From 0d8a7c3c555a83058a29104c7f6ce73d3b64502e Mon Sep 17 00:00:00 2001 From: Andrea Amorese Date: Mon, 20 Dec 2021 10:17:13 +0100 Subject: [PATCH] Built motion from commit 1fbb9c67.|2.5.33 --- apidoc/api_project.js | 2 +- apidoc/api_project.json | 2 +- server/api/action/action.attributes.js | 2 +- server/api/action/action.controller.js | 2 +- server/api/action/action.model.js | 2 +- server/api/action/action.rpc.js | 2 +- server/api/action/index.js | 2 +- .../analyticCustomReport.attributes.js | 2 +- .../analyticCustomReport.controller.js | 2 +- .../analyticCustomReport.model.js | 2 +- .../analyticCustomReport.rpc.js | 2 +- server/api/analyticCustomReport/index.js | 2 +- .../analyticDefaultReport.attributes.js | 2 +- .../analyticDefaultReport.controller.js | 2 +- .../analyticDefaultReport.model.js | 2 +- .../analyticDefaultReport.rpc.js | 2 +- server/api/analyticDefaultReport/index.js | 2 +- .../analyticExtractedReport.attributes.js | 2 +- .../analyticExtractedReport.controller.js | 2 +- .../analyticExtractedReport.model.js | 2 +- .../analyticExtractedReport.rpc.js | 2 +- server/api/analyticExtractedReport/index.js | 2 +- .../analyticFieldReport.attributes.js | 2 +- .../analyticFieldReport.controller.js | 2 +- .../analyticFieldReport.model.js | 2 +- .../analyticFieldReport/analyticFieldReport.rpc.js | 2 +- server/api/analyticFieldReport/index.js | 2 +- .../analyticMetric/analyticMetric.attributes.js | 2 +- .../analyticMetric/analyticMetric.controller.js | 2 +- server/api/analyticMetric/analyticMetric.model.js | 2 +- server/api/analyticMetric/analyticMetric.rpc.js | 2 +- server/api/analyticMetric/index.js | 2 +- .../analyticTreeReport.attributes.js | 2 +- .../analyticTreeReport.controller.js | 2 +- .../analyticTreeReport/analyticTreeReport.model.js | 2 +- .../analyticTreeReport/analyticTreeReport.rpc.js | 2 +- server/api/analyticTreeReport/index.js | 2 +- server/api/attachment/attachment.attributes.js | 2 +- server/api/attachment/attachment.controller.js | 2 +- server/api/attachment/attachment.model.js | 2 +- server/api/attachment/attachment.rpc.js | 2 +- server/api/attachment/index.js | 2 +- server/api/authGoogle/authGoogle.controller.js | 2 +- server/api/authGoogle/index.js | 2 +- server/api/authLocal/authLocal.controller.js | 2 +- server/api/authLocal/index.js | 2 +- server/api/automation/automation.attributes.js | 2 +- server/api/automation/automation.controller.js | 2 +- server/api/automation/automation.model.js | 2 +- server/api/automation/automation.rpc.js | 2 +- server/api/automation/index.js | 2 +- server/api/campaign/campaign.attributes.js | 2 +- server/api/campaign/campaign.controller.js | 2 +- server/api/campaign/campaign.model.js | 2 +- server/api/campaign/campaign.rpc.js | 2 +- server/api/campaign/index.js | 2 +- server/api/cannedAnswer/cannedAnswer.attributes.js | 2 +- server/api/cannedAnswer/cannedAnswer.controller.js | 2 +- server/api/cannedAnswer/cannedAnswer.model.js | 2 +- server/api/cannedAnswer/cannedAnswer.rpc.js | 2 +- server/api/cannedAnswer/index.js | 2 +- server/api/cdr/cdr.attributes.js | 2 +- server/api/cdr/cdr.controller.js | 2 +- server/api/cdr/cdr.model.js | 2 +- server/api/cdr/cdr.rpc.js | 2 +- server/api/cdr/index.js | 2 +- .../chatApplication/chatApplication.attributes.js | 2 +- .../chatApplication/chatApplication.controller.js | 2 +- .../api/chatApplication/chatApplication.model.js | 2 +- server/api/chatApplication/chatApplication.rpc.js | 2 +- server/api/chatApplication/index.js | 2 +- server/api/chatGroup/chatGroup.attributes.js | 2 +- server/api/chatGroup/chatGroup.controller.js | 2 +- server/api/chatGroup/chatGroup.events.js | 2 +- server/api/chatGroup/chatGroup.model.js | 2 +- server/api/chatGroup/chatGroup.rpc.js | 2 +- server/api/chatGroup/chatGroup.socket.js | 2 +- server/api/chatGroup/index.js | 2 +- .../chatInteraction/chatInteraction.attributes.js | 2 +- .../chatInteraction/chatInteraction.controller.js | 2 +- .../api/chatInteraction/chatInteraction.events.js | 2 +- .../api/chatInteraction/chatInteraction.model.js | 2 +- server/api/chatInteraction/chatInteraction.rpc.js | 2 +- .../api/chatInteraction/chatInteraction.socket.js | 2 +- server/api/chatInteraction/index.js | 2 +- .../chatInternalMessage.attributes.js | 2 +- .../chatInternalMessage.controller.js | 2 +- .../chatInternalMessage.events.js | 2 +- .../chatInternalMessage.model.js | 2 +- .../chatInternalMessage/chatInternalMessage.rpc.js | 2 +- .../chatInternalMessage.socket.js | 2 +- server/api/chatInternalMessage/index.js | 2 +- server/api/chatMessage/chatMessage.attributes.js | 2 +- server/api/chatMessage/chatMessage.controller.js | 2 +- server/api/chatMessage/chatMessage.events.js | 2 +- server/api/chatMessage/chatMessage.model.js | 2 +- server/api/chatMessage/chatMessage.rpc.js | 2 +- server/api/chatMessage/chatMessage.socket.js | 2 +- server/api/chatMessage/index.js | 2 +- .../chatOfflineMessage.attributes.js | 2 +- .../chatOfflineMessage.controller.js | 2 +- .../chatOfflineMessage/chatOfflineMessage.model.js | 2 +- .../chatOfflineMessage/chatOfflineMessage.rpc.js | 2 +- server/api/chatOfflineMessage/index.js | 2 +- .../chatProactiveAction.attributes.js | 2 +- .../chatProactiveAction.controller.js | 2 +- .../chatProactiveAction.model.js | 2 +- .../chatProactiveAction/chatProactiveAction.rpc.js | 2 +- server/api/chatProactiveAction/index.js | 2 +- server/api/chatQueue/chatQueue.attributes.js | 2 +- server/api/chatQueue/chatQueue.controller.js | 2 +- server/api/chatQueue/chatQueue.events.js | 2 +- server/api/chatQueue/chatQueue.model.js | 2 +- server/api/chatQueue/chatQueue.rpc.js | 2 +- server/api/chatQueue/chatQueue.socket.js | 2 +- server/api/chatQueue/index.js | 2 +- .../chatQueueReport/chatQueueReport.attributes.js | 2 +- .../chatQueueReport/chatQueueReport.controller.js | 2 +- .../api/chatQueueReport/chatQueueReport.model.js | 2 +- server/api/chatQueueReport/chatQueueReport.rpc.js | 2 +- server/api/chatQueueReport/index.js | 2 +- .../chatTransferReport.attributes.js | 2 +- .../chatTransferReport.controller.js | 2 +- .../chatTransferReport/chatTransferReport.model.js | 2 +- .../chatTransferReport/chatTransferReport.rpc.js | 2 +- server/api/chatTransferReport/index.js | 2 +- server/api/chatWebsite/chatWebsite.attributes.js | 2 +- server/api/chatWebsite/chatWebsite.controller.js | 2 +- server/api/chatWebsite/chatWebsite.events.js | 2 +- server/api/chatWebsite/chatWebsite.model.js | 2 +- server/api/chatWebsite/chatWebsite.rpc.js | 2 +- server/api/chatWebsite/chatWebsite.socket.js | 2 +- server/api/chatWebsite/index.js | 2 +- .../api/cloudProvider/cloudProvider.attributes.js | 2 +- .../api/cloudProvider/cloudProvider.controller.js | 2 +- server/api/cloudProvider/cloudProvider.model.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.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/realtime/realtime.model.js | 2 +- server/api/reportAgentPreview/index.js | 2 +- .../reportAgentPreview.attributes.js | 2 +- .../reportAgentPreview/reportAgentPreview.model.js | 2 +- .../reportAgentPreview/reportAgentPreview.rpc.js | 2 +- server/api/rpc/index.js | 2 +- server/api/rpc/rpc.controller.js | 2 +- server/api/schedule/index.js | 2 +- server/api/schedule/schedule.attributes.js | 2 +- server/api/schedule/schedule.controller.js | 2 +- server/api/schedule/schedule.model.js | 2 +- server/api/schedule/schedule.rpc.js | 2 +- server/api/screenRecording/index.js | 2 +- .../screenRecording/screenRecording.attributes.js | 2 +- .../screenRecording/screenRecording.controller.js | 2 +- .../api/screenRecording/screenRecording.model.js | 2 +- server/api/screenRecording/screenRecording.rpc.js | 2 +- server/api/setting/index.js | 2 +- server/api/setting/setting.attributes.js | 2 +- server/api/setting/setting.controller.js | 2 +- server/api/setting/setting.model.js | 2 +- server/api/setting/setting.rpc.js | 2 +- server/api/smsAccount/index.js | 2 +- server/api/smsAccount/smsAccount.attributes.js | 2 +- server/api/smsAccount/smsAccount.controller.js | 2 +- server/api/smsAccount/smsAccount.events.js | 2 +- server/api/smsAccount/smsAccount.model.js | 2 +- server/api/smsAccount/smsAccount.rpc.js | 2 +- server/api/smsAccount/smsAccount.socket.js | 2 +- server/api/smsApplication/index.js | 2 +- .../smsApplication/smsApplication.attributes.js | 2 +- .../smsApplication/smsApplication.controller.js | 2 +- server/api/smsApplication/smsApplication.model.js | 2 +- server/api/smsApplication/smsApplication.rpc.js | 2 +- server/api/smsInteraction/index.js | 2 +- .../smsInteraction/smsInteraction.attributes.js | 2 +- .../smsInteraction/smsInteraction.controller.js | 2 +- server/api/smsInteraction/smsInteraction.events.js | 2 +- server/api/smsInteraction/smsInteraction.model.js | 2 +- server/api/smsInteraction/smsInteraction.rpc.js | 2 +- server/api/smsInteraction/smsInteraction.socket.js | 2 +- server/api/smsMessage/index.js | 2 +- server/api/smsMessage/smsMessage.attributes.js | 2 +- server/api/smsMessage/smsMessage.controller.js | 2 +- server/api/smsMessage/smsMessage.events.js | 2 +- server/api/smsMessage/smsMessage.model.js | 2 +- server/api/smsMessage/smsMessage.rpc.js | 2 +- server/api/smsMessage/smsMessage.socket.js | 2 +- server/api/smsQueue/index.js | 2 +- server/api/smsQueue/smsQueue.attributes.js | 2 +- server/api/smsQueue/smsQueue.controller.js | 2 +- server/api/smsQueue/smsQueue.events.js | 2 +- server/api/smsQueue/smsQueue.model.js | 2 +- server/api/smsQueue/smsQueue.rpc.js | 2 +- server/api/smsQueue/smsQueue.socket.js | 2 +- server/api/smsQueueReport/index.js | 2 +- .../smsQueueReport/smsQueueReport.attributes.js | 2 +- .../smsQueueReport/smsQueueReport.controller.js | 2 +- server/api/smsQueueReport/smsQueueReport.model.js | 2 +- server/api/smsQueueReport/smsQueueReport.rpc.js | 2 +- server/api/smsTransferReport/index.js | 2 +- .../smsTransferReport.attributes.js | 2 +- .../smsTransferReport.controller.js | 2 +- .../smsTransferReport/smsTransferReport.model.js | 2 +- .../api/smsTransferReport/smsTransferReport.rpc.js | 2 +- server/api/sound/index.js | 2 +- server/api/sound/sound.attributes.js | 2 +- server/api/sound/sound.controller.js | 2 +- server/api/sound/sound.model.js | 2 +- server/api/sound/sound.rpc.js | 2 +- server/api/squareMessage/index.js | 2 +- .../api/squareMessage/squareMessage.attributes.js | 2 +- .../api/squareMessage/squareMessage.controller.js | 2 +- server/api/squareMessage/squareMessage.model.js | 2 +- server/api/squareMessage/squareMessage.rpc.js | 2 +- server/api/squareOdbc/index.js | 2 +- server/api/squareOdbc/squareOdbc.attributes.js | 2 +- server/api/squareOdbc/squareOdbc.controller.js | 2 +- server/api/squareOdbc/squareOdbc.model.js | 2 +- server/api/squareOdbc/squareOdbc.rpc.js | 2 +- server/api/squareProject/index.js | 2 +- .../api/squareProject/squareProject.attributes.js | 2 +- .../api/squareProject/squareProject.controller.js | 2 +- server/api/squareProject/squareProject.events.js | 2 +- server/api/squareProject/squareProject.model.js | 2 +- server/api/squareProject/squareProject.rpc.js | 2 +- server/api/squareProject/squareProject.socket.js | 2 +- server/api/squareRecording/index.js | 2 +- .../squareRecording/squareRecording.attributes.js | 2 +- .../squareRecording/squareRecording.controller.js | 2 +- .../api/squareRecording/squareRecording.model.js | 2 +- server/api/squareRecording/squareRecording.rpc.js | 2 +- server/api/squareReport/index.js | 2 +- server/api/squareReport/squareReport.attributes.js | 2 +- server/api/squareReport/squareReport.controller.js | 2 +- server/api/squareReport/squareReport.model.js | 2 +- server/api/squareReport/squareReport.rpc.js | 2 +- server/api/squareReportDetail/index.js | 2 +- .../squareReportDetail.attributes.js | 2 +- .../squareReportDetail.controller.js | 2 +- .../squareReportDetail/squareReportDetail.model.js | 2 +- .../squareReportDetail/squareReportDetail.rpc.js | 2 +- server/api/system/index.js | 2 +- server/api/system/system.controller.js | 2 +- server/api/tag/index.js | 2 +- server/api/tag/tag.attributes.js | 2 +- server/api/tag/tag.controller.js | 2 +- server/api/tag/tag.model.js | 2 +- server/api/tag/tag.rpc.js | 2 +- server/api/team/index.js | 2 +- server/api/team/team.attributes.js | 2 +- server/api/team/team.controller.js | 2 +- server/api/team/team.events.js | 2 +- server/api/team/team.model.js | 2 +- server/api/team/team.rpc.js | 2 +- server/api/team/team.socket.js | 2 +- server/api/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/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 +- 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/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/license/service.js | 2 +- server/components/parsers/advancedSearch.js | 2 +- server/components/parsers/qs.js | 2 +- server/config/express.js | 2 +- server/config/license/hardware.js | 2 +- server/config/license/index.js | 2 +- server/config/license/util.js | 2 +- server/config/local.env.js | 2 +- server/config/logger.js | 2 +- server/config/pm2/config.js | 2 +- server/config/pm2/index.js | 2 +- server/config/schedule/chat.js | 2 +- server/config/schedule/index.js | 2 +- server/config/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/index.js | 2 +- server/mysqldb/index.js | 2 +- server/routes.js | 2 +- server/rpc/index.js | 2 +- server/services/agi/channel.js | 2 +- server/services/agi/error.js | 2 +- server/services/agi/graph/index.js | 2 +- server/services/agi/index.js | 2 +- server/services/agi/mailRpc/index.js | 2 +- server/services/agi/reply.js | 2 +- server/services/agi/rpc/index.js | 2 +- server/services/agi/scripts/aws/index.js | 2 +- server/services/agi/scripts/aws/lex/index.js | 2 +- server/services/agi/scripts/aws/lex/lib/api.js | 2 +- server/services/agi/scripts/aws/polly/index.js | 2 +- server/services/agi/scripts/aws/polly/lib/api.js | 2 +- server/services/agi/scripts/google/asr/index.js | 2 +- server/services/agi/scripts/google/asr/lib/api.js | 2 +- server/services/agi/scripts/google/index.js | 2 +- server/services/agi/scripts/index.js | 2 +- server/services/agi/scripts/sestek/index.js | 2 +- server/services/agi/scripts/sestek/nda/index.js | 2 +- server/services/agi/scripts/tilde/asr/index.js | 2 +- server/services/agi/scripts/tilde/asr/lib/api.js | 2 +- server/services/agi/scripts/tilde/index.js | 2 +- server/services/agi/server.js | 2 +- server/services/agi/vertices.js | 2 +- server/services/ami/acw/index.js | 2 +- server/services/ami/ami.js | 2 +- server/services/ami/client.js | 2 +- server/services/ami/dialer/action.js | 2 +- server/services/ami/dialer/additionalPhone.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/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 +- 1166 files changed, 1166 insertions(+), 1166 deletions(-) diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 0e6ccb5..4cef21a 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2021-12-20T08:13:10.733Z", + "time": "2021-12-20T08:50:03.282Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index c72d2d8..5d5c7ff 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2021-12-20T08:13:10.733Z", + "time": "2021-12-20T08:50:03.282Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js index ae349ec..8757d24 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 _0x9d99=['bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','motionbar[NULL,NULL,WinAppArguments]','sequelize','exports','VIRTUAL','getDataValue','action','STRING','contactManager','integration','motionbar','jscripty','urlForward','browser'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x9d99,0x1d0));var _0x99d9=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0x9d99[_0x29d915];return _0x160f86;};'use strict';var Sequelize=require(_0x99d9('0x0'));module[_0x99d9('0x1')]={'name':{'type':Sequelize[_0x99d9('0x2')],'get':function(_0x520a86){return this[_0x99d9('0x3')](_0x99d9('0x4'));}},'action':{'type':Sequelize[_0x99d9('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0x99d9('0x6'),_0x99d9('0x7'),_0x99d9('0x8'),_0x99d9('0x9'),_0x99d9('0xa'),_0x99d9('0xb'),_0x99d9('0xc'),_0x99d9('0xd')]],'msg':_0x99d9('0xe')}},'comment':_0x99d9('0xe')},'data1':{'type':Sequelize[_0x99d9('0x5')](0x1000),'comment':'contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]'},'data2':{'type':Sequelize[_0x99d9('0x5')](0x1000),'comment':_0x99d9('0xf')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x99d9('0x10')},'data4':{'type':Sequelize['STRING'](0x1000)},'data5':{'type':Sequelize[_0x99d9('0x5')](0x1000)},'data6':{'type':Sequelize[_0x99d9('0x5')]},'data7':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x7c6c=['motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','motionbar[NULL,NULL,WinAppArguments]','TEXT','sequelize','exports','VIRTUAL','getDataValue','action','STRING','contactManager'];(function(_0x1f2779,_0x5bb117){var _0x22b7bf=function(_0x42516e){while(--_0x42516e){_0x1f2779['push'](_0x1f2779['shift']());}};_0x22b7bf(++_0x5bb117);}(_0x7c6c,0x92));var _0xc7c6=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x7c6c[_0x53ccf2];return _0x5a2964;};'use strict';var Sequelize=require(_0xc7c6('0x0'));module[_0xc7c6('0x1')]={'name':{'type':Sequelize[_0xc7c6('0x2')],'get':function(_0x5a753a){return this[_0xc7c6('0x3')](_0xc7c6('0x4'));}},'action':{'type':Sequelize[_0xc7c6('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0xc7c6('0x6'),'integration',_0xc7c6('0x7'),_0xc7c6('0x8'),_0xc7c6('0x9'),_0xc7c6('0xa'),_0xc7c6('0xb'),_0xc7c6('0xc')]],'msg':_0xc7c6('0xd')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0xc7c6('0x5')](0x1000),'comment':'contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]'},'data2':{'type':Sequelize[_0xc7c6('0x5')](0x1000),'comment':_0xc7c6('0xe')},'data3':{'type':Sequelize[_0xc7c6('0x5')](0x1000),'comment':_0xc7c6('0xf')},'data4':{'type':Sequelize['STRING'](0x1000)},'data5':{'type':Sequelize[_0xc7c6('0x5')](0x1000)},'data6':{'type':Sequelize['STRING']},'data7':{'type':Sequelize[_0xc7c6('0x10')]}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 038dcca..ee12b9a 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 _0x8abe=['Action','find','params','catch','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','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','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','body'];(function(_0x1f472a,_0x501f29){var _0x52ffd2=function(_0x300303){while(--_0x300303){_0x1f472a['push'](_0x1f472a['shift']());}};_0x52ffd2(++_0x501f29);}(_0x8abe,0x64));var _0xe8ab=function(_0x146f98,_0x244654){_0x146f98=_0x146f98-0x0;var _0x3b3be0=_0x8abe[_0x146f98];return _0x3b3be0;};'use strict';var emlformat=require(_0xe8ab('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe8ab('0x1'));var jsonpatch=require(_0xe8ab('0x2'));var rp=require(_0xe8ab('0x3'));var moment=require('moment');var BPromise=require(_0xe8ab('0x4'));var Mustache=require(_0xe8ab('0x5'));var util=require(_0xe8ab('0x6'));var path=require(_0xe8ab('0x7'));var sox=require('sox');var csv=require(_0xe8ab('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe8ab('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xe8ab('0xa'));var jsforce=require(_0xe8ab('0xb'));var deskjs=require(_0xe8ab('0xc'));var toCsv=require(_0xe8ab('0x8'));var querystring=require(_0xe8ab('0xd'));var Papa=require(_0xe8ab('0xe'));var Redis=require('ioredis');var authService=require(_0xe8ab('0xf'));var qs=require(_0xe8ab('0x10'));var as=require(_0xe8ab('0x11'));var hardwareService=require(_0xe8ab('0x12'));var logger=require(_0xe8ab('0x13'))(_0xe8ab('0x14'));var utils=require(_0xe8ab('0x15'));var config=require(_0xe8ab('0x16'));var licenseUtil=require(_0xe8ab('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c2fdc,_0x21e058){_0x21e058=_0x21e058||0xcc;return function(_0x469a03){if(_0x469a03){return _0x3c2fdc[_0xe8ab('0x18')](_0x21e058);}return _0x3c2fdc[_0xe8ab('0x19')](_0x21e058)[_0xe8ab('0x1a')]();};}function respondWithResult(_0x4bfd9e,_0x15c7af){_0x15c7af=_0x15c7af||0xc8;return function(_0x4e864c){if(_0x4e864c){return _0x4bfd9e[_0xe8ab('0x19')](_0x15c7af)[_0xe8ab('0x1b')](_0x4e864c);}};}function respondWithFilteredResult(_0x228ea2,_0x6641c){return function(_0x5b894a){if(_0x5b894a){var _0x1e127e=typeof _0x6641c['offset']===_0xe8ab('0x1c')&&typeof _0x6641c[_0xe8ab('0x1d')]===_0xe8ab('0x1c');var _0xfb16c=_0x5b894a[_0xe8ab('0x1e')];var _0x4f36e2=_0x1e127e?0x0:_0x6641c[_0xe8ab('0x1f')];var _0x1a3a28=_0x1e127e?_0x5b894a['count']:_0x6641c[_0xe8ab('0x1f')]+_0x6641c[_0xe8ab('0x1d')];var _0x2f1c9b;if(_0x1a3a28>=_0xfb16c){_0x1a3a28=_0xfb16c;_0x2f1c9b=0xc8;}else{_0x2f1c9b=0xce;}_0x228ea2['status'](_0x2f1c9b);return _0x228ea2[_0xe8ab('0x20')](_0xe8ab('0x21'),_0x4f36e2+'-'+_0x1a3a28+'/'+_0xfb16c)[_0xe8ab('0x1b')](_0x5b894a);}return null;};}function patchUpdates(_0x363c76){return function(_0x3d9550){try{jsonpatch[_0xe8ab('0x22')](_0x3d9550,_0x363c76,!![]);}catch(_0x4b9da6){return BPromise[_0xe8ab('0x23')](_0x4b9da6);}return _0x3d9550[_0xe8ab('0x24')]();};}function saveUpdates(_0x17e4e1,_0x6ee0aa){return function(_0x3dd225){if(_0x3dd225){return _0x3dd225[_0xe8ab('0x25')](_0x17e4e1)[_0xe8ab('0x26')](function(_0x459fa1){return _0x459fa1;});}return null;};}function removeEntity(_0x245709,_0x2f8713){return function(_0x2fa240){if(_0x2fa240){return _0x2fa240[_0xe8ab('0x27')]()[_0xe8ab('0x26')](function(){_0x245709[_0xe8ab('0x19')](0xcc)[_0xe8ab('0x1a')]();});}};}function handleEntityNotFound(_0x497b1d,_0x325c84){return function(_0x1daeae){if(!_0x1daeae){_0x497b1d[_0xe8ab('0x18')](0x194);}return _0x1daeae;};}function handleError(_0x2eabcf,_0x643cc5){_0x643cc5=_0x643cc5||0x1f4;return function(_0x329e8e){logger['error'](_0x329e8e[_0xe8ab('0x28')]);if(_0x329e8e[_0xe8ab('0x29')]){delete _0x329e8e['name'];}_0x2eabcf['status'](_0x643cc5)[_0xe8ab('0x2a')](_0x329e8e);};}exports[_0xe8ab('0x25')]=function(_0x10d383,_0x9162ee){if(_0x10d383[_0xe8ab('0x2b')]['id']){delete _0x10d383[_0xe8ab('0x2b')]['id'];}return db[_0xe8ab('0x2c')][_0xe8ab('0x2d')]({'where':{'id':_0x10d383[_0xe8ab('0x2e')]['id']}})[_0xe8ab('0x26')](handleEntityNotFound(_0x9162ee,null))['then'](saveUpdates(_0x10d383[_0xe8ab('0x2b')],null))[_0xe8ab('0x26')](respondWithResult(_0x9162ee,null))[_0xe8ab('0x2f')](handleError(_0x9162ee,null));};exports[_0xe8ab('0x27')]=function(_0x462874,_0x5896fc){return db[_0xe8ab('0x2c')][_0xe8ab('0x2d')]({'where':{'id':_0x462874['params']['id']}})[_0xe8ab('0x26')](handleEntityNotFound(_0x5896fc,null))[_0xe8ab('0x26')](removeEntity(_0x5896fc,null))[_0xe8ab('0x2f')](handleError(_0x5896fc,null));}; \ No newline at end of file +var _0xdf8f=['limit','undefined','count','Content-Range','json','apply','save','then','destroy','error','stack','name','send','update','body','Action','find','params','catch','eml-format','zip-dir','fast-json-patch','moment','mustache','util','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/license/util','sendStatus','status','end','offset'];(function(_0x120e6a,_0x3b7409){var _0x3d427c=function(_0x271988){while(--_0x271988){_0x120e6a['push'](_0x120e6a['shift']());}};_0x3d427c(++_0x3b7409);}(_0xdf8f,0x12d));var _0xfdf8=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xdf8f[_0x40a045];return _0x1a687c;};'use strict';var emlformat=require(_0xfdf8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfdf8('0x1'));var jsonpatch=require(_0xfdf8('0x2'));var rp=require('request-promise');var moment=require(_0xfdf8('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xfdf8('0x4'));var util=require(_0xfdf8('0x5'));var path=require('path');var sox=require(_0xfdf8('0x6'));var csv=require(_0xfdf8('0x7'));var ejs=require(_0xfdf8('0x8'));var fs=require('fs');var fs_extra=require(_0xfdf8('0x9'));var _=require('lodash');var squel=require(_0xfdf8('0xa'));var crypto=require(_0xfdf8('0xb'));var jsforce=require(_0xfdf8('0xc'));var deskjs=require(_0xfdf8('0xd'));var toCsv=require(_0xfdf8('0x7'));var querystring=require(_0xfdf8('0xe'));var Papa=require(_0xfdf8('0xf'));var Redis=require(_0xfdf8('0x10'));var authService=require(_0xfdf8('0x11'));var qs=require(_0xfdf8('0x12'));var as=require(_0xfdf8('0x13'));var hardwareService=require(_0xfdf8('0x14'));var logger=require(_0xfdf8('0x15'))(_0xfdf8('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xfdf8('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x14794c,_0x4d1ba1){_0x4d1ba1=_0x4d1ba1||0xcc;return function(_0x140022){if(_0x140022){return _0x14794c[_0xfdf8('0x18')](_0x4d1ba1);}return _0x14794c[_0xfdf8('0x19')](_0x4d1ba1)[_0xfdf8('0x1a')]();};}function respondWithResult(_0x53cfa3,_0x57fef8){_0x57fef8=_0x57fef8||0xc8;return function(_0x684eb2){if(_0x684eb2){return _0x53cfa3[_0xfdf8('0x19')](_0x57fef8)['json'](_0x684eb2);}};}function respondWithFilteredResult(_0x24840e,_0xb1797e){return function(_0x2dc343){if(_0x2dc343){var _0x307218=typeof _0xb1797e[_0xfdf8('0x1b')]==='undefined'&&typeof _0xb1797e[_0xfdf8('0x1c')]===_0xfdf8('0x1d');var _0x2b98b4=_0x2dc343['count'];var _0x4a6c11=_0x307218?0x0:_0xb1797e[_0xfdf8('0x1b')];var _0x17e6b3=_0x307218?_0x2dc343[_0xfdf8('0x1e')]:_0xb1797e[_0xfdf8('0x1b')]+_0xb1797e[_0xfdf8('0x1c')];var _0x490e1e;if(_0x17e6b3>=_0x2b98b4){_0x17e6b3=_0x2b98b4;_0x490e1e=0xc8;}else{_0x490e1e=0xce;}_0x24840e['status'](_0x490e1e);return _0x24840e['set'](_0xfdf8('0x1f'),_0x4a6c11+'-'+_0x17e6b3+'/'+_0x2b98b4)[_0xfdf8('0x20')](_0x2dc343);}return null;};}function patchUpdates(_0x23f818){return function(_0x3b538b){try{jsonpatch[_0xfdf8('0x21')](_0x3b538b,_0x23f818,!![]);}catch(_0x86954e){return BPromise['reject'](_0x86954e);}return _0x3b538b[_0xfdf8('0x22')]();};}function saveUpdates(_0x161ae6,_0x5b580c){return function(_0x59e4ff){if(_0x59e4ff){return _0x59e4ff['update'](_0x161ae6)[_0xfdf8('0x23')](function(_0x233c3d){return _0x233c3d;});}return null;};}function removeEntity(_0x42b14b,_0x467612){return function(_0x43bd13){if(_0x43bd13){return _0x43bd13[_0xfdf8('0x24')]()[_0xfdf8('0x23')](function(){_0x42b14b[_0xfdf8('0x19')](0xcc)[_0xfdf8('0x1a')]();});}};}function handleEntityNotFound(_0x510573,_0xd04640){return function(_0x4836af){if(!_0x4836af){_0x510573['sendStatus'](0x194);}return _0x4836af;};}function handleError(_0x3c26b2,_0x28502b){_0x28502b=_0x28502b||0x1f4;return function(_0x536c34){logger[_0xfdf8('0x25')](_0x536c34[_0xfdf8('0x26')]);if(_0x536c34['name']){delete _0x536c34[_0xfdf8('0x27')];}_0x3c26b2['status'](_0x28502b)[_0xfdf8('0x28')](_0x536c34);};}exports[_0xfdf8('0x29')]=function(_0x4a8e9,_0x6b46c0){if(_0x4a8e9[_0xfdf8('0x2a')]['id']){delete _0x4a8e9[_0xfdf8('0x2a')]['id'];}return db[_0xfdf8('0x2b')][_0xfdf8('0x2c')]({'where':{'id':_0x4a8e9[_0xfdf8('0x2d')]['id']}})[_0xfdf8('0x23')](handleEntityNotFound(_0x6b46c0,null))[_0xfdf8('0x23')](saveUpdates(_0x4a8e9[_0xfdf8('0x2a')],null))[_0xfdf8('0x23')](respondWithResult(_0x6b46c0,null))[_0xfdf8('0x2e')](handleError(_0x6b46c0,null));};exports[_0xfdf8('0x24')]=function(_0x4d74f5,_0xbcf9ad){return db['Action'][_0xfdf8('0x2c')]({'where':{'id':_0x4d74f5[_0xfdf8('0x2d')]['id']}})[_0xfdf8('0x23')](handleEntityNotFound(_0xbcf9ad,null))[_0xfdf8('0x23')](removeEntity(_0xbcf9ad,null))[_0xfdf8('0x2e')](handleError(_0xbcf9ad,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index fd4321e..90f256a 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 _0x66bf=['tools_actions','lodash','util','../../config/logger','api','bluebird','rimraf','../../config/environment','./action.attributes','exports','define','Action'];(function(_0x371a1d,_0x3591f3){var _0x4ba340=function(_0x57cfbc){while(--_0x57cfbc){_0x371a1d['push'](_0x371a1d['shift']());}};_0x4ba340(++_0x3591f3);}(_0x66bf,0x1c9));var _0xf66b=function(_0x36a06a,_0x1e480a){_0x36a06a=_0x36a06a-0x0;var _0x12cba9=_0x66bf[_0x36a06a];return _0x12cba9;};'use strict';var _=require(_0xf66b('0x0'));var util=require(_0xf66b('0x1'));var logger=require(_0xf66b('0x2'))(_0xf66b('0x3'));var moment=require('moment');var BPromise=require(_0xf66b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf66b('0x5'));var config=require(_0xf66b('0x6'));var attributes=require(_0xf66b('0x7'));module[_0xf66b('0x8')]=function(_0x4e31b6,_0x30617f){return _0x4e31b6[_0xf66b('0x9')](_0xf66b('0xa'),attributes,{'tableName':_0xf66b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5862=['api','moment','path','rimraf','../../config/environment','exports','Action','lodash'];(function(_0xc90268,_0x67396a){var _0xb001f1=function(_0x399ed8){while(--_0x399ed8){_0xc90268['push'](_0xc90268['shift']());}};_0xb001f1(++_0x67396a);}(_0x5862,0x137));var _0x2586=function(_0x487f15,_0x1cf5fb){_0x487f15=_0x487f15-0x0;var _0x32c8a1=_0x5862[_0x487f15];return _0x32c8a1;};'use strict';var _=require(_0x2586('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2586('0x1'));var moment=require(_0x2586('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2586('0x3'));var rimraf=require(_0x2586('0x4'));var config=require(_0x2586('0x5'));var attributes=require('./action.attributes');module[_0x2586('0x6')]=function(_0x4ed0ec,_0x10e111){return _0x4ed0ec['define'](_0x2586('0x7'),attributes,{'tableName':'tools_actions','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 b770e26..a8b1390 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 _0x53ec=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0x17928f,_0x4ad33f){var _0x500b63=function(_0x127644){while(--_0x127644){_0x17928f['push'](_0x17928f['shift']());}};_0x500b63(++_0x4ad33f);}(_0x53ec,0x192));var _0xc53e=function(_0x614ef4,_0x28a060){_0x614ef4=_0x614ef4-0x0;var _0x35e8e2=_0x53ec[_0x614ef4];return _0x35e8e2;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var moment=require(_0xc53e('0x2'));var BPromise=require(_0xc53e('0x3'));var rs=require(_0xc53e('0x4'));var fs=require('fs');var Redis=require(_0xc53e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc53e('0x6'));var logger=require('../../config/logger')(_0xc53e('0x7'));var config=require(_0xc53e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc53e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41a9e8,_0x2de88b,_0x5d3b28){return new BPromise(function(_0x1616ac,_0x1ac6c0){return client[_0xc53e('0xa')](_0x41a9e8,_0x5d3b28)[_0xc53e('0xb')](function(_0xd9612){logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));logger[_0xc53e('0xf')]('Action,\x20%s,\x20%s,\x20%s',_0x2de88b,'request\x20sent',JSON[_0xc53e('0x10')](_0xd9612));if(_0xd9612['error']){if(_0xd9612['error'][_0xc53e('0x11')]===0x1f4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')]['message']);return _0x1ac6c0(_0xd9612['error'][_0xc53e('0x13')]);}logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);return _0x1616ac(_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);}else{logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));_0x1616ac(_0xd9612['result'][_0xc53e('0x13')]);}})[_0xc53e('0x14')](function(_0x535cd4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0x535cd4);_0x1ac6c0(_0x535cd4);});});} \ No newline at end of file +var _0x7217=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Action,\x20%s,\x20%s','debug','Action,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7217,0x19e));var _0x7721=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x7217[_0xf50820];return _0x2a9b10;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('Action,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index deb0b89..267a13c 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 _0x8e17=['put','/:id','update','delete','isAuthenticated','destroy','exports','multer','path','express','../../components/interaction/service','./action.controller'];(function(_0x40dcd1,_0x5cd1da){var _0x5c056b=function(_0x87a3a7){while(--_0x87a3a7){_0x40dcd1['push'](_0x40dcd1['shift']());}};_0x5c056b(++_0x5cd1da);}(_0x8e17,0xa3));var _0x78e1=function(_0x44d29e,_0x56835c){_0x44d29e=_0x44d29e-0x0;var _0x59224e=_0x8e17[_0x44d29e];return _0x59224e;};'use strict';var multer=require(_0x78e1('0x0'));var util=require('util');var path=require(_0x78e1('0x1'));var timeout=require('connect-timeout');var express=require(_0x78e1('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x78e1('0x3'));var config=require('../../config/environment');var controller=require(_0x78e1('0x4'));router[_0x78e1('0x5')](_0x78e1('0x6'),auth['isAuthenticated'](),controller[_0x78e1('0x7')]);router[_0x78e1('0x8')]('/:id',auth[_0x78e1('0x9')](),controller[_0x78e1('0xa')]);module[_0x78e1('0xb')]=router; \ No newline at end of file +var _0xc5d2=['../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','isAuthenticated','update','delete','/:id','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x5cd79d,_0x12afd7){var _0x1f62c7=function(_0x54c845){while(--_0x54c845){_0x5cd79d['push'](_0x5cd79d['shift']());}};_0x1f62c7(++_0x12afd7);}(_0xc5d2,0x1ea));var _0x2c5d=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xc5d2[_0x1da04e];return _0xdd8c41;};'use strict';var multer=require(_0x2c5d('0x0'));var util=require(_0x2c5d('0x1'));var path=require('path');var timeout=require(_0x2c5d('0x2'));var express=require(_0x2c5d('0x3'));var router=express[_0x2c5d('0x4')]();var fs_extra=require(_0x2c5d('0x5'));var auth=require(_0x2c5d('0x6'));var interaction=require(_0x2c5d('0x7'));var config=require(_0x2c5d('0x8'));var controller=require(_0x2c5d('0x9'));router['put']('/:id',auth[_0x2c5d('0xa')](),controller[_0x2c5d('0xb')]);router[_0x2c5d('0xc')](_0x2c5d('0xd'),auth[_0x2c5d('0xa')](),controller[_0x2c5d('0xe')]);module[_0x2c5d('0xf')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index bb71173..8de6752 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 _0x425d=['sequelize','STRING','TEXT'];(function(_0x100c9c,_0x2183f3){var _0x566727=function(_0x2d4972){while(--_0x2d4972){_0x100c9c['push'](_0x100c9c['shift']());}};_0x566727(++_0x2183f3);}(_0x425d,0x1e0));var _0xd425=function(_0x8f7825,_0xaa0ca0){_0x8f7825=_0x8f7825-0x0;var _0x29a7c9=_0x425d[_0x8f7825];return _0x29a7c9;};'use strict';var Sequelize=require(_0xd425('0x0'));module['exports']={'name':{'type':Sequelize[_0xd425('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xd425('0x1')]},'parent':{'type':Sequelize[_0xd425('0x1')]},'table':{'type':Sequelize[_0xd425('0x1')]},'conditions':{'type':Sequelize[_0xd425('0x2')]},'joins':{'type':Sequelize[_0xd425('0x2')]}}; \ No newline at end of file +var _0x7dfd=['STRING','TEXT','sequelize','exports'];(function(_0x21a2b4,_0x3109fa){var _0x2da560=function(_0x298a79){while(--_0x298a79){_0x21a2b4['push'](_0x21a2b4['shift']());}};_0x2da560(++_0x3109fa);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd7df('0x0'));module[_0xd7df('0x1')]={'name':{'type':Sequelize[_0xd7df('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xd7df('0x2')]},'parent':{'type':Sequelize[_0xd7df('0x2')]},'table':{'type':Sequelize[_0xd7df('0x2')]},'conditions':{'type':Sequelize[_0xd7df('0x3')]},'joins':{'type':Sequelize[_0xd7df('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index d7e9c28..edf19cf 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 _0x58db=['findAll','%s.%s\x20=\x20%s.%s','output','web','%s-%s.%s','randomstring','generate','csv','AnalyticExtractedReport','cdr','startDate','endDate','info','Run\x20Query:','fork','../../components/export/','../../files/reports','savename','toString','countTable','COUNT(*)','SELECT','run','runReport','AnalyticMetric','groupBy','clone','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','dbH','sendStatus','status','offset','undefined','limit','count','json','apply','reject','then','destroy','CustomReports','UserProfileResource','error','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','options','includeAll','rows','catch','show','params','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','update','body','join','left_join','right_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','order','DESC','alias','joins','parse','foreignKey','foreignTable','parentKey','conditions','debug','Limited\x20Query:','sequelize','QueryTypes','cross_join','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','operator','Sequelize'];(function(_0xab1d90,_0x4fb07f){var _0x2965d7=function(_0x43057c){while(--_0x43057c){_0xab1d90['push'](_0xab1d90['shift']());}};_0x2965d7(++_0x4fb07f);}(_0x58db,0x161));var _0xb58d=function(_0x1dcab6,_0x454e59){_0x1dcab6=_0x1dcab6-0x0;var _0x1d7dc1=_0x58db[_0x1dcab6];return _0x1d7dc1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb58d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb58d('0x1'));var rp=require('request-promise');var moment=require(_0xb58d('0x2'));var BPromise=require(_0xb58d('0x3'));var Mustache=require('mustache');var util=require(_0xb58d('0x4'));var path=require(_0xb58d('0x5'));var sox=require(_0xb58d('0x6'));var csv=require(_0xb58d('0x7'));var ejs=require(_0xb58d('0x8'));var fs=require('fs');var fs_extra=require(_0xb58d('0x9'));var _=require(_0xb58d('0xa'));var squel=require(_0xb58d('0xb'));var crypto=require(_0xb58d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb58d('0xd'));var toCsv=require(_0xb58d('0x7'));var querystring=require(_0xb58d('0xe'));var Papa=require(_0xb58d('0xf'));var Redis=require(_0xb58d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xb58d('0x11'));var as=require(_0xb58d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb58d('0x13'))(_0xb58d('0x14'));var utils=require(_0xb58d('0x15'));var config=require(_0xb58d('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xb58d('0x17'))['db'];var dbH=require(_0xb58d('0x17'))[_0xb58d('0x18')];function respondWithStatusCode(_0x121ddd,_0x451a3d){_0x451a3d=_0x451a3d||0xcc;return function(_0x1f98a3){if(_0x1f98a3){return _0x121ddd[_0xb58d('0x19')](_0x451a3d);}return _0x121ddd[_0xb58d('0x1a')](_0x451a3d)['end']();};}function respondWithResult(_0x222648,_0x189cf0){_0x189cf0=_0x189cf0||0xc8;return function(_0x47e05a){if(_0x47e05a){return _0x222648[_0xb58d('0x1a')](_0x189cf0)['json'](_0x47e05a);}};}function respondWithFilteredResult(_0x6d8cc3,_0x83db1e){return function(_0x32078a){if(_0x32078a){var _0x4509bc=typeof _0x83db1e[_0xb58d('0x1b')]===_0xb58d('0x1c')&&typeof _0x83db1e[_0xb58d('0x1d')]==='undefined';var _0x470738=_0x32078a[_0xb58d('0x1e')];var _0x2d9f5e=_0x4509bc?0x0:_0x83db1e[_0xb58d('0x1b')];var _0x370e83=_0x4509bc?_0x32078a[_0xb58d('0x1e')]:_0x83db1e[_0xb58d('0x1b')]+_0x83db1e['limit'];var _0x351e53;if(_0x370e83>=_0x470738){_0x370e83=_0x470738;_0x351e53=0xc8;}else{_0x351e53=0xce;}_0x6d8cc3[_0xb58d('0x1a')](_0x351e53);return _0x6d8cc3['set']('Content-Range',_0x2d9f5e+'-'+_0x370e83+'/'+_0x470738)[_0xb58d('0x1f')](_0x32078a);}return null;};}function patchUpdates(_0x3a0fdb){return function(_0x4acd8e){try{jsonpatch[_0xb58d('0x20')](_0x4acd8e,_0x3a0fdb,!![]);}catch(_0x3273c0){return BPromise[_0xb58d('0x21')](_0x3273c0);}return _0x4acd8e['save']();};}function saveUpdates(_0x40afff,_0x2c5d1a){return function(_0x297c51){if(_0x297c51){return _0x297c51['update'](_0x40afff)[_0xb58d('0x22')](function(_0x12973f){return _0x12973f;});}return null;};}function removeEntity(_0x22bbbc,_0x905ea7){return function(_0x3a32d4){if(_0x3a32d4){return _0x3a32d4[_0xb58d('0x23')]()[_0xb58d('0x22')](function(){var _0x2ae9fa=_0x3a32d4['get']({'plain':!![]});var _0x207fe3=_0xb58d('0x24');return db[_0xb58d('0x25')][_0xb58d('0x23')]({'where':{'type':_0x207fe3,'resourceId':_0x2ae9fa['id']}})['then'](function(){return _0x3a32d4;});})[_0xb58d('0x22')](function(){_0x22bbbc[_0xb58d('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x334bad,_0x59e48a){return function(_0x166e82){if(!_0x166e82){_0x334bad[_0xb58d('0x19')](0x194);}return _0x166e82;};}function handleError(_0x395a0c,_0x5770ad){_0x5770ad=_0x5770ad||0x1f4;return function(_0x2acee6){logger[_0xb58d('0x26')](_0x2acee6[_0xb58d('0x27')]);if(_0x2acee6[_0xb58d('0x28')]){delete _0x2acee6[_0xb58d('0x28')];}_0x395a0c[_0xb58d('0x1a')](_0x5770ad)[_0xb58d('0x29')](_0x2acee6);};}exports[_0xb58d('0x2a')]=function(_0x5aa1bb,_0x81c377){var _0x61b0a5={},_0x5c5b9c={},_0x56adf6={'count':0x0,'rows':[]};var _0x24a3a9=_[_0xb58d('0x2b')](db[_0xb58d('0x2c')][_0xb58d('0x2d')],function(_0x3fb970){return{'name':_0x3fb970['fieldName'],'type':_0x3fb970[_0xb58d('0x2e')][_0xb58d('0x2f')]};});_0x5c5b9c[_0xb58d('0x30')]=_['map'](_0x24a3a9,_0xb58d('0x28'));_0x5c5b9c[_0xb58d('0x31')]=_[_0xb58d('0x32')](_0x5aa1bb[_0xb58d('0x31')]);_0x5c5b9c['filters']=_[_0xb58d('0x33')](_0x5c5b9c[_0xb58d('0x30')],_0x5c5b9c[_0xb58d('0x31')]);_0x61b0a5[_0xb58d('0x34')]=_[_0xb58d('0x33')](_0x5c5b9c[_0xb58d('0x30')],qs[_0xb58d('0x35')](_0x5aa1bb[_0xb58d('0x31')][_0xb58d('0x35')]));_0x61b0a5[_0xb58d('0x34')]=_0x61b0a5[_0xb58d('0x34')][_0xb58d('0x36')]?_0x61b0a5['attributes']:_0x5c5b9c[_0xb58d('0x30')];if(!_0x5aa1bb[_0xb58d('0x31')][_0xb58d('0x37')](_0xb58d('0x38'))){_0x61b0a5[_0xb58d('0x1d')]=qs[_0xb58d('0x1d')](_0x5aa1bb[_0xb58d('0x31')]['limit']);_0x61b0a5[_0xb58d('0x1b')]=qs[_0xb58d('0x1b')](_0x5aa1bb[_0xb58d('0x31')][_0xb58d('0x1b')]);}_0x61b0a5['order']=qs[_0xb58d('0x39')](_0x5aa1bb[_0xb58d('0x31')][_0xb58d('0x39')]);_0x61b0a5['where']=qs[_0xb58d('0x3a')](_[_0xb58d('0x3b')](_0x5aa1bb[_0xb58d('0x31')],_0x5c5b9c[_0xb58d('0x3a')]),_0x24a3a9);if(_0x5aa1bb['query'][_0xb58d('0x3c')]){_0x61b0a5[_0xb58d('0x3d')]=_[_0xb58d('0x3e')](_0x61b0a5[_0xb58d('0x3d')],{'$or':_[_0xb58d('0x2b')](_0x24a3a9,function(_0x3c7228){if(_0x3c7228[_0xb58d('0x2e')]!=='VIRTUAL'){var _0x30b1cf={};_0x30b1cf[_0x3c7228[_0xb58d('0x28')]]={'$like':'%'+_0x5aa1bb[_0xb58d('0x31')][_0xb58d('0x3c')]+'%'};return _0x30b1cf;}})});}_0x61b0a5=_[_0xb58d('0x3e')]({},_0x61b0a5,_0x5aa1bb[_0xb58d('0x3f')]);var _0x4e2c5e={'where':_0x61b0a5['where']};return db['AnalyticCustomReport']['count'](_0x4e2c5e)[_0xb58d('0x22')](function(_0x5a8817){_0x56adf6['count']=_0x5a8817;if(_0x5aa1bb['query'][_0xb58d('0x40')]){_0x61b0a5['include']=[{'all':!![]}];}return db['AnalyticCustomReport']['findAll'](_0x61b0a5);})[_0xb58d('0x22')](function(_0x49a396){_0x56adf6[_0xb58d('0x41')]=_0x49a396;return _0x56adf6;})[_0xb58d('0x22')](respondWithFilteredResult(_0x81c377,_0x61b0a5))[_0xb58d('0x42')](handleError(_0x81c377,null));};exports[_0xb58d('0x43')]=function(_0x366c14,_0x8eec1){var _0x8e060c={'raw':![],'where':{'id':_0x366c14[_0xb58d('0x44')]['id']}},_0x34f3c5={};_0x34f3c5[_0xb58d('0x30')]=_['keys'](db[_0xb58d('0x2c')][_0xb58d('0x2d')]);_0x34f3c5['query']=_[_0xb58d('0x32')](_0x366c14[_0xb58d('0x31')]);_0x34f3c5[_0xb58d('0x3a')]=_[_0xb58d('0x33')](_0x34f3c5[_0xb58d('0x30')],_0x34f3c5[_0xb58d('0x31')]);_0x8e060c[_0xb58d('0x34')]=_['intersection'](_0x34f3c5[_0xb58d('0x30')],qs[_0xb58d('0x35')](_0x366c14['query'][_0xb58d('0x35')]));_0x8e060c[_0xb58d('0x34')]=_0x8e060c[_0xb58d('0x34')][_0xb58d('0x36')]?_0x8e060c[_0xb58d('0x34')]:_0x34f3c5['model'];if(_0x366c14[_0xb58d('0x31')][_0xb58d('0x40')]){_0x8e060c['include']=[{'all':!![]}];}_0x8e060c=_['merge']({},_0x8e060c,_0x366c14[_0xb58d('0x3f')]);return db['AnalyticCustomReport'][_0xb58d('0x45')](_0x8e060c)[_0xb58d('0x22')](handleEntityNotFound(_0x8eec1,null))[_0xb58d('0x22')](respondWithResult(_0x8eec1,null))[_0xb58d('0x42')](handleError(_0x8eec1,null));};exports['create']=function(_0x493b5c,_0x39398c){return db[_0xb58d('0x2c')][_0xb58d('0x46')](_0x493b5c['body'],{})[_0xb58d('0x22')](function(_0x262778){var _0x3fe6c5=_0x493b5c['user'][_0xb58d('0x47')]({'plain':!![]});if(!_0x3fe6c5)throw new Error(_0xb58d('0x48'));if(_0x3fe6c5[_0xb58d('0x49')]===_0xb58d('0x4a')){var _0x194e2d=_0x262778[_0xb58d('0x47')]({'plain':!![]});var _0x3c2fe5='Reports';return db[_0xb58d('0x4b')][_0xb58d('0x45')]({'where':{'name':_0x3c2fe5,'userProfileId':_0x3fe6c5[_0xb58d('0x4c')]},'raw':!![]})['then'](function(_0x3ff890){if(_0x3ff890&&_0x3ff890[_0xb58d('0x4d')]===0x0){return db[_0xb58d('0x25')][_0xb58d('0x46')]({'name':_0x194e2d[_0xb58d('0x28')],'resourceId':_0x194e2d['id'],'type':'CustomReports','sectionId':_0x3ff890['id']},{})[_0xb58d('0x22')](function(){return _0x262778;});}else{return _0x262778;}})[_0xb58d('0x42')](function(_0x110846){logger[_0xb58d('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x110846);throw _0x110846;});}return _0x262778;})[_0xb58d('0x22')](respondWithResult(_0x39398c,0xc9))[_0xb58d('0x42')](handleError(_0x39398c,null));};exports[_0xb58d('0x4e')]=function(_0x4b1e6f,_0x1d0ec5){if(_0x4b1e6f['body']['id']){delete _0x4b1e6f[_0xb58d('0x4f')]['id'];}return db['AnalyticCustomReport']['find']({'where':{'id':_0x4b1e6f[_0xb58d('0x44')]['id']}})[_0xb58d('0x22')](handleEntityNotFound(_0x1d0ec5,null))[_0xb58d('0x22')](saveUpdates(_0x4b1e6f[_0xb58d('0x4f')],null))[_0xb58d('0x22')](respondWithResult(_0x1d0ec5,null))[_0xb58d('0x42')](handleError(_0x1d0ec5,null));};exports[_0xb58d('0x23')]=function(_0x16d915,_0xc23802){return db[_0xb58d('0x2c')][_0xb58d('0x45')]({'where':{'id':_0x16d915['params']['id']}})[_0xb58d('0x22')](handleEntityNotFound(_0xc23802,null))[_0xb58d('0x22')](removeEntity(_0xc23802,null))['catch'](handleError(_0xc23802,null));};exports['preview']=function(_0x5cb697,_0x1c0cd3){var _0xdad07b=0xa;var _0x4173d1=[_0xb58d('0x50'),_0xb58d('0x51'),_0xb58d('0x52'),'cross_join'];var _0x142781={'SUM':_0xb58d('0x53'),'COUNT':_0xb58d('0x54'),'COUNT DISTINCT':_0xb58d('0x55'),'MAX':_0xb58d('0x56'),'MIN':_0xb58d('0x57'),'AVG':_0xb58d('0x58'),'GROUP_CONCAT':_0xb58d('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xb58d('0x5a')};var _0x22bc2c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xb58d('0x5b'),'HOUR':_0xb58d('0x5c'),'ROUND':_0xb58d('0x5d'),'UNIX_TIMESTAMP':_0xb58d('0x5e')};var _0x209664=function(_0x4ef979){return!_[_0xb58d('0x5f')](['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY',_0xb58d('0x60')],_0x4ef979);};var _0x17ef31=function(_0x444a77){if(!_0x444a77||!_0x444a77[_0xb58d('0x61')][_0xb58d('0x36')]){return'';}for(var _0x499c67='(',_0x5814bd=0x0;_0x5814bd<_0x444a77[_0xb58d('0x61')][_0xb58d('0x36')];_0x5814bd+=0x1){_0x5814bd>0x0&&(_0x499c67+='\x20'+_0x444a77['operator']+'\x20');_0x499c67+=_0x444a77[_0xb58d('0x61')][_0x5814bd][_0xb58d('0x62')]?_0x17ef31(_0x444a77['rules'][_0x5814bd]['group']):_0x444a77[_0xb58d('0x61')][_0x5814bd][_0xb58d('0x63')]+'\x20'+_0x444a77['rules'][_0x5814bd][_0xb58d('0x64')]+(_0x209664(_0x444a77[_0xb58d('0x61')][_0x5814bd][_0xb58d('0x64')])?'\x20'+_0x444a77[_0xb58d('0x61')][_0x5814bd][_0xb58d('0x65')]:'');}return _0x499c67+')';};var _0x2ae01f={'where':{'id':_0x5cb697[_0xb58d('0x44')]['id']}},_0x1c9524,_0xc062fe,_0x1e9228,_0x2bf942,_0x259bdb;_0x2ae01f=_[_0xb58d('0x3e')]({},_0x2ae01f,_0x5cb697[_0xb58d('0x3f')]);return db[_0xb58d('0x2c')][_0xb58d('0x45')](_0x2ae01f)['then'](function(_0x86113d){if(_0x86113d){_0x1c9524=_0x86113d;return _0x86113d[_0xb58d('0x66')]();}return null;})['then'](function(_0x3312cd){if(_0x3312cd){if(!_0x3312cd[_0xb58d('0x36')]){throw new db['Sequelize'][(_0xb58d('0x67'))](_0xb58d('0x68'),0x193);}_0xc062fe=_0x3312cd;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xb58d('0x22')](function(_0x219b46){if(_0x219b46){_0x1e9228=_[_0xb58d('0x69')](_0x219b46,'id');var _0x12b760;var _0x6f2eb=squel[_0xb58d('0x6a')]();_0x6f2eb[_0xb58d('0x6b')](_0x1c9524[_0xb58d('0x6c')]);for(var _0x4f5fff=0x0;_0x4f5fff<_0xc062fe[_0xb58d('0x36')];_0x4f5fff+=0x1){_0x12b760=_0xc062fe[_0x4f5fff][_0xb58d('0x6d')]?_0x1e9228[_0xc062fe[_0x4f5fff]['MetricId']][_0xb58d('0x6e')]:_0xc062fe[_0x4f5fff]['field'];_0x12b760=_0xc062fe[_0x4f5fff][_0xb58d('0x6f')]?_[_0xb58d('0x70')](_0x142781[_0xc062fe[_0x4f5fff][_0xb58d('0x6f')]],'%s',_0x12b760):_0x12b760;_0x12b760=_0xc062fe[_0x4f5fff]['format']?_['replace'](_0x22bc2c[_0xc062fe[_0x4f5fff][_0xb58d('0x71')]],'%s',_0x12b760):_0x12b760;if(_0xc062fe[_0x4f5fff]['groupBy']){_0x6f2eb[_0xb58d('0x62')](_0x12b760);}_0xc062fe[_0x4f5fff][_0xb58d('0x72')]&&_0x6f2eb[_0xb58d('0x73')](_0x12b760,_0xc062fe[_0x4f5fff][_0xb58d('0x72')]===_0xb58d('0x74')?![]:!![]);_0x6f2eb[_0xb58d('0x63')](_0x12b760,_0xc062fe[_0x4f5fff][_0xb58d('0x75')]||_0x12b760);}if(_0x1c9524['joins']){_0x1c9524[_0xb58d('0x76')]=JSON[_0xb58d('0x77')](_0x1c9524['joins']);for(var _0x148ed9=0x0;_0x148ed9<_0x1c9524[_0xb58d('0x76')][_0xb58d('0x36')];_0x148ed9+=0x1){if(_0x1c9524[_0xb58d('0x76')][_0x148ed9]['type']&&_['includes'](_0x4173d1,_0x1c9524['joins'][_0x148ed9][_0xb58d('0x2e')])&&_0x1c9524[_0xb58d('0x76')][_0x148ed9]['parentKey']&&_0x1c9524['joins'][_0x148ed9]['foreignTable']&&_0x1c9524[_0xb58d('0x76')][_0x148ed9][_0xb58d('0x78')]){_0x6f2eb[_0x1c9524[_0xb58d('0x76')][_0x148ed9][_0xb58d('0x2e')]](_0x1c9524[_0xb58d('0x76')][_0x148ed9][_0xb58d('0x79')],null,util[_0xb58d('0x71')]('%s.%s\x20=\x20%s.%s',_0x1c9524[_0xb58d('0x6c')],_0x1c9524[_0xb58d('0x76')][_0x148ed9][_0xb58d('0x7a')],_0x1c9524[_0xb58d('0x76')][_0x148ed9][_0xb58d('0x79')],_0x1c9524[_0xb58d('0x76')][_0x148ed9][_0xb58d('0x78')]));}}}if(_0x1c9524['conditions']){_0x1c9524['conditions']=JSON[_0xb58d('0x77')](_0x1c9524[_0xb58d('0x7b')]);_0x6f2eb[_0xb58d('0x3d')](_0x17ef31(_0x1c9524[_0xb58d('0x7b')][_0xb58d('0x62')]));}_0x259bdb=_0x6f2eb['clone']();_0x6f2eb[_0xb58d('0x1d')](_0xdad07b);_0x6f2eb[_0xb58d('0x1b')](0x0);logger[_0xb58d('0x7c')](_0xb58d('0x7d'),_0x6f2eb['toString']());return dbH[_0xb58d('0x7e')][_0xb58d('0x31')](_0x6f2eb['toString'](),{'type':dbH[_0xb58d('0x7e')][_0xb58d('0x7f')]['SELECT']});}})[_0xb58d('0x22')](respondWithResult(_0x1c0cd3,null))['catch'](handleError(_0x1c0cd3,null));};function runReport(_0x1420a4,_0x4856d7,_0x1522c1){var _0xcc67f4=_0x4856d7[_0xb58d('0x28')];var _0x3c0476=0xa;var _0x3ce39a=[_0xb58d('0x50'),'left_join',_0xb58d('0x52'),_0xb58d('0x80')];var _0xe4cb31={'SUM':'SUM(%s)','COUNT':_0xb58d('0x54'),'COUNT DISTINCT':_0xb58d('0x55'),'MAX':_0xb58d('0x56'),'MIN':_0xb58d('0x57'),'AVG':_0xb58d('0x58'),'GROUP_CONCAT':_0xb58d('0x59'),'GROUP_CONCAT ASC':_0xb58d('0x81'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x59b69d={'SEC_TO_TIME':_0xb58d('0x82'),'DATE':_0xb58d('0x5b'),'HOUR':_0xb58d('0x5c'),'ROUND':_0xb58d('0x5d'),'UNIX_TIMESTAMP':_0xb58d('0x5e')};var _0x2f2f6e=function(_0x5b5362){return!_['includes']([_0xb58d('0x83'),_0xb58d('0x84'),_0xb58d('0x85'),_0xb58d('0x60')],_0x5b5362);};var _0x10070e=function(_0x2ae20b){if(!_0x2ae20b||!_0x2ae20b[_0xb58d('0x61')]['length']){return'';}for(var _0x42c52b='(',_0x1448d6=0x0;_0x1448d6<_0x2ae20b['rules']['length'];_0x1448d6+=0x1){_0x1448d6>0x0&&(_0x42c52b+='\x20'+_0x2ae20b[_0xb58d('0x86')]+'\x20');_0x42c52b+=_0x2ae20b[_0xb58d('0x61')][_0x1448d6][_0xb58d('0x62')]?_0x10070e(_0x2ae20b[_0xb58d('0x61')][_0x1448d6][_0xb58d('0x62')]):_0x2ae20b[_0xb58d('0x61')][_0x1448d6][_0xb58d('0x63')]+'\x20'+_0x2ae20b[_0xb58d('0x61')][_0x1448d6]['condition']+(_0x2f2f6e(_0x2ae20b[_0xb58d('0x61')][_0x1448d6]['condition'])?'\x20'+_0x2ae20b[_0xb58d('0x61')][_0x1448d6][_0xb58d('0x65')]:'');}return _0x42c52b+')';};var _0x526e7d={'where':{'id':_0x1420a4['id']}},_0x306ca1,_0x309720,_0x7dc8a8,_0x2acff3,_0xaadb48;_0x526e7d=_[_0xb58d('0x3e')]({},_0x526e7d,_0x1522c1);return db[_0xb58d('0x2c')][_0xb58d('0x45')](_0x526e7d)[_0xb58d('0x22')](function(_0x5e672e){if(_0x5e672e){_0x306ca1=_0x5e672e;return _0x5e672e['getFields']();}return null;})[_0xb58d('0x22')](function(_0x1dec0a){if(_0x1dec0a){if(!_0x1dec0a[_0xb58d('0x36')]){throw new db[(_0xb58d('0x87'))]['ValidationErrorItem'](_0xb58d('0x68'),0x193);}_0x309720=_0x1dec0a;return db['AnalyticMetric'][_0xb58d('0x88')]({'raw':!![]});}return null;})['then'](function(_0x5cb9bd){if(_0x5cb9bd){_0x7dc8a8=_['keyBy'](_0x5cb9bd,'id');var _0x1a253e;var _0xef0108=squel[_0xb58d('0x6a')]();_0xef0108[_0xb58d('0x6b')](_0x306ca1[_0xb58d('0x6c')]);for(var _0x53fee4=0x0;_0x53fee4<_0x309720[_0xb58d('0x36')];_0x53fee4+=0x1){_0x1a253e=_0x309720[_0x53fee4][_0xb58d('0x6d')]?_0x7dc8a8[_0x309720[_0x53fee4][_0xb58d('0x6d')]][_0xb58d('0x6e')]:_0x309720[_0x53fee4][_0xb58d('0x63')];_0x1a253e=_0x309720[_0x53fee4]['function']?_[_0xb58d('0x70')](_0xe4cb31[_0x309720[_0x53fee4][_0xb58d('0x6f')]],'%s',_0x1a253e):_0x1a253e;_0x1a253e=_0x309720[_0x53fee4][_0xb58d('0x71')]?_['replace'](_0x59b69d[_0x309720[_0x53fee4]['format']],'%s',_0x1a253e):_0x1a253e;if(_0x309720[_0x53fee4]['groupBy']){_0xef0108[_0xb58d('0x62')](_0x1a253e);}_0x309720[_0x53fee4][_0xb58d('0x72')]&&_0xef0108[_0xb58d('0x73')](_0x1a253e,_0x309720[_0x53fee4]['orderBy']===_0xb58d('0x74')?![]:!![]);_0xef0108['field'](_0x1a253e,_0x309720[_0x53fee4]['alias']||_0x1a253e);}if(_0x306ca1[_0xb58d('0x76')]){_0x306ca1[_0xb58d('0x76')]=JSON[_0xb58d('0x77')](_0x306ca1['joins']);for(var _0x494e2f=0x0;_0x494e2f<_0x306ca1['joins'][_0xb58d('0x36')];_0x494e2f+=0x1){if(_0x306ca1[_0xb58d('0x76')][_0x494e2f][_0xb58d('0x2e')]&&_[_0xb58d('0x5f')](_0x3ce39a,_0x306ca1[_0xb58d('0x76')][_0x494e2f][_0xb58d('0x2e')])&&_0x306ca1[_0xb58d('0x76')][_0x494e2f][_0xb58d('0x7a')]&&_0x306ca1[_0xb58d('0x76')][_0x494e2f][_0xb58d('0x79')]&&_0x306ca1['joins'][_0x494e2f][_0xb58d('0x78')]){_0xef0108[_0x306ca1['joins'][_0x494e2f][_0xb58d('0x2e')]](_0x306ca1[_0xb58d('0x76')][_0x494e2f][_0xb58d('0x79')],null,util[_0xb58d('0x71')](_0xb58d('0x89'),_0x306ca1[_0xb58d('0x6c')],_0x306ca1['joins'][_0x494e2f][_0xb58d('0x7a')],_0x306ca1[_0xb58d('0x76')][_0x494e2f][_0xb58d('0x79')],_0x306ca1[_0xb58d('0x76')][_0x494e2f][_0xb58d('0x78')]));}}}if(_0x306ca1[_0xb58d('0x7b')]){_0x306ca1[_0xb58d('0x7b')]=JSON[_0xb58d('0x77')](_0x306ca1[_0xb58d('0x7b')]);_0xef0108['where'](_0x10070e(_0x306ca1['conditions'][_0xb58d('0x62')]));}_0xaadb48=_0xef0108['clone']();_0xef0108[_0xb58d('0x1d')](_0x3c0476);_0xef0108[_0xb58d('0x1b')](0x0);return;}})[_0xb58d('0x22')](function(){if(_0x4856d7[_0xb58d('0x8a')]===_0xb58d('0x8b')){return null;}var _0x55e4f2=_['merge'](_0x4856d7,{'name':_0x4856d7['fullPath']||_0x4856d7[_0xb58d('0x28')]||_0x306ca1[_0xb58d('0x28')],'basename':_0xcc67f4,'savename':util[_0xb58d('0x71')](_0xb58d('0x8c'),_0x4856d7[_0xb58d('0x28')]||_0x306ca1[_0xb58d('0x28')],require(_0xb58d('0x8d'))[_0xb58d('0x8e')](0x4),_0x4856d7[_0xb58d('0x8a')]||_0xb58d('0x8f')),'reportId':_0x306ca1['id'],'reportType':'custom'});return db[_0xb58d('0x90')][_0xb58d('0x46')](_0x55e4f2,{'raw':!![]});})['then'](function(_0x102726){if(_0x306ca1[_0xb58d('0x6c')]===_0xb58d('0x91')){_0xaadb48[_0xb58d('0x3d')](_0x306ca1[_0xb58d('0x6c')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x4856d7[_0xb58d('0x92')],_0x4856d7[_0xb58d('0x93')]);}else{_0xaadb48[_0xb58d('0x3d')](_0x306ca1[_0xb58d('0x6c')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4856d7[_0xb58d('0x92')],_0x4856d7[_0xb58d('0x93')]);}if(_0x102726){logger[_0xb58d('0x94')](_0xb58d('0x95'),_0xaadb48['toString']());require('child_process')[_0xb58d('0x96')](path[_0xb58d('0x50')](__dirname,_0xb58d('0x97'),_0x102726['output']),[_0x102726['id'],_0xaadb48['toString'](),path[_0xb58d('0x50')](__dirname,_0xb58d('0x98'),_0x102726[_0xb58d('0x99')]),_0xcc67f4]);return _0x102726;}else{var _0x1aa336=squel[_0xb58d('0x6a')]();_0x1aa336[_0xb58d('0x6b')]('('+_0xaadb48[_0xb58d('0x9a')]()+')',_0xb58d('0x9b'));_0x1aa336[_0xb58d('0x63')](_0xb58d('0x9c'),_0xb58d('0x1e'));_0xaadb48[_0xb58d('0x1d')](_0x4856d7[_0xb58d('0x1d')]||_0x3c0476);_0xaadb48['offset'](_0x4856d7['offset']||0x0);return dbH['sequelize'][_0xb58d('0x31')](_0x1aa336[_0xb58d('0x9a')](),{'type':dbH[_0xb58d('0x7e')]['QueryTypes']['SELECT']})[_0xb58d('0x22')](function(_0x1c2b65){if(!_0x1c2b65[_0xb58d('0x36')]){_0x2acff3=0x0;}else{_0x2acff3=_0x1c2b65[0x0][_0xb58d('0x1e')]||0x0;}return dbH[_0xb58d('0x7e')][_0xb58d('0x31')](_0xaadb48[_0xb58d('0x9a')](),{'type':dbH[_0xb58d('0x7e')]['QueryTypes'][_0xb58d('0x9d')]});})[_0xb58d('0x22')](function(_0x59966d){return{'rows':_0x59966d||[],'count':_0x2acff3};});}});}exports[_0xb58d('0x9e')]=function(_0x474c50,_0x5456b7){return runReport(_0x474c50[_0xb58d('0x44')],_0x474c50[_0xb58d('0x31')],_0x474c50[_0xb58d('0x3f')])[_0xb58d('0x22')](respondWithResult(_0x5456b7,null))[_0xb58d('0x42')](handleError(_0x5456b7,null));};exports[_0xb58d('0x9f')]=runReport;exports[_0xb58d('0x31')]=function(_0x4ad73d,_0x5f2f2f){var _0x33119f=0xa;var _0x2d1771=[_0xb58d('0x50'),_0xb58d('0x51'),_0xb58d('0x52'),_0xb58d('0x80')];var _0x57e009={'SUM':_0xb58d('0x53'),'COUNT':_0xb58d('0x54'),'COUNT DISTINCT':_0xb58d('0x55'),'MAX':_0xb58d('0x56'),'MIN':_0xb58d('0x57'),'AVG':_0xb58d('0x58'),'GROUP_CONCAT':_0xb58d('0x59'),'GROUP_CONCAT ASC':_0xb58d('0x81'),'GROUP_CONCAT DESC':_0xb58d('0x5a')};var _0x52d4a6={'SEC_TO_TIME':_0xb58d('0x82'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xb58d('0x5d'),'UNIX_TIMESTAMP':_0xb58d('0x5e')};var _0x1ec7eb=function(_0x1d44cd){return!_[_0xb58d('0x5f')](['IS\x20NULL',_0xb58d('0x84'),_0xb58d('0x85'),_0xb58d('0x60')],_0x1d44cd);};var _0x232bec=function(_0x37930b){if(!_0x37930b||!_0x37930b[_0xb58d('0x61')][_0xb58d('0x36')]){return'';}for(var _0x4a4e3a='(',_0x351b48=0x0;_0x351b48<_0x37930b['rules'][_0xb58d('0x36')];_0x351b48+=0x1){_0x351b48>0x0&&(_0x4a4e3a+='\x20'+_0x37930b[_0xb58d('0x86')]+'\x20');_0x4a4e3a+=_0x37930b[_0xb58d('0x61')][_0x351b48]['group']?_0x232bec(_0x37930b[_0xb58d('0x61')][_0x351b48][_0xb58d('0x62')]):_0x37930b['rules'][_0x351b48][_0xb58d('0x63')]+'\x20'+_0x37930b[_0xb58d('0x61')][_0x351b48][_0xb58d('0x64')]+(_0x1ec7eb(_0x37930b['rules'][_0x351b48][_0xb58d('0x64')])?'\x20'+_0x37930b[_0xb58d('0x61')][_0x351b48][_0xb58d('0x65')]:'');}return _0x4a4e3a+')';};var _0xb13981={'where':{'id':_0x4ad73d[_0xb58d('0x44')]['id']}},_0x45a112,_0x43e577,_0x19ed56,_0xf497d4,_0x37665e;_0xb13981=_[_0xb58d('0x3e')]({},_0xb13981,_0x4ad73d[_0xb58d('0x3f')]);return db[_0xb58d('0x2c')][_0xb58d('0x45')](_0xb13981)[_0xb58d('0x22')](function(_0x56743d){if(_0x56743d){_0x45a112=_0x56743d;return _0x56743d['getFields']();}return null;})['then'](function(_0x5bf8f8){if(_0x5bf8f8){if(!_0x5bf8f8[_0xb58d('0x36')]){throw new db['Sequelize'][(_0xb58d('0x67'))](_0xb58d('0x68'),0x193);}_0x43e577=_0x5bf8f8;return db[_0xb58d('0xa0')][_0xb58d('0x88')]({'raw':!![]});}return null;})[_0xb58d('0x22')](function(_0x5bd25c){if(_0x5bd25c){_0x19ed56=_[_0xb58d('0x69')](_0x5bd25c,'id');var _0x50350b;var _0x5a359e=squel[_0xb58d('0x6a')]();_0x5a359e[_0xb58d('0x6b')](_0x45a112['table']);for(var _0x1df351=0x0;_0x1df351<_0x43e577[_0xb58d('0x36')];_0x1df351+=0x1){_0x50350b=_0x43e577[_0x1df351][_0xb58d('0x6d')]?_0x19ed56[_0x43e577[_0x1df351][_0xb58d('0x6d')]][_0xb58d('0x6e')]:_0x43e577[_0x1df351][_0xb58d('0x63')];_0x50350b=_0x43e577[_0x1df351][_0xb58d('0x6f')]?_[_0xb58d('0x70')](_0x57e009[_0x43e577[_0x1df351][_0xb58d('0x6f')]],'%s',_0x50350b):_0x50350b;_0x50350b=_0x43e577[_0x1df351][_0xb58d('0x71')]?_[_0xb58d('0x70')](_0x52d4a6[_0x43e577[_0x1df351][_0xb58d('0x71')]],'%s',_0x50350b):_0x50350b;if(_0x43e577[_0x1df351][_0xb58d('0xa1')]){_0x5a359e[_0xb58d('0x62')](_0x50350b);}_0x43e577[_0x1df351][_0xb58d('0x72')]&&_0x5a359e['order'](_0x50350b,_0x43e577[_0x1df351][_0xb58d('0x72')]===_0xb58d('0x74')?![]:!![]);_0x5a359e[_0xb58d('0x63')](_0x50350b,_0x43e577[_0x1df351]['alias']||_0x50350b);}if(_0x45a112[_0xb58d('0x76')]){_0x45a112[_0xb58d('0x76')]=JSON[_0xb58d('0x77')](_0x45a112[_0xb58d('0x76')]);for(var _0x17c96c=0x0;_0x17c96c<_0x45a112[_0xb58d('0x76')]['length'];_0x17c96c+=0x1){if(_0x45a112[_0xb58d('0x76')][_0x17c96c][_0xb58d('0x2e')]&&_[_0xb58d('0x5f')](_0x2d1771,_0x45a112[_0xb58d('0x76')][_0x17c96c][_0xb58d('0x2e')])&&_0x45a112['joins'][_0x17c96c][_0xb58d('0x7a')]&&_0x45a112['joins'][_0x17c96c]['foreignTable']&&_0x45a112[_0xb58d('0x76')][_0x17c96c][_0xb58d('0x78')]){_0x5a359e[_0x45a112[_0xb58d('0x76')][_0x17c96c][_0xb58d('0x2e')]](_0x45a112[_0xb58d('0x76')][_0x17c96c]['foreignTable'],null,util[_0xb58d('0x71')](_0xb58d('0x89'),_0x45a112[_0xb58d('0x6c')],_0x45a112[_0xb58d('0x76')][_0x17c96c][_0xb58d('0x7a')],_0x45a112[_0xb58d('0x76')][_0x17c96c][_0xb58d('0x79')],_0x45a112[_0xb58d('0x76')][_0x17c96c][_0xb58d('0x78')]));}}}if(_0x45a112[_0xb58d('0x7b')]){_0x45a112['conditions']=JSON['parse'](_0x45a112[_0xb58d('0x7b')]);_0x5a359e[_0xb58d('0x3d')](_0x232bec(_0x45a112[_0xb58d('0x7b')][_0xb58d('0x62')]));}_0x37665e=_0x5a359e[_0xb58d('0xa2')]();_0x5a359e['limit'](_0x33119f);_0x5a359e[_0xb58d('0x1b')](0x0);logger[_0xb58d('0x7c')]('Limited\x20Query:',_0x5a359e['toString']());return dbH[_0xb58d('0x7e')]['query'](_0x5a359e[_0xb58d('0x9a')](),{'type':dbH[_0xb58d('0x7e')][_0xb58d('0x7f')][_0xb58d('0x9d')]});}})[_0xb58d('0x22')](function(){return{'sql':_0x37665e[_0xb58d('0x9a')]()};})[_0xb58d('0x22')](respondWithResult(_0x5f2f2f,null))['catch'](handleError(_0x5f2f2f,null));}; \ No newline at end of file +var _0xd8dd=['Reports','UserProfileSection','find','userProfileId','autoAssociation','catch','body','preview','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','select','from','table','MetricId','metric','function','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','Limited\x20Query:','toString','sequelize','SELECT','join','COUNT(DISTINCT\x20%s)','MAX(%s)','GROUP_CONCAT(%s)','IS\x20NULL','IS\x20NOT\x20NULL','value','AnalyticMetric','replace','parse','fullPath','%s-%s.%s','randomstring','generate','output','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','Run\x20Query:','child_process','fork','savename','countTable','QueryTypes','run','runReport','debug','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','api','../../mysqldb','dbH','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','update','then','destroy','CustomReports','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','AnalyticCustomReport','includeAll','include','findAll','rows','show','params','keys','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x308a4a,_0xf3e174){var _0x1ac764=function(_0xf84761){while(--_0xf84761){_0x308a4a['push'](_0x308a4a['shift']());}};_0x1ac764(++_0xf3e174);}(_0xd8dd,0x19e));var _0xdd8d=function(_0x19342a,_0x518ae6){_0x19342a=_0x19342a-0x0;var _0x2e0796=_0xd8dd[_0x19342a];return _0x2e0796;};'use strict';var emlformat=require(_0xdd8d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdd8d('0x1'));var jsonpatch=require(_0xdd8d('0x2'));var rp=require(_0xdd8d('0x3'));var moment=require(_0xdd8d('0x4'));var BPromise=require(_0xdd8d('0x5'));var Mustache=require('mustache');var util=require(_0xdd8d('0x6'));var path=require(_0xdd8d('0x7'));var sox=require(_0xdd8d('0x8'));var csv=require('to-csv');var ejs=require(_0xdd8d('0x9'));var fs=require('fs');var fs_extra=require(_0xdd8d('0xa'));var _=require('lodash');var squel=require(_0xdd8d('0xb'));var crypto=require(_0xdd8d('0xc'));var jsforce=require(_0xdd8d('0xd'));var deskjs=require(_0xdd8d('0xe'));var toCsv=require(_0xdd8d('0xf'));var querystring=require(_0xdd8d('0x10'));var Papa=require(_0xdd8d('0x11'));var Redis=require('ioredis');var authService=require(_0xdd8d('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xdd8d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xdd8d('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var dbH=require(_0xdd8d('0x15'))[_0xdd8d('0x16')];function respondWithStatusCode(_0x3b04b4,_0x1683bb){_0x1683bb=_0x1683bb||0xcc;return function(_0x3b93ba){if(_0x3b93ba){return _0x3b04b4['sendStatus'](_0x1683bb);}return _0x3b04b4[_0xdd8d('0x17')](_0x1683bb)[_0xdd8d('0x18')]();};}function respondWithResult(_0x331663,_0x465d9a){_0x465d9a=_0x465d9a||0xc8;return function(_0x43e0fd){if(_0x43e0fd){return _0x331663[_0xdd8d('0x17')](_0x465d9a)[_0xdd8d('0x19')](_0x43e0fd);}};}function respondWithFilteredResult(_0x1558bc,_0xbf430d){return function(_0x303b0a){if(_0x303b0a){var _0x192e49=typeof _0xbf430d[_0xdd8d('0x1a')]===_0xdd8d('0x1b')&&typeof _0xbf430d['limit']===_0xdd8d('0x1b');var _0x2d115d=_0x303b0a[_0xdd8d('0x1c')];var _0x3605af=_0x192e49?0x0:_0xbf430d[_0xdd8d('0x1a')];var _0x36c429=_0x192e49?_0x303b0a['count']:_0xbf430d[_0xdd8d('0x1a')]+_0xbf430d[_0xdd8d('0x1d')];var _0x5c2c0e;if(_0x36c429>=_0x2d115d){_0x36c429=_0x2d115d;_0x5c2c0e=0xc8;}else{_0x5c2c0e=0xce;}_0x1558bc[_0xdd8d('0x17')](_0x5c2c0e);return _0x1558bc[_0xdd8d('0x1e')](_0xdd8d('0x1f'),_0x3605af+'-'+_0x36c429+'/'+_0x2d115d)[_0xdd8d('0x19')](_0x303b0a);}return null;};}function patchUpdates(_0x2a4590){return function(_0x400c4c){try{jsonpatch['apply'](_0x400c4c,_0x2a4590,!![]);}catch(_0x3b1387){return BPromise[_0xdd8d('0x20')](_0x3b1387);}return _0x400c4c['save']();};}function saveUpdates(_0x1e0111,_0x51985f){return function(_0x5b71bf){if(_0x5b71bf){return _0x5b71bf[_0xdd8d('0x21')](_0x1e0111)[_0xdd8d('0x22')](function(_0x1fcf03){return _0x1fcf03;});}return null;};}function removeEntity(_0x50ac92,_0x1469b8){return function(_0x43a950){if(_0x43a950){return _0x43a950[_0xdd8d('0x23')]()[_0xdd8d('0x22')](function(){var _0x567cd0=_0x43a950['get']({'plain':!![]});var _0x3df21c=_0xdd8d('0x24');return db[_0xdd8d('0x25')]['destroy']({'where':{'type':_0x3df21c,'resourceId':_0x567cd0['id']}})[_0xdd8d('0x22')](function(){return _0x43a950;});})['then'](function(){_0x50ac92[_0xdd8d('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5206ab,_0x5ddcc7){return function(_0x3882f6){if(!_0x3882f6){_0x5206ab['sendStatus'](0x194);}return _0x3882f6;};}function handleError(_0x2a35d2,_0x573c66){_0x573c66=_0x573c66||0x1f4;return function(_0xacfb7e){logger[_0xdd8d('0x26')](_0xacfb7e[_0xdd8d('0x27')]);if(_0xacfb7e[_0xdd8d('0x28')]){delete _0xacfb7e['name'];}_0x2a35d2['status'](_0x573c66)[_0xdd8d('0x29')](_0xacfb7e);};}exports[_0xdd8d('0x2a')]=function(_0x2b0e14,_0x2bcb51){var _0xb44178={},_0x1693f6={},_0x1fac0b={'count':0x0,'rows':[]};var _0x4c78f3=_[_0xdd8d('0x2b')](db['AnalyticCustomReport'][_0xdd8d('0x2c')],function(_0x56116e){return{'name':_0x56116e[_0xdd8d('0x2d')],'type':_0x56116e[_0xdd8d('0x2e')]['key']};});_0x1693f6[_0xdd8d('0x2f')]=_[_0xdd8d('0x2b')](_0x4c78f3,_0xdd8d('0x28'));_0x1693f6['query']=_['keys'](_0x2b0e14[_0xdd8d('0x30')]);_0x1693f6[_0xdd8d('0x31')]=_[_0xdd8d('0x32')](_0x1693f6['model'],_0x1693f6['query']);_0xb44178[_0xdd8d('0x33')]=_[_0xdd8d('0x32')](_0x1693f6[_0xdd8d('0x2f')],qs[_0xdd8d('0x34')](_0x2b0e14[_0xdd8d('0x30')]['fields']));_0xb44178[_0xdd8d('0x33')]=_0xb44178[_0xdd8d('0x33')][_0xdd8d('0x35')]?_0xb44178[_0xdd8d('0x33')]:_0x1693f6['model'];if(!_0x2b0e14['query'][_0xdd8d('0x36')](_0xdd8d('0x37'))){_0xb44178[_0xdd8d('0x1d')]=qs['limit'](_0x2b0e14[_0xdd8d('0x30')]['limit']);_0xb44178[_0xdd8d('0x1a')]=qs[_0xdd8d('0x1a')](_0x2b0e14[_0xdd8d('0x30')][_0xdd8d('0x1a')]);}_0xb44178[_0xdd8d('0x38')]=qs[_0xdd8d('0x39')](_0x2b0e14['query'][_0xdd8d('0x39')]);_0xb44178[_0xdd8d('0x3a')]=qs[_0xdd8d('0x31')](_[_0xdd8d('0x3b')](_0x2b0e14['query'],_0x1693f6['filters']),_0x4c78f3);if(_0x2b0e14[_0xdd8d('0x30')]['filter']){_0xb44178[_0xdd8d('0x3a')]=_[_0xdd8d('0x3c')](_0xb44178['where'],{'$or':_['map'](_0x4c78f3,function(_0x86eab6){if(_0x86eab6[_0xdd8d('0x2e')]!=='VIRTUAL'){var _0x47d4c1={};_0x47d4c1[_0x86eab6['name']]={'$like':'%'+_0x2b0e14['query'][_0xdd8d('0x3d')]+'%'};return _0x47d4c1;}})});}_0xb44178=_['merge']({},_0xb44178,_0x2b0e14[_0xdd8d('0x3e')]);var _0x4363d7={'where':_0xb44178['where']};return db[_0xdd8d('0x3f')][_0xdd8d('0x1c')](_0x4363d7)[_0xdd8d('0x22')](function(_0x6b00e5){_0x1fac0b['count']=_0x6b00e5;if(_0x2b0e14[_0xdd8d('0x30')][_0xdd8d('0x40')]){_0xb44178[_0xdd8d('0x41')]=[{'all':!![]}];}return db[_0xdd8d('0x3f')][_0xdd8d('0x42')](_0xb44178);})[_0xdd8d('0x22')](function(_0x2e9f8f){_0x1fac0b[_0xdd8d('0x43')]=_0x2e9f8f;return _0x1fac0b;})[_0xdd8d('0x22')](respondWithFilteredResult(_0x2bcb51,_0xb44178))['catch'](handleError(_0x2bcb51,null));};exports[_0xdd8d('0x44')]=function(_0x96d3b2,_0xadf37d){var _0x3d5b3d={'raw':![],'where':{'id':_0x96d3b2[_0xdd8d('0x45')]['id']}},_0x127871={};_0x127871[_0xdd8d('0x2f')]=_[_0xdd8d('0x46')](db['AnalyticCustomReport']['rawAttributes']);_0x127871[_0xdd8d('0x30')]=_[_0xdd8d('0x46')](_0x96d3b2['query']);_0x127871[_0xdd8d('0x31')]=_[_0xdd8d('0x32')](_0x127871[_0xdd8d('0x2f')],_0x127871[_0xdd8d('0x30')]);_0x3d5b3d[_0xdd8d('0x33')]=_[_0xdd8d('0x32')](_0x127871['model'],qs[_0xdd8d('0x34')](_0x96d3b2[_0xdd8d('0x30')][_0xdd8d('0x34')]));_0x3d5b3d[_0xdd8d('0x33')]=_0x3d5b3d[_0xdd8d('0x33')][_0xdd8d('0x35')]?_0x3d5b3d['attributes']:_0x127871['model'];if(_0x96d3b2[_0xdd8d('0x30')][_0xdd8d('0x40')]){_0x3d5b3d[_0xdd8d('0x41')]=[{'all':!![]}];}_0x3d5b3d=_[_0xdd8d('0x3c')]({},_0x3d5b3d,_0x96d3b2[_0xdd8d('0x3e')]);return db[_0xdd8d('0x3f')]['find'](_0x3d5b3d)[_0xdd8d('0x22')](handleEntityNotFound(_0xadf37d,null))[_0xdd8d('0x22')](respondWithResult(_0xadf37d,null))['catch'](handleError(_0xadf37d,null));};exports[_0xdd8d('0x47')]=function(_0xb145c0,_0x5a01df){return db['AnalyticCustomReport']['create'](_0xb145c0['body'],{})[_0xdd8d('0x22')](function(_0x2d4025){var _0x3c23d0=_0xb145c0[_0xdd8d('0x48')][_0xdd8d('0x49')]({'plain':!![]});if(!_0x3c23d0)throw new Error(_0xdd8d('0x4a'));if(_0x3c23d0['role']===_0xdd8d('0x48')){var _0x1e95b0=_0x2d4025[_0xdd8d('0x49')]({'plain':!![]});var _0x1b68c7=_0xdd8d('0x4b');return db[_0xdd8d('0x4c')][_0xdd8d('0x4d')]({'where':{'name':_0x1b68c7,'userProfileId':_0x3c23d0[_0xdd8d('0x4e')]},'raw':!![]})[_0xdd8d('0x22')](function(_0x44d658){if(_0x44d658&&_0x44d658[_0xdd8d('0x4f')]===0x0){return db[_0xdd8d('0x25')]['create']({'name':_0x1e95b0[_0xdd8d('0x28')],'resourceId':_0x1e95b0['id'],'type':_0xdd8d('0x24'),'sectionId':_0x44d658['id']},{})[_0xdd8d('0x22')](function(){return _0x2d4025;});}else{return _0x2d4025;}})['catch'](function(_0x1cdfb6){logger[_0xdd8d('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1cdfb6);throw _0x1cdfb6;});}return _0x2d4025;})[_0xdd8d('0x22')](respondWithResult(_0x5a01df,0xc9))[_0xdd8d('0x50')](handleError(_0x5a01df,null));};exports[_0xdd8d('0x21')]=function(_0x168d1d,_0x343035){if(_0x168d1d[_0xdd8d('0x51')]['id']){delete _0x168d1d['body']['id'];}return db[_0xdd8d('0x3f')]['find']({'where':{'id':_0x168d1d['params']['id']}})['then'](handleEntityNotFound(_0x343035,null))['then'](saveUpdates(_0x168d1d[_0xdd8d('0x51')],null))[_0xdd8d('0x22')](respondWithResult(_0x343035,null))[_0xdd8d('0x50')](handleError(_0x343035,null));};exports['destroy']=function(_0x12ebb4,_0x563fe4){return db[_0xdd8d('0x3f')][_0xdd8d('0x4d')]({'where':{'id':_0x12ebb4[_0xdd8d('0x45')]['id']}})[_0xdd8d('0x22')](handleEntityNotFound(_0x563fe4,null))[_0xdd8d('0x22')](removeEntity(_0x563fe4,null))[_0xdd8d('0x50')](handleError(_0x563fe4,null));};exports[_0xdd8d('0x52')]=function(_0x5c1d08,_0x1e52f9){var _0x48dcfa=0xa;var _0x56d439=['join',_0xdd8d('0x53'),_0xdd8d('0x54'),_0xdd8d('0x55')];var _0x39fc82={'SUM':_0xdd8d('0x56'),'COUNT':_0xdd8d('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xdd8d('0x58'),'AVG':_0xdd8d('0x59'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xdd8d('0x5a'),'GROUP_CONCAT DESC':_0xdd8d('0x5b')};var _0x520953={'SEC_TO_TIME':_0xdd8d('0x5c'),'DATE':_0xdd8d('0x5d'),'HOUR':_0xdd8d('0x5e'),'ROUND':_0xdd8d('0x5f'),'UNIX_TIMESTAMP':_0xdd8d('0x60')};var _0x1a0a77=function(_0x1c9403){return!_[_0xdd8d('0x61')](['IS\x20NULL','IS\x20NOT\x20NULL',_0xdd8d('0x62'),_0xdd8d('0x63')],_0x1c9403);};var _0x4f1051=function(_0x3f2ac8){if(!_0x3f2ac8||!_0x3f2ac8['rules']['length']){return'';}for(var _0x57d58f='(',_0x5e8307=0x0;_0x5e8307<_0x3f2ac8[_0xdd8d('0x64')]['length'];_0x5e8307+=0x1){_0x5e8307>0x0&&(_0x57d58f+='\x20'+_0x3f2ac8[_0xdd8d('0x65')]+'\x20');_0x57d58f+=_0x3f2ac8[_0xdd8d('0x64')][_0x5e8307][_0xdd8d('0x66')]?_0x4f1051(_0x3f2ac8[_0xdd8d('0x64')][_0x5e8307][_0xdd8d('0x66')]):_0x3f2ac8[_0xdd8d('0x64')][_0x5e8307][_0xdd8d('0x67')]+'\x20'+_0x3f2ac8['rules'][_0x5e8307][_0xdd8d('0x68')]+(_0x1a0a77(_0x3f2ac8[_0xdd8d('0x64')][_0x5e8307][_0xdd8d('0x68')])?'\x20'+_0x3f2ac8[_0xdd8d('0x64')][_0x5e8307]['value']:'');}return _0x57d58f+')';};var _0x442d17={'where':{'id':_0x5c1d08[_0xdd8d('0x45')]['id']}},_0x1028bd,_0x525e08,_0x3d8469,_0x36e0a3,_0x15fd3c;_0x442d17=_['merge']({},_0x442d17,_0x5c1d08[_0xdd8d('0x3e')]);return db[_0xdd8d('0x3f')][_0xdd8d('0x4d')](_0x442d17)[_0xdd8d('0x22')](function(_0x51198c){if(_0x51198c){_0x1028bd=_0x51198c;return _0x51198c[_0xdd8d('0x69')]();}return null;})[_0xdd8d('0x22')](function(_0x521bd8){if(_0x521bd8){if(!_0x521bd8['length']){throw new db[(_0xdd8d('0x6a'))][(_0xdd8d('0x6b'))](_0xdd8d('0x6c'),0x193);}_0x525e08=_0x521bd8;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xdd8d('0x22')](function(_0x20badb){if(_0x20badb){_0x3d8469=_[_0xdd8d('0x6d')](_0x20badb,'id');var _0x5964e0;var _0x3e12fa=squel[_0xdd8d('0x6e')]();_0x3e12fa[_0xdd8d('0x6f')](_0x1028bd[_0xdd8d('0x70')]);for(var _0xbd3693=0x0;_0xbd3693<_0x525e08['length'];_0xbd3693+=0x1){_0x5964e0=_0x525e08[_0xbd3693][_0xdd8d('0x71')]?_0x3d8469[_0x525e08[_0xbd3693]['MetricId']][_0xdd8d('0x72')]:_0x525e08[_0xbd3693][_0xdd8d('0x67')];_0x5964e0=_0x525e08[_0xbd3693][_0xdd8d('0x73')]?_['replace'](_0x39fc82[_0x525e08[_0xbd3693][_0xdd8d('0x73')]],'%s',_0x5964e0):_0x5964e0;_0x5964e0=_0x525e08[_0xbd3693][_0xdd8d('0x74')]?_['replace'](_0x520953[_0x525e08[_0xbd3693]['format']],'%s',_0x5964e0):_0x5964e0;if(_0x525e08[_0xbd3693][_0xdd8d('0x75')]){_0x3e12fa['group'](_0x5964e0);}_0x525e08[_0xbd3693][_0xdd8d('0x76')]&&_0x3e12fa[_0xdd8d('0x38')](_0x5964e0,_0x525e08[_0xbd3693][_0xdd8d('0x76')]===_0xdd8d('0x77')?![]:!![]);_0x3e12fa[_0xdd8d('0x67')](_0x5964e0,_0x525e08[_0xbd3693][_0xdd8d('0x78')]||_0x5964e0);}if(_0x1028bd[_0xdd8d('0x79')]){_0x1028bd[_0xdd8d('0x79')]=JSON['parse'](_0x1028bd[_0xdd8d('0x79')]);for(var _0x3101e3=0x0;_0x3101e3<_0x1028bd[_0xdd8d('0x79')][_0xdd8d('0x35')];_0x3101e3+=0x1){if(_0x1028bd[_0xdd8d('0x79')][_0x3101e3][_0xdd8d('0x2e')]&&_[_0xdd8d('0x61')](_0x56d439,_0x1028bd['joins'][_0x3101e3]['type'])&&_0x1028bd['joins'][_0x3101e3][_0xdd8d('0x7a')]&&_0x1028bd[_0xdd8d('0x79')][_0x3101e3][_0xdd8d('0x7b')]&&_0x1028bd[_0xdd8d('0x79')][_0x3101e3][_0xdd8d('0x7c')]){_0x3e12fa[_0x1028bd[_0xdd8d('0x79')][_0x3101e3]['type']](_0x1028bd[_0xdd8d('0x79')][_0x3101e3][_0xdd8d('0x7b')],null,util[_0xdd8d('0x74')](_0xdd8d('0x7d'),_0x1028bd['table'],_0x1028bd[_0xdd8d('0x79')][_0x3101e3][_0xdd8d('0x7a')],_0x1028bd[_0xdd8d('0x79')][_0x3101e3]['foreignTable'],_0x1028bd[_0xdd8d('0x79')][_0x3101e3][_0xdd8d('0x7c')]));}}}if(_0x1028bd['conditions']){_0x1028bd[_0xdd8d('0x7e')]=JSON['parse'](_0x1028bd[_0xdd8d('0x7e')]);_0x3e12fa[_0xdd8d('0x3a')](_0x4f1051(_0x1028bd[_0xdd8d('0x7e')][_0xdd8d('0x66')]));}_0x15fd3c=_0x3e12fa[_0xdd8d('0x7f')]();_0x3e12fa['limit'](_0x48dcfa);_0x3e12fa[_0xdd8d('0x1a')](0x0);logger['debug'](_0xdd8d('0x80'),_0x3e12fa[_0xdd8d('0x81')]());return dbH[_0xdd8d('0x82')][_0xdd8d('0x30')](_0x3e12fa[_0xdd8d('0x81')](),{'type':dbH[_0xdd8d('0x82')]['QueryTypes'][_0xdd8d('0x83')]});}})['then'](respondWithResult(_0x1e52f9,null))[_0xdd8d('0x50')](handleError(_0x1e52f9,null));};function runReport(_0x357eb6,_0x19ce59,_0x46d92c){var _0x5247fb=_0x19ce59[_0xdd8d('0x28')];var _0x4fcec4=0xa;var _0xfbfcea=[_0xdd8d('0x84'),_0xdd8d('0x53'),_0xdd8d('0x54'),_0xdd8d('0x55')];var _0xc6e85c={'SUM':_0xdd8d('0x56'),'COUNT':_0xdd8d('0x57'),'COUNT DISTINCT':_0xdd8d('0x85'),'MAX':_0xdd8d('0x86'),'MIN':_0xdd8d('0x58'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xdd8d('0x87'),'GROUP_CONCAT ASC':_0xdd8d('0x5a'),'GROUP_CONCAT DESC':_0xdd8d('0x5b')};var _0x52a02d={'SEC_TO_TIME':_0xdd8d('0x5c'),'DATE':_0xdd8d('0x5d'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xdd8d('0x60')};var _0x1c9a01=function(_0x173dca){return!_[_0xdd8d('0x61')]([_0xdd8d('0x88'),_0xdd8d('0x89'),_0xdd8d('0x62'),_0xdd8d('0x63')],_0x173dca);};var _0x212543=function(_0x466722){if(!_0x466722||!_0x466722[_0xdd8d('0x64')][_0xdd8d('0x35')]){return'';}for(var _0x3ee134='(',_0x8f7c84=0x0;_0x8f7c84<_0x466722[_0xdd8d('0x64')][_0xdd8d('0x35')];_0x8f7c84+=0x1){_0x8f7c84>0x0&&(_0x3ee134+='\x20'+_0x466722[_0xdd8d('0x65')]+'\x20');_0x3ee134+=_0x466722[_0xdd8d('0x64')][_0x8f7c84][_0xdd8d('0x66')]?_0x212543(_0x466722['rules'][_0x8f7c84][_0xdd8d('0x66')]):_0x466722[_0xdd8d('0x64')][_0x8f7c84][_0xdd8d('0x67')]+'\x20'+_0x466722[_0xdd8d('0x64')][_0x8f7c84]['condition']+(_0x1c9a01(_0x466722[_0xdd8d('0x64')][_0x8f7c84][_0xdd8d('0x68')])?'\x20'+_0x466722['rules'][_0x8f7c84][_0xdd8d('0x8a')]:'');}return _0x3ee134+')';};var _0x5d715e={'where':{'id':_0x357eb6['id']}},_0x3f68bf,_0x2061f1,_0x13323a,_0x3c414d,_0x1c8cbc;_0x5d715e=_[_0xdd8d('0x3c')]({},_0x5d715e,_0x46d92c);return db['AnalyticCustomReport'][_0xdd8d('0x4d')](_0x5d715e)['then'](function(_0x1f795d){if(_0x1f795d){_0x3f68bf=_0x1f795d;return _0x1f795d[_0xdd8d('0x69')]();}return null;})[_0xdd8d('0x22')](function(_0x29a60b){if(_0x29a60b){if(!_0x29a60b[_0xdd8d('0x35')]){throw new db[(_0xdd8d('0x6a'))][(_0xdd8d('0x6b'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2061f1=_0x29a60b;return db[_0xdd8d('0x8b')][_0xdd8d('0x42')]({'raw':!![]});}return null;})[_0xdd8d('0x22')](function(_0x169db3){if(_0x169db3){_0x13323a=_[_0xdd8d('0x6d')](_0x169db3,'id');var _0x562abd;var _0x26fc16=squel[_0xdd8d('0x6e')]();_0x26fc16[_0xdd8d('0x6f')](_0x3f68bf[_0xdd8d('0x70')]);for(var _0x524be2=0x0;_0x524be2<_0x2061f1[_0xdd8d('0x35')];_0x524be2+=0x1){_0x562abd=_0x2061f1[_0x524be2][_0xdd8d('0x71')]?_0x13323a[_0x2061f1[_0x524be2][_0xdd8d('0x71')]][_0xdd8d('0x72')]:_0x2061f1[_0x524be2][_0xdd8d('0x67')];_0x562abd=_0x2061f1[_0x524be2][_0xdd8d('0x73')]?_['replace'](_0xc6e85c[_0x2061f1[_0x524be2][_0xdd8d('0x73')]],'%s',_0x562abd):_0x562abd;_0x562abd=_0x2061f1[_0x524be2]['format']?_[_0xdd8d('0x8c')](_0x52a02d[_0x2061f1[_0x524be2][_0xdd8d('0x74')]],'%s',_0x562abd):_0x562abd;if(_0x2061f1[_0x524be2][_0xdd8d('0x75')]){_0x26fc16['group'](_0x562abd);}_0x2061f1[_0x524be2]['orderBy']&&_0x26fc16[_0xdd8d('0x38')](_0x562abd,_0x2061f1[_0x524be2][_0xdd8d('0x76')]==='DESC'?![]:!![]);_0x26fc16[_0xdd8d('0x67')](_0x562abd,_0x2061f1[_0x524be2]['alias']||_0x562abd);}if(_0x3f68bf['joins']){_0x3f68bf[_0xdd8d('0x79')]=JSON[_0xdd8d('0x8d')](_0x3f68bf[_0xdd8d('0x79')]);for(var _0x421d0a=0x0;_0x421d0a<_0x3f68bf['joins'][_0xdd8d('0x35')];_0x421d0a+=0x1){if(_0x3f68bf['joins'][_0x421d0a][_0xdd8d('0x2e')]&&_[_0xdd8d('0x61')](_0xfbfcea,_0x3f68bf['joins'][_0x421d0a][_0xdd8d('0x2e')])&&_0x3f68bf['joins'][_0x421d0a][_0xdd8d('0x7a')]&&_0x3f68bf['joins'][_0x421d0a]['foreignTable']&&_0x3f68bf[_0xdd8d('0x79')][_0x421d0a][_0xdd8d('0x7c')]){_0x26fc16[_0x3f68bf['joins'][_0x421d0a][_0xdd8d('0x2e')]](_0x3f68bf['joins'][_0x421d0a][_0xdd8d('0x7b')],null,util['format'](_0xdd8d('0x7d'),_0x3f68bf['table'],_0x3f68bf[_0xdd8d('0x79')][_0x421d0a][_0xdd8d('0x7a')],_0x3f68bf[_0xdd8d('0x79')][_0x421d0a]['foreignTable'],_0x3f68bf[_0xdd8d('0x79')][_0x421d0a][_0xdd8d('0x7c')]));}}}if(_0x3f68bf[_0xdd8d('0x7e')]){_0x3f68bf[_0xdd8d('0x7e')]=JSON[_0xdd8d('0x8d')](_0x3f68bf[_0xdd8d('0x7e')]);_0x26fc16[_0xdd8d('0x3a')](_0x212543(_0x3f68bf[_0xdd8d('0x7e')][_0xdd8d('0x66')]));}_0x1c8cbc=_0x26fc16[_0xdd8d('0x7f')]();_0x26fc16['limit'](_0x4fcec4);_0x26fc16['offset'](0x0);return;}})['then'](function(){if(_0x19ce59['output']==='web'){return null;}var _0x34b38e=_[_0xdd8d('0x3c')](_0x19ce59,{'name':_0x19ce59[_0xdd8d('0x8e')]||_0x19ce59[_0xdd8d('0x28')]||_0x3f68bf[_0xdd8d('0x28')],'basename':_0x5247fb,'savename':util[_0xdd8d('0x74')](_0xdd8d('0x8f'),_0x19ce59[_0xdd8d('0x28')]||_0x3f68bf[_0xdd8d('0x28')],require(_0xdd8d('0x90'))[_0xdd8d('0x91')](0x4),_0x19ce59[_0xdd8d('0x92')]||_0xdd8d('0x93')),'reportId':_0x3f68bf['id'],'reportType':_0xdd8d('0x94')});return db[_0xdd8d('0x95')][_0xdd8d('0x47')](_0x34b38e,{'raw':!![]});})[_0xdd8d('0x22')](function(_0x271243){if(_0x3f68bf['table']===_0xdd8d('0x96')){_0x1c8cbc[_0xdd8d('0x3a')](_0x3f68bf[_0xdd8d('0x70')]+_0xdd8d('0x97'),_0x19ce59[_0xdd8d('0x98')],_0x19ce59[_0xdd8d('0x99')]);}else{_0x1c8cbc[_0xdd8d('0x3a')](_0x3f68bf[_0xdd8d('0x70')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x19ce59[_0xdd8d('0x98')],_0x19ce59[_0xdd8d('0x99')]);}if(_0x271243){logger['info'](_0xdd8d('0x9a'),_0x1c8cbc[_0xdd8d('0x81')]());require(_0xdd8d('0x9b'))[_0xdd8d('0x9c')](path[_0xdd8d('0x84')](__dirname,'../../components/export/',_0x271243['output']),[_0x271243['id'],_0x1c8cbc['toString'](),path[_0xdd8d('0x84')](__dirname,'../../files/reports',_0x271243[_0xdd8d('0x9d')]),_0x5247fb]);return _0x271243;}else{var _0x3e3120=squel[_0xdd8d('0x6e')]();_0x3e3120[_0xdd8d('0x6f')]('('+_0x1c8cbc['toString']()+')',_0xdd8d('0x9e'));_0x3e3120['field']('COUNT(*)',_0xdd8d('0x1c'));_0x1c8cbc[_0xdd8d('0x1d')](_0x19ce59['limit']||_0x4fcec4);_0x1c8cbc['offset'](_0x19ce59['offset']||0x0);return dbH['sequelize'][_0xdd8d('0x30')](_0x3e3120[_0xdd8d('0x81')](),{'type':dbH[_0xdd8d('0x82')][_0xdd8d('0x9f')][_0xdd8d('0x83')]})[_0xdd8d('0x22')](function(_0x21e5fe){if(!_0x21e5fe[_0xdd8d('0x35')]){_0x3c414d=0x0;}else{_0x3c414d=_0x21e5fe[0x0][_0xdd8d('0x1c')]||0x0;}return dbH[_0xdd8d('0x82')][_0xdd8d('0x30')](_0x1c8cbc['toString'](),{'type':dbH[_0xdd8d('0x82')][_0xdd8d('0x9f')][_0xdd8d('0x83')]});})[_0xdd8d('0x22')](function(_0x9d775f){return{'rows':_0x9d775f||[],'count':_0x3c414d};});}});}exports[_0xdd8d('0xa0')]=function(_0x32f431,_0x3c6235){return runReport(_0x32f431[_0xdd8d('0x45')],_0x32f431[_0xdd8d('0x30')],_0x32f431[_0xdd8d('0x3e')])[_0xdd8d('0x22')](respondWithResult(_0x3c6235,null))['catch'](handleError(_0x3c6235,null));};exports[_0xdd8d('0xa1')]=runReport;exports[_0xdd8d('0x30')]=function(_0x1be790,_0x5851ba){var _0x4ae48d=0xa;var _0x205683=[_0xdd8d('0x84'),_0xdd8d('0x53'),_0xdd8d('0x54'),_0xdd8d('0x55')];var _0x16bcc0={'SUM':_0xdd8d('0x56'),'COUNT':_0xdd8d('0x57'),'COUNT DISTINCT':_0xdd8d('0x85'),'MAX':'MAX(%s)','MIN':_0xdd8d('0x58'),'AVG':_0xdd8d('0x59'),'GROUP_CONCAT':_0xdd8d('0x87'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xdd8d('0x5b')};var _0x4223d8={'SEC_TO_TIME':_0xdd8d('0x5c'),'DATE':_0xdd8d('0x5d'),'HOUR':_0xdd8d('0x5e'),'ROUND':_0xdd8d('0x5f'),'UNIX_TIMESTAMP':_0xdd8d('0x60')};var _0x45f38a=function(_0x553651){return!_[_0xdd8d('0x61')]([_0xdd8d('0x88'),_0xdd8d('0x89'),_0xdd8d('0x62'),_0xdd8d('0x63')],_0x553651);};var _0x9dacf7=function(_0x29c544){if(!_0x29c544||!_0x29c544['rules'][_0xdd8d('0x35')]){return'';}for(var _0x52eab5='(',_0x3c4fda=0x0;_0x3c4fda<_0x29c544['rules'][_0xdd8d('0x35')];_0x3c4fda+=0x1){_0x3c4fda>0x0&&(_0x52eab5+='\x20'+_0x29c544['operator']+'\x20');_0x52eab5+=_0x29c544[_0xdd8d('0x64')][_0x3c4fda][_0xdd8d('0x66')]?_0x9dacf7(_0x29c544[_0xdd8d('0x64')][_0x3c4fda]['group']):_0x29c544[_0xdd8d('0x64')][_0x3c4fda][_0xdd8d('0x67')]+'\x20'+_0x29c544[_0xdd8d('0x64')][_0x3c4fda]['condition']+(_0x45f38a(_0x29c544[_0xdd8d('0x64')][_0x3c4fda][_0xdd8d('0x68')])?'\x20'+_0x29c544[_0xdd8d('0x64')][_0x3c4fda][_0xdd8d('0x8a')]:'');}return _0x52eab5+')';};var _0x58424f={'where':{'id':_0x1be790['params']['id']}},_0x23ad11,_0xf5a66f,_0x464b96,_0x4b7a5a,_0x39d1dc;_0x58424f=_['merge']({},_0x58424f,_0x1be790[_0xdd8d('0x3e')]);return db[_0xdd8d('0x3f')][_0xdd8d('0x4d')](_0x58424f)['then'](function(_0x19cd92){if(_0x19cd92){_0x23ad11=_0x19cd92;return _0x19cd92[_0xdd8d('0x69')]();}return null;})[_0xdd8d('0x22')](function(_0x1c244d){if(_0x1c244d){if(!_0x1c244d[_0xdd8d('0x35')]){throw new db[(_0xdd8d('0x6a'))][(_0xdd8d('0x6b'))](_0xdd8d('0x6c'),0x193);}_0xf5a66f=_0x1c244d;return db[_0xdd8d('0x8b')][_0xdd8d('0x42')]({'raw':!![]});}return null;})[_0xdd8d('0x22')](function(_0x94c912){if(_0x94c912){_0x464b96=_[_0xdd8d('0x6d')](_0x94c912,'id');var _0x54026c;var _0x3c91c6=squel[_0xdd8d('0x6e')]();_0x3c91c6[_0xdd8d('0x6f')](_0x23ad11[_0xdd8d('0x70')]);for(var _0x260deb=0x0;_0x260deb<_0xf5a66f['length'];_0x260deb+=0x1){_0x54026c=_0xf5a66f[_0x260deb]['MetricId']?_0x464b96[_0xf5a66f[_0x260deb][_0xdd8d('0x71')]][_0xdd8d('0x72')]:_0xf5a66f[_0x260deb][_0xdd8d('0x67')];_0x54026c=_0xf5a66f[_0x260deb]['function']?_[_0xdd8d('0x8c')](_0x16bcc0[_0xf5a66f[_0x260deb][_0xdd8d('0x73')]],'%s',_0x54026c):_0x54026c;_0x54026c=_0xf5a66f[_0x260deb][_0xdd8d('0x74')]?_[_0xdd8d('0x8c')](_0x4223d8[_0xf5a66f[_0x260deb]['format']],'%s',_0x54026c):_0x54026c;if(_0xf5a66f[_0x260deb][_0xdd8d('0x75')]){_0x3c91c6['group'](_0x54026c);}_0xf5a66f[_0x260deb]['orderBy']&&_0x3c91c6[_0xdd8d('0x38')](_0x54026c,_0xf5a66f[_0x260deb]['orderBy']===_0xdd8d('0x77')?![]:!![]);_0x3c91c6[_0xdd8d('0x67')](_0x54026c,_0xf5a66f[_0x260deb][_0xdd8d('0x78')]||_0x54026c);}if(_0x23ad11[_0xdd8d('0x79')]){_0x23ad11[_0xdd8d('0x79')]=JSON[_0xdd8d('0x8d')](_0x23ad11['joins']);for(var _0x59941a=0x0;_0x59941a<_0x23ad11[_0xdd8d('0x79')][_0xdd8d('0x35')];_0x59941a+=0x1){if(_0x23ad11[_0xdd8d('0x79')][_0x59941a][_0xdd8d('0x2e')]&&_['includes'](_0x205683,_0x23ad11[_0xdd8d('0x79')][_0x59941a][_0xdd8d('0x2e')])&&_0x23ad11[_0xdd8d('0x79')][_0x59941a][_0xdd8d('0x7a')]&&_0x23ad11[_0xdd8d('0x79')][_0x59941a]['foreignTable']&&_0x23ad11[_0xdd8d('0x79')][_0x59941a]['foreignKey']){_0x3c91c6[_0x23ad11[_0xdd8d('0x79')][_0x59941a][_0xdd8d('0x2e')]](_0x23ad11[_0xdd8d('0x79')][_0x59941a][_0xdd8d('0x7b')],null,util[_0xdd8d('0x74')](_0xdd8d('0x7d'),_0x23ad11[_0xdd8d('0x70')],_0x23ad11[_0xdd8d('0x79')][_0x59941a][_0xdd8d('0x7a')],_0x23ad11[_0xdd8d('0x79')][_0x59941a][_0xdd8d('0x7b')],_0x23ad11['joins'][_0x59941a][_0xdd8d('0x7c')]));}}}if(_0x23ad11[_0xdd8d('0x7e')]){_0x23ad11[_0xdd8d('0x7e')]=JSON[_0xdd8d('0x8d')](_0x23ad11[_0xdd8d('0x7e')]);_0x3c91c6[_0xdd8d('0x3a')](_0x9dacf7(_0x23ad11['conditions'][_0xdd8d('0x66')]));}_0x39d1dc=_0x3c91c6['clone']();_0x3c91c6[_0xdd8d('0x1d')](_0x4ae48d);_0x3c91c6[_0xdd8d('0x1a')](0x0);logger[_0xdd8d('0xa2')](_0xdd8d('0x80'),_0x3c91c6[_0xdd8d('0x81')]());return dbH['sequelize']['query'](_0x3c91c6[_0xdd8d('0x81')](),{'type':dbH[_0xdd8d('0x82')]['QueryTypes']['SELECT']});}})[_0xdd8d('0x22')](function(){return{'sql':_0x39d1dc[_0xdd8d('0x81')]()};})[_0xdd8d('0x22')](respondWithResult(_0x5851ba,null))['catch'](handleError(_0x5851ba,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 9c8300a..8090cd8 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 _0x7a58=['AnalyticCustomReport','lodash','util','../../config/logger','api','moment','path','rimraf','./analyticCustomReport.attributes','exports','define'];(function(_0x4aafc3,_0x363832){var _0x16f9c8=function(_0x4793ad){while(--_0x4793ad){_0x4aafc3['push'](_0x4aafc3['shift']());}};_0x16f9c8(++_0x363832);}(_0x7a58,0x1c4));var _0x87a5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7a58[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x87a5('0x0'));var util=require(_0x87a5('0x1'));var logger=require(_0x87a5('0x2'))(_0x87a5('0x3'));var moment=require(_0x87a5('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x87a5('0x5'));var rimraf=require(_0x87a5('0x6'));var config=require('../../config/environment');var attributes=require(_0x87a5('0x7'));module[_0x87a5('0x8')]=function(_0xb0d34d,_0x2c9002){return _0xb0d34d[_0x87a5('0x9')](_0x87a5('0xa'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9cce=['../../config/environment','./analyticCustomReport.attributes','exports','define','lodash','util','api','moment','bluebird','request-promise','rimraf'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x9cce,0x143));var _0xe9cc=function(_0x16325e,_0x32fe16){_0x16325e=_0x16325e-0x0;var _0x57938a=_0x9cce[_0x16325e];return _0x57938a;};'use strict';var _=require(_0xe9cc('0x0'));var util=require(_0xe9cc('0x1'));var logger=require('../../config/logger')(_0xe9cc('0x2'));var moment=require(_0xe9cc('0x3'));var BPromise=require(_0xe9cc('0x4'));var rp=require(_0xe9cc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe9cc('0x6'));var config=require(_0xe9cc('0x7'));var attributes=require(_0xe9cc('0x8'));module[_0xe9cc('0x9')]=function(_0x417a78,_0x2186d6){return _0x417a78[_0xe9cc('0xa')]('AnalyticCustomReport',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 61fd4bf..2e10c7e 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 _0x82a9=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x58f0e3,_0xb32673){var _0x5d85c7=function(_0x47497e){while(--_0x47497e){_0x58f0e3['push'](_0x58f0e3['shift']());}};_0x5d85c7(++_0xb32673);}(_0x82a9,0x131));var _0x982a=function(_0x164c83,_0x5b6ab6){_0x164c83=_0x164c83-0x0;var _0x39df56=_0x82a9[_0x164c83];return _0x39df56;};'use strict';var _=require('lodash');var util=require(_0x982a('0x0'));var moment=require(_0x982a('0x1'));var BPromise=require(_0x982a('0x2'));var rs=require(_0x982a('0x3'));var fs=require('fs');var Redis=require(_0x982a('0x4'));var db=require(_0x982a('0x5'))['db'];var utils=require(_0x982a('0x6'));var logger=require('../../config/logger')(_0x982a('0x7'));var config=require(_0x982a('0x8'));var jayson=require(_0x982a('0x9'));var client=jayson[_0x982a('0xa')][_0x982a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a1659,_0x28860a,_0x493fba){return new BPromise(function(_0x34cad9,_0x5c293a){return client[_0x982a('0xc')](_0x1a1659,_0x493fba)[_0x982a('0xd')](function(_0x16cd9f){logger[_0x982a('0xe')](_0x982a('0xf'),_0x28860a,'request\x20sent');logger['debug'](_0x982a('0x10'),_0x28860a,'request\x20sent',JSON[_0x982a('0x11')](_0x16cd9f));if(_0x16cd9f[_0x982a('0x12')]){if(_0x16cd9f[_0x982a('0x12')][_0x982a('0x13')]===0x1f4){logger[_0x982a('0x12')](_0x982a('0xf'),_0x28860a,_0x16cd9f[_0x982a('0x12')]['message']);return _0x5c293a(_0x16cd9f[_0x982a('0x12')][_0x982a('0x14')]);}logger[_0x982a('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0x28860a,_0x16cd9f[_0x982a('0x12')][_0x982a('0x14')]);return _0x34cad9(_0x16cd9f[_0x982a('0x12')][_0x982a('0x14')]);}else{logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x28860a,_0x982a('0x15'));_0x34cad9(_0x16cd9f[_0x982a('0x16')][_0x982a('0x14')]);}})[_0x982a('0x17')](function(_0x43c472){logger[_0x982a('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0x28860a,_0x43c472);_0x5c293a(_0x43c472);});});} \ No newline at end of file +var _0xce54=['catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xce54,0x127));var _0x4ce5=function(_0x76d454,_0x509218){_0x76d454=_0x76d454-0x0;var _0x490d26=_0xce54[_0x76d454];return _0x490d26;};'use strict';var _=require(_0x4ce5('0x0'));var util=require(_0x4ce5('0x1'));var moment=require(_0x4ce5('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4ce5('0x3'));var db=require(_0x4ce5('0x4'))['db'];var utils=require(_0x4ce5('0x5'));var logger=require(_0x4ce5('0x6'))(_0x4ce5('0x7'));var config=require(_0x4ce5('0x8'));var jayson=require(_0x4ce5('0x9'));var client=jayson['client'][_0x4ce5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x337c91,_0x4a0524,_0x3ff84a){return new BPromise(function(_0x2981c8,_0x383748){return client[_0x4ce5('0xb')](_0x337c91,_0x3ff84a)['then'](function(_0x266d1d){logger[_0x4ce5('0xc')](_0x4ce5('0xd'),_0x4a0524,_0x4ce5('0xe'));logger['debug'](_0x4ce5('0xf'),_0x4a0524,'request\x20sent',JSON['stringify'](_0x266d1d));if(_0x266d1d[_0x4ce5('0x10')]){if(_0x266d1d['error'][_0x4ce5('0x11')]===0x1f4){logger[_0x4ce5('0x10')](_0x4ce5('0xd'),_0x4a0524,_0x266d1d[_0x4ce5('0x10')]['message']);return _0x383748(_0x266d1d[_0x4ce5('0x10')][_0x4ce5('0x12')]);}logger[_0x4ce5('0x10')](_0x4ce5('0xd'),_0x4a0524,_0x266d1d[_0x4ce5('0x10')][_0x4ce5('0x12')]);return _0x2981c8(_0x266d1d[_0x4ce5('0x10')][_0x4ce5('0x12')]);}else{logger[_0x4ce5('0xc')](_0x4ce5('0xd'),_0x4a0524,_0x4ce5('0xe'));_0x2981c8(_0x266d1d[_0x4ce5('0x13')]['message']);}})[_0x4ce5('0x14')](function(_0x259ef3){logger[_0x4ce5('0x10')](_0x4ce5('0xd'),_0x4a0524,_0x259ef3);_0x383748(_0x259ef3);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 390b543..0be880c 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 _0x86d7=['../../config/environment','./analyticCustomReport.controller','isAuthenticated','index','/:id','show','get','/:id/preview','run','/:id/query','query','post','create','put','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x298b27,_0x47ab26){var _0x2074bb=function(_0x33dcbd){while(--_0x33dcbd){_0x298b27['push'](_0x298b27['shift']());}};_0x2074bb(++_0x47ab26);}(_0x86d7,0x168));var _0x786d=function(_0x382500,_0x43e04e){_0x382500=_0x382500-0x0;var _0x4aa842=_0x86d7[_0x382500];return _0x4aa842;};'use strict';var multer=require(_0x786d('0x0'));var util=require(_0x786d('0x1'));var path=require(_0x786d('0x2'));var timeout=require(_0x786d('0x3'));var express=require(_0x786d('0x4'));var router=express[_0x786d('0x5')]();var fs_extra=require(_0x786d('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x786d('0x7'));var config=require(_0x786d('0x8'));var controller=require(_0x786d('0x9'));router['get']('/',auth[_0x786d('0xa')](),controller[_0x786d('0xb')]);router['get'](_0x786d('0xc'),auth['isAuthenticated'](),controller[_0x786d('0xd')]);router[_0x786d('0xe')](_0x786d('0xf'),auth[_0x786d('0xa')](),controller['preview']);router['get']('/:id/run',auth[_0x786d('0xa')](),controller[_0x786d('0x10')]);router[_0x786d('0xe')](_0x786d('0x11'),auth['isAuthenticated'](),controller[_0x786d('0x12')]);router[_0x786d('0x13')]('/',auth[_0x786d('0xa')](),controller[_0x786d('0x14')]);router[_0x786d('0x15')]('/:id',auth[_0x786d('0xa')](),controller['update']);router['delete'](_0x786d('0xc'),auth[_0x786d('0xa')](),controller[_0x786d('0x16')]);module['exports']=router; \ No newline at end of file +var _0xc927=['../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','preview','/:id/query','query','update','delete','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2fca58,_0x54b06c){var _0x931664=function(_0x3b5805){while(--_0x3b5805){_0x2fca58['push'](_0x2fca58['shift']());}};_0x931664(++_0x54b06c);}(_0xc927,0x175));var _0x7c92=function(_0x26ba4a,_0x3c4692){_0x26ba4a=_0x26ba4a-0x0;var _0x3cf3d1=_0xc927[_0x26ba4a];return _0x3cf3d1;};'use strict';var multer=require(_0x7c92('0x0'));var util=require(_0x7c92('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7c92('0x2'));var router=express[_0x7c92('0x3')]();var fs_extra=require(_0x7c92('0x4'));var auth=require(_0x7c92('0x5'));var interaction=require(_0x7c92('0x6'));var config=require(_0x7c92('0x7'));var controller=require(_0x7c92('0x8'));router[_0x7c92('0x9')]('/',auth[_0x7c92('0xa')](),controller[_0x7c92('0xb')]);router[_0x7c92('0x9')](_0x7c92('0xc'),auth['isAuthenticated'](),controller[_0x7c92('0xd')]);router[_0x7c92('0x9')]('/:id/preview',auth[_0x7c92('0xa')](),controller[_0x7c92('0xe')]);router[_0x7c92('0x9')]('/:id/run',auth[_0x7c92('0xa')](),controller['run']);router[_0x7c92('0x9')](_0x7c92('0xf'),auth[_0x7c92('0xa')](),controller[_0x7c92('0x10')]);router['post']('/',auth[_0x7c92('0xa')](),controller['create']);router['put'](_0x7c92('0xc'),auth[_0x7c92('0xa')](),controller[_0x7c92('0x11')]);router[_0x7c92('0x12')](_0x7c92('0xc'),auth[_0x7c92('0xa')](),controller['destroy']);module[_0x7c92('0x13')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 6f23ed1..2e32276 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 _0x5fc3=['sequelize','exports','STRING','TEXT'];(function(_0x1fedb6,_0x5441cb){var _0x3d50e5=function(_0x1928d6){while(--_0x1928d6){_0x1fedb6['push'](_0x1fedb6['shift']());}};_0x3d50e5(++_0x5441cb);}(_0x5fc3,0xa8));var _0x35fc=function(_0x3e531a,_0x28a82a){_0x3e531a=_0x3e531a-0x0;var _0x3c2574=_0x5fc3[_0x3e531a];return _0x3c2574;};'use strict';var Sequelize=require(_0x35fc('0x0'));module[_0x35fc('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x35fc('0x2')]},'parent':{'type':Sequelize[_0x35fc('0x2')]},'table':{'type':Sequelize[_0x35fc('0x2')]},'conditions':{'type':Sequelize[_0x35fc('0x3')]},'joins':{'type':Sequelize[_0x35fc('0x3')]}}; \ No newline at end of file +var _0xdc97=['exports','STRING','TEXT','sequelize'];(function(_0x190ff6,_0x515cfd){var _0x5356d2=function(_0x2cf77c){while(--_0x2cf77c){_0x190ff6['push'](_0x190ff6['shift']());}};_0x5356d2(++_0x515cfd);}(_0xdc97,0x13b));var _0x7dc9=function(_0x52c769,_0x3835b4){_0x52c769=_0x52c769-0x0;var _0x476576=_0xdc97[_0x52c769];return _0x476576;};'use strict';var Sequelize=require(_0x7dc9('0x0'));module[_0x7dc9('0x1')]={'name':{'type':Sequelize[_0x7dc9('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x7dc9('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x7dc9('0x3')]},'joins':{'type':Sequelize[_0x7dc9('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index e4e253b..8a7242d 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 _0xe2fe=['set','Content-Range','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','sendStatus','error','name','send','index','AnalyticDefaultReport','rawAttributes','fieldName','map','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','rules','operator','group','field','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','metric','function','replace','groupBy','orderBy','alias','joins','parse','type','foreignTable','%s.%s\x20=\x20%s.%s','table','parentKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','SEC_TO_TIME(%s)','ROUND(%s)','IS\x20EMPTY','getFields','format','foreignKey','web','%s-%s.%s','randomstring','generate','output','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','../../components/export/','savename','countTable','COUNT(*)','run','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20NOT\x20EMPTY','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','api','../../mysqldb','dbH','status','json','offset','limit','undefined','count'];(function(_0x5933bb,_0x546730){var _0x193a96=function(_0x3b3ee4){while(--_0x3b3ee4){_0x5933bb['push'](_0x5933bb['shift']());}};_0x193a96(++_0x546730);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xee2f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xee2f('0x1'));var rp=require('request-promise');var moment=require(_0xee2f('0x2'));var BPromise=require(_0xee2f('0x3'));var Mustache=require(_0xee2f('0x4'));var util=require(_0xee2f('0x5'));var path=require(_0xee2f('0x6'));var sox=require('sox');var csv=require(_0xee2f('0x7'));var ejs=require(_0xee2f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xee2f('0x9'));var squel=require(_0xee2f('0xa'));var crypto=require('crypto');var jsforce=require(_0xee2f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xee2f('0x7'));var querystring=require(_0xee2f('0xc'));var Papa=require('papaparse');var Redis=require(_0xee2f('0xd'));var authService=require(_0xee2f('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xee2f('0xf'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xee2f('0x10'))['db'];var dbH=require(_0xee2f('0x10'))[_0xee2f('0x11')];function respondWithStatusCode(_0x100449,_0x131874){_0x131874=_0x131874||0xcc;return function(_0x3ab91f){if(_0x3ab91f){return _0x100449['sendStatus'](_0x131874);}return _0x100449[_0xee2f('0x12')](_0x131874)['end']();};}function respondWithResult(_0x36db10,_0x271c1d){_0x271c1d=_0x271c1d||0xc8;return function(_0x48b30c){if(_0x48b30c){return _0x36db10[_0xee2f('0x12')](_0x271c1d)[_0xee2f('0x13')](_0x48b30c);}};}function respondWithFilteredResult(_0x28b614,_0x1bbf7d){return function(_0x390c2c){if(_0x390c2c){var _0x58f42a=typeof _0x1bbf7d[_0xee2f('0x14')]==='undefined'&&typeof _0x1bbf7d[_0xee2f('0x15')]===_0xee2f('0x16');var _0x502eb6=_0x390c2c['count'];var _0x40b5bc=_0x58f42a?0x0:_0x1bbf7d['offset'];var _0x69db88=_0x58f42a?_0x390c2c[_0xee2f('0x17')]:_0x1bbf7d[_0xee2f('0x14')]+_0x1bbf7d['limit'];var _0x35e1a4;if(_0x69db88>=_0x502eb6){_0x69db88=_0x502eb6;_0x35e1a4=0xc8;}else{_0x35e1a4=0xce;}_0x28b614[_0xee2f('0x12')](_0x35e1a4);return _0x28b614[_0xee2f('0x18')](_0xee2f('0x19'),_0x40b5bc+'-'+_0x69db88+'/'+_0x502eb6)[_0xee2f('0x13')](_0x390c2c);}return null;};}function patchUpdates(_0x5d36d4){return function(_0x5e73ad){try{jsonpatch[_0xee2f('0x1a')](_0x5e73ad,_0x5d36d4,!![]);}catch(_0x3a1852){return BPromise[_0xee2f('0x1b')](_0x3a1852);}return _0x5e73ad[_0xee2f('0x1c')]();};}function saveUpdates(_0x472e3b,_0xf278cc){return function(_0x39a39c){if(_0x39a39c){return _0x39a39c['update'](_0x472e3b)[_0xee2f('0x1d')](function(_0x2c47c5){return _0x2c47c5;});}return null;};}function removeEntity(_0x15ceda,_0x70e308){return function(_0x820101){if(_0x820101){return _0x820101[_0xee2f('0x1e')]()[_0xee2f('0x1d')](function(){var _0x13013f=_0x820101[_0xee2f('0x1f')]({'plain':!![]});var _0x1e394f=_0xee2f('0x20');return db[_0xee2f('0x21')][_0xee2f('0x1e')]({'where':{'type':_0x1e394f,'resourceId':_0x13013f['id']}})[_0xee2f('0x1d')](function(){return _0x820101;});})['then'](function(){_0x15ceda['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x18bdbb,_0x18ff19){return function(_0x2cb0cb){if(!_0x2cb0cb){_0x18bdbb[_0xee2f('0x22')](0x194);}return _0x2cb0cb;};}function handleError(_0x892a4e,_0x3737fd){_0x3737fd=_0x3737fd||0x1f4;return function(_0x4d8398){logger[_0xee2f('0x23')](_0x4d8398['stack']);if(_0x4d8398[_0xee2f('0x24')]){delete _0x4d8398[_0xee2f('0x24')];}_0x892a4e[_0xee2f('0x12')](_0x3737fd)[_0xee2f('0x25')](_0x4d8398);};}exports[_0xee2f('0x26')]=function(_0x47d5a6,_0x310c0b){var _0xd16e35={},_0x56706e={},_0x4ee0e1={'count':0x0,'rows':[]};var _0xd1aaac=_['map'](db[_0xee2f('0x27')][_0xee2f('0x28')],function(_0x53d9b7){return{'name':_0x53d9b7[_0xee2f('0x29')],'type':_0x53d9b7['type']['key']};});_0x56706e['model']=_[_0xee2f('0x2a')](_0xd1aaac,_0xee2f('0x24'));_0x56706e['query']=_[_0xee2f('0x2b')](_0x47d5a6[_0xee2f('0x2c')]);_0x56706e[_0xee2f('0x2d')]=_[_0xee2f('0x2e')](_0x56706e[_0xee2f('0x2f')],_0x56706e['query']);_0xd16e35[_0xee2f('0x30')]=_['intersection'](_0x56706e[_0xee2f('0x2f')],qs[_0xee2f('0x31')](_0x47d5a6[_0xee2f('0x2c')]['fields']));_0xd16e35[_0xee2f('0x30')]=_0xd16e35['attributes'][_0xee2f('0x32')]?_0xd16e35['attributes']:_0x56706e[_0xee2f('0x2f')];if(!_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x33')](_0xee2f('0x34'))){_0xd16e35[_0xee2f('0x15')]=qs[_0xee2f('0x15')](_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x15')]);_0xd16e35[_0xee2f('0x14')]=qs[_0xee2f('0x14')](_0x47d5a6[_0xee2f('0x2c')]['offset']);}_0xd16e35[_0xee2f('0x35')]=qs['sort'](_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x36')]);_0xd16e35[_0xee2f('0x37')]=qs[_0xee2f('0x2d')](_[_0xee2f('0x38')](_0x47d5a6[_0xee2f('0x2c')],_0x56706e[_0xee2f('0x2d')]),_0xd1aaac);if(_0x47d5a6[_0xee2f('0x2c')]['filter']){_0xd16e35['where']=_['merge'](_0xd16e35[_0xee2f('0x37')],{'$or':_['map'](_0xd1aaac,function(_0x4501c4){if(_0x4501c4['type']!=='VIRTUAL'){var _0x5027a6={};_0x5027a6[_0x4501c4['name']]={'$like':'%'+_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x39')]+'%'};return _0x5027a6;}})});}_0xd16e35=_[_0xee2f('0x3a')]({},_0xd16e35,_0x47d5a6[_0xee2f('0x3b')]);var _0x4823a7={'where':_0xd16e35['where']};return db[_0xee2f('0x27')]['count'](_0x4823a7)['then'](function(_0x8204dc){_0x4ee0e1[_0xee2f('0x17')]=_0x8204dc;if(_0x47d5a6[_0xee2f('0x2c')]['includeAll']){_0xd16e35[_0xee2f('0x3c')]=[{'all':!![]}];}return db[_0xee2f('0x27')][_0xee2f('0x3d')](_0xd16e35);})['then'](function(_0x5896f6){_0x4ee0e1[_0xee2f('0x3e')]=_0x5896f6;return _0x4ee0e1;})[_0xee2f('0x1d')](respondWithFilteredResult(_0x310c0b,_0xd16e35))[_0xee2f('0x3f')](handleError(_0x310c0b,null));};exports[_0xee2f('0x40')]=function(_0x541fa0,_0x20697e){var _0x1df63d={'raw':!![],'where':{'id':_0x541fa0[_0xee2f('0x41')]['id']}},_0x242e91={};_0x242e91[_0xee2f('0x2f')]=_[_0xee2f('0x2b')](db[_0xee2f('0x27')][_0xee2f('0x28')]);_0x242e91[_0xee2f('0x2c')]=_[_0xee2f('0x2b')](_0x541fa0['query']);_0x242e91['filters']=_['intersection'](_0x242e91['model'],_0x242e91[_0xee2f('0x2c')]);_0x1df63d[_0xee2f('0x30')]=_[_0xee2f('0x2e')](_0x242e91[_0xee2f('0x2f')],qs[_0xee2f('0x31')](_0x541fa0['query'][_0xee2f('0x31')]));_0x1df63d[_0xee2f('0x30')]=_0x1df63d[_0xee2f('0x30')][_0xee2f('0x32')]?_0x1df63d['attributes']:_0x242e91['model'];if(_0x541fa0['query'][_0xee2f('0x42')]){_0x1df63d['include']=[{'all':!![]}];}_0x1df63d=_['merge']({},_0x1df63d,_0x541fa0['options']);return db['AnalyticDefaultReport'][_0xee2f('0x43')](_0x1df63d)[_0xee2f('0x1d')](handleEntityNotFound(_0x20697e,null))[_0xee2f('0x1d')](respondWithResult(_0x20697e,null))['catch'](handleError(_0x20697e,null));};exports[_0xee2f('0x44')]=function(_0x57f65d,_0x3d95b8){return db[_0xee2f('0x27')][_0xee2f('0x44')](_0x57f65d[_0xee2f('0x45')],{})[_0xee2f('0x1d')](function(_0x4978eb){var _0x533ad0=_0x57f65d[_0xee2f('0x46')]['get']({'plain':!![]});if(!_0x533ad0)throw new Error(_0xee2f('0x47'));if(_0x533ad0[_0xee2f('0x48')]===_0xee2f('0x46')){var _0x88e683=_0x4978eb['get']({'plain':!![]});var _0x5df503=_0xee2f('0x49');return db[_0xee2f('0x4a')][_0xee2f('0x43')]({'where':{'name':_0x5df503,'userProfileId':_0x533ad0[_0xee2f('0x4b')]},'raw':!![]})[_0xee2f('0x1d')](function(_0x2a450f){if(_0x2a450f&&_0x2a450f[_0xee2f('0x4c')]===0x0){return db[_0xee2f('0x21')][_0xee2f('0x44')]({'name':_0x88e683[_0xee2f('0x24')],'resourceId':_0x88e683['id'],'type':_0xee2f('0x20'),'sectionId':_0x2a450f['id']},{})[_0xee2f('0x1d')](function(){return _0x4978eb;});}else{return _0x4978eb;}})['catch'](function(_0x34cb51){logger[_0xee2f('0x23')](_0xee2f('0x4d'),_0x34cb51);throw _0x34cb51;});}return _0x4978eb;})[_0xee2f('0x1d')](respondWithResult(_0x3d95b8,0xc9))['catch'](handleError(_0x3d95b8,null));};exports[_0xee2f('0x4e')]=function(_0xb3bf3f,_0x3a476f){if(_0xb3bf3f[_0xee2f('0x45')]['id']){delete _0xb3bf3f[_0xee2f('0x45')]['id'];}return db['AnalyticDefaultReport'][_0xee2f('0x43')]({'where':{'id':_0xb3bf3f['params']['id']}})['then'](handleEntityNotFound(_0x3a476f,null))[_0xee2f('0x1d')](saveUpdates(_0xb3bf3f[_0xee2f('0x45')],null))[_0xee2f('0x1d')](respondWithResult(_0x3a476f,null))[_0xee2f('0x3f')](handleError(_0x3a476f,null));};exports[_0xee2f('0x1e')]=function(_0x101e09,_0x20aaca){return db['AnalyticDefaultReport'][_0xee2f('0x43')]({'where':{'id':_0x101e09[_0xee2f('0x41')]['id']}})[_0xee2f('0x1d')](handleEntityNotFound(_0x20aaca,null))[_0xee2f('0x1d')](removeEntity(_0x20aaca,null))[_0xee2f('0x3f')](handleError(_0x20aaca,null));};exports[_0xee2f('0x4f')]=function(_0xcba6fc,_0x2b9636){var _0x1373a1=0xa;var _0x5d6c40=[_0xee2f('0x50'),'left_join',_0xee2f('0x51'),_0xee2f('0x52')];var _0x1dbbf2={'SUM':_0xee2f('0x53'),'COUNT':_0xee2f('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xee2f('0x55'),'MIN':_0xee2f('0x56'),'AVG':_0xee2f('0x57'),'GROUP_CONCAT':_0xee2f('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4fb159={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xee2f('0x59'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xee2f('0x5a')};var _0x1421da=function(_0xd967e9){return!_[_0xee2f('0x5b')]([_0xee2f('0x5c'),_0xee2f('0x5d'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0xd967e9);};var _0x1708c5=function(_0x58e464){if(!_0x58e464||!_0x58e464[_0xee2f('0x5e')]['length']){return'';}for(var _0x7167f9='(',_0x59af84=0x0;_0x59af84<_0x58e464[_0xee2f('0x5e')][_0xee2f('0x32')];_0x59af84+=0x1){_0x59af84>0x0&&(_0x7167f9+='\x20'+_0x58e464[_0xee2f('0x5f')]+'\x20');_0x7167f9+=_0x58e464['rules'][_0x59af84][_0xee2f('0x60')]?_0x1708c5(_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x60')]):_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x61')]+'\x20'+_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x62')]+(_0x1421da(_0x58e464['rules'][_0x59af84][_0xee2f('0x62')])?'\x20'+_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x63')]:'');}return _0x7167f9+')';};var _0x353bd9={'where':{'id':_0xcba6fc[_0xee2f('0x41')]['id']}},_0x5280c7,_0x3c9d47,_0x8ccc9d,_0x15c7ff,_0x191af8;_0x353bd9=_[_0xee2f('0x3a')]({},_0x353bd9,_0xcba6fc['options']);return db[_0xee2f('0x27')][_0xee2f('0x43')](_0x353bd9)['then'](function(_0x9252e3){if(_0x9252e3){_0x5280c7=_0x9252e3;return _0x9252e3['getFields']();}return null;})[_0xee2f('0x1d')](function(_0x4ed7c9){if(_0x4ed7c9){if(!_0x4ed7c9['length']){throw new db[(_0xee2f('0x64'))][(_0xee2f('0x65'))](_0xee2f('0x66'),0x193);}_0x3c9d47=_0x4ed7c9;return db[_0xee2f('0x67')][_0xee2f('0x3d')]({'raw':!![]});}return null;})['then'](function(_0x238e7d){if(_0x238e7d){_0x8ccc9d=_[_0xee2f('0x68')](_0x238e7d,'id');var _0x42fae8;var _0x5d4fe8=squel[_0xee2f('0x69')]();_0x5d4fe8[_0xee2f('0x6a')](_0x5280c7['table']);for(var _0x1f1c55=0x0;_0x1f1c55<_0x3c9d47[_0xee2f('0x32')];_0x1f1c55+=0x1){_0x42fae8=_0x3c9d47[_0x1f1c55][_0xee2f('0x6b')]?_0x8ccc9d[_0x3c9d47[_0x1f1c55][_0xee2f('0x6b')]][_0xee2f('0x6c')]:_0x3c9d47[_0x1f1c55][_0xee2f('0x61')];_0x42fae8=_0x3c9d47[_0x1f1c55][_0xee2f('0x6d')]?_[_0xee2f('0x6e')](_0x1dbbf2[_0x3c9d47[_0x1f1c55][_0xee2f('0x6d')]],'%s',_0x42fae8):_0x42fae8;_0x42fae8=_0x3c9d47[_0x1f1c55]['format']?_['replace'](_0x4fb159[_0x3c9d47[_0x1f1c55]['format']],'%s',_0x42fae8):_0x42fae8;if(_0x3c9d47[_0x1f1c55][_0xee2f('0x6f')]){_0x5d4fe8[_0xee2f('0x60')](_0x42fae8);}_0x3c9d47[_0x1f1c55][_0xee2f('0x70')]&&_0x5d4fe8[_0xee2f('0x35')](_0x42fae8,_0x3c9d47[_0x1f1c55][_0xee2f('0x70')]==='DESC'?![]:!![]);_0x5d4fe8[_0xee2f('0x61')](_0x42fae8,_0x3c9d47[_0x1f1c55][_0xee2f('0x71')]||_0x42fae8);}if(_0x5280c7['joins']){_0x5280c7[_0xee2f('0x72')]=JSON[_0xee2f('0x73')](_0x5280c7[_0xee2f('0x72')]);for(var _0x5a7b6c=0x0;_0x5a7b6c<_0x5280c7[_0xee2f('0x72')]['length'];_0x5a7b6c+=0x1){if(_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x74')]&&_['includes'](_0x5d6c40,_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x74')])&&_0x5280c7['joins'][_0x5a7b6c]['parentKey']&&_0x5280c7['joins'][_0x5a7b6c][_0xee2f('0x75')]&&_0x5280c7['joins'][_0x5a7b6c]['foreignKey']){_0x5d4fe8[_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x74')]](_0x5280c7['joins'][_0x5a7b6c][_0xee2f('0x75')],null,util['format'](_0xee2f('0x76'),_0x5280c7[_0xee2f('0x77')],_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x78')],_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x75')],_0x5280c7[_0xee2f('0x72')][_0x5a7b6c]['foreignKey']));}}}if(_0x5280c7[_0xee2f('0x79')]){_0x5280c7[_0xee2f('0x79')]=JSON[_0xee2f('0x73')](_0x5280c7[_0xee2f('0x79')]);_0x5d4fe8[_0xee2f('0x37')](_0x1708c5(_0x5280c7['conditions'][_0xee2f('0x60')]));}_0x191af8=_0x5d4fe8[_0xee2f('0x7a')]();_0x5d4fe8[_0xee2f('0x15')](_0x1373a1);_0x5d4fe8[_0xee2f('0x14')](0x0);logger[_0xee2f('0x7b')](_0xee2f('0x7c'),_0x5d4fe8['toString']());return dbH['sequelize'][_0xee2f('0x2c')](_0x5d4fe8[_0xee2f('0x7d')](),{'type':dbH[_0xee2f('0x7e')][_0xee2f('0x7f')][_0xee2f('0x80')]});}})[_0xee2f('0x1d')](respondWithResult(_0x2b9636,null))[_0xee2f('0x3f')](handleError(_0x2b9636,null));};function runReport(_0x58c49e,_0x5b7b55,_0x2ad26d){var _0x27eabc=_0x5b7b55[_0xee2f('0x24')];var _0xc92046=0xa;var _0x38ee46=[_0xee2f('0x50'),_0xee2f('0x81'),_0xee2f('0x51'),_0xee2f('0x52')];var _0x21ac2d={'SUM':_0xee2f('0x53'),'COUNT':_0xee2f('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xee2f('0x56'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x2ea31f={'SEC_TO_TIME':_0xee2f('0x82'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xee2f('0x83'),'UNIX_TIMESTAMP':_0xee2f('0x5a')};var _0x18e191=function(_0x4fad8f){return!_['includes']([_0xee2f('0x5c'),_0xee2f('0x5d'),_0xee2f('0x84'),'IS\x20NOT\x20EMPTY'],_0x4fad8f);};var _0xd7c8f8=function(_0x4b0611){if(!_0x4b0611||!_0x4b0611[_0xee2f('0x5e')]['length']){return'';}for(var _0x378fc9='(',_0x25a3b9=0x0;_0x25a3b9<_0x4b0611[_0xee2f('0x5e')]['length'];_0x25a3b9+=0x1){_0x25a3b9>0x0&&(_0x378fc9+='\x20'+_0x4b0611['operator']+'\x20');_0x378fc9+=_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x60')]?_0xd7c8f8(_0x4b0611[_0xee2f('0x5e')][_0x25a3b9]['group']):_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x61')]+'\x20'+_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x62')]+(_0x18e191(_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x62')])?'\x20'+_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x63')]:'');}return _0x378fc9+')';};var _0x449656={'where':{'id':_0x58c49e['id']}},_0x1db0b5,_0x9f06f9,_0x659080,_0x28bde7,_0x214f94;_0x449656=_['merge']({},_0x449656,_0x2ad26d);return db[_0xee2f('0x27')][_0xee2f('0x43')](_0x449656)[_0xee2f('0x1d')](function(_0x2f5ed7){if(_0x2f5ed7){_0x1db0b5=_0x2f5ed7;return _0x2f5ed7[_0xee2f('0x85')]();}return null;})[_0xee2f('0x1d')](function(_0x34cd09){if(_0x34cd09){if(!_0x34cd09[_0xee2f('0x32')]){throw new db[(_0xee2f('0x64'))][(_0xee2f('0x65'))](_0xee2f('0x66'),0x193);}_0x9f06f9=_0x34cd09;return db['AnalyticMetric'][_0xee2f('0x3d')]({'raw':!![]});}return null;})[_0xee2f('0x1d')](function(_0x1422e9){if(_0x1422e9){_0x659080=_[_0xee2f('0x68')](_0x1422e9,'id');var _0x53d769;var _0x15ca4e=squel[_0xee2f('0x69')]();_0x15ca4e[_0xee2f('0x6a')](_0x1db0b5['table']);for(var _0x4f02aa=0x0;_0x4f02aa<_0x9f06f9[_0xee2f('0x32')];_0x4f02aa+=0x1){_0x53d769=_0x9f06f9[_0x4f02aa]['MetricId']?_0x659080[_0x9f06f9[_0x4f02aa]['MetricId']]['metric']:_0x9f06f9[_0x4f02aa][_0xee2f('0x61')];_0x53d769=_0x9f06f9[_0x4f02aa][_0xee2f('0x6d')]?_[_0xee2f('0x6e')](_0x21ac2d[_0x9f06f9[_0x4f02aa][_0xee2f('0x6d')]],'%s',_0x53d769):_0x53d769;_0x53d769=_0x9f06f9[_0x4f02aa]['format']?_[_0xee2f('0x6e')](_0x2ea31f[_0x9f06f9[_0x4f02aa][_0xee2f('0x86')]],'%s',_0x53d769):_0x53d769;if(_0x9f06f9[_0x4f02aa][_0xee2f('0x6f')]){_0x15ca4e['group'](_0x53d769);}_0x9f06f9[_0x4f02aa][_0xee2f('0x70')]&&_0x15ca4e['order'](_0x53d769,_0x9f06f9[_0x4f02aa][_0xee2f('0x70')]==='DESC'?![]:!![]);_0x15ca4e['field'](_0x53d769,_0x9f06f9[_0x4f02aa][_0xee2f('0x71')]||_0x53d769);}if(_0x1db0b5['joins']){_0x1db0b5[_0xee2f('0x72')]=JSON['parse'](_0x1db0b5['joins']);for(var _0x149d7f=0x0;_0x149d7f<_0x1db0b5[_0xee2f('0x72')]['length'];_0x149d7f+=0x1){if(_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x74')]&&_['includes'](_0x38ee46,_0x1db0b5['joins'][_0x149d7f][_0xee2f('0x74')])&&_0x1db0b5[_0xee2f('0x72')][_0x149d7f]['parentKey']&&_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x75')]&&_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x87')]){_0x15ca4e[_0x1db0b5[_0xee2f('0x72')][_0x149d7f]['type']](_0x1db0b5['joins'][_0x149d7f]['foreignTable'],null,util[_0xee2f('0x86')](_0xee2f('0x76'),_0x1db0b5[_0xee2f('0x77')],_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x78')],_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x75')],_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x87')]));}}}if(_0x1db0b5[_0xee2f('0x79')]){_0x1db0b5[_0xee2f('0x79')]=JSON[_0xee2f('0x73')](_0x1db0b5[_0xee2f('0x79')]);_0x15ca4e[_0xee2f('0x37')](_0xd7c8f8(_0x1db0b5[_0xee2f('0x79')][_0xee2f('0x60')]));}_0x214f94=_0x15ca4e['clone']();_0x15ca4e['limit'](_0xc92046);_0x15ca4e[_0xee2f('0x14')](0x0);return;}})[_0xee2f('0x1d')](function(){if(_0x5b7b55['output']===_0xee2f('0x88')){return null;}var _0x444c39=_[_0xee2f('0x3a')](_0x5b7b55,{'name':_0x5b7b55['fullPath']||_0x5b7b55[_0xee2f('0x24')]||_0x1db0b5[_0xee2f('0x24')],'basename':_0x27eabc,'savename':util[_0xee2f('0x86')](_0xee2f('0x89'),_0x5b7b55[_0xee2f('0x24')]||_0x1db0b5[_0xee2f('0x24')],require(_0xee2f('0x8a'))[_0xee2f('0x8b')](0x4),_0x5b7b55[_0xee2f('0x8c')]||'csv'),'reportId':_0x1db0b5['id'],'reportType':_0xee2f('0x8d')});return db[_0xee2f('0x8e')][_0xee2f('0x44')](_0x444c39,{'raw':!![]});})[_0xee2f('0x1d')](function(_0xe7e196){if(_0x1db0b5[_0xee2f('0x77')]===_0xee2f('0x8f')){_0x214f94[_0xee2f('0x37')](_0x1db0b5['table']+_0xee2f('0x90'),_0x5b7b55[_0xee2f('0x91')],_0x5b7b55['endDate']);}else{_0x214f94[_0xee2f('0x37')](_0x1db0b5['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5b7b55[_0xee2f('0x91')],_0x5b7b55[_0xee2f('0x92')]);}if(_0xe7e196){logger[_0xee2f('0x93')](_0xee2f('0x94'),_0x214f94[_0xee2f('0x7d')]());require(_0xee2f('0x95'))['fork'](path[_0xee2f('0x50')](__dirname,_0xee2f('0x96'),_0xe7e196['output']),[_0xe7e196['id'],_0x214f94[_0xee2f('0x7d')](),path[_0xee2f('0x50')](__dirname,'../../files/reports',_0xe7e196[_0xee2f('0x97')]),_0x27eabc]);return _0xe7e196;}else{var _0x26dd6c=squel[_0xee2f('0x69')]();_0x26dd6c[_0xee2f('0x6a')]('('+_0x214f94[_0xee2f('0x7d')]()+')',_0xee2f('0x98'));_0x26dd6c[_0xee2f('0x61')](_0xee2f('0x99'),_0xee2f('0x17'));_0x214f94[_0xee2f('0x15')](_0x5b7b55[_0xee2f('0x15')]||_0xc92046);_0x214f94[_0xee2f('0x14')](_0x5b7b55['offset']||0x0);return dbH[_0xee2f('0x7e')]['query'](_0x26dd6c['toString'](),{'type':dbH['sequelize'][_0xee2f('0x7f')]['SELECT']})[_0xee2f('0x1d')](function(_0x472f83){if(!_0x472f83[_0xee2f('0x32')]){_0x28bde7=0x0;}else{_0x28bde7=_0x472f83[0x0]['count']||0x0;}return dbH[_0xee2f('0x7e')][_0xee2f('0x2c')](_0x214f94['toString'](),{'type':dbH[_0xee2f('0x7e')][_0xee2f('0x7f')][_0xee2f('0x80')]});})[_0xee2f('0x1d')](function(_0x121a34){return{'rows':_0x121a34||[],'count':_0x28bde7};});}});}exports[_0xee2f('0x9a')]=function(_0x3d8c56,_0x5c8550){return runReport(_0x3d8c56[_0xee2f('0x41')],_0x3d8c56[_0xee2f('0x2c')],_0x3d8c56['options'])[_0xee2f('0x1d')](respondWithResult(_0x5c8550,null))[_0xee2f('0x3f')](handleError(_0x5c8550,null));};exports[_0xee2f('0x9b')]=runReport;exports['query']=function(_0x40fa57,_0x1fafcc){var _0x1163f1=0xa;var _0x162014=[_0xee2f('0x50'),_0xee2f('0x81'),'right_join',_0xee2f('0x52')];var _0xb93091={'SUM':_0xee2f('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xee2f('0x55'),'MIN':'MIN(%s)','AVG':_0xee2f('0x57'),'GROUP_CONCAT':_0xee2f('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xee2f('0x9c')};var _0x39922f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xee2f('0x59'),'ROUND':_0xee2f('0x83'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1c9f70=function(_0xa93dc9){return!_[_0xee2f('0x5b')]([_0xee2f('0x5c'),'IS\x20NOT\x20NULL',_0xee2f('0x84'),_0xee2f('0x9d')],_0xa93dc9);};var _0x44b06b=function(_0x541ac7){if(!_0x541ac7||!_0x541ac7[_0xee2f('0x5e')][_0xee2f('0x32')]){return'';}for(var _0xa89897='(',_0x2def5c=0x0;_0x2def5c<_0x541ac7['rules']['length'];_0x2def5c+=0x1){_0x2def5c>0x0&&(_0xa89897+='\x20'+_0x541ac7[_0xee2f('0x5f')]+'\x20');_0xa89897+=_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x60')]?_0x44b06b(_0x541ac7['rules'][_0x2def5c][_0xee2f('0x60')]):_0x541ac7[_0xee2f('0x5e')][_0x2def5c]['field']+'\x20'+_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x62')]+(_0x1c9f70(_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x62')])?'\x20'+_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x63')]:'');}return _0xa89897+')';};var _0x3f9188={'where':{'id':_0x40fa57['params']['id']}},_0x236b63,_0x4ad336,_0x3370de,_0x3c8c20,_0xc9228;_0x3f9188=_[_0xee2f('0x3a')]({},_0x3f9188,_0x40fa57[_0xee2f('0x3b')]);return db[_0xee2f('0x27')][_0xee2f('0x43')](_0x3f9188)[_0xee2f('0x1d')](function(_0xa0dfdd){if(_0xa0dfdd){_0x236b63=_0xa0dfdd;return _0xa0dfdd[_0xee2f('0x85')]();}return null;})[_0xee2f('0x1d')](function(_0x298dfa){if(_0x298dfa){if(!_0x298dfa[_0xee2f('0x32')]){throw new db[(_0xee2f('0x64'))][(_0xee2f('0x65'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4ad336=_0x298dfa;return db[_0xee2f('0x67')]['findAll']({'raw':!![]});}return null;})[_0xee2f('0x1d')](function(_0x35a1c9){if(_0x35a1c9){_0x3370de=_['keyBy'](_0x35a1c9,'id');var _0x464e9e;var _0x738f35=squel[_0xee2f('0x69')]();_0x738f35[_0xee2f('0x6a')](_0x236b63[_0xee2f('0x77')]);for(var _0xe24a8a=0x0;_0xe24a8a<_0x4ad336['length'];_0xe24a8a+=0x1){_0x464e9e=_0x4ad336[_0xe24a8a][_0xee2f('0x6b')]?_0x3370de[_0x4ad336[_0xe24a8a][_0xee2f('0x6b')]][_0xee2f('0x6c')]:_0x4ad336[_0xe24a8a][_0xee2f('0x61')];_0x464e9e=_0x4ad336[_0xe24a8a][_0xee2f('0x6d')]?_[_0xee2f('0x6e')](_0xb93091[_0x4ad336[_0xe24a8a][_0xee2f('0x6d')]],'%s',_0x464e9e):_0x464e9e;_0x464e9e=_0x4ad336[_0xe24a8a][_0xee2f('0x86')]?_[_0xee2f('0x6e')](_0x39922f[_0x4ad336[_0xe24a8a][_0xee2f('0x86')]],'%s',_0x464e9e):_0x464e9e;if(_0x4ad336[_0xe24a8a]['groupBy']){_0x738f35[_0xee2f('0x60')](_0x464e9e);}_0x4ad336[_0xe24a8a][_0xee2f('0x70')]&&_0x738f35[_0xee2f('0x35')](_0x464e9e,_0x4ad336[_0xe24a8a]['orderBy']==='DESC'?![]:!![]);_0x738f35[_0xee2f('0x61')](_0x464e9e,_0x4ad336[_0xe24a8a][_0xee2f('0x71')]||_0x464e9e);}if(_0x236b63[_0xee2f('0x72')]){_0x236b63[_0xee2f('0x72')]=JSON[_0xee2f('0x73')](_0x236b63['joins']);for(var _0x1cee16=0x0;_0x1cee16<_0x236b63[_0xee2f('0x72')]['length'];_0x1cee16+=0x1){if(_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x74')]&&_[_0xee2f('0x5b')](_0x162014,_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x74')])&&_0x236b63[_0xee2f('0x72')][_0x1cee16]['parentKey']&&_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x75')]&&_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x87')]){_0x738f35[_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x74')]](_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x75')],null,util[_0xee2f('0x86')](_0xee2f('0x76'),_0x236b63[_0xee2f('0x77')],_0x236b63['joins'][_0x1cee16][_0xee2f('0x78')],_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x75')],_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x87')]));}}}if(_0x236b63[_0xee2f('0x79')]){_0x236b63['conditions']=JSON[_0xee2f('0x73')](_0x236b63[_0xee2f('0x79')]);_0x738f35[_0xee2f('0x37')](_0x44b06b(_0x236b63[_0xee2f('0x79')]['group']));}_0xc9228=_0x738f35[_0xee2f('0x7a')]();_0x738f35[_0xee2f('0x15')](_0x1163f1);_0x738f35[_0xee2f('0x14')](0x0);logger[_0xee2f('0x7b')](_0xee2f('0x7c'),_0x738f35[_0xee2f('0x7d')]());return dbH[_0xee2f('0x7e')][_0xee2f('0x2c')](_0x738f35['toString'](),{'type':dbH['sequelize'][_0xee2f('0x7f')][_0xee2f('0x80')]});}})[_0xee2f('0x1d')](function(){return{'sql':_0xc9228['toString']()};})[_0xee2f('0x1d')](respondWithResult(_0x1fafcc,null))['catch'](handleError(_0x1fafcc,null));}; \ No newline at end of file +var _0x0295=['default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','fork','../../files/reports','COUNT(*)','SELECT','run','runReport','MAX(%s)','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','get','UserProfileResource','destroy','error','name','send','index','map','AnalyticDefaultReport','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','autoAssociation','DefaultReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MIN(%s)','AVG(%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\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','field','condition','value','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','from','table','MetricId','metric','function','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','group','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20EMPTY','operator','getFields','findAll','select','replace','output','web','%s-%s.%s','randomstring','generate','csv'];(function(_0x50059f,_0x1b78ed){var _0x1a06df=function(_0x3cfb82){while(--_0x3cfb82){_0x50059f['push'](_0x50059f['shift']());}};_0x1a06df(++_0x1b78ed);}(_0x0295,0x1f0));var _0x5029=function(_0x1ff7f9,_0x7f4e5d){_0x1ff7f9=_0x1ff7f9-0x0;var _0x42f261=_0x0295[_0x1ff7f9];return _0x42f261;};'use strict';var emlformat=require(_0x5029('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5029('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5029('0x2'));var Mustache=require(_0x5029('0x3'));var util=require(_0x5029('0x4'));var path=require(_0x5029('0x5'));var sox=require(_0x5029('0x6'));var csv=require(_0x5029('0x7'));var ejs=require(_0x5029('0x8'));var fs=require('fs');var fs_extra=require(_0x5029('0x9'));var _=require(_0x5029('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5029('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5029('0xc'));var Papa=require('papaparse');var Redis=require(_0x5029('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x5029('0xe'));var as=require(_0x5029('0xf'));var hardwareService=require(_0x5029('0x10'));var logger=require('../../config/logger')(_0x5029('0x11'));var utils=require(_0x5029('0x12'));var config=require(_0x5029('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5029('0x14'))['db'];var dbH=require(_0x5029('0x14'))['dbH'];function respondWithStatusCode(_0x4fa22d,_0x49f836){_0x49f836=_0x49f836||0xcc;return function(_0x4aebb6){if(_0x4aebb6){return _0x4fa22d[_0x5029('0x15')](_0x49f836);}return _0x4fa22d[_0x5029('0x16')](_0x49f836)[_0x5029('0x17')]();};}function respondWithResult(_0x434630,_0x2c0b33){_0x2c0b33=_0x2c0b33||0xc8;return function(_0x11c24b){if(_0x11c24b){return _0x434630[_0x5029('0x16')](_0x2c0b33)[_0x5029('0x18')](_0x11c24b);}};}function respondWithFilteredResult(_0x10bf55,_0x326923){return function(_0x457c73){if(_0x457c73){var _0x353cba=typeof _0x326923[_0x5029('0x19')]===_0x5029('0x1a')&&typeof _0x326923[_0x5029('0x1b')]==='undefined';var _0x1ed567=_0x457c73[_0x5029('0x1c')];var _0x35de81=_0x353cba?0x0:_0x326923[_0x5029('0x19')];var _0x8cea01=_0x353cba?_0x457c73[_0x5029('0x1c')]:_0x326923[_0x5029('0x19')]+_0x326923['limit'];var _0x226a5c;if(_0x8cea01>=_0x1ed567){_0x8cea01=_0x1ed567;_0x226a5c=0xc8;}else{_0x226a5c=0xce;}_0x10bf55['status'](_0x226a5c);return _0x10bf55[_0x5029('0x1d')](_0x5029('0x1e'),_0x35de81+'-'+_0x8cea01+'/'+_0x1ed567)[_0x5029('0x18')](_0x457c73);}return null;};}function patchUpdates(_0x3cf0fb){return function(_0x4b5854){try{jsonpatch['apply'](_0x4b5854,_0x3cf0fb,!![]);}catch(_0x4c9184){return BPromise['reject'](_0x4c9184);}return _0x4b5854[_0x5029('0x1f')]();};}function saveUpdates(_0x853a34,_0x1eb228){return function(_0x2bbbcb){if(_0x2bbbcb){return _0x2bbbcb[_0x5029('0x20')](_0x853a34)[_0x5029('0x21')](function(_0x125c26){return _0x125c26;});}return null;};}function removeEntity(_0x356dac,_0x3e857d){return function(_0x4ceaae){if(_0x4ceaae){return _0x4ceaae['destroy']()['then'](function(){var _0x588d90=_0x4ceaae[_0x5029('0x22')]({'plain':!![]});var _0x51093c='DefaultReports';return db[_0x5029('0x23')][_0x5029('0x24')]({'where':{'type':_0x51093c,'resourceId':_0x588d90['id']}})[_0x5029('0x21')](function(){return _0x4ceaae;});})['then'](function(){_0x356dac[_0x5029('0x16')](0xcc)[_0x5029('0x17')]();});}};}function handleEntityNotFound(_0x5e45c4,_0x2b6d99){return function(_0x31f0a0){if(!_0x31f0a0){_0x5e45c4[_0x5029('0x15')](0x194);}return _0x31f0a0;};}function handleError(_0x4a24b9,_0x32da06){_0x32da06=_0x32da06||0x1f4;return function(_0x251f99){logger[_0x5029('0x25')](_0x251f99['stack']);if(_0x251f99[_0x5029('0x26')]){delete _0x251f99[_0x5029('0x26')];}_0x4a24b9['status'](_0x32da06)[_0x5029('0x27')](_0x251f99);};}exports[_0x5029('0x28')]=function(_0x4434ff,_0x1c3dd9){var _0x196830={},_0x2a1ed6={},_0x44255a={'count':0x0,'rows':[]};var _0x465153=_[_0x5029('0x29')](db[_0x5029('0x2a')][_0x5029('0x2b')],function(_0x4519c8){return{'name':_0x4519c8['fieldName'],'type':_0x4519c8[_0x5029('0x2c')]['key']};});_0x2a1ed6[_0x5029('0x2d')]=_['map'](_0x465153,'name');_0x2a1ed6[_0x5029('0x2e')]=_[_0x5029('0x2f')](_0x4434ff[_0x5029('0x2e')]);_0x2a1ed6['filters']=_[_0x5029('0x30')](_0x2a1ed6[_0x5029('0x2d')],_0x2a1ed6[_0x5029('0x2e')]);_0x196830[_0x5029('0x31')]=_[_0x5029('0x30')](_0x2a1ed6[_0x5029('0x2d')],qs[_0x5029('0x32')](_0x4434ff[_0x5029('0x2e')][_0x5029('0x32')]));_0x196830['attributes']=_0x196830[_0x5029('0x31')][_0x5029('0x33')]?_0x196830[_0x5029('0x31')]:_0x2a1ed6[_0x5029('0x2d')];if(!_0x4434ff['query'][_0x5029('0x34')](_0x5029('0x35'))){_0x196830[_0x5029('0x1b')]=qs['limit'](_0x4434ff['query'][_0x5029('0x1b')]);_0x196830[_0x5029('0x19')]=qs['offset'](_0x4434ff['query'][_0x5029('0x19')]);}_0x196830[_0x5029('0x36')]=qs[_0x5029('0x37')](_0x4434ff[_0x5029('0x2e')][_0x5029('0x37')]);_0x196830[_0x5029('0x38')]=qs[_0x5029('0x39')](_[_0x5029('0x3a')](_0x4434ff[_0x5029('0x2e')],_0x2a1ed6[_0x5029('0x39')]),_0x465153);if(_0x4434ff[_0x5029('0x2e')][_0x5029('0x3b')]){_0x196830[_0x5029('0x38')]=_[_0x5029('0x3c')](_0x196830['where'],{'$or':_['map'](_0x465153,function(_0x73797c){if(_0x73797c[_0x5029('0x2c')]!==_0x5029('0x3d')){var _0x48c9eb={};_0x48c9eb[_0x73797c[_0x5029('0x26')]]={'$like':'%'+_0x4434ff[_0x5029('0x2e')]['filter']+'%'};return _0x48c9eb;}})});}_0x196830=_[_0x5029('0x3c')]({},_0x196830,_0x4434ff['options']);var _0x506f0d={'where':_0x196830['where']};return db[_0x5029('0x2a')][_0x5029('0x1c')](_0x506f0d)[_0x5029('0x21')](function(_0x78768){_0x44255a[_0x5029('0x1c')]=_0x78768;if(_0x4434ff[_0x5029('0x2e')][_0x5029('0x3e')]){_0x196830[_0x5029('0x3f')]=[{'all':!![]}];}return db[_0x5029('0x2a')]['findAll'](_0x196830);})[_0x5029('0x21')](function(_0x236455){_0x44255a[_0x5029('0x40')]=_0x236455;return _0x44255a;})[_0x5029('0x21')](respondWithFilteredResult(_0x1c3dd9,_0x196830))[_0x5029('0x41')](handleError(_0x1c3dd9,null));};exports[_0x5029('0x42')]=function(_0x5658a7,_0x259db8){var _0xa1580a={'raw':!![],'where':{'id':_0x5658a7[_0x5029('0x43')]['id']}},_0x9434ed={};_0x9434ed[_0x5029('0x2d')]=_['keys'](db[_0x5029('0x2a')][_0x5029('0x2b')]);_0x9434ed[_0x5029('0x2e')]=_[_0x5029('0x2f')](_0x5658a7[_0x5029('0x2e')]);_0x9434ed[_0x5029('0x39')]=_[_0x5029('0x30')](_0x9434ed[_0x5029('0x2d')],_0x9434ed[_0x5029('0x2e')]);_0xa1580a['attributes']=_[_0x5029('0x30')](_0x9434ed[_0x5029('0x2d')],qs[_0x5029('0x32')](_0x5658a7[_0x5029('0x2e')]['fields']));_0xa1580a['attributes']=_0xa1580a[_0x5029('0x31')][_0x5029('0x33')]?_0xa1580a[_0x5029('0x31')]:_0x9434ed[_0x5029('0x2d')];if(_0x5658a7[_0x5029('0x2e')][_0x5029('0x3e')]){_0xa1580a[_0x5029('0x3f')]=[{'all':!![]}];}_0xa1580a=_[_0x5029('0x3c')]({},_0xa1580a,_0x5658a7[_0x5029('0x44')]);return db[_0x5029('0x2a')][_0x5029('0x45')](_0xa1580a)[_0x5029('0x21')](handleEntityNotFound(_0x259db8,null))[_0x5029('0x21')](respondWithResult(_0x259db8,null))[_0x5029('0x41')](handleError(_0x259db8,null));};exports[_0x5029('0x46')]=function(_0x175cc0,_0x10fc07){return db[_0x5029('0x2a')][_0x5029('0x46')](_0x175cc0[_0x5029('0x47')],{})[_0x5029('0x21')](function(_0x489457){var _0x1069c4=_0x175cc0['user'][_0x5029('0x22')]({'plain':!![]});if(!_0x1069c4)throw new Error(_0x5029('0x48'));if(_0x1069c4['role']==='user'){var _0x319bff=_0x489457['get']({'plain':!![]});var _0x4aaa43=_0x5029('0x49');return db[_0x5029('0x4a')][_0x5029('0x45')]({'where':{'name':_0x4aaa43,'userProfileId':_0x1069c4['userProfileId']},'raw':!![]})['then'](function(_0x1510bb){if(_0x1510bb&&_0x1510bb[_0x5029('0x4b')]===0x0){return db['UserProfileResource'][_0x5029('0x46')]({'name':_0x319bff['name'],'resourceId':_0x319bff['id'],'type':_0x5029('0x4c'),'sectionId':_0x1510bb['id']},{})['then'](function(){return _0x489457;});}else{return _0x489457;}})[_0x5029('0x41')](function(_0x27e1c0){logger[_0x5029('0x25')](_0x5029('0x4d'),_0x27e1c0);throw _0x27e1c0;});}return _0x489457;})[_0x5029('0x21')](respondWithResult(_0x10fc07,0xc9))[_0x5029('0x41')](handleError(_0x10fc07,null));};exports[_0x5029('0x20')]=function(_0xa25013,_0x586936){if(_0xa25013[_0x5029('0x47')]['id']){delete _0xa25013['body']['id'];}return db[_0x5029('0x2a')][_0x5029('0x45')]({'where':{'id':_0xa25013['params']['id']}})[_0x5029('0x21')](handleEntityNotFound(_0x586936,null))['then'](saveUpdates(_0xa25013['body'],null))['then'](respondWithResult(_0x586936,null))[_0x5029('0x41')](handleError(_0x586936,null));};exports['destroy']=function(_0x49d1db,_0x353ae4){return db[_0x5029('0x2a')]['find']({'where':{'id':_0x49d1db[_0x5029('0x43')]['id']}})['then'](handleEntityNotFound(_0x353ae4,null))['then'](removeEntity(_0x353ae4,null))[_0x5029('0x41')](handleError(_0x353ae4,null));};exports[_0x5029('0x4e')]=function(_0x81e39c,_0x448273){var _0x164179=0xa;var _0x4e8d9f=[_0x5029('0x4f'),_0x5029('0x50'),_0x5029('0x51'),_0x5029('0x52')];var _0x4dca54={'SUM':_0x5029('0x53'),'COUNT':_0x5029('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x5029('0x55'),'AVG':_0x5029('0x56'),'GROUP_CONCAT':_0x5029('0x57'),'GROUP_CONCAT ASC':_0x5029('0x58'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4208ab={'SEC_TO_TIME':_0x5029('0x59'),'DATE':_0x5029('0x5a'),'HOUR':_0x5029('0x5b'),'ROUND':_0x5029('0x5c'),'UNIX_TIMESTAMP':_0x5029('0x5d')};var _0x59a718=function(_0x560324){return!_[_0x5029('0x5e')]([_0x5029('0x5f'),_0x5029('0x60'),'IS\x20EMPTY',_0x5029('0x61')],_0x560324);};var _0x2d439a=function(_0x105638){if(!_0x105638||!_0x105638[_0x5029('0x62')][_0x5029('0x33')]){return'';}for(var _0x5264c6='(',_0x2ec5d0=0x0;_0x2ec5d0<_0x105638[_0x5029('0x62')][_0x5029('0x33')];_0x2ec5d0+=0x1){_0x2ec5d0>0x0&&(_0x5264c6+='\x20'+_0x105638['operator']+'\x20');_0x5264c6+=_0x105638[_0x5029('0x62')][_0x2ec5d0]['group']?_0x2d439a(_0x105638[_0x5029('0x62')][_0x2ec5d0]['group']):_0x105638[_0x5029('0x62')][_0x2ec5d0][_0x5029('0x63')]+'\x20'+_0x105638[_0x5029('0x62')][_0x2ec5d0][_0x5029('0x64')]+(_0x59a718(_0x105638[_0x5029('0x62')][_0x2ec5d0][_0x5029('0x64')])?'\x20'+_0x105638['rules'][_0x2ec5d0][_0x5029('0x65')]:'');}return _0x5264c6+')';};var _0x19220d={'where':{'id':_0x81e39c['params']['id']}},_0x1ff8df,_0x151562,_0x389700,_0x506f74,_0x13ca47;_0x19220d=_[_0x5029('0x3c')]({},_0x19220d,_0x81e39c['options']);return db[_0x5029('0x2a')]['find'](_0x19220d)[_0x5029('0x21')](function(_0x54daf9){if(_0x54daf9){_0x1ff8df=_0x54daf9;return _0x54daf9['getFields']();}return null;})[_0x5029('0x21')](function(_0x575f09){if(_0x575f09){if(!_0x575f09[_0x5029('0x33')]){throw new db[(_0x5029('0x66'))][(_0x5029('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x151562=_0x575f09;return db[_0x5029('0x68')]['findAll']({'raw':!![]});}return null;})[_0x5029('0x21')](function(_0x255dfb){if(_0x255dfb){_0x389700=_[_0x5029('0x69')](_0x255dfb,'id');var _0x1cca02;var _0x1deed7=squel['select']();_0x1deed7[_0x5029('0x6a')](_0x1ff8df[_0x5029('0x6b')]);for(var _0x5890ac=0x0;_0x5890ac<_0x151562[_0x5029('0x33')];_0x5890ac+=0x1){_0x1cca02=_0x151562[_0x5890ac][_0x5029('0x6c')]?_0x389700[_0x151562[_0x5890ac][_0x5029('0x6c')]][_0x5029('0x6d')]:_0x151562[_0x5890ac][_0x5029('0x63')];_0x1cca02=_0x151562[_0x5890ac][_0x5029('0x6e')]?_['replace'](_0x4dca54[_0x151562[_0x5890ac]['function']],'%s',_0x1cca02):_0x1cca02;_0x1cca02=_0x151562[_0x5890ac][_0x5029('0x6f')]?_['replace'](_0x4208ab[_0x151562[_0x5890ac][_0x5029('0x6f')]],'%s',_0x1cca02):_0x1cca02;if(_0x151562[_0x5890ac][_0x5029('0x70')]){_0x1deed7['group'](_0x1cca02);}_0x151562[_0x5890ac][_0x5029('0x71')]&&_0x1deed7['order'](_0x1cca02,_0x151562[_0x5890ac]['orderBy']===_0x5029('0x72')?![]:!![]);_0x1deed7[_0x5029('0x63')](_0x1cca02,_0x151562[_0x5890ac][_0x5029('0x73')]||_0x1cca02);}if(_0x1ff8df[_0x5029('0x74')]){_0x1ff8df['joins']=JSON[_0x5029('0x75')](_0x1ff8df[_0x5029('0x74')]);for(var _0x4a2ce8=0x0;_0x4a2ce8<_0x1ff8df[_0x5029('0x74')][_0x5029('0x33')];_0x4a2ce8+=0x1){if(_0x1ff8df['joins'][_0x4a2ce8]['type']&&_['includes'](_0x4e8d9f,_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x2c')])&&_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x76')]&&_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x77')]&&_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x78')]){_0x1deed7[_0x1ff8df[_0x5029('0x74')][_0x4a2ce8]['type']](_0x1ff8df['joins'][_0x4a2ce8][_0x5029('0x77')],null,util[_0x5029('0x6f')](_0x5029('0x79'),_0x1ff8df[_0x5029('0x6b')],_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x76')],_0x1ff8df[_0x5029('0x74')][_0x4a2ce8]['foreignTable'],_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x78')]));}}}if(_0x1ff8df[_0x5029('0x7a')]){_0x1ff8df['conditions']=JSON[_0x5029('0x75')](_0x1ff8df[_0x5029('0x7a')]);_0x1deed7[_0x5029('0x38')](_0x2d439a(_0x1ff8df['conditions'][_0x5029('0x7b')]));}_0x13ca47=_0x1deed7[_0x5029('0x7c')]();_0x1deed7[_0x5029('0x1b')](_0x164179);_0x1deed7['offset'](0x0);logger[_0x5029('0x7d')](_0x5029('0x7e'),_0x1deed7['toString']());return dbH[_0x5029('0x7f')][_0x5029('0x2e')](_0x1deed7[_0x5029('0x80')](),{'type':dbH[_0x5029('0x7f')][_0x5029('0x81')]['SELECT']});}})[_0x5029('0x21')](respondWithResult(_0x448273,null))[_0x5029('0x41')](handleError(_0x448273,null));};function runReport(_0x426d70,_0xe6ac28,_0x153cdc){var _0x5e7f50=_0xe6ac28[_0x5029('0x26')];var _0x202c51=0xa;var _0x344203=['join',_0x5029('0x50'),_0x5029('0x51'),_0x5029('0x52')];var _0x3e47bd={'SUM':_0x5029('0x53'),'COUNT':_0x5029('0x54'),'COUNT DISTINCT':_0x5029('0x82'),'MAX':'MAX(%s)','MIN':_0x5029('0x55'),'AVG':_0x5029('0x56'),'GROUP_CONCAT':_0x5029('0x57'),'GROUP_CONCAT ASC':_0x5029('0x58'),'GROUP_CONCAT DESC':_0x5029('0x83')};var _0x4c40d1={'SEC_TO_TIME':_0x5029('0x59'),'DATE':_0x5029('0x5a'),'HOUR':_0x5029('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x5029('0x5d')};var _0x41e2d8=function(_0x51098a){return!_['includes'](['IS\x20NULL',_0x5029('0x60'),_0x5029('0x84'),_0x5029('0x61')],_0x51098a);};var _0x4007c8=function(_0x3dc05a){if(!_0x3dc05a||!_0x3dc05a['rules'][_0x5029('0x33')]){return'';}for(var _0x2e4782='(',_0x2c0540=0x0;_0x2c0540<_0x3dc05a['rules']['length'];_0x2c0540+=0x1){_0x2c0540>0x0&&(_0x2e4782+='\x20'+_0x3dc05a[_0x5029('0x85')]+'\x20');_0x2e4782+=_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x7b')]?_0x4007c8(_0x3dc05a[_0x5029('0x62')][_0x2c0540]['group']):_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x63')]+'\x20'+_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x64')]+(_0x41e2d8(_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x64')])?'\x20'+_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x65')]:'');}return _0x2e4782+')';};var _0x5aecc2={'where':{'id':_0x426d70['id']}},_0x159450,_0x556c7a,_0x48bbe2,_0x3e3150,_0x533ee2;_0x5aecc2=_[_0x5029('0x3c')]({},_0x5aecc2,_0x153cdc);return db[_0x5029('0x2a')][_0x5029('0x45')](_0x5aecc2)[_0x5029('0x21')](function(_0x1b6f4c){if(_0x1b6f4c){_0x159450=_0x1b6f4c;return _0x1b6f4c[_0x5029('0x86')]();}return null;})[_0x5029('0x21')](function(_0x1d6092){if(_0x1d6092){if(!_0x1d6092['length']){throw new db['Sequelize'][(_0x5029('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x556c7a=_0x1d6092;return db['AnalyticMetric'][_0x5029('0x87')]({'raw':!![]});}return null;})['then'](function(_0x4b25ed){if(_0x4b25ed){_0x48bbe2=_[_0x5029('0x69')](_0x4b25ed,'id');var _0xb8da0b;var _0x13e07e=squel[_0x5029('0x88')]();_0x13e07e[_0x5029('0x6a')](_0x159450['table']);for(var _0x38c02a=0x0;_0x38c02a<_0x556c7a[_0x5029('0x33')];_0x38c02a+=0x1){_0xb8da0b=_0x556c7a[_0x38c02a][_0x5029('0x6c')]?_0x48bbe2[_0x556c7a[_0x38c02a]['MetricId']][_0x5029('0x6d')]:_0x556c7a[_0x38c02a][_0x5029('0x63')];_0xb8da0b=_0x556c7a[_0x38c02a][_0x5029('0x6e')]?_[_0x5029('0x89')](_0x3e47bd[_0x556c7a[_0x38c02a][_0x5029('0x6e')]],'%s',_0xb8da0b):_0xb8da0b;_0xb8da0b=_0x556c7a[_0x38c02a]['format']?_['replace'](_0x4c40d1[_0x556c7a[_0x38c02a][_0x5029('0x6f')]],'%s',_0xb8da0b):_0xb8da0b;if(_0x556c7a[_0x38c02a][_0x5029('0x70')]){_0x13e07e['group'](_0xb8da0b);}_0x556c7a[_0x38c02a][_0x5029('0x71')]&&_0x13e07e[_0x5029('0x36')](_0xb8da0b,_0x556c7a[_0x38c02a][_0x5029('0x71')]===_0x5029('0x72')?![]:!![]);_0x13e07e[_0x5029('0x63')](_0xb8da0b,_0x556c7a[_0x38c02a][_0x5029('0x73')]||_0xb8da0b);}if(_0x159450[_0x5029('0x74')]){_0x159450[_0x5029('0x74')]=JSON['parse'](_0x159450['joins']);for(var _0x4243c3=0x0;_0x4243c3<_0x159450['joins'][_0x5029('0x33')];_0x4243c3+=0x1){if(_0x159450['joins'][_0x4243c3][_0x5029('0x2c')]&&_[_0x5029('0x5e')](_0x344203,_0x159450[_0x5029('0x74')][_0x4243c3]['type'])&&_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x76')]&&_0x159450[_0x5029('0x74')][_0x4243c3]['foreignTable']&&_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x78')]){_0x13e07e[_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x2c')]](_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x77')],null,util[_0x5029('0x6f')](_0x5029('0x79'),_0x159450[_0x5029('0x6b')],_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x76')],_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x77')],_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x78')]));}}}if(_0x159450[_0x5029('0x7a')]){_0x159450[_0x5029('0x7a')]=JSON[_0x5029('0x75')](_0x159450['conditions']);_0x13e07e[_0x5029('0x38')](_0x4007c8(_0x159450[_0x5029('0x7a')][_0x5029('0x7b')]));}_0x533ee2=_0x13e07e[_0x5029('0x7c')]();_0x13e07e[_0x5029('0x1b')](_0x202c51);_0x13e07e['offset'](0x0);return;}})[_0x5029('0x21')](function(){if(_0xe6ac28[_0x5029('0x8a')]===_0x5029('0x8b')){return null;}var _0xf7729c=_[_0x5029('0x3c')](_0xe6ac28,{'name':_0xe6ac28['fullPath']||_0xe6ac28[_0x5029('0x26')]||_0x159450[_0x5029('0x26')],'basename':_0x5e7f50,'savename':util[_0x5029('0x6f')](_0x5029('0x8c'),_0xe6ac28[_0x5029('0x26')]||_0x159450['name'],require(_0x5029('0x8d'))[_0x5029('0x8e')](0x4),_0xe6ac28[_0x5029('0x8a')]||_0x5029('0x8f')),'reportId':_0x159450['id'],'reportType':_0x5029('0x90')});return db[_0x5029('0x91')][_0x5029('0x46')](_0xf7729c,{'raw':!![]});})[_0x5029('0x21')](function(_0x4a7535){if(_0x159450['table']===_0x5029('0x92')){_0x533ee2[_0x5029('0x38')](_0x159450[_0x5029('0x6b')]+_0x5029('0x93'),_0xe6ac28[_0x5029('0x94')],_0xe6ac28['endDate']);}else{_0x533ee2[_0x5029('0x38')](_0x159450['table']+_0x5029('0x95'),_0xe6ac28[_0x5029('0x94')],_0xe6ac28[_0x5029('0x96')]);}if(_0x4a7535){logger[_0x5029('0x97')](_0x5029('0x98'),_0x533ee2[_0x5029('0x80')]());require('child_process')[_0x5029('0x99')](path[_0x5029('0x4f')](__dirname,'../../components/export/',_0x4a7535[_0x5029('0x8a')]),[_0x4a7535['id'],_0x533ee2[_0x5029('0x80')](),path['join'](__dirname,_0x5029('0x9a'),_0x4a7535['savename']),_0x5e7f50]);return _0x4a7535;}else{var _0x54c0f3=squel['select']();_0x54c0f3['from']('('+_0x533ee2[_0x5029('0x80')]()+')','countTable');_0x54c0f3[_0x5029('0x63')](_0x5029('0x9b'),'count');_0x533ee2[_0x5029('0x1b')](_0xe6ac28[_0x5029('0x1b')]||_0x202c51);_0x533ee2['offset'](_0xe6ac28[_0x5029('0x19')]||0x0);return dbH[_0x5029('0x7f')]['query'](_0x54c0f3[_0x5029('0x80')](),{'type':dbH[_0x5029('0x7f')]['QueryTypes'][_0x5029('0x9c')]})[_0x5029('0x21')](function(_0x17c755){if(!_0x17c755[_0x5029('0x33')]){_0x3e3150=0x0;}else{_0x3e3150=_0x17c755[0x0][_0x5029('0x1c')]||0x0;}return dbH[_0x5029('0x7f')]['query'](_0x533ee2[_0x5029('0x80')](),{'type':dbH['sequelize'][_0x5029('0x81')][_0x5029('0x9c')]});})[_0x5029('0x21')](function(_0x3ebe00){return{'rows':_0x3ebe00||[],'count':_0x3e3150};});}});}exports[_0x5029('0x9d')]=function(_0x2138cc,_0x331af8){return runReport(_0x2138cc[_0x5029('0x43')],_0x2138cc[_0x5029('0x2e')],_0x2138cc[_0x5029('0x44')])[_0x5029('0x21')](respondWithResult(_0x331af8,null))[_0x5029('0x41')](handleError(_0x331af8,null));};exports[_0x5029('0x9e')]=runReport;exports[_0x5029('0x2e')]=function(_0x9de076,_0x2ac88e){var _0x55ee4f=0xa;var _0x1fa9eb=[_0x5029('0x4f'),_0x5029('0x50'),_0x5029('0x51'),_0x5029('0x52')];var _0x405d47={'SUM':'SUM(%s)','COUNT':_0x5029('0x54'),'COUNT DISTINCT':_0x5029('0x82'),'MAX':_0x5029('0x9f'),'MIN':_0x5029('0x55'),'AVG':_0x5029('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x5029('0x58'),'GROUP_CONCAT DESC':_0x5029('0x83')};var _0x29c3a2={'SEC_TO_TIME':_0x5029('0x59'),'DATE':_0x5029('0x5a'),'HOUR':_0x5029('0x5b'),'ROUND':_0x5029('0x5c'),'UNIX_TIMESTAMP':_0x5029('0x5d')};var _0xb39e9d=function(_0x124c5e){return!_['includes']([_0x5029('0x5f'),'IS\x20NOT\x20NULL',_0x5029('0x84'),_0x5029('0x61')],_0x124c5e);};var _0x120acc=function(_0x21bb22){if(!_0x21bb22||!_0x21bb22['rules'][_0x5029('0x33')]){return'';}for(var _0x339112='(',_0x5d7c1a=0x0;_0x5d7c1a<_0x21bb22[_0x5029('0x62')][_0x5029('0x33')];_0x5d7c1a+=0x1){_0x5d7c1a>0x0&&(_0x339112+='\x20'+_0x21bb22['operator']+'\x20');_0x339112+=_0x21bb22[_0x5029('0x62')][_0x5d7c1a][_0x5029('0x7b')]?_0x120acc(_0x21bb22['rules'][_0x5d7c1a]['group']):_0x21bb22[_0x5029('0x62')][_0x5d7c1a]['field']+'\x20'+_0x21bb22['rules'][_0x5d7c1a][_0x5029('0x64')]+(_0xb39e9d(_0x21bb22['rules'][_0x5d7c1a][_0x5029('0x64')])?'\x20'+_0x21bb22[_0x5029('0x62')][_0x5d7c1a]['value']:'');}return _0x339112+')';};var _0x327299={'where':{'id':_0x9de076['params']['id']}},_0x3463cc,_0x590cc2,_0x3ac39a,_0x37c47b,_0x62e4af;_0x327299=_[_0x5029('0x3c')]({},_0x327299,_0x9de076['options']);return db[_0x5029('0x2a')][_0x5029('0x45')](_0x327299)[_0x5029('0x21')](function(_0x5e7ec8){if(_0x5e7ec8){_0x3463cc=_0x5e7ec8;return _0x5e7ec8[_0x5029('0x86')]();}return null;})[_0x5029('0x21')](function(_0x5aa480){if(_0x5aa480){if(!_0x5aa480[_0x5029('0x33')]){throw new db[(_0x5029('0x66'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x590cc2=_0x5aa480;return db[_0x5029('0x68')][_0x5029('0x87')]({'raw':!![]});}return null;})['then'](function(_0x5842a5){if(_0x5842a5){_0x3ac39a=_['keyBy'](_0x5842a5,'id');var _0x313bdb;var _0x1d38e0=squel[_0x5029('0x88')]();_0x1d38e0['from'](_0x3463cc[_0x5029('0x6b')]);for(var _0x581237=0x0;_0x581237<_0x590cc2[_0x5029('0x33')];_0x581237+=0x1){_0x313bdb=_0x590cc2[_0x581237]['MetricId']?_0x3ac39a[_0x590cc2[_0x581237]['MetricId']]['metric']:_0x590cc2[_0x581237]['field'];_0x313bdb=_0x590cc2[_0x581237][_0x5029('0x6e')]?_[_0x5029('0x89')](_0x405d47[_0x590cc2[_0x581237][_0x5029('0x6e')]],'%s',_0x313bdb):_0x313bdb;_0x313bdb=_0x590cc2[_0x581237][_0x5029('0x6f')]?_[_0x5029('0x89')](_0x29c3a2[_0x590cc2[_0x581237]['format']],'%s',_0x313bdb):_0x313bdb;if(_0x590cc2[_0x581237][_0x5029('0x70')]){_0x1d38e0[_0x5029('0x7b')](_0x313bdb);}_0x590cc2[_0x581237][_0x5029('0x71')]&&_0x1d38e0[_0x5029('0x36')](_0x313bdb,_0x590cc2[_0x581237][_0x5029('0x71')]===_0x5029('0x72')?![]:!![]);_0x1d38e0['field'](_0x313bdb,_0x590cc2[_0x581237][_0x5029('0x73')]||_0x313bdb);}if(_0x3463cc[_0x5029('0x74')]){_0x3463cc[_0x5029('0x74')]=JSON['parse'](_0x3463cc['joins']);for(var _0xd05bc9=0x0;_0xd05bc9<_0x3463cc[_0x5029('0x74')][_0x5029('0x33')];_0xd05bc9+=0x1){if(_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x2c')]&&_[_0x5029('0x5e')](_0x1fa9eb,_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x2c')])&&_0x3463cc['joins'][_0xd05bc9][_0x5029('0x76')]&&_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x77')]&&_0x3463cc['joins'][_0xd05bc9][_0x5029('0x78')]){_0x1d38e0[_0x3463cc['joins'][_0xd05bc9][_0x5029('0x2c')]](_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x77')],null,util[_0x5029('0x6f')](_0x5029('0x79'),_0x3463cc[_0x5029('0x6b')],_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x76')],_0x3463cc['joins'][_0xd05bc9]['foreignTable'],_0x3463cc['joins'][_0xd05bc9][_0x5029('0x78')]));}}}if(_0x3463cc[_0x5029('0x7a')]){_0x3463cc[_0x5029('0x7a')]=JSON[_0x5029('0x75')](_0x3463cc[_0x5029('0x7a')]);_0x1d38e0['where'](_0x120acc(_0x3463cc[_0x5029('0x7a')][_0x5029('0x7b')]));}_0x62e4af=_0x1d38e0[_0x5029('0x7c')]();_0x1d38e0[_0x5029('0x1b')](_0x55ee4f);_0x1d38e0[_0x5029('0x19')](0x0);logger['debug'](_0x5029('0x7e'),_0x1d38e0[_0x5029('0x80')]());return dbH[_0x5029('0x7f')][_0x5029('0x2e')](_0x1d38e0[_0x5029('0x80')](),{'type':dbH[_0x5029('0x7f')][_0x5029('0x81')][_0x5029('0x9c')]});}})[_0x5029('0x21')](function(){return{'sql':_0x62e4af[_0x5029('0x80')]()};})[_0x5029('0x21')](respondWithResult(_0x2ac88e,null))[_0x5029('0x41')](handleError(_0x2ac88e,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 45731d4..8e97c3e 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 _0x08a7=['rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xef0512,_0x95f97e){var _0xa27be3=function(_0x35d108){while(--_0x35d108){_0xef0512['push'](_0xef0512['shift']());}};_0xa27be3(++_0x95f97e);}(_0x08a7,0x159));var _0x708a=function(_0x50b568,_0x54e916){_0x50b568=_0x50b568-0x0;var _0x1a58f7=_0x08a7[_0x50b568];return _0x1a58f7;};'use strict';var _=require(_0x708a('0x0'));var util=require('util');var logger=require(_0x708a('0x1'))(_0x708a('0x2'));var moment=require(_0x708a('0x3'));var BPromise=require(_0x708a('0x4'));var rp=require(_0x708a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x708a('0x6'));var config=require(_0x708a('0x7'));var attributes=require(_0x708a('0x8'));module[_0x708a('0x9')]=function(_0x53ded7,_0x1aa90d){return _0x53ded7[_0x708a('0xa')](_0x708a('0xb'),attributes,{'tableName':_0x708a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6b36=['util','../../config/logger','request-promise','rimraf','./analyticDefaultReport.attributes','exports','define'];(function(_0x1ead8f,_0x325f7d){var _0x87e090=function(_0x2a42d1){while(--_0x2a42d1){_0x1ead8f['push'](_0x1ead8f['shift']());}};_0x87e090(++_0x325f7d);}(_0x6b36,0x134));var _0x66b3=function(_0x30160f,_0x4e7793){_0x30160f=_0x30160f-0x0;var _0x1a2393=_0x6b36[_0x30160f];return _0x1a2393;};'use strict';var _=require('lodash');var util=require(_0x66b3('0x0'));var logger=require(_0x66b3('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x66b3('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x66b3('0x3'));var config=require('../../config/environment');var attributes=require(_0x66b3('0x4'));module[_0x66b3('0x5')]=function(_0x325f05,_0x493afa){return _0x325f05[_0x66b3('0x6')]('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 a951b6f..5cdc909 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 _0x94ea=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0xcae8ed,_0x389595){var _0x1eda48=function(_0x1c1dfc){while(--_0x1c1dfc){_0xcae8ed['push'](_0xcae8ed['shift']());}};_0x1eda48(++_0x389595);}(_0x94ea,0x13e));var _0xa94e=function(_0x59ffd4,_0x4bda83){_0x59ffd4=_0x59ffd4-0x0;var _0x31fb33=_0x94ea[_0x59ffd4];return _0x31fb33;};'use strict';var _=require(_0xa94e('0x0'));var util=require(_0xa94e('0x1'));var moment=require(_0xa94e('0x2'));var BPromise=require(_0xa94e('0x3'));var rs=require(_0xa94e('0x4'));var fs=require('fs');var Redis=require(_0xa94e('0x5'));var db=require(_0xa94e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xa94e('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x329df7,_0xd9083d,_0x5152c5){return new BPromise(function(_0x4f4bae,_0x4d72c0){return client['request'](_0x329df7,_0x5152c5)[_0xa94e('0x8')](function(_0x4ef2c8){logger[_0xa94e('0x9')](_0xa94e('0xa'),_0xd9083d,_0xa94e('0xb'));logger[_0xa94e('0xc')](_0xa94e('0xd'),_0xd9083d,_0xa94e('0xb'),JSON[_0xa94e('0xe')](_0x4ef2c8));if(_0x4ef2c8[_0xa94e('0xf')]){if(_0x4ef2c8[_0xa94e('0xf')][_0xa94e('0x10')]===0x1f4){logger['error'](_0xa94e('0xa'),_0xd9083d,_0x4ef2c8['error'][_0xa94e('0x11')]);return _0x4d72c0(_0x4ef2c8[_0xa94e('0xf')]['message']);}logger[_0xa94e('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0xd9083d,_0x4ef2c8['error']['message']);return _0x4f4bae(_0x4ef2c8[_0xa94e('0xf')][_0xa94e('0x11')]);}else{logger[_0xa94e('0x9')]('AnalyticDefaultReport,\x20%s,\x20%s',_0xd9083d,'request\x20sent');_0x4f4bae(_0x4ef2c8[_0xa94e('0x12')][_0xa94e('0x11')]);}})[_0xa94e('0x13')](function(_0x5563f8){logger[_0xa94e('0xf')](_0xa94e('0xa'),_0xd9083d,_0x5563f8);_0x4d72c0(_0x5563f8);});});} \ No newline at end of file +var _0x3795=['request','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0x3795,0x108));var _0x5379=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3795[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5379('0x0'));var util=require(_0x5379('0x1'));var moment=require('moment');var BPromise=require(_0x5379('0x2'));var rs=require(_0x5379('0x3'));var fs=require('fs');var Redis=require(_0x5379('0x4'));var db=require(_0x5379('0x5'))['db'];var utils=require(_0x5379('0x6'));var logger=require(_0x5379('0x7'))(_0x5379('0x8'));var config=require('../../config/environment');var jayson=require(_0x5379('0x9'));var client=jayson[_0x5379('0xa')][_0x5379('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x28bacc,_0x19cabe,_0xcd0878){return new BPromise(function(_0xc03213,_0x54aa66){return client[_0x5379('0xc')](_0x28bacc,_0xcd0878)['then'](function(_0x21b834){logger['info'](_0x5379('0xd'),_0x19cabe,_0x5379('0xe'));logger[_0x5379('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x19cabe,_0x5379('0xe'),JSON[_0x5379('0x10')](_0x21b834));if(_0x21b834[_0x5379('0x11')]){if(_0x21b834[_0x5379('0x11')][_0x5379('0x12')]===0x1f4){logger[_0x5379('0x11')](_0x5379('0xd'),_0x19cabe,_0x21b834['error']['message']);return _0x54aa66(_0x21b834[_0x5379('0x11')][_0x5379('0x13')]);}logger['error'](_0x5379('0xd'),_0x19cabe,_0x21b834[_0x5379('0x11')]['message']);return _0xc03213(_0x21b834[_0x5379('0x11')][_0x5379('0x13')]);}else{logger[_0x5379('0x14')](_0x5379('0xd'),_0x19cabe,_0x5379('0xe'));_0xc03213(_0x21b834[_0x5379('0x15')]['message']);}})[_0x5379('0x16')](function(_0x50b745){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x19cabe,_0x50b745);_0x54aa66(_0x50b745);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 9700a05..4001bd5 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 _0x9f7c=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','show','preview','run','/:id/query','post','create','/:id','exports','multer','util','connect-timeout'];(function(_0x5d7051,_0x58de99){var _0x4c0b47=function(_0x10dc37){while(--_0x10dc37){_0x5d7051['push'](_0x5d7051['shift']());}};_0x4c0b47(++_0x58de99);}(_0x9f7c,0x1eb));var _0xc9f7=function(_0x129028,_0x47ea77){_0x129028=_0x129028-0x0;var _0x43d441=_0x9f7c[_0x129028];return _0x43d441;};'use strict';var multer=require(_0xc9f7('0x0'));var util=require(_0xc9f7('0x1'));var path=require('path');var timeout=require(_0xc9f7('0x2'));var express=require(_0xc9f7('0x3'));var router=express[_0xc9f7('0x4')]();var fs_extra=require(_0xc9f7('0x5'));var auth=require(_0xc9f7('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc9f7('0x7'));var controller=require(_0xc9f7('0x8'));router[_0xc9f7('0x9')]('/',auth[_0xc9f7('0xa')](),controller['index']);router[_0xc9f7('0x9')]('/:id',auth[_0xc9f7('0xa')](),controller[_0xc9f7('0xb')]);router['get']('/:id/preview',auth[_0xc9f7('0xa')](),controller[_0xc9f7('0xc')]);router[_0xc9f7('0x9')]('/:id/run',auth['isAuthenticated'](),controller[_0xc9f7('0xd')]);router[_0xc9f7('0x9')](_0xc9f7('0xe'),auth[_0xc9f7('0xa')](),controller['query']);router[_0xc9f7('0xf')]('/',auth[_0xc9f7('0xa')](),controller[_0xc9f7('0x10')]);router['put'](_0xc9f7('0x11'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0xc9f7('0xa')](),controller['destroy']);module[_0xc9f7('0x12')]=router; \ No newline at end of file +var _0xbfb2=['run','/:id/query','query','post','create','put','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','index','get','/:id','show','/:id/preview','preview','/:id/run'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbfb2,0xf8));var _0x2bfb=function(_0x5995aa,_0x18705d){_0x5995aa=_0x5995aa-0x0;var _0x2e2f05=_0xbfb2[_0x5995aa];return _0x2e2f05;};'use strict';var multer=require('multer');var util=require(_0x2bfb('0x0'));var path=require('path');var timeout=require(_0x2bfb('0x1'));var express=require(_0x2bfb('0x2'));var router=express[_0x2bfb('0x3')]();var fs_extra=require(_0x2bfb('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2bfb('0x5'));var config=require(_0x2bfb('0x6'));var controller=require(_0x2bfb('0x7'));router['get']('/',auth[_0x2bfb('0x8')](),controller[_0x2bfb('0x9')]);router[_0x2bfb('0xa')](_0x2bfb('0xb'),auth[_0x2bfb('0x8')](),controller[_0x2bfb('0xc')]);router[_0x2bfb('0xa')](_0x2bfb('0xd'),auth[_0x2bfb('0x8')](),controller[_0x2bfb('0xe')]);router[_0x2bfb('0xa')](_0x2bfb('0xf'),auth[_0x2bfb('0x8')](),controller[_0x2bfb('0x10')]);router[_0x2bfb('0xa')](_0x2bfb('0x11'),auth['isAuthenticated'](),controller[_0x2bfb('0x12')]);router[_0x2bfb('0x13')]('/',auth[_0x2bfb('0x8')](),controller[_0x2bfb('0x14')]);router[_0x2bfb('0x15')](_0x2bfb('0xb'),auth[_0x2bfb('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x2bfb('0x16')]);module[_0x2bfb('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 ab42b81..499bc88 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 _0xceb9=['DATE','manual','scheduled','UNSIGNED','sequelize','STRING','ENUM','csv','pdf'];(function(_0x194d6d,_0x43781b){var _0x6d23cc=function(_0x6c57ad){while(--_0x6c57ad){_0x194d6d['push'](_0x194d6d['shift']());}};_0x6d23cc(++_0x43781b);}(_0xceb9,0x1c6));var _0x9ceb=function(_0x18556e,_0x43dcb7){_0x18556e=_0x18556e-0x0;var _0x562d04=_0xceb9[_0x18556e];return _0x562d04;};'use strict';var Sequelize=require(_0x9ceb('0x0'));var moment=require('moment');module['exports']={'name':{'type':Sequelize[_0x9ceb('0x1')],'allowNull':![]},'basename':{'type':Sequelize[_0x9ceb('0x1')],'allowNull':![]},'output':{'type':Sequelize[_0x9ceb('0x2')](_0x9ceb('0x3'),_0x9ceb('0x4'),'xlsx'),'allowNull':![],'defaultValue':_0x9ceb('0x3')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x9ceb('0x5')]},'endDate':{'type':Sequelize[_0x9ceb('0x5')]},'status':{'type':Sequelize[_0x9ceb('0x1')],'defaultValue':'Loading'},'type':{'type':Sequelize['ENUM'](_0x9ceb('0x6'),_0x9ceb('0x7')),'allowNull':![],'defaultValue':_0x9ceb('0x6')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x9ceb('0x8')]},'reportType':{'type':Sequelize[_0x9ceb('0x1')]}}; \ No newline at end of file +var _0xf5f9=['sequelize','moment','exports','STRING','ENUM','csv','xlsx','DATE','scheduled','manual','INTEGER','UNSIGNED'];(function(_0x423797,_0x3d393b){var _0x57ec0c=function(_0x24c145){while(--_0x24c145){_0x423797['push'](_0x423797['shift']());}};_0x57ec0c(++_0x3d393b);}(_0xf5f9,0xf0));var _0x9f5f=function(_0x46edb7,_0x1e53b0){_0x46edb7=_0x46edb7-0x0;var _0xc4ce02=_0xf5f9[_0x46edb7];return _0xc4ce02;};'use strict';var Sequelize=require(_0x9f5f('0x0'));var moment=require(_0x9f5f('0x1'));module[_0x9f5f('0x2')]={'name':{'type':Sequelize[_0x9f5f('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x9f5f('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x9f5f('0x4')](_0x9f5f('0x5'),'pdf',_0x9f5f('0x6')),'allowNull':![],'defaultValue':_0x9f5f('0x5')},'savename':{'type':Sequelize[_0x9f5f('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x9f5f('0x7')]},'endDate':{'type':Sequelize[_0x9f5f('0x7')]},'status':{'type':Sequelize[_0x9f5f('0x3')],'defaultValue':'Loading'},'type':{'type':Sequelize['ENUM']('manual',_0x9f5f('0x8')),'allowNull':![],'defaultValue':_0x9f5f('0x9')},'reportId':{'type':Sequelize[_0x9f5f('0xa')](0xb)[_0x9f5f('0xb')]},'reportType':{'type':Sequelize[_0x9f5f('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 9b37b61..62dfafb 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 _0x9860=['fast-json-patch','request-promise','moment','bluebird','mustache','sox','lodash','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','save','update','then','destroy','get','ExtractedReports','UserProfileResource','error','stack','name','index','map','AnalyticExtractedReport','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','options','includeAll','findAll','rows','catch','params','rawAttributes','length','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','basename','output','existsSync','join','root','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','server/files/reports','format','%s.%s','eml-format','rimraf','zip-dir'];(function(_0x27d246,_0x2cea3f){var _0x375531=function(_0x26c281){while(--_0x26c281){_0x27d246['push'](_0x27d246['shift']());}};_0x375531(++_0x2cea3f);}(_0x9860,0xb5));var _0x0986=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9860[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x0986('0x0'));var rimraf=require(_0x0986('0x1'));var zipdir=require(_0x0986('0x2'));var jsonpatch=require(_0x0986('0x3'));var rp=require(_0x0986('0x4'));var moment=require(_0x0986('0x5'));var BPromise=require(_0x0986('0x6'));var Mustache=require(_0x0986('0x7'));var util=require('util');var path=require('path');var sox=require(_0x0986('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0986('0x9'));var squel=require('squel');var crypto=require(_0x0986('0xa'));var jsforce=require(_0x0986('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0986('0xc'));var querystring=require(_0x0986('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0986('0xe'));var qs=require(_0x0986('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0986('0x10'));var logger=require(_0x0986('0x11'))(_0x0986('0x12'));var utils=require('../../config/utils');var config=require(_0x0986('0x13'));var licenseUtil=require(_0x0986('0x14'));var db=require(_0x0986('0x15'))['db'];function respondWithStatusCode(_0x4a3c4c,_0x4d2548){_0x4d2548=_0x4d2548||0xcc;return function(_0x97311e){if(_0x97311e){return _0x4a3c4c[_0x0986('0x16')](_0x4d2548);}return _0x4a3c4c['status'](_0x4d2548)[_0x0986('0x17')]();};}function respondWithResult(_0xbd7e1e,_0xac3cc5){_0xac3cc5=_0xac3cc5||0xc8;return function(_0x15f9ef){if(_0x15f9ef){return _0xbd7e1e['status'](_0xac3cc5)[_0x0986('0x18')](_0x15f9ef);}};}function respondWithFilteredResult(_0x481cf8,_0x502228){return function(_0x48c918){if(_0x48c918){var _0x24a362=typeof _0x502228[_0x0986('0x19')]===_0x0986('0x1a')&&typeof _0x502228[_0x0986('0x1b')]===_0x0986('0x1a');var _0x34a144=_0x48c918[_0x0986('0x1c')];var _0x562535=_0x24a362?0x0:_0x502228['offset'];var _0x48efbc=_0x24a362?_0x48c918['count']:_0x502228[_0x0986('0x19')]+_0x502228[_0x0986('0x1b')];var _0x1c71e9;if(_0x48efbc>=_0x34a144){_0x48efbc=_0x34a144;_0x1c71e9=0xc8;}else{_0x1c71e9=0xce;}_0x481cf8[_0x0986('0x1d')](_0x1c71e9);return _0x481cf8[_0x0986('0x1e')](_0x0986('0x1f'),_0x562535+'-'+_0x48efbc+'/'+_0x34a144)[_0x0986('0x18')](_0x48c918);}return null;};}function patchUpdates(_0x5a8796){return function(_0x424409){try{jsonpatch[_0x0986('0x20')](_0x424409,_0x5a8796,!![]);}catch(_0x5a1632){return BPromise['reject'](_0x5a1632);}return _0x424409[_0x0986('0x21')]();};}function saveUpdates(_0x2046a7,_0x226c51){return function(_0x268a5f){if(_0x268a5f){return _0x268a5f[_0x0986('0x22')](_0x2046a7)[_0x0986('0x23')](function(_0x1126af){return _0x1126af;});}return null;};}function removeEntity(_0x5139b0,_0x5b1ba4){return function(_0xb9e336){if(_0xb9e336){return _0xb9e336[_0x0986('0x24')]()[_0x0986('0x23')](function(){var _0x296cba=_0xb9e336[_0x0986('0x25')]({'plain':!![]});var _0x2f288d=_0x0986('0x26');return db[_0x0986('0x27')][_0x0986('0x24')]({'where':{'type':_0x2f288d,'resourceId':_0x296cba['id']}})['then'](function(){return _0xb9e336;});})[_0x0986('0x23')](function(){_0x5139b0['status'](0xcc)[_0x0986('0x17')]();});}};}function handleEntityNotFound(_0x2ec433,_0x31f85f){return function(_0x20deef){if(!_0x20deef){_0x2ec433[_0x0986('0x16')](0x194);}return _0x20deef;};}function handleError(_0x9f2548,_0x4537da){_0x4537da=_0x4537da||0x1f4;return function(_0x3239ec){logger[_0x0986('0x28')](_0x3239ec[_0x0986('0x29')]);if(_0x3239ec[_0x0986('0x2a')]){delete _0x3239ec[_0x0986('0x2a')];}_0x9f2548[_0x0986('0x1d')](_0x4537da)['send'](_0x3239ec);};}exports[_0x0986('0x2b')]=function(_0x2ca8dd,_0x2ca101){var _0xb28d68={},_0x37d2d7={},_0x34ce3c={'count':0x0,'rows':[]};var _0x505a7e=_[_0x0986('0x2c')](db[_0x0986('0x2d')]['rawAttributes'],function(_0x1d8a0c){return{'name':_0x1d8a0c[_0x0986('0x2e')],'type':_0x1d8a0c['type'][_0x0986('0x2f')]};});_0x37d2d7[_0x0986('0x30')]=_[_0x0986('0x2c')](_0x505a7e,_0x0986('0x2a'));_0x37d2d7[_0x0986('0x31')]=_[_0x0986('0x32')](_0x2ca8dd['query']);_0x37d2d7[_0x0986('0x33')]=_[_0x0986('0x34')](_0x37d2d7['model'],_0x37d2d7['query']);_0xb28d68[_0x0986('0x35')]=_['intersection'](_0x37d2d7[_0x0986('0x30')],qs['fields'](_0x2ca8dd['query'][_0x0986('0x36')]));_0xb28d68['attributes']=_0xb28d68[_0x0986('0x35')]['length']?_0xb28d68[_0x0986('0x35')]:_0x37d2d7[_0x0986('0x30')];if(!_0x2ca8dd[_0x0986('0x31')][_0x0986('0x37')](_0x0986('0x38'))){_0xb28d68[_0x0986('0x1b')]=qs[_0x0986('0x1b')](_0x2ca8dd[_0x0986('0x31')][_0x0986('0x1b')]);_0xb28d68['offset']=qs[_0x0986('0x19')](_0x2ca8dd[_0x0986('0x31')]['offset']);}_0xb28d68['order']=qs[_0x0986('0x39')](_0x2ca8dd[_0x0986('0x31')][_0x0986('0x39')]);_0xb28d68[_0x0986('0x3a')]=qs['filters'](_[_0x0986('0x3b')](_0x2ca8dd['query'],_0x37d2d7[_0x0986('0x33')]),_0x505a7e);if(_0x2ca8dd[_0x0986('0x31')][_0x0986('0x3c')]){_0xb28d68[_0x0986('0x3a')]=_[_0x0986('0x3d')](_0xb28d68[_0x0986('0x3a')],{'$or':_['map'](_0x505a7e,function(_0x591896){if(_0x591896[_0x0986('0x3e')]!=='VIRTUAL'){var _0x5b8b2f={};_0x5b8b2f[_0x591896[_0x0986('0x2a')]]={'$like':'%'+_0x2ca8dd[_0x0986('0x31')][_0x0986('0x3c')]+'%'};return _0x5b8b2f;}})});}_0xb28d68=_[_0x0986('0x3d')]({},_0xb28d68,_0x2ca8dd[_0x0986('0x3f')]);var _0x122b93={'where':_0xb28d68[_0x0986('0x3a')]};return db[_0x0986('0x2d')][_0x0986('0x1c')](_0x122b93)[_0x0986('0x23')](function(_0x10f678){_0x34ce3c[_0x0986('0x1c')]=_0x10f678;if(_0x2ca8dd[_0x0986('0x31')][_0x0986('0x40')]){_0xb28d68['include']=[{'all':!![]}];}return db[_0x0986('0x2d')][_0x0986('0x41')](_0xb28d68);})['then'](function(_0x3d6935){_0x34ce3c[_0x0986('0x42')]=_0x3d6935;return _0x34ce3c;})[_0x0986('0x23')](respondWithFilteredResult(_0x2ca101,_0xb28d68))[_0x0986('0x43')](handleError(_0x2ca101,null));};exports['show']=function(_0x1ab724,_0x548522){var _0x3669d5={'raw':!![],'where':{'id':_0x1ab724[_0x0986('0x44')]['id']}},_0x1e9146={};_0x1e9146['model']=_[_0x0986('0x32')](db[_0x0986('0x2d')][_0x0986('0x45')]);_0x1e9146[_0x0986('0x31')]=_['keys'](_0x1ab724[_0x0986('0x31')]);_0x1e9146['filters']=_[_0x0986('0x34')](_0x1e9146[_0x0986('0x30')],_0x1e9146[_0x0986('0x31')]);_0x3669d5['attributes']=_[_0x0986('0x34')](_0x1e9146[_0x0986('0x30')],qs[_0x0986('0x36')](_0x1ab724[_0x0986('0x31')]['fields']));_0x3669d5[_0x0986('0x35')]=_0x3669d5[_0x0986('0x35')][_0x0986('0x46')]?_0x3669d5[_0x0986('0x35')]:_0x1e9146['model'];if(_0x1ab724[_0x0986('0x31')][_0x0986('0x40')]){_0x3669d5[_0x0986('0x47')]=[{'all':!![]}];}_0x3669d5=_[_0x0986('0x3d')]({},_0x3669d5,_0x1ab724[_0x0986('0x3f')]);return db[_0x0986('0x2d')][_0x0986('0x48')](_0x3669d5)[_0x0986('0x23')](handleEntityNotFound(_0x548522,null))[_0x0986('0x23')](respondWithResult(_0x548522,null))[_0x0986('0x43')](handleError(_0x548522,null));};exports['create']=function(_0x128c5a,_0x59a0a4){return db['AnalyticExtractedReport'][_0x0986('0x49')](_0x128c5a[_0x0986('0x4a')],{})[_0x0986('0x23')](function(_0x5b37a5){var _0x568e2=_0x128c5a[_0x0986('0x4b')][_0x0986('0x25')]({'plain':!![]});if(!_0x568e2)throw new Error(_0x0986('0x4c'));if(_0x568e2['role']===_0x0986('0x4b')){var _0x2d1972=_0x5b37a5[_0x0986('0x25')]({'plain':!![]});var _0x19ed28=_0x0986('0x26');return db[_0x0986('0x4d')][_0x0986('0x48')]({'where':{'name':_0x19ed28,'userProfileId':_0x568e2[_0x0986('0x4e')]},'raw':!![]})[_0x0986('0x23')](function(_0x1a5438){if(_0x1a5438&&_0x1a5438[_0x0986('0x4f')]===0x0){return db[_0x0986('0x27')][_0x0986('0x49')]({'name':_0x2d1972[_0x0986('0x2a')],'resourceId':_0x2d1972['id'],'type':_0x1a5438[_0x0986('0x2a')],'sectionId':_0x1a5438['id']},{})['then'](function(){return _0x5b37a5;});}else{return _0x5b37a5;}})[_0x0986('0x43')](function(_0x59852a){logger['error'](_0x0986('0x50'),_0x59852a);throw _0x59852a;});}return _0x5b37a5;})[_0x0986('0x23')](respondWithResult(_0x59a0a4,0xc9))[_0x0986('0x43')](handleError(_0x59a0a4,null));};exports['update']=function(_0x32f73a,_0x537be7){if(_0x32f73a[_0x0986('0x4a')]['id']){delete _0x32f73a['body']['id'];}return db['AnalyticExtractedReport']['find']({'where':{'id':_0x32f73a[_0x0986('0x44')]['id']}})[_0x0986('0x23')](handleEntityNotFound(_0x537be7,null))['then'](saveUpdates(_0x32f73a['body'],null))[_0x0986('0x23')](respondWithResult(_0x537be7,null))[_0x0986('0x43')](handleError(_0x537be7,null));};exports[_0x0986('0x24')]=function(_0xf4fbbd,_0x1bdc5d){return db[_0x0986('0x2d')][_0x0986('0x48')]({'where':{'id':_0xf4fbbd[_0x0986('0x44')]['id']}})[_0x0986('0x23')](handleEntityNotFound(_0x1bdc5d,null))['then'](removeEntity(_0x1bdc5d,null))['catch'](handleError(_0x1bdc5d,null));};exports['download']=function(_0x49c79a,_0x575c54,_0xed9aad){return db[_0x0986('0x2d')]['find']({'where':{'id':_0x49c79a[_0x0986('0x44')]['id']},'attributes':[_0x0986('0x2a'),_0x0986('0x51'),'savename',_0x0986('0x52')],'raw':!![]})['then'](handleEntityNotFound(_0x575c54,null))['then'](function(_0x18a5c2){if(_0x18a5c2){if(!fs[_0x0986('0x53')](path[_0x0986('0x54')](config[_0x0986('0x55')],'server/files/reports',_0x18a5c2['savename']))){throw new db['Sequelize'][(_0x0986('0x56'))](_0x0986('0x57'));}if(_0x49c79a[_0x0986('0x31')][_0x0986('0x58')]){return _0x575c54[_0x0986('0x16')](0xc8);}return _0x575c54['download'](path[_0x0986('0x54')](config[_0x0986('0x55')],_0x0986('0x59'),_0x18a5c2['savename']),util[_0x0986('0x5a')](_0x0986('0x5b'),_0x18a5c2[_0x0986('0x51')]||_0x18a5c2[_0x0986('0x2a')],_0x18a5c2['output']['toLowerCase']()));}})[_0x0986('0x43')](handleError(_0x575c54,null));}; \ No newline at end of file +var _0xca70=['output','toLowerCase','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','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','count','limit','apply','then','destroy','get','ExtractedReports','UserProfileResource','error','stack','name','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','where','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','download','basename','savename','join','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','root','format','%s.%s'];(function(_0x3959ed,_0x24b474){var _0x1a3ef0=function(_0x536f81){while(--_0x536f81){_0x3959ed['push'](_0x3959ed['shift']());}};_0x1a3ef0(++_0x24b474);}(_0xca70,0x1ce));var _0x0ca7=function(_0x42bcf4,_0x3e8daa){_0x42bcf4=_0x42bcf4-0x0;var _0x290456=_0xca70[_0x42bcf4];return _0x290456;};'use strict';var emlformat=require(_0x0ca7('0x0'));var rimraf=require(_0x0ca7('0x1'));var zipdir=require(_0x0ca7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0ca7('0x3'));var moment=require(_0x0ca7('0x4'));var BPromise=require(_0x0ca7('0x5'));var Mustache=require('mustache');var util=require(_0x0ca7('0x6'));var path=require(_0x0ca7('0x7'));var sox=require(_0x0ca7('0x8'));var csv=require(_0x0ca7('0x9'));var ejs=require(_0x0ca7('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0ca7('0xb'));var squel=require(_0x0ca7('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0ca7('0xd'));var toCsv=require(_0x0ca7('0x9'));var querystring=require('querystring');var Papa=require(_0x0ca7('0xe'));var Redis=require(_0x0ca7('0xf'));var authService=require(_0x0ca7('0x10'));var qs=require(_0x0ca7('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0ca7('0x12'));var logger=require(_0x0ca7('0x13'))(_0x0ca7('0x14'));var utils=require(_0x0ca7('0x15'));var config=require(_0x0ca7('0x16'));var licenseUtil=require(_0x0ca7('0x17'));var db=require(_0x0ca7('0x18'))['db'];function respondWithStatusCode(_0x381cae,_0x2cd168){_0x2cd168=_0x2cd168||0xcc;return function(_0x20e075){if(_0x20e075){return _0x381cae[_0x0ca7('0x19')](_0x2cd168);}return _0x381cae[_0x0ca7('0x1a')](_0x2cd168)[_0x0ca7('0x1b')]();};}function respondWithResult(_0x28ade3,_0x198879){_0x198879=_0x198879||0xc8;return function(_0x220f0a){if(_0x220f0a){return _0x28ade3[_0x0ca7('0x1a')](_0x198879)['json'](_0x220f0a);}};}function respondWithFilteredResult(_0x33c27f,_0x391b4a){return function(_0x54469c){if(_0x54469c){var _0x3d0b7c=typeof _0x391b4a[_0x0ca7('0x1c')]===_0x0ca7('0x1d')&&typeof _0x391b4a['limit']===_0x0ca7('0x1d');var _0x22ee88=_0x54469c[_0x0ca7('0x1e')];var _0x51fd67=_0x3d0b7c?0x0:_0x391b4a[_0x0ca7('0x1c')];var _0x4fa4eb=_0x3d0b7c?_0x54469c[_0x0ca7('0x1e')]:_0x391b4a[_0x0ca7('0x1c')]+_0x391b4a[_0x0ca7('0x1f')];var _0x128efe;if(_0x4fa4eb>=_0x22ee88){_0x4fa4eb=_0x22ee88;_0x128efe=0xc8;}else{_0x128efe=0xce;}_0x33c27f[_0x0ca7('0x1a')](_0x128efe);return _0x33c27f['set']('Content-Range',_0x51fd67+'-'+_0x4fa4eb+'/'+_0x22ee88)['json'](_0x54469c);}return null;};}function patchUpdates(_0x4a7ec1){return function(_0x27e1a7){try{jsonpatch[_0x0ca7('0x20')](_0x27e1a7,_0x4a7ec1,!![]);}catch(_0x527354){return BPromise['reject'](_0x527354);}return _0x27e1a7['save']();};}function saveUpdates(_0x412b63,_0x1951a6){return function(_0x4c08d5){if(_0x4c08d5){return _0x4c08d5['update'](_0x412b63)[_0x0ca7('0x21')](function(_0x7437bd){return _0x7437bd;});}return null;};}function removeEntity(_0x144084,_0x5552a4){return function(_0x4a8012){if(_0x4a8012){return _0x4a8012[_0x0ca7('0x22')]()['then'](function(){var _0x4002f8=_0x4a8012[_0x0ca7('0x23')]({'plain':!![]});var _0x5329c7=_0x0ca7('0x24');return db[_0x0ca7('0x25')][_0x0ca7('0x22')]({'where':{'type':_0x5329c7,'resourceId':_0x4002f8['id']}})[_0x0ca7('0x21')](function(){return _0x4a8012;});})[_0x0ca7('0x21')](function(){_0x144084['status'](0xcc)[_0x0ca7('0x1b')]();});}};}function handleEntityNotFound(_0x5e0bb2,_0x4984eb){return function(_0x57c89b){if(!_0x57c89b){_0x5e0bb2[_0x0ca7('0x19')](0x194);}return _0x57c89b;};}function handleError(_0x9d248e,_0x1d6fb6){_0x1d6fb6=_0x1d6fb6||0x1f4;return function(_0x5d1d64){logger[_0x0ca7('0x26')](_0x5d1d64[_0x0ca7('0x27')]);if(_0x5d1d64[_0x0ca7('0x28')]){delete _0x5d1d64[_0x0ca7('0x28')];}_0x9d248e['status'](_0x1d6fb6)['send'](_0x5d1d64);};}exports[_0x0ca7('0x29')]=function(_0x41db25,_0x588474){var _0x3486d7={},_0x4a9809={},_0x401613={'count':0x0,'rows':[]};var _0x5a0967=_[_0x0ca7('0x2a')](db[_0x0ca7('0x2b')][_0x0ca7('0x2c')],function(_0x552a2c){return{'name':_0x552a2c[_0x0ca7('0x2d')],'type':_0x552a2c[_0x0ca7('0x2e')][_0x0ca7('0x2f')]};});_0x4a9809['model']=_['map'](_0x5a0967,'name');_0x4a9809[_0x0ca7('0x30')]=_[_0x0ca7('0x31')](_0x41db25[_0x0ca7('0x30')]);_0x4a9809[_0x0ca7('0x32')]=_[_0x0ca7('0x33')](_0x4a9809[_0x0ca7('0x34')],_0x4a9809[_0x0ca7('0x30')]);_0x3486d7[_0x0ca7('0x35')]=_[_0x0ca7('0x33')](_0x4a9809[_0x0ca7('0x34')],qs[_0x0ca7('0x36')](_0x41db25[_0x0ca7('0x30')][_0x0ca7('0x36')]));_0x3486d7['attributes']=_0x3486d7['attributes'][_0x0ca7('0x37')]?_0x3486d7[_0x0ca7('0x35')]:_0x4a9809[_0x0ca7('0x34')];if(!_0x41db25[_0x0ca7('0x30')][_0x0ca7('0x38')](_0x0ca7('0x39'))){_0x3486d7[_0x0ca7('0x1f')]=qs[_0x0ca7('0x1f')](_0x41db25[_0x0ca7('0x30')][_0x0ca7('0x1f')]);_0x3486d7[_0x0ca7('0x1c')]=qs['offset'](_0x41db25[_0x0ca7('0x30')][_0x0ca7('0x1c')]);}_0x3486d7['order']=qs['sort'](_0x41db25[_0x0ca7('0x30')]['sort']);_0x3486d7[_0x0ca7('0x3a')]=qs[_0x0ca7('0x32')](_['pick'](_0x41db25[_0x0ca7('0x30')],_0x4a9809['filters']),_0x5a0967);if(_0x41db25[_0x0ca7('0x30')]['filter']){_0x3486d7[_0x0ca7('0x3a')]=_['merge'](_0x3486d7[_0x0ca7('0x3a')],{'$or':_[_0x0ca7('0x2a')](_0x5a0967,function(_0x2a1460){if(_0x2a1460[_0x0ca7('0x2e')]!=='VIRTUAL'){var _0x2e3fa5={};_0x2e3fa5[_0x2a1460[_0x0ca7('0x28')]]={'$like':'%'+_0x41db25[_0x0ca7('0x30')][_0x0ca7('0x3b')]+'%'};return _0x2e3fa5;}})});}_0x3486d7=_[_0x0ca7('0x3c')]({},_0x3486d7,_0x41db25[_0x0ca7('0x3d')]);var _0x2afff0={'where':_0x3486d7[_0x0ca7('0x3a')]};return db[_0x0ca7('0x2b')]['count'](_0x2afff0)['then'](function(_0x1fb324){_0x401613[_0x0ca7('0x1e')]=_0x1fb324;if(_0x41db25[_0x0ca7('0x30')][_0x0ca7('0x3e')]){_0x3486d7[_0x0ca7('0x3f')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x0ca7('0x40')](_0x3486d7);})[_0x0ca7('0x21')](function(_0x3b21f3){_0x401613[_0x0ca7('0x41')]=_0x3b21f3;return _0x401613;})[_0x0ca7('0x21')](respondWithFilteredResult(_0x588474,_0x3486d7))[_0x0ca7('0x42')](handleError(_0x588474,null));};exports[_0x0ca7('0x43')]=function(_0x1c525b,_0x1c32c3){var _0xb5171c={'raw':!![],'where':{'id':_0x1c525b[_0x0ca7('0x44')]['id']}},_0x16fa2a={};_0x16fa2a['model']=_[_0x0ca7('0x31')](db[_0x0ca7('0x2b')][_0x0ca7('0x2c')]);_0x16fa2a[_0x0ca7('0x30')]=_[_0x0ca7('0x31')](_0x1c525b[_0x0ca7('0x30')]);_0x16fa2a['filters']=_[_0x0ca7('0x33')](_0x16fa2a[_0x0ca7('0x34')],_0x16fa2a[_0x0ca7('0x30')]);_0xb5171c[_0x0ca7('0x35')]=_[_0x0ca7('0x33')](_0x16fa2a[_0x0ca7('0x34')],qs['fields'](_0x1c525b[_0x0ca7('0x30')][_0x0ca7('0x36')]));_0xb5171c[_0x0ca7('0x35')]=_0xb5171c['attributes']['length']?_0xb5171c[_0x0ca7('0x35')]:_0x16fa2a[_0x0ca7('0x34')];if(_0x1c525b[_0x0ca7('0x30')]['includeAll']){_0xb5171c[_0x0ca7('0x3f')]=[{'all':!![]}];}_0xb5171c=_[_0x0ca7('0x3c')]({},_0xb5171c,_0x1c525b[_0x0ca7('0x3d')]);return db[_0x0ca7('0x2b')]['find'](_0xb5171c)[_0x0ca7('0x21')](handleEntityNotFound(_0x1c32c3,null))['then'](respondWithResult(_0x1c32c3,null))['catch'](handleError(_0x1c32c3,null));};exports['create']=function(_0x20681f,_0x10d2a8){return db[_0x0ca7('0x2b')][_0x0ca7('0x45')](_0x20681f[_0x0ca7('0x46')],{})['then'](function(_0xbea5b7){var _0x475db9=_0x20681f[_0x0ca7('0x47')][_0x0ca7('0x23')]({'plain':!![]});if(!_0x475db9)throw new Error(_0x0ca7('0x48'));if(_0x475db9['role']===_0x0ca7('0x47')){var _0x4cca9b=_0xbea5b7[_0x0ca7('0x23')]({'plain':!![]});var _0x3b434b='ExtractedReports';return db[_0x0ca7('0x49')][_0x0ca7('0x4a')]({'where':{'name':_0x3b434b,'userProfileId':_0x475db9[_0x0ca7('0x4b')]},'raw':!![]})[_0x0ca7('0x21')](function(_0x36e9ad){if(_0x36e9ad&&_0x36e9ad[_0x0ca7('0x4c')]===0x0){return db[_0x0ca7('0x25')][_0x0ca7('0x45')]({'name':_0x4cca9b[_0x0ca7('0x28')],'resourceId':_0x4cca9b['id'],'type':_0x36e9ad['name'],'sectionId':_0x36e9ad['id']},{})['then'](function(){return _0xbea5b7;});}else{return _0xbea5b7;}})[_0x0ca7('0x42')](function(_0x23e01b){logger[_0x0ca7('0x26')](_0x0ca7('0x4d'),_0x23e01b);throw _0x23e01b;});}return _0xbea5b7;})[_0x0ca7('0x21')](respondWithResult(_0x10d2a8,0xc9))[_0x0ca7('0x42')](handleError(_0x10d2a8,null));};exports[_0x0ca7('0x4e')]=function(_0x4c9c10,_0x2a6813){if(_0x4c9c10[_0x0ca7('0x46')]['id']){delete _0x4c9c10[_0x0ca7('0x46')]['id'];}return db[_0x0ca7('0x2b')][_0x0ca7('0x4a')]({'where':{'id':_0x4c9c10[_0x0ca7('0x44')]['id']}})[_0x0ca7('0x21')](handleEntityNotFound(_0x2a6813,null))['then'](saveUpdates(_0x4c9c10['body'],null))[_0x0ca7('0x21')](respondWithResult(_0x2a6813,null))[_0x0ca7('0x42')](handleError(_0x2a6813,null));};exports['destroy']=function(_0x514deb,_0x3f0f63){return db['AnalyticExtractedReport'][_0x0ca7('0x4a')]({'where':{'id':_0x514deb[_0x0ca7('0x44')]['id']}})[_0x0ca7('0x21')](handleEntityNotFound(_0x3f0f63,null))[_0x0ca7('0x21')](removeEntity(_0x3f0f63,null))[_0x0ca7('0x42')](handleError(_0x3f0f63,null));};exports[_0x0ca7('0x4f')]=function(_0x562bd4,_0x44d6c5,_0x4e3c31){return db['AnalyticExtractedReport'][_0x0ca7('0x4a')]({'where':{'id':_0x562bd4['params']['id']},'attributes':[_0x0ca7('0x28'),_0x0ca7('0x50'),_0x0ca7('0x51'),'output'],'raw':!![]})[_0x0ca7('0x21')](handleEntityNotFound(_0x44d6c5,null))[_0x0ca7('0x21')](function(_0x95b421){if(_0x95b421){if(!fs['existsSync'](path[_0x0ca7('0x52')](config['root'],_0x0ca7('0x53'),_0x95b421[_0x0ca7('0x51')]))){throw new db[(_0x0ca7('0x54'))][(_0x0ca7('0x55'))](_0x0ca7('0x56'));}if(_0x562bd4[_0x0ca7('0x30')]['exists']){return _0x44d6c5[_0x0ca7('0x19')](0xc8);}return _0x44d6c5['download'](path[_0x0ca7('0x52')](config[_0x0ca7('0x57')],_0x0ca7('0x53'),_0x95b421[_0x0ca7('0x51')]),util[_0x0ca7('0x58')](_0x0ca7('0x59'),_0x95b421[_0x0ca7('0x50')]||_0x95b421[_0x0ca7('0x28')],_0x95b421[_0x0ca7('0x5a')][_0x0ca7('0x5b')]()));}})[_0x0ca7('0x42')](handleError(_0x44d6c5,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 51c462e..cd8d19a 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 _0xdb41=['define','analytics_extracted_reports','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./analyticExtractedReport.attributes'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0xdb41,0x9c));var _0x1db4=function(_0x1bd224,_0x4ff3cd){_0x1bd224=_0x1bd224-0x0;var _0x12f4e6=_0xdb41[_0x1bd224];return _0x12f4e6;};'use strict';var _=require(_0x1db4('0x0'));var util=require(_0x1db4('0x1'));var logger=require(_0x1db4('0x2'))('api');var moment=require(_0x1db4('0x3'));var BPromise=require(_0x1db4('0x4'));var rp=require(_0x1db4('0x5'));var fs=require('fs');var path=require(_0x1db4('0x6'));var rimraf=require('rimraf');var config=require(_0x1db4('0x7'));var attributes=require(_0x1db4('0x8'));module['exports']=function(_0x4d411c,_0x6948f4){return _0x4d411c[_0x1db4('0x9')]('AnalyticExtractedReport',attributes,{'tableName':_0x1db4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x59ee=['analytics_extracted_reports','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./analyticExtractedReport.attributes','define','AnalyticExtractedReport'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x59ee,0x14b));var _0xe59e=function(_0x32b122,_0x1ad490){_0x32b122=_0x32b122-0x0;var _0x4ad25a=_0x59ee[_0x32b122];return _0x4ad25a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe59e('0x0'))(_0xe59e('0x1'));var moment=require(_0xe59e('0x2'));var BPromise=require(_0xe59e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe59e('0x4'));var config=require(_0xe59e('0x5'));var attributes=require(_0xe59e('0x6'));module['exports']=function(_0x3ff61b,_0x1b52d2){return _0x3ff61b[_0xe59e('0x7')](_0xe59e('0x8'),attributes,{'tableName':_0xe59e('0x9'),'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 1d50c65..6774073 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 _0xb875=['randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash'];(function(_0x416840,_0x59a299){var _0x118276=function(_0x2cda8b){while(--_0x2cda8b){_0x416840['push'](_0x416840['shift']());}};_0x118276(++_0x59a299);}(_0xb875,0x167));var _0x5b87=function(_0x4911b4,_0x515321){_0x4911b4=_0x4911b4-0x0;var _0x4450f1=_0xb875[_0x4911b4];return _0x4450f1;};'use strict';var _=require(_0x5b87('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5b87('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5b87('0x2'))['db'];var utils=require(_0x5b87('0x3'));var logger=require('../../config/logger')(_0x5b87('0x4'));var config=require(_0x5b87('0x5'));var jayson=require(_0x5b87('0x6'));var client=jayson[_0x5b87('0x7')][_0x5b87('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5b27af,_0x1fc1a8,_0x46b1bf){return new BPromise(function(_0x1fb944,_0xb2888){return client['request'](_0x5b27af,_0x46b1bf)[_0x5b87('0x9')](function(_0x537f81){logger[_0x5b87('0xa')](_0x5b87('0xb'),_0x1fc1a8,_0x5b87('0xc'));logger[_0x5b87('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x1fc1a8,'request\x20sent',JSON[_0x5b87('0xe')](_0x537f81));if(_0x537f81[_0x5b87('0xf')]){if(_0x537f81['error'][_0x5b87('0x10')]===0x1f4){logger[_0x5b87('0xf')](_0x5b87('0xb'),_0x1fc1a8,_0x537f81[_0x5b87('0xf')][_0x5b87('0x11')]);return _0xb2888(_0x537f81[_0x5b87('0xf')][_0x5b87('0x11')]);}logger[_0x5b87('0xf')](_0x5b87('0xb'),_0x1fc1a8,_0x537f81['error'][_0x5b87('0x11')]);return _0x1fb944(_0x537f81['error'][_0x5b87('0x11')]);}else{logger[_0x5b87('0xa')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1fc1a8,'request\x20sent');_0x1fb944(_0x537f81[_0x5b87('0x12')]['message']);}})[_0x5b87('0x13')](function(_0x175452){logger[_0x5b87('0xf')](_0x5b87('0xb'),_0x1fc1a8,_0x175452);_0xb2888(_0x175452);});});} \ No newline at end of file +var _0x642b=['catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x3b534c,_0x2c614f){var _0x449ef9=function(_0x285279){while(--_0x285279){_0x3b534c['push'](_0x3b534c['shift']());}};_0x449ef9(++_0x2c614f);}(_0x642b,0xe7));var _0xb642=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x642b[_0x5f09c5];return _0x426ad9;};'use strict';var _=require(_0xb642('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb642('0x1'));var rs=require(_0xb642('0x2'));var fs=require('fs');var Redis=require(_0xb642('0x3'));var db=require(_0xb642('0x4'))['db'];var utils=require(_0xb642('0x5'));var logger=require('../../config/logger')(_0xb642('0x6'));var config=require(_0xb642('0x7'));var jayson=require(_0xb642('0x8'));var client=jayson[_0xb642('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x16be74,_0x5cb0f3,_0x18a7c6){return new BPromise(function(_0x3d478b,_0x4864b3){return client[_0xb642('0xa')](_0x16be74,_0x18a7c6)[_0xb642('0xb')](function(_0x4e4283){logger[_0xb642('0xc')](_0xb642('0xd'),_0x5cb0f3,'request\x20sent');logger[_0xb642('0xe')](_0xb642('0xf'),_0x5cb0f3,_0xb642('0x10'),JSON[_0xb642('0x11')](_0x4e4283));if(_0x4e4283[_0xb642('0x12')]){if(_0x4e4283[_0xb642('0x12')][_0xb642('0x13')]===0x1f4){logger[_0xb642('0x12')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x5cb0f3,_0x4e4283[_0xb642('0x12')][_0xb642('0x14')]);return _0x4864b3(_0x4e4283[_0xb642('0x12')][_0xb642('0x14')]);}logger[_0xb642('0x12')](_0xb642('0xd'),_0x5cb0f3,_0x4e4283[_0xb642('0x12')][_0xb642('0x14')]);return _0x3d478b(_0x4e4283['error'][_0xb642('0x14')]);}else{logger[_0xb642('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x5cb0f3,'request\x20sent');_0x3d478b(_0x4e4283[_0xb642('0x15')]['message']);}})[_0xb642('0x16')](function(_0x5afaea){logger[_0xb642('0x12')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x5cb0f3,_0x5afaea);_0x4864b3(_0x5afaea);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index ff11baf..76df7a7 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 _0xc00a=['get','index','/:id','show','/:id/download','isAuthenticated','create','put','update','delete','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller'];(function(_0x5aef95,_0x26fe83){var _0x139522=function(_0x4f760b){while(--_0x4f760b){_0x5aef95['push'](_0x5aef95['shift']());}};_0x139522(++_0x26fe83);}(_0xc00a,0xb6));var _0xac00=function(_0x29c7ed,_0x389f4b){_0x29c7ed=_0x29c7ed-0x0;var _0x22b24d=_0xc00a[_0x29c7ed];return _0x22b24d;};'use strict';var multer=require(_0xac00('0x0'));var util=require(_0xac00('0x1'));var path=require(_0xac00('0x2'));var timeout=require('connect-timeout');var express=require(_0xac00('0x3'));var router=express['Router']();var fs_extra=require(_0xac00('0x4'));var auth=require(_0xac00('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xac00('0x6'));var controller=require(_0xac00('0x7'));router[_0xac00('0x8')]('/',auth['isAuthenticated'](),controller[_0xac00('0x9')]);router[_0xac00('0x8')](_0xac00('0xa'),auth['isAuthenticated'](),controller[_0xac00('0xb')]);router[_0xac00('0x8')](_0xac00('0xc'),auth['isAuthenticated'](),controller['download']);router['post']('/',auth[_0xac00('0xd')](),controller[_0xac00('0xe')]);router[_0xac00('0xf')](_0xac00('0xa'),auth['isAuthenticated'](),controller[_0xac00('0x10')]);router[_0xac00('0x11')](_0xac00('0xa'),auth[_0xac00('0xd')](),controller['destroy']);module[_0xac00('0x12')]=router; \ No newline at end of file +var _0x8b01=['update','delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller','index','/:id','isAuthenticated','show','get','download','post','create','put'];(function(_0x52a2cd,_0x5015f3){var _0x153b82=function(_0x109043){while(--_0x109043){_0x52a2cd['push'](_0x52a2cd['shift']());}};_0x153b82(++_0x5015f3);}(_0x8b01,0x156));var _0x18b0=function(_0x91e6a3,_0x2183e0){_0x91e6a3=_0x91e6a3-0x0;var _0x5d195e=_0x8b01[_0x91e6a3];return _0x5d195e;};'use strict';var multer=require(_0x18b0('0x0'));var util=require(_0x18b0('0x1'));var path=require(_0x18b0('0x2'));var timeout=require(_0x18b0('0x3'));var express=require(_0x18b0('0x4'));var router=express[_0x18b0('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x18b0('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x18b0('0x7'));var controller=require(_0x18b0('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x18b0('0x9')]);router['get'](_0x18b0('0xa'),auth[_0x18b0('0xb')](),controller[_0x18b0('0xc')]);router[_0x18b0('0xd')]('/:id/download',auth['isAuthenticated'](),controller[_0x18b0('0xe')]);router[_0x18b0('0xf')]('/',auth[_0x18b0('0xb')](),controller[_0x18b0('0x10')]);router[_0x18b0('0x11')](_0x18b0('0xa'),auth[_0x18b0('0xb')](),controller[_0x18b0('0x12')]);router[_0x18b0('0x13')](_0x18b0('0xa'),auth[_0x18b0('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 1ee8f05..00d4ce0 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 _0x1187=['STRING','BOOLEAN','sequelize','exports'];(function(_0x22e714,_0x38d207){var _0x1955ab=function(_0x173287){while(--_0x173287){_0x22e714['push'](_0x22e714['shift']());}};_0x1955ab(++_0x38d207);}(_0x1187,0x1d2));var _0x7118=function(_0x45e7dc,_0x2aff31){_0x45e7dc=_0x45e7dc-0x0;var _0xa11ba5=_0x1187[_0x45e7dc];return _0xa11ba5;};'use strict';var Sequelize=require(_0x7118('0x0'));module[_0x7118('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x7118('0x2')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x7118('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x7118('0x2')]},'custom':{'type':Sequelize[_0x7118('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xfb2a=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x131663,_0x592888){var _0x46e7a4=function(_0x38ed48){while(--_0x38ed48){_0x131663['push'](_0x131663['shift']());}};_0x46e7a4(++_0x592888);}(_0xfb2a,0xdf));var _0xafb2=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xfb2a[_0x3e5086];return _0xfeb102;};'use strict';var Sequelize=require(_0xafb2('0x0'));module[_0xafb2('0x1')]={'field':{'type':Sequelize[_0xafb2('0x2')]},'alias':{'type':Sequelize[_0xafb2('0x3')]},'function':{'type':Sequelize[_0xafb2('0x3')]},'format':{'type':Sequelize[_0xafb2('0x3')]},'groupBy':{'type':Sequelize[_0xafb2('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xafb2('0x3')]},'custom':{'type':Sequelize[_0xafb2('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 49d29aa..807d0f1 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 _0x4dc9=['apply','reject','save','update','destroy','then','end','error','name','send','index','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','AnalyticFieldReport','includeAll','include','rows','show','keys','rawAttributes','catch','create','body','bulkCreate','find','params','bulkDestroy','addFields','AnalyticCustomReport','findOne','sequelize','transaction','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','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','undefined','count','offset','limit','set','Content-Range'];(function(_0x2ce725,_0x2949de){var _0x51dd02=function(_0x218ff0){while(--_0x218ff0){_0x2ce725['push'](_0x2ce725['shift']());}};_0x51dd02(++_0x2949de);}(_0x4dc9,0x141));var _0x94dc=function(_0x28e363,_0x33114f){_0x28e363=_0x28e363-0x0;var _0x112f36=_0x4dc9[_0x28e363];return _0x112f36;};'use strict';var emlformat=require(_0x94dc('0x0'));var rimraf=require(_0x94dc('0x1'));var zipdir=require(_0x94dc('0x2'));var jsonpatch=require(_0x94dc('0x3'));var rp=require(_0x94dc('0x4'));var moment=require(_0x94dc('0x5'));var BPromise=require(_0x94dc('0x6'));var Mustache=require(_0x94dc('0x7'));var util=require(_0x94dc('0x8'));var path=require(_0x94dc('0x9'));var sox=require(_0x94dc('0xa'));var csv=require(_0x94dc('0xb'));var ejs=require(_0x94dc('0xc'));var fs=require('fs');var fs_extra=require(_0x94dc('0xd'));var _=require(_0x94dc('0xe'));var squel=require(_0x94dc('0xf'));var crypto=require(_0x94dc('0x10'));var jsforce=require(_0x94dc('0x11'));var deskjs=require(_0x94dc('0x12'));var toCsv=require(_0x94dc('0xb'));var querystring=require('querystring');var Papa=require(_0x94dc('0x13'));var Redis=require(_0x94dc('0x14'));var authService=require(_0x94dc('0x15'));var qs=require(_0x94dc('0x16'));var as=require(_0x94dc('0x17'));var hardwareService=require(_0x94dc('0x18'));var logger=require(_0x94dc('0x19'))(_0x94dc('0x1a'));var utils=require('../../config/utils');var config=require(_0x94dc('0x1b'));var licenseUtil=require(_0x94dc('0x1c'));var db=require(_0x94dc('0x1d'))['db'];function respondWithStatusCode(_0x4cd0b4,_0x310d85){_0x310d85=_0x310d85||0xcc;return function(_0x71d23a){if(_0x71d23a){return _0x4cd0b4[_0x94dc('0x1e')](_0x310d85);}return _0x4cd0b4[_0x94dc('0x1f')](_0x310d85)['end']();};}function respondWithResult(_0x11256f,_0x793dbb){_0x793dbb=_0x793dbb||0xc8;return function(_0x55ab3c){if(_0x55ab3c){return _0x11256f['status'](_0x793dbb)[_0x94dc('0x20')](_0x55ab3c);}};}function respondWithFilteredResult(_0x2c4145,_0x4cd164){return function(_0x41095e){if(_0x41095e){var _0x4179a0=typeof _0x4cd164['offset']===_0x94dc('0x21')&&typeof _0x4cd164['limit']===_0x94dc('0x21');var _0x53813e=_0x41095e[_0x94dc('0x22')];var _0xb9c7a9=_0x4179a0?0x0:_0x4cd164[_0x94dc('0x23')];var _0x4a6c90=_0x4179a0?_0x41095e[_0x94dc('0x22')]:_0x4cd164[_0x94dc('0x23')]+_0x4cd164[_0x94dc('0x24')];var _0x2529b7;if(_0x4a6c90>=_0x53813e){_0x4a6c90=_0x53813e;_0x2529b7=0xc8;}else{_0x2529b7=0xce;}_0x2c4145['status'](_0x2529b7);return _0x2c4145[_0x94dc('0x25')](_0x94dc('0x26'),_0xb9c7a9+'-'+_0x4a6c90+'/'+_0x53813e)[_0x94dc('0x20')](_0x41095e);}return null;};}function patchUpdates(_0x28caf9){return function(_0x59e856){try{jsonpatch[_0x94dc('0x27')](_0x59e856,_0x28caf9,!![]);}catch(_0x403046){return BPromise[_0x94dc('0x28')](_0x403046);}return _0x59e856[_0x94dc('0x29')]();};}function saveUpdates(_0x1b3109,_0x4ce387){return function(_0xf80607){if(_0xf80607){return _0xf80607[_0x94dc('0x2a')](_0x1b3109)['then'](function(_0x5d58b3){return _0x5d58b3;});}return null;};}function removeEntity(_0x408252,_0x465285){return function(_0x2fa184){if(_0x2fa184){return _0x2fa184[_0x94dc('0x2b')]()[_0x94dc('0x2c')](function(){_0x408252['status'](0xcc)[_0x94dc('0x2d')]();});}};}function handleEntityNotFound(_0x5d8392,_0x4134bc){return function(_0x4c16b9){if(!_0x4c16b9){_0x5d8392[_0x94dc('0x1e')](0x194);}return _0x4c16b9;};}function handleError(_0x56d774,_0x25fae3){_0x25fae3=_0x25fae3||0x1f4;return function(_0x4a055c){logger[_0x94dc('0x2e')](_0x4a055c['stack']);if(_0x4a055c['name']){delete _0x4a055c[_0x94dc('0x2f')];}_0x56d774[_0x94dc('0x1f')](_0x25fae3)[_0x94dc('0x30')](_0x4a055c);};}exports[_0x94dc('0x31')]=function(_0x42e662,_0x28de6f){var _0x5776e5={},_0x42705c={},_0x17dec={'count':0x0,'rows':[]};var _0x5474e1=_['map'](db['AnalyticFieldReport']['rawAttributes'],function(_0x569fdd){return{'name':_0x569fdd['fieldName'],'type':_0x569fdd[_0x94dc('0x32')][_0x94dc('0x33')]};});_0x42705c[_0x94dc('0x34')]=_[_0x94dc('0x35')](_0x5474e1,_0x94dc('0x2f'));_0x42705c['query']=_['keys'](_0x42e662[_0x94dc('0x36')]);_0x42705c[_0x94dc('0x37')]=_[_0x94dc('0x38')](_0x42705c['model'],_0x42705c[_0x94dc('0x36')]);_0x5776e5['attributes']=_['intersection'](_0x42705c[_0x94dc('0x34')],qs[_0x94dc('0x39')](_0x42e662[_0x94dc('0x36')]['fields']));_0x5776e5[_0x94dc('0x3a')]=_0x5776e5[_0x94dc('0x3a')][_0x94dc('0x3b')]?_0x5776e5[_0x94dc('0x3a')]:_0x42705c[_0x94dc('0x34')];if(!_0x42e662[_0x94dc('0x36')][_0x94dc('0x3c')](_0x94dc('0x3d'))){_0x5776e5[_0x94dc('0x24')]=qs['limit'](_0x42e662[_0x94dc('0x36')][_0x94dc('0x24')]);_0x5776e5[_0x94dc('0x23')]=qs[_0x94dc('0x23')](_0x42e662[_0x94dc('0x36')][_0x94dc('0x23')]);}_0x5776e5[_0x94dc('0x3e')]=qs['sort'](_0x42e662[_0x94dc('0x36')][_0x94dc('0x3f')]);_0x5776e5[_0x94dc('0x40')]=qs[_0x94dc('0x37')](_[_0x94dc('0x41')](_0x42e662[_0x94dc('0x36')],_0x42705c[_0x94dc('0x37')]),_0x5474e1);if(_0x42e662[_0x94dc('0x36')]['filter']){_0x5776e5[_0x94dc('0x40')]=_['merge'](_0x5776e5['where'],{'$or':_['map'](_0x5474e1,function(_0x47c28b){if(_0x47c28b[_0x94dc('0x32')]!==_0x94dc('0x42')){var _0x5d4c09={};_0x5d4c09[_0x47c28b[_0x94dc('0x2f')]]={'$like':'%'+_0x42e662[_0x94dc('0x36')][_0x94dc('0x43')]+'%'};return _0x5d4c09;}})});}_0x5776e5=_[_0x94dc('0x44')]({},_0x5776e5,_0x42e662[_0x94dc('0x45')]);var _0x1f0933={'where':_0x5776e5[_0x94dc('0x40')]};return db[_0x94dc('0x46')][_0x94dc('0x22')](_0x1f0933)[_0x94dc('0x2c')](function(_0x34b11f){_0x17dec[_0x94dc('0x22')]=_0x34b11f;if(_0x42e662['query'][_0x94dc('0x47')]){_0x5776e5[_0x94dc('0x48')]=[{'all':!![]}];}return db[_0x94dc('0x46')]['findAll'](_0x5776e5);})[_0x94dc('0x2c')](function(_0x46aa86){_0x17dec[_0x94dc('0x49')]=_0x46aa86;return _0x17dec;})[_0x94dc('0x2c')](respondWithFilteredResult(_0x28de6f,_0x5776e5))['catch'](handleError(_0x28de6f,null));};exports[_0x94dc('0x4a')]=function(_0xfcf112,_0x405d8b){var _0x5c9003={'raw':![],'where':{'id':_0xfcf112['params']['id']}},_0xa74542={};_0xa74542['model']=_[_0x94dc('0x4b')](db['AnalyticFieldReport'][_0x94dc('0x4c')]);_0xa74542[_0x94dc('0x36')]=_[_0x94dc('0x4b')](_0xfcf112['query']);_0xa74542[_0x94dc('0x37')]=_[_0x94dc('0x38')](_0xa74542[_0x94dc('0x34')],_0xa74542[_0x94dc('0x36')]);_0x5c9003[_0x94dc('0x3a')]=_[_0x94dc('0x38')](_0xa74542['model'],qs[_0x94dc('0x39')](_0xfcf112[_0x94dc('0x36')][_0x94dc('0x39')]));_0x5c9003[_0x94dc('0x3a')]=_0x5c9003['attributes'][_0x94dc('0x3b')]?_0x5c9003[_0x94dc('0x3a')]:_0xa74542['model'];if(_0xfcf112['query'][_0x94dc('0x47')]){_0x5c9003[_0x94dc('0x48')]=[{'all':!![]}];}_0x5c9003=_[_0x94dc('0x44')]({},_0x5c9003,_0xfcf112[_0x94dc('0x45')]);return db[_0x94dc('0x46')]['find'](_0x5c9003)[_0x94dc('0x2c')](handleEntityNotFound(_0x405d8b,null))['then'](respondWithResult(_0x405d8b,null))[_0x94dc('0x4d')](handleError(_0x405d8b,null));};exports[_0x94dc('0x4e')]=function(_0x124798,_0x4011b6){return db['AnalyticFieldReport'][_0x94dc('0x4e')](_0x124798[_0x94dc('0x4f')],{})['then'](respondWithResult(_0x4011b6,0xc9))[_0x94dc('0x4d')](handleError(_0x4011b6,null));};exports[_0x94dc('0x50')]=function(_0x593a0e,_0x3afd35){return db[_0x94dc('0x46')][_0x94dc('0x50')](_0x593a0e[_0x94dc('0x4f')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x3afd35,0xc9))[_0x94dc('0x4d')](handleError(_0x3afd35,null));};exports['update']=function(_0x2ae21a,_0x3f6035){if(_0x2ae21a['body']['id']){delete _0x2ae21a[_0x94dc('0x4f')]['id'];}return db[_0x94dc('0x46')][_0x94dc('0x51')]({'where':{'id':_0x2ae21a[_0x94dc('0x52')]['id']}})[_0x94dc('0x2c')](handleEntityNotFound(_0x3f6035,null))['then'](saveUpdates(_0x2ae21a[_0x94dc('0x4f')],null))[_0x94dc('0x2c')](respondWithResult(_0x3f6035,null))[_0x94dc('0x4d')](handleError(_0x3f6035,null));};exports['destroy']=function(_0x1d6c06,_0x43b474){return db[_0x94dc('0x46')][_0x94dc('0x51')]({'where':{'id':_0x1d6c06[_0x94dc('0x52')]['id']}})[_0x94dc('0x2c')](handleEntityNotFound(_0x43b474,null))[_0x94dc('0x2c')](removeEntity(_0x43b474,null))[_0x94dc('0x4d')](handleError(_0x43b474,null));};exports[_0x94dc('0x53')]=function(_0x26552a,_0x4502a5){return db[_0x94dc('0x46')][_0x94dc('0x2b')]({'where':{'id':_0x26552a[_0x94dc('0x36')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0x94dc('0x2c')](respondWithResult(_0x4502a5,0xcc))[_0x94dc('0x4d')](handleError(_0x4502a5,null));};exports[_0x94dc('0x54')]=function(_0x4e8a33,_0x348e3e,_0x1a4bcb){return db[_0x94dc('0x55')][_0x94dc('0x56')]({'where':{'id':_0x4e8a33[_0x94dc('0x52')]['id']}})[_0x94dc('0x2c')](handleEntityNotFound(_0x348e3e,null))[_0x94dc('0x2c')](function(_0x571b1e){if(_0x571b1e){return db[_0x94dc('0x57')][_0x94dc('0x58')](function(_0x49f423){return db[_0x94dc('0x46')][_0x94dc('0x2b')]({'where':{'CustomReportId':_0x4e8a33[_0x94dc('0x52')]['id']},'transaction':_0x49f423})['then'](function(_0x44c578){var _0x39719f=_['map'](_0x4e8a33['body'],function(_0x393d48){delete _0x393d48['id'];_0x393d48['CustomReportId']=_0x4e8a33[_0x94dc('0x52')]['id'];return _0x393d48;});return db['AnalyticFieldReport'][_0x94dc('0x50')](_0x39719f,{'transaction':_0x49f423});});})[_0x94dc('0x2c')](function(){return db[_0x94dc('0x46')][_0x94dc('0x59')]({'where':{'CustomReportId':_0x4e8a33[_0x94dc('0x52')]['id']}});});}})['then'](respondWithResult(_0x348e3e,null))['catch'](handleError(_0x348e3e,null));}; \ No newline at end of file +var _0x17d2=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','count','offset','limit','set','Content-Range','json','reject','save','destroy','then','end','error','name','send','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','include','rows','catch','params','includeAll','create','body','bulkCreate','update','find','ids','addFields','AnalyticCustomReport','CustomReportId','rimraf','zip-dir','fast-json-patch','moment','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','api','../../config/utils'];(function(_0x61a63d,_0x13f379){var _0x5ce6c8=function(_0x56befb){while(--_0x56befb){_0x61a63d['push'](_0x61a63d['shift']());}};_0x5ce6c8(++_0x13f379);}(_0x17d2,0x1c8));var _0x217d=function(_0x5be168,_0x41e08b){_0x5be168=_0x5be168-0x0;var _0x5f038b=_0x17d2[_0x5be168];return _0x5f038b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x217d('0x0'));var zipdir=require(_0x217d('0x1'));var jsonpatch=require(_0x217d('0x2'));var rp=require('request-promise');var moment=require(_0x217d('0x3'));var BPromise=require(_0x217d('0x4'));var Mustache=require(_0x217d('0x5'));var util=require(_0x217d('0x6'));var path=require(_0x217d('0x7'));var sox=require(_0x217d('0x8'));var csv=require(_0x217d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x217d('0xa'));var squel=require(_0x217d('0xb'));var crypto=require(_0x217d('0xc'));var jsforce=require(_0x217d('0xd'));var deskjs=require(_0x217d('0xe'));var toCsv=require(_0x217d('0x9'));var querystring=require(_0x217d('0xf'));var Papa=require(_0x217d('0x10'));var Redis=require(_0x217d('0x11'));var authService=require(_0x217d('0x12'));var qs=require(_0x217d('0x13'));var as=require(_0x217d('0x14'));var hardwareService=require(_0x217d('0x15'));var logger=require('../../config/logger')(_0x217d('0x16'));var utils=require(_0x217d('0x17'));var config=require(_0x217d('0x18'));var licenseUtil=require(_0x217d('0x19'));var db=require(_0x217d('0x1a'))['db'];function respondWithStatusCode(_0x266ec8,_0x124f45){_0x124f45=_0x124f45||0xcc;return function(_0x688bb5){if(_0x688bb5){return _0x266ec8[_0x217d('0x1b')](_0x124f45);}return _0x266ec8[_0x217d('0x1c')](_0x124f45)['end']();};}function respondWithResult(_0xa0fae5,_0x565dae){_0x565dae=_0x565dae||0xc8;return function(_0x33519c){if(_0x33519c){return _0xa0fae5[_0x217d('0x1c')](_0x565dae)['json'](_0x33519c);}};}function respondWithFilteredResult(_0x2aaef7,_0x59f325){return function(_0x47c286){if(_0x47c286){var _0x4a4e26=typeof _0x59f325['offset']===_0x217d('0x1d')&&typeof _0x59f325['limit']===_0x217d('0x1d');var _0x84c483=_0x47c286[_0x217d('0x1e')];var _0x450181=_0x4a4e26?0x0:_0x59f325[_0x217d('0x1f')];var _0x190719=_0x4a4e26?_0x47c286[_0x217d('0x1e')]:_0x59f325[_0x217d('0x1f')]+_0x59f325[_0x217d('0x20')];var _0x1ea908;if(_0x190719>=_0x84c483){_0x190719=_0x84c483;_0x1ea908=0xc8;}else{_0x1ea908=0xce;}_0x2aaef7['status'](_0x1ea908);return _0x2aaef7[_0x217d('0x21')](_0x217d('0x22'),_0x450181+'-'+_0x190719+'/'+_0x84c483)[_0x217d('0x23')](_0x47c286);}return null;};}function patchUpdates(_0x25eff2){return function(_0x3e0afc){try{jsonpatch['apply'](_0x3e0afc,_0x25eff2,!![]);}catch(_0x4433d8){return BPromise[_0x217d('0x24')](_0x4433d8);}return _0x3e0afc[_0x217d('0x25')]();};}function saveUpdates(_0x113989,_0xd6c086){return function(_0x50c201){if(_0x50c201){return _0x50c201['update'](_0x113989)['then'](function(_0x280a3c){return _0x280a3c;});}return null;};}function removeEntity(_0x27cfd9,_0x3847c6){return function(_0x5d9c82){if(_0x5d9c82){return _0x5d9c82[_0x217d('0x26')]()[_0x217d('0x27')](function(){_0x27cfd9[_0x217d('0x1c')](0xcc)[_0x217d('0x28')]();});}};}function handleEntityNotFound(_0x1c9fd3,_0x2f1b90){return function(_0xc44f01){if(!_0xc44f01){_0x1c9fd3['sendStatus'](0x194);}return _0xc44f01;};}function handleError(_0x5c05a8,_0x127cfe){_0x127cfe=_0x127cfe||0x1f4;return function(_0xaa62d0){logger[_0x217d('0x29')](_0xaa62d0['stack']);if(_0xaa62d0[_0x217d('0x2a')]){delete _0xaa62d0[_0x217d('0x2a')];}_0x5c05a8[_0x217d('0x1c')](_0x127cfe)[_0x217d('0x2b')](_0xaa62d0);};}exports['index']=function(_0x371902,_0x5986bf){var _0x1dc5e5={},_0x19c532={},_0x843ca={'count':0x0,'rows':[]};var _0x4daf92=_[_0x217d('0x2c')](db[_0x217d('0x2d')][_0x217d('0x2e')],function(_0x2e55fb){return{'name':_0x2e55fb[_0x217d('0x2f')],'type':_0x2e55fb[_0x217d('0x30')][_0x217d('0x31')]};});_0x19c532[_0x217d('0x32')]=_[_0x217d('0x2c')](_0x4daf92,_0x217d('0x2a'));_0x19c532[_0x217d('0x33')]=_[_0x217d('0x34')](_0x371902['query']);_0x19c532[_0x217d('0x35')]=_[_0x217d('0x36')](_0x19c532[_0x217d('0x32')],_0x19c532[_0x217d('0x33')]);_0x1dc5e5['attributes']=_[_0x217d('0x36')](_0x19c532['model'],qs[_0x217d('0x37')](_0x371902['query'][_0x217d('0x37')]));_0x1dc5e5[_0x217d('0x38')]=_0x1dc5e5[_0x217d('0x38')][_0x217d('0x39')]?_0x1dc5e5[_0x217d('0x38')]:_0x19c532[_0x217d('0x32')];if(!_0x371902[_0x217d('0x33')][_0x217d('0x3a')](_0x217d('0x3b'))){_0x1dc5e5[_0x217d('0x20')]=qs[_0x217d('0x20')](_0x371902[_0x217d('0x33')]['limit']);_0x1dc5e5[_0x217d('0x1f')]=qs[_0x217d('0x1f')](_0x371902[_0x217d('0x33')][_0x217d('0x1f')]);}_0x1dc5e5['order']=qs[_0x217d('0x3c')](_0x371902[_0x217d('0x33')][_0x217d('0x3c')]);_0x1dc5e5['where']=qs[_0x217d('0x35')](_[_0x217d('0x3d')](_0x371902['query'],_0x19c532['filters']),_0x4daf92);if(_0x371902[_0x217d('0x33')][_0x217d('0x3e')]){_0x1dc5e5[_0x217d('0x3f')]=_['merge'](_0x1dc5e5['where'],{'$or':_[_0x217d('0x2c')](_0x4daf92,function(_0x244f56){if(_0x244f56['type']!==_0x217d('0x40')){var _0x4f88dd={};_0x4f88dd[_0x244f56['name']]={'$like':'%'+_0x371902[_0x217d('0x33')][_0x217d('0x3e')]+'%'};return _0x4f88dd;}})});}_0x1dc5e5=_[_0x217d('0x41')]({},_0x1dc5e5,_0x371902['options']);var _0x1aeae2={'where':_0x1dc5e5[_0x217d('0x3f')]};return db[_0x217d('0x2d')][_0x217d('0x1e')](_0x1aeae2)['then'](function(_0x4daf66){_0x843ca[_0x217d('0x1e')]=_0x4daf66;if(_0x371902[_0x217d('0x33')]['includeAll']){_0x1dc5e5[_0x217d('0x42')]=[{'all':!![]}];}return db[_0x217d('0x2d')]['findAll'](_0x1dc5e5);})['then'](function(_0x4b159e){_0x843ca[_0x217d('0x43')]=_0x4b159e;return _0x843ca;})[_0x217d('0x27')](respondWithFilteredResult(_0x5986bf,_0x1dc5e5))[_0x217d('0x44')](handleError(_0x5986bf,null));};exports['show']=function(_0x3c11fd,_0x1e52cc){var _0x1f81d6={'raw':![],'where':{'id':_0x3c11fd[_0x217d('0x45')]['id']}},_0x1827b4={};_0x1827b4[_0x217d('0x32')]=_[_0x217d('0x34')](db[_0x217d('0x2d')][_0x217d('0x2e')]);_0x1827b4[_0x217d('0x33')]=_['keys'](_0x3c11fd[_0x217d('0x33')]);_0x1827b4[_0x217d('0x35')]=_['intersection'](_0x1827b4[_0x217d('0x32')],_0x1827b4['query']);_0x1f81d6['attributes']=_[_0x217d('0x36')](_0x1827b4[_0x217d('0x32')],qs[_0x217d('0x37')](_0x3c11fd[_0x217d('0x33')][_0x217d('0x37')]));_0x1f81d6[_0x217d('0x38')]=_0x1f81d6[_0x217d('0x38')]['length']?_0x1f81d6['attributes']:_0x1827b4[_0x217d('0x32')];if(_0x3c11fd[_0x217d('0x33')][_0x217d('0x46')]){_0x1f81d6[_0x217d('0x42')]=[{'all':!![]}];}_0x1f81d6=_[_0x217d('0x41')]({},_0x1f81d6,_0x3c11fd['options']);return db[_0x217d('0x2d')]['find'](_0x1f81d6)[_0x217d('0x27')](handleEntityNotFound(_0x1e52cc,null))['then'](respondWithResult(_0x1e52cc,null))[_0x217d('0x44')](handleError(_0x1e52cc,null));};exports[_0x217d('0x47')]=function(_0x553f6d,_0x3e12be){return db[_0x217d('0x2d')][_0x217d('0x47')](_0x553f6d[_0x217d('0x48')],{})['then'](respondWithResult(_0x3e12be,0xc9))[_0x217d('0x44')](handleError(_0x3e12be,null));};exports[_0x217d('0x49')]=function(_0x2fd184,_0x294aff){return db['AnalyticFieldReport'][_0x217d('0x49')](_0x2fd184[_0x217d('0x48')],{'raw':![],'individualHooks':!![]})[_0x217d('0x27')](respondWithResult(_0x294aff,0xc9))[_0x217d('0x44')](handleError(_0x294aff,null));};exports[_0x217d('0x4a')]=function(_0x4361f0,_0x15a446){if(_0x4361f0[_0x217d('0x48')]['id']){delete _0x4361f0[_0x217d('0x48')]['id'];}return db[_0x217d('0x2d')]['find']({'where':{'id':_0x4361f0[_0x217d('0x45')]['id']}})[_0x217d('0x27')](handleEntityNotFound(_0x15a446,null))[_0x217d('0x27')](saveUpdates(_0x4361f0[_0x217d('0x48')],null))['then'](respondWithResult(_0x15a446,null))[_0x217d('0x44')](handleError(_0x15a446,null));};exports[_0x217d('0x26')]=function(_0x15f9ae,_0x318146){return db[_0x217d('0x2d')][_0x217d('0x4b')]({'where':{'id':_0x15f9ae[_0x217d('0x45')]['id']}})['then'](handleEntityNotFound(_0x318146,null))[_0x217d('0x27')](removeEntity(_0x318146,null))[_0x217d('0x44')](handleError(_0x318146,null));};exports['bulkDestroy']=function(_0x1ba47c,_0x433258){return db[_0x217d('0x2d')][_0x217d('0x26')]({'where':{'id':_0x1ba47c[_0x217d('0x33')][_0x217d('0x4c')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x433258,0xcc))[_0x217d('0x44')](handleError(_0x433258,null));};exports[_0x217d('0x4d')]=function(_0x3acbaf,_0x5a6aaa,_0x2bd537){return db[_0x217d('0x4e')]['findOne']({'where':{'id':_0x3acbaf[_0x217d('0x45')]['id']}})[_0x217d('0x27')](handleEntityNotFound(_0x5a6aaa,null))[_0x217d('0x27')](function(_0x5d995c){if(_0x5d995c){return db['sequelize']['transaction'](function(_0x57ecac){return db[_0x217d('0x2d')]['destroy']({'where':{'CustomReportId':_0x3acbaf[_0x217d('0x45')]['id']},'transaction':_0x57ecac})[_0x217d('0x27')](function(_0x1bdc78){var _0x46883c=_[_0x217d('0x2c')](_0x3acbaf[_0x217d('0x48')],function(_0x81375){delete _0x81375['id'];_0x81375[_0x217d('0x4f')]=_0x3acbaf[_0x217d('0x45')]['id'];return _0x81375;});return db[_0x217d('0x2d')][_0x217d('0x49')](_0x46883c,{'transaction':_0x57ecac});});})['then'](function(){return db['AnalyticFieldReport']['findAll']({'where':{'CustomReportId':_0x3acbaf['params']['id']}});});}})['then'](respondWithResult(_0x5a6aaa,null))[_0x217d('0x44')](handleError(_0x5a6aaa,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 011661c..290b980 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 _0xe9e3=['./analyticFieldReport.attributes','exports','define','analytics_report_fields','lodash','../../config/logger','request-promise','path','rimraf','../../config/environment'];(function(_0xaf936c,_0x527c18){var _0x1f81cd=function(_0x4360ab){while(--_0x4360ab){_0xaf936c['push'](_0xaf936c['shift']());}};_0x1f81cd(++_0x527c18);}(_0xe9e3,0x1c6));var _0x3e9e=function(_0x41e507,_0x694b79){_0x41e507=_0x41e507-0x0;var _0x3bbe37=_0xe9e3[_0x41e507];return _0x3bbe37;};'use strict';var _=require(_0x3e9e('0x0'));var util=require('util');var logger=require(_0x3e9e('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3e9e('0x2'));var fs=require('fs');var path=require(_0x3e9e('0x3'));var rimraf=require(_0x3e9e('0x4'));var config=require(_0x3e9e('0x5'));var attributes=require(_0x3e9e('0x6'));module[_0x3e9e('0x7')]=function(_0x571cb4,_0x4f5962){return _0x571cb4[_0x3e9e('0x8')]('AnalyticFieldReport',attributes,{'tableName':_0x3e9e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6e0a=['./analyticFieldReport.attributes','exports','define','analytics_report_fields','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x4a3898,_0x4c9853){var _0x25ceb0=function(_0x528b6d){while(--_0x528b6d){_0x4a3898['push'](_0x4a3898['shift']());}};_0x25ceb0(++_0x4c9853);}(_0x6e0a,0x164));var _0xa6e0=function(_0x1d0458,_0x389f29){_0x1d0458=_0x1d0458-0x0;var _0x35eea4=_0x6e0a[_0x1d0458];return _0x35eea4;};'use strict';var _=require('lodash');var util=require(_0xa6e0('0x0'));var logger=require(_0xa6e0('0x1'))(_0xa6e0('0x2'));var moment=require(_0xa6e0('0x3'));var BPromise=require('bluebird');var rp=require(_0xa6e0('0x4'));var fs=require('fs');var path=require(_0xa6e0('0x5'));var rimraf=require(_0xa6e0('0x6'));var config=require('../../config/environment');var attributes=require(_0xa6e0('0x7'));module[_0xa6e0('0x8')]=function(_0xa42b65,_0x553f14){return _0xa42b65[_0xa6e0('0x9')]('AnalyticFieldReport',attributes,{'tableName':_0xa6e0('0xa'),'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 21dbc96..a28f84c 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 _0x0a14=['rpc','jayson/promise','client','request','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1b6aab,_0x5683f0){var _0x181f68=function(_0x127b26){while(--_0x127b26){_0x1b6aab['push'](_0x1b6aab['shift']());}};_0x181f68(++_0x5683f0);}(_0x0a14,0xfc));var _0x40a1=function(_0x450b9e,_0x2992d8){_0x450b9e=_0x450b9e-0x0;var _0x4ff728=_0x0a14[_0x450b9e];return _0x4ff728;};'use strict';var _=require(_0x40a1('0x0'));var util=require(_0x40a1('0x1'));var moment=require(_0x40a1('0x2'));var BPromise=require(_0x40a1('0x3'));var rs=require(_0x40a1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x40a1('0x5'))['db'];var utils=require(_0x40a1('0x6'));var logger=require(_0x40a1('0x7'))(_0x40a1('0x8'));var config=require('../../config/environment');var jayson=require(_0x40a1('0x9'));var client=jayson[_0x40a1('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xbd448a,_0x281e0d,_0x4f09e8){return new BPromise(function(_0x1b2749,_0x469e4d){return client[_0x40a1('0xb')](_0xbd448a,_0x4f09e8)['then'](function(_0x1d6d3b){logger[_0x40a1('0xc')](_0x40a1('0xd'),_0x281e0d,_0x40a1('0xe'));logger[_0x40a1('0xf')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x281e0d,_0x40a1('0xe'),JSON[_0x40a1('0x10')](_0x1d6d3b));if(_0x1d6d3b[_0x40a1('0x11')]){if(_0x1d6d3b[_0x40a1('0x11')]['code']===0x1f4){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x281e0d,_0x1d6d3b[_0x40a1('0x11')]['message']);return _0x469e4d(_0x1d6d3b['error'][_0x40a1('0x12')]);}logger[_0x40a1('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x281e0d,_0x1d6d3b[_0x40a1('0x11')][_0x40a1('0x12')]);return _0x1b2749(_0x1d6d3b[_0x40a1('0x11')][_0x40a1('0x12')]);}else{logger['info'](_0x40a1('0xd'),_0x281e0d,_0x40a1('0xe'));_0x1b2749(_0x1d6d3b[_0x40a1('0x13')][_0x40a1('0x12')]);}})['catch'](function(_0x4d1b1f){logger[_0x40a1('0x11')](_0x40a1('0xd'),_0x281e0d,_0x4d1b1f);_0x469e4d(_0x4d1b1f);});});} \ No newline at end of file +var _0xd3c0=['info','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x20a558,_0x160e0e){var _0x53d3f7=function(_0x259bd8){while(--_0x259bd8){_0x20a558['push'](_0x20a558['shift']());}};_0x53d3f7(++_0x160e0e);}(_0xd3c0,0x1be));var _0x0d3c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd3c0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0d3c('0x0'));var util=require('util');var moment=require(_0x0d3c('0x1'));var BPromise=require(_0x0d3c('0x2'));var rs=require(_0x0d3c('0x3'));var fs=require('fs');var Redis=require(_0x0d3c('0x4'));var db=require(_0x0d3c('0x5'))['db'];var utils=require(_0x0d3c('0x6'));var logger=require(_0x0d3c('0x7'))(_0x0d3c('0x8'));var config=require(_0x0d3c('0x9'));var jayson=require(_0x0d3c('0xa'));var client=jayson[_0x0d3c('0xb')][_0x0d3c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2ee704,_0x43d40e,_0x1dbcea){return new BPromise(function(_0xb69a0a,_0x21befc){return client['request'](_0x2ee704,_0x1dbcea)[_0x0d3c('0xd')](function(_0x31c06e){logger[_0x0d3c('0xe')]('AnalyticFieldReport,\x20%s,\x20%s',_0x43d40e,'request\x20sent');logger['debug'](_0x0d3c('0xf'),_0x43d40e,_0x0d3c('0x10'),JSON[_0x0d3c('0x11')](_0x31c06e));if(_0x31c06e[_0x0d3c('0x12')]){if(_0x31c06e[_0x0d3c('0x12')][_0x0d3c('0x13')]===0x1f4){logger[_0x0d3c('0x12')](_0x0d3c('0x14'),_0x43d40e,_0x31c06e[_0x0d3c('0x12')][_0x0d3c('0x15')]);return _0x21befc(_0x31c06e[_0x0d3c('0x12')]['message']);}logger[_0x0d3c('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x43d40e,_0x31c06e[_0x0d3c('0x12')][_0x0d3c('0x15')]);return _0xb69a0a(_0x31c06e[_0x0d3c('0x12')]['message']);}else{logger[_0x0d3c('0xe')](_0x0d3c('0x14'),_0x43d40e,_0x0d3c('0x10'));_0xb69a0a(_0x31c06e[_0x0d3c('0x16')][_0x0d3c('0x15')]);}})['catch'](function(_0x268471){logger[_0x0d3c('0x12')](_0x0d3c('0x14'),_0x43d40e,_0x268471);_0x21befc(_0x268471);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 1aaa090..338e0e2 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(_0x3d7032,_0x4f483e){var _0x3bfc3c=function(_0x48afd2){while(--_0x48afd2){_0x3d7032['push'](_0x3d7032['shift']());}};_0x3bfc3c(++_0x4f483e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'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(_0x2bb4de,_0x4665be){var _0x39cd99=function(_0x24cd62){while(--_0x24cd62){_0x2bb4de['push'](_0x2bb4de['shift']());}};_0x39cd99(++_0x4665be);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'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 b7435df..6132518 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 _0x4a1d=['exports','STRING','name','sequelize'];(function(_0x3c5aba,_0x2406ab){var _0x220e51=function(_0x117671){while(--_0x117671){_0x3c5aba['push'](_0x3c5aba['shift']());}};_0x220e51(++_0x2406ab);}(_0x4a1d,0x77));var _0xd4a1=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x4a1d[_0x432682];return _0x463d05;};'use strict';var Sequelize=require(_0xd4a1('0x0'));module[_0xd4a1('0x1')]={'name':{'type':Sequelize[_0xd4a1('0x2')],'allowNull':![],'unique':_0xd4a1('0x3')},'table':{'type':Sequelize[_0xd4a1('0x2')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0xd4a1('0x2')]}}; \ No newline at end of file +var _0xe28e=['name','TEXT','sequelize','exports','STRING'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0xe28e,0x1ba));var _0xee28=function(_0x99498a,_0x2a1d60){_0x99498a=_0x99498a-0x0;var _0x2a9d23=_0xe28e[_0x99498a];return _0x2a9d23;};'use strict';var Sequelize=require(_0xee28('0x0'));module[_0xee28('0x1')]={'name':{'type':Sequelize[_0xee28('0x2')],'allowNull':![],'unique':_0xee28('0x3')},'table':{'type':Sequelize[_0xee28('0x2')]},'metric':{'type':Sequelize[_0xee28('0x4')]},'description':{'type':Sequelize[_0xee28('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 399a616..d4d7fd7 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 _0x9957=['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','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','Metrics','UserProfileResource','end','error','name','map','type','key','model','keys','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','AnalyticMetric','include','findAll','rawAttributes','intersection','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs'];(function(_0x3825a8,_0x2ce1a2){var _0xabc9bc=function(_0x101073){while(--_0x101073){_0x3825a8['push'](_0x3825a8['shift']());}};_0xabc9bc(++_0x2ce1a2);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'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(){var _0x472195=_0x563799['get']({'plain':!![]});var _0x39df42=_0x7995('0x28');return db[_0x7995('0x29')][_0x7995('0x27')]({'where':{'type':_0x39df42,'resourceId':_0x472195['id']}})[_0x7995('0x26')](function(){return _0x563799;});})[_0x7995('0x26')](function(){_0x204507['status'](0xcc)[_0x7995('0x2a')]();});}};}function handleEntityNotFound(_0x5911c3,_0x229742){return function(_0x49bc7e){if(!_0x49bc7e){_0x5911c3[_0x7995('0x1b')](0x194);}return _0x49bc7e;};}function handleError(_0x132a42,_0x11c1eb){_0x11c1eb=_0x11c1eb||0x1f4;return function(_0x4b6f99){logger[_0x7995('0x2b')](_0x4b6f99['stack']);if(_0x4b6f99[_0x7995('0x2c')]){delete _0x4b6f99[_0x7995('0x2c')];}_0x132a42[_0x7995('0x1c')](_0x11c1eb)['send'](_0x4b6f99);};}exports['index']=function(_0x48e573,_0x3573be){var _0xe6b0b3={},_0x327a81={},_0x2b874d={'count':0x0,'rows':[]};var _0x2e3493=_[_0x7995('0x2d')](db['AnalyticMetric']['rawAttributes'],function(_0xfa8f15){return{'name':_0xfa8f15['fieldName'],'type':_0xfa8f15[_0x7995('0x2e')][_0x7995('0x2f')]};});_0x327a81[_0x7995('0x30')]=_[_0x7995('0x2d')](_0x2e3493,_0x7995('0x2c'));_0x327a81['query']=_[_0x7995('0x31')](_0x48e573[_0x7995('0x32')]);_0x327a81['filters']=_['intersection'](_0x327a81['model'],_0x327a81[_0x7995('0x32')]);_0xe6b0b3[_0x7995('0x33')]=_['intersection'](_0x327a81[_0x7995('0x30')],qs['fields'](_0x48e573[_0x7995('0x32')][_0x7995('0x34')]));_0xe6b0b3[_0x7995('0x33')]=_0xe6b0b3['attributes']['length']?_0xe6b0b3[_0x7995('0x33')]:_0x327a81['model'];if(!_0x48e573['query'][_0x7995('0x35')](_0x7995('0x36'))){_0xe6b0b3['limit']=qs[_0x7995('0x21')](_0x48e573[_0x7995('0x32')][_0x7995('0x21')]);_0xe6b0b3[_0x7995('0x20')]=qs[_0x7995('0x20')](_0x48e573['query'][_0x7995('0x20')]);}_0xe6b0b3[_0x7995('0x37')]=qs[_0x7995('0x38')](_0x48e573[_0x7995('0x32')]['sort']);_0xe6b0b3[_0x7995('0x39')]=qs[_0x7995('0x3a')](_[_0x7995('0x3b')](_0x48e573[_0x7995('0x32')],_0x327a81[_0x7995('0x3a')]),_0x2e3493);if(_0x48e573[_0x7995('0x32')]['filter']){_0xe6b0b3[_0x7995('0x39')]=_[_0x7995('0x3c')](_0xe6b0b3[_0x7995('0x39')],{'$or':_[_0x7995('0x2d')](_0x2e3493,function(_0x2e04cd){if(_0x2e04cd[_0x7995('0x2e')]!==_0x7995('0x3d')){var _0x270c0e={};_0x270c0e[_0x2e04cd[_0x7995('0x2c')]]={'$like':'%'+_0x48e573[_0x7995('0x32')][_0x7995('0x3e')]+'%'};return _0x270c0e;}})});}_0xe6b0b3=_[_0x7995('0x3c')]({},_0xe6b0b3,_0x48e573[_0x7995('0x3f')]);var _0x53cda2={'where':_0xe6b0b3['where']};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x53cda2)['then'](function(_0x4b0855){_0x2b874d[_0x7995('0x1f')]=_0x4b0855;if(_0x48e573['query']['includeAll']){_0xe6b0b3[_0x7995('0x41')]=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x42')](_0xe6b0b3);})['then'](function(_0x46ac4f){_0x2b874d['rows']=_0x46ac4f;return _0x2b874d;})[_0x7995('0x26')](respondWithFilteredResult(_0x3573be,_0xe6b0b3))['catch'](handleError(_0x3573be,null));};exports['show']=function(_0x39c5b8,_0x403f54){var _0xc04e5={'raw':!![],'where':{'id':_0x39c5b8['params']['id']}},_0x3f1c35={};_0x3f1c35[_0x7995('0x30')]=_[_0x7995('0x31')](db[_0x7995('0x40')][_0x7995('0x43')]);_0x3f1c35['query']=_['keys'](_0x39c5b8[_0x7995('0x32')]);_0x3f1c35['filters']=_[_0x7995('0x44')](_0x3f1c35['model'],_0x3f1c35[_0x7995('0x32')]);_0xc04e5['attributes']=_[_0x7995('0x44')](_0x3f1c35[_0x7995('0x30')],qs['fields'](_0x39c5b8[_0x7995('0x32')][_0x7995('0x34')]));_0xc04e5[_0x7995('0x33')]=_0xc04e5[_0x7995('0x33')]['length']?_0xc04e5[_0x7995('0x33')]:_0x3f1c35[_0x7995('0x30')];if(_0x39c5b8[_0x7995('0x32')]['includeAll']){_0xc04e5[_0x7995('0x41')]=[{'all':!![]}];}_0xc04e5=_[_0x7995('0x3c')]({},_0xc04e5,_0x39c5b8[_0x7995('0x3f')]);return db[_0x7995('0x40')][_0x7995('0x45')](_0xc04e5)['then'](handleEntityNotFound(_0x403f54,null))[_0x7995('0x26')](respondWithResult(_0x403f54,null))[_0x7995('0x46')](handleError(_0x403f54,null));};exports['create']=function(_0x3d1dbb,_0x5843ba){return db[_0x7995('0x40')][_0x7995('0x47')](_0x3d1dbb[_0x7995('0x48')],{})[_0x7995('0x26')](function(_0xddf537){var _0x14b537=_0x3d1dbb[_0x7995('0x49')]['get']({'plain':!![]});if(!_0x14b537)throw new Error(_0x7995('0x4a'));if(_0x14b537[_0x7995('0x4b')]===_0x7995('0x49')){var _0x4ffc8a=_0xddf537[_0x7995('0x4c')]({'plain':!![]});var _0x1fe77e=_0x7995('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x1fe77e,'userProfileId':_0x14b537['userProfileId']},'raw':!![]})[_0x7995('0x26')](function(_0x1fd1ca){if(_0x1fd1ca&&_0x1fd1ca['autoAssociation']===0x0){return db[_0x7995('0x29')][_0x7995('0x47')]({'name':_0x4ffc8a[_0x7995('0x2c')],'resourceId':_0x4ffc8a['id'],'type':_0x1fd1ca[_0x7995('0x2c')],'sectionId':_0x1fd1ca['id']},{})[_0x7995('0x26')](function(){return _0xddf537;});}else{return _0xddf537;}})['catch'](function(_0x29ee32){logger['error'](_0x7995('0x4d'),_0x29ee32);throw _0x29ee32;});}return _0xddf537;})[_0x7995('0x26')](respondWithResult(_0x5843ba,0xc9))[_0x7995('0x46')](handleError(_0x5843ba,null));};exports['update']=function(_0x5e1f34,_0x54e2b1){if(_0x5e1f34['body']['id']){delete _0x5e1f34[_0x7995('0x48')]['id'];}return db[_0x7995('0x40')][_0x7995('0x45')]({'where':{'id':_0x5e1f34[_0x7995('0x4e')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x54e2b1,null))[_0x7995('0x26')](saveUpdates(_0x5e1f34[_0x7995('0x48')],null))[_0x7995('0x26')](respondWithResult(_0x54e2b1,null))[_0x7995('0x46')](handleError(_0x54e2b1,null));};exports[_0x7995('0x27')]=function(_0xa7af8c,_0x133c63){return db[_0x7995('0x40')][_0x7995('0x45')]({'where':{'id':_0xa7af8c[_0x7995('0x4e')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x133c63,null))[_0x7995('0x26')](removeEntity(_0x133c63,null))[_0x7995('0x46')](handleError(_0x133c63,null));}; \ No newline at end of file +var _0x9a19=['AnalyticMetric','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','find','body','user','UserProfileSection','autoAssociation','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','save','then','destroy','get','Metrics','stack','name','send','index','map'];(function(_0x3b72fc,_0x982011){var _0x5e0463=function(_0x21a2d7){while(--_0x21a2d7){_0x3b72fc['push'](_0x3b72fc['shift']());}};_0x5e0463(++_0x982011);}(_0x9a19,0x114));var _0x99a1=function(_0x20589d,_0x55d5bf){_0x20589d=_0x20589d-0x0;var _0x422de9=_0x9a19[_0x20589d];return _0x422de9;};'use strict';var emlformat=require(_0x99a1('0x0'));var rimraf=require(_0x99a1('0x1'));var zipdir=require(_0x99a1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x99a1('0x3'));var moment=require(_0x99a1('0x4'));var BPromise=require(_0x99a1('0x5'));var Mustache=require(_0x99a1('0x6'));var util=require(_0x99a1('0x7'));var path=require(_0x99a1('0x8'));var sox=require(_0x99a1('0x9'));var csv=require(_0x99a1('0xa'));var ejs=require(_0x99a1('0xb'));var fs=require('fs');var fs_extra=require(_0x99a1('0xc'));var _=require(_0x99a1('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x99a1('0xe'));var toCsv=require(_0x99a1('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x99a1('0xf'));var authService=require(_0x99a1('0x10'));var qs=require(_0x99a1('0x11'));var as=require(_0x99a1('0x12'));var hardwareService=require(_0x99a1('0x13'));var logger=require('../../config/logger')(_0x99a1('0x14'));var utils=require(_0x99a1('0x15'));var config=require(_0x99a1('0x16'));var licenseUtil=require(_0x99a1('0x17'));var db=require(_0x99a1('0x18'))['db'];function respondWithStatusCode(_0x1bc7aa,_0x2ff655){_0x2ff655=_0x2ff655||0xcc;return function(_0x532f56){if(_0x532f56){return _0x1bc7aa[_0x99a1('0x19')](_0x2ff655);}return _0x1bc7aa[_0x99a1('0x1a')](_0x2ff655)[_0x99a1('0x1b')]();};}function respondWithResult(_0x47815e,_0xe1a1f){_0xe1a1f=_0xe1a1f||0xc8;return function(_0x3c9ef4){if(_0x3c9ef4){return _0x47815e[_0x99a1('0x1a')](_0xe1a1f)['json'](_0x3c9ef4);}};}function respondWithFilteredResult(_0x2d81ed,_0x3e45d4){return function(_0x1bb464){if(_0x1bb464){var _0x3d40cc=typeof _0x3e45d4[_0x99a1('0x1c')]===_0x99a1('0x1d')&&typeof _0x3e45d4[_0x99a1('0x1e')]==='undefined';var _0x4f049c=_0x1bb464[_0x99a1('0x1f')];var _0xbf62f1=_0x3d40cc?0x0:_0x3e45d4[_0x99a1('0x1c')];var _0x1fcd00=_0x3d40cc?_0x1bb464[_0x99a1('0x1f')]:_0x3e45d4[_0x99a1('0x1c')]+_0x3e45d4[_0x99a1('0x1e')];var _0x3cd62c;if(_0x1fcd00>=_0x4f049c){_0x1fcd00=_0x4f049c;_0x3cd62c=0xc8;}else{_0x3cd62c=0xce;}_0x2d81ed[_0x99a1('0x1a')](_0x3cd62c);return _0x2d81ed[_0x99a1('0x20')](_0x99a1('0x21'),_0xbf62f1+'-'+_0x1fcd00+'/'+_0x4f049c)['json'](_0x1bb464);}return null;};}function patchUpdates(_0x3023a1){return function(_0x20007e){try{jsonpatch['apply'](_0x20007e,_0x3023a1,!![]);}catch(_0x38435b){return BPromise['reject'](_0x38435b);}return _0x20007e[_0x99a1('0x22')]();};}function saveUpdates(_0x2927b0,_0x2d6f20){return function(_0x2d3b82){if(_0x2d3b82){return _0x2d3b82['update'](_0x2927b0)[_0x99a1('0x23')](function(_0x1268a7){return _0x1268a7;});}return null;};}function removeEntity(_0x483c17,_0x44df2d){return function(_0x5b5dfa){if(_0x5b5dfa){return _0x5b5dfa[_0x99a1('0x24')]()[_0x99a1('0x23')](function(){var _0x179597=_0x5b5dfa[_0x99a1('0x25')]({'plain':!![]});var _0x3c813=_0x99a1('0x26');return db['UserProfileResource'][_0x99a1('0x24')]({'where':{'type':_0x3c813,'resourceId':_0x179597['id']}})['then'](function(){return _0x5b5dfa;});})['then'](function(){_0x483c17[_0x99a1('0x1a')](0xcc)[_0x99a1('0x1b')]();});}};}function handleEntityNotFound(_0xa6799b,_0x15a0b6){return function(_0x25d560){if(!_0x25d560){_0xa6799b[_0x99a1('0x19')](0x194);}return _0x25d560;};}function handleError(_0x183037,_0x549645){_0x549645=_0x549645||0x1f4;return function(_0xf41b0d){logger['error'](_0xf41b0d[_0x99a1('0x27')]);if(_0xf41b0d[_0x99a1('0x28')]){delete _0xf41b0d[_0x99a1('0x28')];}_0x183037['status'](_0x549645)[_0x99a1('0x29')](_0xf41b0d);};}exports[_0x99a1('0x2a')]=function(_0x5718b9,_0x37514e){var _0x1434a0={},_0x36aa34={},_0x303d1e={'count':0x0,'rows':[]};var _0x2a5b8c=_[_0x99a1('0x2b')](db[_0x99a1('0x2c')][_0x99a1('0x2d')],function(_0x52da8d){return{'name':_0x52da8d['fieldName'],'type':_0x52da8d[_0x99a1('0x2e')]['key']};});_0x36aa34[_0x99a1('0x2f')]=_[_0x99a1('0x2b')](_0x2a5b8c,'name');_0x36aa34[_0x99a1('0x30')]=_[_0x99a1('0x31')](_0x5718b9[_0x99a1('0x30')]);_0x36aa34[_0x99a1('0x32')]=_[_0x99a1('0x33')](_0x36aa34[_0x99a1('0x2f')],_0x36aa34[_0x99a1('0x30')]);_0x1434a0[_0x99a1('0x34')]=_[_0x99a1('0x33')](_0x36aa34[_0x99a1('0x2f')],qs[_0x99a1('0x35')](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x35')]));_0x1434a0[_0x99a1('0x34')]=_0x1434a0['attributes']['length']?_0x1434a0[_0x99a1('0x34')]:_0x36aa34[_0x99a1('0x2f')];if(!_0x5718b9[_0x99a1('0x30')][_0x99a1('0x36')](_0x99a1('0x37'))){_0x1434a0[_0x99a1('0x1e')]=qs[_0x99a1('0x1e')](_0x5718b9['query'][_0x99a1('0x1e')]);_0x1434a0[_0x99a1('0x1c')]=qs['offset'](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x1c')]);}_0x1434a0[_0x99a1('0x38')]=qs[_0x99a1('0x39')](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x39')]);_0x1434a0[_0x99a1('0x3a')]=qs[_0x99a1('0x32')](_[_0x99a1('0x3b')](_0x5718b9[_0x99a1('0x30')],_0x36aa34[_0x99a1('0x32')]),_0x2a5b8c);if(_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3c')]){_0x1434a0['where']=_['merge'](_0x1434a0['where'],{'$or':_[_0x99a1('0x2b')](_0x2a5b8c,function(_0x169df7){if(_0x169df7[_0x99a1('0x2e')]!==_0x99a1('0x3d')){var _0x40613a={};_0x40613a[_0x169df7['name']]={'$like':'%'+_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3c')]+'%'};return _0x40613a;}})});}_0x1434a0=_[_0x99a1('0x3e')]({},_0x1434a0,_0x5718b9['options']);var _0x49be37={'where':_0x1434a0[_0x99a1('0x3a')]};return db[_0x99a1('0x2c')][_0x99a1('0x1f')](_0x49be37)['then'](function(_0x6c4cb){_0x303d1e[_0x99a1('0x1f')]=_0x6c4cb;if(_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3f')]){_0x1434a0[_0x99a1('0x40')]=[{'all':!![]}];}return db[_0x99a1('0x2c')][_0x99a1('0x41')](_0x1434a0);})[_0x99a1('0x23')](function(_0x1c4ce4){_0x303d1e[_0x99a1('0x42')]=_0x1c4ce4;return _0x303d1e;})['then'](respondWithFilteredResult(_0x37514e,_0x1434a0))[_0x99a1('0x43')](handleError(_0x37514e,null));};exports[_0x99a1('0x44')]=function(_0x3d5373,_0x50d38b){var _0x1beed2={'raw':!![],'where':{'id':_0x3d5373[_0x99a1('0x45')]['id']}},_0x51536d={};_0x51536d[_0x99a1('0x2f')]=_[_0x99a1('0x31')](db[_0x99a1('0x2c')][_0x99a1('0x2d')]);_0x51536d[_0x99a1('0x30')]=_['keys'](_0x3d5373[_0x99a1('0x30')]);_0x51536d['filters']=_[_0x99a1('0x33')](_0x51536d[_0x99a1('0x2f')],_0x51536d[_0x99a1('0x30')]);_0x1beed2[_0x99a1('0x34')]=_[_0x99a1('0x33')](_0x51536d[_0x99a1('0x2f')],qs[_0x99a1('0x35')](_0x3d5373[_0x99a1('0x30')][_0x99a1('0x35')]));_0x1beed2[_0x99a1('0x34')]=_0x1beed2[_0x99a1('0x34')]['length']?_0x1beed2[_0x99a1('0x34')]:_0x51536d[_0x99a1('0x2f')];if(_0x3d5373['query'][_0x99a1('0x3f')]){_0x1beed2[_0x99a1('0x40')]=[{'all':!![]}];}_0x1beed2=_[_0x99a1('0x3e')]({},_0x1beed2,_0x3d5373[_0x99a1('0x46')]);return db[_0x99a1('0x2c')][_0x99a1('0x47')](_0x1beed2)[_0x99a1('0x23')](handleEntityNotFound(_0x50d38b,null))['then'](respondWithResult(_0x50d38b,null))[_0x99a1('0x43')](handleError(_0x50d38b,null));};exports['create']=function(_0x1d4d3f,_0x269798){return db['AnalyticMetric']['create'](_0x1d4d3f[_0x99a1('0x48')],{})[_0x99a1('0x23')](function(_0x462c15){var _0x4519fb=_0x1d4d3f[_0x99a1('0x49')]['get']({'plain':!![]});if(!_0x4519fb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4519fb['role']===_0x99a1('0x49')){var _0x4ae90e=_0x462c15[_0x99a1('0x25')]({'plain':!![]});var _0x30fdfb=_0x99a1('0x26');return db[_0x99a1('0x4a')][_0x99a1('0x47')]({'where':{'name':_0x30fdfb,'userProfileId':_0x4519fb['userProfileId']},'raw':!![]})[_0x99a1('0x23')](function(_0x22bfd8){if(_0x22bfd8&&_0x22bfd8[_0x99a1('0x4b')]===0x0){return db['UserProfileResource'][_0x99a1('0x4c')]({'name':_0x4ae90e['name'],'resourceId':_0x4ae90e['id'],'type':_0x22bfd8['name'],'sectionId':_0x22bfd8['id']},{})[_0x99a1('0x23')](function(){return _0x462c15;});}else{return _0x462c15;}})[_0x99a1('0x43')](function(_0x1dd17b){logger[_0x99a1('0x4d')](_0x99a1('0x4e'),_0x1dd17b);throw _0x1dd17b;});}return _0x462c15;})[_0x99a1('0x23')](respondWithResult(_0x269798,0xc9))[_0x99a1('0x43')](handleError(_0x269798,null));};exports[_0x99a1('0x4f')]=function(_0x16641e,_0x53e9eb){if(_0x16641e[_0x99a1('0x48')]['id']){delete _0x16641e['body']['id'];}return db[_0x99a1('0x2c')][_0x99a1('0x47')]({'where':{'id':_0x16641e['params']['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x53e9eb,null))[_0x99a1('0x23')](saveUpdates(_0x16641e[_0x99a1('0x48')],null))[_0x99a1('0x23')](respondWithResult(_0x53e9eb,null))[_0x99a1('0x43')](handleError(_0x53e9eb,null));};exports[_0x99a1('0x24')]=function(_0x157c49,_0x1a5658){return db[_0x99a1('0x2c')][_0x99a1('0x47')]({'where':{'id':_0x157c49[_0x99a1('0x45')]['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x1a5658,null))['then'](removeEntity(_0x1a5658,null))['catch'](handleError(_0x1a5658,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 16ecc1b..cd2e6a4 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 _0x4491=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','AnalyticMetric','analytics_metrics','lodash'];(function(_0x4922d9,_0x263c9b){var _0x2e43c2=function(_0x4378b1){while(--_0x4378b1){_0x4922d9['push'](_0x4922d9['shift']());}};_0x2e43c2(++_0x263c9b);}(_0x4491,0x1bb));var _0x1449=function(_0x39bd53,_0x47d856){_0x39bd53=_0x39bd53-0x0;var _0x648c9=_0x4491[_0x39bd53];return _0x648c9;};'use strict';var _=require(_0x1449('0x0'));var util=require('util');var logger=require(_0x1449('0x1'))('api');var moment=require(_0x1449('0x2'));var BPromise=require(_0x1449('0x3'));var rp=require(_0x1449('0x4'));var fs=require('fs');var path=require(_0x1449('0x5'));var rimraf=require(_0x1449('0x6'));var config=require(_0x1449('0x7'));var attributes=require('./analyticMetric.attributes');module[_0x1449('0x8')]=function(_0x557482,_0x1d45eb){return _0x557482[_0x1449('0x9')](_0x1449('0xa'),attributes,{'tableName':_0x1449('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe55d=['request-promise','path','rimraf','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','lodash','util','api','moment','bluebird'];(function(_0xb13d17,_0x1cd499){var _0x23c99e=function(_0x309af3){while(--_0x309af3){_0xb13d17['push'](_0xb13d17['shift']());}};_0x23c99e(++_0x1cd499);}(_0xe55d,0x126));var _0xde55=function(_0x22823e,_0x2822f6){_0x22823e=_0x22823e-0x0;var _0x312be0=_0xe55d[_0x22823e];return _0x312be0;};'use strict';var _=require(_0xde55('0x0'));var util=require(_0xde55('0x1'));var logger=require('../../config/logger')(_0xde55('0x2'));var moment=require(_0xde55('0x3'));var BPromise=require(_0xde55('0x4'));var rp=require(_0xde55('0x5'));var fs=require('fs');var path=require(_0xde55('0x6'));var rimraf=require(_0xde55('0x7'));var config=require('../../config/environment');var attributes=require(_0xde55('0x8'));module[_0xde55('0x9')]=function(_0x3b2c0a,_0x55d5fa){return _0x3b2c0a[_0xde55('0xa')](_0xde55('0xb'),attributes,{'tableName':_0xde55('0xc'),'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 6655865..598bac1 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 _0x60bd=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','stringify','error','code','AnalyticMetric,\x20%s,\x20%s','message','result','catch','moment','bluebird','randomstring'];(function(_0x155857,_0x48f43d){var _0x1b0346=function(_0xd276ce){while(--_0xd276ce){_0x155857['push'](_0x155857['shift']());}};_0x1b0346(++_0x48f43d);}(_0x60bd,0x162));var _0xd60b=function(_0x24595e,_0x11cb9a){_0x24595e=_0x24595e-0x0;var _0x3339fc=_0x60bd[_0x24595e];return _0x3339fc;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd60b('0x0'));var BPromise=require(_0xd60b('0x1'));var rs=require(_0xd60b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd60b('0x3'))['db'];var utils=require(_0xd60b('0x4'));var logger=require(_0xd60b('0x5'))(_0xd60b('0x6'));var config=require(_0xd60b('0x7'));var jayson=require(_0xd60b('0x8'));var client=jayson[_0xd60b('0x9')][_0xd60b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5e7b31,_0x7630e4,_0x327114){return new BPromise(function(_0x56c70c,_0x479cd0){return client[_0xd60b('0xb')](_0x5e7b31,_0x327114)['then'](function(_0x14a255){logger[_0xd60b('0xc')]('AnalyticMetric,\x20%s,\x20%s',_0x7630e4,_0xd60b('0xd'));logger['debug']('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x7630e4,_0xd60b('0xd'),JSON[_0xd60b('0xe')](_0x14a255));if(_0x14a255[_0xd60b('0xf')]){if(_0x14a255[_0xd60b('0xf')][_0xd60b('0x10')]===0x1f4){logger[_0xd60b('0xf')](_0xd60b('0x11'),_0x7630e4,_0x14a255['error'][_0xd60b('0x12')]);return _0x479cd0(_0x14a255['error'][_0xd60b('0x12')]);}logger[_0xd60b('0xf')](_0xd60b('0x11'),_0x7630e4,_0x14a255[_0xd60b('0xf')][_0xd60b('0x12')]);return _0x56c70c(_0x14a255[_0xd60b('0xf')][_0xd60b('0x12')]);}else{logger['info'](_0xd60b('0x11'),_0x7630e4,'request\x20sent');_0x56c70c(_0x14a255[_0xd60b('0x13')][_0xd60b('0x12')]);}})[_0xd60b('0x14')](function(_0x1908c8){logger[_0xd60b('0xf')](_0xd60b('0x11'),_0x7630e4,_0x1908c8);_0x479cd0(_0x1908c8);});});} \ No newline at end of file +var _0x376f=['info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','client','http','then','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x376f,0x153));var _0xf376=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0x376f[_0x1b6186];return _0x186121;};'use strict';var _=require(_0xf376('0x0'));var util=require(_0xf376('0x1'));var moment=require(_0xf376('0x2'));var BPromise=require(_0xf376('0x3'));var rs=require(_0xf376('0x4'));var fs=require('fs');var Redis=require(_0xf376('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xf376('0x6'));var jayson=require(_0xf376('0x7'));var client=jayson[_0xf376('0x8')][_0xf376('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x247764,_0x583502,_0x2a8a57){return new BPromise(function(_0xc0e876,_0x4095df){return client['request'](_0x247764,_0x2a8a57)[_0xf376('0xa')](function(_0x438026){logger['info'](_0xf376('0xb'),_0x583502,_0xf376('0xc'));logger[_0xf376('0xd')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x583502,_0xf376('0xc'),JSON[_0xf376('0xe')](_0x438026));if(_0x438026[_0xf376('0xf')]){if(_0x438026['error'][_0xf376('0x10')]===0x1f4){logger[_0xf376('0xf')]('AnalyticMetric,\x20%s,\x20%s',_0x583502,_0x438026['error']['message']);return _0x4095df(_0x438026[_0xf376('0xf')][_0xf376('0x11')]);}logger['error'](_0xf376('0xb'),_0x583502,_0x438026['error'][_0xf376('0x11')]);return _0xc0e876(_0x438026[_0xf376('0xf')][_0xf376('0x11')]);}else{logger[_0xf376('0x12')](_0xf376('0xb'),_0x583502,'request\x20sent');_0xc0e876(_0x438026[_0xf376('0x13')][_0xf376('0x11')]);}})[_0xf376('0x14')](function(_0x418696){logger[_0xf376('0xf')]('AnalyticMetric,\x20%s,\x20%s',_0x583502,_0x418696);_0x4095df(_0x418696);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 17dc4f1..e10dbf8 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 _0xc3a8=['update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','create','put'];(function(_0x6105a6,_0x393b26){var _0x3b77cb=function(_0x36c9d4){while(--_0x36c9d4){_0x6105a6['push'](_0x6105a6['shift']());}};_0x3b77cb(++_0x393b26);}(_0xc3a8,0xe8));var _0x8c3a=function(_0x5d4db8,_0x4ad01b){_0x5d4db8=_0x5d4db8-0x0;var _0x415548=_0xc3a8[_0x5d4db8];return _0x415548;};'use strict';var multer=require(_0x8c3a('0x0'));var util=require(_0x8c3a('0x1'));var path=require(_0x8c3a('0x2'));var timeout=require('connect-timeout');var express=require(_0x8c3a('0x3'));var router=express['Router']();var fs_extra=require(_0x8c3a('0x4'));var auth=require(_0x8c3a('0x5'));var interaction=require(_0x8c3a('0x6'));var config=require(_0x8c3a('0x7'));var controller=require('./analyticMetric.controller');router[_0x8c3a('0x8')]('/',auth[_0x8c3a('0x9')](),controller[_0x8c3a('0xa')]);router[_0x8c3a('0x8')](_0x8c3a('0xb'),auth[_0x8c3a('0x9')](),controller['show']);router[_0x8c3a('0xc')]('/',auth[_0x8c3a('0x9')](),controller[_0x8c3a('0xd')]);router[_0x8c3a('0xe')](_0x8c3a('0xb'),auth['isAuthenticated'](),controller[_0x8c3a('0xf')]);router[_0x8c3a('0x10')]('/:id',auth[_0x8c3a('0x9')](),controller[_0x8c3a('0x11')]);module[_0x8c3a('0x12')]=router; \ No newline at end of file +var _0x565f=['index','/:id','isAuthenticated','show','put','update','delete','destroy','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x8b7177,_0x4ab3e2){var _0x15e557=function(_0x5c47dc){while(--_0x5c47dc){_0x8b7177['push'](_0x8b7177['shift']());}};_0x15e557(++_0x4ab3e2);}(_0x565f,0x68));var _0xf565=function(_0x31f0b9,_0x1bc1f1){_0x31f0b9=_0x31f0b9-0x0;var _0x22fa17=_0x565f[_0x31f0b9];return _0x22fa17;};'use strict';var multer=require('multer');var util=require(_0xf565('0x0'));var path=require(_0xf565('0x1'));var timeout=require(_0xf565('0x2'));var express=require('express');var router=express[_0xf565('0x3')]();var fs_extra=require(_0xf565('0x4'));var auth=require(_0xf565('0x5'));var interaction=require(_0xf565('0x6'));var config=require(_0xf565('0x7'));var controller=require('./analyticMetric.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xf565('0x8')]);router['get'](_0xf565('0x9'),auth[_0xf565('0xa')](),controller[_0xf565('0xb')]);router['post']('/',auth[_0xf565('0xa')](),controller['create']);router[_0xf565('0xc')]('/:id',auth[_0xf565('0xa')](),controller[_0xf565('0xd')]);router[_0xf565('0xe')](_0xf565('0x9'),auth[_0xf565('0xa')](),controller[_0xf565('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index eb83c03..918619e 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 _0x6b03=['TEXT','exports'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x6b03,0xcb));var _0x36b0=function(_0x5eb4da,_0x55cc65){_0x5eb4da=_0x5eb4da-0x0;var _0x4757ab=_0x6b03[_0x5eb4da];return _0x4757ab;};'use strict';var Sequelize=require('sequelize');module[_0x36b0('0x0')]={'tree':{'type':Sequelize[_0x36b0('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x12fd=['TEXT','sequelize','exports'];(function(_0x57fc29,_0x4bbb3c){var _0x347f6a=function(_0x40cc2e){while(--_0x40cc2e){_0x57fc29['push'](_0x57fc29['shift']());}};_0x347f6a(++_0x4bbb3c);}(_0x12fd,0xb5));var _0xd12f=function(_0xe7da85,_0x88701e){_0xe7da85=_0xe7da85-0x0;var _0x10af91=_0x12fd[_0xe7da85];return _0x10af91;};'use strict';var Sequelize=require(_0xd12f('0x0'));module[_0xd12f('0x1')]={'tree':{'type':Sequelize[_0xd12f('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index c34e692..73d17d1 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 _0x4c19=['params','includeAll','find','create','body','rimraf','fast-json-patch','request-promise','bluebird','mustache','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/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','AnalyticTreeReport','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','catch','show'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x4c19,0x93));var _0x94c1=function(_0x45b4d9,_0x6228b9){_0x45b4d9=_0x45b4d9-0x0;var _0x54ae0e=_0x4c19[_0x45b4d9];return _0x54ae0e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x94c1('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x94c1('0x1'));var rp=require(_0x94c1('0x2'));var moment=require('moment');var BPromise=require(_0x94c1('0x3'));var Mustache=require(_0x94c1('0x4'));var util=require('util');var path=require(_0x94c1('0x5'));var sox=require(_0x94c1('0x6'));var csv=require(_0x94c1('0x7'));var ejs=require(_0x94c1('0x8'));var fs=require('fs');var fs_extra=require(_0x94c1('0x9'));var _=require('lodash');var squel=require(_0x94c1('0xa'));var crypto=require(_0x94c1('0xb'));var jsforce=require(_0x94c1('0xc'));var deskjs=require(_0x94c1('0xd'));var toCsv=require(_0x94c1('0x7'));var querystring=require(_0x94c1('0xe'));var Papa=require(_0x94c1('0xf'));var Redis=require(_0x94c1('0x10'));var authService=require(_0x94c1('0x11'));var qs=require(_0x94c1('0x12'));var as=require(_0x94c1('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x94c1('0x14'));var config=require(_0x94c1('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x94c1('0x16'))['db'];function respondWithStatusCode(_0x21adf1,_0x1360e8){_0x1360e8=_0x1360e8||0xcc;return function(_0x3c350a){if(_0x3c350a){return _0x21adf1['sendStatus'](_0x1360e8);}return _0x21adf1[_0x94c1('0x17')](_0x1360e8)[_0x94c1('0x18')]();};}function respondWithResult(_0x30cfa5,_0x435f38){_0x435f38=_0x435f38||0xc8;return function(_0x21b028){if(_0x21b028){return _0x30cfa5[_0x94c1('0x17')](_0x435f38)[_0x94c1('0x19')](_0x21b028);}};}function respondWithFilteredResult(_0x9f858f,_0xc27a2e){return function(_0x5e023b){if(_0x5e023b){var _0x3f8ead=typeof _0xc27a2e[_0x94c1('0x1a')]===_0x94c1('0x1b')&&typeof _0xc27a2e[_0x94c1('0x1c')]===_0x94c1('0x1b');var _0x315742=_0x5e023b[_0x94c1('0x1d')];var _0x222db0=_0x3f8ead?0x0:_0xc27a2e['offset'];var _0x5ed13b=_0x3f8ead?_0x5e023b['count']:_0xc27a2e[_0x94c1('0x1a')]+_0xc27a2e[_0x94c1('0x1c')];var _0x4c4721;if(_0x5ed13b>=_0x315742){_0x5ed13b=_0x315742;_0x4c4721=0xc8;}else{_0x4c4721=0xce;}_0x9f858f['status'](_0x4c4721);return _0x9f858f[_0x94c1('0x1e')](_0x94c1('0x1f'),_0x222db0+'-'+_0x5ed13b+'/'+_0x315742)[_0x94c1('0x19')](_0x5e023b);}return null;};}function patchUpdates(_0x36970e){return function(_0x595b25){try{jsonpatch[_0x94c1('0x20')](_0x595b25,_0x36970e,!![]);}catch(_0x3d0478){return BPromise[_0x94c1('0x21')](_0x3d0478);}return _0x595b25[_0x94c1('0x22')]();};}function saveUpdates(_0x40af9f,_0x6a32c3){return function(_0x4b234f){if(_0x4b234f){return _0x4b234f[_0x94c1('0x23')](_0x40af9f)[_0x94c1('0x24')](function(_0x196818){return _0x196818;});}return null;};}function removeEntity(_0x49fddb,_0xa05ca4){return function(_0x25bba6){if(_0x25bba6){return _0x25bba6[_0x94c1('0x25')]()[_0x94c1('0x24')](function(){_0x49fddb[_0x94c1('0x17')](0xcc)[_0x94c1('0x18')]();});}};}function handleEntityNotFound(_0x187d6e,_0x2b7f05){return function(_0x33e1fd){if(!_0x33e1fd){_0x187d6e[_0x94c1('0x26')](0x194);}return _0x33e1fd;};}function handleError(_0xf721e3,_0xf5c187){_0xf5c187=_0xf5c187||0x1f4;return function(_0x1df841){logger[_0x94c1('0x27')](_0x1df841[_0x94c1('0x28')]);if(_0x1df841['name']){delete _0x1df841[_0x94c1('0x29')];}_0xf721e3[_0x94c1('0x17')](_0xf5c187)[_0x94c1('0x2a')](_0x1df841);};}exports[_0x94c1('0x2b')]=function(_0xc9995f,_0x55cdf9){var _0x300aaa={},_0x336b02={},_0x1a56ff={'count':0x0,'rows':[]};var _0x486f3a=_[_0x94c1('0x2c')](db[_0x94c1('0x2d')]['rawAttributes'],function(_0x43d754){return{'name':_0x43d754['fieldName'],'type':_0x43d754[_0x94c1('0x2e')]['key']};});_0x336b02[_0x94c1('0x2f')]=_['map'](_0x486f3a,_0x94c1('0x29'));_0x336b02[_0x94c1('0x30')]=_[_0x94c1('0x31')](_0xc9995f['query']);_0x336b02[_0x94c1('0x32')]=_[_0x94c1('0x33')](_0x336b02[_0x94c1('0x2f')],_0x336b02[_0x94c1('0x30')]);_0x300aaa[_0x94c1('0x34')]=_[_0x94c1('0x33')](_0x336b02[_0x94c1('0x2f')],qs[_0x94c1('0x35')](_0xc9995f['query'][_0x94c1('0x35')]));_0x300aaa[_0x94c1('0x34')]=_0x300aaa[_0x94c1('0x34')][_0x94c1('0x36')]?_0x300aaa['attributes']:_0x336b02[_0x94c1('0x2f')];if(!_0xc9995f[_0x94c1('0x30')]['hasOwnProperty'](_0x94c1('0x37'))){_0x300aaa[_0x94c1('0x1c')]=qs[_0x94c1('0x1c')](_0xc9995f[_0x94c1('0x30')][_0x94c1('0x1c')]);_0x300aaa[_0x94c1('0x1a')]=qs[_0x94c1('0x1a')](_0xc9995f['query'][_0x94c1('0x1a')]);}_0x300aaa['order']=qs[_0x94c1('0x38')](_0xc9995f['query']['sort']);_0x300aaa[_0x94c1('0x39')]=qs[_0x94c1('0x32')](_[_0x94c1('0x3a')](_0xc9995f[_0x94c1('0x30')],_0x336b02[_0x94c1('0x32')]),_0x486f3a);if(_0xc9995f[_0x94c1('0x30')][_0x94c1('0x3b')]){_0x300aaa[_0x94c1('0x39')]=_[_0x94c1('0x3c')](_0x300aaa[_0x94c1('0x39')],{'$or':_[_0x94c1('0x2c')](_0x486f3a,function(_0x23f586){if(_0x23f586[_0x94c1('0x2e')]!==_0x94c1('0x3d')){var _0x37e7e6={};_0x37e7e6[_0x23f586['name']]={'$like':'%'+_0xc9995f[_0x94c1('0x30')][_0x94c1('0x3b')]+'%'};return _0x37e7e6;}})});}_0x300aaa=_[_0x94c1('0x3c')]({},_0x300aaa,_0xc9995f[_0x94c1('0x3e')]);var _0x359275={'where':_0x300aaa[_0x94c1('0x39')]};return db[_0x94c1('0x2d')][_0x94c1('0x1d')](_0x359275)[_0x94c1('0x24')](function(_0x35f9b7){_0x1a56ff[_0x94c1('0x1d')]=_0x35f9b7;if(_0xc9995f['query']['includeAll']){_0x300aaa[_0x94c1('0x3f')]=[{'all':!![]}];}return db[_0x94c1('0x2d')]['findAll'](_0x300aaa);})[_0x94c1('0x24')](function(_0x4104e1){_0x1a56ff['rows']=_0x4104e1;return _0x1a56ff;})[_0x94c1('0x24')](respondWithFilteredResult(_0x55cdf9,_0x300aaa))[_0x94c1('0x40')](handleError(_0x55cdf9,null));};exports[_0x94c1('0x41')]=function(_0x8b0801,_0x67c8fd){var _0x223168={'raw':!![],'where':{'id':_0x8b0801[_0x94c1('0x42')]['id']}},_0x20d00a={};_0x20d00a[_0x94c1('0x2f')]=_[_0x94c1('0x31')](db[_0x94c1('0x2d')]['rawAttributes']);_0x20d00a['query']=_[_0x94c1('0x31')](_0x8b0801['query']);_0x20d00a[_0x94c1('0x32')]=_['intersection'](_0x20d00a[_0x94c1('0x2f')],_0x20d00a[_0x94c1('0x30')]);_0x223168[_0x94c1('0x34')]=_[_0x94c1('0x33')](_0x20d00a['model'],qs[_0x94c1('0x35')](_0x8b0801[_0x94c1('0x30')][_0x94c1('0x35')]));_0x223168['attributes']=_0x223168[_0x94c1('0x34')][_0x94c1('0x36')]?_0x223168[_0x94c1('0x34')]:_0x20d00a[_0x94c1('0x2f')];if(_0x8b0801[_0x94c1('0x30')][_0x94c1('0x43')]){_0x223168[_0x94c1('0x3f')]=[{'all':!![]}];}_0x223168=_[_0x94c1('0x3c')]({},_0x223168,_0x8b0801[_0x94c1('0x3e')]);return db[_0x94c1('0x2d')][_0x94c1('0x44')](_0x223168)['then'](handleEntityNotFound(_0x67c8fd,null))[_0x94c1('0x24')](respondWithResult(_0x67c8fd,null))['catch'](handleError(_0x67c8fd,null));};exports['create']=function(_0x500b02,_0x29b38b){return db[_0x94c1('0x2d')][_0x94c1('0x45')](_0x500b02[_0x94c1('0x46')],{})[_0x94c1('0x24')](respondWithResult(_0x29b38b,0xc9))[_0x94c1('0x40')](handleError(_0x29b38b,null));};exports[_0x94c1('0x23')]=function(_0x39c247,_0x528981){if(_0x39c247[_0x94c1('0x46')]['id']){delete _0x39c247[_0x94c1('0x46')]['id'];}return db[_0x94c1('0x2d')][_0x94c1('0x44')]({'where':{'id':_0x39c247[_0x94c1('0x42')]['id']}})[_0x94c1('0x24')](handleEntityNotFound(_0x528981,null))[_0x94c1('0x24')](saveUpdates(_0x39c247[_0x94c1('0x46')],null))[_0x94c1('0x24')](respondWithResult(_0x528981,null))[_0x94c1('0x40')](handleError(_0x528981,null));};exports[_0x94c1('0x25')]=function(_0x531f09,_0x2f9d5f){return db[_0x94c1('0x2d')][_0x94c1('0x44')]({'where':{'id':_0x531f09[_0x94c1('0x42')]['id']}})['then'](handleEntityNotFound(_0x2f9d5f,null))[_0x94c1('0x24')](removeEntity(_0x2f9d5f,null))[_0x94c1('0x40')](handleError(_0x2f9d5f,null));}; \ No newline at end of file +var _0x46d5=['query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','params','find','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','json','apply','reject','save','update','then','destroy','error','stack','name','map','AnalyticTreeReport','rawAttributes','fieldName','type','key'];(function(_0x452259,_0x580308){var _0x192c46=function(_0x4bd83c){while(--_0x4bd83c){_0x452259['push'](_0x452259['shift']());}};_0x192c46(++_0x580308);}(_0x46d5,0xa9));var _0x546d=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x46d5[_0xfae23b];return _0x200640;};'use strict';var emlformat=require(_0x546d('0x0'));var rimraf=require(_0x546d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x546d('0x2'));var rp=require(_0x546d('0x3'));var moment=require(_0x546d('0x4'));var BPromise=require(_0x546d('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x546d('0x6'));var sox=require(_0x546d('0x7'));var csv=require(_0x546d('0x8'));var ejs=require(_0x546d('0x9'));var fs=require('fs');var fs_extra=require(_0x546d('0xa'));var _=require(_0x546d('0xb'));var squel=require(_0x546d('0xc'));var crypto=require(_0x546d('0xd'));var jsforce=require(_0x546d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x546d('0x8'));var querystring=require('querystring');var Papa=require(_0x546d('0xf'));var Redis=require(_0x546d('0x10'));var authService=require(_0x546d('0x11'));var qs=require(_0x546d('0x12'));var as=require(_0x546d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x546d('0x14'))(_0x546d('0x15'));var utils=require(_0x546d('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x546d('0x17'))['db'];function respondWithStatusCode(_0x4ce791,_0x36b4b0){_0x36b4b0=_0x36b4b0||0xcc;return function(_0x4bf437){if(_0x4bf437){return _0x4ce791[_0x546d('0x18')](_0x36b4b0);}return _0x4ce791[_0x546d('0x19')](_0x36b4b0)[_0x546d('0x1a')]();};}function respondWithResult(_0x23b2d8,_0x558866){_0x558866=_0x558866||0xc8;return function(_0x48b65f){if(_0x48b65f){return _0x23b2d8[_0x546d('0x19')](_0x558866)['json'](_0x48b65f);}};}function respondWithFilteredResult(_0x49c8ca,_0x512b43){return function(_0x58232b){if(_0x58232b){var _0x4a12be=typeof _0x512b43[_0x546d('0x1b')]===_0x546d('0x1c')&&typeof _0x512b43[_0x546d('0x1d')]==='undefined';var _0x3839ac=_0x58232b[_0x546d('0x1e')];var _0x56607e=_0x4a12be?0x0:_0x512b43[_0x546d('0x1b')];var _0x198544=_0x4a12be?_0x58232b[_0x546d('0x1e')]:_0x512b43[_0x546d('0x1b')]+_0x512b43[_0x546d('0x1d')];var _0x49fb11;if(_0x198544>=_0x3839ac){_0x198544=_0x3839ac;_0x49fb11=0xc8;}else{_0x49fb11=0xce;}_0x49c8ca['status'](_0x49fb11);return _0x49c8ca['set']('Content-Range',_0x56607e+'-'+_0x198544+'/'+_0x3839ac)[_0x546d('0x1f')](_0x58232b);}return null;};}function patchUpdates(_0x47243e){return function(_0x5e227a){try{jsonpatch[_0x546d('0x20')](_0x5e227a,_0x47243e,!![]);}catch(_0x395b7e){return BPromise[_0x546d('0x21')](_0x395b7e);}return _0x5e227a[_0x546d('0x22')]();};}function saveUpdates(_0x1aa690,_0x294a57){return function(_0x1a763e){if(_0x1a763e){return _0x1a763e[_0x546d('0x23')](_0x1aa690)[_0x546d('0x24')](function(_0x441ce9){return _0x441ce9;});}return null;};}function removeEntity(_0x2d690d,_0x3a2145){return function(_0x16d56e){if(_0x16d56e){return _0x16d56e[_0x546d('0x25')]()['then'](function(){_0x2d690d['status'](0xcc)[_0x546d('0x1a')]();});}};}function handleEntityNotFound(_0x281cee,_0x29a224){return function(_0x274073){if(!_0x274073){_0x281cee['sendStatus'](0x194);}return _0x274073;};}function handleError(_0x2936e7,_0x2dfd35){_0x2dfd35=_0x2dfd35||0x1f4;return function(_0x199ed9){logger[_0x546d('0x26')](_0x199ed9[_0x546d('0x27')]);if(_0x199ed9[_0x546d('0x28')]){delete _0x199ed9['name'];}_0x2936e7[_0x546d('0x19')](_0x2dfd35)['send'](_0x199ed9);};}exports['index']=function(_0x12fdfb,_0x2fd65c){var _0x3d1110={},_0x3a9399={},_0x30c22a={'count':0x0,'rows':[]};var _0x32a30c=_[_0x546d('0x29')](db[_0x546d('0x2a')][_0x546d('0x2b')],function(_0x484673){return{'name':_0x484673[_0x546d('0x2c')],'type':_0x484673[_0x546d('0x2d')][_0x546d('0x2e')]};});_0x3a9399['model']=_[_0x546d('0x29')](_0x32a30c,_0x546d('0x28'));_0x3a9399[_0x546d('0x2f')]=_[_0x546d('0x30')](_0x12fdfb[_0x546d('0x2f')]);_0x3a9399[_0x546d('0x31')]=_[_0x546d('0x32')](_0x3a9399[_0x546d('0x33')],_0x3a9399[_0x546d('0x2f')]);_0x3d1110[_0x546d('0x34')]=_[_0x546d('0x32')](_0x3a9399[_0x546d('0x33')],qs[_0x546d('0x35')](_0x12fdfb[_0x546d('0x2f')][_0x546d('0x35')]));_0x3d1110[_0x546d('0x34')]=_0x3d1110[_0x546d('0x34')][_0x546d('0x36')]?_0x3d1110['attributes']:_0x3a9399['model'];if(!_0x12fdfb[_0x546d('0x2f')][_0x546d('0x37')](_0x546d('0x38'))){_0x3d1110[_0x546d('0x1d')]=qs[_0x546d('0x1d')](_0x12fdfb[_0x546d('0x2f')][_0x546d('0x1d')]);_0x3d1110[_0x546d('0x1b')]=qs[_0x546d('0x1b')](_0x12fdfb[_0x546d('0x2f')][_0x546d('0x1b')]);}_0x3d1110[_0x546d('0x39')]=qs[_0x546d('0x3a')](_0x12fdfb[_0x546d('0x2f')][_0x546d('0x3a')]);_0x3d1110[_0x546d('0x3b')]=qs[_0x546d('0x31')](_[_0x546d('0x3c')](_0x12fdfb[_0x546d('0x2f')],_0x3a9399[_0x546d('0x31')]),_0x32a30c);if(_0x12fdfb['query'][_0x546d('0x3d')]){_0x3d1110[_0x546d('0x3b')]=_[_0x546d('0x3e')](_0x3d1110['where'],{'$or':_[_0x546d('0x29')](_0x32a30c,function(_0x17504a){if(_0x17504a[_0x546d('0x2d')]!=='VIRTUAL'){var _0x314523={};_0x314523[_0x17504a[_0x546d('0x28')]]={'$like':'%'+_0x12fdfb[_0x546d('0x2f')]['filter']+'%'};return _0x314523;}})});}_0x3d1110=_['merge']({},_0x3d1110,_0x12fdfb[_0x546d('0x3f')]);var _0x58d19f={'where':_0x3d1110[_0x546d('0x3b')]};return db[_0x546d('0x2a')][_0x546d('0x1e')](_0x58d19f)[_0x546d('0x24')](function(_0x24517d){_0x30c22a[_0x546d('0x1e')]=_0x24517d;if(_0x12fdfb['query'][_0x546d('0x40')]){_0x3d1110[_0x546d('0x41')]=[{'all':!![]}];}return db[_0x546d('0x2a')]['findAll'](_0x3d1110);})[_0x546d('0x24')](function(_0x571741){_0x30c22a[_0x546d('0x42')]=_0x571741;return _0x30c22a;})[_0x546d('0x24')](respondWithFilteredResult(_0x2fd65c,_0x3d1110))[_0x546d('0x43')](handleError(_0x2fd65c,null));};exports[_0x546d('0x44')]=function(_0x5e88d0,_0x263d7e){var _0x5498dd={'raw':!![],'where':{'id':_0x5e88d0[_0x546d('0x45')]['id']}},_0x26fb31={};_0x26fb31[_0x546d('0x33')]=_[_0x546d('0x30')](db[_0x546d('0x2a')][_0x546d('0x2b')]);_0x26fb31[_0x546d('0x2f')]=_[_0x546d('0x30')](_0x5e88d0['query']);_0x26fb31[_0x546d('0x31')]=_[_0x546d('0x32')](_0x26fb31[_0x546d('0x33')],_0x26fb31[_0x546d('0x2f')]);_0x5498dd[_0x546d('0x34')]=_[_0x546d('0x32')](_0x26fb31[_0x546d('0x33')],qs[_0x546d('0x35')](_0x5e88d0[_0x546d('0x2f')][_0x546d('0x35')]));_0x5498dd[_0x546d('0x34')]=_0x5498dd['attributes'][_0x546d('0x36')]?_0x5498dd[_0x546d('0x34')]:_0x26fb31[_0x546d('0x33')];if(_0x5e88d0[_0x546d('0x2f')]['includeAll']){_0x5498dd['include']=[{'all':!![]}];}_0x5498dd=_['merge']({},_0x5498dd,_0x5e88d0['options']);return db[_0x546d('0x2a')][_0x546d('0x46')](_0x5498dd)[_0x546d('0x24')](handleEntityNotFound(_0x263d7e,null))[_0x546d('0x24')](respondWithResult(_0x263d7e,null))[_0x546d('0x43')](handleError(_0x263d7e,null));};exports['create']=function(_0x19e3a8,_0x3e0436){return db[_0x546d('0x2a')]['create'](_0x19e3a8['body'],{})[_0x546d('0x24')](respondWithResult(_0x3e0436,0xc9))[_0x546d('0x43')](handleError(_0x3e0436,null));};exports[_0x546d('0x23')]=function(_0x25d9f8,_0xb1f713){if(_0x25d9f8['body']['id']){delete _0x25d9f8[_0x546d('0x47')]['id'];}return db['AnalyticTreeReport']['find']({'where':{'id':_0x25d9f8[_0x546d('0x45')]['id']}})[_0x546d('0x24')](handleEntityNotFound(_0xb1f713,null))[_0x546d('0x24')](saveUpdates(_0x25d9f8[_0x546d('0x47')],null))[_0x546d('0x24')](respondWithResult(_0xb1f713,null))['catch'](handleError(_0xb1f713,null));};exports[_0x546d('0x25')]=function(_0x3f6f5d,_0xe3668e){return db[_0x546d('0x2a')]['find']({'where':{'id':_0x3f6f5d[_0x546d('0x45')]['id']}})[_0x546d('0x24')](handleEntityNotFound(_0xe3668e,null))[_0x546d('0x24')](removeEntity(_0xe3668e,null))[_0x546d('0x43')](handleError(_0xe3668e,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index baf2933..604da52 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 _0x839f=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x839f,0x16b));var _0xf839=function(_0x4cc377,_0x221b18){_0x4cc377=_0x4cc377-0x0;var _0x54e397=_0x839f[_0x4cc377];return _0x54e397;};'use strict';var _=require(_0xf839('0x0'));var util=require(_0xf839('0x1'));var logger=require(_0xf839('0x2'))(_0xf839('0x3'));var moment=require(_0xf839('0x4'));var BPromise=require(_0xf839('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf839('0x6'));var rimraf=require(_0xf839('0x7'));var config=require(_0xf839('0x8'));var attributes=require(_0xf839('0x9'));module[_0xf839('0xa')]=function(_0x45c65a,_0x6ae79b){return _0x45c65a[_0xf839('0xb')](_0xf839('0xc'),attributes,{'tableName':_0xf839('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb921=['../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x43a472,_0x3e4856){var _0x523786=function(_0x264fdd){while(--_0x264fdd){_0x43a472['push'](_0x43a472['shift']());}};_0x523786(++_0x3e4856);}(_0xb921,0x1f3));var _0x1b92=function(_0x25f3e3,_0x207891){_0x25f3e3=_0x25f3e3-0x0;var _0xa89b6d=_0xb921[_0x25f3e3];return _0xa89b6d;};'use strict';var _=require(_0x1b92('0x0'));var util=require(_0x1b92('0x1'));var logger=require(_0x1b92('0x2'))(_0x1b92('0x3'));var moment=require('moment');var BPromise=require(_0x1b92('0x4'));var rp=require(_0x1b92('0x5'));var fs=require('fs');var path=require(_0x1b92('0x6'));var rimraf=require(_0x1b92('0x7'));var config=require(_0x1b92('0x8'));var attributes=require(_0x1b92('0x9'));module[_0x1b92('0xa')]=function(_0xf11cb1,_0x271de0){return _0xf11cb1[_0x1b92('0xb')](_0x1b92('0xc'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js index 553a275..d636240 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 _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x2a2cc2,_0x2ae390){var _0x278fdc=function(_0x186dfc){while(--_0x186dfc){_0x2a2cc2['push'](_0x2a2cc2['shift']());}};_0x278fdc(++_0x2ae390);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xc4aa[_0x5d2803];return _0xdcad2c;};'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')]('AnalyticTreeReport,\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);});});} \ No newline at end of file +var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x15d424,_0x37466b){var _0x35ac6b=function(_0x14d25f){while(--_0x14d25f){_0x15d424['push'](_0x15d424['shift']());}};_0x35ac6b(++_0x37466b);}(_0xdb28,0x106));var _0x8db2=function(_0x253b3b,_0x77bd8a){_0x253b3b=_0x253b3b-0x0;var _0x2f2aad=_0xdb28[_0x253b3b];return _0x2f2aad;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 1bc7e83..46412e1 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 _0xadfb=['post','create','update','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','isAuthenticated','/:id','show'];(function(_0x375aa1,_0x389dbb){var _0x236a19=function(_0x423189){while(--_0x423189){_0x375aa1['push'](_0x375aa1['shift']());}};_0x236a19(++_0x389dbb);}(_0xadfb,0xd6));var _0xbadf=function(_0x277a45,_0x52b0b8){_0x277a45=_0x277a45-0x0;var _0x2fa275=_0xadfb[_0x277a45];return _0x2fa275;};'use strict';var multer=require(_0xbadf('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xbadf('0x1'));var express=require(_0xbadf('0x2'));var router=express[_0xbadf('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbadf('0x4'));var config=require(_0xbadf('0x5'));var controller=require(_0xbadf('0x6'));router['get']('/',auth[_0xbadf('0x7')](),controller['index']);router['get'](_0xbadf('0x8'),auth['isAuthenticated'](),controller[_0xbadf('0x9')]);router[_0xbadf('0xa')]('/',auth[_0xbadf('0x7')](),controller[_0xbadf('0xb')]);router['put'](_0xbadf('0x8'),auth[_0xbadf('0x7')](),controller[_0xbadf('0xc')]);router[_0xbadf('0xd')]('/:id',auth[_0xbadf('0x7')](),controller[_0xbadf('0xe')]);module[_0xbadf('0xf')]=router; \ No newline at end of file +var _0x16f4=['multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','./analyticTreeReport.controller','get','isAuthenticated','/:id','show','post','create','put','delete','destroy'];(function(_0xbf75e7,_0x3b51af){var _0x4fc8e7=function(_0x511fc1){while(--_0x511fc1){_0xbf75e7['push'](_0xbf75e7['shift']());}};_0x4fc8e7(++_0x3b51af);}(_0x16f4,0x140));var _0x416f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x16f4[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x416f('0x0'));var util=require(_0x416f('0x1'));var path=require('path');var timeout=require(_0x416f('0x2'));var express=require('express');var router=express[_0x416f('0x3')]();var fs_extra=require(_0x416f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x416f('0x5'));var config=require('../../config/environment');var controller=require(_0x416f('0x6'));router[_0x416f('0x7')]('/',auth[_0x416f('0x8')](),controller['index']);router[_0x416f('0x7')](_0x416f('0x9'),auth[_0x416f('0x8')](),controller[_0x416f('0xa')]);router[_0x416f('0xb')]('/',auth[_0x416f('0x8')](),controller[_0x416f('0xc')]);router[_0x416f('0xd')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x416f('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x416f('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 33fecc4..1ea9409 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 _0x295f=['exports','STRING'];(function(_0x63e763,_0x14e831){var _0xa3b713=function(_0x1ac154){while(--_0x1ac154){_0x63e763['push'](_0x63e763['shift']());}};_0xa3b713(++_0x14e831);}(_0x295f,0x168));var _0xf295=function(_0xd94979,_0x319118){_0xd94979=_0xd94979-0x0;var _0x42fe35=_0x295f[_0xd94979];return _0x42fe35;};'use strict';var Sequelize=require('sequelize');module[_0xf295('0x0')]={'name':{'type':Sequelize[_0xf295('0x1')]},'basename':{'type':Sequelize[_0xf295('0x1')]},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf6c1=['STRING'];(function(_0x224602,_0x375e7d){var _0xac146c=function(_0x26721f){while(--_0x26721f){_0x224602['push'](_0x224602['shift']());}};_0xac146c(++_0x375e7d);}(_0xf6c1,0x99));var _0x1f6c=function(_0x20a844,_0x121a40){_0x20a844=_0x20a844-0x0;var _0x3bbab8=_0xf6c1[_0x20a844];return _0x3bbab8;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x1f6c('0x0')]},'basename':{'type':Sequelize[_0x1f6c('0x0')]},'type':{'type':Sequelize[_0x1f6c('0x0')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 1d0d35c..f668e50 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 _0x01db=['options','clone','params','find','get','omit','createdAt','updatedAt','body','originalname','basename','file','filename','mimetype','create','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','eml-format','zip-dir','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','map','Attachment','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','rawAttributes'];(function(_0x72cc4f,_0x38df3b){var _0x3c14d5=function(_0x10d93b){while(--_0x10d93b){_0x72cc4f['push'](_0x72cc4f['shift']());}};_0x3c14d5(++_0x38df3b);}(_0x01db,0x179));var _0xb01d=function(_0x139f8e,_0x55330d){_0x139f8e=_0x139f8e-0x0;var _0x5634ae=_0x01db[_0x139f8e];return _0x5634ae;};'use strict';var emlformat=require(_0xb01d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb01d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb01d('0x2'));var BPromise=require(_0xb01d('0x3'));var Mustache=require(_0xb01d('0x4'));var util=require(_0xb01d('0x5'));var path=require('path');var sox=require(_0xb01d('0x6'));var csv=require(_0xb01d('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb01d('0x8'));var _=require(_0xb01d('0x9'));var squel=require(_0xb01d('0xa'));var crypto=require(_0xb01d('0xb'));var jsforce=require(_0xb01d('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xb01d('0x7'));var querystring=require('querystring');var Papa=require(_0xb01d('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb01d('0xe'));var as=require(_0xb01d('0xf'));var hardwareService=require(_0xb01d('0x10'));var logger=require(_0xb01d('0x11'))(_0xb01d('0x12'));var utils=require(_0xb01d('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb01d('0x14'))['db'];function respondWithStatusCode(_0xe75406,_0x439c8b){_0x439c8b=_0x439c8b||0xcc;return function(_0xdb0d3c){if(_0xdb0d3c){return _0xe75406[_0xb01d('0x15')](_0x439c8b);}return _0xe75406[_0xb01d('0x16')](_0x439c8b)[_0xb01d('0x17')]();};}function respondWithResult(_0x46d0db,_0x10046a){_0x10046a=_0x10046a||0xc8;return function(_0xef2ca7){if(_0xef2ca7){return _0x46d0db[_0xb01d('0x16')](_0x10046a)[_0xb01d('0x18')](_0xef2ca7);}};}function respondWithFilteredResult(_0x5e5b5b,_0x48d348){return function(_0x38441f){if(_0x38441f){var _0x39e13c=typeof _0x48d348[_0xb01d('0x19')]===_0xb01d('0x1a')&&typeof _0x48d348[_0xb01d('0x1b')]==='undefined';var _0x2e4b68=_0x38441f['count'];var _0x2aa02f=_0x39e13c?0x0:_0x48d348[_0xb01d('0x19')];var _0x232e70=_0x39e13c?_0x38441f[_0xb01d('0x1c')]:_0x48d348[_0xb01d('0x19')]+_0x48d348[_0xb01d('0x1b')];var _0x36d4e4;if(_0x232e70>=_0x2e4b68){_0x232e70=_0x2e4b68;_0x36d4e4=0xc8;}else{_0x36d4e4=0xce;}_0x5e5b5b['status'](_0x36d4e4);return _0x5e5b5b[_0xb01d('0x1d')](_0xb01d('0x1e'),_0x2aa02f+'-'+_0x232e70+'/'+_0x2e4b68)[_0xb01d('0x18')](_0x38441f);}return null;};}function patchUpdates(_0x394525){return function(_0x301487){try{jsonpatch[_0xb01d('0x1f')](_0x301487,_0x394525,!![]);}catch(_0x26ff2f){return BPromise['reject'](_0x26ff2f);}return _0x301487[_0xb01d('0x20')]();};}function saveUpdates(_0xca6f4c,_0x4975f7){return function(_0x4a4419){if(_0x4a4419){return _0x4a4419[_0xb01d('0x21')](_0xca6f4c)[_0xb01d('0x22')](function(_0x392ebb){return _0x392ebb;});}return null;};}function removeEntity(_0x5ae693,_0x1b7743){return function(_0x57f0cd){if(_0x57f0cd){return _0x57f0cd[_0xb01d('0x23')]()[_0xb01d('0x22')](function(){_0x5ae693[_0xb01d('0x16')](0xcc)[_0xb01d('0x17')]();});}};}function handleEntityNotFound(_0x50aa83,_0x1d66e2){return function(_0x2311c9){if(!_0x2311c9){_0x50aa83[_0xb01d('0x15')](0x194);}return _0x2311c9;};}function handleError(_0x37947e,_0x320d27){_0x320d27=_0x320d27||0x1f4;return function(_0x3ef8be){logger['error'](_0x3ef8be[_0xb01d('0x24')]);if(_0x3ef8be[_0xb01d('0x25')]){delete _0x3ef8be[_0xb01d('0x25')];}_0x37947e[_0xb01d('0x16')](_0x320d27)[_0xb01d('0x26')](_0x3ef8be);};}exports['index']=function(_0x413c5e,_0x39f63b){var _0x11ae55={},_0x29daf2={},_0xca8f29={'count':0x0,'rows':[]};var _0x4cf2b7=_[_0xb01d('0x27')](db[_0xb01d('0x28')]['rawAttributes'],function(_0x5a43ed){return{'name':_0x5a43ed[_0xb01d('0x29')],'type':_0x5a43ed[_0xb01d('0x2a')][_0xb01d('0x2b')]};});_0x29daf2[_0xb01d('0x2c')]=_[_0xb01d('0x27')](_0x4cf2b7,'name');_0x29daf2[_0xb01d('0x2d')]=_[_0xb01d('0x2e')](_0x413c5e[_0xb01d('0x2d')]);_0x29daf2['filters']=_[_0xb01d('0x2f')](_0x29daf2[_0xb01d('0x2c')],_0x29daf2[_0xb01d('0x2d')]);_0x11ae55[_0xb01d('0x30')]=_[_0xb01d('0x2f')](_0x29daf2[_0xb01d('0x2c')],qs[_0xb01d('0x31')](_0x413c5e['query'][_0xb01d('0x31')]));_0x11ae55['attributes']=_0x11ae55[_0xb01d('0x30')][_0xb01d('0x32')]?_0x11ae55[_0xb01d('0x30')]:_0x29daf2[_0xb01d('0x2c')];if(!_0x413c5e['query'][_0xb01d('0x33')](_0xb01d('0x34'))){_0x11ae55['limit']=qs[_0xb01d('0x1b')](_0x413c5e[_0xb01d('0x2d')][_0xb01d('0x1b')]);_0x11ae55[_0xb01d('0x19')]=qs[_0xb01d('0x19')](_0x413c5e['query'][_0xb01d('0x19')]);}_0x11ae55[_0xb01d('0x35')]=qs[_0xb01d('0x36')](_0x413c5e[_0xb01d('0x2d')][_0xb01d('0x36')]);_0x11ae55['where']=qs[_0xb01d('0x37')](_[_0xb01d('0x38')](_0x413c5e['query'],_0x29daf2[_0xb01d('0x37')]),_0x4cf2b7);if(_0x413c5e[_0xb01d('0x2d')][_0xb01d('0x39')]){_0x11ae55[_0xb01d('0x3a')]=_[_0xb01d('0x3b')](_0x11ae55['where'],{'$or':_[_0xb01d('0x27')](_0x4cf2b7,function(_0x56a8a6){if(_0x56a8a6[_0xb01d('0x2a')]!==_0xb01d('0x3c')){var _0x2866b1={};_0x2866b1[_0x56a8a6[_0xb01d('0x25')]]={'$like':'%'+_0x413c5e[_0xb01d('0x2d')]['filter']+'%'};return _0x2866b1;}})});}_0x11ae55=_[_0xb01d('0x3b')]({},_0x11ae55,_0x413c5e['options']);var _0x41fd58={'where':_0x11ae55['where']};return db['Attachment']['count'](_0x41fd58)[_0xb01d('0x22')](function(_0xe7526d){_0xca8f29['count']=_0xe7526d;if(_0x413c5e[_0xb01d('0x2d')][_0xb01d('0x3d')]){_0x11ae55[_0xb01d('0x3e')]=[{'all':!![]}];}return db['Attachment'][_0xb01d('0x3f')](_0x11ae55);})[_0xb01d('0x22')](function(_0x370a70){_0xca8f29[_0xb01d('0x40')]=_0x370a70;return _0xca8f29;})['then'](respondWithFilteredResult(_0x39f63b,_0x11ae55))[_0xb01d('0x41')](handleError(_0x39f63b,null));};exports[_0xb01d('0x42')]=function(_0x21a036,_0x955837){var _0x5921c6={'raw':!![],'where':{'id':_0x21a036['params']['id']}},_0x3e70e4={};_0x3e70e4[_0xb01d('0x2c')]=_[_0xb01d('0x2e')](db[_0xb01d('0x28')][_0xb01d('0x43')]);_0x3e70e4['query']=_[_0xb01d('0x2e')](_0x21a036[_0xb01d('0x2d')]);_0x3e70e4[_0xb01d('0x37')]=_['intersection'](_0x3e70e4[_0xb01d('0x2c')],_0x3e70e4[_0xb01d('0x2d')]);_0x5921c6[_0xb01d('0x30')]=_[_0xb01d('0x2f')](_0x3e70e4[_0xb01d('0x2c')],qs[_0xb01d('0x31')](_0x21a036['query'][_0xb01d('0x31')]));_0x5921c6['attributes']=_0x5921c6[_0xb01d('0x30')][_0xb01d('0x32')]?_0x5921c6[_0xb01d('0x30')]:_0x3e70e4[_0xb01d('0x2c')];if(_0x21a036[_0xb01d('0x2d')][_0xb01d('0x3d')]){_0x5921c6[_0xb01d('0x3e')]=[{'all':!![]}];}_0x5921c6=_[_0xb01d('0x3b')]({},_0x5921c6,_0x21a036[_0xb01d('0x44')]);return db[_0xb01d('0x28')]['find'](_0x5921c6)[_0xb01d('0x22')](handleEntityNotFound(_0x955837,null))[_0xb01d('0x22')](respondWithResult(_0x955837,null))[_0xb01d('0x41')](handleError(_0x955837,null));};exports[_0xb01d('0x45')]=function(_0x17b0b7,_0x26349a){var _0x528568={'where':{'id':_0x17b0b7[_0xb01d('0x46')]['id']}},_0x966cb4={};_0x966cb4[_0xb01d('0x2c')]=_[_0xb01d('0x2e')](db['Attachment'][_0xb01d('0x43')]);_0x528568[_0xb01d('0x30')]=_['intersection'](_0x966cb4[_0xb01d('0x2c')],qs[_0xb01d('0x31')](_0x17b0b7[_0xb01d('0x2d')][_0xb01d('0x31')]));_0x528568['attributes']=_0x528568[_0xb01d('0x30')][_0xb01d('0x32')]?_0x528568[_0xb01d('0x30')]:_0x966cb4[_0xb01d('0x2c')];if(_0x17b0b7['query'][_0xb01d('0x3d')]){_0x528568[_0xb01d('0x3e')]=[{'all':!![]}];}_0x528568=_['merge']({},_0x528568,_0x17b0b7[_0xb01d('0x44')]);return db[_0xb01d('0x28')][_0xb01d('0x47')](_0x528568)['then'](handleEntityNotFound(_0x26349a,null))[_0xb01d('0x22')](function(_0x1950c3){if(_0x1950c3){var _0x51dd0d=_0x1950c3[_0xb01d('0x48')]({'plain':!![]});_0x51dd0d=qs[_0xb01d('0x49')](_0x51dd0d,['id',_0xb01d('0x4a'),_0xb01d('0x4b')]);_0x17b0b7['body']=_[_0xb01d('0x49')](_0x17b0b7[_0xb01d('0x4c')],['id',_0xb01d('0x4a'),'updatedAt']);return db[_0xb01d('0x28')]['create'](_[_0xb01d('0x3b')](_0x51dd0d,_0x17b0b7[_0xb01d('0x4c')]),{'include':_0x17b0b7['query']['includeAll']?[{'all':!![]}]:undefined});}})[_0xb01d('0x22')](respondWithResult(_0x26349a,0xc9))['catch'](handleError(_0x26349a,null));};exports[_0xb01d('0x21')]=function(_0x3c7513,_0x486f36){if(_0x3c7513[_0xb01d('0x4c')]['id']){delete _0x3c7513[_0xb01d('0x4c')]['id'];}return db[_0xb01d('0x28')][_0xb01d('0x47')]({'where':{'id':_0x3c7513[_0xb01d('0x46')]['id']}})['then'](handleEntityNotFound(_0x486f36,null))[_0xb01d('0x22')](saveUpdates(_0x3c7513[_0xb01d('0x4c')],null))[_0xb01d('0x22')](respondWithResult(_0x486f36,null))[_0xb01d('0x41')](handleError(_0x486f36,null));};exports[_0xb01d('0x23')]=function(_0x45d024,_0x49efbe){return db[_0xb01d('0x28')][_0xb01d('0x47')]({'where':{'id':_0x45d024[_0xb01d('0x46')]['id']}})[_0xb01d('0x22')](handleEntityNotFound(_0x49efbe,null))[_0xb01d('0x22')](removeEntity(_0x49efbe,null))['catch'](handleError(_0x49efbe,null));};exports['create']=function(_0x5b396d,_0x2fe4f5,_0x5721f1){_0x5b396d[_0xb01d('0x4c')][_0xb01d('0x25')]=_0x5b396d['file'][_0xb01d('0x4d')];_0x5b396d[_0xb01d('0x4c')][_0xb01d('0x4e')]=_0x5b396d[_0xb01d('0x4f')][_0xb01d('0x50')];_0x5b396d[_0xb01d('0x4c')]['type']=_0x5b396d[_0xb01d('0x4f')][_0xb01d('0x51')];return db[_0xb01d('0x28')][_0xb01d('0x52')](_0x5b396d[_0xb01d('0x4c')])['then'](respondWithResult(_0x2fe4f5,0xc9))[_0xb01d('0x41')](handleError(_0x2fe4f5,null));};exports['download']=function(_0x19fa90,_0x5ae10e,_0x380759){return db['Attachment']['findOne']({'where':{'id':_0x19fa90['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x5ae10e,null))[_0xb01d('0x22')](function(_0x24b62b){if(_0x24b62b){var _0x3cc2de=_0x24b62b[_0xb01d('0x53')]!==null;var _0xa0d867=path[_0xb01d('0x54')](config[_0xb01d('0x55')],_0xb01d('0x56'));if(_0x3cc2de){_0xa0d867=path[_0xb01d('0x54')](_0xa0d867,_0xb01d('0x57'));}var _0x5e4d74=path['join'](_0xa0d867,_0x24b62b[_0xb01d('0x4e')]);return _0x5ae10e[_0xb01d('0x58')](_0x5e4d74);}})[_0xb01d('0x41')](handleError(_0x5ae10e,null));}; \ No newline at end of file +var _0x5798=['get','omit','createdAt','updatedAt','body','create','destroy','originalname','basename','file','filename','mimetype','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','download','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','end','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','then','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','Attachment','includeAll','include','findAll','catch','params','options','clone','find'];(function(_0x55336a,_0x240d59){var _0x28ceb3=function(_0x399d5c){while(--_0x399d5c){_0x55336a['push'](_0x55336a['shift']());}};_0x28ceb3(++_0x240d59);}(_0x5798,0x176));var _0x8579=function(_0x4f34d8,_0x40f022){_0x4f34d8=_0x4f34d8-0x0;var _0xc97536=_0x5798[_0x4f34d8];return _0xc97536;};'use strict';var emlformat=require(_0x8579('0x0'));var rimraf=require(_0x8579('0x1'));var zipdir=require(_0x8579('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8579('0x3'));var moment=require('moment');var BPromise=require(_0x8579('0x4'));var Mustache=require(_0x8579('0x5'));var util=require(_0x8579('0x6'));var path=require(_0x8579('0x7'));var sox=require('sox');var csv=require(_0x8579('0x8'));var ejs=require(_0x8579('0x9'));var fs=require('fs');var fs_extra=require(_0x8579('0xa'));var _=require(_0x8579('0xb'));var squel=require(_0x8579('0xc'));var crypto=require('crypto');var jsforce=require(_0x8579('0xd'));var deskjs=require(_0x8579('0xe'));var toCsv=require(_0x8579('0x8'));var querystring=require(_0x8579('0xf'));var Papa=require(_0x8579('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8579('0x11'));var as=require(_0x8579('0x12'));var hardwareService=require(_0x8579('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x8579('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x8579('0x15'));var db=require(_0x8579('0x16'))['db'];function respondWithStatusCode(_0x1acbb1,_0x4a5fb3){_0x4a5fb3=_0x4a5fb3||0xcc;return function(_0x2b95be){if(_0x2b95be){return _0x1acbb1['sendStatus'](_0x4a5fb3);}return _0x1acbb1['status'](_0x4a5fb3)[_0x8579('0x17')]();};}function respondWithResult(_0x2d7b9d,_0x3af44a){_0x3af44a=_0x3af44a||0xc8;return function(_0x41c431){if(_0x41c431){return _0x2d7b9d[_0x8579('0x18')](_0x3af44a)['json'](_0x41c431);}};}function respondWithFilteredResult(_0x52b5cf,_0x2825d2){return function(_0x58e495){if(_0x58e495){var _0x4c251f=typeof _0x2825d2[_0x8579('0x19')]===_0x8579('0x1a')&&typeof _0x2825d2[_0x8579('0x1b')]===_0x8579('0x1a');var _0x224712=_0x58e495[_0x8579('0x1c')];var _0x4437bb=_0x4c251f?0x0:_0x2825d2[_0x8579('0x19')];var _0x1b5e2a=_0x4c251f?_0x58e495[_0x8579('0x1c')]:_0x2825d2[_0x8579('0x19')]+_0x2825d2[_0x8579('0x1b')];var _0xb7050a;if(_0x1b5e2a>=_0x224712){_0x1b5e2a=_0x224712;_0xb7050a=0xc8;}else{_0xb7050a=0xce;}_0x52b5cf[_0x8579('0x18')](_0xb7050a);return _0x52b5cf['set'](_0x8579('0x1d'),_0x4437bb+'-'+_0x1b5e2a+'/'+_0x224712)[_0x8579('0x1e')](_0x58e495);}return null;};}function patchUpdates(_0x397075){return function(_0x5accf1){try{jsonpatch[_0x8579('0x1f')](_0x5accf1,_0x397075,!![]);}catch(_0x37354a){return BPromise[_0x8579('0x20')](_0x37354a);}return _0x5accf1[_0x8579('0x21')]();};}function saveUpdates(_0x331ed0,_0x315ea0){return function(_0x55ab39){if(_0x55ab39){return _0x55ab39['update'](_0x331ed0)[_0x8579('0x22')](function(_0x17104c){return _0x17104c;});}return null;};}function removeEntity(_0xdd257,_0x1d15b4){return function(_0x16a67f){if(_0x16a67f){return _0x16a67f['destroy']()[_0x8579('0x22')](function(){_0xdd257[_0x8579('0x18')](0xcc)[_0x8579('0x17')]();});}};}function handleEntityNotFound(_0x3a97ba,_0x34de5e){return function(_0xa1eb69){if(!_0xa1eb69){_0x3a97ba[_0x8579('0x23')](0x194);}return _0xa1eb69;};}function handleError(_0x412788,_0x438a24){_0x438a24=_0x438a24||0x1f4;return function(_0x555c7c){logger[_0x8579('0x24')](_0x555c7c[_0x8579('0x25')]);if(_0x555c7c[_0x8579('0x26')]){delete _0x555c7c['name'];}_0x412788[_0x8579('0x18')](_0x438a24)[_0x8579('0x27')](_0x555c7c);};}exports[_0x8579('0x28')]=function(_0x574b06,_0x1eea0e){var _0x572f60={},_0x95d02={},_0x894523={'count':0x0,'rows':[]};var _0x4493d1=_[_0x8579('0x29')](db['Attachment'][_0x8579('0x2a')],function(_0x30f159){return{'name':_0x30f159[_0x8579('0x2b')],'type':_0x30f159[_0x8579('0x2c')][_0x8579('0x2d')]};});_0x95d02[_0x8579('0x2e')]=_['map'](_0x4493d1,_0x8579('0x26'));_0x95d02['query']=_[_0x8579('0x2f')](_0x574b06[_0x8579('0x30')]);_0x95d02[_0x8579('0x31')]=_['intersection'](_0x95d02[_0x8579('0x2e')],_0x95d02['query']);_0x572f60[_0x8579('0x32')]=_[_0x8579('0x33')](_0x95d02[_0x8579('0x2e')],qs['fields'](_0x574b06[_0x8579('0x30')][_0x8579('0x34')]));_0x572f60['attributes']=_0x572f60[_0x8579('0x32')][_0x8579('0x35')]?_0x572f60[_0x8579('0x32')]:_0x95d02['model'];if(!_0x574b06[_0x8579('0x30')][_0x8579('0x36')](_0x8579('0x37'))){_0x572f60['limit']=qs[_0x8579('0x1b')](_0x574b06['query'][_0x8579('0x1b')]);_0x572f60[_0x8579('0x19')]=qs[_0x8579('0x19')](_0x574b06['query'][_0x8579('0x19')]);}_0x572f60['order']=qs['sort'](_0x574b06[_0x8579('0x30')][_0x8579('0x38')]);_0x572f60[_0x8579('0x39')]=qs['filters'](_[_0x8579('0x3a')](_0x574b06['query'],_0x95d02['filters']),_0x4493d1);if(_0x574b06[_0x8579('0x30')][_0x8579('0x3b')]){_0x572f60[_0x8579('0x39')]=_['merge'](_0x572f60[_0x8579('0x39')],{'$or':_[_0x8579('0x29')](_0x4493d1,function(_0x451bcc){if(_0x451bcc[_0x8579('0x2c')]!==_0x8579('0x3c')){var _0x3ba386={};_0x3ba386[_0x451bcc['name']]={'$like':'%'+_0x574b06[_0x8579('0x30')][_0x8579('0x3b')]+'%'};return _0x3ba386;}})});}_0x572f60=_[_0x8579('0x3d')]({},_0x572f60,_0x574b06['options']);var _0x4c0b09={'where':_0x572f60[_0x8579('0x39')]};return db[_0x8579('0x3e')][_0x8579('0x1c')](_0x4c0b09)[_0x8579('0x22')](function(_0x30c83b){_0x894523[_0x8579('0x1c')]=_0x30c83b;if(_0x574b06[_0x8579('0x30')][_0x8579('0x3f')]){_0x572f60[_0x8579('0x40')]=[{'all':!![]}];}return db[_0x8579('0x3e')][_0x8579('0x41')](_0x572f60);})[_0x8579('0x22')](function(_0x413027){_0x894523['rows']=_0x413027;return _0x894523;})[_0x8579('0x22')](respondWithFilteredResult(_0x1eea0e,_0x572f60))[_0x8579('0x42')](handleError(_0x1eea0e,null));};exports['show']=function(_0x3efcae,_0x3b2418){var _0x37e88a={'raw':!![],'where':{'id':_0x3efcae[_0x8579('0x43')]['id']}},_0x1896dc={};_0x1896dc['model']=_[_0x8579('0x2f')](db[_0x8579('0x3e')][_0x8579('0x2a')]);_0x1896dc['query']=_[_0x8579('0x2f')](_0x3efcae[_0x8579('0x30')]);_0x1896dc[_0x8579('0x31')]=_['intersection'](_0x1896dc[_0x8579('0x2e')],_0x1896dc[_0x8579('0x30')]);_0x37e88a['attributes']=_[_0x8579('0x33')](_0x1896dc[_0x8579('0x2e')],qs[_0x8579('0x34')](_0x3efcae[_0x8579('0x30')][_0x8579('0x34')]));_0x37e88a[_0x8579('0x32')]=_0x37e88a[_0x8579('0x32')][_0x8579('0x35')]?_0x37e88a[_0x8579('0x32')]:_0x1896dc[_0x8579('0x2e')];if(_0x3efcae[_0x8579('0x30')]['includeAll']){_0x37e88a[_0x8579('0x40')]=[{'all':!![]}];}_0x37e88a=_[_0x8579('0x3d')]({},_0x37e88a,_0x3efcae[_0x8579('0x44')]);return db['Attachment']['find'](_0x37e88a)[_0x8579('0x22')](handleEntityNotFound(_0x3b2418,null))[_0x8579('0x22')](respondWithResult(_0x3b2418,null))[_0x8579('0x42')](handleError(_0x3b2418,null));};exports[_0x8579('0x45')]=function(_0x88bb37,_0x255456){var _0x8dfb2c={'where':{'id':_0x88bb37[_0x8579('0x43')]['id']}},_0x261810={};_0x261810[_0x8579('0x2e')]=_[_0x8579('0x2f')](db[_0x8579('0x3e')][_0x8579('0x2a')]);_0x8dfb2c[_0x8579('0x32')]=_['intersection'](_0x261810[_0x8579('0x2e')],qs['fields'](_0x88bb37[_0x8579('0x30')][_0x8579('0x34')]));_0x8dfb2c[_0x8579('0x32')]=_0x8dfb2c[_0x8579('0x32')][_0x8579('0x35')]?_0x8dfb2c[_0x8579('0x32')]:_0x261810[_0x8579('0x2e')];if(_0x88bb37[_0x8579('0x30')][_0x8579('0x3f')]){_0x8dfb2c['include']=[{'all':!![]}];}_0x8dfb2c=_['merge']({},_0x8dfb2c,_0x88bb37['options']);return db[_0x8579('0x3e')][_0x8579('0x46')](_0x8dfb2c)[_0x8579('0x22')](handleEntityNotFound(_0x255456,null))[_0x8579('0x22')](function(_0x5855a7){if(_0x5855a7){var _0xbe8dbb=_0x5855a7[_0x8579('0x47')]({'plain':!![]});_0xbe8dbb=qs[_0x8579('0x48')](_0xbe8dbb,['id',_0x8579('0x49'),_0x8579('0x4a')]);_0x88bb37[_0x8579('0x4b')]=_[_0x8579('0x48')](_0x88bb37[_0x8579('0x4b')],['id',_0x8579('0x49'),_0x8579('0x4a')]);return db[_0x8579('0x3e')][_0x8579('0x4c')](_[_0x8579('0x3d')](_0xbe8dbb,_0x88bb37[_0x8579('0x4b')]),{'include':_0x88bb37['query'][_0x8579('0x3f')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x255456,0xc9))[_0x8579('0x42')](handleError(_0x255456,null));};exports['update']=function(_0x5aa9b8,_0x1d3186){if(_0x5aa9b8[_0x8579('0x4b')]['id']){delete _0x5aa9b8[_0x8579('0x4b')]['id'];}return db[_0x8579('0x3e')][_0x8579('0x46')]({'where':{'id':_0x5aa9b8[_0x8579('0x43')]['id']}})[_0x8579('0x22')](handleEntityNotFound(_0x1d3186,null))[_0x8579('0x22')](saveUpdates(_0x5aa9b8[_0x8579('0x4b')],null))[_0x8579('0x22')](respondWithResult(_0x1d3186,null))[_0x8579('0x42')](handleError(_0x1d3186,null));};exports[_0x8579('0x4d')]=function(_0x120604,_0x5962d3){return db[_0x8579('0x3e')][_0x8579('0x46')]({'where':{'id':_0x120604[_0x8579('0x43')]['id']}})[_0x8579('0x22')](handleEntityNotFound(_0x5962d3,null))[_0x8579('0x22')](removeEntity(_0x5962d3,null))['catch'](handleError(_0x5962d3,null));};exports[_0x8579('0x4c')]=function(_0x3c2bfa,_0x1853a2,_0x70736f){_0x3c2bfa[_0x8579('0x4b')]['name']=_0x3c2bfa['file'][_0x8579('0x4e')];_0x3c2bfa[_0x8579('0x4b')][_0x8579('0x4f')]=_0x3c2bfa[_0x8579('0x50')][_0x8579('0x51')];_0x3c2bfa[_0x8579('0x4b')]['type']=_0x3c2bfa['file'][_0x8579('0x52')];return db['Attachment'][_0x8579('0x4c')](_0x3c2bfa[_0x8579('0x4b')])['then'](respondWithResult(_0x1853a2,0xc9))[_0x8579('0x42')](handleError(_0x1853a2,null));};exports['download']=function(_0xe0b07b,_0x393d3e,_0x50a0d6){return db[_0x8579('0x3e')]['findOne']({'where':{'id':_0xe0b07b[_0x8579('0x43')]['id']},'raw':!![]})[_0x8579('0x22')](handleEntityNotFound(_0x393d3e,null))[_0x8579('0x22')](function(_0x3448e8){if(_0x3448e8){var _0x2cd4f3=_0x3448e8[_0x8579('0x53')]!==null;var _0x2f7be5=path['join'](config[_0x8579('0x54')],_0x8579('0x55'));if(_0x2cd4f3){_0x2f7be5=path[_0x8579('0x56')](_0x2f7be5,_0x8579('0x57'));}var _0x20603c=path[_0x8579('0x56')](_0x2f7be5,_0x3448e8['basename']);return _0x393d3e[_0x8579('0x58')](_0x20603c);}})[_0x8579('0x42')](handleError(_0x393d3e,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index aa48b9c..6bb9005 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 _0x179b=['./attachment.attributes','define','Attachment','lodash','../../config/logger','api','request-promise','path','../../config/environment'];(function(_0x26eb3d,_0x2cfde2){var _0x4bd0c1=function(_0xb650cb){while(--_0xb650cb){_0x26eb3d['push'](_0x26eb3d['shift']());}};_0x4bd0c1(++_0x2cfde2);}(_0x179b,0x150));var _0xb179=function(_0x484c03,_0x13c1d2){_0x484c03=_0x484c03-0x0;var _0x294127=_0x179b[_0x484c03];return _0x294127;};'use strict';var _=require(_0xb179('0x0'));var util=require('util');var logger=require(_0xb179('0x1'))(_0xb179('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb179('0x3'));var fs=require('fs');var path=require(_0xb179('0x4'));var rimraf=require('rimraf');var config=require(_0xb179('0x5'));var attributes=require(_0xb179('0x6'));module['exports']=function(_0x4972f7,_0x4073fd){return _0x4972f7[_0xb179('0x7')](_0xb179('0x8'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0f2d=['util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment','attachments'];(function(_0x3ba681,_0x5a7ba7){var _0x37132a=function(_0x35a663){while(--_0x35a663){_0x3ba681['push'](_0x3ba681['shift']());}};_0x37132a(++_0x5a7ba7);}(_0x0f2d,0x9c));var _0xd0f2=function(_0x4130ff,_0x9a2312){_0x4130ff=_0x4130ff-0x0;var _0x29cdad=_0x0f2d[_0x4130ff];return _0x29cdad;};'use strict';var _=require('lodash');var util=require(_0xd0f2('0x0'));var logger=require(_0xd0f2('0x1'))('api');var moment=require('moment');var BPromise=require(_0xd0f2('0x2'));var rp=require(_0xd0f2('0x3'));var fs=require('fs');var path=require(_0xd0f2('0x4'));var rimraf=require(_0xd0f2('0x5'));var config=require(_0xd0f2('0x6'));var attributes=require(_0xd0f2('0x7'));module[_0xd0f2('0x8')]=function(_0xa3f560,_0x459925){return _0xa3f560[_0xd0f2('0x9')](_0xd0f2('0xa'),attributes,{'tableName':_0xd0f2('0xb'),'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 128a7c7..80a1235 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 _0x4a81=['info','result','catch','Attachment','create','options','CreateAttachment','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','client','request','then','Attachment,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x1c6601,_0x44e8e4){var _0x1d4bf0=function(_0x4fd511){while(--_0x4fd511){_0x1c6601['push'](_0x1c6601['shift']());}};_0x1d4bf0(++_0x44e8e4);}(_0x4a81,0x1b7));var _0x14a8=function(_0x3ce25c,_0x39ff13){_0x3ce25c=_0x3ce25c-0x0;var _0x3cb3af=_0x4a81[_0x3ce25c];return _0x3cb3af;};'use strict';var _=require(_0x14a8('0x0'));var util=require(_0x14a8('0x1'));var moment=require(_0x14a8('0x2'));var BPromise=require(_0x14a8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x14a8('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x14a8('0x5'))(_0x14a8('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x14a8('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x134295,_0x4f2829,_0x26e442){return new BPromise(function(_0x4271b5,_0x3ea48f){return client[_0x14a8('0x8')](_0x134295,_0x26e442)[_0x14a8('0x9')](function(_0x5d42cb){logger['info'](_0x14a8('0xa'),_0x4f2829,_0x14a8('0xb'));logger[_0x14a8('0xc')]('Attachment,\x20%s,\x20%s,\x20%s',_0x4f2829,_0x14a8('0xb'),JSON[_0x14a8('0xd')](_0x5d42cb));if(_0x5d42cb[_0x14a8('0xe')]){if(_0x5d42cb[_0x14a8('0xe')][_0x14a8('0xf')]===0x1f4){logger[_0x14a8('0xe')](_0x14a8('0xa'),_0x4f2829,_0x5d42cb[_0x14a8('0xe')]['message']);return _0x3ea48f(_0x5d42cb['error'][_0x14a8('0x10')]);}logger[_0x14a8('0xe')]('Attachment,\x20%s,\x20%s',_0x4f2829,_0x5d42cb[_0x14a8('0xe')]['message']);return _0x4271b5(_0x5d42cb[_0x14a8('0xe')][_0x14a8('0x10')]);}else{logger[_0x14a8('0x11')](_0x14a8('0xa'),_0x4f2829,_0x14a8('0xb'));_0x4271b5(_0x5d42cb[_0x14a8('0x12')]['message']);}})[_0x14a8('0x13')](function(_0x30de2c){logger['error'](_0x14a8('0xa'),_0x4f2829,_0x30de2c);_0x3ea48f(_0x30de2c);});});}exports['CreateAttachment']=function(_0x98e1d5){var _0x1dac45=this;return new Promise(function(_0x456b7f,_0x1069c8){return db[_0x14a8('0x14')][_0x14a8('0x15')](_0x98e1d5['body'],{'raw':_0x98e1d5[_0x14a8('0x16')]?_0x98e1d5[_0x14a8('0x16')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1956a2){logger['info'](_0x14a8('0x17'),_0x98e1d5);logger['debug'](_0x14a8('0x17'),_0x98e1d5,JSON['stringify'](_0x1956a2));_0x456b7f(_0x1956a2);})[_0x14a8('0x13')](function(_0x3afd58){logger[_0x14a8('0xe')](_0x14a8('0x17'),_0x3afd58['message'],_0x98e1d5);_0x1069c8(_0x1dac45[_0x14a8('0xe')](0x1f4,_0x3afd58['message']));});});}; \ No newline at end of file +var _0xe5b3=['request','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateAttachment','create','body','options','raw','then','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0xd323fe,_0x7956be){var _0x25deae=function(_0x16aef4){while(--_0x16aef4){_0xd323fe['push'](_0xd323fe['shift']());}};_0x25deae(++_0x7956be);}(_0xe5b3,0x133));var _0x3e5b=function(_0x499c96,_0x1314c6){_0x499c96=_0x499c96-0x0;var _0x89e88e=_0xe5b3[_0x499c96];return _0x89e88e;};'use strict';var _=require('lodash');var util=require(_0x3e5b('0x0'));var moment=require(_0x3e5b('0x1'));var BPromise=require(_0x3e5b('0x2'));var rs=require(_0x3e5b('0x3'));var fs=require('fs');var Redis=require(_0x3e5b('0x4'));var db=require(_0x3e5b('0x5'))['db'];var utils=require(_0x3e5b('0x6'));var logger=require(_0x3e5b('0x7'))(_0x3e5b('0x8'));var config=require(_0x3e5b('0x9'));var jayson=require(_0x3e5b('0xa'));var client=jayson['client'][_0x3e5b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5dcf55,_0x534e7d,_0x41d46f){return new BPromise(function(_0x3901c2,_0x3c7c2e){return client[_0x3e5b('0xc')](_0x5dcf55,_0x41d46f)['then'](function(_0x4ed6bc){logger[_0x3e5b('0xd')](_0x3e5b('0xe'),_0x534e7d,_0x3e5b('0xf'));logger[_0x3e5b('0x10')](_0x3e5b('0x11'),_0x534e7d,'request\x20sent',JSON[_0x3e5b('0x12')](_0x4ed6bc));if(_0x4ed6bc['error']){if(_0x4ed6bc[_0x3e5b('0x13')][_0x3e5b('0x14')]===0x1f4){logger[_0x3e5b('0x13')](_0x3e5b('0xe'),_0x534e7d,_0x4ed6bc[_0x3e5b('0x13')][_0x3e5b('0x15')]);return _0x3c7c2e(_0x4ed6bc[_0x3e5b('0x13')]['message']);}logger[_0x3e5b('0x13')]('Attachment,\x20%s,\x20%s',_0x534e7d,_0x4ed6bc['error']['message']);return _0x3901c2(_0x4ed6bc[_0x3e5b('0x13')][_0x3e5b('0x15')]);}else{logger[_0x3e5b('0xd')]('Attachment,\x20%s,\x20%s',_0x534e7d,_0x3e5b('0xf'));_0x3901c2(_0x4ed6bc['result']['message']);}})[_0x3e5b('0x16')](function(_0x11b41b){logger['error'](_0x3e5b('0xe'),_0x534e7d,_0x11b41b);_0x3c7c2e(_0x11b41b);});});}exports[_0x3e5b('0x17')]=function(_0x555002){var _0xc56a2a=this;return new Promise(function(_0x3365dd,_0x52696c){return db['Attachment'][_0x3e5b('0x18')](_0x555002[_0x3e5b('0x19')],{'raw':_0x555002[_0x3e5b('0x1a')]?_0x555002[_0x3e5b('0x1a')][_0x3e5b('0x1b')]===undefined?!![]:![]:!![]})[_0x3e5b('0x1c')](function(_0x447d36){logger[_0x3e5b('0xd')](_0x3e5b('0x17'),_0x555002);logger[_0x3e5b('0x10')](_0x3e5b('0x17'),_0x555002,JSON[_0x3e5b('0x12')](_0x447d36));_0x3365dd(_0x447d36);})[_0x3e5b('0x16')](function(_0x402873){logger['error'](_0x3e5b('0x17'),_0x402873[_0x3e5b('0x15')],_0x555002);_0x52696c(_0xc56a2a[_0x3e5b('0x13')](0x1f4,_0x402873[_0x3e5b('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index c0922a3..37ae491 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(_0x20e06c,_0x832c78){var _0x44a8d9=function(_0x428048){while(--_0x428048){_0x20e06c['push'](_0x20e06c['shift']());}};_0x44a8d9(++_0x832c78);}(_0xadb5,0xad));var _0x5adb=function(_0x4334dc,_0x1cd9da){_0x4334dc=_0x4334dc-0x0;var _0x186bf8=_0xadb5[_0x4334dc];return _0x186bf8;};'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(_0x699b3d,_0x4547e5){_0x699b3d=_0x699b3d-0x0;var _0x163742=_0xdb28[_0x699b3d];return _0x163742;};'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/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index db5a62d..948f04f 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 _0xefa0=['callbackURL','Setting','findOne','blockDuration','then','User','find','emails','admin','user','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport-google-oauth20','Strategy','moment','../../mysqldb','../../config/environment','../../config/utils','login','/login','email','callback','authenticate','use','google','clientID','clientSecret'];(function(_0xa168ed,_0x3e11b3){var _0x32facf=function(_0x3bf853){while(--_0x3bf853){_0xa168ed['push'](_0xa168ed['shift']());}};_0x32facf(++_0x3e11b3);}(_0xefa0,0x1e8));var _0x0efa=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xefa0[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x0efa('0x0'));var passport=require('passport');var GoogleStrategy=require(_0x0efa('0x1'))[_0x0efa('0x2')];var moment=require(_0x0efa('0x3'));var db=require(_0x0efa('0x4'))['db'];var config=require(_0x0efa('0x5'));var signToken=require('../../components/auth/service')['signToken'];var utils=require(_0x0efa('0x6'));exports[_0x0efa('0x7')]=passport['authenticate']('google',{'failureRedirect':_0x0efa('0x8'),'scope':['profile',_0x0efa('0x9')],'session':![]});exports[_0x0efa('0xa')]=passport[_0x0efa('0xb')]('google',{'failureRedirect':_0x0efa('0x8'),'session':![]});passport[_0x0efa('0xc')](new GoogleStrategy({'clientID':config[_0x0efa('0xd')]?config[_0x0efa('0xd')][_0x0efa('0xe')]:'id','clientSecret':config['google']?config[_0x0efa('0xd')][_0x0efa('0xf')]:'secret','callbackURL':config[_0x0efa('0xd')]?config[_0x0efa('0xd')][_0x0efa('0x10')]:''},function(_0x4fbaff,_0x540ae5,_0xe275c5,_0x34d762){var _0x42e1cd,_0x2a4a27;return db[_0x0efa('0x11')][_0x0efa('0x12')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x0efa('0x13')],'raw':!![]})[_0x0efa('0x14')](function(_0x48138b){_0x42e1cd=_0x48138b;return db[_0x0efa('0x15')][_0x0efa('0x16')]({'where':{'email':_['map'](_0xe275c5[_0x0efa('0x17')],'value'),'role':{'$or':[_0x0efa('0x18'),_0x0efa('0x19'),_0x0efa('0x1a')]}}});})[_0x0efa('0x14')](function(_0x5911e2){_0x2a4a27=_0x5911e2;if(_0x2a4a27){if(_0x2a4a27[_0x0efa('0x1b')]){return _0x34d762(_0x0efa('0x1c'));}else if(_0x42e1cd[_0x0efa('0x13')]>0x0){if(_0x2a4a27[_0x0efa('0x1d')]){if(moment(_0x2a4a27[_0x0efa('0x1e')])[_0x0efa('0x1f')](_0x42e1cd[_0x0efa('0x13')],_0x0efa('0x20'))>moment()){return _0x34d762(_0x0efa('0x1c'));}else{return utils[_0x0efa('0x21')](_0x2a4a27,0x0,![],null)[_0x0efa('0x14')](function(){return utils[_0x0efa('0x22')](_0x2a4a27);})[_0x0efa('0x14')](function(){return _0x34d762(null,_0x2a4a27);});}}else{return utils[_0x0efa('0x22')](_0x2a4a27)[_0x0efa('0x14')](function(){return _0x34d762(null,_0x2a4a27);});}}else{return utils[_0x0efa('0x22')](_0x2a4a27)[_0x0efa('0x14')](function(){return _0x34d762(null,_0x2a4a27);});}}return _0x34d762(_0x0efa('0x1c'));})[_0x0efa('0x23')](function(_0x3b7536){_0x34d762(_0x3b7536);});})); \ No newline at end of file +var _0xf6b1=['../../config/utils','login','authenticate','google','/login','email','callback','use','clientSecret','callbackURL','Setting','allowedLoginAttempts','blockDuration','then','User','map','emails','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','add','minutes','clearBlockUser','getLicense','lodash','passport','passport-google-oauth20','Strategy','moment','../../config/environment','../../components/auth/service','signToken'];(function(_0x5c40c9,_0x4c4a67){var _0x1906c4=function(_0x4d4e78){while(--_0x4d4e78){_0x5c40c9['push'](_0x5c40c9['shift']());}};_0x1906c4(++_0x4c4a67);}(_0xf6b1,0x142));var _0x1f6b=function(_0x14514a,_0x1c56a2){_0x14514a=_0x14514a-0x0;var _0xaa71b8=_0xf6b1[_0x14514a];return _0xaa71b8;};'use strict';var _=require(_0x1f6b('0x0'));var passport=require(_0x1f6b('0x1'));var GoogleStrategy=require(_0x1f6b('0x2'))[_0x1f6b('0x3')];var moment=require(_0x1f6b('0x4'));var db=require('../../mysqldb')['db'];var config=require(_0x1f6b('0x5'));var signToken=require(_0x1f6b('0x6'))[_0x1f6b('0x7')];var utils=require(_0x1f6b('0x8'));exports[_0x1f6b('0x9')]=passport[_0x1f6b('0xa')](_0x1f6b('0xb'),{'failureRedirect':_0x1f6b('0xc'),'scope':['profile',_0x1f6b('0xd')],'session':![]});exports[_0x1f6b('0xe')]=passport[_0x1f6b('0xa')](_0x1f6b('0xb'),{'failureRedirect':'/login','session':![]});passport[_0x1f6b('0xf')](new GoogleStrategy({'clientID':config[_0x1f6b('0xb')]?config[_0x1f6b('0xb')]['clientID']:'id','clientSecret':config[_0x1f6b('0xb')]?config[_0x1f6b('0xb')][_0x1f6b('0x10')]:'secret','callbackURL':config[_0x1f6b('0xb')]?config[_0x1f6b('0xb')][_0x1f6b('0x11')]:''},function(_0x28b7a5,_0x51c3de,_0x43d7f0,_0x4b0c91){var _0x14dc7e,_0x184fa2;return db[_0x1f6b('0x12')]['findOne']({'where':{'id':0x1},'attributes':[_0x1f6b('0x13'),_0x1f6b('0x14')],'raw':!![]})[_0x1f6b('0x15')](function(_0x407dac){_0x14dc7e=_0x407dac;return db[_0x1f6b('0x16')]['find']({'where':{'email':_[_0x1f6b('0x17')](_0x43d7f0[_0x1f6b('0x18')],'value'),'role':{'$or':[_0x1f6b('0x19'),_0x1f6b('0x1a'),_0x1f6b('0x1b')]}}});})[_0x1f6b('0x15')](function(_0x43e4ea){_0x184fa2=_0x43e4ea;if(_0x184fa2){if(_0x184fa2['disabled']){return _0x4b0c91(_0x1f6b('0x1c'));}else if(_0x14dc7e['blockDuration']>0x0){if(_0x184fa2['blocked']){if(moment(_0x184fa2['blockedAt'])[_0x1f6b('0x1d')](_0x14dc7e[_0x1f6b('0x14')],_0x1f6b('0x1e'))>moment()){return _0x4b0c91(_0x1f6b('0x1c'));}else{return utils[_0x1f6b('0x1f')](_0x184fa2,0x0,![],null)[_0x1f6b('0x15')](function(){return utils['getLicense'](_0x184fa2);})['then'](function(){return _0x4b0c91(null,_0x184fa2);});}}else{return utils[_0x1f6b('0x20')](_0x184fa2)['then'](function(){return _0x4b0c91(null,_0x184fa2);});}}else{return utils['getLicense'](_0x184fa2)[_0x1f6b('0x15')](function(){return _0x4b0c91(null,_0x184fa2);});}}return _0x4b0c91(_0x1f6b('0x1c'));})['catch'](function(_0x5b683a){_0x4b0c91(_0x5b683a);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 6204ad9..aa1c124 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 _0x221b=['setTokenCookie','express','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','/callback','callback','isMiddleware','login'];(function(_0x58afd5,_0x534a48){var _0x3e503b=function(_0x27ba44){while(--_0x27ba44){_0x58afd5['push'](_0x58afd5['shift']());}};_0x3e503b(++_0x534a48);}(_0x221b,0xbf));var _0xb221=function(_0x50d160,_0x447b4f){_0x50d160=_0x50d160-0x0;var _0x28172e=_0x221b[_0x50d160];return _0x28172e;};'use strict';var express=require(_0xb221('0x0'));var passport=require('passport');var router=express['Router']();var controller=require(_0xb221('0x1'));var userController=require(_0xb221('0x2'));var authService=require(_0xb221('0x3'));router[_0xb221('0x4')]('/',controller['login']);router[_0xb221('0x4')](_0xb221('0x5'),controller[_0xb221('0x6')],authService[_0xb221('0x7')],userController[_0xb221('0x8')],authService[_0xb221('0x9')]);module['exports']=router; \ No newline at end of file +var _0x41d7=['login','get','/callback','callback','setTokenCookie','exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service'];(function(_0x3287c3,_0x40feed){var _0x3a516c=function(_0x1b729c){while(--_0x1b729c){_0x3287c3['push'](_0x3287c3['shift']());}};_0x3a516c(++_0x40feed);}(_0x41d7,0x186));var _0x741d=function(_0x2eedc1,_0x140261){_0x2eedc1=_0x2eedc1-0x0;var _0x7ce90f=_0x41d7[_0x2eedc1];return _0x7ce90f;};'use strict';var express=require(_0x741d('0x0'));var passport=require(_0x741d('0x1'));var router=express[_0x741d('0x2')]();var controller=require(_0x741d('0x3'));var userController=require(_0x741d('0x4'));var authService=require(_0x741d('0x5'));router['get']('/',controller[_0x741d('0x6')]);router[_0x741d('0x7')](_0x741d('0x8'),controller[_0x741d('0x9')],authService['isMiddleware'],userController[_0x741d('0x6')],authService[_0x741d('0xa')]);module[_0x741d('0xb')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index cf07e2d..6df4133 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 _0x75c5=['../../components/auth/service','client','http','Setting','findOne','blockDuration','then','name','salt','disabled','blocked','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','loginAttempts','allowedLoginAttempts','add','minutes','clearBlockUser','getLicense','catch','MailAccount','MailServerOut','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','Smtp','host','port','secure','authentication','auth','format','request','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','json','email','Email\x20parameter\x20is\x20missing','generate','body','trim','toLowerCase','User','find','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','blockedAt','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','https://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','password','previousPasswords','validatePasswordHistory','Password\x20reset!','use','util','passport','passport-local','lodash','randomstring','moment','../../mysqldb'];(function(_0x39cbdb,_0x255131){var _0x2bd8aa=function(_0x3c5484){while(--_0x3c5484){_0x39cbdb['push'](_0x39cbdb['shift']());}};_0x2bd8aa(++_0x255131);}(_0x75c5,0xfb));var _0x575c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x75c5[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x575c('0x0'));var passport=require(_0x575c('0x1'));var LocalStrategy=require(_0x575c('0x2'))['Strategy'];var jayson=require('jayson/promise');var _=require(_0x575c('0x3'));var rs=require(_0x575c('0x4'));var moment=require(_0x575c('0x5'));var db=require(_0x575c('0x6'))['db'];var authService=require(_0x575c('0x7'));var utils=require('../../config/utils');var client=jayson[_0x575c('0x8')][_0x575c('0x9')]({'port':0x232b});function localAuthenticate(_0x62e644,_0xc786e7,_0x2d0629,_0x204764){var _0x163b31,_0x207199;return db[_0x575c('0xa')][_0x575c('0xb')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x575c('0xc')],'raw':!![]})[_0x575c('0xd')](function(_0x54767d){_0x163b31=_0x54767d;return _0x62e644[_0x575c('0xb')]({'attributes':['id',_0x575c('0xe'),'password',_0x575c('0xf'),'role',_0x575c('0x10'),_0x575c('0x11'),'blockedAt','loginAttempts'],'where':{'name':_0xc786e7,'role':{'$or':['admin',_0x575c('0x12'),_0x575c('0x13')]}}});})[_0x575c('0xd')](function(_0x1d71bb){if(!_0x1d71bb||_0x1d71bb&&_0x1d71bb[_0x575c('0xe')]!==_0xc786e7){throw new Error(_0x575c('0x14'));}else{_0x207199=_0x1d71bb;return _0x207199;}})['then'](function(){_0x207199[_0x575c('0x15')](_0x2d0629,function(_0x40a57c,_0xa2cd02){var _0x41edcb=_0x207199[_0x575c('0x16')]+0x1;if(_0x40a57c){return _0x204764(_0x40a57c);}else if(!_0xa2cd02){if(_0x207199[_0x575c('0x10')]){return _0x204764(null,![],{'message':_0x575c('0x14')});}else if(_0x163b31[_0x575c('0x17')]>0x0){if(_0x207199['blocked']){if(_0x163b31[_0x575c('0xc')]>0x0){if(moment(_0x207199['blockedAt'])[_0x575c('0x18')](_0x163b31[_0x575c('0xc')],_0x575c('0x19'))>moment()){return _0x204764(null,![],{'message':_0x575c('0x14')});}else{return utils[_0x575c('0x1a')](_0x207199,_0x41edcb,![],null)[_0x575c('0xd')](function(){return _0x204764(null,![],{'message':_0x575c('0x14')});});}}else{return _0x204764(null,![],{'message':_0x575c('0x14')});}}else{if(_0x41edcb>=_0x163b31[_0x575c('0x17')]){return utils[_0x575c('0x1a')](_0x207199,0x0,!![],moment())[_0x575c('0xd')](function(){return _0x204764(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x575c('0x1a')](_0x207199,_0x41edcb,![],null)['then'](function(){return _0x204764(null,![],{'message':_0x575c('0x14')});});}}}else{return _0x204764(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x207199[_0x575c('0x10')]){return _0x204764(null,![],{'message':_0x575c('0x14')});}else if(_0x163b31['allowedLoginAttempts']>0x0){if(_0x207199['blocked']){if(_0x163b31[_0x575c('0xc')]>0x0){if(moment(_0x207199['blockedAt'])[_0x575c('0x18')](_0x163b31['blockDuration'],_0x575c('0x19'))>moment()){return _0x204764(null,![],{'message':_0x575c('0x14')});}else{return utils[_0x575c('0x1a')](_0x207199,0x0,![],null)[_0x575c('0xd')](function(){return utils[_0x575c('0x1b')](_0x207199);})[_0x575c('0xd')](function(){return _0x204764(null,_0x207199);});}}else{return _0x204764(null,![],{'message':_0x575c('0x14')});}}else{return utils[_0x575c('0x1a')](_0x207199,0x0,![],null)[_0x575c('0xd')](function(){return utils[_0x575c('0x1b')](_0x207199);})[_0x575c('0xd')](function(){return _0x204764(null,_0x207199);})['catch'](function(_0x32c038){return _0x204764(null,![],_0x32c038);});}}else{if(_0x207199[_0x575c('0x11')]){return _0x204764(null,![],{'message':_0x575c('0x14')});}else{return utils[_0x575c('0x1b')](_0x207199)[_0x575c('0xd')](function(){return _0x204764(null,_0x207199);});}}}});})[_0x575c('0x1c')](function(_0x41497a){return _0x204764(null,![],_0x41497a);});}function sendServiceMail(_0x17b1cd){return db[_0x575c('0x1d')]['find']({'where':{'service':!![]},'attributes':['id','name','email'],'include':[{'model':db[_0x575c('0x1e')],'as':'Smtp'}]})[_0x575c('0xd')](function(_0x1bcd11){if(!_0x1bcd11){throw new Error(_0x575c('0x1f'));}var _0x594575={'tls':{'rejectUnauthorized':![]}};if(_0x1bcd11['Smtp'][_0x575c('0x20')]){_0x594575['service']=_0x1bcd11[_0x575c('0x21')][_0x575c('0x20')];}else{_0x594575['host']=_0x1bcd11[_0x575c('0x21')][_0x575c('0x22')];_0x594575[_0x575c('0x23')]=_0x1bcd11[_0x575c('0x21')][_0x575c('0x23')];_0x594575[_0x575c('0x24')]=_0x1bcd11[_0x575c('0x21')][_0x575c('0x24')];}if(_0x1bcd11[_0x575c('0x21')][_0x575c('0x25')]){_0x594575[_0x575c('0x26')]={'user':_0x1bcd11[_0x575c('0x21')]['user'],'pass':_0x1bcd11['Smtp']['pass']};}var _0x18f0ec={'account':_0x594575,'message':_['merge']({'from':util[_0x575c('0x27')]('\x22%s\x22\x20<%s>',_0x1bcd11[_0x575c('0xe')],_0x1bcd11['email']||_0x1bcd11[_0x575c('0x21')][_0x575c('0x12')])},_0x17b1cd)};return client[_0x575c('0x28')]('SendMail',_0x18f0ec);})[_0x575c('0xd')](function(_0x1e694e){if(_0x1e694e[_0x575c('0x29')]){throw new Error(util['format'](_0x575c('0x2a'),_0x1e694e[_0x575c('0x29')][_0x575c('0x2b')]||JSON[_0x575c('0x2c')](_0x1e694e[_0x575c('0x29')])));}return!![];});}function handleError(_0x3bdd1b,_0x50f9f1,_0x441865){return _0x3bdd1b[_0x575c('0x2d')](_0x50f9f1||0x1f4)[_0x575c('0x2e')]({'message':_0x441865?_0x441865[_0x575c('0x2b')]||_0x441865:''});}exports[_0x575c('0x2f')]=function(_0x1503dd,_0x5ca678,_0x5005f6){passport[_0x575c('0x15')](_0x575c('0x30'),function(_0x38c7c1,_0x59ea5e,_0x34acf5){var _0x4bbea=_0x38c7c1||_0x34acf5;if(_0x4bbea){return handleError(_0x5ca678,0x191,_0x4bbea);}if(!_0x59ea5e){return handleError(_0x5ca678,0x194,{'message':_0x575c('0x31')});}else{var _0x13e11f={'payload':{'id':_0x59ea5e['id'],'role':_0x59ea5e[_0x575c('0x32')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x13e11f)[_0x575c('0xd')](function(_0x563913){_0x5ca678[_0x575c('0x33')]({'id':_0x59ea5e['id'],'token':_0x563913,'statusCall':'','isAlreadyLogged':_0x59ea5e['online']});});}})(_0x1503dd,_0x5ca678,_0x5005f6);};exports['forgot']=function(_0x246816,_0x2a8c06,_0x13a789){if(!_0x246816['body'][_0x575c('0x34')]){return handleError(_0x2a8c06,0x1f4,{'message':_0x575c('0x35')});}var _0x76fe12=rs[_0x575c('0x36')]();_0x246816[_0x575c('0x37')][_0x575c('0x34')]=_0x246816[_0x575c('0x37')][_0x575c('0x34')][_0x575c('0x38')]()[_0x575c('0x39')]();var _0x245666;return db[_0x575c('0xa')][_0x575c('0xb')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x575c('0xc')],'raw':!![]})[_0x575c('0xd')](function(_0x10b9d2){_0x245666=_0x10b9d2;return db[_0x575c('0x3a')][_0x575c('0x3b')]({'where':{'email':_0x246816[_0x575c('0x37')][_0x575c('0x34')]}});})[_0x575c('0xd')](function(_0x56315a){if(!_0x56315a){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x56315a[_0x575c('0x10')]){throw new Error(_0x575c('0x3c'));}if(_0x56315a[_0x575c('0x11')]){if(moment(_0x56315a[_0x575c('0x3d')])['add'](_0x245666[_0x575c('0xc')],_0x575c('0x19'))>moment()){throw new Error(_0x575c('0x3e'));}else{_0x56315a[_0x575c('0x11')]=![];_0x56315a['blockedAt']=null;}}_0x56315a[_0x575c('0x3f')]=_0x76fe12;_0x56315a[_0x575c('0x40')]=Date['now']()+0x36ee80;return _0x56315a[_0x575c('0x41')]();})[_0x575c('0xd')](function(){return sendServiceMail({'to':_0x246816['body'][_0x575c('0x34')],'subject':_0x575c('0x42'),'text':_0x575c('0x43')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x575c('0x44')+_0x246816[_0x575c('0x45')][_0x575c('0x22')]+_0x575c('0x46')+_0x76fe12+'\x0a\x0a'+_0x575c('0x47')});})[_0x575c('0xd')](function(){_0x2a8c06[_0x575c('0x2d')](0xc8)[_0x575c('0x2e')]({'message':_0x575c('0x48')});})[_0x575c('0x1c')](function(_0x4fa6cc){return handleError(_0x2a8c06,0x1f4,_0x4fa6cc);});};exports[_0x575c('0x49')]=function(_0x3bf240,_0xf04b49,_0x7af69f){return db['User']['find']({'where':{'resetPasswordToken':_0x3bf240[_0x575c('0x4a')][_0x575c('0x4b')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x575c('0xd')](function(_0x2419b5){if(!_0x2419b5){throw new Error(_0x575c('0x4c'));}return db[_0x575c('0xa')][_0x575c('0xb')]({'attributes':['id',_0x575c('0x4d'),_0x575c('0x4e'),_0x575c('0x4f')]})[_0x575c('0xd')](function(_0x116bed){if(_0x116bed[_0x575c('0x4d')])authService[_0x575c('0x50')](_0x3bf240['body'][_0x575c('0x51')]);if(!_0x116bed['enforcePasswordHistory']||!_0x2419b5[_0x575c('0x52')])return _0x2419b5;authService[_0x575c('0x53')](_0x3bf240[_0x575c('0x37')][_0x575c('0x51')],_0x2419b5[_0x575c('0x52')],_0x116bed[_0x575c('0x4f')]);return _0x2419b5;})[_0x575c('0xd')](function(){_0x2419b5[_0x575c('0x51')]=_0x3bf240[_0x575c('0x37')][_0x575c('0x51')];_0x2419b5['resetPasswordToken']=null;_0x2419b5[_0x575c('0x40')]=null;return _0x2419b5[_0x575c('0x41')]();});})[_0x575c('0xd')](function(){_0xf04b49[_0x575c('0x2d')](0xc8)[_0x575c('0x2e')]({'message':_0x575c('0x54')});})[_0x575c('0x1c')](function(_0x3defd2){return handleError(_0xf04b49,0x1f4,_0x3defd2);});};passport[_0x575c('0x55')](new LocalStrategy({'usernameField':'name','passwordField':_0x575c('0x51')},function(_0x2b2999,_0x1226a1,_0x2392e6){return localAuthenticate(db['User'],_0x2b2999,_0x1226a1,_0x2392e6);})); \ No newline at end of file +var _0x6c65=['catch','MailAccount','find','name','email','MailServerOut','Smtp','service','host','port','secure','auth','pass','merge','\x22%s\x22\x20<%s>','request','error','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','authenticate','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','Setting','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','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://','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','reset','User','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','password','previousPasswords','validatePasswordHistory','save','Password\x20reset!','use','util','passport','passport-local','Strategy','jayson/promise','randomstring','moment','../../components/auth/service','../../config/utils','client','http','findOne','salt','role','blocked','blockedAt','loginAttempts','admin','user','agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','disabled','allowedLoginAttempts','blockDuration','add','minutes','clearBlockUser','getLicense'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0x6c65,0x8f));var _0x56c6=function(_0x3d686e,_0x2d1c24){_0x3d686e=_0x3d686e-0x0;var _0x27cad7=_0x6c65[_0x3d686e];return _0x27cad7;};'use strict';var util=require(_0x56c6('0x0'));var passport=require(_0x56c6('0x1'));var LocalStrategy=require(_0x56c6('0x2'))[_0x56c6('0x3')];var jayson=require(_0x56c6('0x4'));var _=require('lodash');var rs=require(_0x56c6('0x5'));var moment=require(_0x56c6('0x6'));var db=require('../../mysqldb')['db'];var authService=require(_0x56c6('0x7'));var utils=require(_0x56c6('0x8'));var client=jayson[_0x56c6('0x9')][_0x56c6('0xa')]({'port':0x232b});function localAuthenticate(_0x3deb7e,_0x198239,_0x3f5974,_0x190702){var _0x458bf6,_0x3e556d;return db['Setting'][_0x56c6('0xb')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})['then'](function(_0x2a7b2e){_0x458bf6=_0x2a7b2e;return _0x3deb7e[_0x56c6('0xb')]({'attributes':['id','name','password',_0x56c6('0xc'),_0x56c6('0xd'),'disabled',_0x56c6('0xe'),_0x56c6('0xf'),_0x56c6('0x10')],'where':{'name':_0x198239,'role':{'$or':[_0x56c6('0x11'),_0x56c6('0x12'),_0x56c6('0x13')]}}});})[_0x56c6('0x14')](function(_0x474a1f){if(!_0x474a1f||_0x474a1f&&_0x474a1f['name']!==_0x198239){throw new Error(_0x56c6('0x15'));}else{_0x3e556d=_0x474a1f;return _0x3e556d;}})['then'](function(){_0x3e556d['authenticate'](_0x3f5974,function(_0x1efc76,_0x473c14){var _0x4c14c0=_0x3e556d[_0x56c6('0x10')]+0x1;if(_0x1efc76){return _0x190702(_0x1efc76);}else if(!_0x473c14){if(_0x3e556d[_0x56c6('0x16')]){return _0x190702(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x458bf6[_0x56c6('0x17')]>0x0){if(_0x3e556d[_0x56c6('0xe')]){if(_0x458bf6[_0x56c6('0x18')]>0x0){if(moment(_0x3e556d[_0x56c6('0xf')])[_0x56c6('0x19')](_0x458bf6[_0x56c6('0x18')],_0x56c6('0x1a'))>moment()){return _0x190702(null,![],{'message':_0x56c6('0x15')});}else{return utils['clearBlockUser'](_0x3e556d,_0x4c14c0,![],null)[_0x56c6('0x14')](function(){return _0x190702(null,![],{'message':_0x56c6('0x15')});});}}else{return _0x190702(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x4c14c0>=_0x458bf6[_0x56c6('0x17')]){return utils[_0x56c6('0x1b')](_0x3e556d,0x0,!![],moment())[_0x56c6('0x14')](function(){return _0x190702(null,![],{'message':_0x56c6('0x15')});});}else{return utils[_0x56c6('0x1b')](_0x3e556d,_0x4c14c0,![],null)[_0x56c6('0x14')](function(){return _0x190702(null,![],{'message':_0x56c6('0x15')});});}}}else{return _0x190702(null,![],{'message':_0x56c6('0x15')});}}else{if(_0x3e556d[_0x56c6('0x16')]){return _0x190702(null,![],{'message':_0x56c6('0x15')});}else if(_0x458bf6[_0x56c6('0x17')]>0x0){if(_0x3e556d['blocked']){if(_0x458bf6[_0x56c6('0x18')]>0x0){if(moment(_0x3e556d[_0x56c6('0xf')])[_0x56c6('0x19')](_0x458bf6[_0x56c6('0x18')],_0x56c6('0x1a'))>moment()){return _0x190702(null,![],{'message':_0x56c6('0x15')});}else{return utils[_0x56c6('0x1b')](_0x3e556d,0x0,![],null)['then'](function(){return utils['getLicense'](_0x3e556d);})['then'](function(){return _0x190702(null,_0x3e556d);});}}else{return _0x190702(null,![],{'message':_0x56c6('0x15')});}}else{return utils[_0x56c6('0x1b')](_0x3e556d,0x0,![],null)[_0x56c6('0x14')](function(){return utils[_0x56c6('0x1c')](_0x3e556d);})[_0x56c6('0x14')](function(){return _0x190702(null,_0x3e556d);})['catch'](function(_0x5c5877){return _0x190702(null,![],_0x5c5877);});}}else{if(_0x3e556d[_0x56c6('0xe')]){return _0x190702(null,![],{'message':_0x56c6('0x15')});}else{return utils['getLicense'](_0x3e556d)[_0x56c6('0x14')](function(){return _0x190702(null,_0x3e556d);});}}}});})[_0x56c6('0x1d')](function(_0xfd619b){return _0x190702(null,![],_0xfd619b);});}function sendServiceMail(_0x5aa8fe){return db[_0x56c6('0x1e')][_0x56c6('0x1f')]({'where':{'service':!![]},'attributes':['id',_0x56c6('0x20'),_0x56c6('0x21')],'include':[{'model':db[_0x56c6('0x22')],'as':'Smtp'}]})[_0x56c6('0x14')](function(_0x329446){if(!_0x329446){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x36f3d8={'tls':{'rejectUnauthorized':![]}};if(_0x329446[_0x56c6('0x23')][_0x56c6('0x24')]){_0x36f3d8[_0x56c6('0x24')]=_0x329446[_0x56c6('0x23')][_0x56c6('0x24')];}else{_0x36f3d8[_0x56c6('0x25')]=_0x329446[_0x56c6('0x23')]['host'];_0x36f3d8[_0x56c6('0x26')]=_0x329446[_0x56c6('0x23')]['port'];_0x36f3d8['secure']=_0x329446[_0x56c6('0x23')][_0x56c6('0x27')];}if(_0x329446[_0x56c6('0x23')]['authentication']){_0x36f3d8[_0x56c6('0x28')]={'user':_0x329446['Smtp'][_0x56c6('0x12')],'pass':_0x329446[_0x56c6('0x23')][_0x56c6('0x29')]};}var _0x1414fd={'account':_0x36f3d8,'message':_[_0x56c6('0x2a')]({'from':util['format'](_0x56c6('0x2b'),_0x329446[_0x56c6('0x20')],_0x329446[_0x56c6('0x21')]||_0x329446[_0x56c6('0x23')][_0x56c6('0x12')])},_0x5aa8fe)};return client[_0x56c6('0x2c')]('SendMail',_0x1414fd);})[_0x56c6('0x14')](function(_0x17345a){if(_0x17345a[_0x56c6('0x2d')]){throw new Error(util[_0x56c6('0x2e')](_0x56c6('0x2f'),_0x17345a['error'][_0x56c6('0x30')]||JSON[_0x56c6('0x31')](_0x17345a[_0x56c6('0x2d')])));}return!![];});}function handleError(_0x5acefc,_0x37f1db,_0x161a9d){return _0x5acefc[_0x56c6('0x32')](_0x37f1db||0x1f4)[_0x56c6('0x33')]({'message':_0x161a9d?_0x161a9d[_0x56c6('0x30')]||_0x161a9d:''});}exports[_0x56c6('0x34')]=function(_0xacd06b,_0x84c7db,_0x1cec3d){passport[_0x56c6('0x35')](_0x56c6('0x36'),function(_0x2ac5a9,_0xb184dc,_0x8437e4){var _0x2efc93=_0x2ac5a9||_0x8437e4;if(_0x2efc93){return handleError(_0x84c7db,0x191,_0x2efc93);}if(!_0xb184dc){return handleError(_0x84c7db,0x194,{'message':_0x56c6('0x37')});}else{var _0x3c6836={'payload':{'id':_0xb184dc['id'],'role':_0xb184dc['role']},'options':{'expiresIn':0x15180}};return authService[_0x56c6('0x38')](_0x3c6836)[_0x56c6('0x14')](function(_0x4918b9){_0x84c7db[_0x56c6('0x39')]({'id':_0xb184dc['id'],'token':_0x4918b9,'statusCall':'','isAlreadyLogged':_0xb184dc[_0x56c6('0x3a')]});});}})(_0xacd06b,_0x84c7db,_0x1cec3d);};exports[_0x56c6('0x3b')]=function(_0x247744,_0x6fe023,_0x388f80){if(!_0x247744[_0x56c6('0x3c')][_0x56c6('0x21')]){return handleError(_0x6fe023,0x1f4,{'message':_0x56c6('0x3d')});}var _0x2d512c=rs[_0x56c6('0x3e')]();_0x247744[_0x56c6('0x3c')]['email']=_0x247744[_0x56c6('0x3c')][_0x56c6('0x21')]['trim']()['toLowerCase']();var _0x3be845;return db[_0x56c6('0x3f')][_0x56c6('0xb')]({'where':{'id':0x1},'attributes':[_0x56c6('0x17'),_0x56c6('0x18')],'raw':!![]})['then'](function(_0x262833){_0x3be845=_0x262833;return db['User'][_0x56c6('0x1f')]({'where':{'email':_0x247744[_0x56c6('0x3c')][_0x56c6('0x21')]}});})[_0x56c6('0x14')](function(_0x5c984e){if(!_0x5c984e){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x5c984e[_0x56c6('0x16')]){throw new Error(_0x56c6('0x40'));}if(_0x5c984e[_0x56c6('0xe')]){if(moment(_0x5c984e['blockedAt'])['add'](_0x3be845['blockDuration'],_0x56c6('0x1a'))>moment()){throw new Error(_0x56c6('0x41'));}else{_0x5c984e[_0x56c6('0xe')]=![];_0x5c984e[_0x56c6('0xf')]=null;}}_0x5c984e[_0x56c6('0x42')]=_0x2d512c;_0x5c984e[_0x56c6('0x43')]=Date[_0x56c6('0x44')]()+0x36ee80;return _0x5c984e['save']();})[_0x56c6('0x14')](function(){return sendServiceMail({'to':_0x247744[_0x56c6('0x3c')][_0x56c6('0x21')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0x56c6('0x45')+_0x56c6('0x46')+_0x56c6('0x47')+_0x247744['headers']['host']+'/reset/'+_0x2d512c+'\x0a\x0a'+_0x56c6('0x48')});})['then'](function(){_0x6fe023[_0x56c6('0x32')](0xc8)[_0x56c6('0x33')]({'message':'Reset\x20Email\x20sent!'});})[_0x56c6('0x1d')](function(_0x42af4e){return handleError(_0x6fe023,0x1f4,_0x42af4e);});};exports[_0x56c6('0x49')]=function(_0x48ec23,_0x34fc1f,_0x3cfc37){return db[_0x56c6('0x4a')][_0x56c6('0x1f')]({'where':{'resetPasswordToken':_0x48ec23['params']['token'],'resetPasswordExpires':{'$gt':Date[_0x56c6('0x44')]()}}})['then'](function(_0x18f85e){if(!_0x18f85e){throw new Error(_0x56c6('0x4b'));}return db[_0x56c6('0x3f')]['findOne']({'attributes':['id',_0x56c6('0x4c'),_0x56c6('0x4d'),_0x56c6('0x4e')]})['then'](function(_0x29c4ff){if(_0x29c4ff['securePassword'])authService[_0x56c6('0x4f')](_0x48ec23[_0x56c6('0x3c')][_0x56c6('0x50')]);if(!_0x29c4ff[_0x56c6('0x4d')]||!_0x18f85e[_0x56c6('0x51')])return _0x18f85e;authService[_0x56c6('0x52')](_0x48ec23[_0x56c6('0x3c')]['password'],_0x18f85e[_0x56c6('0x51')],_0x29c4ff[_0x56c6('0x4e')]);return _0x18f85e;})['then'](function(){_0x18f85e[_0x56c6('0x50')]=_0x48ec23[_0x56c6('0x3c')][_0x56c6('0x50')];_0x18f85e[_0x56c6('0x42')]=null;_0x18f85e[_0x56c6('0x43')]=null;return _0x18f85e[_0x56c6('0x53')]();});})[_0x56c6('0x14')](function(){_0x34fc1f[_0x56c6('0x32')](0xc8)['send']({'message':_0x56c6('0x54')});})['catch'](function(_0x32a49e){return handleError(_0x34fc1f,0x1f4,_0x32a49e);});};passport[_0x56c6('0x55')](new LocalStrategy({'usernameField':_0x56c6('0x20'),'passwordField':_0x56c6('0x50')},function(_0x42df08,_0x192085,_0xc2b0d8){return localAuthenticate(db[_0x56c6('0x4a')],_0x42df08,_0x192085,_0xc2b0d8);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 82f421e..4cf0e88 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 _0x2c0f=['post','login','/forgot','forgot','/reset/:token','reset','express','./authLocal.controller'];(function(_0x72641b,_0x2e41a2){var _0x10beae=function(_0x51c006){while(--_0x51c006){_0x72641b['push'](_0x72641b['shift']());}};_0x10beae(++_0x2e41a2);}(_0x2c0f,0x12e));var _0xf2c0=function(_0x1b8b95,_0x3ea343){_0x1b8b95=_0x1b8b95-0x0;var _0x3657ae=_0x2c0f[_0x1b8b95];return _0x3657ae;};'use strict';var express=require(_0xf2c0('0x0'));var router=express['Router']();var controller=require(_0xf2c0('0x1'));router[_0xf2c0('0x2')]('/',controller[_0xf2c0('0x3')]);router[_0xf2c0('0x2')](_0xf2c0('0x4'),controller[_0xf2c0('0x5')]);router[_0xf2c0('0x2')](_0xf2c0('0x6'),controller[_0xf2c0('0x7')]);module['exports']=router; \ No newline at end of file +var _0x54ab=['post','/reset/:token','exports','Router','./authLocal.controller','login'];(function(_0x2dcf1d,_0xc76f4d){var _0x370e0c=function(_0x19ab8f){while(--_0x19ab8f){_0x2dcf1d['push'](_0x2dcf1d['shift']());}};_0x370e0c(++_0xc76f4d);}(_0x54ab,0x1dd));var _0xb54a=function(_0x2616bc,_0x41c5e3){_0x2616bc=_0x2616bc-0x0;var _0x58e842=_0x54ab[_0x2616bc];return _0x58e842;};'use strict';var express=require('express');var router=express[_0xb54a('0x0')]();var controller=require(_0xb54a('0x1'));router['post']('/',controller[_0xb54a('0x2')]);router[_0xb54a('0x3')]('/forgot',controller['forgot']);router['post'](_0xb54a('0x4'),controller['reset']);module[_0xb54a('0x5')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 81c9369..98737e6 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 _0x6cb5=['exports','STRING','BOOLEAN','INTEGER','sequelize'];(function(_0x29c261,_0x3af39a){var _0x1a9335=function(_0x40d1e8){while(--_0x40d1e8){_0x29c261['push'](_0x29c261['shift']());}};_0x1a9335(++_0x3af39a);}(_0x6cb5,0xf9));var _0x56cb=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0x6cb5[_0x411add];return _0x238242;};'use strict';var Sequelize=require(_0x56cb('0x0'));module[_0x56cb('0x1')]={'name':{'type':Sequelize[_0x56cb('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x56cb('0x2')]},'description':{'type':Sequelize[_0x56cb('0x2')]},'status':{'type':Sequelize[_0x56cb('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x56cb('0x4')],'defaultValue':0xa}}; \ No newline at end of file +var _0x282b=['exports','STRING','BOOLEAN','INTEGER','sequelize'];(function(_0x3878bd,_0x51e3e5){var _0x359e60=function(_0xe70276){while(--_0xe70276){_0x3878bd['push'](_0x3878bd['shift']());}};_0x359e60(++_0x51e3e5);}(_0x282b,0x18a));var _0xb282=function(_0x4dfc1b,_0x74c22f){_0x4dfc1b=_0x4dfc1b-0x0;var _0x3d3d31=_0x282b[_0x4dfc1b];return _0x3d3d31;};'use strict';var Sequelize=require(_0xb282('0x0'));module[_0xb282('0x1')]={'name':{'type':Sequelize[_0xb282('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xb282('0x2')]},'description':{'type':Sequelize[_0xb282('0x2')]},'status':{'type':Sequelize[_0xb282('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xb282('0x4')],'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 5751824..4656aad 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 _0x733d=['find','create','body','update','params','addConditions','ids','omit','getConditions','findOne','Condition','addActions','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Automation','includeAll','include','catch','show'];(function(_0x204eb7,_0x4974c3){var _0x37e444=function(_0x390613){while(--_0x390613){_0x204eb7['push'](_0x204eb7['shift']());}};_0x37e444(++_0x4974c3);}(_0x733d,0xb4));var _0xd733=function(_0xb983f5,_0x48a9f4){_0xb983f5=_0xb983f5-0x0;var _0x29d6ad=_0x733d[_0xb983f5];return _0x29d6ad;};'use strict';var emlformat=require(_0xd733('0x0'));var rimraf=require(_0xd733('0x1'));var zipdir=require(_0xd733('0x2'));var jsonpatch=require(_0xd733('0x3'));var rp=require(_0xd733('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd733('0x5'));var path=require(_0xd733('0x6'));var sox=require('sox');var csv=require(_0xd733('0x7'));var ejs=require(_0xd733('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd733('0x9'));var squel=require(_0xd733('0xa'));var crypto=require(_0xd733('0xb'));var jsforce=require(_0xd733('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xd733('0x7'));var querystring=require(_0xd733('0xd'));var Papa=require(_0xd733('0xe'));var Redis=require(_0xd733('0xf'));var authService=require(_0xd733('0x10'));var qs=require(_0xd733('0x11'));var as=require(_0xd733('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd733('0x13'));var utils=require(_0xd733('0x14'));var config=require(_0xd733('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xd733('0x16'))['db'];function respondWithStatusCode(_0xf45ed2,_0x1fb23c){_0x1fb23c=_0x1fb23c||0xcc;return function(_0x48823b){if(_0x48823b){return _0xf45ed2[_0xd733('0x17')](_0x1fb23c);}return _0xf45ed2[_0xd733('0x18')](_0x1fb23c)[_0xd733('0x19')]();};}function respondWithResult(_0x113307,_0x534b35){_0x534b35=_0x534b35||0xc8;return function(_0x6f16d7){if(_0x6f16d7){return _0x113307[_0xd733('0x18')](_0x534b35)[_0xd733('0x1a')](_0x6f16d7);}};}function respondWithFilteredResult(_0x3a03e3,_0x2785ed){return function(_0x44f509){if(_0x44f509){var _0x45d0c2=typeof _0x2785ed['offset']===_0xd733('0x1b')&&typeof _0x2785ed['limit']===_0xd733('0x1b');var _0x13df81=_0x44f509[_0xd733('0x1c')];var _0x23b0bf=_0x45d0c2?0x0:_0x2785ed[_0xd733('0x1d')];var _0x5ad23e=_0x45d0c2?_0x44f509[_0xd733('0x1c')]:_0x2785ed[_0xd733('0x1d')]+_0x2785ed[_0xd733('0x1e')];var _0x1f5f34;if(_0x5ad23e>=_0x13df81){_0x5ad23e=_0x13df81;_0x1f5f34=0xc8;}else{_0x1f5f34=0xce;}_0x3a03e3['status'](_0x1f5f34);return _0x3a03e3[_0xd733('0x1f')](_0xd733('0x20'),_0x23b0bf+'-'+_0x5ad23e+'/'+_0x13df81)['json'](_0x44f509);}return null;};}function patchUpdates(_0x5394ca){return function(_0x44cf4f){try{jsonpatch[_0xd733('0x21')](_0x44cf4f,_0x5394ca,!![]);}catch(_0x5efaa5){return BPromise[_0xd733('0x22')](_0x5efaa5);}return _0x44cf4f['save']();};}function saveUpdates(_0x1d0803,_0x30c99d){return function(_0x5e140f){if(_0x5e140f){return _0x5e140f['update'](_0x1d0803)[_0xd733('0x23')](function(_0x42d036){return _0x42d036;});}return null;};}function removeEntity(_0x513e34,_0x4f747c){return function(_0x5f03b9){if(_0x5f03b9){return _0x5f03b9[_0xd733('0x24')]()[_0xd733('0x23')](function(){_0x513e34['status'](0xcc)[_0xd733('0x19')]();});}};}function handleEntityNotFound(_0x18f318,_0x4c5795){return function(_0x5adb49){if(!_0x5adb49){_0x18f318[_0xd733('0x17')](0x194);}return _0x5adb49;};}function handleError(_0xeaa938,_0x540de5){_0x540de5=_0x540de5||0x1f4;return function(_0x28b161){logger[_0xd733('0x25')](_0x28b161[_0xd733('0x26')]);if(_0x28b161[_0xd733('0x27')]){delete _0x28b161[_0xd733('0x27')];}_0xeaa938['status'](_0x540de5)[_0xd733('0x28')](_0x28b161);};}exports[_0xd733('0x29')]=function(_0x3de843,_0x1bc3cf){var _0x16e136={},_0x5d794f={},_0x3f14d5={'count':0x0,'rows':[]};var _0x3e9dbe=_[_0xd733('0x2a')](db['Automation'][_0xd733('0x2b')],function(_0x1dd173){return{'name':_0x1dd173[_0xd733('0x2c')],'type':_0x1dd173[_0xd733('0x2d')]['key']};});_0x5d794f[_0xd733('0x2e')]=_[_0xd733('0x2a')](_0x3e9dbe,'name');_0x5d794f[_0xd733('0x2f')]=_[_0xd733('0x30')](_0x3de843['query']);_0x5d794f[_0xd733('0x31')]=_[_0xd733('0x32')](_0x5d794f[_0xd733('0x2e')],_0x5d794f['query']);_0x16e136[_0xd733('0x33')]=_['intersection'](_0x5d794f[_0xd733('0x2e')],qs[_0xd733('0x34')](_0x3de843[_0xd733('0x2f')][_0xd733('0x34')]));_0x16e136['attributes']=_0x16e136['attributes'][_0xd733('0x35')]?_0x16e136[_0xd733('0x33')]:_0x5d794f['model'];if(!_0x3de843[_0xd733('0x2f')][_0xd733('0x36')](_0xd733('0x37'))){_0x16e136[_0xd733('0x1e')]=qs[_0xd733('0x1e')](_0x3de843[_0xd733('0x2f')]['limit']);_0x16e136[_0xd733('0x1d')]=qs[_0xd733('0x1d')](_0x3de843['query'][_0xd733('0x1d')]);}_0x16e136[_0xd733('0x38')]=qs[_0xd733('0x39')](_0x3de843[_0xd733('0x2f')]['sort']);_0x16e136[_0xd733('0x3a')]=qs[_0xd733('0x31')](_[_0xd733('0x3b')](_0x3de843['query'],_0x5d794f['filters']),_0x3e9dbe);if(_0x3de843[_0xd733('0x2f')][_0xd733('0x3c')]){_0x16e136[_0xd733('0x3a')]=_[_0xd733('0x3d')](_0x16e136['where'],{'$or':_[_0xd733('0x2a')](_0x3e9dbe,function(_0x4dbf11){if(_0x4dbf11['type']!==_0xd733('0x3e')){var _0x9b6452={};_0x9b6452[_0x4dbf11[_0xd733('0x27')]]={'$like':'%'+_0x3de843[_0xd733('0x2f')][_0xd733('0x3c')]+'%'};return _0x9b6452;}})});}_0x16e136=_[_0xd733('0x3d')]({},_0x16e136,_0x3de843[_0xd733('0x3f')]);var _0x56d86d={'where':_0x16e136[_0xd733('0x3a')]};return db[_0xd733('0x40')][_0xd733('0x1c')](_0x56d86d)[_0xd733('0x23')](function(_0x2b1a11){_0x3f14d5['count']=_0x2b1a11;if(_0x3de843[_0xd733('0x2f')][_0xd733('0x41')]){_0x16e136[_0xd733('0x42')]=[{'all':!![]}];}return db[_0xd733('0x40')]['findAll'](_0x16e136);})['then'](function(_0x3e9150){_0x3f14d5['rows']=_0x3e9150;return _0x3f14d5;})['then'](respondWithFilteredResult(_0x1bc3cf,_0x16e136))[_0xd733('0x43')](handleError(_0x1bc3cf,null));};exports[_0xd733('0x44')]=function(_0x45ee62,_0x5bca76){var _0x474bb9={'raw':![],'where':{'id':_0x45ee62['params']['id']}},_0x5802b7={};_0x5802b7[_0xd733('0x2e')]=_['keys'](db['Automation']['rawAttributes']);_0x5802b7[_0xd733('0x2f')]=_[_0xd733('0x30')](_0x45ee62[_0xd733('0x2f')]);_0x5802b7[_0xd733('0x31')]=_[_0xd733('0x32')](_0x5802b7['model'],_0x5802b7[_0xd733('0x2f')]);_0x474bb9['attributes']=_[_0xd733('0x32')](_0x5802b7[_0xd733('0x2e')],qs[_0xd733('0x34')](_0x45ee62[_0xd733('0x2f')]['fields']));_0x474bb9[_0xd733('0x33')]=_0x474bb9['attributes'][_0xd733('0x35')]?_0x474bb9[_0xd733('0x33')]:_0x5802b7['model'];if(_0x45ee62['query']['includeAll']){_0x474bb9[_0xd733('0x42')]=[{'all':!![]}];}_0x474bb9=_[_0xd733('0x3d')]({},_0x474bb9,_0x45ee62[_0xd733('0x3f')]);return db['Automation'][_0xd733('0x45')](_0x474bb9)[_0xd733('0x23')](handleEntityNotFound(_0x5bca76,null))['then'](respondWithResult(_0x5bca76,null))['catch'](handleError(_0x5bca76,null));};exports[_0xd733('0x46')]=function(_0x117dd8,_0x3843c7){return db['Automation'][_0xd733('0x46')](_0x117dd8[_0xd733('0x47')],{})[_0xd733('0x23')](respondWithResult(_0x3843c7,0xc9))[_0xd733('0x43')](handleError(_0x3843c7,null));};exports[_0xd733('0x48')]=function(_0x4c1074,_0x3cd693){if(_0x4c1074['body']['id']){delete _0x4c1074[_0xd733('0x47')]['id'];}return db[_0xd733('0x40')][_0xd733('0x45')]({'where':{'id':_0x4c1074['params']['id']}})[_0xd733('0x23')](handleEntityNotFound(_0x3cd693,null))['then'](saveUpdates(_0x4c1074[_0xd733('0x47')],null))[_0xd733('0x23')](respondWithResult(_0x3cd693,null))[_0xd733('0x43')](handleError(_0x3cd693,null));};exports[_0xd733('0x24')]=function(_0x17d87a,_0x320f86){return db['Automation']['find']({'where':{'id':_0x17d87a[_0xd733('0x49')]['id']}})[_0xd733('0x23')](handleEntityNotFound(_0x320f86,null))[_0xd733('0x23')](removeEntity(_0x320f86,null))['catch'](handleError(_0x320f86,null));};exports['addConditions']=function(_0x1052df,_0x2b2dce,_0x48302c){return db['Condition'][_0xd733('0x45')]({'where':{'id':_0x1052df[_0xd733('0x49')]['id']}})[_0xd733('0x23')](handleEntityNotFound(_0x2b2dce,null))['then'](function(_0x528d98){if(_0x528d98){return _0x528d98[_0xd733('0x4a')](_0x1052df['body'][_0xd733('0x4b')],_[_0xd733('0x4c')](_0x1052df[_0xd733('0x47')],['ids','id'])||{});}})[_0xd733('0x23')](respondWithResult(_0x2b2dce,null))[_0xd733('0x43')](handleError(_0x2b2dce,null));};exports[_0xd733('0x4d')]=function(_0x4bb140,_0x1f1315,_0x354f78){var _0x28434b={};var _0x1e42ec={};var _0x13fe68;var _0x1f1b71;return db[_0xd733('0x40')][_0xd733('0x4e')]({'where':{'id':_0x4bb140[_0xd733('0x49')]['id']}})['then'](handleEntityNotFound(_0x1f1315,null))['then'](function(_0x53328c){if(_0x53328c){_0x13fe68=_0x53328c;_0x1e42ec['model']=_[_0xd733('0x30')](db[_0xd733('0x4f')][_0xd733('0x2b')]);_0x1e42ec[_0xd733('0x2f')]=_['keys'](_0x4bb140[_0xd733('0x2f')]);_0x1e42ec[_0xd733('0x31')]=_[_0xd733('0x32')](_0x1e42ec['model'],_0x1e42ec[_0xd733('0x2f')]);_0x28434b[_0xd733('0x33')]=_[_0xd733('0x32')](_0x1e42ec[_0xd733('0x2e')],qs[_0xd733('0x34')](_0x4bb140[_0xd733('0x2f')][_0xd733('0x34')]));_0x28434b[_0xd733('0x33')]=_0x28434b[_0xd733('0x33')][_0xd733('0x35')]?_0x28434b[_0xd733('0x33')]:_0x1e42ec[_0xd733('0x2e')];_0x28434b[_0xd733('0x38')]=qs[_0xd733('0x39')](_0x4bb140[_0xd733('0x2f')][_0xd733('0x39')]);_0x28434b['where']=qs[_0xd733('0x31')](_[_0xd733('0x3b')](_0x4bb140[_0xd733('0x2f')],_0x1e42ec[_0xd733('0x31')]));if(_0x4bb140[_0xd733('0x2f')][_0xd733('0x3c')]){_0x28434b['where']=_[_0xd733('0x3d')](_0x28434b[_0xd733('0x3a')],{'$or':_['map'](_0x28434b[_0xd733('0x33')],function(_0x39072c){var _0x217a3b={};_0x217a3b[_0x39072c]={'$like':'%'+_0x4bb140[_0xd733('0x2f')]['filter']+'%'};return _0x217a3b;})});}_0x28434b=_[_0xd733('0x3d')]({},_0x28434b,_0x4bb140[_0xd733('0x3f')]);return _0x13fe68['getConditions'](_0x28434b);}})['then'](function(_0x73e670){if(_0x73e670){_0x1f1b71=_0x73e670['length'];if(!_0x4bb140['query'][_0xd733('0x36')]('nolimit')){_0x28434b[_0xd733('0x1e')]=qs[_0xd733('0x1e')](_0x4bb140[_0xd733('0x2f')][_0xd733('0x1e')]);_0x28434b['offset']=qs[_0xd733('0x1d')](_0x4bb140[_0xd733('0x2f')][_0xd733('0x1d')]);}return _0x13fe68[_0xd733('0x4d')](_0x28434b);}})[_0xd733('0x23')](function(_0x374f79){if(_0x374f79){return _0x374f79?{'count':_0x1f1b71,'rows':_0x374f79}:null;}})[_0xd733('0x23')](respondWithResult(_0x1f1315,null))[_0xd733('0x43')](handleError(_0x1f1315,null));};exports[_0xd733('0x50')]=function(_0x37e2d7,_0x587e7c,_0x787e8c){return db[_0xd733('0x51')][_0xd733('0x45')]({'where':{'id':_0x37e2d7[_0xd733('0x49')]['id']}})[_0xd733('0x23')](handleEntityNotFound(_0x587e7c,null))['then'](function(_0x1c3ad5){if(_0x1c3ad5){return _0x1c3ad5[_0xd733('0x50')](_0x37e2d7[_0xd733('0x47')][_0xd733('0x4b')],_[_0xd733('0x4c')](_0x37e2d7[_0xd733('0x47')],[_0xd733('0x4b'),'id'])||{});}})['then'](respondWithResult(_0x587e7c,null))[_0xd733('0x43')](handleError(_0x587e7c,null));};exports['getActions']=function(_0x4a238f,_0x224f9c,_0x236aca){var _0x1c16b8={};var _0x324956={};var _0x459f97;var _0x2e1e16;return db[_0xd733('0x40')]['findOne']({'where':{'id':_0x4a238f[_0xd733('0x49')]['id']}})['then'](handleEntityNotFound(_0x224f9c,null))['then'](function(_0x4cefbf){if(_0x4cefbf){_0x459f97=_0x4cefbf;_0x324956['model']=_[_0xd733('0x30')](db[_0xd733('0x51')][_0xd733('0x2b')]);_0x324956[_0xd733('0x2f')]=_['keys'](_0x4a238f[_0xd733('0x2f')]);_0x324956[_0xd733('0x31')]=_[_0xd733('0x32')](_0x324956[_0xd733('0x2e')],_0x324956[_0xd733('0x2f')]);_0x1c16b8['attributes']=_[_0xd733('0x32')](_0x324956[_0xd733('0x2e')],qs[_0xd733('0x34')](_0x4a238f[_0xd733('0x2f')][_0xd733('0x34')]));_0x1c16b8[_0xd733('0x33')]=_0x1c16b8[_0xd733('0x33')]['length']?_0x1c16b8[_0xd733('0x33')]:_0x324956['model'];_0x1c16b8[_0xd733('0x38')]=qs[_0xd733('0x39')](_0x4a238f['query'][_0xd733('0x39')]);_0x1c16b8[_0xd733('0x3a')]=qs[_0xd733('0x31')](_[_0xd733('0x3b')](_0x4a238f[_0xd733('0x2f')],_0x324956[_0xd733('0x31')]));if(_0x4a238f[_0xd733('0x2f')][_0xd733('0x3c')]){_0x1c16b8[_0xd733('0x3a')]=_[_0xd733('0x3d')](_0x1c16b8[_0xd733('0x3a')],{'$or':_[_0xd733('0x2a')](_0x1c16b8[_0xd733('0x33')],function(_0x852ab3){var _0x4a46f5={};_0x4a46f5[_0x852ab3]={'$like':'%'+_0x4a238f['query']['filter']+'%'};return _0x4a46f5;})});}_0x1c16b8=_[_0xd733('0x3d')]({},_0x1c16b8,_0x4a238f[_0xd733('0x3f')]);return _0x459f97[_0xd733('0x52')](_0x1c16b8);}})[_0xd733('0x23')](function(_0x570539){if(_0x570539){_0x2e1e16=_0x570539[_0xd733('0x35')];if(!_0x4a238f['query']['hasOwnProperty']('nolimit')){_0x1c16b8[_0xd733('0x1e')]=qs[_0xd733('0x1e')](_0x4a238f[_0xd733('0x2f')][_0xd733('0x1e')]);_0x1c16b8[_0xd733('0x1d')]=qs[_0xd733('0x1d')](_0x4a238f[_0xd733('0x2f')]['offset']);}return _0x459f97[_0xd733('0x52')](_0x1c16b8);}})['then'](function(_0x5e65bf){if(_0x5e65bf){return _0x5e65bf?{'count':_0x2e1e16,'rows':_0x5e65bf}:null;}})[_0xd733('0x23')](respondWithResult(_0x224f9c,null))[_0xd733('0x43')](handleError(_0x224f9c,null));}; \ No newline at end of file +var _0x0082=['util','to-csv','fs-extra','lodash','squel','crypto','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','Automation','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','options','create','body','find','params','addConditions','Condition','ids','omit','getConditions','rawAttributes','hasOwnProperty','addActions','Action','getActions','findOne','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache'];(function(_0x6e72b9,_0xb1b68c){var _0x4c638c=function(_0x6e924a){while(--_0x6e924a){_0x6e72b9['push'](_0x6e72b9['shift']());}};_0x4c638c(++_0xb1b68c);}(_0x0082,0x142));var _0x2008=function(_0x467e39,_0x54a12e){_0x467e39=_0x467e39-0x0;var _0x3d4c8e=_0x0082[_0x467e39];return _0x3d4c8e;};'use strict';var emlformat=require(_0x2008('0x0'));var rimraf=require(_0x2008('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2008('0x2'));var rp=require('request-promise');var moment=require(_0x2008('0x3'));var BPromise=require(_0x2008('0x4'));var Mustache=require(_0x2008('0x5'));var util=require(_0x2008('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x2008('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2008('0x8'));var _=require(_0x2008('0x9'));var squel=require(_0x2008('0xa'));var crypto=require(_0x2008('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2008('0x7'));var querystring=require(_0x2008('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2008('0xd'));var hardwareService=require(_0x2008('0xe'));var logger=require(_0x2008('0xf'))(_0x2008('0x10'));var utils=require(_0x2008('0x11'));var config=require(_0x2008('0x12'));var licenseUtil=require(_0x2008('0x13'));var db=require(_0x2008('0x14'))['db'];function respondWithStatusCode(_0x829c38,_0x41a902){_0x41a902=_0x41a902||0xcc;return function(_0x1934b6){if(_0x1934b6){return _0x829c38['sendStatus'](_0x41a902);}return _0x829c38[_0x2008('0x15')](_0x41a902)[_0x2008('0x16')]();};}function respondWithResult(_0x56a21b,_0x3b21a8){_0x3b21a8=_0x3b21a8||0xc8;return function(_0x301e4a){if(_0x301e4a){return _0x56a21b[_0x2008('0x15')](_0x3b21a8)[_0x2008('0x17')](_0x301e4a);}};}function respondWithFilteredResult(_0x3cb286,_0x55068b){return function(_0x9b82fc){if(_0x9b82fc){var _0x58ce38=typeof _0x55068b[_0x2008('0x18')]==='undefined'&&typeof _0x55068b['limit']==='undefined';var _0x22f4fe=_0x9b82fc[_0x2008('0x19')];var _0x90a85a=_0x58ce38?0x0:_0x55068b['offset'];var _0x354d5a=_0x58ce38?_0x9b82fc['count']:_0x55068b[_0x2008('0x18')]+_0x55068b[_0x2008('0x1a')];var _0x409eb8;if(_0x354d5a>=_0x22f4fe){_0x354d5a=_0x22f4fe;_0x409eb8=0xc8;}else{_0x409eb8=0xce;}_0x3cb286[_0x2008('0x15')](_0x409eb8);return _0x3cb286[_0x2008('0x1b')](_0x2008('0x1c'),_0x90a85a+'-'+_0x354d5a+'/'+_0x22f4fe)[_0x2008('0x17')](_0x9b82fc);}return null;};}function patchUpdates(_0x4c08bf){return function(_0x4f2c40){try{jsonpatch[_0x2008('0x1d')](_0x4f2c40,_0x4c08bf,!![]);}catch(_0x375ee2){return BPromise[_0x2008('0x1e')](_0x375ee2);}return _0x4f2c40[_0x2008('0x1f')]();};}function saveUpdates(_0x369372,_0x437de0){return function(_0x5313df){if(_0x5313df){return _0x5313df[_0x2008('0x20')](_0x369372)[_0x2008('0x21')](function(_0x2850ae){return _0x2850ae;});}return null;};}function removeEntity(_0xeac1dc,_0x2aed54){return function(_0xaed62e){if(_0xaed62e){return _0xaed62e[_0x2008('0x22')]()[_0x2008('0x21')](function(){_0xeac1dc[_0x2008('0x15')](0xcc)[_0x2008('0x16')]();});}};}function handleEntityNotFound(_0x186679,_0x1bbd48){return function(_0x7108ac){if(!_0x7108ac){_0x186679[_0x2008('0x23')](0x194);}return _0x7108ac;};}function handleError(_0x46a7e5,_0x45996e){_0x45996e=_0x45996e||0x1f4;return function(_0x356583){logger[_0x2008('0x24')](_0x356583[_0x2008('0x25')]);if(_0x356583[_0x2008('0x26')]){delete _0x356583[_0x2008('0x26')];}_0x46a7e5[_0x2008('0x15')](_0x45996e)['send'](_0x356583);};}exports[_0x2008('0x27')]=function(_0x3c04e7,_0x1a418d){var _0x9c7c35={},_0x24a87d={},_0xea306a={'count':0x0,'rows':[]};var _0x59c22c=_['map'](db[_0x2008('0x28')]['rawAttributes'],function(_0x53974d){return{'name':_0x53974d['fieldName'],'type':_0x53974d[_0x2008('0x29')][_0x2008('0x2a')]};});_0x24a87d[_0x2008('0x2b')]=_[_0x2008('0x2c')](_0x59c22c,'name');_0x24a87d[_0x2008('0x2d')]=_[_0x2008('0x2e')](_0x3c04e7[_0x2008('0x2d')]);_0x24a87d[_0x2008('0x2f')]=_[_0x2008('0x30')](_0x24a87d['model'],_0x24a87d[_0x2008('0x2d')]);_0x9c7c35['attributes']=_[_0x2008('0x30')](_0x24a87d['model'],qs['fields'](_0x3c04e7['query'][_0x2008('0x31')]));_0x9c7c35['attributes']=_0x9c7c35[_0x2008('0x32')][_0x2008('0x33')]?_0x9c7c35[_0x2008('0x32')]:_0x24a87d[_0x2008('0x2b')];if(!_0x3c04e7[_0x2008('0x2d')]['hasOwnProperty'](_0x2008('0x34'))){_0x9c7c35[_0x2008('0x1a')]=qs[_0x2008('0x1a')](_0x3c04e7[_0x2008('0x2d')][_0x2008('0x1a')]);_0x9c7c35[_0x2008('0x18')]=qs[_0x2008('0x18')](_0x3c04e7[_0x2008('0x2d')][_0x2008('0x18')]);}_0x9c7c35[_0x2008('0x35')]=qs[_0x2008('0x36')](_0x3c04e7[_0x2008('0x2d')][_0x2008('0x36')]);_0x9c7c35['where']=qs[_0x2008('0x2f')](_[_0x2008('0x37')](_0x3c04e7[_0x2008('0x2d')],_0x24a87d[_0x2008('0x2f')]),_0x59c22c);if(_0x3c04e7[_0x2008('0x2d')][_0x2008('0x38')]){_0x9c7c35[_0x2008('0x39')]=_[_0x2008('0x3a')](_0x9c7c35[_0x2008('0x39')],{'$or':_['map'](_0x59c22c,function(_0x1d57c7){if(_0x1d57c7['type']!==_0x2008('0x3b')){var _0x2a28e1={};_0x2a28e1[_0x1d57c7[_0x2008('0x26')]]={'$like':'%'+_0x3c04e7[_0x2008('0x2d')][_0x2008('0x38')]+'%'};return _0x2a28e1;}})});}_0x9c7c35=_[_0x2008('0x3a')]({},_0x9c7c35,_0x3c04e7['options']);var _0x5b1a28={'where':_0x9c7c35[_0x2008('0x39')]};return db['Automation']['count'](_0x5b1a28)[_0x2008('0x21')](function(_0x25c855){_0xea306a['count']=_0x25c855;if(_0x3c04e7['query'][_0x2008('0x3c')]){_0x9c7c35[_0x2008('0x3d')]=[{'all':!![]}];}return db[_0x2008('0x28')][_0x2008('0x3e')](_0x9c7c35);})[_0x2008('0x21')](function(_0x18061a){_0xea306a[_0x2008('0x3f')]=_0x18061a;return _0xea306a;})[_0x2008('0x21')](respondWithFilteredResult(_0x1a418d,_0x9c7c35))[_0x2008('0x40')](handleError(_0x1a418d,null));};exports[_0x2008('0x41')]=function(_0x5d0af7,_0x316017){var _0x274cfd={'raw':![],'where':{'id':_0x5d0af7['params']['id']}},_0x439ed0={};_0x439ed0[_0x2008('0x2b')]=_[_0x2008('0x2e')](db[_0x2008('0x28')]['rawAttributes']);_0x439ed0[_0x2008('0x2d')]=_[_0x2008('0x2e')](_0x5d0af7[_0x2008('0x2d')]);_0x439ed0[_0x2008('0x2f')]=_[_0x2008('0x30')](_0x439ed0[_0x2008('0x2b')],_0x439ed0[_0x2008('0x2d')]);_0x274cfd[_0x2008('0x32')]=_[_0x2008('0x30')](_0x439ed0['model'],qs[_0x2008('0x31')](_0x5d0af7['query']['fields']));_0x274cfd[_0x2008('0x32')]=_0x274cfd[_0x2008('0x32')][_0x2008('0x33')]?_0x274cfd[_0x2008('0x32')]:_0x439ed0[_0x2008('0x2b')];if(_0x5d0af7[_0x2008('0x2d')][_0x2008('0x3c')]){_0x274cfd[_0x2008('0x3d')]=[{'all':!![]}];}_0x274cfd=_[_0x2008('0x3a')]({},_0x274cfd,_0x5d0af7[_0x2008('0x42')]);return db[_0x2008('0x28')]['find'](_0x274cfd)[_0x2008('0x21')](handleEntityNotFound(_0x316017,null))[_0x2008('0x21')](respondWithResult(_0x316017,null))[_0x2008('0x40')](handleError(_0x316017,null));};exports[_0x2008('0x43')]=function(_0x4a4754,_0x5f1681){return db[_0x2008('0x28')][_0x2008('0x43')](_0x4a4754[_0x2008('0x44')],{})['then'](respondWithResult(_0x5f1681,0xc9))[_0x2008('0x40')](handleError(_0x5f1681,null));};exports[_0x2008('0x20')]=function(_0xaebb54,_0x5769e3){if(_0xaebb54[_0x2008('0x44')]['id']){delete _0xaebb54[_0x2008('0x44')]['id'];}return db[_0x2008('0x28')][_0x2008('0x45')]({'where':{'id':_0xaebb54[_0x2008('0x46')]['id']}})[_0x2008('0x21')](handleEntityNotFound(_0x5769e3,null))[_0x2008('0x21')](saveUpdates(_0xaebb54[_0x2008('0x44')],null))[_0x2008('0x21')](respondWithResult(_0x5769e3,null))['catch'](handleError(_0x5769e3,null));};exports[_0x2008('0x22')]=function(_0x50b89a,_0x40bcc){return db[_0x2008('0x28')]['find']({'where':{'id':_0x50b89a[_0x2008('0x46')]['id']}})[_0x2008('0x21')](handleEntityNotFound(_0x40bcc,null))[_0x2008('0x21')](removeEntity(_0x40bcc,null))[_0x2008('0x40')](handleError(_0x40bcc,null));};exports[_0x2008('0x47')]=function(_0x2db791,_0x1f6e6c,_0x2ff88d){return db[_0x2008('0x48')][_0x2008('0x45')]({'where':{'id':_0x2db791[_0x2008('0x46')]['id']}})['then'](handleEntityNotFound(_0x1f6e6c,null))[_0x2008('0x21')](function(_0x432c0b){if(_0x432c0b){return _0x432c0b[_0x2008('0x47')](_0x2db791['body'][_0x2008('0x49')],_[_0x2008('0x4a')](_0x2db791[_0x2008('0x44')],['ids','id'])||{});}})[_0x2008('0x21')](respondWithResult(_0x1f6e6c,null))[_0x2008('0x40')](handleError(_0x1f6e6c,null));};exports[_0x2008('0x4b')]=function(_0x9c9be5,_0x3bf92d,_0x28368e){var _0x2c18a9={};var _0x2d1d7c={};var _0x157423;var _0x51ac1f;return db[_0x2008('0x28')]['findOne']({'where':{'id':_0x9c9be5[_0x2008('0x46')]['id']}})['then'](handleEntityNotFound(_0x3bf92d,null))[_0x2008('0x21')](function(_0x34025c){if(_0x34025c){_0x157423=_0x34025c;_0x2d1d7c[_0x2008('0x2b')]=_['keys'](db['Condition'][_0x2008('0x4c')]);_0x2d1d7c[_0x2008('0x2d')]=_[_0x2008('0x2e')](_0x9c9be5[_0x2008('0x2d')]);_0x2d1d7c[_0x2008('0x2f')]=_[_0x2008('0x30')](_0x2d1d7c[_0x2008('0x2b')],_0x2d1d7c['query']);_0x2c18a9[_0x2008('0x32')]=_['intersection'](_0x2d1d7c[_0x2008('0x2b')],qs[_0x2008('0x31')](_0x9c9be5[_0x2008('0x2d')]['fields']));_0x2c18a9['attributes']=_0x2c18a9[_0x2008('0x32')][_0x2008('0x33')]?_0x2c18a9[_0x2008('0x32')]:_0x2d1d7c[_0x2008('0x2b')];_0x2c18a9[_0x2008('0x35')]=qs['sort'](_0x9c9be5[_0x2008('0x2d')][_0x2008('0x36')]);_0x2c18a9[_0x2008('0x39')]=qs[_0x2008('0x2f')](_['pick'](_0x9c9be5[_0x2008('0x2d')],_0x2d1d7c[_0x2008('0x2f')]));if(_0x9c9be5[_0x2008('0x2d')]['filter']){_0x2c18a9[_0x2008('0x39')]=_[_0x2008('0x3a')](_0x2c18a9[_0x2008('0x39')],{'$or':_[_0x2008('0x2c')](_0x2c18a9[_0x2008('0x32')],function(_0x46191e){var _0x510229={};_0x510229[_0x46191e]={'$like':'%'+_0x9c9be5[_0x2008('0x2d')]['filter']+'%'};return _0x510229;})});}_0x2c18a9=_[_0x2008('0x3a')]({},_0x2c18a9,_0x9c9be5[_0x2008('0x42')]);return _0x157423[_0x2008('0x4b')](_0x2c18a9);}})[_0x2008('0x21')](function(_0x27e602){if(_0x27e602){_0x51ac1f=_0x27e602[_0x2008('0x33')];if(!_0x9c9be5[_0x2008('0x2d')][_0x2008('0x4d')](_0x2008('0x34'))){_0x2c18a9[_0x2008('0x1a')]=qs[_0x2008('0x1a')](_0x9c9be5[_0x2008('0x2d')]['limit']);_0x2c18a9[_0x2008('0x18')]=qs[_0x2008('0x18')](_0x9c9be5[_0x2008('0x2d')][_0x2008('0x18')]);}return _0x157423[_0x2008('0x4b')](_0x2c18a9);}})[_0x2008('0x21')](function(_0x898cc6){if(_0x898cc6){return _0x898cc6?{'count':_0x51ac1f,'rows':_0x898cc6}:null;}})[_0x2008('0x21')](respondWithResult(_0x3bf92d,null))[_0x2008('0x40')](handleError(_0x3bf92d,null));};exports[_0x2008('0x4e')]=function(_0x425a03,_0x3b6307,_0x3f1ca8){return db[_0x2008('0x4f')][_0x2008('0x45')]({'where':{'id':_0x425a03[_0x2008('0x46')]['id']}})[_0x2008('0x21')](handleEntityNotFound(_0x3b6307,null))[_0x2008('0x21')](function(_0x3340fa){if(_0x3340fa){return _0x3340fa[_0x2008('0x4e')](_0x425a03[_0x2008('0x44')][_0x2008('0x49')],_['omit'](_0x425a03[_0x2008('0x44')],['ids','id'])||{});}})[_0x2008('0x21')](respondWithResult(_0x3b6307,null))[_0x2008('0x40')](handleError(_0x3b6307,null));};exports[_0x2008('0x50')]=function(_0x4f52c5,_0x451a5b,_0x2bb427){var _0x5c70cd={};var _0x59b3b7={};var _0x1b8bfb;var _0x33da45;return db[_0x2008('0x28')][_0x2008('0x51')]({'where':{'id':_0x4f52c5['params']['id']}})['then'](handleEntityNotFound(_0x451a5b,null))[_0x2008('0x21')](function(_0x5c064f){if(_0x5c064f){_0x1b8bfb=_0x5c064f;_0x59b3b7[_0x2008('0x2b')]=_[_0x2008('0x2e')](db[_0x2008('0x4f')][_0x2008('0x4c')]);_0x59b3b7['query']=_[_0x2008('0x2e')](_0x4f52c5['query']);_0x59b3b7[_0x2008('0x2f')]=_['intersection'](_0x59b3b7[_0x2008('0x2b')],_0x59b3b7[_0x2008('0x2d')]);_0x5c70cd[_0x2008('0x32')]=_[_0x2008('0x30')](_0x59b3b7[_0x2008('0x2b')],qs[_0x2008('0x31')](_0x4f52c5[_0x2008('0x2d')]['fields']));_0x5c70cd[_0x2008('0x32')]=_0x5c70cd['attributes'][_0x2008('0x33')]?_0x5c70cd[_0x2008('0x32')]:_0x59b3b7[_0x2008('0x2b')];_0x5c70cd[_0x2008('0x35')]=qs[_0x2008('0x36')](_0x4f52c5[_0x2008('0x2d')]['sort']);_0x5c70cd[_0x2008('0x39')]=qs[_0x2008('0x2f')](_[_0x2008('0x37')](_0x4f52c5[_0x2008('0x2d')],_0x59b3b7[_0x2008('0x2f')]));if(_0x4f52c5['query']['filter']){_0x5c70cd[_0x2008('0x39')]=_[_0x2008('0x3a')](_0x5c70cd[_0x2008('0x39')],{'$or':_['map'](_0x5c70cd[_0x2008('0x32')],function(_0x13e8be){var _0x530d60={};_0x530d60[_0x13e8be]={'$like':'%'+_0x4f52c5['query'][_0x2008('0x38')]+'%'};return _0x530d60;})});}_0x5c70cd=_[_0x2008('0x3a')]({},_0x5c70cd,_0x4f52c5[_0x2008('0x42')]);return _0x1b8bfb[_0x2008('0x50')](_0x5c70cd);}})[_0x2008('0x21')](function(_0x4acf8c){if(_0x4acf8c){_0x33da45=_0x4acf8c[_0x2008('0x33')];if(!_0x4f52c5[_0x2008('0x2d')][_0x2008('0x4d')]('nolimit')){_0x5c70cd[_0x2008('0x1a')]=qs['limit'](_0x4f52c5[_0x2008('0x2d')]['limit']);_0x5c70cd[_0x2008('0x18')]=qs[_0x2008('0x18')](_0x4f52c5[_0x2008('0x2d')][_0x2008('0x18')]);}return _0x1b8bfb[_0x2008('0x50')](_0x5c70cd);}})[_0x2008('0x21')](function(_0x14ba3e){if(_0x14ba3e){return _0x14ba3e?{'count':_0x33da45,'rows':_0x14ba3e}:null;}})[_0x2008('0x21')](respondWithResult(_0x451a5b,null))['catch'](handleError(_0x451a5b,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index f04e0ef..291c86d 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 _0x4dba=['api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','Automation','tools_automations','lodash','util','../../config/logger'];(function(_0x330d27,_0x177c38){var _0x1ac997=function(_0x1d1063){while(--_0x1d1063){_0x330d27['push'](_0x330d27['shift']());}};_0x1ac997(++_0x177c38);}(_0x4dba,0x101));var _0xa4db=function(_0x32cc18,_0x32386d){_0x32cc18=_0x32cc18-0x0;var _0xba597e=_0x4dba[_0x32cc18];return _0xba597e;};'use strict';var _=require(_0xa4db('0x0'));var util=require(_0xa4db('0x1'));var logger=require(_0xa4db('0x2'))(_0xa4db('0x3'));var moment=require(_0xa4db('0x4'));var BPromise=require(_0xa4db('0x5'));var rp=require(_0xa4db('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa4db('0x7'));var config=require(_0xa4db('0x8'));var attributes=require('./automation.attributes');module[_0xa4db('0x9')]=function(_0x125583,_0x1811ac){return _0x125583[_0xa4db('0xa')](_0xa4db('0xb'),attributes,{'tableName':_0xa4db('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x50e2=['api','moment','bluebird','path','rimraf','exports','define','Automation','tools_automations','lodash','util'];(function(_0x2e1095,_0x3a7d94){var _0x3b2455=function(_0x1e1092){while(--_0x1e1092){_0x2e1095['push'](_0x2e1095['shift']());}};_0x3b2455(++_0x3a7d94);}(_0x50e2,0x148));var _0x250e=function(_0x28edf8,_0x3ab79f){_0x28edf8=_0x28edf8-0x0;var _0xb0bbba=_0x50e2[_0x28edf8];return _0xb0bbba;};'use strict';var _=require(_0x250e('0x0'));var util=require(_0x250e('0x1'));var logger=require('../../config/logger')(_0x250e('0x2'));var moment=require(_0x250e('0x3'));var BPromise=require(_0x250e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x250e('0x5'));var rimraf=require(_0x250e('0x6'));var config=require('../../config/environment');var attributes=require('./automation.attributes');module[_0x250e('0x7')]=function(_0x372179,_0x40079b){return _0x372179[_0x250e('0x8')](_0x250e('0x9'),attributes,{'tableName':_0x250e('0xa'),'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 af6ae32..ecb035d 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 _0xa5c9=['util','moment','bluebird','../../mysqldb','../../config/utils','jayson/promise','client','http','request','info','Automation,\x20%s,\x20%s','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','lodash'];(function(_0x35b148,_0x26f36a){var _0x11c0b3=function(_0x77225b){while(--_0x77225b){_0x35b148['push'](_0x35b148['shift']());}};_0x11c0b3(++_0x26f36a);}(_0xa5c9,0x143));var _0x9a5c=function(_0x1dbaf7,_0x3d05b3){_0x1dbaf7=_0x1dbaf7-0x0;var _0x593f05=_0xa5c9[_0x1dbaf7];return _0x593f05;};'use strict';var _=require(_0x9a5c('0x0'));var util=require(_0x9a5c('0x1'));var moment=require(_0x9a5c('0x2'));var BPromise=require(_0x9a5c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9a5c('0x4'))['db'];var utils=require(_0x9a5c('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x9a5c('0x6'));var client=jayson[_0x9a5c('0x7')][_0x9a5c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3bb6f2,_0x594e67,_0x8de4e9){return new BPromise(function(_0x4ea491,_0xc96c1c){return client[_0x9a5c('0x9')](_0x3bb6f2,_0x8de4e9)['then'](function(_0x127932){logger[_0x9a5c('0xa')](_0x9a5c('0xb'),_0x594e67,'request\x20sent');logger['debug'](_0x9a5c('0xc'),_0x594e67,_0x9a5c('0xd'),JSON[_0x9a5c('0xe')](_0x127932));if(_0x127932[_0x9a5c('0xf')]){if(_0x127932[_0x9a5c('0xf')][_0x9a5c('0x10')]===0x1f4){logger[_0x9a5c('0xf')](_0x9a5c('0xb'),_0x594e67,_0x127932[_0x9a5c('0xf')][_0x9a5c('0x11')]);return _0xc96c1c(_0x127932[_0x9a5c('0xf')][_0x9a5c('0x11')]);}logger['error'](_0x9a5c('0xb'),_0x594e67,_0x127932[_0x9a5c('0xf')][_0x9a5c('0x11')]);return _0x4ea491(_0x127932['error'][_0x9a5c('0x11')]);}else{logger[_0x9a5c('0xa')]('Automation,\x20%s,\x20%s',_0x594e67,_0x9a5c('0xd'));_0x4ea491(_0x127932['result'][_0x9a5c('0x11')]);}})['catch'](function(_0x29d3cd){logger[_0x9a5c('0xf')]('Automation,\x20%s,\x20%s',_0x594e67,_0x29d3cd);_0xc96c1c(_0x29d3cd);});});} \ No newline at end of file +var _0x7df3=['bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','Automation,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util'];(function(_0x2673c5,_0x15d7ce){var _0x38498b=function(_0x3be856){while(--_0x3be856){_0x2673c5['push'](_0x2673c5['shift']());}};_0x38498b(++_0x15d7ce);}(_0x7df3,0x1cc));var _0x37df=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x7df3[_0x297fd3];return _0x2af381;};'use strict';var _=require(_0x37df('0x0'));var util=require(_0x37df('0x1'));var moment=require('moment');var BPromise=require(_0x37df('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x37df('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x37df('0x4'));var logger=require('../../config/logger')(_0x37df('0x5'));var config=require(_0x37df('0x6'));var jayson=require(_0x37df('0x7'));var client=jayson[_0x37df('0x8')][_0x37df('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x773cbe,_0x579adf,_0x56eca4){return new BPromise(function(_0x559bb3,_0x2d9c06){return client[_0x37df('0xa')](_0x773cbe,_0x56eca4)[_0x37df('0xb')](function(_0x22b79a){logger['info'](_0x37df('0xc'),_0x579adf,_0x37df('0xd'));logger[_0x37df('0xe')]('Automation,\x20%s,\x20%s,\x20%s',_0x579adf,_0x37df('0xd'),JSON[_0x37df('0xf')](_0x22b79a));if(_0x22b79a[_0x37df('0x10')]){if(_0x22b79a['error'][_0x37df('0x11')]===0x1f4){logger[_0x37df('0x10')](_0x37df('0xc'),_0x579adf,_0x22b79a[_0x37df('0x10')][_0x37df('0x12')]);return _0x2d9c06(_0x22b79a['error'][_0x37df('0x12')]);}logger[_0x37df('0x10')](_0x37df('0xc'),_0x579adf,_0x22b79a['error'][_0x37df('0x12')]);return _0x559bb3(_0x22b79a[_0x37df('0x10')]['message']);}else{logger['info']('Automation,\x20%s,\x20%s',_0x579adf,_0x37df('0xd'));_0x559bb3(_0x22b79a[_0x37df('0x13')][_0x37df('0x12')]);}})[_0x37df('0x14')](function(_0x2495ea){logger[_0x37df('0x10')](_0x37df('0xc'),_0x579adf,_0x2495ea);_0x2d9c06(_0x2495ea);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index a689f9f..7e6b91f 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 _0xf822=['addConditions','addActions','put','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./automation.controller','get','index','/:id','isAuthenticated','show','/:id/conditions','/:id/actions','getActions','post'];(function(_0x548483,_0x5e53ab){var _0x53afbd=function(_0x4c9f9c){while(--_0x4c9f9c){_0x548483['push'](_0x548483['shift']());}};_0x53afbd(++_0x5e53ab);}(_0xf822,0x19e));var _0x2f82=function(_0x2fc1ba,_0x5c4f1c){_0x2fc1ba=_0x2fc1ba-0x0;var _0x110364=_0xf822[_0x2fc1ba];return _0x110364;};'use strict';var multer=require(_0x2f82('0x0'));var util=require('util');var path=require(_0x2f82('0x1'));var timeout=require(_0x2f82('0x2'));var express=require(_0x2f82('0x3'));var router=express[_0x2f82('0x4')]();var fs_extra=require(_0x2f82('0x5'));var auth=require(_0x2f82('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2f82('0x7'));var controller=require(_0x2f82('0x8'));router[_0x2f82('0x9')]('/',auth['isAuthenticated'](),controller[_0x2f82('0xa')]);router['get'](_0x2f82('0xb'),auth[_0x2f82('0xc')](),controller[_0x2f82('0xd')]);router[_0x2f82('0x9')](_0x2f82('0xe'),auth[_0x2f82('0xc')](),controller['getConditions']);router[_0x2f82('0x9')](_0x2f82('0xf'),auth[_0x2f82('0xc')](),controller[_0x2f82('0x10')]);router[_0x2f82('0x11')]('/',auth[_0x2f82('0xc')](),controller['create']);router['post'](_0x2f82('0xe'),auth[_0x2f82('0xc')](),controller[_0x2f82('0x12')]);router[_0x2f82('0x11')]('/:id/actions',auth['isAuthenticated'](),controller[_0x2f82('0x13')]);router[_0x2f82('0x14')](_0x2f82('0xb'),auth['isAuthenticated'](),controller[_0x2f82('0x15')]);router[_0x2f82('0x16')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x2f82('0x17')]=router; \ No newline at end of file +var _0xac8d=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/actions','getActions','post','create','/:id/conditions','addConditions','put','update','delete','exports','multer','util','path'];(function(_0x29113f,_0x2fb25a){var _0x3e2009=function(_0x4183eb){while(--_0x4183eb){_0x29113f['push'](_0x29113f['shift']());}};_0x3e2009(++_0x2fb25a);}(_0xac8d,0x1d8));var _0xdac8=function(_0x198f6a,_0x46445b){_0x198f6a=_0x198f6a-0x0;var _0x2947f6=_0xac8d[_0x198f6a];return _0x2947f6;};'use strict';var multer=require(_0xdac8('0x0'));var util=require(_0xdac8('0x1'));var path=require(_0xdac8('0x2'));var timeout=require(_0xdac8('0x3'));var express=require(_0xdac8('0x4'));var router=express[_0xdac8('0x5')]();var fs_extra=require(_0xdac8('0x6'));var auth=require(_0xdac8('0x7'));var interaction=require(_0xdac8('0x8'));var config=require('../../config/environment');var controller=require(_0xdac8('0x9'));router[_0xdac8('0xa')]('/',auth[_0xdac8('0xb')](),controller[_0xdac8('0xc')]);router[_0xdac8('0xa')](_0xdac8('0xd'),auth[_0xdac8('0xb')](),controller[_0xdac8('0xe')]);router[_0xdac8('0xa')]('/:id/conditions',auth[_0xdac8('0xb')](),controller['getConditions']);router[_0xdac8('0xa')](_0xdac8('0xf'),auth[_0xdac8('0xb')](),controller[_0xdac8('0x10')]);router[_0xdac8('0x11')]('/',auth['isAuthenticated'](),controller[_0xdac8('0x12')]);router['post'](_0xdac8('0x13'),auth[_0xdac8('0xb')](),controller[_0xdac8('0x14')]);router['post'](_0xdac8('0xf'),auth['isAuthenticated'](),controller['addActions']);router[_0xdac8('0x15')]('/:id',auth[_0xdac8('0xb')](),controller[_0xdac8('0x16')]);router[_0xdac8('0x17')](_0xdac8('0xd'),auth[_0xdac8('0xb')](),controller['destroy']);module[_0xdac8('0x18')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 9e120cc..e396b87 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 _0x0290=['Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Between\x20Words\x20Silence','#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\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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','name','ENUM','ivr','STRING','BOOLEAN'];(function(_0x49f87a,_0x27f66c){var _0x4296da=function(_0x5df5e5){while(--_0x5df5e5){_0x49f87a['push'](_0x49f87a['shift']());}};_0x4296da(++_0x27f66c);}(_0x0290,0x157));var _0x0029=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x0290[_0x2dea24];return _0x309d58;};'use strict';var Sequelize=require(_0x0029('0x0'));module[_0x0029('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x0029('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x0029('0x3')](_0x0029('0x4')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x0029('0x5')]},'active':{'type':Sequelize[_0x0029('0x6')],'defaultValue':0x0,'comment':_0x0029('0x7')},'limitCalls':{'type':Sequelize[_0x0029('0x8')](0x4)[_0x0029('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x0029('0xa')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x0029('0x5')]},'dialOriginateTimeout':{'type':Sequelize[_0x0029('0x8')](0x3)[_0x0029('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0029('0xb')},'dialCongestionMaxRetry':{'type':Sequelize[_0x0029('0x8')](0x3)[_0x0029('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0029('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0029('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0x0029('0x8')](0x3)[_0x0029('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x0029('0x8')](0x5)[_0x0029('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x0029('0x8')](0x3)[_0x0029('0x9')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x0029('0x8')](0x5)[_0x0029('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0029('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0x0029('0x8')](0x3)[_0x0029('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x0029('0x5')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x0029('0x3')](_0x0029('0xe'),_0x0029('0xf'),_0x0029('0x10')),'defaultValue':_0x0029('0xe')},'dialAMDActive':{'type':Sequelize[_0x0029('0x6')],'defaultValue':0x0,'comment':_0x0029('0x11')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x0029('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x0029('0x12')},'dialAMDGreeting':{'type':Sequelize[_0x0029('0x8')](0x9)[_0x0029('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0029('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0029('0x8')](0x9)[_0x0029('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0029('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0029('0x8')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x0029('0x8')](0x9)[_0x0029('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x0029('0x8')](0x9)[_0x0029('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x0029('0x15')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x0029('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x0029('0x16')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x0029('0x8')](0x5)[_0x0029('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x0029('0x17')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x0029('0x8')](0x9)[_0x0029('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0029('0x18')},'dialOrderByScheduledAt':{'type':Sequelize[_0x0029('0x3')](_0x0029('0x19'),_0x0029('0x1a')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x0029('0x5')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x0029('0x8')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x0029('0x8')](0x3)[_0x0029('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0029('0x1b')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x0029('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0029('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x0029('0x8')](0x5)[_0x0029('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x0029('0x8')](0x3)[_0x0029('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x0029('0x8')](0x5)[_0x0029('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0029('0x1d')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x0029('0x8')](0x3)[_0x0029('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0029('0x1e')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0029('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0029('0x1f')},'dialMachineMaxRetry':{'type':Sequelize[_0x0029('0x8')](0x3)[_0x0029('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x0029('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0029('0x20')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x0029('0x8')](0x3)[_0x0029('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0029('0x21')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0029('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0029('0x22')}}; \ No newline at end of file +var _0x78cb=['NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'];(function(_0x199939,_0x3d3cb9){var _0x1522b6=function(_0x28fe8a){while(--_0x28fe8a){_0x199939['push'](_0x199939['shift']());}};_0x1522b6(++_0x3d3cb9);}(_0x78cb,0x9e));var _0xb78c=function(_0x2e7e6f,_0x170a39){_0x2e7e6f=_0x2e7e6f-0x0;var _0x3d890c=_0x78cb[_0x2e7e6f];return _0x3d890c;};'use strict';var Sequelize=require(_0xb78c('0x0'));module[_0xb78c('0x1')]={'name':{'type':Sequelize[_0xb78c('0x2')],'unique':_0xb78c('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xb78c('0x4')](_0xb78c('0x5')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xb78c('0x6')],'defaultValue':0x0,'comment':_0xb78c('0x7')},'limitCalls':{'type':Sequelize[_0xb78c('0x8')](0x4)[_0xb78c('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xb78c('0xa')},'dialOriginateCallerIdName':{'type':Sequelize[_0xb78c('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xb78c('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xb78c('0x8')](0x3)[_0xb78c('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xb78c('0x8')](0x3)[_0xb78c('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb78c('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xb78c('0x8')](0x5)[_0xb78c('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb78c('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0xb78c('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb78c('0xd')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xb78c('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb78c('0xe')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xb78c('0x9')],'defaultValue':0x3,'comment':_0xb78c('0xf')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xb78c('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb78c('0x10')},'dialGlobalMaxRetry':{'type':Sequelize[_0xb78c('0x8')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xb78c('0x11')},'dialTimezone':{'type':Sequelize[_0xb78c('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xb78c('0x2')],'defaultValue':_0xb78c('0x12')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xb78c('0x13'),_0xb78c('0x14'),_0xb78c('0x15')),'defaultValue':_0xb78c('0x13')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xb78c('0x8')](0x9)[_0xb78c('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xb78c('0x16')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xb78c('0x17')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xb78c('0x8')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xb78c('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xb78c('0x18')},'dialAMDMinWordLength':{'type':Sequelize[_0xb78c('0x8')](0x9)[_0xb78c('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xb78c('0x19')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xb78c('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xb78c('0x1a')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xb78c('0x8')](0x9)[_0xb78c('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xb78c('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xb78c('0x1b')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xb78c('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xb78c('0x1c'),_0xb78c('0x1d')),'defaultValue':_0xb78c('0x1c')},'dialPrefix':{'type':Sequelize[_0xb78c('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xb78c('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb78c('0x1e')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xb78c('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xb78c('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb78c('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xb78c('0x8')](0x5)[_0xb78c('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb78c('0x20')},'dialDropMaxRetry':{'type':Sequelize[_0xb78c('0x8')](0x3)[_0xb78c('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb78c('0x21')},'dialDropRetryFrequency':{'type':Sequelize[_0xb78c('0x8')](0x5)[_0xb78c('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb78c('0x22')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xb78c('0x8')](0x3)[_0xb78c('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb78c('0x23')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xb78c('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0xb78c('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb78c('0x24')},'dialMachineRetryFrequency':{'type':Sequelize[_0xb78c('0x8')](0x5)[_0xb78c('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb78c('0x25')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xb78c('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xb78c('0x8')](0x5)[_0xb78c('0x9')],'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 fc74396..ffb0cfa 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 _0x0135=['stack','name','send','index','map','Campaign','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','catch','show','params','length','include','find','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','getHoppers','findOne','rawAttributes','CampaignId','CmHopper','findAll','rows','getHopperHistories','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','ids','spread','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','select','phone','field','NOW()','toString','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','CampaignId\x20=\x20?','onlyIfOpen','cm_contacts','COALESCE(phone,\x27\x27)','cm_hopper_additional_phones','cmHopperId','h.id','ci.OrderBY','OrderBy','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','YYYY-MM-DD\x20HH:mm:ss','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','mustache','path','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','Content-Range','apply','reject','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','sendStatus','error'];(function(_0x28bfdc,_0x50fd27){var _0x25bf45=function(_0x17f94a){while(--_0x17f94a){_0x28bfdc['push'](_0x28bfdc['shift']());}};_0x25bf45(++_0x50fd27);}(_0x0135,0x188));var _0x5013=function(_0x34e33d,_0x46748b){_0x34e33d=_0x34e33d-0x0;var _0x488d61=_0x0135[_0x34e33d];return _0x488d61;};'use strict';var emlformat=require(_0x5013('0x0'));var rimraf=require(_0x5013('0x1'));var zipdir=require(_0x5013('0x2'));var jsonpatch=require(_0x5013('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5013('0x4'));var util=require('util');var path=require(_0x5013('0x5'));var sox=require('sox');var csv=require(_0x5013('0x6'));var ejs=require(_0x5013('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x5013('0x8'));var jsforce=require(_0x5013('0x9'));var deskjs=require(_0x5013('0xa'));var toCsv=require(_0x5013('0x6'));var querystring=require(_0x5013('0xb'));var Papa=require(_0x5013('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5013('0xd'));var hardwareService=require(_0x5013('0xe'));var logger=require(_0x5013('0xf'))(_0x5013('0x10'));var utils=require('../../config/utils');var config=require(_0x5013('0x11'));var licenseUtil=require(_0x5013('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x7331b2,_0x4e7820){_0x4e7820=_0x4e7820||0xcc;return function(_0x28b75e){if(_0x28b75e){return _0x7331b2['sendStatus'](_0x4e7820);}return _0x7331b2[_0x5013('0x13')](_0x4e7820)[_0x5013('0x14')]();};}function respondWithResult(_0x10a237,_0x3b6e1c){_0x3b6e1c=_0x3b6e1c||0xc8;return function(_0x3bdf65){if(_0x3bdf65){return _0x10a237[_0x5013('0x13')](_0x3b6e1c)[_0x5013('0x15')](_0x3bdf65);}};}function respondWithFilteredResult(_0x47032e,_0x115869){return function(_0x2033ae){if(_0x2033ae){var _0x10442f=typeof _0x115869[_0x5013('0x16')]===_0x5013('0x17')&&typeof _0x115869['limit']===_0x5013('0x17');var _0x534765=_0x2033ae['count'];var _0x9b85ab=_0x10442f?0x0:_0x115869['offset'];var _0xb1ecd2=_0x10442f?_0x2033ae[_0x5013('0x18')]:_0x115869['offset']+_0x115869['limit'];var _0x500291;if(_0xb1ecd2>=_0x534765){_0xb1ecd2=_0x534765;_0x500291=0xc8;}else{_0x500291=0xce;}_0x47032e[_0x5013('0x13')](_0x500291);return _0x47032e['set'](_0x5013('0x19'),_0x9b85ab+'-'+_0xb1ecd2+'/'+_0x534765)['json'](_0x2033ae);}return null;};}function patchUpdates(_0x2972cd){return function(_0x20dfc9){try{jsonpatch[_0x5013('0x1a')](_0x20dfc9,_0x2972cd,!![]);}catch(_0x52f57d){return BPromise[_0x5013('0x1b')](_0x52f57d);}return _0x20dfc9[_0x5013('0x1c')]();};}function saveUpdates(_0x25f38c,_0x2c98d1){return function(_0x3f7d0d){if(_0x3f7d0d){return _0x3f7d0d[_0x5013('0x1d')](_0x25f38c)[_0x5013('0x1e')](function(_0x24e1cb){return _0x24e1cb;});}return null;};}function removeEntity(_0x46b7b4,_0x134546){return function(_0x4efc48){if(_0x4efc48){return _0x4efc48[_0x5013('0x1f')]()[_0x5013('0x1e')](function(){var _0x1b3c38=_0x4efc48[_0x5013('0x20')]({'plain':!![]});var _0x7110e2=_0x5013('0x21');return db[_0x5013('0x22')][_0x5013('0x1f')]({'where':{'type':_0x7110e2,'resourceId':_0x1b3c38['id']}})[_0x5013('0x1e')](function(){return _0x4efc48;});})[_0x5013('0x1e')](function(){_0x46b7b4[_0x5013('0x13')](0xcc)[_0x5013('0x14')]();});}};}function handleEntityNotFound(_0x383f51,_0x2e81a8){return function(_0x1694a7){if(!_0x1694a7){_0x383f51[_0x5013('0x23')](0x194);}return _0x1694a7;};}function handleError(_0x2bee7c,_0x14d4a5){_0x14d4a5=_0x14d4a5||0x1f4;return function(_0x2744d6){logger[_0x5013('0x24')](_0x2744d6[_0x5013('0x25')]);if(_0x2744d6[_0x5013('0x26')]){delete _0x2744d6['name'];}_0x2bee7c[_0x5013('0x13')](_0x14d4a5)[_0x5013('0x27')](_0x2744d6);};}exports[_0x5013('0x28')]=function(_0x58005e,_0x19feae){var _0x247563={},_0x593187={},_0xf0bb84={'count':0x0,'rows':[]};var _0x5f2eec=_[_0x5013('0x29')](db[_0x5013('0x2a')]['rawAttributes'],function(_0x4e5e3b){return{'name':_0x4e5e3b[_0x5013('0x2b')],'type':_0x4e5e3b[_0x5013('0x2c')][_0x5013('0x2d')]};});_0x593187['model']=_[_0x5013('0x29')](_0x5f2eec,_0x5013('0x26'));_0x593187[_0x5013('0x2e')]=_[_0x5013('0x2f')](_0x58005e['query']);_0x593187[_0x5013('0x30')]=_[_0x5013('0x31')](_0x593187[_0x5013('0x32')],_0x593187[_0x5013('0x2e')]);_0x247563[_0x5013('0x33')]=_[_0x5013('0x31')](_0x593187[_0x5013('0x32')],qs[_0x5013('0x34')](_0x58005e[_0x5013('0x2e')][_0x5013('0x34')]));_0x247563[_0x5013('0x33')]=_0x247563[_0x5013('0x33')]['length']?_0x247563[_0x5013('0x33')]:_0x593187[_0x5013('0x32')];if(!_0x58005e[_0x5013('0x2e')][_0x5013('0x35')](_0x5013('0x36'))){_0x247563[_0x5013('0x37')]=qs[_0x5013('0x37')](_0x58005e[_0x5013('0x2e')][_0x5013('0x37')]);_0x247563[_0x5013('0x16')]=qs[_0x5013('0x16')](_0x58005e[_0x5013('0x2e')][_0x5013('0x16')]);}_0x247563[_0x5013('0x38')]=qs[_0x5013('0x39')](_0x58005e[_0x5013('0x2e')]['sort']);_0x247563[_0x5013('0x3a')]=qs[_0x5013('0x30')](_[_0x5013('0x3b')](_0x58005e[_0x5013('0x2e')],_0x593187['filters']),_0x5f2eec);if(_0x58005e[_0x5013('0x2e')][_0x5013('0x3c')]){_0x247563[_0x5013('0x3a')]=_[_0x5013('0x3d')](_0x247563[_0x5013('0x3a')],{'$or':_[_0x5013('0x29')](_0x5f2eec,function(_0x35a7b5){if(_0x35a7b5['type']!==_0x5013('0x3e')){var _0x315318={};_0x315318[_0x35a7b5['name']]={'$like':'%'+_0x58005e['query'][_0x5013('0x3c')]+'%'};return _0x315318;}})});}_0x247563=_[_0x5013('0x3d')]({},_0x247563,_0x58005e[_0x5013('0x3f')]);var _0x4c14ac={'where':_0x247563[_0x5013('0x3a')]};return db[_0x5013('0x2a')][_0x5013('0x18')](_0x4c14ac)['then'](function(_0x4ace76){_0xf0bb84[_0x5013('0x18')]=_0x4ace76;if(_0x58005e[_0x5013('0x2e')][_0x5013('0x40')]){_0x247563['include']=[{'all':!![]}];}return db['Campaign']['findAll'](_0x247563);})[_0x5013('0x1e')](function(_0x8f3fc5){_0xf0bb84['rows']=_0x8f3fc5;return _0xf0bb84;})['then'](respondWithFilteredResult(_0x19feae,_0x247563))[_0x5013('0x41')](handleError(_0x19feae,null));};exports[_0x5013('0x42')]=function(_0x186341,_0x4c9721){var _0x616ca5={'raw':![],'where':{'id':_0x186341[_0x5013('0x43')]['id']}},_0x4cc0c8={};_0x4cc0c8[_0x5013('0x32')]=_[_0x5013('0x2f')](db['Campaign']['rawAttributes']);_0x4cc0c8[_0x5013('0x2e')]=_[_0x5013('0x2f')](_0x186341['query']);_0x4cc0c8[_0x5013('0x30')]=_[_0x5013('0x31')](_0x4cc0c8[_0x5013('0x32')],_0x4cc0c8[_0x5013('0x2e')]);_0x616ca5[_0x5013('0x33')]=_['intersection'](_0x4cc0c8[_0x5013('0x32')],qs[_0x5013('0x34')](_0x186341[_0x5013('0x2e')]['fields']));_0x616ca5[_0x5013('0x33')]=_0x616ca5['attributes'][_0x5013('0x44')]?_0x616ca5[_0x5013('0x33')]:_0x4cc0c8['model'];if(_0x186341[_0x5013('0x2e')]['includeAll']){_0x616ca5[_0x5013('0x45')]=[{'all':!![]}];}_0x616ca5=_[_0x5013('0x3d')]({},_0x616ca5,_0x186341[_0x5013('0x3f')]);return db[_0x5013('0x2a')][_0x5013('0x46')](_0x616ca5)[_0x5013('0x1e')](handleEntityNotFound(_0x4c9721,null))[_0x5013('0x1e')](respondWithResult(_0x4c9721,null))['catch'](handleError(_0x4c9721,null));};exports['create']=function(_0x7d419a,_0x701674){return db[_0x5013('0x2a')][_0x5013('0x47')](_0x7d419a[_0x5013('0x48')],{})[_0x5013('0x1e')](function(_0x3593f7){var _0x241058=_0x7d419a['user'][_0x5013('0x20')]({'plain':!![]});if(!_0x241058)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x241058[_0x5013('0x49')]===_0x5013('0x4a')){var _0x3843ba=_0x3593f7['get']({'plain':!![]});var _0x5c6843=_0x5013('0x21');return db[_0x5013('0x4b')][_0x5013('0x46')]({'where':{'name':_0x5c6843,'userProfileId':_0x241058[_0x5013('0x4c')]},'raw':!![]})[_0x5013('0x1e')](function(_0x4893a1){if(_0x4893a1&&_0x4893a1[_0x5013('0x4d')]===0x0){return db[_0x5013('0x22')][_0x5013('0x47')]({'name':_0x3843ba['name'],'resourceId':_0x3843ba['id'],'type':_0x4893a1[_0x5013('0x26')],'sectionId':_0x4893a1['id']},{})[_0x5013('0x1e')](function(){return _0x3593f7;});}else{return _0x3593f7;}})[_0x5013('0x41')](function(_0x522541){logger[_0x5013('0x24')](_0x5013('0x4e'),_0x522541);throw _0x522541;});}return _0x3593f7;})[_0x5013('0x1e')](respondWithResult(_0x701674,0xc9))[_0x5013('0x41')](handleError(_0x701674,null));};exports[_0x5013('0x4f')]=function(_0x2f3233,_0x131998){var _0x55102b={'where':{'id':_0x2f3233['params']['id']}},_0xc6c233={};_0xc6c233[_0x5013('0x32')]=_[_0x5013('0x2f')](db['Campaign']['rawAttributes']);_0x55102b[_0x5013('0x33')]=_[_0x5013('0x31')](_0xc6c233[_0x5013('0x32')],qs[_0x5013('0x34')](_0x2f3233[_0x5013('0x2e')]['fields']));_0x55102b[_0x5013('0x33')]=_0x55102b[_0x5013('0x33')]['length']?_0x55102b['attributes']:_0xc6c233[_0x5013('0x32')];if(_0x2f3233[_0x5013('0x2e')][_0x5013('0x40')]){_0x55102b['include']=[{'all':!![]}];}_0x55102b=_[_0x5013('0x3d')]({},_0x55102b,_0x2f3233[_0x5013('0x3f')]);return db[_0x5013('0x2a')][_0x5013('0x46')](_0x55102b)[_0x5013('0x1e')](handleEntityNotFound(_0x131998,null))[_0x5013('0x1e')](function(_0x5a6251){if(_0x5a6251){var _0x206c18=_0x5a6251[_0x5013('0x20')]({'plain':!![]});_0x206c18=qs[_0x5013('0x50')](_0x206c18,['id',_0x5013('0x51'),'updatedAt']);_0x2f3233[_0x5013('0x48')]=_[_0x5013('0x50')](_0x2f3233[_0x5013('0x48')],['id',_0x5013('0x51'),_0x5013('0x52')]);return db[_0x5013('0x2a')][_0x5013('0x47')](_['merge'](_0x206c18,_0x2f3233[_0x5013('0x48')]),{'include':_0x2f3233[_0x5013('0x2e')][_0x5013('0x40')]?[{'all':!![]}]:undefined})['then'](function(_0x18becb){var _0x1501b6=_0x2f3233[_0x5013('0x4a')][_0x5013('0x20')]({'plain':!![]});if(!_0x1501b6)throw new Error(_0x5013('0x53'));if(_0x1501b6[_0x5013('0x49')]==='user'){var _0x2b3ad7=_0x18becb[_0x5013('0x20')]({'plain':!![]});var _0x4e1c88=_0x5013('0x21');return db[_0x5013('0x4b')]['find']({'where':{'name':_0x4e1c88,'userProfileId':_0x1501b6['userProfileId']},'raw':!![]})[_0x5013('0x1e')](function(_0x18ad99){if(_0x18ad99&&_0x18ad99[_0x5013('0x4d')]===0x0){return db[_0x5013('0x22')][_0x5013('0x47')]({'name':_0x2b3ad7[_0x5013('0x26')],'resourceId':_0x2b3ad7['id'],'type':_0x18ad99[_0x5013('0x26')],'sectionId':_0x18ad99['id']},{})[_0x5013('0x1e')](function(){return _0x18becb;});}else{return _0x18becb;}})[_0x5013('0x41')](function(_0x143d9d){logger[_0x5013('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x143d9d);throw _0x143d9d;});}return _0x18becb;});}})[_0x5013('0x1e')](respondWithResult(_0x131998,0xc9))[_0x5013('0x41')](handleError(_0x131998,null));};exports['update']=function(_0x26c3a3,_0x51ccca){if(_0x26c3a3[_0x5013('0x48')]['id']){delete _0x26c3a3[_0x5013('0x48')]['id'];}return db[_0x5013('0x2a')][_0x5013('0x46')]({'where':{'id':_0x26c3a3[_0x5013('0x43')]['id']}})[_0x5013('0x1e')](handleEntityNotFound(_0x51ccca,null))[_0x5013('0x1e')](saveUpdates(_0x26c3a3[_0x5013('0x48')],null))[_0x5013('0x1e')](respondWithResult(_0x51ccca,null))['catch'](handleError(_0x51ccca,null));};exports[_0x5013('0x1f')]=function(_0x5e9f10,_0x181a02){return db[_0x5013('0x2a')][_0x5013('0x46')]({'where':{'id':_0x5e9f10[_0x5013('0x43')]['id']}})[_0x5013('0x1e')](handleEntityNotFound(_0x181a02,null))[_0x5013('0x1e')](removeEntity(_0x181a02,null))[_0x5013('0x41')](handleError(_0x181a02,null));};exports[_0x5013('0x54')]=function(_0x126da1,_0x277bf3,_0x42a9a2){var _0x5b3c7a={'raw':!![],'where':{}};var _0x2cc1bd={};var _0x2531c3={'count':0x0,'rows':[]};return db[_0x5013('0x2a')][_0x5013('0x55')]({'where':{'id':_0x126da1[_0x5013('0x43')]['id']}})[_0x5013('0x1e')](handleEntityNotFound(_0x277bf3,null))[_0x5013('0x1e')](function(_0x205c82){if(_0x205c82){_0x2cc1bd['model']=_[_0x5013('0x2f')](db['CmHopper'][_0x5013('0x56')]);_0x2cc1bd[_0x5013('0x2e')]=_[_0x5013('0x2f')](_0x126da1['query']);_0x2cc1bd[_0x5013('0x30')]=_[_0x5013('0x31')](_0x2cc1bd['model'],_0x2cc1bd['query']);_0x5b3c7a[_0x5013('0x33')]=_[_0x5013('0x31')](_0x2cc1bd[_0x5013('0x32')],qs[_0x5013('0x34')](_0x126da1[_0x5013('0x2e')]['fields']));_0x5b3c7a[_0x5013('0x33')]=_0x5b3c7a[_0x5013('0x33')]['length']?_0x5b3c7a[_0x5013('0x33')]:_0x2cc1bd[_0x5013('0x32')];if(!_0x126da1[_0x5013('0x2e')][_0x5013('0x35')](_0x5013('0x36'))){_0x5b3c7a[_0x5013('0x37')]=qs[_0x5013('0x37')](_0x126da1['query']['limit']);_0x5b3c7a['offset']=qs[_0x5013('0x16')](_0x126da1[_0x5013('0x2e')][_0x5013('0x16')]);}_0x5b3c7a[_0x5013('0x38')]=qs[_0x5013('0x39')](_0x126da1['query']['sort']);_0x5b3c7a[_0x5013('0x3a')]=qs[_0x5013('0x30')](_[_0x5013('0x3b')](_0x126da1['query'],_0x2cc1bd['filters']));_0x5b3c7a[_0x5013('0x3a')][_0x5013('0x57')]=_0x205c82['id'];if(_0x126da1[_0x5013('0x2e')][_0x5013('0x3c')]){_0x5b3c7a[_0x5013('0x3a')]=_[_0x5013('0x3d')](_0x5b3c7a[_0x5013('0x3a')],{'$or':_[_0x5013('0x29')](_0x5b3c7a[_0x5013('0x33')],function(_0x1c4471){var _0x52c4b7={};_0x52c4b7[_0x1c4471]={'$like':'%'+_0x126da1[_0x5013('0x2e')][_0x5013('0x3c')]+'%'};return _0x52c4b7;})});}_0x5b3c7a=_[_0x5013('0x3d')]({},_0x5b3c7a,_0x126da1['options']);return db[_0x5013('0x58')]['count']({'where':_0x5b3c7a['where']})[_0x5013('0x1e')](function(_0x260335){_0x2531c3[_0x5013('0x18')]=_0x260335;if(_0x126da1['query'][_0x5013('0x40')]){_0x5b3c7a[_0x5013('0x45')]=[{'all':!![]}];}return db['CmHopper'][_0x5013('0x59')](_0x5b3c7a);})[_0x5013('0x1e')](function(_0x598611){_0x2531c3[_0x5013('0x5a')]=_0x598611;return _0x2531c3;});}})[_0x5013('0x1e')](respondWithFilteredResult(_0x277bf3,_0x5b3c7a))[_0x5013('0x41')](handleError(_0x277bf3,null));};exports[_0x5013('0x5b')]=function(_0x1e3448,_0x3719b1,_0x5b92ee){var _0x3ec771={'raw':!![],'where':{}};var _0x4afd6a={};var _0x4b2326={'count':0x0,'rows':[]};return db[_0x5013('0x2a')]['findOne']({'where':{'id':_0x1e3448['params']['id']}})[_0x5013('0x1e')](handleEntityNotFound(_0x3719b1,null))[_0x5013('0x1e')](function(_0x50fb77){if(_0x50fb77){_0x4afd6a['model']=_['keys'](db[_0x5013('0x5c')][_0x5013('0x56')]);_0x4afd6a[_0x5013('0x2e')]=_['keys'](_0x1e3448[_0x5013('0x2e')]);_0x4afd6a['filters']=_[_0x5013('0x31')](_0x4afd6a['model'],_0x4afd6a[_0x5013('0x2e')]);_0x3ec771[_0x5013('0x33')]=_[_0x5013('0x31')](_0x4afd6a['model'],qs[_0x5013('0x34')](_0x1e3448[_0x5013('0x2e')][_0x5013('0x34')]));_0x3ec771[_0x5013('0x33')]=_0x3ec771['attributes'][_0x5013('0x44')]?_0x3ec771[_0x5013('0x33')]:_0x4afd6a[_0x5013('0x32')];if(!_0x1e3448[_0x5013('0x2e')][_0x5013('0x35')](_0x5013('0x36'))){_0x3ec771[_0x5013('0x37')]=qs['limit'](_0x1e3448['query'][_0x5013('0x37')]);_0x3ec771['offset']=qs[_0x5013('0x16')](_0x1e3448[_0x5013('0x2e')][_0x5013('0x16')]);}_0x3ec771['order']=qs['sort'](_0x1e3448[_0x5013('0x2e')][_0x5013('0x39')]);_0x3ec771['where']=qs[_0x5013('0x30')](_[_0x5013('0x3b')](_0x1e3448['query'],_0x4afd6a[_0x5013('0x30')]));_0x3ec771[_0x5013('0x3a')][_0x5013('0x57')]=_0x50fb77['id'];if(_0x1e3448[_0x5013('0x2e')][_0x5013('0x3c')]){_0x3ec771[_0x5013('0x3a')]=_[_0x5013('0x3d')](_0x3ec771[_0x5013('0x3a')],{'$or':_[_0x5013('0x29')](_0x3ec771[_0x5013('0x33')],function(_0x47ca5f){var _0x310751={};_0x310751[_0x47ca5f]={'$like':'%'+_0x1e3448[_0x5013('0x2e')][_0x5013('0x3c')]+'%'};return _0x310751;})});}_0x3ec771=_[_0x5013('0x3d')]({},_0x3ec771,_0x1e3448[_0x5013('0x3f')]);return db[_0x5013('0x5c')][_0x5013('0x18')]({'where':_0x3ec771[_0x5013('0x3a')]})[_0x5013('0x1e')](function(_0xf9eec1){_0x4b2326[_0x5013('0x18')]=_0xf9eec1;if(_0x1e3448[_0x5013('0x2e')][_0x5013('0x40')]){_0x3ec771[_0x5013('0x45')]=[{'all':!![]}];}return db[_0x5013('0x5c')][_0x5013('0x59')](_0x3ec771);})[_0x5013('0x1e')](function(_0x392869){_0x4b2326[_0x5013('0x5a')]=_0x392869;return _0x4b2326;});}})[_0x5013('0x1e')](respondWithFilteredResult(_0x3719b1,_0x3ec771))[_0x5013('0x41')](handleError(_0x3719b1,null));};exports['getHopperFinals']=function(_0xb0efbb,_0x576510,_0x1b3059){var _0x2f7e03={'raw':!![],'where':{}};var _0x115592={};var _0x5ca942={'count':0x0,'rows':[]};return db[_0x5013('0x2a')][_0x5013('0x55')]({'where':{'id':_0xb0efbb[_0x5013('0x43')]['id']}})[_0x5013('0x1e')](handleEntityNotFound(_0x576510,null))[_0x5013('0x1e')](function(_0x2ef0d4){if(_0x2ef0d4){_0x115592[_0x5013('0x32')]=_[_0x5013('0x2f')](db[_0x5013('0x5d')][_0x5013('0x56')]);_0x115592[_0x5013('0x2e')]=_['keys'](_0xb0efbb[_0x5013('0x2e')]);_0x115592[_0x5013('0x30')]=_['intersection'](_0x115592[_0x5013('0x32')],_0x115592['query']);_0x2f7e03[_0x5013('0x33')]=_[_0x5013('0x31')](_0x115592[_0x5013('0x32')],qs[_0x5013('0x34')](_0xb0efbb[_0x5013('0x2e')]['fields']));_0x2f7e03[_0x5013('0x33')]=_0x2f7e03[_0x5013('0x33')][_0x5013('0x44')]?_0x2f7e03[_0x5013('0x33')]:_0x115592[_0x5013('0x32')];if(!_0xb0efbb['query']['hasOwnProperty'](_0x5013('0x36'))){_0x2f7e03[_0x5013('0x37')]=qs[_0x5013('0x37')](_0xb0efbb[_0x5013('0x2e')]['limit']);_0x2f7e03['offset']=qs[_0x5013('0x16')](_0xb0efbb[_0x5013('0x2e')][_0x5013('0x16')]);}_0x2f7e03[_0x5013('0x38')]=qs[_0x5013('0x39')](_0xb0efbb[_0x5013('0x2e')][_0x5013('0x39')]);_0x2f7e03[_0x5013('0x3a')]=qs[_0x5013('0x30')](_[_0x5013('0x3b')](_0xb0efbb[_0x5013('0x2e')],_0x115592[_0x5013('0x30')]));_0x2f7e03[_0x5013('0x3a')][_0x5013('0x57')]=_0x2ef0d4['id'];if(_0xb0efbb['query'][_0x5013('0x3c')]){_0x2f7e03['where']=_[_0x5013('0x3d')](_0x2f7e03[_0x5013('0x3a')],{'$or':_[_0x5013('0x29')](_0x2f7e03[_0x5013('0x33')],function(_0x1835d6){var _0x240fcc={};_0x240fcc[_0x1835d6]={'$like':'%'+_0xb0efbb[_0x5013('0x2e')][_0x5013('0x3c')]+'%'};return _0x240fcc;})});}_0x2f7e03=_[_0x5013('0x3d')]({},_0x2f7e03,_0xb0efbb[_0x5013('0x3f')]);return db[_0x5013('0x5d')][_0x5013('0x18')]({'where':_0x2f7e03['where']})[_0x5013('0x1e')](function(_0x447702){_0x5ca942[_0x5013('0x18')]=_0x447702;if(_0xb0efbb['query']['includeAll']){_0x2f7e03[_0x5013('0x45')]=[{'all':!![]}];}return db[_0x5013('0x5d')][_0x5013('0x59')](_0x2f7e03);})['then'](function(_0x195cdd){_0x5ca942['rows']=_0x195cdd;return _0x5ca942;});}})['then'](respondWithFilteredResult(_0x576510,_0x2f7e03))['catch'](handleError(_0x576510,null));};exports[_0x5013('0x5e')]=function(_0x2604bb,_0x1c0695,_0x15a65e){var _0x18cce1={'raw':!![],'where':{}};var _0x2bde30={};var _0x155623={'count':0x0,'rows':[]};return db[_0x5013('0x2a')]['findOne']({'where':{'id':_0x2604bb['params']['id']}})[_0x5013('0x1e')](handleEntityNotFound(_0x1c0695,null))[_0x5013('0x1e')](function(_0x4bbad9){if(_0x4bbad9){_0x2bde30[_0x5013('0x32')]=_[_0x5013('0x2f')](db[_0x5013('0x5f')][_0x5013('0x56')]);_0x2bde30['query']=_[_0x5013('0x2f')](_0x2604bb['query']);_0x2bde30[_0x5013('0x30')]=_['intersection'](_0x2bde30[_0x5013('0x32')],_0x2bde30['query']);_0x18cce1[_0x5013('0x33')]=_[_0x5013('0x31')](_0x2bde30[_0x5013('0x32')],qs['fields'](_0x2604bb[_0x5013('0x2e')][_0x5013('0x34')]));_0x18cce1['attributes']=_0x18cce1[_0x5013('0x33')][_0x5013('0x44')]?_0x18cce1[_0x5013('0x33')]:_0x2bde30[_0x5013('0x32')];if(!_0x2604bb['query'][_0x5013('0x35')]('nolimit')){_0x18cce1[_0x5013('0x37')]=qs['limit'](_0x2604bb[_0x5013('0x2e')][_0x5013('0x37')]);_0x18cce1[_0x5013('0x16')]=qs[_0x5013('0x16')](_0x2604bb[_0x5013('0x2e')]['offset']);}_0x18cce1[_0x5013('0x38')]=qs[_0x5013('0x39')](_0x2604bb[_0x5013('0x2e')][_0x5013('0x39')]);_0x18cce1[_0x5013('0x3a')]=qs[_0x5013('0x30')](_[_0x5013('0x3b')](_0x2604bb[_0x5013('0x2e')],_0x2bde30[_0x5013('0x30')]));_0x18cce1['where'][_0x5013('0x57')]=_0x4bbad9['id'];if(_0x2604bb[_0x5013('0x2e')][_0x5013('0x3c')]){_0x18cce1['where']=_[_0x5013('0x3d')](_0x18cce1[_0x5013('0x3a')],{'$or':_[_0x5013('0x29')](_0x18cce1['attributes'],function(_0x4c1b51){var _0x2614a1={};_0x2614a1[_0x4c1b51]={'$like':'%'+_0x2604bb[_0x5013('0x2e')][_0x5013('0x3c')]+'%'};return _0x2614a1;})});}_0x18cce1=_[_0x5013('0x3d')]({},_0x18cce1,_0x2604bb[_0x5013('0x3f')]);return db['CmHopperBlack']['count']({'where':_0x18cce1[_0x5013('0x3a')]})['then'](function(_0xc9db55){_0x155623[_0x5013('0x18')]=_0xc9db55;if(_0x2604bb['query'][_0x5013('0x40')]){_0x18cce1[_0x5013('0x45')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x5013('0x59')](_0x18cce1);})[_0x5013('0x1e')](function(_0x4472ff){_0x155623['rows']=_0x4472ff;return _0x155623;});}})[_0x5013('0x1e')](respondWithFilteredResult(_0x1c0695,_0x18cce1))['catch'](handleError(_0x1c0695,null));};exports[_0x5013('0x60')]=function(_0x2f004b,_0x5b4cdc,_0x50c112){var _0x1caf33={};var _0x2d3679={};var _0x1a3202;var _0xf0371e;return db[_0x5013('0x2a')][_0x5013('0x55')]({'where':{'id':_0x2f004b[_0x5013('0x43')]['id']}})[_0x5013('0x1e')](handleEntityNotFound(_0x5b4cdc,null))[_0x5013('0x1e')](function(_0x1e42d1){if(_0x1e42d1){_0x1a3202=_0x1e42d1;_0x2d3679[_0x5013('0x32')]=_[_0x5013('0x2f')](db[_0x5013('0x61')][_0x5013('0x56')]);_0x2d3679[_0x5013('0x2e')]=_['keys'](_0x2f004b[_0x5013('0x2e')]);_0x2d3679['filters']=_[_0x5013('0x31')](_0x2d3679[_0x5013('0x32')],_0x2d3679[_0x5013('0x2e')]);_0x1caf33[_0x5013('0x33')]=_[_0x5013('0x31')](_0x2d3679[_0x5013('0x32')],qs[_0x5013('0x34')](_0x2f004b[_0x5013('0x2e')][_0x5013('0x34')]));_0x1caf33[_0x5013('0x33')]=_0x1caf33[_0x5013('0x33')][_0x5013('0x44')]?_0x1caf33['attributes']:_0x2d3679[_0x5013('0x32')];_0x1caf33[_0x5013('0x38')]=qs[_0x5013('0x39')](_0x2f004b['query'][_0x5013('0x39')]);_0x1caf33[_0x5013('0x3a')]=qs[_0x5013('0x30')](_[_0x5013('0x3b')](_0x2f004b[_0x5013('0x2e')],_0x2d3679['filters']));if(_0x2f004b[_0x5013('0x2e')][_0x5013('0x3c')]){_0x1caf33[_0x5013('0x3a')]=_[_0x5013('0x3d')](_0x1caf33[_0x5013('0x3a')],{'$or':_[_0x5013('0x29')](_0x1caf33[_0x5013('0x33')],function(_0x69e6a1){var _0x1f6a04={};_0x1f6a04[_0x69e6a1]={'$like':'%'+_0x2f004b['query'][_0x5013('0x3c')]+'%'};return _0x1f6a04;})});}_0x1caf33=_['merge']({},_0x1caf33,_0x2f004b['options']);return _0x1a3202['getLists'](_0x1caf33);}})['then'](function(_0x5da914){if(_0x5da914){_0xf0371e=_0x5da914[_0x5013('0x44')];if(!_0x2f004b['query']['hasOwnProperty'](_0x5013('0x36'))){_0x1caf33[_0x5013('0x37')]=qs[_0x5013('0x37')](_0x2f004b[_0x5013('0x2e')][_0x5013('0x37')]);_0x1caf33[_0x5013('0x16')]=qs['offset'](_0x2f004b[_0x5013('0x2e')]['offset']);}return _0x1a3202[_0x5013('0x60')](_0x1caf33);}})[_0x5013('0x1e')](function(_0x24bfc5){if(_0x24bfc5){return _0x24bfc5?{'count':_0xf0371e,'rows':_0x24bfc5}:null;}})[_0x5013('0x1e')](respondWithResult(_0x5b4cdc,null))[_0x5013('0x41')](handleError(_0x5b4cdc,null));};exports[_0x5013('0x62')]=function(_0x2bb636,_0x154ba9,_0xa0992e){var _0x4ab8f4,_0x2ff646;var _0x342925=[];var _0x295d7f=moment()[_0x5013('0x63')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x5013('0x2a')]['find']({'where':{'id':_0x2bb636['params']['id']}})['then'](handleEntityNotFound(_0x154ba9,null))[_0x5013('0x1e')](function(_0x4ec4d0){if(_0x4ec4d0){_0x2ff646=_0x4ec4d0;return _0x4ec4d0[_0x5013('0x62')](_0x2bb636[_0x5013('0x48')][_0x5013('0x64')],_[_0x5013('0x50')](_0x2bb636[_0x5013('0x48')],[_0x5013('0x64'),'id'])||{});}return null;})[_0x5013('0x65')](function(_0x3eac01){var _0x20db88;var _0x3e4139;_0x4ab8f4=_0x3eac01||[];var _0x18ab5f=[];if(_0x3eac01){for(var _0x485117=0x0;_0x485117<_0x3eac01['length'];_0x485117+=0x1){var _0x5a5582=_0x3eac01[_0x485117][_0x5013('0x20')]({'plain':!![]});_0x2ff646[_0x5013('0x66')]=_0x2bb636['body'][_0x5013('0x66')]?_0x2bb636[_0x5013('0x48')][_0x5013('0x66')]:_0x2ff646[_0x5013('0x66')];switch(_0x2ff646[_0x5013('0x66')]){case'always':_0x20db88=squel[_0x5013('0x67')]()[_0x5013('0x68')](_0x5013('0x69'))[_0x5013('0x6a')](['phone',_0x5013('0x6b'),_0x5013('0x6c'),_0x5013('0x6d'),_0x5013('0x57'),'createdAt','updatedAt'],squel[_0x5013('0x6e')]()['field'](_0x5013('0x6f'),_0x5013('0x6f'))[_0x5013('0x70')](_0x5013('0x71'),_0x5013('0x6b'))[_0x5013('0x70')]('id','ContactId')[_0x5013('0x70')](_0x5a5582['CmListId']['toString'](),_0x5013('0x6d'))[_0x5013('0x70')](_0x2bb636[_0x5013('0x43')]['id'][_0x5013('0x72')](),'CampaignId')['field']('\x27'+_0x295d7f+'\x27',_0x5013('0x51'))[_0x5013('0x70')]('\x27'+_0x295d7f+'\x27',_0x5013('0x52'))[_0x5013('0x73')]('cm_contacts')[_0x5013('0x3a')](_0x5013('0x74'))[_0x5013('0x3a')](_0x5013('0x75'),_0x5a5582[_0x5013('0x76')]['toString']())[_0x5013('0x3a')](_0x5013('0x77'))[_0x5013('0x3a')](_0x5013('0x78'),squel[_0x5013('0x6e')]()[_0x5013('0x70')]('COALESCE(calleridnum,\x27\x27)')[_0x5013('0x73')](_0x5013('0x79'))[_0x5013('0x3a')]('CampaignId\x20=\x20?',_0x2bb636['params']['id'][_0x5013('0x72')]()))[_0x5013('0x3a')](_0x5013('0x78'),squel[_0x5013('0x6e')]()[_0x5013('0x70')]('COALESCE(phone,\x27\x27)')[_0x5013('0x73')](_0x5013('0x69'))['where'](_0x5013('0x7a'),_0x2bb636[_0x5013('0x43')]['id'][_0x5013('0x72')]())))[_0x5013('0x72')]();break;case _0x5013('0x7b'):_0x20db88=squel[_0x5013('0x67')]()[_0x5013('0x68')]('cm_hopper')[_0x5013('0x6a')]([_0x5013('0x6f'),_0x5013('0x6b'),_0x5013('0x6c'),'ListId','CampaignId',_0x5013('0x51'),_0x5013('0x52')],squel['select']()['field'](_0x5013('0x6f'),_0x5013('0x6f'))[_0x5013('0x70')]('NOW()',_0x5013('0x6b'))[_0x5013('0x70')]('id',_0x5013('0x6c'))['field'](_0x5a5582[_0x5013('0x76')][_0x5013('0x72')](),_0x5013('0x6d'))[_0x5013('0x70')](_0x2bb636[_0x5013('0x43')]['id'][_0x5013('0x72')](),'CampaignId')[_0x5013('0x70')]('\x27'+_0x295d7f+'\x27','createdAt')[_0x5013('0x70')]('\x27'+_0x295d7f+'\x27',_0x5013('0x52'))['from'](_0x5013('0x7c'))['where'](_0x5013('0x74'))['where'](_0x5013('0x75'),_0x5a5582[_0x5013('0x76')][_0x5013('0x72')]())[_0x5013('0x3a')](_0x5013('0x77'))[_0x5013('0x3a')]('phone\x20NOT\x20IN\x20(?)',squel['select']()['field'](_0x5013('0x7d'))['from']('cm_hopper')[_0x5013('0x3a')](_0x5013('0x7a'),_0x2bb636['params']['id'][_0x5013('0x72')]())))[_0x5013('0x72')]();break;default:_0x20db88=squel[_0x5013('0x67')]()[_0x5013('0x68')](_0x5013('0x69'))['fromQuery'](['phone',_0x5013('0x6b'),_0x5013('0x6c'),_0x5013('0x6d'),_0x5013('0x57'),_0x5013('0x51'),_0x5013('0x52')],squel[_0x5013('0x6e')]()['field']('phone',_0x5013('0x6f'))[_0x5013('0x70')](_0x5013('0x71'),_0x5013('0x6b'))['field']('id',_0x5013('0x6c'))[_0x5013('0x70')](_0x5a5582['CmListId'][_0x5013('0x72')](),_0x5013('0x6d'))[_0x5013('0x70')](_0x2bb636[_0x5013('0x43')]['id']['toString'](),_0x5013('0x57'))[_0x5013('0x70')]('\x27'+_0x295d7f+'\x27',_0x5013('0x51'))[_0x5013('0x70')]('\x27'+_0x295d7f+'\x27',_0x5013('0x52'))[_0x5013('0x73')](_0x5013('0x7c'))[_0x5013('0x3a')]('deletedAt\x20IS\x20NULL')[_0x5013('0x3a')]('ListId\x20=\x20?',_0x5a5582[_0x5013('0x76')][_0x5013('0x72')]())['where'](_0x5013('0x77')))[_0x5013('0x72')]();}_0x3e4139=squel[_0x5013('0x67')]()['into'](_0x5013('0x7e'))[_0x5013('0x6a')]([_0x5013('0x7f'),_0x5013('0x6b'),_0x5013('0x6f'),'OrderBy',_0x5013('0x51'),_0x5013('0x52')],squel[_0x5013('0x6e')]()[_0x5013('0x70')](_0x5013('0x80'),'id')[_0x5013('0x70')](_0x5013('0x71'),_0x5013('0x6b'))[_0x5013('0x70')]('ci.item',_0x5013('0x6f'))[_0x5013('0x70')](_0x5013('0x81'),_0x5013('0x82'))[_0x5013('0x70')]('\x27'+_0x295d7f+'\x27','createdAt')['field']('\x27'+_0x295d7f+'\x27','updatedAt')['from']('cm_contact_has_items','ci')['join'](_0x5013('0x69'),'h','h.ContactId\x20=\x20ci.CmContactId')[_0x5013('0x3a')](_0x5013('0x83'),_0x5a5582['CmListId'][_0x5013('0x72')]())[_0x5013('0x3a')](_0x5013('0x84'),_0x2bb636[_0x5013('0x43')]['id']['toString']())[_0x5013('0x3a')](_0x5013('0x85'),_0x295d7f))[_0x5013('0x72')]();_0x18ab5f[_0x5013('0x86')](db[_0x5013('0x87')][_0x5013('0x2e')](_0x20db88));_0x342925['push'](db[_0x5013('0x87')][_0x5013('0x2e')](_0x3e4139));}return BPromise[_0x5013('0x88')](_0x18ab5f);}})[_0x5013('0x1e')](function(){return BPromise['all'](_0x342925);})[_0x5013('0x1e')](function(){return _0x4ab8f4;})[_0x5013('0x1e')](respondWithResult(_0x154ba9,null))[_0x5013('0x41')](handleError(_0x154ba9,null));};exports[_0x5013('0x89')]=function(_0x346b91,_0x25f791,_0x725ca9){return db[_0x5013('0x2a')][_0x5013('0x46')]({'where':{'id':_0x346b91[_0x5013('0x43')]['id']}})[_0x5013('0x1e')](handleEntityNotFound(_0x25f791,null))[_0x5013('0x1e')](function(_0x14dcec){if(_0x14dcec){return _0x14dcec[_0x5013('0x89')](_0x346b91['query'][_0x5013('0x64')]);}})[_0x5013('0x1e')](function(_0x12c8e1){if(_0x12c8e1){return db[_0x5013('0x58')][_0x5013('0x1f')]({'where':{'ListId':_0x346b91['query'][_0x5013('0x64')],'CampaignId':_0x346b91['params']['id']}})[_0x5013('0x1e')](function(){return _0x12c8e1;});}})['then'](respondWithStatusCode(_0x25f791,null))['catch'](handleError(_0x25f791,null));};exports[_0x5013('0x8a')]=function(_0x4aa572,_0x40dfee,_0x28903f){var _0x4959ef={};var _0x297ef8={};var _0x440ad4;var _0x1cc22b;return db[_0x5013('0x2a')][_0x5013('0x55')]({'where':{'id':_0x4aa572[_0x5013('0x43')]['id']}})[_0x5013('0x1e')](handleEntityNotFound(_0x40dfee,null))[_0x5013('0x1e')](function(_0x4d9ba1){if(_0x4d9ba1){_0x440ad4=_0x4d9ba1;_0x297ef8[_0x5013('0x32')]=_[_0x5013('0x2f')](db['CmList'][_0x5013('0x56')]);_0x297ef8[_0x5013('0x2e')]=_[_0x5013('0x2f')](_0x4aa572[_0x5013('0x2e')]);_0x297ef8[_0x5013('0x30')]=_[_0x5013('0x31')](_0x297ef8[_0x5013('0x32')],_0x297ef8['query']);_0x4959ef[_0x5013('0x33')]=_[_0x5013('0x31')](_0x297ef8[_0x5013('0x32')],qs[_0x5013('0x34')](_0x4aa572['query'][_0x5013('0x34')]));_0x4959ef[_0x5013('0x33')]=_0x4959ef['attributes'][_0x5013('0x44')]?_0x4959ef['attributes']:_0x297ef8[_0x5013('0x32')];_0x4959ef[_0x5013('0x38')]=qs[_0x5013('0x39')](_0x4aa572[_0x5013('0x2e')]['sort']);_0x4959ef[_0x5013('0x3a')]=qs[_0x5013('0x30')](_[_0x5013('0x3b')](_0x4aa572[_0x5013('0x2e')],_0x297ef8['filters']));if(_0x4aa572[_0x5013('0x2e')][_0x5013('0x3c')]){_0x4959ef[_0x5013('0x3a')]=_[_0x5013('0x3d')](_0x4959ef[_0x5013('0x3a')],{'$or':_[_0x5013('0x29')](_0x4959ef['attributes'],function(_0xfda157){var _0x44f0f6={};_0x44f0f6[_0xfda157]={'$like':'%'+_0x4aa572[_0x5013('0x2e')]['filter']+'%'};return _0x44f0f6;})});}_0x4959ef=_['merge']({},_0x4959ef,_0x4aa572[_0x5013('0x3f')]);return _0x440ad4[_0x5013('0x8a')](_0x4959ef);}})[_0x5013('0x1e')](function(_0x2944b6){if(_0x2944b6){_0x1cc22b=_0x2944b6[_0x5013('0x44')];if(!_0x4aa572['query'][_0x5013('0x35')](_0x5013('0x36'))){_0x4959ef[_0x5013('0x37')]=qs[_0x5013('0x37')](_0x4aa572[_0x5013('0x2e')][_0x5013('0x37')]);_0x4959ef['offset']=qs[_0x5013('0x16')](_0x4aa572[_0x5013('0x2e')][_0x5013('0x16')]);}return _0x440ad4['getBlackLists'](_0x4959ef);}})[_0x5013('0x1e')](function(_0x817dc6){if(_0x817dc6){return _0x817dc6?{'count':_0x1cc22b,'rows':_0x817dc6}:null;}})[_0x5013('0x1e')](respondWithResult(_0x40dfee,null))[_0x5013('0x41')](handleError(_0x40dfee,null));};exports['addBlackLists']=function(_0x1efa9f,_0x570a45,_0x545a3a){var _0x28c4e3,_0x220ec5;var _0x154759=[];var _0x1c0b1f=moment()[_0x5013('0x63')](_0x5013('0x8b'));return db[_0x5013('0x2a')][_0x5013('0x46')]({'where':{'id':_0x1efa9f[_0x5013('0x43')]['id']}})[_0x5013('0x1e')](handleEntityNotFound(_0x570a45,null))[_0x5013('0x1e')](function(_0x53f1d5){if(_0x53f1d5){_0x220ec5=_0x53f1d5;return _0x53f1d5[_0x5013('0x8c')](_0x1efa9f[_0x5013('0x48')][_0x5013('0x64')],_[_0x5013('0x50')](_0x1efa9f[_0x5013('0x48')],['ids','id'])||{});}return null;})['spread'](function(_0x2ede3a){var _0x4660d0;var _0x5185d0;_0x28c4e3=_0x2ede3a||[];var _0x5949f2=[];if(_0x2ede3a){for(var _0x56329e=0x0;_0x56329e<_0x2ede3a[_0x5013('0x44')];_0x56329e+=0x1){var _0x591c7b=_0x2ede3a[_0x56329e]['get']({'plain':!![]});_0x4660d0=squel[_0x5013('0x67')]()[_0x5013('0x68')](_0x5013('0x8d'))[_0x5013('0x6a')]([_0x5013('0x6f'),_0x5013('0x6c'),_0x5013('0x6d'),_0x5013('0x57'),_0x5013('0x51'),_0x5013('0x52')],squel[_0x5013('0x6e')]()[_0x5013('0x70')](_0x5013('0x6f'),_0x5013('0x6f'))['field']('id',_0x5013('0x6c'))[_0x5013('0x70')](_0x591c7b[_0x5013('0x76')][_0x5013('0x72')](),_0x5013('0x6d'))[_0x5013('0x70')](_0x1efa9f[_0x5013('0x43')]['id'][_0x5013('0x72')](),_0x5013('0x57'))['field'](_0x5013('0x71'),'createdAt')[_0x5013('0x70')](_0x5013('0x71'),'updatedAt')[_0x5013('0x73')](_0x5013('0x7c'))[_0x5013('0x3a')]('deletedAt\x20IS\x20NULL')[_0x5013('0x3a')](_0x5013('0x75'),_0x591c7b[_0x5013('0x76')]['toString']())[_0x5013('0x3a')]('phone\x20IS\x20NOT\x20NULL'))[_0x5013('0x72')]();_0x5949f2['push'](db[_0x5013('0x87')][_0x5013('0x2e')](_0x4660d0));}return BPromise[_0x5013('0x88')](_0x5949f2);}})[_0x5013('0x1e')](function(){return _0x28c4e3;})['then'](respondWithResult(_0x570a45,null))[_0x5013('0x41')](handleError(_0x570a45,null));};exports[_0x5013('0x8e')]=function(_0x3d7658,_0x47a8d5,_0x5f283){return db[_0x5013('0x2a')]['find']({'where':{'id':_0x3d7658[_0x5013('0x43')]['id']}})[_0x5013('0x1e')](handleEntityNotFound(_0x47a8d5,null))[_0x5013('0x1e')](function(_0xe7604a){if(_0xe7604a){return _0xe7604a[_0x5013('0x8e')](_0x3d7658[_0x5013('0x2e')]['ids']);}})[_0x5013('0x1e')](function(_0x707d98){if(_0x707d98){return db[_0x5013('0x5f')]['destroy']({'where':{'ListId':_0x3d7658[_0x5013('0x2e')][_0x5013('0x64')],'CampaignId':_0x3d7658[_0x5013('0x43')]['id']}})[_0x5013('0x1e')](function(){return _0x707d98;});}})['then'](respondWithStatusCode(_0x47a8d5,null))[_0x5013('0x41')](handleError(_0x47a8d5,null));}; \ No newline at end of file +var _0x4560=['updatedAt','body','update','getHoppers','CmHopper','nolimit','pick','CampaignId','getHopperHistories','CmHopperHistory','findOne','CmHopperFinal','getHopperBlacks','CmHopperBlack','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','dialCheckDuplicateType','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','field','phone','NOW()','CmListId','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','from','onlyIfOpen','insert','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','join','h.CampaignId=?','sequelize','push','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','mustache','util','path','sox','to-csv','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','apply','reject','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','rawAttributes','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','Campaign','count','includeAll','include','findAll','rows','catch','params','options','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','IvrCampaigns','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt'];(function(_0x121874,_0x59b6d8){var _0x51cd1f=function(_0x2f497b){while(--_0x2f497b){_0x121874['push'](_0x121874['shift']());}};_0x51cd1f(++_0x59b6d8);}(_0x4560,0x1d4));var _0x0456=function(_0x23267c,_0x4af6b5){_0x23267c=_0x23267c-0x0;var _0x15495c=_0x4560[_0x23267c];return _0x15495c;};'use strict';var emlformat=require(_0x0456('0x0'));var rimraf=require(_0x0456('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0456('0x2'));var util=require(_0x0456('0x3'));var path=require(_0x0456('0x4'));var sox=require(_0x0456('0x5'));var csv=require(_0x0456('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x0456('0x7'));var crypto=require(_0x0456('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x0456('0x9'));var toCsv=require(_0x0456('0x6'));var querystring=require(_0x0456('0xa'));var Papa=require('papaparse');var Redis=require(_0x0456('0xb'));var authService=require(_0x0456('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x0456('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0456('0xe'))(_0x0456('0xf'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0456('0x10'))['db'];function respondWithStatusCode(_0x415cd5,_0x46b463){_0x46b463=_0x46b463||0xcc;return function(_0x2f147c){if(_0x2f147c){return _0x415cd5[_0x0456('0x11')](_0x46b463);}return _0x415cd5[_0x0456('0x12')](_0x46b463)[_0x0456('0x13')]();};}function respondWithResult(_0xe74de1,_0x4654d9){_0x4654d9=_0x4654d9||0xc8;return function(_0x17ecfd){if(_0x17ecfd){return _0xe74de1[_0x0456('0x12')](_0x4654d9)[_0x0456('0x14')](_0x17ecfd);}};}function respondWithFilteredResult(_0x3f07b6,_0x200de9){return function(_0x63e1d1){if(_0x63e1d1){var _0x2ba60f=typeof _0x200de9[_0x0456('0x15')]===_0x0456('0x16')&&typeof _0x200de9['limit']===_0x0456('0x16');var _0x4f4147=_0x63e1d1['count'];var _0x23e3c7=_0x2ba60f?0x0:_0x200de9[_0x0456('0x15')];var _0x65c456=_0x2ba60f?_0x63e1d1['count']:_0x200de9['offset']+_0x200de9[_0x0456('0x17')];var _0x3990d6;if(_0x65c456>=_0x4f4147){_0x65c456=_0x4f4147;_0x3990d6=0xc8;}else{_0x3990d6=0xce;}_0x3f07b6[_0x0456('0x12')](_0x3990d6);return _0x3f07b6[_0x0456('0x18')]('Content-Range',_0x23e3c7+'-'+_0x65c456+'/'+_0x4f4147)[_0x0456('0x14')](_0x63e1d1);}return null;};}function patchUpdates(_0x343743){return function(_0x3ab556){try{jsonpatch[_0x0456('0x19')](_0x3ab556,_0x343743,!![]);}catch(_0x3a1307){return BPromise[_0x0456('0x1a')](_0x3a1307);}return _0x3ab556['save']();};}function saveUpdates(_0xb2aa8b,_0x1f3691){return function(_0x8285d5){if(_0x8285d5){return _0x8285d5['update'](_0xb2aa8b)[_0x0456('0x1b')](function(_0x5a7ed6){return _0x5a7ed6;});}return null;};}function removeEntity(_0xd18f11,_0x52aa9e){return function(_0x1062f3){if(_0x1062f3){return _0x1062f3[_0x0456('0x1c')]()['then'](function(){var _0x1e643f=_0x1062f3[_0x0456('0x1d')]({'plain':!![]});var _0x4debd9='IvrCampaigns';return db[_0x0456('0x1e')][_0x0456('0x1c')]({'where':{'type':_0x4debd9,'resourceId':_0x1e643f['id']}})[_0x0456('0x1b')](function(){return _0x1062f3;});})['then'](function(){_0xd18f11[_0x0456('0x12')](0xcc)[_0x0456('0x13')]();});}};}function handleEntityNotFound(_0x1a83e5,_0xd0f9a1){return function(_0x1732d5){if(!_0x1732d5){_0x1a83e5[_0x0456('0x11')](0x194);}return _0x1732d5;};}function handleError(_0x451959,_0x5ddff4){_0x5ddff4=_0x5ddff4||0x1f4;return function(_0xdbe2eb){logger[_0x0456('0x1f')](_0xdbe2eb[_0x0456('0x20')]);if(_0xdbe2eb['name']){delete _0xdbe2eb[_0x0456('0x21')];}_0x451959[_0x0456('0x12')](_0x5ddff4)[_0x0456('0x22')](_0xdbe2eb);};}exports[_0x0456('0x23')]=function(_0x442eda,_0x36d8ea){var _0x10c5d6={},_0x120c37={},_0x990579={'count':0x0,'rows':[]};var _0x4009f4=_[_0x0456('0x24')](db['Campaign'][_0x0456('0x25')],function(_0xc70678){return{'name':_0xc70678['fieldName'],'type':_0xc70678[_0x0456('0x26')]['key']};});_0x120c37['model']=_[_0x0456('0x24')](_0x4009f4,_0x0456('0x21'));_0x120c37[_0x0456('0x27')]=_[_0x0456('0x28')](_0x442eda[_0x0456('0x27')]);_0x120c37[_0x0456('0x29')]=_[_0x0456('0x2a')](_0x120c37[_0x0456('0x2b')],_0x120c37[_0x0456('0x27')]);_0x10c5d6[_0x0456('0x2c')]=_[_0x0456('0x2a')](_0x120c37[_0x0456('0x2b')],qs['fields'](_0x442eda[_0x0456('0x27')][_0x0456('0x2d')]));_0x10c5d6['attributes']=_0x10c5d6[_0x0456('0x2c')][_0x0456('0x2e')]?_0x10c5d6[_0x0456('0x2c')]:_0x120c37[_0x0456('0x2b')];if(!_0x442eda[_0x0456('0x27')][_0x0456('0x2f')]('nolimit')){_0x10c5d6['limit']=qs[_0x0456('0x17')](_0x442eda[_0x0456('0x27')][_0x0456('0x17')]);_0x10c5d6['offset']=qs[_0x0456('0x15')](_0x442eda[_0x0456('0x27')][_0x0456('0x15')]);}_0x10c5d6[_0x0456('0x30')]=qs['sort'](_0x442eda['query'][_0x0456('0x31')]);_0x10c5d6[_0x0456('0x32')]=qs[_0x0456('0x29')](_['pick'](_0x442eda[_0x0456('0x27')],_0x120c37[_0x0456('0x29')]),_0x4009f4);if(_0x442eda['query']['filter']){_0x10c5d6['where']=_[_0x0456('0x33')](_0x10c5d6['where'],{'$or':_[_0x0456('0x24')](_0x4009f4,function(_0x206d44){if(_0x206d44[_0x0456('0x26')]!==_0x0456('0x34')){var _0x1e17db={};_0x1e17db[_0x206d44['name']]={'$like':'%'+_0x442eda[_0x0456('0x27')][_0x0456('0x35')]+'%'};return _0x1e17db;}})});}_0x10c5d6=_['merge']({},_0x10c5d6,_0x442eda['options']);var _0x46e253={'where':_0x10c5d6['where']};return db[_0x0456('0x36')][_0x0456('0x37')](_0x46e253)[_0x0456('0x1b')](function(_0x1f1906){_0x990579[_0x0456('0x37')]=_0x1f1906;if(_0x442eda['query'][_0x0456('0x38')]){_0x10c5d6[_0x0456('0x39')]=[{'all':!![]}];}return db[_0x0456('0x36')][_0x0456('0x3a')](_0x10c5d6);})[_0x0456('0x1b')](function(_0x390a55){_0x990579[_0x0456('0x3b')]=_0x390a55;return _0x990579;})[_0x0456('0x1b')](respondWithFilteredResult(_0x36d8ea,_0x10c5d6))[_0x0456('0x3c')](handleError(_0x36d8ea,null));};exports['show']=function(_0x17b345,_0x5e352d){var _0x52be61={'raw':![],'where':{'id':_0x17b345[_0x0456('0x3d')]['id']}},_0x4991d6={};_0x4991d6[_0x0456('0x2b')]=_[_0x0456('0x28')](db[_0x0456('0x36')][_0x0456('0x25')]);_0x4991d6[_0x0456('0x27')]=_[_0x0456('0x28')](_0x17b345[_0x0456('0x27')]);_0x4991d6[_0x0456('0x29')]=_[_0x0456('0x2a')](_0x4991d6[_0x0456('0x2b')],_0x4991d6['query']);_0x52be61[_0x0456('0x2c')]=_[_0x0456('0x2a')](_0x4991d6['model'],qs['fields'](_0x17b345[_0x0456('0x27')][_0x0456('0x2d')]));_0x52be61[_0x0456('0x2c')]=_0x52be61['attributes']['length']?_0x52be61['attributes']:_0x4991d6['model'];if(_0x17b345[_0x0456('0x27')][_0x0456('0x38')]){_0x52be61[_0x0456('0x39')]=[{'all':!![]}];}_0x52be61=_[_0x0456('0x33')]({},_0x52be61,_0x17b345[_0x0456('0x3e')]);return db['Campaign']['find'](_0x52be61)['then'](handleEntityNotFound(_0x5e352d,null))[_0x0456('0x1b')](respondWithResult(_0x5e352d,null))[_0x0456('0x3c')](handleError(_0x5e352d,null));};exports[_0x0456('0x3f')]=function(_0x109655,_0x39ed16){return db['Campaign'][_0x0456('0x3f')](_0x109655['body'],{})[_0x0456('0x1b')](function(_0x51f844){var _0x1ab208=_0x109655[_0x0456('0x40')][_0x0456('0x1d')]({'plain':!![]});if(!_0x1ab208)throw new Error(_0x0456('0x41'));if(_0x1ab208[_0x0456('0x42')]===_0x0456('0x40')){var _0x16d1f0=_0x51f844[_0x0456('0x1d')]({'plain':!![]});var _0x42accf=_0x0456('0x43');return db[_0x0456('0x44')][_0x0456('0x45')]({'where':{'name':_0x42accf,'userProfileId':_0x1ab208[_0x0456('0x46')]},'raw':!![]})['then'](function(_0x3b6417){if(_0x3b6417&&_0x3b6417[_0x0456('0x47')]===0x0){return db['UserProfileResource']['create']({'name':_0x16d1f0['name'],'resourceId':_0x16d1f0['id'],'type':_0x3b6417[_0x0456('0x21')],'sectionId':_0x3b6417['id']},{})[_0x0456('0x1b')](function(){return _0x51f844;});}else{return _0x51f844;}})['catch'](function(_0x4b5f12){logger['error'](_0x0456('0x48'),_0x4b5f12);throw _0x4b5f12;});}return _0x51f844;})[_0x0456('0x1b')](respondWithResult(_0x39ed16,0xc9))[_0x0456('0x3c')](handleError(_0x39ed16,null));};exports[_0x0456('0x49')]=function(_0x8f0d74,_0x273f76){var _0x5b2b8a={'where':{'id':_0x8f0d74[_0x0456('0x3d')]['id']}},_0x1174e1={};_0x1174e1['model']=_[_0x0456('0x28')](db['Campaign'][_0x0456('0x25')]);_0x5b2b8a[_0x0456('0x2c')]=_[_0x0456('0x2a')](_0x1174e1[_0x0456('0x2b')],qs[_0x0456('0x2d')](_0x8f0d74['query'][_0x0456('0x2d')]));_0x5b2b8a[_0x0456('0x2c')]=_0x5b2b8a[_0x0456('0x2c')]['length']?_0x5b2b8a[_0x0456('0x2c')]:_0x1174e1[_0x0456('0x2b')];if(_0x8f0d74[_0x0456('0x27')]['includeAll']){_0x5b2b8a['include']=[{'all':!![]}];}_0x5b2b8a=_[_0x0456('0x33')]({},_0x5b2b8a,_0x8f0d74[_0x0456('0x3e')]);return db[_0x0456('0x36')]['find'](_0x5b2b8a)['then'](handleEntityNotFound(_0x273f76,null))[_0x0456('0x1b')](function(_0x21f51b){if(_0x21f51b){var _0x1687f9=_0x21f51b['get']({'plain':!![]});_0x1687f9=qs[_0x0456('0x4a')](_0x1687f9,['id',_0x0456('0x4b'),_0x0456('0x4c')]);_0x8f0d74[_0x0456('0x4d')]=_[_0x0456('0x4a')](_0x8f0d74[_0x0456('0x4d')],['id',_0x0456('0x4b'),'updatedAt']);return db['Campaign'][_0x0456('0x3f')](_['merge'](_0x1687f9,_0x8f0d74['body']),{'include':_0x8f0d74[_0x0456('0x27')][_0x0456('0x38')]?[{'all':!![]}]:undefined})['then'](function(_0x40eab6){var _0x381f86=_0x8f0d74[_0x0456('0x40')][_0x0456('0x1d')]({'plain':!![]});if(!_0x381f86)throw new Error(_0x0456('0x41'));if(_0x381f86[_0x0456('0x42')]==='user'){var _0x1bc9e2=_0x40eab6[_0x0456('0x1d')]({'plain':!![]});var _0x1bee94=_0x0456('0x43');return db[_0x0456('0x44')][_0x0456('0x45')]({'where':{'name':_0x1bee94,'userProfileId':_0x381f86['userProfileId']},'raw':!![]})[_0x0456('0x1b')](function(_0x4b132b){if(_0x4b132b&&_0x4b132b[_0x0456('0x47')]===0x0){return db[_0x0456('0x1e')][_0x0456('0x3f')]({'name':_0x1bc9e2[_0x0456('0x21')],'resourceId':_0x1bc9e2['id'],'type':_0x4b132b[_0x0456('0x21')],'sectionId':_0x4b132b['id']},{})[_0x0456('0x1b')](function(){return _0x40eab6;});}else{return _0x40eab6;}})['catch'](function(_0x206ce6){logger[_0x0456('0x1f')](_0x0456('0x48'),_0x206ce6);throw _0x206ce6;});}return _0x40eab6;});}})['then'](respondWithResult(_0x273f76,0xc9))[_0x0456('0x3c')](handleError(_0x273f76,null));};exports[_0x0456('0x4e')]=function(_0x15539a,_0x11a989){if(_0x15539a[_0x0456('0x4d')]['id']){delete _0x15539a[_0x0456('0x4d')]['id'];}return db[_0x0456('0x36')]['find']({'where':{'id':_0x15539a[_0x0456('0x3d')]['id']}})[_0x0456('0x1b')](handleEntityNotFound(_0x11a989,null))[_0x0456('0x1b')](saveUpdates(_0x15539a[_0x0456('0x4d')],null))[_0x0456('0x1b')](respondWithResult(_0x11a989,null))[_0x0456('0x3c')](handleError(_0x11a989,null));};exports[_0x0456('0x1c')]=function(_0x2d6ac4,_0x2d72b8){return db[_0x0456('0x36')][_0x0456('0x45')]({'where':{'id':_0x2d6ac4['params']['id']}})[_0x0456('0x1b')](handleEntityNotFound(_0x2d72b8,null))[_0x0456('0x1b')](removeEntity(_0x2d72b8,null))[_0x0456('0x3c')](handleError(_0x2d72b8,null));};exports[_0x0456('0x4f')]=function(_0x3c1806,_0x2934f1,_0x3ae6b9){var _0x4607cb={'raw':!![],'where':{}};var _0x52f603={};var _0x66b763={'count':0x0,'rows':[]};return db[_0x0456('0x36')]['findOne']({'where':{'id':_0x3c1806[_0x0456('0x3d')]['id']}})[_0x0456('0x1b')](handleEntityNotFound(_0x2934f1,null))[_0x0456('0x1b')](function(_0x5735b7){if(_0x5735b7){_0x52f603['model']=_['keys'](db[_0x0456('0x50')][_0x0456('0x25')]);_0x52f603[_0x0456('0x27')]=_[_0x0456('0x28')](_0x3c1806[_0x0456('0x27')]);_0x52f603[_0x0456('0x29')]=_['intersection'](_0x52f603[_0x0456('0x2b')],_0x52f603[_0x0456('0x27')]);_0x4607cb['attributes']=_[_0x0456('0x2a')](_0x52f603['model'],qs[_0x0456('0x2d')](_0x3c1806['query'][_0x0456('0x2d')]));_0x4607cb[_0x0456('0x2c')]=_0x4607cb[_0x0456('0x2c')][_0x0456('0x2e')]?_0x4607cb[_0x0456('0x2c')]:_0x52f603[_0x0456('0x2b')];if(!_0x3c1806[_0x0456('0x27')][_0x0456('0x2f')](_0x0456('0x51'))){_0x4607cb['limit']=qs[_0x0456('0x17')](_0x3c1806[_0x0456('0x27')][_0x0456('0x17')]);_0x4607cb[_0x0456('0x15')]=qs[_0x0456('0x15')](_0x3c1806[_0x0456('0x27')][_0x0456('0x15')]);}_0x4607cb[_0x0456('0x30')]=qs[_0x0456('0x31')](_0x3c1806[_0x0456('0x27')][_0x0456('0x31')]);_0x4607cb[_0x0456('0x32')]=qs[_0x0456('0x29')](_[_0x0456('0x52')](_0x3c1806[_0x0456('0x27')],_0x52f603[_0x0456('0x29')]));_0x4607cb['where'][_0x0456('0x53')]=_0x5735b7['id'];if(_0x3c1806[_0x0456('0x27')][_0x0456('0x35')]){_0x4607cb[_0x0456('0x32')]=_[_0x0456('0x33')](_0x4607cb[_0x0456('0x32')],{'$or':_['map'](_0x4607cb[_0x0456('0x2c')],function(_0x212b86){var _0x14e276={};_0x14e276[_0x212b86]={'$like':'%'+_0x3c1806['query'][_0x0456('0x35')]+'%'};return _0x14e276;})});}_0x4607cb=_['merge']({},_0x4607cb,_0x3c1806['options']);return db['CmHopper']['count']({'where':_0x4607cb[_0x0456('0x32')]})[_0x0456('0x1b')](function(_0x4ee1eb){_0x66b763[_0x0456('0x37')]=_0x4ee1eb;if(_0x3c1806[_0x0456('0x27')][_0x0456('0x38')]){_0x4607cb[_0x0456('0x39')]=[{'all':!![]}];}return db[_0x0456('0x50')][_0x0456('0x3a')](_0x4607cb);})[_0x0456('0x1b')](function(_0x4fd4f4){_0x66b763[_0x0456('0x3b')]=_0x4fd4f4;return _0x66b763;});}})['then'](respondWithFilteredResult(_0x2934f1,_0x4607cb))[_0x0456('0x3c')](handleError(_0x2934f1,null));};exports[_0x0456('0x54')]=function(_0x929109,_0x484e92,_0xb84784){var _0x5b8814={'raw':!![],'where':{}};var _0x1f8002={};var _0x485535={'count':0x0,'rows':[]};return db[_0x0456('0x36')]['findOne']({'where':{'id':_0x929109[_0x0456('0x3d')]['id']}})[_0x0456('0x1b')](handleEntityNotFound(_0x484e92,null))[_0x0456('0x1b')](function(_0x36816d){if(_0x36816d){_0x1f8002['model']=_[_0x0456('0x28')](db[_0x0456('0x55')]['rawAttributes']);_0x1f8002['query']=_['keys'](_0x929109[_0x0456('0x27')]);_0x1f8002['filters']=_[_0x0456('0x2a')](_0x1f8002['model'],_0x1f8002[_0x0456('0x27')]);_0x5b8814[_0x0456('0x2c')]=_[_0x0456('0x2a')](_0x1f8002['model'],qs[_0x0456('0x2d')](_0x929109['query'][_0x0456('0x2d')]));_0x5b8814[_0x0456('0x2c')]=_0x5b8814[_0x0456('0x2c')][_0x0456('0x2e')]?_0x5b8814['attributes']:_0x1f8002[_0x0456('0x2b')];if(!_0x929109['query'][_0x0456('0x2f')](_0x0456('0x51'))){_0x5b8814['limit']=qs['limit'](_0x929109[_0x0456('0x27')]['limit']);_0x5b8814[_0x0456('0x15')]=qs['offset'](_0x929109[_0x0456('0x27')][_0x0456('0x15')]);}_0x5b8814['order']=qs[_0x0456('0x31')](_0x929109[_0x0456('0x27')][_0x0456('0x31')]);_0x5b8814[_0x0456('0x32')]=qs[_0x0456('0x29')](_[_0x0456('0x52')](_0x929109[_0x0456('0x27')],_0x1f8002[_0x0456('0x29')]));_0x5b8814[_0x0456('0x32')]['CampaignId']=_0x36816d['id'];if(_0x929109['query'][_0x0456('0x35')]){_0x5b8814[_0x0456('0x32')]=_[_0x0456('0x33')](_0x5b8814['where'],{'$or':_[_0x0456('0x24')](_0x5b8814['attributes'],function(_0x427289){var _0x16ec92={};_0x16ec92[_0x427289]={'$like':'%'+_0x929109['query']['filter']+'%'};return _0x16ec92;})});}_0x5b8814=_[_0x0456('0x33')]({},_0x5b8814,_0x929109[_0x0456('0x3e')]);return db[_0x0456('0x55')]['count']({'where':_0x5b8814[_0x0456('0x32')]})[_0x0456('0x1b')](function(_0x288e25){_0x485535[_0x0456('0x37')]=_0x288e25;if(_0x929109[_0x0456('0x27')][_0x0456('0x38')]){_0x5b8814[_0x0456('0x39')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x0456('0x3a')](_0x5b8814);})[_0x0456('0x1b')](function(_0x4d614a){_0x485535[_0x0456('0x3b')]=_0x4d614a;return _0x485535;});}})['then'](respondWithFilteredResult(_0x484e92,_0x5b8814))[_0x0456('0x3c')](handleError(_0x484e92,null));};exports['getHopperFinals']=function(_0xdf19c4,_0x2bc0fe,_0x3ede1d){var _0x1143ef={'raw':!![],'where':{}};var _0x5c6bf2={};var _0x2324bb={'count':0x0,'rows':[]};return db[_0x0456('0x36')][_0x0456('0x56')]({'where':{'id':_0xdf19c4['params']['id']}})[_0x0456('0x1b')](handleEntityNotFound(_0x2bc0fe,null))['then'](function(_0x43e440){if(_0x43e440){_0x5c6bf2['model']=_[_0x0456('0x28')](db['CmHopperFinal'][_0x0456('0x25')]);_0x5c6bf2[_0x0456('0x27')]=_[_0x0456('0x28')](_0xdf19c4[_0x0456('0x27')]);_0x5c6bf2[_0x0456('0x29')]=_[_0x0456('0x2a')](_0x5c6bf2[_0x0456('0x2b')],_0x5c6bf2['query']);_0x1143ef['attributes']=_[_0x0456('0x2a')](_0x5c6bf2['model'],qs[_0x0456('0x2d')](_0xdf19c4[_0x0456('0x27')][_0x0456('0x2d')]));_0x1143ef[_0x0456('0x2c')]=_0x1143ef[_0x0456('0x2c')]['length']?_0x1143ef[_0x0456('0x2c')]:_0x5c6bf2['model'];if(!_0xdf19c4['query'][_0x0456('0x2f')](_0x0456('0x51'))){_0x1143ef[_0x0456('0x17')]=qs[_0x0456('0x17')](_0xdf19c4[_0x0456('0x27')][_0x0456('0x17')]);_0x1143ef[_0x0456('0x15')]=qs[_0x0456('0x15')](_0xdf19c4[_0x0456('0x27')][_0x0456('0x15')]);}_0x1143ef['order']=qs[_0x0456('0x31')](_0xdf19c4['query']['sort']);_0x1143ef['where']=qs[_0x0456('0x29')](_['pick'](_0xdf19c4[_0x0456('0x27')],_0x5c6bf2[_0x0456('0x29')]));_0x1143ef['where']['CampaignId']=_0x43e440['id'];if(_0xdf19c4['query'][_0x0456('0x35')]){_0x1143ef['where']=_[_0x0456('0x33')](_0x1143ef[_0x0456('0x32')],{'$or':_[_0x0456('0x24')](_0x1143ef[_0x0456('0x2c')],function(_0x87aca4){var _0x1dfc76={};_0x1dfc76[_0x87aca4]={'$like':'%'+_0xdf19c4['query'][_0x0456('0x35')]+'%'};return _0x1dfc76;})});}_0x1143ef=_['merge']({},_0x1143ef,_0xdf19c4['options']);return db[_0x0456('0x57')][_0x0456('0x37')]({'where':_0x1143ef[_0x0456('0x32')]})[_0x0456('0x1b')](function(_0x262474){_0x2324bb['count']=_0x262474;if(_0xdf19c4[_0x0456('0x27')][_0x0456('0x38')]){_0x1143ef[_0x0456('0x39')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x0456('0x3a')](_0x1143ef);})[_0x0456('0x1b')](function(_0x17a1e7){_0x2324bb[_0x0456('0x3b')]=_0x17a1e7;return _0x2324bb;});}})['then'](respondWithFilteredResult(_0x2bc0fe,_0x1143ef))[_0x0456('0x3c')](handleError(_0x2bc0fe,null));};exports[_0x0456('0x58')]=function(_0x2ed56a,_0x3c60ff,_0x242197){var _0x44105f={'raw':!![],'where':{}};var _0x210ede={};var _0x4f80cb={'count':0x0,'rows':[]};return db['Campaign'][_0x0456('0x56')]({'where':{'id':_0x2ed56a[_0x0456('0x3d')]['id']}})[_0x0456('0x1b')](handleEntityNotFound(_0x3c60ff,null))[_0x0456('0x1b')](function(_0x23fdf1){if(_0x23fdf1){_0x210ede[_0x0456('0x2b')]=_[_0x0456('0x28')](db[_0x0456('0x59')][_0x0456('0x25')]);_0x210ede[_0x0456('0x27')]=_[_0x0456('0x28')](_0x2ed56a[_0x0456('0x27')]);_0x210ede[_0x0456('0x29')]=_[_0x0456('0x2a')](_0x210ede[_0x0456('0x2b')],_0x210ede[_0x0456('0x27')]);_0x44105f[_0x0456('0x2c')]=_[_0x0456('0x2a')](_0x210ede[_0x0456('0x2b')],qs[_0x0456('0x2d')](_0x2ed56a[_0x0456('0x27')]['fields']));_0x44105f['attributes']=_0x44105f[_0x0456('0x2c')][_0x0456('0x2e')]?_0x44105f[_0x0456('0x2c')]:_0x210ede[_0x0456('0x2b')];if(!_0x2ed56a[_0x0456('0x27')][_0x0456('0x2f')](_0x0456('0x51'))){_0x44105f[_0x0456('0x17')]=qs['limit'](_0x2ed56a[_0x0456('0x27')]['limit']);_0x44105f[_0x0456('0x15')]=qs['offset'](_0x2ed56a[_0x0456('0x27')][_0x0456('0x15')]);}_0x44105f['order']=qs['sort'](_0x2ed56a[_0x0456('0x27')][_0x0456('0x31')]);_0x44105f[_0x0456('0x32')]=qs[_0x0456('0x29')](_[_0x0456('0x52')](_0x2ed56a['query'],_0x210ede[_0x0456('0x29')]));_0x44105f[_0x0456('0x32')]['CampaignId']=_0x23fdf1['id'];if(_0x2ed56a[_0x0456('0x27')][_0x0456('0x35')]){_0x44105f[_0x0456('0x32')]=_[_0x0456('0x33')](_0x44105f[_0x0456('0x32')],{'$or':_[_0x0456('0x24')](_0x44105f[_0x0456('0x2c')],function(_0x248442){var _0x51ba85={};_0x51ba85[_0x248442]={'$like':'%'+_0x2ed56a[_0x0456('0x27')][_0x0456('0x35')]+'%'};return _0x51ba85;})});}_0x44105f=_[_0x0456('0x33')]({},_0x44105f,_0x2ed56a[_0x0456('0x3e')]);return db['CmHopperBlack'][_0x0456('0x37')]({'where':_0x44105f[_0x0456('0x32')]})[_0x0456('0x1b')](function(_0x3b55ff){_0x4f80cb['count']=_0x3b55ff;if(_0x2ed56a[_0x0456('0x27')][_0x0456('0x38')]){_0x44105f[_0x0456('0x39')]=[{'all':!![]}];}return db[_0x0456('0x59')][_0x0456('0x3a')](_0x44105f);})[_0x0456('0x1b')](function(_0xd92060){_0x4f80cb['rows']=_0xd92060;return _0x4f80cb;});}})[_0x0456('0x1b')](respondWithFilteredResult(_0x3c60ff,_0x44105f))[_0x0456('0x3c')](handleError(_0x3c60ff,null));};exports['getLists']=function(_0xc1d5f8,_0x2dd299,_0x24f45f){var _0x2d1371={};var _0x1428d2={};var _0x3f7b99;var _0x3f0084;return db[_0x0456('0x36')][_0x0456('0x56')]({'where':{'id':_0xc1d5f8['params']['id']}})['then'](handleEntityNotFound(_0x2dd299,null))[_0x0456('0x1b')](function(_0x5265fd){if(_0x5265fd){_0x3f7b99=_0x5265fd;_0x1428d2[_0x0456('0x2b')]=_[_0x0456('0x28')](db[_0x0456('0x5a')][_0x0456('0x25')]);_0x1428d2[_0x0456('0x27')]=_['keys'](_0xc1d5f8[_0x0456('0x27')]);_0x1428d2[_0x0456('0x29')]=_['intersection'](_0x1428d2['model'],_0x1428d2[_0x0456('0x27')]);_0x2d1371[_0x0456('0x2c')]=_[_0x0456('0x2a')](_0x1428d2[_0x0456('0x2b')],qs[_0x0456('0x2d')](_0xc1d5f8[_0x0456('0x27')][_0x0456('0x2d')]));_0x2d1371['attributes']=_0x2d1371[_0x0456('0x2c')][_0x0456('0x2e')]?_0x2d1371[_0x0456('0x2c')]:_0x1428d2['model'];_0x2d1371[_0x0456('0x30')]=qs[_0x0456('0x31')](_0xc1d5f8['query'][_0x0456('0x31')]);_0x2d1371[_0x0456('0x32')]=qs[_0x0456('0x29')](_[_0x0456('0x52')](_0xc1d5f8[_0x0456('0x27')],_0x1428d2[_0x0456('0x29')]));if(_0xc1d5f8[_0x0456('0x27')][_0x0456('0x35')]){_0x2d1371[_0x0456('0x32')]=_['merge'](_0x2d1371[_0x0456('0x32')],{'$or':_[_0x0456('0x24')](_0x2d1371[_0x0456('0x2c')],function(_0xfd249d){var _0x13bad8={};_0x13bad8[_0xfd249d]={'$like':'%'+_0xc1d5f8[_0x0456('0x27')]['filter']+'%'};return _0x13bad8;})});}_0x2d1371=_[_0x0456('0x33')]({},_0x2d1371,_0xc1d5f8['options']);return _0x3f7b99['getLists'](_0x2d1371);}})[_0x0456('0x1b')](function(_0x550a28){if(_0x550a28){_0x3f0084=_0x550a28[_0x0456('0x2e')];if(!_0xc1d5f8[_0x0456('0x27')]['hasOwnProperty'](_0x0456('0x51'))){_0x2d1371[_0x0456('0x17')]=qs['limit'](_0xc1d5f8['query']['limit']);_0x2d1371['offset']=qs[_0x0456('0x15')](_0xc1d5f8[_0x0456('0x27')][_0x0456('0x15')]);}return _0x3f7b99['getLists'](_0x2d1371);}})[_0x0456('0x1b')](function(_0x3da977){if(_0x3da977){return _0x3da977?{'count':_0x3f0084,'rows':_0x3da977}:null;}})[_0x0456('0x1b')](respondWithResult(_0x2dd299,null))[_0x0456('0x3c')](handleError(_0x2dd299,null));};exports[_0x0456('0x5b')]=function(_0x1eee76,_0x4116d4,_0x6e092e){var _0xa76321,_0x3d978f;var _0x438f73=[];var _0x13f674=moment()[_0x0456('0x5c')](_0x0456('0x5d'));return db[_0x0456('0x36')][_0x0456('0x45')]({'where':{'id':_0x1eee76['params']['id']}})['then'](handleEntityNotFound(_0x4116d4,null))[_0x0456('0x1b')](function(_0x28f07e){if(_0x28f07e){_0x3d978f=_0x28f07e;return _0x28f07e[_0x0456('0x5b')](_0x1eee76['body'][_0x0456('0x5e')],_['omit'](_0x1eee76['body'],[_0x0456('0x5e'),'id'])||{});}return null;})['spread'](function(_0xfd6f54){var _0x497917;var _0x565165;_0xa76321=_0xfd6f54||[];var _0x15a620=[];if(_0xfd6f54){for(var _0x46ca56=0x0;_0x46ca56<_0xfd6f54[_0x0456('0x2e')];_0x46ca56+=0x1){var _0x3ffed1=_0xfd6f54[_0x46ca56][_0x0456('0x1d')]({'plain':!![]});_0x3d978f['dialCheckDuplicateType']=_0x1eee76[_0x0456('0x4d')][_0x0456('0x5f')]?_0x1eee76[_0x0456('0x4d')]['dialCheckDuplicateType']:_0x3d978f[_0x0456('0x5f')];switch(_0x3d978f[_0x0456('0x5f')]){case'always':_0x497917=squel['insert']()[_0x0456('0x60')](_0x0456('0x61'))[_0x0456('0x62')](['phone',_0x0456('0x63'),_0x0456('0x64'),_0x0456('0x65'),_0x0456('0x53'),_0x0456('0x4b'),'updatedAt'],squel['select']()[_0x0456('0x66')](_0x0456('0x67'),_0x0456('0x67'))[_0x0456('0x66')](_0x0456('0x68'),_0x0456('0x63'))['field']('id',_0x0456('0x64'))[_0x0456('0x66')](_0x3ffed1[_0x0456('0x69')][_0x0456('0x6a')](),_0x0456('0x65'))[_0x0456('0x66')](_0x1eee76[_0x0456('0x3d')]['id'][_0x0456('0x6a')](),'CampaignId')[_0x0456('0x66')]('\x27'+_0x13f674+'\x27',_0x0456('0x4b'))[_0x0456('0x66')]('\x27'+_0x13f674+'\x27','updatedAt')['from'](_0x0456('0x6b'))[_0x0456('0x32')](_0x0456('0x6c'))[_0x0456('0x32')](_0x0456('0x6d'),_0x3ffed1[_0x0456('0x69')]['toString']())[_0x0456('0x32')](_0x0456('0x6e'))[_0x0456('0x32')](_0x0456('0x6f'),squel[_0x0456('0x70')]()[_0x0456('0x66')](_0x0456('0x71'))['from'](_0x0456('0x72'))[_0x0456('0x32')](_0x0456('0x73'),_0x1eee76['params']['id'][_0x0456('0x6a')]()))[_0x0456('0x32')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x0456('0x66')](_0x0456('0x74'))[_0x0456('0x75')](_0x0456('0x61'))['where'](_0x0456('0x73'),_0x1eee76['params']['id'][_0x0456('0x6a')]())))[_0x0456('0x6a')]();break;case _0x0456('0x76'):_0x497917=squel[_0x0456('0x77')]()['into'](_0x0456('0x61'))[_0x0456('0x62')]([_0x0456('0x67'),_0x0456('0x63'),_0x0456('0x64'),_0x0456('0x65'),_0x0456('0x53'),_0x0456('0x4b'),_0x0456('0x4c')],squel[_0x0456('0x70')]()[_0x0456('0x66')](_0x0456('0x67'),'phone')['field'](_0x0456('0x68'),'scheduledAt')[_0x0456('0x66')]('id',_0x0456('0x64'))['field'](_0x3ffed1['CmListId'][_0x0456('0x6a')](),_0x0456('0x65'))[_0x0456('0x66')](_0x1eee76[_0x0456('0x3d')]['id'][_0x0456('0x6a')](),'CampaignId')[_0x0456('0x66')]('\x27'+_0x13f674+'\x27',_0x0456('0x4b'))['field']('\x27'+_0x13f674+'\x27',_0x0456('0x4c'))[_0x0456('0x75')]('cm_contacts')[_0x0456('0x32')](_0x0456('0x6c'))['where'](_0x0456('0x6d'),_0x3ffed1[_0x0456('0x69')][_0x0456('0x6a')]())[_0x0456('0x32')](_0x0456('0x6e'))['where'](_0x0456('0x6f'),squel['select']()[_0x0456('0x66')](_0x0456('0x74'))[_0x0456('0x75')](_0x0456('0x61'))['where'](_0x0456('0x73'),_0x1eee76[_0x0456('0x3d')]['id']['toString']())))[_0x0456('0x6a')]();break;default:_0x497917=squel[_0x0456('0x77')]()[_0x0456('0x60')]('cm_hopper')[_0x0456('0x62')]([_0x0456('0x67'),_0x0456('0x63'),_0x0456('0x64'),_0x0456('0x65'),_0x0456('0x53'),_0x0456('0x4b'),_0x0456('0x4c')],squel[_0x0456('0x70')]()[_0x0456('0x66')](_0x0456('0x67'),_0x0456('0x67'))[_0x0456('0x66')]('NOW()',_0x0456('0x63'))['field']('id',_0x0456('0x64'))[_0x0456('0x66')](_0x3ffed1[_0x0456('0x69')][_0x0456('0x6a')](),_0x0456('0x65'))[_0x0456('0x66')](_0x1eee76['params']['id'][_0x0456('0x6a')](),_0x0456('0x53'))['field']('\x27'+_0x13f674+'\x27',_0x0456('0x4b'))['field']('\x27'+_0x13f674+'\x27',_0x0456('0x4c'))[_0x0456('0x75')](_0x0456('0x6b'))['where'](_0x0456('0x6c'))['where'](_0x0456('0x6d'),_0x3ffed1[_0x0456('0x69')][_0x0456('0x6a')]())['where'](_0x0456('0x6e')))[_0x0456('0x6a')]();}_0x565165=squel[_0x0456('0x77')]()[_0x0456('0x60')](_0x0456('0x78'))[_0x0456('0x62')]([_0x0456('0x79'),_0x0456('0x63'),_0x0456('0x67'),_0x0456('0x7a'),_0x0456('0x4b'),'updatedAt'],squel[_0x0456('0x70')]()[_0x0456('0x66')](_0x0456('0x7b'),'id')[_0x0456('0x66')](_0x0456('0x68'),_0x0456('0x63'))[_0x0456('0x66')](_0x0456('0x7c'),_0x0456('0x67'))[_0x0456('0x66')](_0x0456('0x7d'),_0x0456('0x7a'))['field']('\x27'+_0x13f674+'\x27',_0x0456('0x4b'))[_0x0456('0x66')]('\x27'+_0x13f674+'\x27',_0x0456('0x4c'))[_0x0456('0x75')]('cm_contact_has_items','ci')[_0x0456('0x7e')](_0x0456('0x61'),'h','h.ContactId\x20=\x20ci.CmContactId')['where']('h.ListId\x20=\x20?',_0x3ffed1[_0x0456('0x69')][_0x0456('0x6a')]())[_0x0456('0x32')](_0x0456('0x7f'),_0x1eee76[_0x0456('0x3d')]['id'][_0x0456('0x6a')]())['where']('h.createdAt\x20=\x20?',_0x13f674))[_0x0456('0x6a')]();_0x15a620['push'](db[_0x0456('0x80')][_0x0456('0x27')](_0x497917));_0x438f73[_0x0456('0x81')](db[_0x0456('0x80')]['query'](_0x565165));}return BPromise[_0x0456('0x82')](_0x15a620);}})['then'](function(){return BPromise['all'](_0x438f73);})['then'](function(){return _0xa76321;})[_0x0456('0x1b')](respondWithResult(_0x4116d4,null))['catch'](handleError(_0x4116d4,null));};exports[_0x0456('0x83')]=function(_0x17060f,_0x55c59c,_0x217f4d){return db[_0x0456('0x36')]['find']({'where':{'id':_0x17060f[_0x0456('0x3d')]['id']}})[_0x0456('0x1b')](handleEntityNotFound(_0x55c59c,null))[_0x0456('0x1b')](function(_0x4daed4){if(_0x4daed4){return _0x4daed4['removeLists'](_0x17060f['query']['ids']);}})[_0x0456('0x1b')](function(_0x27fa32){if(_0x27fa32){return db[_0x0456('0x50')][_0x0456('0x1c')]({'where':{'ListId':_0x17060f[_0x0456('0x27')][_0x0456('0x5e')],'CampaignId':_0x17060f['params']['id']}})[_0x0456('0x1b')](function(){return _0x27fa32;});}})['then'](respondWithStatusCode(_0x55c59c,null))[_0x0456('0x3c')](handleError(_0x55c59c,null));};exports[_0x0456('0x84')]=function(_0x10227a,_0x4bbd20,_0x53a8f8){var _0x52baa8={};var _0x24741c={};var _0x57d57b;var _0x1a3bc3;return db[_0x0456('0x36')][_0x0456('0x56')]({'where':{'id':_0x10227a[_0x0456('0x3d')]['id']}})[_0x0456('0x1b')](handleEntityNotFound(_0x4bbd20,null))[_0x0456('0x1b')](function(_0x2a3900){if(_0x2a3900){_0x57d57b=_0x2a3900;_0x24741c[_0x0456('0x2b')]=_[_0x0456('0x28')](db[_0x0456('0x5a')]['rawAttributes']);_0x24741c[_0x0456('0x27')]=_[_0x0456('0x28')](_0x10227a[_0x0456('0x27')]);_0x24741c[_0x0456('0x29')]=_[_0x0456('0x2a')](_0x24741c[_0x0456('0x2b')],_0x24741c[_0x0456('0x27')]);_0x52baa8['attributes']=_['intersection'](_0x24741c[_0x0456('0x2b')],qs[_0x0456('0x2d')](_0x10227a[_0x0456('0x27')][_0x0456('0x2d')]));_0x52baa8[_0x0456('0x2c')]=_0x52baa8['attributes'][_0x0456('0x2e')]?_0x52baa8['attributes']:_0x24741c[_0x0456('0x2b')];_0x52baa8[_0x0456('0x30')]=qs['sort'](_0x10227a[_0x0456('0x27')][_0x0456('0x31')]);_0x52baa8['where']=qs[_0x0456('0x29')](_[_0x0456('0x52')](_0x10227a[_0x0456('0x27')],_0x24741c[_0x0456('0x29')]));if(_0x10227a['query']['filter']){_0x52baa8[_0x0456('0x32')]=_[_0x0456('0x33')](_0x52baa8[_0x0456('0x32')],{'$or':_[_0x0456('0x24')](_0x52baa8[_0x0456('0x2c')],function(_0x2af2a7){var _0x45fb21={};_0x45fb21[_0x2af2a7]={'$like':'%'+_0x10227a['query']['filter']+'%'};return _0x45fb21;})});}_0x52baa8=_[_0x0456('0x33')]({},_0x52baa8,_0x10227a[_0x0456('0x3e')]);return _0x57d57b['getBlackLists'](_0x52baa8);}})[_0x0456('0x1b')](function(_0x5a2ae1){if(_0x5a2ae1){_0x1a3bc3=_0x5a2ae1[_0x0456('0x2e')];if(!_0x10227a[_0x0456('0x27')]['hasOwnProperty'](_0x0456('0x51'))){_0x52baa8[_0x0456('0x17')]=qs[_0x0456('0x17')](_0x10227a['query'][_0x0456('0x17')]);_0x52baa8[_0x0456('0x15')]=qs[_0x0456('0x15')](_0x10227a['query'][_0x0456('0x15')]);}return _0x57d57b[_0x0456('0x84')](_0x52baa8);}})['then'](function(_0x50cebd){if(_0x50cebd){return _0x50cebd?{'count':_0x1a3bc3,'rows':_0x50cebd}:null;}})[_0x0456('0x1b')](respondWithResult(_0x4bbd20,null))[_0x0456('0x3c')](handleError(_0x4bbd20,null));};exports[_0x0456('0x85')]=function(_0x5a56ce,_0x3ca5df,_0x490ff4){var _0x468c6d,_0x47acb1;var _0x2c4b8c=[];var _0x47abf8=moment()[_0x0456('0x5c')](_0x0456('0x5d'));return db[_0x0456('0x36')][_0x0456('0x45')]({'where':{'id':_0x5a56ce[_0x0456('0x3d')]['id']}})[_0x0456('0x1b')](handleEntityNotFound(_0x3ca5df,null))['then'](function(_0x2233cb){if(_0x2233cb){_0x47acb1=_0x2233cb;return _0x2233cb[_0x0456('0x85')](_0x5a56ce[_0x0456('0x4d')][_0x0456('0x5e')],_[_0x0456('0x4a')](_0x5a56ce['body'],[_0x0456('0x5e'),'id'])||{});}return null;})['spread'](function(_0x25d616){var _0x148a0c;var _0x3f7b80;_0x468c6d=_0x25d616||[];var _0x13e4fe=[];if(_0x25d616){for(var _0x995570=0x0;_0x995570<_0x25d616['length'];_0x995570+=0x1){var _0x147a22=_0x25d616[_0x995570][_0x0456('0x1d')]({'plain':!![]});_0x148a0c=squel[_0x0456('0x77')]()[_0x0456('0x60')](_0x0456('0x86'))[_0x0456('0x62')]([_0x0456('0x67'),'ContactId',_0x0456('0x65'),'CampaignId',_0x0456('0x4b'),'updatedAt'],squel['select']()[_0x0456('0x66')](_0x0456('0x67'),'phone')[_0x0456('0x66')]('id',_0x0456('0x64'))[_0x0456('0x66')](_0x147a22[_0x0456('0x69')][_0x0456('0x6a')](),'ListId')[_0x0456('0x66')](_0x5a56ce[_0x0456('0x3d')]['id'][_0x0456('0x6a')](),_0x0456('0x53'))[_0x0456('0x66')](_0x0456('0x68'),_0x0456('0x4b'))[_0x0456('0x66')]('NOW()','updatedAt')[_0x0456('0x75')]('cm_contacts')[_0x0456('0x32')](_0x0456('0x6c'))['where'](_0x0456('0x6d'),_0x147a22[_0x0456('0x69')][_0x0456('0x6a')]())[_0x0456('0x32')]('phone\x20IS\x20NOT\x20NULL'))[_0x0456('0x6a')]();_0x13e4fe['push'](db[_0x0456('0x80')][_0x0456('0x27')](_0x148a0c));}return BPromise[_0x0456('0x82')](_0x13e4fe);}})['then'](function(){return _0x468c6d;})[_0x0456('0x1b')](respondWithResult(_0x3ca5df,null))[_0x0456('0x3c')](handleError(_0x3ca5df,null));};exports[_0x0456('0x87')]=function(_0x162df4,_0x44dd07,_0x58ebfd){return db['Campaign'][_0x0456('0x45')]({'where':{'id':_0x162df4['params']['id']}})[_0x0456('0x1b')](handleEntityNotFound(_0x44dd07,null))[_0x0456('0x1b')](function(_0x26d5ec){if(_0x26d5ec){return _0x26d5ec[_0x0456('0x87')](_0x162df4[_0x0456('0x27')][_0x0456('0x5e')]);}})[_0x0456('0x1b')](function(_0x4658b){if(_0x4658b){return db[_0x0456('0x59')][_0x0456('0x1c')]({'where':{'ListId':_0x162df4[_0x0456('0x27')][_0x0456('0x5e')],'CampaignId':_0x162df4[_0x0456('0x3d')]['id']}})[_0x0456('0x1b')](function(){return _0x4658b;});}})[_0x0456('0x1b')](respondWithStatusCode(_0x44dd07,null))[_0x0456('0x3c')](handleError(_0x44dd07,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index d165e81..0819465 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 _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x47fd36,_0x41535d){var _0x21a0fc=function(_0x44c07c){while(--_0x44c07c){_0x47fd36['push'](_0x47fd36['shift']());}};_0x21a0fc(++_0x41535d);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x1345fa,_0x11947a){var _0xc32585=function(_0x178016){while(--_0x178016){_0x1345fa['push'](_0x1345fa['shift']());}};_0xc32585(++_0x11947a);}(_0x7a54,0x106));var _0x47a5=function(_0x42bb34,_0x3a16cc){_0x42bb34=_0x42bb34-0x0;var _0x8c651d=_0x7a54[_0x42bb34];return _0x8c651d;};'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 diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index 3559631..8346f4e 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 _0x177a=['include','model','GetCampaign','stringify','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','options','raw','attributes','limit','map'];(function(_0x2c6575,_0x13c4ea){var _0x2c12a0=function(_0x2d6802){while(--_0x2d6802){_0x2c6575['push'](_0x2c6575['shift']());}};_0x2c12a0(++_0x13c4ea);}(_0x177a,0xdd));var _0xa177=function(_0x973559,_0x13866c){_0x973559=_0x973559-0x0;var _0x885b19=_0x177a[_0x973559];return _0x885b19;};'use strict';var _=require(_0xa177('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa177('0x1'));var rs=require(_0xa177('0x2'));var fs=require('fs');var Redis=require(_0xa177('0x3'));var db=require(_0xa177('0x4'))['db'];var utils=require(_0xa177('0x5'));var logger=require(_0xa177('0x6'))('rpc');var config=require(_0xa177('0x7'));var jayson=require(_0xa177('0x8'));var client=jayson[_0xa177('0x9')][_0xa177('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x34b6a7,_0xb27b2,_0x331b53){return new BPromise(function(_0x11a535,_0x55bf0f){return client[_0xa177('0xb')](_0x34b6a7,_0x331b53)['then'](function(_0x2a8a12){logger[_0xa177('0xc')](_0xa177('0xd'),_0xb27b2,_0xa177('0xe'));logger[_0xa177('0xf')](_0xa177('0x10'),_0xb27b2,_0xa177('0xe'),JSON['stringify'](_0x2a8a12));if(_0x2a8a12[_0xa177('0x11')]){if(_0x2a8a12[_0xa177('0x11')][_0xa177('0x12')]===0x1f4){logger[_0xa177('0x11')](_0xa177('0xd'),_0xb27b2,_0x2a8a12[_0xa177('0x11')][_0xa177('0x13')]);return _0x55bf0f(_0x2a8a12['error']['message']);}logger[_0xa177('0x11')](_0xa177('0xd'),_0xb27b2,_0x2a8a12[_0xa177('0x11')][_0xa177('0x13')]);return _0x11a535(_0x2a8a12[_0xa177('0x11')][_0xa177('0x13')]);}else{logger[_0xa177('0xc')](_0xa177('0xd'),_0xb27b2,_0xa177('0xe'));_0x11a535(_0x2a8a12[_0xa177('0x14')][_0xa177('0x13')]);}})[_0xa177('0x15')](function(_0x5445da){logger[_0xa177('0x11')](_0xa177('0xd'),_0xb27b2,_0x5445da);_0x55bf0f(_0x5445da);});});}exports['GetCampaign']=function(_0x5e6ae3){var _0x2f30d4=this;return new Promise(function(_0x11b060,_0x4042b2){return db['Campaign']['findAll']({'raw':_0x5e6ae3['options']?_0x5e6ae3[_0xa177('0x16')][_0xa177('0x17')]===undefined?!![]:![]:!![],'where':_0x5e6ae3[_0xa177('0x16')]?_0x5e6ae3[_0xa177('0x16')]['where']||null:null,'attributes':_0x5e6ae3[_0xa177('0x16')]?_0x5e6ae3['options'][_0xa177('0x18')]||null:null,'limit':_0x5e6ae3['options']?_0x5e6ae3[_0xa177('0x16')][_0xa177('0x19')]||null:null,'include':_0x5e6ae3[_0xa177('0x16')]?_0x5e6ae3[_0xa177('0x16')]['include']?_[_0xa177('0x1a')](_0x5e6ae3[_0xa177('0x16')][_0xa177('0x1b')],function(_0x4bc686){return{'model':db[_0x4bc686['model']],'as':_0x4bc686['as'],'attributes':_0x4bc686['attributes'],'include':_0x4bc686['include']?_[_0xa177('0x1a')](_0x4bc686[_0xa177('0x1b')],function(_0x1cf775){return{'model':db[_0x1cf775[_0xa177('0x1c')]],'as':_0x1cf775['as'],'attributes':_0x1cf775[_0xa177('0x18')],'include':_0x1cf775['include']?_[_0xa177('0x1a')](_0x1cf775[_0xa177('0x1b')],function(_0x479587){return{'model':db[_0x479587['model']],'as':_0x479587['as'],'attributes':_0x479587[_0xa177('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x55f460){logger['info'](_0xa177('0x1d'),_0x5e6ae3);logger['debug'](_0xa177('0x1d'),_0x5e6ae3,JSON[_0xa177('0x1e')](_0x55f460));_0x11b060(_0x55f460);})[_0xa177('0x15')](function(_0x5f20d4){logger[_0xa177('0x11')](_0xa177('0x1d'),_0x5f20d4['message'],_0x5e6ae3);_0x4042b2(_0x2f30d4[_0xa177('0x11')](0x1f4,_0x5f20d4[_0xa177('0x13')]));});});}; \ No newline at end of file +var _0x55e0=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCampaign','Campaign','options','where','attributes','limit','include','map','model','stringify','lodash','util','moment','bluebird'];(function(_0x3251e4,_0x223733){var _0x4f5337=function(_0x40460a){while(--_0x40460a){_0x3251e4['push'](_0x3251e4['shift']());}};_0x4f5337(++_0x223733);}(_0x55e0,0xdc));var _0x055e=function(_0x17a8af,_0x37e31c){_0x17a8af=_0x17a8af-0x0;var _0x1b8a05=_0x55e0[_0x17a8af];return _0x1b8a05;};'use strict';var _=require(_0x055e('0x0'));var util=require(_0x055e('0x1'));var moment=require(_0x055e('0x2'));var BPromise=require(_0x055e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x055e('0x4'))['db'];var utils=require(_0x055e('0x5'));var logger=require(_0x055e('0x6'))(_0x055e('0x7'));var config=require(_0x055e('0x8'));var jayson=require(_0x055e('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4384ff,_0x4a442e,_0x8e7824){return new BPromise(function(_0x3c4cf,_0x376618){return client[_0x055e('0xa')](_0x4384ff,_0x8e7824)[_0x055e('0xb')](function(_0x49540c){logger[_0x055e('0xc')](_0x055e('0xd'),_0x4a442e,_0x055e('0xe'));logger[_0x055e('0xf')](_0x055e('0x10'),_0x4a442e,'request\x20sent',JSON['stringify'](_0x49540c));if(_0x49540c[_0x055e('0x11')]){if(_0x49540c['error'][_0x055e('0x12')]===0x1f4){logger[_0x055e('0x11')](_0x055e('0xd'),_0x4a442e,_0x49540c[_0x055e('0x11')][_0x055e('0x13')]);return _0x376618(_0x49540c[_0x055e('0x11')][_0x055e('0x13')]);}logger['error'](_0x055e('0xd'),_0x4a442e,_0x49540c[_0x055e('0x11')][_0x055e('0x13')]);return _0x3c4cf(_0x49540c[_0x055e('0x11')][_0x055e('0x13')]);}else{logger['info'](_0x055e('0xd'),_0x4a442e,_0x055e('0xe'));_0x3c4cf(_0x49540c[_0x055e('0x14')]['message']);}})[_0x055e('0x15')](function(_0x2c377c){logger[_0x055e('0x11')](_0x055e('0xd'),_0x4a442e,_0x2c377c);_0x376618(_0x2c377c);});});}exports[_0x055e('0x16')]=function(_0x4c85dd){var _0x36ef10=this;return new Promise(function(_0x2cf3de,_0x2f4a06){return db[_0x055e('0x17')]['findAll']({'raw':_0x4c85dd[_0x055e('0x18')]?_0x4c85dd[_0x055e('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x4c85dd[_0x055e('0x18')]?_0x4c85dd[_0x055e('0x18')][_0x055e('0x19')]||null:null,'attributes':_0x4c85dd[_0x055e('0x18')]?_0x4c85dd[_0x055e('0x18')][_0x055e('0x1a')]||null:null,'limit':_0x4c85dd['options']?_0x4c85dd[_0x055e('0x18')][_0x055e('0x1b')]||null:null,'include':_0x4c85dd[_0x055e('0x18')]?_0x4c85dd['options'][_0x055e('0x1c')]?_[_0x055e('0x1d')](_0x4c85dd[_0x055e('0x18')][_0x055e('0x1c')],function(_0x51df23){return{'model':db[_0x51df23[_0x055e('0x1e')]],'as':_0x51df23['as'],'attributes':_0x51df23['attributes'],'include':_0x51df23[_0x055e('0x1c')]?_[_0x055e('0x1d')](_0x51df23[_0x055e('0x1c')],function(_0x1a76c6){return{'model':db[_0x1a76c6[_0x055e('0x1e')]],'as':_0x1a76c6['as'],'attributes':_0x1a76c6[_0x055e('0x1a')],'include':_0x1a76c6['include']?_[_0x055e('0x1d')](_0x1a76c6[_0x055e('0x1c')],function(_0x2a82f8){return{'model':db[_0x2a82f8['model']],'as':_0x2a82f8['as'],'attributes':_0x2a82f8[_0x055e('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x055e('0xb')](function(_0x42f2df){logger[_0x055e('0xc')]('GetCampaign',_0x4c85dd);logger[_0x055e('0xf')]('GetCampaign',_0x4c85dd,JSON[_0x055e('0x1f')](_0x42f2df));_0x2cf3de(_0x42f2df);})[_0x055e('0x15')](function(_0x23a506){logger[_0x055e('0x11')](_0x055e('0x16'),_0x23a506['message'],_0x4c85dd);_0x2f4a06(_0x36ef10[_0x055e('0x11')](0x1f4,_0x23a506[_0x055e('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 9691d96..7cbc4b4 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 _0x9f47=['addBlackLists','put','/:id','update','delete','destroy','removeLists','removeBlackLists','exports','path','connect-timeout','express','Router','fs-extra','../../config/environment','./campaign.controller','get','index','/:id/hoppers','isAuthenticated','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','/:id/blacklists','post','/:id/clone','clone','/:id/lists'];(function(_0x213322,_0x3b6b24){var _0x1f66bb=function(_0x1907e8){while(--_0x1907e8){_0x213322['push'](_0x213322['shift']());}};_0x1f66bb(++_0x3b6b24);}(_0x9f47,0x1e9));var _0x79f4=function(_0x5162dd,_0x5a2734){_0x5162dd=_0x5162dd-0x0;var _0x307114=_0x9f47[_0x5162dd];return _0x307114;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x79f4('0x0'));var timeout=require(_0x79f4('0x1'));var express=require(_0x79f4('0x2'));var router=express[_0x79f4('0x3')]();var fs_extra=require(_0x79f4('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x79f4('0x5'));var controller=require(_0x79f4('0x6'));router[_0x79f4('0x7')]('/',auth['isAuthenticated'](),controller[_0x79f4('0x8')]);router[_0x79f4('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x79f4('0x7')](_0x79f4('0x9'),auth[_0x79f4('0xa')](),controller[_0x79f4('0xb')]);router[_0x79f4('0x7')](_0x79f4('0xc'),auth[_0x79f4('0xa')](),controller['getHopperHistories']);router['get'](_0x79f4('0xd'),auth[_0x79f4('0xa')](),controller[_0x79f4('0xe')]);router[_0x79f4('0x7')]('/:id/hopper_black',auth[_0x79f4('0xa')](),controller[_0x79f4('0xf')]);router['get']('/:id/lists',auth['isAuthenticated'](),controller['getLists']);router[_0x79f4('0x7')](_0x79f4('0x10'),auth['isAuthenticated'](),controller['getBlackLists']);router[_0x79f4('0x11')]('/',auth[_0x79f4('0xa')](),controller['create']);router[_0x79f4('0x11')](_0x79f4('0x12'),auth['isAuthenticated'](),controller[_0x79f4('0x13')]);router['post'](_0x79f4('0x14'),auth[_0x79f4('0xa')](),controller['addLists']);router[_0x79f4('0x11')]('/:id/blacklists',auth[_0x79f4('0xa')](),controller[_0x79f4('0x15')]);router[_0x79f4('0x16')](_0x79f4('0x17'),auth[_0x79f4('0xa')](),controller[_0x79f4('0x18')]);router[_0x79f4('0x19')](_0x79f4('0x17'),auth[_0x79f4('0xa')](),controller[_0x79f4('0x1a')]);router[_0x79f4('0x19')]('/:id/lists',auth[_0x79f4('0xa')](),controller[_0x79f4('0x1b')]);router[_0x79f4('0x19')](_0x79f4('0x10'),auth[_0x79f4('0xa')](),controller[_0x79f4('0x1c')]);module[_0x79f4('0x1d')]=router; \ No newline at end of file +var _0xf0a5=['clone','addLists','addBlackLists','put','update','delete','removeLists','removeBlackLists','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone'];(function(_0x250817,_0x43af8b){var _0x5e1936=function(_0x1d8dd4){while(--_0x1d8dd4){_0x250817['push'](_0x250817['shift']());}};_0x5e1936(++_0x43af8b);}(_0xf0a5,0x174));var _0x5f0a=function(_0x591734,_0x3d2262){_0x591734=_0x591734-0x0;var _0x30555f=_0xf0a5[_0x591734];return _0x30555f;};'use strict';var multer=require('multer');var util=require(_0x5f0a('0x0'));var path=require(_0x5f0a('0x1'));var timeout=require(_0x5f0a('0x2'));var express=require('express');var router=express[_0x5f0a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5f0a('0x4'));var interaction=require(_0x5f0a('0x5'));var config=require('../../config/environment');var controller=require(_0x5f0a('0x6'));router[_0x5f0a('0x7')]('/',auth[_0x5f0a('0x8')](),controller[_0x5f0a('0x9')]);router['get'](_0x5f0a('0xa'),auth[_0x5f0a('0x8')](),controller[_0x5f0a('0xb')]);router['get'](_0x5f0a('0xc'),auth['isAuthenticated'](),controller[_0x5f0a('0xd')]);router[_0x5f0a('0x7')]('/:id/hopper_histories',auth[_0x5f0a('0x8')](),controller[_0x5f0a('0xe')]);router[_0x5f0a('0x7')](_0x5f0a('0xf'),auth[_0x5f0a('0x8')](),controller['getHopperFinals']);router[_0x5f0a('0x7')](_0x5f0a('0x10'),auth[_0x5f0a('0x8')](),controller[_0x5f0a('0x11')]);router[_0x5f0a('0x7')](_0x5f0a('0x12'),auth[_0x5f0a('0x8')](),controller['getLists']);router[_0x5f0a('0x7')](_0x5f0a('0x13'),auth[_0x5f0a('0x8')](),controller[_0x5f0a('0x14')]);router[_0x5f0a('0x15')]('/',auth[_0x5f0a('0x8')](),controller[_0x5f0a('0x16')]);router[_0x5f0a('0x15')](_0x5f0a('0x17'),auth[_0x5f0a('0x8')](),controller[_0x5f0a('0x18')]);router[_0x5f0a('0x15')](_0x5f0a('0x12'),auth[_0x5f0a('0x8')](),controller[_0x5f0a('0x19')]);router[_0x5f0a('0x15')](_0x5f0a('0x13'),auth['isAuthenticated'](),controller[_0x5f0a('0x1a')]);router[_0x5f0a('0x1b')]('/:id',auth['isAuthenticated'](),controller[_0x5f0a('0x1c')]);router['delete'](_0x5f0a('0xa'),auth['isAuthenticated'](),controller['destroy']);router[_0x5f0a('0x1d')]('/:id/lists',auth[_0x5f0a('0x8')](),controller[_0x5f0a('0x1e')]);router['delete'](_0x5f0a('0x13'),auth[_0x5f0a('0x8')](),controller[_0x5f0a('0x1f')]);module[_0x5f0a('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 5332520..46b9469 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 _0xb236=['key','exports','STRING','TEXT','VIRTUAL'];(function(_0x3bd0dc,_0xf35688){var _0x4d9f39=function(_0x56a099){while(--_0x56a099){_0x3bd0dc['push'](_0x3bd0dc['shift']());}};_0x4d9f39(++_0xf35688);}(_0xb236,0x10a));var _0x6b23=function(_0x278470,_0x16422e){_0x278470=_0x278470-0x0;var _0x2ea89a=_0xb236[_0x278470];return _0x2ea89a;};'use strict';var Sequelize=require('sequelize');module[_0x6b23('0x0')]={'key':{'type':Sequelize[_0x6b23('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x6b23('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x6b23('0x1')]},'name':{'type':Sequelize[_0x6b23('0x3')],'get':function(){return this['getDataValue'](_0x6b23('0x4'));}}}; \ No newline at end of file +var _0xa6ef=['STRING','TEXT','VIRTUAL','key','sequelize','exports'];(function(_0x1bba0b,_0x48548d){var _0x5375ee=function(_0x1fd8fd){while(--_0x1fd8fd){_0x1bba0b['push'](_0x1bba0b['shift']());}};_0x5375ee(++_0x48548d);}(_0xa6ef,0x154));var _0xfa6e=function(_0x2a3ab2,_0x1f005c){_0x2a3ab2=_0x2a3ab2-0x0;var _0x3dd8c5=_0xa6ef[_0x2a3ab2];return _0x3dd8c5;};'use strict';var Sequelize=require(_0xfa6e('0x0'));module[_0xfa6e('0x1')]={'key':{'type':Sequelize[_0xfa6e('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xfa6e('0x3')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xfa6e('0x4')],'get':function(){return this['getDataValue'](_0xfa6e('0x5'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index d831d99..bbfb7c1 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 _0xbc5b=['findAll','rows','catch','show','params','find','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','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/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','error','stack','name','send','index','CannedAnswer','rawAttributes','type','key','map','query','keys','filters','intersection','model','fields','attributes','order','sort','where','pick','filter','merge','options','includeAll','include'];(function(_0x41d80f,_0x32841d){var _0x317fe6=function(_0x4011a8){while(--_0x4011a8){_0x41d80f['push'](_0x41d80f['shift']());}};_0x317fe6(++_0x32841d);}(_0xbc5b,0x124));var _0xbbc5=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xbc5b[_0x2c91e9];return _0x13f0ff;};'use strict';var emlformat=require(_0xbbc5('0x0'));var rimraf=require(_0xbbc5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbbc5('0x2'));var rp=require(_0xbbc5('0x3'));var moment=require(_0xbbc5('0x4'));var BPromise=require(_0xbbc5('0x5'));var Mustache=require('mustache');var util=require(_0xbbc5('0x6'));var path=require('path');var sox=require(_0xbbc5('0x7'));var csv=require(_0xbbc5('0x8'));var ejs=require(_0xbbc5('0x9'));var fs=require('fs');var fs_extra=require(_0xbbc5('0xa'));var _=require(_0xbbc5('0xb'));var squel=require(_0xbbc5('0xc'));var crypto=require(_0xbbc5('0xd'));var jsforce=require(_0xbbc5('0xe'));var deskjs=require(_0xbbc5('0xf'));var toCsv=require(_0xbbc5('0x8'));var querystring=require(_0xbbc5('0x10'));var Papa=require('papaparse');var Redis=require(_0xbbc5('0x11'));var authService=require(_0xbbc5('0x12'));var qs=require(_0xbbc5('0x13'));var as=require(_0xbbc5('0x14'));var hardwareService=require(_0xbbc5('0x15'));var logger=require(_0xbbc5('0x16'))(_0xbbc5('0x17'));var utils=require(_0xbbc5('0x18'));var config=require(_0xbbc5('0x19'));var licenseUtil=require(_0xbbc5('0x1a'));var db=require(_0xbbc5('0x1b'))['db'];function respondWithStatusCode(_0x18907d,_0x3123e1){_0x3123e1=_0x3123e1||0xcc;return function(_0x1b0168){if(_0x1b0168){return _0x18907d[_0xbbc5('0x1c')](_0x3123e1);}return _0x18907d[_0xbbc5('0x1d')](_0x3123e1)[_0xbbc5('0x1e')]();};}function respondWithResult(_0x226e4b,_0x2c6214){_0x2c6214=_0x2c6214||0xc8;return function(_0x368600){if(_0x368600){return _0x226e4b[_0xbbc5('0x1d')](_0x2c6214)[_0xbbc5('0x1f')](_0x368600);}};}function respondWithFilteredResult(_0x18c243,_0x43ec18){return function(_0x137b28){if(_0x137b28){var _0x2ca92a=typeof _0x43ec18[_0xbbc5('0x20')]===_0xbbc5('0x21')&&typeof _0x43ec18[_0xbbc5('0x22')]===_0xbbc5('0x21');var _0x2153ca=_0x137b28[_0xbbc5('0x23')];var _0x534b43=_0x2ca92a?0x0:_0x43ec18[_0xbbc5('0x20')];var _0x290a12=_0x2ca92a?_0x137b28[_0xbbc5('0x23')]:_0x43ec18[_0xbbc5('0x20')]+_0x43ec18[_0xbbc5('0x22')];var _0x163e45;if(_0x290a12>=_0x2153ca){_0x290a12=_0x2153ca;_0x163e45=0xc8;}else{_0x163e45=0xce;}_0x18c243[_0xbbc5('0x1d')](_0x163e45);return _0x18c243[_0xbbc5('0x24')]('Content-Range',_0x534b43+'-'+_0x290a12+'/'+_0x2153ca)['json'](_0x137b28);}return null;};}function patchUpdates(_0x38c1b7){return function(_0x34349e){try{jsonpatch[_0xbbc5('0x25')](_0x34349e,_0x38c1b7,!![]);}catch(_0x14fc91){return BPromise[_0xbbc5('0x26')](_0x14fc91);}return _0x34349e[_0xbbc5('0x27')]();};}function saveUpdates(_0x283976,_0xc0b83d){return function(_0x552867){if(_0x552867){return _0x552867[_0xbbc5('0x28')](_0x283976)[_0xbbc5('0x29')](function(_0x1eb76e){return _0x1eb76e;});}return null;};}function removeEntity(_0x4bb99e,_0x1d58b1){return function(_0x6ec799){if(_0x6ec799){return _0x6ec799[_0xbbc5('0x2a')]()[_0xbbc5('0x29')](function(){var _0x59c07b=_0x6ec799[_0xbbc5('0x2b')]({'plain':!![]});var _0x68af89=_0xbbc5('0x2c');return db[_0xbbc5('0x2d')][_0xbbc5('0x2a')]({'where':{'type':_0x68af89,'resourceId':_0x59c07b['id']}})[_0xbbc5('0x29')](function(){return _0x6ec799;});})['then'](function(){_0x4bb99e[_0xbbc5('0x1d')](0xcc)[_0xbbc5('0x1e')]();});}};}function handleEntityNotFound(_0x4b6390,_0x56a1d7){return function(_0xfc6b5e){if(!_0xfc6b5e){_0x4b6390['sendStatus'](0x194);}return _0xfc6b5e;};}function handleError(_0x111819,_0x2f3121){_0x2f3121=_0x2f3121||0x1f4;return function(_0x1720a4){logger[_0xbbc5('0x2e')](_0x1720a4[_0xbbc5('0x2f')]);if(_0x1720a4[_0xbbc5('0x30')]){delete _0x1720a4[_0xbbc5('0x30')];}_0x111819[_0xbbc5('0x1d')](_0x2f3121)[_0xbbc5('0x31')](_0x1720a4);};}exports[_0xbbc5('0x32')]=function(_0xe92729,_0x5e33ba){var _0x4ed989={},_0x3440e2={},_0x2293cb={'count':0x0,'rows':[]};var _0x1eb990=_['map'](db[_0xbbc5('0x33')][_0xbbc5('0x34')],function(_0x3c262f){return{'name':_0x3c262f['fieldName'],'type':_0x3c262f[_0xbbc5('0x35')][_0xbbc5('0x36')]};});_0x3440e2['model']=_[_0xbbc5('0x37')](_0x1eb990,_0xbbc5('0x30'));_0x3440e2[_0xbbc5('0x38')]=_[_0xbbc5('0x39')](_0xe92729['query']);_0x3440e2[_0xbbc5('0x3a')]=_[_0xbbc5('0x3b')](_0x3440e2[_0xbbc5('0x3c')],_0x3440e2[_0xbbc5('0x38')]);_0x4ed989['attributes']=_[_0xbbc5('0x3b')](_0x3440e2[_0xbbc5('0x3c')],qs[_0xbbc5('0x3d')](_0xe92729[_0xbbc5('0x38')][_0xbbc5('0x3d')]));_0x4ed989[_0xbbc5('0x3e')]=_0x4ed989[_0xbbc5('0x3e')]['length']?_0x4ed989[_0xbbc5('0x3e')]:_0x3440e2[_0xbbc5('0x3c')];if(!_0xe92729['query']['hasOwnProperty']('nolimit')){_0x4ed989[_0xbbc5('0x22')]=qs[_0xbbc5('0x22')](_0xe92729[_0xbbc5('0x38')]['limit']);_0x4ed989[_0xbbc5('0x20')]=qs[_0xbbc5('0x20')](_0xe92729[_0xbbc5('0x38')][_0xbbc5('0x20')]);}_0x4ed989[_0xbbc5('0x3f')]=qs['sort'](_0xe92729[_0xbbc5('0x38')][_0xbbc5('0x40')]);_0x4ed989[_0xbbc5('0x41')]=qs[_0xbbc5('0x3a')](_[_0xbbc5('0x42')](_0xe92729[_0xbbc5('0x38')],_0x3440e2[_0xbbc5('0x3a')]),_0x1eb990);if(_0xe92729[_0xbbc5('0x38')][_0xbbc5('0x43')]){_0x4ed989[_0xbbc5('0x41')]=_['merge'](_0x4ed989[_0xbbc5('0x41')],{'$or':[{'key':{'$like':'%'+_0xe92729['query'][_0xbbc5('0x43')]+'%'}},{'value':{'$like':'%'+_0xe92729[_0xbbc5('0x38')][_0xbbc5('0x43')]+'%'}}]});}_0x4ed989=_[_0xbbc5('0x44')]({},_0x4ed989,_0xe92729[_0xbbc5('0x45')]);var _0x53a898={'where':_0x4ed989['where']};return db[_0xbbc5('0x33')]['count'](_0x53a898)[_0xbbc5('0x29')](function(_0x44d961){_0x2293cb['count']=_0x44d961;if(_0xe92729[_0xbbc5('0x38')][_0xbbc5('0x46')]){_0x4ed989[_0xbbc5('0x47')]=[{'all':!![]}];}return db['CannedAnswer'][_0xbbc5('0x48')](_0x4ed989);})[_0xbbc5('0x29')](function(_0x542e28){_0x2293cb[_0xbbc5('0x49')]=_0x542e28;return _0x2293cb;})['then'](respondWithFilteredResult(_0x5e33ba,_0x4ed989))[_0xbbc5('0x4a')](handleError(_0x5e33ba,null));};exports[_0xbbc5('0x4b')]=function(_0x4f4b74,_0x468f64){var _0x5347a6={'raw':!![],'where':{'id':_0x4f4b74[_0xbbc5('0x4c')]['id']}},_0x1bf427={};_0x1bf427[_0xbbc5('0x3c')]=_[_0xbbc5('0x39')](db[_0xbbc5('0x33')][_0xbbc5('0x34')]);_0x1bf427[_0xbbc5('0x38')]=_[_0xbbc5('0x39')](_0x4f4b74[_0xbbc5('0x38')]);_0x1bf427['filters']=_[_0xbbc5('0x3b')](_0x1bf427[_0xbbc5('0x3c')],_0x1bf427['query']);_0x5347a6['attributes']=_[_0xbbc5('0x3b')](_0x1bf427[_0xbbc5('0x3c')],qs[_0xbbc5('0x3d')](_0x4f4b74[_0xbbc5('0x38')]['fields']));_0x5347a6[_0xbbc5('0x3e')]=_0x5347a6['attributes']['length']?_0x5347a6[_0xbbc5('0x3e')]:_0x1bf427[_0xbbc5('0x3c')];if(_0x4f4b74[_0xbbc5('0x38')][_0xbbc5('0x46')]){_0x5347a6[_0xbbc5('0x47')]=[{'all':!![]}];}_0x5347a6=_[_0xbbc5('0x44')]({},_0x5347a6,_0x4f4b74[_0xbbc5('0x45')]);return db[_0xbbc5('0x33')][_0xbbc5('0x4d')](_0x5347a6)['then'](handleEntityNotFound(_0x468f64,null))['then'](respondWithResult(_0x468f64,null))[_0xbbc5('0x4a')](handleError(_0x468f64,null));};exports[_0xbbc5('0x28')]=function(_0x1e1e8e,_0x16cd29){if(_0x1e1e8e[_0xbbc5('0x4e')]['id']){delete _0x1e1e8e['body']['id'];}return db['CannedAnswer']['find']({'where':{'id':_0x1e1e8e[_0xbbc5('0x4c')]['id']}})[_0xbbc5('0x29')](handleEntityNotFound(_0x16cd29,null))[_0xbbc5('0x29')](saveUpdates(_0x1e1e8e[_0xbbc5('0x4e')],null))[_0xbbc5('0x29')](respondWithResult(_0x16cd29,null))[_0xbbc5('0x4a')](handleError(_0x16cd29,null));};exports['destroy']=function(_0x2b4914,_0x5ed93a){return db['CannedAnswer']['find']({'where':{'id':_0x2b4914['params']['id']}})[_0xbbc5('0x29')](handleEntityNotFound(_0x5ed93a,null))['then'](removeEntity(_0x5ed93a,null))[_0xbbc5('0x4a')](handleError(_0x5ed93a,null));};exports['create']=function(_0x286fac,_0x582d38){var _0x490d15={'key':_0x286fac[_0xbbc5('0x4e')][_0xbbc5('0x36')]};if(_0x286fac[_0xbbc5('0x4e')][_0xbbc5('0x4f')]){_0x490d15['MailAccountId']=_0x286fac[_0xbbc5('0x4e')][_0xbbc5('0x4f')];}else if(_0x286fac[_0xbbc5('0x4e')][_0xbbc5('0x50')]){_0x490d15['SmsAccountId']=_0x286fac[_0xbbc5('0x4e')][_0xbbc5('0x50')];}else if(_0x286fac[_0xbbc5('0x4e')][_0xbbc5('0x51')]){_0x490d15[_0xbbc5('0x51')]=_0x286fac[_0xbbc5('0x4e')][_0xbbc5('0x51')];}else if(_0x286fac['body'][_0xbbc5('0x52')]){_0x490d15[_0xbbc5('0x52')]=_0x286fac[_0xbbc5('0x4e')]['ChatWebsiteId'];}return db[_0xbbc5('0x33')][_0xbbc5('0x4d')]({'where':_0x490d15})['then'](function(_0x358f90){if(_0x358f90){throw new db['Sequelize'][(_0xbbc5('0x53'))](_0xbbc5('0x54'));}return db[_0xbbc5('0x33')][_0xbbc5('0x55')](_0x286fac[_0xbbc5('0x4e')]);})[_0xbbc5('0x29')](function(_0x406352){var _0x19ff39=_0x286fac[_0xbbc5('0x56')]['get']({'plain':!![]});if(!_0x19ff39)throw new Error(_0xbbc5('0x57'));if(_0x19ff39['role']==='user'){var _0x2df2bc=_0x406352[_0xbbc5('0x2b')]({'plain':!![]});return db[_0xbbc5('0x58')][_0xbbc5('0x4d')]({'where':{'name':_0xbbc5('0x2c'),'userProfileId':_0x19ff39['userProfileId']},'raw':!![]})[_0xbbc5('0x29')](function(_0x37aa0e){if(_0x37aa0e&&_0x37aa0e[_0xbbc5('0x59')]===0x0){return db[_0xbbc5('0x2d')][_0xbbc5('0x55')]({'name':_0x2df2bc[_0xbbc5('0x30')],'resourceId':_0x2df2bc['id'],'type':_0x37aa0e['name'],'sectionId':_0x37aa0e['id']},{})[_0xbbc5('0x29')](function(){return _0x406352;});}else{return _0x406352;}})[_0xbbc5('0x4a')](function(_0x459b67){logger[_0xbbc5('0x2e')](_0xbbc5('0x5a'),_0x459b67);throw _0x459b67;});}return _0x406352;})[_0xbbc5('0x29')](respondWithResult(_0x582d38,0xc9))[_0xbbc5('0x4a')](handleError(_0x582d38,null));}; \ No newline at end of file +var _0x0a23=['offset','limit','set','Content-Range','apply','save','update','then','destroy','get','CannedAnswers','UserProfileResource','error','stack','name','send','index','map','CannedAnswer','rawAttributes','fieldName','type','key','model','filters','fields','query','attributes','hasOwnProperty','order','sort','where','merge','filter','options','includeAll','rows','catch','show','params','intersection','include','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count'];(function(_0x52085a,_0x3717ca){var _0x5afc1a=function(_0x2aa175){while(--_0x2aa175){_0x52085a['push'](_0x52085a['shift']());}};_0x5afc1a(++_0x3717ca);}(_0x0a23,0x1ec));var _0x30a2=function(_0x3a1183,_0x42b592){_0x3a1183=_0x3a1183-0x0;var _0x585d79=_0x0a23[_0x3a1183];return _0x585d79;};'use strict';var emlformat=require(_0x30a2('0x0'));var rimraf=require(_0x30a2('0x1'));var zipdir=require(_0x30a2('0x2'));var jsonpatch=require(_0x30a2('0x3'));var rp=require(_0x30a2('0x4'));var moment=require(_0x30a2('0x5'));var BPromise=require(_0x30a2('0x6'));var Mustache=require('mustache');var util=require(_0x30a2('0x7'));var path=require('path');var sox=require(_0x30a2('0x8'));var csv=require(_0x30a2('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x30a2('0xa'));var _=require(_0x30a2('0xb'));var squel=require(_0x30a2('0xc'));var crypto=require(_0x30a2('0xd'));var jsforce=require(_0x30a2('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x30a2('0xf'));var Papa=require(_0x30a2('0x10'));var Redis=require('ioredis');var authService=require(_0x30a2('0x11'));var qs=require(_0x30a2('0x12'));var as=require(_0x30a2('0x13'));var hardwareService=require(_0x30a2('0x14'));var logger=require(_0x30a2('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x30a2('0x16'));var licenseUtil=require(_0x30a2('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x53475f,_0x2aae3b){_0x2aae3b=_0x2aae3b||0xcc;return function(_0x53c6e5){if(_0x53c6e5){return _0x53475f[_0x30a2('0x18')](_0x2aae3b);}return _0x53475f[_0x30a2('0x19')](_0x2aae3b)[_0x30a2('0x1a')]();};}function respondWithResult(_0x1e7c99,_0x12d560){_0x12d560=_0x12d560||0xc8;return function(_0x258fb4){if(_0x258fb4){return _0x1e7c99['status'](_0x12d560)[_0x30a2('0x1b')](_0x258fb4);}};}function respondWithFilteredResult(_0x4a59c5,_0x3653d9){return function(_0x4b8884){if(_0x4b8884){var _0x1f40e2=typeof _0x3653d9['offset']==='undefined'&&typeof _0x3653d9['limit']===_0x30a2('0x1c');var _0xf07789=_0x4b8884[_0x30a2('0x1d')];var _0x2095ef=_0x1f40e2?0x0:_0x3653d9['offset'];var _0x289ae8=_0x1f40e2?_0x4b8884[_0x30a2('0x1d')]:_0x3653d9[_0x30a2('0x1e')]+_0x3653d9[_0x30a2('0x1f')];var _0x348917;if(_0x289ae8>=_0xf07789){_0x289ae8=_0xf07789;_0x348917=0xc8;}else{_0x348917=0xce;}_0x4a59c5['status'](_0x348917);return _0x4a59c5[_0x30a2('0x20')](_0x30a2('0x21'),_0x2095ef+'-'+_0x289ae8+'/'+_0xf07789)[_0x30a2('0x1b')](_0x4b8884);}return null;};}function patchUpdates(_0x288f43){return function(_0x289cef){try{jsonpatch[_0x30a2('0x22')](_0x289cef,_0x288f43,!![]);}catch(_0x495933){return BPromise['reject'](_0x495933);}return _0x289cef[_0x30a2('0x23')]();};}function saveUpdates(_0x33597c,_0x4ecf41){return function(_0x137a42){if(_0x137a42){return _0x137a42[_0x30a2('0x24')](_0x33597c)[_0x30a2('0x25')](function(_0x29224f){return _0x29224f;});}return null;};}function removeEntity(_0x4fccb4,_0x2d6963){return function(_0x33dc03){if(_0x33dc03){return _0x33dc03[_0x30a2('0x26')]()[_0x30a2('0x25')](function(){var _0x32ecc6=_0x33dc03[_0x30a2('0x27')]({'plain':!![]});var _0x1bfdc0=_0x30a2('0x28');return db[_0x30a2('0x29')][_0x30a2('0x26')]({'where':{'type':_0x1bfdc0,'resourceId':_0x32ecc6['id']}})[_0x30a2('0x25')](function(){return _0x33dc03;});})[_0x30a2('0x25')](function(){_0x4fccb4[_0x30a2('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xc720cc,_0x2377b7){return function(_0x517147){if(!_0x517147){_0xc720cc['sendStatus'](0x194);}return _0x517147;};}function handleError(_0x49a763,_0x2a7f48){_0x2a7f48=_0x2a7f48||0x1f4;return function(_0x1d7ca7){logger[_0x30a2('0x2a')](_0x1d7ca7[_0x30a2('0x2b')]);if(_0x1d7ca7['name']){delete _0x1d7ca7[_0x30a2('0x2c')];}_0x49a763[_0x30a2('0x19')](_0x2a7f48)[_0x30a2('0x2d')](_0x1d7ca7);};}exports[_0x30a2('0x2e')]=function(_0x42ab57,_0xd7d237){var _0x2a70d9={},_0xac3fd7={},_0x267570={'count':0x0,'rows':[]};var _0x3e7efd=_[_0x30a2('0x2f')](db[_0x30a2('0x30')][_0x30a2('0x31')],function(_0x347870){return{'name':_0x347870[_0x30a2('0x32')],'type':_0x347870[_0x30a2('0x33')][_0x30a2('0x34')]};});_0xac3fd7[_0x30a2('0x35')]=_[_0x30a2('0x2f')](_0x3e7efd,_0x30a2('0x2c'));_0xac3fd7['query']=_['keys'](_0x42ab57['query']);_0xac3fd7[_0x30a2('0x36')]=_['intersection'](_0xac3fd7[_0x30a2('0x35')],_0xac3fd7['query']);_0x2a70d9['attributes']=_['intersection'](_0xac3fd7[_0x30a2('0x35')],qs[_0x30a2('0x37')](_0x42ab57[_0x30a2('0x38')][_0x30a2('0x37')]));_0x2a70d9[_0x30a2('0x39')]=_0x2a70d9[_0x30a2('0x39')]['length']?_0x2a70d9['attributes']:_0xac3fd7[_0x30a2('0x35')];if(!_0x42ab57[_0x30a2('0x38')][_0x30a2('0x3a')]('nolimit')){_0x2a70d9['limit']=qs[_0x30a2('0x1f')](_0x42ab57[_0x30a2('0x38')][_0x30a2('0x1f')]);_0x2a70d9[_0x30a2('0x1e')]=qs['offset'](_0x42ab57[_0x30a2('0x38')][_0x30a2('0x1e')]);}_0x2a70d9[_0x30a2('0x3b')]=qs[_0x30a2('0x3c')](_0x42ab57[_0x30a2('0x38')][_0x30a2('0x3c')]);_0x2a70d9[_0x30a2('0x3d')]=qs['filters'](_['pick'](_0x42ab57[_0x30a2('0x38')],_0xac3fd7['filters']),_0x3e7efd);if(_0x42ab57[_0x30a2('0x38')]['filter']){_0x2a70d9[_0x30a2('0x3d')]=_[_0x30a2('0x3e')](_0x2a70d9[_0x30a2('0x3d')],{'$or':[{'key':{'$like':'%'+_0x42ab57[_0x30a2('0x38')]['filter']+'%'}},{'value':{'$like':'%'+_0x42ab57['query'][_0x30a2('0x3f')]+'%'}}]});}_0x2a70d9=_[_0x30a2('0x3e')]({},_0x2a70d9,_0x42ab57[_0x30a2('0x40')]);var _0x7da057={'where':_0x2a70d9[_0x30a2('0x3d')]};return db[_0x30a2('0x30')][_0x30a2('0x1d')](_0x7da057)[_0x30a2('0x25')](function(_0x1f7119){_0x267570['count']=_0x1f7119;if(_0x42ab57['query'][_0x30a2('0x41')]){_0x2a70d9['include']=[{'all':!![]}];}return db[_0x30a2('0x30')]['findAll'](_0x2a70d9);})['then'](function(_0x57f924){_0x267570[_0x30a2('0x42')]=_0x57f924;return _0x267570;})['then'](respondWithFilteredResult(_0xd7d237,_0x2a70d9))[_0x30a2('0x43')](handleError(_0xd7d237,null));};exports[_0x30a2('0x44')]=function(_0x1fbcb0,_0x371b6c){var _0x585fe7={'raw':!![],'where':{'id':_0x1fbcb0[_0x30a2('0x45')]['id']}},_0xc07826={};_0xc07826[_0x30a2('0x35')]=_['keys'](db[_0x30a2('0x30')]['rawAttributes']);_0xc07826[_0x30a2('0x38')]=_['keys'](_0x1fbcb0[_0x30a2('0x38')]);_0xc07826[_0x30a2('0x36')]=_['intersection'](_0xc07826[_0x30a2('0x35')],_0xc07826[_0x30a2('0x38')]);_0x585fe7[_0x30a2('0x39')]=_[_0x30a2('0x46')](_0xc07826[_0x30a2('0x35')],qs[_0x30a2('0x37')](_0x1fbcb0[_0x30a2('0x38')][_0x30a2('0x37')]));_0x585fe7[_0x30a2('0x39')]=_0x585fe7[_0x30a2('0x39')]['length']?_0x585fe7[_0x30a2('0x39')]:_0xc07826[_0x30a2('0x35')];if(_0x1fbcb0[_0x30a2('0x38')][_0x30a2('0x41')]){_0x585fe7[_0x30a2('0x47')]=[{'all':!![]}];}_0x585fe7=_['merge']({},_0x585fe7,_0x1fbcb0[_0x30a2('0x40')]);return db[_0x30a2('0x30')][_0x30a2('0x48')](_0x585fe7)[_0x30a2('0x25')](handleEntityNotFound(_0x371b6c,null))[_0x30a2('0x25')](respondWithResult(_0x371b6c,null))[_0x30a2('0x43')](handleError(_0x371b6c,null));};exports[_0x30a2('0x24')]=function(_0x55fbcc,_0x4eaeb1){if(_0x55fbcc[_0x30a2('0x49')]['id']){delete _0x55fbcc[_0x30a2('0x49')]['id'];}return db['CannedAnswer']['find']({'where':{'id':_0x55fbcc[_0x30a2('0x45')]['id']}})[_0x30a2('0x25')](handleEntityNotFound(_0x4eaeb1,null))[_0x30a2('0x25')](saveUpdates(_0x55fbcc[_0x30a2('0x49')],null))['then'](respondWithResult(_0x4eaeb1,null))[_0x30a2('0x43')](handleError(_0x4eaeb1,null));};exports[_0x30a2('0x26')]=function(_0x312b2b,_0x4338f3){return db[_0x30a2('0x30')]['find']({'where':{'id':_0x312b2b['params']['id']}})['then'](handleEntityNotFound(_0x4338f3,null))[_0x30a2('0x25')](removeEntity(_0x4338f3,null))['catch'](handleError(_0x4338f3,null));};exports[_0x30a2('0x4a')]=function(_0x4dc411,_0x562a43){var _0x3d58c3={'key':_0x4dc411['body'][_0x30a2('0x34')]};if(_0x4dc411[_0x30a2('0x49')][_0x30a2('0x4b')]){_0x3d58c3[_0x30a2('0x4b')]=_0x4dc411[_0x30a2('0x49')][_0x30a2('0x4b')];}else if(_0x4dc411[_0x30a2('0x49')]['SmsAccountId']){_0x3d58c3[_0x30a2('0x4c')]=_0x4dc411[_0x30a2('0x49')][_0x30a2('0x4c')];}else if(_0x4dc411[_0x30a2('0x49')][_0x30a2('0x4d')]){_0x3d58c3['OpenchannelAccountId']=_0x4dc411[_0x30a2('0x49')]['OpenchannelAccountId'];}else if(_0x4dc411[_0x30a2('0x49')]['ChatWebsiteId']){_0x3d58c3[_0x30a2('0x4e')]=_0x4dc411['body']['ChatWebsiteId'];}return db[_0x30a2('0x30')][_0x30a2('0x48')]({'where':_0x3d58c3})[_0x30a2('0x25')](function(_0x18a4a4){if(_0x18a4a4){throw new db[(_0x30a2('0x4f'))][(_0x30a2('0x50'))](_0x30a2('0x51'));}return db[_0x30a2('0x30')]['create'](_0x4dc411[_0x30a2('0x49')]);})['then'](function(_0x290669){var _0x24a436=_0x4dc411['user'][_0x30a2('0x27')]({'plain':!![]});if(!_0x24a436)throw new Error(_0x30a2('0x52'));if(_0x24a436['role']===_0x30a2('0x53')){var _0x1baf60=_0x290669['get']({'plain':!![]});return db[_0x30a2('0x54')]['find']({'where':{'name':'CannedAnswers','userProfileId':_0x24a436['userProfileId']},'raw':!![]})[_0x30a2('0x25')](function(_0x4ffdd4){if(_0x4ffdd4&&_0x4ffdd4[_0x30a2('0x55')]===0x0){return db[_0x30a2('0x29')][_0x30a2('0x4a')]({'name':_0x1baf60['name'],'resourceId':_0x1baf60['id'],'type':_0x4ffdd4[_0x30a2('0x2c')],'sectionId':_0x4ffdd4['id']},{})[_0x30a2('0x25')](function(){return _0x290669;});}else{return _0x290669;}})[_0x30a2('0x43')](function(_0x49fcab){logger['error'](_0x30a2('0x56'),_0x49fcab);throw _0x49fcab;});}return _0x290669;})['then'](respondWithResult(_0x562a43,0xc9))['catch'](handleError(_0x562a43,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 924c7d5..f60759a 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 _0xa660=['util','../../config/logger','moment','bluebird','request-promise','../../config/environment','exports','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xa660,0x1c6));var _0x0a66=function(_0x87d914,_0x149b02){_0x87d914=_0x87d914-0x0;var _0x3a8edd=_0xa660[_0x87d914];return _0x3a8edd;};'use strict';var _=require(_0x0a66('0x0'));var util=require(_0x0a66('0x1'));var logger=require(_0x0a66('0x2'))('api');var moment=require(_0x0a66('0x3'));var BPromise=require(_0x0a66('0x4'));var rp=require(_0x0a66('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0a66('0x6'));var attributes=require('./cannedAnswer.attributes');module[_0x0a66('0x7')]=function(_0x165bd0,_0x4fc8a5){return _0x165bd0[_0x0a66('0x8')](_0x0a66('0x9'),attributes,{'tableName':_0x0a66('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0a66('0xb'),'collate':_0x0a66('0xc')});}; \ No newline at end of file +var _0x5346=['utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','tools_canned_answers'];(function(_0x1a3eeb,_0x48a6f5){var _0x4ae9e9=function(_0x4f835d){while(--_0x4f835d){_0x1a3eeb['push'](_0x1a3eeb['shift']());}};_0x4ae9e9(++_0x48a6f5);}(_0x5346,0x1f0));var _0x6534=function(_0x493e67,_0x3e58c1){_0x493e67=_0x493e67-0x0;var _0x3a3f9d=_0x5346[_0x493e67];return _0x3a3f9d;};'use strict';var _=require(_0x6534('0x0'));var util=require('util');var logger=require(_0x6534('0x1'))(_0x6534('0x2'));var moment=require('moment');var BPromise=require(_0x6534('0x3'));var rp=require(_0x6534('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6534('0x5'));var config=require(_0x6534('0x6'));var attributes=require(_0x6534('0x7'));module[_0x6534('0x8')]=function(_0x47e897,_0x2932fa){return _0x47e897[_0x6534('0x9')]('CannedAnswer',attributes,{'tableName':_0x6534('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6534('0xb'),'collate':_0x6534('0xc')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 27d4df9..4b53e2b 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(_0x2aa5c5,_0x42f508){var _0xc9949c=function(_0x8d2d8a){while(--_0x8d2d8a){_0x2aa5c5['push'](_0x2aa5c5['shift']());}};_0xc9949c(++_0x42f508);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'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(_0x18dea7,_0x529f85){var _0x666e22=function(_0x3c03c0){while(--_0x3c03c0){_0x18dea7['push'](_0x18dea7['shift']());}};_0x666e22(++_0x529f85);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'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 e9669fd..1f55dd4 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 _0x3e79=['../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id','put','delete','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service'];(function(_0x4855fa,_0x490cf3){var _0x4b7a91=function(_0x456ec7){while(--_0x456ec7){_0x4855fa['push'](_0x4855fa['shift']());}};_0x4b7a91(++_0x490cf3);}(_0x3e79,0x104));var _0x93e7=function(_0x438f29,_0x2e29b7){_0x438f29=_0x438f29-0x0;var _0x59e746=_0x3e79[_0x438f29];return _0x59e746;};'use strict';var multer=require(_0x93e7('0x0'));var util=require(_0x93e7('0x1'));var path=require('path');var timeout=require(_0x93e7('0x2'));var express=require('express');var router=express[_0x93e7('0x3')]();var fs_extra=require(_0x93e7('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x93e7('0x5'));var config=require(_0x93e7('0x6'));var controller=require(_0x93e7('0x7'));router[_0x93e7('0x8')]('/',auth[_0x93e7('0x9')](),controller[_0x93e7('0xa')]);router[_0x93e7('0x8')](_0x93e7('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x93e7('0x9')](),controller['create']);router[_0x93e7('0xc')]('/:id',auth[_0x93e7('0x9')](),controller['update']);router[_0x93e7('0xd')]('/:id',auth[_0x93e7('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x2260=['../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id','put','update','delete','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x121cb0,_0x1b42e9){var _0x5973d1=function(_0x166a54){while(--_0x166a54){_0x121cb0['push'](_0x121cb0['shift']());}};_0x5973d1(++_0x1b42e9);}(_0x2260,0xe7));var _0x0226=function(_0x352e09,_0x37a7da){_0x352e09=_0x352e09-0x0;var _0x1b7094=_0x2260[_0x352e09];return _0x1b7094;};'use strict';var multer=require('multer');var util=require(_0x0226('0x0'));var path=require(_0x0226('0x1'));var timeout=require(_0x0226('0x2'));var express=require(_0x0226('0x3'));var router=express['Router']();var fs_extra=require(_0x0226('0x4'));var auth=require(_0x0226('0x5'));var interaction=require(_0x0226('0x6'));var config=require(_0x0226('0x7'));var controller=require(_0x0226('0x8'));router[_0x0226('0x9')]('/',auth[_0x0226('0xa')](),controller[_0x0226('0xb')]);router[_0x0226('0x9')](_0x0226('0xc'),auth[_0x0226('0xa')](),controller['show']);router['post']('/',auth[_0x0226('0xa')](),controller['create']);router[_0x0226('0xd')](_0x0226('0xc'),auth[_0x0226('0xa')](),controller[_0x0226('0xe')]);router[_0x0226('0xf')](_0x0226('0xc'),auth[_0x0226('0xa')](),controller['destroy']);module[_0x0226('0x10')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 19523e2..02092a0 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 _0x7e6b=['STRING','INTEGER','DATE','1970-01-01\x2000:00:01'];(function(_0x356127,_0x4873ac){var _0x5d4c75=function(_0x4fe60c){while(--_0x4fe60c){_0x356127['push'](_0x356127['shift']());}};_0x5d4c75(++_0x4873ac);}(_0x7e6b,0x186));var _0xb7e6=function(_0x25a0df,_0x5b4de4){_0x25a0df=_0x25a0df-0x0;var _0x30b5fd=_0x7e6b[_0x25a0df];return _0x30b5fd;};'use strict';var Sequelize=require('sequelize');module['exports']={'calldate':{'type':Sequelize[_0xb7e6('0x0')],'allowNull':![],'defaultValue':_0xb7e6('0x1')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0xb7e6('0x2')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xb7e6('0x2')]},'dstchannel':{'type':Sequelize[_0xb7e6('0x2')]},'lastapp':{'type':Sequelize[_0xb7e6('0x2')]},'lastdata':{'type':Sequelize[_0xb7e6('0x2')]},'duration':{'type':Sequelize[_0xb7e6('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xb7e6('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xb7e6('0x2')]},'userfield':{'type':Sequelize[_0xb7e6('0x2')]},'uniqueid':{'type':Sequelize[_0xb7e6('0x2')]},'linkedid':{'type':Sequelize[_0xb7e6('0x2')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0xb7e6('0x2')]},'type':{'type':Sequelize[_0xb7e6('0x2')]},'tag':{'type':Sequelize[_0xb7e6('0x2')]}}; \ No newline at end of file +var _0xff30=['STRING','INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0xff30,0x104));var _0x0ff3=function(_0x4c5710,_0x3161c6){_0x4c5710=_0x4c5710-0x0;var _0xfd99ad=_0xff30[_0x4c5710];return _0xfd99ad;};'use strict';var Sequelize=require(_0x0ff3('0x0'));module[_0x0ff3('0x1')]={'calldate':{'type':Sequelize[_0x0ff3('0x2')],'allowNull':![],'defaultValue':_0x0ff3('0x3')},'clid':{'type':Sequelize[_0x0ff3('0x4')]},'src':{'type':Sequelize[_0x0ff3('0x4')]},'dst':{'type':Sequelize[_0x0ff3('0x4')]},'dcontext':{'type':Sequelize[_0x0ff3('0x4')]},'channel':{'type':Sequelize[_0x0ff3('0x4')]},'dstchannel':{'type':Sequelize[_0x0ff3('0x4')]},'lastapp':{'type':Sequelize[_0x0ff3('0x4')]},'lastdata':{'type':Sequelize[_0x0ff3('0x4')]},'duration':{'type':Sequelize[_0x0ff3('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x0ff3('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x0ff3('0x4')]},'amaflags':{'type':Sequelize[_0x0ff3('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x0ff3('0x4')]},'userfield':{'type':Sequelize[_0x0ff3('0x4')]},'uniqueid':{'type':Sequelize[_0x0ff3('0x4')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0x0ff3('0x4')]},'peeraccount':{'type':Sequelize[_0x0ff3('0x4')]},'type':{'type':Sequelize[_0x0ff3('0x4')]},'tag':{'type':Sequelize[_0x0ff3('0x4')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index a2560c0..3708f0c 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 _0x0d4d=['zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','limit','undefined','count','offset','status','Content-Range','apply','save','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','Cdr','rows','catch','show','params','keys','length','find','create','body','destroy','describe','eml-format','rimraf'];(function(_0x409d62,_0x41507c){var _0x2e2d31=function(_0x533658){while(--_0x533658){_0x409d62['push'](_0x409d62['shift']());}};_0x2e2d31(++_0x41507c);}(_0x0d4d,0x132));var _0xd0d4=function(_0x8cb2b7,_0x423cb1){_0x8cb2b7=_0x8cb2b7-0x0;var _0x38e954=_0x0d4d[_0x8cb2b7];return _0x38e954;};'use strict';var emlformat=require(_0xd0d4('0x0'));var rimraf=require(_0xd0d4('0x1'));var zipdir=require(_0xd0d4('0x2'));var jsonpatch=require(_0xd0d4('0x3'));var rp=require(_0xd0d4('0x4'));var moment=require(_0xd0d4('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xd0d4('0x6'));var util=require('util');var path=require(_0xd0d4('0x7'));var sox=require(_0xd0d4('0x8'));var csv=require('to-csv');var ejs=require(_0xd0d4('0x9'));var fs=require('fs');var fs_extra=require(_0xd0d4('0xa'));var _=require(_0xd0d4('0xb'));var squel=require('squel');var crypto=require(_0xd0d4('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xd0d4('0xd'));var toCsv=require('to-csv');var querystring=require(_0xd0d4('0xe'));var Papa=require(_0xd0d4('0xf'));var Redis=require(_0xd0d4('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xd0d4('0x11'));var as=require(_0xd0d4('0x12'));var hardwareService=require(_0xd0d4('0x13'));var logger=require(_0xd0d4('0x14'))(_0xd0d4('0x15'));var utils=require(_0xd0d4('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xd0d4('0x17'));var db=require(_0xd0d4('0x18'))['db'];function respondWithStatusCode(_0x29ee49,_0x2ddeca){_0x2ddeca=_0x2ddeca||0xcc;return function(_0x38ca06){if(_0x38ca06){return _0x29ee49[_0xd0d4('0x19')](_0x2ddeca);}return _0x29ee49['status'](_0x2ddeca)[_0xd0d4('0x1a')]();};}function respondWithResult(_0x2131c8,_0x10a175){_0x10a175=_0x10a175||0xc8;return function(_0x5d6dd7){if(_0x5d6dd7){return _0x2131c8['status'](_0x10a175)[_0xd0d4('0x1b')](_0x5d6dd7);}};}function respondWithFilteredResult(_0x186405,_0x553b47){return function(_0x29bda4){if(_0x29bda4){var _0x1e8608=typeof _0x553b47['offset']==='undefined'&&typeof _0x553b47[_0xd0d4('0x1c')]===_0xd0d4('0x1d');var _0x268e1a=_0x29bda4['count'];var _0x5cf4c6=_0x1e8608?0x0:_0x553b47['offset'];var _0x407cda=_0x1e8608?_0x29bda4[_0xd0d4('0x1e')]:_0x553b47[_0xd0d4('0x1f')]+_0x553b47['limit'];var _0x568c75;if(_0x407cda>=_0x268e1a){_0x407cda=_0x268e1a;_0x568c75=0xc8;}else{_0x568c75=0xce;}_0x186405[_0xd0d4('0x20')](_0x568c75);return _0x186405['set'](_0xd0d4('0x21'),_0x5cf4c6+'-'+_0x407cda+'/'+_0x268e1a)[_0xd0d4('0x1b')](_0x29bda4);}return null;};}function patchUpdates(_0x1dcc1b){return function(_0x485cd8){try{jsonpatch[_0xd0d4('0x22')](_0x485cd8,_0x1dcc1b,!![]);}catch(_0x4d9fac){return BPromise['reject'](_0x4d9fac);}return _0x485cd8[_0xd0d4('0x23')]();};}function saveUpdates(_0xda03dd,_0x49b6f0){return function(_0x50f959){if(_0x50f959){return _0x50f959[_0xd0d4('0x24')](_0xda03dd)[_0xd0d4('0x25')](function(_0x398a00){return _0x398a00;});}return null;};}function removeEntity(_0x4c94b1,_0x1d8033){return function(_0x1c0831){if(_0x1c0831){return _0x1c0831['destroy']()[_0xd0d4('0x25')](function(){_0x4c94b1['status'](0xcc)[_0xd0d4('0x1a')]();});}};}function handleEntityNotFound(_0x1b03ef,_0x16808c){return function(_0x5380c3){if(!_0x5380c3){_0x1b03ef['sendStatus'](0x194);}return _0x5380c3;};}function handleError(_0x131de5,_0x4e7cc1){_0x4e7cc1=_0x4e7cc1||0x1f4;return function(_0x50e7f0){logger[_0xd0d4('0x26')](_0x50e7f0[_0xd0d4('0x27')]);if(_0x50e7f0[_0xd0d4('0x28')]){delete _0x50e7f0[_0xd0d4('0x28')];}_0x131de5['status'](_0x4e7cc1)[_0xd0d4('0x29')](_0x50e7f0);};}exports[_0xd0d4('0x2a')]=function(_0x45acf8,_0x22e142){var _0x7eecce={},_0xefce4f={},_0x1b07e8={'count':0x0,'rows':[]};var _0x266b91=_[_0xd0d4('0x2b')](db['Cdr'][_0xd0d4('0x2c')],function(_0x7aa87e){return{'name':_0x7aa87e[_0xd0d4('0x2d')],'type':_0x7aa87e[_0xd0d4('0x2e')][_0xd0d4('0x2f')]};});_0xefce4f[_0xd0d4('0x30')]=_['map'](_0x266b91,'name');_0xefce4f[_0xd0d4('0x31')]=_['keys'](_0x45acf8[_0xd0d4('0x31')]);_0xefce4f[_0xd0d4('0x32')]=_[_0xd0d4('0x33')](_0xefce4f[_0xd0d4('0x30')],_0xefce4f[_0xd0d4('0x31')]);_0x7eecce[_0xd0d4('0x34')]=_[_0xd0d4('0x33')](_0xefce4f['model'],qs['fields'](_0x45acf8[_0xd0d4('0x31')][_0xd0d4('0x35')]));_0x7eecce['attributes']=_0x7eecce[_0xd0d4('0x34')]['length']?_0x7eecce['attributes']:_0xefce4f[_0xd0d4('0x30')];if(!_0x45acf8[_0xd0d4('0x31')][_0xd0d4('0x36')](_0xd0d4('0x37'))){_0x7eecce['limit']=qs['limit'](_0x45acf8[_0xd0d4('0x31')][_0xd0d4('0x1c')]);_0x7eecce[_0xd0d4('0x1f')]=qs['offset'](_0x45acf8[_0xd0d4('0x31')][_0xd0d4('0x1f')]);}_0x7eecce[_0xd0d4('0x38')]=qs[_0xd0d4('0x39')](_0x45acf8[_0xd0d4('0x31')][_0xd0d4('0x39')]);_0x7eecce[_0xd0d4('0x3a')]=qs[_0xd0d4('0x32')](_['pick'](_0x45acf8[_0xd0d4('0x31')],_0xefce4f['filters']),_0x266b91);if(_0x45acf8['query'][_0xd0d4('0x3b')]){_0x7eecce['where']=_[_0xd0d4('0x3c')](_0x7eecce[_0xd0d4('0x3a')],{'$or':_[_0xd0d4('0x2b')](_0x266b91,function(_0x1d6329){if(_0x1d6329[_0xd0d4('0x2e')]!==_0xd0d4('0x3d')){var _0x560e77={};_0x560e77[_0x1d6329[_0xd0d4('0x28')]]={'$like':'%'+_0x45acf8[_0xd0d4('0x31')]['filter']+'%'};return _0x560e77;}})});}_0x7eecce=_['merge']({},_0x7eecce,_0x45acf8[_0xd0d4('0x3e')]);var _0x3e6527={'where':_0x7eecce[_0xd0d4('0x3a')]};return db['Cdr'][_0xd0d4('0x1e')](_0x3e6527)[_0xd0d4('0x25')](function(_0x230101){_0x1b07e8[_0xd0d4('0x1e')]=_0x230101;if(_0x45acf8[_0xd0d4('0x31')][_0xd0d4('0x3f')]){_0x7eecce[_0xd0d4('0x40')]=[{'all':!![]}];}return db[_0xd0d4('0x41')]['findAll'](_0x7eecce);})[_0xd0d4('0x25')](function(_0x4174e8){_0x1b07e8[_0xd0d4('0x42')]=_0x4174e8;return _0x1b07e8;})['then'](respondWithFilteredResult(_0x22e142,_0x7eecce))[_0xd0d4('0x43')](handleError(_0x22e142,null));};exports[_0xd0d4('0x44')]=function(_0x5db657,_0x11b77e){var _0x32d1c1={'raw':!![],'where':{'id':_0x5db657[_0xd0d4('0x45')]['id']}},_0x429b84={};_0x429b84[_0xd0d4('0x30')]=_[_0xd0d4('0x46')](db['Cdr'][_0xd0d4('0x2c')]);_0x429b84[_0xd0d4('0x31')]=_[_0xd0d4('0x46')](_0x5db657[_0xd0d4('0x31')]);_0x429b84['filters']=_[_0xd0d4('0x33')](_0x429b84[_0xd0d4('0x30')],_0x429b84[_0xd0d4('0x31')]);_0x32d1c1[_0xd0d4('0x34')]=_[_0xd0d4('0x33')](_0x429b84[_0xd0d4('0x30')],qs[_0xd0d4('0x35')](_0x5db657['query'][_0xd0d4('0x35')]));_0x32d1c1[_0xd0d4('0x34')]=_0x32d1c1['attributes'][_0xd0d4('0x47')]?_0x32d1c1[_0xd0d4('0x34')]:_0x429b84[_0xd0d4('0x30')];if(_0x5db657[_0xd0d4('0x31')][_0xd0d4('0x3f')]){_0x32d1c1[_0xd0d4('0x40')]=[{'all':!![]}];}_0x32d1c1=_['merge']({},_0x32d1c1,_0x5db657[_0xd0d4('0x3e')]);return db['Cdr'][_0xd0d4('0x48')](_0x32d1c1)[_0xd0d4('0x25')](handleEntityNotFound(_0x11b77e,null))['then'](respondWithResult(_0x11b77e,null))[_0xd0d4('0x43')](handleError(_0x11b77e,null));};exports['create']=function(_0x5d61d5,_0x1dad8b){return db['Cdr'][_0xd0d4('0x49')](_0x5d61d5[_0xd0d4('0x4a')],{})['then'](respondWithResult(_0x1dad8b,0xc9))[_0xd0d4('0x43')](handleError(_0x1dad8b,null));};exports['update']=function(_0xdf2562,_0x258cd1){if(_0xdf2562[_0xd0d4('0x4a')]['id']){delete _0xdf2562[_0xd0d4('0x4a')]['id'];}return db[_0xd0d4('0x41')][_0xd0d4('0x48')]({'where':{'id':_0xdf2562[_0xd0d4('0x45')]['id']}})[_0xd0d4('0x25')](handleEntityNotFound(_0x258cd1,null))[_0xd0d4('0x25')](saveUpdates(_0xdf2562['body'],null))['then'](respondWithResult(_0x258cd1,null))[_0xd0d4('0x43')](handleError(_0x258cd1,null));};exports[_0xd0d4('0x4b')]=function(_0x333a5b,_0x6af64e){return db[_0xd0d4('0x41')][_0xd0d4('0x48')]({'where':{'id':_0x333a5b[_0xd0d4('0x45')]['id']}})[_0xd0d4('0x25')](handleEntityNotFound(_0x6af64e,null))[_0xd0d4('0x25')](removeEntity(_0x6af64e,null))['catch'](handleError(_0x6af64e,null));};exports[_0xd0d4('0x4c')]=function(_0x5b23bb,_0x4b97e1){return db[_0xd0d4('0x41')]['describe']()[_0xd0d4('0x25')](respondWithResult(_0x4b97e1,null))[_0xd0d4('0x43')](handleError(_0x4b97e1,null));}; \ No newline at end of file +var _0xf3be=['then','error','stack','name','send','index','map','Cdr','fieldName','type','key','query','keys','intersection','attributes','fields','model','nolimit','order','sort','where','filters','pick','filter','merge','options','include','rows','catch','rawAttributes','length','includeAll','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy'];(function(_0xc9a9f3,_0x35fc6d){var _0x38bcc4=function(_0x998efe){while(--_0x998efe){_0xc9a9f3['push'](_0xc9a9f3['shift']());}};_0x38bcc4(++_0x35fc6d);}(_0xf3be,0x1e1));var _0xef3b=function(_0x4cb75e,_0x52c55a){_0x4cb75e=_0x4cb75e-0x0;var _0x305784=_0xf3be[_0x4cb75e];return _0x305784;};'use strict';var emlformat=require(_0xef3b('0x0'));var rimraf=require(_0xef3b('0x1'));var zipdir=require(_0xef3b('0x2'));var jsonpatch=require(_0xef3b('0x3'));var rp=require('request-promise');var moment=require(_0xef3b('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xef3b('0x5'));var csv=require(_0xef3b('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xef3b('0x7'));var _=require(_0xef3b('0x8'));var squel=require(_0xef3b('0x9'));var crypto=require(_0xef3b('0xa'));var jsforce=require(_0xef3b('0xb'));var deskjs=require(_0xef3b('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xef3b('0xd'));var Redis=require('ioredis');var authService=require(_0xef3b('0xe'));var qs=require(_0xef3b('0xf'));var as=require(_0xef3b('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xef3b('0x11'))('api');var utils=require(_0xef3b('0x12'));var config=require(_0xef3b('0x13'));var licenseUtil=require(_0xef3b('0x14'));var db=require(_0xef3b('0x15'))['db'];function respondWithStatusCode(_0x2a2a27,_0x3aef79){_0x3aef79=_0x3aef79||0xcc;return function(_0x169b2c){if(_0x169b2c){return _0x2a2a27[_0xef3b('0x16')](_0x3aef79);}return _0x2a2a27[_0xef3b('0x17')](_0x3aef79)[_0xef3b('0x18')]();};}function respondWithResult(_0x510cc3,_0x5a53b9){_0x5a53b9=_0x5a53b9||0xc8;return function(_0x138ea5){if(_0x138ea5){return _0x510cc3[_0xef3b('0x17')](_0x5a53b9)[_0xef3b('0x19')](_0x138ea5);}};}function respondWithFilteredResult(_0x118a31,_0x416801){return function(_0x529e89){if(_0x529e89){var _0x169803=typeof _0x416801[_0xef3b('0x1a')]===_0xef3b('0x1b')&&typeof _0x416801[_0xef3b('0x1c')]===_0xef3b('0x1b');var _0x5908cb=_0x529e89[_0xef3b('0x1d')];var _0x406eb7=_0x169803?0x0:_0x416801['offset'];var _0x280ccf=_0x169803?_0x529e89['count']:_0x416801[_0xef3b('0x1a')]+_0x416801['limit'];var _0x278de3;if(_0x280ccf>=_0x5908cb){_0x280ccf=_0x5908cb;_0x278de3=0xc8;}else{_0x278de3=0xce;}_0x118a31[_0xef3b('0x17')](_0x278de3);return _0x118a31[_0xef3b('0x1e')](_0xef3b('0x1f'),_0x406eb7+'-'+_0x280ccf+'/'+_0x5908cb)[_0xef3b('0x19')](_0x529e89);}return null;};}function patchUpdates(_0x3d18ef){return function(_0x19d4b5){try{jsonpatch[_0xef3b('0x20')](_0x19d4b5,_0x3d18ef,!![]);}catch(_0x4a3fbf){return BPromise[_0xef3b('0x21')](_0x4a3fbf);}return _0x19d4b5[_0xef3b('0x22')]();};}function saveUpdates(_0x214b53,_0xfe39a4){return function(_0x93a080){if(_0x93a080){return _0x93a080[_0xef3b('0x23')](_0x214b53)['then'](function(_0x27cc47){return _0x27cc47;});}return null;};}function removeEntity(_0x574042,_0x57b14a){return function(_0xc68cb2){if(_0xc68cb2){return _0xc68cb2[_0xef3b('0x24')]()[_0xef3b('0x25')](function(){_0x574042[_0xef3b('0x17')](0xcc)[_0xef3b('0x18')]();});}};}function handleEntityNotFound(_0x179338,_0x4ecb5e){return function(_0x487ae6){if(!_0x487ae6){_0x179338[_0xef3b('0x16')](0x194);}return _0x487ae6;};}function handleError(_0x4b6ee7,_0x4d5449){_0x4d5449=_0x4d5449||0x1f4;return function(_0x13dd47){logger[_0xef3b('0x26')](_0x13dd47[_0xef3b('0x27')]);if(_0x13dd47[_0xef3b('0x28')]){delete _0x13dd47[_0xef3b('0x28')];}_0x4b6ee7[_0xef3b('0x17')](_0x4d5449)[_0xef3b('0x29')](_0x13dd47);};}exports[_0xef3b('0x2a')]=function(_0x556c5c,_0xded00b){var _0x2b073b={},_0x634a45={},_0x187d1b={'count':0x0,'rows':[]};var _0x27ab13=_[_0xef3b('0x2b')](db[_0xef3b('0x2c')]['rawAttributes'],function(_0x4c9a84){return{'name':_0x4c9a84[_0xef3b('0x2d')],'type':_0x4c9a84[_0xef3b('0x2e')][_0xef3b('0x2f')]};});_0x634a45['model']=_[_0xef3b('0x2b')](_0x27ab13,_0xef3b('0x28'));_0x634a45[_0xef3b('0x30')]=_[_0xef3b('0x31')](_0x556c5c[_0xef3b('0x30')]);_0x634a45['filters']=_[_0xef3b('0x32')](_0x634a45['model'],_0x634a45[_0xef3b('0x30')]);_0x2b073b[_0xef3b('0x33')]=_[_0xef3b('0x32')](_0x634a45['model'],qs[_0xef3b('0x34')](_0x556c5c[_0xef3b('0x30')][_0xef3b('0x34')]));_0x2b073b['attributes']=_0x2b073b[_0xef3b('0x33')]['length']?_0x2b073b[_0xef3b('0x33')]:_0x634a45[_0xef3b('0x35')];if(!_0x556c5c['query']['hasOwnProperty'](_0xef3b('0x36'))){_0x2b073b[_0xef3b('0x1c')]=qs[_0xef3b('0x1c')](_0x556c5c['query'][_0xef3b('0x1c')]);_0x2b073b[_0xef3b('0x1a')]=qs[_0xef3b('0x1a')](_0x556c5c[_0xef3b('0x30')][_0xef3b('0x1a')]);}_0x2b073b[_0xef3b('0x37')]=qs['sort'](_0x556c5c['query'][_0xef3b('0x38')]);_0x2b073b[_0xef3b('0x39')]=qs[_0xef3b('0x3a')](_[_0xef3b('0x3b')](_0x556c5c[_0xef3b('0x30')],_0x634a45[_0xef3b('0x3a')]),_0x27ab13);if(_0x556c5c['query'][_0xef3b('0x3c')]){_0x2b073b[_0xef3b('0x39')]=_[_0xef3b('0x3d')](_0x2b073b['where'],{'$or':_[_0xef3b('0x2b')](_0x27ab13,function(_0x5ab5eb){if(_0x5ab5eb[_0xef3b('0x2e')]!=='VIRTUAL'){var _0x3a361f={};_0x3a361f[_0x5ab5eb['name']]={'$like':'%'+_0x556c5c[_0xef3b('0x30')]['filter']+'%'};return _0x3a361f;}})});}_0x2b073b=_[_0xef3b('0x3d')]({},_0x2b073b,_0x556c5c[_0xef3b('0x3e')]);var _0x1108e1={'where':_0x2b073b[_0xef3b('0x39')]};return db[_0xef3b('0x2c')][_0xef3b('0x1d')](_0x1108e1)[_0xef3b('0x25')](function(_0x219cfc){_0x187d1b['count']=_0x219cfc;if(_0x556c5c[_0xef3b('0x30')]['includeAll']){_0x2b073b[_0xef3b('0x3f')]=[{'all':!![]}];}return db[_0xef3b('0x2c')]['findAll'](_0x2b073b);})['then'](function(_0x51fb51){_0x187d1b[_0xef3b('0x40')]=_0x51fb51;return _0x187d1b;})['then'](respondWithFilteredResult(_0xded00b,_0x2b073b))[_0xef3b('0x41')](handleError(_0xded00b,null));};exports['show']=function(_0x4b2230,_0x516d08){var _0x5cec25={'raw':!![],'where':{'id':_0x4b2230['params']['id']}},_0x48699a={};_0x48699a['model']=_[_0xef3b('0x31')](db[_0xef3b('0x2c')][_0xef3b('0x42')]);_0x48699a['query']=_['keys'](_0x4b2230[_0xef3b('0x30')]);_0x48699a[_0xef3b('0x3a')]=_[_0xef3b('0x32')](_0x48699a[_0xef3b('0x35')],_0x48699a['query']);_0x5cec25[_0xef3b('0x33')]=_['intersection'](_0x48699a[_0xef3b('0x35')],qs[_0xef3b('0x34')](_0x4b2230[_0xef3b('0x30')][_0xef3b('0x34')]));_0x5cec25[_0xef3b('0x33')]=_0x5cec25['attributes'][_0xef3b('0x43')]?_0x5cec25[_0xef3b('0x33')]:_0x48699a[_0xef3b('0x35')];if(_0x4b2230[_0xef3b('0x30')][_0xef3b('0x44')]){_0x5cec25[_0xef3b('0x3f')]=[{'all':!![]}];}_0x5cec25=_[_0xef3b('0x3d')]({},_0x5cec25,_0x4b2230[_0xef3b('0x3e')]);return db[_0xef3b('0x2c')]['find'](_0x5cec25)[_0xef3b('0x25')](handleEntityNotFound(_0x516d08,null))[_0xef3b('0x25')](respondWithResult(_0x516d08,null))[_0xef3b('0x41')](handleError(_0x516d08,null));};exports['create']=function(_0x3f3e8b,_0x5d48c8){return db[_0xef3b('0x2c')][_0xef3b('0x45')](_0x3f3e8b[_0xef3b('0x46')],{})['then'](respondWithResult(_0x5d48c8,0xc9))['catch'](handleError(_0x5d48c8,null));};exports[_0xef3b('0x23')]=function(_0x38ee41,_0x4b368c){if(_0x38ee41[_0xef3b('0x46')]['id']){delete _0x38ee41[_0xef3b('0x46')]['id'];}return db[_0xef3b('0x2c')][_0xef3b('0x47')]({'where':{'id':_0x38ee41['params']['id']}})[_0xef3b('0x25')](handleEntityNotFound(_0x4b368c,null))[_0xef3b('0x25')](saveUpdates(_0x38ee41[_0xef3b('0x46')],null))[_0xef3b('0x25')](respondWithResult(_0x4b368c,null))[_0xef3b('0x41')](handleError(_0x4b368c,null));};exports[_0xef3b('0x24')]=function(_0x5e66fe,_0x2f45b1){return db[_0xef3b('0x2c')][_0xef3b('0x47')]({'where':{'id':_0x5e66fe[_0xef3b('0x48')]['id']}})[_0xef3b('0x25')](handleEntityNotFound(_0x2f45b1,null))[_0xef3b('0x25')](removeEntity(_0x2f45b1,null))[_0xef3b('0x41')](handleError(_0x2f45b1,null));};exports[_0xef3b('0x49')]=function(_0x3995b9,_0xf30f16){return db[_0xef3b('0x2c')][_0xef3b('0x49')]()[_0xef3b('0x25')](respondWithResult(_0xf30f16,null))['catch'](handleError(_0xf30f16,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 63e102c..44ff8f3 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 _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x3bcbc9,_0x4f1ec2){var _0x46afb8=function(_0x4e3e13){while(--_0x4e3e13){_0x3bcbc9['push'](_0x3bcbc9['shift']());}};_0x46afb8(++_0x4f1ec2);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'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':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file +var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x5c365d,_0x9f030b){var _0x2784c7=function(_0x1df168){while(--_0x1df168){_0x5c365d['push'](_0x5c365d['shift']());}};_0x2784c7(++_0x9f030b);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'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':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 4df27e3..b6675cd 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 _0x8eb8=['then','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x4a518f,_0x1cecde){var _0x551a5e=function(_0x17b103){while(--_0x17b103){_0x4a518f['push'](_0x4a518f['shift']());}};_0x551a5e(++_0x1cecde);}(_0x8eb8,0x7d));var _0x88eb=function(_0x9822c4,_0x37a957){_0x9822c4=_0x9822c4-0x0;var _0x456ce4=_0x8eb8[_0x9822c4];return _0x456ce4;};'use strict';var _=require(_0x88eb('0x0'));var util=require(_0x88eb('0x1'));var moment=require('moment');var BPromise=require(_0x88eb('0x2'));var rs=require(_0x88eb('0x3'));var fs=require('fs');var Redis=require(_0x88eb('0x4'));var db=require(_0x88eb('0x5'))['db'];var utils=require(_0x88eb('0x6'));var logger=require(_0x88eb('0x7'))(_0x88eb('0x8'));var config=require(_0x88eb('0x9'));var jayson=require(_0x88eb('0xa'));var client=jayson[_0x88eb('0xb')][_0x88eb('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3cad2d,_0x32e193,_0x521813){return new BPromise(function(_0x288db4,_0x467c3c){return client['request'](_0x3cad2d,_0x521813)[_0x88eb('0xd')](function(_0x586fa2){logger['info'](_0x88eb('0xe'),_0x32e193,_0x88eb('0xf'));logger[_0x88eb('0x10')](_0x88eb('0x11'),_0x32e193,_0x88eb('0xf'),JSON['stringify'](_0x586fa2));if(_0x586fa2[_0x88eb('0x12')]){if(_0x586fa2[_0x88eb('0x12')]['code']===0x1f4){logger[_0x88eb('0x12')](_0x88eb('0xe'),_0x32e193,_0x586fa2['error']['message']);return _0x467c3c(_0x586fa2[_0x88eb('0x12')][_0x88eb('0x13')]);}logger[_0x88eb('0x12')](_0x88eb('0xe'),_0x32e193,_0x586fa2[_0x88eb('0x12')][_0x88eb('0x13')]);return _0x288db4(_0x586fa2['error'][_0x88eb('0x13')]);}else{logger[_0x88eb('0x14')](_0x88eb('0xe'),_0x32e193,_0x88eb('0xf'));_0x288db4(_0x586fa2[_0x88eb('0x15')][_0x88eb('0x13')]);}})[_0x88eb('0x16')](function(_0x57bea8){logger[_0x88eb('0x12')](_0x88eb('0xe'),_0x32e193,_0x57bea8);_0x467c3c(_0x57bea8);});});} \ No newline at end of file +var _0x2b10=['catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','Cdr,\x20%s,\x20%s','debug','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x3950fd,_0x4575e9){var _0x1259b9=function(_0x2a9679){while(--_0x2a9679){_0x3950fd['push'](_0x3950fd['shift']());}};_0x1259b9(++_0x4575e9);}(_0x2b10,0xd0));var _0x02b1=function(_0x3d3b72,_0x4161ab){_0x3d3b72=_0x3d3b72-0x0;var _0x77de31=_0x2b10[_0x3d3b72];return _0x77de31;};'use strict';var _=require(_0x02b1('0x0'));var util=require(_0x02b1('0x1'));var moment=require(_0x02b1('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x02b1('0x3'));var db=require(_0x02b1('0x4'))['db'];var utils=require(_0x02b1('0x5'));var logger=require(_0x02b1('0x6'))(_0x02b1('0x7'));var config=require(_0x02b1('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x02b1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x10a167,_0x4dbdf9,_0x2b8abe){return new BPromise(function(_0x29027a,_0x53182c){return client[_0x02b1('0xa')](_0x10a167,_0x2b8abe)[_0x02b1('0xb')](function(_0x351d0f){logger[_0x02b1('0xc')](_0x02b1('0xd'),_0x4dbdf9,'request\x20sent');logger[_0x02b1('0xe')](_0x02b1('0xf'),_0x4dbdf9,_0x02b1('0x10'),JSON[_0x02b1('0x11')](_0x351d0f));if(_0x351d0f[_0x02b1('0x12')]){if(_0x351d0f[_0x02b1('0x12')][_0x02b1('0x13')]===0x1f4){logger['error'](_0x02b1('0xd'),_0x4dbdf9,_0x351d0f[_0x02b1('0x12')][_0x02b1('0x14')]);return _0x53182c(_0x351d0f[_0x02b1('0x12')]['message']);}logger[_0x02b1('0x12')](_0x02b1('0xd'),_0x4dbdf9,_0x351d0f['error'][_0x02b1('0x14')]);return _0x29027a(_0x351d0f[_0x02b1('0x12')][_0x02b1('0x14')]);}else{logger[_0x02b1('0xc')](_0x02b1('0xd'),_0x4dbdf9,_0x02b1('0x10'));_0x29027a(_0x351d0f[_0x02b1('0x15')][_0x02b1('0x14')]);}})[_0x02b1('0x16')](function(_0x49a1a2){logger['error']('Cdr,\x20%s,\x20%s',_0x4dbdf9,_0x49a1a2);_0x53182c(_0x49a1a2);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index f1a02fb..aec4308 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(_0x5ac13b,_0x371bf0){var _0x2919c1=function(_0x56b44b){while(--_0x56b44b){_0x5ac13b['push'](_0x5ac13b['shift']());}};_0x2919c1(++_0x371bf0);}(_0xb10b,0x12a));var _0xbb10=function(_0x576d8a,_0x2d7bde){_0x576d8a=_0x576d8a-0x0;var _0x3dc3ef=_0xb10b[_0x576d8a];return _0x3dc3ef;};'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(_0x3a1ea5,_0x349f01){var _0xfac9b2=function(_0xd5310c){while(--_0xd5310c){_0x3a1ea5['push'](_0x3a1ea5['shift']());}};_0xfac9b2(++_0x349f01);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'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 f1b12d2..6dc0046 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 _0x3fba=['STRING','*,*,*,*','sequelize','INTEGER','noop','TEXT'];(function(_0xbdbd32,_0x188a65){var _0x3b2e64=function(_0x788471){while(--_0x788471){_0xbdbd32['push'](_0xbdbd32['shift']());}};_0x3b2e64(++_0x188a65);}(_0x3fba,0xbc));var _0xa3fb=function(_0x2f62aa,_0x108e95){_0x2f62aa=_0x2f62aa-0x0;var _0x1a341f=_0x3fba[_0x2f62aa];return _0x1a341f;};'use strict';var Sequelize=require(_0xa3fb('0x0'));module['exports']={'priority':{'type':Sequelize[_0xa3fb('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xa3fb('0x2')},'appdata':{'type':Sequelize[_0xa3fb('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xa3fb('0x4')],'defaultValue':_0xa3fb('0x5')}}; \ No newline at end of file +var _0x6d36=['noop','TEXT','STRING','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x2d04d8,_0x3ef363){var _0x3d0e80=function(_0x2c94da){while(--_0x2c94da){_0x2d04d8['push'](_0x2d04d8['shift']());}};_0x3d0e80(++_0x3ef363);}(_0x6d36,0x138));var _0x66d3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6d36[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x66d3('0x0'));module[_0x66d3('0x1')]={'priority':{'type':Sequelize[_0x66d3('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x66d3('0x3')},'appdata':{'type':Sequelize[_0x66d3('0x4')]()},'description':{'type':Sequelize[_0x66d3('0x5')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x66d3('0x6')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index ce7f199..9b75963 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 _0x3f9b=['update','then','destroy','error','stack','name','send','show','params','model','keys','ChatApplication','rawAttributes','query','fields','attributes','includeAll','include','merge','find','catch','zip-dir','request-promise','moment','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x3f9b,0x11e));var _0xb3f9=function(_0x237825,_0x3c6f8d){_0x237825=_0x237825-0x0;var _0x3dbfbe=_0x3f9b[_0x237825];return _0x3dbfbe;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb3f9('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb3f9('0x1'));var moment=require(_0xb3f9('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xb3f9('0x3'));var sox=require(_0xb3f9('0x4'));var csv=require(_0xb3f9('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb3f9('0x6'));var _=require(_0xb3f9('0x7'));var squel=require(_0xb3f9('0x8'));var crypto=require(_0xb3f9('0x9'));var jsforce=require(_0xb3f9('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb3f9('0xb'));var Papa=require(_0xb3f9('0xc'));var Redis=require('ioredis');var authService=require(_0xb3f9('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb3f9('0xe'));var logger=require(_0xb3f9('0xf'))(_0xb3f9('0x10'));var utils=require(_0xb3f9('0x11'));var config=require(_0xb3f9('0x12'));var licenseUtil=require(_0xb3f9('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1cdce2,_0xbbc1cb){_0xbbc1cb=_0xbbc1cb||0xcc;return function(_0x395561){if(_0x395561){return _0x1cdce2[_0xb3f9('0x14')](_0xbbc1cb);}return _0x1cdce2[_0xb3f9('0x15')](_0xbbc1cb)[_0xb3f9('0x16')]();};}function respondWithResult(_0x36c56c,_0x67f3ee){_0x67f3ee=_0x67f3ee||0xc8;return function(_0x590d44){if(_0x590d44){return _0x36c56c[_0xb3f9('0x15')](_0x67f3ee)['json'](_0x590d44);}};}function respondWithFilteredResult(_0x55256c,_0x214c4b){return function(_0x86b55c){if(_0x86b55c){var _0x171378=typeof _0x214c4b[_0xb3f9('0x17')]===_0xb3f9('0x18')&&typeof _0x214c4b[_0xb3f9('0x19')]===_0xb3f9('0x18');var _0x3f89e5=_0x86b55c['count'];var _0x2c69d4=_0x171378?0x0:_0x214c4b['offset'];var _0x5e7e42=_0x171378?_0x86b55c[_0xb3f9('0x1a')]:_0x214c4b['offset']+_0x214c4b[_0xb3f9('0x19')];var _0x33cf23;if(_0x5e7e42>=_0x3f89e5){_0x5e7e42=_0x3f89e5;_0x33cf23=0xc8;}else{_0x33cf23=0xce;}_0x55256c[_0xb3f9('0x15')](_0x33cf23);return _0x55256c[_0xb3f9('0x1b')](_0xb3f9('0x1c'),_0x2c69d4+'-'+_0x5e7e42+'/'+_0x3f89e5)[_0xb3f9('0x1d')](_0x86b55c);}return null;};}function patchUpdates(_0x4b7da0){return function(_0x51b607){try{jsonpatch['apply'](_0x51b607,_0x4b7da0,!![]);}catch(_0xb17d2e){return BPromise[_0xb3f9('0x1e')](_0xb17d2e);}return _0x51b607[_0xb3f9('0x1f')]();};}function saveUpdates(_0x4bffc7,_0x53f664){return function(_0x3446ea){if(_0x3446ea){return _0x3446ea[_0xb3f9('0x20')](_0x4bffc7)[_0xb3f9('0x21')](function(_0x560077){return _0x560077;});}return null;};}function removeEntity(_0x3b8738,_0x503ba7){return function(_0x20e804){if(_0x20e804){return _0x20e804[_0xb3f9('0x22')]()[_0xb3f9('0x21')](function(){_0x3b8738['status'](0xcc)[_0xb3f9('0x16')]();});}};}function handleEntityNotFound(_0x1ffd67,_0x378271){return function(_0x4d70e6){if(!_0x4d70e6){_0x1ffd67[_0xb3f9('0x14')](0x194);}return _0x4d70e6;};}function handleError(_0x402bc2,_0x581510){_0x581510=_0x581510||0x1f4;return function(_0x317e48){logger[_0xb3f9('0x23')](_0x317e48[_0xb3f9('0x24')]);if(_0x317e48[_0xb3f9('0x25')]){delete _0x317e48[_0xb3f9('0x25')];}_0x402bc2['status'](_0x581510)[_0xb3f9('0x26')](_0x317e48);};}exports[_0xb3f9('0x27')]=function(_0x2939f8,_0x1d94e0){var _0x3d8c58={'raw':!![],'where':{'id':_0x2939f8[_0xb3f9('0x28')]['id']}},_0x1b952f={};_0x1b952f[_0xb3f9('0x29')]=_[_0xb3f9('0x2a')](db[_0xb3f9('0x2b')][_0xb3f9('0x2c')]);_0x1b952f[_0xb3f9('0x2d')]=_[_0xb3f9('0x2a')](_0x2939f8['query']);_0x1b952f['filters']=_['intersection'](_0x1b952f[_0xb3f9('0x29')],_0x1b952f['query']);_0x3d8c58['attributes']=_['intersection'](_0x1b952f[_0xb3f9('0x29')],qs[_0xb3f9('0x2e')](_0x2939f8['query'][_0xb3f9('0x2e')]));_0x3d8c58[_0xb3f9('0x2f')]=_0x3d8c58[_0xb3f9('0x2f')]['length']?_0x3d8c58['attributes']:_0x1b952f[_0xb3f9('0x29')];if(_0x2939f8['query'][_0xb3f9('0x30')]){_0x3d8c58[_0xb3f9('0x31')]=[{'all':!![]}];}_0x3d8c58=_[_0xb3f9('0x32')]({},_0x3d8c58,_0x2939f8['options']);return db[_0xb3f9('0x2b')][_0xb3f9('0x33')](_0x3d8c58)[_0xb3f9('0x21')](handleEntityNotFound(_0x1d94e0,null))['then'](respondWithResult(_0x1d94e0,null))[_0xb3f9('0x34')](handleError(_0x1d94e0,null));};exports[_0xb3f9('0x20')]=function(_0x5c45e9,_0x21f16a){if(_0x5c45e9['body']['id']){delete _0x5c45e9['body']['id'];}return db[_0xb3f9('0x2b')][_0xb3f9('0x33')]({'where':{'id':_0x5c45e9['params']['id']}})['then'](handleEntityNotFound(_0x21f16a,null))[_0xb3f9('0x21')](saveUpdates(_0x5c45e9['body'],null))[_0xb3f9('0x21')](respondWithResult(_0x21f16a,null))[_0xb3f9('0x34')](handleError(_0x21f16a,null));};exports[_0xb3f9('0x22')]=function(_0x3b8449,_0x48281d){return db['ChatApplication'][_0xb3f9('0x33')]({'where':{'id':_0x3b8449['params']['id']}})[_0xb3f9('0x21')](handleEntityNotFound(_0x48281d,null))['then'](removeEntity(_0x48281d,null))[_0xb3f9('0x34')](handleError(_0x48281d,null));}; \ No newline at end of file +var _0x8a9d=['then','stack','name','send','show','model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','length','include','merge','find','catch','body','params','eml-format','rimraf','fast-json-patch','request-promise','bluebird','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/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update'];(function(_0x350ffa,_0x4b471b){var _0x9116df=function(_0x38b851){while(--_0x38b851){_0x350ffa['push'](_0x350ffa['shift']());}};_0x9116df(++_0x4b471b);}(_0x8a9d,0x1ed));var _0xd8a9=function(_0x372b07,_0x6af854){_0x372b07=_0x372b07-0x0;var _0x4ec305=_0x8a9d[_0x372b07];return _0x4ec305;};'use strict';var emlformat=require(_0xd8a9('0x0'));var rimraf=require(_0xd8a9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd8a9('0x2'));var rp=require(_0xd8a9('0x3'));var moment=require('moment');var BPromise=require(_0xd8a9('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd8a9('0x5'));var sox=require(_0xd8a9('0x6'));var csv=require(_0xd8a9('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd8a9('0x8'));var _=require(_0xd8a9('0x9'));var squel=require(_0xd8a9('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd8a9('0xb'));var toCsv=require(_0xd8a9('0x7'));var querystring=require('querystring');var Papa=require(_0xd8a9('0xc'));var Redis=require(_0xd8a9('0xd'));var authService=require(_0xd8a9('0xe'));var qs=require(_0xd8a9('0xf'));var as=require(_0xd8a9('0x10'));var hardwareService=require(_0xd8a9('0x11'));var logger=require(_0xd8a9('0x12'))(_0xd8a9('0x13'));var utils=require(_0xd8a9('0x14'));var config=require(_0xd8a9('0x15'));var licenseUtil=require(_0xd8a9('0x16'));var db=require(_0xd8a9('0x17'))['db'];function respondWithStatusCode(_0x3c95b2,_0x87c04e){_0x87c04e=_0x87c04e||0xcc;return function(_0x281f47){if(_0x281f47){return _0x3c95b2[_0xd8a9('0x18')](_0x87c04e);}return _0x3c95b2['status'](_0x87c04e)[_0xd8a9('0x19')]();};}function respondWithResult(_0x5d198b,_0x46cf9d){_0x46cf9d=_0x46cf9d||0xc8;return function(_0x34a7ee){if(_0x34a7ee){return _0x5d198b[_0xd8a9('0x1a')](_0x46cf9d)['json'](_0x34a7ee);}};}function respondWithFilteredResult(_0x4eaa0c,_0x32fefd){return function(_0x5ef067){if(_0x5ef067){var _0x1db97b=typeof _0x32fefd[_0xd8a9('0x1b')]===_0xd8a9('0x1c')&&typeof _0x32fefd[_0xd8a9('0x1d')]==='undefined';var _0x34ce6a=_0x5ef067[_0xd8a9('0x1e')];var _0x359e9f=_0x1db97b?0x0:_0x32fefd['offset'];var _0x354c43=_0x1db97b?_0x5ef067[_0xd8a9('0x1e')]:_0x32fefd[_0xd8a9('0x1b')]+_0x32fefd[_0xd8a9('0x1d')];var _0x3c597b;if(_0x354c43>=_0x34ce6a){_0x354c43=_0x34ce6a;_0x3c597b=0xc8;}else{_0x3c597b=0xce;}_0x4eaa0c[_0xd8a9('0x1a')](_0x3c597b);return _0x4eaa0c[_0xd8a9('0x1f')](_0xd8a9('0x20'),_0x359e9f+'-'+_0x354c43+'/'+_0x34ce6a)[_0xd8a9('0x21')](_0x5ef067);}return null;};}function patchUpdates(_0x228f65){return function(_0x53907e){try{jsonpatch[_0xd8a9('0x22')](_0x53907e,_0x228f65,!![]);}catch(_0x427feb){return BPromise[_0xd8a9('0x23')](_0x427feb);}return _0x53907e[_0xd8a9('0x24')]();};}function saveUpdates(_0xd1077a,_0x4eba54){return function(_0xff2b6e){if(_0xff2b6e){return _0xff2b6e[_0xd8a9('0x25')](_0xd1077a)[_0xd8a9('0x26')](function(_0x3bb258){return _0x3bb258;});}return null;};}function removeEntity(_0x4abe9a,_0x49d57a){return function(_0x4ae351){if(_0x4ae351){return _0x4ae351['destroy']()[_0xd8a9('0x26')](function(){_0x4abe9a[_0xd8a9('0x1a')](0xcc)[_0xd8a9('0x19')]();});}};}function handleEntityNotFound(_0x1e62ef,_0x442c96){return function(_0x1de15d){if(!_0x1de15d){_0x1e62ef[_0xd8a9('0x18')](0x194);}return _0x1de15d;};}function handleError(_0x37eb4f,_0x2b4102){_0x2b4102=_0x2b4102||0x1f4;return function(_0x598457){logger['error'](_0x598457[_0xd8a9('0x27')]);if(_0x598457[_0xd8a9('0x28')]){delete _0x598457[_0xd8a9('0x28')];}_0x37eb4f['status'](_0x2b4102)[_0xd8a9('0x29')](_0x598457);};}exports[_0xd8a9('0x2a')]=function(_0x3b542c,_0x419ebe){var _0x1bb98f={'raw':!![],'where':{'id':_0x3b542c['params']['id']}},_0x3563e2={};_0x3563e2[_0xd8a9('0x2b')]=_[_0xd8a9('0x2c')](db[_0xd8a9('0x2d')][_0xd8a9('0x2e')]);_0x3563e2[_0xd8a9('0x2f')]=_[_0xd8a9('0x2c')](_0x3b542c[_0xd8a9('0x2f')]);_0x3563e2[_0xd8a9('0x30')]=_[_0xd8a9('0x31')](_0x3563e2[_0xd8a9('0x2b')],_0x3563e2['query']);_0x1bb98f[_0xd8a9('0x32')]=_['intersection'](_0x3563e2['model'],qs[_0xd8a9('0x33')](_0x3b542c[_0xd8a9('0x2f')][_0xd8a9('0x33')]));_0x1bb98f['attributes']=_0x1bb98f[_0xd8a9('0x32')][_0xd8a9('0x34')]?_0x1bb98f[_0xd8a9('0x32')]:_0x3563e2[_0xd8a9('0x2b')];if(_0x3b542c[_0xd8a9('0x2f')]['includeAll']){_0x1bb98f[_0xd8a9('0x35')]=[{'all':!![]}];}_0x1bb98f=_[_0xd8a9('0x36')]({},_0x1bb98f,_0x3b542c['options']);return db[_0xd8a9('0x2d')][_0xd8a9('0x37')](_0x1bb98f)[_0xd8a9('0x26')](handleEntityNotFound(_0x419ebe,null))[_0xd8a9('0x26')](respondWithResult(_0x419ebe,null))[_0xd8a9('0x38')](handleError(_0x419ebe,null));};exports[_0xd8a9('0x25')]=function(_0x72b295,_0x2835ca){if(_0x72b295[_0xd8a9('0x39')]['id']){delete _0x72b295[_0xd8a9('0x39')]['id'];}return db['ChatApplication'][_0xd8a9('0x37')]({'where':{'id':_0x72b295[_0xd8a9('0x3a')]['id']}})['then'](handleEntityNotFound(_0x2835ca,null))[_0xd8a9('0x26')](saveUpdates(_0x72b295[_0xd8a9('0x39')],null))[_0xd8a9('0x26')](respondWithResult(_0x2835ca,null))[_0xd8a9('0x38')](handleError(_0x2835ca,null));};exports['destroy']=function(_0x4d6ee4,_0xa8480){return db[_0xd8a9('0x2d')][_0xd8a9('0x37')]({'where':{'id':_0x4d6ee4[_0xd8a9('0x3a')]['id']}})[_0xd8a9('0x26')](handleEntityNotFound(_0xa8480,null))[_0xd8a9('0x26')](removeEntity(_0xa8480,null))[_0xd8a9('0x38')](handleError(_0xa8480,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index e84f57c..69ea1f1 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 _0x4588=['rimraf','define','ChatApplication','chat_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x5c0e4d,_0x5b1db2){var _0x2a2ea7=function(_0x42be23){while(--_0x42be23){_0x5c0e4d['push'](_0x5c0e4d['shift']());}};_0x2a2ea7(++_0x5b1db2);}(_0x4588,0x179));var _0x8458=function(_0x6182ff,_0x59d492){_0x6182ff=_0x6182ff-0x0;var _0x1cec22=_0x4588[_0x6182ff];return _0x1cec22;};'use strict';var _=require(_0x8458('0x0'));var util=require(_0x8458('0x1'));var logger=require(_0x8458('0x2'))(_0x8458('0x3'));var moment=require('moment');var BPromise=require(_0x8458('0x4'));var rp=require(_0x8458('0x5'));var fs=require('fs');var path=require(_0x8458('0x6'));var rimraf=require(_0x8458('0x7'));var config=require('../../config/environment');var attributes=require('./chatApplication.attributes');module['exports']=function(_0x46ff3e,_0x7c4650){return _0x46ff3e[_0x8458('0x8')](_0x8458('0x9'),attributes,{'tableName':_0x8458('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x8458('0xb')});}; \ No newline at end of file +var _0x84f1=['util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','define','ChatApplication','utf8mb4','lodash'];(function(_0x331085,_0x46ef3b){var _0x1547f4=function(_0x549b5d){while(--_0x549b5d){_0x331085['push'](_0x331085['shift']());}};_0x1547f4(++_0x46ef3b);}(_0x84f1,0x1bb));var _0x184f=function(_0x5e2eb2,_0x22dffa){_0x5e2eb2=_0x5e2eb2-0x0;var _0xc3b151=_0x84f1[_0x5e2eb2];return _0xc3b151;};'use strict';var _=require(_0x184f('0x0'));var util=require(_0x184f('0x1'));var logger=require(_0x184f('0x2'))(_0x184f('0x3'));var moment=require('moment');var BPromise=require(_0x184f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x184f('0x5'));var rimraf=require(_0x184f('0x6'));var config=require(_0x184f('0x7'));var attributes=require(_0x184f('0x8'));module['exports']=function(_0x27201f,_0x4c641a){return _0x27201f[_0x184f('0x9')](_0x184f('0xa'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x184f('0xb'),'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 81194ed..a18dbc2 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 _0x6644=['request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','ChatApplication,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info'];(function(_0x3f6460,_0x3bdb9b){var _0x5d9ac6=function(_0x1ebb5e){while(--_0x1ebb5e){_0x3f6460['push'](_0x3f6460['shift']());}};_0x5d9ac6(++_0x3bdb9b);}(_0x6644,0x182));var _0x4664=function(_0x41abc0,_0x418df2){_0x41abc0=_0x41abc0-0x0;var _0x2a25f5=_0x6644[_0x41abc0];return _0x2a25f5;};'use strict';var _=require('lodash');var util=require(_0x4664('0x0'));var moment=require(_0x4664('0x1'));var BPromise=require(_0x4664('0x2'));var rs=require(_0x4664('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4664('0x4'))['db'];var utils=require(_0x4664('0x5'));var logger=require(_0x4664('0x6'))(_0x4664('0x7'));var config=require(_0x4664('0x8'));var jayson=require(_0x4664('0x9'));var client=jayson[_0x4664('0xa')][_0x4664('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x232a03,_0x26d05b,_0x27fd5f){return new BPromise(function(_0x7a0978,_0x56da1a){return client['request'](_0x232a03,_0x27fd5f)['then'](function(_0x4f6b27){logger[_0x4664('0xc')]('ChatApplication,\x20%s,\x20%s',_0x26d05b,_0x4664('0xd'));logger['debug'](_0x4664('0xe'),_0x26d05b,'request\x20sent',JSON[_0x4664('0xf')](_0x4f6b27));if(_0x4f6b27[_0x4664('0x10')]){if(_0x4f6b27[_0x4664('0x10')]['code']===0x1f4){logger[_0x4664('0x10')](_0x4664('0x11'),_0x26d05b,_0x4f6b27[_0x4664('0x10')][_0x4664('0x12')]);return _0x56da1a(_0x4f6b27[_0x4664('0x10')][_0x4664('0x12')]);}logger[_0x4664('0x10')]('ChatApplication,\x20%s,\x20%s',_0x26d05b,_0x4f6b27['error'][_0x4664('0x12')]);return _0x7a0978(_0x4f6b27['error']['message']);}else{logger[_0x4664('0xc')]('ChatApplication,\x20%s,\x20%s',_0x26d05b,'request\x20sent');_0x7a0978(_0x4f6b27[_0x4664('0x13')][_0x4664('0x12')]);}})[_0x4664('0x14')](function(_0x11c48b){logger[_0x4664('0x10')](_0x4664('0x11'),_0x26d05b,_0x11c48b);_0x56da1a(_0x11c48b);});});} \ No newline at end of file +var _0x34e8=['code','ChatApplication,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x4152dd,_0x4efab0){var _0x19a354=function(_0x3d6964){while(--_0x3d6964){_0x4152dd['push'](_0x4152dd['shift']());}};_0x19a354(++_0x4efab0);}(_0x34e8,0x82));var _0x834e=function(_0x540cfb,_0x15f0b5){_0x540cfb=_0x540cfb-0x0;var _0x65cb16=_0x34e8[_0x540cfb];return _0x65cb16;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var moment=require(_0x834e('0x2'));var BPromise=require(_0x834e('0x3'));var rs=require(_0x834e('0x4'));var fs=require('fs');var Redis=require(_0x834e('0x5'));var db=require(_0x834e('0x6'))['db'];var utils=require(_0x834e('0x7'));var logger=require(_0x834e('0x8'))(_0x834e('0x9'));var config=require(_0x834e('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x834e('0xb')][_0x834e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3a37b0,_0x361c17,_0x1cd970){return new BPromise(function(_0x46c800,_0x4215ba){return client[_0x834e('0xd')](_0x3a37b0,_0x1cd970)[_0x834e('0xe')](function(_0x58bd5d){logger[_0x834e('0xf')]('ChatApplication,\x20%s,\x20%s',_0x361c17,'request\x20sent');logger['debug'](_0x834e('0x10'),_0x361c17,_0x834e('0x11'),JSON[_0x834e('0x12')](_0x58bd5d));if(_0x58bd5d[_0x834e('0x13')]){if(_0x58bd5d[_0x834e('0x13')][_0x834e('0x14')]===0x1f4){logger[_0x834e('0x13')](_0x834e('0x15'),_0x361c17,_0x58bd5d['error']['message']);return _0x4215ba(_0x58bd5d[_0x834e('0x13')][_0x834e('0x16')]);}logger['error'](_0x834e('0x15'),_0x361c17,_0x58bd5d[_0x834e('0x13')][_0x834e('0x16')]);return _0x46c800(_0x58bd5d[_0x834e('0x13')][_0x834e('0x16')]);}else{logger[_0x834e('0xf')](_0x834e('0x15'),_0x361c17,_0x834e('0x11'));_0x46c800(_0x58bd5d[_0x834e('0x17')][_0x834e('0x16')]);}})[_0x834e('0x18')](function(_0x5593e3){logger['error'](_0x834e('0x15'),_0x361c17,_0x5593e3);_0x4215ba(_0x5593e3);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index bcfccee..a3bf0e4 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 _0x0cac=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatApplication.controller','get','/:id','isAuthenticated','show','put','update','exports','multer','path','express'];(function(_0x5073a4,_0x3e27e2){var _0x15314a=function(_0x10be66){while(--_0x10be66){_0x5073a4['push'](_0x5073a4['shift']());}};_0x15314a(++_0x3e27e2);}(_0x0cac,0x1dd));var _0xc0ca=function(_0x27c5b4,_0x430385){_0x27c5b4=_0x27c5b4-0x0;var _0x1358ba=_0x0cac[_0x27c5b4];return _0x1358ba;};'use strict';var multer=require(_0xc0ca('0x0'));var util=require('util');var path=require(_0xc0ca('0x1'));var timeout=require('connect-timeout');var express=require(_0xc0ca('0x2'));var router=express[_0xc0ca('0x3')]();var fs_extra=require(_0xc0ca('0x4'));var auth=require(_0xc0ca('0x5'));var interaction=require(_0xc0ca('0x6'));var config=require('../../config/environment');var controller=require(_0xc0ca('0x7'));router[_0xc0ca('0x8')](_0xc0ca('0x9'),auth[_0xc0ca('0xa')](),controller[_0xc0ca('0xb')]);router[_0xc0ca('0xc')](_0xc0ca('0x9'),auth[_0xc0ca('0xa')](),controller[_0xc0ca('0xd')]);router['delete']('/:id',auth[_0xc0ca('0xa')](),controller['destroy']);module[_0xc0ca('0xe')]=router; \ No newline at end of file +var _0x58de=['show','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated'];(function(_0x2af009,_0x5432ee){var _0x46d15f=function(_0x26569f){while(--_0x26569f){_0x2af009['push'](_0x2af009['shift']());}};_0x46d15f(++_0x5432ee);}(_0x58de,0xf1));var _0xe58d=function(_0x19c3f4,_0x3b6a12){_0x19c3f4=_0x19c3f4-0x0;var _0x513c9b=_0x58de[_0x19c3f4];return _0x513c9b;};'use strict';var multer=require(_0xe58d('0x0'));var util=require(_0xe58d('0x1'));var path=require(_0xe58d('0x2'));var timeout=require(_0xe58d('0x3'));var express=require(_0xe58d('0x4'));var router=express[_0xe58d('0x5')]();var fs_extra=require(_0xe58d('0x6'));var auth=require(_0xe58d('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xe58d('0x8'));var controller=require('./chatApplication.controller');router[_0xe58d('0x9')]('/:id',auth[_0xe58d('0xa')](),controller[_0xe58d('0xb')]);router[_0xe58d('0xc')](_0xe58d('0xd'),auth[_0xe58d('0xa')](),controller[_0xe58d('0xe')]);router[_0xe58d('0xf')](_0xe58d('0xd'),auth[_0xe58d('0xa')](),controller[_0xe58d('0x10')]);module[_0xe58d('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index c032d56..9f9f908 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 _0x1921=['STRING','BOOLEAN','sequelize'];(function(_0x7e6b22,_0x4116fd){var _0x3f7e2a=function(_0xd26244){while(--_0xd26244){_0x7e6b22['push'](_0x7e6b22['shift']());}};_0x3f7e2a(++_0x4116fd);}(_0x1921,0xf2));var _0x1192=function(_0x36e87f,_0x4061cc){_0x36e87f=_0x36e87f-0x0;var _0x19d2ec=_0x1921[_0x36e87f];return _0x19d2ec;};'use strict';var Sequelize=require(_0x1192('0x0'));module['exports']={'name':{'type':Sequelize[_0x1192('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x1192('0x1')]},'write':{'type':Sequelize[_0x1192('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0x46e4=['STRING','BOOLEAN','sequelize'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x46e4,0xdd));var _0x446e=function(_0x2e18a9,_0x2ae8c2){_0x2e18a9=_0x2e18a9-0x0;var _0x39d8d7=_0x46e4[_0x2e18a9];return _0x39d8d7;};'use strict';var Sequelize=require(_0x446e('0x0'));module['exports']={'name':{'type':Sequelize[_0x446e('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x446e('0x1')]},'write':{'type':Sequelize[_0x446e('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 1dcae9e..64364cb 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 _0xfa17=['update','then','error','name','send','index','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','ChatGroup','includeAll','include','findAll','rows','show','params','find','catch','create','body','destroy','describe','getUnread','ChatInternalMessage','user','addMembers','ids','findOne','User','getMembers','removeMembers','addMessage','ChatGroupId','getMessages','$gte','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./chatGroup.socket','sendStatus','end','status','json','offset','count','limit','set','Content-Range','apply'];(function(_0x568eca,_0x549174){var _0x767192=function(_0x4bc377){while(--_0x4bc377){_0x568eca['push'](_0x568eca['shift']());}};_0x767192(++_0x549174);}(_0xfa17,0x1b3));var _0x7fa1=function(_0x24e3ca,_0x4c951e){_0x24e3ca=_0x24e3ca-0x0;var _0x9204aa=_0xfa17[_0x24e3ca];return _0x9204aa;};'use strict';var emlformat=require(_0x7fa1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7fa1('0x1'));var jsonpatch=require(_0x7fa1('0x2'));var rp=require(_0x7fa1('0x3'));var moment=require(_0x7fa1('0x4'));var BPromise=require(_0x7fa1('0x5'));var Mustache=require(_0x7fa1('0x6'));var util=require('util');var path=require('path');var sox=require(_0x7fa1('0x7'));var csv=require(_0x7fa1('0x8'));var ejs=require(_0x7fa1('0x9'));var fs=require('fs');var fs_extra=require(_0x7fa1('0xa'));var _=require('lodash');var squel=require(_0x7fa1('0xb'));var crypto=require(_0x7fa1('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7fa1('0xd'));var toCsv=require(_0x7fa1('0x8'));var querystring=require(_0x7fa1('0xe'));var Papa=require(_0x7fa1('0xf'));var Redis=require('ioredis');var authService=require(_0x7fa1('0x10'));var qs=require(_0x7fa1('0x11'));var as=require(_0x7fa1('0x12'));var hardwareService=require(_0x7fa1('0x13'));var logger=require(_0x7fa1('0x14'))(_0x7fa1('0x15'));var utils=require(_0x7fa1('0x16'));var config=require(_0x7fa1('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x7fa1('0x18'))['db'];config['redis']=_[_0x7fa1('0x19')](config['redis'],{'host':_0x7fa1('0x1a'),'port':0x18eb});var socket=require(_0x7fa1('0x1b'))(new Redis(config[_0x7fa1('0x1c')]));require(_0x7fa1('0x1d'))['register'](socket);function respondWithStatusCode(_0x3d4dd9,_0x23c6a8){_0x23c6a8=_0x23c6a8||0xcc;return function(_0x374c24){if(_0x374c24){return _0x3d4dd9[_0x7fa1('0x1e')](_0x23c6a8);}return _0x3d4dd9['status'](_0x23c6a8)[_0x7fa1('0x1f')]();};}function respondWithResult(_0x1807d3,_0x149a91){_0x149a91=_0x149a91||0xc8;return function(_0x5df245){if(_0x5df245){return _0x1807d3[_0x7fa1('0x20')](_0x149a91)[_0x7fa1('0x21')](_0x5df245);}};}function respondWithFilteredResult(_0x2b6112,_0x7c3003){return function(_0x581e91){if(_0x581e91){var _0x4008c4=typeof _0x7c3003[_0x7fa1('0x22')]==='undefined'&&typeof _0x7c3003['limit']==='undefined';var _0x57b268=_0x581e91[_0x7fa1('0x23')];var _0xdee8a0=_0x4008c4?0x0:_0x7c3003[_0x7fa1('0x22')];var _0x49d4e5=_0x4008c4?_0x581e91[_0x7fa1('0x23')]:_0x7c3003[_0x7fa1('0x22')]+_0x7c3003[_0x7fa1('0x24')];var _0x541cca;if(_0x49d4e5>=_0x57b268){_0x49d4e5=_0x57b268;_0x541cca=0xc8;}else{_0x541cca=0xce;}_0x2b6112['status'](_0x541cca);return _0x2b6112[_0x7fa1('0x25')](_0x7fa1('0x26'),_0xdee8a0+'-'+_0x49d4e5+'/'+_0x57b268)['json'](_0x581e91);}return null;};}function patchUpdates(_0x515050){return function(_0x24b106){try{jsonpatch[_0x7fa1('0x27')](_0x24b106,_0x515050,!![]);}catch(_0x5232f2){return BPromise['reject'](_0x5232f2);}return _0x24b106['save']();};}function saveUpdates(_0x1a6ad2,_0x4d9470){return function(_0x490c88){if(_0x490c88){return _0x490c88[_0x7fa1('0x28')](_0x1a6ad2)[_0x7fa1('0x29')](function(_0x13ac85){return _0x13ac85;});}return null;};}function removeEntity(_0x335762,_0x31ae4a){return function(_0x130324){if(_0x130324){return _0x130324['destroy']()[_0x7fa1('0x29')](function(){_0x335762['status'](0xcc)[_0x7fa1('0x1f')]();});}};}function handleEntityNotFound(_0x39643f,_0x546831){return function(_0x495a35){if(!_0x495a35){_0x39643f['sendStatus'](0x194);}return _0x495a35;};}function handleError(_0x1d9d93,_0x5bb17b){_0x5bb17b=_0x5bb17b||0x1f4;return function(_0x4a662){logger[_0x7fa1('0x2a')](_0x4a662['stack']);if(_0x4a662[_0x7fa1('0x2b')]){delete _0x4a662['name'];}_0x1d9d93['status'](_0x5bb17b)[_0x7fa1('0x2c')](_0x4a662);};}exports[_0x7fa1('0x2d')]=function(_0x5d1589,_0x4ea37a){var _0x333931={},_0xc34c9c={},_0x34b89b={'count':0x0,'rows':[]};var _0x90aee1=_['map'](db['ChatGroup'][_0x7fa1('0x2e')],function(_0x5cbd5f){return{'name':_0x5cbd5f[_0x7fa1('0x2f')],'type':_0x5cbd5f['type'][_0x7fa1('0x30')]};});_0xc34c9c[_0x7fa1('0x31')]=_[_0x7fa1('0x32')](_0x90aee1,_0x7fa1('0x2b'));_0xc34c9c[_0x7fa1('0x33')]=_[_0x7fa1('0x34')](_0x5d1589[_0x7fa1('0x33')]);_0xc34c9c[_0x7fa1('0x35')]=_[_0x7fa1('0x36')](_0xc34c9c['model'],_0xc34c9c[_0x7fa1('0x33')]);_0x333931[_0x7fa1('0x37')]=_[_0x7fa1('0x36')](_0xc34c9c[_0x7fa1('0x31')],qs[_0x7fa1('0x38')](_0x5d1589[_0x7fa1('0x33')][_0x7fa1('0x38')]));_0x333931[_0x7fa1('0x37')]=_0x333931[_0x7fa1('0x37')][_0x7fa1('0x39')]?_0x333931[_0x7fa1('0x37')]:_0xc34c9c[_0x7fa1('0x31')];if(!_0x5d1589['query'][_0x7fa1('0x3a')](_0x7fa1('0x3b'))){_0x333931[_0x7fa1('0x24')]=qs[_0x7fa1('0x24')](_0x5d1589[_0x7fa1('0x33')]['limit']);_0x333931[_0x7fa1('0x22')]=qs['offset'](_0x5d1589[_0x7fa1('0x33')][_0x7fa1('0x22')]);}_0x333931[_0x7fa1('0x3c')]=qs[_0x7fa1('0x3d')](_0x5d1589[_0x7fa1('0x33')][_0x7fa1('0x3d')]);_0x333931['where']=qs['filters'](_[_0x7fa1('0x3e')](_0x5d1589['query'],_0xc34c9c[_0x7fa1('0x35')]),_0x90aee1);if(_0x5d1589[_0x7fa1('0x33')][_0x7fa1('0x3f')]){_0x333931[_0x7fa1('0x40')]=_['merge'](_0x333931[_0x7fa1('0x40')],{'$or':_[_0x7fa1('0x32')](_0x90aee1,function(_0x47e792){if(_0x47e792['type']!=='VIRTUAL'){var _0x43a708={};_0x43a708[_0x47e792['name']]={'$like':'%'+_0x5d1589[_0x7fa1('0x33')][_0x7fa1('0x3f')]+'%'};return _0x43a708;}})});}_0x333931=_[_0x7fa1('0x41')]({},_0x333931,_0x5d1589[_0x7fa1('0x42')]);var _0x377854={'where':_0x333931['where']};return db[_0x7fa1('0x43')][_0x7fa1('0x23')](_0x377854)[_0x7fa1('0x29')](function(_0x15e530){_0x34b89b[_0x7fa1('0x23')]=_0x15e530;if(_0x5d1589[_0x7fa1('0x33')][_0x7fa1('0x44')]){_0x333931[_0x7fa1('0x45')]=[{'all':!![]}];}return db[_0x7fa1('0x43')][_0x7fa1('0x46')](_0x333931);})[_0x7fa1('0x29')](function(_0x74e749){_0x34b89b[_0x7fa1('0x47')]=_0x74e749;return _0x34b89b;})[_0x7fa1('0x29')](respondWithFilteredResult(_0x4ea37a,_0x333931))['catch'](handleError(_0x4ea37a,null));};exports[_0x7fa1('0x48')]=function(_0x4073f4,_0x2afe27){var _0x29e138={'raw':!![],'where':{'id':_0x4073f4[_0x7fa1('0x49')]['id']}},_0x4b51cc={};_0x4b51cc[_0x7fa1('0x31')]=_[_0x7fa1('0x34')](db[_0x7fa1('0x43')][_0x7fa1('0x2e')]);_0x4b51cc[_0x7fa1('0x33')]=_['keys'](_0x4073f4['query']);_0x4b51cc['filters']=_[_0x7fa1('0x36')](_0x4b51cc[_0x7fa1('0x31')],_0x4b51cc[_0x7fa1('0x33')]);_0x29e138[_0x7fa1('0x37')]=_[_0x7fa1('0x36')](_0x4b51cc[_0x7fa1('0x31')],qs[_0x7fa1('0x38')](_0x4073f4['query'][_0x7fa1('0x38')]));_0x29e138[_0x7fa1('0x37')]=_0x29e138['attributes'][_0x7fa1('0x39')]?_0x29e138[_0x7fa1('0x37')]:_0x4b51cc['model'];if(_0x4073f4[_0x7fa1('0x33')][_0x7fa1('0x44')]){_0x29e138['include']=[{'all':!![]}];}_0x29e138=_[_0x7fa1('0x41')]({},_0x29e138,_0x4073f4[_0x7fa1('0x42')]);return db[_0x7fa1('0x43')][_0x7fa1('0x4a')](_0x29e138)[_0x7fa1('0x29')](handleEntityNotFound(_0x2afe27,null))[_0x7fa1('0x29')](respondWithResult(_0x2afe27,null))[_0x7fa1('0x4b')](handleError(_0x2afe27,null));};exports[_0x7fa1('0x4c')]=function(_0x30224c,_0x22acd0){return db[_0x7fa1('0x43')]['create'](_0x30224c[_0x7fa1('0x4d')],{})[_0x7fa1('0x29')](respondWithResult(_0x22acd0,0xc9))[_0x7fa1('0x4b')](handleError(_0x22acd0,null));};exports['update']=function(_0x51c7b2,_0x17b24b){if(_0x51c7b2['body']['id']){delete _0x51c7b2[_0x7fa1('0x4d')]['id'];}return db[_0x7fa1('0x43')][_0x7fa1('0x4a')]({'where':{'id':_0x51c7b2[_0x7fa1('0x49')]['id']}})[_0x7fa1('0x29')](handleEntityNotFound(_0x17b24b,null))['then'](saveUpdates(_0x51c7b2[_0x7fa1('0x4d')],null))[_0x7fa1('0x29')](respondWithResult(_0x17b24b,null))['catch'](handleError(_0x17b24b,null));};exports[_0x7fa1('0x4e')]=function(_0x335333,_0x1d8607){return db[_0x7fa1('0x43')]['find']({'where':{'id':_0x335333[_0x7fa1('0x49')]['id']}})[_0x7fa1('0x29')](handleEntityNotFound(_0x1d8607,null))[_0x7fa1('0x29')](removeEntity(_0x1d8607,null))[_0x7fa1('0x4b')](handleError(_0x1d8607,null));};exports[_0x7fa1('0x4f')]=function(_0x178eac,_0x33ca55){return db['ChatGroup']['describe']()[_0x7fa1('0x29')](respondWithResult(_0x33ca55,null))[_0x7fa1('0x4b')](handleError(_0x33ca55,null));};exports[_0x7fa1('0x50')]=function(_0x4ab5c8,_0x15a920,_0x4cc30a){return db[_0x7fa1('0x51')][_0x7fa1('0x23')]({'where':{'ChatGroupId':_0x4ab5c8[_0x7fa1('0x49')]['id'],'ToId':_0x4ab5c8[_0x7fa1('0x52')]['id'],'read':![]}})[_0x7fa1('0x29')](function(_0x10afdd){return{'id':_['toInteger'](_0x4ab5c8['params']['id']),'count':_0x10afdd};})['then'](respondWithResult(_0x15a920,null))[_0x7fa1('0x4b')](handleError(_0x15a920,null));};exports[_0x7fa1('0x53')]=function(_0x5a7c7c,_0x21a634,_0xdfeae6){return db[_0x7fa1('0x43')][_0x7fa1('0x4a')]({'where':{'id':_0x5a7c7c['params']['id']}})[_0x7fa1('0x29')](handleEntityNotFound(_0x21a634,null))[_0x7fa1('0x29')](function(_0x1c53e0){if(_0x1c53e0){return _0x1c53e0['addMembers'](_0x5a7c7c[_0x7fa1('0x4d')][_0x7fa1('0x54')],_['omit'](_0x5a7c7c[_0x7fa1('0x4d')],[_0x7fa1('0x54'),'id'])||{});}})[_0x7fa1('0x29')](respondWithResult(_0x21a634,null))[_0x7fa1('0x4b')](handleError(_0x21a634,null));};exports['getMembers']=function(_0x511ab0,_0xe57909,_0x39d396){var _0x4d034a={};var _0x12d7d3={};var _0x4b6e4a;var _0x23e8af;return db[_0x7fa1('0x43')][_0x7fa1('0x55')]({'where':{'id':_0x511ab0[_0x7fa1('0x49')]['id']}})[_0x7fa1('0x29')](handleEntityNotFound(_0xe57909,null))[_0x7fa1('0x29')](function(_0x4c4f14){if(_0x4c4f14){_0x4b6e4a=_0x4c4f14;_0x12d7d3[_0x7fa1('0x31')]=_[_0x7fa1('0x34')](db[_0x7fa1('0x56')][_0x7fa1('0x2e')]);_0x12d7d3[_0x7fa1('0x33')]=_[_0x7fa1('0x34')](_0x511ab0[_0x7fa1('0x33')]);_0x12d7d3[_0x7fa1('0x35')]=_['intersection'](_0x12d7d3['model'],_0x12d7d3['query']);_0x4d034a[_0x7fa1('0x37')]=_[_0x7fa1('0x36')](_0x12d7d3[_0x7fa1('0x31')],qs['fields'](_0x511ab0[_0x7fa1('0x33')][_0x7fa1('0x38')]));_0x4d034a[_0x7fa1('0x37')]=_0x4d034a[_0x7fa1('0x37')][_0x7fa1('0x39')]?_0x4d034a[_0x7fa1('0x37')]:_0x12d7d3['model'];_0x4d034a[_0x7fa1('0x3c')]=qs[_0x7fa1('0x3d')](_0x511ab0[_0x7fa1('0x33')][_0x7fa1('0x3d')]);_0x4d034a[_0x7fa1('0x40')]=qs['filters'](_[_0x7fa1('0x3e')](_0x511ab0['query'],_0x12d7d3[_0x7fa1('0x35')]));if(_0x511ab0['query'][_0x7fa1('0x3f')]){_0x4d034a[_0x7fa1('0x40')]=_[_0x7fa1('0x41')](_0x4d034a[_0x7fa1('0x40')],{'$or':_[_0x7fa1('0x32')](_0x4d034a[_0x7fa1('0x37')],function(_0x345d57){var _0x18387e={};_0x18387e[_0x345d57]={'$like':'%'+_0x511ab0['query']['filter']+'%'};return _0x18387e;})});}_0x4d034a=_[_0x7fa1('0x41')]({},_0x4d034a,_0x511ab0[_0x7fa1('0x42')]);return _0x4b6e4a[_0x7fa1('0x57')](_0x4d034a);}})['then'](function(_0x4208f0){if(_0x4208f0){_0x23e8af=_0x4208f0[_0x7fa1('0x39')];if(!_0x511ab0[_0x7fa1('0x33')][_0x7fa1('0x3a')](_0x7fa1('0x3b'))){_0x4d034a['limit']=qs[_0x7fa1('0x24')](_0x511ab0['query'][_0x7fa1('0x24')]);_0x4d034a['offset']=qs[_0x7fa1('0x22')](_0x511ab0[_0x7fa1('0x33')][_0x7fa1('0x22')]);}return _0x4b6e4a['getMembers'](_0x4d034a);}})[_0x7fa1('0x29')](function(_0x3f6a38){if(_0x3f6a38){return _0x3f6a38?{'count':_0x23e8af,'rows':_0x3f6a38}:null;}})['then'](respondWithResult(_0xe57909,null))['catch'](handleError(_0xe57909,null));};exports[_0x7fa1('0x58')]=function(_0x555b77,_0x432156,_0x3cef51){return db[_0x7fa1('0x43')][_0x7fa1('0x4a')]({'where':{'id':_0x555b77[_0x7fa1('0x49')]['id']}})['then'](handleEntityNotFound(_0x432156,null))['then'](function(_0x2ad6e5){if(_0x2ad6e5){return _0x2ad6e5[_0x7fa1('0x58')](_0x555b77[_0x7fa1('0x33')][_0x7fa1('0x54')]);}})[_0x7fa1('0x29')](respondWithStatusCode(_0x432156,null))[_0x7fa1('0x4b')](handleError(_0x432156,null));};exports[_0x7fa1('0x59')]=function(_0x4da86a,_0x5780ba,_0x31f844){if(_0x4da86a[_0x7fa1('0x4d')]['id']){delete _0x4da86a[_0x7fa1('0x4d')]['id'];}return db['ChatGroup'][_0x7fa1('0x4a')]({'where':{'id':_0x4da86a[_0x7fa1('0x49')]['id']}})[_0x7fa1('0x29')](handleEntityNotFound(_0x5780ba,null))[_0x7fa1('0x29')](function(_0x3de971){if(_0x3de971){_0x4da86a[_0x7fa1('0x4d')][_0x7fa1('0x5a')]=_0x3de971['id'];return db[_0x7fa1('0x51')]['create'](_0x4da86a['body']);}})[_0x7fa1('0x29')](respondWithResult(_0x5780ba,null))[_0x7fa1('0x4b')](handleError(_0x5780ba,null));};exports[_0x7fa1('0x5b')]=function(_0x472ddf,_0x13715d,_0x5d0112){var _0x385286={};var _0x8f5fe2={};var _0x10f804;var _0x387c74;return db[_0x7fa1('0x43')][_0x7fa1('0x55')]({'where':{'id':_0x472ddf[_0x7fa1('0x49')]['id']}})[_0x7fa1('0x29')](handleEntityNotFound(_0x13715d,null))[_0x7fa1('0x29')](function(_0x546e7f){if(_0x546e7f){_0x10f804=_0x546e7f;_0x8f5fe2[_0x7fa1('0x31')]=_[_0x7fa1('0x34')](db[_0x7fa1('0x51')][_0x7fa1('0x2e')]);_0x8f5fe2[_0x7fa1('0x33')]=_['keys'](_0x472ddf[_0x7fa1('0x33')]);_0x8f5fe2[_0x7fa1('0x35')]=_[_0x7fa1('0x36')](_0x8f5fe2[_0x7fa1('0x31')],_0x8f5fe2[_0x7fa1('0x33')]);_0x385286[_0x7fa1('0x37')]=_[_0x7fa1('0x36')](_0x8f5fe2[_0x7fa1('0x31')],qs[_0x7fa1('0x38')](_0x472ddf[_0x7fa1('0x33')][_0x7fa1('0x38')]));_0x385286['attributes']=_0x385286['attributes'][_0x7fa1('0x39')]?_0x385286[_0x7fa1('0x37')]:_0x8f5fe2[_0x7fa1('0x31')];_0x385286[_0x7fa1('0x3c')]=qs[_0x7fa1('0x3d')](_0x472ddf['query'][_0x7fa1('0x3d')]);_0x385286[_0x7fa1('0x40')]=qs['filters'](_[_0x7fa1('0x3e')](_0x472ddf[_0x7fa1('0x33')],_0x8f5fe2[_0x7fa1('0x35')]));if(_0x472ddf['query'][_0x7fa1('0x3f')]){_0x385286['where']=_[_0x7fa1('0x41')](_0x385286[_0x7fa1('0x40')],{'$or':_['map'](_0x385286[_0x7fa1('0x37')],function(_0x59c830){var _0xbd8c90={};_0xbd8c90[_0x59c830]={'$like':'%'+_0x472ddf['query'][_0x7fa1('0x3f')]+'%'};return _0xbd8c90;})});}if(_0x472ddf['query'][_0x7fa1('0x5c')]){var _0x4b5f85=_0x472ddf[_0x7fa1('0x33')][_0x7fa1('0x5c')]['split'](',');var _0x495af4={};_0x495af4[_0x4b5f85[0x0]]={'$gte':moment(_0x4b5f85[0x1])[_0x7fa1('0x5d')](_0x7fa1('0x5e'))};_0x385286['where']=_['merge'](_0x385286[_0x7fa1('0x40')],_0x495af4);}_0x385286=_[_0x7fa1('0x41')]({},_0x385286,_0x472ddf[_0x7fa1('0x42')]);return _0x10f804[_0x7fa1('0x5b')](_0x385286);}})['then'](function(_0x3ef0d8){if(_0x3ef0d8){_0x387c74=_0x3ef0d8['length'];if(!_0x472ddf[_0x7fa1('0x33')][_0x7fa1('0x3a')](_0x7fa1('0x3b'))){_0x385286[_0x7fa1('0x24')]=qs[_0x7fa1('0x24')](_0x472ddf[_0x7fa1('0x33')][_0x7fa1('0x24')]);_0x385286[_0x7fa1('0x22')]=qs['offset'](_0x472ddf[_0x7fa1('0x33')][_0x7fa1('0x22')]);}return _0x10f804[_0x7fa1('0x5b')](_0x385286);}})[_0x7fa1('0x29')](function(_0x4c9731){if(_0x4c9731){return _0x4c9731?{'count':_0x387c74,'rows':_0x4c9731}:null;}})[_0x7fa1('0x29')](respondWithResult(_0x13715d,null))[_0x7fa1('0x4b')](handleError(_0x13715d,null));}; \ No newline at end of file +var _0x6262=['removeMembers','$gte','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','redis','localhost','socket.io-emitter','./chatGroup.socket','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','then','sendStatus','error','name','send','index','rawAttributes','key','model','map','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','ChatGroup','includeAll','findAll','catch','options','find','create','body','update','params','describe','ChatInternalMessage','user','toInteger','addMembers','omit','ids','getMembers','findOne','User','nolimit'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x6262,0x109));var _0x2626=function(_0xb6c6f1,_0x12fa19){_0xb6c6f1=_0xb6c6f1-0x0;var _0xb8552f=_0x6262[_0xb6c6f1];return _0xb8552f;};'use strict';var emlformat=require(_0x2626('0x0'));var rimraf=require(_0x2626('0x1'));var zipdir=require(_0x2626('0x2'));var jsonpatch=require(_0x2626('0x3'));var rp=require(_0x2626('0x4'));var moment=require(_0x2626('0x5'));var BPromise=require(_0x2626('0x6'));var Mustache=require(_0x2626('0x7'));var util=require('util');var path=require('path');var sox=require(_0x2626('0x8'));var csv=require(_0x2626('0x9'));var ejs=require(_0x2626('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2626('0xb'));var squel=require(_0x2626('0xc'));var crypto=require(_0x2626('0xd'));var jsforce=require(_0x2626('0xe'));var deskjs=require(_0x2626('0xf'));var toCsv=require(_0x2626('0x9'));var querystring=require('querystring');var Papa=require(_0x2626('0x10'));var Redis=require(_0x2626('0x11'));var authService=require(_0x2626('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x2626('0x13'));var hardwareService=require(_0x2626('0x14'));var logger=require('../../config/logger')(_0x2626('0x15'));var utils=require(_0x2626('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x2626('0x17'));var db=require('../../mysqldb')['db'];config[_0x2626('0x18')]=_['defaults'](config['redis'],{'host':_0x2626('0x19'),'port':0x18eb});var socket=require(_0x2626('0x1a'))(new Redis(config[_0x2626('0x18')]));require(_0x2626('0x1b'))['register'](socket);function respondWithStatusCode(_0x2e75a0,_0x546ead){_0x546ead=_0x546ead||0xcc;return function(_0x342793){if(_0x342793){return _0x2e75a0['sendStatus'](_0x546ead);}return _0x2e75a0[_0x2626('0x1c')](_0x546ead)[_0x2626('0x1d')]();};}function respondWithResult(_0x4288c5,_0x397794){_0x397794=_0x397794||0xc8;return function(_0x4cc6d0){if(_0x4cc6d0){return _0x4288c5[_0x2626('0x1c')](_0x397794)[_0x2626('0x1e')](_0x4cc6d0);}};}function respondWithFilteredResult(_0x4201a1,_0x2b3d9a){return function(_0x19f6db){if(_0x19f6db){var _0x1d9ee8=typeof _0x2b3d9a[_0x2626('0x1f')]===_0x2626('0x20')&&typeof _0x2b3d9a[_0x2626('0x21')]===_0x2626('0x20');var _0x420866=_0x19f6db[_0x2626('0x22')];var _0x1a133b=_0x1d9ee8?0x0:_0x2b3d9a['offset'];var _0x1c98e8=_0x1d9ee8?_0x19f6db[_0x2626('0x22')]:_0x2b3d9a[_0x2626('0x1f')]+_0x2b3d9a[_0x2626('0x21')];var _0x224278;if(_0x1c98e8>=_0x420866){_0x1c98e8=_0x420866;_0x224278=0xc8;}else{_0x224278=0xce;}_0x4201a1[_0x2626('0x1c')](_0x224278);return _0x4201a1[_0x2626('0x23')](_0x2626('0x24'),_0x1a133b+'-'+_0x1c98e8+'/'+_0x420866)[_0x2626('0x1e')](_0x19f6db);}return null;};}function patchUpdates(_0x126b5b){return function(_0x94b2a3){try{jsonpatch['apply'](_0x94b2a3,_0x126b5b,!![]);}catch(_0x4661e3){return BPromise[_0x2626('0x25')](_0x4661e3);}return _0x94b2a3['save']();};}function saveUpdates(_0x1232a1,_0x14a4a4){return function(_0x1ced81){if(_0x1ced81){return _0x1ced81['update'](_0x1232a1)[_0x2626('0x26')](function(_0x1a207b){return _0x1a207b;});}return null;};}function removeEntity(_0x458edb,_0x37a46d){return function(_0x3d5cad){if(_0x3d5cad){return _0x3d5cad['destroy']()[_0x2626('0x26')](function(){_0x458edb[_0x2626('0x1c')](0xcc)[_0x2626('0x1d')]();});}};}function handleEntityNotFound(_0xe499b4,_0x5f1b6a){return function(_0x52573d){if(!_0x52573d){_0xe499b4[_0x2626('0x27')](0x194);}return _0x52573d;};}function handleError(_0x3a2fa1,_0x146f66){_0x146f66=_0x146f66||0x1f4;return function(_0x13ad53){logger[_0x2626('0x28')](_0x13ad53['stack']);if(_0x13ad53[_0x2626('0x29')]){delete _0x13ad53[_0x2626('0x29')];}_0x3a2fa1['status'](_0x146f66)[_0x2626('0x2a')](_0x13ad53);};}exports[_0x2626('0x2b')]=function(_0x32468d,_0x38e6c9){var _0x4bfce7={},_0x398cff={},_0x2441d4={'count':0x0,'rows':[]};var _0x1e005e=_['map'](db['ChatGroup'][_0x2626('0x2c')],function(_0x192864){return{'name':_0x192864['fieldName'],'type':_0x192864['type'][_0x2626('0x2d')]};});_0x398cff[_0x2626('0x2e')]=_[_0x2626('0x2f')](_0x1e005e,_0x2626('0x29'));_0x398cff['query']=_[_0x2626('0x30')](_0x32468d[_0x2626('0x31')]);_0x398cff[_0x2626('0x32')]=_['intersection'](_0x398cff[_0x2626('0x2e')],_0x398cff[_0x2626('0x31')]);_0x4bfce7[_0x2626('0x33')]=_[_0x2626('0x34')](_0x398cff[_0x2626('0x2e')],qs[_0x2626('0x35')](_0x32468d['query'][_0x2626('0x35')]));_0x4bfce7[_0x2626('0x33')]=_0x4bfce7['attributes'][_0x2626('0x36')]?_0x4bfce7[_0x2626('0x33')]:_0x398cff[_0x2626('0x2e')];if(!_0x32468d[_0x2626('0x31')][_0x2626('0x37')]('nolimit')){_0x4bfce7[_0x2626('0x21')]=qs[_0x2626('0x21')](_0x32468d[_0x2626('0x31')][_0x2626('0x21')]);_0x4bfce7[_0x2626('0x1f')]=qs['offset'](_0x32468d[_0x2626('0x31')][_0x2626('0x1f')]);}_0x4bfce7[_0x2626('0x38')]=qs[_0x2626('0x39')](_0x32468d['query'][_0x2626('0x39')]);_0x4bfce7[_0x2626('0x3a')]=qs[_0x2626('0x32')](_['pick'](_0x32468d['query'],_0x398cff['filters']),_0x1e005e);if(_0x32468d[_0x2626('0x31')]['filter']){_0x4bfce7[_0x2626('0x3a')]=_[_0x2626('0x3b')](_0x4bfce7[_0x2626('0x3a')],{'$or':_['map'](_0x1e005e,function(_0x30c02e){if(_0x30c02e['type']!==_0x2626('0x3c')){var _0x9ab90e={};_0x9ab90e[_0x30c02e['name']]={'$like':'%'+_0x32468d[_0x2626('0x31')][_0x2626('0x3d')]+'%'};return _0x9ab90e;}})});}_0x4bfce7=_['merge']({},_0x4bfce7,_0x32468d['options']);var _0x235164={'where':_0x4bfce7['where']};return db[_0x2626('0x3e')][_0x2626('0x22')](_0x235164)[_0x2626('0x26')](function(_0x31b58e){_0x2441d4[_0x2626('0x22')]=_0x31b58e;if(_0x32468d['query'][_0x2626('0x3f')]){_0x4bfce7['include']=[{'all':!![]}];}return db[_0x2626('0x3e')][_0x2626('0x40')](_0x4bfce7);})[_0x2626('0x26')](function(_0x134699){_0x2441d4['rows']=_0x134699;return _0x2441d4;})[_0x2626('0x26')](respondWithFilteredResult(_0x38e6c9,_0x4bfce7))[_0x2626('0x41')](handleError(_0x38e6c9,null));};exports['show']=function(_0x5696d6,_0x41fe1f){var _0x1879a7={'raw':!![],'where':{'id':_0x5696d6['params']['id']}},_0x2e8f3d={};_0x2e8f3d[_0x2626('0x2e')]=_[_0x2626('0x30')](db['ChatGroup'][_0x2626('0x2c')]);_0x2e8f3d[_0x2626('0x31')]=_[_0x2626('0x30')](_0x5696d6['query']);_0x2e8f3d[_0x2626('0x32')]=_[_0x2626('0x34')](_0x2e8f3d[_0x2626('0x2e')],_0x2e8f3d['query']);_0x1879a7[_0x2626('0x33')]=_['intersection'](_0x2e8f3d[_0x2626('0x2e')],qs['fields'](_0x5696d6[_0x2626('0x31')][_0x2626('0x35')]));_0x1879a7[_0x2626('0x33')]=_0x1879a7[_0x2626('0x33')]['length']?_0x1879a7[_0x2626('0x33')]:_0x2e8f3d[_0x2626('0x2e')];if(_0x5696d6['query'][_0x2626('0x3f')]){_0x1879a7['include']=[{'all':!![]}];}_0x1879a7=_[_0x2626('0x3b')]({},_0x1879a7,_0x5696d6[_0x2626('0x42')]);return db[_0x2626('0x3e')][_0x2626('0x43')](_0x1879a7)[_0x2626('0x26')](handleEntityNotFound(_0x41fe1f,null))[_0x2626('0x26')](respondWithResult(_0x41fe1f,null))[_0x2626('0x41')](handleError(_0x41fe1f,null));};exports[_0x2626('0x44')]=function(_0x1b88d5,_0x1c7ec8){return db[_0x2626('0x3e')][_0x2626('0x44')](_0x1b88d5[_0x2626('0x45')],{})[_0x2626('0x26')](respondWithResult(_0x1c7ec8,0xc9))[_0x2626('0x41')](handleError(_0x1c7ec8,null));};exports[_0x2626('0x46')]=function(_0x23b4f2,_0x4bc160){if(_0x23b4f2[_0x2626('0x45')]['id']){delete _0x23b4f2[_0x2626('0x45')]['id'];}return db[_0x2626('0x3e')][_0x2626('0x43')]({'where':{'id':_0x23b4f2[_0x2626('0x47')]['id']}})['then'](handleEntityNotFound(_0x4bc160,null))[_0x2626('0x26')](saveUpdates(_0x23b4f2[_0x2626('0x45')],null))[_0x2626('0x26')](respondWithResult(_0x4bc160,null))['catch'](handleError(_0x4bc160,null));};exports['destroy']=function(_0x595a58,_0x5d2307){return db[_0x2626('0x3e')][_0x2626('0x43')]({'where':{'id':_0x595a58[_0x2626('0x47')]['id']}})[_0x2626('0x26')](handleEntityNotFound(_0x5d2307,null))['then'](removeEntity(_0x5d2307,null))[_0x2626('0x41')](handleError(_0x5d2307,null));};exports[_0x2626('0x48')]=function(_0x59ad5c,_0x560a8e){return db[_0x2626('0x3e')][_0x2626('0x48')]()[_0x2626('0x26')](respondWithResult(_0x560a8e,null))[_0x2626('0x41')](handleError(_0x560a8e,null));};exports['getUnread']=function(_0x3c65ed,_0x5549be,_0x5a6b2d){return db[_0x2626('0x49')][_0x2626('0x22')]({'where':{'ChatGroupId':_0x3c65ed[_0x2626('0x47')]['id'],'ToId':_0x3c65ed[_0x2626('0x4a')]['id'],'read':![]}})[_0x2626('0x26')](function(_0xbd5ca4){return{'id':_[_0x2626('0x4b')](_0x3c65ed['params']['id']),'count':_0xbd5ca4};})['then'](respondWithResult(_0x5549be,null))[_0x2626('0x41')](handleError(_0x5549be,null));};exports[_0x2626('0x4c')]=function(_0x3b3a4b,_0x1fe8eb,_0x3c78d4){return db[_0x2626('0x3e')][_0x2626('0x43')]({'where':{'id':_0x3b3a4b[_0x2626('0x47')]['id']}})[_0x2626('0x26')](handleEntityNotFound(_0x1fe8eb,null))['then'](function(_0x231c46){if(_0x231c46){return _0x231c46[_0x2626('0x4c')](_0x3b3a4b[_0x2626('0x45')]['ids'],_[_0x2626('0x4d')](_0x3b3a4b[_0x2626('0x45')],[_0x2626('0x4e'),'id'])||{});}})['then'](respondWithResult(_0x1fe8eb,null))['catch'](handleError(_0x1fe8eb,null));};exports[_0x2626('0x4f')]=function(_0x3fba3b,_0x228f0a,_0x415d3d){var _0x129666={};var _0x50794b={};var _0x51b22c;var _0x1c9070;return db[_0x2626('0x3e')][_0x2626('0x50')]({'where':{'id':_0x3fba3b[_0x2626('0x47')]['id']}})['then'](handleEntityNotFound(_0x228f0a,null))['then'](function(_0x427d1b){if(_0x427d1b){_0x51b22c=_0x427d1b;_0x50794b[_0x2626('0x2e')]=_['keys'](db[_0x2626('0x51')]['rawAttributes']);_0x50794b['query']=_[_0x2626('0x30')](_0x3fba3b[_0x2626('0x31')]);_0x50794b['filters']=_[_0x2626('0x34')](_0x50794b[_0x2626('0x2e')],_0x50794b[_0x2626('0x31')]);_0x129666['attributes']=_[_0x2626('0x34')](_0x50794b[_0x2626('0x2e')],qs[_0x2626('0x35')](_0x3fba3b[_0x2626('0x31')]['fields']));_0x129666[_0x2626('0x33')]=_0x129666[_0x2626('0x33')][_0x2626('0x36')]?_0x129666[_0x2626('0x33')]:_0x50794b[_0x2626('0x2e')];_0x129666[_0x2626('0x38')]=qs['sort'](_0x3fba3b[_0x2626('0x31')][_0x2626('0x39')]);_0x129666[_0x2626('0x3a')]=qs[_0x2626('0x32')](_['pick'](_0x3fba3b[_0x2626('0x31')],_0x50794b[_0x2626('0x32')]));if(_0x3fba3b[_0x2626('0x31')]['filter']){_0x129666[_0x2626('0x3a')]=_[_0x2626('0x3b')](_0x129666[_0x2626('0x3a')],{'$or':_[_0x2626('0x2f')](_0x129666['attributes'],function(_0x132c3b){var _0x702815={};_0x702815[_0x132c3b]={'$like':'%'+_0x3fba3b[_0x2626('0x31')][_0x2626('0x3d')]+'%'};return _0x702815;})});}_0x129666=_['merge']({},_0x129666,_0x3fba3b[_0x2626('0x42')]);return _0x51b22c['getMembers'](_0x129666);}})[_0x2626('0x26')](function(_0x458c37){if(_0x458c37){_0x1c9070=_0x458c37[_0x2626('0x36')];if(!_0x3fba3b[_0x2626('0x31')][_0x2626('0x37')](_0x2626('0x52'))){_0x129666[_0x2626('0x21')]=qs['limit'](_0x3fba3b['query']['limit']);_0x129666['offset']=qs['offset'](_0x3fba3b[_0x2626('0x31')]['offset']);}return _0x51b22c[_0x2626('0x4f')](_0x129666);}})[_0x2626('0x26')](function(_0x5d01ae){if(_0x5d01ae){return _0x5d01ae?{'count':_0x1c9070,'rows':_0x5d01ae}:null;}})[_0x2626('0x26')](respondWithResult(_0x228f0a,null))['catch'](handleError(_0x228f0a,null));};exports[_0x2626('0x53')]=function(_0x30b489,_0x3be935,_0x1e4735){return db[_0x2626('0x3e')]['find']({'where':{'id':_0x30b489['params']['id']}})[_0x2626('0x26')](handleEntityNotFound(_0x3be935,null))['then'](function(_0x296812){if(_0x296812){return _0x296812[_0x2626('0x53')](_0x30b489['query'][_0x2626('0x4e')]);}})[_0x2626('0x26')](respondWithStatusCode(_0x3be935,null))[_0x2626('0x41')](handleError(_0x3be935,null));};exports['addMessage']=function(_0x675075,_0x24d1c1,_0x4a2ea7){if(_0x675075['body']['id']){delete _0x675075['body']['id'];}return db['ChatGroup'][_0x2626('0x43')]({'where':{'id':_0x675075[_0x2626('0x47')]['id']}})[_0x2626('0x26')](handleEntityNotFound(_0x24d1c1,null))['then'](function(_0x599167){if(_0x599167){_0x675075['body']['ChatGroupId']=_0x599167['id'];return db[_0x2626('0x49')]['create'](_0x675075['body']);}})[_0x2626('0x26')](respondWithResult(_0x24d1c1,null))[_0x2626('0x41')](handleError(_0x24d1c1,null));};exports['getMessages']=function(_0x27dee2,_0x4c7cf8,_0x68066){var _0x6faedd={};var _0xa56770={};var _0x2dea1e;var _0x57726e;return db[_0x2626('0x3e')][_0x2626('0x50')]({'where':{'id':_0x27dee2['params']['id']}})['then'](handleEntityNotFound(_0x4c7cf8,null))['then'](function(_0x490f77){if(_0x490f77){_0x2dea1e=_0x490f77;_0xa56770[_0x2626('0x2e')]=_[_0x2626('0x30')](db[_0x2626('0x49')][_0x2626('0x2c')]);_0xa56770['query']=_[_0x2626('0x30')](_0x27dee2[_0x2626('0x31')]);_0xa56770[_0x2626('0x32')]=_[_0x2626('0x34')](_0xa56770['model'],_0xa56770[_0x2626('0x31')]);_0x6faedd[_0x2626('0x33')]=_[_0x2626('0x34')](_0xa56770[_0x2626('0x2e')],qs['fields'](_0x27dee2['query'][_0x2626('0x35')]));_0x6faedd[_0x2626('0x33')]=_0x6faedd[_0x2626('0x33')][_0x2626('0x36')]?_0x6faedd[_0x2626('0x33')]:_0xa56770[_0x2626('0x2e')];_0x6faedd[_0x2626('0x38')]=qs[_0x2626('0x39')](_0x27dee2[_0x2626('0x31')][_0x2626('0x39')]);_0x6faedd['where']=qs[_0x2626('0x32')](_['pick'](_0x27dee2[_0x2626('0x31')],_0xa56770[_0x2626('0x32')]));if(_0x27dee2['query'][_0x2626('0x3d')]){_0x6faedd[_0x2626('0x3a')]=_[_0x2626('0x3b')](_0x6faedd[_0x2626('0x3a')],{'$or':_[_0x2626('0x2f')](_0x6faedd['attributes'],function(_0x4128f1){var _0x589abc={};_0x589abc[_0x4128f1]={'$like':'%'+_0x27dee2[_0x2626('0x31')][_0x2626('0x3d')]+'%'};return _0x589abc;})});}if(_0x27dee2[_0x2626('0x31')][_0x2626('0x54')]){var _0x19d95e=_0x27dee2[_0x2626('0x31')][_0x2626('0x54')]['split'](',');var _0x45d974={};_0x45d974[_0x19d95e[0x0]]={'$gte':moment(_0x19d95e[0x1])['format'](_0x2626('0x55'))};_0x6faedd[_0x2626('0x3a')]=_[_0x2626('0x3b')](_0x6faedd[_0x2626('0x3a')],_0x45d974);}_0x6faedd=_[_0x2626('0x3b')]({},_0x6faedd,_0x27dee2[_0x2626('0x42')]);return _0x2dea1e[_0x2626('0x56')](_0x6faedd);}})[_0x2626('0x26')](function(_0x296224){if(_0x296224){_0x57726e=_0x296224[_0x2626('0x36')];if(!_0x27dee2[_0x2626('0x31')][_0x2626('0x37')](_0x2626('0x52'))){_0x6faedd[_0x2626('0x21')]=qs[_0x2626('0x21')](_0x27dee2['query'][_0x2626('0x21')]);_0x6faedd[_0x2626('0x1f')]=qs[_0x2626('0x1f')](_0x27dee2[_0x2626('0x31')][_0x2626('0x1f')]);}return _0x2dea1e[_0x2626('0x56')](_0x6faedd);}})[_0x2626('0x26')](function(_0x55f25d){if(_0x55f25d){return _0x55f25d?{'count':_0x57726e,'rows':_0x55f25d}:null;}})[_0x2626('0x26')](respondWithResult(_0x4c7cf8,null))['catch'](handleError(_0x4c7cf8,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 9ea4273..8743b0c 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 _0x4a6d=['hook','exports','../../mysqldb','save','update','remove','hasOwnProperty'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x4a6d,0x121));var _0xd4a6=function(_0x4125d3,_0x429075){_0x4125d3=_0x4125d3-0x0;var _0x40a5eb=_0x4a6d[_0x4125d3];return _0x40a5eb;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0xd4a6('0x0'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd4a6('0x1'),'afterUpdate':_0xd4a6('0x2'),'afterDestroy':_0xd4a6('0x3')};function emitEvent(_0x9cfdf){return function(_0x49994a,_0x13fd34,_0x4ec60f){ChatGroupEvents['emit'](_0x9cfdf+':'+_0x49994a['id'],_0x49994a);ChatGroupEvents['emit'](_0x9cfdf,_0x49994a);_0x4ec60f(null);};}for(var e in events){if(events[_0xd4a6('0x4')](e)){var event=events[e];ChatGroup[_0xd4a6('0x5')](e,emitEvent(event));}}module[_0xd4a6('0x6')]=ChatGroupEvents; \ No newline at end of file +var _0xbdb5=['events','../../mysqldb','ChatGroup','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xbdb5,0x122));var _0x5bdb=function(_0xc41528,_0x4949ec){_0xc41528=_0xc41528-0x0;var _0x5b7b2a=_0xbdb5[_0xc41528];return _0x5b7b2a;};'use strict';var EventEmitter=require(_0x5bdb('0x0'));var ChatGroup=require(_0x5bdb('0x1'))['db'][_0x5bdb('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x5bdb('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5bdb('0x4'),'afterDestroy':_0x5bdb('0x5')};function emitEvent(_0x492ca4){return function(_0x40e51d,_0x32b733,_0x54beb8){ChatGroupEvents[_0x5bdb('0x6')](_0x492ca4+':'+_0x40e51d['id'],_0x40e51d);ChatGroupEvents[_0x5bdb('0x6')](_0x492ca4,_0x40e51d);_0x54beb8(null);};}for(var e in events){if(events[_0x5bdb('0x7')](e)){var event=events[e];ChatGroup[_0x5bdb('0x8')](e,emitEvent(event));}}module[_0x5bdb('0x9')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 99634fe..ad86f43 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 _0x3aa6=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','lodash','util','../../config/logger','api'];(function(_0x1a0620,_0x4f40c3){var _0x475abc=function(_0x276d92){while(--_0x276d92){_0x1a0620['push'](_0x1a0620['shift']());}};_0x475abc(++_0x4f40c3);}(_0x3aa6,0xec));var _0x63aa=function(_0x504df1,_0x289598){_0x504df1=_0x504df1-0x0;var _0x1063b5=_0x3aa6[_0x504df1];return _0x1063b5;};'use strict';var _=require(_0x63aa('0x0'));var util=require(_0x63aa('0x1'));var logger=require(_0x63aa('0x2'))(_0x63aa('0x3'));var moment=require(_0x63aa('0x4'));var BPromise=require(_0x63aa('0x5'));var rp=require(_0x63aa('0x6'));var fs=require('fs');var path=require(_0x63aa('0x7'));var rimraf=require(_0x63aa('0x8'));var config=require(_0x63aa('0x9'));var attributes=require('./chatGroup.attributes');module[_0x63aa('0xa')]=function(_0x4132d0,_0x476d2f){return _0x4132d0[_0x63aa('0xb')]('ChatGroup',attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0ad2=['bluebird','path','rimraf','../../config/environment','./chatGroup.attributes','exports','ChatGroup','chat_groups','lodash','api','moment'];(function(_0x199570,_0x1b0fc4){var _0x23169b=function(_0x37d6e6){while(--_0x37d6e6){_0x199570['push'](_0x199570['shift']());}};_0x23169b(++_0x1b0fc4);}(_0x0ad2,0xfa));var _0x20ad=function(_0x4dd2b1,_0x56fb2d){_0x4dd2b1=_0x4dd2b1-0x0;var _0x5102d6=_0x0ad2[_0x4dd2b1];return _0x5102d6;};'use strict';var _=require(_0x20ad('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x20ad('0x1'));var moment=require(_0x20ad('0x2'));var BPromise=require(_0x20ad('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x20ad('0x4'));var rimraf=require(_0x20ad('0x5'));var config=require(_0x20ad('0x6'));var attributes=require(_0x20ad('0x7'));module[_0x20ad('0x8')]=function(_0x19b969,_0x2446aa){return _0x19b969['define'](_0x20ad('0x9'),attributes,{'tableName':_0x20ad('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index 28a063e..e9365d9 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 _0x4989=['../../mysqldb','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis'];(function(_0x3e18bf,_0x387f5e){var _0x1022e5=function(_0x242ec4){while(--_0x242ec4){_0x3e18bf['push'](_0x3e18bf['shift']());}};_0x1022e5(++_0x387f5e);}(_0x4989,0x79));var _0x9498=function(_0x59eefb,_0x2151ce){_0x59eefb=_0x59eefb-0x0;var _0x1a49e8=_0x4989[_0x59eefb];return _0x1a49e8;};'use strict';var _=require(_0x9498('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9498('0x1'));var rs=require(_0x9498('0x2'));var fs=require('fs');var Redis=require(_0x9498('0x3'));var db=require(_0x9498('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9498('0x5'));var config=require('../../config/environment');var jayson=require(_0x9498('0x6'));var client=jayson[_0x9498('0x7')]['http']({'port':0x232a});config[_0x9498('0x8')]=_[_0x9498('0x9')](config[_0x9498('0x8')],{'host':_0x9498('0xa'),'port':0x18eb});var socket=require(_0x9498('0xb'))(new Redis(config[_0x9498('0x8')]));require(_0x9498('0xc'))[_0x9498('0xd')](socket);function respondWithRpcPromise(_0x2cd88f,_0x212a2d,_0x1e7440){return new BPromise(function(_0x5ce9bf,_0x1926af){return client[_0x9498('0xe')](_0x2cd88f,_0x1e7440)[_0x9498('0xf')](function(_0x51f0b1){logger[_0x9498('0x10')](_0x9498('0x11'),_0x212a2d,'request\x20sent');logger['debug']('ChatGroup,\x20%s,\x20%s,\x20%s',_0x212a2d,_0x9498('0x12'),JSON[_0x9498('0x13')](_0x51f0b1));if(_0x51f0b1[_0x9498('0x14')]){if(_0x51f0b1[_0x9498('0x14')][_0x9498('0x15')]===0x1f4){logger[_0x9498('0x14')]('ChatGroup,\x20%s,\x20%s',_0x212a2d,_0x51f0b1[_0x9498('0x14')][_0x9498('0x16')]);return _0x1926af(_0x51f0b1[_0x9498('0x14')][_0x9498('0x16')]);}logger[_0x9498('0x14')](_0x9498('0x11'),_0x212a2d,_0x51f0b1[_0x9498('0x14')][_0x9498('0x16')]);return _0x5ce9bf(_0x51f0b1[_0x9498('0x14')][_0x9498('0x16')]);}else{logger[_0x9498('0x10')](_0x9498('0x11'),_0x212a2d,_0x9498('0x12'));_0x5ce9bf(_0x51f0b1[_0x9498('0x17')][_0x9498('0x16')]);}})[_0x9498('0x18')](function(_0x5d775d){logger[_0x9498('0x14')](_0x9498('0x11'),_0x212a2d,_0x5d775d);_0x1926af(_0x5d775d);});});} \ No newline at end of file +var _0x535d=['ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','socket.io-emitter','./chatGroup.socket','register','request','then','info'];(function(_0x30857f,_0x1407c8){var _0x30d99e=function(_0x14b2c4){while(--_0x14b2c4){_0x30857f['push'](_0x30857f['shift']());}};_0x30d99e(++_0x1407c8);}(_0x535d,0xe8));var _0xd535=function(_0x4d4c68,_0x5a1f19){_0x4d4c68=_0x4d4c68-0x0;var _0x562b8a=_0x535d[_0x4d4c68];return _0x562b8a;};'use strict';var _=require(_0xd535('0x0'));var util=require(_0xd535('0x1'));var moment=require('moment');var BPromise=require(_0xd535('0x2'));var rs=require(_0xd535('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd535('0x4'));var logger=require(_0xd535('0x5'))(_0xd535('0x6'));var config=require(_0xd535('0x7'));var jayson=require(_0xd535('0x8'));var client=jayson[_0xd535('0x9')]['http']({'port':0x232a});config['redis']=_[_0xd535('0xa')](config[_0xd535('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xd535('0xc'))(new Redis(config['redis']));require(_0xd535('0xd'))[_0xd535('0xe')](socket);function respondWithRpcPromise(_0x39792b,_0x3a6841,_0x4a296c){return new BPromise(function(_0x3f34c4,_0x38b299){return client[_0xd535('0xf')](_0x39792b,_0x4a296c)[_0xd535('0x10')](function(_0x4c0692){logger[_0xd535('0x11')](_0xd535('0x12'),_0x3a6841,_0xd535('0x13'));logger[_0xd535('0x14')](_0xd535('0x15'),_0x3a6841,_0xd535('0x13'),JSON[_0xd535('0x16')](_0x4c0692));if(_0x4c0692['error']){if(_0x4c0692[_0xd535('0x17')]['code']===0x1f4){logger['error'](_0xd535('0x12'),_0x3a6841,_0x4c0692[_0xd535('0x17')]['message']);return _0x38b299(_0x4c0692[_0xd535('0x17')][_0xd535('0x18')]);}logger[_0xd535('0x17')](_0xd535('0x12'),_0x3a6841,_0x4c0692['error'][_0xd535('0x18')]);return _0x3f34c4(_0x4c0692[_0xd535('0x17')][_0xd535('0x18')]);}else{logger[_0xd535('0x11')]('ChatGroup,\x20%s,\x20%s',_0x3a6841,_0xd535('0x13'));_0x3f34c4(_0x4c0692['result'][_0xd535('0x18')]);}})['catch'](function(_0x34dc17){logger['error'](_0xd535('0x12'),_0x3a6841,_0x34dc17);_0x38b299(_0x34dc17);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 1d1f377..04b0008 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 _0xf468=['./chatGroup.events','save','remove','emit','removeListener','length','chatGroup:'];(function(_0x5dbaa9,_0xa1eb2f){var _0x52abe0=function(_0x4a540c){while(--_0x4a540c){_0x5dbaa9['push'](_0x5dbaa9['shift']());}};_0x52abe0(++_0xa1eb2f);}(_0xf468,0x85));var _0x8f46=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xf468[_0x4243a3];return _0x1b2a33;};'use strict';var ChatGroupEvents=require(_0x8f46('0x0'));var events=[_0x8f46('0x1'),_0x8f46('0x2'),'update'];function createListener(_0x6b8bc1,_0x2317d3){return function(_0xed69fe){_0x2317d3[_0x8f46('0x3')](_0x6b8bc1,_0xed69fe);};}function removeListener(_0x574434,_0x2ee5f2){return function(){ChatGroupEvents[_0x8f46('0x4')](_0x574434,_0x2ee5f2);};}exports['register']=function(_0x18533c){for(var _0x378ed8=0x0,_0x580904=events[_0x8f46('0x5')];_0x378ed8<_0x580904;_0x378ed8++){var _0x4e6064=events[_0x378ed8];var _0x56c79b=createListener(_0x8f46('0x6')+_0x4e6064,_0x18533c);ChatGroupEvents['on'](_0x4e6064,_0x56c79b);}}; \ No newline at end of file +var _0xed6a=['./chatGroup.events','save','remove','update','removeListener','register','chatGroup:'];(function(_0x3c0bf8,_0x42dc2b){var _0x2aeec9=function(_0x1582ff){while(--_0x1582ff){_0x3c0bf8['push'](_0x3c0bf8['shift']());}};_0x2aeec9(++_0x42dc2b);}(_0xed6a,0x18f));var _0xaed6=function(_0x2048ee,_0x31859c){_0x2048ee=_0x2048ee-0x0;var _0x469cc7=_0xed6a[_0x2048ee];return _0x469cc7;};'use strict';var ChatGroupEvents=require(_0xaed6('0x0'));var events=[_0xaed6('0x1'),_0xaed6('0x2'),_0xaed6('0x3')];function createListener(_0x5dc474,_0x5b6487){return function(_0x218a24){_0x5b6487['emit'](_0x5dc474,_0x218a24);};}function removeListener(_0x28abdc,_0x22d1dd){return function(){ChatGroupEvents[_0xaed6('0x4')](_0x28abdc,_0x22d1dd);};}exports[_0xaed6('0x5')]=function(_0x3b1dc3){for(var _0x2f6924=0x0,_0x3a8836=events['length'];_0x2f6924<_0x3a8836;_0x2f6924++){var _0x147a0c=events[_0x2f6924];var _0x57d77f=createListener(_0xaed6('0x6')+_0x147a0c,_0x3b1dc3);ChatGroupEvents['on'](_0x147a0c,_0x57d77f);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 306d309..303f26c 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 _0x1833=['/:id/messages','getMessages','post','create','addMembers','addMessage','update','delete','removeMembers','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','describe','/:id','/:id/unread','getUnread','/:id/members'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x1833,0x1ef));var _0x3183=function(_0x445c98,_0x132bf7){_0x445c98=_0x445c98-0x0;var _0x2fe913=_0x1833[_0x445c98];return _0x2fe913;};'use strict';var multer=require(_0x3183('0x0'));var util=require(_0x3183('0x1'));var path=require(_0x3183('0x2'));var timeout=require(_0x3183('0x3'));var express=require(_0x3183('0x4'));var router=express[_0x3183('0x5')]();var fs_extra=require(_0x3183('0x6'));var auth=require(_0x3183('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x3183('0x8'));var controller=require(_0x3183('0x9'));router[_0x3183('0xa')]('/',auth[_0x3183('0xb')](),controller[_0x3183('0xc')]);router[_0x3183('0xa')]('/describe',auth[_0x3183('0xb')](),controller[_0x3183('0xd')]);router['get'](_0x3183('0xe'),auth[_0x3183('0xb')](),controller['show']);router[_0x3183('0xa')](_0x3183('0xf'),auth['isAuthenticated'](),controller[_0x3183('0x10')]);router[_0x3183('0xa')](_0x3183('0x11'),auth[_0x3183('0xb')](),controller['getMembers']);router[_0x3183('0xa')](_0x3183('0x12'),auth['isAuthenticated'](),controller[_0x3183('0x13')]);router[_0x3183('0x14')]('/',auth['isAuthenticated'](),controller[_0x3183('0x15')]);router[_0x3183('0x14')](_0x3183('0x11'),auth['isAuthenticated'](),controller[_0x3183('0x16')]);router[_0x3183('0x14')]('/:id/messages',auth[_0x3183('0xb')](),controller[_0x3183('0x17')]);router['put'](_0x3183('0xe'),auth['isAuthenticated'](),controller[_0x3183('0x18')]);router[_0x3183('0x19')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x3183('0x19')]('/:id/members',auth[_0x3183('0xb')](),controller[_0x3183('0x1a')]);module['exports']=router; \ No newline at end of file +var _0xd7c5=['post','create','addMembers','addMessage','put','update','delete','destroy','removeMembers','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./chatGroup.controller','get','/describe','isAuthenticated','describe','/:id','show','getUnread','/:id/members','getMembers','/:id/messages','getMessages'];(function(_0x161480,_0x34a24c){var _0x51e88d=function(_0x4a1d98){while(--_0x4a1d98){_0x161480['push'](_0x161480['shift']());}};_0x51e88d(++_0x34a24c);}(_0xd7c5,0x13d));var _0x5d7c=function(_0x36b2fe,_0x29ef4d){_0x36b2fe=_0x36b2fe-0x0;var _0x5941f=_0xd7c5[_0x36b2fe];return _0x5941f;};'use strict';var multer=require(_0x5d7c('0x0'));var util=require(_0x5d7c('0x1'));var path=require(_0x5d7c('0x2'));var timeout=require(_0x5d7c('0x3'));var express=require('express');var router=express[_0x5d7c('0x4')]();var fs_extra=require(_0x5d7c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x5d7c('0x6'));var config=require('../../config/environment');var controller=require(_0x5d7c('0x7'));router[_0x5d7c('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5d7c('0x8')](_0x5d7c('0x9'),auth[_0x5d7c('0xa')](),controller[_0x5d7c('0xb')]);router['get'](_0x5d7c('0xc'),auth[_0x5d7c('0xa')](),controller[_0x5d7c('0xd')]);router[_0x5d7c('0x8')]('/:id/unread',auth['isAuthenticated'](),controller[_0x5d7c('0xe')]);router[_0x5d7c('0x8')](_0x5d7c('0xf'),auth[_0x5d7c('0xa')](),controller[_0x5d7c('0x10')]);router['get'](_0x5d7c('0x11'),auth['isAuthenticated'](),controller[_0x5d7c('0x12')]);router[_0x5d7c('0x13')]('/',auth[_0x5d7c('0xa')](),controller[_0x5d7c('0x14')]);router['post'](_0x5d7c('0xf'),auth['isAuthenticated'](),controller[_0x5d7c('0x15')]);router['post'](_0x5d7c('0x11'),auth[_0x5d7c('0xa')](),controller[_0x5d7c('0x16')]);router[_0x5d7c('0x17')](_0x5d7c('0xc'),auth['isAuthenticated'](),controller[_0x5d7c('0x18')]);router[_0x5d7c('0x19')]('/:id',auth['isAuthenticated'](),controller[_0x5d7c('0x1a')]);router[_0x5d7c('0x19')](_0x5d7c('0xf'),auth[_0x5d7c('0xa')](),controller[_0x5d7c('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 5dc6128..c7281bf 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 _0xa902=['BOOLEAN','INTEGER','ENUM','thumb','TEXT','STRING','DATE','long','out','sequelize','exports'];(function(_0x228907,_0x514883){var _0x10d5b9=function(_0x2db453){while(--_0x2db453){_0x228907['push'](_0x228907['shift']());}};_0x10d5b9(++_0x514883);}(_0xa902,0x8d));var _0x2a90=function(_0x301566,_0x4a8dab){_0x301566=_0x301566-0x0;var _0x2c80fd=_0xa902[_0x301566];return _0x2c80fd;};'use strict';var Sequelize=require(_0x2a90('0x0'));module[_0x2a90('0x1')]={'closed':{'type':Sequelize[_0x2a90('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x2a90('0x3')]},'ratingType':{'type':Sequelize[_0x2a90('0x4')]('star',_0x2a90('0x5')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x2a90('0x6')]},'mailTranscript':{'type':Sequelize[_0x2a90('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x2a90('0x8')]},'disposition':{'type':Sequelize[_0x2a90('0x7')]},'secondDisposition':{'type':Sequelize[_0x2a90('0x7')]},'thirdDisposition':{'type':Sequelize[_0x2a90('0x7')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x2a90('0x7')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x2a90('0x7')]},'deviceModel':{'type':Sequelize[_0x2a90('0x7')]},'deviceVendor':{'type':Sequelize[_0x2a90('0x7')]},'deviceType':{'type':Sequelize[_0x2a90('0x7')]},'referer':{'type':Sequelize[_0x2a90('0x6')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x2a90('0x6')](_0x2a90('0x9'))},'read1stAt':{'type':Sequelize[_0x2a90('0x8')]},'lastMsgAt':{'type':Sequelize[_0x2a90('0x8')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x2a90('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x2a90('0x7')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x2a90('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x94d2=['out','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING','DATE','long'];(function(_0x239a5a,_0x70fa9){var _0x3c1c3e=function(_0x893923){while(--_0x893923){_0x239a5a['push'](_0x239a5a['shift']());}};_0x3c1c3e(++_0x70fa9);}(_0x94d2,0x1cd));var _0x294d=function(_0x305486,_0x24acd4){_0x305486=_0x305486-0x0;var _0xa04940=_0x94d2[_0x305486];return _0xa04940;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0x294d('0x0')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x294d('0x1')]},'ratingType':{'type':Sequelize[_0x294d('0x2')](_0x294d('0x3'),_0x294d('0x4')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x294d('0x5')]},'mailTranscript':{'type':Sequelize[_0x294d('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x294d('0x7')]},'disposition':{'type':Sequelize[_0x294d('0x6')]},'secondDisposition':{'type':Sequelize[_0x294d('0x6')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x294d('0x6')]},'browserVersion':{'type':Sequelize[_0x294d('0x6')]},'osName':{'type':Sequelize[_0x294d('0x6')]},'osVersion':{'type':Sequelize[_0x294d('0x6')]},'deviceModel':{'type':Sequelize[_0x294d('0x6')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x294d('0x6')]},'referer':{'type':Sequelize[_0x294d('0x5')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x294d('0x5')](_0x294d('0x8'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x294d('0x2')]('in',_0x294d('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x294d('0x6')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0x294d('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0x294d('0x0')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 099a08b..03f507a 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 _0x4fc2=['result','catch','sendStatus','end','status','json','offset','undefined','count','Content-Range','apply','reject','save','update','destroy','stack','name','send','render','merge','body','contact','agent','interaction','account','map','fullname','TagIds','Tags','split','forEach','push','ChatInteraction','rawAttributes','type','key','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','select','field','color','from','tools_tags','u.id','u.fullname','ui.ChatInteractionId','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','search','parseSearch','sqlOperator','conditions','find','unreadMessages','`\x20=\x200','having','Contact','operator','$substring','value','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','buildExpression','text','start','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','keys','some','compact','isEmpty','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','DESC','t.id\x20IN\x20?','ChatWebsiteId','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.mandatoryDisposition','Account.mandatoryDisposition','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','contactName','i.*','c.firstName','Contact.firstName','c.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','params','includeAll','options','create','describe','createVidaooSession','findOne','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','metadata','Sequelize','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','disposition','attachmentUpload','file','originalname','filename','mimetype','Attachment','Unauthorized','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','basename','download','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','pathTranscript','Messages','User','ChatWebsite','%s%d','agentAlias','System','customer','website_alias','alias','agent_fullname','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','pick','YYYY-MM-DD\x20HH:mm:ss','include','findAll','getMyMessages','includeAgent','addTags','setTags','spread','Tag','removeTags','unix','server','files','attachments','transcript-%d-%s.zip','firstName','lastName','direction','Account','Owner','mkdirSync','N.A.','closedAt','customerIp','customerPort','existsSync','createWriteStream','out','renderFile','downloadInteraction.ejs','transcript-','.pdf','Chat','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message'];(function(_0x58e6a8,_0x56e7e6){var _0x1b1c9a=function(_0x2ea4b4){while(--_0x2ea4b4){_0x58e6a8['push'](_0x58e6a8['shift']());}};_0x1b1c9a(++_0x56e7e6);}(_0x4fc2,0x111));var _0x24fc=function(_0x482372,_0x40f56b){_0x482372=_0x482372-0x0;var _0x55fbea=_0x4fc2[_0x482372];return _0x55fbea;};'use strict';var emlformat=require(_0x24fc('0x0'));var rimraf=require(_0x24fc('0x1'));var zipdir=require(_0x24fc('0x2'));var jsonpatch=require(_0x24fc('0x3'));var rp=require('request-promise');var moment=require(_0x24fc('0x4'));var BPromise=require(_0x24fc('0x5'));var Mustache=require(_0x24fc('0x6'));var util=require('util');var path=require(_0x24fc('0x7'));var sox=require(_0x24fc('0x8'));var csv=require('to-csv');var ejs=require(_0x24fc('0x9'));var fs=require('fs');var fs_extra=require(_0x24fc('0xa'));var _=require('lodash');var squel=require(_0x24fc('0xb'));var crypto=require(_0x24fc('0xc'));var jsforce=require(_0x24fc('0xd'));var deskjs=require(_0x24fc('0xe'));var toCsv=require(_0x24fc('0xf'));var querystring=require(_0x24fc('0x10'));var Papa=require('papaparse');var Redis=require(_0x24fc('0x11'));var authService=require(_0x24fc('0x12'));var qs=require(_0x24fc('0x13'));var as=require(_0x24fc('0x14'));var pdf=require(_0x24fc('0x15'));var hardwareService=require(_0x24fc('0x16'));var logger=require(_0x24fc('0x17'))(_0x24fc('0x18'));var utils=require('../../config/utils');var config=require(_0x24fc('0x19'));var licenseUtil=require(_0x24fc('0x1a'));var db=require('../../mysqldb')['db'];config[_0x24fc('0x1b')]=_[_0x24fc('0x1c')](config[_0x24fc('0x1b')],{'host':_0x24fc('0x1d'),'port':0x18eb});var socket=require(_0x24fc('0x1e'))(new Redis(config[_0x24fc('0x1b')]));require('./chatInteraction.socket')[_0x24fc('0x1f')](socket);var jayson=require(_0x24fc('0x20'));var client=jayson[_0x24fc('0x21')][_0x24fc('0x22')]({'port':0x232b});var client9004=jayson['client'][_0x24fc('0x22')]({'port':0x232c});function respondWithRpcPromise(_0x588543,_0x4af098,_0x3385c7,_0x218fb6){return new BPromise(function(_0x41c593,_0x25cb40){var _0x52a884=_0x218fb6||client;return _0x52a884[_0x24fc('0x23')](_0x588543,_0x3385c7)[_0x24fc('0x24')](function(_0x6cfa0a){logger[_0x24fc('0x25')]('ChatInteraction,\x20%s,\x20%s',_0x4af098,_0x24fc('0x26'));logger[_0x24fc('0x27')](_0x24fc('0x28'),_0x4af098,'request\x20sent',JSON[_0x24fc('0x29')](_0x6cfa0a));if(_0x6cfa0a[_0x24fc('0x2a')]){if(_0x6cfa0a[_0x24fc('0x2a')][_0x24fc('0x2b')]===0x1f4){logger['error'](_0x24fc('0x2c'),_0x4af098,_0x6cfa0a['error'][_0x24fc('0x2d')]);return _0x25cb40(_0x6cfa0a['error'][_0x24fc('0x2d')]);}logger[_0x24fc('0x2a')](_0x24fc('0x2c'),_0x4af098,_0x6cfa0a['error'][_0x24fc('0x2d')]);return _0x41c593(_0x6cfa0a['error'][_0x24fc('0x2d')]);}else{logger[_0x24fc('0x25')](_0x24fc('0x2c'),_0x4af098,_0x24fc('0x26'));_0x41c593(_0x6cfa0a[_0x24fc('0x2e')][_0x24fc('0x2d')]);}})[_0x24fc('0x2f')](function(_0x20192b){logger[_0x24fc('0x2a')](_0x24fc('0x2c'),_0x4af098,_0x20192b);_0x25cb40(_0x20192b);});});}function respondWithStatusCode(_0x568441,_0x11c913){_0x11c913=_0x11c913||0xcc;return function(_0x16f27f){if(_0x16f27f){return _0x568441[_0x24fc('0x30')](_0x11c913);}return _0x568441['status'](_0x11c913)[_0x24fc('0x31')]();};}function respondWithResult(_0x3d1ec8,_0x35f9f9){_0x35f9f9=_0x35f9f9||0xc8;return function(_0x290f84){if(_0x290f84){return _0x3d1ec8[_0x24fc('0x32')](_0x35f9f9)[_0x24fc('0x33')](_0x290f84);}};}function respondWithFilteredResult(_0x5ac1f2,_0x240ae7){return function(_0x29a461){if(_0x29a461){var _0x3c99ed=typeof _0x240ae7[_0x24fc('0x34')]===_0x24fc('0x35')&&typeof _0x240ae7['limit']==='undefined';var _0x4e6f73=_0x29a461[_0x24fc('0x36')];var _0x574ba3=_0x3c99ed?0x0:_0x240ae7[_0x24fc('0x34')];var _0x3e6389=_0x3c99ed?_0x29a461[_0x24fc('0x36')]:_0x240ae7[_0x24fc('0x34')]+_0x240ae7['limit'];var _0x66eec0;if(_0x3e6389>=_0x4e6f73){_0x3e6389=_0x4e6f73;_0x66eec0=0xc8;}else{_0x66eec0=0xce;}_0x5ac1f2[_0x24fc('0x32')](_0x66eec0);return _0x5ac1f2['set'](_0x24fc('0x37'),_0x574ba3+'-'+_0x3e6389+'/'+_0x4e6f73)[_0x24fc('0x33')](_0x29a461);}return null;};}function patchUpdates(_0x4d756f){return function(_0x48c62a){try{jsonpatch[_0x24fc('0x38')](_0x48c62a,_0x4d756f,!![]);}catch(_0x56eae7){return BPromise[_0x24fc('0x39')](_0x56eae7);}return _0x48c62a[_0x24fc('0x3a')]();};}function saveUpdates(_0x5491b0,_0x2ae896){return function(_0x33bbf2){if(_0x33bbf2){return _0x33bbf2[_0x24fc('0x3b')](_0x5491b0)[_0x24fc('0x24')](function(_0x1c5874){return _0x1c5874;});}return null;};}function removeEntity(_0x1e205d,_0x3b3932){return function(_0x2a209d){if(_0x2a209d){return _0x2a209d[_0x24fc('0x3c')]()['then'](function(){_0x1e205d[_0x24fc('0x32')](0xcc)[_0x24fc('0x31')]();});}};}function handleEntityNotFound(_0x2fbe30,_0x316aa2){return function(_0x242bd5){if(!_0x242bd5){_0x2fbe30['sendStatus'](0x194);}return _0x242bd5;};}function handleError(_0x56a9bd,_0xd52d10){_0xd52d10=_0xd52d10||0x1f4;return function(_0x5d48fe){logger[_0x24fc('0x2a')](_0x5d48fe[_0x24fc('0x3d')]);if(_0x5d48fe[_0x24fc('0x3e')]){delete _0x5d48fe[_0x24fc('0x3e')];}_0x56a9bd['status'](_0xd52d10)[_0x24fc('0x3f')](_0x5d48fe);};}function getMustacheRender(_0x4f4ec8,_0x65771d){return Mustache[_0x24fc('0x40')](_0x4f4ec8,_[_0x24fc('0x41')](_0x65771d[_0x24fc('0x42')],{'contact':_0x65771d[_0x24fc('0x43')],'message':_0x65771d['message'],'agent':_0x65771d[_0x24fc('0x44')],'interaction':_0x65771d[_0x24fc('0x45')],'account':_0x65771d[_0x24fc('0x46')]}))||'';}function getInteractionUsers(_0x22a75c,_0x5ceae2){return new BPromise(function(_0x172923,_0x2f0bd9){try{if(_0x5ceae2[_0x22a75c['id']]){_0x22a75c['Users']=_[_0x24fc('0x47')](_0x5ceae2[_0x22a75c['id']],function(_0x52df2e){return{'id':_0x52df2e['id'],'fullname':_0x52df2e[_0x24fc('0x48')]};});}}catch(_0x2fd30d){_0x2f0bd9(_0x2fd30d);}_0x172923(_0x22a75c);});}function getInteractionTags(_0x3a15ab,_0x1e045a){return new BPromise(function(_0x431189,_0x278b18){try{if(_0x3a15ab[_0x24fc('0x49')]){_0x3a15ab[_0x24fc('0x4a')]=[];_0x3a15ab['TagIds'][_0x24fc('0x4b')](',')[_0x24fc('0x4c')](function(_0x32f72c){_0x3a15ab['Tags'][_0x24fc('0x4d')](_0x1e045a[_0x32f72c]);});}delete _0x3a15ab[_0x24fc('0x49')];}catch(_0x4ae4a7){_0x278b18(_0x4ae4a7);}_0x431189(_0x3a15ab);});}function updateChatInteraction(_0x2c4a6c,_0x22f30b,_0x2c598c){return new BPromise(function(_0x5e4e9b,_0x31ddd0){return getInteractionUsers(_0x2c4a6c,_0x2c598c)[_0x24fc('0x24')](function(_0x585e48){return getInteractionTags(_0x585e48,_0x22f30b);})[_0x24fc('0x24')](function(_0x169982){_0x5e4e9b(_0x169982);})[_0x24fc('0x2f')](function(_0x2a0ac4){_0x31ddd0(_0x2a0ac4);});});}exports['index']=function(_0x2eecaf,_0x9bc56a){var _0x3ce7b3={},_0x7b38fa={},_0xbcbcfa={'count':0x0,'rows':[]};var _0x58a950=_[_0x24fc('0x47')](db[_0x24fc('0x4e')][_0x24fc('0x4f')],function(_0x3c6ffb){return{'name':_0x3c6ffb['fieldName'],'type':_0x3c6ffb[_0x24fc('0x50')][_0x24fc('0x51')]};});_0x7b38fa['model']=_['map'](_0x58a950,_0x24fc('0x3e'));_0x7b38fa['query']=_['keys'](_0x2eecaf[_0x24fc('0x52')]);_0x7b38fa['filters']=_[_0x24fc('0x53')](_0x7b38fa[_0x24fc('0x54')],_0x7b38fa[_0x24fc('0x52')]);_0x3ce7b3['attributes']=_[_0x24fc('0x53')](_0x7b38fa[_0x24fc('0x54')],qs[_0x24fc('0x55')](_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x55')]));_0x3ce7b3[_0x24fc('0x56')]=_0x3ce7b3[_0x24fc('0x56')][_0x24fc('0x57')]?_0x3ce7b3['attributes']:_0x7b38fa['model'];if(!_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x58')](_0x24fc('0x59'))){_0x3ce7b3['limit']=qs['limit'](_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x5a')]);_0x3ce7b3[_0x24fc('0x34')]=qs[_0x24fc('0x34')](_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x34')]);}_0x3ce7b3[_0x24fc('0x5b')]=qs[_0x24fc('0x5c')](_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x5c')]);_0x3ce7b3[_0x24fc('0x5d')]=qs[_0x24fc('0x5e')](_['pick'](_0x2eecaf[_0x24fc('0x52')],_0x7b38fa[_0x24fc('0x5e')]),_0x58a950);var _0x32a466=[];var _0xb0fc00=squel[_0x24fc('0x5f')]()['field']('id')[_0x24fc('0x60')]('name')[_0x24fc('0x60')](_0x24fc('0x61'))[_0x24fc('0x62')](_0x24fc('0x63'));var _0x40f42b=squel[_0x24fc('0x5f')]()['field'](_0x24fc('0x64'))[_0x24fc('0x60')](_0x24fc('0x65'))[_0x24fc('0x60')](_0x24fc('0x66'))[_0x24fc('0x62')]('user_has_chat_interactions','ui')[_0x24fc('0x67')](_0x24fc('0x68'),'u',_0x24fc('0x69'));var _0x1b69ad=squel[_0x24fc('0x5f')]()[_0x24fc('0x62')](_0x24fc('0x6a'),'i')['left_join'](_0x24fc('0x6b'),'c',_0x24fc('0x6c'))['left_join'](_0x24fc('0x68'),'o',_0x24fc('0x6d'))[_0x24fc('0x67')](_0x24fc('0x6e'),'a',_0x24fc('0x6f'))[_0x24fc('0x67')]('chat_messages','me',_0x24fc('0x70'))['left_join'](_0x24fc('0x71'),'it',_0x24fc('0x72'))['left_join'](_0x24fc('0x63'),'t','t.id\x20=\x20it.TagId');var _0x1c1f74=squel['expr']();var _0xdff811=[];var _0x27b612=squel['expr']();var _0x2edef7;if(_0x2eecaf['query'][_0x24fc('0x73')]){_0x2edef7=as[_0x24fc('0x74')](_0x2eecaf['query'][_0x24fc('0x73')]);var _0x3ec1a8=_0x2edef7[_0x24fc('0x75')];for(var _0x47179d=0x0;_0x47179d<_0x2edef7[_0x24fc('0x76')]['length'];_0x47179d++){var _0x39da59=_0x2edef7[_0x24fc('0x76')][_0x47179d];var _0x2d657a='i';var _0x2b5dca=_[_0x24fc('0x77')](_0x58a950,['name',_0x39da59['field']]);if(!_0x2b5dca){switch(_0x39da59[_0x24fc('0x60')]){case _0x24fc('0x78'):if(_0x39da59['value']==0x1){_0x1b69ad['having']('`'+_0x39da59[_0x24fc('0x60')]+_0x24fc('0x79'));}else{_0x1b69ad[_0x24fc('0x7a')]('`'+_0x39da59[_0x24fc('0x60')]+'`\x20>\x200');}break;case _0x24fc('0x7b'):if(_0x39da59[_0x24fc('0x7c')]===_0x24fc('0x7d')){if(_0x39da59[_0x24fc('0x7e')][_0x24fc('0x4b')]('\x20')[_0x24fc('0x57')]>0x1){_0x1c1f74[_0x3ec1a8](_0x24fc('0x7f'),qs[_0x24fc('0x80')](_0x39da59[_0x24fc('0x7e')]),null);}else{var _0x1f6a71='%'+_0x39da59[_0x24fc('0x7e')]+'%';_0x1c1f74[_0x3ec1a8](_0x24fc('0x81'),_0x1f6a71,_0x1f6a71,_0x1f6a71);}}else{_0x2b5dca=_[_0x24fc('0x77')](_0x58a950,[_0x24fc('0x3e'),_0x24fc('0x82')]);_0x39da59['field']=_0x24fc('0x82');_0x10ef7c=as[_0x24fc('0x83')](_0x2d657a,_0x2b5dca[_0x24fc('0x50')],_0x39da59);_0x1c1f74[_0x3ec1a8](_0x10ef7c[_0x24fc('0x84')],_0x10ef7c[_0x24fc('0x7e')][_0x24fc('0x85')],_0x10ef7c[_0x24fc('0x7e')][_0x24fc('0x31')]);}break;case'Tag':var _0x3475b8=_0x39da59[_0x24fc('0x7e')][_0x24fc('0x4b')](',')[_0x24fc('0x47')](function(_0x55fceb){return Number(_0x55fceb);});_0x3475b8[_0x24fc('0x4c')](function(_0x29b381){_0x27b612['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x29b381+',%');});_0xdff811=_['union'](_0xdff811,_0x3475b8);break;case'User':if(_0x39da59[_0x24fc('0x7c')]===_0x24fc('0x7d')){_0x1c1f74[_0x3ec1a8](_0x24fc('0x86'),'%'+_0x39da59[_0x24fc('0x7e')]+'%',null);}else{_0x2b5dca=_[_0x24fc('0x77')](_0x58a950,[_0x24fc('0x3e'),'UserId']);_0x39da59[_0x24fc('0x60')]=_0x24fc('0x87');_0x10ef7c=as['buildExpression'](_0x2d657a,_0x2b5dca['type'],_0x39da59);_0x1c1f74[_0x3ec1a8](_0x10ef7c[_0x24fc('0x84')],_0x10ef7c[_0x24fc('0x7e')][_0x24fc('0x85')],_0x10ef7c['value'][_0x24fc('0x31')]);}break;case _0x24fc('0x42'):_0x10ef7c=as[_0x24fc('0x83')]('me',null,_0x39da59);_0x1c1f74[_0x3ec1a8](_0x10ef7c['text'],_0x10ef7c['value']['start'],_0x10ef7c['value']['end']);break;}}else{var _0x10ef7c=as[_0x24fc('0x83')](_0x2d657a,_0x2b5dca[_0x24fc('0x50')],_0x39da59);_0x1c1f74[_0x3ec1a8](_0x10ef7c[_0x24fc('0x84')],_0x10ef7c['value'][_0x24fc('0x85')],_0x10ef7c['value'][_0x24fc('0x31')]);}}}else{var _0x4e6eec=_(_0x2eecaf[_0x24fc('0x52')])[_0x24fc('0x88')]()[_0x24fc('0x47')](function(_0x4291bd){return _[_0x24fc('0x89')](_0x58a950,[_0x24fc('0x3e'),_0x4291bd])?_0x4291bd:undefined;})[_0x24fc('0x8a')]()['value']();if(!_[_0x24fc('0x8b')](_0x4e6eec)){_0x4e6eec[_0x24fc('0x4c')](function(_0x2de101){if(_0x2de101==='ChatWebsiteId'){_0x1b69ad['where'](_0x24fc('0x8c'),[][_0x24fc('0x8d')](_0x2eecaf['query'][_0x2de101]));}else if(_0x2de101===_0x24fc('0x8e')){var _0x1a2e6d=JSON['parse'](_0x2eecaf[_0x24fc('0x52')][_0x2de101])[_0x24fc('0x8f')];var _0x5249ea=JSON[_0x24fc('0x90')](_0x2eecaf[_0x24fc('0x52')][_0x2de101])[_0x24fc('0x91')];_0x1b69ad[_0x24fc('0x5d')](_0x24fc('0x92'),_0x1a2e6d,_0x5249ea);}else{if(_0x2eecaf[_0x24fc('0x52')][_0x2de101]==='null'){_0x1b69ad['where']('i.'+_0x2de101+_0x24fc('0x93'));}else{_0x1b69ad['where']('i.'+_0x2de101+_0x24fc('0x94'),_0x2eecaf['query'][_0x2de101]);}}});}if(_0x2eecaf['query'][_0x24fc('0x95')]){if(_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x95')]==0x1){_0x1b69ad[_0x24fc('0x7a')](_0x24fc('0x96'));}else{_0x1b69ad[_0x24fc('0x7a')](_0x24fc('0x97'));}}if(_0x2eecaf[_0x24fc('0x52')]['tag']){_0xdff811=_[_0x24fc('0x98')](_0x2eecaf[_0x24fc('0x52')]['tag'])?_0x2eecaf['query'][_0x24fc('0x99')]:new Array(_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x99')]);_0xdff811[_0x24fc('0x4c')](function(_0xd1e6){_0x27b612['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xd1e6+',%');});}if(_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x9a')]){var _0x5ca35b=_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x9a')][_0x24fc('0x9b')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x24fc('0x9c')](_0x5ca35b)){_0x1c1f74['or'](_0x24fc('0x9d'),_0x5ca35b+'%');}else{_0x1c1f74['or'](_0x24fc('0x9e'),qs[_0x24fc('0x80')](_0x5ca35b))['or'](_0x24fc('0x9f'),_0x5ca35b+'%');}}}_0x1b69ad[_0x24fc('0x5d')](_0x1c1f74);_0x1b69ad[_0x24fc('0xa0')](_0x24fc('0xa1'));var _0x188edb={'type':db['Sequelize'][_0x24fc('0xa2')][_0x24fc('0xa3')],'raw':!![]};var _0x1dcccf=_0x1b69ad['clone']();_0x1dcccf['field']('i.id');_0x1dcccf[_0x24fc('0x60')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x24fc('0x78'));if(_0x3ce7b3[_0x24fc('0x5b')]){_0x3ce7b3['order'][_0x24fc('0x4c')](function(_0x559692){var _0x41cef7=_0x559692[0x0]==='contactName'?_0x559692[0x0]:'i.'+_0x559692[0x0];_0x1b69ad[_0x24fc('0x5b')](_0x41cef7,_0x559692[0x1]===_0x24fc('0xa4')?![]:!![]);});}if(!_[_0x24fc('0x8b')](_0xdff811)){_0x1b69ad[_0x24fc('0x7a')](_0x27b612);_0x1dcccf[_0x24fc('0x5d')](_0x24fc('0xa5'),_0xdff811);}BPromise['resolve']()[_0x24fc('0x24')](function(){if(!_0x2edef7){if(_0x2eecaf[_0x24fc('0x52')][_0x24fc('0xa6')])return;_0x1dcccf[_0x24fc('0x5d')](_0x24fc('0xa7'));_0x1b69ad[_0x24fc('0x5d')](_0x24fc('0xa7'));return;}if(_0x2eecaf[_0x24fc('0xa8')][_0x24fc('0xa9')]!=='agent')return;return _0x2eecaf[_0x24fc('0xa8')][_0x24fc('0xaa')]({'attributes':['id'],'raw':!![]})[_0x24fc('0x24')](function(_0x30ed50){if(_['isEmpty'](_0x30ed50)){_0x1dcccf[_0x24fc('0x5d')](_0x24fc('0xab'));_0x1b69ad[_0x24fc('0x5d')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x1dcccf[_0x24fc('0x5d')]('i.ChatWebsiteId\x20IN\x20?',_['map'](_0x30ed50,'id'));_0x1b69ad['where'](_0x24fc('0x8c'),_['map'](_0x30ed50,'id'));}});})[_0x24fc('0x24')](function(){if(_0x2eecaf[_0x24fc('0xa8')][_0x24fc('0xa9')]===_0x24fc('0x44')&&!_0x2edef7&&!_0x2eecaf['query'][_0x24fc('0xa6')])return[];return db[_0x24fc('0xac')][_0x24fc('0x52')](_0x1dcccf[_0x24fc('0xad')](),_0x188edb);})[_0x24fc('0x24')](function(_0x5c80a5){_0xbcbcfa[_0x24fc('0x36')]=_0x5c80a5[_0x24fc('0x57')];if(_0xbcbcfa[_0x24fc('0x36')]===0x0)return[];return db[_0x24fc('0xac')]['query'](_0xb0fc00['toString'](),_0x188edb)[_0x24fc('0x24')](function(_0x4216da){_0x32a466=_[_0x24fc('0xae')](_0x4216da,'id');_0x188edb=_[_0x24fc('0x41')](_0x188edb,{'model':db[_0x24fc('0x4e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2eecaf['query'][_0x24fc('0x55')]){_0x3ce7b3[_0x24fc('0x56')][_0x24fc('0x4c')](function(_0x5d5a59){_0x1b69ad[_0x24fc('0x60')]('i.'+_0x5d5a59);});}else{_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xaf'),_0x24fc('0x78'));_0x1b69ad[_0x24fc('0x60')]('a.key','Account.key');_0x1b69ad['field'](_0x24fc('0xb0'),_0x24fc('0xb1'));_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xb2'),_0x24fc('0xb3'));_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xb4'));_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xb5'),_0x24fc('0xb6'));_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xb7'),'Contact.lastName');_0x1b69ad['field'](_0x24fc('0xb8'),'Contact.email');_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xb9'),_0x24fc('0xba'));_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xbb'),_0x24fc('0xbc'));_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xbd'),_0x24fc('0xbe'));_0x1b69ad['field'](_0x24fc('0xbf'),_0x24fc('0xc0'));_0x1b69ad['field']('o.internal',_0x24fc('0xc1'));_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xc2'),_0x24fc('0x49'));}if(_0x3ce7b3[_0x24fc('0x5a')])_0x1b69ad[_0x24fc('0x5a')](_0x3ce7b3['limit']);if(_0x3ce7b3[_0x24fc('0x34')])_0x1b69ad[_0x24fc('0x34')](_0x3ce7b3[_0x24fc('0x34')]);return db[_0x24fc('0xac')]['query'](_0x1b69ad[_0x24fc('0xad')](),_0x188edb);})[_0x24fc('0x24')](function(_0x1506e8){if(_0x1506e8['length']>0x0)_0x40f42b[_0x24fc('0x5d')](_0x24fc('0xc3'),_[_0x24fc('0x47')](_0x1506e8,'id'));return db['sequelize'][_0x24fc('0x52')](_0x40f42b[_0x24fc('0xad')](),_0x188edb)['then'](function(_0x543db4){var _0x283251=_[_0x24fc('0xc4')](_0x543db4,_0x24fc('0xc5'));var _0x2029cd=[];_0x1506e8[_0x24fc('0x4c')](function(_0x3afe80){_0x2029cd['push'](updateChatInteraction(_0x3afe80,_0x32a466,_0x283251));});return BPromise[_0x24fc('0xc6')](_0x2029cd);});});})[_0x24fc('0x24')](function(_0x17a6a9){_0xbcbcfa[_0x24fc('0xc7')]=_0x17a6a9;return _0xbcbcfa;})[_0x24fc('0x24')](respondWithFilteredResult(_0x9bc56a,_0x3ce7b3))[_0x24fc('0x2f')](handleError(_0x9bc56a,null));};exports['show']=function(_0x4018d3,_0x4a2522){var _0x5226aa={'raw':![],'where':{'id':_0x4018d3[_0x24fc('0xc8')]['id']}},_0x260a62={};_0x260a62['model']=_[_0x24fc('0x88')](db[_0x24fc('0x4e')][_0x24fc('0x4f')]);_0x260a62[_0x24fc('0x52')]=_['keys'](_0x4018d3[_0x24fc('0x52')]);_0x260a62[_0x24fc('0x5e')]=_[_0x24fc('0x53')](_0x260a62[_0x24fc('0x54')],_0x260a62[_0x24fc('0x52')]);_0x5226aa[_0x24fc('0x56')]=_['intersection'](_0x260a62['model'],qs['fields'](_0x4018d3[_0x24fc('0x52')][_0x24fc('0x55')]));_0x5226aa['attributes']=_0x5226aa[_0x24fc('0x56')][_0x24fc('0x57')]?_0x5226aa[_0x24fc('0x56')]:_0x260a62['model'];if(_0x4018d3[_0x24fc('0x52')][_0x24fc('0xc9')]){_0x5226aa['include']=[{'all':!![]}];}_0x5226aa=_['merge']({},_0x5226aa,_0x4018d3[_0x24fc('0xca')]);return db[_0x24fc('0x4e')][_0x24fc('0x77')](_0x5226aa)['then'](handleEntityNotFound(_0x4a2522,null))[_0x24fc('0x24')](respondWithResult(_0x4a2522,null))['catch'](handleError(_0x4a2522,null));};exports['create']=function(_0x344c0f,_0x52484a){return db['ChatInteraction'][_0x24fc('0xcb')](_0x344c0f['body'],{})[_0x24fc('0x24')](respondWithResult(_0x52484a,0xc9))[_0x24fc('0x2f')](handleError(_0x52484a,null));};exports[_0x24fc('0x3b')]=function(_0x11eaeb,_0x4ae346){if(_0x11eaeb[_0x24fc('0x42')]['id']){delete _0x11eaeb[_0x24fc('0x42')]['id'];}return db['ChatInteraction'][_0x24fc('0x77')]({'where':{'id':_0x11eaeb[_0x24fc('0xc8')]['id']}})[_0x24fc('0x24')](handleEntityNotFound(_0x4ae346,null))[_0x24fc('0x24')](saveUpdates(_0x11eaeb[_0x24fc('0x42')],null))['then'](respondWithResult(_0x4ae346,null))[_0x24fc('0x2f')](handleError(_0x4ae346,null));};exports[_0x24fc('0x3c')]=function(_0x5793d9,_0x759d35){return db[_0x24fc('0x4e')][_0x24fc('0x77')]({'where':{'id':_0x5793d9[_0x24fc('0xc8')]['id']}})[_0x24fc('0x24')](handleEntityNotFound(_0x759d35,null))['then'](removeEntity(_0x759d35,null))[_0x24fc('0x2f')](handleError(_0x759d35,null));};exports['describe']=function(_0x5c8969,_0x42c158){return db[_0x24fc('0x4e')][_0x24fc('0xcc')]()['then'](respondWithResult(_0x42c158,null))['catch'](handleError(_0x42c158,null));};exports[_0x24fc('0xcd')]=function(_0x38fba8,_0xfa9d58){var _0x353a64=_0x38fba8[_0x24fc('0xc8')]['id'];var _0x4ee1ad;var _0x4875bd;var _0x1efb25;return db['ChatInteraction']['findOne']({'where':{'id':_0x353a64}})[_0x24fc('0x24')](function(_0x484775){_0x4ee1ad=_0x484775;return db['ChatWebsite'][_0x24fc('0xce')]({'where':{'id':_0x484775[_0x24fc('0xa6')]},'attributes':['id',_0x24fc('0xcf'),_0x24fc('0xd0'),_0x24fc('0xd1'),_0x24fc('0xd2'),_0x24fc('0xd3')],'raw':!![]});})['then'](function(_0x3b2891){if(_0x3b2891&&_0x3b2891[_0x24fc('0xcf')]&&_0x3b2891[_0x24fc('0xd0')]){_0x4875bd=_0x3b2891;var _0x6e3447={'interaction':{'id':_0x353a64},'agent':{'id':_0x38fba8[_0x24fc('0xa8')]['id'],'name':_0x38fba8[_0x24fc('0xa8')][_0x24fc('0x3e')],'fullname':_0x38fba8[_0x24fc('0xa8')][_0x24fc('0x48')],'email':_0x38fba8[_0x24fc('0xa8')][_0x24fc('0xd4')]},'contact':_0x38fba8[_0x24fc('0x42')][_0x24fc('0x43')],'account':_0x38fba8[_0x24fc('0x42')][_0x24fc('0x46')]};var _0x38ec08={'rejectUnauthorized':![],'method':_0x24fc('0xd5'),'url':_0x24fc('0xd6'),'headers':{'X-APIKEY':_0x3b2891[_0x24fc('0xcf')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x38fba8[_0x24fc('0xa8')][_0x24fc('0xd4')]],'buttons':null,'topic':_0x4875bd[_0x24fc('0xd1')],'note':_[_0x24fc('0xd7')](_0x4875bd[_0x24fc('0xd2')])?null:getMustacheRender(_0x4875bd[_0x24fc('0xd2')],_0x6e3447),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0x24fc('0xd7')](_0x4875bd[_0x24fc('0xd3')])){var _0x1d8a8f=getMustacheRender(_0x4875bd[_0x24fc('0xd3')],_0x6e3447);var _0x534388=JSON['parse'](_0x1d8a8f);_0x38ec08['body'][_0x24fc('0xd8')]=_0x534388;}}catch(_0x5aa947){throw new db[(_0x24fc('0xd9'))]['ValidationError'](_0x24fc('0xda'));}return rp(_0x38ec08);}else{throw new db[(_0x24fc('0xd9'))][(_0x24fc('0xdb'))](_0x24fc('0xdc'));}})[_0x24fc('0x24')](function(_0x468477){_0x1efb25=_0x468477;if(_0x1efb25['id']){var _0x1c4ac1={'body':_0x1efb25[_0x24fc('0xdd')],'ChatWebsiteId':_0x4875bd['id'],'ChatInteractionId':_0x4ee1ad['id'],'direction':'out','UserId':_0x38fba8[_0x24fc('0xa8')]['id']};return db[_0x24fc('0xde')][_0x24fc('0xcb')](_0x1c4ac1,{});}else{throw new db[(_0x24fc('0xd9'))]['ValidationError'](_0x24fc('0xdf'));}})[_0x24fc('0x24')](function(){return _0x4ee1ad[_0x24fc('0xe0')]({'vidaooSessionId':_0x1efb25['id']});})[_0x24fc('0x24')](respondWithResult(_0xfa9d58,null))[_0x24fc('0x2f')](handleError(_0xfa9d58,null));};exports[_0x24fc('0xe1')]=function(_0x17280c,_0x13f9e3){if(_0x17280c[_0x24fc('0x42')]['id']){delete _0x17280c[_0x24fc('0x42')]['id'];}return db[_0x24fc('0x4e')][_0x24fc('0x77')]({'where':{'id':_0x17280c['params']['id']},'include':[{'model':db[_0x24fc('0xe2')],'as':_0x24fc('0x7b')}]})[_0x24fc('0x24')](handleEntityNotFound(_0x13f9e3,null))[_0x24fc('0x24')](saveUpdates(_0x17280c[_0x24fc('0x42')],null))[_0x24fc('0x24')](respondWithResult(_0x13f9e3,null))[_0x24fc('0x2f')](handleError(_0x13f9e3,null));};exports['abandon']=function(_0x2400a3,_0x16368d,_0x5b1fe2){if(_0x2400a3[_0x24fc('0x42')]['id']){delete _0x2400a3[_0x24fc('0x42')]['id'];}return db['ChatInteraction'][_0x24fc('0x77')]({'where':{'id':_0x2400a3['params']['id']}})[_0x24fc('0x24')](function(_0x21d6d3){if(!_0x21d6d3){logger['error'](_0x24fc('0xe3'),_0x24fc('0xe4'),0x194,_0x24fc('0xe5'));_0x16368d[_0x24fc('0x30')](0x194);}else{if(_0x21d6d3[_0x24fc('0x87')]){throw new db[(_0x24fc('0xd9'))][(_0x24fc('0xdb'))](_0x24fc('0xe6'));}}return _0x21d6d3;})[_0x24fc('0x24')](function(_0x2c6ac9){if(_0x2c6ac9){return _0x2c6ac9[_0x24fc('0x3b')]({'closed':_0x2400a3[_0x24fc('0x42')][_0x24fc('0xe7')],'disposition':_0x2400a3[_0x24fc('0x42')][_0x24fc('0xe8')]})[_0x24fc('0x24')](function(_0x2ccd34){return _0x2ccd34;});}})['then'](function(_0x51764e){return respondWithRpcPromise('AbandonInteraction',_0x24fc('0xe4'),_0x2400a3['body'],client9004);})[_0x24fc('0x24')](respondWithResult(_0x16368d,null))[_0x24fc('0x2f')](handleError(_0x16368d,null));};exports[_0x24fc('0xe9')]=function(_0x2d7ecb,_0xf4f427,_0x41fbf1){_0x2d7ecb[_0x24fc('0x42')][_0x24fc('0x3e')]=_0x2d7ecb[_0x24fc('0xea')][_0x24fc('0xeb')];_0x2d7ecb[_0x24fc('0x42')]['basename']=_0x2d7ecb['file'][_0x24fc('0xec')];_0x2d7ecb[_0x24fc('0x42')][_0x24fc('0x50')]=_0x2d7ecb['file'][_0x24fc('0xed')];return db[_0x24fc('0xee')][_0x24fc('0xcb')](_0x2d7ecb[_0x24fc('0x42')])[_0x24fc('0x24')](respondWithResult(_0xf4f427,0xc9))[_0x24fc('0x2f')](handleError(_0xf4f427,null));};exports['attachmentDownload']=function(_0x3c41c1,_0x337fad,_0x525d4f){return db[_0x24fc('0x4e')]['findOne']({'where':{'id':_0x3c41c1['params']['id']},'raw':!![]})[_0x24fc('0x24')](handleEntityNotFound(_0x337fad,null))[_0x24fc('0x24')](function(_0x282848){if(_0x282848){if(_0x282848[_0x24fc('0xe7')]){return _0x337fad['status'](0x193)[_0x24fc('0x33')]({'status':0x193,'message':_0x24fc('0xef')});}return db[_0x24fc('0xee')][_0x24fc('0xce')]({'where':{'id':_0x3c41c1[_0x24fc('0x52')]['attachId']},'raw':!![]})['then'](handleEntityNotFound(_0x337fad,null));}})[_0x24fc('0x24')](function(_0x2cbaa1){if(_0x2cbaa1){var _0xaab85=_0x2cbaa1[_0x24fc('0xf0')]!==null;var _0x42d3ae=path['join'](config[_0x24fc('0xf1')],_0x24fc('0xf2'));if(_0xaab85){_0x42d3ae=path[_0x24fc('0xf3')](_0x42d3ae,_0x24fc('0xf4'));}var _0xc73868=path[_0x24fc('0xf3')](_0x42d3ae,_0x2cbaa1[_0x24fc('0xf5')]);return _0x337fad[_0x24fc('0xf6')](_0xc73868);}})[_0x24fc('0x2f')](handleError(_0x337fad,null));};exports['close']=function(_0x3f0da7,_0x36f9d2){var _0x50a4c5=null;var _0x299fd8=null;var _0x5d01fa=null;var _0x92d51d=null;if(_0x3f0da7[_0x24fc('0x42')]['id']){delete _0x3f0da7['body']['id'];}if(_0x3f0da7['body'][_0x24fc('0xf7')]){_0x92d51d=path['join'](config[_0x24fc('0xf1')],_0x24fc('0xf8'),util[_0x24fc('0xf9')](_0x24fc('0xfa'),Date['now']()));_0x3f0da7[_0x24fc('0x42')][_0x24fc('0xfb')]=_0x92d51d;}return db[_0x24fc('0x4e')][_0x24fc('0x77')]({'where':{'id':_0x3f0da7[_0x24fc('0xc8')]['id']},'include':[{'model':db[_0x24fc('0xde')],'as':_0x24fc('0xfc'),'include':[{'model':db[_0x24fc('0xfd')],'as':_0x24fc('0xfd')}]}]})[_0x24fc('0x24')](handleEntityNotFound(_0x36f9d2,null))[_0x24fc('0x24')](saveUpdates(_0x3f0da7[_0x24fc('0x42')],null))[_0x24fc('0x24')](function(_0x210bc5){if(_0x210bc5){_0x50a4c5=_0x210bc5;return db[_0x24fc('0xfe')][_0x24fc('0x77')]({'where':{'id':_0x50a4c5[_0x24fc('0xa6')]}});}})[_0x24fc('0x24')](function(_0x4dbbf1){if(_0x4dbbf1){_0x5d01fa=_0x4dbbf1;return db[_0x24fc('0xe2')][_0x24fc('0x77')]({'where':{'id':_0x50a4c5[_0x24fc('0x82')]}});}})[_0x24fc('0x24')](function(_0x61a50b){if(_0x61a50b){_0x299fd8=_0x61a50b;if(_0x92d51d){var _0x282e8c=null;for(var _0x47637c=0x1;_0x47637c<_0x50a4c5[_0x24fc('0xfc')]['length'];++_0x47637c){_0x282e8c=_0x50a4c5[_0x24fc('0xfc')][_0x47637c];var _0x36788c=_0x282e8c[_0x24fc('0x87')]?util['format'](_0x24fc('0xff'),_0x5d01fa[_0x24fc('0x100')],_0x282e8c[_0x24fc('0x87')]):_0x24fc('0x101');var _0x1bbfe1=_0x3f0da7[_0x24fc('0x42')][_0x24fc('0x102')]||util[_0x24fc('0xf9')]('%s%d','Visitor',_0x282e8c[_0x24fc('0x82')]);switch(_0x5d01fa['agentIdentifier']){case _0x24fc('0x103'):_0x36788c=_0x282e8c[_0x24fc('0x87')]?util[_0x24fc('0xf9')](_0x24fc('0xff'),_0x5d01fa[_0x24fc('0x100')],_0x282e8c[_0x24fc('0x87')]):_0x24fc('0x101');break;case'agent_alias':_0x36788c=_0x282e8c[_0x24fc('0x87')]?_0x282e8c[_0x24fc('0xfd')][_0x24fc('0x104')]||_0x282e8c['User'][_0x24fc('0x48')]:_0x24fc('0x101');break;case _0x24fc('0x105'):_0x36788c=_0x282e8c['UserId']?_0x282e8c[_0x24fc('0xfd')][_0x24fc('0x48')]:_0x24fc('0x101');break;default:_0x36788c=_0x282e8c[_0x24fc('0x87')]?util[_0x24fc('0xf9')](_0x24fc('0xff'),_0x5d01fa[_0x24fc('0x100')],_0x282e8c[_0x24fc('0x87')]):_0x24fc('0x101');}var _0x3f1c36=util['format']('[%s]\x20%s:\x20%s\x0a',moment(_0x282e8c[_0x24fc('0x8e')])[_0x24fc('0xf9')](_0x24fc('0x106')),_0x282e8c['direction']==='in'?_0x1bbfe1:_0x36788c,_0x282e8c[_0x24fc('0x42')]);if(!_0x282e8c[_0x24fc('0x107')]){fs[_0x24fc('0x108')](_0x92d51d,_0x3f1c36);}}return db[_0x24fc('0x109')][_0x24fc('0xce')]({'where':{'service':!![]},'include':[{'model':db[_0x24fc('0x10a')],'as':_0x24fc('0x10b'),'raw':!![]}]});}}})[_0x24fc('0x24')](function(_0x18ab28){if(_0x18ab28&&_0x18ab28[_0x24fc('0x10b')]&&_0x3f0da7[_0x24fc('0x42')]){var _0x14b0b5={'tls':{'rejectUnauthorized':![]}};if(_0x18ab28[_0x24fc('0x10b')][_0x24fc('0x10c')]){_0x14b0b5[_0x24fc('0x10c')]=_0x18ab28['Smtp'][_0x24fc('0x10c')];}else{_0x14b0b5[_0x24fc('0x10d')]=_0x18ab28[_0x24fc('0x10b')]['host'];_0x14b0b5[_0x24fc('0x10e')]=_0x18ab28[_0x24fc('0x10b')][_0x24fc('0x10e')];_0x14b0b5[_0x24fc('0x10f')]=_0x18ab28[_0x24fc('0x10b')][_0x24fc('0x10f')];}if(_0x18ab28[_0x24fc('0x10b')][_0x24fc('0x110')]){_0x14b0b5[_0x24fc('0x111')]={'user':_0x18ab28[_0x24fc('0x10b')][_0x24fc('0xa8')],'pass':_0x18ab28[_0x24fc('0x10b')]['pass']};}return respondWithRpcPromise(_0x24fc('0x112'),_0x24fc('0x113'),{'account':_0x14b0b5,'message':{'from':util[_0x24fc('0xf9')](_0x24fc('0x114'),_0x18ab28[_0x24fc('0x3e')],_0x18ab28[_0x24fc('0xd4')]||_0x18ab28['Smtp'][_0x24fc('0xa8')]),'to':_0x3f0da7[_0x24fc('0x42')][_0x24fc('0xf7')],'subject':_0x24fc('0x115'),'text':util[_0x24fc('0xf9')](_0x24fc('0x116'),_0x3f0da7[_0x24fc('0x42')][_0x24fc('0xf7')]),'attachments':[{'path':_0x92d51d}]}})[_0x24fc('0x24')](function(){return _0x50a4c5;})[_0x24fc('0x2f')](function(_0x51ecc4){console['error'](_0x51ecc4);});}else{return _0x50a4c5;}})['then'](respondWithStatusCode(_0x36f9d2,0xc8))[_0x24fc('0x2f')](handleError(_0x36f9d2,null));};exports[_0x24fc('0x117')]=function(_0x21d021,_0x15035b,_0xe5f00){return db[_0x24fc('0xde')][_0x24fc('0x77')]({'where':{'id':_0x21d021[_0x24fc('0xc8')]['id']}})['then'](handleEntityNotFound(_0x15035b,null))[_0x24fc('0x24')](function(_0x263597){if(_0x263597){return _0x263597['addMessage'](_0x21d021[_0x24fc('0x42')][_0x24fc('0x118')],_[_0x24fc('0x119')](_0x21d021[_0x24fc('0x42')],[_0x24fc('0x118'),'id'])||{});}})[_0x24fc('0x24')](respondWithResult(_0x15035b,null))[_0x24fc('0x2f')](handleError(_0x15035b,null));};exports['getMessages']=function(_0xda0576,_0x1a136f,_0x47833f){var _0x59d561={'raw':![],'where':{}};var _0x4614fe={};var _0x7a2cca={'count':0x0,'rows':[]};return db[_0x24fc('0x4e')][_0x24fc('0xce')]({'where':{'id':_0xda0576[_0x24fc('0xc8')]['id']}})[_0x24fc('0x24')](handleEntityNotFound(_0x1a136f,null))['then'](function(_0x14bd08){if(_0x14bd08){_0x4614fe[_0x24fc('0x54')]=_['keys'](db[_0x24fc('0xde')][_0x24fc('0x4f')]);_0x4614fe[_0x24fc('0x52')]=_[_0x24fc('0x88')](_0xda0576[_0x24fc('0x52')]);_0x4614fe[_0x24fc('0x5e')]=_[_0x24fc('0x53')](_0x4614fe[_0x24fc('0x54')],_0x4614fe[_0x24fc('0x52')]);_0x59d561[_0x24fc('0x56')]=_['intersection'](_0x4614fe['model'],qs[_0x24fc('0x55')](_0xda0576[_0x24fc('0x52')]['fields']));_0x59d561[_0x24fc('0x56')]=_0x59d561[_0x24fc('0x56')][_0x24fc('0x57')]?_0x59d561['attributes']:_0x4614fe[_0x24fc('0x54')];if(!_0xda0576[_0x24fc('0x52')][_0x24fc('0x58')](_0x24fc('0x59'))){_0x59d561['limit']=qs[_0x24fc('0x5a')](_0xda0576['query'][_0x24fc('0x5a')]);_0x59d561['offset']=qs[_0x24fc('0x34')](_0xda0576[_0x24fc('0x52')]['offset']);}_0x59d561[_0x24fc('0x5b')]=qs[_0x24fc('0x5c')](_0xda0576[_0x24fc('0x52')]['sort']);_0x59d561[_0x24fc('0x5d')]=qs[_0x24fc('0x5e')](_[_0x24fc('0x11a')](_0xda0576['query'],_0x4614fe[_0x24fc('0x5e')]));_0x59d561[_0x24fc('0x5d')][_0x24fc('0xc5')]=_0x14bd08['id'];if(_0xda0576['query'][_0x24fc('0x9a')]){_0x59d561[_0x24fc('0x5d')]=_[_0x24fc('0x41')](_0x59d561[_0x24fc('0x5d')],{'$or':_[_0x24fc('0x47')](_0x59d561[_0x24fc('0x56')],function(_0x6fa372){var _0x1e5616={};_0x1e5616[_0x6fa372]={'$like':'%'+_0xda0576[_0x24fc('0x52')]['filter']+'%'};return _0x1e5616;})});}if(_0xda0576['query'][_0x24fc('0x8f')]){var _0x59cd3c=_0xda0576[_0x24fc('0x52')]['$gte']['split'](',');var _0x235cd7={};_0x235cd7[_0x59cd3c[0x0]]={'$gte':moment(_0x59cd3c[0x1])['format'](_0x24fc('0x11b'))};_0x59d561[_0x24fc('0x5d')]=_[_0x24fc('0x41')](_0x59d561['where'],_0x235cd7);}_0x59d561=_[_0x24fc('0x41')]({},_0x59d561,_0xda0576[_0x24fc('0xca')]);return db[_0x24fc('0xde')][_0x24fc('0x36')]({'where':_0x59d561[_0x24fc('0x5d')]})[_0x24fc('0x24')](function(_0x3e6fda){_0x7a2cca[_0x24fc('0x36')]=_0x3e6fda;if(_0xda0576[_0x24fc('0x52')][_0x24fc('0xc9')]){_0x59d561[_0x24fc('0x11c')]=[{'all':!![]}];}return db[_0x24fc('0xde')][_0x24fc('0x11d')](_0x59d561);})[_0x24fc('0x24')](function(_0x4f5acf){_0x7a2cca[_0x24fc('0xc7')]=_0x4f5acf;return _0x7a2cca;});}})[_0x24fc('0x24')](respondWithFilteredResult(_0x1a136f,_0x59d561))[_0x24fc('0x2f')](handleError(_0x1a136f,null));};exports[_0x24fc('0x11e')]=function(_0x4ba8de,_0x53e48e,_0x50012d){var _0x1449f2={'where':{}},_0x43492b={},_0x487e55={'count':0x0,'rows':[]};return db[_0x24fc('0x4e')][_0x24fc('0xce')]({'where':{'id':_0x4ba8de['params']['id']}})['then'](handleEntityNotFound(_0x53e48e,null))[_0x24fc('0x24')](function(_0x5a41d8){if(_0x5a41d8){_0x43492b['model']=_['keys'](db[_0x24fc('0xde')][_0x24fc('0x4f')]);_0x43492b[_0x24fc('0x52')]=_[_0x24fc('0x88')](_0x4ba8de[_0x24fc('0x52')]);_0x43492b[_0x24fc('0x5e')]=_[_0x24fc('0x53')](_0x43492b[_0x24fc('0x54')],_0x43492b['query']);_0x1449f2[_0x24fc('0x56')]=_[_0x24fc('0x53')](_0x43492b[_0x24fc('0x54')],qs[_0x24fc('0x55')](_0x4ba8de[_0x24fc('0x52')][_0x24fc('0x55')]));_0x1449f2[_0x24fc('0x56')]=_0x1449f2[_0x24fc('0x56')][_0x24fc('0x57')]?_0x1449f2[_0x24fc('0x56')]:_0x43492b[_0x24fc('0x54')];if(!_0x4ba8de[_0x24fc('0x52')]['hasOwnProperty'](_0x24fc('0x59'))){_0x1449f2[_0x24fc('0x5a')]=qs[_0x24fc('0x5a')](_0x4ba8de[_0x24fc('0x52')]['limit']);_0x1449f2[_0x24fc('0x34')]=qs[_0x24fc('0x34')](_0x4ba8de[_0x24fc('0x52')][_0x24fc('0x34')]);}_0x1449f2['order']=qs['sort'](_0x4ba8de[_0x24fc('0x52')][_0x24fc('0x5c')]);_0x1449f2[_0x24fc('0x5d')]=qs[_0x24fc('0x5e')](_['pick'](_0x4ba8de[_0x24fc('0x52')],_0x43492b['filters']));_0x1449f2[_0x24fc('0x5d')][_0x24fc('0xc5')]=_0x5a41d8['id'];if(_0x4ba8de[_0x24fc('0x52')]['filter']){_0x1449f2[_0x24fc('0x5d')]=_[_0x24fc('0x41')](_0x1449f2[_0x24fc('0x5d')],{'$or':_[_0x24fc('0x47')](_0x1449f2['attributes'],function(_0x4ae822){var _0x545714={};_0x545714[_0x4ae822]={'$like':'%'+_0x4ba8de[_0x24fc('0x52')][_0x24fc('0x9a')]+'%'};return _0x545714;})});}_0x1449f2[_0x24fc('0x5d')]['secret']=![];if(_0x4ba8de[_0x24fc('0x52')]['id']){_0x1449f2[_0x24fc('0x5d')]['id']={'$gt':_0x4ba8de['query']['id']};}_0x1449f2=_[_0x24fc('0x41')]({},_0x1449f2,_0x4ba8de[_0x24fc('0xca')]);return db[_0x24fc('0xde')][_0x24fc('0x36')]({'where':_0x1449f2['where']})['then'](function(_0x12921f){_0x487e55[_0x24fc('0x36')]=_0x12921f;_0x1449f2['include']=[];if(_0x4ba8de[_0x24fc('0x52')][_0x24fc('0x11f')]){_0x1449f2[_0x24fc('0x11c')]['push']({'model':db[_0x24fc('0xfd')],'as':_0x24fc('0xfd'),'attributes':['id','fullname','alias']});}if(_0x4ba8de[_0x24fc('0x52')][_0x24fc('0xc9')]){_0x1449f2[_0x24fc('0x11c')]=[{'all':!![]}];}return db[_0x24fc('0xde')][_0x24fc('0x11d')](_0x1449f2);})[_0x24fc('0x24')](function(_0x214f7d){_0x487e55[_0x24fc('0xc7')]=_0x214f7d;return _0x487e55;});}})[_0x24fc('0x24')](respondWithFilteredResult(_0x53e48e,_0x1449f2))[_0x24fc('0x2f')](handleError(_0x53e48e,null));};exports[_0x24fc('0x120')]=function(_0x1a7f96,_0x59d246,_0x281eed){return db[_0x24fc('0x4e')]['find']({'where':{'id':_0x1a7f96[_0x24fc('0xc8')]['id']}})[_0x24fc('0x24')](handleEntityNotFound(_0x59d246,null))['then'](function(_0x4e2c71){if(_0x4e2c71){return _0x4e2c71[_0x24fc('0x121')](_0x1a7f96['body'][_0x24fc('0x118')],_['omit'](_0x1a7f96[_0x24fc('0x42')],['ids','id'])||{})[_0x24fc('0x122')](function(){return db[_0x24fc('0x123')][_0x24fc('0x11d')]({'attributes':['id',_0x24fc('0x3e'),_0x24fc('0x61')],'where':{'id':_0x1a7f96[_0x24fc('0x42')][_0x24fc('0x118')]}});})[_0x24fc('0x24')](function(_0x3c5996){socket['emit']('chatInteractionTags:save',{'id':Number(_0x1a7f96['params']['id']),'tags':_0x3c5996||[]});return{'id':Number(_0x1a7f96[_0x24fc('0xc8')]['id']),'tags':_0x3c5996||[]};});}})[_0x24fc('0x24')](respondWithResult(_0x59d246,null))[_0x24fc('0x2f')](handleError(_0x59d246,null));};exports['removeTags']=function(_0x8dc31b,_0x5941bd,_0x4d73bb){return db[_0x24fc('0x4e')][_0x24fc('0x77')]({'where':{'id':_0x8dc31b[_0x24fc('0xc8')]['id']}})['then'](handleEntityNotFound(_0x5941bd,null))[_0x24fc('0x24')](function(_0x464057){if(_0x464057){return _0x464057[_0x24fc('0x124')](_0x8dc31b[_0x24fc('0x52')][_0x24fc('0x118')]);}})[_0x24fc('0x24')](respondWithStatusCode(_0x5941bd,null))['catch'](handleError(_0x5941bd,null));};exports[_0x24fc('0xf6')]=function(_0x9c34d9,_0x3e4f49){var _0x231f0b=moment()[_0x24fc('0x125')]()['toString']();var _0x34355e=path[_0x24fc('0xf3')](config[_0x24fc('0xf1')],_0x24fc('0x126'),_0x24fc('0x127'),'tmp');var _0x4d0910=path[_0x24fc('0xf3')](config[_0x24fc('0xf1')],'server','files',_0x24fc('0x128'));var _0x49025e=path[_0x24fc('0xf3')](_0x34355e,_0x231f0b);var _0x2c9a19=util['format'](_0x24fc('0x129'),_0x9c34d9['params']['id'],_0x231f0b);var _0x38ca24=path['join'](_0x34355e,_0x2c9a19);var _0x53a9aa=[];_0x53a9aa['push']({'model':db['User'],'as':_0x24fc('0xfd'),'attributes':['id',_0x24fc('0x48')],'raw':!![]});_0x53a9aa['push']({'model':db[_0x24fc('0xe2')],'as':_0x24fc('0x7b'),'attributes':['id',_0x24fc('0x12a'),_0x24fc('0x12b')],'raw':!![]});if(_0x9c34d9[_0x24fc('0x52')]['attachments']){_0x53a9aa[_0x24fc('0x4d')]({'model':db[_0x24fc('0xee')],'as':_0x24fc('0xee'),'raw':!![]});}var _0x2139e8=[{'model':db[_0x24fc('0xde')],'as':_0x24fc('0xfc'),'attributes':['id',_0x24fc('0x42'),'createdAt',_0x24fc('0x12c'),_0x24fc('0x107'),_0x24fc('0x95')],'include':_0x53a9aa}];_0x2139e8[_0x24fc('0x4d')]({'model':db['ChatWebsite'],'as':_0x24fc('0x12d'),'attributes':['id',_0x24fc('0x3e')]});_0x2139e8[_0x24fc('0x4d')]({'model':db[_0x24fc('0xfd')],'as':_0x24fc('0x12e'),'attributes':['id','fullname']});return db[_0x24fc('0x4e')]['find']({'where':{'id':_0x9c34d9[_0x24fc('0xc8')]['id']},'include':_0x2139e8})[_0x24fc('0x24')](handleEntityNotFound(_0x3e4f49,null))[_0x24fc('0x24')](function(_0x26179a){if(_0x26179a){var _0x6f1617=_0x26179a['get']({'plain':!![]});fs[_0x24fc('0x12f')](_0x49025e);var _0x57dfbc={'channel':'Chat','account':_0x6f1617['Account'][_0x24fc('0x3e')],'agent':_0x6f1617[_0x24fc('0x12e')]?_0x6f1617[_0x24fc('0x12e')][_0x24fc('0x48')]:_0x24fc('0x130'),'createdAt':moment(_0x6f1617[_0x24fc('0x8e')])[_0x24fc('0xf9')](_0x24fc('0x11b'))[_0x24fc('0xad')](),'closedAt':_0x6f1617[_0x24fc('0xe7')]?moment(_0x6f1617[_0x24fc('0x131')])[_0x24fc('0xf9')](_0x24fc('0x11b'))['toString']():'','disposition':_0x6f1617['disposition'],'chatInfo':{'browser':_0x6f1617['browserName'],'os':_0x6f1617['osName'],'referer':_0x6f1617['referer'],'customerIp':_0x6f1617[_0x24fc('0x132')],'customerPort':_0x6f1617[_0x24fc('0x133')]?_0x6f1617[_0x24fc('0x133')]:_0x24fc('0x130')},'messages':_(_0x6f1617['Messages'])['tail']()[_0x24fc('0x9a')]({'secret':![]})[_0x24fc('0x47')](function(_0x2ee9a6){if(_0x2ee9a6[_0x24fc('0xee')]){var _0x40409c=path['join'](_0x4d0910,_0x2ee9a6[_0x24fc('0xee')][_0x24fc('0xf5')]);if(fs[_0x24fc('0x134')](_0x40409c)){fs['createReadStream'](_0x40409c)['pipe'](fs[_0x24fc('0x135')](path[_0x24fc('0xf3')](_0x49025e,_0x2ee9a6[_0x24fc('0xee')][_0x24fc('0xf5')])));}}return{'date':moment(_0x2ee9a6[_0x24fc('0x8e')])[_0x24fc('0xf9')](_0x24fc('0x11b'))['toString'](),'sender':_0x2ee9a6[_0x24fc('0x12c')]===_0x24fc('0x136')?_0x2ee9a6[_0x24fc('0xfd')]?_0x2ee9a6[_0x24fc('0xfd')]['fullname']:'System':_0x2ee9a6['Contact']['firstName']+(_0x2ee9a6['Contact'][_0x24fc('0x12b')]?'\x20'+_0x2ee9a6[_0x24fc('0x7b')]['lastName']:''),'body':_0x2ee9a6[_0x24fc('0xee')]?_0x2ee9a6[_0x24fc('0xee')]['basename']:_0x2ee9a6[_0x24fc('0x42')],'direction':_0x2ee9a6['direction']===_0x24fc('0x136')?'A':'C','secret':_0x2ee9a6[_0x24fc('0x107')],'read':_0x2ee9a6[_0x24fc('0x95')],'attachment':_0x2ee9a6['Attachment']};})[_0x24fc('0x7e')]()};return ejs[_0x24fc('0x137')](path['join'](config[_0x24fc('0xf1')],'server','views',_0x24fc('0x138')),{'interaction':_0x57dfbc})[_0x24fc('0x24')](function(_0x24101d){var _0x5defce=path[_0x24fc('0xf3')](_0x49025e,_0x24fc('0x139')+_0x6f1617['id']+'-'+_0x231f0b+_0x24fc('0x13a'));var _0x187770={'path':_0x5defce,'channel':_0x24fc('0x13b'),'interactionId':_0x6f1617['id']};return pdf['createPdfFromHTML'](_0x24101d,_0x187770);})['then'](function(){return new BPromise(function(_0x3357cb,_0x2b633b){zipdir(_0x49025e,{'saveTo':_0x38ca24},function(_0x4ad7c4,_0x1d8b26){if(_0x4ad7c4)return _0x2b633b(_0x4ad7c4);return _0x3357cb(_0x1d8b26);});})[_0x24fc('0x24')](function(){return new BPromise(function(_0x4b0f8b,_0x59d408){rimraf(_0x49025e,function(_0x547f6b){if(_0x547f6b)_0x59d408(_0x547f6b);return _0x4b0f8b();});});})[_0x24fc('0x24')](function(){return _0x3e4f49[_0x24fc('0xf6')](_0x38ca24,_0x2c9a19,function(_0x3a2ffd){if(_0x3a2ffd){console[_0x24fc('0x13c')](_0x24fc('0x13d'),_0x3a2ffd);}else{fs[_0x24fc('0x13e')](_0x38ca24);}});});});}else{return _0x3e4f49[_0x24fc('0x30')](0xc8);}})['catch'](handleError(_0x3e4f49,null));}; \ No newline at end of file +var _0x4fc2=['result','catch','sendStatus','end','status','json','offset','undefined','count','Content-Range','apply','reject','save','update','destroy','stack','name','send','render','merge','body','contact','agent','interaction','account','map','fullname','TagIds','Tags','split','forEach','push','ChatInteraction','rawAttributes','type','key','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','select','field','color','from','tools_tags','u.id','u.fullname','ui.ChatInteractionId','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','search','parseSearch','sqlOperator','conditions','find','unreadMessages','`\x20=\x200','having','Contact','operator','$substring','value','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','buildExpression','text','start','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','keys','some','compact','isEmpty','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','DESC','t.id\x20IN\x20?','ChatWebsiteId','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.mandatoryDisposition','Account.mandatoryDisposition','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','contactName','i.*','c.firstName','Contact.firstName','c.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','params','includeAll','options','create','describe','createVidaooSession','findOne','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','metadata','Sequelize','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','disposition','attachmentUpload','file','originalname','filename','mimetype','Attachment','Unauthorized','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','basename','download','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','pathTranscript','Messages','User','ChatWebsite','%s%d','agentAlias','System','customer','website_alias','alias','agent_fullname','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','pick','YYYY-MM-DD\x20HH:mm:ss','include','findAll','getMyMessages','includeAgent','addTags','setTags','spread','Tag','removeTags','unix','server','files','attachments','transcript-%d-%s.zip','firstName','lastName','direction','Account','Owner','mkdirSync','N.A.','closedAt','customerIp','customerPort','existsSync','createWriteStream','out','renderFile','downloadInteraction.ejs','transcript-','.pdf','Chat','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message'];(function(_0xda9130,_0x578616){var _0x578d75=function(_0x530af5){while(--_0x530af5){_0xda9130['push'](_0xda9130['shift']());}};_0x578d75(++_0x578616);}(_0x4fc2,0x111));var _0x24fc=function(_0x52cd66,_0x37dfc3){_0x52cd66=_0x52cd66-0x0;var _0x26fc62=_0x4fc2[_0x52cd66];return _0x26fc62;};'use strict';var emlformat=require(_0x24fc('0x0'));var rimraf=require(_0x24fc('0x1'));var zipdir=require(_0x24fc('0x2'));var jsonpatch=require(_0x24fc('0x3'));var rp=require('request-promise');var moment=require(_0x24fc('0x4'));var BPromise=require(_0x24fc('0x5'));var Mustache=require(_0x24fc('0x6'));var util=require('util');var path=require(_0x24fc('0x7'));var sox=require(_0x24fc('0x8'));var csv=require('to-csv');var ejs=require(_0x24fc('0x9'));var fs=require('fs');var fs_extra=require(_0x24fc('0xa'));var _=require('lodash');var squel=require(_0x24fc('0xb'));var crypto=require(_0x24fc('0xc'));var jsforce=require(_0x24fc('0xd'));var deskjs=require(_0x24fc('0xe'));var toCsv=require(_0x24fc('0xf'));var querystring=require(_0x24fc('0x10'));var Papa=require('papaparse');var Redis=require(_0x24fc('0x11'));var authService=require(_0x24fc('0x12'));var qs=require(_0x24fc('0x13'));var as=require(_0x24fc('0x14'));var pdf=require(_0x24fc('0x15'));var hardwareService=require(_0x24fc('0x16'));var logger=require(_0x24fc('0x17'))(_0x24fc('0x18'));var utils=require('../../config/utils');var config=require(_0x24fc('0x19'));var licenseUtil=require(_0x24fc('0x1a'));var db=require('../../mysqldb')['db'];config[_0x24fc('0x1b')]=_[_0x24fc('0x1c')](config[_0x24fc('0x1b')],{'host':_0x24fc('0x1d'),'port':0x18eb});var socket=require(_0x24fc('0x1e'))(new Redis(config[_0x24fc('0x1b')]));require('./chatInteraction.socket')[_0x24fc('0x1f')](socket);var jayson=require(_0x24fc('0x20'));var client=jayson[_0x24fc('0x21')][_0x24fc('0x22')]({'port':0x232b});var client9004=jayson['client'][_0x24fc('0x22')]({'port':0x232c});function respondWithRpcPromise(_0x588543,_0x4af098,_0x3385c7,_0x218fb6){return new BPromise(function(_0x41c593,_0x25cb40){var _0x52a884=_0x218fb6||client;return _0x52a884[_0x24fc('0x23')](_0x588543,_0x3385c7)[_0x24fc('0x24')](function(_0x6cfa0a){logger[_0x24fc('0x25')]('ChatInteraction,\x20%s,\x20%s',_0x4af098,_0x24fc('0x26'));logger[_0x24fc('0x27')](_0x24fc('0x28'),_0x4af098,'request\x20sent',JSON[_0x24fc('0x29')](_0x6cfa0a));if(_0x6cfa0a[_0x24fc('0x2a')]){if(_0x6cfa0a[_0x24fc('0x2a')][_0x24fc('0x2b')]===0x1f4){logger['error'](_0x24fc('0x2c'),_0x4af098,_0x6cfa0a['error'][_0x24fc('0x2d')]);return _0x25cb40(_0x6cfa0a['error'][_0x24fc('0x2d')]);}logger[_0x24fc('0x2a')](_0x24fc('0x2c'),_0x4af098,_0x6cfa0a['error'][_0x24fc('0x2d')]);return _0x41c593(_0x6cfa0a['error'][_0x24fc('0x2d')]);}else{logger[_0x24fc('0x25')](_0x24fc('0x2c'),_0x4af098,_0x24fc('0x26'));_0x41c593(_0x6cfa0a[_0x24fc('0x2e')][_0x24fc('0x2d')]);}})[_0x24fc('0x2f')](function(_0x20192b){logger[_0x24fc('0x2a')](_0x24fc('0x2c'),_0x4af098,_0x20192b);_0x25cb40(_0x20192b);});});}function respondWithStatusCode(_0x568441,_0x11c913){_0x11c913=_0x11c913||0xcc;return function(_0x16f27f){if(_0x16f27f){return _0x568441[_0x24fc('0x30')](_0x11c913);}return _0x568441['status'](_0x11c913)[_0x24fc('0x31')]();};}function respondWithResult(_0x3d1ec8,_0x35f9f9){_0x35f9f9=_0x35f9f9||0xc8;return function(_0x290f84){if(_0x290f84){return _0x3d1ec8[_0x24fc('0x32')](_0x35f9f9)[_0x24fc('0x33')](_0x290f84);}};}function respondWithFilteredResult(_0x5ac1f2,_0x240ae7){return function(_0x29a461){if(_0x29a461){var _0x3c99ed=typeof _0x240ae7[_0x24fc('0x34')]===_0x24fc('0x35')&&typeof _0x240ae7['limit']==='undefined';var _0x4e6f73=_0x29a461[_0x24fc('0x36')];var _0x574ba3=_0x3c99ed?0x0:_0x240ae7[_0x24fc('0x34')];var _0x3e6389=_0x3c99ed?_0x29a461[_0x24fc('0x36')]:_0x240ae7[_0x24fc('0x34')]+_0x240ae7['limit'];var _0x66eec0;if(_0x3e6389>=_0x4e6f73){_0x3e6389=_0x4e6f73;_0x66eec0=0xc8;}else{_0x66eec0=0xce;}_0x5ac1f2[_0x24fc('0x32')](_0x66eec0);return _0x5ac1f2['set'](_0x24fc('0x37'),_0x574ba3+'-'+_0x3e6389+'/'+_0x4e6f73)[_0x24fc('0x33')](_0x29a461);}return null;};}function patchUpdates(_0x4d756f){return function(_0x48c62a){try{jsonpatch[_0x24fc('0x38')](_0x48c62a,_0x4d756f,!![]);}catch(_0x56eae7){return BPromise[_0x24fc('0x39')](_0x56eae7);}return _0x48c62a[_0x24fc('0x3a')]();};}function saveUpdates(_0x5491b0,_0x2ae896){return function(_0x33bbf2){if(_0x33bbf2){return _0x33bbf2[_0x24fc('0x3b')](_0x5491b0)[_0x24fc('0x24')](function(_0x1c5874){return _0x1c5874;});}return null;};}function removeEntity(_0x1e205d,_0x3b3932){return function(_0x2a209d){if(_0x2a209d){return _0x2a209d[_0x24fc('0x3c')]()['then'](function(){_0x1e205d[_0x24fc('0x32')](0xcc)[_0x24fc('0x31')]();});}};}function handleEntityNotFound(_0x2fbe30,_0x316aa2){return function(_0x242bd5){if(!_0x242bd5){_0x2fbe30['sendStatus'](0x194);}return _0x242bd5;};}function handleError(_0x56a9bd,_0xd52d10){_0xd52d10=_0xd52d10||0x1f4;return function(_0x5d48fe){logger[_0x24fc('0x2a')](_0x5d48fe[_0x24fc('0x3d')]);if(_0x5d48fe[_0x24fc('0x3e')]){delete _0x5d48fe[_0x24fc('0x3e')];}_0x56a9bd['status'](_0xd52d10)[_0x24fc('0x3f')](_0x5d48fe);};}function getMustacheRender(_0x4f4ec8,_0x65771d){return Mustache[_0x24fc('0x40')](_0x4f4ec8,_[_0x24fc('0x41')](_0x65771d[_0x24fc('0x42')],{'contact':_0x65771d[_0x24fc('0x43')],'message':_0x65771d['message'],'agent':_0x65771d[_0x24fc('0x44')],'interaction':_0x65771d[_0x24fc('0x45')],'account':_0x65771d[_0x24fc('0x46')]}))||'';}function getInteractionUsers(_0x22a75c,_0x5ceae2){return new BPromise(function(_0x172923,_0x2f0bd9){try{if(_0x5ceae2[_0x22a75c['id']]){_0x22a75c['Users']=_[_0x24fc('0x47')](_0x5ceae2[_0x22a75c['id']],function(_0x52df2e){return{'id':_0x52df2e['id'],'fullname':_0x52df2e[_0x24fc('0x48')]};});}}catch(_0x2fd30d){_0x2f0bd9(_0x2fd30d);}_0x172923(_0x22a75c);});}function getInteractionTags(_0x3a15ab,_0x1e045a){return new BPromise(function(_0x431189,_0x278b18){try{if(_0x3a15ab[_0x24fc('0x49')]){_0x3a15ab[_0x24fc('0x4a')]=[];_0x3a15ab['TagIds'][_0x24fc('0x4b')](',')[_0x24fc('0x4c')](function(_0x32f72c){_0x3a15ab['Tags'][_0x24fc('0x4d')](_0x1e045a[_0x32f72c]);});}delete _0x3a15ab[_0x24fc('0x49')];}catch(_0x4ae4a7){_0x278b18(_0x4ae4a7);}_0x431189(_0x3a15ab);});}function updateChatInteraction(_0x2c4a6c,_0x22f30b,_0x2c598c){return new BPromise(function(_0x5e4e9b,_0x31ddd0){return getInteractionUsers(_0x2c4a6c,_0x2c598c)[_0x24fc('0x24')](function(_0x585e48){return getInteractionTags(_0x585e48,_0x22f30b);})[_0x24fc('0x24')](function(_0x169982){_0x5e4e9b(_0x169982);})[_0x24fc('0x2f')](function(_0x2a0ac4){_0x31ddd0(_0x2a0ac4);});});}exports['index']=function(_0x2eecaf,_0x9bc56a){var _0x3ce7b3={},_0x7b38fa={},_0xbcbcfa={'count':0x0,'rows':[]};var _0x58a950=_[_0x24fc('0x47')](db[_0x24fc('0x4e')][_0x24fc('0x4f')],function(_0x3c6ffb){return{'name':_0x3c6ffb['fieldName'],'type':_0x3c6ffb[_0x24fc('0x50')][_0x24fc('0x51')]};});_0x7b38fa['model']=_['map'](_0x58a950,_0x24fc('0x3e'));_0x7b38fa['query']=_['keys'](_0x2eecaf[_0x24fc('0x52')]);_0x7b38fa['filters']=_[_0x24fc('0x53')](_0x7b38fa[_0x24fc('0x54')],_0x7b38fa[_0x24fc('0x52')]);_0x3ce7b3['attributes']=_[_0x24fc('0x53')](_0x7b38fa[_0x24fc('0x54')],qs[_0x24fc('0x55')](_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x55')]));_0x3ce7b3[_0x24fc('0x56')]=_0x3ce7b3[_0x24fc('0x56')][_0x24fc('0x57')]?_0x3ce7b3['attributes']:_0x7b38fa['model'];if(!_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x58')](_0x24fc('0x59'))){_0x3ce7b3['limit']=qs['limit'](_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x5a')]);_0x3ce7b3[_0x24fc('0x34')]=qs[_0x24fc('0x34')](_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x34')]);}_0x3ce7b3[_0x24fc('0x5b')]=qs[_0x24fc('0x5c')](_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x5c')]);_0x3ce7b3[_0x24fc('0x5d')]=qs[_0x24fc('0x5e')](_['pick'](_0x2eecaf[_0x24fc('0x52')],_0x7b38fa[_0x24fc('0x5e')]),_0x58a950);var _0x32a466=[];var _0xb0fc00=squel[_0x24fc('0x5f')]()['field']('id')[_0x24fc('0x60')]('name')[_0x24fc('0x60')](_0x24fc('0x61'))[_0x24fc('0x62')](_0x24fc('0x63'));var _0x40f42b=squel[_0x24fc('0x5f')]()['field'](_0x24fc('0x64'))[_0x24fc('0x60')](_0x24fc('0x65'))[_0x24fc('0x60')](_0x24fc('0x66'))[_0x24fc('0x62')]('user_has_chat_interactions','ui')[_0x24fc('0x67')](_0x24fc('0x68'),'u',_0x24fc('0x69'));var _0x1b69ad=squel[_0x24fc('0x5f')]()[_0x24fc('0x62')](_0x24fc('0x6a'),'i')['left_join'](_0x24fc('0x6b'),'c',_0x24fc('0x6c'))['left_join'](_0x24fc('0x68'),'o',_0x24fc('0x6d'))[_0x24fc('0x67')](_0x24fc('0x6e'),'a',_0x24fc('0x6f'))[_0x24fc('0x67')]('chat_messages','me',_0x24fc('0x70'))['left_join'](_0x24fc('0x71'),'it',_0x24fc('0x72'))['left_join'](_0x24fc('0x63'),'t','t.id\x20=\x20it.TagId');var _0x1c1f74=squel['expr']();var _0xdff811=[];var _0x27b612=squel['expr']();var _0x2edef7;if(_0x2eecaf['query'][_0x24fc('0x73')]){_0x2edef7=as[_0x24fc('0x74')](_0x2eecaf['query'][_0x24fc('0x73')]);var _0x3ec1a8=_0x2edef7[_0x24fc('0x75')];for(var _0x47179d=0x0;_0x47179d<_0x2edef7[_0x24fc('0x76')]['length'];_0x47179d++){var _0x39da59=_0x2edef7[_0x24fc('0x76')][_0x47179d];var _0x2d657a='i';var _0x2b5dca=_[_0x24fc('0x77')](_0x58a950,['name',_0x39da59['field']]);if(!_0x2b5dca){switch(_0x39da59[_0x24fc('0x60')]){case _0x24fc('0x78'):if(_0x39da59['value']==0x1){_0x1b69ad['having']('`'+_0x39da59[_0x24fc('0x60')]+_0x24fc('0x79'));}else{_0x1b69ad[_0x24fc('0x7a')]('`'+_0x39da59[_0x24fc('0x60')]+'`\x20>\x200');}break;case _0x24fc('0x7b'):if(_0x39da59[_0x24fc('0x7c')]===_0x24fc('0x7d')){if(_0x39da59[_0x24fc('0x7e')][_0x24fc('0x4b')]('\x20')[_0x24fc('0x57')]>0x1){_0x1c1f74[_0x3ec1a8](_0x24fc('0x7f'),qs[_0x24fc('0x80')](_0x39da59[_0x24fc('0x7e')]),null);}else{var _0x1f6a71='%'+_0x39da59[_0x24fc('0x7e')]+'%';_0x1c1f74[_0x3ec1a8](_0x24fc('0x81'),_0x1f6a71,_0x1f6a71,_0x1f6a71);}}else{_0x2b5dca=_[_0x24fc('0x77')](_0x58a950,[_0x24fc('0x3e'),_0x24fc('0x82')]);_0x39da59['field']=_0x24fc('0x82');_0x10ef7c=as[_0x24fc('0x83')](_0x2d657a,_0x2b5dca[_0x24fc('0x50')],_0x39da59);_0x1c1f74[_0x3ec1a8](_0x10ef7c[_0x24fc('0x84')],_0x10ef7c[_0x24fc('0x7e')][_0x24fc('0x85')],_0x10ef7c[_0x24fc('0x7e')][_0x24fc('0x31')]);}break;case'Tag':var _0x3475b8=_0x39da59[_0x24fc('0x7e')][_0x24fc('0x4b')](',')[_0x24fc('0x47')](function(_0x55fceb){return Number(_0x55fceb);});_0x3475b8[_0x24fc('0x4c')](function(_0x29b381){_0x27b612['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x29b381+',%');});_0xdff811=_['union'](_0xdff811,_0x3475b8);break;case'User':if(_0x39da59[_0x24fc('0x7c')]===_0x24fc('0x7d')){_0x1c1f74[_0x3ec1a8](_0x24fc('0x86'),'%'+_0x39da59[_0x24fc('0x7e')]+'%',null);}else{_0x2b5dca=_[_0x24fc('0x77')](_0x58a950,[_0x24fc('0x3e'),'UserId']);_0x39da59[_0x24fc('0x60')]=_0x24fc('0x87');_0x10ef7c=as['buildExpression'](_0x2d657a,_0x2b5dca['type'],_0x39da59);_0x1c1f74[_0x3ec1a8](_0x10ef7c[_0x24fc('0x84')],_0x10ef7c[_0x24fc('0x7e')][_0x24fc('0x85')],_0x10ef7c['value'][_0x24fc('0x31')]);}break;case _0x24fc('0x42'):_0x10ef7c=as[_0x24fc('0x83')]('me',null,_0x39da59);_0x1c1f74[_0x3ec1a8](_0x10ef7c['text'],_0x10ef7c['value']['start'],_0x10ef7c['value']['end']);break;}}else{var _0x10ef7c=as[_0x24fc('0x83')](_0x2d657a,_0x2b5dca[_0x24fc('0x50')],_0x39da59);_0x1c1f74[_0x3ec1a8](_0x10ef7c[_0x24fc('0x84')],_0x10ef7c['value'][_0x24fc('0x85')],_0x10ef7c['value'][_0x24fc('0x31')]);}}}else{var _0x4e6eec=_(_0x2eecaf[_0x24fc('0x52')])[_0x24fc('0x88')]()[_0x24fc('0x47')](function(_0x4291bd){return _[_0x24fc('0x89')](_0x58a950,[_0x24fc('0x3e'),_0x4291bd])?_0x4291bd:undefined;})[_0x24fc('0x8a')]()['value']();if(!_[_0x24fc('0x8b')](_0x4e6eec)){_0x4e6eec[_0x24fc('0x4c')](function(_0x2de101){if(_0x2de101==='ChatWebsiteId'){_0x1b69ad['where'](_0x24fc('0x8c'),[][_0x24fc('0x8d')](_0x2eecaf['query'][_0x2de101]));}else if(_0x2de101===_0x24fc('0x8e')){var _0x1a2e6d=JSON['parse'](_0x2eecaf[_0x24fc('0x52')][_0x2de101])[_0x24fc('0x8f')];var _0x5249ea=JSON[_0x24fc('0x90')](_0x2eecaf[_0x24fc('0x52')][_0x2de101])[_0x24fc('0x91')];_0x1b69ad[_0x24fc('0x5d')](_0x24fc('0x92'),_0x1a2e6d,_0x5249ea);}else{if(_0x2eecaf[_0x24fc('0x52')][_0x2de101]==='null'){_0x1b69ad['where']('i.'+_0x2de101+_0x24fc('0x93'));}else{_0x1b69ad['where']('i.'+_0x2de101+_0x24fc('0x94'),_0x2eecaf['query'][_0x2de101]);}}});}if(_0x2eecaf['query'][_0x24fc('0x95')]){if(_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x95')]==0x1){_0x1b69ad[_0x24fc('0x7a')](_0x24fc('0x96'));}else{_0x1b69ad[_0x24fc('0x7a')](_0x24fc('0x97'));}}if(_0x2eecaf[_0x24fc('0x52')]['tag']){_0xdff811=_[_0x24fc('0x98')](_0x2eecaf[_0x24fc('0x52')]['tag'])?_0x2eecaf['query'][_0x24fc('0x99')]:new Array(_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x99')]);_0xdff811[_0x24fc('0x4c')](function(_0xd1e6){_0x27b612['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xd1e6+',%');});}if(_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x9a')]){var _0x5ca35b=_0x2eecaf[_0x24fc('0x52')][_0x24fc('0x9a')][_0x24fc('0x9b')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x24fc('0x9c')](_0x5ca35b)){_0x1c1f74['or'](_0x24fc('0x9d'),_0x5ca35b+'%');}else{_0x1c1f74['or'](_0x24fc('0x9e'),qs[_0x24fc('0x80')](_0x5ca35b))['or'](_0x24fc('0x9f'),_0x5ca35b+'%');}}}_0x1b69ad[_0x24fc('0x5d')](_0x1c1f74);_0x1b69ad[_0x24fc('0xa0')](_0x24fc('0xa1'));var _0x188edb={'type':db['Sequelize'][_0x24fc('0xa2')][_0x24fc('0xa3')],'raw':!![]};var _0x1dcccf=_0x1b69ad['clone']();_0x1dcccf['field']('i.id');_0x1dcccf[_0x24fc('0x60')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x24fc('0x78'));if(_0x3ce7b3[_0x24fc('0x5b')]){_0x3ce7b3['order'][_0x24fc('0x4c')](function(_0x559692){var _0x41cef7=_0x559692[0x0]==='contactName'?_0x559692[0x0]:'i.'+_0x559692[0x0];_0x1b69ad[_0x24fc('0x5b')](_0x41cef7,_0x559692[0x1]===_0x24fc('0xa4')?![]:!![]);});}if(!_[_0x24fc('0x8b')](_0xdff811)){_0x1b69ad[_0x24fc('0x7a')](_0x27b612);_0x1dcccf[_0x24fc('0x5d')](_0x24fc('0xa5'),_0xdff811);}BPromise['resolve']()[_0x24fc('0x24')](function(){if(!_0x2edef7){if(_0x2eecaf[_0x24fc('0x52')][_0x24fc('0xa6')])return;_0x1dcccf[_0x24fc('0x5d')](_0x24fc('0xa7'));_0x1b69ad[_0x24fc('0x5d')](_0x24fc('0xa7'));return;}if(_0x2eecaf[_0x24fc('0xa8')][_0x24fc('0xa9')]!=='agent')return;return _0x2eecaf[_0x24fc('0xa8')][_0x24fc('0xaa')]({'attributes':['id'],'raw':!![]})[_0x24fc('0x24')](function(_0x30ed50){if(_['isEmpty'](_0x30ed50)){_0x1dcccf[_0x24fc('0x5d')](_0x24fc('0xab'));_0x1b69ad[_0x24fc('0x5d')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x1dcccf[_0x24fc('0x5d')]('i.ChatWebsiteId\x20IN\x20?',_['map'](_0x30ed50,'id'));_0x1b69ad['where'](_0x24fc('0x8c'),_['map'](_0x30ed50,'id'));}});})[_0x24fc('0x24')](function(){if(_0x2eecaf[_0x24fc('0xa8')][_0x24fc('0xa9')]===_0x24fc('0x44')&&!_0x2edef7&&!_0x2eecaf['query'][_0x24fc('0xa6')])return[];return db[_0x24fc('0xac')][_0x24fc('0x52')](_0x1dcccf[_0x24fc('0xad')](),_0x188edb);})[_0x24fc('0x24')](function(_0x5c80a5){_0xbcbcfa[_0x24fc('0x36')]=_0x5c80a5[_0x24fc('0x57')];if(_0xbcbcfa[_0x24fc('0x36')]===0x0)return[];return db[_0x24fc('0xac')]['query'](_0xb0fc00['toString'](),_0x188edb)[_0x24fc('0x24')](function(_0x4216da){_0x32a466=_[_0x24fc('0xae')](_0x4216da,'id');_0x188edb=_[_0x24fc('0x41')](_0x188edb,{'model':db[_0x24fc('0x4e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2eecaf['query'][_0x24fc('0x55')]){_0x3ce7b3[_0x24fc('0x56')][_0x24fc('0x4c')](function(_0x5d5a59){_0x1b69ad[_0x24fc('0x60')]('i.'+_0x5d5a59);});}else{_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xaf'),_0x24fc('0x78'));_0x1b69ad[_0x24fc('0x60')]('a.key','Account.key');_0x1b69ad['field'](_0x24fc('0xb0'),_0x24fc('0xb1'));_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xb2'),_0x24fc('0xb3'));_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xb4'));_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xb5'),_0x24fc('0xb6'));_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xb7'),'Contact.lastName');_0x1b69ad['field'](_0x24fc('0xb8'),'Contact.email');_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xb9'),_0x24fc('0xba'));_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xbb'),_0x24fc('0xbc'));_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xbd'),_0x24fc('0xbe'));_0x1b69ad['field'](_0x24fc('0xbf'),_0x24fc('0xc0'));_0x1b69ad['field']('o.internal',_0x24fc('0xc1'));_0x1b69ad[_0x24fc('0x60')](_0x24fc('0xc2'),_0x24fc('0x49'));}if(_0x3ce7b3[_0x24fc('0x5a')])_0x1b69ad[_0x24fc('0x5a')](_0x3ce7b3['limit']);if(_0x3ce7b3[_0x24fc('0x34')])_0x1b69ad[_0x24fc('0x34')](_0x3ce7b3[_0x24fc('0x34')]);return db[_0x24fc('0xac')]['query'](_0x1b69ad[_0x24fc('0xad')](),_0x188edb);})[_0x24fc('0x24')](function(_0x1506e8){if(_0x1506e8['length']>0x0)_0x40f42b[_0x24fc('0x5d')](_0x24fc('0xc3'),_[_0x24fc('0x47')](_0x1506e8,'id'));return db['sequelize'][_0x24fc('0x52')](_0x40f42b[_0x24fc('0xad')](),_0x188edb)['then'](function(_0x543db4){var _0x283251=_[_0x24fc('0xc4')](_0x543db4,_0x24fc('0xc5'));var _0x2029cd=[];_0x1506e8[_0x24fc('0x4c')](function(_0x3afe80){_0x2029cd['push'](updateChatInteraction(_0x3afe80,_0x32a466,_0x283251));});return BPromise[_0x24fc('0xc6')](_0x2029cd);});});})[_0x24fc('0x24')](function(_0x17a6a9){_0xbcbcfa[_0x24fc('0xc7')]=_0x17a6a9;return _0xbcbcfa;})[_0x24fc('0x24')](respondWithFilteredResult(_0x9bc56a,_0x3ce7b3))[_0x24fc('0x2f')](handleError(_0x9bc56a,null));};exports['show']=function(_0x4018d3,_0x4a2522){var _0x5226aa={'raw':![],'where':{'id':_0x4018d3[_0x24fc('0xc8')]['id']}},_0x260a62={};_0x260a62['model']=_[_0x24fc('0x88')](db[_0x24fc('0x4e')][_0x24fc('0x4f')]);_0x260a62[_0x24fc('0x52')]=_['keys'](_0x4018d3[_0x24fc('0x52')]);_0x260a62[_0x24fc('0x5e')]=_[_0x24fc('0x53')](_0x260a62[_0x24fc('0x54')],_0x260a62[_0x24fc('0x52')]);_0x5226aa[_0x24fc('0x56')]=_['intersection'](_0x260a62['model'],qs['fields'](_0x4018d3[_0x24fc('0x52')][_0x24fc('0x55')]));_0x5226aa['attributes']=_0x5226aa[_0x24fc('0x56')][_0x24fc('0x57')]?_0x5226aa[_0x24fc('0x56')]:_0x260a62['model'];if(_0x4018d3[_0x24fc('0x52')][_0x24fc('0xc9')]){_0x5226aa['include']=[{'all':!![]}];}_0x5226aa=_['merge']({},_0x5226aa,_0x4018d3[_0x24fc('0xca')]);return db[_0x24fc('0x4e')][_0x24fc('0x77')](_0x5226aa)['then'](handleEntityNotFound(_0x4a2522,null))[_0x24fc('0x24')](respondWithResult(_0x4a2522,null))['catch'](handleError(_0x4a2522,null));};exports['create']=function(_0x344c0f,_0x52484a){return db['ChatInteraction'][_0x24fc('0xcb')](_0x344c0f['body'],{})[_0x24fc('0x24')](respondWithResult(_0x52484a,0xc9))[_0x24fc('0x2f')](handleError(_0x52484a,null));};exports[_0x24fc('0x3b')]=function(_0x11eaeb,_0x4ae346){if(_0x11eaeb[_0x24fc('0x42')]['id']){delete _0x11eaeb[_0x24fc('0x42')]['id'];}return db['ChatInteraction'][_0x24fc('0x77')]({'where':{'id':_0x11eaeb[_0x24fc('0xc8')]['id']}})[_0x24fc('0x24')](handleEntityNotFound(_0x4ae346,null))[_0x24fc('0x24')](saveUpdates(_0x11eaeb[_0x24fc('0x42')],null))['then'](respondWithResult(_0x4ae346,null))[_0x24fc('0x2f')](handleError(_0x4ae346,null));};exports[_0x24fc('0x3c')]=function(_0x5793d9,_0x759d35){return db[_0x24fc('0x4e')][_0x24fc('0x77')]({'where':{'id':_0x5793d9[_0x24fc('0xc8')]['id']}})[_0x24fc('0x24')](handleEntityNotFound(_0x759d35,null))['then'](removeEntity(_0x759d35,null))[_0x24fc('0x2f')](handleError(_0x759d35,null));};exports['describe']=function(_0x5c8969,_0x42c158){return db[_0x24fc('0x4e')][_0x24fc('0xcc')]()['then'](respondWithResult(_0x42c158,null))['catch'](handleError(_0x42c158,null));};exports[_0x24fc('0xcd')]=function(_0x38fba8,_0xfa9d58){var _0x353a64=_0x38fba8[_0x24fc('0xc8')]['id'];var _0x4ee1ad;var _0x4875bd;var _0x1efb25;return db['ChatInteraction']['findOne']({'where':{'id':_0x353a64}})[_0x24fc('0x24')](function(_0x484775){_0x4ee1ad=_0x484775;return db['ChatWebsite'][_0x24fc('0xce')]({'where':{'id':_0x484775[_0x24fc('0xa6')]},'attributes':['id',_0x24fc('0xcf'),_0x24fc('0xd0'),_0x24fc('0xd1'),_0x24fc('0xd2'),_0x24fc('0xd3')],'raw':!![]});})['then'](function(_0x3b2891){if(_0x3b2891&&_0x3b2891[_0x24fc('0xcf')]&&_0x3b2891[_0x24fc('0xd0')]){_0x4875bd=_0x3b2891;var _0x6e3447={'interaction':{'id':_0x353a64},'agent':{'id':_0x38fba8[_0x24fc('0xa8')]['id'],'name':_0x38fba8[_0x24fc('0xa8')][_0x24fc('0x3e')],'fullname':_0x38fba8[_0x24fc('0xa8')][_0x24fc('0x48')],'email':_0x38fba8[_0x24fc('0xa8')][_0x24fc('0xd4')]},'contact':_0x38fba8[_0x24fc('0x42')][_0x24fc('0x43')],'account':_0x38fba8[_0x24fc('0x42')][_0x24fc('0x46')]};var _0x38ec08={'rejectUnauthorized':![],'method':_0x24fc('0xd5'),'url':_0x24fc('0xd6'),'headers':{'X-APIKEY':_0x3b2891[_0x24fc('0xcf')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x38fba8[_0x24fc('0xa8')][_0x24fc('0xd4')]],'buttons':null,'topic':_0x4875bd[_0x24fc('0xd1')],'note':_[_0x24fc('0xd7')](_0x4875bd[_0x24fc('0xd2')])?null:getMustacheRender(_0x4875bd[_0x24fc('0xd2')],_0x6e3447),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0x24fc('0xd7')](_0x4875bd[_0x24fc('0xd3')])){var _0x1d8a8f=getMustacheRender(_0x4875bd[_0x24fc('0xd3')],_0x6e3447);var _0x534388=JSON['parse'](_0x1d8a8f);_0x38ec08['body'][_0x24fc('0xd8')]=_0x534388;}}catch(_0x5aa947){throw new db[(_0x24fc('0xd9'))]['ValidationError'](_0x24fc('0xda'));}return rp(_0x38ec08);}else{throw new db[(_0x24fc('0xd9'))][(_0x24fc('0xdb'))](_0x24fc('0xdc'));}})[_0x24fc('0x24')](function(_0x468477){_0x1efb25=_0x468477;if(_0x1efb25['id']){var _0x1c4ac1={'body':_0x1efb25[_0x24fc('0xdd')],'ChatWebsiteId':_0x4875bd['id'],'ChatInteractionId':_0x4ee1ad['id'],'direction':'out','UserId':_0x38fba8[_0x24fc('0xa8')]['id']};return db[_0x24fc('0xde')][_0x24fc('0xcb')](_0x1c4ac1,{});}else{throw new db[(_0x24fc('0xd9'))]['ValidationError'](_0x24fc('0xdf'));}})[_0x24fc('0x24')](function(){return _0x4ee1ad[_0x24fc('0xe0')]({'vidaooSessionId':_0x1efb25['id']});})[_0x24fc('0x24')](respondWithResult(_0xfa9d58,null))[_0x24fc('0x2f')](handleError(_0xfa9d58,null));};exports[_0x24fc('0xe1')]=function(_0x17280c,_0x13f9e3){if(_0x17280c[_0x24fc('0x42')]['id']){delete _0x17280c[_0x24fc('0x42')]['id'];}return db[_0x24fc('0x4e')][_0x24fc('0x77')]({'where':{'id':_0x17280c['params']['id']},'include':[{'model':db[_0x24fc('0xe2')],'as':_0x24fc('0x7b')}]})[_0x24fc('0x24')](handleEntityNotFound(_0x13f9e3,null))[_0x24fc('0x24')](saveUpdates(_0x17280c[_0x24fc('0x42')],null))[_0x24fc('0x24')](respondWithResult(_0x13f9e3,null))[_0x24fc('0x2f')](handleError(_0x13f9e3,null));};exports['abandon']=function(_0x2400a3,_0x16368d,_0x5b1fe2){if(_0x2400a3[_0x24fc('0x42')]['id']){delete _0x2400a3[_0x24fc('0x42')]['id'];}return db['ChatInteraction'][_0x24fc('0x77')]({'where':{'id':_0x2400a3['params']['id']}})[_0x24fc('0x24')](function(_0x21d6d3){if(!_0x21d6d3){logger['error'](_0x24fc('0xe3'),_0x24fc('0xe4'),0x194,_0x24fc('0xe5'));_0x16368d[_0x24fc('0x30')](0x194);}else{if(_0x21d6d3[_0x24fc('0x87')]){throw new db[(_0x24fc('0xd9'))][(_0x24fc('0xdb'))](_0x24fc('0xe6'));}}return _0x21d6d3;})[_0x24fc('0x24')](function(_0x2c6ac9){if(_0x2c6ac9){return _0x2c6ac9[_0x24fc('0x3b')]({'closed':_0x2400a3[_0x24fc('0x42')][_0x24fc('0xe7')],'disposition':_0x2400a3[_0x24fc('0x42')][_0x24fc('0xe8')]})[_0x24fc('0x24')](function(_0x2ccd34){return _0x2ccd34;});}})['then'](function(_0x51764e){return respondWithRpcPromise('AbandonInteraction',_0x24fc('0xe4'),_0x2400a3['body'],client9004);})[_0x24fc('0x24')](respondWithResult(_0x16368d,null))[_0x24fc('0x2f')](handleError(_0x16368d,null));};exports[_0x24fc('0xe9')]=function(_0x2d7ecb,_0xf4f427,_0x41fbf1){_0x2d7ecb[_0x24fc('0x42')][_0x24fc('0x3e')]=_0x2d7ecb[_0x24fc('0xea')][_0x24fc('0xeb')];_0x2d7ecb[_0x24fc('0x42')]['basename']=_0x2d7ecb['file'][_0x24fc('0xec')];_0x2d7ecb[_0x24fc('0x42')][_0x24fc('0x50')]=_0x2d7ecb['file'][_0x24fc('0xed')];return db[_0x24fc('0xee')][_0x24fc('0xcb')](_0x2d7ecb[_0x24fc('0x42')])[_0x24fc('0x24')](respondWithResult(_0xf4f427,0xc9))[_0x24fc('0x2f')](handleError(_0xf4f427,null));};exports['attachmentDownload']=function(_0x3c41c1,_0x337fad,_0x525d4f){return db[_0x24fc('0x4e')]['findOne']({'where':{'id':_0x3c41c1['params']['id']},'raw':!![]})[_0x24fc('0x24')](handleEntityNotFound(_0x337fad,null))[_0x24fc('0x24')](function(_0x282848){if(_0x282848){if(_0x282848[_0x24fc('0xe7')]){return _0x337fad['status'](0x193)[_0x24fc('0x33')]({'status':0x193,'message':_0x24fc('0xef')});}return db[_0x24fc('0xee')][_0x24fc('0xce')]({'where':{'id':_0x3c41c1[_0x24fc('0x52')]['attachId']},'raw':!![]})['then'](handleEntityNotFound(_0x337fad,null));}})[_0x24fc('0x24')](function(_0x2cbaa1){if(_0x2cbaa1){var _0xaab85=_0x2cbaa1[_0x24fc('0xf0')]!==null;var _0x42d3ae=path['join'](config[_0x24fc('0xf1')],_0x24fc('0xf2'));if(_0xaab85){_0x42d3ae=path[_0x24fc('0xf3')](_0x42d3ae,_0x24fc('0xf4'));}var _0xc73868=path[_0x24fc('0xf3')](_0x42d3ae,_0x2cbaa1[_0x24fc('0xf5')]);return _0x337fad[_0x24fc('0xf6')](_0xc73868);}})[_0x24fc('0x2f')](handleError(_0x337fad,null));};exports['close']=function(_0x3f0da7,_0x36f9d2){var _0x50a4c5=null;var _0x299fd8=null;var _0x5d01fa=null;var _0x92d51d=null;if(_0x3f0da7[_0x24fc('0x42')]['id']){delete _0x3f0da7['body']['id'];}if(_0x3f0da7['body'][_0x24fc('0xf7')]){_0x92d51d=path['join'](config[_0x24fc('0xf1')],_0x24fc('0xf8'),util[_0x24fc('0xf9')](_0x24fc('0xfa'),Date['now']()));_0x3f0da7[_0x24fc('0x42')][_0x24fc('0xfb')]=_0x92d51d;}return db[_0x24fc('0x4e')][_0x24fc('0x77')]({'where':{'id':_0x3f0da7[_0x24fc('0xc8')]['id']},'include':[{'model':db[_0x24fc('0xde')],'as':_0x24fc('0xfc'),'include':[{'model':db[_0x24fc('0xfd')],'as':_0x24fc('0xfd')}]}]})[_0x24fc('0x24')](handleEntityNotFound(_0x36f9d2,null))[_0x24fc('0x24')](saveUpdates(_0x3f0da7[_0x24fc('0x42')],null))[_0x24fc('0x24')](function(_0x210bc5){if(_0x210bc5){_0x50a4c5=_0x210bc5;return db[_0x24fc('0xfe')][_0x24fc('0x77')]({'where':{'id':_0x50a4c5[_0x24fc('0xa6')]}});}})[_0x24fc('0x24')](function(_0x4dbbf1){if(_0x4dbbf1){_0x5d01fa=_0x4dbbf1;return db[_0x24fc('0xe2')][_0x24fc('0x77')]({'where':{'id':_0x50a4c5[_0x24fc('0x82')]}});}})[_0x24fc('0x24')](function(_0x61a50b){if(_0x61a50b){_0x299fd8=_0x61a50b;if(_0x92d51d){var _0x282e8c=null;for(var _0x47637c=0x1;_0x47637c<_0x50a4c5[_0x24fc('0xfc')]['length'];++_0x47637c){_0x282e8c=_0x50a4c5[_0x24fc('0xfc')][_0x47637c];var _0x36788c=_0x282e8c[_0x24fc('0x87')]?util['format'](_0x24fc('0xff'),_0x5d01fa[_0x24fc('0x100')],_0x282e8c[_0x24fc('0x87')]):_0x24fc('0x101');var _0x1bbfe1=_0x3f0da7[_0x24fc('0x42')][_0x24fc('0x102')]||util[_0x24fc('0xf9')]('%s%d','Visitor',_0x282e8c[_0x24fc('0x82')]);switch(_0x5d01fa['agentIdentifier']){case _0x24fc('0x103'):_0x36788c=_0x282e8c[_0x24fc('0x87')]?util[_0x24fc('0xf9')](_0x24fc('0xff'),_0x5d01fa[_0x24fc('0x100')],_0x282e8c[_0x24fc('0x87')]):_0x24fc('0x101');break;case'agent_alias':_0x36788c=_0x282e8c[_0x24fc('0x87')]?_0x282e8c[_0x24fc('0xfd')][_0x24fc('0x104')]||_0x282e8c['User'][_0x24fc('0x48')]:_0x24fc('0x101');break;case _0x24fc('0x105'):_0x36788c=_0x282e8c['UserId']?_0x282e8c[_0x24fc('0xfd')][_0x24fc('0x48')]:_0x24fc('0x101');break;default:_0x36788c=_0x282e8c[_0x24fc('0x87')]?util[_0x24fc('0xf9')](_0x24fc('0xff'),_0x5d01fa[_0x24fc('0x100')],_0x282e8c[_0x24fc('0x87')]):_0x24fc('0x101');}var _0x3f1c36=util['format']('[%s]\x20%s:\x20%s\x0a',moment(_0x282e8c[_0x24fc('0x8e')])[_0x24fc('0xf9')](_0x24fc('0x106')),_0x282e8c['direction']==='in'?_0x1bbfe1:_0x36788c,_0x282e8c[_0x24fc('0x42')]);if(!_0x282e8c[_0x24fc('0x107')]){fs[_0x24fc('0x108')](_0x92d51d,_0x3f1c36);}}return db[_0x24fc('0x109')][_0x24fc('0xce')]({'where':{'service':!![]},'include':[{'model':db[_0x24fc('0x10a')],'as':_0x24fc('0x10b'),'raw':!![]}]});}}})[_0x24fc('0x24')](function(_0x18ab28){if(_0x18ab28&&_0x18ab28[_0x24fc('0x10b')]&&_0x3f0da7[_0x24fc('0x42')]){var _0x14b0b5={'tls':{'rejectUnauthorized':![]}};if(_0x18ab28[_0x24fc('0x10b')][_0x24fc('0x10c')]){_0x14b0b5[_0x24fc('0x10c')]=_0x18ab28['Smtp'][_0x24fc('0x10c')];}else{_0x14b0b5[_0x24fc('0x10d')]=_0x18ab28[_0x24fc('0x10b')]['host'];_0x14b0b5[_0x24fc('0x10e')]=_0x18ab28[_0x24fc('0x10b')][_0x24fc('0x10e')];_0x14b0b5[_0x24fc('0x10f')]=_0x18ab28[_0x24fc('0x10b')][_0x24fc('0x10f')];}if(_0x18ab28[_0x24fc('0x10b')][_0x24fc('0x110')]){_0x14b0b5[_0x24fc('0x111')]={'user':_0x18ab28[_0x24fc('0x10b')][_0x24fc('0xa8')],'pass':_0x18ab28[_0x24fc('0x10b')]['pass']};}return respondWithRpcPromise(_0x24fc('0x112'),_0x24fc('0x113'),{'account':_0x14b0b5,'message':{'from':util[_0x24fc('0xf9')](_0x24fc('0x114'),_0x18ab28[_0x24fc('0x3e')],_0x18ab28[_0x24fc('0xd4')]||_0x18ab28['Smtp'][_0x24fc('0xa8')]),'to':_0x3f0da7[_0x24fc('0x42')][_0x24fc('0xf7')],'subject':_0x24fc('0x115'),'text':util[_0x24fc('0xf9')](_0x24fc('0x116'),_0x3f0da7[_0x24fc('0x42')][_0x24fc('0xf7')]),'attachments':[{'path':_0x92d51d}]}})[_0x24fc('0x24')](function(){return _0x50a4c5;})[_0x24fc('0x2f')](function(_0x51ecc4){console['error'](_0x51ecc4);});}else{return _0x50a4c5;}})['then'](respondWithStatusCode(_0x36f9d2,0xc8))[_0x24fc('0x2f')](handleError(_0x36f9d2,null));};exports[_0x24fc('0x117')]=function(_0x21d021,_0x15035b,_0xe5f00){return db[_0x24fc('0xde')][_0x24fc('0x77')]({'where':{'id':_0x21d021[_0x24fc('0xc8')]['id']}})['then'](handleEntityNotFound(_0x15035b,null))[_0x24fc('0x24')](function(_0x263597){if(_0x263597){return _0x263597['addMessage'](_0x21d021[_0x24fc('0x42')][_0x24fc('0x118')],_[_0x24fc('0x119')](_0x21d021[_0x24fc('0x42')],[_0x24fc('0x118'),'id'])||{});}})[_0x24fc('0x24')](respondWithResult(_0x15035b,null))[_0x24fc('0x2f')](handleError(_0x15035b,null));};exports['getMessages']=function(_0xda0576,_0x1a136f,_0x47833f){var _0x59d561={'raw':![],'where':{}};var _0x4614fe={};var _0x7a2cca={'count':0x0,'rows':[]};return db[_0x24fc('0x4e')][_0x24fc('0xce')]({'where':{'id':_0xda0576[_0x24fc('0xc8')]['id']}})[_0x24fc('0x24')](handleEntityNotFound(_0x1a136f,null))['then'](function(_0x14bd08){if(_0x14bd08){_0x4614fe[_0x24fc('0x54')]=_['keys'](db[_0x24fc('0xde')][_0x24fc('0x4f')]);_0x4614fe[_0x24fc('0x52')]=_[_0x24fc('0x88')](_0xda0576[_0x24fc('0x52')]);_0x4614fe[_0x24fc('0x5e')]=_[_0x24fc('0x53')](_0x4614fe[_0x24fc('0x54')],_0x4614fe[_0x24fc('0x52')]);_0x59d561[_0x24fc('0x56')]=_['intersection'](_0x4614fe['model'],qs[_0x24fc('0x55')](_0xda0576[_0x24fc('0x52')]['fields']));_0x59d561[_0x24fc('0x56')]=_0x59d561[_0x24fc('0x56')][_0x24fc('0x57')]?_0x59d561['attributes']:_0x4614fe[_0x24fc('0x54')];if(!_0xda0576[_0x24fc('0x52')][_0x24fc('0x58')](_0x24fc('0x59'))){_0x59d561['limit']=qs[_0x24fc('0x5a')](_0xda0576['query'][_0x24fc('0x5a')]);_0x59d561['offset']=qs[_0x24fc('0x34')](_0xda0576[_0x24fc('0x52')]['offset']);}_0x59d561[_0x24fc('0x5b')]=qs[_0x24fc('0x5c')](_0xda0576[_0x24fc('0x52')]['sort']);_0x59d561[_0x24fc('0x5d')]=qs[_0x24fc('0x5e')](_[_0x24fc('0x11a')](_0xda0576['query'],_0x4614fe[_0x24fc('0x5e')]));_0x59d561[_0x24fc('0x5d')][_0x24fc('0xc5')]=_0x14bd08['id'];if(_0xda0576['query'][_0x24fc('0x9a')]){_0x59d561[_0x24fc('0x5d')]=_[_0x24fc('0x41')](_0x59d561[_0x24fc('0x5d')],{'$or':_[_0x24fc('0x47')](_0x59d561[_0x24fc('0x56')],function(_0x6fa372){var _0x1e5616={};_0x1e5616[_0x6fa372]={'$like':'%'+_0xda0576[_0x24fc('0x52')]['filter']+'%'};return _0x1e5616;})});}if(_0xda0576['query'][_0x24fc('0x8f')]){var _0x59cd3c=_0xda0576[_0x24fc('0x52')]['$gte']['split'](',');var _0x235cd7={};_0x235cd7[_0x59cd3c[0x0]]={'$gte':moment(_0x59cd3c[0x1])['format'](_0x24fc('0x11b'))};_0x59d561[_0x24fc('0x5d')]=_[_0x24fc('0x41')](_0x59d561['where'],_0x235cd7);}_0x59d561=_[_0x24fc('0x41')]({},_0x59d561,_0xda0576[_0x24fc('0xca')]);return db[_0x24fc('0xde')][_0x24fc('0x36')]({'where':_0x59d561[_0x24fc('0x5d')]})[_0x24fc('0x24')](function(_0x3e6fda){_0x7a2cca[_0x24fc('0x36')]=_0x3e6fda;if(_0xda0576[_0x24fc('0x52')][_0x24fc('0xc9')]){_0x59d561[_0x24fc('0x11c')]=[{'all':!![]}];}return db[_0x24fc('0xde')][_0x24fc('0x11d')](_0x59d561);})[_0x24fc('0x24')](function(_0x4f5acf){_0x7a2cca[_0x24fc('0xc7')]=_0x4f5acf;return _0x7a2cca;});}})[_0x24fc('0x24')](respondWithFilteredResult(_0x1a136f,_0x59d561))[_0x24fc('0x2f')](handleError(_0x1a136f,null));};exports[_0x24fc('0x11e')]=function(_0x4ba8de,_0x53e48e,_0x50012d){var _0x1449f2={'where':{}},_0x43492b={},_0x487e55={'count':0x0,'rows':[]};return db[_0x24fc('0x4e')][_0x24fc('0xce')]({'where':{'id':_0x4ba8de['params']['id']}})['then'](handleEntityNotFound(_0x53e48e,null))[_0x24fc('0x24')](function(_0x5a41d8){if(_0x5a41d8){_0x43492b['model']=_['keys'](db[_0x24fc('0xde')][_0x24fc('0x4f')]);_0x43492b[_0x24fc('0x52')]=_[_0x24fc('0x88')](_0x4ba8de[_0x24fc('0x52')]);_0x43492b[_0x24fc('0x5e')]=_[_0x24fc('0x53')](_0x43492b[_0x24fc('0x54')],_0x43492b['query']);_0x1449f2[_0x24fc('0x56')]=_[_0x24fc('0x53')](_0x43492b[_0x24fc('0x54')],qs[_0x24fc('0x55')](_0x4ba8de[_0x24fc('0x52')][_0x24fc('0x55')]));_0x1449f2[_0x24fc('0x56')]=_0x1449f2[_0x24fc('0x56')][_0x24fc('0x57')]?_0x1449f2[_0x24fc('0x56')]:_0x43492b[_0x24fc('0x54')];if(!_0x4ba8de[_0x24fc('0x52')]['hasOwnProperty'](_0x24fc('0x59'))){_0x1449f2[_0x24fc('0x5a')]=qs[_0x24fc('0x5a')](_0x4ba8de[_0x24fc('0x52')]['limit']);_0x1449f2[_0x24fc('0x34')]=qs[_0x24fc('0x34')](_0x4ba8de[_0x24fc('0x52')][_0x24fc('0x34')]);}_0x1449f2['order']=qs['sort'](_0x4ba8de[_0x24fc('0x52')][_0x24fc('0x5c')]);_0x1449f2[_0x24fc('0x5d')]=qs[_0x24fc('0x5e')](_['pick'](_0x4ba8de[_0x24fc('0x52')],_0x43492b['filters']));_0x1449f2[_0x24fc('0x5d')][_0x24fc('0xc5')]=_0x5a41d8['id'];if(_0x4ba8de[_0x24fc('0x52')]['filter']){_0x1449f2[_0x24fc('0x5d')]=_[_0x24fc('0x41')](_0x1449f2[_0x24fc('0x5d')],{'$or':_[_0x24fc('0x47')](_0x1449f2['attributes'],function(_0x4ae822){var _0x545714={};_0x545714[_0x4ae822]={'$like':'%'+_0x4ba8de[_0x24fc('0x52')][_0x24fc('0x9a')]+'%'};return _0x545714;})});}_0x1449f2[_0x24fc('0x5d')]['secret']=![];if(_0x4ba8de[_0x24fc('0x52')]['id']){_0x1449f2[_0x24fc('0x5d')]['id']={'$gt':_0x4ba8de['query']['id']};}_0x1449f2=_[_0x24fc('0x41')]({},_0x1449f2,_0x4ba8de[_0x24fc('0xca')]);return db[_0x24fc('0xde')][_0x24fc('0x36')]({'where':_0x1449f2['where']})['then'](function(_0x12921f){_0x487e55[_0x24fc('0x36')]=_0x12921f;_0x1449f2['include']=[];if(_0x4ba8de[_0x24fc('0x52')][_0x24fc('0x11f')]){_0x1449f2[_0x24fc('0x11c')]['push']({'model':db[_0x24fc('0xfd')],'as':_0x24fc('0xfd'),'attributes':['id','fullname','alias']});}if(_0x4ba8de[_0x24fc('0x52')][_0x24fc('0xc9')]){_0x1449f2[_0x24fc('0x11c')]=[{'all':!![]}];}return db[_0x24fc('0xde')][_0x24fc('0x11d')](_0x1449f2);})[_0x24fc('0x24')](function(_0x214f7d){_0x487e55[_0x24fc('0xc7')]=_0x214f7d;return _0x487e55;});}})[_0x24fc('0x24')](respondWithFilteredResult(_0x53e48e,_0x1449f2))[_0x24fc('0x2f')](handleError(_0x53e48e,null));};exports[_0x24fc('0x120')]=function(_0x1a7f96,_0x59d246,_0x281eed){return db[_0x24fc('0x4e')]['find']({'where':{'id':_0x1a7f96[_0x24fc('0xc8')]['id']}})[_0x24fc('0x24')](handleEntityNotFound(_0x59d246,null))['then'](function(_0x4e2c71){if(_0x4e2c71){return _0x4e2c71[_0x24fc('0x121')](_0x1a7f96['body'][_0x24fc('0x118')],_['omit'](_0x1a7f96[_0x24fc('0x42')],['ids','id'])||{})[_0x24fc('0x122')](function(){return db[_0x24fc('0x123')][_0x24fc('0x11d')]({'attributes':['id',_0x24fc('0x3e'),_0x24fc('0x61')],'where':{'id':_0x1a7f96[_0x24fc('0x42')][_0x24fc('0x118')]}});})[_0x24fc('0x24')](function(_0x3c5996){socket['emit']('chatInteractionTags:save',{'id':Number(_0x1a7f96['params']['id']),'tags':_0x3c5996||[]});return{'id':Number(_0x1a7f96[_0x24fc('0xc8')]['id']),'tags':_0x3c5996||[]};});}})[_0x24fc('0x24')](respondWithResult(_0x59d246,null))[_0x24fc('0x2f')](handleError(_0x59d246,null));};exports['removeTags']=function(_0x8dc31b,_0x5941bd,_0x4d73bb){return db[_0x24fc('0x4e')][_0x24fc('0x77')]({'where':{'id':_0x8dc31b[_0x24fc('0xc8')]['id']}})['then'](handleEntityNotFound(_0x5941bd,null))[_0x24fc('0x24')](function(_0x464057){if(_0x464057){return _0x464057[_0x24fc('0x124')](_0x8dc31b[_0x24fc('0x52')][_0x24fc('0x118')]);}})[_0x24fc('0x24')](respondWithStatusCode(_0x5941bd,null))['catch'](handleError(_0x5941bd,null));};exports[_0x24fc('0xf6')]=function(_0x9c34d9,_0x3e4f49){var _0x231f0b=moment()[_0x24fc('0x125')]()['toString']();var _0x34355e=path[_0x24fc('0xf3')](config[_0x24fc('0xf1')],_0x24fc('0x126'),_0x24fc('0x127'),'tmp');var _0x4d0910=path[_0x24fc('0xf3')](config[_0x24fc('0xf1')],'server','files',_0x24fc('0x128'));var _0x49025e=path[_0x24fc('0xf3')](_0x34355e,_0x231f0b);var _0x2c9a19=util['format'](_0x24fc('0x129'),_0x9c34d9['params']['id'],_0x231f0b);var _0x38ca24=path['join'](_0x34355e,_0x2c9a19);var _0x53a9aa=[];_0x53a9aa['push']({'model':db['User'],'as':_0x24fc('0xfd'),'attributes':['id',_0x24fc('0x48')],'raw':!![]});_0x53a9aa['push']({'model':db[_0x24fc('0xe2')],'as':_0x24fc('0x7b'),'attributes':['id',_0x24fc('0x12a'),_0x24fc('0x12b')],'raw':!![]});if(_0x9c34d9[_0x24fc('0x52')]['attachments']){_0x53a9aa[_0x24fc('0x4d')]({'model':db[_0x24fc('0xee')],'as':_0x24fc('0xee'),'raw':!![]});}var _0x2139e8=[{'model':db[_0x24fc('0xde')],'as':_0x24fc('0xfc'),'attributes':['id',_0x24fc('0x42'),'createdAt',_0x24fc('0x12c'),_0x24fc('0x107'),_0x24fc('0x95')],'include':_0x53a9aa}];_0x2139e8[_0x24fc('0x4d')]({'model':db['ChatWebsite'],'as':_0x24fc('0x12d'),'attributes':['id',_0x24fc('0x3e')]});_0x2139e8[_0x24fc('0x4d')]({'model':db[_0x24fc('0xfd')],'as':_0x24fc('0x12e'),'attributes':['id','fullname']});return db[_0x24fc('0x4e')]['find']({'where':{'id':_0x9c34d9[_0x24fc('0xc8')]['id']},'include':_0x2139e8})[_0x24fc('0x24')](handleEntityNotFound(_0x3e4f49,null))[_0x24fc('0x24')](function(_0x26179a){if(_0x26179a){var _0x6f1617=_0x26179a['get']({'plain':!![]});fs[_0x24fc('0x12f')](_0x49025e);var _0x57dfbc={'channel':'Chat','account':_0x6f1617['Account'][_0x24fc('0x3e')],'agent':_0x6f1617[_0x24fc('0x12e')]?_0x6f1617[_0x24fc('0x12e')][_0x24fc('0x48')]:_0x24fc('0x130'),'createdAt':moment(_0x6f1617[_0x24fc('0x8e')])[_0x24fc('0xf9')](_0x24fc('0x11b'))[_0x24fc('0xad')](),'closedAt':_0x6f1617[_0x24fc('0xe7')]?moment(_0x6f1617[_0x24fc('0x131')])[_0x24fc('0xf9')](_0x24fc('0x11b'))['toString']():'','disposition':_0x6f1617['disposition'],'chatInfo':{'browser':_0x6f1617['browserName'],'os':_0x6f1617['osName'],'referer':_0x6f1617['referer'],'customerIp':_0x6f1617[_0x24fc('0x132')],'customerPort':_0x6f1617[_0x24fc('0x133')]?_0x6f1617[_0x24fc('0x133')]:_0x24fc('0x130')},'messages':_(_0x6f1617['Messages'])['tail']()[_0x24fc('0x9a')]({'secret':![]})[_0x24fc('0x47')](function(_0x2ee9a6){if(_0x2ee9a6[_0x24fc('0xee')]){var _0x40409c=path['join'](_0x4d0910,_0x2ee9a6[_0x24fc('0xee')][_0x24fc('0xf5')]);if(fs[_0x24fc('0x134')](_0x40409c)){fs['createReadStream'](_0x40409c)['pipe'](fs[_0x24fc('0x135')](path[_0x24fc('0xf3')](_0x49025e,_0x2ee9a6[_0x24fc('0xee')][_0x24fc('0xf5')])));}}return{'date':moment(_0x2ee9a6[_0x24fc('0x8e')])[_0x24fc('0xf9')](_0x24fc('0x11b'))['toString'](),'sender':_0x2ee9a6[_0x24fc('0x12c')]===_0x24fc('0x136')?_0x2ee9a6[_0x24fc('0xfd')]?_0x2ee9a6[_0x24fc('0xfd')]['fullname']:'System':_0x2ee9a6['Contact']['firstName']+(_0x2ee9a6['Contact'][_0x24fc('0x12b')]?'\x20'+_0x2ee9a6[_0x24fc('0x7b')]['lastName']:''),'body':_0x2ee9a6[_0x24fc('0xee')]?_0x2ee9a6[_0x24fc('0xee')]['basename']:_0x2ee9a6[_0x24fc('0x42')],'direction':_0x2ee9a6['direction']===_0x24fc('0x136')?'A':'C','secret':_0x2ee9a6[_0x24fc('0x107')],'read':_0x2ee9a6[_0x24fc('0x95')],'attachment':_0x2ee9a6['Attachment']};})[_0x24fc('0x7e')]()};return ejs[_0x24fc('0x137')](path['join'](config[_0x24fc('0xf1')],'server','views',_0x24fc('0x138')),{'interaction':_0x57dfbc})[_0x24fc('0x24')](function(_0x24101d){var _0x5defce=path[_0x24fc('0xf3')](_0x49025e,_0x24fc('0x139')+_0x6f1617['id']+'-'+_0x231f0b+_0x24fc('0x13a'));var _0x187770={'path':_0x5defce,'channel':_0x24fc('0x13b'),'interactionId':_0x6f1617['id']};return pdf['createPdfFromHTML'](_0x24101d,_0x187770);})['then'](function(){return new BPromise(function(_0x3357cb,_0x2b633b){zipdir(_0x49025e,{'saveTo':_0x38ca24},function(_0x4ad7c4,_0x1d8b26){if(_0x4ad7c4)return _0x2b633b(_0x4ad7c4);return _0x3357cb(_0x1d8b26);});})[_0x24fc('0x24')](function(){return new BPromise(function(_0x4b0f8b,_0x59d408){rimraf(_0x49025e,function(_0x547f6b){if(_0x547f6b)_0x59d408(_0x547f6b);return _0x4b0f8b();});});})[_0x24fc('0x24')](function(){return _0x3e4f49[_0x24fc('0xf6')](_0x38ca24,_0x2c9a19,function(_0x3a2ffd){if(_0x3a2ffd){console[_0x24fc('0x13c')](_0x24fc('0x13d'),_0x3a2ffd);}else{fs[_0x24fc('0x13e')](_0x38ca24);}});});});}else{return _0x3e4f49[_0x24fc('0x30')](0xc8);}})['catch'](handleError(_0x3e4f49,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index d5619ba..fb22f22 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 _0x4d80=['hasOwnProperty','exports','../../mysqldb','ChatInteraction','setMaxListeners','save','update','getUsers','then','setDataValue','map','unreadMessages','length','emit','catch'];(function(_0x5aca7e,_0x27314b){var _0x2f922a=function(_0x471b3c){while(--_0x471b3c){_0x5aca7e['push'](_0x5aca7e['shift']());}};_0x2f922a(++_0x27314b);}(_0x4d80,0x101));var _0x04d8=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x4d80[_0x2641f9];return _0x585741;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x04d8('0x0'))['db'][_0x04d8('0x1')];var ChatMessage=require(_0x04d8('0x0'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x04d8('0x2')](0x0);var events={'afterCreate':_0x04d8('0x3'),'afterUpdate':_0x04d8('0x4'),'afterDestroy':'remove'};function emitEvent(_0x48edc0){return function(_0x2940be,_0x5c89d8,_0x54b0bd){_0x2940be[_0x04d8('0x5')]({'attributes':['id'],'raw':!![]})[_0x04d8('0x6')](function(_0x1cb21c){_0x2940be[_0x04d8('0x7')]('Users',_0x1cb21c[_0x04d8('0x8')](function(_0x4859d6){return{'id':_0x4859d6['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x2940be['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x4bc617){_0x2940be[_0x04d8('0x7')](_0x04d8('0x9'),_0x4bc617[_0x04d8('0xa')]);ChatInteractionEvents[_0x04d8('0xb')](_0x48edc0+':'+_0x2940be['id'],_0x2940be);ChatInteractionEvents[_0x04d8('0xb')](_0x48edc0,_0x2940be);_0x54b0bd(null);})[_0x04d8('0xc')](_0x54b0bd(null));};}for(var e in events){if(events[_0x04d8('0xd')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x04d8('0xe')]=ChatInteractionEvents; \ No newline at end of file +var _0x10ed=['hook','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','update','getUsers','setDataValue','Users','map','findAll','then','unreadMessages','length','emit','hasOwnProperty'];(function(_0x30c820,_0x24dd58){var _0x574c75=function(_0x5d04ad){while(--_0x5d04ad){_0x30c820['push'](_0x30c820['shift']());}};_0x574c75(++_0x24dd58);}(_0x10ed,0x166));var _0xd10e=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x10ed[_0x8c43de];return _0xa6591b;};'use strict';var EventEmitter=require(_0xd10e('0x0'));var ChatInteraction=require(_0xd10e('0x1'))['db'][_0xd10e('0x2')];var ChatMessage=require(_0xd10e('0x1'))['db'][_0xd10e('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xd10e('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd10e('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5e8635){return function(_0x55d4f1,_0x1ec9e0,_0x3a9327){_0x55d4f1[_0xd10e('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x58e044){_0x55d4f1[_0xd10e('0x7')](_0xd10e('0x8'),_0x58e044[_0xd10e('0x9')](function(_0x56d291){return{'id':_0x56d291['id']};}));return ChatMessage[_0xd10e('0xa')]({'where':{'ChatInteractionId':_0x55d4f1['id'],'direction':'in','read':![]},'raw':!![]});})[_0xd10e('0xb')](function(_0x522b9f){_0x55d4f1['setDataValue'](_0xd10e('0xc'),_0x522b9f[_0xd10e('0xd')]);ChatInteractionEvents['emit'](_0x5e8635+':'+_0x55d4f1['id'],_0x55d4f1);ChatInteractionEvents[_0xd10e('0xe')](_0x5e8635,_0x55d4f1);_0x3a9327(null);})['catch'](_0x3a9327(null));};}for(var e in events){if(events[_0xd10e('0xf')](e)){var event=events[e];ChatInteraction[_0xd10e('0x10')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 668ae38..f04a687 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 _0x17af=['../../config/environment','exports','ChatInteraction','changed','closed','closedAt','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4e3a76,_0x300f90){var _0x547038=function(_0x1fd6a2){while(--_0x1fd6a2){_0x4e3a76['push'](_0x4e3a76['shift']());}};_0x547038(++_0x300f90);}(_0x17af,0x17e));var _0xf17a=function(_0x1c270a,_0x378796){_0x1c270a=_0x1c270a-0x0;var _0x2607b8=_0x17af[_0x1c270a];return _0x2607b8;};'use strict';var _=require(_0xf17a('0x0'));var util=require(_0xf17a('0x1'));var logger=require(_0xf17a('0x2'))(_0xf17a('0x3'));var moment=require(_0xf17a('0x4'));var BPromise=require(_0xf17a('0x5'));var rp=require(_0xf17a('0x6'));var fs=require('fs');var path=require(_0xf17a('0x7'));var rimraf=require(_0xf17a('0x8'));var config=require(_0xf17a('0x9'));var attributes=require('./chatInteraction.attributes');module[_0xf17a('0xa')]=function(_0x4d42eb,_0xb3284){return _0x4d42eb['define'](_0xf17a('0xb'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x20b8b4,_0x5afb57,_0x24d425){if(_0x20b8b4[_0xf17a('0xc')](_0xf17a('0xd'))){_0x20b8b4[_0xf17a('0xe')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x24d425(null,_0x20b8b4);}},'charset':_0xf17a('0xf'),'collate':_0xf17a('0x10')});}; \ No newline at end of file +var _0x0680=['./chatInteraction.attributes','exports','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x41ab5c,_0x14800f){var _0xab348=function(_0x46ea20){while(--_0x46ea20){_0x41ab5c['push'](_0x41ab5c['shift']());}};_0xab348(++_0x14800f);}(_0x0680,0xa2));var _0x0068=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0680[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x0068('0x0'));var logger=require(_0x0068('0x1'))(_0x0068('0x2'));var moment=require(_0x0068('0x3'));var BPromise=require(_0x0068('0x4'));var rp=require(_0x0068('0x5'));var fs=require('fs');var path=require(_0x0068('0x6'));var rimraf=require('rimraf');var config=require(_0x0068('0x7'));var attributes=require(_0x0068('0x8'));module[_0x0068('0x9')]=function(_0x237a89,_0x209cfa){return _0x237a89['define']('ChatInteraction',attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4c9857,_0x97c359,_0x3b1388){if(_0x4c9857[_0x0068('0xa')](_0x0068('0xb'))){_0x4c9857[_0x0068('0xc')]=moment()[_0x0068('0xd')](_0x0068('0xe'));}_0x3b1388(null,_0x4c9857);}},'charset':_0x0068('0xf'),'collate':_0x0068('0x10')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 7b7171f..6e62989 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 _0xe2e7=['spread','AddTags','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','request','info','ChatInteraction,\x20%s,\x20%s','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','UpdateChatInteraction','update','body','options','raw','where','attributes','limit','then','debug','stringify','ChatInteraction','find','addTags','omit'];(function(_0x872b02,_0x4f4458){var _0x1a6b24=function(_0x1dfb4e){while(--_0x1dfb4e){_0x872b02['push'](_0x872b02['shift']());}};_0x1a6b24(++_0x4f4458);}(_0xe2e7,0x128));var _0x7e2e=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xe2e7[_0x1cc8fe];return _0x230054;};'use strict';var _=require('lodash');var util=require(_0x7e2e('0x0'));var moment=require(_0x7e2e('0x1'));var BPromise=require(_0x7e2e('0x2'));var rs=require(_0x7e2e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7e2e('0x4'))['db'];var utils=require(_0x7e2e('0x5'));var logger=require(_0x7e2e('0x6'))(_0x7e2e('0x7'));var config=require(_0x7e2e('0x8'));var jayson=require(_0x7e2e('0x9'));var client=jayson['client'][_0x7e2e('0xa')]({'port':0x232a});config[_0x7e2e('0xb')]=_[_0x7e2e('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x7e2e('0xd'))(new Redis(config[_0x7e2e('0xb')]));require(_0x7e2e('0xe'))[_0x7e2e('0xf')](socket);function respondWithRpcPromise(_0x38ccbe,_0x393540,_0x46d5fd){return new BPromise(function(_0x1aa136,_0x1c3fb7){return client[_0x7e2e('0x10')](_0x38ccbe,_0x46d5fd)['then'](function(_0x4f8ebf){logger[_0x7e2e('0x11')](_0x7e2e('0x12'),_0x393540,'request\x20sent');logger['debug'](_0x7e2e('0x13'),_0x393540,_0x7e2e('0x14'),JSON['stringify'](_0x4f8ebf));if(_0x4f8ebf[_0x7e2e('0x15')]){if(_0x4f8ebf['error']['code']===0x1f4){logger[_0x7e2e('0x15')](_0x7e2e('0x12'),_0x393540,_0x4f8ebf[_0x7e2e('0x15')][_0x7e2e('0x16')]);return _0x1c3fb7(_0x4f8ebf['error'][_0x7e2e('0x16')]);}logger[_0x7e2e('0x15')](_0x7e2e('0x12'),_0x393540,_0x4f8ebf[_0x7e2e('0x15')]['message']);return _0x1aa136(_0x4f8ebf[_0x7e2e('0x15')][_0x7e2e('0x16')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x393540,_0x7e2e('0x14'));_0x1aa136(_0x4f8ebf[_0x7e2e('0x17')][_0x7e2e('0x16')]);}})[_0x7e2e('0x18')](function(_0x1b89b0){logger[_0x7e2e('0x15')](_0x7e2e('0x12'),_0x393540,_0x1b89b0);_0x1c3fb7(_0x1b89b0);});});}exports[_0x7e2e('0x19')]=function(_0x10a30a){var _0x4d5d9a=this;return new Promise(function(_0x90c9e2,_0x4a89ac){return db['ChatInteraction'][_0x7e2e('0x1a')](_0x10a30a[_0x7e2e('0x1b')],{'raw':_0x10a30a['options']?_0x10a30a[_0x7e2e('0x1c')][_0x7e2e('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x10a30a[_0x7e2e('0x1c')]?_0x10a30a[_0x7e2e('0x1c')][_0x7e2e('0x1e')]||null:null,'attributes':_0x10a30a['options']?_0x10a30a['options'][_0x7e2e('0x1f')]||null:null,'limit':_0x10a30a[_0x7e2e('0x1c')]?_0x10a30a['options'][_0x7e2e('0x20')]||null:null})[_0x7e2e('0x21')](function(_0x48dc12){logger[_0x7e2e('0x11')](_0x7e2e('0x19'),_0x10a30a);logger[_0x7e2e('0x22')](_0x7e2e('0x19'),_0x10a30a,JSON[_0x7e2e('0x23')](_0x48dc12));_0x90c9e2(_0x48dc12);})['catch'](function(_0xd36aeb){logger[_0x7e2e('0x15')](_0x7e2e('0x19'),_0xd36aeb[_0x7e2e('0x16')],_0x10a30a);_0x4a89ac(_0x4d5d9a[_0x7e2e('0x15')](0x1f4,_0xd36aeb[_0x7e2e('0x16')]));});});};exports['AddTagsToChatInteraction']=function(_0x14ef45){return new Promise(function(_0x30e9e4,_0x240b83){return db[_0x7e2e('0x24')][_0x7e2e('0x25')]({'where':_0x14ef45[_0x7e2e('0x1c')]?_0x14ef45[_0x7e2e('0x1c')][_0x7e2e('0x1e')]||null:null})['then'](function(_0x4d736a){if(_0x4d736a){return _0x4d736a[_0x7e2e('0x26')](_0x14ef45['body']['ids'],_[_0x7e2e('0x27')](_0x14ef45[_0x7e2e('0x1b')],['ids','id'])||{});}})[_0x7e2e('0x28')](function(_0x916df9){logger[_0x7e2e('0x11')](_0x7e2e('0x29'),_0x14ef45);logger[_0x7e2e('0x22')](_0x7e2e('0x29'),_0x14ef45,JSON[_0x7e2e('0x23')](_0x916df9));_0x30e9e4(_0x916df9);})[_0x7e2e('0x18')](function(_0x5d4726){logger[_0x7e2e('0x15')]('AddTags',_0x5d4726[_0x7e2e('0x16')],_0x14ef45);_0x240b83(_this[_0x7e2e('0x15')](0x1f4,_0x5d4726[_0x7e2e('0x16')]));});});}; \ No newline at end of file +var _0xbae1=['register','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateChatInteraction','ChatInteraction','update','options','where','limit','stringify','AddTagsToChatInteraction','find','then','body','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','socket.io-emitter'];(function(_0x394114,_0x3cc56c){var _0x554ed4=function(_0x15f060){while(--_0x15f060){_0x394114['push'](_0x394114['shift']());}};_0x554ed4(++_0x3cc56c);}(_0xbae1,0xbf));var _0x1bae=function(_0x27b2b1,_0x23466d){_0x27b2b1=_0x27b2b1-0x0;var _0x44640e=_0xbae1[_0x27b2b1];return _0x44640e;};'use strict';var _=require(_0x1bae('0x0'));var util=require(_0x1bae('0x1'));var moment=require(_0x1bae('0x2'));var BPromise=require(_0x1bae('0x3'));var rs=require(_0x1bae('0x4'));var fs=require('fs');var Redis=require(_0x1bae('0x5'));var db=require(_0x1bae('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1bae('0x7'))(_0x1bae('0x8'));var config=require(_0x1bae('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1bae('0xa')][_0x1bae('0xb')]({'port':0x232a});config[_0x1bae('0xc')]=_['defaults'](config[_0x1bae('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x1bae('0xd'))(new Redis(config[_0x1bae('0xc')]));require('./chatInteraction.socket')[_0x1bae('0xe')](socket);function respondWithRpcPromise(_0x178976,_0x1ed8b6,_0x14809f){return new BPromise(function(_0xfb0767,_0x4b8773){return client[_0x1bae('0xf')](_0x178976,_0x14809f)['then'](function(_0x4ab555){logger[_0x1bae('0x10')](_0x1bae('0x11'),_0x1ed8b6,_0x1bae('0x12'));logger[_0x1bae('0x13')](_0x1bae('0x14'),_0x1ed8b6,_0x1bae('0x12'),JSON['stringify'](_0x4ab555));if(_0x4ab555['error']){if(_0x4ab555[_0x1bae('0x15')][_0x1bae('0x16')]===0x1f4){logger[_0x1bae('0x15')](_0x1bae('0x11'),_0x1ed8b6,_0x4ab555[_0x1bae('0x15')][_0x1bae('0x17')]);return _0x4b8773(_0x4ab555[_0x1bae('0x15')][_0x1bae('0x17')]);}logger[_0x1bae('0x15')](_0x1bae('0x11'),_0x1ed8b6,_0x4ab555['error']['message']);return _0xfb0767(_0x4ab555[_0x1bae('0x15')][_0x1bae('0x17')]);}else{logger[_0x1bae('0x10')](_0x1bae('0x11'),_0x1ed8b6,_0x1bae('0x12'));_0xfb0767(_0x4ab555[_0x1bae('0x18')][_0x1bae('0x17')]);}})[_0x1bae('0x19')](function(_0x3d9d1c){logger['error'](_0x1bae('0x11'),_0x1ed8b6,_0x3d9d1c);_0x4b8773(_0x3d9d1c);});});}exports[_0x1bae('0x1a')]=function(_0x5695f1){var _0x5387df=this;return new Promise(function(_0x46c28c,_0x7184ce){return db[_0x1bae('0x1b')][_0x1bae('0x1c')](_0x5695f1['body'],{'raw':_0x5695f1[_0x1bae('0x1d')]?_0x5695f1[_0x1bae('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5695f1[_0x1bae('0x1d')]?_0x5695f1[_0x1bae('0x1d')][_0x1bae('0x1e')]||null:null,'attributes':_0x5695f1[_0x1bae('0x1d')]?_0x5695f1[_0x1bae('0x1d')]['attributes']||null:null,'limit':_0x5695f1[_0x1bae('0x1d')]?_0x5695f1['options'][_0x1bae('0x1f')]||null:null})['then'](function(_0x190cfd){logger[_0x1bae('0x10')](_0x1bae('0x1a'),_0x5695f1);logger[_0x1bae('0x13')](_0x1bae('0x1a'),_0x5695f1,JSON[_0x1bae('0x20')](_0x190cfd));_0x46c28c(_0x190cfd);})[_0x1bae('0x19')](function(_0x33d291){logger[_0x1bae('0x15')](_0x1bae('0x1a'),_0x33d291[_0x1bae('0x17')],_0x5695f1);_0x7184ce(_0x5387df['error'](0x1f4,_0x33d291[_0x1bae('0x17')]));});});};exports[_0x1bae('0x21')]=function(_0x53ea31){return new Promise(function(_0x45cbec,_0x35c3fe){return db['ChatInteraction'][_0x1bae('0x22')]({'where':_0x53ea31['options']?_0x53ea31[_0x1bae('0x1d')][_0x1bae('0x1e')]||null:null})[_0x1bae('0x23')](function(_0x2f6fc9){if(_0x2f6fc9){return _0x2f6fc9['addTags'](_0x53ea31[_0x1bae('0x24')][_0x1bae('0x25')],_[_0x1bae('0x26')](_0x53ea31[_0x1bae('0x24')],['ids','id'])||{});}})[_0x1bae('0x27')](function(_0x226f5e){logger[_0x1bae('0x10')](_0x1bae('0x28'),_0x53ea31);logger[_0x1bae('0x13')](_0x1bae('0x28'),_0x53ea31,JSON['stringify'](_0x226f5e));_0x45cbec(_0x226f5e);})[_0x1bae('0x19')](function(_0x56adc2){logger['error'](_0x1bae('0x28'),_0x56adc2[_0x1bae('0x17')],_0x53ea31);_0x35c3fe(_this[_0x1bae('0x15')](0x1f4,_0x56adc2[_0x1bae('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 220f234..d7a3257 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 _0xe4c7=['update','emit','register','chatInteraction:','./chatInteraction.events','save','remove'];(function(_0xe76df0,_0x5b07f9){var _0x23011a=function(_0x1c9604){while(--_0x1c9604){_0xe76df0['push'](_0xe76df0['shift']());}};_0x23011a(++_0x5b07f9);}(_0xe4c7,0x1d2));var _0x7e4c=function(_0x32c57d,_0x4b455a){_0x32c57d=_0x32c57d-0x0;var _0x353d7f=_0xe4c7[_0x32c57d];return _0x353d7f;};'use strict';var ChatInteractionEvents=require(_0x7e4c('0x0'));var events=[_0x7e4c('0x1'),_0x7e4c('0x2'),_0x7e4c('0x3')];function createListener(_0x3aeff1,_0x2d294c){return function(_0x5123a7){_0x2d294c[_0x7e4c('0x4')](_0x3aeff1,_0x5123a7);};}function removeListener(_0xfc6b9e,_0x1ae8f4){return function(){ChatInteractionEvents['removeListener'](_0xfc6b9e,_0x1ae8f4);};}exports[_0x7e4c('0x5')]=function(_0x305963){for(var _0x40b497=0x0,_0x4db23c=events['length'];_0x40b497<_0x4db23c;_0x40b497++){var _0x5a5bb4=events[_0x40b497];var _0x2ca5b6=createListener(_0x7e4c('0x6')+_0x5a5bb4,_0x305963);ChatInteractionEvents['on'](_0x5a5bb4,_0x2ca5b6);}}; \ No newline at end of file +var _0x087a=['remove','update','emit','register','chatInteraction:','./chatInteraction.events','save'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x087a,0xde));var _0xa087=function(_0x1bba7f,_0xaef721){_0x1bba7f=_0x1bba7f-0x0;var _0x4f0565=_0x087a[_0x1bba7f];return _0x4f0565;};'use strict';var ChatInteractionEvents=require(_0xa087('0x0'));var events=[_0xa087('0x1'),_0xa087('0x2'),_0xa087('0x3')];function createListener(_0x74bb24,_0x224d7c){return function(_0x49103f){_0x224d7c[_0xa087('0x4')](_0x74bb24,_0x49103f);};}function removeListener(_0x5c37a3,_0x5d4ab6){return function(){ChatInteractionEvents['removeListener'](_0x5c37a3,_0x5d4ab6);};}exports[_0xa087('0x5')]=function(_0xc05115){for(var _0xc8eecc=0x0,_0x274af8=events['length'];_0xc8eecc<_0x274af8;_0xc8eecc++){var _0x5ec885=events[_0xc8eecc];var _0x4c8ad8=createListener(_0xa087('0x6')+_0x5ec885,_0xc05115);ChatInteractionEvents['on'](_0x5ec885,_0x4c8ad8);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 8bf9464..a5c95de 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 _0xae15=['chatinteraction:destroy','destroy','/:id/tags','removeTags','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','download','create','post','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace','/:id/attachment_upload','single','file','tracked','chat','chatinteraction:addtags','addTags','put','/:id/custom_update','/:id/abandon','abandon','/:id/close','delete'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0xae15,0xd8));var _0x5ae1=function(_0x4b57c0,_0x2fb59f){_0x4b57c0=_0x4b57c0-0x0;var _0x59172f=_0xae15[_0x4b57c0];return _0x59172f;};'use strict';var multer=require(_0x5ae1('0x0'));var util=require('util');var path=require(_0x5ae1('0x1'));var timeout=require(_0x5ae1('0x2'));var express=require(_0x5ae1('0x3'));var router=express['Router']();var fs_extra=require(_0x5ae1('0x4'));var auth=require(_0x5ae1('0x5'));var interaction=require(_0x5ae1('0x6'));var config=require(_0x5ae1('0x7'));var controller=require('./chatInteraction.controller');router['get']('/',auth[_0x5ae1('0x8')](),controller[_0x5ae1('0x9')]);router[_0x5ae1('0xa')](_0x5ae1('0xb'),auth[_0x5ae1('0x8')](),controller[_0x5ae1('0xc')]);router[_0x5ae1('0xa')](_0x5ae1('0xd'),auth['isChatInteractionAuthorized'](),controller[_0x5ae1('0xe')]);router[_0x5ae1('0xa')](_0x5ae1('0xf'),auth[_0x5ae1('0x10')](),controller[_0x5ae1('0x11')]);router[_0x5ae1('0xa')](_0x5ae1('0x12'),auth[_0x5ae1('0x8')](),controller[_0x5ae1('0x13')]);router[_0x5ae1('0xa')](_0x5ae1('0x14'),auth['isChatInteractionAuthorized'](),controller[_0x5ae1('0x15')]);router[_0x5ae1('0xa')]('/:id/download',auth[_0x5ae1('0x8')](),controller[_0x5ae1('0x16')]);router['post']('/',auth[_0x5ae1('0x8')](),controller[_0x5ae1('0x17')]);router[_0x5ae1('0x18')](_0x5ae1('0x19'),auth[_0x5ae1('0x8')](),controller[_0x5ae1('0x1a')]);var upload=multer({'storage':multer[_0x5ae1('0x1b')]({'destination':function(_0x7feb38,_0xebb702,_0x563a0c){_0x563a0c(null,path[_0x5ae1('0x1c')](config[_0x5ae1('0x1d')],_0x5ae1('0x1e')));},'filename':function(_0x2f83a6,_0x3380e9,_0x5d802a){_0x5d802a(null,util[_0x5ae1('0x1f')](_0x5ae1('0x20'),Date[_0x5ae1('0x21')](),_0x3380e9[_0x5ae1('0x22')][_0x5ae1('0x23')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x5ae1('0x24'),upload[_0x5ae1('0x25')](_0x5ae1('0x26')),controller['attachmentUpload']);router[_0x5ae1('0x18')](_0x5ae1('0x12'),auth[_0x5ae1('0x10')](),controller['addMessage']);router[_0x5ae1('0x18')]('/:id/tags',auth[_0x5ae1('0x8')](),interaction[_0x5ae1('0x27')](_0x5ae1('0x28'),_0x5ae1('0x29')),controller[_0x5ae1('0x2a')]);router[_0x5ae1('0x2b')](_0x5ae1('0xd'),auth['isAuthenticated'](),interaction[_0x5ae1('0x27')](_0x5ae1('0x28'),'chatinteraction:update'),controller['update']);router[_0x5ae1('0x2b')](_0x5ae1('0x2c'),controller['customUpdate']);router[_0x5ae1('0x2b')](_0x5ae1('0x2d'),auth['isChatInteractionAuthorized'](),controller[_0x5ae1('0x2e')]);router[_0x5ae1('0x2b')](_0x5ae1('0x2f'),controller['close']);router[_0x5ae1('0x30')](_0x5ae1('0xd'),auth['isAuthenticated'](),interaction[_0x5ae1('0x27')]('chat',_0x5ae1('0x31')),controller[_0x5ae1('0x32')]);router['delete'](_0x5ae1('0x33'),auth[_0x5ae1('0x8')](),controller[_0x5ae1('0x34')]);module['exports']=router; \ No newline at end of file +var _0x4dc2=['removeTags','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','index','get','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','isAuthenticated','/:id/my_messages','getMyMessages','/:id/download','download','post','/:id/vidaoo','diskStorage','join','server/files/attachments/','format','now','single','file','addMessage','/:id/tags','chat','chatinteraction:addtags','addTags','put','update','/:id/custom_update','customUpdate','/:id/abandon','/:id/close','close','tracked','chatinteraction:destroy','destroy','delete'];(function(_0x41070f,_0x3374e0){var _0x2b8c16=function(_0x209e75){while(--_0x209e75){_0x41070f['push'](_0x41070f['shift']());}};_0x2b8c16(++_0x3374e0);}(_0x4dc2,0xc9));var _0x24dc=function(_0x26f864,_0x108da5){_0x26f864=_0x26f864-0x0;var _0x4e6ff7=_0x4dc2[_0x26f864];return _0x4e6ff7;};'use strict';var multer=require('multer');var util=require(_0x24dc('0x0'));var path=require(_0x24dc('0x1'));var timeout=require(_0x24dc('0x2'));var express=require(_0x24dc('0x3'));var router=express[_0x24dc('0x4')]();var fs_extra=require(_0x24dc('0x5'));var auth=require(_0x24dc('0x6'));var interaction=require(_0x24dc('0x7'));var config=require('../../config/environment');var controller=require(_0x24dc('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x24dc('0x9')]);router[_0x24dc('0xa')](_0x24dc('0xb'),auth['isAuthenticated'](),controller[_0x24dc('0xc')]);router[_0x24dc('0xa')](_0x24dc('0xd'),auth[_0x24dc('0xe')](),controller[_0x24dc('0xf')]);router[_0x24dc('0xa')](_0x24dc('0x10'),auth[_0x24dc('0xe')](),controller[_0x24dc('0x11')]);router[_0x24dc('0xa')](_0x24dc('0x12'),auth[_0x24dc('0x13')](),controller['getMessages']);router[_0x24dc('0xa')](_0x24dc('0x14'),auth[_0x24dc('0xe')](),controller[_0x24dc('0x15')]);router[_0x24dc('0xa')](_0x24dc('0x16'),auth[_0x24dc('0x13')](),controller[_0x24dc('0x17')]);router[_0x24dc('0x18')]('/',auth[_0x24dc('0x13')](),controller['create']);router[_0x24dc('0x18')](_0x24dc('0x19'),auth[_0x24dc('0x13')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x24dc('0x1a')]({'destination':function(_0x11c8d2,_0x75aade,_0x2f22c9){_0x2f22c9(null,path[_0x24dc('0x1b')](config['root'],_0x24dc('0x1c')));},'filename':function(_0xfa6ae0,_0x1a6a90,_0x14b575){_0x14b575(null,util[_0x24dc('0x1d')]('%s-%s',Date[_0x24dc('0x1e')](),_0x1a6a90['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x24dc('0x18')]('/:id/attachment_upload',upload[_0x24dc('0x1f')](_0x24dc('0x20')),controller['attachmentUpload']);router[_0x24dc('0x18')](_0x24dc('0x12'),auth[_0x24dc('0xe')](),controller[_0x24dc('0x21')]);router[_0x24dc('0x18')](_0x24dc('0x22'),auth[_0x24dc('0x13')](),interaction['tracked'](_0x24dc('0x23'),_0x24dc('0x24')),controller[_0x24dc('0x25')]);router[_0x24dc('0x26')](_0x24dc('0xd'),auth[_0x24dc('0x13')](),interaction['tracked'](_0x24dc('0x23'),'chatinteraction:update'),controller[_0x24dc('0x27')]);router[_0x24dc('0x26')](_0x24dc('0x28'),controller[_0x24dc('0x29')]);router[_0x24dc('0x26')](_0x24dc('0x2a'),auth[_0x24dc('0xe')](),controller['abandon']);router[_0x24dc('0x26')](_0x24dc('0x2b'),controller[_0x24dc('0x2c')]);router['delete'](_0x24dc('0xd'),auth['isAuthenticated'](),interaction[_0x24dc('0x2d')](_0x24dc('0x23'),_0x24dc('0x2e')),controller[_0x24dc('0x2f')]);router[_0x24dc('0x30')]('/:id/tags',auth['isAuthenticated'](),controller[_0x24dc('0x31')]);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 350025b..5143866 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 _0x7f3d=['BOOLEAN','INTEGER','TEXT'];(function(_0x312aea,_0x5f50b8){var _0x5ef6c4=function(_0x4f7da){while(--_0x4f7da){_0x312aea['push'](_0x312aea['shift']());}};_0x5ef6c4(++_0x5f50b8);}(_0x7f3d,0x7d));var _0xd7f3=function(_0x3a607e,_0x54d530){_0x3a607e=_0x3a607e-0x0;var _0x37b106=_0x7f3d[_0x3a607e];return _0x37b106;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0xd7f3('0x0')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xd7f3('0x1')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xd7f3('0x2')]}}; \ No newline at end of file +var _0x707a=['TEXT','medium','INTEGER','exports'];(function(_0x8f7d2b,_0x1bebaf){var _0x13c298=function(_0x54717e){while(--_0x54717e){_0x8f7d2b['push'](_0x8f7d2b['shift']());}};_0x13c298(++_0x1bebaf);}(_0x707a,0x137));var _0xa707=function(_0x499c9f,_0x3ebe3c){_0x499c9f=_0x499c9f-0x0;var _0x1f9917=_0x707a[_0x499c9f];return _0x1f9917;};'use strict';var Sequelize=require('sequelize');module[_0xa707('0x0')]={'body':{'type':Sequelize[_0xa707('0x1')](_0xa707('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xa707('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 04cd0ea..88ae874 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 _0x4f5f=['count','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','nolimit','sort','where','pick','filter','VIRTUAL','options','include','rows','catch','show','keys','length','includeAll','merge','find','create','body','params','describe','messages','lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','User','agent','admin','user','userpic','internal','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Agents','userProfileId','autoAssociation','findAll','isEmpty','resourceId','push','ToId','read','-createdAt','all','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','sendStatus','status','end','json','offset'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4f5f,0x12f));var _0xf4f5=function(_0x209fcd,_0x1ecccc){_0x209fcd=_0x209fcd-0x0;var _0x501d5e=_0x4f5f[_0x209fcd];return _0x501d5e;};'use strict';var emlformat=require(_0xf4f5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf4f5('0x1'));var jsonpatch=require(_0xf4f5('0x2'));var rp=require(_0xf4f5('0x3'));var moment=require(_0xf4f5('0x4'));var BPromise=require(_0xf4f5('0x5'));var Mustache=require(_0xf4f5('0x6'));var util=require(_0xf4f5('0x7'));var path=require('path');var sox=require(_0xf4f5('0x8'));var csv=require(_0xf4f5('0x9'));var ejs=require(_0xf4f5('0xa'));var fs=require('fs');var fs_extra=require(_0xf4f5('0xb'));var _=require(_0xf4f5('0xc'));var squel=require(_0xf4f5('0xd'));var crypto=require(_0xf4f5('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xf4f5('0xf'));var toCsv=require(_0xf4f5('0x9'));var querystring=require(_0xf4f5('0x10'));var Papa=require('papaparse');var Redis=require(_0xf4f5('0x11'));var authService=require(_0xf4f5('0x12'));var qs=require(_0xf4f5('0x13'));var as=require(_0xf4f5('0x14'));var hardwareService=require(_0xf4f5('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xf4f5('0x16'));var config=require(_0xf4f5('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xf4f5('0x18'))['db'];config[_0xf4f5('0x19')]=_[_0xf4f5('0x1a')](config['redis'],{'host':_0xf4f5('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf4f5('0x19')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithStatusCode(_0x325b17,_0x51d09a){_0x51d09a=_0x51d09a||0xcc;return function(_0x413b81){if(_0x413b81){return _0x325b17[_0xf4f5('0x1c')](_0x51d09a);}return _0x325b17[_0xf4f5('0x1d')](_0x51d09a)[_0xf4f5('0x1e')]();};}function respondWithResult(_0xbed1ea,_0x1c98e2){_0x1c98e2=_0x1c98e2||0xc8;return function(_0x406692){if(_0x406692){return _0xbed1ea[_0xf4f5('0x1d')](_0x1c98e2)[_0xf4f5('0x1f')](_0x406692);}};}function respondWithFilteredResult(_0x22cc38,_0x4c775c){return function(_0x10dd1a){if(_0x10dd1a){var _0x407f68=typeof _0x4c775c[_0xf4f5('0x20')]==='undefined'&&typeof _0x4c775c['limit']==='undefined';var _0x193eef=_0x10dd1a[_0xf4f5('0x21')];var _0x35a1a3=_0x407f68?0x0:_0x4c775c[_0xf4f5('0x20')];var _0x50389c=_0x407f68?_0x10dd1a['count']:_0x4c775c[_0xf4f5('0x20')]+_0x4c775c[_0xf4f5('0x22')];var _0x21a11f;if(_0x50389c>=_0x193eef){_0x50389c=_0x193eef;_0x21a11f=0xc8;}else{_0x21a11f=0xce;}_0x22cc38[_0xf4f5('0x1d')](_0x21a11f);return _0x22cc38[_0xf4f5('0x23')](_0xf4f5('0x24'),_0x35a1a3+'-'+_0x50389c+'/'+_0x193eef)[_0xf4f5('0x1f')](_0x10dd1a);}return null;};}function patchUpdates(_0x1e8d3a){return function(_0x2050f4){try{jsonpatch[_0xf4f5('0x25')](_0x2050f4,_0x1e8d3a,!![]);}catch(_0x2b59bb){return BPromise[_0xf4f5('0x26')](_0x2b59bb);}return _0x2050f4[_0xf4f5('0x27')]();};}function saveUpdates(_0x5ba3b5,_0x53bcb0){return function(_0x593162){if(_0x593162){return _0x593162[_0xf4f5('0x28')](_0x5ba3b5)['then'](function(_0x3111aa){return _0x3111aa;});}return null;};}function removeEntity(_0x57a99e,_0x31246e){return function(_0x521073){if(_0x521073){return _0x521073[_0xf4f5('0x29')]()[_0xf4f5('0x2a')](function(){_0x57a99e[_0xf4f5('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b4b07,_0x3c06fc){return function(_0x5b0a9b){if(!_0x5b0a9b){_0x3b4b07[_0xf4f5('0x1c')](0x194);}return _0x5b0a9b;};}function handleError(_0x3398b5,_0x1424c9){_0x1424c9=_0x1424c9||0x1f4;return function(_0x499e38){logger[_0xf4f5('0x2b')](_0x499e38[_0xf4f5('0x2c')]);if(_0x499e38[_0xf4f5('0x2d')]){delete _0x499e38[_0xf4f5('0x2d')];}_0x3398b5['status'](_0x1424c9)[_0xf4f5('0x2e')](_0x499e38);};}exports[_0xf4f5('0x2f')]=function(_0x2143a4,_0x5282ce){var _0x5d3b2f={},_0x3be11a={},_0xb2b512={'count':0x0,'rows':[]};var _0x43b0b6=_[_0xf4f5('0x30')](db[_0xf4f5('0x31')][_0xf4f5('0x32')],function(_0x42efce){return{'name':_0x42efce[_0xf4f5('0x33')],'type':_0x42efce[_0xf4f5('0x34')][_0xf4f5('0x35')]};});_0x3be11a[_0xf4f5('0x36')]=_[_0xf4f5('0x30')](_0x43b0b6,_0xf4f5('0x2d'));_0x3be11a[_0xf4f5('0x37')]=_['keys'](_0x2143a4[_0xf4f5('0x37')]);_0x3be11a[_0xf4f5('0x38')]=_[_0xf4f5('0x39')](_0x3be11a[_0xf4f5('0x36')],_0x3be11a[_0xf4f5('0x37')]);_0x5d3b2f[_0xf4f5('0x3a')]=_['intersection'](_0x3be11a[_0xf4f5('0x36')],qs['fields'](_0x2143a4['query'][_0xf4f5('0x3b')]));_0x5d3b2f['attributes']=_0x5d3b2f[_0xf4f5('0x3a')]['length']?_0x5d3b2f[_0xf4f5('0x3a')]:_0x3be11a['model'];if(!_0x2143a4[_0xf4f5('0x37')]['hasOwnProperty'](_0xf4f5('0x3c'))){_0x5d3b2f[_0xf4f5('0x22')]=qs[_0xf4f5('0x22')](_0x2143a4[_0xf4f5('0x37')][_0xf4f5('0x22')]);_0x5d3b2f[_0xf4f5('0x20')]=qs['offset'](_0x2143a4[_0xf4f5('0x37')][_0xf4f5('0x20')]);}_0x5d3b2f['order']=qs['sort'](_0x2143a4[_0xf4f5('0x37')][_0xf4f5('0x3d')]);_0x5d3b2f[_0xf4f5('0x3e')]=qs['filters'](_[_0xf4f5('0x3f')](_0x2143a4['query'],_0x3be11a[_0xf4f5('0x38')]),_0x43b0b6);if(_0x2143a4['query'][_0xf4f5('0x40')]){_0x5d3b2f[_0xf4f5('0x3e')]=_['merge'](_0x5d3b2f['where'],{'$or':_['map'](_0x43b0b6,function(_0x465059){if(_0x465059[_0xf4f5('0x34')]!==_0xf4f5('0x41')){var _0x2303fc={};_0x2303fc[_0x465059[_0xf4f5('0x2d')]]={'$like':'%'+_0x2143a4['query'][_0xf4f5('0x40')]+'%'};return _0x2303fc;}})});}_0x5d3b2f=_['merge']({},_0x5d3b2f,_0x2143a4[_0xf4f5('0x42')]);var _0x3bfd21={'where':_0x5d3b2f['where']};return db[_0xf4f5('0x31')][_0xf4f5('0x21')](_0x3bfd21)[_0xf4f5('0x2a')](function(_0x3917aa){_0xb2b512[_0xf4f5('0x21')]=_0x3917aa;if(_0x2143a4['query']['includeAll']){_0x5d3b2f[_0xf4f5('0x43')]=[{'all':!![]}];}return db[_0xf4f5('0x31')]['findAll'](_0x5d3b2f);})[_0xf4f5('0x2a')](function(_0x221638){_0xb2b512[_0xf4f5('0x44')]=_0x221638;return _0xb2b512;})[_0xf4f5('0x2a')](respondWithFilteredResult(_0x5282ce,_0x5d3b2f))[_0xf4f5('0x45')](handleError(_0x5282ce,null));};exports[_0xf4f5('0x46')]=function(_0x33901d,_0x48a6f7){var _0x542a0d={'raw':!![],'where':{'id':_0x33901d['params']['id']}},_0x5786c2={};_0x5786c2[_0xf4f5('0x36')]=_[_0xf4f5('0x47')](db[_0xf4f5('0x31')]['rawAttributes']);_0x5786c2['query']=_[_0xf4f5('0x47')](_0x33901d[_0xf4f5('0x37')]);_0x5786c2[_0xf4f5('0x38')]=_[_0xf4f5('0x39')](_0x5786c2[_0xf4f5('0x36')],_0x5786c2[_0xf4f5('0x37')]);_0x542a0d['attributes']=_[_0xf4f5('0x39')](_0x5786c2['model'],qs[_0xf4f5('0x3b')](_0x33901d[_0xf4f5('0x37')][_0xf4f5('0x3b')]));_0x542a0d['attributes']=_0x542a0d[_0xf4f5('0x3a')][_0xf4f5('0x48')]?_0x542a0d[_0xf4f5('0x3a')]:_0x5786c2[_0xf4f5('0x36')];if(_0x33901d[_0xf4f5('0x37')][_0xf4f5('0x49')]){_0x542a0d[_0xf4f5('0x43')]=[{'all':!![]}];}_0x542a0d=_[_0xf4f5('0x4a')]({},_0x542a0d,_0x33901d[_0xf4f5('0x42')]);return db[_0xf4f5('0x31')][_0xf4f5('0x4b')](_0x542a0d)[_0xf4f5('0x2a')](handleEntityNotFound(_0x48a6f7,null))[_0xf4f5('0x2a')](respondWithResult(_0x48a6f7,null))['catch'](handleError(_0x48a6f7,null));};exports[_0xf4f5('0x4c')]=function(_0x2435e0,_0x100323){return db['ChatInternalMessage'][_0xf4f5('0x4c')](_0x2435e0[_0xf4f5('0x4d')],{})['then'](respondWithResult(_0x100323,0xc9))[_0xf4f5('0x45')](handleError(_0x100323,null));};exports[_0xf4f5('0x28')]=function(_0x40efec,_0x9e433a){if(_0x40efec['body']['id']){delete _0x40efec[_0xf4f5('0x4d')]['id'];}return db[_0xf4f5('0x31')][_0xf4f5('0x4b')]({'where':{'id':_0x40efec[_0xf4f5('0x4e')]['id']}})[_0xf4f5('0x2a')](handleEntityNotFound(_0x9e433a,null))[_0xf4f5('0x2a')](saveUpdates(_0x40efec[_0xf4f5('0x4d')],null))['then'](respondWithResult(_0x9e433a,null))[_0xf4f5('0x45')](handleError(_0x9e433a,null));};exports[_0xf4f5('0x29')]=function(_0x5330de,_0x44de0e){return db[_0xf4f5('0x31')][_0xf4f5('0x4b')]({'where':{'id':_0x5330de[_0xf4f5('0x4e')]['id']}})[_0xf4f5('0x2a')](handleEntityNotFound(_0x44de0e,null))[_0xf4f5('0x2a')](removeEntity(_0x44de0e,null))[_0xf4f5('0x45')](handleError(_0x44de0e,null));};exports[_0xf4f5('0x4f')]=function(_0x1d8726,_0x4bebee){return db[_0xf4f5('0x31')][_0xf4f5('0x4f')]()['then'](respondWithResult(_0x4bebee,null))[_0xf4f5('0x45')](handleError(_0x4bebee,null));};function wrapUser(_0x2b8834){return function(_0x41a236){var _0x2b2055=_0x2b8834['get']({'plain':!![]});_0x2b2055[_0xf4f5('0x50')]=[];if(_0x41a236){_0x2b2055[_0xf4f5('0x51')]=_0x41a236[_0xf4f5('0x52')];_0x2b2055['lastMessage']=_0x41a236;}else{_0x2b2055[_0xf4f5('0x51')]=moment(0x0)[_0xf4f5('0x53')](_0xf4f5('0x54'));_0x2b2055[_0xf4f5('0x55')]={};}return _0x2b2055;};}exports['getUsers']=function(_0x2225c2,_0x23ae74,_0x58052b){var _0x277ac5=[];return db[_0xf4f5('0x56')]['findAll']({'where':{'role':[_0xf4f5('0x57'),_0xf4f5('0x58'),_0xf4f5('0x59')]},'attributes':['id','fullname',_0xf4f5('0x2d'),'role',_0xf4f5('0x5a'),_0xf4f5('0x5b'),'online',_0xf4f5('0x5c'),_0xf4f5('0x5d'),_0xf4f5('0x5e')],'order':qs[_0xf4f5('0x3d')](_0xf4f5('0x5f')),'include':[{'model':db[_0xf4f5('0x60')],'as':'VoiceQueues','attributes':['id',_0xf4f5('0x2d'),_0xf4f5('0x34')],'through':{'attributes':[]}}]})[_0xf4f5('0x2a')](function(_0x181acf){if(_0x181acf){var _0x571973=_0x2225c2[_0xf4f5('0x59')][_0xf4f5('0x61')]({'plain':!![]});if(!_0x571973)throw new Error(_0xf4f5('0x62'));if(_0x571973[_0xf4f5('0x63')]==='user'){return db[_0xf4f5('0x64')]['find']({'where':{'name':_0xf4f5('0x65'),'userProfileId':_0x571973[_0xf4f5('0x66')]},'raw':!![]})[_0xf4f5('0x2a')](function(_0x18582f){if(_0x18582f){if(_0x18582f[_0xf4f5('0x67')]===0x0){return db['UserProfileResource'][_0xf4f5('0x68')]({'where':{'sectionId':_0x18582f['id']},'raw':!![]})[_0xf4f5('0x2a')](function(_0x4ed3e8){var _0x497066=[];if(_[_0xf4f5('0x69')](_0x4ed3e8)){_0x497066=_[_0xf4f5('0x40')](_0x181acf,function(_0x8f57e9){if(_0x8f57e9[_0xf4f5('0x63')]!==_0xf4f5('0x57')){return _0x8f57e9;}});return _0x497066;}else{for(var _0x2fdfff=0x0;_0x2fdfff<_0x181acf[_0xf4f5('0x48')];_0x2fdfff++){var _0x570c9c=_0x181acf[_0x2fdfff];if(_0x570c9c[_0xf4f5('0x63')]==='agent'){var _0x382eae=_[_0xf4f5('0x4b')](_0x4ed3e8,function(_0x13e998){return _0x13e998[_0xf4f5('0x6a')]===_0x570c9c['id'];});if(_0x382eae)_0x497066[_0xf4f5('0x6b')](_0x570c9c);}else{_0x497066[_0xf4f5('0x6b')](_0x570c9c);}}return _0x497066;}});}else{return _0x181acf;}}else{var _0x5e8e1d=_[_0xf4f5('0x40')](_0x181acf,function(_0x34ea82){if(_0x34ea82[_0xf4f5('0x63')]!==_0xf4f5('0x57')){return _0x34ea82;}});return _0x5e8e1d;}});}else{return _0x181acf;}}})[_0xf4f5('0x2a')](function(_0x23c8e1){var _0x5e3e97=[];if(_0x23c8e1){_0x277ac5=_0x23c8e1;for(var _0x2afacd=0x0;_0x2afacd<_0x23c8e1[_0xf4f5('0x48')];_0x2afacd+=0x1){_0x277ac5[_0x2afacd][_0xf4f5('0x50')]=[];_0x5e3e97['push'](db['ChatInternalMessage'][_0xf4f5('0x4b')]({'where':{'FromId':[_0x2225c2[_0xf4f5('0x59')]['id'],_0x23c8e1[_0x2afacd]['id']],'ToId':[_0x2225c2[_0xf4f5('0x59')]['id'],_0x23c8e1[_0x2afacd]['id']],'ChatGroupId':null},'attributes':['id',_0xf4f5('0x52'),'FromId',_0xf4f5('0x6c'),_0xf4f5('0x6d'),_0xf4f5('0x4d')],'order':qs[_0xf4f5('0x3d')](_0xf4f5('0x6e')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x23c8e1[_0x2afacd])));}return BPromise[_0xf4f5('0x6f')](_0x5e3e97);}return[];})[_0xf4f5('0x2a')](function(_0x18312e){return{'rows':_0x18312e,'count':_0x18312e[_0xf4f5('0x48')]};})[_0xf4f5('0x2a')](respondWithResult(_0x23ae74,null))[_0xf4f5('0x45')](handleError(_0x23ae74,null));}; \ No newline at end of file +var _0xdf60=['isEmpty','agent','resourceId','push','messages','FromId','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./chatInternalMessage.socket','register','sendStatus','status','offset','undefined','count','limit','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','ChatInternalMessage','includeAll','include','findAll','rows','catch','params','length','find','create','body','update','describe','lastMessageAt','createdAt','lastMessage','format','User','admin','user','role','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Agents','userProfileId','autoAssociation','UserProfileResource'];(function(_0x5d847b,_0xb06073){var _0x10885e=function(_0x16b438){while(--_0x16b438){_0x5d847b['push'](_0x5d847b['shift']());}};_0x10885e(++_0xb06073);}(_0xdf60,0xea));var _0x0df6=function(_0x5c33d1,_0x3e805c){_0x5c33d1=_0x5c33d1-0x0;var _0x46e2df=_0xdf60[_0x5c33d1];return _0x46e2df;};'use strict';var emlformat=require(_0x0df6('0x0'));var rimraf=require(_0x0df6('0x1'));var zipdir=require(_0x0df6('0x2'));var jsonpatch=require(_0x0df6('0x3'));var rp=require('request-promise');var moment=require(_0x0df6('0x4'));var BPromise=require(_0x0df6('0x5'));var Mustache=require('mustache');var util=require(_0x0df6('0x6'));var path=require(_0x0df6('0x7'));var sox=require(_0x0df6('0x8'));var csv=require(_0x0df6('0x9'));var ejs=require(_0x0df6('0xa'));var fs=require('fs');var fs_extra=require(_0x0df6('0xb'));var _=require('lodash');var squel=require(_0x0df6('0xc'));var crypto=require(_0x0df6('0xd'));var jsforce=require(_0x0df6('0xe'));var deskjs=require(_0x0df6('0xf'));var toCsv=require(_0x0df6('0x9'));var querystring=require('querystring');var Papa=require(_0x0df6('0x10'));var Redis=require('ioredis');var authService=require(_0x0df6('0x11'));var qs=require(_0x0df6('0x12'));var as=require(_0x0df6('0x13'));var hardwareService=require(_0x0df6('0x14'));var logger=require(_0x0df6('0x15'))('api');var utils=require(_0x0df6('0x16'));var config=require(_0x0df6('0x17'));var licenseUtil=require(_0x0df6('0x18'));var db=require(_0x0df6('0x19'))['db'];config[_0x0df6('0x1a')]=_['defaults'](config[_0x0df6('0x1a')],{'host':_0x0df6('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0df6('0x1a')]));require(_0x0df6('0x1c'))[_0x0df6('0x1d')](socket);function respondWithStatusCode(_0x279bd7,_0x462f9e){_0x462f9e=_0x462f9e||0xcc;return function(_0x410aa6){if(_0x410aa6){return _0x279bd7[_0x0df6('0x1e')](_0x462f9e);}return _0x279bd7[_0x0df6('0x1f')](_0x462f9e)['end']();};}function respondWithResult(_0x20a937,_0x6fd0fb){_0x6fd0fb=_0x6fd0fb||0xc8;return function(_0x1c3484){if(_0x1c3484){return _0x20a937[_0x0df6('0x1f')](_0x6fd0fb)['json'](_0x1c3484);}};}function respondWithFilteredResult(_0xaba2c2,_0x3ab41){return function(_0x4a2ce1){if(_0x4a2ce1){var _0x4b65b5=typeof _0x3ab41[_0x0df6('0x20')]===_0x0df6('0x21')&&typeof _0x3ab41['limit']==='undefined';var _0x57fe87=_0x4a2ce1[_0x0df6('0x22')];var _0x49d9f1=_0x4b65b5?0x0:_0x3ab41[_0x0df6('0x20')];var _0x424ace=_0x4b65b5?_0x4a2ce1[_0x0df6('0x22')]:_0x3ab41[_0x0df6('0x20')]+_0x3ab41[_0x0df6('0x23')];var _0x525c9a;if(_0x424ace>=_0x57fe87){_0x424ace=_0x57fe87;_0x525c9a=0xc8;}else{_0x525c9a=0xce;}_0xaba2c2[_0x0df6('0x1f')](_0x525c9a);return _0xaba2c2['set'](_0x0df6('0x24'),_0x49d9f1+'-'+_0x424ace+'/'+_0x57fe87)[_0x0df6('0x25')](_0x4a2ce1);}return null;};}function patchUpdates(_0x5e5e91){return function(_0x29ed10){try{jsonpatch[_0x0df6('0x26')](_0x29ed10,_0x5e5e91,!![]);}catch(_0x40363c){return BPromise[_0x0df6('0x27')](_0x40363c);}return _0x29ed10[_0x0df6('0x28')]();};}function saveUpdates(_0x316db3,_0x1fa793){return function(_0xf8d97b){if(_0xf8d97b){return _0xf8d97b['update'](_0x316db3)[_0x0df6('0x29')](function(_0x15457a){return _0x15457a;});}return null;};}function removeEntity(_0x34ffde,_0x44df14){return function(_0x4d669c){if(_0x4d669c){return _0x4d669c[_0x0df6('0x2a')]()['then'](function(){_0x34ffde[_0x0df6('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x119862,_0x50cc74){return function(_0x8d6aab){if(!_0x8d6aab){_0x119862['sendStatus'](0x194);}return _0x8d6aab;};}function handleError(_0x5b35b4,_0x9648bf){_0x9648bf=_0x9648bf||0x1f4;return function(_0x16406c){logger[_0x0df6('0x2b')](_0x16406c[_0x0df6('0x2c')]);if(_0x16406c[_0x0df6('0x2d')]){delete _0x16406c[_0x0df6('0x2d')];}_0x5b35b4[_0x0df6('0x1f')](_0x9648bf)[_0x0df6('0x2e')](_0x16406c);};}exports[_0x0df6('0x2f')]=function(_0x10a6cd,_0xdaabf9){var _0x541774={},_0x50d9bb={},_0x52aea8={'count':0x0,'rows':[]};var _0x5e5feb=_[_0x0df6('0x30')](db['ChatInternalMessage'][_0x0df6('0x31')],function(_0x3bc2b2){return{'name':_0x3bc2b2[_0x0df6('0x32')],'type':_0x3bc2b2[_0x0df6('0x33')][_0x0df6('0x34')]};});_0x50d9bb[_0x0df6('0x35')]=_['map'](_0x5e5feb,'name');_0x50d9bb[_0x0df6('0x36')]=_[_0x0df6('0x37')](_0x10a6cd[_0x0df6('0x36')]);_0x50d9bb[_0x0df6('0x38')]=_[_0x0df6('0x39')](_0x50d9bb[_0x0df6('0x35')],_0x50d9bb['query']);_0x541774[_0x0df6('0x3a')]=_[_0x0df6('0x39')](_0x50d9bb[_0x0df6('0x35')],qs[_0x0df6('0x3b')](_0x10a6cd['query'][_0x0df6('0x3b')]));_0x541774[_0x0df6('0x3a')]=_0x541774[_0x0df6('0x3a')]['length']?_0x541774[_0x0df6('0x3a')]:_0x50d9bb[_0x0df6('0x35')];if(!_0x10a6cd[_0x0df6('0x36')][_0x0df6('0x3c')]('nolimit')){_0x541774['limit']=qs['limit'](_0x10a6cd[_0x0df6('0x36')][_0x0df6('0x23')]);_0x541774[_0x0df6('0x20')]=qs[_0x0df6('0x20')](_0x10a6cd['query'][_0x0df6('0x20')]);}_0x541774['order']=qs[_0x0df6('0x3d')](_0x10a6cd[_0x0df6('0x36')][_0x0df6('0x3d')]);_0x541774[_0x0df6('0x3e')]=qs[_0x0df6('0x38')](_[_0x0df6('0x3f')](_0x10a6cd[_0x0df6('0x36')],_0x50d9bb[_0x0df6('0x38')]),_0x5e5feb);if(_0x10a6cd['query'][_0x0df6('0x40')]){_0x541774[_0x0df6('0x3e')]=_[_0x0df6('0x41')](_0x541774[_0x0df6('0x3e')],{'$or':_[_0x0df6('0x30')](_0x5e5feb,function(_0x387852){if(_0x387852['type']!==_0x0df6('0x42')){var _0x59812b={};_0x59812b[_0x387852[_0x0df6('0x2d')]]={'$like':'%'+_0x10a6cd[_0x0df6('0x36')][_0x0df6('0x40')]+'%'};return _0x59812b;}})});}_0x541774=_[_0x0df6('0x41')]({},_0x541774,_0x10a6cd[_0x0df6('0x43')]);var _0x17f180={'where':_0x541774[_0x0df6('0x3e')]};return db[_0x0df6('0x44')]['count'](_0x17f180)[_0x0df6('0x29')](function(_0x13ff3c){_0x52aea8['count']=_0x13ff3c;if(_0x10a6cd[_0x0df6('0x36')][_0x0df6('0x45')]){_0x541774[_0x0df6('0x46')]=[{'all':!![]}];}return db[_0x0df6('0x44')][_0x0df6('0x47')](_0x541774);})[_0x0df6('0x29')](function(_0x287e87){_0x52aea8[_0x0df6('0x48')]=_0x287e87;return _0x52aea8;})[_0x0df6('0x29')](respondWithFilteredResult(_0xdaabf9,_0x541774))[_0x0df6('0x49')](handleError(_0xdaabf9,null));};exports['show']=function(_0x25e33e,_0x198c97){var _0x405dc7={'raw':!![],'where':{'id':_0x25e33e[_0x0df6('0x4a')]['id']}},_0x1230ca={};_0x1230ca['model']=_[_0x0df6('0x37')](db[_0x0df6('0x44')]['rawAttributes']);_0x1230ca[_0x0df6('0x36')]=_[_0x0df6('0x37')](_0x25e33e['query']);_0x1230ca['filters']=_['intersection'](_0x1230ca['model'],_0x1230ca[_0x0df6('0x36')]);_0x405dc7['attributes']=_[_0x0df6('0x39')](_0x1230ca[_0x0df6('0x35')],qs[_0x0df6('0x3b')](_0x25e33e[_0x0df6('0x36')]['fields']));_0x405dc7[_0x0df6('0x3a')]=_0x405dc7[_0x0df6('0x3a')][_0x0df6('0x4b')]?_0x405dc7[_0x0df6('0x3a')]:_0x1230ca[_0x0df6('0x35')];if(_0x25e33e['query'][_0x0df6('0x45')]){_0x405dc7[_0x0df6('0x46')]=[{'all':!![]}];}_0x405dc7=_['merge']({},_0x405dc7,_0x25e33e['options']);return db[_0x0df6('0x44')][_0x0df6('0x4c')](_0x405dc7)[_0x0df6('0x29')](handleEntityNotFound(_0x198c97,null))[_0x0df6('0x29')](respondWithResult(_0x198c97,null))[_0x0df6('0x49')](handleError(_0x198c97,null));};exports['create']=function(_0x4e9e0d,_0x430db8){return db[_0x0df6('0x44')][_0x0df6('0x4d')](_0x4e9e0d[_0x0df6('0x4e')],{})[_0x0df6('0x29')](respondWithResult(_0x430db8,0xc9))[_0x0df6('0x49')](handleError(_0x430db8,null));};exports[_0x0df6('0x4f')]=function(_0x15cc87,_0x17a4df){if(_0x15cc87[_0x0df6('0x4e')]['id']){delete _0x15cc87[_0x0df6('0x4e')]['id'];}return db[_0x0df6('0x44')][_0x0df6('0x4c')]({'where':{'id':_0x15cc87[_0x0df6('0x4a')]['id']}})[_0x0df6('0x29')](handleEntityNotFound(_0x17a4df,null))['then'](saveUpdates(_0x15cc87[_0x0df6('0x4e')],null))[_0x0df6('0x29')](respondWithResult(_0x17a4df,null))[_0x0df6('0x49')](handleError(_0x17a4df,null));};exports[_0x0df6('0x2a')]=function(_0x32231d,_0x2a1f65){return db[_0x0df6('0x44')][_0x0df6('0x4c')]({'where':{'id':_0x32231d[_0x0df6('0x4a')]['id']}})[_0x0df6('0x29')](handleEntityNotFound(_0x2a1f65,null))['then'](removeEntity(_0x2a1f65,null))[_0x0df6('0x49')](handleError(_0x2a1f65,null));};exports[_0x0df6('0x50')]=function(_0x567716,_0x5d819e){return db['ChatInternalMessage']['describe']()['then'](respondWithResult(_0x5d819e,null))['catch'](handleError(_0x5d819e,null));};function wrapUser(_0x28b84f){return function(_0x385dbe){var _0x1f3de2=_0x28b84f['get']({'plain':!![]});_0x1f3de2['messages']=[];if(_0x385dbe){_0x1f3de2[_0x0df6('0x51')]=_0x385dbe[_0x0df6('0x52')];_0x1f3de2[_0x0df6('0x53')]=_0x385dbe;}else{_0x1f3de2[_0x0df6('0x51')]=moment(0x0)[_0x0df6('0x54')]('YYYY-MM-DD\x20HH:mm:ss');_0x1f3de2[_0x0df6('0x53')]={};}return _0x1f3de2;};}exports['getUsers']=function(_0x1d8f44,_0x155819,_0x1e97ed){var _0x1426d=[];return db[_0x0df6('0x55')][_0x0df6('0x47')]({'where':{'role':['agent',_0x0df6('0x56'),_0x0df6('0x57')]},'attributes':['id','fullname',_0x0df6('0x2d'),_0x0df6('0x58'),'userpic','internal',_0x0df6('0x59'),_0x0df6('0x5a'),_0x0df6('0x5b'),_0x0df6('0x5c')],'order':qs['sort'](_0x0df6('0x5d')),'include':[{'model':db[_0x0df6('0x5e')],'as':_0x0df6('0x5f'),'attributes':['id',_0x0df6('0x2d'),_0x0df6('0x33')],'through':{'attributes':[]}}]})[_0x0df6('0x29')](function(_0x4ab1b5){if(_0x4ab1b5){var _0x12c284=_0x1d8f44[_0x0df6('0x57')][_0x0df6('0x60')]({'plain':!![]});if(!_0x12c284)throw new Error(_0x0df6('0x61'));if(_0x12c284[_0x0df6('0x58')]==='user'){return db['UserProfileSection'][_0x0df6('0x4c')]({'where':{'name':_0x0df6('0x62'),'userProfileId':_0x12c284[_0x0df6('0x63')]},'raw':!![]})[_0x0df6('0x29')](function(_0x10d540){if(_0x10d540){if(_0x10d540[_0x0df6('0x64')]===0x0){return db[_0x0df6('0x65')][_0x0df6('0x47')]({'where':{'sectionId':_0x10d540['id']},'raw':!![]})['then'](function(_0x154c80){var _0x252629=[];if(_[_0x0df6('0x66')](_0x154c80)){_0x252629=_[_0x0df6('0x40')](_0x4ab1b5,function(_0x5a98c0){if(_0x5a98c0[_0x0df6('0x58')]!==_0x0df6('0x67')){return _0x5a98c0;}});return _0x252629;}else{for(var _0x5de3eb=0x0;_0x5de3eb<_0x4ab1b5[_0x0df6('0x4b')];_0x5de3eb++){var _0x121883=_0x4ab1b5[_0x5de3eb];if(_0x121883[_0x0df6('0x58')]===_0x0df6('0x67')){var _0x49c2e1=_[_0x0df6('0x4c')](_0x154c80,function(_0x2aa23d){return _0x2aa23d[_0x0df6('0x68')]===_0x121883['id'];});if(_0x49c2e1)_0x252629['push'](_0x121883);}else{_0x252629[_0x0df6('0x69')](_0x121883);}}return _0x252629;}});}else{return _0x4ab1b5;}}else{var _0x3e403a=_['filter'](_0x4ab1b5,function(_0x5f3b87){if(_0x5f3b87['role']!==_0x0df6('0x67')){return _0x5f3b87;}});return _0x3e403a;}});}else{return _0x4ab1b5;}}})[_0x0df6('0x29')](function(_0x4ad920){var _0x551b29=[];if(_0x4ad920){_0x1426d=_0x4ad920;for(var _0x13a7ac=0x0;_0x13a7ac<_0x4ad920[_0x0df6('0x4b')];_0x13a7ac+=0x1){_0x1426d[_0x13a7ac][_0x0df6('0x6a')]=[];_0x551b29[_0x0df6('0x69')](db[_0x0df6('0x44')][_0x0df6('0x4c')]({'where':{'FromId':[_0x1d8f44[_0x0df6('0x57')]['id'],_0x4ad920[_0x13a7ac]['id']],'ToId':[_0x1d8f44[_0x0df6('0x57')]['id'],_0x4ad920[_0x13a7ac]['id']],'ChatGroupId':null},'attributes':['id',_0x0df6('0x52'),_0x0df6('0x6b'),_0x0df6('0x6c'),_0x0df6('0x6d'),'body'],'order':qs[_0x0df6('0x3d')](_0x0df6('0x6e')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x4ad920[_0x13a7ac])));}return BPromise[_0x0df6('0x6f')](_0x551b29);}return[];})[_0x0df6('0x29')](function(_0x43637a){return{'rows':_0x43637a,'count':_0x43637a[_0x0df6('0x4b')]};})['then'](respondWithResult(_0x155819,null))[_0x0df6('0x49')](handleError(_0x155819,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 8d90915..d8a070c 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 _0x5193=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatInternalMessage','save','update','remove','emit'];(function(_0x4fdcc0,_0x560a01){var _0xc0ce94=function(_0x36ea12){while(--_0x36ea12){_0x4fdcc0['push'](_0x4fdcc0['shift']());}};_0xc0ce94(++_0x560a01);}(_0x5193,0x143));var _0x3519=function(_0x72b71a,_0x1877bb){_0x72b71a=_0x72b71a-0x0;var _0x2286bc=_0x5193[_0x72b71a];return _0x2286bc;};'use strict';var EventEmitter=require(_0x3519('0x0'));var ChatInternalMessage=require(_0x3519('0x1'))['db'][_0x3519('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3519('0x3'),'afterUpdate':_0x3519('0x4'),'afterDestroy':_0x3519('0x5')};function emitEvent(_0x48eb21){return function(_0x19d7d1,_0x34c3af,_0x372467){ChatInternalMessageEvents[_0x3519('0x6')](_0x48eb21+':'+_0x19d7d1['id'],_0x19d7d1);ChatInternalMessageEvents[_0x3519('0x6')](_0x48eb21,_0x19d7d1);_0x372467(null);};}for(var e in events){if(events[_0x3519('0x7')](e)){var event=events[e];ChatInternalMessage[_0x3519('0x8')](e,emitEvent(event));}}module[_0x3519('0x9')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x9dcb=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','ChatInternalMessage','save'];(function(_0x399ff1,_0x4a2a83){var _0x4f6fab=function(_0x296e54){while(--_0x296e54){_0x399ff1['push'](_0x399ff1['shift']());}};_0x4f6fab(++_0x4a2a83);}(_0x9dcb,0x96));var _0xb9dc=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9dcb[_0x2dafbe];return _0x58a45a;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0xb9dc('0x0'))['db'][_0xb9dc('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb9dc('0x2'),'afterUpdate':_0xb9dc('0x3'),'afterDestroy':_0xb9dc('0x4')};function emitEvent(_0x57591f){return function(_0x5959cd,_0x51f578,_0x4818fd){ChatInternalMessageEvents[_0xb9dc('0x5')](_0x57591f+':'+_0x5959cd['id'],_0x5959cd);ChatInternalMessageEvents['emit'](_0x57591f,_0x5959cd);_0x4818fd(null);};}for(var e in events){if(events[_0xb9dc('0x6')](e)){var event=events[e];ChatInternalMessage[_0xb9dc('0x7')](e,emitEvent(event));}}module[_0xb9dc('0x8')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 98d6a73..28042d8 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 _0xbf34=['utf8mb4_unicode_ci','util','../../config/logger','api','moment','path','rimraf','define','ChatInternalMessage','chat_internal_messages','utf8mb4'];(function(_0xb0895e,_0xbe27f3){var _0x24dbae=function(_0x590497){while(--_0x590497){_0xb0895e['push'](_0xb0895e['shift']());}};_0x24dbae(++_0xbe27f3);}(_0xbf34,0x177));var _0x4bf3=function(_0x24233a,_0xfd68b7){_0x24233a=_0x24233a-0x0;var _0x2a98ee=_0xbf34[_0x24233a];return _0x2a98ee;};'use strict';var _=require('lodash');var util=require(_0x4bf3('0x0'));var logger=require(_0x4bf3('0x1'))(_0x4bf3('0x2'));var moment=require(_0x4bf3('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4bf3('0x4'));var rimraf=require(_0x4bf3('0x5'));var config=require('../../config/environment');var attributes=require('./chatInternalMessage.attributes');module['exports']=function(_0x1938f0,_0x13e811){return _0x1938f0[_0x4bf3('0x6')](_0x4bf3('0x7'),attributes,{'tableName':_0x4bf3('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4bf3('0x9'),'collate':_0x4bf3('0xa')});}; \ No newline at end of file +var _0xcf1b=['exports','ChatInternalMessage','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./chatInternalMessage.attributes'];(function(_0x3179c7,_0x3db9df){var _0x551ad5=function(_0x775027){while(--_0x775027){_0x3179c7['push'](_0x3179c7['shift']());}};_0x551ad5(++_0x3db9df);}(_0xcf1b,0x121));var _0xbcf1=function(_0x564ec2,_0x2d09a3){_0x564ec2=_0x564ec2-0x0;var _0x554b39=_0xcf1b[_0x564ec2];return _0x554b39;};'use strict';var _=require('lodash');var util=require(_0xbcf1('0x0'));var logger=require(_0xbcf1('0x1'))('api');var moment=require(_0xbcf1('0x2'));var BPromise=require(_0xbcf1('0x3'));var rp=require(_0xbcf1('0x4'));var fs=require('fs');var path=require(_0xbcf1('0x5'));var rimraf=require(_0xbcf1('0x6'));var config=require('../../config/environment');var attributes=require(_0xbcf1('0x7'));module[_0xbcf1('0x8')]=function(_0x4213b5,_0x48b9db){return _0x4213b5['define'](_0xbcf1('0x9'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xbcf1('0xa')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 19545c7..7cd5804 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 _0x023f=['../../config/logger','rpc','client','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','request\x20sent','debug','stringify','error','code','ChatInternalMessage,\x20%s,\x20%s','result','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x27ff35,_0x43abb8){var _0x18138f=function(_0x4ea812){while(--_0x4ea812){_0x27ff35['push'](_0x27ff35['shift']());}};_0x18138f(++_0x43abb8);}(_0x023f,0x69));var _0xf023=function(_0x4fcb09,_0x1de55d){_0x4fcb09=_0x4fcb09-0x0;var _0x141fbf=_0x023f[_0x4fcb09];return _0x141fbf;};'use strict';var _=require(_0xf023('0x0'));var util=require(_0xf023('0x1'));var moment=require(_0xf023('0x2'));var BPromise=require(_0xf023('0x3'));var rs=require(_0xf023('0x4'));var fs=require('fs');var Redis=require(_0xf023('0x5'));var db=require(_0xf023('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xf023('0x7'))(_0xf023('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf023('0x9')]['http']({'port':0x232a});config[_0xf023('0xa')]=_[_0xf023('0xb')](config[_0xf023('0xa')],{'host':_0xf023('0xc'),'port':0x18eb});var socket=require(_0xf023('0xd'))(new Redis(config[_0xf023('0xa')]));require(_0xf023('0xe'))[_0xf023('0xf')](socket);function respondWithRpcPromise(_0x4edb7c,_0x312a03,_0x3bcb2e){return new BPromise(function(_0x40b84f,_0x2efd10){return client[_0xf023('0x10')](_0x4edb7c,_0x3bcb2e)[_0xf023('0x11')](function(_0x41afc0){logger[_0xf023('0x12')]('ChatInternalMessage,\x20%s,\x20%s',_0x312a03,_0xf023('0x13'));logger[_0xf023('0x14')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x312a03,'request\x20sent',JSON[_0xf023('0x15')](_0x41afc0));if(_0x41afc0['error']){if(_0x41afc0[_0xf023('0x16')][_0xf023('0x17')]===0x1f4){logger[_0xf023('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x312a03,_0x41afc0['error']['message']);return _0x2efd10(_0x41afc0[_0xf023('0x16')]['message']);}logger[_0xf023('0x16')](_0xf023('0x18'),_0x312a03,_0x41afc0[_0xf023('0x16')]['message']);return _0x40b84f(_0x41afc0[_0xf023('0x16')]['message']);}else{logger[_0xf023('0x12')]('ChatInternalMessage,\x20%s,\x20%s',_0x312a03,_0xf023('0x13'));_0x40b84f(_0x41afc0[_0xf023('0x19')][_0xf023('0x1a')]);}})[_0xf023('0x1b')](function(_0x2edcad){logger[_0xf023('0x16')](_0xf023('0x18'),_0x312a03,_0x2edcad);_0x2efd10(_0x2edcad);});});} \ No newline at end of file +var _0xf698=['info','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','ChatInternalMessage,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','then'];(function(_0x3ca4d1,_0x5b75fa){var _0x4966c7=function(_0x4d8210){while(--_0x4d8210){_0x3ca4d1['push'](_0x3ca4d1['shift']());}};_0x4966c7(++_0x5b75fa);}(_0xf698,0x1de));var _0x8f69=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xf698[_0x3899d1];return _0xeb4a7d;};'use strict';var _=require(_0x8f69('0x0'));var util=require(_0x8f69('0x1'));var moment=require('moment');var BPromise=require(_0x8f69('0x2'));var rs=require(_0x8f69('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8f69('0x4'))['db'];var utils=require(_0x8f69('0x5'));var logger=require(_0x8f69('0x6'))(_0x8f69('0x7'));var config=require('../../config/environment');var jayson=require(_0x8f69('0x8'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x8f69('0x9')](config[_0x8f69('0xa')],{'host':_0x8f69('0xb'),'port':0x18eb});var socket=require(_0x8f69('0xc'))(new Redis(config[_0x8f69('0xa')]));require(_0x8f69('0xd'))[_0x8f69('0xe')](socket);function respondWithRpcPromise(_0x3d86d7,_0xd8d4c0,_0x2496c4){return new BPromise(function(_0x3bc34c,_0xc9406e){return client['request'](_0x3d86d7,_0x2496c4)[_0x8f69('0xf')](function(_0x573d9b){logger[_0x8f69('0x10')]('ChatInternalMessage,\x20%s,\x20%s',_0xd8d4c0,_0x8f69('0x11'));logger['debug'](_0x8f69('0x12'),_0xd8d4c0,_0x8f69('0x11'),JSON[_0x8f69('0x13')](_0x573d9b));if(_0x573d9b['error']){if(_0x573d9b['error'][_0x8f69('0x14')]===0x1f4){logger[_0x8f69('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0xd8d4c0,_0x573d9b[_0x8f69('0x15')][_0x8f69('0x16')]);return _0xc9406e(_0x573d9b[_0x8f69('0x15')]['message']);}logger[_0x8f69('0x15')](_0x8f69('0x17'),_0xd8d4c0,_0x573d9b[_0x8f69('0x15')]['message']);return _0x3bc34c(_0x573d9b[_0x8f69('0x15')][_0x8f69('0x16')]);}else{logger[_0x8f69('0x10')](_0x8f69('0x17'),_0xd8d4c0,_0x8f69('0x11'));_0x3bc34c(_0x573d9b[_0x8f69('0x18')]['message']);}})[_0x8f69('0x19')](function(_0x1449f5){logger[_0x8f69('0x15')](_0x8f69('0x17'),_0xd8d4c0,_0x1449f5);_0xc9406e(_0x1449f5);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 515db4a..8aa8530 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 _0xdf22=['removeListener','length','chatInternalMessage:','./chatInternalMessage.events','save','emit'];(function(_0x16dd09,_0x19cd4a){var _0x518cc4=function(_0x5529b2){while(--_0x5529b2){_0x16dd09['push'](_0x16dd09['shift']());}};_0x518cc4(++_0x19cd4a);}(_0xdf22,0x93));var _0x2df2=function(_0x123af2,_0x23b27c){_0x123af2=_0x123af2-0x0;var _0xe39a07=_0xdf22[_0x123af2];return _0xe39a07;};'use strict';var ChatInternalMessageEvents=require(_0x2df2('0x0'));var events=[_0x2df2('0x1'),'remove','update'];function createListener(_0x5f5a81,_0x4bf738){return function(_0x15026e){_0x4bf738[_0x2df2('0x2')](_0x5f5a81,_0x15026e);};}function removeListener(_0x5e5b9d,_0x15fdd7){return function(){ChatInternalMessageEvents[_0x2df2('0x3')](_0x5e5b9d,_0x15fdd7);};}exports['register']=function(_0x23e410){for(var _0x3ce456=0x0,_0x5e0cff=events[_0x2df2('0x4')];_0x3ce456<_0x5e0cff;_0x3ce456++){var _0x3e23e2=events[_0x3ce456];var _0xfa7ec6=createListener(_0x2df2('0x5')+_0x3e23e2,_0x23e410);ChatInternalMessageEvents['on'](_0x3e23e2,_0xfa7ec6);}}; \ No newline at end of file +var _0x9f94=['removeListener','register','chatInternalMessage:','./chatInternalMessage.events','save','emit'];(function(_0x54c253,_0x10ae65){var _0x1421da=function(_0x23b0e9){while(--_0x23b0e9){_0x54c253['push'](_0x54c253['shift']());}};_0x1421da(++_0x10ae65);}(_0x9f94,0xed));var _0x49f9=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x9f94[_0x178e48];return _0x440d7e;};'use strict';var ChatInternalMessageEvents=require(_0x49f9('0x0'));var events=[_0x49f9('0x1'),'remove','update'];function createListener(_0x4172d7,_0x5a78c7){return function(_0x1ef8db){_0x5a78c7[_0x49f9('0x2')](_0x4172d7,_0x1ef8db);};}function removeListener(_0xceb942,_0x358e09){return function(){ChatInternalMessageEvents[_0x49f9('0x3')](_0xceb942,_0x358e09);};}exports[_0x49f9('0x4')]=function(_0x102781){for(var _0x1f86bc=0x0,_0xbacfd6=events['length'];_0x1f86bc<_0xbacfd6;_0x1f86bc++){var _0x443a32=events[_0x1f86bc];var _0x52a1a5=createListener(_0x49f9('0x5')+_0x443a32,_0x102781);ChatInternalMessageEvents['on'](_0x443a32,_0x52a1a5);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 256550b..e3ffabb 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 _0xd450=['index','/describe','describe','show','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd450,0x73));var _0x0d45=function(_0x222bae,_0x3a6f37){_0x222bae=_0x222bae-0x0;var _0x3a8ad6=_0xd450[_0x222bae];return _0x3a8ad6;};'use strict';var multer=require(_0x0d45('0x0'));var util=require(_0x0d45('0x1'));var path=require(_0x0d45('0x2'));var timeout=require(_0x0d45('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x0d45('0x4'));var auth=require(_0x0d45('0x5'));var interaction=require(_0x0d45('0x6'));var config=require(_0x0d45('0x7'));var controller=require(_0x0d45('0x8'));router[_0x0d45('0x9')]('/',auth[_0x0d45('0xa')](),controller[_0x0d45('0xb')]);router['get'](_0x0d45('0xc'),auth[_0x0d45('0xa')](),controller[_0x0d45('0xd')]);router[_0x0d45('0x9')]('/users',auth[_0x0d45('0xa')](),controller['getUsers']);router[_0x0d45('0x9')]('/:id',auth[_0x0d45('0xa')](),controller[_0x0d45('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x0d45('0xf')](_0x0d45('0x10'),controller[_0x0d45('0x11')]);router[_0x0d45('0x12')](_0x0d45('0x10'),auth[_0x0d45('0xa')](),controller[_0x0d45('0x13')]);module[_0x0d45('0x14')]=router; \ No newline at end of file +var _0xb7ce=['./chatInternalMessage.controller','get','/describe','isAuthenticated','describe','/users','getUsers','/:id','show','post','create','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x11c5da,_0x5799cf){var _0x5cfbf1=function(_0x2d23b0){while(--_0x2d23b0){_0x11c5da['push'](_0x11c5da['shift']());}};_0x5cfbf1(++_0x5799cf);}(_0xb7ce,0x87));var _0xeb7c=function(_0x31784a,_0x140eb4){_0x31784a=_0x31784a-0x0;var _0x485aed=_0xb7ce[_0x31784a];return _0x485aed;};'use strict';var multer=require('multer');var util=require(_0xeb7c('0x0'));var path=require(_0xeb7c('0x1'));var timeout=require(_0xeb7c('0x2'));var express=require(_0xeb7c('0x3'));var router=express[_0xeb7c('0x4')]();var fs_extra=require(_0xeb7c('0x5'));var auth=require(_0xeb7c('0x6'));var interaction=require(_0xeb7c('0x7'));var config=require(_0xeb7c('0x8'));var controller=require(_0xeb7c('0x9'));router[_0xeb7c('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xeb7c('0xa')](_0xeb7c('0xb'),auth[_0xeb7c('0xc')](),controller[_0xeb7c('0xd')]);router['get'](_0xeb7c('0xe'),auth[_0xeb7c('0xc')](),controller[_0xeb7c('0xf')]);router[_0xeb7c('0xa')](_0xeb7c('0x10'),auth[_0xeb7c('0xc')](),controller[_0xeb7c('0x11')]);router[_0xeb7c('0x12')]('/',auth[_0xeb7c('0xc')](),controller[_0xeb7c('0x13')]);router[_0xeb7c('0x14')]('/:id',controller[_0xeb7c('0x15')]);router[_0xeb7c('0x16')](_0xeb7c('0x10'),auth[_0xeb7c('0xc')](),controller['destroy']);module[_0xeb7c('0x17')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 20f6029..7a01a64 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 _0x9158=['DATE','STRING','sequelize','exports','TEXT','BOOLEAN','ENUM'];(function(_0x178668,_0x1ec300){var _0x26107d=function(_0x4c0aa8){while(--_0x4c0aa8){_0x178668['push'](_0x178668['shift']());}};_0x26107d(++_0x1ec300);}(_0x9158,0x16e));var _0x8915=function(_0x4030af,_0x1ce105){_0x4030af=_0x4030af-0x0;var _0x1ba9ae=_0x9158[_0x4030af];return _0x1ba9ae;};'use strict';var Sequelize=require(_0x8915('0x0'));module[_0x8915('0x1')]={'body':{'type':Sequelize[_0x8915('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x8915('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x8915('0x4')]('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x8915('0x5')]},'providerName':{'type':Sequelize[_0x8915('0x6')]},'providerResponse':{'type':Sequelize[_0x8915('0x2')]}}; \ No newline at end of file +var _0x9000=['sequelize','exports','medium','BOOLEAN','ENUM','out','DATE','STRING','TEXT'];(function(_0x4f52e9,_0x53d699){var _0x131b71=function(_0x510456){while(--_0x510456){_0x4f52e9['push'](_0x4f52e9['shift']());}};_0x131b71(++_0x53d699);}(_0x9000,0x19e));var _0x0900=function(_0x2212d3,_0x324f32){_0x2212d3=_0x2212d3-0x0;var _0x51c05d=_0x9000[_0x2212d3];return _0x51c05d;};'use strict';var Sequelize=require(_0x0900('0x0'));module[_0x0900('0x1')]={'body':{'type':Sequelize['TEXT'](_0x0900('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x0900('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x0900('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x0900('0x4')]('in',_0x0900('0x5')),'defaultValue':_0x0900('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x0900('0x6')]},'providerName':{'type':Sequelize[_0x0900('0x7')]},'providerResponse':{'type':Sequelize[_0x0900('0x8')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 42fc27c..c54b750 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 _0xa9e0=['interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','contact','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','chat-interactions','chat','ChatInteraction','RejectMessage','rejectMessage','Sequelize','QueryTypes','SELECT','fullname','rejectmessage','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','redis','defaults','localhost','./chatMessage.socket','register','jayson/promise','client','http','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','stack','name','send','map','ChatMessage','fieldName','type','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','body','find','describe','../../config/logger','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteractionId','isNil','read1stAt','format'];(function(_0x5b2186,_0x339e5f){var _0x400157=function(_0x5ba11e){while(--_0x5ba11e){_0x5b2186['push'](_0x5b2186['shift']());}};_0x400157(++_0x339e5f);}(_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'];config[_0x0a9e('0x15')]=_[_0x0a9e('0x16')](config[_0x0a9e('0x15')],{'host':_0x0a9e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x15')]));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);var jayson=require(_0x0a9e('0x1a'));var client=jayson[_0x0a9e('0x1b')][_0x0a9e('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0x0a9e('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x5d0880,_0x1985b6,_0x519dfd,_0x16033c){return new BPromise(function(_0x12066b,_0x48f32d){var _0x225616=_0x16033c||client;return _0x225616['request'](_0x5d0880,_0x519dfd)[_0x0a9e('0x1d')](function(_0x478723){logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));logger[_0x0a9e('0x21')](_0x0a9e('0x22'),_0x1985b6,_0x0a9e('0x20'),JSON[_0x0a9e('0x23')](_0x478723));if(_0x478723[_0x0a9e('0x24')]){if(_0x478723[_0x0a9e('0x24')][_0x0a9e('0x25')]===0x1f4){logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')]['message']);return _0x48f32d(_0x478723[_0x0a9e('0x24')]['message']);}logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')][_0x0a9e('0x26')]);return _0x12066b(_0x478723[_0x0a9e('0x24')]['message']);}else{logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));_0x12066b(_0x478723[_0x0a9e('0x27')][_0x0a9e('0x26')]);}})[_0x0a9e('0x28')](function(_0x16b1ca){logger['error']('ChatMessage,\x20%s,\x20%s',_0x1985b6,_0x16b1ca);_0x48f32d(_0x16b1ca);});});}function respondWithStatusCode(_0x197ec0,_0x3a8e58){_0x3a8e58=_0x3a8e58||0xcc;return function(_0x40c424){if(_0x40c424){return _0x197ec0[_0x0a9e('0x29')](_0x3a8e58);}return _0x197ec0['status'](_0x3a8e58)[_0x0a9e('0x2a')]();};}function respondWithResult(_0x479bc4,_0x45a1e7){_0x45a1e7=_0x45a1e7||0xc8;return function(_0x5bfb33){if(_0x5bfb33){return _0x479bc4[_0x0a9e('0x2b')](_0x45a1e7)[_0x0a9e('0x2c')](_0x5bfb33);}};}function respondWithFilteredResult(_0x25fba9,_0x14433c){return function(_0x140511){if(_0x140511){var _0x1538a4=typeof _0x14433c[_0x0a9e('0x2d')]===_0x0a9e('0x2e')&&typeof _0x14433c['limit']===_0x0a9e('0x2e');var _0x468813=_0x140511[_0x0a9e('0x2f')];var _0x2ec755=_0x1538a4?0x0:_0x14433c['offset'];var _0x15b200=_0x1538a4?_0x140511[_0x0a9e('0x2f')]:_0x14433c[_0x0a9e('0x2d')]+_0x14433c[_0x0a9e('0x30')];var _0x58b06f;if(_0x15b200>=_0x468813){_0x15b200=_0x468813;_0x58b06f=0xc8;}else{_0x58b06f=0xce;}_0x25fba9[_0x0a9e('0x2b')](_0x58b06f);return _0x25fba9[_0x0a9e('0x31')](_0x0a9e('0x32'),_0x2ec755+'-'+_0x15b200+'/'+_0x468813)[_0x0a9e('0x2c')](_0x140511);}return null;};}function patchUpdates(_0x540530){return function(_0x426950){try{jsonpatch['apply'](_0x426950,_0x540530,!![]);}catch(_0x2407f9){return BPromise[_0x0a9e('0x33')](_0x2407f9);}return _0x426950[_0x0a9e('0x34')]();};}function saveUpdates(_0x33bdb7,_0x25ce3a){return function(_0x5180f1){if(_0x5180f1){return _0x5180f1[_0x0a9e('0x35')](_0x33bdb7)[_0x0a9e('0x1d')](function(_0x40cb85){return _0x40cb85;});}return null;};}function removeEntity(_0x2da5c0,_0x2b45ea){return function(_0x409319){if(_0x409319){return _0x409319[_0x0a9e('0x36')]()[_0x0a9e('0x1d')](function(){_0x2da5c0['status'](0xcc)[_0x0a9e('0x2a')]();});}};}function handleEntityNotFound(_0x5e7238,_0x2cc7a0){return function(_0x14b13f){if(!_0x14b13f){_0x5e7238[_0x0a9e('0x29')](0x194);}return _0x14b13f;};}function handleError(_0x3f3d41,_0x567193){_0x567193=_0x567193||0x1f4;return function(_0x191e91){logger[_0x0a9e('0x24')](_0x191e91[_0x0a9e('0x37')]);if(_0x191e91[_0x0a9e('0x38')]){delete _0x191e91['name'];}_0x3f3d41['status'](_0x567193)[_0x0a9e('0x39')](_0x191e91);};}exports['index']=function(_0x24936a,_0x3d9717){var _0x381c37={},_0x1ef87a={},_0x4f41ae={'count':0x0,'rows':[]};var _0x31916f=_[_0x0a9e('0x3a')](db[_0x0a9e('0x3b')]['rawAttributes'],function(_0x1dbf74){return{'name':_0x1dbf74[_0x0a9e('0x3c')],'type':_0x1dbf74[_0x0a9e('0x3d')]['key']};});_0x1ef87a['model']=_[_0x0a9e('0x3a')](_0x31916f,_0x0a9e('0x38'));_0x1ef87a['query']=_[_0x0a9e('0x3e')](_0x24936a[_0x0a9e('0x3f')]);_0x1ef87a[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],_0x1ef87a['query']);_0x381c37[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],qs[_0x0a9e('0x43')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x43')]));_0x381c37['attributes']=_0x381c37[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x381c37[_0x0a9e('0x42')]:_0x1ef87a[_0x0a9e('0x45')];if(!_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x46')](_0x0a9e('0x47'))){_0x381c37[_0x0a9e('0x30')]=qs[_0x0a9e('0x30')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x30')]);_0x381c37[_0x0a9e('0x2d')]=qs[_0x0a9e('0x2d')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x2d')]);}_0x381c37['order']=qs['sort'](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x48')]);_0x381c37[_0x0a9e('0x49')]=qs[_0x0a9e('0x40')](_[_0x0a9e('0x4a')](_0x24936a[_0x0a9e('0x3f')],_0x1ef87a[_0x0a9e('0x40')]),_0x31916f);if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]){_0x381c37[_0x0a9e('0x49')]=_[_0x0a9e('0x4c')](_0x381c37[_0x0a9e('0x49')],{'$or':_['map'](_0x31916f,function(_0x117c99){if(_0x117c99[_0x0a9e('0x3d')]!==_0x0a9e('0x4d')){var _0xfbd5ad={};_0xfbd5ad[_0x117c99[_0x0a9e('0x38')]]={'$like':'%'+_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]+'%'};return _0xfbd5ad;}})});}_0x381c37=_[_0x0a9e('0x4c')]({},_0x381c37,_0x24936a['options']);var _0x2e9d90={'where':_0x381c37['where']};return db[_0x0a9e('0x3b')][_0x0a9e('0x2f')](_0x2e9d90)[_0x0a9e('0x1d')](function(_0x562fb4){_0x4f41ae[_0x0a9e('0x2f')]=_0x562fb4;if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4e')]){_0x381c37[_0x0a9e('0x4f')]=[{'all':!![]}];}return db[_0x0a9e('0x3b')][_0x0a9e('0x50')](_0x381c37);})[_0x0a9e('0x1d')](function(_0x5bbcde){_0x4f41ae[_0x0a9e('0x51')]=_0x5bbcde;return _0x4f41ae;})[_0x0a9e('0x1d')](respondWithFilteredResult(_0x3d9717,_0x381c37))[_0x0a9e('0x28')](handleError(_0x3d9717,null));};exports[_0x0a9e('0x52')]=function(_0x409789,_0x992c77){var _0x6054ee={'raw':!![],'where':{'id':_0x409789[_0x0a9e('0x53')]['id']}},_0x19383e={};_0x19383e['model']=_[_0x0a9e('0x3e')](db[_0x0a9e('0x3b')]['rawAttributes']);_0x19383e['query']=_['keys'](_0x409789[_0x0a9e('0x3f')]);_0x19383e[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],_0x19383e[_0x0a9e('0x3f')]);_0x6054ee[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],qs['fields'](_0x409789['query']['fields']));_0x6054ee[_0x0a9e('0x42')]=_0x6054ee[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x6054ee['attributes']:_0x19383e[_0x0a9e('0x45')];if(_0x409789[_0x0a9e('0x3f')]['includeAll']){_0x6054ee['include']=[{'all':!![]}];}_0x6054ee=_[_0x0a9e('0x4c')]({},_0x6054ee,_0x409789['options']);return db[_0x0a9e('0x3b')]['find'](_0x6054ee)[_0x0a9e('0x1d')](handleEntityNotFound(_0x992c77,null))[_0x0a9e('0x1d')](respondWithResult(_0x992c77,null))[_0x0a9e('0x28')](handleError(_0x992c77,null));};exports['create']=function(_0x2f82da,_0x1bf38a){return db['ChatMessage']['create'](_0x2f82da[_0x0a9e('0x54')],{})[_0x0a9e('0x1d')](respondWithResult(_0x1bf38a,0xc9))['catch'](handleError(_0x1bf38a,null));};exports[_0x0a9e('0x35')]=function(_0x5ce9ac,_0x211ef9){if(_0x5ce9ac['body']['id']){delete _0x5ce9ac[_0x0a9e('0x54')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x5ce9ac['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x211ef9,null))['then'](saveUpdates(_0x5ce9ac[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](respondWithResult(_0x211ef9,null))[_0x0a9e('0x28')](handleError(_0x211ef9,null));};exports[_0x0a9e('0x36')]=function(_0x232830,_0x272738){return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x232830['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x272738,null))[_0x0a9e('0x1d')](removeEntity(_0x272738,null))[_0x0a9e('0x28')](handleError(_0x272738,null));};exports[_0x0a9e('0x56')]=function(_0xb83dfd,_0x156662){return db['ChatMessage'][_0x0a9e('0x56')]()[_0x0a9e('0x1d')](respondWithResult(_0x156662,null))['catch'](handleError(_0x156662,null));};var interaction_log=require(_0x0a9e('0x57'))('chat-interactions');exports[_0x0a9e('0x58')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee){var _0x273cb5={'agent':{},'channel':'chat'};if(_0x5ba1f9[_0x0a9e('0x54')]['id']){delete _0x5ba1f9[_0x0a9e('0x54')]['id'];}_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x59')]=!![];_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5a')]=moment()['format'](_0x0a9e('0x5b'));_0x5ba1f9['body'][_0x0a9e('0x5c')]=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')]||_0x5ba1f9['user']['id'];_0x273cb5[_0x0a9e('0x5d')]['id']=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')];return db[_0x0a9e('0x3b')]['find']({'where':{'id':_0x5ba1f9[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](saveUpdates(_0x5ba1f9[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](function(_0x88dcbf){if(_0x88dcbf){_0x273cb5[_0x0a9e('0x26')]=_0x88dcbf[_0x0a9e('0x5e')]({'plain':!![]});return db['ChatInteraction'][_0x0a9e('0x55')]({'where':{'id':_0x88dcbf[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](function(_0x3528b7){if(_0x3528b7){return _0x3528b7['update']({'UserId':_0x5ba1f9['body'][_0x0a9e('0x5c')],'read1stAt':_[_0x0a9e('0x60')](_0x3528b7[_0x0a9e('0x61')])?moment()[_0x0a9e('0x62')](_0x0a9e('0x5b')):undefined});}return null;})[_0x0a9e('0x1d')](function(_0x387489){if(_0x387489){_0x273cb5[_0x0a9e('0x63')]=_0x387489[_0x0a9e('0x5e')]({'plain':!![]});interaction_log[_0x0a9e('0x1e')](_0x0a9e('0x64'),_0x5ba1f9[_0x0a9e('0x65')]['id'],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x66')],_0x273cb5[_0x0a9e('0x63')]['id'],_0x5ba1f9[_0x0a9e('0x54')]?JSON['stringify'](_0x5ba1f9[_0x0a9e('0x54')]):_0x0a9e('0x67'));return respondWithRpcPromise(_0x0a9e('0x68'),'acceptMessage',_0x273cb5);}return null;})[_0x0a9e('0x1d')](function(_0x30944e){var _0x4b341d=_0x0a9e('0x69')+_0x30944e[_0x0a9e('0x26')][_0x0a9e('0x6a')];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0x4b341d,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x0a9e('0x1d')](function(_0x18bf5d){return _0x18bf5d;});})[_0x0a9e('0x1d')](function(_0x23a7d3){if(_0x23a7d3){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x23a7d3[0x0];if(!_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),'fullname',_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})['then'](function(_0x2ed01e){if(!_0x2ed01e)return null;_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x2ed01e;return _0x273cb5;})[_0x0a9e('0x1d')](function(_0x542ece){if(_0x542ece){if(_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x6f')]){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x70')]=util['format'](_0x0a9e('0x71'),_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')]);_0x273cb5[_0x0a9e('0x26')]['channel']=_0x273cb5[_0x0a9e('0x72')];_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x58');return respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x75'),'message':_[_0x0a9e('0x4c')](_0x273cb5[_0x0a9e('0x26')],JSON[_0x0a9e('0x76')](_0x273cb5[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002)[_0x0a9e('0x1d')](function(){return _0x273cb5;});}return _0x273cb5;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x4b3c1a,null))['catch'](handleError(_0x4b3c1a,null));};var interaction_log=require(_0x0a9e('0x57'))(_0x0a9e('0x78'));exports[_0x0a9e('0x33')]=function(_0x563627,_0x3736e0,_0x33dda0){var _0x8cea96={'agent':{},'channel':_0x0a9e('0x79')};if(_0x563627['body']['id']){delete _0x563627['body']['id'];}_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')]=_0x563627['body'][_0x0a9e('0x5c')]||_0x563627['user']['id'];_0x8cea96[_0x0a9e('0x5d')]['id']=_0x563627[_0x0a9e('0x54')]['UserId'];return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))[_0x0a9e('0x1d')](function(_0x1f42a0){if(_0x1f42a0){_0x8cea96[_0x0a9e('0x26')]=_0x1f42a0['get']({'plain':!![]});return db[_0x0a9e('0x7a')][_0x0a9e('0x55')]({'where':{'id':_0x1f42a0[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))['then'](function(_0xf51744){if(_0xf51744){_0x8cea96[_0x0a9e('0x63')]=_0xf51744['get']({'plain':!![]});interaction_log[_0x0a9e('0x1e')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x563627[_0x0a9e('0x65')]['id'],_0x563627[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x563627[_0x0a9e('0x65')]['role'],_0x8cea96['interaction']['id'],_0x563627[_0x0a9e('0x54')]?JSON[_0x0a9e('0x23')](_0x563627[_0x0a9e('0x54')]):'null');return respondWithRpcPromise(_0x0a9e('0x7b'),_0x0a9e('0x7c'),_0x8cea96);}return null;})['then'](function(_0x4e46b2){var _0xf0a802='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4e46b2['message']['ContactId'];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0xf0a802,{'type':db[_0x0a9e('0x7d')][_0x0a9e('0x7e')][_0x0a9e('0x7f')],'raw':!![]})[_0x0a9e('0x1d')](function(_0x5a8854){return _0x5a8854;});})[_0x0a9e('0x1d')](function(_0x5955f1){if(_0x5955f1){_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x5955f1[0x0];if(!_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),_0x0a9e('0x80'),_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})[_0x0a9e('0x1d')](function(_0x1910bf){if(!_0x1910bf)return null;_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x1910bf;return _0x8cea96;})['then'](function(_0x2645d6){if(_0x2645d6){_0x2645d6[_0x0a9e('0x26')]['interface']=util[_0x0a9e('0x62')](_0x0a9e('0x71'),_0x563627[_0x0a9e('0x65')]['name']);_0x2645d6[_0x0a9e('0x26')]['channel']=_0x8cea96[_0x0a9e('0x72')];_0x2645d6[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x33');respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x81'),'message':_[_0x0a9e('0x4c')](_0x8cea96['message'],JSON[_0x0a9e('0x76')](_0x8cea96[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002);return _0x8cea96;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x3736e0,null))[_0x0a9e('0x28')](handleError(_0x3736e0,null));}; \ No newline at end of file +var _0xa9e0=['interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','contact','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','chat-interactions','chat','ChatInteraction','RejectMessage','rejectMessage','Sequelize','QueryTypes','SELECT','fullname','rejectmessage','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','redis','defaults','localhost','./chatMessage.socket','register','jayson/promise','client','http','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','stack','name','send','map','ChatMessage','fieldName','type','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','body','find','describe','../../config/logger','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteractionId','isNil','read1stAt','format'];(function(_0x2d73b2,_0x4dd4a7){var _0x416962=function(_0x11d0df){while(--_0x11d0df){_0x2d73b2['push'](_0x2d73b2['shift']());}};_0x416962(++_0x4dd4a7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'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'];config[_0x0a9e('0x15')]=_[_0x0a9e('0x16')](config[_0x0a9e('0x15')],{'host':_0x0a9e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x15')]));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);var jayson=require(_0x0a9e('0x1a'));var client=jayson[_0x0a9e('0x1b')][_0x0a9e('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0x0a9e('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x5d0880,_0x1985b6,_0x519dfd,_0x16033c){return new BPromise(function(_0x12066b,_0x48f32d){var _0x225616=_0x16033c||client;return _0x225616['request'](_0x5d0880,_0x519dfd)[_0x0a9e('0x1d')](function(_0x478723){logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));logger[_0x0a9e('0x21')](_0x0a9e('0x22'),_0x1985b6,_0x0a9e('0x20'),JSON[_0x0a9e('0x23')](_0x478723));if(_0x478723[_0x0a9e('0x24')]){if(_0x478723[_0x0a9e('0x24')][_0x0a9e('0x25')]===0x1f4){logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')]['message']);return _0x48f32d(_0x478723[_0x0a9e('0x24')]['message']);}logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')][_0x0a9e('0x26')]);return _0x12066b(_0x478723[_0x0a9e('0x24')]['message']);}else{logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));_0x12066b(_0x478723[_0x0a9e('0x27')][_0x0a9e('0x26')]);}})[_0x0a9e('0x28')](function(_0x16b1ca){logger['error']('ChatMessage,\x20%s,\x20%s',_0x1985b6,_0x16b1ca);_0x48f32d(_0x16b1ca);});});}function respondWithStatusCode(_0x197ec0,_0x3a8e58){_0x3a8e58=_0x3a8e58||0xcc;return function(_0x40c424){if(_0x40c424){return _0x197ec0[_0x0a9e('0x29')](_0x3a8e58);}return _0x197ec0['status'](_0x3a8e58)[_0x0a9e('0x2a')]();};}function respondWithResult(_0x479bc4,_0x45a1e7){_0x45a1e7=_0x45a1e7||0xc8;return function(_0x5bfb33){if(_0x5bfb33){return _0x479bc4[_0x0a9e('0x2b')](_0x45a1e7)[_0x0a9e('0x2c')](_0x5bfb33);}};}function respondWithFilteredResult(_0x25fba9,_0x14433c){return function(_0x140511){if(_0x140511){var _0x1538a4=typeof _0x14433c[_0x0a9e('0x2d')]===_0x0a9e('0x2e')&&typeof _0x14433c['limit']===_0x0a9e('0x2e');var _0x468813=_0x140511[_0x0a9e('0x2f')];var _0x2ec755=_0x1538a4?0x0:_0x14433c['offset'];var _0x15b200=_0x1538a4?_0x140511[_0x0a9e('0x2f')]:_0x14433c[_0x0a9e('0x2d')]+_0x14433c[_0x0a9e('0x30')];var _0x58b06f;if(_0x15b200>=_0x468813){_0x15b200=_0x468813;_0x58b06f=0xc8;}else{_0x58b06f=0xce;}_0x25fba9[_0x0a9e('0x2b')](_0x58b06f);return _0x25fba9[_0x0a9e('0x31')](_0x0a9e('0x32'),_0x2ec755+'-'+_0x15b200+'/'+_0x468813)[_0x0a9e('0x2c')](_0x140511);}return null;};}function patchUpdates(_0x540530){return function(_0x426950){try{jsonpatch['apply'](_0x426950,_0x540530,!![]);}catch(_0x2407f9){return BPromise[_0x0a9e('0x33')](_0x2407f9);}return _0x426950[_0x0a9e('0x34')]();};}function saveUpdates(_0x33bdb7,_0x25ce3a){return function(_0x5180f1){if(_0x5180f1){return _0x5180f1[_0x0a9e('0x35')](_0x33bdb7)[_0x0a9e('0x1d')](function(_0x40cb85){return _0x40cb85;});}return null;};}function removeEntity(_0x2da5c0,_0x2b45ea){return function(_0x409319){if(_0x409319){return _0x409319[_0x0a9e('0x36')]()[_0x0a9e('0x1d')](function(){_0x2da5c0['status'](0xcc)[_0x0a9e('0x2a')]();});}};}function handleEntityNotFound(_0x5e7238,_0x2cc7a0){return function(_0x14b13f){if(!_0x14b13f){_0x5e7238[_0x0a9e('0x29')](0x194);}return _0x14b13f;};}function handleError(_0x3f3d41,_0x567193){_0x567193=_0x567193||0x1f4;return function(_0x191e91){logger[_0x0a9e('0x24')](_0x191e91[_0x0a9e('0x37')]);if(_0x191e91[_0x0a9e('0x38')]){delete _0x191e91['name'];}_0x3f3d41['status'](_0x567193)[_0x0a9e('0x39')](_0x191e91);};}exports['index']=function(_0x24936a,_0x3d9717){var _0x381c37={},_0x1ef87a={},_0x4f41ae={'count':0x0,'rows':[]};var _0x31916f=_[_0x0a9e('0x3a')](db[_0x0a9e('0x3b')]['rawAttributes'],function(_0x1dbf74){return{'name':_0x1dbf74[_0x0a9e('0x3c')],'type':_0x1dbf74[_0x0a9e('0x3d')]['key']};});_0x1ef87a['model']=_[_0x0a9e('0x3a')](_0x31916f,_0x0a9e('0x38'));_0x1ef87a['query']=_[_0x0a9e('0x3e')](_0x24936a[_0x0a9e('0x3f')]);_0x1ef87a[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],_0x1ef87a['query']);_0x381c37[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],qs[_0x0a9e('0x43')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x43')]));_0x381c37['attributes']=_0x381c37[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x381c37[_0x0a9e('0x42')]:_0x1ef87a[_0x0a9e('0x45')];if(!_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x46')](_0x0a9e('0x47'))){_0x381c37[_0x0a9e('0x30')]=qs[_0x0a9e('0x30')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x30')]);_0x381c37[_0x0a9e('0x2d')]=qs[_0x0a9e('0x2d')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x2d')]);}_0x381c37['order']=qs['sort'](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x48')]);_0x381c37[_0x0a9e('0x49')]=qs[_0x0a9e('0x40')](_[_0x0a9e('0x4a')](_0x24936a[_0x0a9e('0x3f')],_0x1ef87a[_0x0a9e('0x40')]),_0x31916f);if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]){_0x381c37[_0x0a9e('0x49')]=_[_0x0a9e('0x4c')](_0x381c37[_0x0a9e('0x49')],{'$or':_['map'](_0x31916f,function(_0x117c99){if(_0x117c99[_0x0a9e('0x3d')]!==_0x0a9e('0x4d')){var _0xfbd5ad={};_0xfbd5ad[_0x117c99[_0x0a9e('0x38')]]={'$like':'%'+_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]+'%'};return _0xfbd5ad;}})});}_0x381c37=_[_0x0a9e('0x4c')]({},_0x381c37,_0x24936a['options']);var _0x2e9d90={'where':_0x381c37['where']};return db[_0x0a9e('0x3b')][_0x0a9e('0x2f')](_0x2e9d90)[_0x0a9e('0x1d')](function(_0x562fb4){_0x4f41ae[_0x0a9e('0x2f')]=_0x562fb4;if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4e')]){_0x381c37[_0x0a9e('0x4f')]=[{'all':!![]}];}return db[_0x0a9e('0x3b')][_0x0a9e('0x50')](_0x381c37);})[_0x0a9e('0x1d')](function(_0x5bbcde){_0x4f41ae[_0x0a9e('0x51')]=_0x5bbcde;return _0x4f41ae;})[_0x0a9e('0x1d')](respondWithFilteredResult(_0x3d9717,_0x381c37))[_0x0a9e('0x28')](handleError(_0x3d9717,null));};exports[_0x0a9e('0x52')]=function(_0x409789,_0x992c77){var _0x6054ee={'raw':!![],'where':{'id':_0x409789[_0x0a9e('0x53')]['id']}},_0x19383e={};_0x19383e['model']=_[_0x0a9e('0x3e')](db[_0x0a9e('0x3b')]['rawAttributes']);_0x19383e['query']=_['keys'](_0x409789[_0x0a9e('0x3f')]);_0x19383e[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],_0x19383e[_0x0a9e('0x3f')]);_0x6054ee[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],qs['fields'](_0x409789['query']['fields']));_0x6054ee[_0x0a9e('0x42')]=_0x6054ee[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x6054ee['attributes']:_0x19383e[_0x0a9e('0x45')];if(_0x409789[_0x0a9e('0x3f')]['includeAll']){_0x6054ee['include']=[{'all':!![]}];}_0x6054ee=_[_0x0a9e('0x4c')]({},_0x6054ee,_0x409789['options']);return db[_0x0a9e('0x3b')]['find'](_0x6054ee)[_0x0a9e('0x1d')](handleEntityNotFound(_0x992c77,null))[_0x0a9e('0x1d')](respondWithResult(_0x992c77,null))[_0x0a9e('0x28')](handleError(_0x992c77,null));};exports['create']=function(_0x2f82da,_0x1bf38a){return db['ChatMessage']['create'](_0x2f82da[_0x0a9e('0x54')],{})[_0x0a9e('0x1d')](respondWithResult(_0x1bf38a,0xc9))['catch'](handleError(_0x1bf38a,null));};exports[_0x0a9e('0x35')]=function(_0x5ce9ac,_0x211ef9){if(_0x5ce9ac['body']['id']){delete _0x5ce9ac[_0x0a9e('0x54')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x5ce9ac['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x211ef9,null))['then'](saveUpdates(_0x5ce9ac[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](respondWithResult(_0x211ef9,null))[_0x0a9e('0x28')](handleError(_0x211ef9,null));};exports[_0x0a9e('0x36')]=function(_0x232830,_0x272738){return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x232830['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x272738,null))[_0x0a9e('0x1d')](removeEntity(_0x272738,null))[_0x0a9e('0x28')](handleError(_0x272738,null));};exports[_0x0a9e('0x56')]=function(_0xb83dfd,_0x156662){return db['ChatMessage'][_0x0a9e('0x56')]()[_0x0a9e('0x1d')](respondWithResult(_0x156662,null))['catch'](handleError(_0x156662,null));};var interaction_log=require(_0x0a9e('0x57'))('chat-interactions');exports[_0x0a9e('0x58')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee){var _0x273cb5={'agent':{},'channel':'chat'};if(_0x5ba1f9[_0x0a9e('0x54')]['id']){delete _0x5ba1f9[_0x0a9e('0x54')]['id'];}_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x59')]=!![];_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5a')]=moment()['format'](_0x0a9e('0x5b'));_0x5ba1f9['body'][_0x0a9e('0x5c')]=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')]||_0x5ba1f9['user']['id'];_0x273cb5[_0x0a9e('0x5d')]['id']=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')];return db[_0x0a9e('0x3b')]['find']({'where':{'id':_0x5ba1f9[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](saveUpdates(_0x5ba1f9[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](function(_0x88dcbf){if(_0x88dcbf){_0x273cb5[_0x0a9e('0x26')]=_0x88dcbf[_0x0a9e('0x5e')]({'plain':!![]});return db['ChatInteraction'][_0x0a9e('0x55')]({'where':{'id':_0x88dcbf[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](function(_0x3528b7){if(_0x3528b7){return _0x3528b7['update']({'UserId':_0x5ba1f9['body'][_0x0a9e('0x5c')],'read1stAt':_[_0x0a9e('0x60')](_0x3528b7[_0x0a9e('0x61')])?moment()[_0x0a9e('0x62')](_0x0a9e('0x5b')):undefined});}return null;})[_0x0a9e('0x1d')](function(_0x387489){if(_0x387489){_0x273cb5[_0x0a9e('0x63')]=_0x387489[_0x0a9e('0x5e')]({'plain':!![]});interaction_log[_0x0a9e('0x1e')](_0x0a9e('0x64'),_0x5ba1f9[_0x0a9e('0x65')]['id'],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x66')],_0x273cb5[_0x0a9e('0x63')]['id'],_0x5ba1f9[_0x0a9e('0x54')]?JSON['stringify'](_0x5ba1f9[_0x0a9e('0x54')]):_0x0a9e('0x67'));return respondWithRpcPromise(_0x0a9e('0x68'),'acceptMessage',_0x273cb5);}return null;})[_0x0a9e('0x1d')](function(_0x30944e){var _0x4b341d=_0x0a9e('0x69')+_0x30944e[_0x0a9e('0x26')][_0x0a9e('0x6a')];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0x4b341d,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x0a9e('0x1d')](function(_0x18bf5d){return _0x18bf5d;});})[_0x0a9e('0x1d')](function(_0x23a7d3){if(_0x23a7d3){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x23a7d3[0x0];if(!_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),'fullname',_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})['then'](function(_0x2ed01e){if(!_0x2ed01e)return null;_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x2ed01e;return _0x273cb5;})[_0x0a9e('0x1d')](function(_0x542ece){if(_0x542ece){if(_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x6f')]){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x70')]=util['format'](_0x0a9e('0x71'),_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')]);_0x273cb5[_0x0a9e('0x26')]['channel']=_0x273cb5[_0x0a9e('0x72')];_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x58');return respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x75'),'message':_[_0x0a9e('0x4c')](_0x273cb5[_0x0a9e('0x26')],JSON[_0x0a9e('0x76')](_0x273cb5[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002)[_0x0a9e('0x1d')](function(){return _0x273cb5;});}return _0x273cb5;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x4b3c1a,null))['catch'](handleError(_0x4b3c1a,null));};var interaction_log=require(_0x0a9e('0x57'))(_0x0a9e('0x78'));exports[_0x0a9e('0x33')]=function(_0x563627,_0x3736e0,_0x33dda0){var _0x8cea96={'agent':{},'channel':_0x0a9e('0x79')};if(_0x563627['body']['id']){delete _0x563627['body']['id'];}_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')]=_0x563627['body'][_0x0a9e('0x5c')]||_0x563627['user']['id'];_0x8cea96[_0x0a9e('0x5d')]['id']=_0x563627[_0x0a9e('0x54')]['UserId'];return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))[_0x0a9e('0x1d')](function(_0x1f42a0){if(_0x1f42a0){_0x8cea96[_0x0a9e('0x26')]=_0x1f42a0['get']({'plain':!![]});return db[_0x0a9e('0x7a')][_0x0a9e('0x55')]({'where':{'id':_0x1f42a0[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))['then'](function(_0xf51744){if(_0xf51744){_0x8cea96[_0x0a9e('0x63')]=_0xf51744['get']({'plain':!![]});interaction_log[_0x0a9e('0x1e')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x563627[_0x0a9e('0x65')]['id'],_0x563627[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x563627[_0x0a9e('0x65')]['role'],_0x8cea96['interaction']['id'],_0x563627[_0x0a9e('0x54')]?JSON[_0x0a9e('0x23')](_0x563627[_0x0a9e('0x54')]):'null');return respondWithRpcPromise(_0x0a9e('0x7b'),_0x0a9e('0x7c'),_0x8cea96);}return null;})['then'](function(_0x4e46b2){var _0xf0a802='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4e46b2['message']['ContactId'];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0xf0a802,{'type':db[_0x0a9e('0x7d')][_0x0a9e('0x7e')][_0x0a9e('0x7f')],'raw':!![]})[_0x0a9e('0x1d')](function(_0x5a8854){return _0x5a8854;});})[_0x0a9e('0x1d')](function(_0x5955f1){if(_0x5955f1){_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x5955f1[0x0];if(!_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),_0x0a9e('0x80'),_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})[_0x0a9e('0x1d')](function(_0x1910bf){if(!_0x1910bf)return null;_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x1910bf;return _0x8cea96;})['then'](function(_0x2645d6){if(_0x2645d6){_0x2645d6[_0x0a9e('0x26')]['interface']=util[_0x0a9e('0x62')](_0x0a9e('0x71'),_0x563627[_0x0a9e('0x65')]['name']);_0x2645d6[_0x0a9e('0x26')]['channel']=_0x8cea96[_0x0a9e('0x72')];_0x2645d6[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x33');respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x81'),'message':_[_0x0a9e('0x4c')](_0x8cea96['message'],JSON[_0x0a9e('0x76')](_0x8cea96[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002);return _0x8cea96;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x3736e0,null))[_0x0a9e('0x28')](handleError(_0x3736e0,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index ab281de..352bc25 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 _0xfd79=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x4f7d3b,_0x862020){var _0x40b525=function(_0x25437d){while(--_0x25437d){_0x4f7d3b['push'](_0x4f7d3b['shift']());}};_0x40b525(++_0x862020);}(_0xfd79,0x194));var _0x9fd7=function(_0x254aa9,_0x231c46){_0x254aa9=_0x254aa9-0x0;var _0x133690=_0xfd79[_0x254aa9];return _0x133690;};'use strict';var EventEmitter=require(_0x9fd7('0x0'));var ChatMessage=require(_0x9fd7('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x9fd7('0x2')](0x0);var events={'afterCreate':_0x9fd7('0x3'),'afterUpdate':_0x9fd7('0x4'),'afterDestroy':_0x9fd7('0x5')};function emitEvent(_0x3f74f3){return function(_0x3139b2,_0x10a924,_0x376169){ChatMessageEvents[_0x9fd7('0x6')](_0x3f74f3+':'+_0x3139b2['id'],_0x3139b2);ChatMessageEvents[_0x9fd7('0x6')](_0x3f74f3,_0x3139b2);_0x376169(null);};}for(var e in events){if(events[_0x9fd7('0x7')](e)){var event=events[e];ChatMessage[_0x9fd7('0x8')](e,emitEvent(event));}}module[_0x9fd7('0x9')]=ChatMessageEvents; \ No newline at end of file +var _0x627f=['setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','../../mysqldb','ChatMessage'];(function(_0x296f49,_0x20cec6){var _0xf4a5fd=function(_0x1b0892){while(--_0x1b0892){_0x296f49['push'](_0x296f49['shift']());}};_0xf4a5fd(++_0x20cec6);}(_0x627f,0xf1));var _0xf627=function(_0x26a293,_0x8c83d1){_0x26a293=_0x26a293-0x0;var _0xf7fdc0=_0x627f[_0x26a293];return _0xf7fdc0;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0xf627('0x0'))['db'][_0xf627('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xf627('0x2')](0x0);var events={'afterCreate':_0xf627('0x3'),'afterUpdate':_0xf627('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5e06fd){return function(_0x29c134,_0x5e1513,_0x2d45a8){ChatMessageEvents[_0xf627('0x5')](_0x5e06fd+':'+_0x29c134['id'],_0x29c134);ChatMessageEvents[_0xf627('0x5')](_0x5e06fd,_0x29c134);_0x2d45a8(null);};}for(var e in events){if(events[_0xf627('0x6')](e)){var event=events[e];ChatMessage[_0xf627('0x7')](e,emitEvent(event));}}module[_0xf627('0x8')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 0851856..651476a 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 _0x1b07=['moment','bluebird','path','./chatMessage.attributes','define','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','ChatInteraction','findOne','then','update','createdAt','error','utf8mb4_unicode_ci','lodash','util','api'];(function(_0x3dab54,_0x17ae72){var _0x144d02=function(_0x242f74){while(--_0x242f74){_0x3dab54['push'](_0x3dab54['shift']());}};_0x144d02(++_0x17ae72);}(_0x1b07,0xcd));var _0x71b0=function(_0x41d02a,_0x355e19){_0x41d02a=_0x41d02a-0x0;var _0x4c3983=_0x1b07[_0x41d02a];return _0x4c3983;};'use strict';var _=require(_0x71b0('0x0'));var util=require(_0x71b0('0x1'));var logger=require('../../config/logger')(_0x71b0('0x2'));var moment=require(_0x71b0('0x3'));var BPromise=require(_0x71b0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x71b0('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x71b0('0x6'));module['exports']=function(_0x4704c4,_0x2268de){return _0x4704c4[_0x71b0('0x7')]('ChatMessage',attributes,{'tableName':_0x71b0('0x8'),'paranoid':![],'indexes':[{'name':_0x71b0('0x9'),'fields':[_0x71b0('0xa')],'type':_0x71b0('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2c12a4,_0x525bc9,_0x33c3e8){var _0x1c3a58=_0x4704c4[_0x71b0('0xc')];var _0x29e215=_0x2c12a4[_0x71b0('0xd')]({'plain':!![]});if(_0x29e215[_0x71b0('0xe')][_0x71b0('0xf')]()==='in'||_0x29e215['direction']['toLowerCase']()===_0x71b0('0x10')&&!_0x29e215[_0x71b0('0x11')]&&!_[_0x71b0('0x12')](_0x29e215['UserId'])){_0x1c3a58[_0x71b0('0x13')][_0x71b0('0x14')]({'where':{'id':_0x29e215['ChatInteractionId']}})[_0x71b0('0x15')](function(_0x53f807){if(_0x53f807){_0x53f807[_0x71b0('0x16')]({'lastMsgAt':_0x29e215[_0x71b0('0x17')],'lastMsgDirection':_0x29e215[_0x71b0('0xe')]['toLowerCase']()});}})['catch'](function(_0x2e9b43){console[_0x71b0('0x18')](_0x2e9b43);});}_0x33c3e8();}},'charset':'utf8mb4','collate':_0x71b0('0x19')});}; \ No newline at end of file +var _0x2e57=['direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','utf8mb4_unicode_ci','util','../../config/logger','api','request-promise','path','../../config/environment','./chatMessage.attributes','exports','ChatMessage','fti_chat_messages','FULLTEXT','models','get'];(function(_0x20fdc1,_0xde1296){var _0x25397c=function(_0x814b51){while(--_0x814b51){_0x20fdc1['push'](_0x20fdc1['shift']());}};_0x25397c(++_0xde1296);}(_0x2e57,0x1ad));var _0x72e5=function(_0x48531e,_0x2ad085){_0x48531e=_0x48531e-0x0;var _0x1fbfa3=_0x2e57[_0x48531e];return _0x1fbfa3;};'use strict';var _=require('lodash');var util=require(_0x72e5('0x0'));var logger=require(_0x72e5('0x1'))(_0x72e5('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x72e5('0x3'));var fs=require('fs');var path=require(_0x72e5('0x4'));var rimraf=require('rimraf');var config=require(_0x72e5('0x5'));var attributes=require(_0x72e5('0x6'));module[_0x72e5('0x7')]=function(_0x2f60da,_0x4d3ec4){return _0x2f60da['define'](_0x72e5('0x8'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x72e5('0x9'),'fields':['body'],'type':_0x72e5('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3c219a,_0x330944,_0x2c8ee4){var _0x34d78e=_0x2f60da[_0x72e5('0xb')];var _0x3d6f13=_0x3c219a[_0x72e5('0xc')]({'plain':!![]});if(_0x3d6f13[_0x72e5('0xd')][_0x72e5('0xe')]()==='in'||_0x3d6f13['direction'][_0x72e5('0xe')]()===_0x72e5('0xf')&&!_0x3d6f13[_0x72e5('0x10')]&&!_[_0x72e5('0x11')](_0x3d6f13[_0x72e5('0x12')])){_0x34d78e[_0x72e5('0x13')][_0x72e5('0x14')]({'where':{'id':_0x3d6f13[_0x72e5('0x15')]}})[_0x72e5('0x16')](function(_0x2cb07){if(_0x2cb07){_0x2cb07[_0x72e5('0x17')]({'lastMsgAt':_0x3d6f13[_0x72e5('0x18')],'lastMsgDirection':_0x3d6f13[_0x72e5('0xd')][_0x72e5('0xe')]()});}})['catch'](function(_0x209661){console['error'](_0x209661);});}_0x2c8ee4();}},'charset':'utf8mb4','collate':_0x72e5('0x19')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index bebcd36..8785121 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 _0x4ff8=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./chatMessage.socket','register','request','then','info','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','ChatMessage,\x20%s,\x20%s','result','catch','ChatMessage','create','body','options','CreateChatMessage','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x54be74,_0x37c908){var _0x47da47=function(_0x233b4b){while(--_0x233b4b){_0x54be74['push'](_0x54be74['shift']());}};_0x47da47(++_0x37c908);}(_0x4ff8,0xcc));var _0x84ff=function(_0x44ba23,_0x34546d){_0x44ba23=_0x44ba23-0x0;var _0x5d8b84=_0x4ff8[_0x44ba23];return _0x5d8b84;};'use strict';var _=require(_0x84ff('0x0'));var util=require(_0x84ff('0x1'));var moment=require(_0x84ff('0x2'));var BPromise=require(_0x84ff('0x3'));var rs=require(_0x84ff('0x4'));var fs=require('fs');var Redis=require(_0x84ff('0x5'));var db=require(_0x84ff('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x84ff('0x7'))(_0x84ff('0x8'));var config=require(_0x84ff('0x9'));var jayson=require(_0x84ff('0xa'));var client=jayson[_0x84ff('0xb')][_0x84ff('0xc')]({'port':0x232a});config[_0x84ff('0xd')]=_[_0x84ff('0xe')](config[_0x84ff('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x84ff('0xf'))[_0x84ff('0x10')](socket);function respondWithRpcPromise(_0x4067b9,_0x45cd72,_0x13bf86){return new BPromise(function(_0x3dc6e2,_0x14b9e7){return client[_0x84ff('0x11')](_0x4067b9,_0x13bf86)[_0x84ff('0x12')](function(_0x4e5a76){logger[_0x84ff('0x13')]('ChatMessage,\x20%s,\x20%s',_0x45cd72,'request\x20sent');logger[_0x84ff('0x14')](_0x84ff('0x15'),_0x45cd72,_0x84ff('0x16'),JSON[_0x84ff('0x17')](_0x4e5a76));if(_0x4e5a76[_0x84ff('0x18')]){if(_0x4e5a76[_0x84ff('0x18')][_0x84ff('0x19')]===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0x45cd72,_0x4e5a76[_0x84ff('0x18')]['message']);return _0x14b9e7(_0x4e5a76[_0x84ff('0x18')][_0x84ff('0x1a')]);}logger[_0x84ff('0x18')](_0x84ff('0x1b'),_0x45cd72,_0x4e5a76['error'][_0x84ff('0x1a')]);return _0x3dc6e2(_0x4e5a76[_0x84ff('0x18')][_0x84ff('0x1a')]);}else{logger[_0x84ff('0x13')](_0x84ff('0x1b'),_0x45cd72,_0x84ff('0x16'));_0x3dc6e2(_0x4e5a76[_0x84ff('0x1c')]['message']);}})[_0x84ff('0x1d')](function(_0x568223){logger['error']('ChatMessage,\x20%s,\x20%s',_0x45cd72,_0x568223);_0x14b9e7(_0x568223);});});}exports['CreateChatMessage']=function(_0x562adc){var _0x296d35=this;return new Promise(function(_0x34da18,_0x20381b){return db[_0x84ff('0x1e')][_0x84ff('0x1f')](_0x562adc[_0x84ff('0x20')],{'raw':_0x562adc[_0x84ff('0x21')]?_0x562adc[_0x84ff('0x21')]['raw']===undefined?!![]:![]:!![]})[_0x84ff('0x12')](function(_0x2bb763){logger[_0x84ff('0x13')](_0x84ff('0x22'),_0x562adc);logger[_0x84ff('0x14')](_0x84ff('0x22'),_0x562adc,JSON['stringify'](_0x2bb763));_0x34da18(_0x2bb763);})[_0x84ff('0x1d')](function(_0x3070a4){logger[_0x84ff('0x18')]('CreateChatMessage',_0x3070a4['message'],_0x562adc);_0x20381b(_0x296d35[_0x84ff('0x18')](0x1f4,_0x3070a4[_0x84ff('0x1a')]));});});}; \ No newline at end of file +var _0x0ec0=['ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','then','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0ec0,0x12f));var _0x00ec=function(_0x382941,_0x45cc4b){_0x382941=_0x382941-0x0;var _0x3e7aa4=_0x0ec0[_0x382941];return _0x3e7aa4;};'use strict';var _=require(_0x00ec('0x0'));var util=require(_0x00ec('0x1'));var moment=require(_0x00ec('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x00ec('0x3'));var db=require(_0x00ec('0x4'))['db'];var utils=require(_0x00ec('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x00ec('0x6'));var jayson=require(_0x00ec('0x7'));var client=jayson[_0x00ec('0x8')][_0x00ec('0x9')]({'port':0x232a});config[_0x00ec('0xa')]=_['defaults'](config[_0x00ec('0xa')],{'host':_0x00ec('0xb'),'port':0x18eb});var socket=require(_0x00ec('0xc'))(new Redis(config['redis']));require('./chatMessage.socket')[_0x00ec('0xd')](socket);function respondWithRpcPromise(_0x341a76,_0x57a268,_0x4f94b9){return new BPromise(function(_0xdc755,_0x3c95f9){return client[_0x00ec('0xe')](_0x341a76,_0x4f94b9)[_0x00ec('0xf')](function(_0x3993cb){logger[_0x00ec('0x10')](_0x00ec('0x11'),_0x57a268,_0x00ec('0x12'));logger[_0x00ec('0x13')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x57a268,'request\x20sent',JSON[_0x00ec('0x14')](_0x3993cb));if(_0x3993cb[_0x00ec('0x15')]){if(_0x3993cb[_0x00ec('0x15')][_0x00ec('0x16')]===0x1f4){logger[_0x00ec('0x15')](_0x00ec('0x11'),_0x57a268,_0x3993cb['error'][_0x00ec('0x17')]);return _0x3c95f9(_0x3993cb[_0x00ec('0x15')][_0x00ec('0x17')]);}logger[_0x00ec('0x15')](_0x00ec('0x11'),_0x57a268,_0x3993cb[_0x00ec('0x15')]['message']);return _0xdc755(_0x3993cb[_0x00ec('0x15')][_0x00ec('0x17')]);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x57a268,'request\x20sent');_0xdc755(_0x3993cb[_0x00ec('0x18')][_0x00ec('0x17')]);}})[_0x00ec('0x19')](function(_0x315afc){logger['error']('ChatMessage,\x20%s,\x20%s',_0x57a268,_0x315afc);_0x3c95f9(_0x315afc);});});}exports[_0x00ec('0x1a')]=function(_0x6c0075){var _0x1150ae=this;return new Promise(function(_0x411102,_0x46a358){return db[_0x00ec('0x1b')][_0x00ec('0x1c')](_0x6c0075[_0x00ec('0x1d')],{'raw':_0x6c0075[_0x00ec('0x1e')]?_0x6c0075[_0x00ec('0x1e')][_0x00ec('0x1f')]===undefined?!![]:![]:!![]})[_0x00ec('0xf')](function(_0x2bc10d){logger[_0x00ec('0x10')]('CreateChatMessage',_0x6c0075);logger[_0x00ec('0x13')](_0x00ec('0x1a'),_0x6c0075,JSON[_0x00ec('0x14')](_0x2bc10d));_0x411102(_0x2bc10d);})[_0x00ec('0x19')](function(_0x55c905){logger['error'](_0x00ec('0x1a'),_0x55c905[_0x00ec('0x17')],_0x6c0075);_0x46a358(_0x1150ae[_0x00ec('0x15')](0x1f4,_0x55c905[_0x00ec('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 17e8115..fcee830 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 _0x1af3=['emit','register','chatMessage:','./chatMessage.events','save','remove','update'];(function(_0x3f281b,_0x4fc4db){var _0x1db635=function(_0x202ec0){while(--_0x202ec0){_0x3f281b['push'](_0x3f281b['shift']());}};_0x1db635(++_0x4fc4db);}(_0x1af3,0x1ca));var _0x31af=function(_0x29e35f,_0x4859ef){_0x29e35f=_0x29e35f-0x0;var _0x266b74=_0x1af3[_0x29e35f];return _0x266b74;};'use strict';var ChatMessageEvents=require(_0x31af('0x0'));var events=[_0x31af('0x1'),_0x31af('0x2'),_0x31af('0x3')];function createListener(_0x450506,_0xf27e22){return function(_0x3d693c){_0xf27e22[_0x31af('0x4')](_0x450506,_0x3d693c);};}function removeListener(_0x3d64ae,_0xc098ee){return function(){ChatMessageEvents['removeListener'](_0x3d64ae,_0xc098ee);};}exports[_0x31af('0x5')]=function(_0x416162){for(var _0x1ac3f6=0x0,_0x21ddc5=events['length'];_0x1ac3f6<_0x21ddc5;_0x1ac3f6++){var _0x6be8e9=events[_0x1ac3f6];var _0x1833de=createListener(_0x31af('0x6')+_0x6be8e9,_0x416162);ChatMessageEvents['on'](_0x6be8e9,_0x1833de);}}; \ No newline at end of file +var _0xe5d5=['length','chatMessage:','remove','removeListener','register'];(function(_0x3616bb,_0x86fe00){var _0x1c0994=function(_0x46a1d4){while(--_0x46a1d4){_0x3616bb['push'](_0x3616bb['shift']());}};_0x1c0994(++_0x86fe00);}(_0xe5d5,0x156));var _0x5e5d=function(_0x5baebf,_0x350547){_0x5baebf=_0x5baebf-0x0;var _0x16d7c8=_0xe5d5[_0x5baebf];return _0x16d7c8;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=['save',_0x5e5d('0x0'),'update'];function createListener(_0x9f47d6,_0x4b8ae9){return function(_0x50afd3){_0x4b8ae9['emit'](_0x9f47d6,_0x50afd3);};}function removeListener(_0x3e2410,_0x191980){return function(){ChatMessageEvents[_0x5e5d('0x1')](_0x3e2410,_0x191980);};}exports[_0x5e5d('0x2')]=function(_0x13bcb7){for(var _0x39077f=0x0,_0x3200d5=events[_0x5e5d('0x3')];_0x39077f<_0x3200d5;_0x39077f++){var _0x23de8d=events[_0x39077f];var _0x131a59=createListener(_0x5e5d('0x4')+_0x23de8d,_0x13bcb7);ChatMessageEvents['on'](_0x23de8d,_0x131a59);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index a643153..f8b1503 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 _0xb429=['./chatMessage.controller','get','isAuthenticated','/:id','show','post','tracked','chat','chatmessage:create','put','update','/:id/accept','accept','/:id/reject','delete','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1489a5,_0x1fa1bd){var _0x1350fc=function(_0x2fbbc1){while(--_0x2fbbc1){_0x1489a5['push'](_0x1489a5['shift']());}};_0x1350fc(++_0x1fa1bd);}(_0xb429,0x143));var _0x9b42=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xb429[_0xea8947];return _0x2455e9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9b42('0x0'));var timeout=require('connect-timeout');var express=require(_0x9b42('0x1'));var router=express[_0x9b42('0x2')]();var fs_extra=require(_0x9b42('0x3'));var auth=require(_0x9b42('0x4'));var interaction=require(_0x9b42('0x5'));var config=require(_0x9b42('0x6'));var controller=require(_0x9b42('0x7'));router[_0x9b42('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9b42('0x8')]('/describe',auth[_0x9b42('0x9')](),controller['describe']);router[_0x9b42('0x8')](_0x9b42('0xa'),auth[_0x9b42('0x9')](),controller[_0x9b42('0xb')]);router[_0x9b42('0xc')]('/',auth[_0x9b42('0x9')](),interaction[_0x9b42('0xd')](_0x9b42('0xe'),_0x9b42('0xf')),controller['create']);router[_0x9b42('0x10')]('/:id',controller[_0x9b42('0x11')]);router['put'](_0x9b42('0x12'),auth[_0x9b42('0x9')](),controller[_0x9b42('0x13')]);router[_0x9b42('0x10')](_0x9b42('0x14'),auth[_0x9b42('0x9')](),controller['reject']);router[_0x9b42('0x15')]('/:id',auth[_0x9b42('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x0695=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','post','tracked','create','put','update','/:id/accept','accept','/:id/reject','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x528bb5,_0x119c5b){var _0x58e8ca=function(_0x5a8077){while(--_0x5a8077){_0x528bb5['push'](_0x528bb5['shift']());}};_0x58e8ca(++_0x119c5b);}(_0x0695,0xa9));var _0x5069=function(_0x408dc8,_0x2c16d1){_0x408dc8=_0x408dc8-0x0;var _0x24aec6=_0x0695[_0x408dc8];return _0x24aec6;};'use strict';var multer=require(_0x5069('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5069('0x1'));var express=require(_0x5069('0x2'));var router=express[_0x5069('0x3')]();var fs_extra=require(_0x5069('0x4'));var auth=require(_0x5069('0x5'));var interaction=require(_0x5069('0x6'));var config=require(_0x5069('0x7'));var controller=require('./chatMessage.controller');router[_0x5069('0x8')]('/',auth[_0x5069('0x9')](),controller[_0x5069('0xa')]);router[_0x5069('0x8')](_0x5069('0xb'),auth['isAuthenticated'](),controller[_0x5069('0xc')]);router[_0x5069('0x8')](_0x5069('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x5069('0xe')]('/',auth[_0x5069('0x9')](),interaction[_0x5069('0xf')]('chat','chatmessage:create'),controller[_0x5069('0x10')]);router[_0x5069('0x11')](_0x5069('0xd'),controller[_0x5069('0x12')]);router[_0x5069('0x11')](_0x5069('0x13'),auth['isAuthenticated'](),controller[_0x5069('0x14')]);router[_0x5069('0x11')](_0x5069('0x15'),auth[_0x5069('0x9')](),controller['reject']);router[_0x5069('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x5069('0x17')]);module[_0x5069('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 0549e0a..2bdff46 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 _0x8327=['sequelize','exports','TEXT','medium'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x8327,0x110));var _0x7832=function(_0x3e37fc,_0xc8295a){_0x3e37fc=_0x3e37fc-0x0;var _0x59438c=_0x8327[_0x3e37fc];return _0x59438c;};'use strict';var Sequelize=require(_0x7832('0x0'));module[_0x7832('0x1')]={'body':{'type':Sequelize[_0x7832('0x2')](_0x7832('0x3')),'allowNull':![]}}; \ No newline at end of file +var _0xa574=['TEXT','medium','sequelize'];(function(_0x1da04e,_0x31024b){var _0xdd8c41=function(_0x2036f9){while(--_0x2036f9){_0x1da04e['push'](_0x1da04e['shift']());}};_0xdd8c41(++_0x31024b);}(_0xa574,0x158));var _0x4a57=function(_0x100f79,_0x3c24d6){_0x100f79=_0x100f79-0x0;var _0xf5f92c=_0xa574[_0x100f79];return _0xf5f92c;};'use strict';var Sequelize=require(_0x4a57('0x0'));module['exports']={'body':{'type':Sequelize[_0x4a57('0x1')](_0x4a57('0x2')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 353ef9a..90399ed 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 _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(_0x522834,_0x22a649){var _0x4ffdd3=function(_0x2f5ef2){while(--_0x2f5ef2){_0x522834['push'](_0x522834['shift']());}};_0x4ffdd3(++_0x22a649);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'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 +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(_0x51e04a,_0x157cb1){var _0x3d7f01=function(_0x53a448){while(--_0x53a448){_0x51e04a['push'](_0x51e04a['shift']());}};_0x3d7f01(++_0x157cb1);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'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.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 325dbe4..4ae94fc 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 _0xd2a7=['bluebird','request-promise','path','../../config/environment','./chatOfflineMessage.attributes','exports','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x5c9307,_0x5b97e4){var _0x373e29=function(_0xefebbd){while(--_0xefebbd){_0x5c9307['push'](_0x5c9307['shift']());}};_0x373e29(++_0x5b97e4);}(_0xd2a7,0x1db));var _0x7d2a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd2a7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7d2a('0x0'));var util=require(_0x7d2a('0x1'));var logger=require(_0x7d2a('0x2'))(_0x7d2a('0x3'));var moment=require(_0x7d2a('0x4'));var BPromise=require(_0x7d2a('0x5'));var rp=require(_0x7d2a('0x6'));var fs=require('fs');var path=require(_0x7d2a('0x7'));var rimraf=require('rimraf');var config=require(_0x7d2a('0x8'));var attributes=require(_0x7d2a('0x9'));module[_0x7d2a('0xa')]=function(_0x1b6bbe,_0x1e8124){return _0x1b6bbe['define'](_0x7d2a('0xb'),attributes,{'tableName':_0x7d2a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7d2a('0xd'),'collate':_0x7d2a('0xe')});}; \ No newline at end of file +var _0xd556=['ChatOfflineMessage','chat_offline_messages','utf8mb4','util','api','moment','request-promise','rimraf','../../config/environment','./chatOfflineMessage.attributes'];(function(_0x381589,_0x27a707){var _0x2a075d=function(_0x4ea19d){while(--_0x4ea19d){_0x381589['push'](_0x381589['shift']());}};_0x2a075d(++_0x27a707);}(_0xd556,0xfd));var _0x6d55=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xd556[_0x53ccf2];return _0x5a2964;};'use strict';var _=require('lodash');var util=require(_0x6d55('0x0'));var logger=require('../../config/logger')(_0x6d55('0x1'));var moment=require(_0x6d55('0x2'));var BPromise=require('bluebird');var rp=require(_0x6d55('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6d55('0x4'));var config=require(_0x6d55('0x5'));var attributes=require(_0x6d55('0x6'));module['exports']=function(_0xae4461,_0x150326){return _0xae4461['define'](_0x6d55('0x7'),attributes,{'tableName':_0x6d55('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6d55('0x9'),'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 52a2fdb..5e79278 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 _0x1354=['message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x1354,0x95));var _0x4135=function(_0x34a459,_0x136cd9){_0x34a459=_0x34a459-0x0;var _0x500f8b=_0x1354[_0x34a459];return _0x500f8b;};'use strict';var _=require(_0x4135('0x0'));var util=require(_0x4135('0x1'));var moment=require(_0x4135('0x2'));var BPromise=require(_0x4135('0x3'));var rs=require(_0x4135('0x4'));var fs=require('fs');var Redis=require(_0x4135('0x5'));var db=require(_0x4135('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4135('0x7'))(_0x4135('0x8'));var config=require(_0x4135('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4135('0xa')][_0x4135('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5e355d,_0x419ad4,_0x1dcce0){return new BPromise(function(_0x3e7ae3,_0x50ef3f){return client[_0x4135('0xc')](_0x5e355d,_0x1dcce0)['then'](function(_0x365d9b){logger[_0x4135('0xd')](_0x4135('0xe'),_0x419ad4,_0x4135('0xf'));logger['debug'](_0x4135('0x10'),_0x419ad4,'request\x20sent',JSON['stringify'](_0x365d9b));if(_0x365d9b[_0x4135('0x11')]){if(_0x365d9b[_0x4135('0x11')][_0x4135('0x12')]===0x1f4){logger['error'](_0x4135('0xe'),_0x419ad4,_0x365d9b[_0x4135('0x11')][_0x4135('0x13')]);return _0x50ef3f(_0x365d9b[_0x4135('0x11')][_0x4135('0x13')]);}logger[_0x4135('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x419ad4,_0x365d9b['error'][_0x4135('0x13')]);return _0x3e7ae3(_0x365d9b[_0x4135('0x11')][_0x4135('0x13')]);}else{logger[_0x4135('0xd')]('ChatOfflineMessage,\x20%s,\x20%s',_0x419ad4,_0x4135('0xf'));_0x3e7ae3(_0x365d9b[_0x4135('0x14')]['message']);}})['catch'](function(_0x32b4db){logger['error'](_0x4135('0xe'),_0x419ad4,_0x32b4db);_0x50ef3f(_0x32b4db);});});} \ No newline at end of file +var _0xdbad=['message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x28ec5a,_0x5143de){var _0x4b90b5=function(_0x3d76e3){while(--_0x3d76e3){_0x28ec5a['push'](_0x28ec5a['shift']());}};_0x4b90b5(++_0x5143de);}(_0xdbad,0x8d));var _0xddba=function(_0x3a7e0a,_0x16ce30){_0x3a7e0a=_0x3a7e0a-0x0;var _0x1abde1=_0xdbad[_0x3a7e0a];return _0x1abde1;};'use strict';var _=require(_0xddba('0x0'));var util=require(_0xddba('0x1'));var moment=require(_0xddba('0x2'));var BPromise=require(_0xddba('0x3'));var rs=require(_0xddba('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xddba('0x5'))['db'];var utils=require(_0xddba('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xddba('0x7'));var jayson=require(_0xddba('0x8'));var client=jayson['client'][_0xddba('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xede08f,_0x1a5d98,_0x4ed8d1){return new BPromise(function(_0x4a2da7,_0x5dc34d){return client[_0xddba('0xa')](_0xede08f,_0x4ed8d1)[_0xddba('0xb')](function(_0x4a6897){logger[_0xddba('0xc')](_0xddba('0xd'),_0x1a5d98,_0xddba('0xe'));logger[_0xddba('0xf')](_0xddba('0x10'),_0x1a5d98,'request\x20sent',JSON[_0xddba('0x11')](_0x4a6897));if(_0x4a6897[_0xddba('0x12')]){if(_0x4a6897['error'][_0xddba('0x13')]===0x1f4){logger[_0xddba('0x12')]('ChatOfflineMessage,\x20%s,\x20%s',_0x1a5d98,_0x4a6897['error'][_0xddba('0x14')]);return _0x5dc34d(_0x4a6897[_0xddba('0x12')]['message']);}logger[_0xddba('0x12')](_0xddba('0xd'),_0x1a5d98,_0x4a6897[_0xddba('0x12')][_0xddba('0x14')]);return _0x4a2da7(_0x4a6897[_0xddba('0x12')][_0xddba('0x14')]);}else{logger['info'](_0xddba('0xd'),_0x1a5d98,_0xddba('0xe'));_0x4a2da7(_0x4a6897[_0xddba('0x15')][_0xddba('0x14')]);}})[_0xddba('0x16')](function(_0x2663d9){logger[_0xddba('0x12')]('ChatOfflineMessage,\x20%s,\x20%s',_0x1a5d98,_0x2663d9);_0x5dc34d(_0x2663d9);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index ec369b1..9cb5c47 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 _0xf049=['post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x15af7c,_0x434d47){var _0x3e97a6=function(_0x35ce61){while(--_0x35ce61){_0x15af7c['push'](_0x15af7c['shift']());}};_0x3e97a6(++_0x434d47);}(_0xf049,0x150));var _0x9f04=function(_0x61aeac,_0x496cbb){_0x61aeac=_0x61aeac-0x0;var _0x3c45c7=_0xf049[_0x61aeac];return _0x3c45c7;};'use strict';var multer=require(_0x9f04('0x0'));var util=require(_0x9f04('0x1'));var path=require(_0x9f04('0x2'));var timeout=require(_0x9f04('0x3'));var express=require(_0x9f04('0x4'));var router=express['Router']();var fs_extra=require(_0x9f04('0x5'));var auth=require(_0x9f04('0x6'));var interaction=require(_0x9f04('0x7'));var config=require(_0x9f04('0x8'));var controller=require(_0x9f04('0x9'));router[_0x9f04('0xa')]('/',auth[_0x9f04('0xb')](),controller[_0x9f04('0xc')]);router[_0x9f04('0xa')](_0x9f04('0xd'),auth[_0x9f04('0xb')](),controller[_0x9f04('0xe')]);router[_0x9f04('0xa')](_0x9f04('0xf'),auth[_0x9f04('0xb')](),controller['show']);router[_0x9f04('0x10')]('/',auth[_0x9f04('0xb')](),controller[_0x9f04('0x11')]);router[_0x9f04('0x12')](_0x9f04('0xf'),auth['isAuthenticated'](),controller[_0x9f04('0x13')]);router[_0x9f04('0x14')]('/:id',auth[_0x9f04('0xb')](),controller[_0x9f04('0x15')]);module['exports']=router; \ No newline at end of file +var _0x4460=['path','connect-timeout','fs-extra','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','delete','exports','multer','util'];(function(_0x3072c6,_0xce93df){var _0x393ea9=function(_0xb9ad20){while(--_0xb9ad20){_0x3072c6['push'](_0x3072c6['shift']());}};_0x393ea9(++_0xce93df);}(_0x4460,0x1d9));var _0x0446=function(_0x54c507,_0x4251c2){_0x54c507=_0x54c507-0x0;var _0x3a0463=_0x4460[_0x54c507];return _0x3a0463;};'use strict';var multer=require(_0x0446('0x0'));var util=require(_0x0446('0x1'));var path=require(_0x0446('0x2'));var timeout=require(_0x0446('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x0446('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0446('0x5'));var controller=require(_0x0446('0x6'));router[_0x0446('0x7')]('/',auth[_0x0446('0x8')](),controller[_0x0446('0x9')]);router[_0x0446('0x7')](_0x0446('0xa'),auth['isAuthenticated'](),controller[_0x0446('0xb')]);router[_0x0446('0x7')](_0x0446('0xc'),auth[_0x0446('0x8')](),controller[_0x0446('0xd')]);router[_0x0446('0xe')]('/',auth[_0x0446('0x8')](),controller['create']);router[_0x0446('0xf')](_0x0446('0xc'),auth[_0x0446('0x8')](),controller[_0x0446('0x10')]);router[_0x0446('0x11')]('/:id',auth[_0x0446('0x8')](),controller['destroy']);module[_0x0446('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 95ae4a9..0e41a47 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 _0x2553=['mouseOver','timeout','INTEGER','sequelize','STRING'];(function(_0x427386,_0x4b4025){var _0x77e104=function(_0x509407){while(--_0x509407){_0x427386['push'](_0x427386['shift']());}};_0x77e104(++_0x4b4025);}(_0x2553,0x1a2));var _0x3255=function(_0x184f5f,_0x2034dd){_0x184f5f=_0x184f5f-0x0;var _0x467cd7=_0x2553[_0x184f5f];return _0x467cd7;};'use strict';var Sequelize=require(_0x3255('0x0'));module['exports']={'name':{'type':Sequelize[_0x3255('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x3255('0x2'),_0x3255('0x3')),'defaultValue':_0x3255('0x2')},'selector':{'type':Sequelize[_0x3255('0x1')]},'timeout':{'type':Sequelize[_0x3255('0x4')]}}; \ No newline at end of file +var _0x24a7=['INTEGER','sequelize','STRING','ENUM','mouseOver','timeout'];(function(_0x20deea,_0x5b8557){var _0x42ef0c=function(_0x1e8d37){while(--_0x1e8d37){_0x20deea['push'](_0x20deea['shift']());}};_0x42ef0c(++_0x5b8557);}(_0x24a7,0x67));var _0x724a=function(_0x38ee5e,_0x54f363){_0x38ee5e=_0x38ee5e-0x0;var _0xc95b0f=_0x24a7[_0x38ee5e];return _0xc95b0f;};'use strict';var Sequelize=require(_0x724a('0x0'));module['exports']={'name':{'type':Sequelize[_0x724a('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x724a('0x2')](_0x724a('0x3'),_0x724a('0x4')),'defaultValue':_0x724a('0x3')},'selector':{'type':Sequelize[_0x724a('0x1')]},'timeout':{'type':Sequelize[_0x724a('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 8d98286..90f6747 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 _0x56e6=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','send','show','model','ChatProactiveAction','rawAttributes','keys','intersection','query','fields','attributes','includeAll','include','merge','find','catch','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto'];(function(_0x198635,_0x229516){var _0x1913bb=function(_0xc8019e){while(--_0xc8019e){_0x198635['push'](_0x198635['shift']());}};_0x1913bb(++_0x229516);}(_0x56e6,0x6b));var _0x656e=function(_0x88438a,_0x49a36f){_0x88438a=_0x88438a-0x0;var _0x573a37=_0x56e6[_0x88438a];return _0x573a37;};'use strict';var emlformat=require(_0x656e('0x0'));var rimraf=require(_0x656e('0x1'));var zipdir=require(_0x656e('0x2'));var jsonpatch=require(_0x656e('0x3'));var rp=require(_0x656e('0x4'));var moment=require(_0x656e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x656e('0x6'));var util=require(_0x656e('0x7'));var path=require(_0x656e('0x8'));var sox=require(_0x656e('0x9'));var csv=require(_0x656e('0xa'));var ejs=require(_0x656e('0xb'));var fs=require('fs');var fs_extra=require(_0x656e('0xc'));var _=require('lodash');var squel=require(_0x656e('0xd'));var crypto=require(_0x656e('0xe'));var jsforce=require(_0x656e('0xf'));var deskjs=require(_0x656e('0x10'));var toCsv=require(_0x656e('0xa'));var querystring=require(_0x656e('0x11'));var Papa=require(_0x656e('0x12'));var Redis=require(_0x656e('0x13'));var authService=require(_0x656e('0x14'));var qs=require(_0x656e('0x15'));var as=require(_0x656e('0x16'));var hardwareService=require(_0x656e('0x17'));var logger=require(_0x656e('0x18'))(_0x656e('0x19'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x656e('0x1a'));var db=require(_0x656e('0x1b'))['db'];function respondWithStatusCode(_0x3cb3c8,_0x460aad){_0x460aad=_0x460aad||0xcc;return function(_0x581525){if(_0x581525){return _0x3cb3c8['sendStatus'](_0x460aad);}return _0x3cb3c8[_0x656e('0x1c')](_0x460aad)[_0x656e('0x1d')]();};}function respondWithResult(_0x53699e,_0x230249){_0x230249=_0x230249||0xc8;return function(_0x5059d9){if(_0x5059d9){return _0x53699e[_0x656e('0x1c')](_0x230249)[_0x656e('0x1e')](_0x5059d9);}};}function respondWithFilteredResult(_0x2a52f7,_0x1f839f){return function(_0x5a1fc3){if(_0x5a1fc3){var _0x3ab51b=typeof _0x1f839f[_0x656e('0x1f')]===_0x656e('0x20')&&typeof _0x1f839f[_0x656e('0x21')]===_0x656e('0x20');var _0x4fd12e=_0x5a1fc3['count'];var _0x526b83=_0x3ab51b?0x0:_0x1f839f[_0x656e('0x1f')];var _0x1b0fdd=_0x3ab51b?_0x5a1fc3['count']:_0x1f839f[_0x656e('0x1f')]+_0x1f839f['limit'];var _0x495f60;if(_0x1b0fdd>=_0x4fd12e){_0x1b0fdd=_0x4fd12e;_0x495f60=0xc8;}else{_0x495f60=0xce;}_0x2a52f7['status'](_0x495f60);return _0x2a52f7[_0x656e('0x22')](_0x656e('0x23'),_0x526b83+'-'+_0x1b0fdd+'/'+_0x4fd12e)[_0x656e('0x1e')](_0x5a1fc3);}return null;};}function patchUpdates(_0x141587){return function(_0x5532ee){try{jsonpatch[_0x656e('0x24')](_0x5532ee,_0x141587,!![]);}catch(_0x543338){return BPromise[_0x656e('0x25')](_0x543338);}return _0x5532ee['save']();};}function saveUpdates(_0x159e42,_0x1acca5){return function(_0x19ab77){if(_0x19ab77){return _0x19ab77[_0x656e('0x26')](_0x159e42)[_0x656e('0x27')](function(_0x38ea02){return _0x38ea02;});}return null;};}function removeEntity(_0x382a5f,_0x57ac6c){return function(_0x44551b){if(_0x44551b){return _0x44551b[_0x656e('0x28')]()['then'](function(){_0x382a5f['status'](0xcc)[_0x656e('0x1d')]();});}};}function handleEntityNotFound(_0x517021,_0x33fb09){return function(_0x5b492e){if(!_0x5b492e){_0x517021['sendStatus'](0x194);}return _0x5b492e;};}function handleError(_0xa834a5,_0x4e2a80){_0x4e2a80=_0x4e2a80||0x1f4;return function(_0x26870d){logger[_0x656e('0x29')](_0x26870d[_0x656e('0x2a')]);if(_0x26870d['name']){delete _0x26870d['name'];}_0xa834a5[_0x656e('0x1c')](_0x4e2a80)[_0x656e('0x2b')](_0x26870d);};}exports[_0x656e('0x2c')]=function(_0x469acf,_0xc2a01){var _0x264e88={'raw':!![],'where':{'id':_0x469acf['params']['id']}},_0xfece84={};_0xfece84[_0x656e('0x2d')]=_['keys'](db[_0x656e('0x2e')][_0x656e('0x2f')]);_0xfece84['query']=_[_0x656e('0x30')](_0x469acf['query']);_0xfece84['filters']=_[_0x656e('0x31')](_0xfece84[_0x656e('0x2d')],_0xfece84[_0x656e('0x32')]);_0x264e88['attributes']=_[_0x656e('0x31')](_0xfece84['model'],qs[_0x656e('0x33')](_0x469acf[_0x656e('0x32')]['fields']));_0x264e88[_0x656e('0x34')]=_0x264e88['attributes']['length']?_0x264e88[_0x656e('0x34')]:_0xfece84['model'];if(_0x469acf[_0x656e('0x32')][_0x656e('0x35')]){_0x264e88[_0x656e('0x36')]=[{'all':!![]}];}_0x264e88=_[_0x656e('0x37')]({},_0x264e88,_0x469acf['options']);return db['ChatProactiveAction'][_0x656e('0x38')](_0x264e88)['then'](handleEntityNotFound(_0xc2a01,null))[_0x656e('0x27')](respondWithResult(_0xc2a01,null))[_0x656e('0x39')](handleError(_0xc2a01,null));};exports[_0x656e('0x3a')]=function(_0x807b17,_0x2709a7){return db[_0x656e('0x2e')]['create'](_0x807b17['body'],{})['then'](respondWithResult(_0x2709a7,0xc9))['catch'](handleError(_0x2709a7,null));};exports['update']=function(_0x5a44e0,_0x4796b7){if(_0x5a44e0['body']['id']){delete _0x5a44e0[_0x656e('0x3b')]['id'];}return db[_0x656e('0x2e')][_0x656e('0x38')]({'where':{'id':_0x5a44e0[_0x656e('0x3c')]['id']}})[_0x656e('0x27')](handleEntityNotFound(_0x4796b7,null))[_0x656e('0x27')](saveUpdates(_0x5a44e0[_0x656e('0x3b')],null))[_0x656e('0x27')](respondWithResult(_0x4796b7,null))[_0x656e('0x39')](handleError(_0x4796b7,null));};exports[_0x656e('0x28')]=function(_0x24886d,_0x46306a){return db[_0x656e('0x2e')]['find']({'where':{'id':_0x24886d[_0x656e('0x3c')]['id']}})['then'](handleEntityNotFound(_0x46306a,null))['then'](removeEntity(_0x46306a,null))[_0x656e('0x39')](handleError(_0x46306a,null));}; \ No newline at end of file +var _0x0d4d=['destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','limit','undefined','count','offset','status','Content-Range','apply','save','update','then','error','stack','name','send','show','params','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','merge','find','catch','ChatProactiveAction','create','body'];(function(_0x51f9d3,_0x562b53){var _0x25e060=function(_0x47226a){while(--_0x47226a){_0x51f9d3['push'](_0x51f9d3['shift']());}};_0x25e060(++_0x562b53);}(_0x0d4d,0x132));var _0xd0d4=function(_0x1f3249,_0x437f28){_0x1f3249=_0x1f3249-0x0;var _0x27908c=_0x0d4d[_0x1f3249];return _0x27908c;};'use strict';var emlformat=require(_0xd0d4('0x0'));var rimraf=require(_0xd0d4('0x1'));var zipdir=require(_0xd0d4('0x2'));var jsonpatch=require(_0xd0d4('0x3'));var rp=require(_0xd0d4('0x4'));var moment=require(_0xd0d4('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xd0d4('0x6'));var util=require('util');var path=require(_0xd0d4('0x7'));var sox=require(_0xd0d4('0x8'));var csv=require('to-csv');var ejs=require(_0xd0d4('0x9'));var fs=require('fs');var fs_extra=require(_0xd0d4('0xa'));var _=require(_0xd0d4('0xb'));var squel=require('squel');var crypto=require(_0xd0d4('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xd0d4('0xd'));var toCsv=require('to-csv');var querystring=require(_0xd0d4('0xe'));var Papa=require(_0xd0d4('0xf'));var Redis=require(_0xd0d4('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xd0d4('0x11'));var as=require(_0xd0d4('0x12'));var hardwareService=require(_0xd0d4('0x13'));var logger=require(_0xd0d4('0x14'))(_0xd0d4('0x15'));var utils=require(_0xd0d4('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xd0d4('0x17'));var db=require(_0xd0d4('0x18'))['db'];function respondWithStatusCode(_0x29ee49,_0x2ddeca){_0x2ddeca=_0x2ddeca||0xcc;return function(_0x38ca06){if(_0x38ca06){return _0x29ee49[_0xd0d4('0x19')](_0x2ddeca);}return _0x29ee49['status'](_0x2ddeca)[_0xd0d4('0x1a')]();};}function respondWithResult(_0x2131c8,_0x10a175){_0x10a175=_0x10a175||0xc8;return function(_0x5d6dd7){if(_0x5d6dd7){return _0x2131c8['status'](_0x10a175)[_0xd0d4('0x1b')](_0x5d6dd7);}};}function respondWithFilteredResult(_0x186405,_0x553b47){return function(_0x29bda4){if(_0x29bda4){var _0x1e8608=typeof _0x553b47['offset']==='undefined'&&typeof _0x553b47[_0xd0d4('0x1c')]===_0xd0d4('0x1d');var _0x268e1a=_0x29bda4['count'];var _0x5cf4c6=_0x1e8608?0x0:_0x553b47['offset'];var _0x407cda=_0x1e8608?_0x29bda4[_0xd0d4('0x1e')]:_0x553b47[_0xd0d4('0x1f')]+_0x553b47['limit'];var _0x568c75;if(_0x407cda>=_0x268e1a){_0x407cda=_0x268e1a;_0x568c75=0xc8;}else{_0x568c75=0xce;}_0x186405[_0xd0d4('0x20')](_0x568c75);return _0x186405['set'](_0xd0d4('0x21'),_0x5cf4c6+'-'+_0x407cda+'/'+_0x268e1a)[_0xd0d4('0x1b')](_0x29bda4);}return null;};}function patchUpdates(_0x1dcc1b){return function(_0x485cd8){try{jsonpatch[_0xd0d4('0x22')](_0x485cd8,_0x1dcc1b,!![]);}catch(_0x4d9fac){return BPromise['reject'](_0x4d9fac);}return _0x485cd8[_0xd0d4('0x23')]();};}function saveUpdates(_0xda03dd,_0x49b6f0){return function(_0x50f959){if(_0x50f959){return _0x50f959[_0xd0d4('0x24')](_0xda03dd)[_0xd0d4('0x25')](function(_0x398a00){return _0x398a00;});}return null;};}function removeEntity(_0x4c94b1,_0x1d8033){return function(_0x1c0831){if(_0x1c0831){return _0x1c0831['destroy']()[_0xd0d4('0x25')](function(){_0x4c94b1['status'](0xcc)[_0xd0d4('0x1a')]();});}};}function handleEntityNotFound(_0x1b03ef,_0x16808c){return function(_0x5380c3){if(!_0x5380c3){_0x1b03ef['sendStatus'](0x194);}return _0x5380c3;};}function handleError(_0x131de5,_0x4e7cc1){_0x4e7cc1=_0x4e7cc1||0x1f4;return function(_0x50e7f0){logger[_0xd0d4('0x26')](_0x50e7f0[_0xd0d4('0x27')]);if(_0x50e7f0[_0xd0d4('0x28')]){delete _0x50e7f0[_0xd0d4('0x28')];}_0x131de5['status'](_0x4e7cc1)[_0xd0d4('0x29')](_0x50e7f0);};}exports[_0xd0d4('0x2a')]=function(_0x45acf8,_0x22e142){var _0x7eecce={'raw':!![],'where':{'id':_0x45acf8[_0xd0d4('0x2b')]['id']}},_0xefce4f={};_0xefce4f[_0xd0d4('0x2c')]=_[_0xd0d4('0x2d')](db['ChatProactiveAction'][_0xd0d4('0x2e')]);_0xefce4f[_0xd0d4('0x2f')]=_[_0xd0d4('0x2d')](_0x45acf8[_0xd0d4('0x2f')]);_0xefce4f[_0xd0d4('0x30')]=_[_0xd0d4('0x31')](_0xefce4f['model'],_0xefce4f['query']);_0x7eecce[_0xd0d4('0x32')]=_['intersection'](_0xefce4f[_0xd0d4('0x2c')],qs[_0xd0d4('0x33')](_0x45acf8[_0xd0d4('0x2f')][_0xd0d4('0x33')]));_0x7eecce[_0xd0d4('0x32')]=_0x7eecce[_0xd0d4('0x32')][_0xd0d4('0x34')]?_0x7eecce['attributes']:_0xefce4f['model'];if(_0x45acf8[_0xd0d4('0x2f')][_0xd0d4('0x35')]){_0x7eecce['include']=[{'all':!![]}];}_0x7eecce=_[_0xd0d4('0x36')]({},_0x7eecce,_0x45acf8['options']);return db['ChatProactiveAction'][_0xd0d4('0x37')](_0x7eecce)[_0xd0d4('0x25')](handleEntityNotFound(_0x22e142,null))[_0xd0d4('0x25')](respondWithResult(_0x22e142,null))[_0xd0d4('0x38')](handleError(_0x22e142,null));};exports['create']=function(_0x47e4c5,_0x184d3c){return db[_0xd0d4('0x39')][_0xd0d4('0x3a')](_0x47e4c5['body'],{})[_0xd0d4('0x25')](respondWithResult(_0x184d3c,0xc9))[_0xd0d4('0x38')](handleError(_0x184d3c,null));};exports[_0xd0d4('0x24')]=function(_0x45038e,_0x18fd6d){if(_0x45038e[_0xd0d4('0x3b')]['id']){delete _0x45038e[_0xd0d4('0x3b')]['id'];}return db[_0xd0d4('0x39')]['find']({'where':{'id':_0x45038e[_0xd0d4('0x2b')]['id']}})['then'](handleEntityNotFound(_0x18fd6d,null))['then'](saveUpdates(_0x45038e[_0xd0d4('0x3b')],null))['then'](respondWithResult(_0x18fd6d,null))[_0xd0d4('0x38')](handleError(_0x18fd6d,null));};exports[_0xd0d4('0x3c')]=function(_0x1c6d7c,_0x1d6329){return db[_0xd0d4('0x39')][_0xd0d4('0x37')]({'where':{'id':_0x1c6d7c['params']['id']}})[_0xd0d4('0x25')](handleEntityNotFound(_0x1d6329,null))[_0xd0d4('0x25')](removeEntity(_0x1d6329,null))['catch'](handleError(_0x1d6329,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 0d20f91..03dcea4 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 _0xf419=['util','../../config/logger','../../config/environment','./chatProactiveAction.attributes','exports','define','chat_proactive_actions'];(function(_0x5e4372,_0x298ba2){var _0x4b9bb7=function(_0x4c0c23){while(--_0x4c0c23){_0x5e4372['push'](_0x5e4372['shift']());}};_0x4b9bb7(++_0x298ba2);}(_0xf419,0x15e));var _0x9f41=function(_0x26c434,_0x100de4){_0x26c434=_0x26c434-0x0;var _0x142244=_0xf419[_0x26c434];return _0x142244;};'use strict';var _=require('lodash');var util=require(_0x9f41('0x0'));var logger=require(_0x9f41('0x1'))('api');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(_0x9f41('0x2'));var attributes=require(_0x9f41('0x3'));module[_0x9f41('0x4')]=function(_0x2f03e2,_0x1fa395){return _0x2f03e2[_0x9f41('0x5')]('ChatProactiveAction',attributes,{'tableName':_0x9f41('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2ded=['bluebird','request-promise','path','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util','api','moment'];(function(_0x525c53,_0x7d15c0){var _0x1b503b=function(_0x1f2525){while(--_0x1f2525){_0x525c53['push'](_0x525c53['shift']());}};_0x1b503b(++_0x7d15c0);}(_0x2ded,0x71));var _0xd2de=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2ded[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd2de('0x0'));var util=require(_0xd2de('0x1'));var logger=require('../../config/logger')(_0xd2de('0x2'));var moment=require(_0xd2de('0x3'));var BPromise=require(_0xd2de('0x4'));var rp=require(_0xd2de('0x5'));var fs=require('fs');var path=require(_0xd2de('0x6'));var rimraf=require('rimraf');var config=require(_0xd2de('0x7'));var attributes=require(_0xd2de('0x8'));module[_0xd2de('0x9')]=function(_0x18c152,_0x49e540){return _0x18c152[_0xd2de('0xa')](_0xd2de('0xb'),attributes,{'tableName':_0xd2de('0xc'),'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 693aa5a..419476c 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 _0x1d78=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','code','ChatProactiveAction,\x20%s,\x20%s','message','info','result','catch','util'];(function(_0x1a66cd,_0x43558f){var _0x53cf24=function(_0x3598d9){while(--_0x3598d9){_0x1a66cd['push'](_0x1a66cd['shift']());}};_0x53cf24(++_0x43558f);}(_0x1d78,0x8b));var _0x81d7=function(_0x200c9d,_0x2af423){_0x200c9d=_0x200c9d-0x0;var _0x16871d=_0x1d78[_0x200c9d];return _0x16871d;};'use strict';var _=require('lodash');var util=require(_0x81d7('0x0'));var moment=require('moment');var BPromise=require(_0x81d7('0x1'));var rs=require(_0x81d7('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x81d7('0x3'))['db'];var utils=require(_0x81d7('0x4'));var logger=require(_0x81d7('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x81d7('0x6'));var client=jayson[_0x81d7('0x7')][_0x81d7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x42c155,_0x4e3ff4,_0x51353b){return new BPromise(function(_0x420f23,_0x102e84){return client[_0x81d7('0x9')](_0x42c155,_0x51353b)[_0x81d7('0xa')](function(_0x2a83f5){logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x4e3ff4,_0x81d7('0xb'));logger['debug'](_0x81d7('0xc'),_0x4e3ff4,'request\x20sent',JSON['stringify'](_0x2a83f5));if(_0x2a83f5[_0x81d7('0xd')]){if(_0x2a83f5[_0x81d7('0xd')][_0x81d7('0xe')]===0x1f4){logger[_0x81d7('0xd')](_0x81d7('0xf'),_0x4e3ff4,_0x2a83f5[_0x81d7('0xd')]['message']);return _0x102e84(_0x2a83f5[_0x81d7('0xd')][_0x81d7('0x10')]);}logger[_0x81d7('0xd')](_0x81d7('0xf'),_0x4e3ff4,_0x2a83f5[_0x81d7('0xd')]['message']);return _0x420f23(_0x2a83f5[_0x81d7('0xd')]['message']);}else{logger[_0x81d7('0x11')](_0x81d7('0xf'),_0x4e3ff4,_0x81d7('0xb'));_0x420f23(_0x2a83f5[_0x81d7('0x12')][_0x81d7('0x10')]);}})[_0x81d7('0x13')](function(_0x41150c){logger[_0x81d7('0xd')](_0x81d7('0xf'),_0x4e3ff4,_0x41150c);_0x102e84(_0x41150c);});});} \ No newline at end of file +var _0x202d=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x291f8b,_0x3b5591){var _0x275171=function(_0xb33d67){while(--_0xb33d67){_0x291f8b['push'](_0x291f8b['shift']());}};_0x275171(++_0x3b5591);}(_0x202d,0xad));var _0xd202=function(_0xd347f0,_0x5af6cf){_0xd347f0=_0xd347f0-0x0;var _0x27525b=_0x202d[_0xd347f0];return _0x27525b;};'use strict';var _=require(_0xd202('0x0'));var util=require(_0xd202('0x1'));var moment=require(_0xd202('0x2'));var BPromise=require(_0xd202('0x3'));var rs=require(_0xd202('0x4'));var fs=require('fs');var Redis=require(_0xd202('0x5'));var db=require(_0xd202('0x6'))['db'];var utils=require(_0xd202('0x7'));var logger=require('../../config/logger')(_0xd202('0x8'));var config=require(_0xd202('0x9'));var jayson=require(_0xd202('0xa'));var client=jayson[_0xd202('0xb')][_0xd202('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x299669,_0x2550de,_0x4a3f6b){return new BPromise(function(_0x59fac5,_0x434a5c){return client[_0xd202('0xd')](_0x299669,_0x4a3f6b)[_0xd202('0xe')](function(_0x562dc6){logger[_0xd202('0xf')](_0xd202('0x10'),_0x2550de,_0xd202('0x11'));logger['debug'](_0xd202('0x12'),_0x2550de,_0xd202('0x11'),JSON[_0xd202('0x13')](_0x562dc6));if(_0x562dc6['error']){if(_0x562dc6[_0xd202('0x14')][_0xd202('0x15')]===0x1f4){logger[_0xd202('0x14')](_0xd202('0x10'),_0x2550de,_0x562dc6[_0xd202('0x14')][_0xd202('0x16')]);return _0x434a5c(_0x562dc6[_0xd202('0x14')][_0xd202('0x16')]);}logger[_0xd202('0x14')](_0xd202('0x10'),_0x2550de,_0x562dc6[_0xd202('0x14')][_0xd202('0x16')]);return _0x59fac5(_0x562dc6['error'][_0xd202('0x16')]);}else{logger[_0xd202('0xf')](_0xd202('0x10'),_0x2550de,_0xd202('0x11'));_0x59fac5(_0x562dc6[_0xd202('0x17')][_0xd202('0x16')]);}})[_0xd202('0x18')](function(_0x12c063){logger['error'](_0xd202('0x10'),_0x2550de,_0x12c063);_0x434a5c(_0x12c063);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 1433791..1fd7836 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 _0x7fbe=['show','post','create','put','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated'];(function(_0x2c329e,_0x5c9860){var _0x329902=function(_0x7bd77a){while(--_0x7bd77a){_0x2c329e['push'](_0x2c329e['shift']());}};_0x329902(++_0x5c9860);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x4c10fe,_0x19e0b2){_0x4c10fe=_0x4c10fe-0x0;var _0x5d4ffe=_0x7fbe[_0x4c10fe];return _0x5d4ffe;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe7fb('0x0'));var timeout=require(_0xe7fb('0x1'));var express=require(_0xe7fb('0x2'));var router=express[_0xe7fb('0x3')]();var fs_extra=require(_0xe7fb('0x4'));var auth=require(_0xe7fb('0x5'));var interaction=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var controller=require(_0xe7fb('0x8'));router[_0xe7fb('0x9')](_0xe7fb('0xa'),auth[_0xe7fb('0xb')](),controller[_0xe7fb('0xc')]);router[_0xe7fb('0xd')]('/',auth['isAuthenticated'](),controller[_0xe7fb('0xe')]);router[_0xe7fb('0xf')](_0xe7fb('0xa'),auth[_0xe7fb('0xb')](),controller['update']);router['delete'](_0xe7fb('0xa'),auth[_0xe7fb('0xb')](),controller[_0xe7fb('0x10')]);module[_0xe7fb('0x11')]=router; \ No newline at end of file +var _0xf2ca=['show','create','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated'];(function(_0xc0df63,_0x3875ef){var _0x3537bc=function(_0x52e00d){while(--_0x52e00d){_0xc0df63['push'](_0xc0df63['shift']());}};_0x3537bc(++_0x3875ef);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x24563c,_0x49d7cd){_0x24563c=_0x24563c-0x0;var _0x14796e=_0xf2ca[_0x24563c];return _0x14796e;};'use strict';var multer=require(_0xaf2c('0x0'));var util=require(_0xaf2c('0x1'));var path=require(_0xaf2c('0x2'));var timeout=require('connect-timeout');var express=require(_0xaf2c('0x3'));var router=express[_0xaf2c('0x4')]();var fs_extra=require(_0xaf2c('0x5'));var auth=require(_0xaf2c('0x6'));var interaction=require(_0xaf2c('0x7'));var config=require(_0xaf2c('0x8'));var controller=require('./chatProactiveAction.controller');router[_0xaf2c('0x9')](_0xaf2c('0xa'),auth[_0xaf2c('0xb')](),controller[_0xaf2c('0xc')]);router['post']('/',auth[_0xaf2c('0xb')](),controller[_0xaf2c('0xd')]);router['put'](_0xaf2c('0xa'),auth['isAuthenticated'](),controller[_0xaf2c('0xe')]);router['delete'](_0xaf2c('0xa'),auth[_0xaf2c('0xb')](),controller[_0xaf2c('0xf')]);module[_0xaf2c('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 4d2f96b..cb7e5ca 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 _0xc925=['STRING','name','rrmemory','sequelize','exports'];(function(_0x663cdd,_0x4fd7c0){var _0x16d649=function(_0x5b05bc){while(--_0x5b05bc){_0x663cdd['push'](_0x663cdd['shift']());}};_0x16d649(++_0x4fd7c0);}(_0xc925,0xb2));var _0x5c92=function(_0x5b043a,_0x3959ce){_0x5b043a=_0x5b043a-0x0;var _0x439e4c=_0xc925[_0x5b043a];return _0x439e4c;};'use strict';var Sequelize=require(_0x5c92('0x0'));module[_0x5c92('0x1')]={'name':{'type':Sequelize[_0x5c92('0x2')],'unique':_0x5c92('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x5c92('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x5c92('0x4'),'beepall','roundrobin')}}; \ No newline at end of file +var _0x9395=['rrmemory','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x5098a5,_0x355c40){var _0x283bfd=function(_0x5d7514){while(--_0x5d7514){_0x5098a5['push'](_0x5098a5['shift']());}};_0x283bfd(++_0x355c40);}(_0x9395,0x95));var _0x5939=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x9395[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require(_0x5939('0x0'));module[_0x5939('0x1')]={'name':{'type':Sequelize[_0x5939('0x2')],'unique':_0x5939('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x5939('0x2')]},'timeout':{'type':Sequelize[_0x5939('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x5939('0x5'),'beepall',_0x5939('0x6'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index df7fb59..d4a4a35 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 _0x8306=['userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','moment','bluebird','mustache','path','sox','fs-extra','lodash','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','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','jayson/promise','client','http','request','then','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatQueue,\x20%s,\x20%s','info','result','catch','sendStatus','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','get','ChatQueues','UserProfileResource','destroy','status','end','stack','send','index','map','ChatQueue','rawAttributes','fieldName','type','name','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','include','findAll','rows','show','params','length','merge','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','describe','getMembers','UserChatQueue','User','UserId','agent','updatedAt','format','%s/%s','SIP','findOne','Team','getTeams','addTeams','ids','Agents','online','voicePause','interface','sequelize','transaction','each','findOrCreate','emit','userChatQueue:save','select','field','tq.TeamId','from','team_has_chat_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','removeTeams','isEmpty','removeAgents','forEach'];(function(_0x5d5bcb,_0x25e2ea){var _0x4ea5eb=function(_0x36782b){while(--_0x36782b){_0x5d5bcb['push'](_0x5d5bcb['shift']());}};_0x4ea5eb(++_0x25e2ea);}(_0x8306,0x144));var _0x6830=function(_0x2148c1,_0x41caa9){_0x2148c1=_0x2148c1-0x0;var _0x28c175=_0x8306[_0x2148c1];return _0x28c175;};'use strict';var emlformat=require(_0x6830('0x0'));var rimraf=require(_0x6830('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6830('0x2'));var BPromise=require(_0x6830('0x3'));var Mustache=require(_0x6830('0x4'));var util=require('util');var path=require(_0x6830('0x5'));var sox=require(_0x6830('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6830('0x7'));var _=require(_0x6830('0x8'));var squel=require(_0x6830('0x9'));var crypto=require(_0x6830('0xa'));var jsforce=require(_0x6830('0xb'));var deskjs=require(_0x6830('0xc'));var toCsv=require(_0x6830('0xd'));var querystring=require(_0x6830('0xe'));var Papa=require(_0x6830('0xf'));var Redis=require(_0x6830('0x10'));var authService=require(_0x6830('0x11'));var qs=require(_0x6830('0x12'));var as=require(_0x6830('0x13'));var hardwareService=require(_0x6830('0x14'));var logger=require(_0x6830('0x15'))(_0x6830('0x16'));var utils=require(_0x6830('0x17'));var config=require(_0x6830('0x18'));var licenseUtil=require(_0x6830('0x19'));var db=require(_0x6830('0x1a'))['db'];config[_0x6830('0x1b')]=_[_0x6830('0x1c')](config['redis'],{'host':_0x6830('0x1d'),'port':0x18eb});var socket=require(_0x6830('0x1e'))(new Redis(config[_0x6830('0x1b')]));require(_0x6830('0x1f'))['register'](socket);var jayson=require(_0x6830('0x20'));var client=jayson[_0x6830('0x21')][_0x6830('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x2fa50b,_0x16f97d,_0x4cc4bf,_0x2f1efd){return new BPromise(function(_0x391e29,_0x2b67d5){var _0x408a4e=_0x2f1efd||client;return _0x408a4e[_0x6830('0x23')](_0x2fa50b,_0x4cc4bf)[_0x6830('0x24')](function(_0x13bcfe){logger['info']('ChatQueue,\x20%s,\x20%s',_0x16f97d,_0x6830('0x25'));logger[_0x6830('0x26')](_0x6830('0x27'),_0x16f97d,'request\x20sent',JSON[_0x6830('0x28')](_0x13bcfe));if(_0x13bcfe[_0x6830('0x29')]){if(_0x13bcfe[_0x6830('0x29')][_0x6830('0x2a')]===0x1f4){logger[_0x6830('0x29')]('ChatQueue,\x20%s,\x20%s',_0x16f97d,_0x13bcfe[_0x6830('0x29')][_0x6830('0x2b')]);return _0x2b67d5(_0x13bcfe[_0x6830('0x29')]['message']);}logger[_0x6830('0x29')](_0x6830('0x2c'),_0x16f97d,_0x13bcfe[_0x6830('0x29')][_0x6830('0x2b')]);return _0x391e29(_0x13bcfe['error'][_0x6830('0x2b')]);}else{logger[_0x6830('0x2d')]('ChatQueue,\x20%s,\x20%s',_0x16f97d,'request\x20sent');_0x391e29(_0x13bcfe[_0x6830('0x2e')]['message']);}})[_0x6830('0x2f')](function(_0x264202){logger[_0x6830('0x29')](_0x6830('0x2c'),_0x16f97d,_0x264202);_0x2b67d5(_0x264202);});});}function respondWithStatusCode(_0x354b5a,_0x459337){_0x459337=_0x459337||0xcc;return function(_0x4e7a67){if(_0x4e7a67){return _0x354b5a[_0x6830('0x30')](_0x459337);}return _0x354b5a['status'](_0x459337)['end']();};}function respondWithResult(_0x438d4a,_0x21bcd2){_0x21bcd2=_0x21bcd2||0xc8;return function(_0x578723){if(_0x578723){return _0x438d4a['status'](_0x21bcd2)[_0x6830('0x31')](_0x578723);}};}function respondWithFilteredResult(_0x5d55d1,_0x5bae45){return function(_0x2b565d){if(_0x2b565d){var _0xcc2e87=typeof _0x5bae45[_0x6830('0x32')]===_0x6830('0x33')&&typeof _0x5bae45[_0x6830('0x34')]===_0x6830('0x33');var _0xb9e4ab=_0x2b565d[_0x6830('0x35')];var _0x59b7f9=_0xcc2e87?0x0:_0x5bae45[_0x6830('0x32')];var _0x1b9f5d=_0xcc2e87?_0x2b565d['count']:_0x5bae45[_0x6830('0x32')]+_0x5bae45['limit'];var _0x450421;if(_0x1b9f5d>=_0xb9e4ab){_0x1b9f5d=_0xb9e4ab;_0x450421=0xc8;}else{_0x450421=0xce;}_0x5d55d1['status'](_0x450421);return _0x5d55d1['set'](_0x6830('0x36'),_0x59b7f9+'-'+_0x1b9f5d+'/'+_0xb9e4ab)['json'](_0x2b565d);}return null;};}function patchUpdates(_0x159965){return function(_0x86b9cc){try{jsonpatch[_0x6830('0x37')](_0x86b9cc,_0x159965,!![]);}catch(_0x465bdc){return BPromise[_0x6830('0x38')](_0x465bdc);}return _0x86b9cc[_0x6830('0x39')]();};}function saveUpdates(_0x2e6c9a,_0x3eee8d){return function(_0x3f4f25){if(_0x3f4f25){return _0x3f4f25[_0x6830('0x3a')](_0x2e6c9a)['then'](function(_0x36aa07){return _0x36aa07;});}return null;};}function removeEntity(_0x19b70c,_0x33266c){return function(_0x2db824){if(_0x2db824){return _0x2db824['destroy']()['then'](function(){var _0x18e418=_0x2db824[_0x6830('0x3b')]({'plain':!![]});var _0x3b56d2=_0x6830('0x3c');return db[_0x6830('0x3d')][_0x6830('0x3e')]({'where':{'type':_0x3b56d2,'resourceId':_0x18e418['id']}})[_0x6830('0x24')](function(){return _0x2db824;});})[_0x6830('0x24')](function(){_0x19b70c[_0x6830('0x3f')](0xcc)[_0x6830('0x40')]();});}};}function handleEntityNotFound(_0x5a7831,_0x5bf0c2){return function(_0x5262e4){if(!_0x5262e4){_0x5a7831['sendStatus'](0x194);}return _0x5262e4;};}function handleError(_0x24476c,_0x540758){_0x540758=_0x540758||0x1f4;return function(_0x570241){logger[_0x6830('0x29')](_0x570241[_0x6830('0x41')]);if(_0x570241['name']){delete _0x570241['name'];}_0x24476c[_0x6830('0x3f')](_0x540758)[_0x6830('0x42')](_0x570241);};}exports[_0x6830('0x43')]=function(_0x347ef3,_0x5d9935){var _0x8fcbe3={},_0x5383a6={},_0x196a10={'count':0x0,'rows':[]};var _0x2464d7=_[_0x6830('0x44')](db[_0x6830('0x45')][_0x6830('0x46')],function(_0x1489eb){return{'name':_0x1489eb[_0x6830('0x47')],'type':_0x1489eb[_0x6830('0x48')]['key']};});_0x5383a6['model']=_[_0x6830('0x44')](_0x2464d7,_0x6830('0x49'));_0x5383a6[_0x6830('0x4a')]=_[_0x6830('0x4b')](_0x347ef3[_0x6830('0x4a')]);_0x5383a6[_0x6830('0x4c')]=_[_0x6830('0x4d')](_0x5383a6[_0x6830('0x4e')],_0x5383a6[_0x6830('0x4a')]);_0x8fcbe3[_0x6830('0x4f')]=_[_0x6830('0x4d')](_0x5383a6[_0x6830('0x4e')],qs[_0x6830('0x50')](_0x347ef3[_0x6830('0x4a')][_0x6830('0x50')]));_0x8fcbe3[_0x6830('0x4f')]=_0x8fcbe3['attributes']['length']?_0x8fcbe3[_0x6830('0x4f')]:_0x5383a6[_0x6830('0x4e')];if(!_0x347ef3['query'][_0x6830('0x51')](_0x6830('0x52'))){_0x8fcbe3[_0x6830('0x34')]=qs[_0x6830('0x34')](_0x347ef3[_0x6830('0x4a')][_0x6830('0x34')]);_0x8fcbe3[_0x6830('0x32')]=qs[_0x6830('0x32')](_0x347ef3[_0x6830('0x4a')][_0x6830('0x32')]);}_0x8fcbe3[_0x6830('0x53')]=qs[_0x6830('0x54')](_0x347ef3[_0x6830('0x4a')][_0x6830('0x54')]);_0x8fcbe3[_0x6830('0x55')]=qs[_0x6830('0x4c')](_[_0x6830('0x56')](_0x347ef3[_0x6830('0x4a')],_0x5383a6[_0x6830('0x4c')]),_0x2464d7);if(_0x347ef3[_0x6830('0x4a')][_0x6830('0x57')]){_0x8fcbe3[_0x6830('0x55')]=_['merge'](_0x8fcbe3[_0x6830('0x55')],{'$or':_[_0x6830('0x44')](_0x2464d7,function(_0x3050b7){if(_0x3050b7['type']!==_0x6830('0x58')){var _0x33f99d={};_0x33f99d[_0x3050b7[_0x6830('0x49')]]={'$like':'%'+_0x347ef3[_0x6830('0x4a')][_0x6830('0x57')]+'%'};return _0x33f99d;}})});}_0x8fcbe3=_['merge']({},_0x8fcbe3,_0x347ef3[_0x6830('0x59')]);var _0x5ad0d8={'where':_0x8fcbe3[_0x6830('0x55')]};return db[_0x6830('0x45')][_0x6830('0x35')](_0x5ad0d8)[_0x6830('0x24')](function(_0x47c31c){_0x196a10[_0x6830('0x35')]=_0x47c31c;if(_0x347ef3['query']['includeAll']){_0x8fcbe3[_0x6830('0x5a')]=[{'all':!![]}];}return db[_0x6830('0x45')][_0x6830('0x5b')](_0x8fcbe3);})['then'](function(_0x34d311){_0x196a10[_0x6830('0x5c')]=_0x34d311;return _0x196a10;})[_0x6830('0x24')](respondWithFilteredResult(_0x5d9935,_0x8fcbe3))[_0x6830('0x2f')](handleError(_0x5d9935,null));};exports[_0x6830('0x5d')]=function(_0x25d14f,_0xd4ab2a){var _0x2f25e6={'raw':!![],'where':{'id':_0x25d14f[_0x6830('0x5e')]['id']}},_0x3abb6b={};_0x3abb6b[_0x6830('0x4e')]=_[_0x6830('0x4b')](db['ChatQueue'][_0x6830('0x46')]);_0x3abb6b[_0x6830('0x4a')]=_[_0x6830('0x4b')](_0x25d14f[_0x6830('0x4a')]);_0x3abb6b[_0x6830('0x4c')]=_['intersection'](_0x3abb6b[_0x6830('0x4e')],_0x3abb6b[_0x6830('0x4a')]);_0x2f25e6[_0x6830('0x4f')]=_[_0x6830('0x4d')](_0x3abb6b[_0x6830('0x4e')],qs[_0x6830('0x50')](_0x25d14f[_0x6830('0x4a')][_0x6830('0x50')]));_0x2f25e6[_0x6830('0x4f')]=_0x2f25e6[_0x6830('0x4f')][_0x6830('0x5f')]?_0x2f25e6[_0x6830('0x4f')]:_0x3abb6b[_0x6830('0x4e')];if(_0x25d14f[_0x6830('0x4a')]['includeAll']){_0x2f25e6['include']=[{'all':!![]}];}_0x2f25e6=_[_0x6830('0x60')]({},_0x2f25e6,_0x25d14f[_0x6830('0x59')]);return db['ChatQueue'][_0x6830('0x61')](_0x2f25e6)[_0x6830('0x24')](handleEntityNotFound(_0xd4ab2a,null))[_0x6830('0x24')](respondWithResult(_0xd4ab2a,null))[_0x6830('0x2f')](handleError(_0xd4ab2a,null));};exports['create']=function(_0x4320ba,_0x3150e1){return db[_0x6830('0x45')][_0x6830('0x62')](_0x4320ba[_0x6830('0x63')],{})[_0x6830('0x24')](function(_0x29d29b){var _0x5d7bbe=_0x4320ba['user'][_0x6830('0x3b')]({'plain':!![]});if(!_0x5d7bbe)throw new Error(_0x6830('0x64'));if(_0x5d7bbe[_0x6830('0x65')]==='user'){var _0x2d4587=_0x29d29b[_0x6830('0x3b')]({'plain':!![]});var _0x14ea30=_0x6830('0x3c');return db['UserProfileSection'][_0x6830('0x61')]({'where':{'name':_0x14ea30,'userProfileId':_0x5d7bbe['userProfileId']},'raw':!![]})[_0x6830('0x24')](function(_0x1b1abb){if(_0x1b1abb&&_0x1b1abb[_0x6830('0x66')]===0x0){return db[_0x6830('0x3d')]['create']({'name':_0x2d4587[_0x6830('0x49')],'resourceId':_0x2d4587['id'],'type':_0x1b1abb[_0x6830('0x49')],'sectionId':_0x1b1abb['id']},{})[_0x6830('0x24')](function(){return _0x29d29b;});}else{return _0x29d29b;}})[_0x6830('0x2f')](function(_0x59720c){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x59720c);throw _0x59720c;});}return _0x29d29b;})[_0x6830('0x24')](respondWithResult(_0x3150e1,0xc9))[_0x6830('0x2f')](handleError(_0x3150e1,null));};exports['update']=function(_0x4e4bcd,_0x192923){if(_0x4e4bcd[_0x6830('0x63')]['id']){delete _0x4e4bcd['body']['id'];}return db[_0x6830('0x45')]['find']({'where':{'id':_0x4e4bcd[_0x6830('0x5e')]['id']}})[_0x6830('0x24')](handleEntityNotFound(_0x192923,null))['then'](saveUpdates(_0x4e4bcd['body'],null))[_0x6830('0x24')](respondWithResult(_0x192923,null))[_0x6830('0x2f')](handleError(_0x192923,null));};exports['destroy']=function(_0x2aeac1,_0x48826){return db[_0x6830('0x45')][_0x6830('0x61')]({'where':{'id':_0x2aeac1['params']['id']}})[_0x6830('0x24')](handleEntityNotFound(_0x48826,null))[_0x6830('0x24')](removeEntity(_0x48826,null))[_0x6830('0x2f')](handleError(_0x48826,null));};exports[_0x6830('0x67')]=function(_0xc1aa2e,_0x1ccc8b){return db[_0x6830('0x45')][_0x6830('0x67')]()[_0x6830('0x24')](respondWithResult(_0x1ccc8b,null))[_0x6830('0x2f')](handleError(_0x1ccc8b,null));};exports[_0x6830('0x68')]=function(_0x328736,_0x3af943,_0x2ef87d){var _0x13ceee={'raw':!![],'where':{}},_0x585c84={},_0x8fe6b7;return db[_0x6830('0x45')]['findOne']({'where':{'id':_0x328736[_0x6830('0x5e')]['id']}})['then'](handleEntityNotFound(_0x3af943,null))[_0x6830('0x24')](function(_0xfc9680){if(_0xfc9680){_0x8fe6b7=_0xfc9680[_0x6830('0x3b')]({'plain':!![]});_0x585c84[_0x6830('0x4e')]=_['keys'](db[_0x6830('0x69')][_0x6830('0x46')]);_0x585c84[_0x6830('0x4a')]=_[_0x6830('0x4b')](_0x328736[_0x6830('0x4a')]);_0x585c84[_0x6830('0x4c')]=_['intersection'](_0x585c84[_0x6830('0x4e')],_0x585c84[_0x6830('0x4a')]);_0x13ceee['attributes']=_['intersection'](_0x585c84['model'],qs['fields'](_0x328736[_0x6830('0x4a')][_0x6830('0x50')]));_0x13ceee[_0x6830('0x4f')]=_0x13ceee[_0x6830('0x4f')]['length']?_0x13ceee[_0x6830('0x4f')]:_0x585c84[_0x6830('0x4e')];if(!_0x328736[_0x6830('0x4a')][_0x6830('0x51')](_0x6830('0x52'))){_0x13ceee[_0x6830('0x34')]=qs[_0x6830('0x34')](_0x328736[_0x6830('0x4a')]['limit']);_0x13ceee[_0x6830('0x32')]=qs[_0x6830('0x32')](_0x328736[_0x6830('0x4a')][_0x6830('0x32')]);}_0x13ceee['order']=qs[_0x6830('0x54')](_0x328736['query']['sort']);_0x13ceee[_0x6830('0x55')]=qs['filters'](_['pick'](_0x328736[_0x6830('0x4a')],_0x585c84[_0x6830('0x4c')]));_0x13ceee[_0x6830('0x55')]['ChatQueueId']=_0xfc9680['id'];if(_0x328736[_0x6830('0x4a')]['filter']){_0x13ceee[_0x6830('0x55')]=_[_0x6830('0x60')](_0x13ceee[_0x6830('0x55')],{'$or':_['map'](_0x13ceee[_0x6830('0x4f')],function(_0x54ed5f){var _0x14d875={};_0x14d875[_0x54ed5f]={'$like':'%'+_0x328736[_0x6830('0x4a')][_0x6830('0x57')]+'%'};return _0x14d875;})});}_0x13ceee=_['merge']({},_0x13ceee,_0x328736[_0x6830('0x59')]);return db['UserChatQueue'][_0x6830('0x5b')](_0x13ceee);}})[_0x6830('0x24')](function(_0x5a5611){if(_0x5a5611){return db[_0x6830('0x6a')]['findAndCountAll']({'where':{'id':_[_0x6830('0x44')](_0x5a5611,_0x6830('0x6b')),'role':_0x6830('0x6c')},'attributes':['id','name','chatPause',_0x6830('0x6d'),'createdAt']});}})[_0x6830('0x24')](function(_0x58ac2d){if(_0x58ac2d){return{'count':_0x58ac2d['count'],'rows':_[_0x6830('0x44')](_0x58ac2d[_0x6830('0x5c')],function(_0x3ce085){return{'membername':_0x3ce085[_0x6830('0x49')],'UserId':_0x3ce085['id'],'queue_name':_0x8fe6b7[_0x6830('0x49')],'ChatQueueId':_0x8fe6b7['id'],'interface':util[_0x6830('0x6e')](_0x6830('0x6f'),_0x6830('0x70'),_0x3ce085['name']),'penalty':0x0,'paused':_0x3ce085['chatPause'],'createdAt':_0x3ce085['createdAt'],'updatedAt':_0x3ce085[_0x6830('0x6d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6830('0x24')](respondWithFilteredResult(_0x3af943,_0x13ceee))['catch'](handleError(_0x3af943,null));};exports['getTeams']=function(_0x1c57dd,_0x2176f2,_0x534d77){var _0xe6e218={};var _0x9fdd1b={};var _0x31bdc0;var _0x1b76dc;return db[_0x6830('0x45')][_0x6830('0x71')]({'where':{'id':_0x1c57dd['params']['id']}})['then'](handleEntityNotFound(_0x2176f2,null))[_0x6830('0x24')](function(_0x3027ec){if(_0x3027ec){_0x31bdc0=_0x3027ec;_0x9fdd1b['model']=_[_0x6830('0x4b')](db[_0x6830('0x72')][_0x6830('0x46')]);_0x9fdd1b[_0x6830('0x4a')]=_[_0x6830('0x4b')](_0x1c57dd[_0x6830('0x4a')]);_0x9fdd1b[_0x6830('0x4c')]=_['intersection'](_0x9fdd1b[_0x6830('0x4e')],_0x9fdd1b[_0x6830('0x4a')]);_0xe6e218[_0x6830('0x4f')]=_['intersection'](_0x9fdd1b[_0x6830('0x4e')],qs[_0x6830('0x50')](_0x1c57dd[_0x6830('0x4a')][_0x6830('0x50')]));_0xe6e218[_0x6830('0x4f')]=_0xe6e218[_0x6830('0x4f')]['length']?_0xe6e218['attributes']:_0x9fdd1b[_0x6830('0x4e')];_0xe6e218['order']=qs['sort'](_0x1c57dd[_0x6830('0x4a')]['sort']);_0xe6e218[_0x6830('0x55')]=qs['filters'](_[_0x6830('0x56')](_0x1c57dd[_0x6830('0x4a')],_0x9fdd1b[_0x6830('0x4c')]));if(_0x1c57dd['query'][_0x6830('0x57')]){_0xe6e218[_0x6830('0x55')]=_[_0x6830('0x60')](_0xe6e218['where'],{'$or':_['map'](_0xe6e218['attributes'],function(_0x3083f2){var _0x11cb3a={};_0x11cb3a[_0x3083f2]={'$like':'%'+_0x1c57dd[_0x6830('0x4a')][_0x6830('0x57')]+'%'};return _0x11cb3a;})});}_0xe6e218=_[_0x6830('0x60')]({},_0xe6e218,_0x1c57dd[_0x6830('0x59')]);return _0x31bdc0[_0x6830('0x73')](_0xe6e218);}})[_0x6830('0x24')](function(_0x2c6cde){if(_0x2c6cde){_0x1b76dc=_0x2c6cde[_0x6830('0x5f')];if(!_0x1c57dd[_0x6830('0x4a')]['hasOwnProperty']('nolimit')){_0xe6e218[_0x6830('0x34')]=qs[_0x6830('0x34')](_0x1c57dd['query']['limit']);_0xe6e218[_0x6830('0x32')]=qs[_0x6830('0x32')](_0x1c57dd[_0x6830('0x4a')][_0x6830('0x32')]);}return _0x31bdc0[_0x6830('0x73')](_0xe6e218);}})[_0x6830('0x24')](function(_0x20bb66){if(_0x20bb66){return _0x20bb66?{'count':_0x1b76dc,'rows':_0x20bb66}:null;}})[_0x6830('0x24')](respondWithResult(_0x2176f2,null))[_0x6830('0x2f')](handleError(_0x2176f2,null));};exports[_0x6830('0x74')]=function(_0x5e1db3,_0x452533,_0xdb5cd6){var _0x5e6f39=_0x5e1db3['body'][_0x6830('0x75')];return db[_0x6830('0x72')][_0x6830('0x5b')]({'where':{'id':_0x5e6f39},'attributes':['id'],'include':[{'model':db['User'],'as':_0x6830('0x76'),'attributes':['id',_0x6830('0x49'),_0x6830('0x77'),_0x6830('0x78'),_0x6830('0x79')],'raw':!![]}]})['then'](function(_0x4b737a){if(_0x4b737a){var _0x4274f=_['flatMap'](_0x4b737a,function(_0x3aec66){var _0x16b8fe=_0x3aec66[_0x6830('0x3b')]({'plain':!![]});return _0x16b8fe['Agents'];});return db[_0x6830('0x45')][_0x6830('0x61')]({'where':{'id':_0x5e1db3[_0x6830('0x5e')]['id']}})['then'](function(_0x513d90){return db[_0x6830('0x7a')][_0x6830('0x7b')](function(_0x5cf692){return _0x513d90[_0x6830('0x74')](_0x5e6f39,{'transaction':_0x5cf692})[_0x6830('0x24')](function(){return BPromise[_0x6830('0x7c')](_0x4274f,function(_0x38a41c){return db[_0x6830('0x69')][_0x6830('0x7d')]({'where':{'UserId':_0x38a41c['id'],'ChatQueueId':_0x5e1db3['params']['id']},'transaction':_0x5cf692});});})['then'](function(){_0x4274f['forEach'](function(_0xecf31c){socket[_0x6830('0x7e')](_0x6830('0x7f'),{'UserId':_0xecf31c['id'],'ChatQueueId':_0x513d90['id']});});});});});}})['then'](respondWithStatusCode(_0x452533,null))[_0x6830('0x2f')](handleError(_0x452533,null));};exports['removeTeams']=function(_0x3e2379,_0xa40874,_0x49d3d1){return db['Team']['findAll']({'where':{'id':_0x3e2379[_0x6830('0x4a')][_0x6830('0x75')]},'attributes':['id'],'include':[{'model':db[_0x6830('0x6a')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0xa40874,null))[_0x6830('0x24')](function(_0x22f71a){var _0x2b8329=_['map'](_0x22f71a,'id');var _0x4e8f18=[];var _0x4e8bc4=[];var _0x134adc=squel[_0x6830('0x80')]();_0x134adc[_0x6830('0x81')](_0x6830('0x82'))[_0x6830('0x83')](_0x6830('0x84'),'tq')['join'](_0x6830('0x85'),'ut',_0x6830('0x86'))[_0x6830('0x55')](_0x6830('0x87'),_0x3e2379[_0x6830('0x5e')]['id']);for(var _0x61612c=0x0;_0x61612c<_0x22f71a[_0x6830('0x5f')];_0x61612c+=0x1){let _0x5b9e31=_0x22f71a[_0x61612c];for(var _0x21f95f=0x0;_0x21f95f<_0x5b9e31[_0x6830('0x76')][_0x6830('0x5f')];_0x21f95f+=0x1){let _0x3645fb=_0x5b9e31[_0x6830('0x76')][_0x21f95f];var _0x1312a1=_0x134adc[_0x6830('0x88')]();_0x1312a1['where'](_0x6830('0x89'),_0x3645fb['id']);_0x4e8bc4[_0x6830('0x8a')](db[_0x6830('0x7a')][_0x6830('0x4a')](_0x1312a1[_0x6830('0x8b')](),{'type':db['sequelize'][_0x6830('0x8c')][_0x6830('0x8d')]})[_0x6830('0x24')](function(_0x418253){if(_0x418253['length']===0x1){return _0x3645fb['id'];}else{var _0x5cee83=_[_0x6830('0x8e')](_[_0x6830('0x44')](_0x418253,_0x6830('0x8f')),function(_0x684fb7){return _[_0x6830('0x90')](_0x2b8329,_0x684fb7);});if(_0x5cee83){return _0x3645fb['id'];}}}));}}return BPromise[_0x6830('0x91')](_0x4e8bc4)[_0x6830('0x24')](function(_0xd5f9f8){_0x4e8f18=_(_0x4e8f18)[_0x6830('0x92')](_0xd5f9f8)[_0x6830('0x93')]()[_0x6830('0x94')]();return db[_0x6830('0x45')][_0x6830('0x61')]({'where':{'id':_0x3e2379[_0x6830('0x5e')]['id']}})[_0x6830('0x24')](function(_0x179f79){return db[_0x6830('0x7a')][_0x6830('0x7b')](function(_0x36be57){return _0x179f79[_0x6830('0x95')](_0x3e2379[_0x6830('0x4a')][_0x6830('0x75')],{'transaction':_0x36be57})[_0x6830('0x24')](function(){if(!_[_0x6830('0x96')](_0x4e8f18)){return _0x179f79[_0x6830('0x97')](_0x4e8f18,{'transaction':_0x36be57});}})['then'](function(){_0x4e8f18[_0x6830('0x98')](function(_0x1324e8){socket[_0x6830('0x7e')](_0x6830('0x99'),{'UserId':_0x1324e8,'ChatQueueId':_0x179f79['id']});});});});});});})[_0x6830('0x24')](respondWithStatusCode(_0xa40874,null))[_0x6830('0x2f')](handleError(_0xa40874,null));};exports[_0x6830('0x9a')]=function(_0x6ed7a7,_0x107609,_0x32490a){return db[_0x6830('0x45')][_0x6830('0x61')]({'where':{'id':_0x6ed7a7[_0x6830('0x5e')]['id']}})[_0x6830('0x24')](handleEntityNotFound(_0x107609,null))[_0x6830('0x24')](function(_0x528544){if(_0x528544){return _0x528544[_0x6830('0x9a')](_0x6ed7a7[_0x6830('0x63')][_0x6830('0x75')],_[_0x6830('0x9b')](_0x6ed7a7[_0x6830('0x63')],[_0x6830('0x75'),'id'])||{})[_0x6830('0x9c')](function(_0x44e38a){for(var _0x1fe114=0x0;_0x1fe114<_0x6ed7a7['body'][_0x6830('0x75')][_0x6830('0x5f')];_0x1fe114+=0x1){socket[_0x6830('0x7e')](_0x6830('0x7f'),{'UserId':Number(_0x6ed7a7[_0x6830('0x63')][_0x6830('0x75')][_0x1fe114]),'ChatQueueId':Number(_0x6ed7a7['params']['id'])});}return _0x44e38a;});}})[_0x6830('0x24')](respondWithResult(_0x107609,null))[_0x6830('0x2f')](handleError(_0x107609,null));};exports[_0x6830('0x97')]=function(_0x332581,_0x1be9f0,_0x3af3e9){return db[_0x6830('0x45')]['find']({'where':{'id':_0x332581[_0x6830('0x5e')]['id']}})[_0x6830('0x24')](handleEntityNotFound(_0x1be9f0,null))[_0x6830('0x24')](function(_0x1c5eaf){if(_0x1c5eaf){return _0x1c5eaf[_0x6830('0x97')](_0x332581[_0x6830('0x4a')][_0x6830('0x75')])[_0x6830('0x24')](function(){if(_[_0x6830('0x9d')](_0x332581[_0x6830('0x4a')]['ids'])){for(var _0x5a6df3=0x0;_0x5a6df3<_0x332581[_0x6830('0x4a')][_0x6830('0x75')][_0x6830('0x5f')];_0x5a6df3+=0x1){socket[_0x6830('0x7e')](_0x6830('0x99'),{'UserId':Number(_0x332581[_0x6830('0x4a')]['ids'][_0x5a6df3]),'ChatQueueId':Number(_0x332581[_0x6830('0x5e')]['id'])});}}else{socket[_0x6830('0x7e')](_0x6830('0x99'),{'UserId':Number(_0x332581[_0x6830('0x4a')][_0x6830('0x75')]),'ChatQueueId':Number(_0x332581[_0x6830('0x5e')]['id'])});}});}})[_0x6830('0x24')](respondWithStatusCode(_0x1be9f0,null))['catch'](handleError(_0x1be9f0,null));};exports['getAgents']=function(_0x2861c6,_0x552993,_0x735b32){var _0x46cf74={};var _0x839c1f={};var _0x7b3f6f;var _0xef79e6;return db[_0x6830('0x45')][_0x6830('0x71')]({'where':{'id':_0x2861c6[_0x6830('0x5e')]['id']}})[_0x6830('0x24')](handleEntityNotFound(_0x552993,null))[_0x6830('0x24')](function(_0x1fcde8){if(_0x1fcde8){_0x7b3f6f=_0x1fcde8;_0x839c1f['model']=_['keys'](db[_0x6830('0x6a')]['rawAttributes']);_0x839c1f[_0x6830('0x4a')]=_[_0x6830('0x4b')](_0x2861c6[_0x6830('0x4a')]);_0x839c1f[_0x6830('0x4c')]=_[_0x6830('0x4d')](_0x839c1f[_0x6830('0x4e')],_0x839c1f[_0x6830('0x4a')]);_0x46cf74[_0x6830('0x4f')]=_[_0x6830('0x4d')](_0x839c1f[_0x6830('0x4e')],qs[_0x6830('0x50')](_0x2861c6['query'][_0x6830('0x50')]));_0x46cf74[_0x6830('0x4f')]=_0x46cf74[_0x6830('0x4f')][_0x6830('0x5f')]?_0x46cf74[_0x6830('0x4f')]:_0x839c1f[_0x6830('0x4e')];_0x46cf74[_0x6830('0x53')]=qs[_0x6830('0x54')](_0x2861c6['query'][_0x6830('0x54')]);_0x46cf74['where']=qs[_0x6830('0x4c')](_['pick'](_0x2861c6[_0x6830('0x4a')],_0x839c1f['filters']));if(_0x2861c6['query']['filter']){_0x46cf74[_0x6830('0x55')]=_[_0x6830('0x60')](_0x46cf74['where'],{'$or':_[_0x6830('0x44')](_0x46cf74[_0x6830('0x4f')],function(_0x17fc94){var _0x49ec12={};_0x49ec12[_0x17fc94]={'$like':'%'+_0x2861c6[_0x6830('0x4a')][_0x6830('0x57')]+'%'};return _0x49ec12;})});}_0x46cf74=_[_0x6830('0x60')]({},_0x46cf74,_0x2861c6[_0x6830('0x59')]);return _0x7b3f6f[_0x6830('0x9e')](_0x46cf74);}})['then'](function(_0x54e716){if(_0x54e716){_0xef79e6=_0x54e716[_0x6830('0x5f')];if(!_0x2861c6[_0x6830('0x4a')]['hasOwnProperty']('nolimit')){_0x46cf74['limit']=qs[_0x6830('0x34')](_0x2861c6[_0x6830('0x4a')][_0x6830('0x34')]);_0x46cf74[_0x6830('0x32')]=qs[_0x6830('0x32')](_0x2861c6[_0x6830('0x4a')][_0x6830('0x32')]);}return _0x7b3f6f['getAgents'](_0x46cf74);}})[_0x6830('0x24')](function(_0x455eda){if(_0x455eda){return _0x455eda?{'count':_0xef79e6,'rows':_0x455eda}:null;}})[_0x6830('0x24')](respondWithResult(_0x552993,null))[_0x6830('0x2f')](handleError(_0x552993,null));}; \ No newline at end of file +var _0x2f8c=['apply','reject','save','update','destroy','ChatQueues','UserProfileResource','send','index','rawAttributes','fieldName','type','key','map','name','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','sort','pick','where','filter','merge','options','ChatQueue','include','findAll','rows','show','params','length','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','body','describe','getMembers','get','UserChatQueue','order','ChatQueueId','User','findAndCountAll','UserId','agent','updatedAt','createdAt','format','%s/%s','chatPause','getTeams','findOne','Team','nolimit','addTeams','ids','Agents','voicePause','interface','transaction','each','findOrCreate','userChatQueue:save','select','field','tq.TeamId','from','team_has_chat_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','SELECT','TeamId','includes','all','union','compact','value','removeTeams','isEmpty','removeAgents','forEach','emit','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./chatQueue.socket','register','jayson/promise','client','http','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range'];(function(_0x4542b7,_0x45b947){var _0x226db6=function(_0x55e4c8){while(--_0x55e4c8){_0x4542b7['push'](_0x4542b7['shift']());}};_0x226db6(++_0x45b947);}(_0x2f8c,0x1ab));var _0xc2f8=function(_0x1fc4af,_0x501a7f){_0x1fc4af=_0x1fc4af-0x0;var _0x14953d=_0x2f8c[_0x1fc4af];return _0x14953d;};'use strict';var emlformat=require(_0xc2f8('0x0'));var rimraf=require(_0xc2f8('0x1'));var zipdir=require(_0xc2f8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc2f8('0x3'));var moment=require(_0xc2f8('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc2f8('0x5'));var util=require('util');var path=require(_0xc2f8('0x6'));var sox=require(_0xc2f8('0x7'));var csv=require(_0xc2f8('0x8'));var ejs=require(_0xc2f8('0x9'));var fs=require('fs');var fs_extra=require(_0xc2f8('0xa'));var _=require(_0xc2f8('0xb'));var squel=require(_0xc2f8('0xc'));var crypto=require(_0xc2f8('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xc2f8('0xe'));var toCsv=require(_0xc2f8('0x8'));var querystring=require(_0xc2f8('0xf'));var Papa=require(_0xc2f8('0x10'));var Redis=require(_0xc2f8('0x11'));var authService=require(_0xc2f8('0x12'));var qs=require(_0xc2f8('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc2f8('0x14'));var logger=require('../../config/logger')(_0xc2f8('0x15'));var utils=require(_0xc2f8('0x16'));var config=require(_0xc2f8('0x17'));var licenseUtil=require(_0xc2f8('0x18'));var db=require(_0xc2f8('0x19'))['db'];config['redis']=_[_0xc2f8('0x1a')](config[_0xc2f8('0x1b')],{'host':_0xc2f8('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc2f8('0x1b')]));require(_0xc2f8('0x1d'))[_0xc2f8('0x1e')](socket);var jayson=require(_0xc2f8('0x1f'));var client=jayson[_0xc2f8('0x20')][_0xc2f8('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x1ef8b0,_0x10bcf1,_0x453902,_0xa344a7){return new BPromise(function(_0x3312dc,_0x5a2f29){var _0x421910=_0xa344a7||client;return _0x421910[_0xc2f8('0x22')](_0x1ef8b0,_0x453902)[_0xc2f8('0x23')](function(_0x2ae139){logger[_0xc2f8('0x24')](_0xc2f8('0x25'),_0x10bcf1,_0xc2f8('0x26'));logger[_0xc2f8('0x27')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x10bcf1,_0xc2f8('0x26'),JSON[_0xc2f8('0x28')](_0x2ae139));if(_0x2ae139['error']){if(_0x2ae139['error'][_0xc2f8('0x29')]===0x1f4){logger['error'](_0xc2f8('0x25'),_0x10bcf1,_0x2ae139[_0xc2f8('0x2a')][_0xc2f8('0x2b')]);return _0x5a2f29(_0x2ae139[_0xc2f8('0x2a')][_0xc2f8('0x2b')]);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x10bcf1,_0x2ae139['error'][_0xc2f8('0x2b')]);return _0x3312dc(_0x2ae139['error'][_0xc2f8('0x2b')]);}else{logger[_0xc2f8('0x24')]('ChatQueue,\x20%s,\x20%s',_0x10bcf1,_0xc2f8('0x26'));_0x3312dc(_0x2ae139[_0xc2f8('0x2c')][_0xc2f8('0x2b')]);}})[_0xc2f8('0x2d')](function(_0x51b9ef){logger[_0xc2f8('0x2a')](_0xc2f8('0x25'),_0x10bcf1,_0x51b9ef);_0x5a2f29(_0x51b9ef);});});}function respondWithStatusCode(_0x2fc13e,_0x539f8c){_0x539f8c=_0x539f8c||0xcc;return function(_0x413525){if(_0x413525){return _0x2fc13e[_0xc2f8('0x2e')](_0x539f8c);}return _0x2fc13e['status'](_0x539f8c)[_0xc2f8('0x2f')]();};}function respondWithResult(_0x313d8c,_0x2b931a){_0x2b931a=_0x2b931a||0xc8;return function(_0x1b5c14){if(_0x1b5c14){return _0x313d8c[_0xc2f8('0x30')](_0x2b931a)[_0xc2f8('0x31')](_0x1b5c14);}};}function respondWithFilteredResult(_0x3c4efb,_0x41fe4a){return function(_0x2c2eec){if(_0x2c2eec){var _0x420ec7=typeof _0x41fe4a['offset']===_0xc2f8('0x32')&&typeof _0x41fe4a[_0xc2f8('0x33')]===_0xc2f8('0x32');var _0x4aebba=_0x2c2eec[_0xc2f8('0x34')];var _0x10db3b=_0x420ec7?0x0:_0x41fe4a[_0xc2f8('0x35')];var _0x2e20a3=_0x420ec7?_0x2c2eec['count']:_0x41fe4a['offset']+_0x41fe4a[_0xc2f8('0x33')];var _0x1f96cb;if(_0x2e20a3>=_0x4aebba){_0x2e20a3=_0x4aebba;_0x1f96cb=0xc8;}else{_0x1f96cb=0xce;}_0x3c4efb[_0xc2f8('0x30')](_0x1f96cb);return _0x3c4efb[_0xc2f8('0x36')](_0xc2f8('0x37'),_0x10db3b+'-'+_0x2e20a3+'/'+_0x4aebba)['json'](_0x2c2eec);}return null;};}function patchUpdates(_0x32dbaa){return function(_0x4058ef){try{jsonpatch[_0xc2f8('0x38')](_0x4058ef,_0x32dbaa,!![]);}catch(_0x564c3e){return BPromise[_0xc2f8('0x39')](_0x564c3e);}return _0x4058ef[_0xc2f8('0x3a')]();};}function saveUpdates(_0x3555ea,_0x110a5d){return function(_0xabfad6){if(_0xabfad6){return _0xabfad6[_0xc2f8('0x3b')](_0x3555ea)[_0xc2f8('0x23')](function(_0x4c11ae){return _0x4c11ae;});}return null;};}function removeEntity(_0x5bee00,_0x573491){return function(_0x2a095b){if(_0x2a095b){return _0x2a095b[_0xc2f8('0x3c')]()[_0xc2f8('0x23')](function(){var _0x5acaee=_0x2a095b['get']({'plain':!![]});var _0x4718de=_0xc2f8('0x3d');return db[_0xc2f8('0x3e')][_0xc2f8('0x3c')]({'where':{'type':_0x4718de,'resourceId':_0x5acaee['id']}})[_0xc2f8('0x23')](function(){return _0x2a095b;});})[_0xc2f8('0x23')](function(){_0x5bee00['status'](0xcc)[_0xc2f8('0x2f')]();});}};}function handleEntityNotFound(_0x507627,_0x557867){return function(_0x2a2260){if(!_0x2a2260){_0x507627[_0xc2f8('0x2e')](0x194);}return _0x2a2260;};}function handleError(_0x54a910,_0x112988){_0x112988=_0x112988||0x1f4;return function(_0x24dcd1){logger[_0xc2f8('0x2a')](_0x24dcd1['stack']);if(_0x24dcd1['name']){delete _0x24dcd1['name'];}_0x54a910[_0xc2f8('0x30')](_0x112988)[_0xc2f8('0x3f')](_0x24dcd1);};}exports[_0xc2f8('0x40')]=function(_0x1a7ee6,_0x25808f){var _0x7c33a1={},_0x3d2752={},_0x2cce82={'count':0x0,'rows':[]};var _0x3662bd=_['map'](db['ChatQueue'][_0xc2f8('0x41')],function(_0x33ddf3){return{'name':_0x33ddf3[_0xc2f8('0x42')],'type':_0x33ddf3[_0xc2f8('0x43')][_0xc2f8('0x44')]};});_0x3d2752['model']=_[_0xc2f8('0x45')](_0x3662bd,_0xc2f8('0x46'));_0x3d2752[_0xc2f8('0x47')]=_[_0xc2f8('0x48')](_0x1a7ee6[_0xc2f8('0x47')]);_0x3d2752[_0xc2f8('0x49')]=_[_0xc2f8('0x4a')](_0x3d2752[_0xc2f8('0x4b')],_0x3d2752[_0xc2f8('0x47')]);_0x7c33a1[_0xc2f8('0x4c')]=_[_0xc2f8('0x4a')](_0x3d2752[_0xc2f8('0x4b')],qs[_0xc2f8('0x4d')](_0x1a7ee6[_0xc2f8('0x47')][_0xc2f8('0x4d')]));_0x7c33a1['attributes']=_0x7c33a1['attributes']['length']?_0x7c33a1[_0xc2f8('0x4c')]:_0x3d2752['model'];if(!_0x1a7ee6['query'][_0xc2f8('0x4e')]('nolimit')){_0x7c33a1[_0xc2f8('0x33')]=qs['limit'](_0x1a7ee6[_0xc2f8('0x47')]['limit']);_0x7c33a1[_0xc2f8('0x35')]=qs[_0xc2f8('0x35')](_0x1a7ee6[_0xc2f8('0x47')][_0xc2f8('0x35')]);}_0x7c33a1['order']=qs['sort'](_0x1a7ee6[_0xc2f8('0x47')][_0xc2f8('0x4f')]);_0x7c33a1['where']=qs[_0xc2f8('0x49')](_[_0xc2f8('0x50')](_0x1a7ee6[_0xc2f8('0x47')],_0x3d2752[_0xc2f8('0x49')]),_0x3662bd);if(_0x1a7ee6['query']['filter']){_0x7c33a1[_0xc2f8('0x51')]=_['merge'](_0x7c33a1[_0xc2f8('0x51')],{'$or':_[_0xc2f8('0x45')](_0x3662bd,function(_0x25ce7f){if(_0x25ce7f[_0xc2f8('0x43')]!=='VIRTUAL'){var _0x237b57={};_0x237b57[_0x25ce7f[_0xc2f8('0x46')]]={'$like':'%'+_0x1a7ee6[_0xc2f8('0x47')][_0xc2f8('0x52')]+'%'};return _0x237b57;}})});}_0x7c33a1=_[_0xc2f8('0x53')]({},_0x7c33a1,_0x1a7ee6[_0xc2f8('0x54')]);var _0x32ea45={'where':_0x7c33a1['where']};return db[_0xc2f8('0x55')][_0xc2f8('0x34')](_0x32ea45)[_0xc2f8('0x23')](function(_0x12ea64){_0x2cce82['count']=_0x12ea64;if(_0x1a7ee6[_0xc2f8('0x47')]['includeAll']){_0x7c33a1[_0xc2f8('0x56')]=[{'all':!![]}];}return db[_0xc2f8('0x55')][_0xc2f8('0x57')](_0x7c33a1);})[_0xc2f8('0x23')](function(_0x183a3b){_0x2cce82[_0xc2f8('0x58')]=_0x183a3b;return _0x2cce82;})[_0xc2f8('0x23')](respondWithFilteredResult(_0x25808f,_0x7c33a1))[_0xc2f8('0x2d')](handleError(_0x25808f,null));};exports[_0xc2f8('0x59')]=function(_0x4bfacf,_0x2c903f){var _0x5cc1f9={'raw':!![],'where':{'id':_0x4bfacf[_0xc2f8('0x5a')]['id']}},_0xebc7ec={};_0xebc7ec[_0xc2f8('0x4b')]=_[_0xc2f8('0x48')](db[_0xc2f8('0x55')]['rawAttributes']);_0xebc7ec[_0xc2f8('0x47')]=_[_0xc2f8('0x48')](_0x4bfacf[_0xc2f8('0x47')]);_0xebc7ec[_0xc2f8('0x49')]=_[_0xc2f8('0x4a')](_0xebc7ec['model'],_0xebc7ec[_0xc2f8('0x47')]);_0x5cc1f9[_0xc2f8('0x4c')]=_[_0xc2f8('0x4a')](_0xebc7ec[_0xc2f8('0x4b')],qs[_0xc2f8('0x4d')](_0x4bfacf[_0xc2f8('0x47')]['fields']));_0x5cc1f9[_0xc2f8('0x4c')]=_0x5cc1f9[_0xc2f8('0x4c')][_0xc2f8('0x5b')]?_0x5cc1f9[_0xc2f8('0x4c')]:_0xebc7ec['model'];if(_0x4bfacf[_0xc2f8('0x47')][_0xc2f8('0x5c')]){_0x5cc1f9[_0xc2f8('0x56')]=[{'all':!![]}];}_0x5cc1f9=_[_0xc2f8('0x53')]({},_0x5cc1f9,_0x4bfacf[_0xc2f8('0x54')]);return db['ChatQueue'][_0xc2f8('0x5d')](_0x5cc1f9)[_0xc2f8('0x23')](handleEntityNotFound(_0x2c903f,null))[_0xc2f8('0x23')](respondWithResult(_0x2c903f,null))['catch'](handleError(_0x2c903f,null));};exports[_0xc2f8('0x5e')]=function(_0x490139,_0x2868b3){return db[_0xc2f8('0x55')][_0xc2f8('0x5e')](_0x490139['body'],{})['then'](function(_0x5196da){var _0x35d864=_0x490139[_0xc2f8('0x5f')]['get']({'plain':!![]});if(!_0x35d864)throw new Error(_0xc2f8('0x60'));if(_0x35d864[_0xc2f8('0x61')]==='user'){var _0x2ba6fc=_0x5196da['get']({'plain':!![]});var _0x131835=_0xc2f8('0x3d');return db[_0xc2f8('0x62')][_0xc2f8('0x5d')]({'where':{'name':_0x131835,'userProfileId':_0x35d864[_0xc2f8('0x63')]},'raw':!![]})[_0xc2f8('0x23')](function(_0xdeaad1){if(_0xdeaad1&&_0xdeaad1[_0xc2f8('0x64')]===0x0){return db['UserProfileResource'][_0xc2f8('0x5e')]({'name':_0x2ba6fc[_0xc2f8('0x46')],'resourceId':_0x2ba6fc['id'],'type':_0xdeaad1['name'],'sectionId':_0xdeaad1['id']},{})[_0xc2f8('0x23')](function(){return _0x5196da;});}else{return _0x5196da;}})[_0xc2f8('0x2d')](function(_0x3f4092){logger[_0xc2f8('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3f4092);throw _0x3f4092;});}return _0x5196da;})[_0xc2f8('0x23')](respondWithResult(_0x2868b3,0xc9))['catch'](handleError(_0x2868b3,null));};exports[_0xc2f8('0x3b')]=function(_0x450822,_0x5d41da){if(_0x450822['body']['id']){delete _0x450822[_0xc2f8('0x65')]['id'];}return db['ChatQueue']['find']({'where':{'id':_0x450822[_0xc2f8('0x5a')]['id']}})['then'](handleEntityNotFound(_0x5d41da,null))['then'](saveUpdates(_0x450822[_0xc2f8('0x65')],null))[_0xc2f8('0x23')](respondWithResult(_0x5d41da,null))[_0xc2f8('0x2d')](handleError(_0x5d41da,null));};exports[_0xc2f8('0x3c')]=function(_0x10a481,_0x334a3f){return db[_0xc2f8('0x55')][_0xc2f8('0x5d')]({'where':{'id':_0x10a481[_0xc2f8('0x5a')]['id']}})[_0xc2f8('0x23')](handleEntityNotFound(_0x334a3f,null))[_0xc2f8('0x23')](removeEntity(_0x334a3f,null))['catch'](handleError(_0x334a3f,null));};exports[_0xc2f8('0x66')]=function(_0x300a1b,_0x5bb185){return db[_0xc2f8('0x55')][_0xc2f8('0x66')]()[_0xc2f8('0x23')](respondWithResult(_0x5bb185,null))[_0xc2f8('0x2d')](handleError(_0x5bb185,null));};exports[_0xc2f8('0x67')]=function(_0x1130fa,_0x3e72a3,_0x28defd){var _0x45d1bc={'raw':!![],'where':{}},_0x3f95d9={},_0x12b2ec;return db['ChatQueue']['findOne']({'where':{'id':_0x1130fa[_0xc2f8('0x5a')]['id']}})[_0xc2f8('0x23')](handleEntityNotFound(_0x3e72a3,null))[_0xc2f8('0x23')](function(_0x5a5d96){if(_0x5a5d96){_0x12b2ec=_0x5a5d96[_0xc2f8('0x68')]({'plain':!![]});_0x3f95d9[_0xc2f8('0x4b')]=_[_0xc2f8('0x48')](db[_0xc2f8('0x69')][_0xc2f8('0x41')]);_0x3f95d9['query']=_['keys'](_0x1130fa[_0xc2f8('0x47')]);_0x3f95d9[_0xc2f8('0x49')]=_[_0xc2f8('0x4a')](_0x3f95d9[_0xc2f8('0x4b')],_0x3f95d9['query']);_0x45d1bc[_0xc2f8('0x4c')]=_[_0xc2f8('0x4a')](_0x3f95d9[_0xc2f8('0x4b')],qs[_0xc2f8('0x4d')](_0x1130fa['query'][_0xc2f8('0x4d')]));_0x45d1bc[_0xc2f8('0x4c')]=_0x45d1bc['attributes'][_0xc2f8('0x5b')]?_0x45d1bc[_0xc2f8('0x4c')]:_0x3f95d9[_0xc2f8('0x4b')];if(!_0x1130fa[_0xc2f8('0x47')][_0xc2f8('0x4e')]('nolimit')){_0x45d1bc[_0xc2f8('0x33')]=qs[_0xc2f8('0x33')](_0x1130fa[_0xc2f8('0x47')][_0xc2f8('0x33')]);_0x45d1bc[_0xc2f8('0x35')]=qs['offset'](_0x1130fa['query']['offset']);}_0x45d1bc[_0xc2f8('0x6a')]=qs[_0xc2f8('0x4f')](_0x1130fa[_0xc2f8('0x47')][_0xc2f8('0x4f')]);_0x45d1bc[_0xc2f8('0x51')]=qs[_0xc2f8('0x49')](_[_0xc2f8('0x50')](_0x1130fa[_0xc2f8('0x47')],_0x3f95d9[_0xc2f8('0x49')]));_0x45d1bc[_0xc2f8('0x51')][_0xc2f8('0x6b')]=_0x5a5d96['id'];if(_0x1130fa[_0xc2f8('0x47')]['filter']){_0x45d1bc['where']=_[_0xc2f8('0x53')](_0x45d1bc[_0xc2f8('0x51')],{'$or':_[_0xc2f8('0x45')](_0x45d1bc[_0xc2f8('0x4c')],function(_0x2237bd){var _0x44ce5e={};_0x44ce5e[_0x2237bd]={'$like':'%'+_0x1130fa[_0xc2f8('0x47')]['filter']+'%'};return _0x44ce5e;})});}_0x45d1bc=_[_0xc2f8('0x53')]({},_0x45d1bc,_0x1130fa[_0xc2f8('0x54')]);return db[_0xc2f8('0x69')][_0xc2f8('0x57')](_0x45d1bc);}})[_0xc2f8('0x23')](function(_0x5181f6){if(_0x5181f6){return db[_0xc2f8('0x6c')][_0xc2f8('0x6d')]({'where':{'id':_[_0xc2f8('0x45')](_0x5181f6,_0xc2f8('0x6e')),'role':_0xc2f8('0x6f')},'attributes':['id',_0xc2f8('0x46'),'chatPause',_0xc2f8('0x70'),_0xc2f8('0x71')]});}})[_0xc2f8('0x23')](function(_0x22d2c2){if(_0x22d2c2){return{'count':_0x22d2c2['count'],'rows':_[_0xc2f8('0x45')](_0x22d2c2[_0xc2f8('0x58')],function(_0x1544e5){return{'membername':_0x1544e5['name'],'UserId':_0x1544e5['id'],'queue_name':_0x12b2ec[_0xc2f8('0x46')],'ChatQueueId':_0x12b2ec['id'],'interface':util[_0xc2f8('0x72')](_0xc2f8('0x73'),'SIP',_0x1544e5[_0xc2f8('0x46')]),'penalty':0x0,'paused':_0x1544e5[_0xc2f8('0x74')],'createdAt':_0x1544e5[_0xc2f8('0x71')],'updatedAt':_0x1544e5[_0xc2f8('0x70')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xc2f8('0x23')](respondWithFilteredResult(_0x3e72a3,_0x45d1bc))[_0xc2f8('0x2d')](handleError(_0x3e72a3,null));};exports[_0xc2f8('0x75')]=function(_0x2beb68,_0x11942b,_0x15b64e){var _0x12a42f={};var _0x2dbe6f={};var _0x35f404;var _0x300700;return db[_0xc2f8('0x55')][_0xc2f8('0x76')]({'where':{'id':_0x2beb68[_0xc2f8('0x5a')]['id']}})[_0xc2f8('0x23')](handleEntityNotFound(_0x11942b,null))['then'](function(_0x2859dc){if(_0x2859dc){_0x35f404=_0x2859dc;_0x2dbe6f[_0xc2f8('0x4b')]=_['keys'](db[_0xc2f8('0x77')][_0xc2f8('0x41')]);_0x2dbe6f[_0xc2f8('0x47')]=_[_0xc2f8('0x48')](_0x2beb68['query']);_0x2dbe6f[_0xc2f8('0x49')]=_[_0xc2f8('0x4a')](_0x2dbe6f[_0xc2f8('0x4b')],_0x2dbe6f[_0xc2f8('0x47')]);_0x12a42f[_0xc2f8('0x4c')]=_[_0xc2f8('0x4a')](_0x2dbe6f[_0xc2f8('0x4b')],qs['fields'](_0x2beb68[_0xc2f8('0x47')][_0xc2f8('0x4d')]));_0x12a42f[_0xc2f8('0x4c')]=_0x12a42f[_0xc2f8('0x4c')][_0xc2f8('0x5b')]?_0x12a42f['attributes']:_0x2dbe6f[_0xc2f8('0x4b')];_0x12a42f[_0xc2f8('0x6a')]=qs[_0xc2f8('0x4f')](_0x2beb68[_0xc2f8('0x47')][_0xc2f8('0x4f')]);_0x12a42f[_0xc2f8('0x51')]=qs[_0xc2f8('0x49')](_[_0xc2f8('0x50')](_0x2beb68[_0xc2f8('0x47')],_0x2dbe6f[_0xc2f8('0x49')]));if(_0x2beb68['query'][_0xc2f8('0x52')]){_0x12a42f[_0xc2f8('0x51')]=_['merge'](_0x12a42f[_0xc2f8('0x51')],{'$or':_[_0xc2f8('0x45')](_0x12a42f[_0xc2f8('0x4c')],function(_0x31db03){var _0x9e2bc5={};_0x9e2bc5[_0x31db03]={'$like':'%'+_0x2beb68['query'][_0xc2f8('0x52')]+'%'};return _0x9e2bc5;})});}_0x12a42f=_[_0xc2f8('0x53')]({},_0x12a42f,_0x2beb68['options']);return _0x35f404[_0xc2f8('0x75')](_0x12a42f);}})['then'](function(_0x203471){if(_0x203471){_0x300700=_0x203471[_0xc2f8('0x5b')];if(!_0x2beb68[_0xc2f8('0x47')][_0xc2f8('0x4e')](_0xc2f8('0x78'))){_0x12a42f[_0xc2f8('0x33')]=qs['limit'](_0x2beb68[_0xc2f8('0x47')][_0xc2f8('0x33')]);_0x12a42f[_0xc2f8('0x35')]=qs[_0xc2f8('0x35')](_0x2beb68[_0xc2f8('0x47')][_0xc2f8('0x35')]);}return _0x35f404[_0xc2f8('0x75')](_0x12a42f);}})[_0xc2f8('0x23')](function(_0x2ec925){if(_0x2ec925){return _0x2ec925?{'count':_0x300700,'rows':_0x2ec925}:null;}})[_0xc2f8('0x23')](respondWithResult(_0x11942b,null))[_0xc2f8('0x2d')](handleError(_0x11942b,null));};exports[_0xc2f8('0x79')]=function(_0x21218e,_0x54f68d,_0x34305f){var _0x4a195c=_0x21218e[_0xc2f8('0x65')][_0xc2f8('0x7a')];return db['Team'][_0xc2f8('0x57')]({'where':{'id':_0x4a195c},'attributes':['id'],'include':[{'model':db['User'],'as':_0xc2f8('0x7b'),'attributes':['id',_0xc2f8('0x46'),'online',_0xc2f8('0x7c'),_0xc2f8('0x7d')],'raw':!![]}]})[_0xc2f8('0x23')](function(_0x905c63){if(_0x905c63){var _0x3a2ab5=_['flatMap'](_0x905c63,function(_0x4a940a){var _0x405c1c=_0x4a940a[_0xc2f8('0x68')]({'plain':!![]});return _0x405c1c['Agents'];});return db[_0xc2f8('0x55')][_0xc2f8('0x5d')]({'where':{'id':_0x21218e[_0xc2f8('0x5a')]['id']}})[_0xc2f8('0x23')](function(_0x53e744){return db['sequelize'][_0xc2f8('0x7e')](function(_0x5591e3){return _0x53e744[_0xc2f8('0x79')](_0x4a195c,{'transaction':_0x5591e3})[_0xc2f8('0x23')](function(){return BPromise[_0xc2f8('0x7f')](_0x3a2ab5,function(_0x3ec65c){return db[_0xc2f8('0x69')][_0xc2f8('0x80')]({'where':{'UserId':_0x3ec65c['id'],'ChatQueueId':_0x21218e[_0xc2f8('0x5a')]['id']},'transaction':_0x5591e3});});})[_0xc2f8('0x23')](function(){_0x3a2ab5['forEach'](function(_0x3ed901){socket['emit'](_0xc2f8('0x81'),{'UserId':_0x3ed901['id'],'ChatQueueId':_0x53e744['id']});});});});});}})['then'](respondWithStatusCode(_0x54f68d,null))['catch'](handleError(_0x54f68d,null));};exports['removeTeams']=function(_0x5241b6,_0x1a136f,_0x387304){return db['Team'][_0xc2f8('0x57')]({'where':{'id':_0x5241b6['query'][_0xc2f8('0x7a')]},'attributes':['id'],'include':[{'model':db[_0xc2f8('0x6c')],'as':_0xc2f8('0x7b'),'attributes':['id'],'raw':!![]}]})[_0xc2f8('0x23')](handleEntityNotFound(_0x1a136f,null))[_0xc2f8('0x23')](function(_0x1197c1){var _0x3f6220=_[_0xc2f8('0x45')](_0x1197c1,'id');var _0x5bb606=[];var _0x6dab1=[];var _0x30657c=squel[_0xc2f8('0x82')]();_0x30657c[_0xc2f8('0x83')](_0xc2f8('0x84'))[_0xc2f8('0x85')](_0xc2f8('0x86'),'tq')['join'](_0xc2f8('0x87'),'ut',_0xc2f8('0x88'))[_0xc2f8('0x51')](_0xc2f8('0x89'),_0x5241b6[_0xc2f8('0x5a')]['id']);for(var _0x566b37=0x0;_0x566b37<_0x1197c1[_0xc2f8('0x5b')];_0x566b37+=0x1){let _0x49b4f7=_0x1197c1[_0x566b37];for(var _0x3dda14=0x0;_0x3dda14<_0x49b4f7[_0xc2f8('0x7b')][_0xc2f8('0x5b')];_0x3dda14+=0x1){let _0x2a4c74=_0x49b4f7[_0xc2f8('0x7b')][_0x3dda14];var _0x46915b=_0x30657c[_0xc2f8('0x8a')]();_0x46915b['where'](_0xc2f8('0x8b'),_0x2a4c74['id']);_0x6dab1[_0xc2f8('0x8c')](db[_0xc2f8('0x8d')][_0xc2f8('0x47')](_0x46915b[_0xc2f8('0x8e')](),{'type':db[_0xc2f8('0x8d')]['QueryTypes'][_0xc2f8('0x8f')]})['then'](function(_0x507291){if(_0x507291[_0xc2f8('0x5b')]===0x1){return _0x2a4c74['id'];}else{var _0x40b229=_['every'](_[_0xc2f8('0x45')](_0x507291,_0xc2f8('0x90')),function(_0x1ea370){return _[_0xc2f8('0x91')](_0x3f6220,_0x1ea370);});if(_0x40b229){return _0x2a4c74['id'];}}}));}}return BPromise[_0xc2f8('0x92')](_0x6dab1)[_0xc2f8('0x23')](function(_0x26b7a4){_0x5bb606=_(_0x5bb606)[_0xc2f8('0x93')](_0x26b7a4)[_0xc2f8('0x94')]()[_0xc2f8('0x95')]();return db[_0xc2f8('0x55')]['find']({'where':{'id':_0x5241b6[_0xc2f8('0x5a')]['id']}})[_0xc2f8('0x23')](function(_0x578f9f){return db[_0xc2f8('0x8d')][_0xc2f8('0x7e')](function(_0x388928){return _0x578f9f[_0xc2f8('0x96')](_0x5241b6[_0xc2f8('0x47')][_0xc2f8('0x7a')],{'transaction':_0x388928})[_0xc2f8('0x23')](function(){if(!_[_0xc2f8('0x97')](_0x5bb606)){return _0x578f9f[_0xc2f8('0x98')](_0x5bb606,{'transaction':_0x388928});}})[_0xc2f8('0x23')](function(){_0x5bb606[_0xc2f8('0x99')](function(_0x367ba3){socket[_0xc2f8('0x9a')](_0xc2f8('0x9b'),{'UserId':_0x367ba3,'ChatQueueId':_0x578f9f['id']});});});});});});})[_0xc2f8('0x23')](respondWithStatusCode(_0x1a136f,null))['catch'](handleError(_0x1a136f,null));};exports['addAgents']=function(_0x558c31,_0x1b01fe,_0x391fcf){return db[_0xc2f8('0x55')][_0xc2f8('0x5d')]({'where':{'id':_0x558c31[_0xc2f8('0x5a')]['id']}})['then'](handleEntityNotFound(_0x1b01fe,null))[_0xc2f8('0x23')](function(_0x39ca7d){if(_0x39ca7d){return _0x39ca7d[_0xc2f8('0x9c')](_0x558c31[_0xc2f8('0x65')][_0xc2f8('0x7a')],_[_0xc2f8('0x9d')](_0x558c31[_0xc2f8('0x65')],['ids','id'])||{})[_0xc2f8('0x9e')](function(_0x4f80e6){for(var _0x1e61a4=0x0;_0x1e61a4<_0x558c31[_0xc2f8('0x65')][_0xc2f8('0x7a')][_0xc2f8('0x5b')];_0x1e61a4+=0x1){socket[_0xc2f8('0x9a')](_0xc2f8('0x81'),{'UserId':Number(_0x558c31[_0xc2f8('0x65')][_0xc2f8('0x7a')][_0x1e61a4]),'ChatQueueId':Number(_0x558c31['params']['id'])});}return _0x4f80e6;});}})['then'](respondWithResult(_0x1b01fe,null))[_0xc2f8('0x2d')](handleError(_0x1b01fe,null));};exports[_0xc2f8('0x98')]=function(_0x1d8f5d,_0x1f5250,_0x40c5c7){return db[_0xc2f8('0x55')][_0xc2f8('0x5d')]({'where':{'id':_0x1d8f5d[_0xc2f8('0x5a')]['id']}})[_0xc2f8('0x23')](handleEntityNotFound(_0x1f5250,null))['then'](function(_0xd2bc66){if(_0xd2bc66){return _0xd2bc66['removeAgents'](_0x1d8f5d[_0xc2f8('0x47')]['ids'])['then'](function(){if(_[_0xc2f8('0x9f')](_0x1d8f5d[_0xc2f8('0x47')]['ids'])){for(var _0x421542=0x0;_0x421542<_0x1d8f5d[_0xc2f8('0x47')]['ids']['length'];_0x421542+=0x1){socket[_0xc2f8('0x9a')](_0xc2f8('0x9b'),{'UserId':Number(_0x1d8f5d['query'][_0xc2f8('0x7a')][_0x421542]),'ChatQueueId':Number(_0x1d8f5d[_0xc2f8('0x5a')]['id'])});}}else{socket[_0xc2f8('0x9a')](_0xc2f8('0x9b'),{'UserId':Number(_0x1d8f5d[_0xc2f8('0x47')][_0xc2f8('0x7a')]),'ChatQueueId':Number(_0x1d8f5d[_0xc2f8('0x5a')]['id'])});}});}})['then'](respondWithStatusCode(_0x1f5250,null))[_0xc2f8('0x2d')](handleError(_0x1f5250,null));};exports[_0xc2f8('0xa0')]=function(_0x1ce6a1,_0x6690d5,_0x5e744e){var _0x3c0ab5={};var _0x2f9e1e={};var _0x4070dd;var _0x23e67;return db[_0xc2f8('0x55')][_0xc2f8('0x76')]({'where':{'id':_0x1ce6a1[_0xc2f8('0x5a')]['id']}})[_0xc2f8('0x23')](handleEntityNotFound(_0x6690d5,null))[_0xc2f8('0x23')](function(_0x193ca3){if(_0x193ca3){_0x4070dd=_0x193ca3;_0x2f9e1e['model']=_[_0xc2f8('0x48')](db[_0xc2f8('0x6c')]['rawAttributes']);_0x2f9e1e[_0xc2f8('0x47')]=_[_0xc2f8('0x48')](_0x1ce6a1[_0xc2f8('0x47')]);_0x2f9e1e[_0xc2f8('0x49')]=_[_0xc2f8('0x4a')](_0x2f9e1e[_0xc2f8('0x4b')],_0x2f9e1e['query']);_0x3c0ab5[_0xc2f8('0x4c')]=_['intersection'](_0x2f9e1e[_0xc2f8('0x4b')],qs[_0xc2f8('0x4d')](_0x1ce6a1['query'][_0xc2f8('0x4d')]));_0x3c0ab5[_0xc2f8('0x4c')]=_0x3c0ab5[_0xc2f8('0x4c')]['length']?_0x3c0ab5[_0xc2f8('0x4c')]:_0x2f9e1e[_0xc2f8('0x4b')];_0x3c0ab5[_0xc2f8('0x6a')]=qs[_0xc2f8('0x4f')](_0x1ce6a1['query'][_0xc2f8('0x4f')]);_0x3c0ab5[_0xc2f8('0x51')]=qs['filters'](_[_0xc2f8('0x50')](_0x1ce6a1[_0xc2f8('0x47')],_0x2f9e1e[_0xc2f8('0x49')]));if(_0x1ce6a1[_0xc2f8('0x47')][_0xc2f8('0x52')]){_0x3c0ab5['where']=_['merge'](_0x3c0ab5[_0xc2f8('0x51')],{'$or':_['map'](_0x3c0ab5[_0xc2f8('0x4c')],function(_0x540373){var _0x951381={};_0x951381[_0x540373]={'$like':'%'+_0x1ce6a1[_0xc2f8('0x47')]['filter']+'%'};return _0x951381;})});}_0x3c0ab5=_[_0xc2f8('0x53')]({},_0x3c0ab5,_0x1ce6a1[_0xc2f8('0x54')]);return _0x4070dd[_0xc2f8('0xa0')](_0x3c0ab5);}})['then'](function(_0x30612a){if(_0x30612a){_0x23e67=_0x30612a[_0xc2f8('0x5b')];if(!_0x1ce6a1[_0xc2f8('0x47')][_0xc2f8('0x4e')](_0xc2f8('0x78'))){_0x3c0ab5['limit']=qs[_0xc2f8('0x33')](_0x1ce6a1[_0xc2f8('0x47')][_0xc2f8('0x33')]);_0x3c0ab5[_0xc2f8('0x35')]=qs[_0xc2f8('0x35')](_0x1ce6a1['query'][_0xc2f8('0x35')]);}return _0x4070dd[_0xc2f8('0xa0')](_0x3c0ab5);}})[_0xc2f8('0x23')](function(_0x35a929){if(_0x35a929){return _0x35a929?{'count':_0x23e67,'rows':_0x35a929}:null;}})[_0xc2f8('0x23')](respondWithResult(_0x6690d5,null))[_0xc2f8('0x2d')](handleError(_0x6690d5,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 8bfa21e..06d9081 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 _0x8a81=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','ChatQueue'];(function(_0x218c2c,_0x1db202){var _0xe7d467=function(_0x2b2708){while(--_0x2b2708){_0x218c2c['push'](_0x218c2c['shift']());}};_0xe7d467(++_0x1db202);}(_0x8a81,0x1da));var _0x18a8=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x8a81[_0x19950b];return _0x3c6b41;};'use strict';var EventEmitter=require(_0x18a8('0x0'));var ChatQueue=require(_0x18a8('0x1'))['db'][_0x18a8('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x18a8('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x18a8('0x4'),'afterDestroy':_0x18a8('0x5')};function emitEvent(_0x137a14){return function(_0x22c518,_0x24a716,_0x1a1221){ChatQueueEvents['emit'](_0x137a14+':'+_0x22c518['id'],_0x22c518);ChatQueueEvents[_0x18a8('0x6')](_0x137a14,_0x22c518);_0x1a1221(null);};}for(var e in events){if(events[_0x18a8('0x7')](e)){var event=events[e];ChatQueue[_0x18a8('0x8')](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file +var _0xa61f=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','save','update','remove','emit'];(function(_0x4178af,_0x388652){var _0x20f4b1=function(_0x504188){while(--_0x504188){_0x4178af['push'](_0x4178af['shift']());}};_0x20f4b1(++_0x388652);}(_0xa61f,0x14d));var _0xfa61=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xa61f[_0x19950b];return _0x3c6b41;};'use strict';var EventEmitter=require(_0xfa61('0x0'));var ChatQueue=require(_0xfa61('0x1'))['db'][_0xfa61('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xfa61('0x3')](0x0);var events={'afterCreate':_0xfa61('0x4'),'afterUpdate':_0xfa61('0x5'),'afterDestroy':_0xfa61('0x6')};function emitEvent(_0x3b94fb){return function(_0x4a10e1,_0x3ef2cf,_0x50153f){ChatQueueEvents['emit'](_0x3b94fb+':'+_0x4a10e1['id'],_0x4a10e1);ChatQueueEvents[_0xfa61('0x7')](_0x3b94fb,_0x4a10e1);_0x50153f(null);};}for(var e in events){if(events[_0xfa61('0x8')](e)){var event=events[e];ChatQueue[_0xfa61('0x9')](e,emitEvent(event));}}module[_0xfa61('0xa')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index f87afb4..2c8ca2d 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 _0xf6cc=['ChatQueue','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes'];(function(_0x527b81,_0x167f05){var _0x6b4b26=function(_0x3db465){while(--_0x3db465){_0x527b81['push'](_0x527b81['shift']());}};_0x6b4b26(++_0x167f05);}(_0xf6cc,0x119));var _0xcf6c=function(_0x13d04f,_0x2276e0){_0x13d04f=_0x13d04f-0x0;var _0x28f335=_0xf6cc[_0x13d04f];return _0x28f335;};'use strict';var _=require(_0xcf6c('0x0'));var util=require(_0xcf6c('0x1'));var logger=require('../../config/logger')(_0xcf6c('0x2'));var moment=require(_0xcf6c('0x3'));var BPromise=require('bluebird');var rp=require(_0xcf6c('0x4'));var fs=require('fs');var path=require(_0xcf6c('0x5'));var rimraf=require(_0xcf6c('0x6'));var config=require(_0xcf6c('0x7'));var attributes=require(_0xcf6c('0x8'));module['exports']=function(_0x1669c0,_0xd5ea88){return _0x1669c0['define'](_0xcf6c('0x9'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x673b=['../../config/logger','moment','bluebird','request-promise','path','rimraf','./chatQueue.attributes','exports','define','ChatQueue','lodash','util'];(function(_0x5e977f,_0x4b32bf){var _0x5c11dd=function(_0x1a9aee){while(--_0x1a9aee){_0x5e977f['push'](_0x5e977f['shift']());}};_0x5c11dd(++_0x4b32bf);}(_0x673b,0xee));var _0xb673=function(_0x5cb5fc,_0x6cdda3){_0x5cb5fc=_0x5cb5fc-0x0;var _0x4b6fab=_0x673b[_0x5cb5fc];return _0x4b6fab;};'use strict';var _=require(_0xb673('0x0'));var util=require(_0xb673('0x1'));var logger=require(_0xb673('0x2'))('api');var moment=require(_0xb673('0x3'));var BPromise=require(_0xb673('0x4'));var rp=require(_0xb673('0x5'));var fs=require('fs');var path=require(_0xb673('0x6'));var rimraf=require(_0xb673('0x7'));var config=require('../../config/environment');var attributes=require(_0xb673('0x8'));module[_0xb673('0x9')]=function(_0x1278fc,_0x454fca){return _0x1278fc[_0xb673('0xa')](_0xb673('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 2d667fb..39f9768 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 _0x199c=['attributes','limit','include','map','model','raw','where','info','ShowChatQueue','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','./chatQueue.socket','register','request','then','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','ChatQueue,\x20%s,\x20%s','catch','GetChatQueue','ChatQueue','findAll','options'];(function(_0x11e268,_0x7325a){var _0x2765e4=function(_0x4725e2){while(--_0x4725e2){_0x11e268['push'](_0x11e268['shift']());}};_0x2765e4(++_0x7325a);}(_0x199c,0x7b));var _0xc199=function(_0x1bddc1,_0x36a9c6){_0x1bddc1=_0x1bddc1-0x0;var _0x25ddd0=_0x199c[_0x1bddc1];return _0x25ddd0;};'use strict';var _=require(_0xc199('0x0'));var util=require(_0xc199('0x1'));var moment=require(_0xc199('0x2'));var BPromise=require('bluebird');var rs=require(_0xc199('0x3'));var fs=require('fs');var Redis=require(_0xc199('0x4'));var db=require(_0xc199('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc199('0x6'));var config=require(_0xc199('0x7'));var jayson=require(_0xc199('0x8'));var client=jayson[_0xc199('0x9')][_0xc199('0xa')]({'port':0x232a});config[_0xc199('0xb')]=_['defaults'](config[_0xc199('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc199('0xc'))[_0xc199('0xd')](socket);function respondWithRpcPromise(_0xc971a8,_0x4b472c,_0x35f923){return new BPromise(function(_0x44db95,_0x596249){return client[_0xc199('0xe')](_0xc971a8,_0x35f923)[_0xc199('0xf')](function(_0x3b7ec6){logger['info']('ChatQueue,\x20%s,\x20%s',_0x4b472c,'request\x20sent');logger[_0xc199('0x10')](_0xc199('0x11'),_0x4b472c,_0xc199('0x12'),JSON[_0xc199('0x13')](_0x3b7ec6));if(_0x3b7ec6[_0xc199('0x14')]){if(_0x3b7ec6[_0xc199('0x14')][_0xc199('0x15')]===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x4b472c,_0x3b7ec6[_0xc199('0x14')][_0xc199('0x16')]);return _0x596249(_0x3b7ec6[_0xc199('0x14')][_0xc199('0x16')]);}logger[_0xc199('0x14')](_0xc199('0x17'),_0x4b472c,_0x3b7ec6['error'][_0xc199('0x16')]);return _0x44db95(_0x3b7ec6[_0xc199('0x14')][_0xc199('0x16')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x4b472c,_0xc199('0x12'));_0x44db95(_0x3b7ec6['result']['message']);}})[_0xc199('0x18')](function(_0x488501){logger[_0xc199('0x14')](_0xc199('0x17'),_0x4b472c,_0x488501);_0x596249(_0x488501);});});}exports[_0xc199('0x19')]=function(_0x3f5506){var _0x1478b2=this;return new Promise(function(_0x24d50c,_0x2fb987){return db[_0xc199('0x1a')][_0xc199('0x1b')]({'raw':_0x3f5506['options']?_0x3f5506[_0xc199('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x3f5506[_0xc199('0x1c')]?_0x3f5506[_0xc199('0x1c')]['where']||null:null,'attributes':_0x3f5506[_0xc199('0x1c')]?_0x3f5506['options'][_0xc199('0x1d')]||null:null,'limit':_0x3f5506[_0xc199('0x1c')]?_0x3f5506[_0xc199('0x1c')][_0xc199('0x1e')]||null:null,'include':_0x3f5506[_0xc199('0x1c')]?_0x3f5506[_0xc199('0x1c')][_0xc199('0x1f')]?_[_0xc199('0x20')](_0x3f5506['options'][_0xc199('0x1f')],function(_0x2626fc){return{'model':db[_0x2626fc[_0xc199('0x21')]],'as':_0x2626fc['as'],'attributes':_0x2626fc[_0xc199('0x1d')],'include':_0x2626fc[_0xc199('0x1f')]?_[_0xc199('0x20')](_0x2626fc[_0xc199('0x1f')],function(_0x526d72){return{'model':db[_0x526d72[_0xc199('0x21')]],'as':_0x526d72['as'],'attributes':_0x526d72[_0xc199('0x1d')],'include':_0x526d72[_0xc199('0x1f')]?_[_0xc199('0x20')](_0x526d72[_0xc199('0x1f')],function(_0x2dbaaf){return{'model':db[_0x2dbaaf[_0xc199('0x21')]],'as':_0x2dbaaf['as'],'attributes':_0x2dbaaf[_0xc199('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xc199('0xf')](function(_0xf16093){logger['info']('GetChatQueue',_0x3f5506);logger[_0xc199('0x10')]('GetChatQueue',_0x3f5506,JSON['stringify'](_0xf16093));_0x24d50c(_0xf16093);})[_0xc199('0x18')](function(_0x5f15e9){logger['error'](_0xc199('0x19'),_0x5f15e9[_0xc199('0x16')],_0x3f5506);_0x2fb987(_0x1478b2[_0xc199('0x14')](0x1f4,_0x5f15e9[_0xc199('0x16')]));});});};exports['ShowChatQueue']=function(_0x42be5d){var _0x59a193=this;return new Promise(function(_0xbd6526,_0x43743d){return db['ChatQueue']['find']({'raw':_0x42be5d[_0xc199('0x1c')]?_0x42be5d[_0xc199('0x1c')][_0xc199('0x22')]===undefined?!![]:![]:!![],'where':_0x42be5d[_0xc199('0x1c')]?_0x42be5d[_0xc199('0x1c')][_0xc199('0x23')]||null:null,'attributes':_0x42be5d['options']?_0x42be5d[_0xc199('0x1c')][_0xc199('0x1d')]||null:null,'include':_0x42be5d[_0xc199('0x1c')]?_0x42be5d[_0xc199('0x1c')]['include']?_['map'](_0x42be5d['options'][_0xc199('0x1f')],function(_0x181abc){return{'model':db[_0x181abc[_0xc199('0x21')]],'as':_0x181abc['as'],'attributes':_0x181abc[_0xc199('0x1d')],'include':_0x181abc['include']?_[_0xc199('0x20')](_0x181abc[_0xc199('0x1f')],function(_0x30b211){return{'model':db[_0x30b211[_0xc199('0x21')]],'as':_0x30b211['as'],'attributes':_0x30b211[_0xc199('0x1d')],'include':_0x30b211['include']?_[_0xc199('0x20')](_0x30b211[_0xc199('0x1f')],function(_0xdc8ac2){return{'model':db[_0xdc8ac2[_0xc199('0x21')]],'as':_0xdc8ac2['as'],'attributes':_0xdc8ac2[_0xc199('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xc199('0xf')](function(_0x10a077){logger[_0xc199('0x24')]('ShowChatQueue',_0x42be5d);logger[_0xc199('0x10')](_0xc199('0x25'),_0x42be5d,JSON['stringify'](_0x10a077));_0xbd6526(_0x10a077);})[_0xc199('0x18')](function(_0x5742a9){logger[_0xc199('0x14')](_0xc199('0x25'),_0x5742a9['message'],_0x42be5d);_0x43743d(_0x59a193['error'](0x1f4,_0x5742a9[_0xc199('0x16')]));});});}; \ No newline at end of file +var _0x5942=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','socket.io-emitter','register','request','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatQueue,\x20%s,\x20%s','result','catch','GetChatQueue','ChatQueue','findAll','options','where','attributes','map','include','model','ShowChatQueue','find','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x35c543,_0x10a9b7){var _0x9efe3a=function(_0x1aca7b){while(--_0x1aca7b){_0x35c543['push'](_0x35c543['shift']());}};_0x9efe3a(++_0x10a9b7);}(_0x5942,0x16a));var _0x2594=function(_0x38e358,_0x51d4fa){_0x38e358=_0x38e358-0x0;var _0x2b8b86=_0x5942[_0x38e358];return _0x2b8b86;};'use strict';var _=require(_0x2594('0x0'));var util=require(_0x2594('0x1'));var moment=require(_0x2594('0x2'));var BPromise=require(_0x2594('0x3'));var rs=require(_0x2594('0x4'));var fs=require('fs');var Redis=require(_0x2594('0x5'));var db=require(_0x2594('0x6'))['db'];var utils=require(_0x2594('0x7'));var logger=require(_0x2594('0x8'))(_0x2594('0x9'));var config=require(_0x2594('0xa'));var jayson=require(_0x2594('0xb'));var client=jayson['client']['http']({'port':0x232a});config[_0x2594('0xc')]=_[_0x2594('0xd')](config[_0x2594('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x2594('0xe'))(new Redis(config[_0x2594('0xc')]));require('./chatQueue.socket')[_0x2594('0xf')](socket);function respondWithRpcPromise(_0x516088,_0x243a4e,_0x432b67){return new BPromise(function(_0x2e970c,_0x4a7dd2){return client[_0x2594('0x10')](_0x516088,_0x432b67)[_0x2594('0x11')](function(_0x26aa8c){logger[_0x2594('0x12')]('ChatQueue,\x20%s,\x20%s',_0x243a4e,_0x2594('0x13'));logger[_0x2594('0x14')](_0x2594('0x15'),_0x243a4e,_0x2594('0x13'),JSON[_0x2594('0x16')](_0x26aa8c));if(_0x26aa8c[_0x2594('0x17')]){if(_0x26aa8c[_0x2594('0x17')][_0x2594('0x18')]===0x1f4){logger[_0x2594('0x17')]('ChatQueue,\x20%s,\x20%s',_0x243a4e,_0x26aa8c[_0x2594('0x17')][_0x2594('0x19')]);return _0x4a7dd2(_0x26aa8c['error'][_0x2594('0x19')]);}logger['error'](_0x2594('0x1a'),_0x243a4e,_0x26aa8c[_0x2594('0x17')][_0x2594('0x19')]);return _0x2e970c(_0x26aa8c[_0x2594('0x17')][_0x2594('0x19')]);}else{logger['info'](_0x2594('0x1a'),_0x243a4e,_0x2594('0x13'));_0x2e970c(_0x26aa8c[_0x2594('0x1b')][_0x2594('0x19')]);}})[_0x2594('0x1c')](function(_0x4776a3){logger[_0x2594('0x17')](_0x2594('0x1a'),_0x243a4e,_0x4776a3);_0x4a7dd2(_0x4776a3);});});}exports[_0x2594('0x1d')]=function(_0x52b80a){var _0x4fab4e=this;return new Promise(function(_0x31efb3,_0x40a1f2){return db[_0x2594('0x1e')][_0x2594('0x1f')]({'raw':_0x52b80a[_0x2594('0x20')]?_0x52b80a[_0x2594('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x52b80a[_0x2594('0x20')]?_0x52b80a[_0x2594('0x20')][_0x2594('0x21')]||null:null,'attributes':_0x52b80a[_0x2594('0x20')]?_0x52b80a['options'][_0x2594('0x22')]||null:null,'limit':_0x52b80a['options']?_0x52b80a[_0x2594('0x20')]['limit']||null:null,'include':_0x52b80a[_0x2594('0x20')]?_0x52b80a[_0x2594('0x20')]['include']?_[_0x2594('0x23')](_0x52b80a['options'][_0x2594('0x24')],function(_0x12258e){return{'model':db[_0x12258e[_0x2594('0x25')]],'as':_0x12258e['as'],'attributes':_0x12258e[_0x2594('0x22')],'include':_0x12258e[_0x2594('0x24')]?_[_0x2594('0x23')](_0x12258e[_0x2594('0x24')],function(_0x1bf777){return{'model':db[_0x1bf777['model']],'as':_0x1bf777['as'],'attributes':_0x1bf777[_0x2594('0x22')],'include':_0x1bf777['include']?_['map'](_0x1bf777[_0x2594('0x24')],function(_0x21339d){return{'model':db[_0x21339d['model']],'as':_0x21339d['as'],'attributes':_0x21339d[_0x2594('0x22')]};}):[]};}):[]};}):[]:[]})[_0x2594('0x11')](function(_0x590123){logger[_0x2594('0x12')](_0x2594('0x1d'),_0x52b80a);logger[_0x2594('0x14')](_0x2594('0x1d'),_0x52b80a,JSON['stringify'](_0x590123));_0x31efb3(_0x590123);})[_0x2594('0x1c')](function(_0x139602){logger[_0x2594('0x17')](_0x2594('0x1d'),_0x139602[_0x2594('0x19')],_0x52b80a);_0x40a1f2(_0x4fab4e['error'](0x1f4,_0x139602[_0x2594('0x19')]));});});};exports[_0x2594('0x26')]=function(_0x4f3f2f){var _0x4ca65e=this;return new Promise(function(_0x2effa9,_0x1f1425){return db[_0x2594('0x1e')][_0x2594('0x27')]({'raw':_0x4f3f2f['options']?_0x4f3f2f[_0x2594('0x20')][_0x2594('0x28')]===undefined?!![]:![]:!![],'where':_0x4f3f2f['options']?_0x4f3f2f['options']['where']||null:null,'attributes':_0x4f3f2f['options']?_0x4f3f2f['options'][_0x2594('0x22')]||null:null,'include':_0x4f3f2f[_0x2594('0x20')]?_0x4f3f2f[_0x2594('0x20')][_0x2594('0x24')]?_[_0x2594('0x23')](_0x4f3f2f[_0x2594('0x20')][_0x2594('0x24')],function(_0x3c2d3e){return{'model':db[_0x3c2d3e[_0x2594('0x25')]],'as':_0x3c2d3e['as'],'attributes':_0x3c2d3e[_0x2594('0x22')],'include':_0x3c2d3e[_0x2594('0x24')]?_[_0x2594('0x23')](_0x3c2d3e[_0x2594('0x24')],function(_0x2c71be){return{'model':db[_0x2c71be[_0x2594('0x25')]],'as':_0x2c71be['as'],'attributes':_0x2c71be['attributes'],'include':_0x2c71be['include']?_[_0x2594('0x23')](_0x2c71be[_0x2594('0x24')],function(_0x2680ec){return{'model':db[_0x2680ec[_0x2594('0x25')]],'as':_0x2680ec['as'],'attributes':_0x2680ec[_0x2594('0x22')]};}):[]};}):[]};}):[]:[]})[_0x2594('0x11')](function(_0x26e31c){logger[_0x2594('0x12')](_0x2594('0x26'),_0x4f3f2f);logger['debug']('ShowChatQueue',_0x4f3f2f,JSON[_0x2594('0x16')](_0x26e31c));_0x2effa9(_0x26e31c);})['catch'](function(_0x66c6f6){logger[_0x2594('0x17')](_0x2594('0x26'),_0x66c6f6[_0x2594('0x19')],_0x4f3f2f);_0x1f1425(_0x4ca65e['error'](0x1f4,_0x66c6f6['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 4b9e9ee..9c99e9d 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 _0xe13a=['update','emit','removeListener','register','chatQueue:','save','remove'];(function(_0x3b231a,_0x53a00d){var _0x18d67a=function(_0x5e14c6){while(--_0x5e14c6){_0x3b231a['push'](_0x3b231a['shift']());}};_0x18d67a(++_0x53a00d);}(_0xe13a,0x178));var _0xae13=function(_0x96587c,_0x27cb58){_0x96587c=_0x96587c-0x0;var _0x33a69d=_0xe13a[_0x96587c];return _0x33a69d;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0xae13('0x0'),_0xae13('0x1'),_0xae13('0x2')];function createListener(_0x6066c0,_0x4cf961){return function(_0x3aaf90){_0x4cf961[_0xae13('0x3')](_0x6066c0,_0x3aaf90);};}function removeListener(_0x3ebbfe,_0x10abd7){return function(){ChatQueueEvents[_0xae13('0x4')](_0x3ebbfe,_0x10abd7);};}exports[_0xae13('0x5')]=function(_0x412a07){for(var _0x3379ed=0x0,_0x341ba4=events['length'];_0x3379ed<_0x341ba4;_0x3379ed++){var _0x2f6d10=events[_0x3379ed];var _0x2b2e1f=createListener(_0xae13('0x6')+_0x2f6d10,_0x412a07);ChatQueueEvents['on'](_0x2f6d10,_0x2b2e1f);}}; \ No newline at end of file +var _0x0ba7=['emit','removeListener','register','length','chatQueue:','./chatQueue.events','remove','update'];(function(_0x5759a0,_0x2d1582){var _0x3417e9=function(_0x44dc0c){while(--_0x44dc0c){_0x5759a0['push'](_0x5759a0['shift']());}};_0x3417e9(++_0x2d1582);}(_0x0ba7,0x16d));var _0x70ba=function(_0x39ba3c,_0x868d60){_0x39ba3c=_0x39ba3c-0x0;var _0x1d6469=_0x0ba7[_0x39ba3c];return _0x1d6469;};'use strict';var ChatQueueEvents=require(_0x70ba('0x0'));var events=['save',_0x70ba('0x1'),_0x70ba('0x2')];function createListener(_0xadfc69,_0x42d93c){return function(_0x5e5368){_0x42d93c[_0x70ba('0x3')](_0xadfc69,_0x5e5368);};}function removeListener(_0x3e20ab,_0x3cb2e3){return function(){ChatQueueEvents[_0x70ba('0x4')](_0x3e20ab,_0x3cb2e3);};}exports[_0x70ba('0x5')]=function(_0x3f9877){for(var _0x17a00c=0x0,_0x2d5a16=events[_0x70ba('0x6')];_0x17a00c<_0x2d5a16;_0x17a00c++){var _0x1185cb=events[_0x17a00c];var _0x1a968b=createListener(_0x70ba('0x7')+_0x1185cb,_0x3f9877);ChatQueueEvents['on'](_0x1185cb,_0x1a968b);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 44e65d2..6586505 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 _0x5fc3=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','/:id/users','post','create','addTeams','put'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x5fc3,0xa8));var _0x35fc=function(_0x5447aa,_0x3afc00){_0x5447aa=_0x5447aa-0x0;var _0xb21e53=_0x5fc3[_0x5447aa];return _0xb21e53;};'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('0x9')]('/:id/members',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getTeams']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x11')]('/',auth['isAuthenticated'](),controller[_0x35fc('0x12')]);router[_0x35fc('0x11')](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x13')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x35fc('0x14')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x16')](_0x35fc('0xc'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x16')]('/:id/teams',auth[_0x35fc('0xa')](),controller[_0x35fc('0x18')]);router[_0x35fc('0x16')]('/:id/users',auth[_0x35fc('0xa')](),controller[_0x35fc('0x19')]);module[_0x35fc('0x1a')]=router; \ No newline at end of file +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(_0x26d48f,_0x42a741){var _0x4ab9d5=function(_0x1f573d){while(--_0x1f573d){_0x26d48f['push'](_0x26d48f['shift']());}};_0x4ab9d5(++_0x42a741);}(_0x7217,0x19e));var _0x7721=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x7217[_0x297fd3];return _0x2af381;};'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 diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 84c4ad2..63bf8bb 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 _0x1c00=['exports','STRING','DATE','sequelize'];(function(_0x2aeee5,_0x151b16){var _0xf5f89b=function(_0x52415e){while(--_0x52415e){_0x2aeee5['push'](_0x2aeee5['shift']());}};_0xf5f89b(++_0x151b16);}(_0x1c00,0x137));var _0x01c0=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x1c00[_0x4c12ec];return _0x3ae42c;};'use strict';var moment=require('moment');var Sequelize=require(_0x01c0('0x0'));module[_0x01c0('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x01c0('0x2')]},'joinAt':{'type':Sequelize[_0x01c0('0x3')]},'leaveAt':{'type':Sequelize[_0x01c0('0x3')]},'acceptAt':{'type':Sequelize[_0x01c0('0x3')]},'exitAt':{'type':Sequelize[_0x01c0('0x3')]},'reason':{'type':Sequelize[_0x01c0('0x2')]}}; \ No newline at end of file +var _0xdd32=['exports','STRING','DATE','moment','sequelize'];(function(_0x51b241,_0x187fab){var _0x16a3a7=function(_0x5f1b23){while(--_0x5f1b23){_0x51b241['push'](_0x51b241['shift']());}};_0x16a3a7(++_0x187fab);}(_0xdd32,0x67));var _0x2dd3=function(_0x100e2f,_0x3d3c64){_0x100e2f=_0x100e2f-0x0;var _0xe5457b=_0xdd32[_0x100e2f];return _0xe5457b;};'use strict';var moment=require(_0x2dd3('0x0'));var Sequelize=require(_0x2dd3('0x1'));module[_0x2dd3('0x2')]={'uniqueid':{'type':Sequelize[_0x2dd3('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x2dd3('0x3')]},'joinAt':{'type':Sequelize[_0x2dd3('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x2dd3('0x4')]},'exitAt':{'type':Sequelize[_0x2dd3('0x4')]},'reason':{'type':Sequelize[_0x2dd3('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 43712b1..9bfad9a 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 _0x93bb=['includeAll','find','body','update','describe','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','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','then','destroy','error','stack','name','send','map','ChatQueueReport','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','params','keys'];(function(_0x1e9bf5,_0x2b8466){var _0x3e43a0=function(_0x4f74dd){while(--_0x4f74dd){_0x1e9bf5['push'](_0x1e9bf5['shift']());}};_0x3e43a0(++_0x2b8466);}(_0x93bb,0x135));var _0xb93b=function(_0x2524a1,_0x533bb6){_0x2524a1=_0x2524a1-0x0;var _0x3beff7=_0x93bb[_0x2524a1];return _0x3beff7;};'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'];function respondWithStatusCode(_0x5ccabd,_0x44291c){_0x44291c=_0x44291c||0xcc;return function(_0x17f7b0){if(_0x17f7b0){return _0x5ccabd[_0xb93b('0x1c')](_0x44291c);}return _0x5ccabd[_0xb93b('0x1d')](_0x44291c)[_0xb93b('0x1e')]();};}function respondWithResult(_0x29d02e,_0x12ce38){_0x12ce38=_0x12ce38||0xc8;return function(_0x58c73b){if(_0x58c73b){return _0x29d02e[_0xb93b('0x1d')](_0x12ce38)[_0xb93b('0x1f')](_0x58c73b);}};}function respondWithFilteredResult(_0x4281b6,_0x1f6c4b){return function(_0x9e9479){if(_0x9e9479){var _0x1debd0=typeof _0x1f6c4b['offset']===_0xb93b('0x20')&&typeof _0x1f6c4b['limit']===_0xb93b('0x20');var _0x1f4300=_0x9e9479[_0xb93b('0x21')];var _0x11f85b=_0x1debd0?0x0:_0x1f6c4b[_0xb93b('0x22')];var _0x385100=_0x1debd0?_0x9e9479['count']:_0x1f6c4b[_0xb93b('0x22')]+_0x1f6c4b[_0xb93b('0x23')];var _0x3567cf;if(_0x385100>=_0x1f4300){_0x385100=_0x1f4300;_0x3567cf=0xc8;}else{_0x3567cf=0xce;}_0x4281b6[_0xb93b('0x1d')](_0x3567cf);return _0x4281b6[_0xb93b('0x24')](_0xb93b('0x25'),_0x11f85b+'-'+_0x385100+'/'+_0x1f4300)['json'](_0x9e9479);}return null;};}function patchUpdates(_0x57adc7){return function(_0x50f944){try{jsonpatch['apply'](_0x50f944,_0x57adc7,!![]);}catch(_0x1add64){return BPromise['reject'](_0x1add64);}return _0x50f944['save']();};}function saveUpdates(_0xdcf20c,_0x3e57aa){return function(_0x295c61){if(_0x295c61){return _0x295c61['update'](_0xdcf20c)[_0xb93b('0x26')](function(_0x31166b){return _0x31166b;});}return null;};}function removeEntity(_0x5beca0,_0x2cab58){return function(_0x2c6505){if(_0x2c6505){return _0x2c6505[_0xb93b('0x27')]()[_0xb93b('0x26')](function(){_0x5beca0[_0xb93b('0x1d')](0xcc)[_0xb93b('0x1e')]();});}};}function handleEntityNotFound(_0x4e4e16,_0x452483){return function(_0x13d5ad){if(!_0x13d5ad){_0x4e4e16[_0xb93b('0x1c')](0x194);}return _0x13d5ad;};}function handleError(_0x474928,_0x53c665){_0x53c665=_0x53c665||0x1f4;return function(_0x394d37){logger[_0xb93b('0x28')](_0x394d37[_0xb93b('0x29')]);if(_0x394d37[_0xb93b('0x2a')]){delete _0x394d37[_0xb93b('0x2a')];}_0x474928[_0xb93b('0x1d')](_0x53c665)[_0xb93b('0x2b')](_0x394d37);};}exports['index']=function(_0xb79c23,_0x5a9182){var _0x3d835a={},_0x41f593={},_0x60c609={'count':0x0,'rows':[]};var _0x2b31b1=_[_0xb93b('0x2c')](db[_0xb93b('0x2d')][_0xb93b('0x2e')],function(_0x42ee85){return{'name':_0x42ee85[_0xb93b('0x2f')],'type':_0x42ee85['type']['key']};});_0x41f593[_0xb93b('0x30')]=_[_0xb93b('0x2c')](_0x2b31b1,_0xb93b('0x2a'));_0x41f593['query']=_['keys'](_0xb79c23[_0xb93b('0x31')]);_0x41f593[_0xb93b('0x32')]=_[_0xb93b('0x33')](_0x41f593['model'],_0x41f593['query']);_0x3d835a[_0xb93b('0x34')]=_[_0xb93b('0x33')](_0x41f593[_0xb93b('0x30')],qs[_0xb93b('0x35')](_0xb79c23[_0xb93b('0x31')][_0xb93b('0x35')]));_0x3d835a[_0xb93b('0x34')]=_0x3d835a['attributes'][_0xb93b('0x36')]?_0x3d835a[_0xb93b('0x34')]:_0x41f593[_0xb93b('0x30')];if(!_0xb79c23[_0xb93b('0x31')][_0xb93b('0x37')](_0xb93b('0x38'))){_0x3d835a[_0xb93b('0x23')]=qs['limit'](_0xb79c23[_0xb93b('0x31')][_0xb93b('0x23')]);_0x3d835a[_0xb93b('0x22')]=qs[_0xb93b('0x22')](_0xb79c23[_0xb93b('0x31')][_0xb93b('0x22')]);}_0x3d835a[_0xb93b('0x39')]=qs['sort'](_0xb79c23[_0xb93b('0x31')][_0xb93b('0x3a')]);_0x3d835a[_0xb93b('0x3b')]=qs[_0xb93b('0x32')](_[_0xb93b('0x3c')](_0xb79c23[_0xb93b('0x31')],_0x41f593[_0xb93b('0x32')]),_0x2b31b1);if(_0xb79c23[_0xb93b('0x31')][_0xb93b('0x3d')]){_0x3d835a[_0xb93b('0x3b')]=_[_0xb93b('0x3e')](_0x3d835a[_0xb93b('0x3b')],{'$or':_[_0xb93b('0x2c')](_0x2b31b1,function(_0x2adc47){if(_0x2adc47['type']!==_0xb93b('0x3f')){var _0x1462d4={};_0x1462d4[_0x2adc47['name']]={'$like':'%'+_0xb79c23[_0xb93b('0x31')][_0xb93b('0x3d')]+'%'};return _0x1462d4;}})});}_0x3d835a=_[_0xb93b('0x3e')]({},_0x3d835a,_0xb79c23[_0xb93b('0x40')]);var _0x8f34e9={'where':_0x3d835a[_0xb93b('0x3b')]};return db['ChatQueueReport'][_0xb93b('0x21')](_0x8f34e9)[_0xb93b('0x26')](function(_0x10ad42){_0x60c609[_0xb93b('0x21')]=_0x10ad42;if(_0xb79c23['query']['includeAll']){_0x3d835a[_0xb93b('0x41')]=[{'all':!![]}];}return db[_0xb93b('0x2d')][_0xb93b('0x42')](_0x3d835a);})[_0xb93b('0x26')](function(_0x53aaaa){_0x60c609[_0xb93b('0x43')]=_0x53aaaa;return _0x60c609;})['then'](respondWithFilteredResult(_0x5a9182,_0x3d835a))[_0xb93b('0x44')](handleError(_0x5a9182,null));};exports['show']=function(_0x382261,_0x6f9464){var _0x159d3b={'raw':!![],'where':{'id':_0x382261[_0xb93b('0x45')]['id']}},_0x3b1617={};_0x3b1617[_0xb93b('0x30')]=_[_0xb93b('0x46')](db['ChatQueueReport'][_0xb93b('0x2e')]);_0x3b1617['query']=_[_0xb93b('0x46')](_0x382261['query']);_0x3b1617['filters']=_[_0xb93b('0x33')](_0x3b1617[_0xb93b('0x30')],_0x3b1617[_0xb93b('0x31')]);_0x159d3b[_0xb93b('0x34')]=_[_0xb93b('0x33')](_0x3b1617['model'],qs['fields'](_0x382261[_0xb93b('0x31')][_0xb93b('0x35')]));_0x159d3b[_0xb93b('0x34')]=_0x159d3b['attributes'][_0xb93b('0x36')]?_0x159d3b[_0xb93b('0x34')]:_0x3b1617['model'];if(_0x382261[_0xb93b('0x31')][_0xb93b('0x47')]){_0x159d3b[_0xb93b('0x41')]=[{'all':!![]}];}_0x159d3b=_[_0xb93b('0x3e')]({},_0x159d3b,_0x382261['options']);return db[_0xb93b('0x2d')][_0xb93b('0x48')](_0x159d3b)['then'](handleEntityNotFound(_0x6f9464,null))[_0xb93b('0x26')](respondWithResult(_0x6f9464,null))[_0xb93b('0x44')](handleError(_0x6f9464,null));};exports['create']=function(_0x4951fe,_0x31bd33){return db[_0xb93b('0x2d')]['create'](_0x4951fe[_0xb93b('0x49')],{})[_0xb93b('0x26')](respondWithResult(_0x31bd33,0xc9))[_0xb93b('0x44')](handleError(_0x31bd33,null));};exports[_0xb93b('0x4a')]=function(_0x1b3ca9,_0x2b47d4){if(_0x1b3ca9['body']['id']){delete _0x1b3ca9[_0xb93b('0x49')]['id'];}return db[_0xb93b('0x2d')]['find']({'where':{'id':_0x1b3ca9[_0xb93b('0x45')]['id']}})['then'](handleEntityNotFound(_0x2b47d4,null))[_0xb93b('0x26')](saveUpdates(_0x1b3ca9[_0xb93b('0x49')],null))[_0xb93b('0x26')](respondWithResult(_0x2b47d4,null))[_0xb93b('0x44')](handleError(_0x2b47d4,null));};exports[_0xb93b('0x27')]=function(_0x536890,_0x56f7ea){return db[_0xb93b('0x2d')][_0xb93b('0x48')]({'where':{'id':_0x536890[_0xb93b('0x45')]['id']}})[_0xb93b('0x26')](handleEntityNotFound(_0x56f7ea,null))[_0xb93b('0x26')](removeEntity(_0x56f7ea,null))[_0xb93b('0x44')](handleError(_0x56f7ea,null));};exports[_0xb93b('0x4b')]=function(_0x49797b,_0x48c2df){return db['ChatQueueReport'][_0xb93b('0x4b')]()['then'](respondWithResult(_0x48c2df,null))['catch'](handleError(_0x48c2df,null));}; \ No newline at end of file +var _0x6d11=['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','end','json','offset','undefined','limit','apply','reject','then','destroy','stack','name','send','index','map','ChatQueueReport','rawAttributes','key','model','query','keys','filters','intersection','attributes','length','sort','where','filter','merge','VIRTUAL','options','count','includeAll','include','show','params','fields','catch','create','body','find','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x6d11,0xbf));var _0x16d1=function(_0x202925,_0x21f58e){_0x202925=_0x202925-0x0;var _0x439825=_0x6d11[_0x202925];return _0x439825;};'use strict';var emlformat=require(_0x16d1('0x0'));var rimraf=require(_0x16d1('0x1'));var zipdir=require(_0x16d1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x16d1('0x3'));var moment=require('moment');var BPromise=require(_0x16d1('0x4'));var Mustache=require(_0x16d1('0x5'));var util=require('util');var path=require('path');var sox=require(_0x16d1('0x6'));var csv=require(_0x16d1('0x7'));var ejs=require(_0x16d1('0x8'));var fs=require('fs');var fs_extra=require(_0x16d1('0x9'));var _=require(_0x16d1('0xa'));var squel=require(_0x16d1('0xb'));var crypto=require(_0x16d1('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x16d1('0xd'));var Papa=require(_0x16d1('0xe'));var Redis=require(_0x16d1('0xf'));var authService=require(_0x16d1('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x16d1('0x11'));var hardwareService=require(_0x16d1('0x12'));var logger=require(_0x16d1('0x13'))(_0x16d1('0x14'));var utils=require(_0x16d1('0x15'));var config=require(_0x16d1('0x16'));var licenseUtil=require(_0x16d1('0x17'));var db=require(_0x16d1('0x18'))['db'];function respondWithStatusCode(_0x4de260,_0x32fa68){_0x32fa68=_0x32fa68||0xcc;return function(_0x2e71fa){if(_0x2e71fa){return _0x4de260[_0x16d1('0x19')](_0x32fa68);}return _0x4de260[_0x16d1('0x1a')](_0x32fa68)[_0x16d1('0x1b')]();};}function respondWithResult(_0x5a1429,_0xc034b7){_0xc034b7=_0xc034b7||0xc8;return function(_0x1b71d3){if(_0x1b71d3){return _0x5a1429[_0x16d1('0x1a')](_0xc034b7)[_0x16d1('0x1c')](_0x1b71d3);}};}function respondWithFilteredResult(_0x29ebba,_0x173e16){return function(_0x2d7e8a){if(_0x2d7e8a){var _0x4ee46c=typeof _0x173e16[_0x16d1('0x1d')]===_0x16d1('0x1e')&&typeof _0x173e16['limit']==='undefined';var _0x1a9ec8=_0x2d7e8a['count'];var _0x46a25e=_0x4ee46c?0x0:_0x173e16['offset'];var _0x1da1b8=_0x4ee46c?_0x2d7e8a['count']:_0x173e16[_0x16d1('0x1d')]+_0x173e16[_0x16d1('0x1f')];var _0x48cd70;if(_0x1da1b8>=_0x1a9ec8){_0x1da1b8=_0x1a9ec8;_0x48cd70=0xc8;}else{_0x48cd70=0xce;}_0x29ebba['status'](_0x48cd70);return _0x29ebba['set']('Content-Range',_0x46a25e+'-'+_0x1da1b8+'/'+_0x1a9ec8)[_0x16d1('0x1c')](_0x2d7e8a);}return null;};}function patchUpdates(_0x55a0e0){return function(_0x34b88f){try{jsonpatch[_0x16d1('0x20')](_0x34b88f,_0x55a0e0,!![]);}catch(_0x1f6add){return BPromise[_0x16d1('0x21')](_0x1f6add);}return _0x34b88f['save']();};}function saveUpdates(_0x2c7825,_0x58a03b){return function(_0x2a897d){if(_0x2a897d){return _0x2a897d['update'](_0x2c7825)[_0x16d1('0x22')](function(_0x8c7266){return _0x8c7266;});}return null;};}function removeEntity(_0x17e038,_0x47cad4){return function(_0x215c23){if(_0x215c23){return _0x215c23[_0x16d1('0x23')]()[_0x16d1('0x22')](function(){_0x17e038[_0x16d1('0x1a')](0xcc)[_0x16d1('0x1b')]();});}};}function handleEntityNotFound(_0x335c24,_0x4b2b5c){return function(_0x15203b){if(!_0x15203b){_0x335c24[_0x16d1('0x19')](0x194);}return _0x15203b;};}function handleError(_0x262f89,_0x346b69){_0x346b69=_0x346b69||0x1f4;return function(_0x2b8403){logger['error'](_0x2b8403[_0x16d1('0x24')]);if(_0x2b8403[_0x16d1('0x25')]){delete _0x2b8403[_0x16d1('0x25')];}_0x262f89['status'](_0x346b69)[_0x16d1('0x26')](_0x2b8403);};}exports[_0x16d1('0x27')]=function(_0x364bf7,_0x22e5b3){var _0x6396fc={},_0x462e5b={},_0x1dd574={'count':0x0,'rows':[]};var _0x562908=_[_0x16d1('0x28')](db[_0x16d1('0x29')][_0x16d1('0x2a')],function(_0x30cd8f){return{'name':_0x30cd8f['fieldName'],'type':_0x30cd8f['type'][_0x16d1('0x2b')]};});_0x462e5b[_0x16d1('0x2c')]=_[_0x16d1('0x28')](_0x562908,_0x16d1('0x25'));_0x462e5b[_0x16d1('0x2d')]=_[_0x16d1('0x2e')](_0x364bf7[_0x16d1('0x2d')]);_0x462e5b[_0x16d1('0x2f')]=_[_0x16d1('0x30')](_0x462e5b[_0x16d1('0x2c')],_0x462e5b[_0x16d1('0x2d')]);_0x6396fc[_0x16d1('0x31')]=_[_0x16d1('0x30')](_0x462e5b[_0x16d1('0x2c')],qs['fields'](_0x364bf7[_0x16d1('0x2d')]['fields']));_0x6396fc[_0x16d1('0x31')]=_0x6396fc[_0x16d1('0x31')][_0x16d1('0x32')]?_0x6396fc[_0x16d1('0x31')]:_0x462e5b[_0x16d1('0x2c')];if(!_0x364bf7[_0x16d1('0x2d')]['hasOwnProperty']('nolimit')){_0x6396fc['limit']=qs[_0x16d1('0x1f')](_0x364bf7[_0x16d1('0x2d')][_0x16d1('0x1f')]);_0x6396fc[_0x16d1('0x1d')]=qs['offset'](_0x364bf7[_0x16d1('0x2d')][_0x16d1('0x1d')]);}_0x6396fc['order']=qs['sort'](_0x364bf7['query'][_0x16d1('0x33')]);_0x6396fc[_0x16d1('0x34')]=qs[_0x16d1('0x2f')](_['pick'](_0x364bf7[_0x16d1('0x2d')],_0x462e5b[_0x16d1('0x2f')]),_0x562908);if(_0x364bf7[_0x16d1('0x2d')][_0x16d1('0x35')]){_0x6396fc[_0x16d1('0x34')]=_[_0x16d1('0x36')](_0x6396fc[_0x16d1('0x34')],{'$or':_['map'](_0x562908,function(_0x50267b){if(_0x50267b['type']!==_0x16d1('0x37')){var _0x2306d3={};_0x2306d3[_0x50267b[_0x16d1('0x25')]]={'$like':'%'+_0x364bf7[_0x16d1('0x2d')][_0x16d1('0x35')]+'%'};return _0x2306d3;}})});}_0x6396fc=_[_0x16d1('0x36')]({},_0x6396fc,_0x364bf7[_0x16d1('0x38')]);var _0x369b1c={'where':_0x6396fc['where']};return db[_0x16d1('0x29')]['count'](_0x369b1c)['then'](function(_0x352c5b){_0x1dd574[_0x16d1('0x39')]=_0x352c5b;if(_0x364bf7[_0x16d1('0x2d')][_0x16d1('0x3a')]){_0x6396fc[_0x16d1('0x3b')]=[{'all':!![]}];}return db[_0x16d1('0x29')]['findAll'](_0x6396fc);})[_0x16d1('0x22')](function(_0x525212){_0x1dd574['rows']=_0x525212;return _0x1dd574;})['then'](respondWithFilteredResult(_0x22e5b3,_0x6396fc))['catch'](handleError(_0x22e5b3,null));};exports[_0x16d1('0x3c')]=function(_0x168e14,_0x24038b){var _0x1eb761={'raw':!![],'where':{'id':_0x168e14[_0x16d1('0x3d')]['id']}},_0x53de06={};_0x53de06['model']=_[_0x16d1('0x2e')](db[_0x16d1('0x29')][_0x16d1('0x2a')]);_0x53de06[_0x16d1('0x2d')]=_[_0x16d1('0x2e')](_0x168e14[_0x16d1('0x2d')]);_0x53de06[_0x16d1('0x2f')]=_[_0x16d1('0x30')](_0x53de06[_0x16d1('0x2c')],_0x53de06[_0x16d1('0x2d')]);_0x1eb761[_0x16d1('0x31')]=_[_0x16d1('0x30')](_0x53de06[_0x16d1('0x2c')],qs[_0x16d1('0x3e')](_0x168e14[_0x16d1('0x2d')]['fields']));_0x1eb761['attributes']=_0x1eb761[_0x16d1('0x31')][_0x16d1('0x32')]?_0x1eb761[_0x16d1('0x31')]:_0x53de06[_0x16d1('0x2c')];if(_0x168e14[_0x16d1('0x2d')][_0x16d1('0x3a')]){_0x1eb761['include']=[{'all':!![]}];}_0x1eb761=_[_0x16d1('0x36')]({},_0x1eb761,_0x168e14[_0x16d1('0x38')]);return db[_0x16d1('0x29')]['find'](_0x1eb761)['then'](handleEntityNotFound(_0x24038b,null))[_0x16d1('0x22')](respondWithResult(_0x24038b,null))[_0x16d1('0x3f')](handleError(_0x24038b,null));};exports['create']=function(_0x1cc137,_0x583151){return db[_0x16d1('0x29')][_0x16d1('0x40')](_0x1cc137[_0x16d1('0x41')],{})[_0x16d1('0x22')](respondWithResult(_0x583151,0xc9))['catch'](handleError(_0x583151,null));};exports['update']=function(_0x1d92cd,_0x8bb0c1){if(_0x1d92cd['body']['id']){delete _0x1d92cd[_0x16d1('0x41')]['id'];}return db[_0x16d1('0x29')][_0x16d1('0x42')]({'where':{'id':_0x1d92cd[_0x16d1('0x3d')]['id']}})[_0x16d1('0x22')](handleEntityNotFound(_0x8bb0c1,null))['then'](saveUpdates(_0x1d92cd[_0x16d1('0x41')],null))['then'](respondWithResult(_0x8bb0c1,null))[_0x16d1('0x3f')](handleError(_0x8bb0c1,null));};exports[_0x16d1('0x23')]=function(_0x5d384c,_0x413acd){return db[_0x16d1('0x29')][_0x16d1('0x42')]({'where':{'id':_0x5d384c[_0x16d1('0x3d')]['id']}})['then'](handleEntityNotFound(_0x413acd,null))['then'](removeEntity(_0x413acd,null))['catch'](handleError(_0x413acd,null));};exports[_0x16d1('0x43')]=function(_0xbf100f,_0x39fd41){return db[_0x16d1('0x29')]['describe']()[_0x16d1('0x22')](respondWithResult(_0x39fd41,null))[_0x16d1('0x3f')](handleError(_0x39fd41,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 3994921..d540512 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 _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0x572400,_0x54a61e){var _0x2d108d=function(_0x5ccdee){while(--_0x5ccdee){_0x572400['push'](_0x572400['shift']());}};_0x2d108d(++_0x54a61e);}(_0xb7e7,0x121));var _0x7b7e=function(_0x34843e,_0x4c4224){_0x34843e=_0x34843e-0x0;var _0x598f7f=_0xb7e7[_0x34843e];return _0x598f7f;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0xd2e384,_0x148b38){var _0x429485=function(_0xd4de13){while(--_0xd4de13){_0xd2e384['push'](_0xd2e384['shift']());}};_0x429485(++_0x148b38);}(_0xb7e7,0x121));var _0x7b7e=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0xb7e7[_0x341e0f];return _0x59555a;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index ad53ad0..1ac882a 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 _0x0f22=['error','code','message','result','catch','CreateChatQueueReport','create','body','options','raw','info','UpdateChatQueueReport','ChatQueueReport','update','where','limit','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','http','request','then','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x1a75c9,_0x11e344){var _0x3d2b86=function(_0x52b31a){while(--_0x52b31a){_0x1a75c9['push'](_0x1a75c9['shift']());}};_0x3d2b86(++_0x11e344);}(_0x0f22,0xab));var _0x20f2=function(_0x3d07ac,_0x48e276){_0x3d07ac=_0x3d07ac-0x0;var _0x5b88ce=_0x0f22[_0x3d07ac];return _0x5b88ce;};'use strict';var _=require(_0x20f2('0x0'));var util=require(_0x20f2('0x1'));var moment=require(_0x20f2('0x2'));var BPromise=require(_0x20f2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x20f2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x20f2('0x5'));var logger=require('../../config/logger')(_0x20f2('0x6'));var config=require(_0x20f2('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x20f2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x582628,_0x1c1085,_0xecb331){return new BPromise(function(_0x1cacd9,_0x1a6f9c){return client[_0x20f2('0x9')](_0x582628,_0xecb331)[_0x20f2('0xa')](function(_0x2cf9bc){logger['info'](_0x20f2('0xb'),_0x1c1085,_0x20f2('0xc'));logger[_0x20f2('0xd')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x1c1085,_0x20f2('0xc'),JSON[_0x20f2('0xe')](_0x2cf9bc));if(_0x2cf9bc[_0x20f2('0xf')]){if(_0x2cf9bc['error'][_0x20f2('0x10')]===0x1f4){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x1c1085,_0x2cf9bc[_0x20f2('0xf')][_0x20f2('0x11')]);return _0x1a6f9c(_0x2cf9bc[_0x20f2('0xf')][_0x20f2('0x11')]);}logger[_0x20f2('0xf')](_0x20f2('0xb'),_0x1c1085,_0x2cf9bc[_0x20f2('0xf')][_0x20f2('0x11')]);return _0x1cacd9(_0x2cf9bc[_0x20f2('0xf')]['message']);}else{logger['info'](_0x20f2('0xb'),_0x1c1085,_0x20f2('0xc'));_0x1cacd9(_0x2cf9bc[_0x20f2('0x12')][_0x20f2('0x11')]);}})[_0x20f2('0x13')](function(_0x114508){logger[_0x20f2('0xf')](_0x20f2('0xb'),_0x1c1085,_0x114508);_0x1a6f9c(_0x114508);});});}exports[_0x20f2('0x14')]=function(_0x5c4d61){var _0xd537d7=this;return new Promise(function(_0x4290c7,_0x5839f9){return db['ChatQueueReport'][_0x20f2('0x15')](_0x5c4d61[_0x20f2('0x16')],{'raw':_0x5c4d61[_0x20f2('0x17')]?_0x5c4d61[_0x20f2('0x17')][_0x20f2('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x34272e){logger[_0x20f2('0x19')](_0x20f2('0x14'),_0x5c4d61);logger[_0x20f2('0xd')](_0x20f2('0x14'),_0x5c4d61,JSON['stringify'](_0x34272e));_0x4290c7(_0x34272e);})[_0x20f2('0x13')](function(_0x4156ba){logger['error'](_0x20f2('0x14'),_0x4156ba['message'],_0x5c4d61);_0x5839f9(_0xd537d7[_0x20f2('0xf')](0x1f4,_0x4156ba['message']));});});};exports[_0x20f2('0x1a')]=function(_0x50721c){var _0x1b9d3f=this;return new Promise(function(_0x1bc25b,_0x37d81f){return db[_0x20f2('0x1b')][_0x20f2('0x1c')](_0x50721c[_0x20f2('0x16')],{'raw':_0x50721c[_0x20f2('0x17')]?_0x50721c[_0x20f2('0x17')][_0x20f2('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x50721c['options']?_0x50721c[_0x20f2('0x17')][_0x20f2('0x1d')]||null:null,'attributes':_0x50721c[_0x20f2('0x17')]?_0x50721c[_0x20f2('0x17')]['attributes']||null:null,'limit':_0x50721c[_0x20f2('0x17')]?_0x50721c[_0x20f2('0x17')][_0x20f2('0x1e')]||null:null})['then'](function(_0x3abfe8){logger['info']('UpdateChatQueueReport',_0x50721c);logger[_0x20f2('0xd')](_0x20f2('0x1a'),_0x50721c,JSON[_0x20f2('0xe')](_0x3abfe8));_0x1bc25b(_0x3abfe8);})[_0x20f2('0x13')](function(_0x3e6b8e){logger[_0x20f2('0xf')](_0x20f2('0x1a'),_0x3e6b8e[_0x20f2('0x11')],_0x50721c);_0x37d81f(_0x1b9d3f['error'](0x1f4,_0x3e6b8e[_0x20f2('0x11')]));});});}; \ No newline at end of file +var _0xca10=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','debug','UpdateChatQueueReport','update','attributes','limit','then','lodash','util','moment','bluebird','randomstring'];(function(_0x2a97c2,_0x190361){var _0x40f37a=function(_0x54aee4){while(--_0x54aee4){_0x2a97c2['push'](_0x2a97c2['shift']());}};_0x40f37a(++_0x190361);}(_0xca10,0x12d));var _0x0ca1=function(_0x4da62b,_0x469719){_0x4da62b=_0x4da62b-0x0;var _0x39bb0c=_0xca10[_0x4da62b];return _0x39bb0c;};'use strict';var _=require(_0x0ca1('0x0'));var util=require(_0x0ca1('0x1'));var moment=require(_0x0ca1('0x2'));var BPromise=require(_0x0ca1('0x3'));var rs=require(_0x0ca1('0x4'));var fs=require('fs');var Redis=require(_0x0ca1('0x5'));var db=require(_0x0ca1('0x6'))['db'];var utils=require(_0x0ca1('0x7'));var logger=require('../../config/logger')(_0x0ca1('0x8'));var config=require(_0x0ca1('0x9'));var jayson=require(_0x0ca1('0xa'));var client=jayson[_0x0ca1('0xb')][_0x0ca1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x452887,_0x190373,_0x17be5f){return new BPromise(function(_0x62c7c3,_0x5c7e47){return client['request'](_0x452887,_0x17be5f)['then'](function(_0x528306){logger[_0x0ca1('0xd')]('ChatQueueReport,\x20%s,\x20%s',_0x190373,_0x0ca1('0xe'));logger['debug'](_0x0ca1('0xf'),_0x190373,_0x0ca1('0xe'),JSON[_0x0ca1('0x10')](_0x528306));if(_0x528306[_0x0ca1('0x11')]){if(_0x528306[_0x0ca1('0x11')][_0x0ca1('0x12')]===0x1f4){logger[_0x0ca1('0x11')](_0x0ca1('0x13'),_0x190373,_0x528306[_0x0ca1('0x11')][_0x0ca1('0x14')]);return _0x5c7e47(_0x528306[_0x0ca1('0x11')][_0x0ca1('0x14')]);}logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x190373,_0x528306[_0x0ca1('0x11')][_0x0ca1('0x14')]);return _0x62c7c3(_0x528306[_0x0ca1('0x11')][_0x0ca1('0x14')]);}else{logger['info'](_0x0ca1('0x13'),_0x190373,_0x0ca1('0xe'));_0x62c7c3(_0x528306['result'][_0x0ca1('0x14')]);}})[_0x0ca1('0x15')](function(_0x5a9e7f){logger[_0x0ca1('0x11')](_0x0ca1('0x13'),_0x190373,_0x5a9e7f);_0x5c7e47(_0x5a9e7f);});});}exports[_0x0ca1('0x16')]=function(_0x349640){var _0x9330bf=this;return new Promise(function(_0x63b566,_0x5492d7){return db[_0x0ca1('0x17')][_0x0ca1('0x18')](_0x349640[_0x0ca1('0x19')],{'raw':_0x349640[_0x0ca1('0x1a')]?_0x349640[_0x0ca1('0x1a')][_0x0ca1('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x3792ea){logger['info'](_0x0ca1('0x16'),_0x349640);logger[_0x0ca1('0x1c')](_0x0ca1('0x16'),_0x349640,JSON[_0x0ca1('0x10')](_0x3792ea));_0x63b566(_0x3792ea);})[_0x0ca1('0x15')](function(_0x28b5a6){logger[_0x0ca1('0x11')](_0x0ca1('0x16'),_0x28b5a6[_0x0ca1('0x14')],_0x349640);_0x5492d7(_0x9330bf['error'](0x1f4,_0x28b5a6[_0x0ca1('0x14')]));});});};exports[_0x0ca1('0x1d')]=function(_0x3dbf1b){var _0x3157a9=this;return new Promise(function(_0x40e1d2,_0x143eef){return db[_0x0ca1('0x17')][_0x0ca1('0x1e')](_0x3dbf1b[_0x0ca1('0x19')],{'raw':_0x3dbf1b[_0x0ca1('0x1a')]?_0x3dbf1b[_0x0ca1('0x1a')][_0x0ca1('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3dbf1b[_0x0ca1('0x1a')]?_0x3dbf1b[_0x0ca1('0x1a')]['where']||null:null,'attributes':_0x3dbf1b['options']?_0x3dbf1b[_0x0ca1('0x1a')][_0x0ca1('0x1f')]||null:null,'limit':_0x3dbf1b[_0x0ca1('0x1a')]?_0x3dbf1b['options'][_0x0ca1('0x20')]||null:null})[_0x0ca1('0x21')](function(_0x160c7e){logger[_0x0ca1('0xd')](_0x0ca1('0x1d'),_0x3dbf1b);logger[_0x0ca1('0x1c')](_0x0ca1('0x1d'),_0x3dbf1b,JSON[_0x0ca1('0x10')](_0x160c7e));_0x40e1d2(_0x160c7e);})[_0x0ca1('0x15')](function(_0x5c9527){logger[_0x0ca1('0x11')]('UpdateChatQueueReport',_0x5c9527[_0x0ca1('0x14')],_0x3dbf1b);_0x143eef(_0x3157a9[_0x0ca1('0x11')](0x1f4,_0x5c9527[_0x0ca1('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index ae4792f..28e5dc7 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 _0xbc99=['isAuthenticated','index','/describe','describe','/:id','show','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','get'];(function(_0x3cca69,_0x25aae7){var _0x4d7901=function(_0x2c442f){while(--_0x2c442f){_0x3cca69['push'](_0x3cca69['shift']());}};_0x4d7901(++_0x25aae7);}(_0xbc99,0xf7));var _0x9bc9=function(_0xeb8400,_0x34392c){_0xeb8400=_0xeb8400-0x0;var _0x52d09a=_0xbc99[_0xeb8400];return _0x52d09a;};'use strict';var multer=require(_0x9bc9('0x0'));var util=require(_0x9bc9('0x1'));var path=require(_0x9bc9('0x2'));var timeout=require(_0x9bc9('0x3'));var express=require(_0x9bc9('0x4'));var router=express[_0x9bc9('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9bc9('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatQueueReport.controller');router[_0x9bc9('0x7')]('/',auth[_0x9bc9('0x8')](),controller[_0x9bc9('0x9')]);router[_0x9bc9('0x7')](_0x9bc9('0xa'),auth[_0x9bc9('0x8')](),controller[_0x9bc9('0xb')]);router[_0x9bc9('0x7')](_0x9bc9('0xc'),auth[_0x9bc9('0x8')](),controller[_0x9bc9('0xd')]);router['post']('/',auth[_0x9bc9('0x8')](),controller['create']);router['put'](_0x9bc9('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x9bc9('0xe')](_0x9bc9('0xc'),auth[_0x9bc9('0x8')](),controller[_0x9bc9('0xf')]);module[_0x9bc9('0x10')]=router; \ No newline at end of file +var _0x561b=['put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create'];(function(_0x216428,_0x5d20ea){var _0x313dd4=function(_0x447e0d){while(--_0x447e0d){_0x216428['push'](_0x216428['shift']());}};_0x313dd4(++_0x5d20ea);}(_0x561b,0x147));var _0xb561=function(_0xffd8bf,_0x57128d){_0xffd8bf=_0xffd8bf-0x0;var _0x562755=_0x561b[_0xffd8bf];return _0x562755;};'use strict';var multer=require(_0xb561('0x0'));var util=require(_0xb561('0x1'));var path=require(_0xb561('0x2'));var timeout=require('connect-timeout');var express=require(_0xb561('0x3'));var router=express[_0xb561('0x4')]();var fs_extra=require(_0xb561('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb561('0x6'));var config=require(_0xb561('0x7'));var controller=require(_0xb561('0x8'));router[_0xb561('0x9')]('/',auth[_0xb561('0xa')](),controller[_0xb561('0xb')]);router[_0xb561('0x9')](_0xb561('0xc'),auth['isAuthenticated'](),controller[_0xb561('0xd')]);router[_0xb561('0x9')](_0xb561('0xe'),auth[_0xb561('0xa')](),controller[_0xb561('0xf')]);router[_0xb561('0x10')]('/',auth[_0xb561('0xa')](),controller[_0xb561('0x11')]);router[_0xb561('0x12')](_0xb561('0xe'),auth[_0xb561('0xa')](),controller[_0xb561('0x13')]);router[_0xb561('0x14')](_0xb561('0xe'),auth[_0xb561('0xa')](),controller[_0xb561('0x15')]);module[_0xb561('0x16')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 2911c17..eac94a4 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 _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x1a1d9b,_0x5ea65a){var _0x1d7a59=function(_0xa1dea2){while(--_0xa1dea2){_0x1a1d9b['push'](_0x1a1d9b['shift']());}};_0x1d7a59(++_0x5ea65a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file +var _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x54256c,_0x51e1e6){var _0x295965=function(_0x14cbb7){while(--_0x14cbb7){_0x54256c['push'](_0x54256c['shift']());}};_0x295965(++_0x51e1e6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 47d5268..d20f5c6 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 _0x92c6=['ChatTransferReport','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index'];(function(_0x29e871,_0x330b98){var _0x3380e3=function(_0x26eeae){while(--_0x26eeae){_0x29e871['push'](_0x29e871['shift']());}};_0x3380e3(++_0x330b98);}(_0x92c6,0x67));var _0x692c=function(_0x1716f1,_0x2b49de){_0x1716f1=_0x1716f1-0x0;var _0x42d6ff=_0x92c6[_0x1716f1];return _0x42d6ff;};'use strict';var emlformat=require(_0x692c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x692c('0x1'));var jsonpatch=require(_0x692c('0x2'));var rp=require(_0x692c('0x3'));var moment=require('moment');var BPromise=require(_0x692c('0x4'));var Mustache=require('mustache');var util=require(_0x692c('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x692c('0x6'));var fs=require('fs');var fs_extra=require(_0x692c('0x7'));var _=require('lodash');var squel=require(_0x692c('0x8'));var crypto=require(_0x692c('0x9'));var jsforce=require(_0x692c('0xa'));var deskjs=require(_0x692c('0xb'));var toCsv=require(_0x692c('0xc'));var querystring=require(_0x692c('0xd'));var Papa=require(_0x692c('0xe'));var Redis=require(_0x692c('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x692c('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x692c('0x11'));var logger=require('../../config/logger')(_0x692c('0x12'));var utils=require(_0x692c('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x692c('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x197248,_0x51aeae){_0x51aeae=_0x51aeae||0xcc;return function(_0x299b71){if(_0x299b71){return _0x197248[_0x692c('0x15')](_0x51aeae);}return _0x197248[_0x692c('0x16')](_0x51aeae)[_0x692c('0x17')]();};}function respondWithResult(_0x1bc8a9,_0x357d61){_0x357d61=_0x357d61||0xc8;return function(_0x12a56d){if(_0x12a56d){return _0x1bc8a9['status'](_0x357d61)['json'](_0x12a56d);}};}function respondWithFilteredResult(_0x5e7c28,_0x23466d){return function(_0x553e6f){if(_0x553e6f){var _0x243a19=typeof _0x23466d[_0x692c('0x18')]===_0x692c('0x19')&&typeof _0x23466d[_0x692c('0x1a')]==='undefined';var _0x5b1ed0=_0x553e6f[_0x692c('0x1b')];var _0xb18243=_0x243a19?0x0:_0x23466d[_0x692c('0x18')];var _0x2d90a9=_0x243a19?_0x553e6f[_0x692c('0x1b')]:_0x23466d[_0x692c('0x18')]+_0x23466d[_0x692c('0x1a')];var _0x3bfba4;if(_0x2d90a9>=_0x5b1ed0){_0x2d90a9=_0x5b1ed0;_0x3bfba4=0xc8;}else{_0x3bfba4=0xce;}_0x5e7c28[_0x692c('0x16')](_0x3bfba4);return _0x5e7c28[_0x692c('0x1c')](_0x692c('0x1d'),_0xb18243+'-'+_0x2d90a9+'/'+_0x5b1ed0)['json'](_0x553e6f);}return null;};}function patchUpdates(_0x4af0da){return function(_0x2621b1){try{jsonpatch[_0x692c('0x1e')](_0x2621b1,_0x4af0da,!![]);}catch(_0x19118c){return BPromise[_0x692c('0x1f')](_0x19118c);}return _0x2621b1[_0x692c('0x20')]();};}function saveUpdates(_0x1187f4,_0x8b32b2){return function(_0x2708ce){if(_0x2708ce){return _0x2708ce[_0x692c('0x21')](_0x1187f4)[_0x692c('0x22')](function(_0x21a540){return _0x21a540;});}return null;};}function removeEntity(_0x7bf338,_0x1c0e7e){return function(_0x1866f8){if(_0x1866f8){return _0x1866f8[_0x692c('0x23')]()['then'](function(){_0x7bf338[_0x692c('0x16')](0xcc)[_0x692c('0x17')]();});}};}function handleEntityNotFound(_0x4f589a,_0x24cbdc){return function(_0x464f74){if(!_0x464f74){_0x4f589a[_0x692c('0x15')](0x194);}return _0x464f74;};}function handleError(_0x114c89,_0x1d15b9){_0x1d15b9=_0x1d15b9||0x1f4;return function(_0x451b10){logger[_0x692c('0x24')](_0x451b10[_0x692c('0x25')]);if(_0x451b10[_0x692c('0x26')]){delete _0x451b10['name'];}_0x114c89[_0x692c('0x16')](_0x1d15b9)[_0x692c('0x27')](_0x451b10);};}exports[_0x692c('0x28')]=function(_0x3b41bf,_0x16514b){var _0xc3bd8b={},_0x164379={},_0x1ed0b4={'count':0x0,'rows':[]};var _0xf8212e=_['map'](db[_0x692c('0x29')][_0x692c('0x2a')],function(_0x547e88){return{'name':_0x547e88[_0x692c('0x2b')],'type':_0x547e88[_0x692c('0x2c')][_0x692c('0x2d')]};});_0x164379[_0x692c('0x2e')]=_[_0x692c('0x2f')](_0xf8212e,'name');_0x164379[_0x692c('0x30')]=_[_0x692c('0x31')](_0x3b41bf[_0x692c('0x30')]);_0x164379['filters']=_[_0x692c('0x32')](_0x164379[_0x692c('0x2e')],_0x164379[_0x692c('0x30')]);_0xc3bd8b[_0x692c('0x33')]=_['intersection'](_0x164379['model'],qs[_0x692c('0x34')](_0x3b41bf[_0x692c('0x30')][_0x692c('0x34')]));_0xc3bd8b[_0x692c('0x33')]=_0xc3bd8b['attributes'][_0x692c('0x35')]?_0xc3bd8b[_0x692c('0x33')]:_0x164379[_0x692c('0x2e')];if(!_0x3b41bf[_0x692c('0x30')][_0x692c('0x36')](_0x692c('0x37'))){_0xc3bd8b[_0x692c('0x1a')]=qs['limit'](_0x3b41bf[_0x692c('0x30')]['limit']);_0xc3bd8b[_0x692c('0x18')]=qs[_0x692c('0x18')](_0x3b41bf[_0x692c('0x30')][_0x692c('0x18')]);}_0xc3bd8b[_0x692c('0x38')]=qs[_0x692c('0x39')](_0x3b41bf[_0x692c('0x30')][_0x692c('0x39')]);_0xc3bd8b[_0x692c('0x3a')]=qs[_0x692c('0x3b')](_['pick'](_0x3b41bf['query'],_0x164379[_0x692c('0x3b')]),_0xf8212e);if(_0x3b41bf[_0x692c('0x30')][_0x692c('0x3c')]){_0xc3bd8b[_0x692c('0x3a')]=_[_0x692c('0x3d')](_0xc3bd8b['where'],{'$or':_['map'](_0xf8212e,function(_0x4492cb){if(_0x4492cb[_0x692c('0x2c')]!=='VIRTUAL'){var _0x362257={};_0x362257[_0x4492cb[_0x692c('0x26')]]={'$like':'%'+_0x3b41bf[_0x692c('0x30')]['filter']+'%'};return _0x362257;}})});}_0xc3bd8b=_[_0x692c('0x3d')]({},_0xc3bd8b,_0x3b41bf['options']);var _0x3be8ae={'where':_0xc3bd8b[_0x692c('0x3a')]};return db['ChatTransferReport'][_0x692c('0x1b')](_0x3be8ae)[_0x692c('0x22')](function(_0x4b80a0){_0x1ed0b4[_0x692c('0x1b')]=_0x4b80a0;if(_0x3b41bf['query']['includeAll']){_0xc3bd8b[_0x692c('0x3e')]=[{'all':!![]}];}return db['ChatTransferReport'][_0x692c('0x3f')](_0xc3bd8b);})[_0x692c('0x22')](function(_0x25ccd6){_0x1ed0b4[_0x692c('0x40')]=_0x25ccd6;return _0x1ed0b4;})[_0x692c('0x22')](respondWithFilteredResult(_0x16514b,_0xc3bd8b))[_0x692c('0x41')](handleError(_0x16514b,null));};exports[_0x692c('0x42')]=function(_0x481d63,_0x138aa3){var _0x4b7f33={'raw':!![],'where':{'id':_0x481d63[_0x692c('0x43')]['id']}},_0x4c65ab={};_0x4c65ab[_0x692c('0x2e')]=_[_0x692c('0x31')](db[_0x692c('0x29')][_0x692c('0x2a')]);_0x4c65ab[_0x692c('0x30')]=_['keys'](_0x481d63['query']);_0x4c65ab[_0x692c('0x3b')]=_[_0x692c('0x32')](_0x4c65ab[_0x692c('0x2e')],_0x4c65ab['query']);_0x4b7f33[_0x692c('0x33')]=_[_0x692c('0x32')](_0x4c65ab[_0x692c('0x2e')],qs[_0x692c('0x34')](_0x481d63[_0x692c('0x30')][_0x692c('0x34')]));_0x4b7f33[_0x692c('0x33')]=_0x4b7f33[_0x692c('0x33')][_0x692c('0x35')]?_0x4b7f33[_0x692c('0x33')]:_0x4c65ab['model'];if(_0x481d63[_0x692c('0x30')]['includeAll']){_0x4b7f33[_0x692c('0x3e')]=[{'all':!![]}];}_0x4b7f33=_['merge']({},_0x4b7f33,_0x481d63['options']);return db[_0x692c('0x29')][_0x692c('0x44')](_0x4b7f33)[_0x692c('0x22')](handleEntityNotFound(_0x138aa3,null))[_0x692c('0x22')](respondWithResult(_0x138aa3,null))['catch'](handleError(_0x138aa3,null));};exports[_0x692c('0x45')]=function(_0x393b83,_0x16e13e){return db[_0x692c('0x29')][_0x692c('0x45')](_0x393b83[_0x692c('0x46')],{})[_0x692c('0x22')](respondWithResult(_0x16e13e,0xc9))[_0x692c('0x41')](handleError(_0x16e13e,null));};exports[_0x692c('0x21')]=function(_0x24429e,_0x15c62d){if(_0x24429e[_0x692c('0x46')]['id']){delete _0x24429e[_0x692c('0x46')]['id'];}return db['ChatTransferReport'][_0x692c('0x44')]({'where':{'id':_0x24429e['params']['id']}})[_0x692c('0x22')](handleEntityNotFound(_0x15c62d,null))[_0x692c('0x22')](saveUpdates(_0x24429e['body'],null))[_0x692c('0x22')](respondWithResult(_0x15c62d,null))[_0x692c('0x41')](handleError(_0x15c62d,null));};exports[_0x692c('0x23')]=function(_0x3f027d,_0x4ec097){return db[_0x692c('0x29')][_0x692c('0x44')]({'where':{'id':_0x3f027d[_0x692c('0x43')]['id']}})['then'](handleEntityNotFound(_0x4ec097,null))[_0x692c('0x22')](removeEntity(_0x4ec097,null))[_0x692c('0x41')](handleError(_0x4ec097,null));};exports[_0x692c('0x47')]=function(_0x1e060a,_0x2692b9){return db[_0x692c('0x29')][_0x692c('0x47')]()[_0x692c('0x22')](respondWithResult(_0x2692b9,null))[_0x692c('0x41')](handleError(_0x2692b9,null));}; \ No newline at end of file +var _0xd373=['include','findAll','rows','catch','length','find','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','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','../../mysqldb','status','offset','undefined','count','limit','Content-Range','json','apply','save','update','destroy','then','end','sendStatus','error','stack','name','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll'];(function(_0x289842,_0x2d9db4){var _0x16155a=function(_0x1d0510){while(--_0x1d0510){_0x289842['push'](_0x289842['shift']());}};_0x16155a(++_0x2d9db4);}(_0xd373,0xa3));var _0x3d37=function(_0x4b3cbd,_0x220167){_0x4b3cbd=_0x4b3cbd-0x0;var _0x1cc15a=_0xd373[_0x4b3cbd];return _0x1cc15a;};'use strict';var emlformat=require(_0x3d37('0x0'));var rimraf=require(_0x3d37('0x1'));var zipdir=require(_0x3d37('0x2'));var jsonpatch=require(_0x3d37('0x3'));var rp=require(_0x3d37('0x4'));var moment=require(_0x3d37('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3d37('0x6'));var util=require(_0x3d37('0x7'));var path=require(_0x3d37('0x8'));var sox=require('sox');var csv=require(_0x3d37('0x9'));var ejs=require(_0x3d37('0xa'));var fs=require('fs');var fs_extra=require(_0x3d37('0xb'));var _=require(_0x3d37('0xc'));var squel=require(_0x3d37('0xd'));var crypto=require(_0x3d37('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x3d37('0xf'));var toCsv=require(_0x3d37('0x9'));var querystring=require(_0x3d37('0x10'));var Papa=require(_0x3d37('0x11'));var Redis=require(_0x3d37('0x12'));var authService=require(_0x3d37('0x13'));var qs=require(_0x3d37('0x14'));var as=require(_0x3d37('0x15'));var hardwareService=require(_0x3d37('0x16'));var logger=require(_0x3d37('0x17'))(_0x3d37('0x18'));var utils=require(_0x3d37('0x19'));var config=require(_0x3d37('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x3d37('0x1b'))['db'];function respondWithStatusCode(_0x4e211b,_0xad01fc){_0xad01fc=_0xad01fc||0xcc;return function(_0x3e143f){if(_0x3e143f){return _0x4e211b['sendStatus'](_0xad01fc);}return _0x4e211b[_0x3d37('0x1c')](_0xad01fc)['end']();};}function respondWithResult(_0x2ec90f,_0x59731e){_0x59731e=_0x59731e||0xc8;return function(_0x5bbf2b){if(_0x5bbf2b){return _0x2ec90f['status'](_0x59731e)['json'](_0x5bbf2b);}};}function respondWithFilteredResult(_0x2195bc,_0x480963){return function(_0x218a34){if(_0x218a34){var _0x1002eb=typeof _0x480963[_0x3d37('0x1d')]===_0x3d37('0x1e')&&typeof _0x480963['limit']===_0x3d37('0x1e');var _0x6d2c3e=_0x218a34[_0x3d37('0x1f')];var _0x95a1fc=_0x1002eb?0x0:_0x480963[_0x3d37('0x1d')];var _0xc04f1a=_0x1002eb?_0x218a34['count']:_0x480963['offset']+_0x480963[_0x3d37('0x20')];var _0x38c2fb;if(_0xc04f1a>=_0x6d2c3e){_0xc04f1a=_0x6d2c3e;_0x38c2fb=0xc8;}else{_0x38c2fb=0xce;}_0x2195bc[_0x3d37('0x1c')](_0x38c2fb);return _0x2195bc['set'](_0x3d37('0x21'),_0x95a1fc+'-'+_0xc04f1a+'/'+_0x6d2c3e)[_0x3d37('0x22')](_0x218a34);}return null;};}function patchUpdates(_0x55627a){return function(_0x3bf701){try{jsonpatch[_0x3d37('0x23')](_0x3bf701,_0x55627a,!![]);}catch(_0x1f2174){return BPromise['reject'](_0x1f2174);}return _0x3bf701[_0x3d37('0x24')]();};}function saveUpdates(_0x320c78,_0x565fee){return function(_0x5607dc){if(_0x5607dc){return _0x5607dc[_0x3d37('0x25')](_0x320c78)['then'](function(_0x1dfea6){return _0x1dfea6;});}return null;};}function removeEntity(_0x5b5809,_0x1695ff){return function(_0x583a2d){if(_0x583a2d){return _0x583a2d[_0x3d37('0x26')]()[_0x3d37('0x27')](function(){_0x5b5809[_0x3d37('0x1c')](0xcc)[_0x3d37('0x28')]();});}};}function handleEntityNotFound(_0x4c4736,_0x56c602){return function(_0x4486a9){if(!_0x4486a9){_0x4c4736[_0x3d37('0x29')](0x194);}return _0x4486a9;};}function handleError(_0x27a6a9,_0x189b45){_0x189b45=_0x189b45||0x1f4;return function(_0x547f7f){logger[_0x3d37('0x2a')](_0x547f7f[_0x3d37('0x2b')]);if(_0x547f7f[_0x3d37('0x2c')]){delete _0x547f7f[_0x3d37('0x2c')];}_0x27a6a9[_0x3d37('0x1c')](_0x189b45)['send'](_0x547f7f);};}exports[_0x3d37('0x2d')]=function(_0x542d69,_0xb0edc9){var _0x4b39bd={},_0x22756b={},_0x2599c8={'count':0x0,'rows':[]};var _0x433b4d=_[_0x3d37('0x2e')](db[_0x3d37('0x2f')][_0x3d37('0x30')],function(_0x50abb1){return{'name':_0x50abb1[_0x3d37('0x31')],'type':_0x50abb1[_0x3d37('0x32')][_0x3d37('0x33')]};});_0x22756b[_0x3d37('0x34')]=_[_0x3d37('0x2e')](_0x433b4d,_0x3d37('0x2c'));_0x22756b['query']=_[_0x3d37('0x35')](_0x542d69[_0x3d37('0x36')]);_0x22756b[_0x3d37('0x37')]=_['intersection'](_0x22756b['model'],_0x22756b[_0x3d37('0x36')]);_0x4b39bd[_0x3d37('0x38')]=_[_0x3d37('0x39')](_0x22756b[_0x3d37('0x34')],qs['fields'](_0x542d69['query'][_0x3d37('0x3a')]));_0x4b39bd[_0x3d37('0x38')]=_0x4b39bd['attributes']['length']?_0x4b39bd['attributes']:_0x22756b[_0x3d37('0x34')];if(!_0x542d69[_0x3d37('0x36')][_0x3d37('0x3b')]('nolimit')){_0x4b39bd['limit']=qs[_0x3d37('0x20')](_0x542d69['query'][_0x3d37('0x20')]);_0x4b39bd[_0x3d37('0x1d')]=qs[_0x3d37('0x1d')](_0x542d69[_0x3d37('0x36')][_0x3d37('0x1d')]);}_0x4b39bd[_0x3d37('0x3c')]=qs[_0x3d37('0x3d')](_0x542d69[_0x3d37('0x36')][_0x3d37('0x3d')]);_0x4b39bd[_0x3d37('0x3e')]=qs['filters'](_['pick'](_0x542d69[_0x3d37('0x36')],_0x22756b['filters']),_0x433b4d);if(_0x542d69['query'][_0x3d37('0x3f')]){_0x4b39bd['where']=_[_0x3d37('0x40')](_0x4b39bd[_0x3d37('0x3e')],{'$or':_[_0x3d37('0x2e')](_0x433b4d,function(_0x5f22f6){if(_0x5f22f6[_0x3d37('0x32')]!==_0x3d37('0x41')){var _0x2c4c1c={};_0x2c4c1c[_0x5f22f6[_0x3d37('0x2c')]]={'$like':'%'+_0x542d69[_0x3d37('0x36')][_0x3d37('0x3f')]+'%'};return _0x2c4c1c;}})});}_0x4b39bd=_[_0x3d37('0x40')]({},_0x4b39bd,_0x542d69[_0x3d37('0x42')]);var _0x35cf74={'where':_0x4b39bd['where']};return db[_0x3d37('0x2f')][_0x3d37('0x1f')](_0x35cf74)['then'](function(_0x2daac4){_0x2599c8[_0x3d37('0x1f')]=_0x2daac4;if(_0x542d69['query'][_0x3d37('0x43')]){_0x4b39bd[_0x3d37('0x44')]=[{'all':!![]}];}return db['ChatTransferReport'][_0x3d37('0x45')](_0x4b39bd);})[_0x3d37('0x27')](function(_0x57f1c8){_0x2599c8[_0x3d37('0x46')]=_0x57f1c8;return _0x2599c8;})['then'](respondWithFilteredResult(_0xb0edc9,_0x4b39bd))[_0x3d37('0x47')](handleError(_0xb0edc9,null));};exports['show']=function(_0x1fd07e,_0x48dfe8){var _0x2bf81a={'raw':!![],'where':{'id':_0x1fd07e['params']['id']}},_0x476185={};_0x476185[_0x3d37('0x34')]=_[_0x3d37('0x35')](db[_0x3d37('0x2f')][_0x3d37('0x30')]);_0x476185['query']=_[_0x3d37('0x35')](_0x1fd07e[_0x3d37('0x36')]);_0x476185[_0x3d37('0x37')]=_[_0x3d37('0x39')](_0x476185['model'],_0x476185['query']);_0x2bf81a['attributes']=_[_0x3d37('0x39')](_0x476185[_0x3d37('0x34')],qs[_0x3d37('0x3a')](_0x1fd07e['query'][_0x3d37('0x3a')]));_0x2bf81a[_0x3d37('0x38')]=_0x2bf81a[_0x3d37('0x38')][_0x3d37('0x48')]?_0x2bf81a[_0x3d37('0x38')]:_0x476185[_0x3d37('0x34')];if(_0x1fd07e[_0x3d37('0x36')][_0x3d37('0x43')]){_0x2bf81a[_0x3d37('0x44')]=[{'all':!![]}];}_0x2bf81a=_[_0x3d37('0x40')]({},_0x2bf81a,_0x1fd07e['options']);return db[_0x3d37('0x2f')][_0x3d37('0x49')](_0x2bf81a)[_0x3d37('0x27')](handleEntityNotFound(_0x48dfe8,null))['then'](respondWithResult(_0x48dfe8,null))[_0x3d37('0x47')](handleError(_0x48dfe8,null));};exports['create']=function(_0x15f138,_0x416bd1){return db[_0x3d37('0x2f')]['create'](_0x15f138[_0x3d37('0x4a')],{})[_0x3d37('0x27')](respondWithResult(_0x416bd1,0xc9))[_0x3d37('0x47')](handleError(_0x416bd1,null));};exports[_0x3d37('0x25')]=function(_0x46f98b,_0x19d533){if(_0x46f98b['body']['id']){delete _0x46f98b['body']['id'];}return db[_0x3d37('0x2f')][_0x3d37('0x49')]({'where':{'id':_0x46f98b[_0x3d37('0x4b')]['id']}})[_0x3d37('0x27')](handleEntityNotFound(_0x19d533,null))[_0x3d37('0x27')](saveUpdates(_0x46f98b['body'],null))[_0x3d37('0x27')](respondWithResult(_0x19d533,null))[_0x3d37('0x47')](handleError(_0x19d533,null));};exports[_0x3d37('0x26')]=function(_0xfafe57,_0x33475f){return db[_0x3d37('0x2f')][_0x3d37('0x49')]({'where':{'id':_0xfafe57[_0x3d37('0x4b')]['id']}})[_0x3d37('0x27')](handleEntityNotFound(_0x33475f,null))[_0x3d37('0x27')](removeEntity(_0x33475f,null))[_0x3d37('0x47')](handleError(_0x33475f,null));};exports[_0x3d37('0x4c')]=function(_0x4b6101,_0xb4726a){return db[_0x3d37('0x2f')][_0x3d37('0x4c')]()[_0x3d37('0x27')](respondWithResult(_0xb4726a,null))['catch'](handleError(_0xb4726a,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 120d578..fe651e2 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 _0x91e8=['api','../../config/environment','exports','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0x12877b,_0x8650cf){var _0x3549ff=function(_0x4f96b7){while(--_0x4f96b7){_0x12877b['push'](_0x12877b['shift']());}};_0x3549ff(++_0x8650cf);}(_0x91e8,0xf9));var _0x891e=function(_0xc9a48e,_0x4d3e72){_0xc9a48e=_0xc9a48e-0x0;var _0x419127=_0x91e8[_0xc9a48e];return _0x419127;};'use strict';var _=require(_0x891e('0x0'));var util=require(_0x891e('0x1'));var logger=require(_0x891e('0x2'))(_0x891e('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(_0x891e('0x4'));var attributes=require('./chatTransferReport.attributes');module[_0x891e('0x5')]=function(_0x39daad,_0x13864c){return _0x39daad['define'](_0x891e('0x6'),attributes,{'tableName':_0x891e('0x7'),'paranoid':![],'indexes':[{'name':_0x891e('0x8'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x3f2d=['rimraf','../../config/environment','./chatTransferReport.attributes','exports','ChatTransferReport','report_chat_transfer','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x15716a,_0x3e6958){var _0x548da0=function(_0xc42439){while(--_0xc42439){_0x15716a['push'](_0x15716a['shift']());}};_0x548da0(++_0x3e6958);}(_0x3f2d,0xca));var _0xd3f2=function(_0xd1ca62,_0x79a6a0){_0xd1ca62=_0xd1ca62-0x0;var _0x480b25=_0x3f2d[_0xd1ca62];return _0x480b25;};'use strict';var _=require('lodash');var util=require(_0xd3f2('0x0'));var logger=require(_0xd3f2('0x1'))(_0xd3f2('0x2'));var moment=require(_0xd3f2('0x3'));var BPromise=require(_0xd3f2('0x4'));var rp=require(_0xd3f2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd3f2('0x6'));var config=require(_0xd3f2('0x7'));var attributes=require(_0xd3f2('0x8'));module[_0xd3f2('0x9')]=function(_0x276e85,_0x45b3cf){return _0x276e85['define'](_0xd3f2('0xa'),attributes,{'tableName':_0xd3f2('0xb'),'paranoid':![],'indexes':[{'name':_0xd3f2('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index c778108..f7c1ddd 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 _0x5244=['request','then','info','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x340c0d,_0x23e406){var _0x3a62fa=function(_0x22c0c2){while(--_0x22c0c2){_0x340c0d['push'](_0x340c0d['shift']());}};_0x3a62fa(++_0x23e406);}(_0x5244,0x182));var _0x4524=function(_0x5c7fc4,_0x525f28){_0x5c7fc4=_0x5c7fc4-0x0;var _0x1afcb9=_0x5244[_0x5c7fc4];return _0x1afcb9;};'use strict';var _=require(_0x4524('0x0'));var util=require(_0x4524('0x1'));var moment=require(_0x4524('0x2'));var BPromise=require(_0x4524('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4524('0x4'))['db'];var utils=require(_0x4524('0x5'));var logger=require(_0x4524('0x6'))(_0x4524('0x7'));var config=require(_0x4524('0x8'));var jayson=require(_0x4524('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x590e0c,_0x2a2e86,_0x58b71b){return new BPromise(function(_0x10aa75,_0x3f59b4){return client[_0x4524('0xa')](_0x590e0c,_0x58b71b)[_0x4524('0xb')](function(_0x5f3e71){logger[_0x4524('0xc')](_0x4524('0xd'),_0x2a2e86,'request\x20sent');logger[_0x4524('0xe')](_0x4524('0xf'),_0x2a2e86,_0x4524('0x10'),JSON[_0x4524('0x11')](_0x5f3e71));if(_0x5f3e71[_0x4524('0x12')]){if(_0x5f3e71[_0x4524('0x12')][_0x4524('0x13')]===0x1f4){logger[_0x4524('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x2a2e86,_0x5f3e71[_0x4524('0x12')][_0x4524('0x14')]);return _0x3f59b4(_0x5f3e71['error'][_0x4524('0x14')]);}logger[_0x4524('0x12')](_0x4524('0xd'),_0x2a2e86,_0x5f3e71['error'][_0x4524('0x14')]);return _0x10aa75(_0x5f3e71[_0x4524('0x12')][_0x4524('0x14')]);}else{logger[_0x4524('0xc')](_0x4524('0xd'),_0x2a2e86,_0x4524('0x10'));_0x10aa75(_0x5f3e71['result'][_0x4524('0x14')]);}})[_0x4524('0x15')](function(_0x23e38f){logger[_0x4524('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x2a2e86,_0x23e38f);_0x3f59b4(_0x23e38f);});});} \ No newline at end of file +var _0x87cb=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch'];(function(_0x2b99e0,_0x32189c){var _0x26829c=function(_0x2c127c){while(--_0x2c127c){_0x2b99e0['push'](_0x2b99e0['shift']());}};_0x26829c(++_0x32189c);}(_0x87cb,0xfd));var _0xb87c=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x87cb[_0x40220a];return _0x3903cc;};'use strict';var _=require(_0xb87c('0x0'));var util=require(_0xb87c('0x1'));var moment=require('moment');var BPromise=require(_0xb87c('0x2'));var rs=require(_0xb87c('0x3'));var fs=require('fs');var Redis=require(_0xb87c('0x4'));var db=require(_0xb87c('0x5'))['db'];var utils=require(_0xb87c('0x6'));var logger=require(_0xb87c('0x7'))(_0xb87c('0x8'));var config=require(_0xb87c('0x9'));var jayson=require(_0xb87c('0xa'));var client=jayson[_0xb87c('0xb')][_0xb87c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3c6da8,_0x4a42b7,_0x3d3b5b){return new BPromise(function(_0x23286e,_0x7eef7b){return client[_0xb87c('0xd')](_0x3c6da8,_0x3d3b5b)[_0xb87c('0xe')](function(_0x3121d4){logger[_0xb87c('0xf')](_0xb87c('0x10'),_0x4a42b7,_0xb87c('0x11'));logger['debug'](_0xb87c('0x12'),_0x4a42b7,_0xb87c('0x11'),JSON[_0xb87c('0x13')](_0x3121d4));if(_0x3121d4[_0xb87c('0x14')]){if(_0x3121d4[_0xb87c('0x14')]['code']===0x1f4){logger[_0xb87c('0x14')]('ChatTransferReport,\x20%s,\x20%s',_0x4a42b7,_0x3121d4[_0xb87c('0x14')][_0xb87c('0x15')]);return _0x7eef7b(_0x3121d4[_0xb87c('0x14')][_0xb87c('0x15')]);}logger['error'](_0xb87c('0x10'),_0x4a42b7,_0x3121d4[_0xb87c('0x14')]['message']);return _0x23286e(_0x3121d4['error'][_0xb87c('0x15')]);}else{logger['info'](_0xb87c('0x10'),_0x4a42b7,_0xb87c('0x11'));_0x23286e(_0x3121d4['result'][_0xb87c('0x15')]);}})[_0xb87c('0x16')](function(_0x27bf96){logger[_0xb87c('0x14')](_0xb87c('0x10'),_0x4a42b7,_0x27bf96);_0x7eef7b(_0x27bf96);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index c72201f..6e069d8 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 _0x52db=['../../components/auth/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','create','update','delete','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x3a83db,_0x4ca379){var _0x53ac2c=function(_0x587470){while(--_0x587470){_0x3a83db['push'](_0x3a83db['shift']());}};_0x53ac2c(++_0x4ca379);}(_0x52db,0x13e));var _0xb52d=function(_0xbc9765,_0x11b5c6){_0xbc9765=_0xbc9765-0x0;var _0x2bb565=_0x52db[_0xbc9765];return _0x2bb565;};'use strict';var multer=require(_0xb52d('0x0'));var util=require(_0xb52d('0x1'));var path=require('path');var timeout=require(_0xb52d('0x2'));var express=require(_0xb52d('0x3'));var router=express[_0xb52d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb52d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb52d('0x6'));var controller=require(_0xb52d('0x7'));router[_0xb52d('0x8')]('/',auth[_0xb52d('0x9')](),controller['index']);router[_0xb52d('0x8')](_0xb52d('0xa'),auth[_0xb52d('0x9')](),controller[_0xb52d('0xb')]);router[_0xb52d('0x8')](_0xb52d('0xc'),auth['isAuthenticated'](),controller[_0xb52d('0xd')]);router['post']('/',auth[_0xb52d('0x9')](),controller[_0xb52d('0xe')]);router['put'](_0xb52d('0xc'),auth['isAuthenticated'](),controller[_0xb52d('0xf')]);router[_0xb52d('0x10')](_0xb52d('0xc'),auth[_0xb52d('0x9')](),controller[_0xb52d('0x11')]);module[_0xb52d('0x12')]=router; \ No newline at end of file +var _0xc6da=['describe','/:id','show','post','put','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','isAuthenticated','index','get','/describe'];(function(_0x89e0f5,_0x5652e6){var _0x119e69=function(_0x438a08){while(--_0x438a08){_0x89e0f5['push'](_0x89e0f5['shift']());}};_0x119e69(++_0x5652e6);}(_0xc6da,0x9a));var _0xac6d=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xc6da[_0x29b609];return _0x54c952;};'use strict';var multer=require(_0xac6d('0x0'));var util=require(_0xac6d('0x1'));var path=require(_0xac6d('0x2'));var timeout=require(_0xac6d('0x3'));var express=require(_0xac6d('0x4'));var router=express['Router']();var fs_extra=require(_0xac6d('0x5'));var auth=require(_0xac6d('0x6'));var interaction=require(_0xac6d('0x7'));var config=require(_0xac6d('0x8'));var controller=require(_0xac6d('0x9'));router['get']('/',auth[_0xac6d('0xa')](),controller[_0xac6d('0xb')]);router[_0xac6d('0xc')](_0xac6d('0xd'),auth['isAuthenticated'](),controller[_0xac6d('0xe')]);router[_0xac6d('0xc')](_0xac6d('0xf'),auth['isAuthenticated'](),controller[_0xac6d('0x10')]);router[_0xac6d('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0xac6d('0x12')](_0xac6d('0xf'),auth[_0xac6d('0xa')](),controller['update']);router['delete'](_0xac6d('0xf'),auth[_0xac6d('0xa')](),controller[_0xac6d('0x13')]);module[_0xac6d('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 56929c0..16e24cc 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 _0x1373=['Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Send','Feedback','star','thumb','stringify','input','name','getDataValue','onlineForm','setDataValue','Comments','Leave\x20your\x20comments','offlineForm','parse','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.','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','exports','STRING','address','email','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat'];(function(_0x4cbf20,_0x1bfa66){var _0x582ae4=function(_0x5eca38){while(--_0x5eca38){_0x4cbf20['push'](_0x4cbf20['shift']());}};_0x582ae4(++_0x1bfa66);}(_0x1373,0xe2));var _0x3137=function(_0x1b5c1e,_0x5da98b){_0x1b5c1e=_0x1b5c1e-0x0;var _0x5bba27=_0x1373[_0x1b5c1e];return _0x5bba27;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x3137('0x0'));module[_0x3137('0x1')]={'name':{'type':Sequelize[_0x3137('0x2')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x3137('0x3')},'description':{'type':Sequelize[_0x3137('0x2')]},'mapKey':{'type':Sequelize[_0x3137('0x2')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x3137('0x4')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x3137('0x2')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x3137('0x2')],'allowNull':![],'defaultValue':_0x3137('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x3137('0x2')],'allowNull':![],'defaultValue':_0x3137('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x3137('0x2')],'allowNull':![],'defaultValue':_0x3137('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x3137('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x3137('0x2')]},'animation':{'type':Sequelize[_0x3137('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x3137('0x9')](_0x3137('0xa'),_0x3137('0xb')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x3137('0x2')],'defaultValue':_0x3137('0xc')},'start_chat_button':{'type':Sequelize[_0x3137('0x2')],'defaultValue':_0x3137('0xd')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x3137('0x2')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0x3137('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x3137('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x3137('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0x3137('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x3137('0xf')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x3137('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0x3137('0x2')],'defaultValue':_0x3137('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0x3137('0x2')],'defaultValue':_0x3137('0x12')},'noteTitle':{'type':Sequelize[_0x3137('0x2')],'defaultValue':_0x3137('0x13')},'placeholderMessage':{'type':Sequelize[_0x3137('0x2')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x3137('0x2')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x3137('0x2')],'defaultValue':_0x3137('0x14')},'skipMessageButton':{'type':Sequelize[_0x3137('0x2')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x3137('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x3137('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x3137('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x3137('0x2')],'defaultValue':_0x3137('0x15')},'ratingType':{'type':Sequelize[_0x3137('0x9')](_0x3137('0x16'),_0x3137('0x17')),'defaultValue':_0x3137('0x16')},'ratingStarsNumber':{'type':Sequelize[_0x3137('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x3137('0x18')]({'items':[{'type':_0x3137('0x19'),'variable':null,'config':{'placeholder':_0x3137('0x1a'),'type':'text','required':!![]},'props':{'title':_0x3137('0x1a'),'helpText':''}},{'type':'input','props':{'title':_0x3137('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x3137('0x4'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x3137('0x1b')](_0x3137('0x1c'))?JSON['parse'](this['getDataValue'](_0x3137('0x1c'))):{};},'set':function(_0x2ffa54){return this[_0x3137('0x1d')](_0x3137('0x1c'),JSON[_0x3137('0x18')](_0x2ffa54));}},'offlineForm':{'type':Sequelize[_0x3137('0xf')],'defaultValue':function(){return JSON[_0x3137('0x18')]({'items':[{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x3137('0x4'),'type':'email'},'variable':null},{'type':'textarea','config':{'placeholder':_0x3137('0x1e')},'props':{'title':'Comments','helpText':_0x3137('0x1f')}}],'fromKey':0x0});},'get':function(){return this[_0x3137('0x1b')](_0x3137('0x20'))?JSON[_0x3137('0x21')](this[_0x3137('0x1b')](_0x3137('0x20'))):{};},'set':function(_0x53f007){return this[_0x3137('0x1d')]('offlineForm',JSON['stringify'](_0x53f007));}},'token':{'type':Sequelize[_0x3137('0x2')],'defaultValue':function(){return rs[_0x3137('0x22')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x3137('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x3137('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x3137('0x2')]},'forwardOffline':{'type':Sequelize[_0x3137('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x3137('0x2')]},'waitingTitle':{'type':Sequelize[_0x3137('0x2')],'defaultValue':_0x3137('0x23')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x3137('0x24')},'offlineMessageSubject':{'type':Sequelize[_0x3137('0x2')],'defaultValue':_0x3137('0x25')},'offlineMessageBody':{'type':Sequelize[_0x3137('0x2')],'defaultValue':_0x3137('0x26')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x3137('0x2')],'defaultValue':_0x3137('0x27')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x3137('0x28')},'sendUnmanaged':{'type':Sequelize[_0x3137('0x2')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x3137('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x3137('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x3137('0xf')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x3137('0x2')]},'notificationTemplate':{'type':Sequelize[_0x3137('0xf')],'defaultValue':function(){return _0x3137('0x29');}},'notificationSound':{'type':Sequelize[_0x3137('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x3137('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x3137('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0x3137('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x3137('0x2')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x3137('0x7')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x3137('0x2')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x3137('0x2')]},'customerAvatar':{'type':Sequelize[_0x3137('0xf')]},'showCustomerAvatar':{'type':Sequelize[_0x3137('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x3137('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x3137('0x2')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x3137('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x3137('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x3137('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x3137('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x3137('0x2')],'defaultValue':_0x3137('0x2a')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3137('0x7')],'comment':_0x3137('0x2b')},'mandatoryDisposition':{'type':Sequelize[_0x3137('0x8')],'defaultValue':![],'comment':_0x3137('0x2c'),'set':function(_0x289a79){if(!_0x289a79)this[_0x3137('0x1d')](_0x3137('0x2d'),null);this[_0x3137('0x1d')](_0x3137('0x2e'),_0x289a79);}},'vidaooEscalation':{'type':Sequelize[_0x3137('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x3137('0x2')]},'vidaooTopic':{'type':Sequelize[_0x3137('0x2')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0x3137('0x2')],'defaultValue':function(){return _0x3137('0x2f');}},'vidaooMetadata':{'type':Sequelize[_0x3137('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x3137('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x15f5=['Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','stringify','input','name','text','getDataValue','onlineForm','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','parse','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:','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion'];(function(_0x421cf8,_0x23152c){var _0x145c48=function(_0x565862){while(--_0x565862){_0x421cf8['push'](_0x421cf8['shift']());}};_0x145c48(++_0x23152c);}(_0x15f5,0x17b));var _0x515f=function(_0x36b087,_0x4cabbf){_0x36b087=_0x36b087-0x0;var _0x4c033c=_0x15f5[_0x36b087];return _0x4c033c;};'use strict';var Sequelize=require(_0x515f('0x0'));var rs=require(_0x515f('0x1'));module[_0x515f('0x2')]={'name':{'type':Sequelize[_0x515f('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x515f('0x3')],'allowNull':![],'unique':_0x515f('0x4')},'description':{'type':Sequelize[_0x515f('0x3')]},'mapKey':{'type':Sequelize[_0x515f('0x3')],'defaultValue':_0x515f('0x5')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x515f('0x5')},'key':{'type':Sequelize[_0x515f('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x515f('0x3')],'defaultValue':_0x515f('0x6')},'customerAlias':{'type':Sequelize[_0x515f('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x515f('0x3')],'allowNull':![],'defaultValue':_0x515f('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x515f('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x515f('0x3')],'allowNull':![],'defaultValue':_0x515f('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x515f('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x515f('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x515f('0xb')](_0x515f('0xc'),_0x515f('0xd')),'defaultValue':_0x515f('0xc')},'header_online':{'type':Sequelize[_0x515f('0x3')],'defaultValue':_0x515f('0xe')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x515f('0xf')},'offline_chat_button':{'type':Sequelize[_0x515f('0x3')],'defaultValue':_0x515f('0x10')},'header_offline':{'type':Sequelize[_0x515f('0x3')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0x515f('0xa')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x515f('0x9')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x515f('0x3')],'defaultValue':_0x515f('0x11')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x515f('0x12')]},'closingQuestion':{'type':Sequelize[_0x515f('0x3')],'defaultValue':_0x515f('0x13')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x515f('0x14')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x515f('0x15')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0x515f('0x16')},'placeholderMessage':{'type':Sequelize[_0x515f('0x3')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x515f('0x3')],'defaultValue':_0x515f('0x17')},'closingMessageButton':{'type':Sequelize[_0x515f('0x3')],'defaultValue':_0x515f('0x10')},'skipMessageButton':{'type':Sequelize[_0x515f('0x3')],'defaultValue':_0x515f('0x18')},'conditionAgreement':{'type':Sequelize[_0x515f('0xa')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x515f('0xa')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x515f('0xa')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x515f('0x3')],'defaultValue':_0x515f('0x19')},'ratingType':{'type':Sequelize['ENUM'](_0x515f('0x1a'),_0x515f('0x1b')),'defaultValue':_0x515f('0x1a')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x515f('0x12')],'defaultValue':function(){return JSON[_0x515f('0x1c')]({'items':[{'type':_0x515f('0x1d'),'variable':null,'config':{'placeholder':_0x515f('0x1e'),'type':_0x515f('0x1f'),'required':!![]},'props':{'title':_0x515f('0x1e'),'helpText':''}},{'type':_0x515f('0x1d'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x515f('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x515f('0x20')]('onlineForm')?JSON['parse'](this['getDataValue'](_0x515f('0x21'))):{};},'set':function(_0x232b08){return this[_0x515f('0x22')](_0x515f('0x21'),JSON[_0x515f('0x1c')](_0x232b08));}},'offlineForm':{'type':Sequelize[_0x515f('0x12')],'defaultValue':function(){return JSON[_0x515f('0x1c')]({'items':[{'type':_0x515f('0x1d'),'props':{'title':_0x515f('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x515f('0x5'),'type':'email'},'variable':null},{'type':_0x515f('0x23'),'config':{'placeholder':_0x515f('0x24')},'props':{'title':'Comments','helpText':_0x515f('0x25')}}],'fromKey':0x0});},'get':function(){return this[_0x515f('0x20')](_0x515f('0x26'))?JSON[_0x515f('0x27')](this[_0x515f('0x20')](_0x515f('0x26'))):{};},'set':function(_0x217920){return this['setDataValue'](_0x515f('0x26'),JSON[_0x515f('0x1c')](_0x217920));}},'token':{'type':Sequelize[_0x515f('0x3')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x515f('0xa')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x515f('0xa')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x515f('0xa')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x515f('0x3')]},'forwardOffline':{'type':Sequelize[_0x515f('0xa')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x515f('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x515f('0x28')},'waitingMessage':{'type':Sequelize[_0x515f('0x3')],'defaultValue':_0x515f('0x29')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x515f('0x2a')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x515f('0x2b')},'enableUnmanagedNote':{'type':Sequelize[_0x515f('0xa')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x515f('0x3')],'defaultValue':_0x515f('0x18')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x515f('0xa')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x515f('0xa')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x515f('0x12')]},'showAgentAvatar':{'type':Sequelize[_0x515f('0xa')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x515f('0x3')]},'notificationTemplate':{'type':Sequelize[_0x515f('0x12')],'defaultValue':function(){return _0x515f('0x2c');}},'notificationSound':{'type':Sequelize[_0x515f('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x515f('0xa')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x515f('0xa')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x515f('0x3')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0x515f('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x515f('0x2d')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x515f('0x3')],'defaultValue':_0x515f('0x2e')},'defaultTitle':{'type':Sequelize[_0x515f('0x3')]},'customerAvatar':{'type':Sequelize[_0x515f('0x12')]},'showCustomerAvatar':{'type':Sequelize[_0x515f('0xa')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x515f('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x515f('0x3')],'allowNull':![],'defaultValue':_0x515f('0x2f'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x515f('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x515f('0x3')],'defaultValue':_0x515f('0x30')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x515f('0x31')},'mandatoryDisposition':{'type':Sequelize[_0x515f('0xa')],'defaultValue':![],'comment':_0x515f('0x32'),'set':function(_0x2a8e76){if(!_0x2a8e76)this[_0x515f('0x22')](_0x515f('0x33'),null);this[_0x515f('0x22')]('mandatoryDisposition',_0x2a8e76);}},'vidaooEscalation':{'type':Sequelize[_0x515f('0xa')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x515f('0x3')]},'vidaooTopic':{'type':Sequelize[_0x515f('0x3')],'allowNull':![],'defaultValue':_0x515f('0x34')},'vidaooNote':{'type':Sequelize[_0x515f('0x3')],'defaultValue':function(){return _0x515f('0x35');}},'vidaooMetadata':{'type':Sequelize[_0x515f('0x12')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x515f('0xa')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index a556b87..277dc77 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 _0x0903=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./chatWebsite.socket','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','end','json','offset','undefined','count','limit','status','apply','destroy','get','ChatWebsites','name','Pause','mandatoryDispositionPause','rawAttributes','fieldName','type','key','map','query','filters','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','show','params','ChatWebsite','keys','intersection','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','update','describe','addDisposition','ChatWebsiteId','getDispositions','findOne','hasOwnProperty','Disposition','findAll','rows','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addLogo','sitepic','file','filename','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','getLogo','join','root','getLicense','isNil','existsSync','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','notify','user-agent-parser','headers','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','ChatApplication','Applications','applications','list','List','orderBy','asc','account','defaults','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','x-real-port','referer','browser','format','%s\x20%s','version','unknown','vendor','%s\x20%s\x20%s','device','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','autoclose','push','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','forcedOwnership','Start','startRouting','EventManager','offline','files','send','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','render','toPairs','ChatOfflineMessage','originalname','basename','transaction','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','port','secure','authentication','auth','pass','SendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','mimetype','subjectOffline','toPairsIn','mapValues','lastName','NotifyMailAccount','notifyMail','server','attachments','remove','Could\x20not\x20remove\x20attachment\x20file','omit','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','virtual','custom','License','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.ejs','utf8','remote','x-real-ip','connection','replace','verticalAlignment','textColor','color_button','backgroundColor','addApplications','sequelize','findAndCountAll','priority','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','false','offlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api'];(function(_0x4ee3cf,_0x52d38c){var _0x4f8ef4=function(_0x3ca0b8){while(--_0x3ca0b8){_0x4ee3cf['push'](_0x4ee3cf['shift']());}};_0x4f8ef4(++_0x52d38c);}(_0x0903,0x124));var _0x3090=function(_0x46a38b,_0x16ffb5){_0x46a38b=_0x46a38b-0x0;var _0x346e75=_0x0903[_0x46a38b];return _0x346e75;};'use strict';var emlformat=require(_0x3090('0x0'));var rimraf=require(_0x3090('0x1'));var zipdir=require(_0x3090('0x2'));var jsonpatch=require(_0x3090('0x3'));var rp=require('request-promise');var moment=require(_0x3090('0x4'));var BPromise=require(_0x3090('0x5'));var Mustache=require(_0x3090('0x6'));var util=require(_0x3090('0x7'));var path=require(_0x3090('0x8'));var sox=require('sox');var csv=require(_0x3090('0x9'));var ejs=require(_0x3090('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3090('0xb'));var squel=require(_0x3090('0xc'));var crypto=require(_0x3090('0xd'));var jsforce=require(_0x3090('0xe'));var deskjs=require(_0x3090('0xf'));var toCsv=require(_0x3090('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3090('0x10'));var authService=require(_0x3090('0x11'));var qs=require(_0x3090('0x12'));var as=require(_0x3090('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3090('0x14'));var utils=require(_0x3090('0x15'));var config=require(_0x3090('0x16'));var licenseUtil=require(_0x3090('0x17'));var db=require(_0x3090('0x18'))['db'];config[_0x3090('0x19')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3090('0x1a'))(new Redis(config[_0x3090('0x19')]));require(_0x3090('0x1b'))['register'](socket);var jayson=require(_0x3090('0x1c'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x3090('0x1d')][_0x3090('0x1e')]({'port':0x232a});var client9003=jayson[_0x3090('0x1d')][_0x3090('0x1e')]({'port':0x232b});var client9001=jayson['client'][_0x3090('0x1e')]({'port':0x2329});function respondWithRpcPromise(_0x582a6b,_0x22900a,_0xe29afc,_0x2d2ba1){return new BPromise(function(_0x5e2c89,_0x509268){var _0x2198db=_0x2d2ba1||client;return _0x2198db[_0x3090('0x1f')](_0x582a6b,_0xe29afc)[_0x3090('0x20')](function(_0x2541b6){logger[_0x3090('0x21')](_0x3090('0x22'),_0x22900a,_0x3090('0x23'));logger[_0x3090('0x24')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x22900a,_0x3090('0x23'),JSON[_0x3090('0x25')](_0x2541b6));if(_0x2541b6['error']){if(_0x2541b6[_0x3090('0x26')][_0x3090('0x27')]===0x1f4){logger[_0x3090('0x26')](_0x3090('0x22'),_0x22900a,_0x2541b6[_0x3090('0x26')][_0x3090('0x28')]);return _0x509268(_0x2541b6['error'][_0x3090('0x28')]);}logger[_0x3090('0x26')](_0x3090('0x22'),_0x22900a,_0x2541b6[_0x3090('0x26')][_0x3090('0x28')]);return _0x5e2c89(_0x2541b6[_0x3090('0x26')]['message']);}else{logger[_0x3090('0x21')]('ChatWebsite,\x20%s,\x20%s',_0x22900a,_0x3090('0x23'));_0x5e2c89(_0x2541b6[_0x3090('0x29')]['message']);}})[_0x3090('0x2a')](function(_0x4e8d34){logger[_0x3090('0x26')](_0x3090('0x22'),_0x22900a,_0x4e8d34);_0x509268(_0x4e8d34);});});}function respondWithStatusCode(_0x4e822b,_0x637f91){_0x637f91=_0x637f91||0xcc;return function(_0x129cc0){if(_0x129cc0){return _0x4e822b[_0x3090('0x2b')](_0x637f91);}return _0x4e822b['status'](_0x637f91)[_0x3090('0x2c')]();};}function respondWithResult(_0x2f8fcf,_0x5dfd0f){_0x5dfd0f=_0x5dfd0f||0xc8;return function(_0xaf57ba){if(_0xaf57ba){return _0x2f8fcf['status'](_0x5dfd0f)[_0x3090('0x2d')](_0xaf57ba);}};}function respondWithFilteredResult(_0x117e85,_0x381d45){return function(_0xadbf3a){if(_0xadbf3a){var _0x5a0952=typeof _0x381d45[_0x3090('0x2e')]===_0x3090('0x2f')&&typeof _0x381d45['limit']===_0x3090('0x2f');var _0x5bc264=_0xadbf3a[_0x3090('0x30')];var _0x276048=_0x5a0952?0x0:_0x381d45[_0x3090('0x2e')];var _0x1a5d08=_0x5a0952?_0xadbf3a[_0x3090('0x30')]:_0x381d45[_0x3090('0x2e')]+_0x381d45[_0x3090('0x31')];var _0x538d67;if(_0x1a5d08>=_0x5bc264){_0x1a5d08=_0x5bc264;_0x538d67=0xc8;}else{_0x538d67=0xce;}_0x117e85[_0x3090('0x32')](_0x538d67);return _0x117e85['set']('Content-Range',_0x276048+'-'+_0x1a5d08+'/'+_0x5bc264)[_0x3090('0x2d')](_0xadbf3a);}return null;};}function patchUpdates(_0x3065ed){return function(_0x27e2e2){try{jsonpatch[_0x3090('0x33')](_0x27e2e2,_0x3065ed,!![]);}catch(_0x322f7e){return BPromise['reject'](_0x322f7e);}return _0x27e2e2['save']();};}function saveUpdates(_0x4cd9cb,_0x258763){return function(_0xd948b5){if(_0xd948b5){return _0xd948b5['update'](_0x4cd9cb)['then'](function(_0x17a488){return _0x17a488;});}return null;};}function removeEntity(_0x3d0266,_0x1bb915){return function(_0xe08f3c){if(_0xe08f3c){return _0xe08f3c[_0x3090('0x34')]()['then'](function(){var _0xf73892=_0xe08f3c[_0x3090('0x35')]({'plain':!![]});var _0x48d8db=_0x3090('0x36');return db['UserProfileResource'][_0x3090('0x34')]({'where':{'type':_0x48d8db,'resourceId':_0xf73892['id']}})[_0x3090('0x20')](function(){return _0xe08f3c;});})['then'](function(){_0x3d0266[_0x3090('0x32')](0xcc)[_0x3090('0x2c')]();});}};}function handleEntityNotFound(_0x19ffaa,_0x22d641){return function(_0x3b60d7){if(!_0x3b60d7){_0x19ffaa[_0x3090('0x2b')](0x194);}return _0x3b60d7;};}function handleError(_0x28f77a,_0x5335da){_0x5335da=_0x5335da||0x1f4;return function(_0x26e3ad){logger[_0x3090('0x26')](_0x26e3ad['stack']);if(_0x26e3ad[_0x3090('0x37')]){delete _0x26e3ad[_0x3090('0x37')];}_0x28f77a[_0x3090('0x32')](_0x5335da)['send'](_0x26e3ad);};}exports['index']=function(_0x54a103,_0x177430){var _0x5c55d3={'include':[{'model':db[_0x3090('0x38')],'as':_0x3090('0x39')}]},_0x21d471={},_0x1fd779={'count':0x0,'rows':[]};var _0x23399a=_['map'](db['ChatWebsite'][_0x3090('0x3a')],function(_0xe81fb0){return{'name':_0xe81fb0[_0x3090('0x3b')],'type':_0xe81fb0[_0x3090('0x3c')][_0x3090('0x3d')]};});_0x21d471['model']=_[_0x3090('0x3e')](_0x23399a,_0x3090('0x37'));_0x21d471['query']=_['keys'](_0x54a103[_0x3090('0x3f')]);_0x21d471[_0x3090('0x40')]=_['intersection'](_0x21d471[_0x3090('0x41')],_0x21d471[_0x3090('0x3f')]);_0x5c55d3[_0x3090('0x42')]=_['intersection'](_0x21d471[_0x3090('0x41')],qs[_0x3090('0x43')](_0x54a103[_0x3090('0x3f')]['fields']));_0x5c55d3[_0x3090('0x42')]=_0x5c55d3['attributes'][_0x3090('0x44')]?_0x5c55d3['attributes']:_0x21d471[_0x3090('0x41')];if(!_0x54a103[_0x3090('0x3f')]['hasOwnProperty'](_0x3090('0x45'))){_0x5c55d3['limit']=qs[_0x3090('0x31')](_0x54a103[_0x3090('0x3f')]['limit']);_0x5c55d3[_0x3090('0x2e')]=qs['offset'](_0x54a103['query'][_0x3090('0x2e')]);}_0x5c55d3[_0x3090('0x46')]=qs[_0x3090('0x47')](_0x54a103[_0x3090('0x3f')][_0x3090('0x47')]);_0x5c55d3[_0x3090('0x48')]=qs[_0x3090('0x40')](_[_0x3090('0x49')](_0x54a103['query'],_0x21d471[_0x3090('0x40')]),_0x23399a);if(_0x54a103[_0x3090('0x3f')][_0x3090('0x4a')]){_0x5c55d3[_0x3090('0x48')]=_[_0x3090('0x4b')](_0x5c55d3[_0x3090('0x48')],{'$or':_['map'](_0x23399a,function(_0x2f319f){if(_0x2f319f[_0x3090('0x3c')]!==_0x3090('0x4c')){var _0x4eadfb={};_0x4eadfb[_0x2f319f['name']]={'$like':'%'+_0x54a103[_0x3090('0x3f')][_0x3090('0x4a')]+'%'};return _0x4eadfb;}})});}_0x5c55d3=_[_0x3090('0x4b')]({},_0x5c55d3,_0x54a103['options']);var _0x323ca0={'where':_0x5c55d3[_0x3090('0x48')]};return db['ChatWebsite'][_0x3090('0x30')](_0x323ca0)['then'](function(_0x5b9551){_0x1fd779['count']=_0x5b9551;if(_0x54a103[_0x3090('0x3f')][_0x3090('0x4d')]){_0x5c55d3[_0x3090('0x4e')]=[{'all':!![]}];}return db['ChatWebsite']['findAll'](_0x5c55d3);})[_0x3090('0x20')](function(_0x2f8e68){_0x1fd779['rows']=_0x2f8e68;return _0x1fd779;})['then'](respondWithFilteredResult(_0x177430,_0x5c55d3))[_0x3090('0x2a')](handleError(_0x177430,null));};exports[_0x3090('0x4f')]=function(_0x2c07e6,_0x40d3a3){var _0x4aeddf={'raw':![],'where':{'id':_0x2c07e6[_0x3090('0x50')]['id']},'include':[{'model':db[_0x3090('0x38')],'as':_0x3090('0x39')}]},_0x21a533={};_0x21a533[_0x3090('0x41')]=_['keys'](db[_0x3090('0x51')]['rawAttributes']);_0x21a533['query']=_[_0x3090('0x52')](_0x2c07e6[_0x3090('0x3f')]);_0x21a533[_0x3090('0x40')]=_[_0x3090('0x53')](_0x21a533[_0x3090('0x41')],_0x21a533[_0x3090('0x3f')]);_0x4aeddf[_0x3090('0x42')]=_['intersection'](_0x21a533['model'],qs['fields'](_0x2c07e6[_0x3090('0x3f')][_0x3090('0x43')]));_0x4aeddf['attributes']=_0x4aeddf['attributes']['length']?_0x4aeddf[_0x3090('0x42')]:_0x21a533['model'];if(_0x2c07e6[_0x3090('0x3f')][_0x3090('0x4d')]){_0x4aeddf[_0x3090('0x4e')]=[{'all':!![]}];}_0x4aeddf=_[_0x3090('0x4b')]({},_0x4aeddf,_0x2c07e6[_0x3090('0x54')]);return db[_0x3090('0x51')][_0x3090('0x55')](_0x4aeddf)[_0x3090('0x20')](handleEntityNotFound(_0x40d3a3,null))[_0x3090('0x20')](respondWithResult(_0x40d3a3,null))[_0x3090('0x2a')](handleError(_0x40d3a3,null));};exports['create']=function(_0x20fb8d,_0x1bbaac){return db['ChatWebsite'][_0x3090('0x56')](_0x20fb8d[_0x3090('0x57')],{})[_0x3090('0x20')](function(_0x1d4368){var _0x30187b=_0x20fb8d[_0x3090('0x58')]['get']({'plain':!![]});if(!_0x30187b)throw new Error(_0x3090('0x59'));if(_0x30187b[_0x3090('0x5a')]==='user'){var _0x144b3c=_0x1d4368[_0x3090('0x35')]({'plain':!![]});var _0x59818b=_0x3090('0x36');return db[_0x3090('0x5b')][_0x3090('0x55')]({'where':{'name':_0x59818b,'userProfileId':_0x30187b[_0x3090('0x5c')]},'raw':!![]})[_0x3090('0x20')](function(_0x30c602){if(_0x30c602&&_0x30c602[_0x3090('0x5d')]===0x0){return db[_0x3090('0x5e')][_0x3090('0x56')]({'name':_0x144b3c[_0x3090('0x37')],'resourceId':_0x144b3c['id'],'type':_0x30c602[_0x3090('0x37')],'sectionId':_0x30c602['id']},{})[_0x3090('0x20')](function(){return _0x1d4368;});}else{return _0x1d4368;}})['catch'](function(_0xa04939){logger[_0x3090('0x26')](_0x3090('0x5f'),_0xa04939);throw _0xa04939;});}return _0x1d4368;})[_0x3090('0x20')](respondWithResult(_0x1bbaac,0xc9))[_0x3090('0x2a')](handleError(_0x1bbaac,null));};exports[_0x3090('0x60')]=function(_0x5b9dc4,_0x59e0b5){if(_0x5b9dc4[_0x3090('0x57')]['id']){delete _0x5b9dc4['body']['id'];}return db[_0x3090('0x51')]['find']({'where':{'id':_0x5b9dc4[_0x3090('0x50')]['id']},'include':[{'model':db[_0x3090('0x38')],'as':_0x3090('0x39')}]})[_0x3090('0x20')](handleEntityNotFound(_0x59e0b5,null))[_0x3090('0x20')](saveUpdates(_0x5b9dc4[_0x3090('0x57')],null))[_0x3090('0x20')](respondWithResult(_0x59e0b5,null))[_0x3090('0x2a')](handleError(_0x59e0b5,null));};exports[_0x3090('0x34')]=function(_0x36e36d,_0x24d6f4){return db['ChatWebsite'][_0x3090('0x55')]({'where':{'id':_0x36e36d[_0x3090('0x50')]['id']}})[_0x3090('0x20')](handleEntityNotFound(_0x24d6f4,null))[_0x3090('0x20')](removeEntity(_0x24d6f4,null))[_0x3090('0x2a')](handleError(_0x24d6f4,null));};exports[_0x3090('0x61')]=function(_0x578b89,_0x30653a){return db[_0x3090('0x51')][_0x3090('0x61')]()[_0x3090('0x20')](respondWithResult(_0x30653a,null))[_0x3090('0x2a')](handleError(_0x30653a,null));};exports[_0x3090('0x62')]=function(_0x393567,_0x5c7340,_0x4d6209){if(_0x393567['body']['id']){delete _0x393567[_0x3090('0x57')]['id'];}return db[_0x3090('0x51')][_0x3090('0x55')]({'where':{'id':_0x393567[_0x3090('0x50')]['id']}})[_0x3090('0x20')](handleEntityNotFound(_0x5c7340,null))[_0x3090('0x20')](function(_0x4b7df5){if(_0x4b7df5){_0x393567[_0x3090('0x57')][_0x3090('0x63')]=_0x4b7df5['id'];return db['Disposition'][_0x3090('0x56')](_0x393567['body']);}})[_0x3090('0x20')](respondWithResult(_0x5c7340,null))[_0x3090('0x2a')](handleError(_0x5c7340,null));};exports[_0x3090('0x64')]=function(_0x14e616,_0x7dcb8b,_0x2f7308){var _0x5789dd={'raw':![],'where':{}};var _0x3a64b4={};var _0x14cd43={'count':0x0,'rows':[]};return db[_0x3090('0x51')][_0x3090('0x65')]({'where':{'id':_0x14e616[_0x3090('0x50')]['id']}})[_0x3090('0x20')](handleEntityNotFound(_0x7dcb8b,null))[_0x3090('0x20')](function(_0x5823a8){if(_0x5823a8){_0x3a64b4[_0x3090('0x41')]=_[_0x3090('0x52')](db['Disposition'][_0x3090('0x3a')]);_0x3a64b4[_0x3090('0x3f')]=_[_0x3090('0x52')](_0x14e616[_0x3090('0x3f')]);_0x3a64b4['filters']=_[_0x3090('0x53')](_0x3a64b4[_0x3090('0x41')],_0x3a64b4[_0x3090('0x3f')]);_0x5789dd['attributes']=_['intersection'](_0x3a64b4[_0x3090('0x41')],qs[_0x3090('0x43')](_0x14e616[_0x3090('0x3f')][_0x3090('0x43')]));_0x5789dd['attributes']=_0x5789dd[_0x3090('0x42')][_0x3090('0x44')]?_0x5789dd[_0x3090('0x42')]:_0x3a64b4[_0x3090('0x41')];if(!_0x14e616['query'][_0x3090('0x66')](_0x3090('0x45'))){_0x5789dd[_0x3090('0x31')]=qs[_0x3090('0x31')](_0x14e616[_0x3090('0x3f')][_0x3090('0x31')]);_0x5789dd[_0x3090('0x2e')]=qs['offset'](_0x14e616[_0x3090('0x3f')][_0x3090('0x2e')]);}_0x5789dd[_0x3090('0x46')]=qs[_0x3090('0x47')](_0x14e616[_0x3090('0x3f')][_0x3090('0x47')]);_0x5789dd[_0x3090('0x48')]=qs[_0x3090('0x40')](_[_0x3090('0x49')](_0x14e616[_0x3090('0x3f')],_0x3a64b4[_0x3090('0x40')]));_0x5789dd[_0x3090('0x48')][_0x3090('0x63')]=_0x5823a8['id'];if(_0x14e616['query'][_0x3090('0x4a')]){_0x5789dd['where']=_['merge'](_0x5789dd[_0x3090('0x48')],{'$or':_[_0x3090('0x3e')](_0x5789dd[_0x3090('0x42')],function(_0x3b403c){var _0x5baf8b={};_0x5baf8b[_0x3b403c]={'$like':'%'+_0x14e616[_0x3090('0x3f')][_0x3090('0x4a')]+'%'};return _0x5baf8b;})});}_0x5789dd=_[_0x3090('0x4b')]({},_0x5789dd,_0x14e616[_0x3090('0x54')]);return db[_0x3090('0x67')][_0x3090('0x30')]({'where':_0x5789dd[_0x3090('0x48')]})[_0x3090('0x20')](function(_0x5aa3fa){_0x14cd43[_0x3090('0x30')]=_0x5aa3fa;if(_0x14e616['query'][_0x3090('0x4d')]){_0x5789dd['include']=[{'all':!![]}];}return db[_0x3090('0x67')][_0x3090('0x68')](_0x5789dd);})[_0x3090('0x20')](function(_0x392460){_0x14cd43[_0x3090('0x69')]=_0x392460;return _0x14cd43;});}})['then'](respondWithFilteredResult(_0x7dcb8b,_0x5789dd))[_0x3090('0x2a')](handleError(_0x7dcb8b,null));};exports[_0x3090('0x6a')]=function(_0x3deaf4,_0x16e53c,_0x78f61){return db[_0x3090('0x51')][_0x3090('0x55')]({'where':{'id':_0x3deaf4[_0x3090('0x50')]['id']}})[_0x3090('0x20')](handleEntityNotFound(_0x16e53c,null))[_0x3090('0x20')](function(_0xaf2080){if(_0xaf2080){return _0xaf2080[_0x3090('0x6a')](_0x3deaf4['query'][_0x3090('0x6b')]);}})[_0x3090('0x20')](respondWithStatusCode(_0x16e53c,null))[_0x3090('0x2a')](handleError(_0x16e53c,null));};exports[_0x3090('0x6c')]=function(_0x1ca8ab,_0x10dbd8,_0xd1697){if(_0x1ca8ab[_0x3090('0x57')]['id']){delete _0x1ca8ab['body']['id'];}return db[_0x3090('0x51')][_0x3090('0x55')]({'where':{'id':_0x1ca8ab['params']['id']}})[_0x3090('0x20')](handleEntityNotFound(_0x10dbd8,null))[_0x3090('0x20')](function(_0x42466a){if(_0x42466a){_0x1ca8ab[_0x3090('0x57')]['ChatWebsiteId']=_0x42466a['id'];return db['CannedAnswer'][_0x3090('0x56')](_0x1ca8ab[_0x3090('0x57')]);}})[_0x3090('0x20')](respondWithResult(_0x10dbd8,null))[_0x3090('0x2a')](handleError(_0x10dbd8,null));};exports['getAnswers']=function(_0x5567be,_0x5aee70,_0x5427b2){var _0x10e4c8={'raw':![],'where':{}};var _0x283b55={};var _0x1b208d={'count':0x0,'rows':[]};return db[_0x3090('0x51')]['findOne']({'where':{'id':_0x5567be[_0x3090('0x50')]['id']}})[_0x3090('0x20')](handleEntityNotFound(_0x5aee70,null))[_0x3090('0x20')](function(_0x3b35fd){if(_0x3b35fd){_0x283b55['model']=_[_0x3090('0x52')](db[_0x3090('0x6d')][_0x3090('0x3a')]);_0x283b55['query']=_['keys'](_0x5567be[_0x3090('0x3f')]);_0x283b55[_0x3090('0x40')]=_[_0x3090('0x53')](_0x283b55[_0x3090('0x41')],_0x283b55[_0x3090('0x3f')]);_0x10e4c8[_0x3090('0x42')]=_[_0x3090('0x53')](_0x283b55['model'],qs[_0x3090('0x43')](_0x5567be['query'][_0x3090('0x43')]));_0x10e4c8['attributes']=_0x10e4c8[_0x3090('0x42')][_0x3090('0x44')]?_0x10e4c8[_0x3090('0x42')]:_0x283b55[_0x3090('0x41')];if(!_0x5567be[_0x3090('0x3f')][_0x3090('0x66')]('nolimit')){_0x10e4c8[_0x3090('0x31')]=qs[_0x3090('0x31')](_0x5567be['query'][_0x3090('0x31')]);_0x10e4c8[_0x3090('0x2e')]=qs[_0x3090('0x2e')](_0x5567be[_0x3090('0x3f')]['offset']);}_0x10e4c8[_0x3090('0x46')]=qs[_0x3090('0x47')](_0x5567be[_0x3090('0x3f')][_0x3090('0x47')]);_0x10e4c8[_0x3090('0x48')]=qs[_0x3090('0x40')](_[_0x3090('0x49')](_0x5567be[_0x3090('0x3f')],_0x283b55[_0x3090('0x40')]));_0x10e4c8[_0x3090('0x48')][_0x3090('0x63')]=_0x3b35fd['id'];if(_0x5567be[_0x3090('0x3f')][_0x3090('0x4a')]){_0x10e4c8[_0x3090('0x48')]=_['merge'](_0x10e4c8[_0x3090('0x48')],{'$or':_[_0x3090('0x3e')](_0x10e4c8[_0x3090('0x42')],function(_0x4f3f34){var _0x1da3d7={};_0x1da3d7[_0x4f3f34]={'$like':'%'+_0x5567be[_0x3090('0x3f')][_0x3090('0x4a')]+'%'};return _0x1da3d7;})});}_0x10e4c8=_['merge']({},_0x10e4c8,_0x5567be[_0x3090('0x54')]);return db[_0x3090('0x6d')][_0x3090('0x30')]({'where':_0x10e4c8[_0x3090('0x48')]})[_0x3090('0x20')](function(_0x548789){_0x1b208d[_0x3090('0x30')]=_0x548789;if(_0x5567be['query'][_0x3090('0x4d')]){_0x10e4c8[_0x3090('0x4e')]=[{'all':!![]}];}return db[_0x3090('0x6d')][_0x3090('0x68')](_0x10e4c8);})['then'](function(_0x58f49d){_0x1b208d['rows']=_0x58f49d;return _0x1b208d;});}})[_0x3090('0x20')](respondWithFilteredResult(_0x5aee70,_0x10e4c8))[_0x3090('0x2a')](handleError(_0x5aee70,null));};exports[_0x3090('0x6e')]=function(_0x435d6f,_0x5b36fd,_0x85449){return db[_0x3090('0x51')][_0x3090('0x55')]({'where':{'id':_0x435d6f[_0x3090('0x50')]['id']}})[_0x3090('0x20')](handleEntityNotFound(_0x5b36fd,null))[_0x3090('0x20')](function(_0x261604){if(_0x261604){return _0x261604[_0x3090('0x6e')](_0x435d6f[_0x3090('0x3f')][_0x3090('0x6b')]);}})[_0x3090('0x20')](respondWithStatusCode(_0x5b36fd,null))[_0x3090('0x2a')](handleError(_0x5b36fd,null));};exports[_0x3090('0x6f')]=function(_0x140215,_0x2dae7b,_0x34825b){_0x140215['body'][_0x3090('0x70')]=_0x140215[_0x3090('0x71')][_0x3090('0x72')];return db[_0x3090('0x51')][_0x3090('0x55')]({'where':{'id':_0x140215['params']['id']}})[_0x3090('0x20')](handleEntityNotFound(_0x2dae7b,null))[_0x3090('0x20')](saveUpdates(_0x140215[_0x3090('0x57')],null))[_0x3090('0x20')](respondWithResult(_0x2dae7b,null))[_0x3090('0x2a')](handleError(_0x2dae7b,null));};exports['addAvatar']=function(_0x2ab03d,_0x255695,_0x191e4a){_0x2ab03d[_0x3090('0x57')][_0x3090('0x73')]=_0x2ab03d['file'][_0x3090('0x72')];return db[_0x3090('0x51')]['find']({'where':{'id':_0x2ab03d['params']['id']}})[_0x3090('0x20')](handleEntityNotFound(_0x255695,null))[_0x3090('0x20')](saveUpdates(_0x2ab03d[_0x3090('0x57')],null))[_0x3090('0x20')](respondWithResult(_0x255695,null))[_0x3090('0x2a')](handleError(_0x255695,null));};exports[_0x3090('0x74')]=function(_0x4f0783,_0x38ee07,_0x4be023){_0x4f0783['body'][_0x3090('0x75')]=_0x4f0783[_0x3090('0x71')][_0x3090('0x72')];return db[_0x3090('0x51')][_0x3090('0x55')]({'where':{'id':_0x4f0783['params']['id']}})[_0x3090('0x20')](handleEntityNotFound(_0x38ee07,null))['then'](saveUpdates(_0x4f0783[_0x3090('0x57')],null))['then'](respondWithResult(_0x38ee07,null))['catch'](handleError(_0x38ee07,null));};exports[_0x3090('0x76')]=function(_0x55d043,_0x57ad13,_0x51bdfa){_0x55d043[_0x3090('0x57')]['systemAvatar']=_0x55d043[_0x3090('0x71')]['filename'];return db[_0x3090('0x51')]['find']({'where':{'id':_0x55d043[_0x3090('0x50')]['id']}})['then'](handleEntityNotFound(_0x57ad13,null))[_0x3090('0x20')](saveUpdates(_0x55d043[_0x3090('0x57')],null))[_0x3090('0x20')](respondWithResult(_0x57ad13,null))[_0x3090('0x2a')](handleError(_0x57ad13,null));};exports[_0x3090('0x77')]=function(_0x13353d,_0x5a371a,_0xcec680){var _0x4d8a7f=path[_0x3090('0x78')](config[_0x3090('0x79')],'server/files/images/logos/default_logo.svg');var _0x175440={'where':{'id':_0x13353d[_0x3090('0x50')]['id']},'attributes':['id',_0x3090('0x70')],'raw':!![]};var _0xa2f531=![];return require(_0x3090('0x17'))[_0x3090('0x7a')]()[_0x3090('0x20')](function(_0xf410ae){if(_0xf410ae){_0xa2f531=_0xf410ae['custom'];}})[_0x3090('0x20')](function(){return db[_0x3090('0x51')]['find'](_0x175440);})[_0x3090('0x20')](handleEntityNotFound(_0x5a371a,null))[_0x3090('0x20')](function(_0x7e5a02){if(_0x7e5a02){if(!_[_0x3090('0x7b')](_0x7e5a02[_0x3090('0x70')])){if(fs[_0x3090('0x7c')](path[_0x3090('0x78')](config[_0x3090('0x79')],_0x3090('0x7d'),_0x7e5a02[_0x3090('0x70')]))&&_0xa2f531){_0x4d8a7f=path['join'](config['root'],'server/files/images/logos/',_0x7e5a02[_0x3090('0x70')]);}}return _0x5a371a[_0x3090('0x7e')](_0x4d8a7f);}})['catch'](handleError(_0x5a371a,null));};exports['getAvatar']=function(_0x50f917,_0x4c991a,_0x4d6f19){var _0x5627d4=path['join'](config['root'],_0x3090('0x7f'));var _0x11f0d9={'where':{'id':_0x50f917[_0x3090('0x50')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x3090('0x51')][_0x3090('0x55')](_0x11f0d9)[_0x3090('0x20')](handleEntityNotFound(_0x4c991a,null))[_0x3090('0x20')](function(_0x7dd9bb){if(_0x7dd9bb){if(!_['isNil'](_0x7dd9bb[_0x3090('0x73')])){if(fs[_0x3090('0x7c')](path['join'](config[_0x3090('0x79')],_0x3090('0x80'),_0x7dd9bb[_0x3090('0x73')]))){_0x5627d4=path['join'](config[_0x3090('0x79')],_0x3090('0x80'),_0x7dd9bb[_0x3090('0x73')]);}}return _0x4c991a['download'](_0x5627d4);}})[_0x3090('0x2a')](handleError(_0x4c991a,null));};exports['getCustomerAvatar']=function(_0x5616be,_0x188710,_0x35811a){var _0x1e0211=path[_0x3090('0x78')](config['root'],_0x3090('0x81'));var _0x4c2f35={'where':{'id':_0x5616be[_0x3090('0x50')]['id']},'attributes':['id',_0x3090('0x75'),_0x3090('0x82')],'raw':!![]};return db[_0x3090('0x51')][_0x3090('0x55')](_0x4c2f35)[_0x3090('0x20')](handleEntityNotFound(_0x188710,null))['then'](function(_0x2824bc){if(_0x2824bc){if(!_['isNil'](_0x2824bc['customerAvatar'])){if(fs['existsSync'](path['join'](config[_0x3090('0x79')],_0x3090('0x80'),_0x2824bc[_0x3090('0x75')]))&&_0x2824bc[_0x3090('0x82')]){_0x1e0211=path['join'](config[_0x3090('0x79')],_0x3090('0x80'),_0x2824bc[_0x3090('0x75')]);}}return _0x188710[_0x3090('0x7e')](_0x1e0211);}})[_0x3090('0x2a')](handleError(_0x188710,null));};exports[_0x3090('0x83')]=function(_0x3ab9ce,_0x4e9de3,_0x1553f2){var _0x237b6f=path[_0x3090('0x78')](config['root'],_0x3090('0x84'));var _0x106442={'where':{'id':_0x3ab9ce[_0x3090('0x50')]['id']},'attributes':['id',_0x3090('0x85')],'raw':!![]};return db[_0x3090('0x51')][_0x3090('0x55')](_0x106442)[_0x3090('0x20')](handleEntityNotFound(_0x4e9de3,null))[_0x3090('0x20')](function(_0x1d5b23){if(_0x1d5b23){if(!_[_0x3090('0x7b')](_0x1d5b23[_0x3090('0x85')])){if(fs['existsSync'](path['join'](config[_0x3090('0x79')],_0x3090('0x80'),_0x1d5b23[_0x3090('0x85')]))){_0x237b6f=path[_0x3090('0x78')](config[_0x3090('0x79')],_0x3090('0x80'),_0x1d5b23[_0x3090('0x85')]);}}return _0x4e9de3['download'](_0x237b6f);}})[_0x3090('0x2a')](handleError(_0x4e9de3,null));};exports[_0x3090('0x86')]=function(_0xb31925,_0x4143e7,_0xe05d1d){var _0x3379a7=require(_0x3090('0x87'));var _0x4eee79=new _0x3379a7();var _0x11ca82=_0x4eee79['setUA'](_0xb31925[_0x3090('0x88')][_0x3090('0x89')])[_0x3090('0x8a')]();var _0x56c258={'body':_0xb31925[_0x3090('0x57')],'channel':_0x3090('0x8b')};var _0x5ba3d1=[];var _0x19f09a=[];var _0x27a6d6={};var _0x577614=![];return db[_0x3090('0x8c')]['describe']()[_0x3090('0x20')](function(_0x1995f5){if(!_0x1995f5){throw new db[(_0x3090('0x8d'))][(_0x3090('0x8e'))](_0x3090('0x8f'));}_0x5ba3d1=_[_0x3090('0x90')](_[_0x3090('0x52')](_0x1995f5),[_0x3090('0x91'),_0x3090('0x92')]);_0x19f09a=_[_0x3090('0x90')](_[_0x3090('0x52')](_0x1995f5),[_0x3090('0x91'),_0x3090('0x92'),_0x3090('0x93'),_0x3090('0x94')]);if(_0xb31925['body']['id']){delete _0xb31925[_0x3090('0x57')]['id'];}if(_[_0x3090('0x7b')](_0xb31925['body'][_0x3090('0x95')])){throw new db[(_0x3090('0x8d'))]['ValidationError'](_0x3090('0x96'));}if(_[_0x3090('0x7b')](_0xb31925['body'][_0x3090('0x57')])||_0xb31925[_0x3090('0x57')][_0x3090('0x57')]===''){throw new db[(_0x3090('0x8d'))]['ValidationError'](_0x3090('0x97'));}if(_[_0x3090('0x7b')](_0xb31925['body']['mapKey'])){throw new db[(_0x3090('0x8d'))][(_0x3090('0x8e'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x19f09a);}if(!_['includes'](_0x19f09a,_0xb31925['body'][_0x3090('0x98')])){throw new db[(_0x3090('0x8d'))][(_0x3090('0x8e'))](_0x3090('0x99')+_0x19f09a);}_0x27a6d6[_0xb31925[_0x3090('0x57')]['mapKey']]=_0xb31925['body'][_0x3090('0x95')];})['then'](function(){return db[_0x3090('0x51')]['find']({'where':{'id':_0xb31925['params']['id']},'include':[{'model':db[_0x3090('0x9a')],'as':'List','include':[{'model':db[_0x3090('0x8c')],'as':_0x3090('0x9b'),'where':_0x27a6d6,'limit':0x1,'order':[['updatedAt',_0x3090('0x9c')]]}]},{'model':db[_0x3090('0x9d')],'as':_0x3090('0x9e')}]});})['then'](handleEntityNotFound(_0x4143e7,null))[_0x3090('0x20')](function(_0x5c1019){if(_0x5c1019&&_0x5c1019['List']){_0x56c258['account']=_0x5c1019;_0x56c258[_0x3090('0x9f')]=_0x5c1019[_0x3090('0x9e')];_0x56c258[_0x3090('0xa0')]=_0x5c1019[_0x3090('0xa1')];_0x56c258[_0x3090('0x9f')]=_[_0x3090('0xa2')](_0x56c258[_0x3090('0x9f')],['priority'],[_0x3090('0xa3')]);if(_0x56c258[_0x3090('0xa4')][_0x3090('0x9e')]){delete _0x56c258['account'][_0x3090('0x9e')];}if(_0x56c258['account'][_0x3090('0xa1')]&&_0x56c258[_0x3090('0xa4')][_0x3090('0xa1')]['Contacts']['length']){return _0x56c258[_0x3090('0xa4')][_0x3090('0xa1')][_0x3090('0x9b')][0x0];}var _0x27d420=_[_0x3090('0xa5')](_0xb31925['body'],{'firstName':_0xb31925[_0x3090('0x57')][_0x3090('0x95')],'ListId':_0x5c1019[_0x3090('0x94')]});_0x27d420[_0xb31925[_0x3090('0x57')][_0x3090('0x98')]]=_0xb31925[_0x3090('0x57')]['from'];return db[_0x3090('0x8c')][_0x3090('0x56')](_0x27d420,{'fields':_0x5ba3d1,'raw':!![]});}})[_0x3090('0x20')](handleEntityNotFound(_0x4143e7,null))[_0x3090('0x20')](function(_0x3c2de2){_0x56c258[_0x3090('0xa6')]=_0x3c2de2;var _0x56b247=_0xb31925[_0x3090('0x57')][_0x3090('0xa7')];if(_0xb31925['headers']['cf-connecting-ip']){_0x56b247=_0xb31925['headers'][_0x3090('0xa8')];}else if(_0xb31925['headers'][_0x3090('0xa9')]){_0x56b247=_[_0x3090('0xaa')](_0xb31925[_0x3090('0x88')][_0x3090('0xa9')][_0x3090('0xab')](','));}if(_0x3c2de2){var _0x11cc44={'ContactId':_0x3c2de2['id'],'ChatWebsiteId':_0xb31925[_0x3090('0x50')]['id'],'from':(_0x3c2de2[_0x3090('0xac')]||'')+'\x20'+(_0x3c2de2['lastName']||''),'customerIp':_0x56b247,'customerPort':_0xb31925[_0x3090('0x88')]['x-real-port']?_0xb31925[_0x3090('0x88')][_0x3090('0xad')]:null,'referer':_0xb31925['body'][_0x3090('0xae')],'browserName':_0x11ca82['browser'][_0x3090('0x37')]&&_0x11ca82[_0x3090('0xaf')]['version']?util[_0x3090('0xb0')](_0x3090('0xb1'),_0x11ca82[_0x3090('0xaf')][_0x3090('0x37')],_0x11ca82[_0x3090('0xaf')][_0x3090('0xb2')]):'unknown','browserVersion':_0x11ca82[_0x3090('0xaf')]['version']||_0x3090('0xb3'),'osName':util[_0x3090('0xb0')](_0x3090('0xb1'),_0x11ca82['os'][_0x3090('0x37')],_0x11ca82['os'][_0x3090('0xb2')]),'osVersion':_0x11ca82['os']['version'],'deviceModel':_0x11ca82['device'][_0x3090('0x41')]&&_0x11ca82['device'][_0x3090('0xb4')]?util[_0x3090('0xb0')](_0x3090('0xb5'),_0x11ca82['device'][_0x3090('0x41')],_0x11ca82[_0x3090('0xb6')]['vendor'],_0x11ca82[_0x3090('0xb6')][_0x3090('0x3c')]):null,'deviceVendor':_0x11ca82[_0x3090('0xb6')][_0x3090('0xb4')],'deviceType':_0x11ca82[_0x3090('0xb6')][_0x3090('0x3c')],'formData':JSON[_0x3090('0x25')](_0xb31925[_0x3090('0x57')])};var _0x3e935c={'ChatWebsiteId':_0xb31925[_0x3090('0x50')]['id'],'closed':![]};if(_0xb31925[_0x3090('0x57')][_0x3090('0xb7')]){_0x3e935c['threadId']=_0xb31925[_0x3090('0x57')]['threadId'];return db[_0x3090('0xb8')]['find']({'where':_0x3e935c})[_0x3090('0x20')](function(_0x411591){if(_0x411591){return[_0x411591,![]];}_0x11cc44['threadId']=_0xb31925['body'][_0x3090('0xb7')];_0x11cc44[_0x3090('0xb9')]=_0xb31925[_0x3090('0x57')][_0x3090('0xb9')];return db[_0x3090('0xb8')][_0x3090('0x56')](_0x11cc44)[_0x3090('0x20')](function(_0x3e9427){return[_0x3e9427,!![]];});});}_0x3e935c[_0x3090('0xba')]=_0x3c2de2['id'];if(_0xb31925[_0x3090('0x57')][_0x3090('0xbb')]&&_0xb31925['body'][_0x3090('0xbb')]['id']){_0x3e935c['id']=_0xb31925[_0x3090('0x57')][_0x3090('0xbb')]['id'];return db['ChatInteraction']['find']({'where':_0x3e935c})['then'](function(_0x3b2c28){if(_0x3b2c28){return[_0x3b2c28,![]];}return db[_0x3090('0xb8')][_0x3090('0x56')](_0x11cc44)['then'](function(_0x56b3c2){return[_0x56b3c2,!![]];});});}return db[_0x3090('0xb8')][_0x3090('0x56')](_0x11cc44)[_0x3090('0x20')](function(_0x33386c){return[_0x33386c,!![]];});}})[_0x3090('0xbc')](function(_0x5f0ea2,_0x34ba41){if(_0x5f0ea2){_0x577614=_0x34ba41;if(!_0x34ba41){var _0x2cd69c={'from':(_0x56c258['contact'][_0x3090('0xac')]||'')+'\x20'+(_0x56c258[_0x3090('0xa6')]['lastName']||'')};if(_0xb31925[_0x3090('0x57')][_0x3090('0xb7')]&&_0xb31925[_0x3090('0x57')]['messageId']&&_0xb31925[_0x3090('0x57')]['threadId']!=_0xb31925[_0x3090('0x57')]['messageId']){_0x2cd69c[_0x3090('0xb7')]=_0xb31925[_0x3090('0x57')][_0x3090('0xbd')];}return _0x5f0ea2[_0x3090('0x60')](_0x2cd69c);}else{return _0x5f0ea2;}}})['then'](function(_0x11fdd9){_0x56c258['interaction']=_0x11fdd9['get']({'plain':!![]});_0x56c258[_0x3090('0xbb')][_0x3090('0xbe')]=_0x577614;if(_0x56c258['interaction'][_0x3090('0xbe')]){if(_0x56c258[_0x3090('0xa4')][_0x3090('0xbf')]){_0x56c258['applications'][_0x3090('0xc0')]({'id':0x0,'priority':_0x56c258[_0x3090('0x9f')]['length']+0x1,'app':'close','appdata':_0x3090('0xc1'),'interval':_0x3090('0xc2')});}}return db[_0x3090('0xc3')]['create']({'body':_0xb31925[_0x3090('0x57')][_0x3090('0x57')],'ChatWebsiteId':_0xb31925['params']['id'],'ChatInteractionId':_0x11fdd9['id'],'direction':'in','ContactId':_0x56c258[_0x3090('0xa6')]['id'],'AttachmentId':_0xb31925[_0x3090('0x57')][_0x3090('0xc4')]});})['then'](function(_0x2c5c1a){_0x56c258[_0x3090('0x28')]=_0x2c5c1a;if(_0x56c258[_0x3090('0xbb')][_0x3090('0xc5')]){return db[_0x3090('0xc6')][_0x3090('0x55')]({'attributes':['id',_0x3090('0x37')],'where':{'id':_0x56c258[_0x3090('0xbb')][_0x3090('0xc5')]}})['then'](function(_0x30c940){if(_0x30c940){_0x56c258[_0x3090('0x9f')][_0x3090('0xc7')]({'id':0x0,'priority':0x0,'app':_0x3090('0xc8'),'appdata':_0x30c940[_0x3090('0x37')]+','+(_0x56c258[_0x3090('0xa4')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});_0x56c258[_0x3090('0xc9')]=!![];}return respondWithRpcPromise(_0x3090('0xca'),'startRouting',_0x56c258);});}return respondWithRpcPromise(_0x3090('0xca'),_0x3090('0xcb'),_0x56c258);})[_0x3090('0x20')](function(_0x43e7d5){respondWithRpcPromise('EventManager',_0x3090('0xcc'),{'event':_0x3090('0x86'),'message':_0x43e7d5},client9002);return _0x43e7d5;})[_0x3090('0x20')](respondWithResult(_0x4143e7,null))[_0x3090('0x2a')](handleError(_0x4143e7,null));};exports[_0x3090('0xcd')]=function(_0x530d3a,_0x3ee684,_0x53ae2c){var _0x17e109,_0x4eb5c8,_0x2401ee;var _0x3d97b9=[];var _0x513b91=[];var _0x5947ec={};var _0x55f4c0=_0x530d3a[_0x3090('0xce')]||[];var _0x51be24=[];var _0x4b6460;return db[_0x3090('0x8c')][_0x3090('0x61')]()[_0x3090('0x20')](function(_0x35f45d){if(!_0x35f45d){throw new db[(_0x3090('0x8d'))][(_0x3090('0x8e'))](_0x3090('0x8f'));}_0x513b91=_[_0x3090('0x90')](_[_0x3090('0x52')](_0x35f45d),[_0x3090('0x91'),'updatedAt']);_0x3d97b9=_[_0x3090('0x90')](_[_0x3090('0x52')](_0x35f45d),['createdAt',_0x3090('0x92'),_0x3090('0x93'),_0x3090('0x94')]);if(_0x530d3a[_0x3090('0x57')]['id']){delete _0x530d3a[_0x3090('0x57')]['id'];}if(_[_0x3090('0x7b')](_0x530d3a[_0x3090('0x57')][_0x3090('0x95')])){throw _0x3ee684[_0x3090('0x32')](0x1f4)[_0x3090('0xcf')](new db[(_0x3090('0x8d'))][(_0x3090('0x8e'))](_0x3090('0x96')));}if(_['isNil'](_0x530d3a[_0x3090('0x57')][_0x3090('0x57')])||_0x530d3a[_0x3090('0x57')][_0x3090('0x57')]===''){throw _0x3ee684['status'](0x1f4)[_0x3090('0xcf')](new db[(_0x3090('0x8d'))]['ValidationError'](_0x3090('0x97')));}if(_[_0x3090('0x7b')](_0x530d3a[_0x3090('0x57')][_0x3090('0xd0')])){throw _0x3ee684[_0x3090('0x32')](0x1f4)[_0x3090('0xcf')](new db[(_0x3090('0x8d'))][(_0x3090('0x8e'))](_0x3090('0xd1')+_0x3d97b9));}if(!_[_0x3090('0xd2')](_0x3d97b9,_0x530d3a[_0x3090('0x57')][_0x3090('0xd0')])){throw _0x3ee684[_0x3090('0x32')](0x1f4)[_0x3090('0xcf')](new db['Sequelize'][(_0x3090('0x8e'))](_0x3090('0xd3')+_0x3d97b9));}_0x5947ec[_0x530d3a['body'][_0x3090('0xd0')]]=_0x530d3a[_0x3090('0x57')][_0x3090('0x95')];})[_0x3090('0x20')](function(){return db['ChatWebsite']['find']({'where':{'id':_0x530d3a[_0x3090('0x50')]['id']},'include':[{'model':db[_0x3090('0x9a')],'as':_0x3090('0xa1')},{'model':db[_0x3090('0xd4')],'as':'MailAccount'}]});})['then'](handleEntityNotFound(_0x3ee684,null))[_0x3090('0x20')](function(_0x392af3){if(_0x392af3&&_0x392af3[_0x3090('0xa1')]){_0x4eb5c8=_0x392af3;var _0x4e942d=_['defaults'](_0x530d3a[_0x3090('0x57')],{'firstName':_0x530d3a[_0x3090('0x57')][_0x3090('0x95')],'phone':_0x530d3a['body']['from'],'ListId':_0x392af3['ListId']});_0x4e942d[_0x530d3a['body'][_0x3090('0xd0')]]=_0x530d3a[_0x3090('0x57')][_0x3090('0x95')];return db[_0x3090('0x8c')][_0x3090('0xd5')]({'where':_0x5947ec,'defaults':_0x4e942d});}})[_0x3090('0xbc')](function(_0x1c0a3f){if(_0x1c0a3f){_0x2401ee=_0x1c0a3f;var _0xf78b6d=fs[_0x3090('0xd6')](path['join'](config[_0x3090('0x79')],_0x3090('0xd7')),'utf8');var _0x2cf8c7=ejs[_0x3090('0xd8')](_0xf78b6d,{'body':_[_0x3090('0xd9')](_0x530d3a[_0x3090('0x57')][_0x3090('0x57')]),'bodyTitle':_0x4eb5c8['offlineMessageBody']});return db[_0x3090('0xda')][_0x3090('0x56')]({'body':_0x2cf8c7,'ContactId':_0x1c0a3f['id'],'ChatWebsiteId':_0x4eb5c8['id']});}})[_0x3090('0x20')](function(_0x12fdbf){_0x4b6460=_0x12fdbf;if(_0x55f4c0[_0x3090('0x44')]){var _0x199ee2=_0x55f4c0[_0x3090('0x3e')](function(_0x153cbb){return{'name':_0x153cbb[_0x3090('0xdb')],'basename':_0x153cbb[_0x3090('0x72')],'type':_0x153cbb['mimetype'],'ChatOfflineMessageId':_0x12fdbf['id']};});_0x51be24=_0x199ee2['map'](_0x5aa79d=>{var _0x257c1f={'filename':_0x5aa79d[_0x3090('0x37')],'path':path[_0x3090('0x78')](config[_0x3090('0x79')],'server','files','attachments','offline-chat',_0x5aa79d[_0x3090('0xdc')])};return _0x257c1f;});if(!_0x4eb5c8['openNewInteraction']){return db['sequelize'][_0x3090('0xdd')](function(_0x5288f0){return db[_0x3090('0xde')][_0x3090('0xdf')](_0x199ee2,{'transaction':_0x5288f0});});}}})[_0x3090('0x20')](function(){if(_0x4b6460){_0x17e109=_0x4b6460;return db[_0x3090('0xd4')][_0x3090('0x65')]({'where':{'active':!![]},'include':[{'model':db[_0x3090('0xe0')],'as':_0x3090('0xe1'),'raw':!![]}]});}})[_0x3090('0x20')](function(_0x4bb172){if(_0x4bb172&&_0x4bb172[_0x3090('0xe1')]&&_0x4eb5c8[_0x3090('0xe2')]&&_0x4eb5c8[_0x3090('0xe3')]){var _0x32efac={'tls':{'rejectUnauthorized':![]}};if(_0x4bb172['Smtp'][_0x3090('0xe4')]){_0x32efac[_0x3090('0xe4')]=_0x4bb172['Smtp'][_0x3090('0xe4')];}else{_0x32efac['host']=_0x4bb172[_0x3090('0xe1')]['host'];_0x32efac[_0x3090('0xe5')]=_0x4bb172[_0x3090('0xe1')][_0x3090('0xe5')];_0x32efac['secure']=_0x4bb172[_0x3090('0xe1')][_0x3090('0xe6')];}if(_0x4bb172[_0x3090('0xe1')][_0x3090('0xe7')]){_0x32efac[_0x3090('0xe8')]={'user':_0x4bb172[_0x3090('0xe1')]['user'],'pass':_0x4bb172['Smtp'][_0x3090('0xe9')]};}return respondWithRpcPromise(_0x3090('0xea'),'sendMail',{'account':_0x32efac,'message':{'from':util[_0x3090('0xb0')](_0x3090('0xeb'),_0x4bb172[_0x3090('0x37')],_0x4bb172[_0x3090('0xec')]||_0x4bb172[_0x3090('0xe1')][_0x3090('0x58')]),'to':_0x4eb5c8[_0x3090('0xe3')],'subject':_0x4eb5c8[_0x3090('0xed')],'html':_0x17e109[_0x3090('0x57')],'attachments':_0x51be24}},client9003)[_0x3090('0x20')](function(){return _0x17e109;})[_0x3090('0x2a')](function(_0x4c3aea){console[_0x3090('0x26')](_0x4c3aea);});}})[_0x3090('0x20')](function(){if(_0x4eb5c8&&_0x4eb5c8['openNewInteraction']&&_0x4eb5c8[_0x3090('0xee')]){var _0x5ab8b6=[];if(_0x55f4c0[_0x3090('0x44')]){_0x5ab8b6=_0x55f4c0[_0x3090('0x3e')](function(_0x1821b3){return{'name':_0x1821b3[_0x3090('0xdb')],'basename':_0x1821b3[_0x3090('0x72')],'type':_0x1821b3[_0x3090('0xef')],'ChatOfflineMessageId':_0x4b6460['id']};});}var _0x2a61c6;if(!_[_0x3090('0x7b')](_0x4eb5c8[_0x3090('0xf0')])){var _0x3e0af1=_[_0x3090('0x3e')](_0x530d3a[_0x3090('0x57')],function(_0x276071){return _0x276071;});var _0x291591=_[_0x3090('0xf1')](_0x3e0af1)[0x0];var _0x12bc89=_[_0x3090('0xf2')](_0x291591,function(_0x516084){return _0x516084;});_0x2a61c6=_0x12bc89[0x1][_0x4eb5c8[_0x3090('0xf0')]];}var _0x33bfd9={'from':_0x2401ee[_0x3090('0xec')],'firstName':_0x2401ee[_0x3090('0xac')],'lastName':_0x2401ee[_0x3090('0xf3')],'mapKey':_0x3090('0xec'),'message':{'from':_0x2401ee['email'],'to':_0x4eb5c8[_0x3090('0xd4')][_0x3090('0xec')],'cc':'','subject':_['isNil'](_0x2a61c6)?_0x4eb5c8[_0x3090('0xed')]:_0x2a61c6,'messageId':'','sentAt':new Date(),'attach':_0x5ab8b6[_0x3090('0x44')],'attachments':_0x5ab8b6,'originChannel':'Chat','ChatWebsiteId':_0x4eb5c8['id'],'ChatOfflineMessageId':_0x17e109['id'],'originTo':_0x4eb5c8[_0x3090('0xd4')][_0x3090('0xec')]},'body':_0x17e109[_0x3090('0x57')]};var _0x137354={'account':{'id':_0x4eb5c8[_0x3090('0xee')]},'body':_0x33bfd9,'log':_0x3090('0xf4')};return respondWithRpcPromise(_0x3090('0xf4'),_0x3090('0xf5'),_0x137354,client9001)[_0x3090('0x20')](function(){return _0x17e109;})[_0x3090('0x2a')](function(_0x5d33bd){console[_0x3090('0x26')](_0x5d33bd);});}return;})[_0x3090('0x20')](function(){if(_0x17e109){return _0x17e109;}})['then'](respondWithResult(_0x3ee684,null))[_0x3090('0x2a')](function(_0x56cd05){console[_0x3090('0x26')]('catch',_0x56cd05);for(var _0x5cefb6 of _0x55f4c0){var _0xa0416=path[_0x3090('0x78')](config[_0x3090('0x79')],_0x3090('0xf6'),'files',_0x3090('0xf7'),'offline-chat',_0x5cefb6['filename']);fs_extra[_0x3090('0xf8')](_0xa0416)['catch'](function(_0xec72fe){console[_0x3090('0x26')](_0x3090('0xf9'),_0xa0416,_0xec72fe);});}});};exports['addInteraction']=function(_0x53a0c8,_0x31f28b,_0x563c0e){return db['ChatInteraction'][_0x3090('0x55')]({'where':{'id':_0x53a0c8[_0x3090('0x50')]['id']}})['then'](handleEntityNotFound(_0x31f28b,null))[_0x3090('0x20')](function(_0x2a9548){if(_0x2a9548){return _0x2a9548['addInteraction'](_0x53a0c8[_0x3090('0x57')][_0x3090('0x6b')],_[_0x3090('0xfa')](_0x53a0c8[_0x3090('0x57')],['ids','id'])||{});}})[_0x3090('0x20')](respondWithResult(_0x31f28b,null))[_0x3090('0x2a')](handleError(_0x31f28b,null));};exports[_0x3090('0xfb')]=function(_0xdfd0b0,_0x31d2a3,_0x199491){var _0x5c3375={'raw':![],'where':{}};var _0x2765aa={};var _0x3adfc1={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x3090('0x65')]({'where':{'id':_0xdfd0b0[_0x3090('0x50')]['id']}})['then'](handleEntityNotFound(_0x31d2a3,null))[_0x3090('0x20')](function(_0x4cbb37){if(_0x4cbb37){_0x2765aa[_0x3090('0x41')]=_[_0x3090('0x52')](db[_0x3090('0xb8')][_0x3090('0x3a')]);_0x2765aa[_0x3090('0x3f')]=_['keys'](_0xdfd0b0[_0x3090('0x3f')]);_0x2765aa[_0x3090('0x40')]=_[_0x3090('0x53')](_0x2765aa[_0x3090('0x41')],_0x2765aa['query']);_0x5c3375['attributes']=_[_0x3090('0x53')](_0x2765aa[_0x3090('0x41')],qs[_0x3090('0x43')](_0xdfd0b0[_0x3090('0x3f')][_0x3090('0x43')]));_0x5c3375['attributes']=_0x5c3375[_0x3090('0x42')][_0x3090('0x44')]?_0x5c3375['attributes']:_0x2765aa[_0x3090('0x41')];if(!_0xdfd0b0[_0x3090('0x3f')][_0x3090('0x66')](_0x3090('0x45'))){_0x5c3375[_0x3090('0x31')]=qs[_0x3090('0x31')](_0xdfd0b0[_0x3090('0x3f')][_0x3090('0x31')]);_0x5c3375[_0x3090('0x2e')]=qs['offset'](_0xdfd0b0[_0x3090('0x3f')][_0x3090('0x2e')]);}_0x5c3375[_0x3090('0x46')]=qs[_0x3090('0x47')](_0xdfd0b0[_0x3090('0x3f')][_0x3090('0x47')]);_0x5c3375[_0x3090('0x48')]=qs['filters'](_[_0x3090('0x49')](_0xdfd0b0[_0x3090('0x3f')],_0x2765aa[_0x3090('0x40')]));_0x5c3375[_0x3090('0x48')]['ChatWebsiteId']=_0x4cbb37['id'];if(_0xdfd0b0['query'][_0x3090('0x4a')]){_0x5c3375[_0x3090('0x48')]=_[_0x3090('0x4b')](_0x5c3375[_0x3090('0x48')],{'$or':_['map'](_0x5c3375['attributes'],function(_0x511694){var _0x23a2d2={};_0x23a2d2[_0x511694]={'$like':'%'+_0xdfd0b0[_0x3090('0x3f')][_0x3090('0x4a')]+'%'};return _0x23a2d2;})});}_0x5c3375=_[_0x3090('0x4b')]({},_0x5c3375,_0xdfd0b0[_0x3090('0x54')]);return db[_0x3090('0xb8')]['count']({'where':_0x5c3375['where']})[_0x3090('0x20')](function(_0x575af4){_0x3adfc1[_0x3090('0x30')]=_0x575af4;if(_0xdfd0b0[_0x3090('0x3f')][_0x3090('0x4d')]){_0x5c3375[_0x3090('0x4e')]=[{'model':db[_0x3090('0x8c')],'as':_0x3090('0xfc'),'required':![]},{'model':db[_0x3090('0xc6')],'as':_0x3090('0xfd'),'attributes':['name',_0x3090('0xfe'),_0x3090('0xff')],'required':![]},{'model':db[_0x3090('0x100')],'as':_0x3090('0x101'),'attributes':['id','name',_0x3090('0x102')],'where':_0xdfd0b0['query']['tag']?{'id':_0xdfd0b0[_0x3090('0x3f')][_0x3090('0x103')]}:undefined,'required':_0xdfd0b0[_0x3090('0x3f')][_0x3090('0x103')]?!![]:![]}];}return db[_0x3090('0xb8')]['findAll'](_0x5c3375);})['then'](function(_0x12d9d8){_0x3adfc1[_0x3090('0x69')]=_0x12d9d8;return _0x3adfc1;});}})[_0x3090('0x20')](respondWithFilteredResult(_0x31d2a3,_0x5c3375))[_0x3090('0x2a')](handleError(_0x31d2a3,null));};function iftimePromise(_0xa8a642,_0x16d0f7){return respondWithRpcPromise(_0x3090('0x104'),_0x3090('0x105'),{'command':_0x16d0f7[_0x3090('0x106')]?util[_0x3090('0xb0')](_0x3090('0x107'),_0xa8a642[_0x3090('0x108')],_0x16d0f7[_0x3090('0x106')]):util[_0x3090('0xb0')](_0x3090('0x109'),_0xa8a642[_0x3090('0x108')])},client9002)[_0x3090('0x20')](function(_0x37bd2a){var _0x166dcf=_0x37bd2a&&_0x37bd2a['indexOf']('true')>=0x0?!![]:![];logger[_0x3090('0x21')](_0x3090('0x10a'),_0x16d0f7['id'],_0xa8a642['id'],_0xa8a642[_0x3090('0x108')],_0x166dcf?_0x3090('0x10b'):_0x3090('0x10c'),_0x16d0f7[_0x3090('0x106')]?_0x16d0f7['timezone']:_0x3090('0x10d'));return _0x166dcf;})['catch'](function(_0x1b2a05){logger[_0x3090('0x26')](_0x3090('0x10a'),_0x16d0f7['id'],_0xa8a642['id'],_0xa8a642[_0x3090('0x108')],util[_0x3090('0x10e')](_0x1b2a05,{'showHidden':![],'depth':null}),_0x16d0f7[_0x3090('0x106')]?_0x16d0f7[_0x3090('0x106')]:_0x3090('0x10d'));return![];});}exports[_0x3090('0x105')]=function(_0x49a457,_0x214ec5,_0x22783c){var _0x97405c=0x0;var _0x5edf5e=0x0;var _0x352d02=![];var _0x2bda96;var _0x30bde4;return db[_0x3090('0x51')]['find']({'where':{'id':_0x49a457[_0x3090('0x50')]['id']},'include':[{'model':db[_0x3090('0x10f')],'as':'Interval','include':[{'model':db[_0x3090('0x10f')],'as':_0x3090('0x110'),'attributes':['id',_0x3090('0x108')],'raw':!![]}]}]})[_0x3090('0x20')](handleEntityNotFound(_0x214ec5,null))[_0x3090('0x20')](function(_0x1e0eeb){if(_0x1e0eeb){_0x2bda96=_0x1e0eeb;return _0x1e0eeb[_0x3090('0x111')]({'raw':!![]});}})['then'](function(_0x2c3a34){if(_0x2bda96){if(_0x2c3a34){_0x30bde4=_0x2c3a34;}}return require('../../config/license/util')[_0x3090('0x7a')]();})[_0x3090('0x20')](function(_0x4a1061){if(_0x4a1061){_0x5edf5e=_0x4a1061[_0x3090('0x112')];_0x352d02=_0x4a1061[_0x3090('0x113')];}})[_0x3090('0x20')](function(){return db['ChatInteraction'][_0x3090('0x30')]({'where':{'closed':![]}});})[_0x3090('0x20')](function(_0x4e50cd){_0x97405c=_0x4e50cd;if(_0x5edf5e&&_0x4e50cd>_0x5edf5e){return db[_0x3090('0x114')]['findOne']({'where':{'id':0x1}})[_0x3090('0x20')](function(_0x492a05){if(_0x492a05){_0x492a05[_0x3090('0x115')](_0x3090('0x116'));}});}})['then'](function(){if(_0x2bda96[_0x3090('0x10f')]&&_0x2bda96['Interval'][_0x3090('0x110')]){var _0x5003c1=[];for(var _0x3d50b4=0x0;_0x3d50b4<_0x2bda96[_0x3090('0x10f')]['Intervals'][_0x3090('0x44')];_0x3d50b4++){var _0x192804=_0x2bda96[_0x3090('0x10f')][_0x3090('0x110')][_0x3d50b4][_0x3090('0x35')]({'plain':!![]});_0x5003c1['push'](iftimePromise(_0x192804,_0x2bda96));}return BPromise[_0x3090('0x117')](_0x5003c1)[_0x3090('0x20')](function(_0x11f476){return _[_0x3090('0x118')](_0x11f476);});}else{return!![];}})['then'](function(_0x3e9e24){var _0xf3e69e=fs[_0x3090('0xd6')](path[_0x3090('0x78')](config[_0x3090('0x79')],_0x3090('0x119')),_0x3090('0x11a'));var _0x5beb96={'remote':_0x2bda96[_0x3090('0x11b')],'query':querystring[_0x3090('0x25')](_[_0x3090('0x4b')](_0x2bda96['get']({'plain':!![]}),{'customerIp':_0x49a457[_0x3090('0x88')]['x-forwarded-for']||_0x49a457[_0x3090('0x88')][_0x3090('0x11c')]||_0x49a457[_0x3090('0x11d')]['remoteAddress']||_0x49a457['ip'],'referer':_0x49a457[_0x3090('0x88')][_0x3090('0xae')],'openedInteractions':_0x97405c,'maxInteractions':_0x5edf5e,'virtual':_0x352d02[_0x3090('0x112')],'online':_0x3e9e24,'custom':_0x352d02}))[_0x3090('0x11e')](/'/g,'\x5c\x27')};_0x214ec5[_0x3090('0xcf')](ejs[_0x3090('0xd8')](Mustache['render'](_0xf3e69e,_0x5beb96),{'proactiveActions':_0x30bde4,'alignment':_0x2bda96['alignment'],'verticalAlignment':_0x2bda96[_0x3090('0x11f')],'div_color':_0x2bda96['color'],'text_color':_0x2bda96[_0x3090('0x120')],'button_color':_0x2bda96[_0x3090('0x121')],'background_color':_0x2bda96[_0x3090('0x122')]}));})[_0x3090('0x2a')](handleError(_0x214ec5,null));};exports[_0x3090('0x123')]=function(_0x32b855,_0x2f6a86,_0x5d266f){return db[_0x3090('0x51')][_0x3090('0x65')]({'where':{'id':_0x32b855[_0x3090('0x50')]['id']}})['then'](handleEntityNotFound(_0x2f6a86,null))[_0x3090('0x20')](function(_0x5d0c8b){if(_0x5d0c8b){return db[_0x3090('0x124')][_0x3090('0xdd')](function(_0x3af420){return db[_0x3090('0x9d')][_0x3090('0x34')]({'where':{'ChatWebsiteId':_0x32b855[_0x3090('0x50')]['id']},'transaction':_0x3af420})[_0x3090('0x20')](function(_0x15c72e){var _0x325807=_[_0x3090('0x3e')](_0x32b855[_0x3090('0x57')],function(_0x5c2ece){_0x5c2ece['ChatWebsiteId']=_0x32b855[_0x3090('0x50')]['id'];return _0x5c2ece;});return db['ChatApplication'][_0x3090('0xdf')](_0x325807,{'transaction':_0x3af420});});})[_0x3090('0x20')](function(){return db[_0x3090('0x9d')][_0x3090('0x125')]({'where':{'ChatWebsiteId':_0x32b855[_0x3090('0x50')]['id']},'order':_0x3090('0x126')});});}})['then'](respondWithResult(_0x2f6a86,null))[_0x3090('0x2a')](handleError(_0x2f6a86,null));};exports[_0x3090('0x127')]=function(_0x23f60c,_0x1e6d2e,_0x1852ff){var _0x33b9f8={};var _0x35cb35={};var _0x571cea;var _0x3a827d;return db[_0x3090('0x51')]['findOne']({'where':{'id':_0x23f60c[_0x3090('0x50')]['id']}})[_0x3090('0x20')](handleEntityNotFound(_0x1e6d2e,null))['then'](function(_0xb71d1b){if(_0xb71d1b){_0x571cea=_0xb71d1b;_0x35cb35['model']=_[_0x3090('0x52')](db[_0x3090('0x9d')][_0x3090('0x3a')]);_0x35cb35['query']=_[_0x3090('0x52')](_0x23f60c['query']);_0x35cb35[_0x3090('0x40')]=_[_0x3090('0x53')](_0x35cb35[_0x3090('0x41')],_0x35cb35[_0x3090('0x3f')]);_0x33b9f8['attributes']=_[_0x3090('0x53')](_0x35cb35['model'],qs[_0x3090('0x43')](_0x23f60c[_0x3090('0x3f')]['fields']));_0x33b9f8[_0x3090('0x42')]=_0x33b9f8['attributes'][_0x3090('0x44')]?_0x33b9f8['attributes']:_0x35cb35['model'];_0x33b9f8[_0x3090('0x46')]=qs[_0x3090('0x47')](_0x23f60c['query'][_0x3090('0x47')]);_0x33b9f8[_0x3090('0x48')]=qs[_0x3090('0x40')](_[_0x3090('0x49')](_0x23f60c['query'],_0x35cb35[_0x3090('0x40')]));if(_0x23f60c['query']['filter']){_0x33b9f8[_0x3090('0x48')]=_[_0x3090('0x4b')](_0x33b9f8[_0x3090('0x48')],{'$or':_['map'](_0x33b9f8[_0x3090('0x42')],function(_0x243dbf){var _0x46467b={};_0x46467b[_0x243dbf]={'$like':'%'+_0x23f60c[_0x3090('0x3f')][_0x3090('0x4a')]+'%'};return _0x46467b;})});}_0x33b9f8=_[_0x3090('0x4b')]({},_0x33b9f8,_0x23f60c[_0x3090('0x54')]);return _0x571cea[_0x3090('0x127')](_0x33b9f8);}})[_0x3090('0x20')](function(_0x12e2ba){if(_0x12e2ba){_0x3a827d=_0x12e2ba[_0x3090('0x44')];if(!_0x23f60c[_0x3090('0x3f')][_0x3090('0x66')]('nolimit')){_0x33b9f8['limit']=qs[_0x3090('0x31')](_0x23f60c[_0x3090('0x3f')][_0x3090('0x31')]);_0x33b9f8[_0x3090('0x2e')]=qs[_0x3090('0x2e')](_0x23f60c[_0x3090('0x3f')][_0x3090('0x2e')]);}return _0x571cea[_0x3090('0x127')](_0x33b9f8);}})['then'](function(_0x5eb3d8){if(_0x5eb3d8){return _0x5eb3d8?{'count':_0x3a827d,'rows':_0x5eb3d8}:null;}})[_0x3090('0x20')](respondWithResult(_0x1e6d2e,null))[_0x3090('0x2a')](handleError(_0x1e6d2e,null));};exports[_0x3090('0x128')]=function(_0x1c3a1f,_0x5a1663,_0x4fb937){return db[_0x3090('0x129')][_0x3090('0x55')]({'where':{'id':_0x1c3a1f[_0x3090('0x50')]['id']}})[_0x3090('0x20')](handleEntityNotFound(_0x5a1663,null))['then'](function(_0x16b458){if(_0x16b458){return _0x16b458['addProactiveActions'](_0x1c3a1f[_0x3090('0x57')][_0x3090('0x6b')],_[_0x3090('0xfa')](_0x1c3a1f[_0x3090('0x57')],['ids','id'])||{});}})[_0x3090('0x20')](respondWithResult(_0x5a1663,null))[_0x3090('0x2a')](handleError(_0x5a1663,null));};exports['getProactiveActions']=function(_0x241bc5,_0x20ddc3,_0x11a129){var _0x2b14b0={};var _0x4e2a52={};var _0x332301;var _0x17c3ce;return db[_0x3090('0x51')][_0x3090('0x65')]({'where':{'id':_0x241bc5[_0x3090('0x50')]['id']}})['then'](handleEntityNotFound(_0x20ddc3,null))[_0x3090('0x20')](function(_0x400fd5){if(_0x400fd5){_0x332301=_0x400fd5;_0x4e2a52[_0x3090('0x41')]=_['keys'](db[_0x3090('0x12a')]['rawAttributes']);_0x4e2a52[_0x3090('0x3f')]=_[_0x3090('0x52')](_0x241bc5[_0x3090('0x3f')]);_0x4e2a52[_0x3090('0x40')]=_[_0x3090('0x53')](_0x4e2a52[_0x3090('0x41')],_0x4e2a52[_0x3090('0x3f')]);_0x2b14b0[_0x3090('0x42')]=_[_0x3090('0x53')](_0x4e2a52[_0x3090('0x41')],qs[_0x3090('0x43')](_0x241bc5[_0x3090('0x3f')]['fields']));_0x2b14b0[_0x3090('0x42')]=_0x2b14b0[_0x3090('0x42')]['length']?_0x2b14b0[_0x3090('0x42')]:_0x4e2a52[_0x3090('0x41')];_0x2b14b0['order']=qs[_0x3090('0x47')](_0x241bc5[_0x3090('0x3f')][_0x3090('0x47')]);_0x2b14b0['where']=qs['filters'](_['pick'](_0x241bc5[_0x3090('0x3f')],_0x4e2a52['filters']));if(_0x241bc5[_0x3090('0x3f')][_0x3090('0x4a')]){_0x2b14b0[_0x3090('0x48')]=_[_0x3090('0x4b')](_0x2b14b0[_0x3090('0x48')],{'$or':_['map'](_0x2b14b0['attributes'],function(_0x26b927){var _0x27a3a2={};_0x27a3a2[_0x26b927]={'$like':'%'+_0x241bc5[_0x3090('0x3f')][_0x3090('0x4a')]+'%'};return _0x27a3a2;})});}_0x2b14b0=_['merge']({},_0x2b14b0,_0x241bc5['options']);return _0x332301[_0x3090('0x111')](_0x2b14b0);}})[_0x3090('0x20')](function(_0x5647c1){if(_0x5647c1){_0x17c3ce=_0x5647c1[_0x3090('0x44')];if(!_0x241bc5[_0x3090('0x3f')][_0x3090('0x66')]('nolimit')){_0x2b14b0[_0x3090('0x31')]=qs[_0x3090('0x31')](_0x241bc5[_0x3090('0x3f')][_0x3090('0x31')]);_0x2b14b0[_0x3090('0x2e')]=qs[_0x3090('0x2e')](_0x241bc5[_0x3090('0x3f')]['offset']);}return _0x332301[_0x3090('0x111')](_0x2b14b0);}})[_0x3090('0x20')](function(_0xb936a7){if(_0xb936a7){return _0xb936a7?{'count':_0x17c3ce,'rows':_0xb936a7}:null;}})[_0x3090('0x20')](respondWithResult(_0x20ddc3,null))[_0x3090('0x2a')](handleError(_0x20ddc3,null));};exports[_0x3090('0x12b')]=function(_0x1f970e,_0x2727e1,_0x2a11cc){var _0x1e79ac=_0x1f970e[_0x3090('0x3f')]['online']===_0x3090('0x12c')?_0x3090('0x12d'):'onlineForm';return db[_0x3090('0x51')]['find']({'attributes':['id',_0x1e79ac],'where':{'id':_0x1f970e['params']['id']}})[_0x3090('0x20')](handleEntityNotFound(_0x2727e1,null))['then'](function(_0x2a833a){if(_0x2a833a){var _0x5036c2=_0x2a833a[_0x1e79ac];var _0x1d91b4=_0x5036c2&&_0x5036c2[_0x3090('0x12e')]?_0x5036c2[_0x3090('0x12e')]:[];_0x2727e1[_0x3090('0xcf')]({'fromKey':_[_0x3090('0x7b')](_0x5036c2[_0x3090('0x12f')])?undefined:_0x5036c2['fromKey'],'count':_0x1d91b4[_0x3090('0x44')],'rows':_0x1d91b4});}})['catch'](handleError(_0x2727e1,null));};exports[_0x3090('0x130')]=function(_0x4c9531,_0x5281f5,_0x17e202){var _0x4dea3f={'raw':![],'where':{}};var _0x231e17={};var _0x1f71a6={'count':0x0,'rows':[]};return db[_0x3090('0x51')][_0x3090('0x65')]({'where':{'id':_0x4c9531[_0x3090('0x50')]['id']}})[_0x3090('0x20')](handleEntityNotFound(_0x5281f5,null))['then'](function(_0x1849c8){if(_0x1849c8){_0x231e17[_0x3090('0x41')]=_[_0x3090('0x52')](db['ChatOfflineMessage']['rawAttributes']);_0x231e17['query']=_[_0x3090('0x52')](_0x4c9531['query']);_0x231e17['filters']=_[_0x3090('0x53')](_0x231e17['model'],_0x231e17[_0x3090('0x3f')]);_0x4dea3f[_0x3090('0x42')]=_[_0x3090('0x53')](_0x231e17[_0x3090('0x41')],qs[_0x3090('0x43')](_0x4c9531[_0x3090('0x3f')][_0x3090('0x43')]));_0x4dea3f['attributes']=_0x4dea3f['attributes'][_0x3090('0x44')]?_0x4dea3f[_0x3090('0x42')]:_0x231e17[_0x3090('0x41')];if(!_0x4c9531[_0x3090('0x3f')]['hasOwnProperty'](_0x3090('0x45'))){_0x4dea3f[_0x3090('0x31')]=qs['limit'](_0x4c9531[_0x3090('0x3f')][_0x3090('0x31')]);_0x4dea3f['offset']=qs['offset'](_0x4c9531[_0x3090('0x3f')][_0x3090('0x2e')]);}_0x4dea3f[_0x3090('0x46')]=qs[_0x3090('0x47')](_0x4c9531[_0x3090('0x3f')][_0x3090('0x47')]);_0x4dea3f[_0x3090('0x48')]=qs[_0x3090('0x40')](_[_0x3090('0x49')](_0x4c9531['query'],_0x231e17['filters']));_0x4dea3f[_0x3090('0x48')][_0x3090('0x63')]=_0x1849c8['id'];if(_0x4c9531[_0x3090('0x3f')][_0x3090('0x4a')]){_0x4dea3f[_0x3090('0x48')]=_[_0x3090('0x4b')](_0x4dea3f[_0x3090('0x48')],{'$or':_['map'](_0x4dea3f['attributes'],function(_0x37dc40){var _0x20638a={};_0x20638a[_0x37dc40]={'$like':'%'+_0x4c9531[_0x3090('0x3f')][_0x3090('0x4a')]+'%'};return _0x20638a;})});}_0x4dea3f=_[_0x3090('0x4b')]({},_0x4dea3f,_0x4c9531[_0x3090('0x54')]);return db[_0x3090('0xda')][_0x3090('0x30')]({'where':_0x4dea3f[_0x3090('0x48')]})['then'](function(_0x42a2f1){_0x1f71a6['count']=_0x42a2f1;if(_0x4c9531[_0x3090('0x3f')][_0x3090('0x4d')]){_0x4dea3f[_0x3090('0x4e')]=[{'all':!![]}];}else{_0x4dea3f[_0x3090('0x4e')]=[{'model':db['CmContact'],'as':_0x3090('0xfc'),'required':![]},{'model':db[_0x3090('0xde')],'as':_0x3090('0x131'),'required':![]}];}return db[_0x3090('0xda')][_0x3090('0x68')](_0x4dea3f);})['then'](function(_0x450453){_0x1f71a6['rows']=_0x450453;return _0x1f71a6;});}})[_0x3090('0x20')](respondWithFilteredResult(_0x5281f5,_0x4dea3f))['catch'](handleError(_0x5281f5,null));};exports[_0x3090('0x132')]=function(_0x12e210,_0x155f20,_0x5c2743){return db[_0x3090('0x51')][_0x3090('0x55')]({'where':{'id':_0x12e210['params']['id']}})[_0x3090('0x20')](handleEntityNotFound(_0x155f20,null))[_0x3090('0x20')](function(_0x135206){if(_0x135206){return _0x135206['addAgents'](_0x12e210[_0x3090('0x57')][_0x3090('0x6b')],_[_0x3090('0xfa')](_0x12e210[_0x3090('0x57')],['ids','id'])||{})['spread'](function(_0x5c5c0b){for(var _0xb2faa2=0x0;_0xb2faa2<_0x12e210['body']['ids'][_0x3090('0x44')];_0xb2faa2+=0x1){socket[_0x3090('0x133')](_0x3090('0x134'),{'UserId':Number(_0x12e210[_0x3090('0x57')][_0x3090('0x6b')][_0xb2faa2]),'ChatWebsiteId':Number(_0x12e210[_0x3090('0x50')]['id'])});}return _0x5c5c0b;});}})[_0x3090('0x20')](respondWithResult(_0x155f20,null))['catch'](handleError(_0x155f20,null));};exports[_0x3090('0x135')]=function(_0x1f83cc,_0x2f26ad,_0x4461b8){return db[_0x3090('0x51')][_0x3090('0x55')]({'where':{'id':_0x1f83cc[_0x3090('0x50')]['id']}})[_0x3090('0x20')](handleEntityNotFound(_0x2f26ad,null))[_0x3090('0x20')](function(_0x362264){if(_0x362264){return _0x362264[_0x3090('0x135')](_0x1f83cc[_0x3090('0x3f')]['ids'])[_0x3090('0x20')](function(){if(_[_0x3090('0x136')](_0x1f83cc[_0x3090('0x3f')]['ids'])){for(var _0x79f534=0x0;_0x79f534<_0x1f83cc[_0x3090('0x3f')]['ids'][_0x3090('0x44')];_0x79f534+=0x1){socket[_0x3090('0x133')](_0x3090('0x137'),{'UserId':Number(_0x1f83cc['query'][_0x3090('0x6b')][_0x79f534]),'ChatWebsiteId':Number(_0x1f83cc[_0x3090('0x50')]['id'])});}}else{socket[_0x3090('0x133')](_0x3090('0x137'),{'UserId':Number(_0x1f83cc[_0x3090('0x3f')][_0x3090('0x6b')]),'ChatWebsiteId':Number(_0x1f83cc[_0x3090('0x50')]['id'])});}});}})[_0x3090('0x20')](respondWithStatusCode(_0x2f26ad,null))['catch'](handleError(_0x2f26ad,null));};exports[_0x3090('0x138')]=function(_0x1a5b96,_0x4fc89b,_0x113d6f){var _0x18eb09={};var _0x3c6111={};var _0x41966c;var _0x1b4ee4;return db[_0x3090('0x51')]['findOne']({'where':{'id':_0x1a5b96[_0x3090('0x50')]['id']}})['then'](handleEntityNotFound(_0x4fc89b,null))[_0x3090('0x20')](function(_0x2666b6){if(_0x2666b6){_0x41966c=_0x2666b6;_0x3c6111[_0x3090('0x41')]=_['keys'](db['User']['rawAttributes']);_0x3c6111[_0x3090('0x3f')]=_[_0x3090('0x52')](_0x1a5b96[_0x3090('0x3f')]);_0x3c6111[_0x3090('0x40')]=_[_0x3090('0x53')](_0x3c6111[_0x3090('0x41')],_0x3c6111[_0x3090('0x3f')]);_0x18eb09[_0x3090('0x42')]=_[_0x3090('0x53')](_0x3c6111['model'],qs[_0x3090('0x43')](_0x1a5b96[_0x3090('0x3f')][_0x3090('0x43')]));_0x18eb09[_0x3090('0x42')]=_0x18eb09['attributes']['length']?_0x18eb09[_0x3090('0x42')]:_0x3c6111['model'];_0x18eb09[_0x3090('0x46')]=qs['sort'](_0x1a5b96[_0x3090('0x3f')]['sort']);_0x18eb09[_0x3090('0x48')]=qs['filters'](_[_0x3090('0x49')](_0x1a5b96['query'],_0x3c6111['filters']));if(_0x1a5b96['query'][_0x3090('0x4a')]){_0x18eb09[_0x3090('0x48')]=_[_0x3090('0x4b')](_0x18eb09[_0x3090('0x48')],{'$or':_['map'](_0x18eb09[_0x3090('0x42')],function(_0x224d20){var _0x8b799e={};_0x8b799e[_0x224d20]={'$like':'%'+_0x1a5b96[_0x3090('0x3f')][_0x3090('0x4a')]+'%'};return _0x8b799e;})});}_0x18eb09=_['merge']({},_0x18eb09,_0x1a5b96['options']);return _0x41966c[_0x3090('0x138')](_0x18eb09);}})[_0x3090('0x20')](function(_0x48fda7){if(_0x48fda7){_0x1b4ee4=_0x48fda7[_0x3090('0x44')];if(!_0x1a5b96[_0x3090('0x3f')][_0x3090('0x66')](_0x3090('0x45'))){_0x18eb09[_0x3090('0x31')]=qs[_0x3090('0x31')](_0x1a5b96[_0x3090('0x3f')][_0x3090('0x31')]);_0x18eb09[_0x3090('0x2e')]=qs[_0x3090('0x2e')](_0x1a5b96[_0x3090('0x3f')][_0x3090('0x2e')]);}return _0x41966c['getAgents'](_0x18eb09);}})[_0x3090('0x20')](function(_0x5d6ba7){if(_0x5d6ba7){return _0x5d6ba7?{'count':_0x1b4ee4,'rows':_0x5d6ba7}:null;}})[_0x3090('0x20')](respondWithResult(_0x4fc89b,null))['catch'](handleError(_0x4fc89b,null));}; \ No newline at end of file +var _0xeecf=['vendor','%s\x20%s\x20%s','threadId','externalUrl','ContactId','interaction','ChatInteraction','spread','contact','lastName','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','EventManager','offline','files','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','ChatOfflineMessage','originalname','mimetype','server','attachments','offline-chat','sequelize','Attachment','Smtp','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','offlineMessageSubject','openNewInteraction','MailAccountId','toPairsIn','subjectOffline','email','Chat','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','tag','getSnippet','iftime\x20%s,%s','interval','timezone','iftime\x20%s','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','getProactiveActions','virtual','chatLicenseExceeded','Intervals','all','server/files/chat/iframe.ejs','remote','x-real-ip','connection','replace','alignment','textColor','backgroundColor','addApplications','transaction','bulkCreate','findAndCountAll','priority','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','offlineForm','onlineForm','items','fromKey','getOfflineMessages','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','destroy','get','UserProfileResource','stack','name','send','index','Pause','ChatWebsite','rawAttributes','fieldName','type','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','VIRTUAL','filter','merge','include','findAll','catch','show','params','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatWebsites','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','mandatoryDispositionPause','describe','ChatWebsiteId','Disposition','getDispositions','options','rows','removeDispositions','CannedAnswer','getAnswers','findOne','removeAnswers','ids','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','root','sitepic','getLicense','custom','isNil','existsSync','join','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','headers','user-agent','getResult','chat','CmContact','ValidationError','no\x20available\x20attributes','updatedAt','difference','createdAt','ListId','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication','Applications','applications','list','orderBy','asc','account','from','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','x-real-port','referer','browser','format','%s\x20%s','version','unknown','device'];(function(_0x270c4f,_0x45a4c9){var _0x33c664=function(_0x568ab4){while(--_0x568ab4){_0x270c4f['push'](_0x270c4f['shift']());}};_0x33c664(++_0x45a4c9);}(_0xeecf,0x7f));var _0xfeec=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xeecf[_0x6c993a];return _0x27f547;};'use strict';var emlformat=require(_0xfeec('0x0'));var rimraf=require(_0xfeec('0x1'));var zipdir=require(_0xfeec('0x2'));var jsonpatch=require(_0xfeec('0x3'));var rp=require(_0xfeec('0x4'));var moment=require(_0xfeec('0x5'));var BPromise=require(_0xfeec('0x6'));var Mustache=require(_0xfeec('0x7'));var util=require(_0xfeec('0x8'));var path=require(_0xfeec('0x9'));var sox=require('sox');var csv=require(_0xfeec('0xa'));var ejs=require(_0xfeec('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfeec('0xc'));var squel=require(_0xfeec('0xd'));var crypto=require(_0xfeec('0xe'));var jsforce=require(_0xfeec('0xf'));var deskjs=require(_0xfeec('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xfeec('0x11'));var Redis=require(_0xfeec('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xfeec('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xfeec('0x14'));var utils=require(_0xfeec('0x15'));var config=require(_0xfeec('0x16'));var licenseUtil=require(_0xfeec('0x17'));var db=require('../../mysqldb')['db'];config[_0xfeec('0x18')]=_[_0xfeec('0x19')](config['redis'],{'host':_0xfeec('0x1a'),'port':0x18eb});var socket=require(_0xfeec('0x1b'))(new Redis(config[_0xfeec('0x18')]));require(_0xfeec('0x1c'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xfeec('0x1d')][_0xfeec('0x1e')]({'port':0x232c});var client9002=jayson[_0xfeec('0x1d')][_0xfeec('0x1e')]({'port':0x232a});var client9003=jayson[_0xfeec('0x1d')][_0xfeec('0x1e')]({'port':0x232b});var client9001=jayson['client']['http']({'port':0x2329});function respondWithRpcPromise(_0x4300f9,_0x2a20ec,_0xcbc84e,_0x44124d){return new BPromise(function(_0xb86ca7,_0x6870aa){var _0x48adcb=_0x44124d||client;return _0x48adcb[_0xfeec('0x1f')](_0x4300f9,_0xcbc84e)[_0xfeec('0x20')](function(_0x5cd6f5){logger[_0xfeec('0x21')](_0xfeec('0x22'),_0x2a20ec,_0xfeec('0x23'));logger[_0xfeec('0x24')](_0xfeec('0x25'),_0x2a20ec,_0xfeec('0x23'),JSON[_0xfeec('0x26')](_0x5cd6f5));if(_0x5cd6f5[_0xfeec('0x27')]){if(_0x5cd6f5[_0xfeec('0x27')][_0xfeec('0x28')]===0x1f4){logger['error'](_0xfeec('0x22'),_0x2a20ec,_0x5cd6f5[_0xfeec('0x27')][_0xfeec('0x29')]);return _0x6870aa(_0x5cd6f5[_0xfeec('0x27')][_0xfeec('0x29')]);}logger[_0xfeec('0x27')](_0xfeec('0x22'),_0x2a20ec,_0x5cd6f5['error'][_0xfeec('0x29')]);return _0xb86ca7(_0x5cd6f5[_0xfeec('0x27')][_0xfeec('0x29')]);}else{logger[_0xfeec('0x21')]('ChatWebsite,\x20%s,\x20%s',_0x2a20ec,_0xfeec('0x23'));_0xb86ca7(_0x5cd6f5[_0xfeec('0x2a')][_0xfeec('0x29')]);}})['catch'](function(_0x2e9e82){logger[_0xfeec('0x27')](_0xfeec('0x22'),_0x2a20ec,_0x2e9e82);_0x6870aa(_0x2e9e82);});});}function respondWithStatusCode(_0x11e619,_0x46e6e3){_0x46e6e3=_0x46e6e3||0xcc;return function(_0x311e5e){if(_0x311e5e){return _0x11e619[_0xfeec('0x2b')](_0x46e6e3);}return _0x11e619[_0xfeec('0x2c')](_0x46e6e3)[_0xfeec('0x2d')]();};}function respondWithResult(_0x92d155,_0x311fdd){_0x311fdd=_0x311fdd||0xc8;return function(_0x4f5dc5){if(_0x4f5dc5){return _0x92d155[_0xfeec('0x2c')](_0x311fdd)['json'](_0x4f5dc5);}};}function respondWithFilteredResult(_0xa1383c,_0x47f9b2){return function(_0x280e0f){if(_0x280e0f){var _0x1dd9d2=typeof _0x47f9b2[_0xfeec('0x2e')]==='undefined'&&typeof _0x47f9b2[_0xfeec('0x2f')]===_0xfeec('0x30');var _0x21714c=_0x280e0f[_0xfeec('0x31')];var _0x92fb10=_0x1dd9d2?0x0:_0x47f9b2[_0xfeec('0x2e')];var _0x3d629a=_0x1dd9d2?_0x280e0f[_0xfeec('0x31')]:_0x47f9b2[_0xfeec('0x2e')]+_0x47f9b2[_0xfeec('0x2f')];var _0x570c06;if(_0x3d629a>=_0x21714c){_0x3d629a=_0x21714c;_0x570c06=0xc8;}else{_0x570c06=0xce;}_0xa1383c[_0xfeec('0x2c')](_0x570c06);return _0xa1383c[_0xfeec('0x32')](_0xfeec('0x33'),_0x92fb10+'-'+_0x3d629a+'/'+_0x21714c)[_0xfeec('0x34')](_0x280e0f);}return null;};}function patchUpdates(_0xa4d15a){return function(_0x8f5407){try{jsonpatch[_0xfeec('0x35')](_0x8f5407,_0xa4d15a,!![]);}catch(_0x17e893){return BPromise[_0xfeec('0x36')](_0x17e893);}return _0x8f5407[_0xfeec('0x37')]();};}function saveUpdates(_0x1d7a4d,_0xbaba27){return function(_0x8a4b36){if(_0x8a4b36){return _0x8a4b36[_0xfeec('0x38')](_0x1d7a4d)[_0xfeec('0x20')](function(_0x52e0be){return _0x52e0be;});}return null;};}function removeEntity(_0x1c05ab,_0x15c902){return function(_0x5250c8){if(_0x5250c8){return _0x5250c8[_0xfeec('0x39')]()['then'](function(){var _0x293478=_0x5250c8[_0xfeec('0x3a')]({'plain':!![]});var _0x26f04c='ChatWebsites';return db[_0xfeec('0x3b')][_0xfeec('0x39')]({'where':{'type':_0x26f04c,'resourceId':_0x293478['id']}})[_0xfeec('0x20')](function(){return _0x5250c8;});})[_0xfeec('0x20')](function(){_0x1c05ab['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x109000,_0x3bd5b5){return function(_0x294726){if(!_0x294726){_0x109000[_0xfeec('0x2b')](0x194);}return _0x294726;};}function handleError(_0x49c1c5,_0x4caa70){_0x4caa70=_0x4caa70||0x1f4;return function(_0x1fbc09){logger[_0xfeec('0x27')](_0x1fbc09[_0xfeec('0x3c')]);if(_0x1fbc09[_0xfeec('0x3d')]){delete _0x1fbc09[_0xfeec('0x3d')];}_0x49c1c5['status'](_0x4caa70)[_0xfeec('0x3e')](_0x1fbc09);};}exports[_0xfeec('0x3f')]=function(_0x4fe3de,_0x2a1ce1){var _0x3eb7ab={'include':[{'model':db[_0xfeec('0x40')],'as':'mandatoryDispositionPause'}]},_0x30ed0d={},_0x346b31={'count':0x0,'rows':[]};var _0x46ae76=_['map'](db[_0xfeec('0x41')][_0xfeec('0x42')],function(_0x560556){return{'name':_0x560556[_0xfeec('0x43')],'type':_0x560556[_0xfeec('0x44')]['key']};});_0x30ed0d[_0xfeec('0x45')]=_[_0xfeec('0x46')](_0x46ae76,'name');_0x30ed0d[_0xfeec('0x47')]=_[_0xfeec('0x48')](_0x4fe3de['query']);_0x30ed0d['filters']=_[_0xfeec('0x49')](_0x30ed0d[_0xfeec('0x45')],_0x30ed0d['query']);_0x3eb7ab[_0xfeec('0x4a')]=_[_0xfeec('0x49')](_0x30ed0d[_0xfeec('0x45')],qs[_0xfeec('0x4b')](_0x4fe3de[_0xfeec('0x47')][_0xfeec('0x4b')]));_0x3eb7ab[_0xfeec('0x4a')]=_0x3eb7ab['attributes'][_0xfeec('0x4c')]?_0x3eb7ab[_0xfeec('0x4a')]:_0x30ed0d['model'];if(!_0x4fe3de[_0xfeec('0x47')][_0xfeec('0x4d')](_0xfeec('0x4e'))){_0x3eb7ab[_0xfeec('0x2f')]=qs[_0xfeec('0x2f')](_0x4fe3de[_0xfeec('0x47')][_0xfeec('0x2f')]);_0x3eb7ab[_0xfeec('0x2e')]=qs[_0xfeec('0x2e')](_0x4fe3de[_0xfeec('0x47')]['offset']);}_0x3eb7ab[_0xfeec('0x4f')]=qs[_0xfeec('0x50')](_0x4fe3de[_0xfeec('0x47')][_0xfeec('0x50')]);_0x3eb7ab[_0xfeec('0x51')]=qs[_0xfeec('0x52')](_[_0xfeec('0x53')](_0x4fe3de[_0xfeec('0x47')],_0x30ed0d[_0xfeec('0x52')]),_0x46ae76);if(_0x4fe3de[_0xfeec('0x47')]['filter']){_0x3eb7ab[_0xfeec('0x51')]=_['merge'](_0x3eb7ab['where'],{'$or':_[_0xfeec('0x46')](_0x46ae76,function(_0x1ab71d){if(_0x1ab71d[_0xfeec('0x44')]!==_0xfeec('0x54')){var _0x2a5486={};_0x2a5486[_0x1ab71d[_0xfeec('0x3d')]]={'$like':'%'+_0x4fe3de['query'][_0xfeec('0x55')]+'%'};return _0x2a5486;}})});}_0x3eb7ab=_[_0xfeec('0x56')]({},_0x3eb7ab,_0x4fe3de['options']);var _0x32182b={'where':_0x3eb7ab[_0xfeec('0x51')]};return db[_0xfeec('0x41')][_0xfeec('0x31')](_0x32182b)[_0xfeec('0x20')](function(_0x52fd1d){_0x346b31[_0xfeec('0x31')]=_0x52fd1d;if(_0x4fe3de[_0xfeec('0x47')]['includeAll']){_0x3eb7ab[_0xfeec('0x57')]=[{'all':!![]}];}return db[_0xfeec('0x41')][_0xfeec('0x58')](_0x3eb7ab);})[_0xfeec('0x20')](function(_0x44e170){_0x346b31['rows']=_0x44e170;return _0x346b31;})['then'](respondWithFilteredResult(_0x2a1ce1,_0x3eb7ab))[_0xfeec('0x59')](handleError(_0x2a1ce1,null));};exports[_0xfeec('0x5a')]=function(_0x138a79,_0x51e1ed){var _0x4ae765={'raw':![],'where':{'id':_0x138a79[_0xfeec('0x5b')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x185450={};_0x185450[_0xfeec('0x45')]=_[_0xfeec('0x48')](db['ChatWebsite'][_0xfeec('0x42')]);_0x185450[_0xfeec('0x47')]=_[_0xfeec('0x48')](_0x138a79[_0xfeec('0x47')]);_0x185450[_0xfeec('0x52')]=_[_0xfeec('0x49')](_0x185450[_0xfeec('0x45')],_0x185450[_0xfeec('0x47')]);_0x4ae765['attributes']=_[_0xfeec('0x49')](_0x185450['model'],qs[_0xfeec('0x4b')](_0x138a79[_0xfeec('0x47')][_0xfeec('0x4b')]));_0x4ae765[_0xfeec('0x4a')]=_0x4ae765[_0xfeec('0x4a')][_0xfeec('0x4c')]?_0x4ae765[_0xfeec('0x4a')]:_0x185450['model'];if(_0x138a79['query'][_0xfeec('0x5c')]){_0x4ae765[_0xfeec('0x57')]=[{'all':!![]}];}_0x4ae765=_[_0xfeec('0x56')]({},_0x4ae765,_0x138a79['options']);return db[_0xfeec('0x41')]['find'](_0x4ae765)['then'](handleEntityNotFound(_0x51e1ed,null))[_0xfeec('0x20')](respondWithResult(_0x51e1ed,null))[_0xfeec('0x59')](handleError(_0x51e1ed,null));};exports[_0xfeec('0x5d')]=function(_0x50b7b5,_0xf96263){return db[_0xfeec('0x41')][_0xfeec('0x5d')](_0x50b7b5[_0xfeec('0x5e')],{})[_0xfeec('0x20')](function(_0x820a73){var _0x472727=_0x50b7b5[_0xfeec('0x5f')][_0xfeec('0x3a')]({'plain':!![]});if(!_0x472727)throw new Error(_0xfeec('0x60'));if(_0x472727[_0xfeec('0x61')]===_0xfeec('0x5f')){var _0x11fead=_0x820a73[_0xfeec('0x3a')]({'plain':!![]});var _0x26a612=_0xfeec('0x62');return db[_0xfeec('0x63')]['find']({'where':{'name':_0x26a612,'userProfileId':_0x472727[_0xfeec('0x64')]},'raw':!![]})[_0xfeec('0x20')](function(_0x2f1329){if(_0x2f1329&&_0x2f1329[_0xfeec('0x65')]===0x0){return db[_0xfeec('0x3b')][_0xfeec('0x5d')]({'name':_0x11fead[_0xfeec('0x3d')],'resourceId':_0x11fead['id'],'type':_0x2f1329[_0xfeec('0x3d')],'sectionId':_0x2f1329['id']},{})[_0xfeec('0x20')](function(){return _0x820a73;});}else{return _0x820a73;}})['catch'](function(_0xd34da5){logger[_0xfeec('0x27')](_0xfeec('0x66'),_0xd34da5);throw _0xd34da5;});}return _0x820a73;})[_0xfeec('0x20')](respondWithResult(_0xf96263,0xc9))[_0xfeec('0x59')](handleError(_0xf96263,null));};exports[_0xfeec('0x38')]=function(_0x51480c,_0x51ebdd){if(_0x51480c[_0xfeec('0x5e')]['id']){delete _0x51480c['body']['id'];}return db[_0xfeec('0x41')][_0xfeec('0x67')]({'where':{'id':_0x51480c[_0xfeec('0x5b')]['id']},'include':[{'model':db[_0xfeec('0x40')],'as':_0xfeec('0x68')}]})['then'](handleEntityNotFound(_0x51ebdd,null))['then'](saveUpdates(_0x51480c[_0xfeec('0x5e')],null))[_0xfeec('0x20')](respondWithResult(_0x51ebdd,null))[_0xfeec('0x59')](handleError(_0x51ebdd,null));};exports[_0xfeec('0x39')]=function(_0x54bd35,_0x111555){return db[_0xfeec('0x41')][_0xfeec('0x67')]({'where':{'id':_0x54bd35[_0xfeec('0x5b')]['id']}})[_0xfeec('0x20')](handleEntityNotFound(_0x111555,null))['then'](removeEntity(_0x111555,null))[_0xfeec('0x59')](handleError(_0x111555,null));};exports[_0xfeec('0x69')]=function(_0x142338,_0x417470){return db['ChatWebsite'][_0xfeec('0x69')]()['then'](respondWithResult(_0x417470,null))['catch'](handleError(_0x417470,null));};exports['addDisposition']=function(_0xf24d8b,_0x588249,_0x52e062){if(_0xf24d8b['body']['id']){delete _0xf24d8b[_0xfeec('0x5e')]['id'];}return db[_0xfeec('0x41')][_0xfeec('0x67')]({'where':{'id':_0xf24d8b[_0xfeec('0x5b')]['id']}})[_0xfeec('0x20')](handleEntityNotFound(_0x588249,null))[_0xfeec('0x20')](function(_0x4e3a11){if(_0x4e3a11){_0xf24d8b[_0xfeec('0x5e')][_0xfeec('0x6a')]=_0x4e3a11['id'];return db[_0xfeec('0x6b')][_0xfeec('0x5d')](_0xf24d8b[_0xfeec('0x5e')]);}})[_0xfeec('0x20')](respondWithResult(_0x588249,null))[_0xfeec('0x59')](handleError(_0x588249,null));};exports[_0xfeec('0x6c')]=function(_0x4a5671,_0x1eec02,_0x27a310){var _0x3eb0b2={'raw':![],'where':{}};var _0x10b7bf={};var _0x4e5ca1={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x4a5671[_0xfeec('0x5b')]['id']}})[_0xfeec('0x20')](handleEntityNotFound(_0x1eec02,null))[_0xfeec('0x20')](function(_0x55095c){if(_0x55095c){_0x10b7bf[_0xfeec('0x45')]=_[_0xfeec('0x48')](db[_0xfeec('0x6b')][_0xfeec('0x42')]);_0x10b7bf[_0xfeec('0x47')]=_[_0xfeec('0x48')](_0x4a5671[_0xfeec('0x47')]);_0x10b7bf['filters']=_[_0xfeec('0x49')](_0x10b7bf[_0xfeec('0x45')],_0x10b7bf['query']);_0x3eb0b2[_0xfeec('0x4a')]=_['intersection'](_0x10b7bf[_0xfeec('0x45')],qs[_0xfeec('0x4b')](_0x4a5671['query']['fields']));_0x3eb0b2['attributes']=_0x3eb0b2[_0xfeec('0x4a')][_0xfeec('0x4c')]?_0x3eb0b2[_0xfeec('0x4a')]:_0x10b7bf[_0xfeec('0x45')];if(!_0x4a5671[_0xfeec('0x47')][_0xfeec('0x4d')]('nolimit')){_0x3eb0b2[_0xfeec('0x2f')]=qs['limit'](_0x4a5671['query']['limit']);_0x3eb0b2['offset']=qs[_0xfeec('0x2e')](_0x4a5671[_0xfeec('0x47')][_0xfeec('0x2e')]);}_0x3eb0b2['order']=qs['sort'](_0x4a5671['query'][_0xfeec('0x50')]);_0x3eb0b2['where']=qs[_0xfeec('0x52')](_[_0xfeec('0x53')](_0x4a5671[_0xfeec('0x47')],_0x10b7bf[_0xfeec('0x52')]));_0x3eb0b2[_0xfeec('0x51')][_0xfeec('0x6a')]=_0x55095c['id'];if(_0x4a5671['query'][_0xfeec('0x55')]){_0x3eb0b2['where']=_[_0xfeec('0x56')](_0x3eb0b2[_0xfeec('0x51')],{'$or':_[_0xfeec('0x46')](_0x3eb0b2[_0xfeec('0x4a')],function(_0x5858ab){var _0x345c41={};_0x345c41[_0x5858ab]={'$like':'%'+_0x4a5671[_0xfeec('0x47')][_0xfeec('0x55')]+'%'};return _0x345c41;})});}_0x3eb0b2=_['merge']({},_0x3eb0b2,_0x4a5671[_0xfeec('0x6d')]);return db[_0xfeec('0x6b')][_0xfeec('0x31')]({'where':_0x3eb0b2[_0xfeec('0x51')]})[_0xfeec('0x20')](function(_0x8b014a){_0x4e5ca1['count']=_0x8b014a;if(_0x4a5671[_0xfeec('0x47')][_0xfeec('0x5c')]){_0x3eb0b2[_0xfeec('0x57')]=[{'all':!![]}];}return db[_0xfeec('0x6b')][_0xfeec('0x58')](_0x3eb0b2);})[_0xfeec('0x20')](function(_0x21e04d){_0x4e5ca1[_0xfeec('0x6e')]=_0x21e04d;return _0x4e5ca1;});}})[_0xfeec('0x20')](respondWithFilteredResult(_0x1eec02,_0x3eb0b2))['catch'](handleError(_0x1eec02,null));};exports[_0xfeec('0x6f')]=function(_0x2834a0,_0x5626f9,_0x587355){return db[_0xfeec('0x41')][_0xfeec('0x67')]({'where':{'id':_0x2834a0[_0xfeec('0x5b')]['id']}})[_0xfeec('0x20')](handleEntityNotFound(_0x5626f9,null))[_0xfeec('0x20')](function(_0x3d49ec){if(_0x3d49ec){return _0x3d49ec[_0xfeec('0x6f')](_0x2834a0[_0xfeec('0x47')]['ids']);}})[_0xfeec('0x20')](respondWithStatusCode(_0x5626f9,null))[_0xfeec('0x59')](handleError(_0x5626f9,null));};exports['addAnswer']=function(_0x19c308,_0x3d56c5,_0x21b332){if(_0x19c308['body']['id']){delete _0x19c308[_0xfeec('0x5e')]['id'];}return db[_0xfeec('0x41')]['find']({'where':{'id':_0x19c308[_0xfeec('0x5b')]['id']}})[_0xfeec('0x20')](handleEntityNotFound(_0x3d56c5,null))[_0xfeec('0x20')](function(_0x4a7f00){if(_0x4a7f00){_0x19c308[_0xfeec('0x5e')][_0xfeec('0x6a')]=_0x4a7f00['id'];return db[_0xfeec('0x70')][_0xfeec('0x5d')](_0x19c308['body']);}})['then'](respondWithResult(_0x3d56c5,null))[_0xfeec('0x59')](handleError(_0x3d56c5,null));};exports[_0xfeec('0x71')]=function(_0x3c8bc8,_0x1856dc,_0x5e2024){var _0x184922={'raw':![],'where':{}};var _0x1578e7={};var _0xabbe5={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xfeec('0x72')]({'where':{'id':_0x3c8bc8[_0xfeec('0x5b')]['id']}})[_0xfeec('0x20')](handleEntityNotFound(_0x1856dc,null))[_0xfeec('0x20')](function(_0x38241b){if(_0x38241b){_0x1578e7[_0xfeec('0x45')]=_[_0xfeec('0x48')](db[_0xfeec('0x70')]['rawAttributes']);_0x1578e7[_0xfeec('0x47')]=_[_0xfeec('0x48')](_0x3c8bc8[_0xfeec('0x47')]);_0x1578e7[_0xfeec('0x52')]=_[_0xfeec('0x49')](_0x1578e7[_0xfeec('0x45')],_0x1578e7[_0xfeec('0x47')]);_0x184922['attributes']=_['intersection'](_0x1578e7[_0xfeec('0x45')],qs[_0xfeec('0x4b')](_0x3c8bc8['query'][_0xfeec('0x4b')]));_0x184922[_0xfeec('0x4a')]=_0x184922['attributes'][_0xfeec('0x4c')]?_0x184922[_0xfeec('0x4a')]:_0x1578e7[_0xfeec('0x45')];if(!_0x3c8bc8['query'][_0xfeec('0x4d')](_0xfeec('0x4e'))){_0x184922[_0xfeec('0x2f')]=qs[_0xfeec('0x2f')](_0x3c8bc8[_0xfeec('0x47')]['limit']);_0x184922[_0xfeec('0x2e')]=qs[_0xfeec('0x2e')](_0x3c8bc8[_0xfeec('0x47')][_0xfeec('0x2e')]);}_0x184922['order']=qs[_0xfeec('0x50')](_0x3c8bc8[_0xfeec('0x47')][_0xfeec('0x50')]);_0x184922[_0xfeec('0x51')]=qs[_0xfeec('0x52')](_[_0xfeec('0x53')](_0x3c8bc8[_0xfeec('0x47')],_0x1578e7[_0xfeec('0x52')]));_0x184922['where']['ChatWebsiteId']=_0x38241b['id'];if(_0x3c8bc8['query']['filter']){_0x184922[_0xfeec('0x51')]=_[_0xfeec('0x56')](_0x184922['where'],{'$or':_[_0xfeec('0x46')](_0x184922[_0xfeec('0x4a')],function(_0x22e3a0){var _0x2c8669={};_0x2c8669[_0x22e3a0]={'$like':'%'+_0x3c8bc8[_0xfeec('0x47')]['filter']+'%'};return _0x2c8669;})});}_0x184922=_[_0xfeec('0x56')]({},_0x184922,_0x3c8bc8[_0xfeec('0x6d')]);return db[_0xfeec('0x70')][_0xfeec('0x31')]({'where':_0x184922[_0xfeec('0x51')]})[_0xfeec('0x20')](function(_0x52aa70){_0xabbe5[_0xfeec('0x31')]=_0x52aa70;if(_0x3c8bc8[_0xfeec('0x47')]['includeAll']){_0x184922[_0xfeec('0x57')]=[{'all':!![]}];}return db[_0xfeec('0x70')][_0xfeec('0x58')](_0x184922);})[_0xfeec('0x20')](function(_0x39b8f9){_0xabbe5[_0xfeec('0x6e')]=_0x39b8f9;return _0xabbe5;});}})['then'](respondWithFilteredResult(_0x1856dc,_0x184922))[_0xfeec('0x59')](handleError(_0x1856dc,null));};exports[_0xfeec('0x73')]=function(_0x466202,_0x51ce81,_0x32cbb1){return db['ChatWebsite'][_0xfeec('0x67')]({'where':{'id':_0x466202[_0xfeec('0x5b')]['id']}})[_0xfeec('0x20')](handleEntityNotFound(_0x51ce81,null))[_0xfeec('0x20')](function(_0xc3c4a8){if(_0xc3c4a8){return _0xc3c4a8[_0xfeec('0x73')](_0x466202['query'][_0xfeec('0x74')]);}})[_0xfeec('0x20')](respondWithStatusCode(_0x51ce81,null))[_0xfeec('0x59')](handleError(_0x51ce81,null));};exports['addLogo']=function(_0x3464d9,_0x4b068a,_0x5ecdd9){_0x3464d9[_0xfeec('0x5e')]['sitepic']=_0x3464d9[_0xfeec('0x75')][_0xfeec('0x76')];return db[_0xfeec('0x41')][_0xfeec('0x67')]({'where':{'id':_0x3464d9[_0xfeec('0x5b')]['id']}})[_0xfeec('0x20')](handleEntityNotFound(_0x4b068a,null))[_0xfeec('0x20')](saveUpdates(_0x3464d9['body'],null))[_0xfeec('0x20')](respondWithResult(_0x4b068a,null))['catch'](handleError(_0x4b068a,null));};exports[_0xfeec('0x77')]=function(_0x2c0ef1,_0x3c0033,_0x54d2c6){_0x2c0ef1['body'][_0xfeec('0x78')]=_0x2c0ef1['file'][_0xfeec('0x76')];return db[_0xfeec('0x41')]['find']({'where':{'id':_0x2c0ef1['params']['id']}})[_0xfeec('0x20')](handleEntityNotFound(_0x3c0033,null))['then'](saveUpdates(_0x2c0ef1[_0xfeec('0x5e')],null))[_0xfeec('0x20')](respondWithResult(_0x3c0033,null))[_0xfeec('0x59')](handleError(_0x3c0033,null));};exports[_0xfeec('0x79')]=function(_0x5d0a8c,_0x56a345,_0x2e1190){_0x5d0a8c[_0xfeec('0x5e')][_0xfeec('0x7a')]=_0x5d0a8c[_0xfeec('0x75')][_0xfeec('0x76')];return db['ChatWebsite'][_0xfeec('0x67')]({'where':{'id':_0x5d0a8c[_0xfeec('0x5b')]['id']}})[_0xfeec('0x20')](handleEntityNotFound(_0x56a345,null))[_0xfeec('0x20')](saveUpdates(_0x5d0a8c['body'],null))['then'](respondWithResult(_0x56a345,null))[_0xfeec('0x59')](handleError(_0x56a345,null));};exports[_0xfeec('0x7b')]=function(_0x4453ef,_0x57f01e,_0xb7faf1){_0x4453ef['body'][_0xfeec('0x7c')]=_0x4453ef[_0xfeec('0x75')]['filename'];return db[_0xfeec('0x41')]['find']({'where':{'id':_0x4453ef[_0xfeec('0x5b')]['id']}})[_0xfeec('0x20')](handleEntityNotFound(_0x57f01e,null))[_0xfeec('0x20')](saveUpdates(_0x4453ef['body'],null))[_0xfeec('0x20')](respondWithResult(_0x57f01e,null))[_0xfeec('0x59')](handleError(_0x57f01e,null));};exports[_0xfeec('0x7d')]=function(_0x43cb17,_0x5254e3,_0x348fb5){var _0x3d1ba8=path['join'](config[_0xfeec('0x7e')],'server/files/images/logos/default_logo.svg');var _0x2ed1fc={'where':{'id':_0x43cb17['params']['id']},'attributes':['id',_0xfeec('0x7f')],'raw':!![]};var _0x21ebb6=![];return require(_0xfeec('0x17'))[_0xfeec('0x80')]()[_0xfeec('0x20')](function(_0x29f9b1){if(_0x29f9b1){_0x21ebb6=_0x29f9b1[_0xfeec('0x81')];}})[_0xfeec('0x20')](function(){return db[_0xfeec('0x41')]['find'](_0x2ed1fc);})[_0xfeec('0x20')](handleEntityNotFound(_0x5254e3,null))[_0xfeec('0x20')](function(_0x40b43b){if(_0x40b43b){if(!_[_0xfeec('0x82')](_0x40b43b['sitepic'])){if(fs[_0xfeec('0x83')](path[_0xfeec('0x84')](config['root'],_0xfeec('0x85'),_0x40b43b[_0xfeec('0x7f')]))&&_0x21ebb6){_0x3d1ba8=path[_0xfeec('0x84')](config['root'],_0xfeec('0x85'),_0x40b43b['sitepic']);}}return _0x5254e3[_0xfeec('0x86')](_0x3d1ba8);}})[_0xfeec('0x59')](handleError(_0x5254e3,null));};exports[_0xfeec('0x87')]=function(_0x1061af,_0x45db83,_0xb384bc){var _0x566415=path[_0xfeec('0x84')](config[_0xfeec('0x7e')],_0xfeec('0x88'));var _0x14aa9f={'where':{'id':_0x1061af['params']['id']},'attributes':['id',_0xfeec('0x78')],'raw':!![]};return db[_0xfeec('0x41')][_0xfeec('0x67')](_0x14aa9f)[_0xfeec('0x20')](handleEntityNotFound(_0x45db83,null))[_0xfeec('0x20')](function(_0x25879e){if(_0x25879e){if(!_[_0xfeec('0x82')](_0x25879e[_0xfeec('0x78')])){if(fs[_0xfeec('0x83')](path['join'](config[_0xfeec('0x7e')],_0xfeec('0x89'),_0x25879e[_0xfeec('0x78')]))){_0x566415=path[_0xfeec('0x84')](config[_0xfeec('0x7e')],_0xfeec('0x89'),_0x25879e[_0xfeec('0x78')]);}}return _0x45db83['download'](_0x566415);}})['catch'](handleError(_0x45db83,null));};exports[_0xfeec('0x8a')]=function(_0x36ba95,_0xa0ff1b,_0x31dcd5){var _0x5e0675=path['join'](config[_0xfeec('0x7e')],_0xfeec('0x8b'));var _0x335be={'where':{'id':_0x36ba95[_0xfeec('0x5b')]['id']},'attributes':['id',_0xfeec('0x7a'),_0xfeec('0x8c')],'raw':!![]};return db['ChatWebsite'][_0xfeec('0x67')](_0x335be)[_0xfeec('0x20')](handleEntityNotFound(_0xa0ff1b,null))[_0xfeec('0x20')](function(_0x5dc397){if(_0x5dc397){if(!_[_0xfeec('0x82')](_0x5dc397[_0xfeec('0x7a')])){if(fs[_0xfeec('0x83')](path[_0xfeec('0x84')](config[_0xfeec('0x7e')],_0xfeec('0x89'),_0x5dc397[_0xfeec('0x7a')]))&&_0x5dc397[_0xfeec('0x8c')]){_0x5e0675=path[_0xfeec('0x84')](config[_0xfeec('0x7e')],_0xfeec('0x89'),_0x5dc397['customerAvatar']);}}return _0xa0ff1b[_0xfeec('0x86')](_0x5e0675);}})[_0xfeec('0x59')](handleError(_0xa0ff1b,null));};exports['getSystemAvatar']=function(_0x346621,_0x327e0f,_0x236ab8){var _0x10eb4b=path[_0xfeec('0x84')](config[_0xfeec('0x7e')],_0xfeec('0x8d'));var _0x22386e={'where':{'id':_0x346621[_0xfeec('0x5b')]['id']},'attributes':['id',_0xfeec('0x7c')],'raw':!![]};return db[_0xfeec('0x41')][_0xfeec('0x67')](_0x22386e)[_0xfeec('0x20')](handleEntityNotFound(_0x327e0f,null))[_0xfeec('0x20')](function(_0x5427ee){if(_0x5427ee){if(!_[_0xfeec('0x82')](_0x5427ee[_0xfeec('0x7c')])){if(fs[_0xfeec('0x83')](path[_0xfeec('0x84')](config[_0xfeec('0x7e')],'server/files/images/avatars/',_0x5427ee[_0xfeec('0x7c')]))){_0x10eb4b=path['join'](config[_0xfeec('0x7e')],_0xfeec('0x89'),_0x5427ee[_0xfeec('0x7c')]);}}return _0x327e0f[_0xfeec('0x86')](_0x10eb4b);}})[_0xfeec('0x59')](handleError(_0x327e0f,null));};exports[_0xfeec('0x8e')]=function(_0x4ca695,_0x256b36,_0x507f45){var _0x776241=require(_0xfeec('0x8f'));var _0x4aa2e6=new _0x776241();var _0x4aa12d=_0x4aa2e6['setUA'](_0x4ca695[_0xfeec('0x90')][_0xfeec('0x91')])[_0xfeec('0x92')]();var _0xb1db84={'body':_0x4ca695[_0xfeec('0x5e')],'channel':_0xfeec('0x93')};var _0xc811c=[];var _0x1892da=[];var _0x261314={};var _0x1b6031=![];return db[_0xfeec('0x94')][_0xfeec('0x69')]()[_0xfeec('0x20')](function(_0x16b791){if(!_0x16b791){throw new db['Sequelize'][(_0xfeec('0x95'))](_0xfeec('0x96'));}_0xc811c=_['difference'](_['keys'](_0x16b791),['createdAt',_0xfeec('0x97')]);_0x1892da=_[_0xfeec('0x98')](_[_0xfeec('0x48')](_0x16b791),[_0xfeec('0x99'),_0xfeec('0x97'),'CompanyId',_0xfeec('0x9a')]);if(_0x4ca695[_0xfeec('0x5e')]['id']){delete _0x4ca695[_0xfeec('0x5e')]['id'];}if(_[_0xfeec('0x82')](_0x4ca695[_0xfeec('0x5e')]['from'])){throw new db[(_0xfeec('0x9b'))][(_0xfeec('0x95'))](_0xfeec('0x9c'));}if(_[_0xfeec('0x82')](_0x4ca695[_0xfeec('0x5e')]['body'])||_0x4ca695[_0xfeec('0x5e')]['body']===''){throw new db[(_0xfeec('0x9b'))]['ValidationError'](_0xfeec('0x9d'));}if(_[_0xfeec('0x82')](_0x4ca695[_0xfeec('0x5e')]['mapKey'])){throw new db[(_0xfeec('0x9b'))][(_0xfeec('0x95'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1892da);}if(!_[_0xfeec('0x9e')](_0x1892da,_0x4ca695[_0xfeec('0x5e')][_0xfeec('0x9f')])){throw new db['Sequelize'][(_0xfeec('0x95'))](_0xfeec('0xa0')+_0x1892da);}_0x261314[_0x4ca695[_0xfeec('0x5e')]['mapKey']]=_0x4ca695[_0xfeec('0x5e')]['from'];})[_0xfeec('0x20')](function(){return db[_0xfeec('0x41')][_0xfeec('0x67')]({'where':{'id':_0x4ca695[_0xfeec('0x5b')]['id']},'include':[{'model':db[_0xfeec('0xa1')],'as':_0xfeec('0xa2'),'include':[{'model':db['CmContact'],'as':_0xfeec('0xa3'),'where':_0x261314,'limit':0x1,'order':[[_0xfeec('0x97'),_0xfeec('0xa4')]]}]},{'model':db[_0xfeec('0xa5')],'as':_0xfeec('0xa6')}]});})[_0xfeec('0x20')](handleEntityNotFound(_0x256b36,null))['then'](function(_0x4618c1){if(_0x4618c1&&_0x4618c1[_0xfeec('0xa2')]){_0xb1db84['account']=_0x4618c1;_0xb1db84[_0xfeec('0xa7')]=_0x4618c1[_0xfeec('0xa6')];_0xb1db84[_0xfeec('0xa8')]=_0x4618c1[_0xfeec('0xa2')];_0xb1db84[_0xfeec('0xa7')]=_[_0xfeec('0xa9')](_0xb1db84[_0xfeec('0xa7')],['priority'],[_0xfeec('0xaa')]);if(_0xb1db84[_0xfeec('0xab')][_0xfeec('0xa6')]){delete _0xb1db84[_0xfeec('0xab')][_0xfeec('0xa6')];}if(_0xb1db84[_0xfeec('0xab')][_0xfeec('0xa2')]&&_0xb1db84['account'][_0xfeec('0xa2')][_0xfeec('0xa3')]['length']){return _0xb1db84['account']['List']['Contacts'][0x0];}var _0x43e75f=_[_0xfeec('0x19')](_0x4ca695['body'],{'firstName':_0x4ca695[_0xfeec('0x5e')][_0xfeec('0xac')],'ListId':_0x4618c1['ListId']});_0x43e75f[_0x4ca695['body'][_0xfeec('0x9f')]]=_0x4ca695[_0xfeec('0x5e')][_0xfeec('0xac')];return db[_0xfeec('0x94')][_0xfeec('0x5d')](_0x43e75f,{'fields':_0xc811c,'raw':!![]});}})['then'](handleEntityNotFound(_0x256b36,null))[_0xfeec('0x20')](function(_0x51c58c){_0xb1db84['contact']=_0x51c58c;var _0xf33d08=_0x4ca695[_0xfeec('0x5e')][_0xfeec('0xad')];if(_0x4ca695[_0xfeec('0x90')][_0xfeec('0xae')]){_0xf33d08=_0x4ca695['headers'][_0xfeec('0xae')];}else if(_0x4ca695['headers'][_0xfeec('0xaf')]){_0xf33d08=_[_0xfeec('0xb0')](_0x4ca695[_0xfeec('0x90')][_0xfeec('0xaf')][_0xfeec('0xb1')](','));}if(_0x51c58c){var _0x29f214={'ContactId':_0x51c58c['id'],'ChatWebsiteId':_0x4ca695[_0xfeec('0x5b')]['id'],'from':(_0x51c58c[_0xfeec('0xb2')]||'')+'\x20'+(_0x51c58c['lastName']||''),'customerIp':_0xf33d08,'customerPort':_0x4ca695[_0xfeec('0x90')]['x-real-port']?_0x4ca695[_0xfeec('0x90')][_0xfeec('0xb3')]:null,'referer':_0x4ca695['body'][_0xfeec('0xb4')],'browserName':_0x4aa12d[_0xfeec('0xb5')][_0xfeec('0x3d')]&&_0x4aa12d[_0xfeec('0xb5')]['version']?util[_0xfeec('0xb6')](_0xfeec('0xb7'),_0x4aa12d[_0xfeec('0xb5')][_0xfeec('0x3d')],_0x4aa12d[_0xfeec('0xb5')][_0xfeec('0xb8')]):_0xfeec('0xb9'),'browserVersion':_0x4aa12d[_0xfeec('0xb5')][_0xfeec('0xb8')]||_0xfeec('0xb9'),'osName':util[_0xfeec('0xb6')](_0xfeec('0xb7'),_0x4aa12d['os']['name'],_0x4aa12d['os'][_0xfeec('0xb8')]),'osVersion':_0x4aa12d['os'][_0xfeec('0xb8')],'deviceModel':_0x4aa12d[_0xfeec('0xba')][_0xfeec('0x45')]&&_0x4aa12d['device'][_0xfeec('0xbb')]?util[_0xfeec('0xb6')](_0xfeec('0xbc'),_0x4aa12d[_0xfeec('0xba')][_0xfeec('0x45')],_0x4aa12d[_0xfeec('0xba')][_0xfeec('0xbb')],_0x4aa12d['device'][_0xfeec('0x44')]):null,'deviceVendor':_0x4aa12d[_0xfeec('0xba')][_0xfeec('0xbb')],'deviceType':_0x4aa12d['device'][_0xfeec('0x44')],'formData':JSON[_0xfeec('0x26')](_0x4ca695[_0xfeec('0x5e')])};var _0x2e1bd8={'ChatWebsiteId':_0x4ca695[_0xfeec('0x5b')]['id'],'closed':![]};if(_0x4ca695[_0xfeec('0x5e')][_0xfeec('0xbd')]){_0x2e1bd8[_0xfeec('0xbd')]=_0x4ca695[_0xfeec('0x5e')][_0xfeec('0xbd')];return db['ChatInteraction']['find']({'where':_0x2e1bd8})[_0xfeec('0x20')](function(_0x1d74b8){if(_0x1d74b8){return[_0x1d74b8,![]];}_0x29f214[_0xfeec('0xbd')]=_0x4ca695[_0xfeec('0x5e')][_0xfeec('0xbd')];_0x29f214['externalUrl']=_0x4ca695[_0xfeec('0x5e')][_0xfeec('0xbe')];return db['ChatInteraction'][_0xfeec('0x5d')](_0x29f214)['then'](function(_0x4f6ca8){return[_0x4f6ca8,!![]];});});}_0x2e1bd8[_0xfeec('0xbf')]=_0x51c58c['id'];if(_0x4ca695[_0xfeec('0x5e')][_0xfeec('0xc0')]&&_0x4ca695[_0xfeec('0x5e')]['interaction']['id']){_0x2e1bd8['id']=_0x4ca695[_0xfeec('0x5e')][_0xfeec('0xc0')]['id'];return db[_0xfeec('0xc1')][_0xfeec('0x67')]({'where':_0x2e1bd8})[_0xfeec('0x20')](function(_0x2d081e){if(_0x2d081e){return[_0x2d081e,![]];}return db['ChatInteraction'][_0xfeec('0x5d')](_0x29f214)[_0xfeec('0x20')](function(_0x461fdb){return[_0x461fdb,!![]];});});}return db['ChatInteraction'][_0xfeec('0x5d')](_0x29f214)[_0xfeec('0x20')](function(_0x598926){return[_0x598926,!![]];});}})[_0xfeec('0xc2')](function(_0x3d5617,_0x20caf0){if(_0x3d5617){_0x1b6031=_0x20caf0;if(!_0x20caf0){var _0x11008b={'from':(_0xb1db84[_0xfeec('0xc3')][_0xfeec('0xb2')]||'')+'\x20'+(_0xb1db84[_0xfeec('0xc3')][_0xfeec('0xc4')]||'')};if(_0x4ca695[_0xfeec('0x5e')][_0xfeec('0xbd')]&&_0x4ca695[_0xfeec('0x5e')][_0xfeec('0xc5')]&&_0x4ca695['body'][_0xfeec('0xbd')]!=_0x4ca695[_0xfeec('0x5e')][_0xfeec('0xc5')]){_0x11008b['threadId']=_0x4ca695[_0xfeec('0x5e')]['messageId'];}return _0x3d5617[_0xfeec('0x38')](_0x11008b);}else{return _0x3d5617;}}})[_0xfeec('0x20')](function(_0x4a5c03){_0xb1db84['interaction']=_0x4a5c03[_0xfeec('0x3a')]({'plain':!![]});_0xb1db84[_0xfeec('0xc0')]['created']=_0x1b6031;if(_0xb1db84['interaction'][_0xfeec('0xc6')]){if(_0xb1db84['account'][_0xfeec('0xc7')]){_0xb1db84['applications'][_0xfeec('0xc8')]({'id':0x0,'priority':_0xb1db84[_0xfeec('0xa7')]['length']+0x1,'app':_0xfeec('0xc9'),'appdata':_0xfeec('0xca'),'interval':_0xfeec('0xcb')});}}return db[_0xfeec('0xcc')][_0xfeec('0x5d')]({'body':_0x4ca695['body']['body'],'ChatWebsiteId':_0x4ca695['params']['id'],'ChatInteractionId':_0x4a5c03['id'],'direction':'in','ContactId':_0xb1db84[_0xfeec('0xc3')]['id'],'AttachmentId':_0x4ca695[_0xfeec('0x5e')][_0xfeec('0xcd')]});})[_0xfeec('0x20')](function(_0x4a9c2c){_0xb1db84['message']=_0x4a9c2c;if(_0xb1db84[_0xfeec('0xc0')][_0xfeec('0xce')]){return db[_0xfeec('0xcf')][_0xfeec('0x67')]({'attributes':['id',_0xfeec('0x3d')],'where':{'id':_0xb1db84[_0xfeec('0xc0')][_0xfeec('0xce')]}})[_0xfeec('0x20')](function(_0x1df2f7){if(_0x1df2f7){_0xb1db84[_0xfeec('0xa7')][_0xfeec('0xd0')]({'id':0x0,'priority':0x0,'app':_0xfeec('0xd1'),'appdata':_0x1df2f7['name']+','+(_0xb1db84[_0xfeec('0xab')][_0xfeec('0xd2')]||0xa),'interval':_0xfeec('0xcb')});_0xb1db84['forcedOwnership']=!![];}return respondWithRpcPromise(_0xfeec('0xd3'),_0xfeec('0xd4'),_0xb1db84);});}return respondWithRpcPromise(_0xfeec('0xd3'),'startRouting',_0xb1db84);})['then'](function(_0x2598bc){respondWithRpcPromise(_0xfeec('0xd5'),_0xfeec('0xd5'),{'event':_0xfeec('0x8e'),'message':_0x2598bc},client9002);return _0x2598bc;})[_0xfeec('0x20')](respondWithResult(_0x256b36,null))[_0xfeec('0x59')](handleError(_0x256b36,null));};exports[_0xfeec('0xd6')]=function(_0x2438c7,_0x1d3a72,_0x58161b){var _0x237334,_0x2d9a9f,_0x1ffe4e;var _0x15702c=[];var _0x5f43f8=[];var _0x3dadad={};var _0x98d80c=_0x2438c7[_0xfeec('0xd7')]||[];var _0x1ef898=[];var _0x1523d9;return db[_0xfeec('0x94')]['describe']()[_0xfeec('0x20')](function(_0x1f00f8){if(!_0x1f00f8){throw new db['Sequelize'][(_0xfeec('0x95'))](_0xfeec('0x96'));}_0x5f43f8=_[_0xfeec('0x98')](_[_0xfeec('0x48')](_0x1f00f8),[_0xfeec('0x99'),_0xfeec('0x97')]);_0x15702c=_['difference'](_['keys'](_0x1f00f8),[_0xfeec('0x99'),_0xfeec('0x97'),'CompanyId',_0xfeec('0x9a')]);if(_0x2438c7[_0xfeec('0x5e')]['id']){delete _0x2438c7['body']['id'];}if(_[_0xfeec('0x82')](_0x2438c7[_0xfeec('0x5e')][_0xfeec('0xac')])){throw _0x1d3a72['status'](0x1f4)[_0xfeec('0x3e')](new db[(_0xfeec('0x9b'))][(_0xfeec('0x95'))]('from\x20is\x20mandatory'));}if(_[_0xfeec('0x82')](_0x2438c7[_0xfeec('0x5e')]['body'])||_0x2438c7[_0xfeec('0x5e')]['body']===''){throw _0x1d3a72[_0xfeec('0x2c')](0x1f4)[_0xfeec('0x3e')](new db['Sequelize']['ValidationError'](_0xfeec('0x9d')));}if(_['isNil'](_0x2438c7[_0xfeec('0x5e')]['mapKeyOffline'])){throw _0x1d3a72[_0xfeec('0x2c')](0x1f4)[_0xfeec('0x3e')](new db[(_0xfeec('0x9b'))][(_0xfeec('0x95'))](_0xfeec('0xd8')+_0x15702c));}if(!_[_0xfeec('0x9e')](_0x15702c,_0x2438c7[_0xfeec('0x5e')][_0xfeec('0xd9')])){throw _0x1d3a72[_0xfeec('0x2c')](0x1f4)[_0xfeec('0x3e')](new db[(_0xfeec('0x9b'))][(_0xfeec('0x95'))](_0xfeec('0xda')+_0x15702c));}_0x3dadad[_0x2438c7['body'][_0xfeec('0xd9')]]=_0x2438c7[_0xfeec('0x5e')][_0xfeec('0xac')];})[_0xfeec('0x20')](function(){return db[_0xfeec('0x41')][_0xfeec('0x67')]({'where':{'id':_0x2438c7[_0xfeec('0x5b')]['id']},'include':[{'model':db['CmList'],'as':_0xfeec('0xa2')},{'model':db[_0xfeec('0xdb')],'as':'MailAccount'}]});})['then'](handleEntityNotFound(_0x1d3a72,null))[_0xfeec('0x20')](function(_0x337f97){if(_0x337f97&&_0x337f97['List']){_0x2d9a9f=_0x337f97;var _0x45a265=_['defaults'](_0x2438c7[_0xfeec('0x5e')],{'firstName':_0x2438c7['body'][_0xfeec('0xac')],'phone':_0x2438c7[_0xfeec('0x5e')][_0xfeec('0xac')],'ListId':_0x337f97[_0xfeec('0x9a')]});_0x45a265[_0x2438c7[_0xfeec('0x5e')]['mapKeyOffline']]=_0x2438c7[_0xfeec('0x5e')][_0xfeec('0xac')];return db[_0xfeec('0x94')][_0xfeec('0xdc')]({'where':_0x3dadad,'defaults':_0x45a265});}})[_0xfeec('0xc2')](function(_0x36fe3f){if(_0x36fe3f){_0x1ffe4e=_0x36fe3f;var _0x186356=fs[_0xfeec('0xdd')](path[_0xfeec('0x84')](config[_0xfeec('0x7e')],_0xfeec('0xde')),_0xfeec('0xdf'));var _0x4e67f0=ejs[_0xfeec('0xe0')](_0x186356,{'body':_[_0xfeec('0xe1')](_0x2438c7[_0xfeec('0x5e')][_0xfeec('0x5e')]),'bodyTitle':_0x2d9a9f['offlineMessageBody']});return db[_0xfeec('0xe2')]['create']({'body':_0x4e67f0,'ContactId':_0x36fe3f['id'],'ChatWebsiteId':_0x2d9a9f['id']});}})[_0xfeec('0x20')](function(_0x411dce){_0x1523d9=_0x411dce;if(_0x98d80c[_0xfeec('0x4c')]){var _0x526b74=_0x98d80c[_0xfeec('0x46')](function(_0x2bb932){return{'name':_0x2bb932[_0xfeec('0xe3')],'basename':_0x2bb932[_0xfeec('0x76')],'type':_0x2bb932[_0xfeec('0xe4')],'ChatOfflineMessageId':_0x411dce['id']};});_0x1ef898=_0x526b74[_0xfeec('0x46')](_0x392c42=>{var _0x347b39={'filename':_0x392c42[_0xfeec('0x3d')],'path':path[_0xfeec('0x84')](config[_0xfeec('0x7e')],_0xfeec('0xe5'),_0xfeec('0xd7'),_0xfeec('0xe6'),_0xfeec('0xe7'),_0x392c42['basename'])};return _0x347b39;});if(!_0x2d9a9f['openNewInteraction']){return db[_0xfeec('0xe8')]['transaction'](function(_0x49c6fa){return db[_0xfeec('0xe9')]['bulkCreate'](_0x526b74,{'transaction':_0x49c6fa});});}}})[_0xfeec('0x20')](function(){if(_0x1523d9){_0x237334=_0x1523d9;return db[_0xfeec('0xdb')][_0xfeec('0x72')]({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':_0xfeec('0xea'),'raw':!![]}]});}})[_0xfeec('0x20')](function(_0x2c7a5c){if(_0x2c7a5c&&_0x2c7a5c[_0xfeec('0xea')]&&_0x2d9a9f['forwardOffline']&&_0x2d9a9f[_0xfeec('0xeb')]){var _0x38fe94={'tls':{'rejectUnauthorized':![]}};if(_0x2c7a5c[_0xfeec('0xea')]['service']){_0x38fe94[_0xfeec('0xec')]=_0x2c7a5c[_0xfeec('0xea')]['service'];}else{_0x38fe94[_0xfeec('0xed')]=_0x2c7a5c[_0xfeec('0xea')]['host'];_0x38fe94[_0xfeec('0xee')]=_0x2c7a5c[_0xfeec('0xea')][_0xfeec('0xee')];_0x38fe94[_0xfeec('0xef')]=_0x2c7a5c[_0xfeec('0xea')]['secure'];}if(_0x2c7a5c['Smtp'][_0xfeec('0xf0')]){_0x38fe94[_0xfeec('0xf1')]={'user':_0x2c7a5c[_0xfeec('0xea')][_0xfeec('0x5f')],'pass':_0x2c7a5c[_0xfeec('0xea')][_0xfeec('0xf2')]};}return respondWithRpcPromise(_0xfeec('0xf3'),_0xfeec('0xf4'),{'account':_0x38fe94,'message':{'from':util[_0xfeec('0xb6')](_0xfeec('0xf5'),_0x2c7a5c[_0xfeec('0x3d')],_0x2c7a5c['email']||_0x2c7a5c[_0xfeec('0xea')]['user']),'to':_0x2d9a9f[_0xfeec('0xeb')],'subject':_0x2d9a9f[_0xfeec('0xf6')],'html':_0x237334[_0xfeec('0x5e')],'attachments':_0x1ef898}},client9003)['then'](function(){return _0x237334;})[_0xfeec('0x59')](function(_0x13a194){console['error'](_0x13a194);});}})[_0xfeec('0x20')](function(){if(_0x2d9a9f&&_0x2d9a9f[_0xfeec('0xf7')]&&_0x2d9a9f[_0xfeec('0xf8')]){var _0x55cc0d=[];if(_0x98d80c[_0xfeec('0x4c')]){_0x55cc0d=_0x98d80c[_0xfeec('0x46')](function(_0x5367b7){return{'name':_0x5367b7['originalname'],'basename':_0x5367b7[_0xfeec('0x76')],'type':_0x5367b7['mimetype'],'ChatOfflineMessageId':_0x1523d9['id']};});}var _0x25fe8e;if(!_[_0xfeec('0x82')](_0x2d9a9f['subjectOffline'])){var _0x1075db=_[_0xfeec('0x46')](_0x2438c7[_0xfeec('0x5e')],function(_0x4f9174){return _0x4f9174;});var _0x5b5d70=_[_0xfeec('0xf9')](_0x1075db)[0x0];var _0x2bb48f=_['mapValues'](_0x5b5d70,function(_0x17b552){return _0x17b552;});_0x25fe8e=_0x2bb48f[0x1][_0x2d9a9f[_0xfeec('0xfa')]];}var _0x56bc43={'from':_0x1ffe4e[_0xfeec('0xfb')],'firstName':_0x1ffe4e['firstName'],'lastName':_0x1ffe4e[_0xfeec('0xc4')],'mapKey':'email','message':{'from':_0x1ffe4e[_0xfeec('0xfb')],'to':_0x2d9a9f['MailAccount'][_0xfeec('0xfb')],'cc':'','subject':_[_0xfeec('0x82')](_0x25fe8e)?_0x2d9a9f[_0xfeec('0xf6')]:_0x25fe8e,'messageId':'','sentAt':new Date(),'attach':_0x55cc0d[_0xfeec('0x4c')],'attachments':_0x55cc0d,'originChannel':_0xfeec('0xfc'),'ChatWebsiteId':_0x2d9a9f['id'],'ChatOfflineMessageId':_0x237334['id'],'originTo':_0x2d9a9f['MailAccount']['email']},'body':_0x237334[_0xfeec('0x5e')]};var _0x1d4231={'account':{'id':_0x2d9a9f[_0xfeec('0xf8')]},'body':_0x56bc43,'log':'NotifyMailAccount'};return respondWithRpcPromise('NotifyMailAccount',_0xfeec('0xfd'),_0x1d4231,client9001)[_0xfeec('0x20')](function(){return _0x237334;})[_0xfeec('0x59')](function(_0x4ec62d){console[_0xfeec('0x27')](_0x4ec62d);});}return;})[_0xfeec('0x20')](function(){if(_0x237334){return _0x237334;}})[_0xfeec('0x20')](respondWithResult(_0x1d3a72,null))[_0xfeec('0x59')](function(_0x54adf4){console[_0xfeec('0x27')](_0xfeec('0x59'),_0x54adf4);for(var _0x85cc9b of _0x98d80c){var _0xb8020=path[_0xfeec('0x84')](config[_0xfeec('0x7e')],'server',_0xfeec('0xd7'),_0xfeec('0xe6'),_0xfeec('0xe7'),_0x85cc9b['filename']);fs_extra[_0xfeec('0xfe')](_0xb8020)[_0xfeec('0x59')](function(_0x360f5a){console[_0xfeec('0x27')](_0xfeec('0xff'),_0xb8020,_0x360f5a);});}});};exports['addInteraction']=function(_0x176b47,_0x43fc1b,_0x5bb402){return db[_0xfeec('0xc1')][_0xfeec('0x67')]({'where':{'id':_0x176b47['params']['id']}})[_0xfeec('0x20')](handleEntityNotFound(_0x43fc1b,null))[_0xfeec('0x20')](function(_0xebe3a6){if(_0xebe3a6){return _0xebe3a6[_0xfeec('0x100')](_0x176b47[_0xfeec('0x5e')][_0xfeec('0x74')],_[_0xfeec('0x101')](_0x176b47[_0xfeec('0x5e')],[_0xfeec('0x74'),'id'])||{});}})[_0xfeec('0x20')](respondWithResult(_0x43fc1b,null))[_0xfeec('0x59')](handleError(_0x43fc1b,null));};exports[_0xfeec('0x102')]=function(_0x14b558,_0x536514,_0x32a7c6){var _0x1d6c35={'raw':![],'where':{}};var _0x5468fc={};var _0x18f45c={'count':0x0,'rows':[]};return db[_0xfeec('0x41')]['findOne']({'where':{'id':_0x14b558[_0xfeec('0x5b')]['id']}})['then'](handleEntityNotFound(_0x536514,null))['then'](function(_0x5d0a08){if(_0x5d0a08){_0x5468fc['model']=_[_0xfeec('0x48')](db[_0xfeec('0xc1')][_0xfeec('0x42')]);_0x5468fc[_0xfeec('0x47')]=_[_0xfeec('0x48')](_0x14b558[_0xfeec('0x47')]);_0x5468fc[_0xfeec('0x52')]=_[_0xfeec('0x49')](_0x5468fc[_0xfeec('0x45')],_0x5468fc[_0xfeec('0x47')]);_0x1d6c35[_0xfeec('0x4a')]=_['intersection'](_0x5468fc['model'],qs[_0xfeec('0x4b')](_0x14b558[_0xfeec('0x47')]['fields']));_0x1d6c35['attributes']=_0x1d6c35['attributes']['length']?_0x1d6c35[_0xfeec('0x4a')]:_0x5468fc[_0xfeec('0x45')];if(!_0x14b558[_0xfeec('0x47')][_0xfeec('0x4d')](_0xfeec('0x4e'))){_0x1d6c35[_0xfeec('0x2f')]=qs[_0xfeec('0x2f')](_0x14b558['query'][_0xfeec('0x2f')]);_0x1d6c35[_0xfeec('0x2e')]=qs['offset'](_0x14b558[_0xfeec('0x47')][_0xfeec('0x2e')]);}_0x1d6c35[_0xfeec('0x4f')]=qs['sort'](_0x14b558['query'][_0xfeec('0x50')]);_0x1d6c35[_0xfeec('0x51')]=qs[_0xfeec('0x52')](_[_0xfeec('0x53')](_0x14b558['query'],_0x5468fc[_0xfeec('0x52')]));_0x1d6c35[_0xfeec('0x51')][_0xfeec('0x6a')]=_0x5d0a08['id'];if(_0x14b558['query'][_0xfeec('0x55')]){_0x1d6c35['where']=_[_0xfeec('0x56')](_0x1d6c35[_0xfeec('0x51')],{'$or':_[_0xfeec('0x46')](_0x1d6c35[_0xfeec('0x4a')],function(_0x125c99){var _0x580b10={};_0x580b10[_0x125c99]={'$like':'%'+_0x14b558['query'][_0xfeec('0x55')]+'%'};return _0x580b10;})});}_0x1d6c35=_[_0xfeec('0x56')]({},_0x1d6c35,_0x14b558[_0xfeec('0x6d')]);return db[_0xfeec('0xc1')][_0xfeec('0x31')]({'where':_0x1d6c35[_0xfeec('0x51')]})[_0xfeec('0x20')](function(_0x52cc88){_0x18f45c['count']=_0x52cc88;if(_0x14b558[_0xfeec('0x47')][_0xfeec('0x5c')]){_0x1d6c35['include']=[{'model':db[_0xfeec('0x94')],'as':_0xfeec('0x103'),'required':![]},{'model':db[_0xfeec('0xcf')],'as':_0xfeec('0x104'),'attributes':['name',_0xfeec('0x105'),_0xfeec('0x106')],'required':![]},{'model':db[_0xfeec('0x107')],'as':_0xfeec('0x108'),'attributes':['id','name','color'],'where':_0x14b558[_0xfeec('0x47')][_0xfeec('0x109')]?{'id':_0x14b558['query'][_0xfeec('0x109')]}:undefined,'required':_0x14b558[_0xfeec('0x47')]['tag']?!![]:![]}];}return db['ChatInteraction'][_0xfeec('0x58')](_0x1d6c35);})[_0xfeec('0x20')](function(_0x3033ac){_0x18f45c[_0xfeec('0x6e')]=_0x3033ac;return _0x18f45c;});}})[_0xfeec('0x20')](respondWithFilteredResult(_0x536514,_0x1d6c35))['catch'](handleError(_0x536514,null));};function iftimePromise(_0x2f8b17,_0x56d7b5){return respondWithRpcPromise('Command',_0xfeec('0x10a'),{'command':_0x56d7b5['timezone']?util[_0xfeec('0xb6')](_0xfeec('0x10b'),_0x2f8b17[_0xfeec('0x10c')],_0x56d7b5[_0xfeec('0x10d')]):util['format'](_0xfeec('0x10e'),_0x2f8b17['interval'])},client9002)['then'](function(_0x3245c4){var _0x2047b0=_0x3245c4&&_0x3245c4[_0xfeec('0x10f')]('true')>=0x0?!![]:![];logger['info'](_0xfeec('0x110'),_0x56d7b5['id'],_0x2f8b17['id'],_0x2f8b17[_0xfeec('0x10c')],_0x2047b0?_0xfeec('0x111'):_0xfeec('0x112'),_0x56d7b5[_0xfeec('0x10d')]?_0x56d7b5[_0xfeec('0x10d')]:_0xfeec('0x113'));return _0x2047b0;})[_0xfeec('0x59')](function(_0x13bebc){logger[_0xfeec('0x27')](_0xfeec('0x110'),_0x56d7b5['id'],_0x2f8b17['id'],_0x2f8b17[_0xfeec('0x10c')],util[_0xfeec('0x114')](_0x13bebc,{'showHidden':![],'depth':null}),_0x56d7b5['timezone']?_0x56d7b5[_0xfeec('0x10d')]:_0xfeec('0x113'));return![];});}exports[_0xfeec('0x10a')]=function(_0x4a7e78,_0x19b3f2,_0x25ef4d){var _0x304795=0x0;var _0x13b25f=0x0;var _0x1f8964=![];var _0x1eab45;var _0x52d3b8;return db[_0xfeec('0x41')][_0xfeec('0x67')]({'where':{'id':_0x4a7e78[_0xfeec('0x5b')]['id']},'include':[{'model':db[_0xfeec('0x115')],'as':'Interval','include':[{'model':db[_0xfeec('0x115')],'as':'Intervals','attributes':['id',_0xfeec('0x10c')],'raw':!![]}]}]})[_0xfeec('0x20')](handleEntityNotFound(_0x19b3f2,null))['then'](function(_0x347f5f){if(_0x347f5f){_0x1eab45=_0x347f5f;return _0x347f5f[_0xfeec('0x116')]({'raw':!![]});}})['then'](function(_0x30cce4){if(_0x1eab45){if(_0x30cce4){_0x52d3b8=_0x30cce4;}}return require(_0xfeec('0x17'))[_0xfeec('0x80')]();})[_0xfeec('0x20')](function(_0x19bd9d){if(_0x19bd9d){_0x13b25f=_0x19bd9d[_0xfeec('0x117')];_0x1f8964=_0x19bd9d[_0xfeec('0x81')];}})['then'](function(){return db[_0xfeec('0xc1')]['count']({'where':{'closed':![]}});})[_0xfeec('0x20')](function(_0x2d5aee){_0x304795=_0x2d5aee;if(_0x13b25f&&_0x2d5aee>_0x13b25f){return db['License'][_0xfeec('0x72')]({'where':{'id':0x1}})[_0xfeec('0x20')](function(_0x6c64ff){if(_0x6c64ff){_0x6c64ff['increment'](_0xfeec('0x118'));}});}})[_0xfeec('0x20')](function(){if(_0x1eab45[_0xfeec('0x115')]&&_0x1eab45[_0xfeec('0x115')]['Intervals']){var _0xc61bc4=[];for(var _0x2fe39a=0x0;_0x2fe39a<_0x1eab45['Interval']['Intervals'][_0xfeec('0x4c')];_0x2fe39a++){var _0x3ee3a4=_0x1eab45['Interval'][_0xfeec('0x119')][_0x2fe39a][_0xfeec('0x3a')]({'plain':!![]});_0xc61bc4[_0xfeec('0xc8')](iftimePromise(_0x3ee3a4,_0x1eab45));}return BPromise[_0xfeec('0x11a')](_0xc61bc4)[_0xfeec('0x20')](function(_0x5f4e34){return _['some'](_0x5f4e34);});}else{return!![];}})[_0xfeec('0x20')](function(_0xdac022){var _0x2ebcba=fs[_0xfeec('0xdd')](path[_0xfeec('0x84')](config[_0xfeec('0x7e')],_0xfeec('0x11b')),'utf8');var _0x5e274a={'remote':_0x1eab45[_0xfeec('0x11c')],'query':querystring['stringify'](_[_0xfeec('0x56')](_0x1eab45[_0xfeec('0x3a')]({'plain':!![]}),{'customerIp':_0x4a7e78[_0xfeec('0x90')][_0xfeec('0xaf')]||_0x4a7e78[_0xfeec('0x90')][_0xfeec('0x11d')]||_0x4a7e78[_0xfeec('0x11e')]['remoteAddress']||_0x4a7e78['ip'],'referer':_0x4a7e78[_0xfeec('0x90')]['referer'],'openedInteractions':_0x304795,'maxInteractions':_0x13b25f,'virtual':_0x1f8964[_0xfeec('0x117')],'online':_0xdac022,'custom':_0x1f8964}))[_0xfeec('0x11f')](/'/g,'\x5c\x27')};_0x19b3f2[_0xfeec('0x3e')](ejs[_0xfeec('0xe0')](Mustache[_0xfeec('0xe0')](_0x2ebcba,_0x5e274a),{'proactiveActions':_0x52d3b8,'alignment':_0x1eab45[_0xfeec('0x120')],'verticalAlignment':_0x1eab45['verticalAlignment'],'div_color':_0x1eab45['color'],'text_color':_0x1eab45[_0xfeec('0x121')],'button_color':_0x1eab45['color_button'],'background_color':_0x1eab45[_0xfeec('0x122')]}));})[_0xfeec('0x59')](handleError(_0x19b3f2,null));};exports[_0xfeec('0x123')]=function(_0x4d699e,_0x58dc1a,_0x2ce340){return db[_0xfeec('0x41')]['findOne']({'where':{'id':_0x4d699e[_0xfeec('0x5b')]['id']}})[_0xfeec('0x20')](handleEntityNotFound(_0x58dc1a,null))[_0xfeec('0x20')](function(_0x3214a3){if(_0x3214a3){return db['sequelize'][_0xfeec('0x124')](function(_0x3fef75){return db['ChatApplication'][_0xfeec('0x39')]({'where':{'ChatWebsiteId':_0x4d699e[_0xfeec('0x5b')]['id']},'transaction':_0x3fef75})[_0xfeec('0x20')](function(_0x921e3c){var _0x1ff1f5=_[_0xfeec('0x46')](_0x4d699e['body'],function(_0x2271ee){_0x2271ee[_0xfeec('0x6a')]=_0x4d699e[_0xfeec('0x5b')]['id'];return _0x2271ee;});return db[_0xfeec('0xa5')][_0xfeec('0x125')](_0x1ff1f5,{'transaction':_0x3fef75});});})[_0xfeec('0x20')](function(){return db[_0xfeec('0xa5')][_0xfeec('0x126')]({'where':{'ChatWebsiteId':_0x4d699e[_0xfeec('0x5b')]['id']},'order':_0xfeec('0x127')});});}})[_0xfeec('0x20')](respondWithResult(_0x58dc1a,null))[_0xfeec('0x59')](handleError(_0x58dc1a,null));};exports[_0xfeec('0x128')]=function(_0x4f9525,_0x5a0fbf,_0x542675){var _0x4c6232={};var _0x59f15f={};var _0x2aa096;var _0x5eb4da;return db['ChatWebsite']['findOne']({'where':{'id':_0x4f9525[_0xfeec('0x5b')]['id']}})[_0xfeec('0x20')](handleEntityNotFound(_0x5a0fbf,null))[_0xfeec('0x20')](function(_0x170e48){if(_0x170e48){_0x2aa096=_0x170e48;_0x59f15f['model']=_[_0xfeec('0x48')](db[_0xfeec('0xa5')][_0xfeec('0x42')]);_0x59f15f['query']=_[_0xfeec('0x48')](_0x4f9525[_0xfeec('0x47')]);_0x59f15f[_0xfeec('0x52')]=_[_0xfeec('0x49')](_0x59f15f[_0xfeec('0x45')],_0x59f15f[_0xfeec('0x47')]);_0x4c6232['attributes']=_['intersection'](_0x59f15f[_0xfeec('0x45')],qs[_0xfeec('0x4b')](_0x4f9525[_0xfeec('0x47')]['fields']));_0x4c6232[_0xfeec('0x4a')]=_0x4c6232[_0xfeec('0x4a')][_0xfeec('0x4c')]?_0x4c6232[_0xfeec('0x4a')]:_0x59f15f[_0xfeec('0x45')];_0x4c6232['order']=qs[_0xfeec('0x50')](_0x4f9525[_0xfeec('0x47')]['sort']);_0x4c6232[_0xfeec('0x51')]=qs[_0xfeec('0x52')](_[_0xfeec('0x53')](_0x4f9525[_0xfeec('0x47')],_0x59f15f[_0xfeec('0x52')]));if(_0x4f9525[_0xfeec('0x47')][_0xfeec('0x55')]){_0x4c6232[_0xfeec('0x51')]=_[_0xfeec('0x56')](_0x4c6232[_0xfeec('0x51')],{'$or':_[_0xfeec('0x46')](_0x4c6232[_0xfeec('0x4a')],function(_0x3d9b02){var _0x4b277c={};_0x4b277c[_0x3d9b02]={'$like':'%'+_0x4f9525['query'][_0xfeec('0x55')]+'%'};return _0x4b277c;})});}_0x4c6232=_[_0xfeec('0x56')]({},_0x4c6232,_0x4f9525['options']);return _0x2aa096[_0xfeec('0x128')](_0x4c6232);}})[_0xfeec('0x20')](function(_0xc34f3a){if(_0xc34f3a){_0x5eb4da=_0xc34f3a[_0xfeec('0x4c')];if(!_0x4f9525['query'][_0xfeec('0x4d')](_0xfeec('0x4e'))){_0x4c6232[_0xfeec('0x2f')]=qs[_0xfeec('0x2f')](_0x4f9525[_0xfeec('0x47')][_0xfeec('0x2f')]);_0x4c6232[_0xfeec('0x2e')]=qs[_0xfeec('0x2e')](_0x4f9525[_0xfeec('0x47')][_0xfeec('0x2e')]);}return _0x2aa096['getApplications'](_0x4c6232);}})[_0xfeec('0x20')](function(_0x4752cb){if(_0x4752cb){return _0x4752cb?{'count':_0x5eb4da,'rows':_0x4752cb}:null;}})[_0xfeec('0x20')](respondWithResult(_0x5a0fbf,null))['catch'](handleError(_0x5a0fbf,null));};exports[_0xfeec('0x129')]=function(_0xf57c58,_0x25823d,_0x2c2599){return db[_0xfeec('0x12a')][_0xfeec('0x67')]({'where':{'id':_0xf57c58[_0xfeec('0x5b')]['id']}})['then'](handleEntityNotFound(_0x25823d,null))[_0xfeec('0x20')](function(_0x526f92){if(_0x526f92){return _0x526f92[_0xfeec('0x129')](_0xf57c58[_0xfeec('0x5e')][_0xfeec('0x74')],_[_0xfeec('0x101')](_0xf57c58['body'],[_0xfeec('0x74'),'id'])||{});}})[_0xfeec('0x20')](respondWithResult(_0x25823d,null))['catch'](handleError(_0x25823d,null));};exports[_0xfeec('0x116')]=function(_0xed7251,_0x45602a,_0x5b03f8){var _0x35715c={};var _0x56edf4={};var _0x4bcd2c;var _0x9cdba7;return db[_0xfeec('0x41')][_0xfeec('0x72')]({'where':{'id':_0xed7251['params']['id']}})[_0xfeec('0x20')](handleEntityNotFound(_0x45602a,null))[_0xfeec('0x20')](function(_0x12799b){if(_0x12799b){_0x4bcd2c=_0x12799b;_0x56edf4[_0xfeec('0x45')]=_[_0xfeec('0x48')](db[_0xfeec('0x12b')][_0xfeec('0x42')]);_0x56edf4[_0xfeec('0x47')]=_[_0xfeec('0x48')](_0xed7251[_0xfeec('0x47')]);_0x56edf4[_0xfeec('0x52')]=_['intersection'](_0x56edf4[_0xfeec('0x45')],_0x56edf4[_0xfeec('0x47')]);_0x35715c[_0xfeec('0x4a')]=_[_0xfeec('0x49')](_0x56edf4['model'],qs['fields'](_0xed7251[_0xfeec('0x47')][_0xfeec('0x4b')]));_0x35715c[_0xfeec('0x4a')]=_0x35715c[_0xfeec('0x4a')][_0xfeec('0x4c')]?_0x35715c['attributes']:_0x56edf4['model'];_0x35715c[_0xfeec('0x4f')]=qs[_0xfeec('0x50')](_0xed7251[_0xfeec('0x47')][_0xfeec('0x50')]);_0x35715c[_0xfeec('0x51')]=qs[_0xfeec('0x52')](_[_0xfeec('0x53')](_0xed7251['query'],_0x56edf4[_0xfeec('0x52')]));if(_0xed7251[_0xfeec('0x47')][_0xfeec('0x55')]){_0x35715c[_0xfeec('0x51')]=_[_0xfeec('0x56')](_0x35715c['where'],{'$or':_[_0xfeec('0x46')](_0x35715c[_0xfeec('0x4a')],function(_0x302210){var _0x21d2cd={};_0x21d2cd[_0x302210]={'$like':'%'+_0xed7251[_0xfeec('0x47')]['filter']+'%'};return _0x21d2cd;})});}_0x35715c=_['merge']({},_0x35715c,_0xed7251[_0xfeec('0x6d')]);return _0x4bcd2c[_0xfeec('0x116')](_0x35715c);}})['then'](function(_0x1af537){if(_0x1af537){_0x9cdba7=_0x1af537[_0xfeec('0x4c')];if(!_0xed7251[_0xfeec('0x47')][_0xfeec('0x4d')](_0xfeec('0x4e'))){_0x35715c[_0xfeec('0x2f')]=qs[_0xfeec('0x2f')](_0xed7251[_0xfeec('0x47')][_0xfeec('0x2f')]);_0x35715c[_0xfeec('0x2e')]=qs['offset'](_0xed7251[_0xfeec('0x47')][_0xfeec('0x2e')]);}return _0x4bcd2c[_0xfeec('0x116')](_0x35715c);}})['then'](function(_0x350653){if(_0x350653){return _0x350653?{'count':_0x9cdba7,'rows':_0x350653}:null;}})[_0xfeec('0x20')](respondWithResult(_0x45602a,null))[_0xfeec('0x59')](handleError(_0x45602a,null));};exports[_0xfeec('0x12c')]=function(_0x40800a,_0x469036,_0x191a28){var _0x4570e1=_0x40800a['query'][_0xfeec('0x12d')]==='false'?_0xfeec('0x12e'):_0xfeec('0x12f');return db[_0xfeec('0x41')]['find']({'attributes':['id',_0x4570e1],'where':{'id':_0x40800a[_0xfeec('0x5b')]['id']}})[_0xfeec('0x20')](handleEntityNotFound(_0x469036,null))[_0xfeec('0x20')](function(_0xd40936){if(_0xd40936){var _0x1b7d3c=_0xd40936[_0x4570e1];var _0x495fc6=_0x1b7d3c&&_0x1b7d3c[_0xfeec('0x130')]?_0x1b7d3c[_0xfeec('0x130')]:[];_0x469036['send']({'fromKey':_[_0xfeec('0x82')](_0x1b7d3c[_0xfeec('0x131')])?undefined:_0x1b7d3c[_0xfeec('0x131')],'count':_0x495fc6[_0xfeec('0x4c')],'rows':_0x495fc6});}})[_0xfeec('0x59')](handleError(_0x469036,null));};exports[_0xfeec('0x132')]=function(_0x3449c2,_0xd7a389,_0x15caa8){var _0x2f1d78={'raw':![],'where':{}};var _0x29731c={};var _0x147c5a={'count':0x0,'rows':[]};return db[_0xfeec('0x41')][_0xfeec('0x72')]({'where':{'id':_0x3449c2[_0xfeec('0x5b')]['id']}})['then'](handleEntityNotFound(_0xd7a389,null))[_0xfeec('0x20')](function(_0x55b1a3){if(_0x55b1a3){_0x29731c[_0xfeec('0x45')]=_[_0xfeec('0x48')](db[_0xfeec('0xe2')][_0xfeec('0x42')]);_0x29731c[_0xfeec('0x47')]=_[_0xfeec('0x48')](_0x3449c2[_0xfeec('0x47')]);_0x29731c[_0xfeec('0x52')]=_[_0xfeec('0x49')](_0x29731c['model'],_0x29731c[_0xfeec('0x47')]);_0x2f1d78[_0xfeec('0x4a')]=_[_0xfeec('0x49')](_0x29731c[_0xfeec('0x45')],qs[_0xfeec('0x4b')](_0x3449c2['query'][_0xfeec('0x4b')]));_0x2f1d78['attributes']=_0x2f1d78[_0xfeec('0x4a')][_0xfeec('0x4c')]?_0x2f1d78[_0xfeec('0x4a')]:_0x29731c[_0xfeec('0x45')];if(!_0x3449c2['query'][_0xfeec('0x4d')](_0xfeec('0x4e'))){_0x2f1d78['limit']=qs['limit'](_0x3449c2[_0xfeec('0x47')][_0xfeec('0x2f')]);_0x2f1d78[_0xfeec('0x2e')]=qs[_0xfeec('0x2e')](_0x3449c2['query']['offset']);}_0x2f1d78[_0xfeec('0x4f')]=qs['sort'](_0x3449c2[_0xfeec('0x47')]['sort']);_0x2f1d78[_0xfeec('0x51')]=qs[_0xfeec('0x52')](_[_0xfeec('0x53')](_0x3449c2['query'],_0x29731c['filters']));_0x2f1d78[_0xfeec('0x51')][_0xfeec('0x6a')]=_0x55b1a3['id'];if(_0x3449c2[_0xfeec('0x47')][_0xfeec('0x55')]){_0x2f1d78[_0xfeec('0x51')]=_[_0xfeec('0x56')](_0x2f1d78[_0xfeec('0x51')],{'$or':_['map'](_0x2f1d78[_0xfeec('0x4a')],function(_0x165245){var _0x460748={};_0x460748[_0x165245]={'$like':'%'+_0x3449c2[_0xfeec('0x47')][_0xfeec('0x55')]+'%'};return _0x460748;})});}_0x2f1d78=_[_0xfeec('0x56')]({},_0x2f1d78,_0x3449c2['options']);return db[_0xfeec('0xe2')]['count']({'where':_0x2f1d78['where']})[_0xfeec('0x20')](function(_0xee60a1){_0x147c5a[_0xfeec('0x31')]=_0xee60a1;if(_0x3449c2[_0xfeec('0x47')][_0xfeec('0x5c')]){_0x2f1d78[_0xfeec('0x57')]=[{'all':!![]}];}else{_0x2f1d78[_0xfeec('0x57')]=[{'model':db['CmContact'],'as':_0xfeec('0x103'),'required':![]},{'model':db[_0xfeec('0xe9')],'as':'Attachments','required':![]}];}return db[_0xfeec('0xe2')][_0xfeec('0x58')](_0x2f1d78);})[_0xfeec('0x20')](function(_0x5ba4a8){_0x147c5a[_0xfeec('0x6e')]=_0x5ba4a8;return _0x147c5a;});}})['then'](respondWithFilteredResult(_0xd7a389,_0x2f1d78))['catch'](handleError(_0xd7a389,null));};exports[_0xfeec('0x133')]=function(_0x52b19d,_0x3c6f0f,_0x40df97){return db['ChatWebsite']['find']({'where':{'id':_0x52b19d[_0xfeec('0x5b')]['id']}})[_0xfeec('0x20')](handleEntityNotFound(_0x3c6f0f,null))[_0xfeec('0x20')](function(_0x395f4c){if(_0x395f4c){return _0x395f4c[_0xfeec('0x133')](_0x52b19d['body']['ids'],_['omit'](_0x52b19d[_0xfeec('0x5e')],['ids','id'])||{})[_0xfeec('0xc2')](function(_0xb75c45){for(var _0x270ea1=0x0;_0x270ea1<_0x52b19d[_0xfeec('0x5e')][_0xfeec('0x74')][_0xfeec('0x4c')];_0x270ea1+=0x1){socket[_0xfeec('0x134')](_0xfeec('0x135'),{'UserId':Number(_0x52b19d[_0xfeec('0x5e')][_0xfeec('0x74')][_0x270ea1]),'ChatWebsiteId':Number(_0x52b19d[_0xfeec('0x5b')]['id'])});}return _0xb75c45;});}})[_0xfeec('0x20')](respondWithResult(_0x3c6f0f,null))['catch'](handleError(_0x3c6f0f,null));};exports[_0xfeec('0x136')]=function(_0x3bd482,_0xb7ccae,_0x712f45){return db['ChatWebsite'][_0xfeec('0x67')]({'where':{'id':_0x3bd482[_0xfeec('0x5b')]['id']}})['then'](handleEntityNotFound(_0xb7ccae,null))[_0xfeec('0x20')](function(_0x1cb2d6){if(_0x1cb2d6){return _0x1cb2d6[_0xfeec('0x136')](_0x3bd482[_0xfeec('0x47')][_0xfeec('0x74')])[_0xfeec('0x20')](function(){if(_[_0xfeec('0x137')](_0x3bd482[_0xfeec('0x47')][_0xfeec('0x74')])){for(var _0x53e80f=0x0;_0x53e80f<_0x3bd482[_0xfeec('0x47')]['ids'][_0xfeec('0x4c')];_0x53e80f+=0x1){socket[_0xfeec('0x134')](_0xfeec('0x138'),{'UserId':Number(_0x3bd482[_0xfeec('0x47')][_0xfeec('0x74')][_0x53e80f]),'ChatWebsiteId':Number(_0x3bd482['params']['id'])});}}else{socket[_0xfeec('0x134')](_0xfeec('0x138'),{'UserId':Number(_0x3bd482[_0xfeec('0x47')][_0xfeec('0x74')]),'ChatWebsiteId':Number(_0x3bd482[_0xfeec('0x5b')]['id'])});}});}})['then'](respondWithStatusCode(_0xb7ccae,null))[_0xfeec('0x59')](handleError(_0xb7ccae,null));};exports['getAgents']=function(_0x239512,_0x1aca15,_0x3aa553){var _0xc96aba={};var _0x4c5ea3={};var _0x310ce9;var _0xa7a5b0;return db[_0xfeec('0x41')][_0xfeec('0x72')]({'where':{'id':_0x239512[_0xfeec('0x5b')]['id']}})[_0xfeec('0x20')](handleEntityNotFound(_0x1aca15,null))[_0xfeec('0x20')](function(_0x5c1069){if(_0x5c1069){_0x310ce9=_0x5c1069;_0x4c5ea3[_0xfeec('0x45')]=_[_0xfeec('0x48')](db[_0xfeec('0xcf')][_0xfeec('0x42')]);_0x4c5ea3[_0xfeec('0x47')]=_[_0xfeec('0x48')](_0x239512[_0xfeec('0x47')]);_0x4c5ea3[_0xfeec('0x52')]=_[_0xfeec('0x49')](_0x4c5ea3[_0xfeec('0x45')],_0x4c5ea3[_0xfeec('0x47')]);_0xc96aba[_0xfeec('0x4a')]=_[_0xfeec('0x49')](_0x4c5ea3[_0xfeec('0x45')],qs[_0xfeec('0x4b')](_0x239512[_0xfeec('0x47')][_0xfeec('0x4b')]));_0xc96aba['attributes']=_0xc96aba[_0xfeec('0x4a')][_0xfeec('0x4c')]?_0xc96aba['attributes']:_0x4c5ea3[_0xfeec('0x45')];_0xc96aba[_0xfeec('0x4f')]=qs[_0xfeec('0x50')](_0x239512['query'][_0xfeec('0x50')]);_0xc96aba[_0xfeec('0x51')]=qs['filters'](_[_0xfeec('0x53')](_0x239512['query'],_0x4c5ea3[_0xfeec('0x52')]));if(_0x239512[_0xfeec('0x47')][_0xfeec('0x55')]){_0xc96aba[_0xfeec('0x51')]=_[_0xfeec('0x56')](_0xc96aba[_0xfeec('0x51')],{'$or':_[_0xfeec('0x46')](_0xc96aba[_0xfeec('0x4a')],function(_0x54b517){var _0x25ca06={};_0x25ca06[_0x54b517]={'$like':'%'+_0x239512[_0xfeec('0x47')][_0xfeec('0x55')]+'%'};return _0x25ca06;})});}_0xc96aba=_['merge']({},_0xc96aba,_0x239512['options']);return _0x310ce9[_0xfeec('0x139')](_0xc96aba);}})[_0xfeec('0x20')](function(_0x4ff584){if(_0x4ff584){_0xa7a5b0=_0x4ff584[_0xfeec('0x4c')];if(!_0x239512[_0xfeec('0x47')]['hasOwnProperty'](_0xfeec('0x4e'))){_0xc96aba[_0xfeec('0x2f')]=qs[_0xfeec('0x2f')](_0x239512[_0xfeec('0x47')][_0xfeec('0x2f')]);_0xc96aba['offset']=qs['offset'](_0x239512[_0xfeec('0x47')][_0xfeec('0x2e')]);}return _0x310ce9[_0xfeec('0x139')](_0xc96aba);}})['then'](function(_0xa42add){if(_0xa42add){return _0xa42add?{'count':_0xa7a5b0,'rows':_0xa42add}:null;}})[_0xfeec('0x20')](respondWithResult(_0x1aca15,null))[_0xfeec('0x59')](handleError(_0x1aca15,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 6f67508..e44369f 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 _0x6bff=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','update','remove'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6bff,0xa6));var _0xf6bf=function(_0x2a7d83,_0x17a867){_0x2a7d83=_0x2a7d83-0x0;var _0x50e7b5=_0x6bff[_0x2a7d83];return _0x50e7b5;};'use strict';var EventEmitter=require(_0xf6bf('0x0'));var ChatWebsite=require(_0xf6bf('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xf6bf('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf6bf('0x3'),'afterDestroy':_0xf6bf('0x4')};function emitEvent(_0x3ab762){return function(_0x14a2d8,_0x4cc8b6,_0x1f3e2c){ChatWebsiteEvents[_0xf6bf('0x5')](_0x3ab762+':'+_0x14a2d8['id'],_0x14a2d8);ChatWebsiteEvents[_0xf6bf('0x5')](_0x3ab762,_0x14a2d8);_0x1f3e2c(null);};}for(var e in events){if(events[_0xf6bf('0x6')](e)){var event=events[e];ChatWebsite[_0xf6bf('0x7')](e,emitEvent(event));}}module[_0xf6bf('0x8')]=ChatWebsiteEvents; \ No newline at end of file +var _0x544f=['remove','emit','hook','exports','events','setMaxListeners','save','update'];(function(_0x4499d3,_0x8383cd){var _0x22c6ec=function(_0x56a6ac){while(--_0x56a6ac){_0x4499d3['push'](_0x4499d3['shift']());}};_0x22c6ec(++_0x8383cd);}(_0x544f,0x14c));var _0xf544=function(_0x459423,_0x3416a8){_0x459423=_0x459423-0x0;var _0x42ed14=_0x544f[_0x459423];return _0x42ed14;};'use strict';var EventEmitter=require(_0xf544('0x0'));var ChatWebsite=require('../../mysqldb')['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xf544('0x1')](0x0);var events={'afterCreate':_0xf544('0x2'),'afterUpdate':_0xf544('0x3'),'afterDestroy':_0xf544('0x4')};function emitEvent(_0x5ef358){return function(_0x3aedf9,_0x42f20a,_0x599d96){ChatWebsiteEvents[_0xf544('0x5')](_0x5ef358+':'+_0x3aedf9['id'],_0x3aedf9);ChatWebsiteEvents[_0xf544('0x5')](_0x5ef358,_0x3aedf9);_0x599d96(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0xf544('0x6')](e,emitEvent(event));}}module[_0xf544('0x7')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index c18987f..c36f188 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 _0x26dd=['define','ChatWebsite','chat_websites','lodash','../../config/logger','api','moment','request-promise','path','../../config/environment','./chatWebsite.attributes'];(function(_0x3b1883,_0x53f8c0){var _0x111897=function(_0x48119b){while(--_0x48119b){_0x3b1883['push'](_0x3b1883['shift']());}};_0x111897(++_0x53f8c0);}(_0x26dd,0x1d1));var _0xd26d=function(_0x3c4916,_0x1c5575){_0x3c4916=_0x3c4916-0x0;var _0x328192=_0x26dd[_0x3c4916];return _0x328192;};'use strict';var _=require(_0xd26d('0x0'));var util=require('util');var logger=require(_0xd26d('0x1'))(_0xd26d('0x2'));var moment=require(_0xd26d('0x3'));var BPromise=require('bluebird');var rp=require(_0xd26d('0x4'));var fs=require('fs');var path=require(_0xd26d('0x5'));var rimraf=require('rimraf');var config=require(_0xd26d('0x6'));var attributes=require(_0xd26d('0x7'));module['exports']=function(_0x3b084a,_0x47d830){return _0x3b084a[_0xd26d('0x8')](_0xd26d('0x9'),attributes,{'tableName':_0xd26d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3d1e=['request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','chat_websites','lodash','util','../../config/logger','moment','bluebird'];(function(_0x50410c,_0xdbce5){var _0x599013=function(_0x43ad83){while(--_0x43ad83){_0x50410c['push'](_0x50410c['shift']());}};_0x599013(++_0xdbce5);}(_0x3d1e,0xc7));var _0xe3d1=function(_0x964fa7,_0x5872ff){_0x964fa7=_0x964fa7-0x0;var _0x1e1eec=_0x3d1e[_0x964fa7];return _0x1e1eec;};'use strict';var _=require(_0xe3d1('0x0'));var util=require(_0xe3d1('0x1'));var logger=require(_0xe3d1('0x2'))('api');var moment=require(_0xe3d1('0x3'));var BPromise=require(_0xe3d1('0x4'));var rp=require(_0xe3d1('0x5'));var fs=require('fs');var path=require(_0xe3d1('0x6'));var rimraf=require(_0xe3d1('0x7'));var config=require(_0xe3d1('0x8'));var attributes=require(_0xe3d1('0x9'));module[_0xe3d1('0xa')]=function(_0x2f47a3,_0x599471){return _0x2f47a3['define']('ChatWebsite',attributes,{'tableName':_0xe3d1('0xb'),'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 f855033..0eb1ab0 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 _0x032d=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x032d,0x69));var _0xd032=function(_0x2b4290,_0x333670){_0x2b4290=_0x2b4290-0x0;var _0x123a61=_0x032d[_0x2b4290];return _0x123a61;};'use strict';var _=require(_0xd032('0x0'));var util=require(_0xd032('0x1'));var moment=require(_0xd032('0x2'));var BPromise=require('bluebird');var rs=require(_0xd032('0x3'));var fs=require('fs');var Redis=require(_0xd032('0x4'));var db=require(_0xd032('0x5'))['db'];var utils=require(_0xd032('0x6'));var logger=require(_0xd032('0x7'))(_0xd032('0x8'));var config=require(_0xd032('0x9'));var jayson=require(_0xd032('0xa'));var client=jayson[_0xd032('0xb')][_0xd032('0xc')]({'port':0x232a});config[_0xd032('0xd')]=_[_0xd032('0xe')](config['redis'],{'host':_0xd032('0xf'),'port':0x18eb});var socket=require(_0xd032('0x10'))(new Redis(config['redis']));require('./chatWebsite.socket')['register'](socket);function respondWithRpcPromise(_0x1171b0,_0x208880,_0x5be3c6){return new BPromise(function(_0x531a52,_0x3b895e){return client[_0xd032('0x11')](_0x1171b0,_0x5be3c6)[_0xd032('0x12')](function(_0x13e996){logger[_0xd032('0x13')](_0xd032('0x14'),_0x208880,_0xd032('0x15'));logger[_0xd032('0x16')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x208880,_0xd032('0x15'),JSON[_0xd032('0x17')](_0x13e996));if(_0x13e996[_0xd032('0x18')]){if(_0x13e996[_0xd032('0x18')][_0xd032('0x19')]===0x1f4){logger['error'](_0xd032('0x14'),_0x208880,_0x13e996[_0xd032('0x18')][_0xd032('0x1a')]);return _0x3b895e(_0x13e996[_0xd032('0x18')][_0xd032('0x1a')]);}logger[_0xd032('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x208880,_0x13e996['error'][_0xd032('0x1a')]);return _0x531a52(_0x13e996['error'][_0xd032('0x1a')]);}else{logger['info'](_0xd032('0x14'),_0x208880,_0xd032('0x15'));_0x531a52(_0x13e996['result']['message']);}})[_0xd032('0x1b')](function(_0x237aa9){logger['error'](_0xd032('0x14'),_0x208880,_0x237aa9);_0x3b895e(_0x237aa9);});});} \ No newline at end of file +var _0xc6a7=['redis','defaults','localhost','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x2cef87,_0x126a4e){var _0x4883af=function(_0x2f9975){while(--_0x2f9975){_0x2cef87['push'](_0x2cef87['shift']());}};_0x4883af(++_0x126a4e);}(_0xc6a7,0x1c0));var _0x7c6a=function(_0x26f702,_0x3919bf){_0x26f702=_0x26f702-0x0;var _0x11417d=_0xc6a7[_0x26f702];return _0x11417d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7c6a('0x0'));var BPromise=require(_0x7c6a('0x1'));var rs=require(_0x7c6a('0x2'));var fs=require('fs');var Redis=require(_0x7c6a('0x3'));var db=require(_0x7c6a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7c6a('0x5'))(_0x7c6a('0x6'));var config=require(_0x7c6a('0x7'));var jayson=require(_0x7c6a('0x8'));var client=jayson[_0x7c6a('0x9')][_0x7c6a('0xa')]({'port':0x232a});config[_0x7c6a('0xb')]=_[_0x7c6a('0xc')](config[_0x7c6a('0xb')],{'host':_0x7c6a('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x7c6a('0xe'))[_0x7c6a('0xf')](socket);function respondWithRpcPromise(_0x5e3638,_0x36746b,_0x238ebe){return new BPromise(function(_0x17f123,_0x50ea5b){return client[_0x7c6a('0x10')](_0x5e3638,_0x238ebe)[_0x7c6a('0x11')](function(_0xb62d40){logger[_0x7c6a('0x12')](_0x7c6a('0x13'),_0x36746b,'request\x20sent');logger[_0x7c6a('0x14')](_0x7c6a('0x15'),_0x36746b,_0x7c6a('0x16'),JSON[_0x7c6a('0x17')](_0xb62d40));if(_0xb62d40[_0x7c6a('0x18')]){if(_0xb62d40['error']['code']===0x1f4){logger[_0x7c6a('0x18')](_0x7c6a('0x13'),_0x36746b,_0xb62d40['error'][_0x7c6a('0x19')]);return _0x50ea5b(_0xb62d40[_0x7c6a('0x18')][_0x7c6a('0x19')]);}logger[_0x7c6a('0x18')](_0x7c6a('0x13'),_0x36746b,_0xb62d40[_0x7c6a('0x18')][_0x7c6a('0x19')]);return _0x17f123(_0xb62d40[_0x7c6a('0x18')][_0x7c6a('0x19')]);}else{logger[_0x7c6a('0x12')](_0x7c6a('0x13'),_0x36746b,_0x7c6a('0x16'));_0x17f123(_0xb62d40['result'][_0x7c6a('0x19')]);}})[_0x7c6a('0x1a')](function(_0x251f90){logger['error'](_0x7c6a('0x13'),_0x36746b,_0x251f90);_0x50ea5b(_0x251f90);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 73edb92..3c1c424 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 _0xda61=['length','chatWebsite:','save','remove','update','removeListener'];(function(_0x1ec8f9,_0x22f5e7){var _0x17cd3d=function(_0x156ad2){while(--_0x156ad2){_0x1ec8f9['push'](_0x1ec8f9['shift']());}};_0x17cd3d(++_0x22f5e7);}(_0xda61,0x12e));var _0x1da6=function(_0xc97c3c,_0x38c459){_0xc97c3c=_0xc97c3c-0x0;var _0x3f0130=_0xda61[_0xc97c3c];return _0x3f0130;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x1da6('0x0'),_0x1da6('0x1'),_0x1da6('0x2')];function createListener(_0x3e0854,_0x318676){return function(_0x2d2195){_0x318676['emit'](_0x3e0854,_0x2d2195);};}function removeListener(_0xa36b05,_0x2b3e35){return function(){ChatWebsiteEvents[_0x1da6('0x3')](_0xa36b05,_0x2b3e35);};}exports['register']=function(_0x30e540){for(var _0x1cde52=0x0,_0x2d6e8c=events[_0x1da6('0x4')];_0x1cde52<_0x2d6e8c;_0x1cde52++){var _0x1fb878=events[_0x1cde52];var _0x19bd3f=createListener(_0x1da6('0x5')+_0x1fb878,_0x30e540);ChatWebsiteEvents['on'](_0x1fb878,_0x19bd3f);}}; \ No newline at end of file +var _0xf287=['update','emit','length','./chatWebsite.events','save'];(function(_0x229128,_0x273558){var _0x1875b9=function(_0x275e35){while(--_0x275e35){_0x229128['push'](_0x229128['shift']());}};_0x1875b9(++_0x273558);}(_0xf287,0x1d9));var _0x7f28=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xf287[_0x53ccf2];return _0x5a2964;};'use strict';var ChatWebsiteEvents=require(_0x7f28('0x0'));var events=[_0x7f28('0x1'),'remove',_0x7f28('0x2')];function createListener(_0x585226,_0x548e23){return function(_0x6d0b43){_0x548e23[_0x7f28('0x3')](_0x585226,_0x6d0b43);};}function removeListener(_0x5c5257,_0x2dd841){return function(){ChatWebsiteEvents['removeListener'](_0x5c5257,_0x2dd841);};}exports['register']=function(_0x5c5564){for(var _0x1ad3be=0x0,_0x4f3dfe=events[_0x7f28('0x4')];_0x1ad3be<_0x4f3dfe;_0x1ad3be++){var _0x5a6634=events[_0x1ad3be];var _0xca26b9=createListener('chatWebsite:'+_0x5a6634,_0x5c5564);ChatWebsiteEvents['on'](_0x5a6634,_0xca26b9);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index fd20985..4133536 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 _0x3495=['attachments','offline-chat','ensureDir','replace','/:id/offline','any','addInteraction','addApplications','addProactiveActions','/:id/users','put','update','delete','removeAnswers','removeAgents','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','create','post','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','originalname','addLogo','server/files/images/avatars/','now','single','file','addAvatar','/:id/customer_avatar','addCustomerAvatar','addSystemAvatar','/:id/notify','server/files'];(function(_0x48f23f,_0x9145c5){var _0x52e361=function(_0x5c0f7c){while(--_0x5c0f7c){_0x48f23f['push'](_0x48f23f['shift']());}};_0x52e361(++_0x9145c5);}(_0x3495,0x1b9));var _0x5349=function(_0x5f6bb2,_0x4d446a){_0x5f6bb2=_0x5f6bb2-0x0;var _0x208968=_0x3495[_0x5f6bb2];return _0x208968;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5349('0x0'));var timeout=require('connect-timeout');var express=require(_0x5349('0x1'));var router=express[_0x5349('0x2')]();var fs_extra=require(_0x5349('0x3'));var auth=require(_0x5349('0x4'));var interaction=require(_0x5349('0x5'));var config=require(_0x5349('0x6'));var controller=require(_0x5349('0x7'));router[_0x5349('0x8')]('/',auth[_0x5349('0x9')](),controller['index']);router['get'](_0x5349('0xa'),auth[_0x5349('0x9')](),controller[_0x5349('0xb')]);router[_0x5349('0x8')](_0x5349('0xc'),auth[_0x5349('0x9')](),controller[_0x5349('0xd')]);router[_0x5349('0x8')](_0x5349('0xe'),auth[_0x5349('0x9')](),controller[_0x5349('0xf')]);router[_0x5349('0x8')](_0x5349('0x10'),auth['isAuthenticated'](),controller[_0x5349('0x11')]);router[_0x5349('0x8')](_0x5349('0x12'),controller[_0x5349('0x13')]);router[_0x5349('0x8')](_0x5349('0x14'),controller[_0x5349('0x15')]);router[_0x5349('0x8')]('/:id/customer_avatar',controller[_0x5349('0x16')]);router[_0x5349('0x8')](_0x5349('0x17'),controller[_0x5349('0x18')]);router['get'](_0x5349('0x19'),auth[_0x5349('0x9')](),controller[_0x5349('0x1a')]);router['get'](_0x5349('0x1b'),controller[_0x5349('0x1c')]);router['get'](_0x5349('0x1d'),auth[_0x5349('0x9')](),controller[_0x5349('0x1e')]);router[_0x5349('0x8')](_0x5349('0x1f'),auth[_0x5349('0x9')](),controller[_0x5349('0x20')]);router[_0x5349('0x8')](_0x5349('0x21'),controller['getFields']);router['get']('/:id/offline_messages',auth[_0x5349('0x9')](),controller['getOfflineMessages']);router[_0x5349('0x8')]('/:id/users',auth[_0x5349('0x9')](),controller['getAgents']);router['post']('/',auth[_0x5349('0x9')](),controller[_0x5349('0x22')]);router[_0x5349('0x23')](_0x5349('0xe'),auth[_0x5349('0x9')](),controller[_0x5349('0x24')]);router[_0x5349('0x23')]('/:id/canned_answers',auth[_0x5349('0x9')](),controller[_0x5349('0x25')]);var upload=multer({'storage':multer[_0x5349('0x26')]({'destination':function(_0x157f95,_0x1a0ff1,_0x5c26c0){_0x5c26c0(null,path[_0x5349('0x27')](config[_0x5349('0x28')],_0x5349('0x29')));},'filename':function(_0x7e06c6,_0x5106dd,_0x3e4d69){_0x3e4d69(null,util[_0x5349('0x2a')](_0x5349('0x2b'),Date['now'](),_0x5106dd[_0x5349('0x2c')]));}})});router[_0x5349('0x23')](_0x5349('0x12'),upload['single']('file'),controller[_0x5349('0x2d')]);var upload=multer({'storage':multer[_0x5349('0x26')]({'destination':function(_0x13873e,_0x26ac15,_0x52d85e){_0x52d85e(null,path[_0x5349('0x27')](config['root'],_0x5349('0x2e')));},'filename':function(_0x2ab6e0,_0x796744,_0x1d5a0e){_0x1d5a0e(null,util[_0x5349('0x2a')](_0x5349('0x2b'),Date[_0x5349('0x2f')](),_0x796744[_0x5349('0x2c')]));}})});router[_0x5349('0x23')](_0x5349('0x14'),upload[_0x5349('0x30')](_0x5349('0x31')),controller[_0x5349('0x32')]);var upload=multer({'storage':multer[_0x5349('0x26')]({'destination':function(_0xd0319b,_0x3c0c81,_0x5b1580){_0x5b1580(null,path['join'](config[_0x5349('0x28')],_0x5349('0x2e')));},'filename':function(_0x5d2581,_0x419b54,_0x262af1){_0x262af1(null,util[_0x5349('0x2a')](_0x5349('0x2b'),Date['now'](),_0x419b54[_0x5349('0x2c')]));}})});router[_0x5349('0x23')](_0x5349('0x33'),upload[_0x5349('0x30')](_0x5349('0x31')),controller[_0x5349('0x34')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5eaa65,_0x30680e,_0x183b4f){_0x183b4f(null,path['join'](config[_0x5349('0x28')],_0x5349('0x2e')));},'filename':function(_0x32a298,_0x20972b,_0x24f465){_0x24f465(null,util[_0x5349('0x2a')](_0x5349('0x2b'),Date[_0x5349('0x2f')](),_0x20972b[_0x5349('0x2c')]));}})});router[_0x5349('0x23')](_0x5349('0x17'),upload['single'](_0x5349('0x31')),controller[_0x5349('0x35')]);router[_0x5349('0x23')](_0x5349('0x36'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0x5349('0x26')]({'destination':function(_0x597dac,_0x48a5fe,_0xce986b){const _0x252ece=path[_0x5349('0x27')](config[_0x5349('0x28')],_0x5349('0x37'),_0x5349('0x38'),_0x5349('0x39'));fs_extra[_0x5349('0x3a')](_0x252ece,function(){_0xce986b(null,_0x252ece);});},'filename':function(_0x3d8e07,_0x321e97,_0x3ad137){const _0x1b549d=_0x321e97[_0x5349('0x2c')][_0x5349('0x3b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x426aa9=path['extname'](_0x1b549d);const _0x1b03c1=Date[_0x5349('0x2f')]()+'-'+_0x1b549d[_0x5349('0x3b')](_0x426aa9,'')+_0x426aa9;_0x3ad137(null,_0x1b03c1);}})});router[_0x5349('0x23')](_0x5349('0x3c'),offlineUploadMulter[_0x5349('0x3d')](),controller['offline']);router['post'](_0x5349('0x19'),auth[_0x5349('0x9')](),controller[_0x5349('0x3e')]);router['post'](_0x5349('0x1d'),auth['isAuthenticated'](),controller[_0x5349('0x3f')]);router[_0x5349('0x23')](_0x5349('0x1f'),auth['isAuthenticated'](),controller[_0x5349('0x40')]);router[_0x5349('0x23')](_0x5349('0x41'),auth['isAuthenticated'](),controller['addAgents']);router[_0x5349('0x42')](_0x5349('0xc'),auth[_0x5349('0x9')](),controller[_0x5349('0x43')]);router['delete'](_0x5349('0xc'),auth[_0x5349('0x9')](),controller['destroy']);router[_0x5349('0x44')]('/:id/dispositions',auth[_0x5349('0x9')](),controller['removeDispositions']);router[_0x5349('0x44')](_0x5349('0x10'),auth[_0x5349('0x9')](),controller[_0x5349('0x45')]);router[_0x5349('0x44')](_0x5349('0x41'),auth[_0x5349('0x9')](),controller[_0x5349('0x46')]);module['exports']=router; \ No newline at end of file +var _0x94e6=['Router','fs-extra','../../components/auth/service','./chatWebsite.controller','get','isAuthenticated','index','describe','/:id','/:id/dispositions','getDispositions','getAnswers','/:id/logo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','post','addDisposition','/:id/canned_answers','addAnswer','diskStorage','root','server/files/images/logos/','format','%s-%s','now','originalname','file','addLogo','join','single','addAvatar','addCustomerAvatar','server/files/images/avatars/','/:id/system_avatar','addSystemAvatar','/:id/notify','notify','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','addInteraction','addApplications','addProactiveActions','addAgents','put','delete','removeDispositions','removeAnswers','exports','util','path','connect-timeout','express'];(function(_0x16d840,_0x4f8894){var _0x13bc57=function(_0x5af799){while(--_0x5af799){_0x16d840['push'](_0x16d840['shift']());}};_0x13bc57(++_0x4f8894);}(_0x94e6,0x11c));var _0x694e=function(_0x2d9496,_0x22ad76){_0x2d9496=_0x2d9496-0x0;var _0x3142b8=_0x94e6[_0x2d9496];return _0x3142b8;};'use strict';var multer=require('multer');var util=require(_0x694e('0x0'));var path=require(_0x694e('0x1'));var timeout=require(_0x694e('0x2'));var express=require(_0x694e('0x3'));var router=express[_0x694e('0x4')]();var fs_extra=require(_0x694e('0x5'));var auth=require(_0x694e('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x694e('0x7'));router[_0x694e('0x8')]('/',auth[_0x694e('0x9')](),controller[_0x694e('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x694e('0xb')]);router['get'](_0x694e('0xc'),auth[_0x694e('0x9')](),controller['show']);router[_0x694e('0x8')](_0x694e('0xd'),auth[_0x694e('0x9')](),controller[_0x694e('0xe')]);router[_0x694e('0x8')]('/:id/canned_answers',auth[_0x694e('0x9')](),controller[_0x694e('0xf')]);router[_0x694e('0x8')](_0x694e('0x10'),controller['getLogo']);router[_0x694e('0x8')](_0x694e('0x11'),controller[_0x694e('0x12')]);router[_0x694e('0x8')](_0x694e('0x13'),controller[_0x694e('0x14')]);router[_0x694e('0x8')]('/:id/system_avatar',controller[_0x694e('0x15')]);router[_0x694e('0x8')](_0x694e('0x16'),auth[_0x694e('0x9')](),controller[_0x694e('0x17')]);router[_0x694e('0x8')](_0x694e('0x18'),controller[_0x694e('0x19')]);router[_0x694e('0x8')](_0x694e('0x1a'),auth[_0x694e('0x9')](),controller[_0x694e('0x1b')]);router[_0x694e('0x8')](_0x694e('0x1c'),auth['isAuthenticated'](),controller['getProactiveActions']);router[_0x694e('0x8')](_0x694e('0x1d'),controller[_0x694e('0x1e')]);router[_0x694e('0x8')](_0x694e('0x1f'),auth[_0x694e('0x9')](),controller[_0x694e('0x20')]);router[_0x694e('0x8')](_0x694e('0x21'),auth[_0x694e('0x9')](),controller['getAgents']);router[_0x694e('0x22')]('/',auth['isAuthenticated'](),controller['create']);router[_0x694e('0x22')](_0x694e('0xd'),auth[_0x694e('0x9')](),controller[_0x694e('0x23')]);router[_0x694e('0x22')](_0x694e('0x24'),auth[_0x694e('0x9')](),controller[_0x694e('0x25')]);var upload=multer({'storage':multer[_0x694e('0x26')]({'destination':function(_0x2695c6,_0x251779,_0x245dec){_0x245dec(null,path['join'](config[_0x694e('0x27')],_0x694e('0x28')));},'filename':function(_0x112bbb,_0x5893aa,_0x2b923e){_0x2b923e(null,util[_0x694e('0x29')](_0x694e('0x2a'),Date[_0x694e('0x2b')](),_0x5893aa[_0x694e('0x2c')]));}})});router['post'](_0x694e('0x10'),upload['single'](_0x694e('0x2d')),controller[_0x694e('0x2e')]);var upload=multer({'storage':multer[_0x694e('0x26')]({'destination':function(_0x55f6af,_0x394cc4,_0x37fb1d){_0x37fb1d(null,path[_0x694e('0x2f')](config[_0x694e('0x27')],'server/files/images/avatars/'));},'filename':function(_0x3bf6ef,_0x109e03,_0x8eb754){_0x8eb754(null,util['format'](_0x694e('0x2a'),Date['now'](),_0x109e03[_0x694e('0x2c')]));}})});router[_0x694e('0x22')](_0x694e('0x11'),upload[_0x694e('0x30')](_0x694e('0x2d')),controller[_0x694e('0x31')]);var upload=multer({'storage':multer[_0x694e('0x26')]({'destination':function(_0x56d25a,_0x468477,_0x16763c){_0x16763c(null,path['join'](config[_0x694e('0x27')],'server/files/images/avatars/'));},'filename':function(_0x23ee5e,_0x4de7c6,_0x46b7ca){_0x46b7ca(null,util['format']('%s-%s',Date[_0x694e('0x2b')](),_0x4de7c6[_0x694e('0x2c')]));}})});router[_0x694e('0x22')](_0x694e('0x13'),upload[_0x694e('0x30')](_0x694e('0x2d')),controller[_0x694e('0x32')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x210b13,_0x357738,_0x3bfec8){_0x3bfec8(null,path['join'](config[_0x694e('0x27')],_0x694e('0x33')));},'filename':function(_0x47378b,_0x481310,_0x13eb20){_0x13eb20(null,util[_0x694e('0x29')](_0x694e('0x2a'),Date[_0x694e('0x2b')](),_0x481310[_0x694e('0x2c')]));}})});router[_0x694e('0x22')](_0x694e('0x34'),upload[_0x694e('0x30')](_0x694e('0x2d')),controller[_0x694e('0x35')]);router[_0x694e('0x22')](_0x694e('0x36'),controller[_0x694e('0x37')]);const offlineUploadMulter=multer({'storage':multer[_0x694e('0x26')]({'destination':function(_0x4f8c1c,_0x1ff71e,_0x460925){const _0x3067ca=path[_0x694e('0x2f')](config[_0x694e('0x27')],'server/files',_0x694e('0x38'),_0x694e('0x39'));fs_extra[_0x694e('0x3a')](_0x3067ca,function(){_0x460925(null,_0x3067ca);});},'filename':function(_0xf31141,_0x4f5cd0,_0x32636d){const _0x228611=_0x4f5cd0[_0x694e('0x2c')][_0x694e('0x3b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x2e6976=path[_0x694e('0x3c')](_0x228611);const _0x45c432=Date[_0x694e('0x2b')]()+'-'+_0x228611[_0x694e('0x3b')](_0x2e6976,'')+_0x2e6976;_0x32636d(null,_0x45c432);}})});router[_0x694e('0x22')](_0x694e('0x3d'),offlineUploadMulter[_0x694e('0x3e')](),controller['offline']);router[_0x694e('0x22')](_0x694e('0x16'),auth[_0x694e('0x9')](),controller[_0x694e('0x3f')]);router[_0x694e('0x22')](_0x694e('0x1a'),auth[_0x694e('0x9')](),controller[_0x694e('0x40')]);router['post'](_0x694e('0x1c'),auth[_0x694e('0x9')](),controller[_0x694e('0x41')]);router[_0x694e('0x22')](_0x694e('0x21'),auth[_0x694e('0x9')](),controller[_0x694e('0x42')]);router[_0x694e('0x43')](_0x694e('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x694e('0x44')](_0x694e('0xc'),auth[_0x694e('0x9')](),controller['destroy']);router[_0x694e('0x44')](_0x694e('0xd'),auth[_0x694e('0x9')](),controller[_0x694e('0x45')]);router[_0x694e('0x44')](_0x694e('0x24'),auth['isAuthenticated'](),controller[_0x694e('0x46')]);router[_0x694e('0x44')](_0x694e('0x21'),auth[_0x694e('0x9')](),controller['removeAgents']);module[_0x694e('0x47')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index fb1f8a4..f3f603a 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 _0x6144=['STRING','ENUM','Google','sequelize','exports'];(function(_0x25918a,_0x27c6a4){var _0x1c79d4=function(_0x43d8fc){while(--_0x43d8fc){_0x25918a['push'](_0x25918a['shift']());}};_0x1c79d4(++_0x27c6a4);}(_0x6144,0x99));var _0x4614=function(_0x26fb28,_0x288d71){_0x26fb28=_0x26fb28-0x0;var _0xe90d7d=_0x6144[_0x26fb28];return _0xe90d7d;};'use strict';var Sequelize=require(_0x4614('0x0'));module[_0x4614('0x1')]={'name':{'type':Sequelize[_0x4614('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x4614('0x3')]('AmazonAWS',_0x4614('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x4614('0x2')]},'data2':{'type':Sequelize[_0x4614('0x2')]}}; \ No newline at end of file +var _0x1883=['ENUM','AmazonAWS','Google','sequelize','exports','STRING'];(function(_0x5c00da,_0x1865ca){var _0x1bdd13=function(_0x25b6e3){while(--_0x25b6e3){_0x5c00da['push'](_0x5c00da['shift']());}};_0x1bdd13(++_0x1865ca);}(_0x1883,0xab));var _0x3188=function(_0x3cdfa7,_0x34363c){_0x3cdfa7=_0x3cdfa7-0x0;var _0x4cda29=_0x1883[_0x3cdfa7];return _0x4cda29;};'use strict';var Sequelize=require(_0x3188('0x0'));module[_0x3188('0x1')]={'name':{'type':Sequelize[_0x3188('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x3188('0x3')](_0x3188('0x4'),_0x3188('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x3188('0x2')]},'data2':{'type':Sequelize[_0x3188('0x2')]}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index da05ae8..187b67f 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 _0xdb28=['error','stack','name','send','index','CloudProvider','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','create','body','eml-format','rimraf','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'];(function(_0x1348ac,_0x23f80c){var _0x246815=function(_0x489432){while(--_0x489432){_0x1348ac['push'](_0x1348ac['shift']());}};_0x246815(++_0x23f80c);}(_0xdb28,0x106));var _0x8db2=function(_0x128374,_0x252eba){_0x128374=_0x128374-0x0;var _0x277839=_0xdb28[_0x128374];return _0x277839;};'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['create']=function(_0x449109,_0x2ada52){return db[_0x8db2('0x2b')][_0x8db2('0x49')](_0x449109['body'],{})['then'](respondWithResult(_0x2ada52,0xc9))[_0x8db2('0x42')](handleError(_0x2ada52,null));};exports[_0x8db2('0x23')]=function(_0x164020,_0x4c66e5){if(_0x164020['body']['id']){delete _0x164020['body']['id'];}return db[_0x8db2('0x2b')][_0x8db2('0x48')]({'where':{'id':_0x164020[_0x8db2('0x44')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x4c66e5,null))[_0x8db2('0x24')](saveUpdates(_0x164020[_0x8db2('0x4a')],null))[_0x8db2('0x24')](respondWithResult(_0x4c66e5,null))['catch'](handleError(_0x4c66e5,null));};exports['destroy']=function(_0x3d29bc,_0x18c6ef){return db[_0x8db2('0x2b')][_0x8db2('0x48')]({'where':{'id':_0x3d29bc[_0x8db2('0x44')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x18c6ef,null))[_0x8db2('0x24')](removeEntity(_0x18c6ef,null))[_0x8db2('0x42')](handleError(_0x18c6ef,null));}; \ No newline at end of file +var _0x7a54=['offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','CloudProvider','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','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'];(function(_0x3d8ffb,_0x1a35dd){var _0x22b09a=function(_0x2cda5f){while(--_0x2cda5f){_0x3d8ffb['push'](_0x3d8ffb['shift']());}};_0x22b09a(++_0x1a35dd);}(_0x7a54,0x106));var _0x47a5=function(_0x403285,_0x333050){_0x403285=_0x403285-0x0;var _0x536775=_0x7a54[_0x403285];return _0x536775;};'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['CloudProvider'][_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['CloudProvider']['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['CloudProvider']['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('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index d8f5433..e7509b8 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 _0xb674=['../../config/environment','./cloudProvider.attributes','exports','define','cloud_providers','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x547456,_0x1de17e){var _0xc1fd7b=function(_0x12be35){while(--_0x12be35){_0x547456['push'](_0x547456['shift']());}};_0xc1fd7b(++_0x1de17e);}(_0xb674,0xc8));var _0x4b67=function(_0x3082e5,_0x833b52){_0x3082e5=_0x3082e5-0x0;var _0x5204b9=_0xb674[_0x3082e5];return _0x5204b9;};'use strict';var _=require(_0x4b67('0x0'));var util=require('util');var logger=require(_0x4b67('0x1'))(_0x4b67('0x2'));var moment=require(_0x4b67('0x3'));var BPromise=require(_0x4b67('0x4'));var rp=require(_0x4b67('0x5'));var fs=require('fs');var path=require(_0x4b67('0x6'));var rimraf=require(_0x4b67('0x7'));var config=require(_0x4b67('0x8'));var attributes=require(_0x4b67('0x9'));module[_0x4b67('0xa')]=function(_0x2d9a50,_0x28a913){return _0x2d9a50[_0x4b67('0xb')]('CloudProvider',attributes,{'tableName':_0x4b67('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1e05=['rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','util','api','bluebird','request-promise','path'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x1e05,0x1db));var _0x51e0=function(_0x39e84d,_0x11931d){_0x39e84d=_0x39e84d-0x0;var _0x1991bc=_0x1e05[_0x39e84d];return _0x1991bc;};'use strict';var _=require(_0x51e0('0x0'));var util=require(_0x51e0('0x1'));var logger=require('../../config/logger')(_0x51e0('0x2'));var moment=require('moment');var BPromise=require(_0x51e0('0x3'));var rp=require(_0x51e0('0x4'));var fs=require('fs');var path=require(_0x51e0('0x5'));var rimraf=require(_0x51e0('0x6'));var config=require(_0x51e0('0x7'));var attributes=require(_0x51e0('0x8'));module[_0x51e0('0x9')]=function(_0x326a01,_0x1352f7){return _0x326a01[_0x51e0('0xa')](_0x51e0('0xb'),attributes,{'tableName':_0x51e0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index 8f68360..07368df 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 _0xa3fe=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','error','code','CloudProvider,\x20%s,\x20%s','message','info','result','catch','lodash','moment','bluebird','ioredis'];(function(_0x418f25,_0x1e09af){var _0x3a571b=function(_0x386d44){while(--_0x386d44){_0x418f25['push'](_0x418f25['shift']());}};_0x3a571b(++_0x1e09af);}(_0xa3fe,0xd8));var _0xea3f=function(_0x50c54a,_0x25df7b){_0x50c54a=_0x50c54a-0x0;var _0x4ce675=_0xa3fe[_0x50c54a];return _0x4ce675;};'use strict';var _=require(_0xea3f('0x0'));var util=require('util');var moment=require(_0xea3f('0x1'));var BPromise=require(_0xea3f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xea3f('0x3'));var db=require(_0xea3f('0x4'))['db'];var utils=require(_0xea3f('0x5'));var logger=require('../../config/logger')(_0xea3f('0x6'));var config=require('../../config/environment');var jayson=require(_0xea3f('0x7'));var client=jayson[_0xea3f('0x8')][_0xea3f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x49e494,_0x56abd6,_0x187ce0){return new BPromise(function(_0x35ba50,_0x3c4807){return client['request'](_0x49e494,_0x187ce0)['then'](function(_0x464ad4){logger['info']('CloudProvider,\x20%s,\x20%s',_0x56abd6,_0xea3f('0xa'));logger[_0xea3f('0xb')](_0xea3f('0xc'),_0x56abd6,'request\x20sent',JSON['stringify'](_0x464ad4));if(_0x464ad4['error']){if(_0x464ad4[_0xea3f('0xd')][_0xea3f('0xe')]===0x1f4){logger[_0xea3f('0xd')](_0xea3f('0xf'),_0x56abd6,_0x464ad4['error']['message']);return _0x3c4807(_0x464ad4['error'][_0xea3f('0x10')]);}logger[_0xea3f('0xd')]('CloudProvider,\x20%s,\x20%s',_0x56abd6,_0x464ad4[_0xea3f('0xd')][_0xea3f('0x10')]);return _0x35ba50(_0x464ad4['error'][_0xea3f('0x10')]);}else{logger[_0xea3f('0x11')](_0xea3f('0xf'),_0x56abd6,_0xea3f('0xa'));_0x35ba50(_0x464ad4[_0xea3f('0x12')][_0xea3f('0x10')]);}})[_0xea3f('0x13')](function(_0x2585f1){logger[_0xea3f('0xd')](_0xea3f('0xf'),_0x56abd6,_0x2585f1);_0x3c4807(_0x2585f1);});});} \ No newline at end of file +var _0x94d4=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','error','message','CloudProvider,\x20%s,\x20%s','result','catch','lodash','util','bluebird'];(function(_0x51b3e4,_0x4d3270){var _0x4fc719=function(_0x2ef72a){while(--_0x2ef72a){_0x51b3e4['push'](_0x51b3e4['shift']());}};_0x4fc719(++_0x4d3270);}(_0x94d4,0xa5));var _0x494d=function(_0x1d74d1,_0xb72373){_0x1d74d1=_0x1d74d1-0x0;var _0x53d254=_0x94d4[_0x1d74d1];return _0x53d254;};'use strict';var _=require(_0x494d('0x0'));var util=require(_0x494d('0x1'));var moment=require('moment');var BPromise=require(_0x494d('0x2'));var rs=require(_0x494d('0x3'));var fs=require('fs');var Redis=require(_0x494d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x494d('0x5'));var logger=require(_0x494d('0x6'))(_0x494d('0x7'));var config=require(_0x494d('0x8'));var jayson=require(_0x494d('0x9'));var client=jayson[_0x494d('0xa')][_0x494d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4c53d7,_0x4f4576,_0x5269db){return new BPromise(function(_0x396280,_0x3f6b68){return client['request'](_0x4c53d7,_0x5269db)['then'](function(_0x456fe8){logger[_0x494d('0xc')]('CloudProvider,\x20%s,\x20%s',_0x4f4576,_0x494d('0xd'));logger[_0x494d('0xe')](_0x494d('0xf'),_0x4f4576,_0x494d('0xd'),JSON['stringify'](_0x456fe8));if(_0x456fe8[_0x494d('0x10')]){if(_0x456fe8[_0x494d('0x10')]['code']===0x1f4){logger['error']('CloudProvider,\x20%s,\x20%s',_0x4f4576,_0x456fe8[_0x494d('0x10')][_0x494d('0x11')]);return _0x3f6b68(_0x456fe8[_0x494d('0x10')][_0x494d('0x11')]);}logger[_0x494d('0x10')](_0x494d('0x12'),_0x4f4576,_0x456fe8[_0x494d('0x10')][_0x494d('0x11')]);return _0x396280(_0x456fe8[_0x494d('0x10')][_0x494d('0x11')]);}else{logger[_0x494d('0xc')]('CloudProvider,\x20%s,\x20%s',_0x4f4576,_0x494d('0xd'));_0x396280(_0x456fe8[_0x494d('0x13')][_0x494d('0x11')]);}})[_0x494d('0x14')](function(_0x120488){logger[_0x494d('0x10')](_0x494d('0x12'),_0x4f4576,_0x120488);_0x3f6b68(_0x120488);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 7ebd894..5c9eaed 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 _0xc08a=['destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cloudProvider.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete'];(function(_0x4b8224,_0xe52003){var _0xd52a92=function(_0x59ae92){while(--_0x59ae92){_0x4b8224['push'](_0x4b8224['shift']());}};_0xd52a92(++_0xe52003);}(_0xc08a,0x167));var _0xac08=function(_0x246419,_0x554ea8){_0x246419=_0x246419-0x0;var _0x5c54c6=_0xc08a[_0x246419];return _0x5c54c6;};'use strict';var multer=require(_0xac08('0x0'));var util=require(_0xac08('0x1'));var path=require(_0xac08('0x2'));var timeout=require('connect-timeout');var express=require(_0xac08('0x3'));var router=express[_0xac08('0x4')]();var fs_extra=require(_0xac08('0x5'));var auth=require(_0xac08('0x6'));var interaction=require(_0xac08('0x7'));var config=require(_0xac08('0x8'));var controller=require(_0xac08('0x9'));router[_0xac08('0xa')]('/',auth[_0xac08('0xb')](),controller[_0xac08('0xc')]);router[_0xac08('0xa')](_0xac08('0xd'),auth[_0xac08('0xb')](),controller[_0xac08('0xe')]);router['post']('/',auth[_0xac08('0xb')](),controller[_0xac08('0xf')]);router[_0xac08('0x10')](_0xac08('0xd'),auth[_0xac08('0xb')](),controller[_0xac08('0x11')]);router[_0xac08('0x12')](_0xac08('0xd'),auth[_0xac08('0xb')](),controller[_0xac08('0x13')]);module[_0xac08('0x14')]=router; \ No newline at end of file +var _0x4458=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cloudProvider.controller','index','get','/:id','isAuthenticated','post','create','put','update','delete','destroy','exports','multer'];(function(_0x161341,_0x1c054d){var _0x5e06c3=function(_0x1d177a){while(--_0x1d177a){_0x161341['push'](_0x161341['shift']());}};_0x5e06c3(++_0x1c054d);}(_0x4458,0xe6));var _0x8445=function(_0x3dab9a,_0x72c442){_0x3dab9a=_0x3dab9a-0x0;var _0x53459a=_0x4458[_0x3dab9a];return _0x53459a;};'use strict';var multer=require(_0x8445('0x0'));var util=require(_0x8445('0x1'));var path=require(_0x8445('0x2'));var timeout=require(_0x8445('0x3'));var express=require(_0x8445('0x4'));var router=express['Router']();var fs_extra=require(_0x8445('0x5'));var auth=require(_0x8445('0x6'));var interaction=require(_0x8445('0x7'));var config=require(_0x8445('0x8'));var controller=require(_0x8445('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x8445('0xa')]);router[_0x8445('0xb')](_0x8445('0xc'),auth[_0x8445('0xd')](),controller['show']);router[_0x8445('0xe')]('/',auth[_0x8445('0xd')](),controller[_0x8445('0xf')]);router[_0x8445('0x10')](_0x8445('0xc'),auth[_0x8445('0xd')](),controller[_0x8445('0x11')]);router[_0x8445('0x12')](_0x8445('0xc'),auth[_0x8445('0xd')](),controller[_0x8445('0x13')]);module[_0x8445('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index e5276aa..2c72a0a 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 _0xf811=['STRING','name','exports'];(function(_0xda501a,_0x159d6a){var _0x44be3a=function(_0x5c1c5f){while(--_0x5c1c5f){_0xda501a['push'](_0xda501a['shift']());}};_0x44be3a(++_0x159d6a);}(_0xf811,0x110));var _0x1f81=function(_0x1f36bb,_0x8af718){_0x1f36bb=_0x1f36bb-0x0;var _0xaf97fa=_0xf811[_0x1f36bb];return _0xaf97fa;};'use strict';var Sequelize=require('sequelize');module[_0x1f81('0x0')]={'name':{'type':Sequelize[_0x1f81('0x1')],'unique':_0x1f81('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x1f81('0x1')]},'companyId':{'type':Sequelize[_0x1f81('0x1')]},'website':{'type':Sequelize[_0x1f81('0x1')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x1f81('0x1')]},'type':{'type':Sequelize[_0x1f81('0x1')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x1f81('0x1')]},'city':{'type':Sequelize[_0x1f81('0x1')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x1f81('0x1')]},'sStreet':{'type':Sequelize[_0x1f81('0x1')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x1f81('0x1')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1f81('0x1')]}}; \ No newline at end of file +var _0xb4a9=['name','STRING','sequelize'];(function(_0x58fb72,_0x235d8e){var _0x36bc80=function(_0x3692d7){while(--_0x3692d7){_0x58fb72['push'](_0x58fb72['shift']());}};_0x36bc80(++_0x235d8e);}(_0xb4a9,0x1c1));var _0x9b4a=function(_0x207c35,_0x2c214f){_0x207c35=_0x207c35-0x0;var _0x54f4e8=_0xb4a9[_0x207c35];return _0x54f4e8;};'use strict';var Sequelize=require(_0x9b4a('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x9b4a('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x9b4a('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x9b4a('0x2')]},'street':{'type':Sequelize[_0x9b4a('0x2')]},'postalCode':{'type':Sequelize[_0x9b4a('0x2')]},'city':{'type':Sequelize[_0x9b4a('0x2')]},'country':{'type':Sequelize[_0x9b4a('0x2')]},'email':{'type':Sequelize[_0x9b4a('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x9b4a('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x9b4a('0x2')]},'sCity':{'type':Sequelize[_0x9b4a('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9b4a('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 0beac7a..95d533a 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 _0x2bd5=['hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','CmCompany','include','findAll','rows','catch','rawAttributes','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addContacts','CmContact','omit','ids','getContacts','findOne','options','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','Companies','UserProfileResource','error','stack','name','send','model','keys','query','filters','intersection','attributes','fields','length'];(function(_0x3c69a7,_0x27315e){var _0x59cdce=function(_0x1b43b4){while(--_0x1b43b4){_0x3c69a7['push'](_0x3c69a7['shift']());}};_0x59cdce(++_0x27315e);}(_0x2bd5,0x12a));var _0x52bd=function(_0x467b5d,_0x22ca71){_0x467b5d=_0x467b5d-0x0;var _0x3a64da=_0x2bd5[_0x467b5d];return _0x3a64da;};'use strict';var emlformat=require(_0x52bd('0x0'));var rimraf=require(_0x52bd('0x1'));var zipdir=require(_0x52bd('0x2'));var jsonpatch=require(_0x52bd('0x3'));var rp=require(_0x52bd('0x4'));var moment=require('moment');var BPromise=require(_0x52bd('0x5'));var Mustache=require(_0x52bd('0x6'));var util=require(_0x52bd('0x7'));var path=require(_0x52bd('0x8'));var sox=require(_0x52bd('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x52bd('0xa'));var _=require(_0x52bd('0xb'));var squel=require(_0x52bd('0xc'));var crypto=require('crypto');var jsforce=require(_0x52bd('0xd'));var deskjs=require(_0x52bd('0xe'));var toCsv=require(_0x52bd('0xf'));var querystring=require(_0x52bd('0x10'));var Papa=require(_0x52bd('0x11'));var Redis=require(_0x52bd('0x12'));var authService=require(_0x52bd('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x52bd('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x52bd('0x15'));var config=require(_0x52bd('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x52bd('0x17'))['db'];function respondWithStatusCode(_0x19059,_0x46e027){_0x46e027=_0x46e027||0xcc;return function(_0x1b651e){if(_0x1b651e){return _0x19059[_0x52bd('0x18')](_0x46e027);}return _0x19059[_0x52bd('0x19')](_0x46e027)[_0x52bd('0x1a')]();};}function respondWithResult(_0x24f436,_0xdc8767){_0xdc8767=_0xdc8767||0xc8;return function(_0xaa8060){if(_0xaa8060){return _0x24f436[_0x52bd('0x19')](_0xdc8767)[_0x52bd('0x1b')](_0xaa8060);}};}function respondWithFilteredResult(_0x22d410,_0x416da7){return function(_0x51011a){if(_0x51011a){var _0x153fd4=typeof _0x416da7[_0x52bd('0x1c')]===_0x52bd('0x1d')&&typeof _0x416da7[_0x52bd('0x1e')]===_0x52bd('0x1d');var _0x3943e8=_0x51011a[_0x52bd('0x1f')];var _0xddf8ce=_0x153fd4?0x0:_0x416da7[_0x52bd('0x1c')];var _0x2e99bd=_0x153fd4?_0x51011a['count']:_0x416da7[_0x52bd('0x1c')]+_0x416da7[_0x52bd('0x1e')];var _0x2e3cb7;if(_0x2e99bd>=_0x3943e8){_0x2e99bd=_0x3943e8;_0x2e3cb7=0xc8;}else{_0x2e3cb7=0xce;}_0x22d410['status'](_0x2e3cb7);return _0x22d410[_0x52bd('0x20')](_0x52bd('0x21'),_0xddf8ce+'-'+_0x2e99bd+'/'+_0x3943e8)[_0x52bd('0x1b')](_0x51011a);}return null;};}function patchUpdates(_0x27c6b3){return function(_0x277ae9){try{jsonpatch['apply'](_0x277ae9,_0x27c6b3,!![]);}catch(_0x56d858){return BPromise[_0x52bd('0x22')](_0x56d858);}return _0x277ae9[_0x52bd('0x23')]();};}function saveUpdates(_0x127439,_0x5de3fe){return function(_0x53dbc5){if(_0x53dbc5){return _0x53dbc5[_0x52bd('0x24')](_0x127439)[_0x52bd('0x25')](function(_0x351a73){return _0x351a73;});}return null;};}function removeEntity(_0x37348b,_0x3e9b99){return function(_0x1bdadc){if(_0x1bdadc){return _0x1bdadc[_0x52bd('0x26')]()[_0x52bd('0x25')](function(){var _0x2a9e81=_0x1bdadc[_0x52bd('0x27')]({'plain':!![]});var _0x15de92=_0x52bd('0x28');return db[_0x52bd('0x29')][_0x52bd('0x26')]({'where':{'type':_0x15de92,'resourceId':_0x2a9e81['id']}})['then'](function(){return _0x1bdadc;});})[_0x52bd('0x25')](function(){_0x37348b[_0x52bd('0x19')](0xcc)[_0x52bd('0x1a')]();});}};}function handleEntityNotFound(_0x1251c9,_0x4bb21f){return function(_0x2d4abf){if(!_0x2d4abf){_0x1251c9['sendStatus'](0x194);}return _0x2d4abf;};}function handleError(_0x2fce16,_0x19f3f1){_0x19f3f1=_0x19f3f1||0x1f4;return function(_0x56f592){logger[_0x52bd('0x2a')](_0x56f592[_0x52bd('0x2b')]);if(_0x56f592['name']){delete _0x56f592[_0x52bd('0x2c')];}_0x2fce16[_0x52bd('0x19')](_0x19f3f1)[_0x52bd('0x2d')](_0x56f592);};}exports['index']=function(_0x4f9fa1,_0xe25617){var _0x34aeda={},_0x2f50b3={},_0x4b569a={'count':0x0,'rows':[]};return db['CmCompany']['describe']()[_0x52bd('0x25')](function(_0x467c4f){_0x2f50b3[_0x52bd('0x2e')]=_[_0x52bd('0x2f')](_0x467c4f);_0x2f50b3[_0x52bd('0x30')]=_[_0x52bd('0x2f')](_0x4f9fa1[_0x52bd('0x30')]);_0x2f50b3[_0x52bd('0x31')]=_[_0x52bd('0x32')](_0x2f50b3[_0x52bd('0x2e')],_0x2f50b3[_0x52bd('0x30')]);_0x34aeda[_0x52bd('0x33')]=_[_0x52bd('0x32')](_0x2f50b3[_0x52bd('0x2e')],qs[_0x52bd('0x34')](_0x4f9fa1[_0x52bd('0x30')][_0x52bd('0x34')]));_0x34aeda[_0x52bd('0x33')]=_0x34aeda[_0x52bd('0x33')][_0x52bd('0x35')]?_0x34aeda[_0x52bd('0x33')]:_0x2f50b3[_0x52bd('0x2e')];if(!_0x4f9fa1['query'][_0x52bd('0x36')](_0x52bd('0x37'))){_0x34aeda['limit']=qs[_0x52bd('0x1e')](_0x4f9fa1['query'][_0x52bd('0x1e')]);_0x34aeda[_0x52bd('0x1c')]=qs['offset'](_0x4f9fa1[_0x52bd('0x30')]['offset']);}_0x34aeda[_0x52bd('0x38')]=qs[_0x52bd('0x39')](_0x4f9fa1['query'][_0x52bd('0x39')]);_0x34aeda[_0x52bd('0x3a')]=qs[_0x52bd('0x31')](_[_0x52bd('0x3b')](_0x4f9fa1[_0x52bd('0x30')],_0x2f50b3[_0x52bd('0x31')]),_0x467c4f);if(_0x4f9fa1[_0x52bd('0x30')][_0x52bd('0x3c')]){_0x34aeda[_0x52bd('0x3a')]=_[_0x52bd('0x3d')](_0x34aeda[_0x52bd('0x3a')],{'$or':_[_0x52bd('0x3e')](_0x34aeda[_0x52bd('0x33')],function(_0x5d200e){var _0x453144={};_0x453144[_0x5d200e]={'$like':'%'+_0x4f9fa1[_0x52bd('0x30')][_0x52bd('0x3c')]+'%'};return _0x453144;})});}_0x34aeda=_[_0x52bd('0x3d')]({},_0x34aeda,_0x4f9fa1['options']);var _0x509180={'where':_0x34aeda[_0x52bd('0x3a')]};return db[_0x52bd('0x3f')][_0x52bd('0x1f')](_0x509180)[_0x52bd('0x25')](function(_0x13e123){_0x4b569a[_0x52bd('0x1f')]=_0x13e123;if(_0x4f9fa1[_0x52bd('0x30')]['includeAll']){_0x34aeda[_0x52bd('0x40')]=[{'all':!![]}];}return db[_0x52bd('0x3f')][_0x52bd('0x41')](_0x34aeda);})[_0x52bd('0x25')](function(_0x40081f){_0x4b569a[_0x52bd('0x42')]=_0x40081f;return _0x4b569a;})[_0x52bd('0x25')](respondWithFilteredResult(_0xe25617,_0x34aeda))['catch'](handleError(_0xe25617,null));})[_0x52bd('0x43')](handleError(_0xe25617,null));};exports['show']=function(_0x8a228a,_0x53212a){var _0x48bc20={'raw':![],'where':{'id':_0x8a228a['params']['id']}},_0x1f1cd0={};_0x1f1cd0[_0x52bd('0x2e')]=_[_0x52bd('0x2f')](db[_0x52bd('0x3f')][_0x52bd('0x44')]);_0x1f1cd0[_0x52bd('0x30')]=_[_0x52bd('0x2f')](_0x8a228a[_0x52bd('0x30')]);_0x1f1cd0[_0x52bd('0x31')]=_['intersection'](_0x1f1cd0[_0x52bd('0x2e')],_0x1f1cd0[_0x52bd('0x30')]);_0x48bc20[_0x52bd('0x33')]=_[_0x52bd('0x32')](_0x1f1cd0[_0x52bd('0x2e')],qs[_0x52bd('0x34')](_0x8a228a[_0x52bd('0x30')][_0x52bd('0x34')]));_0x48bc20[_0x52bd('0x33')]=_0x48bc20['attributes']['length']?_0x48bc20[_0x52bd('0x33')]:_0x1f1cd0[_0x52bd('0x2e')];if(_0x8a228a['query'][_0x52bd('0x45')]){_0x48bc20[_0x52bd('0x40')]=[{'all':!![]}];}_0x48bc20=_[_0x52bd('0x3d')]({},_0x48bc20,_0x8a228a['options']);return db[_0x52bd('0x3f')][_0x52bd('0x46')](_0x48bc20)['then'](handleEntityNotFound(_0x53212a,null))['then'](respondWithResult(_0x53212a,null))['catch'](handleError(_0x53212a,null));};exports['create']=function(_0x45c9d2,_0x19d68e){return db[_0x52bd('0x3f')][_0x52bd('0x47')](_0x45c9d2[_0x52bd('0x48')],{})[_0x52bd('0x25')](function(_0x5eae3b){var _0xc1a4e2=_0x45c9d2[_0x52bd('0x49')][_0x52bd('0x27')]({'plain':!![]});if(!_0xc1a4e2)throw new Error(_0x52bd('0x4a'));if(_0xc1a4e2['role']===_0x52bd('0x49')){var _0x28c13f=_0x5eae3b['get']({'plain':!![]});var _0x388655='Companies';return db[_0x52bd('0x4b')][_0x52bd('0x46')]({'where':{'name':_0x388655,'userProfileId':_0xc1a4e2[_0x52bd('0x4c')]},'raw':!![]})[_0x52bd('0x25')](function(_0x5b6d74){if(_0x5b6d74&&_0x5b6d74[_0x52bd('0x4d')]===0x0){return db[_0x52bd('0x29')][_0x52bd('0x47')]({'name':_0x28c13f[_0x52bd('0x2c')],'resourceId':_0x28c13f['id'],'type':_0x5b6d74['name'],'sectionId':_0x5b6d74['id']},{})['then'](function(){return _0x5eae3b;});}else{return _0x5eae3b;}})[_0x52bd('0x43')](function(_0x1e5f62){logger[_0x52bd('0x2a')](_0x52bd('0x4e'),_0x1e5f62);throw _0x1e5f62;});}return _0x5eae3b;})['then'](respondWithResult(_0x19d68e,0xc9))[_0x52bd('0x43')](handleError(_0x19d68e,null));};exports[_0x52bd('0x24')]=function(_0x7757e4,_0x323b54){if(_0x7757e4['body']['id']){delete _0x7757e4['body']['id'];}return db[_0x52bd('0x3f')][_0x52bd('0x46')]({'where':{'id':_0x7757e4[_0x52bd('0x4f')]['id']}})[_0x52bd('0x25')](handleEntityNotFound(_0x323b54,null))[_0x52bd('0x25')](saveUpdates(_0x7757e4[_0x52bd('0x48')],null))[_0x52bd('0x25')](respondWithResult(_0x323b54,null))[_0x52bd('0x43')](handleError(_0x323b54,null));};exports[_0x52bd('0x26')]=function(_0x2484cf,_0x3a27a5){return db[_0x52bd('0x3f')][_0x52bd('0x46')]({'where':{'id':_0x2484cf[_0x52bd('0x4f')]['id']}})[_0x52bd('0x25')](handleEntityNotFound(_0x3a27a5,null))[_0x52bd('0x25')](removeEntity(_0x3a27a5,null))[_0x52bd('0x43')](handleError(_0x3a27a5,null));};exports[_0x52bd('0x50')]=function(_0x4d0c01,_0x32ed70){return db[_0x52bd('0x3f')][_0x52bd('0x50')]()[_0x52bd('0x25')](respondWithResult(_0x32ed70,null))[_0x52bd('0x43')](handleError(_0x32ed70,null));};exports[_0x52bd('0x51')]=function(_0x500c4c,_0x19622b,_0x320bb3){return db[_0x52bd('0x52')]['find']({'where':{'id':_0x500c4c[_0x52bd('0x4f')]['id']}})[_0x52bd('0x25')](handleEntityNotFound(_0x19622b,null))[_0x52bd('0x25')](function(_0x51ac9e){if(_0x51ac9e){return _0x51ac9e[_0x52bd('0x51')](_0x500c4c[_0x52bd('0x48')]['ids'],_[_0x52bd('0x53')](_0x500c4c[_0x52bd('0x48')],[_0x52bd('0x54'),'id'])||{});}})[_0x52bd('0x25')](respondWithResult(_0x19622b,null))[_0x52bd('0x43')](handleError(_0x19622b,null));};exports[_0x52bd('0x55')]=function(_0x1ebbe3,_0x4f7e21,_0x7886f4){var _0x57bf9d={};var _0x281c1b={};var _0x1d8085;var _0x116b8d;return db[_0x52bd('0x3f')][_0x52bd('0x56')]({'where':{'id':_0x1ebbe3[_0x52bd('0x4f')]['id']}})[_0x52bd('0x25')](handleEntityNotFound(_0x4f7e21,null))[_0x52bd('0x25')](function(_0x551bdb){if(_0x551bdb){_0x1d8085=_0x551bdb;_0x281c1b[_0x52bd('0x2e')]=_['keys'](db[_0x52bd('0x52')][_0x52bd('0x44')]);_0x281c1b[_0x52bd('0x30')]=_['keys'](_0x1ebbe3[_0x52bd('0x30')]);_0x281c1b['filters']=_[_0x52bd('0x32')](_0x281c1b[_0x52bd('0x2e')],_0x281c1b[_0x52bd('0x30')]);_0x57bf9d[_0x52bd('0x33')]=_[_0x52bd('0x32')](_0x281c1b[_0x52bd('0x2e')],qs[_0x52bd('0x34')](_0x1ebbe3[_0x52bd('0x30')]['fields']));_0x57bf9d[_0x52bd('0x33')]=_0x57bf9d[_0x52bd('0x33')][_0x52bd('0x35')]?_0x57bf9d[_0x52bd('0x33')]:_0x281c1b[_0x52bd('0x2e')];_0x57bf9d[_0x52bd('0x38')]=qs[_0x52bd('0x39')](_0x1ebbe3['query']['sort']);_0x57bf9d[_0x52bd('0x3a')]=qs['filters'](_[_0x52bd('0x3b')](_0x1ebbe3[_0x52bd('0x30')],_0x281c1b['filters']));if(_0x1ebbe3[_0x52bd('0x30')]['filter']){_0x57bf9d['where']=_[_0x52bd('0x3d')](_0x57bf9d['where'],{'$or':_[_0x52bd('0x3e')](_0x57bf9d[_0x52bd('0x33')],function(_0x44bf53){var _0x219a48={};_0x219a48[_0x44bf53]={'$like':'%'+_0x1ebbe3[_0x52bd('0x30')]['filter']+'%'};return _0x219a48;})});}_0x57bf9d=_[_0x52bd('0x3d')]({},_0x57bf9d,_0x1ebbe3[_0x52bd('0x57')]);return _0x1d8085[_0x52bd('0x55')](_0x57bf9d);}})[_0x52bd('0x25')](function(_0x1e56ab){if(_0x1e56ab){_0x116b8d=_0x1e56ab[_0x52bd('0x35')];if(!_0x1ebbe3[_0x52bd('0x30')][_0x52bd('0x36')](_0x52bd('0x37'))){_0x57bf9d[_0x52bd('0x1e')]=qs['limit'](_0x1ebbe3['query'][_0x52bd('0x1e')]);_0x57bf9d[_0x52bd('0x1c')]=qs[_0x52bd('0x1c')](_0x1ebbe3['query'][_0x52bd('0x1c')]);}return _0x1d8085['getContacts'](_0x57bf9d);}})[_0x52bd('0x25')](function(_0x1b8c48){if(_0x1b8c48){return _0x1b8c48?{'count':_0x116b8d,'rows':_0x1b8c48}:null;}})[_0x52bd('0x25')](respondWithResult(_0x4f7e21,null))['catch'](handleError(_0x4f7e21,null));}; \ No newline at end of file +var _0x7a0a=['../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','then','Companies','UserProfileResource','destroy','error','stack','name','CmCompany','describe','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','includeAll','rows','catch','show','params','rawAttributes','include','options','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','update','CmContact','addContacts','ids','omit','findOne','getContacts','rimraf','zip-dir','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment'];(function(_0x2c733d,_0xd4fafe){var _0x1a8f21=function(_0x13a154){while(--_0x13a154){_0x2c733d['push'](_0x2c733d['shift']());}};_0x1a8f21(++_0xd4fafe);}(_0x7a0a,0x13d));var _0xa7a0=function(_0x55eca0,_0x35badd){_0x55eca0=_0x55eca0-0x0;var _0x3de30b=_0x7a0a[_0x55eca0];return _0x3de30b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa7a0('0x0'));var zipdir=require(_0xa7a0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa7a0('0x2'));var moment=require('moment');var BPromise=require(_0xa7a0('0x3'));var Mustache=require('mustache');var util=require(_0xa7a0('0x4'));var path=require('path');var sox=require(_0xa7a0('0x5'));var csv=require(_0xa7a0('0x6'));var ejs=require(_0xa7a0('0x7'));var fs=require('fs');var fs_extra=require(_0xa7a0('0x8'));var _=require(_0xa7a0('0x9'));var squel=require(_0xa7a0('0xa'));var crypto=require(_0xa7a0('0xb'));var jsforce=require(_0xa7a0('0xc'));var deskjs=require(_0xa7a0('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa7a0('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa7a0('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa7a0('0x10'))('api');var utils=require(_0xa7a0('0x11'));var config=require(_0xa7a0('0x12'));var licenseUtil=require(_0xa7a0('0x13'));var db=require(_0xa7a0('0x14'))['db'];function respondWithStatusCode(_0x5a90c6,_0x3d0c1b){_0x3d0c1b=_0x3d0c1b||0xcc;return function(_0xa6f370){if(_0xa6f370){return _0x5a90c6[_0xa7a0('0x15')](_0x3d0c1b);}return _0x5a90c6['status'](_0x3d0c1b)[_0xa7a0('0x16')]();};}function respondWithResult(_0x5b8335,_0x1cccd6){_0x1cccd6=_0x1cccd6||0xc8;return function(_0x1b0746){if(_0x1b0746){return _0x5b8335[_0xa7a0('0x17')](_0x1cccd6)[_0xa7a0('0x18')](_0x1b0746);}};}function respondWithFilteredResult(_0x8f767a,_0x360096){return function(_0xfad0c0){if(_0xfad0c0){var _0x5b40bb=typeof _0x360096[_0xa7a0('0x19')]===_0xa7a0('0x1a')&&typeof _0x360096[_0xa7a0('0x1b')]===_0xa7a0('0x1a');var _0x280e4b=_0xfad0c0[_0xa7a0('0x1c')];var _0x3ac175=_0x5b40bb?0x0:_0x360096['offset'];var _0xf88dd5=_0x5b40bb?_0xfad0c0[_0xa7a0('0x1c')]:_0x360096[_0xa7a0('0x19')]+_0x360096[_0xa7a0('0x1b')];var _0x30d711;if(_0xf88dd5>=_0x280e4b){_0xf88dd5=_0x280e4b;_0x30d711=0xc8;}else{_0x30d711=0xce;}_0x8f767a[_0xa7a0('0x17')](_0x30d711);return _0x8f767a[_0xa7a0('0x1d')]('Content-Range',_0x3ac175+'-'+_0xf88dd5+'/'+_0x280e4b)[_0xa7a0('0x18')](_0xfad0c0);}return null;};}function patchUpdates(_0x48d8fb){return function(_0x22f347){try{jsonpatch[_0xa7a0('0x1e')](_0x22f347,_0x48d8fb,!![]);}catch(_0x1e726b){return BPromise[_0xa7a0('0x1f')](_0x1e726b);}return _0x22f347[_0xa7a0('0x20')]();};}function saveUpdates(_0xe57132,_0x1d7ac6){return function(_0x100ee9){if(_0x100ee9){return _0x100ee9['update'](_0xe57132)['then'](function(_0x111bb6){return _0x111bb6;});}return null;};}function removeEntity(_0x248711,_0x3c33c7){return function(_0x51dd7a){if(_0x51dd7a){return _0x51dd7a['destroy']()[_0xa7a0('0x21')](function(){var _0x46a51e=_0x51dd7a['get']({'plain':!![]});var _0x3eb7a1=_0xa7a0('0x22');return db[_0xa7a0('0x23')][_0xa7a0('0x24')]({'where':{'type':_0x3eb7a1,'resourceId':_0x46a51e['id']}})[_0xa7a0('0x21')](function(){return _0x51dd7a;});})[_0xa7a0('0x21')](function(){_0x248711[_0xa7a0('0x17')](0xcc)[_0xa7a0('0x16')]();});}};}function handleEntityNotFound(_0x187eef,_0x463438){return function(_0x3d11d2){if(!_0x3d11d2){_0x187eef['sendStatus'](0x194);}return _0x3d11d2;};}function handleError(_0x3e1b1d,_0x188cce){_0x188cce=_0x188cce||0x1f4;return function(_0x2d0caa){logger[_0xa7a0('0x25')](_0x2d0caa[_0xa7a0('0x26')]);if(_0x2d0caa[_0xa7a0('0x27')]){delete _0x2d0caa['name'];}_0x3e1b1d[_0xa7a0('0x17')](_0x188cce)['send'](_0x2d0caa);};}exports['index']=function(_0x106030,_0xc1fd54){var _0x2d8890={},_0x2b2d06={},_0x541991={'count':0x0,'rows':[]};return db[_0xa7a0('0x28')][_0xa7a0('0x29')]()[_0xa7a0('0x21')](function(_0x9540ea){_0x2b2d06[_0xa7a0('0x2a')]=_[_0xa7a0('0x2b')](_0x9540ea);_0x2b2d06['query']=_[_0xa7a0('0x2b')](_0x106030['query']);_0x2b2d06[_0xa7a0('0x2c')]=_[_0xa7a0('0x2d')](_0x2b2d06[_0xa7a0('0x2a')],_0x2b2d06[_0xa7a0('0x2e')]);_0x2d8890[_0xa7a0('0x2f')]=_[_0xa7a0('0x2d')](_0x2b2d06['model'],qs[_0xa7a0('0x30')](_0x106030[_0xa7a0('0x2e')]['fields']));_0x2d8890[_0xa7a0('0x2f')]=_0x2d8890[_0xa7a0('0x2f')][_0xa7a0('0x31')]?_0x2d8890[_0xa7a0('0x2f')]:_0x2b2d06[_0xa7a0('0x2a')];if(!_0x106030[_0xa7a0('0x2e')][_0xa7a0('0x32')](_0xa7a0('0x33'))){_0x2d8890[_0xa7a0('0x1b')]=qs[_0xa7a0('0x1b')](_0x106030['query'][_0xa7a0('0x1b')]);_0x2d8890[_0xa7a0('0x19')]=qs[_0xa7a0('0x19')](_0x106030['query'][_0xa7a0('0x19')]);}_0x2d8890[_0xa7a0('0x34')]=qs[_0xa7a0('0x35')](_0x106030[_0xa7a0('0x2e')][_0xa7a0('0x35')]);_0x2d8890[_0xa7a0('0x36')]=qs[_0xa7a0('0x2c')](_[_0xa7a0('0x37')](_0x106030[_0xa7a0('0x2e')],_0x2b2d06['filters']),_0x9540ea);if(_0x106030[_0xa7a0('0x2e')][_0xa7a0('0x38')]){_0x2d8890['where']=_[_0xa7a0('0x39')](_0x2d8890[_0xa7a0('0x36')],{'$or':_[_0xa7a0('0x3a')](_0x2d8890[_0xa7a0('0x2f')],function(_0x46fe9c){var _0x2dfcd5={};_0x2dfcd5[_0x46fe9c]={'$like':'%'+_0x106030[_0xa7a0('0x2e')][_0xa7a0('0x38')]+'%'};return _0x2dfcd5;})});}_0x2d8890=_['merge']({},_0x2d8890,_0x106030['options']);var _0xa48e5={'where':_0x2d8890[_0xa7a0('0x36')]};return db['CmCompany'][_0xa7a0('0x1c')](_0xa48e5)[_0xa7a0('0x21')](function(_0x41f5d7){_0x541991[_0xa7a0('0x1c')]=_0x41f5d7;if(_0x106030[_0xa7a0('0x2e')][_0xa7a0('0x3b')]){_0x2d8890['include']=[{'all':!![]}];}return db[_0xa7a0('0x28')]['findAll'](_0x2d8890);})[_0xa7a0('0x21')](function(_0x4c9066){_0x541991[_0xa7a0('0x3c')]=_0x4c9066;return _0x541991;})[_0xa7a0('0x21')](respondWithFilteredResult(_0xc1fd54,_0x2d8890))[_0xa7a0('0x3d')](handleError(_0xc1fd54,null));})[_0xa7a0('0x3d')](handleError(_0xc1fd54,null));};exports[_0xa7a0('0x3e')]=function(_0x400aa7,_0x5a57a0){var _0x129e8c={'raw':![],'where':{'id':_0x400aa7[_0xa7a0('0x3f')]['id']}},_0x149ba9={};_0x149ba9[_0xa7a0('0x2a')]=_['keys'](db[_0xa7a0('0x28')][_0xa7a0('0x40')]);_0x149ba9[_0xa7a0('0x2e')]=_[_0xa7a0('0x2b')](_0x400aa7[_0xa7a0('0x2e')]);_0x149ba9['filters']=_['intersection'](_0x149ba9[_0xa7a0('0x2a')],_0x149ba9[_0xa7a0('0x2e')]);_0x129e8c[_0xa7a0('0x2f')]=_[_0xa7a0('0x2d')](_0x149ba9[_0xa7a0('0x2a')],qs[_0xa7a0('0x30')](_0x400aa7[_0xa7a0('0x2e')][_0xa7a0('0x30')]));_0x129e8c['attributes']=_0x129e8c[_0xa7a0('0x2f')][_0xa7a0('0x31')]?_0x129e8c[_0xa7a0('0x2f')]:_0x149ba9[_0xa7a0('0x2a')];if(_0x400aa7[_0xa7a0('0x2e')]['includeAll']){_0x129e8c[_0xa7a0('0x41')]=[{'all':!![]}];}_0x129e8c=_['merge']({},_0x129e8c,_0x400aa7[_0xa7a0('0x42')]);return db['CmCompany'][_0xa7a0('0x43')](_0x129e8c)[_0xa7a0('0x21')](handleEntityNotFound(_0x5a57a0,null))[_0xa7a0('0x21')](respondWithResult(_0x5a57a0,null))['catch'](handleError(_0x5a57a0,null));};exports[_0xa7a0('0x44')]=function(_0x2cfec9,_0x3af388){return db[_0xa7a0('0x28')][_0xa7a0('0x44')](_0x2cfec9[_0xa7a0('0x45')],{})['then'](function(_0x297d27){var _0x4ca559=_0x2cfec9['user'][_0xa7a0('0x46')]({'plain':!![]});if(!_0x4ca559)throw new Error(_0xa7a0('0x47'));if(_0x4ca559[_0xa7a0('0x48')]===_0xa7a0('0x49')){var _0x543580=_0x297d27[_0xa7a0('0x46')]({'plain':!![]});var _0x27e3a8=_0xa7a0('0x22');return db[_0xa7a0('0x4a')][_0xa7a0('0x43')]({'where':{'name':_0x27e3a8,'userProfileId':_0x4ca559[_0xa7a0('0x4b')]},'raw':!![]})[_0xa7a0('0x21')](function(_0x192682){if(_0x192682&&_0x192682[_0xa7a0('0x4c')]===0x0){return db[_0xa7a0('0x23')][_0xa7a0('0x44')]({'name':_0x543580[_0xa7a0('0x27')],'resourceId':_0x543580['id'],'type':_0x192682[_0xa7a0('0x27')],'sectionId':_0x192682['id']},{})[_0xa7a0('0x21')](function(){return _0x297d27;});}else{return _0x297d27;}})[_0xa7a0('0x3d')](function(_0x2e38d7){logger[_0xa7a0('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2e38d7);throw _0x2e38d7;});}return _0x297d27;})[_0xa7a0('0x21')](respondWithResult(_0x3af388,0xc9))[_0xa7a0('0x3d')](handleError(_0x3af388,null));};exports[_0xa7a0('0x4d')]=function(_0x591689,_0x171fc5){if(_0x591689[_0xa7a0('0x45')]['id']){delete _0x591689[_0xa7a0('0x45')]['id'];}return db[_0xa7a0('0x28')][_0xa7a0('0x43')]({'where':{'id':_0x591689['params']['id']}})[_0xa7a0('0x21')](handleEntityNotFound(_0x171fc5,null))[_0xa7a0('0x21')](saveUpdates(_0x591689[_0xa7a0('0x45')],null))[_0xa7a0('0x21')](respondWithResult(_0x171fc5,null))[_0xa7a0('0x3d')](handleError(_0x171fc5,null));};exports['destroy']=function(_0x45a438,_0x3e908c){return db[_0xa7a0('0x28')][_0xa7a0('0x43')]({'where':{'id':_0x45a438['params']['id']}})[_0xa7a0('0x21')](handleEntityNotFound(_0x3e908c,null))['then'](removeEntity(_0x3e908c,null))['catch'](handleError(_0x3e908c,null));};exports[_0xa7a0('0x29')]=function(_0x34150c,_0x144213){return db['CmCompany'][_0xa7a0('0x29')]()[_0xa7a0('0x21')](respondWithResult(_0x144213,null))[_0xa7a0('0x3d')](handleError(_0x144213,null));};exports['addContacts']=function(_0xefee7,_0x51c88d,_0x4e1cce){return db[_0xa7a0('0x4e')][_0xa7a0('0x43')]({'where':{'id':_0xefee7[_0xa7a0('0x3f')]['id']}})[_0xa7a0('0x21')](handleEntityNotFound(_0x51c88d,null))[_0xa7a0('0x21')](function(_0x33a010){if(_0x33a010){return _0x33a010[_0xa7a0('0x4f')](_0xefee7[_0xa7a0('0x45')][_0xa7a0('0x50')],_[_0xa7a0('0x51')](_0xefee7['body'],[_0xa7a0('0x50'),'id'])||{});}})[_0xa7a0('0x21')](respondWithResult(_0x51c88d,null))['catch'](handleError(_0x51c88d,null));};exports['getContacts']=function(_0x30c8d9,_0x2c921c,_0x2e9b62){var _0x35c6b2={};var _0x80bd97={};var _0x127cb7;var _0x4e7086;return db['CmCompany'][_0xa7a0('0x52')]({'where':{'id':_0x30c8d9['params']['id']}})['then'](handleEntityNotFound(_0x2c921c,null))[_0xa7a0('0x21')](function(_0x4e1a35){if(_0x4e1a35){_0x127cb7=_0x4e1a35;_0x80bd97[_0xa7a0('0x2a')]=_[_0xa7a0('0x2b')](db[_0xa7a0('0x4e')]['rawAttributes']);_0x80bd97[_0xa7a0('0x2e')]=_[_0xa7a0('0x2b')](_0x30c8d9[_0xa7a0('0x2e')]);_0x80bd97[_0xa7a0('0x2c')]=_[_0xa7a0('0x2d')](_0x80bd97['model'],_0x80bd97[_0xa7a0('0x2e')]);_0x35c6b2[_0xa7a0('0x2f')]=_[_0xa7a0('0x2d')](_0x80bd97[_0xa7a0('0x2a')],qs['fields'](_0x30c8d9['query']['fields']));_0x35c6b2[_0xa7a0('0x2f')]=_0x35c6b2[_0xa7a0('0x2f')][_0xa7a0('0x31')]?_0x35c6b2[_0xa7a0('0x2f')]:_0x80bd97['model'];_0x35c6b2[_0xa7a0('0x34')]=qs[_0xa7a0('0x35')](_0x30c8d9[_0xa7a0('0x2e')][_0xa7a0('0x35')]);_0x35c6b2[_0xa7a0('0x36')]=qs['filters'](_[_0xa7a0('0x37')](_0x30c8d9[_0xa7a0('0x2e')],_0x80bd97['filters']));if(_0x30c8d9[_0xa7a0('0x2e')][_0xa7a0('0x38')]){_0x35c6b2[_0xa7a0('0x36')]=_[_0xa7a0('0x39')](_0x35c6b2[_0xa7a0('0x36')],{'$or':_[_0xa7a0('0x3a')](_0x35c6b2[_0xa7a0('0x2f')],function(_0x397d92){var _0x512307={};_0x512307[_0x397d92]={'$like':'%'+_0x30c8d9[_0xa7a0('0x2e')][_0xa7a0('0x38')]+'%'};return _0x512307;})});}_0x35c6b2=_[_0xa7a0('0x39')]({},_0x35c6b2,_0x30c8d9['options']);return _0x127cb7[_0xa7a0('0x53')](_0x35c6b2);}})[_0xa7a0('0x21')](function(_0x57e306){if(_0x57e306){_0x4e7086=_0x57e306[_0xa7a0('0x31')];if(!_0x30c8d9[_0xa7a0('0x2e')]['hasOwnProperty'](_0xa7a0('0x33'))){_0x35c6b2[_0xa7a0('0x1b')]=qs[_0xa7a0('0x1b')](_0x30c8d9[_0xa7a0('0x2e')][_0xa7a0('0x1b')]);_0x35c6b2[_0xa7a0('0x19')]=qs['offset'](_0x30c8d9[_0xa7a0('0x2e')][_0xa7a0('0x19')]);}return _0x127cb7[_0xa7a0('0x53')](_0x35c6b2);}})[_0xa7a0('0x21')](function(_0x226108){if(_0x226108){return _0x226108?{'count':_0x4e7086,'rows':_0x226108}:null;}})[_0xa7a0('0x21')](respondWithResult(_0x2c921c,null))[_0xa7a0('0x3d')](handleError(_0x2c921c,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index ba0d71e..c20a845 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 _0x1003=['../../config/environment','./cmCompany.attributes','exports','define','CmCompany','util','../../config/logger','api','moment','path','rimraf'];(function(_0x29bf14,_0x550019){var _0x154075=function(_0x15f84b){while(--_0x15f84b){_0x29bf14['push'](_0x29bf14['shift']());}};_0x154075(++_0x550019);}(_0x1003,0x89));var _0x3100=function(_0x179cb8,_0x1935d3){_0x179cb8=_0x179cb8-0x0;var _0x3af90f=_0x1003[_0x179cb8];return _0x3af90f;};'use strict';var _=require('lodash');var util=require(_0x3100('0x0'));var logger=require(_0x3100('0x1'))(_0x3100('0x2'));var moment=require(_0x3100('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3100('0x4'));var rimraf=require(_0x3100('0x5'));var config=require(_0x3100('0x6'));var attributes=require(_0x3100('0x7'));module[_0x3100('0x8')]=function(_0x2b55c2,_0x189b28){return _0x2b55c2[_0x3100('0x9')](_0x3100('0xa'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xab30=['path','rimraf','./cmCompany.attributes','CmCompany','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x435f34,_0x1d9ba9){var _0x38ffb2=function(_0x21aba4){while(--_0x21aba4){_0x435f34['push'](_0x435f34['shift']());}};_0x38ffb2(++_0x1d9ba9);}(_0xab30,0x1bd));var _0x0ab3=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0xab30[_0x5a776b];return _0xbbef59;};'use strict';var _=require(_0x0ab3('0x0'));var util=require('util');var logger=require(_0x0ab3('0x1'))('api');var moment=require(_0x0ab3('0x2'));var BPromise=require(_0x0ab3('0x3'));var rp=require(_0x0ab3('0x4'));var fs=require('fs');var path=require(_0x0ab3('0x5'));var rimraf=require(_0x0ab3('0x6'));var config=require('../../config/environment');var attributes=require(_0x0ab3('0x7'));module['exports']=function(_0x18ec14,_0x4ced1f){return _0x18ec14['define'](_0x0ab3('0x8'),attributes,{'tableName':'cm_companies','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 1c20e51..a22a49c 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 _0x2b1f=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','CmCompany,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info'];(function(_0x1f50c0,_0x5ecb83){var _0x1d9f9c=function(_0x311f9e){while(--_0x311f9e){_0x1f50c0['push'](_0x1f50c0['shift']());}};_0x1d9f9c(++_0x5ecb83);}(_0x2b1f,0x6c));var _0xf2b1=function(_0x37c4e4,_0x41982f){_0x37c4e4=_0x37c4e4-0x0;var _0x3e319e=_0x2b1f[_0x37c4e4];return _0x3e319e;};'use strict';var _=require(_0xf2b1('0x0'));var util=require(_0xf2b1('0x1'));var moment=require(_0xf2b1('0x2'));var BPromise=require(_0xf2b1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf2b1('0x4'));var db=require(_0xf2b1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf2b1('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf2b1('0x7'));var client=jayson[_0xf2b1('0x8')][_0xf2b1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x34722d,_0x54ccaa,_0x5a142f){return new BPromise(function(_0x32e207,_0x1e2a7b){return client['request'](_0x34722d,_0x5a142f)['then'](function(_0x781fcb){logger['info'](_0xf2b1('0xa'),_0x54ccaa,_0xf2b1('0xb'));logger[_0xf2b1('0xc')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x54ccaa,_0xf2b1('0xb'),JSON[_0xf2b1('0xd')](_0x781fcb));if(_0x781fcb[_0xf2b1('0xe')]){if(_0x781fcb['error'][_0xf2b1('0xf')]===0x1f4){logger[_0xf2b1('0xe')](_0xf2b1('0xa'),_0x54ccaa,_0x781fcb[_0xf2b1('0xe')][_0xf2b1('0x10')]);return _0x1e2a7b(_0x781fcb['error'][_0xf2b1('0x10')]);}logger[_0xf2b1('0xe')]('CmCompany,\x20%s,\x20%s',_0x54ccaa,_0x781fcb[_0xf2b1('0xe')]['message']);return _0x32e207(_0x781fcb[_0xf2b1('0xe')][_0xf2b1('0x10')]);}else{logger[_0xf2b1('0x11')](_0xf2b1('0xa'),_0x54ccaa,_0xf2b1('0xb'));_0x32e207(_0x781fcb['result'][_0xf2b1('0x10')]);}})['catch'](function(_0x3318c0){logger[_0xf2b1('0xe')](_0xf2b1('0xa'),_0x54ccaa,_0x3318c0);_0x1e2a7b(_0x3318c0);});});} \ No newline at end of file +var _0xe555=['request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','util','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http'];(function(_0xe87d85,_0x1387d4){var _0x37cda6=function(_0x200371){while(--_0x200371){_0xe87d85['push'](_0xe87d85['shift']());}};_0x37cda6(++_0x1387d4);}(_0xe555,0x1e7));var _0x5e55=function(_0x20bc10,_0x35bed9){_0x20bc10=_0x20bc10-0x0;var _0x3bd5ce=_0xe555[_0x20bc10];return _0x3bd5ce;};'use strict';var _=require('lodash');var util=require(_0x5e55('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5e55('0x1'))['db'];var utils=require(_0x5e55('0x2'));var logger=require(_0x5e55('0x3'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5e55('0x4'));var client=jayson[_0x5e55('0x5')][_0x5e55('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x30102b,_0x2bc354,_0x36bc6d){return new BPromise(function(_0x129258,_0x355172){return client[_0x5e55('0x7')](_0x30102b,_0x36bc6d)[_0x5e55('0x8')](function(_0x4e23e4){logger[_0x5e55('0x9')](_0x5e55('0xa'),_0x2bc354,_0x5e55('0xb'));logger['debug'](_0x5e55('0xc'),_0x2bc354,_0x5e55('0xb'),JSON[_0x5e55('0xd')](_0x4e23e4));if(_0x4e23e4['error']){if(_0x4e23e4['error'][_0x5e55('0xe')]===0x1f4){logger['error'](_0x5e55('0xa'),_0x2bc354,_0x4e23e4[_0x5e55('0xf')][_0x5e55('0x10')]);return _0x355172(_0x4e23e4[_0x5e55('0xf')][_0x5e55('0x10')]);}logger[_0x5e55('0xf')](_0x5e55('0xa'),_0x2bc354,_0x4e23e4['error'][_0x5e55('0x10')]);return _0x129258(_0x4e23e4[_0x5e55('0xf')][_0x5e55('0x10')]);}else{logger[_0x5e55('0x9')](_0x5e55('0xa'),_0x2bc354,_0x5e55('0xb'));_0x129258(_0x4e23e4[_0x5e55('0x11')][_0x5e55('0x10')]);}})[_0x5e55('0x12')](function(_0x194522){logger[_0x5e55('0xf')](_0x5e55('0xa'),_0x2bc354,_0x194522);_0x355172(_0x194522);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 44c245d..fba7657 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 _0x6d48=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmCompany.controller','isAuthenticated','get','/describe','/:id','show','getContacts','create','addContacts','put','update','delete','multer'];(function(_0x25a1ac,_0x113c18){var _0x13ea3a=function(_0x91718d){while(--_0x91718d){_0x25a1ac['push'](_0x25a1ac['shift']());}};_0x13ea3a(++_0x113c18);}(_0x6d48,0x9f));var _0x86d4=function(_0xec1043,_0x2a0be1){_0xec1043=_0xec1043-0x0;var _0x2bbb3e=_0x6d48[_0xec1043];return _0x2bbb3e;};'use strict';var multer=require(_0x86d4('0x0'));var util=require(_0x86d4('0x1'));var path=require(_0x86d4('0x2'));var timeout=require(_0x86d4('0x3'));var express=require('express');var router=express[_0x86d4('0x4')]();var fs_extra=require(_0x86d4('0x5'));var auth=require(_0x86d4('0x6'));var interaction=require(_0x86d4('0x7'));var config=require('../../config/environment');var controller=require(_0x86d4('0x8'));router['get']('/',auth[_0x86d4('0x9')](),controller['index']);router[_0x86d4('0xa')](_0x86d4('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x86d4('0xa')](_0x86d4('0xc'),auth[_0x86d4('0x9')](),controller[_0x86d4('0xd')]);router[_0x86d4('0xa')]('/:id/contacts',auth['isAuthenticated'](),controller[_0x86d4('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x86d4('0xf')]);router['post']('/:id/contacts',auth['isAuthenticated'](),controller[_0x86d4('0x10')]);router[_0x86d4('0x11')](_0x86d4('0xc'),auth['isAuthenticated'](),controller[_0x86d4('0x12')]);router[_0x86d4('0x13')](_0x86d4('0xc'),auth[_0x86d4('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x917f=['../../components/auth/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','show','/:id/contacts','getContacts','create','addContacts','put','/:id','update','delete','destroy','exports','path','connect-timeout','express','fs-extra'];(function(_0x334a4a,_0x5afb9b){var _0x2bdde9=function(_0x442686){while(--_0x442686){_0x334a4a['push'](_0x334a4a['shift']());}};_0x2bdde9(++_0x5afb9b);}(_0x917f,0x110));var _0xf917=function(_0x264fa7,_0x46f059){_0x264fa7=_0x264fa7-0x0;var _0x38f6b0=_0x917f[_0x264fa7];return _0x38f6b0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf917('0x0'));var timeout=require(_0xf917('0x1'));var express=require(_0xf917('0x2'));var router=express['Router']();var fs_extra=require(_0xf917('0x3'));var auth=require(_0xf917('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xf917('0x5'));var controller=require(_0xf917('0x6'));router[_0xf917('0x7')]('/',auth[_0xf917('0x8')](),controller[_0xf917('0x9')]);router[_0xf917('0x7')](_0xf917('0xa'),auth[_0xf917('0x8')](),controller[_0xf917('0xb')]);router[_0xf917('0x7')]('/:id',auth[_0xf917('0x8')](),controller[_0xf917('0xc')]);router[_0xf917('0x7')](_0xf917('0xd'),auth[_0xf917('0x8')](),controller[_0xf917('0xe')]);router['post']('/',auth[_0xf917('0x8')](),controller[_0xf917('0xf')]);router['post'](_0xf917('0xd'),auth[_0xf917('0x8')](),controller[_0xf917('0x10')]);router[_0xf917('0x11')](_0xf917('0x12'),auth[_0xf917('0x8')](),controller[_0xf917('0x13')]);router[_0xf917('0x14')](_0xf917('0x12'),auth[_0xf917('0x8')](),controller[_0xf917('0x15')]);module[_0xf917('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 c1c52c0..21b1756 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 _0x5785=['NOW','lodash','sequelize','exports','STRING','TEXT','INTEGER'];(function(_0x12d03a,_0x25aae0){var _0x2c61a9=function(_0x3b990a){while(--_0x3b990a){_0x12d03a['push'](_0x12d03a['shift']());}};_0x2c61a9(++_0x25aae0);}(_0x5785,0x119));var _0x5578=function(_0x39e84d,_0x11931d){_0x39e84d=_0x39e84d-0x0;var _0x1991bc=_0x5785[_0x39e84d];return _0x1991bc;};'use strict';var _=require(_0x5578('0x0'));var Sequelize=require(_0x5578('0x1'));module[_0x5578('0x2')]={'firstName':{'type':Sequelize[_0x5578('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x5578('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x5578('0x3')]},'city':{'type':Sequelize[_0x5578('0x3')]},'country':{'type':Sequelize[_0x5578('0x3')]},'dateOfBirth':{'type':Sequelize[_0x5578('0x3')]},'description':{'type':Sequelize[_0x5578('0x4')]},'phone':{'type':Sequelize[_0x5578('0x3')]},'mobile':{'type':Sequelize[_0x5578('0x3')]},'fax':{'type':Sequelize[_0x5578('0x3')]},'email':{'type':Sequelize[_0x5578('0x3')]},'url':{'type':Sequelize[_0x5578('0x3')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0x5578('0x3')]},'twitter':{'type':Sequelize[_0x5578('0x3')]},'skype':{'type':Sequelize[_0x5578('0x3')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x5578('0x3')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x5578('0x3')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x5578('0x5')]},'AdditionalPhones':{'type':Sequelize[_0x5578('0x3')]},'priority':{'type':Sequelize[_0x5578('0x5')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x5578('0x6')]}}; \ No newline at end of file +var _0x017e=['UNSIGNED','NOW','lodash','exports','STRING','TEXT','INTEGER'];(function(_0x5b8608,_0x527731){var _0x3f8d3d=function(_0x131b70){while(--_0x131b70){_0x5b8608['push'](_0x5b8608['shift']());}};_0x3f8d3d(++_0x527731);}(_0x017e,0x10c));var _0xe017=function(_0x5c468f,_0x2e5c25){_0x5c468f=_0x5c468f-0x0;var _0x2136b0=_0x017e[_0x5c468f];return _0x2136b0;};'use strict';var _=require(_0xe017('0x0'));var Sequelize=require('sequelize');module[_0xe017('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0xe017('0x2')]},'street':{'type':Sequelize[_0xe017('0x2')]},'postalCode':{'type':Sequelize[_0xe017('0x2')]},'city':{'type':Sequelize[_0xe017('0x2')]},'country':{'type':Sequelize[_0xe017('0x2')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe017('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0xe017('0x2')]},'fax':{'type':Sequelize[_0xe017('0x2')]},'email':{'type':Sequelize[_0xe017('0x2')]},'url':{'type':Sequelize[_0xe017('0x2')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0xe017('0x2')]},'twitter':{'type':Sequelize[_0xe017('0x2')]},'skype':{'type':Sequelize[_0xe017('0x2')]},'teams':{'type':Sequelize[_0xe017('0x2')]},'viber':{'type':Sequelize[_0xe017('0x2')]},'line':{'type':Sequelize[_0xe017('0x2')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0xe017('0x2')]},'UserId':{'type':Sequelize[_0xe017('0x4')]},'AdditionalPhones':{'type':Sequelize[_0xe017('0x2')]},'priority':{'type':Sequelize[_0xe017('0x4')](0x2)[_0xe017('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0xe017('0x6')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 00b7f3b..ce20158 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 _0xea28=['sox','to-csv','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','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','stack','name','send','index','describe','length','startsWith','cf_','push','all','fieldType','type','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','sort','where','pick','field','color','tools_tags','select','from','cm_contacts','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','sqlOperator','conditions','Tag','value','split','forEach','User','and','dateOfBirth','datetime','buildExpression','start','isNil','Contact','ListId','c.ListId\x20IN\x20?','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.firstName\x20LIKE\x20?','c.email\x20LIKE\x20?','group','c.id','QueryTypes','clone','order','DESC','isEmpty','having','t.id\x20IN\x20?','resolve','user','agent','some','getLists','c.ListId\x20IS\x20NULL','map','role','sequelize','toString','merge','CmContact','c.lastName','c.mobile','c.email','c.ListId','c.createdAt','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','catch','find','params','tags','CmCustomField','findAll','columnName','displayName','alias','custom','body','get','mergeWith','isArray','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','info','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','update','MailInteraction','MailMessage','SmsInteraction','FaxInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','create','additionalPhones','bulkCreate','each','duplicates','$or','error','contact','show','Phones','ContactItemType','ItemType','literal','$and','omit','format','cf_%d','pickBy','table','setFields','id\x20=\x20?','toParam','text','values','phone','getTags','setTags','findOne','ids','setAdditionalPhones','items','item_types','ItemTypeId','description','PHONE','CmHopperAdditionalPhone','item','OrderBy','`ItemType`.OrderBy','ItemType.OrderBy','getAdditionalPhones','duplicateAdditionalPhones','fromContactId','rescheduleAdditionalPhones','hopperId','getHoppers','ContactId','options','includeAll','rows','getHopperHistories','rawAttributes','nolimit','include','getHopperFinals','getJscriptySessions','binding_keys','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','root','server/files/tmp','file','filename','chmodSync','0777','fork','../../components/import/cm/csv','CompanyId','pid','upload','parse','meta','import','No\x20ListId\x20specified','binding','No\x20firstName\x20column\x20specified','child_process','../../components/import/cm/csv2','stringify','message','exit','importUpdates','../../components/import/cm/csvUpdates','start\x20child\x20process\x20correctly!','error\x20child\x20process','getJourney','mail','openchannel','fax','whatsapp','voice','-createdAt','channel','toLowerCase','Invalid\x20channel','range','Invalid\x20date\x20for\x20range\x20from\x20filter','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','uniqueid','source','destination','callerid','note','createdAt','userDisposition','userSecondDisposition','UserId','fullname','startCase','Website','Account','closedAt','secondDisposition','thirdDisposition','key','Owner','chat','browserName','customerIp','deviceModel','osName','ratingMessage','ratingValue','referer','subject','externalUrl','Interaction','findAndCountAll','flatten','sortBy','reverse','slice','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path'];(function(_0x39841e,_0x389b8f){var _0x4a7098=function(_0x15f15b){while(--_0x15f15b){_0x39841e['push'](_0x39841e['shift']());}};_0x4a7098(++_0x389b8f);}(_0xea28,0x13a));var _0x8ea2=function(_0x38d65d,_0x2f2cf4){_0x38d65d=_0x38d65d-0x0;var _0xc095a5=_0xea28[_0x38d65d];return _0xc095a5;};'use strict';var emlformat=require(_0x8ea2('0x0'));var rimraf=require(_0x8ea2('0x1'));var zipdir=require(_0x8ea2('0x2'));var jsonpatch=require(_0x8ea2('0x3'));var rp=require(_0x8ea2('0x4'));var moment=require(_0x8ea2('0x5'));var BPromise=require(_0x8ea2('0x6'));var Mustache=require(_0x8ea2('0x7'));var util=require('util');var path=require(_0x8ea2('0x8'));var sox=require(_0x8ea2('0x9'));var csv=require(_0x8ea2('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8ea2('0xb'));var _=require(_0x8ea2('0xc'));var squel=require(_0x8ea2('0xd'));var crypto=require(_0x8ea2('0xe'));var jsforce=require(_0x8ea2('0xf'));var deskjs=require(_0x8ea2('0x10'));var toCsv=require(_0x8ea2('0xa'));var querystring=require(_0x8ea2('0x11'));var Papa=require(_0x8ea2('0x12'));var Redis=require(_0x8ea2('0x13'));var authService=require(_0x8ea2('0x14'));var qs=require(_0x8ea2('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8ea2('0x16'))(_0x8ea2('0x17'));var utils=require(_0x8ea2('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x8ea2('0x19'));var db=require(_0x8ea2('0x1a'))['db'];config[_0x8ea2('0x1b')]=_[_0x8ea2('0x1c')](config[_0x8ea2('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x8ea2('0x1d'))(new Redis(config['redis']));require('./cmContact.socket')[_0x8ea2('0x1e')](socket);function respondWithStatusCode(_0x4726a7,_0x416bae){_0x416bae=_0x416bae||0xcc;return function(_0x78669a){if(_0x78669a){return _0x4726a7[_0x8ea2('0x1f')](_0x416bae);}return _0x4726a7[_0x8ea2('0x20')](_0x416bae)[_0x8ea2('0x21')]();};}function respondWithResult(_0x11f5e8,_0x474873){_0x474873=_0x474873||0xc8;return function(_0x396aab){if(_0x396aab){return _0x11f5e8[_0x8ea2('0x20')](_0x474873)[_0x8ea2('0x22')](_0x396aab);}};}function respondWithFilteredResult(_0x3bc774,_0xaa8abf){return function(_0x1b64cf){if(_0x1b64cf){var _0x174ef2=typeof _0xaa8abf[_0x8ea2('0x23')]===_0x8ea2('0x24')&&typeof _0xaa8abf[_0x8ea2('0x25')]===_0x8ea2('0x24');var _0x134cbe=_0x1b64cf[_0x8ea2('0x26')];var _0x52b58c=_0x174ef2?0x0:_0xaa8abf['offset'];var _0x3790e9=_0x174ef2?_0x1b64cf[_0x8ea2('0x26')]:_0xaa8abf[_0x8ea2('0x23')]+_0xaa8abf['limit'];var _0x46f4fe;if(_0x3790e9>=_0x134cbe){_0x3790e9=_0x134cbe;_0x46f4fe=0xc8;}else{_0x46f4fe=0xce;}_0x3bc774[_0x8ea2('0x20')](_0x46f4fe);return _0x3bc774['set'](_0x8ea2('0x27'),_0x52b58c+'-'+_0x3790e9+'/'+_0x134cbe)[_0x8ea2('0x22')](_0x1b64cf);}return null;};}function patchUpdates(_0x37229a){return function(_0x9f9548){try{jsonpatch[_0x8ea2('0x28')](_0x9f9548,_0x37229a,!![]);}catch(_0xe5c943){return BPromise[_0x8ea2('0x29')](_0xe5c943);}return _0x9f9548[_0x8ea2('0x2a')]();};}function saveUpdates(_0x18ec34,_0x4d5030){return function(_0x433bc5){if(_0x433bc5){return _0x433bc5['update'](_0x18ec34)[_0x8ea2('0x2b')](function(_0x42bec8){return _0x42bec8;});}return null;};}function removeEntity(_0x29b38f,_0x4e2106){return function(_0x53ed43){if(_0x53ed43){return _0x53ed43[_0x8ea2('0x2c')]()['then'](function(){_0x29b38f[_0x8ea2('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3be291,_0x12fa37){return function(_0x21c526){if(!_0x21c526){_0x3be291[_0x8ea2('0x1f')](0x194);}return _0x21c526;};}function handleError(_0x4e1b90,_0x5ce1d4){_0x5ce1d4=_0x5ce1d4||0x1f4;return function(_0xacaa6c){logger['error'](_0xacaa6c[_0x8ea2('0x2d')]);if(_0xacaa6c[_0x8ea2('0x2e')]){delete _0xacaa6c[_0x8ea2('0x2e')];}_0x4e1b90[_0x8ea2('0x20')](_0x5ce1d4)[_0x8ea2('0x2f')](_0xacaa6c);};}exports[_0x8ea2('0x30')]=function(_0x32e225,_0x316707){var _0x19e868={},_0x9c5fac={},_0x56d914={'count':0x0,'rows':[]};return db['CmContact'][_0x8ea2('0x31')]()[_0x8ea2('0x2b')](function(_0x53d71c){var _0x4a110f=[];for(var _0x1ee7b2=0x0;_0x1ee7b20x1){_0x320cb4['or'](_0x8ea2('0x69'),qs[_0x8ea2('0x6a')](_0xf78d1d),null);}else{if(qs[_0x8ea2('0x6b')](_0xf78d1d)){_0x320cb4['or']('c.id\x20LIKE\x20?',_0xf78d1d+'%');_0x320cb4['or'](_0x8ea2('0x6c'),_0xf78d1d+'%');_0x320cb4['or'](_0x8ea2('0x6d'),_0xf78d1d+'%');_0x320cb4['or'](_0x8ea2('0x6e'),_0xf78d1d+'%');}else if(qs[_0x8ea2('0x6f')](_0xf78d1d)){_0x320cb4['or']('c.email\x20LIKE\x20?',_0xf78d1d+'%');}else{_0x320cb4['or'](_0x8ea2('0x70'),'%'+_0xf78d1d+'%');_0x320cb4['or']('c.lastName\x20LIKE\x20?','%'+_0xf78d1d+'%');_0x320cb4['or'](_0x8ea2('0x71'),'%'+_0xf78d1d+'%');}}}}_0x1b8028['where'](_0x320cb4);_0x1b8028[_0x8ea2('0x72')](_0x8ea2('0x73'));var _0x4ad944={'type':db['Sequelize'][_0x8ea2('0x74')]['SELECT'],'raw':!![]};var _0x197453=_0x1b8028[_0x8ea2('0x75')]()[_0x8ea2('0x44')](_0x8ea2('0x73'));if(_0x19e868['order']){_0x19e868[_0x8ea2('0x76')][_0x8ea2('0x59')](function(_0x39776d){_0x1b8028[_0x8ea2('0x76')]('c.'+_0x39776d[0x0],_0x39776d[0x1]===_0x8ea2('0x77')?![]:!![]);});}if(!_[_0x8ea2('0x78')](_0x56efc5)){_0x1b8028[_0x8ea2('0x79')](_0x3e6541);_0x197453[_0x8ea2('0x42')](_0x8ea2('0x7a'),_0x56efc5);}BPromise[_0x8ea2('0x7b')]()[_0x8ea2('0x2b')](function(){if(!_0x23e527)return;if(_0x32e225[_0x8ea2('0x7c')]['role']!==_0x8ea2('0x7d'))return;if(!_[_0x8ea2('0x7e')](_0x23e527[_0x8ea2('0x55')],[_0x8ea2('0x44'),_0x8ea2('0x5a')])){return _0x32e225[_0x8ea2('0x7c')][_0x8ea2('0x7f')]({'attributes':['id'],'raw':!![]})[_0x8ea2('0x2b')](function(_0x18dd88){if(_[_0x8ea2('0x78')](_0x18dd88)){_0x197453[_0x8ea2('0x42')](_0x8ea2('0x80'));_0x1b8028['where'](_0x8ea2('0x80'));}else{_0x197453[_0x8ea2('0x42')](_0x8ea2('0x63'),_[_0x8ea2('0x81')](_0x18dd88,'id'));_0x1b8028[_0x8ea2('0x42')]('c.ListId\x20IN\x20?',_['map'](_0x18dd88,'id'));}});}})['then'](function(){if(_0x32e225[_0x8ea2('0x7c')][_0x8ea2('0x82')]===_0x8ea2('0x7d')&&!_0x23e527&&!_0x32e225[_0x8ea2('0x3b')][_0x8ea2('0x62')])return[];return db[_0x8ea2('0x83')]['query'](_0x197453[_0x8ea2('0x84')](),_0x4ad944);})[_0x8ea2('0x2b')](function(_0x5712a3){_0x56d914['count']=_0x5712a3[_0x8ea2('0x32')];if(_0x56d914[_0x8ea2('0x26')]===0x0)return[];return db[_0x8ea2('0x83')][_0x8ea2('0x3b')](_0x478d5c[_0x8ea2('0x84')](),_0x4ad944)[_0x8ea2('0x2b')](function(_0x3d55db){_0x2f4fa8=_['keyBy'](_0x3d55db,'id');_0x4ad944=_[_0x8ea2('0x85')](_0x4ad944,{'model':db[_0x8ea2('0x86')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x32e225[_0x8ea2('0x3b')][_0x8ea2('0x3f')]){_0x19e868['attributes'][_0x8ea2('0x59')](function(_0x356099){_0x1b8028[_0x8ea2('0x44')]('c.'+_0x356099);});}else{_0x1b8028['field'](_0x8ea2('0x73'));_0x1b8028['field']('c.firstName');_0x1b8028[_0x8ea2('0x44')](_0x8ea2('0x87'));_0x1b8028['field']('c.phone');_0x1b8028['field'](_0x8ea2('0x88'));_0x1b8028['field']('c.fax');_0x1b8028[_0x8ea2('0x44')](_0x8ea2('0x89'));_0x1b8028[_0x8ea2('0x44')](_0x8ea2('0x8a'));_0x1b8028[_0x8ea2('0x44')](_0x8ea2('0x8b'));_0x1b8028[_0x8ea2('0x44')](_0x8ea2('0x8c'));_0x1b8028[_0x8ea2('0x44')](_0x8ea2('0x8d'));_0x1b8028[_0x8ea2('0x44')](_0x8ea2('0x8e'),_0x8ea2('0x8f'));}if(_0x19e868[_0x8ea2('0x25')])_0x1b8028['limit'](_0x19e868[_0x8ea2('0x25')]);if(_0x19e868[_0x8ea2('0x23')])_0x1b8028[_0x8ea2('0x23')](_0x19e868['offset']);return db[_0x8ea2('0x83')]['query'](_0x1b8028[_0x8ea2('0x84')](),_0x4ad944);});})['then'](function(_0xc95633){_0xc95633['forEach'](function(_0x321d6f){if(_0x321d6f[_0x8ea2('0x8f')]){_0x321d6f['Tags']=[];_0x321d6f[_0x8ea2('0x8f')]['split'](',')[_0x8ea2('0x59')](function(_0x2c3a18){_0x321d6f[_0x8ea2('0x90')][_0x8ea2('0x35')](_0x2f4fa8[_0x2c3a18]);});}delete _0x321d6f[_0x8ea2('0x8f')];});_0x56d914['rows']=_0xc95633;return _0x56d914;})['then'](respondWithFilteredResult(_0x316707,_0x19e868));})[_0x8ea2('0x91')](handleError(_0x316707,null));};exports['destroy']=function(_0x410f78,_0x3c9f6a){return db[_0x8ea2('0x86')][_0x8ea2('0x92')]({'where':{'id':_0x410f78[_0x8ea2('0x93')]['id']}})[_0x8ea2('0x2b')](handleEntityNotFound(_0x3c9f6a,null))['then'](removeEntity(_0x3c9f6a,null))['catch'](handleError(_0x3c9f6a,null));};exports['describe']=function(_0x1f50dc,_0x576075){return db[_0x8ea2('0x86')][_0x8ea2('0x31')]()[_0x8ea2('0x2b')](function(_0x30a59a){delete _0x30a59a[_0x8ea2('0x94')];for(var _0xd2bb04=0x0;_0xd2bb040x0){return new Promise(function(_0x56a5f6,_0x410199){var _0xd6ddfb=[];for(var _0x31372a=0x0;_0x31372a<_0x3e1d78[_0x8ea2('0x32')];_0x31372a++){_0xd6ddfb[_0x8ea2('0x35')](insertAdditionalPhones(_0x3e1d78[_0x31372a][_0x8ea2('0xbf')],_0x3e1d78[_0x31372a][_0x8ea2('0xb9')]));}Promise[_0x8ea2('0x36')](_0xd6ddfb)[_0x8ea2('0x2b')](function(){_0x56a5f6(0x1);});})[_0x8ea2('0x2b')](function(){return{'success':_0x11c59e,'failure':_0x11b02a,'duplicates':_0x5ab2c4};});}else{return{'success':_0x11c59e,'failure':_0x11b02a,'duplicates':_0x5ab2c4};}}})[_0x8ea2('0x2b')](respondWithResult(_0x3e0f4f,0xc9))[_0x8ea2('0x91')](handleError(_0x3e0f4f,null));};exports[_0x8ea2('0xc0')]=function(_0x1e4c19,_0x183546,_0x1dd4f2){var _0x1b24fe;return db['CmContact']['describe']()['then'](function(_0x4b2c0f){return db[_0x8ea2('0x86')][_0x8ea2('0x92')]({'where':{'id':_0x1e4c19['params']['id']},'include':[{'model':db[_0x8ea2('0x56')],'as':_0x8ea2('0x90'),'attributes':['id',_0x8ea2('0x2e'),_0x8ea2('0x45')],'required':_0x1e4c19['query'][_0x8ea2('0x66')]?!![]:![]},{'model':db['CmContactHasItem'],'as':_0x8ea2('0xc1'),'where':{'CmContactId':_0x1e4c19[_0x8ea2('0x93')]['id']},'required':![],'include':[{'model':db[_0x8ea2('0xc2')],'as':_0x8ea2('0xc3')}]}],'order':[db[_0x8ea2('0x83')][_0x8ea2('0xc4')]('`Phones.ItemType`.OrderBy')],'logging':console['log'],'attributes':_[_0x8ea2('0x3a')](_0x4b2c0f)});})[_0x8ea2('0x2b')](function(_0x53ff43){_0x1b24fe=_0x53ff43[_0x8ea2('0x9c')]({'plain':!![]});var _0x5392aa={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x53ff43&&_0x53ff43[_0x8ea2('0x62')]){if(_0x53ff43[_0x8ea2('0x62')]){_0x5392aa[_0x8ea2('0x42')][_0x8ea2('0xc5')][_0x8ea2('0x35')]({'ListId':{'$ne':_0x53ff43[_0x8ea2('0x62')]}});}}return db[_0x8ea2('0x95')]['findAll'](_0x5392aa);})[_0x8ea2('0x2b')](function(_0x5c9e47){return _[_0x8ea2('0xc6')](_0x1b24fe,_[_0x8ea2('0x81')](_0x5c9e47,function(_0x2856eb){return util[_0x8ea2('0xc7')](_0x8ea2('0xc8'),_0x2856eb['id']);}));})[_0x8ea2('0x2b')](handleEntityNotFound(_0x183546,null))[_0x8ea2('0x2b')](respondWithResult(_0x183546,null))['catch'](handleError(_0x183546,null));};exports[_0x8ea2('0xa6')]=function(_0x2bbf85,_0x4185d8){var _0x55d880;if(_0x2bbf85[_0x8ea2('0x9b')]['id']){delete _0x2bbf85[_0x8ea2('0x9b')]['id'];}return db[_0x8ea2('0x86')][_0x8ea2('0x92')]({'where':{'id':_0x2bbf85[_0x8ea2('0x93')]['id']}})[_0x8ea2('0x2b')](handleEntityNotFound(_0x4185d8,null))['then'](saveUpdates(_0x2bbf85['body'],null))[_0x8ea2('0x2b')](function(_0x34c4d7){_0x55d880=_0x34c4d7;var _0x406b40={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x34c4d7&&_0x34c4d7[_0x8ea2('0x62')]){if(_0x34c4d7[_0x8ea2('0x62')]){_0x406b40['where'][_0x8ea2('0xc5')]['push']({'ListId':{'$ne':_0x34c4d7[_0x8ea2('0x62')]}});}}return db[_0x8ea2('0x95')]['findAll'](_0x406b40);})[_0x8ea2('0x2b')](function(_0x254b51){if(_0x254b51){return _[_0x8ea2('0xc6')](_[_0x8ea2('0xc9')](_0x2bbf85[_0x8ea2('0x9b')],function(_0x46901d,_0x1b8254){return _[_0x8ea2('0x33')](_0x1b8254,_0x8ea2('0x34'));}),_[_0x8ea2('0x81')](_0x254b51,function(_0x4af3c4){return util[_0x8ea2('0xc7')](_0x8ea2('0xc8'),_0x4af3c4['id']);}));}})[_0x8ea2('0x2b')](function(_0x5ba0a2){if(_0x5ba0a2&&!_[_0x8ea2('0x78')](_0x5ba0a2)){var _0x5013ff=squel[_0x8ea2('0xa6')]()[_0x8ea2('0xca')](_0x8ea2('0x49'))[_0x8ea2('0xcb')](_0x5ba0a2)[_0x8ea2('0x42')](_0x8ea2('0xcc'),_0x2bbf85[_0x8ea2('0x93')]['id'])[_0x8ea2('0xcd')]();return db[_0x8ea2('0x83')]['query'](_0x5013ff[_0x8ea2('0xce')],{'replacements':_0x5013ff[_0x8ea2('0xcf')]});}})[_0x8ea2('0x2b')](function(){if(_0x2bbf85[_0x8ea2('0x9b')][_0x8ea2('0xd0')]&&_0x55d880){return db[_0x8ea2('0xa1')][_0x8ea2('0xa6')]({'phone':_0x2bbf85[_0x8ea2('0x9b')][_0x8ea2('0xd0')]},{'where':{'ContactId':_0x55d880['id']}});}})['then'](function(){return _0x55d880;})[_0x8ea2('0x2b')](respondWithResult(_0x4185d8,null))[_0x8ea2('0x91')](handleError(_0x4185d8,null));};exports[_0x8ea2('0xd1')]=function(_0xd93673,_0xcbb6b3,_0x4bdbe0){var _0x7ba3a3={};var _0x44791f={};var _0x959a31;var _0x2d541c;return db[_0x8ea2('0x86')]['findOne']({'where':{'id':_0xd93673[_0x8ea2('0x93')]['id']}})['then'](handleEntityNotFound(_0xcbb6b3,null))[_0x8ea2('0x2b')](function(_0x21b282){if(_0x21b282){_0x959a31=_0x21b282;_0x44791f[_0x8ea2('0x39')]=_['keys'](db[_0x8ea2('0x56')]['rawAttributes']);_0x44791f['query']=_['keys'](_0xd93673[_0x8ea2('0x3b')]);_0x44791f['filters']=_[_0x8ea2('0x3e')](_0x44791f[_0x8ea2('0x39')],_0x44791f[_0x8ea2('0x3b')]);_0x7ba3a3[_0x8ea2('0x3d')]=_[_0x8ea2('0x3e')](_0x44791f[_0x8ea2('0x39')],qs[_0x8ea2('0x3f')](_0xd93673[_0x8ea2('0x3b')]['fields']));_0x7ba3a3['attributes']=_0x7ba3a3[_0x8ea2('0x3d')][_0x8ea2('0x32')]?_0x7ba3a3[_0x8ea2('0x3d')]:_0x44791f['model'];_0x7ba3a3['order']=qs['sort'](_0xd93673[_0x8ea2('0x3b')]['sort']);_0x7ba3a3['where']=qs[_0x8ea2('0x3c')](_[_0x8ea2('0x43')](_0xd93673['query'],_0x44791f['filters']));if(_0xd93673[_0x8ea2('0x3b')]['filter']){_0x7ba3a3['where']=_[_0x8ea2('0x85')](_0x7ba3a3[_0x8ea2('0x42')],{'$or':_[_0x8ea2('0x81')](_0x7ba3a3['attributes'],function(_0x42cd0f){var _0x1cdedb={};_0x1cdedb[_0x42cd0f]={'$like':'%'+_0xd93673[_0x8ea2('0x3b')][_0x8ea2('0x68')]+'%'};return _0x1cdedb;})});}_0x7ba3a3=_[_0x8ea2('0x85')]({},_0x7ba3a3,_0xd93673['options']);return _0x959a31[_0x8ea2('0xd1')](_0x7ba3a3);}})['then'](function(_0x481fd0){if(_0x481fd0){_0x2d541c=_0x481fd0['length'];if(!_0xd93673[_0x8ea2('0x3b')]['hasOwnProperty']('nolimit')){_0x7ba3a3[_0x8ea2('0x25')]=qs[_0x8ea2('0x25')](_0xd93673[_0x8ea2('0x3b')][_0x8ea2('0x25')]);_0x7ba3a3[_0x8ea2('0x23')]=qs[_0x8ea2('0x23')](_0xd93673[_0x8ea2('0x3b')][_0x8ea2('0x23')]);}return _0x959a31['getTags'](_0x7ba3a3);}})[_0x8ea2('0x2b')](function(_0x1e216b){if(_0x1e216b){return _0x1e216b?{'count':_0x2d541c,'rows':_0x1e216b}:null;}})[_0x8ea2('0x2b')](respondWithResult(_0xcbb6b3,null))[_0x8ea2('0x91')](handleError(_0xcbb6b3,null));};exports[_0x8ea2('0xd2')]=function(_0x4cb596,_0x261e47,_0x4b042e){if(_0x4cb596[_0x8ea2('0x9b')]['id']){delete _0x4cb596['body']['id'];}return db[_0x8ea2('0x86')][_0x8ea2('0xd3')]({'where':{'id':_0x4cb596[_0x8ea2('0x93')]['id']}})[_0x8ea2('0x2b')](handleEntityNotFound(_0x261e47,null))['then'](function(_0x508ce6){if(_0x508ce6){return _0x508ce6['setTags'](_0x4cb596[_0x8ea2('0x9b')][_0x8ea2('0xd4')]||[]);}return null;})['then'](respondWithResult(_0x261e47,null))[_0x8ea2('0x91')](handleError(_0x261e47,null));};exports[_0x8ea2('0xd5')]=function(_0x24d578,_0x1c009e){var _0xad91b2=[];_0xad91b2[_0x8ea2('0x35')](addAdditionalPhones(_0x24d578[_0x8ea2('0x9b')]));Promise[_0x8ea2('0x36')](_0xad91b2)[_0x8ea2('0x2b')](function(){_0xad91b2=[];_0xad91b2[_0x8ea2('0x35')](deleteCmHopperPhones(_0x24d578[_0x8ea2('0x9b')]['id']));_0xad91b2[_0x8ea2('0x35')](addCmHopperPhones(_0x24d578[_0x8ea2('0x9b')]['id']));Promise['all'](_0xad91b2)[_0x8ea2('0x2b')](function(){return[0x1];})['then'](respondWithResult(_0x1c009e,null));});};function addAdditionalPhones(_0x570d9b){var _0x41ee31;return new Promise(function(_0x5cf367,_0x45a00a){return db[_0x8ea2('0xac')][_0x8ea2('0x2c')]({'where':{'CmContactId':_0x570d9b['id']}})[_0x8ea2('0x2b')](function(){var _0xff0fae=[];for(var _0x5c5d78=0x0;_0x5c5d78<_0x570d9b[_0x8ea2('0xd6')][_0x8ea2('0x32')];_0x5c5d78++){var _0x39add3=_0x570d9b['item_types']?_['isNil'](_0x570d9b[_0x8ea2('0xd7')][_0x5c5d78])?'':_0x570d9b[_0x8ea2('0xd7')][_0x5c5d78]:_0x570d9b['items'][_0x5c5d78][_0x8ea2('0xd8')]?_0x570d9b['items'][_0x5c5d78][_0x8ea2('0xd8')]:'';var _0x483261=_[_0x8ea2('0x60')](_0x570d9b[_0x8ea2('0xd6')][_0x5c5d78][_0x8ea2('0xd9')])?'':_0x570d9b[_0x8ea2('0xd6')][_0x5c5d78][_0x8ea2('0xd9')];var _0x24e4c7=_0x39add3+':'+_0x570d9b[_0x8ea2('0xd6')][_0x5c5d78]['phone']+'§'+_0x483261;if(_['isNil'](_0x41ee31))_0x41ee31=_0x24e4c7;else _0x41ee31+=';'+_0x24e4c7;_0xff0fae[_0x8ea2('0x35')](addAdditionalPhone(_0x570d9b['id'],_0x570d9b['items'][_0x5c5d78][_0x8ea2('0xd0')],_0x570d9b[_0x8ea2('0xd7')]?_[_0x8ea2('0x60')](_0x570d9b[_0x8ea2('0xd7')][_0x5c5d78])?null:_0x570d9b['item_types'][_0x5c5d78]:_0x570d9b[_0x8ea2('0xd6')][_0x5c5d78][_0x8ea2('0xd8')]?_0x570d9b['items'][_0x5c5d78][_0x8ea2('0xd8')]:null,_0x5c5d78,_0x483261));}Promise[_0x8ea2('0x36')](_0xff0fae)[_0x8ea2('0x2b')](function(){db['CmContact']['update']({'AdditionalPhones':_0x41ee31},{'where':{'id':_0x570d9b['id']}})['then'](function(){_0x5cf367(0x1);});});});});}function addAdditionalPhone(_0xf4682,_0x557f49,_0x1120c0,_0x488acb,_0x36bf4a){return db[_0x8ea2('0xac')][_0x8ea2('0x92')]({'where':{'CmContactId':_0xf4682,'item':_0x557f49}})[_0x8ea2('0x2b')](function(_0x54925a){if(_0x54925a)logger[_0x8ea2('0xa2')]('contact\x20phone\x20exists',_0x54925a);else{db['CmContactHasItem']['create']({'CmContactId':_0xf4682,'item':_0x557f49,'ItemTypeId':_0x1120c0,'OrderBy':_0x488acb,'ItemClass':_0x8ea2('0xda'),'description':_0x36bf4a});}});}function deletePhones(_0x2ac747){return db[_0x8ea2('0xac')]['destroy']({'where':{'CmContactId':_0x2ac747}});}function deleteCmHopperPhones(_0xcdb8f1){return new Promise(function(_0x2c6860,_0x229dec){return db[_0x8ea2('0xa1')][_0x8ea2('0x96')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0xcdb8f1}})[_0x8ea2('0x2b')](function(_0x4604cb){db[_0x8ea2('0xdb')][_0x8ea2('0x2c')]({'where':{'CmHopperId':{'$in':_[_0x8ea2('0x81')](_0x4604cb,'id')}}});})[_0x8ea2('0x2b')](function(){_0x2c6860(0x1);});});}function addCmHopperPhones(_0xc35654){return new Promise(function(_0x355b91,_0x1cf414){return db['CmHopper']['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0xc35654}})[_0x8ea2('0x2b')](function(_0x58b75c){var _0x7db85a=[];_[_0x8ea2('0x81')](_0x58b75c,function(_0x3ebbc8){_0x7db85a['push'](createCmHopperPhone(_0xc35654,_0x3ebbc8['id']));});Promise[_0x8ea2('0x36')](_0x7db85a)['then'](function(){_0x355b91(0x1);});});});}function createCmHopperPhone(_0x4e42f9,_0x1c850a){return new Promise(function(_0x46c1de,_0x6f4bf9){db[_0x8ea2('0xac')][_0x8ea2('0x96')]({'raw':!![],'attributes':[_0x8ea2('0xdc')],'where':{'CmContactId':_0x4e42f9,'ItemClass':_0x8ea2('0xda')},'include':[{'model':db['ContactItemType'],'attributes':[_0x8ea2('0xdd')],'as':_0x8ea2('0xc3')}],'order':[db[_0x8ea2('0x83')]['literal'](_0x8ea2('0xde'))]})[_0x8ea2('0x2b')](function(_0x5fd14f){var _0x4cf15e=0x1;var _0x1dbf22=_[_0x8ea2('0x81')](_0x5fd14f,function(_0x31d904){_0x31d904['CmHopperId']=_0x1c850a;_0x31d904['phone']=_0x31d904[_0x8ea2('0xdc')];_0x31d904['OrderBy']=_0x31d904[_0x8ea2('0xdf')]||_0x4cf15e;delete _0x31d904['ItemType.OrderBy'];_0x4cf15e=_0x4cf15e+0x1;return _0x31d904;});return db[_0x8ea2('0xdb')][_0x8ea2('0xba')](_0x1dbf22,{});})[_0x8ea2('0x2b')](function(){_0x46c1de(0x1);});});}function insertAdditionalPhones(_0x291b64,_0x27fe34){return new Promise(function(_0x49553f,_0x3a41ec){var _0x3a0866=[];for(var _0x9cd255=0x0;_0x9cd255<_0x27fe34[_0x8ea2('0x32')];_0x9cd255++){var _0x26b5c8=_0x27fe34[_0x9cd255];_0x3a0866[_0x8ea2('0x35')](parseContactItemType(_0x26b5c8));}Promise['all'](_0x3a0866)['then'](function(){var _0x1ba00d={'id':_0x291b64['id'],'items':_0x27fe34};return addAdditionalPhones(_0x1ba00d)[_0x8ea2('0x2b')](function(_0x4c70af){return addCmHopperPhones(_0x291b64['id']);});})[_0x8ea2('0x2b')](function(){_0x49553f(_0x291b64);});});}function parseContactItemType(_0x475b04){return new Promise(function(_0x1ca9a1,_0x279b7d){if(_0x475b04['hasOwnProperty'](_0x8ea2('0xd8'))){_0x1ca9a1(_0x475b04);}else{return db[_0x8ea2('0xc2')]['find']({'where':{'name':_0x475b04[_0x8ea2('0xc3')]}})['then'](function(_0x1a2388){if(_['isNil'](_0x1a2388))_0x475b04['ItemTypeId']=null;else _0x475b04[_0x8ea2('0xd8')]=_0x1a2388['id'];_0x1ca9a1(_0x475b04);});}});}exports[_0x8ea2('0xe0')]=function(_0xbb5964,_0x2bc279){return db['CmContactHasItem'][_0x8ea2('0x96')]({'raw':!![],'where':{'CmContactId':_0xbb5964[_0x8ea2('0x93')]['id'],'ItemClass':_0x8ea2('0xda')},'include':[{'model':db['ContactItemType'],'as':_0x8ea2('0xc3')}],'order':[[db[_0x8ea2('0x83')][_0x8ea2('0xc4')](_0x8ea2('0xde'))],[_0x8ea2('0xdd')]]})[_0x8ea2('0x2b')](function(_0x2282b2){return _0x2282b2;})['then'](respondWithResult(_0x2bc279,null))[_0x8ea2('0x91')](handleError(_0x2bc279,null));};exports[_0x8ea2('0xe1')]=function(_0x38a4b4,_0x3ad26a){return db[_0x8ea2('0xac')][_0x8ea2('0x96')]({'raw':!![],'where':{'CmContactId':_0x38a4b4[_0x8ea2('0x9b')][_0x8ea2('0xe2')]}})[_0x8ea2('0x2b')](function(_0x14e992){var _0x3a37fb=_[_0x8ea2('0x81')](_0x14e992,function(_0x556919){_0x556919['CmContactId']=_0x38a4b4[_0x8ea2('0x9b')]['toContactId'];return _0x556919;});return db[_0x8ea2('0xac')][_0x8ea2('0xba')](_0x3a37fb,{});})[_0x8ea2('0x2b')](function(_0xd496f9){return addCmHopperPhones(_0x38a4b4[_0x8ea2('0x9b')]['toContactId']);})[_0x8ea2('0x2b')](function(_0x642e9a){return['ok'];})['then'](respondWithResult(_0x3ad26a,null))[_0x8ea2('0x91')](handleError(_0x3ad26a,null));};exports[_0x8ea2('0xe3')]=function(_0x2988c8,_0x43ab2f){var _0x47a6dd=[];_0x47a6dd[_0x8ea2('0x35')](createCmHopperPhone(_0x2988c8[_0x8ea2('0x9b')]['id'],_0x2988c8[_0x8ea2('0x9b')][_0x8ea2('0xe4')]));Promise['all'](_0x47a6dd)[_0x8ea2('0x2b')](function(){return[0x1];})[_0x8ea2('0x2b')](respondWithResult(_0x43ab2f,null));};exports[_0x8ea2('0xe5')]=function(_0x59ae1f,_0x2686b8,_0x49c8d7){var _0x2dc764={'raw':![],'where':{}};var _0x5f0a08={};var _0x4d6379={'count':0x0,'rows':[]};return db[_0x8ea2('0x86')]['findOne']({'where':{'id':_0x59ae1f[_0x8ea2('0x93')]['id']}})[_0x8ea2('0x2b')](handleEntityNotFound(_0x2686b8,null))[_0x8ea2('0x2b')](function(_0x2c7daa){if(_0x2c7daa){_0x5f0a08['model']=_[_0x8ea2('0x3a')](db['CmHopper']['rawAttributes']);_0x5f0a08['query']=_['keys'](_0x59ae1f[_0x8ea2('0x3b')]);_0x5f0a08[_0x8ea2('0x3c')]=_[_0x8ea2('0x3e')](_0x5f0a08[_0x8ea2('0x39')],_0x5f0a08[_0x8ea2('0x3b')]);_0x2dc764['attributes']=_['intersection'](_0x5f0a08[_0x8ea2('0x39')],qs['fields'](_0x59ae1f['query'][_0x8ea2('0x3f')]));_0x2dc764[_0x8ea2('0x3d')]=_0x2dc764[_0x8ea2('0x3d')]['length']?_0x2dc764[_0x8ea2('0x3d')]:_0x5f0a08['model'];if(!_0x59ae1f[_0x8ea2('0x3b')][_0x8ea2('0x40')]('nolimit')){_0x2dc764[_0x8ea2('0x25')]=qs[_0x8ea2('0x25')](_0x59ae1f['query'][_0x8ea2('0x25')]);_0x2dc764[_0x8ea2('0x23')]=qs[_0x8ea2('0x23')](_0x59ae1f[_0x8ea2('0x3b')][_0x8ea2('0x23')]);}_0x2dc764[_0x8ea2('0x76')]=qs[_0x8ea2('0x41')](_0x59ae1f[_0x8ea2('0x3b')][_0x8ea2('0x41')]);_0x2dc764['where']=qs[_0x8ea2('0x3c')](_['pick'](_0x59ae1f[_0x8ea2('0x3b')],_0x5f0a08[_0x8ea2('0x3c')]));_0x2dc764[_0x8ea2('0x42')][_0x8ea2('0xe6')]=_0x2c7daa['id'];if(_0x59ae1f[_0x8ea2('0x3b')][_0x8ea2('0x68')]){_0x2dc764[_0x8ea2('0x42')]=_[_0x8ea2('0x85')](_0x2dc764['where'],{'$or':_['map'](_0x2dc764[_0x8ea2('0x3d')],function(_0x37cc04){var _0x2c71d0={};_0x2c71d0[_0x37cc04]={'$like':'%'+_0x59ae1f[_0x8ea2('0x3b')][_0x8ea2('0x68')]+'%'};return _0x2c71d0;})});}_0x2dc764=_['merge']({},_0x2dc764,_0x59ae1f[_0x8ea2('0xe7')]);return db[_0x8ea2('0xa1')]['count']({'where':_0x2dc764[_0x8ea2('0x42')]})[_0x8ea2('0x2b')](function(_0x3ac848){_0x4d6379['count']=_0x3ac848;if(_0x59ae1f['query'][_0x8ea2('0xe8')]){_0x2dc764['include']=[{'all':!![]}];}return db[_0x8ea2('0xa1')][_0x8ea2('0x96')](_0x2dc764);})[_0x8ea2('0x2b')](function(_0x474109){_0x4d6379[_0x8ea2('0xe9')]=_0x474109;return _0x4d6379;});}})[_0x8ea2('0x2b')](respondWithFilteredResult(_0x2686b8,_0x2dc764))[_0x8ea2('0x91')](handleError(_0x2686b8,null));};exports[_0x8ea2('0xea')]=function(_0x1451c2,_0x74f368,_0x2cd485){var _0x1945be={'raw':!![],'where':{}};var _0x1417ce={};var _0x250f66={'count':0x0,'rows':[]};return db[_0x8ea2('0x86')][_0x8ea2('0xd3')]({'where':{'id':_0x1451c2[_0x8ea2('0x93')]['id']}})[_0x8ea2('0x2b')](handleEntityNotFound(_0x74f368,null))[_0x8ea2('0x2b')](function(_0x5bc575){if(_0x5bc575){_0x1417ce['model']=_['keys'](db[_0x8ea2('0xae')][_0x8ea2('0xeb')]);_0x1417ce[_0x8ea2('0x3b')]=_[_0x8ea2('0x3a')](_0x1451c2['query']);_0x1417ce['filters']=_[_0x8ea2('0x3e')](_0x1417ce['model'],_0x1417ce[_0x8ea2('0x3b')]);_0x1945be[_0x8ea2('0x3d')]=_[_0x8ea2('0x3e')](_0x1417ce[_0x8ea2('0x39')],qs[_0x8ea2('0x3f')](_0x1451c2[_0x8ea2('0x3b')][_0x8ea2('0x3f')]));_0x1945be['attributes']=_0x1945be[_0x8ea2('0x3d')][_0x8ea2('0x32')]?_0x1945be[_0x8ea2('0x3d')]:_0x1417ce[_0x8ea2('0x39')];if(!_0x1451c2['query']['hasOwnProperty'](_0x8ea2('0xec'))){_0x1945be[_0x8ea2('0x25')]=qs[_0x8ea2('0x25')](_0x1451c2['query']['limit']);_0x1945be[_0x8ea2('0x23')]=qs['offset'](_0x1451c2[_0x8ea2('0x3b')][_0x8ea2('0x23')]);}_0x1945be[_0x8ea2('0x76')]=qs['sort'](_0x1451c2[_0x8ea2('0x3b')][_0x8ea2('0x41')]);_0x1945be[_0x8ea2('0x42')]=qs[_0x8ea2('0x3c')](_['pick'](_0x1451c2['query'],_0x1417ce[_0x8ea2('0x3c')]));_0x1945be[_0x8ea2('0x42')][_0x8ea2('0xe6')]=_0x5bc575['id'];if(_0x1451c2['query'][_0x8ea2('0x68')]){_0x1945be['where']=_[_0x8ea2('0x85')](_0x1945be['where'],{'$or':_[_0x8ea2('0x81')](_0x1945be['attributes'],function(_0x1ea4ff){var _0x1985ac={};_0x1985ac[_0x1ea4ff]={'$like':'%'+_0x1451c2[_0x8ea2('0x3b')][_0x8ea2('0x68')]+'%'};return _0x1985ac;})});}_0x1945be=_['merge']({},_0x1945be,_0x1451c2[_0x8ea2('0xe7')]);return db[_0x8ea2('0xae')][_0x8ea2('0x26')]({'where':_0x1945be[_0x8ea2('0x42')]})['then'](function(_0x31265e){_0x250f66[_0x8ea2('0x26')]=_0x31265e;if(_0x1451c2[_0x8ea2('0x3b')][_0x8ea2('0xe8')]){_0x1945be[_0x8ea2('0xed')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x8ea2('0x96')](_0x1945be);})[_0x8ea2('0x2b')](function(_0x306d01){_0x250f66[_0x8ea2('0xe9')]=_0x306d01;return _0x250f66;});}})['then'](respondWithFilteredResult(_0x74f368,_0x1945be))[_0x8ea2('0x91')](handleError(_0x74f368,null));};exports[_0x8ea2('0xee')]=function(_0x58a5cd,_0x532131,_0x5c5300){var _0x4035eb={'raw':!![],'where':{}};var _0x3eeecc={};var _0x348ce0={'count':0x0,'rows':[]};return db[_0x8ea2('0x86')][_0x8ea2('0xd3')]({'where':{'id':_0x58a5cd[_0x8ea2('0x93')]['id']}})['then'](handleEntityNotFound(_0x532131,null))['then'](function(_0xc099b6){if(_0xc099b6){_0x3eeecc[_0x8ea2('0x39')]=_[_0x8ea2('0x3a')](db['CmHopperFinal']['rawAttributes']);_0x3eeecc[_0x8ea2('0x3b')]=_[_0x8ea2('0x3a')](_0x58a5cd['query']);_0x3eeecc[_0x8ea2('0x3c')]=_['intersection'](_0x3eeecc[_0x8ea2('0x39')],_0x3eeecc[_0x8ea2('0x3b')]);_0x4035eb[_0x8ea2('0x3d')]=_['intersection'](_0x3eeecc[_0x8ea2('0x39')],qs[_0x8ea2('0x3f')](_0x58a5cd['query'][_0x8ea2('0x3f')]));_0x4035eb[_0x8ea2('0x3d')]=_0x4035eb['attributes']['length']?_0x4035eb[_0x8ea2('0x3d')]:_0x3eeecc[_0x8ea2('0x39')];if(!_0x58a5cd[_0x8ea2('0x3b')]['hasOwnProperty'](_0x8ea2('0xec'))){_0x4035eb[_0x8ea2('0x25')]=qs[_0x8ea2('0x25')](_0x58a5cd[_0x8ea2('0x3b')][_0x8ea2('0x25')]);_0x4035eb['offset']=qs[_0x8ea2('0x23')](_0x58a5cd['query'][_0x8ea2('0x23')]);}_0x4035eb['order']=qs[_0x8ea2('0x41')](_0x58a5cd[_0x8ea2('0x3b')][_0x8ea2('0x41')]);_0x4035eb[_0x8ea2('0x42')]=qs['filters'](_[_0x8ea2('0x43')](_0x58a5cd[_0x8ea2('0x3b')],_0x3eeecc[_0x8ea2('0x3c')]));_0x4035eb[_0x8ea2('0x42')][_0x8ea2('0xe6')]=_0xc099b6['id'];if(_0x58a5cd[_0x8ea2('0x3b')][_0x8ea2('0x68')]){_0x4035eb[_0x8ea2('0x42')]=_[_0x8ea2('0x85')](_0x4035eb[_0x8ea2('0x42')],{'$or':_[_0x8ea2('0x81')](_0x4035eb['attributes'],function(_0x2ab1da){var _0x2f71e5={};_0x2f71e5[_0x2ab1da]={'$like':'%'+_0x58a5cd[_0x8ea2('0x3b')]['filter']+'%'};return _0x2f71e5;})});}_0x4035eb=_[_0x8ea2('0x85')]({},_0x4035eb,_0x58a5cd[_0x8ea2('0xe7')]);return db[_0x8ea2('0xad')][_0x8ea2('0x26')]({'where':_0x4035eb[_0x8ea2('0x42')]})[_0x8ea2('0x2b')](function(_0x382a85){_0x348ce0[_0x8ea2('0x26')]=_0x382a85;if(_0x58a5cd[_0x8ea2('0x3b')][_0x8ea2('0xe8')]){_0x4035eb['include']=[{'all':!![]}];}return db[_0x8ea2('0xad')][_0x8ea2('0x96')](_0x4035eb);})[_0x8ea2('0x2b')](function(_0x432b84){_0x348ce0['rows']=_0x432b84;return _0x348ce0;});}})[_0x8ea2('0x2b')](respondWithFilteredResult(_0x532131,_0x4035eb))[_0x8ea2('0x91')](handleError(_0x532131,null));};exports[_0x8ea2('0xef')]=function(_0x10d2b3,_0x12a217,_0x45d011){var _0x109785={'raw':!![],'where':{}};var _0x4db2c3={};var _0x44b0dc={'count':0x0,'rows':[]};return db[_0x8ea2('0x86')]['findOne']({'where':{'id':_0x10d2b3[_0x8ea2('0x93')]['id']}})[_0x8ea2('0x2b')](handleEntityNotFound(_0x12a217,null))[_0x8ea2('0x2b')](function(_0x50ebcd){if(_0x50ebcd){_0x4db2c3['model']=_[_0x8ea2('0x3a')](db['JscriptySessionReport']['rawAttributes']);_0x4db2c3[_0x8ea2('0x3b')]=_[_0x8ea2('0x3a')](_0x10d2b3['query']);_0x4db2c3[_0x8ea2('0x3c')]=_[_0x8ea2('0x3e')](_0x4db2c3['model'],_0x4db2c3[_0x8ea2('0x3b')]);_0x109785['attributes']=_[_0x8ea2('0x3e')](_0x4db2c3[_0x8ea2('0x39')],qs[_0x8ea2('0x3f')](_0x10d2b3[_0x8ea2('0x3b')][_0x8ea2('0x3f')]));_0x109785[_0x8ea2('0x3d')]=_0x109785[_0x8ea2('0x3d')][_0x8ea2('0x32')]?_0x109785[_0x8ea2('0x3d')]:_0x4db2c3[_0x8ea2('0x39')];if(!_0x10d2b3[_0x8ea2('0x3b')][_0x8ea2('0x40')](_0x8ea2('0xec'))){_0x109785[_0x8ea2('0x25')]=qs[_0x8ea2('0x25')](_0x10d2b3[_0x8ea2('0x3b')]['limit']);_0x109785[_0x8ea2('0x23')]=qs[_0x8ea2('0x23')](_0x10d2b3['query']['offset']);}_0x109785[_0x8ea2('0x76')]=qs['sort'](_0x10d2b3['query'][_0x8ea2('0x41')]);_0x109785[_0x8ea2('0x42')]=qs[_0x8ea2('0x3c')](_['pick'](_0x10d2b3[_0x8ea2('0x3b')],_0x4db2c3[_0x8ea2('0x3c')]));_0x109785[_0x8ea2('0x42')]['ContactId']=_0x50ebcd['id'];if(_0x10d2b3[_0x8ea2('0x3b')]['filter']){_0x109785[_0x8ea2('0x42')]=_['merge'](_0x109785['where'],{'$or':_[_0x8ea2('0x81')](_0x109785[_0x8ea2('0x3d')],function(_0x10ae49){var _0x3d7695={};_0x3d7695[_0x10ae49]={'$like':'%'+_0x10d2b3[_0x8ea2('0x3b')][_0x8ea2('0x68')]+'%'};return _0x3d7695;})});}_0x109785=_[_0x8ea2('0x85')]({},_0x109785,_0x10d2b3[_0x8ea2('0xe7')]);return db[_0x8ea2('0xb5')][_0x8ea2('0x26')]({'where':_0x109785[_0x8ea2('0x42')]})[_0x8ea2('0x2b')](function(_0x540593){_0x44b0dc['count']=_0x540593;if(_0x10d2b3['query'][_0x8ea2('0xe8')]){_0x109785[_0x8ea2('0xed')]=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x109785);})[_0x8ea2('0x2b')](function(_0x6fe84){_0x44b0dc[_0x8ea2('0xe9')]=_0x6fe84;return _0x44b0dc;});}})[_0x8ea2('0x2b')](respondWithFilteredResult(_0x12a217,_0x109785))[_0x8ea2('0x91')](handleError(_0x12a217,null));};exports['uploadCsv']=function(_0x294220,_0x5736b9,_0x3c8cfe){try{if(!_0x294220['body'][_0x8ea2('0x62')]){throw new Error('No\x20ListId\x20specified');}if(!_0x294220[_0x8ea2('0x9b')][_0x8ea2('0xf0')]){throw new Error('No\x20association\x20keys\x20specified!');}if(!_0x294220['body'][_0x8ea2('0xf1')]){throw new Error(_0x8ea2('0xf2'));}if(!_0x294220[_0x8ea2('0x9b')][_0x8ea2('0xf3')]){throw new Error(_0x8ea2('0xf4'));}var _0x30a29a=_0x294220[_0x8ea2('0x9b')][_0x8ea2('0xf0')][_0x8ea2('0x58')](',');var _0x4b21a2=_0x294220[_0x8ea2('0x9b')][_0x8ea2('0xf1')][_0x8ea2('0x58')](',');if(!_0x30a29a[_0x8ea2('0x32')]||!_0x4b21a2[_0x8ea2('0x32')]||_0x30a29a['length']!==_0x4b21a2['length']){throw new Error(_0x8ea2('0xf5'));}_0x294220[_0x8ea2('0x9b')][_0x8ea2('0x3f')]=_[_0x8ea2('0xf6')](_0x30a29a,_0x4b21a2);if(!_0x294220[_0x8ea2('0x9b')][_0x8ea2('0x3f')][_0x8ea2('0xd0')]){throw new Error(_0x8ea2('0xf7'));}if(!_0x294220[_0x8ea2('0x9b')]['fields'][_0x8ea2('0xf8')]){throw new Error('No\x20firstName\x20column\x20specified');}var _0x546cb6=path[_0x8ea2('0x9f')](config[_0x8ea2('0xf9')],_0x8ea2('0xfa'),_0x294220[_0x8ea2('0xfb')][_0x8ea2('0xfc')]);fs[_0x8ea2('0xfd')](_0x546cb6,parseInt(_0x8ea2('0xfe'),0x8));var _0x405a86=require('child_process')[_0x8ea2('0xff')](path[_0x8ea2('0x9f')](__dirname,_0x8ea2('0x100')),[_0x546cb6,_0x294220[_0x8ea2('0x9b')][_0x8ea2('0xf0')],_0x294220['body']['binding_values'],_0x294220[_0x8ea2('0x9b')][_0x8ea2('0x62')],_0x294220[_0x8ea2('0x9b')][_0x8ea2('0x101')],_0x294220[_0x8ea2('0x9b')][_0x8ea2('0xbc')],_0x294220[_0x8ea2('0x9b')]['socket_timestamp']]);return _0x5736b9[_0x8ea2('0x20')](0xc8)[_0x8ea2('0x22')]({'message':'File\x20uploaded\x20correctly!','pid':_0x405a86[_0x8ea2('0x102')]});}catch(_0x5b9692){return _0x5736b9[_0x8ea2('0x20')](0x1f4)[_0x8ea2('0x2f')](_0x5b9692);}};exports[_0x8ea2('0x103')]=function(_0x2f7a76,_0x3e054c,_0x4fcb69){var _0x40b9d5=fs['createReadStream'](_0x2f7a76[_0x8ea2('0xfb')][_0x8ea2('0x8')]);Papa[_0x8ea2('0x104')](_0x40b9d5,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x55efe6){return _0x3e054c['status'](0xc8)[_0x8ea2('0x22')]({'file':_0x2f7a76[_0x8ea2('0xfb')],'fields':_0x55efe6[_0x8ea2('0x105')][_0x8ea2('0x3f')]});}});};exports[_0x8ea2('0x106')]=function(_0xc9cc,_0x69a44,_0x4e36be){return db[_0x8ea2('0x5a')][_0x8ea2('0x96')]({'raw':!![],'attributes':['id'],'where':{'role':_0x8ea2('0x7d')}})[_0x8ea2('0x2b')](function(_0x813581){var _0x3df861=![];if(!_0xc9cc[_0x8ea2('0x9b')][_0x8ea2('0x62')]){throw new Error(_0x8ea2('0x107'));}if(!_0xc9cc[_0x8ea2('0x9b')][_0x8ea2('0x108')][_0x8ea2('0xd0')]){throw new Error(_0x8ea2('0xf7'));}if(!_0xc9cc[_0x8ea2('0x9b')][_0x8ea2('0x108')][_0x8ea2('0xf8')]){throw new Error(_0x8ea2('0x109'));}if(!_0xc9cc['body']['socket_timestamp']){throw new Error(_0x8ea2('0xf4'));}var _0x1d6974=require(_0x8ea2('0x10a'))[_0x8ea2('0xff')](path[_0x8ea2('0x9f')](__dirname,_0x8ea2('0x10b')),[_0xc9cc['params']['id'],JSON[_0x8ea2('0x10c')](_0xc9cc['body']),JSON[_0x8ea2('0x10c')](_0x813581)]);_0x1d6974['on'](_0x8ea2('0x10d'),function(_0x4f731e){_0x3df861=!![];return _0x69a44[_0x8ea2('0x20')](0xc8)[_0x8ea2('0x22')]({'message':'start\x20child\x20process\x20correctly!','pid':_0x1d6974[_0x8ea2('0x102')]});});_0x1d6974['on'](_0x8ea2('0x10e'),function(_0xe81353){if(_0xe81353&&!_0x3df861){return _0x69a44[_0x8ea2('0x20')](0x1f4)[_0x8ea2('0x22')]({'message':'error\x20child\x20process','pid':_0x1d6974['pid']});}});})['catch'](handleError(_0x69a44,null));};exports[_0x8ea2('0x10f')]=function(_0x199d37,_0x244f5e,_0x27d7ba){return db[_0x8ea2('0x5a')][_0x8ea2('0x96')]({'raw':!![],'attributes':['id'],'where':{'role':'agent'}})[_0x8ea2('0x2b')](function(_0x363147){var _0x56945f=![];if(!_0x199d37['body'][_0x8ea2('0x62')]){throw new Error(_0x8ea2('0x107'));}if(!_0x199d37[_0x8ea2('0x9b')]['binding']['phone']){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x199d37['body']['binding'][_0x8ea2('0xf8')]){throw new Error(_0x8ea2('0x109'));}if(!_0x199d37['body'][_0x8ea2('0xf3')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0xd33a90=require(_0x8ea2('0x10a'))['fork'](path[_0x8ea2('0x9f')](__dirname,_0x8ea2('0x110')),[_0x199d37[_0x8ea2('0x93')]['id'],JSON['stringify'](_0x199d37[_0x8ea2('0x9b')]),JSON[_0x8ea2('0x10c')](_0x363147)]);_0xd33a90['on'](_0x8ea2('0x10d'),function(_0xe7d9dd){_0x56945f=!![];return _0x244f5e[_0x8ea2('0x20')](0xc8)[_0x8ea2('0x22')]({'message':_0x8ea2('0x111'),'pid':_0xd33a90['pid']});});_0xd33a90['on'](_0x8ea2('0x10e'),function(_0x1ac027){if(_0x1ac027&&!_0x56945f){return _0x244f5e[_0x8ea2('0x20')](0x1f4)['json']({'message':_0x8ea2('0x112'),'pid':_0xd33a90[_0x8ea2('0x102')]});}});})['catch'](handleError(_0x244f5e,null));};exports[_0x8ea2('0x113')]=function(_0x354be9,_0x5307a1){var _0x12026f=[_0x8ea2('0x114'),'chat','sms',_0x8ea2('0x115'),_0x8ea2('0x116'),_0x8ea2('0x117'),_0x8ea2('0x118')];var _0x540586={'offset':0x0,'order':qs[_0x8ea2('0x41')](_0x8ea2('0x119'))},_0x3eb4bf={'count':0x0,'rows':[]};Promise[_0x8ea2('0x7b')]()[_0x8ea2('0x2b')](function(){if(_0x354be9[_0x8ea2('0x3b')][_0x8ea2('0x11a')]){if(!_['includes'](_0x12026f,_0x354be9[_0x8ea2('0x3b')][_0x8ea2('0x11a')][_0x8ea2('0x11b')]())){throw new Error(_0x8ea2('0x11c'));}_0x12026f=[_0x354be9[_0x8ea2('0x3b')][_0x8ea2('0x11a')]['toLowerCase']()];}if(_0x354be9['query'][_0x8ea2('0x11d')]){try{var _0x189afd=JSON[_0x8ea2('0x104')](_0x354be9['query'][_0x8ea2('0x11d')]);if(!moment(_0x189afd[_0x8ea2('0x48')])['isValid']()){throw new Error(_0x8ea2('0x11e'));}if(!moment(_0x189afd['to'])[_0x8ea2('0x11f')]()){throw new Error(_0x8ea2('0x120'));}}catch(_0x1360b8){throw new Error('Invalid\x20createdAt\x20filter');}}if(!_0x354be9[_0x8ea2('0x3b')]['hasOwnProperty'](_0x8ea2('0xec'))){_0x540586['limit']=qs[_0x8ea2('0x25')](_0x354be9[_0x8ea2('0x3b')][_0x8ea2('0x25')]||0xa);_0x540586['offset']=qs[_0x8ea2('0x23')](_0x354be9[_0x8ea2('0x3b')]['offset']);}var _0x498247=_0x12026f['map'](function(_0x3500b7){if(_0x3500b7===_0x8ea2('0x118')){var _0x2df47b={'attributes':['id',_0x8ea2('0x121'),'type',_0x8ea2('0x122'),_0x8ea2('0x123'),_0x8ea2('0x124'),'starttime','endtime','duration',_0x8ea2('0x125'),_0x8ea2('0x126'),_0x8ea2('0x127'),_0x8ea2('0x128'),'userThirdDisposition',_0x8ea2('0x129')],'where':{'ContactId':_0x354be9[_0x8ea2('0x93')]['id']},'include':[{'model':db[_0x8ea2('0x5a')],'as':_0x8ea2('0x5a'),'attributes':['id','name',_0x8ea2('0x12a'),_0x8ea2('0x99')]}],'order':[[_0x8ea2('0x126'),'DESC']]};if(_0x354be9['query'][_0x8ea2('0x11d')]){_0x2df47b[_0x8ea2('0x42')][_0x8ea2('0x126')]={'$gte':_0x189afd[_0x8ea2('0x48')],'$lte':_0x189afd['to']};}return db[_0x8ea2('0xb0')]['findAndCountAll'](_0x2df47b)[_0x8ea2('0x2b')](function(_0x5d4826){_0x3eb4bf['count']+=_0x5d4826[_0x8ea2('0x26')];return _[_0x8ea2('0x81')](_0x5d4826[_0x8ea2('0xe9')],function(_0x5a3896){var _0x4dd21e=_0x5a3896[_0x8ea2('0x9c')]({'plain':!![]});_0x4dd21e[_0x8ea2('0x11a')]=_0x3500b7;if(_0x4dd21e[_0x8ea2('0x5a')]){_0x4dd21e[_0x8ea2('0x5a')]={'id':_0x4dd21e[_0x8ea2('0x5a')]['id'],'name':_0x4dd21e[_0x8ea2('0x5a')][_0x8ea2('0x2e')],'fullname':_0x4dd21e[_0x8ea2('0x5a')][_0x8ea2('0x12a')],'alias':_0x4dd21e['User']['alias']};}return _0x4dd21e;});});}else{var _0x43b455=_[_0x8ea2('0x12b')](_0x3500b7)+(_0x3500b7==='chat'?_0x8ea2('0x12c'):_0x8ea2('0x12d'));var _0x264705={'attributes':['id','closed',_0x8ea2('0x12e'),_0x8ea2('0x126'),_0x8ea2('0x125'),'disposition',_0x8ea2('0x12f'),_0x8ea2('0x130'),_0x8ea2('0x129'),_0x43b455+'Id'],'where':{'ContactId':_0x354be9[_0x8ea2('0x93')]['id']},'include':[{'model':db[_0x43b455],'as':_0x8ea2('0x12d'),'attributes':['id',_0x8ea2('0x2e'),_0x8ea2('0x131')]},{'model':db[_0x8ea2('0x5a')],'as':_0x8ea2('0x132'),'attributes':['id',_0x8ea2('0x2e'),_0x8ea2('0x12a')]},{'model':db[_0x8ea2('0x56')],'as':'Tags','attributes':['id',_0x8ea2('0x2e'),_0x8ea2('0x45')],'through':{'attributes':[]}}],'order':[[_0x8ea2('0x126'),_0x8ea2('0x77')]]};if(_0x354be9[_0x8ea2('0x3b')][_0x8ea2('0x11d')]){_0x264705['where']['createdAt']={'$gte':_0x189afd[_0x8ea2('0x48')],'$lte':_0x189afd['to']};}switch(_0x3500b7){case _0x8ea2('0x133'):_0x264705[_0x8ea2('0x3d')][_0x8ea2('0x35')](_0x8ea2('0x134'),_0x8ea2('0x135'),'customerPort',_0x8ea2('0x136'),_0x8ea2('0x137'),_0x8ea2('0x138'),'ratingType',_0x8ea2('0x139'),_0x8ea2('0x13a'));break;case _0x8ea2('0x114'):_0x264705[_0x8ea2('0x3d')][_0x8ea2('0x35')](_0x8ea2('0x13b'),'substatus');break;case _0x8ea2('0x115'):_0x264705[_0x8ea2('0x3d')][_0x8ea2('0x35')](_0x8ea2('0x13c'),'threadId');break;}return db[_[_0x8ea2('0x12b')](_0x3500b7)+_0x8ea2('0x13d')][_0x8ea2('0x13e')](_0x264705)['then'](function(_0x56ab93){_0x3eb4bf[_0x8ea2('0x26')]+=_0x56ab93[_0x8ea2('0x26')];return _[_0x8ea2('0x81')](_0x56ab93['rows'],function(_0x5a9a54){var _0x1c0283=_0x5a9a54[_0x8ea2('0x9c')]({'plain':!![]});_0x1c0283[_0x8ea2('0x11a')]=_0x3500b7;if(_0x1c0283[_0x8ea2('0x132')]){_0x1c0283['Owner']={'id':_0x1c0283['Owner']['id'],'name':_0x1c0283[_0x8ea2('0x132')][_0x8ea2('0x2e')],'fullname':_0x1c0283['Owner'][_0x8ea2('0x12a')]};}return _0x1c0283;});});}});return Promise[_0x8ea2('0x36')](_0x498247);})['then'](function(_0x5dfe99){return _(_0x5dfe99)[_0x8ea2('0x13f')]()[_0x8ea2('0x140')]('createdAt')[_0x8ea2('0x141')]()[_0x8ea2('0x57')]();})[_0x8ea2('0x2b')](function(_0x308e2d){_0x3eb4bf[_0x8ea2('0xe9')]=_0x540586[_0x8ea2('0x25')]?_0x308e2d[_0x8ea2('0x142')](_0x540586[_0x8ea2('0x23')],_0x540586[_0x8ea2('0x23')]+_0x540586[_0x8ea2('0x25')]):_0x308e2d;return _0x3eb4bf;})[_0x8ea2('0x2b')](respondWithFilteredResult(_0x5307a1,_0x540586))['catch'](handleError(_0x5307a1,null));}; \ No newline at end of file +var _0x7be1=['fullname','DESC','createdAt','findAndCountAll','startCase','Website','Account','closed','closedAt','disposition','secondDisposition','thirdDisposition','key','customerIp','deviceModel','osName','ratingMessage','ratingType','ratingValue','referer','subject','openchannel','threadId','Interaction','channel','Owner','flatten','reverse','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./cmContact.socket','register','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','sendStatus','error','name','send','index','describe','keys','length','startsWith','cf_','push','CmCustomField','trimStart','type','model','query','filters','attributes','intersection','fields','hasOwnProperty','sort','where','pick','select','field','color','from','tools_tags','cm_contacts','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','sqlOperator','conditions','find','Tag','split','map','User','and','uc.UserId\x20=\x20?','value','dateOfBirth','fieldType','datetime','castTo','DATE','buildExpression','start','filter','isNil','Contact','forEach','ListId','c.ListId\x20IN\x20?','\x20=\x20?','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.id','Sequelize','QueryTypes','clone','order','isEmpty','having','resolve','role','agent','some','user','getLists','c.ListId\x20IS\x20NULL','sequelize','toString','keyBy','CmContact','c.lastName','c.phone','c.fax','c.email','c.createdAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','params','tags','columnName','displayName','alias','values','merge','body','get','mergeWith','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','info','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','OpenchannelMessage','CmContactHasItem','CmHopperFinal','CmHopperHistory','VoiceCallReport','ChatQueueReport','FaxQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','additionalPhones','bulkCreate','each','duplicates','findOrCreate','spread','all','show','Phones','`Phones.ItemType`.OrderBy','$and','findAll','omit','pickBy','format','cf_%d','table','setFields','id\x20=\x20?','text','phone','CmHopper','getTags','setTags','findOne','ids','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','item','ContactItemType','ItemType','literal','`ItemType`.OrderBy','CmHopperId','OrderBy','ItemType.OrderBy','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','hopperId','getHoppers','nolimit','options','includeAll','getHopperHistories','ContactId','include','getHopperFinals','rawAttributes','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_values','No\x20association\x20values\x20specified!','binding_keys','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','upload','createReadStream','path','parse','meta','binding','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','../../components/import/cm/csvUpdates','getJourney','mail','chat','sms','fax','whatsapp','voice','-createdAt','includes','toLowerCase','Invalid\x20channel','range','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','uniqueid','source','destination','starttime','endtime','duration','note','userDisposition','userSecondDisposition','userThirdDisposition','UserId'];(function(_0x4d5177,_0x283c88){var _0x592a67=function(_0x39218b){while(--_0x39218b){_0x4d5177['push'](_0x4d5177['shift']());}};_0x592a67(++_0x283c88);}(_0x7be1,0x165));var _0x17be=function(_0x5180c3,_0x4b35f7){_0x5180c3=_0x5180c3-0x0;var _0x55c975=_0x7be1[_0x5180c3];return _0x55c975;};'use strict';var emlformat=require(_0x17be('0x0'));var rimraf=require(_0x17be('0x1'));var zipdir=require(_0x17be('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x17be('0x3'));var moment=require(_0x17be('0x4'));var BPromise=require(_0x17be('0x5'));var Mustache=require(_0x17be('0x6'));var util=require(_0x17be('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x17be('0x8'));var fs=require('fs');var fs_extra=require(_0x17be('0x9'));var _=require('lodash');var squel=require(_0x17be('0xa'));var crypto=require(_0x17be('0xb'));var jsforce=require(_0x17be('0xc'));var deskjs=require(_0x17be('0xd'));var toCsv=require(_0x17be('0xe'));var querystring=require(_0x17be('0xf'));var Papa=require('papaparse');var Redis=require(_0x17be('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x17be('0x11'));var as=require(_0x17be('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x17be('0x13'))(_0x17be('0x14'));var utils=require(_0x17be('0x15'));var config=require(_0x17be('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x17be('0x17'))['db'];config['redis']=_[_0x17be('0x18')](config['redis'],{'host':_0x17be('0x19'),'port':0x18eb});var socket=require(_0x17be('0x1a'))(new Redis(config[_0x17be('0x1b')]));require(_0x17be('0x1c'))[_0x17be('0x1d')](socket);function respondWithStatusCode(_0x4cbd7e,_0x127e5a){_0x127e5a=_0x127e5a||0xcc;return function(_0x497a95){if(_0x497a95){return _0x4cbd7e['sendStatus'](_0x127e5a);}return _0x4cbd7e[_0x17be('0x1e')](_0x127e5a)['end']();};}function respondWithResult(_0x2a37ec,_0x4abdbc){_0x4abdbc=_0x4abdbc||0xc8;return function(_0x2aa9a6){if(_0x2aa9a6){return _0x2a37ec[_0x17be('0x1e')](_0x4abdbc)['json'](_0x2aa9a6);}};}function respondWithFilteredResult(_0x179a31,_0x5a1454){return function(_0x222009){if(_0x222009){var _0x4cff4b=typeof _0x5a1454[_0x17be('0x1f')]===_0x17be('0x20')&&typeof _0x5a1454[_0x17be('0x21')]===_0x17be('0x20');var _0x445e9b=_0x222009['count'];var _0x1b664c=_0x4cff4b?0x0:_0x5a1454[_0x17be('0x1f')];var _0x138b97=_0x4cff4b?_0x222009[_0x17be('0x22')]:_0x5a1454['offset']+_0x5a1454[_0x17be('0x21')];var _0x5310a3;if(_0x138b97>=_0x445e9b){_0x138b97=_0x445e9b;_0x5310a3=0xc8;}else{_0x5310a3=0xce;}_0x179a31['status'](_0x5310a3);return _0x179a31[_0x17be('0x23')](_0x17be('0x24'),_0x1b664c+'-'+_0x138b97+'/'+_0x445e9b)[_0x17be('0x25')](_0x222009);}return null;};}function patchUpdates(_0x285afc){return function(_0x5ec450){try{jsonpatch[_0x17be('0x26')](_0x5ec450,_0x285afc,!![]);}catch(_0x1aa54f){return BPromise['reject'](_0x1aa54f);}return _0x5ec450[_0x17be('0x27')]();};}function saveUpdates(_0x484d71,_0x1389a9){return function(_0x47839d){if(_0x47839d){return _0x47839d[_0x17be('0x28')](_0x484d71)[_0x17be('0x29')](function(_0x53320b){return _0x53320b;});}return null;};}function removeEntity(_0x4459fb,_0x4f535a){return function(_0x48ae1f){if(_0x48ae1f){return _0x48ae1f[_0x17be('0x2a')]()['then'](function(){_0x4459fb[_0x17be('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16a3ad,_0x1efef0){return function(_0x165046){if(!_0x165046){_0x16a3ad[_0x17be('0x2b')](0x194);}return _0x165046;};}function handleError(_0x339d11,_0x1f8908){_0x1f8908=_0x1f8908||0x1f4;return function(_0x266b84){logger[_0x17be('0x2c')](_0x266b84['stack']);if(_0x266b84[_0x17be('0x2d')]){delete _0x266b84[_0x17be('0x2d')];}_0x339d11[_0x17be('0x1e')](_0x1f8908)[_0x17be('0x2e')](_0x266b84);};}exports[_0x17be('0x2f')]=function(_0x564897,_0x233c28){var _0x294f46={},_0x456978={},_0x50e0c2={'count':0x0,'rows':[]};return db['CmContact'][_0x17be('0x30')]()[_0x17be('0x29')](function(_0x57c5b2){var _0x24c39a=[];for(var _0x48d695=0x0;_0x48d6950x1){_0x5b07e6['or'](_0x17be('0x6e'),qs[_0x17be('0x6f')](_0x19e1e8),null);}else{if(qs[_0x17be('0x70')](_0x19e1e8)){_0x5b07e6['or'](_0x17be('0x71'),_0x19e1e8+'%');_0x5b07e6['or'](_0x17be('0x72'),_0x19e1e8+'%');_0x5b07e6['or'](_0x17be('0x73'),_0x19e1e8+'%');_0x5b07e6['or']('c.fax\x20LIKE\x20?',_0x19e1e8+'%');}else if(qs[_0x17be('0x74')](_0x19e1e8)){_0x5b07e6['or'](_0x17be('0x75'),_0x19e1e8+'%');}else{_0x5b07e6['or']('c.firstName\x20LIKE\x20?','%'+_0x19e1e8+'%');_0x5b07e6['or'](_0x17be('0x76'),'%'+_0x19e1e8+'%');_0x5b07e6['or']('c.email\x20LIKE\x20?','%'+_0x19e1e8+'%');}}}}_0x1536ca[_0x17be('0x41')](_0x5b07e6);_0x1536ca['group'](_0x17be('0x77'));var _0x272132={'type':db[_0x17be('0x78')][_0x17be('0x79')]['SELECT'],'raw':!![]};var _0x4c92f1=_0x1536ca[_0x17be('0x7a')]()[_0x17be('0x44')](_0x17be('0x77'));if(_0x294f46[_0x17be('0x7b')]){_0x294f46[_0x17be('0x7b')]['forEach'](function(_0x18e9c4){_0x1536ca[_0x17be('0x7b')]('c.'+_0x18e9c4[0x0],_0x18e9c4[0x1]==='DESC'?![]:!![]);});}if(!_[_0x17be('0x7c')](_0x81a890)){_0x1536ca[_0x17be('0x7d')](_0x2ce6c5);_0x4c92f1['where']('t.id\x20IN\x20?',_0x81a890);}BPromise[_0x17be('0x7e')]()[_0x17be('0x29')](function(){if(!_0x450edd)return;if(_0x564897['user'][_0x17be('0x7f')]!==_0x17be('0x80'))return;if(!_[_0x17be('0x81')](_0x450edd[_0x17be('0x53')],[_0x17be('0x44'),_0x17be('0x58')])){return _0x564897[_0x17be('0x82')][_0x17be('0x83')]({'attributes':['id'],'raw':!![]})[_0x17be('0x29')](function(_0x39452f){if(_[_0x17be('0x7c')](_0x39452f)){_0x4c92f1[_0x17be('0x41')](_0x17be('0x84'));_0x1536ca[_0x17be('0x41')]('c.ListId\x20IS\x20NULL');}else{_0x4c92f1['where'](_0x17be('0x68'),_[_0x17be('0x57')](_0x39452f,'id'));_0x1536ca[_0x17be('0x41')](_0x17be('0x68'),_[_0x17be('0x57')](_0x39452f,'id'));}});}})[_0x17be('0x29')](function(){if(_0x564897[_0x17be('0x82')]['role']===_0x17be('0x80')&&!_0x450edd&&!_0x564897[_0x17be('0x3a')][_0x17be('0x67')])return[];return db[_0x17be('0x85')]['query'](_0x4c92f1[_0x17be('0x86')](),_0x272132);})[_0x17be('0x29')](function(_0x554d61){_0x50e0c2[_0x17be('0x22')]=_0x554d61['length'];if(_0x50e0c2['count']===0x0)return[];return db[_0x17be('0x85')]['query'](_0x42b50b['toString'](),_0x272132)['then'](function(_0x3ecf36){_0x2f79f8=_[_0x17be('0x87')](_0x3ecf36,'id');_0x272132=_['merge'](_0x272132,{'model':db[_0x17be('0x88')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x564897['query'][_0x17be('0x3e')]){_0x294f46[_0x17be('0x3c')][_0x17be('0x66')](function(_0x3c3f27){_0x1536ca[_0x17be('0x44')]('c.'+_0x3c3f27);});}else{_0x1536ca[_0x17be('0x44')]('c.id');_0x1536ca['field']('c.firstName');_0x1536ca[_0x17be('0x44')](_0x17be('0x89'));_0x1536ca[_0x17be('0x44')](_0x17be('0x8a'));_0x1536ca[_0x17be('0x44')]('c.mobile');_0x1536ca[_0x17be('0x44')](_0x17be('0x8b'));_0x1536ca[_0x17be('0x44')](_0x17be('0x8c'));_0x1536ca[_0x17be('0x44')]('c.ListId');_0x1536ca[_0x17be('0x44')](_0x17be('0x8d'));_0x1536ca[_0x17be('0x44')]('c.deletedAt');_0x1536ca[_0x17be('0x44')](_0x17be('0x8e'));_0x1536ca[_0x17be('0x44')](_0x17be('0x8f'),_0x17be('0x90'));}if(_0x294f46[_0x17be('0x21')])_0x1536ca[_0x17be('0x21')](_0x294f46[_0x17be('0x21')]);if(_0x294f46[_0x17be('0x1f')])_0x1536ca[_0x17be('0x1f')](_0x294f46[_0x17be('0x1f')]);return db[_0x17be('0x85')]['query'](_0x1536ca[_0x17be('0x86')](),_0x272132);});})[_0x17be('0x29')](function(_0x4851ad){_0x4851ad[_0x17be('0x66')](function(_0x3e552d){if(_0x3e552d['TagIds']){_0x3e552d[_0x17be('0x91')]=[];_0x3e552d[_0x17be('0x90')]['split'](',')['forEach'](function(_0xbbd80){_0x3e552d['Tags']['push'](_0x2f79f8[_0xbbd80]);});}delete _0x3e552d[_0x17be('0x90')];});_0x50e0c2[_0x17be('0x92')]=_0x4851ad;return _0x50e0c2;})[_0x17be('0x29')](respondWithFilteredResult(_0x233c28,_0x294f46));})[_0x17be('0x93')](handleError(_0x233c28,null));};exports[_0x17be('0x2a')]=function(_0x1b4372,_0x32022e){return db[_0x17be('0x88')][_0x17be('0x54')]({'where':{'id':_0x1b4372[_0x17be('0x94')]['id']}})[_0x17be('0x29')](handleEntityNotFound(_0x32022e,null))[_0x17be('0x29')](removeEntity(_0x32022e,null))[_0x17be('0x93')](handleError(_0x32022e,null));};exports['describe']=function(_0x3c8b95,_0x590c29){return db[_0x17be('0x88')][_0x17be('0x30')]()['then'](function(_0xede2dc){delete _0xede2dc[_0x17be('0x95')];for(var _0x2afcf6=0x0;_0x2afcf60x0){return new Promise(function(_0xbc6f2f,_0x1e5b25){var _0x525a74=[];for(var _0x1f0860=0x0;_0x1f0860<_0x2bbcd3[_0x17be('0x32')];_0x1f0860++){_0x525a74[_0x17be('0x35')](insertAdditionalPhones(_0x2bbcd3[_0x1f0860]['contact'],_0x2bbcd3[_0x1f0860][_0x17be('0xb7')]));}Promise[_0x17be('0xbd')](_0x525a74)[_0x17be('0x29')](function(){_0xbc6f2f(0x1);});})[_0x17be('0x29')](function(){return{'success':_0x46c3a8,'failure':_0x5ea16e,'duplicates':_0x2ca38a};});}else{return{'success':_0x46c3a8,'failure':_0x5ea16e,'duplicates':_0x2ca38a};}}})['then'](respondWithResult(_0x1f611a,0xc9))[_0x17be('0x93')](handleError(_0x1f611a,null));};exports[_0x17be('0xbe')]=function(_0x401e53,_0x469c70,_0x51cf9c){var _0x426b1b;return db[_0x17be('0x88')][_0x17be('0x30')]()[_0x17be('0x29')](function(_0x893b64){return db[_0x17be('0x88')][_0x17be('0x54')]({'where':{'id':_0x401e53[_0x17be('0x94')]['id']},'include':[{'model':db['Tag'],'as':_0x17be('0x91'),'attributes':['id',_0x17be('0x2d'),_0x17be('0x45')],'required':_0x401e53['query'][_0x17be('0x6a')]?!![]:![]},{'model':db[_0x17be('0xab')],'as':_0x17be('0xbf'),'where':{'CmContactId':_0x401e53['params']['id']},'required':![],'include':[{'model':db['ContactItemType'],'as':'ItemType'}]}],'order':[db[_0x17be('0x85')]['literal'](_0x17be('0xc0'))],'logging':console['log'],'attributes':_[_0x17be('0x31')](_0x893b64)});})['then'](function(_0x2264cd){_0x426b1b=_0x2264cd[_0x17be('0x9c')]({'plain':!![]});var _0x4a9bec={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x2264cd&&_0x2264cd[_0x17be('0x67')]){if(_0x2264cd[_0x17be('0x67')]){_0x4a9bec[_0x17be('0x41')][_0x17be('0xc1')][_0x17be('0x35')]({'ListId':{'$ne':_0x2264cd['ListId']}});}}return db[_0x17be('0x36')]['findAll'](_0x4a9bec);})['then'](function(_0x397539){return _['omit'](_0x426b1b,_['map'](_0x397539,function(_0x5363f1){return util['format']('cf_%d',_0x5363f1['id']);}));})['then'](handleEntityNotFound(_0x469c70,null))[_0x17be('0x29')](respondWithResult(_0x469c70,null))['catch'](handleError(_0x469c70,null));};exports[_0x17be('0x28')]=function(_0x20e204,_0x584117){var _0x16835a;if(_0x20e204['body']['id']){delete _0x20e204[_0x17be('0x9b')]['id'];}return db['CmContact'][_0x17be('0x54')]({'where':{'id':_0x20e204[_0x17be('0x94')]['id']}})[_0x17be('0x29')](handleEntityNotFound(_0x584117,null))['then'](saveUpdates(_0x20e204[_0x17be('0x9b')],null))['then'](function(_0x28c0dd){_0x16835a=_0x28c0dd;var _0x14a06b={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x28c0dd&&_0x28c0dd[_0x17be('0x67')]){if(_0x28c0dd[_0x17be('0x67')]){_0x14a06b['where'][_0x17be('0xc1')][_0x17be('0x35')]({'ListId':{'$ne':_0x28c0dd[_0x17be('0x67')]}});}}return db[_0x17be('0x36')][_0x17be('0xc2')](_0x14a06b);})[_0x17be('0x29')](function(_0x4502aa){if(_0x4502aa){return _[_0x17be('0xc3')](_[_0x17be('0xc4')](_0x20e204[_0x17be('0x9b')],function(_0x19f7d6,_0x582eec){return _[_0x17be('0x33')](_0x582eec,'cf_');}),_[_0x17be('0x57')](_0x4502aa,function(_0x194aa0){return util[_0x17be('0xc5')](_0x17be('0xc6'),_0x194aa0['id']);}));}})[_0x17be('0x29')](function(_0x5dab34){if(_0x5dab34&&!_['isEmpty'](_0x5dab34)){var _0x2eceb7=squel[_0x17be('0x28')]()[_0x17be('0xc7')]('cm_contacts')[_0x17be('0xc8')](_0x5dab34)['where'](_0x17be('0xc9'),_0x20e204[_0x17be('0x94')]['id'])['toParam']();return db[_0x17be('0x85')]['query'](_0x2eceb7[_0x17be('0xca')],{'replacements':_0x2eceb7[_0x17be('0x99')]});}})[_0x17be('0x29')](function(){if(_0x20e204[_0x17be('0x9b')][_0x17be('0xcb')]&&_0x16835a){return db[_0x17be('0xcc')]['update']({'phone':_0x20e204[_0x17be('0x9b')]['phone']},{'where':{'ContactId':_0x16835a['id']}});}})[_0x17be('0x29')](function(){return _0x16835a;})[_0x17be('0x29')](respondWithResult(_0x584117,null))[_0x17be('0x93')](handleError(_0x584117,null));};exports['getTags']=function(_0x23592a,_0x73ca71,_0x27bec8){var _0x20118f={};var _0x3b511a={};var _0x5e0239;var _0x3e0fa7;return db[_0x17be('0x88')]['findOne']({'where':{'id':_0x23592a[_0x17be('0x94')]['id']}})['then'](handleEntityNotFound(_0x73ca71,null))[_0x17be('0x29')](function(_0x5883d5){if(_0x5883d5){_0x5e0239=_0x5883d5;_0x3b511a['model']=_[_0x17be('0x31')](db['Tag']['rawAttributes']);_0x3b511a[_0x17be('0x3a')]=_[_0x17be('0x31')](_0x23592a[_0x17be('0x3a')]);_0x3b511a[_0x17be('0x3b')]=_[_0x17be('0x3d')](_0x3b511a['model'],_0x3b511a[_0x17be('0x3a')]);_0x20118f[_0x17be('0x3c')]=_['intersection'](_0x3b511a[_0x17be('0x39')],qs[_0x17be('0x3e')](_0x23592a[_0x17be('0x3a')][_0x17be('0x3e')]));_0x20118f[_0x17be('0x3c')]=_0x20118f['attributes']['length']?_0x20118f['attributes']:_0x3b511a[_0x17be('0x39')];_0x20118f[_0x17be('0x7b')]=qs['sort'](_0x23592a[_0x17be('0x3a')]['sort']);_0x20118f[_0x17be('0x41')]=qs[_0x17be('0x3b')](_['pick'](_0x23592a['query'],_0x3b511a[_0x17be('0x3b')]));if(_0x23592a[_0x17be('0x3a')][_0x17be('0x63')]){_0x20118f[_0x17be('0x41')]=_[_0x17be('0x9a')](_0x20118f['where'],{'$or':_[_0x17be('0x57')](_0x20118f[_0x17be('0x3c')],function(_0x48593d){var _0x4a762d={};_0x4a762d[_0x48593d]={'$like':'%'+_0x23592a[_0x17be('0x3a')][_0x17be('0x63')]+'%'};return _0x4a762d;})});}_0x20118f=_[_0x17be('0x9a')]({},_0x20118f,_0x23592a['options']);return _0x5e0239[_0x17be('0xcd')](_0x20118f);}})[_0x17be('0x29')](function(_0x439be0){if(_0x439be0){_0x3e0fa7=_0x439be0[_0x17be('0x32')];if(!_0x23592a['query'][_0x17be('0x3f')]('nolimit')){_0x20118f[_0x17be('0x21')]=qs[_0x17be('0x21')](_0x23592a[_0x17be('0x3a')][_0x17be('0x21')]);_0x20118f[_0x17be('0x1f')]=qs['offset'](_0x23592a[_0x17be('0x3a')][_0x17be('0x1f')]);}return _0x5e0239['getTags'](_0x20118f);}})[_0x17be('0x29')](function(_0x3e98bf){if(_0x3e98bf){return _0x3e98bf?{'count':_0x3e0fa7,'rows':_0x3e98bf}:null;}})[_0x17be('0x29')](respondWithResult(_0x73ca71,null))[_0x17be('0x93')](handleError(_0x73ca71,null));};exports[_0x17be('0xce')]=function(_0xb030da,_0x251c22,_0x21a546){if(_0xb030da[_0x17be('0x9b')]['id']){delete _0xb030da[_0x17be('0x9b')]['id'];}return db[_0x17be('0x88')][_0x17be('0xcf')]({'where':{'id':_0xb030da['params']['id']}})[_0x17be('0x29')](handleEntityNotFound(_0x251c22,null))['then'](function(_0x3bf4b2){if(_0x3bf4b2){return _0x3bf4b2[_0x17be('0xce')](_0xb030da[_0x17be('0x9b')][_0x17be('0xd0')]||[]);}return null;})[_0x17be('0x29')](respondWithResult(_0x251c22,null))['catch'](handleError(_0x251c22,null));};exports['setAdditionalPhones']=function(_0x5c160b,_0x4f9b36){var _0x404181=[];_0x404181['push'](addAdditionalPhones(_0x5c160b[_0x17be('0x9b')]));Promise[_0x17be('0xbd')](_0x404181)[_0x17be('0x29')](function(){_0x404181=[];_0x404181[_0x17be('0x35')](deleteCmHopperPhones(_0x5c160b[_0x17be('0x9b')]['id']));_0x404181['push'](addCmHopperPhones(_0x5c160b[_0x17be('0x9b')]['id']));Promise['all'](_0x404181)[_0x17be('0x29')](function(){return[0x1];})[_0x17be('0x29')](respondWithResult(_0x4f9b36,null));});};function addAdditionalPhones(_0x2f1fd0){var _0x358c04;return new Promise(function(_0xe46107,_0x30f9cf){return db[_0x17be('0xab')][_0x17be('0x2a')]({'where':{'CmContactId':_0x2f1fd0['id']}})[_0x17be('0x29')](function(){var _0x4c37f4=[];for(var _0x58072d=0x0;_0x58072d<_0x2f1fd0[_0x17be('0xd1')][_0x17be('0x32')];_0x58072d++){var _0x227f93=_0x2f1fd0[_0x17be('0xd2')]?_[_0x17be('0x64')](_0x2f1fd0[_0x17be('0xd2')][_0x58072d])?'':_0x2f1fd0['item_types'][_0x58072d]:_0x2f1fd0[_0x17be('0xd1')][_0x58072d][_0x17be('0xd3')]?_0x2f1fd0['items'][_0x58072d][_0x17be('0xd3')]:'';var _0x59de60=_[_0x17be('0x64')](_0x2f1fd0[_0x17be('0xd1')][_0x58072d]['description'])?'':_0x2f1fd0[_0x17be('0xd1')][_0x58072d][_0x17be('0xd4')];var _0xc20026=_0x227f93+':'+_0x2f1fd0[_0x17be('0xd1')][_0x58072d][_0x17be('0xcb')]+'§'+_0x59de60;if(_[_0x17be('0x64')](_0x358c04))_0x358c04=_0xc20026;else _0x358c04+=';'+_0xc20026;_0x4c37f4[_0x17be('0x35')](addAdditionalPhone(_0x2f1fd0['id'],_0x2f1fd0[_0x17be('0xd1')][_0x58072d][_0x17be('0xcb')],_0x2f1fd0[_0x17be('0xd2')]?_['isNil'](_0x2f1fd0[_0x17be('0xd2')][_0x58072d])?null:_0x2f1fd0[_0x17be('0xd2')][_0x58072d]:_0x2f1fd0[_0x17be('0xd1')][_0x58072d]['ItemTypeId']?_0x2f1fd0[_0x17be('0xd1')][_0x58072d][_0x17be('0xd3')]:null,_0x58072d,_0x59de60));}Promise[_0x17be('0xbd')](_0x4c37f4)[_0x17be('0x29')](function(){db['CmContact'][_0x17be('0x28')]({'AdditionalPhones':_0x358c04},{'where':{'id':_0x2f1fd0['id']}})[_0x17be('0x29')](function(){_0xe46107(0x1);});});});});}function addAdditionalPhone(_0xf0f27f,_0x3c41a9,_0x46f628,_0x976cc5,_0x16b144){return db[_0x17be('0xab')]['find']({'where':{'CmContactId':_0xf0f27f,'item':_0x3c41a9}})[_0x17be('0x29')](function(_0xfb3900){if(_0xfb3900)logger[_0x17be('0xa0')](_0x17be('0xd5'),_0xfb3900);else{db['CmContactHasItem'][_0x17be('0xa4')]({'CmContactId':_0xf0f27f,'item':_0x3c41a9,'ItemTypeId':_0x46f628,'OrderBy':_0x976cc5,'ItemClass':_0x17be('0xd6'),'description':_0x16b144});}});}function deletePhones(_0x47e3d4){return db[_0x17be('0xab')]['destroy']({'where':{'CmContactId':_0x47e3d4}});}function deleteCmHopperPhones(_0x445456){return new Promise(function(_0x557df4,_0x17c724){return db[_0x17be('0xcc')][_0x17be('0xc2')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x445456}})[_0x17be('0x29')](function(_0x528dff){db[_0x17be('0xd7')][_0x17be('0x2a')]({'where':{'CmHopperId':{'$in':_[_0x17be('0x57')](_0x528dff,'id')}}});})[_0x17be('0x29')](function(){_0x557df4(0x1);});});}function addCmHopperPhones(_0x31a51c){return new Promise(function(_0x51f8ca,_0x2547b5){return db[_0x17be('0xcc')][_0x17be('0xc2')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x31a51c}})[_0x17be('0x29')](function(_0x55054a){var _0x4de8c1=[];_[_0x17be('0x57')](_0x55054a,function(_0x923da9){_0x4de8c1['push'](createCmHopperPhone(_0x31a51c,_0x923da9['id']));});Promise[_0x17be('0xbd')](_0x4de8c1)[_0x17be('0x29')](function(){_0x51f8ca(0x1);});});});}function createCmHopperPhone(_0x511fc8,_0x591e5a){return new Promise(function(_0x5e228f,_0x5db52c){db['CmContactHasItem']['findAll']({'raw':!![],'attributes':[_0x17be('0xd8')],'where':{'CmContactId':_0x511fc8,'ItemClass':_0x17be('0xd6')},'include':[{'model':db[_0x17be('0xd9')],'attributes':['OrderBy'],'as':_0x17be('0xda')}],'order':[db[_0x17be('0x85')][_0x17be('0xdb')](_0x17be('0xdc'))]})[_0x17be('0x29')](function(_0x51324f){var _0x266114=0x1;var _0x481a3a=_['map'](_0x51324f,function(_0x544d9b){_0x544d9b[_0x17be('0xdd')]=_0x591e5a;_0x544d9b[_0x17be('0xcb')]=_0x544d9b['item'];_0x544d9b[_0x17be('0xde')]=_0x544d9b[_0x17be('0xdf')]||_0x266114;delete _0x544d9b[_0x17be('0xdf')];_0x266114=_0x266114+0x1;return _0x544d9b;});return db[_0x17be('0xd7')]['bulkCreate'](_0x481a3a,{});})[_0x17be('0x29')](function(){_0x5e228f(0x1);});});}function insertAdditionalPhones(_0x27cb62,_0x1fe32c){return new Promise(function(_0x14d62e,_0x4a49da){var _0x45393f=[];for(var _0x3ed267=0x0;_0x3ed267<_0x1fe32c[_0x17be('0x32')];_0x3ed267++){var _0x4f5aeb=_0x1fe32c[_0x3ed267];_0x45393f[_0x17be('0x35')](parseContactItemType(_0x4f5aeb));}Promise['all'](_0x45393f)['then'](function(){var _0x4e69a3={'id':_0x27cb62['id'],'items':_0x1fe32c};return addAdditionalPhones(_0x4e69a3)[_0x17be('0x29')](function(_0x2da76b){return addCmHopperPhones(_0x27cb62['id']);});})[_0x17be('0x29')](function(){_0x14d62e(_0x27cb62);});});}function parseContactItemType(_0x159ed9){return new Promise(function(_0xdc8bc8,_0x48219e){if(_0x159ed9[_0x17be('0x3f')](_0x17be('0xd3'))){_0xdc8bc8(_0x159ed9);}else{return db[_0x17be('0xd9')][_0x17be('0x54')]({'where':{'name':_0x159ed9['ItemType']}})[_0x17be('0x29')](function(_0x12cf8d){if(_['isNil'](_0x12cf8d))_0x159ed9[_0x17be('0xd3')]=null;else _0x159ed9[_0x17be('0xd3')]=_0x12cf8d['id'];_0xdc8bc8(_0x159ed9);});}});}exports['getAdditionalPhones']=function(_0xd86765,_0x5c49b4){return db[_0x17be('0xab')][_0x17be('0xc2')]({'raw':!![],'where':{'CmContactId':_0xd86765[_0x17be('0x94')]['id'],'ItemClass':_0x17be('0xd6')},'include':[{'model':db[_0x17be('0xd9')],'as':_0x17be('0xda')}],'order':[[db[_0x17be('0x85')]['literal'](_0x17be('0xdc'))],['OrderBy']]})[_0x17be('0x29')](function(_0x4b53fa){return _0x4b53fa;})[_0x17be('0x29')](respondWithResult(_0x5c49b4,null))[_0x17be('0x93')](handleError(_0x5c49b4,null));};exports[_0x17be('0xe0')]=function(_0x46c06a,_0x3ca3d6){return db[_0x17be('0xab')]['findAll']({'raw':!![],'where':{'CmContactId':_0x46c06a[_0x17be('0x9b')][_0x17be('0xe1')]}})[_0x17be('0x29')](function(_0xe7dd4){var _0x2da5a8=_[_0x17be('0x57')](_0xe7dd4,function(_0xad9ceb){_0xad9ceb[_0x17be('0xe2')]=_0x46c06a[_0x17be('0x9b')]['toContactId'];return _0xad9ceb;});return db[_0x17be('0xab')][_0x17be('0xb8')](_0x2da5a8,{});})['then'](function(_0x339036){return addCmHopperPhones(_0x46c06a[_0x17be('0x9b')][_0x17be('0xe3')]);})['then'](function(_0x2bde39){return['ok'];})[_0x17be('0x29')](respondWithResult(_0x3ca3d6,null))[_0x17be('0x93')](handleError(_0x3ca3d6,null));};exports['rescheduleAdditionalPhones']=function(_0x7308c,_0x39d41b){var _0x43b6bc=[];_0x43b6bc[_0x17be('0x35')](createCmHopperPhone(_0x7308c[_0x17be('0x9b')]['id'],_0x7308c['body'][_0x17be('0xe4')]));Promise[_0x17be('0xbd')](_0x43b6bc)[_0x17be('0x29')](function(){return[0x1];})[_0x17be('0x29')](respondWithResult(_0x39d41b,null));};exports[_0x17be('0xe5')]=function(_0x48c63c,_0x12e083,_0x12bcfd){var _0x430dc7={'raw':![],'where':{}};var _0x439977={};var _0x19975d={'count':0x0,'rows':[]};return db[_0x17be('0x88')][_0x17be('0xcf')]({'where':{'id':_0x48c63c['params']['id']}})[_0x17be('0x29')](handleEntityNotFound(_0x12e083,null))[_0x17be('0x29')](function(_0x44be2c){if(_0x44be2c){_0x439977[_0x17be('0x39')]=_[_0x17be('0x31')](db[_0x17be('0xcc')]['rawAttributes']);_0x439977[_0x17be('0x3a')]=_['keys'](_0x48c63c[_0x17be('0x3a')]);_0x439977[_0x17be('0x3b')]=_[_0x17be('0x3d')](_0x439977['model'],_0x439977['query']);_0x430dc7['attributes']=_['intersection'](_0x439977['model'],qs[_0x17be('0x3e')](_0x48c63c[_0x17be('0x3a')][_0x17be('0x3e')]));_0x430dc7[_0x17be('0x3c')]=_0x430dc7[_0x17be('0x3c')][_0x17be('0x32')]?_0x430dc7[_0x17be('0x3c')]:_0x439977[_0x17be('0x39')];if(!_0x48c63c[_0x17be('0x3a')]['hasOwnProperty'](_0x17be('0xe6'))){_0x430dc7[_0x17be('0x21')]=qs[_0x17be('0x21')](_0x48c63c[_0x17be('0x3a')][_0x17be('0x21')]);_0x430dc7[_0x17be('0x1f')]=qs['offset'](_0x48c63c['query'][_0x17be('0x1f')]);}_0x430dc7[_0x17be('0x7b')]=qs[_0x17be('0x40')](_0x48c63c[_0x17be('0x3a')][_0x17be('0x40')]);_0x430dc7[_0x17be('0x41')]=qs[_0x17be('0x3b')](_[_0x17be('0x42')](_0x48c63c[_0x17be('0x3a')],_0x439977['filters']));_0x430dc7[_0x17be('0x41')]['ContactId']=_0x44be2c['id'];if(_0x48c63c[_0x17be('0x3a')][_0x17be('0x63')]){_0x430dc7[_0x17be('0x41')]=_[_0x17be('0x9a')](_0x430dc7['where'],{'$or':_[_0x17be('0x57')](_0x430dc7['attributes'],function(_0x4a8450){var _0x2aefef={};_0x2aefef[_0x4a8450]={'$like':'%'+_0x48c63c[_0x17be('0x3a')][_0x17be('0x63')]+'%'};return _0x2aefef;})});}_0x430dc7=_[_0x17be('0x9a')]({},_0x430dc7,_0x48c63c[_0x17be('0xe7')]);return db['CmHopper'][_0x17be('0x22')]({'where':_0x430dc7[_0x17be('0x41')]})[_0x17be('0x29')](function(_0x56f4c1){_0x19975d[_0x17be('0x22')]=_0x56f4c1;if(_0x48c63c['query'][_0x17be('0xe8')]){_0x430dc7['include']=[{'all':!![]}];}return db[_0x17be('0xcc')][_0x17be('0xc2')](_0x430dc7);})[_0x17be('0x29')](function(_0x510273){_0x19975d[_0x17be('0x92')]=_0x510273;return _0x19975d;});}})[_0x17be('0x29')](respondWithFilteredResult(_0x12e083,_0x430dc7))[_0x17be('0x93')](handleError(_0x12e083,null));};exports[_0x17be('0xe9')]=function(_0x5d609c,_0x2e3f89,_0x528a0c){var _0x404105={'raw':!![],'where':{}};var _0x485bf0={};var _0x1d96a1={'count':0x0,'rows':[]};return db[_0x17be('0x88')]['findOne']({'where':{'id':_0x5d609c[_0x17be('0x94')]['id']}})[_0x17be('0x29')](handleEntityNotFound(_0x2e3f89,null))[_0x17be('0x29')](function(_0x488439){if(_0x488439){_0x485bf0[_0x17be('0x39')]=_['keys'](db[_0x17be('0xad')]['rawAttributes']);_0x485bf0[_0x17be('0x3a')]=_['keys'](_0x5d609c[_0x17be('0x3a')]);_0x485bf0['filters']=_[_0x17be('0x3d')](_0x485bf0[_0x17be('0x39')],_0x485bf0[_0x17be('0x3a')]);_0x404105[_0x17be('0x3c')]=_[_0x17be('0x3d')](_0x485bf0[_0x17be('0x39')],qs[_0x17be('0x3e')](_0x5d609c['query'][_0x17be('0x3e')]));_0x404105[_0x17be('0x3c')]=_0x404105[_0x17be('0x3c')][_0x17be('0x32')]?_0x404105[_0x17be('0x3c')]:_0x485bf0[_0x17be('0x39')];if(!_0x5d609c[_0x17be('0x3a')]['hasOwnProperty'](_0x17be('0xe6'))){_0x404105[_0x17be('0x21')]=qs[_0x17be('0x21')](_0x5d609c['query'][_0x17be('0x21')]);_0x404105[_0x17be('0x1f')]=qs[_0x17be('0x1f')](_0x5d609c[_0x17be('0x3a')][_0x17be('0x1f')]);}_0x404105[_0x17be('0x7b')]=qs['sort'](_0x5d609c[_0x17be('0x3a')][_0x17be('0x40')]);_0x404105[_0x17be('0x41')]=qs['filters'](_['pick'](_0x5d609c[_0x17be('0x3a')],_0x485bf0[_0x17be('0x3b')]));_0x404105[_0x17be('0x41')][_0x17be('0xea')]=_0x488439['id'];if(_0x5d609c['query'][_0x17be('0x63')]){_0x404105[_0x17be('0x41')]=_[_0x17be('0x9a')](_0x404105[_0x17be('0x41')],{'$or':_[_0x17be('0x57')](_0x404105[_0x17be('0x3c')],function(_0x952c51){var _0x21d6df={};_0x21d6df[_0x952c51]={'$like':'%'+_0x5d609c[_0x17be('0x3a')][_0x17be('0x63')]+'%'};return _0x21d6df;})});}_0x404105=_[_0x17be('0x9a')]({},_0x404105,_0x5d609c[_0x17be('0xe7')]);return db[_0x17be('0xad')][_0x17be('0x22')]({'where':_0x404105[_0x17be('0x41')]})[_0x17be('0x29')](function(_0x5dd882){_0x1d96a1['count']=_0x5dd882;if(_0x5d609c[_0x17be('0x3a')]['includeAll']){_0x404105[_0x17be('0xeb')]=[{'all':!![]}];}return db[_0x17be('0xad')][_0x17be('0xc2')](_0x404105);})[_0x17be('0x29')](function(_0x413cb1){_0x1d96a1['rows']=_0x413cb1;return _0x1d96a1;});}})[_0x17be('0x29')](respondWithFilteredResult(_0x2e3f89,_0x404105))[_0x17be('0x93')](handleError(_0x2e3f89,null));};exports[_0x17be('0xec')]=function(_0x265fdc,_0xf3271d,_0x33616f){var _0x3d682d={'raw':!![],'where':{}};var _0xea0b7d={};var _0x4936dc={'count':0x0,'rows':[]};return db['CmContact'][_0x17be('0xcf')]({'where':{'id':_0x265fdc[_0x17be('0x94')]['id']}})[_0x17be('0x29')](handleEntityNotFound(_0xf3271d,null))['then'](function(_0x41f91c){if(_0x41f91c){_0xea0b7d[_0x17be('0x39')]=_[_0x17be('0x31')](db[_0x17be('0xac')][_0x17be('0xed')]);_0xea0b7d[_0x17be('0x3a')]=_[_0x17be('0x31')](_0x265fdc['query']);_0xea0b7d['filters']=_[_0x17be('0x3d')](_0xea0b7d[_0x17be('0x39')],_0xea0b7d['query']);_0x3d682d['attributes']=_[_0x17be('0x3d')](_0xea0b7d['model'],qs['fields'](_0x265fdc[_0x17be('0x3a')][_0x17be('0x3e')]));_0x3d682d[_0x17be('0x3c')]=_0x3d682d[_0x17be('0x3c')][_0x17be('0x32')]?_0x3d682d[_0x17be('0x3c')]:_0xea0b7d[_0x17be('0x39')];if(!_0x265fdc[_0x17be('0x3a')][_0x17be('0x3f')]('nolimit')){_0x3d682d[_0x17be('0x21')]=qs[_0x17be('0x21')](_0x265fdc['query'][_0x17be('0x21')]);_0x3d682d[_0x17be('0x1f')]=qs[_0x17be('0x1f')](_0x265fdc['query']['offset']);}_0x3d682d[_0x17be('0x7b')]=qs[_0x17be('0x40')](_0x265fdc[_0x17be('0x3a')][_0x17be('0x40')]);_0x3d682d['where']=qs[_0x17be('0x3b')](_['pick'](_0x265fdc[_0x17be('0x3a')],_0xea0b7d['filters']));_0x3d682d[_0x17be('0x41')][_0x17be('0xea')]=_0x41f91c['id'];if(_0x265fdc[_0x17be('0x3a')][_0x17be('0x63')]){_0x3d682d[_0x17be('0x41')]=_[_0x17be('0x9a')](_0x3d682d[_0x17be('0x41')],{'$or':_[_0x17be('0x57')](_0x3d682d[_0x17be('0x3c')],function(_0x9c5c6a){var _0x218ad7={};_0x218ad7[_0x9c5c6a]={'$like':'%'+_0x265fdc[_0x17be('0x3a')][_0x17be('0x63')]+'%'};return _0x218ad7;})});}_0x3d682d=_[_0x17be('0x9a')]({},_0x3d682d,_0x265fdc[_0x17be('0xe7')]);return db[_0x17be('0xac')][_0x17be('0x22')]({'where':_0x3d682d[_0x17be('0x41')]})['then'](function(_0x47a042){_0x4936dc[_0x17be('0x22')]=_0x47a042;if(_0x265fdc[_0x17be('0x3a')][_0x17be('0xe8')]){_0x3d682d['include']=[{'all':!![]}];}return db[_0x17be('0xac')]['findAll'](_0x3d682d);})[_0x17be('0x29')](function(_0xbc64f){_0x4936dc['rows']=_0xbc64f;return _0x4936dc;});}})[_0x17be('0x29')](respondWithFilteredResult(_0xf3271d,_0x3d682d))[_0x17be('0x93')](handleError(_0xf3271d,null));};exports[_0x17be('0xee')]=function(_0xde87fd,_0xa9e77d,_0x36942f){var _0x517c2c={'raw':!![],'where':{}};var _0x3e12c4={};var _0x16689c={'count':0x0,'rows':[]};return db[_0x17be('0x88')][_0x17be('0xcf')]({'where':{'id':_0xde87fd[_0x17be('0x94')]['id']}})[_0x17be('0x29')](handleEntityNotFound(_0xa9e77d,null))[_0x17be('0x29')](function(_0x16fd52){if(_0x16fd52){_0x3e12c4['model']=_[_0x17be('0x31')](db[_0x17be('0xb3')][_0x17be('0xed')]);_0x3e12c4[_0x17be('0x3a')]=_['keys'](_0xde87fd['query']);_0x3e12c4[_0x17be('0x3b')]=_[_0x17be('0x3d')](_0x3e12c4['model'],_0x3e12c4['query']);_0x517c2c[_0x17be('0x3c')]=_[_0x17be('0x3d')](_0x3e12c4[_0x17be('0x39')],qs[_0x17be('0x3e')](_0xde87fd[_0x17be('0x3a')][_0x17be('0x3e')]));_0x517c2c['attributes']=_0x517c2c['attributes']['length']?_0x517c2c[_0x17be('0x3c')]:_0x3e12c4[_0x17be('0x39')];if(!_0xde87fd['query'][_0x17be('0x3f')](_0x17be('0xe6'))){_0x517c2c['limit']=qs[_0x17be('0x21')](_0xde87fd['query']['limit']);_0x517c2c[_0x17be('0x1f')]=qs[_0x17be('0x1f')](_0xde87fd[_0x17be('0x3a')]['offset']);}_0x517c2c[_0x17be('0x7b')]=qs[_0x17be('0x40')](_0xde87fd[_0x17be('0x3a')][_0x17be('0x40')]);_0x517c2c['where']=qs[_0x17be('0x3b')](_['pick'](_0xde87fd['query'],_0x3e12c4[_0x17be('0x3b')]));_0x517c2c[_0x17be('0x41')][_0x17be('0xea')]=_0x16fd52['id'];if(_0xde87fd[_0x17be('0x3a')][_0x17be('0x63')]){_0x517c2c[_0x17be('0x41')]=_[_0x17be('0x9a')](_0x517c2c[_0x17be('0x41')],{'$or':_[_0x17be('0x57')](_0x517c2c[_0x17be('0x3c')],function(_0x4ce649){var _0x36f552={};_0x36f552[_0x4ce649]={'$like':'%'+_0xde87fd[_0x17be('0x3a')][_0x17be('0x63')]+'%'};return _0x36f552;})});}_0x517c2c=_['merge']({},_0x517c2c,_0xde87fd[_0x17be('0xe7')]);return db['JscriptySessionReport'][_0x17be('0x22')]({'where':_0x517c2c[_0x17be('0x41')]})[_0x17be('0x29')](function(_0x28f3c2){_0x16689c[_0x17be('0x22')]=_0x28f3c2;if(_0xde87fd['query'][_0x17be('0xe8')]){_0x517c2c['include']=[{'all':!![]}];}return db[_0x17be('0xb3')]['findAll'](_0x517c2c);})['then'](function(_0x5830b1){_0x16689c[_0x17be('0x92')]=_0x5830b1;return _0x16689c;});}})['then'](respondWithFilteredResult(_0xa9e77d,_0x517c2c))['catch'](handleError(_0xa9e77d,null));};exports[_0x17be('0xef')]=function(_0x4196fe,_0x478026,_0xbed496){try{if(!_0x4196fe[_0x17be('0x9b')][_0x17be('0x67')]){throw new Error(_0x17be('0xf0'));}if(!_0x4196fe[_0x17be('0x9b')]['binding_keys']){throw new Error('No\x20association\x20keys\x20specified!');}if(!_0x4196fe[_0x17be('0x9b')][_0x17be('0xf1')]){throw new Error(_0x17be('0xf2'));}if(!_0x4196fe['body']['socket_timestamp']){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x30bff7=_0x4196fe[_0x17be('0x9b')][_0x17be('0xf3')]['split'](',');var _0x49b80e=_0x4196fe['body'][_0x17be('0xf1')][_0x17be('0x56')](',');if(!_0x30bff7[_0x17be('0x32')]||!_0x49b80e['length']||_0x30bff7['length']!==_0x49b80e[_0x17be('0x32')]){throw new Error(_0x17be('0xf4'));}_0x4196fe[_0x17be('0x9b')]['fields']=_[_0x17be('0xf5')](_0x30bff7,_0x49b80e);if(!_0x4196fe[_0x17be('0x9b')]['fields']['phone']){throw new Error(_0x17be('0xf6'));}if(!_0x4196fe[_0x17be('0x9b')][_0x17be('0x3e')][_0x17be('0xf7')]){throw new Error(_0x17be('0xf8'));}var _0x3c1729=path['join'](config[_0x17be('0xf9')],_0x17be('0xfa'),_0x4196fe[_0x17be('0xfb')][_0x17be('0xfc')]);fs[_0x17be('0xfd')](_0x3c1729,parseInt(_0x17be('0xfe'),0x8));var _0x3d7d42=require(_0x17be('0xff'))[_0x17be('0x100')](path['join'](__dirname,_0x17be('0x101')),[_0x3c1729,_0x4196fe['body']['binding_keys'],_0x4196fe[_0x17be('0x9b')][_0x17be('0xf1')],_0x4196fe[_0x17be('0x9b')][_0x17be('0x67')],_0x4196fe[_0x17be('0x9b')][_0x17be('0x102')],_0x4196fe[_0x17be('0x9b')][_0x17be('0xba')],_0x4196fe[_0x17be('0x9b')]['socket_timestamp']]);return _0x478026[_0x17be('0x1e')](0xc8)[_0x17be('0x25')]({'message':_0x17be('0x103'),'pid':_0x3d7d42[_0x17be('0x104')]});}catch(_0x24ab40){return _0x478026[_0x17be('0x1e')](0x1f4)[_0x17be('0x2e')](_0x24ab40);}};exports[_0x17be('0x105')]=function(_0x2430a7,_0x406bbe,_0x36fb88){var _0x353209=fs[_0x17be('0x106')](_0x2430a7['file'][_0x17be('0x107')]);Papa[_0x17be('0x108')](_0x353209,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x9e8be9){return _0x406bbe[_0x17be('0x1e')](0xc8)[_0x17be('0x25')]({'file':_0x2430a7[_0x17be('0xfb')],'fields':_0x9e8be9[_0x17be('0x109')][_0x17be('0x3e')]});}});};exports['import']=function(_0x2fc9e2,_0x5c7852,_0x370cf0){return db[_0x17be('0x58')][_0x17be('0xc2')]({'raw':!![],'attributes':['id'],'where':{'role':'agent'}})[_0x17be('0x29')](function(_0x1f1182){var _0x342e81=![];if(!_0x2fc9e2[_0x17be('0x9b')][_0x17be('0x67')]){throw new Error(_0x17be('0xf0'));}if(!_0x2fc9e2['body'][_0x17be('0x10a')][_0x17be('0xcb')]){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x2fc9e2[_0x17be('0x9b')]['binding'][_0x17be('0xf7')]){throw new Error(_0x17be('0xf8'));}if(!_0x2fc9e2[_0x17be('0x9b')][_0x17be('0x10b')]){throw new Error(_0x17be('0x10c'));}var _0x9fcaef=require(_0x17be('0xff'))[_0x17be('0x100')](path[_0x17be('0x9e')](__dirname,_0x17be('0x10d')),[_0x2fc9e2[_0x17be('0x94')]['id'],JSON[_0x17be('0x10e')](_0x2fc9e2[_0x17be('0x9b')]),JSON[_0x17be('0x10e')](_0x1f1182)]);_0x9fcaef['on'](_0x17be('0x10f'),function(_0x11fdef){_0x342e81=!![];return _0x5c7852['status'](0xc8)[_0x17be('0x25')]({'message':_0x17be('0x110'),'pid':_0x9fcaef[_0x17be('0x104')]});});_0x9fcaef['on'](_0x17be('0x111'),function(_0x2d8be2){if(_0x2d8be2&&!_0x342e81){return _0x5c7852[_0x17be('0x1e')](0x1f4)[_0x17be('0x25')]({'message':_0x17be('0x112'),'pid':_0x9fcaef[_0x17be('0x104')]});}});})[_0x17be('0x93')](handleError(_0x5c7852,null));};exports['importUpdates']=function(_0x2a349b,_0x268536,_0x546c64){return db[_0x17be('0x58')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x17be('0x80')}})['then'](function(_0x1b9d1){var _0x7ca428=![];if(!_0x2a349b[_0x17be('0x9b')]['ListId']){throw new Error('No\x20ListId\x20specified');}if(!_0x2a349b[_0x17be('0x9b')]['binding'][_0x17be('0xcb')]){throw new Error(_0x17be('0xf6'));}if(!_0x2a349b['body'][_0x17be('0x10a')][_0x17be('0xf7')]){throw new Error(_0x17be('0xf8'));}if(!_0x2a349b[_0x17be('0x9b')][_0x17be('0x10b')]){throw new Error(_0x17be('0x10c'));}var _0x5bae0c=require(_0x17be('0xff'))[_0x17be('0x100')](path[_0x17be('0x9e')](__dirname,_0x17be('0x113')),[_0x2a349b[_0x17be('0x94')]['id'],JSON[_0x17be('0x10e')](_0x2a349b[_0x17be('0x9b')]),JSON[_0x17be('0x10e')](_0x1b9d1)]);_0x5bae0c['on'](_0x17be('0x10f'),function(_0x2b2b2f){_0x7ca428=!![];return _0x268536['status'](0xc8)['json']({'message':_0x17be('0x110'),'pid':_0x5bae0c[_0x17be('0x104')]});});_0x5bae0c['on'](_0x17be('0x111'),function(_0x3f05dc){if(_0x3f05dc&&!_0x7ca428){return _0x268536[_0x17be('0x1e')](0x1f4)[_0x17be('0x25')]({'message':_0x17be('0x112'),'pid':_0x5bae0c[_0x17be('0x104')]});}});})['catch'](handleError(_0x268536,null));};exports[_0x17be('0x114')]=function(_0x419fce,_0x7d7008){var _0x4decd3=[_0x17be('0x115'),_0x17be('0x116'),_0x17be('0x117'),'openchannel',_0x17be('0x118'),_0x17be('0x119'),_0x17be('0x11a')];var _0x1d1945={'offset':0x0,'order':qs[_0x17be('0x40')](_0x17be('0x11b'))},_0x4fd1a3={'count':0x0,'rows':[]};Promise[_0x17be('0x7e')]()[_0x17be('0x29')](function(){if(_0x419fce[_0x17be('0x3a')]['channel']){if(!_[_0x17be('0x11c')](_0x4decd3,_0x419fce['query']['channel'][_0x17be('0x11d')]())){throw new Error(_0x17be('0x11e'));}_0x4decd3=[_0x419fce[_0x17be('0x3a')]['channel']['toLowerCase']()];}if(_0x419fce[_0x17be('0x3a')][_0x17be('0x11f')]){try{var _0x73556e=JSON['parse'](_0x419fce['query'][_0x17be('0x11f')]);if(!moment(_0x73556e[_0x17be('0x46')])['isValid']()){throw new Error(_0x17be('0x120'));}if(!moment(_0x73556e['to'])['isValid']()){throw new Error(_0x17be('0x121'));}}catch(_0x29f2e8){throw new Error('Invalid\x20createdAt\x20filter');}}if(!_0x419fce['query']['hasOwnProperty'](_0x17be('0xe6'))){_0x1d1945[_0x17be('0x21')]=qs[_0x17be('0x21')](_0x419fce['query']['limit']||0xa);_0x1d1945['offset']=qs['offset'](_0x419fce[_0x17be('0x3a')][_0x17be('0x1f')]);}var _0x29f7aa=_0x4decd3[_0x17be('0x57')](function(_0x50547b){if(_0x50547b===_0x17be('0x11a')){var _0x3f9be0={'attributes':['id',_0x17be('0x122'),_0x17be('0x38'),_0x17be('0x123'),_0x17be('0x124'),'callerid',_0x17be('0x125'),_0x17be('0x126'),_0x17be('0x127'),_0x17be('0x128'),'createdAt',_0x17be('0x129'),_0x17be('0x12a'),_0x17be('0x12b'),_0x17be('0x12c')],'where':{'ContactId':_0x419fce[_0x17be('0x94')]['id']},'include':[{'model':db[_0x17be('0x58')],'as':_0x17be('0x58'),'attributes':['id','name',_0x17be('0x12d'),'alias']}],'order':[['createdAt',_0x17be('0x12e')]]};if(_0x419fce[_0x17be('0x3a')]['range']){_0x3f9be0['where'][_0x17be('0x12f')]={'$gte':_0x73556e[_0x17be('0x46')],'$lte':_0x73556e['to']};}return db[_0x17be('0xae')][_0x17be('0x130')](_0x3f9be0)['then'](function(_0x33b3f9){_0x4fd1a3[_0x17be('0x22')]+=_0x33b3f9[_0x17be('0x22')];return _[_0x17be('0x57')](_0x33b3f9[_0x17be('0x92')],function(_0x337a08){var _0x1b9eb1=_0x337a08[_0x17be('0x9c')]({'plain':!![]});_0x1b9eb1['channel']=_0x50547b;if(_0x1b9eb1['User']){_0x1b9eb1[_0x17be('0x58')]={'id':_0x1b9eb1['User']['id'],'name':_0x1b9eb1['User'][_0x17be('0x2d')],'fullname':_0x1b9eb1[_0x17be('0x58')]['fullname'],'alias':_0x1b9eb1[_0x17be('0x58')][_0x17be('0x98')]};}return _0x1b9eb1;});});}else{var _0x3506cd=_[_0x17be('0x131')](_0x50547b)+(_0x50547b==='chat'?_0x17be('0x132'):_0x17be('0x133'));var _0x18b05e={'attributes':['id',_0x17be('0x134'),_0x17be('0x135'),'createdAt',_0x17be('0x128'),_0x17be('0x136'),_0x17be('0x137'),_0x17be('0x138'),_0x17be('0x12c'),_0x3506cd+'Id'],'where':{'ContactId':_0x419fce[_0x17be('0x94')]['id']},'include':[{'model':db[_0x3506cd],'as':_0x17be('0x133'),'attributes':['id',_0x17be('0x2d'),_0x17be('0x139')]},{'model':db['User'],'as':'Owner','attributes':['id',_0x17be('0x2d'),_0x17be('0x12d')]},{'model':db[_0x17be('0x55')],'as':_0x17be('0x91'),'attributes':['id',_0x17be('0x2d'),_0x17be('0x45')],'through':{'attributes':[]}}],'order':[[_0x17be('0x12f'),_0x17be('0x12e')]]};if(_0x419fce[_0x17be('0x3a')][_0x17be('0x11f')]){_0x18b05e[_0x17be('0x41')]['createdAt']={'$gte':_0x73556e[_0x17be('0x46')],'$lte':_0x73556e['to']};}switch(_0x50547b){case'chat':_0x18b05e[_0x17be('0x3c')][_0x17be('0x35')]('browserName',_0x17be('0x13a'),'customerPort',_0x17be('0x13b'),_0x17be('0x13c'),_0x17be('0x13d'),_0x17be('0x13e'),_0x17be('0x13f'),_0x17be('0x140'));break;case _0x17be('0x115'):_0x18b05e[_0x17be('0x3c')][_0x17be('0x35')](_0x17be('0x141'),'substatus');break;case _0x17be('0x142'):_0x18b05e[_0x17be('0x3c')][_0x17be('0x35')]('externalUrl',_0x17be('0x143'));break;}return db[_[_0x17be('0x131')](_0x50547b)+_0x17be('0x144')][_0x17be('0x130')](_0x18b05e)[_0x17be('0x29')](function(_0x3b145d){_0x4fd1a3[_0x17be('0x22')]+=_0x3b145d['count'];return _[_0x17be('0x57')](_0x3b145d[_0x17be('0x92')],function(_0x265549){var _0x3af777=_0x265549[_0x17be('0x9c')]({'plain':!![]});_0x3af777[_0x17be('0x145')]=_0x50547b;if(_0x3af777[_0x17be('0x146')]){_0x3af777[_0x17be('0x146')]={'id':_0x3af777['Owner']['id'],'name':_0x3af777['Owner'][_0x17be('0x2d')],'fullname':_0x3af777[_0x17be('0x146')][_0x17be('0x12d')]};}return _0x3af777;});});}});return Promise[_0x17be('0xbd')](_0x29f7aa);})[_0x17be('0x29')](function(_0x1c6eb1){return _(_0x1c6eb1)[_0x17be('0x147')]()['sortBy'](_0x17be('0x12f'))[_0x17be('0x148')]()[_0x17be('0x5b')]();})[_0x17be('0x29')](function(_0x3f1886){_0x4fd1a3[_0x17be('0x92')]=_0x1d1945[_0x17be('0x21')]?_0x3f1886['slice'](_0x1d1945[_0x17be('0x1f')],_0x1d1945['offset']+_0x1d1945[_0x17be('0x21')]):_0x3f1886;return _0x4fd1a3;})[_0x17be('0x29')](respondWithFilteredResult(_0x7d7008,_0x1d1945))[_0x17be('0x93')](handleError(_0x7d7008,null));}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.events.js b/server/api/cmContact/cmContact.events.js index 7d4bcb6..18f5f9f 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 _0x6583=['update','emit','exports','events','CmContact','setMaxListeners','save'];(function(_0x23f02f,_0x56bf52){var _0x1ec655=function(_0x549da3){while(--_0x549da3){_0x23f02f['push'](_0x23f02f['shift']());}};_0x1ec655(++_0x56bf52);}(_0x6583,0x6c));var _0x3658=function(_0x17a0a0,_0x1befaa){_0x17a0a0=_0x17a0a0-0x0;var _0x4da752=_0x6583[_0x17a0a0];return _0x4da752;};'use strict';var EventEmitter=require(_0x3658('0x0'));var CmContact=require('../../mysqldb')['db'][_0x3658('0x1')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x3658('0x2')](0x0);var events={'afterCreate':_0x3658('0x3'),'afterUpdate':_0x3658('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1be83f){return function(_0x4d551e,_0x20be63,_0x5ebd6e){CmContactEvents['emit'](_0x1be83f+':'+_0x4d551e['id'],_0x4d551e);CmContactEvents[_0x3658('0x5')](_0x1be83f,_0x4d551e);_0x5ebd6e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmContact['hook'](e,emitEvent(event));}}module[_0x3658('0x6')]=CmContactEvents; \ No newline at end of file +var _0xcb57=['events','../../mysqldb','setMaxListeners','update','emit','hook','exports'];(function(_0x233506,_0x2f9e0f){var _0x24c3e6=function(_0x12fa20){while(--_0x12fa20){_0x233506['push'](_0x233506['shift']());}};_0x24c3e6(++_0x2f9e0f);}(_0xcb57,0xa1));var _0x7cb5=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0xcb57[_0x1deb03];return _0x189fe7;};'use strict';var EventEmitter=require(_0x7cb5('0x0'));var CmContact=require(_0x7cb5('0x1'))['db']['CmContact'];var CmContactEvents=new EventEmitter();CmContactEvents[_0x7cb5('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7cb5('0x3'),'afterDestroy':'remove'};function emitEvent(_0x33e1e6){return function(_0x1b1ef7,_0x4850d6,_0x3dc74f){CmContactEvents[_0x7cb5('0x4')](_0x33e1e6+':'+_0x1b1ef7['id'],_0x1b1ef7);CmContactEvents[_0x7cb5('0x4')](_0x33e1e6,_0x1b1ef7);_0x3dc74f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmContact[_0x7cb5('0x5')](e,emitEvent(event));}}module[_0x7cb5('0x6')]=CmContactEvents; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.model.js b/server/api/cmContact/cmContact.model.js index 11108fa..456ce50 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 _0x1ec6=['CmContact','cm_contacts','phone','firstName','lastName','mobile','fax','email','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','get','error','cmContact','afterCreate','inspect','CmHopper','isNil','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId','priority','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','callbackUniqueid','catch','findOne','then','\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','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','VoiceQueue','outbound','dialCheckDuplicateType','CmList','Lists','always','onlyIfOpen','findAll','BlackLists','length','CmHopperBlack','cmContact,\x20%s,\x20%s','message','Campaign','List\x20not\x20found','models','destroy','ContactId','VoiceQueueId','CampaignId','push','all','info','[CmContact][afterDestroy][Succesfull]','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./cmContact.attributes','exports','define'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x1ec6,0x158));var _0x61ec=function(_0xd45112,_0x68c8b4){_0xd45112=_0xd45112-0x0;var _0x2cddb8=_0x1ec6[_0xd45112];return _0x2cddb8;};'use strict';var _=require(_0x61ec('0x0'));var util=require(_0x61ec('0x1'));var logger=require(_0x61ec('0x2'))(_0x61ec('0x3'));var moment=require('moment');var BPromise=require(_0x61ec('0x4'));var rp=require(_0x61ec('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x61ec('0x6'));var config=require(_0x61ec('0x7'));var attributes=require(_0x61ec('0x8'));module[_0x61ec('0x9')]=function(_0x2bd635,_0x17c12d){return _0x2bd635[_0x61ec('0xa')](_0x61ec('0xb'),attributes,{'tableName':_0x61ec('0xc'),'paranoid':!![],'indexes':[{'name':_0x61ec('0xd'),'fields':['phone']},{'name':'fti_cm_contacts','fields':[_0x61ec('0xe'),_0x61ec('0xf'),_0x61ec('0xd'),_0x61ec('0x10'),_0x61ec('0x11'),_0x61ec('0x12')],'type':_0x61ec('0x13')}],'timestamps':!![],'charset':_0x61ec('0x14'),'collate':_0x61ec('0x15'),'hooks':{'afterCreate':function(_0x1833b7,_0x513329,_0x5a293e){var _0x401c83=_0x2bd635['models'];var _0x48d684=_0x1833b7[_0x61ec('0x16')]({'plain':!![]});function _0x5012dc(){return function(_0x5912ef){logger[_0x61ec('0x17')](_0x61ec('0x18'),_0x61ec('0x19'),util[_0x61ec('0x1a')](_0x5912ef,{'showHidden':![],'depth':null}));};}var _0x48c6d0=function(_0x5db7be){return new BPromise(function(_0xaa68e6,_0x11e521){_0x401c83[_0x61ec('0x1b')]['findOne']({'where':{'phone':_0x48d684[_0x61ec('0xd')],'VoiceQueueId':_0x5db7be['id']}})['then'](function(_0x5ad163){if(!_[_0x61ec('0x1c')](_0x5ad163)){throw new Error(_0x61ec('0x1d')+_0x48d684[_0x61ec('0xd')]+_0x61ec('0x1e')+_0x5db7be['id']);}return _0x401c83[_0x61ec('0x1b')][_0x61ec('0x1f')]({'phone':_0x48d684[_0x61ec('0xd')],'ContactId':_0x48d684['id'],'ListId':_0x48d684[_0x61ec('0x20')],'priority':_0x48d684[_0x61ec('0x21')]?_0x48d684[_0x61ec('0x21')]:0x2,'scheduledat':_0x48d684[_0x61ec('0x22')]?_0x48d684[_0x61ec('0x22')]:moment()[_0x61ec('0x23')](_0x61ec('0x24')),'callback':_0x48d684[_0x61ec('0x25')]?!![]:![],'callbackuniqueid':_0x48d684[_0x61ec('0x25')]?_0x48d684[_0x61ec('0x25')]:undefined,'callbackat':_0x48d684['callbackUniqueid']?moment()['format'](_0x61ec('0x24')):undefined,'VoiceQueueId':_0x5db7be['id']});})[_0x61ec('0x26')](function(_0x214d70){_0x11e521(_0x214d70);});});};var _0x184f5a=function(_0x2b476e){return new BPromise(function(_0x4c8432,_0xd67819){_0x401c83['CmHopper'][_0x61ec('0x27')]({'where':{'phone':_0x48d684['phone'],'VoiceQueueId':_0x2b476e['id']}})[_0x61ec('0x28')](function(_0x221ce4){if(!_[_0x61ec('0x1c')](_0x221ce4)){throw new Error(_0x61ec('0x1d')+_0x48d684[_0x61ec('0xd')]+_0x61ec('0x29')+_0x2b476e['id']);}return _0x401c83[_0x61ec('0x2a')][_0x61ec('0x27')]({'where':{'calleridnum':_0x48d684[_0x61ec('0xd')],'VoiceQueueId':_0x2b476e['id']}});})[_0x61ec('0x28')](function(_0x575f98){if(!_[_0x61ec('0x1c')](_0x575f98)){throw new Error(_0x61ec('0x2b')+_0x48d684[_0x61ec('0xd')]+_0x61ec('0x2c')+_0x2b476e['id']);}return _0x401c83['CmHopper'][_0x61ec('0x1f')]({'phone':_0x48d684[_0x61ec('0xd')],'ContactId':_0x48d684['id'],'ListId':_0x48d684[_0x61ec('0x20')],'priority':_0x48d684[_0x61ec('0x21')]?_0x48d684[_0x61ec('0x21')]:0x2,'scheduledat':_0x48d684[_0x61ec('0x22')]?_0x48d684[_0x61ec('0x22')]:moment()[_0x61ec('0x23')](_0x61ec('0x24')),'callback':_0x48d684['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x48d684[_0x61ec('0x25')]?_0x48d684[_0x61ec('0x25')]:undefined,'callbackat':_0x48d684[_0x61ec('0x25')]?moment()['format'](_0x61ec('0x24')):undefined,'VoiceQueueId':_0x2b476e['id']});})[_0x61ec('0x26')](function(_0x5478ea){_0xd67819(_0x5478ea);});});};function _0x4d1529(){return function(_0x3b1c6d){logger['error'](_0x61ec('0x18'),_0x61ec('0x19'),util[_0x61ec('0x1a')](_0x3b1c6d,{'showHidden':![],'depth':null}));};}var _0x3afac3=function(_0xa3c575){return new BPromise(function(_0x46e3a8,_0x9a61f9){_0x401c83['CmHopper'][_0x61ec('0x27')]({'where':{'phone':_0x48d684[_0x61ec('0xd')],'CampaignId':_0xa3c575['id']}})['then'](function(_0x20abc7){if(!_['isNil'](_0x20abc7)){throw new Error(_0x61ec('0x1d')+_0x48d684[_0x61ec('0xd')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0xa3c575['id']);}return _0x401c83[_0x61ec('0x1b')][_0x61ec('0x1f')]({'phone':_0x48d684[_0x61ec('0xd')],'ContactId':_0x48d684['id'],'ListId':_0x48d684[_0x61ec('0x20')],'priority':_0x48d684[_0x61ec('0x21')]?_0x48d684['priority']:0x2,'scheduledat':_0x48d684[_0x61ec('0x22')]?_0x48d684[_0x61ec('0x22')]:moment()['format'](_0x61ec('0x24')),'callback':_0x48d684['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x48d684[_0x61ec('0x25')]?_0x48d684[_0x61ec('0x25')]:undefined,'callbackat':_0x48d684['callbackUniqueid']?moment()[_0x61ec('0x23')](_0x61ec('0x24')):undefined,'CampaignId':_0xa3c575['id']});})[_0x61ec('0x26')](function(_0x2fcc7c){_0x9a61f9(_0x2fcc7c);});});};var _0x3adc74=function(_0x45a941){return new BPromise(function(_0x96f82b,_0x454b8e){_0x401c83[_0x61ec('0x1b')][_0x61ec('0x27')]({'where':{'phone':_0x48d684['phone'],'CampaignId':_0x45a941['id']}})['then'](function(_0x3c859f){if(!_[_0x61ec('0x1c')](_0x3c859f)){throw new Error('cmContact,\x20afterCreate\x20'+_0x48d684['phone']+_0x61ec('0x2d')+_0x45a941['id']);}return _0x401c83[_0x61ec('0x2a')][_0x61ec('0x27')]({'where':{'calleridnum':_0x48d684[_0x61ec('0xd')],'CampaignId':_0x45a941['id']}});})[_0x61ec('0x28')](function(_0x5ad1ec){if(!_[_0x61ec('0x1c')](_0x5ad1ec)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x48d684['phone']+_0x61ec('0x2e')+_0x45a941['id']);}return _0x401c83['CmHopper']['create']({'phone':_0x48d684[_0x61ec('0xd')],'ContactId':_0x48d684['id'],'ListId':_0x48d684[_0x61ec('0x20')],'priority':_0x48d684[_0x61ec('0x21')]?_0x48d684[_0x61ec('0x21')]:0x2,'scheduledat':_0x48d684['scheduledat']?_0x48d684[_0x61ec('0x22')]:moment()['format'](_0x61ec('0x24')),'callback':_0x48d684[_0x61ec('0x25')]?!![]:![],'callbackuniqueid':_0x48d684['callbackUniqueid']?_0x48d684['callbackUniqueid']:undefined,'callbackat':_0x48d684[_0x61ec('0x25')]?moment()[_0x61ec('0x23')](_0x61ec('0x24')):undefined,'CampaignId':_0x45a941['id']});})[_0x61ec('0x26')](function(_0x2b19b7){_0x454b8e(_0x2b19b7);});});};if(_0x48d684[_0x61ec('0x20')]){_0x401c83[_0x61ec('0x2f')]['findAll']({'where':{'type':_0x61ec('0x30')},'attributes':['id',_0x61ec('0x31')],'include':[{'model':_0x401c83[_0x61ec('0x32')],'as':_0x61ec('0x33'),'where':{'id':_0x48d684['ListId']}}]})[_0x61ec('0x28')](function(_0x34d047){if(_0x34d047){var _0x10f64a=[];for(var _0xb8776a=0x0,_0x131759;_0xb8776a<_0x34d047['length'];_0xb8776a+=0x1){_0x131759=_0x34d047[_0xb8776a][_0x61ec('0x16')]({'plain':!![]});switch(_0x131759['dialCheckDuplicateType']){case _0x61ec('0x34'):_0x184f5a(_0x131759)[_0x61ec('0x26')](_0x5012dc());break;case _0x61ec('0x35'):_0x48c6d0(_0x131759)[_0x61ec('0x26')](_0x5012dc());break;default:_0x401c83[_0x61ec('0x1b')]['create']({'phone':_0x48d684[_0x61ec('0xd')],'ContactId':_0x48d684['id'],'ListId':_0x48d684[_0x61ec('0x20')],'scheduledat':_0x48d684[_0x61ec('0x22')]?_0x48d684[_0x61ec('0x22')]:moment()[_0x61ec('0x23')](_0x61ec('0x24')),'priority':_0x48d684[_0x61ec('0x21')]?_0x48d684[_0x61ec('0x21')]:0x2,'callback':_0x48d684['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x48d684['callbackUniqueid']?_0x48d684[_0x61ec('0x25')]:undefined,'callbackat':_0x48d684[_0x61ec('0x25')]?moment()['format'](_0x61ec('0x24')):undefined,'VoiceQueueId':_0x131759['id']})[_0x61ec('0x26')](_0x5012dc());}}}})['then'](function(){return _0x401c83[_0x61ec('0x2f')][_0x61ec('0x36')]({'where':{'type':_0x61ec('0x30')},'attributes':['id'],'include':[{'model':_0x401c83[_0x61ec('0x32')],'as':_0x61ec('0x37'),'where':{'id':_0x48d684[_0x61ec('0x20')]}}]})[_0x61ec('0x28')](function(_0x32dc76){if(_0x32dc76){var _0x5e7a99=[];for(var _0x9b2a9d=0x0,_0x5770a8;_0x9b2a9d<_0x32dc76[_0x61ec('0x38')];_0x9b2a9d+=0x1){_0x5770a8=_0x32dc76[_0x9b2a9d]['get']({'plain':!![]});_0x401c83[_0x61ec('0x39')]['create']({'phone':_0x48d684[_0x61ec('0xd')],'ContactId':_0x48d684['id'],'ListId':_0x48d684[_0x61ec('0x20')],'VoiceQueueId':_0x5770a8['id']})[_0x61ec('0x26')](function(_0x4010fd){logger[_0x61ec('0x17')](_0x61ec('0x3a'),'afterCreate',_0x4010fd[_0x61ec('0x3b')]);});}}});})[_0x61ec('0x28')](function(){return _0x401c83[_0x61ec('0x3c')][_0x61ec('0x36')]({'attributes':['id',_0x61ec('0x31')],'include':[{'model':_0x401c83[_0x61ec('0x32')],'as':_0x61ec('0x33'),'where':{'id':_0x48d684['ListId']}}]})[_0x61ec('0x28')](function(_0x441661){if(_0x441661){var _0x55c116=[];for(var _0x13c6f2=0x0,_0x24c42c;_0x13c6f2<_0x441661[_0x61ec('0x38')];_0x13c6f2+=0x1){_0x24c42c=_0x441661[_0x13c6f2]['get']({'plain':!![]});switch(_0x24c42c[_0x61ec('0x31')]){case _0x61ec('0x34'):_0x3adc74(_0x24c42c)[_0x61ec('0x26')](_0x4d1529());break;case _0x61ec('0x35'):_0x3afac3(_0x24c42c)['catch'](_0x4d1529());break;default:_0x401c83['CmHopper']['create']({'phone':_0x48d684[_0x61ec('0xd')],'ContactId':_0x48d684['id'],'ListId':_0x48d684[_0x61ec('0x20')],'scheduledat':_0x48d684[_0x61ec('0x22')]?_0x48d684['scheduledat']:moment()[_0x61ec('0x23')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x48d684[_0x61ec('0x21')]?_0x48d684[_0x61ec('0x21')]:0x2,'callback':_0x48d684[_0x61ec('0x25')]?!![]:![],'callbackuniqueid':_0x48d684[_0x61ec('0x25')]?_0x48d684[_0x61ec('0x25')]:undefined,'callbackat':_0x48d684['callbackUniqueid']?moment()[_0x61ec('0x23')](_0x61ec('0x24')):undefined,'CampaignId':_0x24c42c['id']})[_0x61ec('0x26')](_0x4d1529());}}}});})['then'](function(){return _0x401c83[_0x61ec('0x3c')][_0x61ec('0x36')]({'attributes':['id'],'include':[{'model':_0x401c83[_0x61ec('0x32')],'as':_0x61ec('0x37'),'where':{'id':_0x48d684[_0x61ec('0x20')]}}]})[_0x61ec('0x28')](function(_0x1af46b){if(_0x1af46b){var _0x30c423=[];for(var _0x1b8930=0x0,_0x134e7d;_0x1b8930<_0x1af46b['length'];_0x1b8930+=0x1){_0x134e7d=_0x1af46b[_0x1b8930]['get']({'plain':!![]});_0x401c83['CmHopperBlack'][_0x61ec('0x1f')]({'phone':_0x48d684[_0x61ec('0xd')],'ContactId':_0x48d684['id'],'ListId':_0x48d684[_0x61ec('0x20')],'CampaignId':_0x134e7d['id']})['catch'](function(_0x1c448d){logger[_0x61ec('0x17')](_0x61ec('0x3a'),_0x61ec('0x19'),_0x1c448d[_0x61ec('0x3b')]);});}}});})['then'](function(){_0x5a293e();})[_0x61ec('0x26')](function(_0x47dd2c){logger[_0x61ec('0x17')](_0x61ec('0x3a'),_0x61ec('0x19'),_0x47dd2c[_0x61ec('0x3b')]);_0x5a293e(_0x47dd2c);});}else{_0x5a293e(new Error(_0x61ec('0x3d')));}},'afterDestroy':function(_0x571609,_0xc7f9c6,_0x2b5e98){var _0x59ed45=_0x2bd635[_0x61ec('0x3e')];var _0x8adaa6=_0x571609[_0x61ec('0x16')]({'plain':!![]});return _0x59ed45['CmHopper'][_0x61ec('0x36')]({'raw':!![],'where':{'ListId':_0x8adaa6['ListId'],'ContactId':_0x8adaa6['id']}})['then'](function(_0x25e2e2){if(!_['isEmpty'](_0x25e2e2)){var _0x47ca33=[];for(var _0x9f24e9=0x0;_0x9f24e9<_0x25e2e2[_0x61ec('0x38')];_0x9f24e9+=0x1){var _0x345581=_0x59ed45[_0x61ec('0x1b')][_0x61ec('0x3f')]({'where':{'ListId':_0x25e2e2[_0x9f24e9][_0x61ec('0x20')],'ContactId':_0x25e2e2[_0x9f24e9][_0x61ec('0x40')],'VoiceQueueId':_0x25e2e2[_0x9f24e9][_0x61ec('0x41')],'CampaignId':_0x25e2e2[_0x9f24e9][_0x61ec('0x42')]}});_0x47ca33[_0x61ec('0x43')](_0x345581);}return BPromise[_0x61ec('0x44')](_0x47ca33);}})[_0x61ec('0x28')](function(_0x434746){logger[_0x61ec('0x45')](_0x61ec('0x46'),util['inspect'](_0x434746,{'showHidden':![],'depth':null}));_0x2b5e98();})['catch'](function(_0x5ae1b4){logger[_0x61ec('0x17')]('[CmContact][afterDestroy][Error]',util[_0x61ec('0x1a')](_0x5ae1b4,{'showHidden':![],'depth':null}));_0x2b5e98(_0x5ae1b4);});}}});}; \ No newline at end of file +var _0x60c7=['outbound','CmHopperBlack','cmContact,\x20%s,\x20%s','message','Campaign','List\x20not\x20found','models','destroy','ContactId','VoiceQueueId','CampaignId','push','all','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','lodash','util','bluebird','request-promise','path','../../config/environment','./cmContact.attributes','exports','define','cm_contacts','phone','firstName','lastName','mobile','email','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','get','error','afterCreate','inspect','CmHopper','findOne','then','isNil','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','scheduledat','YYYY-MM-DD\x20HH:mm:ss','callbackUniqueid','format','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','ListId','priority','cmContact','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','dialCheckDuplicateType','CmList','length','always','catch','onlyIfOpen'];(function(_0x24a5ba,_0x533aa1){var _0x3c169b=function(_0x37fbbb){while(--_0x37fbbb){_0x24a5ba['push'](_0x24a5ba['shift']());}};_0x3c169b(++_0x533aa1);}(_0x60c7,0xd0));var _0x760c=function(_0x3bd1e8,_0x92e927){_0x3bd1e8=_0x3bd1e8-0x0;var _0x5537b8=_0x60c7[_0x3bd1e8];return _0x5537b8;};'use strict';var _=require(_0x760c('0x0'));var util=require(_0x760c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x760c('0x2'));var rp=require(_0x760c('0x3'));var fs=require('fs');var path=require(_0x760c('0x4'));var rimraf=require('rimraf');var config=require(_0x760c('0x5'));var attributes=require(_0x760c('0x6'));module[_0x760c('0x7')]=function(_0x4061e7,_0x2c3255){return _0x4061e7[_0x760c('0x8')]('CmContact',attributes,{'tableName':_0x760c('0x9'),'paranoid':!![],'indexes':[{'name':_0x760c('0xa'),'fields':[_0x760c('0xa')]},{'name':'fti_cm_contacts','fields':[_0x760c('0xb'),_0x760c('0xc'),_0x760c('0xa'),_0x760c('0xd'),'fax',_0x760c('0xe')],'type':_0x760c('0xf')}],'timestamps':!![],'charset':_0x760c('0x10'),'collate':_0x760c('0x11'),'hooks':{'afterCreate':function(_0x5193c2,_0x10657a,_0x310680){var _0x46df27=_0x4061e7['models'];var _0x2855b2=_0x5193c2[_0x760c('0x12')]({'plain':!![]});function _0x2750d1(){return function(_0x33d857){logger[_0x760c('0x13')]('cmContact',_0x760c('0x14'),util[_0x760c('0x15')](_0x33d857,{'showHidden':![],'depth':null}));};}var _0x553e71=function(_0x5a3a26){return new BPromise(function(_0x13f00b,_0x1b362a){_0x46df27[_0x760c('0x16')][_0x760c('0x17')]({'where':{'phone':_0x2855b2[_0x760c('0xa')],'VoiceQueueId':_0x5a3a26['id']}})[_0x760c('0x18')](function(_0x4ee49a){if(!_[_0x760c('0x19')](_0x4ee49a)){throw new Error(_0x760c('0x1a')+_0x2855b2[_0x760c('0xa')]+_0x760c('0x1b')+_0x5a3a26['id']);}return _0x46df27['CmHopper'][_0x760c('0x1c')]({'phone':_0x2855b2[_0x760c('0xa')],'ContactId':_0x2855b2['id'],'ListId':_0x2855b2['ListId'],'priority':_0x2855b2['priority']?_0x2855b2['priority']:0x2,'scheduledat':_0x2855b2[_0x760c('0x1d')]?_0x2855b2[_0x760c('0x1d')]:moment()['format'](_0x760c('0x1e')),'callback':_0x2855b2[_0x760c('0x1f')]?!![]:![],'callbackuniqueid':_0x2855b2[_0x760c('0x1f')]?_0x2855b2[_0x760c('0x1f')]:undefined,'callbackat':_0x2855b2[_0x760c('0x1f')]?moment()[_0x760c('0x20')](_0x760c('0x1e')):undefined,'VoiceQueueId':_0x5a3a26['id']});})['catch'](function(_0x3f7f2f){_0x1b362a(_0x3f7f2f);});});};var _0x52d5b6=function(_0x5777a5){return new BPromise(function(_0x2d64ed,_0x33dbac){_0x46df27[_0x760c('0x16')][_0x760c('0x17')]({'where':{'phone':_0x2855b2[_0x760c('0xa')],'VoiceQueueId':_0x5777a5['id']}})[_0x760c('0x18')](function(_0x2448d5){if(!_[_0x760c('0x19')](_0x2448d5)){throw new Error(_0x760c('0x1a')+_0x2855b2[_0x760c('0xa')]+_0x760c('0x21')+_0x5777a5['id']);}return _0x46df27[_0x760c('0x22')][_0x760c('0x17')]({'where':{'calleridnum':_0x2855b2[_0x760c('0xa')],'VoiceQueueId':_0x5777a5['id']}});})[_0x760c('0x18')](function(_0x242c90){if(!_['isNil'](_0x242c90)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x2855b2[_0x760c('0xa')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20'+_0x5777a5['id']);}return _0x46df27[_0x760c('0x16')][_0x760c('0x1c')]({'phone':_0x2855b2[_0x760c('0xa')],'ContactId':_0x2855b2['id'],'ListId':_0x2855b2[_0x760c('0x23')],'priority':_0x2855b2[_0x760c('0x24')]?_0x2855b2[_0x760c('0x24')]:0x2,'scheduledat':_0x2855b2[_0x760c('0x1d')]?_0x2855b2[_0x760c('0x1d')]:moment()[_0x760c('0x20')](_0x760c('0x1e')),'callback':_0x2855b2[_0x760c('0x1f')]?!![]:![],'callbackuniqueid':_0x2855b2[_0x760c('0x1f')]?_0x2855b2[_0x760c('0x1f')]:undefined,'callbackat':_0x2855b2[_0x760c('0x1f')]?moment()['format'](_0x760c('0x1e')):undefined,'VoiceQueueId':_0x5777a5['id']});})['catch'](function(_0x563bfb){_0x33dbac(_0x563bfb);});});};function _0x452b23(){return function(_0x2bf153){logger[_0x760c('0x13')](_0x760c('0x25'),_0x760c('0x14'),util[_0x760c('0x15')](_0x2bf153,{'showHidden':![],'depth':null}));};}var _0x26334f=function(_0x2f1915){return new BPromise(function(_0x1bbae9,_0x13606a){_0x46df27[_0x760c('0x16')][_0x760c('0x17')]({'where':{'phone':_0x2855b2['phone'],'CampaignId':_0x2f1915['id']}})['then'](function(_0x39b979){if(!_[_0x760c('0x19')](_0x39b979)){throw new Error('cmContact,\x20afterCreate\x20'+_0x2855b2[_0x760c('0xa')]+_0x760c('0x26')+_0x2f1915['id']);}return _0x46df27[_0x760c('0x16')]['create']({'phone':_0x2855b2[_0x760c('0xa')],'ContactId':_0x2855b2['id'],'ListId':_0x2855b2[_0x760c('0x23')],'priority':_0x2855b2[_0x760c('0x24')]?_0x2855b2[_0x760c('0x24')]:0x2,'scheduledat':_0x2855b2[_0x760c('0x1d')]?_0x2855b2[_0x760c('0x1d')]:moment()[_0x760c('0x20')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x2855b2[_0x760c('0x1f')]?!![]:![],'callbackuniqueid':_0x2855b2[_0x760c('0x1f')]?_0x2855b2[_0x760c('0x1f')]:undefined,'callbackat':_0x2855b2['callbackUniqueid']?moment()['format'](_0x760c('0x1e')):undefined,'CampaignId':_0x2f1915['id']});})['catch'](function(_0x26b692){_0x13606a(_0x26b692);});});};var _0x1c8ce5=function(_0x3ffca8){return new BPromise(function(_0x1258dc,_0x58784c){_0x46df27[_0x760c('0x16')][_0x760c('0x17')]({'where':{'phone':_0x2855b2['phone'],'CampaignId':_0x3ffca8['id']}})[_0x760c('0x18')](function(_0x5283c2){if(!_[_0x760c('0x19')](_0x5283c2)){throw new Error(_0x760c('0x1a')+_0x2855b2[_0x760c('0xa')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x3ffca8['id']);}return _0x46df27[_0x760c('0x22')][_0x760c('0x17')]({'where':{'calleridnum':_0x2855b2[_0x760c('0xa')],'CampaignId':_0x3ffca8['id']}});})[_0x760c('0x18')](function(_0x34d968){if(!_[_0x760c('0x19')](_0x34d968)){throw new Error(_0x760c('0x27')+_0x2855b2[_0x760c('0xa')]+_0x760c('0x28')+_0x3ffca8['id']);}return _0x46df27[_0x760c('0x16')][_0x760c('0x1c')]({'phone':_0x2855b2[_0x760c('0xa')],'ContactId':_0x2855b2['id'],'ListId':_0x2855b2['ListId'],'priority':_0x2855b2[_0x760c('0x24')]?_0x2855b2[_0x760c('0x24')]:0x2,'scheduledat':_0x2855b2['scheduledat']?_0x2855b2[_0x760c('0x1d')]:moment()[_0x760c('0x20')](_0x760c('0x1e')),'callback':_0x2855b2[_0x760c('0x1f')]?!![]:![],'callbackuniqueid':_0x2855b2['callbackUniqueid']?_0x2855b2[_0x760c('0x1f')]:undefined,'callbackat':_0x2855b2[_0x760c('0x1f')]?moment()[_0x760c('0x20')](_0x760c('0x1e')):undefined,'CampaignId':_0x3ffca8['id']});})['catch'](function(_0xfb502){_0x58784c(_0xfb502);});});};if(_0x2855b2[_0x760c('0x23')]){_0x46df27['VoiceQueue'][_0x760c('0x29')]({'where':{'type':'outbound'},'attributes':['id',_0x760c('0x2a')],'include':[{'model':_0x46df27[_0x760c('0x2b')],'as':'Lists','where':{'id':_0x2855b2['ListId']}}]})[_0x760c('0x18')](function(_0x37bc1f){if(_0x37bc1f){var _0x311fee=[];for(var _0x47a259=0x0,_0xfd125d;_0x47a259<_0x37bc1f[_0x760c('0x2c')];_0x47a259+=0x1){_0xfd125d=_0x37bc1f[_0x47a259][_0x760c('0x12')]({'plain':!![]});switch(_0xfd125d[_0x760c('0x2a')]){case _0x760c('0x2d'):_0x52d5b6(_0xfd125d)[_0x760c('0x2e')](_0x2750d1());break;case _0x760c('0x2f'):_0x553e71(_0xfd125d)[_0x760c('0x2e')](_0x2750d1());break;default:_0x46df27[_0x760c('0x16')][_0x760c('0x1c')]({'phone':_0x2855b2[_0x760c('0xa')],'ContactId':_0x2855b2['id'],'ListId':_0x2855b2[_0x760c('0x23')],'scheduledat':_0x2855b2[_0x760c('0x1d')]?_0x2855b2['scheduledat']:moment()[_0x760c('0x20')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x2855b2[_0x760c('0x24')]?_0x2855b2['priority']:0x2,'callback':_0x2855b2[_0x760c('0x1f')]?!![]:![],'callbackuniqueid':_0x2855b2[_0x760c('0x1f')]?_0x2855b2['callbackUniqueid']:undefined,'callbackat':_0x2855b2['callbackUniqueid']?moment()['format'](_0x760c('0x1e')):undefined,'VoiceQueueId':_0xfd125d['id']})[_0x760c('0x2e')](_0x2750d1());}}}})[_0x760c('0x18')](function(){return _0x46df27['VoiceQueue']['findAll']({'where':{'type':_0x760c('0x30')},'attributes':['id'],'include':[{'model':_0x46df27[_0x760c('0x2b')],'as':'BlackLists','where':{'id':_0x2855b2[_0x760c('0x23')]}}]})[_0x760c('0x18')](function(_0x2f6e56){if(_0x2f6e56){var _0x3da365=[];for(var _0xc7feef=0x0,_0x113866;_0xc7feef<_0x2f6e56['length'];_0xc7feef+=0x1){_0x113866=_0x2f6e56[_0xc7feef]['get']({'plain':!![]});_0x46df27[_0x760c('0x31')]['create']({'phone':_0x2855b2[_0x760c('0xa')],'ContactId':_0x2855b2['id'],'ListId':_0x2855b2[_0x760c('0x23')],'VoiceQueueId':_0x113866['id']})['catch'](function(_0x2b012b){logger[_0x760c('0x13')](_0x760c('0x32'),_0x760c('0x14'),_0x2b012b[_0x760c('0x33')]);});}}});})[_0x760c('0x18')](function(){return _0x46df27[_0x760c('0x34')]['findAll']({'attributes':['id',_0x760c('0x2a')],'include':[{'model':_0x46df27[_0x760c('0x2b')],'as':'Lists','where':{'id':_0x2855b2['ListId']}}]})['then'](function(_0x43d3a7){if(_0x43d3a7){var _0x22facf=[];for(var _0x213155=0x0,_0x515109;_0x213155<_0x43d3a7[_0x760c('0x2c')];_0x213155+=0x1){_0x515109=_0x43d3a7[_0x213155][_0x760c('0x12')]({'plain':!![]});switch(_0x515109[_0x760c('0x2a')]){case'always':_0x1c8ce5(_0x515109)['catch'](_0x452b23());break;case _0x760c('0x2f'):_0x26334f(_0x515109)['catch'](_0x452b23());break;default:_0x46df27['CmHopper'][_0x760c('0x1c')]({'phone':_0x2855b2[_0x760c('0xa')],'ContactId':_0x2855b2['id'],'ListId':_0x2855b2[_0x760c('0x23')],'scheduledat':_0x2855b2[_0x760c('0x1d')]?_0x2855b2[_0x760c('0x1d')]:moment()[_0x760c('0x20')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x2855b2[_0x760c('0x24')]?_0x2855b2['priority']:0x2,'callback':_0x2855b2[_0x760c('0x1f')]?!![]:![],'callbackuniqueid':_0x2855b2[_0x760c('0x1f')]?_0x2855b2[_0x760c('0x1f')]:undefined,'callbackat':_0x2855b2[_0x760c('0x1f')]?moment()[_0x760c('0x20')](_0x760c('0x1e')):undefined,'CampaignId':_0x515109['id']})[_0x760c('0x2e')](_0x452b23());}}}});})['then'](function(){return _0x46df27[_0x760c('0x34')][_0x760c('0x29')]({'attributes':['id'],'include':[{'model':_0x46df27[_0x760c('0x2b')],'as':'BlackLists','where':{'id':_0x2855b2['ListId']}}]})[_0x760c('0x18')](function(_0x358126){if(_0x358126){var _0x4af7b1=[];for(var _0x28efba=0x0,_0x329e82;_0x28efba<_0x358126[_0x760c('0x2c')];_0x28efba+=0x1){_0x329e82=_0x358126[_0x28efba][_0x760c('0x12')]({'plain':!![]});_0x46df27[_0x760c('0x31')][_0x760c('0x1c')]({'phone':_0x2855b2['phone'],'ContactId':_0x2855b2['id'],'ListId':_0x2855b2[_0x760c('0x23')],'CampaignId':_0x329e82['id']})[_0x760c('0x2e')](function(_0x39e565){logger[_0x760c('0x13')](_0x760c('0x32'),_0x760c('0x14'),_0x39e565[_0x760c('0x33')]);});}}});})[_0x760c('0x18')](function(){_0x310680();})[_0x760c('0x2e')](function(_0x120046){logger[_0x760c('0x13')]('cmContact,\x20%s,\x20%s',_0x760c('0x14'),_0x120046[_0x760c('0x33')]);_0x310680(_0x120046);});}else{_0x310680(new Error(_0x760c('0x35')));}},'afterDestroy':function(_0x3c626f,_0x1c2eaa,_0x18a1eb){var _0x528c12=_0x4061e7[_0x760c('0x36')];var _0x5369af=_0x3c626f[_0x760c('0x12')]({'plain':!![]});return _0x528c12[_0x760c('0x16')][_0x760c('0x29')]({'raw':!![],'where':{'ListId':_0x5369af[_0x760c('0x23')],'ContactId':_0x5369af['id']}})['then'](function(_0x37fbeb){if(!_['isEmpty'](_0x37fbeb)){var _0x58679c=[];for(var _0x39bff7=0x0;_0x39bff7<_0x37fbeb[_0x760c('0x2c')];_0x39bff7+=0x1){var _0x4e448d=_0x528c12[_0x760c('0x16')][_0x760c('0x37')]({'where':{'ListId':_0x37fbeb[_0x39bff7]['ListId'],'ContactId':_0x37fbeb[_0x39bff7][_0x760c('0x38')],'VoiceQueueId':_0x37fbeb[_0x39bff7][_0x760c('0x39')],'CampaignId':_0x37fbeb[_0x39bff7][_0x760c('0x3a')]}});_0x58679c[_0x760c('0x3b')](_0x4e448d);}return BPromise[_0x760c('0x3c')](_0x58679c);}})['then'](function(_0x265272){logger[_0x760c('0x3d')](_0x760c('0x3e'),util[_0x760c('0x15')](_0x265272,{'showHidden':![],'depth':null}));_0x18a1eb();})[_0x760c('0x2e')](function(_0x16fdaf){logger[_0x760c('0x13')](_0x760c('0x3f'),util[_0x760c('0x15')](_0x16fdaf,{'showHidden':![],'depth':null}));_0x18a1eb(_0x16fdaf);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index 99df198..b81763f 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 _0x967b=['lodash','util','moment','bluebird','randomstring','ioredis','squel','../../mysqldb','../../config/logger','client','http','defaults','localhost','redis','register','then','info','debug','CmContact,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','CmContact,\x20%s,\x20%s','message','catch','GetCmContact','options','raw','where','attributes','limit','map','model','include','CreateCmContact','CmContact','body','keys','length','startsWith','update','cm_contacts','set','toString','sequelize','query'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x967b,0x170));var _0xb967=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x967b[_0x2dadb9];return _0x2f0097;};'use strict';var _=require(_0xb967('0x0'));var util=require(_0xb967('0x1'));var moment=require(_0xb967('0x2'));var BPromise=require(_0xb967('0x3'));var rs=require(_0xb967('0x4'));var fs=require('fs');var Redis=require(_0xb967('0x5'));var squel=require(_0xb967('0x6'));var db=require(_0xb967('0x7'))['db'];var utils=require('../../config/utils');var logger=require(_0xb967('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb967('0x9')][_0xb967('0xa')]({'port':0x232a});config['redis']=_[_0xb967('0xb')](config['redis'],{'host':_0xb967('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb967('0xd')]));require('./cmContact.socket')[_0xb967('0xe')](socket);function respondWithRpcPromise(_0x8a0dd2,_0x4aa4af,_0x36cb48){return new BPromise(function(_0x293fc0,_0x378f59){return client['request'](_0x8a0dd2,_0x36cb48)[_0xb967('0xf')](function(_0x131365){logger[_0xb967('0x10')]('CmContact,\x20%s,\x20%s',_0x4aa4af,'request\x20sent');logger[_0xb967('0x11')](_0xb967('0x12'),_0x4aa4af,_0xb967('0x13'),JSON[_0xb967('0x14')](_0x131365));if(_0x131365[_0xb967('0x15')]){if(_0x131365['error']['code']===0x1f4){logger[_0xb967('0x15')](_0xb967('0x16'),_0x4aa4af,_0x131365[_0xb967('0x15')]['message']);return _0x378f59(_0x131365[_0xb967('0x15')][_0xb967('0x17')]);}logger[_0xb967('0x15')]('CmContact,\x20%s,\x20%s',_0x4aa4af,_0x131365[_0xb967('0x15')][_0xb967('0x17')]);return _0x293fc0(_0x131365['error'][_0xb967('0x17')]);}else{logger[_0xb967('0x10')](_0xb967('0x16'),_0x4aa4af,'request\x20sent');_0x293fc0(_0x131365['result'][_0xb967('0x17')]);}})[_0xb967('0x18')](function(_0x4374ca){logger[_0xb967('0x15')](_0xb967('0x16'),_0x4aa4af,_0x4374ca);_0x378f59(_0x4374ca);});});}exports[_0xb967('0x19')]=function(_0x33f7d9){var _0x11cc6c=this;return new Promise(function(_0x3d0f21,_0x4b4bd2){return db['CmContact']['findAll']({'raw':_0x33f7d9['options']?_0x33f7d9[_0xb967('0x1a')][_0xb967('0x1b')]===undefined?!![]:![]:!![],'where':_0x33f7d9['options']?_0x33f7d9[_0xb967('0x1a')][_0xb967('0x1c')]||null:null,'attributes':_0x33f7d9[_0xb967('0x1a')]?_0x33f7d9[_0xb967('0x1a')][_0xb967('0x1d')]||null:null,'limit':_0x33f7d9[_0xb967('0x1a')]?_0x33f7d9[_0xb967('0x1a')][_0xb967('0x1e')]||null:null,'include':_0x33f7d9[_0xb967('0x1a')]?_0x33f7d9[_0xb967('0x1a')]['include']?_[_0xb967('0x1f')](_0x33f7d9[_0xb967('0x1a')]['include'],function(_0x333f3a){return{'model':db[_0x333f3a[_0xb967('0x20')]],'as':_0x333f3a['as'],'attributes':_0x333f3a[_0xb967('0x1d')],'include':_0x333f3a[_0xb967('0x21')]?_[_0xb967('0x1f')](_0x333f3a[_0xb967('0x21')],function(_0x574591){return{'model':db[_0x574591[_0xb967('0x20')]],'as':_0x574591['as'],'attributes':_0x574591[_0xb967('0x1d')],'include':_0x574591[_0xb967('0x21')]?_['map'](_0x574591[_0xb967('0x21')],function(_0x4b718b){return{'model':db[_0x4b718b[_0xb967('0x20')]],'as':_0x4b718b['as'],'attributes':_0x4b718b[_0xb967('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xb967('0xf')](function(_0x3544d4){logger[_0xb967('0x10')]('GetCmContact',_0x33f7d9);logger[_0xb967('0x11')]('GetCmContact',_0x33f7d9,JSON[_0xb967('0x14')](_0x3544d4));_0x3d0f21(_0x3544d4);})[_0xb967('0x18')](function(_0x1b626b){logger[_0xb967('0x15')](_0xb967('0x19'),_0x1b626b[_0xb967('0x17')],_0x33f7d9);_0x4b4bd2(_0x11cc6c[_0xb967('0x15')](0x1f4,_0x1b626b[_0xb967('0x17')]));});});};exports[_0xb967('0x22')]=function(_0x2f44e4){var _0x29f7eb=this;return new Promise(function(_0x1ee503,_0x31834b){return db[_0xb967('0x23')]['create'](_0x2f44e4[_0xb967('0x24')],{'raw':_0x2f44e4[_0xb967('0x1a')]?_0x2f44e4[_0xb967('0x1a')][_0xb967('0x1b')]===undefined?!![]:![]:!![]})[_0xb967('0xf')](function(_0x5b83fa){var _0x251daa;for(var _0x33ae75=0x0;_0x33ae75{}\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(_0x10018b,_0x2d5091){var _0x5ec192=function(_0x4a9036){while(--_0x4a9036){_0x10018b['push'](_0x10018b['shift']());}};_0x5ec192(++_0x2d5091);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'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 3b8b24c..3674a3a 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 _0xb201=['PHONE','sequelize','INTEGER','STRING'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xb201,0x1b1));var _0x1b20=function(_0x2d5f8a,_0x3d7dbe){_0x2d5f8a=_0x2d5f8a-0x0;var _0x20d836=_0xb201[_0x2d5f8a];return _0x20d836;};'use strict';var Sequelize=require(_0x1b20('0x0'));module['exports']={'CmContactId':{'type':Sequelize[_0x1b20('0x1')],'primaryKey':!![]},'item':{'type':Sequelize[_0x1b20('0x2')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x1b20('0x1')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x1b20('0x2')],'defaultValue':_0x1b20('0x3')},'OrderBy':{'type':Sequelize[_0x1b20('0x1')],'defaultValue':null},'description':{'type':Sequelize['STRING'],'defaultValue':null}}; \ No newline at end of file +var _0xbb53=['exports','INTEGER','STRING','PHONE','sequelize'];(function(_0x4decc6,_0x192282){var _0x94634=function(_0x1056ec){while(--_0x1056ec){_0x4decc6['push'](_0x4decc6['shift']());}};_0x94634(++_0x192282);}(_0xbb53,0x121));var _0x3bb5=function(_0x1cbb6a,_0xe9748a){_0x1cbb6a=_0x1cbb6a-0x0;var _0x359725=_0xbb53[_0x1cbb6a];return _0x359725;};'use strict';var Sequelize=require(_0x3bb5('0x0'));module[_0x3bb5('0x1')]={'CmContactId':{'type':Sequelize[_0x3bb5('0x2')],'primaryKey':!![]},'item':{'type':Sequelize[_0x3bb5('0x3')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x3bb5('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x3bb5('0x3')],'defaultValue':_0x3bb5('0x4')},'OrderBy':{'type':Sequelize[_0x3bb5('0x2')],'defaultValue':null},'description':{'type':Sequelize[_0x3bb5('0x3')],'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 01093b9..eeb6c72 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 _0x812c=['rawAttributes','fieldName','type','key','model','keys','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','include','findAll','catch','show','params','intersection','includeAll','create','body','user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','offset','undefined','limit','count','json','apply','save','then','get','UserProfileResource','destroy','sendStatus','stack','name','send','map','CmContactHasItem'];(function(_0x5c6121,_0x40f733){var _0x216aea=function(_0x2723ad){while(--_0x2723ad){_0x5c6121['push'](_0x5c6121['shift']());}};_0x216aea(++_0x40f733);}(_0x812c,0x78));var _0xc812=function(_0x4789cd,_0x1d18d6){_0x4789cd=_0x4789cd-0x0;var _0x39f810=_0x812c[_0x4789cd];return _0x39f810;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc812('0x0'));var zipdir=require(_0xc812('0x1'));var jsonpatch=require(_0xc812('0x2'));var rp=require(_0xc812('0x3'));var moment=require(_0xc812('0x4'));var BPromise=require(_0xc812('0x5'));var Mustache=require(_0xc812('0x6'));var util=require(_0xc812('0x7'));var path=require(_0xc812('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc812('0x9'));var fs=require('fs');var fs_extra=require(_0xc812('0xa'));var _=require(_0xc812('0xb'));var squel=require(_0xc812('0xc'));var crypto=require(_0xc812('0xd'));var jsforce=require(_0xc812('0xe'));var deskjs=require(_0xc812('0xf'));var toCsv=require(_0xc812('0x10'));var querystring=require(_0xc812('0x11'));var Papa=require(_0xc812('0x12'));var Redis=require(_0xc812('0x13'));var authService=require(_0xc812('0x14'));var qs=require(_0xc812('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc812('0x16'));var logger=require(_0xc812('0x17'))(_0xc812('0x18'));var utils=require(_0xc812('0x19'));var config=require(_0xc812('0x1a'));var licenseUtil=require(_0xc812('0x1b'));var db=require(_0xc812('0x1c'))['db'];function respondWithStatusCode(_0x283fa5,_0x5d40e7){_0x5d40e7=_0x5d40e7||0xcc;return function(_0x289009){if(_0x289009){return _0x283fa5['sendStatus'](_0x5d40e7);}return _0x283fa5['status'](_0x5d40e7)[_0xc812('0x1d')]();};}function respondWithResult(_0x5e2f3a,_0x22c5e3){_0x22c5e3=_0x22c5e3||0xc8;return function(_0x388125){if(_0x388125){return _0x5e2f3a[_0xc812('0x1e')](_0x22c5e3)['json'](_0x388125);}};}function respondWithFilteredResult(_0x4448ac,_0x8a838d){return function(_0x3f197d){if(_0x3f197d){var _0x48af9e=typeof _0x8a838d[_0xc812('0x1f')]===_0xc812('0x20')&&typeof _0x8a838d[_0xc812('0x21')]==='undefined';var _0x5dc52b=_0x3f197d[_0xc812('0x22')];var _0x5b08a3=_0x48af9e?0x0:_0x8a838d[_0xc812('0x1f')];var _0x5507f4=_0x48af9e?_0x3f197d[_0xc812('0x22')]:_0x8a838d['offset']+_0x8a838d[_0xc812('0x21')];var _0x57737b;if(_0x5507f4>=_0x5dc52b){_0x5507f4=_0x5dc52b;_0x57737b=0xc8;}else{_0x57737b=0xce;}_0x4448ac[_0xc812('0x1e')](_0x57737b);return _0x4448ac['set']('Content-Range',_0x5b08a3+'-'+_0x5507f4+'/'+_0x5dc52b)[_0xc812('0x23')](_0x3f197d);}return null;};}function patchUpdates(_0x5ab0f3){return function(_0x2fd220){try{jsonpatch[_0xc812('0x24')](_0x2fd220,_0x5ab0f3,!![]);}catch(_0x5795ad){return BPromise['reject'](_0x5795ad);}return _0x2fd220[_0xc812('0x25')]();};}function saveUpdates(_0x3cf61a,_0xbe1181){return function(_0x5a4e76){if(_0x5a4e76){return _0x5a4e76['update'](_0x3cf61a)['then'](function(_0x395dc5){return _0x395dc5;});}return null;};}function removeEntity(_0x415b2d,_0x17912e){return function(_0x1a49f4){if(_0x1a49f4){return _0x1a49f4['destroy']()[_0xc812('0x26')](function(){var _0x11cd13=_0x1a49f4[_0xc812('0x27')]({'plain':!![]});var _0x4d716b='CmContactHasItems';return db[_0xc812('0x28')][_0xc812('0x29')]({'where':{'type':_0x4d716b,'resourceId':_0x11cd13['id']}})[_0xc812('0x26')](function(){return _0x1a49f4;});})['then'](function(){_0x415b2d[_0xc812('0x1e')](0xcc)[_0xc812('0x1d')]();});}};}function handleEntityNotFound(_0x5c9bee,_0x193e08){return function(_0x1adc42){if(!_0x1adc42){_0x5c9bee[_0xc812('0x2a')](0x194);}return _0x1adc42;};}function handleError(_0x5c40c1,_0x407926){_0x407926=_0x407926||0x1f4;return function(_0x2f37f1){logger['error'](_0x2f37f1[_0xc812('0x2b')]);if(_0x2f37f1[_0xc812('0x2c')]){delete _0x2f37f1['name'];}_0x5c40c1['status'](_0x407926)[_0xc812('0x2d')](_0x2f37f1);};}exports['index']=function(_0x4e4616,_0x59f5f8){var _0x3d98ef={},_0x44dea3={},_0x554a5a={'count':0x0,'rows':[]};var _0x4fdeb6=_[_0xc812('0x2e')](db[_0xc812('0x2f')][_0xc812('0x30')],function(_0x37f6e7){return{'name':_0x37f6e7[_0xc812('0x31')],'type':_0x37f6e7[_0xc812('0x32')][_0xc812('0x33')]};});_0x44dea3[_0xc812('0x34')]=_[_0xc812('0x2e')](_0x4fdeb6,_0xc812('0x2c'));_0x44dea3['query']=_[_0xc812('0x35')](_0x4e4616['query']);_0x44dea3['filters']=_['intersection'](_0x44dea3[_0xc812('0x34')],_0x44dea3[_0xc812('0x36')]);_0x3d98ef[_0xc812('0x37')]=_['intersection'](_0x44dea3[_0xc812('0x34')],qs['fields'](_0x4e4616[_0xc812('0x36')][_0xc812('0x38')]));_0x3d98ef[_0xc812('0x37')]=_0x3d98ef[_0xc812('0x37')][_0xc812('0x39')]?_0x3d98ef[_0xc812('0x37')]:_0x44dea3[_0xc812('0x34')];if(!_0x4e4616[_0xc812('0x36')][_0xc812('0x3a')](_0xc812('0x3b'))){_0x3d98ef[_0xc812('0x21')]=qs[_0xc812('0x21')](_0x4e4616[_0xc812('0x36')][_0xc812('0x21')]);_0x3d98ef['offset']=qs[_0xc812('0x1f')](_0x4e4616[_0xc812('0x36')][_0xc812('0x1f')]);}_0x3d98ef[_0xc812('0x3c')]=qs[_0xc812('0x3d')](_0x4e4616[_0xc812('0x36')][_0xc812('0x3d')]);_0x3d98ef[_0xc812('0x3e')]=qs[_0xc812('0x3f')](_[_0xc812('0x40')](_0x4e4616[_0xc812('0x36')],_0x44dea3['filters']),_0x4fdeb6);if(_0x4e4616[_0xc812('0x36')][_0xc812('0x41')]){_0x3d98ef[_0xc812('0x3e')]=_['merge'](_0x3d98ef[_0xc812('0x3e')],{'$or':_[_0xc812('0x2e')](_0x4fdeb6,function(_0x321bf3){if(_0x321bf3['type']!==_0xc812('0x42')){var _0x405131={};_0x405131[_0x321bf3['name']]={'$like':'%'+_0x4e4616[_0xc812('0x36')][_0xc812('0x41')]+'%'};return _0x405131;}})});}_0x3d98ef=_[_0xc812('0x43')]({},_0x3d98ef,_0x4e4616[_0xc812('0x44')]);var _0x117930={'where':_0x3d98ef[_0xc812('0x3e')]};return db[_0xc812('0x2f')]['count'](_0x117930)[_0xc812('0x26')](function(_0x3ec317){_0x554a5a[_0xc812('0x22')]=_0x3ec317;if(_0x4e4616[_0xc812('0x36')]['includeAll']){_0x3d98ef[_0xc812('0x45')]=[{'all':!![]}];}return db[_0xc812('0x2f')][_0xc812('0x46')](_0x3d98ef);})[_0xc812('0x26')](function(_0x4e0d68){_0x554a5a['rows']=_0x4e0d68;return _0x554a5a;})[_0xc812('0x26')](respondWithFilteredResult(_0x59f5f8,_0x3d98ef))[_0xc812('0x47')](handleError(_0x59f5f8,null));};exports[_0xc812('0x48')]=function(_0x2aa851,_0x5143bd){var _0x42d935={'raw':!![],'where':{'id':_0x2aa851[_0xc812('0x49')]['id']}},_0x3a4669={};_0x3a4669[_0xc812('0x34')]=_[_0xc812('0x35')](db[_0xc812('0x2f')][_0xc812('0x30')]);_0x3a4669['query']=_[_0xc812('0x35')](_0x2aa851[_0xc812('0x36')]);_0x3a4669['filters']=_[_0xc812('0x4a')](_0x3a4669[_0xc812('0x34')],_0x3a4669[_0xc812('0x36')]);_0x42d935[_0xc812('0x37')]=_['intersection'](_0x3a4669[_0xc812('0x34')],qs['fields'](_0x2aa851[_0xc812('0x36')][_0xc812('0x38')]));_0x42d935['attributes']=_0x42d935[_0xc812('0x37')][_0xc812('0x39')]?_0x42d935[_0xc812('0x37')]:_0x3a4669[_0xc812('0x34')];if(_0x2aa851[_0xc812('0x36')][_0xc812('0x4b')]){_0x42d935[_0xc812('0x45')]=[{'all':!![]}];}_0x42d935=_[_0xc812('0x43')]({},_0x42d935,_0x2aa851[_0xc812('0x44')]);return db[_0xc812('0x2f')]['find'](_0x42d935)[_0xc812('0x26')](handleEntityNotFound(_0x5143bd,null))['then'](respondWithResult(_0x5143bd,null))[_0xc812('0x47')](handleError(_0x5143bd,null));};exports[_0xc812('0x4c')]=function(_0x2860a9,_0x155a20){return db[_0xc812('0x2f')][_0xc812('0x4c')](_0x2860a9[_0xc812('0x4d')],{})['then'](function(_0x5b5937){var _0x244bda=_0x2860a9[_0xc812('0x4e')][_0xc812('0x27')]({'plain':!![]});if(!_0x244bda)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x244bda[_0xc812('0x4f')]===_0xc812('0x4e')){var _0x11da16=_0x5b5937[_0xc812('0x27')]({'plain':!![]});var _0x57cf57='CmContactHasItems';return db[_0xc812('0x50')]['find']({'where':{'name':_0x57cf57,'userProfileId':_0x244bda['userProfileId']},'raw':!![]})[_0xc812('0x26')](function(_0x1944c9){if(_0x1944c9&&_0x1944c9[_0xc812('0x51')]===0x0){return db['UserProfileResource']['create']({'name':_0x11da16[_0xc812('0x2c')],'resourceId':_0x11da16['id'],'type':_0x1944c9[_0xc812('0x2c')],'sectionId':_0x1944c9['id']},{})[_0xc812('0x26')](function(){return _0x5b5937;});}else{return _0x5b5937;}})[_0xc812('0x47')](function(_0x468f82){logger['error'](_0xc812('0x52'),_0x468f82);throw _0x468f82;});}return _0x5b5937;})[_0xc812('0x26')](respondWithResult(_0x155a20,0xc9))['catch'](handleError(_0x155a20,null));};exports[_0xc812('0x53')]=function(_0x2c636e,_0x3fe028){if(_0x2c636e[_0xc812('0x4d')]['id']){delete _0x2c636e['body']['id'];}return db[_0xc812('0x2f')]['find']({'where':{'id':_0x2c636e[_0xc812('0x49')]['id']}})[_0xc812('0x26')](handleEntityNotFound(_0x3fe028,null))[_0xc812('0x26')](saveUpdates(_0x2c636e[_0xc812('0x4d')],null))[_0xc812('0x26')](respondWithResult(_0x3fe028,null))[_0xc812('0x47')](handleError(_0x3fe028,null));};exports['destroy']=function(_0x368428,_0x622b15){return db[_0xc812('0x2f')]['find']({'where':{'id':_0x368428[_0xc812('0x49')]['id']}})[_0xc812('0x26')](handleEntityNotFound(_0x622b15,null))[_0xc812('0x26')](removeEntity(_0x622b15,null))[_0xc812('0x47')](handleError(_0x622b15,null));}; \ No newline at end of file +var _0x56e1=['role','user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','moment','bluebird','mustache','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','destroy','then','get','CmContactHasItems','sendStatus','error','stack','index','map','CmContactHasItem','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','merge','filter','options','includeAll','findAll','rows','catch','show','params','rawAttributes','length','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x16ac0d,_0x58b125){var _0x3361b4=function(_0x50ad62){while(--_0x50ad62){_0x16ac0d['push'](_0x16ac0d['shift']());}};_0x3361b4(++_0x58b125);}(_0x56e1,0x196));var _0x156e=function(_0x459c2b,_0x44b2d9){_0x459c2b=_0x459c2b-0x0;var _0x26bc62=_0x56e1[_0x459c2b];return _0x26bc62;};'use strict';var emlformat=require(_0x156e('0x0'));var rimraf=require(_0x156e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x156e('0x2'));var BPromise=require(_0x156e('0x3'));var Mustache=require(_0x156e('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x156e('0x5'));var _=require(_0x156e('0x6'));var squel=require(_0x156e('0x7'));var crypto=require(_0x156e('0x8'));var jsforce=require(_0x156e('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x156e('0xa'));var querystring=require(_0x156e('0xb'));var Papa=require(_0x156e('0xc'));var Redis=require(_0x156e('0xd'));var authService=require(_0x156e('0xe'));var qs=require(_0x156e('0xf'));var as=require(_0x156e('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x156e('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x156e('0x12'));var licenseUtil=require(_0x156e('0x13'));var db=require(_0x156e('0x14'))['db'];function respondWithStatusCode(_0x3faab0,_0x51170b){_0x51170b=_0x51170b||0xcc;return function(_0x4baa41){if(_0x4baa41){return _0x3faab0['sendStatus'](_0x51170b);}return _0x3faab0[_0x156e('0x15')](_0x51170b)[_0x156e('0x16')]();};}function respondWithResult(_0x1141aa,_0xf83c99){_0xf83c99=_0xf83c99||0xc8;return function(_0x5185e9){if(_0x5185e9){return _0x1141aa[_0x156e('0x15')](_0xf83c99)[_0x156e('0x17')](_0x5185e9);}};}function respondWithFilteredResult(_0x5870b1,_0x33309c){return function(_0x10a2e7){if(_0x10a2e7){var _0x5c291a=typeof _0x33309c[_0x156e('0x18')]===_0x156e('0x19')&&typeof _0x33309c[_0x156e('0x1a')]===_0x156e('0x19');var _0x496baf=_0x10a2e7[_0x156e('0x1b')];var _0x2972ae=_0x5c291a?0x0:_0x33309c[_0x156e('0x18')];var _0x3a15c9=_0x5c291a?_0x10a2e7['count']:_0x33309c['offset']+_0x33309c['limit'];var _0x2bc96c;if(_0x3a15c9>=_0x496baf){_0x3a15c9=_0x496baf;_0x2bc96c=0xc8;}else{_0x2bc96c=0xce;}_0x5870b1[_0x156e('0x15')](_0x2bc96c);return _0x5870b1[_0x156e('0x1c')](_0x156e('0x1d'),_0x2972ae+'-'+_0x3a15c9+'/'+_0x496baf)[_0x156e('0x17')](_0x10a2e7);}return null;};}function patchUpdates(_0x30b25d){return function(_0x5ccd30){try{jsonpatch['apply'](_0x5ccd30,_0x30b25d,!![]);}catch(_0x4d06ec){return BPromise['reject'](_0x4d06ec);}return _0x5ccd30[_0x156e('0x1e')]();};}function saveUpdates(_0x54d0dc,_0x4c5979){return function(_0x8180e9){if(_0x8180e9){return _0x8180e9[_0x156e('0x1f')](_0x54d0dc)['then'](function(_0x41a9d1){return _0x41a9d1;});}return null;};}function removeEntity(_0x4f6a1c,_0x2c27e2){return function(_0x153d25){if(_0x153d25){return _0x153d25[_0x156e('0x20')]()[_0x156e('0x21')](function(){var _0x1846b1=_0x153d25[_0x156e('0x22')]({'plain':!![]});var _0x31991f=_0x156e('0x23');return db['UserProfileResource'][_0x156e('0x20')]({'where':{'type':_0x31991f,'resourceId':_0x1846b1['id']}})[_0x156e('0x21')](function(){return _0x153d25;});})['then'](function(){_0x4f6a1c['status'](0xcc)[_0x156e('0x16')]();});}};}function handleEntityNotFound(_0x4f3a28,_0x241055){return function(_0x2d8d2e){if(!_0x2d8d2e){_0x4f3a28[_0x156e('0x24')](0x194);}return _0x2d8d2e;};}function handleError(_0x471e0b,_0x3c7446){_0x3c7446=_0x3c7446||0x1f4;return function(_0xc7dd6f){logger[_0x156e('0x25')](_0xc7dd6f[_0x156e('0x26')]);if(_0xc7dd6f['name']){delete _0xc7dd6f['name'];}_0x471e0b[_0x156e('0x15')](_0x3c7446)['send'](_0xc7dd6f);};}exports[_0x156e('0x27')]=function(_0x18b57c,_0x2ec64f){var _0x58dbf0={},_0x4fa91c={},_0x335beb={'count':0x0,'rows':[]};var _0x2409da=_[_0x156e('0x28')](db[_0x156e('0x29')]['rawAttributes'],function(_0x30fc24){return{'name':_0x30fc24[_0x156e('0x2a')],'type':_0x30fc24[_0x156e('0x2b')][_0x156e('0x2c')]};});_0x4fa91c[_0x156e('0x2d')]=_[_0x156e('0x28')](_0x2409da,_0x156e('0x2e'));_0x4fa91c[_0x156e('0x2f')]=_[_0x156e('0x30')](_0x18b57c[_0x156e('0x2f')]);_0x4fa91c[_0x156e('0x31')]=_[_0x156e('0x32')](_0x4fa91c[_0x156e('0x2d')],_0x4fa91c[_0x156e('0x2f')]);_0x58dbf0[_0x156e('0x33')]=_[_0x156e('0x32')](_0x4fa91c[_0x156e('0x2d')],qs['fields'](_0x18b57c[_0x156e('0x2f')][_0x156e('0x34')]));_0x58dbf0[_0x156e('0x33')]=_0x58dbf0[_0x156e('0x33')]['length']?_0x58dbf0[_0x156e('0x33')]:_0x4fa91c[_0x156e('0x2d')];if(!_0x18b57c['query'][_0x156e('0x35')]('nolimit')){_0x58dbf0[_0x156e('0x1a')]=qs[_0x156e('0x1a')](_0x18b57c[_0x156e('0x2f')][_0x156e('0x1a')]);_0x58dbf0[_0x156e('0x18')]=qs['offset'](_0x18b57c[_0x156e('0x2f')][_0x156e('0x18')]);}_0x58dbf0[_0x156e('0x36')]=qs[_0x156e('0x37')](_0x18b57c['query'][_0x156e('0x37')]);_0x58dbf0[_0x156e('0x38')]=qs['filters'](_[_0x156e('0x39')](_0x18b57c[_0x156e('0x2f')],_0x4fa91c[_0x156e('0x31')]),_0x2409da);if(_0x18b57c['query']['filter']){_0x58dbf0['where']=_[_0x156e('0x3a')](_0x58dbf0[_0x156e('0x38')],{'$or':_[_0x156e('0x28')](_0x2409da,function(_0x2f2137){if(_0x2f2137[_0x156e('0x2b')]!=='VIRTUAL'){var _0xa7f055={};_0xa7f055[_0x2f2137[_0x156e('0x2e')]]={'$like':'%'+_0x18b57c['query'][_0x156e('0x3b')]+'%'};return _0xa7f055;}})});}_0x58dbf0=_[_0x156e('0x3a')]({},_0x58dbf0,_0x18b57c[_0x156e('0x3c')]);var _0xd43f73={'where':_0x58dbf0[_0x156e('0x38')]};return db['CmContactHasItem'][_0x156e('0x1b')](_0xd43f73)[_0x156e('0x21')](function(_0x14b71e){_0x335beb[_0x156e('0x1b')]=_0x14b71e;if(_0x18b57c['query'][_0x156e('0x3d')]){_0x58dbf0['include']=[{'all':!![]}];}return db[_0x156e('0x29')][_0x156e('0x3e')](_0x58dbf0);})['then'](function(_0x253d96){_0x335beb[_0x156e('0x3f')]=_0x253d96;return _0x335beb;})[_0x156e('0x21')](respondWithFilteredResult(_0x2ec64f,_0x58dbf0))[_0x156e('0x40')](handleError(_0x2ec64f,null));};exports[_0x156e('0x41')]=function(_0x1e0390,_0x463d59){var _0x22280e={'raw':!![],'where':{'id':_0x1e0390[_0x156e('0x42')]['id']}},_0x5d1157={};_0x5d1157[_0x156e('0x2d')]=_[_0x156e('0x30')](db[_0x156e('0x29')][_0x156e('0x43')]);_0x5d1157[_0x156e('0x2f')]=_['keys'](_0x1e0390[_0x156e('0x2f')]);_0x5d1157['filters']=_['intersection'](_0x5d1157[_0x156e('0x2d')],_0x5d1157[_0x156e('0x2f')]);_0x22280e[_0x156e('0x33')]=_['intersection'](_0x5d1157['model'],qs[_0x156e('0x34')](_0x1e0390[_0x156e('0x2f')][_0x156e('0x34')]));_0x22280e[_0x156e('0x33')]=_0x22280e['attributes'][_0x156e('0x44')]?_0x22280e[_0x156e('0x33')]:_0x5d1157[_0x156e('0x2d')];if(_0x1e0390[_0x156e('0x2f')][_0x156e('0x3d')]){_0x22280e[_0x156e('0x45')]=[{'all':!![]}];}_0x22280e=_[_0x156e('0x3a')]({},_0x22280e,_0x1e0390['options']);return db[_0x156e('0x29')][_0x156e('0x46')](_0x22280e)[_0x156e('0x21')](handleEntityNotFound(_0x463d59,null))[_0x156e('0x21')](respondWithResult(_0x463d59,null))[_0x156e('0x40')](handleError(_0x463d59,null));};exports[_0x156e('0x47')]=function(_0x27f8d2,_0x1aaea3){return db[_0x156e('0x29')][_0x156e('0x47')](_0x27f8d2[_0x156e('0x48')],{})[_0x156e('0x21')](function(_0x26c58d){var _0x10cbd8=_0x27f8d2['user'][_0x156e('0x22')]({'plain':!![]});if(!_0x10cbd8)throw new Error(_0x156e('0x49'));if(_0x10cbd8[_0x156e('0x4a')]===_0x156e('0x4b')){var _0x5c5783=_0x26c58d[_0x156e('0x22')]({'plain':!![]});var _0x14b80f='CmContactHasItems';return db[_0x156e('0x4c')][_0x156e('0x46')]({'where':{'name':_0x14b80f,'userProfileId':_0x10cbd8['userProfileId']},'raw':!![]})[_0x156e('0x21')](function(_0x51a898){if(_0x51a898&&_0x51a898[_0x156e('0x4d')]===0x0){return db[_0x156e('0x4e')][_0x156e('0x47')]({'name':_0x5c5783[_0x156e('0x2e')],'resourceId':_0x5c5783['id'],'type':_0x51a898[_0x156e('0x2e')],'sectionId':_0x51a898['id']},{})[_0x156e('0x21')](function(){return _0x26c58d;});}else{return _0x26c58d;}})[_0x156e('0x40')](function(_0x85ed73){logger[_0x156e('0x25')](_0x156e('0x4f'),_0x85ed73);throw _0x85ed73;});}return _0x26c58d;})[_0x156e('0x21')](respondWithResult(_0x1aaea3,0xc9))[_0x156e('0x40')](handleError(_0x1aaea3,null));};exports['update']=function(_0x3f5a36,_0x8aff3d){if(_0x3f5a36[_0x156e('0x48')]['id']){delete _0x3f5a36[_0x156e('0x48')]['id'];}return db[_0x156e('0x29')]['find']({'where':{'id':_0x3f5a36[_0x156e('0x42')]['id']}})['then'](handleEntityNotFound(_0x8aff3d,null))[_0x156e('0x21')](saveUpdates(_0x3f5a36[_0x156e('0x48')],null))[_0x156e('0x21')](respondWithResult(_0x8aff3d,null))[_0x156e('0x40')](handleError(_0x8aff3d,null));};exports[_0x156e('0x20')]=function(_0x527dad,_0x3be06e){return db[_0x156e('0x29')][_0x156e('0x46')]({'where':{'id':_0x527dad[_0x156e('0x42')]['id']}})[_0x156e('0x21')](handleEntityNotFound(_0x3be06e,null))['then'](removeEntity(_0x3be06e,null))[_0x156e('0x40')](handleError(_0x3be06e,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index 39464c9..90b8e27 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 _0x4b95=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','CmContactHasItem','cm_contact_has_items','util'];(function(_0x1e8cab,_0x2e4308){var _0x2d71d2=function(_0xde4be3){while(--_0xde4be3){_0x1e8cab['push'](_0x1e8cab['shift']());}};_0x2d71d2(++_0x2e4308);}(_0x4b95,0x1d3));var _0x54b9=function(_0x5c0f65,_0x8fb857){_0x5c0f65=_0x5c0f65-0x0;var _0x307a8f=_0x4b95[_0x5c0f65];return _0x307a8f;};'use strict';var _=require('lodash');var util=require(_0x54b9('0x0'));var logger=require(_0x54b9('0x1'))(_0x54b9('0x2'));var moment=require(_0x54b9('0x3'));var BPromise=require(_0x54b9('0x4'));var rp=require(_0x54b9('0x5'));var fs=require('fs');var path=require(_0x54b9('0x6'));var rimraf=require(_0x54b9('0x7'));var config=require(_0x54b9('0x8'));var attributes=require('./cmContactHasItem.attributes');module[_0x54b9('0x9')]=function(_0x179f5b,_0x77efb4){return _0x179f5b[_0x54b9('0xa')](_0x54b9('0xb'),attributes,{'tableName':_0x54b9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x24de=['cm_contact_has_items','util','../../config/logger','api','moment','path','../../config/environment','./cmContactHasItem.attributes','exports','define','CmContactHasItem'];(function(_0x356bf3,_0x17ed21){var _0x42d22=function(_0x4818e2){while(--_0x4818e2){_0x356bf3['push'](_0x356bf3['shift']());}};_0x42d22(++_0x17ed21);}(_0x24de,0x64));var _0xe24d=function(_0x32501b,_0x13fe35){_0x32501b=_0x32501b-0x0;var _0x1c2539=_0x24de[_0x32501b];return _0x1c2539;};'use strict';var _=require('lodash');var util=require(_0xe24d('0x0'));var logger=require(_0xe24d('0x1'))(_0xe24d('0x2'));var moment=require(_0xe24d('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe24d('0x4'));var rimraf=require('rimraf');var config=require(_0xe24d('0x5'));var attributes=require(_0xe24d('0x6'));module[_0xe24d('0x7')]=function(_0x5e5c80,_0x5aef49){return _0x5e5c80[_0xe24d('0x8')](_0xe24d('0x9'),attributes,{'tableName':_0xe24d('0xa'),'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 4789bbc..372239a 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 _0x1764=['debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','message','result','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','CmContactHasItem,\x20%s,\x20%s','request\x20sent'];(function(_0x46e649,_0x2a600f){var _0x305678=function(_0x2072b6){while(--_0x2072b6){_0x46e649['push'](_0x46e649['shift']());}};_0x305678(++_0x2a600f);}(_0x1764,0xd7));var _0x4176=function(_0xac5aa5,_0x35b081){_0xac5aa5=_0xac5aa5-0x0;var _0x59cb5e=_0x1764[_0xac5aa5];return _0x59cb5e;};'use strict';var _=require('lodash');var util=require(_0x4176('0x0'));var moment=require(_0x4176('0x1'));var BPromise=require(_0x4176('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4176('0x3'));var db=require(_0x4176('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4176('0x5'))('rpc');var config=require(_0x4176('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x4176('0x7')][_0x4176('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x85968a,_0x3a56bc,_0x59335d){return new BPromise(function(_0x56a3ae,_0x54eeb6){return client[_0x4176('0x9')](_0x85968a,_0x59335d)[_0x4176('0xa')](function(_0x1312fb){logger['info'](_0x4176('0xb'),_0x3a56bc,_0x4176('0xc'));logger[_0x4176('0xd')](_0x4176('0xe'),_0x3a56bc,_0x4176('0xc'),JSON[_0x4176('0xf')](_0x1312fb));if(_0x1312fb['error']){if(_0x1312fb[_0x4176('0x10')]['code']===0x1f4){logger['error'](_0x4176('0xb'),_0x3a56bc,_0x1312fb[_0x4176('0x10')]['message']);return _0x54eeb6(_0x1312fb['error'][_0x4176('0x11')]);}logger[_0x4176('0x10')](_0x4176('0xb'),_0x3a56bc,_0x1312fb[_0x4176('0x10')][_0x4176('0x11')]);return _0x56a3ae(_0x1312fb['error'][_0x4176('0x11')]);}else{logger['info'](_0x4176('0xb'),_0x3a56bc,_0x4176('0xc'));_0x56a3ae(_0x1312fb[_0x4176('0x12')][_0x4176('0x11')]);}})['catch'](function(_0x3a73af){logger[_0x4176('0x10')](_0x4176('0xb'),_0x3a56bc,_0x3a73af);_0x54eeb6(_0x3a73af);});});} \ No newline at end of file +var _0x80e4=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','CmContactHasItem,\x20%s,\x20%s','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x37f301,_0x6e74bd){var _0x2f71d5=function(_0x1f3479){while(--_0x1f3479){_0x37f301['push'](_0x37f301['shift']());}};_0x2f71d5(++_0x6e74bd);}(_0x80e4,0xbb));var _0x480e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0x80e4[_0x3c2a69];return _0x596bc8;};'use strict';var _=require(_0x480e('0x0'));var util=require(_0x480e('0x1'));var moment=require('moment');var BPromise=require(_0x480e('0x2'));var rs=require(_0x480e('0x3'));var fs=require('fs');var Redis=require(_0x480e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x480e('0x5'));var logger=require(_0x480e('0x6'))('rpc');var config=require(_0x480e('0x7'));var jayson=require(_0x480e('0x8'));var client=jayson[_0x480e('0x9')][_0x480e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x35c431,_0x4ea050,_0x5af665){return new BPromise(function(_0xc9ecef,_0xdccbc8){return client[_0x480e('0xb')](_0x35c431,_0x5af665)[_0x480e('0xc')](function(_0x4ac661){logger[_0x480e('0xd')](_0x480e('0xe'),_0x4ea050,'request\x20sent');logger[_0x480e('0xf')](_0x480e('0x10'),_0x4ea050,_0x480e('0x11'),JSON[_0x480e('0x12')](_0x4ac661));if(_0x4ac661[_0x480e('0x13')]){if(_0x4ac661[_0x480e('0x13')][_0x480e('0x14')]===0x1f4){logger['error'](_0x480e('0xe'),_0x4ea050,_0x4ac661['error'][_0x480e('0x15')]);return _0xdccbc8(_0x4ac661['error'][_0x480e('0x15')]);}logger[_0x480e('0x13')](_0x480e('0xe'),_0x4ea050,_0x4ac661['error'][_0x480e('0x15')]);return _0xc9ecef(_0x4ac661['error'][_0x480e('0x15')]);}else{logger[_0x480e('0xd')]('CmContactHasItem,\x20%s,\x20%s',_0x4ea050,_0x480e('0x11'));_0xc9ecef(_0x4ac661[_0x480e('0x16')][_0x480e('0x15')]);}})[_0x480e('0x17')](function(_0x26d68b){logger[_0x480e('0x13')](_0x480e('0xe'),_0x4ea050,_0x26d68b);_0xdccbc8(_0x26d68b);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index 5844463..059fcd6 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 _0x7cc2=['path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./cmContactHasItem.controller','get','isAuthenticated','/:id','show','create','put','update','destroy','multer','util'];(function(_0x546c68,_0x5c0116){var _0x4a2389=function(_0x5aa205){while(--_0x5aa205){_0x546c68['push'](_0x546c68['shift']());}};_0x4a2389(++_0x5c0116);}(_0x7cc2,0x196));var _0x27cc=function(_0xda464c,_0x26e47d){_0xda464c=_0xda464c-0x0;var _0x19e222=_0x7cc2[_0xda464c];return _0x19e222;};'use strict';var multer=require(_0x27cc('0x0'));var util=require(_0x27cc('0x1'));var path=require(_0x27cc('0x2'));var timeout=require(_0x27cc('0x3'));var express=require(_0x27cc('0x4'));var router=express['Router']();var fs_extra=require(_0x27cc('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x27cc('0x6'));var config=require(_0x27cc('0x7'));var controller=require(_0x27cc('0x8'));router[_0x27cc('0x9')]('/',auth[_0x27cc('0xa')](),controller['index']);router[_0x27cc('0x9')](_0x27cc('0xb'),auth['isAuthenticated'](),controller[_0x27cc('0xc')]);router['post']('/',auth[_0x27cc('0xa')](),controller[_0x27cc('0xd')]);router[_0x27cc('0xe')]('/:id',auth[_0x27cc('0xa')](),controller[_0x27cc('0xf')]);router['delete'](_0x27cc('0xb'),auth[_0x27cc('0xa')](),controller[_0x27cc('0x10')]);module['exports']=router; \ No newline at end of file +var _0x6305=['isAuthenticated','show','post','create','put','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmContactHasItem.controller','get','/:id'];(function(_0x5632ec,_0x373af6){var _0x4f43b2=function(_0x26bd8f){while(--_0x26bd8f){_0x5632ec['push'](_0x5632ec['shift']());}};_0x4f43b2(++_0x373af6);}(_0x6305,0x1ab));var _0x5630=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0x6305[_0x1a36a5];return _0x746243;};'use strict';var multer=require('multer');var util=require(_0x5630('0x0'));var path=require('path');var timeout=require(_0x5630('0x1'));var express=require(_0x5630('0x2'));var router=express[_0x5630('0x3')]();var fs_extra=require(_0x5630('0x4'));var auth=require(_0x5630('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5630('0x6'));var controller=require(_0x5630('0x7'));router[_0x5630('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5630('0x8')](_0x5630('0x9'),auth[_0x5630('0xa')](),controller[_0x5630('0xb')]);router[_0x5630('0xc')]('/',auth[_0x5630('0xa')](),controller[_0x5630('0xd')]);router[_0x5630('0xe')](_0x5630('0x9'),auth[_0x5630('0xa')](),controller[_0x5630('0xf')]);router[_0x5630('0x10')]('/:id',auth[_0x5630('0xa')](),controller[_0x5630('0x11')]);module[_0x5630('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index cbeedcc..e07cc65 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 _0x0bee=['STRING','alias','name','TEXT','type','select','parse','values','isArray','setDataValue','stringify','BOOLEAN','ENUM','voice','sequelize','lodash','exports','VIRTUAL','getDataValue'];(function(_0x1ce279,_0x422132){var _0x4dd294=function(_0xe732d6){while(--_0xe732d6){_0x1ce279['push'](_0x1ce279['shift']());}};_0x4dd294(++_0x422132);}(_0x0bee,0x93));var _0xe0be=function(_0x300883,_0x5a1ea4){_0x300883=_0x300883-0x0;var _0x5b9e7a=_0x0bee[_0x300883];return _0x5b9e7a;};'use strict';var Sequelize=require(_0xe0be('0x0'));var _=require(_0xe0be('0x1'));module[_0xe0be('0x2')]={'name':{'type':Sequelize[_0xe0be('0x3')],'get':function(_0x57255a){return this[_0xe0be('0x4')]('alias');}},'alias':{'type':Sequelize[_0xe0be('0x5')],'allowNull':![],'set':function(_0x1fd8ee){this['setDataValue'](_0xe0be('0x6'),_0x1fd8ee?_0x1fd8ee:this['getDataValue'](_0xe0be('0x7')));}},'type':{'type':Sequelize[_0xe0be('0x5')],'allowNull':![]},'values':{'type':Sequelize[_0xe0be('0x8')]('long'),'get':function(){if(this['getDataValue'](_0xe0be('0x9'))===_0xe0be('0xa')){return JSON[_0xe0be('0xb')](this[_0xe0be('0x4')](_0xe0be('0xc')));}else{return this['getDataValue']('values');}},'set':function(_0x1c70c7){if(Array[_0xe0be('0xd')](_0x1c70c7)){this[_0xe0be('0xe')](_0xe0be('0xc'),JSON[_0xe0be('0xf')](_0x1c70c7));}else{this[_0xe0be('0xe')](_0xe0be('0xc'),_0x1c70c7);}}},'required':{'type':Sequelize[_0xe0be('0x10')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xe0be('0x10')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xe0be('0x11')](_0xe0be('0x12'))}}; \ No newline at end of file +var _0x80e7=['STRING','setDataValue','alias','name','long','type','select','parse','values','isArray','stringify','BOOLEAN','voice','lodash','VIRTUAL','getDataValue'];(function(_0x46cd80,_0x5890a5){var _0xf8004d=function(_0x2d057e){while(--_0x2d057e){_0x46cd80['push'](_0x46cd80['shift']());}};_0xf8004d(++_0x5890a5);}(_0x80e7,0xbd));var _0x780e=function(_0x353a65,_0x2e574d){_0x353a65=_0x353a65-0x0;var _0x554b5c=_0x80e7[_0x353a65];return _0x554b5c;};'use strict';var Sequelize=require('sequelize');var _=require(_0x780e('0x0'));module['exports']={'name':{'type':Sequelize[_0x780e('0x1')],'get':function(_0x3a69fe){return this[_0x780e('0x2')]('alias');}},'alias':{'type':Sequelize[_0x780e('0x3')],'allowNull':![],'set':function(_0x35fc27){this[_0x780e('0x4')](_0x780e('0x5'),_0x35fc27?_0x35fc27:this[_0x780e('0x2')](_0x780e('0x6')));}},'type':{'type':Sequelize[_0x780e('0x3')],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0x780e('0x7')),'get':function(){if(this[_0x780e('0x2')](_0x780e('0x8'))===_0x780e('0x9')){return JSON[_0x780e('0xa')](this[_0x780e('0x2')](_0x780e('0xb')));}else{return this[_0x780e('0x2')](_0x780e('0xb'));}},'set':function(_0x57aeb0){if(Array[_0x780e('0xc')](_0x57aeb0)){this['setDataValue'](_0x780e('0xb'),JSON[_0x780e('0xd')](_0x57aeb0));}else{this[_0x780e('0x4')](_0x780e('0xb'),_0x57aeb0);}}},'required':{'type':Sequelize[_0x780e('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x780e('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM'](_0x780e('0xf'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index e56bf60..50b422e 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 _0x31d2=['type','VIRTUAL','merge','includeAll','findAll','show','params','options','find','catch','update','body','create','text','Sequelize','TEXT','INTEGER','switch','BOOLEAN','defaultValue','sequelize','addColumn','format','cf_%d','eml-format','rimraf','fast-json-patch','request-promise','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','then','destroy','stack','name','send','index','CmCustomField','rawAttributes','fieldName','key','model','differenceBy','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where'];(function(_0xba22f4,_0x4f1626){var _0x1d9a19=function(_0x274bb2){while(--_0x274bb2){_0xba22f4['push'](_0xba22f4['shift']());}};_0x1d9a19(++_0x4f1626);}(_0x31d2,0x6c));var _0x231d=function(_0x3ade7d,_0x446f53){_0x3ade7d=_0x3ade7d-0x0;var _0x42ddc9=_0x31d2[_0x3ade7d];return _0x42ddc9;};'use strict';var emlformat=require(_0x231d('0x0'));var rimraf=require(_0x231d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x231d('0x2'));var rp=require(_0x231d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x231d('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x231d('0x5'));var ejs=require(_0x231d('0x6'));var fs=require('fs');var fs_extra=require(_0x231d('0x7'));var _=require(_0x231d('0x8'));var squel=require(_0x231d('0x9'));var crypto=require(_0x231d('0xa'));var jsforce=require(_0x231d('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x231d('0xc'));var Redis=require('ioredis');var authService=require(_0x231d('0xd'));var qs=require(_0x231d('0xe'));var as=require(_0x231d('0xf'));var hardwareService=require(_0x231d('0x10'));var logger=require(_0x231d('0x11'))('api');var utils=require(_0x231d('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x231d('0x13'));var db=require(_0x231d('0x14'))['db'];function respondWithStatusCode(_0x59aa5a,_0x3f1e54){_0x3f1e54=_0x3f1e54||0xcc;return function(_0x450b27){if(_0x450b27){return _0x59aa5a[_0x231d('0x15')](_0x3f1e54);}return _0x59aa5a[_0x231d('0x16')](_0x3f1e54)[_0x231d('0x17')]();};}function respondWithResult(_0x4a43c2,_0x2c3d2a){_0x2c3d2a=_0x2c3d2a||0xc8;return function(_0x581187){if(_0x581187){return _0x4a43c2[_0x231d('0x16')](_0x2c3d2a)[_0x231d('0x18')](_0x581187);}};}function respondWithFilteredResult(_0x5f30c0,_0x45d1e2){return function(_0x5099c4){if(_0x5099c4){var _0x58036e=typeof _0x45d1e2[_0x231d('0x19')]==='undefined'&&typeof _0x45d1e2[_0x231d('0x1a')]===_0x231d('0x1b');var _0x35ca8a=_0x5099c4[_0x231d('0x1c')];var _0x5e546f=_0x58036e?0x0:_0x45d1e2[_0x231d('0x19')];var _0x3545ef=_0x58036e?_0x5099c4['count']:_0x45d1e2['offset']+_0x45d1e2[_0x231d('0x1a')];var _0x4852b7;if(_0x3545ef>=_0x35ca8a){_0x3545ef=_0x35ca8a;_0x4852b7=0xc8;}else{_0x4852b7=0xce;}_0x5f30c0[_0x231d('0x16')](_0x4852b7);return _0x5f30c0[_0x231d('0x1d')](_0x231d('0x1e'),_0x5e546f+'-'+_0x3545ef+'/'+_0x35ca8a)[_0x231d('0x18')](_0x5099c4);}return null;};}function patchUpdates(_0xab5eb7){return function(_0x174868){try{jsonpatch[_0x231d('0x1f')](_0x174868,_0xab5eb7,!![]);}catch(_0xae6f2){return BPromise[_0x231d('0x20')](_0xae6f2);}return _0x174868['save']();};}function saveUpdates(_0x39749,_0x235768){return function(_0x3f3015){if(_0x3f3015){return _0x3f3015['update'](_0x39749)[_0x231d('0x21')](function(_0x36f723){return _0x36f723;});}return null;};}function removeEntity(_0x55cdb7,_0x157a6d){return function(_0x380da4){if(_0x380da4){return _0x380da4[_0x231d('0x22')]()[_0x231d('0x21')](function(){_0x55cdb7[_0x231d('0x16')](0xcc)[_0x231d('0x17')]();});}};}function handleEntityNotFound(_0x1d6fe9,_0x5e7d35){return function(_0x16bcd4){if(!_0x16bcd4){_0x1d6fe9['sendStatus'](0x194);}return _0x16bcd4;};}function handleError(_0x248296,_0x5954c7){_0x5954c7=_0x5954c7||0x1f4;return function(_0x3a9fd5){logger['error'](_0x3a9fd5[_0x231d('0x23')]);if(_0x3a9fd5['name']){delete _0x3a9fd5[_0x231d('0x24')];}_0x248296[_0x231d('0x16')](_0x5954c7)[_0x231d('0x25')](_0x3a9fd5);};}exports[_0x231d('0x26')]=function(_0x550931,_0x4c3488){var _0x44c531={},_0x492864={},_0xb7acae={'count':0x0,'rows':[]};var _0x2ee1c5=_['map'](db[_0x231d('0x27')][_0x231d('0x28')],function(_0x4586d0){return{'name':_0x4586d0[_0x231d('0x29')],'type':_0x4586d0['type'][_0x231d('0x2a')]};});_0x492864[_0x231d('0x2b')]=_[_0x231d('0x2c')](_[_0x231d('0x2d')](_0x2ee1c5,_0x231d('0x24')),[_0x231d('0x24')]);_0x492864[_0x231d('0x2e')]=_[_0x231d('0x2f')](_0x550931['query']);_0x492864[_0x231d('0x30')]=_[_0x231d('0x31')](_0x492864[_0x231d('0x2b')],_0x492864[_0x231d('0x2e')]);_0x44c531[_0x231d('0x32')]=_['intersection'](_0x492864[_0x231d('0x2b')],qs[_0x231d('0x33')](_0x550931[_0x231d('0x2e')][_0x231d('0x33')]));_0x44c531[_0x231d('0x32')]=_0x44c531['attributes'][_0x231d('0x34')]?_0x44c531[_0x231d('0x32')]:_0x492864[_0x231d('0x2b')];if(!_0x550931[_0x231d('0x2e')][_0x231d('0x35')](_0x231d('0x36'))){_0x44c531[_0x231d('0x1a')]=qs[_0x231d('0x1a')](_0x550931[_0x231d('0x2e')][_0x231d('0x1a')]);_0x44c531[_0x231d('0x19')]=qs[_0x231d('0x19')](_0x550931[_0x231d('0x2e')][_0x231d('0x19')]);}_0x44c531[_0x231d('0x37')]=qs[_0x231d('0x38')](_0x550931[_0x231d('0x2e')][_0x231d('0x38')]);_0x44c531['where']=qs['filters'](_[_0x231d('0x39')](_0x550931[_0x231d('0x2e')],_0x492864['filters']),_0x2ee1c5);if(_0x550931[_0x231d('0x2e')][_0x231d('0x3a')]){_0x44c531[_0x231d('0x3b')]=_['merge'](_0x44c531['where'],{'$or':_['map'](_0x2ee1c5,function(_0x1d7025){if(_0x1d7025[_0x231d('0x3c')]!==_0x231d('0x3d')){var _0x15f5e5={};_0x15f5e5[_0x1d7025['name']]={'$like':'%'+_0x550931[_0x231d('0x2e')][_0x231d('0x3a')]+'%'};return _0x15f5e5;}})});}_0x44c531=_[_0x231d('0x3e')]({},_0x44c531,_0x550931['options']);var _0x2dd3b6={'where':_0x44c531[_0x231d('0x3b')]};return db[_0x231d('0x27')]['count'](_0x2dd3b6)['then'](function(_0x26bca7){_0xb7acae[_0x231d('0x1c')]=_0x26bca7;if(_0x550931['query'][_0x231d('0x3f')]){_0x44c531['include']=[{'all':!![]}];}return db[_0x231d('0x27')][_0x231d('0x40')](_0x44c531);})['then'](function(_0x586113){_0xb7acae['rows']=_0x586113;return _0xb7acae;})[_0x231d('0x21')](respondWithFilteredResult(_0x4c3488,_0x44c531))['catch'](handleError(_0x4c3488,null));};exports[_0x231d('0x41')]=function(_0x4e3a78,_0x50d027){var _0x1ee012={'raw':!![],'where':{'id':_0x4e3a78[_0x231d('0x42')]['id']}},_0x145b2a={};_0x145b2a[_0x231d('0x2b')]=_[_0x231d('0x2f')](db[_0x231d('0x27')][_0x231d('0x28')]);_0x145b2a[_0x231d('0x2e')]=_[_0x231d('0x2f')](_0x4e3a78[_0x231d('0x2e')]);_0x145b2a[_0x231d('0x30')]=_[_0x231d('0x31')](_0x145b2a[_0x231d('0x2b')],_0x145b2a[_0x231d('0x2e')]);_0x1ee012['attributes']=_[_0x231d('0x31')](_0x145b2a['model'],qs[_0x231d('0x33')](_0x4e3a78[_0x231d('0x2e')][_0x231d('0x33')]));_0x1ee012[_0x231d('0x32')]=_0x1ee012[_0x231d('0x32')][_0x231d('0x34')]?_0x1ee012[_0x231d('0x32')]:_0x145b2a[_0x231d('0x2b')];if(_0x4e3a78[_0x231d('0x2e')]['includeAll']){_0x1ee012['include']=[{'all':!![]}];}_0x1ee012=_[_0x231d('0x3e')]({},_0x1ee012,_0x4e3a78[_0x231d('0x43')]);return db['CmCustomField'][_0x231d('0x44')](_0x1ee012)[_0x231d('0x21')](handleEntityNotFound(_0x50d027,null))['then'](respondWithResult(_0x50d027,null))[_0x231d('0x45')](handleError(_0x50d027,null));};exports[_0x231d('0x46')]=function(_0xd5267,_0x880007){if(_0xd5267[_0x231d('0x47')]['id']){delete _0xd5267[_0x231d('0x47')]['id'];}return db['CmCustomField'][_0x231d('0x44')]({'where':{'id':_0xd5267['params']['id']}})[_0x231d('0x21')](handleEntityNotFound(_0x880007,null))[_0x231d('0x21')](saveUpdates(_0xd5267[_0x231d('0x47')],null))[_0x231d('0x21')](respondWithResult(_0x880007,null))[_0x231d('0x45')](handleError(_0x880007,null));};exports[_0x231d('0x22')]=function(_0x380673,_0x354450){return db['CmCustomField']['find']({'where':{'id':_0x380673[_0x231d('0x42')]['id']}})[_0x231d('0x21')](handleEntityNotFound(_0x354450,null))[_0x231d('0x21')](removeEntity(_0x354450,null))[_0x231d('0x45')](handleError(_0x354450,null));};exports[_0x231d('0x48')]=function(_0xeb5be4,_0x78e0df){var _0x4564c5;return db['sequelize']['transaction'](function(_0xa603af){return db[_0x231d('0x27')][_0x231d('0x48')](_0xeb5be4[_0x231d('0x47')],{'transaction':_0xa603af})[_0x231d('0x21')](function(_0x57fd5a){_0x4564c5=_0x57fd5a;var _0x456c54={'type':db['Sequelize']['TEXT'],'transaction':_0xa603af};switch(_0xeb5be4[_0x231d('0x47')]['type']){case _0x231d('0x49'):_0x456c54[_0x231d('0x3c')]=db[_0x231d('0x4a')][_0x231d('0x4b')];break;case'number':_0x456c54[_0x231d('0x3c')]=db[_0x231d('0x4a')][_0x231d('0x4c')];break;case _0x231d('0x4d'):_0x456c54[_0x231d('0x3c')]=db['Sequelize'][_0x231d('0x4e')];_0x456c54[_0x231d('0x4f')]=![];break;default:}return db[_0x231d('0x50')]['queryInterface'][_0x231d('0x51')]('cm_contacts',util[_0x231d('0x52')](_0x231d('0x53'),_0x4564c5['id']),_0x456c54);})[_0x231d('0x21')](function(){return _0x4564c5;});})[_0x231d('0x21')](respondWithResult(_0x78e0df,0xc9))['catch'](handleError(_0x78e0df,null));}; \ No newline at end of file +var _0x8e3b=['request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','offset','undefined','limit','set','Content-Range','reject','save','destroy','then','stack','name','send','index','map','type','key','model','differenceBy','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','CmCustomField','count','includeAll','include','rows','catch','show','params','keys','rawAttributes','options','find','update','body','transaction','create','Sequelize','TEXT','number','INTEGER','switch','BOOLEAN','defaultValue','sequelize','addColumn','cm_contacts','format','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x3864bc,_0x2e0dbd){var _0x4b4879=function(_0x2a24aa){while(--_0x2a24aa){_0x3864bc['push'](_0x3864bc['shift']());}};_0x4b4879(++_0x2e0dbd);}(_0x8e3b,0xaa));var _0xb8e3=function(_0x5ecc63,_0x110d0d){_0x5ecc63=_0x5ecc63-0x0;var _0x56e65f=_0x8e3b[_0x5ecc63];return _0x56e65f;};'use strict';var emlformat=require(_0xb8e3('0x0'));var rimraf=require(_0xb8e3('0x1'));var zipdir=require(_0xb8e3('0x2'));var jsonpatch=require(_0xb8e3('0x3'));var rp=require(_0xb8e3('0x4'));var moment=require(_0xb8e3('0x5'));var BPromise=require(_0xb8e3('0x6'));var Mustache=require(_0xb8e3('0x7'));var util=require('util');var path=require(_0xb8e3('0x8'));var sox=require(_0xb8e3('0x9'));var csv=require(_0xb8e3('0xa'));var ejs=require(_0xb8e3('0xb'));var fs=require('fs');var fs_extra=require(_0xb8e3('0xc'));var _=require('lodash');var squel=require(_0xb8e3('0xd'));var crypto=require(_0xb8e3('0xe'));var jsforce=require(_0xb8e3('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xb8e3('0xa'));var querystring=require(_0xb8e3('0x10'));var Papa=require(_0xb8e3('0x11'));var Redis=require('ioredis');var authService=require(_0xb8e3('0x12'));var qs=require(_0xb8e3('0x13'));var as=require(_0xb8e3('0x14'));var hardwareService=require(_0xb8e3('0x15'));var logger=require('../../config/logger')(_0xb8e3('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb8e3('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x144a57,_0x479d31){_0x479d31=_0x479d31||0xcc;return function(_0x2ea5e7){if(_0x2ea5e7){return _0x144a57[_0xb8e3('0x18')](_0x479d31);}return _0x144a57[_0xb8e3('0x19')](_0x479d31)[_0xb8e3('0x1a')]();};}function respondWithResult(_0x5c4f8a,_0x289153){_0x289153=_0x289153||0xc8;return function(_0x557837){if(_0x557837){return _0x5c4f8a['status'](_0x289153)['json'](_0x557837);}};}function respondWithFilteredResult(_0x578c3b,_0x485ac4){return function(_0x24f4ae){if(_0x24f4ae){var _0x245c95=typeof _0x485ac4[_0xb8e3('0x1b')]===_0xb8e3('0x1c')&&typeof _0x485ac4[_0xb8e3('0x1d')]==='undefined';var _0x150046=_0x24f4ae['count'];var _0x241bb0=_0x245c95?0x0:_0x485ac4[_0xb8e3('0x1b')];var _0x2957aa=_0x245c95?_0x24f4ae['count']:_0x485ac4[_0xb8e3('0x1b')]+_0x485ac4[_0xb8e3('0x1d')];var _0x2157f4;if(_0x2957aa>=_0x150046){_0x2957aa=_0x150046;_0x2157f4=0xc8;}else{_0x2157f4=0xce;}_0x578c3b[_0xb8e3('0x19')](_0x2157f4);return _0x578c3b[_0xb8e3('0x1e')](_0xb8e3('0x1f'),_0x241bb0+'-'+_0x2957aa+'/'+_0x150046)['json'](_0x24f4ae);}return null;};}function patchUpdates(_0x8a9c20){return function(_0x1607eb){try{jsonpatch['apply'](_0x1607eb,_0x8a9c20,!![]);}catch(_0xb29572){return BPromise[_0xb8e3('0x20')](_0xb29572);}return _0x1607eb[_0xb8e3('0x21')]();};}function saveUpdates(_0x4aaa9f,_0x23bc1c){return function(_0x442c5b){if(_0x442c5b){return _0x442c5b['update'](_0x4aaa9f)['then'](function(_0x5c5e2e){return _0x5c5e2e;});}return null;};}function removeEntity(_0x96c749,_0x2cc145){return function(_0x11090a){if(_0x11090a){return _0x11090a[_0xb8e3('0x22')]()[_0xb8e3('0x23')](function(){_0x96c749[_0xb8e3('0x19')](0xcc)[_0xb8e3('0x1a')]();});}};}function handleEntityNotFound(_0x12f5d1,_0x2c3897){return function(_0x13c61f){if(!_0x13c61f){_0x12f5d1['sendStatus'](0x194);}return _0x13c61f;};}function handleError(_0x5c43aa,_0x281e43){_0x281e43=_0x281e43||0x1f4;return function(_0x23dc82){logger['error'](_0x23dc82[_0xb8e3('0x24')]);if(_0x23dc82[_0xb8e3('0x25')]){delete _0x23dc82[_0xb8e3('0x25')];}_0x5c43aa[_0xb8e3('0x19')](_0x281e43)[_0xb8e3('0x26')](_0x23dc82);};}exports[_0xb8e3('0x27')]=function(_0x5017a4,_0x127d9e){var _0x155045={},_0x5275da={},_0x43fa26={'count':0x0,'rows':[]};var _0x28bef5=_[_0xb8e3('0x28')](db['CmCustomField']['rawAttributes'],function(_0x38aabd){return{'name':_0x38aabd['fieldName'],'type':_0x38aabd[_0xb8e3('0x29')][_0xb8e3('0x2a')]};});_0x5275da[_0xb8e3('0x2b')]=_[_0xb8e3('0x2c')](_[_0xb8e3('0x28')](_0x28bef5,'name'),[_0xb8e3('0x25')]);_0x5275da[_0xb8e3('0x2d')]=_['keys'](_0x5017a4[_0xb8e3('0x2d')]);_0x5275da[_0xb8e3('0x2e')]=_[_0xb8e3('0x2f')](_0x5275da[_0xb8e3('0x2b')],_0x5275da[_0xb8e3('0x2d')]);_0x155045[_0xb8e3('0x30')]=_[_0xb8e3('0x2f')](_0x5275da[_0xb8e3('0x2b')],qs[_0xb8e3('0x31')](_0x5017a4[_0xb8e3('0x2d')][_0xb8e3('0x31')]));_0x155045[_0xb8e3('0x30')]=_0x155045[_0xb8e3('0x30')][_0xb8e3('0x32')]?_0x155045[_0xb8e3('0x30')]:_0x5275da[_0xb8e3('0x2b')];if(!_0x5017a4[_0xb8e3('0x2d')][_0xb8e3('0x33')](_0xb8e3('0x34'))){_0x155045[_0xb8e3('0x1d')]=qs[_0xb8e3('0x1d')](_0x5017a4[_0xb8e3('0x2d')][_0xb8e3('0x1d')]);_0x155045[_0xb8e3('0x1b')]=qs[_0xb8e3('0x1b')](_0x5017a4[_0xb8e3('0x2d')][_0xb8e3('0x1b')]);}_0x155045[_0xb8e3('0x35')]=qs[_0xb8e3('0x36')](_0x5017a4[_0xb8e3('0x2d')][_0xb8e3('0x36')]);_0x155045[_0xb8e3('0x37')]=qs[_0xb8e3('0x2e')](_[_0xb8e3('0x38')](_0x5017a4[_0xb8e3('0x2d')],_0x5275da[_0xb8e3('0x2e')]),_0x28bef5);if(_0x5017a4[_0xb8e3('0x2d')][_0xb8e3('0x39')]){_0x155045[_0xb8e3('0x37')]=_['merge'](_0x155045['where'],{'$or':_[_0xb8e3('0x28')](_0x28bef5,function(_0xe699fc){if(_0xe699fc[_0xb8e3('0x29')]!==_0xb8e3('0x3a')){var _0x3caa78={};_0x3caa78[_0xe699fc[_0xb8e3('0x25')]]={'$like':'%'+_0x5017a4[_0xb8e3('0x2d')][_0xb8e3('0x39')]+'%'};return _0x3caa78;}})});}_0x155045=_[_0xb8e3('0x3b')]({},_0x155045,_0x5017a4['options']);var _0xd25234={'where':_0x155045['where']};return db[_0xb8e3('0x3c')][_0xb8e3('0x3d')](_0xd25234)[_0xb8e3('0x23')](function(_0x410b3a){_0x43fa26[_0xb8e3('0x3d')]=_0x410b3a;if(_0x5017a4[_0xb8e3('0x2d')][_0xb8e3('0x3e')]){_0x155045[_0xb8e3('0x3f')]=[{'all':!![]}];}return db['CmCustomField']['findAll'](_0x155045);})['then'](function(_0x4f3b80){_0x43fa26[_0xb8e3('0x40')]=_0x4f3b80;return _0x43fa26;})[_0xb8e3('0x23')](respondWithFilteredResult(_0x127d9e,_0x155045))[_0xb8e3('0x41')](handleError(_0x127d9e,null));};exports[_0xb8e3('0x42')]=function(_0x4815cb,_0x260bf1){var _0x18f2b7={'raw':!![],'where':{'id':_0x4815cb[_0xb8e3('0x43')]['id']}},_0x56259e={};_0x56259e['model']=_[_0xb8e3('0x44')](db[_0xb8e3('0x3c')][_0xb8e3('0x45')]);_0x56259e[_0xb8e3('0x2d')]=_[_0xb8e3('0x44')](_0x4815cb[_0xb8e3('0x2d')]);_0x56259e['filters']=_['intersection'](_0x56259e['model'],_0x56259e['query']);_0x18f2b7[_0xb8e3('0x30')]=_['intersection'](_0x56259e[_0xb8e3('0x2b')],qs[_0xb8e3('0x31')](_0x4815cb['query']['fields']));_0x18f2b7[_0xb8e3('0x30')]=_0x18f2b7[_0xb8e3('0x30')]['length']?_0x18f2b7[_0xb8e3('0x30')]:_0x56259e[_0xb8e3('0x2b')];if(_0x4815cb[_0xb8e3('0x2d')]['includeAll']){_0x18f2b7[_0xb8e3('0x3f')]=[{'all':!![]}];}_0x18f2b7=_[_0xb8e3('0x3b')]({},_0x18f2b7,_0x4815cb[_0xb8e3('0x46')]);return db[_0xb8e3('0x3c')][_0xb8e3('0x47')](_0x18f2b7)['then'](handleEntityNotFound(_0x260bf1,null))[_0xb8e3('0x23')](respondWithResult(_0x260bf1,null))[_0xb8e3('0x41')](handleError(_0x260bf1,null));};exports[_0xb8e3('0x48')]=function(_0x10402e,_0x456242){if(_0x10402e[_0xb8e3('0x49')]['id']){delete _0x10402e[_0xb8e3('0x49')]['id'];}return db[_0xb8e3('0x3c')]['find']({'where':{'id':_0x10402e['params']['id']}})[_0xb8e3('0x23')](handleEntityNotFound(_0x456242,null))['then'](saveUpdates(_0x10402e[_0xb8e3('0x49')],null))[_0xb8e3('0x23')](respondWithResult(_0x456242,null))[_0xb8e3('0x41')](handleError(_0x456242,null));};exports[_0xb8e3('0x22')]=function(_0x542b9b,_0xb557a1){return db['CmCustomField']['find']({'where':{'id':_0x542b9b[_0xb8e3('0x43')]['id']}})['then'](handleEntityNotFound(_0xb557a1,null))['then'](removeEntity(_0xb557a1,null))[_0xb8e3('0x41')](handleError(_0xb557a1,null));};exports['create']=function(_0x5bb8f9,_0x156ec7){var _0x395aa8;return db['sequelize'][_0xb8e3('0x4a')](function(_0x35cafc){return db[_0xb8e3('0x3c')][_0xb8e3('0x4b')](_0x5bb8f9[_0xb8e3('0x49')],{'transaction':_0x35cafc})[_0xb8e3('0x23')](function(_0xd3bd35){_0x395aa8=_0xd3bd35;var _0x3e57ee={'type':db[_0xb8e3('0x4c')][_0xb8e3('0x4d')],'transaction':_0x35cafc};switch(_0x5bb8f9['body'][_0xb8e3('0x29')]){case'text':_0x3e57ee[_0xb8e3('0x29')]=db[_0xb8e3('0x4c')][_0xb8e3('0x4d')];break;case _0xb8e3('0x4e'):_0x3e57ee[_0xb8e3('0x29')]=db[_0xb8e3('0x4c')][_0xb8e3('0x4f')];break;case _0xb8e3('0x50'):_0x3e57ee[_0xb8e3('0x29')]=db[_0xb8e3('0x4c')][_0xb8e3('0x51')];_0x3e57ee[_0xb8e3('0x52')]=![];break;default:}return db[_0xb8e3('0x53')]['queryInterface'][_0xb8e3('0x54')](_0xb8e3('0x55'),util[_0xb8e3('0x56')]('cf_%d',_0x395aa8['id']),_0x3e57ee);})[_0xb8e3('0x23')](function(){return _0x395aa8;});})[_0xb8e3('0x23')](respondWithResult(_0x156ec7,0xc9))[_0xb8e3('0x41')](handleError(_0x156ec7,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index c0915fc..6680b1a 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 _0x806c=['./cmCustomField.attributes','exports','CmCustomField','cm_custom_fields','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x806c,0x13c));var _0xc806=function(_0x2ef44b,_0x553359){_0x2ef44b=_0x2ef44b-0x0;var _0x2405b9=_0x806c[_0x2ef44b];return _0x2405b9;};'use strict';var _=require(_0xc806('0x0'));var util=require(_0xc806('0x1'));var logger=require('../../config/logger')(_0xc806('0x2'));var moment=require(_0xc806('0x3'));var BPromise=require(_0xc806('0x4'));var rp=require(_0xc806('0x5'));var fs=require('fs');var path=require(_0xc806('0x6'));var rimraf=require(_0xc806('0x7'));var config=require(_0xc806('0x8'));var attributes=require(_0xc806('0x9'));module[_0xc806('0xa')]=function(_0x4b26ef,_0x1003b2){return _0x4b26ef['define'](_0xc806('0xb'),attributes,{'tableName':_0xc806('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3a9c=['../../config/logger','bluebird','rimraf','../../config/environment','./cmCustomField.attributes','exports','CmCustomField','util'];(function(_0x16e569,_0x33f836){var _0x22470a=function(_0x4b7c33){while(--_0x4b7c33){_0x16e569['push'](_0x16e569['shift']());}};_0x22470a(++_0x33f836);}(_0x3a9c,0x77));var _0xc3a9=function(_0x166607,_0x251a9b){_0x166607=_0x166607-0x0;var _0x1381ef=_0x3a9c[_0x166607];return _0x1381ef;};'use strict';var _=require('lodash');var util=require(_0xc3a9('0x0'));var logger=require(_0xc3a9('0x1'))('api');var moment=require('moment');var BPromise=require(_0xc3a9('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc3a9('0x3'));var config=require(_0xc3a9('0x4'));var attributes=require(_0xc3a9('0x5'));module[_0xc3a9('0x6')]=function(_0x5c4f39,_0x68de2c){return _0x5c4f39['define'](_0xc3a9('0x7'),attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index 89cf55e..0aa8a68 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 _0x4eec=['http','request','then','CmCustomField,\x20%s,\x20%s','debug','CmCustomField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x26b80e,_0x5c9333){var _0x84a8a8=function(_0x2e5b4a){while(--_0x2e5b4a){_0x26b80e['push'](_0x26b80e['shift']());}};_0x84a8a8(++_0x5c9333);}(_0x4eec,0x12b));var _0xc4ee=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4eec[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc4ee('0x0'));var util=require('util');var moment=require(_0xc4ee('0x1'));var BPromise=require('bluebird');var rs=require(_0xc4ee('0x2'));var fs=require('fs');var Redis=require(_0xc4ee('0x3'));var db=require(_0xc4ee('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc4ee('0x5'))(_0xc4ee('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xc4ee('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x835121,_0x4bcd74,_0x4a92a7){return new BPromise(function(_0x48feed,_0x19a384){return client[_0xc4ee('0x8')](_0x835121,_0x4a92a7)[_0xc4ee('0x9')](function(_0x378c36){logger['info'](_0xc4ee('0xa'),_0x4bcd74,'request\x20sent');logger[_0xc4ee('0xb')](_0xc4ee('0xc'),_0x4bcd74,'request\x20sent',JSON['stringify'](_0x378c36));if(_0x378c36[_0xc4ee('0xd')]){if(_0x378c36[_0xc4ee('0xd')][_0xc4ee('0xe')]===0x1f4){logger[_0xc4ee('0xd')](_0xc4ee('0xa'),_0x4bcd74,_0x378c36[_0xc4ee('0xd')][_0xc4ee('0xf')]);return _0x19a384(_0x378c36['error'][_0xc4ee('0xf')]);}logger[_0xc4ee('0xd')](_0xc4ee('0xa'),_0x4bcd74,_0x378c36[_0xc4ee('0xd')][_0xc4ee('0xf')]);return _0x48feed(_0x378c36[_0xc4ee('0xd')][_0xc4ee('0xf')]);}else{logger['info']('CmCustomField,\x20%s,\x20%s',_0x4bcd74,'request\x20sent');_0x48feed(_0x378c36[_0xc4ee('0x10')][_0xc4ee('0xf')]);}})[_0xc4ee('0x11')](function(_0x549f08){logger[_0xc4ee('0xd')](_0xc4ee('0xa'),_0x4bcd74,_0x549f08);_0x19a384(_0x549f08);});});} \ No newline at end of file +var _0x1415=['../../config/environment','http','info','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','CmCustomField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc'];(function(_0x1c8c28,_0x3ee093){var _0x1f59b4=function(_0x29bcc0){while(--_0x29bcc0){_0x1c8c28['push'](_0x1c8c28['shift']());}};_0x1f59b4(++_0x3ee093);}(_0x1415,0x11e));var _0x5141=function(_0x3e292f,_0x52d5bb){_0x3e292f=_0x3e292f-0x0;var _0x2a8fb4=_0x1415[_0x3e292f];return _0x2a8fb4;};'use strict';var _=require(_0x5141('0x0'));var util=require(_0x5141('0x1'));var moment=require(_0x5141('0x2'));var BPromise=require(_0x5141('0x3'));var rs=require(_0x5141('0x4'));var fs=require('fs');var Redis=require(_0x5141('0x5'));var db=require(_0x5141('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5141('0x7'));var config=require(_0x5141('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5141('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xfde040,_0x389fbf,_0x149441){return new BPromise(function(_0x104abf,_0x26c4cd){return client['request'](_0xfde040,_0x149441)['then'](function(_0x257db3){logger[_0x5141('0xa')]('CmCustomField,\x20%s,\x20%s',_0x389fbf,_0x5141('0xb'));logger[_0x5141('0xc')](_0x5141('0xd'),_0x389fbf,'request\x20sent',JSON[_0x5141('0xe')](_0x257db3));if(_0x257db3[_0x5141('0xf')]){if(_0x257db3[_0x5141('0xf')][_0x5141('0x10')]===0x1f4){logger[_0x5141('0xf')](_0x5141('0x11'),_0x389fbf,_0x257db3[_0x5141('0xf')][_0x5141('0x12')]);return _0x26c4cd(_0x257db3[_0x5141('0xf')][_0x5141('0x12')]);}logger['error']('CmCustomField,\x20%s,\x20%s',_0x389fbf,_0x257db3[_0x5141('0xf')][_0x5141('0x12')]);return _0x104abf(_0x257db3[_0x5141('0xf')][_0x5141('0x12')]);}else{logger[_0x5141('0xa')]('CmCustomField,\x20%s,\x20%s',_0x389fbf,'request\x20sent');_0x104abf(_0x257db3[_0x5141('0x13')][_0x5141('0x12')]);}})[_0x5141('0x14')](function(_0x4427b9){logger[_0x5141('0xf')](_0x5141('0x11'),_0x389fbf,_0x4427b9);_0x26c4cd(_0x4427b9);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 714e198..d14c082 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 _0x7163=['../../components/interaction/service','../../config/environment','./cmCustomField.controller','index','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x7163,0x1ef));var _0x3716=function(_0x3c4a7c,_0x2f4e3c){_0x3c4a7c=_0x3c4a7c-0x0;var _0xf13d1e=_0x7163[_0x3c4a7c];return _0xf13d1e;};'use strict';var multer=require(_0x3716('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3716('0x1'));var express=require(_0x3716('0x2'));var router=express[_0x3716('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3716('0x4'));var interaction=require(_0x3716('0x5'));var config=require(_0x3716('0x6'));var controller=require(_0x3716('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x3716('0x8')]);router[_0x3716('0x9')](_0x3716('0xa'),auth[_0x3716('0xb')](),controller[_0x3716('0xc')]);router[_0x3716('0xd')]('/',auth[_0x3716('0xb')](),controller[_0x3716('0xe')]);router[_0x3716('0xf')](_0x3716('0xa'),auth[_0x3716('0xb')](),controller[_0x3716('0x10')]);router[_0x3716('0x11')](_0x3716('0xa'),auth[_0x3716('0xb')](),controller[_0x3716('0x12')]);module[_0x3716('0x13')]=router; \ No newline at end of file +var _0x63b6=['get','show','post','create','put','update','delete','/:id','destroy','exports','multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./cmCustomField.controller','isAuthenticated'];(function(_0x3af7a9,_0x3909c3){var _0x5db91b=function(_0x12f796){while(--_0x12f796){_0x3af7a9['push'](_0x3af7a9['shift']());}};_0x5db91b(++_0x3909c3);}(_0x63b6,0x127));var _0x663b=function(_0x5ac8a0,_0x46420b){_0x5ac8a0=_0x5ac8a0-0x0;var _0x1401fd=_0x63b6[_0x5ac8a0];return _0x1401fd;};'use strict';var multer=require(_0x663b('0x0'));var util=require(_0x663b('0x1'));var path=require(_0x663b('0x2'));var timeout=require('connect-timeout');var express=require(_0x663b('0x3'));var router=express['Router']();var fs_extra=require(_0x663b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x663b('0x5'));var config=require(_0x663b('0x6'));var controller=require(_0x663b('0x7'));router['get']('/',auth[_0x663b('0x8')](),controller['index']);router[_0x663b('0x9')]('/:id',auth[_0x663b('0x8')](),controller[_0x663b('0xa')]);router[_0x663b('0xb')]('/',auth[_0x663b('0x8')](),controller[_0x663b('0xc')]);router[_0x663b('0xd')]('/:id',auth[_0x663b('0x8')](),controller[_0x663b('0xe')]);router[_0x663b('0xf')](_0x663b('0x10'),auth[_0x663b('0x8')](),controller[_0x663b('0x11')]);module[_0x663b('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index df25637..d1e4a30 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 _0xba8b=['STRING','BOOLEAN','DATE','format','INTEGER','UNSIGNED','contactListQueue','sequelize','exports'];(function(_0x2702fc,_0x379255){var _0x47bfc6=function(_0x512bc7){while(--_0x512bc7){_0x2702fc['push'](_0x2702fc['shift']());}};_0x47bfc6(++_0x379255);}(_0xba8b,0x1b7));var _0xbba8=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xba8b[_0x27af45];return _0x18df21;};'use strict';var moment=require('moment');var Sequelize=require(_0xbba8('0x0'));module[_0xbba8('0x1')]={'phone':{'type':Sequelize[_0xbba8('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0xbba8('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xbba8('0x4')],'defaultValue':moment()[_0xbba8('0x5')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0xbba8('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xbba8('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0xbba8('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xbba8('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xbba8('0x4')]},'priority':{'type':Sequelize[_0xbba8('0x6')](0x2)[_0xbba8('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xbba8('0x6')],'unique':_0xbba8('0x8')},'ListId':{'type':Sequelize[_0xbba8('0x6')],'unique':_0xbba8('0x8')},'UserId':{'type':Sequelize[_0xbba8('0x6')]},'VoiceQueueId':{'type':Sequelize[_0xbba8('0x6')],'unique':_0xbba8('0x8')},'CampaignId':{'type':Sequelize[_0xbba8('0x6')]},'countnosuchnumberretry':{'type':Sequelize[_0xbba8('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xbba8('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xbba8('0x6')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0xbba8('0x6')],'allowNull':!![],'defaultValue':0x0}}; \ No newline at end of file +var _0x4390=['UNSIGNED','contactListQueue','moment','exports','BOOLEAN','DATE','format','INTEGER'];(function(_0x330c3d,_0x2a51d2){var _0x375ea3=function(_0x36bb7f){while(--_0x36bb7f){_0x330c3d['push'](_0x330c3d['shift']());}};_0x375ea3(++_0x2a51d2);}(_0x4390,0x14a));var _0x0439=function(_0x556b1e,_0x377edc){_0x556b1e=_0x556b1e-0x0;var _0x44442b=_0x4390[_0x556b1e];return _0x44442b;};'use strict';var moment=require(_0x0439('0x0'));var Sequelize=require('sequelize');module[_0x0439('0x1')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0x0439('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x0439('0x3')],'defaultValue':moment()[_0x0439('0x4')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x0439('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x0439('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x0439('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x0439('0x2')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x0439('0x3')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x0439('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x0439('0x2')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x0439('0x5')],'unique':_0x0439('0x7')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x0439('0x7')},'UserId':{'type':Sequelize[_0x0439('0x5')]},'VoiceQueueId':{'type':Sequelize[_0x0439('0x5')],'unique':_0x0439('0x7')},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize[_0x0439('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x0439('0x5')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x0439('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x0439('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x0439('0x5')],'allowNull':!![],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index 261ea28..5881dc0 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 _0x9957=['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','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','$and','$lt','$lte','$eq','$between','$notBetween','$in','$notLike','$like','$overlap','$contained','$any','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','CmHopper','includeAll','include','rows','catch','params','rawAttributes','length','options','find','create','body','update','describe','VoiceQueueId','VoiceQueue','Campaign','CampaignId','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','campaign','user','UserId','format','YYYY-MM-DD\x20HH:mm:ss','phone','campaigntype','queue','ivr','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','end','CmContact','getVoiceQueues','outbound','preview','transaction','direction','isEmpty','hopperIds','priority','ASC','DESC','sequelize','COALESCE(CmHopper.UserId,\x200)\x20ASC','scheduledAt','dialOrderByScheduledAt','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','UPDATE','Contact','CmCompany','Company','CmList','List','Queue','dialActive','getOpenContacts','isNumber','entity\x20not\x20found','eml-format'];(function(_0x300e8,_0x528266){var _0x346471=function(_0x3c8224){while(--_0x3c8224){_0x300e8['push'](_0x300e8['shift']());}};_0x346471(++_0x528266);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'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['CmHopper']['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')]);_0x456a28[_0x7995('0x32')]=_['concat'](_0x456a28[_0x7995('0x32')],[_0x7995('0x35'),'$or','$gt','$gte',_0x7995('0x36'),_0x7995('0x37'),'$ne',_0x7995('0x38'),'$not',_0x7995('0x39'),_0x7995('0x3a'),_0x7995('0x3b'),'$notIn','$like',_0x7995('0x3c'),'$iLike','$notILike',_0x7995('0x3d'),_0x7995('0x3e'),'$contains',_0x7995('0x3f'),_0x7995('0x40')]);_0x514445[_0x7995('0x41')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],qs['fields'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x42')]));_0x514445[_0x7995('0x41')]=_0x514445[_0x7995('0x41')]['length']?_0x514445[_0x7995('0x41')]:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99[_0x7995('0x34')][_0x7995('0x43')](_0x7995('0x44'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x21')]);_0x514445[_0x7995('0x20')]=qs[_0x7995('0x20')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445[_0x7995('0x45')]=qs[_0x7995('0x46')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x46')]);_0x514445[_0x7995('0x47')]=qs[_0x7995('0x32')](_[_0x7995('0x48')](_0x4b6f99['query'],_0x456a28['filters']),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x49')]){_0x514445['where']=_['merge'](_0x514445[_0x7995('0x47')],{'$or':_['map'](_0x4253e5,function(_0x504a33){if(_0x504a33[_0x7995('0x2d')]!==_0x7995('0x4a')){var _0x35c8ff={};_0x35c8ff[_0x504a33['name']]={'$like':'%'+_0x4b6f99[_0x7995('0x34')]['filter']+'%'};return _0x35c8ff;}})});}_0x514445=_[_0x7995('0x4b')]({},_0x514445,_0x4b6f99['options']);var _0x493066={'where':_0x514445[_0x7995('0x47')]};return db[_0x7995('0x4c')][_0x7995('0x1f')](_0x493066)[_0x7995('0x26')](function(_0x599ecb){_0x3250e0[_0x7995('0x1f')]=_0x599ecb;if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x4d')]){_0x514445[_0x7995('0x4e')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x514445);})[_0x7995('0x26')](function(_0x55791b){_0x3250e0[_0x7995('0x4f')]=_0x55791b;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))[_0x7995('0x50')](handleError(_0x9b2a15,null));};exports['show']=function(_0x1e795e,_0x1b0373){var _0x4d9245={'raw':!![],'where':{'id':_0x1e795e[_0x7995('0x51')]['id']}},_0x3e9e62={};_0x3e9e62[_0x7995('0x2f')]=_[_0x7995('0x31')](db['CmHopper'][_0x7995('0x52')]);_0x3e9e62[_0x7995('0x34')]=_[_0x7995('0x31')](_0x1e795e['query']);_0x3e9e62[_0x7995('0x32')]=_[_0x7995('0x33')](_0x3e9e62[_0x7995('0x2f')],_0x3e9e62[_0x7995('0x34')]);_0x4d9245[_0x7995('0x41')]=_['intersection'](_0x3e9e62[_0x7995('0x2f')],qs[_0x7995('0x42')](_0x1e795e['query'][_0x7995('0x42')]));_0x4d9245['attributes']=_0x4d9245[_0x7995('0x41')][_0x7995('0x53')]?_0x4d9245[_0x7995('0x41')]:_0x3e9e62[_0x7995('0x2f')];if(_0x1e795e[_0x7995('0x34')][_0x7995('0x4d')]){_0x4d9245[_0x7995('0x4e')]=[{'all':!![]}];}_0x4d9245=_['merge']({},_0x4d9245,_0x1e795e[_0x7995('0x54')]);return db[_0x7995('0x4c')][_0x7995('0x55')](_0x4d9245)['then'](handleEntityNotFound(_0x1b0373,null))[_0x7995('0x26')](respondWithResult(_0x1b0373,null))[_0x7995('0x50')](handleError(_0x1b0373,null));};exports[_0x7995('0x56')]=function(_0x47d1d8,_0x4ec548){return db['CmHopper'][_0x7995('0x56')](_0x47d1d8[_0x7995('0x57')],{})['then'](respondWithResult(_0x4ec548,0xc9))[_0x7995('0x50')](handleError(_0x4ec548,null));};exports[_0x7995('0x58')]=function(_0x31f27c,_0x1a9bd7){if(_0x31f27c[_0x7995('0x57')]['id']){delete _0x31f27c['body']['id'];}return db[_0x7995('0x4c')]['find']({'where':{'id':_0x31f27c[_0x7995('0x51')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x1a9bd7,null))[_0x7995('0x26')](saveUpdates(_0x31f27c['body'],null))['then'](respondWithResult(_0x1a9bd7,null))['catch'](handleError(_0x1a9bd7,null));};exports['describe']=function(_0x2e13b0,_0x3709de){return db[_0x7995('0x4c')][_0x7995('0x59')]()[_0x7995('0x26')](respondWithResult(_0x3709de,null))[_0x7995('0x50')](handleError(_0x3709de,null));};exports[_0x7995('0x27')]=function(_0xda6ce8,_0x328671){var _0x17ecd3;var _0xa7af8c=_0xda6ce8[_0x7995('0x51')]['id'];return db[_0x7995('0x4c')][_0x7995('0x55')]({'where':{'id':_0xda6ce8[_0x7995('0x51')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x328671,null))[_0x7995('0x26')](function(_0x223e08){if(_0x223e08){return _0x223e08[_0x7995('0x27')]()['then'](function(_0x56a374){return _0x56a374;});}})[_0x7995('0x26')](function(_0x3b8a54){_0x17ecd3=_0x3b8a54;if(_0x3b8a54){if(_0x3b8a54[_0x7995('0x5a')]||_0x3b8a54['CampaignId']){return db[_0x3b8a54['VoiceQueueId']?_0x7995('0x5b'):_0x7995('0x5c')][_0x7995('0x55')]({'where':{'id':_0x3b8a54[_0x7995('0x5a')]?_0x3b8a54['VoiceQueueId']:_0x3b8a54[_0x7995('0x5d')]},'attributes':['id',_0x7995('0x29')],'raw':!![]});}}})[_0x7995('0x26')](function(_0x33c49c){var _0x502d43={};if(_0x33c49c){_['merge'](_0x502d43,_[_0x7995('0x5e')](_0x17ecd3[_0x7995('0x5f')],[_0x7995('0x60'),_0x7995('0x61'),'id']));_0x502d43[_0x7995('0x62')]=0x15;_0x502d43[_0x7995('0x63')]=_0x7995('0x64');_0x502d43[_0x7995('0x65')]=_0x33c49c[_0x7995('0x29')];_0x502d43['membername']=_0xda6ce8[_0x7995('0x66')][_0x7995('0x29')];_0x502d43[_0x7995('0x67')]=_0xda6ce8[_0x7995('0x66')]['id'];_0x502d43['deleted']=!![];_0x502d43['deletedat']=moment()[_0x7995('0x68')](_0x7995('0x69'));_0x502d43['calleridnum']=_0x17ecd3[_0x7995('0x6a')];_0x502d43[_0x7995('0x6b')]=_0x17ecd3[_0x7995('0x5a')]?_0x7995('0x6c'):_0x7995('0x6d');return db['CmContact'][_0x7995('0x55')]({'where':{'id':_0x502d43['ContactId']},'attributes':[_0x7995('0x6e'),_0x7995('0x6f')]})[_0x7995('0x26')](function(_0x25b534){if(!_[_0x7995('0x70')](_0x328671)&&!_[_0x7995('0x70')](_0x25b534[_0x7995('0x6e')])){_0x502d43[_0x7995('0x71')]=_0x25b534[_0x7995('0x6e')];if(!_[_0x7995('0x70')](_0x25b534[_0x7995('0x6f')])){_0x502d43[_0x7995('0x71')]+='\x20'+_0x25b534['lastName'];}}})[_0x7995('0x72')](function(){return db[_0x7995('0x73')][_0x7995('0x56')](_0x502d43);});}})[_0x7995('0x26')](function(_0x2c6548){return db['CmHopperAdditionalPhone']['destroy']({'where':{'CmHopperId':_0xa7af8c}});})[_0x7995('0x26')](function(){return _0x328671[_0x7995('0x1c')](0xcc)[_0x7995('0x74')]();})[_0x7995('0x50')](handleError(_0x328671,null));};exports['getPreview']=function(_0x22d317,_0x50a12e,_0x5df621){var _0xca8238=[];return db[_0x7995('0x75')][_0x7995('0x59')]()[_0x7995('0x26')](function(_0x290eae){_0xca8238=_[_0x7995('0x31')](_0x290eae);return _0x22d317[_0x7995('0x66')][_0x7995('0x76')]({'where':{'type':_0x7995('0x77'),'dialActive':!![],'dialMethod':_0x7995('0x78')},'attributes':['id','dialOrderByScheduledAt'],'raw':!![]});})[_0x7995('0x26')](function(_0x8908cd){if(_0x8908cd&&_0x8908cd[_0x7995('0x53')]){return db['sequelize'][_0x7995('0x79')](function(_0x1d2f9d){var _0x705f0={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x7995('0x68')](_0x7995('0x69'))},'VoiceQueueId':{'$in':_[_0x7995('0x30')](_0x8908cd,'id')},'$or':[{'UserId':null},{'UserId':_0x22d317[_0x7995('0x66')]['id']}]};var _0x3adfd2=[];if(_0x22d317[_0x7995('0x57')][_0x7995('0x7a')]&&_0x22d317[_0x7995('0x57')]['direction']==='prev'){if(!_[_0x7995('0x7b')](_0x22d317[_0x7995('0x57')][_0x7995('0x7c')])){_0x705f0['id']={'$in':_0x22d317[_0x7995('0x57')]['hopperIds']};}_0x3adfd2=[[_0x7995('0x7d'),_0x7995('0x7e')],['scheduledAt',_0x8908cd[0x0]['dialOrderByScheduledAt']===_0x7995('0x7e')?_0x7995('0x7f'):'ASC'],db[_0x7995('0x80')]['literal'](_0x7995('0x81')),['id',_0x7995('0x7f')]];}else{if(!_['isEmpty'](_0x22d317['body'][_0x7995('0x7c')])){_0x705f0['id']={'$notIn':_0x22d317['body'][_0x7995('0x7c')]};}_0x3adfd2=[[_0x7995('0x7d'),_0x7995('0x7f')],[_0x7995('0x82'),_0x8908cd[0x0][_0x7995('0x83')]],db[_0x7995('0x80')][_0x7995('0x84')](_0x7995('0x85')),['id',_0x7995('0x7e')]];}return db[_0x7995('0x4c')][_0x7995('0x86')]({'attributes':['id',_0x7995('0x87'),_0x7995('0x6a')],'where':_0x705f0,'order':_0x3adfd2,'transaction':_0x1d2f9d,'lock':_0x1d2f9d[_0x7995('0x88')][_0x7995('0x89')],'include':[{'model':db[_0x7995('0x75')],'as':_0x7995('0x8a'),'attributes':_0xca8238,'include':[{'model':db[_0x7995('0x8b')],'as':_0x7995('0x8c'),'attributes':['id',_0x7995('0x29')]}]},{'model':db[_0x7995('0x8d')],'as':_0x7995('0x8e'),'attributes':['id',_0x7995('0x29')]},{'model':db[_0x7995('0x5b')],'as':_0x7995('0x8f'),'attributes':['id',_0x7995('0x29'),_0x7995('0x90')]}]})[_0x7995('0x26')](function(_0x59efff){if(_0x59efff){return _0x59efff[_0x7995('0x58')]({'UserId':_0x22d317[_0x7995('0x66')]['id']},{'transaction':_0x1d2f9d});}});});}})['then'](handleEntityNotFound(_0x50a12e,null))['then'](respondWithResult(_0x50a12e,null))[_0x7995('0x50')](handleError(_0x50a12e,null));};exports[_0x7995('0x91')]=function(_0x2d45d5,_0x38acda,_0xe1ce4){return _0x2d45d5[_0x7995('0x66')]['getVoiceQueues']({'where':{'type':_0x7995('0x77'),'dialActive':!![],'dialMethod':_0x7995('0x78')},'attributes':['id'],'raw':!![]})[_0x7995('0x26')](function(_0x77b03f){if(_0x77b03f&&_0x77b03f[_0x7995('0x53')]){return db[_0x7995('0x4c')][_0x7995('0x1f')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x7995('0x68')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x7995('0x30')](_0x77b03f,'id')},'$or':[{'UserId':null},{'UserId':_0x2d45d5[_0x7995('0x66')]['id']}]}});}return 0x0;})['then'](function(_0x479271){if(!_[_0x7995('0x70')](_0x479271)&&_[_0x7995('0x92')](_0x479271)){return _0x38acda[_0x7995('0x1c')](0xc8)[_0x7995('0x1d')]({'contacts':_0x479271});}else{logger[_0x7995('0x28')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x7995('0x91'),0x194,_0x7995('0x93'));_0x38acda['sendStatus'](0x194);}})[_0x7995('0x50')](handleError(_0x38acda,null));}; \ No newline at end of file +var _0xd6d6=['deleted','campaign','user','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','CmContact','ContactId','firstName','lastName','isNil','finally','CmHopperFinal','getPreview','getVoiceQueues','outbound','preview','direction','isEmpty','hopperIds','priority','dialOrderByScheduledAt','ASC','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','sequelize','findOne','LOCK','UPDATE','Contact','CmCompany','Company','dialActive','getOpenContacts','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','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','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','CmHopper','rawAttributes','fieldName','type','key','model','query','filters','intersection','$and','$gt','$gte','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$overlap','$contains','$contained','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','findAll','rows','catch','show','params','keys','includeAll','include','options','find','create','body','describe','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','dataValues','createdAt','updatedAt'];(function(_0x162824,_0x4c8b6d){var _0x87b0a9=function(_0x242510){while(--_0x242510){_0x162824['push'](_0x162824['shift']());}};_0x87b0a9(++_0x4c8b6d);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x1b0e73,_0x3a0d34){_0x1b0e73=_0x1b0e73-0x0;var _0x4f9d8a=_0xd6d6[_0x1b0e73];return _0x4f9d8a;};'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'];function respondWithStatusCode(_0x32146d,_0xe61c36){_0xe61c36=_0xe61c36||0xcc;return function(_0x3f8542){if(_0x3f8542){return _0x32146d[_0x6d6d('0x19')](_0xe61c36);}return _0x32146d[_0x6d6d('0x1a')](_0xe61c36)[_0x6d6d('0x1b')]();};}function respondWithResult(_0x2cb2dd,_0x5f4154){_0x5f4154=_0x5f4154||0xc8;return function(_0xd09ea7){if(_0xd09ea7){return _0x2cb2dd[_0x6d6d('0x1a')](_0x5f4154)[_0x6d6d('0x1c')](_0xd09ea7);}};}function respondWithFilteredResult(_0xa3b05d,_0x29cbd8){return function(_0x5d80c0){if(_0x5d80c0){var _0x2e6fdb=typeof _0x29cbd8['offset']===_0x6d6d('0x1d')&&typeof _0x29cbd8[_0x6d6d('0x1e')]===_0x6d6d('0x1d');var _0x4bb3d1=_0x5d80c0['count'];var _0x9e1e18=_0x2e6fdb?0x0:_0x29cbd8[_0x6d6d('0x1f')];var _0x2b59d4=_0x2e6fdb?_0x5d80c0[_0x6d6d('0x20')]:_0x29cbd8['offset']+_0x29cbd8['limit'];var _0x474873;if(_0x2b59d4>=_0x4bb3d1){_0x2b59d4=_0x4bb3d1;_0x474873=0xc8;}else{_0x474873=0xce;}_0xa3b05d['status'](_0x474873);return _0xa3b05d[_0x6d6d('0x21')](_0x6d6d('0x22'),_0x9e1e18+'-'+_0x2b59d4+'/'+_0x4bb3d1)[_0x6d6d('0x1c')](_0x5d80c0);}return null;};}function patchUpdates(_0x450352){return function(_0x40d35b){try{jsonpatch[_0x6d6d('0x23')](_0x40d35b,_0x450352,!![]);}catch(_0x164c67){return BPromise[_0x6d6d('0x24')](_0x164c67);}return _0x40d35b[_0x6d6d('0x25')]();};}function saveUpdates(_0x6f64e3,_0x24b10d){return function(_0x6e58e3){if(_0x6e58e3){return _0x6e58e3[_0x6d6d('0x26')](_0x6f64e3)[_0x6d6d('0x27')](function(_0x1f7f88){return _0x1f7f88;});}return null;};}function removeEntity(_0x25a02e,_0xced622){return function(_0x583b10){if(_0x583b10){return _0x583b10[_0x6d6d('0x28')]()[_0x6d6d('0x27')](function(){_0x25a02e[_0x6d6d('0x1a')](0xcc)[_0x6d6d('0x1b')]();});}};}function handleEntityNotFound(_0xf0df7f,_0x12fab2){return function(_0x554f8e){if(!_0x554f8e){_0xf0df7f[_0x6d6d('0x19')](0x194);}return _0x554f8e;};}function handleError(_0x2b5e31,_0x235451){_0x235451=_0x235451||0x1f4;return function(_0x126ac8){logger[_0x6d6d('0x29')](_0x126ac8[_0x6d6d('0x2a')]);if(_0x126ac8[_0x6d6d('0x2b')]){delete _0x126ac8['name'];}_0x2b5e31[_0x6d6d('0x1a')](_0x235451)[_0x6d6d('0x2c')](_0x126ac8);};}exports['index']=function(_0x553645,_0x3edcce){var _0x5273cd={},_0x8a9a84={},_0x57341f={'count':0x0,'rows':[]};var _0xde3272=_[_0x6d6d('0x2d')](db[_0x6d6d('0x2e')][_0x6d6d('0x2f')],function(_0x64d1f7){return{'name':_0x64d1f7[_0x6d6d('0x30')],'type':_0x64d1f7[_0x6d6d('0x31')][_0x6d6d('0x32')]};});_0x8a9a84[_0x6d6d('0x33')]=_[_0x6d6d('0x2d')](_0xde3272,'name');_0x8a9a84[_0x6d6d('0x34')]=_['keys'](_0x553645[_0x6d6d('0x34')]);_0x8a9a84[_0x6d6d('0x35')]=_[_0x6d6d('0x36')](_0x8a9a84[_0x6d6d('0x33')],_0x8a9a84['query']);_0x8a9a84[_0x6d6d('0x35')]=_['concat'](_0x8a9a84[_0x6d6d('0x35')],[_0x6d6d('0x37'),'$or',_0x6d6d('0x38'),_0x6d6d('0x39'),_0x6d6d('0x3a'),_0x6d6d('0x3b'),_0x6d6d('0x3c'),_0x6d6d('0x3d'),_0x6d6d('0x3e'),_0x6d6d('0x3f'),_0x6d6d('0x40'),_0x6d6d('0x41'),_0x6d6d('0x42'),_0x6d6d('0x43'),_0x6d6d('0x44'),_0x6d6d('0x45'),'$notILike',_0x6d6d('0x43'),_0x6d6d('0x46'),_0x6d6d('0x47'),_0x6d6d('0x48'),'$any']);_0x5273cd['attributes']=_[_0x6d6d('0x36')](_0x8a9a84[_0x6d6d('0x33')],qs[_0x6d6d('0x49')](_0x553645['query'][_0x6d6d('0x49')]));_0x5273cd[_0x6d6d('0x4a')]=_0x5273cd[_0x6d6d('0x4a')][_0x6d6d('0x4b')]?_0x5273cd['attributes']:_0x8a9a84['model'];if(!_0x553645['query'][_0x6d6d('0x4c')](_0x6d6d('0x4d'))){_0x5273cd[_0x6d6d('0x1e')]=qs[_0x6d6d('0x1e')](_0x553645['query'][_0x6d6d('0x1e')]);_0x5273cd[_0x6d6d('0x1f')]=qs[_0x6d6d('0x1f')](_0x553645[_0x6d6d('0x34')][_0x6d6d('0x1f')]);}_0x5273cd[_0x6d6d('0x4e')]=qs['sort'](_0x553645[_0x6d6d('0x34')][_0x6d6d('0x4f')]);_0x5273cd[_0x6d6d('0x50')]=qs[_0x6d6d('0x35')](_[_0x6d6d('0x51')](_0x553645[_0x6d6d('0x34')],_0x8a9a84[_0x6d6d('0x35')]),_0xde3272);if(_0x553645['query'][_0x6d6d('0x52')]){_0x5273cd[_0x6d6d('0x50')]=_[_0x6d6d('0x53')](_0x5273cd[_0x6d6d('0x50')],{'$or':_[_0x6d6d('0x2d')](_0xde3272,function(_0x5d9268){if(_0x5d9268[_0x6d6d('0x31')]!==_0x6d6d('0x54')){var _0x55dba8={};_0x55dba8[_0x5d9268[_0x6d6d('0x2b')]]={'$like':'%'+_0x553645['query'][_0x6d6d('0x52')]+'%'};return _0x55dba8;}})});}_0x5273cd=_[_0x6d6d('0x53')]({},_0x5273cd,_0x553645['options']);var _0x2c191b={'where':_0x5273cd[_0x6d6d('0x50')]};return db[_0x6d6d('0x2e')][_0x6d6d('0x20')](_0x2c191b)[_0x6d6d('0x27')](function(_0x513506){_0x57341f['count']=_0x513506;if(_0x553645[_0x6d6d('0x34')]['includeAll']){_0x5273cd['include']=[{'all':!![]}];}return db[_0x6d6d('0x2e')][_0x6d6d('0x55')](_0x5273cd);})[_0x6d6d('0x27')](function(_0x49aa5d){_0x57341f[_0x6d6d('0x56')]=_0x49aa5d;return _0x57341f;})['then'](respondWithFilteredResult(_0x3edcce,_0x5273cd))[_0x6d6d('0x57')](handleError(_0x3edcce,null));};exports[_0x6d6d('0x58')]=function(_0x1d3826,_0x4606eb){var _0x75f298={'raw':!![],'where':{'id':_0x1d3826[_0x6d6d('0x59')]['id']}},_0x2669f0={};_0x2669f0['model']=_[_0x6d6d('0x5a')](db[_0x6d6d('0x2e')][_0x6d6d('0x2f')]);_0x2669f0[_0x6d6d('0x34')]=_[_0x6d6d('0x5a')](_0x1d3826[_0x6d6d('0x34')]);_0x2669f0[_0x6d6d('0x35')]=_[_0x6d6d('0x36')](_0x2669f0[_0x6d6d('0x33')],_0x2669f0['query']);_0x75f298['attributes']=_[_0x6d6d('0x36')](_0x2669f0[_0x6d6d('0x33')],qs[_0x6d6d('0x49')](_0x1d3826[_0x6d6d('0x34')][_0x6d6d('0x49')]));_0x75f298['attributes']=_0x75f298[_0x6d6d('0x4a')][_0x6d6d('0x4b')]?_0x75f298[_0x6d6d('0x4a')]:_0x2669f0[_0x6d6d('0x33')];if(_0x1d3826[_0x6d6d('0x34')][_0x6d6d('0x5b')]){_0x75f298[_0x6d6d('0x5c')]=[{'all':!![]}];}_0x75f298=_[_0x6d6d('0x53')]({},_0x75f298,_0x1d3826[_0x6d6d('0x5d')]);return db[_0x6d6d('0x2e')][_0x6d6d('0x5e')](_0x75f298)[_0x6d6d('0x27')](handleEntityNotFound(_0x4606eb,null))['then'](respondWithResult(_0x4606eb,null))[_0x6d6d('0x57')](handleError(_0x4606eb,null));};exports[_0x6d6d('0x5f')]=function(_0xe6fc76,_0x972221){return db[_0x6d6d('0x2e')]['create'](_0xe6fc76[_0x6d6d('0x60')],{})[_0x6d6d('0x27')](respondWithResult(_0x972221,0xc9))[_0x6d6d('0x57')](handleError(_0x972221,null));};exports['update']=function(_0x577f01,_0x7e984c){if(_0x577f01['body']['id']){delete _0x577f01[_0x6d6d('0x60')]['id'];}return db[_0x6d6d('0x2e')][_0x6d6d('0x5e')]({'where':{'id':_0x577f01[_0x6d6d('0x59')]['id']}})[_0x6d6d('0x27')](handleEntityNotFound(_0x7e984c,null))[_0x6d6d('0x27')](saveUpdates(_0x577f01[_0x6d6d('0x60')],null))[_0x6d6d('0x27')](respondWithResult(_0x7e984c,null))[_0x6d6d('0x57')](handleError(_0x7e984c,null));};exports[_0x6d6d('0x61')]=function(_0x583d1a,_0x2d6e3a){return db[_0x6d6d('0x2e')][_0x6d6d('0x61')]()[_0x6d6d('0x27')](respondWithResult(_0x2d6e3a,null))[_0x6d6d('0x57')](handleError(_0x2d6e3a,null));};exports[_0x6d6d('0x28')]=function(_0x243be3,_0x5e5ace){var _0x5a1cdc;var _0x3ad9b0=_0x243be3[_0x6d6d('0x59')]['id'];return db['CmHopper'][_0x6d6d('0x5e')]({'where':{'id':_0x243be3[_0x6d6d('0x59')]['id']}})[_0x6d6d('0x27')](handleEntityNotFound(_0x5e5ace,null))[_0x6d6d('0x27')](function(_0x113ab8){if(_0x113ab8){return _0x113ab8[_0x6d6d('0x28')]()[_0x6d6d('0x27')](function(_0x1ef7fb){return _0x1ef7fb;});}})[_0x6d6d('0x27')](function(_0x36f37a){_0x5a1cdc=_0x36f37a;if(_0x36f37a){if(_0x36f37a[_0x6d6d('0x62')]||_0x36f37a[_0x6d6d('0x63')]){return db[_0x36f37a[_0x6d6d('0x62')]?_0x6d6d('0x64'):_0x6d6d('0x65')]['find']({'where':{'id':_0x36f37a[_0x6d6d('0x62')]?_0x36f37a[_0x6d6d('0x62')]:_0x36f37a['CampaignId']},'attributes':['id',_0x6d6d('0x2b')],'raw':!![]});}}})[_0x6d6d('0x27')](function(_0x1f99ef){var _0x407357={};if(_0x1f99ef){_[_0x6d6d('0x53')](_0x407357,_[_0x6d6d('0x66')](_0x5a1cdc[_0x6d6d('0x67')],[_0x6d6d('0x68'),_0x6d6d('0x69'),'id']));_0x407357['state']=0x15;_0x407357['statedesc']=_0x6d6d('0x6a');_0x407357[_0x6d6d('0x6b')]=_0x1f99ef[_0x6d6d('0x2b')];_0x407357['membername']=_0x243be3['user'][_0x6d6d('0x2b')];_0x407357['UserId']=_0x243be3[_0x6d6d('0x6c')]['id'];_0x407357['deleted']=!![];_0x407357[_0x6d6d('0x6d')]=moment()[_0x6d6d('0x6e')](_0x6d6d('0x6f'));_0x407357[_0x6d6d('0x70')]=_0x5a1cdc[_0x6d6d('0x71')];_0x407357[_0x6d6d('0x72')]=_0x5a1cdc['VoiceQueueId']?_0x6d6d('0x73'):'ivr';return db[_0x6d6d('0x74')]['find']({'where':{'id':_0x407357[_0x6d6d('0x75')]},'attributes':[_0x6d6d('0x76'),_0x6d6d('0x77')]})[_0x6d6d('0x27')](function(_0x29b68b){if(!_[_0x6d6d('0x78')](_0x5e5ace)&&!_[_0x6d6d('0x78')](_0x29b68b['firstName'])){_0x407357['calleridname']=_0x29b68b[_0x6d6d('0x76')];if(!_['isNil'](_0x29b68b[_0x6d6d('0x77')])){_0x407357['calleridname']+='\x20'+_0x29b68b[_0x6d6d('0x77')];}}})[_0x6d6d('0x79')](function(){return db[_0x6d6d('0x7a')][_0x6d6d('0x5f')](_0x407357);});}})[_0x6d6d('0x27')](function(_0x2ee7c9){return db['CmHopperAdditionalPhone'][_0x6d6d('0x28')]({'where':{'CmHopperId':_0x3ad9b0}});})[_0x6d6d('0x27')](function(){return _0x5e5ace[_0x6d6d('0x1a')](0xcc)[_0x6d6d('0x1b')]();})[_0x6d6d('0x57')](handleError(_0x5e5ace,null));};exports[_0x6d6d('0x7b')]=function(_0x30e31f,_0x589d64,_0x3fa820){var _0x4ec43e=[];return db[_0x6d6d('0x74')][_0x6d6d('0x61')]()[_0x6d6d('0x27')](function(_0x198d6d){_0x4ec43e=_[_0x6d6d('0x5a')](_0x198d6d);return _0x30e31f[_0x6d6d('0x6c')][_0x6d6d('0x7c')]({'where':{'type':_0x6d6d('0x7d'),'dialActive':!![],'dialMethod':_0x6d6d('0x7e')},'attributes':['id','dialOrderByScheduledAt'],'raw':!![]});})['then'](function(_0x3e0e8c){if(_0x3e0e8c&&_0x3e0e8c['length']){return db['sequelize']['transaction'](function(_0x1e3b17){var _0x1ee1b3={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x6d6d('0x6e')](_0x6d6d('0x6f'))},'VoiceQueueId':{'$in':_[_0x6d6d('0x2d')](_0x3e0e8c,'id')},'$or':[{'UserId':null},{'UserId':_0x30e31f[_0x6d6d('0x6c')]['id']}]};var _0x4d4083=[];if(_0x30e31f['body'][_0x6d6d('0x7f')]&&_0x30e31f['body']['direction']==='prev'){if(!_[_0x6d6d('0x80')](_0x30e31f['body'][_0x6d6d('0x81')])){_0x1ee1b3['id']={'$in':_0x30e31f['body'][_0x6d6d('0x81')]};}_0x4d4083=[[_0x6d6d('0x82'),'ASC'],['scheduledAt',_0x3e0e8c[0x0][_0x6d6d('0x83')]===_0x6d6d('0x84')?_0x6d6d('0x85'):_0x6d6d('0x84')],db['sequelize'][_0x6d6d('0x86')](_0x6d6d('0x87')),['id',_0x6d6d('0x85')]];}else{if(!_[_0x6d6d('0x80')](_0x30e31f['body'][_0x6d6d('0x81')])){_0x1ee1b3['id']={'$notIn':_0x30e31f['body']['hopperIds']};}_0x4d4083=[['priority',_0x6d6d('0x85')],['scheduledAt',_0x3e0e8c[0x0][_0x6d6d('0x83')]],db[_0x6d6d('0x88')][_0x6d6d('0x86')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id','ASC']];}return db[_0x6d6d('0x2e')][_0x6d6d('0x89')]({'attributes':['id','scheduledat','phone'],'where':_0x1ee1b3,'order':_0x4d4083,'transaction':_0x1e3b17,'lock':_0x1e3b17[_0x6d6d('0x8a')][_0x6d6d('0x8b')],'include':[{'model':db[_0x6d6d('0x74')],'as':_0x6d6d('0x8c'),'attributes':_0x4ec43e,'include':[{'model':db[_0x6d6d('0x8d')],'as':_0x6d6d('0x8e'),'attributes':['id',_0x6d6d('0x2b')]}]},{'model':db['CmList'],'as':'List','attributes':['id','name']},{'model':db['VoiceQueue'],'as':'Queue','attributes':['id','name',_0x6d6d('0x8f')]}]})[_0x6d6d('0x27')](function(_0x328ab5){if(_0x328ab5){return _0x328ab5[_0x6d6d('0x26')]({'UserId':_0x30e31f['user']['id']},{'transaction':_0x1e3b17});}});});}})['then'](handleEntityNotFound(_0x589d64,null))['then'](respondWithResult(_0x589d64,null))[_0x6d6d('0x57')](handleError(_0x589d64,null));};exports[_0x6d6d('0x90')]=function(_0x38eb23,_0x1c8d15,_0x58157a){return _0x38eb23['user'][_0x6d6d('0x7c')]({'where':{'type':_0x6d6d('0x7d'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})[_0x6d6d('0x27')](function(_0x2efab5){if(_0x2efab5&&_0x2efab5[_0x6d6d('0x4b')]){return db[_0x6d6d('0x2e')][_0x6d6d('0x20')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x6d6d('0x6f'))},'VoiceQueueId':{'$in':_['map'](_0x2efab5,'id')},'$or':[{'UserId':null},{'UserId':_0x38eb23[_0x6d6d('0x6c')]['id']}]}});}return 0x0;})['then'](function(_0x108108){if(!_['isNil'](_0x108108)&&_[_0x6d6d('0x91')](_0x108108)){return _0x1c8d15[_0x6d6d('0x1a')](0xc8)[_0x6d6d('0x1c')]({'contacts':_0x108108});}else{logger[_0x6d6d('0x29')](_0x6d6d('0x92'),_0x6d6d('0x90'),0x194,_0x6d6d('0x93'));_0x1c8d15[_0x6d6d('0x19')](0x194);}})[_0x6d6d('0x57')](handleError(_0x1c8d15,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index eeda535..f7cc7b2 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 _0xe3da=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports','define','CmHopper','scheduledat','priority','lodash','util','../../config/logger'];(function(_0x345cb2,_0x5a17bd){var _0x517828=function(_0x37042a){while(--_0x37042a){_0x345cb2['push'](_0x345cb2['shift']());}};_0x517828(++_0x5a17bd);}(_0xe3da,0x1cd));var _0xae3d=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xe3da[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xae3d('0x0'));var util=require(_0xae3d('0x1'));var logger=require(_0xae3d('0x2'))(_0xae3d('0x3'));var moment=require(_0xae3d('0x4'));var BPromise=require(_0xae3d('0x5'));var rp=require(_0xae3d('0x6'));var fs=require('fs');var path=require(_0xae3d('0x7'));var rimraf=require(_0xae3d('0x8'));var config=require(_0xae3d('0x9'));var attributes=require(_0xae3d('0xa'));module[_0xae3d('0xb')]=function(_0xa9a1a,_0xa54808){return _0xa9a1a[_0xae3d('0xc')](_0xae3d('0xd'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0xae3d('0xe'),'fields':[_0xae3d('0xe')]},{'name':'phone','fields':['phone']},{'name':_0xae3d('0xf'),'fields':[_0xae3d('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7c09=['scheduledat','phone','priority','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','define','CmHopper','cm_hopper'];(function(_0x37bbe9,_0x13044e){var _0xfc4123=function(_0x4ce049){while(--_0x4ce049){_0x37bbe9['push'](_0x37bbe9['shift']());}};_0xfc4123(++_0x13044e);}(_0x7c09,0x102));var _0x97c0=function(_0x2198be,_0x4fff42){_0x2198be=_0x2198be-0x0;var _0x45fd4a=_0x7c09[_0x2198be];return _0x45fd4a;};'use strict';var _=require('lodash');var util=require(_0x97c0('0x0'));var logger=require(_0x97c0('0x1'))('api');var moment=require(_0x97c0('0x2'));var BPromise=require(_0x97c0('0x3'));var rp=require(_0x97c0('0x4'));var fs=require('fs');var path=require(_0x97c0('0x5'));var rimraf=require(_0x97c0('0x6'));var config=require(_0x97c0('0x7'));var attributes=require(_0x97c0('0x8'));module['exports']=function(_0x4b2f81,_0x590368){return _0x4b2f81[_0x97c0('0x9')](_0x97c0('0xa'),attributes,{'tableName':_0x97c0('0xb'),'paranoid':![],'indexes':[{'name':_0x97c0('0xc'),'fields':[_0x97c0('0xc')]},{'name':'phone','fields':[_0x97c0('0xd')]},{'name':'priority','fields':[_0x97c0('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 d43a562..787728d 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 _0x02f1=['message','result','catch','GetCmHopper','CmHopper','options','raw','where','attributes','limit','include','map','model','find','ShowCmHopper','body','CreateCmHopper','UpdateCmHopper','update','destroy','DestroyCmHopper','GetContactDialer','CmContact','describe','transaction','findAll','order','LOCK','Contact','keys','User','Agent','name','voicePause','length','UserId','push','includes','all','MoveContactManagedDialer','sequelize','create','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','\x22%s\x22','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','UPDATE','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xb4454a,_0x537bb4){var _0x46a7d1=function(_0x39720f){while(--_0x39720f){_0xb4454a['push'](_0xb4454a['shift']());}};_0x46a7d1(++_0x537bb4);}(_0x02f1,0x1e5));var _0x102f=function(_0x1723dc,_0x3f45a8){_0x1723dc=_0x1723dc-0x0;var _0x1d24f8=_0x02f1[_0x1723dc];return _0x1d24f8;};'use strict';var _=require(_0x102f('0x0'));var util=require(_0x102f('0x1'));var moment=require(_0x102f('0x2'));var BPromise=require(_0x102f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x102f('0x4'));var db=require(_0x102f('0x5'))['db'];var utils=require(_0x102f('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x102f('0x7'));var client=jayson[_0x102f('0x8')][_0x102f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5f2962,_0x4df4d6,_0x2ad06d){return new BPromise(function(_0x30cdc1,_0x5a59da){return client[_0x102f('0xa')](_0x5f2962,_0x2ad06d)[_0x102f('0xb')](function(_0x2f9d30){logger[_0x102f('0xc')](_0x102f('0xd'),_0x4df4d6,_0x102f('0xe'));logger[_0x102f('0xf')](_0x102f('0x10'),_0x4df4d6,_0x102f('0xe'),JSON[_0x102f('0x11')](_0x2f9d30));if(_0x2f9d30['error']){if(_0x2f9d30[_0x102f('0x12')]['code']===0x1f4){logger[_0x102f('0x12')](_0x102f('0xd'),_0x4df4d6,_0x2f9d30[_0x102f('0x12')][_0x102f('0x13')]);return _0x5a59da(_0x2f9d30[_0x102f('0x12')][_0x102f('0x13')]);}logger[_0x102f('0x12')](_0x102f('0xd'),_0x4df4d6,_0x2f9d30['error']['message']);return _0x30cdc1(_0x2f9d30['error'][_0x102f('0x13')]);}else{logger['info']('CmHopper,\x20%s,\x20%s',_0x4df4d6,_0x102f('0xe'));_0x30cdc1(_0x2f9d30[_0x102f('0x14')]['message']);}})[_0x102f('0x15')](function(_0x4ccfe1){logger[_0x102f('0x12')](_0x102f('0xd'),_0x4df4d6,_0x4ccfe1);_0x5a59da(_0x4ccfe1);});});}exports[_0x102f('0x16')]=function(_0x5990c0){var _0x1db728=this;return new Promise(function(_0x498f3f,_0xf7c908){return db[_0x102f('0x17')]['findAll']({'raw':_0x5990c0[_0x102f('0x18')]?_0x5990c0[_0x102f('0x18')][_0x102f('0x19')]===undefined?!![]:![]:!![],'where':_0x5990c0[_0x102f('0x18')]?_0x5990c0[_0x102f('0x18')][_0x102f('0x1a')]||null:null,'attributes':_0x5990c0['options']?_0x5990c0[_0x102f('0x18')][_0x102f('0x1b')]||null:null,'limit':_0x5990c0[_0x102f('0x18')]?_0x5990c0[_0x102f('0x18')][_0x102f('0x1c')]||null:null,'include':_0x5990c0[_0x102f('0x18')]?_0x5990c0['options'][_0x102f('0x1d')]?_[_0x102f('0x1e')](_0x5990c0['options'][_0x102f('0x1d')],function(_0x4c0c7e){return{'model':db[_0x4c0c7e['model']],'as':_0x4c0c7e['as'],'attributes':_0x4c0c7e['attributes'],'include':_0x4c0c7e[_0x102f('0x1d')]?_[_0x102f('0x1e')](_0x4c0c7e['include'],function(_0x1ed720){return{'model':db[_0x1ed720[_0x102f('0x1f')]],'as':_0x1ed720['as'],'attributes':_0x1ed720[_0x102f('0x1b')],'include':_0x1ed720[_0x102f('0x1d')]?_[_0x102f('0x1e')](_0x1ed720[_0x102f('0x1d')],function(_0x297cc0){return{'model':db[_0x297cc0[_0x102f('0x1f')]],'as':_0x297cc0['as'],'attributes':_0x297cc0['attributes']};}):[]};}):[]};}):[]:[]})[_0x102f('0xb')](function(_0x14f65b){logger[_0x102f('0xc')](_0x102f('0x16'),_0x5990c0);logger['debug'](_0x102f('0x16'),_0x5990c0,JSON[_0x102f('0x11')](_0x14f65b));_0x498f3f(_0x14f65b);})[_0x102f('0x15')](function(_0x392106){logger['error'](_0x102f('0x16'),_0x392106[_0x102f('0x13')],_0x5990c0);_0xf7c908(_0x1db728[_0x102f('0x12')](0x1f4,_0x392106[_0x102f('0x13')]));});});};exports['ShowCmHopper']=function(_0x5e621f){var _0xf00ad9=this;return new Promise(function(_0x2abe1f,_0x57e832){return db[_0x102f('0x17')][_0x102f('0x20')]({'raw':_0x5e621f['options']?_0x5e621f['options'][_0x102f('0x19')]===undefined?!![]:![]:!![],'where':_0x5e621f[_0x102f('0x18')]?_0x5e621f['options'][_0x102f('0x1a')]||null:null,'attributes':_0x5e621f[_0x102f('0x18')]?_0x5e621f['options'][_0x102f('0x1b')]||null:null,'include':_0x5e621f[_0x102f('0x18')]?_0x5e621f[_0x102f('0x18')][_0x102f('0x1d')]?_[_0x102f('0x1e')](_0x5e621f[_0x102f('0x18')][_0x102f('0x1d')],function(_0x24de28){return{'model':db[_0x24de28[_0x102f('0x1f')]],'as':_0x24de28['as'],'attributes':_0x24de28[_0x102f('0x1b')],'include':_0x24de28[_0x102f('0x1d')]?_[_0x102f('0x1e')](_0x24de28[_0x102f('0x1d')],function(_0x5114f5){return{'model':db[_0x5114f5['model']],'as':_0x5114f5['as'],'attributes':_0x5114f5[_0x102f('0x1b')],'include':_0x5114f5['include']?_[_0x102f('0x1e')](_0x5114f5[_0x102f('0x1d')],function(_0x4c570b){return{'model':db[_0x4c570b[_0x102f('0x1f')]],'as':_0x4c570b['as'],'attributes':_0x4c570b[_0x102f('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x102f('0xb')](function(_0x7af7ed){logger[_0x102f('0xc')](_0x102f('0x21'),_0x5e621f);logger[_0x102f('0xf')]('ShowCmHopper',_0x5e621f,JSON[_0x102f('0x11')](_0x7af7ed));_0x2abe1f(_0x7af7ed);})[_0x102f('0x15')](function(_0x24c27c){logger['error'](_0x102f('0x21'),_0x24c27c[_0x102f('0x13')],_0x5e621f);_0x57e832(_0xf00ad9[_0x102f('0x12')](0x1f4,_0x24c27c[_0x102f('0x13')]));});});};exports['CreateCmHopper']=function(_0x296993){var _0x1184e6=this;return new Promise(function(_0x5b910f,_0x509720){return db[_0x102f('0x17')]['create'](_0x296993[_0x102f('0x22')],{'raw':_0x296993['options']?_0x296993[_0x102f('0x18')][_0x102f('0x19')]===undefined?!![]:![]:!![]})[_0x102f('0xb')](function(_0x3d38bd){logger[_0x102f('0xc')](_0x102f('0x23'),_0x296993);logger['debug'](_0x102f('0x23'),_0x296993,JSON[_0x102f('0x11')](_0x3d38bd));_0x5b910f(_0x3d38bd);})[_0x102f('0x15')](function(_0x42f401){logger[_0x102f('0x12')]('CreateCmHopper',_0x42f401[_0x102f('0x13')],_0x296993);_0x509720(_0x1184e6[_0x102f('0x12')](0x1f4,_0x42f401[_0x102f('0x13')]));});});};exports[_0x102f('0x24')]=function(_0x152072){var _0x578ce1=this;return new Promise(function(_0x3ef7c4,_0x262599){return db['CmHopper'][_0x102f('0x25')](_0x152072['body'],{'raw':_0x152072['options']?_0x152072['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x152072[_0x102f('0x18')]?_0x152072[_0x102f('0x18')][_0x102f('0x1a')]||null:null,'attributes':_0x152072[_0x102f('0x18')]?_0x152072[_0x102f('0x18')][_0x102f('0x1b')]||null:null,'limit':_0x152072[_0x102f('0x18')]?_0x152072[_0x102f('0x18')][_0x102f('0x1c')]||null:null})[_0x102f('0xb')](function(_0x531755){logger[_0x102f('0xc')]('UpdateCmHopper',_0x152072);logger[_0x102f('0xf')](_0x102f('0x24'),_0x152072,JSON[_0x102f('0x11')](_0x531755));_0x3ef7c4(_0x531755);})[_0x102f('0x15')](function(_0x128250){logger[_0x102f('0x12')](_0x102f('0x24'),_0x128250['message'],_0x152072);_0x262599(_0x578ce1[_0x102f('0x12')](0x1f4,_0x128250[_0x102f('0x13')]));});});};exports['DestroyCmHopper']=function(_0x1c0830){var _0x5b4fda=this;return new Promise(function(_0x5cb5c8,_0xec669){return db[_0x102f('0x17')][_0x102f('0x26')]({'where':_0x1c0830[_0x102f('0x18')]?_0x1c0830[_0x102f('0x18')][_0x102f('0x1a')]||null:null})[_0x102f('0xb')](function(_0x3fe09c){logger[_0x102f('0xc')]('DestroyCmHopper',_0x1c0830);logger['debug']('DestroyCmHopper',_0x1c0830,JSON[_0x102f('0x11')](_0x3fe09c));_0x5cb5c8(_0x3fe09c);})['catch'](function(_0x136b90){logger[_0x102f('0x12')](_0x102f('0x27'),_0x136b90[_0x102f('0x13')],_0x1c0830);_0xec669(_0x5b4fda[_0x102f('0x12')](0x1f4,_0x136b90[_0x102f('0x13')]));});});};exports[_0x102f('0x28')]=function(_0x48e7f2){var _0x541cdc=this;return new Promise(function(_0x589a60,_0x6fb58c){return db[_0x102f('0x29')][_0x102f('0x2a')]()[_0x102f('0xb')](function(_0xa41795){return db['sequelize'][_0x102f('0x2b')](function(_0x48c137){return db[_0x102f('0x17')][_0x102f('0x2c')]({'where':_0x48e7f2[_0x102f('0x18')]?_0x48e7f2['options'][_0x102f('0x1a')]||null:null,'attributes':_0x48e7f2[_0x102f('0x18')]?_0x48e7f2[_0x102f('0x18')][_0x102f('0x1b')]||null:null,'limit':_0x48e7f2['options']?_0x48e7f2[_0x102f('0x18')]['limit']||null:null,'order':_0x48e7f2[_0x102f('0x18')]?_0x48e7f2['options'][_0x102f('0x2d')]||null:null,'transaction':_0x48c137,'lock':_0x48c137[_0x102f('0x2e')]['UPDATE'],'include':[{'model':db[_0x102f('0x29')],'as':_0x102f('0x2f'),'attributes':_[_0x102f('0x30')](_0xa41795)},{'model':db[_0x102f('0x31')],'as':_0x102f('0x32'),'attributes':['id',_0x102f('0x33'),_0x102f('0x34')]}]})[_0x102f('0xb')](function(_0x3fb0a7){var _0x52972a=[];var _0x597a89=[];for(var _0x42b106=0x0;_0x42b106<_0x3fb0a7[_0x102f('0x35')];_0x42b106+=0x1){var _0x1c8fde=_0x3fb0a7[_0x42b106][_0x102f('0x36')];if(_0x1c8fde===null){_0x52972a[_0x102f('0x37')](_0x3fb0a7[_0x42b106][_0x102f('0x25')](_0x48e7f2[_0x102f('0x22')],{'transaction':_0x48c137}));}else if(!_0x597a89[_0x102f('0x38')](_0x1c8fde)){_0x597a89[_0x102f('0x37')](_0x1c8fde);_0x52972a[_0x102f('0x37')](_0x3fb0a7[_0x42b106][_0x102f('0x25')](_0x48e7f2[_0x102f('0x22')],{'transaction':_0x48c137}));}}return BPromise[_0x102f('0x39')](_0x52972a);});})[_0x102f('0xb')](function(_0x1627bd){logger[_0x102f('0xc')](_0x102f('0x28'),_0x48e7f2);logger[_0x102f('0xf')](_0x102f('0x28'),_0x48e7f2,JSON[_0x102f('0x11')](_0x1627bd));_0x589a60(_0x1627bd);})['catch'](function(_0x5ca4d6){logger[_0x102f('0x12')](_0x102f('0x28'),_0x5ca4d6[_0x102f('0x13')],_0x48e7f2);_0x6fb58c(_0x541cdc[_0x102f('0x12')](0x1f4,_0x5ca4d6['message']));});});});};exports[_0x102f('0x3a')]=function(_0x555e2b){var _0x3a85cc=this;return new Promise(function(_0x53686a,_0x498f40){return db[_0x102f('0x3b')][_0x102f('0x2b')](function(_0x1adf49){return db['CmHopperFinal'][_0x102f('0x3c')](_0x555e2b[_0x102f('0x22')],{'raw':_0x555e2b['options']?_0x555e2b[_0x102f('0x18')][_0x102f('0x19')]===undefined?!![]:![]:!![],'transaction':_0x1adf49})[_0x102f('0xb')](function(){return db[_0x102f('0x17')][_0x102f('0x26')]({'where':_0x555e2b[_0x102f('0x18')]?_0x555e2b[_0x102f('0x18')][_0x102f('0x1a')]||null:null,'transaction':_0x1adf49});});})['then'](function(_0x58bd73){logger[_0x102f('0xc')](_0x102f('0x3a'),_0x555e2b);logger[_0x102f('0xf')](_0x102f('0x3a'),_0x555e2b,JSON[_0x102f('0x11')](_0x58bd73));_0x53686a(_0x58bd73);})[_0x102f('0x15')](function(_0x30996b){logger[_0x102f('0x12')](_0x102f('0x3a'),_0x30996b[_0x102f('0x13')],_0x555e2b);_0x498f40(_0x3a85cc['error'](0x1f4,_0x30996b['message']));});});};exports[_0x102f('0x3d')]=function(_0x122d6f){var _0x3d10c2=this;return new Promise(function(_0x56bdb8,_0x32c2c4){return db[_0x102f('0x17')]['findAll']({'raw':_0x122d6f[_0x102f('0x18')]?_0x122d6f['options']['raw']===undefined?!![]:![]:!![],'where':_0x122d6f[_0x102f('0x18')]?_0x122d6f[_0x102f('0x18')][_0x102f('0x1a')]||null:null,'attributes':[[db[_0x102f('0x3b')]['fn'](_0x102f('0x3e'),db[_0x102f('0x3b')]['fn']('IF',db[_0x102f('0x3b')][_0x102f('0x3f')](_0x102f('0x40')+util['format'](_0x102f('0x41'),moment()[_0x102f('0x42')](_0x102f('0x43')))+_0x102f('0x44')))),_0x102f('0x45')]]})[_0x102f('0xb')](function(_0x3cec3f){logger[_0x102f('0xc')](_0x102f('0x3d'),_0x122d6f);logger[_0x102f('0xf')]('CountReScheduled',_0x122d6f,JSON[_0x102f('0x11')](_0x3cec3f));_0x56bdb8(_0x3cec3f);})[_0x102f('0x15')](function(_0x169f81){logger['error']('CountReScheduled',_0x169f81[_0x102f('0x13')],_0x122d6f);_0x32c2c4(_0x3d10c2['error'](0x1f4,_0x169f81[_0x102f('0x13')]));});});};exports[_0x102f('0x46')]=function(_0x41f6c5){var _0x50548a=this;return new Promise(function(_0x5d069b,_0x164fe2){return db[_0x102f('0x29')]['describe']()[_0x102f('0xb')](function(_0xdbf636){return db['sequelize'][_0x102f('0x2b')](function(_0x230d1c){return db[_0x102f('0x17')][_0x102f('0x2c')]({'where':_0x41f6c5[_0x102f('0x18')]?_0x41f6c5[_0x102f('0x18')][_0x102f('0x1a')]||null:null,'attributes':_0x41f6c5[_0x102f('0x18')]?_0x41f6c5[_0x102f('0x18')][_0x102f('0x1b')]||null:null,'limit':0x1,'order':_0x41f6c5[_0x102f('0x18')]?_0x41f6c5[_0x102f('0x18')]['order']||null:null,'group':db[_0x102f('0x17')][_0x102f('0x36')],'transaction':_0x230d1c,'lock':_0x230d1c[_0x102f('0x2e')][_0x102f('0x47')],'include':_0x41f6c5['options']?_0x41f6c5[_0x102f('0x18')]['include']?_['map'](_0x41f6c5[_0x102f('0x18')][_0x102f('0x1d')],function(_0x2f1ecf){return{'model':db[_0x2f1ecf[_0x102f('0x1f')]],'as':_0x2f1ecf['as'],'attributes':_0x2f1ecf['attributes'],'include':_0x2f1ecf['include']?_[_0x102f('0x1e')](_0x2f1ecf['include'],function(_0xa453a4){return{'model':db[_0xa453a4[_0x102f('0x1f')]],'as':_0xa453a4['as'],'attributes':_0xa453a4[_0x102f('0x1b')],'include':_0xa453a4[_0x102f('0x1d')]?_[_0x102f('0x1e')](_0xa453a4['include'],function(_0xc82a09){return{'model':db[_0xc82a09[_0x102f('0x1f')]],'as':_0xc82a09['as'],'attributes':_0xc82a09[_0x102f('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x355689){var _0x39a6ba=[];for(var _0x3612b6=0x0;_0x3612b6<_0x355689[_0x102f('0x35')];_0x3612b6+=0x1){_0x39a6ba[_0x102f('0x37')](_0x355689[_0x3612b6][_0x102f('0x25')](_0x41f6c5[_0x102f('0x22')],{'transaction':_0x230d1c}));}return BPromise[_0x102f('0x39')](_0x39a6ba);});})[_0x102f('0xb')](function(_0x3f7407){logger[_0x102f('0xc')](_0x102f('0x46'),_0x41f6c5);logger[_0x102f('0xf')]('GetContactRecallMe',_0x41f6c5,JSON[_0x102f('0x11')](_0x3f7407));_0x5d069b(_0x3f7407);})['catch'](function(_0x45b960){logger['error'](_0x102f('0x46'),_0x45b960['message'],_0x41f6c5);_0x164fe2(_0x50548a[_0x102f('0x12')](0x1f4,_0x45b960[_0x102f('0x13')]));});});});};exports['GetCmHopperPreview']=function(_0x982703){var _0x12f000=this;return new Promise(function(_0xa56c2c,_0x51f1c5){db[_0x102f('0x29')][_0x102f('0x2a')]()[_0x102f('0xb')](function(_0x2b1015){return db[_0x102f('0x17')][_0x102f('0x2c')]({'raw':_0x982703[_0x102f('0x18')]?_0x982703['options'][_0x102f('0x19')]===undefined?!![]:![]:!![],'where':_0x982703['options']?_0x982703[_0x102f('0x18')]['where']||null:null,'attributes':_0x982703[_0x102f('0x18')]?_0x982703[_0x102f('0x18')][_0x102f('0x1b')]||null:null,'limit':_0x982703[_0x102f('0x18')]?_0x982703[_0x102f('0x18')]['limit']||null:null,'include':_0x982703['options']?_0x982703['options'][_0x102f('0x1d')]?_[_0x102f('0x1e')](_0x982703[_0x102f('0x18')]['include'],function(_0x2924ed){return{'model':db[_0x2924ed['model']],'as':_0x2924ed['as'],'attributes':_0x2924ed['as']==='Contact'?_['keys'](_0x2b1015):_0x2924ed[_0x102f('0x1b')],'include':_0x2924ed[_0x102f('0x1d')]?_[_0x102f('0x1e')](_0x2924ed[_0x102f('0x1d')],function(_0xc27418){return{'model':db[_0xc27418[_0x102f('0x1f')]],'as':_0xc27418['as'],'attributes':_0xc27418['attributes'],'include':_0xc27418['include']?_[_0x102f('0x1e')](_0xc27418[_0x102f('0x1d')],function(_0x525847){return{'model':db[_0x525847[_0x102f('0x1f')]],'as':_0x525847['as'],'attributes':_0x525847['attributes']};}):[]};}):[]};}):[]:[]})[_0x102f('0xb')](function(_0x3a27db){logger[_0x102f('0xc')](_0x102f('0x16'),_0x982703);logger[_0x102f('0xf')](_0x102f('0x16'),_0x982703,JSON[_0x102f('0x11')](_0x3a27db));_0xa56c2c(_0x3a27db);})[_0x102f('0x15')](function(_0x5ce2c4){logger[_0x102f('0x12')](_0x102f('0x16'),_0x5ce2c4[_0x102f('0x13')],_0x982703);_0x51f1c5(_0x12f000['error'](0x1f4,_0x5ce2c4[_0x102f('0x13')]));});});});}; \ No newline at end of file +var _0xe0f1=['bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','CmHopper,\x20%s,\x20%s','debug','CmHopper,\x20%s,\x20%s,\x20%s','code','error','message','request\x20sent','result','catch','GetCmHopper','findAll','options','where','attributes','limit','include','map','model','stringify','find','raw','ShowCmHopper','CreateCmHopper','CmHopper','create','body','UpdateCmHopper','DestroyCmHopper','destroy','GetContactDialer','describe','sequelize','order','LOCK','UPDATE','CmContact','keys','Agent','name','UserId','push','update','includes','MoveContactManagedDialer','CountReScheduled','literal','`scheduledat`\x20>=\x20','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','GetContactRecallMe','transaction','length','all','GetCmHopperPreview','Contact','util','moment'];(function(_0x1ce8ba,_0x20e396){var _0x612123=function(_0x41d755){while(--_0x41d755){_0x1ce8ba['push'](_0x1ce8ba['shift']());}};_0x612123(++_0x20e396);}(_0xe0f1,0x19c));var _0x1e0f=function(_0x1a7550,_0x1edace){_0x1a7550=_0x1a7550-0x0;var _0x426e22=_0xe0f1[_0x1a7550];return _0x426e22;};'use strict';var _=require('lodash');var util=require(_0x1e0f('0x0'));var moment=require(_0x1e0f('0x1'));var BPromise=require(_0x1e0f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1e0f('0x3'));var db=require(_0x1e0f('0x4'))['db'];var utils=require(_0x1e0f('0x5'));var logger=require('../../config/logger')(_0x1e0f('0x6'));var config=require('../../config/environment');var jayson=require(_0x1e0f('0x7'));var client=jayson[_0x1e0f('0x8')][_0x1e0f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5a4de7,_0x43c8fc,_0x36e3ed){return new BPromise(function(_0x2fb851,_0x47418c){return client[_0x1e0f('0xa')](_0x5a4de7,_0x36e3ed)[_0x1e0f('0xb')](function(_0x102741){logger[_0x1e0f('0xc')](_0x1e0f('0xd'),_0x43c8fc,'request\x20sent');logger[_0x1e0f('0xe')](_0x1e0f('0xf'),_0x43c8fc,'request\x20sent',JSON['stringify'](_0x102741));if(_0x102741['error']){if(_0x102741['error'][_0x1e0f('0x10')]===0x1f4){logger[_0x1e0f('0x11')](_0x1e0f('0xd'),_0x43c8fc,_0x102741[_0x1e0f('0x11')][_0x1e0f('0x12')]);return _0x47418c(_0x102741[_0x1e0f('0x11')]['message']);}logger[_0x1e0f('0x11')](_0x1e0f('0xd'),_0x43c8fc,_0x102741['error'][_0x1e0f('0x12')]);return _0x2fb851(_0x102741[_0x1e0f('0x11')][_0x1e0f('0x12')]);}else{logger[_0x1e0f('0xc')](_0x1e0f('0xd'),_0x43c8fc,_0x1e0f('0x13'));_0x2fb851(_0x102741[_0x1e0f('0x14')][_0x1e0f('0x12')]);}})[_0x1e0f('0x15')](function(_0x386142){logger[_0x1e0f('0x11')](_0x1e0f('0xd'),_0x43c8fc,_0x386142);_0x47418c(_0x386142);});});}exports[_0x1e0f('0x16')]=function(_0x3cc5da){var _0x4e5946=this;return new Promise(function(_0x18c156,_0x5ee3da){return db['CmHopper'][_0x1e0f('0x17')]({'raw':_0x3cc5da[_0x1e0f('0x18')]?_0x3cc5da['options']['raw']===undefined?!![]:![]:!![],'where':_0x3cc5da['options']?_0x3cc5da[_0x1e0f('0x18')][_0x1e0f('0x19')]||null:null,'attributes':_0x3cc5da['options']?_0x3cc5da[_0x1e0f('0x18')][_0x1e0f('0x1a')]||null:null,'limit':_0x3cc5da[_0x1e0f('0x18')]?_0x3cc5da[_0x1e0f('0x18')][_0x1e0f('0x1b')]||null:null,'include':_0x3cc5da[_0x1e0f('0x18')]?_0x3cc5da[_0x1e0f('0x18')][_0x1e0f('0x1c')]?_[_0x1e0f('0x1d')](_0x3cc5da[_0x1e0f('0x18')][_0x1e0f('0x1c')],function(_0x2fbd32){return{'model':db[_0x2fbd32[_0x1e0f('0x1e')]],'as':_0x2fbd32['as'],'attributes':_0x2fbd32['attributes'],'include':_0x2fbd32[_0x1e0f('0x1c')]?_[_0x1e0f('0x1d')](_0x2fbd32[_0x1e0f('0x1c')],function(_0x22413c){return{'model':db[_0x22413c['model']],'as':_0x22413c['as'],'attributes':_0x22413c[_0x1e0f('0x1a')],'include':_0x22413c[_0x1e0f('0x1c')]?_[_0x1e0f('0x1d')](_0x22413c['include'],function(_0x20c4b7){return{'model':db[_0x20c4b7['model']],'as':_0x20c4b7['as'],'attributes':_0x20c4b7['attributes']};}):[]};}):[]};}):[]:[]})[_0x1e0f('0xb')](function(_0x1ee126){logger['info'](_0x1e0f('0x16'),_0x3cc5da);logger[_0x1e0f('0xe')](_0x1e0f('0x16'),_0x3cc5da,JSON[_0x1e0f('0x1f')](_0x1ee126));_0x18c156(_0x1ee126);})['catch'](function(_0x1fae83){logger[_0x1e0f('0x11')](_0x1e0f('0x16'),_0x1fae83[_0x1e0f('0x12')],_0x3cc5da);_0x5ee3da(_0x4e5946['error'](0x1f4,_0x1fae83['message']));});});};exports['ShowCmHopper']=function(_0x523aab){var _0xc9ef95=this;return new Promise(function(_0x8971d8,_0x48021f){return db['CmHopper'][_0x1e0f('0x20')]({'raw':_0x523aab[_0x1e0f('0x18')]?_0x523aab['options'][_0x1e0f('0x21')]===undefined?!![]:![]:!![],'where':_0x523aab[_0x1e0f('0x18')]?_0x523aab[_0x1e0f('0x18')][_0x1e0f('0x19')]||null:null,'attributes':_0x523aab[_0x1e0f('0x18')]?_0x523aab[_0x1e0f('0x18')][_0x1e0f('0x1a')]||null:null,'include':_0x523aab[_0x1e0f('0x18')]?_0x523aab[_0x1e0f('0x18')][_0x1e0f('0x1c')]?_[_0x1e0f('0x1d')](_0x523aab[_0x1e0f('0x18')][_0x1e0f('0x1c')],function(_0x15ce94){return{'model':db[_0x15ce94['model']],'as':_0x15ce94['as'],'attributes':_0x15ce94[_0x1e0f('0x1a')],'include':_0x15ce94[_0x1e0f('0x1c')]?_[_0x1e0f('0x1d')](_0x15ce94[_0x1e0f('0x1c')],function(_0x1e94dc){return{'model':db[_0x1e94dc[_0x1e0f('0x1e')]],'as':_0x1e94dc['as'],'attributes':_0x1e94dc['attributes'],'include':_0x1e94dc[_0x1e0f('0x1c')]?_[_0x1e0f('0x1d')](_0x1e94dc['include'],function(_0x130884){return{'model':db[_0x130884[_0x1e0f('0x1e')]],'as':_0x130884['as'],'attributes':_0x130884[_0x1e0f('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x1e0f('0xb')](function(_0x1ac191){logger[_0x1e0f('0xc')](_0x1e0f('0x22'),_0x523aab);logger[_0x1e0f('0xe')](_0x1e0f('0x22'),_0x523aab,JSON['stringify'](_0x1ac191));_0x8971d8(_0x1ac191);})[_0x1e0f('0x15')](function(_0x283b6d){logger[_0x1e0f('0x11')](_0x1e0f('0x22'),_0x283b6d['message'],_0x523aab);_0x48021f(_0xc9ef95['error'](0x1f4,_0x283b6d[_0x1e0f('0x12')]));});});};exports[_0x1e0f('0x23')]=function(_0x231f6f){var _0x3435ce=this;return new Promise(function(_0x5afbef,_0x301708){return db[_0x1e0f('0x24')][_0x1e0f('0x25')](_0x231f6f[_0x1e0f('0x26')],{'raw':_0x231f6f[_0x1e0f('0x18')]?_0x231f6f[_0x1e0f('0x18')][_0x1e0f('0x21')]===undefined?!![]:![]:!![]})['then'](function(_0x39e6e1){logger[_0x1e0f('0xc')](_0x1e0f('0x23'),_0x231f6f);logger[_0x1e0f('0xe')](_0x1e0f('0x23'),_0x231f6f,JSON[_0x1e0f('0x1f')](_0x39e6e1));_0x5afbef(_0x39e6e1);})[_0x1e0f('0x15')](function(_0x494bf4){logger[_0x1e0f('0x11')](_0x1e0f('0x23'),_0x494bf4[_0x1e0f('0x12')],_0x231f6f);_0x301708(_0x3435ce[_0x1e0f('0x11')](0x1f4,_0x494bf4[_0x1e0f('0x12')]));});});};exports[_0x1e0f('0x27')]=function(_0x1045fc){var _0x4150ec=this;return new Promise(function(_0x353dc8,_0x567d7b){return db[_0x1e0f('0x24')]['update'](_0x1045fc[_0x1e0f('0x26')],{'raw':_0x1045fc[_0x1e0f('0x18')]?_0x1045fc[_0x1e0f('0x18')][_0x1e0f('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1045fc[_0x1e0f('0x18')]?_0x1045fc['options']['where']||null:null,'attributes':_0x1045fc[_0x1e0f('0x18')]?_0x1045fc[_0x1e0f('0x18')][_0x1e0f('0x1a')]||null:null,'limit':_0x1045fc[_0x1e0f('0x18')]?_0x1045fc[_0x1e0f('0x18')][_0x1e0f('0x1b')]||null:null})[_0x1e0f('0xb')](function(_0x62e53f){logger['info'](_0x1e0f('0x27'),_0x1045fc);logger[_0x1e0f('0xe')](_0x1e0f('0x27'),_0x1045fc,JSON[_0x1e0f('0x1f')](_0x62e53f));_0x353dc8(_0x62e53f);})[_0x1e0f('0x15')](function(_0x423b18){logger[_0x1e0f('0x11')](_0x1e0f('0x27'),_0x423b18[_0x1e0f('0x12')],_0x1045fc);_0x567d7b(_0x4150ec['error'](0x1f4,_0x423b18[_0x1e0f('0x12')]));});});};exports[_0x1e0f('0x28')]=function(_0x461642){var _0x123e0f=this;return new Promise(function(_0x5eef05,_0x332ae4){return db[_0x1e0f('0x24')][_0x1e0f('0x29')]({'where':_0x461642[_0x1e0f('0x18')]?_0x461642[_0x1e0f('0x18')]['where']||null:null})[_0x1e0f('0xb')](function(_0x1dff84){logger['info'](_0x1e0f('0x28'),_0x461642);logger['debug']('DestroyCmHopper',_0x461642,JSON['stringify'](_0x1dff84));_0x5eef05(_0x1dff84);})[_0x1e0f('0x15')](function(_0x367045){logger[_0x1e0f('0x11')]('DestroyCmHopper',_0x367045['message'],_0x461642);_0x332ae4(_0x123e0f[_0x1e0f('0x11')](0x1f4,_0x367045[_0x1e0f('0x12')]));});});};exports[_0x1e0f('0x2a')]=function(_0x4bf24f){var _0x3af782=this;return new Promise(function(_0xf0ec93,_0x1e8ac8){return db['CmContact'][_0x1e0f('0x2b')]()['then'](function(_0xa4c477){return db[_0x1e0f('0x2c')]['transaction'](function(_0x74c40c){return db['CmHopper'][_0x1e0f('0x17')]({'where':_0x4bf24f[_0x1e0f('0x18')]?_0x4bf24f[_0x1e0f('0x18')][_0x1e0f('0x19')]||null:null,'attributes':_0x4bf24f[_0x1e0f('0x18')]?_0x4bf24f[_0x1e0f('0x18')][_0x1e0f('0x1a')]||null:null,'limit':_0x4bf24f[_0x1e0f('0x18')]?_0x4bf24f[_0x1e0f('0x18')][_0x1e0f('0x1b')]||null:null,'order':_0x4bf24f[_0x1e0f('0x18')]?_0x4bf24f[_0x1e0f('0x18')][_0x1e0f('0x2d')]||null:null,'transaction':_0x74c40c,'lock':_0x74c40c[_0x1e0f('0x2e')][_0x1e0f('0x2f')],'include':[{'model':db[_0x1e0f('0x30')],'as':'Contact','attributes':_[_0x1e0f('0x31')](_0xa4c477)},{'model':db['User'],'as':_0x1e0f('0x32'),'attributes':['id',_0x1e0f('0x33'),'voicePause']}]})[_0x1e0f('0xb')](function(_0x16d6b3){var _0x56e2e3=[];var _0x102d55=[];for(var _0x1d79c7=0x0;_0x1d79c7<_0x16d6b3['length'];_0x1d79c7+=0x1){var _0x16781f=_0x16d6b3[_0x1d79c7][_0x1e0f('0x34')];if(_0x16781f===null){_0x56e2e3[_0x1e0f('0x35')](_0x16d6b3[_0x1d79c7][_0x1e0f('0x36')](_0x4bf24f[_0x1e0f('0x26')],{'transaction':_0x74c40c}));}else if(!_0x102d55[_0x1e0f('0x37')](_0x16781f)){_0x102d55[_0x1e0f('0x35')](_0x16781f);_0x56e2e3[_0x1e0f('0x35')](_0x16d6b3[_0x1d79c7][_0x1e0f('0x36')](_0x4bf24f[_0x1e0f('0x26')],{'transaction':_0x74c40c}));}}return BPromise['all'](_0x56e2e3);});})[_0x1e0f('0xb')](function(_0x582138){logger['info'](_0x1e0f('0x2a'),_0x4bf24f);logger['debug'](_0x1e0f('0x2a'),_0x4bf24f,JSON[_0x1e0f('0x1f')](_0x582138));_0xf0ec93(_0x582138);})['catch'](function(_0x4c67f6){logger[_0x1e0f('0x11')](_0x1e0f('0x2a'),_0x4c67f6[_0x1e0f('0x12')],_0x4bf24f);_0x1e8ac8(_0x3af782[_0x1e0f('0x11')](0x1f4,_0x4c67f6[_0x1e0f('0x12')]));});});});};exports[_0x1e0f('0x38')]=function(_0x70a4b0){var _0xd95e35=this;return new Promise(function(_0x14f130,_0x11bbb1){return db[_0x1e0f('0x2c')]['transaction'](function(_0x5d2733){return db['CmHopperFinal'][_0x1e0f('0x25')](_0x70a4b0['body'],{'raw':_0x70a4b0['options']?_0x70a4b0[_0x1e0f('0x18')]['raw']===undefined?!![]:![]:!![],'transaction':_0x5d2733})[_0x1e0f('0xb')](function(){return db['CmHopper'][_0x1e0f('0x29')]({'where':_0x70a4b0['options']?_0x70a4b0[_0x1e0f('0x18')]['where']||null:null,'transaction':_0x5d2733});});})['then'](function(_0x3fc5cb){logger[_0x1e0f('0xc')](_0x1e0f('0x38'),_0x70a4b0);logger[_0x1e0f('0xe')]('MoveContactManagedDialer',_0x70a4b0,JSON['stringify'](_0x3fc5cb));_0x14f130(_0x3fc5cb);})['catch'](function(_0x157209){logger[_0x1e0f('0x11')](_0x1e0f('0x38'),_0x157209[_0x1e0f('0x12')],_0x70a4b0);_0x11bbb1(_0xd95e35['error'](0x1f4,_0x157209[_0x1e0f('0x12')]));});});};exports[_0x1e0f('0x39')]=function(_0xe2ef84){var _0x587046=this;return new Promise(function(_0x5d4db3,_0xbb89a9){return db[_0x1e0f('0x24')][_0x1e0f('0x17')]({'raw':_0xe2ef84['options']?_0xe2ef84['options']['raw']===undefined?!![]:![]:!![],'where':_0xe2ef84[_0x1e0f('0x18')]?_0xe2ef84[_0x1e0f('0x18')][_0x1e0f('0x19')]||null:null,'attributes':[[db[_0x1e0f('0x2c')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x1e0f('0x2c')][_0x1e0f('0x3a')](_0x1e0f('0x3b')+util[_0x1e0f('0x3c')]('\x22%s\x22',moment()['format'](_0x1e0f('0x3d')))+_0x1e0f('0x3e')))),'contactsRescheduled']]})[_0x1e0f('0xb')](function(_0x15f8ad){logger[_0x1e0f('0xc')](_0x1e0f('0x39'),_0xe2ef84);logger['debug']('CountReScheduled',_0xe2ef84,JSON[_0x1e0f('0x1f')](_0x15f8ad));_0x5d4db3(_0x15f8ad);})[_0x1e0f('0x15')](function(_0x463111){logger[_0x1e0f('0x11')]('CountReScheduled',_0x463111[_0x1e0f('0x12')],_0xe2ef84);_0xbb89a9(_0x587046[_0x1e0f('0x11')](0x1f4,_0x463111[_0x1e0f('0x12')]));});});};exports[_0x1e0f('0x3f')]=function(_0x13d1af){var _0xca94fb=this;return new Promise(function(_0x7d1393,_0x563b72){return db[_0x1e0f('0x30')][_0x1e0f('0x2b')]()[_0x1e0f('0xb')](function(_0x4ba8bc){return db['sequelize'][_0x1e0f('0x40')](function(_0x253af7){return db['CmHopper'][_0x1e0f('0x17')]({'where':_0x13d1af[_0x1e0f('0x18')]?_0x13d1af['options'][_0x1e0f('0x19')]||null:null,'attributes':_0x13d1af[_0x1e0f('0x18')]?_0x13d1af['options'][_0x1e0f('0x1a')]||null:null,'limit':0x1,'order':_0x13d1af[_0x1e0f('0x18')]?_0x13d1af[_0x1e0f('0x18')]['order']||null:null,'group':db['CmHopper'][_0x1e0f('0x34')],'transaction':_0x253af7,'lock':_0x253af7['LOCK']['UPDATE'],'include':_0x13d1af[_0x1e0f('0x18')]?_0x13d1af[_0x1e0f('0x18')][_0x1e0f('0x1c')]?_[_0x1e0f('0x1d')](_0x13d1af[_0x1e0f('0x18')][_0x1e0f('0x1c')],function(_0x197048){return{'model':db[_0x197048['model']],'as':_0x197048['as'],'attributes':_0x197048[_0x1e0f('0x1a')],'include':_0x197048[_0x1e0f('0x1c')]?_['map'](_0x197048[_0x1e0f('0x1c')],function(_0x59daaf){return{'model':db[_0x59daaf[_0x1e0f('0x1e')]],'as':_0x59daaf['as'],'attributes':_0x59daaf[_0x1e0f('0x1a')],'include':_0x59daaf['include']?_[_0x1e0f('0x1d')](_0x59daaf[_0x1e0f('0x1c')],function(_0x1e6894){return{'model':db[_0x1e6894[_0x1e0f('0x1e')]],'as':_0x1e6894['as'],'attributes':_0x1e6894[_0x1e0f('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x1e0f('0xb')](function(_0x3a91f6){var _0x2239a0=[];for(var _0x51242b=0x0;_0x51242b<_0x3a91f6[_0x1e0f('0x41')];_0x51242b+=0x1){_0x2239a0['push'](_0x3a91f6[_0x51242b][_0x1e0f('0x36')](_0x13d1af[_0x1e0f('0x26')],{'transaction':_0x253af7}));}return BPromise[_0x1e0f('0x42')](_0x2239a0);});})[_0x1e0f('0xb')](function(_0x942505){logger[_0x1e0f('0xc')](_0x1e0f('0x3f'),_0x13d1af);logger['debug'](_0x1e0f('0x3f'),_0x13d1af,JSON[_0x1e0f('0x1f')](_0x942505));_0x7d1393(_0x942505);})[_0x1e0f('0x15')](function(_0x4ea281){logger[_0x1e0f('0x11')]('GetContactRecallMe',_0x4ea281[_0x1e0f('0x12')],_0x13d1af);_0x563b72(_0xca94fb['error'](0x1f4,_0x4ea281[_0x1e0f('0x12')]));});});});};exports[_0x1e0f('0x43')]=function(_0xffcdc2){var _0xaba0cf=this;return new Promise(function(_0x1e8231,_0x26e9c6){db['CmContact'][_0x1e0f('0x2b')]()['then'](function(_0x2661c9){return db[_0x1e0f('0x24')]['findAll']({'raw':_0xffcdc2['options']?_0xffcdc2[_0x1e0f('0x18')][_0x1e0f('0x21')]===undefined?!![]:![]:!![],'where':_0xffcdc2[_0x1e0f('0x18')]?_0xffcdc2['options'][_0x1e0f('0x19')]||null:null,'attributes':_0xffcdc2['options']?_0xffcdc2[_0x1e0f('0x18')][_0x1e0f('0x1a')]||null:null,'limit':_0xffcdc2[_0x1e0f('0x18')]?_0xffcdc2[_0x1e0f('0x18')][_0x1e0f('0x1b')]||null:null,'include':_0xffcdc2[_0x1e0f('0x18')]?_0xffcdc2[_0x1e0f('0x18')][_0x1e0f('0x1c')]?_[_0x1e0f('0x1d')](_0xffcdc2[_0x1e0f('0x18')][_0x1e0f('0x1c')],function(_0x622f0){return{'model':db[_0x622f0[_0x1e0f('0x1e')]],'as':_0x622f0['as'],'attributes':_0x622f0['as']===_0x1e0f('0x44')?_[_0x1e0f('0x31')](_0x2661c9):_0x622f0['attributes'],'include':_0x622f0['include']?_[_0x1e0f('0x1d')](_0x622f0[_0x1e0f('0x1c')],function(_0x34f596){return{'model':db[_0x34f596[_0x1e0f('0x1e')]],'as':_0x34f596['as'],'attributes':_0x34f596['attributes'],'include':_0x34f596['include']?_['map'](_0x34f596[_0x1e0f('0x1c')],function(_0x31d9c5){return{'model':db[_0x31d9c5[_0x1e0f('0x1e')]],'as':_0x31d9c5['as'],'attributes':_0x31d9c5[_0x1e0f('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x1e0f('0xb')](function(_0x47601d){logger[_0x1e0f('0xc')](_0x1e0f('0x16'),_0xffcdc2);logger[_0x1e0f('0xe')](_0x1e0f('0x16'),_0xffcdc2,JSON[_0x1e0f('0x1f')](_0x47601d));_0x1e8231(_0x47601d);})[_0x1e0f('0x15')](function(_0x4bcc61){logger[_0x1e0f('0x11')]('GetCmHopper',_0x4bcc61['message'],_0xffcdc2);_0x26e9c6(_0xaba0cf['error'](0x1f4,_0x4bcc61[_0x1e0f('0x12')]));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index a48fd1a..6a9f296 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 _0x22d2=['express','Router','../../components/auth/service','../../config/environment','./cmHopper.controller','get','isAuthenticated','describe','/opencontacts','/:id','show','post','create','/preview','put','update','destroy','exports','multer','util','path','connect-timeout'];(function(_0x516d47,_0x29055e){var _0x46421b=function(_0x39f986){while(--_0x39f986){_0x516d47['push'](_0x516d47['shift']());}};_0x46421b(++_0x29055e);}(_0x22d2,0x15c));var _0x222d=function(_0x1227ce,_0x2ae2a2){_0x1227ce=_0x1227ce-0x0;var _0x53f6c0=_0x22d2[_0x1227ce];return _0x53f6c0;};'use strict';var multer=require(_0x222d('0x0'));var util=require(_0x222d('0x1'));var path=require(_0x222d('0x2'));var timeout=require(_0x222d('0x3'));var express=require(_0x222d('0x4'));var router=express[_0x222d('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x222d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x222d('0x7'));var controller=require(_0x222d('0x8'));router[_0x222d('0x9')]('/',auth[_0x222d('0xa')](),controller['index']);router[_0x222d('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x222d('0xb')]);router[_0x222d('0x9')](_0x222d('0xc'),auth[_0x222d('0xa')](),controller['getOpenContacts']);router[_0x222d('0x9')](_0x222d('0xd'),auth[_0x222d('0xa')](),controller[_0x222d('0xe')]);router[_0x222d('0xf')]('/',auth[_0x222d('0xa')](),controller[_0x222d('0x10')]);router['post'](_0x222d('0x11'),auth[_0x222d('0xa')](),controller['getPreview']);router[_0x222d('0x12')](_0x222d('0xd'),auth['isAuthenticated'](),controller[_0x222d('0x13')]);router['delete'](_0x222d('0xd'),auth['isAuthenticated'](),controller[_0x222d('0x14')]);module[_0x222d('0x15')]=router; \ No newline at end of file +var _0x0e09=['getOpenContacts','/:id','post','create','/preview','getPreview','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopper.controller','get','index','/describe','isAuthenticated','describe','/opencontacts'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x0e09,0x1bb));var _0x90e0=function(_0x33b43a,_0x5c7594){_0x33b43a=_0x33b43a-0x0;var _0x307b4e=_0x0e09[_0x33b43a];return _0x307b4e;};'use strict';var multer=require(_0x90e0('0x0'));var util=require(_0x90e0('0x1'));var path=require(_0x90e0('0x2'));var timeout=require(_0x90e0('0x3'));var express=require(_0x90e0('0x4'));var router=express[_0x90e0('0x5')]();var fs_extra=require(_0x90e0('0x6'));var auth=require(_0x90e0('0x7'));var interaction=require(_0x90e0('0x8'));var config=require('../../config/environment');var controller=require(_0x90e0('0x9'));router[_0x90e0('0xa')]('/',auth['isAuthenticated'](),controller[_0x90e0('0xb')]);router[_0x90e0('0xa')](_0x90e0('0xc'),auth[_0x90e0('0xd')](),controller[_0x90e0('0xe')]);router[_0x90e0('0xa')](_0x90e0('0xf'),auth['isAuthenticated'](),controller[_0x90e0('0x10')]);router[_0x90e0('0xa')](_0x90e0('0x11'),auth[_0x90e0('0xd')](),controller['show']);router[_0x90e0('0x12')]('/',auth[_0x90e0('0xd')](),controller[_0x90e0('0x13')]);router[_0x90e0('0x12')](_0x90e0('0x14'),auth[_0x90e0('0xd')](),controller[_0x90e0('0x15')]);router[_0x90e0('0x16')](_0x90e0('0x11'),auth['isAuthenticated'](),controller[_0x90e0('0x17')]);router[_0x90e0('0x18')](_0x90e0('0x11'),auth[_0x90e0('0xd')](),controller[_0x90e0('0x19')]);module[_0x90e0('0x1a')]=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index c40f30c..43cb062 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 _0xbc48=['moment','sequelize','exports','INTEGER','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x12e6e5,_0x39855b){var _0x4ef6ce=function(_0x3e06f3){while(--_0x3e06f3){_0x12e6e5['push'](_0x12e6e5['shift']());}};_0x4ef6ce(++_0x39855b);}(_0xbc48,0x118));var _0x8bc4=function(_0x519ad5,_0x2dbb51){_0x519ad5=_0x519ad5-0x0;var _0x58c6e0=_0xbc48[_0x519ad5];return _0x58c6e0;};'use strict';var moment=require(_0x8bc4('0x0'));var Sequelize=require(_0x8bc4('0x1'));module[_0x8bc4('0x2')]={'CmHopperId':{'type':Sequelize[_0x8bc4('0x3')]},'phone':{'type':Sequelize[_0x8bc4('0x4')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x8bc4('0x3')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x8bc4('0x5')],'defaultValue':moment()[_0x8bc4('0x6')](_0x8bc4('0x7'))},'countbusyretry':{'type':Sequelize[_0x8bc4('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x8bc4('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x8bc4('0x3')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x8bc4('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x8bc4('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x8bc4('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x5f9d=['INTEGER','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','moment','sequelize'];(function(_0x5dded2,_0xbb9a46){var _0x33ec96=function(_0x6def98){while(--_0x6def98){_0x5dded2['push'](_0x5dded2['shift']());}};_0x33ec96(++_0xbb9a46);}(_0x5f9d,0x1c5));var _0xd5f9=function(_0x286910,_0x233d46){_0x286910=_0x286910-0x0;var _0x9ec39f=_0x5f9d[_0x286910];return _0x9ec39f;};'use strict';var moment=require(_0xd5f9('0x0'));var Sequelize=require(_0xd5f9('0x1'));module['exports']={'CmHopperId':{'type':Sequelize[_0xd5f9('0x2')]},'phone':{'type':Sequelize[_0xd5f9('0x3')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0xd5f9('0x2')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0xd5f9('0x4')],'defaultValue':moment()[_0xd5f9('0x5')](_0xd5f9('0x6'))},'countbusyretry':{'type':Sequelize[_0xd5f9('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xd5f9('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0xd5f9('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xd5f9('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xd5f9('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xd5f9('0x2')],'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 37cb2a7..b679214 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 _0x6db1=['create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','crypto','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','reject','save','then','destroy','get','CmHopperAdditionalPhones','UserProfileResource','error','stack','name','send','index','CmHopperAdditionalPhone','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','options','includeAll','include','findAll','rows','show','params','keys','length','find','catch'];(function(_0x414df0,_0x3b902f){var _0x2cf357=function(_0x528c3c){while(--_0x528c3c){_0x414df0['push'](_0x414df0['shift']());}};_0x2cf357(++_0x3b902f);}(_0x6db1,0xad));var _0x16db=function(_0x1d2ed3,_0x57c771){_0x1d2ed3=_0x1d2ed3-0x0;var _0x5c89c6=_0x6db1[_0x1d2ed3];return _0x5c89c6;};'use strict';var emlformat=require(_0x16db('0x0'));var rimraf=require(_0x16db('0x1'));var zipdir=require(_0x16db('0x2'));var jsonpatch=require(_0x16db('0x3'));var rp=require(_0x16db('0x4'));var moment=require(_0x16db('0x5'));var BPromise=require(_0x16db('0x6'));var Mustache=require(_0x16db('0x7'));var util=require('util');var path=require(_0x16db('0x8'));var sox=require(_0x16db('0x9'));var csv=require(_0x16db('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x16db('0xb'));var _=require(_0x16db('0xc'));var squel=require('squel');var crypto=require(_0x16db('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x16db('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x16db('0xe'));var authService=require(_0x16db('0xf'));var qs=require(_0x16db('0x10'));var as=require(_0x16db('0x11'));var hardwareService=require(_0x16db('0x12'));var logger=require(_0x16db('0x13'))('api');var utils=require(_0x16db('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x16db('0x15'));var db=require(_0x16db('0x16'))['db'];function respondWithStatusCode(_0x3d6423,_0x391a78){_0x391a78=_0x391a78||0xcc;return function(_0x1f93d4){if(_0x1f93d4){return _0x3d6423[_0x16db('0x17')](_0x391a78);}return _0x3d6423[_0x16db('0x18')](_0x391a78)[_0x16db('0x19')]();};}function respondWithResult(_0x1d7f89,_0x1c3779){_0x1c3779=_0x1c3779||0xc8;return function(_0x4615b6){if(_0x4615b6){return _0x1d7f89[_0x16db('0x18')](_0x1c3779)[_0x16db('0x1a')](_0x4615b6);}};}function respondWithFilteredResult(_0x409621,_0x5dc299){return function(_0x16f10f){if(_0x16f10f){var _0x297a17=typeof _0x5dc299[_0x16db('0x1b')]===_0x16db('0x1c')&&typeof _0x5dc299['limit']===_0x16db('0x1c');var _0x567df9=_0x16f10f[_0x16db('0x1d')];var _0xf9d57d=_0x297a17?0x0:_0x5dc299[_0x16db('0x1b')];var _0x364384=_0x297a17?_0x16f10f[_0x16db('0x1d')]:_0x5dc299[_0x16db('0x1b')]+_0x5dc299['limit'];var _0x157e12;if(_0x364384>=_0x567df9){_0x364384=_0x567df9;_0x157e12=0xc8;}else{_0x157e12=0xce;}_0x409621['status'](_0x157e12);return _0x409621['set'](_0x16db('0x1e'),_0xf9d57d+'-'+_0x364384+'/'+_0x567df9)['json'](_0x16f10f);}return null;};}function patchUpdates(_0x57f406){return function(_0x2b45c7){try{jsonpatch[_0x16db('0x1f')](_0x2b45c7,_0x57f406,!![]);}catch(_0x16ceb2){return BPromise[_0x16db('0x20')](_0x16ceb2);}return _0x2b45c7[_0x16db('0x21')]();};}function saveUpdates(_0x90c535,_0x4107e8){return function(_0x3e01d8){if(_0x3e01d8){return _0x3e01d8['update'](_0x90c535)[_0x16db('0x22')](function(_0x33d23e){return _0x33d23e;});}return null;};}function removeEntity(_0x1d873f,_0x3094aa){return function(_0xcebafc){if(_0xcebafc){return _0xcebafc[_0x16db('0x23')]()[_0x16db('0x22')](function(){var _0x1e2236=_0xcebafc[_0x16db('0x24')]({'plain':!![]});var _0x483804=_0x16db('0x25');return db[_0x16db('0x26')]['destroy']({'where':{'type':_0x483804,'resourceId':_0x1e2236['id']}})['then'](function(){return _0xcebafc;});})[_0x16db('0x22')](function(){_0x1d873f[_0x16db('0x18')](0xcc)[_0x16db('0x19')]();});}};}function handleEntityNotFound(_0x1dce76,_0x2f803d){return function(_0x4b109c){if(!_0x4b109c){_0x1dce76['sendStatus'](0x194);}return _0x4b109c;};}function handleError(_0x4b3f1f,_0x2e3013){_0x2e3013=_0x2e3013||0x1f4;return function(_0x18d5dd){logger[_0x16db('0x27')](_0x18d5dd[_0x16db('0x28')]);if(_0x18d5dd['name']){delete _0x18d5dd[_0x16db('0x29')];}_0x4b3f1f[_0x16db('0x18')](_0x2e3013)[_0x16db('0x2a')](_0x18d5dd);};}exports[_0x16db('0x2b')]=function(_0x345c4a,_0x17164b){var _0x3218c3={},_0x1d4149={},_0x405dc1={'count':0x0,'rows':[]};var _0x1c198f=_['map'](db[_0x16db('0x2c')][_0x16db('0x2d')],function(_0x3a18fc){return{'name':_0x3a18fc[_0x16db('0x2e')],'type':_0x3a18fc[_0x16db('0x2f')][_0x16db('0x30')]};});_0x1d4149[_0x16db('0x31')]=_['map'](_0x1c198f,_0x16db('0x29'));_0x1d4149[_0x16db('0x32')]=_['keys'](_0x345c4a[_0x16db('0x32')]);_0x1d4149[_0x16db('0x33')]=_[_0x16db('0x34')](_0x1d4149[_0x16db('0x31')],_0x1d4149[_0x16db('0x32')]);_0x3218c3[_0x16db('0x35')]=_[_0x16db('0x34')](_0x1d4149[_0x16db('0x31')],qs[_0x16db('0x36')](_0x345c4a[_0x16db('0x32')][_0x16db('0x36')]));_0x3218c3[_0x16db('0x35')]=_0x3218c3[_0x16db('0x35')]['length']?_0x3218c3['attributes']:_0x1d4149[_0x16db('0x31')];if(!_0x345c4a[_0x16db('0x32')][_0x16db('0x37')](_0x16db('0x38'))){_0x3218c3[_0x16db('0x39')]=qs['limit'](_0x345c4a[_0x16db('0x32')][_0x16db('0x39')]);_0x3218c3[_0x16db('0x1b')]=qs['offset'](_0x345c4a[_0x16db('0x32')][_0x16db('0x1b')]);}_0x3218c3[_0x16db('0x3a')]=qs[_0x16db('0x3b')](_0x345c4a[_0x16db('0x32')]['sort']);_0x3218c3[_0x16db('0x3c')]=qs[_0x16db('0x33')](_[_0x16db('0x3d')](_0x345c4a[_0x16db('0x32')],_0x1d4149[_0x16db('0x33')]),_0x1c198f);if(_0x345c4a[_0x16db('0x32')][_0x16db('0x3e')]){_0x3218c3[_0x16db('0x3c')]=_[_0x16db('0x3f')](_0x3218c3[_0x16db('0x3c')],{'$or':_[_0x16db('0x40')](_0x1c198f,function(_0x72cbf5){if(_0x72cbf5['type']!=='VIRTUAL'){var _0x16ad57={};_0x16ad57[_0x72cbf5[_0x16db('0x29')]]={'$like':'%'+_0x345c4a[_0x16db('0x32')][_0x16db('0x3e')]+'%'};return _0x16ad57;}})});}_0x3218c3=_[_0x16db('0x3f')]({},_0x3218c3,_0x345c4a[_0x16db('0x41')]);var _0x145f7b={'where':_0x3218c3['where']};return db['CmHopperAdditionalPhone']['count'](_0x145f7b)[_0x16db('0x22')](function(_0x1274c8){_0x405dc1[_0x16db('0x1d')]=_0x1274c8;if(_0x345c4a[_0x16db('0x32')][_0x16db('0x42')]){_0x3218c3[_0x16db('0x43')]=[{'all':!![]}];}return db[_0x16db('0x2c')][_0x16db('0x44')](_0x3218c3);})['then'](function(_0x217549){_0x405dc1[_0x16db('0x45')]=_0x217549;return _0x405dc1;})['then'](respondWithFilteredResult(_0x17164b,_0x3218c3))['catch'](handleError(_0x17164b,null));};exports[_0x16db('0x46')]=function(_0x4009b2,_0x59529a){var _0x1eec2f={'raw':!![],'where':{'id':_0x4009b2[_0x16db('0x47')]['id']}},_0x505ae3={};_0x505ae3[_0x16db('0x31')]=_[_0x16db('0x48')](db[_0x16db('0x2c')]['rawAttributes']);_0x505ae3[_0x16db('0x32')]=_[_0x16db('0x48')](_0x4009b2[_0x16db('0x32')]);_0x505ae3[_0x16db('0x33')]=_[_0x16db('0x34')](_0x505ae3[_0x16db('0x31')],_0x505ae3[_0x16db('0x32')]);_0x1eec2f[_0x16db('0x35')]=_[_0x16db('0x34')](_0x505ae3[_0x16db('0x31')],qs[_0x16db('0x36')](_0x4009b2[_0x16db('0x32')][_0x16db('0x36')]));_0x1eec2f[_0x16db('0x35')]=_0x1eec2f[_0x16db('0x35')][_0x16db('0x49')]?_0x1eec2f['attributes']:_0x505ae3['model'];if(_0x4009b2[_0x16db('0x32')]['includeAll']){_0x1eec2f[_0x16db('0x43')]=[{'all':!![]}];}_0x1eec2f=_[_0x16db('0x3f')]({},_0x1eec2f,_0x4009b2[_0x16db('0x41')]);return db[_0x16db('0x2c')][_0x16db('0x4a')](_0x1eec2f)[_0x16db('0x22')](handleEntityNotFound(_0x59529a,null))[_0x16db('0x22')](respondWithResult(_0x59529a,null))[_0x16db('0x4b')](handleError(_0x59529a,null));};exports[_0x16db('0x4c')]=function(_0x315ed5,_0x3eb368){return db[_0x16db('0x2c')][_0x16db('0x4c')](_0x315ed5[_0x16db('0x4d')],{})[_0x16db('0x22')](function(_0x23aa09){var _0x4d971a=_0x315ed5[_0x16db('0x4e')]['get']({'plain':!![]});if(!_0x4d971a)throw new Error(_0x16db('0x4f'));if(_0x4d971a['role']===_0x16db('0x4e')){var _0x32af44=_0x23aa09[_0x16db('0x24')]({'plain':!![]});var _0x3019c6='CmHopperAdditionalPhones';return db[_0x16db('0x50')]['find']({'where':{'name':_0x3019c6,'userProfileId':_0x4d971a['userProfileId']},'raw':!![]})[_0x16db('0x22')](function(_0x231399){if(_0x231399&&_0x231399['autoAssociation']===0x0){return db[_0x16db('0x26')][_0x16db('0x4c')]({'name':_0x32af44['name'],'resourceId':_0x32af44['id'],'type':_0x231399['name'],'sectionId':_0x231399['id']},{})[_0x16db('0x22')](function(){return _0x23aa09;});}else{return _0x23aa09;}})[_0x16db('0x4b')](function(_0x33cd56){logger['error'](_0x16db('0x51'),_0x33cd56);throw _0x33cd56;});}return _0x23aa09;})[_0x16db('0x22')](respondWithResult(_0x3eb368,0xc9))[_0x16db('0x4b')](handleError(_0x3eb368,null));};exports[_0x16db('0x52')]=function(_0x3bf3eb,_0x3d26ac){if(_0x3bf3eb['body']['id']){delete _0x3bf3eb['body']['id'];}return db[_0x16db('0x2c')][_0x16db('0x4a')]({'where':{'id':_0x3bf3eb['params']['id']}})['then'](handleEntityNotFound(_0x3d26ac,null))[_0x16db('0x22')](saveUpdates(_0x3bf3eb[_0x16db('0x4d')],null))[_0x16db('0x22')](respondWithResult(_0x3d26ac,null))[_0x16db('0x4b')](handleError(_0x3d26ac,null));};exports[_0x16db('0x23')]=function(_0xd40622,_0x186331){return db[_0x16db('0x2c')][_0x16db('0x4a')]({'where':{'id':_0xd40622[_0x16db('0x47')]['id']}})[_0x16db('0x22')](handleEntityNotFound(_0x186331,null))[_0x16db('0x22')](removeEntity(_0x186331,null))[_0x16db('0x4b')](handleError(_0x186331,null));}; \ No newline at end of file +var _0x22d0=['desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','get','CmHopperAdditionalPhones','UserProfileResource','error','stack','send','index','map','CmHopperAdditionalPhone','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','order','sort','pick','filter','where','merge','VIRTUAL','name','catch','params','rawAttributes','includeAll','include','options','create','body','user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x22d0,0x8e));var _0x022d=function(_0x32a884,_0x183853){_0x32a884=_0x32a884-0x0;var _0x242f9b=_0x22d0[_0x32a884];return _0x242f9b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x022d('0x0'));var rp=require(_0x022d('0x1'));var moment=require(_0x022d('0x2'));var BPromise=require(_0x022d('0x3'));var Mustache=require(_0x022d('0x4'));var util=require(_0x022d('0x5'));var path=require(_0x022d('0x6'));var sox=require('sox');var csv=require(_0x022d('0x7'));var ejs=require(_0x022d('0x8'));var fs=require('fs');var fs_extra=require(_0x022d('0x9'));var _=require('lodash');var squel=require(_0x022d('0xa'));var crypto=require(_0x022d('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x022d('0xc'));var toCsv=require(_0x022d('0x7'));var querystring=require(_0x022d('0xd'));var Papa=require(_0x022d('0xe'));var Redis=require('ioredis');var authService=require(_0x022d('0xf'));var qs=require(_0x022d('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x022d('0x11'));var logger=require('../../config/logger')(_0x022d('0x12'));var utils=require(_0x022d('0x13'));var config=require(_0x022d('0x14'));var licenseUtil=require(_0x022d('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x51f85a,_0x1a3663){_0x1a3663=_0x1a3663||0xcc;return function(_0x2fd6c0){if(_0x2fd6c0){return _0x51f85a[_0x022d('0x16')](_0x1a3663);}return _0x51f85a['status'](_0x1a3663)[_0x022d('0x17')]();};}function respondWithResult(_0x38b657,_0x59485c){_0x59485c=_0x59485c||0xc8;return function(_0x1aa533){if(_0x1aa533){return _0x38b657[_0x022d('0x18')](_0x59485c)[_0x022d('0x19')](_0x1aa533);}};}function respondWithFilteredResult(_0x59414c,_0x282d69){return function(_0x1e7912){if(_0x1e7912){var _0x285a41=typeof _0x282d69[_0x022d('0x1a')]===_0x022d('0x1b')&&typeof _0x282d69[_0x022d('0x1c')]===_0x022d('0x1b');var _0x258358=_0x1e7912['count'];var _0x186131=_0x285a41?0x0:_0x282d69['offset'];var _0x130238=_0x285a41?_0x1e7912[_0x022d('0x1d')]:_0x282d69[_0x022d('0x1a')]+_0x282d69[_0x022d('0x1c')];var _0x54881b;if(_0x130238>=_0x258358){_0x130238=_0x258358;_0x54881b=0xc8;}else{_0x54881b=0xce;}_0x59414c[_0x022d('0x18')](_0x54881b);return _0x59414c['set'](_0x022d('0x1e'),_0x186131+'-'+_0x130238+'/'+_0x258358)['json'](_0x1e7912);}return null;};}function patchUpdates(_0x25cdec){return function(_0x1d99f6){try{jsonpatch['apply'](_0x1d99f6,_0x25cdec,!![]);}catch(_0x1d73cc){return BPromise[_0x022d('0x1f')](_0x1d73cc);}return _0x1d99f6[_0x022d('0x20')]();};}function saveUpdates(_0x561661,_0x31e6e7){return function(_0x3fe553){if(_0x3fe553){return _0x3fe553[_0x022d('0x21')](_0x561661)[_0x022d('0x22')](function(_0x4a88da){return _0x4a88da;});}return null;};}function removeEntity(_0x5cb95a,_0x574ca8){return function(_0x5cdd43){if(_0x5cdd43){return _0x5cdd43[_0x022d('0x23')]()[_0x022d('0x22')](function(){var _0x190ec0=_0x5cdd43[_0x022d('0x24')]({'plain':!![]});var _0x4eea4d=_0x022d('0x25');return db[_0x022d('0x26')]['destroy']({'where':{'type':_0x4eea4d,'resourceId':_0x190ec0['id']}})[_0x022d('0x22')](function(){return _0x5cdd43;});})[_0x022d('0x22')](function(){_0x5cb95a[_0x022d('0x18')](0xcc)[_0x022d('0x17')]();});}};}function handleEntityNotFound(_0x39b1cd,_0x2b1141){return function(_0xb5f9c2){if(!_0xb5f9c2){_0x39b1cd[_0x022d('0x16')](0x194);}return _0xb5f9c2;};}function handleError(_0x5df377,_0x5182b1){_0x5182b1=_0x5182b1||0x1f4;return function(_0x3b59dc){logger[_0x022d('0x27')](_0x3b59dc[_0x022d('0x28')]);if(_0x3b59dc['name']){delete _0x3b59dc['name'];}_0x5df377['status'](_0x5182b1)[_0x022d('0x29')](_0x3b59dc);};}exports[_0x022d('0x2a')]=function(_0x59ad6a,_0x3435ed){var _0x5dad9a={},_0x188a41={},_0x597c20={'count':0x0,'rows':[]};var _0x2aa759=_[_0x022d('0x2b')](db[_0x022d('0x2c')]['rawAttributes'],function(_0x20fc3e){return{'name':_0x20fc3e[_0x022d('0x2d')],'type':_0x20fc3e[_0x022d('0x2e')][_0x022d('0x2f')]};});_0x188a41[_0x022d('0x30')]=_[_0x022d('0x2b')](_0x2aa759,'name');_0x188a41['query']=_[_0x022d('0x31')](_0x59ad6a[_0x022d('0x32')]);_0x188a41[_0x022d('0x33')]=_['intersection'](_0x188a41['model'],_0x188a41[_0x022d('0x32')]);_0x5dad9a[_0x022d('0x34')]=_[_0x022d('0x35')](_0x188a41['model'],qs[_0x022d('0x36')](_0x59ad6a[_0x022d('0x32')]['fields']));_0x5dad9a[_0x022d('0x34')]=_0x5dad9a[_0x022d('0x34')]['length']?_0x5dad9a[_0x022d('0x34')]:_0x188a41['model'];if(!_0x59ad6a[_0x022d('0x32')]['hasOwnProperty']('nolimit')){_0x5dad9a[_0x022d('0x1c')]=qs[_0x022d('0x1c')](_0x59ad6a[_0x022d('0x32')]['limit']);_0x5dad9a[_0x022d('0x1a')]=qs['offset'](_0x59ad6a[_0x022d('0x32')][_0x022d('0x1a')]);}_0x5dad9a[_0x022d('0x37')]=qs[_0x022d('0x38')](_0x59ad6a[_0x022d('0x32')][_0x022d('0x38')]);_0x5dad9a['where']=qs[_0x022d('0x33')](_[_0x022d('0x39')](_0x59ad6a[_0x022d('0x32')],_0x188a41[_0x022d('0x33')]),_0x2aa759);if(_0x59ad6a['query'][_0x022d('0x3a')]){_0x5dad9a[_0x022d('0x3b')]=_[_0x022d('0x3c')](_0x5dad9a['where'],{'$or':_['map'](_0x2aa759,function(_0x15919f){if(_0x15919f[_0x022d('0x2e')]!==_0x022d('0x3d')){var _0x52bc60={};_0x52bc60[_0x15919f[_0x022d('0x3e')]]={'$like':'%'+_0x59ad6a['query'][_0x022d('0x3a')]+'%'};return _0x52bc60;}})});}_0x5dad9a=_['merge']({},_0x5dad9a,_0x59ad6a['options']);var _0x5685f6={'where':_0x5dad9a[_0x022d('0x3b')]};return db[_0x022d('0x2c')][_0x022d('0x1d')](_0x5685f6)[_0x022d('0x22')](function(_0x515060){_0x597c20['count']=_0x515060;if(_0x59ad6a[_0x022d('0x32')]['includeAll']){_0x5dad9a['include']=[{'all':!![]}];}return db['CmHopperAdditionalPhone']['findAll'](_0x5dad9a);})[_0x022d('0x22')](function(_0x2e52b5){_0x597c20['rows']=_0x2e52b5;return _0x597c20;})[_0x022d('0x22')](respondWithFilteredResult(_0x3435ed,_0x5dad9a))[_0x022d('0x3f')](handleError(_0x3435ed,null));};exports['show']=function(_0x5b0ede,_0x349639){var _0x4be8dd={'raw':!![],'where':{'id':_0x5b0ede[_0x022d('0x40')]['id']}},_0x3bc796={};_0x3bc796[_0x022d('0x30')]=_[_0x022d('0x31')](db[_0x022d('0x2c')][_0x022d('0x41')]);_0x3bc796['query']=_[_0x022d('0x31')](_0x5b0ede['query']);_0x3bc796[_0x022d('0x33')]=_['intersection'](_0x3bc796['model'],_0x3bc796['query']);_0x4be8dd[_0x022d('0x34')]=_['intersection'](_0x3bc796[_0x022d('0x30')],qs['fields'](_0x5b0ede[_0x022d('0x32')][_0x022d('0x36')]));_0x4be8dd[_0x022d('0x34')]=_0x4be8dd[_0x022d('0x34')]['length']?_0x4be8dd[_0x022d('0x34')]:_0x3bc796[_0x022d('0x30')];if(_0x5b0ede['query'][_0x022d('0x42')]){_0x4be8dd[_0x022d('0x43')]=[{'all':!![]}];}_0x4be8dd=_[_0x022d('0x3c')]({},_0x4be8dd,_0x5b0ede[_0x022d('0x44')]);return db[_0x022d('0x2c')]['find'](_0x4be8dd)[_0x022d('0x22')](handleEntityNotFound(_0x349639,null))[_0x022d('0x22')](respondWithResult(_0x349639,null))['catch'](handleError(_0x349639,null));};exports[_0x022d('0x45')]=function(_0x5e8b4a,_0x48c7b5){return db['CmHopperAdditionalPhone'][_0x022d('0x45')](_0x5e8b4a[_0x022d('0x46')],{})[_0x022d('0x22')](function(_0x410fbf){var _0x258c2e=_0x5e8b4a[_0x022d('0x47')][_0x022d('0x24')]({'plain':!![]});if(!_0x258c2e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x258c2e[_0x022d('0x48')]===_0x022d('0x47')){var _0x5dd804=_0x410fbf[_0x022d('0x24')]({'plain':!![]});var _0x346270='CmHopperAdditionalPhones';return db[_0x022d('0x49')]['find']({'where':{'name':_0x346270,'userProfileId':_0x258c2e[_0x022d('0x4a')]},'raw':!![]})[_0x022d('0x22')](function(_0x2cd264){if(_0x2cd264&&_0x2cd264['autoAssociation']===0x0){return db['UserProfileResource'][_0x022d('0x45')]({'name':_0x5dd804[_0x022d('0x3e')],'resourceId':_0x5dd804['id'],'type':_0x2cd264[_0x022d('0x3e')],'sectionId':_0x2cd264['id']},{})['then'](function(){return _0x410fbf;});}else{return _0x410fbf;}})[_0x022d('0x3f')](function(_0x3c7ea7){logger[_0x022d('0x27')](_0x022d('0x4b'),_0x3c7ea7);throw _0x3c7ea7;});}return _0x410fbf;})['then'](respondWithResult(_0x48c7b5,0xc9))[_0x022d('0x3f')](handleError(_0x48c7b5,null));};exports[_0x022d('0x21')]=function(_0x59432c,_0x4631e6){if(_0x59432c['body']['id']){delete _0x59432c[_0x022d('0x46')]['id'];}return db['CmHopperAdditionalPhone']['find']({'where':{'id':_0x59432c[_0x022d('0x40')]['id']}})[_0x022d('0x22')](handleEntityNotFound(_0x4631e6,null))[_0x022d('0x22')](saveUpdates(_0x59432c['body'],null))['then'](respondWithResult(_0x4631e6,null))[_0x022d('0x3f')](handleError(_0x4631e6,null));};exports[_0x022d('0x23')]=function(_0x2785e6,_0x3c4c92){return db[_0x022d('0x2c')][_0x022d('0x4c')]({'where':{'id':_0x2785e6[_0x022d('0x40')]['id']}})[_0x022d('0x22')](handleEntityNotFound(_0x3c4c92,null))[_0x022d('0x22')](removeEntity(_0x3c4c92,null))[_0x022d('0x3f')](handleError(_0x3c4c92,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index 2b022da..9e8a291 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 _0x4c5c=['api','moment','bluebird','path','rimraf','./cmHopperAdditionalPhone.attributes','define','CmHopperAdditionalPhone','util','../../config/logger'];(function(_0x54fc1f,_0x1703c2){var _0x53f699=function(_0x3fad74){while(--_0x3fad74){_0x54fc1f['push'](_0x54fc1f['shift']());}};_0x53f699(++_0x1703c2);}(_0x4c5c,0xc6));var _0xc4c5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4c5c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xc4c5('0x0'));var logger=require(_0xc4c5('0x1'))(_0xc4c5('0x2'));var moment=require(_0xc4c5('0x3'));var BPromise=require(_0xc4c5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc4c5('0x5'));var rimraf=require(_0xc4c5('0x6'));var config=require('../../config/environment');var attributes=require(_0xc4c5('0x7'));module['exports']=function(_0x39c2d1,_0x230291){return _0x39c2d1[_0xc4c5('0x8')](_0xc4c5('0x9'),attributes,{'tableName':'cm_hopper_additional_phones','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa4cd=['rimraf','../../config/environment','./cmHopperAdditionalPhone.attributes','exports','define','CmHopperAdditionalPhone','cm_hopper_additional_phones','lodash','../../config/logger','moment','request-promise','path'];(function(_0x2134b7,_0x1eb5e2){var _0x6c5914=function(_0x1da201){while(--_0x1da201){_0x2134b7['push'](_0x2134b7['shift']());}};_0x6c5914(++_0x1eb5e2);}(_0xa4cd,0x17b));var _0xda4c=function(_0x41bd6a,_0x318a99){_0x41bd6a=_0x41bd6a-0x0;var _0x527009=_0xa4cd[_0x41bd6a];return _0x527009;};'use strict';var _=require(_0xda4c('0x0'));var util=require('util');var logger=require(_0xda4c('0x1'))('api');var moment=require(_0xda4c('0x2'));var BPromise=require('bluebird');var rp=require(_0xda4c('0x3'));var fs=require('fs');var path=require(_0xda4c('0x4'));var rimraf=require(_0xda4c('0x5'));var config=require(_0xda4c('0x6'));var attributes=require(_0xda4c('0x7'));module[_0xda4c('0x8')]=function(_0x3b618b,_0x17b808){return _0x3b618b[_0xda4c('0x9')](_0xda4c('0xa'),attributes,{'tableName':_0xda4c('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 8d72d6f..f52df86 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 _0x641b=['countmachineretry','countagentrejectretry','entity','dialGlobalMaxRetry','countabandonedretry','ListId','waitTime','duration','activateAdditionalPhone','add','minutes','scheduledat','phone','isNil','countnosuchnumberretry','countdropretry','createdAt','updatedAt','hopperToAdditional\x20-\x20','additionalToHopper\x20-\x20','additional\x20-\x20','hopper\x20-\x20','sequelize','transaction','update','CmHopper','IncrementPreviewCounters','field','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CmHopperAdditionalPhone,\x20%s,\x20%s','result','catch','VerifyAdditionalPhones','findOne','body','ContactId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','ASC','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x57b03e,_0x45f3b3){var _0x21fa44=function(_0x40a7e2){while(--_0x40a7e2){_0x57b03e['push'](_0x57b03e['shift']());}};_0x21fa44(++_0x45f3b3);}(_0x641b,0x190));var _0xb641=function(_0x8df82b,_0x2b370d){_0x8df82b=_0x8df82b-0x0;var _0x5b87d8=_0x641b[_0x8df82b];return _0x5b87d8;};'use strict';var _=require('lodash');var util=require(_0xb641('0x0'));var moment=require('moment');var BPromise=require(_0xb641('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb641('0x2'));var db=require(_0xb641('0x3'))['db'];var utils=require(_0xb641('0x4'));var logger=require(_0xb641('0x5'))('rpc');var config=require(_0xb641('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xb641('0x7')][_0xb641('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5295f5,_0x3595bc,_0x4c4061){return new BPromise(function(_0x40a068,_0x453f76){return client[_0xb641('0x9')](_0x5295f5,_0x4c4061)[_0xb641('0xa')](function(_0x52264b){logger[_0xb641('0xb')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x3595bc,_0xb641('0xc'));logger[_0xb641('0xd')](_0xb641('0xe'),_0x3595bc,_0xb641('0xc'),JSON[_0xb641('0xf')](_0x52264b));if(_0x52264b[_0xb641('0x10')]){if(_0x52264b[_0xb641('0x10')][_0xb641('0x11')]===0x1f4){logger[_0xb641('0x10')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x3595bc,_0x52264b['error'][_0xb641('0x12')]);return _0x453f76(_0x52264b[_0xb641('0x10')]['message']);}logger['error'](_0xb641('0x13'),_0x3595bc,_0x52264b[_0xb641('0x10')][_0xb641('0x12')]);return _0x40a068(_0x52264b[_0xb641('0x10')]['message']);}else{logger[_0xb641('0xb')](_0xb641('0x13'),_0x3595bc,'request\x20sent');_0x40a068(_0x52264b[_0xb641('0x14')][_0xb641('0x12')]);}})[_0xb641('0x15')](function(_0x392347){logger[_0xb641('0x10')](_0xb641('0x13'),_0x3595bc,_0x392347);_0x453f76(_0x392347);});});}exports[_0xb641('0x16')]=function(_0x1e540a){var _0x3df360=this;return new Promise(function(_0x59ee5a,_0x3445c0){return db['CmHopper'][_0xb641('0x17')]({'raw':!![],'where':{'ContactId':_0x1e540a[_0xb641('0x18')][_0xb641('0x19')],'ListId':_0x1e540a[_0xb641('0x18')]['ListId'],'VoiceQueueId':_0x1e540a['body'][_0xb641('0x1a')]===undefined?null:_0x1e540a['body']['VoiceQueueId'],'CampaignId':_0x1e540a[_0xb641('0x18')][_0xb641('0x1b')]===undefined?null:_0x1e540a[_0xb641('0x18')]['CampaignId']}})[_0xb641('0xa')](function(_0x301bf1){if(_0x301bf1!=null){return db[_0xb641('0x1c')][_0xb641('0x17')]({'raw':!![],'where':{'CmHopperId':_0x301bf1['id'],'OrderBy':{'$gt':_0x301bf1[_0xb641('0x1d')]}},'order':[[_0xb641('0x1d'),_0xb641('0x1e')]]})['then'](function(_0x5f35c2){var _0x1ec0e6=0x0;if(_0x5f35c2){if(_0x5f35c2[_0xb641('0x1f')]+_0x5f35c2[_0xb641('0x20')]+_0x5f35c2[_0xb641('0x21')]+_0x5f35c2['countnosuchnumberretry']+_0x5f35c2['countdropretry']+_0x5f35c2['countabandonedretry']+_0x5f35c2[_0xb641('0x22')]+_0x5f35c2[_0xb641('0x23')]<_0x1e540a[_0xb641('0x24')][_0xb641('0x25')])_0x1ec0e6=0x1;_0x59ee5a({'additional':_0x1ec0e6});}else{return db['CmHopperAdditionalPhone'][_0xb641('0x17')]({'raw':!![],'where':{'CmHopperId':_0x301bf1['id']},'order':[[_0xb641('0x1d'),_0xb641('0x1e')]]})[_0xb641('0xa')](function(_0x16e58e){var _0x4f50e2=0x0;if(_0x16e58e){if(_0x16e58e[_0xb641('0x1f')]+_0x16e58e[_0xb641('0x20')]+_0x16e58e[_0xb641('0x21')]+_0x16e58e['countnosuchnumberretry']+_0x16e58e['countdropretry']+_0x16e58e[_0xb641('0x26')]+_0x16e58e[_0xb641('0x22')]+_0x16e58e[_0xb641('0x23')]<_0x1e540a[_0xb641('0x24')]['dialGlobalMaxRetry'])_0x4f50e2=0x1;_0x59ee5a({'additional':_0x4f50e2});}else{_0x59ee5a({'additional':0x0});}})[_0xb641('0x15')](function(_0x223cb8){logger['error']('VerifyAdditionalPhones',_0x223cb8[_0xb641('0x12')],_0x1e540a);_0x3445c0(_0x3df360['error'](0x1f4,_0x223cb8[_0xb641('0x12')]));});}})[_0xb641('0x15')](function(_0x346908){logger['error']('VerifyAdditionalPhones',_0x346908[_0xb641('0x12')],_0x1e540a);_0x3445c0(_0x3df360[_0xb641('0x10')](0x1f4,_0x346908[_0xb641('0x12')]));});}else _0x59ee5a({'additional':0x0});});});};exports['SwapAdditionalPhones']=function(_0x26754b){var _0x124c21=this;return new Promise(function(_0x2a70ac,_0x33b793){return db['CmHopper']['findOne']({'raw':!![],'where':{'ContactId':_0x26754b[_0xb641('0x18')][_0xb641('0x19')],'ListId':_0x26754b[_0xb641('0x18')][_0xb641('0x27')],'VoiceQueueId':_0x26754b[_0xb641('0x18')][_0xb641('0x1a')]===undefined?null:_0x26754b[_0xb641('0x18')][_0xb641('0x1a')],'CampaignId':_0x26754b['body'][_0xb641('0x1b')]===undefined?null:_0x26754b[_0xb641('0x18')][_0xb641('0x1b')]}})[_0xb641('0xa')](function(_0x314d09){if(_0x314d09!=null){return db[_0xb641('0x1c')][_0xb641('0x17')]({'raw':!![],'where':{'CmHopperId':_0x314d09['id'],'OrderBy':{'$gte':_0x314d09[_0xb641('0x1d')]}},'order':[['OrderBy',_0xb641('0x1e')]]})[_0xb641('0xa')](function(_0x1b854a){if(_0x1b854a)return activateAdditionalPhone(_0x314d09,_0x26754b[_0xb641('0x18')],_0x1b854a,_0x26754b['duration'],_0x26754b[_0xb641('0x28')])[_0xb641('0xa')](function(_0x2a3db2){_0x2a70ac(_0x2a3db2);});else{return db[_0xb641('0x1c')][_0xb641('0x17')]({'raw':!![],'where':{'CmHopperId':_0x314d09['id']},'order':[[_0xb641('0x1d'),_0xb641('0x1e')]]})[_0xb641('0xa')](function(_0x5cf04e){if(_0x5cf04e)return activateAdditionalPhone(_0x314d09,_0x26754b[_0xb641('0x18')],_0x5cf04e,_0x26754b[_0xb641('0x29')],_0x26754b[_0xb641('0x28')])['then'](function(_0x6addad){_0x2a70ac(_0x6addad);});else{_0x2a70ac({'id':_0x314d09['id'],'phone':''});}})[_0xb641('0x15')](function(_0x4321c2){logger['error']('VerifyAdditionalPhones',_0x4321c2[_0xb641('0x12')],_0x26754b);_0x33b793(_0x124c21[_0xb641('0x10')](0x1f4,_0x4321c2[_0xb641('0x12')]));});}})[_0xb641('0x15')](function(_0x4a2152){logger[_0xb641('0x10')](_0xb641('0x16'),_0x4a2152['message'],_0x26754b);_0x33b793(_0x124c21[_0xb641('0x10')](0x1f4,_0x4a2152[_0xb641('0x12')]));});}else _0x2a70ac(0x1);});});};function activateAdditionalPhone(_0x15549b,_0x3beb0b,_0x4da930,_0x297e53,_0x5c57b8){return new Promise(function(_0x299e50,_0x11ea67){logger[_0xb641('0xb')](_0xb641('0x2a'));var _0x2ee9ce;if(moment()>moment(_0x4da930['scheduledat'])){_0x2ee9ce=moment()[_0xb641('0x2b')](_0x5c57b8||0x3,_0xb641('0x2c'));}else{if(_0x4da930['OrderBy']==0x0){_0x2ee9ce=moment(_0x4da930[_0xb641('0x2d')]);}else{_0x2ee9ce=moment()[_0xb641('0x2b')](_0x5c57b8||0x3,'minutes');}}var _0x5c5394={'phone':_0x15549b[_0xb641('0x2e')],'active':0x0,'OrderBy':_[_0xb641('0x2f')](_0x15549b['OrderBy'])?0x0:_0x15549b[_0xb641('0x1d')],'scheduledat':moment()[_0xb641('0x2b')](_0x297e53||0x1,_0xb641('0x2c')),'countbusyretry':_0x3beb0b['countbusyretry'],'countcongestionretry':_0x3beb0b[_0xb641('0x20')],'countnoanswerretry':_0x3beb0b[_0xb641('0x21')],'countnosuchnumberretry':_0x3beb0b[_0xb641('0x30')],'countdropretry':_0x3beb0b[_0xb641('0x31')],'countabandonedretry':_0x3beb0b[_0xb641('0x26')],'countmachineretry':_0x3beb0b[_0xb641('0x22')],'countagentrejectretry':_0x3beb0b[_0xb641('0x23')],'createdAt':_0x3beb0b[_0xb641('0x32')],'updatedAt':_0x3beb0b[_0xb641('0x33')]};var _0xdb5cfb={'CmHopperId':_0x15549b['id'],'phone':_0x4da930[_0xb641('0x2e')],'active':0x0,'OrderBy':_[_0xb641('0x2f')](_0x4da930[_0xb641('0x1d')])?0x0:_0x4da930[_0xb641('0x1d')],'scheduledat':_0x2ee9ce,'countbusyretry':_0x4da930[_0xb641('0x1f')],'countcongestionretry':_0x4da930[_0xb641('0x20')],'countnoanswerretry':_0x4da930[_0xb641('0x21')],'countnosuchnumberretry':_0x4da930[_0xb641('0x30')],'countdropretry':_0x4da930[_0xb641('0x31')],'countabandonedretry':_0x4da930['countabandonedretry'],'countmachineretry':_0x4da930['countmachineretry'],'countagentrejectretry':_0x4da930[_0xb641('0x23')],'createdAt':_0x4da930['createdAt'],'updatedAt':_0x4da930[_0xb641('0x33')]};logger[_0xb641('0xb')](_0xb641('0x34')+JSON['stringify'](_0x5c5394));logger['info'](_0xb641('0x35')+JSON[_0xb641('0xf')](_0xdb5cfb));logger[_0xb641('0xb')](_0xb641('0x36')+JSON[_0xb641('0xf')](_0x4da930));logger[_0xb641('0xb')](_0xb641('0x37')+JSON['stringify'](_0x15549b));return db[_0xb641('0x38')][_0xb641('0x39')](function(_0x53070b){return db[_0xb641('0x1c')][_0xb641('0x3a')](_0x5c5394,{'where':{'id':_0x4da930['id']}},{'transaction':_0x53070b})[_0xb641('0xa')](function(){return db[_0xb641('0x3b')][_0xb641('0x3a')](_0xdb5cfb,{'where':{'id':_0x15549b['id']}},{'transaction':_0x53070b});});})[_0xb641('0xa')](function(_0x5ee084){_0x299e50({'id':_0x15549b['id'],'phone':_0x4da930['phone']});})['catch'](function(_0x1de3ad){logger[_0xb641('0x10')](_0xb641('0x2a'),_0x1de3ad[_0xb641('0x12')],req);_0x11ea67(_this['error'](0x1f4,_0x1de3ad[_0xb641('0x12')]));});});}exports[_0xb641('0x3c')]=function(_0x1c2c0b){var _0x3e3090=this;return new Promise(function(_0x31b27e,_0x5c2499){return db['CmHopper']['update'](_0x1c2c0b[_0xb641('0x18')][_0xb641('0x3d')],{'where':{'id':_0x1c2c0b[_0xb641('0x18')]['id']}})[_0xb641('0xa')](function(_0x53e615){_0x31b27e(_0x53e615);})['catch'](function(_0x4771f3){logger[_0xb641('0x10')](_0xb641('0x3c'),_0x4771f3[_0xb641('0x12')],_0x1c2c0b);_0x5c2499(_0x3e3090[_0xb641('0x10')](0x1f4,_0x4771f3[_0xb641('0x12')]));});});}; \ No newline at end of file +var _0x641e=['add','minutes','isNil','countnosuchnumberretry','createdAt','updatedAt','phone','hopperToAdditional\x20-\x20','additionalToHopper\x20-\x20','additional\x20-\x20','hopper\x20-\x20','sequelize','transaction','update','CmHopper','IncrementPreviewCounters','field','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','code','CmHopperAdditionalPhone,\x20%s,\x20%s','message','result','catch','VerifyAdditionalPhones','findOne','body','ContactId','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','ASC','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countagentrejectretry','entity','countmachineretry','dialGlobalMaxRetry','SwapAdditionalPhones','duration','waitTime','activateAdditionalPhone','scheduledat'];(function(_0x52c766,_0x4399e0){var _0x48c6a4=function(_0x31c7ab){while(--_0x31c7ab){_0x52c766['push'](_0x52c766['shift']());}};_0x48c6a4(++_0x4399e0);}(_0x641e,0x8f));var _0xe641=function(_0x2e2aaa,_0x3214bf){_0x2e2aaa=_0x2e2aaa-0x0;var _0x122b6f=_0x641e[_0x2e2aaa];return _0x122b6f;};'use strict';var _=require(_0xe641('0x0'));var util=require('util');var moment=require(_0xe641('0x1'));var BPromise=require(_0xe641('0x2'));var rs=require(_0xe641('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe641('0x4'));var logger=require(_0xe641('0x5'))(_0xe641('0x6'));var config=require(_0xe641('0x7'));var jayson=require(_0xe641('0x8'));var client=jayson['client'][_0xe641('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x16d75a,_0x3480ca,_0x45662d){return new BPromise(function(_0x5e80e4,_0x524f83){return client[_0xe641('0xa')](_0x16d75a,_0x45662d)[_0xe641('0xb')](function(_0xa56285){logger[_0xe641('0xc')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x3480ca,_0xe641('0xd'));logger['debug'](_0xe641('0xe'),_0x3480ca,_0xe641('0xd'),JSON[_0xe641('0xf')](_0xa56285));if(_0xa56285['error']){if(_0xa56285[_0xe641('0x10')][_0xe641('0x11')]===0x1f4){logger[_0xe641('0x10')](_0xe641('0x12'),_0x3480ca,_0xa56285[_0xe641('0x10')][_0xe641('0x13')]);return _0x524f83(_0xa56285[_0xe641('0x10')][_0xe641('0x13')]);}logger[_0xe641('0x10')](_0xe641('0x12'),_0x3480ca,_0xa56285[_0xe641('0x10')][_0xe641('0x13')]);return _0x5e80e4(_0xa56285[_0xe641('0x10')][_0xe641('0x13')]);}else{logger[_0xe641('0xc')](_0xe641('0x12'),_0x3480ca,'request\x20sent');_0x5e80e4(_0xa56285[_0xe641('0x14')][_0xe641('0x13')]);}})[_0xe641('0x15')](function(_0x399fa5){logger[_0xe641('0x10')](_0xe641('0x12'),_0x3480ca,_0x399fa5);_0x524f83(_0x399fa5);});});}exports[_0xe641('0x16')]=function(_0x5f3b3d){var _0x33d14b=this;return new Promise(function(_0x417f0b,_0x18760a){return db['CmHopper'][_0xe641('0x17')]({'raw':!![],'where':{'ContactId':_0x5f3b3d[_0xe641('0x18')][_0xe641('0x19')],'ListId':_0x5f3b3d['body'][_0xe641('0x1a')],'VoiceQueueId':_0x5f3b3d[_0xe641('0x18')]['VoiceQueueId']===undefined?null:_0x5f3b3d[_0xe641('0x18')][_0xe641('0x1b')],'CampaignId':_0x5f3b3d[_0xe641('0x18')]['CampaignId']===undefined?null:_0x5f3b3d[_0xe641('0x18')][_0xe641('0x1c')]}})[_0xe641('0xb')](function(_0x3f5b7a){if(_0x3f5b7a!=null){return db[_0xe641('0x1d')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x3f5b7a['id'],'OrderBy':{'$gt':_0x3f5b7a[_0xe641('0x1e')]}},'order':[[_0xe641('0x1e'),_0xe641('0x1f')]]})[_0xe641('0xb')](function(_0x421692){var _0x358760=0x0;if(_0x421692){if(_0x421692[_0xe641('0x20')]+_0x421692[_0xe641('0x21')]+_0x421692[_0xe641('0x22')]+_0x421692['countnosuchnumberretry']+_0x421692[_0xe641('0x23')]+_0x421692[_0xe641('0x24')]+_0x421692['countmachineretry']+_0x421692[_0xe641('0x25')]<_0x5f3b3d[_0xe641('0x26')]['dialGlobalMaxRetry'])_0x358760=0x1;_0x417f0b({'additional':_0x358760});}else{return db[_0xe641('0x1d')][_0xe641('0x17')]({'raw':!![],'where':{'CmHopperId':_0x3f5b7a['id']},'order':[[_0xe641('0x1e'),_0xe641('0x1f')]]})[_0xe641('0xb')](function(_0x1ee2b9){var _0x11e3ef=0x0;if(_0x1ee2b9){if(_0x1ee2b9['countbusyretry']+_0x1ee2b9[_0xe641('0x21')]+_0x1ee2b9[_0xe641('0x22')]+_0x1ee2b9['countnosuchnumberretry']+_0x1ee2b9[_0xe641('0x23')]+_0x1ee2b9[_0xe641('0x24')]+_0x1ee2b9[_0xe641('0x27')]+_0x1ee2b9[_0xe641('0x25')]<_0x5f3b3d[_0xe641('0x26')][_0xe641('0x28')])_0x11e3ef=0x1;_0x417f0b({'additional':_0x11e3ef});}else{_0x417f0b({'additional':0x0});}})[_0xe641('0x15')](function(_0x123957){logger[_0xe641('0x10')](_0xe641('0x16'),_0x123957['message'],_0x5f3b3d);_0x18760a(_0x33d14b[_0xe641('0x10')](0x1f4,_0x123957[_0xe641('0x13')]));});}})['catch'](function(_0x212f5b){logger[_0xe641('0x10')](_0xe641('0x16'),_0x212f5b['message'],_0x5f3b3d);_0x18760a(_0x33d14b['error'](0x1f4,_0x212f5b[_0xe641('0x13')]));});}else _0x417f0b({'additional':0x0});});});};exports[_0xe641('0x29')]=function(_0x3b131f){var _0x5f5399=this;return new Promise(function(_0x3ec5ae,_0x2ba6db){return db['CmHopper'][_0xe641('0x17')]({'raw':!![],'where':{'ContactId':_0x3b131f[_0xe641('0x18')][_0xe641('0x19')],'ListId':_0x3b131f[_0xe641('0x18')]['ListId'],'VoiceQueueId':_0x3b131f[_0xe641('0x18')][_0xe641('0x1b')]===undefined?null:_0x3b131f[_0xe641('0x18')]['VoiceQueueId'],'CampaignId':_0x3b131f[_0xe641('0x18')][_0xe641('0x1c')]===undefined?null:_0x3b131f['body'][_0xe641('0x1c')]}})['then'](function(_0xc84ece){if(_0xc84ece!=null){return db[_0xe641('0x1d')][_0xe641('0x17')]({'raw':!![],'where':{'CmHopperId':_0xc84ece['id'],'OrderBy':{'$gte':_0xc84ece['OrderBy']}},'order':[[_0xe641('0x1e'),_0xe641('0x1f')]]})[_0xe641('0xb')](function(_0x59e027){if(_0x59e027)return activateAdditionalPhone(_0xc84ece,_0x3b131f[_0xe641('0x18')],_0x59e027,_0x3b131f[_0xe641('0x2a')],_0x3b131f['waitTime'])['then'](function(_0x4275a5){_0x3ec5ae(_0x4275a5);});else{return db[_0xe641('0x1d')][_0xe641('0x17')]({'raw':!![],'where':{'CmHopperId':_0xc84ece['id']},'order':[[_0xe641('0x1e'),_0xe641('0x1f')]]})[_0xe641('0xb')](function(_0x4b4803){if(_0x4b4803)return activateAdditionalPhone(_0xc84ece,_0x3b131f['body'],_0x4b4803,_0x3b131f[_0xe641('0x2a')],_0x3b131f[_0xe641('0x2b')])['then'](function(_0x4e144f){_0x3ec5ae(_0x4e144f);});else{_0x3ec5ae({'id':_0xc84ece['id'],'phone':''});}})[_0xe641('0x15')](function(_0x2acc9e){logger['error'](_0xe641('0x16'),_0x2acc9e[_0xe641('0x13')],_0x3b131f);_0x2ba6db(_0x5f5399['error'](0x1f4,_0x2acc9e[_0xe641('0x13')]));});}})[_0xe641('0x15')](function(_0x3e0009){logger['error']('VerifyAdditionalPhones',_0x3e0009['message'],_0x3b131f);_0x2ba6db(_0x5f5399[_0xe641('0x10')](0x1f4,_0x3e0009[_0xe641('0x13')]));});}else _0x3ec5ae(0x1);});});};function activateAdditionalPhone(_0x378821,_0x586ab7,_0x5f3ba5,_0x3f15b1,_0x4b8dd0){return new Promise(function(_0x511e70,_0x4af9da){logger[_0xe641('0xc')](_0xe641('0x2c'));var _0x1d1892;if(moment()>moment(_0x5f3ba5[_0xe641('0x2d')])){_0x1d1892=moment()[_0xe641('0x2e')](_0x4b8dd0||0x3,'minutes');}else{if(_0x5f3ba5[_0xe641('0x1e')]==0x0){_0x1d1892=moment(_0x5f3ba5[_0xe641('0x2d')]);}else{_0x1d1892=moment()[_0xe641('0x2e')](_0x4b8dd0||0x3,_0xe641('0x2f'));}}var _0x1cd1ca={'phone':_0x378821['phone'],'active':0x0,'OrderBy':_[_0xe641('0x30')](_0x378821[_0xe641('0x1e')])?0x0:_0x378821[_0xe641('0x1e')],'scheduledat':moment()[_0xe641('0x2e')](_0x3f15b1||0x1,_0xe641('0x2f')),'countbusyretry':_0x586ab7['countbusyretry'],'countcongestionretry':_0x586ab7[_0xe641('0x21')],'countnoanswerretry':_0x586ab7[_0xe641('0x22')],'countnosuchnumberretry':_0x586ab7[_0xe641('0x31')],'countdropretry':_0x586ab7['countdropretry'],'countabandonedretry':_0x586ab7[_0xe641('0x24')],'countmachineretry':_0x586ab7[_0xe641('0x27')],'countagentrejectretry':_0x586ab7[_0xe641('0x25')],'createdAt':_0x586ab7[_0xe641('0x32')],'updatedAt':_0x586ab7[_0xe641('0x33')]};var _0x2576b1={'CmHopperId':_0x378821['id'],'phone':_0x5f3ba5[_0xe641('0x34')],'active':0x0,'OrderBy':_[_0xe641('0x30')](_0x5f3ba5[_0xe641('0x1e')])?0x0:_0x5f3ba5['OrderBy'],'scheduledat':_0x1d1892,'countbusyretry':_0x5f3ba5[_0xe641('0x20')],'countcongestionretry':_0x5f3ba5['countcongestionretry'],'countnoanswerretry':_0x5f3ba5['countnoanswerretry'],'countnosuchnumberretry':_0x5f3ba5[_0xe641('0x31')],'countdropretry':_0x5f3ba5[_0xe641('0x23')],'countabandonedretry':_0x5f3ba5['countabandonedretry'],'countmachineretry':_0x5f3ba5[_0xe641('0x27')],'countagentrejectretry':_0x5f3ba5[_0xe641('0x25')],'createdAt':_0x5f3ba5['createdAt'],'updatedAt':_0x5f3ba5['updatedAt']};logger[_0xe641('0xc')](_0xe641('0x35')+JSON[_0xe641('0xf')](_0x1cd1ca));logger[_0xe641('0xc')](_0xe641('0x36')+JSON[_0xe641('0xf')](_0x2576b1));logger[_0xe641('0xc')](_0xe641('0x37')+JSON[_0xe641('0xf')](_0x5f3ba5));logger[_0xe641('0xc')](_0xe641('0x38')+JSON[_0xe641('0xf')](_0x378821));return db[_0xe641('0x39')][_0xe641('0x3a')](function(_0x181f30){return db[_0xe641('0x1d')][_0xe641('0x3b')](_0x1cd1ca,{'where':{'id':_0x5f3ba5['id']}},{'transaction':_0x181f30})[_0xe641('0xb')](function(){return db[_0xe641('0x3c')]['update'](_0x2576b1,{'where':{'id':_0x378821['id']}},{'transaction':_0x181f30});});})['then'](function(_0x5187d7){_0x511e70({'id':_0x378821['id'],'phone':_0x5f3ba5[_0xe641('0x34')]});})['catch'](function(_0x3ddf98){logger[_0xe641('0x10')](_0xe641('0x2c'),_0x3ddf98[_0xe641('0x13')],req);_0x4af9da(_this[_0xe641('0x10')](0x1f4,_0x3ddf98[_0xe641('0x13')]));});});}exports[_0xe641('0x3d')]=function(_0xecf788){var _0x5abc6f=this;return new Promise(function(_0x133d0b,_0x54886a){return db['CmHopper'][_0xe641('0x3b')](_0xecf788['body'][_0xe641('0x3e')],{'where':{'id':_0xecf788[_0xe641('0x18')]['id']}})[_0xe641('0xb')](function(_0x387802){_0x133d0b(_0x387802);})[_0xe641('0x15')](function(_0x14af2a){logger['error'](_0xe641('0x3d'),_0x14af2a[_0xe641('0x13')],_0xecf788);_0x54886a(_0x5abc6f['error'](0x1f4,_0x14af2a['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index 5d50ab1..987d3b8 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 _0xaa7c=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','index','/:id','isAuthenticated','show','create','put','update','delete','destroy','multer','util'];(function(_0xf62e6c,_0x160938){var _0x14234f=function(_0x16fe1d){while(--_0x16fe1d){_0xf62e6c['push'](_0xf62e6c['shift']());}};_0x14234f(++_0x160938);}(_0xaa7c,0x18e));var _0xcaa7=function(_0x2b4376,_0x4fa631){_0x2b4376=_0x2b4376-0x0;var _0x23599e=_0xaa7c[_0x2b4376];return _0x23599e;};'use strict';var multer=require(_0xcaa7('0x0'));var util=require(_0xcaa7('0x1'));var path=require(_0xcaa7('0x2'));var timeout=require(_0xcaa7('0x3'));var express=require(_0xcaa7('0x4'));var router=express['Router']();var fs_extra=require(_0xcaa7('0x5'));var auth=require(_0xcaa7('0x6'));var interaction=require(_0xcaa7('0x7'));var config=require(_0xcaa7('0x8'));var controller=require(_0xcaa7('0x9'));router[_0xcaa7('0xa')]('/',auth['isAuthenticated'](),controller[_0xcaa7('0xb')]);router['get'](_0xcaa7('0xc'),auth[_0xcaa7('0xd')](),controller[_0xcaa7('0xe')]);router['post']('/',auth[_0xcaa7('0xd')](),controller[_0xcaa7('0xf')]);router[_0xcaa7('0x10')](_0xcaa7('0xc'),auth[_0xcaa7('0xd')](),controller[_0xcaa7('0x11')]);router[_0xcaa7('0x12')]('/:id',auth[_0xcaa7('0xd')](),controller[_0xcaa7('0x13')]);module['exports']=router; \ No newline at end of file +var _0x58fa=['../../config/environment','./cmHopperAdditionalPhone.controller','isAuthenticated','index','/:id','post','put','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x28cf9d,_0x3ed77a){var _0x2be5b4=function(_0x504dd4){while(--_0x504dd4){_0x28cf9d['push'](_0x28cf9d['shift']());}};_0x2be5b4(++_0x3ed77a);}(_0x58fa,0x129));var _0xa58f=function(_0x12cde7,_0x501522){_0x12cde7=_0x12cde7-0x0;var _0x47002e=_0x58fa[_0x12cde7];return _0x47002e;};'use strict';var multer=require(_0xa58f('0x0'));var util=require(_0xa58f('0x1'));var path=require(_0xa58f('0x2'));var timeout=require(_0xa58f('0x3'));var express=require(_0xa58f('0x4'));var router=express[_0xa58f('0x5')]();var fs_extra=require(_0xa58f('0x6'));var auth=require(_0xa58f('0x7'));var interaction=require(_0xa58f('0x8'));var config=require(_0xa58f('0x9'));var controller=require(_0xa58f('0xa'));router['get']('/',auth[_0xa58f('0xb')](),controller[_0xa58f('0xc')]);router['get'](_0xa58f('0xd'),auth[_0xa58f('0xb')](),controller['show']);router[_0xa58f('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa58f('0xf')](_0xa58f('0xd'),auth[_0xa58f('0xb')](),controller['update']);router[_0xa58f('0x10')]('/:id',auth[_0xa58f('0xb')](),controller['destroy']);module[_0xa58f('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 6d34449..8eb2f0f 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 _0x80c3=['STRING','contactListQueue','INTEGER','moment'];(function(_0x10c0b5,_0x361ef7){var _0x558e64=function(_0x138b16){while(--_0x138b16){_0x10c0b5['push'](_0x10c0b5['shift']());}};_0x558e64(++_0x361ef7);}(_0x80c3,0x18f));var _0x380c=function(_0x188a93,_0xaf57db){_0x188a93=_0x188a93-0x0;var _0x23b40d=_0x80c3[_0x188a93];return _0x23b40d;};'use strict';var moment=require(_0x380c('0x0'));var Sequelize=require('sequelize');module['exports']={'phone':{'type':Sequelize[_0x380c('0x1')],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x380c('0x2')},'ListId':{'type':Sequelize[_0x380c('0x3')],'unique':_0x380c('0x2')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'}}; \ No newline at end of file +var _0x51f2=['contactListQueue','moment','sequelize','exports','STRING','INTEGER'];(function(_0x2672cf,_0x4d5ea8){var _0x2ed2d6=function(_0x4abeaf){while(--_0x4abeaf){_0x2672cf['push'](_0x2672cf['shift']());}};_0x2ed2d6(++_0x4d5ea8);}(_0x51f2,0xeb));var _0x251f=function(_0x76e3a8,_0x45ced5){_0x76e3a8=_0x76e3a8-0x0;var _0x327e61=_0x51f2[_0x76e3a8];return _0x327e61;};'use strict';var moment=require(_0x251f('0x0'));var Sequelize=require(_0x251f('0x1'));module[_0x251f('0x2')]={'phone':{'type':Sequelize[_0x251f('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x251f('0x4')],'unique':_0x251f('0x5')},'ListId':{'type':Sequelize[_0x251f('0x4')],'unique':_0x251f('0x5')},'VoiceQueueId':{'type':Sequelize[_0x251f('0x4')],'unique':'contactListQueue'}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 106f8c8..29a92ac 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 _0x20fa=['find','update','body','catch','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','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','sendStatus','status','end','offset','undefined','limit','set','Content-Range','json','apply','reject','then','error','stack','name','send','CmHopperBlack','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','merge','where','VIRTUAL','options','count','includeAll','findAll','rows','show','params','include'];(function(_0x58a4b5,_0x182439){var _0x51821d=function(_0x47c3c5){while(--_0x47c3c5){_0x58a4b5['push'](_0x58a4b5['shift']());}};_0x51821d(++_0x182439);}(_0x20fa,0xea));var _0xa20f=function(_0x2b9e8a,_0x7b21d4){_0x2b9e8a=_0x2b9e8a-0x0;var _0x520e67=_0x20fa[_0x2b9e8a];return _0x520e67;};'use strict';var emlformat=require(_0xa20f('0x0'));var rimraf=require(_0xa20f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa20f('0x2'));var rp=require(_0xa20f('0x3'));var moment=require(_0xa20f('0x4'));var BPromise=require(_0xa20f('0x5'));var Mustache=require(_0xa20f('0x6'));var util=require(_0xa20f('0x7'));var path=require(_0xa20f('0x8'));var sox=require('sox');var csv=require(_0xa20f('0x9'));var ejs=require(_0xa20f('0xa'));var fs=require('fs');var fs_extra=require(_0xa20f('0xb'));var _=require(_0xa20f('0xc'));var squel=require(_0xa20f('0xd'));var crypto=require('crypto');var jsforce=require(_0xa20f('0xe'));var deskjs=require(_0xa20f('0xf'));var toCsv=require(_0xa20f('0x9'));var querystring=require(_0xa20f('0x10'));var Papa=require(_0xa20f('0x11'));var Redis=require(_0xa20f('0x12'));var authService=require(_0xa20f('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xa20f('0x14'));var hardwareService=require(_0xa20f('0x15'));var logger=require('../../config/logger')(_0xa20f('0x16'));var utils=require(_0xa20f('0x17'));var config=require(_0xa20f('0x18'));var licenseUtil=require(_0xa20f('0x19'));var db=require(_0xa20f('0x1a'))['db'];function respondWithStatusCode(_0x6fd89,_0x50169e){_0x50169e=_0x50169e||0xcc;return function(_0x409000){if(_0x409000){return _0x6fd89[_0xa20f('0x1b')](_0x50169e);}return _0x6fd89[_0xa20f('0x1c')](_0x50169e)[_0xa20f('0x1d')]();};}function respondWithResult(_0x313cb9,_0x8b7ef5){_0x8b7ef5=_0x8b7ef5||0xc8;return function(_0x1e0c85){if(_0x1e0c85){return _0x313cb9[_0xa20f('0x1c')](_0x8b7ef5)['json'](_0x1e0c85);}};}function respondWithFilteredResult(_0x45f827,_0x49afb7){return function(_0x29b4eb){if(_0x29b4eb){var _0xe3f7ba=typeof _0x49afb7[_0xa20f('0x1e')]===_0xa20f('0x1f')&&typeof _0x49afb7[_0xa20f('0x20')]==='undefined';var _0x20cc4c=_0x29b4eb['count'];var _0x49ec6a=_0xe3f7ba?0x0:_0x49afb7[_0xa20f('0x1e')];var _0x5ccd11=_0xe3f7ba?_0x29b4eb['count']:_0x49afb7[_0xa20f('0x1e')]+_0x49afb7[_0xa20f('0x20')];var _0x4edbc2;if(_0x5ccd11>=_0x20cc4c){_0x5ccd11=_0x20cc4c;_0x4edbc2=0xc8;}else{_0x4edbc2=0xce;}_0x45f827[_0xa20f('0x1c')](_0x4edbc2);return _0x45f827[_0xa20f('0x21')](_0xa20f('0x22'),_0x49ec6a+'-'+_0x5ccd11+'/'+_0x20cc4c)[_0xa20f('0x23')](_0x29b4eb);}return null;};}function patchUpdates(_0x4f21c3){return function(_0x597b48){try{jsonpatch[_0xa20f('0x24')](_0x597b48,_0x4f21c3,!![]);}catch(_0x21a332){return BPromise[_0xa20f('0x25')](_0x21a332);}return _0x597b48['save']();};}function saveUpdates(_0x2af236,_0x4efd07){return function(_0x78070c){if(_0x78070c){return _0x78070c['update'](_0x2af236)[_0xa20f('0x26')](function(_0x518bd3){return _0x518bd3;});}return null;};}function removeEntity(_0x371bed,_0x362341){return function(_0x4e5521){if(_0x4e5521){return _0x4e5521['destroy']()['then'](function(){_0x371bed[_0xa20f('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x331b3e,_0x4b271d){return function(_0x5653f1){if(!_0x5653f1){_0x331b3e['sendStatus'](0x194);}return _0x5653f1;};}function handleError(_0x7eda68,_0x43b146){_0x43b146=_0x43b146||0x1f4;return function(_0x56f682){logger[_0xa20f('0x27')](_0x56f682[_0xa20f('0x28')]);if(_0x56f682[_0xa20f('0x29')]){delete _0x56f682['name'];}_0x7eda68['status'](_0x43b146)[_0xa20f('0x2a')](_0x56f682);};}exports['index']=function(_0x16c83a,_0x17634c){var _0x3b24bb={},_0x157062={},_0x1907e2={'count':0x0,'rows':[]};var _0xef186=_['map'](db[_0xa20f('0x2b')][_0xa20f('0x2c')],function(_0x435b18){return{'name':_0x435b18[_0xa20f('0x2d')],'type':_0x435b18['type'][_0xa20f('0x2e')]};});_0x157062[_0xa20f('0x2f')]=_[_0xa20f('0x30')](_0xef186,'name');_0x157062['query']=_[_0xa20f('0x31')](_0x16c83a[_0xa20f('0x32')]);_0x157062[_0xa20f('0x33')]=_['intersection'](_0x157062[_0xa20f('0x2f')],_0x157062[_0xa20f('0x32')]);_0x3b24bb['attributes']=_[_0xa20f('0x34')](_0x157062[_0xa20f('0x2f')],qs[_0xa20f('0x35')](_0x16c83a['query'][_0xa20f('0x35')]));_0x3b24bb[_0xa20f('0x36')]=_0x3b24bb[_0xa20f('0x36')][_0xa20f('0x37')]?_0x3b24bb[_0xa20f('0x36')]:_0x157062[_0xa20f('0x2f')];if(!_0x16c83a[_0xa20f('0x32')][_0xa20f('0x38')]('nolimit')){_0x3b24bb[_0xa20f('0x20')]=qs[_0xa20f('0x20')](_0x16c83a['query'][_0xa20f('0x20')]);_0x3b24bb['offset']=qs['offset'](_0x16c83a[_0xa20f('0x32')][_0xa20f('0x1e')]);}_0x3b24bb[_0xa20f('0x39')]=qs[_0xa20f('0x3a')](_0x16c83a[_0xa20f('0x32')][_0xa20f('0x3a')]);_0x3b24bb['where']=qs['filters'](_['pick'](_0x16c83a['query'],_0x157062[_0xa20f('0x33')]),_0xef186);if(_0x16c83a[_0xa20f('0x32')]['filter']){_0x3b24bb['where']=_[_0xa20f('0x3b')](_0x3b24bb[_0xa20f('0x3c')],{'$or':_[_0xa20f('0x30')](_0xef186,function(_0x21fcf9){if(_0x21fcf9['type']!==_0xa20f('0x3d')){var _0x197356={};_0x197356[_0x21fcf9['name']]={'$like':'%'+_0x16c83a[_0xa20f('0x32')]['filter']+'%'};return _0x197356;}})});}_0x3b24bb=_['merge']({},_0x3b24bb,_0x16c83a[_0xa20f('0x3e')]);var _0x319eb5={'where':_0x3b24bb['where']};return db[_0xa20f('0x2b')][_0xa20f('0x3f')](_0x319eb5)[_0xa20f('0x26')](function(_0x3c2ed8){_0x1907e2[_0xa20f('0x3f')]=_0x3c2ed8;if(_0x16c83a[_0xa20f('0x32')][_0xa20f('0x40')]){_0x3b24bb['include']=[{'all':!![]}];}return db[_0xa20f('0x2b')][_0xa20f('0x41')](_0x3b24bb);})[_0xa20f('0x26')](function(_0x29a91a){_0x1907e2[_0xa20f('0x42')]=_0x29a91a;return _0x1907e2;})[_0xa20f('0x26')](respondWithFilteredResult(_0x17634c,_0x3b24bb))['catch'](handleError(_0x17634c,null));};exports[_0xa20f('0x43')]=function(_0x28e0f1,_0x155f08){var _0x14a21e={'raw':!![],'where':{'id':_0x28e0f1[_0xa20f('0x44')]['id']}},_0xd4f35c={};_0xd4f35c[_0xa20f('0x2f')]=_['keys'](db[_0xa20f('0x2b')]['rawAttributes']);_0xd4f35c[_0xa20f('0x32')]=_[_0xa20f('0x31')](_0x28e0f1[_0xa20f('0x32')]);_0xd4f35c[_0xa20f('0x33')]=_[_0xa20f('0x34')](_0xd4f35c[_0xa20f('0x2f')],_0xd4f35c[_0xa20f('0x32')]);_0x14a21e[_0xa20f('0x36')]=_[_0xa20f('0x34')](_0xd4f35c['model'],qs[_0xa20f('0x35')](_0x28e0f1[_0xa20f('0x32')]['fields']));_0x14a21e[_0xa20f('0x36')]=_0x14a21e[_0xa20f('0x36')][_0xa20f('0x37')]?_0x14a21e[_0xa20f('0x36')]:_0xd4f35c[_0xa20f('0x2f')];if(_0x28e0f1['query'][_0xa20f('0x40')]){_0x14a21e[_0xa20f('0x45')]=[{'all':!![]}];}_0x14a21e=_['merge']({},_0x14a21e,_0x28e0f1[_0xa20f('0x3e')]);return db[_0xa20f('0x2b')][_0xa20f('0x46')](_0x14a21e)[_0xa20f('0x26')](handleEntityNotFound(_0x155f08,null))['then'](respondWithResult(_0x155f08,null))['catch'](handleError(_0x155f08,null));};exports[_0xa20f('0x47')]=function(_0x455a70,_0x1ea7ea){if(_0x455a70[_0xa20f('0x48')]['id']){delete _0x455a70['body']['id'];}return db[_0xa20f('0x2b')][_0xa20f('0x46')]({'where':{'id':_0x455a70[_0xa20f('0x44')]['id']}})[_0xa20f('0x26')](handleEntityNotFound(_0x1ea7ea,null))[_0xa20f('0x26')](saveUpdates(_0x455a70[_0xa20f('0x48')],null))[_0xa20f('0x26')](respondWithResult(_0x1ea7ea,null))[_0xa20f('0x49')](handleError(_0x1ea7ea,null));};exports[_0xa20f('0x4a')]=function(_0x87d3f,_0xae9caf){return db[_0xa20f('0x2b')][_0xa20f('0x46')]({'where':{'id':_0x87d3f[_0xa20f('0x44')]['id']}})[_0xa20f('0x26')](handleEntityNotFound(_0xae9caf,null))[_0xa20f('0x26')](removeEntity(_0xae9caf,null))[_0xa20f('0x49')](handleError(_0xae9caf,null));};exports[_0xa20f('0x4b')]=function(_0x257a19,_0x2fb9e6){return db['CmHopperBlack']['describe']()['then'](respondWithResult(_0x2fb9e6,null))[_0xa20f('0x49')](handleError(_0x2fb9e6,null));}; \ No newline at end of file +var _0xa3eb=['save','update','then','destroy','sendStatus','stack','name','send','map','CmHopperBlack','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','show','params','catch','find','describe','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/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','limit','count','offset','set','Content-Range','apply','reject'];(function(_0x2a5ad0,_0x14cc75){var _0x1f46d1=function(_0x476729){while(--_0x476729){_0x2a5ad0['push'](_0x2a5ad0['shift']());}};_0x1f46d1(++_0x14cc75);}(_0xa3eb,0x1ed));var _0xba3e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa3eb[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0xba3e('0x0'));var rimraf=require(_0xba3e('0x1'));var zipdir=require(_0xba3e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xba3e('0x3'));var moment=require(_0xba3e('0x4'));var BPromise=require(_0xba3e('0x5'));var Mustache=require(_0xba3e('0x6'));var util=require(_0xba3e('0x7'));var path=require(_0xba3e('0x8'));var sox=require(_0xba3e('0x9'));var csv=require(_0xba3e('0xa'));var ejs=require(_0xba3e('0xb'));var fs=require('fs');var fs_extra=require(_0xba3e('0xc'));var _=require(_0xba3e('0xd'));var squel=require(_0xba3e('0xe'));var crypto=require(_0xba3e('0xf'));var jsforce=require(_0xba3e('0x10'));var deskjs=require(_0xba3e('0x11'));var toCsv=require(_0xba3e('0xa'));var querystring=require(_0xba3e('0x12'));var Papa=require(_0xba3e('0x13'));var Redis=require(_0xba3e('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xba3e('0x15'));var as=require(_0xba3e('0x16'));var hardwareService=require(_0xba3e('0x17'));var logger=require('../../config/logger')(_0xba3e('0x18'));var utils=require(_0xba3e('0x19'));var config=require(_0xba3e('0x1a'));var licenseUtil=require(_0xba3e('0x1b'));var db=require(_0xba3e('0x1c'))['db'];function respondWithStatusCode(_0x4bf734,_0x730291){_0x730291=_0x730291||0xcc;return function(_0x159739){if(_0x159739){return _0x4bf734['sendStatus'](_0x730291);}return _0x4bf734['status'](_0x730291)[_0xba3e('0x1d')]();};}function respondWithResult(_0x16399c,_0x1a9cd2){_0x1a9cd2=_0x1a9cd2||0xc8;return function(_0x4ac37d){if(_0x4ac37d){return _0x16399c[_0xba3e('0x1e')](_0x1a9cd2)[_0xba3e('0x1f')](_0x4ac37d);}};}function respondWithFilteredResult(_0x578d23,_0x20ccd2){return function(_0x395965){if(_0x395965){var _0x1cb29c=typeof _0x20ccd2['offset']==='undefined'&&typeof _0x20ccd2[_0xba3e('0x20')]==='undefined';var _0x1cb884=_0x395965[_0xba3e('0x21')];var _0x37c8c9=_0x1cb29c?0x0:_0x20ccd2[_0xba3e('0x22')];var _0x241606=_0x1cb29c?_0x395965[_0xba3e('0x21')]:_0x20ccd2[_0xba3e('0x22')]+_0x20ccd2[_0xba3e('0x20')];var _0x498735;if(_0x241606>=_0x1cb884){_0x241606=_0x1cb884;_0x498735=0xc8;}else{_0x498735=0xce;}_0x578d23[_0xba3e('0x1e')](_0x498735);return _0x578d23[_0xba3e('0x23')](_0xba3e('0x24'),_0x37c8c9+'-'+_0x241606+'/'+_0x1cb884)[_0xba3e('0x1f')](_0x395965);}return null;};}function patchUpdates(_0x342c25){return function(_0x3e7e8c){try{jsonpatch[_0xba3e('0x25')](_0x3e7e8c,_0x342c25,!![]);}catch(_0x4f6d50){return BPromise[_0xba3e('0x26')](_0x4f6d50);}return _0x3e7e8c[_0xba3e('0x27')]();};}function saveUpdates(_0x51607e,_0x5ed12e){return function(_0x519c3e){if(_0x519c3e){return _0x519c3e[_0xba3e('0x28')](_0x51607e)[_0xba3e('0x29')](function(_0x4a1368){return _0x4a1368;});}return null;};}function removeEntity(_0xa774f9,_0x570fc9){return function(_0x1c261f){if(_0x1c261f){return _0x1c261f[_0xba3e('0x2a')]()[_0xba3e('0x29')](function(){_0xa774f9[_0xba3e('0x1e')](0xcc)[_0xba3e('0x1d')]();});}};}function handleEntityNotFound(_0x4190ab,_0x347118){return function(_0x42c30a){if(!_0x42c30a){_0x4190ab[_0xba3e('0x2b')](0x194);}return _0x42c30a;};}function handleError(_0x328aaf,_0x2df8e0){_0x2df8e0=_0x2df8e0||0x1f4;return function(_0xbb2a3c){logger['error'](_0xbb2a3c[_0xba3e('0x2c')]);if(_0xbb2a3c[_0xba3e('0x2d')]){delete _0xbb2a3c[_0xba3e('0x2d')];}_0x328aaf['status'](_0x2df8e0)[_0xba3e('0x2e')](_0xbb2a3c);};}exports['index']=function(_0x4fb8a0,_0x11318e){var _0x4cd364={},_0x26a025={},_0x544ca9={'count':0x0,'rows':[]};var _0x25bad7=_[_0xba3e('0x2f')](db[_0xba3e('0x30')][_0xba3e('0x31')],function(_0x10e076){return{'name':_0x10e076[_0xba3e('0x32')],'type':_0x10e076[_0xba3e('0x33')][_0xba3e('0x34')]};});_0x26a025[_0xba3e('0x35')]=_[_0xba3e('0x2f')](_0x25bad7,_0xba3e('0x2d'));_0x26a025[_0xba3e('0x36')]=_[_0xba3e('0x37')](_0x4fb8a0['query']);_0x26a025[_0xba3e('0x38')]=_[_0xba3e('0x39')](_0x26a025[_0xba3e('0x35')],_0x26a025['query']);_0x4cd364[_0xba3e('0x3a')]=_['intersection'](_0x26a025[_0xba3e('0x35')],qs[_0xba3e('0x3b')](_0x4fb8a0['query'][_0xba3e('0x3b')]));_0x4cd364[_0xba3e('0x3a')]=_0x4cd364[_0xba3e('0x3a')][_0xba3e('0x3c')]?_0x4cd364['attributes']:_0x26a025[_0xba3e('0x35')];if(!_0x4fb8a0['query']['hasOwnProperty']('nolimit')){_0x4cd364[_0xba3e('0x20')]=qs['limit'](_0x4fb8a0[_0xba3e('0x36')]['limit']);_0x4cd364['offset']=qs['offset'](_0x4fb8a0[_0xba3e('0x36')]['offset']);}_0x4cd364['order']=qs[_0xba3e('0x3d')](_0x4fb8a0[_0xba3e('0x36')][_0xba3e('0x3d')]);_0x4cd364['where']=qs[_0xba3e('0x38')](_[_0xba3e('0x3e')](_0x4fb8a0['query'],_0x26a025[_0xba3e('0x38')]),_0x25bad7);if(_0x4fb8a0[_0xba3e('0x36')][_0xba3e('0x3f')]){_0x4cd364[_0xba3e('0x40')]=_[_0xba3e('0x41')](_0x4cd364[_0xba3e('0x40')],{'$or':_[_0xba3e('0x2f')](_0x25bad7,function(_0x48f3c3){if(_0x48f3c3[_0xba3e('0x33')]!==_0xba3e('0x42')){var _0x517176={};_0x517176[_0x48f3c3['name']]={'$like':'%'+_0x4fb8a0[_0xba3e('0x36')][_0xba3e('0x3f')]+'%'};return _0x517176;}})});}_0x4cd364=_[_0xba3e('0x41')]({},_0x4cd364,_0x4fb8a0[_0xba3e('0x43')]);var _0x1e22c3={'where':_0x4cd364['where']};return db['CmHopperBlack'][_0xba3e('0x21')](_0x1e22c3)[_0xba3e('0x29')](function(_0x5dfb1e){_0x544ca9['count']=_0x5dfb1e;if(_0x4fb8a0[_0xba3e('0x36')][_0xba3e('0x44')]){_0x4cd364[_0xba3e('0x45')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xba3e('0x46')](_0x4cd364);})[_0xba3e('0x29')](function(_0x396376){_0x544ca9['rows']=_0x396376;return _0x544ca9;})[_0xba3e('0x29')](respondWithFilteredResult(_0x11318e,_0x4cd364))['catch'](handleError(_0x11318e,null));};exports[_0xba3e('0x47')]=function(_0x2280d0,_0x59a34d){var _0x2ef22f={'raw':!![],'where':{'id':_0x2280d0[_0xba3e('0x48')]['id']}},_0x286031={};_0x286031[_0xba3e('0x35')]=_['keys'](db[_0xba3e('0x30')]['rawAttributes']);_0x286031['query']=_[_0xba3e('0x37')](_0x2280d0[_0xba3e('0x36')]);_0x286031['filters']=_[_0xba3e('0x39')](_0x286031['model'],_0x286031[_0xba3e('0x36')]);_0x2ef22f[_0xba3e('0x3a')]=_['intersection'](_0x286031[_0xba3e('0x35')],qs[_0xba3e('0x3b')](_0x2280d0[_0xba3e('0x36')][_0xba3e('0x3b')]));_0x2ef22f['attributes']=_0x2ef22f[_0xba3e('0x3a')][_0xba3e('0x3c')]?_0x2ef22f[_0xba3e('0x3a')]:_0x286031[_0xba3e('0x35')];if(_0x2280d0[_0xba3e('0x36')][_0xba3e('0x44')]){_0x2ef22f[_0xba3e('0x45')]=[{'all':!![]}];}_0x2ef22f=_[_0xba3e('0x41')]({},_0x2ef22f,_0x2280d0[_0xba3e('0x43')]);return db[_0xba3e('0x30')]['find'](_0x2ef22f)[_0xba3e('0x29')](handleEntityNotFound(_0x59a34d,null))[_0xba3e('0x29')](respondWithResult(_0x59a34d,null))[_0xba3e('0x49')](handleError(_0x59a34d,null));};exports['update']=function(_0x57498e,_0x25f43b){if(_0x57498e['body']['id']){delete _0x57498e['body']['id'];}return db[_0xba3e('0x30')][_0xba3e('0x4a')]({'where':{'id':_0x57498e[_0xba3e('0x48')]['id']}})[_0xba3e('0x29')](handleEntityNotFound(_0x25f43b,null))[_0xba3e('0x29')](saveUpdates(_0x57498e['body'],null))[_0xba3e('0x29')](respondWithResult(_0x25f43b,null))['catch'](handleError(_0x25f43b,null));};exports['destroy']=function(_0xc85c7c,_0x44bb0a){return db[_0xba3e('0x30')][_0xba3e('0x4a')]({'where':{'id':_0xc85c7c[_0xba3e('0x48')]['id']}})['then'](handleEntityNotFound(_0x44bb0a,null))[_0xba3e('0x29')](removeEntity(_0x44bb0a,null))[_0xba3e('0x49')](handleError(_0x44bb0a,null));};exports[_0xba3e('0x4b')]=function(_0x45d289,_0x1a54c3){return db[_0xba3e('0x30')]['describe']()[_0xba3e('0x29')](respondWithResult(_0x1a54c3,null))[_0xba3e('0x49')](handleError(_0x1a54c3,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 9ab5b6e..b00215f 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 _0xce78=['api','moment','request-promise','rimraf','exports','define','CmHopperBlack','cm_hopper_black','../../config/logger'];(function(_0x4a209a,_0x575ff9){var _0x4b3c20=function(_0x1a50c1){while(--_0x1a50c1){_0x4a209a['push'](_0x4a209a['shift']());}};_0x4b3c20(++_0x575ff9);}(_0xce78,0x74));var _0x8ce7=function(_0xf4a734,_0x1a4fe7){_0xf4a734=_0xf4a734-0x0;var _0x10ee33=_0xce78[_0xf4a734];return _0x10ee33;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8ce7('0x0'))(_0x8ce7('0x1'));var moment=require(_0x8ce7('0x2'));var BPromise=require('bluebird');var rp=require(_0x8ce7('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8ce7('0x4'));var config=require('../../config/environment');var attributes=require('./cmHopperBlack.attributes');module[_0x8ce7('0x5')]=function(_0x29aad7,_0x5a652f){return _0x29aad7[_0x8ce7('0x6')](_0x8ce7('0x7'),attributes,{'tableName':_0x8ce7('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6b33=['./cmHopperBlack.attributes','exports','define','CmHopperBlack','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x41747a,_0x25e972){var _0x184199=function(_0x5be7d3){while(--_0x5be7d3){_0x41747a['push'](_0x41747a['shift']());}};_0x184199(++_0x25e972);}(_0x6b33,0x143));var _0x36b3=function(_0x461070,_0x2550c8){_0x461070=_0x461070-0x0;var _0xdc1292=_0x6b33[_0x461070];return _0xdc1292;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x36b3('0x0'))(_0x36b3('0x1'));var moment=require(_0x36b3('0x2'));var BPromise=require(_0x36b3('0x3'));var rp=require(_0x36b3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x36b3('0x5'));var config=require(_0x36b3('0x6'));var attributes=require(_0x36b3('0x7'));module[_0x36b3('0x8')]=function(_0x2aaa47,_0x2e666d){return _0x2aaa47[_0x36b3('0x9')](_0x36b3('0xa'),attributes,{'tableName':'cm_hopper_black','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 24a11a2..5239379 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 _0xb974=['DestroyCmHopperBlack','destroy','lodash','util','moment','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','client','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','limit','map','include','model','attributes','UpdateCmHopperBlack','update','body'];(function(_0x26a10d,_0x277fad){var _0x393311=function(_0x5c62df){while(--_0x5c62df){_0x26a10d['push'](_0x26a10d['shift']());}};_0x393311(++_0x277fad);}(_0xb974,0x105));var _0x4b97=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xb974[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x4b97('0x0'));var util=require(_0x4b97('0x1'));var moment=require(_0x4b97('0x2'));var BPromise=require(_0x4b97('0x3'));var rs=require(_0x4b97('0x4'));var fs=require('fs');var Redis=require(_0x4b97('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x4b97('0x6'));var jayson=require(_0x4b97('0x7'));var client=jayson[_0x4b97('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x38b146,_0x386b0f,_0x10ba8d){return new BPromise(function(_0x2eb0c3,_0x56f489){return client['request'](_0x38b146,_0x10ba8d)[_0x4b97('0x9')](function(_0x7d3a2f){logger[_0x4b97('0xa')](_0x4b97('0xb'),_0x386b0f,_0x4b97('0xc'));logger[_0x4b97('0xd')](_0x4b97('0xe'),_0x386b0f,'request\x20sent',JSON[_0x4b97('0xf')](_0x7d3a2f));if(_0x7d3a2f['error']){if(_0x7d3a2f[_0x4b97('0x10')][_0x4b97('0x11')]===0x1f4){logger[_0x4b97('0x10')](_0x4b97('0xb'),_0x386b0f,_0x7d3a2f[_0x4b97('0x10')][_0x4b97('0x12')]);return _0x56f489(_0x7d3a2f[_0x4b97('0x10')]['message']);}logger[_0x4b97('0x10')](_0x4b97('0xb'),_0x386b0f,_0x7d3a2f['error'][_0x4b97('0x12')]);return _0x2eb0c3(_0x7d3a2f[_0x4b97('0x10')][_0x4b97('0x12')]);}else{logger[_0x4b97('0xa')]('CmHopperBlack,\x20%s,\x20%s',_0x386b0f,'request\x20sent');_0x2eb0c3(_0x7d3a2f[_0x4b97('0x13')][_0x4b97('0x12')]);}})[_0x4b97('0x14')](function(_0x1ac552){logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x386b0f,_0x1ac552);_0x56f489(_0x1ac552);});});}exports[_0x4b97('0x15')]=function(_0x4d7787){var _0x4beed1=this;return new Promise(function(_0x39bd34,_0x40c2f7){return db[_0x4b97('0x16')][_0x4b97('0x17')]({'raw':_0x4d7787[_0x4b97('0x18')]?_0x4d7787[_0x4b97('0x18')][_0x4b97('0x19')]===undefined?!![]:![]:!![],'where':_0x4d7787[_0x4b97('0x18')]?_0x4d7787[_0x4b97('0x18')][_0x4b97('0x1a')]||null:null,'attributes':_0x4d7787[_0x4b97('0x18')]?_0x4d7787[_0x4b97('0x18')]['attributes']||null:null,'limit':_0x4d7787[_0x4b97('0x18')]?_0x4d7787[_0x4b97('0x18')][_0x4b97('0x1b')]||null:null,'include':_0x4d7787[_0x4b97('0x18')]?_0x4d7787[_0x4b97('0x18')]['include']?_[_0x4b97('0x1c')](_0x4d7787[_0x4b97('0x18')][_0x4b97('0x1d')],function(_0xdd0b57){return{'model':db[_0xdd0b57[_0x4b97('0x1e')]],'as':_0xdd0b57['as'],'attributes':_0xdd0b57[_0x4b97('0x1f')],'include':_0xdd0b57['include']?_[_0x4b97('0x1c')](_0xdd0b57[_0x4b97('0x1d')],function(_0x502302){return{'model':db[_0x502302['model']],'as':_0x502302['as'],'attributes':_0x502302[_0x4b97('0x1f')],'include':_0x502302['include']?_[_0x4b97('0x1c')](_0x502302[_0x4b97('0x1d')],function(_0x1630f1){return{'model':db[_0x1630f1['model']],'as':_0x1630f1['as'],'attributes':_0x1630f1[_0x4b97('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x4b97('0x9')](function(_0xc9dd5b){logger[_0x4b97('0xa')](_0x4b97('0x15'),_0x4d7787);logger[_0x4b97('0xd')](_0x4b97('0x15'),_0x4d7787,JSON[_0x4b97('0xf')](_0xc9dd5b));_0x39bd34(_0xc9dd5b);})[_0x4b97('0x14')](function(_0x35576d){logger[_0x4b97('0x10')](_0x4b97('0x15'),_0x35576d['message'],_0x4d7787);_0x40c2f7(_0x4beed1[_0x4b97('0x10')](0x1f4,_0x35576d['message']));});});};exports[_0x4b97('0x20')]=function(_0xabf01d){var _0x416497=this;return new Promise(function(_0x1dfbc2,_0x5db390){return db[_0x4b97('0x16')][_0x4b97('0x21')](_0xabf01d[_0x4b97('0x22')],{'raw':_0xabf01d[_0x4b97('0x18')]?_0xabf01d[_0x4b97('0x18')][_0x4b97('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xabf01d['options']?_0xabf01d[_0x4b97('0x18')][_0x4b97('0x1a')]||null:null,'attributes':_0xabf01d[_0x4b97('0x18')]?_0xabf01d['options'][_0x4b97('0x1f')]||null:null,'limit':_0xabf01d[_0x4b97('0x18')]?_0xabf01d['options'][_0x4b97('0x1b')]||null:null})[_0x4b97('0x9')](function(_0x163433){logger['info'](_0x4b97('0x20'),_0xabf01d);logger[_0x4b97('0xd')](_0x4b97('0x20'),_0xabf01d,JSON['stringify'](_0x163433));_0x1dfbc2(_0x163433);})[_0x4b97('0x14')](function(_0x454a7f){logger[_0x4b97('0x10')](_0x4b97('0x20'),_0x454a7f[_0x4b97('0x12')],_0xabf01d);_0x5db390(_0x416497[_0x4b97('0x10')](0x1f4,_0x454a7f['message']));});});};exports[_0x4b97('0x23')]=function(_0x1d9689){var _0x2abff1=this;return new Promise(function(_0x5da59d,_0x2f0143){return db[_0x4b97('0x16')][_0x4b97('0x24')]({'where':_0x1d9689['options']?_0x1d9689['options']['where']||null:null})['then'](function(_0x2b8a0c){logger[_0x4b97('0xa')](_0x4b97('0x23'),_0x1d9689);logger[_0x4b97('0xd')](_0x4b97('0x23'),_0x1d9689,JSON[_0x4b97('0xf')](_0x2b8a0c));_0x5da59d(_0x2b8a0c);})[_0x4b97('0x14')](function(_0x321249){logger[_0x4b97('0x10')](_0x4b97('0x23'),_0x321249['message'],_0x1d9689);_0x2f0143(_0x2abff1['error'](0x1f4,_0x321249[_0x4b97('0x12')]));});});}; \ No newline at end of file +var _0xc154=['../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','attributes','limit','include','map','model','stringify','update','body','UpdateCmHopperBlack','DestroyCmHopperBlack','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x622a5d,_0x46e7e1){var _0x5d1917=function(_0x181f14){while(--_0x181f14){_0x622a5d['push'](_0x622a5d['shift']());}};_0x5d1917(++_0x46e7e1);}(_0xc154,0xe3));var _0x4c15=function(_0xf858e,_0x51b0f1){_0xf858e=_0xf858e-0x0;var _0x5344d8=_0xc154[_0xf858e];return _0x5344d8;};'use strict';var _=require(_0x4c15('0x0'));var util=require(_0x4c15('0x1'));var moment=require(_0x4c15('0x2'));var BPromise=require(_0x4c15('0x3'));var rs=require(_0x4c15('0x4'));var fs=require('fs');var Redis=require(_0x4c15('0x5'));var db=require(_0x4c15('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4c15('0x7'))('rpc');var config=require(_0x4c15('0x8'));var jayson=require(_0x4c15('0x9'));var client=jayson[_0x4c15('0xa')][_0x4c15('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x442258,_0x587ec6,_0x42800e){return new BPromise(function(_0x163275,_0x3d200d){return client[_0x4c15('0xc')](_0x442258,_0x42800e)[_0x4c15('0xd')](function(_0x1b75e7){logger[_0x4c15('0xe')](_0x4c15('0xf'),_0x587ec6,_0x4c15('0x10'));logger[_0x4c15('0x11')](_0x4c15('0x12'),_0x587ec6,_0x4c15('0x10'),JSON['stringify'](_0x1b75e7));if(_0x1b75e7['error']){if(_0x1b75e7[_0x4c15('0x13')]['code']===0x1f4){logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x587ec6,_0x1b75e7[_0x4c15('0x13')][_0x4c15('0x14')]);return _0x3d200d(_0x1b75e7['error'][_0x4c15('0x14')]);}logger['error'](_0x4c15('0xf'),_0x587ec6,_0x1b75e7[_0x4c15('0x13')][_0x4c15('0x14')]);return _0x163275(_0x1b75e7[_0x4c15('0x13')][_0x4c15('0x14')]);}else{logger[_0x4c15('0xe')]('CmHopperBlack,\x20%s,\x20%s',_0x587ec6,_0x4c15('0x10'));_0x163275(_0x1b75e7[_0x4c15('0x15')]['message']);}})[_0x4c15('0x16')](function(_0xccf2d6){logger[_0x4c15('0x13')](_0x4c15('0xf'),_0x587ec6,_0xccf2d6);_0x3d200d(_0xccf2d6);});});}exports[_0x4c15('0x17')]=function(_0x5a918f){var _0x73dfad=this;return new Promise(function(_0x2fa82d,_0x9b823c){return db[_0x4c15('0x18')][_0x4c15('0x19')]({'raw':_0x5a918f[_0x4c15('0x1a')]?_0x5a918f[_0x4c15('0x1a')][_0x4c15('0x1b')]===undefined?!![]:![]:!![],'where':_0x5a918f[_0x4c15('0x1a')]?_0x5a918f['options'][_0x4c15('0x1c')]||null:null,'attributes':_0x5a918f['options']?_0x5a918f['options'][_0x4c15('0x1d')]||null:null,'limit':_0x5a918f['options']?_0x5a918f[_0x4c15('0x1a')][_0x4c15('0x1e')]||null:null,'include':_0x5a918f[_0x4c15('0x1a')]?_0x5a918f[_0x4c15('0x1a')][_0x4c15('0x1f')]?_[_0x4c15('0x20')](_0x5a918f['options']['include'],function(_0xaca28f){return{'model':db[_0xaca28f['model']],'as':_0xaca28f['as'],'attributes':_0xaca28f['attributes'],'include':_0xaca28f[_0x4c15('0x1f')]?_[_0x4c15('0x20')](_0xaca28f[_0x4c15('0x1f')],function(_0x24bd19){return{'model':db[_0x24bd19[_0x4c15('0x21')]],'as':_0x24bd19['as'],'attributes':_0x24bd19[_0x4c15('0x1d')],'include':_0x24bd19[_0x4c15('0x1f')]?_[_0x4c15('0x20')](_0x24bd19[_0x4c15('0x1f')],function(_0x406d14){return{'model':db[_0x406d14[_0x4c15('0x21')]],'as':_0x406d14['as'],'attributes':_0x406d14['attributes']};}):[]};}):[]};}):[]:[]})[_0x4c15('0xd')](function(_0x622be5){logger['info']('GetCmHopperBlack',_0x5a918f);logger[_0x4c15('0x11')](_0x4c15('0x17'),_0x5a918f,JSON[_0x4c15('0x22')](_0x622be5));_0x2fa82d(_0x622be5);})[_0x4c15('0x16')](function(_0x24ba0d){logger[_0x4c15('0x13')](_0x4c15('0x17'),_0x24ba0d[_0x4c15('0x14')],_0x5a918f);_0x9b823c(_0x73dfad[_0x4c15('0x13')](0x1f4,_0x24ba0d[_0x4c15('0x14')]));});});};exports['UpdateCmHopperBlack']=function(_0x4bc079){var _0x157878=this;return new Promise(function(_0x1ed4ae,_0x58f038){return db['CmHopperBlack'][_0x4c15('0x23')](_0x4bc079[_0x4c15('0x24')],{'raw':_0x4bc079['options']?_0x4bc079[_0x4c15('0x1a')][_0x4c15('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4bc079[_0x4c15('0x1a')]?_0x4bc079[_0x4c15('0x1a')][_0x4c15('0x1c')]||null:null,'attributes':_0x4bc079[_0x4c15('0x1a')]?_0x4bc079[_0x4c15('0x1a')][_0x4c15('0x1d')]||null:null,'limit':_0x4bc079[_0x4c15('0x1a')]?_0x4bc079['options'][_0x4c15('0x1e')]||null:null})[_0x4c15('0xd')](function(_0x2f869e){logger[_0x4c15('0xe')](_0x4c15('0x25'),_0x4bc079);logger[_0x4c15('0x11')](_0x4c15('0x25'),_0x4bc079,JSON[_0x4c15('0x22')](_0x2f869e));_0x1ed4ae(_0x2f869e);})[_0x4c15('0x16')](function(_0x372afd){logger[_0x4c15('0x13')](_0x4c15('0x25'),_0x372afd['message'],_0x4bc079);_0x58f038(_0x157878['error'](0x1f4,_0x372afd[_0x4c15('0x14')]));});});};exports[_0x4c15('0x26')]=function(_0x5f2f8c){var _0x57117c=this;return new Promise(function(_0x1d5c7e,_0x55919b){return db[_0x4c15('0x18')]['destroy']({'where':_0x5f2f8c[_0x4c15('0x1a')]?_0x5f2f8c[_0x4c15('0x1a')]['where']||null:null})[_0x4c15('0xd')](function(_0x30a9ce){logger[_0x4c15('0xe')](_0x4c15('0x26'),_0x5f2f8c);logger[_0x4c15('0x11')](_0x4c15('0x26'),_0x5f2f8c,JSON[_0x4c15('0x22')](_0x30a9ce));_0x1d5c7e(_0x30a9ce);})[_0x4c15('0x16')](function(_0xe73f50){logger[_0x4c15('0x13')](_0x4c15('0x26'),_0xe73f50[_0x4c15('0x14')],_0x5f2f8c);_0x55919b(_0x57117c['error'](0x1f4,_0xe73f50[_0x4c15('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index aa514c9..1af777a 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 _0xa6b0=['update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','describe','/:id','put'];(function(_0x483017,_0x73092c){var _0x3cc794=function(_0x28cb06){while(--_0x28cb06){_0x483017['push'](_0x483017['shift']());}};_0x3cc794(++_0x73092c);}(_0xa6b0,0xaf));var _0x0a6b=function(_0x2eaff2,_0x79b375){_0x2eaff2=_0x2eaff2-0x0;var _0xf691ed=_0xa6b0[_0x2eaff2];return _0xf691ed;};'use strict';var multer=require(_0x0a6b('0x0'));var util=require(_0x0a6b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0a6b('0x2'));var router=express[_0x0a6b('0x3')]();var fs_extra=require(_0x0a6b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0a6b('0x5'));var config=require(_0x0a6b('0x6'));var controller=require(_0x0a6b('0x7'));router[_0x0a6b('0x8')]('/',auth[_0x0a6b('0x9')](),controller[_0x0a6b('0xa')]);router[_0x0a6b('0x8')](_0x0a6b('0xb'),auth[_0x0a6b('0x9')](),controller[_0x0a6b('0xc')]);router[_0x0a6b('0x8')](_0x0a6b('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x0a6b('0xe')](_0x0a6b('0xd'),auth[_0x0a6b('0x9')](),controller[_0x0a6b('0xf')]);router[_0x0a6b('0x10')](_0x0a6b('0xd'),auth[_0x0a6b('0x9')](),controller[_0x0a6b('0x11')]);module[_0x0a6b('0x12')]=router; \ No newline at end of file +var _0x4819=['show','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','isAuthenticated','/describe','describe','get','/:id'];(function(_0x1036ee,_0x45df41){var _0x56a33c=function(_0x244dbe){while(--_0x244dbe){_0x1036ee['push'](_0x1036ee['shift']());}};_0x56a33c(++_0x45df41);}(_0x4819,0xcd));var _0x9481=function(_0x3bf957,_0x168c65){_0x3bf957=_0x3bf957-0x0;var _0x551cc=_0x4819[_0x3bf957];return _0x551cc;};'use strict';var multer=require('multer');var util=require(_0x9481('0x0'));var path=require(_0x9481('0x1'));var timeout=require(_0x9481('0x2'));var express=require(_0x9481('0x3'));var router=express[_0x9481('0x4')]();var fs_extra=require(_0x9481('0x5'));var auth=require(_0x9481('0x6'));var interaction=require(_0x9481('0x7'));var config=require(_0x9481('0x8'));var controller=require(_0x9481('0x9'));router['get']('/',auth[_0x9481('0xa')](),controller['index']);router['get'](_0x9481('0xb'),auth[_0x9481('0xa')](),controller[_0x9481('0xc')]);router[_0x9481('0xd')](_0x9481('0xe'),auth['isAuthenticated'](),controller[_0x9481('0xf')]);router['put'](_0x9481('0xe'),auth['isAuthenticated'](),controller[_0x9481('0x10')]);router[_0x9481('0x11')](_0x9481('0xe'),auth[_0x9481('0xa')](),controller[_0x9481('0x12')]);module[_0x9481('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 1042406..43bcd12 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 _0xb449=['setDataValue','BOOLEAN','sequelize','moment','INTEGER','STRING','DATE','endtime'];(function(_0x2aa196,_0x5a832f){var _0x5e2a4e=function(_0x907b50){while(--_0x907b50){_0x2aa196['push'](_0x2aa196['shift']());}};_0x5e2a4e(++_0x5a832f);}(_0xb449,0xaa));var _0x9b44=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb449[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x9b44('0x0'));var moment=require(_0x9b44('0x1'));module['exports']={'state':{'type':Sequelize[_0x9b44('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x9b44('0x3')]},'scheduledat':{'type':Sequelize[_0x9b44('0x4')]},'countbusyretry':{'type':Sequelize[_0x9b44('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x9b44('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x9b44('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x9b44('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x9b44('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x9b44('0x3')]},'originatecalleridname':{'type':Sequelize[_0x9b44('0x3')]},'calleridnum':{'type':Sequelize[_0x9b44('0x3')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x9b44('0x4')]},'responsetime':{'type':Sequelize[_0x9b44('0x4')]},'answertime':{'type':Sequelize[_0x9b44('0x4')]},'droptime':{'type':Sequelize[_0x9b44('0x4')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x9b44('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x9b44('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x9b44('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x9b44('0x3')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x9b44('0x3')]},'reason':{'type':Sequelize[_0x9b44('0x3')]},'disposition':{'type':Sequelize[_0x9b44('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x9b44('0x3')]},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x51289a){var _0x172f0d=this['getDataValue'](_0x9b44('0x5'));if(_0x172f0d&&_0x51289a){this[_0x9b44('0x6')]('followuptime',moment(_0x51289a)['diff'](moment(_0x172f0d),'seconds'));}}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x9b44('0x7')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x9b44('0x7')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x9b44('0x4')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x9b44('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0x9b44('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x9b44('0x4')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x9b44('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0x9b44('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x9b44('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x9b44('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x9b44('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x052f=['seconds','BOOLEAN','moment','exports','INTEGER','STRING','DATE','getDataValue','setDataValue','followuptime','diff'];(function(_0x46b387,_0x5a75cc){var _0x4d4502=function(_0x46d8b4){while(--_0x46d8b4){_0x46b387['push'](_0x46b387['shift']());}};_0x4d4502(++_0x5a75cc);}(_0x052f,0x199));var _0xf052=function(_0x409cdb,_0x4f17f4){_0x409cdb=_0x409cdb-0x0;var _0x3ecbbf=_0x052f[_0x409cdb];return _0x3ecbbf;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xf052('0x0'));module[_0xf052('0x1')]={'state':{'type':Sequelize[_0xf052('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0xf052('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xf052('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xf052('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xf052('0x3')]},'originatecalleridnum':{'type':Sequelize[_0xf052('0x3')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xf052('0x3')]},'calleridname':{'type':Sequelize[_0xf052('0x3')]},'starttime':{'type':Sequelize[_0xf052('0x4')]},'responsetime':{'type':Sequelize[_0xf052('0x4')]},'answertime':{'type':Sequelize[_0xf052('0x4')]},'droptime':{'type':Sequelize[_0xf052('0x4')]},'endtime':{'type':Sequelize[_0xf052('0x4')]},'ringtime':{'type':Sequelize[_0xf052('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xf052('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xf052('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0xf052('0x3')]},'campaigntype':{'type':Sequelize[_0xf052('0x3')]},'membername':{'type':Sequelize[_0xf052('0x3')]},'reason':{'type':Sequelize[_0xf052('0x3')]},'disposition':{'type':Sequelize[_0xf052('0x3')]},'secondDisposition':{'type':Sequelize[_0xf052('0x3')]},'thirdDisposition':{'type':Sequelize[_0xf052('0x3')]},'dispositionat':{'type':Sequelize[_0xf052('0x4')],'set':function(_0x45093d){var _0x130302=this[_0xf052('0x5')]('endtime');if(_0x130302&&_0x45093d){this[_0xf052('0x6')](_0xf052('0x7'),moment(_0x45093d)[_0xf052('0x8')](moment(_0x130302),_0xf052('0x9')));}}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0xf052('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xf052('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xf052('0x4')]},'callback':{'type':Sequelize[_0xf052('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0xf052('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0xf052('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize[_0xf052('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xf052('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xf052('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xf052('0x2')],'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 1aa6787..f697805 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 _0x5d17=['ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','VoiceQueueId','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20NOT\x20IN\x20(?)','cm_hopper','state\x20=\x204','moveContactsIvrCampaignHopperFinal','into','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','calleridnum','group','checkContactHopper','findOne','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','name','send','index','CmHopperFinal','rawAttributes','fieldName','type','model','map','query','intersection','attributes','fields','length','nolimit','sort','where','filters','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','describe','update','body','uniqueid','find','countContactsQueueCampaignHopperFinal','COUNT','sequelize','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','literal','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','answeringMachine','countContactsIvrCampaignHopperFinal','congestionContacts','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','fromQuery','scheduledAt','ContactId','ListId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','phone','NOW()'];(function(_0x5e2152,_0x172f3d){var _0x5ddcf6=function(_0x30a5cc){while(--_0x30a5cc){_0x5e2152['push'](_0x5e2152['shift']());}};_0x5ddcf6(++_0x172f3d);}(_0x5d17,0x114));var _0x75d1=function(_0x14909f,_0xe25f2e){_0x14909f=_0x14909f-0x0;var _0x19698c=_0x5d17[_0x14909f];return _0x19698c;};'use strict';var emlformat=require(_0x75d1('0x0'));var rimraf=require(_0x75d1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x75d1('0x2'));var moment=require(_0x75d1('0x3'));var BPromise=require(_0x75d1('0x4'));var Mustache=require('mustache');var util=require(_0x75d1('0x5'));var path=require(_0x75d1('0x6'));var sox=require(_0x75d1('0x7'));var csv=require(_0x75d1('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x75d1('0x9'));var _=require(_0x75d1('0xa'));var squel=require(_0x75d1('0xb'));var crypto=require(_0x75d1('0xc'));var jsforce=require(_0x75d1('0xd'));var deskjs=require(_0x75d1('0xe'));var toCsv=require(_0x75d1('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x75d1('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x75d1('0x10'));var hardwareService=require(_0x75d1('0x11'));var logger=require('../../config/logger')(_0x75d1('0x12'));var utils=require(_0x75d1('0x13'));var config=require(_0x75d1('0x14'));var licenseUtil=require(_0x75d1('0x15'));var db=require(_0x75d1('0x16'))['db'];function respondWithStatusCode(_0xd089cf,_0x49667a){_0x49667a=_0x49667a||0xcc;return function(_0x19e825){if(_0x19e825){return _0xd089cf[_0x75d1('0x17')](_0x49667a);}return _0xd089cf[_0x75d1('0x18')](_0x49667a)[_0x75d1('0x19')]();};}function respondWithResult(_0x49d723,_0x553697){_0x553697=_0x553697||0xc8;return function(_0x55b8a0){if(_0x55b8a0){return _0x49d723[_0x75d1('0x18')](_0x553697)[_0x75d1('0x1a')](_0x55b8a0);}};}function respondWithFilteredResult(_0x2fd022,_0x52e649){return function(_0x1f9620){if(_0x1f9620){var _0x3fff9b=typeof _0x52e649[_0x75d1('0x1b')]===_0x75d1('0x1c')&&typeof _0x52e649[_0x75d1('0x1d')]===_0x75d1('0x1c');var _0x2845bc=_0x1f9620[_0x75d1('0x1e')];var _0x1bc5de=_0x3fff9b?0x0:_0x52e649[_0x75d1('0x1b')];var _0x2c2a6d=_0x3fff9b?_0x1f9620['count']:_0x52e649['offset']+_0x52e649[_0x75d1('0x1d')];var _0x42b7ac;if(_0x2c2a6d>=_0x2845bc){_0x2c2a6d=_0x2845bc;_0x42b7ac=0xc8;}else{_0x42b7ac=0xce;}_0x2fd022['status'](_0x42b7ac);return _0x2fd022[_0x75d1('0x1f')](_0x75d1('0x20'),_0x1bc5de+'-'+_0x2c2a6d+'/'+_0x2845bc)[_0x75d1('0x1a')](_0x1f9620);}return null;};}function patchUpdates(_0xf6cc70){return function(_0xa42dbe){try{jsonpatch[_0x75d1('0x21')](_0xa42dbe,_0xf6cc70,!![]);}catch(_0x51d3b0){return BPromise[_0x75d1('0x22')](_0x51d3b0);}return _0xa42dbe[_0x75d1('0x23')]();};}function saveUpdates(_0x501cc7,_0x1cb58c){return function(_0x641ea4){if(_0x641ea4){return _0x641ea4['update'](_0x501cc7)[_0x75d1('0x24')](function(_0x5e70ec){return _0x5e70ec;});}return null;};}function removeEntity(_0x3a85c0,_0xc256af){return function(_0x345cf5){if(_0x345cf5){return _0x345cf5['destroy']()['then'](function(){_0x3a85c0[_0x75d1('0x18')](0xcc)[_0x75d1('0x19')]();});}};}function handleEntityNotFound(_0x315ce5,_0x18184b){return function(_0x51d043){if(!_0x51d043){_0x315ce5[_0x75d1('0x17')](0x194);}return _0x51d043;};}function handleError(_0x2b5848,_0x367238){_0x367238=_0x367238||0x1f4;return function(_0x51138e){logger['error'](_0x51138e['stack']);if(_0x51138e[_0x75d1('0x25')]){delete _0x51138e[_0x75d1('0x25')];}_0x2b5848[_0x75d1('0x18')](_0x367238)[_0x75d1('0x26')](_0x51138e);};}exports[_0x75d1('0x27')]=function(_0x519ceb,_0x4d292e){var _0x410e16={},_0x197f52={},_0x4967b5={'count':0x0,'rows':[]};var _0x2408b6=_['map'](db[_0x75d1('0x28')][_0x75d1('0x29')],function(_0x91e7c9){return{'name':_0x91e7c9[_0x75d1('0x2a')],'type':_0x91e7c9[_0x75d1('0x2b')]['key']};});_0x197f52[_0x75d1('0x2c')]=_[_0x75d1('0x2d')](_0x2408b6,_0x75d1('0x25'));_0x197f52[_0x75d1('0x2e')]=_['keys'](_0x519ceb[_0x75d1('0x2e')]);_0x197f52['filters']=_[_0x75d1('0x2f')](_0x197f52[_0x75d1('0x2c')],_0x197f52['query']);_0x410e16[_0x75d1('0x30')]=_[_0x75d1('0x2f')](_0x197f52[_0x75d1('0x2c')],qs[_0x75d1('0x31')](_0x519ceb[_0x75d1('0x2e')]['fields']));_0x410e16[_0x75d1('0x30')]=_0x410e16[_0x75d1('0x30')][_0x75d1('0x32')]?_0x410e16[_0x75d1('0x30')]:_0x197f52['model'];if(!_0x519ceb['query']['hasOwnProperty'](_0x75d1('0x33'))){_0x410e16[_0x75d1('0x1d')]=qs[_0x75d1('0x1d')](_0x519ceb[_0x75d1('0x2e')][_0x75d1('0x1d')]);_0x410e16[_0x75d1('0x1b')]=qs[_0x75d1('0x1b')](_0x519ceb[_0x75d1('0x2e')][_0x75d1('0x1b')]);}_0x410e16['order']=qs[_0x75d1('0x34')](_0x519ceb[_0x75d1('0x2e')][_0x75d1('0x34')]);_0x410e16[_0x75d1('0x35')]=qs[_0x75d1('0x36')](_['pick'](_0x519ceb['query'],_0x197f52['filters']),_0x2408b6);if(_0x519ceb[_0x75d1('0x2e')][_0x75d1('0x37')]){_0x410e16[_0x75d1('0x35')]=_[_0x75d1('0x38')](_0x410e16[_0x75d1('0x35')],{'$or':_[_0x75d1('0x2d')](_0x2408b6,function(_0x48f9f3){if(_0x48f9f3['type']!=='VIRTUAL'){var _0x3f2569={};_0x3f2569[_0x48f9f3['name']]={'$like':'%'+_0x519ceb['query'][_0x75d1('0x37')]+'%'};return _0x3f2569;}})});}_0x410e16=_[_0x75d1('0x38')]({},_0x410e16,_0x519ceb[_0x75d1('0x39')]);var _0x46854c={'where':_0x410e16['where']};return db[_0x75d1('0x28')][_0x75d1('0x1e')](_0x46854c)[_0x75d1('0x24')](function(_0x3d4137){_0x4967b5[_0x75d1('0x1e')]=_0x3d4137;if(_0x519ceb[_0x75d1('0x2e')][_0x75d1('0x3a')]){_0x410e16[_0x75d1('0x3b')]=[{'all':!![]}];}return db[_0x75d1('0x28')][_0x75d1('0x3c')](_0x410e16);})[_0x75d1('0x24')](function(_0x93922f){_0x4967b5[_0x75d1('0x3d')]=_0x93922f;return _0x4967b5;})[_0x75d1('0x24')](respondWithFilteredResult(_0x4d292e,_0x410e16))[_0x75d1('0x3e')](handleError(_0x4d292e,null));};exports[_0x75d1('0x3f')]=function(_0x25f689,_0x2ad3ef){var _0x42c18c={'raw':!![],'where':{'id':_0x25f689[_0x75d1('0x40')]['id']}},_0x2384aa={};_0x2384aa[_0x75d1('0x2c')]=_['keys'](db['CmHopperFinal'][_0x75d1('0x29')]);_0x2384aa[_0x75d1('0x2e')]=_[_0x75d1('0x41')](_0x25f689[_0x75d1('0x2e')]);_0x2384aa['filters']=_[_0x75d1('0x2f')](_0x2384aa[_0x75d1('0x2c')],_0x2384aa[_0x75d1('0x2e')]);_0x42c18c[_0x75d1('0x30')]=_['intersection'](_0x2384aa[_0x75d1('0x2c')],qs[_0x75d1('0x31')](_0x25f689[_0x75d1('0x2e')][_0x75d1('0x31')]));_0x42c18c['attributes']=_0x42c18c[_0x75d1('0x30')]['length']?_0x42c18c[_0x75d1('0x30')]:_0x2384aa[_0x75d1('0x2c')];if(_0x25f689[_0x75d1('0x2e')][_0x75d1('0x3a')]){_0x42c18c[_0x75d1('0x3b')]=[{'all':!![]}];}_0x42c18c=_[_0x75d1('0x38')]({},_0x42c18c,_0x25f689['options']);return db[_0x75d1('0x28')]['find'](_0x42c18c)['then'](handleEntityNotFound(_0x2ad3ef,null))[_0x75d1('0x24')](respondWithResult(_0x2ad3ef,null))[_0x75d1('0x3e')](handleError(_0x2ad3ef,null));};exports[_0x75d1('0x42')]=function(_0x12bd67,_0x16f744){return db[_0x75d1('0x28')][_0x75d1('0x42')]()['then'](respondWithResult(_0x16f744,null))['catch'](handleError(_0x16f744,null));};exports[_0x75d1('0x43')]=function(_0x8ce3d2,_0x50def3){if(_0x8ce3d2[_0x75d1('0x44')][_0x75d1('0x45')]){delete _0x8ce3d2[_0x75d1('0x44')]['uniqueid'];}return db[_0x75d1('0x28')][_0x75d1('0x46')]({'where':{'uniqueid':_0x8ce3d2[_0x75d1('0x40')]['id']}})[_0x75d1('0x24')](handleEntityNotFound(_0x50def3,null))[_0x75d1('0x24')](saveUpdates(_0x8ce3d2[_0x75d1('0x44')],null))[_0x75d1('0x24')](respondWithResult(_0x50def3,null))['catch'](handleError(_0x50def3,null));};exports[_0x75d1('0x47')]=function(_0x382195,_0x16b3c0,_0x395e0b){return db[_0x75d1('0x28')][_0x75d1('0x3c')]({'raw':![],'where':{'VoiceQueueId':_0x382195[_0x75d1('0x40')]['id']},'attributes':[[db['sequelize']['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db[_0x75d1('0x49')]['literal'](_0x75d1('0x4a')))),_0x75d1('0x4b')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db[_0x75d1('0x49')]['literal'](_0x75d1('0x4c')))),_0x75d1('0x4d')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db[_0x75d1('0x49')][_0x75d1('0x4e')](_0x75d1('0x4f')))),_0x75d1('0x50')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db['sequelize']['literal'](_0x75d1('0x51')))),'congestionContacts'],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db['sequelize']['fn']('IF',db[_0x75d1('0x49')][_0x75d1('0x4e')](_0x75d1('0x52')))),_0x75d1('0x53')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db['sequelize'][_0x75d1('0x4e')](_0x75d1('0x54')))),_0x75d1('0x55')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db[_0x75d1('0x49')][_0x75d1('0x4e')](_0x75d1('0x56')))),_0x75d1('0x57')],[db['sequelize']['fn']('COUNT',db[_0x75d1('0x49')]['fn']('IF',db[_0x75d1('0x49')][_0x75d1('0x4e')]('`state`\x20=\x2019,\x201,\x20null'))),_0x75d1('0x58')]]})['then'](handleEntityNotFound(_0x16b3c0,null))[_0x75d1('0x24')](respondWithResult(_0x16b3c0,null))[_0x75d1('0x3e')](handleError(_0x16b3c0,null));};exports[_0x75d1('0x59')]=function(_0x16cc70,_0x5d2219,_0x22ce12){return db['CmHopperFinal']['findAll']({'raw':![],'where':{'CampaignId':_0x16cc70[_0x75d1('0x40')]['id']},'attributes':[[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db['sequelize']['literal'](_0x75d1('0x4a')))),_0x75d1('0x4b')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db['sequelize'][_0x75d1('0x4e')](_0x75d1('0x4c')))),_0x75d1('0x4d')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db[_0x75d1('0x49')][_0x75d1('0x4e')](_0x75d1('0x4f')))),_0x75d1('0x50')],[db[_0x75d1('0x49')]['fn']('COUNT',db[_0x75d1('0x49')]['fn']('IF',db[_0x75d1('0x49')][_0x75d1('0x4e')](_0x75d1('0x51')))),_0x75d1('0x5a')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db['sequelize']['fn']('IF',db['sequelize'][_0x75d1('0x4e')](_0x75d1('0x52')))),_0x75d1('0x53')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db['sequelize']['fn']('IF',db['sequelize'][_0x75d1('0x4e')](_0x75d1('0x54')))),'abandonedContacts'],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db[_0x75d1('0x49')][_0x75d1('0x4e')](_0x75d1('0x56')))),'reCallContacts'],[db['sequelize']['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db['sequelize'][_0x75d1('0x4e')]('`state`\x20=\x2019,\x201,\x20null'))),_0x75d1('0x58')]]})[_0x75d1('0x24')](handleEntityNotFound(_0x5d2219,null))[_0x75d1('0x24')](respondWithResult(_0x5d2219,null))['catch'](handleError(_0x5d2219,null));};exports[_0x75d1('0x5b')]=function(_0x1f9ac2,_0x290587,_0x1baaca){return db[_0x75d1('0x5c')]['find']({'where':{'id':_0x1f9ac2['params']['id']}})[_0x75d1('0x24')](handleEntityNotFound(_0x290587,null))['then'](function(_0x3f15f3){var _0xf29a9f;if(_0x3f15f3){_0xf29a9f=squel[_0x75d1('0x5d')]()['into']('cm_hopper')[_0x75d1('0x5e')](['phone',_0x75d1('0x5f'),_0x75d1('0x60'),_0x75d1('0x61'),'VoiceQueueId',_0x75d1('0x62'),_0x75d1('0x63')],squel[_0x75d1('0x64')]()[_0x75d1('0x65')](_0x75d1('0x66'),_0x75d1('0x67'))[_0x75d1('0x65')](_0x75d1('0x68'),_0x75d1('0x5f'))[_0x75d1('0x65')](_0x75d1('0x69'),_0x75d1('0x60'))[_0x75d1('0x65')](_0x75d1('0x6a'),'ListId')['field'](_0x75d1('0x6b'),_0x75d1('0x6c'))['field'](_0x75d1('0x68'),'createdAt')['field']('NOW()',_0x75d1('0x63'))[_0x75d1('0x6d')](_0x75d1('0x6e'))[_0x75d1('0x35')](_0x75d1('0x6f'),_0x1f9ac2['params']['id'][_0x75d1('0x70')]())[_0x75d1('0x35')](_0x75d1('0x71'),_0x1f9ac2[_0x75d1('0x44')][_0x75d1('0x72')]['toString']())[_0x75d1('0x35')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x75d1('0x35')](_0x75d1('0x73'),squel[_0x75d1('0x64')]()['field']('phone')['from'](_0x75d1('0x74'))[_0x75d1('0x35')](_0x75d1('0x6f'),_0x1f9ac2[_0x75d1('0x40')]['id'][_0x75d1('0x70')]()))[_0x75d1('0x35')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x75d1('0x64')]()[_0x75d1('0x65')]('calleridnum')[_0x75d1('0x6d')]('cm_hopper_final')['where']('VoiceQueueId\x20=\x20?',_0x1f9ac2[_0x75d1('0x40')]['id']['toString']())['where'](_0x75d1('0x75')))['group'](_0x75d1('0x60')))[_0x75d1('0x70')]();return db[_0x75d1('0x49')][_0x75d1('0x2e')](_0xf29a9f);}return[];})[_0x75d1('0x24')](respondWithResult(_0x290587,null))[_0x75d1('0x3e')](handleError(_0x290587,null));};exports[_0x75d1('0x76')]=function(_0x217347,_0x51b682,_0x195a0a){return db['Campaign'][_0x75d1('0x46')]({'where':{'id':_0x217347[_0x75d1('0x40')]['id']}})[_0x75d1('0x24')](handleEntityNotFound(_0x51b682,null))['then'](function(_0x10bc92){var _0x150735;if(_0x10bc92){_0x150735=squel[_0x75d1('0x5d')]()[_0x75d1('0x77')](_0x75d1('0x74'))[_0x75d1('0x5e')]([_0x75d1('0x67'),'scheduledAt',_0x75d1('0x60'),_0x75d1('0x61'),_0x75d1('0x78'),_0x75d1('0x62'),_0x75d1('0x63')],squel['select']()['field'](_0x75d1('0x66'),'phone')[_0x75d1('0x65')](_0x75d1('0x68'),_0x75d1('0x5f'))[_0x75d1('0x65')]('ANY_VALUE(ContactId)','ContactId')[_0x75d1('0x65')](_0x75d1('0x6a'),_0x75d1('0x61'))[_0x75d1('0x65')](_0x75d1('0x79'),'CampaignId')[_0x75d1('0x65')](_0x75d1('0x68'),'createdAt')[_0x75d1('0x65')](_0x75d1('0x68'),_0x75d1('0x63'))[_0x75d1('0x6d')](_0x75d1('0x6e'))[_0x75d1('0x35')]('CampaignId\x20=\x20?',_0x217347[_0x75d1('0x40')]['id'][_0x75d1('0x70')]())[_0x75d1('0x35')](_0x75d1('0x71'),_0x217347[_0x75d1('0x44')][_0x75d1('0x72')]['toString']())[_0x75d1('0x35')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x75d1('0x35')](_0x75d1('0x73'),squel[_0x75d1('0x64')]()[_0x75d1('0x65')](_0x75d1('0x67'))[_0x75d1('0x6d')]('cm_hopper')[_0x75d1('0x35')](_0x75d1('0x7a'),_0x217347[_0x75d1('0x40')]['id']['toString']()))[_0x75d1('0x35')](_0x75d1('0x73'),squel['select']()[_0x75d1('0x65')](_0x75d1('0x7b'))[_0x75d1('0x6d')](_0x75d1('0x6e'))[_0x75d1('0x35')](_0x75d1('0x7a'),_0x217347[_0x75d1('0x40')]['id'][_0x75d1('0x70')]())[_0x75d1('0x35')]('state\x20=\x204'))[_0x75d1('0x7c')](_0x75d1('0x60')))['toString']();return db[_0x75d1('0x49')][_0x75d1('0x2e')](_0x150735);}return[];})['then'](respondWithResult(_0x51b682,null))['catch'](handleError(_0x51b682,null));};exports[_0x75d1('0x7d')]=function(_0x44a017,_0x4d8e5d,_0x1f3a7e){return db['CmHopper'][_0x75d1('0x7e')]({'where':{'VoiceQueueId':_0x44a017['body'][_0x75d1('0x6c')],'CampaignId':_0x44a017[_0x75d1('0x44')][_0x75d1('0x78')],'ContactId':_0x44a017[_0x75d1('0x44')][_0x75d1('0x60')]}})[_0x75d1('0x24')](handleEntityNotFound(_0x4d8e5d,null))[_0x75d1('0x24')](function(_0x205e82){if(_0x205e82){return _0x205e82;}return null;})[_0x75d1('0x24')](respondWithResult(_0x4d8e5d,null))[_0x75d1('0x3e')](handleError(_0x4d8e5d,null));}; \ No newline at end of file +var _0x0295=['ejs','fs-extra','lodash','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','CmHopperFinal','includeAll','rows','catch','show','params','intersection','include','find','describe','body','uniqueid','findAll','sequelize','literal','noSuchContacts','COUNT','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x200,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','cm_hopper','fromQuery','phone','scheduledAt','ListId','VoiceQueueId','updatedAt','select','field','NOW()','ANY_VALUE(ContactId)','ContactId','ANY_VALUE(ListId)','createdAt','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20NOT\x20IN\x20(?)','from','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','insert','into','CampaignId','ANY_VALUE(calleridnum)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','CmHopper','findOne','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv'];(function(_0x3041f2,_0x328cc7){var _0x349c0b=function(_0x78ff43){while(--_0x78ff43){_0x3041f2['push'](_0x3041f2['shift']());}};_0x349c0b(++_0x328cc7);}(_0x0295,0x1f0));var _0x5029=function(_0x329664,_0x130748){_0x329664=_0x329664-0x0;var _0x4e346e=_0x0295[_0x329664];return _0x4e346e;};'use strict';var emlformat=require(_0x5029('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5029('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5029('0x2'));var Mustache=require(_0x5029('0x3'));var util=require(_0x5029('0x4'));var path=require(_0x5029('0x5'));var sox=require(_0x5029('0x6'));var csv=require(_0x5029('0x7'));var ejs=require(_0x5029('0x8'));var fs=require('fs');var fs_extra=require(_0x5029('0x9'));var _=require(_0x5029('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5029('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5029('0xc'));var Papa=require('papaparse');var Redis=require(_0x5029('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x5029('0xe'));var as=require(_0x5029('0xf'));var hardwareService=require(_0x5029('0x10'));var logger=require('../../config/logger')(_0x5029('0x11'));var utils=require(_0x5029('0x12'));var config=require(_0x5029('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5029('0x14'))['db'];function respondWithStatusCode(_0x2442b2,_0x4cced9){_0x4cced9=_0x4cced9||0xcc;return function(_0x4fa22d){if(_0x4fa22d){return _0x2442b2['sendStatus'](_0x4cced9);}return _0x2442b2['status'](_0x4cced9)[_0x5029('0x15')]();};}function respondWithResult(_0x2e0369,_0x12c237){_0x12c237=_0x12c237||0xc8;return function(_0x434630){if(_0x434630){return _0x2e0369[_0x5029('0x16')](_0x12c237)[_0x5029('0x17')](_0x434630);}};}function respondWithFilteredResult(_0xe278b7,_0x317c20){return function(_0x10bf55){if(_0x10bf55){var _0x326923=typeof _0x317c20[_0x5029('0x18')]===_0x5029('0x19')&&typeof _0x317c20[_0x5029('0x1a')]===_0x5029('0x19');var _0x343918=_0x10bf55['count'];var _0x1ed567=_0x326923?0x0:_0x317c20[_0x5029('0x18')];var _0x35de81=_0x326923?_0x10bf55[_0x5029('0x1b')]:_0x317c20[_0x5029('0x18')]+_0x317c20[_0x5029('0x1a')];var _0xaba461;if(_0x35de81>=_0x343918){_0x35de81=_0x343918;_0xaba461=0xc8;}else{_0xaba461=0xce;}_0xe278b7['status'](_0xaba461);return _0xe278b7[_0x5029('0x1c')]('Content-Range',_0x1ed567+'-'+_0x35de81+'/'+_0x343918)[_0x5029('0x17')](_0x10bf55);}return null;};}function patchUpdates(_0x8a414c){return function(_0x2710aa){try{jsonpatch[_0x5029('0x1d')](_0x2710aa,_0x8a414c,!![]);}catch(_0x4b5854){return BPromise['reject'](_0x4b5854);}return _0x2710aa[_0x5029('0x1e')]();};}function saveUpdates(_0x4a49b6,_0x3f657d){return function(_0x853a34){if(_0x853a34){return _0x853a34[_0x5029('0x1f')](_0x4a49b6)[_0x5029('0x20')](function(_0x16bd22){return _0x16bd22;});}return null;};}function removeEntity(_0x3a3e52,_0x125c26){return function(_0x356dac){if(_0x356dac){return _0x356dac[_0x5029('0x21')]()['then'](function(){_0x3a3e52['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x588d90,_0x45666c){return function(_0x51093c){if(!_0x51093c){_0x588d90['sendStatus'](0x194);}return _0x51093c;};}function handleError(_0x181da0,_0x1e7e61){_0x1e7e61=_0x1e7e61||0x1f4;return function(_0x36d810){logger['error'](_0x36d810[_0x5029('0x22')]);if(_0x36d810[_0x5029('0x23')]){delete _0x36d810['name'];}_0x181da0[_0x5029('0x16')](_0x1e7e61)[_0x5029('0x24')](_0x36d810);};}exports[_0x5029('0x25')]=function(_0x4a24b9,_0x32da06){var _0x251f99={},_0xe5313e={},_0x4b6f92={'count':0x0,'rows':[]};var _0x2cedf6=_[_0x5029('0x26')](db['CmHopperFinal'][_0x5029('0x27')],function(_0x25032b){return{'name':_0x25032b[_0x5029('0x28')],'type':_0x25032b[_0x5029('0x29')][_0x5029('0x2a')]};});_0xe5313e[_0x5029('0x2b')]=_[_0x5029('0x26')](_0x2cedf6,_0x5029('0x23'));_0xe5313e[_0x5029('0x2c')]=_[_0x5029('0x2d')](_0x4a24b9[_0x5029('0x2c')]);_0xe5313e[_0x5029('0x2e')]=_['intersection'](_0xe5313e[_0x5029('0x2b')],_0xe5313e['query']);_0x251f99[_0x5029('0x2f')]=_['intersection'](_0xe5313e['model'],qs[_0x5029('0x30')](_0x4a24b9[_0x5029('0x2c')][_0x5029('0x30')]));_0x251f99['attributes']=_0x251f99[_0x5029('0x2f')][_0x5029('0x31')]?_0x251f99[_0x5029('0x2f')]:_0xe5313e[_0x5029('0x2b')];if(!_0x4a24b9[_0x5029('0x2c')][_0x5029('0x32')](_0x5029('0x33'))){_0x251f99[_0x5029('0x1a')]=qs[_0x5029('0x1a')](_0x4a24b9['query'][_0x5029('0x1a')]);_0x251f99[_0x5029('0x18')]=qs[_0x5029('0x18')](_0x4a24b9[_0x5029('0x2c')]['offset']);}_0x251f99[_0x5029('0x34')]=qs[_0x5029('0x35')](_0x4a24b9[_0x5029('0x2c')]['sort']);_0x251f99['where']=qs[_0x5029('0x2e')](_[_0x5029('0x36')](_0x4a24b9['query'],_0xe5313e['filters']),_0x2cedf6);if(_0x4a24b9[_0x5029('0x2c')][_0x5029('0x37')]){_0x251f99[_0x5029('0x38')]=_[_0x5029('0x39')](_0x251f99[_0x5029('0x38')],{'$or':_[_0x5029('0x26')](_0x2cedf6,function(_0x3cb84e){if(_0x3cb84e[_0x5029('0x29')]!==_0x5029('0x3a')){var _0x3effa4={};_0x3effa4[_0x3cb84e[_0x5029('0x23')]]={'$like':'%'+_0x4a24b9[_0x5029('0x2c')][_0x5029('0x37')]+'%'};return _0x3effa4;}})});}_0x251f99=_[_0x5029('0x39')]({},_0x251f99,_0x4a24b9['options']);var _0x57c2b5={'where':_0x251f99[_0x5029('0x38')]};return db[_0x5029('0x3b')][_0x5029('0x1b')](_0x57c2b5)['then'](function(_0x32d8a3){_0x4b6f92[_0x5029('0x1b')]=_0x32d8a3;if(_0x4a24b9['query'][_0x5029('0x3c')]){_0x251f99['include']=[{'all':!![]}];}return db[_0x5029('0x3b')]['findAll'](_0x251f99);})[_0x5029('0x20')](function(_0x359838){_0x4b6f92[_0x5029('0x3d')]=_0x359838;return _0x4b6f92;})[_0x5029('0x20')](respondWithFilteredResult(_0x32da06,_0x251f99))[_0x5029('0x3e')](handleError(_0x32da06,null));};exports[_0x5029('0x3f')]=function(_0x4b2219,_0x1021ea){var _0x2ae047={'raw':!![],'where':{'id':_0x4b2219[_0x5029('0x40')]['id']}},_0x5a3e4d={};_0x5a3e4d[_0x5029('0x2b')]=_[_0x5029('0x2d')](db[_0x5029('0x3b')][_0x5029('0x27')]);_0x5a3e4d[_0x5029('0x2c')]=_['keys'](_0x4b2219[_0x5029('0x2c')]);_0x5a3e4d[_0x5029('0x2e')]=_[_0x5029('0x41')](_0x5a3e4d[_0x5029('0x2b')],_0x5a3e4d[_0x5029('0x2c')]);_0x2ae047['attributes']=_[_0x5029('0x41')](_0x5a3e4d[_0x5029('0x2b')],qs[_0x5029('0x30')](_0x4b2219[_0x5029('0x2c')][_0x5029('0x30')]));_0x2ae047[_0x5029('0x2f')]=_0x2ae047[_0x5029('0x2f')][_0x5029('0x31')]?_0x2ae047[_0x5029('0x2f')]:_0x5a3e4d['model'];if(_0x4b2219[_0x5029('0x2c')][_0x5029('0x3c')]){_0x2ae047[_0x5029('0x42')]=[{'all':!![]}];}_0x2ae047=_[_0x5029('0x39')]({},_0x2ae047,_0x4b2219['options']);return db['CmHopperFinal'][_0x5029('0x43')](_0x2ae047)[_0x5029('0x20')](handleEntityNotFound(_0x1021ea,null))[_0x5029('0x20')](respondWithResult(_0x1021ea,null))[_0x5029('0x3e')](handleError(_0x1021ea,null));};exports[_0x5029('0x44')]=function(_0x3dfc08,_0x2bb7fc){return db[_0x5029('0x3b')][_0x5029('0x44')]()[_0x5029('0x20')](respondWithResult(_0x2bb7fc,null))[_0x5029('0x3e')](handleError(_0x2bb7fc,null));};exports[_0x5029('0x1f')]=function(_0x449ef5,_0x18f1f5){if(_0x449ef5[_0x5029('0x45')][_0x5029('0x46')]){delete _0x449ef5[_0x5029('0x45')][_0x5029('0x46')];}return db[_0x5029('0x3b')][_0x5029('0x43')]({'where':{'uniqueid':_0x449ef5[_0x5029('0x40')]['id']}})['then'](handleEntityNotFound(_0x18f1f5,null))[_0x5029('0x20')](saveUpdates(_0x449ef5['body'],null))[_0x5029('0x20')](respondWithResult(_0x18f1f5,null))[_0x5029('0x3e')](handleError(_0x18f1f5,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x5343c6,_0x319bff,_0x5e739d){return db['CmHopperFinal'][_0x5029('0x47')]({'raw':![],'where':{'VoiceQueueId':_0x5343c6[_0x5029('0x40')]['id']},'attributes':[[db[_0x5029('0x48')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')]('`state`\x20=\x200,\x201,\x20null'))),_0x5029('0x4a')],[db['sequelize']['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')](_0x5029('0x4c')))),_0x5029('0x4d')],[db[_0x5029('0x48')]['fn'](_0x5029('0x4b'),db[_0x5029('0x48')]['fn']('IF',db[_0x5029('0x48')]['literal'](_0x5029('0x4e')))),'busyContacts'],[db[_0x5029('0x48')]['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db[_0x5029('0x48')]['literal']('`state`\x20=\x208,\x201,\x20null'))),'congestionContacts'],[db[_0x5029('0x48')]['fn']('COUNT',db[_0x5029('0x48')]['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x5029('0x4f')],[db['sequelize']['fn']('COUNT',db[_0x5029('0x48')]['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')](_0x5029('0x50')))),_0x5029('0x51')],[db['sequelize']['fn'](_0x5029('0x4b'),db[_0x5029('0x48')]['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')]('`state`\x20=\x2022,\x201,\x20null'))),_0x5029('0x52')],[db[_0x5029('0x48')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')](_0x5029('0x53')))),_0x5029('0x54')]]})['then'](handleEntityNotFound(_0x319bff,null))[_0x5029('0x20')](respondWithResult(_0x319bff,null))[_0x5029('0x3e')](handleError(_0x319bff,null));};exports[_0x5029('0x55')]=function(_0x2aebb3,_0x3a82f7,_0x26f56f){return db['CmHopperFinal']['findAll']({'raw':![],'where':{'CampaignId':_0x2aebb3[_0x5029('0x40')]['id']},'attributes':[[db[_0x5029('0x48')]['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')](_0x5029('0x56')))),_0x5029('0x4a')],[db[_0x5029('0x48')]['fn']('COUNT',db[_0x5029('0x48')]['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')]('`state`\x20=\x203,\x201,\x20null'))),_0x5029('0x4d')],[db['sequelize']['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')](_0x5029('0x4e')))),_0x5029('0x57')],[db[_0x5029('0x48')]['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')](_0x5029('0x58')))),_0x5029('0x59')],[db[_0x5029('0x48')]['fn']('COUNT',db[_0x5029('0x48')]['fn']('IF',db['sequelize'][_0x5029('0x49')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x5029('0x4f')],[db['sequelize']['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db['sequelize'][_0x5029('0x49')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x5029('0x51')],[db[_0x5029('0x48')]['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db[_0x5029('0x48')]['literal'](_0x5029('0x5a')))),_0x5029('0x52')],[db[_0x5029('0x48')]['fn'](_0x5029('0x4b'),db[_0x5029('0x48')]['fn']('IF',db['sequelize'][_0x5029('0x49')](_0x5029('0x53')))),'answeringMachine']]})[_0x5029('0x20')](handleEntityNotFound(_0x3a82f7,null))[_0x5029('0x20')](respondWithResult(_0x3a82f7,null))[_0x5029('0x3e')](handleError(_0x3a82f7,null));};exports[_0x5029('0x5b')]=function(_0x9b1c13,_0x1bd1c6,_0x5bd84e){return db['VoiceQueue'][_0x5029('0x43')]({'where':{'id':_0x9b1c13['params']['id']}})[_0x5029('0x20')](handleEntityNotFound(_0x1bd1c6,null))[_0x5029('0x20')](function(_0x58db57){var _0x181956;if(_0x58db57){_0x181956=squel['insert']()['into'](_0x5029('0x5c'))[_0x5029('0x5d')]([_0x5029('0x5e'),_0x5029('0x5f'),'ContactId',_0x5029('0x60'),_0x5029('0x61'),'createdAt',_0x5029('0x62')],squel[_0x5029('0x63')]()['field']('ANY_VALUE(calleridnum)','phone')[_0x5029('0x64')](_0x5029('0x65'),_0x5029('0x5f'))[_0x5029('0x64')](_0x5029('0x66'),_0x5029('0x67'))[_0x5029('0x64')](_0x5029('0x68'),_0x5029('0x60'))['field']('ANY_VALUE(VoiceQueueId)',_0x5029('0x61'))[_0x5029('0x64')](_0x5029('0x65'),_0x5029('0x69'))[_0x5029('0x64')](_0x5029('0x65'),_0x5029('0x62'))['from'](_0x5029('0x6a'))[_0x5029('0x38')](_0x5029('0x6b'),_0x9b1c13['params']['id'][_0x5029('0x6c')]())[_0x5029('0x38')](_0x5029('0x6d'),_0x9b1c13['body'][_0x5029('0x6e')][_0x5029('0x6c')]())[_0x5029('0x38')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x5029('0x38')](_0x5029('0x6f'),squel['select']()[_0x5029('0x64')](_0x5029('0x5e'))[_0x5029('0x70')](_0x5029('0x5c'))[_0x5029('0x38')]('VoiceQueueId\x20=\x20?',_0x9b1c13[_0x5029('0x40')]['id'][_0x5029('0x6c')]()))[_0x5029('0x38')](_0x5029('0x6f'),squel[_0x5029('0x63')]()['field'](_0x5029('0x71'))[_0x5029('0x70')](_0x5029('0x6a'))['where'](_0x5029('0x6b'),_0x9b1c13[_0x5029('0x40')]['id'][_0x5029('0x6c')]())[_0x5029('0x38')](_0x5029('0x72')))[_0x5029('0x73')](_0x5029('0x67')))['toString']();return db[_0x5029('0x48')][_0x5029('0x2c')](_0x181956);}return[];})[_0x5029('0x20')](respondWithResult(_0x1bd1c6,null))[_0x5029('0x3e')](handleError(_0x1bd1c6,null));};exports[_0x5029('0x74')]=function(_0x4c40d1,_0x209c83,_0x443070){return db[_0x5029('0x75')]['find']({'where':{'id':_0x4c40d1[_0x5029('0x40')]['id']}})[_0x5029('0x20')](handleEntityNotFound(_0x209c83,null))['then'](function(_0x5c8bd4){var _0x524825;if(_0x5c8bd4){_0x524825=squel[_0x5029('0x76')]()[_0x5029('0x77')](_0x5029('0x5c'))[_0x5029('0x5d')]([_0x5029('0x5e'),'scheduledAt',_0x5029('0x67'),_0x5029('0x60'),_0x5029('0x78'),'createdAt','updatedAt'],squel[_0x5029('0x63')]()[_0x5029('0x64')](_0x5029('0x79'),_0x5029('0x5e'))['field'](_0x5029('0x65'),_0x5029('0x5f'))[_0x5029('0x64')](_0x5029('0x66'),_0x5029('0x67'))[_0x5029('0x64')](_0x5029('0x68'),_0x5029('0x60'))['field'](_0x5029('0x7a'),'CampaignId')['field'](_0x5029('0x65'),'createdAt')[_0x5029('0x64')](_0x5029('0x65'),_0x5029('0x62'))[_0x5029('0x70')](_0x5029('0x6a'))[_0x5029('0x38')](_0x5029('0x7b'),_0x4c40d1[_0x5029('0x40')]['id']['toString']())['where'](_0x5029('0x6d'),_0x4c40d1['body']['state'][_0x5029('0x6c')]())['where']('calleridnum\x20IS\x20NOT\x20NULL')[_0x5029('0x38')](_0x5029('0x6f'),squel[_0x5029('0x63')]()[_0x5029('0x64')](_0x5029('0x5e'))['from'](_0x5029('0x5c'))[_0x5029('0x38')](_0x5029('0x7b'),_0x4c40d1['params']['id'][_0x5029('0x6c')]()))[_0x5029('0x38')](_0x5029('0x6f'),squel[_0x5029('0x63')]()[_0x5029('0x64')]('calleridnum')['from'](_0x5029('0x6a'))[_0x5029('0x38')]('CampaignId\x20=\x20?',_0x4c40d1[_0x5029('0x40')]['id'][_0x5029('0x6c')]())[_0x5029('0x38')](_0x5029('0x72')))[_0x5029('0x73')](_0x5029('0x67')))[_0x5029('0x6c')]();return db[_0x5029('0x48')]['query'](_0x524825);}return[];})['then'](respondWithResult(_0x209c83,null))[_0x5029('0x3e')](handleError(_0x209c83,null));};exports['checkContactHopper']=function(_0x20a259,_0x5e5f88,_0x36fdce){return db[_0x5029('0x7c')][_0x5029('0x7d')]({'where':{'VoiceQueueId':_0x20a259['body'][_0x5029('0x61')],'CampaignId':_0x20a259[_0x5029('0x45')][_0x5029('0x78')],'ContactId':_0x20a259['body'][_0x5029('0x67')]}})[_0x5029('0x20')](handleEntityNotFound(_0x5e5f88,null))[_0x5029('0x20')](function(_0x4421bd){if(_0x4421bd){return _0x4421bd;}return null;})[_0x5029('0x20')](respondWithResult(_0x5e5f88,null))[_0x5029('0x3e')](handleError(_0x5e5f88,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 4e41db6..900dc4c 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 _0xbebe=['cm_hopper_final','calleridnum','uniqueid','moment','bluebird','request-promise','path','rimraf','./cmHopperFinal.attributes','exports','CmHopperFinal'];(function(_0x27f9d8,_0x177bfc){var _0xdc93=function(_0x3de2c4){while(--_0x3de2c4){_0x27f9d8['push'](_0x27f9d8['shift']());}};_0xdc93(++_0x177bfc);}(_0xbebe,0x184));var _0xebeb=function(_0x34a77c,_0x3021a3){_0x34a77c=_0x34a77c-0x0;var _0x31bb71=_0xbebe[_0x34a77c];return _0x31bb71;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xebeb('0x0'));var BPromise=require(_0xebeb('0x1'));var rp=require(_0xebeb('0x2'));var fs=require('fs');var path=require(_0xebeb('0x3'));var rimraf=require(_0xebeb('0x4'));var config=require('../../config/environment');var attributes=require(_0xebeb('0x5'));module[_0xebeb('0x6')]=function(_0xc993a9,_0x1f7ba2){return _0xc993a9['define'](_0xebeb('0x7'),attributes,{'tableName':_0xebeb('0x8'),'paranoid':![],'indexes':[{'name':_0xebeb('0x9'),'fields':['calleridnum']},{'name':_0xebeb('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x5953=['cm_hopper_final','calleridnum','uniqueid','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','define'];(function(_0x4afe00,_0x279ebd){var _0x137693=function(_0x346959){while(--_0x346959){_0x4afe00['push'](_0x4afe00['shift']());}};_0x137693(++_0x279ebd);}(_0x5953,0x7b));var _0x3595=function(_0x50b86,_0x190c6b){_0x50b86=_0x50b86-0x0;var _0x1773ed=_0x5953[_0x50b86];return _0x1773ed;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3595('0x0'))('api');var moment=require(_0x3595('0x1'));var BPromise=require(_0x3595('0x2'));var rp=require(_0x3595('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3595('0x4'));var config=require(_0x3595('0x5'));var attributes=require(_0x3595('0x6'));module[_0x3595('0x7')]=function(_0x2995b7,_0x2d7d45){return _0x2995b7[_0x3595('0x8')]('CmHopperFinal',attributes,{'tableName':_0x3595('0x9'),'paranoid':![],'indexes':[{'name':_0x3595('0xa'),'fields':[_0x3595('0xa')]},{'name':_0x3595('0xb'),'fields':[_0x3595('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 55f5c94..ffb8b33 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(_0x3861a3,_0x3063ad){var _0x4701d9=function(_0xcd7c11){while(--_0xcd7c11){_0x3861a3['push'](_0x3861a3['shift']());}};_0x4701d9(++_0x3063ad);}(_0x7a54,0x106));var _0x47a5=function(_0x310281,_0x46ac50){_0x310281=_0x310281-0x0;var _0x4dafad=_0x7a54[_0x310281];return _0x4dafad;};'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 _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x51bdad,_0x46f130){var _0x385898=function(_0x54ff30){while(--_0x54ff30){_0x51bdad['push'](_0x51bdad['shift']());}};_0x385898(++_0x46f130);}(_0xb10b,0x12a));var _0xbb10=function(_0x4fa892,_0x4e66a0){_0x4fa892=_0x4fa892-0x0;var _0x260ef6=_0xb10b[_0x4fa892];return _0x260ef6;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index 7cf0984..54ef6b5 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 _0xfaa3=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','/describe','isAuthenticated','describe','/:id','show','countContactsIvrCampaignHopperFinal','post','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','update','exports','multer'];(function(_0x38321f,_0x480990){var _0x237592=function(_0x3ff7e0){while(--_0x3ff7e0){_0x38321f['push'](_0x38321f['shift']());}};_0x237592(++_0x480990);}(_0xfaa3,0x137));var _0x3faa=function(_0x24d503,_0x515509){_0x24d503=_0x24d503-0x0;var _0x4fd82c=_0xfaa3[_0x24d503];return _0x4fd82c;};'use strict';var multer=require(_0x3faa('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3faa('0x1'));var express=require(_0x3faa('0x2'));var router=express[_0x3faa('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3faa('0x4'));var interaction=require(_0x3faa('0x5'));var config=require(_0x3faa('0x6'));var controller=require(_0x3faa('0x7'));router[_0x3faa('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x3faa('0x8')](_0x3faa('0x9'),auth[_0x3faa('0xa')](),controller[_0x3faa('0xb')]);router[_0x3faa('0x8')](_0x3faa('0xc'),auth[_0x3faa('0xa')](),controller[_0x3faa('0xd')]);router[_0x3faa('0x8')]('/voice/queue/countAttributes/:id',auth['isAuthenticated'](),controller['countContactsQueueCampaignHopperFinal']);router['get']('/campaign/countAttributes/:id',auth[_0x3faa('0xa')](),controller[_0x3faa('0xe')]);router[_0x3faa('0xf')]('/voice/queue/moveContacts/:id',auth[_0x3faa('0xa')](),controller[_0x3faa('0x10')]);router[_0x3faa('0xf')](_0x3faa('0x11'),auth[_0x3faa('0xa')](),controller[_0x3faa('0x12')]);router[_0x3faa('0xf')](_0x3faa('0x13'),auth[_0x3faa('0xa')](),controller[_0x3faa('0x14')]);router[_0x3faa('0x15')](_0x3faa('0xc'),auth[_0x3faa('0xa')](),controller[_0x3faa('0x16')]);module[_0x3faa('0x17')]=router; \ No newline at end of file +var _0x6635=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','/describe','describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','exports','path'];(function(_0x22bae4,_0x22474b){var _0x2047b6=function(_0x849589){while(--_0x849589){_0x22bae4['push'](_0x22bae4['shift']());}};_0x2047b6(++_0x22474b);}(_0x6635,0x10d));var _0x5663=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x6635[_0x3e5086];return _0xfeb102;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5663('0x0'));var timeout=require(_0x5663('0x1'));var express=require(_0x5663('0x2'));var router=express[_0x5663('0x3')]();var fs_extra=require(_0x5663('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5663('0x5'));var config=require(_0x5663('0x6'));var controller=require(_0x5663('0x7'));router[_0x5663('0x8')]('/',auth[_0x5663('0x9')](),controller['index']);router[_0x5663('0x8')](_0x5663('0xa'),auth[_0x5663('0x9')](),controller[_0x5663('0xb')]);router[_0x5663('0x8')](_0x5663('0xc'),auth[_0x5663('0x9')](),controller[_0x5663('0xd')]);router[_0x5663('0x8')](_0x5663('0xe'),auth['isAuthenticated'](),controller[_0x5663('0xf')]);router[_0x5663('0x8')](_0x5663('0x10'),auth[_0x5663('0x9')](),controller[_0x5663('0x11')]);router[_0x5663('0x12')](_0x5663('0x13'),auth[_0x5663('0x9')](),controller[_0x5663('0x14')]);router[_0x5663('0x12')](_0x5663('0x15'),auth[_0x5663('0x9')](),controller[_0x5663('0x16')]);router[_0x5663('0x12')](_0x5663('0x17'),auth[_0x5663('0x9')](),controller[_0x5663('0x18')]);router[_0x5663('0x19')]('/:id',auth[_0x5663('0x9')](),controller['update']);module[_0x5663('0x1a')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index a19823e..3db18f5 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 _0xeff1=['STRING','DATE','BOOLEAN','sequelize','exports','INTEGER'];(function(_0x4eea3a,_0x2d86a2){var _0x275b27=function(_0x214855){while(--_0x214855){_0x4eea3a['push'](_0x4eea3a['shift']());}};_0x275b27(++_0x2d86a2);}(_0xeff1,0x165));var _0x1eff=function(_0x1ebeea,_0x2f54f4){_0x1ebeea=_0x1ebeea-0x0;var _0x576465=_0xeff1[_0x1ebeea];return _0x576465;};'use strict';var Sequelize=require(_0x1eff('0x0'));module[_0x1eff('0x1')]={'state':{'type':Sequelize[_0x1eff('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x1eff('0x3')]},'scheduledat':{'type':Sequelize[_0x1eff('0x4')]},'countbusyretry':{'type':Sequelize[_0x1eff('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x1eff('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x1eff('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x1eff('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x1eff('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x1eff('0x3')]},'originatecalleridname':{'type':Sequelize[_0x1eff('0x3')]},'calleridnum':{'type':Sequelize[_0x1eff('0x3')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x1eff('0x4')]},'responsetime':{'type':Sequelize[_0x1eff('0x4')]},'answertime':{'type':Sequelize[_0x1eff('0x4')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x1eff('0x4')]},'ringtime':{'type':Sequelize[_0x1eff('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x1eff('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x1eff('0x3')]},'amd':{'type':Sequelize[_0x1eff('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x1eff('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x1eff('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x1eff('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x1eff('0x4')]},'recallme':{'type':Sequelize[_0x1eff('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x1eff('0x4')]},'edited':{'type':Sequelize[_0x1eff('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x1eff('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x1eff('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x1eff('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x1eff('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x1eff('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x769b=['BOOLEAN','sequelize','exports','INTEGER','STRING','DATE'];(function(_0x1a84b1,_0x3ca6d8){var _0x161938=function(_0x44e888){while(--_0x44e888){_0x1a84b1['push'](_0x1a84b1['shift']());}};_0x161938(++_0x3ca6d8);}(_0x769b,0x1ed));var _0xb769=function(_0x24b492,_0x463da0){_0x24b492=_0x24b492-0x0;var _0x9b39ad=_0x769b[_0x24b492];return _0x9b39ad;};'use strict';var Sequelize=require(_0xb769('0x0'));module[_0xb769('0x1')]={'state':{'type':Sequelize[_0xb769('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0xb769('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xb769('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xb769('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xb769('0x3')]},'originatecalleridnum':{'type':Sequelize[_0xb769('0x3')]},'originatecalleridname':{'type':Sequelize[_0xb769('0x3')]},'calleridnum':{'type':Sequelize[_0xb769('0x3')]},'calleridname':{'type':Sequelize[_0xb769('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xb769('0x4')]},'answertime':{'type':Sequelize[_0xb769('0x4')]},'droptime':{'type':Sequelize[_0xb769('0x4')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xb769('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xb769('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xb769('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xb769('0x3')]},'campaign':{'type':Sequelize[_0xb769('0x3')]},'campaigntype':{'type':Sequelize[_0xb769('0x3')]},'membername':{'type':Sequelize[_0xb769('0x3')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0xb769('0x5')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0xb769('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xb769('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize[_0xb769('0x4')]},'edited':{'type':Sequelize[_0xb769('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xb769('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xb769('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xb769('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xb769('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 86797b8..d178b38 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 _0xfc0e=['merge','catch','create','body','describe','update','uniqueid','find','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','limit','count','offset','Content-Range','reject','save','then','destroy','end','error','stack','name','send','index','CmHopperHistory','rawAttributes','fieldName','type','keys','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','map','VIRTUAL','options','includeAll','include','show','params'];(function(_0x5eed63,_0x433df4){var _0x529db8=function(_0x8369aa){while(--_0x8369aa){_0x5eed63['push'](_0x5eed63['shift']());}};_0x529db8(++_0x433df4);}(_0xfc0e,0x11c));var _0xefc0=function(_0x9c2427,_0x17c865){_0x9c2427=_0x9c2427-0x0;var _0x51984f=_0xfc0e[_0x9c2427];return _0x51984f;};'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('moment');var BPromise=require('bluebird');var Mustache=require(_0xefc0('0x0'));var util=require(_0xefc0('0x1'));var path=require(_0xefc0('0x2'));var sox=require(_0xefc0('0x3'));var csv=require(_0xefc0('0x4'));var ejs=require(_0xefc0('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xefc0('0x6'));var squel=require(_0xefc0('0x7'));var crypto=require('crypto');var jsforce=require(_0xefc0('0x8'));var deskjs=require('desk.js');var toCsv=require(_0xefc0('0x4'));var querystring=require(_0xefc0('0x9'));var Papa=require(_0xefc0('0xa'));var Redis=require(_0xefc0('0xb'));var authService=require('../../components/auth/service');var qs=require(_0xefc0('0xc'));var as=require(_0xefc0('0xd'));var hardwareService=require(_0xefc0('0xe'));var logger=require('../../config/logger')(_0xefc0('0xf'));var utils=require('../../config/utils');var config=require(_0xefc0('0x10'));var licenseUtil=require(_0xefc0('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x553fb8,_0x19b45e){_0x19b45e=_0x19b45e||0xcc;return function(_0x56df99){if(_0x56df99){return _0x553fb8[_0xefc0('0x12')](_0x19b45e);}return _0x553fb8[_0xefc0('0x13')](_0x19b45e)['end']();};}function respondWithResult(_0x37f043,_0x390d2a){_0x390d2a=_0x390d2a||0xc8;return function(_0x8adc08){if(_0x8adc08){return _0x37f043[_0xefc0('0x13')](_0x390d2a)[_0xefc0('0x14')](_0x8adc08);}};}function respondWithFilteredResult(_0xcecb93,_0x4ef602){return function(_0x1fa1d6){if(_0x1fa1d6){var _0x5e5fe8=typeof _0x4ef602['offset']===_0xefc0('0x15')&&typeof _0x4ef602[_0xefc0('0x16')]===_0xefc0('0x15');var _0xc73832=_0x1fa1d6[_0xefc0('0x17')];var _0x4bec03=_0x5e5fe8?0x0:_0x4ef602[_0xefc0('0x18')];var _0x5df1cf=_0x5e5fe8?_0x1fa1d6[_0xefc0('0x17')]:_0x4ef602[_0xefc0('0x18')]+_0x4ef602[_0xefc0('0x16')];var _0x62433e;if(_0x5df1cf>=_0xc73832){_0x5df1cf=_0xc73832;_0x62433e=0xc8;}else{_0x62433e=0xce;}_0xcecb93[_0xefc0('0x13')](_0x62433e);return _0xcecb93['set'](_0xefc0('0x19'),_0x4bec03+'-'+_0x5df1cf+'/'+_0xc73832)[_0xefc0('0x14')](_0x1fa1d6);}return null;};}function patchUpdates(_0x34d342){return function(_0x53e25c){try{jsonpatch['apply'](_0x53e25c,_0x34d342,!![]);}catch(_0x4d88d1){return BPromise[_0xefc0('0x1a')](_0x4d88d1);}return _0x53e25c[_0xefc0('0x1b')]();};}function saveUpdates(_0x2b3657,_0x78f49b){return function(_0x3dc7c5){if(_0x3dc7c5){return _0x3dc7c5['update'](_0x2b3657)[_0xefc0('0x1c')](function(_0x2c220e){return _0x2c220e;});}return null;};}function removeEntity(_0xb2a004,_0x2f01e9){return function(_0x2b5c06){if(_0x2b5c06){return _0x2b5c06[_0xefc0('0x1d')]()[_0xefc0('0x1c')](function(){_0xb2a004[_0xefc0('0x13')](0xcc)[_0xefc0('0x1e')]();});}};}function handleEntityNotFound(_0x3f477b,_0x39f11f){return function(_0x42d905){if(!_0x42d905){_0x3f477b['sendStatus'](0x194);}return _0x42d905;};}function handleError(_0x1487a4,_0x310341){_0x310341=_0x310341||0x1f4;return function(_0x16cfc0){logger[_0xefc0('0x1f')](_0x16cfc0[_0xefc0('0x20')]);if(_0x16cfc0['name']){delete _0x16cfc0[_0xefc0('0x21')];}_0x1487a4[_0xefc0('0x13')](_0x310341)[_0xefc0('0x22')](_0x16cfc0);};}exports[_0xefc0('0x23')]=function(_0x4af6c8,_0x566a14){var _0x5c8683={},_0xbdb27e={},_0x2b10a3={'count':0x0,'rows':[]};var _0x466704=_['map'](db[_0xefc0('0x24')][_0xefc0('0x25')],function(_0x17662f){return{'name':_0x17662f[_0xefc0('0x26')],'type':_0x17662f[_0xefc0('0x27')]['key']};});_0xbdb27e['model']=_['map'](_0x466704,_0xefc0('0x21'));_0xbdb27e['query']=_[_0xefc0('0x28')](_0x4af6c8[_0xefc0('0x29')]);_0xbdb27e['filters']=_['intersection'](_0xbdb27e['model'],_0xbdb27e[_0xefc0('0x29')]);_0x5c8683['attributes']=_[_0xefc0('0x2a')](_0xbdb27e[_0xefc0('0x2b')],qs[_0xefc0('0x2c')](_0x4af6c8[_0xefc0('0x29')][_0xefc0('0x2c')]));_0x5c8683['attributes']=_0x5c8683[_0xefc0('0x2d')][_0xefc0('0x2e')]?_0x5c8683[_0xefc0('0x2d')]:_0xbdb27e[_0xefc0('0x2b')];if(!_0x4af6c8[_0xefc0('0x29')][_0xefc0('0x2f')](_0xefc0('0x30'))){_0x5c8683[_0xefc0('0x16')]=qs[_0xefc0('0x16')](_0x4af6c8[_0xefc0('0x29')]['limit']);_0x5c8683[_0xefc0('0x18')]=qs[_0xefc0('0x18')](_0x4af6c8[_0xefc0('0x29')]['offset']);}_0x5c8683['order']=qs[_0xefc0('0x31')](_0x4af6c8[_0xefc0('0x29')][_0xefc0('0x31')]);_0x5c8683[_0xefc0('0x32')]=qs[_0xefc0('0x33')](_[_0xefc0('0x34')](_0x4af6c8['query'],_0xbdb27e['filters']),_0x466704);if(_0x4af6c8[_0xefc0('0x29')][_0xefc0('0x35')]){_0x5c8683[_0xefc0('0x32')]=_['merge'](_0x5c8683[_0xefc0('0x32')],{'$or':_[_0xefc0('0x36')](_0x466704,function(_0x306159){if(_0x306159['type']!==_0xefc0('0x37')){var _0x124a04={};_0x124a04[_0x306159[_0xefc0('0x21')]]={'$like':'%'+_0x4af6c8[_0xefc0('0x29')][_0xefc0('0x35')]+'%'};return _0x124a04;}})});}_0x5c8683=_['merge']({},_0x5c8683,_0x4af6c8[_0xefc0('0x38')]);var _0x348c12={'where':_0x5c8683[_0xefc0('0x32')]};return db[_0xefc0('0x24')][_0xefc0('0x17')](_0x348c12)[_0xefc0('0x1c')](function(_0x19ebdc){_0x2b10a3['count']=_0x19ebdc;if(_0x4af6c8[_0xefc0('0x29')][_0xefc0('0x39')]){_0x5c8683[_0xefc0('0x3a')]=[{'all':!![]}];}return db[_0xefc0('0x24')]['findAll'](_0x5c8683);})['then'](function(_0x364fdf){_0x2b10a3['rows']=_0x364fdf;return _0x2b10a3;})[_0xefc0('0x1c')](respondWithFilteredResult(_0x566a14,_0x5c8683))['catch'](handleError(_0x566a14,null));};exports[_0xefc0('0x3b')]=function(_0x1e4154,_0x2df1ce){var _0x50ede5={'raw':!![],'where':{'id':_0x1e4154[_0xefc0('0x3c')]['id']}},_0x41ac16={};_0x41ac16[_0xefc0('0x2b')]=_[_0xefc0('0x28')](db[_0xefc0('0x24')][_0xefc0('0x25')]);_0x41ac16[_0xefc0('0x29')]=_['keys'](_0x1e4154[_0xefc0('0x29')]);_0x41ac16[_0xefc0('0x33')]=_[_0xefc0('0x2a')](_0x41ac16[_0xefc0('0x2b')],_0x41ac16[_0xefc0('0x29')]);_0x50ede5[_0xefc0('0x2d')]=_[_0xefc0('0x2a')](_0x41ac16['model'],qs['fields'](_0x1e4154['query']['fields']));_0x50ede5[_0xefc0('0x2d')]=_0x50ede5[_0xefc0('0x2d')][_0xefc0('0x2e')]?_0x50ede5[_0xefc0('0x2d')]:_0x41ac16[_0xefc0('0x2b')];if(_0x1e4154['query'][_0xefc0('0x39')]){_0x50ede5[_0xefc0('0x3a')]=[{'all':!![]}];}_0x50ede5=_[_0xefc0('0x3d')]({},_0x50ede5,_0x1e4154[_0xefc0('0x38')]);return db[_0xefc0('0x24')]['find'](_0x50ede5)[_0xefc0('0x1c')](handleEntityNotFound(_0x2df1ce,null))[_0xefc0('0x1c')](respondWithResult(_0x2df1ce,null))[_0xefc0('0x3e')](handleError(_0x2df1ce,null));};exports[_0xefc0('0x3f')]=function(_0x35291a,_0x4762cd){return db['CmHopperHistory'][_0xefc0('0x3f')](_0x35291a[_0xefc0('0x40')],{})[_0xefc0('0x1c')](respondWithResult(_0x4762cd,0xc9))[_0xefc0('0x3e')](handleError(_0x4762cd,null));};exports[_0xefc0('0x41')]=function(_0x6d29e,_0x100632){return db['CmHopperHistory'][_0xefc0('0x41')]()[_0xefc0('0x1c')](respondWithResult(_0x100632,null))[_0xefc0('0x3e')](handleError(_0x100632,null));};exports[_0xefc0('0x42')]=function(_0x497ece,_0x344c3b){if(_0x497ece[_0xefc0('0x40')][_0xefc0('0x43')]){delete _0x497ece[_0xefc0('0x40')]['uniqueid'];}return db[_0xefc0('0x24')][_0xefc0('0x44')]({'where':{'uniqueid':_0x497ece[_0xefc0('0x3c')]['id']}})[_0xefc0('0x1c')](handleEntityNotFound(_0x344c3b,null))['then'](saveUpdates(_0x497ece[_0xefc0('0x40')],null))[_0xefc0('0x1c')](respondWithResult(_0x344c3b,null))['catch'](handleError(_0x344c3b,null));}; \ No newline at end of file +var _0x8cc9=['moment','bluebird','util','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','index','map','CmHopperHistory','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','sort','pick','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','find','create','body','describe','uniqueid','eml-format','zip-dir'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x8cc9,0x1ae));var _0x98cc=function(_0x4c1009,_0x4e37fe){_0x4c1009=_0x4c1009-0x0;var _0x294e84=_0x8cc9[_0x4c1009];return _0x294e84;};'use strict';var emlformat=require(_0x98cc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x98cc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x98cc('0x2'));var BPromise=require(_0x98cc('0x3'));var Mustache=require('mustache');var util=require(_0x98cc('0x4'));var path=require('path');var sox=require(_0x98cc('0x5'));var csv=require(_0x98cc('0x6'));var ejs=require(_0x98cc('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x98cc('0x8'));var jsforce=require(_0x98cc('0x9'));var deskjs=require(_0x98cc('0xa'));var toCsv=require(_0x98cc('0x6'));var querystring=require(_0x98cc('0xb'));var Papa=require(_0x98cc('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x98cc('0xd'));var as=require(_0x98cc('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x98cc('0xf'))('api');var utils=require(_0x98cc('0x10'));var config=require(_0x98cc('0x11'));var licenseUtil=require(_0x98cc('0x12'));var db=require(_0x98cc('0x13'))['db'];function respondWithStatusCode(_0x1ea321,_0x4f56fc){_0x4f56fc=_0x4f56fc||0xcc;return function(_0x1a1e66){if(_0x1a1e66){return _0x1ea321[_0x98cc('0x14')](_0x4f56fc);}return _0x1ea321[_0x98cc('0x15')](_0x4f56fc)['end']();};}function respondWithResult(_0x4f387b,_0x42b438){_0x42b438=_0x42b438||0xc8;return function(_0x595c1e){if(_0x595c1e){return _0x4f387b['status'](_0x42b438)[_0x98cc('0x16')](_0x595c1e);}};}function respondWithFilteredResult(_0x58e938,_0x37bdc9){return function(_0x25e67b){if(_0x25e67b){var _0x28f6c2=typeof _0x37bdc9[_0x98cc('0x17')]===_0x98cc('0x18')&&typeof _0x37bdc9['limit']===_0x98cc('0x18');var _0x507f4a=_0x25e67b[_0x98cc('0x19')];var _0x11c21b=_0x28f6c2?0x0:_0x37bdc9[_0x98cc('0x17')];var _0x1a4e99=_0x28f6c2?_0x25e67b[_0x98cc('0x19')]:_0x37bdc9[_0x98cc('0x17')]+_0x37bdc9[_0x98cc('0x1a')];var _0x27e5be;if(_0x1a4e99>=_0x507f4a){_0x1a4e99=_0x507f4a;_0x27e5be=0xc8;}else{_0x27e5be=0xce;}_0x58e938[_0x98cc('0x15')](_0x27e5be);return _0x58e938[_0x98cc('0x1b')](_0x98cc('0x1c'),_0x11c21b+'-'+_0x1a4e99+'/'+_0x507f4a)['json'](_0x25e67b);}return null;};}function patchUpdates(_0x1516ea){return function(_0x2352f2){try{jsonpatch[_0x98cc('0x1d')](_0x2352f2,_0x1516ea,!![]);}catch(_0x31081d){return BPromise[_0x98cc('0x1e')](_0x31081d);}return _0x2352f2[_0x98cc('0x1f')]();};}function saveUpdates(_0x4e5c47,_0x493ff1){return function(_0x94ebfe){if(_0x94ebfe){return _0x94ebfe[_0x98cc('0x20')](_0x4e5c47)[_0x98cc('0x21')](function(_0x979087){return _0x979087;});}return null;};}function removeEntity(_0x23e43c,_0x417622){return function(_0x57d0c9){if(_0x57d0c9){return _0x57d0c9[_0x98cc('0x22')]()[_0x98cc('0x21')](function(){_0x23e43c['status'](0xcc)[_0x98cc('0x23')]();});}};}function handleEntityNotFound(_0x1672ef,_0xb70334){return function(_0x54739a){if(!_0x54739a){_0x1672ef[_0x98cc('0x14')](0x194);}return _0x54739a;};}function handleError(_0x47e63f,_0x5bfe33){_0x5bfe33=_0x5bfe33||0x1f4;return function(_0x37a03a){logger[_0x98cc('0x24')](_0x37a03a[_0x98cc('0x25')]);if(_0x37a03a[_0x98cc('0x26')]){delete _0x37a03a['name'];}_0x47e63f[_0x98cc('0x15')](_0x5bfe33)['send'](_0x37a03a);};}exports[_0x98cc('0x27')]=function(_0xd74291,_0x307c01){var _0x470cf1={},_0x6fb5d3={},_0x119477={'count':0x0,'rows':[]};var _0x398d8d=_[_0x98cc('0x28')](db[_0x98cc('0x29')][_0x98cc('0x2a')],function(_0x28ecde){return{'name':_0x28ecde[_0x98cc('0x2b')],'type':_0x28ecde[_0x98cc('0x2c')][_0x98cc('0x2d')]};});_0x6fb5d3[_0x98cc('0x2e')]=_['map'](_0x398d8d,_0x98cc('0x26'));_0x6fb5d3[_0x98cc('0x2f')]=_['keys'](_0xd74291[_0x98cc('0x2f')]);_0x6fb5d3[_0x98cc('0x30')]=_[_0x98cc('0x31')](_0x6fb5d3['model'],_0x6fb5d3[_0x98cc('0x2f')]);_0x470cf1[_0x98cc('0x32')]=_[_0x98cc('0x31')](_0x6fb5d3['model'],qs[_0x98cc('0x33')](_0xd74291[_0x98cc('0x2f')][_0x98cc('0x33')]));_0x470cf1[_0x98cc('0x32')]=_0x470cf1[_0x98cc('0x32')][_0x98cc('0x34')]?_0x470cf1['attributes']:_0x6fb5d3['model'];if(!_0xd74291['query']['hasOwnProperty'](_0x98cc('0x35'))){_0x470cf1[_0x98cc('0x1a')]=qs['limit'](_0xd74291['query'][_0x98cc('0x1a')]);_0x470cf1[_0x98cc('0x17')]=qs[_0x98cc('0x17')](_0xd74291[_0x98cc('0x2f')]['offset']);}_0x470cf1['order']=qs[_0x98cc('0x36')](_0xd74291[_0x98cc('0x2f')][_0x98cc('0x36')]);_0x470cf1['where']=qs[_0x98cc('0x30')](_[_0x98cc('0x37')](_0xd74291[_0x98cc('0x2f')],_0x6fb5d3[_0x98cc('0x30')]),_0x398d8d);if(_0xd74291[_0x98cc('0x2f')]['filter']){_0x470cf1[_0x98cc('0x38')]=_[_0x98cc('0x39')](_0x470cf1[_0x98cc('0x38')],{'$or':_['map'](_0x398d8d,function(_0x1602bd){if(_0x1602bd[_0x98cc('0x2c')]!==_0x98cc('0x3a')){var _0x568c5a={};_0x568c5a[_0x1602bd['name']]={'$like':'%'+_0xd74291[_0x98cc('0x2f')]['filter']+'%'};return _0x568c5a;}})});}_0x470cf1=_[_0x98cc('0x39')]({},_0x470cf1,_0xd74291[_0x98cc('0x3b')]);var _0x1ba378={'where':_0x470cf1[_0x98cc('0x38')]};return db[_0x98cc('0x29')]['count'](_0x1ba378)['then'](function(_0x4bb2be){_0x119477[_0x98cc('0x19')]=_0x4bb2be;if(_0xd74291[_0x98cc('0x2f')][_0x98cc('0x3c')]){_0x470cf1[_0x98cc('0x3d')]=[{'all':!![]}];}return db[_0x98cc('0x29')][_0x98cc('0x3e')](_0x470cf1);})[_0x98cc('0x21')](function(_0x46cb84){_0x119477['rows']=_0x46cb84;return _0x119477;})['then'](respondWithFilteredResult(_0x307c01,_0x470cf1))[_0x98cc('0x3f')](handleError(_0x307c01,null));};exports[_0x98cc('0x40')]=function(_0xf54424,_0x5a64c6){var _0x50b4e6={'raw':!![],'where':{'id':_0xf54424[_0x98cc('0x41')]['id']}},_0x31c25b={};_0x31c25b[_0x98cc('0x2e')]=_[_0x98cc('0x42')](db[_0x98cc('0x29')][_0x98cc('0x2a')]);_0x31c25b[_0x98cc('0x2f')]=_[_0x98cc('0x42')](_0xf54424['query']);_0x31c25b[_0x98cc('0x30')]=_[_0x98cc('0x31')](_0x31c25b[_0x98cc('0x2e')],_0x31c25b[_0x98cc('0x2f')]);_0x50b4e6['attributes']=_[_0x98cc('0x31')](_0x31c25b[_0x98cc('0x2e')],qs[_0x98cc('0x33')](_0xf54424[_0x98cc('0x2f')][_0x98cc('0x33')]));_0x50b4e6['attributes']=_0x50b4e6[_0x98cc('0x32')][_0x98cc('0x34')]?_0x50b4e6['attributes']:_0x31c25b[_0x98cc('0x2e')];if(_0xf54424['query'][_0x98cc('0x3c')]){_0x50b4e6[_0x98cc('0x3d')]=[{'all':!![]}];}_0x50b4e6=_[_0x98cc('0x39')]({},_0x50b4e6,_0xf54424[_0x98cc('0x3b')]);return db[_0x98cc('0x29')][_0x98cc('0x43')](_0x50b4e6)[_0x98cc('0x21')](handleEntityNotFound(_0x5a64c6,null))[_0x98cc('0x21')](respondWithResult(_0x5a64c6,null))['catch'](handleError(_0x5a64c6,null));};exports[_0x98cc('0x44')]=function(_0x39ffed,_0x38e3ff){return db['CmHopperHistory']['create'](_0x39ffed[_0x98cc('0x45')],{})[_0x98cc('0x21')](respondWithResult(_0x38e3ff,0xc9))['catch'](handleError(_0x38e3ff,null));};exports[_0x98cc('0x46')]=function(_0x36961a,_0x192c97){return db[_0x98cc('0x29')]['describe']()['then'](respondWithResult(_0x192c97,null))[_0x98cc('0x3f')](handleError(_0x192c97,null));};exports[_0x98cc('0x20')]=function(_0x4f9cce,_0x101d70){if(_0x4f9cce[_0x98cc('0x45')][_0x98cc('0x47')]){delete _0x4f9cce[_0x98cc('0x45')]['uniqueid'];}return db[_0x98cc('0x29')][_0x98cc('0x43')]({'where':{'uniqueid':_0x4f9cce[_0x98cc('0x41')]['id']}})[_0x98cc('0x21')](handleEntityNotFound(_0x101d70,null))[_0x98cc('0x21')](saveUpdates(_0x4f9cce[_0x98cc('0x45')],null))['then'](respondWithResult(_0x101d70,null))['catch'](handleError(_0x101d70,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index c925a97..39ec1a1 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 _0xb7de=['exports','define','endtime','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./cmHopperHistory.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb7de,0xc7));var _0xeb7d=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0xb7de[_0x55e08b];return _0xd1a7ff;};'use strict';var _=require(_0xeb7d('0x0'));var util=require(_0xeb7d('0x1'));var logger=require(_0xeb7d('0x2'))('api');var moment=require(_0xeb7d('0x3'));var BPromise=require(_0xeb7d('0x4'));var rp=require(_0xeb7d('0x5'));var fs=require('fs');var path=require(_0xeb7d('0x6'));var rimraf=require(_0xeb7d('0x7'));var config=require('../../config/environment');var attributes=require(_0xeb7d('0x8'));module[_0xeb7d('0x9')]=function(_0xadf4,_0x433c32){return _0xadf4[_0xeb7d('0xa')]('CmHopperHistory',attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0xeb7d('0xb'),'fields':[_0xeb7d('0xb')]},{'name':_0xeb7d('0xc'),'fields':[_0xeb7d('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xaec5=['../../config/environment','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0xaec5,0x92));var _0x5aec=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaec5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5aec('0x0'));var util=require(_0x5aec('0x1'));var logger=require(_0x5aec('0x2'))(_0x5aec('0x3'));var moment=require(_0x5aec('0x4'));var BPromise=require(_0x5aec('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5aec('0x6'));var rimraf=require(_0x5aec('0x7'));var config=require(_0x5aec('0x8'));var attributes=require('./cmHopperHistory.attributes');module['exports']=function(_0x539cdf,_0x52d725){return _0x539cdf[_0x5aec('0x9')](_0x5aec('0xa'),attributes,{'tableName':_0x5aec('0xb'),'paranoid':![],'indexes':[{'name':_0x5aec('0xc'),'fields':['endtime']},{'name':_0x5aec('0xd'),'fields':[_0x5aec('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 8d519c0..15a9144 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 _0x44f8=['raw','then','CreateCmHopperHistory','AvgHandleTime','findAll','where','sequelize','col','predictiveIntervalTotalCalls','COUNT','literal','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','AVG','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x204,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundReCallsDay','campaign','GetVoiceQueueHopperHistory','name','ivrAnswerCallsDay','GetCampaignHopperHistory','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','request','info','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CmHopperHistory,\x20%s,\x20%s','catch','CmHopperHistory','create','body','options'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x44f8,0xfb));var _0x844f=function(_0x57fffa,_0x2a3135){_0x57fffa=_0x57fffa-0x0;var _0x3ceb54=_0x44f8[_0x57fffa];return _0x3ceb54;};'use strict';var _=require(_0x844f('0x0'));var util=require(_0x844f('0x1'));var moment=require(_0x844f('0x2'));var BPromise=require('bluebird');var rs=require(_0x844f('0x3'));var fs=require('fs');var Redis=require(_0x844f('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x844f('0x5'))(_0x844f('0x6'));var config=require(_0x844f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x844f('0x8')][_0x844f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2fc3be,_0x3e5ece,_0x3bc2d4){return new BPromise(function(_0xca8bd6,_0x36ff38){return client[_0x844f('0xa')](_0x2fc3be,_0x3bc2d4)['then'](function(_0xe1201d){logger[_0x844f('0xb')]('CmHopperHistory,\x20%s,\x20%s',_0x3e5ece,_0x844f('0xc'));logger[_0x844f('0xd')](_0x844f('0xe'),_0x3e5ece,_0x844f('0xc'),JSON[_0x844f('0xf')](_0xe1201d));if(_0xe1201d[_0x844f('0x10')]){if(_0xe1201d[_0x844f('0x10')][_0x844f('0x11')]===0x1f4){logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x3e5ece,_0xe1201d[_0x844f('0x10')]['message']);return _0x36ff38(_0xe1201d[_0x844f('0x10')][_0x844f('0x12')]);}logger[_0x844f('0x10')](_0x844f('0x13'),_0x3e5ece,_0xe1201d[_0x844f('0x10')][_0x844f('0x12')]);return _0xca8bd6(_0xe1201d[_0x844f('0x10')][_0x844f('0x12')]);}else{logger[_0x844f('0xb')](_0x844f('0x13'),_0x3e5ece,'request\x20sent');_0xca8bd6(_0xe1201d['result'][_0x844f('0x12')]);}})[_0x844f('0x14')](function(_0x41f991){logger[_0x844f('0x10')](_0x844f('0x13'),_0x3e5ece,_0x41f991);_0x36ff38(_0x41f991);});});}exports['CreateCmHopperHistory']=function(_0x4d8a0a){var _0x2b0df1=this;return new Promise(function(_0x3d99bd,_0x5cdde8){return db[_0x844f('0x15')][_0x844f('0x16')](_0x4d8a0a[_0x844f('0x17')],{'raw':_0x4d8a0a[_0x844f('0x18')]?_0x4d8a0a[_0x844f('0x18')][_0x844f('0x19')]===undefined?!![]:![]:!![]})[_0x844f('0x1a')](function(_0x50952e){logger[_0x844f('0xb')](_0x844f('0x1b'),_0x4d8a0a);logger[_0x844f('0xd')](_0x844f('0x1b'),_0x4d8a0a,JSON['stringify'](_0x50952e));_0x3d99bd(_0x50952e);})[_0x844f('0x14')](function(_0x30997a){logger[_0x844f('0x10')](_0x844f('0x1b'),_0x30997a[_0x844f('0x12')],_0x4d8a0a);_0x5cdde8(_0x2b0df1['error'](0x1f4,_0x30997a[_0x844f('0x12')]));});});};exports[_0x844f('0x1c')]=function(_0x52e4b0){var _0x56f118=this;return new Promise(function(_0x48409c,_0x308461){return db['CmHopperHistory'][_0x844f('0x1d')]({'raw':_0x52e4b0[_0x844f('0x18')]?_0x52e4b0[_0x844f('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x52e4b0['options']?_0x52e4b0[_0x844f('0x18')][_0x844f('0x1e')]||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db[_0x844f('0x1f')][_0x844f('0x20')]('id')),_0x844f('0x21')],[db[_0x844f('0x1f')]['fn'](_0x844f('0x22'),db['sequelize']['fn']('IF',db['sequelize'][_0x844f('0x23')]('`state`\x20=\x204,\x201,\x20null'))),_0x844f('0x24')],[db[_0x844f('0x1f')]['fn'](_0x844f('0x22'),db[_0x844f('0x1f')]['fn']('IF',db[_0x844f('0x1f')][_0x844f('0x23')](_0x844f('0x25')))),_0x844f('0x26')],[db[_0x844f('0x1f')]['fn'](_0x844f('0x22'),db[_0x844f('0x1f')]['fn']('IF',db[_0x844f('0x1f')]['literal'](_0x844f('0x27')))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0x844f('0x1f')]['fn'](_0x844f('0x28'),db[_0x844f('0x1f')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0x844f('0x29')],[db[_0x844f('0x1f')]['fn']('AVG',db[_0x844f('0x1f')]['fn']('IF',db[_0x844f('0x1f')]['literal'](_0x844f('0x2a')))),_0x844f('0x2b')]]})[_0x844f('0x1a')](function(_0x50988d){logger[_0x844f('0xb')](_0x844f('0x1c'),_0x52e4b0);logger['debug'](_0x844f('0x1c'),_0x52e4b0,JSON[_0x844f('0xf')](_0x50988d));_0x48409c(_0x50988d);})['catch'](function(_0x4eb75a){logger[_0x844f('0x10')](_0x844f('0x1c'),_0x4eb75a[_0x844f('0x12')],_0x52e4b0);_0x308461(_0x56f118[_0x844f('0x10')](0x1f4,_0x4eb75a[_0x844f('0x12')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x44ce82){var _0x18db6e=this;return new Promise(function(_0x52b592,_0x1a53f7){return db[_0x844f('0x15')][_0x844f('0x1d')]({'raw':_0x44ce82[_0x844f('0x18')]?_0x44ce82[_0x844f('0x18')][_0x844f('0x19')]===undefined?!![]:![]:!![],'where':_0x44ce82['options']?_0x44ce82[_0x844f('0x18')][_0x844f('0x1e')]||null:null,'attributes':[['campaign','name'],[db['sequelize']['fn'](_0x844f('0x22'),db[_0x844f('0x1f')]['fn']('IF',db[_0x844f('0x1f')][_0x844f('0x23')]('`state`\x20=\x200,\x201,\x20null'))),_0x844f('0x2c')],[db[_0x844f('0x1f')]['fn']('COUNT',db[_0x844f('0x1f')]['fn']('IF',db[_0x844f('0x1f')]['literal'](_0x844f('0x2d')))),_0x844f('0x2e')],[db['sequelize']['fn'](_0x844f('0x22'),db[_0x844f('0x1f')]['fn']('IF',db[_0x844f('0x1f')][_0x844f('0x23')](_0x844f('0x2f')))),'outboundAnswerCallsDay'],[db[_0x844f('0x1f')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x844f('0x1f')][_0x844f('0x23')](_0x844f('0x30')))),'outboundBusyCallsDay'],[db[_0x844f('0x1f')]['fn'](_0x844f('0x22'),db[_0x844f('0x1f')]['fn']('IF',db['sequelize']['literal'](_0x844f('0x31')))),_0x844f('0x32')],[db[_0x844f('0x1f')]['fn'](_0x844f('0x22'),db['sequelize']['fn']('IF',db[_0x844f('0x1f')][_0x844f('0x23')](_0x844f('0x33')))),_0x844f('0x34')],[db[_0x844f('0x1f')]['fn'](_0x844f('0x22'),db['sequelize']['fn']('IF',db[_0x844f('0x1f')][_0x844f('0x23')](_0x844f('0x35')))),_0x844f('0x36')],[db[_0x844f('0x1f')]['fn'](_0x844f('0x22'),db[_0x844f('0x1f')]['fn']('IF',db[_0x844f('0x1f')][_0x844f('0x23')]('`state`\x20=\x2012,\x201,\x20null'))),_0x844f('0x37')],[db[_0x844f('0x1f')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x844f('0x1f')][_0x844f('0x23')](_0x844f('0x38')))),_0x844f('0x39')],[db[_0x844f('0x1f')]['fn'](_0x844f('0x22'),db['sequelize']['fn']('IF',db[_0x844f('0x1f')][_0x844f('0x23')](_0x844f('0x3a')))),_0x844f('0x3b')],[db[_0x844f('0x1f')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x844f('0x1f')][_0x844f('0x23')](_0x844f('0x3c')))),'outboundRejectCallsDay'],[db[_0x844f('0x1f')]['fn']('COUNT',db[_0x844f('0x1f')]['fn']('IF',db['sequelize'][_0x844f('0x23')]('`state`\x20=\x2016,\x201,\x20null'))),_0x844f('0x3d')],[db[_0x844f('0x1f')]['fn'](_0x844f('0x22'),db['sequelize']['fn']('IF',db[_0x844f('0x1f')][_0x844f('0x23')](_0x844f('0x3e')))),'outboundRejectCallsDay'],[db[_0x844f('0x1f')]['fn']('COUNT',db[_0x844f('0x1f')]['fn']('IF',db[_0x844f('0x1f')][_0x844f('0x23')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0x844f('0x3f')]],'group':[_0x844f('0x40')]})['then'](function(_0xb447f9){logger[_0x844f('0xb')]('GetVoiceQueueHopperHistory',_0x44ce82);logger[_0x844f('0xd')](_0x844f('0x41'),_0x44ce82,JSON[_0x844f('0xf')](_0xb447f9));_0x52b592(_0xb447f9);})['catch'](function(_0x2360f8){logger[_0x844f('0x10')]('GetVoiceQueueHopperHistory',_0x2360f8[_0x844f('0x12')],_0x44ce82);_0x1a53f7(_0x18db6e[_0x844f('0x10')](0x1f4,_0x2360f8[_0x844f('0x12')]));});});};exports['GetCampaignHopperHistory']=function(_0x19ce02){var _0x566513=this;return new Promise(function(_0x405557,_0x25c113){return db[_0x844f('0x15')][_0x844f('0x1d')]({'raw':_0x19ce02[_0x844f('0x18')]?_0x19ce02['options']['raw']===undefined?!![]:![]:!![],'where':_0x19ce02[_0x844f('0x18')]?_0x19ce02['options'][_0x844f('0x1e')]||null:null,'attributes':[[_0x844f('0x40'),_0x844f('0x42')],[db[_0x844f('0x1f')]['fn'](_0x844f('0x22'),db[_0x844f('0x1f')][_0x844f('0x20')]('id')),'ivrTotalCallsDays'],[db[_0x844f('0x1f')]['fn'](_0x844f('0x22'),db[_0x844f('0x1f')]['fn']('IF',db[_0x844f('0x1f')][_0x844f('0x23')](_0x844f('0x2f')))),_0x844f('0x43')]],'group':[_0x844f('0x40')]})['then'](function(_0x2c41eb){logger[_0x844f('0xb')](_0x844f('0x44'),_0x19ce02);logger[_0x844f('0xd')](_0x844f('0x44'),_0x19ce02,JSON[_0x844f('0xf')](_0x2c41eb));_0x405557(_0x2c41eb);})[_0x844f('0x14')](function(_0x2a8d0b){logger[_0x844f('0x10')](_0x844f('0x44'),_0x2a8d0b['message'],_0x19ce02);_0x25c113(_0x566513[_0x844f('0x10')](0x1f4,_0x2a8d0b[_0x844f('0x12')]));});});}; \ No newline at end of file +var _0xfccf=['predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','raw','where','campaign','name','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','`state`\x20=\x204,\x201,\x20null','GetCampaignHopperHistory','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','AvgHandleTime','sequelize','COUNT','col','literal','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xfccf,0xaa));var _0xffcc=function(_0x133a9a,_0x37f5f0){_0x133a9a=_0x133a9a-0x0;var _0x39a830=_0xfccf[_0x133a9a];return _0x39a830;};'use strict';var _=require(_0xffcc('0x0'));var util=require(_0xffcc('0x1'));var moment=require(_0xffcc('0x2'));var BPromise=require(_0xffcc('0x3'));var rs=require(_0xffcc('0x4'));var fs=require('fs');var Redis=require(_0xffcc('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xffcc('0x6'))(_0xffcc('0x7'));var config=require(_0xffcc('0x8'));var jayson=require(_0xffcc('0x9'));var client=jayson[_0xffcc('0xa')][_0xffcc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x229fe1,_0x3cf6b6,_0x5792b8){return new BPromise(function(_0x15e64c,_0x240dfe){return client['request'](_0x229fe1,_0x5792b8)[_0xffcc('0xc')](function(_0x3ceec5){logger['info'](_0xffcc('0xd'),_0x3cf6b6,_0xffcc('0xe'));logger[_0xffcc('0xf')](_0xffcc('0x10'),_0x3cf6b6,_0xffcc('0xe'),JSON[_0xffcc('0x11')](_0x3ceec5));if(_0x3ceec5[_0xffcc('0x12')]){if(_0x3ceec5[_0xffcc('0x12')][_0xffcc('0x13')]===0x1f4){logger[_0xffcc('0x12')](_0xffcc('0xd'),_0x3cf6b6,_0x3ceec5['error']['message']);return _0x240dfe(_0x3ceec5[_0xffcc('0x12')][_0xffcc('0x14')]);}logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x3cf6b6,_0x3ceec5[_0xffcc('0x12')]['message']);return _0x15e64c(_0x3ceec5[_0xffcc('0x12')][_0xffcc('0x14')]);}else{logger[_0xffcc('0x15')](_0xffcc('0xd'),_0x3cf6b6,'request\x20sent');_0x15e64c(_0x3ceec5[_0xffcc('0x16')][_0xffcc('0x14')]);}})[_0xffcc('0x17')](function(_0x1fc745){logger['error'](_0xffcc('0xd'),_0x3cf6b6,_0x1fc745);_0x240dfe(_0x1fc745);});});}exports[_0xffcc('0x18')]=function(_0x4e979f){var _0x3dd2c8=this;return new Promise(function(_0x230411,_0x51437d){return db[_0xffcc('0x19')][_0xffcc('0x1a')](_0x4e979f[_0xffcc('0x1b')],{'raw':_0x4e979f[_0xffcc('0x1c')]?_0x4e979f['options']['raw']===undefined?!![]:![]:!![]})[_0xffcc('0xc')](function(_0x402c95){logger[_0xffcc('0x15')](_0xffcc('0x18'),_0x4e979f);logger[_0xffcc('0xf')](_0xffcc('0x18'),_0x4e979f,JSON[_0xffcc('0x11')](_0x402c95));_0x230411(_0x402c95);})[_0xffcc('0x17')](function(_0x217914){logger[_0xffcc('0x12')](_0xffcc('0x18'),_0x217914[_0xffcc('0x14')],_0x4e979f);_0x51437d(_0x3dd2c8['error'](0x1f4,_0x217914[_0xffcc('0x14')]));});});};exports[_0xffcc('0x1d')]=function(_0x18e4ed){var _0x1b9024=this;return new Promise(function(_0x1c073e,_0x3bc3c7){return db[_0xffcc('0x19')]['findAll']({'raw':_0x18e4ed[_0xffcc('0x1c')]?_0x18e4ed[_0xffcc('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x18e4ed[_0xffcc('0x1c')]?_0x18e4ed[_0xffcc('0x1c')]['where']||null:null,'attributes':[[db[_0xffcc('0x1e')]['fn'](_0xffcc('0x1f'),db[_0xffcc('0x1e')][_0xffcc('0x20')]('id')),'predictiveIntervalTotalCalls'],[db[_0xffcc('0x1e')]['fn'](_0xffcc('0x1f'),db[_0xffcc('0x1e')]['fn']('IF',db[_0xffcc('0x1e')]['literal']('`state`\x20=\x204,\x201,\x20null'))),'predictiveIntervalAnsweredCalls'],[db['sequelize']['fn']('COUNT',db[_0xffcc('0x1e')]['fn']('IF',db['sequelize'][_0xffcc('0x21')](_0xffcc('0x22')))),_0xffcc('0x23')],[db[_0xffcc('0x1e')]['fn'](_0xffcc('0x1f'),db['sequelize']['fn']('IF',db[_0xffcc('0x1e')][_0xffcc('0x21')](_0xffcc('0x24')))),_0xffcc('0x25')],[db[_0xffcc('0x1e')]['fn'](_0xffcc('0x26'),db[_0xffcc('0x1e')]['fn']('IF',db[_0xffcc('0x1e')][_0xffcc('0x21')](_0xffcc('0x27')))),_0xffcc('0x28')],[db['sequelize']['fn']('AVG',db[_0xffcc('0x1e')]['fn']('IF',db[_0xffcc('0x1e')]['literal'](_0xffcc('0x29')))),_0xffcc('0x2a')]]})[_0xffcc('0xc')](function(_0x2a6beb){logger[_0xffcc('0x15')]('AvgHandleTime',_0x18e4ed);logger[_0xffcc('0xf')]('AvgHandleTime',_0x18e4ed,JSON[_0xffcc('0x11')](_0x2a6beb));_0x1c073e(_0x2a6beb);})['catch'](function(_0x294510){logger[_0xffcc('0x12')]('AvgHandleTime',_0x294510[_0xffcc('0x14')],_0x18e4ed);_0x3bc3c7(_0x1b9024[_0xffcc('0x12')](0x1f4,_0x294510[_0xffcc('0x14')]));});});};exports[_0xffcc('0x2b')]=function(_0x217277){var _0x5c5be2=this;return new Promise(function(_0x1248ed,_0x5986b1){return db[_0xffcc('0x19')]['findAll']({'raw':_0x217277[_0xffcc('0x1c')]?_0x217277[_0xffcc('0x1c')][_0xffcc('0x2c')]===undefined?!![]:![]:!![],'where':_0x217277['options']?_0x217277[_0xffcc('0x1c')][_0xffcc('0x2d')]||null:null,'attributes':[[_0xffcc('0x2e'),_0xffcc('0x2f')],[db[_0xffcc('0x1e')]['fn']('COUNT',db[_0xffcc('0x1e')]['fn']('IF',db[_0xffcc('0x1e')][_0xffcc('0x21')](_0xffcc('0x30')))),'outboundNoSuchCallsDay'],[db[_0xffcc('0x1e')]['fn'](_0xffcc('0x1f'),db[_0xffcc('0x1e')]['fn']('IF',db[_0xffcc('0x1e')]['literal'](_0xffcc('0x31')))),_0xffcc('0x32')],[db['sequelize']['fn'](_0xffcc('0x1f'),db[_0xffcc('0x1e')]['fn']('IF',db['sequelize'][_0xffcc('0x21')]('`state`\x20=\x204,\x201,\x20null'))),_0xffcc('0x33')],[db[_0xffcc('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xffcc('0x1e')][_0xffcc('0x21')](_0xffcc('0x34')))),_0xffcc('0x35')],[db[_0xffcc('0x1e')]['fn'](_0xffcc('0x1f'),db[_0xffcc('0x1e')]['fn']('IF',db[_0xffcc('0x1e')][_0xffcc('0x21')]('`state`\x20=\x208,\x201,\x20null'))),_0xffcc('0x36')],[db[_0xffcc('0x1e')]['fn'](_0xffcc('0x1f'),db[_0xffcc('0x1e')]['fn']('IF',db[_0xffcc('0x1e')][_0xffcc('0x21')](_0xffcc('0x37')))),_0xffcc('0x38')],[db[_0xffcc('0x1e')]['fn'](_0xffcc('0x1f'),db[_0xffcc('0x1e')]['fn']('IF',db[_0xffcc('0x1e')]['literal'](_0xffcc('0x39')))),'outboundDropCallsDayCallersExit'],[db['sequelize']['fn']('COUNT',db[_0xffcc('0x1e')]['fn']('IF',db['sequelize'][_0xffcc('0x21')](_0xffcc('0x3a')))),_0xffcc('0x3b')],[db[_0xffcc('0x1e')]['fn'](_0xffcc('0x1f'),db[_0xffcc('0x1e')]['fn']('IF',db['sequelize'][_0xffcc('0x21')]('`state`\x20=\x2013,\x201,\x20null'))),_0xffcc('0x3c')],[db['sequelize']['fn'](_0xffcc('0x1f'),db[_0xffcc('0x1e')]['fn']('IF',db[_0xffcc('0x1e')][_0xffcc('0x21')](_0xffcc('0x3d')))),_0xffcc('0x3e')],[db['sequelize']['fn'](_0xffcc('0x1f'),db[_0xffcc('0x1e')]['fn']('IF',db[_0xffcc('0x1e')][_0xffcc('0x21')]('`state`\x20=\x2018,\x201,\x20null'))),_0xffcc('0x3f')],[db['sequelize']['fn'](_0xffcc('0x1f'),db['sequelize']['fn']('IF',db[_0xffcc('0x1e')]['literal'](_0xffcc('0x40')))),_0xffcc('0x41')],[db[_0xffcc('0x1e')]['fn'](_0xffcc('0x1f'),db[_0xffcc('0x1e')]['fn']('IF',db['sequelize'][_0xffcc('0x21')](_0xffcc('0x42')))),_0xffcc('0x3f')],[db[_0xffcc('0x1e')]['fn'](_0xffcc('0x1f'),db[_0xffcc('0x1e')]['fn']('IF',db['sequelize'][_0xffcc('0x21')](_0xffcc('0x43')))),'outboundReCallsDay']],'group':[_0xffcc('0x2e')]})[_0xffcc('0xc')](function(_0x44ef5d){logger[_0xffcc('0x15')](_0xffcc('0x2b'),_0x217277);logger[_0xffcc('0xf')](_0xffcc('0x2b'),_0x217277,JSON['stringify'](_0x44ef5d));_0x1248ed(_0x44ef5d);})[_0xffcc('0x17')](function(_0x5c40f5){logger['error'](_0xffcc('0x2b'),_0x5c40f5['message'],_0x217277);_0x5986b1(_0x5c5be2['error'](0x1f4,_0x5c40f5['message']));});});};exports['GetCampaignHopperHistory']=function(_0x4afd24){var _0x912857=this;return new Promise(function(_0x530182,_0x511bcb){return db[_0xffcc('0x19')]['findAll']({'raw':_0x4afd24['options']?_0x4afd24[_0xffcc('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x4afd24['options']?_0x4afd24['options'][_0xffcc('0x2d')]||null:null,'attributes':[[_0xffcc('0x2e'),_0xffcc('0x2f')],[db['sequelize']['fn'](_0xffcc('0x1f'),db[_0xffcc('0x1e')][_0xffcc('0x20')]('id')),'ivrTotalCallsDays'],[db[_0xffcc('0x1e')]['fn'](_0xffcc('0x1f'),db[_0xffcc('0x1e')]['fn']('IF',db['sequelize'][_0xffcc('0x21')](_0xffcc('0x44')))),'ivrAnswerCallsDay']],'group':[_0xffcc('0x2e')]})[_0xffcc('0xc')](function(_0x5b45f1){logger[_0xffcc('0x15')](_0xffcc('0x45'),_0x4afd24);logger['debug'](_0xffcc('0x45'),_0x4afd24,JSON[_0xffcc('0x11')](_0x5b45f1));_0x530182(_0x5b45f1);})[_0xffcc('0x17')](function(_0x58243c){logger[_0xffcc('0x12')](_0xffcc('0x45'),_0x58243c[_0xffcc('0x14')],_0x4afd24);_0x511bcb(_0x912857[_0xffcc('0x12')](0x1f4,_0x58243c[_0xffcc('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 058420a..44533dd 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 _0xf098=['put','exports','multer','util','path','../../components/interaction/service','./cmHopperHistory.controller','isAuthenticated','get','/describe','/:id','show','post','create'];(function(_0xfd9fbe,_0xd1f701){var _0x27c180=function(_0x5e9728){while(--_0x5e9728){_0xfd9fbe['push'](_0xfd9fbe['shift']());}};_0x27c180(++_0xd1f701);}(_0xf098,0x8e));var _0x8f09=function(_0xaa84fc,_0x8450e4){_0xaa84fc=_0xaa84fc-0x0;var _0x220f7d=_0xf098[_0xaa84fc];return _0x220f7d;};'use strict';var multer=require(_0x8f09('0x0'));var util=require(_0x8f09('0x1'));var path=require(_0x8f09('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8f09('0x3'));var config=require('../../config/environment');var controller=require(_0x8f09('0x4'));router['get']('/',auth[_0x8f09('0x5')](),controller['index']);router[_0x8f09('0x6')](_0x8f09('0x7'),auth['isAuthenticated'](),controller['describe']);router[_0x8f09('0x6')](_0x8f09('0x8'),auth[_0x8f09('0x5')](),controller[_0x8f09('0x9')]);router[_0x8f09('0xa')]('/',auth[_0x8f09('0x5')](),controller[_0x8f09('0xb')]);router[_0x8f09('0xc')]('/:id',auth['isAuthenticated'](),controller['update']);module[_0x8f09('0xd')]=router; \ No newline at end of file +var _0xf9ff=['put','update','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x201789,_0x4a20d6){var _0x5c6358=function(_0x3ab4fd){while(--_0x3ab4fd){_0x201789['push'](_0x201789['shift']());}};_0x5c6358(++_0x4a20d6);}(_0xf9ff,0x1df));var _0xff9f=function(_0x3f00ee,_0x1d1673){_0x3f00ee=_0x3f00ee-0x0;var _0x18a07e=_0xf9ff[_0x3f00ee];return _0x18a07e;};'use strict';var multer=require(_0xff9f('0x0'));var util=require(_0xff9f('0x1'));var path=require(_0xff9f('0x2'));var timeout=require('connect-timeout');var express=require(_0xff9f('0x3'));var router=express[_0xff9f('0x4')]();var fs_extra=require(_0xff9f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xff9f('0x6'));var config=require(_0xff9f('0x7'));var controller=require('./cmHopperHistory.controller');router[_0xff9f('0x8')]('/',auth[_0xff9f('0x9')](),controller['index']);router[_0xff9f('0x8')](_0xff9f('0xa'),auth[_0xff9f('0x9')](),controller[_0xff9f('0xb')]);router['get'](_0xff9f('0xc'),auth['isAuthenticated'](),controller[_0xff9f('0xd')]);router['post']('/',auth[_0xff9f('0x9')](),controller['create']);router[_0xff9f('0xe')](_0xff9f('0xc'),auth[_0xff9f('0x9')](),controller[_0xff9f('0xf')]);module[_0xff9f('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 b48a543..5d15e96 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 _0x3a32=['exports','STRING','name','sequelize'];(function(_0x5a7d5f,_0x5695cb){var _0x5dcded=function(_0x13f053){while(--_0x13f053){_0x5a7d5f['push'](_0x5a7d5f['shift']());}};_0x5dcded(++_0x5695cb);}(_0x3a32,0x9b));var _0x23a3=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x3a32[_0x334841];return _0x5beb4b;};'use strict';var Sequelize=require(_0x23a3('0x0'));module[_0x23a3('0x1')]={'name':{'type':Sequelize[_0x23a3('0x2')],'unique':_0x23a3('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x23a3('0x2')]},'dialPrefix':{'type':Sequelize[_0x23a3('0x2')]}}; \ No newline at end of file +var _0x0c02=['exports','STRING'];(function(_0x1e6e99,_0xd3bb5f){var _0x6b6ca8=function(_0xa29245){while(--_0xa29245){_0x1e6e99['push'](_0x1e6e99['shift']());}};_0x6b6ca8(++_0xd3bb5f);}(_0x0c02,0x84));var _0x20c0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c02[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x20c0('0x0')]={'name':{'type':Sequelize[_0x20c0('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x20c0('0x1')]},'dialPrefix':{'type':Sequelize[_0x20c0('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index bf2f9c6..fa2027a 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 _0x9c00=['map','CmList','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','includeAll','include','catch','params','options','find','create','user','role','UserProfileSection','userProfileId','body','describe','addDisposition','ListId','findOne','Disposition','pick','findAll','rows','removeDispositions','ids','addContacts','CmContact','tags','push','each','omit','errors','CmCustomField','CustomFields','concat','format','cf_%d','raw','getContacts','getContactsCsv','ContactItemType','from','cm_contacts','c.ListId\x20=\x20?','field','c.cf_','alias','item','cm_contact_has_items','select','description','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','description_additionalPhone_','toString','isEmpty','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','download','sequelize','transaction','addCustomFields','Sequelize','text','TEXT','number','INTEGER','defaultValue','queryInterface','addColumn','cf_%s','findAndCountAll','addAgents','spread','emit','userCmList:save','removeAgents','isArray','userCmList:remove','getAgents','info','message','eml-format','rimraf','request-promise','moment','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/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','json','undefined','count','offset','limit','Content-Range','reject','save','update','then','destroy','get','Lists','UserProfileResource','error','name','send'];(function(_0x10cc84,_0x3b44eb){var _0x357fe4=function(_0x5c2e94){while(--_0x5c2e94){_0x10cc84['push'](_0x10cc84['shift']());}};_0x357fe4(++_0x3b44eb);}(_0x9c00,0x1a0));var _0x09c0=function(_0x2bf6be,_0x5b23f1){_0x2bf6be=_0x2bf6be-0x0;var _0x532ef4=_0x9c00[_0x2bf6be];return _0x532ef4;};'use strict';var emlformat=require(_0x09c0('0x0'));var rimraf=require(_0x09c0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x09c0('0x2'));var moment=require(_0x09c0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x09c0('0x4'));var util=require(_0x09c0('0x5'));var path=require(_0x09c0('0x6'));var sox=require(_0x09c0('0x7'));var csv=require(_0x09c0('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x09c0('0x9'));var squel=require(_0x09c0('0xa'));var crypto=require(_0x09c0('0xb'));var jsforce=require(_0x09c0('0xc'));var deskjs=require(_0x09c0('0xd'));var toCsv=require('to-csv');var querystring=require(_0x09c0('0xe'));var Papa=require(_0x09c0('0xf'));var Redis=require(_0x09c0('0x10'));var authService=require(_0x09c0('0x11'));var qs=require(_0x09c0('0x12'));var as=require(_0x09c0('0x13'));var hardwareService=require(_0x09c0('0x14'));var logger=require(_0x09c0('0x15'))(_0x09c0('0x16'));var utils=require(_0x09c0('0x17'));var config=require(_0x09c0('0x18'));var licenseUtil=require(_0x09c0('0x19'));var db=require(_0x09c0('0x1a'))['db'];var csv_results;config[_0x09c0('0x1b')]=_[_0x09c0('0x1c')](config[_0x09c0('0x1b')],{'host':_0x09c0('0x1d'),'port':0x18eb});var socket=require(_0x09c0('0x1e'))(new Redis(config[_0x09c0('0x1b')]));require(_0x09c0('0x1f'))[_0x09c0('0x20')](socket);function respondWithStatusCode(_0x254598,_0x152140){_0x152140=_0x152140||0xcc;return function(_0x45a265){if(_0x45a265){return _0x254598[_0x09c0('0x21')](_0x152140);}return _0x254598[_0x09c0('0x22')](_0x152140)['end']();};}function respondWithResult(_0x590129,_0x558b4f){_0x558b4f=_0x558b4f||0xc8;return function(_0x42030d){if(_0x42030d){return _0x590129[_0x09c0('0x22')](_0x558b4f)[_0x09c0('0x23')](_0x42030d);}};}function respondWithFilteredResult(_0x628272,_0x5dcab7){return function(_0x2c4440){if(_0x2c4440){var _0x4aa8a5=typeof _0x5dcab7['offset']===_0x09c0('0x24')&&typeof _0x5dcab7['limit']===_0x09c0('0x24');var _0x319c36=_0x2c4440[_0x09c0('0x25')];var _0x49064c=_0x4aa8a5?0x0:_0x5dcab7[_0x09c0('0x26')];var _0x44f714=_0x4aa8a5?_0x2c4440[_0x09c0('0x25')]:_0x5dcab7[_0x09c0('0x26')]+_0x5dcab7[_0x09c0('0x27')];var _0xa5d16f;if(_0x44f714>=_0x319c36){_0x44f714=_0x319c36;_0xa5d16f=0xc8;}else{_0xa5d16f=0xce;}_0x628272[_0x09c0('0x22')](_0xa5d16f);return _0x628272['set'](_0x09c0('0x28'),_0x49064c+'-'+_0x44f714+'/'+_0x319c36)[_0x09c0('0x23')](_0x2c4440);}return null;};}function patchUpdates(_0x473fbd){return function(_0x1d18e9){try{jsonpatch['apply'](_0x1d18e9,_0x473fbd,!![]);}catch(_0x4f6824){return BPromise[_0x09c0('0x29')](_0x4f6824);}return _0x1d18e9[_0x09c0('0x2a')]();};}function saveUpdates(_0x1e8a1c,_0x3a5370){return function(_0x491e6f){if(_0x491e6f){return _0x491e6f[_0x09c0('0x2b')](_0x1e8a1c)[_0x09c0('0x2c')](function(_0x56d883){return _0x56d883;});}return null;};}function removeEntity(_0x2c7202,_0x163a59){return function(_0x2e3d4d){if(_0x2e3d4d){return _0x2e3d4d[_0x09c0('0x2d')]()[_0x09c0('0x2c')](function(){var _0x1d2d9d=_0x2e3d4d[_0x09c0('0x2e')]({'plain':!![]});var _0x35b61c=_0x09c0('0x2f');return db[_0x09c0('0x30')][_0x09c0('0x2d')]({'where':{'type':_0x35b61c,'resourceId':_0x1d2d9d['id']}})['then'](function(){return _0x2e3d4d;});})[_0x09c0('0x2c')](function(){_0x2c7202[_0x09c0('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d09e0,_0x5aa0b9){return function(_0x3f5b10){if(!_0x3f5b10){_0x1d09e0['sendStatus'](0x194);}return _0x3f5b10;};}function handleError(_0x3ac8e4,_0x24e371){_0x24e371=_0x24e371||0x1f4;return function(_0x108409){logger[_0x09c0('0x31')](_0x108409['stack']);if(_0x108409['name']){delete _0x108409[_0x09c0('0x32')];}_0x3ac8e4[_0x09c0('0x22')](_0x24e371)[_0x09c0('0x33')](_0x108409);};}exports['index']=function(_0x321ee6,_0x4bdae9){var _0x350cd3={},_0x21755d={},_0x16cf08={'count':0x0,'rows':[]};var _0x500cf8=_[_0x09c0('0x34')](db[_0x09c0('0x35')][_0x09c0('0x36')],function(_0x184c0b){return{'name':_0x184c0b[_0x09c0('0x37')],'type':_0x184c0b[_0x09c0('0x38')][_0x09c0('0x39')]};});_0x21755d['model']=_[_0x09c0('0x34')](_0x500cf8,_0x09c0('0x32'));_0x21755d[_0x09c0('0x3a')]=_[_0x09c0('0x3b')](_0x321ee6[_0x09c0('0x3a')]);_0x21755d['filters']=_[_0x09c0('0x3c')](_0x21755d[_0x09c0('0x3d')],_0x21755d[_0x09c0('0x3a')]);_0x350cd3[_0x09c0('0x3e')]=_[_0x09c0('0x3c')](_0x21755d['model'],qs[_0x09c0('0x3f')](_0x321ee6[_0x09c0('0x3a')][_0x09c0('0x3f')]));_0x350cd3[_0x09c0('0x3e')]=_0x350cd3[_0x09c0('0x3e')][_0x09c0('0x40')]?_0x350cd3[_0x09c0('0x3e')]:_0x21755d['model'];if(!_0x321ee6[_0x09c0('0x3a')][_0x09c0('0x41')](_0x09c0('0x42'))){_0x350cd3[_0x09c0('0x27')]=qs[_0x09c0('0x27')](_0x321ee6['query']['limit']);_0x350cd3['offset']=qs['offset'](_0x321ee6[_0x09c0('0x3a')][_0x09c0('0x26')]);}_0x350cd3[_0x09c0('0x43')]=qs[_0x09c0('0x44')](_0x321ee6[_0x09c0('0x3a')]['sort']);_0x350cd3[_0x09c0('0x45')]=qs[_0x09c0('0x46')](_['pick'](_0x321ee6[_0x09c0('0x3a')],_0x21755d['filters']),_0x500cf8);if(_0x321ee6[_0x09c0('0x3a')]['filter']){_0x350cd3[_0x09c0('0x45')]=_[_0x09c0('0x47')](_0x350cd3['where'],{'$or':_[_0x09c0('0x34')](_0x500cf8,function(_0x17fed6){if(_0x17fed6['type']!==_0x09c0('0x48')){var _0x30f8a7={};_0x30f8a7[_0x17fed6[_0x09c0('0x32')]]={'$like':'%'+_0x321ee6[_0x09c0('0x3a')][_0x09c0('0x49')]+'%'};return _0x30f8a7;}})});}_0x350cd3=_[_0x09c0('0x47')]({},_0x350cd3,_0x321ee6['options']);var _0x24bb97={'where':_0x350cd3[_0x09c0('0x45')]};return db[_0x09c0('0x35')]['count'](_0x24bb97)[_0x09c0('0x2c')](function(_0x30c0c5){_0x16cf08[_0x09c0('0x25')]=_0x30c0c5;if(_0x321ee6['query'][_0x09c0('0x4a')]){_0x350cd3[_0x09c0('0x4b')]=[{'all':!![]}];}return db['CmList']['findAll'](_0x350cd3);})[_0x09c0('0x2c')](function(_0x471078){_0x16cf08['rows']=_0x471078;return _0x16cf08;})[_0x09c0('0x2c')](respondWithFilteredResult(_0x4bdae9,_0x350cd3))[_0x09c0('0x4c')](handleError(_0x4bdae9,null));};exports['show']=function(_0xbabba1,_0x13582b){var _0x2e7d4f={'raw':![],'where':{'id':_0xbabba1[_0x09c0('0x4d')]['id']}},_0x33fc26={};_0x33fc26['model']=_[_0x09c0('0x3b')](db['CmList']['rawAttributes']);_0x33fc26[_0x09c0('0x3a')]=_[_0x09c0('0x3b')](_0xbabba1[_0x09c0('0x3a')]);_0x33fc26[_0x09c0('0x46')]=_[_0x09c0('0x3c')](_0x33fc26[_0x09c0('0x3d')],_0x33fc26['query']);_0x2e7d4f['attributes']=_['intersection'](_0x33fc26[_0x09c0('0x3d')],qs[_0x09c0('0x3f')](_0xbabba1[_0x09c0('0x3a')]['fields']));_0x2e7d4f[_0x09c0('0x3e')]=_0x2e7d4f[_0x09c0('0x3e')][_0x09c0('0x40')]?_0x2e7d4f[_0x09c0('0x3e')]:_0x33fc26[_0x09c0('0x3d')];if(_0xbabba1[_0x09c0('0x3a')][_0x09c0('0x4a')]){_0x2e7d4f[_0x09c0('0x4b')]=[{'all':!![]}];}_0x2e7d4f=_[_0x09c0('0x47')]({},_0x2e7d4f,_0xbabba1[_0x09c0('0x4e')]);return db[_0x09c0('0x35')][_0x09c0('0x4f')](_0x2e7d4f)[_0x09c0('0x2c')](handleEntityNotFound(_0x13582b,null))[_0x09c0('0x2c')](respondWithResult(_0x13582b,null))[_0x09c0('0x4c')](handleError(_0x13582b,null));};exports[_0x09c0('0x50')]=function(_0x37e043,_0x14c834){return db[_0x09c0('0x35')][_0x09c0('0x50')](_0x37e043['body'],{})[_0x09c0('0x2c')](function(_0x44befb){var _0x15b0a2=_0x37e043[_0x09c0('0x51')][_0x09c0('0x2e')]({'plain':!![]});if(!_0x15b0a2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x15b0a2[_0x09c0('0x52')]===_0x09c0('0x51')){var _0x1823c2=_0x44befb['get']({'plain':!![]});var _0xe0b82a=_0x09c0('0x2f');return db[_0x09c0('0x53')][_0x09c0('0x4f')]({'where':{'name':_0xe0b82a,'userProfileId':_0x15b0a2[_0x09c0('0x54')]},'raw':!![]})[_0x09c0('0x2c')](function(_0x45ecd0){if(_0x45ecd0&&_0x45ecd0['autoAssociation']===0x0){return db[_0x09c0('0x30')][_0x09c0('0x50')]({'name':_0x1823c2[_0x09c0('0x32')],'resourceId':_0x1823c2['id'],'type':_0x45ecd0[_0x09c0('0x32')],'sectionId':_0x45ecd0['id']},{})[_0x09c0('0x2c')](function(){return _0x44befb;});}else{return _0x44befb;}})[_0x09c0('0x4c')](function(_0x3ebabb){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3ebabb);throw _0x3ebabb;});}return _0x44befb;})[_0x09c0('0x2c')](respondWithResult(_0x14c834,0xc9))[_0x09c0('0x4c')](handleError(_0x14c834,null));};exports[_0x09c0('0x2b')]=function(_0x528366,_0x1af651){if(_0x528366['body']['id']){delete _0x528366[_0x09c0('0x55')]['id'];}return db[_0x09c0('0x35')][_0x09c0('0x4f')]({'where':{'id':_0x528366[_0x09c0('0x4d')]['id']}})[_0x09c0('0x2c')](handleEntityNotFound(_0x1af651,null))[_0x09c0('0x2c')](saveUpdates(_0x528366[_0x09c0('0x55')],null))['then'](respondWithResult(_0x1af651,null))[_0x09c0('0x4c')](handleError(_0x1af651,null));};exports[_0x09c0('0x2d')]=function(_0x97c584,_0x270ff2){return db[_0x09c0('0x35')][_0x09c0('0x4f')]({'where':{'id':_0x97c584[_0x09c0('0x4d')]['id']}})[_0x09c0('0x2c')](handleEntityNotFound(_0x270ff2,null))[_0x09c0('0x2c')](removeEntity(_0x270ff2,null))[_0x09c0('0x4c')](handleError(_0x270ff2,null));};exports[_0x09c0('0x56')]=function(_0x4c4339,_0x34cc0a){return db[_0x09c0('0x35')][_0x09c0('0x56')]()[_0x09c0('0x2c')](respondWithResult(_0x34cc0a,null))['catch'](handleError(_0x34cc0a,null));};exports[_0x09c0('0x57')]=function(_0x48dae0,_0x29205f,_0x9a4f4){if(_0x48dae0[_0x09c0('0x55')]['id']){delete _0x48dae0['body']['id'];}return db['CmList'][_0x09c0('0x4f')]({'where':{'id':_0x48dae0[_0x09c0('0x4d')]['id']}})[_0x09c0('0x2c')](handleEntityNotFound(_0x29205f,null))[_0x09c0('0x2c')](function(_0x4b65c7){if(_0x4b65c7){_0x48dae0[_0x09c0('0x55')][_0x09c0('0x58')]=_0x4b65c7['id'];return db['Disposition'][_0x09c0('0x50')](_0x48dae0[_0x09c0('0x55')]);}})[_0x09c0('0x2c')](respondWithResult(_0x29205f,null))[_0x09c0('0x4c')](handleError(_0x29205f,null));};exports['getDispositions']=function(_0x8d27a5,_0x24f23b,_0x3c3ad4){var _0x36c2f5={'raw':![],'where':{}};var _0x360924={};var _0x4613e0={'count':0x0,'rows':[]};return db[_0x09c0('0x35')][_0x09c0('0x59')]({'where':{'id':_0x8d27a5[_0x09c0('0x4d')]['id']}})[_0x09c0('0x2c')](handleEntityNotFound(_0x24f23b,null))[_0x09c0('0x2c')](function(_0x2906cb){if(_0x2906cb){_0x360924[_0x09c0('0x3d')]=_['keys'](db[_0x09c0('0x5a')][_0x09c0('0x36')]);_0x360924[_0x09c0('0x3a')]=_[_0x09c0('0x3b')](_0x8d27a5[_0x09c0('0x3a')]);_0x360924['filters']=_[_0x09c0('0x3c')](_0x360924[_0x09c0('0x3d')],_0x360924[_0x09c0('0x3a')]);_0x36c2f5[_0x09c0('0x3e')]=_['intersection'](_0x360924[_0x09c0('0x3d')],qs[_0x09c0('0x3f')](_0x8d27a5['query'][_0x09c0('0x3f')]));_0x36c2f5[_0x09c0('0x3e')]=_0x36c2f5[_0x09c0('0x3e')][_0x09c0('0x40')]?_0x36c2f5[_0x09c0('0x3e')]:_0x360924['model'];if(!_0x8d27a5[_0x09c0('0x3a')][_0x09c0('0x41')](_0x09c0('0x42'))){_0x36c2f5[_0x09c0('0x27')]=qs[_0x09c0('0x27')](_0x8d27a5['query'][_0x09c0('0x27')]);_0x36c2f5[_0x09c0('0x26')]=qs[_0x09c0('0x26')](_0x8d27a5[_0x09c0('0x3a')][_0x09c0('0x26')]);}_0x36c2f5[_0x09c0('0x43')]=qs['sort'](_0x8d27a5['query']['sort']);_0x36c2f5['where']=qs[_0x09c0('0x46')](_[_0x09c0('0x5b')](_0x8d27a5[_0x09c0('0x3a')],_0x360924['filters']));_0x36c2f5[_0x09c0('0x45')]['ListId']=_0x2906cb['id'];if(_0x8d27a5[_0x09c0('0x3a')][_0x09c0('0x49')]){_0x36c2f5['where']=_[_0x09c0('0x47')](_0x36c2f5['where'],{'$or':_['map'](_0x36c2f5[_0x09c0('0x3e')],function(_0x111647){var _0xde4ccc={};_0xde4ccc[_0x111647]={'$like':'%'+_0x8d27a5[_0x09c0('0x3a')][_0x09c0('0x49')]+'%'};return _0xde4ccc;})});}_0x36c2f5=_[_0x09c0('0x47')]({},_0x36c2f5,_0x8d27a5[_0x09c0('0x4e')]);return db[_0x09c0('0x5a')][_0x09c0('0x25')]({'where':_0x36c2f5[_0x09c0('0x45')]})['then'](function(_0x188af2){_0x4613e0[_0x09c0('0x25')]=_0x188af2;if(_0x8d27a5['query']['includeAll']){_0x36c2f5[_0x09c0('0x4b')]=[{'all':!![]}];}return db[_0x09c0('0x5a')][_0x09c0('0x5c')](_0x36c2f5);})[_0x09c0('0x2c')](function(_0x3310d2){_0x4613e0[_0x09c0('0x5d')]=_0x3310d2;return _0x4613e0;});}})[_0x09c0('0x2c')](respondWithFilteredResult(_0x24f23b,_0x36c2f5))['catch'](handleError(_0x24f23b,null));};exports[_0x09c0('0x5e')]=function(_0x56b94b,_0x399542,_0x1d1491){return db[_0x09c0('0x35')][_0x09c0('0x4f')]({'where':{'id':_0x56b94b[_0x09c0('0x4d')]['id']}})['then'](handleEntityNotFound(_0x399542,null))[_0x09c0('0x2c')](function(_0x4ce49a){if(_0x4ce49a){return _0x4ce49a[_0x09c0('0x5e')](_0x56b94b['query'][_0x09c0('0x5f')]);}})[_0x09c0('0x2c')](respondWithStatusCode(_0x399542,null))[_0x09c0('0x4c')](handleError(_0x399542,null));};exports[_0x09c0('0x60')]=function(_0x3a1bb0,_0x14629c,_0x29e16){return db['CmList']['find']({'where':{'id':_0x3a1bb0[_0x09c0('0x4d')]['id']}})[_0x09c0('0x2c')](handleEntityNotFound(_0x14629c,null))[_0x09c0('0x2c')](function(_0x309d0a){if(_0x309d0a){var _0x31ed01=[];var _0x1041d9={'success':[],'errors':[]};return db[_0x09c0('0x61')][_0x09c0('0x56')]()[_0x09c0('0x2c')](function(_0x2af2ad){if(_0x3a1bb0['body']['tags']&&_['isArray'](_0x3a1bb0[_0x09c0('0x55')][_0x09c0('0x62')])){if(_0x3a1bb0[_0x09c0('0x55')]['tags']['length']){_0x3a1bb0[_0x09c0('0x55')]['tags']=_0x3a1bb0[_0x09c0('0x55')][_0x09c0('0x62')]['join'](';')+';';}else{_0x3a1bb0[_0x09c0('0x55')]['tags']=null;}}else{_0x3a1bb0[_0x09c0('0x55')][_0x09c0('0x62')]=null;}if(_0x3a1bb0[_0x09c0('0x55')]&&_['isArray'](_0x3a1bb0[_0x09c0('0x55')])){for(var _0x456adf=0x0;_0x456adf<_0x3a1bb0[_0x09c0('0x55')][_0x09c0('0x40')];_0x456adf+=0x1){_0x3a1bb0[_0x09c0('0x55')][_0x456adf][_0x09c0('0x58')]=_0x3a1bb0[_0x09c0('0x4d')]['id'];_0x31ed01[_0x09c0('0x63')](_0x3a1bb0[_0x09c0('0x55')][_0x456adf]);}return BPromise[_0x09c0('0x64')](_0x31ed01,function(_0x22efe8){return db[_0x09c0('0x61')]['create'](_[_0x09c0('0x65')](_0x22efe8,[_0x09c0('0x5f'),'id'])||{},{'fields':_[_0x09c0('0x3b')](_0x2af2ad),'raw':!![]})[_0x09c0('0x2c')](function(_0x45233b){_0x1041d9['success'][_0x09c0('0x63')](_0x45233b['dataValues']);})['catch'](function(_0x97d2d){_0x1041d9[_0x09c0('0x66')][_0x09c0('0x63')]({'data':_0x22efe8,'error':_0x97d2d['message']});});})[_0x09c0('0x2c')](function(_0x18a821){return _0x1041d9;})[_0x09c0('0x4c')](function(_0x42f327){return _0x42f327;});}else{_0x14629c[_0x09c0('0x22')](0x190)[_0x09c0('0x23')]({'message':'Malformed\x20request\x20syntax'});}});}})[_0x09c0('0x2c')](respondWithResult(_0x14629c,null))[_0x09c0('0x4c')](handleError(_0x14629c,null));};exports['getContacts']=function(_0x7d7b3a,_0x3c7ba0,_0x582dfe){var _0x474053;return db[_0x09c0('0x35')][_0x09c0('0x4f')]({'where':{'id':_0x7d7b3a['params']['id']},'include':[{'model':db[_0x09c0('0x67')],'as':_0x09c0('0x68')}]})['then'](handleEntityNotFound(_0x3c7ba0,null))[_0x09c0('0x2c')](function(_0x17050c){if(_0x17050c){_0x474053=_0x17050c;return db[_0x09c0('0x61')][_0x09c0('0x36')];}})[_0x09c0('0x2c')](function(_0x34dd1d){if(_0x34dd1d){var _0x41b5a6={};var _0x2e9dfd={};_0x2e9dfd['model']=_[_0x09c0('0x69')](_[_0x09c0('0x3b')](_0x34dd1d),_[_0x09c0('0x34')](_0x474053['CustomFields'],function(_0x131e1a){return util[_0x09c0('0x6a')](_0x09c0('0x6b'),_0x131e1a['id']);}));_0x2e9dfd['query']=_[_0x09c0('0x3b')](_0x7d7b3a[_0x09c0('0x3a')]);_0x2e9dfd[_0x09c0('0x46')]=_[_0x09c0('0x3c')](_0x2e9dfd[_0x09c0('0x3d')],_0x2e9dfd[_0x09c0('0x3a')]);_0x41b5a6[_0x09c0('0x3e')]=_['intersection'](_0x2e9dfd[_0x09c0('0x3d')],qs[_0x09c0('0x3f')](_0x7d7b3a[_0x09c0('0x3a')][_0x09c0('0x3f')]));_0x41b5a6[_0x09c0('0x3e')]=_0x41b5a6[_0x09c0('0x3e')][_0x09c0('0x40')]?_0x41b5a6['attributes']:_0x2e9dfd[_0x09c0('0x3d')];if(!_0x7d7b3a[_0x09c0('0x3a')][_0x09c0('0x41')](_0x09c0('0x42'))){_0x41b5a6['limit']=qs['limit'](_0x7d7b3a[_0x09c0('0x3a')][_0x09c0('0x27')]);_0x41b5a6[_0x09c0('0x26')]=qs['offset'](_0x7d7b3a[_0x09c0('0x3a')][_0x09c0('0x26')]);}_0x41b5a6[_0x09c0('0x43')]=qs[_0x09c0('0x44')](_0x7d7b3a['query'][_0x09c0('0x44')]);_0x41b5a6[_0x09c0('0x45')]=qs['filters'](_[_0x09c0('0x5b')](_0x7d7b3a[_0x09c0('0x3a')],_0x2e9dfd[_0x09c0('0x46')]));_0x41b5a6[_0x09c0('0x6c')]=!![];if(_0x7d7b3a[_0x09c0('0x3a')]['filter']){_0x41b5a6[_0x09c0('0x45')]=_[_0x09c0('0x47')](_0x41b5a6['where'],{'$or':_[_0x09c0('0x34')](_0x41b5a6[_0x09c0('0x3e')],function(_0x450ce4){var _0x475a03={};_0x475a03[_0x450ce4]={'$like':'%'+_0x7d7b3a[_0x09c0('0x3a')][_0x09c0('0x49')]+'%'};return _0x475a03;})});}_0x41b5a6=_['merge']({},_0x41b5a6,_0x7d7b3a['options']);return _0x474053[_0x09c0('0x6d')](_0x41b5a6);}})[_0x09c0('0x2c')](respondWithResult(_0x3c7ba0,null))[_0x09c0('0x4c')](handleError(_0x3c7ba0,null));};exports[_0x09c0('0x6e')]=function(_0x2d8d0a,_0x2a17a0,_0x3db01d){var _0x24cbdf;var _0x1b9f57;var _0x71d7a7;var _0x3ba21d=_0x2d8d0a[_0x09c0('0x4d')]['id'];csv_results=[];return db[_0x09c0('0x6f')]['findAll']({'attributes':['id',_0x09c0('0x32')],'raw':!![],'order':['OrderBy']})[_0x09c0('0x2c')](function(_0x5af234){_0x24cbdf=_0x5af234;var _0x4ce059=_[_0x09c0('0x3b')](db[_0x09c0('0x61')][_0x09c0('0x36')]);return db[_0x09c0('0x67')][_0x09c0('0x5c')]({'raw':!![],'attributes':['id','alias']})['then'](function(_0x347f02){_0x1b9f57=_0x347f02;var _0x1f00a3=squel['select']()[_0x09c0('0x3f')](_0x4ce059)[_0x09c0('0x70')](_0x09c0('0x71'),'c')[_0x09c0('0x45')](_0x09c0('0x72'),_0x3ba21d)['distinct']();for(var _0x2b6a09=0x0;_0x2b6a09<_0x1b9f57[_0x09c0('0x40')];_0x2b6a09++){_0x1f00a3[_0x09c0('0x73')](_0x09c0('0x74')+_0x1b9f57[_0x2b6a09]['id'],'customField_'+_0x1b9f57[_0x2b6a09][_0x09c0('0x75')]);}for(var _0x2b6a09=0x0;_0x2b6a09<_0x24cbdf['length'];_0x2b6a09++){_0x1f00a3['field'](squel['select']()[_0x09c0('0x73')](_0x09c0('0x76'))[_0x09c0('0x70')](_0x09c0('0x77'))[_0x09c0('0x45')]('ItemTypeId\x20=\x20?',_0x24cbdf[_0x2b6a09]['id'])['where']('CmContactId\x20=\x20c.id'),'additionalPhone_'+_0x24cbdf[_0x2b6a09][_0x09c0('0x32')]);_0x1f00a3[_0x09c0('0x73')](squel[_0x09c0('0x78')]()[_0x09c0('0x73')](_0x09c0('0x79'))[_0x09c0('0x70')]('cm_contact_has_items')[_0x09c0('0x45')](_0x09c0('0x7a'),_0x24cbdf[_0x2b6a09]['id'])['where'](_0x09c0('0x7b')),_0x09c0('0x7c')+_0x24cbdf[_0x2b6a09]['name']);}var _0x3e00c6=[];_0x3e00c6[_0x09c0('0x63')](_0x1f00a3[_0x09c0('0x7d')]());BPromise[_0x09c0('0x64')](_0x3e00c6,handleQuery)['then'](function(_0x3d62ed){handleQuery(_0x1f00a3[_0x09c0('0x7d')]());var _0x2284ab=csv_results[0x0];if(!_[_0x09c0('0x7e')](_0x2284ab)){var _0x34e81d=toCsv(_0x2284ab);var _0x2c7c2c=Date['now']();fs['writeFileSync'](util[_0x09c0('0x6a')](_0x09c0('0x7f'),_0x3ba21d,_0x2c7c2c),_0x34e81d);_0x2a17a0[_0x09c0('0x80')](_0x09c0('0x81'),_0x09c0('0x82')+util[_0x09c0('0x6a')](_0x09c0('0x83'),_0x3ba21d,_0x2c7c2c));_0x2a17a0[_0x09c0('0x80')]('Content-type','text/csv');return _0x2a17a0[_0x09c0('0x84')](util['format'](_0x09c0('0x7f'),_0x3ba21d,_0x2c7c2c));}else{return _0x2a17a0[_0x09c0('0x21')](0xcc);}});});});};exports['addCustomField']=function(_0x33af87,_0x5f3c92,_0x4a9e7c){var _0x8ffc99;delete _0x33af87[_0x09c0('0x55')]['id'];return db['CmList'][_0x09c0('0x59')]({'where':{'id':_0x33af87[_0x09c0('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5f3c92,null))[_0x09c0('0x2c')](function(_0x2c784b){if(_0x2c784b){return db[_0x09c0('0x85')][_0x09c0('0x86')](function(_0xe3213a){return db['CmCustomField'][_0x09c0('0x50')](_0x33af87['body'],{'transaction':_0xe3213a})[_0x09c0('0x2c')](function(_0x445994){_0x8ffc99=_0x445994;return _0x2c784b[_0x09c0('0x87')](_0x445994,{'transaction':_0xe3213a});})['then'](function(){var _0x558e2e={'type':db[_0x09c0('0x88')]['TEXT'],'transaction':_0xe3213a};switch(_0x33af87[_0x09c0('0x55')][_0x09c0('0x38')]){case _0x09c0('0x89'):_0x558e2e[_0x09c0('0x38')]=db[_0x09c0('0x88')][_0x09c0('0x8a')];break;case _0x09c0('0x8b'):_0x558e2e['type']=db[_0x09c0('0x88')][_0x09c0('0x8c')];break;case'switch':_0x558e2e['type']=db[_0x09c0('0x88')]['BOOLEAN'];_0x558e2e[_0x09c0('0x8d')]=![];break;default:}return db[_0x09c0('0x85')][_0x09c0('0x8e')][_0x09c0('0x8f')]('cm_contacts',util[_0x09c0('0x6a')](_0x09c0('0x90'),_0x8ffc99['id']),_0x558e2e);})[_0x09c0('0x2c')](function(){return _0x8ffc99;});});}})['then'](respondWithResult(_0x5f3c92,null))[_0x09c0('0x4c')](handleError(_0x5f3c92,null));};exports['getCustomFields']=function(_0x22df6d,_0x27de30,_0x2deeee){var _0x6cc6d8={};var _0x1b333c={};var _0x186280;var _0x5ae22c;return db[_0x09c0('0x35')][_0x09c0('0x59')]({'where':{'id':_0x22df6d['params']['id']}})[_0x09c0('0x2c')](handleEntityNotFound(_0x27de30,null))['then'](function(_0x3058c4){if(_0x3058c4){_0x186280=_0x3058c4;_0x1b333c[_0x09c0('0x3d')]=_[_0x09c0('0x3b')](db[_0x09c0('0x67')][_0x09c0('0x36')]);_0x1b333c[_0x09c0('0x3a')]=_['keys'](_0x22df6d[_0x09c0('0x3a')]);_0x1b333c[_0x09c0('0x46')]=_[_0x09c0('0x3c')](_0x1b333c[_0x09c0('0x3d')],_0x1b333c['query']);_0x6cc6d8[_0x09c0('0x3e')]=_[_0x09c0('0x3c')](_0x1b333c[_0x09c0('0x3d')],qs[_0x09c0('0x3f')](_0x22df6d['query'][_0x09c0('0x3f')]));_0x6cc6d8[_0x09c0('0x3e')]=_0x6cc6d8['attributes'][_0x09c0('0x40')]?_0x6cc6d8[_0x09c0('0x3e')]:_0x1b333c['model'];_0x6cc6d8[_0x09c0('0x43')]=qs[_0x09c0('0x44')](_0x22df6d[_0x09c0('0x3a')][_0x09c0('0x44')]);_0x6cc6d8[_0x09c0('0x45')]=qs[_0x09c0('0x46')](_[_0x09c0('0x5b')](_0x22df6d['query'],_0x1b333c[_0x09c0('0x46')]));_0x6cc6d8['where']=_['merge'](_0x6cc6d8[_0x09c0('0x45')],{'$or':[{'ListId':_0x3058c4['id']},{'ListId':null}]});if(_0x22df6d[_0x09c0('0x3a')]['filter']){_0x6cc6d8[_0x09c0('0x45')]=_[_0x09c0('0x47')](_0x6cc6d8['where'],{'$or':_[_0x09c0('0x34')](_0x6cc6d8['attributes'],function(_0x3f194f){var _0x306a54={};_0x306a54[_0x3f194f]={'$like':'%'+_0x22df6d[_0x09c0('0x3a')][_0x09c0('0x49')]+'%'};return _0x306a54;})});}_0x6cc6d8=_[_0x09c0('0x47')]({},_0x6cc6d8,_0x22df6d[_0x09c0('0x4e')]);return db[_0x09c0('0x67')][_0x09c0('0x91')](_0x6cc6d8);}})[_0x09c0('0x2c')](respondWithResult(_0x27de30,null))[_0x09c0('0x4c')](handleError(_0x27de30,null));};exports[_0x09c0('0x92')]=function(_0x11ab24,_0x51df74,_0x18acaf){return db[_0x09c0('0x35')][_0x09c0('0x4f')]({'where':{'id':_0x11ab24['params']['id']}})[_0x09c0('0x2c')](handleEntityNotFound(_0x51df74,null))['then'](function(_0x54728b){if(_0x54728b){return _0x54728b[_0x09c0('0x92')](_0x11ab24['body'][_0x09c0('0x5f')],_[_0x09c0('0x65')](_0x11ab24[_0x09c0('0x55')],[_0x09c0('0x5f'),'id'])||{})[_0x09c0('0x93')](function(_0x39a238){for(var _0x461ad4=0x0;_0x461ad4<_0x11ab24['body'][_0x09c0('0x5f')][_0x09c0('0x40')];_0x461ad4+=0x1){socket[_0x09c0('0x94')](_0x09c0('0x95'),{'UserId':Number(_0x11ab24[_0x09c0('0x55')][_0x09c0('0x5f')][_0x461ad4]),'CmListId':Number(_0x11ab24[_0x09c0('0x4d')]['id'])});}return _0x39a238;});}})[_0x09c0('0x2c')](respondWithResult(_0x51df74,null))[_0x09c0('0x4c')](handleError(_0x51df74,null));};exports[_0x09c0('0x96')]=function(_0x1caaeb,_0x1578c1,_0x1c52cf){return db[_0x09c0('0x35')][_0x09c0('0x4f')]({'where':{'id':_0x1caaeb[_0x09c0('0x4d')]['id']}})[_0x09c0('0x2c')](handleEntityNotFound(_0x1578c1,null))['then'](function(_0x3135b5){if(_0x3135b5){return _0x3135b5[_0x09c0('0x96')](_0x1caaeb[_0x09c0('0x3a')]['ids'])[_0x09c0('0x2c')](function(){if(_[_0x09c0('0x97')](_0x1caaeb[_0x09c0('0x3a')]['ids'])){for(var _0x2979ec=0x0;_0x2979ec<_0x1caaeb[_0x09c0('0x3a')][_0x09c0('0x5f')][_0x09c0('0x40')];_0x2979ec+=0x1){socket[_0x09c0('0x94')](_0x09c0('0x98'),{'UserId':Number(_0x1caaeb[_0x09c0('0x3a')][_0x09c0('0x5f')][_0x2979ec]),'CmListId':Number(_0x1caaeb[_0x09c0('0x4d')]['id'])});}}else{socket[_0x09c0('0x94')]('userCmList:remove',{'UserId':Number(_0x1caaeb[_0x09c0('0x3a')]['ids']),'CmListId':Number(_0x1caaeb[_0x09c0('0x4d')]['id'])});}});}})[_0x09c0('0x2c')](respondWithStatusCode(_0x1578c1,null))['catch'](handleError(_0x1578c1,null));};exports[_0x09c0('0x99')]=function(_0x425488,_0x450414,_0x57653e){var _0x1ba8eb={};var _0x468d78={};var _0x1aa32f;var _0x2eb784;return db[_0x09c0('0x35')][_0x09c0('0x59')]({'where':{'id':_0x425488[_0x09c0('0x4d')]['id']}})[_0x09c0('0x2c')](handleEntityNotFound(_0x450414,null))[_0x09c0('0x2c')](function(_0x2179e0){if(_0x2179e0){_0x1aa32f=_0x2179e0;_0x468d78['model']=_['keys'](db['User'][_0x09c0('0x36')]);_0x468d78[_0x09c0('0x3a')]=_['keys'](_0x425488[_0x09c0('0x3a')]);_0x468d78[_0x09c0('0x46')]=_[_0x09c0('0x3c')](_0x468d78[_0x09c0('0x3d')],_0x468d78[_0x09c0('0x3a')]);_0x1ba8eb[_0x09c0('0x3e')]=_[_0x09c0('0x3c')](_0x468d78[_0x09c0('0x3d')],qs[_0x09c0('0x3f')](_0x425488[_0x09c0('0x3a')][_0x09c0('0x3f')]));_0x1ba8eb[_0x09c0('0x3e')]=_0x1ba8eb['attributes'][_0x09c0('0x40')]?_0x1ba8eb[_0x09c0('0x3e')]:_0x468d78[_0x09c0('0x3d')];_0x1ba8eb[_0x09c0('0x43')]=qs[_0x09c0('0x44')](_0x425488[_0x09c0('0x3a')][_0x09c0('0x44')]);_0x1ba8eb[_0x09c0('0x45')]=qs[_0x09c0('0x46')](_[_0x09c0('0x5b')](_0x425488[_0x09c0('0x3a')],_0x468d78['filters']));if(_0x425488[_0x09c0('0x3a')][_0x09c0('0x49')]){_0x1ba8eb[_0x09c0('0x45')]=_['merge'](_0x1ba8eb[_0x09c0('0x45')],{'$or':_[_0x09c0('0x34')](_0x1ba8eb[_0x09c0('0x3e')],function(_0x2f9b5e){var _0x22ebcc={};_0x22ebcc[_0x2f9b5e]={'$like':'%'+_0x425488['query'][_0x09c0('0x49')]+'%'};return _0x22ebcc;})});}_0x1ba8eb=_[_0x09c0('0x47')]({},_0x1ba8eb,_0x425488[_0x09c0('0x4e')]);return _0x1aa32f[_0x09c0('0x99')](_0x1ba8eb);}})[_0x09c0('0x2c')](function(_0x18710c){if(_0x18710c){_0x2eb784=_0x18710c[_0x09c0('0x40')];if(!_0x425488['query'][_0x09c0('0x41')](_0x09c0('0x42'))){_0x1ba8eb[_0x09c0('0x27')]=qs['limit'](_0x425488[_0x09c0('0x3a')][_0x09c0('0x27')]);_0x1ba8eb[_0x09c0('0x26')]=qs[_0x09c0('0x26')](_0x425488[_0x09c0('0x3a')][_0x09c0('0x26')]);}return _0x1aa32f[_0x09c0('0x99')](_0x1ba8eb);}})[_0x09c0('0x2c')](function(_0x47ebdb){if(_0x47ebdb){return _0x47ebdb?{'count':_0x2eb784,'rows':_0x47ebdb}:null;}})['then'](respondWithResult(_0x450414,null))[_0x09c0('0x4c')](handleError(_0x450414,null));};function handleQuery(_0x4f1145){logger[_0x09c0('0x9a')](_0x4f1145);return db['sequelize'][_0x09c0('0x3a')](_0x4f1145)[_0x09c0('0x93')](function(_0x5dd07a){csv_results[_0x09c0('0x63')](_0x5dd07a);})[_0x09c0('0x4c')](function(_0x31f7b4){logger[_0x09c0('0x31')](_0x31f7b4[_0x09c0('0x9b')]);});} \ No newline at end of file +var _0xb03e=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Lists','error','stack','index','CmList','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','name','options','includeAll','include','findAll','rows','catch','show','keys','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','ListId','Disposition','getDispositions','findOne','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','push','omit','success','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CustomFields','concat','cf_%d','raw','getContactsCsv','ContactItemType','OrderBy','CmCustomField','alias','select','from','cm_contacts','c.ListId\x20=\x20?','distinct','c.cf_','field','item','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','description','description_additionalPhone_','toString','now','format','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','sendStatus','addCustomField','transaction','addCustomFields','Sequelize','TEXT','text','number','INTEGER','BOOLEAN','defaultValue','sequelize','queryInterface','addColumn','cf_%s','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis'];(function(_0x4da344,_0x5e8c29){var _0x26ec89=function(_0x33295d){while(--_0x33295d){_0x4da344['push'](_0x4da344['shift']());}};_0x26ec89(++_0x5e8c29);}(_0xb03e,0x1eb));var _0xeb03=function(_0x2e9e95,_0x368cfb){_0x2e9e95=_0x2e9e95-0x0;var _0x452e39=_0xb03e[_0x2e9e95];return _0x452e39;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xeb03('0x0'));var zipdir=require(_0xeb03('0x1'));var jsonpatch=require(_0xeb03('0x2'));var rp=require(_0xeb03('0x3'));var moment=require(_0xeb03('0x4'));var BPromise=require(_0xeb03('0x5'));var Mustache=require(_0xeb03('0x6'));var util=require(_0xeb03('0x7'));var path=require(_0xeb03('0x8'));var sox=require(_0xeb03('0x9'));var csv=require(_0xeb03('0xa'));var ejs=require(_0xeb03('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeb03('0xc'));var squel=require(_0xeb03('0xd'));var crypto=require(_0xeb03('0xe'));var jsforce=require(_0xeb03('0xf'));var deskjs=require(_0xeb03('0x10'));var toCsv=require(_0xeb03('0xa'));var querystring=require('querystring');var Papa=require(_0xeb03('0x11'));var Redis=require(_0xeb03('0x12'));var authService=require(_0xeb03('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xeb03('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xeb03('0x15'))(_0xeb03('0x16'));var utils=require(_0xeb03('0x17'));var config=require(_0xeb03('0x18'));var licenseUtil=require(_0xeb03('0x19'));var db=require(_0xeb03('0x1a'))['db'];var csv_results;config[_0xeb03('0x1b')]=_[_0xeb03('0x1c')](config[_0xeb03('0x1b')],{'host':_0xeb03('0x1d'),'port':0x18eb});var socket=require(_0xeb03('0x1e'))(new Redis(config[_0xeb03('0x1b')]));require('./cmList.socket')[_0xeb03('0x1f')](socket);function respondWithStatusCode(_0x100bef,_0x372c71){_0x372c71=_0x372c71||0xcc;return function(_0x33f9ba){if(_0x33f9ba){return _0x100bef['sendStatus'](_0x372c71);}return _0x100bef[_0xeb03('0x20')](_0x372c71)[_0xeb03('0x21')]();};}function respondWithResult(_0x3f26ef,_0x478989){_0x478989=_0x478989||0xc8;return function(_0x7ce874){if(_0x7ce874){return _0x3f26ef[_0xeb03('0x20')](_0x478989)[_0xeb03('0x22')](_0x7ce874);}};}function respondWithFilteredResult(_0x44716c,_0x42fa4e){return function(_0x1b4cbd){if(_0x1b4cbd){var _0x167a33=typeof _0x42fa4e[_0xeb03('0x23')]===_0xeb03('0x24')&&typeof _0x42fa4e[_0xeb03('0x25')]===_0xeb03('0x24');var _0x2c238d=_0x1b4cbd[_0xeb03('0x26')];var _0x19bddf=_0x167a33?0x0:_0x42fa4e['offset'];var _0x1bea3f=_0x167a33?_0x1b4cbd[_0xeb03('0x26')]:_0x42fa4e[_0xeb03('0x23')]+_0x42fa4e[_0xeb03('0x25')];var _0xe5a1c2;if(_0x1bea3f>=_0x2c238d){_0x1bea3f=_0x2c238d;_0xe5a1c2=0xc8;}else{_0xe5a1c2=0xce;}_0x44716c[_0xeb03('0x20')](_0xe5a1c2);return _0x44716c[_0xeb03('0x27')](_0xeb03('0x28'),_0x19bddf+'-'+_0x1bea3f+'/'+_0x2c238d)[_0xeb03('0x22')](_0x1b4cbd);}return null;};}function patchUpdates(_0x5a704b){return function(_0x712ac2){try{jsonpatch[_0xeb03('0x29')](_0x712ac2,_0x5a704b,!![]);}catch(_0x11ea85){return BPromise[_0xeb03('0x2a')](_0x11ea85);}return _0x712ac2[_0xeb03('0x2b')]();};}function saveUpdates(_0x5dcda3,_0x638353){return function(_0x406864){if(_0x406864){return _0x406864[_0xeb03('0x2c')](_0x5dcda3)[_0xeb03('0x2d')](function(_0x3f276a){return _0x3f276a;});}return null;};}function removeEntity(_0x119697,_0xb04f34){return function(_0x3f68f3){if(_0x3f68f3){return _0x3f68f3[_0xeb03('0x2e')]()['then'](function(){var _0x832372=_0x3f68f3[_0xeb03('0x2f')]({'plain':!![]});var _0x2683f9=_0xeb03('0x30');return db['UserProfileResource']['destroy']({'where':{'type':_0x2683f9,'resourceId':_0x832372['id']}})[_0xeb03('0x2d')](function(){return _0x3f68f3;});})['then'](function(){_0x119697[_0xeb03('0x20')](0xcc)[_0xeb03('0x21')]();});}};}function handleEntityNotFound(_0x160a37,_0x5db8bb){return function(_0xd4c8ec){if(!_0xd4c8ec){_0x160a37['sendStatus'](0x194);}return _0xd4c8ec;};}function handleError(_0x5cb729,_0x49e316){_0x49e316=_0x49e316||0x1f4;return function(_0x538d19){logger[_0xeb03('0x31')](_0x538d19[_0xeb03('0x32')]);if(_0x538d19['name']){delete _0x538d19['name'];}_0x5cb729['status'](_0x49e316)['send'](_0x538d19);};}exports[_0xeb03('0x33')]=function(_0x3655c3,_0x32aff7){var _0x2d2ddd={},_0x19fa35={},_0x5234dc={'count':0x0,'rows':[]};var _0x13efc6=_['map'](db[_0xeb03('0x34')][_0xeb03('0x35')],function(_0x19ceae){return{'name':_0x19ceae[_0xeb03('0x36')],'type':_0x19ceae[_0xeb03('0x37')][_0xeb03('0x38')]};});_0x19fa35[_0xeb03('0x39')]=_[_0xeb03('0x3a')](_0x13efc6,'name');_0x19fa35[_0xeb03('0x3b')]=_['keys'](_0x3655c3[_0xeb03('0x3b')]);_0x19fa35[_0xeb03('0x3c')]=_[_0xeb03('0x3d')](_0x19fa35[_0xeb03('0x39')],_0x19fa35[_0xeb03('0x3b')]);_0x2d2ddd[_0xeb03('0x3e')]=_['intersection'](_0x19fa35[_0xeb03('0x39')],qs['fields'](_0x3655c3['query']['fields']));_0x2d2ddd[_0xeb03('0x3e')]=_0x2d2ddd[_0xeb03('0x3e')][_0xeb03('0x3f')]?_0x2d2ddd[_0xeb03('0x3e')]:_0x19fa35[_0xeb03('0x39')];if(!_0x3655c3['query'][_0xeb03('0x40')](_0xeb03('0x41'))){_0x2d2ddd[_0xeb03('0x25')]=qs['limit'](_0x3655c3['query'][_0xeb03('0x25')]);_0x2d2ddd[_0xeb03('0x23')]=qs[_0xeb03('0x23')](_0x3655c3['query'][_0xeb03('0x23')]);}_0x2d2ddd[_0xeb03('0x42')]=qs['sort'](_0x3655c3['query'][_0xeb03('0x43')]);_0x2d2ddd[_0xeb03('0x44')]=qs['filters'](_[_0xeb03('0x45')](_0x3655c3[_0xeb03('0x3b')],_0x19fa35[_0xeb03('0x3c')]),_0x13efc6);if(_0x3655c3[_0xeb03('0x3b')][_0xeb03('0x46')]){_0x2d2ddd[_0xeb03('0x44')]=_[_0xeb03('0x47')](_0x2d2ddd[_0xeb03('0x44')],{'$or':_[_0xeb03('0x3a')](_0x13efc6,function(_0x286f48){if(_0x286f48[_0xeb03('0x37')]!==_0xeb03('0x48')){var _0x2a9348={};_0x2a9348[_0x286f48[_0xeb03('0x49')]]={'$like':'%'+_0x3655c3[_0xeb03('0x3b')][_0xeb03('0x46')]+'%'};return _0x2a9348;}})});}_0x2d2ddd=_[_0xeb03('0x47')]({},_0x2d2ddd,_0x3655c3[_0xeb03('0x4a')]);var _0x35e53d={'where':_0x2d2ddd[_0xeb03('0x44')]};return db[_0xeb03('0x34')][_0xeb03('0x26')](_0x35e53d)[_0xeb03('0x2d')](function(_0x5bb7d9){_0x5234dc['count']=_0x5bb7d9;if(_0x3655c3[_0xeb03('0x3b')][_0xeb03('0x4b')]){_0x2d2ddd[_0xeb03('0x4c')]=[{'all':!![]}];}return db[_0xeb03('0x34')][_0xeb03('0x4d')](_0x2d2ddd);})[_0xeb03('0x2d')](function(_0x103c78){_0x5234dc[_0xeb03('0x4e')]=_0x103c78;return _0x5234dc;})['then'](respondWithFilteredResult(_0x32aff7,_0x2d2ddd))[_0xeb03('0x4f')](handleError(_0x32aff7,null));};exports[_0xeb03('0x50')]=function(_0x275d4d,_0xe9dcb0){var _0x528c0f={'raw':![],'where':{'id':_0x275d4d['params']['id']}},_0x57f59e={};_0x57f59e[_0xeb03('0x39')]=_['keys'](db['CmList']['rawAttributes']);_0x57f59e[_0xeb03('0x3b')]=_[_0xeb03('0x51')](_0x275d4d[_0xeb03('0x3b')]);_0x57f59e[_0xeb03('0x3c')]=_[_0xeb03('0x3d')](_0x57f59e[_0xeb03('0x39')],_0x57f59e['query']);_0x528c0f[_0xeb03('0x3e')]=_['intersection'](_0x57f59e['model'],qs[_0xeb03('0x52')](_0x275d4d[_0xeb03('0x3b')][_0xeb03('0x52')]));_0x528c0f['attributes']=_0x528c0f[_0xeb03('0x3e')][_0xeb03('0x3f')]?_0x528c0f[_0xeb03('0x3e')]:_0x57f59e[_0xeb03('0x39')];if(_0x275d4d[_0xeb03('0x3b')]['includeAll']){_0x528c0f[_0xeb03('0x4c')]=[{'all':!![]}];}_0x528c0f=_['merge']({},_0x528c0f,_0x275d4d[_0xeb03('0x4a')]);return db[_0xeb03('0x34')][_0xeb03('0x53')](_0x528c0f)[_0xeb03('0x2d')](handleEntityNotFound(_0xe9dcb0,null))[_0xeb03('0x2d')](respondWithResult(_0xe9dcb0,null))[_0xeb03('0x4f')](handleError(_0xe9dcb0,null));};exports[_0xeb03('0x54')]=function(_0x292319,_0x38c993){return db[_0xeb03('0x34')][_0xeb03('0x54')](_0x292319[_0xeb03('0x55')],{})[_0xeb03('0x2d')](function(_0x345a98){var _0x2a7eaf=_0x292319[_0xeb03('0x56')][_0xeb03('0x2f')]({'plain':!![]});if(!_0x2a7eaf)throw new Error(_0xeb03('0x57'));if(_0x2a7eaf[_0xeb03('0x58')]===_0xeb03('0x56')){var _0x353e29=_0x345a98[_0xeb03('0x2f')]({'plain':!![]});var _0x1761ab=_0xeb03('0x30');return db['UserProfileSection'][_0xeb03('0x53')]({'where':{'name':_0x1761ab,'userProfileId':_0x2a7eaf[_0xeb03('0x59')]},'raw':!![]})[_0xeb03('0x2d')](function(_0x5405b4){if(_0x5405b4&&_0x5405b4[_0xeb03('0x5a')]===0x0){return db[_0xeb03('0x5b')][_0xeb03('0x54')]({'name':_0x353e29[_0xeb03('0x49')],'resourceId':_0x353e29['id'],'type':_0x5405b4[_0xeb03('0x49')],'sectionId':_0x5405b4['id']},{})[_0xeb03('0x2d')](function(){return _0x345a98;});}else{return _0x345a98;}})[_0xeb03('0x4f')](function(_0x36f18e){logger[_0xeb03('0x31')](_0xeb03('0x5c'),_0x36f18e);throw _0x36f18e;});}return _0x345a98;})[_0xeb03('0x2d')](respondWithResult(_0x38c993,0xc9))[_0xeb03('0x4f')](handleError(_0x38c993,null));};exports[_0xeb03('0x2c')]=function(_0xd4ecb3,_0x571934){if(_0xd4ecb3[_0xeb03('0x55')]['id']){delete _0xd4ecb3[_0xeb03('0x55')]['id'];}return db[_0xeb03('0x34')][_0xeb03('0x53')]({'where':{'id':_0xd4ecb3[_0xeb03('0x5d')]['id']}})[_0xeb03('0x2d')](handleEntityNotFound(_0x571934,null))[_0xeb03('0x2d')](saveUpdates(_0xd4ecb3[_0xeb03('0x55')],null))[_0xeb03('0x2d')](respondWithResult(_0x571934,null))[_0xeb03('0x4f')](handleError(_0x571934,null));};exports['destroy']=function(_0x40a270,_0x3a1cd2){return db[_0xeb03('0x34')][_0xeb03('0x53')]({'where':{'id':_0x40a270['params']['id']}})[_0xeb03('0x2d')](handleEntityNotFound(_0x3a1cd2,null))[_0xeb03('0x2d')](removeEntity(_0x3a1cd2,null))[_0xeb03('0x4f')](handleError(_0x3a1cd2,null));};exports[_0xeb03('0x5e')]=function(_0x17a00f,_0x4aa96e){return db[_0xeb03('0x34')][_0xeb03('0x5e')]()[_0xeb03('0x2d')](respondWithResult(_0x4aa96e,null))['catch'](handleError(_0x4aa96e,null));};exports[_0xeb03('0x5f')]=function(_0x45dd25,_0x4d9cfc,_0x1f6117){if(_0x45dd25[_0xeb03('0x55')]['id']){delete _0x45dd25[_0xeb03('0x55')]['id'];}return db['CmList'][_0xeb03('0x53')]({'where':{'id':_0x45dd25[_0xeb03('0x5d')]['id']}})['then'](handleEntityNotFound(_0x4d9cfc,null))[_0xeb03('0x2d')](function(_0xfeb8e2){if(_0xfeb8e2){_0x45dd25[_0xeb03('0x55')][_0xeb03('0x60')]=_0xfeb8e2['id'];return db[_0xeb03('0x61')][_0xeb03('0x54')](_0x45dd25[_0xeb03('0x55')]);}})[_0xeb03('0x2d')](respondWithResult(_0x4d9cfc,null))['catch'](handleError(_0x4d9cfc,null));};exports[_0xeb03('0x62')]=function(_0x50489b,_0xbcc043,_0x10343a){var _0x3a9518={'raw':![],'where':{}};var _0x59d0c7={};var _0x1bd1b3={'count':0x0,'rows':[]};return db[_0xeb03('0x34')][_0xeb03('0x63')]({'where':{'id':_0x50489b[_0xeb03('0x5d')]['id']}})['then'](handleEntityNotFound(_0xbcc043,null))[_0xeb03('0x2d')](function(_0x1cdf8e){if(_0x1cdf8e){_0x59d0c7['model']=_['keys'](db['Disposition'][_0xeb03('0x35')]);_0x59d0c7[_0xeb03('0x3b')]=_[_0xeb03('0x51')](_0x50489b[_0xeb03('0x3b')]);_0x59d0c7[_0xeb03('0x3c')]=_[_0xeb03('0x3d')](_0x59d0c7[_0xeb03('0x39')],_0x59d0c7[_0xeb03('0x3b')]);_0x3a9518[_0xeb03('0x3e')]=_['intersection'](_0x59d0c7['model'],qs[_0xeb03('0x52')](_0x50489b[_0xeb03('0x3b')]['fields']));_0x3a9518[_0xeb03('0x3e')]=_0x3a9518[_0xeb03('0x3e')][_0xeb03('0x3f')]?_0x3a9518[_0xeb03('0x3e')]:_0x59d0c7['model'];if(!_0x50489b['query'][_0xeb03('0x40')](_0xeb03('0x41'))){_0x3a9518[_0xeb03('0x25')]=qs[_0xeb03('0x25')](_0x50489b[_0xeb03('0x3b')][_0xeb03('0x25')]);_0x3a9518[_0xeb03('0x23')]=qs[_0xeb03('0x23')](_0x50489b[_0xeb03('0x3b')][_0xeb03('0x23')]);}_0x3a9518[_0xeb03('0x42')]=qs['sort'](_0x50489b['query'][_0xeb03('0x43')]);_0x3a9518['where']=qs[_0xeb03('0x3c')](_['pick'](_0x50489b[_0xeb03('0x3b')],_0x59d0c7['filters']));_0x3a9518[_0xeb03('0x44')][_0xeb03('0x60')]=_0x1cdf8e['id'];if(_0x50489b['query'][_0xeb03('0x46')]){_0x3a9518['where']=_[_0xeb03('0x47')](_0x3a9518['where'],{'$or':_[_0xeb03('0x3a')](_0x3a9518['attributes'],function(_0x53ed45){var _0x2d4b1f={};_0x2d4b1f[_0x53ed45]={'$like':'%'+_0x50489b[_0xeb03('0x3b')][_0xeb03('0x46')]+'%'};return _0x2d4b1f;})});}_0x3a9518=_[_0xeb03('0x47')]({},_0x3a9518,_0x50489b[_0xeb03('0x4a')]);return db[_0xeb03('0x61')][_0xeb03('0x26')]({'where':_0x3a9518['where']})[_0xeb03('0x2d')](function(_0x16ed3f){_0x1bd1b3[_0xeb03('0x26')]=_0x16ed3f;if(_0x50489b[_0xeb03('0x3b')][_0xeb03('0x4b')]){_0x3a9518[_0xeb03('0x4c')]=[{'all':!![]}];}return db[_0xeb03('0x61')]['findAll'](_0x3a9518);})[_0xeb03('0x2d')](function(_0x24ddeb){_0x1bd1b3[_0xeb03('0x4e')]=_0x24ddeb;return _0x1bd1b3;});}})[_0xeb03('0x2d')](respondWithFilteredResult(_0xbcc043,_0x3a9518))[_0xeb03('0x4f')](handleError(_0xbcc043,null));};exports[_0xeb03('0x64')]=function(_0x3b3f90,_0xe42b85,_0x4f8d9a){return db[_0xeb03('0x34')][_0xeb03('0x53')]({'where':{'id':_0x3b3f90[_0xeb03('0x5d')]['id']}})[_0xeb03('0x2d')](handleEntityNotFound(_0xe42b85,null))[_0xeb03('0x2d')](function(_0x5ace77){if(_0x5ace77){return _0x5ace77[_0xeb03('0x64')](_0x3b3f90[_0xeb03('0x3b')][_0xeb03('0x65')]);}})[_0xeb03('0x2d')](respondWithStatusCode(_0xe42b85,null))[_0xeb03('0x4f')](handleError(_0xe42b85,null));};exports[_0xeb03('0x66')]=function(_0x39ec6e,_0x4c3b3d,_0x52b2c){return db[_0xeb03('0x34')][_0xeb03('0x53')]({'where':{'id':_0x39ec6e[_0xeb03('0x5d')]['id']}})[_0xeb03('0x2d')](handleEntityNotFound(_0x4c3b3d,null))['then'](function(_0x339bf1){if(_0x339bf1){var _0xce144f=[];var _0xfc8ac5={'success':[],'errors':[]};return db[_0xeb03('0x67')][_0xeb03('0x5e')]()[_0xeb03('0x2d')](function(_0x1caa47){if(_0x39ec6e['body'][_0xeb03('0x68')]&&_[_0xeb03('0x69')](_0x39ec6e[_0xeb03('0x55')][_0xeb03('0x68')])){if(_0x39ec6e[_0xeb03('0x55')][_0xeb03('0x68')]['length']){_0x39ec6e[_0xeb03('0x55')][_0xeb03('0x68')]=_0x39ec6e[_0xeb03('0x55')]['tags'][_0xeb03('0x6a')](';')+';';}else{_0x39ec6e[_0xeb03('0x55')][_0xeb03('0x68')]=null;}}else{_0x39ec6e[_0xeb03('0x55')][_0xeb03('0x68')]=null;}if(_0x39ec6e[_0xeb03('0x55')]&&_[_0xeb03('0x69')](_0x39ec6e['body'])){for(var _0x5ec4b5=0x0;_0x5ec4b5<_0x39ec6e[_0xeb03('0x55')][_0xeb03('0x3f')];_0x5ec4b5+=0x1){_0x39ec6e[_0xeb03('0x55')][_0x5ec4b5][_0xeb03('0x60')]=_0x39ec6e['params']['id'];_0xce144f[_0xeb03('0x6b')](_0x39ec6e[_0xeb03('0x55')][_0x5ec4b5]);}return BPromise['each'](_0xce144f,function(_0x45fd83){return db[_0xeb03('0x67')][_0xeb03('0x54')](_[_0xeb03('0x6c')](_0x45fd83,[_0xeb03('0x65'),'id'])||{},{'fields':_[_0xeb03('0x51')](_0x1caa47),'raw':!![]})['then'](function(_0x3cc7b0){_0xfc8ac5[_0xeb03('0x6d')][_0xeb03('0x6b')](_0x3cc7b0[_0xeb03('0x6e')]);})[_0xeb03('0x4f')](function(_0x2f60b4){_0xfc8ac5[_0xeb03('0x6f')][_0xeb03('0x6b')]({'data':_0x45fd83,'error':_0x2f60b4[_0xeb03('0x70')]});});})[_0xeb03('0x2d')](function(_0x5dbc4e){return _0xfc8ac5;})[_0xeb03('0x4f')](function(_0x4416aa){return _0x4416aa;});}else{_0x4c3b3d['status'](0x190)[_0xeb03('0x22')]({'message':_0xeb03('0x71')});}});}})['then'](respondWithResult(_0x4c3b3d,null))[_0xeb03('0x4f')](handleError(_0x4c3b3d,null));};exports[_0xeb03('0x72')]=function(_0x2385e9,_0x247b4c,_0x1286e3){var _0x501a3b;return db['CmList']['find']({'where':{'id':_0x2385e9[_0xeb03('0x5d')]['id']},'include':[{'model':db['CmCustomField'],'as':_0xeb03('0x73')}]})[_0xeb03('0x2d')](handleEntityNotFound(_0x247b4c,null))[_0xeb03('0x2d')](function(_0x37e510){if(_0x37e510){_0x501a3b=_0x37e510;return db[_0xeb03('0x67')][_0xeb03('0x35')];}})[_0xeb03('0x2d')](function(_0x45a041){if(_0x45a041){var _0x25e79e={};var _0x734ac2={};_0x734ac2[_0xeb03('0x39')]=_[_0xeb03('0x74')](_['keys'](_0x45a041),_['map'](_0x501a3b[_0xeb03('0x73')],function(_0x5ea58f){return util['format'](_0xeb03('0x75'),_0x5ea58f['id']);}));_0x734ac2[_0xeb03('0x3b')]=_['keys'](_0x2385e9['query']);_0x734ac2[_0xeb03('0x3c')]=_[_0xeb03('0x3d')](_0x734ac2['model'],_0x734ac2[_0xeb03('0x3b')]);_0x25e79e[_0xeb03('0x3e')]=_[_0xeb03('0x3d')](_0x734ac2[_0xeb03('0x39')],qs[_0xeb03('0x52')](_0x2385e9['query'][_0xeb03('0x52')]));_0x25e79e['attributes']=_0x25e79e['attributes'][_0xeb03('0x3f')]?_0x25e79e[_0xeb03('0x3e')]:_0x734ac2[_0xeb03('0x39')];if(!_0x2385e9[_0xeb03('0x3b')]['hasOwnProperty']('nolimit')){_0x25e79e[_0xeb03('0x25')]=qs[_0xeb03('0x25')](_0x2385e9[_0xeb03('0x3b')][_0xeb03('0x25')]);_0x25e79e[_0xeb03('0x23')]=qs[_0xeb03('0x23')](_0x2385e9[_0xeb03('0x3b')][_0xeb03('0x23')]);}_0x25e79e['order']=qs['sort'](_0x2385e9[_0xeb03('0x3b')]['sort']);_0x25e79e[_0xeb03('0x44')]=qs['filters'](_[_0xeb03('0x45')](_0x2385e9[_0xeb03('0x3b')],_0x734ac2[_0xeb03('0x3c')]));_0x25e79e[_0xeb03('0x76')]=!![];if(_0x2385e9[_0xeb03('0x3b')][_0xeb03('0x46')]){_0x25e79e[_0xeb03('0x44')]=_[_0xeb03('0x47')](_0x25e79e['where'],{'$or':_['map'](_0x25e79e[_0xeb03('0x3e')],function(_0x10e280){var _0x1104f1={};_0x1104f1[_0x10e280]={'$like':'%'+_0x2385e9[_0xeb03('0x3b')][_0xeb03('0x46')]+'%'};return _0x1104f1;})});}_0x25e79e=_['merge']({},_0x25e79e,_0x2385e9[_0xeb03('0x4a')]);return _0x501a3b[_0xeb03('0x72')](_0x25e79e);}})['then'](respondWithResult(_0x247b4c,null))[_0xeb03('0x4f')](handleError(_0x247b4c,null));};exports[_0xeb03('0x77')]=function(_0x43105,_0x26833d,_0x21942d){var _0x33d5d5;var _0x2d3bc2;var _0x438e15;var _0x31dd49=_0x43105[_0xeb03('0x5d')]['id'];csv_results=[];return db[_0xeb03('0x78')][_0xeb03('0x4d')]({'attributes':['id',_0xeb03('0x49')],'raw':!![],'order':[_0xeb03('0x79')]})['then'](function(_0x3bd1f0){_0x33d5d5=_0x3bd1f0;var _0x25ac7b=_['keys'](db[_0xeb03('0x67')]['rawAttributes']);return db[_0xeb03('0x7a')]['findAll']({'raw':!![],'attributes':['id',_0xeb03('0x7b')]})[_0xeb03('0x2d')](function(_0x38eabb){_0x2d3bc2=_0x38eabb;var _0x1df994=squel[_0xeb03('0x7c')]()[_0xeb03('0x52')](_0x25ac7b)[_0xeb03('0x7d')](_0xeb03('0x7e'),'c')['where'](_0xeb03('0x7f'),_0x31dd49)[_0xeb03('0x80')]();for(var _0x3ce037=0x0;_0x3ce037<_0x2d3bc2[_0xeb03('0x3f')];_0x3ce037++){_0x1df994['field'](_0xeb03('0x81')+_0x2d3bc2[_0x3ce037]['id'],'customField_'+_0x2d3bc2[_0x3ce037][_0xeb03('0x7b')]);}for(var _0x3ce037=0x0;_0x3ce037<_0x33d5d5[_0xeb03('0x3f')];_0x3ce037++){_0x1df994[_0xeb03('0x82')](squel['select']()[_0xeb03('0x82')](_0xeb03('0x83'))[_0xeb03('0x7d')](_0xeb03('0x84'))['where'](_0xeb03('0x85'),_0x33d5d5[_0x3ce037]['id'])['where'](_0xeb03('0x86')),'additionalPhone_'+_0x33d5d5[_0x3ce037][_0xeb03('0x49')]);_0x1df994['field'](squel[_0xeb03('0x7c')]()[_0xeb03('0x82')](_0xeb03('0x87'))['from']('cm_contact_has_items')['where']('ItemTypeId\x20=\x20?',_0x33d5d5[_0x3ce037]['id'])['where'](_0xeb03('0x86')),_0xeb03('0x88')+_0x33d5d5[_0x3ce037][_0xeb03('0x49')]);}var _0x3f58d3=[];_0x3f58d3[_0xeb03('0x6b')](_0x1df994[_0xeb03('0x89')]());BPromise['each'](_0x3f58d3,handleQuery)[_0xeb03('0x2d')](function(_0x25bd07){handleQuery(_0x1df994[_0xeb03('0x89')]());var _0xd773c1=csv_results[0x0];if(!_['isEmpty'](_0xd773c1)){var _0x5c49c9=toCsv(_0xd773c1);var _0x2ea4f3=Date[_0xeb03('0x8a')]();fs['writeFileSync'](util[_0xeb03('0x8b')](_0xeb03('0x8c'),_0x31dd49,_0x2ea4f3),_0x5c49c9);_0x26833d[_0xeb03('0x8d')](_0xeb03('0x8e'),_0xeb03('0x8f')+util[_0xeb03('0x8b')](_0xeb03('0x90'),_0x31dd49,_0x2ea4f3));_0x26833d['setHeader'](_0xeb03('0x91'),_0xeb03('0x92'));return _0x26833d[_0xeb03('0x93')](util[_0xeb03('0x8b')](_0xeb03('0x8c'),_0x31dd49,_0x2ea4f3));}else{return _0x26833d[_0xeb03('0x94')](0xcc);}});});});};exports[_0xeb03('0x95')]=function(_0x3c8502,_0x4bd997,_0x39ed73){var _0x5e0e2b;delete _0x3c8502['body']['id'];return db[_0xeb03('0x34')][_0xeb03('0x63')]({'where':{'id':_0x3c8502['params']['id']}})[_0xeb03('0x2d')](handleEntityNotFound(_0x4bd997,null))['then'](function(_0xc3d089){if(_0xc3d089){return db['sequelize'][_0xeb03('0x96')](function(_0x40e81d){return db[_0xeb03('0x7a')][_0xeb03('0x54')](_0x3c8502[_0xeb03('0x55')],{'transaction':_0x40e81d})['then'](function(_0x15a726){_0x5e0e2b=_0x15a726;return _0xc3d089[_0xeb03('0x97')](_0x15a726,{'transaction':_0x40e81d});})[_0xeb03('0x2d')](function(){var _0x2b368c={'type':db[_0xeb03('0x98')][_0xeb03('0x99')],'transaction':_0x40e81d};switch(_0x3c8502[_0xeb03('0x55')][_0xeb03('0x37')]){case _0xeb03('0x9a'):_0x2b368c['type']=db['Sequelize']['TEXT'];break;case _0xeb03('0x9b'):_0x2b368c[_0xeb03('0x37')]=db[_0xeb03('0x98')][_0xeb03('0x9c')];break;case'switch':_0x2b368c['type']=db['Sequelize'][_0xeb03('0x9d')];_0x2b368c[_0xeb03('0x9e')]=![];break;default:}return db[_0xeb03('0x9f')][_0xeb03('0xa0')][_0xeb03('0xa1')]('cm_contacts',util[_0xeb03('0x8b')](_0xeb03('0xa2'),_0x5e0e2b['id']),_0x2b368c);})['then'](function(){return _0x5e0e2b;});});}})[_0xeb03('0x2d')](respondWithResult(_0x4bd997,null))['catch'](handleError(_0x4bd997,null));};exports['getCustomFields']=function(_0x12782f,_0x164b74,_0x123742){var _0x4a8209={};var _0x243689={};var _0xe6ca24;var _0x531b45;return db[_0xeb03('0x34')]['findOne']({'where':{'id':_0x12782f['params']['id']}})[_0xeb03('0x2d')](handleEntityNotFound(_0x164b74,null))[_0xeb03('0x2d')](function(_0x366054){if(_0x366054){_0xe6ca24=_0x366054;_0x243689[_0xeb03('0x39')]=_[_0xeb03('0x51')](db[_0xeb03('0x7a')]['rawAttributes']);_0x243689[_0xeb03('0x3b')]=_[_0xeb03('0x51')](_0x12782f[_0xeb03('0x3b')]);_0x243689[_0xeb03('0x3c')]=_[_0xeb03('0x3d')](_0x243689[_0xeb03('0x39')],_0x243689[_0xeb03('0x3b')]);_0x4a8209[_0xeb03('0x3e')]=_[_0xeb03('0x3d')](_0x243689[_0xeb03('0x39')],qs[_0xeb03('0x52')](_0x12782f[_0xeb03('0x3b')][_0xeb03('0x52')]));_0x4a8209[_0xeb03('0x3e')]=_0x4a8209[_0xeb03('0x3e')][_0xeb03('0x3f')]?_0x4a8209[_0xeb03('0x3e')]:_0x243689[_0xeb03('0x39')];_0x4a8209[_0xeb03('0x42')]=qs[_0xeb03('0x43')](_0x12782f[_0xeb03('0x3b')][_0xeb03('0x43')]);_0x4a8209['where']=qs[_0xeb03('0x3c')](_['pick'](_0x12782f[_0xeb03('0x3b')],_0x243689[_0xeb03('0x3c')]));_0x4a8209[_0xeb03('0x44')]=_[_0xeb03('0x47')](_0x4a8209[_0xeb03('0x44')],{'$or':[{'ListId':_0x366054['id']},{'ListId':null}]});if(_0x12782f[_0xeb03('0x3b')]['filter']){_0x4a8209[_0xeb03('0x44')]=_[_0xeb03('0x47')](_0x4a8209['where'],{'$or':_[_0xeb03('0x3a')](_0x4a8209['attributes'],function(_0xed0704){var _0x1f855f={};_0x1f855f[_0xed0704]={'$like':'%'+_0x12782f[_0xeb03('0x3b')][_0xeb03('0x46')]+'%'};return _0x1f855f;})});}_0x4a8209=_[_0xeb03('0x47')]({},_0x4a8209,_0x12782f[_0xeb03('0x4a')]);return db[_0xeb03('0x7a')]['findAndCountAll'](_0x4a8209);}})[_0xeb03('0x2d')](respondWithResult(_0x164b74,null))[_0xeb03('0x4f')](handleError(_0x164b74,null));};exports[_0xeb03('0xa3')]=function(_0x3217ff,_0xf4005a,_0x1f4a24){return db[_0xeb03('0x34')][_0xeb03('0x53')]({'where':{'id':_0x3217ff[_0xeb03('0x5d')]['id']}})[_0xeb03('0x2d')](handleEntityNotFound(_0xf4005a,null))[_0xeb03('0x2d')](function(_0x46a466){if(_0x46a466){return _0x46a466[_0xeb03('0xa3')](_0x3217ff[_0xeb03('0x55')]['ids'],_['omit'](_0x3217ff[_0xeb03('0x55')],[_0xeb03('0x65'),'id'])||{})[_0xeb03('0xa4')](function(_0x4488c4){for(var _0x180d98=0x0;_0x180d98<_0x3217ff['body'][_0xeb03('0x65')]['length'];_0x180d98+=0x1){socket[_0xeb03('0xa5')](_0xeb03('0xa6'),{'UserId':Number(_0x3217ff[_0xeb03('0x55')][_0xeb03('0x65')][_0x180d98]),'CmListId':Number(_0x3217ff[_0xeb03('0x5d')]['id'])});}return _0x4488c4;});}})[_0xeb03('0x2d')](respondWithResult(_0xf4005a,null))['catch'](handleError(_0xf4005a,null));};exports[_0xeb03('0xa7')]=function(_0x4293a4,_0x43fbc2,_0x8d1a29){return db[_0xeb03('0x34')][_0xeb03('0x53')]({'where':{'id':_0x4293a4[_0xeb03('0x5d')]['id']}})[_0xeb03('0x2d')](handleEntityNotFound(_0x43fbc2,null))['then'](function(_0x302d87){if(_0x302d87){return _0x302d87[_0xeb03('0xa7')](_0x4293a4['query'][_0xeb03('0x65')])['then'](function(){if(_[_0xeb03('0x69')](_0x4293a4[_0xeb03('0x3b')][_0xeb03('0x65')])){for(var _0x29ecb3=0x0;_0x29ecb3<_0x4293a4[_0xeb03('0x3b')][_0xeb03('0x65')][_0xeb03('0x3f')];_0x29ecb3+=0x1){socket[_0xeb03('0xa5')](_0xeb03('0xa8'),{'UserId':Number(_0x4293a4[_0xeb03('0x3b')][_0xeb03('0x65')][_0x29ecb3]),'CmListId':Number(_0x4293a4['params']['id'])});}}else{socket['emit'](_0xeb03('0xa8'),{'UserId':Number(_0x4293a4['query']['ids']),'CmListId':Number(_0x4293a4[_0xeb03('0x5d')]['id'])});}});}})[_0xeb03('0x2d')](respondWithStatusCode(_0x43fbc2,null))[_0xeb03('0x4f')](handleError(_0x43fbc2,null));};exports[_0xeb03('0xa9')]=function(_0x3574ef,_0x23725d,_0x2340d5){var _0x127277={};var _0x27afe7={};var _0x494be8;var _0x3a7e6b;return db['CmList'][_0xeb03('0x63')]({'where':{'id':_0x3574ef['params']['id']}})[_0xeb03('0x2d')](handleEntityNotFound(_0x23725d,null))[_0xeb03('0x2d')](function(_0x357282){if(_0x357282){_0x494be8=_0x357282;_0x27afe7[_0xeb03('0x39')]=_[_0xeb03('0x51')](db['User'][_0xeb03('0x35')]);_0x27afe7[_0xeb03('0x3b')]=_[_0xeb03('0x51')](_0x3574ef[_0xeb03('0x3b')]);_0x27afe7[_0xeb03('0x3c')]=_[_0xeb03('0x3d')](_0x27afe7[_0xeb03('0x39')],_0x27afe7['query']);_0x127277[_0xeb03('0x3e')]=_[_0xeb03('0x3d')](_0x27afe7['model'],qs['fields'](_0x3574ef[_0xeb03('0x3b')][_0xeb03('0x52')]));_0x127277['attributes']=_0x127277[_0xeb03('0x3e')][_0xeb03('0x3f')]?_0x127277[_0xeb03('0x3e')]:_0x27afe7[_0xeb03('0x39')];_0x127277[_0xeb03('0x42')]=qs[_0xeb03('0x43')](_0x3574ef['query']['sort']);_0x127277[_0xeb03('0x44')]=qs[_0xeb03('0x3c')](_[_0xeb03('0x45')](_0x3574ef[_0xeb03('0x3b')],_0x27afe7[_0xeb03('0x3c')]));if(_0x3574ef['query'][_0xeb03('0x46')]){_0x127277[_0xeb03('0x44')]=_[_0xeb03('0x47')](_0x127277[_0xeb03('0x44')],{'$or':_[_0xeb03('0x3a')](_0x127277[_0xeb03('0x3e')],function(_0xa16cb7){var _0x223acf={};_0x223acf[_0xa16cb7]={'$like':'%'+_0x3574ef[_0xeb03('0x3b')][_0xeb03('0x46')]+'%'};return _0x223acf;})});}_0x127277=_[_0xeb03('0x47')]({},_0x127277,_0x3574ef[_0xeb03('0x4a')]);return _0x494be8[_0xeb03('0xa9')](_0x127277);}})[_0xeb03('0x2d')](function(_0x2f2552){if(_0x2f2552){_0x3a7e6b=_0x2f2552[_0xeb03('0x3f')];if(!_0x3574ef[_0xeb03('0x3b')]['hasOwnProperty'](_0xeb03('0x41'))){_0x127277[_0xeb03('0x25')]=qs[_0xeb03('0x25')](_0x3574ef['query'][_0xeb03('0x25')]);_0x127277[_0xeb03('0x23')]=qs['offset'](_0x3574ef[_0xeb03('0x3b')][_0xeb03('0x23')]);}return _0x494be8[_0xeb03('0xa9')](_0x127277);}})['then'](function(_0x133ca1){if(_0x133ca1){return _0x133ca1?{'count':_0x3a7e6b,'rows':_0x133ca1}:null;}})['then'](respondWithResult(_0x23725d,null))[_0xeb03('0x4f')](handleError(_0x23725d,null));};function handleQuery(_0x23ec58){logger['info'](_0x23ec58);return db[_0xeb03('0x9f')]['query'](_0x23ec58)['spread'](function(_0x41c1fa){csv_results[_0xeb03('0x6b')](_0x41c1fa);})[_0xeb03('0x4f')](function(_0x12235e){logger[_0xeb03('0x31')](_0x12235e[_0xeb03('0x70')]);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index e3e7abc..f8d93e9 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 _0x5fc3=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x99868f,_0xbdb8e7){var _0x27a71b=function(_0x41feca){while(--_0x41feca){_0x99868f['push'](_0x99868f['shift']());}};_0x27a71b(++_0xbdb8e7);}(_0x5fc3,0xa8));var _0x35fc=function(_0x56756b,_0x3e8cc7){_0x56756b=_0x56756b-0x0;var _0xa3002=_0x5fc3[_0x56756b];return _0xa3002;};'use strict';var EventEmitter=require(_0x35fc('0x0'));var CmList=require(_0x35fc('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0x35fc('0x2')](0x0);var events={'afterCreate':_0x35fc('0x3'),'afterUpdate':_0x35fc('0x4'),'afterDestroy':_0x35fc('0x5')};function emitEvent(_0xb4f9ce){return function(_0x5e75e6,_0x2d1404,_0x1d5fec){CmListEvents[_0x35fc('0x6')](_0xb4f9ce+':'+_0x5e75e6['id'],_0x5e75e6);CmListEvents['emit'](_0xb4f9ce,_0x5e75e6);_0x1d5fec(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0x35fc('0x7')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file +var _0xe14b=['hasOwnProperty','hook','exports','events','../../mysqldb','save','update','emit'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xe14b,0x93));var _0xbe14=function(_0x2a0a27,_0x2d48e3){_0x2a0a27=_0x2a0a27-0x0;var _0x4869d5=_0xe14b[_0x2a0a27];return _0x4869d5;};'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 diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 910adcc..a15f2d2 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 _0x55e0=['./cmList.attributes','exports','define','cm_lists','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x55e0,0xdc));var _0x055e=function(_0x22487b,_0x3a9021){_0x22487b=_0x22487b-0x0;var _0x2949ef=_0x55e0[_0x22487b];return _0x2949ef;};'use strict';var _=require(_0x055e('0x0'));var util=require(_0x055e('0x1'));var logger=require(_0x055e('0x2'))(_0x055e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x055e('0x4'));var fs=require('fs');var path=require(_0x055e('0x5'));var rimraf=require(_0x055e('0x6'));var config=require(_0x055e('0x7'));var attributes=require(_0x055e('0x8'));module[_0x055e('0x9')]=function(_0x490ee1,_0x5239f6){return _0x490ee1[_0x055e('0xa')]('CmList',attributes,{'tableName':_0x055e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1be1=['define','cm_lists','../../config/logger','api','bluebird','request-promise','path','rimraf','./cmList.attributes','exports'];(function(_0x349b5c,_0x55e5fa){var _0x3efcac=function(_0x27832d){while(--_0x27832d){_0x349b5c['push'](_0x349b5c['shift']());}};_0x3efcac(++_0x55e5fa);}(_0x1be1,0x192));var _0x11be=function(_0x4178ac,_0x1bf739){_0x4178ac=_0x4178ac-0x0;var _0x54f205=_0x1be1[_0x4178ac];return _0x54f205;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x11be('0x0'))(_0x11be('0x1'));var moment=require('moment');var BPromise=require(_0x11be('0x2'));var rp=require(_0x11be('0x3'));var fs=require('fs');var path=require(_0x11be('0x4'));var rimraf=require(_0x11be('0x5'));var config=require('../../config/environment');var attributes=require(_0x11be('0x6'));module[_0x11be('0x7')]=function(_0x11f793,_0x479719){return _0x11f793[_0x11be('0x8')]('CmList',attributes,{'tableName':_0x11be('0x9'),'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 ab144c2..a5c151b 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 _0x2c8f=['http','redis','defaults','socket.io-emitter','./cmList.socket','register','request','then','CmList,\x20%s,\x20%s','CmList,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','client'];(function(_0x172747,_0x1732bd){var _0x509692=function(_0x448c56){while(--_0x448c56){_0x172747['push'](_0x172747['shift']());}};_0x509692(++_0x1732bd);}(_0x2c8f,0x1e5));var _0xf2c8=function(_0x1d69d2,_0x2ef689){_0x1d69d2=_0x1d69d2-0x0;var _0x10b3ba=_0x2c8f[_0x1d69d2];return _0x10b3ba;};'use strict';var _=require(_0xf2c8('0x0'));var util=require(_0xf2c8('0x1'));var moment=require(_0xf2c8('0x2'));var BPromise=require(_0xf2c8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf2c8('0x4'))['db'];var utils=require(_0xf2c8('0x5'));var logger=require(_0xf2c8('0x6'))(_0xf2c8('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf2c8('0x8')][_0xf2c8('0x9')]({'port':0x232a});config[_0xf2c8('0xa')]=_[_0xf2c8('0xb')](config[_0xf2c8('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xf2c8('0xc'))(new Redis(config[_0xf2c8('0xa')]));require(_0xf2c8('0xd'))[_0xf2c8('0xe')](socket);function respondWithRpcPromise(_0x2a953b,_0x5a7d19,_0xa56b8d){return new BPromise(function(_0x5a950d,_0x10c67b){return client[_0xf2c8('0xf')](_0x2a953b,_0xa56b8d)[_0xf2c8('0x10')](function(_0x1eb544){logger['info'](_0xf2c8('0x11'),_0x5a7d19,'request\x20sent');logger['debug'](_0xf2c8('0x12'),_0x5a7d19,_0xf2c8('0x13'),JSON[_0xf2c8('0x14')](_0x1eb544));if(_0x1eb544[_0xf2c8('0x15')]){if(_0x1eb544[_0xf2c8('0x15')][_0xf2c8('0x16')]===0x1f4){logger[_0xf2c8('0x15')](_0xf2c8('0x11'),_0x5a7d19,_0x1eb544[_0xf2c8('0x15')][_0xf2c8('0x17')]);return _0x10c67b(_0x1eb544[_0xf2c8('0x15')][_0xf2c8('0x17')]);}logger[_0xf2c8('0x15')](_0xf2c8('0x11'),_0x5a7d19,_0x1eb544[_0xf2c8('0x15')][_0xf2c8('0x17')]);return _0x5a950d(_0x1eb544[_0xf2c8('0x15')][_0xf2c8('0x17')]);}else{logger[_0xf2c8('0x18')](_0xf2c8('0x11'),_0x5a7d19,_0xf2c8('0x13'));_0x5a950d(_0x1eb544['result'][_0xf2c8('0x17')]);}})[_0xf2c8('0x19')](function(_0xed5021){logger[_0xf2c8('0x15')](_0xf2c8('0x11'),_0x5a7d19,_0xed5021);_0x10c67b(_0xed5021);});});} \ No newline at end of file +var _0x34ee=['../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','then','info','request\x20sent','stringify','error','CmList,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x34ee,0x1ce));var _0xe34e=function(_0x5b3c61,_0x3eb2aa){_0x5b3c61=_0x5b3c61-0x0;var _0x153389=_0x34ee[_0x5b3c61];return _0x153389;};'use strict';var _=require(_0xe34e('0x0'));var util=require('util');var moment=require(_0xe34e('0x1'));var BPromise=require(_0xe34e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe34e('0x3'));var db=require(_0xe34e('0x4'))['db'];var utils=require(_0xe34e('0x5'));var logger=require(_0xe34e('0x6'))(_0xe34e('0x7'));var config=require(_0xe34e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe34e('0x9')][_0xe34e('0xa')]({'port':0x232a});config[_0xe34e('0xb')]=_[_0xe34e('0xc')](config[_0xe34e('0xb')],{'host':_0xe34e('0xd'),'port':0x18eb});var socket=require(_0xe34e('0xe'))(new Redis(config[_0xe34e('0xb')]));require(_0xe34e('0xf'))[_0xe34e('0x10')](socket);function respondWithRpcPromise(_0x306cbd,_0x3fd1f9,_0x134221){return new BPromise(function(_0x200c81,_0x58e6e7){return client['request'](_0x306cbd,_0x134221)[_0xe34e('0x11')](function(_0x1dd646){logger[_0xe34e('0x12')]('CmList,\x20%s,\x20%s',_0x3fd1f9,_0xe34e('0x13'));logger['debug']('CmList,\x20%s,\x20%s,\x20%s',_0x3fd1f9,_0xe34e('0x13'),JSON[_0xe34e('0x14')](_0x1dd646));if(_0x1dd646[_0xe34e('0x15')]){if(_0x1dd646[_0xe34e('0x15')]['code']===0x1f4){logger[_0xe34e('0x15')](_0xe34e('0x16'),_0x3fd1f9,_0x1dd646[_0xe34e('0x15')][_0xe34e('0x17')]);return _0x58e6e7(_0x1dd646[_0xe34e('0x15')][_0xe34e('0x17')]);}logger[_0xe34e('0x15')](_0xe34e('0x16'),_0x3fd1f9,_0x1dd646[_0xe34e('0x15')][_0xe34e('0x17')]);return _0x200c81(_0x1dd646[_0xe34e('0x15')][_0xe34e('0x17')]);}else{logger['info'](_0xe34e('0x16'),_0x3fd1f9,_0xe34e('0x13'));_0x200c81(_0x1dd646[_0xe34e('0x18')][_0xe34e('0x17')]);}})[_0xe34e('0x19')](function(_0x5b0642){logger[_0xe34e('0x15')](_0xe34e('0x16'),_0x3fd1f9,_0x5b0642);_0x58e6e7(_0x5b0642);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index cedd998..a7ec3a2 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 _0x3e0b=['removeListener','register','save','remove','update'];(function(_0x1f62c3,_0x1ff95b){var _0x385c1c=function(_0x1db580){while(--_0x1db580){_0x1f62c3['push'](_0x1f62c3['shift']());}};_0x385c1c(++_0x1ff95b);}(_0x3e0b,0x151));var _0xb3e0=function(_0x21a83f,_0xb70c9c){_0x21a83f=_0x21a83f-0x0;var _0x59e63d=_0x3e0b[_0x21a83f];return _0x59e63d;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0xb3e0('0x0'),_0xb3e0('0x1'),_0xb3e0('0x2')];function createListener(_0x26df8c,_0x5f2da4){return function(_0x3cb028){_0x5f2da4['emit'](_0x26df8c,_0x3cb028);};}function removeListener(_0x128b3a,_0x1b741e){return function(){CmListEvents[_0xb3e0('0x3')](_0x128b3a,_0x1b741e);};}exports[_0xb3e0('0x4')]=function(_0x5533a8){for(var _0x446f1b=0x0,_0x1f1e5a=events['length'];_0x446f1b<_0x1f1e5a;_0x446f1b++){var _0xa28ab1=events[_0x446f1b];var _0x5b953=createListener('cmList:'+_0xa28ab1,_0x5533a8);CmListEvents['on'](_0xa28ab1,_0x5b953);}}; \ No newline at end of file +var _0x6da6=['remove','emit','removeListener','length','./cmList.events','save'];(function(_0x242a4f,_0x369c57){var _0x122117=function(_0x55a797){while(--_0x55a797){_0x242a4f['push'](_0x242a4f['shift']());}};_0x122117(++_0x369c57);}(_0x6da6,0x9a));var _0x66da=function(_0x152ca2,_0x5abd1b){_0x152ca2=_0x152ca2-0x0;var _0x58fbd2=_0x6da6[_0x152ca2];return _0x58fbd2;};'use strict';var CmListEvents=require(_0x66da('0x0'));var events=[_0x66da('0x1'),_0x66da('0x2'),'update'];function createListener(_0x13472b,_0xbe411){return function(_0x141762){_0xbe411[_0x66da('0x3')](_0x13472b,_0x141762);};}function removeListener(_0x48bbfa,_0x3fd0ef){return function(){CmListEvents[_0x66da('0x4')](_0x48bbfa,_0x3fd0ef);};}exports['register']=function(_0x37e95e){for(var _0x44600a=0x0,_0x3892d4=events[_0x66da('0x5')];_0x44600a<_0x3892d4;_0x44600a++){var _0x378aa4=events[_0x44600a];var _0x55fc5f=createListener('cmList:'+_0x378aa4,_0x37e95e);CmListEvents['on'](_0x378aa4,_0x55fc5f);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 3df6037..b12f18e 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 _0x9f5e=['put','update','delete','destroy','removeDispositions','removeAgents','exports','connect-timeout','express','fs-extra','../../components/auth/service','./cmList.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','getCustomFields','getAgents','post','create','addContacts','/:id/fields','addCustomField','/:id/users','addAgents'];(function(_0x13a5a8,_0x186495){var _0x397582=function(_0x33dc56){while(--_0x33dc56){_0x13a5a8['push'](_0x13a5a8['shift']());}};_0x397582(++_0x186495);}(_0x9f5e,0x167));var _0xe9f5=function(_0x154628,_0x5bdb5a){_0x154628=_0x154628-0x0;var _0x1e9b20=_0x9f5e[_0x154628];return _0x1e9b20;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xe9f5('0x0'));var express=require(_0xe9f5('0x1'));var router=express['Router']();var fs_extra=require(_0xe9f5('0x2'));var auth=require(_0xe9f5('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe9f5('0x4'));router[_0xe9f5('0x5')]('/',auth[_0xe9f5('0x6')](),controller[_0xe9f5('0x7')]);router[_0xe9f5('0x5')](_0xe9f5('0x8'),auth[_0xe9f5('0x6')](),controller[_0xe9f5('0x9')]);router[_0xe9f5('0x5')](_0xe9f5('0xa'),auth['isAuthenticated'](),controller[_0xe9f5('0xb')]);router['get'](_0xe9f5('0xc'),auth[_0xe9f5('0x6')](),controller[_0xe9f5('0xd')]);router[_0xe9f5('0x5')](_0xe9f5('0xe'),auth[_0xe9f5('0x6')](),controller[_0xe9f5('0xf')]);router[_0xe9f5('0x5')]('/:id/contacts/csv',auth[_0xe9f5('0x6')](),controller['getContactsCsv']);router[_0xe9f5('0x5')]('/:id/fields',auth[_0xe9f5('0x6')](),controller[_0xe9f5('0x10')]);router[_0xe9f5('0x5')]('/:id/users',auth[_0xe9f5('0x6')](),controller[_0xe9f5('0x11')]);router[_0xe9f5('0x12')]('/',auth[_0xe9f5('0x6')](),controller[_0xe9f5('0x13')]);router['post']('/:id/dispositions',auth[_0xe9f5('0x6')](),controller['addDisposition']);router[_0xe9f5('0x12')](_0xe9f5('0xe'),auth[_0xe9f5('0x6')](),controller[_0xe9f5('0x14')]);router[_0xe9f5('0x12')](_0xe9f5('0x15'),auth[_0xe9f5('0x6')](),controller[_0xe9f5('0x16')]);router[_0xe9f5('0x12')](_0xe9f5('0x17'),auth[_0xe9f5('0x6')](),controller[_0xe9f5('0x18')]);router[_0xe9f5('0x19')]('/:id',auth[_0xe9f5('0x6')](),controller[_0xe9f5('0x1a')]);router[_0xe9f5('0x1b')](_0xe9f5('0xa'),auth[_0xe9f5('0x6')](),controller[_0xe9f5('0x1c')]);router[_0xe9f5('0x1b')](_0xe9f5('0xc'),auth[_0xe9f5('0x6')](),controller[_0xe9f5('0x1d')]);router[_0xe9f5('0x1b')](_0xe9f5('0x17'),auth['isAuthenticated'](),controller[_0xe9f5('0x1e')]);module[_0xe9f5('0x1f')]=router; \ No newline at end of file +var _0xd2e9=['get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','getContacts','getContactsCsv','/:id/users','getAgents','post','create','/:id/contacts','addContacts','/:id/fields','addCustomField','addAgents','put','update','delete','destroy','removeDispositions','removeAgents','connect-timeout','Router','../../config/environment','./cmList.controller'];(function(_0x11851f,_0x621c7c){var _0x598e1c=function(_0x476881){while(--_0x476881){_0x11851f['push'](_0x11851f['shift']());}};_0x598e1c(++_0x621c7c);}(_0xd2e9,0x1bc));var _0x9d2e=function(_0x14cec9,_0x23e174){_0x14cec9=_0x14cec9-0x0;var _0x261226=_0xd2e9[_0x14cec9];return _0x261226;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x9d2e('0x0'));var express=require('express');var router=express[_0x9d2e('0x1')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9d2e('0x2'));var controller=require(_0x9d2e('0x3'));router[_0x9d2e('0x4')]('/',auth[_0x9d2e('0x5')](),controller['index']);router[_0x9d2e('0x4')](_0x9d2e('0x6'),auth[_0x9d2e('0x5')](),controller[_0x9d2e('0x7')]);router['get'](_0x9d2e('0x8'),auth[_0x9d2e('0x5')](),controller[_0x9d2e('0x9')]);router[_0x9d2e('0x4')](_0x9d2e('0xa'),auth[_0x9d2e('0x5')](),controller['getDispositions']);router[_0x9d2e('0x4')]('/:id/contacts',auth[_0x9d2e('0x5')](),controller[_0x9d2e('0xb')]);router['get']('/:id/contacts/csv',auth['isAuthenticated'](),controller[_0x9d2e('0xc')]);router[_0x9d2e('0x4')]('/:id/fields',auth[_0x9d2e('0x5')](),controller['getCustomFields']);router['get'](_0x9d2e('0xd'),auth['isAuthenticated'](),controller[_0x9d2e('0xe')]);router[_0x9d2e('0xf')]('/',auth['isAuthenticated'](),controller[_0x9d2e('0x10')]);router[_0x9d2e('0xf')](_0x9d2e('0xa'),auth[_0x9d2e('0x5')](),controller['addDisposition']);router[_0x9d2e('0xf')](_0x9d2e('0x11'),auth[_0x9d2e('0x5')](),controller[_0x9d2e('0x12')]);router['post'](_0x9d2e('0x13'),auth['isAuthenticated'](),controller[_0x9d2e('0x14')]);router[_0x9d2e('0xf')](_0x9d2e('0xd'),auth[_0x9d2e('0x5')](),controller[_0x9d2e('0x15')]);router[_0x9d2e('0x16')](_0x9d2e('0x8'),auth[_0x9d2e('0x5')](),controller[_0x9d2e('0x17')]);router[_0x9d2e('0x18')](_0x9d2e('0x8'),auth[_0x9d2e('0x5')](),controller[_0x9d2e('0x19')]);router[_0x9d2e('0x18')](_0x9d2e('0xa'),auth['isAuthenticated'](),controller[_0x9d2e('0x1a')]);router['delete'](_0x9d2e('0xd'),auth[_0x9d2e('0x5')](),controller[_0x9d2e('0x1b')]);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 4714129..a6c6908 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 _0x20ec=['exports','VIRTUAL','getDataValue','field','STRING','sequelize'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x20ec,0x1f1));var _0xc20e=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x20ec[_0x2070da];return _0x4f9fe1;};'use strict';var Sequelize=require(_0xc20e('0x0'));module[_0xc20e('0x1')]={'name':{'type':Sequelize[_0xc20e('0x2')],'get':function(_0x1e3a17){return this[_0xc20e('0x3')](_0xc20e('0x4'));}},'field':{'type':Sequelize[_0xc20e('0x5')],'allowNull':![]},'operator':{'type':Sequelize[_0xc20e('0x5')],'allowNull':![]},'value':{'type':Sequelize[_0xc20e('0x5')],'allowNull':![]}}; \ No newline at end of file +var _0x6d76=['sequelize','exports','field','STRING'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x6d76,0x120));var _0x66d7=function(_0x1d7f50,_0x1cc7d6){_0x1d7f50=_0x1d7f50-0x0;var _0x2009f7=_0x6d76[_0x1d7f50];return _0x2009f7;};'use strict';var Sequelize=require(_0x66d7('0x0'));module[_0x66d7('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x34c37f){return this['getDataValue'](_0x66d7('0x2'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x66d7('0x3')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index d154162..3952046 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 _0x9957=['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','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x58e9d8,_0x2bafc8){var _0x189aa4=function(_0x5243b6){while(--_0x5243b6){_0x58e9d8['push'](_0x58e9d8['shift']());}};_0x189aa4(++_0x2bafc8);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'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){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,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(_0x7303c,_0x2d7803){var _0x367cc7=function(_0x333990){while(--_0x333990){_0x7303c['push'](_0x7303c['shift']());}};_0x367cc7(++_0x2d7803);}(_0x7a54,0x106));var _0x47a5=function(_0x5be848,_0x162691){_0x5be848=_0x5be848-0x0;var _0x5e225b=_0x7a54[_0x5be848];return _0x5e225b;};'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 39803b6..7914d55 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 _0xc1bd=['./condition.attributes','exports','Condition','tools_conditions','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x2abaae,_0x29fd8b){var _0x5b5745=function(_0x2f6218){while(--_0x2f6218){_0x2abaae['push'](_0x2abaae['shift']());}};_0x5b5745(++_0x29fd8b);}(_0xc1bd,0x118));var _0xdc1b=function(_0x2853ce,_0x23f70e){_0x2853ce=_0x2853ce-0x0;var _0x266a31=_0xc1bd[_0x2853ce];return _0x266a31;};'use strict';var _=require(_0xdc1b('0x0'));var util=require('util');var logger=require(_0xdc1b('0x1'))(_0xdc1b('0x2'));var moment=require(_0xdc1b('0x3'));var BPromise=require(_0xdc1b('0x4'));var rp=require(_0xdc1b('0x5'));var fs=require('fs');var path=require(_0xdc1b('0x6'));var rimraf=require('rimraf');var config=require(_0xdc1b('0x7'));var attributes=require(_0xdc1b('0x8'));module[_0xdc1b('0x9')]=function(_0x390591,_0x317795){return _0x390591['define'](_0xdc1b('0xa'),attributes,{'tableName':_0xdc1b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7e65=['define','tools_conditions','lodash','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./condition.attributes','exports'];(function(_0x5d6c3e,_0x409a3e){var _0x44ecb7=function(_0x936b6a){while(--_0x936b6a){_0x5d6c3e['push'](_0x5d6c3e['shift']());}};_0x44ecb7(++_0x409a3e);}(_0x7e65,0x14c));var _0x57e6=function(_0x12be89,_0x32459e){_0x12be89=_0x12be89-0x0;var _0x1d0b3d=_0x7e65[_0x12be89];return _0x1d0b3d;};'use strict';var _=require(_0x57e6('0x0'));var util=require('util');var logger=require(_0x57e6('0x1'))(_0x57e6('0x2'));var moment=require(_0x57e6('0x3'));var BPromise=require('bluebird');var rp=require(_0x57e6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x57e6('0x5'));var config=require(_0x57e6('0x6'));var attributes=require(_0x57e6('0x7'));module[_0x57e6('0x8')]=function(_0x176a89,_0x13f657){return _0x176a89[_0x57e6('0x9')]('Condition',attributes,{'tableName':_0x57e6('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 4ba6c14..e1f4b5c 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 _0xed98=['error','Condition,\x20%s,\x20%s','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','info','request\x20sent'];(function(_0x100447,_0x3d10b5){var _0x37bcab=function(_0x17691e){while(--_0x17691e){_0x100447['push'](_0x100447['shift']());}};_0x37bcab(++_0x3d10b5);}(_0xed98,0xcb));var _0x8ed9=function(_0x1a798c,_0x4b66d1){_0x1a798c=_0x1a798c-0x0;var _0x43a000=_0xed98[_0x1a798c];return _0x43a000;};'use strict';var _=require(_0x8ed9('0x0'));var util=require(_0x8ed9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8ed9('0x2'));var fs=require('fs');var Redis=require(_0x8ed9('0x3'));var db=require(_0x8ed9('0x4'))['db'];var utils=require(_0x8ed9('0x5'));var logger=require(_0x8ed9('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8ed9('0x7')][_0x8ed9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3a6f9c,_0xb1398c,_0xa403a2){return new BPromise(function(_0xcabd07,_0x4ce2e7){return client[_0x8ed9('0x9')](_0x3a6f9c,_0xa403a2)[_0x8ed9('0xa')](function(_0x5acc20){logger[_0x8ed9('0xb')]('Condition,\x20%s,\x20%s',_0xb1398c,_0x8ed9('0xc'));logger['debug']('Condition,\x20%s,\x20%s,\x20%s',_0xb1398c,'request\x20sent',JSON['stringify'](_0x5acc20));if(_0x5acc20['error']){if(_0x5acc20[_0x8ed9('0xd')]['code']===0x1f4){logger[_0x8ed9('0xd')](_0x8ed9('0xe'),_0xb1398c,_0x5acc20[_0x8ed9('0xd')][_0x8ed9('0xf')]);return _0x4ce2e7(_0x5acc20[_0x8ed9('0xd')][_0x8ed9('0xf')]);}logger['error'](_0x8ed9('0xe'),_0xb1398c,_0x5acc20[_0x8ed9('0xd')][_0x8ed9('0xf')]);return _0xcabd07(_0x5acc20['error']['message']);}else{logger[_0x8ed9('0xb')](_0x8ed9('0xe'),_0xb1398c,_0x8ed9('0xc'));_0xcabd07(_0x5acc20[_0x8ed9('0x10')][_0x8ed9('0xf')]);}})[_0x8ed9('0x11')](function(_0x2656fe){logger[_0x8ed9('0xd')](_0x8ed9('0xe'),_0xb1398c,_0x2656fe);_0x4ce2e7(_0x2656fe);});});} \ No newline at end of file +var _0xd638=['result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','Condition,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info'];(function(_0x3ea61f,_0x2d80dc){var _0x506eff=function(_0x48d67a){while(--_0x48d67a){_0x3ea61f['push'](_0x3ea61f['shift']());}};_0x506eff(++_0x2d80dc);}(_0xd638,0x14b));var _0x8d63=function(_0x107e87,_0x20293b){_0x107e87=_0x107e87-0x0;var _0x267b1a=_0xd638[_0x107e87];return _0x267b1a;};'use strict';var _=require(_0x8d63('0x0'));var util=require(_0x8d63('0x1'));var moment=require('moment');var BPromise=require(_0x8d63('0x2'));var rs=require(_0x8d63('0x3'));var fs=require('fs');var Redis=require(_0x8d63('0x4'));var db=require(_0x8d63('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8d63('0x6'))('rpc');var config=require(_0x8d63('0x7'));var jayson=require(_0x8d63('0x8'));var client=jayson[_0x8d63('0x9')][_0x8d63('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2038c9,_0x17720a,_0x2173a1){return new BPromise(function(_0xb59dbc,_0x525533){return client[_0x8d63('0xb')](_0x2038c9,_0x2173a1)[_0x8d63('0xc')](function(_0x1493a3){logger['info'](_0x8d63('0xd'),_0x17720a,_0x8d63('0xe'));logger[_0x8d63('0xf')]('Condition,\x20%s,\x20%s,\x20%s',_0x17720a,_0x8d63('0xe'),JSON[_0x8d63('0x10')](_0x1493a3));if(_0x1493a3[_0x8d63('0x11')]){if(_0x1493a3[_0x8d63('0x11')][_0x8d63('0x12')]===0x1f4){logger[_0x8d63('0x11')](_0x8d63('0xd'),_0x17720a,_0x1493a3[_0x8d63('0x11')][_0x8d63('0x13')]);return _0x525533(_0x1493a3[_0x8d63('0x11')][_0x8d63('0x13')]);}logger[_0x8d63('0x11')](_0x8d63('0xd'),_0x17720a,_0x1493a3[_0x8d63('0x11')][_0x8d63('0x13')]);return _0xb59dbc(_0x1493a3['error'][_0x8d63('0x13')]);}else{logger[_0x8d63('0x14')]('Condition,\x20%s,\x20%s',_0x17720a,_0x8d63('0xe'));_0xb59dbc(_0x1493a3[_0x8d63('0x15')][_0x8d63('0x13')]);}})['catch'](function(_0x54fd5b){logger[_0x8d63('0x11')](_0x8d63('0xd'),_0x17720a,_0x54fd5b);_0x525533(_0x54fd5b);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 95fbea2..7520eea 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 _0xb340=['multer','util','path','express','Router','fs-extra','../../components/interaction/service','./condition.controller','/:id','isAuthenticated','update','delete','destroy'];(function(_0x5a6a08,_0x1c2957){var _0x4dc396=function(_0x4a3b08){while(--_0x4a3b08){_0x5a6a08['push'](_0x5a6a08['shift']());}};_0x4dc396(++_0x1c2957);}(_0xb340,0x75));var _0x0b34=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xb340[_0x2160a9];return _0xa88cf7;};'use strict';var multer=require(_0x0b34('0x0'));var util=require(_0x0b34('0x1'));var path=require(_0x0b34('0x2'));var timeout=require('connect-timeout');var express=require(_0x0b34('0x3'));var router=express[_0x0b34('0x4')]();var fs_extra=require(_0x0b34('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0b34('0x6'));var config=require('../../config/environment');var controller=require(_0x0b34('0x7'));router['put'](_0x0b34('0x8'),auth[_0x0b34('0x9')](),controller[_0x0b34('0xa')]);router[_0x0b34('0xb')](_0x0b34('0x8'),auth['isAuthenticated'](),controller[_0x0b34('0xc')]);module['exports']=router; \ No newline at end of file +var _0x97aa=['fs-extra','../../components/auth/service','../../components/interaction/service','./condition.controller','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x449e8b,_0xd163ef){var _0x4cde2a=function(_0x495525){while(--_0x495525){_0x449e8b['push'](_0x449e8b['shift']());}};_0x4cde2a(++_0xd163ef);}(_0x97aa,0x1da));var _0xa97a=function(_0x56734f,_0x28c3cf){_0x56734f=_0x56734f-0x0;var _0x34b752=_0x97aa[_0x56734f];return _0x34b752;};'use strict';var multer=require(_0xa97a('0x0'));var util=require(_0xa97a('0x1'));var path=require(_0xa97a('0x2'));var timeout=require(_0xa97a('0x3'));var express=require(_0xa97a('0x4'));var router=express[_0xa97a('0x5')]();var fs_extra=require(_0xa97a('0x6'));var auth=require(_0xa97a('0x7'));var interaction=require(_0xa97a('0x8'));var config=require('../../config/environment');var controller=require(_0xa97a('0x9'));router['put']('/:id',auth['isAuthenticated'](),controller[_0xa97a('0xa')]);router[_0xa97a('0xb')](_0xa97a('0xc'),auth['isAuthenticated'](),controller[_0xa97a('0xd')]);module[_0xa97a('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 494009c..1f7af67 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 _0x116e=['name','INTEGER','STRING','sequelize','exports'];(function(_0x1a83c3,_0x1daad9){var _0x538187=function(_0x52cc0b){while(--_0x52cc0b){_0x1a83c3['push'](_0x1a83c3['shift']());}};_0x538187(++_0x1daad9);}(_0x116e,0x1de));var _0xe116=function(_0x3b1d1e,_0x10d8d9){_0x3b1d1e=_0x3b1d1e-0x0;var _0x5670b7=_0x116e[_0x3b1d1e];return _0x5670b7;};'use strict';var Sequelize=require(_0xe116('0x0'));module[_0xe116('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xe116('0x2')},'OrderBy':{'type':Sequelize[_0xe116('0x3')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0xe116('0x4')],'allowNull':!![]}}; \ No newline at end of file +var _0x6831=['exports','STRING','name','sequelize'];(function(_0x54c6e2,_0x41a8f8){var _0x36523a=function(_0x3649dc){while(--_0x3649dc){_0x54c6e2['push'](_0x54c6e2['shift']());}};_0x36523a(++_0x41a8f8);}(_0x6831,0xff));var _0x1683=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6831[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x1683('0x0'));module[_0x1683('0x1')]={'name':{'type':Sequelize[_0x1683('0x2')],'allowNull':![],'unique':_0x1683('0x3')},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x1683('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 f55ed6e..320562a 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 _0xbbbf=['json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','ContactItemTypes','error','send','index','map','ContactItemType','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','name','merge','includeAll','include','rows','catch','show','params','keys','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','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','path','sox','to-csv','lodash','squel','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end'];(function(_0x4e4a09,_0xe4eac8){var _0x17a756=function(_0x23b5ef){while(--_0x23b5ef){_0x4e4a09['push'](_0x4e4a09['shift']());}};_0x17a756(++_0xe4eac8);}(_0xbbbf,0x186));var _0xfbbb=function(_0x3c01ee,_0x44f651){_0x3c01ee=_0x3c01ee-0x0;var _0x6bc616=_0xbbbf[_0x3c01ee];return _0x6bc616;};'use strict';var emlformat=require(_0xfbbb('0x0'));var rimraf=require(_0xfbbb('0x1'));var zipdir=require(_0xfbbb('0x2'));var jsonpatch=require(_0xfbbb('0x3'));var rp=require(_0xfbbb('0x4'));var moment=require(_0xfbbb('0x5'));var BPromise=require(_0xfbbb('0x6'));var Mustache=require(_0xfbbb('0x7'));var util=require(_0xfbbb('0x8'));var path=require(_0xfbbb('0x9'));var sox=require(_0xfbbb('0xa'));var csv=require(_0xfbbb('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfbbb('0xc'));var squel=require(_0xfbbb('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xfbbb('0xb'));var querystring=require('querystring');var Papa=require(_0xfbbb('0xe'));var Redis=require('ioredis');var authService=require(_0xfbbb('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xfbbb('0x10'));var hardwareService=require(_0xfbbb('0x11'));var logger=require(_0xfbbb('0x12'))(_0xfbbb('0x13'));var utils=require(_0xfbbb('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xfbbb('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3e80aa,_0x4170e0){_0x4170e0=_0x4170e0||0xcc;return function(_0x4e2a00){if(_0x4e2a00){return _0x3e80aa[_0xfbbb('0x16')](_0x4170e0);}return _0x3e80aa[_0xfbbb('0x17')](_0x4170e0)[_0xfbbb('0x18')]();};}function respondWithResult(_0x554082,_0x665e0c){_0x665e0c=_0x665e0c||0xc8;return function(_0x1dae0c){if(_0x1dae0c){return _0x554082[_0xfbbb('0x17')](_0x665e0c)[_0xfbbb('0x19')](_0x1dae0c);}};}function respondWithFilteredResult(_0x352d98,_0x1dc1aa){return function(_0x7cd15f){if(_0x7cd15f){var _0x14a83a=typeof _0x1dc1aa[_0xfbbb('0x1a')]===_0xfbbb('0x1b')&&typeof _0x1dc1aa['limit']===_0xfbbb('0x1b');var _0x242e71=_0x7cd15f[_0xfbbb('0x1c')];var _0x5081ac=_0x14a83a?0x0:_0x1dc1aa[_0xfbbb('0x1a')];var _0x132075=_0x14a83a?_0x7cd15f['count']:_0x1dc1aa[_0xfbbb('0x1a')]+_0x1dc1aa[_0xfbbb('0x1d')];var _0x4acada;if(_0x132075>=_0x242e71){_0x132075=_0x242e71;_0x4acada=0xc8;}else{_0x4acada=0xce;}_0x352d98[_0xfbbb('0x17')](_0x4acada);return _0x352d98[_0xfbbb('0x1e')](_0xfbbb('0x1f'),_0x5081ac+'-'+_0x132075+'/'+_0x242e71)['json'](_0x7cd15f);}return null;};}function patchUpdates(_0x5d4947){return function(_0x3e8f3c){try{jsonpatch[_0xfbbb('0x20')](_0x3e8f3c,_0x5d4947,!![]);}catch(_0x5da6e1){return BPromise[_0xfbbb('0x21')](_0x5da6e1);}return _0x3e8f3c[_0xfbbb('0x22')]();};}function saveUpdates(_0x1cecad,_0x1c13c4){return function(_0x56f7c4){if(_0x56f7c4){return _0x56f7c4[_0xfbbb('0x23')](_0x1cecad)[_0xfbbb('0x24')](function(_0xd52346){return _0xd52346;});}return null;};}function removeEntity(_0x485ab2,_0x539c71){return function(_0x1bf549){if(_0x1bf549){return _0x1bf549[_0xfbbb('0x25')]()[_0xfbbb('0x24')](function(){var _0x57b3db=_0x1bf549[_0xfbbb('0x26')]({'plain':!![]});var _0x985749=_0xfbbb('0x27');return db['UserProfileResource'][_0xfbbb('0x25')]({'where':{'type':_0x985749,'resourceId':_0x57b3db['id']}})[_0xfbbb('0x24')](function(){return _0x1bf549;});})[_0xfbbb('0x24')](function(){_0x485ab2['status'](0xcc)[_0xfbbb('0x18')]();});}};}function handleEntityNotFound(_0x3a47f2,_0x406ff0){return function(_0x291f3d){if(!_0x291f3d){_0x3a47f2['sendStatus'](0x194);}return _0x291f3d;};}function handleError(_0x5afe5e,_0x384d13){_0x384d13=_0x384d13||0x1f4;return function(_0x280be4){logger[_0xfbbb('0x28')](_0x280be4['stack']);if(_0x280be4['name']){delete _0x280be4['name'];}_0x5afe5e[_0xfbbb('0x17')](_0x384d13)[_0xfbbb('0x29')](_0x280be4);};}exports[_0xfbbb('0x2a')]=function(_0x13220c,_0x303a78){var _0x330da8={},_0x3ea3bd={},_0x217699={'count':0x0,'rows':[]};var _0x272120=_[_0xfbbb('0x2b')](db[_0xfbbb('0x2c')][_0xfbbb('0x2d')],function(_0x22f530){return{'name':_0x22f530[_0xfbbb('0x2e')],'type':_0x22f530[_0xfbbb('0x2f')][_0xfbbb('0x30')]};});_0x3ea3bd['model']=_['map'](_0x272120,'name');_0x3ea3bd[_0xfbbb('0x31')]=_['keys'](_0x13220c['query']);_0x3ea3bd[_0xfbbb('0x32')]=_[_0xfbbb('0x33')](_0x3ea3bd[_0xfbbb('0x34')],_0x3ea3bd[_0xfbbb('0x31')]);_0x330da8[_0xfbbb('0x35')]=_[_0xfbbb('0x33')](_0x3ea3bd[_0xfbbb('0x34')],qs[_0xfbbb('0x36')](_0x13220c['query'][_0xfbbb('0x36')]));_0x330da8[_0xfbbb('0x35')]=_0x330da8[_0xfbbb('0x35')][_0xfbbb('0x37')]?_0x330da8[_0xfbbb('0x35')]:_0x3ea3bd[_0xfbbb('0x34')];if(!_0x13220c['query'][_0xfbbb('0x38')](_0xfbbb('0x39'))){_0x330da8[_0xfbbb('0x1d')]=qs[_0xfbbb('0x1d')](_0x13220c[_0xfbbb('0x31')][_0xfbbb('0x1d')]);_0x330da8[_0xfbbb('0x1a')]=qs[_0xfbbb('0x1a')](_0x13220c[_0xfbbb('0x31')]['offset']);}_0x330da8[_0xfbbb('0x3a')]=qs[_0xfbbb('0x3b')](_0x13220c[_0xfbbb('0x31')]['sort']);_0x330da8[_0xfbbb('0x3c')]=qs[_0xfbbb('0x32')](_[_0xfbbb('0x3d')](_0x13220c['query'],_0x3ea3bd[_0xfbbb('0x32')]),_0x272120);if(_0x13220c[_0xfbbb('0x31')][_0xfbbb('0x3e')]){_0x330da8[_0xfbbb('0x3c')]=_['merge'](_0x330da8[_0xfbbb('0x3c')],{'$or':_['map'](_0x272120,function(_0xd22908){if(_0xd22908[_0xfbbb('0x2f')]!==_0xfbbb('0x3f')){var _0x1f94a3={};_0x1f94a3[_0xd22908[_0xfbbb('0x40')]]={'$like':'%'+_0x13220c[_0xfbbb('0x31')][_0xfbbb('0x3e')]+'%'};return _0x1f94a3;}})});}_0x330da8=_[_0xfbbb('0x41')]({},_0x330da8,_0x13220c['options']);var _0x478c78={'where':_0x330da8[_0xfbbb('0x3c')]};return db[_0xfbbb('0x2c')][_0xfbbb('0x1c')](_0x478c78)[_0xfbbb('0x24')](function(_0x3b3cf6){_0x217699['count']=_0x3b3cf6;if(_0x13220c['query'][_0xfbbb('0x42')]){_0x330da8[_0xfbbb('0x43')]=[{'all':!![]}];}return db[_0xfbbb('0x2c')]['findAll'](_0x330da8);})[_0xfbbb('0x24')](function(_0x51b046){_0x217699[_0xfbbb('0x44')]=_0x51b046;return _0x217699;})[_0xfbbb('0x24')](respondWithFilteredResult(_0x303a78,_0x330da8))[_0xfbbb('0x45')](handleError(_0x303a78,null));};exports[_0xfbbb('0x46')]=function(_0x4a3a4d,_0x25f26d){var _0x258d72={'raw':!![],'where':{'id':_0x4a3a4d[_0xfbbb('0x47')]['id']}},_0x4ef756={};_0x4ef756['model']=_[_0xfbbb('0x48')](db['ContactItemType'][_0xfbbb('0x2d')]);_0x4ef756[_0xfbbb('0x31')]=_[_0xfbbb('0x48')](_0x4a3a4d[_0xfbbb('0x31')]);_0x4ef756[_0xfbbb('0x32')]=_['intersection'](_0x4ef756[_0xfbbb('0x34')],_0x4ef756[_0xfbbb('0x31')]);_0x258d72[_0xfbbb('0x35')]=_[_0xfbbb('0x33')](_0x4ef756[_0xfbbb('0x34')],qs[_0xfbbb('0x36')](_0x4a3a4d[_0xfbbb('0x31')][_0xfbbb('0x36')]));_0x258d72[_0xfbbb('0x35')]=_0x258d72[_0xfbbb('0x35')]['length']?_0x258d72[_0xfbbb('0x35')]:_0x4ef756[_0xfbbb('0x34')];if(_0x4a3a4d[_0xfbbb('0x31')][_0xfbbb('0x42')]){_0x258d72['include']=[{'all':!![]}];}_0x258d72=_[_0xfbbb('0x41')]({},_0x258d72,_0x4a3a4d[_0xfbbb('0x49')]);return db[_0xfbbb('0x2c')][_0xfbbb('0x4a')](_0x258d72)[_0xfbbb('0x24')](handleEntityNotFound(_0x25f26d,null))[_0xfbbb('0x24')](respondWithResult(_0x25f26d,null))['catch'](handleError(_0x25f26d,null));};exports[_0xfbbb('0x4b')]=function(_0x691e71,_0x32331d){return db[_0xfbbb('0x2c')][_0xfbbb('0x4b')](_0x691e71[_0xfbbb('0x4c')],{})[_0xfbbb('0x24')](function(_0x16c05a){var _0x4cb682=_0x691e71[_0xfbbb('0x4d')][_0xfbbb('0x26')]({'plain':!![]});if(!_0x4cb682)throw new Error(_0xfbbb('0x4e'));if(_0x4cb682['role']==='user'){var _0x2e213b=_0x16c05a[_0xfbbb('0x26')]({'plain':!![]});var _0xaa5110=_0xfbbb('0x27');return db[_0xfbbb('0x4f')][_0xfbbb('0x4a')]({'where':{'name':_0xaa5110,'userProfileId':_0x4cb682[_0xfbbb('0x50')]},'raw':!![]})[_0xfbbb('0x24')](function(_0x406e04){if(_0x406e04&&_0x406e04[_0xfbbb('0x51')]===0x0){return db['UserProfileResource'][_0xfbbb('0x4b')]({'name':_0x2e213b[_0xfbbb('0x40')],'resourceId':_0x2e213b['id'],'type':_0x406e04[_0xfbbb('0x40')],'sectionId':_0x406e04['id']},{})[_0xfbbb('0x24')](function(){return _0x16c05a;});}else{return _0x16c05a;}})['catch'](function(_0x47d9ea){logger[_0xfbbb('0x28')](_0xfbbb('0x52'),_0x47d9ea);throw _0x47d9ea;});}return _0x16c05a;})['then'](respondWithResult(_0x32331d,0xc9))[_0xfbbb('0x45')](handleError(_0x32331d,null));};exports['update']=function(_0x7e5719,_0x5572f7){if(_0x7e5719[_0xfbbb('0x4c')]['id']){delete _0x7e5719[_0xfbbb('0x4c')]['id'];}return db['ContactItemType'][_0xfbbb('0x4a')]({'where':{'id':_0x7e5719[_0xfbbb('0x47')]['id']}})[_0xfbbb('0x24')](handleEntityNotFound(_0x5572f7,null))[_0xfbbb('0x24')](saveUpdates(_0x7e5719[_0xfbbb('0x4c')],null))['then'](respondWithResult(_0x5572f7,null))[_0xfbbb('0x45')](handleError(_0x5572f7,null));};exports['destroy']=function(_0x249f81,_0xa746db){return db[_0xfbbb('0x2c')]['find']({'where':{'id':_0x249f81[_0xfbbb('0x47')]['id']}})[_0xfbbb('0x24')](handleEntityNotFound(_0xa746db,null))[_0xfbbb('0x24')](removeEntity(_0xa746db,null))['catch'](handleError(_0xa746db,null));}; \ No newline at end of file +var _0xca94=['../../mysqldb','sendStatus','status','end','json','offset','undefined','set','Content-Range','apply','reject','then','get','ContactItemTypes','UserProfileResource','destroy','stack','name','map','ContactItemType','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','catch','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','autoAssociation','update','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x12cde4,_0x2d2153){var _0x24deef=function(_0x3cbf5c){while(--_0x3cbf5c){_0x12cde4['push'](_0x12cde4['shift']());}};_0x24deef(++_0x2d2153);}(_0xca94,0x88));var _0x4ca9=function(_0x1cb0b4,_0x1fd48d){_0x1cb0b4=_0x1cb0b4-0x0;var _0x525b60=_0xca94[_0x1cb0b4];return _0x525b60;};'use strict';var emlformat=require(_0x4ca9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4ca9('0x1'));var jsonpatch=require(_0x4ca9('0x2'));var rp=require(_0x4ca9('0x3'));var moment=require('moment');var BPromise=require(_0x4ca9('0x4'));var Mustache=require(_0x4ca9('0x5'));var util=require(_0x4ca9('0x6'));var path=require(_0x4ca9('0x7'));var sox=require(_0x4ca9('0x8'));var csv=require('to-csv');var ejs=require(_0x4ca9('0x9'));var fs=require('fs');var fs_extra=require(_0x4ca9('0xa'));var _=require(_0x4ca9('0xb'));var squel=require(_0x4ca9('0xc'));var crypto=require(_0x4ca9('0xd'));var jsforce=require(_0x4ca9('0xe'));var deskjs=require(_0x4ca9('0xf'));var toCsv=require(_0x4ca9('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4ca9('0x11'));var authService=require(_0x4ca9('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x4ca9('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4ca9('0x14'))(_0x4ca9('0x15'));var utils=require(_0x4ca9('0x16'));var config=require(_0x4ca9('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x4ca9('0x18'))['db'];function respondWithStatusCode(_0x4f6a84,_0x45a993){_0x45a993=_0x45a993||0xcc;return function(_0x144260){if(_0x144260){return _0x4f6a84[_0x4ca9('0x19')](_0x45a993);}return _0x4f6a84[_0x4ca9('0x1a')](_0x45a993)[_0x4ca9('0x1b')]();};}function respondWithResult(_0x86942,_0x51b17d){_0x51b17d=_0x51b17d||0xc8;return function(_0x229ca1){if(_0x229ca1){return _0x86942[_0x4ca9('0x1a')](_0x51b17d)[_0x4ca9('0x1c')](_0x229ca1);}};}function respondWithFilteredResult(_0x2dfc88,_0x4dd8b1){return function(_0x132f64){if(_0x132f64){var _0x5b7d6d=typeof _0x4dd8b1[_0x4ca9('0x1d')]===_0x4ca9('0x1e')&&typeof _0x4dd8b1['limit']==='undefined';var _0x594ed3=_0x132f64['count'];var _0x3619bf=_0x5b7d6d?0x0:_0x4dd8b1[_0x4ca9('0x1d')];var _0x3cbfed=_0x5b7d6d?_0x132f64['count']:_0x4dd8b1[_0x4ca9('0x1d')]+_0x4dd8b1['limit'];var _0xad9437;if(_0x3cbfed>=_0x594ed3){_0x3cbfed=_0x594ed3;_0xad9437=0xc8;}else{_0xad9437=0xce;}_0x2dfc88[_0x4ca9('0x1a')](_0xad9437);return _0x2dfc88[_0x4ca9('0x1f')](_0x4ca9('0x20'),_0x3619bf+'-'+_0x3cbfed+'/'+_0x594ed3)[_0x4ca9('0x1c')](_0x132f64);}return null;};}function patchUpdates(_0x5e4f2f){return function(_0x3c288e){try{jsonpatch[_0x4ca9('0x21')](_0x3c288e,_0x5e4f2f,!![]);}catch(_0x3976e1){return BPromise[_0x4ca9('0x22')](_0x3976e1);}return _0x3c288e['save']();};}function saveUpdates(_0x406cff,_0x5b91d4){return function(_0x68363a){if(_0x68363a){return _0x68363a['update'](_0x406cff)[_0x4ca9('0x23')](function(_0x1c38d3){return _0x1c38d3;});}return null;};}function removeEntity(_0xeb277a,_0x2ec177){return function(_0x4cccf2){if(_0x4cccf2){return _0x4cccf2['destroy']()['then'](function(){var _0x2386cd=_0x4cccf2[_0x4ca9('0x24')]({'plain':!![]});var _0x1035e2=_0x4ca9('0x25');return db[_0x4ca9('0x26')][_0x4ca9('0x27')]({'where':{'type':_0x1035e2,'resourceId':_0x2386cd['id']}})[_0x4ca9('0x23')](function(){return _0x4cccf2;});})[_0x4ca9('0x23')](function(){_0xeb277a[_0x4ca9('0x1a')](0xcc)[_0x4ca9('0x1b')]();});}};}function handleEntityNotFound(_0x50f0fc,_0x206149){return function(_0x210385){if(!_0x210385){_0x50f0fc[_0x4ca9('0x19')](0x194);}return _0x210385;};}function handleError(_0xbb7835,_0x24f88c){_0x24f88c=_0x24f88c||0x1f4;return function(_0x486556){logger['error'](_0x486556[_0x4ca9('0x28')]);if(_0x486556[_0x4ca9('0x29')]){delete _0x486556[_0x4ca9('0x29')];}_0xbb7835['status'](_0x24f88c)['send'](_0x486556);};}exports['index']=function(_0x37e6a8,_0x6f549d){var _0x513a76={},_0x21b43d={},_0x561a67={'count':0x0,'rows':[]};var _0x13e32a=_[_0x4ca9('0x2a')](db[_0x4ca9('0x2b')]['rawAttributes'],function(_0x398cb1){return{'name':_0x398cb1['fieldName'],'type':_0x398cb1[_0x4ca9('0x2c')][_0x4ca9('0x2d')]};});_0x21b43d[_0x4ca9('0x2e')]=_[_0x4ca9('0x2a')](_0x13e32a,_0x4ca9('0x29'));_0x21b43d[_0x4ca9('0x2f')]=_[_0x4ca9('0x30')](_0x37e6a8['query']);_0x21b43d[_0x4ca9('0x31')]=_['intersection'](_0x21b43d[_0x4ca9('0x2e')],_0x21b43d[_0x4ca9('0x2f')]);_0x513a76[_0x4ca9('0x32')]=_[_0x4ca9('0x33')](_0x21b43d[_0x4ca9('0x2e')],qs[_0x4ca9('0x34')](_0x37e6a8[_0x4ca9('0x2f')][_0x4ca9('0x34')]));_0x513a76[_0x4ca9('0x32')]=_0x513a76[_0x4ca9('0x32')][_0x4ca9('0x35')]?_0x513a76[_0x4ca9('0x32')]:_0x21b43d['model'];if(!_0x37e6a8[_0x4ca9('0x2f')][_0x4ca9('0x36')](_0x4ca9('0x37'))){_0x513a76['limit']=qs[_0x4ca9('0x38')](_0x37e6a8['query'][_0x4ca9('0x38')]);_0x513a76[_0x4ca9('0x1d')]=qs[_0x4ca9('0x1d')](_0x37e6a8[_0x4ca9('0x2f')][_0x4ca9('0x1d')]);}_0x513a76[_0x4ca9('0x39')]=qs[_0x4ca9('0x3a')](_0x37e6a8[_0x4ca9('0x2f')][_0x4ca9('0x3a')]);_0x513a76[_0x4ca9('0x3b')]=qs[_0x4ca9('0x31')](_[_0x4ca9('0x3c')](_0x37e6a8[_0x4ca9('0x2f')],_0x21b43d[_0x4ca9('0x31')]),_0x13e32a);if(_0x37e6a8['query']['filter']){_0x513a76[_0x4ca9('0x3b')]=_[_0x4ca9('0x3d')](_0x513a76[_0x4ca9('0x3b')],{'$or':_[_0x4ca9('0x2a')](_0x13e32a,function(_0x51f98c){if(_0x51f98c[_0x4ca9('0x2c')]!==_0x4ca9('0x3e')){var _0x1b7c9d={};_0x1b7c9d[_0x51f98c[_0x4ca9('0x29')]]={'$like':'%'+_0x37e6a8[_0x4ca9('0x2f')][_0x4ca9('0x3f')]+'%'};return _0x1b7c9d;}})});}_0x513a76=_[_0x4ca9('0x3d')]({},_0x513a76,_0x37e6a8[_0x4ca9('0x40')]);var _0x10b5c9={'where':_0x513a76[_0x4ca9('0x3b')]};return db[_0x4ca9('0x2b')]['count'](_0x10b5c9)[_0x4ca9('0x23')](function(_0x51d317){_0x561a67[_0x4ca9('0x41')]=_0x51d317;if(_0x37e6a8[_0x4ca9('0x2f')][_0x4ca9('0x42')]){_0x513a76[_0x4ca9('0x43')]=[{'all':!![]}];}return db[_0x4ca9('0x2b')][_0x4ca9('0x44')](_0x513a76);})[_0x4ca9('0x23')](function(_0x32929e){_0x561a67[_0x4ca9('0x45')]=_0x32929e;return _0x561a67;})[_0x4ca9('0x23')](respondWithFilteredResult(_0x6f549d,_0x513a76))[_0x4ca9('0x46')](handleError(_0x6f549d,null));};exports['show']=function(_0xa111e0,_0x1c3d11){var _0x9b0f3d={'raw':!![],'where':{'id':_0xa111e0[_0x4ca9('0x47')]['id']}},_0x435b76={};_0x435b76['model']=_['keys'](db[_0x4ca9('0x2b')]['rawAttributes']);_0x435b76[_0x4ca9('0x2f')]=_[_0x4ca9('0x30')](_0xa111e0['query']);_0x435b76['filters']=_[_0x4ca9('0x33')](_0x435b76[_0x4ca9('0x2e')],_0x435b76[_0x4ca9('0x2f')]);_0x9b0f3d['attributes']=_[_0x4ca9('0x33')](_0x435b76['model'],qs[_0x4ca9('0x34')](_0xa111e0['query'][_0x4ca9('0x34')]));_0x9b0f3d[_0x4ca9('0x32')]=_0x9b0f3d[_0x4ca9('0x32')][_0x4ca9('0x35')]?_0x9b0f3d[_0x4ca9('0x32')]:_0x435b76[_0x4ca9('0x2e')];if(_0xa111e0[_0x4ca9('0x2f')]['includeAll']){_0x9b0f3d[_0x4ca9('0x43')]=[{'all':!![]}];}_0x9b0f3d=_[_0x4ca9('0x3d')]({},_0x9b0f3d,_0xa111e0[_0x4ca9('0x40')]);return db[_0x4ca9('0x2b')][_0x4ca9('0x48')](_0x9b0f3d)['then'](handleEntityNotFound(_0x1c3d11,null))[_0x4ca9('0x23')](respondWithResult(_0x1c3d11,null))['catch'](handleError(_0x1c3d11,null));};exports[_0x4ca9('0x49')]=function(_0x11f1b3,_0x1e396c){return db[_0x4ca9('0x2b')][_0x4ca9('0x49')](_0x11f1b3[_0x4ca9('0x4a')],{})[_0x4ca9('0x23')](function(_0x4e7fd3){var _0x310372=_0x11f1b3['user'][_0x4ca9('0x24')]({'plain':!![]});if(!_0x310372)throw new Error(_0x4ca9('0x4b'));if(_0x310372[_0x4ca9('0x4c')]===_0x4ca9('0x4d')){var _0x3bfac2=_0x4e7fd3[_0x4ca9('0x24')]({'plain':!![]});var _0x509ae9=_0x4ca9('0x25');return db['UserProfileSection']['find']({'where':{'name':_0x509ae9,'userProfileId':_0x310372['userProfileId']},'raw':!![]})['then'](function(_0x4ab9fe){if(_0x4ab9fe&&_0x4ab9fe[_0x4ca9('0x4e')]===0x0){return db['UserProfileResource'][_0x4ca9('0x49')]({'name':_0x3bfac2[_0x4ca9('0x29')],'resourceId':_0x3bfac2['id'],'type':_0x4ab9fe['name'],'sectionId':_0x4ab9fe['id']},{})['then'](function(){return _0x4e7fd3;});}else{return _0x4e7fd3;}})[_0x4ca9('0x46')](function(_0x321170){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x321170);throw _0x321170;});}return _0x4e7fd3;})[_0x4ca9('0x23')](respondWithResult(_0x1e396c,0xc9))['catch'](handleError(_0x1e396c,null));};exports[_0x4ca9('0x4f')]=function(_0x4a220b,_0x261596){if(_0x4a220b[_0x4ca9('0x4a')]['id']){delete _0x4a220b[_0x4ca9('0x4a')]['id'];}return db['ContactItemType'][_0x4ca9('0x48')]({'where':{'id':_0x4a220b['params']['id']}})[_0x4ca9('0x23')](handleEntityNotFound(_0x261596,null))[_0x4ca9('0x23')](saveUpdates(_0x4a220b[_0x4ca9('0x4a')],null))[_0x4ca9('0x23')](respondWithResult(_0x261596,null))['catch'](handleError(_0x261596,null));};exports[_0x4ca9('0x27')]=function(_0x26e0ba,_0x4d56fc){return db[_0x4ca9('0x2b')][_0x4ca9('0x48')]({'where':{'id':_0x26e0ba[_0x4ca9('0x47')]['id']}})[_0x4ca9('0x23')](handleEntityNotFound(_0x4d56fc,null))[_0x4ca9('0x23')](removeEntity(_0x4d56fc,null))[_0x4ca9('0x46')](handleError(_0x4d56fc,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index 04416cc..c51d092 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 _0x4de4=['api','moment','bluebird','request-promise','../../config/environment','./contactItemType.attributes','exports','ContactItemType','tools_contact_item_types','lodash','util','../../config/logger'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4de4,0x111));var _0x44de=function(_0x394ff4,_0x7c300b){_0x394ff4=_0x394ff4-0x0;var _0x4667ea=_0x4de4[_0x394ff4];return _0x4667ea;};'use strict';var _=require(_0x44de('0x0'));var util=require(_0x44de('0x1'));var logger=require(_0x44de('0x2'))(_0x44de('0x3'));var moment=require(_0x44de('0x4'));var BPromise=require(_0x44de('0x5'));var rp=require(_0x44de('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x44de('0x7'));var attributes=require(_0x44de('0x8'));module[_0x44de('0x9')]=function(_0x2067fd,_0x28957f){return _0x2067fd['define'](_0x44de('0xa'),attributes,{'tableName':_0x44de('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x80c6=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./contactItemType.attributes','exports','define','ContactItemType','tools_contact_item_types','lodash'];(function(_0x478927,_0x137268){var _0x37223f=function(_0x16faf8){while(--_0x16faf8){_0x478927['push'](_0x478927['shift']());}};_0x37223f(++_0x137268);}(_0x80c6,0x1a3));var _0x680c=function(_0x3abf2c,_0x4286e5){_0x3abf2c=_0x3abf2c-0x0;var _0x1f629e=_0x80c6[_0x3abf2c];return _0x1f629e;};'use strict';var _=require(_0x680c('0x0'));var util=require(_0x680c('0x1'));var logger=require('../../config/logger')(_0x680c('0x2'));var moment=require(_0x680c('0x3'));var BPromise=require(_0x680c('0x4'));var rp=require(_0x680c('0x5'));var fs=require('fs');var path=require(_0x680c('0x6'));var rimraf=require(_0x680c('0x7'));var config=require(_0x680c('0x8'));var attributes=require(_0x680c('0x9'));module[_0x680c('0xa')]=function(_0x3d8bd2,_0x1f7ae2){return _0x3d8bd2[_0x680c('0xb')](_0x680c('0xc'),attributes,{'tableName':_0x680c('0xd'),'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 088533a..826974d 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 _0x53b7=['../../config/utils','rpc','jayson/promise','client','http','request','then','ContactItemType,\x20%s,\x20%s','debug','ContactItemType,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x478703,_0x1bba1b){var _0x4e5e03=function(_0x47d1ca){while(--_0x47d1ca){_0x478703['push'](_0x478703['shift']());}};_0x4e5e03(++_0x1bba1b);}(_0x53b7,0x170));var _0x753b=function(_0x47ebe1,_0x149f7d){_0x47ebe1=_0x47ebe1-0x0;var _0x670800=_0x53b7[_0x47ebe1];return _0x670800;};'use strict';var _=require(_0x753b('0x0'));var util=require(_0x753b('0x1'));var moment=require(_0x753b('0x2'));var BPromise=require(_0x753b('0x3'));var rs=require(_0x753b('0x4'));var fs=require('fs');var Redis=require(_0x753b('0x5'));var db=require(_0x753b('0x6'))['db'];var utils=require(_0x753b('0x7'));var logger=require('../../config/logger')(_0x753b('0x8'));var config=require('../../config/environment');var jayson=require(_0x753b('0x9'));var client=jayson[_0x753b('0xa')][_0x753b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3bb0da,_0x3ed3cc,_0x1a3b67){return new BPromise(function(_0x2014b7,_0x2fbac8){return client[_0x753b('0xc')](_0x3bb0da,_0x1a3b67)[_0x753b('0xd')](function(_0x36431a){logger['info'](_0x753b('0xe'),_0x3ed3cc,'request\x20sent');logger[_0x753b('0xf')](_0x753b('0x10'),_0x3ed3cc,_0x753b('0x11'),JSON[_0x753b('0x12')](_0x36431a));if(_0x36431a[_0x753b('0x13')]){if(_0x36431a[_0x753b('0x13')][_0x753b('0x14')]===0x1f4){logger[_0x753b('0x13')](_0x753b('0xe'),_0x3ed3cc,_0x36431a[_0x753b('0x13')][_0x753b('0x15')]);return _0x2fbac8(_0x36431a['error']['message']);}logger['error'](_0x753b('0xe'),_0x3ed3cc,_0x36431a[_0x753b('0x13')]['message']);return _0x2014b7(_0x36431a[_0x753b('0x13')][_0x753b('0x15')]);}else{logger[_0x753b('0x16')](_0x753b('0xe'),_0x3ed3cc,_0x753b('0x11'));_0x2014b7(_0x36431a[_0x753b('0x17')][_0x753b('0x15')]);}})[_0x753b('0x18')](function(_0x5a6834){logger[_0x753b('0x13')](_0x753b('0xe'),_0x3ed3cc,_0x5a6834);_0x2fbac8(_0x5a6834);});});} \ No newline at end of file +var _0x95a9=['debug','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','ContactItemType,\x20%s,\x20%s','request\x20sent'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0x95a9,0x10b));var _0x995a=function(_0x137f74,_0x55292b){_0x137f74=_0x137f74-0x0;var _0x2d11a1=_0x95a9[_0x137f74];return _0x2d11a1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x995a('0x0'));var BPromise=require(_0x995a('0x1'));var rs=require(_0x995a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x995a('0x3'));var logger=require(_0x995a('0x4'))(_0x995a('0x5'));var config=require(_0x995a('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x995a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x572282,_0x26d553,_0x368b77){return new BPromise(function(_0x5b4a60,_0x35327a){return client[_0x995a('0x8')](_0x572282,_0x368b77)[_0x995a('0x9')](function(_0x5ef9bc){logger[_0x995a('0xa')](_0x995a('0xb'),_0x26d553,_0x995a('0xc'));logger[_0x995a('0xd')](_0x995a('0xe'),_0x26d553,_0x995a('0xc'),JSON[_0x995a('0xf')](_0x5ef9bc));if(_0x5ef9bc[_0x995a('0x10')]){if(_0x5ef9bc[_0x995a('0x10')][_0x995a('0x11')]===0x1f4){logger[_0x995a('0x10')](_0x995a('0xb'),_0x26d553,_0x5ef9bc['error'][_0x995a('0x12')]);return _0x35327a(_0x5ef9bc[_0x995a('0x10')][_0x995a('0x12')]);}logger['error'](_0x995a('0xb'),_0x26d553,_0x5ef9bc[_0x995a('0x10')][_0x995a('0x12')]);return _0x5b4a60(_0x5ef9bc[_0x995a('0x10')][_0x995a('0x12')]);}else{logger[_0x995a('0xa')](_0x995a('0xb'),_0x26d553,_0x995a('0xc'));_0x5b4a60(_0x5ef9bc['result'][_0x995a('0x12')]);}})[_0x995a('0x13')](function(_0x3fe4f2){logger[_0x995a('0x10')]('ContactItemType,\x20%s,\x20%s',_0x26d553,_0x3fe4f2);_0x35327a(_0x3fe4f2);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index 90f3148..28aa784 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 _0x19b3=['create','put','isAuthenticated','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','/:id','show','post'];(function(_0x36fe46,_0x40010c){var _0x4d2e9c=function(_0x2dfa20){while(--_0x2dfa20){_0x36fe46['push'](_0x36fe46['shift']());}};_0x4d2e9c(++_0x40010c);}(_0x19b3,0x1be));var _0x319b=function(_0x14e27a,_0x3b4136){_0x14e27a=_0x14e27a-0x0;var _0x288688=_0x19b3[_0x14e27a];return _0x288688;};'use strict';var multer=require(_0x319b('0x0'));var util=require(_0x319b('0x1'));var path=require(_0x319b('0x2'));var timeout=require(_0x319b('0x3'));var express=require(_0x319b('0x4'));var router=express[_0x319b('0x5')]();var fs_extra=require(_0x319b('0x6'));var auth=require(_0x319b('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x319b('0x8'));var controller=require('./contactItemType.controller');router[_0x319b('0x9')]('/',auth['isAuthenticated'](),controller[_0x319b('0xa')]);router[_0x319b('0x9')](_0x319b('0xb'),auth['isAuthenticated'](),controller[_0x319b('0xc')]);router[_0x319b('0xd')]('/',auth['isAuthenticated'](),controller[_0x319b('0xe')]);router[_0x319b('0xf')]('/:id',auth[_0x319b('0x10')](),controller[_0x319b('0x11')]);router['delete'](_0x319b('0xb'),auth[_0x319b('0x10')](),controller[_0x319b('0x12')]);module[_0x319b('0x13')]=router; \ No newline at end of file +var _0x685d=['isAuthenticated','/:id','show','create','put','update','destroy','exports','multer','path','Router','fs-extra','./contactItemType.controller','get'];(function(_0x450c90,_0x1d279e){var _0xa56dcc=function(_0x1ae3fd){while(--_0x1ae3fd){_0x450c90['push'](_0x450c90['shift']());}};_0xa56dcc(++_0x1d279e);}(_0x685d,0x1d6));var _0xd685=function(_0x551835,_0x8f77f7){_0x551835=_0x551835-0x0;var _0x27019f=_0x685d[_0x551835];return _0x27019f;};'use strict';var multer=require(_0xd685('0x0'));var util=require('util');var path=require(_0xd685('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd685('0x2')]();var fs_extra=require(_0xd685('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd685('0x4'));router[_0xd685('0x5')]('/',auth[_0xd685('0x6')](),controller['index']);router['get'](_0xd685('0x7'),auth[_0xd685('0x6')](),controller[_0xd685('0x8')]);router['post']('/',auth[_0xd685('0x6')](),controller[_0xd685('0x9')]);router[_0xd685('0xa')](_0xd685('0x7'),auth[_0xd685('0x6')](),controller[_0xd685('0xb')]);router['delete'](_0xd685('0x7'),auth[_0xd685('0x6')](),controller[_0xd685('0xc')]);module[_0xd685('0xd')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index fcbe0a0..a4cefb5 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 _0x757a=['exports','STRING'];(function(_0x2f86f8,_0x404cf8){var _0x4fce92=function(_0x28c6eb){while(--_0x28c6eb){_0x2f86f8['push'](_0x2f86f8['shift']());}};_0x4fce92(++_0x404cf8);}(_0x757a,0xde));var _0xa757=function(_0x4aded0,_0x540880){_0x4aded0=_0x4aded0-0x0;var _0xd30355=_0x757a[_0x4aded0];return _0xd30355;};'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 +var _0xb10b=['name','sequelize','STRING'];(function(_0x8396b2,_0x55705b){var _0x5265b3=function(_0xb3e904){while(--_0xb3e904){_0x8396b2['push'](_0x8396b2['shift']());}};_0x5265b3(++_0x55705b);}(_0xb10b,0x12a));var _0xbb10=function(_0x267cf4,_0xcbcf72){_0x267cf4=_0x267cf4-0x0;var _0x4824cf=_0xb10b[_0x267cf4];return _0x4824cf;};'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 diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index eeeed9e..b194132 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 _0x5221=['crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','apply','reject','then','destroy','CustomDashboards','stack','name','send','index','map','Dashboard','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','params','find','catch','create','body','get','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','length','omit','createdAt','updatedAt','role','iframe','attrUrl','attrs','https://','custom','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie3','web-report','reportType','attrReport','attrRefresh','stringify','DashboardId','DashboardItem','getItems','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','squel'];(function(_0x345346,_0x20c71e){var _0x39a3ac=function(_0x46b857){while(--_0x46b857){_0x345346['push'](_0x345346['shift']());}};_0x39a3ac(++_0x20c71e);}(_0x5221,0x15c));var _0x1522=function(_0x56c1ec,_0x11f5ee){_0x56c1ec=_0x56c1ec-0x0;var _0x515a74=_0x5221[_0x56c1ec];return _0x515a74;};'use strict';var emlformat=require(_0x1522('0x0'));var rimraf=require(_0x1522('0x1'));var zipdir=require(_0x1522('0x2'));var jsonpatch=require(_0x1522('0x3'));var rp=require(_0x1522('0x4'));var moment=require(_0x1522('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1522('0x6'));var util=require(_0x1522('0x7'));var path=require('path');var sox=require(_0x1522('0x8'));var csv=require(_0x1522('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1522('0xa'));var _=require('lodash');var squel=require(_0x1522('0xb'));var crypto=require(_0x1522('0xc'));var jsforce=require(_0x1522('0xd'));var deskjs=require(_0x1522('0xe'));var toCsv=require(_0x1522('0x9'));var querystring=require(_0x1522('0xf'));var Papa=require('papaparse');var Redis=require(_0x1522('0x10'));var authService=require(_0x1522('0x11'));var qs=require(_0x1522('0x12'));var as=require(_0x1522('0x13'));var hardwareService=require(_0x1522('0x14'));var logger=require(_0x1522('0x15'))(_0x1522('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1522('0x17'));var db=require(_0x1522('0x18'))['db'];config[_0x1522('0x19')]=_[_0x1522('0x1a')](config[_0x1522('0x19')],{'host':_0x1522('0x1b'),'port':0x18eb});var socket=require(_0x1522('0x1c'))(new Redis(config[_0x1522('0x19')]));require(_0x1522('0x1d'))[_0x1522('0x1e')](socket);function respondWithStatusCode(_0x5c769e,_0x52fe39){_0x52fe39=_0x52fe39||0xcc;return function(_0x31b7d6){if(_0x31b7d6){return _0x5c769e[_0x1522('0x1f')](_0x52fe39);}return _0x5c769e[_0x1522('0x20')](_0x52fe39)[_0x1522('0x21')]();};}function respondWithResult(_0x3f66a8,_0x163812){_0x163812=_0x163812||0xc8;return function(_0x25bc00){if(_0x25bc00){return _0x3f66a8['status'](_0x163812)[_0x1522('0x22')](_0x25bc00);}};}function respondWithFilteredResult(_0x45db2d,_0x39ca81){return function(_0x32874b){if(_0x32874b){var _0x52ad7a=typeof _0x39ca81['offset']===_0x1522('0x23')&&typeof _0x39ca81[_0x1522('0x24')]==='undefined';var _0x393623=_0x32874b[_0x1522('0x25')];var _0x20d773=_0x52ad7a?0x0:_0x39ca81[_0x1522('0x26')];var _0x11d39e=_0x52ad7a?_0x32874b[_0x1522('0x25')]:_0x39ca81[_0x1522('0x26')]+_0x39ca81[_0x1522('0x24')];var _0x435e8a;if(_0x11d39e>=_0x393623){_0x11d39e=_0x393623;_0x435e8a=0xc8;}else{_0x435e8a=0xce;}_0x45db2d[_0x1522('0x20')](_0x435e8a);return _0x45db2d['set']('Content-Range',_0x20d773+'-'+_0x11d39e+'/'+_0x393623)[_0x1522('0x22')](_0x32874b);}return null;};}function patchUpdates(_0x46fc3c){return function(_0x4abff5){try{jsonpatch[_0x1522('0x27')](_0x4abff5,_0x46fc3c,!![]);}catch(_0x51b695){return BPromise[_0x1522('0x28')](_0x51b695);}return _0x4abff5['save']();};}function saveUpdates(_0xd5feba,_0x275f9a){return function(_0x2244ca){if(_0x2244ca){return _0x2244ca['update'](_0xd5feba)[_0x1522('0x29')](function(_0x4c5e4c){return _0x4c5e4c;});}return null;};}function removeEntity(_0x125ff0,_0x1127b1){return function(_0x2cd103){if(_0x2cd103){return _0x2cd103[_0x1522('0x2a')]()[_0x1522('0x29')](function(){var _0x25f85e=_0x2cd103['get']({'plain':!![]});var _0x338d00=_0x1522('0x2b');return db['UserProfileResource'][_0x1522('0x2a')]({'where':{'type':_0x338d00,'resourceId':_0x25f85e['id']}})['then'](function(){return _0x2cd103;});})[_0x1522('0x29')](function(){_0x125ff0[_0x1522('0x20')](0xcc)[_0x1522('0x21')]();});}};}function handleEntityNotFound(_0x43e726,_0x5f5b06){return function(_0x29f115){if(!_0x29f115){_0x43e726['sendStatus'](0x194);}return _0x29f115;};}function handleError(_0x379849,_0x532bbc){_0x532bbc=_0x532bbc||0x1f4;return function(_0x2cd505){logger['error'](_0x2cd505[_0x1522('0x2c')]);if(_0x2cd505[_0x1522('0x2d')]){delete _0x2cd505[_0x1522('0x2d')];}_0x379849[_0x1522('0x20')](_0x532bbc)[_0x1522('0x2e')](_0x2cd505);};}exports[_0x1522('0x2f')]=function(_0x9aeee,_0x3bf947){var _0x4997e2={},_0x20e4b9={},_0x277449={'count':0x0,'rows':[]};var _0x27e984=_[_0x1522('0x30')](db[_0x1522('0x31')][_0x1522('0x32')],function(_0x391219){return{'name':_0x391219[_0x1522('0x33')],'type':_0x391219[_0x1522('0x34')]['key']};});_0x20e4b9[_0x1522('0x35')]=_[_0x1522('0x30')](_0x27e984,_0x1522('0x2d'));_0x20e4b9[_0x1522('0x36')]=_[_0x1522('0x37')](_0x9aeee[_0x1522('0x36')]);_0x20e4b9[_0x1522('0x38')]=_['intersection'](_0x20e4b9['model'],_0x20e4b9[_0x1522('0x36')]);_0x4997e2[_0x1522('0x39')]=_[_0x1522('0x3a')](_0x20e4b9[_0x1522('0x35')],qs[_0x1522('0x3b')](_0x9aeee[_0x1522('0x36')]['fields']));_0x4997e2[_0x1522('0x39')]=_0x4997e2[_0x1522('0x39')]['length']?_0x4997e2[_0x1522('0x39')]:_0x20e4b9['model'];if(!_0x9aeee[_0x1522('0x36')][_0x1522('0x3c')](_0x1522('0x3d'))){_0x4997e2[_0x1522('0x24')]=qs[_0x1522('0x24')](_0x9aeee[_0x1522('0x36')]['limit']);_0x4997e2[_0x1522('0x26')]=qs[_0x1522('0x26')](_0x9aeee['query']['offset']);}_0x4997e2[_0x1522('0x3e')]=qs[_0x1522('0x3f')](_0x9aeee['query']['sort']);_0x4997e2[_0x1522('0x40')]=qs[_0x1522('0x38')](_[_0x1522('0x41')](_0x9aeee[_0x1522('0x36')],_0x20e4b9[_0x1522('0x38')]),_0x27e984);if(_0x9aeee['query'][_0x1522('0x42')]){_0x4997e2[_0x1522('0x40')]=_[_0x1522('0x43')](_0x4997e2[_0x1522('0x40')],{'$or':_[_0x1522('0x30')](_0x27e984,function(_0x3525f2){if(_0x3525f2[_0x1522('0x34')]!==_0x1522('0x44')){var _0x3b3135={};_0x3b3135[_0x3525f2['name']]={'$like':'%'+_0x9aeee[_0x1522('0x36')][_0x1522('0x42')]+'%'};return _0x3b3135;}})});}_0x4997e2=_['merge']({},_0x4997e2,_0x9aeee[_0x1522('0x45')]);var _0x1e6e60={'where':_0x4997e2[_0x1522('0x40')]};return db[_0x1522('0x31')][_0x1522('0x25')](_0x1e6e60)[_0x1522('0x29')](function(_0x22414b){_0x277449[_0x1522('0x25')]=_0x22414b;if(_0x9aeee[_0x1522('0x36')][_0x1522('0x46')]){_0x4997e2[_0x1522('0x47')]=[{'all':!![]}];}return db[_0x1522('0x31')][_0x1522('0x48')](_0x4997e2);})['then'](function(_0xfde8b){_0x277449['rows']=_0xfde8b;return _0x277449;})[_0x1522('0x29')](respondWithFilteredResult(_0x3bf947,_0x4997e2))['catch'](handleError(_0x3bf947,null));};exports['show']=function(_0x131dc8,_0x2d41e4){var _0x46a63f={'raw':![],'where':{'id':_0x131dc8[_0x1522('0x49')]['id']}},_0x131276={};_0x131276[_0x1522('0x35')]=_[_0x1522('0x37')](db[_0x1522('0x31')][_0x1522('0x32')]);_0x131276[_0x1522('0x36')]=_[_0x1522('0x37')](_0x131dc8[_0x1522('0x36')]);_0x131276[_0x1522('0x38')]=_[_0x1522('0x3a')](_0x131276['model'],_0x131276[_0x1522('0x36')]);_0x46a63f['attributes']=_[_0x1522('0x3a')](_0x131276['model'],qs[_0x1522('0x3b')](_0x131dc8[_0x1522('0x36')][_0x1522('0x3b')]));_0x46a63f[_0x1522('0x39')]=_0x46a63f[_0x1522('0x39')]['length']?_0x46a63f[_0x1522('0x39')]:_0x131276[_0x1522('0x35')];if(_0x131dc8['query'][_0x1522('0x46')]){_0x46a63f['include']=[{'all':!![]}];}_0x46a63f=_['merge']({},_0x46a63f,_0x131dc8['options']);return db[_0x1522('0x31')][_0x1522('0x4a')](_0x46a63f)[_0x1522('0x29')](handleEntityNotFound(_0x2d41e4,null))[_0x1522('0x29')](respondWithResult(_0x2d41e4,null))[_0x1522('0x4b')](handleError(_0x2d41e4,null));};exports[_0x1522('0x4c')]=function(_0x5c9e62,_0x36f9fc){return db['Dashboard']['create'](_0x5c9e62[_0x1522('0x4d')],{})[_0x1522('0x29')](function(_0x1782fd){var _0x43598b=_0x5c9e62['user'][_0x1522('0x4e')]({'plain':!![]});if(!_0x43598b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x43598b['role']===_0x1522('0x4f')){var _0x183438=_0x1782fd[_0x1522('0x4e')]({'plain':!![]});var _0x195117=_0x1522('0x2b');return db[_0x1522('0x50')][_0x1522('0x4a')]({'where':{'name':_0x195117,'userProfileId':_0x43598b[_0x1522('0x51')]},'raw':!![]})[_0x1522('0x29')](function(_0x5b2af8){if(_0x5b2af8&&_0x5b2af8[_0x1522('0x52')]===0x0){return db[_0x1522('0x53')][_0x1522('0x4c')]({'name':_0x183438[_0x1522('0x2d')],'resourceId':_0x183438['id'],'type':_0x5b2af8[_0x1522('0x2d')],'sectionId':_0x5b2af8['id']},{})[_0x1522('0x29')](function(){return _0x1782fd;});}else{return _0x1782fd;}})[_0x1522('0x4b')](function(_0x21abce){logger[_0x1522('0x54')](_0x1522('0x55'),_0x21abce);throw _0x21abce;});}return _0x1782fd;})[_0x1522('0x29')](respondWithResult(_0x36f9fc,0xc9))[_0x1522('0x4b')](handleError(_0x36f9fc,null));};exports[_0x1522('0x56')]=function(_0x2d4169,_0x487d04){var _0x2fe039={'where':{'id':_0x2d4169['params']['id']}},_0x223d0a={};_0x223d0a[_0x1522('0x35')]=_[_0x1522('0x37')](db[_0x1522('0x31')]['rawAttributes']);_0x2fe039[_0x1522('0x39')]=_[_0x1522('0x3a')](_0x223d0a[_0x1522('0x35')],qs[_0x1522('0x3b')](_0x2d4169['query'][_0x1522('0x3b')]));_0x2fe039['attributes']=_0x2fe039[_0x1522('0x39')][_0x1522('0x57')]?_0x2fe039[_0x1522('0x39')]:_0x223d0a[_0x1522('0x35')];if(_0x2d4169[_0x1522('0x36')][_0x1522('0x46')]){_0x2fe039['include']=[{'all':!![]}];}_0x2fe039=_[_0x1522('0x43')]({},_0x2fe039,_0x2d4169['options']);return db[_0x1522('0x31')]['find'](_0x2fe039)[_0x1522('0x29')](handleEntityNotFound(_0x487d04,null))[_0x1522('0x29')](function(_0x5bc8f4){if(_0x5bc8f4){var _0x575be5=_0x5bc8f4[_0x1522('0x4e')]({'plain':!![]});_0x575be5=qs[_0x1522('0x58')](_0x575be5,['id',_0x1522('0x59'),'updatedAt']);_0x2d4169[_0x1522('0x4d')]=_[_0x1522('0x58')](_0x2d4169[_0x1522('0x4d')],['id',_0x1522('0x59'),_0x1522('0x5a')]);return db[_0x1522('0x31')][_0x1522('0x4c')](_[_0x1522('0x43')](_0x575be5,_0x2d4169[_0x1522('0x4d')]),{'include':_0x2d4169['query']['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x3acfa6){var _0x179775=_0x2d4169['user'][_0x1522('0x4e')]({'plain':!![]});if(!_0x179775)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x179775[_0x1522('0x5b')]===_0x1522('0x4f')){var _0x281690=_0x3acfa6['get']({'plain':!![]});var _0x2a6485=_0x1522('0x2b');return db[_0x1522('0x50')][_0x1522('0x4a')]({'where':{'name':_0x2a6485,'userProfileId':_0x179775['userProfileId']},'raw':!![]})['then'](function(_0x57c8ff){if(_0x57c8ff&&_0x57c8ff[_0x1522('0x52')]===0x0){return db['UserProfileResource']['create']({'name':_0x281690[_0x1522('0x2d')],'resourceId':_0x281690['id'],'type':_0x57c8ff[_0x1522('0x2d')],'sectionId':_0x57c8ff['id']},{})[_0x1522('0x29')](function(){return _0x3acfa6;});}else{return _0x3acfa6;}})[_0x1522('0x4b')](function(_0x4e0f6b){logger[_0x1522('0x54')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4e0f6b);throw _0x4e0f6b;});}return _0x3acfa6;});}})['then'](respondWithResult(_0x487d04,0xc9))[_0x1522('0x4b')](handleError(_0x487d04,null));};exports['update']=function(_0x44aea3,_0x481349){if(_0x44aea3[_0x1522('0x4d')]['id']){delete _0x44aea3[_0x1522('0x4d')]['id'];}return db[_0x1522('0x31')][_0x1522('0x4a')]({'where':{'id':_0x44aea3['params']['id']}})['then'](handleEntityNotFound(_0x481349,null))[_0x1522('0x29')](saveUpdates(_0x44aea3[_0x1522('0x4d')],null))[_0x1522('0x29')](respondWithResult(_0x481349,null))[_0x1522('0x4b')](handleError(_0x481349,null));};exports[_0x1522('0x2a')]=function(_0x37151d,_0x16a2c5){return db['Dashboard'][_0x1522('0x4a')]({'where':{'id':_0x37151d['params']['id']}})[_0x1522('0x29')](handleEntityNotFound(_0x16a2c5,null))[_0x1522('0x29')](removeEntity(_0x16a2c5,null))[_0x1522('0x4b')](handleError(_0x16a2c5,null));};function widgetAttributes(_0xf3214e){try{switch(_0xf3214e[_0x1522('0x34')]){case _0x1522('0x5c'):return[{'name':_0x1522('0x5d'),'value':_0xf3214e['attrUrl']||(_0xf3214e['attrs']&&_0xf3214e[_0x1522('0x5e')][0x0]?_0xf3214e[_0x1522('0x5e')][0x0]['value']:undefined)||_0x1522('0x5f')}];case _0x1522('0x60'):return[{'name':_0x1522('0x61'),'value':_0xf3214e[_0x1522('0x61')]||(_0xf3214e[_0x1522('0x5e')]&&_0xf3214e[_0x1522('0x5e')][0x0]?_0xf3214e['attrs'][0x0][_0x1522('0x62')]:undefined)||''}];case _0x1522('0x63'):return[{'name':_0x1522('0x64'),'value':_0xf3214e[_0x1522('0x64')]||(_0xf3214e[_0x1522('0x5e')]&&_0xf3214e[_0x1522('0x5e')][0x0]?_0xf3214e[_0x1522('0x5e')][0x0][_0x1522('0x62')]:undefined)||_0x1522('0x65')},{'name':'attrTimezone','value':_0xf3214e[_0x1522('0x66')]||(_0xf3214e[_0x1522('0x5e')]&&_0xf3214e[_0x1522('0x5e')][0x1]?_0xf3214e[_0x1522('0x5e')][0x1][_0x1522('0x62')]:undefined)||'0.00'},{'name':_0x1522('0x67'),'value':_0xf3214e[_0x1522('0x67')]||(_0xf3214e['attrs']&&_0xf3214e[_0x1522('0x5e')][0x2]?_0xf3214e[_0x1522('0x5e')][0x2][_0x1522('0x62')]:undefined)||0xc}];case'counter':return[{'name':_0x1522('0x68'),'value':_0xf3214e['attrMetric']||(_0xf3214e[_0x1522('0x5e')]&&_0xf3214e[_0x1522('0x5e')][0x0]?_0xf3214e[_0x1522('0x5e')][0x0][_0x1522('0x62')]:undefined)||_0x1522('0x69')},{'name':_0x1522('0x6a'),'value':_0xf3214e['attrVoiceQueues']||(_0xf3214e[_0x1522('0x5e')]&&_0xf3214e[_0x1522('0x5e')][0x1]?_0xf3214e[_0x1522('0x5e')][0x1][_0x1522('0x62')]:undefined)||[]},{'name':'attrFontSize','value':_0xf3214e[_0x1522('0x67')]||(_0xf3214e[_0x1522('0x5e')]&&_0xf3214e[_0x1522('0x5e')][0x2]?_0xf3214e[_0x1522('0x5e')][0x2]['value']:undefined)||0x14}];case _0x1522('0x6b'):case _0x1522('0x6c'):return[{'name':_0x1522('0x6d'),'value':_0xf3214e[_0x1522('0x6d')]||(_0xf3214e[_0x1522('0x5e')]&&_0xf3214e[_0x1522('0x5e')][0x0]?_0xf3214e['attrs'][0x0][_0x1522('0x62')]:undefined)||_0x1522('0x69')},{'name':'attrSerie2','value':_0xf3214e['attrSerie2']||(_0xf3214e['attrs']&&_0xf3214e['attrs'][0x1]?_0xf3214e['attrs'][0x1][_0x1522('0x62')]:undefined)||null},{'name':'attrSerie3','value':_0xf3214e[_0x1522('0x6e')]||(_0xf3214e[_0x1522('0x5e')]&&_0xf3214e['attrs'][0x2]?_0xf3214e[_0x1522('0x5e')][0x2][_0x1522('0x62')]:undefined)||null},{'name':_0x1522('0x6a'),'value':_0xf3214e[_0x1522('0x6a')]||(_0xf3214e[_0x1522('0x5e')]&&_0xf3214e[_0x1522('0x5e')][0x3]?_0xf3214e[_0x1522('0x5e')][0x3]['value']:undefined)||[]}];case _0x1522('0x6f'):return[{'name':'attrReport','type':_0xf3214e[_0x1522('0x70')]||(_0xf3214e[_0x1522('0x5e')]&&_0xf3214e[_0x1522('0x5e')][0x0]?_0xf3214e[_0x1522('0x5e')][0x0]['type']:undefined)||null,'value':_0xf3214e[_0x1522('0x71')]||(_0xf3214e['attrs']&&_0xf3214e['attrs'][0x0]?_0xf3214e[_0x1522('0x5e')][0x0][_0x1522('0x62')]:undefined)||null},{'name':'attrRefresh','value':_0xf3214e[_0x1522('0x72')]||(_0xf3214e[_0x1522('0x5e')]&&_0xf3214e['attrs'][0x1]?_0xf3214e[_0x1522('0x5e')][0x1][_0x1522('0x62')]:undefined)||0x0}];default:return[];}}catch(_0x48b63e){logger[_0x1522('0x54')]('widgetAttributes:\x20%s',JSON[_0x1522('0x73')](_0x48b63e));return[];}}exports['addItem']=function(_0x566373,_0x5ad33c,_0x4c96d7){if(_0x566373[_0x1522('0x4d')]['id']){delete _0x566373[_0x1522('0x4d')]['id'];}return db['Dashboard']['find']({'where':{'id':_0x566373[_0x1522('0x49')]['id']}})[_0x1522('0x29')](handleEntityNotFound(_0x5ad33c,null))[_0x1522('0x29')](function(_0x462b67){if(_0x462b67){_0x566373[_0x1522('0x4d')][_0x1522('0x74')]=_0x462b67['id'];_0x566373[_0x1522('0x4d')]['attrs']=widgetAttributes(_0x566373['body']);return db[_0x1522('0x75')][_0x1522('0x4c')](_0x566373['body']);}})['then'](respondWithResult(_0x5ad33c,null))[_0x1522('0x4b')](handleError(_0x5ad33c,null));};exports[_0x1522('0x76')]=function(_0x566449,_0x2cf11e,_0x4cdc3d){var _0x3502cf={};var _0x1b6235={};var _0x546a60;var _0x5cf308;return db[_0x1522('0x31')][_0x1522('0x77')]({'where':{'id':_0x566449[_0x1522('0x49')]['id']}})['then'](handleEntityNotFound(_0x2cf11e,null))[_0x1522('0x29')](function(_0x49e98d){if(_0x49e98d){_0x546a60=_0x49e98d;_0x1b6235[_0x1522('0x35')]=_[_0x1522('0x37')](db[_0x1522('0x75')][_0x1522('0x32')]);_0x1b6235[_0x1522('0x36')]=_['keys'](_0x566449[_0x1522('0x36')]);_0x1b6235['filters']=_[_0x1522('0x3a')](_0x1b6235[_0x1522('0x35')],_0x1b6235['query']);_0x3502cf['attributes']=_['intersection'](_0x1b6235['model'],qs[_0x1522('0x3b')](_0x566449['query'][_0x1522('0x3b')]));_0x3502cf['attributes']=_0x3502cf[_0x1522('0x39')][_0x1522('0x57')]?_0x3502cf[_0x1522('0x39')]:_0x1b6235[_0x1522('0x35')];_0x3502cf['order']=qs[_0x1522('0x3f')](_0x566449[_0x1522('0x36')][_0x1522('0x3f')]);_0x3502cf['where']=qs['filters'](_[_0x1522('0x41')](_0x566449[_0x1522('0x36')],_0x1b6235['filters']));if(_0x566449['query'][_0x1522('0x42')]){_0x3502cf[_0x1522('0x40')]=_['merge'](_0x3502cf[_0x1522('0x40')],{'$or':_[_0x1522('0x30')](_0x3502cf[_0x1522('0x39')],function(_0x543b73){var _0x5bf54b={};_0x5bf54b[_0x543b73]={'$like':'%'+_0x566449[_0x1522('0x36')][_0x1522('0x42')]+'%'};return _0x5bf54b;})});}_0x3502cf=_[_0x1522('0x43')]({},_0x3502cf,_0x566449[_0x1522('0x45')]);return _0x546a60['getItems'](_0x3502cf);}})['then'](function(_0x2a924e){if(_0x2a924e){_0x5cf308=_0x2a924e[_0x1522('0x57')];if(!_0x566449['query'][_0x1522('0x3c')]('nolimit')){_0x3502cf[_0x1522('0x24')]=qs['limit'](_0x566449[_0x1522('0x36')][_0x1522('0x24')]);_0x3502cf['offset']=qs['offset'](_0x566449[_0x1522('0x36')][_0x1522('0x26')]);}return _0x546a60[_0x1522('0x76')](_0x3502cf);}})[_0x1522('0x29')](function(_0x200ab6){if(_0x200ab6){return _0x200ab6?{'count':_0x5cf308,'rows':_0x200ab6}:null;}})[_0x1522('0x29')](respondWithResult(_0x2cf11e,null))[_0x1522('0x4b')](handleError(_0x2cf11e,null));}; \ No newline at end of file +var _0x9fa8=['body','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','error','update','params','iframe','attrUrl','attrs','value','https://','attrPath','clock','attrHourFormat','attrTimezone','attrFontSize','counter','attrMetric','attrVoiceQueues','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','addItem','DashboardItem','findOne','order','pick','getItems','nolimit','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','./dashboard.socket','register','sendStatus','status','end','undefined','limit','offset','count','set','Content-Range','json','reject','save','destroy','then','get','CustomDashboards','stack','name','send','map','Dashboard','type','key','model','keys','query','attributes','length','hasOwnProperty','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','rawAttributes','intersection','fields','include','find'];(function(_0x2d465c,_0x3630c3){var _0x27fc14=function(_0x3652c1){while(--_0x3652c1){_0x2d465c['push'](_0x2d465c['shift']());}};_0x27fc14(++_0x3630c3);}(_0x9fa8,0x11a));var _0x89fa=function(_0x18c8e7,_0xf8c4fd){_0x18c8e7=_0x18c8e7-0x0;var _0x4c3bf9=_0x9fa8[_0x18c8e7];return _0x4c3bf9;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x89fa('0x0'));var jsonpatch=require(_0x89fa('0x1'));var rp=require(_0x89fa('0x2'));var moment=require('moment');var BPromise=require(_0x89fa('0x3'));var Mustache=require(_0x89fa('0x4'));var util=require(_0x89fa('0x5'));var path=require('path');var sox=require(_0x89fa('0x6'));var csv=require(_0x89fa('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x89fa('0x8'));var squel=require(_0x89fa('0x9'));var crypto=require('crypto');var jsforce=require(_0x89fa('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x89fa('0x7'));var querystring=require(_0x89fa('0xb'));var Papa=require(_0x89fa('0xc'));var Redis=require(_0x89fa('0xd'));var authService=require(_0x89fa('0xe'));var qs=require(_0x89fa('0xf'));var as=require(_0x89fa('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x89fa('0x11'));var utils=require(_0x89fa('0x12'));var config=require(_0x89fa('0x13'));var licenseUtil=require(_0x89fa('0x14'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x89fa('0x15')](config[_0x89fa('0x16')],{'host':_0x89fa('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x89fa('0x16')]));require(_0x89fa('0x18'))[_0x89fa('0x19')](socket);function respondWithStatusCode(_0x3fe33d,_0x5b4fde){_0x5b4fde=_0x5b4fde||0xcc;return function(_0x560b8c){if(_0x560b8c){return _0x3fe33d[_0x89fa('0x1a')](_0x5b4fde);}return _0x3fe33d[_0x89fa('0x1b')](_0x5b4fde)[_0x89fa('0x1c')]();};}function respondWithResult(_0x18e7be,_0x438652){_0x438652=_0x438652||0xc8;return function(_0x140c3e){if(_0x140c3e){return _0x18e7be[_0x89fa('0x1b')](_0x438652)['json'](_0x140c3e);}};}function respondWithFilteredResult(_0x2ad0d9,_0x252da4){return function(_0x2ca7de){if(_0x2ca7de){var _0x23695b=typeof _0x252da4['offset']===_0x89fa('0x1d')&&typeof _0x252da4[_0x89fa('0x1e')]===_0x89fa('0x1d');var _0x5669e3=_0x2ca7de['count'];var _0x13ce00=_0x23695b?0x0:_0x252da4[_0x89fa('0x1f')];var _0x14628b=_0x23695b?_0x2ca7de[_0x89fa('0x20')]:_0x252da4[_0x89fa('0x1f')]+_0x252da4['limit'];var _0x446295;if(_0x14628b>=_0x5669e3){_0x14628b=_0x5669e3;_0x446295=0xc8;}else{_0x446295=0xce;}_0x2ad0d9['status'](_0x446295);return _0x2ad0d9[_0x89fa('0x21')](_0x89fa('0x22'),_0x13ce00+'-'+_0x14628b+'/'+_0x5669e3)[_0x89fa('0x23')](_0x2ca7de);}return null;};}function patchUpdates(_0x305d8f){return function(_0x15b2e9){try{jsonpatch['apply'](_0x15b2e9,_0x305d8f,!![]);}catch(_0x244e47){return BPromise[_0x89fa('0x24')](_0x244e47);}return _0x15b2e9[_0x89fa('0x25')]();};}function saveUpdates(_0x30b2f3,_0x4b3efa){return function(_0x9e46a3){if(_0x9e46a3){return _0x9e46a3['update'](_0x30b2f3)['then'](function(_0x522c2d){return _0x522c2d;});}return null;};}function removeEntity(_0x19e2dc,_0x1da9e9){return function(_0x2affa6){if(_0x2affa6){return _0x2affa6[_0x89fa('0x26')]()[_0x89fa('0x27')](function(){var _0xd46922=_0x2affa6[_0x89fa('0x28')]({'plain':!![]});var _0xdadbc5=_0x89fa('0x29');return db['UserProfileResource'][_0x89fa('0x26')]({'where':{'type':_0xdadbc5,'resourceId':_0xd46922['id']}})[_0x89fa('0x27')](function(){return _0x2affa6;});})['then'](function(){_0x19e2dc['status'](0xcc)[_0x89fa('0x1c')]();});}};}function handleEntityNotFound(_0x321675,_0x21c3da){return function(_0x2159ac){if(!_0x2159ac){_0x321675[_0x89fa('0x1a')](0x194);}return _0x2159ac;};}function handleError(_0x2891ff,_0x49eb71){_0x49eb71=_0x49eb71||0x1f4;return function(_0x591bfb){logger['error'](_0x591bfb[_0x89fa('0x2a')]);if(_0x591bfb[_0x89fa('0x2b')]){delete _0x591bfb['name'];}_0x2891ff[_0x89fa('0x1b')](_0x49eb71)[_0x89fa('0x2c')](_0x591bfb);};}exports['index']=function(_0x22e919,_0x1c3fca){var _0x4bf5fc={},_0x43f04c={},_0x387bca={'count':0x0,'rows':[]};var _0x334edf=_[_0x89fa('0x2d')](db[_0x89fa('0x2e')]['rawAttributes'],function(_0x48079c){return{'name':_0x48079c['fieldName'],'type':_0x48079c[_0x89fa('0x2f')][_0x89fa('0x30')]};});_0x43f04c[_0x89fa('0x31')]=_[_0x89fa('0x2d')](_0x334edf,_0x89fa('0x2b'));_0x43f04c['query']=_[_0x89fa('0x32')](_0x22e919[_0x89fa('0x33')]);_0x43f04c['filters']=_['intersection'](_0x43f04c['model'],_0x43f04c['query']);_0x4bf5fc[_0x89fa('0x34')]=_['intersection'](_0x43f04c[_0x89fa('0x31')],qs['fields'](_0x22e919[_0x89fa('0x33')]['fields']));_0x4bf5fc[_0x89fa('0x34')]=_0x4bf5fc[_0x89fa('0x34')][_0x89fa('0x35')]?_0x4bf5fc[_0x89fa('0x34')]:_0x43f04c[_0x89fa('0x31')];if(!_0x22e919[_0x89fa('0x33')][_0x89fa('0x36')]('nolimit')){_0x4bf5fc[_0x89fa('0x1e')]=qs[_0x89fa('0x1e')](_0x22e919[_0x89fa('0x33')][_0x89fa('0x1e')]);_0x4bf5fc[_0x89fa('0x1f')]=qs[_0x89fa('0x1f')](_0x22e919[_0x89fa('0x33')][_0x89fa('0x1f')]);}_0x4bf5fc['order']=qs['sort'](_0x22e919['query'][_0x89fa('0x37')]);_0x4bf5fc[_0x89fa('0x38')]=qs[_0x89fa('0x39')](_['pick'](_0x22e919[_0x89fa('0x33')],_0x43f04c['filters']),_0x334edf);if(_0x22e919[_0x89fa('0x33')][_0x89fa('0x3a')]){_0x4bf5fc[_0x89fa('0x38')]=_[_0x89fa('0x3b')](_0x4bf5fc[_0x89fa('0x38')],{'$or':_['map'](_0x334edf,function(_0x4c0e9c){if(_0x4c0e9c[_0x89fa('0x2f')]!==_0x89fa('0x3c')){var _0x4340b6={};_0x4340b6[_0x4c0e9c[_0x89fa('0x2b')]]={'$like':'%'+_0x22e919[_0x89fa('0x33')][_0x89fa('0x3a')]+'%'};return _0x4340b6;}})});}_0x4bf5fc=_['merge']({},_0x4bf5fc,_0x22e919[_0x89fa('0x3d')]);var _0xa5883b={'where':_0x4bf5fc[_0x89fa('0x38')]};return db[_0x89fa('0x2e')][_0x89fa('0x20')](_0xa5883b)[_0x89fa('0x27')](function(_0x200ec9){_0x387bca[_0x89fa('0x20')]=_0x200ec9;if(_0x22e919[_0x89fa('0x33')][_0x89fa('0x3e')]){_0x4bf5fc['include']=[{'all':!![]}];}return db[_0x89fa('0x2e')][_0x89fa('0x3f')](_0x4bf5fc);})[_0x89fa('0x27')](function(_0x1ef2ae){_0x387bca[_0x89fa('0x40')]=_0x1ef2ae;return _0x387bca;})[_0x89fa('0x27')](respondWithFilteredResult(_0x1c3fca,_0x4bf5fc))[_0x89fa('0x41')](handleError(_0x1c3fca,null));};exports[_0x89fa('0x42')]=function(_0x19c1df,_0x482cec){var _0x9b0c7c={'raw':![],'where':{'id':_0x19c1df['params']['id']}},_0x81e854={};_0x81e854[_0x89fa('0x31')]=_[_0x89fa('0x32')](db[_0x89fa('0x2e')][_0x89fa('0x43')]);_0x81e854['query']=_['keys'](_0x19c1df[_0x89fa('0x33')]);_0x81e854[_0x89fa('0x39')]=_[_0x89fa('0x44')](_0x81e854[_0x89fa('0x31')],_0x81e854[_0x89fa('0x33')]);_0x9b0c7c['attributes']=_['intersection'](_0x81e854[_0x89fa('0x31')],qs[_0x89fa('0x45')](_0x19c1df[_0x89fa('0x33')][_0x89fa('0x45')]));_0x9b0c7c['attributes']=_0x9b0c7c[_0x89fa('0x34')]['length']?_0x9b0c7c[_0x89fa('0x34')]:_0x81e854['model'];if(_0x19c1df[_0x89fa('0x33')][_0x89fa('0x3e')]){_0x9b0c7c[_0x89fa('0x46')]=[{'all':!![]}];}_0x9b0c7c=_[_0x89fa('0x3b')]({},_0x9b0c7c,_0x19c1df['options']);return db[_0x89fa('0x2e')][_0x89fa('0x47')](_0x9b0c7c)[_0x89fa('0x27')](handleEntityNotFound(_0x482cec,null))[_0x89fa('0x27')](respondWithResult(_0x482cec,null))[_0x89fa('0x41')](handleError(_0x482cec,null));};exports['create']=function(_0x5f22bd,_0x5a9290){return db[_0x89fa('0x2e')]['create'](_0x5f22bd[_0x89fa('0x48')],{})['then'](function(_0x525a99){var _0x4526d3=_0x5f22bd[_0x89fa('0x49')]['get']({'plain':!![]});if(!_0x4526d3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4526d3[_0x89fa('0x4a')]==='user'){var _0x538b5f=_0x525a99[_0x89fa('0x28')]({'plain':!![]});var _0x5b4ca2=_0x89fa('0x29');return db[_0x89fa('0x4b')][_0x89fa('0x47')]({'where':{'name':_0x5b4ca2,'userProfileId':_0x4526d3[_0x89fa('0x4c')]},'raw':!![]})[_0x89fa('0x27')](function(_0x186b71){if(_0x186b71&&_0x186b71[_0x89fa('0x4d')]===0x0){return db[_0x89fa('0x4e')]['create']({'name':_0x538b5f[_0x89fa('0x2b')],'resourceId':_0x538b5f['id'],'type':_0x186b71[_0x89fa('0x2b')],'sectionId':_0x186b71['id']},{})[_0x89fa('0x27')](function(){return _0x525a99;});}else{return _0x525a99;}})[_0x89fa('0x41')](function(_0x1d1eac){logger['error'](_0x89fa('0x4f'),_0x1d1eac);throw _0x1d1eac;});}return _0x525a99;})[_0x89fa('0x27')](respondWithResult(_0x5a9290,0xc9))['catch'](handleError(_0x5a9290,null));};exports['clone']=function(_0x51e005,_0x3618f4){var _0x4ea26c={'where':{'id':_0x51e005['params']['id']}},_0x4845bd={};_0x4845bd['model']=_['keys'](db['Dashboard'][_0x89fa('0x43')]);_0x4ea26c[_0x89fa('0x34')]=_[_0x89fa('0x44')](_0x4845bd[_0x89fa('0x31')],qs[_0x89fa('0x45')](_0x51e005[_0x89fa('0x33')][_0x89fa('0x45')]));_0x4ea26c[_0x89fa('0x34')]=_0x4ea26c[_0x89fa('0x34')][_0x89fa('0x35')]?_0x4ea26c[_0x89fa('0x34')]:_0x4845bd[_0x89fa('0x31')];if(_0x51e005['query']['includeAll']){_0x4ea26c[_0x89fa('0x46')]=[{'all':!![]}];}_0x4ea26c=_[_0x89fa('0x3b')]({},_0x4ea26c,_0x51e005[_0x89fa('0x3d')]);return db[_0x89fa('0x2e')][_0x89fa('0x47')](_0x4ea26c)[_0x89fa('0x27')](handleEntityNotFound(_0x3618f4,null))[_0x89fa('0x27')](function(_0x193b1b){if(_0x193b1b){var _0x19f40c=_0x193b1b[_0x89fa('0x28')]({'plain':!![]});_0x19f40c=qs[_0x89fa('0x50')](_0x19f40c,['id',_0x89fa('0x51'),_0x89fa('0x52')]);_0x51e005[_0x89fa('0x48')]=_[_0x89fa('0x50')](_0x51e005[_0x89fa('0x48')],['id',_0x89fa('0x51'),_0x89fa('0x52')]);return db[_0x89fa('0x2e')][_0x89fa('0x53')](_[_0x89fa('0x3b')](_0x19f40c,_0x51e005['body']),{'include':_0x51e005[_0x89fa('0x33')]['includeAll']?[{'all':!![]}]:undefined})[_0x89fa('0x27')](function(_0x2377dd){var _0x491b28=_0x51e005['user'][_0x89fa('0x28')]({'plain':!![]});if(!_0x491b28)throw new Error(_0x89fa('0x54'));if(_0x491b28[_0x89fa('0x4a')]===_0x89fa('0x49')){var _0x158650=_0x2377dd[_0x89fa('0x28')]({'plain':!![]});var _0x5db97a='CustomDashboards';return db[_0x89fa('0x4b')][_0x89fa('0x47')]({'where':{'name':_0x5db97a,'userProfileId':_0x491b28['userProfileId']},'raw':!![]})[_0x89fa('0x27')](function(_0x2d8dba){if(_0x2d8dba&&_0x2d8dba['autoAssociation']===0x0){return db[_0x89fa('0x4e')][_0x89fa('0x53')]({'name':_0x158650[_0x89fa('0x2b')],'resourceId':_0x158650['id'],'type':_0x2d8dba['name'],'sectionId':_0x2d8dba['id']},{})[_0x89fa('0x27')](function(){return _0x2377dd;});}else{return _0x2377dd;}})[_0x89fa('0x41')](function(_0x115d19){logger[_0x89fa('0x55')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x115d19);throw _0x115d19;});}return _0x2377dd;});}})[_0x89fa('0x27')](respondWithResult(_0x3618f4,0xc9))['catch'](handleError(_0x3618f4,null));};exports[_0x89fa('0x56')]=function(_0x559890,_0x5e620b){if(_0x559890[_0x89fa('0x48')]['id']){delete _0x559890['body']['id'];}return db['Dashboard'][_0x89fa('0x47')]({'where':{'id':_0x559890['params']['id']}})['then'](handleEntityNotFound(_0x5e620b,null))['then'](saveUpdates(_0x559890[_0x89fa('0x48')],null))[_0x89fa('0x27')](respondWithResult(_0x5e620b,null))[_0x89fa('0x41')](handleError(_0x5e620b,null));};exports[_0x89fa('0x26')]=function(_0x4e3b55,_0x5c3f9b){return db['Dashboard'][_0x89fa('0x47')]({'where':{'id':_0x4e3b55[_0x89fa('0x57')]['id']}})['then'](handleEntityNotFound(_0x5c3f9b,null))[_0x89fa('0x27')](removeEntity(_0x5c3f9b,null))[_0x89fa('0x41')](handleError(_0x5c3f9b,null));};function widgetAttributes(_0x239060){try{switch(_0x239060[_0x89fa('0x2f')]){case _0x89fa('0x58'):return[{'name':_0x89fa('0x59'),'value':_0x239060[_0x89fa('0x59')]||(_0x239060[_0x89fa('0x5a')]&&_0x239060[_0x89fa('0x5a')][0x0]?_0x239060[_0x89fa('0x5a')][0x0][_0x89fa('0x5b')]:undefined)||_0x89fa('0x5c')}];case'custom':return[{'name':_0x89fa('0x5d'),'value':_0x239060[_0x89fa('0x5d')]||(_0x239060[_0x89fa('0x5a')]&&_0x239060[_0x89fa('0x5a')][0x0]?_0x239060[_0x89fa('0x5a')][0x0][_0x89fa('0x5b')]:undefined)||''}];case _0x89fa('0x5e'):return[{'name':_0x89fa('0x5f'),'value':_0x239060[_0x89fa('0x5f')]||(_0x239060[_0x89fa('0x5a')]&&_0x239060[_0x89fa('0x5a')][0x0]?_0x239060[_0x89fa('0x5a')][0x0][_0x89fa('0x5b')]:undefined)||'HH:mm:ss'},{'name':'attrTimezone','value':_0x239060[_0x89fa('0x60')]||(_0x239060['attrs']&&_0x239060[_0x89fa('0x5a')][0x1]?_0x239060[_0x89fa('0x5a')][0x1][_0x89fa('0x5b')]:undefined)||'0.00'},{'name':_0x89fa('0x61'),'value':_0x239060['attrFontSize']||(_0x239060[_0x89fa('0x5a')]&&_0x239060[_0x89fa('0x5a')][0x2]?_0x239060[_0x89fa('0x5a')][0x2][_0x89fa('0x5b')]:undefined)||0xc}];case _0x89fa('0x62'):return[{'name':_0x89fa('0x63'),'value':_0x239060['attrMetric']||(_0x239060['attrs']&&_0x239060['attrs'][0x0]?_0x239060[_0x89fa('0x5a')][0x0][_0x89fa('0x5b')]:undefined)||'total'},{'name':_0x89fa('0x64'),'value':_0x239060[_0x89fa('0x64')]||(_0x239060[_0x89fa('0x5a')]&&_0x239060['attrs'][0x1]?_0x239060['attrs'][0x1][_0x89fa('0x5b')]:undefined)||[]},{'name':_0x89fa('0x61'),'value':_0x239060['attrFontSize']||(_0x239060[_0x89fa('0x5a')]&&_0x239060[_0x89fa('0x5a')][0x2]?_0x239060[_0x89fa('0x5a')][0x2]['value']:undefined)||0x14}];case'multibar-chart':case _0x89fa('0x65'):return[{'name':_0x89fa('0x66'),'value':_0x239060[_0x89fa('0x66')]||(_0x239060[_0x89fa('0x5a')]&&_0x239060[_0x89fa('0x5a')][0x0]?_0x239060[_0x89fa('0x5a')][0x0][_0x89fa('0x5b')]:undefined)||_0x89fa('0x67')},{'name':_0x89fa('0x68'),'value':_0x239060[_0x89fa('0x68')]||(_0x239060[_0x89fa('0x5a')]&&_0x239060[_0x89fa('0x5a')][0x1]?_0x239060['attrs'][0x1][_0x89fa('0x5b')]:undefined)||null},{'name':_0x89fa('0x69'),'value':_0x239060[_0x89fa('0x69')]||(_0x239060[_0x89fa('0x5a')]&&_0x239060[_0x89fa('0x5a')][0x2]?_0x239060['attrs'][0x2][_0x89fa('0x5b')]:undefined)||null},{'name':_0x89fa('0x64'),'value':_0x239060[_0x89fa('0x64')]||(_0x239060[_0x89fa('0x5a')]&&_0x239060['attrs'][0x3]?_0x239060['attrs'][0x3][_0x89fa('0x5b')]:undefined)||[]}];case _0x89fa('0x6a'):return[{'name':_0x89fa('0x6b'),'type':_0x239060[_0x89fa('0x6c')]||(_0x239060[_0x89fa('0x5a')]&&_0x239060[_0x89fa('0x5a')][0x0]?_0x239060['attrs'][0x0][_0x89fa('0x2f')]:undefined)||null,'value':_0x239060[_0x89fa('0x6b')]||(_0x239060[_0x89fa('0x5a')]&&_0x239060[_0x89fa('0x5a')][0x0]?_0x239060[_0x89fa('0x5a')][0x0]['value']:undefined)||null},{'name':'attrRefresh','value':_0x239060[_0x89fa('0x6d')]||(_0x239060[_0x89fa('0x5a')]&&_0x239060[_0x89fa('0x5a')][0x1]?_0x239060[_0x89fa('0x5a')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x44d456){logger['error'](_0x89fa('0x6e'),JSON['stringify'](_0x44d456));return[];}}exports[_0x89fa('0x6f')]=function(_0x3a95de,_0x1dc95d,_0xe5a187){if(_0x3a95de['body']['id']){delete _0x3a95de['body']['id'];}return db[_0x89fa('0x2e')][_0x89fa('0x47')]({'where':{'id':_0x3a95de[_0x89fa('0x57')]['id']}})[_0x89fa('0x27')](handleEntityNotFound(_0x1dc95d,null))['then'](function(_0x23b89e){if(_0x23b89e){_0x3a95de[_0x89fa('0x48')]['DashboardId']=_0x23b89e['id'];_0x3a95de[_0x89fa('0x48')][_0x89fa('0x5a')]=widgetAttributes(_0x3a95de[_0x89fa('0x48')]);return db[_0x89fa('0x70')][_0x89fa('0x53')](_0x3a95de['body']);}})['then'](respondWithResult(_0x1dc95d,null))[_0x89fa('0x41')](handleError(_0x1dc95d,null));};exports['getItems']=function(_0x3f0dbb,_0x4abb5f,_0x4e0b96){var _0x5a653e={};var _0x704e64={};var _0x576dd1;var _0x5e7f65;return db['Dashboard'][_0x89fa('0x71')]({'where':{'id':_0x3f0dbb[_0x89fa('0x57')]['id']}})[_0x89fa('0x27')](handleEntityNotFound(_0x4abb5f,null))['then'](function(_0x5e86e2){if(_0x5e86e2){_0x576dd1=_0x5e86e2;_0x704e64[_0x89fa('0x31')]=_[_0x89fa('0x32')](db['DashboardItem'][_0x89fa('0x43')]);_0x704e64[_0x89fa('0x33')]=_[_0x89fa('0x32')](_0x3f0dbb[_0x89fa('0x33')]);_0x704e64['filters']=_['intersection'](_0x704e64['model'],_0x704e64[_0x89fa('0x33')]);_0x5a653e[_0x89fa('0x34')]=_['intersection'](_0x704e64[_0x89fa('0x31')],qs[_0x89fa('0x45')](_0x3f0dbb['query'][_0x89fa('0x45')]));_0x5a653e['attributes']=_0x5a653e[_0x89fa('0x34')][_0x89fa('0x35')]?_0x5a653e['attributes']:_0x704e64[_0x89fa('0x31')];_0x5a653e[_0x89fa('0x72')]=qs[_0x89fa('0x37')](_0x3f0dbb[_0x89fa('0x33')][_0x89fa('0x37')]);_0x5a653e['where']=qs['filters'](_[_0x89fa('0x73')](_0x3f0dbb[_0x89fa('0x33')],_0x704e64[_0x89fa('0x39')]));if(_0x3f0dbb[_0x89fa('0x33')][_0x89fa('0x3a')]){_0x5a653e[_0x89fa('0x38')]=_[_0x89fa('0x3b')](_0x5a653e[_0x89fa('0x38')],{'$or':_['map'](_0x5a653e[_0x89fa('0x34')],function(_0x1ba356){var _0x1e56c2={};_0x1e56c2[_0x1ba356]={'$like':'%'+_0x3f0dbb[_0x89fa('0x33')][_0x89fa('0x3a')]+'%'};return _0x1e56c2;})});}_0x5a653e=_[_0x89fa('0x3b')]({},_0x5a653e,_0x3f0dbb[_0x89fa('0x3d')]);return _0x576dd1[_0x89fa('0x74')](_0x5a653e);}})[_0x89fa('0x27')](function(_0x58ae1a){if(_0x58ae1a){_0x5e7f65=_0x58ae1a[_0x89fa('0x35')];if(!_0x3f0dbb['query']['hasOwnProperty'](_0x89fa('0x75'))){_0x5a653e[_0x89fa('0x1e')]=qs[_0x89fa('0x1e')](_0x3f0dbb[_0x89fa('0x33')][_0x89fa('0x1e')]);_0x5a653e[_0x89fa('0x1f')]=qs[_0x89fa('0x1f')](_0x3f0dbb[_0x89fa('0x33')]['offset']);}return _0x576dd1[_0x89fa('0x74')](_0x5a653e);}})['then'](function(_0x535a4a){if(_0x535a4a){return _0x535a4a?{'count':_0x5e7f65,'rows':_0x535a4a}:null;}})[_0x89fa('0x27')](respondWithResult(_0x4abb5f,null))['catch'](handleError(_0x4abb5f,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index ce49170..5290e30 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 _0x282f=['save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Dashboard'];(function(_0x154ffd,_0x4b47c2){var _0xb6e802=function(_0x3c00f9){while(--_0x3c00f9){_0x154ffd['push'](_0x154ffd['shift']());}};_0xb6e802(++_0x4b47c2);}(_0x282f,0x153));var _0xf282=function(_0x2acb85,_0x2769e2){_0x2acb85=_0x2acb85-0x0;var _0x2063d5=_0x282f[_0x2acb85];return _0x2063d5;};'use strict';var EventEmitter=require(_0xf282('0x0'));var Dashboard=require(_0xf282('0x1'))['db'][_0xf282('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf282('0x3'),'afterUpdate':'update','afterDestroy':_0xf282('0x4')};function emitEvent(_0x3fd09b){return function(_0x2e2120,_0x25abc7,_0x478b73){DashboardEvents[_0xf282('0x5')](_0x3fd09b+':'+_0x2e2120['id'],_0x2e2120);DashboardEvents['emit'](_0x3fd09b,_0x2e2120);_0x478b73(null);};}for(var e in events){if(events[_0xf282('0x6')](e)){var event=events[e];Dashboard[_0xf282('0x7')](e,emitEvent(event));}}module[_0xf282('0x8')]=DashboardEvents; \ No newline at end of file +var _0x299a=['Dashboard','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x1925e5,_0x24d6b9){var _0x5ea3e6=function(_0x480dad){while(--_0x480dad){_0x1925e5['push'](_0x1925e5['shift']());}};_0x5ea3e6(++_0x24d6b9);}(_0x299a,0x182));var _0xa299=function(_0x34690b,_0x27d693){_0x34690b=_0x34690b-0x0;var _0x4d405e=_0x299a[_0x34690b];return _0x4d405e;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0xa299('0x0'))['db'][_0xa299('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xa299('0x2')](0x0);var events={'afterCreate':_0xa299('0x3'),'afterUpdate':'update','afterDestroy':_0xa299('0x4')};function emitEvent(_0x198986){return function(_0x16aa7b,_0x123cd7,_0x38965e){DashboardEvents[_0xa299('0x5')](_0x198986+':'+_0x16aa7b['id'],_0x16aa7b);DashboardEvents[_0xa299('0x5')](_0x198986,_0x16aa7b);_0x38965e(null);};}for(var e in events){if(events[_0xa299('0x6')](e)){var event=events[e];Dashboard[_0xa299('0x7')](e,emitEvent(event));}}module[_0xa299('0x8')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index f06be58..fcbb11e 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 _0x0d16=['lodash','util','../../config/logger','api','moment','path','../../config/environment','./dashboard.attributes','exports','define','dashboards'];(function(_0x4b5e23,_0x401b1){var _0x371abd=function(_0x3f6ed6){while(--_0x3f6ed6){_0x4b5e23['push'](_0x4b5e23['shift']());}};_0x371abd(++_0x401b1);}(_0x0d16,0xbb));var _0x60d1=function(_0x5e943c,_0x5e4f6a){_0x5e943c=_0x5e943c-0x0;var _0x1b2421=_0x0d16[_0x5e943c];return _0x1b2421;};'use strict';var _=require(_0x60d1('0x0'));var util=require(_0x60d1('0x1'));var logger=require(_0x60d1('0x2'))(_0x60d1('0x3'));var moment=require(_0x60d1('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x60d1('0x5'));var rimraf=require('rimraf');var config=require(_0x60d1('0x6'));var attributes=require(_0x60d1('0x7'));module[_0x60d1('0x8')]=function(_0x42d473,_0x1fc1e1){return _0x42d473[_0x60d1('0x9')]('Dashboard',attributes,{'tableName':_0x60d1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1589=['lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./dashboard.attributes','exports','Dashboard','dashboards'];(function(_0x54ba64,_0x2ac1e7){var _0x319cf7=function(_0x598edf){while(--_0x598edf){_0x54ba64['push'](_0x54ba64['shift']());}};_0x319cf7(++_0x2ac1e7);}(_0x1589,0x9c));var _0x9158=function(_0x2f62aa,_0x108e95){_0x2f62aa=_0x2f62aa-0x0;var _0x1a341f=_0x1589[_0x2f62aa];return _0x1a341f;};'use strict';var _=require(_0x9158('0x0'));var util=require(_0x9158('0x1'));var logger=require('../../config/logger')(_0x9158('0x2'));var moment=require('moment');var BPromise=require(_0x9158('0x3'));var rp=require(_0x9158('0x4'));var fs=require('fs');var path=require(_0x9158('0x5'));var rimraf=require(_0x9158('0x6'));var config=require(_0x9158('0x7'));var attributes=require(_0x9158('0x8'));module[_0x9158('0x9')]=function(_0x59e780,_0x470604){return _0x59e780['define'](_0x9158('0xa'),attributes,{'tableName':_0x9158('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index 31a8ad5..ee25f65 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 _0x4ec8=['Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./dashboard.socket','register','request','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4d180c,_0x45c68e){var _0x49b57e=function(_0x264741){while(--_0x264741){_0x4d180c['push'](_0x4d180c['shift']());}};_0x49b57e(++_0x45c68e);}(_0x4ec8,0x1db));var _0x84ec=function(_0x392461,_0x36cb63){_0x392461=_0x392461-0x0;var _0x2e9964=_0x4ec8[_0x392461];return _0x2e9964;};'use strict';var _=require('lodash');var util=require(_0x84ec('0x0'));var moment=require(_0x84ec('0x1'));var BPromise=require(_0x84ec('0x2'));var rs=require(_0x84ec('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x84ec('0x4'))(_0x84ec('0x5'));var config=require(_0x84ec('0x6'));var jayson=require(_0x84ec('0x7'));var client=jayson[_0x84ec('0x8')]['http']({'port':0x232a});config[_0x84ec('0x9')]=_['defaults'](config[_0x84ec('0x9')],{'host':_0x84ec('0xa'),'port':0x18eb});var socket=require(_0x84ec('0xb'))(new Redis(config['redis']));require(_0x84ec('0xc'))[_0x84ec('0xd')](socket);function respondWithRpcPromise(_0x47b969,_0x34aca4,_0x308e57){return new BPromise(function(_0x3dde7f,_0x2e69f5){return client[_0x84ec('0xe')](_0x47b969,_0x308e57)['then'](function(_0x5a1247){logger[_0x84ec('0xf')](_0x84ec('0x10'),_0x34aca4,_0x84ec('0x11'));logger[_0x84ec('0x12')](_0x84ec('0x13'),_0x34aca4,_0x84ec('0x11'),JSON[_0x84ec('0x14')](_0x5a1247));if(_0x5a1247['error']){if(_0x5a1247[_0x84ec('0x15')][_0x84ec('0x16')]===0x1f4){logger[_0x84ec('0x15')](_0x84ec('0x10'),_0x34aca4,_0x5a1247[_0x84ec('0x15')][_0x84ec('0x17')]);return _0x2e69f5(_0x5a1247[_0x84ec('0x15')][_0x84ec('0x17')]);}logger[_0x84ec('0x15')]('Dashboard,\x20%s,\x20%s',_0x34aca4,_0x5a1247[_0x84ec('0x15')][_0x84ec('0x17')]);return _0x3dde7f(_0x5a1247[_0x84ec('0x15')][_0x84ec('0x17')]);}else{logger[_0x84ec('0xf')](_0x84ec('0x10'),_0x34aca4,_0x84ec('0x11'));_0x3dde7f(_0x5a1247[_0x84ec('0x18')][_0x84ec('0x17')]);}})[_0x84ec('0x19')](function(_0x20fb30){logger[_0x84ec('0x15')]('Dashboard,\x20%s,\x20%s',_0x34aca4,_0x20fb30);_0x2e69f5(_0x20fb30);});});} \ No newline at end of file +var _0x4360=['./dashboard.socket','register','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter'];(function(_0x413b4d,_0xa3459c){var _0x8b810a=function(_0x22d441){while(--_0x22d441){_0x413b4d['push'](_0x413b4d['shift']());}};_0x8b810a(++_0xa3459c);}(_0x4360,0x89));var _0x0436=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0x4360[_0x4fc9e6];return _0x551d28;};'use strict';var _=require(_0x0436('0x0'));var util=require(_0x0436('0x1'));var moment=require(_0x0436('0x2'));var BPromise=require('bluebird');var rs=require(_0x0436('0x3'));var fs=require('fs');var Redis=require(_0x0436('0x4'));var db=require(_0x0436('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0436('0x6'));var config=require(_0x0436('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0436('0x8')]['http']({'port':0x232a});config[_0x0436('0x9')]=_[_0x0436('0xa')](config['redis'],{'host':_0x0436('0xb'),'port':0x18eb});var socket=require(_0x0436('0xc'))(new Redis(config[_0x0436('0x9')]));require(_0x0436('0xd'))[_0x0436('0xe')](socket);function respondWithRpcPromise(_0x1f9b66,_0xb7b33e,_0x5854e0){return new BPromise(function(_0x425176,_0x512ae2){return client['request'](_0x1f9b66,_0x5854e0)[_0x0436('0xf')](function(_0x25049f){logger[_0x0436('0x10')](_0x0436('0x11'),_0xb7b33e,_0x0436('0x12'));logger[_0x0436('0x13')](_0x0436('0x14'),_0xb7b33e,'request\x20sent',JSON['stringify'](_0x25049f));if(_0x25049f[_0x0436('0x15')]){if(_0x25049f[_0x0436('0x15')][_0x0436('0x16')]===0x1f4){logger[_0x0436('0x15')](_0x0436('0x11'),_0xb7b33e,_0x25049f[_0x0436('0x15')][_0x0436('0x17')]);return _0x512ae2(_0x25049f[_0x0436('0x15')][_0x0436('0x17')]);}logger['error'](_0x0436('0x11'),_0xb7b33e,_0x25049f[_0x0436('0x15')][_0x0436('0x17')]);return _0x425176(_0x25049f[_0x0436('0x15')]['message']);}else{logger[_0x0436('0x10')]('Dashboard,\x20%s,\x20%s',_0xb7b33e,_0x0436('0x12'));_0x425176(_0x25049f[_0x0436('0x18')][_0x0436('0x17')]);}})['catch'](function(_0x464bed){logger[_0x0436('0x15')](_0x0436('0x11'),_0xb7b33e,_0x464bed);_0x512ae2(_0x464bed);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index db60439..09a6954 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 _0x7821=['remove','update','emit','removeListener','register','length','dashboard:','./dashboard.events','save'];(function(_0x2060c2,_0x4e0b9d){var _0x5b73a6=function(_0x1eef84){while(--_0x1eef84){_0x2060c2['push'](_0x2060c2['shift']());}};_0x5b73a6(++_0x4e0b9d);}(_0x7821,0x1ae));var _0x1782=function(_0x3018eb,_0x570c63){_0x3018eb=_0x3018eb-0x0;var _0x23131f=_0x7821[_0x3018eb];return _0x23131f;};'use strict';var DashboardEvents=require(_0x1782('0x0'));var events=[_0x1782('0x1'),_0x1782('0x2'),_0x1782('0x3')];function createListener(_0x3e7356,_0x59a895){return function(_0x56c54d){_0x59a895[_0x1782('0x4')](_0x3e7356,_0x56c54d);};}function removeListener(_0x37605e,_0x5a97f4){return function(){DashboardEvents[_0x1782('0x5')](_0x37605e,_0x5a97f4);};}exports[_0x1782('0x6')]=function(_0x28aaaa){for(var _0x364db2=0x0,_0x119b74=events[_0x1782('0x7')];_0x364db2<_0x119b74;_0x364db2++){var _0x140b8b=events[_0x364db2];var _0x1e0945=createListener(_0x1782('0x8')+_0x140b8b,_0x28aaaa);DashboardEvents['on'](_0x140b8b,_0x1e0945);}}; \ No newline at end of file +var _0x595c=['emit','removeListener','length','save','remove','update'];(function(_0x308275,_0x5d8a30){var _0x219f2e=function(_0x1792ea){while(--_0x1792ea){_0x308275['push'](_0x308275['shift']());}};_0x219f2e(++_0x5d8a30);}(_0x595c,0x147));var _0xc595=function(_0x2063b8,_0x51a6a8){_0x2063b8=_0x2063b8-0x0;var _0x152ded=_0x595c[_0x2063b8];return _0x152ded;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0xc595('0x0'),_0xc595('0x1'),_0xc595('0x2')];function createListener(_0x5463be,_0x5bf308){return function(_0x56b928){_0x5bf308[_0xc595('0x3')](_0x5463be,_0x56b928);};}function removeListener(_0x24596a,_0x3628c8){return function(){DashboardEvents[_0xc595('0x4')](_0x24596a,_0x3628c8);};}exports['register']=function(_0x426d15){for(var _0x5de6cb=0x0,_0x10c9cf=events[_0xc595('0x5')];_0x5de6cb<_0x10c9cf;_0x5de6cb++){var _0x394aa9=events[_0x5de6cb];var _0x3f20b2=createListener('dashboard:'+_0x394aa9,_0x426d15);DashboardEvents['on'](_0x394aa9,_0x3f20b2);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index e0cdff8..00b40d5 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 _0x4357=['delete','exports','util','path','fs-extra','../../components/auth/service','get','isAuthenticated','show','/:id/items','getItems','post','clone','/:id','update'];(function(_0x77481e,_0x26c026){var _0x2cefb5=function(_0x3ac516){while(--_0x3ac516){_0x77481e['push'](_0x77481e['shift']());}};_0x2cefb5(++_0x26c026);}(_0x4357,0xd4));var _0x7435=function(_0x4aa33b,_0x18235f){_0x4aa33b=_0x4aa33b-0x0;var _0x5efce2=_0x4357[_0x4aa33b];return _0x5efce2;};'use strict';var multer=require('multer');var util=require(_0x7435('0x0'));var path=require(_0x7435('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x7435('0x2'));var auth=require(_0x7435('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./dashboard.controller');router[_0x7435('0x4')]('/',auth[_0x7435('0x5')](),controller['index']);router[_0x7435('0x4')]('/:id',auth['isAuthenticated'](),controller[_0x7435('0x6')]);router['get'](_0x7435('0x7'),auth[_0x7435('0x5')](),controller[_0x7435('0x8')]);router[_0x7435('0x9')]('/',auth[_0x7435('0x5')](),controller['create']);router[_0x7435('0x9')]('/:id/clone',auth[_0x7435('0x5')](),controller[_0x7435('0xa')]);router[_0x7435('0x9')]('/:id/items',auth[_0x7435('0x5')](),controller['addItem']);router['put'](_0x7435('0xb'),auth[_0x7435('0x5')](),controller[_0x7435('0xc')]);router[_0x7435('0xd')](_0x7435('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x7435('0xe')]=router; \ No newline at end of file +var _0xb126=['destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./dashboard.controller','isAuthenticated','index','get','/:id','show','/:id/items','post','create','/:id/clone','clone','addItem','put','delete'];(function(_0x2ee916,_0x55b4b0){var _0xc73595=function(_0x1ddaa8){while(--_0x1ddaa8){_0x2ee916['push'](_0x2ee916['shift']());}};_0xc73595(++_0x55b4b0);}(_0xb126,0xb2));var _0x6b12=function(_0x30a58,_0x4645dc){_0x30a58=_0x30a58-0x0;var _0x4480ac=_0xb126[_0x30a58];return _0x4480ac;};'use strict';var multer=require(_0x6b12('0x0'));var util=require('util');var path=require(_0x6b12('0x1'));var timeout=require(_0x6b12('0x2'));var express=require('express');var router=express[_0x6b12('0x3')]();var fs_extra=require(_0x6b12('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6b12('0x5'));var config=require('../../config/environment');var controller=require(_0x6b12('0x6'));router['get']('/',auth[_0x6b12('0x7')](),controller[_0x6b12('0x8')]);router[_0x6b12('0x9')](_0x6b12('0xa'),auth[_0x6b12('0x7')](),controller[_0x6b12('0xb')]);router['get'](_0x6b12('0xc'),auth[_0x6b12('0x7')](),controller['getItems']);router[_0x6b12('0xd')]('/',auth['isAuthenticated'](),controller[_0x6b12('0xe')]);router[_0x6b12('0xd')](_0x6b12('0xf'),auth[_0x6b12('0x7')](),controller[_0x6b12('0x10')]);router[_0x6b12('0xd')](_0x6b12('0xc'),auth[_0x6b12('0x7')](),controller[_0x6b12('0x11')]);router[_0x6b12('0x12')]('/:id',auth[_0x6b12('0x7')](),controller['update']);router[_0x6b12('0x13')](_0x6b12('0xa'),auth[_0x6b12('0x7')](),controller[_0x6b12('0x14')]);module[_0x6b12('0x15')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index eaae1ff..a205b86 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 _0x3f8a=['parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','sequelize','squel','lodash','exports','STRING','TEXT','long'];(function(_0x4e0403,_0x23bb0a){var _0xb4ab4f=function(_0x3c12c3){while(--_0x3c12c3){_0x4e0403['push'](_0x4e0403['shift']());}};_0xb4ab4f(++_0x23bb0a);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x2feaad,_0x1aa6fc){_0x2feaad=_0x2feaad-0x0;var _0x5514bd=_0x3f8a[_0x2feaad];return _0x5514bd;};'use strict';var Sequelize=require(_0xa3f8('0x0'));var squel=require(_0xa3f8('0x1'));var _=require(_0xa3f8('0x2'));module[_0xa3f8('0x3')]={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xa3f8('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xa3f8('0x5')](_0xa3f8('0x6')),'get':function(){try{return JSON[_0xa3f8('0x7')](this[_0xa3f8('0x8')](_0xa3f8('0x9')));}catch(_0x39d2e4){return[];}},'set':function(_0x471464){try{this[_0xa3f8('0xa')](_0xa3f8('0x9'),JSON[_0xa3f8('0xb')](_0x471464));}catch(_0x268332){this[_0xa3f8('0xa')](_0xa3f8('0x9'),JSON[_0xa3f8('0xb')]([]));}}},'sizeX':{'type':Sequelize[_0xa3f8('0xc')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xa3f8('0xc')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0xa3f8('0xc')]},'background':{'type':Sequelize[_0xa3f8('0x4')],'allowNull':![],'defaultValue':_0xa3f8('0xd'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xa3f8('0x4')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xa3f8('0x4')]},'titleFontSize':{'type':Sequelize[_0xa3f8('0xc')],'defaultValue':0xc}}; \ No newline at end of file +var _0x53ec=['getDataValue','attrs','stringify','setDataValue','INTEGER','#ffffff','sequelize','squel','lodash','exports','STRING','long'];(function(_0x5a187b,_0x1f64fe){var _0x14d601=function(_0x45fd29){while(--_0x45fd29){_0x5a187b['push'](_0x5a187b['shift']());}};_0x14d601(++_0x1f64fe);}(_0x53ec,0x192));var _0xc53e=function(_0x1066a3,_0x4ae4b6){_0x1066a3=_0x1066a3-0x0;var _0x488ca3=_0x53ec[_0x1066a3];return _0x488ca3;};'use strict';var Sequelize=require(_0xc53e('0x0'));var squel=require(_0xc53e('0x1'));var _=require(_0xc53e('0x2'));module[_0xc53e('0x3')]={'title':{'type':Sequelize[_0xc53e('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0xc53e('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0xc53e('0x5')),'get':function(){try{return JSON['parse'](this[_0xc53e('0x6')](_0xc53e('0x7')));}catch(_0x4a9c59){return[];}},'set':function(_0x2f1414){try{this['setDataValue'](_0xc53e('0x7'),JSON[_0xc53e('0x8')](_0x2f1414));}catch(_0x5d3b28){this[_0xc53e('0x9')](_0xc53e('0x7'),JSON[_0xc53e('0x8')]([]));}}},'sizeX':{'type':Sequelize[_0xc53e('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xc53e('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xc53e('0xa')]},'col':{'type':Sequelize[_0xc53e('0xa')]},'background':{'type':Sequelize[_0xc53e('0x4')],'allowNull':![],'defaultValue':_0xc53e('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xc53e('0x4')]},'titleFontSize':{'type':Sequelize['INTEGER'],'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 fdeacce..80d225e 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 _0x8cd5=['attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','stringify','body','create','rimraf','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','redis','localhost','socket.io-emitter','register','sendStatus','end','json','undefined','offset','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','status','send','show','params','model','keys','DashboardItem','rawAttributes','query','intersection','attributes','fields','includeAll','include','merge','options','find','catch','type','iframe','attrUrl','attrs','https://','custom','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','total'];(function(_0x1aed95,_0x1de484){var _0x31cbda=function(_0x3c7753){while(--_0x3c7753){_0x1aed95['push'](_0x1aed95['shift']());}};_0x31cbda(++_0x1de484);}(_0x8cd5,0x6a));var _0x58cd=function(_0x239a9,_0x4e772b){_0x239a9=_0x239a9-0x0;var _0x270da5=_0x8cd5[_0x239a9];return _0x270da5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x58cd('0x0'));var zipdir=require(_0x58cd('0x1'));var jsonpatch=require(_0x58cd('0x2'));var rp=require(_0x58cd('0x3'));var moment=require(_0x58cd('0x4'));var BPromise=require(_0x58cd('0x5'));var Mustache=require(_0x58cd('0x6'));var util=require(_0x58cd('0x7'));var path=require('path');var sox=require(_0x58cd('0x8'));var csv=require(_0x58cd('0x9'));var ejs=require(_0x58cd('0xa'));var fs=require('fs');var fs_extra=require(_0x58cd('0xb'));var _=require(_0x58cd('0xc'));var squel=require(_0x58cd('0xd'));var crypto=require('crypto');var jsforce=require(_0x58cd('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x58cd('0x9'));var querystring=require(_0x58cd('0xf'));var Papa=require(_0x58cd('0x10'));var Redis=require(_0x58cd('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x58cd('0x12'));var as=require(_0x58cd('0x13'));var hardwareService=require(_0x58cd('0x14'));var logger=require(_0x58cd('0x15'))(_0x58cd('0x16'));var utils=require(_0x58cd('0x17'));var config=require(_0x58cd('0x18'));var licenseUtil=require(_0x58cd('0x19'));var db=require(_0x58cd('0x1a'))['db'];config[_0x58cd('0x1b')]=_['defaults'](config[_0x58cd('0x1b')],{'host':_0x58cd('0x1c'),'port':0x18eb});var socket=require(_0x58cd('0x1d'))(new Redis(config[_0x58cd('0x1b')]));require('./dashboardItem.socket')[_0x58cd('0x1e')](socket);function respondWithStatusCode(_0x48bf6f,_0x2bdb52){_0x2bdb52=_0x2bdb52||0xcc;return function(_0x13f57f){if(_0x13f57f){return _0x48bf6f[_0x58cd('0x1f')](_0x2bdb52);}return _0x48bf6f['status'](_0x2bdb52)[_0x58cd('0x20')]();};}function respondWithResult(_0x579d0a,_0x3fecd0){_0x3fecd0=_0x3fecd0||0xc8;return function(_0x397ffe){if(_0x397ffe){return _0x579d0a['status'](_0x3fecd0)[_0x58cd('0x21')](_0x397ffe);}};}function respondWithFilteredResult(_0x1e9e15,_0x39f76a){return function(_0x5b4e1a){if(_0x5b4e1a){var _0x1bb3bd=typeof _0x39f76a['offset']===_0x58cd('0x22')&&typeof _0x39f76a['limit']===_0x58cd('0x22');var _0x533eb7=_0x5b4e1a['count'];var _0x37b80c=_0x1bb3bd?0x0:_0x39f76a[_0x58cd('0x23')];var _0x396d96=_0x1bb3bd?_0x5b4e1a[_0x58cd('0x24')]:_0x39f76a[_0x58cd('0x23')]+_0x39f76a[_0x58cd('0x25')];var _0x32e67e;if(_0x396d96>=_0x533eb7){_0x396d96=_0x533eb7;_0x32e67e=0xc8;}else{_0x32e67e=0xce;}_0x1e9e15['status'](_0x32e67e);return _0x1e9e15[_0x58cd('0x26')](_0x58cd('0x27'),_0x37b80c+'-'+_0x396d96+'/'+_0x533eb7)['json'](_0x5b4e1a);}return null;};}function patchUpdates(_0x58fb54){return function(_0x1910ee){try{jsonpatch[_0x58cd('0x28')](_0x1910ee,_0x58fb54,!![]);}catch(_0x15e69d){return BPromise[_0x58cd('0x29')](_0x15e69d);}return _0x1910ee[_0x58cd('0x2a')]();};}function saveUpdates(_0x596392,_0x4e8748){return function(_0x102542){if(_0x102542){return _0x102542[_0x58cd('0x2b')](_0x596392)[_0x58cd('0x2c')](function(_0x1ab6c1){return _0x1ab6c1;});}return null;};}function removeEntity(_0x26cc49,_0x446ce9){return function(_0x1b24d7){if(_0x1b24d7){return _0x1b24d7[_0x58cd('0x2d')]()[_0x58cd('0x2c')](function(){_0x26cc49['status'](0xcc)[_0x58cd('0x20')]();});}};}function handleEntityNotFound(_0x2063c9,_0x59e49d){return function(_0x407639){if(!_0x407639){_0x2063c9[_0x58cd('0x1f')](0x194);}return _0x407639;};}function handleError(_0x2fdf12,_0xe7e8d2){_0xe7e8d2=_0xe7e8d2||0x1f4;return function(_0x27248f){logger[_0x58cd('0x2e')](_0x27248f[_0x58cd('0x2f')]);if(_0x27248f[_0x58cd('0x30')]){delete _0x27248f[_0x58cd('0x30')];}_0x2fdf12[_0x58cd('0x31')](_0xe7e8d2)[_0x58cd('0x32')](_0x27248f);};}exports[_0x58cd('0x33')]=function(_0x151339,_0x1d54cf){var _0x133362={'raw':![],'where':{'id':_0x151339[_0x58cd('0x34')]['id']}},_0x2b395f={};_0x2b395f[_0x58cd('0x35')]=_[_0x58cd('0x36')](db[_0x58cd('0x37')][_0x58cd('0x38')]);_0x2b395f[_0x58cd('0x39')]=_[_0x58cd('0x36')](_0x151339[_0x58cd('0x39')]);_0x2b395f['filters']=_[_0x58cd('0x3a')](_0x2b395f[_0x58cd('0x35')],_0x2b395f[_0x58cd('0x39')]);_0x133362[_0x58cd('0x3b')]=_['intersection'](_0x2b395f[_0x58cd('0x35')],qs[_0x58cd('0x3c')](_0x151339[_0x58cd('0x39')][_0x58cd('0x3c')]));_0x133362[_0x58cd('0x3b')]=_0x133362[_0x58cd('0x3b')]['length']?_0x133362[_0x58cd('0x3b')]:_0x2b395f[_0x58cd('0x35')];if(_0x151339['query'][_0x58cd('0x3d')]){_0x133362[_0x58cd('0x3e')]=[{'all':!![]}];}_0x133362=_[_0x58cd('0x3f')]({},_0x133362,_0x151339[_0x58cd('0x40')]);return db[_0x58cd('0x37')][_0x58cd('0x41')](_0x133362)[_0x58cd('0x2c')](handleEntityNotFound(_0x1d54cf,null))[_0x58cd('0x2c')](respondWithResult(_0x1d54cf,null))[_0x58cd('0x42')](handleError(_0x1d54cf,null));};exports[_0x58cd('0x2d')]=function(_0x51f1b9,_0x16a9c7){return db['DashboardItem'][_0x58cd('0x41')]({'where':{'id':_0x51f1b9['params']['id']}})['then'](handleEntityNotFound(_0x16a9c7,null))[_0x58cd('0x2c')](removeEntity(_0x16a9c7,null))[_0x58cd('0x42')](handleError(_0x16a9c7,null));};function widgetAttributes(_0x1849bc){try{switch(_0x1849bc[_0x58cd('0x43')]){case _0x58cd('0x44'):return[{'name':_0x58cd('0x45'),'value':_0x1849bc[_0x58cd('0x45')]||(_0x1849bc['attrs']&&_0x1849bc[_0x58cd('0x46')][0x0]?_0x1849bc[_0x58cd('0x46')][0x0]['value']:undefined)||_0x58cd('0x47')}];case _0x58cd('0x48'):return[{'name':'attrPath','value':_0x1849bc[_0x58cd('0x49')]||(_0x1849bc[_0x58cd('0x46')]&&_0x1849bc['attrs'][0x0]?_0x1849bc[_0x58cd('0x46')][0x0][_0x58cd('0x4a')]:undefined)||''}];case _0x58cd('0x4b'):return[{'name':_0x58cd('0x4c'),'value':_0x1849bc[_0x58cd('0x4c')]||(_0x1849bc[_0x58cd('0x46')]&&_0x1849bc[_0x58cd('0x46')][0x0]?_0x1849bc[_0x58cd('0x46')][0x0]['value']:undefined)||_0x58cd('0x4d')},{'name':_0x58cd('0x4e'),'value':_0x1849bc['attrTimezone']||(_0x1849bc['attrs']&&_0x1849bc['attrs'][0x1]?_0x1849bc[_0x58cd('0x46')][0x1][_0x58cd('0x4a')]:undefined)||_0x58cd('0x4f')},{'name':'attrFontSize','value':_0x1849bc[_0x58cd('0x50')]||(_0x1849bc['attrs']&&_0x1849bc[_0x58cd('0x46')][0x2]?_0x1849bc[_0x58cd('0x46')][0x2]['value']:undefined)||0xc}];case _0x58cd('0x51'):return[{'name':_0x58cd('0x52'),'value':_0x1849bc[_0x58cd('0x52')]||(_0x1849bc[_0x58cd('0x46')]&&_0x1849bc[_0x58cd('0x46')][0x0]?_0x1849bc[_0x58cd('0x46')][0x0][_0x58cd('0x4a')]:undefined)||'total'},{'name':_0x58cd('0x53'),'value':_0x1849bc['attrVoiceQueues']||(_0x1849bc[_0x58cd('0x46')]&&_0x1849bc['attrs'][0x1]?_0x1849bc['attrs'][0x1][_0x58cd('0x4a')]:undefined)||[]},{'name':_0x58cd('0x50'),'value':_0x1849bc[_0x58cd('0x50')]||(_0x1849bc['attrs']&&_0x1849bc['attrs'][0x2]?_0x1849bc[_0x58cd('0x46')][0x2]['value']:undefined)||0x14}];case _0x58cd('0x54'):case _0x58cd('0x55'):return[{'name':_0x58cd('0x56'),'value':_0x1849bc[_0x58cd('0x56')]||(_0x1849bc['attrs']&&_0x1849bc[_0x58cd('0x46')][0x0]?_0x1849bc['attrs'][0x0][_0x58cd('0x4a')]:undefined)||_0x58cd('0x57')},{'name':'attrSerie2','value':_0x1849bc[_0x58cd('0x58')]||(_0x1849bc['attrs']&&_0x1849bc[_0x58cd('0x46')][0x1]?_0x1849bc[_0x58cd('0x46')][0x1][_0x58cd('0x4a')]:undefined)||null},{'name':_0x58cd('0x59'),'value':_0x1849bc['attrSerie3']||(_0x1849bc[_0x58cd('0x46')]&&_0x1849bc['attrs'][0x2]?_0x1849bc['attrs'][0x2][_0x58cd('0x4a')]:undefined)||null},{'name':_0x58cd('0x53'),'value':_0x1849bc['attrVoiceQueues']||(_0x1849bc['attrs']&&_0x1849bc['attrs'][0x3]?_0x1849bc[_0x58cd('0x46')][0x3][_0x58cd('0x4a')]:undefined)||[]}];case _0x58cd('0x5a'):return[{'name':_0x58cd('0x5b'),'type':_0x1849bc[_0x58cd('0x5c')]||(_0x1849bc['attrs']&&_0x1849bc[_0x58cd('0x46')][0x0]?_0x1849bc[_0x58cd('0x46')][0x0][_0x58cd('0x43')]:undefined)||null,'value':_0x1849bc[_0x58cd('0x5b')]||(_0x1849bc['attrs']&&_0x1849bc['attrs'][0x0]?_0x1849bc[_0x58cd('0x46')][0x0][_0x58cd('0x4a')]:undefined)||null},{'name':'attrRefresh','value':_0x1849bc[_0x58cd('0x5d')]||(_0x1849bc[_0x58cd('0x46')]&&_0x1849bc[_0x58cd('0x46')][0x1]?_0x1849bc['attrs'][0x1][_0x58cd('0x4a')]:undefined)||0x0}];default:return[];}}catch(_0x458978){logger['error']('widgetAttributes:\x20%s',JSON[_0x58cd('0x5e')](_0x458978));return[];}}exports['create']=function(_0x388b48,_0x458497){if(_0x388b48[_0x58cd('0x5f')]){_0x388b48[_0x58cd('0x5f')][_0x58cd('0x46')]=widgetAttributes(_0x388b48[_0x58cd('0x5f')]);}return db[_0x58cd('0x37')][_0x58cd('0x60')](_0x388b48['body'],{})[_0x58cd('0x2c')](respondWithResult(_0x458497,0xc9))[_0x58cd('0x42')](handleError(_0x458497,null));};exports[_0x58cd('0x2b')]=function(_0x14e2b7,_0x88d810){if(_0x14e2b7[_0x58cd('0x5f')]['id']){delete _0x14e2b7[_0x58cd('0x5f')]['id'];}_0x14e2b7[_0x58cd('0x5f')]['attrs']=widgetAttributes(_0x14e2b7['body']);return db[_0x58cd('0x37')][_0x58cd('0x41')]({'where':{'id':_0x14e2b7[_0x58cd('0x34')]['id']}})['then'](handleEntityNotFound(_0x88d810,null))[_0x58cd('0x2c')](saveUpdates(_0x14e2b7[_0x58cd('0x5f')],null))['then'](respondWithResult(_0x88d810,null))[_0x58cd('0x42')](handleError(_0x88d810,null));}; \ No newline at end of file +var _0x655e=['clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','attrVoiceQueues','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','type','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','redis','defaults','socket.io-emitter','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','name','send','params','model','keys','DashboardItem','query','filters','intersection','fields','attributes','length','includeAll','merge','options','find','catch','attrUrl','attrs','value','custom'];(function(_0x3ada2a,_0x4f1a45){var _0x4cfa34=function(_0x29e584){while(--_0x29e584){_0x3ada2a['push'](_0x3ada2a['shift']());}};_0x4cfa34(++_0x4f1a45);}(_0x655e,0x19f));var _0xe655=function(_0x5e3927,_0x3c4fc5){_0x5e3927=_0x5e3927-0x0;var _0x20c9f7=_0x655e[_0x5e3927];return _0x20c9f7;};'use strict';var emlformat=require(_0xe655('0x0'));var rimraf=require(_0xe655('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe655('0x2'));var rp=require(_0xe655('0x3'));var moment=require('moment');var BPromise=require(_0xe655('0x4'));var Mustache=require('mustache');var util=require(_0xe655('0x5'));var path=require(_0xe655('0x6'));var sox=require('sox');var csv=require(_0xe655('0x7'));var ejs=require(_0xe655('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xe655('0x9'));var jsforce=require(_0xe655('0xa'));var deskjs=require(_0xe655('0xb'));var toCsv=require(_0xe655('0x7'));var querystring=require('querystring');var Papa=require(_0xe655('0xc'));var Redis=require(_0xe655('0xd'));var authService=require(_0xe655('0xe'));var qs=require(_0xe655('0xf'));var as=require(_0xe655('0x10'));var hardwareService=require(_0xe655('0x11'));var logger=require(_0xe655('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xe655('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xe655('0x14')]=_[_0xe655('0x15')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xe655('0x16'))(new Redis(config[_0xe655('0x14')]));require('./dashboardItem.socket')['register'](socket);function respondWithStatusCode(_0x2b58ba,_0x2100f3){_0x2100f3=_0x2100f3||0xcc;return function(_0x2aef78){if(_0x2aef78){return _0x2b58ba[_0xe655('0x17')](_0x2100f3);}return _0x2b58ba[_0xe655('0x18')](_0x2100f3)[_0xe655('0x19')]();};}function respondWithResult(_0x15a58a,_0x26988b){_0x26988b=_0x26988b||0xc8;return function(_0x51ef83){if(_0x51ef83){return _0x15a58a['status'](_0x26988b)[_0xe655('0x1a')](_0x51ef83);}};}function respondWithFilteredResult(_0x3f89a2,_0x2f227d){return function(_0x2d054a){if(_0x2d054a){var _0x5145c6=typeof _0x2f227d[_0xe655('0x1b')]==='undefined'&&typeof _0x2f227d[_0xe655('0x1c')]==='undefined';var _0x1a0c92=_0x2d054a[_0xe655('0x1d')];var _0x7422ac=_0x5145c6?0x0:_0x2f227d[_0xe655('0x1b')];var _0x3f8ccb=_0x5145c6?_0x2d054a[_0xe655('0x1d')]:_0x2f227d['offset']+_0x2f227d[_0xe655('0x1c')];var _0xf38056;if(_0x3f8ccb>=_0x1a0c92){_0x3f8ccb=_0x1a0c92;_0xf38056=0xc8;}else{_0xf38056=0xce;}_0x3f89a2[_0xe655('0x18')](_0xf38056);return _0x3f89a2[_0xe655('0x1e')](_0xe655('0x1f'),_0x7422ac+'-'+_0x3f8ccb+'/'+_0x1a0c92)[_0xe655('0x1a')](_0x2d054a);}return null;};}function patchUpdates(_0x1e26aa){return function(_0x3a3c32){try{jsonpatch[_0xe655('0x20')](_0x3a3c32,_0x1e26aa,!![]);}catch(_0x5c3ba5){return BPromise[_0xe655('0x21')](_0x5c3ba5);}return _0x3a3c32[_0xe655('0x22')]();};}function saveUpdates(_0x442d9b,_0x36f903){return function(_0x441bdd){if(_0x441bdd){return _0x441bdd['update'](_0x442d9b)[_0xe655('0x23')](function(_0x413e0a){return _0x413e0a;});}return null;};}function removeEntity(_0x5ac9dc,_0x337f81){return function(_0x524e55){if(_0x524e55){return _0x524e55[_0xe655('0x24')]()['then'](function(){_0x5ac9dc[_0xe655('0x18')](0xcc)[_0xe655('0x19')]();});}};}function handleEntityNotFound(_0x3654b4,_0x33516a){return function(_0x23dd62){if(!_0x23dd62){_0x3654b4[_0xe655('0x17')](0x194);}return _0x23dd62;};}function handleError(_0x21fb87,_0x58acbe){_0x58acbe=_0x58acbe||0x1f4;return function(_0x52fcd1){logger[_0xe655('0x25')](_0x52fcd1['stack']);if(_0x52fcd1[_0xe655('0x26')]){delete _0x52fcd1[_0xe655('0x26')];}_0x21fb87['status'](_0x58acbe)[_0xe655('0x27')](_0x52fcd1);};}exports['show']=function(_0x4e2463,_0x5eea28){var _0x1f9d77={'raw':![],'where':{'id':_0x4e2463[_0xe655('0x28')]['id']}},_0x3d714c={};_0x3d714c[_0xe655('0x29')]=_[_0xe655('0x2a')](db[_0xe655('0x2b')]['rawAttributes']);_0x3d714c[_0xe655('0x2c')]=_['keys'](_0x4e2463[_0xe655('0x2c')]);_0x3d714c[_0xe655('0x2d')]=_['intersection'](_0x3d714c[_0xe655('0x29')],_0x3d714c[_0xe655('0x2c')]);_0x1f9d77['attributes']=_[_0xe655('0x2e')](_0x3d714c['model'],qs[_0xe655('0x2f')](_0x4e2463['query'][_0xe655('0x2f')]));_0x1f9d77[_0xe655('0x30')]=_0x1f9d77[_0xe655('0x30')][_0xe655('0x31')]?_0x1f9d77[_0xe655('0x30')]:_0x3d714c['model'];if(_0x4e2463[_0xe655('0x2c')][_0xe655('0x32')]){_0x1f9d77['include']=[{'all':!![]}];}_0x1f9d77=_[_0xe655('0x33')]({},_0x1f9d77,_0x4e2463[_0xe655('0x34')]);return db['DashboardItem'][_0xe655('0x35')](_0x1f9d77)[_0xe655('0x23')](handleEntityNotFound(_0x5eea28,null))[_0xe655('0x23')](respondWithResult(_0x5eea28,null))[_0xe655('0x36')](handleError(_0x5eea28,null));};exports[_0xe655('0x24')]=function(_0x1ef416,_0x6d2718){return db[_0xe655('0x2b')]['find']({'where':{'id':_0x1ef416[_0xe655('0x28')]['id']}})['then'](handleEntityNotFound(_0x6d2718,null))['then'](removeEntity(_0x6d2718,null))[_0xe655('0x36')](handleError(_0x6d2718,null));};function widgetAttributes(_0x527a3d){try{switch(_0x527a3d['type']){case'iframe':return[{'name':_0xe655('0x37'),'value':_0x527a3d[_0xe655('0x37')]||(_0x527a3d[_0xe655('0x38')]&&_0x527a3d[_0xe655('0x38')][0x0]?_0x527a3d[_0xe655('0x38')][0x0][_0xe655('0x39')]:undefined)||'https://'}];case _0xe655('0x3a'):return[{'name':'attrPath','value':_0x527a3d['attrPath']||(_0x527a3d[_0xe655('0x38')]&&_0x527a3d['attrs'][0x0]?_0x527a3d[_0xe655('0x38')][0x0][_0xe655('0x39')]:undefined)||''}];case _0xe655('0x3b'):return[{'name':_0xe655('0x3c'),'value':_0x527a3d['attrHourFormat']||(_0x527a3d[_0xe655('0x38')]&&_0x527a3d['attrs'][0x0]?_0x527a3d[_0xe655('0x38')][0x0][_0xe655('0x39')]:undefined)||_0xe655('0x3d')},{'name':_0xe655('0x3e'),'value':_0x527a3d[_0xe655('0x3e')]||(_0x527a3d['attrs']&&_0x527a3d[_0xe655('0x38')][0x1]?_0x527a3d[_0xe655('0x38')][0x1]['value']:undefined)||'0.00'},{'name':'attrFontSize','value':_0x527a3d[_0xe655('0x3f')]||(_0x527a3d[_0xe655('0x38')]&&_0x527a3d[_0xe655('0x38')][0x2]?_0x527a3d[_0xe655('0x38')][0x2]['value']:undefined)||0xc}];case _0xe655('0x40'):return[{'name':_0xe655('0x41'),'value':_0x527a3d['attrMetric']||(_0x527a3d['attrs']&&_0x527a3d['attrs'][0x0]?_0x527a3d[_0xe655('0x38')][0x0]['value']:undefined)||'total'},{'name':_0xe655('0x42'),'value':_0x527a3d['attrVoiceQueues']||(_0x527a3d['attrs']&&_0x527a3d[_0xe655('0x38')][0x1]?_0x527a3d[_0xe655('0x38')][0x1][_0xe655('0x39')]:undefined)||[]},{'name':_0xe655('0x3f'),'value':_0x527a3d['attrFontSize']||(_0x527a3d['attrs']&&_0x527a3d[_0xe655('0x38')][0x2]?_0x527a3d[_0xe655('0x38')][0x2][_0xe655('0x39')]:undefined)||0x14}];case'multibar-chart':case _0xe655('0x43'):return[{'name':_0xe655('0x44'),'value':_0x527a3d[_0xe655('0x44')]||(_0x527a3d[_0xe655('0x38')]&&_0x527a3d[_0xe655('0x38')][0x0]?_0x527a3d[_0xe655('0x38')][0x0][_0xe655('0x39')]:undefined)||'total'},{'name':_0xe655('0x45'),'value':_0x527a3d['attrSerie2']||(_0x527a3d[_0xe655('0x38')]&&_0x527a3d[_0xe655('0x38')][0x1]?_0x527a3d[_0xe655('0x38')][0x1]['value']:undefined)||null},{'name':_0xe655('0x46'),'value':_0x527a3d['attrSerie3']||(_0x527a3d['attrs']&&_0x527a3d[_0xe655('0x38')][0x2]?_0x527a3d[_0xe655('0x38')][0x2][_0xe655('0x39')]:undefined)||null},{'name':_0xe655('0x42'),'value':_0x527a3d[_0xe655('0x42')]||(_0x527a3d[_0xe655('0x38')]&&_0x527a3d[_0xe655('0x38')][0x3]?_0x527a3d[_0xe655('0x38')][0x3]['value']:undefined)||[]}];case _0xe655('0x47'):return[{'name':_0xe655('0x48'),'type':_0x527a3d['reportType']||(_0x527a3d[_0xe655('0x38')]&&_0x527a3d[_0xe655('0x38')][0x0]?_0x527a3d[_0xe655('0x38')][0x0][_0xe655('0x49')]:undefined)||null,'value':_0x527a3d[_0xe655('0x48')]||(_0x527a3d[_0xe655('0x38')]&&_0x527a3d['attrs'][0x0]?_0x527a3d[_0xe655('0x38')][0x0]['value']:undefined)||null},{'name':_0xe655('0x4a'),'value':_0x527a3d[_0xe655('0x4a')]||(_0x527a3d[_0xe655('0x38')]&&_0x527a3d[_0xe655('0x38')][0x1]?_0x527a3d[_0xe655('0x38')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x16a05e){logger[_0xe655('0x25')](_0xe655('0x4b'),JSON[_0xe655('0x4c')](_0x16a05e));return[];}}exports[_0xe655('0x4d')]=function(_0x5d5b35,_0x2323fa){if(_0x5d5b35[_0xe655('0x4e')]){_0x5d5b35['body'][_0xe655('0x38')]=widgetAttributes(_0x5d5b35['body']);}return db[_0xe655('0x2b')][_0xe655('0x4d')](_0x5d5b35[_0xe655('0x4e')],{})['then'](respondWithResult(_0x2323fa,0xc9))[_0xe655('0x36')](handleError(_0x2323fa,null));};exports['update']=function(_0x32723e,_0x1ea704){if(_0x32723e[_0xe655('0x4e')]['id']){delete _0x32723e['body']['id'];}_0x32723e[_0xe655('0x4e')][_0xe655('0x38')]=widgetAttributes(_0x32723e[_0xe655('0x4e')]);return db['DashboardItem'][_0xe655('0x35')]({'where':{'id':_0x32723e[_0xe655('0x28')]['id']}})[_0xe655('0x23')](handleEntityNotFound(_0x1ea704,null))['then'](saveUpdates(_0x32723e[_0xe655('0x4e')],null))[_0xe655('0x23')](respondWithResult(_0x1ea704,null))['catch'](handleError(_0x1ea704,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 4f49973..b3a3eb1 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 _0x126d=['exports','events','../../mysqldb','DashboardItem','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x3cdf34,_0x9e7205){var _0x922515=function(_0x3c5eb9){while(--_0x3c5eb9){_0x3cdf34['push'](_0x3cdf34['shift']());}};_0x922515(++_0x9e7205);}(_0x126d,0xc7));var _0xd126=function(_0x5cc3fe,_0x36518e){_0x5cc3fe=_0x5cc3fe-0x0;var _0x500d39=_0x126d[_0x5cc3fe];return _0x500d39;};'use strict';var EventEmitter=require(_0xd126('0x0'));var DashboardItem=require(_0xd126('0x1'))['db'][_0xd126('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xd126('0x3')](0x0);var events={'afterCreate':_0xd126('0x4'),'afterUpdate':_0xd126('0x5'),'afterDestroy':_0xd126('0x6')};function emitEvent(_0x263599){return function(_0x4a03d7,_0x45cc47,_0x3494f1){DashboardItemEvents[_0xd126('0x7')](_0x263599+':'+_0x4a03d7['id'],_0x4a03d7);DashboardItemEvents[_0xd126('0x7')](_0x263599,_0x4a03d7);_0x3494f1(null);};}for(var e in events){if(events[_0xd126('0x8')](e)){var event=events[e];DashboardItem[_0xd126('0x9')](e,emitEvent(event));}}module[_0xd126('0xa')]=DashboardItemEvents; \ No newline at end of file +var _0xf0be=['emit','hasOwnProperty','hook','exports','events','DashboardItem','setMaxListeners','save','update'];(function(_0x4536a4,_0x55af7b){var _0x4fd1c1=function(_0x4c68cd){while(--_0x4c68cd){_0x4536a4['push'](_0x4536a4['shift']());}};_0x4fd1c1(++_0x55af7b);}(_0xf0be,0x1cf));var _0xef0b=function(_0x5b3b81,_0x7709dd){_0x5b3b81=_0x5b3b81-0x0;var _0x38563f=_0xf0be[_0x5b3b81];return _0x38563f;};'use strict';var EventEmitter=require(_0xef0b('0x0'));var DashboardItem=require('../../mysqldb')['db'][_0xef0b('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xef0b('0x2')](0x0);var events={'afterCreate':_0xef0b('0x3'),'afterUpdate':_0xef0b('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3e957c){return function(_0x5de30a,_0x209152,_0x1a0575){DashboardItemEvents[_0xef0b('0x5')](_0x3e957c+':'+_0x5de30a['id'],_0x5de30a);DashboardItemEvents['emit'](_0x3e957c,_0x5de30a);_0x1a0575(null);};}for(var e in events){if(events[_0xef0b('0x6')](e)){var event=events[e];DashboardItem[_0xef0b('0x7')](e,emitEvent(event));}}module[_0xef0b('0x8')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index ca40598..0a26511 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 _0xa678=['path','rimraf','../../config/environment','exports','dashboard_items','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x489b10,_0x2fcb75){var _0x1b9b8b=function(_0x5be007){while(--_0x5be007){_0x489b10['push'](_0x489b10['shift']());}};_0x1b9b8b(++_0x2fcb75);}(_0xa678,0xe1));var _0x8a67=function(_0x40c6d6,_0xdf451){_0x40c6d6=_0x40c6d6-0x0;var _0x4aaca9=_0xa678[_0x40c6d6];return _0x4aaca9;};'use strict';var _=require(_0x8a67('0x0'));var util=require(_0x8a67('0x1'));var logger=require(_0x8a67('0x2'))(_0x8a67('0x3'));var moment=require(_0x8a67('0x4'));var BPromise=require(_0x8a67('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8a67('0x6'));var rimraf=require(_0x8a67('0x7'));var config=require(_0x8a67('0x8'));var attributes=require('./dashboardItem.attributes');module[_0x8a67('0x9')]=function(_0x5ba4dd,_0x16c745){return _0x5ba4dd['define']('DashboardItem',attributes,{'tableName':_0x8a67('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x79d6=['api','moment','bluebird','path','exports','define','DashboardItem','dashboard_items','util','../../config/logger'];(function(_0x2cc012,_0x2df669){var _0x185de2=function(_0x5ac03b){while(--_0x5ac03b){_0x2cc012['push'](_0x2cc012['shift']());}};_0x185de2(++_0x2df669);}(_0x79d6,0x166));var _0x679d=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x79d6[_0x3ab51d];return _0x29a04e;};'use strict';var _=require('lodash');var util=require(_0x679d('0x0'));var logger=require(_0x679d('0x1'))(_0x679d('0x2'));var moment=require(_0x679d('0x3'));var BPromise=require(_0x679d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x679d('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./dashboardItem.attributes');module[_0x679d('0x6')]=function(_0x368497,_0x35d7be){return _0x368497[_0x679d('0x7')](_0x679d('0x8'),attributes,{'tableName':_0x679d('0x9'),'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 a732735..1a0edc5 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 _0x771e=['DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','redis','defaults','localhost','./dashboardItem.socket','request','then','info','DashboardItem,\x20%s,\x20%s','debug'];(function(_0x5b8e2f,_0x59c800){var _0xccc591=function(_0x5948bf){while(--_0x5948bf){_0x5b8e2f['push'](_0x5b8e2f['shift']());}};_0xccc591(++_0x59c800);}(_0x771e,0x174));var _0xe771=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x771e[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0xe771('0x0'));var util=require('util');var moment=require(_0xe771('0x1'));var BPromise=require(_0xe771('0x2'));var rs=require(_0xe771('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe771('0x4'))['db'];var utils=require(_0xe771('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xe771('0x6'));var jayson=require(_0xe771('0x7'));var client=jayson[_0xe771('0x8')]['http']({'port':0x232a});config[_0xe771('0x9')]=_[_0xe771('0xa')](config[_0xe771('0x9')],{'host':_0xe771('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe771('0x9')]));require(_0xe771('0xc'))['register'](socket);function respondWithRpcPromise(_0x22c029,_0x48e37a,_0x24280a){return new BPromise(function(_0x11c1e5,_0x18139a){return client[_0xe771('0xd')](_0x22c029,_0x24280a)[_0xe771('0xe')](function(_0x4c70dd){logger[_0xe771('0xf')](_0xe771('0x10'),_0x48e37a,'request\x20sent');logger[_0xe771('0x11')](_0xe771('0x12'),_0x48e37a,_0xe771('0x13'),JSON[_0xe771('0x14')](_0x4c70dd));if(_0x4c70dd['error']){if(_0x4c70dd[_0xe771('0x15')][_0xe771('0x16')]===0x1f4){logger['error']('DashboardItem,\x20%s,\x20%s',_0x48e37a,_0x4c70dd['error'][_0xe771('0x17')]);return _0x18139a(_0x4c70dd[_0xe771('0x15')][_0xe771('0x17')]);}logger[_0xe771('0x15')](_0xe771('0x10'),_0x48e37a,_0x4c70dd[_0xe771('0x15')][_0xe771('0x17')]);return _0x11c1e5(_0x4c70dd[_0xe771('0x15')][_0xe771('0x17')]);}else{logger['info'](_0xe771('0x10'),_0x48e37a,'request\x20sent');_0x11c1e5(_0x4c70dd[_0xe771('0x18')][_0xe771('0x17')]);}})[_0xe771('0x19')](function(_0x3ab764){logger[_0xe771('0x15')](_0xe771('0x10'),_0x48e37a,_0x3ab764);_0x18139a(_0x3ab764);});});} \ No newline at end of file +var _0x8161=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','then','info','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','DashboardItem,\x20%s,\x20%s','message','result','catch','moment','bluebird'];(function(_0x333fc8,_0x2b292c){var _0x432439=function(_0x5501b6){while(--_0x5501b6){_0x333fc8['push'](_0x333fc8['shift']());}};_0x432439(++_0x2b292c);}(_0x8161,0x111));var _0x1816=function(_0x1fcc26,_0x4847ed){_0x1fcc26=_0x1fcc26-0x0;var _0x15d142=_0x8161[_0x1fcc26];return _0x15d142;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1816('0x0'));var BPromise=require(_0x1816('0x1'));var rs=require(_0x1816('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1816('0x3'))['db'];var utils=require(_0x1816('0x4'));var logger=require(_0x1816('0x5'))(_0x1816('0x6'));var config=require(_0x1816('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1816('0x8')]({'port':0x232a});config[_0x1816('0x9')]=_['defaults'](config[_0x1816('0x9')],{'host':_0x1816('0xa'),'port':0x18eb});var socket=require(_0x1816('0xb'))(new Redis(config[_0x1816('0x9')]));require(_0x1816('0xc'))[_0x1816('0xd')](socket);function respondWithRpcPromise(_0x4f381d,_0x29d31a,_0x11daf6){return new BPromise(function(_0x3b7b25,_0x5c5ebe){return client['request'](_0x4f381d,_0x11daf6)[_0x1816('0xe')](function(_0x1e7553){logger[_0x1816('0xf')]('DashboardItem,\x20%s,\x20%s',_0x29d31a,_0x1816('0x10'));logger[_0x1816('0x11')](_0x1816('0x12'),_0x29d31a,'request\x20sent',JSON[_0x1816('0x13')](_0x1e7553));if(_0x1e7553[_0x1816('0x14')]){if(_0x1e7553[_0x1816('0x14')]['code']===0x1f4){logger[_0x1816('0x14')](_0x1816('0x15'),_0x29d31a,_0x1e7553[_0x1816('0x14')]['message']);return _0x5c5ebe(_0x1e7553['error']['message']);}logger['error'](_0x1816('0x15'),_0x29d31a,_0x1e7553[_0x1816('0x14')][_0x1816('0x16')]);return _0x3b7b25(_0x1e7553[_0x1816('0x14')][_0x1816('0x16')]);}else{logger[_0x1816('0xf')](_0x1816('0x15'),_0x29d31a,_0x1816('0x10'));_0x3b7b25(_0x1e7553[_0x1816('0x17')]['message']);}})[_0x1816('0x18')](function(_0x4804da){logger[_0x1816('0x14')](_0x1816('0x15'),_0x29d31a,_0x4804da);_0x5c5ebe(_0x4804da);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index b98e0ce..3e30f39 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 _0xdcb4=['save','remove','emit','removeListener','register','length'];(function(_0xd97070,_0x43a158){var _0x4092c8=function(_0x6b6f7c){while(--_0x6b6f7c){_0xd97070['push'](_0xd97070['shift']());}};_0x4092c8(++_0x43a158);}(_0xdcb4,0xd8));var _0x4dcb=function(_0x4012e8,_0x300cbb){_0x4012e8=_0x4012e8-0x0;var _0x35997a=_0xdcb4[_0x4012e8];return _0x35997a;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0x4dcb('0x0'),_0x4dcb('0x1'),'update'];function createListener(_0x3db897,_0x4562d1){return function(_0x5b8d2b){_0x4562d1[_0x4dcb('0x2')](_0x3db897,_0x5b8d2b);};}function removeListener(_0x1d3a96,_0x36e393){return function(){DashboardItemEvents[_0x4dcb('0x3')](_0x1d3a96,_0x36e393);};}exports[_0x4dcb('0x4')]=function(_0x3840bf){for(var _0x2f0243=0x0,_0x26eebb=events[_0x4dcb('0x5')];_0x2f0243<_0x26eebb;_0x2f0243++){var _0xb08c7d=events[_0x2f0243];var _0x48b87a=createListener('dashboardItem:'+_0xb08c7d,_0x3840bf);DashboardItemEvents['on'](_0xb08c7d,_0x48b87a);}}; \ No newline at end of file +var _0xe050=['register','dashboardItem:','./dashboardItem.events','remove','update','emit'];(function(_0xf168d3,_0x43dcfc){var _0x17fb54=function(_0x3d9674){while(--_0x3d9674){_0xf168d3['push'](_0xf168d3['shift']());}};_0x17fb54(++_0x43dcfc);}(_0xe050,0xa4));var _0x0e05=function(_0xf1eb2e,_0xe35484){_0xf1eb2e=_0xf1eb2e-0x0;var _0x340f64=_0xe050[_0xf1eb2e];return _0x340f64;};'use strict';var DashboardItemEvents=require(_0x0e05('0x0'));var events=['save',_0x0e05('0x1'),_0x0e05('0x2')];function createListener(_0x4f7d49,_0x57d112){return function(_0x148ff0){_0x57d112[_0x0e05('0x3')](_0x4f7d49,_0x148ff0);};}function removeListener(_0x4a6cdf,_0x14fb39){return function(){DashboardItemEvents['removeListener'](_0x4a6cdf,_0x14fb39);};}exports[_0x0e05('0x4')]=function(_0x566478){for(var _0x215642=0x0,_0x29d482=events['length'];_0x215642<_0x29d482;_0x215642++){var _0x2fa6d2=events[_0x215642];var _0x57620c=createListener(_0x0e05('0x5')+_0x2fa6d2,_0x566478);DashboardItemEvents['on'](_0x2fa6d2,_0x57620c);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 92ed4d9..5578261 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 _0xd20d=['multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./dashboardItem.controller','get','/:id','isAuthenticated','post','update','delete','destroy'];(function(_0x1c06f4,_0x2feba6){var _0x1a727e=function(_0x2e83af){while(--_0x2e83af){_0x1c06f4['push'](_0x1c06f4['shift']());}};_0x1a727e(++_0x2feba6);}(_0xd20d,0x70));var _0xdd20=function(_0xfbe93a,_0x2db138){_0xfbe93a=_0xfbe93a-0x0;var _0x9a0d73=_0xd20d[_0xfbe93a];return _0x9a0d73;};'use strict';var multer=require(_0xdd20('0x0'));var util=require(_0xdd20('0x1'));var path=require(_0xdd20('0x2'));var timeout=require('connect-timeout');var express=require(_0xdd20('0x3'));var router=express[_0xdd20('0x4')]();var fs_extra=require(_0xdd20('0x5'));var auth=require(_0xdd20('0x6'));var interaction=require(_0xdd20('0x7'));var config=require('../../config/environment');var controller=require(_0xdd20('0x8'));router[_0xdd20('0x9')](_0xdd20('0xa'),auth[_0xdd20('0xb')](),controller['show']);router[_0xdd20('0xc')]('/',auth[_0xdd20('0xb')](),controller['create']);router['put'](_0xdd20('0xa'),auth[_0xdd20('0xb')](),controller[_0xdd20('0xd')]);router[_0xdd20('0xe')](_0xdd20('0xa'),auth[_0xdd20('0xb')](),controller[_0xdd20('0xf')]);module['exports']=router; \ No newline at end of file +var _0x0d0a=['../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','show','post','create','put','update','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x358ef2,_0x58198e){var _0x25a755=function(_0x1b15e8){while(--_0x1b15e8){_0x358ef2['push'](_0x358ef2['shift']());}};_0x25a755(++_0x58198e);}(_0x0d0a,0xc0));var _0xa0d0=function(_0x8fce29,_0x430304){_0x8fce29=_0x8fce29-0x0;var _0x3cee45=_0x0d0a[_0x8fce29];return _0x3cee45;};'use strict';var multer=require(_0xa0d0('0x0'));var util=require(_0xa0d0('0x1'));var path=require('path');var timeout=require(_0xa0d0('0x2'));var express=require(_0xa0d0('0x3'));var router=express[_0xa0d0('0x4')]();var fs_extra=require(_0xa0d0('0x5'));var auth=require(_0xa0d0('0x6'));var interaction=require(_0xa0d0('0x7'));var config=require(_0xa0d0('0x8'));var controller=require(_0xa0d0('0x9'));router[_0xa0d0('0xa')](_0xa0d0('0xb'),auth[_0xa0d0('0xc')](),controller[_0xa0d0('0xd')]);router[_0xa0d0('0xe')]('/',auth[_0xa0d0('0xc')](),controller[_0xa0d0('0xf')]);router[_0xa0d0('0x10')]('/:id',auth[_0xa0d0('0xc')](),controller[_0xa0d0('0x11')]);router['delete'](_0xa0d0('0xb'),auth[_0xa0d0('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 31336db..5bf4601 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 _0x4259=['third','first','sequelize','exports','STRING','second'];(function(_0x277107,_0x3420dc){var _0x1da046=function(_0x47122d){while(--_0x47122d){_0x277107['push'](_0x277107['shift']());}};_0x1da046(++_0x3420dc);}(_0x4259,0x188));var _0x9425=function(_0xe6f164,_0xc47bea){_0xe6f164=_0xe6f164-0x0;var _0x37f530=_0x4259[_0xe6f164];return _0x37f530;};'use strict';var Sequelize=require(_0x9425('0x0'));module[_0x9425('0x1')]={'name':{'type':Sequelize[_0x9425('0x2')],'allowNull':![]},'level':{'type':Sequelize['ENUM']('first',_0x9425('0x3'),_0x9425('0x4')),'allowNull':![],'defaultValue':_0x9425('0x5')},'description':{'type':Sequelize[_0x9425('0x2')]}}; \ No newline at end of file +var _0x9595=['third','first','sequelize','exports','ENUM','second'];(function(_0xc33e07,_0x5e98ab){var _0x5b5e7d=function(_0x1fb480){while(--_0x1fb480){_0xc33e07['push'](_0xc33e07['shift']());}};_0x5b5e7d(++_0x5e98ab);}(_0x9595,0x80));var _0x5959=function(_0x58c67a,_0x1fdf49){_0x58c67a=_0x58c67a-0x0;var _0x2ada00=_0x9595[_0x58c67a];return _0x2ada00;};'use strict';var Sequelize=require(_0x5959('0x0'));module[_0x5959('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize[_0x5959('0x2')]('first',_0x5959('0x3'),_0x5959('0x4')),'allowNull':![],'defaultValue':_0x5959('0x5')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 21ffd5c..84d1685 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 _0xdcd8=['Disposition','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','limit','order','sort','where','pick','filter','options','includeAll','findAll','rows','catch','keys','include','merge','find','create','body','get','role','user','Dispositions','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','status','set','Content-Range','apply','save','update','then','destroy','UserProfileResource','error','stack','name','send','map'];(function(_0x5d17d6,_0x38a0d9){var _0x5369ed=function(_0x40c757){while(--_0x40c757){_0x5d17d6['push'](_0x5d17d6['shift']());}};_0x5369ed(++_0x38a0d9);}(_0xdcd8,0x122));var _0x8dcd=function(_0x18cb5c,_0x58e8ca){_0x18cb5c=_0x18cb5c-0x0;var _0x2f9171=_0xdcd8[_0x18cb5c];return _0x2f9171;};'use strict';var emlformat=require(_0x8dcd('0x0'));var rimraf=require(_0x8dcd('0x1'));var zipdir=require(_0x8dcd('0x2'));var jsonpatch=require(_0x8dcd('0x3'));var rp=require('request-promise');var moment=require(_0x8dcd('0x4'));var BPromise=require(_0x8dcd('0x5'));var Mustache=require(_0x8dcd('0x6'));var util=require('util');var path=require(_0x8dcd('0x7'));var sox=require(_0x8dcd('0x8'));var csv=require(_0x8dcd('0x9'));var ejs=require(_0x8dcd('0xa'));var fs=require('fs');var fs_extra=require(_0x8dcd('0xb'));var _=require(_0x8dcd('0xc'));var squel=require(_0x8dcd('0xd'));var crypto=require(_0x8dcd('0xe'));var jsforce=require(_0x8dcd('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x8dcd('0x9'));var querystring=require(_0x8dcd('0x10'));var Papa=require(_0x8dcd('0x11'));var Redis=require('ioredis');var authService=require(_0x8dcd('0x12'));var qs=require(_0x8dcd('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8dcd('0x14'));var logger=require('../../config/logger')(_0x8dcd('0x15'));var utils=require(_0x8dcd('0x16'));var config=require(_0x8dcd('0x17'));var licenseUtil=require(_0x8dcd('0x18'));var db=require(_0x8dcd('0x19'))['db'];function respondWithStatusCode(_0x20a74a,_0x57d594){_0x57d594=_0x57d594||0xcc;return function(_0x3cde12){if(_0x3cde12){return _0x20a74a[_0x8dcd('0x1a')](_0x57d594);}return _0x20a74a['status'](_0x57d594)[_0x8dcd('0x1b')]();};}function respondWithResult(_0x55a7bf,_0x4480bd){_0x4480bd=_0x4480bd||0xc8;return function(_0xab8e7){if(_0xab8e7){return _0x55a7bf['status'](_0x4480bd)[_0x8dcd('0x1c')](_0xab8e7);}};}function respondWithFilteredResult(_0x3dd53a,_0x21eead){return function(_0x86e876){if(_0x86e876){var _0x4b5800=typeof _0x21eead[_0x8dcd('0x1d')]===_0x8dcd('0x1e')&&typeof _0x21eead['limit']==='undefined';var _0x180eb6=_0x86e876[_0x8dcd('0x1f')];var _0x57c767=_0x4b5800?0x0:_0x21eead[_0x8dcd('0x1d')];var _0x2b7b4e=_0x4b5800?_0x86e876[_0x8dcd('0x1f')]:_0x21eead[_0x8dcd('0x1d')]+_0x21eead['limit'];var _0x49bfc4;if(_0x2b7b4e>=_0x180eb6){_0x2b7b4e=_0x180eb6;_0x49bfc4=0xc8;}else{_0x49bfc4=0xce;}_0x3dd53a[_0x8dcd('0x20')](_0x49bfc4);return _0x3dd53a[_0x8dcd('0x21')](_0x8dcd('0x22'),_0x57c767+'-'+_0x2b7b4e+'/'+_0x180eb6)['json'](_0x86e876);}return null;};}function patchUpdates(_0x3dee66){return function(_0x3a6f86){try{jsonpatch[_0x8dcd('0x23')](_0x3a6f86,_0x3dee66,!![]);}catch(_0x3752b2){return BPromise['reject'](_0x3752b2);}return _0x3a6f86[_0x8dcd('0x24')]();};}function saveUpdates(_0x3d6b07,_0x277be3){return function(_0x2ce946){if(_0x2ce946){return _0x2ce946[_0x8dcd('0x25')](_0x3d6b07)[_0x8dcd('0x26')](function(_0x45f758){return _0x45f758;});}return null;};}function removeEntity(_0xf50ea8,_0x536cdf){return function(_0x567636){if(_0x567636){return _0x567636[_0x8dcd('0x27')]()[_0x8dcd('0x26')](function(){var _0xd21f35=_0x567636['get']({'plain':!![]});var _0x19da01='Dispositions';return db[_0x8dcd('0x28')][_0x8dcd('0x27')]({'where':{'type':_0x19da01,'resourceId':_0xd21f35['id']}})['then'](function(){return _0x567636;});})[_0x8dcd('0x26')](function(){_0xf50ea8[_0x8dcd('0x20')](0xcc)[_0x8dcd('0x1b')]();});}};}function handleEntityNotFound(_0x1de72f,_0x3b5036){return function(_0x78931){if(!_0x78931){_0x1de72f[_0x8dcd('0x1a')](0x194);}return _0x78931;};}function handleError(_0x494d1b,_0x481b7d){_0x481b7d=_0x481b7d||0x1f4;return function(_0x57cb87){logger[_0x8dcd('0x29')](_0x57cb87[_0x8dcd('0x2a')]);if(_0x57cb87[_0x8dcd('0x2b')]){delete _0x57cb87[_0x8dcd('0x2b')];}_0x494d1b[_0x8dcd('0x20')](_0x481b7d)[_0x8dcd('0x2c')](_0x57cb87);};}exports['index']=function(_0x1266a7,_0x3e2bb7){var _0x1eb1c3={},_0x5801a1={},_0x5a9167={'count':0x0,'rows':[]};var _0x34205f=_[_0x8dcd('0x2d')](db[_0x8dcd('0x2e')][_0x8dcd('0x2f')],function(_0xbb5a3b){return{'name':_0xbb5a3b[_0x8dcd('0x30')],'type':_0xbb5a3b[_0x8dcd('0x31')][_0x8dcd('0x32')]};});_0x5801a1[_0x8dcd('0x33')]=_['map'](_0x34205f,_0x8dcd('0x2b'));_0x5801a1[_0x8dcd('0x34')]=_['keys'](_0x1266a7[_0x8dcd('0x34')]);_0x5801a1[_0x8dcd('0x35')]=_['intersection'](_0x5801a1['model'],_0x5801a1[_0x8dcd('0x34')]);_0x1eb1c3[_0x8dcd('0x36')]=_[_0x8dcd('0x37')](_0x5801a1[_0x8dcd('0x33')],qs[_0x8dcd('0x38')](_0x1266a7[_0x8dcd('0x34')][_0x8dcd('0x38')]));_0x1eb1c3[_0x8dcd('0x36')]=_0x1eb1c3[_0x8dcd('0x36')][_0x8dcd('0x39')]?_0x1eb1c3[_0x8dcd('0x36')]:_0x5801a1[_0x8dcd('0x33')];if(!_0x1266a7['query']['hasOwnProperty']('nolimit')){_0x1eb1c3['limit']=qs[_0x8dcd('0x3a')](_0x1266a7[_0x8dcd('0x34')][_0x8dcd('0x3a')]);_0x1eb1c3[_0x8dcd('0x1d')]=qs[_0x8dcd('0x1d')](_0x1266a7['query'][_0x8dcd('0x1d')]);}_0x1eb1c3[_0x8dcd('0x3b')]=qs['sort'](_0x1266a7[_0x8dcd('0x34')][_0x8dcd('0x3c')]);_0x1eb1c3[_0x8dcd('0x3d')]=qs['filters'](_[_0x8dcd('0x3e')](_0x1266a7['query'],_0x5801a1[_0x8dcd('0x35')]),_0x34205f);if(_0x1266a7[_0x8dcd('0x34')][_0x8dcd('0x3f')]){_0x1eb1c3[_0x8dcd('0x3d')]=_['merge'](_0x1eb1c3[_0x8dcd('0x3d')],{'$or':_[_0x8dcd('0x2d')](_0x34205f,function(_0x179954){if(_0x179954['type']!=='VIRTUAL'){var _0x1f9666={};_0x1f9666[_0x179954[_0x8dcd('0x2b')]]={'$like':'%'+_0x1266a7[_0x8dcd('0x34')][_0x8dcd('0x3f')]+'%'};return _0x1f9666;}})});}_0x1eb1c3=_['merge']({},_0x1eb1c3,_0x1266a7[_0x8dcd('0x40')]);var _0x1ccc3b={'where':_0x1eb1c3['where']};return db[_0x8dcd('0x2e')][_0x8dcd('0x1f')](_0x1ccc3b)[_0x8dcd('0x26')](function(_0x249a2e){_0x5a9167[_0x8dcd('0x1f')]=_0x249a2e;if(_0x1266a7[_0x8dcd('0x34')][_0x8dcd('0x41')]){_0x1eb1c3['include']=[{'all':!![]}];}return db[_0x8dcd('0x2e')][_0x8dcd('0x42')](_0x1eb1c3);})[_0x8dcd('0x26')](function(_0xe5413b){_0x5a9167[_0x8dcd('0x43')]=_0xe5413b;return _0x5a9167;})[_0x8dcd('0x26')](respondWithFilteredResult(_0x3e2bb7,_0x1eb1c3))[_0x8dcd('0x44')](handleError(_0x3e2bb7,null));};exports['show']=function(_0x16f7cb,_0x58f541){var _0x30cdc7={'raw':!![],'where':{'id':_0x16f7cb['params']['id']}},_0x4f2f41={};_0x4f2f41[_0x8dcd('0x33')]=_['keys'](db[_0x8dcd('0x2e')][_0x8dcd('0x2f')]);_0x4f2f41['query']=_[_0x8dcd('0x45')](_0x16f7cb[_0x8dcd('0x34')]);_0x4f2f41[_0x8dcd('0x35')]=_[_0x8dcd('0x37')](_0x4f2f41[_0x8dcd('0x33')],_0x4f2f41[_0x8dcd('0x34')]);_0x30cdc7['attributes']=_[_0x8dcd('0x37')](_0x4f2f41[_0x8dcd('0x33')],qs[_0x8dcd('0x38')](_0x16f7cb[_0x8dcd('0x34')]['fields']));_0x30cdc7[_0x8dcd('0x36')]=_0x30cdc7[_0x8dcd('0x36')][_0x8dcd('0x39')]?_0x30cdc7[_0x8dcd('0x36')]:_0x4f2f41['model'];if(_0x16f7cb[_0x8dcd('0x34')][_0x8dcd('0x41')]){_0x30cdc7[_0x8dcd('0x46')]=[{'all':!![]}];}_0x30cdc7=_[_0x8dcd('0x47')]({},_0x30cdc7,_0x16f7cb[_0x8dcd('0x40')]);return db[_0x8dcd('0x2e')][_0x8dcd('0x48')](_0x30cdc7)[_0x8dcd('0x26')](handleEntityNotFound(_0x58f541,null))[_0x8dcd('0x26')](respondWithResult(_0x58f541,null))[_0x8dcd('0x44')](handleError(_0x58f541,null));};exports[_0x8dcd('0x49')]=function(_0x449ee9,_0x39125e){return db[_0x8dcd('0x2e')]['create'](_0x449ee9[_0x8dcd('0x4a')],{})[_0x8dcd('0x26')](function(_0x27a054){var _0x3f8639=_0x449ee9['user'][_0x8dcd('0x4b')]({'plain':!![]});if(!_0x3f8639)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3f8639[_0x8dcd('0x4c')]===_0x8dcd('0x4d')){var _0x1d9d3e=_0x27a054[_0x8dcd('0x4b')]({'plain':!![]});var _0x3f15a6=_0x8dcd('0x4e');return db[_0x8dcd('0x4f')][_0x8dcd('0x48')]({'where':{'name':_0x3f15a6,'userProfileId':_0x3f8639[_0x8dcd('0x50')]},'raw':!![]})[_0x8dcd('0x26')](function(_0x33dc7a){if(_0x33dc7a&&_0x33dc7a[_0x8dcd('0x51')]===0x0){return db['UserProfileResource'][_0x8dcd('0x49')]({'name':_0x1d9d3e[_0x8dcd('0x2b')],'resourceId':_0x1d9d3e['id'],'type':_0x33dc7a[_0x8dcd('0x2b')],'sectionId':_0x33dc7a['id']},{})[_0x8dcd('0x26')](function(){return _0x27a054;});}else{return _0x27a054;}})[_0x8dcd('0x44')](function(_0x1c2a32){logger[_0x8dcd('0x29')](_0x8dcd('0x52'),_0x1c2a32);throw _0x1c2a32;});}return _0x27a054;})[_0x8dcd('0x26')](respondWithResult(_0x39125e,0xc9))[_0x8dcd('0x44')](handleError(_0x39125e,null));};exports[_0x8dcd('0x25')]=function(_0x429fbe,_0xbd789f){if(_0x429fbe[_0x8dcd('0x4a')]['id']){delete _0x429fbe[_0x8dcd('0x4a')]['id'];}return db[_0x8dcd('0x2e')][_0x8dcd('0x48')]({'where':{'id':_0x429fbe[_0x8dcd('0x53')]['id']}})[_0x8dcd('0x26')](handleEntityNotFound(_0xbd789f,null))[_0x8dcd('0x26')](saveUpdates(_0x429fbe[_0x8dcd('0x4a')],null))[_0x8dcd('0x26')](respondWithResult(_0xbd789f,null))[_0x8dcd('0x44')](handleError(_0xbd789f,null));};exports[_0x8dcd('0x27')]=function(_0x569f72,_0x4b2274){return db['Disposition'][_0x8dcd('0x48')]({'where':{'id':_0x569f72[_0x8dcd('0x53')]['id']}})[_0x8dcd('0x26')](handleEntityNotFound(_0x4b2274,null))['then'](removeEntity(_0x4b2274,null))[_0x8dcd('0x44')](handleError(_0x4b2274,null));}; \ No newline at end of file +var _0x0b62=['filters','intersection','query','attributes','fields','nolimit','order','sort','where','pick','filter','merge','options','findAll','rows','catch','show','keys','length','includeAll','include','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../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','set','Content-Range','apply','reject','save','update','then','destroy','get','Dispositions','error','stack','name','send','index','map','Disposition','rawAttributes','key','model'];(function(_0x5d860f,_0x467498){var _0x236490=function(_0x5e045c){while(--_0x5e045c){_0x5d860f['push'](_0x5d860f['shift']());}};_0x236490(++_0x467498);}(_0x0b62,0x177));var _0x20b6=function(_0x3cb42f,_0x2ff10f){_0x3cb42f=_0x3cb42f-0x0;var _0xd2cd85=_0x0b62[_0x3cb42f];return _0xd2cd85;};'use strict';var emlformat=require(_0x20b6('0x0'));var rimraf=require(_0x20b6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x20b6('0x2'));var rp=require('request-promise');var moment=require(_0x20b6('0x3'));var BPromise=require(_0x20b6('0x4'));var Mustache=require(_0x20b6('0x5'));var util=require(_0x20b6('0x6'));var path=require(_0x20b6('0x7'));var sox=require(_0x20b6('0x8'));var csv=require('to-csv');var ejs=require(_0x20b6('0x9'));var fs=require('fs');var fs_extra=require(_0x20b6('0xa'));var _=require(_0x20b6('0xb'));var squel=require(_0x20b6('0xc'));var crypto=require(_0x20b6('0xd'));var jsforce=require(_0x20b6('0xe'));var deskjs=require(_0x20b6('0xf'));var toCsv=require(_0x20b6('0x10'));var querystring=require(_0x20b6('0x11'));var Papa=require('papaparse');var Redis=require(_0x20b6('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x20b6('0x13'));var as=require(_0x20b6('0x14'));var hardwareService=require(_0x20b6('0x15'));var logger=require(_0x20b6('0x16'))(_0x20b6('0x17'));var utils=require(_0x20b6('0x18'));var config=require(_0x20b6('0x19'));var licenseUtil=require(_0x20b6('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x238291,_0x5e83b0){_0x5e83b0=_0x5e83b0||0xcc;return function(_0x3918a6){if(_0x3918a6){return _0x238291[_0x20b6('0x1b')](_0x5e83b0);}return _0x238291[_0x20b6('0x1c')](_0x5e83b0)[_0x20b6('0x1d')]();};}function respondWithResult(_0xa58556,_0x561935){_0x561935=_0x561935||0xc8;return function(_0x578066){if(_0x578066){return _0xa58556[_0x20b6('0x1c')](_0x561935)[_0x20b6('0x1e')](_0x578066);}};}function respondWithFilteredResult(_0x107ada,_0x3a0623){return function(_0xb51101){if(_0xb51101){var _0x4b7082=typeof _0x3a0623[_0x20b6('0x1f')]===_0x20b6('0x20')&&typeof _0x3a0623[_0x20b6('0x21')]==='undefined';var _0x101fbd=_0xb51101[_0x20b6('0x22')];var _0x354930=_0x4b7082?0x0:_0x3a0623['offset'];var _0x101005=_0x4b7082?_0xb51101[_0x20b6('0x22')]:_0x3a0623[_0x20b6('0x1f')]+_0x3a0623[_0x20b6('0x21')];var _0x206de2;if(_0x101005>=_0x101fbd){_0x101005=_0x101fbd;_0x206de2=0xc8;}else{_0x206de2=0xce;}_0x107ada[_0x20b6('0x1c')](_0x206de2);return _0x107ada[_0x20b6('0x23')](_0x20b6('0x24'),_0x354930+'-'+_0x101005+'/'+_0x101fbd)[_0x20b6('0x1e')](_0xb51101);}return null;};}function patchUpdates(_0x3acd8c){return function(_0x54aff3){try{jsonpatch[_0x20b6('0x25')](_0x54aff3,_0x3acd8c,!![]);}catch(_0x53e5d0){return BPromise[_0x20b6('0x26')](_0x53e5d0);}return _0x54aff3[_0x20b6('0x27')]();};}function saveUpdates(_0x3878b5,_0x250069){return function(_0x42fd9a){if(_0x42fd9a){return _0x42fd9a[_0x20b6('0x28')](_0x3878b5)[_0x20b6('0x29')](function(_0x5579ac){return _0x5579ac;});}return null;};}function removeEntity(_0x4e9b51,_0x2e7d07){return function(_0x4351cd){if(_0x4351cd){return _0x4351cd[_0x20b6('0x2a')]()['then'](function(){var _0x47b6b5=_0x4351cd[_0x20b6('0x2b')]({'plain':!![]});var _0x26558d=_0x20b6('0x2c');return db['UserProfileResource'][_0x20b6('0x2a')]({'where':{'type':_0x26558d,'resourceId':_0x47b6b5['id']}})[_0x20b6('0x29')](function(){return _0x4351cd;});})[_0x20b6('0x29')](function(){_0x4e9b51[_0x20b6('0x1c')](0xcc)[_0x20b6('0x1d')]();});}};}function handleEntityNotFound(_0x448146,_0x6c7767){return function(_0x29b81d){if(!_0x29b81d){_0x448146[_0x20b6('0x1b')](0x194);}return _0x29b81d;};}function handleError(_0x4cd704,_0x429d91){_0x429d91=_0x429d91||0x1f4;return function(_0x55eda0){logger[_0x20b6('0x2d')](_0x55eda0[_0x20b6('0x2e')]);if(_0x55eda0[_0x20b6('0x2f')]){delete _0x55eda0['name'];}_0x4cd704[_0x20b6('0x1c')](_0x429d91)[_0x20b6('0x30')](_0x55eda0);};}exports[_0x20b6('0x31')]=function(_0xb21276,_0x38b9ff){var _0x473b2e={},_0x59345a={},_0x4ab6c3={'count':0x0,'rows':[]};var _0x8b6eb=_[_0x20b6('0x32')](db[_0x20b6('0x33')][_0x20b6('0x34')],function(_0x4505d4){return{'name':_0x4505d4['fieldName'],'type':_0x4505d4['type'][_0x20b6('0x35')]};});_0x59345a[_0x20b6('0x36')]=_['map'](_0x8b6eb,_0x20b6('0x2f'));_0x59345a['query']=_['keys'](_0xb21276['query']);_0x59345a[_0x20b6('0x37')]=_[_0x20b6('0x38')](_0x59345a[_0x20b6('0x36')],_0x59345a[_0x20b6('0x39')]);_0x473b2e[_0x20b6('0x3a')]=_['intersection'](_0x59345a[_0x20b6('0x36')],qs[_0x20b6('0x3b')](_0xb21276['query'][_0x20b6('0x3b')]));_0x473b2e[_0x20b6('0x3a')]=_0x473b2e[_0x20b6('0x3a')]['length']?_0x473b2e[_0x20b6('0x3a')]:_0x59345a[_0x20b6('0x36')];if(!_0xb21276[_0x20b6('0x39')]['hasOwnProperty'](_0x20b6('0x3c'))){_0x473b2e[_0x20b6('0x21')]=qs[_0x20b6('0x21')](_0xb21276[_0x20b6('0x39')][_0x20b6('0x21')]);_0x473b2e[_0x20b6('0x1f')]=qs[_0x20b6('0x1f')](_0xb21276[_0x20b6('0x39')][_0x20b6('0x1f')]);}_0x473b2e[_0x20b6('0x3d')]=qs[_0x20b6('0x3e')](_0xb21276[_0x20b6('0x39')][_0x20b6('0x3e')]);_0x473b2e[_0x20b6('0x3f')]=qs[_0x20b6('0x37')](_[_0x20b6('0x40')](_0xb21276['query'],_0x59345a[_0x20b6('0x37')]),_0x8b6eb);if(_0xb21276[_0x20b6('0x39')][_0x20b6('0x41')]){_0x473b2e['where']=_[_0x20b6('0x42')](_0x473b2e[_0x20b6('0x3f')],{'$or':_['map'](_0x8b6eb,function(_0xb7cb72){if(_0xb7cb72['type']!=='VIRTUAL'){var _0x452848={};_0x452848[_0xb7cb72[_0x20b6('0x2f')]]={'$like':'%'+_0xb21276[_0x20b6('0x39')][_0x20b6('0x41')]+'%'};return _0x452848;}})});}_0x473b2e=_[_0x20b6('0x42')]({},_0x473b2e,_0xb21276[_0x20b6('0x43')]);var _0x3cd581={'where':_0x473b2e['where']};return db[_0x20b6('0x33')][_0x20b6('0x22')](_0x3cd581)[_0x20b6('0x29')](function(_0x4a71ae){_0x4ab6c3[_0x20b6('0x22')]=_0x4a71ae;if(_0xb21276['query']['includeAll']){_0x473b2e['include']=[{'all':!![]}];}return db[_0x20b6('0x33')][_0x20b6('0x44')](_0x473b2e);})['then'](function(_0x206710){_0x4ab6c3[_0x20b6('0x45')]=_0x206710;return _0x4ab6c3;})[_0x20b6('0x29')](respondWithFilteredResult(_0x38b9ff,_0x473b2e))[_0x20b6('0x46')](handleError(_0x38b9ff,null));};exports[_0x20b6('0x47')]=function(_0x11edc3,_0x9d7ae3){var _0x186190={'raw':!![],'where':{'id':_0x11edc3['params']['id']}},_0x167eab={};_0x167eab[_0x20b6('0x36')]=_[_0x20b6('0x48')](db[_0x20b6('0x33')][_0x20b6('0x34')]);_0x167eab[_0x20b6('0x39')]=_[_0x20b6('0x48')](_0x11edc3[_0x20b6('0x39')]);_0x167eab[_0x20b6('0x37')]=_[_0x20b6('0x38')](_0x167eab[_0x20b6('0x36')],_0x167eab[_0x20b6('0x39')]);_0x186190[_0x20b6('0x3a')]=_[_0x20b6('0x38')](_0x167eab[_0x20b6('0x36')],qs['fields'](_0x11edc3[_0x20b6('0x39')]['fields']));_0x186190[_0x20b6('0x3a')]=_0x186190[_0x20b6('0x3a')][_0x20b6('0x49')]?_0x186190['attributes']:_0x167eab[_0x20b6('0x36')];if(_0x11edc3[_0x20b6('0x39')][_0x20b6('0x4a')]){_0x186190[_0x20b6('0x4b')]=[{'all':!![]}];}_0x186190=_[_0x20b6('0x42')]({},_0x186190,_0x11edc3['options']);return db[_0x20b6('0x33')][_0x20b6('0x4c')](_0x186190)[_0x20b6('0x29')](handleEntityNotFound(_0x9d7ae3,null))[_0x20b6('0x29')](respondWithResult(_0x9d7ae3,null))['catch'](handleError(_0x9d7ae3,null));};exports['create']=function(_0xbbf120,_0x35f5fe){return db[_0x20b6('0x33')]['create'](_0xbbf120[_0x20b6('0x4d')],{})[_0x20b6('0x29')](function(_0x5f10c9){var _0x1b07f4=_0xbbf120[_0x20b6('0x4e')][_0x20b6('0x2b')]({'plain':!![]});if(!_0x1b07f4)throw new Error(_0x20b6('0x4f'));if(_0x1b07f4[_0x20b6('0x50')]===_0x20b6('0x4e')){var _0x2db38c=_0x5f10c9['get']({'plain':!![]});var _0x6ca01f=_0x20b6('0x2c');return db['UserProfileSection'][_0x20b6('0x4c')]({'where':{'name':_0x6ca01f,'userProfileId':_0x1b07f4[_0x20b6('0x51')]},'raw':!![]})['then'](function(_0x3d84d4){if(_0x3d84d4&&_0x3d84d4[_0x20b6('0x52')]===0x0){return db['UserProfileResource'][_0x20b6('0x53')]({'name':_0x2db38c[_0x20b6('0x2f')],'resourceId':_0x2db38c['id'],'type':_0x3d84d4[_0x20b6('0x2f')],'sectionId':_0x3d84d4['id']},{})[_0x20b6('0x29')](function(){return _0x5f10c9;});}else{return _0x5f10c9;}})['catch'](function(_0x46e375){logger[_0x20b6('0x2d')](_0x20b6('0x54'),_0x46e375);throw _0x46e375;});}return _0x5f10c9;})[_0x20b6('0x29')](respondWithResult(_0x35f5fe,0xc9))[_0x20b6('0x46')](handleError(_0x35f5fe,null));};exports[_0x20b6('0x28')]=function(_0x301a01,_0xc5b77f){if(_0x301a01[_0x20b6('0x4d')]['id']){delete _0x301a01[_0x20b6('0x4d')]['id'];}return db['Disposition']['find']({'where':{'id':_0x301a01[_0x20b6('0x55')]['id']}})[_0x20b6('0x29')](handleEntityNotFound(_0xc5b77f,null))[_0x20b6('0x29')](saveUpdates(_0x301a01['body'],null))['then'](respondWithResult(_0xc5b77f,null))['catch'](handleError(_0xc5b77f,null));};exports[_0x20b6('0x2a')]=function(_0x543901,_0x1e7864){return db['Disposition']['find']({'where':{'id':_0x543901[_0x20b6('0x55')]['id']}})['then'](handleEntityNotFound(_0x1e7864,null))['then'](removeEntity(_0x1e7864,null))[_0x20b6('0x46')](handleError(_0x1e7864,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 88f7302..7a3c049 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 _0xf2d3=['SmsAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./disposition.attributes','Disposition','name','ListId','name_chat','ChatWebsiteId','name_mail','MailAccountId','name_sms'];(function(_0x41e226,_0x5b6d61){var _0x87089d=function(_0x596f57){while(--_0x596f57){_0x41e226['push'](_0x41e226['shift']());}};_0x87089d(++_0x5b6d61);}(_0xf2d3,0x175));var _0x3f2d=function(_0x340031,_0x168157){_0x340031=_0x340031-0x0;var _0x133239=_0xf2d3[_0x340031];return _0x133239;};'use strict';var _=require('lodash');var util=require(_0x3f2d('0x0'));var logger=require(_0x3f2d('0x1'))(_0x3f2d('0x2'));var moment=require(_0x3f2d('0x3'));var BPromise=require(_0x3f2d('0x4'));var rp=require(_0x3f2d('0x5'));var fs=require('fs');var path=require(_0x3f2d('0x6'));var rimraf=require(_0x3f2d('0x7'));var config=require(_0x3f2d('0x8'));var attributes=require(_0x3f2d('0x9'));module['exports']=function(_0x5c7e3e,_0x242f0f){return _0x5c7e3e['define'](_0x3f2d('0xa'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':[_0x3f2d('0xb'),_0x3f2d('0xc')]},{'unique':!![],'name':_0x3f2d('0xd'),'fields':['name',_0x3f2d('0xe')]},{'unique':!![],'name':_0x3f2d('0xf'),'fields':[_0x3f2d('0xb'),_0x3f2d('0x10')]},{'unique':!![],'name':_0x3f2d('0x11'),'fields':['name',_0x3f2d('0x12')]},{'unique':!![],'name':_0x3f2d('0x13'),'fields':[_0x3f2d('0xb'),_0x3f2d('0x14')]},{'unique':!![],'name':_0x3f2d('0x15'),'fields':[_0x3f2d('0xb'),_0x3f2d('0x16')]},{'unique':!![],'name':'name_whatsapp','fields':[_0x3f2d('0xb'),'WhatsappAccountId']}],'timestamps':!![]});}; \ No newline at end of file +var _0xd2cc=['name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./disposition.attributes','exports','define','tools_dispositions','ListId','name_chat','name','ChatWebsiteId','name_mail','MailAccountId','SmsAccountId','FaxAccountId'];(function(_0x1e888a,_0x34d602){var _0x52db7c=function(_0x537a08){while(--_0x537a08){_0x1e888a['push'](_0x1e888a['shift']());}};_0x52db7c(++_0x34d602);}(_0xd2cc,0x154));var _0xcd2c=function(_0x5487cb,_0x8f6af0){_0x5487cb=_0x5487cb-0x0;var _0x19012f=_0xd2cc[_0x5487cb];return _0x19012f;};'use strict';var _=require(_0xcd2c('0x0'));var util=require(_0xcd2c('0x1'));var logger=require(_0xcd2c('0x2'))(_0xcd2c('0x3'));var moment=require('moment');var BPromise=require(_0xcd2c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcd2c('0x5'));var rimraf=require(_0xcd2c('0x6'));var config=require(_0xcd2c('0x7'));var attributes=require(_0xcd2c('0x8'));module[_0xcd2c('0x9')]=function(_0x1064b2,_0x1f6bfd){return _0x1064b2[_0xcd2c('0xa')]('Disposition',attributes,{'tableName':_0xcd2c('0xb'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':['name',_0xcd2c('0xc')]},{'unique':!![],'name':_0xcd2c('0xd'),'fields':[_0xcd2c('0xe'),_0xcd2c('0xf')]},{'unique':!![],'name':_0xcd2c('0x10'),'fields':[_0xcd2c('0xe'),_0xcd2c('0x11')]},{'unique':!![],'name':'name_sms','fields':[_0xcd2c('0xe'),_0xcd2c('0x12')]},{'unique':!![],'name':'name_fax','fields':[_0xcd2c('0xe'),_0xcd2c('0x13')]},{'unique':!![],'name':_0xcd2c('0x14'),'fields':[_0xcd2c('0xe'),_0xcd2c('0x15')]},{'unique':!![],'name':_0xcd2c('0x16'),'fields':[_0xcd2c('0xe'),_0xcd2c('0x17')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 60ceaaa..407a63f 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(_0x3f1811,_0x3d3aa4){var _0xc0ceb9=function(_0x30689a){while(--_0x30689a){_0x3f1811['push'](_0x3f1811['shift']());}};_0xc0ceb9(++_0x3d3aa4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'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(_0xdd6a1e,_0x1ea4bf){var _0x168957=function(_0x211b95){while(--_0x211b95){_0xdd6a1e['push'](_0xdd6a1e['shift']());}};_0x168957(++_0x1ea4bf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'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 dbec379..efd68bf 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 _0xc0f3=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','isAuthenticated','index','get','show','post','create','/:id','delete','destroy','multer','util','connect-timeout'];(function(_0x10e33e,_0x1f96f1){var _0xf9adfe=function(_0x24d4c2){while(--_0x24d4c2){_0x10e33e['push'](_0x10e33e['shift']());}};_0xf9adfe(++_0x1f96f1);}(_0xc0f3,0x177));var _0x3c0f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc0f3[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x3c0f('0x0'));var util=require(_0x3c0f('0x1'));var path=require('path');var timeout=require(_0x3c0f('0x2'));var express=require(_0x3c0f('0x3'));var router=express[_0x3c0f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3c0f('0x5'));var interaction=require(_0x3c0f('0x6'));var config=require(_0x3c0f('0x7'));var controller=require(_0x3c0f('0x8'));router['get']('/',auth[_0x3c0f('0x9')](),controller[_0x3c0f('0xa')]);router[_0x3c0f('0xb')]('/:id',auth[_0x3c0f('0x9')](),controller[_0x3c0f('0xc')]);router[_0x3c0f('0xd')]('/',auth['isAuthenticated'](),controller[_0x3c0f('0xe')]);router['put'](_0x3c0f('0xf'),auth[_0x3c0f('0x9')](),controller['update']);router[_0x3c0f('0x10')](_0x3c0f('0xf'),auth[_0x3c0f('0x9')](),controller[_0x3c0f('0x11')]);module['exports']=router; \ No newline at end of file +var _0xb44f=['delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','index','/:id','isAuthenticated','show','post','create','put','update'];(function(_0x3c734e,_0x73b6d7){var _0x10a609=function(_0x276585){while(--_0x276585){_0x3c734e['push'](_0x3c734e['shift']());}};_0x10a609(++_0x73b6d7);}(_0xb44f,0x1e7));var _0xfb44=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb44f[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xfb44('0x0'));var util=require(_0xfb44('0x1'));var path=require(_0xfb44('0x2'));var timeout=require(_0xfb44('0x3'));var express=require('express');var router=express[_0xfb44('0x4')]();var fs_extra=require(_0xfb44('0x5'));var auth=require(_0xfb44('0x6'));var interaction=require(_0xfb44('0x7'));var config=require(_0xfb44('0x8'));var controller=require(_0xfb44('0x9'));router[_0xfb44('0xa')]('/',auth['isAuthenticated'](),controller[_0xfb44('0xb')]);router[_0xfb44('0xa')](_0xfb44('0xc'),auth[_0xfb44('0xd')](),controller[_0xfb44('0xe')]);router[_0xfb44('0xf')]('/',auth[_0xfb44('0xd')](),controller[_0xfb44('0x10')]);router[_0xfb44('0x11')](_0xfb44('0xc'),auth[_0xfb44('0xd')](),controller[_0xfb44('0x12')]);router[_0xfb44('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xfb44('0x14')]);module[_0xfb44('0x15')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 4025813..f5ecb4f 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 _0x5225=['IAX','DADHI','KHOMP','TEXT','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','mandatoryDisposition','sequelize','STRING','ENUM','xCALLY\x20Motion\x20Fax','localstationid','2400','4800','7200','14400','9600','12000','v17,v27,v29','INTEGER','SIP'];(function(_0x55358b,_0x14b858){var _0x5226de=function(_0x4a19f7){while(--_0x4a19f7){_0x55358b['push'](_0x55358b['shift']());}};_0x5226de(++_0x14b858);}(_0x5225,0x19b));var _0x5522=function(_0x2cf683,_0x3213de){_0x2cf683=_0x2cf683-0x0;var _0x5cddff=_0x5225[_0x2cf683];return _0x5cddff;};'use strict';var Sequelize=require(_0x5522('0x0'));module['exports']={'name':{'type':Sequelize[_0x5522('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize[_0x5522('0x2')]('yes','no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0x5522('0x1')],'defaultValue':_0x5522('0x3')},'localstationid':{'type':Sequelize[_0x5522('0x1')],'unique':_0x5522('0x4')},'minrate':{'type':Sequelize[_0x5522('0x2')](_0x5522('0x5'),_0x5522('0x6'),_0x5522('0x7'),'9600','12000',_0x5522('0x8')),'defaultValue':_0x5522('0x6')},'maxrate':{'type':Sequelize['ENUM'](_0x5522('0x5'),'4800',_0x5522('0x7'),_0x5522('0x9'),_0x5522('0xa'),'14400'),'defaultValue':_0x5522('0x8')},'modem':{'type':Sequelize['STRING'],'defaultValue':_0x5522('0xb')},'gateway':{'type':Sequelize[_0x5522('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x5522('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x5522('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0x5522('0xd'),_0x5522('0xe'),_0x5522('0xf'),_0x5522('0x10')),'defaultValue':_0x5522('0xd')},'key':{'type':Sequelize[_0x5522('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x5522('0x11')],'defaultValue':function(){return _0x5522('0x12');}},'notificationSound':{'type':Sequelize[_0x5522('0x13')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x5522('0x13')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x5522('0x13')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5522('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5522('0x13')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5522('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5522('0xc')],'allowNull':!![],'defaultValue':null,'comment':_0x5522('0x14')},'mandatoryDisposition':{'type':Sequelize[_0x5522('0x13')],'defaultValue':![],'comment':_0x5522('0x15'),'set':function(_0x4b67bc){if(!_0x4b67bc)this[_0x5522('0x16')](_0x5522('0x17'),null);this['setDataValue'](_0x5522('0x18'),_0x4b67bc);}}}; \ No newline at end of file +var _0x5df6=['14400','2400','12000','v17,v27,v29','IAX','DADHI','KHOMP','SIP','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','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','ENUM','localstationid','4800','7200','9600'];(function(_0x2f6014,_0x5c65b7){var _0x21453a=function(_0x4e09c6){while(--_0x4e09c6){_0x2f6014['push'](_0x2f6014['shift']());}};_0x21453a(++_0x5c65b7);}(_0x5df6,0x156));var _0x65df=function(_0x19cd62,_0x2f033b){_0x19cd62=_0x19cd62-0x0;var _0x2e57c0=_0x5df6[_0x19cd62];return _0x2e57c0;};'use strict';var Sequelize=require(_0x65df('0x0'));module[_0x65df('0x1')]={'name':{'type':Sequelize[_0x65df('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x65df('0x2')]},'ecm':{'type':Sequelize[_0x65df('0x3')]('yes','no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0x65df('0x2')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0x65df('0x2')],'unique':_0x65df('0x4')},'minrate':{'type':Sequelize[_0x65df('0x3')]('2400',_0x65df('0x5'),_0x65df('0x6'),_0x65df('0x7'),'12000',_0x65df('0x8')),'defaultValue':_0x65df('0x5')},'maxrate':{'type':Sequelize[_0x65df('0x3')](_0x65df('0x9'),_0x65df('0x5'),_0x65df('0x6'),_0x65df('0x7'),_0x65df('0xa'),'14400'),'defaultValue':_0x65df('0x8')},'modem':{'type':Sequelize['STRING'],'defaultValue':_0x65df('0xb')},'gateway':{'type':Sequelize[_0x65df('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x65df('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x65df('0x3')]('SIP',_0x65df('0xc'),_0x65df('0xd'),_0x65df('0xe')),'defaultValue':_0x65df('0xf')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x65df('0x10')],'defaultValue':function(){return _0x65df('0x11');}},'notificationSound':{'type':Sequelize[_0x65df('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x65df('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x65df('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x65df('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x65df('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x65df('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x65df('0x13')],'allowNull':!![],'defaultValue':null,'comment':_0x65df('0x14')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x65df('0x15'),'set':function(_0x23ed7c){if(!_0x23ed7c)this[_0x65df('0x16')](_0x65df('0x17'),null);this[_0x65df('0x16')](_0x65df('0x18'),_0x23ed7c);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index f14ac79..a1af555 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 _0x5937=['reject','save','update','destroy','get','FaxAccounts','sendStatus','stack','name','send','mandatoryDispositionPause','map','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','FaxAccount','includeAll','include','rows','show','params','Pause','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','describe','addDisposition','FaxAccountId','Disposition','getDispositions','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','FaxInteraction','addInteraction','omit','getInteractions','findOne','CmContact','Contact','fullname','internal','Tag','color','tag','findAll','addApplications','transaction','FaxApplication','bulkCreate','findAndCountAll','getApplications','context','from-voip-provider','exten','app','description','Fax\x20Extension','appdata','Answer','push','CDR(type)=inbound-fax','ecm','localstationid','gateway','faxdetect','headerinfo','maxrate','minrate','modem','t38timeout','FAXOPT(','Set','Wait','ReceiveFax','addAccountApplications','sequelize','VoiceExtension','updateAccountApplications','tech','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','format','CmList','List','Contacts','DESC','attachments','join','server/files/attachments','basename','CheckAfterSend','isNil','path','from','\x22%s\x22\x20<%s>','fax','defaults','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Contact\x20not\x20found','spread','ContactId','dataValues','Messages','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','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','redis','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','status','end','json','offset','undefined','count','limit','set','Content-Range','apply'];(function(_0x21e119,_0x3e2c9c){var _0x27a6b1=function(_0x1c2222){while(--_0x1c2222){_0x21e119['push'](_0x21e119['shift']());}};_0x27a6b1(++_0x3e2c9c);}(_0x5937,0x163));var _0x7593=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x5937[_0x4a9fb1];return _0x348672;};'use strict';var emlformat=require(_0x7593('0x0'));var rimraf=require(_0x7593('0x1'));var zipdir=require(_0x7593('0x2'));var jsonpatch=require(_0x7593('0x3'));var rp=require(_0x7593('0x4'));var moment=require('moment');var BPromise=require(_0x7593('0x5'));var Mustache=require('mustache');var util=require(_0x7593('0x6'));var path=require('path');var sox=require(_0x7593('0x7'));var csv=require(_0x7593('0x8'));var ejs=require(_0x7593('0x9'));var fs=require('fs');var fs_extra=require(_0x7593('0xa'));var _=require('lodash');var squel=require(_0x7593('0xb'));var crypto=require(_0x7593('0xc'));var jsforce=require(_0x7593('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7593('0xe'));var Papa=require(_0x7593('0xf'));var Redis=require(_0x7593('0x10'));var authService=require(_0x7593('0x11'));var qs=require(_0x7593('0x12'));var as=require(_0x7593('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7593('0x14'))(_0x7593('0x15'));var utils=require(_0x7593('0x16'));var config=require(_0x7593('0x17'));var licenseUtil=require(_0x7593('0x18'));var db=require(_0x7593('0x19'))['db'];config[_0x7593('0x1a')]=_['defaults'](config[_0x7593('0x1a')],{'host':_0x7593('0x1b'),'port':0x18eb});var socket=require(_0x7593('0x1c'))(new Redis(config[_0x7593('0x1a')]));require(_0x7593('0x1d'))[_0x7593('0x1e')](socket);var jayson=require(_0x7593('0x1f'));var client=jayson[_0x7593('0x20')][_0x7593('0x21')]({'port':0x232c});var client9002=jayson['client'][_0x7593('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x4961b3,_0x1fb8d2,_0x4ba31e,_0x3ce54a){return new BPromise(function(_0x24ecf5,_0x1f6d17){var _0x260752=_0x3ce54a||client;return _0x260752['request'](_0x4961b3,_0x4ba31e)[_0x7593('0x22')](function(_0x3eb169){logger[_0x7593('0x23')](_0x7593('0x24'),_0x1fb8d2,_0x7593('0x25'));logger[_0x7593('0x26')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x1fb8d2,'request\x20sent',JSON[_0x7593('0x27')](_0x3eb169));if(_0x3eb169[_0x7593('0x28')]){if(_0x3eb169['error'][_0x7593('0x29')]===0x1f4){logger['error'](_0x7593('0x24'),_0x1fb8d2,_0x3eb169[_0x7593('0x28')]['message']);return _0x1f6d17(_0x3eb169['error'][_0x7593('0x2a')]);}logger[_0x7593('0x28')]('FaxAccount,\x20%s,\x20%s',_0x1fb8d2,_0x3eb169['error'][_0x7593('0x2a')]);return _0x24ecf5(_0x3eb169['error'][_0x7593('0x2a')]);}else{logger['info'](_0x7593('0x24'),_0x1fb8d2,_0x7593('0x25'));_0x24ecf5(_0x3eb169[_0x7593('0x2b')][_0x7593('0x2a')]);}})[_0x7593('0x2c')](function(_0x540ba1){logger[_0x7593('0x28')](_0x7593('0x24'),_0x1fb8d2,_0x540ba1);_0x1f6d17(_0x540ba1);});});}function respondWithStatusCode(_0x2c4333,_0x3c9173){_0x3c9173=_0x3c9173||0xcc;return function(_0x1adeae){if(_0x1adeae){return _0x2c4333['sendStatus'](_0x3c9173);}return _0x2c4333[_0x7593('0x2d')](_0x3c9173)[_0x7593('0x2e')]();};}function respondWithResult(_0x1b26d4,_0x2157d1){_0x2157d1=_0x2157d1||0xc8;return function(_0x251759){if(_0x251759){return _0x1b26d4[_0x7593('0x2d')](_0x2157d1)[_0x7593('0x2f')](_0x251759);}};}function respondWithFilteredResult(_0x3f78cb,_0x5192dd){return function(_0x258e2a){if(_0x258e2a){var _0x37e27b=typeof _0x5192dd[_0x7593('0x30')]==='undefined'&&typeof _0x5192dd['limit']===_0x7593('0x31');var _0x288bc1=_0x258e2a[_0x7593('0x32')];var _0x160e55=_0x37e27b?0x0:_0x5192dd[_0x7593('0x30')];var _0x5d270b=_0x37e27b?_0x258e2a['count']:_0x5192dd[_0x7593('0x30')]+_0x5192dd[_0x7593('0x33')];var _0x5e34bd;if(_0x5d270b>=_0x288bc1){_0x5d270b=_0x288bc1;_0x5e34bd=0xc8;}else{_0x5e34bd=0xce;}_0x3f78cb[_0x7593('0x2d')](_0x5e34bd);return _0x3f78cb[_0x7593('0x34')](_0x7593('0x35'),_0x160e55+'-'+_0x5d270b+'/'+_0x288bc1)['json'](_0x258e2a);}return null;};}function patchUpdates(_0x1e4ccf){return function(_0x53aaf2){try{jsonpatch[_0x7593('0x36')](_0x53aaf2,_0x1e4ccf,!![]);}catch(_0x40d50b){return BPromise[_0x7593('0x37')](_0x40d50b);}return _0x53aaf2[_0x7593('0x38')]();};}function saveUpdates(_0x170f78,_0x2e24d8){return function(_0x25ac1b){if(_0x25ac1b){return _0x25ac1b[_0x7593('0x39')](_0x170f78)[_0x7593('0x22')](function(_0x3d3a3c){return _0x3d3a3c;});}return null;};}function removeEntity(_0x1bb1f8,_0x15a883){return function(_0x500186){if(_0x500186){return _0x500186[_0x7593('0x3a')]()[_0x7593('0x22')](function(){var _0x353bd8=_0x500186[_0x7593('0x3b')]({'plain':!![]});var _0x2f2f2e=_0x7593('0x3c');return db['UserProfileResource'][_0x7593('0x3a')]({'where':{'type':_0x2f2f2e,'resourceId':_0x353bd8['id']}})[_0x7593('0x22')](function(){return _0x500186;});})[_0x7593('0x22')](function(){_0x1bb1f8[_0x7593('0x2d')](0xcc)[_0x7593('0x2e')]();});}};}function handleEntityNotFound(_0x542591,_0x4819bc){return function(_0x2f5218){if(!_0x2f5218){_0x542591[_0x7593('0x3d')](0x194);}return _0x2f5218;};}function handleError(_0x2cfe0f,_0x37f109){_0x37f109=_0x37f109||0x1f4;return function(_0x41ab76){logger['error'](_0x41ab76[_0x7593('0x3e')]);if(_0x41ab76[_0x7593('0x3f')]){delete _0x41ab76[_0x7593('0x3f')];}_0x2cfe0f[_0x7593('0x2d')](_0x37f109)[_0x7593('0x40')](_0x41ab76);};}exports['index']=function(_0x41b6a0,_0x50aa08){var _0x260ffe={'include':[{'model':db['Pause'],'as':_0x7593('0x41')}]},_0x1d0db6={},_0x32dbc4={'count':0x0,'rows':[]};var _0x5250f0=_[_0x7593('0x42')](db['FaxAccount'][_0x7593('0x43')],function(_0x402991){return{'name':_0x402991['fieldName'],'type':_0x402991[_0x7593('0x44')][_0x7593('0x45')]};});_0x1d0db6[_0x7593('0x46')]=_[_0x7593('0x42')](_0x5250f0,'name');_0x1d0db6[_0x7593('0x47')]=_[_0x7593('0x48')](_0x41b6a0['query']);_0x1d0db6[_0x7593('0x49')]=_[_0x7593('0x4a')](_0x1d0db6['model'],_0x1d0db6[_0x7593('0x47')]);_0x260ffe['attributes']=_[_0x7593('0x4a')](_0x1d0db6['model'],qs[_0x7593('0x4b')](_0x41b6a0['query'][_0x7593('0x4b')]));_0x260ffe[_0x7593('0x4c')]=_0x260ffe[_0x7593('0x4c')][_0x7593('0x4d')]?_0x260ffe[_0x7593('0x4c')]:_0x1d0db6[_0x7593('0x46')];if(!_0x41b6a0[_0x7593('0x47')][_0x7593('0x4e')](_0x7593('0x4f'))){_0x260ffe['limit']=qs[_0x7593('0x33')](_0x41b6a0['query']['limit']);_0x260ffe[_0x7593('0x30')]=qs[_0x7593('0x30')](_0x41b6a0['query'][_0x7593('0x30')]);}_0x260ffe[_0x7593('0x50')]=qs[_0x7593('0x51')](_0x41b6a0[_0x7593('0x47')][_0x7593('0x51')]);_0x260ffe[_0x7593('0x52')]=qs[_0x7593('0x49')](_[_0x7593('0x53')](_0x41b6a0[_0x7593('0x47')],_0x1d0db6[_0x7593('0x49')]),_0x5250f0);if(_0x41b6a0[_0x7593('0x47')][_0x7593('0x54')]){_0x260ffe[_0x7593('0x52')]=_[_0x7593('0x55')](_0x260ffe[_0x7593('0x52')],{'$or':_[_0x7593('0x42')](_0x5250f0,function(_0x9dbdbf){if(_0x9dbdbf['type']!==_0x7593('0x56')){var _0x842719={};_0x842719[_0x9dbdbf[_0x7593('0x3f')]]={'$like':'%'+_0x41b6a0['query'][_0x7593('0x54')]+'%'};return _0x842719;}})});}_0x260ffe=_[_0x7593('0x55')]({},_0x260ffe,_0x41b6a0[_0x7593('0x57')]);var _0x3ddca6={'where':_0x260ffe[_0x7593('0x52')]};return db[_0x7593('0x58')][_0x7593('0x32')](_0x3ddca6)['then'](function(_0x4f33af){_0x32dbc4[_0x7593('0x32')]=_0x4f33af;if(_0x41b6a0[_0x7593('0x47')][_0x7593('0x59')]){_0x260ffe[_0x7593('0x5a')]=[{'all':!![]}];}return db[_0x7593('0x58')]['findAll'](_0x260ffe);})[_0x7593('0x22')](function(_0x191138){_0x32dbc4[_0x7593('0x5b')]=_0x191138;return _0x32dbc4;})[_0x7593('0x22')](respondWithFilteredResult(_0x50aa08,_0x260ffe))[_0x7593('0x2c')](handleError(_0x50aa08,null));};exports[_0x7593('0x5c')]=function(_0xffe6d6,_0x3719a0){var _0x168722={'raw':![],'where':{'id':_0xffe6d6[_0x7593('0x5d')]['id']},'include':[{'model':db[_0x7593('0x5e')],'as':_0x7593('0x41')}]},_0x305746={};_0x305746['model']=_[_0x7593('0x48')](db['FaxAccount'][_0x7593('0x43')]);_0x305746[_0x7593('0x47')]=_[_0x7593('0x48')](_0xffe6d6[_0x7593('0x47')]);_0x305746[_0x7593('0x49')]=_[_0x7593('0x4a')](_0x305746[_0x7593('0x46')],_0x305746[_0x7593('0x47')]);_0x168722[_0x7593('0x4c')]=_[_0x7593('0x4a')](_0x305746[_0x7593('0x46')],qs['fields'](_0xffe6d6[_0x7593('0x47')][_0x7593('0x4b')]));_0x168722['attributes']=_0x168722[_0x7593('0x4c')]['length']?_0x168722[_0x7593('0x4c')]:_0x305746[_0x7593('0x46')];if(_0xffe6d6[_0x7593('0x47')][_0x7593('0x59')]){_0x168722[_0x7593('0x5a')]=[{'all':!![]}];}_0x168722=_['merge']({},_0x168722,_0xffe6d6['options']);return db[_0x7593('0x58')][_0x7593('0x5f')](_0x168722)['then'](handleEntityNotFound(_0x3719a0,null))[_0x7593('0x22')](respondWithResult(_0x3719a0,null))[_0x7593('0x2c')](handleError(_0x3719a0,null));};exports[_0x7593('0x60')]=function(_0x2822ea,_0x128621){return db['FaxAccount'][_0x7593('0x60')](_0x2822ea[_0x7593('0x61')],{})[_0x7593('0x22')](function(_0xcafd18){var _0xf2335=_0x2822ea[_0x7593('0x62')][_0x7593('0x3b')]({'plain':!![]});if(!_0xf2335)throw new Error(_0x7593('0x63'));if(_0xf2335[_0x7593('0x64')]===_0x7593('0x62')){var _0x286ef8=_0xcafd18[_0x7593('0x3b')]({'plain':!![]});var _0x19fd6c=_0x7593('0x3c');return db[_0x7593('0x65')][_0x7593('0x5f')]({'where':{'name':_0x19fd6c,'userProfileId':_0xf2335[_0x7593('0x66')]},'raw':!![]})['then'](function(_0x2a06f5){if(_0x2a06f5&&_0x2a06f5[_0x7593('0x67')]===0x0){return db[_0x7593('0x68')]['create']({'name':_0x286ef8[_0x7593('0x3f')],'resourceId':_0x286ef8['id'],'type':_0x2a06f5[_0x7593('0x3f')],'sectionId':_0x2a06f5['id']},{})[_0x7593('0x22')](function(){return _0xcafd18;});}else{return _0xcafd18;}})[_0x7593('0x2c')](function(_0x15f516){logger[_0x7593('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x15f516);throw _0x15f516;});}return _0xcafd18;})[_0x7593('0x22')](respondWithResult(_0x128621,0xc9))[_0x7593('0x2c')](handleError(_0x128621,null));};exports[_0x7593('0x39')]=function(_0x1d5651,_0x3ff7bb){if(_0x1d5651['body']['id']){delete _0x1d5651[_0x7593('0x61')]['id'];}return db[_0x7593('0x58')][_0x7593('0x5f')]({'where':{'id':_0x1d5651[_0x7593('0x5d')]['id']},'include':[{'model':db[_0x7593('0x5e')],'as':_0x7593('0x41')}]})[_0x7593('0x22')](handleEntityNotFound(_0x3ff7bb,null))[_0x7593('0x22')](saveUpdates(_0x1d5651[_0x7593('0x61')],null))[_0x7593('0x22')](respondWithResult(_0x3ff7bb,null))[_0x7593('0x2c')](handleError(_0x3ff7bb,null));};exports[_0x7593('0x3a')]=function(_0x960b5,_0x4df170){return db[_0x7593('0x58')][_0x7593('0x5f')]({'where':{'id':_0x960b5[_0x7593('0x5d')]['id']}})['then'](handleEntityNotFound(_0x4df170,null))[_0x7593('0x22')](removeEntity(_0x4df170,null))['catch'](handleError(_0x4df170,null));};exports[_0x7593('0x69')]=function(_0x387079,_0x4fa2a6){return db[_0x7593('0x58')][_0x7593('0x69')]()[_0x7593('0x22')](respondWithResult(_0x4fa2a6,null))[_0x7593('0x2c')](handleError(_0x4fa2a6,null));};exports[_0x7593('0x6a')]=function(_0x52e53c,_0x2e3b34,_0x1c14fd){if(_0x52e53c[_0x7593('0x61')]['id']){delete _0x52e53c[_0x7593('0x61')]['id'];}return db[_0x7593('0x58')]['find']({'where':{'id':_0x52e53c[_0x7593('0x5d')]['id']}})['then'](handleEntityNotFound(_0x2e3b34,null))[_0x7593('0x22')](function(_0x497067){if(_0x497067){_0x52e53c[_0x7593('0x61')][_0x7593('0x6b')]=_0x497067['id'];return db[_0x7593('0x6c')][_0x7593('0x60')](_0x52e53c['body']);}})[_0x7593('0x22')](respondWithResult(_0x2e3b34,null))[_0x7593('0x2c')](handleError(_0x2e3b34,null));};exports[_0x7593('0x6d')]=function(_0x4d65b9,_0x32cc46,_0x3d6ce7){var _0x590956={'raw':![],'where':{}};var _0x598efd={};var _0x134518={'count':0x0,'rows':[]};return db[_0x7593('0x58')]['findOne']({'where':{'id':_0x4d65b9[_0x7593('0x5d')]['id']}})['then'](handleEntityNotFound(_0x32cc46,null))[_0x7593('0x22')](function(_0xb5ceb3){if(_0xb5ceb3){_0x598efd[_0x7593('0x46')]=_[_0x7593('0x48')](db[_0x7593('0x6c')][_0x7593('0x43')]);_0x598efd['query']=_[_0x7593('0x48')](_0x4d65b9[_0x7593('0x47')]);_0x598efd[_0x7593('0x49')]=_[_0x7593('0x4a')](_0x598efd[_0x7593('0x46')],_0x598efd['query']);_0x590956[_0x7593('0x4c')]=_[_0x7593('0x4a')](_0x598efd[_0x7593('0x46')],qs[_0x7593('0x4b')](_0x4d65b9[_0x7593('0x47')]['fields']));_0x590956[_0x7593('0x4c')]=_0x590956[_0x7593('0x4c')][_0x7593('0x4d')]?_0x590956[_0x7593('0x4c')]:_0x598efd['model'];if(!_0x4d65b9[_0x7593('0x47')][_0x7593('0x4e')](_0x7593('0x4f'))){_0x590956[_0x7593('0x33')]=qs['limit'](_0x4d65b9[_0x7593('0x47')][_0x7593('0x33')]);_0x590956[_0x7593('0x30')]=qs[_0x7593('0x30')](_0x4d65b9['query'][_0x7593('0x30')]);}_0x590956['order']=qs[_0x7593('0x51')](_0x4d65b9[_0x7593('0x47')][_0x7593('0x51')]);_0x590956[_0x7593('0x52')]=qs['filters'](_['pick'](_0x4d65b9[_0x7593('0x47')],_0x598efd[_0x7593('0x49')]));_0x590956[_0x7593('0x52')][_0x7593('0x6b')]=_0xb5ceb3['id'];if(_0x4d65b9[_0x7593('0x47')][_0x7593('0x54')]){_0x590956['where']=_[_0x7593('0x55')](_0x590956[_0x7593('0x52')],{'$or':_[_0x7593('0x42')](_0x590956[_0x7593('0x4c')],function(_0x20e387){var _0x7126b3={};_0x7126b3[_0x20e387]={'$like':'%'+_0x4d65b9[_0x7593('0x47')][_0x7593('0x54')]+'%'};return _0x7126b3;})});}_0x590956=_['merge']({},_0x590956,_0x4d65b9[_0x7593('0x57')]);return db['Disposition'][_0x7593('0x32')]({'where':_0x590956[_0x7593('0x52')]})[_0x7593('0x22')](function(_0xda3630){_0x134518[_0x7593('0x32')]=_0xda3630;if(_0x4d65b9[_0x7593('0x47')][_0x7593('0x59')]){_0x590956['include']=[{'all':!![]}];}return db['Disposition']['findAll'](_0x590956);})['then'](function(_0x40b609){_0x134518[_0x7593('0x5b')]=_0x40b609;return _0x134518;});}})[_0x7593('0x22')](respondWithFilteredResult(_0x32cc46,_0x590956))[_0x7593('0x2c')](handleError(_0x32cc46,null));};exports[_0x7593('0x6e')]=function(_0x8f7bcc,_0x2a5fe6,_0x2b7f48){return db['FaxAccount'][_0x7593('0x5f')]({'where':{'id':_0x8f7bcc[_0x7593('0x5d')]['id']}})['then'](handleEntityNotFound(_0x2a5fe6,null))[_0x7593('0x22')](function(_0x5431bf){if(_0x5431bf){return _0x5431bf[_0x7593('0x6e')](_0x8f7bcc['query']['ids']);}})[_0x7593('0x22')](respondWithStatusCode(_0x2a5fe6,null))[_0x7593('0x2c')](handleError(_0x2a5fe6,null));};exports[_0x7593('0x6f')]=function(_0x67f69,_0x1c31ea,_0xe67cc2){if(_0x67f69[_0x7593('0x61')]['id']){delete _0x67f69[_0x7593('0x61')]['id'];}return db[_0x7593('0x58')][_0x7593('0x5f')]({'where':{'id':_0x67f69[_0x7593('0x5d')]['id']}})[_0x7593('0x22')](handleEntityNotFound(_0x1c31ea,null))[_0x7593('0x22')](function(_0x2fe28d){if(_0x2fe28d){_0x67f69['body'][_0x7593('0x6b')]=_0x2fe28d['id'];return db[_0x7593('0x70')][_0x7593('0x60')](_0x67f69[_0x7593('0x61')]);}})['then'](respondWithResult(_0x1c31ea,null))['catch'](handleError(_0x1c31ea,null));};exports[_0x7593('0x71')]=function(_0x5acd5a,_0x4d2c07,_0x2658d8){var _0x42b806={'raw':![],'where':{}};var _0xdda214={};var _0xfd5579={'count':0x0,'rows':[]};return db[_0x7593('0x58')]['findOne']({'where':{'id':_0x5acd5a['params']['id']}})[_0x7593('0x22')](handleEntityNotFound(_0x4d2c07,null))[_0x7593('0x22')](function(_0x2ca6f1){if(_0x2ca6f1){_0xdda214[_0x7593('0x46')]=_[_0x7593('0x48')](db['CannedAnswer'][_0x7593('0x43')]);_0xdda214[_0x7593('0x47')]=_[_0x7593('0x48')](_0x5acd5a[_0x7593('0x47')]);_0xdda214[_0x7593('0x49')]=_['intersection'](_0xdda214[_0x7593('0x46')],_0xdda214[_0x7593('0x47')]);_0x42b806[_0x7593('0x4c')]=_[_0x7593('0x4a')](_0xdda214[_0x7593('0x46')],qs[_0x7593('0x4b')](_0x5acd5a[_0x7593('0x47')][_0x7593('0x4b')]));_0x42b806[_0x7593('0x4c')]=_0x42b806[_0x7593('0x4c')][_0x7593('0x4d')]?_0x42b806[_0x7593('0x4c')]:_0xdda214['model'];if(!_0x5acd5a[_0x7593('0x47')][_0x7593('0x4e')](_0x7593('0x4f'))){_0x42b806[_0x7593('0x33')]=qs[_0x7593('0x33')](_0x5acd5a[_0x7593('0x47')][_0x7593('0x33')]);_0x42b806[_0x7593('0x30')]=qs['offset'](_0x5acd5a['query'][_0x7593('0x30')]);}_0x42b806[_0x7593('0x50')]=qs[_0x7593('0x51')](_0x5acd5a[_0x7593('0x47')][_0x7593('0x51')]);_0x42b806[_0x7593('0x52')]=qs[_0x7593('0x49')](_['pick'](_0x5acd5a[_0x7593('0x47')],_0xdda214['filters']));_0x42b806[_0x7593('0x52')][_0x7593('0x6b')]=_0x2ca6f1['id'];if(_0x5acd5a[_0x7593('0x47')][_0x7593('0x54')]){_0x42b806['where']=_[_0x7593('0x55')](_0x42b806[_0x7593('0x52')],{'$or':_['map'](_0x42b806['attributes'],function(_0x4dc55b){var _0x1f4ae9={};_0x1f4ae9[_0x4dc55b]={'$like':'%'+_0x5acd5a['query'][_0x7593('0x54')]+'%'};return _0x1f4ae9;})});}_0x42b806=_['merge']({},_0x42b806,_0x5acd5a['options']);return db[_0x7593('0x70')][_0x7593('0x32')]({'where':_0x42b806[_0x7593('0x52')]})['then'](function(_0x270b17){_0xfd5579['count']=_0x270b17;if(_0x5acd5a[_0x7593('0x47')][_0x7593('0x59')]){_0x42b806['include']=[{'all':!![]}];}return db[_0x7593('0x70')]['findAll'](_0x42b806);})['then'](function(_0x27285b){_0xfd5579[_0x7593('0x5b')]=_0x27285b;return _0xfd5579;});}})[_0x7593('0x22')](respondWithFilteredResult(_0x4d2c07,_0x42b806))[_0x7593('0x2c')](handleError(_0x4d2c07,null));};exports['removeAnswers']=function(_0x47f065,_0x1b8e89,_0x3841c6){return db[_0x7593('0x58')][_0x7593('0x5f')]({'where':{'id':_0x47f065[_0x7593('0x5d')]['id']}})['then'](handleEntityNotFound(_0x1b8e89,null))['then'](function(_0x25afaf){if(_0x25afaf){return _0x25afaf[_0x7593('0x72')](_0x47f065['query'][_0x7593('0x73')]);}})[_0x7593('0x22')](respondWithStatusCode(_0x1b8e89,null))[_0x7593('0x2c')](handleError(_0x1b8e89,null));};exports['addInteraction']=function(_0x52105f,_0x8c937,_0xe680){return db[_0x7593('0x74')][_0x7593('0x5f')]({'where':{'id':_0x52105f[_0x7593('0x5d')]['id']}})[_0x7593('0x22')](handleEntityNotFound(_0x8c937,null))[_0x7593('0x22')](function(_0x1752fd){if(_0x1752fd){return _0x1752fd[_0x7593('0x75')](_0x52105f['body'][_0x7593('0x73')],_[_0x7593('0x76')](_0x52105f[_0x7593('0x61')],[_0x7593('0x73'),'id'])||{});}})['then'](respondWithResult(_0x8c937,null))['catch'](handleError(_0x8c937,null));};exports[_0x7593('0x77')]=function(_0x52aadb,_0x3a35a2,_0x443998){var _0x4ac5a8={'raw':![],'where':{}};var _0x8c194a={};var _0x4062c1={'count':0x0,'rows':[]};return db[_0x7593('0x58')][_0x7593('0x78')]({'where':{'id':_0x52aadb[_0x7593('0x5d')]['id']}})[_0x7593('0x22')](handleEntityNotFound(_0x3a35a2,null))[_0x7593('0x22')](function(_0x37eace){if(_0x37eace){_0x8c194a['model']=_[_0x7593('0x48')](db[_0x7593('0x74')]['rawAttributes']);_0x8c194a[_0x7593('0x47')]=_['keys'](_0x52aadb[_0x7593('0x47')]);_0x8c194a[_0x7593('0x49')]=_['intersection'](_0x8c194a[_0x7593('0x46')],_0x8c194a['query']);_0x4ac5a8[_0x7593('0x4c')]=_[_0x7593('0x4a')](_0x8c194a[_0x7593('0x46')],qs['fields'](_0x52aadb[_0x7593('0x47')][_0x7593('0x4b')]));_0x4ac5a8['attributes']=_0x4ac5a8[_0x7593('0x4c')][_0x7593('0x4d')]?_0x4ac5a8['attributes']:_0x8c194a['model'];if(!_0x52aadb[_0x7593('0x47')][_0x7593('0x4e')](_0x7593('0x4f'))){_0x4ac5a8[_0x7593('0x33')]=qs[_0x7593('0x33')](_0x52aadb[_0x7593('0x47')][_0x7593('0x33')]);_0x4ac5a8['offset']=qs[_0x7593('0x30')](_0x52aadb[_0x7593('0x47')]['offset']);}_0x4ac5a8[_0x7593('0x50')]=qs[_0x7593('0x51')](_0x52aadb[_0x7593('0x47')][_0x7593('0x51')]);_0x4ac5a8[_0x7593('0x52')]=qs[_0x7593('0x49')](_[_0x7593('0x53')](_0x52aadb[_0x7593('0x47')],_0x8c194a[_0x7593('0x49')]));_0x4ac5a8[_0x7593('0x52')][_0x7593('0x6b')]=_0x37eace['id'];if(_0x52aadb['query']['filter']){_0x4ac5a8['where']=_[_0x7593('0x55')](_0x4ac5a8[_0x7593('0x52')],{'$or':_[_0x7593('0x42')](_0x4ac5a8[_0x7593('0x4c')],function(_0x4786c8){var _0x222f07={};_0x222f07[_0x4786c8]={'$like':'%'+_0x52aadb[_0x7593('0x47')][_0x7593('0x54')]+'%'};return _0x222f07;})});}_0x4ac5a8=_['merge']({},_0x4ac5a8,_0x52aadb[_0x7593('0x57')]);return db[_0x7593('0x74')][_0x7593('0x32')]({'where':_0x4ac5a8[_0x7593('0x52')]})[_0x7593('0x22')](function(_0x50338a){_0x4062c1[_0x7593('0x32')]=_0x50338a;if(_0x52aadb[_0x7593('0x47')][_0x7593('0x59')]){_0x4ac5a8[_0x7593('0x5a')]=[{'model':db[_0x7593('0x79')],'as':_0x7593('0x7a'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x7593('0x3f'),_0x7593('0x7b'),_0x7593('0x7c')],'required':![]},{'model':db[_0x7593('0x7d')],'as':'Tags','attributes':['id',_0x7593('0x3f'),_0x7593('0x7e')],'where':_0x52aadb['query']['tag']?{'id':_0x52aadb[_0x7593('0x47')][_0x7593('0x7f')]}:undefined,'required':_0x52aadb['query'][_0x7593('0x7f')]?!![]:![]}];}return db[_0x7593('0x74')][_0x7593('0x80')](_0x4ac5a8);})[_0x7593('0x22')](function(_0x2a54d1){_0x4062c1[_0x7593('0x5b')]=_0x2a54d1;return _0x4062c1;});}})[_0x7593('0x22')](respondWithFilteredResult(_0x3a35a2,_0x4ac5a8))[_0x7593('0x2c')](handleError(_0x3a35a2,null));};exports[_0x7593('0x81')]=function(_0x809b1f,_0x15f468,_0x55c136){return db[_0x7593('0x58')][_0x7593('0x78')]({'where':{'id':_0x809b1f[_0x7593('0x5d')]['id']}})[_0x7593('0x22')](handleEntityNotFound(_0x15f468,null))[_0x7593('0x22')](function(_0x25509c){if(_0x25509c){return db['sequelize'][_0x7593('0x82')](function(_0x2c911f){return db[_0x7593('0x83')][_0x7593('0x3a')]({'where':{'FaxAccountId':_0x809b1f['params']['id']},'transaction':_0x2c911f})['then'](function(_0x21cb04){var _0x18ba71=_[_0x7593('0x42')](_0x809b1f['body'],function(_0x2bab74){_0x2bab74[_0x7593('0x6b')]=_0x809b1f[_0x7593('0x5d')]['id'];return _0x2bab74;});return db[_0x7593('0x83')][_0x7593('0x84')](_0x18ba71,{'transaction':_0x2c911f});});})[_0x7593('0x22')](function(){return db['FaxApplication'][_0x7593('0x85')]({'where':{'FaxAccountId':_0x809b1f['params']['id']},'order':'priority'});});}})[_0x7593('0x22')](respondWithResult(_0x15f468,null))[_0x7593('0x2c')](handleError(_0x15f468,null));};exports[_0x7593('0x86')]=function(_0x5667ae,_0x143997,_0x30d75a){var _0x594422={};var _0x470946={};var _0x533452;var _0x51855f;return db['FaxAccount']['findOne']({'where':{'id':_0x5667ae['params']['id']}})[_0x7593('0x22')](handleEntityNotFound(_0x143997,null))[_0x7593('0x22')](function(_0x2d67e1){if(_0x2d67e1){_0x533452=_0x2d67e1;_0x470946[_0x7593('0x46')]=_[_0x7593('0x48')](db[_0x7593('0x83')][_0x7593('0x43')]);_0x470946[_0x7593('0x47')]=_[_0x7593('0x48')](_0x5667ae[_0x7593('0x47')]);_0x470946[_0x7593('0x49')]=_[_0x7593('0x4a')](_0x470946[_0x7593('0x46')],_0x470946[_0x7593('0x47')]);_0x594422[_0x7593('0x4c')]=_[_0x7593('0x4a')](_0x470946['model'],qs[_0x7593('0x4b')](_0x5667ae[_0x7593('0x47')][_0x7593('0x4b')]));_0x594422[_0x7593('0x4c')]=_0x594422[_0x7593('0x4c')]['length']?_0x594422[_0x7593('0x4c')]:_0x470946[_0x7593('0x46')];_0x594422['order']=qs[_0x7593('0x51')](_0x5667ae[_0x7593('0x47')][_0x7593('0x51')]);_0x594422[_0x7593('0x52')]=qs[_0x7593('0x49')](_[_0x7593('0x53')](_0x5667ae[_0x7593('0x47')],_0x470946[_0x7593('0x49')]));if(_0x5667ae[_0x7593('0x47')][_0x7593('0x54')]){_0x594422[_0x7593('0x52')]=_[_0x7593('0x55')](_0x594422['where'],{'$or':_['map'](_0x594422['attributes'],function(_0x423e6a){var _0x1211b4={};_0x1211b4[_0x423e6a]={'$like':'%'+_0x5667ae[_0x7593('0x47')][_0x7593('0x54')]+'%'};return _0x1211b4;})});}_0x594422=_[_0x7593('0x55')]({},_0x594422,_0x5667ae[_0x7593('0x57')]);return _0x533452['getApplications'](_0x594422);}})['then'](function(_0x4549e4){if(_0x4549e4){_0x51855f=_0x4549e4[_0x7593('0x4d')];if(!_0x5667ae[_0x7593('0x47')][_0x7593('0x4e')](_0x7593('0x4f'))){_0x594422[_0x7593('0x33')]=qs[_0x7593('0x33')](_0x5667ae[_0x7593('0x47')]['limit']);_0x594422[_0x7593('0x30')]=qs[_0x7593('0x30')](_0x5667ae['query'][_0x7593('0x30')]);}return _0x533452[_0x7593('0x86')](_0x594422);}})['then'](function(_0x54061f){if(_0x54061f){return _0x54061f?{'count':_0x51855f,'rows':_0x54061f}:null;}})['then'](respondWithResult(_0x143997,null))[_0x7593('0x2c')](handleError(_0x143997,null));};function Extension(_0x5beb93,_0x3d9a05,_0xd7b53d,_0x20ff7f){this[_0x7593('0x87')]=_0x7593('0x88');this[_0x7593('0x89')]=_0x5beb93['localstationid'];this[_0x7593('0x8a')]=_0x20ff7f;this[_0x7593('0x44')]='system';this[_0x7593('0x8b')]=_0x7593('0x8c');this['FaxAccountId']=_0x5beb93['id'];this['priority']=_0x3d9a05;this[_0x7593('0x8d')]=_0xd7b53d;}function createExtensionsReciveFax(_0x105f4a){var _0xaa9de3=0x1;var _0xa54ddf=[];_0xa54ddf['push'](new Extension(_0x105f4a,_0xaa9de3,'',_0x7593('0x8e')));_0xaa9de3+=0x1;_0xa54ddf[_0x7593('0x8f')](new Extension(_0x105f4a,_0xaa9de3,_0x7593('0x90'),'Set'));_0xaa9de3+=0x1;for(var _0x497a4b in _0x105f4a){if(_0x105f4a[_0x7593('0x4e')](_0x497a4b)&&(_0x497a4b===_0x7593('0x91')||_0x497a4b===_0x7593('0x92')||_0x497a4b===_0x7593('0x93')||_0x497a4b===_0x7593('0x94')||_0x497a4b===_0x7593('0x95')||_0x497a4b===_0x7593('0x96')||_0x497a4b===_0x7593('0x97')||_0x497a4b===_0x7593('0x98')||_0x497a4b===_0x7593('0x99'))){_0xa54ddf[_0x7593('0x8f')](new Extension(_0x105f4a,_0xaa9de3,_0x7593('0x9a')+_0x497a4b+')='+_0x105f4a[_0x497a4b],_0x7593('0x9b')));_0xaa9de3+=0x1;}}_0xa54ddf[_0x7593('0x8f')](new Extension(_0x105f4a,_0xaa9de3,'6',_0x7593('0x9c')));_0xaa9de3+=0x1;_0xa54ddf[_0x7593('0x8f')](new Extension(_0x105f4a,_0xaa9de3,'/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',_0x7593('0x9d')));_0xaa9de3=0x0;return _0xa54ddf;}exports[_0x7593('0x9e')]=function(_0x15f456,_0x1c0653,_0x135da0){var _0xf01844;return db[_0x7593('0x9f')][_0x7593('0x82')](function(_0x47d59c){return db[_0x7593('0x58')]['create'](_0x15f456[_0x7593('0x61')],{'transaction':_0x47d59c})[_0x7593('0x22')](function(_0x2f795d){_0xf01844=_0x2f795d[_0x7593('0x3b')]({'plain':!![]});return db[_0x7593('0xa0')][_0x7593('0x84')](createExtensionsReciveFax(_0xf01844),{'transaction':_0x47d59c});});})[_0x7593('0x22')](function(){return _0xf01844;})[_0x7593('0x22')](respondWithResult(_0x1c0653,null))['catch'](handleError(_0x1c0653,null));};exports[_0x7593('0xa1')]=function(_0x26471e,_0x3db202,_0x588f97){var _0x289cbf;return db[_0x7593('0x9f')][_0x7593('0x82')](function(_0x4e8d4a){return db[_0x7593('0x58')][_0x7593('0x39')](_0x26471e['body'],{'where':{'id':_0x26471e['body']['id']},'transaction':_0x4e8d4a})[_0x7593('0x22')](function(_0x514ded){return db[_0x7593('0xa0')]['destroy']({'where':{'FaxAccountId':_0x26471e[_0x7593('0x61')]['id']},'transaction':_0x4e8d4a})[_0x7593('0x22')](function(_0x37bc39){return db[_0x7593('0xa0')][_0x7593('0x84')](createExtensionsReciveFax(_[_0x7593('0x76')](_0x26471e[_0x7593('0x61')],[_0x7593('0xa2'),_0x7593('0x45'),'createdAt',_0x7593('0xa3'),_0x7593('0xa4'),_0x7593('0xa5')])),{'transaction':_0x4e8d4a});});});})[_0x7593('0x22')](function(){return db[_0x7593('0x58')][_0x7593('0xa6')](_0x26471e[_0x7593('0x61')]['id']);})[_0x7593('0x22')](respondWithResult(_0x3db202,null))[_0x7593('0x2c')](handleError(_0x3db202,null));};exports[_0x7593('0xa7')]=function(_0x1feb1d,_0x1108ba,_0x37a301){var _0x13eccc={'raw':!![],'where':{}};var _0x30cc9a={};var _0x8d3ec9={'count':0x0,'rows':[]};return db['FaxAccount'][_0x7593('0x78')]({'where':{'id':_0x1feb1d[_0x7593('0x5d')]['id']}})[_0x7593('0x22')](handleEntityNotFound(_0x1108ba,null))['then'](function(_0x56e69d){if(_0x56e69d){_0x30cc9a['model']=_['keys'](db[_0x7593('0xa8')][_0x7593('0x43')]);_0x30cc9a[_0x7593('0x47')]=_[_0x7593('0x48')](_0x1feb1d['query']);_0x30cc9a['filters']=_[_0x7593('0x4a')](_0x30cc9a['model'],_0x30cc9a[_0x7593('0x47')]);_0x13eccc[_0x7593('0x4c')]=_[_0x7593('0x4a')](_0x30cc9a[_0x7593('0x46')],qs['fields'](_0x1feb1d[_0x7593('0x47')][_0x7593('0x4b')]));_0x13eccc['attributes']=_0x13eccc[_0x7593('0x4c')][_0x7593('0x4d')]?_0x13eccc[_0x7593('0x4c')]:_0x30cc9a[_0x7593('0x46')];if(!_0x1feb1d['query']['hasOwnProperty']('nolimit')){_0x13eccc[_0x7593('0x33')]=qs[_0x7593('0x33')](_0x1feb1d['query'][_0x7593('0x33')]);_0x13eccc[_0x7593('0x30')]=qs[_0x7593('0x30')](_0x1feb1d[_0x7593('0x47')]['offset']);}_0x13eccc[_0x7593('0x50')]=qs[_0x7593('0x51')](_0x1feb1d[_0x7593('0x47')][_0x7593('0x51')]);_0x13eccc['where']=qs[_0x7593('0x49')](_['pick'](_0x1feb1d[_0x7593('0x47')],_0x30cc9a[_0x7593('0x49')]));_0x13eccc[_0x7593('0x52')]['FaxAccountId']=_0x56e69d['id'];if(_0x1feb1d[_0x7593('0x47')][_0x7593('0x54')]){_0x13eccc[_0x7593('0x52')]=_[_0x7593('0x55')](_0x13eccc[_0x7593('0x52')],{'$or':_[_0x7593('0x42')](_0x13eccc[_0x7593('0x4c')],function(_0x5895c2){var _0x4118e0={};_0x4118e0[_0x5895c2]={'$like':'%'+_0x1feb1d[_0x7593('0x47')][_0x7593('0x54')]+'%'};return _0x4118e0;})});}if(_0x1feb1d[_0x7593('0x47')][_0x7593('0xa9')]){var _0x259c32=_0x1feb1d[_0x7593('0x47')]['$gte'][_0x7593('0xaa')](',');var _0x583fe8={};_0x583fe8[_0x259c32[0x0]]={'$gte':moment(_0x259c32[0x1])[_0x7593('0xab')]('YYYY-MM-DD\x20HH:mm:ss')};_0x13eccc['where']=_[_0x7593('0x55')](_0x13eccc[_0x7593('0x52')],_0x583fe8);}_0x13eccc=_[_0x7593('0x55')]({},_0x13eccc,_0x1feb1d[_0x7593('0x57')]);return db[_0x7593('0xa8')][_0x7593('0x32')]({'where':_0x13eccc[_0x7593('0x52')]})[_0x7593('0x22')](function(_0x3512a3){_0x8d3ec9[_0x7593('0x32')]=_0x3512a3;if(_0x1feb1d[_0x7593('0x47')]['includeAll']){_0x13eccc[_0x7593('0x5a')]=[{'all':!![]}];}return db[_0x7593('0xa8')][_0x7593('0x80')](_0x13eccc);})[_0x7593('0x22')](function(_0x5d0791){_0x8d3ec9[_0x7593('0x5b')]=_0x5d0791;return _0x8d3ec9;});}})[_0x7593('0x22')](respondWithFilteredResult(_0x1108ba,_0x13eccc))['catch'](handleError(_0x1108ba,null));};exports[_0x7593('0x40')]=function(_0x38b2b9,_0x5dab05,_0x513d1c){var _0x9785b5,_0x2db9e0={},_0x552a79;if(_0x38b2b9[_0x7593('0x61')]['to']){_0x552a79=_0x38b2b9[_0x7593('0x61')]['to'][0x0];}return db['FaxAccount'][_0x7593('0x5f')]({'where':{'id':_0x38b2b9[_0x7593('0x5d')]['id']},'include':[{'model':db[_0x7593('0xac')],'as':_0x7593('0xad'),'include':[{'model':db[_0x7593('0x79')],'as':_0x7593('0xae'),'where':{'fax':_0x552a79},'limit':0x1,'order':[['updatedAt',_0x7593('0xaf')]]}]}]})[_0x7593('0x22')](handleEntityNotFound(_0x5dab05,null))[_0x7593('0x22')](function(_0x25f300){_0x9785b5=_0x25f300;if(_0x38b2b9['body']['attachments']&&_0x38b2b9[_0x7593('0x61')][_0x7593('0xb0')][_0x7593('0x4d')]){for(var _0x365e75=0x0;_0x365e75<_0x38b2b9[_0x7593('0x61')]['attachments'][_0x7593('0x4d')];_0x365e75+=0x1){_0x38b2b9['body'][_0x7593('0xb0')][_0x365e75]={'filename':_0x38b2b9['body'][_0x7593('0xb0')][_0x365e75][_0x7593('0x3f')],'id':_0x38b2b9[_0x7593('0x61')]['attachments'][_0x365e75]['id'],'path':path[_0x7593('0xb1')](config['root'],_0x7593('0xb2'),_0x38b2b9[_0x7593('0x61')][_0x7593('0xb0')][_0x365e75][_0x7593('0xb3')])};}}return respondWithRpcPromise(_0x7593('0xb4'),_0x7593('0xb4'),{'FaxAccountId':_[_0x7593('0xb5')](_0x38b2b9[_0x7593('0x5d')]['id'])?undefined:_0x38b2b9['params']['id'],'path':_[_0x7593('0xb5')](_0x38b2b9[_0x7593('0x61')][_0x7593('0xb0')][0x0][_0x7593('0xb6')])?undefined:_0x38b2b9['body'][_0x7593('0xb0')][0x0][_0x7593('0xb6')],'fax':_[_0x7593('0xb5')](_0x38b2b9[_0x7593('0x61')]['to'][0x0])?undefined:_0x38b2b9['body']['to'][0x0]},client9002);})[_0x7593('0x22')](function(){if(_0x9785b5){if(_[_0x7593('0xb5')](_0x38b2b9[_0x7593('0x61')][_0x7593('0xb7')])){_0x38b2b9['body'][_0x7593('0xb7')]=util['format'](_0x7593('0xb8'),_0x9785b5['name'],_0x9785b5[_0x7593('0xb9')]);}if(_0x9785b5[_0x7593('0xad')]){if(_0x9785b5[_0x7593('0xad')][_0x7593('0xae')][_0x7593('0x4d')]){return _0x9785b5[_0x7593('0xad')]['Contacts'][0x0];}else{return db[_0x7593('0x79')][_0x7593('0x60')](_[_0x7593('0xba')](_0x38b2b9[_0x7593('0x61')],{'firstName':_0x38b2b9[_0x7593('0x61')]['to'][0x0],'phone':_0x38b2b9['body']['to'][0x0],'fax':_0x38b2b9[_0x7593('0x61')]['to'][0x0],'ListId':_0x9785b5[_0x7593('0xa5')]}));}}else{throw new Error(_0x7593('0xbb'));}}else{throw new Error(_0x7593('0xbc'));}})['then'](function(_0x44380c){if(_0x44380c){return db[_0x7593('0x74')][_0x7593('0x5f')]({'where':{'ContactId':_0x44380c['id'],'closed':![],'FaxAccountId':_0x9785b5['id']}})[_0x7593('0x22')](function(_0x5f33da){if(_0x5f33da){return[_0x5f33da,![]];}return db[_0x7593('0x74')][_0x7593('0x60')]({'UserId':_0x38b2b9[_0x7593('0x62')]['id'],'ContactId':_0x44380c['id'],'FaxAccountId':_0x9785b5['id'],'fax':_0x38b2b9[_0x7593('0x61')]['to'][0x0],'firstMsgDirection':_0x7593('0xbd'),'Messages':[_[_0x7593('0x55')](_0x38b2b9['body'],{'read':![],'body':_0x38b2b9['body'][_0x7593('0xb0')][0x0][_0x7593('0xbe')],'FaxAccountId':_0x9785b5['id'],'UserId':_0x38b2b9[_0x7593('0x62')]['id'],'ContactId':_0x44380c['id'],'AttachmentId':_0x38b2b9['body'][_0x7593('0xb0')][0x0]['id']})]},{'include':[{'model':db[_0x7593('0xa8')],'as':'Messages'}]})[_0x7593('0x22')](function(_0x5841f0){return[_0x5841f0,!![]];});});}else{throw new Error(_0x7593('0xbf'));}})[_0x7593('0xc0')](function(_0xc2f455,_0xa1da9f){if(_0xa1da9f){return _0xc2f455;}return db['FaxMessage'][_0x7593('0x60')]({'direction':_0x7593('0xbd'),'read':![],'body':_0x38b2b9[_0x7593('0x61')]['attachments'][0x0][_0x7593('0xbe')],'FaxAccountId':_0x9785b5['id'],'FaxInteractionId':_0xc2f455['id'],'UserId':_0x38b2b9[_0x7593('0x62')]['id'],'ContactId':_0xc2f455[_0x7593('0xc1')],'AttachmentId':_0x38b2b9[_0x7593('0x61')][_0x7593('0xb0')][0x0]['id']})[_0x7593('0x22')](function(_0x3a68d9){_0xc2f455[_0x7593('0xc2')][_0x7593('0xc3')]=[];_0xc2f455[_0x7593('0xc2')][_0x7593('0xc3')]['push'](_0x3a68d9['dataValues']);return _0xc2f455;});})[_0x7593('0x22')](function(_0x20cad4){respondWithRpcPromise(_0x7593('0xc4'),'SendFax',{'FaxAccountId':_[_0x7593('0xb5')](_0x38b2b9[_0x7593('0x5d')]['id'])?undefined:_0x38b2b9[_0x7593('0x5d')]['id'],'path':_[_0x7593('0xb5')](_0x38b2b9[_0x7593('0x61')]['attachments'][0x0][_0x7593('0xb6')])?undefined:_0x38b2b9[_0x7593('0x61')][_0x7593('0xb0')][0x0][_0x7593('0xb6')],'fax':_['isNil'](_0x38b2b9[_0x7593('0x61')]['to'][0x0])?undefined:_0x38b2b9[_0x7593('0x61')]['to'][0x0],'AttachmentId':_0x38b2b9[_0x7593('0x61')][_0x7593('0xb0')][0x0]['id']},client9002)['then'](function(_0x2d60d4){logger[_0x7593('0x23')](_0x7593('0xc5'),_0x2d60d4);})[_0x7593('0x2c')](function(_0x222666){logger[_0x7593('0x23')](_0x7593('0xc5'),_0x222666);});return _0x20cad4;})[_0x7593('0x22')](respondWithResult(_0x5dab05,null))['catch'](handleError(_0x5dab05,null));};exports[_0x7593('0xc6')]=function(_0x259e5f,_0x4c30f5,_0x4fdb13){return db[_0x7593('0x58')][_0x7593('0x5f')]({'where':{'id':_0x259e5f['params']['id']}})[_0x7593('0x22')](handleEntityNotFound(_0x4c30f5,null))[_0x7593('0x22')](function(_0x5b2ce2){if(_0x5b2ce2){return _0x5b2ce2['addAgents'](_0x259e5f[_0x7593('0x61')][_0x7593('0x73')],_[_0x7593('0x76')](_0x259e5f['body'],[_0x7593('0x73'),'id'])||{})['spread'](function(_0x64ad23){for(var _0x340116=0x0;_0x340116<_0x259e5f[_0x7593('0x61')][_0x7593('0x73')][_0x7593('0x4d')];_0x340116+=0x1){socket[_0x7593('0xc7')](_0x7593('0xc8'),{'UserId':Number(_0x259e5f[_0x7593('0x61')][_0x7593('0x73')][_0x340116]),'FaxAccountId':Number(_0x259e5f[_0x7593('0x5d')]['id'])});}return _0x64ad23;});}})[_0x7593('0x22')](respondWithResult(_0x4c30f5,null))[_0x7593('0x2c')](handleError(_0x4c30f5,null));};exports[_0x7593('0xc9')]=function(_0x1a6616,_0xef2d45,_0x39bcac){return db[_0x7593('0x58')]['find']({'where':{'id':_0x1a6616[_0x7593('0x5d')]['id']}})[_0x7593('0x22')](handleEntityNotFound(_0xef2d45,null))[_0x7593('0x22')](function(_0x1a0d8e){if(_0x1a0d8e){return _0x1a0d8e[_0x7593('0xc9')](_0x1a6616[_0x7593('0x47')][_0x7593('0x73')])['then'](function(){if(_[_0x7593('0xca')](_0x1a6616[_0x7593('0x47')]['ids'])){for(var _0x55ca63=0x0;_0x55ca63<_0x1a6616[_0x7593('0x47')]['ids'][_0x7593('0x4d')];_0x55ca63+=0x1){socket[_0x7593('0xc7')](_0x7593('0xcb'),{'UserId':Number(_0x1a6616[_0x7593('0x47')][_0x7593('0x73')][_0x55ca63]),'FaxAccountId':Number(_0x1a6616[_0x7593('0x5d')]['id'])});}}else{socket['emit']('userFaxAccount:remove',{'UserId':Number(_0x1a6616[_0x7593('0x47')]['ids']),'FaxAccountId':Number(_0x1a6616[_0x7593('0x5d')]['id'])});}});}})[_0x7593('0x22')](respondWithStatusCode(_0xef2d45,null))[_0x7593('0x2c')](handleError(_0xef2d45,null));};exports['getAgents']=function(_0x59992c,_0x5741fb,_0x41cc94){var _0x2c516e={};var _0x3797a6={};var _0x469132;var _0x2e61b5;return db['FaxAccount'][_0x7593('0x78')]({'where':{'id':_0x59992c[_0x7593('0x5d')]['id']}})['then'](handleEntityNotFound(_0x5741fb,null))[_0x7593('0x22')](function(_0x41b4ef){if(_0x41b4ef){_0x469132=_0x41b4ef;_0x3797a6['model']=_[_0x7593('0x48')](db['User'][_0x7593('0x43')]);_0x3797a6[_0x7593('0x47')]=_['keys'](_0x59992c['query']);_0x3797a6['filters']=_[_0x7593('0x4a')](_0x3797a6['model'],_0x3797a6['query']);_0x2c516e[_0x7593('0x4c')]=_[_0x7593('0x4a')](_0x3797a6[_0x7593('0x46')],qs[_0x7593('0x4b')](_0x59992c['query']['fields']));_0x2c516e['attributes']=_0x2c516e[_0x7593('0x4c')][_0x7593('0x4d')]?_0x2c516e[_0x7593('0x4c')]:_0x3797a6[_0x7593('0x46')];_0x2c516e[_0x7593('0x50')]=qs['sort'](_0x59992c[_0x7593('0x47')][_0x7593('0x51')]);_0x2c516e[_0x7593('0x52')]=qs['filters'](_[_0x7593('0x53')](_0x59992c[_0x7593('0x47')],_0x3797a6[_0x7593('0x49')]));if(_0x59992c[_0x7593('0x47')][_0x7593('0x54')]){_0x2c516e[_0x7593('0x52')]=_['merge'](_0x2c516e[_0x7593('0x52')],{'$or':_['map'](_0x2c516e['attributes'],function(_0xf753b3){var _0x40c034={};_0x40c034[_0xf753b3]={'$like':'%'+_0x59992c[_0x7593('0x47')][_0x7593('0x54')]+'%'};return _0x40c034;})});}_0x2c516e=_[_0x7593('0x55')]({},_0x2c516e,_0x59992c[_0x7593('0x57')]);return _0x469132[_0x7593('0xcc')](_0x2c516e);}})[_0x7593('0x22')](function(_0xf1d6c0){if(_0xf1d6c0){_0x2e61b5=_0xf1d6c0[_0x7593('0x4d')];if(!_0x59992c[_0x7593('0x47')][_0x7593('0x4e')](_0x7593('0x4f'))){_0x2c516e[_0x7593('0x33')]=qs['limit'](_0x59992c[_0x7593('0x47')][_0x7593('0x33')]);_0x2c516e[_0x7593('0x30')]=qs[_0x7593('0x30')](_0x59992c[_0x7593('0x47')]['offset']);}return _0x469132[_0x7593('0xcc')](_0x2c516e);}})[_0x7593('0x22')](function(_0x59d894){if(_0x59d894){return _0x59d894?{'count':_0x2e61b5,'rows':_0x59d894}:null;}})[_0x7593('0x22')](respondWithResult(_0x5741fb,null))['catch'](handleError(_0x5741fb,null));}; \ No newline at end of file +var _0x7125=['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','redis','defaults','localhost','./faxAccount.socket','register','jayson/promise','client','http','request','then','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','sendStatus','status','end','json','undefined','limit','set','Content-Range','apply','reject','update','destroy','FaxAccounts','UserProfileResource','stack','name','index','mandatoryDispositionPause','FaxAccount','rawAttributes','fieldName','type','model','keys','filters','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','include','findAll','rows','show','params','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Pause','describe','addDisposition','Disposition','getDispositions','map','FaxAccountId','CannedAnswer','removeAnswers','ids','FaxInteraction','addInteraction','omit','getInteractions','findOne','Contact','User','fullname','color','tag','sequelize','transaction','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','exten','app','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','localstationid','faxdetect','maxrate','minrate','modem','t38timeout','FAXOPT(','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','tech','key','createdAt','updatedAt','TrunkId','ListId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','send','List','CmContact','DESC','attachments','join','server/files/attachments','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','Contacts','Send\x20Fax\x20failed','out','filename','Contact\x20not\x20found','spread','ContactId','dataValues','Messages','SendFax','SendFaxRpc,\x20%s','addAgents','userFaxAccount:save','removeAgents','isArray','emit','userFaxAccount:remove','getAgents','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x7125,0x177));var _0x5712=function(_0x484fa1,_0x462ffa){_0x484fa1=_0x484fa1-0x0;var _0x341b4d=_0x7125[_0x484fa1];return _0x341b4d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5712('0x0'));var zipdir=require(_0x5712('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5712('0x2'));var moment=require(_0x5712('0x3'));var BPromise=require(_0x5712('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5712('0x5'));var sox=require(_0x5712('0x6'));var csv=require(_0x5712('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5712('0x8'));var _=require(_0x5712('0x9'));var squel=require(_0x5712('0xa'));var crypto=require(_0x5712('0xb'));var jsforce=require(_0x5712('0xc'));var deskjs=require(_0x5712('0xd'));var toCsv=require(_0x5712('0x7'));var querystring=require(_0x5712('0xe'));var Papa=require(_0x5712('0xf'));var Redis=require(_0x5712('0x10'));var authService=require(_0x5712('0x11'));var qs=require(_0x5712('0x12'));var as=require(_0x5712('0x13'));var hardwareService=require(_0x5712('0x14'));var logger=require(_0x5712('0x15'))(_0x5712('0x16'));var utils=require(_0x5712('0x17'));var config=require(_0x5712('0x18'));var licenseUtil=require(_0x5712('0x19'));var db=require(_0x5712('0x1a'))['db'];config[_0x5712('0x1b')]=_[_0x5712('0x1c')](config['redis'],{'host':_0x5712('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x5712('0x1e'))[_0x5712('0x1f')](socket);var jayson=require(_0x5712('0x20'));var client=jayson[_0x5712('0x21')][_0x5712('0x22')]({'port':0x232c});var client9002=jayson['client'][_0x5712('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x5bfaf4,_0x18e505,_0x48c2e7,_0x1fb46e){return new BPromise(function(_0x45da35,_0x23f480){var _0x2addb7=_0x1fb46e||client;return _0x2addb7[_0x5712('0x23')](_0x5bfaf4,_0x48c2e7)[_0x5712('0x24')](function(_0x327dc7){logger['info'](_0x5712('0x25'),_0x18e505,_0x5712('0x26'));logger[_0x5712('0x27')](_0x5712('0x28'),_0x18e505,_0x5712('0x26'),JSON['stringify'](_0x327dc7));if(_0x327dc7[_0x5712('0x29')]){if(_0x327dc7[_0x5712('0x29')][_0x5712('0x2a')]===0x1f4){logger[_0x5712('0x29')](_0x5712('0x25'),_0x18e505,_0x327dc7[_0x5712('0x29')][_0x5712('0x2b')]);return _0x23f480(_0x327dc7[_0x5712('0x29')]['message']);}logger[_0x5712('0x29')](_0x5712('0x25'),_0x18e505,_0x327dc7[_0x5712('0x29')][_0x5712('0x2b')]);return _0x45da35(_0x327dc7[_0x5712('0x29')][_0x5712('0x2b')]);}else{logger[_0x5712('0x2c')](_0x5712('0x25'),_0x18e505,_0x5712('0x26'));_0x45da35(_0x327dc7[_0x5712('0x2d')][_0x5712('0x2b')]);}})[_0x5712('0x2e')](function(_0x1b7a41){logger['error']('FaxAccount,\x20%s,\x20%s',_0x18e505,_0x1b7a41);_0x23f480(_0x1b7a41);});});}function respondWithStatusCode(_0x24b276,_0x1e01b2){_0x1e01b2=_0x1e01b2||0xcc;return function(_0x14a94c){if(_0x14a94c){return _0x24b276[_0x5712('0x2f')](_0x1e01b2);}return _0x24b276[_0x5712('0x30')](_0x1e01b2)[_0x5712('0x31')]();};}function respondWithResult(_0x1864e3,_0x48f680){_0x48f680=_0x48f680||0xc8;return function(_0x4de73f){if(_0x4de73f){return _0x1864e3[_0x5712('0x30')](_0x48f680)[_0x5712('0x32')](_0x4de73f);}};}function respondWithFilteredResult(_0x172f31,_0x5927ae){return function(_0x3796f1){if(_0x3796f1){var _0x5c5b8c=typeof _0x5927ae['offset']===_0x5712('0x33')&&typeof _0x5927ae[_0x5712('0x34')]===_0x5712('0x33');var _0x271c6e=_0x3796f1['count'];var _0x49af62=_0x5c5b8c?0x0:_0x5927ae['offset'];var _0x407182=_0x5c5b8c?_0x3796f1['count']:_0x5927ae['offset']+_0x5927ae[_0x5712('0x34')];var _0x3cd48;if(_0x407182>=_0x271c6e){_0x407182=_0x271c6e;_0x3cd48=0xc8;}else{_0x3cd48=0xce;}_0x172f31[_0x5712('0x30')](_0x3cd48);return _0x172f31[_0x5712('0x35')](_0x5712('0x36'),_0x49af62+'-'+_0x407182+'/'+_0x271c6e)[_0x5712('0x32')](_0x3796f1);}return null;};}function patchUpdates(_0x4b5f62){return function(_0x4597ba){try{jsonpatch[_0x5712('0x37')](_0x4597ba,_0x4b5f62,!![]);}catch(_0x8a8757){return BPromise[_0x5712('0x38')](_0x8a8757);}return _0x4597ba['save']();};}function saveUpdates(_0x5ca7a2,_0x21b431){return function(_0x2ad3ba){if(_0x2ad3ba){return _0x2ad3ba[_0x5712('0x39')](_0x5ca7a2)[_0x5712('0x24')](function(_0x4e4118){return _0x4e4118;});}return null;};}function removeEntity(_0x3af521,_0x56e2e6){return function(_0x4914dc){if(_0x4914dc){return _0x4914dc[_0x5712('0x3a')]()['then'](function(){var _0x1325b7=_0x4914dc['get']({'plain':!![]});var _0x516b01=_0x5712('0x3b');return db[_0x5712('0x3c')]['destroy']({'where':{'type':_0x516b01,'resourceId':_0x1325b7['id']}})[_0x5712('0x24')](function(){return _0x4914dc;});})[_0x5712('0x24')](function(){_0x3af521[_0x5712('0x30')](0xcc)[_0x5712('0x31')]();});}};}function handleEntityNotFound(_0x2f1180,_0xaf22de){return function(_0x142f63){if(!_0x142f63){_0x2f1180['sendStatus'](0x194);}return _0x142f63;};}function handleError(_0x21257b,_0x1e5972){_0x1e5972=_0x1e5972||0x1f4;return function(_0x5f111a){logger[_0x5712('0x29')](_0x5f111a[_0x5712('0x3d')]);if(_0x5f111a[_0x5712('0x3e')]){delete _0x5f111a[_0x5712('0x3e')];}_0x21257b['status'](_0x1e5972)['send'](_0x5f111a);};}exports[_0x5712('0x3f')]=function(_0x9b3707,_0x9ff848){var _0x48dfc9={'include':[{'model':db['Pause'],'as':_0x5712('0x40')}]},_0x2b2a43={},_0xefc16e={'count':0x0,'rows':[]};var _0x496ef6=_['map'](db[_0x5712('0x41')][_0x5712('0x42')],function(_0x1b4819){return{'name':_0x1b4819[_0x5712('0x43')],'type':_0x1b4819[_0x5712('0x44')]['key']};});_0x2b2a43[_0x5712('0x45')]=_['map'](_0x496ef6,'name');_0x2b2a43['query']=_[_0x5712('0x46')](_0x9b3707['query']);_0x2b2a43[_0x5712('0x47')]=_[_0x5712('0x48')](_0x2b2a43['model'],_0x2b2a43['query']);_0x48dfc9[_0x5712('0x49')]=_[_0x5712('0x48')](_0x2b2a43[_0x5712('0x45')],qs[_0x5712('0x4a')](_0x9b3707[_0x5712('0x4b')]['fields']));_0x48dfc9[_0x5712('0x49')]=_0x48dfc9[_0x5712('0x49')][_0x5712('0x4c')]?_0x48dfc9[_0x5712('0x49')]:_0x2b2a43[_0x5712('0x45')];if(!_0x9b3707['query'][_0x5712('0x4d')](_0x5712('0x4e'))){_0x48dfc9['limit']=qs[_0x5712('0x34')](_0x9b3707[_0x5712('0x4b')][_0x5712('0x34')]);_0x48dfc9[_0x5712('0x4f')]=qs[_0x5712('0x4f')](_0x9b3707[_0x5712('0x4b')][_0x5712('0x4f')]);}_0x48dfc9[_0x5712('0x50')]=qs[_0x5712('0x51')](_0x9b3707[_0x5712('0x4b')][_0x5712('0x51')]);_0x48dfc9[_0x5712('0x52')]=qs[_0x5712('0x47')](_[_0x5712('0x53')](_0x9b3707['query'],_0x2b2a43[_0x5712('0x47')]),_0x496ef6);if(_0x9b3707[_0x5712('0x4b')][_0x5712('0x54')]){_0x48dfc9['where']=_[_0x5712('0x55')](_0x48dfc9[_0x5712('0x52')],{'$or':_['map'](_0x496ef6,function(_0x1fd42a){if(_0x1fd42a[_0x5712('0x44')]!==_0x5712('0x56')){var _0x3f6138={};_0x3f6138[_0x1fd42a[_0x5712('0x3e')]]={'$like':'%'+_0x9b3707['query'][_0x5712('0x54')]+'%'};return _0x3f6138;}})});}_0x48dfc9=_['merge']({},_0x48dfc9,_0x9b3707['options']);var _0x3f81f2={'where':_0x48dfc9[_0x5712('0x52')]};return db['FaxAccount']['count'](_0x3f81f2)[_0x5712('0x24')](function(_0x5e6f52){_0xefc16e[_0x5712('0x57')]=_0x5e6f52;if(_0x9b3707[_0x5712('0x4b')][_0x5712('0x58')]){_0x48dfc9[_0x5712('0x59')]=[{'all':!![]}];}return db['FaxAccount'][_0x5712('0x5a')](_0x48dfc9);})[_0x5712('0x24')](function(_0x7986f8){_0xefc16e[_0x5712('0x5b')]=_0x7986f8;return _0xefc16e;})['then'](respondWithFilteredResult(_0x9ff848,_0x48dfc9))['catch'](handleError(_0x9ff848,null));};exports[_0x5712('0x5c')]=function(_0x43ef02,_0x444ebe){var _0x4842c0={'raw':![],'where':{'id':_0x43ef02[_0x5712('0x5d')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x4caf56={};_0x4caf56[_0x5712('0x45')]=_[_0x5712('0x46')](db[_0x5712('0x41')]['rawAttributes']);_0x4caf56[_0x5712('0x4b')]=_[_0x5712('0x46')](_0x43ef02[_0x5712('0x4b')]);_0x4caf56[_0x5712('0x47')]=_[_0x5712('0x48')](_0x4caf56['model'],_0x4caf56[_0x5712('0x4b')]);_0x4842c0[_0x5712('0x49')]=_[_0x5712('0x48')](_0x4caf56[_0x5712('0x45')],qs[_0x5712('0x4a')](_0x43ef02['query']['fields']));_0x4842c0[_0x5712('0x49')]=_0x4842c0[_0x5712('0x49')][_0x5712('0x4c')]?_0x4842c0[_0x5712('0x49')]:_0x4caf56[_0x5712('0x45')];if(_0x43ef02[_0x5712('0x4b')][_0x5712('0x58')]){_0x4842c0[_0x5712('0x59')]=[{'all':!![]}];}_0x4842c0=_[_0x5712('0x55')]({},_0x4842c0,_0x43ef02[_0x5712('0x5e')]);return db[_0x5712('0x41')][_0x5712('0x5f')](_0x4842c0)['then'](handleEntityNotFound(_0x444ebe,null))[_0x5712('0x24')](respondWithResult(_0x444ebe,null))[_0x5712('0x2e')](handleError(_0x444ebe,null));};exports['create']=function(_0x45c36b,_0x548bf8){return db[_0x5712('0x41')][_0x5712('0x60')](_0x45c36b[_0x5712('0x61')],{})[_0x5712('0x24')](function(_0x272908){var _0x38c860=_0x45c36b[_0x5712('0x62')][_0x5712('0x63')]({'plain':!![]});if(!_0x38c860)throw new Error(_0x5712('0x64'));if(_0x38c860['role']==='user'){var _0x295bd3=_0x272908[_0x5712('0x63')]({'plain':!![]});var _0x1fb7ea=_0x5712('0x3b');return db[_0x5712('0x65')]['find']({'where':{'name':_0x1fb7ea,'userProfileId':_0x38c860[_0x5712('0x66')]},'raw':!![]})[_0x5712('0x24')](function(_0x57815e){if(_0x57815e&&_0x57815e[_0x5712('0x67')]===0x0){return db[_0x5712('0x3c')][_0x5712('0x60')]({'name':_0x295bd3[_0x5712('0x3e')],'resourceId':_0x295bd3['id'],'type':_0x57815e['name'],'sectionId':_0x57815e['id']},{})[_0x5712('0x24')](function(){return _0x272908;});}else{return _0x272908;}})[_0x5712('0x2e')](function(_0x2080c1){logger['error'](_0x5712('0x68'),_0x2080c1);throw _0x2080c1;});}return _0x272908;})[_0x5712('0x24')](respondWithResult(_0x548bf8,0xc9))['catch'](handleError(_0x548bf8,null));};exports['update']=function(_0x30c680,_0xb6c764){if(_0x30c680['body']['id']){delete _0x30c680[_0x5712('0x61')]['id'];}return db[_0x5712('0x41')][_0x5712('0x5f')]({'where':{'id':_0x30c680[_0x5712('0x5d')]['id']},'include':[{'model':db[_0x5712('0x69')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0xb6c764,null))['then'](saveUpdates(_0x30c680[_0x5712('0x61')],null))['then'](respondWithResult(_0xb6c764,null))['catch'](handleError(_0xb6c764,null));};exports[_0x5712('0x3a')]=function(_0x4eccef,_0x35e711){return db[_0x5712('0x41')]['find']({'where':{'id':_0x4eccef[_0x5712('0x5d')]['id']}})[_0x5712('0x24')](handleEntityNotFound(_0x35e711,null))[_0x5712('0x24')](removeEntity(_0x35e711,null))[_0x5712('0x2e')](handleError(_0x35e711,null));};exports[_0x5712('0x6a')]=function(_0x3f9657,_0x3f8e28){return db[_0x5712('0x41')]['describe']()[_0x5712('0x24')](respondWithResult(_0x3f8e28,null))['catch'](handleError(_0x3f8e28,null));};exports[_0x5712('0x6b')]=function(_0x134f04,_0x2c16e1,_0x56e2db){if(_0x134f04[_0x5712('0x61')]['id']){delete _0x134f04['body']['id'];}return db[_0x5712('0x41')][_0x5712('0x5f')]({'where':{'id':_0x134f04[_0x5712('0x5d')]['id']}})[_0x5712('0x24')](handleEntityNotFound(_0x2c16e1,null))['then'](function(_0x48d748){if(_0x48d748){_0x134f04['body']['FaxAccountId']=_0x48d748['id'];return db[_0x5712('0x6c')][_0x5712('0x60')](_0x134f04[_0x5712('0x61')]);}})[_0x5712('0x24')](respondWithResult(_0x2c16e1,null))[_0x5712('0x2e')](handleError(_0x2c16e1,null));};exports[_0x5712('0x6d')]=function(_0x1a2a5d,_0x20abc9,_0x1d3f38){var _0x4a9e9f={'raw':![],'where':{}};var _0x10b5f0={};var _0x3066ad={'count':0x0,'rows':[]};return db[_0x5712('0x41')]['findOne']({'where':{'id':_0x1a2a5d[_0x5712('0x5d')]['id']}})['then'](handleEntityNotFound(_0x20abc9,null))[_0x5712('0x24')](function(_0xcb200e){if(_0xcb200e){_0x10b5f0[_0x5712('0x45')]=_[_0x5712('0x46')](db[_0x5712('0x6c')]['rawAttributes']);_0x10b5f0[_0x5712('0x4b')]=_['keys'](_0x1a2a5d[_0x5712('0x4b')]);_0x10b5f0[_0x5712('0x47')]=_[_0x5712('0x48')](_0x10b5f0[_0x5712('0x45')],_0x10b5f0[_0x5712('0x4b')]);_0x4a9e9f[_0x5712('0x49')]=_[_0x5712('0x48')](_0x10b5f0[_0x5712('0x45')],qs[_0x5712('0x4a')](_0x1a2a5d[_0x5712('0x4b')][_0x5712('0x4a')]));_0x4a9e9f['attributes']=_0x4a9e9f[_0x5712('0x49')][_0x5712('0x4c')]?_0x4a9e9f['attributes']:_0x10b5f0[_0x5712('0x45')];if(!_0x1a2a5d[_0x5712('0x4b')][_0x5712('0x4d')]('nolimit')){_0x4a9e9f[_0x5712('0x34')]=qs['limit'](_0x1a2a5d[_0x5712('0x4b')][_0x5712('0x34')]);_0x4a9e9f['offset']=qs[_0x5712('0x4f')](_0x1a2a5d[_0x5712('0x4b')][_0x5712('0x4f')]);}_0x4a9e9f[_0x5712('0x50')]=qs[_0x5712('0x51')](_0x1a2a5d['query'][_0x5712('0x51')]);_0x4a9e9f['where']=qs[_0x5712('0x47')](_[_0x5712('0x53')](_0x1a2a5d[_0x5712('0x4b')],_0x10b5f0[_0x5712('0x47')]));_0x4a9e9f['where']['FaxAccountId']=_0xcb200e['id'];if(_0x1a2a5d['query'][_0x5712('0x54')]){_0x4a9e9f[_0x5712('0x52')]=_['merge'](_0x4a9e9f[_0x5712('0x52')],{'$or':_[_0x5712('0x6e')](_0x4a9e9f[_0x5712('0x49')],function(_0x128601){var _0x66874b={};_0x66874b[_0x128601]={'$like':'%'+_0x1a2a5d[_0x5712('0x4b')]['filter']+'%'};return _0x66874b;})});}_0x4a9e9f=_['merge']({},_0x4a9e9f,_0x1a2a5d[_0x5712('0x5e')]);return db[_0x5712('0x6c')]['count']({'where':_0x4a9e9f[_0x5712('0x52')]})[_0x5712('0x24')](function(_0x2e653c){_0x3066ad['count']=_0x2e653c;if(_0x1a2a5d['query'][_0x5712('0x58')]){_0x4a9e9f[_0x5712('0x59')]=[{'all':!![]}];}return db['Disposition'][_0x5712('0x5a')](_0x4a9e9f);})[_0x5712('0x24')](function(_0x3e2899){_0x3066ad['rows']=_0x3e2899;return _0x3066ad;});}})[_0x5712('0x24')](respondWithFilteredResult(_0x20abc9,_0x4a9e9f))[_0x5712('0x2e')](handleError(_0x20abc9,null));};exports['removeDispositions']=function(_0x5cc86b,_0xc5e396,_0xa92a52){return db[_0x5712('0x41')]['find']({'where':{'id':_0x5cc86b['params']['id']}})[_0x5712('0x24')](handleEntityNotFound(_0xc5e396,null))[_0x5712('0x24')](function(_0x4e2a2a){if(_0x4e2a2a){return _0x4e2a2a['removeDispositions'](_0x5cc86b['query']['ids']);}})[_0x5712('0x24')](respondWithStatusCode(_0xc5e396,null))[_0x5712('0x2e')](handleError(_0xc5e396,null));};exports['addAnswer']=function(_0x1afde4,_0x7afbf3,_0x24ac00){if(_0x1afde4[_0x5712('0x61')]['id']){delete _0x1afde4[_0x5712('0x61')]['id'];}return db['FaxAccount'][_0x5712('0x5f')]({'where':{'id':_0x1afde4[_0x5712('0x5d')]['id']}})['then'](handleEntityNotFound(_0x7afbf3,null))['then'](function(_0x454b1b){if(_0x454b1b){_0x1afde4[_0x5712('0x61')][_0x5712('0x6f')]=_0x454b1b['id'];return db[_0x5712('0x70')][_0x5712('0x60')](_0x1afde4[_0x5712('0x61')]);}})[_0x5712('0x24')](respondWithResult(_0x7afbf3,null))[_0x5712('0x2e')](handleError(_0x7afbf3,null));};exports['getAnswers']=function(_0x3ed94d,_0x490987,_0x336205){var _0x552c32={'raw':![],'where':{}};var _0x4e693e={};var _0x40ff8d={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x3ed94d[_0x5712('0x5d')]['id']}})[_0x5712('0x24')](handleEntityNotFound(_0x490987,null))[_0x5712('0x24')](function(_0x3a7274){if(_0x3a7274){_0x4e693e[_0x5712('0x45')]=_[_0x5712('0x46')](db['CannedAnswer']['rawAttributes']);_0x4e693e['query']=_[_0x5712('0x46')](_0x3ed94d[_0x5712('0x4b')]);_0x4e693e[_0x5712('0x47')]=_[_0x5712('0x48')](_0x4e693e[_0x5712('0x45')],_0x4e693e[_0x5712('0x4b')]);_0x552c32[_0x5712('0x49')]=_[_0x5712('0x48')](_0x4e693e[_0x5712('0x45')],qs[_0x5712('0x4a')](_0x3ed94d[_0x5712('0x4b')][_0x5712('0x4a')]));_0x552c32[_0x5712('0x49')]=_0x552c32['attributes'][_0x5712('0x4c')]?_0x552c32[_0x5712('0x49')]:_0x4e693e[_0x5712('0x45')];if(!_0x3ed94d[_0x5712('0x4b')][_0x5712('0x4d')]('nolimit')){_0x552c32[_0x5712('0x34')]=qs['limit'](_0x3ed94d[_0x5712('0x4b')][_0x5712('0x34')]);_0x552c32['offset']=qs[_0x5712('0x4f')](_0x3ed94d[_0x5712('0x4b')][_0x5712('0x4f')]);}_0x552c32[_0x5712('0x50')]=qs[_0x5712('0x51')](_0x3ed94d[_0x5712('0x4b')][_0x5712('0x51')]);_0x552c32[_0x5712('0x52')]=qs[_0x5712('0x47')](_[_0x5712('0x53')](_0x3ed94d['query'],_0x4e693e['filters']));_0x552c32[_0x5712('0x52')]['FaxAccountId']=_0x3a7274['id'];if(_0x3ed94d[_0x5712('0x4b')]['filter']){_0x552c32[_0x5712('0x52')]=_[_0x5712('0x55')](_0x552c32[_0x5712('0x52')],{'$or':_[_0x5712('0x6e')](_0x552c32['attributes'],function(_0x5513ed){var _0x27cf98={};_0x27cf98[_0x5513ed]={'$like':'%'+_0x3ed94d[_0x5712('0x4b')]['filter']+'%'};return _0x27cf98;})});}_0x552c32=_[_0x5712('0x55')]({},_0x552c32,_0x3ed94d[_0x5712('0x5e')]);return db[_0x5712('0x70')][_0x5712('0x57')]({'where':_0x552c32[_0x5712('0x52')]})[_0x5712('0x24')](function(_0x528df3){_0x40ff8d[_0x5712('0x57')]=_0x528df3;if(_0x3ed94d[_0x5712('0x4b')][_0x5712('0x58')]){_0x552c32[_0x5712('0x59')]=[{'all':!![]}];}return db[_0x5712('0x70')][_0x5712('0x5a')](_0x552c32);})[_0x5712('0x24')](function(_0x48ba48){_0x40ff8d[_0x5712('0x5b')]=_0x48ba48;return _0x40ff8d;});}})[_0x5712('0x24')](respondWithFilteredResult(_0x490987,_0x552c32))['catch'](handleError(_0x490987,null));};exports[_0x5712('0x71')]=function(_0x54b13d,_0x2771bf,_0x7e39a4){return db[_0x5712('0x41')][_0x5712('0x5f')]({'where':{'id':_0x54b13d[_0x5712('0x5d')]['id']}})['then'](handleEntityNotFound(_0x2771bf,null))['then'](function(_0x51751b){if(_0x51751b){return _0x51751b['removeAnswers'](_0x54b13d[_0x5712('0x4b')][_0x5712('0x72')]);}})[_0x5712('0x24')](respondWithStatusCode(_0x2771bf,null))['catch'](handleError(_0x2771bf,null));};exports['addInteraction']=function(_0x2b1293,_0x2301f7,_0x4d4c4b){return db[_0x5712('0x73')][_0x5712('0x5f')]({'where':{'id':_0x2b1293[_0x5712('0x5d')]['id']}})[_0x5712('0x24')](handleEntityNotFound(_0x2301f7,null))['then'](function(_0x268753){if(_0x268753){return _0x268753[_0x5712('0x74')](_0x2b1293[_0x5712('0x61')][_0x5712('0x72')],_[_0x5712('0x75')](_0x2b1293[_0x5712('0x61')],[_0x5712('0x72'),'id'])||{});}})['then'](respondWithResult(_0x2301f7,null))[_0x5712('0x2e')](handleError(_0x2301f7,null));};exports[_0x5712('0x76')]=function(_0xffaa42,_0x4e6b3c,_0x5b5d28){var _0x49145e={'raw':![],'where':{}};var _0x3d9cf1={};var _0x3a3d27={'count':0x0,'rows':[]};return db[_0x5712('0x41')][_0x5712('0x77')]({'where':{'id':_0xffaa42[_0x5712('0x5d')]['id']}})[_0x5712('0x24')](handleEntityNotFound(_0x4e6b3c,null))['then'](function(_0x3a4764){if(_0x3a4764){_0x3d9cf1[_0x5712('0x45')]=_[_0x5712('0x46')](db[_0x5712('0x73')][_0x5712('0x42')]);_0x3d9cf1['query']=_[_0x5712('0x46')](_0xffaa42[_0x5712('0x4b')]);_0x3d9cf1[_0x5712('0x47')]=_['intersection'](_0x3d9cf1[_0x5712('0x45')],_0x3d9cf1[_0x5712('0x4b')]);_0x49145e[_0x5712('0x49')]=_[_0x5712('0x48')](_0x3d9cf1[_0x5712('0x45')],qs[_0x5712('0x4a')](_0xffaa42['query'][_0x5712('0x4a')]));_0x49145e[_0x5712('0x49')]=_0x49145e[_0x5712('0x49')][_0x5712('0x4c')]?_0x49145e[_0x5712('0x49')]:_0x3d9cf1[_0x5712('0x45')];if(!_0xffaa42['query'][_0x5712('0x4d')](_0x5712('0x4e'))){_0x49145e[_0x5712('0x34')]=qs['limit'](_0xffaa42[_0x5712('0x4b')]['limit']);_0x49145e['offset']=qs['offset'](_0xffaa42['query']['offset']);}_0x49145e[_0x5712('0x50')]=qs['sort'](_0xffaa42[_0x5712('0x4b')][_0x5712('0x51')]);_0x49145e[_0x5712('0x52')]=qs[_0x5712('0x47')](_['pick'](_0xffaa42['query'],_0x3d9cf1['filters']));_0x49145e[_0x5712('0x52')][_0x5712('0x6f')]=_0x3a4764['id'];if(_0xffaa42['query'][_0x5712('0x54')]){_0x49145e[_0x5712('0x52')]=_[_0x5712('0x55')](_0x49145e[_0x5712('0x52')],{'$or':_[_0x5712('0x6e')](_0x49145e[_0x5712('0x49')],function(_0x1a9d8a){var _0x1ab7e6={};_0x1ab7e6[_0x1a9d8a]={'$like':'%'+_0xffaa42[_0x5712('0x4b')][_0x5712('0x54')]+'%'};return _0x1ab7e6;})});}_0x49145e=_[_0x5712('0x55')]({},_0x49145e,_0xffaa42[_0x5712('0x5e')]);return db[_0x5712('0x73')]['count']({'where':_0x49145e['where']})[_0x5712('0x24')](function(_0x34503f){_0x3a3d27['count']=_0x34503f;if(_0xffaa42[_0x5712('0x4b')][_0x5712('0x58')]){_0x49145e[_0x5712('0x59')]=[{'model':db['CmContact'],'as':_0x5712('0x78'),'required':![]},{'model':db[_0x5712('0x79')],'as':'Owner','attributes':[_0x5712('0x3e'),_0x5712('0x7a'),'internal'],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id','name',_0x5712('0x7b')],'where':_0xffaa42['query'][_0x5712('0x7c')]?{'id':_0xffaa42[_0x5712('0x4b')][_0x5712('0x7c')]}:undefined,'required':_0xffaa42[_0x5712('0x4b')][_0x5712('0x7c')]?!![]:![]}];}return db['FaxInteraction'][_0x5712('0x5a')](_0x49145e);})['then'](function(_0x560493){_0x3a3d27[_0x5712('0x5b')]=_0x560493;return _0x3a3d27;});}})[_0x5712('0x24')](respondWithFilteredResult(_0x4e6b3c,_0x49145e))[_0x5712('0x2e')](handleError(_0x4e6b3c,null));};exports['addApplications']=function(_0x73c82e,_0x3fe90c,_0x1dabc9){return db['FaxAccount']['findOne']({'where':{'id':_0x73c82e[_0x5712('0x5d')]['id']}})[_0x5712('0x24')](handleEntityNotFound(_0x3fe90c,null))[_0x5712('0x24')](function(_0x3faca6){if(_0x3faca6){return db[_0x5712('0x7d')][_0x5712('0x7e')](function(_0x3da648){return db[_0x5712('0x7f')]['destroy']({'where':{'FaxAccountId':_0x73c82e[_0x5712('0x5d')]['id']},'transaction':_0x3da648})[_0x5712('0x24')](function(_0x2514e5){var _0x56f622=_[_0x5712('0x6e')](_0x73c82e['body'],function(_0x123bf9){_0x123bf9[_0x5712('0x6f')]=_0x73c82e[_0x5712('0x5d')]['id'];return _0x123bf9;});return db[_0x5712('0x7f')][_0x5712('0x80')](_0x56f622,{'transaction':_0x3da648});});})[_0x5712('0x24')](function(){return db[_0x5712('0x7f')][_0x5712('0x81')]({'where':{'FaxAccountId':_0x73c82e[_0x5712('0x5d')]['id']},'order':_0x5712('0x82')});});}})[_0x5712('0x24')](respondWithResult(_0x3fe90c,null))[_0x5712('0x2e')](handleError(_0x3fe90c,null));};exports['getApplications']=function(_0x1af6f5,_0x2b0887,_0x510b6f){var _0x2f6799={};var _0x44776b={};var _0x32bf24;var _0x2f7839;return db[_0x5712('0x41')][_0x5712('0x77')]({'where':{'id':_0x1af6f5[_0x5712('0x5d')]['id']}})['then'](handleEntityNotFound(_0x2b0887,null))[_0x5712('0x24')](function(_0x103730){if(_0x103730){_0x32bf24=_0x103730;_0x44776b[_0x5712('0x45')]=_[_0x5712('0x46')](db[_0x5712('0x7f')][_0x5712('0x42')]);_0x44776b['query']=_[_0x5712('0x46')](_0x1af6f5[_0x5712('0x4b')]);_0x44776b[_0x5712('0x47')]=_['intersection'](_0x44776b[_0x5712('0x45')],_0x44776b[_0x5712('0x4b')]);_0x2f6799['attributes']=_[_0x5712('0x48')](_0x44776b[_0x5712('0x45')],qs['fields'](_0x1af6f5[_0x5712('0x4b')][_0x5712('0x4a')]));_0x2f6799[_0x5712('0x49')]=_0x2f6799[_0x5712('0x49')][_0x5712('0x4c')]?_0x2f6799[_0x5712('0x49')]:_0x44776b[_0x5712('0x45')];_0x2f6799[_0x5712('0x50')]=qs['sort'](_0x1af6f5[_0x5712('0x4b')]['sort']);_0x2f6799[_0x5712('0x52')]=qs[_0x5712('0x47')](_['pick'](_0x1af6f5[_0x5712('0x4b')],_0x44776b[_0x5712('0x47')]));if(_0x1af6f5[_0x5712('0x4b')]['filter']){_0x2f6799['where']=_['merge'](_0x2f6799['where'],{'$or':_[_0x5712('0x6e')](_0x2f6799[_0x5712('0x49')],function(_0x3f0bda){var _0x287b39={};_0x287b39[_0x3f0bda]={'$like':'%'+_0x1af6f5['query']['filter']+'%'};return _0x287b39;})});}_0x2f6799=_['merge']({},_0x2f6799,_0x1af6f5[_0x5712('0x5e')]);return _0x32bf24[_0x5712('0x83')](_0x2f6799);}})[_0x5712('0x24')](function(_0x5193b1){if(_0x5193b1){_0x2f7839=_0x5193b1['length'];if(!_0x1af6f5[_0x5712('0x4b')][_0x5712('0x4d')](_0x5712('0x4e'))){_0x2f6799[_0x5712('0x34')]=qs[_0x5712('0x34')](_0x1af6f5[_0x5712('0x4b')][_0x5712('0x34')]);_0x2f6799['offset']=qs['offset'](_0x1af6f5[_0x5712('0x4b')]['offset']);}return _0x32bf24['getApplications'](_0x2f6799);}})[_0x5712('0x24')](function(_0x281ecd){if(_0x281ecd){return _0x281ecd?{'count':_0x2f7839,'rows':_0x281ecd}:null;}})[_0x5712('0x24')](respondWithResult(_0x2b0887,null))['catch'](handleError(_0x2b0887,null));};function Extension(_0x4f914d,_0x260972,_0x3830f9,_0x62ac60){this['context']='from-voip-provider';this[_0x5712('0x84')]=_0x4f914d['localstationid'];this[_0x5712('0x85')]=_0x62ac60;this['type']='system';this['description']=_0x5712('0x86');this[_0x5712('0x6f')]=_0x4f914d['id'];this['priority']=_0x260972;this[_0x5712('0x87')]=_0x3830f9;}function createExtensionsReciveFax(_0x3a1883){var _0x11b8c8=0x1;var _0x1c547d=[];_0x1c547d[_0x5712('0x88')](new Extension(_0x3a1883,_0x11b8c8,'',_0x5712('0x89')));_0x11b8c8+=0x1;_0x1c547d['push'](new Extension(_0x3a1883,_0x11b8c8,_0x5712('0x8a'),_0x5712('0x8b')));_0x11b8c8+=0x1;for(var _0x2c289d in _0x3a1883){if(_0x3a1883[_0x5712('0x4d')](_0x2c289d)&&(_0x2c289d===_0x5712('0x8c')||_0x2c289d===_0x5712('0x8d')||_0x2c289d==='gateway'||_0x2c289d===_0x5712('0x8e')||_0x2c289d==='headerinfo'||_0x2c289d===_0x5712('0x8f')||_0x2c289d===_0x5712('0x90')||_0x2c289d===_0x5712('0x91')||_0x2c289d===_0x5712('0x92'))){_0x1c547d[_0x5712('0x88')](new Extension(_0x3a1883,_0x11b8c8,_0x5712('0x93')+_0x2c289d+')='+_0x3a1883[_0x2c289d],_0x5712('0x8b')));_0x11b8c8+=0x1;}}_0x1c547d['push'](new Extension(_0x3a1883,_0x11b8c8,'6',_0x5712('0x94')));_0x11b8c8+=0x1;_0x1c547d[_0x5712('0x88')](new Extension(_0x3a1883,_0x11b8c8,_0x5712('0x95'),_0x5712('0x96')));_0x11b8c8=0x0;return _0x1c547d;}exports[_0x5712('0x97')]=function(_0x43c140,_0x13e279,_0x36e58a){var _0x5ad097;return db[_0x5712('0x7d')]['transaction'](function(_0x8f239a){return db['FaxAccount'][_0x5712('0x60')](_0x43c140[_0x5712('0x61')],{'transaction':_0x8f239a})['then'](function(_0x3104cc){_0x5ad097=_0x3104cc[_0x5712('0x63')]({'plain':!![]});return db[_0x5712('0x98')][_0x5712('0x80')](createExtensionsReciveFax(_0x5ad097),{'transaction':_0x8f239a});});})[_0x5712('0x24')](function(){return _0x5ad097;})['then'](respondWithResult(_0x13e279,null))[_0x5712('0x2e')](handleError(_0x13e279,null));};exports['updateAccountApplications']=function(_0x57423c,_0x45322b,_0x1356e5){var _0x98666f;return db[_0x5712('0x7d')][_0x5712('0x7e')](function(_0x2b50ad){return db['FaxAccount'][_0x5712('0x39')](_0x57423c[_0x5712('0x61')],{'where':{'id':_0x57423c[_0x5712('0x61')]['id']},'transaction':_0x2b50ad})[_0x5712('0x24')](function(_0x27ecf1){return db[_0x5712('0x98')][_0x5712('0x3a')]({'where':{'FaxAccountId':_0x57423c[_0x5712('0x61')]['id']},'transaction':_0x2b50ad})['then'](function(_0x5560a0){return db[_0x5712('0x98')][_0x5712('0x80')](createExtensionsReciveFax(_[_0x5712('0x75')](_0x57423c[_0x5712('0x61')],[_0x5712('0x99'),_0x5712('0x9a'),_0x5712('0x9b'),_0x5712('0x9c'),_0x5712('0x9d'),_0x5712('0x9e')])),{'transaction':_0x2b50ad});});});})[_0x5712('0x24')](function(){return db['FaxAccount']['findById'](_0x57423c['body']['id']);})[_0x5712('0x24')](respondWithResult(_0x45322b,null))['catch'](handleError(_0x45322b,null));};exports[_0x5712('0x9f')]=function(_0xae83a9,_0x239bb7,_0x4ed36e){var _0x1a2f66={'raw':!![],'where':{}};var _0x469bbd={};var _0x59706b={'count':0x0,'rows':[]};return db[_0x5712('0x41')]['findOne']({'where':{'id':_0xae83a9[_0x5712('0x5d')]['id']}})[_0x5712('0x24')](handleEntityNotFound(_0x239bb7,null))[_0x5712('0x24')](function(_0x377d12){if(_0x377d12){_0x469bbd[_0x5712('0x45')]=_['keys'](db['FaxMessage'][_0x5712('0x42')]);_0x469bbd[_0x5712('0x4b')]=_[_0x5712('0x46')](_0xae83a9[_0x5712('0x4b')]);_0x469bbd['filters']=_[_0x5712('0x48')](_0x469bbd['model'],_0x469bbd[_0x5712('0x4b')]);_0x1a2f66['attributes']=_[_0x5712('0x48')](_0x469bbd[_0x5712('0x45')],qs['fields'](_0xae83a9[_0x5712('0x4b')][_0x5712('0x4a')]));_0x1a2f66[_0x5712('0x49')]=_0x1a2f66[_0x5712('0x49')][_0x5712('0x4c')]?_0x1a2f66[_0x5712('0x49')]:_0x469bbd[_0x5712('0x45')];if(!_0xae83a9[_0x5712('0x4b')][_0x5712('0x4d')](_0x5712('0x4e'))){_0x1a2f66['limit']=qs[_0x5712('0x34')](_0xae83a9[_0x5712('0x4b')]['limit']);_0x1a2f66[_0x5712('0x4f')]=qs[_0x5712('0x4f')](_0xae83a9[_0x5712('0x4b')][_0x5712('0x4f')]);}_0x1a2f66[_0x5712('0x50')]=qs[_0x5712('0x51')](_0xae83a9[_0x5712('0x4b')][_0x5712('0x51')]);_0x1a2f66[_0x5712('0x52')]=qs[_0x5712('0x47')](_['pick'](_0xae83a9['query'],_0x469bbd[_0x5712('0x47')]));_0x1a2f66[_0x5712('0x52')]['FaxAccountId']=_0x377d12['id'];if(_0xae83a9[_0x5712('0x4b')][_0x5712('0x54')]){_0x1a2f66[_0x5712('0x52')]=_['merge'](_0x1a2f66[_0x5712('0x52')],{'$or':_[_0x5712('0x6e')](_0x1a2f66[_0x5712('0x49')],function(_0xaa627c){var _0x11c072={};_0x11c072[_0xaa627c]={'$like':'%'+_0xae83a9[_0x5712('0x4b')][_0x5712('0x54')]+'%'};return _0x11c072;})});}if(_0xae83a9[_0x5712('0x4b')][_0x5712('0xa0')]){var _0x58a199=_0xae83a9[_0x5712('0x4b')][_0x5712('0xa0')][_0x5712('0xa1')](',');var _0x4fccbe={};_0x4fccbe[_0x58a199[0x0]]={'$gte':moment(_0x58a199[0x1])[_0x5712('0xa2')](_0x5712('0xa3'))};_0x1a2f66['where']=_[_0x5712('0x55')](_0x1a2f66[_0x5712('0x52')],_0x4fccbe);}_0x1a2f66=_[_0x5712('0x55')]({},_0x1a2f66,_0xae83a9[_0x5712('0x5e')]);return db[_0x5712('0xa4')][_0x5712('0x57')]({'where':_0x1a2f66['where']})[_0x5712('0x24')](function(_0x49a12e){_0x59706b[_0x5712('0x57')]=_0x49a12e;if(_0xae83a9[_0x5712('0x4b')][_0x5712('0x58')]){_0x1a2f66[_0x5712('0x59')]=[{'all':!![]}];}return db[_0x5712('0xa4')][_0x5712('0x5a')](_0x1a2f66);})[_0x5712('0x24')](function(_0x16d7ab){_0x59706b[_0x5712('0x5b')]=_0x16d7ab;return _0x59706b;});}})['then'](respondWithFilteredResult(_0x239bb7,_0x1a2f66))[_0x5712('0x2e')](handleError(_0x239bb7,null));};exports[_0x5712('0xa5')]=function(_0x134962,_0x35bcd1,_0x44c262){var _0x5712f0,_0x42bbef={},_0x27b410;if(_0x134962[_0x5712('0x61')]['to']){_0x27b410=_0x134962[_0x5712('0x61')]['to'][0x0];}return db[_0x5712('0x41')][_0x5712('0x5f')]({'where':{'id':_0x134962[_0x5712('0x5d')]['id']},'include':[{'model':db['CmList'],'as':_0x5712('0xa6'),'include':[{'model':db[_0x5712('0xa7')],'as':'Contacts','where':{'fax':_0x27b410},'limit':0x1,'order':[[_0x5712('0x9c'),_0x5712('0xa8')]]}]}]})[_0x5712('0x24')](handleEntityNotFound(_0x35bcd1,null))['then'](function(_0x163bda){_0x5712f0=_0x163bda;if(_0x134962[_0x5712('0x61')][_0x5712('0xa9')]&&_0x134962[_0x5712('0x61')][_0x5712('0xa9')][_0x5712('0x4c')]){for(var _0x4ac261=0x0;_0x4ac261<_0x134962[_0x5712('0x61')]['attachments'][_0x5712('0x4c')];_0x4ac261+=0x1){_0x134962['body']['attachments'][_0x4ac261]={'filename':_0x134962[_0x5712('0x61')][_0x5712('0xa9')][_0x4ac261][_0x5712('0x3e')],'id':_0x134962[_0x5712('0x61')][_0x5712('0xa9')][_0x4ac261]['id'],'path':path[_0x5712('0xaa')](config['root'],_0x5712('0xab'),_0x134962['body'][_0x5712('0xa9')][_0x4ac261]['basename'])};}}return respondWithRpcPromise(_0x5712('0xac'),_0x5712('0xac'),{'FaxAccountId':_[_0x5712('0xad')](_0x134962[_0x5712('0x5d')]['id'])?undefined:_0x134962['params']['id'],'path':_[_0x5712('0xad')](_0x134962['body']['attachments'][0x0]['path'])?undefined:_0x134962[_0x5712('0x61')][_0x5712('0xa9')][0x0][_0x5712('0x5')],'fax':_[_0x5712('0xad')](_0x134962['body']['to'][0x0])?undefined:_0x134962[_0x5712('0x61')]['to'][0x0]},client9002);})['then'](function(){if(_0x5712f0){if(_[_0x5712('0xad')](_0x134962['body']['from'])){_0x134962[_0x5712('0x61')][_0x5712('0xae')]=util[_0x5712('0xa2')](_0x5712('0xaf'),_0x5712f0[_0x5712('0x3e')],_0x5712f0[_0x5712('0xb0')]);}if(_0x5712f0[_0x5712('0xa6')]){if(_0x5712f0[_0x5712('0xa6')][_0x5712('0xb1')][_0x5712('0x4c')]){return _0x5712f0['List'][_0x5712('0xb1')][0x0];}else{return db[_0x5712('0xa7')][_0x5712('0x60')](_['defaults'](_0x134962[_0x5712('0x61')],{'firstName':_0x134962[_0x5712('0x61')]['to'][0x0],'phone':_0x134962[_0x5712('0x61')]['to'][0x0],'fax':_0x134962[_0x5712('0x61')]['to'][0x0],'ListId':_0x5712f0[_0x5712('0x9e')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0x5712('0xb2'));}})[_0x5712('0x24')](function(_0x44f778){if(_0x44f778){return db[_0x5712('0x73')][_0x5712('0x5f')]({'where':{'ContactId':_0x44f778['id'],'closed':![],'FaxAccountId':_0x5712f0['id']}})[_0x5712('0x24')](function(_0x53968a){if(_0x53968a){return[_0x53968a,![]];}return db[_0x5712('0x73')][_0x5712('0x60')]({'UserId':_0x134962[_0x5712('0x62')]['id'],'ContactId':_0x44f778['id'],'FaxAccountId':_0x5712f0['id'],'fax':_0x134962[_0x5712('0x61')]['to'][0x0],'firstMsgDirection':_0x5712('0xb3'),'Messages':[_[_0x5712('0x55')](_0x134962['body'],{'read':![],'body':_0x134962['body'][_0x5712('0xa9')][0x0][_0x5712('0xb4')],'FaxAccountId':_0x5712f0['id'],'UserId':_0x134962[_0x5712('0x62')]['id'],'ContactId':_0x44f778['id'],'AttachmentId':_0x134962[_0x5712('0x61')][_0x5712('0xa9')][0x0]['id']})]},{'include':[{'model':db[_0x5712('0xa4')],'as':'Messages'}]})[_0x5712('0x24')](function(_0x5b4da8){return[_0x5b4da8,!![]];});});}else{throw new Error(_0x5712('0xb5'));}})[_0x5712('0xb6')](function(_0x1565ae,_0x467369){if(_0x467369){return _0x1565ae;}return db['FaxMessage'][_0x5712('0x60')]({'direction':_0x5712('0xb3'),'read':![],'body':_0x134962[_0x5712('0x61')][_0x5712('0xa9')][0x0][_0x5712('0xb4')],'FaxAccountId':_0x5712f0['id'],'FaxInteractionId':_0x1565ae['id'],'UserId':_0x134962[_0x5712('0x62')]['id'],'ContactId':_0x1565ae[_0x5712('0xb7')],'AttachmentId':_0x134962['body'][_0x5712('0xa9')][0x0]['id']})[_0x5712('0x24')](function(_0x32d3c5){_0x1565ae[_0x5712('0xb8')][_0x5712('0xb9')]=[];_0x1565ae[_0x5712('0xb8')][_0x5712('0xb9')]['push'](_0x32d3c5['dataValues']);return _0x1565ae;});})[_0x5712('0x24')](function(_0xe0409a){respondWithRpcPromise('SendFax',_0x5712('0xba'),{'FaxAccountId':_['isNil'](_0x134962[_0x5712('0x5d')]['id'])?undefined:_0x134962['params']['id'],'path':_[_0x5712('0xad')](_0x134962['body'][_0x5712('0xa9')][0x0][_0x5712('0x5')])?undefined:_0x134962[_0x5712('0x61')]['attachments'][0x0][_0x5712('0x5')],'fax':_[_0x5712('0xad')](_0x134962[_0x5712('0x61')]['to'][0x0])?undefined:_0x134962[_0x5712('0x61')]['to'][0x0],'AttachmentId':_0x134962[_0x5712('0x61')]['attachments'][0x0]['id']},client9002)[_0x5712('0x24')](function(_0x329e95){logger[_0x5712('0x2c')](_0x5712('0xbb'),_0x329e95);})[_0x5712('0x2e')](function(_0x21203d){logger[_0x5712('0x2c')](_0x5712('0xbb'),_0x21203d);});return _0xe0409a;})[_0x5712('0x24')](respondWithResult(_0x35bcd1,null))[_0x5712('0x2e')](handleError(_0x35bcd1,null));};exports['addAgents']=function(_0x5b46ab,_0x17e7d4,_0x90a0be){return db[_0x5712('0x41')][_0x5712('0x5f')]({'where':{'id':_0x5b46ab[_0x5712('0x5d')]['id']}})[_0x5712('0x24')](handleEntityNotFound(_0x17e7d4,null))[_0x5712('0x24')](function(_0x584d8e){if(_0x584d8e){return _0x584d8e[_0x5712('0xbc')](_0x5b46ab[_0x5712('0x61')][_0x5712('0x72')],_['omit'](_0x5b46ab[_0x5712('0x61')],['ids','id'])||{})[_0x5712('0xb6')](function(_0x197bb9){for(var _0x1ebe6a=0x0;_0x1ebe6a<_0x5b46ab['body'][_0x5712('0x72')]['length'];_0x1ebe6a+=0x1){socket['emit'](_0x5712('0xbd'),{'UserId':Number(_0x5b46ab[_0x5712('0x61')][_0x5712('0x72')][_0x1ebe6a]),'FaxAccountId':Number(_0x5b46ab[_0x5712('0x5d')]['id'])});}return _0x197bb9;});}})[_0x5712('0x24')](respondWithResult(_0x17e7d4,null))[_0x5712('0x2e')](handleError(_0x17e7d4,null));};exports[_0x5712('0xbe')]=function(_0x3921fc,_0x441eab,_0x55e796){return db[_0x5712('0x41')][_0x5712('0x5f')]({'where':{'id':_0x3921fc['params']['id']}})[_0x5712('0x24')](handleEntityNotFound(_0x441eab,null))[_0x5712('0x24')](function(_0x540918){if(_0x540918){return _0x540918[_0x5712('0xbe')](_0x3921fc[_0x5712('0x4b')]['ids'])[_0x5712('0x24')](function(){if(_[_0x5712('0xbf')](_0x3921fc[_0x5712('0x4b')]['ids'])){for(var _0x4a3e15=0x0;_0x4a3e15<_0x3921fc['query'][_0x5712('0x72')]['length'];_0x4a3e15+=0x1){socket['emit']('userFaxAccount:remove',{'UserId':Number(_0x3921fc[_0x5712('0x4b')][_0x5712('0x72')][_0x4a3e15]),'FaxAccountId':Number(_0x3921fc[_0x5712('0x5d')]['id'])});}}else{socket[_0x5712('0xc0')](_0x5712('0xc1'),{'UserId':Number(_0x3921fc['query'][_0x5712('0x72')]),'FaxAccountId':Number(_0x3921fc['params']['id'])});}});}})[_0x5712('0x24')](respondWithStatusCode(_0x441eab,null))[_0x5712('0x2e')](handleError(_0x441eab,null));};exports[_0x5712('0xc2')]=function(_0x469eed,_0x30d154,_0x45fc24){var _0x3b6f28={};var _0x522659={};var _0x4b36bc;var _0x226dbc;return db[_0x5712('0x41')][_0x5712('0x77')]({'where':{'id':_0x469eed[_0x5712('0x5d')]['id']}})['then'](handleEntityNotFound(_0x30d154,null))['then'](function(_0x3a261b){if(_0x3a261b){_0x4b36bc=_0x3a261b;_0x522659[_0x5712('0x45')]=_[_0x5712('0x46')](db[_0x5712('0x79')][_0x5712('0x42')]);_0x522659[_0x5712('0x4b')]=_[_0x5712('0x46')](_0x469eed[_0x5712('0x4b')]);_0x522659['filters']=_[_0x5712('0x48')](_0x522659[_0x5712('0x45')],_0x522659[_0x5712('0x4b')]);_0x3b6f28[_0x5712('0x49')]=_['intersection'](_0x522659[_0x5712('0x45')],qs[_0x5712('0x4a')](_0x469eed[_0x5712('0x4b')][_0x5712('0x4a')]));_0x3b6f28['attributes']=_0x3b6f28[_0x5712('0x49')]['length']?_0x3b6f28[_0x5712('0x49')]:_0x522659[_0x5712('0x45')];_0x3b6f28[_0x5712('0x50')]=qs[_0x5712('0x51')](_0x469eed[_0x5712('0x4b')][_0x5712('0x51')]);_0x3b6f28[_0x5712('0x52')]=qs[_0x5712('0x47')](_[_0x5712('0x53')](_0x469eed[_0x5712('0x4b')],_0x522659[_0x5712('0x47')]));if(_0x469eed[_0x5712('0x4b')][_0x5712('0x54')]){_0x3b6f28[_0x5712('0x52')]=_[_0x5712('0x55')](_0x3b6f28[_0x5712('0x52')],{'$or':_[_0x5712('0x6e')](_0x3b6f28[_0x5712('0x49')],function(_0x56afee){var _0x54607e={};_0x54607e[_0x56afee]={'$like':'%'+_0x469eed[_0x5712('0x4b')][_0x5712('0x54')]+'%'};return _0x54607e;})});}_0x3b6f28=_[_0x5712('0x55')]({},_0x3b6f28,_0x469eed['options']);return _0x4b36bc[_0x5712('0xc2')](_0x3b6f28);}})['then'](function(_0x243534){if(_0x243534){_0x226dbc=_0x243534['length'];if(!_0x469eed[_0x5712('0x4b')]['hasOwnProperty'](_0x5712('0x4e'))){_0x3b6f28[_0x5712('0x34')]=qs[_0x5712('0x34')](_0x469eed['query']['limit']);_0x3b6f28[_0x5712('0x4f')]=qs[_0x5712('0x4f')](_0x469eed['query'][_0x5712('0x4f')]);}return _0x4b36bc[_0x5712('0xc2')](_0x3b6f28);}})[_0x5712('0x24')](function(_0x40dc3c){if(_0x40dc3c){return _0x40dc3c?{'count':_0x226dbc,'rows':_0x40dc3c}:null;}})['then'](respondWithResult(_0x30d154,null))[_0x5712('0x2e')](handleError(_0x30d154,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 285b103..5e31615 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 _0xf161=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxAccount','save','update'];(function(_0x549658,_0x584f60){var _0x372d09=function(_0x36f176){while(--_0x36f176){_0x549658['push'](_0x549658['shift']());}};_0x372d09(++_0x584f60);}(_0xf161,0x1d1));var _0x1f16=function(_0x15c421,_0x6366f7){_0x15c421=_0x15c421-0x0;var _0x5e5ed5=_0xf161[_0x15c421];return _0x5e5ed5;};'use strict';var EventEmitter=require(_0x1f16('0x0'));var FaxAccount=require(_0x1f16('0x1'))['db'][_0x1f16('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1f16('0x3'),'afterUpdate':_0x1f16('0x4'),'afterDestroy':_0x1f16('0x5')};function emitEvent(_0x47bfc3){return function(_0x3b2635,_0x7b53d7,_0x30a348){FaxAccountEvents['emit'](_0x47bfc3+':'+_0x3b2635['id'],_0x3b2635);FaxAccountEvents[_0x1f16('0x6')](_0x47bfc3,_0x3b2635);_0x30a348(null);};}for(var e in events){if(events[_0x1f16('0x7')](e)){var event=events[e];FaxAccount[_0x1f16('0x8')](e,emitEvent(event));}}module[_0x1f16('0x9')]=FaxAccountEvents; \ No newline at end of file +var _0x42e5=['exports','events','../../mysqldb','FaxAccount','save','update','emit','hasOwnProperty','hook'];(function(_0x48600b,_0x2ad9a8){var _0x30a058=function(_0x14e31d){while(--_0x14e31d){_0x48600b['push'](_0x48600b['shift']());}};_0x30a058(++_0x2ad9a8);}(_0x42e5,0x172));var _0x542e=function(_0x6a47c,_0x2cbd54){_0x6a47c=_0x6a47c-0x0;var _0x1b8c47=_0x42e5[_0x6a47c];return _0x1b8c47;};'use strict';var EventEmitter=require(_0x542e('0x0'));var FaxAccount=require(_0x542e('0x1'))['db'][_0x542e('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x542e('0x3'),'afterUpdate':_0x542e('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4d08b0){return function(_0x3385c4,_0x3e3ba9,_0x22e1cb){FaxAccountEvents[_0x542e('0x5')](_0x4d08b0+':'+_0x3385c4['id'],_0x3385c4);FaxAccountEvents[_0x542e('0x5')](_0x4d08b0,_0x3385c4);_0x22e1cb(null);};}for(var e in events){if(events[_0x542e('0x6')](e)){var event=events[e];FaxAccount[_0x542e('0x7')](e,emitEvent(event));}}module[_0x542e('0x8')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 907cf7f..13b7bdc 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 _0x5825=['moment','bluebird','path','FaxAccount','fax_accounts','lodash','../../config/logger','api'];(function(_0x36ec40,_0x237c64){var _0x47ba03=function(_0x3defae){while(--_0x3defae){_0x36ec40['push'](_0x36ec40['shift']());}};_0x47ba03(++_0x237c64);}(_0x5825,0x1cd));var _0x5582=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5825[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x5582('0x0'));var util=require('util');var logger=require(_0x5582('0x1'))(_0x5582('0x2'));var moment=require(_0x5582('0x3'));var BPromise=require(_0x5582('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5582('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./faxAccount.attributes');module['exports']=function(_0x146a00,_0x300faa){return _0x146a00['define'](_0x5582('0x6'),attributes,{'tableName':_0x5582('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xef6e=['exports','define','fax_accounts','lodash','util','../../config/logger','moment','bluebird','rimraf','../../config/environment','./faxAccount.attributes'];(function(_0x33eac1,_0x479af7){var _0x3d6efc=function(_0x132b40){while(--_0x132b40){_0x33eac1['push'](_0x33eac1['shift']());}};_0x3d6efc(++_0x479af7);}(_0xef6e,0x66));var _0xeef6=function(_0x38bbf3,_0x2693a8){_0x38bbf3=_0x38bbf3-0x0;var _0x3b77e0=_0xef6e[_0x38bbf3];return _0x3b77e0;};'use strict';var _=require(_0xeef6('0x0'));var util=require(_0xeef6('0x1'));var logger=require(_0xeef6('0x2'))('api');var moment=require(_0xeef6('0x3'));var BPromise=require(_0xeef6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xeef6('0x5'));var config=require(_0xeef6('0x6'));var attributes=require(_0xeef6('0x7'));module[_0xeef6('0x8')]=function(_0x2f5ad5,_0x1c2a40){return _0x2f5ad5[_0xeef6('0x9')]('FaxAccount',attributes,{'tableName':_0xeef6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index b2272f6..f44a9df 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 _0xc4b8=['findAll','options','raw','where','limit','include','map','model','attributes','NotifyFaxAccount','fax','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','keys','createdAt','updatedAt','difference','CompanyId','ListId','body','isNil','from','from\x20is\x20mandatory','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','account','List','Contacts','FaxApplication','Applications','get','applications','list','orderBy','priority','length','create','contact','FaxInteraction','find','Contact\x20not\x20found','spread','autoclose','push','close','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','User','UserId','unshift','name','Start','startRouting','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','then','info','request\x20sent','debug','error','code','FaxAccount,\x20%s,\x20%s','message','catch','GetFaxAccount','FaxAccount'];(function(_0x100246,_0x1657ac){var _0x12ed2e=function(_0x595bd5){while(--_0x595bd5){_0x100246['push'](_0x100246['shift']());}};_0x12ed2e(++_0x1657ac);}(_0xc4b8,0x98));var _0x8c4b=function(_0x3acbbb,_0x5e07bc){_0x3acbbb=_0x3acbbb-0x0;var _0x24b96e=_0xc4b8[_0x3acbbb];return _0x24b96e;};'use strict';var _=require('lodash');var util=require(_0x8c4b('0x0'));var moment=require(_0x8c4b('0x1'));var BPromise=require(_0x8c4b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8c4b('0x3'));var db=require(_0x8c4b('0x4'))['db'];var utils=require(_0x8c4b('0x5'));var logger=require(_0x8c4b('0x6'))(_0x8c4b('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8c4b('0x8')]['http']({'port':0x232c});config[_0x8c4b('0x9')]=_[_0x8c4b('0xa')](config[_0x8c4b('0x9')],{'host':_0x8c4b('0xb'),'port':0x18eb});var socket=require(_0x8c4b('0xc'))(new Redis(config[_0x8c4b('0x9')]));require(_0x8c4b('0xd'))[_0x8c4b('0xe')](socket);function respondWithRpcPromise(_0x33e40a,_0x53e351,_0x1042d0){return new BPromise(function(_0x27db0e,_0x5eb583){return client['request'](_0x33e40a,_0x1042d0)[_0x8c4b('0xf')](function(_0xa759ba){logger[_0x8c4b('0x10')]('FaxAccount,\x20%s,\x20%s',_0x53e351,_0x8c4b('0x11'));logger[_0x8c4b('0x12')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x53e351,_0x8c4b('0x11'),JSON['stringify'](_0xa759ba));if(_0xa759ba[_0x8c4b('0x13')]){if(_0xa759ba[_0x8c4b('0x13')][_0x8c4b('0x14')]===0x1f4){logger['error'](_0x8c4b('0x15'),_0x53e351,_0xa759ba[_0x8c4b('0x13')][_0x8c4b('0x16')]);return _0x5eb583(_0xa759ba['error'][_0x8c4b('0x16')]);}logger[_0x8c4b('0x13')]('FaxAccount,\x20%s,\x20%s',_0x53e351,_0xa759ba[_0x8c4b('0x13')][_0x8c4b('0x16')]);return _0x27db0e(_0xa759ba[_0x8c4b('0x13')]['message']);}else{logger[_0x8c4b('0x10')](_0x8c4b('0x15'),_0x53e351,_0x8c4b('0x11'));_0x27db0e(_0xa759ba['result']['message']);}})[_0x8c4b('0x17')](function(_0x58ca42){logger[_0x8c4b('0x13')]('FaxAccount,\x20%s,\x20%s',_0x53e351,_0x58ca42);_0x5eb583(_0x58ca42);});});}exports[_0x8c4b('0x18')]=function(_0x12e77f){var _0x514b3d=this;return new Promise(function(_0xbd1107,_0x14696a){return db[_0x8c4b('0x19')][_0x8c4b('0x1a')]({'raw':_0x12e77f[_0x8c4b('0x1b')]?_0x12e77f['options'][_0x8c4b('0x1c')]===undefined?!![]:![]:!![],'where':_0x12e77f[_0x8c4b('0x1b')]?_0x12e77f[_0x8c4b('0x1b')][_0x8c4b('0x1d')]||null:null,'attributes':_0x12e77f[_0x8c4b('0x1b')]?_0x12e77f['options']['attributes']||null:null,'limit':_0x12e77f['options']?_0x12e77f['options'][_0x8c4b('0x1e')]||null:null,'include':_0x12e77f[_0x8c4b('0x1b')]?_0x12e77f[_0x8c4b('0x1b')][_0x8c4b('0x1f')]?_[_0x8c4b('0x20')](_0x12e77f[_0x8c4b('0x1b')][_0x8c4b('0x1f')],function(_0x170daa){return{'model':db[_0x170daa[_0x8c4b('0x21')]],'as':_0x170daa['as'],'attributes':_0x170daa[_0x8c4b('0x22')],'include':_0x170daa[_0x8c4b('0x1f')]?_[_0x8c4b('0x20')](_0x170daa[_0x8c4b('0x1f')],function(_0x49ab2f){return{'model':db[_0x49ab2f[_0x8c4b('0x21')]],'as':_0x49ab2f['as'],'attributes':_0x49ab2f[_0x8c4b('0x22')],'include':_0x49ab2f[_0x8c4b('0x1f')]?_['map'](_0x49ab2f[_0x8c4b('0x1f')],function(_0x16920c){return{'model':db[_0x16920c[_0x8c4b('0x21')]],'as':_0x16920c['as'],'attributes':_0x16920c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x24fecc){logger[_0x8c4b('0x10')](_0x8c4b('0x18'),_0x12e77f);logger[_0x8c4b('0x12')](_0x8c4b('0x18'),_0x12e77f,JSON['stringify'](_0x24fecc));_0xbd1107(_0x24fecc);})[_0x8c4b('0x17')](function(_0x57e8c6){logger[_0x8c4b('0x13')](_0x8c4b('0x18'),_0x57e8c6[_0x8c4b('0x16')],_0x12e77f);_0x14696a(_0x514b3d['error'](0x1f4,_0x57e8c6[_0x8c4b('0x16')]));});});};exports[_0x8c4b('0x23')]=function(_0x3301ad,_0x58c42c,_0x3dc708){var _0x3fbf47=this;return new Promise(function(_0x38f963,_0x1f8548){var _0x4f365a={'body':_0x3301ad['body'],'channel':_0x8c4b('0x24')};var _0x307a16=[];var _0x2897a9=[];var _0xedbe1d={};return db[_0x8c4b('0x25')][_0x8c4b('0x26')]()[_0x8c4b('0xf')](function(_0x1e1a28){if(!_0x1e1a28){throw new db[(_0x8c4b('0x27'))][(_0x8c4b('0x28'))](_0x8c4b('0x29'));}_0x307a16=_['difference'](_[_0x8c4b('0x2a')](_0x1e1a28),[_0x8c4b('0x2b'),_0x8c4b('0x2c')]);_0x2897a9=_[_0x8c4b('0x2d')](_['keys'](_0x1e1a28),['createdAt',_0x8c4b('0x2c'),_0x8c4b('0x2e'),_0x8c4b('0x2f')]);if(_0x3301ad[_0x8c4b('0x30')]['id']){delete _0x3301ad['body']['id'];}if(_[_0x8c4b('0x31')](_0x3301ad[_0x8c4b('0x30')][_0x8c4b('0x32')])){throw new db[(_0x8c4b('0x27'))][(_0x8c4b('0x28'))](_0x8c4b('0x33'));}if(_[_0x8c4b('0x31')](_0x3301ad['body'][_0x8c4b('0x30')])||_0x3301ad[_0x8c4b('0x30')][_0x8c4b('0x30')]===''){throw new db[(_0x8c4b('0x27'))]['ValidationError'](_0x8c4b('0x34'));}if(_[_0x8c4b('0x31')](_0x3301ad[_0x8c4b('0x30')][_0x8c4b('0x35')])){throw new db[(_0x8c4b('0x27'))][(_0x8c4b('0x28'))](_0x8c4b('0x36')+_0x2897a9);}if(!_[_0x8c4b('0x37')](_0x2897a9,_0x3301ad['body'][_0x8c4b('0x35')])){throw new db['Sequelize'][(_0x8c4b('0x28'))](_0x8c4b('0x38')+_0x2897a9);}_0xedbe1d[_0x3301ad['body'][_0x8c4b('0x35')]]=_0x3301ad[_0x8c4b('0x30')][_0x8c4b('0x32')];})[_0x8c4b('0xf')](function(){return db[_0x8c4b('0x19')]['find']({'where':{'id':_0x3301ad[_0x8c4b('0x39')]['id']},'include':[{'model':db['CmList'],'as':_0x8c4b('0x3a'),'include':[{'model':db[_0x8c4b('0x25')],'as':_0x8c4b('0x3b'),'where':_0xedbe1d,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0x8c4b('0x3c')],'as':_0x8c4b('0x3d')}]});})['then'](function(_0x5770e9){if(_0x5770e9&&_0x5770e9['List']){var _0x57a2c2=_0x5770e9[_0x8c4b('0x3e')]({'plain':!![]});_0x4f365a['account']=_0x57a2c2;_0x4f365a[_0x8c4b('0x3f')]=_0x57a2c2[_0x8c4b('0x3d')];_0x4f365a[_0x8c4b('0x40')]=_0x57a2c2[_0x8c4b('0x3a')];_0x4f365a['applications']=_[_0x8c4b('0x41')](_0x4f365a[_0x8c4b('0x3f')],[_0x8c4b('0x42')],['asc']);if(_0x4f365a[_0x8c4b('0x39')][_0x8c4b('0x3d')]){delete _0x4f365a[_0x8c4b('0x39')][_0x8c4b('0x3d')];}if(_0x4f365a[_0x8c4b('0x39')][_0x8c4b('0x3a')]&&_0x4f365a['account'][_0x8c4b('0x3a')][_0x8c4b('0x3b')][_0x8c4b('0x43')]){return _0x4f365a['account'][_0x8c4b('0x3a')][_0x8c4b('0x3b')][0x0];}var _0x44ee0a=_['defaults'](_0x3301ad[_0x8c4b('0x30')],{'firstName':_0x3301ad[_0x8c4b('0x30')][_0x8c4b('0x32')],'ListId':_0x57a2c2[_0x8c4b('0x2f')]});_0x44ee0a[_0x3301ad[_0x8c4b('0x30')][_0x8c4b('0x35')]]=_0x3301ad['body']['from'];return db['CmContact'][_0x8c4b('0x44')](_0x44ee0a,{'fields':_0x307a16,'raw':!![]});}})[_0x8c4b('0xf')](function(_0x3c7fa4){_0x4f365a[_0x8c4b('0x45')]=_0x3c7fa4;if(_0x3c7fa4){var _0x559c81={'ContactId':_0x3c7fa4['id'],'FaxAccountId':_0x3301ad[_0x8c4b('0x39')]['id'],'fax':_0x3c7fa4['fax']};return db[_0x8c4b('0x46')][_0x8c4b('0x47')]({'where':{'ContactId':_0x3c7fa4['id'],'closed':![],'FaxAccountId':_0x3301ad[_0x8c4b('0x39')]['id']}})[_0x8c4b('0xf')](function(_0x55ce3e){if(_0x55ce3e){return[_0x55ce3e,![]];}return db[_0x8c4b('0x46')][_0x8c4b('0x44')](_0x559c81)['then'](function(_0xcb2033){return[_0xcb2033,!![]];});});}else{throw new Error(_0x8c4b('0x48'));}})[_0x8c4b('0x49')](function(_0x3c44e5,_0x13cce1){var _0x466126=_0x3c44e5['get']({'plain':!![]});if(_0x13cce1){if(_0x4f365a[_0x8c4b('0x39')][_0x8c4b('0x4a')]){_0x4f365a[_0x8c4b('0x3f')][_0x8c4b('0x4b')]({'id':0x0,'priority':_0x4f365a[_0x8c4b('0x3f')][_0x8c4b('0x43')]+0x1,'app':_0x8c4b('0x4c'),'appdata':'unmanaged','interval':_0x8c4b('0x4d')});}_0x466126[_0x8c4b('0x4e')]=!![];}else{_0x466126[_0x8c4b('0x4e')]=![];}_0x4f365a[_0x8c4b('0x4f')]=_0x466126;return db[_0x8c4b('0x50')]['create']({'body':_0x3301ad['body'][_0x8c4b('0x30')],'FaxAccountId':_0x3301ad[_0x8c4b('0x39')]['id'],'FaxInteractionId':_0x3c44e5['id'],'direction':'in','ContactId':_0x3c44e5[_0x8c4b('0x51')],'AttachmentId':_0x3301ad[_0x8c4b('0x30')][_0x8c4b('0x52')]});})[_0x8c4b('0xf')](function(_0x220146){_0x4f365a['message']=_0x220146;if(_0x4f365a[_0x8c4b('0x4f')]['UserId']){return db[_0x8c4b('0x53')][_0x8c4b('0x47')]({'attributes':['id','name'],'where':{'id':_0x4f365a[_0x8c4b('0x4f')][_0x8c4b('0x54')]}})[_0x8c4b('0xf')](function(_0x56dd0e){if(_0x56dd0e){_0x4f365a[_0x8c4b('0x3f')][_0x8c4b('0x55')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x56dd0e[_0x8c4b('0x56')]+','+(_0x4f365a[_0x8c4b('0x39')]['waitForTheAssignedAgent']||0xa),'interval':_0x8c4b('0x4d')});}return respondWithRpcPromise(_0x8c4b('0x57'),_0x8c4b('0x58'),_0x4f365a);});}return respondWithRpcPromise(_0x8c4b('0x57'),_0x8c4b('0x58'),_0x4f365a);})[_0x8c4b('0xf')](function(_0x78a9b3){_0x38f963(_0x78a9b3);})['catch'](function(_0x4ae111){_0x1f8548(_0x3fbf47[_0x8c4b('0x13')](0x1f4,_0x4ae111[_0x8c4b('0x16')]));});});}; \ No newline at end of file +var _0xc01a=['code','message','result','GetFaxAccount','FaxAccount','options','raw','where','attributes','map','include','model','NotifyFaxAccount','body','fax','describe','ValidationError','difference','keys','createdAt','updatedAt','isNil','from','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','CmContact','Contacts','DESC','Applications','List','get','applications','priority','asc','FaxInteraction','create','spread','autoclose','push','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x44f42c,_0x565dc9){var _0x4e3130=function(_0x36d53d){while(--_0x36d53d){_0x44f42c['push'](_0x44f42c['shift']());}};_0x4e3130(++_0x565dc9);}(_0xc01a,0x136));var _0xac01=function(_0x2aabf1,_0x90f467){_0x2aabf1=_0x2aabf1-0x0;var _0x4e1aa0=_0xc01a[_0x2aabf1];return _0x4e1aa0;};'use strict';var _=require('lodash');var util=require(_0xac01('0x0'));var moment=require(_0xac01('0x1'));var BPromise=require(_0xac01('0x2'));var rs=require(_0xac01('0x3'));var fs=require('fs');var Redis=require(_0xac01('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xac01('0x5'));var logger=require(_0xac01('0x6'))('rpc');var config=require(_0xac01('0x7'));var jayson=require(_0xac01('0x8'));var client=jayson['client'][_0xac01('0x9')]({'port':0x232c});config[_0xac01('0xa')]=_[_0xac01('0xb')](config[_0xac01('0xa')],{'host':_0xac01('0xc'),'port':0x18eb});var socket=require(_0xac01('0xd'))(new Redis(config[_0xac01('0xa')]));require('./faxAccount.socket')[_0xac01('0xe')](socket);function respondWithRpcPromise(_0x583f42,_0x2c417b,_0x404c0d){return new BPromise(function(_0x39d2f2,_0x584045){return client['request'](_0x583f42,_0x404c0d)[_0xac01('0xf')](function(_0x5004d6){logger[_0xac01('0x10')](_0xac01('0x11'),_0x2c417b,_0xac01('0x12'));logger['debug'](_0xac01('0x13'),_0x2c417b,_0xac01('0x12'),JSON[_0xac01('0x14')](_0x5004d6));if(_0x5004d6[_0xac01('0x15')]){if(_0x5004d6[_0xac01('0x15')][_0xac01('0x16')]===0x1f4){logger[_0xac01('0x15')](_0xac01('0x11'),_0x2c417b,_0x5004d6[_0xac01('0x15')][_0xac01('0x17')]);return _0x584045(_0x5004d6[_0xac01('0x15')]['message']);}logger[_0xac01('0x15')](_0xac01('0x11'),_0x2c417b,_0x5004d6[_0xac01('0x15')][_0xac01('0x17')]);return _0x39d2f2(_0x5004d6[_0xac01('0x15')][_0xac01('0x17')]);}else{logger['info'](_0xac01('0x11'),_0x2c417b,_0xac01('0x12'));_0x39d2f2(_0x5004d6[_0xac01('0x18')]['message']);}})['catch'](function(_0x55e408){logger[_0xac01('0x15')]('FaxAccount,\x20%s,\x20%s',_0x2c417b,_0x55e408);_0x584045(_0x55e408);});});}exports[_0xac01('0x19')]=function(_0x4a7a40){var _0x58cbab=this;return new Promise(function(_0x3ed882,_0x34b415){return db[_0xac01('0x1a')]['findAll']({'raw':_0x4a7a40['options']?_0x4a7a40[_0xac01('0x1b')][_0xac01('0x1c')]===undefined?!![]:![]:!![],'where':_0x4a7a40[_0xac01('0x1b')]?_0x4a7a40[_0xac01('0x1b')][_0xac01('0x1d')]||null:null,'attributes':_0x4a7a40[_0xac01('0x1b')]?_0x4a7a40[_0xac01('0x1b')][_0xac01('0x1e')]||null:null,'limit':_0x4a7a40['options']?_0x4a7a40[_0xac01('0x1b')]['limit']||null:null,'include':_0x4a7a40['options']?_0x4a7a40[_0xac01('0x1b')]['include']?_[_0xac01('0x1f')](_0x4a7a40[_0xac01('0x1b')][_0xac01('0x20')],function(_0x16c98d){return{'model':db[_0x16c98d[_0xac01('0x21')]],'as':_0x16c98d['as'],'attributes':_0x16c98d['attributes'],'include':_0x16c98d[_0xac01('0x20')]?_['map'](_0x16c98d[_0xac01('0x20')],function(_0x5038ff){return{'model':db[_0x5038ff[_0xac01('0x21')]],'as':_0x5038ff['as'],'attributes':_0x5038ff[_0xac01('0x1e')],'include':_0x5038ff['include']?_['map'](_0x5038ff['include'],function(_0x1aeb5b){return{'model':db[_0x1aeb5b[_0xac01('0x21')]],'as':_0x1aeb5b['as'],'attributes':_0x1aeb5b[_0xac01('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xac01('0xf')](function(_0x28e361){logger[_0xac01('0x10')]('GetFaxAccount',_0x4a7a40);logger['debug']('GetFaxAccount',_0x4a7a40,JSON['stringify'](_0x28e361));_0x3ed882(_0x28e361);})['catch'](function(_0x2ab34d){logger['error'](_0xac01('0x19'),_0x2ab34d[_0xac01('0x17')],_0x4a7a40);_0x34b415(_0x58cbab[_0xac01('0x15')](0x1f4,_0x2ab34d[_0xac01('0x17')]));});});};exports[_0xac01('0x22')]=function(_0x50fe14,_0x1f58a8,_0x51a6f1){var _0x145b02=this;return new Promise(function(_0x3b3cd0,_0x449b7f){var _0x4f9ad0={'body':_0x50fe14[_0xac01('0x23')],'channel':_0xac01('0x24')};var _0x125c1e=[];var _0x2a74da=[];var _0x479ca2={};return db['CmContact'][_0xac01('0x25')]()[_0xac01('0xf')](function(_0x59b291){if(!_0x59b291){throw new db['Sequelize'][(_0xac01('0x26'))]('no\x20available\x20attributes');}_0x125c1e=_[_0xac01('0x27')](_[_0xac01('0x28')](_0x59b291),[_0xac01('0x29'),_0xac01('0x2a')]);_0x2a74da=_[_0xac01('0x27')](_[_0xac01('0x28')](_0x59b291),['createdAt',_0xac01('0x2a'),'CompanyId','ListId']);if(_0x50fe14['body']['id']){delete _0x50fe14[_0xac01('0x23')]['id'];}if(_[_0xac01('0x2b')](_0x50fe14['body'][_0xac01('0x2c')])){throw new db[(_0xac01('0x2d'))][(_0xac01('0x26'))](_0xac01('0x2e'));}if(_[_0xac01('0x2b')](_0x50fe14[_0xac01('0x23')][_0xac01('0x23')])||_0x50fe14[_0xac01('0x23')][_0xac01('0x23')]===''){throw new db[(_0xac01('0x2d'))][(_0xac01('0x26'))](_0xac01('0x2f'));}if(_[_0xac01('0x2b')](_0x50fe14[_0xac01('0x23')]['mapKey'])){throw new db[(_0xac01('0x2d'))][(_0xac01('0x26'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2a74da);}if(!_[_0xac01('0x30')](_0x2a74da,_0x50fe14[_0xac01('0x23')][_0xac01('0x31')])){throw new db[(_0xac01('0x2d'))]['ValidationError'](_0xac01('0x32')+_0x2a74da);}_0x479ca2[_0x50fe14['body']['mapKey']]=_0x50fe14['body']['from'];})['then'](function(){return db[_0xac01('0x1a')][_0xac01('0x33')]({'where':{'id':_0x50fe14[_0xac01('0x34')]['id']},'include':[{'model':db[_0xac01('0x35')],'as':'List','include':[{'model':db[_0xac01('0x36')],'as':_0xac01('0x37'),'where':_0x479ca2,'limit':0x1,'order':[['updatedAt',_0xac01('0x38')]]}]},{'model':db['FaxApplication'],'as':_0xac01('0x39')}]});})[_0xac01('0xf')](function(_0x41489a){if(_0x41489a&&_0x41489a[_0xac01('0x3a')]){var _0x19d499=_0x41489a[_0xac01('0x3b')]({'plain':!![]});_0x4f9ad0[_0xac01('0x34')]=_0x19d499;_0x4f9ad0[_0xac01('0x3c')]=_0x19d499['Applications'];_0x4f9ad0['list']=_0x19d499[_0xac01('0x3a')];_0x4f9ad0['applications']=_['orderBy'](_0x4f9ad0[_0xac01('0x3c')],[_0xac01('0x3d')],[_0xac01('0x3e')]);if(_0x4f9ad0['account']['Applications']){delete _0x4f9ad0[_0xac01('0x34')][_0xac01('0x39')];}if(_0x4f9ad0['account']['List']&&_0x4f9ad0[_0xac01('0x34')][_0xac01('0x3a')][_0xac01('0x37')]['length']){return _0x4f9ad0[_0xac01('0x34')][_0xac01('0x3a')][_0xac01('0x37')][0x0];}var _0x49dde2=_['defaults'](_0x50fe14[_0xac01('0x23')],{'firstName':_0x50fe14['body'][_0xac01('0x2c')],'ListId':_0x19d499['ListId']});_0x49dde2[_0x50fe14[_0xac01('0x23')][_0xac01('0x31')]]=_0x50fe14[_0xac01('0x23')]['from'];return db[_0xac01('0x36')]['create'](_0x49dde2,{'fields':_0x125c1e,'raw':!![]});}})[_0xac01('0xf')](function(_0x5d6907){_0x4f9ad0['contact']=_0x5d6907;if(_0x5d6907){var _0x4bf2b5={'ContactId':_0x5d6907['id'],'FaxAccountId':_0x50fe14['account']['id'],'fax':_0x5d6907[_0xac01('0x24')]};return db[_0xac01('0x3f')][_0xac01('0x33')]({'where':{'ContactId':_0x5d6907['id'],'closed':![],'FaxAccountId':_0x50fe14[_0xac01('0x34')]['id']}})['then'](function(_0x265267){if(_0x265267){return[_0x265267,![]];}return db[_0xac01('0x3f')][_0xac01('0x40')](_0x4bf2b5)[_0xac01('0xf')](function(_0x2f730a){return[_0x2f730a,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xac01('0x41')](function(_0x27a9d6,_0x2d434a){var _0x591d2d=_0x27a9d6[_0xac01('0x3b')]({'plain':!![]});if(_0x2d434a){if(_0x4f9ad0[_0xac01('0x34')][_0xac01('0x42')]){_0x4f9ad0[_0xac01('0x3c')][_0xac01('0x43')]({'id':0x0,'priority':_0x4f9ad0['applications']['length']+0x1,'app':'close','appdata':_0xac01('0x44'),'interval':_0xac01('0x45')});}_0x591d2d[_0xac01('0x46')]=!![];}else{_0x591d2d[_0xac01('0x46')]=![];}_0x4f9ad0[_0xac01('0x47')]=_0x591d2d;return db[_0xac01('0x48')]['create']({'body':_0x50fe14['body'][_0xac01('0x23')],'FaxAccountId':_0x50fe14[_0xac01('0x34')]['id'],'FaxInteractionId':_0x27a9d6['id'],'direction':'in','ContactId':_0x27a9d6[_0xac01('0x49')],'AttachmentId':_0x50fe14['body'][_0xac01('0x4a')]});})[_0xac01('0xf')](function(_0x1559ab){_0x4f9ad0[_0xac01('0x17')]=_0x1559ab;if(_0x4f9ad0[_0xac01('0x47')][_0xac01('0x4b')]){return db[_0xac01('0x4c')][_0xac01('0x33')]({'attributes':['id','name'],'where':{'id':_0x4f9ad0['interaction'][_0xac01('0x4b')]}})[_0xac01('0xf')](function(_0x14394a){if(_0x14394a){_0x4f9ad0[_0xac01('0x3c')][_0xac01('0x4d')]({'id':0x0,'priority':0x0,'app':_0xac01('0x4e'),'appdata':_0x14394a['name']+','+(_0x4f9ad0[_0xac01('0x34')][_0xac01('0x4f')]||0xa),'interval':_0xac01('0x45')});}return respondWithRpcPromise(_0xac01('0x50'),_0xac01('0x51'),_0x4f9ad0);});}return respondWithRpcPromise(_0xac01('0x50'),_0xac01('0x51'),_0x4f9ad0);})[_0xac01('0xf')](function(_0x2d3e2c){_0x3b3cd0(_0x2d3e2c);})[_0xac01('0x52')](function(_0x42db77){_0x449b7f(_0x145b02['error'](0x1f4,_0x42db77[_0xac01('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 5d93f00..f2c0fcb 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 _0xf3f3=['faxAccount:','./faxAccount.events','save','remove','update','emit','removeListener','register','length'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xf3f3,0x196));var _0x3f3f=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0xf3f3[_0x173441];return _0x2423a8;};'use strict';var FaxAccountEvents=require(_0x3f3f('0x0'));var events=[_0x3f3f('0x1'),_0x3f3f('0x2'),_0x3f3f('0x3')];function createListener(_0x201326,_0x5abcbd){return function(_0x193ba2){_0x5abcbd[_0x3f3f('0x4')](_0x201326,_0x193ba2);};}function removeListener(_0x52c330,_0x3a4846){return function(){FaxAccountEvents[_0x3f3f('0x5')](_0x52c330,_0x3a4846);};}exports[_0x3f3f('0x6')]=function(_0x360001){for(var _0x5748b3=0x0,_0x11e67a=events[_0x3f3f('0x7')];_0x5748b3<_0x11e67a;_0x5748b3++){var _0x5aa2a7=events[_0x5748b3];var _0x29931a=createListener(_0x3f3f('0x8')+_0x5aa2a7,_0x360001);FaxAccountEvents['on'](_0x5aa2a7,_0x29931a);}}; \ No newline at end of file +var _0x11bd=['register','length','faxAccount:','./faxAccount.events','save','remove','update','emit','removeListener'];(function(_0x4283f9,_0x59d731){var _0x57c42b=function(_0x346fd8){while(--_0x346fd8){_0x4283f9['push'](_0x4283f9['shift']());}};_0x57c42b(++_0x59d731);}(_0x11bd,0x186));var _0xd11b=function(_0x1a2fa8,_0x558b3b){_0x1a2fa8=_0x1a2fa8-0x0;var _0x268fe4=_0x11bd[_0x1a2fa8];return _0x268fe4;};'use strict';var FaxAccountEvents=require(_0xd11b('0x0'));var events=[_0xd11b('0x1'),_0xd11b('0x2'),_0xd11b('0x3')];function createListener(_0x27d2e9,_0x186c48){return function(_0x1ef90f){_0x186c48[_0xd11b('0x4')](_0x27d2e9,_0x1ef90f);};}function removeListener(_0x37b218,_0x286613){return function(){FaxAccountEvents[_0xd11b('0x5')](_0x37b218,_0x286613);};}exports[_0xd11b('0x6')]=function(_0xec1de){for(var _0x7fa05b=0x0,_0x2a27a0=events[_0xd11b('0x7')];_0x7fa05b<_0x2a27a0;_0x7fa05b++){var _0x26245b=events[_0x7fa05b];var _0x39b4d8=createListener(_0xd11b('0x8')+_0x26245b,_0xec1de);FaxAccountEvents['on'](_0x26245b,_0x39b4d8);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 9bfa499..2254dea 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(_0x182f71,_0x2a9c96){var _0x18b7e6=function(_0x3aeb15){while(--_0x3aeb15){_0x182f71['push'](_0x182f71['shift']());}};_0x18b7e6(++_0x2a9c96);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'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(_0x211ee1,_0x2eb0a3){var _0x3d1c69=function(_0x41af11){while(--_0x41af11){_0x211ee1['push'](_0x211ee1['shift']());}};_0x3d1c69(++_0x2eb0a3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'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 def5e48..1ad56b8 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 _0xba46=['TEXT','sequelize','exports','INTEGER','STRING','noop'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xba46,0x1db));var _0x6ba4=function(_0x43f19e,_0x3fd498){_0x43f19e=_0x43f19e-0x0;var _0x335014=_0xba46[_0x43f19e];return _0x335014;};'use strict';var Sequelize=require(_0x6ba4('0x0'));module[_0x6ba4('0x1')]={'priority':{'type':Sequelize[_0x6ba4('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x6ba4('0x3')],'allowNull':![],'defaultValue':_0x6ba4('0x4')},'appdata':{'type':Sequelize[_0x6ba4('0x5')]()},'description':{'type':Sequelize[_0x6ba4('0x3')]},'interval':{'type':Sequelize[_0x6ba4('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x881c=['STRING','noop','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x2d8fc2,_0x1c461d){var _0x3a9e53=function(_0x18941c){while(--_0x18941c){_0x2d8fc2['push'](_0x2d8fc2['shift']());}};_0x3a9e53(++_0x1c461d);}(_0x881c,0xf9));var _0xc881=function(_0x2a48e3,_0x406413){_0x2a48e3=_0x2a48e3-0x0;var _0x48dec3=_0x881c[_0x2a48e3];return _0x48dec3;};'use strict';var Sequelize=require(_0xc881('0x0'));module[_0xc881('0x1')]={'priority':{'type':Sequelize[_0xc881('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xc881('0x3')],'allowNull':![],'defaultValue':_0xc881('0x4')},'appdata':{'type':Sequelize[_0xc881('0x5')]()},'description':{'type':Sequelize[_0xc881('0x3')]},'interval':{'type':Sequelize[_0xc881('0x3')],'defaultValue':_0xc881('0x6')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 8ec8992..7247f74 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 _0x418b=['show','find','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','FaxApplication','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch'];(function(_0x4e4bec,_0x20f6e3){var _0x272a69=function(_0x3ac1ce){while(--_0x3ac1ce){_0x4e4bec['push'](_0x4e4bec['shift']());}};_0x272a69(++_0x20f6e3);}(_0x418b,0xe9));var _0xb418=function(_0x4b5147,_0x1371a3){_0x4b5147=_0x4b5147-0x0;var _0x3f612a=_0x418b[_0x4b5147];return _0x3f612a;};'use strict';var emlformat=require(_0xb418('0x0'));var rimraf=require(_0xb418('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb418('0x2'));var rp=require(_0xb418('0x3'));var moment=require(_0xb418('0x4'));var BPromise=require(_0xb418('0x5'));var Mustache=require(_0xb418('0x6'));var util=require(_0xb418('0x7'));var path=require(_0xb418('0x8'));var sox=require(_0xb418('0x9'));var csv=require('to-csv');var ejs=require(_0xb418('0xa'));var fs=require('fs');var fs_extra=require(_0xb418('0xb'));var _=require(_0xb418('0xc'));var squel=require(_0xb418('0xd'));var crypto=require(_0xb418('0xe'));var jsforce=require(_0xb418('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xb418('0x10'));var querystring=require(_0xb418('0x11'));var Papa=require('papaparse');var Redis=require(_0xb418('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb418('0x13'));var hardwareService=require(_0xb418('0x14'));var logger=require(_0xb418('0x15'))(_0xb418('0x16'));var utils=require(_0xb418('0x17'));var config=require(_0xb418('0x18'));var licenseUtil=require(_0xb418('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x16550d,_0x5e25eb){_0x5e25eb=_0x5e25eb||0xcc;return function(_0x43ecb8){if(_0x43ecb8){return _0x16550d['sendStatus'](_0x5e25eb);}return _0x16550d['status'](_0x5e25eb)[_0xb418('0x1a')]();};}function respondWithResult(_0x4581e8,_0x8f2f4){_0x8f2f4=_0x8f2f4||0xc8;return function(_0x22126e){if(_0x22126e){return _0x4581e8[_0xb418('0x1b')](_0x8f2f4)[_0xb418('0x1c')](_0x22126e);}};}function respondWithFilteredResult(_0xfe4d18,_0x18b0d8){return function(_0x1f9a12){if(_0x1f9a12){var _0xc5c70e=typeof _0x18b0d8[_0xb418('0x1d')]==='undefined'&&typeof _0x18b0d8[_0xb418('0x1e')]===_0xb418('0x1f');var _0xea790a=_0x1f9a12[_0xb418('0x20')];var _0x212ee8=_0xc5c70e?0x0:_0x18b0d8[_0xb418('0x1d')];var _0xa8a84b=_0xc5c70e?_0x1f9a12[_0xb418('0x20')]:_0x18b0d8[_0xb418('0x1d')]+_0x18b0d8['limit'];var _0x294772;if(_0xa8a84b>=_0xea790a){_0xa8a84b=_0xea790a;_0x294772=0xc8;}else{_0x294772=0xce;}_0xfe4d18['status'](_0x294772);return _0xfe4d18[_0xb418('0x21')](_0xb418('0x22'),_0x212ee8+'-'+_0xa8a84b+'/'+_0xea790a)[_0xb418('0x1c')](_0x1f9a12);}return null;};}function patchUpdates(_0x1a4535){return function(_0x2b02b5){try{jsonpatch[_0xb418('0x23')](_0x2b02b5,_0x1a4535,!![]);}catch(_0xcabc81){return BPromise[_0xb418('0x24')](_0xcabc81);}return _0x2b02b5[_0xb418('0x25')]();};}function saveUpdates(_0x2c360c,_0x36c44c){return function(_0x1816df){if(_0x1816df){return _0x1816df[_0xb418('0x26')](_0x2c360c)[_0xb418('0x27')](function(_0x2712e2){return _0x2712e2;});}return null;};}function removeEntity(_0x3eb465,_0x27dc24){return function(_0x9801c5){if(_0x9801c5){return _0x9801c5[_0xb418('0x28')]()[_0xb418('0x27')](function(){_0x3eb465['status'](0xcc)[_0xb418('0x1a')]();});}};}function handleEntityNotFound(_0x24efa2,_0x3300c1){return function(_0x4672da){if(!_0x4672da){_0x24efa2['sendStatus'](0x194);}return _0x4672da;};}function handleError(_0x41c50e,_0x4eda64){_0x4eda64=_0x4eda64||0x1f4;return function(_0x44f51b){logger['error'](_0x44f51b[_0xb418('0x29')]);if(_0x44f51b[_0xb418('0x2a')]){delete _0x44f51b['name'];}_0x41c50e['status'](_0x4eda64)[_0xb418('0x2b')](_0x44f51b);};}exports[_0xb418('0x2c')]=function(_0x4ee8f0,_0x3c480c){var _0x1901f0={},_0x19a02d={},_0x35fc27={'count':0x0,'rows':[]};var _0x52ebeb=_['map'](db[_0xb418('0x2d')][_0xb418('0x2e')],function(_0xd7eb6d){return{'name':_0xd7eb6d[_0xb418('0x2f')],'type':_0xd7eb6d['type'][_0xb418('0x30')]};});_0x19a02d[_0xb418('0x31')]=_[_0xb418('0x32')](_0x52ebeb,_0xb418('0x2a'));_0x19a02d[_0xb418('0x33')]=_[_0xb418('0x34')](_0x4ee8f0[_0xb418('0x33')]);_0x19a02d[_0xb418('0x35')]=_[_0xb418('0x36')](_0x19a02d[_0xb418('0x31')],_0x19a02d[_0xb418('0x33')]);_0x1901f0['attributes']=_['intersection'](_0x19a02d[_0xb418('0x31')],qs[_0xb418('0x37')](_0x4ee8f0[_0xb418('0x33')][_0xb418('0x37')]));_0x1901f0[_0xb418('0x38')]=_0x1901f0[_0xb418('0x38')][_0xb418('0x39')]?_0x1901f0[_0xb418('0x38')]:_0x19a02d[_0xb418('0x31')];if(!_0x4ee8f0[_0xb418('0x33')]['hasOwnProperty'](_0xb418('0x3a'))){_0x1901f0['limit']=qs['limit'](_0x4ee8f0[_0xb418('0x33')][_0xb418('0x1e')]);_0x1901f0[_0xb418('0x1d')]=qs['offset'](_0x4ee8f0[_0xb418('0x33')][_0xb418('0x1d')]);}_0x1901f0[_0xb418('0x3b')]=qs[_0xb418('0x3c')](_0x4ee8f0['query'][_0xb418('0x3c')]);_0x1901f0[_0xb418('0x3d')]=qs['filters'](_['pick'](_0x4ee8f0[_0xb418('0x33')],_0x19a02d[_0xb418('0x35')]),_0x52ebeb);if(_0x4ee8f0[_0xb418('0x33')][_0xb418('0x3e')]){_0x1901f0['where']=_[_0xb418('0x3f')](_0x1901f0[_0xb418('0x3d')],{'$or':_[_0xb418('0x32')](_0x52ebeb,function(_0x251bb5){if(_0x251bb5[_0xb418('0x40')]!==_0xb418('0x41')){var _0x1c4ed4={};_0x1c4ed4[_0x251bb5[_0xb418('0x2a')]]={'$like':'%'+_0x4ee8f0['query'][_0xb418('0x3e')]+'%'};return _0x1c4ed4;}})});}_0x1901f0=_[_0xb418('0x3f')]({},_0x1901f0,_0x4ee8f0[_0xb418('0x42')]);var _0x5bb9ab={'where':_0x1901f0[_0xb418('0x3d')]};return db[_0xb418('0x2d')][_0xb418('0x20')](_0x5bb9ab)['then'](function(_0x2be77c){_0x35fc27[_0xb418('0x20')]=_0x2be77c;if(_0x4ee8f0[_0xb418('0x33')][_0xb418('0x43')]){_0x1901f0[_0xb418('0x44')]=[{'all':!![]}];}return db[_0xb418('0x2d')][_0xb418('0x45')](_0x1901f0);})[_0xb418('0x27')](function(_0xc08207){_0x35fc27['rows']=_0xc08207;return _0x35fc27;})[_0xb418('0x27')](respondWithFilteredResult(_0x3c480c,_0x1901f0))[_0xb418('0x46')](handleError(_0x3c480c,null));};exports[_0xb418('0x47')]=function(_0x3d5baa,_0x140f1a){var _0x363643={'raw':!![],'where':{'id':_0x3d5baa['params']['id']}},_0x8a8b16={};_0x8a8b16[_0xb418('0x31')]=_[_0xb418('0x34')](db[_0xb418('0x2d')][_0xb418('0x2e')]);_0x8a8b16['query']=_[_0xb418('0x34')](_0x3d5baa[_0xb418('0x33')]);_0x8a8b16[_0xb418('0x35')]=_[_0xb418('0x36')](_0x8a8b16['model'],_0x8a8b16['query']);_0x363643[_0xb418('0x38')]=_['intersection'](_0x8a8b16[_0xb418('0x31')],qs[_0xb418('0x37')](_0x3d5baa[_0xb418('0x33')]['fields']));_0x363643[_0xb418('0x38')]=_0x363643[_0xb418('0x38')][_0xb418('0x39')]?_0x363643[_0xb418('0x38')]:_0x8a8b16[_0xb418('0x31')];if(_0x3d5baa[_0xb418('0x33')][_0xb418('0x43')]){_0x363643[_0xb418('0x44')]=[{'all':!![]}];}_0x363643=_[_0xb418('0x3f')]({},_0x363643,_0x3d5baa[_0xb418('0x42')]);return db[_0xb418('0x2d')][_0xb418('0x48')](_0x363643)['then'](handleEntityNotFound(_0x140f1a,null))['then'](respondWithResult(_0x140f1a,null))[_0xb418('0x46')](handleError(_0x140f1a,null));};exports[_0xb418('0x49')]=function(_0x5e9b6d,_0x5cb1fb){return db[_0xb418('0x2d')]['create'](_0x5e9b6d[_0xb418('0x4a')],{})[_0xb418('0x27')](respondWithResult(_0x5cb1fb,0xc9))[_0xb418('0x46')](handleError(_0x5cb1fb,null));};exports['update']=function(_0xd6d981,_0xe300f5){if(_0xd6d981[_0xb418('0x4a')]['id']){delete _0xd6d981['body']['id'];}return db[_0xb418('0x2d')][_0xb418('0x48')]({'where':{'id':_0xd6d981[_0xb418('0x4b')]['id']}})[_0xb418('0x27')](handleEntityNotFound(_0xe300f5,null))[_0xb418('0x27')](saveUpdates(_0xd6d981[_0xb418('0x4a')],null))['then'](respondWithResult(_0xe300f5,null))['catch'](handleError(_0xe300f5,null));};exports[_0xb418('0x28')]=function(_0x480c80,_0x57cf57){return db[_0xb418('0x2d')][_0xb418('0x48')]({'where':{'id':_0x480c80[_0xb418('0x4b')]['id']}})['then'](handleEntityNotFound(_0x57cf57,null))[_0xb418('0x27')](removeEntity(_0x57cf57,null))[_0xb418('0x46')](handleError(_0x57cf57,null));}; \ No newline at end of file +var _0x5985=['findAll','rows','catch','show','params','rawAttributes','options','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','map','FaxApplication','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','filter','includeAll','include'];(function(_0x3b227a,_0x3f0d7f){var _0x4d67a8=function(_0x3846d9){while(--_0x3846d9){_0x3b227a['push'](_0x3b227a['shift']());}};_0x4d67a8(++_0x3f0d7f);}(_0x5985,0xa7));var _0x5598=function(_0x572d93,_0x5518fc){_0x572d93=_0x572d93-0x0;var _0x3d522e=_0x5985[_0x572d93];return _0x3d522e;};'use strict';var emlformat=require(_0x5598('0x0'));var rimraf=require(_0x5598('0x1'));var zipdir=require(_0x5598('0x2'));var jsonpatch=require(_0x5598('0x3'));var rp=require(_0x5598('0x4'));var moment=require(_0x5598('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5598('0x6'));var util=require(_0x5598('0x7'));var path=require(_0x5598('0x8'));var sox=require(_0x5598('0x9'));var csv=require(_0x5598('0xa'));var ejs=require(_0x5598('0xb'));var fs=require('fs');var fs_extra=require(_0x5598('0xc'));var _=require(_0x5598('0xd'));var squel=require(_0x5598('0xe'));var crypto=require(_0x5598('0xf'));var jsforce=require(_0x5598('0x10'));var deskjs=require(_0x5598('0x11'));var toCsv=require(_0x5598('0xa'));var querystring=require(_0x5598('0x12'));var Papa=require(_0x5598('0x13'));var Redis=require(_0x5598('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x5598('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5598('0x16'));var logger=require(_0x5598('0x17'))(_0x5598('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5598('0x19'));var db=require(_0x5598('0x1a'))['db'];function respondWithStatusCode(_0x57ae1e,_0x36b25d){_0x36b25d=_0x36b25d||0xcc;return function(_0x3f87ce){if(_0x3f87ce){return _0x57ae1e[_0x5598('0x1b')](_0x36b25d);}return _0x57ae1e[_0x5598('0x1c')](_0x36b25d)[_0x5598('0x1d')]();};}function respondWithResult(_0x5d3303,_0x2f6f37){_0x2f6f37=_0x2f6f37||0xc8;return function(_0x33bfac){if(_0x33bfac){return _0x5d3303['status'](_0x2f6f37)['json'](_0x33bfac);}};}function respondWithFilteredResult(_0x466bc6,_0x50df62){return function(_0x253553){if(_0x253553){var _0xd74f46=typeof _0x50df62[_0x5598('0x1e')]===_0x5598('0x1f')&&typeof _0x50df62[_0x5598('0x20')]===_0x5598('0x1f');var _0x5cd16c=_0x253553['count'];var _0x42e386=_0xd74f46?0x0:_0x50df62[_0x5598('0x1e')];var _0x5e7eaf=_0xd74f46?_0x253553[_0x5598('0x21')]:_0x50df62[_0x5598('0x1e')]+_0x50df62[_0x5598('0x20')];var _0x45dbb5;if(_0x5e7eaf>=_0x5cd16c){_0x5e7eaf=_0x5cd16c;_0x45dbb5=0xc8;}else{_0x45dbb5=0xce;}_0x466bc6[_0x5598('0x1c')](_0x45dbb5);return _0x466bc6[_0x5598('0x22')](_0x5598('0x23'),_0x42e386+'-'+_0x5e7eaf+'/'+_0x5cd16c)['json'](_0x253553);}return null;};}function patchUpdates(_0x3a00b6){return function(_0x28ff58){try{jsonpatch[_0x5598('0x24')](_0x28ff58,_0x3a00b6,!![]);}catch(_0x1bff25){return BPromise[_0x5598('0x25')](_0x1bff25);}return _0x28ff58[_0x5598('0x26')]();};}function saveUpdates(_0x590579,_0x3119){return function(_0x3b08ac){if(_0x3b08ac){return _0x3b08ac[_0x5598('0x27')](_0x590579)[_0x5598('0x28')](function(_0x261690){return _0x261690;});}return null;};}function removeEntity(_0x223c3f,_0x164c50){return function(_0x17433d){if(_0x17433d){return _0x17433d['destroy']()[_0x5598('0x28')](function(){_0x223c3f['status'](0xcc)[_0x5598('0x1d')]();});}};}function handleEntityNotFound(_0x1137b3,_0x57e3b4){return function(_0x45abc9){if(!_0x45abc9){_0x1137b3[_0x5598('0x1b')](0x194);}return _0x45abc9;};}function handleError(_0xe973c4,_0x4a3146){_0x4a3146=_0x4a3146||0x1f4;return function(_0x284229){logger['error'](_0x284229[_0x5598('0x29')]);if(_0x284229[_0x5598('0x2a')]){delete _0x284229[_0x5598('0x2a')];}_0xe973c4[_0x5598('0x1c')](_0x4a3146)[_0x5598('0x2b')](_0x284229);};}exports[_0x5598('0x2c')]=function(_0x1e6893,_0x4b4f72){var _0x52e434={},_0x2f0ace={},_0x57357a={'count':0x0,'rows':[]};var _0xa7bcb8=_[_0x5598('0x2d')](db[_0x5598('0x2e')]['rawAttributes'],function(_0x21bd22){return{'name':_0x21bd22[_0x5598('0x2f')],'type':_0x21bd22[_0x5598('0x30')][_0x5598('0x31')]};});_0x2f0ace[_0x5598('0x32')]=_[_0x5598('0x2d')](_0xa7bcb8,_0x5598('0x2a'));_0x2f0ace[_0x5598('0x33')]=_[_0x5598('0x34')](_0x1e6893[_0x5598('0x33')]);_0x2f0ace[_0x5598('0x35')]=_[_0x5598('0x36')](_0x2f0ace['model'],_0x2f0ace['query']);_0x52e434[_0x5598('0x37')]=_[_0x5598('0x36')](_0x2f0ace[_0x5598('0x32')],qs[_0x5598('0x38')](_0x1e6893[_0x5598('0x33')][_0x5598('0x38')]));_0x52e434[_0x5598('0x37')]=_0x52e434[_0x5598('0x37')][_0x5598('0x39')]?_0x52e434[_0x5598('0x37')]:_0x2f0ace[_0x5598('0x32')];if(!_0x1e6893[_0x5598('0x33')]['hasOwnProperty'](_0x5598('0x3a'))){_0x52e434[_0x5598('0x20')]=qs[_0x5598('0x20')](_0x1e6893['query'][_0x5598('0x20')]);_0x52e434['offset']=qs[_0x5598('0x1e')](_0x1e6893[_0x5598('0x33')][_0x5598('0x1e')]);}_0x52e434[_0x5598('0x3b')]=qs[_0x5598('0x3c')](_0x1e6893[_0x5598('0x33')][_0x5598('0x3c')]);_0x52e434[_0x5598('0x3d')]=qs[_0x5598('0x35')](_[_0x5598('0x3e')](_0x1e6893['query'],_0x2f0ace[_0x5598('0x35')]),_0xa7bcb8);if(_0x1e6893[_0x5598('0x33')]['filter']){_0x52e434['where']=_[_0x5598('0x3f')](_0x52e434[_0x5598('0x3d')],{'$or':_[_0x5598('0x2d')](_0xa7bcb8,function(_0x3cb049){if(_0x3cb049['type']!=='VIRTUAL'){var _0xdc2007={};_0xdc2007[_0x3cb049['name']]={'$like':'%'+_0x1e6893[_0x5598('0x33')][_0x5598('0x40')]+'%'};return _0xdc2007;}})});}_0x52e434=_[_0x5598('0x3f')]({},_0x52e434,_0x1e6893['options']);var _0x158b9b={'where':_0x52e434[_0x5598('0x3d')]};return db['FaxApplication'][_0x5598('0x21')](_0x158b9b)[_0x5598('0x28')](function(_0x2248f4){_0x57357a[_0x5598('0x21')]=_0x2248f4;if(_0x1e6893[_0x5598('0x33')][_0x5598('0x41')]){_0x52e434[_0x5598('0x42')]=[{'all':!![]}];}return db[_0x5598('0x2e')][_0x5598('0x43')](_0x52e434);})[_0x5598('0x28')](function(_0x2d35ca){_0x57357a[_0x5598('0x44')]=_0x2d35ca;return _0x57357a;})['then'](respondWithFilteredResult(_0x4b4f72,_0x52e434))[_0x5598('0x45')](handleError(_0x4b4f72,null));};exports[_0x5598('0x46')]=function(_0x2164cc,_0x1446ba){var _0x55645a={'raw':!![],'where':{'id':_0x2164cc[_0x5598('0x47')]['id']}},_0x2da4c8={};_0x2da4c8[_0x5598('0x32')]=_['keys'](db['FaxApplication'][_0x5598('0x48')]);_0x2da4c8[_0x5598('0x33')]=_[_0x5598('0x34')](_0x2164cc[_0x5598('0x33')]);_0x2da4c8[_0x5598('0x35')]=_[_0x5598('0x36')](_0x2da4c8[_0x5598('0x32')],_0x2da4c8[_0x5598('0x33')]);_0x55645a[_0x5598('0x37')]=_[_0x5598('0x36')](_0x2da4c8[_0x5598('0x32')],qs[_0x5598('0x38')](_0x2164cc[_0x5598('0x33')]['fields']));_0x55645a[_0x5598('0x37')]=_0x55645a['attributes'][_0x5598('0x39')]?_0x55645a[_0x5598('0x37')]:_0x2da4c8[_0x5598('0x32')];if(_0x2164cc[_0x5598('0x33')][_0x5598('0x41')]){_0x55645a[_0x5598('0x42')]=[{'all':!![]}];}_0x55645a=_['merge']({},_0x55645a,_0x2164cc[_0x5598('0x49')]);return db[_0x5598('0x2e')][_0x5598('0x4a')](_0x55645a)[_0x5598('0x28')](handleEntityNotFound(_0x1446ba,null))[_0x5598('0x28')](respondWithResult(_0x1446ba,null))['catch'](handleError(_0x1446ba,null));};exports['create']=function(_0x3e175d,_0x4462f8){return db[_0x5598('0x2e')][_0x5598('0x4b')](_0x3e175d[_0x5598('0x4c')],{})['then'](respondWithResult(_0x4462f8,0xc9))[_0x5598('0x45')](handleError(_0x4462f8,null));};exports[_0x5598('0x27')]=function(_0x4494fc,_0x32a24b){if(_0x4494fc[_0x5598('0x4c')]['id']){delete _0x4494fc['body']['id'];}return db[_0x5598('0x2e')][_0x5598('0x4a')]({'where':{'id':_0x4494fc[_0x5598('0x47')]['id']}})['then'](handleEntityNotFound(_0x32a24b,null))[_0x5598('0x28')](saveUpdates(_0x4494fc[_0x5598('0x4c')],null))[_0x5598('0x28')](respondWithResult(_0x32a24b,null))['catch'](handleError(_0x32a24b,null));};exports[_0x5598('0x4d')]=function(_0x3a13a8,_0x479bcd){return db[_0x5598('0x2e')]['find']({'where':{'id':_0x3a13a8['params']['id']}})['then'](handleEntityNotFound(_0x479bcd,null))[_0x5598('0x28')](removeEntity(_0x479bcd,null))['catch'](handleError(_0x479bcd,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 9aeaade..761e758 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 _0xcdbf=['exports','define','FaxApplication','fax_applications','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x91accc,_0x3af767){var _0xd9bbc9=function(_0x2a42c2){while(--_0x2a42c2){_0x91accc['push'](_0x91accc['shift']());}};_0xd9bbc9(++_0x3af767);}(_0xcdbf,0x184));var _0xfcdb=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0xcdbf[_0x2e4aa2];return _0x5e6092;};'use strict';var _=require('lodash');var util=require(_0xfcdb('0x0'));var logger=require(_0xfcdb('0x1'))('api');var moment=require(_0xfcdb('0x2'));var BPromise=require(_0xfcdb('0x3'));var rp=require(_0xfcdb('0x4'));var fs=require('fs');var path=require(_0xfcdb('0x5'));var rimraf=require(_0xfcdb('0x6'));var config=require(_0xfcdb('0x7'));var attributes=require('./faxApplication.attributes');module[_0xfcdb('0x8')]=function(_0x5194dc,_0x3dec63){return _0x5194dc[_0xfcdb('0x9')](_0xfcdb('0xa'),attributes,{'tableName':_0xfcdb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xe94a=['../../config/environment','./faxApplication.attributes','exports','define','fax_applications','utf8mb4','lodash','../../config/logger','api','moment','request-promise'];(function(_0x137e04,_0x3c0799){var _0x4c6762=function(_0x45f489){while(--_0x45f489){_0x137e04['push'](_0x137e04['shift']());}};_0x4c6762(++_0x3c0799);}(_0xe94a,0xf8));var _0xae94=function(_0x502598,_0x1e95c8){_0x502598=_0x502598-0x0;var _0xbdee21=_0xe94a[_0x502598];return _0xbdee21;};'use strict';var _=require(_0xae94('0x0'));var util=require('util');var logger=require(_0xae94('0x1'))(_0xae94('0x2'));var moment=require(_0xae94('0x3'));var BPromise=require('bluebird');var rp=require(_0xae94('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xae94('0x5'));var attributes=require(_0xae94('0x6'));module[_0xae94('0x7')]=function(_0x3a809b,_0x29abe6){return _0x3a809b[_0xae94('0x8')]('FaxApplication',attributes,{'tableName':_0xae94('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xae94('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index b6851a6..06c2a07 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 _0xd288=['jayson/promise','client','http','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','UpdateFaxApplication','FaxApplication','update','options','raw','where','attributes','stringify','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x1f2b56,_0x4df540){var _0x2e832d=function(_0x10477d){while(--_0x10477d){_0x1f2b56['push'](_0x1f2b56['shift']());}};_0x2e832d(++_0x4df540);}(_0xd288,0x18f));var _0x8d28=function(_0x2990ee,_0x554c5e){_0x2990ee=_0x2990ee-0x0;var _0x380c70=_0xd288[_0x2990ee];return _0x380c70;};'use strict';var _=require('lodash');var util=require(_0x8d28('0x0'));var moment=require('moment');var BPromise=require(_0x8d28('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8d28('0x2'));var db=require(_0x8d28('0x3'))['db'];var utils=require(_0x8d28('0x4'));var logger=require(_0x8d28('0x5'))('rpc');var config=require(_0x8d28('0x6'));var jayson=require(_0x8d28('0x7'));var client=jayson[_0x8d28('0x8')][_0x8d28('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xd2f706,_0x1524cc,_0x3c899d){return new BPromise(function(_0x4e993d,_0x317d36){return client[_0x8d28('0xa')](_0xd2f706,_0x3c899d)[_0x8d28('0xb')](function(_0x375454){logger[_0x8d28('0xc')](_0x8d28('0xd'),_0x1524cc,_0x8d28('0xe'));logger[_0x8d28('0xf')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x1524cc,'request\x20sent',JSON['stringify'](_0x375454));if(_0x375454[_0x8d28('0x10')]){if(_0x375454[_0x8d28('0x10')][_0x8d28('0x11')]===0x1f4){logger['error'](_0x8d28('0xd'),_0x1524cc,_0x375454[_0x8d28('0x10')]['message']);return _0x317d36(_0x375454[_0x8d28('0x10')][_0x8d28('0x12')]);}logger['error'](_0x8d28('0xd'),_0x1524cc,_0x375454[_0x8d28('0x10')][_0x8d28('0x12')]);return _0x4e993d(_0x375454[_0x8d28('0x10')][_0x8d28('0x12')]);}else{logger[_0x8d28('0xc')](_0x8d28('0xd'),_0x1524cc,_0x8d28('0xe'));_0x4e993d(_0x375454[_0x8d28('0x13')][_0x8d28('0x12')]);}})[_0x8d28('0x14')](function(_0x5bd457){logger[_0x8d28('0x10')](_0x8d28('0xd'),_0x1524cc,_0x5bd457);_0x317d36(_0x5bd457);});});}exports[_0x8d28('0x15')]=function(_0x1300a4){var _0x2794d5=this;return new Promise(function(_0x460437,_0x425c2d){return db[_0x8d28('0x16')][_0x8d28('0x17')](_0x1300a4['body'],{'raw':_0x1300a4[_0x8d28('0x18')]?_0x1300a4['options'][_0x8d28('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1300a4['options']?_0x1300a4['options'][_0x8d28('0x1a')]||null:null,'attributes':_0x1300a4[_0x8d28('0x18')]?_0x1300a4[_0x8d28('0x18')][_0x8d28('0x1b')]||null:null,'limit':_0x1300a4[_0x8d28('0x18')]?_0x1300a4[_0x8d28('0x18')]['limit']||null:null})[_0x8d28('0xb')](function(_0x11e48f){logger['info'](_0x8d28('0x15'),_0x1300a4);logger['debug'](_0x8d28('0x15'),_0x1300a4,JSON[_0x8d28('0x1c')](_0x11e48f));_0x460437(_0x11e48f);})[_0x8d28('0x14')](function(_0x454c94){logger[_0x8d28('0x10')](_0x8d28('0x15'),_0x454c94[_0x8d28('0x12')],_0x1300a4);_0x425c2d(_0x2794d5[_0x8d28('0x10')](0x1f4,_0x454c94[_0x8d28('0x12')]));});});}; \ No newline at end of file +var _0x8dd6=['message','result','UpdateFaxApplication','FaxApplication','update','body','options','where','attributes','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x1aec67,_0x59d3df){var _0x5709c6=function(_0x46b7bb){while(--_0x46b7bb){_0x1aec67['push'](_0x1aec67['shift']());}};_0x5709c6(++_0x59d3df);}(_0x8dd6,0x19f));var _0x68dd=function(_0x2fa2dc,_0x37cb65){_0x2fa2dc=_0x2fa2dc-0x0;var _0xa6c429=_0x8dd6[_0x2fa2dc];return _0xa6c429;};'use strict';var _=require(_0x68dd('0x0'));var util=require('util');var moment=require(_0x68dd('0x1'));var BPromise=require(_0x68dd('0x2'));var rs=require(_0x68dd('0x3'));var fs=require('fs');var Redis=require(_0x68dd('0x4'));var db=require(_0x68dd('0x5'))['db'];var utils=require(_0x68dd('0x6'));var logger=require(_0x68dd('0x7'))(_0x68dd('0x8'));var config=require('../../config/environment');var jayson=require(_0x68dd('0x9'));var client=jayson['client'][_0x68dd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x437362,_0x180562,_0x5e0c96){return new BPromise(function(_0x1eb468,_0x5796f0){return client[_0x68dd('0xb')](_0x437362,_0x5e0c96)[_0x68dd('0xc')](function(_0xe42dec){logger[_0x68dd('0xd')](_0x68dd('0xe'),_0x180562,_0x68dd('0xf'));logger[_0x68dd('0x10')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x180562,'request\x20sent',JSON[_0x68dd('0x11')](_0xe42dec));if(_0xe42dec[_0x68dd('0x12')]){if(_0xe42dec['error'][_0x68dd('0x13')]===0x1f4){logger['error'](_0x68dd('0xe'),_0x180562,_0xe42dec[_0x68dd('0x12')][_0x68dd('0x14')]);return _0x5796f0(_0xe42dec[_0x68dd('0x12')]['message']);}logger[_0x68dd('0x12')](_0x68dd('0xe'),_0x180562,_0xe42dec['error']['message']);return _0x1eb468(_0xe42dec[_0x68dd('0x12')][_0x68dd('0x14')]);}else{logger[_0x68dd('0xd')](_0x68dd('0xe'),_0x180562,_0x68dd('0xf'));_0x1eb468(_0xe42dec[_0x68dd('0x15')][_0x68dd('0x14')]);}})['catch'](function(_0x2b7318){logger[_0x68dd('0x12')]('FaxApplication,\x20%s,\x20%s',_0x180562,_0x2b7318);_0x5796f0(_0x2b7318);});});}exports[_0x68dd('0x16')]=function(_0x3af827){var _0x3ffa84=this;return new Promise(function(_0x3c486c,_0x5e370d){return db[_0x68dd('0x17')][_0x68dd('0x18')](_0x3af827[_0x68dd('0x19')],{'raw':_0x3af827['options']?_0x3af827[_0x68dd('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3af827[_0x68dd('0x1a')]?_0x3af827[_0x68dd('0x1a')][_0x68dd('0x1b')]||null:null,'attributes':_0x3af827[_0x68dd('0x1a')]?_0x3af827['options'][_0x68dd('0x1c')]||null:null,'limit':_0x3af827['options']?_0x3af827[_0x68dd('0x1a')]['limit']||null:null})['then'](function(_0x29b64a){logger[_0x68dd('0xd')](_0x68dd('0x16'),_0x3af827);logger[_0x68dd('0x10')](_0x68dd('0x16'),_0x3af827,JSON[_0x68dd('0x11')](_0x29b64a));_0x3c486c(_0x29b64a);})['catch'](function(_0x3197c9){logger['error'](_0x68dd('0x16'),_0x3197c9['message'],_0x3af827);_0x5e370d(_0x3ffa84[_0x68dd('0x12')](0x1f4,_0x3197c9[_0x68dd('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 70562e1..5752564 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 _0x9354=['Router','fs-extra','../../components/auth/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','show','put','update','delete','exports','util','path','express'];(function(_0x168d5b,_0xb436da){var _0x316557=function(_0x2e471b){while(--_0x2e471b){_0x168d5b['push'](_0x168d5b['shift']());}};_0x316557(++_0xb436da);}(_0x9354,0x96));var _0x4935=function(_0x3ed4d7,_0x3783e0){_0x3ed4d7=_0x3ed4d7-0x0;var _0x2be1a4=_0x9354[_0x3ed4d7];return _0x2be1a4;};'use strict';var multer=require('multer');var util=require(_0x4935('0x0'));var path=require(_0x4935('0x1'));var timeout=require('connect-timeout');var express=require(_0x4935('0x2'));var router=express[_0x4935('0x3')]();var fs_extra=require(_0x4935('0x4'));var auth=require(_0x4935('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4935('0x6'));var controller=require(_0x4935('0x7'));router[_0x4935('0x8')]('/',auth[_0x4935('0x9')](),controller[_0x4935('0xa')]);router[_0x4935('0x8')](_0x4935('0xb'),auth[_0x4935('0x9')](),controller[_0x4935('0xc')]);router['post']('/',auth[_0x4935('0x9')](),controller['create']);router[_0x4935('0xd')](_0x4935('0xb'),auth[_0x4935('0x9')](),controller[_0x4935('0xe')]);router[_0x4935('0xf')](_0x4935('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x4935('0x10')]=router; \ No newline at end of file +var _0x6e6c=['delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','post','create','update'];(function(_0x20a558,_0x160e0e){var _0x53d3f7=function(_0x259bd8){while(--_0x259bd8){_0x20a558['push'](_0x20a558['shift']());}};_0x53d3f7(++_0x160e0e);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x6e6c[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0xc6e6('0x0'));var util=require(_0xc6e6('0x1'));var path=require('path');var timeout=require(_0xc6e6('0x2'));var express=require(_0xc6e6('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc6e6('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc6e6('0x5'));var controller=require('./faxApplication.controller');router[_0xc6e6('0x6')]('/',auth[_0xc6e6('0x7')](),controller['index']);router[_0xc6e6('0x6')](_0xc6e6('0x8'),auth['isAuthenticated'](),controller[_0xc6e6('0x9')]);router[_0xc6e6('0xa')]('/',auth['isAuthenticated'](),controller[_0xc6e6('0xb')]);router['put'](_0xc6e6('0x8'),auth[_0xc6e6('0x7')](),controller[_0xc6e6('0xc')]);router[_0xc6e6('0xd')](_0xc6e6('0x8'),auth[_0xc6e6('0x7')](),controller[_0xc6e6('0xe')]);module[_0xc6e6('0xf')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 46a6912..d4b37c6 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 _0x0fb1=['ENUM','sequelize','exports','DATE','STRING'];(function(_0xc498b3,_0x5610b4){var _0x1e2530=function(_0x5c6e08){while(--_0x5c6e08){_0xc498b3['push'](_0xc498b3['shift']());}};_0x1e2530(++_0x5610b4);}(_0x0fb1,0x1be));var _0x10fb=function(_0x4bccfa,_0x30a740){_0x4bccfa=_0x4bccfa-0x0;var _0x5f3008=_0x0fb1[_0x4bccfa];return _0x5f3008;};'use strict';var Sequelize=require(_0x10fb('0x0'));module[_0x10fb('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x10fb('0x2')]},'disposition':{'type':Sequelize[_0x10fb('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x10fb('0x3')]},'read1stAt':{'type':Sequelize[_0x10fb('0x2')]},'fax':{'type':Sequelize[_0x10fb('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x10fb('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x10fb('0x4')]('in','out'),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x53a0=['BOOLEAN','STRING','DATE','ENUM','out','exports'];(function(_0x7fb44a,_0xe164b1){var _0x394c49=function(_0x2313cc){while(--_0x2313cc){_0x7fb44a['push'](_0x7fb44a['shift']());}};_0x394c49(++_0xe164b1);}(_0x53a0,0x155));var _0x053a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x53a0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module[_0x053a('0x0')]={'closed':{'type':Sequelize[_0x053a('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x053a('0x2')]},'secondDisposition':{'type':Sequelize[_0x053a('0x2')]},'thirdDisposition':{'type':Sequelize[_0x053a('0x2')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x053a('0x3')]},'fax':{'type':Sequelize[_0x053a('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x053a('0x4')]('in',_0x053a('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x053a('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x053a('0x5')),'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 217f8cc..b8e3d41 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 _0x70fb=['$substring','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','buildExpression','text','Tag','split','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','UserId','start','body','some','compact','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','createdAt','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','DESC','isEmpty','t.id\x20IN\x20?','user','role','i.FaxAccountId\x20IS\x20NULL','agent','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','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','contactName','i.*','c.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','all','rows','params','includeAll','include','FaxInteraction','create','update','destroy','describe','addMessage','FaxMessage','ids','findOne','FaxInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','omit','spread','emit','faxInteractionTags:save','removeTags','download','unix','join','server','files','tmp','transcript-%d-%s.zip','Messages','get','mkdirSync','Attachment','basename','existsSync','createReadStream','pipe','createWriteStream','resolve','log','err','eml-format','fast-json-patch','request-promise','mustache','util','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','save','then','stack','name','send','Users','map','TagIds','Tags','forEach','push','catch','rawAttributes','fieldName','type','key','query','keys','filters','model','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','select','field','color','from','u.id','u.fullname','ui.FaxInteractionId','user_has_fax_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_accounts','fax_messages','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','tools_tags','expr','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200'];(function(_0x4782af,_0x4dff5e){var _0x533a07=function(_0xee9c29){while(--_0xee9c29){_0x4782af['push'](_0x4782af['shift']());}};_0x533a07(++_0x4dff5e);}(_0x70fb,0x144));var _0xb70f=function(_0x2965d6,_0x4f3c54){_0x2965d6=_0x2965d6-0x0;var _0x122ef7=_0x70fb[_0x2965d6];return _0x122ef7;};'use strict';var emlformat=require(_0xb70f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb70f('0x1'));var rp=require(_0xb70f('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb70f('0x3'));var util=require(_0xb70f('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0xb70f('0x5'));var ejs=require(_0xb70f('0x6'));var fs=require('fs');var fs_extra=require(_0xb70f('0x7'));var _=require(_0xb70f('0x8'));var squel=require(_0xb70f('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb70f('0xa'));var toCsv=require('to-csv');var querystring=require(_0xb70f('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb70f('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0xb70f('0xd'));var hardwareService=require(_0xb70f('0xe'));var logger=require(_0xb70f('0xf'))(_0xb70f('0x10'));var utils=require(_0xb70f('0x11'));var config=require(_0xb70f('0x12'));var licenseUtil=require(_0xb70f('0x13'));var db=require('../../mysqldb')['db'];config[_0xb70f('0x14')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xb70f('0x15'))(new Redis(config[_0xb70f('0x14')]));require(_0xb70f('0x16'))[_0xb70f('0x17')](socket);function respondWithStatusCode(_0x47016c,_0x54135a){_0x54135a=_0x54135a||0xcc;return function(_0x46e728){if(_0x46e728){return _0x47016c[_0xb70f('0x18')](_0x54135a);}return _0x47016c[_0xb70f('0x19')](_0x54135a)[_0xb70f('0x1a')]();};}function respondWithResult(_0x3430e7,_0x2aeaf8){_0x2aeaf8=_0x2aeaf8||0xc8;return function(_0x502550){if(_0x502550){return _0x3430e7[_0xb70f('0x19')](_0x2aeaf8)['json'](_0x502550);}};}function respondWithFilteredResult(_0x12a7f9,_0x5e0e0a){return function(_0x9e1a5e){if(_0x9e1a5e){var _0xcfd8d9=typeof _0x5e0e0a[_0xb70f('0x1b')]===_0xb70f('0x1c')&&typeof _0x5e0e0a[_0xb70f('0x1d')]==='undefined';var _0xdea8c3=_0x9e1a5e[_0xb70f('0x1e')];var _0x50063d=_0xcfd8d9?0x0:_0x5e0e0a[_0xb70f('0x1b')];var _0x55d464=_0xcfd8d9?_0x9e1a5e[_0xb70f('0x1e')]:_0x5e0e0a[_0xb70f('0x1b')]+_0x5e0e0a[_0xb70f('0x1d')];var _0x5b0c55;if(_0x55d464>=_0xdea8c3){_0x55d464=_0xdea8c3;_0x5b0c55=0xc8;}else{_0x5b0c55=0xce;}_0x12a7f9[_0xb70f('0x19')](_0x5b0c55);return _0x12a7f9[_0xb70f('0x1f')]('Content-Range',_0x50063d+'-'+_0x55d464+'/'+_0xdea8c3)[_0xb70f('0x20')](_0x9e1a5e);}return null;};}function patchUpdates(_0x36fdae){return function(_0x1e7c50){try{jsonpatch[_0xb70f('0x21')](_0x1e7c50,_0x36fdae,!![]);}catch(_0x29226f){return BPromise['reject'](_0x29226f);}return _0x1e7c50[_0xb70f('0x22')]();};}function saveUpdates(_0x281d0,_0x2c0409){return function(_0x3d2abc){if(_0x3d2abc){return _0x3d2abc['update'](_0x281d0)[_0xb70f('0x23')](function(_0x59bf87){return _0x59bf87;});}return null;};}function removeEntity(_0x90a825,_0x38c6ee){return function(_0x168a79){if(_0x168a79){return _0x168a79['destroy']()[_0xb70f('0x23')](function(){_0x90a825[_0xb70f('0x19')](0xcc)[_0xb70f('0x1a')]();});}};}function handleEntityNotFound(_0xeb40aa,_0x2ae5b7){return function(_0x540d44){if(!_0x540d44){_0xeb40aa[_0xb70f('0x18')](0x194);}return _0x540d44;};}function handleError(_0x260d98,_0x29432c){_0x29432c=_0x29432c||0x1f4;return function(_0x1cfea8){logger['error'](_0x1cfea8[_0xb70f('0x24')]);if(_0x1cfea8['name']){delete _0x1cfea8[_0xb70f('0x25')];}_0x260d98['status'](_0x29432c)[_0xb70f('0x26')](_0x1cfea8);};}function getInteractionUsers(_0x25a10e,_0x43a692){return new BPromise(function(_0x57550a,_0xe83214){try{if(_0x43a692[_0x25a10e['id']]){_0x25a10e[_0xb70f('0x27')]=_[_0xb70f('0x28')](_0x43a692[_0x25a10e['id']],function(_0x33448d){return{'id':_0x33448d['id'],'fullname':_0x33448d['fullname']};});}}catch(_0x2ec02a){_0xe83214(_0x2ec02a);}_0x57550a(_0x25a10e);});}function getInteractionTags(_0x58a8a3,_0x47dbad){return new BPromise(function(_0x16a8a4,_0x4d46d9){try{if(_0x58a8a3[_0xb70f('0x29')]){_0x58a8a3[_0xb70f('0x2a')]=[];_0x58a8a3[_0xb70f('0x29')]['split'](',')[_0xb70f('0x2b')](function(_0x977d34){_0x58a8a3[_0xb70f('0x2a')][_0xb70f('0x2c')](_0x47dbad[_0x977d34]);});}delete _0x58a8a3[_0xb70f('0x29')];}catch(_0x34bbdf){_0x4d46d9(_0x34bbdf);}_0x16a8a4(_0x58a8a3);});}function updateFaxInteraction(_0x45936f,_0x2e0029,_0x34a9a2){return new BPromise(function(_0x36ad18,_0x2819c5){return getInteractionUsers(_0x45936f,_0x34a9a2)[_0xb70f('0x23')](function(_0x131487){return getInteractionTags(_0x131487,_0x2e0029);})[_0xb70f('0x23')](function(_0x29e234){_0x36ad18(_0x29e234);})[_0xb70f('0x2d')](function(_0x1460f3){_0x2819c5(_0x1460f3);});});}exports['index']=function(_0x523592,_0x31cedc){var _0x150dd5={},_0x25baea={},_0x44b57={'count':0x0,'rows':[]};var _0x28219e=_[_0xb70f('0x28')](db['FaxInteraction'][_0xb70f('0x2e')],function(_0x37e7e3){return{'name':_0x37e7e3[_0xb70f('0x2f')],'type':_0x37e7e3[_0xb70f('0x30')][_0xb70f('0x31')]};});_0x25baea['model']=_['map'](_0x28219e,'name');_0x25baea[_0xb70f('0x32')]=_[_0xb70f('0x33')](_0x523592[_0xb70f('0x32')]);_0x25baea[_0xb70f('0x34')]=_['intersection'](_0x25baea[_0xb70f('0x35')],_0x25baea[_0xb70f('0x32')]);_0x150dd5['attributes']=_[_0xb70f('0x36')](_0x25baea[_0xb70f('0x35')],qs['fields'](_0x523592['query'][_0xb70f('0x37')]));_0x150dd5[_0xb70f('0x38')]=_0x150dd5[_0xb70f('0x38')][_0xb70f('0x39')]?_0x150dd5[_0xb70f('0x38')]:_0x25baea['model'];if(!_0x523592[_0xb70f('0x32')][_0xb70f('0x3a')]('nolimit')){_0x150dd5[_0xb70f('0x1d')]=qs[_0xb70f('0x1d')](_0x523592[_0xb70f('0x32')][_0xb70f('0x1d')]);_0x150dd5[_0xb70f('0x1b')]=qs['offset'](_0x523592[_0xb70f('0x32')][_0xb70f('0x1b')]);}_0x150dd5[_0xb70f('0x3b')]=qs['sort'](_0x523592[_0xb70f('0x32')][_0xb70f('0x3c')]);_0x150dd5[_0xb70f('0x3d')]=qs[_0xb70f('0x34')](_[_0xb70f('0x3e')](_0x523592[_0xb70f('0x32')],_0x25baea[_0xb70f('0x34')]),_0x28219e);var _0xbdce55=[];var _0x3ce6c9=squel[_0xb70f('0x3f')]()['field']('id')[_0xb70f('0x40')](_0xb70f('0x25'))[_0xb70f('0x40')](_0xb70f('0x41'))[_0xb70f('0x42')]('tools_tags');var _0x3af045=squel[_0xb70f('0x3f')]()[_0xb70f('0x40')](_0xb70f('0x43'))[_0xb70f('0x40')](_0xb70f('0x44'))[_0xb70f('0x40')](_0xb70f('0x45'))['from'](_0xb70f('0x46'),'ui')[_0xb70f('0x47')](_0xb70f('0x48'),'u',_0xb70f('0x49'));var _0xa28432=squel['select']()[_0xb70f('0x42')]('fax_interactions','i')[_0xb70f('0x47')](_0xb70f('0x4a'),'c',_0xb70f('0x4b'))[_0xb70f('0x47')](_0xb70f('0x48'),'o',_0xb70f('0x4c'))[_0xb70f('0x47')](_0xb70f('0x4d'),'a','a.id\x20=\x20i.FaxAccountId')[_0xb70f('0x47')](_0xb70f('0x4e'),'me','me.FaxInteractionId\x20=\x20i.id')[_0xb70f('0x47')](_0xb70f('0x4f'),'it',_0xb70f('0x50'))[_0xb70f('0x47')](_0xb70f('0x51'),'t','t.id\x20=\x20it.TagId');var _0x216495=squel[_0xb70f('0x52')]();var _0x51c0cd=[];var _0xc613f6=squel[_0xb70f('0x52')]();var _0x1da593;if(_0x523592[_0xb70f('0x32')]['search']){_0x1da593=as[_0xb70f('0x53')](_0x523592['query']['search']);var _0x3d5a54=_0x1da593[_0xb70f('0x54')];for(var _0x5f4d70=0x0;_0x5f4d70<_0x1da593[_0xb70f('0x55')][_0xb70f('0x39')];_0x5f4d70++){var _0x4e1988=_0x1da593[_0xb70f('0x55')][_0x5f4d70];var _0x2435c9='i';var _0x40763e=_[_0xb70f('0x56')](_0x28219e,[_0xb70f('0x25'),_0x4e1988[_0xb70f('0x40')]]);if(!_0x40763e){switch(_0x4e1988[_0xb70f('0x40')]){case _0xb70f('0x57'):if(_0x4e1988[_0xb70f('0x58')]==0x1){_0xa28432[_0xb70f('0x59')]('`'+_0x4e1988['field']+_0xb70f('0x5a'));}else{_0xa28432['having']('`'+_0x4e1988[_0xb70f('0x40')]+_0xb70f('0x5b'));}break;case'Contact':if(_0x4e1988['operator']===_0xb70f('0x5c')){if(_0x4e1988[_0xb70f('0x58')]['split']('\x20')[_0xb70f('0x39')]>0x1){_0x216495[_0x3d5a54](_0xb70f('0x5d'),qs[_0xb70f('0x5e')](_0x4e1988[_0xb70f('0x58')]),null);}else{var _0x189b6f='%'+_0x4e1988[_0xb70f('0x58')]+'%';_0x216495[_0x3d5a54](_0xb70f('0x5f'),_0x189b6f,_0x189b6f,_0x189b6f);}}else{_0x40763e=_['find'](_0x28219e,[_0xb70f('0x25'),_0xb70f('0x60')]);_0x4e1988['field']=_0xb70f('0x60');_0x44f754=as[_0xb70f('0x61')](_0x2435c9,_0x40763e[_0xb70f('0x30')],_0x4e1988);_0x216495[_0x3d5a54](_0x44f754[_0xb70f('0x62')],_0x44f754[_0xb70f('0x58')]['start'],_0x44f754['value'][_0xb70f('0x1a')]);}break;case _0xb70f('0x63'):var _0x561583=_0x4e1988[_0xb70f('0x58')][_0xb70f('0x64')](',')[_0xb70f('0x28')](function(_0x3411ef){return Number(_0x3411ef);});_0x561583[_0xb70f('0x2b')](function(_0x1f337e){_0xc613f6['or'](_0xb70f('0x65'),'%,'+_0x1f337e+',%');});_0x51c0cd=_[_0xb70f('0x66')](_0x51c0cd,_0x561583);break;case _0xb70f('0x67'):if(_0x4e1988[_0xb70f('0x68')]===_0xb70f('0x5c')){_0x216495[_0x3d5a54]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x4e1988[_0xb70f('0x58')]+'%',null);}else{_0x40763e=_[_0xb70f('0x56')](_0x28219e,['name',_0xb70f('0x69')]);_0x4e1988['field']=_0xb70f('0x69');_0x44f754=as[_0xb70f('0x61')](_0x2435c9,_0x40763e[_0xb70f('0x30')],_0x4e1988);_0x216495[_0x3d5a54](_0x44f754['text'],_0x44f754[_0xb70f('0x58')][_0xb70f('0x6a')],_0x44f754[_0xb70f('0x58')][_0xb70f('0x1a')]);}break;case _0xb70f('0x6b'):_0x44f754=as[_0xb70f('0x61')]('me',null,_0x4e1988);_0x216495[_0x3d5a54](_0x44f754[_0xb70f('0x62')],_0x44f754[_0xb70f('0x58')]['start'],_0x44f754[_0xb70f('0x58')][_0xb70f('0x1a')]);break;}}else{var _0x44f754=as[_0xb70f('0x61')](_0x2435c9,_0x40763e[_0xb70f('0x30')],_0x4e1988);_0x216495[_0x3d5a54](_0x44f754[_0xb70f('0x62')],_0x44f754[_0xb70f('0x58')]['start'],_0x44f754[_0xb70f('0x58')][_0xb70f('0x1a')]);}}}else{var _0x226e15=_(_0x523592['query'])[_0xb70f('0x33')]()[_0xb70f('0x28')](function(_0x1fe94c){return _[_0xb70f('0x6c')](_0x28219e,['name',_0x1fe94c])?_0x1fe94c:undefined;})[_0xb70f('0x6d')]()[_0xb70f('0x58')]();if(!_['isEmpty'](_0x226e15)){_0x226e15[_0xb70f('0x2b')](function(_0x2b4970){if(_0x2b4970===_0xb70f('0x6e')){_0xa28432[_0xb70f('0x3d')](_0xb70f('0x6f'),[][_0xb70f('0x70')](_0x523592[_0xb70f('0x32')][_0x2b4970]));}else if(_0x2b4970===_0xb70f('0x71')){var _0x2fd438=JSON['parse'](_0x523592[_0xb70f('0x32')][_0x2b4970])[_0xb70f('0x72')];var _0x5c24f=JSON['parse'](_0x523592[_0xb70f('0x32')][_0x2b4970])['$lte'];_0xa28432[_0xb70f('0x3d')](_0xb70f('0x73'),_0x2fd438,_0x5c24f);}else{if(_0x523592[_0xb70f('0x32')][_0x2b4970]==='null'){_0xa28432[_0xb70f('0x3d')]('i.'+_0x2b4970+'\x20IS\x20NULL');}else{_0xa28432[_0xb70f('0x3d')]('i.'+_0x2b4970+_0xb70f('0x74'),_0x523592['query'][_0x2b4970]);}}});}if(_0x523592[_0xb70f('0x32')][_0xb70f('0x75')]){if(_0x523592[_0xb70f('0x32')][_0xb70f('0x75')]==0x1){_0xa28432[_0xb70f('0x59')](_0xb70f('0x76'));}else{_0xa28432[_0xb70f('0x59')]('`unreadMessages`\x20>\x200');}}if(_0x523592[_0xb70f('0x32')][_0xb70f('0x77')]){_0x51c0cd=_[_0xb70f('0x78')](_0x523592[_0xb70f('0x32')][_0xb70f('0x77')])?_0x523592[_0xb70f('0x32')]['tag']:new Array(_0x523592['query'][_0xb70f('0x77')]);_0x51c0cd[_0xb70f('0x2b')](function(_0x48fdba){_0xc613f6['or'](_0xb70f('0x65'),'%,'+_0x48fdba+',%');});}if(_0x523592[_0xb70f('0x32')][_0xb70f('0x79')]){var _0x35963b=_0x523592[_0xb70f('0x32')][_0xb70f('0x79')][_0xb70f('0x7a')]('\x5c','\x5c\x5c')[_0xb70f('0x7a')](/'/g,'\x27\x27');if(qs[_0xb70f('0x7b')](_0x35963b)){_0x216495['or'](_0xb70f('0x7c'),_0x35963b+'%')['or']('i.fax\x20LIKE\x20?',_0x35963b+'%');}_0x216495['or'](_0xb70f('0x7d'),_0x35963b+'%');}}_0xa28432[_0xb70f('0x3d')](_0x216495);_0xa28432[_0xb70f('0x7e')](_0xb70f('0x7f'));var _0x10d3bc={'type':db[_0xb70f('0x80')][_0xb70f('0x81')][_0xb70f('0x82')],'raw':!![]};var _0x4567a8=_0xa28432[_0xb70f('0x83')]();_0x4567a8['field'](_0xb70f('0x7f'));_0x4567a8[_0xb70f('0x40')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xb70f('0x57'));if(_0x150dd5[_0xb70f('0x3b')]){_0x150dd5[_0xb70f('0x3b')][_0xb70f('0x2b')](function(_0x4aacaa){var _0x193997=_0x4aacaa[0x0]==='contactName'?_0x4aacaa[0x0]:'i.'+_0x4aacaa[0x0];_0xa28432[_0xb70f('0x3b')](_0x193997,_0x4aacaa[0x1]===_0xb70f('0x84')?![]:!![]);});}if(!_[_0xb70f('0x85')](_0x51c0cd)){_0xa28432[_0xb70f('0x59')](_0xc613f6);_0x4567a8[_0xb70f('0x3d')](_0xb70f('0x86'),_0x51c0cd);}BPromise['resolve']()[_0xb70f('0x23')](function(){if(!_0x1da593){if(_0x523592[_0xb70f('0x32')][_0xb70f('0x6e')])return;_0x4567a8['where']('i.FaxAccountId\x20IS\x20NOT\x20NULL');_0xa28432[_0xb70f('0x3d')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x523592[_0xb70f('0x87')][_0xb70f('0x88')]!=='agent')return;return _0x523592[_0xb70f('0x87')]['getFaxAccounts']({'attributes':['id'],'raw':!![]})[_0xb70f('0x23')](function(_0x115d4b){if(_[_0xb70f('0x85')](_0x115d4b)){_0x4567a8[_0xb70f('0x3d')](_0xb70f('0x89'));_0xa28432[_0xb70f('0x3d')]('i.FaxAccountId\x20IS\x20NULL');}else{_0x4567a8[_0xb70f('0x3d')](_0xb70f('0x6f'),_[_0xb70f('0x28')](_0x115d4b,'id'));_0xa28432['where'](_0xb70f('0x6f'),_[_0xb70f('0x28')](_0x115d4b,'id'));}});})['then'](function(){if(_0x523592[_0xb70f('0x87')]['role']===_0xb70f('0x8a')&&!_0x1da593&&!_0x523592['query'][_0xb70f('0x6e')])return[];return db['sequelize'][_0xb70f('0x32')](_0x4567a8[_0xb70f('0x8b')](),_0x10d3bc);})['then'](function(_0x5053bf){_0x44b57[_0xb70f('0x1e')]=_0x5053bf[_0xb70f('0x39')];if(_0x44b57[_0xb70f('0x1e')]===0x0)return[];return db['sequelize']['query'](_0x3ce6c9[_0xb70f('0x8b')](),_0x10d3bc)[_0xb70f('0x23')](function(_0x135edb){_0xbdce55=_[_0xb70f('0x8c')](_0x135edb,'id');_0x10d3bc=_[_0xb70f('0x8d')](_0x10d3bc,{'model':db['FaxInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x523592['query']['fields']){_0x150dd5[_0xb70f('0x38')]['forEach'](function(_0x2b3564){_0xa28432[_0xb70f('0x40')]('i.'+_0x2b3564);});}else{_0xa28432[_0xb70f('0x40')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0xa28432['field'](_0xb70f('0x8e'),_0xb70f('0x8f'));_0xa28432[_0xb70f('0x40')](_0xb70f('0x90'),'Account.mandatoryDisposition');_0xa28432[_0xb70f('0x40')](_0xb70f('0x91'),_0xb70f('0x92'));_0xa28432['field'](_0xb70f('0x93'));_0xa28432['field'](_0xb70f('0x94'),'Contact.firstName');_0xa28432[_0xb70f('0x40')]('c.lastName',_0xb70f('0x95'));_0xa28432[_0xb70f('0x40')](_0xb70f('0x96'),_0xb70f('0x97'));_0xa28432[_0xb70f('0x40')](_0xb70f('0x98'),_0xb70f('0x99'));_0xa28432[_0xb70f('0x40')](_0xb70f('0x9a'),_0xb70f('0x9b'));_0xa28432['field'](_0xb70f('0x9c'),_0xb70f('0x9d'));_0xa28432[_0xb70f('0x40')](_0xb70f('0x9e'),_0xb70f('0x9f'));_0xa28432[_0xb70f('0x40')]('o.internal',_0xb70f('0xa0'));_0xa28432[_0xb70f('0x40')](_0xb70f('0xa1'),'TagIds');}if(_0x150dd5['limit'])_0xa28432[_0xb70f('0x1d')](_0x150dd5['limit']);if(_0x150dd5[_0xb70f('0x1b')])_0xa28432[_0xb70f('0x1b')](_0x150dd5[_0xb70f('0x1b')]);return db['sequelize'][_0xb70f('0x32')](_0xa28432[_0xb70f('0x8b')](),_0x10d3bc);})[_0xb70f('0x23')](function(_0x4cabab){if(_0x4cabab[_0xb70f('0x39')]>0x0)_0x3af045['where'](_0xb70f('0xa2'),_[_0xb70f('0x28')](_0x4cabab,'id'));return db['sequelize']['query'](_0x3af045[_0xb70f('0x8b')](),_0x10d3bc)[_0xb70f('0x23')](function(_0x88db6a){var _0x3e211c=_[_0xb70f('0xa3')](_0x88db6a,'FaxInteractionId');var _0x46b618=[];_0x4cabab[_0xb70f('0x2b')](function(_0x2dcbcb){_0x46b618[_0xb70f('0x2c')](updateFaxInteraction(_0x2dcbcb,_0xbdce55,_0x3e211c));});return BPromise[_0xb70f('0xa4')](_0x46b618);});});})[_0xb70f('0x23')](function(_0x103b6e){_0x44b57[_0xb70f('0xa5')]=_0x103b6e;return _0x44b57;})[_0xb70f('0x23')](respondWithFilteredResult(_0x31cedc,_0x150dd5))[_0xb70f('0x2d')](handleError(_0x31cedc,null));};exports['show']=function(_0x481aee,_0x47e4b3){var _0x1df0d5={'raw':![],'where':{'id':_0x481aee[_0xb70f('0xa6')]['id']}},_0x4fef1a={};_0x4fef1a[_0xb70f('0x35')]=_[_0xb70f('0x33')](db['FaxInteraction'][_0xb70f('0x2e')]);_0x4fef1a[_0xb70f('0x32')]=_[_0xb70f('0x33')](_0x481aee[_0xb70f('0x32')]);_0x4fef1a[_0xb70f('0x34')]=_[_0xb70f('0x36')](_0x4fef1a[_0xb70f('0x35')],_0x4fef1a['query']);_0x1df0d5[_0xb70f('0x38')]=_['intersection'](_0x4fef1a['model'],qs[_0xb70f('0x37')](_0x481aee[_0xb70f('0x32')][_0xb70f('0x37')]));_0x1df0d5[_0xb70f('0x38')]=_0x1df0d5[_0xb70f('0x38')][_0xb70f('0x39')]?_0x1df0d5[_0xb70f('0x38')]:_0x4fef1a[_0xb70f('0x35')];if(_0x481aee['query'][_0xb70f('0xa7')]){_0x1df0d5[_0xb70f('0xa8')]=[{'all':!![]}];}_0x1df0d5=_[_0xb70f('0x8d')]({},_0x1df0d5,_0x481aee['options']);return db[_0xb70f('0xa9')][_0xb70f('0x56')](_0x1df0d5)[_0xb70f('0x23')](handleEntityNotFound(_0x47e4b3,null))['then'](respondWithResult(_0x47e4b3,null))[_0xb70f('0x2d')](handleError(_0x47e4b3,null));};exports['create']=function(_0x27bf39,_0x3ff8a9){return db['FaxInteraction'][_0xb70f('0xaa')](_0x27bf39[_0xb70f('0x6b')],{})[_0xb70f('0x23')](respondWithResult(_0x3ff8a9,0xc9))[_0xb70f('0x2d')](handleError(_0x3ff8a9,null));};exports[_0xb70f('0xab')]=function(_0x48956c,_0x951e62){if(_0x48956c['body']['id']){delete _0x48956c[_0xb70f('0x6b')]['id'];}return db[_0xb70f('0xa9')][_0xb70f('0x56')]({'where':{'id':_0x48956c[_0xb70f('0xa6')]['id']}})['then'](handleEntityNotFound(_0x951e62,null))['then'](saveUpdates(_0x48956c[_0xb70f('0x6b')],null))[_0xb70f('0x23')](respondWithResult(_0x951e62,null))[_0xb70f('0x2d')](handleError(_0x951e62,null));};exports[_0xb70f('0xac')]=function(_0x601b72,_0x223e91){return db[_0xb70f('0xa9')][_0xb70f('0x56')]({'where':{'id':_0x601b72['params']['id']}})[_0xb70f('0x23')](handleEntityNotFound(_0x223e91,null))[_0xb70f('0x23')](removeEntity(_0x223e91,null))[_0xb70f('0x2d')](handleError(_0x223e91,null));};exports[_0xb70f('0xad')]=function(_0x2b5b03,_0x4813a8){return db['FaxInteraction'][_0xb70f('0xad')]()[_0xb70f('0x23')](respondWithResult(_0x4813a8,null))[_0xb70f('0x2d')](handleError(_0x4813a8,null));};exports[_0xb70f('0xae')]=function(_0xf3f307,_0x3b34a0,_0x5aa25a){return db[_0xb70f('0xaf')][_0xb70f('0x56')]({'where':{'id':_0xf3f307[_0xb70f('0xa6')]['id']}})[_0xb70f('0x23')](handleEntityNotFound(_0x3b34a0,null))[_0xb70f('0x23')](function(_0x416ba2){if(_0x416ba2){return _0x416ba2[_0xb70f('0xae')](_0xf3f307['body'][_0xb70f('0xb0')],_['omit'](_0xf3f307[_0xb70f('0x6b')],[_0xb70f('0xb0'),'id'])||{});}})[_0xb70f('0x23')](respondWithResult(_0x3b34a0,null))['catch'](handleError(_0x3b34a0,null));};exports['getMessages']=function(_0x1775bf,_0x3acfe2,_0x367ce8){var _0x3ce14b={'raw':![],'where':{}};var _0x20c36f={};var _0x144cce={'count':0x0,'rows':[]};return db[_0xb70f('0xa9')][_0xb70f('0xb1')]({'where':{'id':_0x1775bf['params']['id']}})['then'](handleEntityNotFound(_0x3acfe2,null))['then'](function(_0xb70f8){if(_0xb70f8){_0x20c36f[_0xb70f('0x35')]=_[_0xb70f('0x33')](db[_0xb70f('0xaf')][_0xb70f('0x2e')]);_0x20c36f[_0xb70f('0x32')]=_[_0xb70f('0x33')](_0x1775bf[_0xb70f('0x32')]);_0x20c36f['filters']=_[_0xb70f('0x36')](_0x20c36f['model'],_0x20c36f[_0xb70f('0x32')]);_0x3ce14b[_0xb70f('0x38')]=_[_0xb70f('0x36')](_0x20c36f[_0xb70f('0x35')],qs['fields'](_0x1775bf[_0xb70f('0x32')][_0xb70f('0x37')]));_0x3ce14b[_0xb70f('0x38')]=_0x3ce14b[_0xb70f('0x38')][_0xb70f('0x39')]?_0x3ce14b[_0xb70f('0x38')]:_0x20c36f[_0xb70f('0x35')];if(!_0x1775bf['query'][_0xb70f('0x3a')]('nolimit')){_0x3ce14b[_0xb70f('0x1d')]=qs[_0xb70f('0x1d')](_0x1775bf['query']['limit']);_0x3ce14b[_0xb70f('0x1b')]=qs[_0xb70f('0x1b')](_0x1775bf['query'][_0xb70f('0x1b')]);}_0x3ce14b[_0xb70f('0x3b')]=qs['sort'](_0x1775bf[_0xb70f('0x32')][_0xb70f('0x3c')]);_0x3ce14b['where']=qs['filters'](_[_0xb70f('0x3e')](_0x1775bf[_0xb70f('0x32')],_0x20c36f['filters']));_0x3ce14b[_0xb70f('0x3d')][_0xb70f('0xb2')]=_0xb70f8['id'];if(_0x1775bf[_0xb70f('0x32')][_0xb70f('0x79')]){_0x3ce14b[_0xb70f('0x3d')]=_[_0xb70f('0x8d')](_0x3ce14b[_0xb70f('0x3d')],{'$or':_[_0xb70f('0x28')](_0x3ce14b['attributes'],function(_0x114f21){var _0x8096db={};_0x8096db[_0x114f21]={'$like':'%'+_0x1775bf['query']['filter']+'%'};return _0x8096db;})});}if(_0x1775bf[_0xb70f('0x32')][_0xb70f('0x72')]){var _0x21b661=_0x1775bf[_0xb70f('0x32')][_0xb70f('0x72')][_0xb70f('0x64')](',');var _0x351a51={};_0x351a51[_0x21b661[0x0]]={'$gte':moment(_0x21b661[0x1])[_0xb70f('0xb3')](_0xb70f('0xb4'))};_0x3ce14b[_0xb70f('0x3d')]=_['merge'](_0x3ce14b[_0xb70f('0x3d')],_0x351a51);}_0x3ce14b=_[_0xb70f('0x8d')]({},_0x3ce14b,_0x1775bf['options']);return db[_0xb70f('0xaf')]['count']({'where':_0x3ce14b['where']})[_0xb70f('0x23')](function(_0x25f20c){_0x144cce[_0xb70f('0x1e')]=_0x25f20c;if(_0x1775bf['query']['includeAll']){_0x3ce14b['include']=[{'all':!![]}];}return db[_0xb70f('0xaf')][_0xb70f('0xb5')](_0x3ce14b);})[_0xb70f('0x23')](function(_0x5834f9){_0x144cce[_0xb70f('0xa5')]=_0x5834f9;return _0x144cce;});}})[_0xb70f('0x23')](respondWithFilteredResult(_0x3acfe2,_0x3ce14b))['catch'](handleError(_0x3acfe2,null));};exports[_0xb70f('0xb6')]=function(_0x305dd7,_0xee80f2,_0x59fcad){return db[_0xb70f('0xa9')][_0xb70f('0x56')]({'where':{'id':_0x305dd7[_0xb70f('0xa6')]['id']}})[_0xb70f('0x23')](handleEntityNotFound(_0xee80f2,null))[_0xb70f('0x23')](function(_0x2563c9){if(_0x2563c9){return _0x2563c9[_0xb70f('0xb7')](_0x305dd7[_0xb70f('0x6b')][_0xb70f('0xb0')],_[_0xb70f('0xb8')](_0x305dd7[_0xb70f('0x6b')],[_0xb70f('0xb0'),'id'])||{})[_0xb70f('0xb9')](function(){return db[_0xb70f('0x63')][_0xb70f('0xb5')]({'attributes':['id',_0xb70f('0x25'),_0xb70f('0x41')],'where':{'id':_0x305dd7[_0xb70f('0x6b')]['ids']}});})[_0xb70f('0x23')](function(_0x1a8c3e){socket[_0xb70f('0xba')](_0xb70f('0xbb'),{'id':Number(_0x305dd7[_0xb70f('0xa6')]['id']),'tags':_0x1a8c3e||[]});return{'id':Number(_0x305dd7['params']['id']),'tags':_0x1a8c3e||[]};});}})[_0xb70f('0x23')](respondWithResult(_0xee80f2,null))[_0xb70f('0x2d')](handleError(_0xee80f2,null));};exports['removeTags']=function(_0x48f102,_0x37e94e,_0x2210ff){return db['FaxInteraction'][_0xb70f('0x56')]({'where':{'id':_0x48f102[_0xb70f('0xa6')]['id']}})[_0xb70f('0x23')](handleEntityNotFound(_0x37e94e,null))['then'](function(_0x21dfc4){if(_0x21dfc4){return _0x21dfc4[_0xb70f('0xbc')](_0x48f102['query'][_0xb70f('0xb0')]);}})[_0xb70f('0x23')](respondWithStatusCode(_0x37e94e,null))['catch'](handleError(_0x37e94e,null));};exports[_0xb70f('0xbd')]=function(_0x3cb3c9,_0x5450d3){var _0x54e0a1=moment()[_0xb70f('0xbe')]()[_0xb70f('0x8b')]();var _0x380179=path[_0xb70f('0xbf')](config['root'],_0xb70f('0xc0'),_0xb70f('0xc1'),_0xb70f('0xc2'));var _0x27d516=path[_0xb70f('0xbf')](config['root'],_0xb70f('0xc0'),_0xb70f('0xc1'),'attachments');var _0x60053f=path[_0xb70f('0xbf')](_0x380179,_0x54e0a1);var _0x1aa6a2=util[_0xb70f('0xb3')](_0xb70f('0xc3'),_0x3cb3c9[_0xb70f('0xa6')]['id'],_0x54e0a1);var _0xd72801=path[_0xb70f('0xbf')](_0x380179,_0x1aa6a2);var _0x5e749f=[];_0x5e749f[_0xb70f('0x2c')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});var _0x2fd592=[{'model':db['FaxMessage'],'as':_0xb70f('0xc4'),'attributes':['id',_0xb70f('0x6b'),_0xb70f('0x71')],'include':_0x5e749f}];return db[_0xb70f('0xa9')]['find']({'where':{'id':_0x3cb3c9[_0xb70f('0xa6')]['id']},'include':_0x2fd592})[_0xb70f('0x23')](handleEntityNotFound(_0x5450d3,null))['then'](function(_0x1ee25a){if(_0x1ee25a&&_0x1ee25a[_0xb70f('0xc4')]){var _0x641d81=_0x1ee25a[_0xb70f('0xc5')]({'plain':!![]});fs[_0xb70f('0xc6')](_0x60053f);for(var _0x4824c6=0x0;_0x4824c6<_0x641d81[_0xb70f('0xc4')][_0xb70f('0x39')];_0x4824c6++){var _0x503e1c=_0x641d81[_0xb70f('0xc4')][_0x4824c6][_0xb70f('0xc7')];if(_0x503e1c){var _0xea61e7=path[_0xb70f('0xbf')](_0x27d516,_0x503e1c[_0xb70f('0xc8')]);if(fs[_0xb70f('0xc9')](_0xea61e7)){fs[_0xb70f('0xca')](_0xea61e7)[_0xb70f('0xcb')](fs[_0xb70f('0xcc')](path[_0xb70f('0xbf')](_0x60053f,_0x503e1c[_0xb70f('0xc8')])));}}}return BPromise[_0xb70f('0xcd')]()[_0xb70f('0x23')](function(){return new BPromise(function(_0x2470db,_0x43f30e){zipdir(_0x60053f,{'saveTo':_0xd72801},function(_0x1c2cf3,_0x2b05b4){if(_0x1c2cf3)return _0x43f30e(_0x1c2cf3);return _0x2470db(_0x2b05b4);});})['then'](function(){return new BPromise(function(_0x21be57,_0x16c5a7){rimraf(_0x60053f,function(_0x3d9b57){if(_0x3d9b57)_0x16c5a7(_0x3d9b57);return _0x21be57();});});})[_0xb70f('0x23')](function(){return _0x5450d3[_0xb70f('0xbd')](_0xd72801,_0x1aa6a2,function(_0x4ca6be){if(_0x4ca6be){console[_0xb70f('0xce')](_0xb70f('0xcf'),_0x4ca6be);}else{fs['unlinkSync'](_0xd72801);}});});});}else{return _0x5450d3[_0xb70f('0x18')](0xc8);}})['catch'](handleError(_0x5450d3,null));}; \ No newline at end of file +var _0x2f54=['c.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','push','all','rows','show','params','rawAttributes','includeAll','include','options','catch','create','body','describe','FaxMessage','addMessage','ids','findOne','nolimit','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','omit','findAll','color','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','Attachment','Messages','get','basename','existsSync','createReadStream','pipe','createWriteStream','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','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/license/util','../../mysqldb','redis','defaults','localhost','./faxInteraction.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','save','update','then','destroy','error','stack','name','send','Users','map','fullname','TagIds','Tags','split','index','FaxInteraction','key','query','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','filters','pick','field','from','tools_tags','u.fullname','ui.FaxInteractionId','user_has_fax_interactions','left_join','users','u.id\x20=\x20ui.UserId','select','fax_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text','keys','some','compact','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','createdAt','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','tag','isArray','replace','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','t.id\x20IN\x20?','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','Account.key','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.*'];(function(_0x5cb4c7,_0x11370d){var _0x4e1f99=function(_0x334ab5){while(--_0x334ab5){_0x5cb4c7['push'](_0x5cb4c7['shift']());}};_0x4e1f99(++_0x11370d);}(_0x2f54,0x11e));var _0x42f5=function(_0x433e29,_0x14b418){_0x433e29=_0x433e29-0x0;var _0x84abd4=_0x2f54[_0x433e29];return _0x84abd4;};'use strict';var emlformat=require(_0x42f5('0x0'));var rimraf=require(_0x42f5('0x1'));var zipdir=require(_0x42f5('0x2'));var jsonpatch=require(_0x42f5('0x3'));var rp=require('request-promise');var moment=require(_0x42f5('0x4'));var BPromise=require(_0x42f5('0x5'));var Mustache=require(_0x42f5('0x6'));var util=require(_0x42f5('0x7'));var path=require(_0x42f5('0x8'));var sox=require(_0x42f5('0x9'));var csv=require(_0x42f5('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x42f5('0xb'));var _=require(_0x42f5('0xc'));var squel=require(_0x42f5('0xd'));var crypto=require('crypto');var jsforce=require(_0x42f5('0xe'));var deskjs=require(_0x42f5('0xf'));var toCsv=require('to-csv');var querystring=require(_0x42f5('0x10'));var Papa=require(_0x42f5('0x11'));var Redis=require(_0x42f5('0x12'));var authService=require(_0x42f5('0x13'));var qs=require(_0x42f5('0x14'));var as=require(_0x42f5('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x42f5('0x16'))(_0x42f5('0x17'));var utils=require(_0x42f5('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x42f5('0x19'));var db=require(_0x42f5('0x1a'))['db'];config[_0x42f5('0x1b')]=_[_0x42f5('0x1c')](config['redis'],{'host':_0x42f5('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x42f5('0x1b')]));require(_0x42f5('0x1e'))[_0x42f5('0x1f')](socket);function respondWithStatusCode(_0x46a9c7,_0xcdda76){_0xcdda76=_0xcdda76||0xcc;return function(_0x8ecf0e){if(_0x8ecf0e){return _0x46a9c7[_0x42f5('0x20')](_0xcdda76);}return _0x46a9c7[_0x42f5('0x21')](_0xcdda76)[_0x42f5('0x22')]();};}function respondWithResult(_0x4f244f,_0x436a34){_0x436a34=_0x436a34||0xc8;return function(_0x2a8550){if(_0x2a8550){return _0x4f244f[_0x42f5('0x21')](_0x436a34)[_0x42f5('0x23')](_0x2a8550);}};}function respondWithFilteredResult(_0x461f89,_0x3cc4ec){return function(_0x17ea1f){if(_0x17ea1f){var _0x31bdb5=typeof _0x3cc4ec[_0x42f5('0x24')]==='undefined'&&typeof _0x3cc4ec[_0x42f5('0x25')]===_0x42f5('0x26');var _0x594923=_0x17ea1f[_0x42f5('0x27')];var _0x21d19d=_0x31bdb5?0x0:_0x3cc4ec[_0x42f5('0x24')];var _0x7a53f6=_0x31bdb5?_0x17ea1f[_0x42f5('0x27')]:_0x3cc4ec['offset']+_0x3cc4ec[_0x42f5('0x25')];var _0xbe4310;if(_0x7a53f6>=_0x594923){_0x7a53f6=_0x594923;_0xbe4310=0xc8;}else{_0xbe4310=0xce;}_0x461f89[_0x42f5('0x21')](_0xbe4310);return _0x461f89[_0x42f5('0x28')]('Content-Range',_0x21d19d+'-'+_0x7a53f6+'/'+_0x594923)[_0x42f5('0x23')](_0x17ea1f);}return null;};}function patchUpdates(_0x57a74b){return function(_0x49a053){try{jsonpatch['apply'](_0x49a053,_0x57a74b,!![]);}catch(_0x169ce6){return BPromise['reject'](_0x169ce6);}return _0x49a053[_0x42f5('0x29')]();};}function saveUpdates(_0x36f906,_0x1e3d4f){return function(_0x2a1c7c){if(_0x2a1c7c){return _0x2a1c7c[_0x42f5('0x2a')](_0x36f906)[_0x42f5('0x2b')](function(_0x4319cb){return _0x4319cb;});}return null;};}function removeEntity(_0x3670af,_0x4e8cf1){return function(_0x2716cb){if(_0x2716cb){return _0x2716cb[_0x42f5('0x2c')]()['then'](function(){_0x3670af[_0x42f5('0x21')](0xcc)[_0x42f5('0x22')]();});}};}function handleEntityNotFound(_0x13bbb4,_0x143bc0){return function(_0x71d985){if(!_0x71d985){_0x13bbb4['sendStatus'](0x194);}return _0x71d985;};}function handleError(_0x1cb520,_0x6109de){_0x6109de=_0x6109de||0x1f4;return function(_0x2e2643){logger[_0x42f5('0x2d')](_0x2e2643[_0x42f5('0x2e')]);if(_0x2e2643[_0x42f5('0x2f')]){delete _0x2e2643[_0x42f5('0x2f')];}_0x1cb520[_0x42f5('0x21')](_0x6109de)[_0x42f5('0x30')](_0x2e2643);};}function getInteractionUsers(_0x14ccc4,_0x3f1999){return new BPromise(function(_0x5537e2,_0x18c9c9){try{if(_0x3f1999[_0x14ccc4['id']]){_0x14ccc4[_0x42f5('0x31')]=_[_0x42f5('0x32')](_0x3f1999[_0x14ccc4['id']],function(_0x5a884b){return{'id':_0x5a884b['id'],'fullname':_0x5a884b[_0x42f5('0x33')]};});}}catch(_0x3a2dbd){_0x18c9c9(_0x3a2dbd);}_0x5537e2(_0x14ccc4);});}function getInteractionTags(_0x1d2941,_0x2e8815){return new BPromise(function(_0x349e28,_0x1e2e67){try{if(_0x1d2941[_0x42f5('0x34')]){_0x1d2941[_0x42f5('0x35')]=[];_0x1d2941[_0x42f5('0x34')][_0x42f5('0x36')](',')['forEach'](function(_0x4038ed){_0x1d2941[_0x42f5('0x35')]['push'](_0x2e8815[_0x4038ed]);});}delete _0x1d2941['TagIds'];}catch(_0xdb4cbc){_0x1e2e67(_0xdb4cbc);}_0x349e28(_0x1d2941);});}function updateFaxInteraction(_0x232930,_0x13451c,_0x1c426c){return new BPromise(function(_0x12f717,_0x421976){return getInteractionUsers(_0x232930,_0x1c426c)[_0x42f5('0x2b')](function(_0x8f5e56){return getInteractionTags(_0x8f5e56,_0x13451c);})['then'](function(_0x156105){_0x12f717(_0x156105);})['catch'](function(_0x4803c4){_0x421976(_0x4803c4);});});}exports[_0x42f5('0x37')]=function(_0x55d21a,_0x369702){var _0x170149={},_0x578c45={},_0x593b88={'count':0x0,'rows':[]};var _0x415951=_[_0x42f5('0x32')](db[_0x42f5('0x38')]['rawAttributes'],function(_0x393e48){return{'name':_0x393e48['fieldName'],'type':_0x393e48['type'][_0x42f5('0x39')]};});_0x578c45['model']=_[_0x42f5('0x32')](_0x415951,_0x42f5('0x2f'));_0x578c45[_0x42f5('0x3a')]=_['keys'](_0x55d21a[_0x42f5('0x3a')]);_0x578c45['filters']=_[_0x42f5('0x3b')](_0x578c45['model'],_0x578c45[_0x42f5('0x3a')]);_0x170149[_0x42f5('0x3c')]=_['intersection'](_0x578c45[_0x42f5('0x3d')],qs[_0x42f5('0x3e')](_0x55d21a[_0x42f5('0x3a')]['fields']));_0x170149['attributes']=_0x170149[_0x42f5('0x3c')][_0x42f5('0x3f')]?_0x170149[_0x42f5('0x3c')]:_0x578c45[_0x42f5('0x3d')];if(!_0x55d21a[_0x42f5('0x3a')][_0x42f5('0x40')]('nolimit')){_0x170149[_0x42f5('0x25')]=qs[_0x42f5('0x25')](_0x55d21a[_0x42f5('0x3a')][_0x42f5('0x25')]);_0x170149[_0x42f5('0x24')]=qs['offset'](_0x55d21a[_0x42f5('0x3a')][_0x42f5('0x24')]);}_0x170149[_0x42f5('0x41')]=qs[_0x42f5('0x42')](_0x55d21a[_0x42f5('0x3a')][_0x42f5('0x42')]);_0x170149[_0x42f5('0x43')]=qs[_0x42f5('0x44')](_[_0x42f5('0x45')](_0x55d21a['query'],_0x578c45[_0x42f5('0x44')]),_0x415951);var _0x2039a3=[];var _0x5a5ea8=squel['select']()[_0x42f5('0x46')]('id')[_0x42f5('0x46')](_0x42f5('0x2f'))[_0x42f5('0x46')]('color')[_0x42f5('0x47')](_0x42f5('0x48'));var _0x43628f=squel['select']()[_0x42f5('0x46')]('u.id')[_0x42f5('0x46')](_0x42f5('0x49'))[_0x42f5('0x46')](_0x42f5('0x4a'))[_0x42f5('0x47')](_0x42f5('0x4b'),'ui')[_0x42f5('0x4c')](_0x42f5('0x4d'),'u',_0x42f5('0x4e'));var _0x4f6955=squel[_0x42f5('0x4f')]()['from'](_0x42f5('0x50'),'i')['left_join'](_0x42f5('0x51'),'c',_0x42f5('0x52'))['left_join'](_0x42f5('0x4d'),'o','o.id\x20=\x20i.UserId')[_0x42f5('0x4c')](_0x42f5('0x53'),'a',_0x42f5('0x54'))[_0x42f5('0x4c')](_0x42f5('0x55'),'me',_0x42f5('0x56'))['left_join'](_0x42f5('0x57'),'it',_0x42f5('0x58'))['left_join'](_0x42f5('0x48'),'t',_0x42f5('0x59'));var _0x49fad0=squel[_0x42f5('0x5a')]();var _0xb5e02a=[];var _0x21373d=squel[_0x42f5('0x5a')]();var _0x4fdfe4;if(_0x55d21a[_0x42f5('0x3a')][_0x42f5('0x5b')]){_0x4fdfe4=as[_0x42f5('0x5c')](_0x55d21a[_0x42f5('0x3a')][_0x42f5('0x5b')]);var _0x3a38b5=_0x4fdfe4[_0x42f5('0x5d')];for(var _0x37f4b8=0x0;_0x37f4b8<_0x4fdfe4['conditions'][_0x42f5('0x3f')];_0x37f4b8++){var _0x283ed7=_0x4fdfe4['conditions'][_0x37f4b8];var _0x1cd959='i';var _0x9c20b2=_[_0x42f5('0x5e')](_0x415951,[_0x42f5('0x2f'),_0x283ed7[_0x42f5('0x46')]]);if(!_0x9c20b2){switch(_0x283ed7[_0x42f5('0x46')]){case _0x42f5('0x5f'):if(_0x283ed7[_0x42f5('0x60')]==0x1){_0x4f6955[_0x42f5('0x61')]('`'+_0x283ed7[_0x42f5('0x46')]+_0x42f5('0x62'));}else{_0x4f6955[_0x42f5('0x61')]('`'+_0x283ed7[_0x42f5('0x46')]+_0x42f5('0x63'));}break;case _0x42f5('0x64'):if(_0x283ed7[_0x42f5('0x65')]===_0x42f5('0x66')){if(_0x283ed7[_0x42f5('0x60')]['split']('\x20')[_0x42f5('0x3f')]>0x1){_0x49fad0[_0x3a38b5]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x283ed7[_0x42f5('0x60')]),null);}else{var _0x35e1b7='%'+_0x283ed7['value']+'%';_0x49fad0[_0x3a38b5](_0x42f5('0x67'),_0x35e1b7,_0x35e1b7,_0x35e1b7);}}else{_0x9c20b2=_['find'](_0x415951,[_0x42f5('0x2f'),_0x42f5('0x68')]);_0x283ed7['field']='ContactId';_0x3cb6ab=as[_0x42f5('0x69')](_0x1cd959,_0x9c20b2[_0x42f5('0x6a')],_0x283ed7);_0x49fad0[_0x3a38b5](_0x3cb6ab['text'],_0x3cb6ab[_0x42f5('0x60')][_0x42f5('0x6b')],_0x3cb6ab[_0x42f5('0x60')][_0x42f5('0x22')]);}break;case _0x42f5('0x6c'):var _0x4e604b=_0x283ed7[_0x42f5('0x60')]['split'](',')['map'](function(_0x366f02){return Number(_0x366f02);});_0x4e604b[_0x42f5('0x6d')](function(_0x6802f){_0x21373d['or'](_0x42f5('0x6e'),'%,'+_0x6802f+',%');});_0xb5e02a=_['union'](_0xb5e02a,_0x4e604b);break;case'User':if(_0x283ed7['operator']===_0x42f5('0x66')){_0x49fad0[_0x3a38b5](_0x42f5('0x6f'),'%'+_0x283ed7['value']+'%',null);}else{_0x9c20b2=_[_0x42f5('0x5e')](_0x415951,[_0x42f5('0x2f'),_0x42f5('0x70')]);_0x283ed7[_0x42f5('0x46')]=_0x42f5('0x70');_0x3cb6ab=as[_0x42f5('0x69')](_0x1cd959,_0x9c20b2['type'],_0x283ed7);_0x49fad0[_0x3a38b5](_0x3cb6ab[_0x42f5('0x71')],_0x3cb6ab[_0x42f5('0x60')][_0x42f5('0x6b')],_0x3cb6ab['value'][_0x42f5('0x22')]);}break;case'body':_0x3cb6ab=as[_0x42f5('0x69')]('me',null,_0x283ed7);_0x49fad0[_0x3a38b5](_0x3cb6ab['text'],_0x3cb6ab[_0x42f5('0x60')][_0x42f5('0x6b')],_0x3cb6ab['value'][_0x42f5('0x22')]);break;}}else{var _0x3cb6ab=as[_0x42f5('0x69')](_0x1cd959,_0x9c20b2[_0x42f5('0x6a')],_0x283ed7);_0x49fad0[_0x3a38b5](_0x3cb6ab['text'],_0x3cb6ab[_0x42f5('0x60')][_0x42f5('0x6b')],_0x3cb6ab['value'][_0x42f5('0x22')]);}}}else{var _0x164ed2=_(_0x55d21a['query'])[_0x42f5('0x72')]()['map'](function(_0x51408e){return _[_0x42f5('0x73')](_0x415951,['name',_0x51408e])?_0x51408e:undefined;})[_0x42f5('0x74')]()[_0x42f5('0x60')]();if(!_[_0x42f5('0x75')](_0x164ed2)){_0x164ed2[_0x42f5('0x6d')](function(_0x122a83){if(_0x122a83===_0x42f5('0x76')){_0x4f6955['where'](_0x42f5('0x77'),[][_0x42f5('0x78')](_0x55d21a[_0x42f5('0x3a')][_0x122a83]));}else if(_0x122a83===_0x42f5('0x79')){var _0x2c2cec=JSON['parse'](_0x55d21a['query'][_0x122a83])['$gte'];var _0xae097e=JSON['parse'](_0x55d21a['query'][_0x122a83])[_0x42f5('0x7a')];_0x4f6955[_0x42f5('0x43')](_0x42f5('0x7b'),_0x2c2cec,_0xae097e);}else{if(_0x55d21a[_0x42f5('0x3a')][_0x122a83]===_0x42f5('0x7c')){_0x4f6955[_0x42f5('0x43')]('i.'+_0x122a83+_0x42f5('0x7d'));}else{_0x4f6955[_0x42f5('0x43')]('i.'+_0x122a83+'\x20=\x20?',_0x55d21a[_0x42f5('0x3a')][_0x122a83]);}}});}if(_0x55d21a[_0x42f5('0x3a')]['read']){if(_0x55d21a[_0x42f5('0x3a')]['read']==0x1){_0x4f6955[_0x42f5('0x61')]('`unreadMessages`\x20=\x200');}else{_0x4f6955['having']('`unreadMessages`\x20>\x200');}}if(_0x55d21a[_0x42f5('0x3a')][_0x42f5('0x7e')]){_0xb5e02a=_[_0x42f5('0x7f')](_0x55d21a['query'][_0x42f5('0x7e')])?_0x55d21a[_0x42f5('0x3a')][_0x42f5('0x7e')]:new Array(_0x55d21a[_0x42f5('0x3a')][_0x42f5('0x7e')]);_0xb5e02a[_0x42f5('0x6d')](function(_0x23321e){_0x21373d['or'](_0x42f5('0x6e'),'%,'+_0x23321e+',%');});}if(_0x55d21a['query']['filter']){var _0xcf9479=_0x55d21a[_0x42f5('0x3a')]['filter'][_0x42f5('0x80')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x42f5('0x81')](_0xcf9479)){_0x49fad0['or'](_0x42f5('0x82'),_0xcf9479+'%')['or'](_0x42f5('0x83'),_0xcf9479+'%');}_0x49fad0['or'](_0x42f5('0x84'),_0xcf9479+'%');}}_0x4f6955[_0x42f5('0x43')](_0x49fad0);_0x4f6955[_0x42f5('0x85')](_0x42f5('0x86'));var _0x391798={'type':db[_0x42f5('0x87')][_0x42f5('0x88')][_0x42f5('0x89')],'raw':!![]};var _0x549dee=_0x4f6955[_0x42f5('0x8a')]();_0x549dee['field'](_0x42f5('0x86'));_0x549dee[_0x42f5('0x46')](_0x42f5('0x8b'),'unreadMessages');if(_0x170149[_0x42f5('0x41')]){_0x170149[_0x42f5('0x41')][_0x42f5('0x6d')](function(_0x54528e){var _0x222fcc=_0x54528e[0x0]===_0x42f5('0x8c')?_0x54528e[0x0]:'i.'+_0x54528e[0x0];_0x4f6955['order'](_0x222fcc,_0x54528e[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0xb5e02a)){_0x4f6955[_0x42f5('0x61')](_0x21373d);_0x549dee[_0x42f5('0x43')](_0x42f5('0x8d'),_0xb5e02a);}BPromise['resolve']()[_0x42f5('0x2b')](function(){if(!_0x4fdfe4){if(_0x55d21a['query']['FaxAccountId'])return;_0x549dee[_0x42f5('0x43')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');_0x4f6955['where'](_0x42f5('0x8e'));return;}if(_0x55d21a[_0x42f5('0x8f')][_0x42f5('0x90')]!==_0x42f5('0x91'))return;return _0x55d21a[_0x42f5('0x8f')][_0x42f5('0x92')]({'attributes':['id'],'raw':!![]})[_0x42f5('0x2b')](function(_0x447a46){if(_[_0x42f5('0x75')](_0x447a46)){_0x549dee['where'](_0x42f5('0x93'));_0x4f6955[_0x42f5('0x43')]('i.FaxAccountId\x20IS\x20NULL');}else{_0x549dee[_0x42f5('0x43')](_0x42f5('0x77'),_[_0x42f5('0x32')](_0x447a46,'id'));_0x4f6955[_0x42f5('0x43')](_0x42f5('0x77'),_[_0x42f5('0x32')](_0x447a46,'id'));}});})[_0x42f5('0x2b')](function(){if(_0x55d21a[_0x42f5('0x8f')]['role']===_0x42f5('0x91')&&!_0x4fdfe4&&!_0x55d21a['query']['FaxAccountId'])return[];return db[_0x42f5('0x94')][_0x42f5('0x3a')](_0x549dee[_0x42f5('0x95')](),_0x391798);})[_0x42f5('0x2b')](function(_0x4d584a){_0x593b88[_0x42f5('0x27')]=_0x4d584a['length'];if(_0x593b88[_0x42f5('0x27')]===0x0)return[];return db[_0x42f5('0x94')]['query'](_0x5a5ea8[_0x42f5('0x95')](),_0x391798)[_0x42f5('0x2b')](function(_0x3bfd91){_0x2039a3=_[_0x42f5('0x96')](_0x3bfd91,'id');_0x391798=_[_0x42f5('0x97')](_0x391798,{'model':db[_0x42f5('0x38')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x55d21a[_0x42f5('0x3a')][_0x42f5('0x3e')]){_0x170149[_0x42f5('0x3c')]['forEach'](function(_0x6296a){_0x4f6955[_0x42f5('0x46')]('i.'+_0x6296a);});}else{_0x4f6955['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x42f5('0x5f'));_0x4f6955[_0x42f5('0x46')](_0x42f5('0x98'),_0x42f5('0x99'));_0x4f6955[_0x42f5('0x46')]('a.mandatoryDisposition','Account.mandatoryDisposition');_0x4f6955[_0x42f5('0x46')](_0x42f5('0x9a'),'contactName');_0x4f6955[_0x42f5('0x46')](_0x42f5('0x9b'));_0x4f6955[_0x42f5('0x46')](_0x42f5('0x9c'),'Contact.firstName');_0x4f6955[_0x42f5('0x46')](_0x42f5('0x9d'),_0x42f5('0x9e'));_0x4f6955[_0x42f5('0x46')]('c.email',_0x42f5('0x9f'));_0x4f6955['field'](_0x42f5('0xa0'),_0x42f5('0xa1'));_0x4f6955[_0x42f5('0x46')](_0x42f5('0xa2'),'Contact.mobile');_0x4f6955[_0x42f5('0x46')](_0x42f5('0xa3'),_0x42f5('0xa4'));_0x4f6955[_0x42f5('0x46')](_0x42f5('0xa5'),_0x42f5('0xa6'));_0x4f6955[_0x42f5('0x46')](_0x42f5('0xa7'),_0x42f5('0xa8'));_0x4f6955[_0x42f5('0x46')](_0x42f5('0xa9'),'TagIds');}if(_0x170149[_0x42f5('0x25')])_0x4f6955[_0x42f5('0x25')](_0x170149['limit']);if(_0x170149[_0x42f5('0x24')])_0x4f6955['offset'](_0x170149[_0x42f5('0x24')]);return db[_0x42f5('0x94')][_0x42f5('0x3a')](_0x4f6955[_0x42f5('0x95')](),_0x391798);})['then'](function(_0x4f3a05){if(_0x4f3a05[_0x42f5('0x3f')]>0x0)_0x43628f[_0x42f5('0x43')](_0x42f5('0xaa'),_[_0x42f5('0x32')](_0x4f3a05,'id'));return db[_0x42f5('0x94')][_0x42f5('0x3a')](_0x43628f[_0x42f5('0x95')](),_0x391798)[_0x42f5('0x2b')](function(_0x4902dd){var _0x3f1a3b=_[_0x42f5('0xab')](_0x4902dd,_0x42f5('0xac'));var _0x3da8ac=[];_0x4f3a05[_0x42f5('0x6d')](function(_0x2c76d9){_0x3da8ac[_0x42f5('0xad')](updateFaxInteraction(_0x2c76d9,_0x2039a3,_0x3f1a3b));});return BPromise[_0x42f5('0xae')](_0x3da8ac);});});})[_0x42f5('0x2b')](function(_0x3bf8eb){_0x593b88[_0x42f5('0xaf')]=_0x3bf8eb;return _0x593b88;})[_0x42f5('0x2b')](respondWithFilteredResult(_0x369702,_0x170149))['catch'](handleError(_0x369702,null));};exports[_0x42f5('0xb0')]=function(_0x25ba45,_0x559613){var _0x4ea31b={'raw':![],'where':{'id':_0x25ba45[_0x42f5('0xb1')]['id']}},_0x253777={};_0x253777[_0x42f5('0x3d')]=_['keys'](db[_0x42f5('0x38')][_0x42f5('0xb2')]);_0x253777['query']=_[_0x42f5('0x72')](_0x25ba45['query']);_0x253777['filters']=_['intersection'](_0x253777[_0x42f5('0x3d')],_0x253777['query']);_0x4ea31b[_0x42f5('0x3c')]=_[_0x42f5('0x3b')](_0x253777[_0x42f5('0x3d')],qs['fields'](_0x25ba45[_0x42f5('0x3a')][_0x42f5('0x3e')]));_0x4ea31b[_0x42f5('0x3c')]=_0x4ea31b[_0x42f5('0x3c')][_0x42f5('0x3f')]?_0x4ea31b[_0x42f5('0x3c')]:_0x253777['model'];if(_0x25ba45['query'][_0x42f5('0xb3')]){_0x4ea31b[_0x42f5('0xb4')]=[{'all':!![]}];}_0x4ea31b=_['merge']({},_0x4ea31b,_0x25ba45[_0x42f5('0xb5')]);return db[_0x42f5('0x38')][_0x42f5('0x5e')](_0x4ea31b)['then'](handleEntityNotFound(_0x559613,null))[_0x42f5('0x2b')](respondWithResult(_0x559613,null))[_0x42f5('0xb6')](handleError(_0x559613,null));};exports['create']=function(_0x4c3022,_0x1f9361){return db[_0x42f5('0x38')][_0x42f5('0xb7')](_0x4c3022[_0x42f5('0xb8')],{})[_0x42f5('0x2b')](respondWithResult(_0x1f9361,0xc9))[_0x42f5('0xb6')](handleError(_0x1f9361,null));};exports[_0x42f5('0x2a')]=function(_0x2b93d9,_0x3d93dd){if(_0x2b93d9[_0x42f5('0xb8')]['id']){delete _0x2b93d9['body']['id'];}return db[_0x42f5('0x38')][_0x42f5('0x5e')]({'where':{'id':_0x2b93d9[_0x42f5('0xb1')]['id']}})[_0x42f5('0x2b')](handleEntityNotFound(_0x3d93dd,null))['then'](saveUpdates(_0x2b93d9[_0x42f5('0xb8')],null))[_0x42f5('0x2b')](respondWithResult(_0x3d93dd,null))[_0x42f5('0xb6')](handleError(_0x3d93dd,null));};exports[_0x42f5('0x2c')]=function(_0x22e681,_0x43c62a){return db[_0x42f5('0x38')][_0x42f5('0x5e')]({'where':{'id':_0x22e681[_0x42f5('0xb1')]['id']}})['then'](handleEntityNotFound(_0x43c62a,null))[_0x42f5('0x2b')](removeEntity(_0x43c62a,null))['catch'](handleError(_0x43c62a,null));};exports[_0x42f5('0xb9')]=function(_0x157323,_0x3e70d6){return db['FaxInteraction'][_0x42f5('0xb9')]()[_0x42f5('0x2b')](respondWithResult(_0x3e70d6,null))[_0x42f5('0xb6')](handleError(_0x3e70d6,null));};exports['addMessage']=function(_0x54ba76,_0x3d5d33,_0x471f20){return db[_0x42f5('0xba')][_0x42f5('0x5e')]({'where':{'id':_0x54ba76['params']['id']}})[_0x42f5('0x2b')](handleEntityNotFound(_0x3d5d33,null))[_0x42f5('0x2b')](function(_0x2f4ee2){if(_0x2f4ee2){return _0x2f4ee2[_0x42f5('0xbb')](_0x54ba76[_0x42f5('0xb8')][_0x42f5('0xbc')],_['omit'](_0x54ba76[_0x42f5('0xb8')],[_0x42f5('0xbc'),'id'])||{});}})['then'](respondWithResult(_0x3d5d33,null))[_0x42f5('0xb6')](handleError(_0x3d5d33,null));};exports['getMessages']=function(_0x1cf480,_0x3d8b9f,_0x1f5bb5){var _0x462dd5={'raw':![],'where':{}};var _0x5c9451={};var _0x12c3d8={'count':0x0,'rows':[]};return db[_0x42f5('0x38')][_0x42f5('0xbd')]({'where':{'id':_0x1cf480[_0x42f5('0xb1')]['id']}})['then'](handleEntityNotFound(_0x3d8b9f,null))[_0x42f5('0x2b')](function(_0x2bbb8f){if(_0x2bbb8f){_0x5c9451[_0x42f5('0x3d')]=_[_0x42f5('0x72')](db[_0x42f5('0xba')][_0x42f5('0xb2')]);_0x5c9451['query']=_[_0x42f5('0x72')](_0x1cf480[_0x42f5('0x3a')]);_0x5c9451[_0x42f5('0x44')]=_[_0x42f5('0x3b')](_0x5c9451[_0x42f5('0x3d')],_0x5c9451[_0x42f5('0x3a')]);_0x462dd5['attributes']=_[_0x42f5('0x3b')](_0x5c9451[_0x42f5('0x3d')],qs[_0x42f5('0x3e')](_0x1cf480[_0x42f5('0x3a')][_0x42f5('0x3e')]));_0x462dd5[_0x42f5('0x3c')]=_0x462dd5['attributes'][_0x42f5('0x3f')]?_0x462dd5[_0x42f5('0x3c')]:_0x5c9451[_0x42f5('0x3d')];if(!_0x1cf480[_0x42f5('0x3a')][_0x42f5('0x40')](_0x42f5('0xbe'))){_0x462dd5[_0x42f5('0x25')]=qs['limit'](_0x1cf480[_0x42f5('0x3a')]['limit']);_0x462dd5[_0x42f5('0x24')]=qs[_0x42f5('0x24')](_0x1cf480[_0x42f5('0x3a')][_0x42f5('0x24')]);}_0x462dd5[_0x42f5('0x41')]=qs[_0x42f5('0x42')](_0x1cf480[_0x42f5('0x3a')][_0x42f5('0x42')]);_0x462dd5['where']=qs['filters'](_[_0x42f5('0x45')](_0x1cf480[_0x42f5('0x3a')],_0x5c9451['filters']));_0x462dd5[_0x42f5('0x43')][_0x42f5('0xac')]=_0x2bbb8f['id'];if(_0x1cf480[_0x42f5('0x3a')][_0x42f5('0xbf')]){_0x462dd5[_0x42f5('0x43')]=_[_0x42f5('0x97')](_0x462dd5[_0x42f5('0x43')],{'$or':_[_0x42f5('0x32')](_0x462dd5['attributes'],function(_0x355cda){var _0x43df82={};_0x43df82[_0x355cda]={'$like':'%'+_0x1cf480['query'][_0x42f5('0xbf')]+'%'};return _0x43df82;})});}if(_0x1cf480[_0x42f5('0x3a')][_0x42f5('0xc0')]){var _0x2322fb=_0x1cf480['query']['$gte'][_0x42f5('0x36')](',');var _0x154d6e={};_0x154d6e[_0x2322fb[0x0]]={'$gte':moment(_0x2322fb[0x1])[_0x42f5('0xc1')](_0x42f5('0xc2'))};_0x462dd5[_0x42f5('0x43')]=_[_0x42f5('0x97')](_0x462dd5['where'],_0x154d6e);}_0x462dd5=_[_0x42f5('0x97')]({},_0x462dd5,_0x1cf480[_0x42f5('0xb5')]);return db[_0x42f5('0xba')]['count']({'where':_0x462dd5['where']})[_0x42f5('0x2b')](function(_0x266769){_0x12c3d8[_0x42f5('0x27')]=_0x266769;if(_0x1cf480[_0x42f5('0x3a')][_0x42f5('0xb3')]){_0x462dd5[_0x42f5('0xb4')]=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0x462dd5);})[_0x42f5('0x2b')](function(_0x2144d0){_0x12c3d8['rows']=_0x2144d0;return _0x12c3d8;});}})[_0x42f5('0x2b')](respondWithFilteredResult(_0x3d8b9f,_0x462dd5))[_0x42f5('0xb6')](handleError(_0x3d8b9f,null));};exports[_0x42f5('0xc3')]=function(_0x146019,_0x57f2a0,_0x558b64){return db['FaxInteraction'][_0x42f5('0x5e')]({'where':{'id':_0x146019[_0x42f5('0xb1')]['id']}})[_0x42f5('0x2b')](handleEntityNotFound(_0x57f2a0,null))[_0x42f5('0x2b')](function(_0x4b424b){if(_0x4b424b){return _0x4b424b[_0x42f5('0xc4')](_0x146019[_0x42f5('0xb8')][_0x42f5('0xbc')],_[_0x42f5('0xc5')](_0x146019[_0x42f5('0xb8')],[_0x42f5('0xbc'),'id'])||{})['spread'](function(){return db[_0x42f5('0x6c')][_0x42f5('0xc6')]({'attributes':['id','name',_0x42f5('0xc7')],'where':{'id':_0x146019[_0x42f5('0xb8')]['ids']}});})[_0x42f5('0x2b')](function(_0xa4c34a){socket['emit']('faxInteractionTags:save',{'id':Number(_0x146019['params']['id']),'tags':_0xa4c34a||[]});return{'id':Number(_0x146019[_0x42f5('0xb1')]['id']),'tags':_0xa4c34a||[]};});}})[_0x42f5('0x2b')](respondWithResult(_0x57f2a0,null))[_0x42f5('0xb6')](handleError(_0x57f2a0,null));};exports[_0x42f5('0xc8')]=function(_0x5558ba,_0x2ca8f6,_0x38a2e5){return db['FaxInteraction'][_0x42f5('0x5e')]({'where':{'id':_0x5558ba[_0x42f5('0xb1')]['id']}})['then'](handleEntityNotFound(_0x2ca8f6,null))[_0x42f5('0x2b')](function(_0x200c1c){if(_0x200c1c){return _0x200c1c['removeTags'](_0x5558ba[_0x42f5('0x3a')][_0x42f5('0xbc')]);}})[_0x42f5('0x2b')](respondWithStatusCode(_0x2ca8f6,null))[_0x42f5('0xb6')](handleError(_0x2ca8f6,null));};exports[_0x42f5('0xc9')]=function(_0x2becc2,_0x1bc334){var _0x5ac085=moment()[_0x42f5('0xca')]()[_0x42f5('0x95')]();var _0x1a2a50=path[_0x42f5('0xcb')](config[_0x42f5('0xcc')],_0x42f5('0xcd'),_0x42f5('0xce'),_0x42f5('0xcf'));var _0x205a2b=path['join'](config[_0x42f5('0xcc')],_0x42f5('0xcd'),'files',_0x42f5('0xd0'));var _0x3dd1c8=path[_0x42f5('0xcb')](_0x1a2a50,_0x5ac085);var _0x2609e4=util[_0x42f5('0xc1')](_0x42f5('0xd1'),_0x2becc2[_0x42f5('0xb1')]['id'],_0x5ac085);var _0x4522e1=path[_0x42f5('0xcb')](_0x1a2a50,_0x2609e4);var _0x355d29=[];_0x355d29[_0x42f5('0xad')]({'model':db[_0x42f5('0xd2')],'as':_0x42f5('0xd2'),'raw':!![]});var _0x19d1fa=[{'model':db['FaxMessage'],'as':_0x42f5('0xd3'),'attributes':['id',_0x42f5('0xb8'),_0x42f5('0x79')],'include':_0x355d29}];return db[_0x42f5('0x38')]['find']({'where':{'id':_0x2becc2[_0x42f5('0xb1')]['id']},'include':_0x19d1fa})[_0x42f5('0x2b')](handleEntityNotFound(_0x1bc334,null))[_0x42f5('0x2b')](function(_0x19ebcb){if(_0x19ebcb&&_0x19ebcb[_0x42f5('0xd3')]){var _0xf3160f=_0x19ebcb[_0x42f5('0xd4')]({'plain':!![]});fs['mkdirSync'](_0x3dd1c8);for(var _0x200f72=0x0;_0x200f72<_0xf3160f[_0x42f5('0xd3')][_0x42f5('0x3f')];_0x200f72++){var _0x1061c0=_0xf3160f[_0x42f5('0xd3')][_0x200f72][_0x42f5('0xd2')];if(_0x1061c0){var _0x5bb5e3=path['join'](_0x205a2b,_0x1061c0[_0x42f5('0xd5')]);if(fs[_0x42f5('0xd6')](_0x5bb5e3)){fs[_0x42f5('0xd7')](_0x5bb5e3)[_0x42f5('0xd8')](fs[_0x42f5('0xd9')](path[_0x42f5('0xcb')](_0x3dd1c8,_0x1061c0[_0x42f5('0xd5')])));}}}return BPromise['resolve']()['then'](function(){return new BPromise(function(_0x50377d,_0x477d9d){zipdir(_0x3dd1c8,{'saveTo':_0x4522e1},function(_0x353680,_0x3c94fa){if(_0x353680)return _0x477d9d(_0x353680);return _0x50377d(_0x3c94fa);});})[_0x42f5('0x2b')](function(){return new BPromise(function(_0x257ad4,_0x1239c4){rimraf(_0x3dd1c8,function(_0x220a57){if(_0x220a57)_0x1239c4(_0x220a57);return _0x257ad4();});});})['then'](function(){return _0x1bc334['download'](_0x4522e1,_0x2609e4,function(_0x159097){if(_0x159097){console[_0x42f5('0xda')](_0x42f5('0xdb'),_0x159097);}else{fs[_0x42f5('0xdc')](_0x4522e1);}});});});}else{return _0x1bc334[_0x42f5('0x20')](0xc8);}})['catch'](handleError(_0x1bc334,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 6d320f7..68bafb1 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 _0x5a2d=['findAll','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save','update','getUsers','then','setDataValue','Users','map'];(function(_0xcd39c8,_0x2ad166){var _0x463dfc=function(_0x224b09){while(--_0x224b09){_0xcd39c8['push'](_0xcd39c8['shift']());}};_0x463dfc(++_0x2ad166);}(_0x5a2d,0x9f));var _0xd5a2=function(_0x234ce7,_0x3e909c){_0x234ce7=_0x234ce7-0x0;var _0x57c561=_0x5a2d[_0x234ce7];return _0x57c561;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0xd5a2('0x0'))['db']['FaxInteraction'];var FaxMessage=require(_0xd5a2('0x0'))['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xd5a2('0x1')](0x0);var events={'afterCreate':_0xd5a2('0x2'),'afterUpdate':_0xd5a2('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4ab0ad){return function(_0x3f5206,_0x32316c,_0x2d6690){_0x3f5206[_0xd5a2('0x4')]({'attributes':['id'],'raw':!![]})[_0xd5a2('0x5')](function(_0x1a64be){_0x3f5206[_0xd5a2('0x6')](_0xd5a2('0x7'),_0x1a64be[_0xd5a2('0x8')](function(_0x338b8f){return{'id':_0x338b8f['id']};}));return FaxMessage[_0xd5a2('0x9')]({'where':{'FaxInteractionId':_0x3f5206['id'],'direction':'in','read':![]},'raw':!![]});})[_0xd5a2('0x5')](function(_0x4630b0){_0x3f5206['setDataValue']('unreadMessages',_0x4630b0['length']);FaxInteractionEvents[_0xd5a2('0xa')](_0x4ab0ad+':'+_0x3f5206['id'],_0x3f5206);FaxInteractionEvents[_0xd5a2('0xa')](_0x4ab0ad,_0x3f5206);_0x2d6690(null);})['catch'](_0x2d6690(null));};}for(var e in events){if(events[_0xd5a2('0xb')](e)){var event=events[e];FaxInteraction[_0xd5a2('0xc')](e,emitEvent(event));}}module[_0xd5a2('0xd')]=FaxInteractionEvents; \ No newline at end of file +var _0x47f7=['getUsers','then','setDataValue','Users','map','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save','update','remove'];(function(_0x3712ee,_0x5623e6){var _0x3fae99=function(_0x2b6e92){while(--_0x2b6e92){_0x3712ee['push'](_0x3712ee['shift']());}};_0x3fae99(++_0x5623e6);}(_0x47f7,0x1ad));var _0x747f=function(_0x469558,_0x190c1b){_0x469558=_0x469558-0x0;var _0x277ec2=_0x47f7[_0x469558];return _0x277ec2;};'use strict';var EventEmitter=require(_0x747f('0x0'));var FaxInteraction=require(_0x747f('0x1'))['db'][_0x747f('0x2')];var FaxMessage=require(_0x747f('0x1'))['db'][_0x747f('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x747f('0x4')](0x0);var events={'afterCreate':_0x747f('0x5'),'afterUpdate':_0x747f('0x6'),'afterDestroy':_0x747f('0x7')};function emitEvent(_0x2e3d02){return function(_0x52fc85,_0x3119f3,_0x2bd29c){_0x52fc85[_0x747f('0x8')]({'attributes':['id'],'raw':!![]})[_0x747f('0x9')](function(_0x4cfdc5){_0x52fc85[_0x747f('0xa')](_0x747f('0xb'),_0x4cfdc5[_0x747f('0xc')](function(_0x2b4f85){return{'id':_0x2b4f85['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x52fc85['id'],'direction':'in','read':![]},'raw':!![]});})[_0x747f('0x9')](function(_0x1b3d47){_0x52fc85[_0x747f('0xa')]('unreadMessages',_0x1b3d47[_0x747f('0xd')]);FaxInteractionEvents[_0x747f('0xe')](_0x2e3d02+':'+_0x52fc85['id'],_0x52fc85);FaxInteractionEvents[_0x747f('0xe')](_0x2e3d02,_0x52fc85);_0x2bd29c(null);})[_0x747f('0xf')](_0x2bd29c(null));};}for(var e in events){if(events[_0x747f('0x10')](e)){var event=events[e];FaxInteraction[_0x747f('0x11')](e,emitEvent(event));}}module[_0x747f('0x12')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index b344b40..5c0d6c6 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 _0x0137=['moment','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes','exports','define','fax_interactions','changed','closed','closedAt','format','lodash','util','../../config/logger','api'];(function(_0xdc65e6,_0x3f4c38){var _0x492a9d=function(_0x18a6f2){while(--_0x18a6f2){_0xdc65e6['push'](_0xdc65e6['shift']());}};_0x492a9d(++_0x3f4c38);}(_0x0137,0x1d8));var _0x7013=function(_0x4fdb79,_0x12c116){_0x4fdb79=_0x4fdb79-0x0;var _0x3ec15b=_0x0137[_0x4fdb79];return _0x3ec15b;};'use strict';var _=require(_0x7013('0x0'));var util=require(_0x7013('0x1'));var logger=require(_0x7013('0x2'))(_0x7013('0x3'));var moment=require(_0x7013('0x4'));var BPromise=require('bluebird');var rp=require(_0x7013('0x5'));var fs=require('fs');var path=require(_0x7013('0x6'));var rimraf=require(_0x7013('0x7'));var config=require(_0x7013('0x8'));var attributes=require(_0x7013('0x9'));module[_0x7013('0xa')]=function(_0x50b822,_0x24cb85){return _0x50b822[_0x7013('0xb')]('FaxInteraction',attributes,{'tableName':_0x7013('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x16dae3,_0x1b748c,_0x56d571){if(_0x16dae3[_0x7013('0xd')](_0x7013('0xe'))){_0x16dae3[_0x7013('0xf')]=moment()[_0x7013('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}_0x56d571(null,_0x16dae3);}}});}; \ No newline at end of file +var _0x40f3=['closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','moment','bluebird','rimraf','../../config/environment','exports','define','FaxInteraction','fax_interactions','changed'];(function(_0x2bf5bd,_0x120787){var _0xc810c0=function(_0xba9dd3){while(--_0xba9dd3){_0x2bf5bd['push'](_0x2bf5bd['shift']());}};_0xc810c0(++_0x120787);}(_0x40f3,0x8b));var _0x340f=function(_0x4e9d3c,_0x1f4b98){_0x4e9d3c=_0x4e9d3c-0x0;var _0x2d0825=_0x40f3[_0x4e9d3c];return _0x2d0825;};'use strict';var _=require('lodash');var util=require(_0x340f('0x0'));var logger=require(_0x340f('0x1'))('api');var moment=require(_0x340f('0x2'));var BPromise=require(_0x340f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x340f('0x4'));var config=require(_0x340f('0x5'));var attributes=require('./faxInteraction.attributes');module[_0x340f('0x6')]=function(_0x496502,_0x48d1e8){return _0x496502[_0x340f('0x7')](_0x340f('0x8'),attributes,{'tableName':_0x340f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5af823,_0x4f1f9b,_0x1b7b15){if(_0x5af823[_0x340f('0xa')](_0x340f('0xb'))){_0x5af823[_0x340f('0xc')]=moment()[_0x340f('0xd')](_0x340f('0xe'));}_0x1b7b15(null,_0x5af823);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 17f4c6d..06521f3 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 _0xdfe7=['register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','UpdateFaxInteraction','update','body','options','raw','where','attributes','limit','debug','catch','AddTagsToFaxInteraction','FaxInteraction','find','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./faxInteraction.socket'];(function(_0x3a2180,_0x2b31bb){var _0x44d72e=function(_0x358826){while(--_0x358826){_0x3a2180['push'](_0x3a2180['shift']());}};_0x44d72e(++_0x2b31bb);}(_0xdfe7,0xfc));var _0x7dfe=function(_0x5a02fa,_0x17aa52){_0x5a02fa=_0x5a02fa-0x0;var _0x158cca=_0xdfe7[_0x5a02fa];return _0x158cca;};'use strict';var _=require(_0x7dfe('0x0'));var util=require(_0x7dfe('0x1'));var moment=require(_0x7dfe('0x2'));var BPromise=require(_0x7dfe('0x3'));var rs=require(_0x7dfe('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7dfe('0x5'))['db'];var utils=require(_0x7dfe('0x6'));var logger=require(_0x7dfe('0x7'))(_0x7dfe('0x8'));var config=require(_0x7dfe('0x9'));var jayson=require(_0x7dfe('0xa'));var client=jayson[_0x7dfe('0xb')][_0x7dfe('0xc')]({'port':0x232a});config['redis']=_[_0x7dfe('0xd')](config[_0x7dfe('0xe')],{'host':_0x7dfe('0xf'),'port':0x18eb});var socket=require(_0x7dfe('0x10'))(new Redis(config['redis']));require(_0x7dfe('0x11'))[_0x7dfe('0x12')](socket);function respondWithRpcPromise(_0x3fe16a,_0x40b683,_0x46e829){return new BPromise(function(_0x470e4d,_0x1d11da){return client[_0x7dfe('0x13')](_0x3fe16a,_0x46e829)[_0x7dfe('0x14')](function(_0x5b5e84){logger[_0x7dfe('0x15')](_0x7dfe('0x16'),_0x40b683,_0x7dfe('0x17'));logger['debug']('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x40b683,_0x7dfe('0x17'),JSON[_0x7dfe('0x18')](_0x5b5e84));if(_0x5b5e84[_0x7dfe('0x19')]){if(_0x5b5e84['error'][_0x7dfe('0x1a')]===0x1f4){logger['error'](_0x7dfe('0x16'),_0x40b683,_0x5b5e84[_0x7dfe('0x19')][_0x7dfe('0x1b')]);return _0x1d11da(_0x5b5e84[_0x7dfe('0x19')][_0x7dfe('0x1b')]);}logger['error']('FaxInteraction,\x20%s,\x20%s',_0x40b683,_0x5b5e84[_0x7dfe('0x19')]['message']);return _0x470e4d(_0x5b5e84[_0x7dfe('0x19')][_0x7dfe('0x1b')]);}else{logger[_0x7dfe('0x15')](_0x7dfe('0x16'),_0x40b683,_0x7dfe('0x17'));_0x470e4d(_0x5b5e84['result'][_0x7dfe('0x1b')]);}})['catch'](function(_0x1e90fe){logger[_0x7dfe('0x19')](_0x7dfe('0x16'),_0x40b683,_0x1e90fe);_0x1d11da(_0x1e90fe);});});}exports[_0x7dfe('0x1c')]=function(_0x26c1da){var _0x4e1af4=this;return new Promise(function(_0x3d0b09,_0x4dfbaa){return db['FaxInteraction'][_0x7dfe('0x1d')](_0x26c1da[_0x7dfe('0x1e')],{'raw':_0x26c1da['options']?_0x26c1da[_0x7dfe('0x1f')][_0x7dfe('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x26c1da[_0x7dfe('0x1f')]?_0x26c1da[_0x7dfe('0x1f')][_0x7dfe('0x21')]||null:null,'attributes':_0x26c1da[_0x7dfe('0x1f')]?_0x26c1da[_0x7dfe('0x1f')][_0x7dfe('0x22')]||null:null,'limit':_0x26c1da['options']?_0x26c1da[_0x7dfe('0x1f')][_0x7dfe('0x23')]||null:null})[_0x7dfe('0x14')](function(_0x5101b3){logger['info']('UpdateFaxInteraction',_0x26c1da);logger[_0x7dfe('0x24')](_0x7dfe('0x1c'),_0x26c1da,JSON[_0x7dfe('0x18')](_0x5101b3));_0x3d0b09(_0x5101b3);})[_0x7dfe('0x25')](function(_0x9bdbc8){logger['error'](_0x7dfe('0x1c'),_0x9bdbc8[_0x7dfe('0x1b')],_0x26c1da);_0x4dfbaa(_0x4e1af4[_0x7dfe('0x19')](0x1f4,_0x9bdbc8[_0x7dfe('0x1b')]));});});};exports[_0x7dfe('0x26')]=function(_0x53da7c){return new Promise(function(_0x7fbf6f,_0x1e946d){return db[_0x7dfe('0x27')][_0x7dfe('0x28')]({'where':_0x53da7c[_0x7dfe('0x1f')]?_0x53da7c[_0x7dfe('0x1f')][_0x7dfe('0x21')]||null:null})[_0x7dfe('0x14')](function(_0x59d674){if(_0x59d674){return _0x59d674['addTags'](_0x53da7c['body'][_0x7dfe('0x29')],_[_0x7dfe('0x2a')](_0x53da7c[_0x7dfe('0x1e')],[_0x7dfe('0x29'),'id'])||{});}})[_0x7dfe('0x2b')](function(_0x3384b7){logger[_0x7dfe('0x15')](_0x7dfe('0x2c'),_0x53da7c);logger[_0x7dfe('0x24')]('AddTags',_0x53da7c,JSON[_0x7dfe('0x18')](_0x3384b7));_0x7fbf6f(_0x3384b7);})[_0x7dfe('0x25')](function(_0x43e54a){logger['error'](_0x7dfe('0x2c'),_0x43e54a['message'],_0x53da7c);_0x1e946d(_this[_0x7dfe('0x19')](0x1f4,_0x43e54a['message']));});});}; \ No newline at end of file +var _0x8a87=['FaxInteraction','update','body','options','raw','where','attributes','then','catch','AddTagsToFaxInteraction','find','addTags','ids','omit','AddTags','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','register','info','FaxInteraction,\x20%s,\x20%s','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','UpdateFaxInteraction'];(function(_0x57989a,_0x3cf3f6){var _0x219ba0=function(_0x38a155){while(--_0x38a155){_0x57989a['push'](_0x57989a['shift']());}};_0x219ba0(++_0x3cf3f6);}(_0x8a87,0x147));var _0x78a8=function(_0x4dc8c6,_0x3fba52){_0x4dc8c6=_0x4dc8c6-0x0;var _0x69ce1d=_0x8a87[_0x4dc8c6];return _0x69ce1d;};'use strict';var _=require(_0x78a8('0x0'));var util=require(_0x78a8('0x1'));var moment=require('moment');var BPromise=require(_0x78a8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x78a8('0x3'));var db=require(_0x78a8('0x4'))['db'];var utils=require(_0x78a8('0x5'));var logger=require(_0x78a8('0x6'))(_0x78a8('0x7'));var config=require(_0x78a8('0x8'));var jayson=require(_0x78a8('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x78a8('0xa')]=_[_0x78a8('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x78a8('0xa')]));require('./faxInteraction.socket')[_0x78a8('0xc')](socket);function respondWithRpcPromise(_0x48faaa,_0x44135b,_0x5c7e10){return new BPromise(function(_0x9b22ce,_0x5882f1){return client['request'](_0x48faaa,_0x5c7e10)['then'](function(_0x2d0987){logger[_0x78a8('0xd')](_0x78a8('0xe'),_0x44135b,'request\x20sent');logger[_0x78a8('0xf')](_0x78a8('0x10'),_0x44135b,_0x78a8('0x11'),JSON[_0x78a8('0x12')](_0x2d0987));if(_0x2d0987['error']){if(_0x2d0987['error'][_0x78a8('0x13')]===0x1f4){logger[_0x78a8('0x14')](_0x78a8('0xe'),_0x44135b,_0x2d0987['error'][_0x78a8('0x15')]);return _0x5882f1(_0x2d0987[_0x78a8('0x14')]['message']);}logger[_0x78a8('0x14')]('FaxInteraction,\x20%s,\x20%s',_0x44135b,_0x2d0987[_0x78a8('0x14')][_0x78a8('0x15')]);return _0x9b22ce(_0x2d0987[_0x78a8('0x14')][_0x78a8('0x15')]);}else{logger[_0x78a8('0xd')](_0x78a8('0xe'),_0x44135b,_0x78a8('0x11'));_0x9b22ce(_0x2d0987[_0x78a8('0x16')][_0x78a8('0x15')]);}})['catch'](function(_0x4717fe){logger[_0x78a8('0x14')](_0x78a8('0xe'),_0x44135b,_0x4717fe);_0x5882f1(_0x4717fe);});});}exports[_0x78a8('0x17')]=function(_0x18f68b){var _0x17f8d5=this;return new Promise(function(_0x111da4,_0x11efc9){return db[_0x78a8('0x18')][_0x78a8('0x19')](_0x18f68b[_0x78a8('0x1a')],{'raw':_0x18f68b[_0x78a8('0x1b')]?_0x18f68b[_0x78a8('0x1b')][_0x78a8('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x18f68b[_0x78a8('0x1b')]?_0x18f68b[_0x78a8('0x1b')][_0x78a8('0x1d')]||null:null,'attributes':_0x18f68b[_0x78a8('0x1b')]?_0x18f68b[_0x78a8('0x1b')][_0x78a8('0x1e')]||null:null,'limit':_0x18f68b['options']?_0x18f68b[_0x78a8('0x1b')]['limit']||null:null})[_0x78a8('0x1f')](function(_0x537419){logger['info'](_0x78a8('0x17'),_0x18f68b);logger['debug'](_0x78a8('0x17'),_0x18f68b,JSON['stringify'](_0x537419));_0x111da4(_0x537419);})[_0x78a8('0x20')](function(_0x225355){logger[_0x78a8('0x14')]('UpdateFaxInteraction',_0x225355[_0x78a8('0x15')],_0x18f68b);_0x11efc9(_0x17f8d5[_0x78a8('0x14')](0x1f4,_0x225355['message']));});});};exports[_0x78a8('0x21')]=function(_0xbcdba0){return new Promise(function(_0x3522b9,_0x2b2557){return db['FaxInteraction'][_0x78a8('0x22')]({'where':_0xbcdba0[_0x78a8('0x1b')]?_0xbcdba0[_0x78a8('0x1b')][_0x78a8('0x1d')]||null:null})[_0x78a8('0x1f')](function(_0xd98fcd){if(_0xd98fcd){return _0xd98fcd[_0x78a8('0x23')](_0xbcdba0[_0x78a8('0x1a')][_0x78a8('0x24')],_[_0x78a8('0x25')](_0xbcdba0['body'],['ids','id'])||{});}})['spread'](function(_0x2c1ec1){logger[_0x78a8('0xd')](_0x78a8('0x26'),_0xbcdba0);logger[_0x78a8('0xf')](_0x78a8('0x26'),_0xbcdba0,JSON['stringify'](_0x2c1ec1));_0x3522b9(_0x2c1ec1);})[_0x78a8('0x20')](function(_0x4ef657){logger[_0x78a8('0x14')](_0x78a8('0x26'),_0x4ef657[_0x78a8('0x15')],_0xbcdba0);_0x2b2557(_this[_0x78a8('0x14')](0x1f4,_0x4ef657['message']));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 368306f..59ff923 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 _0xbbc9=['emit','removeListener','length','./faxInteraction.events','save','update'];(function(_0x29cfb4,_0x2154b9){var _0xf782a8=function(_0x2d8e25){while(--_0x2d8e25){_0x29cfb4['push'](_0x29cfb4['shift']());}};_0xf782a8(++_0x2154b9);}(_0xbbc9,0x195));var _0x9bbc=function(_0x472ff2,_0x559096){_0x472ff2=_0x472ff2-0x0;var _0x5b4ce1=_0xbbc9[_0x472ff2];return _0x5b4ce1;};'use strict';var FaxInteractionEvents=require(_0x9bbc('0x0'));var events=[_0x9bbc('0x1'),'remove',_0x9bbc('0x2')];function createListener(_0x319e19,_0x5abb79){return function(_0xf2fb09){_0x5abb79[_0x9bbc('0x3')](_0x319e19,_0xf2fb09);};}function removeListener(_0x188bfa,_0x36cfb5){return function(){FaxInteractionEvents[_0x9bbc('0x4')](_0x188bfa,_0x36cfb5);};}exports['register']=function(_0x4d7ccc){for(var _0xcf0ce8=0x0,_0x3c58d1=events[_0x9bbc('0x5')];_0xcf0ce8<_0x3c58d1;_0xcf0ce8++){var _0x1361c4=events[_0xcf0ce8];var _0x14f33d=createListener('faxInteraction:'+_0x1361c4,_0x4d7ccc);FaxInteractionEvents['on'](_0x1361c4,_0x14f33d);}}; \ No newline at end of file +var _0xa23b=['emit','removeListener','save','remove','update'];(function(_0x582d37,_0xc34a90){var _0x4aa6b6=function(_0x47224a){while(--_0x47224a){_0x582d37['push'](_0x582d37['shift']());}};_0x4aa6b6(++_0xc34a90);}(_0xa23b,0x9d));var _0xba23=function(_0x370f3f,_0x5d2a1b){_0x370f3f=_0x370f3f-0x0;var _0x5108c1=_0xa23b[_0x370f3f];return _0x5108c1;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0xba23('0x0'),_0xba23('0x1'),_0xba23('0x2')];function createListener(_0x4b94bb,_0x42e63a){return function(_0xf0883c){_0x42e63a[_0xba23('0x3')](_0x4b94bb,_0xf0883c);};}function removeListener(_0x549f71,_0xd7b8f0){return function(){FaxInteractionEvents[_0xba23('0x4')](_0x549f71,_0xd7b8f0);};}exports['register']=function(_0x235ec1){for(var _0x158461=0x0,_0x1ba99e=events['length'];_0x158461<_0x1ba99e;_0x158461++){var _0x57a5c0=events[_0x158461];var _0x723684=createListener('faxInteraction:'+_0x57a5c0,_0x235ec1);FaxInteractionEvents['on'](_0x57a5c0,_0x723684);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 3a45d1d..00c222f 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 _0x919c=['post','addMessage','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','update','delete','destroy','removeTags','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/messages','getMessages','/:id/download','download','create'];(function(_0x993e7d,_0x4b7f76){var _0x4de01e=function(_0x63a895){while(--_0x63a895){_0x993e7d['push'](_0x993e7d['shift']());}};_0x4de01e(++_0x4b7f76);}(_0x919c,0xcc));var _0xc919=function(_0x2bdac,_0x5b0a5f){_0x2bdac=_0x2bdac-0x0;var _0x281d09=_0x919c[_0x2bdac];return _0x281d09;};'use strict';var multer=require(_0xc919('0x0'));var util=require('util');var path=require(_0xc919('0x1'));var timeout=require(_0xc919('0x2'));var express=require(_0xc919('0x3'));var router=express[_0xc919('0x4')]();var fs_extra=require(_0xc919('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc919('0x6'));var config=require(_0xc919('0x7'));var controller=require(_0xc919('0x8'));router[_0xc919('0x9')]('/',auth[_0xc919('0xa')](),controller[_0xc919('0xb')]);router[_0xc919('0x9')](_0xc919('0xc'),auth['isAuthenticated'](),controller[_0xc919('0xd')]);router[_0xc919('0x9')](_0xc919('0xe'),auth[_0xc919('0xa')](),controller['show']);router[_0xc919('0x9')](_0xc919('0xf'),auth['isAuthenticated'](),controller[_0xc919('0x10')]);router[_0xc919('0x9')](_0xc919('0x11'),auth['isAuthenticated'](),controller[_0xc919('0x12')]);router['post']('/',auth[_0xc919('0xa')](),controller[_0xc919('0x13')]);router[_0xc919('0x14')](_0xc919('0xf'),auth[_0xc919('0xa')](),controller[_0xc919('0x15')]);router[_0xc919('0x14')](_0xc919('0x16'),auth['isAuthenticated'](),interaction[_0xc919('0x17')](_0xc919('0x18'),_0xc919('0x19')),controller[_0xc919('0x1a')]);router['put'](_0xc919('0xe'),auth[_0xc919('0xa')](),interaction[_0xc919('0x17')](_0xc919('0x18'),'faxinteraction:update'),controller[_0xc919('0x1b')]);router[_0xc919('0x1c')](_0xc919('0xe'),auth[_0xc919('0xa')](),interaction[_0xc919('0x17')](_0xc919('0x18'),'faxinteraction:destroy'),controller[_0xc919('0x1d')]);router[_0xc919('0x1c')]('/:id/tags',auth[_0xc919('0xa')](),controller[_0xc919('0x1e')]);module[_0xc919('0x1f')]=router; \ No newline at end of file +var _0x805b=['faxinteraction:destroy','destroy','/:id/tags','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxInteraction.controller','get','index','/:id','isAuthenticated','getMessages','/:id/download','download','post','/:id/messages','addMessage','tracked','addTags','put','fax','update','delete'];(function(_0x4360c4,_0x2f8209){var _0x3168c8=function(_0x309523){while(--_0x309523){_0x4360c4['push'](_0x4360c4['shift']());}};_0x3168c8(++_0x2f8209);}(_0x805b,0x17c));var _0xb805=function(_0x40e5ac,_0x3fd4b0){_0x40e5ac=_0x40e5ac-0x0;var _0x366bae=_0x805b[_0x40e5ac];return _0x366bae;};'use strict';var multer=require(_0xb805('0x0'));var util=require(_0xb805('0x1'));var path=require(_0xb805('0x2'));var timeout=require(_0xb805('0x3'));var express=require(_0xb805('0x4'));var router=express[_0xb805('0x5')]();var fs_extra=require(_0xb805('0x6'));var auth=require(_0xb805('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xb805('0x8'));var controller=require(_0xb805('0x9'));router[_0xb805('0xa')]('/',auth['isAuthenticated'](),controller[_0xb805('0xb')]);router[_0xb805('0xa')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xb805('0xa')](_0xb805('0xc'),auth[_0xb805('0xd')](),controller['show']);router[_0xb805('0xa')]('/:id/messages',auth['isAuthenticated'](),controller[_0xb805('0xe')]);router[_0xb805('0xa')](_0xb805('0xf'),auth[_0xb805('0xd')](),controller[_0xb805('0x10')]);router[_0xb805('0x11')]('/',auth[_0xb805('0xd')](),controller['create']);router['post'](_0xb805('0x12'),auth[_0xb805('0xd')](),controller[_0xb805('0x13')]);router['post']('/:id/tags',auth[_0xb805('0xd')](),interaction[_0xb805('0x14')]('fax','faxinteraction:addtags'),controller[_0xb805('0x15')]);router[_0xb805('0x16')](_0xb805('0xc'),auth[_0xb805('0xd')](),interaction[_0xb805('0x14')](_0xb805('0x17'),'faxinteraction:update'),controller[_0xb805('0x18')]);router[_0xb805('0x19')]('/:id',auth[_0xb805('0xd')](),interaction['tracked'](_0xb805('0x17'),_0xb805('0x1a')),controller[_0xb805('0x1b')]);router[_0xb805('0x19')](_0xb805('0x1c'),auth['isAuthenticated'](),controller['removeTags']);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 9606212..1e9f177 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 _0xde9d=['sequelize','exports','TEXT','medium','BOOLEAN','out'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xde9d,0x156));var _0xdde9=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xde9d[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xdde9('0x0'));module[_0xdde9('0x1')]={'body':{'type':Sequelize[_0xdde9('0x2')](_0xdde9('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xdde9('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xdde9('0x5')),'defaultValue':_0xdde9('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xdde9('0x2')],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x8664=['ENUM','out','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x40b551,_0x129c88){var _0x452ea9=function(_0x3b6523){while(--_0x3b6523){_0x40b551['push'](_0x40b551['shift']());}};_0x452ea9(++_0x129c88);}(_0x8664,0x11a));var _0x4866=function(_0x58bc0c,_0x39db28){_0x58bc0c=_0x58bc0c-0x0;var _0xea6fff=_0x8664[_0x58bc0c];return _0xea6fff;};'use strict';var Sequelize=require(_0x4866('0x0'));module[_0x4866('0x1')]={'body':{'type':Sequelize[_0x4866('0x2')](_0x4866('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x4866('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x4866('0x5')]('in',_0x4866('0x6')),'defaultValue':_0x4866('0x6'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x4866('0x2')],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 1b27c91..776fb06 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 _0x5ff8=['acceptmessage','fax-interactions','reject','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','User','fullname','event','rejectmessage','create','CmContact','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','server','attachments','Attachment','zip-dir','moment','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/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','info','FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','stack','name','send','index','map','FaxMessage','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','filter','merge','where','options','findAll','rows','params','includeAll','find','body','destroy','describe','accept','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','FaxInteraction','FaxInteractionId','isNil','interaction','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','email','internal','agent','interface','SIP/%s','channel','EventManager'];(function(_0x2f92c1,_0xe5ea43){var _0x5280c2=function(_0x39e2f9){while(--_0x39e2f9){_0x2f92c1['push'](_0x2f92c1['shift']());}};_0x5280c2(++_0xe5ea43);}(_0x5ff8,0xa0));var _0x85ff=function(_0x4f53d0,_0x4485ac){_0x4f53d0=_0x4f53d0-0x0;var _0x434bf7=_0x5ff8[_0x4f53d0];return _0x434bf7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x85ff('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x85ff('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x85ff('0x2'));var util=require(_0x85ff('0x3'));var path=require(_0x85ff('0x4'));var sox=require(_0x85ff('0x5'));var csv=require(_0x85ff('0x6'));var ejs=require(_0x85ff('0x7'));var fs=require('fs');var fs_extra=require(_0x85ff('0x8'));var _=require(_0x85ff('0x9'));var squel=require(_0x85ff('0xa'));var crypto=require(_0x85ff('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x85ff('0xc'));var toCsv=require(_0x85ff('0x6'));var querystring=require(_0x85ff('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x85ff('0xe'));var qs=require(_0x85ff('0xf'));var as=require(_0x85ff('0x10'));var hardwareService=require(_0x85ff('0x11'));var logger=require(_0x85ff('0x12'))('api');var utils=require(_0x85ff('0x13'));var config=require(_0x85ff('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x85ff('0x15'))['db'];config[_0x85ff('0x16')]=_['defaults'](config['redis'],{'host':_0x85ff('0x17'),'port':0x18eb});var socket=require(_0x85ff('0x18'))(new Redis(config[_0x85ff('0x16')]));require(_0x85ff('0x19'))[_0x85ff('0x1a')](socket);var jayson=require(_0x85ff('0x1b'));var client=jayson[_0x85ff('0x1c')][_0x85ff('0x1d')]({'port':0x232c});var client9002=jayson[_0x85ff('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2aee25,_0x1d6361,_0x3dced7,_0xcb8de9){return new BPromise(function(_0x2f1d40,_0xea8cef){var _0x3f9fd4=_0xcb8de9||client;return _0x3f9fd4['request'](_0x2aee25,_0x3dced7)['then'](function(_0x3f13f3){logger[_0x85ff('0x1e')](_0x85ff('0x1f'),_0x1d6361,'request\x20sent');logger[_0x85ff('0x20')](_0x85ff('0x21'),_0x1d6361,_0x85ff('0x22'),JSON['stringify'](_0x3f13f3));if(_0x3f13f3[_0x85ff('0x23')]){if(_0x3f13f3[_0x85ff('0x23')][_0x85ff('0x24')]===0x1f4){logger[_0x85ff('0x23')](_0x85ff('0x1f'),_0x1d6361,_0x3f13f3[_0x85ff('0x23')][_0x85ff('0x25')]);return _0xea8cef(_0x3f13f3[_0x85ff('0x23')]['message']);}logger[_0x85ff('0x23')](_0x85ff('0x1f'),_0x1d6361,_0x3f13f3[_0x85ff('0x23')][_0x85ff('0x25')]);return _0x2f1d40(_0x3f13f3[_0x85ff('0x23')][_0x85ff('0x25')]);}else{logger[_0x85ff('0x1e')]('FaxMessage,\x20%s,\x20%s',_0x1d6361,_0x85ff('0x22'));_0x2f1d40(_0x3f13f3['result'][_0x85ff('0x25')]);}})[_0x85ff('0x26')](function(_0x47a3e1){logger['error'](_0x85ff('0x1f'),_0x1d6361,_0x47a3e1);_0xea8cef(_0x47a3e1);});});}function respondWithStatusCode(_0x38cdc5,_0x1658e8){_0x1658e8=_0x1658e8||0xcc;return function(_0x50c138){if(_0x50c138){return _0x38cdc5[_0x85ff('0x27')](_0x1658e8);}return _0x38cdc5[_0x85ff('0x28')](_0x1658e8)[_0x85ff('0x29')]();};}function respondWithResult(_0x381c76,_0x560b48){_0x560b48=_0x560b48||0xc8;return function(_0x136738){if(_0x136738){return _0x381c76[_0x85ff('0x28')](_0x560b48)[_0x85ff('0x2a')](_0x136738);}};}function respondWithFilteredResult(_0x2a77ef,_0x1b363c){return function(_0x17a722){if(_0x17a722){var _0x1dd0ab=typeof _0x1b363c[_0x85ff('0x2b')]==='undefined'&&typeof _0x1b363c[_0x85ff('0x2c')]===_0x85ff('0x2d');var _0x4d0ede=_0x17a722['count'];var _0x50ed3b=_0x1dd0ab?0x0:_0x1b363c[_0x85ff('0x2b')];var _0x82fea4=_0x1dd0ab?_0x17a722[_0x85ff('0x2e')]:_0x1b363c[_0x85ff('0x2b')]+_0x1b363c[_0x85ff('0x2c')];var _0x243f8a;if(_0x82fea4>=_0x4d0ede){_0x82fea4=_0x4d0ede;_0x243f8a=0xc8;}else{_0x243f8a=0xce;}_0x2a77ef[_0x85ff('0x28')](_0x243f8a);return _0x2a77ef[_0x85ff('0x2f')](_0x85ff('0x30'),_0x50ed3b+'-'+_0x82fea4+'/'+_0x4d0ede)[_0x85ff('0x2a')](_0x17a722);}return null;};}function patchUpdates(_0x437559){return function(_0xe0391d){try{jsonpatch[_0x85ff('0x31')](_0xe0391d,_0x437559,!![]);}catch(_0x5964d2){return BPromise['reject'](_0x5964d2);}return _0xe0391d[_0x85ff('0x32')]();};}function saveUpdates(_0x2b315a,_0x2d34fa){return function(_0xdce9b1){if(_0xdce9b1){return _0xdce9b1[_0x85ff('0x33')](_0x2b315a)[_0x85ff('0x34')](function(_0x5cd863){return _0x5cd863;});}return null;};}function removeEntity(_0x2bc549,_0x102754){return function(_0x1bff5b){if(_0x1bff5b){return _0x1bff5b['destroy']()[_0x85ff('0x34')](function(){_0x2bc549['status'](0xcc)[_0x85ff('0x29')]();});}};}function handleEntityNotFound(_0x1b6b8e,_0x96553f){return function(_0x1c68ac){if(!_0x1c68ac){_0x1b6b8e['sendStatus'](0x194);}return _0x1c68ac;};}function handleError(_0xb1fa42,_0x509f78){_0x509f78=_0x509f78||0x1f4;return function(_0x1aa331){logger[_0x85ff('0x23')](_0x1aa331[_0x85ff('0x35')]);if(_0x1aa331[_0x85ff('0x36')]){delete _0x1aa331[_0x85ff('0x36')];}_0xb1fa42[_0x85ff('0x28')](_0x509f78)[_0x85ff('0x37')](_0x1aa331);};}exports[_0x85ff('0x38')]=function(_0x497922,_0x249bfd){var _0x2cb649={},_0x525ce4={},_0x4ee455={'count':0x0,'rows':[]};var _0xdb0590=_[_0x85ff('0x39')](db[_0x85ff('0x3a')][_0x85ff('0x3b')],function(_0x394e2d){return{'name':_0x394e2d[_0x85ff('0x3c')],'type':_0x394e2d[_0x85ff('0x3d')]['key']};});_0x525ce4[_0x85ff('0x3e')]=_[_0x85ff('0x39')](_0xdb0590,_0x85ff('0x36'));_0x525ce4[_0x85ff('0x3f')]=_[_0x85ff('0x40')](_0x497922[_0x85ff('0x3f')]);_0x525ce4[_0x85ff('0x41')]=_[_0x85ff('0x42')](_0x525ce4[_0x85ff('0x3e')],_0x525ce4['query']);_0x2cb649['attributes']=_[_0x85ff('0x42')](_0x525ce4[_0x85ff('0x3e')],qs[_0x85ff('0x43')](_0x497922[_0x85ff('0x3f')]['fields']));_0x2cb649[_0x85ff('0x44')]=_0x2cb649[_0x85ff('0x44')][_0x85ff('0x45')]?_0x2cb649[_0x85ff('0x44')]:_0x525ce4[_0x85ff('0x3e')];if(!_0x497922['query']['hasOwnProperty'](_0x85ff('0x46'))){_0x2cb649[_0x85ff('0x2c')]=qs[_0x85ff('0x2c')](_0x497922[_0x85ff('0x3f')]['limit']);_0x2cb649['offset']=qs[_0x85ff('0x2b')](_0x497922[_0x85ff('0x3f')][_0x85ff('0x2b')]);}_0x2cb649[_0x85ff('0x47')]=qs[_0x85ff('0x48')](_0x497922[_0x85ff('0x3f')][_0x85ff('0x48')]);_0x2cb649['where']=qs['filters'](_[_0x85ff('0x49')](_0x497922['query'],_0x525ce4[_0x85ff('0x41')]),_0xdb0590);if(_0x497922[_0x85ff('0x3f')][_0x85ff('0x4a')]){_0x2cb649['where']=_[_0x85ff('0x4b')](_0x2cb649[_0x85ff('0x4c')],{'$or':_['map'](_0xdb0590,function(_0x4caa02){if(_0x4caa02[_0x85ff('0x3d')]!=='VIRTUAL'){var _0x5b734e={};_0x5b734e[_0x4caa02['name']]={'$like':'%'+_0x497922['query']['filter']+'%'};return _0x5b734e;}})});}_0x2cb649=_[_0x85ff('0x4b')]({},_0x2cb649,_0x497922[_0x85ff('0x4d')]);var _0x1e4d8b={'where':_0x2cb649['where']};return db[_0x85ff('0x3a')]['count'](_0x1e4d8b)[_0x85ff('0x34')](function(_0x5b9251){_0x4ee455[_0x85ff('0x2e')]=_0x5b9251;if(_0x497922['query']['includeAll']){_0x2cb649['include']=[{'all':!![]}];}return db[_0x85ff('0x3a')][_0x85ff('0x4e')](_0x2cb649);})[_0x85ff('0x34')](function(_0xbdc46b){_0x4ee455[_0x85ff('0x4f')]=_0xbdc46b;return _0x4ee455;})[_0x85ff('0x34')](respondWithFilteredResult(_0x249bfd,_0x2cb649))[_0x85ff('0x26')](handleError(_0x249bfd,null));};exports['show']=function(_0x4d5140,_0x3fb0f2){var _0x42c465={'raw':!![],'where':{'id':_0x4d5140[_0x85ff('0x50')]['id']}},_0x262257={};_0x262257[_0x85ff('0x3e')]=_[_0x85ff('0x40')](db[_0x85ff('0x3a')][_0x85ff('0x3b')]);_0x262257[_0x85ff('0x3f')]=_[_0x85ff('0x40')](_0x4d5140[_0x85ff('0x3f')]);_0x262257[_0x85ff('0x41')]=_['intersection'](_0x262257[_0x85ff('0x3e')],_0x262257[_0x85ff('0x3f')]);_0x42c465['attributes']=_[_0x85ff('0x42')](_0x262257['model'],qs['fields'](_0x4d5140[_0x85ff('0x3f')][_0x85ff('0x43')]));_0x42c465[_0x85ff('0x44')]=_0x42c465['attributes'][_0x85ff('0x45')]?_0x42c465[_0x85ff('0x44')]:_0x262257[_0x85ff('0x3e')];if(_0x4d5140[_0x85ff('0x3f')][_0x85ff('0x51')]){_0x42c465['include']=[{'all':!![]}];}_0x42c465=_[_0x85ff('0x4b')]({},_0x42c465,_0x4d5140[_0x85ff('0x4d')]);return db[_0x85ff('0x3a')][_0x85ff('0x52')](_0x42c465)[_0x85ff('0x34')](handleEntityNotFound(_0x3fb0f2,null))[_0x85ff('0x34')](respondWithResult(_0x3fb0f2,null))['catch'](handleError(_0x3fb0f2,null));};exports[_0x85ff('0x33')]=function(_0x42b936,_0x34b534){if(_0x42b936[_0x85ff('0x53')]['id']){delete _0x42b936[_0x85ff('0x53')]['id'];}return db[_0x85ff('0x3a')]['find']({'where':{'id':_0x42b936[_0x85ff('0x50')]['id']}})['then'](handleEntityNotFound(_0x34b534,null))[_0x85ff('0x34')](saveUpdates(_0x42b936['body'],null))[_0x85ff('0x34')](respondWithResult(_0x34b534,null))[_0x85ff('0x26')](handleError(_0x34b534,null));};exports[_0x85ff('0x54')]=function(_0x3867bd,_0x3efaa1){return db[_0x85ff('0x3a')][_0x85ff('0x52')]({'where':{'id':_0x3867bd['params']['id']}})[_0x85ff('0x34')](handleEntityNotFound(_0x3efaa1,null))[_0x85ff('0x34')](removeEntity(_0x3efaa1,null))['catch'](handleError(_0x3efaa1,null));};exports[_0x85ff('0x55')]=function(_0x4ced32,_0x2253df){return db[_0x85ff('0x3a')][_0x85ff('0x55')]()[_0x85ff('0x34')](respondWithResult(_0x2253df,null))[_0x85ff('0x26')](handleError(_0x2253df,null));};var interaction_log=require(_0x85ff('0x12'))('fax-interactions');exports[_0x85ff('0x56')]=function(_0x3ef995,_0x5bb5bb,_0x17eb12){var _0x462e8a={'agent':{},'channel':_0x85ff('0x57')};if(_0x3ef995['body']['id']){delete _0x3ef995[_0x85ff('0x53')]['id'];}_0x3ef995['body'][_0x85ff('0x58')]=!![];_0x3ef995['body'][_0x85ff('0x59')]=moment()[_0x85ff('0x5a')](_0x85ff('0x5b'));_0x3ef995[_0x85ff('0x53')][_0x85ff('0x5c')]=_0x3ef995[_0x85ff('0x53')]['UserId']||_0x3ef995[_0x85ff('0x5d')]['id'];_0x462e8a['agent']['id']=_0x3ef995['body'][_0x85ff('0x5c')];return db[_0x85ff('0x3a')][_0x85ff('0x52')]({'where':{'id':_0x3ef995[_0x85ff('0x50')]['id'],'UserId':null}})[_0x85ff('0x34')](handleEntityNotFound(_0x5bb5bb,null))[_0x85ff('0x34')](saveUpdates(_0x3ef995[_0x85ff('0x53')],null))[_0x85ff('0x34')](function(_0x20dfee){if(_0x20dfee){_0x462e8a[_0x85ff('0x25')]=_0x20dfee[_0x85ff('0x5e')]({'plain':!![]});return db[_0x85ff('0x5f')][_0x85ff('0x52')]({'where':{'id':_0x20dfee[_0x85ff('0x60')]}});}return null;})[_0x85ff('0x34')](handleEntityNotFound(_0x5bb5bb,null))[_0x85ff('0x34')](function(_0x51010b){if(_0x51010b){return _0x51010b['update']({'UserId':_0x3ef995[_0x85ff('0x53')]['UserId'],'read1stAt':_[_0x85ff('0x61')](_0x51010b['read1stAt'])?moment()[_0x85ff('0x5a')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x85ff('0x34')](function(_0x9eb023){if(_0x9eb023){_0x462e8a[_0x85ff('0x62')]=_0x9eb023['get']({'plain':!![]});interaction_log[_0x85ff('0x1e')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3ef995[_0x85ff('0x5d')]['id'],_0x3ef995[_0x85ff('0x5d')][_0x85ff('0x36')],_0x3ef995['user'][_0x85ff('0x63')],_0x462e8a[_0x85ff('0x62')]['id'],_0x3ef995[_0x85ff('0x53')]?JSON['stringify'](_0x3ef995[_0x85ff('0x53')]):_0x85ff('0x64'));return respondWithRpcPromise('AcceptMessage',_0x85ff('0x65'),_0x462e8a);}return null;})[_0x85ff('0x34')](function(_0x2583e6){var _0xc2168e=_0x85ff('0x66')+_0x2583e6[_0x85ff('0x25')][_0x85ff('0x67')];return db[_0x85ff('0x68')]['query'](_0xc2168e,{'type':db[_0x85ff('0x69')][_0x85ff('0x6a')][_0x85ff('0x6b')],'raw':!![]})[_0x85ff('0x34')](function(_0x132ab5){return _0x132ab5;});})['then'](function(_0x56c6a4){if(_0x56c6a4){_0x462e8a[_0x85ff('0x25')][_0x85ff('0x6c')]=_0x56c6a4[0x0];if(!_0x3ef995[_0x85ff('0x53')][_0x85ff('0x5c')])return;return db['User'][_0x85ff('0x52')]({'where':{'id':_0x3ef995[_0x85ff('0x53')][_0x85ff('0x5c')],'role':'agent'},'attributes':['id',_0x85ff('0x36'),'fullname',_0x85ff('0x6d'),_0x85ff('0x6e')],'raw':!![]});}return null;})[_0x85ff('0x34')](function(_0x1e4784){if(!_0x1e4784)return null;_0x462e8a[_0x85ff('0x25')][_0x85ff('0x6f')]=_0x1e4784;return _0x462e8a;})[_0x85ff('0x34')](function(_0x3573f6){if(_0x3573f6){if(_0x3ef995['body']['manual']){_0x462e8a[_0x85ff('0x25')][_0x85ff('0x70')]=util[_0x85ff('0x5a')](_0x85ff('0x71'),_0x3ef995[_0x85ff('0x5d')]['name']);_0x462e8a[_0x85ff('0x25')][_0x85ff('0x72')]=_0x462e8a[_0x85ff('0x72')];_0x462e8a[_0x85ff('0x25')]['event']=_0x85ff('0x56');return respondWithRpcPromise(_0x85ff('0x73'),_0x85ff('0x73'),{'event':_0x85ff('0x74'),'message':_0x462e8a[_0x85ff('0x25')]},client9002)[_0x85ff('0x34')](function(){return _0x462e8a;});}return _0x462e8a;}return null;})[_0x85ff('0x34')](respondWithResult(_0x5bb5bb,null))[_0x85ff('0x26')](handleError(_0x5bb5bb,null));};var interaction_log=require(_0x85ff('0x12'))(_0x85ff('0x75'));exports[_0x85ff('0x76')]=function(_0x479a4e,_0x14adbb,_0x13d8f0){var _0x4e3290={'agent':{},'channel':_0x85ff('0x57')};if(_0x479a4e[_0x85ff('0x53')]['id']){delete _0x479a4e['body']['id'];}_0x479a4e[_0x85ff('0x53')][_0x85ff('0x5c')]=_0x479a4e[_0x85ff('0x53')][_0x85ff('0x5c')]||_0x479a4e['user']['id'];_0x4e3290[_0x85ff('0x6f')]['id']=_0x479a4e['body'][_0x85ff('0x5c')];return db[_0x85ff('0x3a')][_0x85ff('0x52')]({'where':{'id':_0x479a4e[_0x85ff('0x50')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x14adbb,null))[_0x85ff('0x34')](function(_0x1a0e7b){if(_0x1a0e7b){_0x4e3290[_0x85ff('0x25')]=_0x1a0e7b['get']({'plain':!![]});return db[_0x85ff('0x5f')][_0x85ff('0x52')]({'where':{'id':_0x1a0e7b['FaxInteractionId']}});}return null;})[_0x85ff('0x34')](handleEntityNotFound(_0x14adbb,null))[_0x85ff('0x34')](function(_0x11394a){if(_0x11394a){_0x4e3290[_0x85ff('0x62')]=_0x11394a[_0x85ff('0x5e')]({'plain':!![]});interaction_log[_0x85ff('0x1e')](_0x85ff('0x77'),_0x479a4e[_0x85ff('0x5d')]['id'],_0x479a4e[_0x85ff('0x5d')][_0x85ff('0x36')],_0x479a4e[_0x85ff('0x5d')][_0x85ff('0x63')],_0x4e3290[_0x85ff('0x62')]['id'],_0x479a4e[_0x85ff('0x53')]?JSON['stringify'](_0x479a4e['body']):'null');return respondWithRpcPromise(_0x85ff('0x78'),'rejectMessage',_0x4e3290);}return null;})[_0x85ff('0x34')](function(_0x4e03e7){var _0x32855b='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4e03e7[_0x85ff('0x25')][_0x85ff('0x67')];return db['sequelize'][_0x85ff('0x3f')](_0x32855b,{'type':db['Sequelize'][_0x85ff('0x6a')][_0x85ff('0x6b')],'raw':!![]})[_0x85ff('0x34')](function(_0x2f0abc){return _0x2f0abc;});})[_0x85ff('0x34')](function(_0x55c227){if(_0x55c227){_0x4e3290['message'][_0x85ff('0x6c')]=_0x55c227[0x0];if(!_0x479a4e[_0x85ff('0x53')][_0x85ff('0x5c')])return;return db[_0x85ff('0x79')]['find']({'where':{'id':_0x479a4e[_0x85ff('0x53')][_0x85ff('0x5c')],'role':_0x85ff('0x6f')},'attributes':['id',_0x85ff('0x36'),_0x85ff('0x7a'),_0x85ff('0x6d'),_0x85ff('0x6e')],'raw':!![]});}return null;})[_0x85ff('0x34')](function(_0x52861d){if(!_0x52861d)return null;_0x4e3290['message'][_0x85ff('0x6f')]=_0x52861d;return _0x4e3290;})[_0x85ff('0x34')](function(_0x788c03){if(_0x788c03){_0x788c03[_0x85ff('0x25')][_0x85ff('0x70')]=util[_0x85ff('0x5a')](_0x85ff('0x71'),_0x479a4e['user'][_0x85ff('0x36')]);_0x788c03['message'][_0x85ff('0x72')]=_0x4e3290[_0x85ff('0x72')];_0x788c03[_0x85ff('0x25')][_0x85ff('0x7b')]=_0x85ff('0x76');respondWithRpcPromise(_0x85ff('0x73'),_0x85ff('0x73'),{'event':_0x85ff('0x7c'),'message':_0x788c03['message']},client9002);return _0x4e3290;}return null;})['then'](respondWithResult(_0x14adbb,null))[_0x85ff('0x26')](handleError(_0x14adbb,null));};exports[_0x85ff('0x7d')]=function(_0x460734,_0x5d5626){var _0x2a29d4;return db[_0x85ff('0x3a')][_0x85ff('0x7d')](_0x460734[_0x85ff('0x53')],{})[_0x85ff('0x34')](function(_0x5aa13b){_0x2a29d4=_0x5aa13b;return db[_0x85ff('0x7e')]['findOne']({'where':{'id':_0x2a29d4[_0x85ff('0x67')]}});})[_0x85ff('0x34')](function(_0x3a4070){if(_['isNil'](_0x3a4070)){return;}else{_0x2a29d4[_0x85ff('0x57')]=_0x3a4070[_0x85ff('0x57')];return db['Attachment']['findOne']({'where':{'id':_0x2a29d4[_0x85ff('0x7f')]}});}})[_0x85ff('0x34')](function(_0x2600b6){return respondWithRpcPromise('SendFax',_0x85ff('0x80'),{'FaxAccountId':_[_0x85ff('0x61')](_0x460734[_0x85ff('0x53')])?undefined:_0x460734['body'][_0x85ff('0x81')],'path':_[_0x85ff('0x61')](_0x2600b6)?undefined:util[_0x85ff('0x5a')](_0x85ff('0x82'),_0x2600b6[_0x85ff('0x83')]),'fax':_[_0x85ff('0x61')](_0x2a29d4[_0x85ff('0x57')])?undefined:_0x2a29d4[_0x85ff('0x57')],'AttachmentId':_0x2a29d4[_0x85ff('0x7f')]},client9002);})['then'](respondWithResult(_0x5d5626,0xc9))[_0x85ff('0x26')](handleError(_0x5d5626,null));};exports[_0x85ff('0x84')]=function(_0x286535,_0x16a6ac){var _0x352c3d=path[_0x85ff('0x85')](config[_0x85ff('0x86')],_0x85ff('0x87'),'files',_0x85ff('0x88'));return db['FaxMessage'][_0x85ff('0x52')]({'where':{'id':_0x286535['params']['id']},'include':[{'model':db[_0x85ff('0x89')],'as':_0x85ff('0x89')}]})[_0x85ff('0x34')](handleEntityNotFound(_0x16a6ac,null))[_0x85ff('0x34')](function(_0x3a2361){if(_0x3a2361){return _0x16a6ac['download'](path[_0x85ff('0x85')](_0x352c3d,_0x3a2361[_0x85ff('0x89')][_0x85ff('0x83')]));}})[_0x85ff('0x26')](handleError(_0x16a6ac,null));}; \ No newline at end of file +var _0x7995=['Content-Range','save','update','destroy','stack','name','send','index','map','FaxMessage','rawAttributes','type','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','include','findAll','rows','show','params','includeAll','find','body','describe','fax-interactions','accept','fax','read','format','YYYY-MM-DD\x20HH:mm:ss','agent','FaxInteraction','UserId','isNil','read1stAt','get','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction','AcceptMessage','acceptMessage','sequelize','Sequelize','QueryTypes','contact','User','fullname','email','internal','manual','channel','EventManager','acceptmessage','reject','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','SELECT','interface','SIP/%s','event','rejectmessage','create','CmContact','Attachment','findOne','AttachmentId','SendFax','FaxAccountId','download','join','root','files','attachments','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','jayson/promise','client','http','request','then','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','FaxMessage,\x20%s,\x20%s','message','info','result','catch','sendStatus','end','status','json','offset','limit','undefined','count','set'];(function(_0x571339,_0x5bcafb){var _0x5af8a6=function(_0x389251){while(--_0x389251){_0x571339['push'](_0x571339['shift']());}};_0x5af8a6(++_0x5bcafb);}(_0x7995,0x17b));var _0x5799=function(_0x576a8d,_0x151a23){_0x576a8d=_0x576a8d-0x0;var _0x4df398=_0x7995[_0x576a8d];return _0x4df398;};'use strict';var emlformat=require(_0x5799('0x0'));var rimraf=require(_0x5799('0x1'));var zipdir=require(_0x5799('0x2'));var jsonpatch=require(_0x5799('0x3'));var rp=require(_0x5799('0x4'));var moment=require(_0x5799('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5799('0x6'));var util=require('util');var path=require(_0x5799('0x7'));var sox=require(_0x5799('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5799('0x9'));var _=require(_0x5799('0xa'));var squel=require(_0x5799('0xb'));var crypto=require('crypto');var jsforce=require(_0x5799('0xc'));var deskjs=require(_0x5799('0xd'));var toCsv=require('to-csv');var querystring=require(_0x5799('0xe'));var Papa=require(_0x5799('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5799('0x10'));var as=require(_0x5799('0x11'));var hardwareService=require(_0x5799('0x12'));var logger=require(_0x5799('0x13'))(_0x5799('0x14'));var utils=require(_0x5799('0x15'));var config=require(_0x5799('0x16'));var licenseUtil=require(_0x5799('0x17'));var db=require('../../mysqldb')['db'];config[_0x5799('0x18')]=_[_0x5799('0x19')](config[_0x5799('0x18')],{'host':_0x5799('0x1a'),'port':0x18eb});var socket=require(_0x5799('0x1b'))(new Redis(config['redis']));require(_0x5799('0x1c'))['register'](socket);var jayson=require(_0x5799('0x1d'));var client=jayson[_0x5799('0x1e')][_0x5799('0x1f')]({'port':0x232c});var client9002=jayson['client'][_0x5799('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x49ba0f,_0x36d73f,_0x49f84a,_0x190221){return new BPromise(function(_0xe4a88d,_0x46b8dd){var _0x3c72cc=_0x190221||client;return _0x3c72cc[_0x5799('0x20')](_0x49ba0f,_0x49f84a)[_0x5799('0x21')](function(_0x3a4cec){logger['info']('FaxMessage,\x20%s,\x20%s',_0x36d73f,'request\x20sent');logger[_0x5799('0x22')](_0x5799('0x23'),_0x36d73f,_0x5799('0x24'),JSON['stringify'](_0x3a4cec));if(_0x3a4cec[_0x5799('0x25')]){if(_0x3a4cec[_0x5799('0x25')][_0x5799('0x26')]===0x1f4){logger[_0x5799('0x25')](_0x5799('0x27'),_0x36d73f,_0x3a4cec[_0x5799('0x25')][_0x5799('0x28')]);return _0x46b8dd(_0x3a4cec[_0x5799('0x25')][_0x5799('0x28')]);}logger['error'](_0x5799('0x27'),_0x36d73f,_0x3a4cec[_0x5799('0x25')]['message']);return _0xe4a88d(_0x3a4cec['error'][_0x5799('0x28')]);}else{logger[_0x5799('0x29')](_0x5799('0x27'),_0x36d73f,'request\x20sent');_0xe4a88d(_0x3a4cec[_0x5799('0x2a')][_0x5799('0x28')]);}})[_0x5799('0x2b')](function(_0xed4090){logger[_0x5799('0x25')]('FaxMessage,\x20%s,\x20%s',_0x36d73f,_0xed4090);_0x46b8dd(_0xed4090);});});}function respondWithStatusCode(_0x3f2817,_0x46c5e3){_0x46c5e3=_0x46c5e3||0xcc;return function(_0x177fe7){if(_0x177fe7){return _0x3f2817[_0x5799('0x2c')](_0x46c5e3);}return _0x3f2817['status'](_0x46c5e3)[_0x5799('0x2d')]();};}function respondWithResult(_0xefeb5b,_0x29cd3b){_0x29cd3b=_0x29cd3b||0xc8;return function(_0x3f1c5a){if(_0x3f1c5a){return _0xefeb5b[_0x5799('0x2e')](_0x29cd3b)[_0x5799('0x2f')](_0x3f1c5a);}};}function respondWithFilteredResult(_0x563622,_0x804b70){return function(_0x5d1862){if(_0x5d1862){var _0x4f6dee=typeof _0x804b70[_0x5799('0x30')]==='undefined'&&typeof _0x804b70[_0x5799('0x31')]===_0x5799('0x32');var _0x33be24=_0x5d1862[_0x5799('0x33')];var _0x2d9f66=_0x4f6dee?0x0:_0x804b70[_0x5799('0x30')];var _0x137f79=_0x4f6dee?_0x5d1862[_0x5799('0x33')]:_0x804b70[_0x5799('0x30')]+_0x804b70['limit'];var _0x50a281;if(_0x137f79>=_0x33be24){_0x137f79=_0x33be24;_0x50a281=0xc8;}else{_0x50a281=0xce;}_0x563622[_0x5799('0x2e')](_0x50a281);return _0x563622[_0x5799('0x34')](_0x5799('0x35'),_0x2d9f66+'-'+_0x137f79+'/'+_0x33be24)[_0x5799('0x2f')](_0x5d1862);}return null;};}function patchUpdates(_0x112032){return function(_0x27d65f){try{jsonpatch['apply'](_0x27d65f,_0x112032,!![]);}catch(_0x23666c){return BPromise['reject'](_0x23666c);}return _0x27d65f[_0x5799('0x36')]();};}function saveUpdates(_0x5c643c,_0x5b8011){return function(_0x42d65e){if(_0x42d65e){return _0x42d65e[_0x5799('0x37')](_0x5c643c)['then'](function(_0x281516){return _0x281516;});}return null;};}function removeEntity(_0xe815ac,_0x36f65b){return function(_0x3104fe){if(_0x3104fe){return _0x3104fe[_0x5799('0x38')]()[_0x5799('0x21')](function(){_0xe815ac[_0x5799('0x2e')](0xcc)[_0x5799('0x2d')]();});}};}function handleEntityNotFound(_0x3914b0,_0x227009){return function(_0x4ab2a0){if(!_0x4ab2a0){_0x3914b0['sendStatus'](0x194);}return _0x4ab2a0;};}function handleError(_0x3d070b,_0x2a7c4a){_0x2a7c4a=_0x2a7c4a||0x1f4;return function(_0x253cf5){logger[_0x5799('0x25')](_0x253cf5[_0x5799('0x39')]);if(_0x253cf5[_0x5799('0x3a')]){delete _0x253cf5['name'];}_0x3d070b[_0x5799('0x2e')](_0x2a7c4a)[_0x5799('0x3b')](_0x253cf5);};}exports[_0x5799('0x3c')]=function(_0x310396,_0x4bc0e6){var _0x289603={},_0xbb7c69={},_0x16a8b7={'count':0x0,'rows':[]};var _0x5e1eed=_[_0x5799('0x3d')](db[_0x5799('0x3e')][_0x5799('0x3f')],function(_0x1c1f0e){return{'name':_0x1c1f0e['fieldName'],'type':_0x1c1f0e[_0x5799('0x40')]['key']};});_0xbb7c69['model']=_[_0x5799('0x3d')](_0x5e1eed,_0x5799('0x3a'));_0xbb7c69[_0x5799('0x41')]=_[_0x5799('0x42')](_0x310396['query']);_0xbb7c69[_0x5799('0x43')]=_[_0x5799('0x44')](_0xbb7c69['model'],_0xbb7c69[_0x5799('0x41')]);_0x289603[_0x5799('0x45')]=_[_0x5799('0x44')](_0xbb7c69[_0x5799('0x46')],qs[_0x5799('0x47')](_0x310396['query'][_0x5799('0x47')]));_0x289603[_0x5799('0x45')]=_0x289603[_0x5799('0x45')][_0x5799('0x48')]?_0x289603[_0x5799('0x45')]:_0xbb7c69[_0x5799('0x46')];if(!_0x310396[_0x5799('0x41')][_0x5799('0x49')](_0x5799('0x4a'))){_0x289603[_0x5799('0x31')]=qs[_0x5799('0x31')](_0x310396[_0x5799('0x41')][_0x5799('0x31')]);_0x289603['offset']=qs['offset'](_0x310396['query'][_0x5799('0x30')]);}_0x289603['order']=qs[_0x5799('0x4b')](_0x310396[_0x5799('0x41')][_0x5799('0x4b')]);_0x289603[_0x5799('0x4c')]=qs[_0x5799('0x43')](_['pick'](_0x310396[_0x5799('0x41')],_0xbb7c69['filters']),_0x5e1eed);if(_0x310396[_0x5799('0x41')][_0x5799('0x4d')]){_0x289603[_0x5799('0x4c')]=_[_0x5799('0x4e')](_0x289603[_0x5799('0x4c')],{'$or':_['map'](_0x5e1eed,function(_0x14bbea){if(_0x14bbea['type']!=='VIRTUAL'){var _0x3cf73e={};_0x3cf73e[_0x14bbea[_0x5799('0x3a')]]={'$like':'%'+_0x310396[_0x5799('0x41')][_0x5799('0x4d')]+'%'};return _0x3cf73e;}})});}_0x289603=_[_0x5799('0x4e')]({},_0x289603,_0x310396[_0x5799('0x4f')]);var _0xcc4336={'where':_0x289603[_0x5799('0x4c')]};return db[_0x5799('0x3e')][_0x5799('0x33')](_0xcc4336)[_0x5799('0x21')](function(_0x11257a){_0x16a8b7[_0x5799('0x33')]=_0x11257a;if(_0x310396[_0x5799('0x41')]['includeAll']){_0x289603[_0x5799('0x50')]=[{'all':!![]}];}return db[_0x5799('0x3e')][_0x5799('0x51')](_0x289603);})[_0x5799('0x21')](function(_0x2d38ba){_0x16a8b7[_0x5799('0x52')]=_0x2d38ba;return _0x16a8b7;})[_0x5799('0x21')](respondWithFilteredResult(_0x4bc0e6,_0x289603))[_0x5799('0x2b')](handleError(_0x4bc0e6,null));};exports[_0x5799('0x53')]=function(_0xb57841,_0x1764cb){var _0x275e39={'raw':!![],'where':{'id':_0xb57841[_0x5799('0x54')]['id']}},_0x3a8fb8={};_0x3a8fb8[_0x5799('0x46')]=_['keys'](db[_0x5799('0x3e')][_0x5799('0x3f')]);_0x3a8fb8[_0x5799('0x41')]=_[_0x5799('0x42')](_0xb57841[_0x5799('0x41')]);_0x3a8fb8[_0x5799('0x43')]=_['intersection'](_0x3a8fb8[_0x5799('0x46')],_0x3a8fb8[_0x5799('0x41')]);_0x275e39[_0x5799('0x45')]=_['intersection'](_0x3a8fb8[_0x5799('0x46')],qs[_0x5799('0x47')](_0xb57841['query'][_0x5799('0x47')]));_0x275e39[_0x5799('0x45')]=_0x275e39[_0x5799('0x45')][_0x5799('0x48')]?_0x275e39[_0x5799('0x45')]:_0x3a8fb8[_0x5799('0x46')];if(_0xb57841[_0x5799('0x41')][_0x5799('0x55')]){_0x275e39[_0x5799('0x50')]=[{'all':!![]}];}_0x275e39=_[_0x5799('0x4e')]({},_0x275e39,_0xb57841[_0x5799('0x4f')]);return db[_0x5799('0x3e')][_0x5799('0x56')](_0x275e39)['then'](handleEntityNotFound(_0x1764cb,null))[_0x5799('0x21')](respondWithResult(_0x1764cb,null))[_0x5799('0x2b')](handleError(_0x1764cb,null));};exports['update']=function(_0x4daa79,_0x5bf093){if(_0x4daa79[_0x5799('0x57')]['id']){delete _0x4daa79[_0x5799('0x57')]['id'];}return db['FaxMessage'][_0x5799('0x56')]({'where':{'id':_0x4daa79['params']['id']}})[_0x5799('0x21')](handleEntityNotFound(_0x5bf093,null))[_0x5799('0x21')](saveUpdates(_0x4daa79['body'],null))[_0x5799('0x21')](respondWithResult(_0x5bf093,null))[_0x5799('0x2b')](handleError(_0x5bf093,null));};exports[_0x5799('0x38')]=function(_0x58ba49,_0x29375b){return db[_0x5799('0x3e')][_0x5799('0x56')]({'where':{'id':_0x58ba49[_0x5799('0x54')]['id']}})[_0x5799('0x21')](handleEntityNotFound(_0x29375b,null))['then'](removeEntity(_0x29375b,null))[_0x5799('0x2b')](handleError(_0x29375b,null));};exports['describe']=function(_0x132242,_0x35401e){return db[_0x5799('0x3e')][_0x5799('0x58')]()[_0x5799('0x21')](respondWithResult(_0x35401e,null))[_0x5799('0x2b')](handleError(_0x35401e,null));};var interaction_log=require(_0x5799('0x13'))(_0x5799('0x59'));exports[_0x5799('0x5a')]=function(_0x31e630,_0x3f361b,_0x52f670){var _0x53fb64={'agent':{},'channel':_0x5799('0x5b')};if(_0x31e630[_0x5799('0x57')]['id']){delete _0x31e630[_0x5799('0x57')]['id'];}_0x31e630[_0x5799('0x57')][_0x5799('0x5c')]=!![];_0x31e630[_0x5799('0x57')]['readAt']=moment()[_0x5799('0x5d')](_0x5799('0x5e'));_0x31e630[_0x5799('0x57')]['UserId']=_0x31e630[_0x5799('0x57')]['UserId']||_0x31e630['user']['id'];_0x53fb64[_0x5799('0x5f')]['id']=_0x31e630[_0x5799('0x57')]['UserId'];return db[_0x5799('0x3e')][_0x5799('0x56')]({'where':{'id':_0x31e630[_0x5799('0x54')]['id'],'UserId':null}})[_0x5799('0x21')](handleEntityNotFound(_0x3f361b,null))[_0x5799('0x21')](saveUpdates(_0x31e630['body'],null))[_0x5799('0x21')](function(_0x4d629b){if(_0x4d629b){_0x53fb64['message']=_0x4d629b['get']({'plain':!![]});return db[_0x5799('0x60')]['find']({'where':{'id':_0x4d629b['FaxInteractionId']}});}return null;})[_0x5799('0x21')](handleEntityNotFound(_0x3f361b,null))[_0x5799('0x21')](function(_0x1c6650){if(_0x1c6650){return _0x1c6650['update']({'UserId':_0x31e630[_0x5799('0x57')][_0x5799('0x61')],'read1stAt':_[_0x5799('0x62')](_0x1c6650[_0x5799('0x63')])?moment()[_0x5799('0x5d')](_0x5799('0x5e')):undefined});}return null;})[_0x5799('0x21')](function(_0x281bcd){if(_0x281bcd){_0x53fb64['interaction']=_0x281bcd[_0x5799('0x64')]({'plain':!![]});interaction_log[_0x5799('0x29')](_0x5799('0x65'),_0x31e630[_0x5799('0x66')]['id'],_0x31e630[_0x5799('0x66')][_0x5799('0x3a')],_0x31e630['user'][_0x5799('0x67')],_0x53fb64[_0x5799('0x68')]['id'],_0x31e630[_0x5799('0x57')]?JSON['stringify'](_0x31e630['body']):'null');return respondWithRpcPromise(_0x5799('0x69'),_0x5799('0x6a'),_0x53fb64);}return null;})['then'](function(_0x468881){var _0x2c69d4='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x468881['message']['ContactId'];return db[_0x5799('0x6b')][_0x5799('0x41')](_0x2c69d4,{'type':db[_0x5799('0x6c')][_0x5799('0x6d')]['SELECT'],'raw':!![]})['then'](function(_0x5a9b86){return _0x5a9b86;});})[_0x5799('0x21')](function(_0x3215f7){if(_0x3215f7){_0x53fb64[_0x5799('0x28')][_0x5799('0x6e')]=_0x3215f7[0x0];if(!_0x31e630[_0x5799('0x57')][_0x5799('0x61')])return;return db[_0x5799('0x6f')][_0x5799('0x56')]({'where':{'id':_0x31e630[_0x5799('0x57')][_0x5799('0x61')],'role':_0x5799('0x5f')},'attributes':['id',_0x5799('0x3a'),_0x5799('0x70'),_0x5799('0x71'),_0x5799('0x72')],'raw':!![]});}return null;})[_0x5799('0x21')](function(_0x20accb){if(!_0x20accb)return null;_0x53fb64[_0x5799('0x28')]['agent']=_0x20accb;return _0x53fb64;})[_0x5799('0x21')](function(_0x5ecc74){if(_0x5ecc74){if(_0x31e630[_0x5799('0x57')][_0x5799('0x73')]){_0x53fb64['message']['interface']=util[_0x5799('0x5d')]('SIP/%s',_0x31e630[_0x5799('0x66')]['name']);_0x53fb64[_0x5799('0x28')][_0x5799('0x74')]=_0x53fb64[_0x5799('0x74')];_0x53fb64[_0x5799('0x28')]['event']='accept';return respondWithRpcPromise(_0x5799('0x75'),_0x5799('0x75'),{'event':_0x5799('0x76'),'message':_0x53fb64[_0x5799('0x28')]},client9002)[_0x5799('0x21')](function(){return _0x53fb64;});}return _0x53fb64;}return null;})['then'](respondWithResult(_0x3f361b,null))[_0x5799('0x2b')](handleError(_0x3f361b,null));};var interaction_log=require('../../config/logger')(_0x5799('0x59'));exports[_0x5799('0x77')]=function(_0x588683,_0x380591,_0x4b76b4){var _0x403365={'agent':{},'channel':'fax'};if(_0x588683['body']['id']){delete _0x588683[_0x5799('0x57')]['id'];}_0x588683[_0x5799('0x57')][_0x5799('0x61')]=_0x588683[_0x5799('0x57')]['UserId']||_0x588683['user']['id'];_0x403365['agent']['id']=_0x588683[_0x5799('0x57')][_0x5799('0x61')];return db[_0x5799('0x3e')][_0x5799('0x56')]({'where':{'id':_0x588683[_0x5799('0x54')]['id'],'UserId':null}})[_0x5799('0x21')](handleEntityNotFound(_0x380591,null))[_0x5799('0x21')](function(_0x225430){if(_0x225430){_0x403365['message']=_0x225430[_0x5799('0x64')]({'plain':!![]});return db['FaxInteraction'][_0x5799('0x56')]({'where':{'id':_0x225430[_0x5799('0x78')]}});}return null;})[_0x5799('0x21')](handleEntityNotFound(_0x380591,null))[_0x5799('0x21')](function(_0x57732b){if(_0x57732b){_0x403365[_0x5799('0x68')]=_0x57732b[_0x5799('0x64')]({'plain':!![]});interaction_log['info'](_0x5799('0x79'),_0x588683[_0x5799('0x66')]['id'],_0x588683[_0x5799('0x66')][_0x5799('0x3a')],_0x588683['user'][_0x5799('0x67')],_0x403365[_0x5799('0x68')]['id'],_0x588683[_0x5799('0x57')]?JSON['stringify'](_0x588683[_0x5799('0x57')]):_0x5799('0x7a'));return respondWithRpcPromise(_0x5799('0x7b'),_0x5799('0x7c'),_0x403365);}return null;})[_0x5799('0x21')](function(_0x448363){var _0x431eec=_0x5799('0x7d')+_0x448363[_0x5799('0x28')][_0x5799('0x7e')];return db[_0x5799('0x6b')][_0x5799('0x41')](_0x431eec,{'type':db[_0x5799('0x6c')]['QueryTypes'][_0x5799('0x7f')],'raw':!![]})[_0x5799('0x21')](function(_0x2a7ba7){return _0x2a7ba7;});})[_0x5799('0x21')](function(_0x5a100a){if(_0x5a100a){_0x403365[_0x5799('0x28')][_0x5799('0x6e')]=_0x5a100a[0x0];if(!_0x588683[_0x5799('0x57')][_0x5799('0x61')])return;return db[_0x5799('0x6f')][_0x5799('0x56')]({'where':{'id':_0x588683[_0x5799('0x57')][_0x5799('0x61')],'role':_0x5799('0x5f')},'attributes':['id','name','fullname',_0x5799('0x71'),_0x5799('0x72')],'raw':!![]});}return null;})['then'](function(_0x2da07d){if(!_0x2da07d)return null;_0x403365['message'][_0x5799('0x5f')]=_0x2da07d;return _0x403365;})[_0x5799('0x21')](function(_0x53001f){if(_0x53001f){_0x53001f[_0x5799('0x28')][_0x5799('0x80')]=util[_0x5799('0x5d')](_0x5799('0x81'),_0x588683[_0x5799('0x66')]['name']);_0x53001f[_0x5799('0x28')][_0x5799('0x74')]=_0x403365[_0x5799('0x74')];_0x53001f['message'][_0x5799('0x82')]=_0x5799('0x77');respondWithRpcPromise(_0x5799('0x75'),'EventManager',{'event':_0x5799('0x83'),'message':_0x53001f['message']},client9002);return _0x403365;}return null;})[_0x5799('0x21')](respondWithResult(_0x380591,null))[_0x5799('0x2b')](handleError(_0x380591,null));};exports[_0x5799('0x84')]=function(_0x114cee,_0x17ea01){var _0x1dfc85;return db[_0x5799('0x3e')][_0x5799('0x84')](_0x114cee[_0x5799('0x57')],{})['then'](function(_0x25dafc){_0x1dfc85=_0x25dafc;return db[_0x5799('0x85')]['findOne']({'where':{'id':_0x1dfc85[_0x5799('0x7e')]}});})['then'](function(_0x11a25e){if(_['isNil'](_0x11a25e)){return;}else{_0x1dfc85['fax']=_0x11a25e[_0x5799('0x5b')];return db[_0x5799('0x86')][_0x5799('0x87')]({'where':{'id':_0x1dfc85[_0x5799('0x88')]}});}})[_0x5799('0x21')](function(_0x43023a){return respondWithRpcPromise('SendFax',_0x5799('0x89'),{'FaxAccountId':_[_0x5799('0x62')](_0x114cee[_0x5799('0x57')])?undefined:_0x114cee[_0x5799('0x57')][_0x5799('0x8a')],'path':_[_0x5799('0x62')](_0x43023a)?undefined:util[_0x5799('0x5d')]('/var/opt/motion2/server/files/attachments/%s',_0x43023a['basename']),'fax':_['isNil'](_0x1dfc85[_0x5799('0x5b')])?undefined:_0x1dfc85['fax'],'AttachmentId':_0x1dfc85[_0x5799('0x88')]},client9002);})[_0x5799('0x21')](respondWithResult(_0x17ea01,0xc9))[_0x5799('0x2b')](handleError(_0x17ea01,null));};exports[_0x5799('0x8b')]=function(_0xea5c99,_0x658ed8){var _0x47db62=path[_0x5799('0x8c')](config[_0x5799('0x8d')],'server',_0x5799('0x8e'),_0x5799('0x8f'));return db[_0x5799('0x3e')][_0x5799('0x56')]({'where':{'id':_0xea5c99[_0x5799('0x54')]['id']},'include':[{'model':db[_0x5799('0x86')],'as':_0x5799('0x86')}]})[_0x5799('0x21')](handleEntityNotFound(_0x658ed8,null))[_0x5799('0x21')](function(_0x5b8ff3){if(_0x5b8ff3){return _0x658ed8[_0x5799('0x8b')](path['join'](_0x47db62,_0x5b8ff3[_0x5799('0x86')]['basename']));}})[_0x5799('0x2b')](handleError(_0x658ed8,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 7770fde..f1afc20 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 _0x3dba=['save','remove','emit','setMaxListeners'];(function(_0x3008b1,_0x2a89f){var _0x1922d9=function(_0x3ad7bf){while(--_0x3ad7bf){_0x3008b1['push'](_0x3008b1['shift']());}};_0x1922d9(++_0x2a89f);}(_0x3dba,0x73));var _0xa3db=function(_0x40ebc3,_0x5b7f78){_0x40ebc3=_0x40ebc3-0x0;var _0x1d8b08=_0x3dba[_0x40ebc3];return _0x1d8b08;};'use strict';var EventEmitter=require('events');var FaxMessage=require('../../mysqldb')['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xa3db('0x0')](0x0);var events={'afterCreate':_0xa3db('0x1'),'afterUpdate':'update','afterDestroy':_0xa3db('0x2')};function emitEvent(_0x2ddae6){return function(_0x20b644,_0x189a24,_0x15fbf8){FaxMessageEvents[_0xa3db('0x3')](_0x2ddae6+':'+_0x20b644['id'],_0x20b644);FaxMessageEvents[_0xa3db('0x3')](_0x2ddae6,_0x20b644);_0x15fbf8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file +var _0x46c1=['update','emit','hook','exports','../../mysqldb','FaxMessage','setMaxListeners','save'];(function(_0x2f222f,_0x33d7b0){var _0x51d081=function(_0x48e6cf){while(--_0x48e6cf){_0x2f222f['push'](_0x2f222f['shift']());}};_0x51d081(++_0x33d7b0);}(_0x46c1,0x7c));var _0x146c=function(_0x5f4856,_0x30bb5c){_0x5f4856=_0x5f4856-0x0;var _0x25633f=_0x46c1[_0x5f4856];return _0x25633f;};'use strict';var EventEmitter=require('events');var FaxMessage=require(_0x146c('0x0'))['db'][_0x146c('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x146c('0x2')](0x0);var events={'afterCreate':_0x146c('0x3'),'afterUpdate':_0x146c('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3cfd3f){return function(_0x5932ea,_0x6da0b5,_0x1634f6){FaxMessageEvents[_0x146c('0x5')](_0x3cfd3f+':'+_0x5932ea['id'],_0x5932ea);FaxMessageEvents['emit'](_0x3cfd3f,_0x5932ea);_0x1634f6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage[_0x146c('0x6')](e,emitEvent(event));}}module[_0x146c('0x7')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 3904741..edd2067 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 _0xb29d=['moment','bluebird','path','rimraf','../../config/environment','./faxMessage.attributes','exports','define','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','direction','toLowerCase','out','secret','UserId','FaxInteraction','findOne','FaxInteractionId','then','update','catch','error','utf8mb4_unicode_ci','lodash','../../config/logger','api'];(function(_0x5f196f,_0x1a2281){var _0x454535=function(_0x1456eb){while(--_0x1456eb){_0x5f196f['push'](_0x5f196f['shift']());}};_0x454535(++_0x1a2281);}(_0xb29d,0x193));var _0xdb29=function(_0x3eda1b,_0x14542a){_0x3eda1b=_0x3eda1b-0x0;var _0x28835d=_0xb29d[_0x3eda1b];return _0x28835d;};'use strict';var _=require(_0xdb29('0x0'));var util=require('util');var logger=require(_0xdb29('0x1'))(_0xdb29('0x2'));var moment=require(_0xdb29('0x3'));var BPromise=require(_0xdb29('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdb29('0x5'));var rimraf=require(_0xdb29('0x6'));var config=require(_0xdb29('0x7'));var attributes=require(_0xdb29('0x8'));module[_0xdb29('0x9')]=function(_0x102830,_0x1d0b44){return _0x102830[_0xdb29('0xa')](_0xdb29('0xb'),attributes,{'tableName':_0xdb29('0xc'),'paranoid':![],'indexes':[{'name':_0xdb29('0xd'),'fields':[_0xdb29('0xe')],'type':_0xdb29('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x33a944,_0x56b3bb,_0x31b026){var _0x53d11a=_0x102830['models'];var _0x556d2e=_0x33a944['get']({'plain':!![]});if(_0x556d2e[_0xdb29('0x10')][_0xdb29('0x11')]()==='in'||_0x556d2e[_0xdb29('0x10')]['toLowerCase']()===_0xdb29('0x12')&&!_0x556d2e[_0xdb29('0x13')]&&!_['isNil'](_0x556d2e[_0xdb29('0x14')])){_0x53d11a[_0xdb29('0x15')][_0xdb29('0x16')]({'where':{'id':_0x556d2e[_0xdb29('0x17')]}})[_0xdb29('0x18')](function(_0x567d43){if(_0x567d43){_0x567d43[_0xdb29('0x19')]({'lastMsgAt':_0x556d2e['createdAt'],'lastMsgDirection':_0x556d2e[_0xdb29('0x10')]['toLowerCase']()});}})[_0xdb29('0x1a')](function(_0x26cf4a){console[_0xdb29('0x1b')](_0x26cf4a);});}_0x31b026();}},'charset':'utf8mb4','collate':_0xdb29('0x1c')});}; \ No newline at end of file +var _0x3c24=['isNil','UserId','FaxInteraction','findOne','FaxInteractionId','then','update','createdAt','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./faxMessage.attributes','FaxMessage','fax_messages','body','FULLTEXT','models','get','direction','toLowerCase'];(function(_0x376a90,_0x30d208){var _0x27115f=function(_0x2cba72){while(--_0x2cba72){_0x376a90['push'](_0x376a90['shift']());}};_0x27115f(++_0x30d208);}(_0x3c24,0x91));var _0x43c2=function(_0x2892da,_0x191a40){_0x2892da=_0x2892da-0x0;var _0x28cff2=_0x3c24[_0x2892da];return _0x28cff2;};'use strict';var _=require(_0x43c2('0x0'));var util=require(_0x43c2('0x1'));var logger=require('../../config/logger')(_0x43c2('0x2'));var moment=require(_0x43c2('0x3'));var BPromise=require(_0x43c2('0x4'));var rp=require(_0x43c2('0x5'));var fs=require('fs');var path=require(_0x43c2('0x6'));var rimraf=require(_0x43c2('0x7'));var config=require('../../config/environment');var attributes=require(_0x43c2('0x8'));module['exports']=function(_0x4feaf5,_0x5451f1){return _0x4feaf5['define'](_0x43c2('0x9'),attributes,{'tableName':_0x43c2('0xa'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0x43c2('0xb')],'type':_0x43c2('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5d5d2,_0x536948,_0x339a4a){var _0x45c131=_0x4feaf5[_0x43c2('0xd')];var _0x49eff8=_0x5d5d2[_0x43c2('0xe')]({'plain':!![]});if(_0x49eff8[_0x43c2('0xf')][_0x43c2('0x10')]()==='in'||_0x49eff8['direction'][_0x43c2('0x10')]()==='out'&&!_0x49eff8['secret']&&!_[_0x43c2('0x11')](_0x49eff8[_0x43c2('0x12')])){_0x45c131[_0x43c2('0x13')][_0x43c2('0x14')]({'where':{'id':_0x49eff8[_0x43c2('0x15')]}})[_0x43c2('0x16')](function(_0x3ecf92){if(_0x3ecf92){_0x3ecf92[_0x43c2('0x17')]({'lastMsgAt':_0x49eff8[_0x43c2('0x18')],'lastMsgDirection':_0x49eff8[_0x43c2('0xf')]['toLowerCase']()});}})['catch'](function(_0x1b7f28){console['error'](_0x1b7f28);});}_0x339a4a();}},'charset':_0x43c2('0x19'),'collate':_0x43c2('0x1a')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 11feb82..9c56dcc 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 _0x55ca=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./faxMessage.socket','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','code','error','message','catch','CreateFaxMessage','FaxMessage','body','options','raw','UpdateFaxMessage','update','attributes','limit','debug','stringify','lodash','util','ioredis'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x55ca,0x126));var _0xa55c=function(_0x238202,_0x10da07){_0x238202=_0x238202-0x0;var _0x217367=_0x55ca[_0x238202];return _0x217367;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa55c('0x2'));var db=require(_0xa55c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa55c('0x4'))(_0xa55c('0x5'));var config=require(_0xa55c('0x6'));var jayson=require(_0xa55c('0x7'));var client=jayson[_0xa55c('0x8')][_0xa55c('0x9')]({'port':0x232a});config[_0xa55c('0xa')]=_['defaults'](config[_0xa55c('0xa')],{'host':_0xa55c('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa55c('0xa')]));require(_0xa55c('0xc'))['register'](socket);function respondWithRpcPromise(_0x5849ad,_0x473d0e,_0x20c76a){return new BPromise(function(_0x381d07,_0x5d8e5a){return client[_0xa55c('0xd')](_0x5849ad,_0x20c76a)[_0xa55c('0xe')](function(_0x508342){logger[_0xa55c('0xf')](_0xa55c('0x10'),_0x473d0e,_0xa55c('0x11'));logger['debug']('FaxMessage,\x20%s,\x20%s,\x20%s',_0x473d0e,_0xa55c('0x11'),JSON['stringify'](_0x508342));if(_0x508342['error']){if(_0x508342['error'][_0xa55c('0x12')]===0x1f4){logger[_0xa55c('0x13')](_0xa55c('0x10'),_0x473d0e,_0x508342[_0xa55c('0x13')][_0xa55c('0x14')]);return _0x5d8e5a(_0x508342[_0xa55c('0x13')]['message']);}logger[_0xa55c('0x13')](_0xa55c('0x10'),_0x473d0e,_0x508342[_0xa55c('0x13')][_0xa55c('0x14')]);return _0x381d07(_0x508342[_0xa55c('0x13')][_0xa55c('0x14')]);}else{logger[_0xa55c('0xf')](_0xa55c('0x10'),_0x473d0e,_0xa55c('0x11'));_0x381d07(_0x508342['result'][_0xa55c('0x14')]);}})[_0xa55c('0x15')](function(_0x461284){logger[_0xa55c('0x13')](_0xa55c('0x10'),_0x473d0e,_0x461284);_0x5d8e5a(_0x461284);});});}exports[_0xa55c('0x16')]=function(_0x4c0daf){var _0x5f5158=this;return new Promise(function(_0xd643cc,_0x3776ac){return db[_0xa55c('0x17')]['create'](_0x4c0daf[_0xa55c('0x18')],{'raw':_0x4c0daf[_0xa55c('0x19')]?_0x4c0daf['options'][_0xa55c('0x1a')]===undefined?!![]:![]:!![]})[_0xa55c('0xe')](function(_0x940f28){logger[_0xa55c('0xf')](_0xa55c('0x16'),_0x4c0daf);logger['debug'](_0xa55c('0x16'),_0x4c0daf,JSON['stringify'](_0x940f28));_0xd643cc(_0x940f28);})['catch'](function(_0x59d89a){logger[_0xa55c('0x13')]('CreateFaxMessage',_0x59d89a[_0xa55c('0x14')],_0x4c0daf);_0x3776ac(_0x5f5158[_0xa55c('0x13')](0x1f4,_0x59d89a[_0xa55c('0x14')]));});});};exports[_0xa55c('0x1b')]=function(_0x2313a9){var _0x170ba4=this;return new Promise(function(_0x1da633,_0x11e7f7){return db[_0xa55c('0x17')][_0xa55c('0x1c')](_0x2313a9[_0xa55c('0x18')],{'raw':_0x2313a9['options']?_0x2313a9[_0xa55c('0x19')][_0xa55c('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2313a9[_0xa55c('0x19')]?_0x2313a9[_0xa55c('0x19')]['where']||null:null,'attributes':_0x2313a9[_0xa55c('0x19')]?_0x2313a9[_0xa55c('0x19')][_0xa55c('0x1d')]||null:null,'limit':_0x2313a9[_0xa55c('0x19')]?_0x2313a9[_0xa55c('0x19')][_0xa55c('0x1e')]||null:null})['then'](function(_0x23e698){logger['info'](_0xa55c('0x1b'),_0x2313a9);logger[_0xa55c('0x1f')](_0xa55c('0x1b'),_0x2313a9,JSON[_0xa55c('0x20')](_0x23e698));_0x1da633(_0x23e698);})['catch'](function(_0x3d28fb){logger[_0xa55c('0x13')](_0xa55c('0x1b'),_0x3d28fb[_0xa55c('0x14')],_0x2313a9);_0x11e7f7(_0x170ba4[_0xa55c('0x13')](0x1f4,_0x3d28fb[_0xa55c('0x14')]));});});}; \ No newline at end of file +var _0x55ca=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./faxMessage.socket','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','code','error','message','catch','CreateFaxMessage','FaxMessage','body','options','raw','UpdateFaxMessage','update','attributes','limit','debug','stringify','lodash','util','ioredis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x55ca,0x126));var _0xa55c=function(_0x512aa7,_0x2be0d9){_0x512aa7=_0x512aa7-0x0;var _0x952539=_0x55ca[_0x512aa7];return _0x952539;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa55c('0x2'));var db=require(_0xa55c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa55c('0x4'))(_0xa55c('0x5'));var config=require(_0xa55c('0x6'));var jayson=require(_0xa55c('0x7'));var client=jayson[_0xa55c('0x8')][_0xa55c('0x9')]({'port':0x232a});config[_0xa55c('0xa')]=_['defaults'](config[_0xa55c('0xa')],{'host':_0xa55c('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa55c('0xa')]));require(_0xa55c('0xc'))['register'](socket);function respondWithRpcPromise(_0x5849ad,_0x473d0e,_0x20c76a){return new BPromise(function(_0x381d07,_0x5d8e5a){return client[_0xa55c('0xd')](_0x5849ad,_0x20c76a)[_0xa55c('0xe')](function(_0x508342){logger[_0xa55c('0xf')](_0xa55c('0x10'),_0x473d0e,_0xa55c('0x11'));logger['debug']('FaxMessage,\x20%s,\x20%s,\x20%s',_0x473d0e,_0xa55c('0x11'),JSON['stringify'](_0x508342));if(_0x508342['error']){if(_0x508342['error'][_0xa55c('0x12')]===0x1f4){logger[_0xa55c('0x13')](_0xa55c('0x10'),_0x473d0e,_0x508342[_0xa55c('0x13')][_0xa55c('0x14')]);return _0x5d8e5a(_0x508342[_0xa55c('0x13')]['message']);}logger[_0xa55c('0x13')](_0xa55c('0x10'),_0x473d0e,_0x508342[_0xa55c('0x13')][_0xa55c('0x14')]);return _0x381d07(_0x508342[_0xa55c('0x13')][_0xa55c('0x14')]);}else{logger[_0xa55c('0xf')](_0xa55c('0x10'),_0x473d0e,_0xa55c('0x11'));_0x381d07(_0x508342['result'][_0xa55c('0x14')]);}})[_0xa55c('0x15')](function(_0x461284){logger[_0xa55c('0x13')](_0xa55c('0x10'),_0x473d0e,_0x461284);_0x5d8e5a(_0x461284);});});}exports[_0xa55c('0x16')]=function(_0x4c0daf){var _0x5f5158=this;return new Promise(function(_0xd643cc,_0x3776ac){return db[_0xa55c('0x17')]['create'](_0x4c0daf[_0xa55c('0x18')],{'raw':_0x4c0daf[_0xa55c('0x19')]?_0x4c0daf['options'][_0xa55c('0x1a')]===undefined?!![]:![]:!![]})[_0xa55c('0xe')](function(_0x940f28){logger[_0xa55c('0xf')](_0xa55c('0x16'),_0x4c0daf);logger['debug'](_0xa55c('0x16'),_0x4c0daf,JSON['stringify'](_0x940f28));_0xd643cc(_0x940f28);})['catch'](function(_0x59d89a){logger[_0xa55c('0x13')]('CreateFaxMessage',_0x59d89a[_0xa55c('0x14')],_0x4c0daf);_0x3776ac(_0x5f5158[_0xa55c('0x13')](0x1f4,_0x59d89a[_0xa55c('0x14')]));});});};exports[_0xa55c('0x1b')]=function(_0x2313a9){var _0x170ba4=this;return new Promise(function(_0x1da633,_0x11e7f7){return db[_0xa55c('0x17')][_0xa55c('0x1c')](_0x2313a9[_0xa55c('0x18')],{'raw':_0x2313a9['options']?_0x2313a9[_0xa55c('0x19')][_0xa55c('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2313a9[_0xa55c('0x19')]?_0x2313a9[_0xa55c('0x19')]['where']||null:null,'attributes':_0x2313a9[_0xa55c('0x19')]?_0x2313a9[_0xa55c('0x19')][_0xa55c('0x1d')]||null:null,'limit':_0x2313a9[_0xa55c('0x19')]?_0x2313a9[_0xa55c('0x19')][_0xa55c('0x1e')]||null:null})['then'](function(_0x23e698){logger['info'](_0xa55c('0x1b'),_0x2313a9);logger[_0xa55c('0x1f')](_0xa55c('0x1b'),_0x2313a9,JSON[_0xa55c('0x20')](_0x23e698));_0x1da633(_0x23e698);})['catch'](function(_0x3d28fb){logger[_0xa55c('0x13')](_0xa55c('0x1b'),_0x3d28fb[_0xa55c('0x14')],_0x2313a9);_0x11e7f7(_0x170ba4[_0xa55c('0x13')](0x1f4,_0x3d28fb[_0xa55c('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 5a84879..97ff1b7 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 _0x21c8=['save','remove','update','emit','register','length','./faxMessage.events'];(function(_0x17c3c7,_0x5d69c4){var _0x199cca=function(_0x5814aa){while(--_0x5814aa){_0x17c3c7['push'](_0x17c3c7['shift']());}};_0x199cca(++_0x5d69c4);}(_0x21c8,0xa7));var _0x821c=function(_0x4f2ee2,_0x1828cd){_0x4f2ee2=_0x4f2ee2-0x0;var _0x3b87d9=_0x21c8[_0x4f2ee2];return _0x3b87d9;};'use strict';var FaxMessageEvents=require(_0x821c('0x0'));var events=[_0x821c('0x1'),_0x821c('0x2'),_0x821c('0x3')];function createListener(_0x6485ad,_0x12d167){return function(_0x4adc2c){_0x12d167[_0x821c('0x4')](_0x6485ad,_0x4adc2c);};}function removeListener(_0x9ef992,_0x45e653){return function(){FaxMessageEvents['removeListener'](_0x9ef992,_0x45e653);};}exports[_0x821c('0x5')]=function(_0x36b7b7){for(var _0x4d8607=0x0,_0x58a9a4=events[_0x821c('0x6')];_0x4d8607<_0x58a9a4;_0x4d8607++){var _0x2af9b2=events[_0x4d8607];var _0xd613f5=createListener('faxMessage:'+_0x2af9b2,_0x36b7b7);FaxMessageEvents['on'](_0x2af9b2,_0xd613f5);}}; \ No newline at end of file +var _0xc942=['faxMessage:','./faxMessage.events','remove','update','removeListener','register'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0xc942,0x18d));var _0x2c94=function(_0x1c6bad,_0x13b02f){_0x1c6bad=_0x1c6bad-0x0;var _0x1ab607=_0xc942[_0x1c6bad];return _0x1ab607;};'use strict';var FaxMessageEvents=require(_0x2c94('0x0'));var events=['save',_0x2c94('0x1'),_0x2c94('0x2')];function createListener(_0x529a28,_0x4e38cb){return function(_0x23a672){_0x4e38cb['emit'](_0x529a28,_0x23a672);};}function removeListener(_0x37e1ea,_0x8dfafb){return function(){FaxMessageEvents[_0x2c94('0x3')](_0x37e1ea,_0x8dfafb);};}exports[_0x2c94('0x4')]=function(_0x6357ac){for(var _0x163785=0x0,_0xae0f4b=events['length'];_0x163785<_0xae0f4b;_0x163785++){var _0x47014f=events[_0x163785];var _0x5708a3=createListener(_0x2c94('0x5')+_0x47014f,_0x6357ac);FaxMessageEvents['on'](_0x47014f,_0x5708a3);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index f8c4c6b..6f57887 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','./faxMessage.controller','isAuthenticated','describe','get','/:id','show','download','post','tracked','fax','faxmessage:create','create','put','update','reject','destroy','exports','multer','util','path','Router','fs-extra'];(function(_0x16f6cf,_0x364ec8){var _0xcf168e=function(_0x3801cc){while(--_0x3801cc){_0x16f6cf['push'](_0x16f6cf['shift']());}};_0xcf168e(++_0x364ec8);}(_0x70e0,0x17b));var _0x070e=function(_0x28bf70,_0x44a804){_0x28bf70=_0x28bf70-0x0;var _0x3f1dee=_0x70e0[_0x28bf70];return _0x3f1dee;};'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');var controller=require(_0x070e('0x7'));router['get']('/',auth[_0x070e('0x8')](),controller['index']);router['get']('/describe',auth[_0x070e('0x8')](),controller[_0x070e('0x9')]);router[_0x070e('0xa')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0xc')]);router[_0x070e('0xa')]('/:id/download',auth['isAuthenticated'](),controller[_0x070e('0xd')]);router[_0x070e('0xe')]('/',auth[_0x070e('0x8')](),interaction[_0x070e('0xf')](_0x070e('0x10'),_0x070e('0x11')),controller[_0x070e('0x12')]);router[_0x070e('0x13')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0x14')]);router['put']('/:id/accept',auth[_0x070e('0x8')](),controller['accept']);router['put']('/:id/reject',auth[_0x070e('0x8')](),controller[_0x070e('0x15')]);router['delete']('/:id',auth[_0x070e('0x8')](),controller[_0x070e('0x16')]);module[_0x070e('0x17')]=router; \ No newline at end of file +var _0xa5fa=['accept','/:id/reject','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','download','tracked','faxmessage:create','create','put'];(function(_0x21bf71,_0xe1eabe){var _0x179fa6=function(_0x1c83d2){while(--_0x1c83d2){_0x21bf71['push'](_0x21bf71['shift']());}};_0x179fa6(++_0xe1eabe);}(_0xa5fa,0xc4));var _0xaa5f=function(_0x632bb3,_0x35f4fe){_0x632bb3=_0x632bb3-0x0;var _0x5875ec=_0xa5fa[_0x632bb3];return _0x5875ec;};'use strict';var multer=require('multer');var util=require(_0xaa5f('0x0'));var path=require(_0xaa5f('0x1'));var timeout=require(_0xaa5f('0x2'));var express=require(_0xaa5f('0x3'));var router=express['Router']();var fs_extra=require(_0xaa5f('0x4'));var auth=require(_0xaa5f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xaa5f('0x6'));var controller=require(_0xaa5f('0x7'));router[_0xaa5f('0x8')]('/',auth[_0xaa5f('0x9')](),controller[_0xaa5f('0xa')]);router[_0xaa5f('0x8')](_0xaa5f('0xb'),auth[_0xaa5f('0x9')](),controller[_0xaa5f('0xc')]);router[_0xaa5f('0x8')](_0xaa5f('0xd'),auth['isAuthenticated'](),controller[_0xaa5f('0xe')]);router[_0xaa5f('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0xaa5f('0xf')]);router['post']('/',auth['isAuthenticated'](),interaction[_0xaa5f('0x10')]('fax',_0xaa5f('0x11')),controller[_0xaa5f('0x12')]);router[_0xaa5f('0x13')](_0xaa5f('0xd'),auth[_0xaa5f('0x9')](),controller['update']);router[_0xaa5f('0x13')]('/:id/accept',auth[_0xaa5f('0x9')](),controller[_0xaa5f('0x14')]);router[_0xaa5f('0x13')](_0xaa5f('0x15'),auth[_0xaa5f('0x9')](),controller['reject']);router['delete'](_0xaa5f('0xd'),auth[_0xaa5f('0x9')](),controller[_0xaa5f('0x16')]);module[_0xaa5f('0x17')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 8a0a565..92d331f 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 _0xa54e=['exports','name','INTEGER','ENUM','rrmemory','roundrobin','sequelize'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0xa54e,0x7d));var _0xea54=function(_0x4529b3,_0x390ebb){_0x4529b3=_0x4529b3-0x0;var _0x21e907=_0xa54e[_0x4529b3];return _0x21e907;};'use strict';var Sequelize=require(_0xea54('0x0'));module[_0xea54('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xea54('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xea54('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xea54('0x4')](_0xea54('0x5'),'beepall',_0xea54('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xea54('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xde76=['roundrobin','INTEGER','sequelize','exports','STRING','name','beepall'];(function(_0x3dbccc,_0x56c4a7){var _0x560c00=function(_0x4371b1){while(--_0x4371b1){_0x3dbccc['push'](_0x3dbccc['shift']());}};_0x560c00(++_0x56c4a7);}(_0xde76,0xe9));var _0x6de7=function(_0x57a049,_0x3d53f2){_0x57a049=_0x57a049-0x0;var _0x40c949=_0xde76[_0x57a049];return _0x40c949;};'use strict';var Sequelize=require(_0x6de7('0x0'));module[_0x6de7('0x1')]={'name':{'type':Sequelize[_0x6de7('0x2')],'unique':_0x6de7('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x6de7('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x6de7('0x4'),_0x6de7('0x5')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x6de7('0x6')],'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 7b867d9..097a358 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 _0xd00a=['%s/%s','Team','getTeams','addTeams','ids','findAll','Agents','online','voicePause','interface','flatMap','findOrCreate','forEach','emit','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?','push','sequelize','toString','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','addAgents','spread','isArray','order','getAgents','eml-format','rimraf','zip-dir','mustache','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','destroy','then','get','FaxQueues','UserProfileResource','end','stack','name','send','map','FaxQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','include','rows','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','describe','getMembers','findOne','UserFaxQueue','pick','FaxQueueId','User','findAndCountAll','UserId','faxPause','updatedAt','createdAt','format'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xd00a,0x144));var _0xad00=function(_0xcf6d0d,_0x490049){_0xcf6d0d=_0xcf6d0d-0x0;var _0x4bc54e=_0xd00a[_0xcf6d0d];return _0x4bc54e;};'use strict';var emlformat=require(_0xad00('0x0'));var rimraf=require(_0xad00('0x1'));var zipdir=require(_0xad00('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xad00('0x3'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xad00('0x4'));var fs=require('fs');var fs_extra=require(_0xad00('0x5'));var _=require('lodash');var squel=require(_0xad00('0x6'));var crypto=require(_0xad00('0x7'));var jsforce=require('jsforce');var deskjs=require(_0xad00('0x8'));var toCsv=require('to-csv');var querystring=require(_0xad00('0x9'));var Papa=require(_0xad00('0xa'));var Redis=require(_0xad00('0xb'));var authService=require(_0xad00('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0xad00('0xd'));var hardwareService=require(_0xad00('0xe'));var logger=require(_0xad00('0xf'))(_0xad00('0x10'));var utils=require(_0xad00('0x11'));var config=require(_0xad00('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xad00('0x13'))['db'];config[_0xad00('0x14')]=_[_0xad00('0x15')](config['redis'],{'host':_0xad00('0x16'),'port':0x18eb});var socket=require(_0xad00('0x17'))(new Redis(config[_0xad00('0x14')]));require(_0xad00('0x18'))[_0xad00('0x19')](socket);function respondWithStatusCode(_0x409683,_0x53c024){_0x53c024=_0x53c024||0xcc;return function(_0x1a6e95){if(_0x1a6e95){return _0x409683[_0xad00('0x1a')](_0x53c024);}return _0x409683[_0xad00('0x1b')](_0x53c024)['end']();};}function respondWithResult(_0x386fac,_0x41c3ca){_0x41c3ca=_0x41c3ca||0xc8;return function(_0x375878){if(_0x375878){return _0x386fac[_0xad00('0x1b')](_0x41c3ca)[_0xad00('0x1c')](_0x375878);}};}function respondWithFilteredResult(_0x3896df,_0x3e552d){return function(_0x2240b5){if(_0x2240b5){var _0x47f97c=typeof _0x3e552d['offset']===_0xad00('0x1d')&&typeof _0x3e552d['limit']==='undefined';var _0xb081fe=_0x2240b5[_0xad00('0x1e')];var _0x5e5bc4=_0x47f97c?0x0:_0x3e552d[_0xad00('0x1f')];var _0x41c98b=_0x47f97c?_0x2240b5[_0xad00('0x1e')]:_0x3e552d['offset']+_0x3e552d[_0xad00('0x20')];var _0xa9db99;if(_0x41c98b>=_0xb081fe){_0x41c98b=_0xb081fe;_0xa9db99=0xc8;}else{_0xa9db99=0xce;}_0x3896df[_0xad00('0x1b')](_0xa9db99);return _0x3896df[_0xad00('0x21')](_0xad00('0x22'),_0x5e5bc4+'-'+_0x41c98b+'/'+_0xb081fe)[_0xad00('0x1c')](_0x2240b5);}return null;};}function patchUpdates(_0x5e458a){return function(_0x1fbe51){try{jsonpatch[_0xad00('0x23')](_0x1fbe51,_0x5e458a,!![]);}catch(_0xd6fd7f){return BPromise[_0xad00('0x24')](_0xd6fd7f);}return _0x1fbe51[_0xad00('0x25')]();};}function saveUpdates(_0x3b6981,_0x3b7dff){return function(_0x184125){if(_0x184125){return _0x184125['update'](_0x3b6981)['then'](function(_0x521caf){return _0x521caf;});}return null;};}function removeEntity(_0x3aa6f4,_0x31ba7d){return function(_0x11c06a){if(_0x11c06a){return _0x11c06a[_0xad00('0x26')]()[_0xad00('0x27')](function(){var _0x17b502=_0x11c06a[_0xad00('0x28')]({'plain':!![]});var _0x2a80da=_0xad00('0x29');return db[_0xad00('0x2a')]['destroy']({'where':{'type':_0x2a80da,'resourceId':_0x17b502['id']}})[_0xad00('0x27')](function(){return _0x11c06a;});})[_0xad00('0x27')](function(){_0x3aa6f4[_0xad00('0x1b')](0xcc)[_0xad00('0x2b')]();});}};}function handleEntityNotFound(_0x2f3eb7,_0x46af0c){return function(_0x2ea3a4){if(!_0x2ea3a4){_0x2f3eb7['sendStatus'](0x194);}return _0x2ea3a4;};}function handleError(_0x185542,_0x5b7eb2){_0x5b7eb2=_0x5b7eb2||0x1f4;return function(_0x433147){logger['error'](_0x433147[_0xad00('0x2c')]);if(_0x433147['name']){delete _0x433147[_0xad00('0x2d')];}_0x185542[_0xad00('0x1b')](_0x5b7eb2)[_0xad00('0x2e')](_0x433147);};}exports['index']=function(_0x4cec62,_0x1a9439){var _0x2b915b={},_0x4cf885={},_0x4aa95f={'count':0x0,'rows':[]};var _0x1478b5=_[_0xad00('0x2f')](db[_0xad00('0x30')][_0xad00('0x31')],function(_0x26cb1d){return{'name':_0x26cb1d[_0xad00('0x32')],'type':_0x26cb1d[_0xad00('0x33')][_0xad00('0x34')]};});_0x4cf885[_0xad00('0x35')]=_[_0xad00('0x2f')](_0x1478b5,_0xad00('0x2d'));_0x4cf885[_0xad00('0x36')]=_[_0xad00('0x37')](_0x4cec62[_0xad00('0x36')]);_0x4cf885[_0xad00('0x38')]=_['intersection'](_0x4cf885[_0xad00('0x35')],_0x4cf885[_0xad00('0x36')]);_0x2b915b[_0xad00('0x39')]=_[_0xad00('0x3a')](_0x4cf885[_0xad00('0x35')],qs[_0xad00('0x3b')](_0x4cec62[_0xad00('0x36')][_0xad00('0x3b')]));_0x2b915b[_0xad00('0x39')]=_0x2b915b[_0xad00('0x39')][_0xad00('0x3c')]?_0x2b915b[_0xad00('0x39')]:_0x4cf885[_0xad00('0x35')];if(!_0x4cec62[_0xad00('0x36')][_0xad00('0x3d')](_0xad00('0x3e'))){_0x2b915b[_0xad00('0x20')]=qs[_0xad00('0x20')](_0x4cec62[_0xad00('0x36')][_0xad00('0x20')]);_0x2b915b[_0xad00('0x1f')]=qs[_0xad00('0x1f')](_0x4cec62[_0xad00('0x36')]['offset']);}_0x2b915b['order']=qs[_0xad00('0x3f')](_0x4cec62[_0xad00('0x36')]['sort']);_0x2b915b[_0xad00('0x40')]=qs[_0xad00('0x38')](_['pick'](_0x4cec62[_0xad00('0x36')],_0x4cf885[_0xad00('0x38')]),_0x1478b5);if(_0x4cec62['query'][_0xad00('0x41')]){_0x2b915b[_0xad00('0x40')]=_[_0xad00('0x42')](_0x2b915b[_0xad00('0x40')],{'$or':_['map'](_0x1478b5,function(_0x434d1e){if(_0x434d1e[_0xad00('0x33')]!=='VIRTUAL'){var _0x2a8d40={};_0x2a8d40[_0x434d1e['name']]={'$like':'%'+_0x4cec62[_0xad00('0x36')][_0xad00('0x41')]+'%'};return _0x2a8d40;}})});}_0x2b915b=_[_0xad00('0x42')]({},_0x2b915b,_0x4cec62[_0xad00('0x43')]);var _0x51b4ec={'where':_0x2b915b[_0xad00('0x40')]};return db[_0xad00('0x30')][_0xad00('0x1e')](_0x51b4ec)[_0xad00('0x27')](function(_0x2d8e35){_0x4aa95f[_0xad00('0x1e')]=_0x2d8e35;if(_0x4cec62[_0xad00('0x36')]['includeAll']){_0x2b915b[_0xad00('0x44')]=[{'all':!![]}];}return db[_0xad00('0x30')]['findAll'](_0x2b915b);})[_0xad00('0x27')](function(_0x309bac){_0x4aa95f[_0xad00('0x45')]=_0x309bac;return _0x4aa95f;})[_0xad00('0x27')](respondWithFilteredResult(_0x1a9439,_0x2b915b))[_0xad00('0x46')](handleError(_0x1a9439,null));};exports[_0xad00('0x47')]=function(_0x341f9d,_0x17f14a){var _0x5dd6cc={'raw':!![],'where':{'id':_0x341f9d[_0xad00('0x48')]['id']}},_0x47db39={};_0x47db39[_0xad00('0x35')]=_[_0xad00('0x37')](db[_0xad00('0x30')]['rawAttributes']);_0x47db39[_0xad00('0x36')]=_['keys'](_0x341f9d[_0xad00('0x36')]);_0x47db39[_0xad00('0x38')]=_['intersection'](_0x47db39[_0xad00('0x35')],_0x47db39[_0xad00('0x36')]);_0x5dd6cc['attributes']=_[_0xad00('0x3a')](_0x47db39[_0xad00('0x35')],qs[_0xad00('0x3b')](_0x341f9d[_0xad00('0x36')][_0xad00('0x3b')]));_0x5dd6cc[_0xad00('0x39')]=_0x5dd6cc[_0xad00('0x39')][_0xad00('0x3c')]?_0x5dd6cc[_0xad00('0x39')]:_0x47db39[_0xad00('0x35')];if(_0x341f9d['query']['includeAll']){_0x5dd6cc[_0xad00('0x44')]=[{'all':!![]}];}_0x5dd6cc=_[_0xad00('0x42')]({},_0x5dd6cc,_0x341f9d['options']);return db[_0xad00('0x30')]['find'](_0x5dd6cc)[_0xad00('0x27')](handleEntityNotFound(_0x17f14a,null))[_0xad00('0x27')](respondWithResult(_0x17f14a,null))[_0xad00('0x46')](handleError(_0x17f14a,null));};exports[_0xad00('0x49')]=function(_0x25715a,_0xaa3d2b){return db[_0xad00('0x30')][_0xad00('0x49')](_0x25715a[_0xad00('0x4a')],{})[_0xad00('0x27')](function(_0x2a1523){var _0x3cb81f=_0x25715a[_0xad00('0x4b')][_0xad00('0x28')]({'plain':!![]});if(!_0x3cb81f)throw new Error(_0xad00('0x4c'));if(_0x3cb81f[_0xad00('0x4d')]===_0xad00('0x4b')){var _0x8a8702=_0x2a1523['get']({'plain':!![]});var _0x3e196a=_0xad00('0x29');return db['UserProfileSection']['find']({'where':{'name':_0x3e196a,'userProfileId':_0x3cb81f['userProfileId']},'raw':!![]})[_0xad00('0x27')](function(_0x4d0cd9){if(_0x4d0cd9&&_0x4d0cd9[_0xad00('0x4e')]===0x0){return db['UserProfileResource'][_0xad00('0x49')]({'name':_0x8a8702['name'],'resourceId':_0x8a8702['id'],'type':_0x4d0cd9['name'],'sectionId':_0x4d0cd9['id']},{})['then'](function(){return _0x2a1523;});}else{return _0x2a1523;}})[_0xad00('0x46')](function(_0x4e9724){logger[_0xad00('0x4f')](_0xad00('0x50'),_0x4e9724);throw _0x4e9724;});}return _0x2a1523;})[_0xad00('0x27')](respondWithResult(_0xaa3d2b,0xc9))['catch'](handleError(_0xaa3d2b,null));};exports[_0xad00('0x51')]=function(_0x24312c,_0x45e09c){if(_0x24312c[_0xad00('0x4a')]['id']){delete _0x24312c['body']['id'];}return db[_0xad00('0x30')][_0xad00('0x52')]({'where':{'id':_0x24312c['params']['id']}})[_0xad00('0x27')](handleEntityNotFound(_0x45e09c,null))[_0xad00('0x27')](saveUpdates(_0x24312c[_0xad00('0x4a')],null))[_0xad00('0x27')](respondWithResult(_0x45e09c,null))[_0xad00('0x46')](handleError(_0x45e09c,null));};exports['destroy']=function(_0x4f0bcd,_0x471a79){return db[_0xad00('0x30')]['find']({'where':{'id':_0x4f0bcd['params']['id']}})[_0xad00('0x27')](handleEntityNotFound(_0x471a79,null))[_0xad00('0x27')](removeEntity(_0x471a79,null))[_0xad00('0x46')](handleError(_0x471a79,null));};exports[_0xad00('0x53')]=function(_0x19277b,_0x58c1a3){return db[_0xad00('0x30')]['describe']()[_0xad00('0x27')](respondWithResult(_0x58c1a3,null))[_0xad00('0x46')](handleError(_0x58c1a3,null));};exports[_0xad00('0x54')]=function(_0x1f62b3,_0x3424bc,_0x321925){var _0x39f8f6={'raw':!![],'where':{}},_0x41a198={},_0x386e88;return db['FaxQueue'][_0xad00('0x55')]({'where':{'id':_0x1f62b3[_0xad00('0x48')]['id']}})[_0xad00('0x27')](handleEntityNotFound(_0x3424bc,null))[_0xad00('0x27')](function(_0x3f0ff9){if(_0x3f0ff9){_0x386e88=_0x3f0ff9['get']({'plain':!![]});_0x41a198[_0xad00('0x35')]=_['keys'](db[_0xad00('0x56')][_0xad00('0x31')]);_0x41a198[_0xad00('0x36')]=_[_0xad00('0x37')](_0x1f62b3[_0xad00('0x36')]);_0x41a198[_0xad00('0x38')]=_[_0xad00('0x3a')](_0x41a198[_0xad00('0x35')],_0x41a198[_0xad00('0x36')]);_0x39f8f6['attributes']=_[_0xad00('0x3a')](_0x41a198[_0xad00('0x35')],qs[_0xad00('0x3b')](_0x1f62b3[_0xad00('0x36')][_0xad00('0x3b')]));_0x39f8f6[_0xad00('0x39')]=_0x39f8f6['attributes']['length']?_0x39f8f6[_0xad00('0x39')]:_0x41a198[_0xad00('0x35')];if(!_0x1f62b3[_0xad00('0x36')]['hasOwnProperty'](_0xad00('0x3e'))){_0x39f8f6[_0xad00('0x20')]=qs[_0xad00('0x20')](_0x1f62b3[_0xad00('0x36')][_0xad00('0x20')]);_0x39f8f6[_0xad00('0x1f')]=qs[_0xad00('0x1f')](_0x1f62b3[_0xad00('0x36')]['offset']);}_0x39f8f6['order']=qs[_0xad00('0x3f')](_0x1f62b3[_0xad00('0x36')]['sort']);_0x39f8f6['where']=qs['filters'](_[_0xad00('0x57')](_0x1f62b3[_0xad00('0x36')],_0x41a198['filters']));_0x39f8f6[_0xad00('0x40')][_0xad00('0x58')]=_0x3f0ff9['id'];if(_0x1f62b3[_0xad00('0x36')]['filter']){_0x39f8f6[_0xad00('0x40')]=_[_0xad00('0x42')](_0x39f8f6['where'],{'$or':_[_0xad00('0x2f')](_0x39f8f6['attributes'],function(_0x26ae14){var _0x9d0a20={};_0x9d0a20[_0x26ae14]={'$like':'%'+_0x1f62b3[_0xad00('0x36')][_0xad00('0x41')]+'%'};return _0x9d0a20;})});}_0x39f8f6=_[_0xad00('0x42')]({},_0x39f8f6,_0x1f62b3[_0xad00('0x43')]);return db[_0xad00('0x56')]['findAll'](_0x39f8f6);}})[_0xad00('0x27')](function(_0x43e092){if(_0x43e092){return db[_0xad00('0x59')][_0xad00('0x5a')]({'where':{'id':_[_0xad00('0x2f')](_0x43e092,_0xad00('0x5b')),'role':'agent'},'attributes':['id',_0xad00('0x2d'),_0xad00('0x5c'),_0xad00('0x5d'),_0xad00('0x5e')]});}})[_0xad00('0x27')](function(_0x2a402e){if(_0x2a402e){return{'count':_0x2a402e[_0xad00('0x1e')],'rows':_[_0xad00('0x2f')](_0x2a402e[_0xad00('0x45')],function(_0x5b81b4){return{'membername':_0x5b81b4[_0xad00('0x2d')],'UserId':_0x5b81b4['id'],'queue_name':_0x386e88[_0xad00('0x2d')],'FaxQueueId':_0x386e88['id'],'interface':util[_0xad00('0x5f')](_0xad00('0x60'),'SIP',_0x5b81b4['name']),'penalty':0x0,'paused':_0x5b81b4[_0xad00('0x5c')],'createdAt':_0x5b81b4['createdAt'],'updatedAt':_0x5b81b4[_0xad00('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xad00('0x27')](respondWithFilteredResult(_0x3424bc,_0x39f8f6))[_0xad00('0x46')](handleError(_0x3424bc,null));};exports['getTeams']=function(_0x53e3c0,_0x5b8478,_0x2c7dc3){var _0x22ea91={};var _0x3c20f6={};var _0x5e4944;var _0x44e7f5;return db['FaxQueue'][_0xad00('0x55')]({'where':{'id':_0x53e3c0[_0xad00('0x48')]['id']}})[_0xad00('0x27')](handleEntityNotFound(_0x5b8478,null))[_0xad00('0x27')](function(_0x551b61){if(_0x551b61){_0x5e4944=_0x551b61;_0x3c20f6['model']=_['keys'](db[_0xad00('0x61')]['rawAttributes']);_0x3c20f6[_0xad00('0x36')]=_['keys'](_0x53e3c0[_0xad00('0x36')]);_0x3c20f6[_0xad00('0x38')]=_[_0xad00('0x3a')](_0x3c20f6[_0xad00('0x35')],_0x3c20f6[_0xad00('0x36')]);_0x22ea91['attributes']=_['intersection'](_0x3c20f6[_0xad00('0x35')],qs[_0xad00('0x3b')](_0x53e3c0[_0xad00('0x36')][_0xad00('0x3b')]));_0x22ea91['attributes']=_0x22ea91[_0xad00('0x39')]['length']?_0x22ea91[_0xad00('0x39')]:_0x3c20f6['model'];_0x22ea91['order']=qs['sort'](_0x53e3c0[_0xad00('0x36')]['sort']);_0x22ea91[_0xad00('0x40')]=qs[_0xad00('0x38')](_[_0xad00('0x57')](_0x53e3c0[_0xad00('0x36')],_0x3c20f6[_0xad00('0x38')]));if(_0x53e3c0[_0xad00('0x36')][_0xad00('0x41')]){_0x22ea91['where']=_['merge'](_0x22ea91['where'],{'$or':_['map'](_0x22ea91[_0xad00('0x39')],function(_0x3de807){var _0x41d2c8={};_0x41d2c8[_0x3de807]={'$like':'%'+_0x53e3c0[_0xad00('0x36')][_0xad00('0x41')]+'%'};return _0x41d2c8;})});}_0x22ea91=_['merge']({},_0x22ea91,_0x53e3c0['options']);return _0x5e4944[_0xad00('0x62')](_0x22ea91);}})['then'](function(_0x4e5ee4){if(_0x4e5ee4){_0x44e7f5=_0x4e5ee4[_0xad00('0x3c')];if(!_0x53e3c0['query']['hasOwnProperty'](_0xad00('0x3e'))){_0x22ea91[_0xad00('0x20')]=qs['limit'](_0x53e3c0[_0xad00('0x36')][_0xad00('0x20')]);_0x22ea91[_0xad00('0x1f')]=qs[_0xad00('0x1f')](_0x53e3c0[_0xad00('0x36')]['offset']);}return _0x5e4944[_0xad00('0x62')](_0x22ea91);}})[_0xad00('0x27')](function(_0x431473){if(_0x431473){return _0x431473?{'count':_0x44e7f5,'rows':_0x431473}:null;}})['then'](respondWithResult(_0x5b8478,null))['catch'](handleError(_0x5b8478,null));};exports[_0xad00('0x63')]=function(_0x42bfec,_0x52400e,_0x2a5851){var _0x45c21d=_0x42bfec[_0xad00('0x4a')][_0xad00('0x64')];return db[_0xad00('0x61')][_0xad00('0x65')]({'where':{'id':_0x45c21d},'attributes':['id'],'include':[{'model':db[_0xad00('0x59')],'as':_0xad00('0x66'),'attributes':['id',_0xad00('0x2d'),_0xad00('0x67'),_0xad00('0x68'),_0xad00('0x69')],'raw':!![]}]})['then'](function(_0x38cca7){if(_0x38cca7){var _0x47c92f=_[_0xad00('0x6a')](_0x38cca7,function(_0x1c3935){var _0x47ef59=_0x1c3935[_0xad00('0x28')]({'plain':!![]});return _0x47ef59['Agents'];});return db[_0xad00('0x30')][_0xad00('0x52')]({'where':{'id':_0x42bfec[_0xad00('0x48')]['id']}})['then'](function(_0x44eb95){return db['sequelize']['transaction'](function(_0x19ef2a){return _0x44eb95['addTeams'](_0x45c21d,{'transaction':_0x19ef2a})[_0xad00('0x27')](function(){return BPromise['each'](_0x47c92f,function(_0x5bd772){return db['UserFaxQueue'][_0xad00('0x6b')]({'where':{'UserId':_0x5bd772['id'],'FaxQueueId':_0x42bfec['params']['id']},'transaction':_0x19ef2a});});})[_0xad00('0x27')](function(){_0x47c92f[_0xad00('0x6c')](function(_0x4997ac){socket[_0xad00('0x6d')]('userFaxQueue:save',{'UserId':_0x4997ac['id'],'FaxQueueId':_0x44eb95['id']});});});});});}})[_0xad00('0x27')](respondWithStatusCode(_0x52400e,null))['catch'](handleError(_0x52400e,null));};exports[_0xad00('0x6e')]=function(_0x54de7d,_0x5e188a,_0x15517b){return db[_0xad00('0x61')][_0xad00('0x65')]({'where':{'id':_0x54de7d[_0xad00('0x36')]['ids']},'attributes':['id'],'include':[{'model':db[_0xad00('0x59')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xad00('0x27')](handleEntityNotFound(_0x5e188a,null))[_0xad00('0x27')](function(_0x38ed9f){var _0x377125=_['map'](_0x38ed9f,'id');var _0x22f1e7=[];var _0x2cc427=[];var _0x635dc3=squel[_0xad00('0x6f')]();_0x635dc3[_0xad00('0x70')](_0xad00('0x71'))[_0xad00('0x72')](_0xad00('0x73'),'tq')[_0xad00('0x74')](_0xad00('0x75'),'ut',_0xad00('0x76'))[_0xad00('0x40')](_0xad00('0x77'),_0x54de7d[_0xad00('0x48')]['id']);for(var _0x37c9cd=0x0;_0x37c9cd<_0x38ed9f[_0xad00('0x3c')];_0x37c9cd+=0x1){let _0x1a95ef=_0x38ed9f[_0x37c9cd];for(var _0x4a06fa=0x0;_0x4a06fa<_0x1a95ef['Agents']['length'];_0x4a06fa+=0x1){let _0x27685f=_0x1a95ef[_0xad00('0x66')][_0x4a06fa];var _0x4c881c=_0x635dc3[_0xad00('0x78')]();_0x4c881c[_0xad00('0x40')](_0xad00('0x79'),_0x27685f['id']);_0x2cc427[_0xad00('0x7a')](db[_0xad00('0x7b')][_0xad00('0x36')](_0x4c881c[_0xad00('0x7c')](),{'type':db[_0xad00('0x7b')]['QueryTypes'][_0xad00('0x7d')]})[_0xad00('0x27')](function(_0x384ae5){if(_0x384ae5['length']===0x1){return _0x27685f['id'];}else{var _0x493c41=_[_0xad00('0x7e')](_[_0xad00('0x2f')](_0x384ae5,_0xad00('0x7f')),function(_0x260135){return _[_0xad00('0x80')](_0x377125,_0x260135);});if(_0x493c41){return _0x27685f['id'];}}}));}}return BPromise[_0xad00('0x81')](_0x2cc427)[_0xad00('0x27')](function(_0x4e9a6a){_0x22f1e7=_(_0x22f1e7)[_0xad00('0x82')](_0x4e9a6a)[_0xad00('0x83')]()[_0xad00('0x84')]();return db[_0xad00('0x30')][_0xad00('0x52')]({'where':{'id':_0x54de7d[_0xad00('0x48')]['id']}})[_0xad00('0x27')](function(_0x26fe4a){return db[_0xad00('0x7b')]['transaction'](function(_0x44b22d){return _0x26fe4a[_0xad00('0x6e')](_0x54de7d[_0xad00('0x36')]['ids'],{'transaction':_0x44b22d})[_0xad00('0x27')](function(){if(!_[_0xad00('0x85')](_0x22f1e7)){return _0x26fe4a[_0xad00('0x86')](_0x22f1e7,{'transaction':_0x44b22d});}})[_0xad00('0x27')](function(){_0x22f1e7['forEach'](function(_0x16ba55){socket[_0xad00('0x6d')]('userFaxQueue:remove',{'UserId':_0x16ba55,'FaxQueueId':_0x26fe4a['id']});});});});});});})['then'](respondWithStatusCode(_0x5e188a,null))[_0xad00('0x46')](handleError(_0x5e188a,null));};exports['addAgents']=function(_0x5b8d7e,_0x38a2f4,_0x3ab5ca){return db['FaxQueue'][_0xad00('0x52')]({'where':{'id':_0x5b8d7e['params']['id']}})[_0xad00('0x27')](handleEntityNotFound(_0x38a2f4,null))[_0xad00('0x27')](function(_0x4911cc){if(_0x4911cc){return _0x4911cc[_0xad00('0x87')](_0x5b8d7e[_0xad00('0x4a')][_0xad00('0x64')],_['omit'](_0x5b8d7e[_0xad00('0x4a')],[_0xad00('0x64'),'id'])||{})[_0xad00('0x88')](function(_0x772fc){for(var _0x29e155=0x0;_0x29e155<_0x5b8d7e[_0xad00('0x4a')]['ids'][_0xad00('0x3c')];_0x29e155+=0x1){socket[_0xad00('0x6d')]('userFaxQueue:save',{'UserId':Number(_0x5b8d7e[_0xad00('0x4a')]['ids'][_0x29e155]),'FaxQueueId':Number(_0x5b8d7e[_0xad00('0x48')]['id'])});}return _0x772fc;});}})['then'](respondWithResult(_0x38a2f4,null))[_0xad00('0x46')](handleError(_0x38a2f4,null));};exports[_0xad00('0x86')]=function(_0x3d8d82,_0x66c0eb,_0x376e99){return db[_0xad00('0x30')][_0xad00('0x52')]({'where':{'id':_0x3d8d82[_0xad00('0x48')]['id']}})[_0xad00('0x27')](handleEntityNotFound(_0x66c0eb,null))[_0xad00('0x27')](function(_0x16eccb){if(_0x16eccb){return _0x16eccb[_0xad00('0x86')](_0x3d8d82[_0xad00('0x36')][_0xad00('0x64')])[_0xad00('0x27')](function(){if(_[_0xad00('0x89')](_0x3d8d82[_0xad00('0x36')]['ids'])){for(var _0x14f15d=0x0;_0x14f15d<_0x3d8d82['query'][_0xad00('0x64')][_0xad00('0x3c')];_0x14f15d+=0x1){socket[_0xad00('0x6d')]('userFaxQueue:remove',{'UserId':Number(_0x3d8d82['query']['ids'][_0x14f15d]),'FaxQueueId':Number(_0x3d8d82[_0xad00('0x48')]['id'])});}}else{socket['emit']('userFaxQueue:remove',{'UserId':Number(_0x3d8d82[_0xad00('0x36')]['ids']),'FaxQueueId':Number(_0x3d8d82[_0xad00('0x48')]['id'])});}});}})[_0xad00('0x27')](respondWithStatusCode(_0x66c0eb,null))[_0xad00('0x46')](handleError(_0x66c0eb,null));};exports['getAgents']=function(_0x45b0ce,_0x27cef,_0x17c3da){var _0x315974={};var _0xe5ce2a={};var _0x3cb880;var _0x29866e;return db[_0xad00('0x30')][_0xad00('0x55')]({'where':{'id':_0x45b0ce[_0xad00('0x48')]['id']}})['then'](handleEntityNotFound(_0x27cef,null))[_0xad00('0x27')](function(_0x1c98f6){if(_0x1c98f6){_0x3cb880=_0x1c98f6;_0xe5ce2a['model']=_[_0xad00('0x37')](db[_0xad00('0x59')][_0xad00('0x31')]);_0xe5ce2a[_0xad00('0x36')]=_[_0xad00('0x37')](_0x45b0ce[_0xad00('0x36')]);_0xe5ce2a[_0xad00('0x38')]=_[_0xad00('0x3a')](_0xe5ce2a[_0xad00('0x35')],_0xe5ce2a[_0xad00('0x36')]);_0x315974[_0xad00('0x39')]=_['intersection'](_0xe5ce2a['model'],qs[_0xad00('0x3b')](_0x45b0ce[_0xad00('0x36')][_0xad00('0x3b')]));_0x315974[_0xad00('0x39')]=_0x315974[_0xad00('0x39')]['length']?_0x315974[_0xad00('0x39')]:_0xe5ce2a[_0xad00('0x35')];_0x315974[_0xad00('0x8a')]=qs[_0xad00('0x3f')](_0x45b0ce[_0xad00('0x36')]['sort']);_0x315974[_0xad00('0x40')]=qs['filters'](_['pick'](_0x45b0ce[_0xad00('0x36')],_0xe5ce2a[_0xad00('0x38')]));if(_0x45b0ce['query']['filter']){_0x315974[_0xad00('0x40')]=_['merge'](_0x315974['where'],{'$or':_[_0xad00('0x2f')](_0x315974[_0xad00('0x39')],function(_0x21ebe5){var _0xb310e1={};_0xb310e1[_0x21ebe5]={'$like':'%'+_0x45b0ce['query'][_0xad00('0x41')]+'%'};return _0xb310e1;})});}_0x315974=_[_0xad00('0x42')]({},_0x315974,_0x45b0ce[_0xad00('0x43')]);return _0x3cb880[_0xad00('0x8b')](_0x315974);}})['then'](function(_0x36ee00){if(_0x36ee00){_0x29866e=_0x36ee00[_0xad00('0x3c')];if(!_0x45b0ce['query']['hasOwnProperty']('nolimit')){_0x315974[_0xad00('0x20')]=qs[_0xad00('0x20')](_0x45b0ce[_0xad00('0x36')]['limit']);_0x315974[_0xad00('0x1f')]=qs[_0xad00('0x1f')](_0x45b0ce['query'][_0xad00('0x1f')]);}return _0x3cb880[_0xad00('0x8b')](_0x315974);}})[_0xad00('0x27')](function(_0x71824e){if(_0x71824e){return _0x71824e?{'count':_0x29866e,'rows':_0x71824e}:null;}})[_0xad00('0x27')](respondWithResult(_0x27cef,null))[_0xad00('0x46')](handleError(_0x27cef,null));}; \ No newline at end of file +var _0x5d1c=['getTeams','addTeams','ids','Agents','voicePause','interface','flatMap','sequelize','transaction','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?','push','QueryTypes','SELECT','every','includes','all','union','value','isEmpty','removeAgents','emit','addAgents','spread','isArray','userFaxQueue:remove','getAgents','rimraf','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','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','status','end','json','offset','undefined','count','limit','set','reject','save','then','FaxQueues','sendStatus','stack','name','index','map','FaxQueue','rawAttributes','fieldName','key','model','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','keys','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','body','destroy','describe','getMembers','findOne','hasOwnProperty','FaxQueueId','UserFaxQueue','User','findAndCountAll','agent','faxPause','updatedAt','createdAt','%s/%s','SIP'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0x5d1c,0x1dd));var _0xc5d1=function(_0x59f5ca,_0x30ad50){_0x59f5ca=_0x59f5ca-0x0;var _0x5d5a11=_0x5d1c[_0x59f5ca];return _0x5d5a11;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc5d1('0x0'));var zipdir=require(_0xc5d1('0x1'));var jsonpatch=require(_0xc5d1('0x2'));var rp=require('request-promise');var moment=require(_0xc5d1('0x3'));var BPromise=require(_0xc5d1('0x4'));var Mustache=require(_0xc5d1('0x5'));var util=require(_0xc5d1('0x6'));var path=require(_0xc5d1('0x7'));var sox=require(_0xc5d1('0x8'));var csv=require(_0xc5d1('0x9'));var ejs=require(_0xc5d1('0xa'));var fs=require('fs');var fs_extra=require(_0xc5d1('0xb'));var _=require(_0xc5d1('0xc'));var squel=require(_0xc5d1('0xd'));var crypto=require(_0xc5d1('0xe'));var jsforce=require(_0xc5d1('0xf'));var deskjs=require(_0xc5d1('0x10'));var toCsv=require(_0xc5d1('0x9'));var querystring=require(_0xc5d1('0x11'));var Papa=require('papaparse');var Redis=require(_0xc5d1('0x12'));var authService=require(_0xc5d1('0x13'));var qs=require(_0xc5d1('0x14'));var as=require(_0xc5d1('0x15'));var hardwareService=require(_0xc5d1('0x16'));var logger=require(_0xc5d1('0x17'))(_0xc5d1('0x18'));var utils=require('../../config/utils');var config=require(_0xc5d1('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xc5d1('0x1a'))['db'];config[_0xc5d1('0x1b')]=_[_0xc5d1('0x1c')](config[_0xc5d1('0x1b')],{'host':_0xc5d1('0x1d'),'port':0x18eb});var socket=require(_0xc5d1('0x1e'))(new Redis(config[_0xc5d1('0x1b')]));require(_0xc5d1('0x1f'))[_0xc5d1('0x20')](socket);function respondWithStatusCode(_0x4768b0,_0x483755){_0x483755=_0x483755||0xcc;return function(_0x3f756c){if(_0x3f756c){return _0x4768b0['sendStatus'](_0x483755);}return _0x4768b0[_0xc5d1('0x21')](_0x483755)[_0xc5d1('0x22')]();};}function respondWithResult(_0x220f0d,_0x349992){_0x349992=_0x349992||0xc8;return function(_0x189a1f){if(_0x189a1f){return _0x220f0d[_0xc5d1('0x21')](_0x349992)[_0xc5d1('0x23')](_0x189a1f);}};}function respondWithFilteredResult(_0x2f143f,_0x4324b6){return function(_0x4c6b38){if(_0x4c6b38){var _0x52b15c=typeof _0x4324b6[_0xc5d1('0x24')]===_0xc5d1('0x25')&&typeof _0x4324b6['limit']===_0xc5d1('0x25');var _0x208b38=_0x4c6b38[_0xc5d1('0x26')];var _0x2716b6=_0x52b15c?0x0:_0x4324b6['offset'];var _0x597be0=_0x52b15c?_0x4c6b38[_0xc5d1('0x26')]:_0x4324b6[_0xc5d1('0x24')]+_0x4324b6[_0xc5d1('0x27')];var _0x42a495;if(_0x597be0>=_0x208b38){_0x597be0=_0x208b38;_0x42a495=0xc8;}else{_0x42a495=0xce;}_0x2f143f[_0xc5d1('0x21')](_0x42a495);return _0x2f143f[_0xc5d1('0x28')]('Content-Range',_0x2716b6+'-'+_0x597be0+'/'+_0x208b38)[_0xc5d1('0x23')](_0x4c6b38);}return null;};}function patchUpdates(_0x5f2061){return function(_0x2cc13e){try{jsonpatch['apply'](_0x2cc13e,_0x5f2061,!![]);}catch(_0x431bff){return BPromise[_0xc5d1('0x29')](_0x431bff);}return _0x2cc13e[_0xc5d1('0x2a')]();};}function saveUpdates(_0x403835,_0x372bf2){return function(_0x3c0a99){if(_0x3c0a99){return _0x3c0a99['update'](_0x403835)['then'](function(_0x3ffaab){return _0x3ffaab;});}return null;};}function removeEntity(_0xba242b,_0x2f2fef){return function(_0xe6f49e){if(_0xe6f49e){return _0xe6f49e['destroy']()[_0xc5d1('0x2b')](function(){var _0x430d9b=_0xe6f49e['get']({'plain':!![]});var _0x1ccb55=_0xc5d1('0x2c');return db['UserProfileResource']['destroy']({'where':{'type':_0x1ccb55,'resourceId':_0x430d9b['id']}})[_0xc5d1('0x2b')](function(){return _0xe6f49e;});})[_0xc5d1('0x2b')](function(){_0xba242b['status'](0xcc)[_0xc5d1('0x22')]();});}};}function handleEntityNotFound(_0x39ec4d,_0x1ae27d){return function(_0x1e06d9){if(!_0x1e06d9){_0x39ec4d[_0xc5d1('0x2d')](0x194);}return _0x1e06d9;};}function handleError(_0x1bf18f,_0x2c932e){_0x2c932e=_0x2c932e||0x1f4;return function(_0x82185d){logger['error'](_0x82185d[_0xc5d1('0x2e')]);if(_0x82185d['name']){delete _0x82185d[_0xc5d1('0x2f')];}_0x1bf18f[_0xc5d1('0x21')](_0x2c932e)['send'](_0x82185d);};}exports[_0xc5d1('0x30')]=function(_0x621e35,_0x51bba2){var _0x29a055={},_0x122a4f={},_0x118e1c={'count':0x0,'rows':[]};var _0x3e8674=_[_0xc5d1('0x31')](db[_0xc5d1('0x32')][_0xc5d1('0x33')],function(_0x3831f4){return{'name':_0x3831f4[_0xc5d1('0x34')],'type':_0x3831f4['type'][_0xc5d1('0x35')]};});_0x122a4f[_0xc5d1('0x36')]=_[_0xc5d1('0x31')](_0x3e8674,'name');_0x122a4f[_0xc5d1('0x37')]=_['keys'](_0x621e35[_0xc5d1('0x37')]);_0x122a4f[_0xc5d1('0x38')]=_['intersection'](_0x122a4f['model'],_0x122a4f[_0xc5d1('0x37')]);_0x29a055[_0xc5d1('0x39')]=_[_0xc5d1('0x3a')](_0x122a4f['model'],qs['fields'](_0x621e35[_0xc5d1('0x37')][_0xc5d1('0x3b')]));_0x29a055[_0xc5d1('0x39')]=_0x29a055[_0xc5d1('0x39')][_0xc5d1('0x3c')]?_0x29a055[_0xc5d1('0x39')]:_0x122a4f[_0xc5d1('0x36')];if(!_0x621e35[_0xc5d1('0x37')]['hasOwnProperty'](_0xc5d1('0x3d'))){_0x29a055['limit']=qs['limit'](_0x621e35[_0xc5d1('0x37')][_0xc5d1('0x27')]);_0x29a055[_0xc5d1('0x24')]=qs['offset'](_0x621e35[_0xc5d1('0x37')][_0xc5d1('0x24')]);}_0x29a055[_0xc5d1('0x3e')]=qs['sort'](_0x621e35[_0xc5d1('0x37')][_0xc5d1('0x3f')]);_0x29a055[_0xc5d1('0x40')]=qs[_0xc5d1('0x38')](_[_0xc5d1('0x41')](_0x621e35[_0xc5d1('0x37')],_0x122a4f['filters']),_0x3e8674);if(_0x621e35['query'][_0xc5d1('0x42')]){_0x29a055['where']=_[_0xc5d1('0x43')](_0x29a055['where'],{'$or':_['map'](_0x3e8674,function(_0x20b981){if(_0x20b981['type']!==_0xc5d1('0x44')){var _0x5db4c1={};_0x5db4c1[_0x20b981['name']]={'$like':'%'+_0x621e35[_0xc5d1('0x37')][_0xc5d1('0x42')]+'%'};return _0x5db4c1;}})});}_0x29a055=_['merge']({},_0x29a055,_0x621e35[_0xc5d1('0x45')]);var _0x3a15e3={'where':_0x29a055[_0xc5d1('0x40')]};return db[_0xc5d1('0x32')][_0xc5d1('0x26')](_0x3a15e3)[_0xc5d1('0x2b')](function(_0x296fc7){_0x118e1c[_0xc5d1('0x26')]=_0x296fc7;if(_0x621e35[_0xc5d1('0x37')][_0xc5d1('0x46')]){_0x29a055[_0xc5d1('0x47')]=[{'all':!![]}];}return db[_0xc5d1('0x32')][_0xc5d1('0x48')](_0x29a055);})[_0xc5d1('0x2b')](function(_0x4159df){_0x118e1c[_0xc5d1('0x49')]=_0x4159df;return _0x118e1c;})[_0xc5d1('0x2b')](respondWithFilteredResult(_0x51bba2,_0x29a055))['catch'](handleError(_0x51bba2,null));};exports[_0xc5d1('0x4a')]=function(_0x13dc31,_0x2a2a5c){var _0x20a008={'raw':!![],'where':{'id':_0x13dc31['params']['id']}},_0x14a63f={};_0x14a63f[_0xc5d1('0x36')]=_['keys'](db[_0xc5d1('0x32')][_0xc5d1('0x33')]);_0x14a63f[_0xc5d1('0x37')]=_[_0xc5d1('0x4b')](_0x13dc31[_0xc5d1('0x37')]);_0x14a63f['filters']=_[_0xc5d1('0x3a')](_0x14a63f[_0xc5d1('0x36')],_0x14a63f['query']);_0x20a008['attributes']=_[_0xc5d1('0x3a')](_0x14a63f[_0xc5d1('0x36')],qs[_0xc5d1('0x3b')](_0x13dc31[_0xc5d1('0x37')][_0xc5d1('0x3b')]));_0x20a008['attributes']=_0x20a008[_0xc5d1('0x39')][_0xc5d1('0x3c')]?_0x20a008[_0xc5d1('0x39')]:_0x14a63f['model'];if(_0x13dc31[_0xc5d1('0x37')][_0xc5d1('0x46')]){_0x20a008['include']=[{'all':!![]}];}_0x20a008=_[_0xc5d1('0x43')]({},_0x20a008,_0x13dc31[_0xc5d1('0x45')]);return db[_0xc5d1('0x32')][_0xc5d1('0x4c')](_0x20a008)[_0xc5d1('0x2b')](handleEntityNotFound(_0x2a2a5c,null))[_0xc5d1('0x2b')](respondWithResult(_0x2a2a5c,null))[_0xc5d1('0x4d')](handleError(_0x2a2a5c,null));};exports[_0xc5d1('0x4e')]=function(_0x1f534b,_0x1281aa){return db['FaxQueue'][_0xc5d1('0x4e')](_0x1f534b['body'],{})['then'](function(_0xd07bc3){var _0x867271=_0x1f534b[_0xc5d1('0x4f')][_0xc5d1('0x50')]({'plain':!![]});if(!_0x867271)throw new Error(_0xc5d1('0x51'));if(_0x867271[_0xc5d1('0x52')]===_0xc5d1('0x4f')){var _0x1d4960=_0xd07bc3[_0xc5d1('0x50')]({'plain':!![]});var _0x31b4db=_0xc5d1('0x2c');return db[_0xc5d1('0x53')][_0xc5d1('0x4c')]({'where':{'name':_0x31b4db,'userProfileId':_0x867271[_0xc5d1('0x54')]},'raw':!![]})['then'](function(_0x23e58e){if(_0x23e58e&&_0x23e58e[_0xc5d1('0x55')]===0x0){return db[_0xc5d1('0x56')][_0xc5d1('0x4e')]({'name':_0x1d4960[_0xc5d1('0x2f')],'resourceId':_0x1d4960['id'],'type':_0x23e58e[_0xc5d1('0x2f')],'sectionId':_0x23e58e['id']},{})[_0xc5d1('0x2b')](function(){return _0xd07bc3;});}else{return _0xd07bc3;}})[_0xc5d1('0x4d')](function(_0xccd23){logger[_0xc5d1('0x57')](_0xc5d1('0x58'),_0xccd23);throw _0xccd23;});}return _0xd07bc3;})[_0xc5d1('0x2b')](respondWithResult(_0x1281aa,0xc9))['catch'](handleError(_0x1281aa,null));};exports[_0xc5d1('0x59')]=function(_0x4e43a9,_0x20b1ec){if(_0x4e43a9['body']['id']){delete _0x4e43a9['body']['id'];}return db[_0xc5d1('0x32')][_0xc5d1('0x4c')]({'where':{'id':_0x4e43a9[_0xc5d1('0x5a')]['id']}})[_0xc5d1('0x2b')](handleEntityNotFound(_0x20b1ec,null))[_0xc5d1('0x2b')](saveUpdates(_0x4e43a9[_0xc5d1('0x5b')],null))['then'](respondWithResult(_0x20b1ec,null))[_0xc5d1('0x4d')](handleError(_0x20b1ec,null));};exports[_0xc5d1('0x5c')]=function(_0x27f48d,_0x20e80e){return db[_0xc5d1('0x32')]['find']({'where':{'id':_0x27f48d['params']['id']}})['then'](handleEntityNotFound(_0x20e80e,null))[_0xc5d1('0x2b')](removeEntity(_0x20e80e,null))[_0xc5d1('0x4d')](handleError(_0x20e80e,null));};exports[_0xc5d1('0x5d')]=function(_0x4017f2,_0x293a1d){return db[_0xc5d1('0x32')][_0xc5d1('0x5d')]()[_0xc5d1('0x2b')](respondWithResult(_0x293a1d,null))[_0xc5d1('0x4d')](handleError(_0x293a1d,null));};exports[_0xc5d1('0x5e')]=function(_0x1167fd,_0x166ce7,_0x2ed7b7){var _0x59e560={'raw':!![],'where':{}},_0x468295={},_0x35122f;return db[_0xc5d1('0x32')][_0xc5d1('0x5f')]({'where':{'id':_0x1167fd[_0xc5d1('0x5a')]['id']}})[_0xc5d1('0x2b')](handleEntityNotFound(_0x166ce7,null))[_0xc5d1('0x2b')](function(_0x34814b){if(_0x34814b){_0x35122f=_0x34814b['get']({'plain':!![]});_0x468295['model']=_[_0xc5d1('0x4b')](db['UserFaxQueue'][_0xc5d1('0x33')]);_0x468295[_0xc5d1('0x37')]=_['keys'](_0x1167fd[_0xc5d1('0x37')]);_0x468295[_0xc5d1('0x38')]=_['intersection'](_0x468295[_0xc5d1('0x36')],_0x468295[_0xc5d1('0x37')]);_0x59e560['attributes']=_[_0xc5d1('0x3a')](_0x468295[_0xc5d1('0x36')],qs[_0xc5d1('0x3b')](_0x1167fd[_0xc5d1('0x37')][_0xc5d1('0x3b')]));_0x59e560[_0xc5d1('0x39')]=_0x59e560[_0xc5d1('0x39')][_0xc5d1('0x3c')]?_0x59e560[_0xc5d1('0x39')]:_0x468295[_0xc5d1('0x36')];if(!_0x1167fd[_0xc5d1('0x37')][_0xc5d1('0x60')](_0xc5d1('0x3d'))){_0x59e560[_0xc5d1('0x27')]=qs[_0xc5d1('0x27')](_0x1167fd[_0xc5d1('0x37')][_0xc5d1('0x27')]);_0x59e560['offset']=qs[_0xc5d1('0x24')](_0x1167fd[_0xc5d1('0x37')][_0xc5d1('0x24')]);}_0x59e560[_0xc5d1('0x3e')]=qs[_0xc5d1('0x3f')](_0x1167fd[_0xc5d1('0x37')][_0xc5d1('0x3f')]);_0x59e560[_0xc5d1('0x40')]=qs['filters'](_[_0xc5d1('0x41')](_0x1167fd[_0xc5d1('0x37')],_0x468295['filters']));_0x59e560['where'][_0xc5d1('0x61')]=_0x34814b['id'];if(_0x1167fd[_0xc5d1('0x37')][_0xc5d1('0x42')]){_0x59e560['where']=_[_0xc5d1('0x43')](_0x59e560[_0xc5d1('0x40')],{'$or':_['map'](_0x59e560[_0xc5d1('0x39')],function(_0x5f3e7e){var _0x6c2264={};_0x6c2264[_0x5f3e7e]={'$like':'%'+_0x1167fd[_0xc5d1('0x37')][_0xc5d1('0x42')]+'%'};return _0x6c2264;})});}_0x59e560=_[_0xc5d1('0x43')]({},_0x59e560,_0x1167fd[_0xc5d1('0x45')]);return db[_0xc5d1('0x62')]['findAll'](_0x59e560);}})[_0xc5d1('0x2b')](function(_0x388e21){if(_0x388e21){return db[_0xc5d1('0x63')][_0xc5d1('0x64')]({'where':{'id':_[_0xc5d1('0x31')](_0x388e21,'UserId'),'role':_0xc5d1('0x65')},'attributes':['id',_0xc5d1('0x2f'),_0xc5d1('0x66'),_0xc5d1('0x67'),_0xc5d1('0x68')]});}})[_0xc5d1('0x2b')](function(_0x5331a0){if(_0x5331a0){return{'count':_0x5331a0[_0xc5d1('0x26')],'rows':_[_0xc5d1('0x31')](_0x5331a0[_0xc5d1('0x49')],function(_0x56a2f2){return{'membername':_0x56a2f2[_0xc5d1('0x2f')],'UserId':_0x56a2f2['id'],'queue_name':_0x35122f[_0xc5d1('0x2f')],'FaxQueueId':_0x35122f['id'],'interface':util['format'](_0xc5d1('0x69'),_0xc5d1('0x6a'),_0x56a2f2[_0xc5d1('0x2f')]),'penalty':0x0,'paused':_0x56a2f2[_0xc5d1('0x66')],'createdAt':_0x56a2f2[_0xc5d1('0x68')],'updatedAt':_0x56a2f2['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xc5d1('0x2b')](respondWithFilteredResult(_0x166ce7,_0x59e560))['catch'](handleError(_0x166ce7,null));};exports[_0xc5d1('0x6b')]=function(_0x2d4fab,_0x3eaa55,_0x5c8755){var _0x457bb4={};var _0x1eefb1={};var _0x615a79;var _0x1d8f76;return db[_0xc5d1('0x32')][_0xc5d1('0x5f')]({'where':{'id':_0x2d4fab[_0xc5d1('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3eaa55,null))['then'](function(_0x20aa74){if(_0x20aa74){_0x615a79=_0x20aa74;_0x1eefb1[_0xc5d1('0x36')]=_[_0xc5d1('0x4b')](db['Team'][_0xc5d1('0x33')]);_0x1eefb1[_0xc5d1('0x37')]=_[_0xc5d1('0x4b')](_0x2d4fab['query']);_0x1eefb1['filters']=_['intersection'](_0x1eefb1[_0xc5d1('0x36')],_0x1eefb1[_0xc5d1('0x37')]);_0x457bb4['attributes']=_[_0xc5d1('0x3a')](_0x1eefb1['model'],qs['fields'](_0x2d4fab['query'][_0xc5d1('0x3b')]));_0x457bb4[_0xc5d1('0x39')]=_0x457bb4[_0xc5d1('0x39')][_0xc5d1('0x3c')]?_0x457bb4[_0xc5d1('0x39')]:_0x1eefb1[_0xc5d1('0x36')];_0x457bb4[_0xc5d1('0x3e')]=qs[_0xc5d1('0x3f')](_0x2d4fab[_0xc5d1('0x37')][_0xc5d1('0x3f')]);_0x457bb4[_0xc5d1('0x40')]=qs[_0xc5d1('0x38')](_[_0xc5d1('0x41')](_0x2d4fab['query'],_0x1eefb1[_0xc5d1('0x38')]));if(_0x2d4fab[_0xc5d1('0x37')][_0xc5d1('0x42')]){_0x457bb4[_0xc5d1('0x40')]=_[_0xc5d1('0x43')](_0x457bb4[_0xc5d1('0x40')],{'$or':_[_0xc5d1('0x31')](_0x457bb4[_0xc5d1('0x39')],function(_0x58a290){var _0x3cef57={};_0x3cef57[_0x58a290]={'$like':'%'+_0x2d4fab['query'][_0xc5d1('0x42')]+'%'};return _0x3cef57;})});}_0x457bb4=_[_0xc5d1('0x43')]({},_0x457bb4,_0x2d4fab[_0xc5d1('0x45')]);return _0x615a79['getTeams'](_0x457bb4);}})[_0xc5d1('0x2b')](function(_0x193585){if(_0x193585){_0x1d8f76=_0x193585[_0xc5d1('0x3c')];if(!_0x2d4fab[_0xc5d1('0x37')]['hasOwnProperty'](_0xc5d1('0x3d'))){_0x457bb4[_0xc5d1('0x27')]=qs[_0xc5d1('0x27')](_0x2d4fab['query'][_0xc5d1('0x27')]);_0x457bb4[_0xc5d1('0x24')]=qs[_0xc5d1('0x24')](_0x2d4fab[_0xc5d1('0x37')][_0xc5d1('0x24')]);}return _0x615a79['getTeams'](_0x457bb4);}})['then'](function(_0x29043c){if(_0x29043c){return _0x29043c?{'count':_0x1d8f76,'rows':_0x29043c}:null;}})[_0xc5d1('0x2b')](respondWithResult(_0x3eaa55,null))['catch'](handleError(_0x3eaa55,null));};exports[_0xc5d1('0x6c')]=function(_0x351332,_0x44aed9,_0x18eba9){var _0x22f1ef=_0x351332[_0xc5d1('0x5b')][_0xc5d1('0x6d')];return db['Team'][_0xc5d1('0x48')]({'where':{'id':_0x22f1ef},'attributes':['id'],'include':[{'model':db[_0xc5d1('0x63')],'as':_0xc5d1('0x6e'),'attributes':['id',_0xc5d1('0x2f'),'online',_0xc5d1('0x6f'),_0xc5d1('0x70')],'raw':!![]}]})[_0xc5d1('0x2b')](function(_0x5c7f63){if(_0x5c7f63){var _0x528fff=_[_0xc5d1('0x71')](_0x5c7f63,function(_0x104df9){var _0x3ed1ba=_0x104df9[_0xc5d1('0x50')]({'plain':!![]});return _0x3ed1ba['Agents'];});return db['FaxQueue']['find']({'where':{'id':_0x351332[_0xc5d1('0x5a')]['id']}})['then'](function(_0x9917e){return db[_0xc5d1('0x72')][_0xc5d1('0x73')](function(_0x49adc7){return _0x9917e[_0xc5d1('0x6c')](_0x22f1ef,{'transaction':_0x49adc7})[_0xc5d1('0x2b')](function(){return BPromise['each'](_0x528fff,function(_0x666787){return db[_0xc5d1('0x62')]['findOrCreate']({'where':{'UserId':_0x666787['id'],'FaxQueueId':_0x351332[_0xc5d1('0x5a')]['id']},'transaction':_0x49adc7});});})[_0xc5d1('0x2b')](function(){_0x528fff[_0xc5d1('0x74')](function(_0x443006){socket['emit'](_0xc5d1('0x75'),{'UserId':_0x443006['id'],'FaxQueueId':_0x9917e['id']});});});});});}})['then'](respondWithStatusCode(_0x44aed9,null))['catch'](handleError(_0x44aed9,null));};exports[_0xc5d1('0x76')]=function(_0x342ca5,_0x265d15,_0x510e90){return db['Team'][_0xc5d1('0x48')]({'where':{'id':_0x342ca5['query'][_0xc5d1('0x6d')]},'attributes':['id'],'include':[{'model':db[_0xc5d1('0x63')],'as':_0xc5d1('0x6e'),'attributes':['id'],'raw':!![]}]})[_0xc5d1('0x2b')](handleEntityNotFound(_0x265d15,null))[_0xc5d1('0x2b')](function(_0x579c09){var _0x4e34b1=_[_0xc5d1('0x31')](_0x579c09,'id');var _0xa559cd=[];var _0x2009d9=[];var _0x50ddb6=squel[_0xc5d1('0x77')]();_0x50ddb6[_0xc5d1('0x78')](_0xc5d1('0x79'))[_0xc5d1('0x7a')](_0xc5d1('0x7b'),'tq')[_0xc5d1('0x7c')](_0xc5d1('0x7d'),'ut',_0xc5d1('0x7e'))['where'](_0xc5d1('0x7f'),_0x342ca5[_0xc5d1('0x5a')]['id']);for(var _0x5e4472=0x0;_0x5e4472<_0x579c09[_0xc5d1('0x3c')];_0x5e4472+=0x1){let _0x548428=_0x579c09[_0x5e4472];for(var _0x213940=0x0;_0x213940<_0x548428['Agents'][_0xc5d1('0x3c')];_0x213940+=0x1){let _0x5af021=_0x548428['Agents'][_0x213940];var _0x3e5efd=_0x50ddb6[_0xc5d1('0x80')]();_0x3e5efd[_0xc5d1('0x40')](_0xc5d1('0x81'),_0x5af021['id']);_0x2009d9[_0xc5d1('0x82')](db[_0xc5d1('0x72')][_0xc5d1('0x37')](_0x3e5efd['toString'](),{'type':db[_0xc5d1('0x72')][_0xc5d1('0x83')][_0xc5d1('0x84')]})[_0xc5d1('0x2b')](function(_0x1cf3c3){if(_0x1cf3c3[_0xc5d1('0x3c')]===0x1){return _0x5af021['id'];}else{var _0x581288=_[_0xc5d1('0x85')](_[_0xc5d1('0x31')](_0x1cf3c3,'TeamId'),function(_0x4c2d75){return _[_0xc5d1('0x86')](_0x4e34b1,_0x4c2d75);});if(_0x581288){return _0x5af021['id'];}}}));}}return BPromise[_0xc5d1('0x87')](_0x2009d9)['then'](function(_0x3e9a6c){_0xa559cd=_(_0xa559cd)[_0xc5d1('0x88')](_0x3e9a6c)['compact']()[_0xc5d1('0x89')]();return db[_0xc5d1('0x32')][_0xc5d1('0x4c')]({'where':{'id':_0x342ca5[_0xc5d1('0x5a')]['id']}})[_0xc5d1('0x2b')](function(_0x5bb32f){return db['sequelize']['transaction'](function(_0x17b865){return _0x5bb32f['removeTeams'](_0x342ca5[_0xc5d1('0x37')][_0xc5d1('0x6d')],{'transaction':_0x17b865})['then'](function(){if(!_[_0xc5d1('0x8a')](_0xa559cd)){return _0x5bb32f[_0xc5d1('0x8b')](_0xa559cd,{'transaction':_0x17b865});}})['then'](function(){_0xa559cd['forEach'](function(_0x222c6a){socket[_0xc5d1('0x8c')]('userFaxQueue:remove',{'UserId':_0x222c6a,'FaxQueueId':_0x5bb32f['id']});});});});});});})[_0xc5d1('0x2b')](respondWithStatusCode(_0x265d15,null))[_0xc5d1('0x4d')](handleError(_0x265d15,null));};exports[_0xc5d1('0x8d')]=function(_0x6ef648,_0x5a7682,_0x119401){return db[_0xc5d1('0x32')]['find']({'where':{'id':_0x6ef648[_0xc5d1('0x5a')]['id']}})[_0xc5d1('0x2b')](handleEntityNotFound(_0x5a7682,null))[_0xc5d1('0x2b')](function(_0x530aef){if(_0x530aef){return _0x530aef[_0xc5d1('0x8d')](_0x6ef648[_0xc5d1('0x5b')][_0xc5d1('0x6d')],_['omit'](_0x6ef648[_0xc5d1('0x5b')],[_0xc5d1('0x6d'),'id'])||{})[_0xc5d1('0x8e')](function(_0x2bd057){for(var _0xcaeda5=0x0;_0xcaeda5<_0x6ef648[_0xc5d1('0x5b')]['ids'][_0xc5d1('0x3c')];_0xcaeda5+=0x1){socket['emit']('userFaxQueue:save',{'UserId':Number(_0x6ef648[_0xc5d1('0x5b')][_0xc5d1('0x6d')][_0xcaeda5]),'FaxQueueId':Number(_0x6ef648[_0xc5d1('0x5a')]['id'])});}return _0x2bd057;});}})[_0xc5d1('0x2b')](respondWithResult(_0x5a7682,null))[_0xc5d1('0x4d')](handleError(_0x5a7682,null));};exports[_0xc5d1('0x8b')]=function(_0x4252d8,_0xec5f9b,_0x2321d6){return db[_0xc5d1('0x32')][_0xc5d1('0x4c')]({'where':{'id':_0x4252d8['params']['id']}})[_0xc5d1('0x2b')](handleEntityNotFound(_0xec5f9b,null))[_0xc5d1('0x2b')](function(_0x53beb8){if(_0x53beb8){return _0x53beb8[_0xc5d1('0x8b')](_0x4252d8[_0xc5d1('0x37')][_0xc5d1('0x6d')])[_0xc5d1('0x2b')](function(){if(_[_0xc5d1('0x8f')](_0x4252d8['query'][_0xc5d1('0x6d')])){for(var _0x384f6d=0x0;_0x384f6d<_0x4252d8[_0xc5d1('0x37')][_0xc5d1('0x6d')][_0xc5d1('0x3c')];_0x384f6d+=0x1){socket[_0xc5d1('0x8c')]('userFaxQueue:remove',{'UserId':Number(_0x4252d8[_0xc5d1('0x37')][_0xc5d1('0x6d')][_0x384f6d]),'FaxQueueId':Number(_0x4252d8[_0xc5d1('0x5a')]['id'])});}}else{socket[_0xc5d1('0x8c')](_0xc5d1('0x90'),{'UserId':Number(_0x4252d8[_0xc5d1('0x37')][_0xc5d1('0x6d')]),'FaxQueueId':Number(_0x4252d8[_0xc5d1('0x5a')]['id'])});}});}})[_0xc5d1('0x2b')](respondWithStatusCode(_0xec5f9b,null))['catch'](handleError(_0xec5f9b,null));};exports['getAgents']=function(_0x15fbb1,_0x107d0f,_0x4e4659){var _0x4c2738={};var _0x504ce0={};var _0x4b8dc7;var _0x4dec16;return db['FaxQueue'][_0xc5d1('0x5f')]({'where':{'id':_0x15fbb1['params']['id']}})[_0xc5d1('0x2b')](handleEntityNotFound(_0x107d0f,null))[_0xc5d1('0x2b')](function(_0x23c04f){if(_0x23c04f){_0x4b8dc7=_0x23c04f;_0x504ce0['model']=_['keys'](db['User']['rawAttributes']);_0x504ce0['query']=_[_0xc5d1('0x4b')](_0x15fbb1[_0xc5d1('0x37')]);_0x504ce0[_0xc5d1('0x38')]=_[_0xc5d1('0x3a')](_0x504ce0[_0xc5d1('0x36')],_0x504ce0[_0xc5d1('0x37')]);_0x4c2738['attributes']=_[_0xc5d1('0x3a')](_0x504ce0['model'],qs[_0xc5d1('0x3b')](_0x15fbb1[_0xc5d1('0x37')][_0xc5d1('0x3b')]));_0x4c2738[_0xc5d1('0x39')]=_0x4c2738[_0xc5d1('0x39')][_0xc5d1('0x3c')]?_0x4c2738['attributes']:_0x504ce0[_0xc5d1('0x36')];_0x4c2738[_0xc5d1('0x3e')]=qs[_0xc5d1('0x3f')](_0x15fbb1[_0xc5d1('0x37')][_0xc5d1('0x3f')]);_0x4c2738[_0xc5d1('0x40')]=qs['filters'](_[_0xc5d1('0x41')](_0x15fbb1[_0xc5d1('0x37')],_0x504ce0[_0xc5d1('0x38')]));if(_0x15fbb1[_0xc5d1('0x37')][_0xc5d1('0x42')]){_0x4c2738[_0xc5d1('0x40')]=_[_0xc5d1('0x43')](_0x4c2738[_0xc5d1('0x40')],{'$or':_['map'](_0x4c2738[_0xc5d1('0x39')],function(_0x2d79cd){var _0x53a67c={};_0x53a67c[_0x2d79cd]={'$like':'%'+_0x15fbb1['query'][_0xc5d1('0x42')]+'%'};return _0x53a67c;})});}_0x4c2738=_[_0xc5d1('0x43')]({},_0x4c2738,_0x15fbb1['options']);return _0x4b8dc7[_0xc5d1('0x91')](_0x4c2738);}})[_0xc5d1('0x2b')](function(_0x2079c0){if(_0x2079c0){_0x4dec16=_0x2079c0[_0xc5d1('0x3c')];if(!_0x15fbb1[_0xc5d1('0x37')][_0xc5d1('0x60')](_0xc5d1('0x3d'))){_0x4c2738['limit']=qs[_0xc5d1('0x27')](_0x15fbb1['query']['limit']);_0x4c2738[_0xc5d1('0x24')]=qs[_0xc5d1('0x24')](_0x15fbb1[_0xc5d1('0x37')][_0xc5d1('0x24')]);}return _0x4b8dc7[_0xc5d1('0x91')](_0x4c2738);}})[_0xc5d1('0x2b')](function(_0x2d3000){if(_0x2d3000){return _0x2d3000?{'count':_0x4dec16,'rows':_0x2d3000}:null;}})[_0xc5d1('0x2b')](respondWithResult(_0x107d0f,null))['catch'](handleError(_0x107d0f,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index d930b95..a4c7ba0 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 _0xc782=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxQueue','save','update','remove'];(function(_0x5b4e81,_0x1511af){var _0x36d33b=function(_0x2f6ef4){while(--_0x2f6ef4){_0x5b4e81['push'](_0x5b4e81['shift']());}};_0x36d33b(++_0x1511af);}(_0xc782,0x180));var _0x2c78=function(_0x107df9,_0x4d1825){_0x107df9=_0x107df9-0x0;var _0x2df84a=_0xc782[_0x107df9];return _0x2df84a;};'use strict';var EventEmitter=require(_0x2c78('0x0'));var FaxQueue=require(_0x2c78('0x1'))['db'][_0x2c78('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2c78('0x3'),'afterUpdate':_0x2c78('0x4'),'afterDestroy':_0x2c78('0x5')};function emitEvent(_0x16d78c){return function(_0x419ff1,_0x9a2636,_0x4c7827){FaxQueueEvents[_0x2c78('0x6')](_0x16d78c+':'+_0x419ff1['id'],_0x419ff1);FaxQueueEvents[_0x2c78('0x6')](_0x16d78c,_0x419ff1);_0x4c7827(null);};}for(var e in events){if(events[_0x2c78('0x7')](e)){var event=events[e];FaxQueue[_0x2c78('0x8')](e,emitEvent(event));}}module[_0x2c78('0x9')]=FaxQueueEvents; \ No newline at end of file +var _0xd01a=['events','remove','emit','hasOwnProperty'];(function(_0xda04c5,_0x1292a3){var _0x5a92d7=function(_0x21374c){while(--_0x21374c){_0xda04c5['push'](_0xda04c5['shift']());}};_0x5a92d7(++_0x1292a3);}(_0xd01a,0x144));var _0xad01=function(_0x7f1f52,_0x42c666){_0x7f1f52=_0x7f1f52-0x0;var _0xf657b6=_0xd01a[_0x7f1f52];return _0xf657b6;};'use strict';var EventEmitter=require(_0xad01('0x0'));var FaxQueue=require('../../mysqldb')['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xad01('0x1')};function emitEvent(_0x3cad4d){return function(_0x49fb7f,_0x445fff,_0x29c06a){FaxQueueEvents[_0xad01('0x2')](_0x3cad4d+':'+_0x49fb7f['id'],_0x49fb7f);FaxQueueEvents['emit'](_0x3cad4d,_0x49fb7f);_0x29c06a(null);};}for(var e in events){if(events[_0xad01('0x3')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 8eb9fac..2c849fd 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 _0xb89c=['fax_queues','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./faxQueue.attributes','exports','FaxQueue'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0xb89c,0xe5));var _0xcb89=function(_0x328505,_0x4b3105){_0x328505=_0x328505-0x0;var _0x1994ff=_0xb89c[_0x328505];return _0x1994ff;};'use strict';var _=require(_0xcb89('0x0'));var util=require(_0xcb89('0x1'));var logger=require(_0xcb89('0x2'))(_0xcb89('0x3'));var moment=require(_0xcb89('0x4'));var BPromise=require('bluebird');var rp=require(_0xcb89('0x5'));var fs=require('fs');var path=require(_0xcb89('0x6'));var rimraf=require('rimraf');var config=require(_0xcb89('0x7'));var attributes=require(_0xcb89('0x8'));module[_0xcb89('0x9')]=function(_0x48dc28,_0x1e3d2f){return _0x48dc28['define'](_0xcb89('0xa'),attributes,{'tableName':_0xcb89('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x27a6=['define','FaxQueue','fax_queues','lodash','api','path','rimraf','../../config/environment','./faxQueue.attributes','exports'];(function(_0x53f2da,_0x4a26f4){var _0x53d879=function(_0x4d9e4c){while(--_0x4d9e4c){_0x53f2da['push'](_0x53f2da['shift']());}};_0x53d879(++_0x4a26f4);}(_0x27a6,0x175));var _0x627a=function(_0x414810,_0x5e924d){_0x414810=_0x414810-0x0;var _0x2d4df5=_0x27a6[_0x414810];return _0x2d4df5;};'use strict';var _=require(_0x627a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x627a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x627a('0x2'));var rimraf=require(_0x627a('0x3'));var config=require(_0x627a('0x4'));var attributes=require(_0x627a('0x5'));module[_0x627a('0x6')]=function(_0x28c6ca,_0x942778){return _0x28c6ca[_0x627a('0x7')](_0x627a('0x8'),attributes,{'tableName':_0x627a('0x9'),'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 3157076..d191156 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 _0x9a72=['model','ShowFaxQueue','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','request','then','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','GetFaxQueue','FaxQueue','options','where','attributes','map','include'];(function(_0x5d31ee,_0x183e43){var _0x21c2e6=function(_0x176343){while(--_0x176343){_0x5d31ee['push'](_0x5d31ee['shift']());}};_0x21c2e6(++_0x183e43);}(_0x9a72,0xda));var _0x29a7=function(_0x593254,_0x398971){_0x593254=_0x593254-0x0;var _0x44f13c=_0x9a72[_0x593254];return _0x44f13c;};'use strict';var _=require(_0x29a7('0x0'));var util=require(_0x29a7('0x1'));var moment=require(_0x29a7('0x2'));var BPromise=require(_0x29a7('0x3'));var rs=require(_0x29a7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x29a7('0x5'));var logger=require(_0x29a7('0x6'))(_0x29a7('0x7'));var config=require(_0x29a7('0x8'));var jayson=require(_0x29a7('0x9'));var client=jayson['client'][_0x29a7('0xa')]({'port':0x232a});config[_0x29a7('0xb')]=_[_0x29a7('0xc')](config[_0x29a7('0xb')],{'host':_0x29a7('0xd'),'port':0x18eb});var socket=require(_0x29a7('0xe'))(new Redis(config[_0x29a7('0xb')]));require(_0x29a7('0xf'))['register'](socket);function respondWithRpcPromise(_0x2b5f95,_0x372407,_0x1db4c9){return new BPromise(function(_0x56aff3,_0x37f50d){return client[_0x29a7('0x10')](_0x2b5f95,_0x1db4c9)[_0x29a7('0x11')](function(_0x1ae88b){logger['info'](_0x29a7('0x12'),_0x372407,_0x29a7('0x13'));logger[_0x29a7('0x14')](_0x29a7('0x15'),_0x372407,'request\x20sent',JSON[_0x29a7('0x16')](_0x1ae88b));if(_0x1ae88b[_0x29a7('0x17')]){if(_0x1ae88b[_0x29a7('0x17')]['code']===0x1f4){logger[_0x29a7('0x17')](_0x29a7('0x12'),_0x372407,_0x1ae88b[_0x29a7('0x17')][_0x29a7('0x18')]);return _0x37f50d(_0x1ae88b['error'][_0x29a7('0x18')]);}logger['error']('FaxQueue,\x20%s,\x20%s',_0x372407,_0x1ae88b[_0x29a7('0x17')][_0x29a7('0x18')]);return _0x56aff3(_0x1ae88b['error'][_0x29a7('0x18')]);}else{logger[_0x29a7('0x19')]('FaxQueue,\x20%s,\x20%s',_0x372407,'request\x20sent');_0x56aff3(_0x1ae88b['result'][_0x29a7('0x18')]);}})[_0x29a7('0x1a')](function(_0x483e27){logger[_0x29a7('0x17')](_0x29a7('0x12'),_0x372407,_0x483e27);_0x37f50d(_0x483e27);});});}exports[_0x29a7('0x1b')]=function(_0x41140f){var _0xbca942=this;return new Promise(function(_0x5bb50e,_0x184381){return db[_0x29a7('0x1c')]['findAll']({'raw':_0x41140f['options']?_0x41140f[_0x29a7('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x41140f['options']?_0x41140f[_0x29a7('0x1d')][_0x29a7('0x1e')]||null:null,'attributes':_0x41140f[_0x29a7('0x1d')]?_0x41140f['options'][_0x29a7('0x1f')]||null:null,'limit':_0x41140f[_0x29a7('0x1d')]?_0x41140f[_0x29a7('0x1d')]['limit']||null:null,'include':_0x41140f[_0x29a7('0x1d')]?_0x41140f[_0x29a7('0x1d')]['include']?_[_0x29a7('0x20')](_0x41140f[_0x29a7('0x1d')][_0x29a7('0x21')],function(_0x167294){return{'model':db[_0x167294[_0x29a7('0x22')]],'as':_0x167294['as'],'attributes':_0x167294[_0x29a7('0x1f')],'include':_0x167294[_0x29a7('0x21')]?_[_0x29a7('0x20')](_0x167294[_0x29a7('0x21')],function(_0x103860){return{'model':db[_0x103860['model']],'as':_0x103860['as'],'attributes':_0x103860[_0x29a7('0x1f')],'include':_0x103860[_0x29a7('0x21')]?_[_0x29a7('0x20')](_0x103860[_0x29a7('0x21')],function(_0x361f26){return{'model':db[_0x361f26[_0x29a7('0x22')]],'as':_0x361f26['as'],'attributes':_0x361f26['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3cbd3f){logger[_0x29a7('0x19')](_0x29a7('0x1b'),_0x41140f);logger['debug']('GetFaxQueue',_0x41140f,JSON[_0x29a7('0x16')](_0x3cbd3f));_0x5bb50e(_0x3cbd3f);})[_0x29a7('0x1a')](function(_0x310dba){logger[_0x29a7('0x17')]('GetFaxQueue',_0x310dba[_0x29a7('0x18')],_0x41140f);_0x184381(_0xbca942['error'](0x1f4,_0x310dba[_0x29a7('0x18')]));});});};exports[_0x29a7('0x23')]=function(_0x409612){var _0x48af76=this;return new Promise(function(_0x29da8f,_0xf72197){return db[_0x29a7('0x1c')]['find']({'raw':_0x409612['options']?_0x409612[_0x29a7('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x409612[_0x29a7('0x1d')]?_0x409612[_0x29a7('0x1d')][_0x29a7('0x1e')]||null:null,'attributes':_0x409612['options']?_0x409612[_0x29a7('0x1d')][_0x29a7('0x1f')]||null:null,'include':_0x409612[_0x29a7('0x1d')]?_0x409612[_0x29a7('0x1d')][_0x29a7('0x21')]?_[_0x29a7('0x20')](_0x409612['options'][_0x29a7('0x21')],function(_0x3e4060){return{'model':db[_0x3e4060[_0x29a7('0x22')]],'as':_0x3e4060['as'],'attributes':_0x3e4060['attributes'],'include':_0x3e4060[_0x29a7('0x21')]?_[_0x29a7('0x20')](_0x3e4060['include'],function(_0x4eba1f){return{'model':db[_0x4eba1f['model']],'as':_0x4eba1f['as'],'attributes':_0x4eba1f[_0x29a7('0x1f')],'include':_0x4eba1f[_0x29a7('0x21')]?_[_0x29a7('0x20')](_0x4eba1f[_0x29a7('0x21')],function(_0x36ccce){return{'model':db[_0x36ccce[_0x29a7('0x22')]],'as':_0x36ccce['as'],'attributes':_0x36ccce[_0x29a7('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5b865f){logger[_0x29a7('0x19')]('ShowFaxQueue',_0x409612);logger['debug']('ShowFaxQueue',_0x409612,JSON[_0x29a7('0x16')](_0x5b865f));_0x29da8f(_0x5b865f);})[_0x29a7('0x1a')](function(_0x585457){logger[_0x29a7('0x17')](_0x29a7('0x23'),_0x585457[_0x29a7('0x18')],_0x409612);_0xf72197(_0x48af76['error'](0x1f4,_0x585457['message']));});});}; \ No newline at end of file +var _0x9844=['register','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFaxQueue','options','raw','where','attributes','include','map','model','then','info','FaxQueue','ShowFaxQueue','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x2406ac,_0x3d0777){var _0x5e6b08=function(_0x3e5bc7){while(--_0x3e5bc7){_0x2406ac['push'](_0x2406ac['shift']());}};_0x5e6b08(++_0x3d0777);}(_0x9844,0x65));var _0x4984=function(_0x33b981,_0x35fb2e){_0x33b981=_0x33b981-0x0;var _0x191c42=_0x9844[_0x33b981];return _0x191c42;};'use strict';var _=require(_0x4984('0x0'));var util=require(_0x4984('0x1'));var moment=require(_0x4984('0x2'));var BPromise=require(_0x4984('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4984('0x4'));var db=require(_0x4984('0x5'))['db'];var utils=require(_0x4984('0x6'));var logger=require(_0x4984('0x7'))(_0x4984('0x8'));var config=require(_0x4984('0x9'));var jayson=require(_0x4984('0xa'));var client=jayson[_0x4984('0xb')][_0x4984('0xc')]({'port':0x232a});config[_0x4984('0xd')]=_[_0x4984('0xe')](config['redis'],{'host':_0x4984('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4984('0xd')]));require('./faxQueue.socket')[_0x4984('0x10')](socket);function respondWithRpcPromise(_0x2c0d08,_0x55c4f2,_0x54ef31){return new BPromise(function(_0x2048f4,_0x5377c3){return client['request'](_0x2c0d08,_0x54ef31)['then'](function(_0x1835dd){logger['info'](_0x4984('0x11'),_0x55c4f2,_0x4984('0x12'));logger[_0x4984('0x13')](_0x4984('0x14'),_0x55c4f2,_0x4984('0x12'),JSON[_0x4984('0x15')](_0x1835dd));if(_0x1835dd[_0x4984('0x16')]){if(_0x1835dd['error'][_0x4984('0x17')]===0x1f4){logger[_0x4984('0x16')]('FaxQueue,\x20%s,\x20%s',_0x55c4f2,_0x1835dd[_0x4984('0x16')][_0x4984('0x18')]);return _0x5377c3(_0x1835dd[_0x4984('0x16')][_0x4984('0x18')]);}logger[_0x4984('0x16')](_0x4984('0x11'),_0x55c4f2,_0x1835dd[_0x4984('0x16')][_0x4984('0x18')]);return _0x2048f4(_0x1835dd[_0x4984('0x16')][_0x4984('0x18')]);}else{logger['info']('FaxQueue,\x20%s,\x20%s',_0x55c4f2,_0x4984('0x12'));_0x2048f4(_0x1835dd[_0x4984('0x19')][_0x4984('0x18')]);}})[_0x4984('0x1a')](function(_0x58eebe){logger[_0x4984('0x16')](_0x4984('0x11'),_0x55c4f2,_0x58eebe);_0x5377c3(_0x58eebe);});});}exports[_0x4984('0x1b')]=function(_0x344ca4){var _0x19e9ed=this;return new Promise(function(_0x51b91e,_0x2de463){return db['FaxQueue']['findAll']({'raw':_0x344ca4[_0x4984('0x1c')]?_0x344ca4['options'][_0x4984('0x1d')]===undefined?!![]:![]:!![],'where':_0x344ca4[_0x4984('0x1c')]?_0x344ca4[_0x4984('0x1c')][_0x4984('0x1e')]||null:null,'attributes':_0x344ca4[_0x4984('0x1c')]?_0x344ca4[_0x4984('0x1c')][_0x4984('0x1f')]||null:null,'limit':_0x344ca4[_0x4984('0x1c')]?_0x344ca4[_0x4984('0x1c')]['limit']||null:null,'include':_0x344ca4[_0x4984('0x1c')]?_0x344ca4[_0x4984('0x1c')][_0x4984('0x20')]?_[_0x4984('0x21')](_0x344ca4[_0x4984('0x1c')][_0x4984('0x20')],function(_0x1794a5){return{'model':db[_0x1794a5[_0x4984('0x22')]],'as':_0x1794a5['as'],'attributes':_0x1794a5[_0x4984('0x1f')],'include':_0x1794a5[_0x4984('0x20')]?_[_0x4984('0x21')](_0x1794a5['include'],function(_0x32d8ed){return{'model':db[_0x32d8ed['model']],'as':_0x32d8ed['as'],'attributes':_0x32d8ed[_0x4984('0x1f')],'include':_0x32d8ed[_0x4984('0x20')]?_[_0x4984('0x21')](_0x32d8ed[_0x4984('0x20')],function(_0x34c3a5){return{'model':db[_0x34c3a5['model']],'as':_0x34c3a5['as'],'attributes':_0x34c3a5['attributes']};}):[]};}):[]};}):[]:[]})[_0x4984('0x23')](function(_0xf2d5a9){logger[_0x4984('0x24')](_0x4984('0x1b'),_0x344ca4);logger[_0x4984('0x13')]('GetFaxQueue',_0x344ca4,JSON[_0x4984('0x15')](_0xf2d5a9));_0x51b91e(_0xf2d5a9);})['catch'](function(_0x2d9a8e){logger[_0x4984('0x16')]('GetFaxQueue',_0x2d9a8e['message'],_0x344ca4);_0x2de463(_0x19e9ed[_0x4984('0x16')](0x1f4,_0x2d9a8e['message']));});});};exports['ShowFaxQueue']=function(_0x5c5280){var _0x425ab6=this;return new Promise(function(_0x2042ef,_0x2c2996){return db[_0x4984('0x25')]['find']({'raw':_0x5c5280['options']?_0x5c5280[_0x4984('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x5c5280[_0x4984('0x1c')]?_0x5c5280[_0x4984('0x1c')][_0x4984('0x1e')]||null:null,'attributes':_0x5c5280[_0x4984('0x1c')]?_0x5c5280[_0x4984('0x1c')][_0x4984('0x1f')]||null:null,'include':_0x5c5280[_0x4984('0x1c')]?_0x5c5280['options']['include']?_[_0x4984('0x21')](_0x5c5280['options'][_0x4984('0x20')],function(_0x4a6d44){return{'model':db[_0x4a6d44[_0x4984('0x22')]],'as':_0x4a6d44['as'],'attributes':_0x4a6d44['attributes'],'include':_0x4a6d44[_0x4984('0x20')]?_[_0x4984('0x21')](_0x4a6d44['include'],function(_0x11a172){return{'model':db[_0x11a172[_0x4984('0x22')]],'as':_0x11a172['as'],'attributes':_0x11a172[_0x4984('0x1f')],'include':_0x11a172[_0x4984('0x20')]?_['map'](_0x11a172[_0x4984('0x20')],function(_0x4e789f){return{'model':db[_0x4e789f[_0x4984('0x22')]],'as':_0x4e789f['as'],'attributes':_0x4e789f[_0x4984('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x4984('0x23')](function(_0x34eadb){logger[_0x4984('0x24')](_0x4984('0x26'),_0x5c5280);logger['debug'](_0x4984('0x26'),_0x5c5280,JSON[_0x4984('0x15')](_0x34eadb));_0x2042ef(_0x34eadb);})[_0x4984('0x1a')](function(_0x173516){logger[_0x4984('0x16')](_0x4984('0x26'),_0x173516[_0x4984('0x18')],_0x5c5280);_0x2c2996(_0x425ab6[_0x4984('0x16')](0x1f4,_0x173516[_0x4984('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index dff723c..264bf02 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 _0x28e4=['update','removeListener','register','length','./faxQueue.events','save','remove'];(function(_0x55ba17,_0x2c6e87){var _0x3716b5=function(_0x2b7222){while(--_0x2b7222){_0x55ba17['push'](_0x55ba17['shift']());}};_0x3716b5(++_0x2c6e87);}(_0x28e4,0x11c));var _0x428e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x28e4[_0x3dd15e];return _0x231fd0;};'use strict';var FaxQueueEvents=require(_0x428e('0x0'));var events=[_0x428e('0x1'),_0x428e('0x2'),_0x428e('0x3')];function createListener(_0x39da09,_0x253594){return function(_0x46e41e){_0x253594['emit'](_0x39da09,_0x46e41e);};}function removeListener(_0x4b2d9b,_0x18d91d){return function(){FaxQueueEvents[_0x428e('0x4')](_0x4b2d9b,_0x18d91d);};}exports[_0x428e('0x5')]=function(_0x5052f7){for(var _0x3ab35a=0x0,_0x4cdc6f=events[_0x428e('0x6')];_0x3ab35a<_0x4cdc6f;_0x3ab35a++){var _0x5b0d72=events[_0x3ab35a];var _0x516f8c=createListener('faxQueue:'+_0x5b0d72,_0x5052f7);FaxQueueEvents['on'](_0x5b0d72,_0x516f8c);}}; \ No newline at end of file +var _0x4111=['faxQueue:','./faxQueue.events','save','remove','update','emit','removeListener','length'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x4111,0x91));var _0x1411=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4111[_0x3dd15e];return _0x231fd0;};'use strict';var FaxQueueEvents=require(_0x1411('0x0'));var events=[_0x1411('0x1'),_0x1411('0x2'),_0x1411('0x3')];function createListener(_0x5b19ab,_0x20a397){return function(_0x3a7dee){_0x20a397[_0x1411('0x4')](_0x5b19ab,_0x3a7dee);};}function removeListener(_0x4bf1cd,_0x148644){return function(){FaxQueueEvents[_0x1411('0x5')](_0x4bf1cd,_0x148644);};}exports['register']=function(_0x5c58ed){for(var _0x3d1a31=0x0,_0x13a2da=events[_0x1411('0x6')];_0x3d1a31<_0x13a2da;_0x3d1a31++){var _0xa2ef43=events[_0x3d1a31];var _0x289066=createListener(_0x1411('0x7')+_0xa2ef43,_0x5c58ed);FaxQueueEvents['on'](_0xa2ef43,_0x289066);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index b4a623e..7169d87 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 _0xf2e3=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','getAgents','create','post','/:id/users','put','update','delete','destroy','removeAgents','exports'];(function(_0x4c4569,_0x46d59d){var _0x5c8090=function(_0xfa0c47){while(--_0xfa0c47){_0x4c4569['push'](_0x4c4569['shift']());}};_0x5c8090(++_0x46d59d);}(_0xf2e3,0x9b));var _0x3f2e=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xf2e3[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require(_0x3f2e('0x0'));var util=require('util');var path=require(_0x3f2e('0x1'));var timeout=require(_0x3f2e('0x2'));var express=require(_0x3f2e('0x3'));var router=express[_0x3f2e('0x4')]();var fs_extra=require(_0x3f2e('0x5'));var auth=require(_0x3f2e('0x6'));var interaction=require(_0x3f2e('0x7'));var config=require(_0x3f2e('0x8'));var controller=require(_0x3f2e('0x9'));router['get']('/',auth[_0x3f2e('0xa')](),controller[_0x3f2e('0xb')]);router[_0x3f2e('0xc')](_0x3f2e('0xd'),auth[_0x3f2e('0xa')](),controller[_0x3f2e('0xe')]);router[_0x3f2e('0xc')](_0x3f2e('0xf'),auth[_0x3f2e('0xa')](),controller[_0x3f2e('0x10')]);router[_0x3f2e('0xc')](_0x3f2e('0x11'),auth[_0x3f2e('0xa')](),controller[_0x3f2e('0x12')]);router[_0x3f2e('0xc')](_0x3f2e('0x13'),auth[_0x3f2e('0xa')](),controller[_0x3f2e('0x14')]);router[_0x3f2e('0xc')]('/:id/users',auth[_0x3f2e('0xa')](),controller[_0x3f2e('0x15')]);router['post']('/',auth[_0x3f2e('0xa')](),controller[_0x3f2e('0x16')]);router[_0x3f2e('0x17')](_0x3f2e('0x13'),auth[_0x3f2e('0xa')](),controller['addTeams']);router[_0x3f2e('0x17')](_0x3f2e('0x18'),auth[_0x3f2e('0xa')](),controller['addAgents']);router[_0x3f2e('0x19')](_0x3f2e('0xf'),auth[_0x3f2e('0xa')](),controller[_0x3f2e('0x1a')]);router[_0x3f2e('0x1b')](_0x3f2e('0xf'),auth[_0x3f2e('0xa')](),controller[_0x3f2e('0x1c')]);router[_0x3f2e('0x1b')](_0x3f2e('0x13'),auth[_0x3f2e('0xa')](),controller['removeTeams']);router[_0x3f2e('0x1b')](_0x3f2e('0x18'),auth[_0x3f2e('0xa')](),controller[_0x3f2e('0x1d')]);module[_0x3f2e('0x1e')]=router; \ No newline at end of file +var _0x7278=['../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','/describe','describe','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','addTeams','post','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x52f3c9,_0x113cd7){var _0x233dab=function(_0x117cfb){while(--_0x117cfb){_0x52f3c9['push'](_0x52f3c9['shift']());}};_0x233dab(++_0x113cd7);}(_0x7278,0x161));var _0x8727=function(_0xb4904c,_0x5b457d){_0xb4904c=_0xb4904c-0x0;var _0xea246f=_0x7278[_0xb4904c];return _0xea246f;};'use strict';var multer=require(_0x8727('0x0'));var util=require(_0x8727('0x1'));var path=require(_0x8727('0x2'));var timeout=require(_0x8727('0x3'));var express=require(_0x8727('0x4'));var router=express['Router']();var fs_extra=require(_0x8727('0x5'));var auth=require(_0x8727('0x6'));var interaction=require(_0x8727('0x7'));var config=require(_0x8727('0x8'));var controller=require(_0x8727('0x9'));router[_0x8727('0xa')]('/',auth[_0x8727('0xb')](),controller['index']);router[_0x8727('0xa')](_0x8727('0xc'),auth[_0x8727('0xb')](),controller[_0x8727('0xd')]);router[_0x8727('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x8727('0xa')](_0x8727('0xe'),auth[_0x8727('0xb')](),controller[_0x8727('0xf')]);router[_0x8727('0xa')](_0x8727('0x10'),auth[_0x8727('0xb')](),controller[_0x8727('0x11')]);router['get'](_0x8727('0x12'),auth[_0x8727('0xb')](),controller[_0x8727('0x13')]);router['post']('/',auth[_0x8727('0xb')](),controller[_0x8727('0x14')]);router['post'](_0x8727('0x10'),auth[_0x8727('0xb')](),controller[_0x8727('0x15')]);router[_0x8727('0x16')](_0x8727('0x12'),auth[_0x8727('0xb')](),controller[_0x8727('0x17')]);router[_0x8727('0x18')](_0x8727('0x19'),auth[_0x8727('0xb')](),controller['update']);router[_0x8727('0x1a')](_0x8727('0x19'),auth[_0x8727('0xb')](),controller[_0x8727('0x1b')]);router[_0x8727('0x1a')](_0x8727('0x10'),auth['isAuthenticated'](),controller['removeTeams']);router[_0x8727('0x1a')]('/:id/users',auth[_0x8727('0xb')](),controller[_0x8727('0x1c')]);module[_0x8727('0x1d')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index b1e7cb9..25fcfc1 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 _0xde1d=['DATE','sequelize','exports','STRING'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xde1d,0x109));var _0xdde1=function(_0x99c2dd,_0x1d32eb){_0x99c2dd=_0x99c2dd-0x0;var _0x173349=_0xde1d[_0x99c2dd];return _0x173349;};'use strict';var moment=require('moment');var Sequelize=require(_0xdde1('0x0'));module[_0xdde1('0x1')]={'uniqueid':{'type':Sequelize[_0xdde1('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xdde1('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xdde1('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xdde1('0x3')]},'reason':{'type':Sequelize[_0xdde1('0x2')]}}; \ No newline at end of file +var _0x29d4=['DATE','moment','exports','STRING'];(function(_0x4d0662,_0x145963){var _0x6eea6d=function(_0x2def06){while(--_0x2def06){_0x4d0662['push'](_0x4d0662['shift']());}};_0x6eea6d(++_0x145963);}(_0x29d4,0x1a1));var _0x429d=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0x29d4[_0x4b7b62];return _0x2280df;};'use strict';var moment=require(_0x429d('0x0'));var Sequelize=require('sequelize');module[_0x429d('0x1')]={'uniqueid':{'type':Sequelize[_0x429d('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x429d('0x2')]},'joinAt':{'type':Sequelize[_0x429d('0x3')]},'leaveAt':{'type':Sequelize[_0x429d('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x429d('0x3')]},'reason':{'type':Sequelize[_0x429d('0x2')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index a9301c8..f8610bf 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 _0x4876=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','stack','send','index','map','rawAttributes','type','key','model','name','query','keys','filters','fields','attributes','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','FaxQueueReport','findAll','rows','catch','show','params','intersection','length','find','create','body','destroy','describe','zip-dir','moment','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x1bd213,_0x156b25){var _0xb72a1a=function(_0x48a4a7){while(--_0x48a4a7){_0x1bd213['push'](_0x1bd213['shift']());}};_0xb72a1a(++_0x156b25);}(_0x4876,0x84));var _0x6487=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4876[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6487('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6487('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x6487('0x2'));var util=require(_0x6487('0x3'));var path=require(_0x6487('0x4'));var sox=require(_0x6487('0x5'));var csv=require('to-csv');var ejs=require(_0x6487('0x6'));var fs=require('fs');var fs_extra=require(_0x6487('0x7'));var _=require('lodash');var squel=require(_0x6487('0x8'));var crypto=require(_0x6487('0x9'));var jsforce=require(_0x6487('0xa'));var deskjs=require(_0x6487('0xb'));var toCsv=require(_0x6487('0xc'));var querystring=require(_0x6487('0xd'));var Papa=require(_0x6487('0xe'));var Redis=require(_0x6487('0xf'));var authService=require(_0x6487('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x6487('0x11'));var hardwareService=require(_0x6487('0x12'));var logger=require(_0x6487('0x13'))(_0x6487('0x14'));var utils=require(_0x6487('0x15'));var config=require(_0x6487('0x16'));var licenseUtil=require(_0x6487('0x17'));var db=require(_0x6487('0x18'))['db'];function respondWithStatusCode(_0x48e266,_0x30227d){_0x30227d=_0x30227d||0xcc;return function(_0x22596a){if(_0x22596a){return _0x48e266[_0x6487('0x19')](_0x30227d);}return _0x48e266[_0x6487('0x1a')](_0x30227d)['end']();};}function respondWithResult(_0x40a352,_0x10f2e1){_0x10f2e1=_0x10f2e1||0xc8;return function(_0x1ac263){if(_0x1ac263){return _0x40a352[_0x6487('0x1a')](_0x10f2e1)['json'](_0x1ac263);}};}function respondWithFilteredResult(_0x522154,_0x1dde46){return function(_0x552f2d){if(_0x552f2d){var _0x2fdfc3=typeof _0x1dde46['offset']===_0x6487('0x1b')&&typeof _0x1dde46[_0x6487('0x1c')]===_0x6487('0x1b');var _0x26b2f2=_0x552f2d[_0x6487('0x1d')];var _0x59514e=_0x2fdfc3?0x0:_0x1dde46['offset'];var _0x5afb4a=_0x2fdfc3?_0x552f2d[_0x6487('0x1d')]:_0x1dde46[_0x6487('0x1e')]+_0x1dde46[_0x6487('0x1c')];var _0x424ae2;if(_0x5afb4a>=_0x26b2f2){_0x5afb4a=_0x26b2f2;_0x424ae2=0xc8;}else{_0x424ae2=0xce;}_0x522154[_0x6487('0x1a')](_0x424ae2);return _0x522154[_0x6487('0x1f')](_0x6487('0x20'),_0x59514e+'-'+_0x5afb4a+'/'+_0x26b2f2)[_0x6487('0x21')](_0x552f2d);}return null;};}function patchUpdates(_0x1b99ef){return function(_0x30ed2e){try{jsonpatch[_0x6487('0x22')](_0x30ed2e,_0x1b99ef,!![]);}catch(_0x2827a3){return BPromise[_0x6487('0x23')](_0x2827a3);}return _0x30ed2e[_0x6487('0x24')]();};}function saveUpdates(_0x21b8e8,_0x21050d){return function(_0x3affe7){if(_0x3affe7){return _0x3affe7[_0x6487('0x25')](_0x21b8e8)[_0x6487('0x26')](function(_0x4d06b2){return _0x4d06b2;});}return null;};}function removeEntity(_0x58d269,_0x234485){return function(_0x4e8ec8){if(_0x4e8ec8){return _0x4e8ec8['destroy']()[_0x6487('0x26')](function(){_0x58d269[_0x6487('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x116995,_0x38ac56){return function(_0x2f4190){if(!_0x2f4190){_0x116995[_0x6487('0x19')](0x194);}return _0x2f4190;};}function handleError(_0x392e60,_0x5439f7){_0x5439f7=_0x5439f7||0x1f4;return function(_0x44bb48){logger['error'](_0x44bb48[_0x6487('0x27')]);if(_0x44bb48['name']){delete _0x44bb48['name'];}_0x392e60[_0x6487('0x1a')](_0x5439f7)[_0x6487('0x28')](_0x44bb48);};}exports[_0x6487('0x29')]=function(_0x4c424a,_0x39581d){var _0x3c4411={},_0x33085b={},_0x63ddc7={'count':0x0,'rows':[]};var _0x35b089=_[_0x6487('0x2a')](db['FaxQueueReport'][_0x6487('0x2b')],function(_0x270e6e){return{'name':_0x270e6e['fieldName'],'type':_0x270e6e[_0x6487('0x2c')][_0x6487('0x2d')]};});_0x33085b[_0x6487('0x2e')]=_[_0x6487('0x2a')](_0x35b089,_0x6487('0x2f'));_0x33085b[_0x6487('0x30')]=_[_0x6487('0x31')](_0x4c424a['query']);_0x33085b[_0x6487('0x32')]=_['intersection'](_0x33085b[_0x6487('0x2e')],_0x33085b['query']);_0x3c4411['attributes']=_['intersection'](_0x33085b['model'],qs[_0x6487('0x33')](_0x4c424a[_0x6487('0x30')][_0x6487('0x33')]));_0x3c4411['attributes']=_0x3c4411[_0x6487('0x34')]['length']?_0x3c4411[_0x6487('0x34')]:_0x33085b[_0x6487('0x2e')];if(!_0x4c424a[_0x6487('0x30')][_0x6487('0x35')](_0x6487('0x36'))){_0x3c4411['limit']=qs[_0x6487('0x1c')](_0x4c424a['query'][_0x6487('0x1c')]);_0x3c4411[_0x6487('0x1e')]=qs[_0x6487('0x1e')](_0x4c424a[_0x6487('0x30')]['offset']);}_0x3c4411[_0x6487('0x37')]=qs[_0x6487('0x38')](_0x4c424a[_0x6487('0x30')]['sort']);_0x3c4411['where']=qs[_0x6487('0x32')](_['pick'](_0x4c424a[_0x6487('0x30')],_0x33085b[_0x6487('0x32')]),_0x35b089);if(_0x4c424a[_0x6487('0x30')]['filter']){_0x3c4411[_0x6487('0x39')]=_[_0x6487('0x3a')](_0x3c4411[_0x6487('0x39')],{'$or':_[_0x6487('0x2a')](_0x35b089,function(_0x2e532d){if(_0x2e532d[_0x6487('0x2c')]!==_0x6487('0x3b')){var _0x538293={};_0x538293[_0x2e532d[_0x6487('0x2f')]]={'$like':'%'+_0x4c424a[_0x6487('0x30')][_0x6487('0x3c')]+'%'};return _0x538293;}})});}_0x3c4411=_['merge']({},_0x3c4411,_0x4c424a[_0x6487('0x3d')]);var _0x4de8c8={'where':_0x3c4411[_0x6487('0x39')]};return db['FaxQueueReport'][_0x6487('0x1d')](_0x4de8c8)['then'](function(_0x44e2e9){_0x63ddc7[_0x6487('0x1d')]=_0x44e2e9;if(_0x4c424a[_0x6487('0x30')][_0x6487('0x3e')]){_0x3c4411[_0x6487('0x3f')]=[{'all':!![]}];}return db[_0x6487('0x40')][_0x6487('0x41')](_0x3c4411);})[_0x6487('0x26')](function(_0x47b3bb){_0x63ddc7[_0x6487('0x42')]=_0x47b3bb;return _0x63ddc7;})[_0x6487('0x26')](respondWithFilteredResult(_0x39581d,_0x3c4411))[_0x6487('0x43')](handleError(_0x39581d,null));};exports[_0x6487('0x44')]=function(_0x3598c4,_0x12f7f5){var _0x594b42={'raw':!![],'where':{'id':_0x3598c4[_0x6487('0x45')]['id']}},_0x56452e={};_0x56452e['model']=_[_0x6487('0x31')](db[_0x6487('0x40')][_0x6487('0x2b')]);_0x56452e[_0x6487('0x30')]=_[_0x6487('0x31')](_0x3598c4[_0x6487('0x30')]);_0x56452e[_0x6487('0x32')]=_[_0x6487('0x46')](_0x56452e[_0x6487('0x2e')],_0x56452e['query']);_0x594b42[_0x6487('0x34')]=_[_0x6487('0x46')](_0x56452e[_0x6487('0x2e')],qs['fields'](_0x3598c4['query'][_0x6487('0x33')]));_0x594b42[_0x6487('0x34')]=_0x594b42[_0x6487('0x34')][_0x6487('0x47')]?_0x594b42[_0x6487('0x34')]:_0x56452e[_0x6487('0x2e')];if(_0x3598c4['query'][_0x6487('0x3e')]){_0x594b42['include']=[{'all':!![]}];}_0x594b42=_[_0x6487('0x3a')]({},_0x594b42,_0x3598c4[_0x6487('0x3d')]);return db[_0x6487('0x40')][_0x6487('0x48')](_0x594b42)[_0x6487('0x26')](handleEntityNotFound(_0x12f7f5,null))[_0x6487('0x26')](respondWithResult(_0x12f7f5,null))[_0x6487('0x43')](handleError(_0x12f7f5,null));};exports[_0x6487('0x49')]=function(_0x2f6b86,_0x1e8ae7){return db[_0x6487('0x40')][_0x6487('0x49')](_0x2f6b86['body'],{})[_0x6487('0x26')](respondWithResult(_0x1e8ae7,0xc9))['catch'](handleError(_0x1e8ae7,null));};exports[_0x6487('0x25')]=function(_0x2c4272,_0x46c3dd){if(_0x2c4272[_0x6487('0x4a')]['id']){delete _0x2c4272[_0x6487('0x4a')]['id'];}return db[_0x6487('0x40')][_0x6487('0x48')]({'where':{'id':_0x2c4272[_0x6487('0x45')]['id']}})[_0x6487('0x26')](handleEntityNotFound(_0x46c3dd,null))[_0x6487('0x26')](saveUpdates(_0x2c4272[_0x6487('0x4a')],null))[_0x6487('0x26')](respondWithResult(_0x46c3dd,null))[_0x6487('0x43')](handleError(_0x46c3dd,null));};exports[_0x6487('0x4b')]=function(_0x2a7715,_0x2dde3c){return db[_0x6487('0x40')][_0x6487('0x48')]({'where':{'id':_0x2a7715[_0x6487('0x45')]['id']}})['then'](handleEntityNotFound(_0x2dde3c,null))[_0x6487('0x26')](removeEntity(_0x2dde3c,null))[_0x6487('0x43')](handleError(_0x2dde3c,null));};exports['describe']=function(_0x39f822,_0x38a94b){return db[_0x6487('0x40')][_0x6487('0x4c')]()['then'](respondWithResult(_0x38a94b,null))[_0x6487('0x43')](handleError(_0x38a94b,null));}; \ No newline at end of file +var _0x668b=['order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','catch','show','params','create','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','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','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','update','destroy','then','error','stack','name','send','map','FaxQueueReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x2c1dcd,_0x350452){var _0x158ce5=function(_0x5c1c57){while(--_0x5c1c57){_0x2c1dcd['push'](_0x2c1dcd['shift']());}};_0x158ce5(++_0x350452);}(_0x668b,0x140));var _0xb668=function(_0x1c510a,_0x1413a9){_0x1c510a=_0x1c510a-0x0;var _0x23cedd=_0x668b[_0x1c510a];return _0x23cedd;};'use strict';var emlformat=require(_0xb668('0x0'));var rimraf=require(_0xb668('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb668('0x2'));var rp=require(_0xb668('0x3'));var moment=require('moment');var BPromise=require(_0xb668('0x4'));var Mustache=require('mustache');var util=require(_0xb668('0x5'));var path=require(_0xb668('0x6'));var sox=require(_0xb668('0x7'));var csv=require('to-csv');var ejs=require(_0xb668('0x8'));var fs=require('fs');var fs_extra=require(_0xb668('0x9'));var _=require(_0xb668('0xa'));var squel=require(_0xb668('0xb'));var crypto=require(_0xb668('0xc'));var jsforce=require(_0xb668('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb668('0xe'));var querystring=require(_0xb668('0xf'));var Papa=require(_0xb668('0x10'));var Redis=require(_0xb668('0x11'));var authService=require(_0xb668('0x12'));var qs=require(_0xb668('0x13'));var as=require(_0xb668('0x14'));var hardwareService=require(_0xb668('0x15'));var logger=require('../../config/logger')(_0xb668('0x16'));var utils=require(_0xb668('0x17'));var config=require(_0xb668('0x18'));var licenseUtil=require(_0xb668('0x19'));var db=require(_0xb668('0x1a'))['db'];function respondWithStatusCode(_0x167057,_0x1d111a){_0x1d111a=_0x1d111a||0xcc;return function(_0x10ed24){if(_0x10ed24){return _0x167057[_0xb668('0x1b')](_0x1d111a);}return _0x167057[_0xb668('0x1c')](_0x1d111a)[_0xb668('0x1d')]();};}function respondWithResult(_0x3b7556,_0x3aed25){_0x3aed25=_0x3aed25||0xc8;return function(_0xd0450f){if(_0xd0450f){return _0x3b7556[_0xb668('0x1c')](_0x3aed25)[_0xb668('0x1e')](_0xd0450f);}};}function respondWithFilteredResult(_0x1ca6e7,_0x222cad){return function(_0x4fa32a){if(_0x4fa32a){var _0x4a755b=typeof _0x222cad[_0xb668('0x1f')]===_0xb668('0x20')&&typeof _0x222cad['limit']===_0xb668('0x20');var _0x567ad7=_0x4fa32a[_0xb668('0x21')];var _0x89fe72=_0x4a755b?0x0:_0x222cad['offset'];var _0x38595d=_0x4a755b?_0x4fa32a[_0xb668('0x21')]:_0x222cad['offset']+_0x222cad[_0xb668('0x22')];var _0x5b31ab;if(_0x38595d>=_0x567ad7){_0x38595d=_0x567ad7;_0x5b31ab=0xc8;}else{_0x5b31ab=0xce;}_0x1ca6e7[_0xb668('0x1c')](_0x5b31ab);return _0x1ca6e7[_0xb668('0x23')](_0xb668('0x24'),_0x89fe72+'-'+_0x38595d+'/'+_0x567ad7)[_0xb668('0x1e')](_0x4fa32a);}return null;};}function patchUpdates(_0x5d33ae){return function(_0x2b7f96){try{jsonpatch[_0xb668('0x25')](_0x2b7f96,_0x5d33ae,!![]);}catch(_0x25e5be){return BPromise['reject'](_0x25e5be);}return _0x2b7f96['save']();};}function saveUpdates(_0x43a70b,_0x1e5620){return function(_0x517eee){if(_0x517eee){return _0x517eee[_0xb668('0x26')](_0x43a70b)['then'](function(_0x2f1394){return _0x2f1394;});}return null;};}function removeEntity(_0x4bd365,_0x3f4745){return function(_0x1e1c94){if(_0x1e1c94){return _0x1e1c94[_0xb668('0x27')]()[_0xb668('0x28')](function(){_0x4bd365[_0xb668('0x1c')](0xcc)[_0xb668('0x1d')]();});}};}function handleEntityNotFound(_0x4d4bf8,_0x23084d){return function(_0x10d767){if(!_0x10d767){_0x4d4bf8[_0xb668('0x1b')](0x194);}return _0x10d767;};}function handleError(_0x49abfd,_0x5e0cee){_0x5e0cee=_0x5e0cee||0x1f4;return function(_0xe62fce){logger[_0xb668('0x29')](_0xe62fce[_0xb668('0x2a')]);if(_0xe62fce['name']){delete _0xe62fce[_0xb668('0x2b')];}_0x49abfd[_0xb668('0x1c')](_0x5e0cee)[_0xb668('0x2c')](_0xe62fce);};}exports['index']=function(_0x5709e2,_0x12919c){var _0x2619a4={},_0x589c58={},_0x2e5857={'count':0x0,'rows':[]};var _0x1791ff=_[_0xb668('0x2d')](db[_0xb668('0x2e')][_0xb668('0x2f')],function(_0x5f36b5){return{'name':_0x5f36b5[_0xb668('0x30')],'type':_0x5f36b5[_0xb668('0x31')]['key']};});_0x589c58[_0xb668('0x32')]=_['map'](_0x1791ff,_0xb668('0x2b'));_0x589c58[_0xb668('0x33')]=_[_0xb668('0x34')](_0x5709e2[_0xb668('0x33')]);_0x589c58[_0xb668('0x35')]=_[_0xb668('0x36')](_0x589c58[_0xb668('0x32')],_0x589c58[_0xb668('0x33')]);_0x2619a4[_0xb668('0x37')]=_['intersection'](_0x589c58[_0xb668('0x32')],qs[_0xb668('0x38')](_0x5709e2[_0xb668('0x33')]['fields']));_0x2619a4[_0xb668('0x37')]=_0x2619a4[_0xb668('0x37')][_0xb668('0x39')]?_0x2619a4[_0xb668('0x37')]:_0x589c58['model'];if(!_0x5709e2[_0xb668('0x33')][_0xb668('0x3a')](_0xb668('0x3b'))){_0x2619a4[_0xb668('0x22')]=qs[_0xb668('0x22')](_0x5709e2[_0xb668('0x33')][_0xb668('0x22')]);_0x2619a4['offset']=qs[_0xb668('0x1f')](_0x5709e2[_0xb668('0x33')]['offset']);}_0x2619a4[_0xb668('0x3c')]=qs['sort'](_0x5709e2['query'][_0xb668('0x3d')]);_0x2619a4[_0xb668('0x3e')]=qs['filters'](_[_0xb668('0x3f')](_0x5709e2['query'],_0x589c58[_0xb668('0x35')]),_0x1791ff);if(_0x5709e2['query']['filter']){_0x2619a4[_0xb668('0x3e')]=_[_0xb668('0x40')](_0x2619a4['where'],{'$or':_['map'](_0x1791ff,function(_0x218c1c){if(_0x218c1c[_0xb668('0x31')]!==_0xb668('0x41')){var _0x187f4d={};_0x187f4d[_0x218c1c[_0xb668('0x2b')]]={'$like':'%'+_0x5709e2['query']['filter']+'%'};return _0x187f4d;}})});}_0x2619a4=_[_0xb668('0x40')]({},_0x2619a4,_0x5709e2[_0xb668('0x42')]);var _0xcdf6a8={'where':_0x2619a4[_0xb668('0x3e')]};return db[_0xb668('0x2e')][_0xb668('0x21')](_0xcdf6a8)['then'](function(_0x51a482){_0x2e5857[_0xb668('0x21')]=_0x51a482;if(_0x5709e2[_0xb668('0x33')][_0xb668('0x43')]){_0x2619a4[_0xb668('0x44')]=[{'all':!![]}];}return db[_0xb668('0x2e')]['findAll'](_0x2619a4);})[_0xb668('0x28')](function(_0x429b14){_0x2e5857['rows']=_0x429b14;return _0x2e5857;})[_0xb668('0x28')](respondWithFilteredResult(_0x12919c,_0x2619a4))[_0xb668('0x45')](handleError(_0x12919c,null));};exports[_0xb668('0x46')]=function(_0x54353,_0x5273e8){var _0x583a61={'raw':!![],'where':{'id':_0x54353[_0xb668('0x47')]['id']}},_0x4b7192={};_0x4b7192['model']=_['keys'](db['FaxQueueReport']['rawAttributes']);_0x4b7192[_0xb668('0x33')]=_['keys'](_0x54353[_0xb668('0x33')]);_0x4b7192[_0xb668('0x35')]=_[_0xb668('0x36')](_0x4b7192[_0xb668('0x32')],_0x4b7192[_0xb668('0x33')]);_0x583a61['attributes']=_[_0xb668('0x36')](_0x4b7192[_0xb668('0x32')],qs[_0xb668('0x38')](_0x54353[_0xb668('0x33')][_0xb668('0x38')]));_0x583a61[_0xb668('0x37')]=_0x583a61[_0xb668('0x37')][_0xb668('0x39')]?_0x583a61[_0xb668('0x37')]:_0x4b7192[_0xb668('0x32')];if(_0x54353[_0xb668('0x33')]['includeAll']){_0x583a61[_0xb668('0x44')]=[{'all':!![]}];}_0x583a61=_[_0xb668('0x40')]({},_0x583a61,_0x54353[_0xb668('0x42')]);return db['FaxQueueReport']['find'](_0x583a61)[_0xb668('0x28')](handleEntityNotFound(_0x5273e8,null))['then'](respondWithResult(_0x5273e8,null))[_0xb668('0x45')](handleError(_0x5273e8,null));};exports['create']=function(_0x55a656,_0x4e2853){return db[_0xb668('0x2e')][_0xb668('0x48')](_0x55a656['body'],{})[_0xb668('0x28')](respondWithResult(_0x4e2853,0xc9))[_0xb668('0x45')](handleError(_0x4e2853,null));};exports[_0xb668('0x26')]=function(_0x1b649f,_0x16d06f){if(_0x1b649f[_0xb668('0x49')]['id']){delete _0x1b649f[_0xb668('0x49')]['id'];}return db[_0xb668('0x2e')][_0xb668('0x4a')]({'where':{'id':_0x1b649f[_0xb668('0x47')]['id']}})['then'](handleEntityNotFound(_0x16d06f,null))[_0xb668('0x28')](saveUpdates(_0x1b649f[_0xb668('0x49')],null))[_0xb668('0x28')](respondWithResult(_0x16d06f,null))[_0xb668('0x45')](handleError(_0x16d06f,null));};exports[_0xb668('0x27')]=function(_0x3da9ba,_0x381694){return db[_0xb668('0x2e')][_0xb668('0x4a')]({'where':{'id':_0x3da9ba['params']['id']}})[_0xb668('0x28')](handleEntityNotFound(_0x381694,null))[_0xb668('0x28')](removeEntity(_0x381694,null))[_0xb668('0x45')](handleError(_0x381694,null));};exports['describe']=function(_0x5c4e1a,_0x25c2a0){return db[_0xb668('0x2e')][_0xb668('0x4b')]()['then'](respondWithResult(_0x25c2a0,null))[_0xb668('0x45')](handleError(_0x25c2a0,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index bb13bf5..81873f2 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 _0x7fbe=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','uniqueid','../../config/logger','api'];(function(_0x30e9a0,_0x3c5afc){var _0x5b329f=function(_0x52b030){while(--_0x52b030){_0x30e9a0['push'](_0x30e9a0['shift']());}};_0x5b329f(++_0x3c5afc);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x4c1eec,_0x515aa1){_0x4c1eec=_0x4c1eec-0x0;var _0x5d8475=_0x7fbe[_0x4c1eec];return _0x5d8475;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe7fb('0x0'))(_0xe7fb('0x1'));var moment=require(_0xe7fb('0x2'));var BPromise=require(_0xe7fb('0x3'));var rp=require(_0xe7fb('0x4'));var fs=require('fs');var path=require(_0xe7fb('0x5'));var rimraf=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var attributes=require(_0xe7fb('0x8'));module[_0xe7fb('0x9')]=function(_0x290172,_0x12d1b0){return _0x290172[_0xe7fb('0xa')](_0xe7fb('0xb'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0xe7fb('0xc'),'fields':[_0xe7fb('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x53ec=['path','../../config/environment','./faxQueueReport.attributes','define','FaxQueueReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x270318,_0x352543){var _0x4976e7=function(_0x40de08){while(--_0x40de08){_0x270318['push'](_0x270318['shift']());}};_0x4976e7(++_0x352543);}(_0x53ec,0x192));var _0xc53e=function(_0x1dd82f,_0x52acb7){_0x1dd82f=_0x1dd82f-0x0;var _0x353ca4=_0x53ec[_0x1dd82f];return _0x353ca4;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var logger=require(_0xc53e('0x2'))(_0xc53e('0x3'));var moment=require(_0xc53e('0x4'));var BPromise=require(_0xc53e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc53e('0x6'));var rimraf=require('rimraf');var config=require(_0xc53e('0x7'));var attributes=require(_0xc53e('0x8'));module['exports']=function(_0x2f1414,_0x4f989b){return _0x2f1414[_0xc53e('0x9')](_0xc53e('0xa'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0xc53e('0xb'),'fields':[_0xc53e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index ddc0ea0..3d0cce2 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 _0xb301=['UpdateFaxQueueReport','moment','bluebird','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateFaxQueueReport','FaxQueueReport','create','body','options','raw','catch','update','where','attributes','limit'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0xb301,0xf9));var _0x1b30=function(_0x437f59,_0x353271){_0x437f59=_0x437f59-0x0;var _0x1e50d4=_0xb301[_0x437f59];return _0x1e50d4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1b30('0x0'));var BPromise=require(_0x1b30('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1b30('0x2'))['db'];var utils=require(_0x1b30('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x1b30('0x4'));var jayson=require(_0x1b30('0x5'));var client=jayson[_0x1b30('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x12f85b,_0x55a851,_0x329d99){return new BPromise(function(_0x5c8309,_0x3496ec){return client[_0x1b30('0x7')](_0x12f85b,_0x329d99)[_0x1b30('0x8')](function(_0x57f20d){logger[_0x1b30('0x9')](_0x1b30('0xa'),_0x55a851,_0x1b30('0xb'));logger[_0x1b30('0xc')](_0x1b30('0xd'),_0x55a851,_0x1b30('0xb'),JSON[_0x1b30('0xe')](_0x57f20d));if(_0x57f20d[_0x1b30('0xf')]){if(_0x57f20d[_0x1b30('0xf')][_0x1b30('0x10')]===0x1f4){logger[_0x1b30('0xf')](_0x1b30('0xa'),_0x55a851,_0x57f20d[_0x1b30('0xf')][_0x1b30('0x11')]);return _0x3496ec(_0x57f20d[_0x1b30('0xf')]['message']);}logger['error'](_0x1b30('0xa'),_0x55a851,_0x57f20d[_0x1b30('0xf')]['message']);return _0x5c8309(_0x57f20d[_0x1b30('0xf')][_0x1b30('0x11')]);}else{logger[_0x1b30('0x9')](_0x1b30('0xa'),_0x55a851,_0x1b30('0xb'));_0x5c8309(_0x57f20d[_0x1b30('0x12')][_0x1b30('0x11')]);}})['catch'](function(_0x45a2f5){logger[_0x1b30('0xf')]('FaxQueueReport,\x20%s,\x20%s',_0x55a851,_0x45a2f5);_0x3496ec(_0x45a2f5);});});}exports[_0x1b30('0x13')]=function(_0x2f5f64){var _0x47b5e8=this;return new Promise(function(_0x3d8f15,_0x5d738f){return db[_0x1b30('0x14')][_0x1b30('0x15')](_0x2f5f64[_0x1b30('0x16')],{'raw':_0x2f5f64['options']?_0x2f5f64[_0x1b30('0x17')][_0x1b30('0x18')]===undefined?!![]:![]:!![]})[_0x1b30('0x8')](function(_0x19b5c5){logger[_0x1b30('0x9')](_0x1b30('0x13'),_0x2f5f64);logger[_0x1b30('0xc')](_0x1b30('0x13'),_0x2f5f64,JSON[_0x1b30('0xe')](_0x19b5c5));_0x3d8f15(_0x19b5c5);})[_0x1b30('0x19')](function(_0x2d0168){logger[_0x1b30('0xf')](_0x1b30('0x13'),_0x2d0168[_0x1b30('0x11')],_0x2f5f64);_0x5d738f(_0x47b5e8[_0x1b30('0xf')](0x1f4,_0x2d0168[_0x1b30('0x11')]));});});};exports['UpdateFaxQueueReport']=function(_0x22ed61){var _0x11e02c=this;return new Promise(function(_0x2735b4,_0x230358){return db[_0x1b30('0x14')][_0x1b30('0x1a')](_0x22ed61[_0x1b30('0x16')],{'raw':_0x22ed61['options']?_0x22ed61[_0x1b30('0x17')][_0x1b30('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x22ed61['options']?_0x22ed61[_0x1b30('0x17')][_0x1b30('0x1b')]||null:null,'attributes':_0x22ed61['options']?_0x22ed61['options'][_0x1b30('0x1c')]||null:null,'limit':_0x22ed61[_0x1b30('0x17')]?_0x22ed61[_0x1b30('0x17')][_0x1b30('0x1d')]||null:null})[_0x1b30('0x8')](function(_0x5e1a37){logger[_0x1b30('0x9')]('UpdateFaxQueueReport',_0x22ed61);logger[_0x1b30('0xc')](_0x1b30('0x1e'),_0x22ed61,JSON[_0x1b30('0xe')](_0x5e1a37));_0x2735b4(_0x5e1a37);})['catch'](function(_0x22d2d1){logger['error']('UpdateFaxQueueReport',_0x22d2d1[_0x1b30('0x11')],_0x22ed61);_0x230358(_0x11e02c[_0x1b30('0xf')](0x1f4,_0x22d2d1['message']));});});}; \ No newline at end of file +var _0xa57e=['info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','FaxQueueReport','body','options','raw','then','CreateFaxQueueReport','stringify','catch','UpdateFaxQueueReport','update','where','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x498ce6,_0x5f4767){var _0x4b24aa=function(_0xc3d88d){while(--_0xc3d88d){_0x498ce6['push'](_0x498ce6['shift']());}};_0x4b24aa(++_0x5f4767);}(_0xa57e,0x1f2));var _0xea57=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa57e[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require(_0xea57('0x0'));var moment=require(_0xea57('0x1'));var BPromise=require(_0xea57('0x2'));var rs=require(_0xea57('0x3'));var fs=require('fs');var Redis=require(_0xea57('0x4'));var db=require(_0xea57('0x5'))['db'];var utils=require(_0xea57('0x6'));var logger=require(_0xea57('0x7'))(_0xea57('0x8'));var config=require(_0xea57('0x9'));var jayson=require(_0xea57('0xa'));var client=jayson[_0xea57('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c767f,_0x4947b5,_0x348cc2){return new BPromise(function(_0x3c706f,_0x226429){return client['request'](_0x4c767f,_0x348cc2)['then'](function(_0x2006d5){logger[_0xea57('0xc')](_0xea57('0xd'),_0x4947b5,_0xea57('0xe'));logger[_0xea57('0xf')](_0xea57('0x10'),_0x4947b5,_0xea57('0xe'),JSON['stringify'](_0x2006d5));if(_0x2006d5['error']){if(_0x2006d5[_0xea57('0x11')][_0xea57('0x12')]===0x1f4){logger[_0xea57('0x11')](_0xea57('0xd'),_0x4947b5,_0x2006d5[_0xea57('0x11')][_0xea57('0x13')]);return _0x226429(_0x2006d5[_0xea57('0x11')][_0xea57('0x13')]);}logger[_0xea57('0x11')](_0xea57('0xd'),_0x4947b5,_0x2006d5[_0xea57('0x11')][_0xea57('0x13')]);return _0x3c706f(_0x2006d5[_0xea57('0x11')]['message']);}else{logger[_0xea57('0xc')](_0xea57('0xd'),_0x4947b5,'request\x20sent');_0x3c706f(_0x2006d5[_0xea57('0x14')]['message']);}})['catch'](function(_0x1ff533){logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x4947b5,_0x1ff533);_0x226429(_0x1ff533);});});}exports['CreateFaxQueueReport']=function(_0x2a8824){var _0x27fa83=this;return new Promise(function(_0x32ffa6,_0x3fc961){return db[_0xea57('0x15')]['create'](_0x2a8824[_0xea57('0x16')],{'raw':_0x2a8824[_0xea57('0x17')]?_0x2a8824[_0xea57('0x17')][_0xea57('0x18')]===undefined?!![]:![]:!![]})[_0xea57('0x19')](function(_0x413800){logger[_0xea57('0xc')](_0xea57('0x1a'),_0x2a8824);logger['debug']('CreateFaxQueueReport',_0x2a8824,JSON[_0xea57('0x1b')](_0x413800));_0x32ffa6(_0x413800);})[_0xea57('0x1c')](function(_0x5736fe){logger[_0xea57('0x11')]('CreateFaxQueueReport',_0x5736fe[_0xea57('0x13')],_0x2a8824);_0x3fc961(_0x27fa83['error'](0x1f4,_0x5736fe['message']));});});};exports[_0xea57('0x1d')]=function(_0x330c96){var _0x1c036f=this;return new Promise(function(_0x454e4a,_0x33fd31){return db['FaxQueueReport'][_0xea57('0x1e')](_0x330c96['body'],{'raw':_0x330c96[_0xea57('0x17')]?_0x330c96[_0xea57('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x330c96[_0xea57('0x17')]?_0x330c96[_0xea57('0x17')][_0xea57('0x1f')]||null:null,'attributes':_0x330c96[_0xea57('0x17')]?_0x330c96['options'][_0xea57('0x20')]||null:null,'limit':_0x330c96[_0xea57('0x17')]?_0x330c96['options'][_0xea57('0x21')]||null:null})[_0xea57('0x19')](function(_0x4d384e){logger[_0xea57('0xc')]('UpdateFaxQueueReport',_0x330c96);logger[_0xea57('0xf')]('UpdateFaxQueueReport',_0x330c96,JSON['stringify'](_0x4d384e));_0x454e4a(_0x4d384e);})[_0xea57('0x1c')](function(_0x2ea533){logger[_0xea57('0x11')](_0xea57('0x1d'),_0x2ea533[_0xea57('0x13')],_0x330c96);_0x33fd31(_0x1c036f[_0xea57('0x11')](0x1f4,_0x2ea533[_0xea57('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 198ac20..cc99d3d 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 _0x7719=['../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x430d7c,_0x4bfab6){var _0x1e3f10=function(_0x2bb09d){while(--_0x2bb09d){_0x430d7c['push'](_0x430d7c['shift']());}};_0x1e3f10(++_0x4bfab6);}(_0x7719,0x181));var _0x9771=function(_0x2c742c,_0x337544){_0x2c742c=_0x2c742c-0x0;var _0x29673a=_0x7719[_0x2c742c];return _0x29673a;};'use strict';var multer=require(_0x9771('0x0'));var util=require(_0x9771('0x1'));var path=require(_0x9771('0x2'));var timeout=require(_0x9771('0x3'));var express=require('express');var router=express[_0x9771('0x4')]();var fs_extra=require(_0x9771('0x5'));var auth=require(_0x9771('0x6'));var interaction=require(_0x9771('0x7'));var config=require(_0x9771('0x8'));var controller=require(_0x9771('0x9'));router[_0x9771('0xa')]('/',auth[_0x9771('0xb')](),controller[_0x9771('0xc')]);router[_0x9771('0xa')](_0x9771('0xd'),auth[_0x9771('0xb')](),controller[_0x9771('0xe')]);router[_0x9771('0xa')](_0x9771('0xf'),auth[_0x9771('0xb')](),controller[_0x9771('0x10')]);router[_0x9771('0x11')]('/',auth[_0x9771('0xb')](),controller[_0x9771('0x12')]);router[_0x9771('0x13')]('/:id',auth[_0x9771('0xb')](),controller[_0x9771('0x14')]);router[_0x9771('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x9771('0x16')]);module['exports']=router; \ No newline at end of file +var _0x8b80=['delete','destroy','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','/describe','isAuthenticated','describe','show','create','update'];(function(_0x2ee01d,_0x48f7a7){var _0x24bc9f=function(_0x2c23fd){while(--_0x2c23fd){_0x2ee01d['push'](_0x2ee01d['shift']());}};_0x24bc9f(++_0x48f7a7);}(_0x8b80,0x162));var _0x08b8=function(_0x287a47,_0x2f731c){_0x287a47=_0x287a47-0x0;var _0x3fb726=_0x8b80[_0x287a47];return _0x3fb726;};'use strict';var multer=require('multer');var util=require(_0x08b8('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x08b8('0x1'));var router=express['Router']();var fs_extra=require(_0x08b8('0x2'));var auth=require(_0x08b8('0x3'));var interaction=require(_0x08b8('0x4'));var config=require(_0x08b8('0x5'));var controller=require(_0x08b8('0x6'));router[_0x08b8('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x08b8('0x7')](_0x08b8('0x8'),auth[_0x08b8('0x9')](),controller[_0x08b8('0xa')]);router[_0x08b8('0x7')]('/:id',auth[_0x08b8('0x9')](),controller[_0x08b8('0xb')]);router['post']('/',auth[_0x08b8('0x9')](),controller[_0x08b8('0xc')]);router['put']('/:id',auth[_0x08b8('0x9')](),controller[_0x08b8('0xd')]);router[_0x08b8('0xe')]('/:id',auth[_0x08b8('0x9')](),controller[_0x08b8('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 88cca79..6d27f02 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 _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x38bfb8,_0x1608ed){var _0x5daf37=function(_0xd65bdd){while(--_0xd65bdd){_0x38bfb8['push'](_0x38bfb8['shift']());}};_0x5daf37(++_0x1608ed);}(_0x008c,0x188));var _0xc008=function(_0x3b150c,_0x2f93f8){_0x3b150c=_0x3b150c-0x0;var _0x5cd414=_0x008c[_0x3b150c];return _0x5cd414;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}}; \ No newline at end of file +var _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x5d8fe1,_0xf8dad1){var _0x1c7c6c=function(_0x3b2007){while(--_0x3b2007){_0x5d8fe1['push'](_0x5d8fe1['shift']());}};_0x1c7c6c(++_0xf8dad1);}(_0xaa88,0x137));var _0x8aa8=function(_0x468b0f,_0x408566){_0x468b0f=_0x468b0f-0x0;var _0x3e74d9=_0xaa88[_0x468b0f];return _0x3e74d9;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 137c1dc..7cde416 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 _0x7f06=['moment','util','path','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','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','count','limit','set','Content-Range','apply','reject','save','then','destroy','error','name','send','index','map','FaxTransferReport','rawAttributes','fieldName','type','query','keys','filters','model','attributes','filter','where','merge','VIRTUAL','includeAll','findAll','catch','show','intersection','fields','length','include','options','create','update','body','find','params','describe','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x5e18cb,_0x40f3fd){var _0x2eee7d=function(_0x1db363){while(--_0x1db363){_0x5e18cb['push'](_0x5e18cb['shift']());}};_0x2eee7d(++_0x40f3fd);}(_0x7f06,0x15f));var _0x67f0=function(_0x14b717,_0x2a3734){_0x14b717=_0x14b717-0x0;var _0x5ab8e7=_0x7f06[_0x14b717];return _0x5ab8e7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x67f0('0x0'));var zipdir=require(_0x67f0('0x1'));var jsonpatch=require(_0x67f0('0x2'));var rp=require(_0x67f0('0x3'));var moment=require(_0x67f0('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x67f0('0x5'));var path=require(_0x67f0('0x6'));var sox=require('sox');var csv=require(_0x67f0('0x7'));var ejs=require(_0x67f0('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x67f0('0x9'));var squel=require(_0x67f0('0xa'));var crypto=require('crypto');var jsforce=require(_0x67f0('0xb'));var deskjs=require(_0x67f0('0xc'));var toCsv=require('to-csv');var querystring=require(_0x67f0('0xd'));var Papa=require(_0x67f0('0xe'));var Redis=require(_0x67f0('0xf'));var authService=require(_0x67f0('0x10'));var qs=require(_0x67f0('0x11'));var as=require(_0x67f0('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x67f0('0x13'))(_0x67f0('0x14'));var utils=require(_0x67f0('0x15'));var config=require(_0x67f0('0x16'));var licenseUtil=require(_0x67f0('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5c3577,_0x5ba547){_0x5ba547=_0x5ba547||0xcc;return function(_0x115581){if(_0x115581){return _0x5c3577[_0x67f0('0x18')](_0x5ba547);}return _0x5c3577['status'](_0x5ba547)[_0x67f0('0x19')]();};}function respondWithResult(_0x5701cd,_0x5aadb9){_0x5aadb9=_0x5aadb9||0xc8;return function(_0x53ed9c){if(_0x53ed9c){return _0x5701cd[_0x67f0('0x1a')](_0x5aadb9)[_0x67f0('0x1b')](_0x53ed9c);}};}function respondWithFilteredResult(_0x1a2e17,_0x5ab462){return function(_0x441fc6){if(_0x441fc6){var _0xea1176=typeof _0x5ab462[_0x67f0('0x1c')]==='undefined'&&typeof _0x5ab462['limit']==='undefined';var _0x4cf9a5=_0x441fc6[_0x67f0('0x1d')];var _0x410a32=_0xea1176?0x0:_0x5ab462['offset'];var _0x25d611=_0xea1176?_0x441fc6['count']:_0x5ab462[_0x67f0('0x1c')]+_0x5ab462[_0x67f0('0x1e')];var _0x5d6570;if(_0x25d611>=_0x4cf9a5){_0x25d611=_0x4cf9a5;_0x5d6570=0xc8;}else{_0x5d6570=0xce;}_0x1a2e17['status'](_0x5d6570);return _0x1a2e17[_0x67f0('0x1f')](_0x67f0('0x20'),_0x410a32+'-'+_0x25d611+'/'+_0x4cf9a5)[_0x67f0('0x1b')](_0x441fc6);}return null;};}function patchUpdates(_0x3f4fd1){return function(_0x7443d4){try{jsonpatch[_0x67f0('0x21')](_0x7443d4,_0x3f4fd1,!![]);}catch(_0x211947){return BPromise[_0x67f0('0x22')](_0x211947);}return _0x7443d4[_0x67f0('0x23')]();};}function saveUpdates(_0x3f8dd2,_0x428027){return function(_0xe35235){if(_0xe35235){return _0xe35235['update'](_0x3f8dd2)[_0x67f0('0x24')](function(_0x2c4c6b){return _0x2c4c6b;});}return null;};}function removeEntity(_0x4bc4dd,_0xbdc2fe){return function(_0x374e6b){if(_0x374e6b){return _0x374e6b[_0x67f0('0x25')]()['then'](function(){_0x4bc4dd['status'](0xcc)[_0x67f0('0x19')]();});}};}function handleEntityNotFound(_0x811516,_0x5cd577){return function(_0x134db3){if(!_0x134db3){_0x811516['sendStatus'](0x194);}return _0x134db3;};}function handleError(_0x4dc78f,_0x48e7bb){_0x48e7bb=_0x48e7bb||0x1f4;return function(_0x10c7ab){logger[_0x67f0('0x26')](_0x10c7ab['stack']);if(_0x10c7ab[_0x67f0('0x27')]){delete _0x10c7ab[_0x67f0('0x27')];}_0x4dc78f[_0x67f0('0x1a')](_0x48e7bb)[_0x67f0('0x28')](_0x10c7ab);};}exports[_0x67f0('0x29')]=function(_0x26e36b,_0x24a077){var _0x55b9d6={},_0x58e1e2={},_0x507a08={'count':0x0,'rows':[]};var _0x14ef4f=_[_0x67f0('0x2a')](db[_0x67f0('0x2b')][_0x67f0('0x2c')],function(_0x4e0a80){return{'name':_0x4e0a80[_0x67f0('0x2d')],'type':_0x4e0a80[_0x67f0('0x2e')]['key']};});_0x58e1e2['model']=_[_0x67f0('0x2a')](_0x14ef4f,_0x67f0('0x27'));_0x58e1e2[_0x67f0('0x2f')]=_[_0x67f0('0x30')](_0x26e36b['query']);_0x58e1e2[_0x67f0('0x31')]=_['intersection'](_0x58e1e2[_0x67f0('0x32')],_0x58e1e2[_0x67f0('0x2f')]);_0x55b9d6[_0x67f0('0x33')]=_['intersection'](_0x58e1e2['model'],qs['fields'](_0x26e36b[_0x67f0('0x2f')]['fields']));_0x55b9d6[_0x67f0('0x33')]=_0x55b9d6['attributes']['length']?_0x55b9d6[_0x67f0('0x33')]:_0x58e1e2[_0x67f0('0x32')];if(!_0x26e36b['query']['hasOwnProperty']('nolimit')){_0x55b9d6[_0x67f0('0x1e')]=qs[_0x67f0('0x1e')](_0x26e36b['query']['limit']);_0x55b9d6[_0x67f0('0x1c')]=qs[_0x67f0('0x1c')](_0x26e36b[_0x67f0('0x2f')][_0x67f0('0x1c')]);}_0x55b9d6['order']=qs['sort'](_0x26e36b[_0x67f0('0x2f')]['sort']);_0x55b9d6['where']=qs[_0x67f0('0x31')](_['pick'](_0x26e36b[_0x67f0('0x2f')],_0x58e1e2['filters']),_0x14ef4f);if(_0x26e36b[_0x67f0('0x2f')][_0x67f0('0x34')]){_0x55b9d6[_0x67f0('0x35')]=_[_0x67f0('0x36')](_0x55b9d6[_0x67f0('0x35')],{'$or':_['map'](_0x14ef4f,function(_0x21840a){if(_0x21840a[_0x67f0('0x2e')]!==_0x67f0('0x37')){var _0x538eee={};_0x538eee[_0x21840a[_0x67f0('0x27')]]={'$like':'%'+_0x26e36b[_0x67f0('0x2f')][_0x67f0('0x34')]+'%'};return _0x538eee;}})});}_0x55b9d6=_['merge']({},_0x55b9d6,_0x26e36b['options']);var _0x2b4c86={'where':_0x55b9d6['where']};return db[_0x67f0('0x2b')][_0x67f0('0x1d')](_0x2b4c86)[_0x67f0('0x24')](function(_0x130044){_0x507a08['count']=_0x130044;if(_0x26e36b[_0x67f0('0x2f')][_0x67f0('0x38')]){_0x55b9d6['include']=[{'all':!![]}];}return db[_0x67f0('0x2b')][_0x67f0('0x39')](_0x55b9d6);})[_0x67f0('0x24')](function(_0x1b3228){_0x507a08['rows']=_0x1b3228;return _0x507a08;})[_0x67f0('0x24')](respondWithFilteredResult(_0x24a077,_0x55b9d6))[_0x67f0('0x3a')](handleError(_0x24a077,null));};exports[_0x67f0('0x3b')]=function(_0x4d866a,_0x1c7ac0){var _0x4b4609={'raw':!![],'where':{'id':_0x4d866a['params']['id']}},_0x4904e4={};_0x4904e4[_0x67f0('0x32')]=_[_0x67f0('0x30')](db[_0x67f0('0x2b')][_0x67f0('0x2c')]);_0x4904e4[_0x67f0('0x2f')]=_[_0x67f0('0x30')](_0x4d866a[_0x67f0('0x2f')]);_0x4904e4[_0x67f0('0x31')]=_['intersection'](_0x4904e4[_0x67f0('0x32')],_0x4904e4[_0x67f0('0x2f')]);_0x4b4609[_0x67f0('0x33')]=_[_0x67f0('0x3c')](_0x4904e4[_0x67f0('0x32')],qs[_0x67f0('0x3d')](_0x4d866a[_0x67f0('0x2f')][_0x67f0('0x3d')]));_0x4b4609[_0x67f0('0x33')]=_0x4b4609[_0x67f0('0x33')][_0x67f0('0x3e')]?_0x4b4609[_0x67f0('0x33')]:_0x4904e4[_0x67f0('0x32')];if(_0x4d866a['query'][_0x67f0('0x38')]){_0x4b4609[_0x67f0('0x3f')]=[{'all':!![]}];}_0x4b4609=_[_0x67f0('0x36')]({},_0x4b4609,_0x4d866a[_0x67f0('0x40')]);return db['FaxTransferReport']['find'](_0x4b4609)['then'](handleEntityNotFound(_0x1c7ac0,null))[_0x67f0('0x24')](respondWithResult(_0x1c7ac0,null))[_0x67f0('0x3a')](handleError(_0x1c7ac0,null));};exports[_0x67f0('0x41')]=function(_0x3c0c1e,_0x210c51){return db['FaxTransferReport'][_0x67f0('0x41')](_0x3c0c1e['body'],{})[_0x67f0('0x24')](respondWithResult(_0x210c51,0xc9))[_0x67f0('0x3a')](handleError(_0x210c51,null));};exports[_0x67f0('0x42')]=function(_0x1820a6,_0x13717c){if(_0x1820a6[_0x67f0('0x43')]['id']){delete _0x1820a6[_0x67f0('0x43')]['id'];}return db[_0x67f0('0x2b')][_0x67f0('0x44')]({'where':{'id':_0x1820a6[_0x67f0('0x45')]['id']}})['then'](handleEntityNotFound(_0x13717c,null))['then'](saveUpdates(_0x1820a6[_0x67f0('0x43')],null))[_0x67f0('0x24')](respondWithResult(_0x13717c,null))['catch'](handleError(_0x13717c,null));};exports[_0x67f0('0x25')]=function(_0x37bbb7,_0x574d33){return db[_0x67f0('0x2b')][_0x67f0('0x44')]({'where':{'id':_0x37bbb7['params']['id']}})[_0x67f0('0x24')](handleEntityNotFound(_0x574d33,null))[_0x67f0('0x24')](removeEntity(_0x574d33,null))[_0x67f0('0x3a')](handleError(_0x574d33,null));};exports[_0x67f0('0x46')]=function(_0x5cfe0a,_0x5f0edd){return db[_0x67f0('0x2b')]['describe']()[_0x67f0('0x24')](respondWithResult(_0x5f0edd,null))[_0x67f0('0x3a')](handleError(_0x5f0edd,null));}; \ No newline at end of file +var _0x150d=['end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','update','then','destroy','error','name','send','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','FaxTransferReport','includeAll','findAll','rows','catch','params','length','include','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','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','../../config/utils','../../config/license/util','status'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x150d,0x1f2));var _0xd150=function(_0x42d2af,_0x3961b5){_0x42d2af=_0x42d2af-0x0;var _0x1d6d63=_0x150d[_0x42d2af];return _0x1d6d63;};'use strict';var emlformat=require(_0xd150('0x0'));var rimraf=require(_0xd150('0x1'));var zipdir=require(_0xd150('0x2'));var jsonpatch=require(_0xd150('0x3'));var rp=require('request-promise');var moment=require(_0xd150('0x4'));var BPromise=require(_0xd150('0x5'));var Mustache=require(_0xd150('0x6'));var util=require(_0xd150('0x7'));var path=require(_0xd150('0x8'));var sox=require(_0xd150('0x9'));var csv=require(_0xd150('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd150('0xb'));var squel=require(_0xd150('0xc'));var crypto=require(_0xd150('0xd'));var jsforce=require(_0xd150('0xe'));var deskjs=require(_0xd150('0xf'));var toCsv=require(_0xd150('0xa'));var querystring=require(_0xd150('0x10'));var Papa=require(_0xd150('0x11'));var Redis=require(_0xd150('0x12'));var authService=require(_0xd150('0x13'));var qs=require(_0xd150('0x14'));var as=require(_0xd150('0x15'));var hardwareService=require(_0xd150('0x16'));var logger=require(_0xd150('0x17'))('api');var utils=require(_0xd150('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xd150('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x312f5c,_0x30d556){_0x30d556=_0x30d556||0xcc;return function(_0x233ff7){if(_0x233ff7){return _0x312f5c['sendStatus'](_0x30d556);}return _0x312f5c[_0xd150('0x1a')](_0x30d556)[_0xd150('0x1b')]();};}function respondWithResult(_0x335cc1,_0x183f23){_0x183f23=_0x183f23||0xc8;return function(_0x25b1c6){if(_0x25b1c6){return _0x335cc1[_0xd150('0x1a')](_0x183f23)['json'](_0x25b1c6);}};}function respondWithFilteredResult(_0x4088b6,_0x117794){return function(_0x201306){if(_0x201306){var _0x54bbb1=typeof _0x117794[_0xd150('0x1c')]===_0xd150('0x1d')&&typeof _0x117794['limit']===_0xd150('0x1d');var _0x26f6e2=_0x201306['count'];var _0x552b00=_0x54bbb1?0x0:_0x117794[_0xd150('0x1c')];var _0x2bd4f8=_0x54bbb1?_0x201306[_0xd150('0x1e')]:_0x117794[_0xd150('0x1c')]+_0x117794[_0xd150('0x1f')];var _0x5d7564;if(_0x2bd4f8>=_0x26f6e2){_0x2bd4f8=_0x26f6e2;_0x5d7564=0xc8;}else{_0x5d7564=0xce;}_0x4088b6[_0xd150('0x1a')](_0x5d7564);return _0x4088b6[_0xd150('0x20')](_0xd150('0x21'),_0x552b00+'-'+_0x2bd4f8+'/'+_0x26f6e2)[_0xd150('0x22')](_0x201306);}return null;};}function patchUpdates(_0x268aa0){return function(_0x1046e5){try{jsonpatch[_0xd150('0x23')](_0x1046e5,_0x268aa0,!![]);}catch(_0x5b66bf){return BPromise[_0xd150('0x24')](_0x5b66bf);}return _0x1046e5['save']();};}function saveUpdates(_0x57195e,_0x44f970){return function(_0x3867c8){if(_0x3867c8){return _0x3867c8[_0xd150('0x25')](_0x57195e)[_0xd150('0x26')](function(_0x66d8ce){return _0x66d8ce;});}return null;};}function removeEntity(_0x24514f,_0x576792){return function(_0x19e0df){if(_0x19e0df){return _0x19e0df[_0xd150('0x27')]()[_0xd150('0x26')](function(){_0x24514f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a7af0,_0x10c888){return function(_0x2e42cb){if(!_0x2e42cb){_0x5a7af0['sendStatus'](0x194);}return _0x2e42cb;};}function handleError(_0x3f1561,_0xa1b9a){_0xa1b9a=_0xa1b9a||0x1f4;return function(_0x5e11be){logger[_0xd150('0x28')](_0x5e11be['stack']);if(_0x5e11be[_0xd150('0x29')]){delete _0x5e11be[_0xd150('0x29')];}_0x3f1561[_0xd150('0x1a')](_0xa1b9a)[_0xd150('0x2a')](_0x5e11be);};}exports['index']=function(_0xc0f40c,_0xee62c9){var _0x32c5e1={},_0x12f932={},_0x579b7d={'count':0x0,'rows':[]};var _0x1fced6=_['map'](db['FaxTransferReport'][_0xd150('0x2b')],function(_0x7fd2d){return{'name':_0x7fd2d['fieldName'],'type':_0x7fd2d[_0xd150('0x2c')][_0xd150('0x2d')]};});_0x12f932[_0xd150('0x2e')]=_[_0xd150('0x2f')](_0x1fced6,_0xd150('0x29'));_0x12f932[_0xd150('0x30')]=_[_0xd150('0x31')](_0xc0f40c[_0xd150('0x30')]);_0x12f932[_0xd150('0x32')]=_[_0xd150('0x33')](_0x12f932[_0xd150('0x2e')],_0x12f932[_0xd150('0x30')]);_0x32c5e1[_0xd150('0x34')]=_[_0xd150('0x33')](_0x12f932[_0xd150('0x2e')],qs[_0xd150('0x35')](_0xc0f40c[_0xd150('0x30')][_0xd150('0x35')]));_0x32c5e1[_0xd150('0x34')]=_0x32c5e1[_0xd150('0x34')]['length']?_0x32c5e1['attributes']:_0x12f932[_0xd150('0x2e')];if(!_0xc0f40c[_0xd150('0x30')][_0xd150('0x36')](_0xd150('0x37'))){_0x32c5e1[_0xd150('0x1f')]=qs['limit'](_0xc0f40c[_0xd150('0x30')][_0xd150('0x1f')]);_0x32c5e1[_0xd150('0x1c')]=qs[_0xd150('0x1c')](_0xc0f40c[_0xd150('0x30')][_0xd150('0x1c')]);}_0x32c5e1[_0xd150('0x38')]=qs[_0xd150('0x39')](_0xc0f40c['query'][_0xd150('0x39')]);_0x32c5e1[_0xd150('0x3a')]=qs[_0xd150('0x32')](_[_0xd150('0x3b')](_0xc0f40c[_0xd150('0x30')],_0x12f932['filters']),_0x1fced6);if(_0xc0f40c[_0xd150('0x30')][_0xd150('0x3c')]){_0x32c5e1[_0xd150('0x3a')]=_[_0xd150('0x3d')](_0x32c5e1[_0xd150('0x3a')],{'$or':_[_0xd150('0x2f')](_0x1fced6,function(_0x5b7595){if(_0x5b7595[_0xd150('0x2c')]!=='VIRTUAL'){var _0x22a9c7={};_0x22a9c7[_0x5b7595[_0xd150('0x29')]]={'$like':'%'+_0xc0f40c[_0xd150('0x30')][_0xd150('0x3c')]+'%'};return _0x22a9c7;}})});}_0x32c5e1=_[_0xd150('0x3d')]({},_0x32c5e1,_0xc0f40c['options']);var _0x354c4b={'where':_0x32c5e1[_0xd150('0x3a')]};return db[_0xd150('0x3e')][_0xd150('0x1e')](_0x354c4b)[_0xd150('0x26')](function(_0x85a990){_0x579b7d[_0xd150('0x1e')]=_0x85a990;if(_0xc0f40c['query'][_0xd150('0x3f')]){_0x32c5e1['include']=[{'all':!![]}];}return db['FaxTransferReport'][_0xd150('0x40')](_0x32c5e1);})[_0xd150('0x26')](function(_0x37c9a4){_0x579b7d[_0xd150('0x41')]=_0x37c9a4;return _0x579b7d;})[_0xd150('0x26')](respondWithFilteredResult(_0xee62c9,_0x32c5e1))[_0xd150('0x42')](handleError(_0xee62c9,null));};exports['show']=function(_0x46a239,_0x1646c3){var _0x4a3604={'raw':!![],'where':{'id':_0x46a239[_0xd150('0x43')]['id']}},_0x39741c={};_0x39741c[_0xd150('0x2e')]=_['keys'](db[_0xd150('0x3e')]['rawAttributes']);_0x39741c['query']=_[_0xd150('0x31')](_0x46a239[_0xd150('0x30')]);_0x39741c[_0xd150('0x32')]=_['intersection'](_0x39741c[_0xd150('0x2e')],_0x39741c[_0xd150('0x30')]);_0x4a3604[_0xd150('0x34')]=_[_0xd150('0x33')](_0x39741c[_0xd150('0x2e')],qs['fields'](_0x46a239[_0xd150('0x30')][_0xd150('0x35')]));_0x4a3604[_0xd150('0x34')]=_0x4a3604['attributes'][_0xd150('0x44')]?_0x4a3604[_0xd150('0x34')]:_0x39741c['model'];if(_0x46a239['query'][_0xd150('0x3f')]){_0x4a3604[_0xd150('0x45')]=[{'all':!![]}];}_0x4a3604=_[_0xd150('0x3d')]({},_0x4a3604,_0x46a239[_0xd150('0x46')]);return db['FaxTransferReport'][_0xd150('0x47')](_0x4a3604)[_0xd150('0x26')](handleEntityNotFound(_0x1646c3,null))[_0xd150('0x26')](respondWithResult(_0x1646c3,null))['catch'](handleError(_0x1646c3,null));};exports['create']=function(_0x54381a,_0x3bd6b1){return db[_0xd150('0x3e')][_0xd150('0x48')](_0x54381a[_0xd150('0x49')],{})[_0xd150('0x26')](respondWithResult(_0x3bd6b1,0xc9))[_0xd150('0x42')](handleError(_0x3bd6b1,null));};exports[_0xd150('0x25')]=function(_0x2124dc,_0x3130d3){if(_0x2124dc[_0xd150('0x49')]['id']){delete _0x2124dc[_0xd150('0x49')]['id'];}return db['FaxTransferReport'][_0xd150('0x47')]({'where':{'id':_0x2124dc[_0xd150('0x43')]['id']}})[_0xd150('0x26')](handleEntityNotFound(_0x3130d3,null))[_0xd150('0x26')](saveUpdates(_0x2124dc[_0xd150('0x49')],null))[_0xd150('0x26')](respondWithResult(_0x3130d3,null))[_0xd150('0x42')](handleError(_0x3130d3,null));};exports[_0xd150('0x27')]=function(_0x18fa1c,_0x2d025d){return db[_0xd150('0x3e')][_0xd150('0x47')]({'where':{'id':_0x18fa1c[_0xd150('0x43')]['id']}})[_0xd150('0x26')](handleEntityNotFound(_0x2d025d,null))[_0xd150('0x26')](removeEntity(_0x2d025d,null))[_0xd150('0x42')](handleError(_0x2d025d,null));};exports[_0xd150('0x4a')]=function(_0x3e1749,_0x1ef5ae){return db[_0xd150('0x3e')]['describe']()[_0xd150('0x26')](respondWithResult(_0x1ef5ae,null))[_0xd150('0x42')](handleError(_0x1ef5ae,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index c49f37a..44cfc62 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 _0x2d93=['FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports'];(function(_0x323747,_0x5c0967){var _0x296372=function(_0x413eff){while(--_0x413eff){_0x323747['push'](_0x323747['shift']());}};_0x296372(++_0x5c0967);}(_0x2d93,0xf3));var _0x32d9=function(_0x44268d,_0xad8443){_0x44268d=_0x44268d-0x0;var _0x4be92d=_0x2d93[_0x44268d];return _0x4be92d;};'use strict';var _=require(_0x32d9('0x0'));var util=require(_0x32d9('0x1'));var logger=require(_0x32d9('0x2'))(_0x32d9('0x3'));var moment=require(_0x32d9('0x4'));var BPromise=require(_0x32d9('0x5'));var rp=require(_0x32d9('0x6'));var fs=require('fs');var path=require(_0x32d9('0x7'));var rimraf=require(_0x32d9('0x8'));var config=require(_0x32d9('0x9'));var attributes=require(_0x32d9('0xa'));module[_0x32d9('0xb')]=function(_0x9b4979,_0x3529db){return _0x9b4979['define'](_0x32d9('0xc'),attributes,{'tableName':_0x32d9('0xd'),'paranoid':![],'indexes':[{'name':_0x32d9('0xe'),'fields':[_0x32d9('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5e65=['define','report_fax_transfer','lodash','api','bluebird','path','./faxTransferReport.attributes','exports'];(function(_0x5812b9,_0x2fa1cc){var _0xf61ef=function(_0x287489){while(--_0x287489){_0x5812b9['push'](_0x5812b9['shift']());}};_0xf61ef(++_0x2fa1cc);}(_0x5e65,0x152));var _0x55e6=function(_0x1b50da,_0x53ee22){_0x1b50da=_0x1b50da-0x0;var _0x530452=_0x5e65[_0x1b50da];return _0x530452;};'use strict';var _=require(_0x55e6('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x55e6('0x1'));var moment=require('moment');var BPromise=require(_0x55e6('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x55e6('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x55e6('0x4'));module[_0x55e6('0x5')]=function(_0x70cd2f,_0x2e4a86){return _0x70cd2f[_0x55e6('0x6')]('FaxTransferReport',attributes,{'tableName':_0x55e6('0x7'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 5ed5a90..6dce75a 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 _0x67e5=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','stringify','error','code','message','FaxTransferReport,\x20%s,\x20%s','result','lodash','util'];(function(_0x1f75f9,_0x5c2a8d){var _0x34f4c7=function(_0x4ec21c){while(--_0x4ec21c){_0x1f75f9['push'](_0x1f75f9['shift']());}};_0x34f4c7(++_0x5c2a8d);}(_0x67e5,0x18d));var _0x567e=function(_0x5cbb42,_0xcb7a75){_0x5cbb42=_0x5cbb42-0x0;var _0x37761c=_0x67e5[_0x5cbb42];return _0x37761c;};'use strict';var _=require(_0x567e('0x0'));var util=require(_0x567e('0x1'));var moment=require('moment');var BPromise=require(_0x567e('0x2'));var rs=require(_0x567e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x567e('0x4'))['db'];var utils=require(_0x567e('0x5'));var logger=require(_0x567e('0x6'))(_0x567e('0x7'));var config=require(_0x567e('0x8'));var jayson=require(_0x567e('0x9'));var client=jayson[_0x567e('0xa')][_0x567e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x228ec2,_0x2f596c,_0x2e8997){return new BPromise(function(_0x5e3602,_0x3898cb){return client[_0x567e('0xc')](_0x228ec2,_0x2e8997)[_0x567e('0xd')](function(_0x332bd2){logger['info']('FaxTransferReport,\x20%s,\x20%s',_0x2f596c,_0x567e('0xe'));logger['debug']('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x2f596c,_0x567e('0xe'),JSON[_0x567e('0xf')](_0x332bd2));if(_0x332bd2[_0x567e('0x10')]){if(_0x332bd2[_0x567e('0x10')][_0x567e('0x11')]===0x1f4){logger[_0x567e('0x10')]('FaxTransferReport,\x20%s,\x20%s',_0x2f596c,_0x332bd2[_0x567e('0x10')][_0x567e('0x12')]);return _0x3898cb(_0x332bd2['error']['message']);}logger[_0x567e('0x10')](_0x567e('0x13'),_0x2f596c,_0x332bd2[_0x567e('0x10')][_0x567e('0x12')]);return _0x5e3602(_0x332bd2[_0x567e('0x10')][_0x567e('0x12')]);}else{logger['info']('FaxTransferReport,\x20%s,\x20%s',_0x2f596c,'request\x20sent');_0x5e3602(_0x332bd2[_0x567e('0x14')]['message']);}})['catch'](function(_0xe4db48){logger[_0x567e('0x10')](_0x567e('0x13'),_0x2f596c,_0xe4db48);_0x3898cb(_0xe4db48);});});} \ No newline at end of file +var _0x311f=['stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/logger','../../config/environment','client','request','then','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x2f3848,_0x48564d){var _0x102668=function(_0x5e32ab){while(--_0x5e32ab){_0x2f3848['push'](_0x2f3848['shift']());}};_0x102668(++_0x48564d);}(_0x311f,0x6a));var _0xf311=function(_0x55912d,_0x1f3d3c){_0x55912d=_0x55912d-0x0;var _0x46c1bb=_0x311f[_0x55912d];return _0x46c1bb;};'use strict';var _=require(_0xf311('0x0'));var util=require(_0xf311('0x1'));var moment=require(_0xf311('0x2'));var BPromise=require('bluebird');var rs=require(_0xf311('0x3'));var fs=require('fs');var Redis=require(_0xf311('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf311('0x5'))('rpc');var config=require(_0xf311('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xf311('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa57445,_0x3ba55d,_0x40d42f){return new BPromise(function(_0x2855fb,_0x34331e){return client[_0xf311('0x8')](_0xa57445,_0x40d42f)[_0xf311('0x9')](function(_0x293374){logger['info'](_0xf311('0xa'),_0x3ba55d,_0xf311('0xb'));logger[_0xf311('0xc')](_0xf311('0xd'),_0x3ba55d,_0xf311('0xb'),JSON[_0xf311('0xe')](_0x293374));if(_0x293374[_0xf311('0xf')]){if(_0x293374[_0xf311('0xf')][_0xf311('0x10')]===0x1f4){logger[_0xf311('0xf')](_0xf311('0xa'),_0x3ba55d,_0x293374[_0xf311('0xf')][_0xf311('0x11')]);return _0x34331e(_0x293374['error'][_0xf311('0x11')]);}logger['error'](_0xf311('0xa'),_0x3ba55d,_0x293374['error'][_0xf311('0x11')]);return _0x2855fb(_0x293374['error'][_0xf311('0x11')]);}else{logger['info']('FaxTransferReport,\x20%s,\x20%s',_0x3ba55d,_0xf311('0xb'));_0x2855fb(_0x293374[_0xf311('0x12')][_0xf311('0x11')]);}})[_0xf311('0x13')](function(_0x1334d2){logger[_0xf311('0xf')](_0xf311('0xa'),_0x3ba55d,_0x1334d2);_0x34331e(_0x1334d2);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 770f909..d34df83 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 _0xc441=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','update','delete','destroy','exports','util','connect-timeout'];(function(_0x58355a,_0x340a2c){var _0xffc83=function(_0x594d72){while(--_0x594d72){_0x58355a['push'](_0x58355a['shift']());}};_0xffc83(++_0x340a2c);}(_0xc441,0xfa));var _0x1c44=function(_0x591215,_0x35b633){_0x591215=_0x591215-0x0;var _0x20bf5a=_0xc441[_0x591215];return _0x20bf5a;};'use strict';var multer=require('multer');var util=require(_0x1c44('0x0'));var path=require('path');var timeout=require(_0x1c44('0x1'));var express=require(_0x1c44('0x2'));var router=express[_0x1c44('0x3')]();var fs_extra=require(_0x1c44('0x4'));var auth=require(_0x1c44('0x5'));var interaction=require(_0x1c44('0x6'));var config=require(_0x1c44('0x7'));var controller=require(_0x1c44('0x8'));router[_0x1c44('0x9')]('/',auth[_0x1c44('0xa')](),controller[_0x1c44('0xb')]);router[_0x1c44('0x9')](_0x1c44('0xc'),auth['isAuthenticated'](),controller[_0x1c44('0xd')]);router[_0x1c44('0x9')](_0x1c44('0xe'),auth['isAuthenticated'](),controller[_0x1c44('0xf')]);router[_0x1c44('0x10')]('/',auth[_0x1c44('0xa')](),controller['create']);router['put'](_0x1c44('0xe'),auth[_0x1c44('0xa')](),controller[_0x1c44('0x11')]);router[_0x1c44('0x12')](_0x1c44('0xe'),auth[_0x1c44('0xa')](),controller[_0x1c44('0x13')]);module[_0x1c44('0x14')]=router; \ No newline at end of file +var _0xd437=['../../components/interaction/service','./faxTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x3876a9,_0x4b6660){var _0x9e56fb=function(_0x545ceb){while(--_0x545ceb){_0x3876a9['push'](_0x3876a9['shift']());}};_0x9e56fb(++_0x4b6660);}(_0xd437,0x1f0));var _0x7d43=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0xd437[_0x1deb03];return _0x189fe7;};'use strict';var multer=require(_0x7d43('0x0'));var util=require(_0x7d43('0x1'));var path=require(_0x7d43('0x2'));var timeout=require(_0x7d43('0x3'));var express=require(_0x7d43('0x4'));var router=express[_0x7d43('0x5')]();var fs_extra=require(_0x7d43('0x6'));var auth=require(_0x7d43('0x7'));var interaction=require(_0x7d43('0x8'));var config=require('../../config/environment');var controller=require(_0x7d43('0x9'));router[_0x7d43('0xa')]('/',auth[_0x7d43('0xb')](),controller[_0x7d43('0xc')]);router[_0x7d43('0xa')](_0x7d43('0xd'),auth[_0x7d43('0xb')](),controller[_0x7d43('0xe')]);router['get'](_0x7d43('0xf'),auth[_0x7d43('0xb')](),controller['show']);router[_0x7d43('0x10')]('/',auth['isAuthenticated'](),controller[_0x7d43('0x11')]);router[_0x7d43('0x12')]('/:id',auth[_0x7d43('0xb')](),controller[_0x7d43('0x13')]);router['delete'](_0x7d43('0xf'),auth[_0x7d43('0xb')](),controller['destroy']);module[_0x7d43('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 6ab886f..eec5a66 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 _0x2305=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x28c588,_0x12f4f5){var _0x3e3088=function(_0x3d8428){while(--_0x3d8428){_0x28c588['push'](_0x28c588['shift']());}};_0x3e3088(++_0x12f4f5);}(_0x2305,0x181));var _0x5230=function(_0x351509,_0x54725c){_0x351509=_0x351509-0x0;var _0x4e9861=_0x2305[_0x351509];return _0x4e9861;};'use strict';var multer=require(_0x5230('0x0'));var util=require(_0x5230('0x1'));var path=require(_0x5230('0x2'));var timeout=require(_0x5230('0x3'));var express=require(_0x5230('0x4'));var router=express[_0x5230('0x5')]();var fs_extra=require(_0x5230('0x6'));var auth=require(_0x5230('0x7'));var interaction=require(_0x5230('0x8'));var config=require(_0x5230('0x9'));var controller=require('./intDeskAccount.controller');router[_0x5230('0xa')]('/',auth[_0x5230('0xb')](),controller[_0x5230('0xc')]);router[_0x5230('0xa')](_0x5230('0xd'),auth[_0x5230('0xb')](),controller[_0x5230('0xe')]);router['get'](_0x5230('0xf'),auth[_0x5230('0xb')](),controller[_0x5230('0x10')]);router[_0x5230('0xa')](_0x5230('0x11'),auth[_0x5230('0xb')](),controller['getFields']);router[_0x5230('0x12')]('/',auth[_0x5230('0xb')](),controller[_0x5230('0x13')]);router[_0x5230('0x12')]('/:id/configurations',auth[_0x5230('0xb')](),controller[_0x5230('0x14')]);router[_0x5230('0x15')]('/:id',auth[_0x5230('0xb')](),controller[_0x5230('0x16')]);router[_0x5230('0x17')]('/:id',auth['isAuthenticated'](),controller[_0x5230('0x18')]);module[_0x5230('0x19')]=router; \ No newline at end of file +var _0xbd4a=['../../components/interaction/service','../../config/environment','./intDeskAccount.controller','index','get','/:id','isAuthenticated','getConfigurations','/:id/fields','post','create','/:id/configurations','update','delete','exports','multer','util','path','connect-timeout','Router'];(function(_0x5f035f,_0x5300d1){var _0xad281e=function(_0x5b92ae){while(--_0x5b92ae){_0x5f035f['push'](_0x5f035f['shift']());}};_0xad281e(++_0x5300d1);}(_0xbd4a,0xeb));var _0xabd4=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xbd4a[_0x21a9d9];return _0x46adce;};'use strict';var multer=require(_0xabd4('0x0'));var util=require(_0xabd4('0x1'));var path=require(_0xabd4('0x2'));var timeout=require(_0xabd4('0x3'));var express=require('express');var router=express[_0xabd4('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xabd4('0x5'));var config=require(_0xabd4('0x6'));var controller=require(_0xabd4('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xabd4('0x8')]);router[_0xabd4('0x9')](_0xabd4('0xa'),auth[_0xabd4('0xb')](),controller['show']);router[_0xabd4('0x9')]('/:id/configurations',auth[_0xabd4('0xb')](),controller[_0xabd4('0xc')]);router['get'](_0xabd4('0xd'),auth[_0xabd4('0xb')](),controller['getFields']);router[_0xabd4('0xe')]('/',auth[_0xabd4('0xb')](),controller[_0xabd4('0xf')]);router['post'](_0xabd4('0x10'),auth[_0xabd4('0xb')](),controller['addConfiguration']);router['put'](_0xabd4('0xa'),auth['isAuthenticated'](),controller[_0xabd4('0x11')]);router[_0xabd4('0x12')](_0xabd4('0xa'),auth[_0xabd4('0xb')](),controller['destroy']);module[_0xabd4('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index e47a9e1..7593ca1 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 _0x0753=['STRING','basic','ENUM','integrationTab','newTab','exports'];(function(_0x1fdb5f,_0x97f230){var _0x505252=function(_0x532e44){while(--_0x532e44){_0x1fdb5f['push'](_0x1fdb5f['shift']());}};_0x505252(++_0x97f230);}(_0x0753,0xcb));var _0x3075=function(_0x2c8c97,_0x48e6a2){_0x2c8c97=_0x2c8c97-0x0;var _0xf4541c=_0x0753[_0x2c8c97];return _0xf4541c;};'use strict';var Sequelize=require('sequelize');module[_0x3075('0x0')]={'name':{'type':Sequelize[_0x3075('0x1')]},'description':{'type':Sequelize[_0x3075('0x1')]},'username':{'type':Sequelize[_0x3075('0x1')]},'remoteUri':{'type':Sequelize[_0x3075('0x1')]},'authType':{'type':Sequelize['ENUM'](_0x3075('0x2')),'defaultValue':'basic'},'password':{'type':Sequelize[_0x3075('0x1')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize[_0x3075('0x1')]},'token':{'type':Sequelize[_0x3075('0x1')]},'tokenSecret':{'type':Sequelize[_0x3075('0x1')]},'serverUrl':{'type':Sequelize[_0x3075('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x3075('0x3')](_0x3075('0x4'),_0x3075('0x5')),'defaultValue':_0x3075('0x4')}}; \ No newline at end of file +var _0x3cb1=['ENUM','integrationTab','sequelize','exports','STRING','basic'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x3cb1,0x1a6));var _0x13cb=function(_0x297fb9,_0x20043a){_0x297fb9=_0x297fb9-0x0;var _0xbe61b4=_0x3cb1[_0x297fb9];return _0xbe61b4;};'use strict';var Sequelize=require(_0x13cb('0x0'));module[_0x13cb('0x1')]={'name':{'type':Sequelize[_0x13cb('0x2')]},'description':{'type':Sequelize[_0x13cb('0x2')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x13cb('0x2')]},'authType':{'type':Sequelize['ENUM']('basic'),'defaultValue':_0x13cb('0x3')},'password':{'type':Sequelize[_0x13cb('0x2')]},'consumerKey':{'type':Sequelize[_0x13cb('0x2')]},'consumerSecret':{'type':Sequelize[_0x13cb('0x2')]},'token':{'type':Sequelize[_0x13cb('0x2')]},'tokenSecret':{'type':Sequelize[_0x13cb('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x13cb('0x4')](_0x13cb('0x5'),'newTab'),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index d943d35..541c7f2 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 _0xffb9=['find','getConfigurations','findOne','options','hasOwnProperty','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','DeskConfiguration','DeskField','priority','remoteUri','username','consumerKey','consumerSecret','tokenSecret','substring','GET','format','%s/custom_fields','application/json','authType','basic','headers','Authorization','Basic\x20%s','%s:%s','toString','base64','concat','entries','active','label','test','statusCode','error','getFields','stringify','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','map','DeskAccount','rawAttributes','fieldName','model','query','intersection','attributes','fields','length','nolimit','order','sort','filters','pick','where','type','VIRTUAL','filter','includeAll','findAll','rows','show','params','keys','include','merge','catch','create','body'];(function(_0x59dccc,_0x184c1c){var _0xc97bcb=function(_0x1ddbcb){while(--_0x1ddbcb){_0x59dccc['push'](_0x59dccc['shift']());}};_0xc97bcb(++_0x184c1c);}(_0xffb9,0x9f));var _0x9ffb=function(_0x5003e2,_0x83dcc1){_0x5003e2=_0x5003e2-0x0;var _0x59bb42=_0xffb9[_0x5003e2];return _0x59bb42;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9ffb('0x0'));var zipdir=require(_0x9ffb('0x1'));var jsonpatch=require(_0x9ffb('0x2'));var rp=require('request-promise');var moment=require(_0x9ffb('0x3'));var BPromise=require(_0x9ffb('0x4'));var Mustache=require(_0x9ffb('0x5'));var util=require(_0x9ffb('0x6'));var path=require(_0x9ffb('0x7'));var sox=require(_0x9ffb('0x8'));var csv=require(_0x9ffb('0x9'));var ejs=require(_0x9ffb('0xa'));var fs=require('fs');var fs_extra=require(_0x9ffb('0xb'));var _=require(_0x9ffb('0xc'));var squel=require(_0x9ffb('0xd'));var crypto=require(_0x9ffb('0xe'));var jsforce=require(_0x9ffb('0xf'));var deskjs=require(_0x9ffb('0x10'));var toCsv=require(_0x9ffb('0x9'));var querystring=require(_0x9ffb('0x11'));var Papa=require(_0x9ffb('0x12'));var Redis=require(_0x9ffb('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x9ffb('0x14'));var as=require(_0x9ffb('0x15'));var hardwareService=require(_0x9ffb('0x16'));var logger=require(_0x9ffb('0x17'))('api');var utils=require(_0x9ffb('0x18'));var config=require(_0x9ffb('0x19'));var licenseUtil=require(_0x9ffb('0x1a'));var db=require(_0x9ffb('0x1b'))['db'];var integrations=require(_0x9ffb('0x1c'));function respondWithStatusCode(_0x3f9c15,_0x2550e3){_0x2550e3=_0x2550e3||0xcc;return function(_0x4120bb){if(_0x4120bb){return _0x3f9c15[_0x9ffb('0x1d')](_0x2550e3);}return _0x3f9c15[_0x9ffb('0x1e')](_0x2550e3)[_0x9ffb('0x1f')]();};}function respondWithResult(_0x9732f0,_0x4cc44d){_0x4cc44d=_0x4cc44d||0xc8;return function(_0xa4d269){if(_0xa4d269){return _0x9732f0['status'](_0x4cc44d)['json'](_0xa4d269);}};}function respondWithFilteredResult(_0x487d4c,_0x12e686){return function(_0x2246f5){if(_0x2246f5){var _0x29b601=typeof _0x12e686[_0x9ffb('0x20')]===_0x9ffb('0x21')&&typeof _0x12e686[_0x9ffb('0x22')]==='undefined';var _0x5c3dda=_0x2246f5[_0x9ffb('0x23')];var _0x2b9f5c=_0x29b601?0x0:_0x12e686['offset'];var _0x46cace=_0x29b601?_0x2246f5[_0x9ffb('0x23')]:_0x12e686[_0x9ffb('0x20')]+_0x12e686[_0x9ffb('0x22')];var _0x516a02;if(_0x46cace>=_0x5c3dda){_0x46cace=_0x5c3dda;_0x516a02=0xc8;}else{_0x516a02=0xce;}_0x487d4c[_0x9ffb('0x1e')](_0x516a02);return _0x487d4c[_0x9ffb('0x24')](_0x9ffb('0x25'),_0x2b9f5c+'-'+_0x46cace+'/'+_0x5c3dda)['json'](_0x2246f5);}return null;};}function patchUpdates(_0x5376df){return function(_0x33678c){try{jsonpatch[_0x9ffb('0x26')](_0x33678c,_0x5376df,!![]);}catch(_0x262f44){return BPromise[_0x9ffb('0x27')](_0x262f44);}return _0x33678c['save']();};}function saveUpdates(_0x2aa392,_0x5362db){return function(_0x406c23){if(_0x406c23){return _0x406c23[_0x9ffb('0x28')](_0x2aa392)[_0x9ffb('0x29')](function(_0x3ef774){return _0x3ef774;});}return null;};}function removeEntity(_0x314718,_0x51c3d9){return function(_0x1656b0){if(_0x1656b0){return _0x1656b0[_0x9ffb('0x2a')]()[_0x9ffb('0x29')](function(){_0x314718['status'](0xcc)[_0x9ffb('0x1f')]();});}};}function handleEntityNotFound(_0x11b66c,_0x2ed409){return function(_0x35a65c){if(!_0x35a65c){_0x11b66c['sendStatus'](0x194);}return _0x35a65c;};}function handleError(_0x510086,_0x1c7fc3){_0x1c7fc3=_0x1c7fc3||0x1f4;return function(_0x196842){logger['error'](_0x196842[_0x9ffb('0x2b')]);if(_0x196842[_0x9ffb('0x2c')]){delete _0x196842[_0x9ffb('0x2c')];}_0x510086[_0x9ffb('0x1e')](_0x1c7fc3)[_0x9ffb('0x2d')](_0x196842);};}exports[_0x9ffb('0x2e')]=function(_0x5220a7,_0x5d2ec3){var _0x536d64={},_0x3d8f0f={},_0x20dc28={'count':0x0,'rows':[]};var _0x5192a9=_[_0x9ffb('0x2f')](db[_0x9ffb('0x30')][_0x9ffb('0x31')],function(_0x3d5748){return{'name':_0x3d5748[_0x9ffb('0x32')],'type':_0x3d5748['type']['key']};});_0x3d8f0f[_0x9ffb('0x33')]=_[_0x9ffb('0x2f')](_0x5192a9,_0x9ffb('0x2c'));_0x3d8f0f[_0x9ffb('0x34')]=_['keys'](_0x5220a7['query']);_0x3d8f0f['filters']=_[_0x9ffb('0x35')](_0x3d8f0f[_0x9ffb('0x33')],_0x3d8f0f[_0x9ffb('0x34')]);_0x536d64[_0x9ffb('0x36')]=_[_0x9ffb('0x35')](_0x3d8f0f[_0x9ffb('0x33')],qs['fields'](_0x5220a7[_0x9ffb('0x34')][_0x9ffb('0x37')]));_0x536d64[_0x9ffb('0x36')]=_0x536d64[_0x9ffb('0x36')][_0x9ffb('0x38')]?_0x536d64[_0x9ffb('0x36')]:_0x3d8f0f[_0x9ffb('0x33')];if(!_0x5220a7[_0x9ffb('0x34')]['hasOwnProperty'](_0x9ffb('0x39'))){_0x536d64[_0x9ffb('0x22')]=qs[_0x9ffb('0x22')](_0x5220a7[_0x9ffb('0x34')]['limit']);_0x536d64[_0x9ffb('0x20')]=qs[_0x9ffb('0x20')](_0x5220a7[_0x9ffb('0x34')][_0x9ffb('0x20')]);}_0x536d64[_0x9ffb('0x3a')]=qs[_0x9ffb('0x3b')](_0x5220a7[_0x9ffb('0x34')][_0x9ffb('0x3b')]);_0x536d64['where']=qs[_0x9ffb('0x3c')](_[_0x9ffb('0x3d')](_0x5220a7[_0x9ffb('0x34')],_0x3d8f0f[_0x9ffb('0x3c')]),_0x5192a9);if(_0x5220a7[_0x9ffb('0x34')]['filter']){_0x536d64['where']=_['merge'](_0x536d64[_0x9ffb('0x3e')],{'$or':_[_0x9ffb('0x2f')](_0x5192a9,function(_0x5789d4){if(_0x5789d4[_0x9ffb('0x3f')]!==_0x9ffb('0x40')){var _0x31763b={};_0x31763b[_0x5789d4[_0x9ffb('0x2c')]]={'$like':'%'+_0x5220a7[_0x9ffb('0x34')][_0x9ffb('0x41')]+'%'};return _0x31763b;}})});}_0x536d64=_['merge']({},_0x536d64,_0x5220a7['options']);var _0x13c71e={'where':_0x536d64[_0x9ffb('0x3e')]};return db[_0x9ffb('0x30')][_0x9ffb('0x23')](_0x13c71e)[_0x9ffb('0x29')](function(_0x37da1d){_0x20dc28[_0x9ffb('0x23')]=_0x37da1d;if(_0x5220a7[_0x9ffb('0x34')][_0x9ffb('0x42')]){_0x536d64['include']=[{'all':!![]}];}return db[_0x9ffb('0x30')][_0x9ffb('0x43')](_0x536d64);})[_0x9ffb('0x29')](function(_0x214418){_0x20dc28[_0x9ffb('0x44')]=_0x214418;return _0x20dc28;})['then'](respondWithFilteredResult(_0x5d2ec3,_0x536d64))['catch'](handleError(_0x5d2ec3,null));};exports[_0x9ffb('0x45')]=function(_0x29e561,_0xe0d119){var _0x21e01b={'raw':![],'where':{'id':_0x29e561[_0x9ffb('0x46')]['id']}},_0x4e5743={};_0x4e5743[_0x9ffb('0x33')]=_[_0x9ffb('0x47')](db['DeskAccount'][_0x9ffb('0x31')]);_0x4e5743[_0x9ffb('0x34')]=_[_0x9ffb('0x47')](_0x29e561['query']);_0x4e5743[_0x9ffb('0x3c')]=_[_0x9ffb('0x35')](_0x4e5743['model'],_0x4e5743['query']);_0x21e01b[_0x9ffb('0x36')]=_[_0x9ffb('0x35')](_0x4e5743[_0x9ffb('0x33')],qs['fields'](_0x29e561[_0x9ffb('0x34')][_0x9ffb('0x37')]));_0x21e01b[_0x9ffb('0x36')]=_0x21e01b[_0x9ffb('0x36')]['length']?_0x21e01b[_0x9ffb('0x36')]:_0x4e5743[_0x9ffb('0x33')];if(_0x29e561[_0x9ffb('0x34')][_0x9ffb('0x42')]){_0x21e01b[_0x9ffb('0x48')]=[{'all':!![]}];}_0x21e01b=_[_0x9ffb('0x49')]({},_0x21e01b,_0x29e561['options']);return db[_0x9ffb('0x30')]['find'](_0x21e01b)['then'](handleEntityNotFound(_0xe0d119,null))[_0x9ffb('0x29')](respondWithResult(_0xe0d119,null))[_0x9ffb('0x4a')](handleError(_0xe0d119,null));};exports['create']=function(_0x13faec,_0x54fc42){return db[_0x9ffb('0x30')][_0x9ffb('0x4b')](_0x13faec[_0x9ffb('0x4c')],{})[_0x9ffb('0x29')](respondWithResult(_0x54fc42,0xc9))[_0x9ffb('0x4a')](handleError(_0x54fc42,null));};exports['update']=function(_0x4efda3,_0x73774e){if(_0x4efda3[_0x9ffb('0x4c')]['id']){delete _0x4efda3[_0x9ffb('0x4c')]['id'];}return db[_0x9ffb('0x30')][_0x9ffb('0x4d')]({'where':{'id':_0x4efda3[_0x9ffb('0x46')]['id']}})[_0x9ffb('0x29')](handleEntityNotFound(_0x73774e,null))[_0x9ffb('0x29')](saveUpdates(_0x4efda3[_0x9ffb('0x4c')],null))['then'](respondWithResult(_0x73774e,null))['catch'](handleError(_0x73774e,null));};exports['destroy']=function(_0x4801b6,_0x597064){return db[_0x9ffb('0x30')][_0x9ffb('0x4d')]({'where':{'id':_0x4801b6[_0x9ffb('0x46')]['id']}})[_0x9ffb('0x29')](handleEntityNotFound(_0x597064,null))[_0x9ffb('0x29')](removeEntity(_0x597064,null))['catch'](handleError(_0x597064,null));};exports[_0x9ffb('0x4e')]=function(_0x3b72b6,_0x8ffd6e,_0x219234){var _0x34d1dc={};var _0x5b7444={};var _0x191eaa;var _0x2abe36;return db[_0x9ffb('0x30')][_0x9ffb('0x4f')]({'where':{'id':_0x3b72b6['params']['id']}})[_0x9ffb('0x29')](handleEntityNotFound(_0x8ffd6e,null))[_0x9ffb('0x29')](function(_0x3407d1){if(_0x3407d1){_0x191eaa=_0x3407d1;_0x5b7444[_0x9ffb('0x33')]=_[_0x9ffb('0x47')](db['DeskConfiguration']['rawAttributes']);_0x5b7444[_0x9ffb('0x34')]=_[_0x9ffb('0x47')](_0x3b72b6[_0x9ffb('0x34')]);_0x5b7444[_0x9ffb('0x3c')]=_['intersection'](_0x5b7444[_0x9ffb('0x33')],_0x5b7444[_0x9ffb('0x34')]);_0x34d1dc[_0x9ffb('0x36')]=_[_0x9ffb('0x35')](_0x5b7444['model'],qs[_0x9ffb('0x37')](_0x3b72b6[_0x9ffb('0x34')][_0x9ffb('0x37')]));_0x34d1dc[_0x9ffb('0x36')]=_0x34d1dc[_0x9ffb('0x36')]['length']?_0x34d1dc[_0x9ffb('0x36')]:_0x5b7444[_0x9ffb('0x33')];_0x34d1dc[_0x9ffb('0x3a')]=qs['sort'](_0x3b72b6['query'][_0x9ffb('0x3b')]);_0x34d1dc[_0x9ffb('0x3e')]=qs[_0x9ffb('0x3c')](_['pick'](_0x3b72b6[_0x9ffb('0x34')],_0x5b7444[_0x9ffb('0x3c')]));if(_0x3b72b6['query']['filter']){_0x34d1dc[_0x9ffb('0x3e')]=_[_0x9ffb('0x49')](_0x34d1dc['where'],{'$or':_[_0x9ffb('0x2f')](_0x34d1dc[_0x9ffb('0x36')],function(_0x5df2bf){var _0x3f784e={};_0x3f784e[_0x5df2bf]={'$like':'%'+_0x3b72b6['query'][_0x9ffb('0x41')]+'%'};return _0x3f784e;})});}_0x34d1dc=_['merge']({},_0x34d1dc,_0x3b72b6[_0x9ffb('0x50')]);return _0x191eaa[_0x9ffb('0x4e')](_0x34d1dc);}})[_0x9ffb('0x29')](function(_0x518bb3){if(_0x518bb3){_0x2abe36=_0x518bb3[_0x9ffb('0x38')];if(!_0x3b72b6[_0x9ffb('0x34')][_0x9ffb('0x51')](_0x9ffb('0x39'))){_0x34d1dc[_0x9ffb('0x22')]=qs[_0x9ffb('0x22')](_0x3b72b6['query'][_0x9ffb('0x22')]);_0x34d1dc[_0x9ffb('0x20')]=qs['offset'](_0x3b72b6[_0x9ffb('0x34')][_0x9ffb('0x20')]);}return _0x191eaa['getConfigurations'](_0x34d1dc);}})['then'](function(_0x49af63){if(_0x49af63){return _0x49af63?{'count':_0x2abe36,'rows':_0x49af63}:null;}})[_0x9ffb('0x29')](respondWithResult(_0x8ffd6e,null))['catch'](handleError(_0x8ffd6e,null));};exports['addConfiguration']=function(_0x2247fd,_0x1fe4d9,_0x848ba){if(_0x2247fd[_0x9ffb('0x4c')]['id']){delete _0x2247fd['body']['id'];}return db[_0x9ffb('0x30')][_0x9ffb('0x4f')]({'where':{'id':_0x2247fd['params']['id']}})['then'](handleEntityNotFound(_0x1fe4d9,null))[_0x9ffb('0x29')](function(_0x2558dc){if(_0x2558dc){_0x2247fd[_0x9ffb('0x4c')][_0x9ffb('0x52')]=_0x2558dc['id'];_0x2247fd[_0x9ffb('0x4c')][_0x9ffb('0x53')]=integrations[_0x9ffb('0x54')](_0x2247fd['body'][_0x9ffb('0x55')],_0x2247fd['body'][_0x9ffb('0x3f')]);_0x2247fd[_0x9ffb('0x4c')][_0x9ffb('0x56')]=integrations[_0x9ffb('0x57')](_0x2247fd[_0x9ffb('0x4c')][_0x9ffb('0x55')],_0x2247fd['body']['type']);return db[_0x9ffb('0x58')][_0x9ffb('0x4b')](_0x2247fd['body'],{'include':[{'model':db[_0x9ffb('0x59')],'as':_0x9ffb('0x53')},{'model':db[_0x9ffb('0x59')],'as':_0x9ffb('0x56')}]});}return null;})['then'](respondWithResult(_0x1fe4d9,null))[_0x9ffb('0x4a')](handleError(_0x1fe4d9,null));};exports['getFields']=function(_0x4826c7,_0x207761,_0x10a9d7){var _0x3b188b=[{'name':_0x9ffb('0x5a'),'label':_0x9ffb('0x5a'),'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 _0x4bcab5='';return db[_0x9ffb('0x30')][_0x9ffb('0x4f')]({'where':{'id':_0x4826c7[_0x9ffb('0x46')]['id']},'attributes':['id',_0x9ffb('0x5b'),'authType',_0x9ffb('0x5c'),'password',_0x9ffb('0x5d'),_0x9ffb('0x5e'),'token',_0x9ffb('0x5f')]})[_0x9ffb('0x29')](handleEntityNotFound(_0x207761,null))[_0x9ffb('0x29')](function(_0x4d3f67){if(_0x4d3f67){_0x4bcab5=_0x4d3f67[_0x9ffb('0x5b')];var _0x5200e6=_0x4bcab5['slice'](-0x1);if(_0x5200e6==='/'){_0x4bcab5=_0x4bcab5[_0x9ffb('0x60')](0x0,_0x4bcab5['lastIndexOf'](_0x5200e6));}var _0x3f9733={'method':_0x9ffb('0x61'),'uri':util[_0x9ffb('0x62')](_0x9ffb('0x63'),_0x4bcab5),'headers':{'Content-Type':_0x9ffb('0x64'),'Accept':_0x9ffb('0x64')},'json':!![]};if(_0x4d3f67[_0x9ffb('0x65')]===_0x9ffb('0x66')){_0x3f9733[_0x9ffb('0x67')][_0x9ffb('0x68')]=util[_0x9ffb('0x62')](_0x9ffb('0x69'),new Buffer(util['format'](_0x9ffb('0x6a'),_0x4d3f67[_0x9ffb('0x5c')],_0x4d3f67['password']))[_0x9ffb('0x6b')](_0x9ffb('0x6c')));}return rp(_0x3f9733)['then'](function(_0x51e7b2){return _0x3b188b[_0x9ffb('0x6d')](_[_0x9ffb('0x2f')](_0x51e7b2['_embedded'][_0x9ffb('0x6e')],function(_0x2b415e){return{'id':_0x2b415e[_0x9ffb('0x2c')],'name':_0x2b415e[_0x9ffb('0x2c')],'type':_0x2b415e['type'],'active':_0x2b415e[_0x9ffb('0x6f')],'label':_0x2b415e[_0x9ffb('0x70')],'custom':!![]};}));});}})['then'](function(_0x1e022c){return{'count':_0x1e022c[_0x9ffb('0x38')],'rows':_0x1e022c};})[_0x9ffb('0x29')](respondWithResult(_0x207761,null))['catch'](function(_0x4a3d13){var _0x52a2c2=_0x4826c7[_0x9ffb('0x34')][_0x9ffb('0x71')]?0x1f4:_0x4a3d13[_0x9ffb('0x72')]||0x1f4;logger[_0x9ffb('0x73')]('getFields,\x20%s,\x20%s,\x20%s',_0x9ffb('0x74'),_0x52a2c2,JSON[_0x9ffb('0x75')](_0x4a3d13));delete _0x4a3d13[_0x9ffb('0x2c')];if(_0x52a2c2===0x191){_0x52a2c2=0x190;}_0x207761['status'](_0x52a2c2)['send'](_0x4826c7[_0x9ffb('0x34')][_0x9ffb('0x71')]?{'message':'Wrong\x20credentials','statusCode':_0x4a3d13[_0x9ffb('0x72')]}:_0x4a3d13);});}; \ No newline at end of file +var _0xf965=['limit','set','Content-Range','apply','save','update','then','error','stack','name','send','index','map','DeskAccount','rawAttributes','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','type','VIRTUAL','options','includeAll','rows','catch','show','params','length','create','body','find','findOne','addConfiguration','AccountId','Subjects','Descriptions','getDescriptions','DeskConfiguration','DeskField','getFields','priority','username','password','consumerKey','consumerSecret','remoteUri','slice','substring','lastIndexOf','%s/custom_fields','application/json','authType','basic','headers','format','%s:%s','toString','base64','concat','_embedded','entries','active','label','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','count'];(function(_0x379998,_0x3c0201){var _0x35194b=function(_0x23cd75){while(--_0x23cd75){_0x379998['push'](_0x379998['shift']());}};_0x35194b(++_0x3c0201);}(_0xf965,0x197));var _0x5f96=function(_0x1944e6,_0x5ef9c2){_0x1944e6=_0x1944e6-0x0;var _0x55e8a3=_0xf965[_0x1944e6];return _0x55e8a3;};'use strict';var emlformat=require(_0x5f96('0x0'));var rimraf=require(_0x5f96('0x1'));var zipdir=require(_0x5f96('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5f96('0x3'));var moment=require(_0x5f96('0x4'));var BPromise=require(_0x5f96('0x5'));var Mustache=require(_0x5f96('0x6'));var util=require(_0x5f96('0x7'));var path=require(_0x5f96('0x8'));var sox=require(_0x5f96('0x9'));var csv=require('to-csv');var ejs=require(_0x5f96('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5f96('0xb'));var squel=require(_0x5f96('0xc'));var crypto=require(_0x5f96('0xd'));var jsforce=require(_0x5f96('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5f96('0xf'));var querystring=require(_0x5f96('0x10'));var Papa=require('papaparse');var Redis=require(_0x5f96('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5f96('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5f96('0x13'));var logger=require('../../config/logger')(_0x5f96('0x14'));var utils=require(_0x5f96('0x15'));var config=require(_0x5f96('0x16'));var licenseUtil=require(_0x5f96('0x17'));var db=require(_0x5f96('0x18'))['db'];var integrations=require(_0x5f96('0x19'));function respondWithStatusCode(_0x989f56,_0xdbdae1){_0xdbdae1=_0xdbdae1||0xcc;return function(_0x38d600){if(_0x38d600){return _0x989f56[_0x5f96('0x1a')](_0xdbdae1);}return _0x989f56['status'](_0xdbdae1)[_0x5f96('0x1b')]();};}function respondWithResult(_0x4a325d,_0x48f3bc){_0x48f3bc=_0x48f3bc||0xc8;return function(_0x2dfca8){if(_0x2dfca8){return _0x4a325d[_0x5f96('0x1c')](_0x48f3bc)[_0x5f96('0x1d')](_0x2dfca8);}};}function respondWithFilteredResult(_0x28c958,_0x4d1670){return function(_0x4e9646){if(_0x4e9646){var _0x26ff6b=typeof _0x4d1670[_0x5f96('0x1e')]==='undefined'&&typeof _0x4d1670['limit']===_0x5f96('0x1f');var _0x44694b=_0x4e9646[_0x5f96('0x20')];var _0x2e469a=_0x26ff6b?0x0:_0x4d1670[_0x5f96('0x1e')];var _0x44dac8=_0x26ff6b?_0x4e9646[_0x5f96('0x20')]:_0x4d1670[_0x5f96('0x1e')]+_0x4d1670[_0x5f96('0x21')];var _0x442d77;if(_0x44dac8>=_0x44694b){_0x44dac8=_0x44694b;_0x442d77=0xc8;}else{_0x442d77=0xce;}_0x28c958[_0x5f96('0x1c')](_0x442d77);return _0x28c958[_0x5f96('0x22')](_0x5f96('0x23'),_0x2e469a+'-'+_0x44dac8+'/'+_0x44694b)['json'](_0x4e9646);}return null;};}function patchUpdates(_0xd48510){return function(_0x352fda){try{jsonpatch[_0x5f96('0x24')](_0x352fda,_0xd48510,!![]);}catch(_0x315cbc){return BPromise['reject'](_0x315cbc);}return _0x352fda[_0x5f96('0x25')]();};}function saveUpdates(_0x324960,_0x455733){return function(_0x57eb11){if(_0x57eb11){return _0x57eb11[_0x5f96('0x26')](_0x324960)[_0x5f96('0x27')](function(_0x15fa55){return _0x15fa55;});}return null;};}function removeEntity(_0x333162,_0x25e2d9){return function(_0x3a7f37){if(_0x3a7f37){return _0x3a7f37['destroy']()[_0x5f96('0x27')](function(){_0x333162[_0x5f96('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x26549e,_0x58a948){return function(_0x572729){if(!_0x572729){_0x26549e[_0x5f96('0x1a')](0x194);}return _0x572729;};}function handleError(_0x59699f,_0x2d4d99){_0x2d4d99=_0x2d4d99||0x1f4;return function(_0x5a7a79){logger[_0x5f96('0x28')](_0x5a7a79[_0x5f96('0x29')]);if(_0x5a7a79[_0x5f96('0x2a')]){delete _0x5a7a79['name'];}_0x59699f[_0x5f96('0x1c')](_0x2d4d99)[_0x5f96('0x2b')](_0x5a7a79);};}exports[_0x5f96('0x2c')]=function(_0x59bd85,_0x900c86){var _0x1dc9d5={},_0x54f8b4={},_0x16a22d={'count':0x0,'rows':[]};var _0x350dba=_[_0x5f96('0x2d')](db[_0x5f96('0x2e')][_0x5f96('0x2f')],function(_0x44c7bd){return{'name':_0x44c7bd['fieldName'],'type':_0x44c7bd['type'][_0x5f96('0x30')]};});_0x54f8b4['model']=_[_0x5f96('0x2d')](_0x350dba,_0x5f96('0x2a'));_0x54f8b4[_0x5f96('0x31')]=_[_0x5f96('0x32')](_0x59bd85[_0x5f96('0x31')]);_0x54f8b4['filters']=_[_0x5f96('0x33')](_0x54f8b4[_0x5f96('0x34')],_0x54f8b4[_0x5f96('0x31')]);_0x1dc9d5[_0x5f96('0x35')]=_[_0x5f96('0x33')](_0x54f8b4[_0x5f96('0x34')],qs[_0x5f96('0x36')](_0x59bd85[_0x5f96('0x31')][_0x5f96('0x36')]));_0x1dc9d5[_0x5f96('0x35')]=_0x1dc9d5[_0x5f96('0x35')]['length']?_0x1dc9d5[_0x5f96('0x35')]:_0x54f8b4['model'];if(!_0x59bd85['query'][_0x5f96('0x37')](_0x5f96('0x38'))){_0x1dc9d5[_0x5f96('0x21')]=qs[_0x5f96('0x21')](_0x59bd85[_0x5f96('0x31')][_0x5f96('0x21')]);_0x1dc9d5[_0x5f96('0x1e')]=qs['offset'](_0x59bd85['query'][_0x5f96('0x1e')]);}_0x1dc9d5[_0x5f96('0x39')]=qs[_0x5f96('0x3a')](_0x59bd85[_0x5f96('0x31')][_0x5f96('0x3a')]);_0x1dc9d5['where']=qs[_0x5f96('0x3b')](_[_0x5f96('0x3c')](_0x59bd85[_0x5f96('0x31')],_0x54f8b4[_0x5f96('0x3b')]),_0x350dba);if(_0x59bd85[_0x5f96('0x31')][_0x5f96('0x3d')]){_0x1dc9d5[_0x5f96('0x3e')]=_[_0x5f96('0x3f')](_0x1dc9d5[_0x5f96('0x3e')],{'$or':_[_0x5f96('0x2d')](_0x350dba,function(_0x2d7ce2){if(_0x2d7ce2[_0x5f96('0x40')]!==_0x5f96('0x41')){var _0x106e02={};_0x106e02[_0x2d7ce2[_0x5f96('0x2a')]]={'$like':'%'+_0x59bd85[_0x5f96('0x31')][_0x5f96('0x3d')]+'%'};return _0x106e02;}})});}_0x1dc9d5=_[_0x5f96('0x3f')]({},_0x1dc9d5,_0x59bd85[_0x5f96('0x42')]);var _0x532973={'where':_0x1dc9d5[_0x5f96('0x3e')]};return db[_0x5f96('0x2e')][_0x5f96('0x20')](_0x532973)[_0x5f96('0x27')](function(_0xe93678){_0x16a22d['count']=_0xe93678;if(_0x59bd85[_0x5f96('0x31')][_0x5f96('0x43')]){_0x1dc9d5['include']=[{'all':!![]}];}return db[_0x5f96('0x2e')]['findAll'](_0x1dc9d5);})[_0x5f96('0x27')](function(_0x4a0512){_0x16a22d[_0x5f96('0x44')]=_0x4a0512;return _0x16a22d;})[_0x5f96('0x27')](respondWithFilteredResult(_0x900c86,_0x1dc9d5))[_0x5f96('0x45')](handleError(_0x900c86,null));};exports[_0x5f96('0x46')]=function(_0x382de4,_0x5b05e6){var _0x29413a={'raw':![],'where':{'id':_0x382de4[_0x5f96('0x47')]['id']}},_0x27c85f={};_0x27c85f['model']=_[_0x5f96('0x32')](db['DeskAccount'][_0x5f96('0x2f')]);_0x27c85f[_0x5f96('0x31')]=_['keys'](_0x382de4['query']);_0x27c85f[_0x5f96('0x3b')]=_[_0x5f96('0x33')](_0x27c85f[_0x5f96('0x34')],_0x27c85f[_0x5f96('0x31')]);_0x29413a[_0x5f96('0x35')]=_[_0x5f96('0x33')](_0x27c85f['model'],qs[_0x5f96('0x36')](_0x382de4[_0x5f96('0x31')][_0x5f96('0x36')]));_0x29413a[_0x5f96('0x35')]=_0x29413a[_0x5f96('0x35')][_0x5f96('0x48')]?_0x29413a[_0x5f96('0x35')]:_0x27c85f[_0x5f96('0x34')];if(_0x382de4['query'][_0x5f96('0x43')]){_0x29413a['include']=[{'all':!![]}];}_0x29413a=_[_0x5f96('0x3f')]({},_0x29413a,_0x382de4['options']);return db[_0x5f96('0x2e')]['find'](_0x29413a)[_0x5f96('0x27')](handleEntityNotFound(_0x5b05e6,null))[_0x5f96('0x27')](respondWithResult(_0x5b05e6,null))['catch'](handleError(_0x5b05e6,null));};exports[_0x5f96('0x49')]=function(_0x2c29f0,_0xfff12e){return db[_0x5f96('0x2e')]['create'](_0x2c29f0['body'],{})[_0x5f96('0x27')](respondWithResult(_0xfff12e,0xc9))[_0x5f96('0x45')](handleError(_0xfff12e,null));};exports[_0x5f96('0x26')]=function(_0x42c582,_0x5b3001){if(_0x42c582[_0x5f96('0x4a')]['id']){delete _0x42c582[_0x5f96('0x4a')]['id'];}return db[_0x5f96('0x2e')][_0x5f96('0x4b')]({'where':{'id':_0x42c582[_0x5f96('0x47')]['id']}})[_0x5f96('0x27')](handleEntityNotFound(_0x5b3001,null))[_0x5f96('0x27')](saveUpdates(_0x42c582[_0x5f96('0x4a')],null))[_0x5f96('0x27')](respondWithResult(_0x5b3001,null))[_0x5f96('0x45')](handleError(_0x5b3001,null));};exports['destroy']=function(_0x40fd07,_0x109b44){return db[_0x5f96('0x2e')][_0x5f96('0x4b')]({'where':{'id':_0x40fd07[_0x5f96('0x47')]['id']}})[_0x5f96('0x27')](handleEntityNotFound(_0x109b44,null))[_0x5f96('0x27')](removeEntity(_0x109b44,null))[_0x5f96('0x45')](handleError(_0x109b44,null));};exports['getConfigurations']=function(_0x274eeb,_0x48a5fc,_0x3f25be){var _0x2515a5={};var _0x55977c={};var _0x15abc7;var _0x16cfd5;return db['DeskAccount'][_0x5f96('0x4c')]({'where':{'id':_0x274eeb[_0x5f96('0x47')]['id']}})[_0x5f96('0x27')](handleEntityNotFound(_0x48a5fc,null))[_0x5f96('0x27')](function(_0x1c5d50){if(_0x1c5d50){_0x15abc7=_0x1c5d50;_0x55977c[_0x5f96('0x34')]=_[_0x5f96('0x32')](db['DeskConfiguration']['rawAttributes']);_0x55977c[_0x5f96('0x31')]=_[_0x5f96('0x32')](_0x274eeb[_0x5f96('0x31')]);_0x55977c[_0x5f96('0x3b')]=_[_0x5f96('0x33')](_0x55977c[_0x5f96('0x34')],_0x55977c[_0x5f96('0x31')]);_0x2515a5[_0x5f96('0x35')]=_[_0x5f96('0x33')](_0x55977c[_0x5f96('0x34')],qs[_0x5f96('0x36')](_0x274eeb[_0x5f96('0x31')][_0x5f96('0x36')]));_0x2515a5['attributes']=_0x2515a5['attributes'][_0x5f96('0x48')]?_0x2515a5[_0x5f96('0x35')]:_0x55977c[_0x5f96('0x34')];_0x2515a5[_0x5f96('0x39')]=qs[_0x5f96('0x3a')](_0x274eeb['query'][_0x5f96('0x3a')]);_0x2515a5[_0x5f96('0x3e')]=qs[_0x5f96('0x3b')](_[_0x5f96('0x3c')](_0x274eeb[_0x5f96('0x31')],_0x55977c[_0x5f96('0x3b')]));if(_0x274eeb[_0x5f96('0x31')][_0x5f96('0x3d')]){_0x2515a5[_0x5f96('0x3e')]=_[_0x5f96('0x3f')](_0x2515a5[_0x5f96('0x3e')],{'$or':_[_0x5f96('0x2d')](_0x2515a5[_0x5f96('0x35')],function(_0xcf947f){var _0x27a1db={};_0x27a1db[_0xcf947f]={'$like':'%'+_0x274eeb[_0x5f96('0x31')][_0x5f96('0x3d')]+'%'};return _0x27a1db;})});}_0x2515a5=_[_0x5f96('0x3f')]({},_0x2515a5,_0x274eeb[_0x5f96('0x42')]);return _0x15abc7['getConfigurations'](_0x2515a5);}})['then'](function(_0x20fd2a){if(_0x20fd2a){_0x16cfd5=_0x20fd2a['length'];if(!_0x274eeb[_0x5f96('0x31')][_0x5f96('0x37')](_0x5f96('0x38'))){_0x2515a5[_0x5f96('0x21')]=qs[_0x5f96('0x21')](_0x274eeb['query'][_0x5f96('0x21')]);_0x2515a5[_0x5f96('0x1e')]=qs[_0x5f96('0x1e')](_0x274eeb['query'][_0x5f96('0x1e')]);}return _0x15abc7['getConfigurations'](_0x2515a5);}})[_0x5f96('0x27')](function(_0x5ed4fa){if(_0x5ed4fa){return _0x5ed4fa?{'count':_0x16cfd5,'rows':_0x5ed4fa}:null;}})['then'](respondWithResult(_0x48a5fc,null))[_0x5f96('0x45')](handleError(_0x48a5fc,null));};exports[_0x5f96('0x4d')]=function(_0x17acf2,_0xa2a054,_0xd1810d){if(_0x17acf2[_0x5f96('0x4a')]['id']){delete _0x17acf2[_0x5f96('0x4a')]['id'];}return db[_0x5f96('0x2e')][_0x5f96('0x4c')]({'where':{'id':_0x17acf2['params']['id']}})[_0x5f96('0x27')](handleEntityNotFound(_0xa2a054,null))[_0x5f96('0x27')](function(_0x311141){if(_0x311141){_0x17acf2['body'][_0x5f96('0x4e')]=_0x311141['id'];_0x17acf2[_0x5f96('0x4a')][_0x5f96('0x4f')]=integrations['getSubjects'](_0x17acf2[_0x5f96('0x4a')]['channel'],_0x17acf2[_0x5f96('0x4a')][_0x5f96('0x40')]);_0x17acf2['body'][_0x5f96('0x50')]=integrations[_0x5f96('0x51')](_0x17acf2['body']['channel'],_0x17acf2[_0x5f96('0x4a')]['type']);return db[_0x5f96('0x52')][_0x5f96('0x49')](_0x17acf2[_0x5f96('0x4a')],{'include':[{'model':db[_0x5f96('0x53')],'as':_0x5f96('0x4f')},{'model':db[_0x5f96('0x53')],'as':_0x5f96('0x50')}]});}return null;})[_0x5f96('0x27')](respondWithResult(_0xa2a054,null))[_0x5f96('0x45')](handleError(_0xa2a054,null));};exports[_0x5f96('0x54')]=function(_0x5e44bc,_0x3a0f54,_0x4dd5c4){var _0x30be42=[{'name':_0x5f96('0x55'),'label':_0x5f96('0x55'),'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 _0x1acdec='';return db[_0x5f96('0x2e')][_0x5f96('0x4c')]({'where':{'id':_0x5e44bc[_0x5f96('0x47')]['id']},'attributes':['id','remoteUri','authType',_0x5f96('0x56'),_0x5f96('0x57'),_0x5f96('0x58'),_0x5f96('0x59'),'token','tokenSecret']})[_0x5f96('0x27')](handleEntityNotFound(_0x3a0f54,null))['then'](function(_0x38d093){if(_0x38d093){_0x1acdec=_0x38d093[_0x5f96('0x5a')];var _0x2633da=_0x1acdec[_0x5f96('0x5b')](-0x1);if(_0x2633da==='/'){_0x1acdec=_0x1acdec[_0x5f96('0x5c')](0x0,_0x1acdec[_0x5f96('0x5d')](_0x2633da));}var _0x391827={'method':'GET','uri':util['format'](_0x5f96('0x5e'),_0x1acdec),'headers':{'Content-Type':_0x5f96('0x5f'),'Accept':_0x5f96('0x5f')},'json':!![]};if(_0x38d093[_0x5f96('0x60')]===_0x5f96('0x61')){_0x391827[_0x5f96('0x62')]['Authorization']=util[_0x5f96('0x63')]('Basic\x20%s',new Buffer(util[_0x5f96('0x63')](_0x5f96('0x64'),_0x38d093[_0x5f96('0x56')],_0x38d093[_0x5f96('0x57')]))[_0x5f96('0x65')](_0x5f96('0x66')));}return rp(_0x391827)['then'](function(_0x5d5912){return _0x30be42[_0x5f96('0x67')](_[_0x5f96('0x2d')](_0x5d5912[_0x5f96('0x68')][_0x5f96('0x69')],function(_0x1fab60){return{'id':_0x1fab60[_0x5f96('0x2a')],'name':_0x1fab60['name'],'type':_0x1fab60[_0x5f96('0x40')],'active':_0x1fab60[_0x5f96('0x6a')],'label':_0x1fab60[_0x5f96('0x6b')],'custom':!![]};}));});}})[_0x5f96('0x27')](function(_0x5a6a05){return{'count':_0x5a6a05['length'],'rows':_0x5a6a05};})[_0x5f96('0x27')](respondWithResult(_0x3a0f54,null))['catch'](function(_0x3dd566){var _0x56bcad=_0x5e44bc[_0x5f96('0x31')][_0x5f96('0x6c')]?0x1f4:_0x3dd566['statusCode']||0x1f4;logger[_0x5f96('0x28')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x56bcad,JSON['stringify'](_0x3dd566));delete _0x3dd566[_0x5f96('0x2a')];if(_0x56bcad===0x191){_0x56bcad=0x190;}_0x3a0f54[_0x5f96('0x1c')](_0x56bcad)[_0x5f96('0x2b')](_0x5e44bc[_0x5f96('0x31')][_0x5f96('0x6c')]?{'message':_0x5f96('0x6d'),'statusCode':_0x3dd566['statusCode']}:_0x3dd566);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 7b2c9cd..d03cefb 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 _0x4fbd=['bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','lodash','util','../../config/logger','moment'];(function(_0x109075,_0x22742a){var _0x15a2af=function(_0xdfecaa){while(--_0xdfecaa){_0x109075['push'](_0x109075['shift']());}};_0x15a2af(++_0x22742a);}(_0x4fbd,0x7e));var _0xd4fb=function(_0xd86eec,_0x2478f0){_0xd86eec=_0xd86eec-0x0;var _0x92f40b=_0x4fbd[_0xd86eec];return _0x92f40b;};'use strict';var _=require(_0xd4fb('0x0'));var util=require(_0xd4fb('0x1'));var logger=require(_0xd4fb('0x2'))('api');var moment=require(_0xd4fb('0x3'));var BPromise=require(_0xd4fb('0x4'));var rp=require(_0xd4fb('0x5'));var fs=require('fs');var path=require(_0xd4fb('0x6'));var rimraf=require(_0xd4fb('0x7'));var config=require(_0xd4fb('0x8'));var attributes=require('./intDeskAccount.attributes');var integrations=require(_0xd4fb('0x9'));module['exports']=function(_0x153a0d,_0x22940c){return _0x153a0d['define']('DeskAccount',attributes,{'tableName':'int_desk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd579=['request-promise','path','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','DeskAccount','lodash','util','api','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd579,0x19f));var _0x9d57=function(_0x3af2f9,_0x4ba3a1){_0x3af2f9=_0x3af2f9-0x0;var _0x294886=_0xd579[_0x3af2f9];return _0x294886;};'use strict';var _=require(_0x9d57('0x0'));var util=require(_0x9d57('0x1'));var logger=require('../../config/logger')(_0x9d57('0x2'));var moment=require(_0x9d57('0x3'));var BPromise=require(_0x9d57('0x4'));var rp=require(_0x9d57('0x5'));var fs=require('fs');var path=require(_0x9d57('0x6'));var rimraf=require(_0x9d57('0x7'));var config=require(_0x9d57('0x8'));var attributes=require(_0x9d57('0x9'));var integrations=require(_0x9d57('0xa'));module[_0x9d57('0xb')]=function(_0x4b85ef,_0x41a418){return _0x4b85ef[_0x9d57('0xc')](_0x9d57('0xd'),attributes,{'tableName':'int_desk_accounts','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 2f38cdf..a2ad1f7 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 _0x13ab=['GetDeskAccount','DeskAccount','findAll','options','raw','where','limit','include','map','model','attributes','stringify','ShowDeskAccount','find','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','DeskAccount,\x20%s,\x20%s','debug','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x13ab,0x7a));var _0xb13a=function(_0x5a7bb0,_0x2cfc98){_0x5a7bb0=_0x5a7bb0-0x0;var _0x4e9ea1=_0x13ab[_0x5a7bb0];return _0x4e9ea1;};'use strict';var _=require(_0xb13a('0x0'));var util=require('util');var moment=require(_0xb13a('0x1'));var BPromise=require(_0xb13a('0x2'));var rs=require(_0xb13a('0x3'));var fs=require('fs');var Redis=require(_0xb13a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb13a('0x5'));var logger=require(_0xb13a('0x6'))(_0xb13a('0x7'));var config=require(_0xb13a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb13a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x7fbfb2,_0x165e7,_0x3fbba7){return new BPromise(function(_0x2942f7,_0x1fcf2b){return client[_0xb13a('0xa')](_0x7fbfb2,_0x3fbba7)[_0xb13a('0xb')](function(_0x4053c0){logger['info'](_0xb13a('0xc'),_0x165e7,'request\x20sent');logger[_0xb13a('0xd')](_0xb13a('0xe'),_0x165e7,_0xb13a('0xf'),JSON['stringify'](_0x4053c0));if(_0x4053c0[_0xb13a('0x10')]){if(_0x4053c0['error'][_0xb13a('0x11')]===0x1f4){logger[_0xb13a('0x10')](_0xb13a('0xc'),_0x165e7,_0x4053c0[_0xb13a('0x10')]['message']);return _0x1fcf2b(_0x4053c0[_0xb13a('0x10')][_0xb13a('0x12')]);}logger['error'](_0xb13a('0xc'),_0x165e7,_0x4053c0[_0xb13a('0x10')]['message']);return _0x2942f7(_0x4053c0[_0xb13a('0x10')]['message']);}else{logger[_0xb13a('0x13')]('DeskAccount,\x20%s,\x20%s',_0x165e7,_0xb13a('0xf'));_0x2942f7(_0x4053c0[_0xb13a('0x14')][_0xb13a('0x12')]);}})[_0xb13a('0x15')](function(_0x1f0cd4){logger[_0xb13a('0x10')](_0xb13a('0xc'),_0x165e7,_0x1f0cd4);_0x1fcf2b(_0x1f0cd4);});});}exports[_0xb13a('0x16')]=function(_0x2fbee){var _0x44b4fb=this;return new Promise(function(_0x10a1fd,_0x47d797){return db[_0xb13a('0x17')][_0xb13a('0x18')]({'raw':_0x2fbee[_0xb13a('0x19')]?_0x2fbee[_0xb13a('0x19')][_0xb13a('0x1a')]===undefined?!![]:![]:!![],'where':_0x2fbee[_0xb13a('0x19')]?_0x2fbee[_0xb13a('0x19')][_0xb13a('0x1b')]||null:null,'attributes':_0x2fbee[_0xb13a('0x19')]?_0x2fbee[_0xb13a('0x19')]['attributes']||null:null,'limit':_0x2fbee[_0xb13a('0x19')]?_0x2fbee[_0xb13a('0x19')][_0xb13a('0x1c')]||null:null,'include':_0x2fbee['options']?_0x2fbee[_0xb13a('0x19')][_0xb13a('0x1d')]?_[_0xb13a('0x1e')](_0x2fbee[_0xb13a('0x19')][_0xb13a('0x1d')],function(_0x57fb67){return{'model':db[_0x57fb67[_0xb13a('0x1f')]],'as':_0x57fb67['as'],'attributes':_0x57fb67[_0xb13a('0x20')],'include':_0x57fb67[_0xb13a('0x1d')]?_[_0xb13a('0x1e')](_0x57fb67[_0xb13a('0x1d')],function(_0xb71422){return{'model':db[_0xb71422[_0xb13a('0x1f')]],'as':_0xb71422['as'],'attributes':_0xb71422[_0xb13a('0x20')],'include':_0xb71422[_0xb13a('0x1d')]?_[_0xb13a('0x1e')](_0xb71422[_0xb13a('0x1d')],function(_0x18196f){return{'model':db[_0x18196f['model']],'as':_0x18196f['as'],'attributes':_0x18196f[_0xb13a('0x20')]};}):[]};}):[]};}):[]:[]})[_0xb13a('0xb')](function(_0x4e0477){logger[_0xb13a('0x13')](_0xb13a('0x16'),_0x2fbee);logger[_0xb13a('0xd')](_0xb13a('0x16'),_0x2fbee,JSON[_0xb13a('0x21')](_0x4e0477));_0x10a1fd(_0x4e0477);})[_0xb13a('0x15')](function(_0x44abec){logger[_0xb13a('0x10')]('GetDeskAccount',_0x44abec['message'],_0x2fbee);_0x47d797(_0x44b4fb[_0xb13a('0x10')](0x1f4,_0x44abec[_0xb13a('0x12')]));});});};exports[_0xb13a('0x22')]=function(_0x24e138){var _0x107576=this;return new Promise(function(_0x8220b3,_0x4773b1){return db[_0xb13a('0x17')][_0xb13a('0x23')]({'raw':_0x24e138[_0xb13a('0x19')]?_0x24e138['options'][_0xb13a('0x1a')]===undefined?!![]:![]:!![],'where':_0x24e138[_0xb13a('0x19')]?_0x24e138[_0xb13a('0x19')][_0xb13a('0x1b')]||null:null,'attributes':_0x24e138[_0xb13a('0x19')]?_0x24e138[_0xb13a('0x19')][_0xb13a('0x20')]||null:null,'include':_0x24e138[_0xb13a('0x19')]?_0x24e138[_0xb13a('0x19')][_0xb13a('0x1d')]?_['map'](_0x24e138[_0xb13a('0x19')]['include'],function(_0x31a0a6){return{'model':db[_0x31a0a6[_0xb13a('0x1f')]],'as':_0x31a0a6['as'],'attributes':_0x31a0a6[_0xb13a('0x20')],'include':_0x31a0a6[_0xb13a('0x1d')]?_[_0xb13a('0x1e')](_0x31a0a6[_0xb13a('0x1d')],function(_0x534f3a){return{'model':db[_0x534f3a[_0xb13a('0x1f')]],'as':_0x534f3a['as'],'attributes':_0x534f3a[_0xb13a('0x20')],'include':_0x534f3a[_0xb13a('0x1d')]?_[_0xb13a('0x1e')](_0x534f3a['include'],function(_0x10332b){return{'model':db[_0x10332b[_0xb13a('0x1f')]],'as':_0x10332b['as'],'attributes':_0x10332b[_0xb13a('0x20')]};}):[]};}):[]};}):[]:[]})[_0xb13a('0xb')](function(_0x2cd64d){logger['info'](_0xb13a('0x22'),_0x24e138);logger[_0xb13a('0xd')](_0xb13a('0x22'),_0x24e138,JSON['stringify'](_0x2cd64d));_0x8220b3(_0x2cd64d);})[_0xb13a('0x15')](function(_0x462acf){logger[_0xb13a('0x10')](_0xb13a('0x22'),_0x462acf[_0xb13a('0x12')],_0x24e138);_0x4773b1(_0x107576[_0xb13a('0x10')](0x1f4,_0x462acf[_0xb13a('0x12')]));});});}; \ No newline at end of file +var _0xd456=['catch','GetDeskAccount','DeskAccount','findAll','options','limit','include','map','model','ShowDeskAccount','find','raw','where','attributes','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','DeskAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0xd456,0x1ae));var _0x6d45=function(_0x34c3bf,_0x5ac388){_0x34c3bf=_0x34c3bf-0x0;var _0x552279=_0xd456[_0x34c3bf];return _0x552279;};'use strict';var _=require(_0x6d45('0x0'));var util=require(_0x6d45('0x1'));var moment=require(_0x6d45('0x2'));var BPromise=require(_0x6d45('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6d45('0x4'))['db'];var utils=require(_0x6d45('0x5'));var logger=require(_0x6d45('0x6'))('rpc');var config=require(_0x6d45('0x7'));var jayson=require(_0x6d45('0x8'));var client=jayson['client'][_0x6d45('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x137de7,_0xe4397f,_0xe1003b){return new BPromise(function(_0x53a346,_0x593775){return client['request'](_0x137de7,_0xe1003b)['then'](function(_0x2af868){logger['info'](_0x6d45('0xa'),_0xe4397f,'request\x20sent');logger[_0x6d45('0xb')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0xe4397f,_0x6d45('0xc'),JSON[_0x6d45('0xd')](_0x2af868));if(_0x2af868[_0x6d45('0xe')]){if(_0x2af868['error'][_0x6d45('0xf')]===0x1f4){logger[_0x6d45('0xe')](_0x6d45('0xa'),_0xe4397f,_0x2af868['error']['message']);return _0x593775(_0x2af868[_0x6d45('0xe')][_0x6d45('0x10')]);}logger[_0x6d45('0xe')](_0x6d45('0xa'),_0xe4397f,_0x2af868[_0x6d45('0xe')]['message']);return _0x53a346(_0x2af868[_0x6d45('0xe')][_0x6d45('0x10')]);}else{logger[_0x6d45('0x11')](_0x6d45('0xa'),_0xe4397f,'request\x20sent');_0x53a346(_0x2af868['result'][_0x6d45('0x10')]);}})[_0x6d45('0x12')](function(_0x245269){logger[_0x6d45('0xe')](_0x6d45('0xa'),_0xe4397f,_0x245269);_0x593775(_0x245269);});});}exports[_0x6d45('0x13')]=function(_0x461c96){var _0x444239=this;return new Promise(function(_0x36b926,_0x2202c0){return db[_0x6d45('0x14')][_0x6d45('0x15')]({'raw':_0x461c96[_0x6d45('0x16')]?_0x461c96[_0x6d45('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x461c96[_0x6d45('0x16')]?_0x461c96['options']['where']||null:null,'attributes':_0x461c96[_0x6d45('0x16')]?_0x461c96[_0x6d45('0x16')]['attributes']||null:null,'limit':_0x461c96[_0x6d45('0x16')]?_0x461c96[_0x6d45('0x16')][_0x6d45('0x17')]||null:null,'include':_0x461c96[_0x6d45('0x16')]?_0x461c96[_0x6d45('0x16')][_0x6d45('0x18')]?_[_0x6d45('0x19')](_0x461c96[_0x6d45('0x16')][_0x6d45('0x18')],function(_0x139c5a){return{'model':db[_0x139c5a['model']],'as':_0x139c5a['as'],'attributes':_0x139c5a['attributes'],'include':_0x139c5a['include']?_[_0x6d45('0x19')](_0x139c5a[_0x6d45('0x18')],function(_0x130a23){return{'model':db[_0x130a23[_0x6d45('0x1a')]],'as':_0x130a23['as'],'attributes':_0x130a23['attributes'],'include':_0x130a23[_0x6d45('0x18')]?_[_0x6d45('0x19')](_0x130a23['include'],function(_0x29deda){return{'model':db[_0x29deda['model']],'as':_0x29deda['as'],'attributes':_0x29deda['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5309ce){logger[_0x6d45('0x11')](_0x6d45('0x13'),_0x461c96);logger['debug'](_0x6d45('0x13'),_0x461c96,JSON[_0x6d45('0xd')](_0x5309ce));_0x36b926(_0x5309ce);})[_0x6d45('0x12')](function(_0x94a93b){logger['error'](_0x6d45('0x13'),_0x94a93b[_0x6d45('0x10')],_0x461c96);_0x2202c0(_0x444239[_0x6d45('0xe')](0x1f4,_0x94a93b['message']));});});};exports[_0x6d45('0x1b')]=function(_0x3813d2){var _0xe03b22=this;return new Promise(function(_0x2f9e74,_0x3f437f){return db[_0x6d45('0x14')][_0x6d45('0x1c')]({'raw':_0x3813d2[_0x6d45('0x16')]?_0x3813d2['options'][_0x6d45('0x1d')]===undefined?!![]:![]:!![],'where':_0x3813d2[_0x6d45('0x16')]?_0x3813d2[_0x6d45('0x16')][_0x6d45('0x1e')]||null:null,'attributes':_0x3813d2[_0x6d45('0x16')]?_0x3813d2[_0x6d45('0x16')]['attributes']||null:null,'include':_0x3813d2[_0x6d45('0x16')]?_0x3813d2[_0x6d45('0x16')][_0x6d45('0x18')]?_[_0x6d45('0x19')](_0x3813d2[_0x6d45('0x16')][_0x6d45('0x18')],function(_0xa2f688){return{'model':db[_0xa2f688['model']],'as':_0xa2f688['as'],'attributes':_0xa2f688[_0x6d45('0x1f')],'include':_0xa2f688[_0x6d45('0x18')]?_['map'](_0xa2f688[_0x6d45('0x18')],function(_0x28e552){return{'model':db[_0x28e552[_0x6d45('0x1a')]],'as':_0x28e552['as'],'attributes':_0x28e552['attributes'],'include':_0x28e552[_0x6d45('0x18')]?_['map'](_0x28e552[_0x6d45('0x18')],function(_0x238911){return{'model':db[_0x238911[_0x6d45('0x1a')]],'as':_0x238911['as'],'attributes':_0x238911[_0x6d45('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x19d2c2){logger[_0x6d45('0x11')]('ShowDeskAccount',_0x3813d2);logger[_0x6d45('0xb')](_0x6d45('0x1b'),_0x3813d2,JSON[_0x6d45('0xd')](_0x19d2c2));_0x2f9e74(_0x19d2c2);})[_0x6d45('0x12')](function(_0x52d01c){logger['error'](_0x6d45('0x1b'),_0x52d01c[_0x6d45('0x10')],_0x3813d2);_0x3f437f(_0xe03b22[_0x6d45('0xe')](0x1f4,_0x52d01c['message']));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index a74e7c7..23f87a5 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 _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(_0x4281f3,_0x51daa2){var _0x1296f8=function(_0x6f286e){while(--_0x6f286e){_0x4281f3['push'](_0x4281f3['shift']());}};_0x1296f8(++_0x51daa2);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'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 +var _0xedd9=['getTags','post','create','setTags','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getSubjects','/:id/descriptions','/:id/tags'];(function(_0x33acd7,_0x171e48){var _0x2829d3=function(_0x4fa44a){while(--_0x4fa44a){_0x33acd7['push'](_0x33acd7['shift']());}};_0x2829d3(++_0x171e48);}(_0xedd9,0xfc));var _0x9edd=function(_0xdf4c42,_0x26befb){_0xdf4c42=_0xdf4c42-0x0;var _0x191e98=_0xedd9[_0xdf4c42];return _0x191e98;};'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');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0x9')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller['getFields']);router[_0x9edd('0x9')]('/:id/subjects',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['get'](_0x9edd('0x10'),auth[_0x9edd('0xa')](),controller['getDescriptions']);router[_0x9edd('0x9')](_0x9edd('0x11'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);router[_0x9edd('0x13')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0x14')]);router[_0x9edd('0x13')]('/:id/tags',auth[_0x9edd('0xa')](),controller[_0x9edd('0x15')]);router[_0x9edd('0x16')](_0x9edd('0xc'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x17')]);router[_0x9edd('0x18')](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x19')]);module[_0x9edd('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 88b0d24..c2ee560 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 _0xb7f3=['STRING','sequelize'];(function(_0x108831,_0x5e4f70){var _0x4da77a=function(_0x139446){while(--_0x139446){_0x108831['push'](_0x108831['shift']());}};_0x4da77a(++_0x5e4f70);}(_0xb7f3,0x107));var _0x3b7f=function(_0x1797e5,_0x679f29){_0x1797e5=_0x1797e5-0x0;var _0x1e8ee3=_0xb7f3[_0x1797e5];return _0x1e8ee3;};'use strict';var Sequelize=require(_0x3b7f('0x0'));module['exports']={'name':{'type':Sequelize[_0x3b7f('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x771a=['STRING','sequelize','exports'];(function(_0x1aaf6b,_0x49d401){var _0x11a796=function(_0x34c667){while(--_0x34c667){_0x1aaf6b['push'](_0x1aaf6b['shift']());}};_0x11a796(++_0x49d401);}(_0x771a,0x18d));var _0xa771=function(_0x2aecb2,_0x343312){_0x2aecb2=_0x2aecb2-0x0;var _0x3ebb80=_0x771a[_0x2aecb2];return _0x3ebb80;};'use strict';var Sequelize=require(_0xa771('0x0'));module[_0xa771('0x1')]={'name':{'type':Sequelize[_0xa771('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index c4c4196..787d037 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 _0xb677=['order','sort','where','pick','filter','merge','VIRTUAL','DeskConfiguration','count','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','getFields','findOne','DeskField','hasOwnProperty','getSubjects','options','getDescriptions','getTags','Tag','setTags','ids','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','name','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0xb677,0xc9));var _0x7b67=function(_0x5b0456,_0x39bd8d){_0x5b0456=_0x5b0456-0x0;var _0x591a22=_0xb677[_0x5b0456];return _0x591a22;};'use strict';var emlformat=require(_0x7b67('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7b67('0x1'));var jsonpatch=require(_0x7b67('0x2'));var rp=require(_0x7b67('0x3'));var moment=require('moment');var BPromise=require(_0x7b67('0x4'));var Mustache=require(_0x7b67('0x5'));var util=require(_0x7b67('0x6'));var path=require(_0x7b67('0x7'));var sox=require(_0x7b67('0x8'));var csv=require(_0x7b67('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7b67('0xa'));var _=require('lodash');var squel=require(_0x7b67('0xb'));var crypto=require(_0x7b67('0xc'));var jsforce=require(_0x7b67('0xd'));var deskjs=require(_0x7b67('0xe'));var toCsv=require(_0x7b67('0x9'));var querystring=require('querystring');var Papa=require(_0x7b67('0xf'));var Redis=require(_0x7b67('0x10'));var authService=require(_0x7b67('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x7b67('0x12'));var hardwareService=require(_0x7b67('0x13'));var logger=require(_0x7b67('0x14'))('api');var utils=require(_0x7b67('0x15'));var config=require(_0x7b67('0x16'));var licenseUtil=require(_0x7b67('0x17'));var db=require(_0x7b67('0x18'))['db'];function respondWithStatusCode(_0x51afbd,_0x3eb33c){_0x3eb33c=_0x3eb33c||0xcc;return function(_0x8c8033){if(_0x8c8033){return _0x51afbd[_0x7b67('0x19')](_0x3eb33c);}return _0x51afbd[_0x7b67('0x1a')](_0x3eb33c)[_0x7b67('0x1b')]();};}function respondWithResult(_0x2f3b9a,_0x2ba2ee){_0x2ba2ee=_0x2ba2ee||0xc8;return function(_0x4d506b){if(_0x4d506b){return _0x2f3b9a[_0x7b67('0x1a')](_0x2ba2ee)[_0x7b67('0x1c')](_0x4d506b);}};}function respondWithFilteredResult(_0x396cb1,_0x39cbc5){return function(_0x5ee79b){if(_0x5ee79b){var _0x102ff9=typeof _0x39cbc5[_0x7b67('0x1d')]===_0x7b67('0x1e')&&typeof _0x39cbc5[_0x7b67('0x1f')]==='undefined';var _0x3d204c=_0x5ee79b['count'];var _0x102b8c=_0x102ff9?0x0:_0x39cbc5[_0x7b67('0x1d')];var _0x146f0b=_0x102ff9?_0x5ee79b['count']:_0x39cbc5[_0x7b67('0x1d')]+_0x39cbc5[_0x7b67('0x1f')];var _0x2e04a9;if(_0x146f0b>=_0x3d204c){_0x146f0b=_0x3d204c;_0x2e04a9=0xc8;}else{_0x2e04a9=0xce;}_0x396cb1[_0x7b67('0x1a')](_0x2e04a9);return _0x396cb1[_0x7b67('0x20')](_0x7b67('0x21'),_0x102b8c+'-'+_0x146f0b+'/'+_0x3d204c)[_0x7b67('0x1c')](_0x5ee79b);}return null;};}function patchUpdates(_0x979d71){return function(_0x35c001){try{jsonpatch[_0x7b67('0x22')](_0x35c001,_0x979d71,!![]);}catch(_0x59cb6a){return BPromise[_0x7b67('0x23')](_0x59cb6a);}return _0x35c001[_0x7b67('0x24')]();};}function saveUpdates(_0x375b50,_0x384f06){return function(_0x53d0ec){if(_0x53d0ec){return _0x53d0ec[_0x7b67('0x25')](_0x375b50)[_0x7b67('0x26')](function(_0x2074f3){return _0x2074f3;});}return null;};}function removeEntity(_0x19f959,_0x44c92b){return function(_0x204da6){if(_0x204da6){return _0x204da6[_0x7b67('0x27')]()[_0x7b67('0x26')](function(){_0x19f959[_0x7b67('0x1a')](0xcc)[_0x7b67('0x1b')]();});}};}function handleEntityNotFound(_0x35c73f,_0x10c52c){return function(_0xe1050f){if(!_0xe1050f){_0x35c73f['sendStatus'](0x194);}return _0xe1050f;};}function handleError(_0x26e342,_0x1ab2f5){_0x1ab2f5=_0x1ab2f5||0x1f4;return function(_0x2dd3f7){logger['error'](_0x2dd3f7['stack']);if(_0x2dd3f7[_0x7b67('0x28')]){delete _0x2dd3f7[_0x7b67('0x28')];}_0x26e342[_0x7b67('0x1a')](_0x1ab2f5)['send'](_0x2dd3f7);};}exports['index']=function(_0x2953d0,_0x3e42e6){var _0x5e34da={},_0x4f43fc={},_0x27456b={'count':0x0,'rows':[]};var _0x5366d5=_[_0x7b67('0x29')](db['DeskConfiguration']['rawAttributes'],function(_0x3633ac){return{'name':_0x3633ac[_0x7b67('0x2a')],'type':_0x3633ac[_0x7b67('0x2b')][_0x7b67('0x2c')]};});_0x4f43fc[_0x7b67('0x2d')]=_[_0x7b67('0x29')](_0x5366d5,'name');_0x4f43fc[_0x7b67('0x2e')]=_[_0x7b67('0x2f')](_0x2953d0[_0x7b67('0x2e')]);_0x4f43fc[_0x7b67('0x30')]=_[_0x7b67('0x31')](_0x4f43fc[_0x7b67('0x2d')],_0x4f43fc[_0x7b67('0x2e')]);_0x5e34da[_0x7b67('0x32')]=_[_0x7b67('0x31')](_0x4f43fc['model'],qs[_0x7b67('0x33')](_0x2953d0[_0x7b67('0x2e')][_0x7b67('0x33')]));_0x5e34da[_0x7b67('0x32')]=_0x5e34da[_0x7b67('0x32')][_0x7b67('0x34')]?_0x5e34da[_0x7b67('0x32')]:_0x4f43fc[_0x7b67('0x2d')];if(!_0x2953d0[_0x7b67('0x2e')]['hasOwnProperty'](_0x7b67('0x35'))){_0x5e34da[_0x7b67('0x1f')]=qs['limit'](_0x2953d0[_0x7b67('0x2e')][_0x7b67('0x1f')]);_0x5e34da[_0x7b67('0x1d')]=qs['offset'](_0x2953d0['query'][_0x7b67('0x1d')]);}_0x5e34da[_0x7b67('0x36')]=qs[_0x7b67('0x37')](_0x2953d0[_0x7b67('0x2e')][_0x7b67('0x37')]);_0x5e34da[_0x7b67('0x38')]=qs[_0x7b67('0x30')](_[_0x7b67('0x39')](_0x2953d0[_0x7b67('0x2e')],_0x4f43fc['filters']),_0x5366d5);if(_0x2953d0['query'][_0x7b67('0x3a')]){_0x5e34da[_0x7b67('0x38')]=_[_0x7b67('0x3b')](_0x5e34da[_0x7b67('0x38')],{'$or':_[_0x7b67('0x29')](_0x5366d5,function(_0x3795b5){if(_0x3795b5['type']!==_0x7b67('0x3c')){var _0x5c54c9={};_0x5c54c9[_0x3795b5['name']]={'$like':'%'+_0x2953d0[_0x7b67('0x2e')][_0x7b67('0x3a')]+'%'};return _0x5c54c9;}})});}_0x5e34da=_[_0x7b67('0x3b')]({},_0x5e34da,_0x2953d0['options']);var _0x519a23={'where':_0x5e34da[_0x7b67('0x38')]};return db[_0x7b67('0x3d')][_0x7b67('0x3e')](_0x519a23)[_0x7b67('0x26')](function(_0x250bf1){_0x27456b[_0x7b67('0x3e')]=_0x250bf1;if(_0x2953d0[_0x7b67('0x2e')][_0x7b67('0x3f')]){_0x5e34da[_0x7b67('0x40')]=[{'all':!![]}];}return db['DeskConfiguration'][_0x7b67('0x41')](_0x5e34da);})[_0x7b67('0x26')](function(_0x2eaeff){_0x27456b[_0x7b67('0x42')]=_0x2eaeff;return _0x27456b;})[_0x7b67('0x26')](respondWithFilteredResult(_0x3e42e6,_0x5e34da))['catch'](handleError(_0x3e42e6,null));};exports[_0x7b67('0x43')]=function(_0x22f771,_0x25cb59){var _0x27d2e0={'raw':![],'where':{'id':_0x22f771[_0x7b67('0x44')]['id']}},_0x5beec6={};_0x5beec6[_0x7b67('0x2d')]=_[_0x7b67('0x2f')](db[_0x7b67('0x3d')][_0x7b67('0x45')]);_0x5beec6[_0x7b67('0x2e')]=_['keys'](_0x22f771[_0x7b67('0x2e')]);_0x5beec6['filters']=_['intersection'](_0x5beec6[_0x7b67('0x2d')],_0x5beec6[_0x7b67('0x2e')]);_0x27d2e0[_0x7b67('0x32')]=_[_0x7b67('0x31')](_0x5beec6[_0x7b67('0x2d')],qs[_0x7b67('0x33')](_0x22f771['query'][_0x7b67('0x33')]));_0x27d2e0[_0x7b67('0x32')]=_0x27d2e0[_0x7b67('0x32')][_0x7b67('0x34')]?_0x27d2e0['attributes']:_0x5beec6[_0x7b67('0x2d')];if(_0x22f771[_0x7b67('0x2e')][_0x7b67('0x3f')]){_0x27d2e0['include']=[{'all':!![]}];}_0x27d2e0=_[_0x7b67('0x3b')]({},_0x27d2e0,_0x22f771['options']);return db[_0x7b67('0x3d')][_0x7b67('0x46')](_0x27d2e0)['then'](handleEntityNotFound(_0x25cb59,null))['then'](respondWithResult(_0x25cb59,null))[_0x7b67('0x47')](handleError(_0x25cb59,null));};exports['create']=function(_0x484ce3,_0x35eb76){return db['DeskConfiguration'][_0x7b67('0x48')](_0x484ce3[_0x7b67('0x49')],{})[_0x7b67('0x26')](respondWithResult(_0x35eb76,0xc9))[_0x7b67('0x47')](handleError(_0x35eb76,null));};exports[_0x7b67('0x25')]=function(_0x5b6cf3,_0x44ae7e){if(_0x5b6cf3[_0x7b67('0x49')]['id']){delete _0x5b6cf3['body']['id'];}return db[_0x7b67('0x3d')][_0x7b67('0x46')]({'where':{'id':_0x5b6cf3[_0x7b67('0x44')]['id']}})[_0x7b67('0x26')](handleEntityNotFound(_0x44ae7e,null))['then'](saveUpdates(_0x5b6cf3[_0x7b67('0x49')],null))[_0x7b67('0x26')](respondWithResult(_0x44ae7e,null))[_0x7b67('0x47')](handleError(_0x44ae7e,null));};exports[_0x7b67('0x27')]=function(_0x3e20da,_0x33352b){return db['DeskConfiguration'][_0x7b67('0x46')]({'where':{'id':_0x3e20da[_0x7b67('0x44')]['id']}})[_0x7b67('0x26')](handleEntityNotFound(_0x33352b,null))[_0x7b67('0x26')](removeEntity(_0x33352b,null))['catch'](handleError(_0x33352b,null));};exports[_0x7b67('0x4a')]=function(_0x1df255,_0x38ac63,_0x45a247){var _0x4769d7={};var _0x3c3d76={};var _0x25b293;var _0x3c9821;return db[_0x7b67('0x3d')][_0x7b67('0x4b')]({'where':{'id':_0x1df255[_0x7b67('0x44')]['id']}})[_0x7b67('0x26')](handleEntityNotFound(_0x38ac63,null))[_0x7b67('0x26')](function(_0x296d6e){if(_0x296d6e){_0x25b293=_0x296d6e;_0x3c3d76[_0x7b67('0x2d')]=_[_0x7b67('0x2f')](db[_0x7b67('0x4c')][_0x7b67('0x45')]);_0x3c3d76['query']=_['keys'](_0x1df255[_0x7b67('0x2e')]);_0x3c3d76[_0x7b67('0x30')]=_['intersection'](_0x3c3d76[_0x7b67('0x2d')],_0x3c3d76[_0x7b67('0x2e')]);_0x4769d7[_0x7b67('0x32')]=_['intersection'](_0x3c3d76['model'],qs[_0x7b67('0x33')](_0x1df255[_0x7b67('0x2e')]['fields']));_0x4769d7['attributes']=_0x4769d7[_0x7b67('0x32')][_0x7b67('0x34')]?_0x4769d7[_0x7b67('0x32')]:_0x3c3d76[_0x7b67('0x2d')];_0x4769d7[_0x7b67('0x36')]=qs[_0x7b67('0x37')](_0x1df255[_0x7b67('0x2e')][_0x7b67('0x37')]);_0x4769d7[_0x7b67('0x38')]=qs['filters'](_[_0x7b67('0x39')](_0x1df255[_0x7b67('0x2e')],_0x3c3d76[_0x7b67('0x30')]));if(_0x1df255[_0x7b67('0x2e')]['filter']){_0x4769d7['where']=_[_0x7b67('0x3b')](_0x4769d7['where'],{'$or':_[_0x7b67('0x29')](_0x4769d7[_0x7b67('0x32')],function(_0xf4e518){var _0x4e2984={};_0x4e2984[_0xf4e518]={'$like':'%'+_0x1df255[_0x7b67('0x2e')][_0x7b67('0x3a')]+'%'};return _0x4e2984;})});}_0x4769d7=_['merge']({},_0x4769d7,_0x1df255['options']);return _0x25b293[_0x7b67('0x4a')](_0x4769d7);}})[_0x7b67('0x26')](function(_0x4f005f){if(_0x4f005f){_0x3c9821=_0x4f005f[_0x7b67('0x34')];if(!_0x1df255[_0x7b67('0x2e')][_0x7b67('0x4d')](_0x7b67('0x35'))){_0x4769d7[_0x7b67('0x1f')]=qs[_0x7b67('0x1f')](_0x1df255[_0x7b67('0x2e')][_0x7b67('0x1f')]);_0x4769d7[_0x7b67('0x1d')]=qs['offset'](_0x1df255[_0x7b67('0x2e')][_0x7b67('0x1d')]);}return _0x25b293['getFields'](_0x4769d7);}})[_0x7b67('0x26')](function(_0x624e00){if(_0x624e00){return _0x624e00?{'count':_0x3c9821,'rows':_0x624e00}:null;}})[_0x7b67('0x26')](respondWithResult(_0x38ac63,null))[_0x7b67('0x47')](handleError(_0x38ac63,null));};exports[_0x7b67('0x4e')]=function(_0x176768,_0x5e806f,_0x4de24c){var _0x3b6ca4={};var _0x1e918b={};var _0x207cb6;var _0x3dadca;return db['DeskConfiguration'][_0x7b67('0x4b')]({'where':{'id':_0x176768['params']['id']}})[_0x7b67('0x26')](handleEntityNotFound(_0x5e806f,null))[_0x7b67('0x26')](function(_0x1d32e6){if(_0x1d32e6){_0x207cb6=_0x1d32e6;_0x1e918b['model']=_[_0x7b67('0x2f')](db[_0x7b67('0x4c')]['rawAttributes']);_0x1e918b[_0x7b67('0x2e')]=_[_0x7b67('0x2f')](_0x176768[_0x7b67('0x2e')]);_0x1e918b[_0x7b67('0x30')]=_[_0x7b67('0x31')](_0x1e918b[_0x7b67('0x2d')],_0x1e918b[_0x7b67('0x2e')]);_0x3b6ca4[_0x7b67('0x32')]=_[_0x7b67('0x31')](_0x1e918b[_0x7b67('0x2d')],qs[_0x7b67('0x33')](_0x176768['query'][_0x7b67('0x33')]));_0x3b6ca4[_0x7b67('0x32')]=_0x3b6ca4[_0x7b67('0x32')][_0x7b67('0x34')]?_0x3b6ca4[_0x7b67('0x32')]:_0x1e918b[_0x7b67('0x2d')];_0x3b6ca4[_0x7b67('0x36')]=qs[_0x7b67('0x37')](_0x176768['query'][_0x7b67('0x37')]);_0x3b6ca4[_0x7b67('0x38')]=qs[_0x7b67('0x30')](_['pick'](_0x176768[_0x7b67('0x2e')],_0x1e918b[_0x7b67('0x30')]));if(_0x176768[_0x7b67('0x2e')][_0x7b67('0x3a')]){_0x3b6ca4[_0x7b67('0x38')]=_[_0x7b67('0x3b')](_0x3b6ca4[_0x7b67('0x38')],{'$or':_[_0x7b67('0x29')](_0x3b6ca4[_0x7b67('0x32')],function(_0x57c6e5){var _0x1ead83={};_0x1ead83[_0x57c6e5]={'$like':'%'+_0x176768[_0x7b67('0x2e')][_0x7b67('0x3a')]+'%'};return _0x1ead83;})});}_0x3b6ca4=_[_0x7b67('0x3b')]({},_0x3b6ca4,_0x176768[_0x7b67('0x4f')]);return _0x207cb6[_0x7b67('0x4e')](_0x3b6ca4);}})['then'](function(_0x1c8e4e){if(_0x1c8e4e){_0x3dadca=_0x1c8e4e['length'];if(!_0x176768[_0x7b67('0x2e')][_0x7b67('0x4d')](_0x7b67('0x35'))){_0x3b6ca4[_0x7b67('0x1f')]=qs[_0x7b67('0x1f')](_0x176768[_0x7b67('0x2e')]['limit']);_0x3b6ca4[_0x7b67('0x1d')]=qs[_0x7b67('0x1d')](_0x176768[_0x7b67('0x2e')]['offset']);}return _0x207cb6[_0x7b67('0x4e')](_0x3b6ca4);}})['then'](function(_0x334917){if(_0x334917){return _0x334917?{'count':_0x3dadca,'rows':_0x334917}:null;}})[_0x7b67('0x26')](respondWithResult(_0x5e806f,null))[_0x7b67('0x47')](handleError(_0x5e806f,null));};exports[_0x7b67('0x50')]=function(_0x2e436a,_0x13053c,_0x556b56){var _0x3d0e39={};var _0x565fd6={};var _0x2eaa24;var _0x528175;return db['DeskConfiguration']['findOne']({'where':{'id':_0x2e436a['params']['id']}})[_0x7b67('0x26')](handleEntityNotFound(_0x13053c,null))['then'](function(_0x324aa7){if(_0x324aa7){_0x2eaa24=_0x324aa7;_0x565fd6[_0x7b67('0x2d')]=_['keys'](db[_0x7b67('0x4c')]['rawAttributes']);_0x565fd6[_0x7b67('0x2e')]=_[_0x7b67('0x2f')](_0x2e436a['query']);_0x565fd6[_0x7b67('0x30')]=_[_0x7b67('0x31')](_0x565fd6[_0x7b67('0x2d')],_0x565fd6[_0x7b67('0x2e')]);_0x3d0e39[_0x7b67('0x32')]=_[_0x7b67('0x31')](_0x565fd6['model'],qs[_0x7b67('0x33')](_0x2e436a[_0x7b67('0x2e')]['fields']));_0x3d0e39[_0x7b67('0x32')]=_0x3d0e39[_0x7b67('0x32')][_0x7b67('0x34')]?_0x3d0e39[_0x7b67('0x32')]:_0x565fd6[_0x7b67('0x2d')];_0x3d0e39['order']=qs[_0x7b67('0x37')](_0x2e436a['query'][_0x7b67('0x37')]);_0x3d0e39['where']=qs[_0x7b67('0x30')](_['pick'](_0x2e436a['query'],_0x565fd6[_0x7b67('0x30')]));if(_0x2e436a[_0x7b67('0x2e')][_0x7b67('0x3a')]){_0x3d0e39['where']=_[_0x7b67('0x3b')](_0x3d0e39['where'],{'$or':_[_0x7b67('0x29')](_0x3d0e39[_0x7b67('0x32')],function(_0x3358d0){var _0x47d52a={};_0x47d52a[_0x3358d0]={'$like':'%'+_0x2e436a[_0x7b67('0x2e')][_0x7b67('0x3a')]+'%'};return _0x47d52a;})});}_0x3d0e39=_[_0x7b67('0x3b')]({},_0x3d0e39,_0x2e436a[_0x7b67('0x4f')]);return _0x2eaa24['getDescriptions'](_0x3d0e39);}})[_0x7b67('0x26')](function(_0x1d882a){if(_0x1d882a){_0x528175=_0x1d882a[_0x7b67('0x34')];if(!_0x2e436a[_0x7b67('0x2e')][_0x7b67('0x4d')](_0x7b67('0x35'))){_0x3d0e39[_0x7b67('0x1f')]=qs[_0x7b67('0x1f')](_0x2e436a[_0x7b67('0x2e')][_0x7b67('0x1f')]);_0x3d0e39['offset']=qs[_0x7b67('0x1d')](_0x2e436a[_0x7b67('0x2e')][_0x7b67('0x1d')]);}return _0x2eaa24['getDescriptions'](_0x3d0e39);}})[_0x7b67('0x26')](function(_0x4c1211){if(_0x4c1211){return _0x4c1211?{'count':_0x528175,'rows':_0x4c1211}:null;}})[_0x7b67('0x26')](respondWithResult(_0x13053c,null))[_0x7b67('0x47')](handleError(_0x13053c,null));};exports[_0x7b67('0x51')]=function(_0x13e77a,_0x5e4e2a,_0x1c6542){var _0x33825a={};var _0x40c284={};var _0x1787ac;var _0x48897a;return db[_0x7b67('0x3d')][_0x7b67('0x4b')]({'where':{'id':_0x13e77a[_0x7b67('0x44')]['id']}})[_0x7b67('0x26')](handleEntityNotFound(_0x5e4e2a,null))[_0x7b67('0x26')](function(_0x1f51f1){if(_0x1f51f1){_0x1787ac=_0x1f51f1;_0x40c284[_0x7b67('0x2d')]=_[_0x7b67('0x2f')](db[_0x7b67('0x52')]['rawAttributes']);_0x40c284['query']=_[_0x7b67('0x2f')](_0x13e77a[_0x7b67('0x2e')]);_0x40c284[_0x7b67('0x30')]=_[_0x7b67('0x31')](_0x40c284[_0x7b67('0x2d')],_0x40c284[_0x7b67('0x2e')]);_0x33825a[_0x7b67('0x32')]=_[_0x7b67('0x31')](_0x40c284[_0x7b67('0x2d')],qs[_0x7b67('0x33')](_0x13e77a[_0x7b67('0x2e')][_0x7b67('0x33')]));_0x33825a[_0x7b67('0x32')]=_0x33825a[_0x7b67('0x32')][_0x7b67('0x34')]?_0x33825a['attributes']:_0x40c284[_0x7b67('0x2d')];_0x33825a[_0x7b67('0x36')]=qs['sort'](_0x13e77a[_0x7b67('0x2e')][_0x7b67('0x37')]);_0x33825a['where']=qs['filters'](_['pick'](_0x13e77a['query'],_0x40c284[_0x7b67('0x30')]));if(_0x13e77a['query']['filter']){_0x33825a[_0x7b67('0x38')]=_[_0x7b67('0x3b')](_0x33825a['where'],{'$or':_[_0x7b67('0x29')](_0x33825a[_0x7b67('0x32')],function(_0x193419){var _0x302104={};_0x302104[_0x193419]={'$like':'%'+_0x13e77a[_0x7b67('0x2e')][_0x7b67('0x3a')]+'%'};return _0x302104;})});}_0x33825a=_[_0x7b67('0x3b')]({},_0x33825a,_0x13e77a['options']);return _0x1787ac[_0x7b67('0x51')](_0x33825a);}})['then'](function(_0x33546a){if(_0x33546a){_0x48897a=_0x33546a[_0x7b67('0x34')];if(!_0x13e77a['query'][_0x7b67('0x4d')]('nolimit')){_0x33825a[_0x7b67('0x1f')]=qs[_0x7b67('0x1f')](_0x13e77a[_0x7b67('0x2e')][_0x7b67('0x1f')]);_0x33825a[_0x7b67('0x1d')]=qs[_0x7b67('0x1d')](_0x13e77a[_0x7b67('0x2e')][_0x7b67('0x1d')]);}return _0x1787ac[_0x7b67('0x51')](_0x33825a);}})[_0x7b67('0x26')](function(_0x4e2ab1){if(_0x4e2ab1){return _0x4e2ab1?{'count':_0x48897a,'rows':_0x4e2ab1}:null;}})[_0x7b67('0x26')](respondWithResult(_0x5e4e2a,null))[_0x7b67('0x47')](handleError(_0x5e4e2a,null));};exports[_0x7b67('0x53')]=function(_0x564f91,_0x22bf19,_0x511fee){if(_0x564f91['body']['id']){delete _0x564f91[_0x7b67('0x49')]['id'];}return db[_0x7b67('0x3d')]['findOne']({'where':{'id':_0x564f91['params']['id']}})[_0x7b67('0x26')](handleEntityNotFound(_0x22bf19,null))['then'](function(_0xa9cb5f){if(_0xa9cb5f){return _0xa9cb5f[_0x7b67('0x53')](_0x564f91[_0x7b67('0x49')][_0x7b67('0x54')]||[]);}return null;})['then'](respondWithResult(_0x22bf19,null))[_0x7b67('0x47')](handleError(_0x22bf19,null));}; \ No newline at end of file +var _0x0f25=['setTags','eml-format','rimraf','fast-json-patch','moment','util','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../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','limit','undefined','count','set','Content-Range','reject','save','then','destroy','sendStatus','name','index','map','DeskConfiguration','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','update','getFields','findOne','DeskField','getSubjects','getDescriptions','getTags'];(function(_0x2e5e73,_0x30d4d9){var _0x4cf641=function(_0x26b1b6){while(--_0x26b1b6){_0x2e5e73['push'](_0x2e5e73['shift']());}};_0x4cf641(++_0x30d4d9);}(_0x0f25,0x9d));var _0x50f2=function(_0x4816c4,_0x33a92a){_0x4816c4=_0x4816c4-0x0;var _0x5cabb1=_0x0f25[_0x4816c4];return _0x5cabb1;};'use strict';var emlformat=require(_0x50f2('0x0'));var rimraf=require(_0x50f2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x50f2('0x2'));var rp=require('request-promise');var moment=require(_0x50f2('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x50f2('0x4'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x50f2('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x50f2('0x6'));var crypto=require(_0x50f2('0x7'));var jsforce=require(_0x50f2('0x8'));var deskjs=require(_0x50f2('0x9'));var toCsv=require(_0x50f2('0xa'));var querystring=require('querystring');var Papa=require(_0x50f2('0xb'));var Redis=require('ioredis');var authService=require(_0x50f2('0xc'));var qs=require(_0x50f2('0xd'));var as=require(_0x50f2('0xe'));var hardwareService=require(_0x50f2('0xf'));var logger=require(_0x50f2('0x10'))('api');var utils=require(_0x50f2('0x11'));var config=require(_0x50f2('0x12'));var licenseUtil=require(_0x50f2('0x13'));var db=require(_0x50f2('0x14'))['db'];function respondWithStatusCode(_0x31124e,_0x135074){_0x135074=_0x135074||0xcc;return function(_0x209131){if(_0x209131){return _0x31124e['sendStatus'](_0x135074);}return _0x31124e[_0x50f2('0x15')](_0x135074)[_0x50f2('0x16')]();};}function respondWithResult(_0x8a83e7,_0x19cb4a){_0x19cb4a=_0x19cb4a||0xc8;return function(_0x3de040){if(_0x3de040){return _0x8a83e7[_0x50f2('0x15')](_0x19cb4a)[_0x50f2('0x17')](_0x3de040);}};}function respondWithFilteredResult(_0x315e4b,_0x4765a4){return function(_0x5f1a79){if(_0x5f1a79){var _0x2be71d=typeof _0x4765a4[_0x50f2('0x18')]==='undefined'&&typeof _0x4765a4[_0x50f2('0x19')]===_0x50f2('0x1a');var _0x59a577=_0x5f1a79['count'];var _0x81d39c=_0x2be71d?0x0:_0x4765a4[_0x50f2('0x18')];var _0x5157ae=_0x2be71d?_0x5f1a79[_0x50f2('0x1b')]:_0x4765a4['offset']+_0x4765a4[_0x50f2('0x19')];var _0x230960;if(_0x5157ae>=_0x59a577){_0x5157ae=_0x59a577;_0x230960=0xc8;}else{_0x230960=0xce;}_0x315e4b[_0x50f2('0x15')](_0x230960);return _0x315e4b[_0x50f2('0x1c')](_0x50f2('0x1d'),_0x81d39c+'-'+_0x5157ae+'/'+_0x59a577)['json'](_0x5f1a79);}return null;};}function patchUpdates(_0x9b2dc7){return function(_0x33e57e){try{jsonpatch['apply'](_0x33e57e,_0x9b2dc7,!![]);}catch(_0x14deb3){return BPromise[_0x50f2('0x1e')](_0x14deb3);}return _0x33e57e[_0x50f2('0x1f')]();};}function saveUpdates(_0x47cb3c,_0x30a836){return function(_0x596cc6){if(_0x596cc6){return _0x596cc6['update'](_0x47cb3c)[_0x50f2('0x20')](function(_0x40db01){return _0x40db01;});}return null;};}function removeEntity(_0x2aef2a,_0x371c4f){return function(_0x5bd9c2){if(_0x5bd9c2){return _0x5bd9c2[_0x50f2('0x21')]()[_0x50f2('0x20')](function(){_0x2aef2a[_0x50f2('0x15')](0xcc)[_0x50f2('0x16')]();});}};}function handleEntityNotFound(_0x10916f,_0x8f5f78){return function(_0x42c2bc){if(!_0x42c2bc){_0x10916f[_0x50f2('0x22')](0x194);}return _0x42c2bc;};}function handleError(_0x4db325,_0x108e3a){_0x108e3a=_0x108e3a||0x1f4;return function(_0x1f5d18){logger['error'](_0x1f5d18['stack']);if(_0x1f5d18[_0x50f2('0x23')]){delete _0x1f5d18[_0x50f2('0x23')];}_0x4db325[_0x50f2('0x15')](_0x108e3a)['send'](_0x1f5d18);};}exports[_0x50f2('0x24')]=function(_0x3858e6,_0x1b4f0f){var _0x32f65e={},_0xb81fd={},_0x23e646={'count':0x0,'rows':[]};var _0x30b6b0=_[_0x50f2('0x25')](db[_0x50f2('0x26')][_0x50f2('0x27')],function(_0x1dbd5d){return{'name':_0x1dbd5d[_0x50f2('0x28')],'type':_0x1dbd5d['type'][_0x50f2('0x29')]};});_0xb81fd[_0x50f2('0x2a')]=_[_0x50f2('0x25')](_0x30b6b0,_0x50f2('0x23'));_0xb81fd[_0x50f2('0x2b')]=_[_0x50f2('0x2c')](_0x3858e6['query']);_0xb81fd[_0x50f2('0x2d')]=_[_0x50f2('0x2e')](_0xb81fd[_0x50f2('0x2a')],_0xb81fd['query']);_0x32f65e[_0x50f2('0x2f')]=_[_0x50f2('0x2e')](_0xb81fd['model'],qs[_0x50f2('0x30')](_0x3858e6['query'][_0x50f2('0x30')]));_0x32f65e[_0x50f2('0x2f')]=_0x32f65e[_0x50f2('0x2f')][_0x50f2('0x31')]?_0x32f65e[_0x50f2('0x2f')]:_0xb81fd[_0x50f2('0x2a')];if(!_0x3858e6[_0x50f2('0x2b')][_0x50f2('0x32')](_0x50f2('0x33'))){_0x32f65e[_0x50f2('0x19')]=qs[_0x50f2('0x19')](_0x3858e6['query'][_0x50f2('0x19')]);_0x32f65e['offset']=qs['offset'](_0x3858e6[_0x50f2('0x2b')]['offset']);}_0x32f65e[_0x50f2('0x34')]=qs[_0x50f2('0x35')](_0x3858e6[_0x50f2('0x2b')]['sort']);_0x32f65e['where']=qs['filters'](_[_0x50f2('0x36')](_0x3858e6[_0x50f2('0x2b')],_0xb81fd[_0x50f2('0x2d')]),_0x30b6b0);if(_0x3858e6['query'][_0x50f2('0x37')]){_0x32f65e[_0x50f2('0x38')]=_[_0x50f2('0x39')](_0x32f65e['where'],{'$or':_[_0x50f2('0x25')](_0x30b6b0,function(_0x31558b){if(_0x31558b['type']!==_0x50f2('0x3a')){var _0x148827={};_0x148827[_0x31558b[_0x50f2('0x23')]]={'$like':'%'+_0x3858e6[_0x50f2('0x2b')][_0x50f2('0x37')]+'%'};return _0x148827;}})});}_0x32f65e=_[_0x50f2('0x39')]({},_0x32f65e,_0x3858e6[_0x50f2('0x3b')]);var _0x264bf9={'where':_0x32f65e['where']};return db[_0x50f2('0x26')][_0x50f2('0x1b')](_0x264bf9)[_0x50f2('0x20')](function(_0x4da711){_0x23e646['count']=_0x4da711;if(_0x3858e6[_0x50f2('0x2b')][_0x50f2('0x3c')]){_0x32f65e[_0x50f2('0x3d')]=[{'all':!![]}];}return db[_0x50f2('0x26')][_0x50f2('0x3e')](_0x32f65e);})[_0x50f2('0x20')](function(_0x1dc7b2){_0x23e646[_0x50f2('0x3f')]=_0x1dc7b2;return _0x23e646;})['then'](respondWithFilteredResult(_0x1b4f0f,_0x32f65e))['catch'](handleError(_0x1b4f0f,null));};exports[_0x50f2('0x40')]=function(_0xcac8f0,_0x116da9){var _0x3a5df3={'raw':![],'where':{'id':_0xcac8f0[_0x50f2('0x41')]['id']}},_0x46b5b4={};_0x46b5b4[_0x50f2('0x2a')]=_[_0x50f2('0x2c')](db[_0x50f2('0x26')][_0x50f2('0x27')]);_0x46b5b4[_0x50f2('0x2b')]=_[_0x50f2('0x2c')](_0xcac8f0['query']);_0x46b5b4['filters']=_['intersection'](_0x46b5b4[_0x50f2('0x2a')],_0x46b5b4[_0x50f2('0x2b')]);_0x3a5df3[_0x50f2('0x2f')]=_[_0x50f2('0x2e')](_0x46b5b4[_0x50f2('0x2a')],qs[_0x50f2('0x30')](_0xcac8f0[_0x50f2('0x2b')][_0x50f2('0x30')]));_0x3a5df3[_0x50f2('0x2f')]=_0x3a5df3[_0x50f2('0x2f')][_0x50f2('0x31')]?_0x3a5df3['attributes']:_0x46b5b4['model'];if(_0xcac8f0[_0x50f2('0x2b')][_0x50f2('0x3c')]){_0x3a5df3['include']=[{'all':!![]}];}_0x3a5df3=_['merge']({},_0x3a5df3,_0xcac8f0[_0x50f2('0x3b')]);return db['DeskConfiguration'][_0x50f2('0x42')](_0x3a5df3)[_0x50f2('0x20')](handleEntityNotFound(_0x116da9,null))[_0x50f2('0x20')](respondWithResult(_0x116da9,null))[_0x50f2('0x43')](handleError(_0x116da9,null));};exports[_0x50f2('0x44')]=function(_0x2bdae7,_0x1ba936){return db[_0x50f2('0x26')][_0x50f2('0x44')](_0x2bdae7[_0x50f2('0x45')],{})[_0x50f2('0x20')](respondWithResult(_0x1ba936,0xc9))['catch'](handleError(_0x1ba936,null));};exports[_0x50f2('0x46')]=function(_0x10d7de,_0x7a06a){if(_0x10d7de['body']['id']){delete _0x10d7de[_0x50f2('0x45')]['id'];}return db['DeskConfiguration'][_0x50f2('0x42')]({'where':{'id':_0x10d7de[_0x50f2('0x41')]['id']}})['then'](handleEntityNotFound(_0x7a06a,null))['then'](saveUpdates(_0x10d7de[_0x50f2('0x45')],null))[_0x50f2('0x20')](respondWithResult(_0x7a06a,null))[_0x50f2('0x43')](handleError(_0x7a06a,null));};exports[_0x50f2('0x21')]=function(_0x151abd,_0x3d4bb8){return db[_0x50f2('0x26')]['find']({'where':{'id':_0x151abd[_0x50f2('0x41')]['id']}})['then'](handleEntityNotFound(_0x3d4bb8,null))[_0x50f2('0x20')](removeEntity(_0x3d4bb8,null))[_0x50f2('0x43')](handleError(_0x3d4bb8,null));};exports[_0x50f2('0x47')]=function(_0x3afce8,_0x233d22,_0x1435b9){var _0x1cd823={};var _0x2a7b7a={};var _0x5a6b76;var _0x439ebd;return db[_0x50f2('0x26')][_0x50f2('0x48')]({'where':{'id':_0x3afce8['params']['id']}})[_0x50f2('0x20')](handleEntityNotFound(_0x233d22,null))[_0x50f2('0x20')](function(_0x588d74){if(_0x588d74){_0x5a6b76=_0x588d74;_0x2a7b7a[_0x50f2('0x2a')]=_[_0x50f2('0x2c')](db[_0x50f2('0x49')][_0x50f2('0x27')]);_0x2a7b7a[_0x50f2('0x2b')]=_[_0x50f2('0x2c')](_0x3afce8['query']);_0x2a7b7a[_0x50f2('0x2d')]=_[_0x50f2('0x2e')](_0x2a7b7a[_0x50f2('0x2a')],_0x2a7b7a[_0x50f2('0x2b')]);_0x1cd823[_0x50f2('0x2f')]=_[_0x50f2('0x2e')](_0x2a7b7a['model'],qs[_0x50f2('0x30')](_0x3afce8[_0x50f2('0x2b')]['fields']));_0x1cd823[_0x50f2('0x2f')]=_0x1cd823['attributes'][_0x50f2('0x31')]?_0x1cd823[_0x50f2('0x2f')]:_0x2a7b7a[_0x50f2('0x2a')];_0x1cd823[_0x50f2('0x34')]=qs[_0x50f2('0x35')](_0x3afce8['query'][_0x50f2('0x35')]);_0x1cd823[_0x50f2('0x38')]=qs['filters'](_[_0x50f2('0x36')](_0x3afce8[_0x50f2('0x2b')],_0x2a7b7a['filters']));if(_0x3afce8[_0x50f2('0x2b')]['filter']){_0x1cd823['where']=_[_0x50f2('0x39')](_0x1cd823[_0x50f2('0x38')],{'$or':_[_0x50f2('0x25')](_0x1cd823['attributes'],function(_0x1d7b1e){var _0x5dd833={};_0x5dd833[_0x1d7b1e]={'$like':'%'+_0x3afce8[_0x50f2('0x2b')]['filter']+'%'};return _0x5dd833;})});}_0x1cd823=_[_0x50f2('0x39')]({},_0x1cd823,_0x3afce8[_0x50f2('0x3b')]);return _0x5a6b76[_0x50f2('0x47')](_0x1cd823);}})[_0x50f2('0x20')](function(_0x5de8eb){if(_0x5de8eb){_0x439ebd=_0x5de8eb[_0x50f2('0x31')];if(!_0x3afce8[_0x50f2('0x2b')][_0x50f2('0x32')](_0x50f2('0x33'))){_0x1cd823[_0x50f2('0x19')]=qs[_0x50f2('0x19')](_0x3afce8[_0x50f2('0x2b')][_0x50f2('0x19')]);_0x1cd823[_0x50f2('0x18')]=qs[_0x50f2('0x18')](_0x3afce8[_0x50f2('0x2b')][_0x50f2('0x18')]);}return _0x5a6b76[_0x50f2('0x47')](_0x1cd823);}})[_0x50f2('0x20')](function(_0x3c53ef){if(_0x3c53ef){return _0x3c53ef?{'count':_0x439ebd,'rows':_0x3c53ef}:null;}})[_0x50f2('0x20')](respondWithResult(_0x233d22,null))[_0x50f2('0x43')](handleError(_0x233d22,null));};exports[_0x50f2('0x4a')]=function(_0xceac84,_0x5d96f0,_0x2d799b){var _0x406cef={};var _0x7f4be4={};var _0x15206c;var _0x2adf79;return db[_0x50f2('0x26')]['findOne']({'where':{'id':_0xceac84[_0x50f2('0x41')]['id']}})[_0x50f2('0x20')](handleEntityNotFound(_0x5d96f0,null))[_0x50f2('0x20')](function(_0x3fb979){if(_0x3fb979){_0x15206c=_0x3fb979;_0x7f4be4[_0x50f2('0x2a')]=_[_0x50f2('0x2c')](db[_0x50f2('0x49')]['rawAttributes']);_0x7f4be4[_0x50f2('0x2b')]=_['keys'](_0xceac84[_0x50f2('0x2b')]);_0x7f4be4[_0x50f2('0x2d')]=_[_0x50f2('0x2e')](_0x7f4be4['model'],_0x7f4be4['query']);_0x406cef[_0x50f2('0x2f')]=_['intersection'](_0x7f4be4[_0x50f2('0x2a')],qs[_0x50f2('0x30')](_0xceac84[_0x50f2('0x2b')][_0x50f2('0x30')]));_0x406cef[_0x50f2('0x2f')]=_0x406cef[_0x50f2('0x2f')][_0x50f2('0x31')]?_0x406cef[_0x50f2('0x2f')]:_0x7f4be4[_0x50f2('0x2a')];_0x406cef[_0x50f2('0x34')]=qs[_0x50f2('0x35')](_0xceac84[_0x50f2('0x2b')][_0x50f2('0x35')]);_0x406cef['where']=qs['filters'](_['pick'](_0xceac84[_0x50f2('0x2b')],_0x7f4be4['filters']));if(_0xceac84['query'][_0x50f2('0x37')]){_0x406cef[_0x50f2('0x38')]=_['merge'](_0x406cef[_0x50f2('0x38')],{'$or':_[_0x50f2('0x25')](_0x406cef[_0x50f2('0x2f')],function(_0x1fc097){var _0x56e211={};_0x56e211[_0x1fc097]={'$like':'%'+_0xceac84[_0x50f2('0x2b')][_0x50f2('0x37')]+'%'};return _0x56e211;})});}_0x406cef=_[_0x50f2('0x39')]({},_0x406cef,_0xceac84['options']);return _0x15206c[_0x50f2('0x4a')](_0x406cef);}})[_0x50f2('0x20')](function(_0x5e59c6){if(_0x5e59c6){_0x2adf79=_0x5e59c6[_0x50f2('0x31')];if(!_0xceac84['query'][_0x50f2('0x32')](_0x50f2('0x33'))){_0x406cef['limit']=qs[_0x50f2('0x19')](_0xceac84[_0x50f2('0x2b')][_0x50f2('0x19')]);_0x406cef[_0x50f2('0x18')]=qs[_0x50f2('0x18')](_0xceac84[_0x50f2('0x2b')][_0x50f2('0x18')]);}return _0x15206c[_0x50f2('0x4a')](_0x406cef);}})[_0x50f2('0x20')](function(_0x1007c9){if(_0x1007c9){return _0x1007c9?{'count':_0x2adf79,'rows':_0x1007c9}:null;}})['then'](respondWithResult(_0x5d96f0,null))[_0x50f2('0x43')](handleError(_0x5d96f0,null));};exports[_0x50f2('0x4b')]=function(_0x12cccb,_0x132bbe,_0x3ad857){var _0x276e40={};var _0x39024b={};var _0x24c0b8;var _0x26ef83;return db[_0x50f2('0x26')][_0x50f2('0x48')]({'where':{'id':_0x12cccb[_0x50f2('0x41')]['id']}})['then'](handleEntityNotFound(_0x132bbe,null))[_0x50f2('0x20')](function(_0x154076){if(_0x154076){_0x24c0b8=_0x154076;_0x39024b[_0x50f2('0x2a')]=_[_0x50f2('0x2c')](db['DeskField']['rawAttributes']);_0x39024b[_0x50f2('0x2b')]=_[_0x50f2('0x2c')](_0x12cccb[_0x50f2('0x2b')]);_0x39024b['filters']=_[_0x50f2('0x2e')](_0x39024b['model'],_0x39024b[_0x50f2('0x2b')]);_0x276e40['attributes']=_[_0x50f2('0x2e')](_0x39024b[_0x50f2('0x2a')],qs[_0x50f2('0x30')](_0x12cccb['query'][_0x50f2('0x30')]));_0x276e40[_0x50f2('0x2f')]=_0x276e40[_0x50f2('0x2f')][_0x50f2('0x31')]?_0x276e40['attributes']:_0x39024b[_0x50f2('0x2a')];_0x276e40[_0x50f2('0x34')]=qs['sort'](_0x12cccb['query'][_0x50f2('0x35')]);_0x276e40[_0x50f2('0x38')]=qs[_0x50f2('0x2d')](_[_0x50f2('0x36')](_0x12cccb['query'],_0x39024b[_0x50f2('0x2d')]));if(_0x12cccb[_0x50f2('0x2b')]['filter']){_0x276e40['where']=_[_0x50f2('0x39')](_0x276e40[_0x50f2('0x38')],{'$or':_[_0x50f2('0x25')](_0x276e40[_0x50f2('0x2f')],function(_0x109c42){var _0x1fdf03={};_0x1fdf03[_0x109c42]={'$like':'%'+_0x12cccb[_0x50f2('0x2b')]['filter']+'%'};return _0x1fdf03;})});}_0x276e40=_[_0x50f2('0x39')]({},_0x276e40,_0x12cccb['options']);return _0x24c0b8[_0x50f2('0x4b')](_0x276e40);}})[_0x50f2('0x20')](function(_0xbfdfa2){if(_0xbfdfa2){_0x26ef83=_0xbfdfa2['length'];if(!_0x12cccb['query'][_0x50f2('0x32')]('nolimit')){_0x276e40[_0x50f2('0x19')]=qs[_0x50f2('0x19')](_0x12cccb[_0x50f2('0x2b')][_0x50f2('0x19')]);_0x276e40['offset']=qs['offset'](_0x12cccb['query'][_0x50f2('0x18')]);}return _0x24c0b8[_0x50f2('0x4b')](_0x276e40);}})[_0x50f2('0x20')](function(_0x139860){if(_0x139860){return _0x139860?{'count':_0x26ef83,'rows':_0x139860}:null;}})[_0x50f2('0x20')](respondWithResult(_0x132bbe,null))[_0x50f2('0x43')](handleError(_0x132bbe,null));};exports['getTags']=function(_0x1bca25,_0xcc06d9,_0x436ac4){var _0x27611a={};var _0x1c25df={};var _0x413569;var _0x54cd33;return db[_0x50f2('0x26')]['findOne']({'where':{'id':_0x1bca25['params']['id']}})[_0x50f2('0x20')](handleEntityNotFound(_0xcc06d9,null))[_0x50f2('0x20')](function(_0xcf51c1){if(_0xcf51c1){_0x413569=_0xcf51c1;_0x1c25df[_0x50f2('0x2a')]=_[_0x50f2('0x2c')](db['Tag'][_0x50f2('0x27')]);_0x1c25df['query']=_[_0x50f2('0x2c')](_0x1bca25['query']);_0x1c25df[_0x50f2('0x2d')]=_[_0x50f2('0x2e')](_0x1c25df[_0x50f2('0x2a')],_0x1c25df[_0x50f2('0x2b')]);_0x27611a['attributes']=_['intersection'](_0x1c25df[_0x50f2('0x2a')],qs[_0x50f2('0x30')](_0x1bca25[_0x50f2('0x2b')][_0x50f2('0x30')]));_0x27611a['attributes']=_0x27611a[_0x50f2('0x2f')][_0x50f2('0x31')]?_0x27611a[_0x50f2('0x2f')]:_0x1c25df['model'];_0x27611a[_0x50f2('0x34')]=qs[_0x50f2('0x35')](_0x1bca25[_0x50f2('0x2b')][_0x50f2('0x35')]);_0x27611a[_0x50f2('0x38')]=qs[_0x50f2('0x2d')](_[_0x50f2('0x36')](_0x1bca25[_0x50f2('0x2b')],_0x1c25df['filters']));if(_0x1bca25[_0x50f2('0x2b')][_0x50f2('0x37')]){_0x27611a[_0x50f2('0x38')]=_[_0x50f2('0x39')](_0x27611a[_0x50f2('0x38')],{'$or':_['map'](_0x27611a[_0x50f2('0x2f')],function(_0x13c05c){var _0x13ba27={};_0x13ba27[_0x13c05c]={'$like':'%'+_0x1bca25['query']['filter']+'%'};return _0x13ba27;})});}_0x27611a=_[_0x50f2('0x39')]({},_0x27611a,_0x1bca25[_0x50f2('0x3b')]);return _0x413569[_0x50f2('0x4c')](_0x27611a);}})[_0x50f2('0x20')](function(_0x22dd69){if(_0x22dd69){_0x54cd33=_0x22dd69[_0x50f2('0x31')];if(!_0x1bca25[_0x50f2('0x2b')][_0x50f2('0x32')]('nolimit')){_0x27611a[_0x50f2('0x19')]=qs[_0x50f2('0x19')](_0x1bca25[_0x50f2('0x2b')][_0x50f2('0x19')]);_0x27611a[_0x50f2('0x18')]=qs[_0x50f2('0x18')](_0x1bca25[_0x50f2('0x2b')][_0x50f2('0x18')]);}return _0x413569[_0x50f2('0x4c')](_0x27611a);}})[_0x50f2('0x20')](function(_0x2fdc92){if(_0x2fdc92){return _0x2fdc92?{'count':_0x54cd33,'rows':_0x2fdc92}:null;}})[_0x50f2('0x20')](respondWithResult(_0xcc06d9,null))['catch'](handleError(_0xcc06d9,null));};exports['setTags']=function(_0x38fc51,_0x3c1978,_0x3e1cfa){if(_0x38fc51[_0x50f2('0x45')]['id']){delete _0x38fc51[_0x50f2('0x45')]['id'];}return db[_0x50f2('0x26')][_0x50f2('0x48')]({'where':{'id':_0x38fc51[_0x50f2('0x41')]['id']}})[_0x50f2('0x20')](handleEntityNotFound(_0x3c1978,null))[_0x50f2('0x20')](function(_0x440786){if(_0x440786){return _0x440786[_0x50f2('0x4d')](_0x38fc51[_0x50f2('0x45')]['ids']||[]);}return null;})[_0x50f2('0x20')](respondWithResult(_0x3c1978,null))['catch'](handleError(_0x3c1978,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 58ed3f8..0cf3787 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 _0xdf8b=['define','DeskConfiguration','int_desk_configurations','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports'];(function(_0x594cfc,_0x1fb259){var _0x3df210=function(_0x55de22){while(--_0x55de22){_0x594cfc['push'](_0x594cfc['shift']());}};_0x3df210(++_0x1fb259);}(_0xdf8b,0x6b));var _0xbdf8=function(_0x469eba,_0x39471c){_0x469eba=_0x469eba-0x0;var _0x355f69=_0xdf8b[_0x469eba];return _0x355f69;};'use strict';var _=require('lodash');var util=require(_0xbdf8('0x0'));var logger=require('../../config/logger')(_0xbdf8('0x1'));var moment=require(_0xbdf8('0x2'));var BPromise=require(_0xbdf8('0x3'));var rp=require(_0xbdf8('0x4'));var fs=require('fs');var path=require(_0xbdf8('0x5'));var rimraf=require(_0xbdf8('0x6'));var config=require(_0xbdf8('0x7'));var attributes=require(_0xbdf8('0x8'));module[_0xbdf8('0x9')]=function(_0x25780e,_0x2fea77){return _0x25780e[_0xbdf8('0xa')](_0xbdf8('0xb'),attributes,{'tableName':_0xbdf8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc1f0=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','define','int_desk_configurations'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0xc1f0,0x1ad));var _0x0c1f=function(_0x27d883,_0x2169b4){_0x27d883=_0x27d883-0x0;var _0x54d989=_0xc1f0[_0x27d883];return _0x54d989;};'use strict';var _=require(_0x0c1f('0x0'));var util=require(_0x0c1f('0x1'));var logger=require(_0x0c1f('0x2'))(_0x0c1f('0x3'));var moment=require(_0x0c1f('0x4'));var BPromise=require(_0x0c1f('0x5'));var rp=require(_0x0c1f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0c1f('0x7'));var config=require(_0x0c1f('0x8'));var attributes=require(_0x0c1f('0x9'));module[_0x0c1f('0xa')]=function(_0x5d8483,_0x312c01){return _0x5d8483[_0x0c1f('0xb')]('DeskConfiguration',attributes,{'tableName':_0x0c1f('0xc'),'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 411f9ac..a8e673f 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 _0xa412=['DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','info'];(function(_0x510b98,_0x4c4cbb){var _0x45e775=function(_0x29ec11){while(--_0x29ec11){_0x510b98['push'](_0x510b98['shift']());}};_0x45e775(++_0x4c4cbb);}(_0xa412,0x127));var _0x2a41=function(_0x1d4b50,_0x2d07d3){_0x1d4b50=_0x1d4b50-0x0;var _0x1ce436=_0xa412[_0x1d4b50];return _0x1ce436;};'use strict';var _=require(_0x2a41('0x0'));var util=require(_0x2a41('0x1'));var moment=require(_0x2a41('0x2'));var BPromise=require(_0x2a41('0x3'));var rs=require(_0x2a41('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2a41('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2a41('0x6'))(_0x2a41('0x7'));var config=require('../../config/environment');var jayson=require(_0x2a41('0x8'));var client=jayson[_0x2a41('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3fb2a5,_0x3c3620,_0x32af58){return new BPromise(function(_0x4d481f,_0x355027){return client[_0x2a41('0xa')](_0x3fb2a5,_0x32af58)[_0x2a41('0xb')](function(_0x21d1f1){logger[_0x2a41('0xc')](_0x2a41('0xd'),_0x3c3620,_0x2a41('0xe'));logger[_0x2a41('0xf')](_0x2a41('0x10'),_0x3c3620,_0x2a41('0xe'),JSON['stringify'](_0x21d1f1));if(_0x21d1f1[_0x2a41('0x11')]){if(_0x21d1f1[_0x2a41('0x11')][_0x2a41('0x12')]===0x1f4){logger[_0x2a41('0x11')](_0x2a41('0xd'),_0x3c3620,_0x21d1f1['error']['message']);return _0x355027(_0x21d1f1[_0x2a41('0x11')][_0x2a41('0x13')]);}logger[_0x2a41('0x11')](_0x2a41('0xd'),_0x3c3620,_0x21d1f1[_0x2a41('0x11')][_0x2a41('0x13')]);return _0x4d481f(_0x21d1f1[_0x2a41('0x11')]['message']);}else{logger[_0x2a41('0xc')]('DeskConfiguration,\x20%s,\x20%s',_0x3c3620,_0x2a41('0xe'));_0x4d481f(_0x21d1f1[_0x2a41('0x14')]['message']);}})[_0x2a41('0x15')](function(_0x147f46){logger['error'](_0x2a41('0xd'),_0x3c3620,_0x147f46);_0x355027(_0x147f46);});});} \ No newline at end of file +var _0x0ac0=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','randomstring'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x0ac0,0x130));var _0x00ac=function(_0x4e6eb2,_0x16a451){_0x4e6eb2=_0x4e6eb2-0x0;var _0x4e0c1c=_0x0ac0[_0x4e6eb2];return _0x4e0c1c;};'use strict';var _=require(_0x00ac('0x0'));var util=require(_0x00ac('0x1'));var moment=require(_0x00ac('0x2'));var BPromise=require('bluebird');var rs=require(_0x00ac('0x3'));var fs=require('fs');var Redis=require(_0x00ac('0x4'));var db=require(_0x00ac('0x5'))['db'];var utils=require(_0x00ac('0x6'));var logger=require(_0x00ac('0x7'))(_0x00ac('0x8'));var config=require(_0x00ac('0x9'));var jayson=require(_0x00ac('0xa'));var client=jayson['client'][_0x00ac('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xa2a17e,_0x3546f0,_0x282faa){return new BPromise(function(_0x4427de,_0x121a9e){return client[_0x00ac('0xc')](_0xa2a17e,_0x282faa)['then'](function(_0x48c47e){logger[_0x00ac('0xd')](_0x00ac('0xe'),_0x3546f0,_0x00ac('0xf'));logger[_0x00ac('0x10')](_0x00ac('0x11'),_0x3546f0,'request\x20sent',JSON[_0x00ac('0x12')](_0x48c47e));if(_0x48c47e['error']){if(_0x48c47e[_0x00ac('0x13')]['code']===0x1f4){logger[_0x00ac('0x13')](_0x00ac('0xe'),_0x3546f0,_0x48c47e[_0x00ac('0x13')][_0x00ac('0x14')]);return _0x121a9e(_0x48c47e['error']['message']);}logger[_0x00ac('0x13')]('DeskConfiguration,\x20%s,\x20%s',_0x3546f0,_0x48c47e['error'][_0x00ac('0x14')]);return _0x4427de(_0x48c47e[_0x00ac('0x13')]['message']);}else{logger[_0x00ac('0xd')]('DeskConfiguration,\x20%s,\x20%s',_0x3546f0,'request\x20sent');_0x4427de(_0x48c47e[_0x00ac('0x15')][_0x00ac('0x14')]);}})['catch'](function(_0x66e4ba){logger[_0x00ac('0x13')](_0x00ac('0xe'),_0x3546f0,_0x66e4ba);_0x121a9e(_0x66e4ba);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 9a4de94..01e8468 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 _0x2895=['../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','post','create','put','update','exports','multer','util','path','express','Router','fs-extra'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2895,0x82));var _0x5289=function(_0x5bb097,_0x246a46){_0x5bb097=_0x5bb097-0x0;var _0x326348=_0x2895[_0x5bb097];return _0x326348;};'use strict';var multer=require(_0x5289('0x0'));var util=require(_0x5289('0x1'));var path=require(_0x5289('0x2'));var timeout=require('connect-timeout');var express=require(_0x5289('0x3'));var router=express[_0x5289('0x4')]();var fs_extra=require(_0x5289('0x5'));var auth=require(_0x5289('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5289('0x7'));var controller=require('./intDeskField.controller');router[_0x5289('0x8')]('/',auth[_0x5289('0x9')](),controller[_0x5289('0xa')]);router[_0x5289('0x8')](_0x5289('0xb'),auth[_0x5289('0x9')](),controller['show']);router[_0x5289('0xc')]('/',auth[_0x5289('0x9')](),controller[_0x5289('0xd')]);router[_0x5289('0xe')](_0x5289('0xb'),auth[_0x5289('0x9')](),controller[_0x5289('0xf')]);router['delete'](_0x5289('0xb'),auth[_0x5289('0x9')](),controller['destroy']);module[_0x5289('0x10')]=router; \ No newline at end of file +var _0x84c6=['index','/:id','show','create','update','delete','destroy','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','isAuthenticated'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x84c6,0xe7));var _0x684c=function(_0x13682e,_0x431f67){_0x13682e=_0x13682e-0x0;var _0x244503=_0x84c6[_0x13682e];return _0x244503;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x684c('0x0'));var timeout=require(_0x684c('0x1'));var express=require(_0x684c('0x2'));var router=express['Router']();var fs_extra=require(_0x684c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x684c('0x4'));var config=require(_0x684c('0x5'));var controller=require(_0x684c('0x6'));router[_0x684c('0x7')]('/',auth[_0x684c('0x8')](),controller[_0x684c('0x9')]);router[_0x684c('0x7')](_0x684c('0xa'),auth[_0x684c('0x8')](),controller[_0x684c('0xb')]);router['post']('/',auth[_0x684c('0x8')](),controller[_0x684c('0xc')]);router['put'](_0x684c('0xa'),auth['isAuthenticated'](),controller[_0x684c('0xd')]);router[_0x684c('0xe')](_0x684c('0xa'),auth[_0x684c('0x8')](),controller[_0x684c('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index b3133b0..988e6aa 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 _0xf040=['ENUM','string','variable','keyValue','picklist','STRING','customVariable','BOOLEAN','exports'];(function(_0x58f4d1,_0x370178){var _0x45a984=function(_0x458ad6){while(--_0x458ad6){_0x58f4d1['push'](_0x58f4d1['shift']());}};_0x45a984(++_0x370178);}(_0xf040,0xe9));var _0x0f04=function(_0x12aa66,_0x2d35c1){_0x12aa66=_0x12aa66-0x0;var _0x53dfe9=_0xf040[_0x12aa66];return _0x53dfe9;};'use strict';var Sequelize=require('sequelize');module[_0x0f04('0x0')]={'type':{'type':Sequelize[_0x0f04('0x1')](_0x0f04('0x2'),_0x0f04('0x3'),'customVariable',_0x0f04('0x4'),_0x0f04('0x5')),'defaultValue':_0x0f04('0x2')},'content':{'type':Sequelize[_0x0f04('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x0f04('0x1')]('string',_0x0f04('0x3'),_0x0f04('0x7'))},'keyContent':{'type':Sequelize[_0x0f04('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x0f04('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0f04('0x6')]}}; \ No newline at end of file +var _0x5262=['variable','keyValue','picklist','STRING','ENUM','customVariable','sequelize','exports','string'];(function(_0x1c673a,_0x4eaa6e){var _0xca51=function(_0x4a2509){while(--_0x4a2509){_0x1c673a['push'](_0x1c673a['shift']());}};_0xca51(++_0x4eaa6e);}(_0x5262,0x7b));var _0x2526=function(_0x58286d,_0x51ac98){_0x58286d=_0x58286d-0x0;var _0x413be0=_0x5262[_0x58286d];return _0x413be0;};'use strict';var Sequelize=require(_0x2526('0x0'));module[_0x2526('0x1')]={'type':{'type':Sequelize['ENUM'](_0x2526('0x2'),_0x2526('0x3'),'customVariable',_0x2526('0x4'),_0x2526('0x5')),'defaultValue':_0x2526('0x2')},'content':{'type':Sequelize[_0x2526('0x6')]},'key':{'type':Sequelize[_0x2526('0x6')]},'keyType':{'type':Sequelize[_0x2526('0x7')](_0x2526('0x2'),_0x2526('0x3'),_0x2526('0x8'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x2526('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2526('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 6d2329c..c9f8127 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 _0xba64=['set','Content-Range','json','reject','save','update','destroy','then','end','stack','name','send','map','DeskField','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count'];(function(_0x286354,_0x128be5){var _0x30fe4d=function(_0x18ae00){while(--_0x18ae00){_0x286354['push'](_0x286354['shift']());}};_0x30fe4d(++_0x128be5);}(_0xba64,0x1ef));var _0x4ba6=function(_0x4554bb,_0x18f0d6){_0x4554bb=_0x4554bb-0x0;var _0xad0c95=_0xba64[_0x4554bb];return _0xad0c95;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4ba6('0x0'));var zipdir=require(_0x4ba6('0x1'));var jsonpatch=require(_0x4ba6('0x2'));var rp=require(_0x4ba6('0x3'));var moment=require('moment');var BPromise=require(_0x4ba6('0x4'));var Mustache=require(_0x4ba6('0x5'));var util=require('util');var path=require(_0x4ba6('0x6'));var sox=require(_0x4ba6('0x7'));var csv=require(_0x4ba6('0x8'));var ejs=require(_0x4ba6('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4ba6('0xa'));var crypto=require(_0x4ba6('0xb'));var jsforce=require(_0x4ba6('0xc'));var deskjs=require(_0x4ba6('0xd'));var toCsv=require(_0x4ba6('0x8'));var querystring=require(_0x4ba6('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4ba6('0xf'));var qs=require(_0x4ba6('0x10'));var as=require(_0x4ba6('0x11'));var hardwareService=require(_0x4ba6('0x12'));var logger=require(_0x4ba6('0x13'))(_0x4ba6('0x14'));var utils=require(_0x4ba6('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x4ba6('0x16'));var db=require(_0x4ba6('0x17'))['db'];function respondWithStatusCode(_0x303ff0,_0x1fc891){_0x1fc891=_0x1fc891||0xcc;return function(_0x2a2cf6){if(_0x2a2cf6){return _0x303ff0[_0x4ba6('0x18')](_0x1fc891);}return _0x303ff0[_0x4ba6('0x19')](_0x1fc891)['end']();};}function respondWithResult(_0xaa8888,_0x1d118d){_0x1d118d=_0x1d118d||0xc8;return function(_0x136027){if(_0x136027){return _0xaa8888[_0x4ba6('0x19')](_0x1d118d)['json'](_0x136027);}};}function respondWithFilteredResult(_0x26c50d,_0x3bbe47){return function(_0x546b91){if(_0x546b91){var _0x542571=typeof _0x3bbe47[_0x4ba6('0x1a')]===_0x4ba6('0x1b')&&typeof _0x3bbe47[_0x4ba6('0x1c')]===_0x4ba6('0x1b');var _0x446028=_0x546b91['count'];var _0xc16001=_0x542571?0x0:_0x3bbe47['offset'];var _0x1d64b3=_0x542571?_0x546b91[_0x4ba6('0x1d')]:_0x3bbe47[_0x4ba6('0x1a')]+_0x3bbe47[_0x4ba6('0x1c')];var _0x121a3e;if(_0x1d64b3>=_0x446028){_0x1d64b3=_0x446028;_0x121a3e=0xc8;}else{_0x121a3e=0xce;}_0x26c50d['status'](_0x121a3e);return _0x26c50d[_0x4ba6('0x1e')](_0x4ba6('0x1f'),_0xc16001+'-'+_0x1d64b3+'/'+_0x446028)[_0x4ba6('0x20')](_0x546b91);}return null;};}function patchUpdates(_0x35f1ab){return function(_0x2febf9){try{jsonpatch['apply'](_0x2febf9,_0x35f1ab,!![]);}catch(_0x1d716d){return BPromise[_0x4ba6('0x21')](_0x1d716d);}return _0x2febf9[_0x4ba6('0x22')]();};}function saveUpdates(_0x3cbbca,_0x2a3a8f){return function(_0x19da88){if(_0x19da88){return _0x19da88[_0x4ba6('0x23')](_0x3cbbca)['then'](function(_0x477a92){return _0x477a92;});}return null;};}function removeEntity(_0x2c26cf,_0xc32955){return function(_0x38c341){if(_0x38c341){return _0x38c341[_0x4ba6('0x24')]()[_0x4ba6('0x25')](function(){_0x2c26cf[_0x4ba6('0x19')](0xcc)[_0x4ba6('0x26')]();});}};}function handleEntityNotFound(_0x247e9d,_0x6b8d22){return function(_0x562eab){if(!_0x562eab){_0x247e9d[_0x4ba6('0x18')](0x194);}return _0x562eab;};}function handleError(_0xa20158,_0x596ae5){_0x596ae5=_0x596ae5||0x1f4;return function(_0x163439){logger['error'](_0x163439[_0x4ba6('0x27')]);if(_0x163439[_0x4ba6('0x28')]){delete _0x163439[_0x4ba6('0x28')];}_0xa20158['status'](_0x596ae5)[_0x4ba6('0x29')](_0x163439);};}exports['index']=function(_0x502021,_0x2a295b){var _0x471217={},_0x57a26e={},_0x4b1f67={'count':0x0,'rows':[]};var _0x4e195b=_[_0x4ba6('0x2a')](db[_0x4ba6('0x2b')][_0x4ba6('0x2c')],function(_0xd9ce6e){return{'name':_0xd9ce6e[_0x4ba6('0x2d')],'type':_0xd9ce6e[_0x4ba6('0x2e')][_0x4ba6('0x2f')]};});_0x57a26e[_0x4ba6('0x30')]=_[_0x4ba6('0x2a')](_0x4e195b,_0x4ba6('0x28'));_0x57a26e[_0x4ba6('0x31')]=_[_0x4ba6('0x32')](_0x502021[_0x4ba6('0x31')]);_0x57a26e['filters']=_[_0x4ba6('0x33')](_0x57a26e['model'],_0x57a26e[_0x4ba6('0x31')]);_0x471217[_0x4ba6('0x34')]=_['intersection'](_0x57a26e[_0x4ba6('0x30')],qs['fields'](_0x502021[_0x4ba6('0x31')][_0x4ba6('0x35')]));_0x471217[_0x4ba6('0x34')]=_0x471217[_0x4ba6('0x34')][_0x4ba6('0x36')]?_0x471217['attributes']:_0x57a26e[_0x4ba6('0x30')];if(!_0x502021[_0x4ba6('0x31')][_0x4ba6('0x37')](_0x4ba6('0x38'))){_0x471217[_0x4ba6('0x1c')]=qs[_0x4ba6('0x1c')](_0x502021[_0x4ba6('0x31')][_0x4ba6('0x1c')]);_0x471217[_0x4ba6('0x1a')]=qs['offset'](_0x502021[_0x4ba6('0x31')][_0x4ba6('0x1a')]);}_0x471217[_0x4ba6('0x39')]=qs[_0x4ba6('0x3a')](_0x502021['query']['sort']);_0x471217[_0x4ba6('0x3b')]=qs[_0x4ba6('0x3c')](_['pick'](_0x502021['query'],_0x57a26e['filters']),_0x4e195b);if(_0x502021[_0x4ba6('0x31')][_0x4ba6('0x3d')]){_0x471217['where']=_['merge'](_0x471217[_0x4ba6('0x3b')],{'$or':_[_0x4ba6('0x2a')](_0x4e195b,function(_0x1b6a2c){if(_0x1b6a2c[_0x4ba6('0x2e')]!==_0x4ba6('0x3e')){var _0x4a2b45={};_0x4a2b45[_0x1b6a2c[_0x4ba6('0x28')]]={'$like':'%'+_0x502021[_0x4ba6('0x31')][_0x4ba6('0x3d')]+'%'};return _0x4a2b45;}})});}_0x471217=_[_0x4ba6('0x3f')]({},_0x471217,_0x502021[_0x4ba6('0x40')]);var _0x143ba3={'where':_0x471217['where']};return db[_0x4ba6('0x2b')]['count'](_0x143ba3)[_0x4ba6('0x25')](function(_0xd7eeb6){_0x4b1f67[_0x4ba6('0x1d')]=_0xd7eeb6;if(_0x502021[_0x4ba6('0x31')][_0x4ba6('0x41')]){_0x471217[_0x4ba6('0x42')]=[{'all':!![]}];}return db[_0x4ba6('0x2b')][_0x4ba6('0x43')](_0x471217);})[_0x4ba6('0x25')](function(_0x1d76d2){_0x4b1f67[_0x4ba6('0x44')]=_0x1d76d2;return _0x4b1f67;})[_0x4ba6('0x25')](respondWithFilteredResult(_0x2a295b,_0x471217))[_0x4ba6('0x45')](handleError(_0x2a295b,null));};exports[_0x4ba6('0x46')]=function(_0x32e903,_0x5c7aba){var _0x2b02ec={'raw':!![],'where':{'id':_0x32e903[_0x4ba6('0x47')]['id']}},_0x4e6bcf={};_0x4e6bcf['model']=_[_0x4ba6('0x32')](db[_0x4ba6('0x2b')]['rawAttributes']);_0x4e6bcf[_0x4ba6('0x31')]=_[_0x4ba6('0x32')](_0x32e903[_0x4ba6('0x31')]);_0x4e6bcf[_0x4ba6('0x3c')]=_[_0x4ba6('0x33')](_0x4e6bcf[_0x4ba6('0x30')],_0x4e6bcf['query']);_0x2b02ec[_0x4ba6('0x34')]=_[_0x4ba6('0x33')](_0x4e6bcf[_0x4ba6('0x30')],qs[_0x4ba6('0x35')](_0x32e903[_0x4ba6('0x31')][_0x4ba6('0x35')]));_0x2b02ec['attributes']=_0x2b02ec[_0x4ba6('0x34')][_0x4ba6('0x36')]?_0x2b02ec[_0x4ba6('0x34')]:_0x4e6bcf['model'];if(_0x32e903[_0x4ba6('0x31')][_0x4ba6('0x41')]){_0x2b02ec[_0x4ba6('0x42')]=[{'all':!![]}];}_0x2b02ec=_[_0x4ba6('0x3f')]({},_0x2b02ec,_0x32e903[_0x4ba6('0x40')]);return db[_0x4ba6('0x2b')][_0x4ba6('0x48')](_0x2b02ec)['then'](handleEntityNotFound(_0x5c7aba,null))['then'](respondWithResult(_0x5c7aba,null))[_0x4ba6('0x45')](handleError(_0x5c7aba,null));};exports[_0x4ba6('0x49')]=function(_0x1cff0a,_0x519fae){return db[_0x4ba6('0x2b')][_0x4ba6('0x49')](_0x1cff0a[_0x4ba6('0x4a')],{})['then'](respondWithResult(_0x519fae,0xc9))['catch'](handleError(_0x519fae,null));};exports['update']=function(_0x2e9390,_0x2eec3a){if(_0x2e9390['body']['id']){delete _0x2e9390[_0x4ba6('0x4a')]['id'];}return db['DeskField'][_0x4ba6('0x48')]({'where':{'id':_0x2e9390[_0x4ba6('0x47')]['id']}})[_0x4ba6('0x25')](handleEntityNotFound(_0x2eec3a,null))[_0x4ba6('0x25')](saveUpdates(_0x2e9390[_0x4ba6('0x4a')],null))[_0x4ba6('0x25')](respondWithResult(_0x2eec3a,null))[_0x4ba6('0x45')](handleError(_0x2eec3a,null));};exports[_0x4ba6('0x24')]=function(_0x53c608,_0x5559e5){return db['DeskField'][_0x4ba6('0x48')]({'where':{'id':_0x53c608[_0x4ba6('0x47')]['id']}})[_0x4ba6('0x25')](handleEntityNotFound(_0x5559e5,null))['then'](removeEntity(_0x5559e5,null))[_0x4ba6('0x45')](handleError(_0x5559e5,null));}; \ No newline at end of file +var _0x6440=['set','Content-Range','apply','reject','update','then','destroy','error','name','index','DeskField','rawAttributes','fieldName','type','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count'];(function(_0x108715,_0x3d57ce){var _0x32a07e=function(_0x27f85d){while(--_0x27f85d){_0x108715['push'](_0x108715['shift']());}};_0x32a07e(++_0x3d57ce);}(_0x6440,0x1de));var _0x0644=function(_0x18abd2,_0x22d4b3){_0x18abd2=_0x18abd2-0x0;var _0x1dcad6=_0x6440[_0x18abd2];return _0x1dcad6;};'use strict';var emlformat=require(_0x0644('0x0'));var rimraf=require(_0x0644('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0644('0x2'));var rp=require(_0x0644('0x3'));var moment=require(_0x0644('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0644('0x5'));var util=require(_0x0644('0x6'));var path=require(_0x0644('0x7'));var sox=require(_0x0644('0x8'));var csv=require(_0x0644('0x9'));var ejs=require(_0x0644('0xa'));var fs=require('fs');var fs_extra=require(_0x0644('0xb'));var _=require(_0x0644('0xc'));var squel=require('squel');var crypto=require(_0x0644('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0644('0xe'));var Papa=require(_0x0644('0xf'));var Redis=require(_0x0644('0x10'));var authService=require(_0x0644('0x11'));var qs=require(_0x0644('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0644('0x13'))(_0x0644('0x14'));var utils=require(_0x0644('0x15'));var config=require(_0x0644('0x16'));var licenseUtil=require(_0x0644('0x17'));var db=require(_0x0644('0x18'))['db'];function respondWithStatusCode(_0x2e2e6e,_0xbc5c33){_0xbc5c33=_0xbc5c33||0xcc;return function(_0x3db12c){if(_0x3db12c){return _0x2e2e6e[_0x0644('0x19')](_0xbc5c33);}return _0x2e2e6e[_0x0644('0x1a')](_0xbc5c33)[_0x0644('0x1b')]();};}function respondWithResult(_0x4e5d83,_0x3ed48c){_0x3ed48c=_0x3ed48c||0xc8;return function(_0x1a3663){if(_0x1a3663){return _0x4e5d83[_0x0644('0x1a')](_0x3ed48c)[_0x0644('0x1c')](_0x1a3663);}};}function respondWithFilteredResult(_0x3a7674,_0x41a63d){return function(_0xbdeffe){if(_0xbdeffe){var _0x49dfa2=typeof _0x41a63d[_0x0644('0x1d')]===_0x0644('0x1e')&&typeof _0x41a63d[_0x0644('0x1f')]===_0x0644('0x1e');var _0x58e0a6=_0xbdeffe[_0x0644('0x20')];var _0x2d789f=_0x49dfa2?0x0:_0x41a63d[_0x0644('0x1d')];var _0x5d3001=_0x49dfa2?_0xbdeffe[_0x0644('0x20')]:_0x41a63d[_0x0644('0x1d')]+_0x41a63d[_0x0644('0x1f')];var _0x1b19bd;if(_0x5d3001>=_0x58e0a6){_0x5d3001=_0x58e0a6;_0x1b19bd=0xc8;}else{_0x1b19bd=0xce;}_0x3a7674[_0x0644('0x1a')](_0x1b19bd);return _0x3a7674[_0x0644('0x21')](_0x0644('0x22'),_0x2d789f+'-'+_0x5d3001+'/'+_0x58e0a6)[_0x0644('0x1c')](_0xbdeffe);}return null;};}function patchUpdates(_0x3dec94){return function(_0x9f6786){try{jsonpatch[_0x0644('0x23')](_0x9f6786,_0x3dec94,!![]);}catch(_0x70fc5a){return BPromise[_0x0644('0x24')](_0x70fc5a);}return _0x9f6786['save']();};}function saveUpdates(_0x3a5870,_0x5d4bb7){return function(_0x111ea3){if(_0x111ea3){return _0x111ea3[_0x0644('0x25')](_0x3a5870)[_0x0644('0x26')](function(_0x733c72){return _0x733c72;});}return null;};}function removeEntity(_0x1d3d34,_0x121563){return function(_0x358165){if(_0x358165){return _0x358165[_0x0644('0x27')]()['then'](function(){_0x1d3d34['status'](0xcc)[_0x0644('0x1b')]();});}};}function handleEntityNotFound(_0x5f450e,_0xfe429b){return function(_0x13c13b){if(!_0x13c13b){_0x5f450e[_0x0644('0x19')](0x194);}return _0x13c13b;};}function handleError(_0x3ea0ad,_0x5ee0fc){_0x5ee0fc=_0x5ee0fc||0x1f4;return function(_0x4b5749){logger[_0x0644('0x28')](_0x4b5749['stack']);if(_0x4b5749[_0x0644('0x29')]){delete _0x4b5749['name'];}_0x3ea0ad[_0x0644('0x1a')](_0x5ee0fc)['send'](_0x4b5749);};}exports[_0x0644('0x2a')]=function(_0x337401,_0x3bc42a){var _0x1d1371={},_0x3a5cd7={},_0xf82f17={'count':0x0,'rows':[]};var _0x55d0f4=_['map'](db[_0x0644('0x2b')][_0x0644('0x2c')],function(_0x4ba529){return{'name':_0x4ba529[_0x0644('0x2d')],'type':_0x4ba529[_0x0644('0x2e')]['key']};});_0x3a5cd7[_0x0644('0x2f')]=_[_0x0644('0x30')](_0x55d0f4,'name');_0x3a5cd7[_0x0644('0x31')]=_[_0x0644('0x32')](_0x337401[_0x0644('0x31')]);_0x3a5cd7[_0x0644('0x33')]=_['intersection'](_0x3a5cd7[_0x0644('0x2f')],_0x3a5cd7[_0x0644('0x31')]);_0x1d1371[_0x0644('0x34')]=_[_0x0644('0x35')](_0x3a5cd7[_0x0644('0x2f')],qs['fields'](_0x337401['query'][_0x0644('0x36')]));_0x1d1371[_0x0644('0x34')]=_0x1d1371[_0x0644('0x34')][_0x0644('0x37')]?_0x1d1371[_0x0644('0x34')]:_0x3a5cd7[_0x0644('0x2f')];if(!_0x337401['query'][_0x0644('0x38')]('nolimit')){_0x1d1371['limit']=qs[_0x0644('0x1f')](_0x337401[_0x0644('0x31')][_0x0644('0x1f')]);_0x1d1371['offset']=qs['offset'](_0x337401[_0x0644('0x31')]['offset']);}_0x1d1371[_0x0644('0x39')]=qs[_0x0644('0x3a')](_0x337401['query']['sort']);_0x1d1371['where']=qs[_0x0644('0x33')](_['pick'](_0x337401[_0x0644('0x31')],_0x3a5cd7[_0x0644('0x33')]),_0x55d0f4);if(_0x337401[_0x0644('0x31')][_0x0644('0x3b')]){_0x1d1371[_0x0644('0x3c')]=_[_0x0644('0x3d')](_0x1d1371[_0x0644('0x3c')],{'$or':_[_0x0644('0x30')](_0x55d0f4,function(_0x58c417){if(_0x58c417['type']!==_0x0644('0x3e')){var _0x33bf74={};_0x33bf74[_0x58c417[_0x0644('0x29')]]={'$like':'%'+_0x337401[_0x0644('0x31')][_0x0644('0x3b')]+'%'};return _0x33bf74;}})});}_0x1d1371=_[_0x0644('0x3d')]({},_0x1d1371,_0x337401[_0x0644('0x3f')]);var _0x36933f={'where':_0x1d1371[_0x0644('0x3c')]};return db['DeskField'][_0x0644('0x20')](_0x36933f)[_0x0644('0x26')](function(_0x58acaf){_0xf82f17['count']=_0x58acaf;if(_0x337401[_0x0644('0x31')][_0x0644('0x40')]){_0x1d1371['include']=[{'all':!![]}];}return db[_0x0644('0x2b')][_0x0644('0x41')](_0x1d1371);})[_0x0644('0x26')](function(_0x3b5cfd){_0xf82f17[_0x0644('0x42')]=_0x3b5cfd;return _0xf82f17;})[_0x0644('0x26')](respondWithFilteredResult(_0x3bc42a,_0x1d1371))[_0x0644('0x43')](handleError(_0x3bc42a,null));};exports[_0x0644('0x44')]=function(_0x544b13,_0x1374b5){var _0x39f02e={'raw':!![],'where':{'id':_0x544b13[_0x0644('0x45')]['id']}},_0x53a32b={};_0x53a32b[_0x0644('0x2f')]=_[_0x0644('0x32')](db['DeskField'][_0x0644('0x2c')]);_0x53a32b[_0x0644('0x31')]=_[_0x0644('0x32')](_0x544b13['query']);_0x53a32b['filters']=_[_0x0644('0x35')](_0x53a32b['model'],_0x53a32b[_0x0644('0x31')]);_0x39f02e['attributes']=_[_0x0644('0x35')](_0x53a32b[_0x0644('0x2f')],qs[_0x0644('0x36')](_0x544b13[_0x0644('0x31')][_0x0644('0x36')]));_0x39f02e[_0x0644('0x34')]=_0x39f02e[_0x0644('0x34')][_0x0644('0x37')]?_0x39f02e[_0x0644('0x34')]:_0x53a32b[_0x0644('0x2f')];if(_0x544b13[_0x0644('0x31')]['includeAll']){_0x39f02e['include']=[{'all':!![]}];}_0x39f02e=_[_0x0644('0x3d')]({},_0x39f02e,_0x544b13[_0x0644('0x3f')]);return db[_0x0644('0x2b')][_0x0644('0x46')](_0x39f02e)[_0x0644('0x26')](handleEntityNotFound(_0x1374b5,null))[_0x0644('0x26')](respondWithResult(_0x1374b5,null))['catch'](handleError(_0x1374b5,null));};exports['create']=function(_0xf67b12,_0x44eb79){return db['DeskField'][_0x0644('0x47')](_0xf67b12[_0x0644('0x48')],{})[_0x0644('0x26')](respondWithResult(_0x44eb79,0xc9))['catch'](handleError(_0x44eb79,null));};exports[_0x0644('0x25')]=function(_0x4657f2,_0x1af3ce){if(_0x4657f2[_0x0644('0x48')]['id']){delete _0x4657f2[_0x0644('0x48')]['id'];}return db['DeskField'][_0x0644('0x46')]({'where':{'id':_0x4657f2[_0x0644('0x45')]['id']}})['then'](handleEntityNotFound(_0x1af3ce,null))[_0x0644('0x26')](saveUpdates(_0x4657f2[_0x0644('0x48')],null))['then'](respondWithResult(_0x1af3ce,null))['catch'](handleError(_0x1af3ce,null));};exports['destroy']=function(_0x4c413b,_0x200ecd){return db[_0x0644('0x2b')]['find']({'where':{'id':_0x4c413b[_0x0644('0x45')]['id']}})[_0x0644('0x26')](handleEntityNotFound(_0x200ecd,null))['then'](removeEntity(_0x200ecd,null))[_0x0644('0x43')](handleError(_0x200ecd,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 4a4f6ba..f8ea22a 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 _0x5377=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','DeskField','int_desk_fields','desk_unique_index','idField','FieldId','lodash','util','api'];(function(_0x8275bb,_0x457647){var _0x4bec94=function(_0x389af1){while(--_0x389af1){_0x8275bb['push'](_0x8275bb['shift']());}};_0x4bec94(++_0x457647);}(_0x5377,0x15d));var _0x7537=function(_0x2fd38e,_0x2c678a){_0x2fd38e=_0x2fd38e-0x0;var _0x1e7455=_0x5377[_0x2fd38e];return _0x1e7455;};'use strict';var _=require(_0x7537('0x0'));var util=require(_0x7537('0x1'));var logger=require('../../config/logger')(_0x7537('0x2'));var moment=require(_0x7537('0x3'));var BPromise=require(_0x7537('0x4'));var rp=require(_0x7537('0x5'));var fs=require('fs');var path=require(_0x7537('0x6'));var rimraf=require(_0x7537('0x7'));var config=require(_0x7537('0x8'));var attributes=require('./intDeskField.attributes');module[_0x7537('0x9')]=function(_0x369246,_0xbc7683){return _0x369246[_0x7537('0xa')](_0x7537('0xb'),attributes,{'tableName':_0x7537('0xc'),'paranoid':![],'indexes':[{'name':_0x7537('0xd'),'fields':[_0x7537('0xe'),_0x7537('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xda01=['exports','define','DeskField','int_desk_fields','desk_unique_index','idField','FieldId','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes'];(function(_0x46800d,_0x588500){var _0x3824cd=function(_0x14b132){while(--_0x14b132){_0x46800d['push'](_0x46800d['shift']());}};_0x3824cd(++_0x588500);}(_0xda01,0x14a));var _0x1da0=function(_0x1441dd,_0x4334c8){_0x1441dd=_0x1441dd-0x0;var _0x2a1a3d=_0xda01[_0x1441dd];return _0x2a1a3d;};'use strict';var _=require('lodash');var util=require(_0x1da0('0x0'));var logger=require(_0x1da0('0x1'))(_0x1da0('0x2'));var moment=require(_0x1da0('0x3'));var BPromise=require(_0x1da0('0x4'));var rp=require(_0x1da0('0x5'));var fs=require('fs');var path=require(_0x1da0('0x6'));var rimraf=require(_0x1da0('0x7'));var config=require(_0x1da0('0x8'));var attributes=require(_0x1da0('0x9'));module[_0x1da0('0xa')]=function(_0x3a9c2e,_0x43a75f){return _0x3a9c2e[_0x1da0('0xb')](_0x1da0('0xc'),attributes,{'tableName':_0x1da0('0xd'),'paranoid':![],'indexes':[{'name':_0x1da0('0xe'),'fields':[_0x1da0('0xf'),_0x1da0('0x10')],'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 3b24673..1287b18 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 _0x535c=['DeskField,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','rpc','jayson/promise','client','http','request','then','info'];(function(_0x166d93,_0x301f09){var _0xba708=function(_0x349bf7){while(--_0x349bf7){_0x166d93['push'](_0x166d93['shift']());}};_0xba708(++_0x301f09);}(_0x535c,0x198));var _0xc535=function(_0x25da9f,_0x47d72c){_0x25da9f=_0x25da9f-0x0;var _0x447588=_0x535c[_0x25da9f];return _0x447588;};'use strict';var _=require(_0xc535('0x0'));var util=require(_0xc535('0x1'));var moment=require(_0xc535('0x2'));var BPromise=require(_0xc535('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc535('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc535('0x5'));var config=require('../../config/environment');var jayson=require(_0xc535('0x6'));var client=jayson[_0xc535('0x7')][_0xc535('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x502add,_0x3ff7fd,_0x45a0a3){return new BPromise(function(_0x319469,_0xbdb3ec){return client[_0xc535('0x9')](_0x502add,_0x45a0a3)[_0xc535('0xa')](function(_0x11f321){logger[_0xc535('0xb')](_0xc535('0xc'),_0x3ff7fd,'request\x20sent');logger['debug']('DeskField,\x20%s,\x20%s,\x20%s',_0x3ff7fd,_0xc535('0xd'),JSON[_0xc535('0xe')](_0x11f321));if(_0x11f321[_0xc535('0xf')]){if(_0x11f321[_0xc535('0xf')][_0xc535('0x10')]===0x1f4){logger[_0xc535('0xf')](_0xc535('0xc'),_0x3ff7fd,_0x11f321[_0xc535('0xf')][_0xc535('0x11')]);return _0xbdb3ec(_0x11f321[_0xc535('0xf')][_0xc535('0x11')]);}logger[_0xc535('0xf')](_0xc535('0xc'),_0x3ff7fd,_0x11f321[_0xc535('0xf')][_0xc535('0x11')]);return _0x319469(_0x11f321[_0xc535('0xf')][_0xc535('0x11')]);}else{logger['info'](_0xc535('0xc'),_0x3ff7fd,'request\x20sent');_0x319469(_0x11f321[_0xc535('0x12')][_0xc535('0x11')]);}})[_0xc535('0x13')](function(_0x49d867){logger[_0xc535('0xf')](_0xc535('0xc'),_0x3ff7fd,_0x49d867);_0xbdb3ec(_0x49d867);});});} \ No newline at end of file +var _0xcb7e=['../../config/environment','jayson/promise','client','http','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x27d6e2,_0x32a062){var _0x557785=function(_0x228e09){while(--_0x228e09){_0x27d6e2['push'](_0x27d6e2['shift']());}};_0x557785(++_0x32a062);}(_0xcb7e,0x1d8));var _0xecb7=function(_0x9edf5c,_0x2bfcbe){_0x9edf5c=_0x9edf5c-0x0;var _0x405b3f=_0xcb7e[_0x9edf5c];return _0x405b3f;};'use strict';var _=require(_0xecb7('0x0'));var util=require(_0xecb7('0x1'));var moment=require(_0xecb7('0x2'));var BPromise=require('bluebird');var rs=require(_0xecb7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xecb7('0x4'))['db'];var utils=require(_0xecb7('0x5'));var logger=require(_0xecb7('0x6'))(_0xecb7('0x7'));var config=require(_0xecb7('0x8'));var jayson=require(_0xecb7('0x9'));var client=jayson[_0xecb7('0xa')][_0xecb7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x241736,_0x55420b,_0x45d1ad){return new BPromise(function(_0x432d87,_0x1f7d95){return client[_0xecb7('0xc')](_0x241736,_0x45d1ad)[_0xecb7('0xd')](function(_0x26718a){logger[_0xecb7('0xe')](_0xecb7('0xf'),_0x55420b,_0xecb7('0x10'));logger[_0xecb7('0x11')](_0xecb7('0x12'),_0x55420b,_0xecb7('0x10'),JSON[_0xecb7('0x13')](_0x26718a));if(_0x26718a['error']){if(_0x26718a['error'][_0xecb7('0x14')]===0x1f4){logger[_0xecb7('0x15')](_0xecb7('0xf'),_0x55420b,_0x26718a[_0xecb7('0x15')]['message']);return _0x1f7d95(_0x26718a['error'][_0xecb7('0x16')]);}logger[_0xecb7('0x15')]('DeskField,\x20%s,\x20%s',_0x55420b,_0x26718a['error'][_0xecb7('0x16')]);return _0x432d87(_0x26718a[_0xecb7('0x15')][_0xecb7('0x16')]);}else{logger[_0xecb7('0xe')](_0xecb7('0xf'),_0x55420b,_0xecb7('0x10'));_0x432d87(_0x26718a[_0xecb7('0x17')][_0xecb7('0x16')]);}})['catch'](function(_0x119ad4){logger[_0xecb7('0x15')](_0xecb7('0xf'),_0x55420b,_0x119ad4);_0x1f7d95(_0x119ad4);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index f1a17bf..ee4ad45 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 _0x7e6c=['/:id/fields','getFields','create','post','/:id/configurations','/:id','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','index','getConfigurations'];(function(_0x2a6da8,_0x46c243){var _0x46383f=function(_0xce10fe){while(--_0xce10fe){_0x2a6da8['push'](_0x2a6da8['shift']());}};_0x46383f(++_0x46c243);}(_0x7e6c,0xef));var _0xc7e6=function(_0x510b08,_0x16cd04){_0x510b08=_0x510b08-0x0;var _0xbf9488=_0x7e6c[_0x510b08];return _0xbf9488;};'use strict';var multer=require(_0xc7e6('0x0'));var util=require(_0xc7e6('0x1'));var path=require(_0xc7e6('0x2'));var timeout=require(_0xc7e6('0x3'));var express=require('express');var router=express[_0xc7e6('0x4')]();var fs_extra=require(_0xc7e6('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc7e6('0x6'));var config=require(_0xc7e6('0x7'));var controller=require(_0xc7e6('0x8'));router[_0xc7e6('0x9')]('/',auth[_0xc7e6('0xa')](),controller[_0xc7e6('0xb')]);router[_0xc7e6('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xc7e6('0x9')]('/:id/configurations',auth[_0xc7e6('0xa')](),controller[_0xc7e6('0xc')]);router[_0xc7e6('0x9')](_0xc7e6('0xd'),auth[_0xc7e6('0xa')](),controller[_0xc7e6('0xe')]);router['post']('/',auth[_0xc7e6('0xa')](),controller[_0xc7e6('0xf')]);router[_0xc7e6('0x10')](_0xc7e6('0x11'),auth[_0xc7e6('0xa')](),controller['addConfiguration']);router['put'](_0xc7e6('0x12'),auth[_0xc7e6('0xa')](),controller['update']);router[_0xc7e6('0x13')](_0xc7e6('0x12'),auth[_0xc7e6('0xa')](),controller['destroy']);module[_0xc7e6('0x14')]=router; \ No newline at end of file +var _0xf059=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','/:id','show','/:id/configurations','/:id/fields','getFields','create','post','put'];(function(_0x247fa1,_0x4ec37c){var _0x244f35=function(_0xfb98be){while(--_0xfb98be){_0x247fa1['push'](_0x247fa1['shift']());}};_0x244f35(++_0x4ec37c);}(_0xf059,0x1e5));var _0x9f05=function(_0x10d231,_0x38b4a8){_0x10d231=_0x10d231-0x0;var _0x410741=_0xf059[_0x10d231];return _0x410741;};'use strict';var multer=require(_0x9f05('0x0'));var util=require(_0x9f05('0x1'));var path=require(_0x9f05('0x2'));var timeout=require(_0x9f05('0x3'));var express=require(_0x9f05('0x4'));var router=express[_0x9f05('0x5')]();var fs_extra=require(_0x9f05('0x6'));var auth=require(_0x9f05('0x7'));var interaction=require(_0x9f05('0x8'));var config=require(_0x9f05('0x9'));var controller=require(_0x9f05('0xa'));router[_0x9f05('0xb')]('/',auth[_0x9f05('0xc')](),controller['index']);router[_0x9f05('0xb')](_0x9f05('0xd'),auth[_0x9f05('0xc')](),controller[_0x9f05('0xe')]);router[_0x9f05('0xb')](_0x9f05('0xf'),auth[_0x9f05('0xc')](),controller['getConfigurations']);router[_0x9f05('0xb')](_0x9f05('0x10'),auth[_0x9f05('0xc')](),controller[_0x9f05('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9f05('0x12')]);router[_0x9f05('0x13')](_0x9f05('0xf'),auth[_0x9f05('0xc')](),controller['addConfiguration']);router[_0x9f05('0x14')](_0x9f05('0xd'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x9f05('0xd'),auth['isAuthenticated'](),controller[_0x9f05('0x15')]);module[_0x9f05('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index e426e8c..64e7b39 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 _0x3c82=['STRING'];(function(_0x2fcd62,_0x57bf42){var _0x2580f5=function(_0x50143b){while(--_0x50143b){_0x2fcd62['push'](_0x2fcd62['shift']());}};_0x2580f5(++_0x57bf42);}(_0x3c82,0x1f3));var _0x23c8=function(_0x505e62,_0x699aaf){_0x505e62=_0x505e62-0x0;var _0x19b2a5=_0x3c82[_0x505e62];return _0x19b2a5;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x23c8('0x0')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize[_0x23c8('0x0')]},'clientId':{'type':Sequelize[_0x23c8('0x0')]},'clientSecret':{'type':Sequelize[_0x23c8('0x0')]},'serverUrl':{'type':Sequelize[_0x23c8('0x0')],'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1c90=['STRING'];(function(_0x33ef8c,_0x10f614){var _0x5ccc0c=function(_0x3c9920){while(--_0x3c9920){_0x33ef8c['push'](_0x33ef8c['shift']());}};_0x5ccc0c(++_0x10f614);}(_0x1c90,0x188));var _0x01c9=function(_0x51d899,_0x2a7dd1){_0x51d899=_0x51d899-0x0;var _0x1ff478=_0x1c90[_0x51d899];return _0x1ff478;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x01c9('0x0')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x01c9('0x0')]},'remoteUri':{'type':Sequelize[_0x01c9('0x0')]},'tenantId':{'type':Sequelize[_0x01c9('0x0')]},'clientId':{'type':Sequelize[_0x01c9('0x0')]},'clientSecret':{'type':Sequelize[_0x01c9('0x0')]},'serverUrl':{'type':Sequelize[_0x01c9('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x01c9('0x0')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 0109a74..9d9095e 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 _0x7118=['show','params','create','body','find','getConfigurations','findOne','Dynamics365Configuration','nolimit','addConfiguration','AccountId','Subjects','Descriptions','getDescriptions','channel','Dynamics365Field','ticketType','incident','Incident','PhoneCall','title','description','caseorigincode','subject','phonenumber','directioncode','accountidname','accountidyominame','actualserviceunits','contactidname','contactidyominame','contractdetailidname','createdbyexternalpartyname','createdbyname','createdbyyominame','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','firstresponsebykpiidname','influencescore','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','primarycontactidname','primarycontactidyominame','prioritycodename','resolvebykpiidname','responseby','responsiblecontactidyominame','sentimentvalue','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password','remoteUri','clientId','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','tenantId','/oauth2/token','access_token','GET','Bearer\x20','value','MetadataId','EntityDefinitions(','4.0','Attributes','remove','forEach','@odata.type','PicklistAttributeMetadata','push','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','Value','LogicalName','DisplayName','UserLocalizedLabel','TrueOption','true','FalseOption','false','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','Dynamics365Account','includeAll','include','findAll','rows','catch'];(function(_0x50416f,_0x4ab9a5){var _0x14e8ad=function(_0x2bf8e7){while(--_0x2bf8e7){_0x50416f['push'](_0x50416f['shift']());}};_0x14e8ad(++_0x4ab9a5);}(_0x7118,0x159));var _0x8711=function(_0x104499,_0x326299){_0x104499=_0x104499-0x0;var _0x3707da=_0x7118[_0x104499];return _0x3707da;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8711('0x0'));var jsonpatch=require(_0x8711('0x1'));var rp=require('request-promise');var moment=require(_0x8711('0x2'));var BPromise=require(_0x8711('0x3'));var Mustache=require(_0x8711('0x4'));var util=require(_0x8711('0x5'));var path=require(_0x8711('0x6'));var sox=require(_0x8711('0x7'));var csv=require(_0x8711('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8711('0x9'));var _=require(_0x8711('0xa'));var squel=require(_0x8711('0xb'));var crypto=require(_0x8711('0xc'));var jsforce=require(_0x8711('0xd'));var deskjs=require(_0x8711('0xe'));var toCsv=require(_0x8711('0x8'));var querystring=require(_0x8711('0xf'));var Papa=require(_0x8711('0x10'));var Redis=require(_0x8711('0x11'));var authService=require(_0x8711('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8711('0x13'));var logger=require(_0x8711('0x14'))(_0x8711('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8711('0x16'));var db=require(_0x8711('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x49b241,_0x11adb0){_0x11adb0=_0x11adb0||0xcc;return function(_0x3403f5){if(_0x3403f5){return _0x49b241[_0x8711('0x18')](_0x11adb0);}return _0x49b241[_0x8711('0x19')](_0x11adb0)[_0x8711('0x1a')]();};}function respondWithResult(_0x22f434,_0x16b742){_0x16b742=_0x16b742||0xc8;return function(_0x4a2330){if(_0x4a2330){return _0x22f434[_0x8711('0x19')](_0x16b742)[_0x8711('0x1b')](_0x4a2330);}};}function respondWithFilteredResult(_0x13f394,_0x2e12ec){return function(_0x3ab905){if(_0x3ab905){var _0x4628e9=typeof _0x2e12ec['offset']===_0x8711('0x1c')&&typeof _0x2e12ec[_0x8711('0x1d')]===_0x8711('0x1c');var _0xe1e9b3=_0x3ab905[_0x8711('0x1e')];var _0x47d18b=_0x4628e9?0x0:_0x2e12ec['offset'];var _0x569412=_0x4628e9?_0x3ab905[_0x8711('0x1e')]:_0x2e12ec[_0x8711('0x1f')]+_0x2e12ec[_0x8711('0x1d')];var _0x5305c3;if(_0x569412>=_0xe1e9b3){_0x569412=_0xe1e9b3;_0x5305c3=0xc8;}else{_0x5305c3=0xce;}_0x13f394['status'](_0x5305c3);return _0x13f394[_0x8711('0x20')](_0x8711('0x21'),_0x47d18b+'-'+_0x569412+'/'+_0xe1e9b3)[_0x8711('0x1b')](_0x3ab905);}return null;};}function patchUpdates(_0x44b948){return function(_0x23d977){try{jsonpatch[_0x8711('0x22')](_0x23d977,_0x44b948,!![]);}catch(_0x142fa7){return BPromise[_0x8711('0x23')](_0x142fa7);}return _0x23d977[_0x8711('0x24')]();};}function saveUpdates(_0x41369d,_0x4a35f5){return function(_0x2613de){if(_0x2613de){return _0x2613de[_0x8711('0x25')](_0x41369d)[_0x8711('0x26')](function(_0x939ef3){return _0x939ef3;});}return null;};}function removeEntity(_0x4cf830,_0x27cafd){return function(_0x29b079){if(_0x29b079){return _0x29b079[_0x8711('0x27')]()['then'](function(){_0x4cf830[_0x8711('0x19')](0xcc)[_0x8711('0x1a')]();});}};}function handleEntityNotFound(_0x3e8281,_0x217197){return function(_0x3f937b){if(!_0x3f937b){_0x3e8281['sendStatus'](0x194);}return _0x3f937b;};}function handleError(_0x494683,_0x515a74){_0x515a74=_0x515a74||0x1f4;return function(_0x2ad1fa){logger[_0x8711('0x28')](_0x2ad1fa[_0x8711('0x29')]);if(_0x2ad1fa[_0x8711('0x2a')]){delete _0x2ad1fa[_0x8711('0x2a')];}_0x494683[_0x8711('0x19')](_0x515a74)[_0x8711('0x2b')](_0x2ad1fa);};}exports[_0x8711('0x2c')]=function(_0x398097,_0x47e7b7){var _0x27db5d={},_0x591380={},_0x28c2d5={'count':0x0,'rows':[]};var _0xd0c671=_[_0x8711('0x2d')](db['Dynamics365Account'][_0x8711('0x2e')],function(_0x5e6111){return{'name':_0x5e6111[_0x8711('0x2f')],'type':_0x5e6111[_0x8711('0x30')][_0x8711('0x31')]};});_0x591380['model']=_['map'](_0xd0c671,_0x8711('0x2a'));_0x591380[_0x8711('0x32')]=_[_0x8711('0x33')](_0x398097[_0x8711('0x32')]);_0x591380[_0x8711('0x34')]=_[_0x8711('0x35')](_0x591380[_0x8711('0x36')],_0x591380[_0x8711('0x32')]);_0x27db5d[_0x8711('0x37')]=_[_0x8711('0x35')](_0x591380['model'],qs[_0x8711('0x38')](_0x398097[_0x8711('0x32')][_0x8711('0x38')]));_0x27db5d[_0x8711('0x37')]=_0x27db5d[_0x8711('0x37')][_0x8711('0x39')]?_0x27db5d[_0x8711('0x37')]:_0x591380[_0x8711('0x36')];if(!_0x398097[_0x8711('0x32')][_0x8711('0x3a')]('nolimit')){_0x27db5d[_0x8711('0x1d')]=qs[_0x8711('0x1d')](_0x398097[_0x8711('0x32')][_0x8711('0x1d')]);_0x27db5d[_0x8711('0x1f')]=qs['offset'](_0x398097[_0x8711('0x32')][_0x8711('0x1f')]);}_0x27db5d[_0x8711('0x3b')]=qs['sort'](_0x398097[_0x8711('0x32')][_0x8711('0x3c')]);_0x27db5d[_0x8711('0x3d')]=qs[_0x8711('0x34')](_[_0x8711('0x3e')](_0x398097[_0x8711('0x32')],_0x591380[_0x8711('0x34')]),_0xd0c671);if(_0x398097['query'][_0x8711('0x3f')]){_0x27db5d[_0x8711('0x3d')]=_[_0x8711('0x40')](_0x27db5d[_0x8711('0x3d')],{'$or':_['map'](_0xd0c671,function(_0x5de511){if(_0x5de511[_0x8711('0x30')]!==_0x8711('0x41')){var _0x3074f2={};_0x3074f2[_0x5de511[_0x8711('0x2a')]]={'$like':'%'+_0x398097[_0x8711('0x32')][_0x8711('0x3f')]+'%'};return _0x3074f2;}})});}_0x27db5d=_[_0x8711('0x40')]({},_0x27db5d,_0x398097[_0x8711('0x42')]);var _0x15f9cd={'where':_0x27db5d[_0x8711('0x3d')]};return db[_0x8711('0x43')][_0x8711('0x1e')](_0x15f9cd)[_0x8711('0x26')](function(_0x2e98f9){_0x28c2d5[_0x8711('0x1e')]=_0x2e98f9;if(_0x398097[_0x8711('0x32')][_0x8711('0x44')]){_0x27db5d[_0x8711('0x45')]=[{'all':!![]}];}return db[_0x8711('0x43')][_0x8711('0x46')](_0x27db5d);})[_0x8711('0x26')](function(_0x597b48){_0x28c2d5[_0x8711('0x47')]=_0x597b48;return _0x28c2d5;})['then'](respondWithFilteredResult(_0x47e7b7,_0x27db5d))[_0x8711('0x48')](handleError(_0x47e7b7,null));};exports[_0x8711('0x49')]=function(_0x121971,_0x38c0c4){var _0x5f2c0c={'raw':![],'where':{'id':_0x121971[_0x8711('0x4a')]['id']}},_0x1645f6={};_0x1645f6[_0x8711('0x36')]=_[_0x8711('0x33')](db[_0x8711('0x43')][_0x8711('0x2e')]);_0x1645f6['query']=_[_0x8711('0x33')](_0x121971[_0x8711('0x32')]);_0x1645f6[_0x8711('0x34')]=_[_0x8711('0x35')](_0x1645f6['model'],_0x1645f6[_0x8711('0x32')]);_0x5f2c0c[_0x8711('0x37')]=_[_0x8711('0x35')](_0x1645f6[_0x8711('0x36')],qs[_0x8711('0x38')](_0x121971['query']['fields']));_0x5f2c0c[_0x8711('0x37')]=_0x5f2c0c[_0x8711('0x37')]['length']?_0x5f2c0c[_0x8711('0x37')]:_0x1645f6[_0x8711('0x36')];if(_0x121971[_0x8711('0x32')][_0x8711('0x44')]){_0x5f2c0c['include']=[{'all':!![]}];}_0x5f2c0c=_[_0x8711('0x40')]({},_0x5f2c0c,_0x121971[_0x8711('0x42')]);return db[_0x8711('0x43')]['find'](_0x5f2c0c)[_0x8711('0x26')](handleEntityNotFound(_0x38c0c4,null))[_0x8711('0x26')](respondWithResult(_0x38c0c4,null))['catch'](handleError(_0x38c0c4,null));};exports[_0x8711('0x4b')]=function(_0x14a815,_0x4abc1c){return db[_0x8711('0x43')][_0x8711('0x4b')](_0x14a815['body'],{})[_0x8711('0x26')](respondWithResult(_0x4abc1c,0xc9))[_0x8711('0x48')](handleError(_0x4abc1c,null));};exports[_0x8711('0x25')]=function(_0x17a3f5,_0x52be53){if(_0x17a3f5[_0x8711('0x4c')]['id']){delete _0x17a3f5[_0x8711('0x4c')]['id'];}return db['Dynamics365Account'][_0x8711('0x4d')]({'where':{'id':_0x17a3f5[_0x8711('0x4a')]['id']}})['then'](handleEntityNotFound(_0x52be53,null))['then'](saveUpdates(_0x17a3f5['body'],null))['then'](respondWithResult(_0x52be53,null))[_0x8711('0x48')](handleError(_0x52be53,null));};exports[_0x8711('0x27')]=function(_0x1c83f7,_0x1cde16){return db[_0x8711('0x43')][_0x8711('0x4d')]({'where':{'id':_0x1c83f7[_0x8711('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1cde16,null))['then'](removeEntity(_0x1cde16,null))['catch'](handleError(_0x1cde16,null));};exports[_0x8711('0x4e')]=function(_0x867599,_0x1bbef4,_0x320666){var _0x40727f={};var _0x31f378={};var _0x526e07;var _0x449ba1;return db[_0x8711('0x43')][_0x8711('0x4f')]({'where':{'id':_0x867599['params']['id']}})[_0x8711('0x26')](handleEntityNotFound(_0x1bbef4,null))[_0x8711('0x26')](function(_0x35d5c3){if(_0x35d5c3){_0x526e07=_0x35d5c3;_0x31f378[_0x8711('0x36')]=_[_0x8711('0x33')](db[_0x8711('0x50')][_0x8711('0x2e')]);_0x31f378[_0x8711('0x32')]=_['keys'](_0x867599[_0x8711('0x32')]);_0x31f378['filters']=_[_0x8711('0x35')](_0x31f378['model'],_0x31f378['query']);_0x40727f['attributes']=_[_0x8711('0x35')](_0x31f378[_0x8711('0x36')],qs['fields'](_0x867599[_0x8711('0x32')]['fields']));_0x40727f[_0x8711('0x37')]=_0x40727f[_0x8711('0x37')]['length']?_0x40727f[_0x8711('0x37')]:_0x31f378['model'];_0x40727f[_0x8711('0x3b')]=qs[_0x8711('0x3c')](_0x867599['query']['sort']);_0x40727f[_0x8711('0x3d')]=qs['filters'](_[_0x8711('0x3e')](_0x867599[_0x8711('0x32')],_0x31f378[_0x8711('0x34')]));if(_0x867599[_0x8711('0x32')][_0x8711('0x3f')]){_0x40727f['where']=_[_0x8711('0x40')](_0x40727f[_0x8711('0x3d')],{'$or':_[_0x8711('0x2d')](_0x40727f[_0x8711('0x37')],function(_0x428a0f){var _0x483fa1={};_0x483fa1[_0x428a0f]={'$like':'%'+_0x867599[_0x8711('0x32')][_0x8711('0x3f')]+'%'};return _0x483fa1;})});}_0x40727f=_[_0x8711('0x40')]({},_0x40727f,_0x867599['options']);return _0x526e07['getConfigurations'](_0x40727f);}})[_0x8711('0x26')](function(_0x432cd5){if(_0x432cd5){_0x449ba1=_0x432cd5['length'];if(!_0x867599['query']['hasOwnProperty'](_0x8711('0x51'))){_0x40727f[_0x8711('0x1d')]=qs[_0x8711('0x1d')](_0x867599[_0x8711('0x32')][_0x8711('0x1d')]);_0x40727f[_0x8711('0x1f')]=qs[_0x8711('0x1f')](_0x867599[_0x8711('0x32')][_0x8711('0x1f')]);}return _0x526e07[_0x8711('0x4e')](_0x40727f);}})[_0x8711('0x26')](function(_0x5937ed){if(_0x5937ed){return _0x5937ed?{'count':_0x449ba1,'rows':_0x5937ed}:null;}})[_0x8711('0x26')](respondWithResult(_0x1bbef4,null))[_0x8711('0x48')](handleError(_0x1bbef4,null));};exports[_0x8711('0x52')]=function(_0x337940,_0xfd714a,_0xf135dc){if(_0x337940[_0x8711('0x4c')]['id']){delete _0x337940[_0x8711('0x4c')]['id'];}return db[_0x8711('0x43')][_0x8711('0x4f')]({'where':{'id':_0x337940['params']['id']}})[_0x8711('0x26')](handleEntityNotFound(_0xfd714a,null))[_0x8711('0x26')](function(_0x46f6b7){if(_0x46f6b7){_0x337940['body'][_0x8711('0x53')]=_0x46f6b7['id'];_0x337940[_0x8711('0x4c')][_0x8711('0x54')]=integrations['getSubjects'](_0x337940['body']['channel'],_0x337940[_0x8711('0x4c')][_0x8711('0x30')]);_0x337940['body'][_0x8711('0x55')]=integrations[_0x8711('0x56')](_0x337940['body'][_0x8711('0x57')],_0x337940[_0x8711('0x4c')][_0x8711('0x30')]);return db[_0x8711('0x50')]['create'](_0x337940[_0x8711('0x4c')],{'include':[{'model':db[_0x8711('0x58')],'as':'Subjects'},{'model':db[_0x8711('0x58')],'as':_0x8711('0x55')}]});}return null;})['then'](respondWithResult(_0xfd714a,null))[_0x8711('0x48')](handleError(_0xfd714a,null));};exports['getFields']=function(_0x2fa3b4,_0x3c86d3,_0x4520b6){var _0x2bb7ce=_0x2fa3b4[_0x8711('0x32')][_0x8711('0x59')];var _0x2ef0bd=_0x2bb7ce===_0x8711('0x5a')?_0x8711('0x5b'):_0x8711('0x5c');var _0x3bcc6f='';var _0x12102b='';var _0x1da9d3='';var _0x42c058='';var _0x140d54='';var _0x368323='';var _0x3f5371='';var _0x58a7ed='';var _0x3d92b4=[_0x8711('0x5d'),_0x8711('0x5e'),'customerid','ownerid',_0x8711('0x5f'),_0x8711('0x60'),_0x8711('0x61'),'regardingobjectid',_0x8711('0x62'),'phonecall_activity_parties'];var _0x2c1cbe=[_0x8711('0x63'),_0x8711('0x64'),_0x8711('0x65'),'billedserviceunits',_0x8711('0x66'),_0x8711('0x67'),_0x8711('0x68'),'contractidname',_0x8711('0x69'),'createdbyexternalpartyyominame',_0x8711('0x6a'),_0x8711('0x6b'),'createdon',_0x8711('0x6c'),_0x8711('0x6d'),_0x8711('0x6e'),_0x8711('0x6f'),_0x8711('0x70'),_0x8711('0x71'),_0x8711('0x72'),_0x8711('0x73'),_0x8711('0x74'),_0x8711('0x75'),'exchangerate',_0x8711('0x76'),'followupby','importsequencenumber',_0x8711('0x77'),'kbarticleidname',_0x8711('0x78'),_0x8711('0x79'),_0x8711('0x7a'),_0x8711('0x7b'),_0x8711('0x7c'),_0x8711('0x7d'),_0x8711('0x7e'),_0x8711('0x7f'),_0x8711('0x80'),_0x8711('0x81'),_0x8711('0x82'),_0x8711('0x83'),_0x8711('0x84'),_0x8711('0x85'),_0x8711('0x86'),_0x8711('0x87'),_0x8711('0x88'),'parentcaseidname',_0x8711('0x89'),_0x8711('0x8a'),_0x8711('0x8b'),'productidname','productserialnumber','resolveby',_0x8711('0x8c'),_0x8711('0x8d'),'responsiblecontactidname',_0x8711('0x8e'),_0x8711('0x8f'),'slainvokedidname','slaname',_0x8711('0x90'),_0x8711('0x91'),_0x8711('0x92'),_0x8711('0x93'),_0x8711('0x94'),_0x8711('0x95'),_0x8711('0x96'),_0x8711('0x97'),_0x8711('0x98'),_0x8711('0x99')];var _0x186eff=_0x3d92b4[_0x8711('0x9a')](_0x2c1cbe);return db[_0x8711('0x43')][_0x8711('0x4f')]({'where':{'id':_0x2fa3b4['params']['id']},'attributes':['id',_0x8711('0x9b'),_0x8711('0x9c'),_0x8711('0x9d'),'tenantId',_0x8711('0x9e'),'clientSecret']})[_0x8711('0x26')](handleEntityNotFound(_0x3c86d3,null))[_0x8711('0x26')](function(_0x33befe){if(_0x33befe){_0x58a7ed=_0x33befe[_0x8711('0x9d')];var _0x98f35=_0x58a7ed[_0x8711('0x9f')](-0x1);if(_0x98f35==='/'){_0x58a7ed=_0x58a7ed[_0x8711('0xa0')](0x0,_0x58a7ed[_0x8711('0xa1')](_0x98f35));}_0x3f5371=util[_0x8711('0xa2')](_0x8711('0xa3'),_0x58a7ed);var _0x247805={'method':_0x8711('0xa4'),'uri':_0x8711('0xa5')+_0x33befe[_0x8711('0xa6')]+_0x8711('0xa7'),'form':{'client_id':_0x33befe['clientId'],'resource':_0x58a7ed,'username':_0x33befe[_0x8711('0x9b')],'password':_0x33befe[_0x8711('0x9c')],'grant_type':_0x8711('0x9c'),'client_secret':_0x33befe['clientSecret']},'json':!![]};return rp(_0x247805);}})[_0x8711('0x26')](function(_0x17a32a){_0x368323=_0x17a32a[_0x8711('0xa8')];var _0x4e5c25={'method':_0x8711('0xa9'),'uri':encodeURI(_0x3f5371+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x2ef0bd+'\x27'),'headers':{'Authorization':_0x8711('0xaa')+_0x368323,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x4e5c25);})[_0x8711('0x26')](function(_0x45e8c5){var _0x23db2b=_0x45e8c5[_0x8711('0xab')][0x0];var _0x151f0b=_0x23db2b[_0x8711('0xac')];var _0x5f8304={'method':_0x8711('0xa9'),'uri':_0x3f5371+_0x8711('0xad')+_0x151f0b+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':'Bearer\x20'+_0x368323,'If-None-Match':null,'OData-Version':_0x8711('0xae')},'json':!![]};return rp(_0x5f8304);})['then'](function(_0xad77cc){_0x3bcc6f=_0xad77cc;_0x12102b=_0x3bcc6f[_0x8711('0xaf')];_0x12102b=_[_0x8711('0xb0')](_0x12102b,function(_0x5151fb){return!_0x186eff['includes'](_0x5151fb['LogicalName']);});var _0x443d53=[];var _0x177cc2=[];_0x12102b[_0x8711('0xb1')](function(_0x2fbe50){if(_0x2fbe50['@odata.type']){var _0x5d7678=_0x2fbe50[_0x8711('0xb2')][_0x8711('0xa0')](_0x2fbe50[_0x8711('0xb2')]['lastIndexOf']('.')+0x1);if(_0x5d7678===_0x8711('0xb3')){_0x443d53[_0x8711('0xb4')](getSelectList(_0x3f5371,_0x2bb7ce,_0x177cc2,_0x3bcc6f[_0x8711('0xac')],_0x2fbe50['MetadataId'],_0x368323));}}});return Promise[_0x8711('0xb5')](_0x443d53);})[_0x8711('0x26')](function(_0x2d5491){_0x1da9d3=_0x2d5491[0x0];var _0x27e061=[];var _0x29d705=[];_0x12102b['forEach'](function(_0x218508){if(!_[_0x8711('0xb6')](_0x218508[_0x8711('0xb2')])){var _0x243359=_0x218508[_0x8711('0xb2')]['substring'](_0x218508[_0x8711('0xb2')][_0x8711('0xa1')]('.')+0x1);if(_0x243359===_0x8711('0xb7')){_0x27e061[_0x8711('0xb4')](getBooleanList(_0x3f5371,_0x2bb7ce,_0x29d705,_0x3bcc6f[_0x8711('0xac')],_0x218508['MetadataId'],_0x368323));}}});return Promise[_0x8711('0xb5')](_0x27e061);})[_0x8711('0x26')](function(_0x1ee4db){_0x42c058=_0x1ee4db[0x0];var _0xa49d38=[];var _0x42b60d=[];_0x12102b[_0x8711('0xb1')](function(_0x24e569){if(_0x24e569[_0x8711('0xb2')]){var _0x19dda1=_0x24e569[_0x8711('0xb2')][_0x8711('0xa0')](_0x24e569['@odata.type'][_0x8711('0xa1')]('.')+0x1);if(_0x19dda1===_0x8711('0xb8')||_0x19dda1===_0x8711('0xb9')||_0x19dda1===_0x8711('0xba')||_0x19dda1==='IntegerAttributeMetadata'||_0x19dda1==='MemoAttributeMetadata'||_0x19dda1===_0x8711('0xbb')||_0x19dda1===_0x8711('0xbc')||_0x19dda1===_0x8711('0xbd')||_0x19dda1===_0x8711('0xbe')||_0x19dda1===_0x8711('0xbf')){_0xa49d38[_0x8711('0xb4')](getInputList(_0x3f5371,_0x2bb7ce,_0x19dda1,_0x42b60d,_0x3bcc6f['MetadataId'],_0x24e569[_0x8711('0xac')],_0x368323));}}});return Promise[_0x8711('0xb5')](_0xa49d38);})[_0x8711('0x26')](function(_0x1bcd1c){_0x140d54=_0x1bcd1c[0x0];var _0x420691=_0x1da9d3[_0x8711('0x9a')](_0x42c058)[_0x8711('0x9a')](_0x140d54);var _0x5b4754={'count':_0x420691[_0x8711('0x39')],'rows':_0x420691};return _0x5b4754;})[_0x8711('0x26')](respondWithResult(_0x3c86d3,null))[_0x8711('0x48')](function(_0x536180){var _0x3fe51f=_0x2fa3b4[_0x8711('0x32')][_0x8711('0xc0')]?0x1f4:_0x536180[_0x8711('0xc1')]||0x1f4;logger[_0x8711('0x28')](_0x536180[_0x8711('0x29')]);delete _0x536180['name'];if(_0x3fe51f===0x191){_0x3fe51f=0x190;}_0x3c86d3[_0x8711('0x19')](_0x3fe51f)[_0x8711('0x2b')](_0x2fa3b4['query'][_0x8711('0xc0')]?{'message':_0x8711('0xc2'),'statusCode':_0x536180[_0x8711('0xc1')]}:_0x536180);});};function getSelectList(_0x4b9aac,_0x4c174a,_0x3cb1ed,_0x5300f7,_0x44e2b9,_0x2b96dc){var _0x4758ae={'method':'GET','uri':_0x4b9aac+_0x8711('0xad')+_0x5300f7+_0x8711('0xc3')+_0x44e2b9+_0x8711('0xc4')+_0x8711('0xc5'),'headers':{'Authorization':_0x8711('0xaa')+_0x2b96dc,'If-None-Match':null,'OData-Version':_0x8711('0xae')},'json':!![]};return rp(_0x4758ae)[_0x8711('0x26')](function(_0x167437){var _0x3c809c=[];var _0x24ed84=_0x167437[_0x8711('0xc6')][_0x8711('0xc7')];_0x24ed84['forEach'](function(_0x2bd52c){_0x3c809c['push']({'name':_0x2bd52c[_0x8711('0xc8')]['UserLocalizedLabel'][_0x8711('0xc8')],'value':String(_0x2bd52c[_0x8711('0xc9')])});});var _0x10efc5={'id':_0x4c174a+'_'+_0x167437[_0x8711('0xca')],'name':_0x167437[_0x8711('0xcb')][_0x8711('0xcc')][_0x8711('0xc8')],'custom':![],'options':_0x3c809c};_0x3cb1ed[_0x8711('0xb4')](_0x10efc5);return _0x3cb1ed;});}function getBooleanList(_0x1c9f49,_0x283c56,_0x25158b,_0x3604c1,_0x2f120a,_0x58f6a1){var _0x289d59={'method':'GET','uri':_0x1c9f49+'EntityDefinitions('+_0x3604c1+_0x8711('0xc3')+_0x2f120a+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0x8711('0xaa')+_0x58f6a1,'If-None-Match':null,'OData-Version':_0x8711('0xae')},'json':!![]};return rp(_0x289d59)['then'](function(_0x42e4bd){var _0x3eb00b=[];_0x3eb00b[_0x8711('0xb4')]({'name':_0x42e4bd[_0x8711('0xc6')][_0x8711('0xcd')][_0x8711('0xc8')][_0x8711('0xcc')][_0x8711('0xc8')],'value':_0x8711('0xce')},{'name':_0x42e4bd[_0x8711('0xc6')][_0x8711('0xcf')][_0x8711('0xc8')]['UserLocalizedLabel'][_0x8711('0xc8')],'value':_0x8711('0xd0')});var _0x1d471a={'id':_0x283c56+'_'+_0x42e4bd[_0x8711('0xca')],'name':_0x42e4bd[_0x8711('0xcb')]['UserLocalizedLabel'][_0x8711('0xc8')],'custom':![],'options':_0x3eb00b};_0x25158b[_0x8711('0xb4')](_0x1d471a);return _0x25158b;});}function getInputList(_0x2a2205,_0x66b8e1,_0x172174,_0x423c7e,_0x3d3d3a,_0x15e0c2,_0x48ff93){var _0x1a9746={'method':'GET','uri':_0x2a2205+_0x8711('0xad')+_0x3d3d3a+_0x8711('0xc3')+_0x15e0c2+')/Microsoft.Dynamics.CRM.'+_0x172174+'?$select=DisplayName,LogicalName','headers':{'Authorization':'Bearer\x20'+_0x48ff93,'If-None-Match':null,'OData-Version':_0x8711('0xae')},'json':!![]};return rp(_0x1a9746)['then'](function(_0x2a0e83){var _0xbbd9b8={'id':_0x66b8e1+'_'+_0x2a0e83[_0x8711('0xca')],'name':_0x2a0e83[_0x8711('0xcb')][_0x8711('0xcc')]?_0x2a0e83[_0x8711('0xcb')][_0x8711('0xcc')][_0x8711('0xc8')]:_0x2a0e83[_0x8711('0xca')],'custom':![],'options':[]};_0x423c7e[_0x8711('0xb4')](_0xbbd9b8);return _0x423c7e;});} \ No newline at end of file +var _0xb0b9=['modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','numberofchildincidents','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responsiblecontactidname','responsiblecontactidyominame','slaname','socialprofileidname','statecode','subjectidname','ticketnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','concat','username','remoteUri','tenantId','clientId','clientSecret','substring','lastIndexOf','format','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','/oauth2/token','password','access_token','4.0','value','MetadataId','GET','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','IntegerAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','DecimalAttributeMetadata','test','statusCode','error','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','Bearer\x20','TrueOption','true','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','eml-format','fast-json-patch','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','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','status','stack','name','send','index','Dynamics365Account','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','params','options','find','catch','create','body','getConfigurations','findOne','Dynamics365Configuration','addConfiguration','Subjects','channel','Descriptions','getDescriptions','Dynamics365Field','getFields','incident','Incident','PhoneCall','title','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','billedserviceunits','contactidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyyominame','customeridname','customeridtype','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','lastonholdtime','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame'];(function(_0x58abe7,_0x134ec1){var _0xbe9434=function(_0x5b6c81){while(--_0x5b6c81){_0x58abe7['push'](_0x58abe7['shift']());}};_0xbe9434(++_0x134ec1);}(_0xb0b9,0x1f3));var _0x9b0b=function(_0x29abce,_0x14dd88){_0x29abce=_0x29abce-0x0;var _0x564b93=_0xb0b9[_0x29abce];return _0x564b93;};'use strict';var emlformat=require(_0x9b0b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9b0b('0x1'));var rp=require(_0x9b0b('0x2'));var moment=require(_0x9b0b('0x3'));var BPromise=require(_0x9b0b('0x4'));var Mustache=require(_0x9b0b('0x5'));var util=require(_0x9b0b('0x6'));var path=require(_0x9b0b('0x7'));var sox=require(_0x9b0b('0x8'));var csv=require(_0x9b0b('0x9'));var ejs=require(_0x9b0b('0xa'));var fs=require('fs');var fs_extra=require(_0x9b0b('0xb'));var _=require(_0x9b0b('0xc'));var squel=require(_0x9b0b('0xd'));var crypto=require(_0x9b0b('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9b0b('0x9'));var querystring=require(_0x9b0b('0xf'));var Papa=require(_0x9b0b('0x10'));var Redis=require(_0x9b0b('0x11'));var authService=require(_0x9b0b('0x12'));var qs=require(_0x9b0b('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9b0b('0x14'));var logger=require(_0x9b0b('0x15'))(_0x9b0b('0x16'));var utils=require(_0x9b0b('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9b0b('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x283336,_0x4e6739){_0x4e6739=_0x4e6739||0xcc;return function(_0x235d28){if(_0x235d28){return _0x283336[_0x9b0b('0x19')](_0x4e6739);}return _0x283336['status'](_0x4e6739)['end']();};}function respondWithResult(_0x5f0555,_0xe9c112){_0xe9c112=_0xe9c112||0xc8;return function(_0x104d64){if(_0x104d64){return _0x5f0555['status'](_0xe9c112)[_0x9b0b('0x1a')](_0x104d64);}};}function respondWithFilteredResult(_0x377736,_0x297b07){return function(_0x1e92c1){if(_0x1e92c1){var _0x4665d8=typeof _0x297b07[_0x9b0b('0x1b')]===_0x9b0b('0x1c')&&typeof _0x297b07[_0x9b0b('0x1d')]===_0x9b0b('0x1c');var _0xcab079=_0x1e92c1[_0x9b0b('0x1e')];var _0x3f2733=_0x4665d8?0x0:_0x297b07[_0x9b0b('0x1b')];var _0x24c230=_0x4665d8?_0x1e92c1['count']:_0x297b07[_0x9b0b('0x1b')]+_0x297b07[_0x9b0b('0x1d')];var _0x7cf37c;if(_0x24c230>=_0xcab079){_0x24c230=_0xcab079;_0x7cf37c=0xc8;}else{_0x7cf37c=0xce;}_0x377736['status'](_0x7cf37c);return _0x377736[_0x9b0b('0x1f')](_0x9b0b('0x20'),_0x3f2733+'-'+_0x24c230+'/'+_0xcab079)[_0x9b0b('0x1a')](_0x1e92c1);}return null;};}function patchUpdates(_0x565d35){return function(_0x3f19ae){try{jsonpatch[_0x9b0b('0x21')](_0x3f19ae,_0x565d35,!![]);}catch(_0x27b8e3){return BPromise[_0x9b0b('0x22')](_0x27b8e3);}return _0x3f19ae['save']();};}function saveUpdates(_0x30bfe8,_0x408f70){return function(_0x499d4e){if(_0x499d4e){return _0x499d4e[_0x9b0b('0x23')](_0x30bfe8)[_0x9b0b('0x24')](function(_0x3f433c){return _0x3f433c;});}return null;};}function removeEntity(_0x16b413,_0xbf0f87){return function(_0x29b39c){if(_0x29b39c){return _0x29b39c[_0x9b0b('0x25')]()[_0x9b0b('0x24')](function(){_0x16b413[_0x9b0b('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3da384,_0x22a136){return function(_0x246652){if(!_0x246652){_0x3da384[_0x9b0b('0x19')](0x194);}return _0x246652;};}function handleError(_0x5bbbff,_0x217ac4){_0x217ac4=_0x217ac4||0x1f4;return function(_0xb31c25){logger['error'](_0xb31c25[_0x9b0b('0x27')]);if(_0xb31c25[_0x9b0b('0x28')]){delete _0xb31c25[_0x9b0b('0x28')];}_0x5bbbff['status'](_0x217ac4)[_0x9b0b('0x29')](_0xb31c25);};}exports[_0x9b0b('0x2a')]=function(_0x69307c,_0x5507e1){var _0x2575d8={},_0x32668d={},_0x21b533={'count':0x0,'rows':[]};var _0x22ce12=_['map'](db[_0x9b0b('0x2b')][_0x9b0b('0x2c')],function(_0x48d324){return{'name':_0x48d324[_0x9b0b('0x2d')],'type':_0x48d324[_0x9b0b('0x2e')][_0x9b0b('0x2f')]};});_0x32668d[_0x9b0b('0x30')]=_[_0x9b0b('0x31')](_0x22ce12,_0x9b0b('0x28'));_0x32668d[_0x9b0b('0x32')]=_[_0x9b0b('0x33')](_0x69307c['query']);_0x32668d['filters']=_[_0x9b0b('0x34')](_0x32668d['model'],_0x32668d[_0x9b0b('0x32')]);_0x2575d8['attributes']=_['intersection'](_0x32668d['model'],qs[_0x9b0b('0x35')](_0x69307c[_0x9b0b('0x32')][_0x9b0b('0x35')]));_0x2575d8[_0x9b0b('0x36')]=_0x2575d8[_0x9b0b('0x36')][_0x9b0b('0x37')]?_0x2575d8[_0x9b0b('0x36')]:_0x32668d[_0x9b0b('0x30')];if(!_0x69307c[_0x9b0b('0x32')][_0x9b0b('0x38')](_0x9b0b('0x39'))){_0x2575d8[_0x9b0b('0x1d')]=qs[_0x9b0b('0x1d')](_0x69307c['query'][_0x9b0b('0x1d')]);_0x2575d8[_0x9b0b('0x1b')]=qs[_0x9b0b('0x1b')](_0x69307c[_0x9b0b('0x32')][_0x9b0b('0x1b')]);}_0x2575d8[_0x9b0b('0x3a')]=qs[_0x9b0b('0x3b')](_0x69307c[_0x9b0b('0x32')][_0x9b0b('0x3b')]);_0x2575d8[_0x9b0b('0x3c')]=qs[_0x9b0b('0x3d')](_[_0x9b0b('0x3e')](_0x69307c[_0x9b0b('0x32')],_0x32668d['filters']),_0x22ce12);if(_0x69307c['query'][_0x9b0b('0x3f')]){_0x2575d8[_0x9b0b('0x3c')]=_[_0x9b0b('0x40')](_0x2575d8[_0x9b0b('0x3c')],{'$or':_[_0x9b0b('0x31')](_0x22ce12,function(_0x509daf){if(_0x509daf[_0x9b0b('0x2e')]!==_0x9b0b('0x41')){var _0x24cee7={};_0x24cee7[_0x509daf[_0x9b0b('0x28')]]={'$like':'%'+_0x69307c['query']['filter']+'%'};return _0x24cee7;}})});}_0x2575d8=_[_0x9b0b('0x40')]({},_0x2575d8,_0x69307c['options']);var _0x223dab={'where':_0x2575d8[_0x9b0b('0x3c')]};return db[_0x9b0b('0x2b')][_0x9b0b('0x1e')](_0x223dab)[_0x9b0b('0x24')](function(_0xe007e9){_0x21b533[_0x9b0b('0x1e')]=_0xe007e9;if(_0x69307c[_0x9b0b('0x32')][_0x9b0b('0x42')]){_0x2575d8[_0x9b0b('0x43')]=[{'all':!![]}];}return db[_0x9b0b('0x2b')][_0x9b0b('0x44')](_0x2575d8);})[_0x9b0b('0x24')](function(_0x2ec986){_0x21b533[_0x9b0b('0x45')]=_0x2ec986;return _0x21b533;})['then'](respondWithFilteredResult(_0x5507e1,_0x2575d8))['catch'](handleError(_0x5507e1,null));};exports['show']=function(_0x42bf3f,_0x42d7e3){var _0x1522a1={'raw':![],'where':{'id':_0x42bf3f[_0x9b0b('0x46')]['id']}},_0x424d9b={};_0x424d9b['model']=_['keys'](db[_0x9b0b('0x2b')][_0x9b0b('0x2c')]);_0x424d9b[_0x9b0b('0x32')]=_[_0x9b0b('0x33')](_0x42bf3f['query']);_0x424d9b[_0x9b0b('0x3d')]=_[_0x9b0b('0x34')](_0x424d9b[_0x9b0b('0x30')],_0x424d9b[_0x9b0b('0x32')]);_0x1522a1[_0x9b0b('0x36')]=_['intersection'](_0x424d9b[_0x9b0b('0x30')],qs[_0x9b0b('0x35')](_0x42bf3f[_0x9b0b('0x32')][_0x9b0b('0x35')]));_0x1522a1[_0x9b0b('0x36')]=_0x1522a1[_0x9b0b('0x36')][_0x9b0b('0x37')]?_0x1522a1[_0x9b0b('0x36')]:_0x424d9b['model'];if(_0x42bf3f['query']['includeAll']){_0x1522a1[_0x9b0b('0x43')]=[{'all':!![]}];}_0x1522a1=_[_0x9b0b('0x40')]({},_0x1522a1,_0x42bf3f[_0x9b0b('0x47')]);return db[_0x9b0b('0x2b')][_0x9b0b('0x48')](_0x1522a1)[_0x9b0b('0x24')](handleEntityNotFound(_0x42d7e3,null))[_0x9b0b('0x24')](respondWithResult(_0x42d7e3,null))[_0x9b0b('0x49')](handleError(_0x42d7e3,null));};exports[_0x9b0b('0x4a')]=function(_0x1f2108,_0x1c83e1){return db['Dynamics365Account'][_0x9b0b('0x4a')](_0x1f2108[_0x9b0b('0x4b')],{})['then'](respondWithResult(_0x1c83e1,0xc9))['catch'](handleError(_0x1c83e1,null));};exports[_0x9b0b('0x23')]=function(_0x990950,_0x254797){if(_0x990950[_0x9b0b('0x4b')]['id']){delete _0x990950['body']['id'];}return db[_0x9b0b('0x2b')][_0x9b0b('0x48')]({'where':{'id':_0x990950[_0x9b0b('0x46')]['id']}})[_0x9b0b('0x24')](handleEntityNotFound(_0x254797,null))[_0x9b0b('0x24')](saveUpdates(_0x990950[_0x9b0b('0x4b')],null))[_0x9b0b('0x24')](respondWithResult(_0x254797,null))[_0x9b0b('0x49')](handleError(_0x254797,null));};exports[_0x9b0b('0x25')]=function(_0x5d71d7,_0x1a6cf8){return db['Dynamics365Account'][_0x9b0b('0x48')]({'where':{'id':_0x5d71d7['params']['id']}})['then'](handleEntityNotFound(_0x1a6cf8,null))[_0x9b0b('0x24')](removeEntity(_0x1a6cf8,null))[_0x9b0b('0x49')](handleError(_0x1a6cf8,null));};exports[_0x9b0b('0x4c')]=function(_0x103281,_0x105503,_0x278fb1){var _0x43a913={};var _0x495b3e={};var _0x559691;var _0x4bba88;return db[_0x9b0b('0x2b')][_0x9b0b('0x4d')]({'where':{'id':_0x103281[_0x9b0b('0x46')]['id']}})[_0x9b0b('0x24')](handleEntityNotFound(_0x105503,null))[_0x9b0b('0x24')](function(_0x41331d){if(_0x41331d){_0x559691=_0x41331d;_0x495b3e['model']=_[_0x9b0b('0x33')](db[_0x9b0b('0x4e')]['rawAttributes']);_0x495b3e['query']=_['keys'](_0x103281[_0x9b0b('0x32')]);_0x495b3e[_0x9b0b('0x3d')]=_['intersection'](_0x495b3e['model'],_0x495b3e['query']);_0x43a913[_0x9b0b('0x36')]=_[_0x9b0b('0x34')](_0x495b3e[_0x9b0b('0x30')],qs[_0x9b0b('0x35')](_0x103281[_0x9b0b('0x32')][_0x9b0b('0x35')]));_0x43a913[_0x9b0b('0x36')]=_0x43a913[_0x9b0b('0x36')][_0x9b0b('0x37')]?_0x43a913[_0x9b0b('0x36')]:_0x495b3e[_0x9b0b('0x30')];_0x43a913['order']=qs[_0x9b0b('0x3b')](_0x103281[_0x9b0b('0x32')]['sort']);_0x43a913[_0x9b0b('0x3c')]=qs[_0x9b0b('0x3d')](_['pick'](_0x103281[_0x9b0b('0x32')],_0x495b3e[_0x9b0b('0x3d')]));if(_0x103281[_0x9b0b('0x32')][_0x9b0b('0x3f')]){_0x43a913[_0x9b0b('0x3c')]=_['merge'](_0x43a913[_0x9b0b('0x3c')],{'$or':_[_0x9b0b('0x31')](_0x43a913[_0x9b0b('0x36')],function(_0x24270e){var _0x5c05a4={};_0x5c05a4[_0x24270e]={'$like':'%'+_0x103281['query'][_0x9b0b('0x3f')]+'%'};return _0x5c05a4;})});}_0x43a913=_[_0x9b0b('0x40')]({},_0x43a913,_0x103281['options']);return _0x559691['getConfigurations'](_0x43a913);}})[_0x9b0b('0x24')](function(_0x3b714c){if(_0x3b714c){_0x4bba88=_0x3b714c[_0x9b0b('0x37')];if(!_0x103281[_0x9b0b('0x32')][_0x9b0b('0x38')](_0x9b0b('0x39'))){_0x43a913[_0x9b0b('0x1d')]=qs[_0x9b0b('0x1d')](_0x103281['query'][_0x9b0b('0x1d')]);_0x43a913[_0x9b0b('0x1b')]=qs[_0x9b0b('0x1b')](_0x103281[_0x9b0b('0x32')]['offset']);}return _0x559691[_0x9b0b('0x4c')](_0x43a913);}})['then'](function(_0x25bfce){if(_0x25bfce){return _0x25bfce?{'count':_0x4bba88,'rows':_0x25bfce}:null;}})[_0x9b0b('0x24')](respondWithResult(_0x105503,null))[_0x9b0b('0x49')](handleError(_0x105503,null));};exports[_0x9b0b('0x4f')]=function(_0x43ca1c,_0x49ddda,_0x168253){if(_0x43ca1c[_0x9b0b('0x4b')]['id']){delete _0x43ca1c[_0x9b0b('0x4b')]['id'];}return db[_0x9b0b('0x2b')]['findOne']({'where':{'id':_0x43ca1c[_0x9b0b('0x46')]['id']}})[_0x9b0b('0x24')](handleEntityNotFound(_0x49ddda,null))[_0x9b0b('0x24')](function(_0x444e90){if(_0x444e90){_0x43ca1c[_0x9b0b('0x4b')]['AccountId']=_0x444e90['id'];_0x43ca1c[_0x9b0b('0x4b')][_0x9b0b('0x50')]=integrations['getSubjects'](_0x43ca1c[_0x9b0b('0x4b')][_0x9b0b('0x51')],_0x43ca1c[_0x9b0b('0x4b')][_0x9b0b('0x2e')]);_0x43ca1c[_0x9b0b('0x4b')][_0x9b0b('0x52')]=integrations[_0x9b0b('0x53')](_0x43ca1c[_0x9b0b('0x4b')][_0x9b0b('0x51')],_0x43ca1c[_0x9b0b('0x4b')][_0x9b0b('0x2e')]);return db[_0x9b0b('0x4e')][_0x9b0b('0x4a')](_0x43ca1c['body'],{'include':[{'model':db[_0x9b0b('0x54')],'as':_0x9b0b('0x50')},{'model':db['Dynamics365Field'],'as':'Descriptions'}]});}return null;})[_0x9b0b('0x24')](respondWithResult(_0x49ddda,null))['catch'](handleError(_0x49ddda,null));};exports[_0x9b0b('0x55')]=function(_0x1b14ba,_0x3024e6,_0x1572be){var _0x1d4eb2=_0x1b14ba[_0x9b0b('0x32')]['ticketType'];var _0x2cda79=_0x1d4eb2===_0x9b0b('0x56')?_0x9b0b('0x57'):_0x9b0b('0x58');var _0x3858e8='';var _0x732298='';var _0x299764='';var _0x2341c3='';var _0x2ef8ad='';var _0x3022ff='';var _0x206e35='';var _0x4479cf='';var _0x26f066=[_0x9b0b('0x59'),'description',_0x9b0b('0x5a'),_0x9b0b('0x5b'),_0x9b0b('0x5c'),_0x9b0b('0x5d'),_0x9b0b('0x5e'),_0x9b0b('0x5f'),_0x9b0b('0x60'),_0x9b0b('0x61')];var _0x44e368=[_0x9b0b('0x62'),_0x9b0b('0x63'),'actualserviceunits',_0x9b0b('0x64'),_0x9b0b('0x65'),'contactidyominame','contractdetailidname',_0x9b0b('0x66'),_0x9b0b('0x67'),_0x9b0b('0x68'),_0x9b0b('0x69'),_0x9b0b('0x6a'),_0x9b0b('0x6b'),'createdonbehalfbyname',_0x9b0b('0x6c'),_0x9b0b('0x6d'),_0x9b0b('0x6e'),'customeridyominame','emailaddress',_0x9b0b('0x6f'),_0x9b0b('0x70'),_0x9b0b('0x71'),_0x9b0b('0x72'),_0x9b0b('0x73'),_0x9b0b('0x74'),'followupby','importsequencenumber','influencescore','kbarticleidname',_0x9b0b('0x75'),'masteridname',_0x9b0b('0x76'),_0x9b0b('0x77'),_0x9b0b('0x78'),_0x9b0b('0x79'),_0x9b0b('0x7a'),_0x9b0b('0x7b'),_0x9b0b('0x7c'),_0x9b0b('0x7d'),'msdyn_iotalertname',_0x9b0b('0x7e'),'onholdtime',_0x9b0b('0x7f'),_0x9b0b('0x80'),_0x9b0b('0x81'),_0x9b0b('0x82'),_0x9b0b('0x83'),_0x9b0b('0x84'),_0x9b0b('0x85'),_0x9b0b('0x86'),_0x9b0b('0x87'),_0x9b0b('0x88'),_0x9b0b('0x89'),_0x9b0b('0x8a'),'responseby',_0x9b0b('0x8b'),_0x9b0b('0x8c'),'sentimentvalue','slainvokedidname',_0x9b0b('0x8d'),_0x9b0b('0x8e'),_0x9b0b('0x8f'),'statuscode',_0x9b0b('0x90'),_0x9b0b('0x91'),'timezoneruleversionnumber',_0x9b0b('0x92'),_0x9b0b('0x93'),_0x9b0b('0x94'),'versionnumber'];var _0x46071c=_0x26f066[_0x9b0b('0x95')](_0x44e368);return db[_0x9b0b('0x2b')]['findOne']({'where':{'id':_0x1b14ba[_0x9b0b('0x46')]['id']},'attributes':['id',_0x9b0b('0x96'),'password',_0x9b0b('0x97'),_0x9b0b('0x98'),_0x9b0b('0x99'),_0x9b0b('0x9a')]})[_0x9b0b('0x24')](handleEntityNotFound(_0x3024e6,null))[_0x9b0b('0x24')](function(_0x1ee566){if(_0x1ee566){_0x4479cf=_0x1ee566[_0x9b0b('0x97')];var _0x40c624=_0x4479cf['slice'](-0x1);if(_0x40c624==='/'){_0x4479cf=_0x4479cf[_0x9b0b('0x9b')](0x0,_0x4479cf[_0x9b0b('0x9c')](_0x40c624));}_0x206e35=util[_0x9b0b('0x9d')](_0x9b0b('0x9e'),_0x4479cf);var _0x65175={'method':_0x9b0b('0x9f'),'uri':_0x9b0b('0xa0')+_0x1ee566[_0x9b0b('0x98')]+_0x9b0b('0xa1'),'form':{'client_id':_0x1ee566[_0x9b0b('0x99')],'resource':_0x4479cf,'username':_0x1ee566['username'],'password':_0x1ee566[_0x9b0b('0xa2')],'grant_type':_0x9b0b('0xa2'),'client_secret':_0x1ee566['clientSecret']},'json':!![]};return rp(_0x65175);}})[_0x9b0b('0x24')](function(_0x1329bc){_0x3022ff=_0x1329bc[_0x9b0b('0xa3')];var _0x5e9e82={'method':'GET','uri':encodeURI(_0x206e35+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x2cda79+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x3022ff,'If-None-Match':null,'OData-Version':_0x9b0b('0xa4')},'json':!![]};return rp(_0x5e9e82);})[_0x9b0b('0x24')](function(_0x384052){var _0x3bece4=_0x384052[_0x9b0b('0xa5')][0x0];var _0x537180=_0x3bece4[_0x9b0b('0xa6')];var _0x194163={'method':_0x9b0b('0xa7'),'uri':_0x206e35+_0x9b0b('0xa8')+_0x537180+_0x9b0b('0xa9'),'headers':{'Authorization':'Bearer\x20'+_0x3022ff,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x194163);})[_0x9b0b('0x24')](function(_0x217a8d){_0x3858e8=_0x217a8d;_0x732298=_0x3858e8[_0x9b0b('0xaa')];_0x732298=_[_0x9b0b('0xab')](_0x732298,function(_0x296a80){return!_0x46071c['includes'](_0x296a80[_0x9b0b('0xac')]);});var _0x503cb2=[];var _0x20c12b=[];_0x732298[_0x9b0b('0xad')](function(_0x589073){if(_0x589073[_0x9b0b('0xae')]){var _0x47fe30=_0x589073[_0x9b0b('0xae')]['substring'](_0x589073['@odata.type'][_0x9b0b('0x9c')]('.')+0x1);if(_0x47fe30===_0x9b0b('0xaf')){_0x503cb2[_0x9b0b('0xb0')](getSelectList(_0x206e35,_0x1d4eb2,_0x20c12b,_0x3858e8['MetadataId'],_0x589073[_0x9b0b('0xa6')],_0x3022ff));}}});return Promise[_0x9b0b('0xb1')](_0x503cb2);})[_0x9b0b('0x24')](function(_0x3277e2){_0x299764=_0x3277e2[0x0];var _0x57967e=[];var _0x174960=[];_0x732298[_0x9b0b('0xad')](function(_0x53aced){if(!_[_0x9b0b('0xb2')](_0x53aced[_0x9b0b('0xae')])){var _0x2a5b68=_0x53aced[_0x9b0b('0xae')][_0x9b0b('0x9b')](_0x53aced[_0x9b0b('0xae')][_0x9b0b('0x9c')]('.')+0x1);if(_0x2a5b68===_0x9b0b('0xb3')){_0x57967e[_0x9b0b('0xb0')](getBooleanList(_0x206e35,_0x1d4eb2,_0x174960,_0x3858e8[_0x9b0b('0xa6')],_0x53aced[_0x9b0b('0xa6')],_0x3022ff));}}});return Promise[_0x9b0b('0xb1')](_0x57967e);})[_0x9b0b('0x24')](function(_0x55aeb9){_0x2341c3=_0x55aeb9[0x0];var _0xf6e8b2=[];var _0x3dc705=[];_0x732298[_0x9b0b('0xad')](function(_0x589014){if(_0x589014[_0x9b0b('0xae')]){var _0x8758f2=_0x589014[_0x9b0b('0xae')][_0x9b0b('0x9b')](_0x589014[_0x9b0b('0xae')][_0x9b0b('0x9c')]('.')+0x1);if(_0x8758f2===_0x9b0b('0xb4')||_0x8758f2===_0x9b0b('0xb5')||_0x8758f2==='BigIntAttributeMetadata'||_0x8758f2===_0x9b0b('0xb6')||_0x8758f2==='MemoAttributeMetadata'||_0x8758f2===_0x9b0b('0xb7')||_0x8758f2===_0x9b0b('0xb8')||_0x8758f2===_0x9b0b('0xb9')||_0x8758f2==='StateAttributeMetadata'||_0x8758f2===_0x9b0b('0xba')){_0xf6e8b2['push'](getInputList(_0x206e35,_0x1d4eb2,_0x8758f2,_0x3dc705,_0x3858e8[_0x9b0b('0xa6')],_0x589014[_0x9b0b('0xa6')],_0x3022ff));}}});return Promise[_0x9b0b('0xb1')](_0xf6e8b2);})[_0x9b0b('0x24')](function(_0x552a1a){_0x2ef8ad=_0x552a1a[0x0];var _0x22bff9=_0x299764[_0x9b0b('0x95')](_0x2341c3)[_0x9b0b('0x95')](_0x2ef8ad);var _0x105a58={'count':_0x22bff9[_0x9b0b('0x37')],'rows':_0x22bff9};return _0x105a58;})['then'](respondWithResult(_0x3024e6,null))[_0x9b0b('0x49')](function(_0x64399d){var _0x338587=_0x1b14ba[_0x9b0b('0x32')][_0x9b0b('0xbb')]?0x1f4:_0x64399d[_0x9b0b('0xbc')]||0x1f4;logger[_0x9b0b('0xbd')](_0x64399d[_0x9b0b('0x27')]);delete _0x64399d[_0x9b0b('0x28')];if(_0x338587===0x191){_0x338587=0x190;}_0x3024e6[_0x9b0b('0x26')](_0x338587)['send'](_0x1b14ba[_0x9b0b('0x32')][_0x9b0b('0xbb')]?{'message':_0x9b0b('0xbe'),'statusCode':_0x64399d[_0x9b0b('0xbc')]}:_0x64399d);});};function getSelectList(_0x11d770,_0x2a74f6,_0x1fcf48,_0x453c36,_0x398cb6,_0x145298){var _0x51d212={'method':_0x9b0b('0xa7'),'uri':_0x11d770+_0x9b0b('0xa8')+_0x453c36+_0x9b0b('0xbf')+_0x398cb6+_0x9b0b('0xc0')+_0x9b0b('0xc1'),'headers':{'Authorization':'Bearer\x20'+_0x145298,'If-None-Match':null,'OData-Version':_0x9b0b('0xa4')},'json':!![]};return rp(_0x51d212)[_0x9b0b('0x24')](function(_0x296015){var _0x2cfe37=[];var _0x589a79=_0x296015[_0x9b0b('0xc2')][_0x9b0b('0xc3')];_0x589a79[_0x9b0b('0xad')](function(_0x769efe){_0x2cfe37[_0x9b0b('0xb0')]({'name':_0x769efe[_0x9b0b('0xc4')][_0x9b0b('0xc5')][_0x9b0b('0xc4')],'value':String(_0x769efe[_0x9b0b('0xc6')])});});var _0x4a4f0c={'id':_0x2a74f6+'_'+_0x296015['LogicalName'],'name':_0x296015[_0x9b0b('0xc7')][_0x9b0b('0xc5')][_0x9b0b('0xc4')],'custom':![],'options':_0x2cfe37};_0x1fcf48[_0x9b0b('0xb0')](_0x4a4f0c);return _0x1fcf48;});}function getBooleanList(_0x4d3ccd,_0x2272bb,_0x4d5e14,_0x15d04b,_0x248194,_0x23c0b3){var _0x48a4ab={'method':'GET','uri':_0x4d3ccd+_0x9b0b('0xa8')+_0x15d04b+_0x9b0b('0xbf')+_0x248194+_0x9b0b('0xc8'),'headers':{'Authorization':_0x9b0b('0xc9')+_0x23c0b3,'If-None-Match':null,'OData-Version':_0x9b0b('0xa4')},'json':!![]};return rp(_0x48a4ab)[_0x9b0b('0x24')](function(_0x554fe6){var _0x5bdbfe=[];_0x5bdbfe['push']({'name':_0x554fe6['OptionSet'][_0x9b0b('0xca')][_0x9b0b('0xc4')][_0x9b0b('0xc5')][_0x9b0b('0xc4')],'value':_0x9b0b('0xcb')},{'name':_0x554fe6[_0x9b0b('0xc2')]['FalseOption']['Label'][_0x9b0b('0xc5')][_0x9b0b('0xc4')],'value':_0x9b0b('0xcc')});var _0x4438b9={'id':_0x2272bb+'_'+_0x554fe6[_0x9b0b('0xac')],'name':_0x554fe6[_0x9b0b('0xc7')]['UserLocalizedLabel'][_0x9b0b('0xc4')],'custom':![],'options':_0x5bdbfe};_0x4d5e14[_0x9b0b('0xb0')](_0x4438b9);return _0x4d5e14;});}function getInputList(_0x191c44,_0x5cece4,_0x106e5e,_0x188183,_0x1463e1,_0x3be1b4,_0x14117c){var _0x446160={'method':_0x9b0b('0xa7'),'uri':_0x191c44+'EntityDefinitions('+_0x1463e1+_0x9b0b('0xbf')+_0x3be1b4+_0x9b0b('0xcd')+_0x106e5e+_0x9b0b('0xce'),'headers':{'Authorization':_0x9b0b('0xc9')+_0x14117c,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x446160)[_0x9b0b('0x24')](function(_0x5afae3){var _0x252f7={'id':_0x5cece4+'_'+_0x5afae3[_0x9b0b('0xac')],'name':_0x5afae3[_0x9b0b('0xc7')]['UserLocalizedLabel']?_0x5afae3[_0x9b0b('0xc7')]['UserLocalizedLabel'][_0x9b0b('0xc4')]:_0x5afae3['LogicalName'],'custom':![],'options':[]};_0x188183['push'](_0x252f7);return _0x188183;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 8f87adc..8dfba13 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 _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts'];(function(_0x1f9f5f,_0x509fb7){var _0x51d649=function(_0x4a5285){while(--_0x4a5285){_0x1f9f5f['push'](_0x1f9f5f['shift']());}};_0x51d649(++_0x509fb7);}(_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'));var integrations=require(_0x3071('0x8'));module[_0x3071('0x9')]=function(_0x41cf76,_0x1d3dd6){return _0x41cf76[_0x3071('0xa')](_0x3071('0xb'),attributes,{'tableName':_0x3071('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x757a=['Dynamics365Account','int_dynamics365_accounts','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0x1c568e,_0x3bf9af){var _0x4c7789=function(_0x47e657){while(--_0x47e657){_0x1c568e['push'](_0x1c568e['shift']());}};_0x4c7789(++_0x3bf9af);}(_0x757a,0xde));var _0xa757=function(_0x327af9,_0x47e14d){_0x327af9=_0x327af9-0x0;var _0x307073=_0x757a[_0x327af9];return _0x307073;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));var integrations=require(_0xa757('0x7'));module['exports']=function(_0xae0e7c,_0x4343b6){return _0xae0e7c['define'](_0xa757('0x8'),attributes,{'tableName':_0xa757('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 4062e56..e30bbea 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 _0x8130=['code','message','result','GetDynamics365Account','Dynamics365Account','findAll','raw','options','where','attributes','include','map','model','then','info','catch','ShowDynamics365Account','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x451756,_0x25d98f){var _0x49ef0e=function(_0x2c5b6b){while(--_0x2c5b6b){_0x451756['push'](_0x451756['shift']());}};_0x49ef0e(++_0x25d98f);}(_0x8130,0x7d));var _0x0813=function(_0x2f6fb6,_0x3fefb1){_0x2f6fb6=_0x2f6fb6-0x0;var _0x55c48f=_0x8130[_0x2f6fb6];return _0x55c48f;};'use strict';var _=require(_0x0813('0x0'));var util=require(_0x0813('0x1'));var moment=require(_0x0813('0x2'));var BPromise=require(_0x0813('0x3'));var rs=require(_0x0813('0x4'));var fs=require('fs');var Redis=require(_0x0813('0x5'));var db=require(_0x0813('0x6'))['db'];var utils=require(_0x0813('0x7'));var logger=require(_0x0813('0x8'))(_0x0813('0x9'));var config=require(_0x0813('0xa'));var jayson=require(_0x0813('0xb'));var client=jayson['client'][_0x0813('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5809f9,_0x4c4c2e,_0x344432){return new BPromise(function(_0x5b1f77,_0x34cca8){return client[_0x0813('0xd')](_0x5809f9,_0x344432)['then'](function(_0x410822){logger['info'](_0x0813('0xe'),_0x4c4c2e,_0x0813('0xf'));logger[_0x0813('0x10')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x4c4c2e,_0x0813('0xf'),JSON[_0x0813('0x11')](_0x410822));if(_0x410822[_0x0813('0x12')]){if(_0x410822[_0x0813('0x12')][_0x0813('0x13')]===0x1f4){logger['error'](_0x0813('0xe'),_0x4c4c2e,_0x410822[_0x0813('0x12')]['message']);return _0x34cca8(_0x410822['error']['message']);}logger['error'](_0x0813('0xe'),_0x4c4c2e,_0x410822[_0x0813('0x12')][_0x0813('0x14')]);return _0x5b1f77(_0x410822['error'][_0x0813('0x14')]);}else{logger['info'](_0x0813('0xe'),_0x4c4c2e,_0x0813('0xf'));_0x5b1f77(_0x410822[_0x0813('0x15')][_0x0813('0x14')]);}})['catch'](function(_0x457cad){logger[_0x0813('0x12')](_0x0813('0xe'),_0x4c4c2e,_0x457cad);_0x34cca8(_0x457cad);});});}exports[_0x0813('0x16')]=function(_0xc46583){var _0x54bd86=this;return new Promise(function(_0x37eaac,_0x139f1a){return db[_0x0813('0x17')][_0x0813('0x18')]({'raw':_0xc46583['options']?_0xc46583['options'][_0x0813('0x19')]===undefined?!![]:![]:!![],'where':_0xc46583[_0x0813('0x1a')]?_0xc46583['options'][_0x0813('0x1b')]||null:null,'attributes':_0xc46583[_0x0813('0x1a')]?_0xc46583[_0x0813('0x1a')][_0x0813('0x1c')]||null:null,'limit':_0xc46583[_0x0813('0x1a')]?_0xc46583[_0x0813('0x1a')]['limit']||null:null,'include':_0xc46583[_0x0813('0x1a')]?_0xc46583[_0x0813('0x1a')][_0x0813('0x1d')]?_[_0x0813('0x1e')](_0xc46583[_0x0813('0x1a')][_0x0813('0x1d')],function(_0x2e0be0){return{'model':db[_0x2e0be0[_0x0813('0x1f')]],'as':_0x2e0be0['as'],'attributes':_0x2e0be0[_0x0813('0x1c')],'include':_0x2e0be0[_0x0813('0x1d')]?_[_0x0813('0x1e')](_0x2e0be0['include'],function(_0x1795ae){return{'model':db[_0x1795ae[_0x0813('0x1f')]],'as':_0x1795ae['as'],'attributes':_0x1795ae[_0x0813('0x1c')],'include':_0x1795ae['include']?_[_0x0813('0x1e')](_0x1795ae['include'],function(_0x200d78){return{'model':db[_0x200d78['model']],'as':_0x200d78['as'],'attributes':_0x200d78[_0x0813('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x0813('0x20')](function(_0xacb049){logger[_0x0813('0x21')](_0x0813('0x16'),_0xc46583);logger[_0x0813('0x10')](_0x0813('0x16'),_0xc46583,JSON[_0x0813('0x11')](_0xacb049));_0x37eaac(_0xacb049);})[_0x0813('0x22')](function(_0x474f26){logger['error'](_0x0813('0x16'),_0x474f26[_0x0813('0x14')],_0xc46583);_0x139f1a(_0x54bd86[_0x0813('0x12')](0x1f4,_0x474f26['message']));});});};exports[_0x0813('0x23')]=function(_0x1c8c85){var _0x58d51a=this;return new Promise(function(_0x5d94f8,_0x5481c6){return db[_0x0813('0x17')]['find']({'raw':_0x1c8c85['options']?_0x1c8c85[_0x0813('0x1a')][_0x0813('0x19')]===undefined?!![]:![]:!![],'where':_0x1c8c85[_0x0813('0x1a')]?_0x1c8c85[_0x0813('0x1a')][_0x0813('0x1b')]||null:null,'attributes':_0x1c8c85['options']?_0x1c8c85['options'][_0x0813('0x1c')]||null:null,'include':_0x1c8c85[_0x0813('0x1a')]?_0x1c8c85[_0x0813('0x1a')][_0x0813('0x1d')]?_[_0x0813('0x1e')](_0x1c8c85[_0x0813('0x1a')][_0x0813('0x1d')],function(_0x361818){return{'model':db[_0x361818['model']],'as':_0x361818['as'],'attributes':_0x361818[_0x0813('0x1c')],'include':_0x361818[_0x0813('0x1d')]?_['map'](_0x361818[_0x0813('0x1d')],function(_0x337598){return{'model':db[_0x337598[_0x0813('0x1f')]],'as':_0x337598['as'],'attributes':_0x337598[_0x0813('0x1c')],'include':_0x337598[_0x0813('0x1d')]?_[_0x0813('0x1e')](_0x337598[_0x0813('0x1d')],function(_0x197f97){return{'model':db[_0x197f97[_0x0813('0x1f')]],'as':_0x197f97['as'],'attributes':_0x197f97[_0x0813('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x0813('0x20')](function(_0x3abbda){logger[_0x0813('0x21')](_0x0813('0x23'),_0x1c8c85);logger[_0x0813('0x10')](_0x0813('0x23'),_0x1c8c85,JSON[_0x0813('0x11')](_0x3abbda));_0x5d94f8(_0x3abbda);})['catch'](function(_0x39a697){logger[_0x0813('0x12')](_0x0813('0x23'),_0x39a697[_0x0813('0x14')],_0x1c8c85);_0x5481c6(_0x58d51a[_0x0813('0x12')](0x1f4,_0x39a697[_0x0813('0x14')]));});});}; \ No newline at end of file +var _0x0e04=['../../config/environment','jayson/promise','client','http','request','then','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetDynamics365Account','findAll','options','attributes','limit','include','map','model','ShowDynamics365Account','find','raw','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x56e760,_0x2c38a3){var _0x2e39a7=function(_0x5a8be3){while(--_0x5a8be3){_0x56e760['push'](_0x56e760['shift']());}};_0x2e39a7(++_0x2c38a3);}(_0x0e04,0x111));var _0x40e0=function(_0x16d8a7,_0xe0a184){_0x16d8a7=_0x16d8a7-0x0;var _0x2ee312=_0x0e04[_0x16d8a7];return _0x2ee312;};'use strict';var _=require(_0x40e0('0x0'));var util=require(_0x40e0('0x1'));var moment=require(_0x40e0('0x2'));var BPromise=require('bluebird');var rs=require(_0x40e0('0x3'));var fs=require('fs');var Redis=require(_0x40e0('0x4'));var db=require(_0x40e0('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x40e0('0x6'))('rpc');var config=require(_0x40e0('0x7'));var jayson=require(_0x40e0('0x8'));var client=jayson[_0x40e0('0x9')][_0x40e0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1c9db7,_0x2e8b1b,_0x1fb8dc){return new BPromise(function(_0x5f1fcb,_0x2af0ba){return client[_0x40e0('0xb')](_0x1c9db7,_0x1fb8dc)[_0x40e0('0xc')](function(_0x1e0888){logger['info'](_0x40e0('0xd'),_0x2e8b1b,_0x40e0('0xe'));logger[_0x40e0('0xf')](_0x40e0('0x10'),_0x2e8b1b,_0x40e0('0xe'),JSON[_0x40e0('0x11')](_0x1e0888));if(_0x1e0888[_0x40e0('0x12')]){if(_0x1e0888[_0x40e0('0x12')][_0x40e0('0x13')]===0x1f4){logger[_0x40e0('0x12')](_0x40e0('0xd'),_0x2e8b1b,_0x1e0888[_0x40e0('0x12')][_0x40e0('0x14')]);return _0x2af0ba(_0x1e0888[_0x40e0('0x12')]['message']);}logger[_0x40e0('0x12')](_0x40e0('0xd'),_0x2e8b1b,_0x1e0888['error'][_0x40e0('0x14')]);return _0x5f1fcb(_0x1e0888[_0x40e0('0x12')]['message']);}else{logger[_0x40e0('0x15')](_0x40e0('0xd'),_0x2e8b1b,_0x40e0('0xe'));_0x5f1fcb(_0x1e0888[_0x40e0('0x16')][_0x40e0('0x14')]);}})[_0x40e0('0x17')](function(_0x33eb70){logger[_0x40e0('0x12')](_0x40e0('0xd'),_0x2e8b1b,_0x33eb70);_0x2af0ba(_0x33eb70);});});}exports[_0x40e0('0x18')]=function(_0x3badeb){var _0x80793b=this;return new Promise(function(_0x20b70f,_0x3abcfd){return db['Dynamics365Account'][_0x40e0('0x19')]({'raw':_0x3badeb['options']?_0x3badeb['options']['raw']===undefined?!![]:![]:!![],'where':_0x3badeb[_0x40e0('0x1a')]?_0x3badeb[_0x40e0('0x1a')]['where']||null:null,'attributes':_0x3badeb['options']?_0x3badeb[_0x40e0('0x1a')][_0x40e0('0x1b')]||null:null,'limit':_0x3badeb[_0x40e0('0x1a')]?_0x3badeb[_0x40e0('0x1a')][_0x40e0('0x1c')]||null:null,'include':_0x3badeb[_0x40e0('0x1a')]?_0x3badeb[_0x40e0('0x1a')][_0x40e0('0x1d')]?_[_0x40e0('0x1e')](_0x3badeb[_0x40e0('0x1a')]['include'],function(_0x41a3e5){return{'model':db[_0x41a3e5[_0x40e0('0x1f')]],'as':_0x41a3e5['as'],'attributes':_0x41a3e5['attributes'],'include':_0x41a3e5['include']?_[_0x40e0('0x1e')](_0x41a3e5['include'],function(_0x2254d3){return{'model':db[_0x2254d3['model']],'as':_0x2254d3['as'],'attributes':_0x2254d3[_0x40e0('0x1b')],'include':_0x2254d3[_0x40e0('0x1d')]?_['map'](_0x2254d3[_0x40e0('0x1d')],function(_0x2dbe3d){return{'model':db[_0x2dbe3d[_0x40e0('0x1f')]],'as':_0x2dbe3d['as'],'attributes':_0x2dbe3d[_0x40e0('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x40e0('0xc')](function(_0x1943d5){logger['info'](_0x40e0('0x18'),_0x3badeb);logger[_0x40e0('0xf')](_0x40e0('0x18'),_0x3badeb,JSON['stringify'](_0x1943d5));_0x20b70f(_0x1943d5);})['catch'](function(_0x4f5050){logger[_0x40e0('0x12')](_0x40e0('0x18'),_0x4f5050[_0x40e0('0x14')],_0x3badeb);_0x3abcfd(_0x80793b[_0x40e0('0x12')](0x1f4,_0x4f5050[_0x40e0('0x14')]));});});};exports[_0x40e0('0x20')]=function(_0x2f7c50){var _0x18b5ba=this;return new Promise(function(_0x4a8278,_0x3c56d3){return db['Dynamics365Account'][_0x40e0('0x21')]({'raw':_0x2f7c50['options']?_0x2f7c50[_0x40e0('0x1a')][_0x40e0('0x22')]===undefined?!![]:![]:!![],'where':_0x2f7c50[_0x40e0('0x1a')]?_0x2f7c50[_0x40e0('0x1a')]['where']||null:null,'attributes':_0x2f7c50[_0x40e0('0x1a')]?_0x2f7c50['options'][_0x40e0('0x1b')]||null:null,'include':_0x2f7c50[_0x40e0('0x1a')]?_0x2f7c50[_0x40e0('0x1a')][_0x40e0('0x1d')]?_[_0x40e0('0x1e')](_0x2f7c50[_0x40e0('0x1a')][_0x40e0('0x1d')],function(_0x142e5f){return{'model':db[_0x142e5f[_0x40e0('0x1f')]],'as':_0x142e5f['as'],'attributes':_0x142e5f[_0x40e0('0x1b')],'include':_0x142e5f[_0x40e0('0x1d')]?_[_0x40e0('0x1e')](_0x142e5f[_0x40e0('0x1d')],function(_0x5f18dd){return{'model':db[_0x5f18dd[_0x40e0('0x1f')]],'as':_0x5f18dd['as'],'attributes':_0x5f18dd['attributes'],'include':_0x5f18dd[_0x40e0('0x1d')]?_[_0x40e0('0x1e')](_0x5f18dd[_0x40e0('0x1d')],function(_0xd83418){return{'model':db[_0xd83418[_0x40e0('0x1f')]],'as':_0xd83418['as'],'attributes':_0xd83418[_0x40e0('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x40e0('0xc')](function(_0x57c531){logger[_0x40e0('0x15')]('ShowDynamics365Account',_0x2f7c50);logger[_0x40e0('0xf')](_0x40e0('0x20'),_0x2f7c50,JSON['stringify'](_0x57c531));_0x4a8278(_0x57c531);})[_0x40e0('0x17')](function(_0x30c1c7){logger[_0x40e0('0x12')](_0x40e0('0x20'),_0x30c1c7['message'],_0x2f7c50);_0x3c56d3(_0x18b5ba['error'](0x1f4,_0x30c1c7[_0x40e0('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 9987088..3287aec 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 _0x6ce1=['delete','exports','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','/:id','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post','put'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x6ce1,0xca));var _0x16ce=function(_0xebf3ca,_0x4f988d){_0xebf3ca=_0xebf3ca-0x0;var _0x51f2a8=_0x6ce1[_0xebf3ca];return _0x51f2a8;};'use strict';var multer=require('multer');var util=require(_0x16ce('0x0'));var path=require(_0x16ce('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x16ce('0x2')]();var fs_extra=require(_0x16ce('0x3'));var auth=require(_0x16ce('0x4'));var interaction=require(_0x16ce('0x5'));var config=require(_0x16ce('0x6'));var controller=require(_0x16ce('0x7'));router[_0x16ce('0x8')]('/',auth[_0x16ce('0x9')](),controller['index']);router[_0x16ce('0x8')](_0x16ce('0xa'),auth[_0x16ce('0x9')](),controller['show']);router[_0x16ce('0x8')](_0x16ce('0xb'),auth[_0x16ce('0x9')](),controller[_0x16ce('0xc')]);router[_0x16ce('0x8')]('/:id/subjects',auth['isAuthenticated'](),controller[_0x16ce('0xd')]);router[_0x16ce('0x8')](_0x16ce('0xe'),auth['isAuthenticated'](),controller[_0x16ce('0xf')]);router[_0x16ce('0x10')]('/',auth[_0x16ce('0x9')](),controller['create']);router[_0x16ce('0x11')](_0x16ce('0xa'),auth[_0x16ce('0x9')](),controller['update']);router[_0x16ce('0x12')](_0x16ce('0xa'),auth[_0x16ce('0x9')](),controller['destroy']);module[_0x16ce('0x13')]=router; \ No newline at end of file +var _0xd48a=['Router','fs-extra','../../components/auth/service','../../config/environment','./intDynamics365Configuration.controller','isAuthenticated','show','get','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','/:id','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x4c0c55,_0x1e8f70){var _0x32f6de=function(_0x5e699e){while(--_0x5e699e){_0x4c0c55['push'](_0x4c0c55['shift']());}};_0x32f6de(++_0x1e8f70);}(_0xd48a,0x96));var _0xad48=function(_0x597d48,_0x25a706){_0x597d48=_0x597d48-0x0;var _0x22c76e=_0xd48a[_0x597d48];return _0x22c76e;};'use strict';var multer=require(_0xad48('0x0'));var util=require('util');var path=require(_0xad48('0x1'));var timeout=require(_0xad48('0x2'));var express=require(_0xad48('0x3'));var router=express[_0xad48('0x4')]();var fs_extra=require(_0xad48('0x5'));var auth=require(_0xad48('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xad48('0x7'));var controller=require(_0xad48('0x8'));router['get']('/',auth[_0xad48('0x9')](),controller['index']);router['get']('/:id',auth[_0xad48('0x9')](),controller[_0xad48('0xa')]);router[_0xad48('0xb')](_0xad48('0xc'),auth[_0xad48('0x9')](),controller[_0xad48('0xd')]);router[_0xad48('0xb')](_0xad48('0xe'),auth['isAuthenticated'](),controller[_0xad48('0xf')]);router['get'](_0xad48('0x10'),auth[_0xad48('0x9')](),controller['getDescriptions']);router[_0xad48('0x11')]('/',auth[_0xad48('0x9')](),controller['create']);router['put'](_0xad48('0x12'),auth[_0xad48('0x9')](),controller['update']);router[_0xad48('0x13')](_0xad48('0x12'),auth['isAuthenticated'](),controller[_0xad48('0x14')]);module[_0xad48('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index ef747a1..622414b 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 _0xd216=['ENUM','incident','phonecall','sequelize','STRING'];(function(_0x31f2b7,_0x2e2ef4){var _0x3bccc0=function(_0x1d4694){while(--_0x1d4694){_0x31f2b7['push'](_0x31f2b7['shift']());}};_0x3bccc0(++_0x2e2ef4);}(_0xd216,0x198));var _0x6d21=function(_0x3b724b,_0x9a0f1d){_0x3b724b=_0x3b724b-0x0;var _0x2725da=_0xd216[_0x3b724b];return _0x2725da;};'use strict';var Sequelize=require(_0x6d21('0x0'));module['exports']={'name':{'type':Sequelize[_0x6d21('0x1')]},'description':{'type':Sequelize[_0x6d21('0x1')]},'ticketType':{'type':Sequelize[_0x6d21('0x2')](_0x6d21('0x3'),_0x6d21('0x4')),'defaultValue':'incident'}}; \ No newline at end of file +var _0x63f9=['ENUM','incident','phonecall','sequelize','exports','STRING'];(function(_0x4ea5cf,_0x4bd89e){var _0xfdfef9=function(_0x48aecd){while(--_0x48aecd){_0x4ea5cf['push'](_0x4ea5cf['shift']());}};_0xfdfef9(++_0x4bd89e);}(_0x63f9,0x1e9));var _0x963f=function(_0x48b827,_0x269c4e){_0x48b827=_0x48b827-0x0;var _0x2a0573=_0x63f9[_0x48b827];return _0x2a0573;};'use strict';var Sequelize=require(_0x963f('0x0'));module[_0x963f('0x1')]={'name':{'type':Sequelize[_0x963f('0x2')]},'description':{'type':Sequelize[_0x963f('0x2')]},'ticketType':{'type':Sequelize[_0x963f('0x3')](_0x963f('0x4'),_0x963f('0x5')),'defaultValue':_0x963f('0x4')}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 4a8e8f1..0e34f25 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 _0xdb81=['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/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','save','update','then','destroy','end','error','stack','name','send','index','map','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','Dynamics365Configuration','includeAll','include','findAll','rows','show','params','keys','rawAttributes','find','create','body','catch','findOne','Dynamics365Field','nolimit','getFields','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0x1b828b,_0x344400){var _0x98da1a=function(_0x1a0f5b){while(--_0x1a0f5b){_0x1b828b['push'](_0x1b828b['shift']());}};_0x98da1a(++_0x344400);}(_0xdb81,0xf8));var _0x1db8=function(_0x2657c1,_0x50043d){_0x2657c1=_0x2657c1-0x0;var _0x2a94c3=_0xdb81[_0x2657c1];return _0x2a94c3;};'use strict';var emlformat=require(_0x1db8('0x0'));var rimraf=require(_0x1db8('0x1'));var zipdir=require(_0x1db8('0x2'));var jsonpatch=require(_0x1db8('0x3'));var rp=require('request-promise');var moment=require(_0x1db8('0x4'));var BPromise=require(_0x1db8('0x5'));var Mustache=require(_0x1db8('0x6'));var util=require(_0x1db8('0x7'));var path=require(_0x1db8('0x8'));var sox=require(_0x1db8('0x9'));var csv=require(_0x1db8('0xa'));var ejs=require(_0x1db8('0xb'));var fs=require('fs');var fs_extra=require(_0x1db8('0xc'));var _=require(_0x1db8('0xd'));var squel=require(_0x1db8('0xe'));var crypto=require(_0x1db8('0xf'));var jsforce=require(_0x1db8('0x10'));var deskjs=require(_0x1db8('0x11'));var toCsv=require('to-csv');var querystring=require(_0x1db8('0x12'));var Papa=require(_0x1db8('0x13'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1db8('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1db8('0x15'));var logger=require(_0x1db8('0x16'))(_0x1db8('0x17'));var utils=require(_0x1db8('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x1db8('0x19'));var db=require(_0x1db8('0x1a'))['db'];function respondWithStatusCode(_0x1771d3,_0x2d68fc){_0x2d68fc=_0x2d68fc||0xcc;return function(_0x5476af){if(_0x5476af){return _0x1771d3[_0x1db8('0x1b')](_0x2d68fc);}return _0x1771d3['status'](_0x2d68fc)['end']();};}function respondWithResult(_0x16de20,_0x131e84){_0x131e84=_0x131e84||0xc8;return function(_0x1f2f74){if(_0x1f2f74){return _0x16de20[_0x1db8('0x1c')](_0x131e84)[_0x1db8('0x1d')](_0x1f2f74);}};}function respondWithFilteredResult(_0x226b88,_0x50ed1f){return function(_0x3f1ee5){if(_0x3f1ee5){var _0xb030e2=typeof _0x50ed1f[_0x1db8('0x1e')]==='undefined'&&typeof _0x50ed1f[_0x1db8('0x1f')]===_0x1db8('0x20');var _0x1b02af=_0x3f1ee5[_0x1db8('0x21')];var _0x53d6d3=_0xb030e2?0x0:_0x50ed1f['offset'];var _0x140d80=_0xb030e2?_0x3f1ee5[_0x1db8('0x21')]:_0x50ed1f[_0x1db8('0x1e')]+_0x50ed1f[_0x1db8('0x1f')];var _0x157fbe;if(_0x140d80>=_0x1b02af){_0x140d80=_0x1b02af;_0x157fbe=0xc8;}else{_0x157fbe=0xce;}_0x226b88[_0x1db8('0x1c')](_0x157fbe);return _0x226b88[_0x1db8('0x22')](_0x1db8('0x23'),_0x53d6d3+'-'+_0x140d80+'/'+_0x1b02af)[_0x1db8('0x1d')](_0x3f1ee5);}return null;};}function patchUpdates(_0x31867a){return function(_0x508e81){try{jsonpatch['apply'](_0x508e81,_0x31867a,!![]);}catch(_0x29a28c){return BPromise['reject'](_0x29a28c);}return _0x508e81[_0x1db8('0x24')]();};}function saveUpdates(_0x144593,_0x3585ed){return function(_0x4ae3a7){if(_0x4ae3a7){return _0x4ae3a7[_0x1db8('0x25')](_0x144593)[_0x1db8('0x26')](function(_0x585613){return _0x585613;});}return null;};}function removeEntity(_0x4d69ae,_0xd7cfe7){return function(_0x2687ab){if(_0x2687ab){return _0x2687ab[_0x1db8('0x27')]()['then'](function(){_0x4d69ae['status'](0xcc)[_0x1db8('0x28')]();});}};}function handleEntityNotFound(_0x2fd170,_0x543d29){return function(_0x30b973){if(!_0x30b973){_0x2fd170['sendStatus'](0x194);}return _0x30b973;};}function handleError(_0x73177a,_0x20fad5){_0x20fad5=_0x20fad5||0x1f4;return function(_0x3451bb){logger[_0x1db8('0x29')](_0x3451bb[_0x1db8('0x2a')]);if(_0x3451bb[_0x1db8('0x2b')]){delete _0x3451bb[_0x1db8('0x2b')];}_0x73177a[_0x1db8('0x1c')](_0x20fad5)[_0x1db8('0x2c')](_0x3451bb);};}exports[_0x1db8('0x2d')]=function(_0x4d3fa9,_0x486623){var _0x4c603c={},_0x412121={},_0x1db8a9={'count':0x0,'rows':[]};var _0x5cfc10=_[_0x1db8('0x2e')](db['Dynamics365Configuration']['rawAttributes'],function(_0x2cbea3){return{'name':_0x2cbea3[_0x1db8('0x2f')],'type':_0x2cbea3[_0x1db8('0x30')][_0x1db8('0x31')]};});_0x412121[_0x1db8('0x32')]=_[_0x1db8('0x2e')](_0x5cfc10,'name');_0x412121[_0x1db8('0x33')]=_['keys'](_0x4d3fa9[_0x1db8('0x33')]);_0x412121[_0x1db8('0x34')]=_[_0x1db8('0x35')](_0x412121['model'],_0x412121[_0x1db8('0x33')]);_0x4c603c['attributes']=_[_0x1db8('0x35')](_0x412121['model'],qs[_0x1db8('0x36')](_0x4d3fa9[_0x1db8('0x33')]['fields']));_0x4c603c[_0x1db8('0x37')]=_0x4c603c['attributes'][_0x1db8('0x38')]?_0x4c603c[_0x1db8('0x37')]:_0x412121['model'];if(!_0x4d3fa9[_0x1db8('0x33')][_0x1db8('0x39')]('nolimit')){_0x4c603c[_0x1db8('0x1f')]=qs['limit'](_0x4d3fa9['query'][_0x1db8('0x1f')]);_0x4c603c[_0x1db8('0x1e')]=qs[_0x1db8('0x1e')](_0x4d3fa9[_0x1db8('0x33')]['offset']);}_0x4c603c[_0x1db8('0x3a')]=qs[_0x1db8('0x3b')](_0x4d3fa9[_0x1db8('0x33')][_0x1db8('0x3b')]);_0x4c603c[_0x1db8('0x3c')]=qs[_0x1db8('0x34')](_[_0x1db8('0x3d')](_0x4d3fa9[_0x1db8('0x33')],_0x412121[_0x1db8('0x34')]),_0x5cfc10);if(_0x4d3fa9[_0x1db8('0x33')]['filter']){_0x4c603c[_0x1db8('0x3c')]=_[_0x1db8('0x3e')](_0x4c603c['where'],{'$or':_[_0x1db8('0x2e')](_0x5cfc10,function(_0x2380f6){if(_0x2380f6[_0x1db8('0x30')]!==_0x1db8('0x3f')){var _0x439447={};_0x439447[_0x2380f6[_0x1db8('0x2b')]]={'$like':'%'+_0x4d3fa9[_0x1db8('0x33')][_0x1db8('0x40')]+'%'};return _0x439447;}})});}_0x4c603c=_[_0x1db8('0x3e')]({},_0x4c603c,_0x4d3fa9[_0x1db8('0x41')]);var _0x647090={'where':_0x4c603c['where']};return db[_0x1db8('0x42')][_0x1db8('0x21')](_0x647090)[_0x1db8('0x26')](function(_0x563194){_0x1db8a9[_0x1db8('0x21')]=_0x563194;if(_0x4d3fa9['query'][_0x1db8('0x43')]){_0x4c603c[_0x1db8('0x44')]=[{'all':!![]}];}return db[_0x1db8('0x42')][_0x1db8('0x45')](_0x4c603c);})[_0x1db8('0x26')](function(_0x3cc56a){_0x1db8a9[_0x1db8('0x46')]=_0x3cc56a;return _0x1db8a9;})['then'](respondWithFilteredResult(_0x486623,_0x4c603c))['catch'](handleError(_0x486623,null));};exports[_0x1db8('0x47')]=function(_0x3f52f2,_0x334aff){var _0x420293={'raw':![],'where':{'id':_0x3f52f2[_0x1db8('0x48')]['id']}},_0x2ee3b7={};_0x2ee3b7[_0x1db8('0x32')]=_[_0x1db8('0x49')](db['Dynamics365Configuration'][_0x1db8('0x4a')]);_0x2ee3b7[_0x1db8('0x33')]=_[_0x1db8('0x49')](_0x3f52f2[_0x1db8('0x33')]);_0x2ee3b7[_0x1db8('0x34')]=_[_0x1db8('0x35')](_0x2ee3b7[_0x1db8('0x32')],_0x2ee3b7['query']);_0x420293['attributes']=_[_0x1db8('0x35')](_0x2ee3b7[_0x1db8('0x32')],qs[_0x1db8('0x36')](_0x3f52f2[_0x1db8('0x33')][_0x1db8('0x36')]));_0x420293[_0x1db8('0x37')]=_0x420293[_0x1db8('0x37')][_0x1db8('0x38')]?_0x420293[_0x1db8('0x37')]:_0x2ee3b7[_0x1db8('0x32')];if(_0x3f52f2['query'][_0x1db8('0x43')]){_0x420293['include']=[{'all':!![]}];}_0x420293=_[_0x1db8('0x3e')]({},_0x420293,_0x3f52f2['options']);return db[_0x1db8('0x42')][_0x1db8('0x4b')](_0x420293)['then'](handleEntityNotFound(_0x334aff,null))['then'](respondWithResult(_0x334aff,null))['catch'](handleError(_0x334aff,null));};exports[_0x1db8('0x4c')]=function(_0x141ed5,_0x43f868){return db[_0x1db8('0x42')]['create'](_0x141ed5[_0x1db8('0x4d')],{})[_0x1db8('0x26')](respondWithResult(_0x43f868,0xc9))[_0x1db8('0x4e')](handleError(_0x43f868,null));};exports[_0x1db8('0x25')]=function(_0x2de337,_0x23deb7){if(_0x2de337[_0x1db8('0x4d')]['id']){delete _0x2de337[_0x1db8('0x4d')]['id'];}return db[_0x1db8('0x42')][_0x1db8('0x4b')]({'where':{'id':_0x2de337['params']['id']}})['then'](handleEntityNotFound(_0x23deb7,null))[_0x1db8('0x26')](saveUpdates(_0x2de337[_0x1db8('0x4d')],null))[_0x1db8('0x26')](respondWithResult(_0x23deb7,null))[_0x1db8('0x4e')](handleError(_0x23deb7,null));};exports[_0x1db8('0x27')]=function(_0x4ec73e,_0x127dd3){return db[_0x1db8('0x42')][_0x1db8('0x4b')]({'where':{'id':_0x4ec73e[_0x1db8('0x48')]['id']}})[_0x1db8('0x26')](handleEntityNotFound(_0x127dd3,null))[_0x1db8('0x26')](removeEntity(_0x127dd3,null))['catch'](handleError(_0x127dd3,null));};exports['getFields']=function(_0x4c772a,_0x59056f,_0x43ca4d){var _0x3b7eaa={};var _0xde3520={};var _0x50c628;var _0x264f66;return db[_0x1db8('0x42')][_0x1db8('0x4f')]({'where':{'id':_0x4c772a[_0x1db8('0x48')]['id']}})[_0x1db8('0x26')](handleEntityNotFound(_0x59056f,null))[_0x1db8('0x26')](function(_0x2475c3){if(_0x2475c3){_0x50c628=_0x2475c3;_0xde3520[_0x1db8('0x32')]=_[_0x1db8('0x49')](db[_0x1db8('0x50')][_0x1db8('0x4a')]);_0xde3520[_0x1db8('0x33')]=_[_0x1db8('0x49')](_0x4c772a[_0x1db8('0x33')]);_0xde3520[_0x1db8('0x34')]=_[_0x1db8('0x35')](_0xde3520['model'],_0xde3520[_0x1db8('0x33')]);_0x3b7eaa[_0x1db8('0x37')]=_['intersection'](_0xde3520[_0x1db8('0x32')],qs[_0x1db8('0x36')](_0x4c772a[_0x1db8('0x33')][_0x1db8('0x36')]));_0x3b7eaa[_0x1db8('0x37')]=_0x3b7eaa[_0x1db8('0x37')][_0x1db8('0x38')]?_0x3b7eaa[_0x1db8('0x37')]:_0xde3520[_0x1db8('0x32')];_0x3b7eaa['order']=qs[_0x1db8('0x3b')](_0x4c772a[_0x1db8('0x33')][_0x1db8('0x3b')]);_0x3b7eaa[_0x1db8('0x3c')]=qs['filters'](_[_0x1db8('0x3d')](_0x4c772a[_0x1db8('0x33')],_0xde3520['filters']));if(_0x4c772a['query'][_0x1db8('0x40')]){_0x3b7eaa[_0x1db8('0x3c')]=_[_0x1db8('0x3e')](_0x3b7eaa[_0x1db8('0x3c')],{'$or':_[_0x1db8('0x2e')](_0x3b7eaa[_0x1db8('0x37')],function(_0x30e345){var _0x552b1a={};_0x552b1a[_0x30e345]={'$like':'%'+_0x4c772a[_0x1db8('0x33')][_0x1db8('0x40')]+'%'};return _0x552b1a;})});}_0x3b7eaa=_[_0x1db8('0x3e')]({},_0x3b7eaa,_0x4c772a[_0x1db8('0x41')]);return _0x50c628['getFields'](_0x3b7eaa);}})[_0x1db8('0x26')](function(_0x164120){if(_0x164120){_0x264f66=_0x164120[_0x1db8('0x38')];if(!_0x4c772a[_0x1db8('0x33')][_0x1db8('0x39')](_0x1db8('0x51'))){_0x3b7eaa[_0x1db8('0x1f')]=qs[_0x1db8('0x1f')](_0x4c772a[_0x1db8('0x33')][_0x1db8('0x1f')]);_0x3b7eaa['offset']=qs[_0x1db8('0x1e')](_0x4c772a[_0x1db8('0x33')][_0x1db8('0x1e')]);}return _0x50c628[_0x1db8('0x52')](_0x3b7eaa);}})[_0x1db8('0x26')](function(_0x235623){if(_0x235623){return _0x235623?{'count':_0x264f66,'rows':_0x235623}:null;}})[_0x1db8('0x26')](respondWithResult(_0x59056f,null))['catch'](handleError(_0x59056f,null));};exports['getSubjects']=function(_0x2a8b60,_0x308a54,_0x50e8b6){var _0x47330d={};var _0x32f23e={};var _0x13ec32;var _0x298167;return db['Dynamics365Configuration'][_0x1db8('0x4f')]({'where':{'id':_0x2a8b60['params']['id']}})[_0x1db8('0x26')](handleEntityNotFound(_0x308a54,null))[_0x1db8('0x26')](function(_0xbe5536){if(_0xbe5536){_0x13ec32=_0xbe5536;_0x32f23e[_0x1db8('0x32')]=_[_0x1db8('0x49')](db[_0x1db8('0x50')]['rawAttributes']);_0x32f23e['query']=_['keys'](_0x2a8b60[_0x1db8('0x33')]);_0x32f23e['filters']=_[_0x1db8('0x35')](_0x32f23e[_0x1db8('0x32')],_0x32f23e[_0x1db8('0x33')]);_0x47330d['attributes']=_[_0x1db8('0x35')](_0x32f23e['model'],qs['fields'](_0x2a8b60[_0x1db8('0x33')]['fields']));_0x47330d[_0x1db8('0x37')]=_0x47330d['attributes'][_0x1db8('0x38')]?_0x47330d['attributes']:_0x32f23e[_0x1db8('0x32')];_0x47330d['order']=qs[_0x1db8('0x3b')](_0x2a8b60[_0x1db8('0x33')][_0x1db8('0x3b')]);_0x47330d[_0x1db8('0x3c')]=qs[_0x1db8('0x34')](_['pick'](_0x2a8b60[_0x1db8('0x33')],_0x32f23e[_0x1db8('0x34')]));if(_0x2a8b60['query'][_0x1db8('0x40')]){_0x47330d[_0x1db8('0x3c')]=_['merge'](_0x47330d['where'],{'$or':_[_0x1db8('0x2e')](_0x47330d['attributes'],function(_0xd2312e){var _0x4af5e6={};_0x4af5e6[_0xd2312e]={'$like':'%'+_0x2a8b60[_0x1db8('0x33')][_0x1db8('0x40')]+'%'};return _0x4af5e6;})});}_0x47330d=_[_0x1db8('0x3e')]({},_0x47330d,_0x2a8b60[_0x1db8('0x41')]);return _0x13ec32[_0x1db8('0x53')](_0x47330d);}})[_0x1db8('0x26')](function(_0x4829c0){if(_0x4829c0){_0x298167=_0x4829c0['length'];if(!_0x2a8b60[_0x1db8('0x33')]['hasOwnProperty'](_0x1db8('0x51'))){_0x47330d[_0x1db8('0x1f')]=qs['limit'](_0x2a8b60[_0x1db8('0x33')][_0x1db8('0x1f')]);_0x47330d[_0x1db8('0x1e')]=qs[_0x1db8('0x1e')](_0x2a8b60[_0x1db8('0x33')][_0x1db8('0x1e')]);}return _0x13ec32[_0x1db8('0x53')](_0x47330d);}})[_0x1db8('0x26')](function(_0x355d6e){if(_0x355d6e){return _0x355d6e?{'count':_0x298167,'rows':_0x355d6e}:null;}})['then'](respondWithResult(_0x308a54,null))[_0x1db8('0x4e')](handleError(_0x308a54,null));};exports['getDescriptions']=function(_0x114c8e,_0x35c1ea,_0x428e03){var _0x33b13f={};var _0x959780={};var _0x15c2a7;var _0x78d2ab;return db['Dynamics365Configuration'][_0x1db8('0x4f')]({'where':{'id':_0x114c8e[_0x1db8('0x48')]['id']}})[_0x1db8('0x26')](handleEntityNotFound(_0x35c1ea,null))[_0x1db8('0x26')](function(_0x5e9a32){if(_0x5e9a32){_0x15c2a7=_0x5e9a32;_0x959780['model']=_[_0x1db8('0x49')](db[_0x1db8('0x50')][_0x1db8('0x4a')]);_0x959780[_0x1db8('0x33')]=_[_0x1db8('0x49')](_0x114c8e[_0x1db8('0x33')]);_0x959780['filters']=_[_0x1db8('0x35')](_0x959780[_0x1db8('0x32')],_0x959780[_0x1db8('0x33')]);_0x33b13f[_0x1db8('0x37')]=_[_0x1db8('0x35')](_0x959780[_0x1db8('0x32')],qs[_0x1db8('0x36')](_0x114c8e[_0x1db8('0x33')]['fields']));_0x33b13f[_0x1db8('0x37')]=_0x33b13f[_0x1db8('0x37')]['length']?_0x33b13f[_0x1db8('0x37')]:_0x959780['model'];_0x33b13f['order']=qs['sort'](_0x114c8e[_0x1db8('0x33')][_0x1db8('0x3b')]);_0x33b13f[_0x1db8('0x3c')]=qs[_0x1db8('0x34')](_[_0x1db8('0x3d')](_0x114c8e[_0x1db8('0x33')],_0x959780[_0x1db8('0x34')]));if(_0x114c8e['query'][_0x1db8('0x40')]){_0x33b13f[_0x1db8('0x3c')]=_[_0x1db8('0x3e')](_0x33b13f[_0x1db8('0x3c')],{'$or':_[_0x1db8('0x2e')](_0x33b13f[_0x1db8('0x37')],function(_0x47d738){var _0x1eaf93={};_0x1eaf93[_0x47d738]={'$like':'%'+_0x114c8e[_0x1db8('0x33')][_0x1db8('0x40')]+'%'};return _0x1eaf93;})});}_0x33b13f=_['merge']({},_0x33b13f,_0x114c8e[_0x1db8('0x41')]);return _0x15c2a7[_0x1db8('0x54')](_0x33b13f);}})[_0x1db8('0x26')](function(_0x1e4c5a){if(_0x1e4c5a){_0x78d2ab=_0x1e4c5a[_0x1db8('0x38')];if(!_0x114c8e[_0x1db8('0x33')]['hasOwnProperty']('nolimit')){_0x33b13f[_0x1db8('0x1f')]=qs[_0x1db8('0x1f')](_0x114c8e['query'][_0x1db8('0x1f')]);_0x33b13f[_0x1db8('0x1e')]=qs[_0x1db8('0x1e')](_0x114c8e[_0x1db8('0x33')]['offset']);}return _0x15c2a7[_0x1db8('0x54')](_0x33b13f);}})[_0x1db8('0x26')](function(_0x5626b4){if(_0x5626b4){return _0x5626b4?{'count':_0x78d2ab,'rows':_0x5626b4}:null;}})['then'](respondWithResult(_0x35c1ea,null))[_0x1db8('0x4e')](handleError(_0x35c1ea,null));}; \ No newline at end of file +var _0xb818=['../../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','reject','save','then','destroy','error','name','send','Dynamics365Configuration','rawAttributes','fieldName','type','key','map','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','include','findAll','catch','show','params','keys','length','includeAll','options','find','create','update','body','findOne','Dynamics365Field','getFields','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x3be9ee,_0x26e4b1){var _0x5931f4=function(_0x3fa7b8){while(--_0x3fa7b8){_0x3be9ee['push'](_0x3be9ee['shift']());}};_0x5931f4(++_0x26e4b1);}(_0xb818,0x1df));var _0x8b81=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xb818[_0x178e48];return _0x440d7e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8b81('0x0'));var zipdir=require(_0x8b81('0x1'));var jsonpatch=require(_0x8b81('0x2'));var rp=require('request-promise');var moment=require(_0x8b81('0x3'));var BPromise=require(_0x8b81('0x4'));var Mustache=require(_0x8b81('0x5'));var util=require(_0x8b81('0x6'));var path=require(_0x8b81('0x7'));var sox=require(_0x8b81('0x8'));var csv=require(_0x8b81('0x9'));var ejs=require(_0x8b81('0xa'));var fs=require('fs');var fs_extra=require(_0x8b81('0xb'));var _=require('lodash');var squel=require(_0x8b81('0xc'));var crypto=require(_0x8b81('0xd'));var jsforce=require(_0x8b81('0xe'));var deskjs=require(_0x8b81('0xf'));var toCsv=require(_0x8b81('0x9'));var querystring=require(_0x8b81('0x10'));var Papa=require(_0x8b81('0x11'));var Redis=require(_0x8b81('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x8b81('0x13'));var as=require(_0x8b81('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8b81('0x15'))(_0x8b81('0x16'));var utils=require(_0x8b81('0x17'));var config=require(_0x8b81('0x18'));var licenseUtil=require(_0x8b81('0x19'));var db=require(_0x8b81('0x1a'))['db'];function respondWithStatusCode(_0x48fff6,_0x968ae4){_0x968ae4=_0x968ae4||0xcc;return function(_0x3190cf){if(_0x3190cf){return _0x48fff6[_0x8b81('0x1b')](_0x968ae4);}return _0x48fff6[_0x8b81('0x1c')](_0x968ae4)[_0x8b81('0x1d')]();};}function respondWithResult(_0x39cc92,_0x56a50f){_0x56a50f=_0x56a50f||0xc8;return function(_0x4f07ae){if(_0x4f07ae){return _0x39cc92['status'](_0x56a50f)[_0x8b81('0x1e')](_0x4f07ae);}};}function respondWithFilteredResult(_0x3a9612,_0x4cdab5){return function(_0x1878c9){if(_0x1878c9){var _0x48aec2=typeof _0x4cdab5[_0x8b81('0x1f')]===_0x8b81('0x20')&&typeof _0x4cdab5[_0x8b81('0x21')]===_0x8b81('0x20');var _0x292762=_0x1878c9[_0x8b81('0x22')];var _0x29e2b3=_0x48aec2?0x0:_0x4cdab5['offset'];var _0xfe40c=_0x48aec2?_0x1878c9[_0x8b81('0x22')]:_0x4cdab5['offset']+_0x4cdab5[_0x8b81('0x21')];var _0x59158f;if(_0xfe40c>=_0x292762){_0xfe40c=_0x292762;_0x59158f=0xc8;}else{_0x59158f=0xce;}_0x3a9612[_0x8b81('0x1c')](_0x59158f);return _0x3a9612[_0x8b81('0x23')](_0x8b81('0x24'),_0x29e2b3+'-'+_0xfe40c+'/'+_0x292762)[_0x8b81('0x1e')](_0x1878c9);}return null;};}function patchUpdates(_0x3830a5){return function(_0x35d866){try{jsonpatch['apply'](_0x35d866,_0x3830a5,!![]);}catch(_0x86275e){return BPromise[_0x8b81('0x25')](_0x86275e);}return _0x35d866[_0x8b81('0x26')]();};}function saveUpdates(_0x4a1be7,_0x52ccd4){return function(_0x116bf4){if(_0x116bf4){return _0x116bf4['update'](_0x4a1be7)[_0x8b81('0x27')](function(_0x395307){return _0x395307;});}return null;};}function removeEntity(_0x51be23,_0x5f4005){return function(_0x422c2d){if(_0x422c2d){return _0x422c2d[_0x8b81('0x28')]()[_0x8b81('0x27')](function(){_0x51be23[_0x8b81('0x1c')](0xcc)[_0x8b81('0x1d')]();});}};}function handleEntityNotFound(_0x2031ee,_0x23852f){return function(_0x428d28){if(!_0x428d28){_0x2031ee[_0x8b81('0x1b')](0x194);}return _0x428d28;};}function handleError(_0x18dd99,_0x3e4131){_0x3e4131=_0x3e4131||0x1f4;return function(_0x5510b8){logger[_0x8b81('0x29')](_0x5510b8['stack']);if(_0x5510b8[_0x8b81('0x2a')]){delete _0x5510b8[_0x8b81('0x2a')];}_0x18dd99[_0x8b81('0x1c')](_0x3e4131)[_0x8b81('0x2b')](_0x5510b8);};}exports['index']=function(_0x4666a5,_0x369321){var _0x18d1cd={},_0x4aec7c={},_0x412d59={'count':0x0,'rows':[]};var _0x4ebf4c=_['map'](db[_0x8b81('0x2c')][_0x8b81('0x2d')],function(_0x3d6c59){return{'name':_0x3d6c59[_0x8b81('0x2e')],'type':_0x3d6c59[_0x8b81('0x2f')][_0x8b81('0x30')]};});_0x4aec7c['model']=_[_0x8b81('0x31')](_0x4ebf4c,_0x8b81('0x2a'));_0x4aec7c[_0x8b81('0x32')]=_['keys'](_0x4666a5[_0x8b81('0x32')]);_0x4aec7c['filters']=_[_0x8b81('0x33')](_0x4aec7c[_0x8b81('0x34')],_0x4aec7c[_0x8b81('0x32')]);_0x18d1cd[_0x8b81('0x35')]=_[_0x8b81('0x33')](_0x4aec7c[_0x8b81('0x34')],qs['fields'](_0x4666a5[_0x8b81('0x32')][_0x8b81('0x36')]));_0x18d1cd[_0x8b81('0x35')]=_0x18d1cd['attributes']['length']?_0x18d1cd[_0x8b81('0x35')]:_0x4aec7c['model'];if(!_0x4666a5[_0x8b81('0x32')][_0x8b81('0x37')](_0x8b81('0x38'))){_0x18d1cd[_0x8b81('0x21')]=qs[_0x8b81('0x21')](_0x4666a5[_0x8b81('0x32')][_0x8b81('0x21')]);_0x18d1cd[_0x8b81('0x1f')]=qs[_0x8b81('0x1f')](_0x4666a5[_0x8b81('0x32')][_0x8b81('0x1f')]);}_0x18d1cd[_0x8b81('0x39')]=qs[_0x8b81('0x3a')](_0x4666a5['query']['sort']);_0x18d1cd['where']=qs[_0x8b81('0x3b')](_[_0x8b81('0x3c')](_0x4666a5[_0x8b81('0x32')],_0x4aec7c[_0x8b81('0x3b')]),_0x4ebf4c);if(_0x4666a5[_0x8b81('0x32')][_0x8b81('0x3d')]){_0x18d1cd[_0x8b81('0x3e')]=_[_0x8b81('0x3f')](_0x18d1cd[_0x8b81('0x3e')],{'$or':_[_0x8b81('0x31')](_0x4ebf4c,function(_0x3de045){if(_0x3de045['type']!==_0x8b81('0x40')){var _0x1e1b86={};_0x1e1b86[_0x3de045['name']]={'$like':'%'+_0x4666a5[_0x8b81('0x32')]['filter']+'%'};return _0x1e1b86;}})});}_0x18d1cd=_[_0x8b81('0x3f')]({},_0x18d1cd,_0x4666a5['options']);var _0x87b5a2={'where':_0x18d1cd[_0x8b81('0x3e')]};return db['Dynamics365Configuration'][_0x8b81('0x22')](_0x87b5a2)[_0x8b81('0x27')](function(_0x46366f){_0x412d59['count']=_0x46366f;if(_0x4666a5[_0x8b81('0x32')]['includeAll']){_0x18d1cd[_0x8b81('0x41')]=[{'all':!![]}];}return db['Dynamics365Configuration'][_0x8b81('0x42')](_0x18d1cd);})[_0x8b81('0x27')](function(_0x110f9c){_0x412d59['rows']=_0x110f9c;return _0x412d59;})[_0x8b81('0x27')](respondWithFilteredResult(_0x369321,_0x18d1cd))[_0x8b81('0x43')](handleError(_0x369321,null));};exports[_0x8b81('0x44')]=function(_0x4fe749,_0x55dfa0){var _0x366ef6={'raw':![],'where':{'id':_0x4fe749[_0x8b81('0x45')]['id']}},_0x33c727={};_0x33c727['model']=_['keys'](db[_0x8b81('0x2c')][_0x8b81('0x2d')]);_0x33c727[_0x8b81('0x32')]=_[_0x8b81('0x46')](_0x4fe749['query']);_0x33c727[_0x8b81('0x3b')]=_['intersection'](_0x33c727[_0x8b81('0x34')],_0x33c727[_0x8b81('0x32')]);_0x366ef6[_0x8b81('0x35')]=_['intersection'](_0x33c727[_0x8b81('0x34')],qs[_0x8b81('0x36')](_0x4fe749['query'][_0x8b81('0x36')]));_0x366ef6['attributes']=_0x366ef6[_0x8b81('0x35')][_0x8b81('0x47')]?_0x366ef6[_0x8b81('0x35')]:_0x33c727[_0x8b81('0x34')];if(_0x4fe749[_0x8b81('0x32')][_0x8b81('0x48')]){_0x366ef6[_0x8b81('0x41')]=[{'all':!![]}];}_0x366ef6=_[_0x8b81('0x3f')]({},_0x366ef6,_0x4fe749[_0x8b81('0x49')]);return db[_0x8b81('0x2c')][_0x8b81('0x4a')](_0x366ef6)[_0x8b81('0x27')](handleEntityNotFound(_0x55dfa0,null))['then'](respondWithResult(_0x55dfa0,null))[_0x8b81('0x43')](handleError(_0x55dfa0,null));};exports[_0x8b81('0x4b')]=function(_0x1818d8,_0x46c9a5){return db[_0x8b81('0x2c')][_0x8b81('0x4b')](_0x1818d8['body'],{})[_0x8b81('0x27')](respondWithResult(_0x46c9a5,0xc9))['catch'](handleError(_0x46c9a5,null));};exports[_0x8b81('0x4c')]=function(_0x4410ab,_0xd5de04){if(_0x4410ab[_0x8b81('0x4d')]['id']){delete _0x4410ab[_0x8b81('0x4d')]['id'];}return db[_0x8b81('0x2c')][_0x8b81('0x4a')]({'where':{'id':_0x4410ab[_0x8b81('0x45')]['id']}})[_0x8b81('0x27')](handleEntityNotFound(_0xd5de04,null))[_0x8b81('0x27')](saveUpdates(_0x4410ab['body'],null))[_0x8b81('0x27')](respondWithResult(_0xd5de04,null))['catch'](handleError(_0xd5de04,null));};exports['destroy']=function(_0xb5a868,_0x126562){return db[_0x8b81('0x2c')][_0x8b81('0x4a')]({'where':{'id':_0xb5a868[_0x8b81('0x45')]['id']}})['then'](handleEntityNotFound(_0x126562,null))['then'](removeEntity(_0x126562,null))[_0x8b81('0x43')](handleError(_0x126562,null));};exports['getFields']=function(_0xc93203,_0x3a69a7,_0x1573e3){var _0x339cb4={};var _0x14b455={};var _0x15be81;var _0x54a915;return db['Dynamics365Configuration'][_0x8b81('0x4e')]({'where':{'id':_0xc93203['params']['id']}})[_0x8b81('0x27')](handleEntityNotFound(_0x3a69a7,null))[_0x8b81('0x27')](function(_0x428bfb){if(_0x428bfb){_0x15be81=_0x428bfb;_0x14b455[_0x8b81('0x34')]=_[_0x8b81('0x46')](db[_0x8b81('0x4f')][_0x8b81('0x2d')]);_0x14b455[_0x8b81('0x32')]=_[_0x8b81('0x46')](_0xc93203[_0x8b81('0x32')]);_0x14b455['filters']=_[_0x8b81('0x33')](_0x14b455[_0x8b81('0x34')],_0x14b455['query']);_0x339cb4[_0x8b81('0x35')]=_[_0x8b81('0x33')](_0x14b455[_0x8b81('0x34')],qs[_0x8b81('0x36')](_0xc93203[_0x8b81('0x32')][_0x8b81('0x36')]));_0x339cb4[_0x8b81('0x35')]=_0x339cb4[_0x8b81('0x35')][_0x8b81('0x47')]?_0x339cb4[_0x8b81('0x35')]:_0x14b455[_0x8b81('0x34')];_0x339cb4['order']=qs[_0x8b81('0x3a')](_0xc93203[_0x8b81('0x32')][_0x8b81('0x3a')]);_0x339cb4[_0x8b81('0x3e')]=qs[_0x8b81('0x3b')](_[_0x8b81('0x3c')](_0xc93203[_0x8b81('0x32')],_0x14b455[_0x8b81('0x3b')]));if(_0xc93203[_0x8b81('0x32')][_0x8b81('0x3d')]){_0x339cb4[_0x8b81('0x3e')]=_[_0x8b81('0x3f')](_0x339cb4[_0x8b81('0x3e')],{'$or':_['map'](_0x339cb4[_0x8b81('0x35')],function(_0x39f7af){var _0x3182b3={};_0x3182b3[_0x39f7af]={'$like':'%'+_0xc93203[_0x8b81('0x32')]['filter']+'%'};return _0x3182b3;})});}_0x339cb4=_[_0x8b81('0x3f')]({},_0x339cb4,_0xc93203['options']);return _0x15be81[_0x8b81('0x50')](_0x339cb4);}})['then'](function(_0x40d4d6){if(_0x40d4d6){_0x54a915=_0x40d4d6[_0x8b81('0x47')];if(!_0xc93203[_0x8b81('0x32')]['hasOwnProperty']('nolimit')){_0x339cb4[_0x8b81('0x21')]=qs[_0x8b81('0x21')](_0xc93203['query']['limit']);_0x339cb4[_0x8b81('0x1f')]=qs['offset'](_0xc93203[_0x8b81('0x32')][_0x8b81('0x1f')]);}return _0x15be81[_0x8b81('0x50')](_0x339cb4);}})['then'](function(_0x31f2af){if(_0x31f2af){return _0x31f2af?{'count':_0x54a915,'rows':_0x31f2af}:null;}})['then'](respondWithResult(_0x3a69a7,null))['catch'](handleError(_0x3a69a7,null));};exports[_0x8b81('0x51')]=function(_0x46e89f,_0x38bc5f,_0x43312b){var _0x2be785={};var _0x24aaf0={};var _0x2e5c31;var _0x10204d;return db[_0x8b81('0x2c')][_0x8b81('0x4e')]({'where':{'id':_0x46e89f[_0x8b81('0x45')]['id']}})[_0x8b81('0x27')](handleEntityNotFound(_0x38bc5f,null))[_0x8b81('0x27')](function(_0x213645){if(_0x213645){_0x2e5c31=_0x213645;_0x24aaf0[_0x8b81('0x34')]=_['keys'](db[_0x8b81('0x4f')][_0x8b81('0x2d')]);_0x24aaf0['query']=_[_0x8b81('0x46')](_0x46e89f['query']);_0x24aaf0[_0x8b81('0x3b')]=_[_0x8b81('0x33')](_0x24aaf0[_0x8b81('0x34')],_0x24aaf0[_0x8b81('0x32')]);_0x2be785[_0x8b81('0x35')]=_['intersection'](_0x24aaf0[_0x8b81('0x34')],qs[_0x8b81('0x36')](_0x46e89f[_0x8b81('0x32')][_0x8b81('0x36')]));_0x2be785[_0x8b81('0x35')]=_0x2be785['attributes'][_0x8b81('0x47')]?_0x2be785[_0x8b81('0x35')]:_0x24aaf0[_0x8b81('0x34')];_0x2be785[_0x8b81('0x39')]=qs[_0x8b81('0x3a')](_0x46e89f[_0x8b81('0x32')][_0x8b81('0x3a')]);_0x2be785[_0x8b81('0x3e')]=qs[_0x8b81('0x3b')](_[_0x8b81('0x3c')](_0x46e89f[_0x8b81('0x32')],_0x24aaf0[_0x8b81('0x3b')]));if(_0x46e89f['query'][_0x8b81('0x3d')]){_0x2be785[_0x8b81('0x3e')]=_[_0x8b81('0x3f')](_0x2be785[_0x8b81('0x3e')],{'$or':_[_0x8b81('0x31')](_0x2be785[_0x8b81('0x35')],function(_0xf56a3){var _0x1c7b2c={};_0x1c7b2c[_0xf56a3]={'$like':'%'+_0x46e89f[_0x8b81('0x32')]['filter']+'%'};return _0x1c7b2c;})});}_0x2be785=_[_0x8b81('0x3f')]({},_0x2be785,_0x46e89f[_0x8b81('0x49')]);return _0x2e5c31['getSubjects'](_0x2be785);}})[_0x8b81('0x27')](function(_0xb5f764){if(_0xb5f764){_0x10204d=_0xb5f764[_0x8b81('0x47')];if(!_0x46e89f[_0x8b81('0x32')][_0x8b81('0x37')](_0x8b81('0x38'))){_0x2be785[_0x8b81('0x21')]=qs[_0x8b81('0x21')](_0x46e89f[_0x8b81('0x32')]['limit']);_0x2be785[_0x8b81('0x1f')]=qs[_0x8b81('0x1f')](_0x46e89f['query'][_0x8b81('0x1f')]);}return _0x2e5c31[_0x8b81('0x51')](_0x2be785);}})['then'](function(_0x12649b){if(_0x12649b){return _0x12649b?{'count':_0x10204d,'rows':_0x12649b}:null;}})[_0x8b81('0x27')](respondWithResult(_0x38bc5f,null))[_0x8b81('0x43')](handleError(_0x38bc5f,null));};exports[_0x8b81('0x52')]=function(_0x5c9815,_0x48dd6f,_0x273c3e){var _0x4fea1b={};var _0x3b37c4={};var _0x269c55;var _0x217d58;return db[_0x8b81('0x2c')]['findOne']({'where':{'id':_0x5c9815[_0x8b81('0x45')]['id']}})['then'](handleEntityNotFound(_0x48dd6f,null))['then'](function(_0x58a3f5){if(_0x58a3f5){_0x269c55=_0x58a3f5;_0x3b37c4[_0x8b81('0x34')]=_[_0x8b81('0x46')](db[_0x8b81('0x4f')][_0x8b81('0x2d')]);_0x3b37c4['query']=_[_0x8b81('0x46')](_0x5c9815[_0x8b81('0x32')]);_0x3b37c4[_0x8b81('0x3b')]=_[_0x8b81('0x33')](_0x3b37c4[_0x8b81('0x34')],_0x3b37c4[_0x8b81('0x32')]);_0x4fea1b['attributes']=_[_0x8b81('0x33')](_0x3b37c4['model'],qs[_0x8b81('0x36')](_0x5c9815[_0x8b81('0x32')][_0x8b81('0x36')]));_0x4fea1b['attributes']=_0x4fea1b[_0x8b81('0x35')][_0x8b81('0x47')]?_0x4fea1b['attributes']:_0x3b37c4[_0x8b81('0x34')];_0x4fea1b[_0x8b81('0x39')]=qs[_0x8b81('0x3a')](_0x5c9815['query'][_0x8b81('0x3a')]);_0x4fea1b[_0x8b81('0x3e')]=qs['filters'](_[_0x8b81('0x3c')](_0x5c9815[_0x8b81('0x32')],_0x3b37c4[_0x8b81('0x3b')]));if(_0x5c9815[_0x8b81('0x32')][_0x8b81('0x3d')]){_0x4fea1b[_0x8b81('0x3e')]=_[_0x8b81('0x3f')](_0x4fea1b[_0x8b81('0x3e')],{'$or':_[_0x8b81('0x31')](_0x4fea1b['attributes'],function(_0x29c224){var _0x5b5a7c={};_0x5b5a7c[_0x29c224]={'$like':'%'+_0x5c9815[_0x8b81('0x32')][_0x8b81('0x3d')]+'%'};return _0x5b5a7c;})});}_0x4fea1b=_[_0x8b81('0x3f')]({},_0x4fea1b,_0x5c9815['options']);return _0x269c55[_0x8b81('0x52')](_0x4fea1b);}})['then'](function(_0x3989f1){if(_0x3989f1){_0x217d58=_0x3989f1[_0x8b81('0x47')];if(!_0x5c9815[_0x8b81('0x32')]['hasOwnProperty'](_0x8b81('0x38'))){_0x4fea1b['limit']=qs['limit'](_0x5c9815[_0x8b81('0x32')][_0x8b81('0x21')]);_0x4fea1b['offset']=qs[_0x8b81('0x1f')](_0x5c9815[_0x8b81('0x32')]['offset']);}return _0x269c55[_0x8b81('0x52')](_0x4fea1b);}})['then'](function(_0x95064){if(_0x95064){return _0x95064?{'count':_0x217d58,'rows':_0x95064}:null;}})['then'](respondWithResult(_0x48dd6f,null))[_0x8b81('0x43')](handleError(_0x48dd6f,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index f0f6c52..7fb1ca8 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 _0x9bde=['request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations','util','api','bluebird'];(function(_0x230405,_0x19673b){var _0x59bb74=function(_0x398f23){while(--_0x398f23){_0x230405['push'](_0x230405['shift']());}};_0x59bb74(++_0x19673b);}(_0x9bde,0xe1));var _0xe9bd=function(_0x23844a,_0x296752){_0x23844a=_0x23844a-0x0;var _0x564497=_0x9bde[_0x23844a];return _0x564497;};'use strict';var _=require('lodash');var util=require(_0xe9bd('0x0'));var logger=require('../../config/logger')(_0xe9bd('0x1'));var moment=require('moment');var BPromise=require(_0xe9bd('0x2'));var rp=require(_0xe9bd('0x3'));var fs=require('fs');var path=require(_0xe9bd('0x4'));var rimraf=require(_0xe9bd('0x5'));var config=require(_0xe9bd('0x6'));var attributes=require(_0xe9bd('0x7'));module[_0xe9bd('0x8')]=function(_0x4fd7b8,_0x4763e9){return _0x4fd7b8[_0xe9bd('0x9')](_0xe9bd('0xa'),attributes,{'tableName':_0xe9bd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x00bb=['util','../../config/logger','moment','request-promise','path','../../config/environment','./intDynamics365Configuration.attributes','define','Dynamics365Configuration','int_dynamics365_configurations','lodash'];(function(_0x3d9c1b,_0x5f53c5){var _0x4aee21=function(_0x566ab8){while(--_0x566ab8){_0x3d9c1b['push'](_0x3d9c1b['shift']());}};_0x4aee21(++_0x5f53c5);}(_0x00bb,0x1d8));var _0xb00b=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x00bb[_0x2d7f0e];return _0x110b07;};'use strict';var _=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var logger=require(_0xb00b('0x2'))('api');var moment=require(_0xb00b('0x3'));var BPromise=require('bluebird');var rp=require(_0xb00b('0x4'));var fs=require('fs');var path=require(_0xb00b('0x5'));var rimraf=require('rimraf');var config=require(_0xb00b('0x6'));var attributes=require(_0xb00b('0x7'));module['exports']=function(_0x574cf8,_0x532ffb){return _0x574cf8[_0xb00b('0x8')](_0xb00b('0x9'),attributes,{'tableName':_0xb00b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index c13326d..44bb864 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 _0x0564=['jayson/promise','client','http','then','Dynamics365Configuration,\x20%s,\x20%s','debug','stringify','error','code','message','info','result','catch','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x26253d,_0x5dfc80){var _0x318a82=function(_0x22ae6a){while(--_0x22ae6a){_0x26253d['push'](_0x26253d['shift']());}};_0x318a82(++_0x5dfc80);}(_0x0564,0x1d9));var _0x4056=function(_0x3d2089,_0x155ee1){_0x3d2089=_0x3d2089-0x0;var _0x41a399=_0x0564[_0x3d2089];return _0x41a399;};'use strict';var _=require('lodash');var util=require(_0x4056('0x0'));var moment=require(_0x4056('0x1'));var BPromise=require('bluebird');var rs=require(_0x4056('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4056('0x3'))['db'];var utils=require(_0x4056('0x4'));var logger=require('../../config/logger')(_0x4056('0x5'));var config=require(_0x4056('0x6'));var jayson=require(_0x4056('0x7'));var client=jayson[_0x4056('0x8')][_0x4056('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1a3652,_0xfcdab1,_0x3084ef){return new BPromise(function(_0x5d2e84,_0x3b17b8){return client['request'](_0x1a3652,_0x3084ef)[_0x4056('0xa')](function(_0x5b95c4){logger['info'](_0x4056('0xb'),_0xfcdab1,'request\x20sent');logger[_0x4056('0xc')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0xfcdab1,'request\x20sent',JSON[_0x4056('0xd')](_0x5b95c4));if(_0x5b95c4[_0x4056('0xe')]){if(_0x5b95c4[_0x4056('0xe')][_0x4056('0xf')]===0x1f4){logger[_0x4056('0xe')](_0x4056('0xb'),_0xfcdab1,_0x5b95c4['error'][_0x4056('0x10')]);return _0x3b17b8(_0x5b95c4['error'][_0x4056('0x10')]);}logger[_0x4056('0xe')](_0x4056('0xb'),_0xfcdab1,_0x5b95c4[_0x4056('0xe')]['message']);return _0x5d2e84(_0x5b95c4[_0x4056('0xe')]['message']);}else{logger[_0x4056('0x11')](_0x4056('0xb'),_0xfcdab1,'request\x20sent');_0x5d2e84(_0x5b95c4[_0x4056('0x12')][_0x4056('0x10')]);}})[_0x4056('0x13')](function(_0x540d43){logger[_0x4056('0xe')]('Dynamics365Configuration,\x20%s,\x20%s',_0xfcdab1,_0x540d43);_0x3b17b8(_0x540d43);});});} \ No newline at end of file +var _0x7445=['moment','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','Dynamics365Configuration,\x20%s,\x20%s','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','catch','lodash','util'];(function(_0x6d6a66,_0x2924af){var _0x11eb6e=function(_0x52e55a){while(--_0x52e55a){_0x6d6a66['push'](_0x6d6a66['shift']());}};_0x11eb6e(++_0x2924af);}(_0x7445,0x106));var _0x5744=function(_0xc0638b,_0x2fccf4){_0xc0638b=_0xc0638b-0x0;var _0xd57dfa=_0x7445[_0xc0638b];return _0xd57dfa;};'use strict';var _=require(_0x5744('0x0'));var util=require(_0x5744('0x1'));var moment=require(_0x5744('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5744('0x3'))['db'];var utils=require(_0x5744('0x4'));var logger=require('../../config/logger')(_0x5744('0x5'));var config=require(_0x5744('0x6'));var jayson=require(_0x5744('0x7'));var client=jayson[_0x5744('0x8')][_0x5744('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x15e518,_0x572a8f,_0x44143b){return new BPromise(function(_0x1e9609,_0x3312f0){return client[_0x5744('0xa')](_0x15e518,_0x44143b)[_0x5744('0xb')](function(_0x1e6051){logger['info'](_0x5744('0xc'),_0x572a8f,'request\x20sent');logger[_0x5744('0xd')](_0x5744('0xe'),_0x572a8f,'request\x20sent',JSON[_0x5744('0xf')](_0x1e6051));if(_0x1e6051[_0x5744('0x10')]){if(_0x1e6051[_0x5744('0x10')][_0x5744('0x11')]===0x1f4){logger[_0x5744('0x10')](_0x5744('0xc'),_0x572a8f,_0x1e6051['error']['message']);return _0x3312f0(_0x1e6051[_0x5744('0x10')]['message']);}logger[_0x5744('0x10')](_0x5744('0xc'),_0x572a8f,_0x1e6051[_0x5744('0x10')]['message']);return _0x1e9609(_0x1e6051[_0x5744('0x10')][_0x5744('0x12')]);}else{logger[_0x5744('0x13')](_0x5744('0xc'),_0x572a8f,_0x5744('0x14'));_0x1e9609(_0x1e6051['result'][_0x5744('0x12')]);}})[_0x5744('0x15')](function(_0xb1dd5a){logger[_0x5744('0x10')](_0x5744('0xc'),_0x572a8f,_0xb1dd5a);_0x3312f0(_0xb1dd5a);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 6486c0d..c3f421c 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 _0x8782=['destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8782,0x1ce));var _0x2878=function(_0x192022,_0x23385c){_0x192022=_0x192022-0x0;var _0x161d8c=_0x8782[_0x192022];return _0x161d8c;};'use strict';var multer=require(_0x2878('0x0'));var util=require('util');var path=require(_0x2878('0x1'));var timeout=require(_0x2878('0x2'));var express=require(_0x2878('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2878('0x4'));var interaction=require(_0x2878('0x5'));var config=require(_0x2878('0x6'));var controller=require(_0x2878('0x7'));router[_0x2878('0x8')]('/',auth[_0x2878('0x9')](),controller[_0x2878('0xa')]);router['get'](_0x2878('0xb'),auth[_0x2878('0x9')](),controller[_0x2878('0xc')]);router[_0x2878('0xd')]('/',auth[_0x2878('0x9')](),controller[_0x2878('0xe')]);router[_0x2878('0xf')](_0x2878('0xb'),auth[_0x2878('0x9')](),controller[_0x2878('0x10')]);router[_0x2878('0x11')](_0x2878('0xb'),auth[_0x2878('0x9')](),controller[_0x2878('0x12')]);module[_0x2878('0x13')]=router; \ No newline at end of file +var _0x08dc=['../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','post','create','update','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x08dc,0xd1));var _0xc08d=function(_0x449b92,_0x2e0eb1){_0x449b92=_0x449b92-0x0;var _0x4c0989=_0x08dc[_0x449b92];return _0x4c0989;};'use strict';var multer=require(_0xc08d('0x0'));var util=require(_0xc08d('0x1'));var path=require(_0xc08d('0x2'));var timeout=require('connect-timeout');var express=require(_0xc08d('0x3'));var router=express[_0xc08d('0x4')]();var fs_extra=require(_0xc08d('0x5'));var auth=require(_0xc08d('0x6'));var interaction=require(_0xc08d('0x7'));var config=require(_0xc08d('0x8'));var controller=require(_0xc08d('0x9'));router[_0xc08d('0xa')]('/',auth[_0xc08d('0xb')](),controller[_0xc08d('0xc')]);router[_0xc08d('0xa')](_0xc08d('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xc08d('0xe')]('/',auth[_0xc08d('0xb')](),controller[_0xc08d('0xf')]);router['put'](_0xc08d('0xd'),auth['isAuthenticated'](),controller[_0xc08d('0x10')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc08d('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 8544682..dc92369 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 _0x4214=['STRING','BOOLEAN','exports','ENUM','string','variable','customVariable','keyValue','picklist'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x4214,0xa4));var _0x4421=function(_0x575a16,_0x18eefa){_0x575a16=_0x575a16-0x0;var _0x298d59=_0x4214[_0x575a16];return _0x298d59;};'use strict';var Sequelize=require('sequelize');module[_0x4421('0x0')]={'type':{'type':Sequelize[_0x4421('0x1')](_0x4421('0x2'),_0x4421('0x3'),_0x4421('0x4'),_0x4421('0x5'),_0x4421('0x6')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x4421('0x7')]},'keyType':{'type':Sequelize[_0x4421('0x1')](_0x4421('0x2'),_0x4421('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x4421('0x7')]},'idField':{'type':Sequelize[_0x4421('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x4421('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4421('0x7')]}}; \ No newline at end of file +var _0x1182=['sequelize','exports','ENUM','variable','customVariable','string','STRING','BOOLEAN'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x1182,0x130));var _0x2118=function(_0x3ae38e,_0x3aaa14){_0x3ae38e=_0x3ae38e-0x0;var _0x483595=_0x1182[_0x3ae38e];return _0x483595;};'use strict';var Sequelize=require(_0x2118('0x0'));module[_0x2118('0x1')]={'type':{'type':Sequelize[_0x2118('0x2')]('string',_0x2118('0x3'),_0x2118('0x4'),'keyValue','picklist'),'defaultValue':_0x2118('0x5')},'content':{'type':Sequelize[_0x2118('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x2118('0x2')](_0x2118('0x5'),'variable',_0x2118('0x4'))},'keyContent':{'type':Sequelize[_0x2118('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x2118('0x6')]},'customField':{'type':Sequelize[_0x2118('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2118('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 33142d9..4dd8c17 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 _0xe165=['squel','crypto','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','update','destroy','sendStatus','error','stack','name','send','index','map','Dynamics365Field','rawAttributes','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','then','include','findAll','rows','catch','show','params','length','includeAll','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x67a245,_0x22c647){var _0xed6bed=function(_0x4e3c94){while(--_0x4e3c94){_0x67a245['push'](_0x67a245['shift']());}};_0xed6bed(++_0x22c647);}(_0xe165,0x1e6));var _0x5e16=function(_0x3d9d7b,_0x542ca4){_0x3d9d7b=_0x3d9d7b-0x0;var _0x3df3e0=_0xe165[_0x3d9d7b];return _0x3df3e0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5e16('0x0'));var zipdir=require(_0x5e16('0x1'));var jsonpatch=require(_0x5e16('0x2'));var rp=require(_0x5e16('0x3'));var moment=require(_0x5e16('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5e16('0x5'));var path=require(_0x5e16('0x6'));var sox=require(_0x5e16('0x7'));var csv=require(_0x5e16('0x8'));var ejs=require(_0x5e16('0x9'));var fs=require('fs');var fs_extra=require(_0x5e16('0xa'));var _=require('lodash');var squel=require(_0x5e16('0xb'));var crypto=require(_0x5e16('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5e16('0xd'));var toCsv=require(_0x5e16('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5e16('0xe'));var qs=require(_0x5e16('0xf'));var as=require(_0x5e16('0x10'));var hardwareService=require(_0x5e16('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x5e16('0x12'));var config=require(_0x5e16('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5e16('0x14'))['db'];function respondWithStatusCode(_0x5b5959,_0x49b58d){_0x49b58d=_0x49b58d||0xcc;return function(_0xa58ba4){if(_0xa58ba4){return _0x5b5959['sendStatus'](_0x49b58d);}return _0x5b5959[_0x5e16('0x15')](_0x49b58d)[_0x5e16('0x16')]();};}function respondWithResult(_0x2f3c1b,_0x3180dc){_0x3180dc=_0x3180dc||0xc8;return function(_0x150531){if(_0x150531){return _0x2f3c1b['status'](_0x3180dc)[_0x5e16('0x17')](_0x150531);}};}function respondWithFilteredResult(_0x574987,_0x27b6df){return function(_0x16a0e8){if(_0x16a0e8){var _0x52320a=typeof _0x27b6df['offset']==='undefined'&&typeof _0x27b6df[_0x5e16('0x18')]===_0x5e16('0x19');var _0x507c3f=_0x16a0e8[_0x5e16('0x1a')];var _0x5e67cb=_0x52320a?0x0:_0x27b6df['offset'];var _0x184074=_0x52320a?_0x16a0e8[_0x5e16('0x1a')]:_0x27b6df[_0x5e16('0x1b')]+_0x27b6df[_0x5e16('0x18')];var _0x5297dd;if(_0x184074>=_0x507c3f){_0x184074=_0x507c3f;_0x5297dd=0xc8;}else{_0x5297dd=0xce;}_0x574987[_0x5e16('0x15')](_0x5297dd);return _0x574987[_0x5e16('0x1c')](_0x5e16('0x1d'),_0x5e67cb+'-'+_0x184074+'/'+_0x507c3f)[_0x5e16('0x17')](_0x16a0e8);}return null;};}function patchUpdates(_0x18a01e){return function(_0x3c09d2){try{jsonpatch[_0x5e16('0x1e')](_0x3c09d2,_0x18a01e,!![]);}catch(_0x42eba8){return BPromise[_0x5e16('0x1f')](_0x42eba8);}return _0x3c09d2['save']();};}function saveUpdates(_0x516496,_0x894a88){return function(_0x48d508){if(_0x48d508){return _0x48d508[_0x5e16('0x20')](_0x516496)['then'](function(_0x4b1ab7){return _0x4b1ab7;});}return null;};}function removeEntity(_0x55974a,_0x528769){return function(_0x332164){if(_0x332164){return _0x332164[_0x5e16('0x21')]()['then'](function(){_0x55974a[_0x5e16('0x15')](0xcc)[_0x5e16('0x16')]();});}};}function handleEntityNotFound(_0xc3e0a0,_0x2d4663){return function(_0x441aac){if(!_0x441aac){_0xc3e0a0[_0x5e16('0x22')](0x194);}return _0x441aac;};}function handleError(_0xac2674,_0x1deb0a){_0x1deb0a=_0x1deb0a||0x1f4;return function(_0x8a730f){logger[_0x5e16('0x23')](_0x8a730f[_0x5e16('0x24')]);if(_0x8a730f['name']){delete _0x8a730f[_0x5e16('0x25')];}_0xac2674[_0x5e16('0x15')](_0x1deb0a)[_0x5e16('0x26')](_0x8a730f);};}exports[_0x5e16('0x27')]=function(_0xc16c51,_0x681151){var _0x56f4c5={},_0x2ffda9={},_0x34a65c={'count':0x0,'rows':[]};var _0x460895=_[_0x5e16('0x28')](db[_0x5e16('0x29')][_0x5e16('0x2a')],function(_0x301daf){return{'name':_0x301daf['fieldName'],'type':_0x301daf['type']['key']};});_0x2ffda9[_0x5e16('0x2b')]=_['map'](_0x460895,_0x5e16('0x25'));_0x2ffda9[_0x5e16('0x2c')]=_[_0x5e16('0x2d')](_0xc16c51['query']);_0x2ffda9[_0x5e16('0x2e')]=_[_0x5e16('0x2f')](_0x2ffda9['model'],_0x2ffda9['query']);_0x56f4c5[_0x5e16('0x30')]=_[_0x5e16('0x2f')](_0x2ffda9[_0x5e16('0x2b')],qs['fields'](_0xc16c51[_0x5e16('0x2c')][_0x5e16('0x31')]));_0x56f4c5[_0x5e16('0x30')]=_0x56f4c5[_0x5e16('0x30')]['length']?_0x56f4c5[_0x5e16('0x30')]:_0x2ffda9[_0x5e16('0x2b')];if(!_0xc16c51[_0x5e16('0x2c')]['hasOwnProperty'](_0x5e16('0x32'))){_0x56f4c5['limit']=qs[_0x5e16('0x18')](_0xc16c51['query'][_0x5e16('0x18')]);_0x56f4c5[_0x5e16('0x1b')]=qs[_0x5e16('0x1b')](_0xc16c51[_0x5e16('0x2c')][_0x5e16('0x1b')]);}_0x56f4c5[_0x5e16('0x33')]=qs[_0x5e16('0x34')](_0xc16c51[_0x5e16('0x2c')]['sort']);_0x56f4c5[_0x5e16('0x35')]=qs[_0x5e16('0x2e')](_[_0x5e16('0x36')](_0xc16c51[_0x5e16('0x2c')],_0x2ffda9['filters']),_0x460895);if(_0xc16c51['query'][_0x5e16('0x37')]){_0x56f4c5[_0x5e16('0x35')]=_['merge'](_0x56f4c5[_0x5e16('0x35')],{'$or':_[_0x5e16('0x28')](_0x460895,function(_0x402fa3){if(_0x402fa3['type']!==_0x5e16('0x38')){var _0x29bca5={};_0x29bca5[_0x402fa3[_0x5e16('0x25')]]={'$like':'%'+_0xc16c51[_0x5e16('0x2c')]['filter']+'%'};return _0x29bca5;}})});}_0x56f4c5=_[_0x5e16('0x39')]({},_0x56f4c5,_0xc16c51[_0x5e16('0x3a')]);var _0x993930={'where':_0x56f4c5[_0x5e16('0x35')]};return db[_0x5e16('0x29')][_0x5e16('0x1a')](_0x993930)[_0x5e16('0x3b')](function(_0x5beeec){_0x34a65c[_0x5e16('0x1a')]=_0x5beeec;if(_0xc16c51[_0x5e16('0x2c')]['includeAll']){_0x56f4c5[_0x5e16('0x3c')]=[{'all':!![]}];}return db['Dynamics365Field'][_0x5e16('0x3d')](_0x56f4c5);})[_0x5e16('0x3b')](function(_0x568a38){_0x34a65c[_0x5e16('0x3e')]=_0x568a38;return _0x34a65c;})[_0x5e16('0x3b')](respondWithFilteredResult(_0x681151,_0x56f4c5))[_0x5e16('0x3f')](handleError(_0x681151,null));};exports[_0x5e16('0x40')]=function(_0x346abc,_0x1365bc){var _0x4d2cb8={'raw':!![],'where':{'id':_0x346abc[_0x5e16('0x41')]['id']}},_0x13a2d2={};_0x13a2d2[_0x5e16('0x2b')]=_['keys'](db[_0x5e16('0x29')]['rawAttributes']);_0x13a2d2[_0x5e16('0x2c')]=_[_0x5e16('0x2d')](_0x346abc[_0x5e16('0x2c')]);_0x13a2d2[_0x5e16('0x2e')]=_[_0x5e16('0x2f')](_0x13a2d2[_0x5e16('0x2b')],_0x13a2d2['query']);_0x4d2cb8[_0x5e16('0x30')]=_[_0x5e16('0x2f')](_0x13a2d2[_0x5e16('0x2b')],qs['fields'](_0x346abc[_0x5e16('0x2c')][_0x5e16('0x31')]));_0x4d2cb8['attributes']=_0x4d2cb8['attributes'][_0x5e16('0x42')]?_0x4d2cb8['attributes']:_0x13a2d2['model'];if(_0x346abc['query'][_0x5e16('0x43')]){_0x4d2cb8[_0x5e16('0x3c')]=[{'all':!![]}];}_0x4d2cb8=_[_0x5e16('0x39')]({},_0x4d2cb8,_0x346abc[_0x5e16('0x3a')]);return db[_0x5e16('0x29')][_0x5e16('0x44')](_0x4d2cb8)[_0x5e16('0x3b')](handleEntityNotFound(_0x1365bc,null))[_0x5e16('0x3b')](respondWithResult(_0x1365bc,null))['catch'](handleError(_0x1365bc,null));};exports[_0x5e16('0x45')]=function(_0x315521,_0x59bf9d){return db['Dynamics365Field'][_0x5e16('0x45')](_0x315521[_0x5e16('0x46')],{})[_0x5e16('0x3b')](respondWithResult(_0x59bf9d,0xc9))[_0x5e16('0x3f')](handleError(_0x59bf9d,null));};exports[_0x5e16('0x20')]=function(_0x7ac8,_0x549fc6){if(_0x7ac8[_0x5e16('0x46')]['id']){delete _0x7ac8['body']['id'];}return db['Dynamics365Field'][_0x5e16('0x44')]({'where':{'id':_0x7ac8[_0x5e16('0x41')]['id']}})[_0x5e16('0x3b')](handleEntityNotFound(_0x549fc6,null))[_0x5e16('0x3b')](saveUpdates(_0x7ac8['body'],null))['then'](respondWithResult(_0x549fc6,null))[_0x5e16('0x3f')](handleError(_0x549fc6,null));};exports[_0x5e16('0x21')]=function(_0x4cfb9b,_0x6e5961){return db['Dynamics365Field'][_0x5e16('0x44')]({'where':{'id':_0x4cfb9b['params']['id']}})[_0x5e16('0x3b')](handleEntityNotFound(_0x6e5961,null))[_0x5e16('0x3b')](removeEntity(_0x6e5961,null))[_0x5e16('0x3f')](handleError(_0x6e5961,null));}; \ No newline at end of file +var _0x5fc9=['update','then','destroy','error','name','send','index','map','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','Dynamics365Field','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','find','create','body','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','crypto','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject'];(function(_0x2b547d,_0x11dcca){var _0x261466=function(_0x24a3bc){while(--_0x24a3bc){_0x2b547d['push'](_0x2b547d['shift']());}};_0x261466(++_0x11dcca);}(_0x5fc9,0x1ca));var _0x95fc=function(_0x4896d1,_0x524fa5){_0x4896d1=_0x4896d1-0x0;var _0x4e9a57=_0x5fc9[_0x4896d1];return _0x4e9a57;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x95fc('0x0'));var zipdir=require(_0x95fc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x95fc('0x2'));var moment=require(_0x95fc('0x3'));var BPromise=require(_0x95fc('0x4'));var Mustache=require(_0x95fc('0x5'));var util=require('util');var path=require(_0x95fc('0x6'));var sox=require(_0x95fc('0x7'));var csv=require(_0x95fc('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x95fc('0x9'));var _=require(_0x95fc('0xa'));var squel=require('squel');var crypto=require(_0x95fc('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x95fc('0xc'));var Papa=require('papaparse');var Redis=require(_0x95fc('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x95fc('0xe'));var as=require(_0x95fc('0xf'));var hardwareService=require(_0x95fc('0x10'));var logger=require('../../config/logger')(_0x95fc('0x11'));var utils=require(_0x95fc('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x95fc('0x13'));var db=require(_0x95fc('0x14'))['db'];function respondWithStatusCode(_0x4e6340,_0x5438cb){_0x5438cb=_0x5438cb||0xcc;return function(_0x3882bd){if(_0x3882bd){return _0x4e6340[_0x95fc('0x15')](_0x5438cb);}return _0x4e6340[_0x95fc('0x16')](_0x5438cb)[_0x95fc('0x17')]();};}function respondWithResult(_0x4c1e77,_0xf0cc26){_0xf0cc26=_0xf0cc26||0xc8;return function(_0x2700c2){if(_0x2700c2){return _0x4c1e77[_0x95fc('0x16')](_0xf0cc26)[_0x95fc('0x18')](_0x2700c2);}};}function respondWithFilteredResult(_0x3a2ee7,_0x5edf77){return function(_0x548f88){if(_0x548f88){var _0x4fc139=typeof _0x5edf77[_0x95fc('0x19')]===_0x95fc('0x1a')&&typeof _0x5edf77[_0x95fc('0x1b')]==='undefined';var _0x2fdf9f=_0x548f88[_0x95fc('0x1c')];var _0x507bcb=_0x4fc139?0x0:_0x5edf77[_0x95fc('0x19')];var _0x28d5ef=_0x4fc139?_0x548f88['count']:_0x5edf77[_0x95fc('0x19')]+_0x5edf77[_0x95fc('0x1b')];var _0x40c2c9;if(_0x28d5ef>=_0x2fdf9f){_0x28d5ef=_0x2fdf9f;_0x40c2c9=0xc8;}else{_0x40c2c9=0xce;}_0x3a2ee7[_0x95fc('0x16')](_0x40c2c9);return _0x3a2ee7[_0x95fc('0x1d')](_0x95fc('0x1e'),_0x507bcb+'-'+_0x28d5ef+'/'+_0x2fdf9f)[_0x95fc('0x18')](_0x548f88);}return null;};}function patchUpdates(_0x349682){return function(_0x224c63){try{jsonpatch['apply'](_0x224c63,_0x349682,!![]);}catch(_0x4c6378){return BPromise[_0x95fc('0x1f')](_0x4c6378);}return _0x224c63['save']();};}function saveUpdates(_0x523ff1,_0x129508){return function(_0x352bab){if(_0x352bab){return _0x352bab[_0x95fc('0x20')](_0x523ff1)[_0x95fc('0x21')](function(_0x45186c){return _0x45186c;});}return null;};}function removeEntity(_0x193da3,_0x221ed3){return function(_0x113131){if(_0x113131){return _0x113131[_0x95fc('0x22')]()[_0x95fc('0x21')](function(){_0x193da3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4483ce,_0x62ed1d){return function(_0x269aad){if(!_0x269aad){_0x4483ce[_0x95fc('0x15')](0x194);}return _0x269aad;};}function handleError(_0xc7ea4b,_0x31a510){_0x31a510=_0x31a510||0x1f4;return function(_0x5489c4){logger[_0x95fc('0x23')](_0x5489c4['stack']);if(_0x5489c4[_0x95fc('0x24')]){delete _0x5489c4['name'];}_0xc7ea4b['status'](_0x31a510)[_0x95fc('0x25')](_0x5489c4);};}exports[_0x95fc('0x26')]=function(_0x21a0db,_0x1998a9){var _0x2a6e3b={},_0x269b38={},_0x431d00={'count':0x0,'rows':[]};var _0x582e3d=_[_0x95fc('0x27')](db['Dynamics365Field']['rawAttributes'],function(_0xc665b4){return{'name':_0xc665b4['fieldName'],'type':_0xc665b4[_0x95fc('0x28')][_0x95fc('0x29')]};});_0x269b38[_0x95fc('0x2a')]=_[_0x95fc('0x27')](_0x582e3d,'name');_0x269b38[_0x95fc('0x2b')]=_[_0x95fc('0x2c')](_0x21a0db[_0x95fc('0x2b')]);_0x269b38['filters']=_[_0x95fc('0x2d')](_0x269b38['model'],_0x269b38[_0x95fc('0x2b')]);_0x2a6e3b['attributes']=_[_0x95fc('0x2d')](_0x269b38['model'],qs[_0x95fc('0x2e')](_0x21a0db[_0x95fc('0x2b')][_0x95fc('0x2e')]));_0x2a6e3b['attributes']=_0x2a6e3b[_0x95fc('0x2f')]['length']?_0x2a6e3b[_0x95fc('0x2f')]:_0x269b38[_0x95fc('0x2a')];if(!_0x21a0db[_0x95fc('0x2b')][_0x95fc('0x30')](_0x95fc('0x31'))){_0x2a6e3b[_0x95fc('0x1b')]=qs[_0x95fc('0x1b')](_0x21a0db[_0x95fc('0x2b')]['limit']);_0x2a6e3b[_0x95fc('0x19')]=qs[_0x95fc('0x19')](_0x21a0db['query'][_0x95fc('0x19')]);}_0x2a6e3b['order']=qs[_0x95fc('0x32')](_0x21a0db[_0x95fc('0x2b')][_0x95fc('0x32')]);_0x2a6e3b[_0x95fc('0x33')]=qs[_0x95fc('0x34')](_[_0x95fc('0x35')](_0x21a0db['query'],_0x269b38[_0x95fc('0x34')]),_0x582e3d);if(_0x21a0db['query'][_0x95fc('0x36')]){_0x2a6e3b['where']=_[_0x95fc('0x37')](_0x2a6e3b['where'],{'$or':_['map'](_0x582e3d,function(_0x13ef06){if(_0x13ef06[_0x95fc('0x28')]!==_0x95fc('0x38')){var _0x2eb845={};_0x2eb845[_0x13ef06[_0x95fc('0x24')]]={'$like':'%'+_0x21a0db[_0x95fc('0x2b')][_0x95fc('0x36')]+'%'};return _0x2eb845;}})});}_0x2a6e3b=_[_0x95fc('0x37')]({},_0x2a6e3b,_0x21a0db['options']);var _0x354d81={'where':_0x2a6e3b[_0x95fc('0x33')]};return db[_0x95fc('0x39')]['count'](_0x354d81)[_0x95fc('0x21')](function(_0x683e73){_0x431d00[_0x95fc('0x1c')]=_0x683e73;if(_0x21a0db[_0x95fc('0x2b')][_0x95fc('0x3a')]){_0x2a6e3b[_0x95fc('0x3b')]=[{'all':!![]}];}return db[_0x95fc('0x39')][_0x95fc('0x3c')](_0x2a6e3b);})[_0x95fc('0x21')](function(_0x29d7eb){_0x431d00[_0x95fc('0x3d')]=_0x29d7eb;return _0x431d00;})[_0x95fc('0x21')](respondWithFilteredResult(_0x1998a9,_0x2a6e3b))[_0x95fc('0x3e')](handleError(_0x1998a9,null));};exports[_0x95fc('0x3f')]=function(_0x334885,_0x2c7b95){var _0x43ab19={'raw':!![],'where':{'id':_0x334885[_0x95fc('0x40')]['id']}},_0x4fdecd={};_0x4fdecd['model']=_[_0x95fc('0x2c')](db[_0x95fc('0x39')][_0x95fc('0x41')]);_0x4fdecd[_0x95fc('0x2b')]=_['keys'](_0x334885[_0x95fc('0x2b')]);_0x4fdecd[_0x95fc('0x34')]=_[_0x95fc('0x2d')](_0x4fdecd[_0x95fc('0x2a')],_0x4fdecd[_0x95fc('0x2b')]);_0x43ab19[_0x95fc('0x2f')]=_['intersection'](_0x4fdecd[_0x95fc('0x2a')],qs[_0x95fc('0x2e')](_0x334885[_0x95fc('0x2b')][_0x95fc('0x2e')]));_0x43ab19[_0x95fc('0x2f')]=_0x43ab19[_0x95fc('0x2f')][_0x95fc('0x42')]?_0x43ab19['attributes']:_0x4fdecd[_0x95fc('0x2a')];if(_0x334885[_0x95fc('0x2b')]['includeAll']){_0x43ab19[_0x95fc('0x3b')]=[{'all':!![]}];}_0x43ab19=_[_0x95fc('0x37')]({},_0x43ab19,_0x334885['options']);return db[_0x95fc('0x39')][_0x95fc('0x43')](_0x43ab19)[_0x95fc('0x21')](handleEntityNotFound(_0x2c7b95,null))[_0x95fc('0x21')](respondWithResult(_0x2c7b95,null))[_0x95fc('0x3e')](handleError(_0x2c7b95,null));};exports[_0x95fc('0x44')]=function(_0x2c0ea9,_0x2947cd){return db[_0x95fc('0x39')][_0x95fc('0x44')](_0x2c0ea9[_0x95fc('0x45')],{})[_0x95fc('0x21')](respondWithResult(_0x2947cd,0xc9))[_0x95fc('0x3e')](handleError(_0x2947cd,null));};exports[_0x95fc('0x20')]=function(_0x1402e9,_0x1a12f0){if(_0x1402e9['body']['id']){delete _0x1402e9[_0x95fc('0x45')]['id'];}return db[_0x95fc('0x39')][_0x95fc('0x43')]({'where':{'id':_0x1402e9[_0x95fc('0x40')]['id']}})[_0x95fc('0x21')](handleEntityNotFound(_0x1a12f0,null))[_0x95fc('0x21')](saveUpdates(_0x1402e9['body'],null))[_0x95fc('0x21')](respondWithResult(_0x1a12f0,null))[_0x95fc('0x3e')](handleError(_0x1a12f0,null));};exports[_0x95fc('0x22')]=function(_0x59c04b,_0x13aceb){return db[_0x95fc('0x39')][_0x95fc('0x43')]({'where':{'id':_0x59c04b[_0x95fc('0x40')]['id']}})[_0x95fc('0x21')](handleEntityNotFound(_0x13aceb,null))[_0x95fc('0x21')](removeEntity(_0x13aceb,null))[_0x95fc('0x3e')](handleError(_0x13aceb,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 765f1b7..b30978c 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 _0x4353=['./intDynamics365Field.attributes','exports','FieldId','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x545e9a,_0x2d9016){var _0x548780=function(_0x3cb507){while(--_0x3cb507){_0x545e9a['push'](_0x545e9a['shift']());}};_0x548780(++_0x2d9016);}(_0x4353,0x15f));var _0x3435=function(_0x2259a3,_0x4b358d){_0x2259a3=_0x2259a3-0x0;var _0x1cbc85=_0x4353[_0x2259a3];return _0x1cbc85;};'use strict';var _=require(_0x3435('0x0'));var util=require(_0x3435('0x1'));var logger=require('../../config/logger')(_0x3435('0x2'));var moment=require(_0x3435('0x3'));var BPromise=require(_0x3435('0x4'));var rp=require(_0x3435('0x5'));var fs=require('fs');var path=require(_0x3435('0x6'));var rimraf=require(_0x3435('0x7'));var config=require(_0x3435('0x8'));var attributes=require(_0x3435('0x9'));module[_0x3435('0xa')]=function(_0x2921ce,_0x264471){return _0x2921ce['define']('Dynamics365Field',attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':['idField',_0x3435('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa841=['exports','int_dynamics365_fields','idField','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes'];(function(_0x24f862,_0x4b645a){var _0x198aa4=function(_0x131195){while(--_0x131195){_0x24f862['push'](_0x24f862['shift']());}};_0x198aa4(++_0x4b645a);}(_0xa841,0xf3));var _0x1a84=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xa841[_0x27af45];return _0x18df21;};'use strict';var _=require(_0x1a84('0x0'));var util=require(_0x1a84('0x1'));var logger=require('../../config/logger')(_0x1a84('0x2'));var moment=require(_0x1a84('0x3'));var BPromise=require('bluebird');var rp=require(_0x1a84('0x4'));var fs=require('fs');var path=require(_0x1a84('0x5'));var rimraf=require(_0x1a84('0x6'));var config=require(_0x1a84('0x7'));var attributes=require(_0x1a84('0x8'));module[_0x1a84('0x9')]=function(_0x43fb47,_0x428292){return _0x43fb47['define']('Dynamics365Field',attributes,{'tableName':_0x1a84('0xa'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0x1a84('0xb'),'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 640854a..5ec1442 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 _0x6d21=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch'];(function(_0x37b519,_0x24b2ca){var _0x412276=function(_0xbe9cbb){while(--_0xbe9cbb){_0x37b519['push'](_0x37b519['shift']());}};_0x412276(++_0x24b2ca);}(_0x6d21,0x1e3));var _0x16d2=function(_0x556b16,_0x51f863){_0x556b16=_0x556b16-0x0;var _0x3f2a44=_0x6d21[_0x556b16];return _0x3f2a44;};'use strict';var _=require(_0x16d2('0x0'));var util=require(_0x16d2('0x1'));var moment=require(_0x16d2('0x2'));var BPromise=require(_0x16d2('0x3'));var rs=require(_0x16d2('0x4'));var fs=require('fs');var Redis=require(_0x16d2('0x5'));var db=require(_0x16d2('0x6'))['db'];var utils=require(_0x16d2('0x7'));var logger=require(_0x16d2('0x8'))(_0x16d2('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x16d2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4aab22,_0x38c544,_0x1e6a81){return new BPromise(function(_0x49b6a1,_0x571425){return client[_0x16d2('0xb')](_0x4aab22,_0x1e6a81)[_0x16d2('0xc')](function(_0x5536f9){logger[_0x16d2('0xd')](_0x16d2('0xe'),_0x38c544,_0x16d2('0xf'));logger[_0x16d2('0x10')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x38c544,_0x16d2('0xf'),JSON[_0x16d2('0x11')](_0x5536f9));if(_0x5536f9[_0x16d2('0x12')]){if(_0x5536f9[_0x16d2('0x12')][_0x16d2('0x13')]===0x1f4){logger[_0x16d2('0x12')]('Dynamics365Field,\x20%s,\x20%s',_0x38c544,_0x5536f9['error'][_0x16d2('0x14')]);return _0x571425(_0x5536f9[_0x16d2('0x12')][_0x16d2('0x14')]);}logger[_0x16d2('0x12')]('Dynamics365Field,\x20%s,\x20%s',_0x38c544,_0x5536f9['error'][_0x16d2('0x14')]);return _0x49b6a1(_0x5536f9[_0x16d2('0x12')][_0x16d2('0x14')]);}else{logger[_0x16d2('0xd')](_0x16d2('0xe'),_0x38c544,_0x16d2('0xf'));_0x49b6a1(_0x5536f9[_0x16d2('0x15')][_0x16d2('0x14')]);}})[_0x16d2('0x16')](function(_0x545e23){logger[_0x16d2('0x12')](_0x16d2('0xe'),_0x38c544,_0x545e23);_0x571425(_0x545e23);});});} \ No newline at end of file +var _0xd8c2=['stringify','error','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent'];(function(_0x210d7f,_0x2abe4f){var _0x42d687=function(_0x46b2ae){while(--_0x46b2ae){_0x210d7f['push'](_0x210d7f['shift']());}};_0x42d687(++_0x2abe4f);}(_0xd8c2,0x1e0));var _0x2d8c=function(_0x38a835,_0x19dd12){_0x38a835=_0x38a835-0x0;var _0x2d1b85=_0xd8c2[_0x38a835];return _0x2d1b85;};'use strict';var _=require('lodash');var util=require(_0x2d8c('0x0'));var moment=require(_0x2d8c('0x1'));var BPromise=require('bluebird');var rs=require(_0x2d8c('0x2'));var fs=require('fs');var Redis=require(_0x2d8c('0x3'));var db=require(_0x2d8c('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2d8c('0x5'));var config=require(_0x2d8c('0x6'));var jayson=require(_0x2d8c('0x7'));var client=jayson[_0x2d8c('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8ab062,_0x48daa4,_0x3d4a6a){return new BPromise(function(_0xb576f8,_0xd5c502){return client[_0x2d8c('0x9')](_0x8ab062,_0x3d4a6a)[_0x2d8c('0xa')](function(_0x1f002e){logger[_0x2d8c('0xb')](_0x2d8c('0xc'),_0x48daa4,_0x2d8c('0xd'));logger['debug']('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x48daa4,'request\x20sent',JSON[_0x2d8c('0xe')](_0x1f002e));if(_0x1f002e['error']){if(_0x1f002e['error']['code']===0x1f4){logger['error'](_0x2d8c('0xc'),_0x48daa4,_0x1f002e[_0x2d8c('0xf')][_0x2d8c('0x10')]);return _0xd5c502(_0x1f002e['error'][_0x2d8c('0x10')]);}logger['error'](_0x2d8c('0xc'),_0x48daa4,_0x1f002e[_0x2d8c('0xf')][_0x2d8c('0x10')]);return _0xb576f8(_0x1f002e['error'][_0x2d8c('0x10')]);}else{logger[_0x2d8c('0xb')](_0x2d8c('0xc'),_0x48daa4,_0x2d8c('0xd'));_0xb576f8(_0x1f002e[_0x2d8c('0x11')][_0x2d8c('0x10')]);}})[_0x2d8c('0x12')](function(_0x56d729){logger['error'](_0x2d8c('0xc'),_0x48daa4,_0x56d729);_0xd5c502(_0x56d729);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 5f5bab0..0ca5c31 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 _0xf562=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshdeskAccount.controller','get','index','show','/:id/configurations','getConfigurations','/:id/fields','isAuthenticated','getFields','post','create','addConfiguration','put','update','delete','/:id','destroy','exports'];(function(_0x27308a,_0x39ecb5){var _0x532efb=function(_0x54ee46){while(--_0x54ee46){_0x27308a['push'](_0x27308a['shift']());}};_0x532efb(++_0x39ecb5);}(_0xf562,0x1ba));var _0x2f56=function(_0x141d0a,_0x590c81){_0x141d0a=_0x141d0a-0x0;var _0x170d11=_0xf562[_0x141d0a];return _0x170d11;};'use strict';var multer=require('multer');var util=require(_0x2f56('0x0'));var path=require(_0x2f56('0x1'));var timeout=require(_0x2f56('0x2'));var express=require(_0x2f56('0x3'));var router=express[_0x2f56('0x4')]();var fs_extra=require(_0x2f56('0x5'));var auth=require(_0x2f56('0x6'));var interaction=require(_0x2f56('0x7'));var config=require('../../config/environment');var controller=require(_0x2f56('0x8'));router[_0x2f56('0x9')]('/',auth['isAuthenticated'](),controller[_0x2f56('0xa')]);router[_0x2f56('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x2f56('0xb')]);router[_0x2f56('0x9')](_0x2f56('0xc'),auth['isAuthenticated'](),controller[_0x2f56('0xd')]);router[_0x2f56('0x9')](_0x2f56('0xe'),auth[_0x2f56('0xf')](),controller[_0x2f56('0x10')]);router[_0x2f56('0x11')]('/',auth[_0x2f56('0xf')](),controller[_0x2f56('0x12')]);router[_0x2f56('0x11')](_0x2f56('0xc'),auth[_0x2f56('0xf')](),controller[_0x2f56('0x13')]);router[_0x2f56('0x14')]('/:id',auth[_0x2f56('0xf')](),controller[_0x2f56('0x15')]);router[_0x2f56('0x16')](_0x2f56('0x17'),auth[_0x2f56('0xf')](),controller[_0x2f56('0x18')]);module[_0x2f56('0x19')]=router; \ No newline at end of file +var _0xa950=['get','/:id/configurations','post','create','addConfiguration','put','update','delete','destroy','exports','multer','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id','show'];(function(_0x5bdfb2,_0x5eeb10){var _0x5f5240=function(_0x2cb9c6){while(--_0x2cb9c6){_0x5bdfb2['push'](_0x5bdfb2['shift']());}};_0x5f5240(++_0x5eeb10);}(_0xa950,0xdb));var _0x0a95=function(_0x5a2b80,_0x5bfdb6){_0x5a2b80=_0x5a2b80-0x0;var _0x4b81da=_0xa950[_0x5a2b80];return _0x4b81da;};'use strict';var multer=require(_0x0a95('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a95('0x1')]();var fs_extra=require(_0x0a95('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x0a95('0x3'));var config=require(_0x0a95('0x4'));var controller=require('./intFreshdeskAccount.controller');router['get']('/',auth[_0x0a95('0x5')](),controller[_0x0a95('0x6')]);router['get'](_0x0a95('0x7'),auth['isAuthenticated'](),controller[_0x0a95('0x8')]);router[_0x0a95('0x9')](_0x0a95('0xa'),auth[_0x0a95('0x5')](),controller['getConfigurations']);router[_0x0a95('0x9')]('/:id/fields',auth[_0x0a95('0x5')](),controller['getFields']);router[_0x0a95('0xb')]('/',auth['isAuthenticated'](),controller[_0x0a95('0xc')]);router[_0x0a95('0xb')](_0x0a95('0xa'),auth[_0x0a95('0x5')](),controller[_0x0a95('0xd')]);router[_0x0a95('0xe')]('/:id',auth[_0x0a95('0x5')](),controller[_0x0a95('0xf')]);router[_0x0a95('0x10')](_0x0a95('0x7'),auth[_0x0a95('0x5')](),controller[_0x0a95('0x11')]);module[_0x0a95('0x12')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 558856a..fffe3ea 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 _0x1a85=['STRING','remoteUri'];(function(_0x4c7d49,_0x284cdf){var _0x212fb0=function(_0x12e185){while(--_0x12e185){_0x4c7d49['push'](_0x4c7d49['shift']());}};_0x212fb0(++_0x284cdf);}(_0x1a85,0x178));var _0x51a8=function(_0x2ccdb9,_0x3ded46){_0x2ccdb9=_0x2ccdb9-0x0;var _0x4e8120=_0x1a85[_0x2ccdb9];return _0x4e8120;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x51a8('0x0')]},'description':{'type':Sequelize[_0x51a8('0x0')]},'username':{'type':Sequelize[_0x51a8('0x0')],'unique':'username'},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x51a8('0x0')],'unique':_0x51a8('0x1')},'serverUrl':{'type':Sequelize[_0x51a8('0x0')],'allowNull':![]}}; \ No newline at end of file +var _0xa30a=['sequelize','exports','STRING','username','remoteUri'];(function(_0x13d269,_0x32c58d){var _0x16c67a=function(_0x31306e){while(--_0x31306e){_0x13d269['push'](_0x13d269['shift']());}};_0x16c67a(++_0x32c58d);}(_0xa30a,0xd7));var _0xaa30=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa30a[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xaa30('0x0'));module[_0xaa30('0x1')]={'name':{'type':Sequelize[_0xaa30('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xaa30('0x2')],'unique':_0xaa30('0x3')},'apiKey':{'type':Sequelize[_0xaa30('0x2')]},'remoteUri':{'type':Sequelize[_0xaa30('0x2')],'unique':_0xaa30('0x4')},'serverUrl':{'type':Sequelize[_0xaa30('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 11ba677..aa8533e 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 _0x5e14=['request-promise','moment','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/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','index','map','FreshdeskAccount','rawAttributes','fieldName','key','query','keys','intersection','attributes','fields','model','sort','pick','filters','where','filter','merge','options','include','findAll','rows','show','params','includeAll','find','create','body','catch','getConfigurations','findOne','FreshdeskConfiguration','length','hasOwnProperty','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','type','getDescriptions','FreshdeskField','Descriptions','getFields','remoteUri','apiKey','slice','lastIndexOf','GET','format','api/v2/ticket_fields','%s:X','base64','requester','subject','description','priority','group','source','ticket_type','default','custom_text','custom_dropdown','choices','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x4de9e8,_0x565ffa){var _0x4db0de=function(_0x12279d){while(--_0x12279d){_0x4de9e8['push'](_0x4de9e8['shift']());}};_0x4db0de(++_0x565ffa);}(_0x5e14,0x164));var _0x45e1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5e14[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x45e1('0x0'));var rimraf=require(_0x45e1('0x1'));var zipdir=require(_0x45e1('0x2'));var jsonpatch=require(_0x45e1('0x3'));var rp=require(_0x45e1('0x4'));var moment=require(_0x45e1('0x5'));var BPromise=require(_0x45e1('0x6'));var Mustache=require(_0x45e1('0x7'));var util=require(_0x45e1('0x8'));var path=require(_0x45e1('0x9'));var sox=require(_0x45e1('0xa'));var csv=require(_0x45e1('0xb'));var ejs=require(_0x45e1('0xc'));var fs=require('fs');var fs_extra=require(_0x45e1('0xd'));var _=require(_0x45e1('0xe'));var squel=require(_0x45e1('0xf'));var crypto=require(_0x45e1('0x10'));var jsforce=require(_0x45e1('0x11'));var deskjs=require(_0x45e1('0x12'));var toCsv=require(_0x45e1('0xb'));var querystring=require(_0x45e1('0x13'));var Papa=require(_0x45e1('0x14'));var Redis=require('ioredis');var authService=require(_0x45e1('0x15'));var qs=require(_0x45e1('0x16'));var as=require(_0x45e1('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x45e1('0x18'))('api');var utils=require(_0x45e1('0x19'));var config=require(_0x45e1('0x1a'));var licenseUtil=require(_0x45e1('0x1b'));var db=require(_0x45e1('0x1c'))['db'];var integrations=require(_0x45e1('0x1d'));function respondWithStatusCode(_0x2ec2b9,_0x2ab53e){_0x2ab53e=_0x2ab53e||0xcc;return function(_0x59e307){if(_0x59e307){return _0x2ec2b9[_0x45e1('0x1e')](_0x2ab53e);}return _0x2ec2b9[_0x45e1('0x1f')](_0x2ab53e)[_0x45e1('0x20')]();};}function respondWithResult(_0x370297,_0x4364a0){_0x4364a0=_0x4364a0||0xc8;return function(_0x235cb9){if(_0x235cb9){return _0x370297[_0x45e1('0x1f')](_0x4364a0)['json'](_0x235cb9);}};}function respondWithFilteredResult(_0x5d9dba,_0x2de680){return function(_0x53a90e){if(_0x53a90e){var _0x5095be=typeof _0x2de680['offset']===_0x45e1('0x21')&&typeof _0x2de680[_0x45e1('0x22')]===_0x45e1('0x21');var _0x474aa2=_0x53a90e[_0x45e1('0x23')];var _0xb67f34=_0x5095be?0x0:_0x2de680[_0x45e1('0x24')];var _0x22d927=_0x5095be?_0x53a90e['count']:_0x2de680[_0x45e1('0x24')]+_0x2de680['limit'];var _0x3134f4;if(_0x22d927>=_0x474aa2){_0x22d927=_0x474aa2;_0x3134f4=0xc8;}else{_0x3134f4=0xce;}_0x5d9dba[_0x45e1('0x1f')](_0x3134f4);return _0x5d9dba[_0x45e1('0x25')](_0x45e1('0x26'),_0xb67f34+'-'+_0x22d927+'/'+_0x474aa2)[_0x45e1('0x27')](_0x53a90e);}return null;};}function patchUpdates(_0x4f4884){return function(_0x34d043){try{jsonpatch[_0x45e1('0x28')](_0x34d043,_0x4f4884,!![]);}catch(_0x44d900){return BPromise[_0x45e1('0x29')](_0x44d900);}return _0x34d043[_0x45e1('0x2a')]();};}function saveUpdates(_0x32ae6b,_0x477b12){return function(_0x2bdd53){if(_0x2bdd53){return _0x2bdd53[_0x45e1('0x2b')](_0x32ae6b)[_0x45e1('0x2c')](function(_0x2f724b){return _0x2f724b;});}return null;};}function removeEntity(_0x51fb60,_0x3847dd){return function(_0x81ea3c){if(_0x81ea3c){return _0x81ea3c[_0x45e1('0x2d')]()[_0x45e1('0x2c')](function(){_0x51fb60[_0x45e1('0x1f')](0xcc)[_0x45e1('0x20')]();});}};}function handleEntityNotFound(_0x20f986,_0xb92fc){return function(_0x5cd4c6){if(!_0x5cd4c6){_0x20f986[_0x45e1('0x1e')](0x194);}return _0x5cd4c6;};}function handleError(_0x3889bf,_0x668f14){_0x668f14=_0x668f14||0x1f4;return function(_0x284695){logger[_0x45e1('0x2e')](_0x284695[_0x45e1('0x2f')]);if(_0x284695[_0x45e1('0x30')]){delete _0x284695[_0x45e1('0x30')];}_0x3889bf[_0x45e1('0x1f')](_0x668f14)['send'](_0x284695);};}exports[_0x45e1('0x31')]=function(_0x52c7cc,_0x400a20){var _0x1b97ff={},_0x4fccf0={},_0x2f42f2={'count':0x0,'rows':[]};var _0x327b22=_[_0x45e1('0x32')](db[_0x45e1('0x33')][_0x45e1('0x34')],function(_0x290d99){return{'name':_0x290d99[_0x45e1('0x35')],'type':_0x290d99['type'][_0x45e1('0x36')]};});_0x4fccf0['model']=_[_0x45e1('0x32')](_0x327b22,_0x45e1('0x30'));_0x4fccf0[_0x45e1('0x37')]=_[_0x45e1('0x38')](_0x52c7cc['query']);_0x4fccf0['filters']=_[_0x45e1('0x39')](_0x4fccf0['model'],_0x4fccf0[_0x45e1('0x37')]);_0x1b97ff[_0x45e1('0x3a')]=_[_0x45e1('0x39')](_0x4fccf0['model'],qs[_0x45e1('0x3b')](_0x52c7cc[_0x45e1('0x37')][_0x45e1('0x3b')]));_0x1b97ff[_0x45e1('0x3a')]=_0x1b97ff[_0x45e1('0x3a')]['length']?_0x1b97ff[_0x45e1('0x3a')]:_0x4fccf0[_0x45e1('0x3c')];if(!_0x52c7cc[_0x45e1('0x37')]['hasOwnProperty']('nolimit')){_0x1b97ff[_0x45e1('0x22')]=qs[_0x45e1('0x22')](_0x52c7cc['query']['limit']);_0x1b97ff[_0x45e1('0x24')]=qs[_0x45e1('0x24')](_0x52c7cc['query'][_0x45e1('0x24')]);}_0x1b97ff['order']=qs[_0x45e1('0x3d')](_0x52c7cc[_0x45e1('0x37')][_0x45e1('0x3d')]);_0x1b97ff['where']=qs['filters'](_[_0x45e1('0x3e')](_0x52c7cc[_0x45e1('0x37')],_0x4fccf0[_0x45e1('0x3f')]),_0x327b22);if(_0x52c7cc[_0x45e1('0x37')]['filter']){_0x1b97ff['where']=_['merge'](_0x1b97ff[_0x45e1('0x40')],{'$or':_[_0x45e1('0x32')](_0x327b22,function(_0x2c1500){if(_0x2c1500['type']!=='VIRTUAL'){var _0x55f92b={};_0x55f92b[_0x2c1500[_0x45e1('0x30')]]={'$like':'%'+_0x52c7cc[_0x45e1('0x37')][_0x45e1('0x41')]+'%'};return _0x55f92b;}})});}_0x1b97ff=_[_0x45e1('0x42')]({},_0x1b97ff,_0x52c7cc[_0x45e1('0x43')]);var _0x2ef57b={'where':_0x1b97ff['where']};return db[_0x45e1('0x33')][_0x45e1('0x23')](_0x2ef57b)[_0x45e1('0x2c')](function(_0x1a070e){_0x2f42f2['count']=_0x1a070e;if(_0x52c7cc[_0x45e1('0x37')]['includeAll']){_0x1b97ff[_0x45e1('0x44')]=[{'all':!![]}];}return db['FreshdeskAccount'][_0x45e1('0x45')](_0x1b97ff);})[_0x45e1('0x2c')](function(_0xacce1d){_0x2f42f2[_0x45e1('0x46')]=_0xacce1d;return _0x2f42f2;})[_0x45e1('0x2c')](respondWithFilteredResult(_0x400a20,_0x1b97ff))['catch'](handleError(_0x400a20,null));};exports[_0x45e1('0x47')]=function(_0x1dc9fe,_0x11e45b){var _0x46feb6={'raw':![],'where':{'id':_0x1dc9fe[_0x45e1('0x48')]['id']}},_0x1c1a10={};_0x1c1a10['model']=_[_0x45e1('0x38')](db[_0x45e1('0x33')]['rawAttributes']);_0x1c1a10[_0x45e1('0x37')]=_[_0x45e1('0x38')](_0x1dc9fe[_0x45e1('0x37')]);_0x1c1a10[_0x45e1('0x3f')]=_[_0x45e1('0x39')](_0x1c1a10[_0x45e1('0x3c')],_0x1c1a10[_0x45e1('0x37')]);_0x46feb6[_0x45e1('0x3a')]=_[_0x45e1('0x39')](_0x1c1a10[_0x45e1('0x3c')],qs[_0x45e1('0x3b')](_0x1dc9fe[_0x45e1('0x37')][_0x45e1('0x3b')]));_0x46feb6[_0x45e1('0x3a')]=_0x46feb6[_0x45e1('0x3a')]['length']?_0x46feb6[_0x45e1('0x3a')]:_0x1c1a10[_0x45e1('0x3c')];if(_0x1dc9fe[_0x45e1('0x37')][_0x45e1('0x49')]){_0x46feb6[_0x45e1('0x44')]=[{'all':!![]}];}_0x46feb6=_[_0x45e1('0x42')]({},_0x46feb6,_0x1dc9fe[_0x45e1('0x43')]);return db[_0x45e1('0x33')][_0x45e1('0x4a')](_0x46feb6)[_0x45e1('0x2c')](handleEntityNotFound(_0x11e45b,null))[_0x45e1('0x2c')](respondWithResult(_0x11e45b,null))['catch'](handleError(_0x11e45b,null));};exports[_0x45e1('0x4b')]=function(_0x4a6b2e,_0x21f7e9){return db[_0x45e1('0x33')][_0x45e1('0x4b')](_0x4a6b2e[_0x45e1('0x4c')],{})['then'](respondWithResult(_0x21f7e9,0xc9))[_0x45e1('0x4d')](handleError(_0x21f7e9,null));};exports[_0x45e1('0x2b')]=function(_0x17701d,_0x22eb5c){if(_0x17701d[_0x45e1('0x4c')]['id']){delete _0x17701d[_0x45e1('0x4c')]['id'];}return db['FreshdeskAccount'][_0x45e1('0x4a')]({'where':{'id':_0x17701d[_0x45e1('0x48')]['id']}})[_0x45e1('0x2c')](handleEntityNotFound(_0x22eb5c,null))[_0x45e1('0x2c')](saveUpdates(_0x17701d['body'],null))[_0x45e1('0x2c')](respondWithResult(_0x22eb5c,null))[_0x45e1('0x4d')](handleError(_0x22eb5c,null));};exports[_0x45e1('0x2d')]=function(_0x1c1824,_0x10580e){return db[_0x45e1('0x33')][_0x45e1('0x4a')]({'where':{'id':_0x1c1824[_0x45e1('0x48')]['id']}})[_0x45e1('0x2c')](handleEntityNotFound(_0x10580e,null))[_0x45e1('0x2c')](removeEntity(_0x10580e,null))['catch'](handleError(_0x10580e,null));};exports[_0x45e1('0x4e')]=function(_0x273043,_0x3234f1,_0x2126a9){var _0x5f1be7={};var _0x2a5a99={};var _0x10d9ff;var _0x4e0bca;return db[_0x45e1('0x33')][_0x45e1('0x4f')]({'where':{'id':_0x273043[_0x45e1('0x48')]['id']}})[_0x45e1('0x2c')](handleEntityNotFound(_0x3234f1,null))[_0x45e1('0x2c')](function(_0x5e08e1){if(_0x5e08e1){_0x10d9ff=_0x5e08e1;_0x2a5a99[_0x45e1('0x3c')]=_[_0x45e1('0x38')](db[_0x45e1('0x50')][_0x45e1('0x34')]);_0x2a5a99['query']=_[_0x45e1('0x38')](_0x273043[_0x45e1('0x37')]);_0x2a5a99['filters']=_[_0x45e1('0x39')](_0x2a5a99[_0x45e1('0x3c')],_0x2a5a99[_0x45e1('0x37')]);_0x5f1be7[_0x45e1('0x3a')]=_[_0x45e1('0x39')](_0x2a5a99[_0x45e1('0x3c')],qs['fields'](_0x273043['query']['fields']));_0x5f1be7[_0x45e1('0x3a')]=_0x5f1be7['attributes'][_0x45e1('0x51')]?_0x5f1be7[_0x45e1('0x3a')]:_0x2a5a99[_0x45e1('0x3c')];_0x5f1be7['order']=qs[_0x45e1('0x3d')](_0x273043[_0x45e1('0x37')][_0x45e1('0x3d')]);_0x5f1be7[_0x45e1('0x40')]=qs[_0x45e1('0x3f')](_['pick'](_0x273043[_0x45e1('0x37')],_0x2a5a99[_0x45e1('0x3f')]));if(_0x273043[_0x45e1('0x37')][_0x45e1('0x41')]){_0x5f1be7[_0x45e1('0x40')]=_[_0x45e1('0x42')](_0x5f1be7[_0x45e1('0x40')],{'$or':_['map'](_0x5f1be7[_0x45e1('0x3a')],function(_0x256d9c){var _0x194fdd={};_0x194fdd[_0x256d9c]={'$like':'%'+_0x273043[_0x45e1('0x37')][_0x45e1('0x41')]+'%'};return _0x194fdd;})});}_0x5f1be7=_[_0x45e1('0x42')]({},_0x5f1be7,_0x273043[_0x45e1('0x43')]);return _0x10d9ff[_0x45e1('0x4e')](_0x5f1be7);}})[_0x45e1('0x2c')](function(_0x3fd1ca){if(_0x3fd1ca){_0x4e0bca=_0x3fd1ca['length'];if(!_0x273043[_0x45e1('0x37')][_0x45e1('0x52')](_0x45e1('0x53'))){_0x5f1be7[_0x45e1('0x22')]=qs['limit'](_0x273043[_0x45e1('0x37')][_0x45e1('0x22')]);_0x5f1be7['offset']=qs[_0x45e1('0x24')](_0x273043[_0x45e1('0x37')][_0x45e1('0x24')]);}return _0x10d9ff['getConfigurations'](_0x5f1be7);}})[_0x45e1('0x2c')](function(_0x5c4b49){if(_0x5c4b49){return _0x5c4b49?{'count':_0x4e0bca,'rows':_0x5c4b49}:null;}})[_0x45e1('0x2c')](respondWithResult(_0x3234f1,null))[_0x45e1('0x4d')](handleError(_0x3234f1,null));};exports[_0x45e1('0x54')]=function(_0xf19241,_0x50bde2,_0x5b0cf4){if(_0xf19241[_0x45e1('0x4c')]['id']){delete _0xf19241[_0x45e1('0x4c')]['id'];}return db[_0x45e1('0x33')]['findOne']({'where':{'id':_0xf19241[_0x45e1('0x48')]['id']}})[_0x45e1('0x2c')](handleEntityNotFound(_0x50bde2,null))[_0x45e1('0x2c')](function(_0x1e9735){if(_0x1e9735){_0xf19241['body'][_0x45e1('0x55')]=_0x1e9735['id'];_0xf19241[_0x45e1('0x4c')][_0x45e1('0x56')]=integrations[_0x45e1('0x57')](_0xf19241[_0x45e1('0x4c')][_0x45e1('0x58')],_0xf19241[_0x45e1('0x4c')][_0x45e1('0x59')]);_0xf19241[_0x45e1('0x4c')]['Descriptions']=integrations[_0x45e1('0x5a')](_0xf19241['body'][_0x45e1('0x58')],_0xf19241[_0x45e1('0x4c')]['type']);return db[_0x45e1('0x50')][_0x45e1('0x4b')](_0xf19241[_0x45e1('0x4c')],{'include':[{'model':db[_0x45e1('0x5b')],'as':_0x45e1('0x56')},{'model':db[_0x45e1('0x5b')],'as':_0x45e1('0x5c')}]});}return null;})[_0x45e1('0x2c')](respondWithResult(_0x50bde2,null))[_0x45e1('0x4d')](handleError(_0x50bde2,null));};exports[_0x45e1('0x5d')]=function(_0xdd2fd1,_0x2c2b42,_0x47218e){var _0x398cf8='';return db[_0x45e1('0x33')]['findOne']({'where':{'id':_0xdd2fd1[_0x45e1('0x48')]['id']},'attributes':['id',_0x45e1('0x5e'),_0x45e1('0x5f')]})[_0x45e1('0x2c')](handleEntityNotFound(_0x2c2b42,null))[_0x45e1('0x2c')](function(_0xf29469){if(_0xf29469){_0x398cf8=_0xf29469[_0x45e1('0x5e')];var _0x12afc0=_0x398cf8[_0x45e1('0x60')](-0x1);if(_0x12afc0==='/'){_0x398cf8=_0x398cf8['substring'](0x0,_0x398cf8[_0x45e1('0x61')](_0x12afc0));}return rp({'method':_0x45e1('0x62'),'uri':util[_0x45e1('0x63')]('%s/%s',_0x398cf8,_0x45e1('0x64')),'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0x45e1('0x63')](_0x45e1('0x65'),_0xf29469['apiKey']))['toString'](_0x45e1('0x66')))},'json':!![]});}})[_0x45e1('0x2c')](function(_0x156479){if(_0x156479){var _0xa4529f=[_0x45e1('0x67'),_0x45e1('0x68'),'agent',_0x45e1('0x69'),_0x45e1('0x1f'),_0x45e1('0x6a'),_0x45e1('0x6b'),_0x45e1('0x6c'),_0x45e1('0x6d'),_0x45e1('0x6b'),'company'];_['remove'](_0x156479,function(_0x22b3d8){return _0xa4529f['includes'](_0x22b3d8['name'])||!_0x22b3d8[_0x45e1('0x6e')]&&_0x22b3d8[_0x45e1('0x59')]!==_0x45e1('0x6f')&&_0x22b3d8[_0x45e1('0x59')]!==_0x45e1('0x70');});return{'count':_0x156479[_0x45e1('0x51')],'rows':_[_0x45e1('0x32')](_0x156479,function(_0x180f2d){return{'id':_0x180f2d[_0x45e1('0x30')],'name':_0x180f2d['label'],'custom':!_0x180f2d[_0x45e1('0x6e')],'options':_0x180f2d[_0x45e1('0x71')]?_[_0x45e1('0x32')](_0x180f2d[_0x45e1('0x71')],function(_0x5759f8){return{'name':_['capitalize'](_0x5759f8),'value':_0x5759f8};}):[]};})};}})['then'](respondWithResult(_0x2c2b42,null))[_0x45e1('0x4d')](function(_0x5700d0){var _0x3f2809=_0xdd2fd1[_0x45e1('0x37')][_0x45e1('0x72')]?0x1f4:_0x5700d0[_0x45e1('0x73')]||0x1f4;logger[_0x45e1('0x2e')](_0x45e1('0x74'),'getFields',_0x3f2809,JSON[_0x45e1('0x75')](_0x5700d0));delete _0x5700d0[_0x45e1('0x30')];if(_0x3f2809===0x191){_0x3f2809=0x190;}_0x2c2b42[_0x45e1('0x1f')](_0x3f2809)[_0x45e1('0x76')](_0xdd2fd1[_0x45e1('0x37')][_0x45e1('0x72')]?{'message':_0x45e1('0x77'),'statusCode':_0x5700d0[_0x45e1('0x73')]}:_0x5700d0);});}; \ No newline at end of file +var _0xe189=['map','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','FreshdeskAccount','findAll','catch','find','create','body','params','findOne','FreshdeskConfiguration','getConfigurations','nolimit','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','FreshdeskField','remoteUri','apiKey','slice','substring','%s/%s','format','Basic\x20%s','%s:X','toString','base64','requester','description','priority','group','source','company','remove','includes','label','default','choices','capitalize','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','eml-format','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','destroy','then','error','stack','name','send','index','rawAttributes','fieldName','type','key'];(function(_0x2881e2,_0x341293){var _0x5c1e1f=function(_0x10ba61){while(--_0x10ba61){_0x2881e2['push'](_0x2881e2['shift']());}};_0x5c1e1f(++_0x341293);}(_0xe189,0x194));var _0x9e18=function(_0x458726,_0x5caaa2){_0x458726=_0x458726-0x0;var _0x48a564=_0xe189[_0x458726];return _0x48a564;};'use strict';var emlformat=require(_0x9e18('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9e18('0x1'));var rp=require(_0x9e18('0x2'));var moment=require(_0x9e18('0x3'));var BPromise=require(_0x9e18('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9e18('0x5'));var sox=require(_0x9e18('0x6'));var csv=require(_0x9e18('0x7'));var ejs=require(_0x9e18('0x8'));var fs=require('fs');var fs_extra=require(_0x9e18('0x9'));var _=require('lodash');var squel=require(_0x9e18('0xa'));var crypto=require(_0x9e18('0xb'));var jsforce=require(_0x9e18('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x9e18('0x7'));var querystring=require(_0x9e18('0xd'));var Papa=require(_0x9e18('0xe'));var Redis=require('ioredis');var authService=require(_0x9e18('0xf'));var qs=require(_0x9e18('0x10'));var as=require(_0x9e18('0x11'));var hardwareService=require(_0x9e18('0x12'));var logger=require(_0x9e18('0x13'))(_0x9e18('0x14'));var utils=require(_0x9e18('0x15'));var config=require(_0x9e18('0x16'));var licenseUtil=require(_0x9e18('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x9e18('0x18'));function respondWithStatusCode(_0x502513,_0x39a077){_0x39a077=_0x39a077||0xcc;return function(_0x56c209){if(_0x56c209){return _0x502513['sendStatus'](_0x39a077);}return _0x502513[_0x9e18('0x19')](_0x39a077)[_0x9e18('0x1a')]();};}function respondWithResult(_0x35c4e1,_0x97e41a){_0x97e41a=_0x97e41a||0xc8;return function(_0x566954){if(_0x566954){return _0x35c4e1[_0x9e18('0x19')](_0x97e41a)['json'](_0x566954);}};}function respondWithFilteredResult(_0x57bcd9,_0xb10405){return function(_0x4e7bcb){if(_0x4e7bcb){var _0x691a51=typeof _0xb10405[_0x9e18('0x1b')]===_0x9e18('0x1c')&&typeof _0xb10405[_0x9e18('0x1d')]==='undefined';var _0x4a5247=_0x4e7bcb[_0x9e18('0x1e')];var _0x446098=_0x691a51?0x0:_0xb10405['offset'];var _0x1aa23f=_0x691a51?_0x4e7bcb['count']:_0xb10405[_0x9e18('0x1b')]+_0xb10405['limit'];var _0x2ef267;if(_0x1aa23f>=_0x4a5247){_0x1aa23f=_0x4a5247;_0x2ef267=0xc8;}else{_0x2ef267=0xce;}_0x57bcd9[_0x9e18('0x19')](_0x2ef267);return _0x57bcd9[_0x9e18('0x1f')](_0x9e18('0x20'),_0x446098+'-'+_0x1aa23f+'/'+_0x4a5247)[_0x9e18('0x21')](_0x4e7bcb);}return null;};}function patchUpdates(_0x3fb6ba){return function(_0x21d814){try{jsonpatch[_0x9e18('0x22')](_0x21d814,_0x3fb6ba,!![]);}catch(_0x11619d){return BPromise['reject'](_0x11619d);}return _0x21d814[_0x9e18('0x23')]();};}function saveUpdates(_0x24cc43,_0x37738e){return function(_0x52039e){if(_0x52039e){return _0x52039e[_0x9e18('0x24')](_0x24cc43)['then'](function(_0x4b591){return _0x4b591;});}return null;};}function removeEntity(_0x50131d,_0x2f5a26){return function(_0x4eabe9){if(_0x4eabe9){return _0x4eabe9[_0x9e18('0x25')]()[_0x9e18('0x26')](function(){_0x50131d['status'](0xcc)[_0x9e18('0x1a')]();});}};}function handleEntityNotFound(_0x4b6ab5,_0x4c133b){return function(_0x445f10){if(!_0x445f10){_0x4b6ab5['sendStatus'](0x194);}return _0x445f10;};}function handleError(_0x4513e7,_0x49a3d6){_0x49a3d6=_0x49a3d6||0x1f4;return function(_0xcf65ba){logger[_0x9e18('0x27')](_0xcf65ba[_0x9e18('0x28')]);if(_0xcf65ba[_0x9e18('0x29')]){delete _0xcf65ba[_0x9e18('0x29')];}_0x4513e7[_0x9e18('0x19')](_0x49a3d6)[_0x9e18('0x2a')](_0xcf65ba);};}exports[_0x9e18('0x2b')]=function(_0xc75df0,_0x5e1eb2){var _0x2ee4da={},_0x2621e9={},_0x284f51={'count':0x0,'rows':[]};var _0x2325b6=_['map'](db['FreshdeskAccount'][_0x9e18('0x2c')],function(_0x1bb217){return{'name':_0x1bb217[_0x9e18('0x2d')],'type':_0x1bb217[_0x9e18('0x2e')][_0x9e18('0x2f')]};});_0x2621e9['model']=_[_0x9e18('0x30')](_0x2325b6,_0x9e18('0x29'));_0x2621e9[_0x9e18('0x31')]=_[_0x9e18('0x32')](_0xc75df0[_0x9e18('0x31')]);_0x2621e9[_0x9e18('0x33')]=_['intersection'](_0x2621e9[_0x9e18('0x34')],_0x2621e9[_0x9e18('0x31')]);_0x2ee4da[_0x9e18('0x35')]=_[_0x9e18('0x36')](_0x2621e9[_0x9e18('0x34')],qs['fields'](_0xc75df0['query'][_0x9e18('0x37')]));_0x2ee4da[_0x9e18('0x35')]=_0x2ee4da[_0x9e18('0x35')][_0x9e18('0x38')]?_0x2ee4da['attributes']:_0x2621e9[_0x9e18('0x34')];if(!_0xc75df0[_0x9e18('0x31')][_0x9e18('0x39')]('nolimit')){_0x2ee4da[_0x9e18('0x1d')]=qs['limit'](_0xc75df0[_0x9e18('0x31')]['limit']);_0x2ee4da[_0x9e18('0x1b')]=qs[_0x9e18('0x1b')](_0xc75df0[_0x9e18('0x31')][_0x9e18('0x1b')]);}_0x2ee4da[_0x9e18('0x3a')]=qs[_0x9e18('0x3b')](_0xc75df0[_0x9e18('0x31')][_0x9e18('0x3b')]);_0x2ee4da[_0x9e18('0x3c')]=qs[_0x9e18('0x33')](_[_0x9e18('0x3d')](_0xc75df0['query'],_0x2621e9[_0x9e18('0x33')]),_0x2325b6);if(_0xc75df0[_0x9e18('0x31')][_0x9e18('0x3e')]){_0x2ee4da[_0x9e18('0x3c')]=_[_0x9e18('0x3f')](_0x2ee4da[_0x9e18('0x3c')],{'$or':_[_0x9e18('0x30')](_0x2325b6,function(_0x2bfaf4){if(_0x2bfaf4[_0x9e18('0x2e')]!==_0x9e18('0x40')){var _0x258969={};_0x258969[_0x2bfaf4[_0x9e18('0x29')]]={'$like':'%'+_0xc75df0[_0x9e18('0x31')][_0x9e18('0x3e')]+'%'};return _0x258969;}})});}_0x2ee4da=_['merge']({},_0x2ee4da,_0xc75df0[_0x9e18('0x41')]);var _0x5d9ffe={'where':_0x2ee4da[_0x9e18('0x3c')]};return db['FreshdeskAccount'][_0x9e18('0x1e')](_0x5d9ffe)[_0x9e18('0x26')](function(_0x1821cb){_0x284f51[_0x9e18('0x1e')]=_0x1821cb;if(_0xc75df0[_0x9e18('0x31')][_0x9e18('0x42')]){_0x2ee4da[_0x9e18('0x43')]=[{'all':!![]}];}return db[_0x9e18('0x44')][_0x9e18('0x45')](_0x2ee4da);})[_0x9e18('0x26')](function(_0x579142){_0x284f51['rows']=_0x579142;return _0x284f51;})['then'](respondWithFilteredResult(_0x5e1eb2,_0x2ee4da))[_0x9e18('0x46')](handleError(_0x5e1eb2,null));};exports['show']=function(_0x4ad78e,_0x411317){var _0xb11dc0={'raw':![],'where':{'id':_0x4ad78e['params']['id']}},_0x2f38b9={};_0x2f38b9[_0x9e18('0x34')]=_[_0x9e18('0x32')](db[_0x9e18('0x44')][_0x9e18('0x2c')]);_0x2f38b9[_0x9e18('0x31')]=_['keys'](_0x4ad78e[_0x9e18('0x31')]);_0x2f38b9[_0x9e18('0x33')]=_[_0x9e18('0x36')](_0x2f38b9[_0x9e18('0x34')],_0x2f38b9['query']);_0xb11dc0[_0x9e18('0x35')]=_[_0x9e18('0x36')](_0x2f38b9[_0x9e18('0x34')],qs[_0x9e18('0x37')](_0x4ad78e[_0x9e18('0x31')]['fields']));_0xb11dc0[_0x9e18('0x35')]=_0xb11dc0[_0x9e18('0x35')][_0x9e18('0x38')]?_0xb11dc0[_0x9e18('0x35')]:_0x2f38b9[_0x9e18('0x34')];if(_0x4ad78e['query']['includeAll']){_0xb11dc0['include']=[{'all':!![]}];}_0xb11dc0=_['merge']({},_0xb11dc0,_0x4ad78e[_0x9e18('0x41')]);return db[_0x9e18('0x44')][_0x9e18('0x47')](_0xb11dc0)[_0x9e18('0x26')](handleEntityNotFound(_0x411317,null))[_0x9e18('0x26')](respondWithResult(_0x411317,null))['catch'](handleError(_0x411317,null));};exports[_0x9e18('0x48')]=function(_0x36eeaf,_0x375f11){return db[_0x9e18('0x44')]['create'](_0x36eeaf['body'],{})[_0x9e18('0x26')](respondWithResult(_0x375f11,0xc9))[_0x9e18('0x46')](handleError(_0x375f11,null));};exports[_0x9e18('0x24')]=function(_0x28a370,_0xda11e3){if(_0x28a370[_0x9e18('0x49')]['id']){delete _0x28a370['body']['id'];}return db[_0x9e18('0x44')]['find']({'where':{'id':_0x28a370[_0x9e18('0x4a')]['id']}})[_0x9e18('0x26')](handleEntityNotFound(_0xda11e3,null))[_0x9e18('0x26')](saveUpdates(_0x28a370[_0x9e18('0x49')],null))[_0x9e18('0x26')](respondWithResult(_0xda11e3,null))[_0x9e18('0x46')](handleError(_0xda11e3,null));};exports[_0x9e18('0x25')]=function(_0x3edade,_0x352ca5){return db[_0x9e18('0x44')][_0x9e18('0x47')]({'where':{'id':_0x3edade[_0x9e18('0x4a')]['id']}})[_0x9e18('0x26')](handleEntityNotFound(_0x352ca5,null))[_0x9e18('0x26')](removeEntity(_0x352ca5,null))[_0x9e18('0x46')](handleError(_0x352ca5,null));};exports['getConfigurations']=function(_0x210835,_0x134abb,_0x2d0811){var _0x324079={};var _0x2fe5c8={};var _0x4ce26e;var _0x2630aa;return db[_0x9e18('0x44')][_0x9e18('0x4b')]({'where':{'id':_0x210835[_0x9e18('0x4a')]['id']}})[_0x9e18('0x26')](handleEntityNotFound(_0x134abb,null))[_0x9e18('0x26')](function(_0x1db24e){if(_0x1db24e){_0x4ce26e=_0x1db24e;_0x2fe5c8[_0x9e18('0x34')]=_[_0x9e18('0x32')](db[_0x9e18('0x4c')][_0x9e18('0x2c')]);_0x2fe5c8[_0x9e18('0x31')]=_[_0x9e18('0x32')](_0x210835[_0x9e18('0x31')]);_0x2fe5c8[_0x9e18('0x33')]=_[_0x9e18('0x36')](_0x2fe5c8[_0x9e18('0x34')],_0x2fe5c8[_0x9e18('0x31')]);_0x324079[_0x9e18('0x35')]=_[_0x9e18('0x36')](_0x2fe5c8[_0x9e18('0x34')],qs[_0x9e18('0x37')](_0x210835[_0x9e18('0x31')][_0x9e18('0x37')]));_0x324079[_0x9e18('0x35')]=_0x324079[_0x9e18('0x35')][_0x9e18('0x38')]?_0x324079['attributes']:_0x2fe5c8[_0x9e18('0x34')];_0x324079[_0x9e18('0x3a')]=qs[_0x9e18('0x3b')](_0x210835[_0x9e18('0x31')][_0x9e18('0x3b')]);_0x324079[_0x9e18('0x3c')]=qs[_0x9e18('0x33')](_['pick'](_0x210835[_0x9e18('0x31')],_0x2fe5c8[_0x9e18('0x33')]));if(_0x210835[_0x9e18('0x31')][_0x9e18('0x3e')]){_0x324079[_0x9e18('0x3c')]=_[_0x9e18('0x3f')](_0x324079[_0x9e18('0x3c')],{'$or':_[_0x9e18('0x30')](_0x324079[_0x9e18('0x35')],function(_0x5f07e5){var _0x7aeac0={};_0x7aeac0[_0x5f07e5]={'$like':'%'+_0x210835[_0x9e18('0x31')]['filter']+'%'};return _0x7aeac0;})});}_0x324079=_[_0x9e18('0x3f')]({},_0x324079,_0x210835[_0x9e18('0x41')]);return _0x4ce26e[_0x9e18('0x4d')](_0x324079);}})[_0x9e18('0x26')](function(_0x4cdfe3){if(_0x4cdfe3){_0x2630aa=_0x4cdfe3[_0x9e18('0x38')];if(!_0x210835[_0x9e18('0x31')][_0x9e18('0x39')](_0x9e18('0x4e'))){_0x324079['limit']=qs[_0x9e18('0x1d')](_0x210835[_0x9e18('0x31')][_0x9e18('0x1d')]);_0x324079[_0x9e18('0x1b')]=qs['offset'](_0x210835[_0x9e18('0x31')]['offset']);}return _0x4ce26e[_0x9e18('0x4d')](_0x324079);}})[_0x9e18('0x26')](function(_0x2ee076){if(_0x2ee076){return _0x2ee076?{'count':_0x2630aa,'rows':_0x2ee076}:null;}})[_0x9e18('0x26')](respondWithResult(_0x134abb,null))[_0x9e18('0x46')](handleError(_0x134abb,null));};exports[_0x9e18('0x4f')]=function(_0x60233c,_0x212341,_0x5673dc){if(_0x60233c[_0x9e18('0x49')]['id']){delete _0x60233c[_0x9e18('0x49')]['id'];}return db[_0x9e18('0x44')][_0x9e18('0x4b')]({'where':{'id':_0x60233c['params']['id']}})['then'](handleEntityNotFound(_0x212341,null))[_0x9e18('0x26')](function(_0x21f734){if(_0x21f734){_0x60233c[_0x9e18('0x49')][_0x9e18('0x50')]=_0x21f734['id'];_0x60233c[_0x9e18('0x49')][_0x9e18('0x51')]=integrations['getSubjects'](_0x60233c['body'][_0x9e18('0x52')],_0x60233c[_0x9e18('0x49')][_0x9e18('0x2e')]);_0x60233c[_0x9e18('0x49')][_0x9e18('0x53')]=integrations[_0x9e18('0x54')](_0x60233c['body'][_0x9e18('0x52')],_0x60233c['body']['type']);return db['FreshdeskConfiguration']['create'](_0x60233c[_0x9e18('0x49')],{'include':[{'model':db[_0x9e18('0x55')],'as':_0x9e18('0x51')},{'model':db[_0x9e18('0x55')],'as':_0x9e18('0x53')}]});}return null;})[_0x9e18('0x26')](respondWithResult(_0x212341,null))[_0x9e18('0x46')](handleError(_0x212341,null));};exports['getFields']=function(_0x222366,_0x1e241d,_0x569cf5){var _0x52a6ef='';return db['FreshdeskAccount']['findOne']({'where':{'id':_0x222366[_0x9e18('0x4a')]['id']},'attributes':['id',_0x9e18('0x56'),_0x9e18('0x57')]})[_0x9e18('0x26')](handleEntityNotFound(_0x1e241d,null))['then'](function(_0x5c4d97){if(_0x5c4d97){_0x52a6ef=_0x5c4d97[_0x9e18('0x56')];var _0x40384b=_0x52a6ef[_0x9e18('0x58')](-0x1);if(_0x40384b==='/'){_0x52a6ef=_0x52a6ef[_0x9e18('0x59')](0x0,_0x52a6ef['lastIndexOf'](_0x40384b));}return rp({'method':'GET','uri':util['format'](_0x9e18('0x5a'),_0x52a6ef,'api/v2/ticket_fields'),'headers':{'Authorization':util[_0x9e18('0x5b')](_0x9e18('0x5c'),new Buffer(util[_0x9e18('0x5b')](_0x9e18('0x5d'),_0x5c4d97[_0x9e18('0x57')]))[_0x9e18('0x5e')](_0x9e18('0x5f')))},'json':!![]});}})[_0x9e18('0x26')](function(_0xf60714){if(_0xf60714){var _0x5217bd=[_0x9e18('0x60'),'subject','agent',_0x9e18('0x61'),_0x9e18('0x19'),_0x9e18('0x62'),_0x9e18('0x63'),_0x9e18('0x64'),'ticket_type',_0x9e18('0x63'),_0x9e18('0x65')];_[_0x9e18('0x66')](_0xf60714,function(_0x55f676){return _0x5217bd[_0x9e18('0x67')](_0x55f676[_0x9e18('0x29')])||!_0x55f676['default']&&_0x55f676[_0x9e18('0x2e')]!=='custom_text'&&_0x55f676['type']!=='custom_dropdown';});return{'count':_0xf60714[_0x9e18('0x38')],'rows':_[_0x9e18('0x30')](_0xf60714,function(_0x4ceeb3){return{'id':_0x4ceeb3[_0x9e18('0x29')],'name':_0x4ceeb3[_0x9e18('0x68')],'custom':!_0x4ceeb3[_0x9e18('0x69')],'options':_0x4ceeb3['choices']?_['map'](_0x4ceeb3[_0x9e18('0x6a')],function(_0x539aa9){return{'name':_[_0x9e18('0x6b')](_0x539aa9),'value':_0x539aa9};}):[]};})};}})[_0x9e18('0x26')](respondWithResult(_0x1e241d,null))['catch'](function(_0x2d8c1a){var _0x503234=_0x222366[_0x9e18('0x31')][_0x9e18('0x6c')]?0x1f4:_0x2d8c1a['statusCode']||0x1f4;logger[_0x9e18('0x27')](_0x9e18('0x6d'),'getFields',_0x503234,JSON[_0x9e18('0x6e')](_0x2d8c1a));delete _0x2d8c1a[_0x9e18('0x29')];if(_0x503234===0x191){_0x503234=0x190;}_0x1e241d[_0x9e18('0x19')](_0x503234)[_0x9e18('0x2a')](_0x222366[_0x9e18('0x31')][_0x9e18('0x6c')]?{'message':_0x9e18('0x6f'),'statusCode':_0x2d8c1a[_0x9e18('0x70')]}:_0x2d8c1a);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 9cb4242..c0a7cb4 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 _0x3252=['define','FreshdeskAccount','int_freshdesk_accounts','lodash','../../config/logger','moment','request-promise','path','../../config/environment','./intFreshdeskAccount.attributes','exports'];(function(_0x49f760,_0x1a8f26){var _0x6d1f5b=function(_0x182b5c){while(--_0x182b5c){_0x49f760['push'](_0x49f760['shift']());}};_0x6d1f5b(++_0x1a8f26);}(_0x3252,0x18f));var _0x2325=function(_0x15b148,_0x6fd9b6){_0x15b148=_0x15b148-0x0;var _0x18819c=_0x3252[_0x15b148];return _0x18819c;};'use strict';var _=require(_0x2325('0x0'));var util=require('util');var logger=require(_0x2325('0x1'))('api');var moment=require(_0x2325('0x2'));var BPromise=require('bluebird');var rp=require(_0x2325('0x3'));var fs=require('fs');var path=require(_0x2325('0x4'));var rimraf=require('rimraf');var config=require(_0x2325('0x5'));var attributes=require(_0x2325('0x6'));var integrations=require('../../components/integrations/configuration');module[_0x2325('0x7')]=function(_0x20bd5b,_0x3ac4d1){return _0x20bd5b[_0x2325('0x8')](_0x2325('0x9'),attributes,{'tableName':_0x2325('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcb6e=['moment','rimraf','./intFreshdeskAccount.attributes','../../components/integrations/configuration','int_freshdesk_accounts','lodash','util','../../config/logger','api'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xcb6e,0x15b));var _0xecb6=function(_0x222994,_0x485b4f){_0x222994=_0x222994-0x0;var _0x5a65a3=_0xcb6e[_0x222994];return _0x5a65a3;};'use strict';var _=require(_0xecb6('0x0'));var util=require(_0xecb6('0x1'));var logger=require(_0xecb6('0x2'))(_0xecb6('0x3'));var moment=require(_0xecb6('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xecb6('0x5'));var config=require('../../config/environment');var attributes=require(_0xecb6('0x6'));var integrations=require(_0xecb6('0x7'));module['exports']=function(_0x503a7d,_0x544dd8){return _0x503a7d['define']('FreshdeskAccount',attributes,{'tableName':_0xecb6('0x8'),'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 556c54a..9edc798 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 _0xe0e8=['attributes','limit','include','map','model','stringify','ShowFreshdeskAccount','where','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','error','message','catch','GetFreshdeskAccount','findAll','options','raw'];(function(_0x562f3b,_0x4c65ae){var _0x1edd55=function(_0xe67e06){while(--_0xe67e06){_0x562f3b['push'](_0x562f3b['shift']());}};_0x1edd55(++_0x4c65ae);}(_0xe0e8,0x1c8));var _0x8e0e=function(_0x5292fc,_0x1bd395){_0x5292fc=_0x5292fc-0x0;var _0x1c48ad=_0xe0e8[_0x5292fc];return _0x1c48ad;};'use strict';var _=require(_0x8e0e('0x0'));var util=require('util');var moment=require(_0x8e0e('0x1'));var BPromise=require(_0x8e0e('0x2'));var rs=require(_0x8e0e('0x3'));var fs=require('fs');var Redis=require(_0x8e0e('0x4'));var db=require(_0x8e0e('0x5'))['db'];var utils=require(_0x8e0e('0x6'));var logger=require('../../config/logger')(_0x8e0e('0x7'));var config=require(_0x8e0e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8e0e('0x9')][_0x8e0e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7b4c8c,_0x36a988,_0x442342){return new BPromise(function(_0x7b66f5,_0x845b4d){return client['request'](_0x7b4c8c,_0x442342)[_0x8e0e('0xb')](function(_0x1ce843){logger[_0x8e0e('0xc')](_0x8e0e('0xd'),_0x36a988,_0x8e0e('0xe'));logger[_0x8e0e('0xf')](_0x8e0e('0x10'),_0x36a988,_0x8e0e('0xe'),JSON['stringify'](_0x1ce843));if(_0x1ce843['error']){if(_0x1ce843[_0x8e0e('0x11')]['code']===0x1f4){logger[_0x8e0e('0x11')](_0x8e0e('0xd'),_0x36a988,_0x1ce843[_0x8e0e('0x11')][_0x8e0e('0x12')]);return _0x845b4d(_0x1ce843['error'][_0x8e0e('0x12')]);}logger[_0x8e0e('0x11')](_0x8e0e('0xd'),_0x36a988,_0x1ce843['error']['message']);return _0x7b66f5(_0x1ce843[_0x8e0e('0x11')]['message']);}else{logger['info']('FreshdeskAccount,\x20%s,\x20%s',_0x36a988,'request\x20sent');_0x7b66f5(_0x1ce843['result']['message']);}})[_0x8e0e('0x13')](function(_0x331c07){logger[_0x8e0e('0x11')]('FreshdeskAccount,\x20%s,\x20%s',_0x36a988,_0x331c07);_0x845b4d(_0x331c07);});});}exports[_0x8e0e('0x14')]=function(_0x557b86){var _0x575752=this;return new Promise(function(_0x5a70ea,_0x55b02b){return db['FreshdeskAccount'][_0x8e0e('0x15')]({'raw':_0x557b86[_0x8e0e('0x16')]?_0x557b86[_0x8e0e('0x16')][_0x8e0e('0x17')]===undefined?!![]:![]:!![],'where':_0x557b86[_0x8e0e('0x16')]?_0x557b86[_0x8e0e('0x16')]['where']||null:null,'attributes':_0x557b86[_0x8e0e('0x16')]?_0x557b86['options'][_0x8e0e('0x18')]||null:null,'limit':_0x557b86['options']?_0x557b86[_0x8e0e('0x16')][_0x8e0e('0x19')]||null:null,'include':_0x557b86['options']?_0x557b86[_0x8e0e('0x16')][_0x8e0e('0x1a')]?_[_0x8e0e('0x1b')](_0x557b86['options']['include'],function(_0x266f35){return{'model':db[_0x266f35[_0x8e0e('0x1c')]],'as':_0x266f35['as'],'attributes':_0x266f35[_0x8e0e('0x18')],'include':_0x266f35[_0x8e0e('0x1a')]?_[_0x8e0e('0x1b')](_0x266f35['include'],function(_0x4d1309){return{'model':db[_0x4d1309[_0x8e0e('0x1c')]],'as':_0x4d1309['as'],'attributes':_0x4d1309[_0x8e0e('0x18')],'include':_0x4d1309['include']?_[_0x8e0e('0x1b')](_0x4d1309['include'],function(_0x1fa12a){return{'model':db[_0x1fa12a[_0x8e0e('0x1c')]],'as':_0x1fa12a['as'],'attributes':_0x1fa12a[_0x8e0e('0x18')]};}):[]};}):[]};}):[]:[]})[_0x8e0e('0xb')](function(_0x2ccc77){logger['info'](_0x8e0e('0x14'),_0x557b86);logger['debug'](_0x8e0e('0x14'),_0x557b86,JSON[_0x8e0e('0x1d')](_0x2ccc77));_0x5a70ea(_0x2ccc77);})[_0x8e0e('0x13')](function(_0x385569){logger['error'](_0x8e0e('0x14'),_0x385569[_0x8e0e('0x12')],_0x557b86);_0x55b02b(_0x575752[_0x8e0e('0x11')](0x1f4,_0x385569[_0x8e0e('0x12')]));});});};exports[_0x8e0e('0x1e')]=function(_0x19eaf6){var _0x2806cb=this;return new Promise(function(_0x1b853f,_0x37b152){return db['FreshdeskAccount']['find']({'raw':_0x19eaf6[_0x8e0e('0x16')]?_0x19eaf6[_0x8e0e('0x16')][_0x8e0e('0x17')]===undefined?!![]:![]:!![],'where':_0x19eaf6[_0x8e0e('0x16')]?_0x19eaf6[_0x8e0e('0x16')][_0x8e0e('0x1f')]||null:null,'attributes':_0x19eaf6['options']?_0x19eaf6[_0x8e0e('0x16')][_0x8e0e('0x18')]||null:null,'include':_0x19eaf6['options']?_0x19eaf6[_0x8e0e('0x16')]['include']?_['map'](_0x19eaf6[_0x8e0e('0x16')][_0x8e0e('0x1a')],function(_0x24b05c){return{'model':db[_0x24b05c['model']],'as':_0x24b05c['as'],'attributes':_0x24b05c[_0x8e0e('0x18')],'include':_0x24b05c[_0x8e0e('0x1a')]?_['map'](_0x24b05c[_0x8e0e('0x1a')],function(_0x59364f){return{'model':db[_0x59364f[_0x8e0e('0x1c')]],'as':_0x59364f['as'],'attributes':_0x59364f['attributes'],'include':_0x59364f[_0x8e0e('0x1a')]?_[_0x8e0e('0x1b')](_0x59364f[_0x8e0e('0x1a')],function(_0x127986){return{'model':db[_0x127986[_0x8e0e('0x1c')]],'as':_0x127986['as'],'attributes':_0x127986[_0x8e0e('0x18')]};}):[]};}):[]};}):[]:[]})[_0x8e0e('0xb')](function(_0x2191ff){logger[_0x8e0e('0xc')]('ShowFreshdeskAccount',_0x19eaf6);logger['debug']('ShowFreshdeskAccount',_0x19eaf6,JSON['stringify'](_0x2191ff));_0x1b853f(_0x2191ff);})[_0x8e0e('0x13')](function(_0xacd722){logger[_0x8e0e('0x11')](_0x8e0e('0x1e'),_0xacd722['message'],_0x19eaf6);_0x37b152(_0x2806cb[_0x8e0e('0x11')](0x1f4,_0xacd722[_0x8e0e('0x12')]));});});}; \ No newline at end of file +var _0xc5c7=['FreshdeskAccount,\x20%s,\x20%s','request\x20sent','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','FreshdeskAccount','options','raw','where','attributes','limit','map','model','include','GetFreshdeskAccount','debug','ShowFreshdeskAccount','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc5c7,0x1cf));var _0x7c5c=function(_0x470d05,_0x2046e7){_0x470d05=_0x470d05-0x0;var _0xb1d12d=_0xc5c7[_0x470d05];return _0xb1d12d;};'use strict';var _=require('lodash');var util=require(_0x7c5c('0x0'));var moment=require(_0x7c5c('0x1'));var BPromise=require(_0x7c5c('0x2'));var rs=require(_0x7c5c('0x3'));var fs=require('fs');var Redis=require(_0x7c5c('0x4'));var db=require(_0x7c5c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7c5c('0x6'))(_0x7c5c('0x7'));var config=require(_0x7c5c('0x8'));var jayson=require(_0x7c5c('0x9'));var client=jayson[_0x7c5c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5ec99e,_0xdbfbeb,_0x5895b5){return new BPromise(function(_0x402b70,_0x5bc01c){return client[_0x7c5c('0xb')](_0x5ec99e,_0x5895b5)[_0x7c5c('0xc')](function(_0x5f4265){logger['info'](_0x7c5c('0xd'),_0xdbfbeb,_0x7c5c('0xe'));logger['debug'](_0x7c5c('0xf'),_0xdbfbeb,'request\x20sent',JSON[_0x7c5c('0x10')](_0x5f4265));if(_0x5f4265['error']){if(_0x5f4265[_0x7c5c('0x11')][_0x7c5c('0x12')]===0x1f4){logger['error'](_0x7c5c('0xd'),_0xdbfbeb,_0x5f4265[_0x7c5c('0x11')][_0x7c5c('0x13')]);return _0x5bc01c(_0x5f4265[_0x7c5c('0x11')][_0x7c5c('0x13')]);}logger[_0x7c5c('0x11')](_0x7c5c('0xd'),_0xdbfbeb,_0x5f4265[_0x7c5c('0x11')][_0x7c5c('0x13')]);return _0x402b70(_0x5f4265[_0x7c5c('0x11')][_0x7c5c('0x13')]);}else{logger[_0x7c5c('0x14')](_0x7c5c('0xd'),_0xdbfbeb,_0x7c5c('0xe'));_0x402b70(_0x5f4265['result']['message']);}})[_0x7c5c('0x15')](function(_0x12e92a){logger[_0x7c5c('0x11')](_0x7c5c('0xd'),_0xdbfbeb,_0x12e92a);_0x5bc01c(_0x12e92a);});});}exports['GetFreshdeskAccount']=function(_0x41bbee){var _0x7df960=this;return new Promise(function(_0x3f9704,_0x2792f4){return db[_0x7c5c('0x16')]['findAll']({'raw':_0x41bbee['options']?_0x41bbee[_0x7c5c('0x17')][_0x7c5c('0x18')]===undefined?!![]:![]:!![],'where':_0x41bbee[_0x7c5c('0x17')]?_0x41bbee['options'][_0x7c5c('0x19')]||null:null,'attributes':_0x41bbee[_0x7c5c('0x17')]?_0x41bbee[_0x7c5c('0x17')][_0x7c5c('0x1a')]||null:null,'limit':_0x41bbee[_0x7c5c('0x17')]?_0x41bbee['options'][_0x7c5c('0x1b')]||null:null,'include':_0x41bbee[_0x7c5c('0x17')]?_0x41bbee[_0x7c5c('0x17')]['include']?_[_0x7c5c('0x1c')](_0x41bbee[_0x7c5c('0x17')]['include'],function(_0xccd178){return{'model':db[_0xccd178[_0x7c5c('0x1d')]],'as':_0xccd178['as'],'attributes':_0xccd178[_0x7c5c('0x1a')],'include':_0xccd178[_0x7c5c('0x1e')]?_[_0x7c5c('0x1c')](_0xccd178[_0x7c5c('0x1e')],function(_0x348da0){return{'model':db[_0x348da0[_0x7c5c('0x1d')]],'as':_0x348da0['as'],'attributes':_0x348da0[_0x7c5c('0x1a')],'include':_0x348da0[_0x7c5c('0x1e')]?_[_0x7c5c('0x1c')](_0x348da0['include'],function(_0x43d38b){return{'model':db[_0x43d38b['model']],'as':_0x43d38b['as'],'attributes':_0x43d38b['attributes']};}):[]};}):[]};}):[]:[]})[_0x7c5c('0xc')](function(_0x5315b0){logger[_0x7c5c('0x14')](_0x7c5c('0x1f'),_0x41bbee);logger[_0x7c5c('0x20')](_0x7c5c('0x1f'),_0x41bbee,JSON['stringify'](_0x5315b0));_0x3f9704(_0x5315b0);})['catch'](function(_0x447e0d){logger[_0x7c5c('0x11')](_0x7c5c('0x1f'),_0x447e0d[_0x7c5c('0x13')],_0x41bbee);_0x2792f4(_0x7df960['error'](0x1f4,_0x447e0d[_0x7c5c('0x13')]));});});};exports[_0x7c5c('0x21')]=function(_0x4de2d2){var _0x36bf25=this;return new Promise(function(_0x3bc897,_0x3e4fe1){return db[_0x7c5c('0x16')]['find']({'raw':_0x4de2d2[_0x7c5c('0x17')]?_0x4de2d2[_0x7c5c('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x4de2d2[_0x7c5c('0x17')]?_0x4de2d2[_0x7c5c('0x17')][_0x7c5c('0x19')]||null:null,'attributes':_0x4de2d2[_0x7c5c('0x17')]?_0x4de2d2['options'][_0x7c5c('0x1a')]||null:null,'include':_0x4de2d2['options']?_0x4de2d2[_0x7c5c('0x17')][_0x7c5c('0x1e')]?_['map'](_0x4de2d2[_0x7c5c('0x17')][_0x7c5c('0x1e')],function(_0x2994d8){return{'model':db[_0x2994d8['model']],'as':_0x2994d8['as'],'attributes':_0x2994d8['attributes'],'include':_0x2994d8[_0x7c5c('0x1e')]?_[_0x7c5c('0x1c')](_0x2994d8['include'],function(_0x5529c9){return{'model':db[_0x5529c9[_0x7c5c('0x1d')]],'as':_0x5529c9['as'],'attributes':_0x5529c9['attributes'],'include':_0x5529c9[_0x7c5c('0x1e')]?_[_0x7c5c('0x1c')](_0x5529c9[_0x7c5c('0x1e')],function(_0x3079c5){return{'model':db[_0x3079c5[_0x7c5c('0x1d')]],'as':_0x3079c5['as'],'attributes':_0x3079c5[_0x7c5c('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x27bc9b){logger['info'](_0x7c5c('0x21'),_0x4de2d2);logger[_0x7c5c('0x20')](_0x7c5c('0x21'),_0x4de2d2,JSON['stringify'](_0x27bc9b));_0x3bc897(_0x27bc9b);})[_0x7c5c('0x15')](function(_0x268bdf){logger[_0x7c5c('0x11')](_0x7c5c('0x21'),_0x268bdf[_0x7c5c('0x13')],_0x4de2d2);_0x3e4fe1(_0x36bf25[_0x7c5c('0x11')](0x1f4,_0x268bdf[_0x7c5c('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 7bcbe32..9bb2518 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 _0xdc97=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','getSubjects','/:id/descriptions','/:id/tags','getTags','post','create','setTags','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x285118,_0x36caee){var _0x5a1b03=function(_0xb61a9e){while(--_0xb61a9e){_0x285118['push'](_0x285118['shift']());}};_0x5a1b03(++_0x36caee);}(_0xdc97,0x126));var _0x7dc9=function(_0x170d43,_0xffdb44){_0x170d43=_0x170d43-0x0;var _0x4024fa=_0xdc97[_0x170d43];return _0x4024fa;};'use strict';var multer=require(_0x7dc9('0x0'));var util=require('util');var path=require(_0x7dc9('0x1'));var timeout=require(_0x7dc9('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x7dc9('0x3'));var auth=require(_0x7dc9('0x4'));var interaction=require(_0x7dc9('0x5'));var config=require(_0x7dc9('0x6'));var controller=require(_0x7dc9('0x7'));router[_0x7dc9('0x8')]('/',auth[_0x7dc9('0x9')](),controller[_0x7dc9('0xa')]);router['get']('/:id',auth[_0x7dc9('0x9')](),controller[_0x7dc9('0xb')]);router['get'](_0x7dc9('0xc'),auth[_0x7dc9('0x9')](),controller[_0x7dc9('0xd')]);router[_0x7dc9('0x8')]('/:id/subjects',auth[_0x7dc9('0x9')](),controller[_0x7dc9('0xe')]);router[_0x7dc9('0x8')](_0x7dc9('0xf'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x7dc9('0x8')](_0x7dc9('0x10'),auth[_0x7dc9('0x9')](),controller[_0x7dc9('0x11')]);router[_0x7dc9('0x12')]('/',auth[_0x7dc9('0x9')](),controller[_0x7dc9('0x13')]);router['post']('/:id/tags',auth[_0x7dc9('0x9')](),controller[_0x7dc9('0x14')]);router[_0x7dc9('0x15')](_0x7dc9('0x16'),auth['isAuthenticated'](),controller[_0x7dc9('0x17')]);router[_0x7dc9('0x18')](_0x7dc9('0x16'),auth[_0x7dc9('0x9')](),controller[_0x7dc9('0x19')]);module[_0x7dc9('0x1a')]=router; \ No newline at end of file +var _0x4403=['./intFreshdeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags','put','/:id','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x5337a1,_0x3bb74b){var _0x27bce4=function(_0x1d5f6d){while(--_0x1d5f6d){_0x5337a1['push'](_0x5337a1['shift']());}};_0x27bce4(++_0x3bb74b);}(_0x4403,0x10c));var _0x3440=function(_0x23b0aa,_0x5967c1){_0x23b0aa=_0x23b0aa-0x0;var _0x299166=_0x4403[_0x23b0aa];return _0x299166;};'use strict';var multer=require('multer');var util=require(_0x3440('0x0'));var path=require(_0x3440('0x1'));var timeout=require(_0x3440('0x2'));var express=require(_0x3440('0x3'));var router=express[_0x3440('0x4')]();var fs_extra=require(_0x3440('0x5'));var auth=require(_0x3440('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3440('0x7'));var controller=require(_0x3440('0x8'));router[_0x3440('0x9')]('/',auth[_0x3440('0xa')](),controller[_0x3440('0xb')]);router[_0x3440('0x9')]('/:id',auth[_0x3440('0xa')](),controller[_0x3440('0xc')]);router[_0x3440('0x9')](_0x3440('0xd'),auth[_0x3440('0xa')](),controller['getFields']);router[_0x3440('0x9')](_0x3440('0xe'),auth[_0x3440('0xa')](),controller['getSubjects']);router[_0x3440('0x9')](_0x3440('0xf'),auth[_0x3440('0xa')](),controller[_0x3440('0x10')]);router[_0x3440('0x9')](_0x3440('0x11'),auth[_0x3440('0xa')](),controller[_0x3440('0x12')]);router[_0x3440('0x13')]('/',auth[_0x3440('0xa')](),controller['create']);router[_0x3440('0x13')](_0x3440('0x11'),auth[_0x3440('0xa')](),controller[_0x3440('0x14')]);router[_0x3440('0x15')](_0x3440('0x16'),auth[_0x3440('0xa')](),controller['update']);router['delete'](_0x3440('0x16'),auth['isAuthenticated'](),controller['destroy']);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 44dc92d..a95904f 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 _0x32eb=['sequelize'];(function(_0x4c85b5,_0x16d28a){var _0x4bb9ac=function(_0x1a51b6){while(--_0x1a51b6){_0x4c85b5['push'](_0x4c85b5['shift']());}};_0x4bb9ac(++_0x16d28a);}(_0x32eb,0xe0));var _0xb32e=function(_0xd0cd0b,_0x490956){_0xd0cd0b=_0xd0cd0b-0x0;var _0x59cced=_0x32eb[_0xd0cd0b];return _0x59cced;};'use strict';var Sequelize=require(_0xb32e('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0269=['STRING','sequelize'];(function(_0x4758d2,_0x43cb31){var _0x2b689d=function(_0x27581f){while(--_0x27581f){_0x4758d2['push'](_0x4758d2['shift']());}};_0x2b689d(++_0x43cb31);}(_0x0269,0x1a9));var _0x9026=function(_0xc4f0db,_0x2f6f05){_0xc4f0db=_0xc4f0db-0x0;var _0x56d4b2=_0x0269[_0xc4f0db];return _0x56d4b2;};'use strict';var Sequelize=require(_0x9026('0x0'));module['exports']={'name':{'type':Sequelize[_0x9026('0x1')]},'description':{'type':Sequelize[_0x9026('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 6881693..d65df1e 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 _0xbf32=['path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','reject','save','update','destroy','error','stack','name','send','map','FreshdeskConfiguration','rawAttributes','fieldName','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','type','VIRTUAL','options','then','include','findAll','rows','params','includeAll','catch','create','body','find','getFields','findOne','FreshdeskField','order','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache'];(function(_0xc88f11,_0x50820c){var _0x2b639e=function(_0x56463e){while(--_0x56463e){_0xc88f11['push'](_0xc88f11['shift']());}};_0x2b639e(++_0x50820c);}(_0xbf32,0x1f1));var _0x2bf3=function(_0x2052ee,_0x4dabe9){_0x2052ee=_0x2052ee-0x0;var _0x2a4b95=_0xbf32[_0x2052ee];return _0x2a4b95;};'use strict';var emlformat=require(_0x2bf3('0x0'));var rimraf=require(_0x2bf3('0x1'));var zipdir=require(_0x2bf3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2bf3('0x3'));var moment=require(_0x2bf3('0x4'));var BPromise=require(_0x2bf3('0x5'));var Mustache=require(_0x2bf3('0x6'));var util=require('util');var path=require(_0x2bf3('0x7'));var sox=require(_0x2bf3('0x8'));var csv=require(_0x2bf3('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2bf3('0xa'));var _=require(_0x2bf3('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2bf3('0xc'));var deskjs=require(_0x2bf3('0xd'));var toCsv=require(_0x2bf3('0x9'));var querystring=require(_0x2bf3('0xe'));var Papa=require('papaparse');var Redis=require(_0x2bf3('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x2bf3('0x10'));var as=require(_0x2bf3('0x11'));var hardwareService=require(_0x2bf3('0x12'));var logger=require('../../config/logger')(_0x2bf3('0x13'));var utils=require(_0x2bf3('0x14'));var config=require(_0x2bf3('0x15'));var licenseUtil=require(_0x2bf3('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4cd629,_0x24450e){_0x24450e=_0x24450e||0xcc;return function(_0x34af4a){if(_0x34af4a){return _0x4cd629[_0x2bf3('0x17')](_0x24450e);}return _0x4cd629[_0x2bf3('0x18')](_0x24450e)[_0x2bf3('0x19')]();};}function respondWithResult(_0x21684c,_0x56869d){_0x56869d=_0x56869d||0xc8;return function(_0x48faf3){if(_0x48faf3){return _0x21684c[_0x2bf3('0x18')](_0x56869d)[_0x2bf3('0x1a')](_0x48faf3);}};}function respondWithFilteredResult(_0x50c4d1,_0x13fe9b){return function(_0x21e4d0){if(_0x21e4d0){var _0x326b76=typeof _0x13fe9b[_0x2bf3('0x1b')]===_0x2bf3('0x1c')&&typeof _0x13fe9b['limit']===_0x2bf3('0x1c');var _0x4bb341=_0x21e4d0[_0x2bf3('0x1d')];var _0xfc532a=_0x326b76?0x0:_0x13fe9b[_0x2bf3('0x1b')];var _0xee4961=_0x326b76?_0x21e4d0['count']:_0x13fe9b[_0x2bf3('0x1b')]+_0x13fe9b['limit'];var _0x3b56e9;if(_0xee4961>=_0x4bb341){_0xee4961=_0x4bb341;_0x3b56e9=0xc8;}else{_0x3b56e9=0xce;}_0x50c4d1[_0x2bf3('0x18')](_0x3b56e9);return _0x50c4d1[_0x2bf3('0x1e')](_0x2bf3('0x1f'),_0xfc532a+'-'+_0xee4961+'/'+_0x4bb341)[_0x2bf3('0x1a')](_0x21e4d0);}return null;};}function patchUpdates(_0x272376){return function(_0x4e172c){try{jsonpatch['apply'](_0x4e172c,_0x272376,!![]);}catch(_0x255bd3){return BPromise[_0x2bf3('0x20')](_0x255bd3);}return _0x4e172c[_0x2bf3('0x21')]();};}function saveUpdates(_0x4b6935,_0x210f62){return function(_0x44d7aa){if(_0x44d7aa){return _0x44d7aa[_0x2bf3('0x22')](_0x4b6935)['then'](function(_0x4774b3){return _0x4774b3;});}return null;};}function removeEntity(_0x318b1c,_0x3c444d){return function(_0x324aaf){if(_0x324aaf){return _0x324aaf[_0x2bf3('0x23')]()['then'](function(){_0x318b1c[_0x2bf3('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e0417,_0x2e3e75){return function(_0x480739){if(!_0x480739){_0x5e0417[_0x2bf3('0x17')](0x194);}return _0x480739;};}function handleError(_0x2e314e,_0x4e5589){_0x4e5589=_0x4e5589||0x1f4;return function(_0x43e614){logger[_0x2bf3('0x24')](_0x43e614[_0x2bf3('0x25')]);if(_0x43e614[_0x2bf3('0x26')]){delete _0x43e614[_0x2bf3('0x26')];}_0x2e314e[_0x2bf3('0x18')](_0x4e5589)[_0x2bf3('0x27')](_0x43e614);};}exports['index']=function(_0x9b14d7,_0xf2ba08){var _0x29d74f={},_0x5b6c03={},_0x4d2fe2={'count':0x0,'rows':[]};var _0x7afb10=_[_0x2bf3('0x28')](db[_0x2bf3('0x29')][_0x2bf3('0x2a')],function(_0x421bd7){return{'name':_0x421bd7[_0x2bf3('0x2b')],'type':_0x421bd7['type'][_0x2bf3('0x2c')]};});_0x5b6c03[_0x2bf3('0x2d')]=_['map'](_0x7afb10,'name');_0x5b6c03['query']=_[_0x2bf3('0x2e')](_0x9b14d7['query']);_0x5b6c03[_0x2bf3('0x2f')]=_[_0x2bf3('0x30')](_0x5b6c03[_0x2bf3('0x2d')],_0x5b6c03[_0x2bf3('0x31')]);_0x29d74f[_0x2bf3('0x32')]=_['intersection'](_0x5b6c03[_0x2bf3('0x2d')],qs[_0x2bf3('0x33')](_0x9b14d7[_0x2bf3('0x31')][_0x2bf3('0x33')]));_0x29d74f[_0x2bf3('0x32')]=_0x29d74f[_0x2bf3('0x32')][_0x2bf3('0x34')]?_0x29d74f[_0x2bf3('0x32')]:_0x5b6c03[_0x2bf3('0x2d')];if(!_0x9b14d7[_0x2bf3('0x31')][_0x2bf3('0x35')](_0x2bf3('0x36'))){_0x29d74f['limit']=qs[_0x2bf3('0x37')](_0x9b14d7[_0x2bf3('0x31')][_0x2bf3('0x37')]);_0x29d74f[_0x2bf3('0x1b')]=qs['offset'](_0x9b14d7[_0x2bf3('0x31')][_0x2bf3('0x1b')]);}_0x29d74f['order']=qs['sort'](_0x9b14d7['query'][_0x2bf3('0x38')]);_0x29d74f[_0x2bf3('0x39')]=qs[_0x2bf3('0x2f')](_[_0x2bf3('0x3a')](_0x9b14d7[_0x2bf3('0x31')],_0x5b6c03['filters']),_0x7afb10);if(_0x9b14d7[_0x2bf3('0x31')][_0x2bf3('0x3b')]){_0x29d74f[_0x2bf3('0x39')]=_[_0x2bf3('0x3c')](_0x29d74f['where'],{'$or':_[_0x2bf3('0x28')](_0x7afb10,function(_0x34fe8a){if(_0x34fe8a[_0x2bf3('0x3d')]!==_0x2bf3('0x3e')){var _0x158c38={};_0x158c38[_0x34fe8a['name']]={'$like':'%'+_0x9b14d7[_0x2bf3('0x31')][_0x2bf3('0x3b')]+'%'};return _0x158c38;}})});}_0x29d74f=_[_0x2bf3('0x3c')]({},_0x29d74f,_0x9b14d7[_0x2bf3('0x3f')]);var _0x468763={'where':_0x29d74f[_0x2bf3('0x39')]};return db['FreshdeskConfiguration'][_0x2bf3('0x1d')](_0x468763)[_0x2bf3('0x40')](function(_0x3b1ee4){_0x4d2fe2[_0x2bf3('0x1d')]=_0x3b1ee4;if(_0x9b14d7[_0x2bf3('0x31')]['includeAll']){_0x29d74f[_0x2bf3('0x41')]=[{'all':!![]}];}return db[_0x2bf3('0x29')][_0x2bf3('0x42')](_0x29d74f);})['then'](function(_0x4518b5){_0x4d2fe2[_0x2bf3('0x43')]=_0x4518b5;return _0x4d2fe2;})[_0x2bf3('0x40')](respondWithFilteredResult(_0xf2ba08,_0x29d74f))['catch'](handleError(_0xf2ba08,null));};exports['show']=function(_0x2879c9,_0x15462e){var _0x4b9785={'raw':![],'where':{'id':_0x2879c9[_0x2bf3('0x44')]['id']}},_0x2d4c35={};_0x2d4c35[_0x2bf3('0x2d')]=_[_0x2bf3('0x2e')](db[_0x2bf3('0x29')][_0x2bf3('0x2a')]);_0x2d4c35['query']=_[_0x2bf3('0x2e')](_0x2879c9['query']);_0x2d4c35['filters']=_['intersection'](_0x2d4c35[_0x2bf3('0x2d')],_0x2d4c35[_0x2bf3('0x31')]);_0x4b9785[_0x2bf3('0x32')]=_['intersection'](_0x2d4c35[_0x2bf3('0x2d')],qs['fields'](_0x2879c9['query'][_0x2bf3('0x33')]));_0x4b9785[_0x2bf3('0x32')]=_0x4b9785[_0x2bf3('0x32')]['length']?_0x4b9785['attributes']:_0x2d4c35[_0x2bf3('0x2d')];if(_0x2879c9[_0x2bf3('0x31')][_0x2bf3('0x45')]){_0x4b9785['include']=[{'all':!![]}];}_0x4b9785=_['merge']({},_0x4b9785,_0x2879c9[_0x2bf3('0x3f')]);return db[_0x2bf3('0x29')]['find'](_0x4b9785)['then'](handleEntityNotFound(_0x15462e,null))[_0x2bf3('0x40')](respondWithResult(_0x15462e,null))[_0x2bf3('0x46')](handleError(_0x15462e,null));};exports['create']=function(_0x101216,_0x165b18){return db[_0x2bf3('0x29')][_0x2bf3('0x47')](_0x101216[_0x2bf3('0x48')],{})[_0x2bf3('0x40')](respondWithResult(_0x165b18,0xc9))[_0x2bf3('0x46')](handleError(_0x165b18,null));};exports[_0x2bf3('0x22')]=function(_0x95d79b,_0x4d363a){if(_0x95d79b[_0x2bf3('0x48')]['id']){delete _0x95d79b['body']['id'];}return db[_0x2bf3('0x29')]['find']({'where':{'id':_0x95d79b['params']['id']}})[_0x2bf3('0x40')](handleEntityNotFound(_0x4d363a,null))[_0x2bf3('0x40')](saveUpdates(_0x95d79b[_0x2bf3('0x48')],null))[_0x2bf3('0x40')](respondWithResult(_0x4d363a,null))[_0x2bf3('0x46')](handleError(_0x4d363a,null));};exports['destroy']=function(_0xec2a94,_0x139821){return db['FreshdeskConfiguration'][_0x2bf3('0x49')]({'where':{'id':_0xec2a94['params']['id']}})[_0x2bf3('0x40')](handleEntityNotFound(_0x139821,null))[_0x2bf3('0x40')](removeEntity(_0x139821,null))[_0x2bf3('0x46')](handleError(_0x139821,null));};exports[_0x2bf3('0x4a')]=function(_0x1b8d3c,_0x285b98,_0x21605c){var _0xe866ad={};var _0x3213ca={};var _0x11fe62;var _0x5b0fb1;return db[_0x2bf3('0x29')][_0x2bf3('0x4b')]({'where':{'id':_0x1b8d3c[_0x2bf3('0x44')]['id']}})[_0x2bf3('0x40')](handleEntityNotFound(_0x285b98,null))['then'](function(_0x3e87c0){if(_0x3e87c0){_0x11fe62=_0x3e87c0;_0x3213ca['model']=_[_0x2bf3('0x2e')](db[_0x2bf3('0x4c')]['rawAttributes']);_0x3213ca['query']=_['keys'](_0x1b8d3c[_0x2bf3('0x31')]);_0x3213ca['filters']=_[_0x2bf3('0x30')](_0x3213ca[_0x2bf3('0x2d')],_0x3213ca[_0x2bf3('0x31')]);_0xe866ad[_0x2bf3('0x32')]=_[_0x2bf3('0x30')](_0x3213ca['model'],qs[_0x2bf3('0x33')](_0x1b8d3c['query']['fields']));_0xe866ad[_0x2bf3('0x32')]=_0xe866ad[_0x2bf3('0x32')][_0x2bf3('0x34')]?_0xe866ad['attributes']:_0x3213ca['model'];_0xe866ad[_0x2bf3('0x4d')]=qs[_0x2bf3('0x38')](_0x1b8d3c[_0x2bf3('0x31')][_0x2bf3('0x38')]);_0xe866ad['where']=qs[_0x2bf3('0x2f')](_[_0x2bf3('0x3a')](_0x1b8d3c[_0x2bf3('0x31')],_0x3213ca[_0x2bf3('0x2f')]));if(_0x1b8d3c['query'][_0x2bf3('0x3b')]){_0xe866ad[_0x2bf3('0x39')]=_['merge'](_0xe866ad['where'],{'$or':_['map'](_0xe866ad[_0x2bf3('0x32')],function(_0x25b23e){var _0x13ffe4={};_0x13ffe4[_0x25b23e]={'$like':'%'+_0x1b8d3c['query'][_0x2bf3('0x3b')]+'%'};return _0x13ffe4;})});}_0xe866ad=_[_0x2bf3('0x3c')]({},_0xe866ad,_0x1b8d3c[_0x2bf3('0x3f')]);return _0x11fe62[_0x2bf3('0x4a')](_0xe866ad);}})[_0x2bf3('0x40')](function(_0x30edce){if(_0x30edce){_0x5b0fb1=_0x30edce['length'];if(!_0x1b8d3c['query'][_0x2bf3('0x35')](_0x2bf3('0x36'))){_0xe866ad[_0x2bf3('0x37')]=qs['limit'](_0x1b8d3c[_0x2bf3('0x31')]['limit']);_0xe866ad[_0x2bf3('0x1b')]=qs[_0x2bf3('0x1b')](_0x1b8d3c[_0x2bf3('0x31')]['offset']);}return _0x11fe62[_0x2bf3('0x4a')](_0xe866ad);}})[_0x2bf3('0x40')](function(_0x27554b){if(_0x27554b){return _0x27554b?{'count':_0x5b0fb1,'rows':_0x27554b}:null;}})[_0x2bf3('0x40')](respondWithResult(_0x285b98,null))['catch'](handleError(_0x285b98,null));};exports[_0x2bf3('0x4e')]=function(_0x31eddd,_0x3a28fb,_0x285458){var _0x64091d={};var _0x16a55e={};var _0x163f4c;var _0x20bd55;return db['FreshdeskConfiguration'][_0x2bf3('0x4b')]({'where':{'id':_0x31eddd['params']['id']}})[_0x2bf3('0x40')](handleEntityNotFound(_0x3a28fb,null))[_0x2bf3('0x40')](function(_0x3e12b0){if(_0x3e12b0){_0x163f4c=_0x3e12b0;_0x16a55e[_0x2bf3('0x2d')]=_[_0x2bf3('0x2e')](db[_0x2bf3('0x4c')][_0x2bf3('0x2a')]);_0x16a55e[_0x2bf3('0x31')]=_[_0x2bf3('0x2e')](_0x31eddd[_0x2bf3('0x31')]);_0x16a55e['filters']=_[_0x2bf3('0x30')](_0x16a55e[_0x2bf3('0x2d')],_0x16a55e[_0x2bf3('0x31')]);_0x64091d['attributes']=_[_0x2bf3('0x30')](_0x16a55e['model'],qs['fields'](_0x31eddd[_0x2bf3('0x31')][_0x2bf3('0x33')]));_0x64091d[_0x2bf3('0x32')]=_0x64091d['attributes']['length']?_0x64091d[_0x2bf3('0x32')]:_0x16a55e['model'];_0x64091d[_0x2bf3('0x4d')]=qs['sort'](_0x31eddd[_0x2bf3('0x31')][_0x2bf3('0x38')]);_0x64091d[_0x2bf3('0x39')]=qs[_0x2bf3('0x2f')](_[_0x2bf3('0x3a')](_0x31eddd['query'],_0x16a55e[_0x2bf3('0x2f')]));if(_0x31eddd[_0x2bf3('0x31')][_0x2bf3('0x3b')]){_0x64091d['where']=_['merge'](_0x64091d[_0x2bf3('0x39')],{'$or':_['map'](_0x64091d[_0x2bf3('0x32')],function(_0x287fe3){var _0x46ff64={};_0x46ff64[_0x287fe3]={'$like':'%'+_0x31eddd[_0x2bf3('0x31')][_0x2bf3('0x3b')]+'%'};return _0x46ff64;})});}_0x64091d=_[_0x2bf3('0x3c')]({},_0x64091d,_0x31eddd['options']);return _0x163f4c[_0x2bf3('0x4e')](_0x64091d);}})['then'](function(_0x1792d5){if(_0x1792d5){_0x20bd55=_0x1792d5[_0x2bf3('0x34')];if(!_0x31eddd[_0x2bf3('0x31')]['hasOwnProperty']('nolimit')){_0x64091d[_0x2bf3('0x37')]=qs[_0x2bf3('0x37')](_0x31eddd['query']['limit']);_0x64091d['offset']=qs[_0x2bf3('0x1b')](_0x31eddd[_0x2bf3('0x31')][_0x2bf3('0x1b')]);}return _0x163f4c['getSubjects'](_0x64091d);}})['then'](function(_0x48deac){if(_0x48deac){return _0x48deac?{'count':_0x20bd55,'rows':_0x48deac}:null;}})[_0x2bf3('0x40')](respondWithResult(_0x3a28fb,null))[_0x2bf3('0x46')](handleError(_0x3a28fb,null));};exports[_0x2bf3('0x4f')]=function(_0x3d4610,_0x1b515e,_0x3f8a90){var _0x5e177e={};var _0x4e441f={};var _0x5bbaf4;var _0x2156b7;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x3d4610[_0x2bf3('0x44')]['id']}})['then'](handleEntityNotFound(_0x1b515e,null))[_0x2bf3('0x40')](function(_0x43708c){if(_0x43708c){_0x5bbaf4=_0x43708c;_0x4e441f[_0x2bf3('0x2d')]=_[_0x2bf3('0x2e')](db[_0x2bf3('0x4c')]['rawAttributes']);_0x4e441f[_0x2bf3('0x31')]=_[_0x2bf3('0x2e')](_0x3d4610['query']);_0x4e441f[_0x2bf3('0x2f')]=_['intersection'](_0x4e441f[_0x2bf3('0x2d')],_0x4e441f[_0x2bf3('0x31')]);_0x5e177e[_0x2bf3('0x32')]=_[_0x2bf3('0x30')](_0x4e441f[_0x2bf3('0x2d')],qs[_0x2bf3('0x33')](_0x3d4610[_0x2bf3('0x31')][_0x2bf3('0x33')]));_0x5e177e[_0x2bf3('0x32')]=_0x5e177e['attributes'][_0x2bf3('0x34')]?_0x5e177e[_0x2bf3('0x32')]:_0x4e441f[_0x2bf3('0x2d')];_0x5e177e['order']=qs['sort'](_0x3d4610[_0x2bf3('0x31')]['sort']);_0x5e177e['where']=qs[_0x2bf3('0x2f')](_['pick'](_0x3d4610[_0x2bf3('0x31')],_0x4e441f['filters']));if(_0x3d4610[_0x2bf3('0x31')][_0x2bf3('0x3b')]){_0x5e177e['where']=_[_0x2bf3('0x3c')](_0x5e177e[_0x2bf3('0x39')],{'$or':_[_0x2bf3('0x28')](_0x5e177e[_0x2bf3('0x32')],function(_0x467bfb){var _0x57beec={};_0x57beec[_0x467bfb]={'$like':'%'+_0x3d4610[_0x2bf3('0x31')][_0x2bf3('0x3b')]+'%'};return _0x57beec;})});}_0x5e177e=_[_0x2bf3('0x3c')]({},_0x5e177e,_0x3d4610[_0x2bf3('0x3f')]);return _0x5bbaf4[_0x2bf3('0x4f')](_0x5e177e);}})[_0x2bf3('0x40')](function(_0x134824){if(_0x134824){_0x2156b7=_0x134824[_0x2bf3('0x34')];if(!_0x3d4610[_0x2bf3('0x31')][_0x2bf3('0x35')]('nolimit')){_0x5e177e['limit']=qs[_0x2bf3('0x37')](_0x3d4610['query'][_0x2bf3('0x37')]);_0x5e177e['offset']=qs[_0x2bf3('0x1b')](_0x3d4610[_0x2bf3('0x31')][_0x2bf3('0x1b')]);}return _0x5bbaf4[_0x2bf3('0x4f')](_0x5e177e);}})[_0x2bf3('0x40')](function(_0x1c1bb1){if(_0x1c1bb1){return _0x1c1bb1?{'count':_0x2156b7,'rows':_0x1c1bb1}:null;}})[_0x2bf3('0x40')](respondWithResult(_0x1b515e,null))[_0x2bf3('0x46')](handleError(_0x1b515e,null));};exports[_0x2bf3('0x50')]=function(_0x43a33d,_0x5cebb2,_0x5e9ee4){var _0x4c6cb1={};var _0x15f1d0={};var _0x13a109;var _0x1baf5d;return db[_0x2bf3('0x29')][_0x2bf3('0x4b')]({'where':{'id':_0x43a33d[_0x2bf3('0x44')]['id']}})[_0x2bf3('0x40')](handleEntityNotFound(_0x5cebb2,null))['then'](function(_0x176f63){if(_0x176f63){_0x13a109=_0x176f63;_0x15f1d0['model']=_[_0x2bf3('0x2e')](db[_0x2bf3('0x51')][_0x2bf3('0x2a')]);_0x15f1d0[_0x2bf3('0x31')]=_[_0x2bf3('0x2e')](_0x43a33d['query']);_0x15f1d0[_0x2bf3('0x2f')]=_['intersection'](_0x15f1d0[_0x2bf3('0x2d')],_0x15f1d0[_0x2bf3('0x31')]);_0x4c6cb1[_0x2bf3('0x32')]=_[_0x2bf3('0x30')](_0x15f1d0[_0x2bf3('0x2d')],qs[_0x2bf3('0x33')](_0x43a33d[_0x2bf3('0x31')][_0x2bf3('0x33')]));_0x4c6cb1[_0x2bf3('0x32')]=_0x4c6cb1['attributes'][_0x2bf3('0x34')]?_0x4c6cb1[_0x2bf3('0x32')]:_0x15f1d0[_0x2bf3('0x2d')];_0x4c6cb1['order']=qs[_0x2bf3('0x38')](_0x43a33d[_0x2bf3('0x31')]['sort']);_0x4c6cb1[_0x2bf3('0x39')]=qs[_0x2bf3('0x2f')](_[_0x2bf3('0x3a')](_0x43a33d['query'],_0x15f1d0[_0x2bf3('0x2f')]));if(_0x43a33d[_0x2bf3('0x31')][_0x2bf3('0x3b')]){_0x4c6cb1[_0x2bf3('0x39')]=_[_0x2bf3('0x3c')](_0x4c6cb1[_0x2bf3('0x39')],{'$or':_[_0x2bf3('0x28')](_0x4c6cb1[_0x2bf3('0x32')],function(_0x17f640){var _0x22d4b5={};_0x22d4b5[_0x17f640]={'$like':'%'+_0x43a33d[_0x2bf3('0x31')][_0x2bf3('0x3b')]+'%'};return _0x22d4b5;})});}_0x4c6cb1=_[_0x2bf3('0x3c')]({},_0x4c6cb1,_0x43a33d[_0x2bf3('0x3f')]);return _0x13a109[_0x2bf3('0x50')](_0x4c6cb1);}})[_0x2bf3('0x40')](function(_0x863fa4){if(_0x863fa4){_0x1baf5d=_0x863fa4[_0x2bf3('0x34')];if(!_0x43a33d[_0x2bf3('0x31')][_0x2bf3('0x35')](_0x2bf3('0x36'))){_0x4c6cb1[_0x2bf3('0x37')]=qs[_0x2bf3('0x37')](_0x43a33d[_0x2bf3('0x31')][_0x2bf3('0x37')]);_0x4c6cb1['offset']=qs['offset'](_0x43a33d[_0x2bf3('0x31')][_0x2bf3('0x1b')]);}return _0x13a109[_0x2bf3('0x50')](_0x4c6cb1);}})[_0x2bf3('0x40')](function(_0x1e1c1b){if(_0x1e1c1b){return _0x1e1c1b?{'count':_0x1baf5d,'rows':_0x1e1c1b}:null;}})[_0x2bf3('0x40')](respondWithResult(_0x5cebb2,null))['catch'](handleError(_0x5cebb2,null));};exports['setTags']=function(_0x163f50,_0x5beb68,_0x3b1e2d){if(_0x163f50[_0x2bf3('0x48')]['id']){delete _0x163f50[_0x2bf3('0x48')]['id'];}return db['FreshdeskConfiguration'][_0x2bf3('0x4b')]({'where':{'id':_0x163f50[_0x2bf3('0x44')]['id']}})[_0x2bf3('0x40')](handleEntityNotFound(_0x5beb68,null))['then'](function(_0x2b517f){if(_0x2b517f){return _0x2b517f[_0x2bf3('0x52')](_0x163f50[_0x2bf3('0x48')][_0x2bf3('0x53')]||[]);}return null;})['then'](respondWithResult(_0x5beb68,null))['catch'](handleError(_0x5beb68,null));}; \ No newline at end of file +var _0x0c09=['../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','reject','save','destroy','then','error','stack','name','send','index','map','FreshdeskConfiguration','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','rawAttributes','include','find','create','update','body','getFields','FreshdeskField','getSubjects','findOne','getDescriptions','getTags','Tag','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x484a87,_0x136006){var _0x589452=function(_0x54c13c){while(--_0x54c13c){_0x484a87['push'](_0x484a87['shift']());}};_0x589452(++_0x136006);}(_0x0c09,0x92));var _0x90c0=function(_0x37ccab,_0x473852){_0x37ccab=_0x37ccab-0x0;var _0x23c0b4=_0x0c09[_0x37ccab];return _0x23c0b4;};'use strict';var emlformat=require(_0x90c0('0x0'));var rimraf=require(_0x90c0('0x1'));var zipdir=require(_0x90c0('0x2'));var jsonpatch=require(_0x90c0('0x3'));var rp=require(_0x90c0('0x4'));var moment=require(_0x90c0('0x5'));var BPromise=require(_0x90c0('0x6'));var Mustache=require(_0x90c0('0x7'));var util=require(_0x90c0('0x8'));var path=require(_0x90c0('0x9'));var sox=require(_0x90c0('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x90c0('0xb'));var _=require('lodash');var squel=require(_0x90c0('0xc'));var crypto=require(_0x90c0('0xd'));var jsforce=require(_0x90c0('0xe'));var deskjs=require(_0x90c0('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x90c0('0x10'));var Redis=require(_0x90c0('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x90c0('0x12'));var as=require(_0x90c0('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x90c0('0x14'))(_0x90c0('0x15'));var utils=require(_0x90c0('0x16'));var config=require(_0x90c0('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x90c0('0x18'))['db'];function respondWithStatusCode(_0xe8d513,_0x2f7d93){_0x2f7d93=_0x2f7d93||0xcc;return function(_0x5aaa53){if(_0x5aaa53){return _0xe8d513[_0x90c0('0x19')](_0x2f7d93);}return _0xe8d513[_0x90c0('0x1a')](_0x2f7d93)[_0x90c0('0x1b')]();};}function respondWithResult(_0x2138f7,_0x7edec2){_0x7edec2=_0x7edec2||0xc8;return function(_0x5cd418){if(_0x5cd418){return _0x2138f7[_0x90c0('0x1a')](_0x7edec2)[_0x90c0('0x1c')](_0x5cd418);}};}function respondWithFilteredResult(_0x48503c,_0x57ebd4){return function(_0x418dcd){if(_0x418dcd){var _0x2687fd=typeof _0x57ebd4[_0x90c0('0x1d')]==='undefined'&&typeof _0x57ebd4[_0x90c0('0x1e')]===_0x90c0('0x1f');var _0x5361ad=_0x418dcd[_0x90c0('0x20')];var _0x2acd63=_0x2687fd?0x0:_0x57ebd4['offset'];var _0x345a1c=_0x2687fd?_0x418dcd['count']:_0x57ebd4[_0x90c0('0x1d')]+_0x57ebd4[_0x90c0('0x1e')];var _0x52e5e3;if(_0x345a1c>=_0x5361ad){_0x345a1c=_0x5361ad;_0x52e5e3=0xc8;}else{_0x52e5e3=0xce;}_0x48503c[_0x90c0('0x1a')](_0x52e5e3);return _0x48503c[_0x90c0('0x21')]('Content-Range',_0x2acd63+'-'+_0x345a1c+'/'+_0x5361ad)['json'](_0x418dcd);}return null;};}function patchUpdates(_0x57174a){return function(_0x113558){try{jsonpatch['apply'](_0x113558,_0x57174a,!![]);}catch(_0x5bc354){return BPromise[_0x90c0('0x22')](_0x5bc354);}return _0x113558[_0x90c0('0x23')]();};}function saveUpdates(_0x5bb8a2,_0x23e0b2){return function(_0x3e5831){if(_0x3e5831){return _0x3e5831['update'](_0x5bb8a2)['then'](function(_0x13c323){return _0x13c323;});}return null;};}function removeEntity(_0x49441a,_0x116ea9){return function(_0x365662){if(_0x365662){return _0x365662[_0x90c0('0x24')]()[_0x90c0('0x25')](function(){_0x49441a['status'](0xcc)[_0x90c0('0x1b')]();});}};}function handleEntityNotFound(_0x4655d9,_0x3794a3){return function(_0x48b855){if(!_0x48b855){_0x4655d9[_0x90c0('0x19')](0x194);}return _0x48b855;};}function handleError(_0x292dc5,_0x3fe8d6){_0x3fe8d6=_0x3fe8d6||0x1f4;return function(_0x3768cf){logger[_0x90c0('0x26')](_0x3768cf[_0x90c0('0x27')]);if(_0x3768cf[_0x90c0('0x28')]){delete _0x3768cf[_0x90c0('0x28')];}_0x292dc5['status'](_0x3fe8d6)[_0x90c0('0x29')](_0x3768cf);};}exports[_0x90c0('0x2a')]=function(_0x32fa9b,_0x4f32dd){var _0x48c295={},_0x6a1d10={},_0x3de6be={'count':0x0,'rows':[]};var _0x48829d=_[_0x90c0('0x2b')](db[_0x90c0('0x2c')]['rawAttributes'],function(_0x16bf40){return{'name':_0x16bf40[_0x90c0('0x2d')],'type':_0x16bf40[_0x90c0('0x2e')][_0x90c0('0x2f')]};});_0x6a1d10['model']=_[_0x90c0('0x2b')](_0x48829d,'name');_0x6a1d10['query']=_[_0x90c0('0x30')](_0x32fa9b[_0x90c0('0x31')]);_0x6a1d10[_0x90c0('0x32')]=_[_0x90c0('0x33')](_0x6a1d10[_0x90c0('0x34')],_0x6a1d10[_0x90c0('0x31')]);_0x48c295['attributes']=_[_0x90c0('0x33')](_0x6a1d10[_0x90c0('0x34')],qs['fields'](_0x32fa9b[_0x90c0('0x31')][_0x90c0('0x35')]));_0x48c295[_0x90c0('0x36')]=_0x48c295[_0x90c0('0x36')][_0x90c0('0x37')]?_0x48c295[_0x90c0('0x36')]:_0x6a1d10[_0x90c0('0x34')];if(!_0x32fa9b['query'][_0x90c0('0x38')](_0x90c0('0x39'))){_0x48c295[_0x90c0('0x1e')]=qs[_0x90c0('0x1e')](_0x32fa9b[_0x90c0('0x31')]['limit']);_0x48c295[_0x90c0('0x1d')]=qs[_0x90c0('0x1d')](_0x32fa9b['query']['offset']);}_0x48c295[_0x90c0('0x3a')]=qs[_0x90c0('0x3b')](_0x32fa9b[_0x90c0('0x31')][_0x90c0('0x3b')]);_0x48c295[_0x90c0('0x3c')]=qs[_0x90c0('0x32')](_[_0x90c0('0x3d')](_0x32fa9b['query'],_0x6a1d10['filters']),_0x48829d);if(_0x32fa9b[_0x90c0('0x31')][_0x90c0('0x3e')]){_0x48c295[_0x90c0('0x3c')]=_[_0x90c0('0x3f')](_0x48c295[_0x90c0('0x3c')],{'$or':_[_0x90c0('0x2b')](_0x48829d,function(_0x210244){if(_0x210244[_0x90c0('0x2e')]!==_0x90c0('0x40')){var _0xedfd1e={};_0xedfd1e[_0x210244[_0x90c0('0x28')]]={'$like':'%'+_0x32fa9b[_0x90c0('0x31')][_0x90c0('0x3e')]+'%'};return _0xedfd1e;}})});}_0x48c295=_[_0x90c0('0x3f')]({},_0x48c295,_0x32fa9b[_0x90c0('0x41')]);var _0x39d080={'where':_0x48c295[_0x90c0('0x3c')]};return db[_0x90c0('0x2c')][_0x90c0('0x20')](_0x39d080)[_0x90c0('0x25')](function(_0x4adfc7){_0x3de6be[_0x90c0('0x20')]=_0x4adfc7;if(_0x32fa9b[_0x90c0('0x31')][_0x90c0('0x42')]){_0x48c295['include']=[{'all':!![]}];}return db['FreshdeskConfiguration']['findAll'](_0x48c295);})[_0x90c0('0x25')](function(_0x47d972){_0x3de6be[_0x90c0('0x43')]=_0x47d972;return _0x3de6be;})['then'](respondWithFilteredResult(_0x4f32dd,_0x48c295))[_0x90c0('0x44')](handleError(_0x4f32dd,null));};exports[_0x90c0('0x45')]=function(_0x3cba7c,_0x10ed35){var _0x2c781b={'raw':![],'where':{'id':_0x3cba7c[_0x90c0('0x46')]['id']}},_0x49230c={};_0x49230c[_0x90c0('0x34')]=_[_0x90c0('0x30')](db[_0x90c0('0x2c')][_0x90c0('0x47')]);_0x49230c[_0x90c0('0x31')]=_['keys'](_0x3cba7c['query']);_0x49230c['filters']=_[_0x90c0('0x33')](_0x49230c[_0x90c0('0x34')],_0x49230c[_0x90c0('0x31')]);_0x2c781b['attributes']=_[_0x90c0('0x33')](_0x49230c[_0x90c0('0x34')],qs['fields'](_0x3cba7c['query'][_0x90c0('0x35')]));_0x2c781b['attributes']=_0x2c781b[_0x90c0('0x36')][_0x90c0('0x37')]?_0x2c781b['attributes']:_0x49230c[_0x90c0('0x34')];if(_0x3cba7c[_0x90c0('0x31')][_0x90c0('0x42')]){_0x2c781b[_0x90c0('0x48')]=[{'all':!![]}];}_0x2c781b=_[_0x90c0('0x3f')]({},_0x2c781b,_0x3cba7c[_0x90c0('0x41')]);return db['FreshdeskConfiguration'][_0x90c0('0x49')](_0x2c781b)[_0x90c0('0x25')](handleEntityNotFound(_0x10ed35,null))[_0x90c0('0x25')](respondWithResult(_0x10ed35,null))[_0x90c0('0x44')](handleError(_0x10ed35,null));};exports[_0x90c0('0x4a')]=function(_0x2b6a86,_0x3b1aa9){return db[_0x90c0('0x2c')][_0x90c0('0x4a')](_0x2b6a86['body'],{})[_0x90c0('0x25')](respondWithResult(_0x3b1aa9,0xc9))[_0x90c0('0x44')](handleError(_0x3b1aa9,null));};exports[_0x90c0('0x4b')]=function(_0x2a6304,_0x2eab53){if(_0x2a6304[_0x90c0('0x4c')]['id']){delete _0x2a6304[_0x90c0('0x4c')]['id'];}return db['FreshdeskConfiguration'][_0x90c0('0x49')]({'where':{'id':_0x2a6304[_0x90c0('0x46')]['id']}})[_0x90c0('0x25')](handleEntityNotFound(_0x2eab53,null))[_0x90c0('0x25')](saveUpdates(_0x2a6304['body'],null))['then'](respondWithResult(_0x2eab53,null))[_0x90c0('0x44')](handleError(_0x2eab53,null));};exports['destroy']=function(_0x4d2370,_0x3db649){return db[_0x90c0('0x2c')][_0x90c0('0x49')]({'where':{'id':_0x4d2370[_0x90c0('0x46')]['id']}})[_0x90c0('0x25')](handleEntityNotFound(_0x3db649,null))[_0x90c0('0x25')](removeEntity(_0x3db649,null))['catch'](handleError(_0x3db649,null));};exports[_0x90c0('0x4d')]=function(_0x49d234,_0x18b2f1,_0x43118d){var _0x2c47b4={};var _0x289aae={};var _0x11ff73;var _0x4884eb;return db[_0x90c0('0x2c')]['findOne']({'where':{'id':_0x49d234['params']['id']}})[_0x90c0('0x25')](handleEntityNotFound(_0x18b2f1,null))[_0x90c0('0x25')](function(_0x4af046){if(_0x4af046){_0x11ff73=_0x4af046;_0x289aae[_0x90c0('0x34')]=_[_0x90c0('0x30')](db[_0x90c0('0x4e')][_0x90c0('0x47')]);_0x289aae[_0x90c0('0x31')]=_[_0x90c0('0x30')](_0x49d234[_0x90c0('0x31')]);_0x289aae['filters']=_[_0x90c0('0x33')](_0x289aae['model'],_0x289aae[_0x90c0('0x31')]);_0x2c47b4[_0x90c0('0x36')]=_[_0x90c0('0x33')](_0x289aae[_0x90c0('0x34')],qs[_0x90c0('0x35')](_0x49d234['query'][_0x90c0('0x35')]));_0x2c47b4['attributes']=_0x2c47b4[_0x90c0('0x36')][_0x90c0('0x37')]?_0x2c47b4['attributes']:_0x289aae[_0x90c0('0x34')];_0x2c47b4[_0x90c0('0x3a')]=qs[_0x90c0('0x3b')](_0x49d234[_0x90c0('0x31')]['sort']);_0x2c47b4['where']=qs[_0x90c0('0x32')](_['pick'](_0x49d234[_0x90c0('0x31')],_0x289aae[_0x90c0('0x32')]));if(_0x49d234[_0x90c0('0x31')]['filter']){_0x2c47b4[_0x90c0('0x3c')]=_[_0x90c0('0x3f')](_0x2c47b4['where'],{'$or':_[_0x90c0('0x2b')](_0x2c47b4[_0x90c0('0x36')],function(_0xf795f8){var _0x5ab574={};_0x5ab574[_0xf795f8]={'$like':'%'+_0x49d234[_0x90c0('0x31')][_0x90c0('0x3e')]+'%'};return _0x5ab574;})});}_0x2c47b4=_[_0x90c0('0x3f')]({},_0x2c47b4,_0x49d234[_0x90c0('0x41')]);return _0x11ff73['getFields'](_0x2c47b4);}})[_0x90c0('0x25')](function(_0x2d895c){if(_0x2d895c){_0x4884eb=_0x2d895c[_0x90c0('0x37')];if(!_0x49d234[_0x90c0('0x31')][_0x90c0('0x38')]('nolimit')){_0x2c47b4[_0x90c0('0x1e')]=qs[_0x90c0('0x1e')](_0x49d234['query']['limit']);_0x2c47b4[_0x90c0('0x1d')]=qs[_0x90c0('0x1d')](_0x49d234['query']['offset']);}return _0x11ff73[_0x90c0('0x4d')](_0x2c47b4);}})[_0x90c0('0x25')](function(_0xfe6907){if(_0xfe6907){return _0xfe6907?{'count':_0x4884eb,'rows':_0xfe6907}:null;}})[_0x90c0('0x25')](respondWithResult(_0x18b2f1,null))[_0x90c0('0x44')](handleError(_0x18b2f1,null));};exports[_0x90c0('0x4f')]=function(_0x46e479,_0xc75380,_0x1d25b1){var _0x3bf305={};var _0x534330={};var _0x2ddee9;var _0x1419a9;return db[_0x90c0('0x2c')][_0x90c0('0x50')]({'where':{'id':_0x46e479[_0x90c0('0x46')]['id']}})[_0x90c0('0x25')](handleEntityNotFound(_0xc75380,null))[_0x90c0('0x25')](function(_0x10d8cd){if(_0x10d8cd){_0x2ddee9=_0x10d8cd;_0x534330[_0x90c0('0x34')]=_[_0x90c0('0x30')](db[_0x90c0('0x4e')][_0x90c0('0x47')]);_0x534330[_0x90c0('0x31')]=_[_0x90c0('0x30')](_0x46e479[_0x90c0('0x31')]);_0x534330['filters']=_[_0x90c0('0x33')](_0x534330[_0x90c0('0x34')],_0x534330[_0x90c0('0x31')]);_0x3bf305[_0x90c0('0x36')]=_[_0x90c0('0x33')](_0x534330['model'],qs[_0x90c0('0x35')](_0x46e479[_0x90c0('0x31')][_0x90c0('0x35')]));_0x3bf305[_0x90c0('0x36')]=_0x3bf305[_0x90c0('0x36')]['length']?_0x3bf305[_0x90c0('0x36')]:_0x534330[_0x90c0('0x34')];_0x3bf305[_0x90c0('0x3a')]=qs[_0x90c0('0x3b')](_0x46e479['query'][_0x90c0('0x3b')]);_0x3bf305[_0x90c0('0x3c')]=qs[_0x90c0('0x32')](_[_0x90c0('0x3d')](_0x46e479[_0x90c0('0x31')],_0x534330[_0x90c0('0x32')]));if(_0x46e479['query']['filter']){_0x3bf305['where']=_['merge'](_0x3bf305[_0x90c0('0x3c')],{'$or':_[_0x90c0('0x2b')](_0x3bf305[_0x90c0('0x36')],function(_0x3bd861){var _0x18b9b8={};_0x18b9b8[_0x3bd861]={'$like':'%'+_0x46e479[_0x90c0('0x31')][_0x90c0('0x3e')]+'%'};return _0x18b9b8;})});}_0x3bf305=_[_0x90c0('0x3f')]({},_0x3bf305,_0x46e479[_0x90c0('0x41')]);return _0x2ddee9[_0x90c0('0x4f')](_0x3bf305);}})['then'](function(_0x478143){if(_0x478143){_0x1419a9=_0x478143['length'];if(!_0x46e479['query'][_0x90c0('0x38')]('nolimit')){_0x3bf305['limit']=qs[_0x90c0('0x1e')](_0x46e479[_0x90c0('0x31')][_0x90c0('0x1e')]);_0x3bf305['offset']=qs[_0x90c0('0x1d')](_0x46e479[_0x90c0('0x31')][_0x90c0('0x1d')]);}return _0x2ddee9[_0x90c0('0x4f')](_0x3bf305);}})[_0x90c0('0x25')](function(_0x48733a){if(_0x48733a){return _0x48733a?{'count':_0x1419a9,'rows':_0x48733a}:null;}})[_0x90c0('0x25')](respondWithResult(_0xc75380,null))[_0x90c0('0x44')](handleError(_0xc75380,null));};exports['getDescriptions']=function(_0x56dc79,_0x43ef7a,_0x315e00){var _0x8ce9c1={};var _0x4cf0f8={};var _0x1c96ba;var _0x5d43e2;return db[_0x90c0('0x2c')]['findOne']({'where':{'id':_0x56dc79[_0x90c0('0x46')]['id']}})[_0x90c0('0x25')](handleEntityNotFound(_0x43ef7a,null))['then'](function(_0x96bd40){if(_0x96bd40){_0x1c96ba=_0x96bd40;_0x4cf0f8[_0x90c0('0x34')]=_[_0x90c0('0x30')](db[_0x90c0('0x4e')][_0x90c0('0x47')]);_0x4cf0f8[_0x90c0('0x31')]=_['keys'](_0x56dc79['query']);_0x4cf0f8['filters']=_[_0x90c0('0x33')](_0x4cf0f8['model'],_0x4cf0f8[_0x90c0('0x31')]);_0x8ce9c1[_0x90c0('0x36')]=_['intersection'](_0x4cf0f8[_0x90c0('0x34')],qs[_0x90c0('0x35')](_0x56dc79[_0x90c0('0x31')][_0x90c0('0x35')]));_0x8ce9c1[_0x90c0('0x36')]=_0x8ce9c1['attributes'][_0x90c0('0x37')]?_0x8ce9c1[_0x90c0('0x36')]:_0x4cf0f8[_0x90c0('0x34')];_0x8ce9c1['order']=qs[_0x90c0('0x3b')](_0x56dc79[_0x90c0('0x31')]['sort']);_0x8ce9c1[_0x90c0('0x3c')]=qs[_0x90c0('0x32')](_[_0x90c0('0x3d')](_0x56dc79[_0x90c0('0x31')],_0x4cf0f8[_0x90c0('0x32')]));if(_0x56dc79['query'][_0x90c0('0x3e')]){_0x8ce9c1[_0x90c0('0x3c')]=_[_0x90c0('0x3f')](_0x8ce9c1[_0x90c0('0x3c')],{'$or':_['map'](_0x8ce9c1['attributes'],function(_0xedcf5c){var _0x4bd67a={};_0x4bd67a[_0xedcf5c]={'$like':'%'+_0x56dc79['query'][_0x90c0('0x3e')]+'%'};return _0x4bd67a;})});}_0x8ce9c1=_[_0x90c0('0x3f')]({},_0x8ce9c1,_0x56dc79[_0x90c0('0x41')]);return _0x1c96ba[_0x90c0('0x51')](_0x8ce9c1);}})['then'](function(_0x5b2bf7){if(_0x5b2bf7){_0x5d43e2=_0x5b2bf7[_0x90c0('0x37')];if(!_0x56dc79[_0x90c0('0x31')][_0x90c0('0x38')](_0x90c0('0x39'))){_0x8ce9c1[_0x90c0('0x1e')]=qs[_0x90c0('0x1e')](_0x56dc79['query'][_0x90c0('0x1e')]);_0x8ce9c1[_0x90c0('0x1d')]=qs['offset'](_0x56dc79[_0x90c0('0x31')][_0x90c0('0x1d')]);}return _0x1c96ba[_0x90c0('0x51')](_0x8ce9c1);}})[_0x90c0('0x25')](function(_0x2a97d1){if(_0x2a97d1){return _0x2a97d1?{'count':_0x5d43e2,'rows':_0x2a97d1}:null;}})[_0x90c0('0x25')](respondWithResult(_0x43ef7a,null))[_0x90c0('0x44')](handleError(_0x43ef7a,null));};exports[_0x90c0('0x52')]=function(_0x33e99a,_0x14b641,_0x30ad58){var _0x131902={};var _0x366ec7={};var _0x3923fb;var _0x24245d;return db['FreshdeskConfiguration'][_0x90c0('0x50')]({'where':{'id':_0x33e99a[_0x90c0('0x46')]['id']}})[_0x90c0('0x25')](handleEntityNotFound(_0x14b641,null))[_0x90c0('0x25')](function(_0x2bc111){if(_0x2bc111){_0x3923fb=_0x2bc111;_0x366ec7[_0x90c0('0x34')]=_[_0x90c0('0x30')](db[_0x90c0('0x53')][_0x90c0('0x47')]);_0x366ec7[_0x90c0('0x31')]=_[_0x90c0('0x30')](_0x33e99a[_0x90c0('0x31')]);_0x366ec7[_0x90c0('0x32')]=_[_0x90c0('0x33')](_0x366ec7[_0x90c0('0x34')],_0x366ec7[_0x90c0('0x31')]);_0x131902['attributes']=_[_0x90c0('0x33')](_0x366ec7['model'],qs[_0x90c0('0x35')](_0x33e99a['query'][_0x90c0('0x35')]));_0x131902[_0x90c0('0x36')]=_0x131902['attributes'][_0x90c0('0x37')]?_0x131902[_0x90c0('0x36')]:_0x366ec7[_0x90c0('0x34')];_0x131902[_0x90c0('0x3a')]=qs[_0x90c0('0x3b')](_0x33e99a[_0x90c0('0x31')][_0x90c0('0x3b')]);_0x131902[_0x90c0('0x3c')]=qs[_0x90c0('0x32')](_[_0x90c0('0x3d')](_0x33e99a[_0x90c0('0x31')],_0x366ec7[_0x90c0('0x32')]));if(_0x33e99a['query'][_0x90c0('0x3e')]){_0x131902[_0x90c0('0x3c')]=_[_0x90c0('0x3f')](_0x131902['where'],{'$or':_[_0x90c0('0x2b')](_0x131902[_0x90c0('0x36')],function(_0x5a2dce){var _0x77f12b={};_0x77f12b[_0x5a2dce]={'$like':'%'+_0x33e99a[_0x90c0('0x31')][_0x90c0('0x3e')]+'%'};return _0x77f12b;})});}_0x131902=_[_0x90c0('0x3f')]({},_0x131902,_0x33e99a[_0x90c0('0x41')]);return _0x3923fb[_0x90c0('0x52')](_0x131902);}})[_0x90c0('0x25')](function(_0x541737){if(_0x541737){_0x24245d=_0x541737['length'];if(!_0x33e99a[_0x90c0('0x31')]['hasOwnProperty'](_0x90c0('0x39'))){_0x131902['limit']=qs[_0x90c0('0x1e')](_0x33e99a['query'][_0x90c0('0x1e')]);_0x131902['offset']=qs[_0x90c0('0x1d')](_0x33e99a[_0x90c0('0x31')][_0x90c0('0x1d')]);}return _0x3923fb[_0x90c0('0x52')](_0x131902);}})[_0x90c0('0x25')](function(_0x3df37b){if(_0x3df37b){return _0x3df37b?{'count':_0x24245d,'rows':_0x3df37b}:null;}})[_0x90c0('0x25')](respondWithResult(_0x14b641,null))['catch'](handleError(_0x14b641,null));};exports['setTags']=function(_0x8c54a3,_0x43b5a3,_0x4fd031){if(_0x8c54a3[_0x90c0('0x4c')]['id']){delete _0x8c54a3[_0x90c0('0x4c')]['id'];}return db[_0x90c0('0x2c')][_0x90c0('0x50')]({'where':{'id':_0x8c54a3[_0x90c0('0x46')]['id']}})[_0x90c0('0x25')](handleEntityNotFound(_0x43b5a3,null))['then'](function(_0x110151){if(_0x110151){return _0x110151['setTags'](_0x8c54a3[_0x90c0('0x4c')][_0x90c0('0x54')]||[]);}return null;})['then'](respondWithResult(_0x43b5a3,null))[_0x90c0('0x44')](handleError(_0x43b5a3,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 816f377..0577685 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 _0x4700=['rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x1a976f,_0xd3e7d5){var _0x2a776d=function(_0x151842){while(--_0x151842){_0x1a976f['push'](_0x1a976f['shift']());}};_0x2a776d(++_0xd3e7d5);}(_0x4700,0x125));var _0x0470=function(_0x389b27,_0x5214a0){_0x389b27=_0x389b27-0x0;var _0x39b3d3=_0x4700[_0x389b27];return _0x39b3d3;};'use strict';var _=require(_0x0470('0x0'));var util=require(_0x0470('0x1'));var logger=require(_0x0470('0x2'))('api');var moment=require(_0x0470('0x3'));var BPromise=require('bluebird');var rp=require(_0x0470('0x4'));var fs=require('fs');var path=require(_0x0470('0x5'));var rimraf=require(_0x0470('0x6'));var config=require(_0x0470('0x7'));var attributes=require(_0x0470('0x8'));module[_0x0470('0x9')]=function(_0x293b05,_0x8f37c4){return _0x293b05[_0x0470('0xa')](_0x0470('0xb'),attributes,{'tableName':_0x0470('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5556=['rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','api','moment','bluebird','request-promise','path'];(function(_0x4d4253,_0x4ab0f7){var _0x1c33f0=function(_0x109af3){while(--_0x109af3){_0x4d4253['push'](_0x4d4253['shift']());}};_0x1c33f0(++_0x4ab0f7);}(_0x5556,0x7c));var _0x6555=function(_0x3261ed,_0x1f06ad){_0x3261ed=_0x3261ed-0x0;var _0xbea3c3=_0x5556[_0x3261ed];return _0xbea3c3;};'use strict';var _=require(_0x6555('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6555('0x1'));var moment=require(_0x6555('0x2'));var BPromise=require(_0x6555('0x3'));var rp=require(_0x6555('0x4'));var fs=require('fs');var path=require(_0x6555('0x5'));var rimraf=require(_0x6555('0x6'));var config=require(_0x6555('0x7'));var attributes=require(_0x6555('0x8'));module[_0x6555('0x9')]=function(_0x15ca82,_0x100480){return _0x15ca82[_0x6555('0xa')](_0x6555('0xb'),attributes,{'tableName':_0x6555('0xc'),'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 7cd5408..1033df0 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 _0x08ab=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x5cfee3,_0x3d05f2){var _0x3e9912=function(_0x47f1b5){while(--_0x47f1b5){_0x5cfee3['push'](_0x5cfee3['shift']());}};_0x3e9912(++_0x3d05f2);}(_0x08ab,0xd4));var _0xb08a=function(_0x2338ae,_0x1896f8){_0x2338ae=_0x2338ae-0x0;var _0x4adad9=_0x08ab[_0x2338ae];return _0x4adad9;};'use strict';var _=require(_0xb08a('0x0'));var util=require(_0xb08a('0x1'));var moment=require(_0xb08a('0x2'));var BPromise=require(_0xb08a('0x3'));var rs=require(_0xb08a('0x4'));var fs=require('fs');var Redis=require(_0xb08a('0x5'));var db=require(_0xb08a('0x6'))['db'];var utils=require(_0xb08a('0x7'));var logger=require(_0xb08a('0x8'))(_0xb08a('0x9'));var config=require(_0xb08a('0xa'));var jayson=require(_0xb08a('0xb'));var client=jayson[_0xb08a('0xc')][_0xb08a('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x450e66,_0x12f2a5,_0x5a80fd){return new BPromise(function(_0x39e4a5,_0x840bf6){return client[_0xb08a('0xe')](_0x450e66,_0x5a80fd)[_0xb08a('0xf')](function(_0xe925e6){logger[_0xb08a('0x10')](_0xb08a('0x11'),_0x12f2a5,_0xb08a('0x12'));logger[_0xb08a('0x13')](_0xb08a('0x14'),_0x12f2a5,_0xb08a('0x12'),JSON[_0xb08a('0x15')](_0xe925e6));if(_0xe925e6[_0xb08a('0x16')]){if(_0xe925e6[_0xb08a('0x16')][_0xb08a('0x17')]===0x1f4){logger[_0xb08a('0x16')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x12f2a5,_0xe925e6[_0xb08a('0x16')][_0xb08a('0x18')]);return _0x840bf6(_0xe925e6[_0xb08a('0x16')][_0xb08a('0x18')]);}logger[_0xb08a('0x16')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x12f2a5,_0xe925e6['error'][_0xb08a('0x18')]);return _0x39e4a5(_0xe925e6[_0xb08a('0x16')]['message']);}else{logger[_0xb08a('0x10')](_0xb08a('0x11'),_0x12f2a5,_0xb08a('0x12'));_0x39e4a5(_0xe925e6[_0xb08a('0x19')]['message']);}})[_0xb08a('0x1a')](function(_0x15906c){logger['error'](_0xb08a('0x11'),_0x12f2a5,_0x15906c);_0x840bf6(_0x15906c);});});} \ No newline at end of file +var _0xb7d2=['result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','request\x20sent','stringify','error','code','FreshdeskConfiguration,\x20%s,\x20%s','message'];(function(_0x1ada0f,_0x566552){var _0x21b3b2=function(_0x1c756c){while(--_0x1c756c){_0x1ada0f['push'](_0x1ada0f['shift']());}};_0x21b3b2(++_0x566552);}(_0xb7d2,0x1ce));var _0x2b7d=function(_0x439c4d,_0x5f1aad){_0x439c4d=_0x439c4d-0x0;var _0x4821fe=_0xb7d2[_0x439c4d];return _0x4821fe;};'use strict';var _=require(_0x2b7d('0x0'));var util=require(_0x2b7d('0x1'));var moment=require('moment');var BPromise=require(_0x2b7d('0x2'));var rs=require(_0x2b7d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2b7d('0x4'))['db'];var utils=require(_0x2b7d('0x5'));var logger=require(_0x2b7d('0x6'))(_0x2b7d('0x7'));var config=require('../../config/environment');var jayson=require(_0x2b7d('0x8'));var client=jayson[_0x2b7d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5e8a60,_0x5b7de7,_0x1d3d9b){return new BPromise(function(_0x116d7b,_0x500502){return client[_0x2b7d('0xa')](_0x5e8a60,_0x1d3d9b)[_0x2b7d('0xb')](function(_0x3d4d7d){logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x5b7de7,_0x2b7d('0xc'));logger['debug']('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x5b7de7,_0x2b7d('0xc'),JSON[_0x2b7d('0xd')](_0x3d4d7d));if(_0x3d4d7d[_0x2b7d('0xe')]){if(_0x3d4d7d['error'][_0x2b7d('0xf')]===0x1f4){logger['error'](_0x2b7d('0x10'),_0x5b7de7,_0x3d4d7d[_0x2b7d('0xe')][_0x2b7d('0x11')]);return _0x500502(_0x3d4d7d[_0x2b7d('0xe')]['message']);}logger[_0x2b7d('0xe')](_0x2b7d('0x10'),_0x5b7de7,_0x3d4d7d[_0x2b7d('0xe')][_0x2b7d('0x11')]);return _0x116d7b(_0x3d4d7d[_0x2b7d('0xe')][_0x2b7d('0x11')]);}else{logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x5b7de7,_0x2b7d('0xc'));_0x116d7b(_0x3d4d7d[_0x2b7d('0x12')][_0x2b7d('0x11')]);}})[_0x2b7d('0x13')](function(_0x56c8d2){logger['error'](_0x2b7d('0x10'),_0x5b7de7,_0x56c8d2);_0x500502(_0x56c8d2);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 0e862a4..afff6b9 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 _0x8ed3=['post','create','put','update','exports','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','/:id','show'];(function(_0x1d536d,_0x325129){var _0x1f9387=function(_0x21abfe){while(--_0x21abfe){_0x1d536d['push'](_0x1d536d['shift']());}};_0x1f9387(++_0x325129);}(_0x8ed3,0x1eb));var _0x38ed=function(_0x33e613,_0x2e55f0){_0x33e613=_0x33e613-0x0;var _0x421c4b=_0x8ed3[_0x33e613];return _0x421c4b;};'use strict';var multer=require(_0x38ed('0x0'));var util=require(_0x38ed('0x1'));var path=require(_0x38ed('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x38ed('0x3'));var auth=require(_0x38ed('0x4'));var interaction=require(_0x38ed('0x5'));var config=require(_0x38ed('0x6'));var controller=require(_0x38ed('0x7'));router[_0x38ed('0x8')]('/',auth[_0x38ed('0x9')](),controller[_0x38ed('0xa')]);router[_0x38ed('0x8')](_0x38ed('0xb'),auth['isAuthenticated'](),controller[_0x38ed('0xc')]);router[_0x38ed('0xd')]('/',auth[_0x38ed('0x9')](),controller[_0x38ed('0xe')]);router[_0x38ed('0xf')](_0x38ed('0xb'),auth['isAuthenticated'](),controller[_0x38ed('0x10')]);router['delete']('/:id',auth[_0x38ed('0x9')](),controller['destroy']);module[_0x38ed('0x11')]=router; \ No newline at end of file +var _0x3e90=['/:id','show','post','create','put','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get'];(function(_0x269c94,_0x25a7b7){var _0x3b23f9=function(_0x2f9a0d){while(--_0x2f9a0d){_0x269c94['push'](_0x269c94['shift']());}};_0x3b23f9(++_0x25a7b7);}(_0x3e90,0x1e3));var _0x03e9=function(_0x33500d,_0x408f01){_0x33500d=_0x33500d-0x0;var _0x34b5a0=_0x3e90[_0x33500d];return _0x34b5a0;};'use strict';var multer=require(_0x03e9('0x0'));var util=require(_0x03e9('0x1'));var path=require('path');var timeout=require(_0x03e9('0x2'));var express=require(_0x03e9('0x3'));var router=express[_0x03e9('0x4')]();var fs_extra=require(_0x03e9('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x03e9('0x6'));var config=require(_0x03e9('0x7'));var controller=require('./intFreshdeskField.controller');router['get']('/',auth[_0x03e9('0x8')](),controller[_0x03e9('0x9')]);router[_0x03e9('0xa')](_0x03e9('0xb'),auth[_0x03e9('0x8')](),controller[_0x03e9('0xc')]);router[_0x03e9('0xd')]('/',auth[_0x03e9('0x8')](),controller[_0x03e9('0xe')]);router[_0x03e9('0xf')]('/:id',auth[_0x03e9('0x8')](),controller[_0x03e9('0x10')]);router[_0x03e9('0x11')](_0x03e9('0xb'),auth[_0x03e9('0x8')](),controller['destroy']);module[_0x03e9('0x12')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 212d220..e8cf64f 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 _0x938f=['customVariable','BOOLEAN','sequelize','exports','ENUM','variable','keyValue','picklist','STRING'];(function(_0x174f0e,_0x22cd03){var _0xd40c0e=function(_0x9ab883){while(--_0x9ab883){_0x174f0e['push'](_0x174f0e['shift']());}};_0xd40c0e(++_0x22cd03);}(_0x938f,0xd1));var _0xf938=function(_0x19f8ee,_0x3e08c2){_0x19f8ee=_0x19f8ee-0x0;var _0x3b68f2=_0x938f[_0x19f8ee];return _0x3b68f2;};'use strict';var Sequelize=require(_0xf938('0x0'));module[_0xf938('0x1')]={'type':{'type':Sequelize[_0xf938('0x2')]('string',_0xf938('0x3'),'customVariable',_0xf938('0x4'),_0xf938('0x5')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xf938('0x6')]},'keyType':{'type':Sequelize[_0xf938('0x2')]('string',_0xf938('0x3'),_0xf938('0x7'))},'keyContent':{'type':Sequelize[_0xf938('0x6')]},'idField':{'type':Sequelize[_0xf938('0x6')]},'nameField':{'type':Sequelize[_0xf938('0x6')]},'customField':{'type':Sequelize[_0xf938('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf938('0x6')]}}; \ No newline at end of file +var _0x3529=['sequelize','ENUM','string','customVariable','picklist','STRING','variable'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x3529,0x8c));var _0x9352=function(_0x2b338b,_0x4a06ba){_0x2b338b=_0x2b338b-0x0;var _0x256f66=_0x3529[_0x2b338b];return _0x256f66;};'use strict';var Sequelize=require(_0x9352('0x0'));module['exports']={'type':{'type':Sequelize[_0x9352('0x1')](_0x9352('0x2'),'variable',_0x9352('0x3'),'keyValue',_0x9352('0x4')),'defaultValue':_0x9352('0x2')},'content':{'type':Sequelize[_0x9352('0x5')]},'key':{'type':Sequelize[_0x9352('0x5')]},'keyType':{'type':Sequelize[_0x9352('0x1')](_0x9352('0x2'),_0x9352('0x6'),'customVariable')},'keyContent':{'type':Sequelize[_0x9352('0x5')]},'idField':{'type':Sequelize[_0x9352('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9352('0x5')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 96cc0e9..2379926 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 _0xb921=['papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','update','then','destroy','error','stack','name','index','FreshdeskField','rawAttributes','type','key','model','map','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','rows','show','params','include','options','create','body','catch','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x522144,_0x4dd58d){var _0x2a0223=function(_0x3a9563){while(--_0x3a9563){_0x522144['push'](_0x522144['shift']());}};_0x2a0223(++_0x4dd58d);}(_0xb921,0x16a));var _0x1b92=function(_0x2726ad,_0x5073b1){_0x2726ad=_0x2726ad-0x0;var _0xd87993=_0xb921[_0x2726ad];return _0xd87993;};'use strict';var emlformat=require(_0x1b92('0x0'));var rimraf=require(_0x1b92('0x1'));var zipdir=require(_0x1b92('0x2'));var jsonpatch=require(_0x1b92('0x3'));var rp=require(_0x1b92('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1b92('0x5'));var util=require(_0x1b92('0x6'));var path=require(_0x1b92('0x7'));var sox=require(_0x1b92('0x8'));var csv=require(_0x1b92('0x9'));var ejs=require(_0x1b92('0xa'));var fs=require('fs');var fs_extra=require(_0x1b92('0xb'));var _=require(_0x1b92('0xc'));var squel=require(_0x1b92('0xd'));var crypto=require(_0x1b92('0xe'));var jsforce=require(_0x1b92('0xf'));var deskjs=require(_0x1b92('0x10'));var toCsv=require(_0x1b92('0x9'));var querystring=require(_0x1b92('0x11'));var Papa=require(_0x1b92('0x12'));var Redis=require('ioredis');var authService=require(_0x1b92('0x13'));var qs=require(_0x1b92('0x14'));var as=require(_0x1b92('0x15'));var hardwareService=require(_0x1b92('0x16'));var logger=require(_0x1b92('0x17'))(_0x1b92('0x18'));var utils=require(_0x1b92('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x1b92('0x1a'));var db=require(_0x1b92('0x1b'))['db'];function respondWithStatusCode(_0x5a1ca5,_0x81cbe0){_0x81cbe0=_0x81cbe0||0xcc;return function(_0x29a7ed){if(_0x29a7ed){return _0x5a1ca5[_0x1b92('0x1c')](_0x81cbe0);}return _0x5a1ca5[_0x1b92('0x1d')](_0x81cbe0)[_0x1b92('0x1e')]();};}function respondWithResult(_0x290be6,_0x1d33bf){_0x1d33bf=_0x1d33bf||0xc8;return function(_0x4bbb76){if(_0x4bbb76){return _0x290be6[_0x1b92('0x1d')](_0x1d33bf)['json'](_0x4bbb76);}};}function respondWithFilteredResult(_0x1a559b,_0x511a97){return function(_0x694d4f){if(_0x694d4f){var _0x523285=typeof _0x511a97[_0x1b92('0x1f')]===_0x1b92('0x20')&&typeof _0x511a97[_0x1b92('0x21')]==='undefined';var _0x2d171f=_0x694d4f[_0x1b92('0x22')];var _0x289523=_0x523285?0x0:_0x511a97[_0x1b92('0x1f')];var _0x4368dc=_0x523285?_0x694d4f['count']:_0x511a97[_0x1b92('0x1f')]+_0x511a97[_0x1b92('0x21')];var _0x30b0d8;if(_0x4368dc>=_0x2d171f){_0x4368dc=_0x2d171f;_0x30b0d8=0xc8;}else{_0x30b0d8=0xce;}_0x1a559b['status'](_0x30b0d8);return _0x1a559b[_0x1b92('0x23')](_0x1b92('0x24'),_0x289523+'-'+_0x4368dc+'/'+_0x2d171f)[_0x1b92('0x25')](_0x694d4f);}return null;};}function patchUpdates(_0x4bfc51){return function(_0x1d9d28){try{jsonpatch['apply'](_0x1d9d28,_0x4bfc51,!![]);}catch(_0x39ef4e){return BPromise[_0x1b92('0x26')](_0x39ef4e);}return _0x1d9d28['save']();};}function saveUpdates(_0x4ea25f,_0x34c5c9){return function(_0x311487){if(_0x311487){return _0x311487[_0x1b92('0x27')](_0x4ea25f)[_0x1b92('0x28')](function(_0x41fc82){return _0x41fc82;});}return null;};}function removeEntity(_0x186030,_0x48cdf1){return function(_0x3be220){if(_0x3be220){return _0x3be220[_0x1b92('0x29')]()[_0x1b92('0x28')](function(){_0x186030[_0x1b92('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f0e1b,_0x53025e){return function(_0x4369e2){if(!_0x4369e2){_0x3f0e1b[_0x1b92('0x1c')](0x194);}return _0x4369e2;};}function handleError(_0x1abb9a,_0x3c1fa1){_0x3c1fa1=_0x3c1fa1||0x1f4;return function(_0x3e353){logger[_0x1b92('0x2a')](_0x3e353[_0x1b92('0x2b')]);if(_0x3e353[_0x1b92('0x2c')]){delete _0x3e353['name'];}_0x1abb9a['status'](_0x3c1fa1)['send'](_0x3e353);};}exports[_0x1b92('0x2d')]=function(_0x525d05,_0x2c4e02){var _0x5d006b={},_0x462949={},_0x4656aa={'count':0x0,'rows':[]};var _0x26f832=_['map'](db[_0x1b92('0x2e')][_0x1b92('0x2f')],function(_0x55eafd){return{'name':_0x55eafd['fieldName'],'type':_0x55eafd[_0x1b92('0x30')][_0x1b92('0x31')]};});_0x462949[_0x1b92('0x32')]=_[_0x1b92('0x33')](_0x26f832,_0x1b92('0x2c'));_0x462949['query']=_[_0x1b92('0x34')](_0x525d05[_0x1b92('0x35')]);_0x462949[_0x1b92('0x36')]=_[_0x1b92('0x37')](_0x462949[_0x1b92('0x32')],_0x462949[_0x1b92('0x35')]);_0x5d006b[_0x1b92('0x38')]=_['intersection'](_0x462949[_0x1b92('0x32')],qs[_0x1b92('0x39')](_0x525d05['query'][_0x1b92('0x39')]));_0x5d006b[_0x1b92('0x38')]=_0x5d006b[_0x1b92('0x38')]['length']?_0x5d006b[_0x1b92('0x38')]:_0x462949[_0x1b92('0x32')];if(!_0x525d05['query']['hasOwnProperty'](_0x1b92('0x3a'))){_0x5d006b[_0x1b92('0x21')]=qs[_0x1b92('0x21')](_0x525d05[_0x1b92('0x35')]['limit']);_0x5d006b['offset']=qs['offset'](_0x525d05[_0x1b92('0x35')][_0x1b92('0x1f')]);}_0x5d006b[_0x1b92('0x3b')]=qs[_0x1b92('0x3c')](_0x525d05[_0x1b92('0x35')][_0x1b92('0x3c')]);_0x5d006b[_0x1b92('0x3d')]=qs['filters'](_[_0x1b92('0x3e')](_0x525d05[_0x1b92('0x35')],_0x462949['filters']),_0x26f832);if(_0x525d05[_0x1b92('0x35')][_0x1b92('0x3f')]){_0x5d006b[_0x1b92('0x3d')]=_[_0x1b92('0x40')](_0x5d006b[_0x1b92('0x3d')],{'$or':_[_0x1b92('0x33')](_0x26f832,function(_0x115e5f){if(_0x115e5f[_0x1b92('0x30')]!==_0x1b92('0x41')){var _0x14571e={};_0x14571e[_0x115e5f['name']]={'$like':'%'+_0x525d05[_0x1b92('0x35')]['filter']+'%'};return _0x14571e;}})});}_0x5d006b=_[_0x1b92('0x40')]({},_0x5d006b,_0x525d05['options']);var _0x4589fb={'where':_0x5d006b[_0x1b92('0x3d')]};return db[_0x1b92('0x2e')][_0x1b92('0x22')](_0x4589fb)[_0x1b92('0x28')](function(_0x29cda5){_0x4656aa[_0x1b92('0x22')]=_0x29cda5;if(_0x525d05[_0x1b92('0x35')][_0x1b92('0x42')]){_0x5d006b['include']=[{'all':!![]}];}return db[_0x1b92('0x2e')]['findAll'](_0x5d006b);})[_0x1b92('0x28')](function(_0x1e945){_0x4656aa[_0x1b92('0x43')]=_0x1e945;return _0x4656aa;})[_0x1b92('0x28')](respondWithFilteredResult(_0x2c4e02,_0x5d006b))['catch'](handleError(_0x2c4e02,null));};exports[_0x1b92('0x44')]=function(_0xfb5b49,_0x133500){var _0x469a88={'raw':!![],'where':{'id':_0xfb5b49[_0x1b92('0x45')]['id']}},_0xd3f7b0={};_0xd3f7b0['model']=_[_0x1b92('0x34')](db[_0x1b92('0x2e')][_0x1b92('0x2f')]);_0xd3f7b0[_0x1b92('0x35')]=_[_0x1b92('0x34')](_0xfb5b49[_0x1b92('0x35')]);_0xd3f7b0['filters']=_[_0x1b92('0x37')](_0xd3f7b0[_0x1b92('0x32')],_0xd3f7b0['query']);_0x469a88[_0x1b92('0x38')]=_['intersection'](_0xd3f7b0[_0x1b92('0x32')],qs[_0x1b92('0x39')](_0xfb5b49[_0x1b92('0x35')]['fields']));_0x469a88[_0x1b92('0x38')]=_0x469a88[_0x1b92('0x38')]['length']?_0x469a88['attributes']:_0xd3f7b0['model'];if(_0xfb5b49[_0x1b92('0x35')][_0x1b92('0x42')]){_0x469a88[_0x1b92('0x46')]=[{'all':!![]}];}_0x469a88=_[_0x1b92('0x40')]({},_0x469a88,_0xfb5b49[_0x1b92('0x47')]);return db[_0x1b92('0x2e')]['find'](_0x469a88)[_0x1b92('0x28')](handleEntityNotFound(_0x133500,null))[_0x1b92('0x28')](respondWithResult(_0x133500,null))['catch'](handleError(_0x133500,null));};exports[_0x1b92('0x48')]=function(_0x30dbb0,_0x121be9){return db['FreshdeskField'][_0x1b92('0x48')](_0x30dbb0[_0x1b92('0x49')],{})[_0x1b92('0x28')](respondWithResult(_0x121be9,0xc9))[_0x1b92('0x4a')](handleError(_0x121be9,null));};exports[_0x1b92('0x27')]=function(_0x5ac096,_0x142d28){if(_0x5ac096[_0x1b92('0x49')]['id']){delete _0x5ac096[_0x1b92('0x49')]['id'];}return db[_0x1b92('0x2e')][_0x1b92('0x4b')]({'where':{'id':_0x5ac096['params']['id']}})['then'](handleEntityNotFound(_0x142d28,null))[_0x1b92('0x28')](saveUpdates(_0x5ac096[_0x1b92('0x49')],null))[_0x1b92('0x28')](respondWithResult(_0x142d28,null))[_0x1b92('0x4a')](handleError(_0x142d28,null));};exports['destroy']=function(_0x4e0954,_0xfdae28){return db['FreshdeskField'][_0x1b92('0x4b')]({'where':{'id':_0x4e0954[_0x1b92('0x45')]['id']}})[_0x1b92('0x28')](handleEntityNotFound(_0xfdae28,null))['then'](removeEntity(_0xfdae28,null))[_0x1b92('0x4a')](handleError(_0xfdae28,null));}; \ No newline at end of file +var _0xd404=['set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','FreshdeskField','fieldName','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','includeAll','include','findAll','rows','catch','params','rawAttributes','options','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','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'];(function(_0x96e728,_0x50aca0){var _0x59f72b=function(_0x67427b){while(--_0x67427b){_0x96e728['push'](_0x96e728['shift']());}};_0x59f72b(++_0x50aca0);}(_0xd404,0x15b));var _0x4d40=function(_0x5bf530,_0x273157){_0x5bf530=_0x5bf530-0x0;var _0x403b6f=_0xd404[_0x5bf530];return _0x403b6f;};'use strict';var emlformat=require(_0x4d40('0x0'));var rimraf=require(_0x4d40('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4d40('0x2'));var rp=require(_0x4d40('0x3'));var moment=require('moment');var BPromise=require(_0x4d40('0x4'));var Mustache=require(_0x4d40('0x5'));var util=require(_0x4d40('0x6'));var path=require(_0x4d40('0x7'));var sox=require(_0x4d40('0x8'));var csv=require(_0x4d40('0x9'));var ejs=require(_0x4d40('0xa'));var fs=require('fs');var fs_extra=require(_0x4d40('0xb'));var _=require(_0x4d40('0xc'));var squel=require('squel');var crypto=require(_0x4d40('0xd'));var jsforce=require(_0x4d40('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4d40('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4d40('0xf'));var authService=require(_0x4d40('0x10'));var qs=require(_0x4d40('0x11'));var as=require(_0x4d40('0x12'));var hardwareService=require(_0x4d40('0x13'));var logger=require(_0x4d40('0x14'))(_0x4d40('0x15'));var utils=require(_0x4d40('0x16'));var config=require(_0x4d40('0x17'));var licenseUtil=require(_0x4d40('0x18'));var db=require(_0x4d40('0x19'))['db'];function respondWithStatusCode(_0x3c3b7e,_0x28e5bf){_0x28e5bf=_0x28e5bf||0xcc;return function(_0x42a621){if(_0x42a621){return _0x3c3b7e['sendStatus'](_0x28e5bf);}return _0x3c3b7e[_0x4d40('0x1a')](_0x28e5bf)[_0x4d40('0x1b')]();};}function respondWithResult(_0x3b071b,_0x2083bd){_0x2083bd=_0x2083bd||0xc8;return function(_0x477a91){if(_0x477a91){return _0x3b071b['status'](_0x2083bd)[_0x4d40('0x1c')](_0x477a91);}};}function respondWithFilteredResult(_0x4077ce,_0x20bc1b){return function(_0xcee25a){if(_0xcee25a){var _0x453857=typeof _0x20bc1b[_0x4d40('0x1d')]===_0x4d40('0x1e')&&typeof _0x20bc1b[_0x4d40('0x1f')]===_0x4d40('0x1e');var _0x4b5d23=_0xcee25a['count'];var _0x1ae5c7=_0x453857?0x0:_0x20bc1b[_0x4d40('0x1d')];var _0x4e505f=_0x453857?_0xcee25a[_0x4d40('0x20')]:_0x20bc1b[_0x4d40('0x1d')]+_0x20bc1b['limit'];var _0x36d031;if(_0x4e505f>=_0x4b5d23){_0x4e505f=_0x4b5d23;_0x36d031=0xc8;}else{_0x36d031=0xce;}_0x4077ce['status'](_0x36d031);return _0x4077ce[_0x4d40('0x21')](_0x4d40('0x22'),_0x1ae5c7+'-'+_0x4e505f+'/'+_0x4b5d23)['json'](_0xcee25a);}return null;};}function patchUpdates(_0x57c997){return function(_0x375ce0){try{jsonpatch[_0x4d40('0x23')](_0x375ce0,_0x57c997,!![]);}catch(_0x4d52ce){return BPromise[_0x4d40('0x24')](_0x4d52ce);}return _0x375ce0[_0x4d40('0x25')]();};}function saveUpdates(_0x30f058,_0x5d4c24){return function(_0x356fd6){if(_0x356fd6){return _0x356fd6[_0x4d40('0x26')](_0x30f058)[_0x4d40('0x27')](function(_0x5ca0a0){return _0x5ca0a0;});}return null;};}function removeEntity(_0x4eebc3,_0x2df33a){return function(_0x90b652){if(_0x90b652){return _0x90b652[_0x4d40('0x28')]()[_0x4d40('0x27')](function(){_0x4eebc3[_0x4d40('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xbcd540,_0x1f5e5b){return function(_0x560df8){if(!_0x560df8){_0xbcd540['sendStatus'](0x194);}return _0x560df8;};}function handleError(_0x274d44,_0x2a0c82){_0x2a0c82=_0x2a0c82||0x1f4;return function(_0x3fa83e){logger[_0x4d40('0x29')](_0x3fa83e[_0x4d40('0x2a')]);if(_0x3fa83e[_0x4d40('0x2b')]){delete _0x3fa83e[_0x4d40('0x2b')];}_0x274d44[_0x4d40('0x1a')](_0x2a0c82)[_0x4d40('0x2c')](_0x3fa83e);};}exports[_0x4d40('0x2d')]=function(_0x1c0fcf,_0x4ca431){var _0x4e4e61={},_0x52f706={},_0x158a86={'count':0x0,'rows':[]};var _0x350488=_[_0x4d40('0x2e')](db[_0x4d40('0x2f')]['rawAttributes'],function(_0x18e601){return{'name':_0x18e601[_0x4d40('0x30')],'type':_0x18e601[_0x4d40('0x31')]['key']};});_0x52f706[_0x4d40('0x32')]=_[_0x4d40('0x2e')](_0x350488,_0x4d40('0x2b'));_0x52f706[_0x4d40('0x33')]=_[_0x4d40('0x34')](_0x1c0fcf['query']);_0x52f706[_0x4d40('0x35')]=_['intersection'](_0x52f706[_0x4d40('0x32')],_0x52f706[_0x4d40('0x33')]);_0x4e4e61[_0x4d40('0x36')]=_[_0x4d40('0x37')](_0x52f706['model'],qs['fields'](_0x1c0fcf[_0x4d40('0x33')][_0x4d40('0x38')]));_0x4e4e61[_0x4d40('0x36')]=_0x4e4e61[_0x4d40('0x36')]['length']?_0x4e4e61[_0x4d40('0x36')]:_0x52f706['model'];if(!_0x1c0fcf[_0x4d40('0x33')][_0x4d40('0x39')](_0x4d40('0x3a'))){_0x4e4e61[_0x4d40('0x1f')]=qs[_0x4d40('0x1f')](_0x1c0fcf[_0x4d40('0x33')][_0x4d40('0x1f')]);_0x4e4e61[_0x4d40('0x1d')]=qs[_0x4d40('0x1d')](_0x1c0fcf[_0x4d40('0x33')]['offset']);}_0x4e4e61[_0x4d40('0x3b')]=qs[_0x4d40('0x3c')](_0x1c0fcf['query']['sort']);_0x4e4e61['where']=qs[_0x4d40('0x35')](_[_0x4d40('0x3d')](_0x1c0fcf['query'],_0x52f706[_0x4d40('0x35')]),_0x350488);if(_0x1c0fcf[_0x4d40('0x33')][_0x4d40('0x3e')]){_0x4e4e61[_0x4d40('0x3f')]=_[_0x4d40('0x40')](_0x4e4e61['where'],{'$or':_[_0x4d40('0x2e')](_0x350488,function(_0x21a4ec){if(_0x21a4ec['type']!=='VIRTUAL'){var _0x3a4924={};_0x3a4924[_0x21a4ec[_0x4d40('0x2b')]]={'$like':'%'+_0x1c0fcf['query'][_0x4d40('0x3e')]+'%'};return _0x3a4924;}})});}_0x4e4e61=_[_0x4d40('0x40')]({},_0x4e4e61,_0x1c0fcf['options']);var _0x1e8427={'where':_0x4e4e61[_0x4d40('0x3f')]};return db['FreshdeskField'][_0x4d40('0x20')](_0x1e8427)[_0x4d40('0x27')](function(_0x4841ac){_0x158a86[_0x4d40('0x20')]=_0x4841ac;if(_0x1c0fcf['query'][_0x4d40('0x41')]){_0x4e4e61[_0x4d40('0x42')]=[{'all':!![]}];}return db[_0x4d40('0x2f')][_0x4d40('0x43')](_0x4e4e61);})[_0x4d40('0x27')](function(_0x2ef0ca){_0x158a86[_0x4d40('0x44')]=_0x2ef0ca;return _0x158a86;})[_0x4d40('0x27')](respondWithFilteredResult(_0x4ca431,_0x4e4e61))[_0x4d40('0x45')](handleError(_0x4ca431,null));};exports['show']=function(_0x250847,_0x3718a8){var _0x1c2fa8={'raw':!![],'where':{'id':_0x250847[_0x4d40('0x46')]['id']}},_0xcdde22={};_0xcdde22['model']=_[_0x4d40('0x34')](db['FreshdeskField'][_0x4d40('0x47')]);_0xcdde22[_0x4d40('0x33')]=_[_0x4d40('0x34')](_0x250847[_0x4d40('0x33')]);_0xcdde22['filters']=_[_0x4d40('0x37')](_0xcdde22[_0x4d40('0x32')],_0xcdde22['query']);_0x1c2fa8[_0x4d40('0x36')]=_['intersection'](_0xcdde22[_0x4d40('0x32')],qs[_0x4d40('0x38')](_0x250847[_0x4d40('0x33')][_0x4d40('0x38')]));_0x1c2fa8['attributes']=_0x1c2fa8[_0x4d40('0x36')]['length']?_0x1c2fa8[_0x4d40('0x36')]:_0xcdde22[_0x4d40('0x32')];if(_0x250847[_0x4d40('0x33')][_0x4d40('0x41')]){_0x1c2fa8['include']=[{'all':!![]}];}_0x1c2fa8=_[_0x4d40('0x40')]({},_0x1c2fa8,_0x250847[_0x4d40('0x48')]);return db[_0x4d40('0x2f')][_0x4d40('0x49')](_0x1c2fa8)['then'](handleEntityNotFound(_0x3718a8,null))[_0x4d40('0x27')](respondWithResult(_0x3718a8,null))[_0x4d40('0x45')](handleError(_0x3718a8,null));};exports['create']=function(_0x200d29,_0x493d8e){return db[_0x4d40('0x2f')][_0x4d40('0x4a')](_0x200d29[_0x4d40('0x4b')],{})[_0x4d40('0x27')](respondWithResult(_0x493d8e,0xc9))[_0x4d40('0x45')](handleError(_0x493d8e,null));};exports[_0x4d40('0x26')]=function(_0x30be7b,_0x37b6bf){if(_0x30be7b[_0x4d40('0x4b')]['id']){delete _0x30be7b['body']['id'];}return db[_0x4d40('0x2f')][_0x4d40('0x49')]({'where':{'id':_0x30be7b[_0x4d40('0x46')]['id']}})[_0x4d40('0x27')](handleEntityNotFound(_0x37b6bf,null))[_0x4d40('0x27')](saveUpdates(_0x30be7b['body'],null))[_0x4d40('0x27')](respondWithResult(_0x37b6bf,null))[_0x4d40('0x45')](handleError(_0x37b6bf,null));};exports['destroy']=function(_0xdf0235,_0x48ffd7){return db[_0x4d40('0x2f')][_0x4d40('0x49')]({'where':{'id':_0xdf0235[_0x4d40('0x46')]['id']}})['then'](handleEntityNotFound(_0x48ffd7,null))[_0x4d40('0x27')](removeEntity(_0x48ffd7,null))[_0x4d40('0x45')](handleError(_0x48ffd7,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index cd65b6c..37fb286 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 _0xd10b=['path','rimraf','./intFreshdeskField.attributes','exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1e9424,_0x191cba){var _0x1bd96c=function(_0x5e952d){while(--_0x5e952d){_0x1e9424['push'](_0x1e9424['shift']());}};_0x1bd96c(++_0x191cba);}(_0xd10b,0xf8));var _0xbd10=function(_0x1db831,_0x8725b6){_0x1db831=_0x1db831-0x0;var _0x5db8ad=_0xd10b[_0x1db831];return _0x5db8ad;};'use strict';var _=require(_0xbd10('0x0'));var util=require(_0xbd10('0x1'));var logger=require(_0xbd10('0x2'))(_0xbd10('0x3'));var moment=require(_0xbd10('0x4'));var BPromise=require(_0xbd10('0x5'));var rp=require(_0xbd10('0x6'));var fs=require('fs');var path=require(_0xbd10('0x7'));var rimraf=require(_0xbd10('0x8'));var config=require('../../config/environment');var attributes=require(_0xbd10('0x9'));module[_0xbd10('0xa')]=function(_0x12e5bd,_0x3e2ac8){return _0x12e5bd[_0xbd10('0xb')](_0xbd10('0xc'),attributes,{'tableName':_0xbd10('0xd'),'paranoid':![],'indexes':[{'name':_0xbd10('0xe'),'fields':[_0xbd10('0xf'),_0xbd10('0x10')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x48d7=['request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','FieldId','lodash','util','../../config/logger','moment','bluebird'];(function(_0x5eebf9,_0x3969b9){var _0x4bd465=function(_0x2d47f3){while(--_0x2d47f3){_0x5eebf9['push'](_0x5eebf9['shift']());}};_0x4bd465(++_0x3969b9);}(_0x48d7,0xfb));var _0x748d=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x48d7[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0x748d('0x0'));var util=require(_0x748d('0x1'));var logger=require(_0x748d('0x2'))('api');var moment=require(_0x748d('0x3'));var BPromise=require(_0x748d('0x4'));var rp=require(_0x748d('0x5'));var fs=require('fs');var path=require(_0x748d('0x6'));var rimraf=require(_0x748d('0x7'));var config=require(_0x748d('0x8'));var attributes=require(_0x748d('0x9'));module[_0x748d('0xa')]=function(_0x591eb9,_0x23a5ed){return _0x591eb9[_0x748d('0xb')](_0x748d('0xc'),attributes,{'tableName':_0x748d('0xd'),'paranoid':![],'indexes':[{'name':_0x748d('0xe'),'fields':['idField',_0x748d('0xf')],'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 1916265..acedcf1 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 _0x929e=['stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s'];(function(_0x156fa9,_0x2c4a0e){var _0x14dd7d=function(_0x20f7a4){while(--_0x20f7a4){_0x156fa9['push'](_0x156fa9['shift']());}};_0x14dd7d(++_0x2c4a0e);}(_0x929e,0x1bb));var _0xe929=function(_0x2128b4,_0x1514af){_0x2128b4=_0x2128b4-0x0;var _0x4b367a=_0x929e[_0x2128b4];return _0x4b367a;};'use strict';var _=require(_0xe929('0x0'));var util=require(_0xe929('0x1'));var moment=require(_0xe929('0x2'));var BPromise=require('bluebird');var rs=require(_0xe929('0x3'));var fs=require('fs');var Redis=require(_0xe929('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe929('0x5'))(_0xe929('0x6'));var config=require(_0xe929('0x7'));var jayson=require(_0xe929('0x8'));var client=jayson['client'][_0xe929('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x239d89,_0x109350,_0xe45523){return new BPromise(function(_0x2499df,_0x3b9caa){return client[_0xe929('0xa')](_0x239d89,_0xe45523)[_0xe929('0xb')](function(_0x230e27){logger[_0xe929('0xc')](_0xe929('0xd'),_0x109350,_0xe929('0xe'));logger[_0xe929('0xf')](_0xe929('0x10'),_0x109350,_0xe929('0xe'),JSON[_0xe929('0x11')](_0x230e27));if(_0x230e27[_0xe929('0x12')]){if(_0x230e27[_0xe929('0x12')][_0xe929('0x13')]===0x1f4){logger['error']('FreshdeskField,\x20%s,\x20%s',_0x109350,_0x230e27[_0xe929('0x12')][_0xe929('0x14')]);return _0x3b9caa(_0x230e27['error'][_0xe929('0x14')]);}logger[_0xe929('0x12')](_0xe929('0xd'),_0x109350,_0x230e27[_0xe929('0x12')]['message']);return _0x2499df(_0x230e27[_0xe929('0x12')][_0xe929('0x14')]);}else{logger[_0xe929('0xc')](_0xe929('0xd'),_0x109350,_0xe929('0xe'));_0x2499df(_0x230e27[_0xe929('0x15')][_0xe929('0x14')]);}})[_0xe929('0x16')](function(_0x29edf1){logger[_0xe929('0x12')](_0xe929('0xd'),_0x109350,_0x29edf1);_0x3b9caa(_0x29edf1);});});} \ No newline at end of file +var _0x90b8=['stringify','error','code','FreshdeskField,\x20%s,\x20%s','message','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','info','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s'];(function(_0x3a9cc6,_0x5a04f5){var _0x37084e=function(_0x77695){while(--_0x77695){_0x3a9cc6['push'](_0x3a9cc6['shift']());}};_0x37084e(++_0x5a04f5);}(_0x90b8,0x156));var _0x890b=function(_0x4fdc46,_0x2a3759){_0x4fdc46=_0x4fdc46-0x0;var _0x2c178a=_0x90b8[_0x4fdc46];return _0x2c178a;};'use strict';var _=require(_0x890b('0x0'));var util=require(_0x890b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x890b('0x2'));var fs=require('fs');var Redis=require(_0x890b('0x3'));var db=require(_0x890b('0x4'))['db'];var utils=require(_0x890b('0x5'));var logger=require(_0x890b('0x6'))(_0x890b('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x890b('0x8')][_0x890b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2ed096,_0x4a786d,_0x482fc3){return new BPromise(function(_0x44c313,_0x5a800f){return client[_0x890b('0xa')](_0x2ed096,_0x482fc3)['then'](function(_0x22bca2){logger[_0x890b('0xb')]('FreshdeskField,\x20%s,\x20%s',_0x4a786d,_0x890b('0xc'));logger[_0x890b('0xd')](_0x890b('0xe'),_0x4a786d,'request\x20sent',JSON[_0x890b('0xf')](_0x22bca2));if(_0x22bca2[_0x890b('0x10')]){if(_0x22bca2[_0x890b('0x10')][_0x890b('0x11')]===0x1f4){logger[_0x890b('0x10')](_0x890b('0x12'),_0x4a786d,_0x22bca2[_0x890b('0x10')]['message']);return _0x5a800f(_0x22bca2[_0x890b('0x10')][_0x890b('0x13')]);}logger[_0x890b('0x10')](_0x890b('0x12'),_0x4a786d,_0x22bca2[_0x890b('0x10')][_0x890b('0x13')]);return _0x44c313(_0x22bca2['error'][_0x890b('0x13')]);}else{logger['info'](_0x890b('0x12'),_0x4a786d,'request\x20sent');_0x44c313(_0x22bca2['result'][_0x890b('0x13')]);}})[_0x890b('0x14')](function(_0x2f1f8d){logger['error'](_0x890b('0x12'),_0x4a786d,_0x2f1f8d);_0x5a800f(_0x2f1f8d);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 4fa2284..d1d048f 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 _0x0565=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','post','create','delete','/:id','exports'];(function(_0xd52cba,_0x12ba30){var _0x59c1fe=function(_0x124c31){while(--_0x124c31){_0xd52cba['push'](_0xd52cba['shift']());}};_0x59c1fe(++_0x12ba30);}(_0x0565,0xf2));var _0x5056=function(_0x1b7368,_0x3286ed){_0x1b7368=_0x1b7368-0x0;var _0x25d54c=_0x0565[_0x1b7368];return _0x25d54c;};'use strict';var multer=require(_0x5056('0x0'));var util=require(_0x5056('0x1'));var path=require(_0x5056('0x2'));var timeout=require(_0x5056('0x3'));var express=require(_0x5056('0x4'));var router=express[_0x5056('0x5')]();var fs_extra=require(_0x5056('0x6'));var auth=require(_0x5056('0x7'));var interaction=require(_0x5056('0x8'));var config=require(_0x5056('0x9'));var controller=require('./intFreshsalesAccount.controller');router[_0x5056('0xa')]('/',auth[_0x5056('0xb')](),controller[_0x5056('0xc')]);router[_0x5056('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x5056('0xd')]);router[_0x5056('0xa')](_0x5056('0xe'),auth[_0x5056('0xb')](),controller[_0x5056('0xf')]);router[_0x5056('0xa')](_0x5056('0x10'),auth[_0x5056('0xb')](),controller['getFields']);router[_0x5056('0x11')]('/',auth[_0x5056('0xb')](),controller[_0x5056('0x12')]);router['post']('/:id/configurations',auth[_0x5056('0xb')](),controller['addConfiguration']);router['put']('/:id',auth[_0x5056('0xb')](),controller['update']);router[_0x5056('0x13')](_0x5056('0x14'),auth[_0x5056('0xb')](),controller['destroy']);module[_0x5056('0x15')]=router; \ No newline at end of file +var _0xa5fa=['connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','getFields','create','addConfiguration','put','update','destroy','exports','util','path'];(function(_0x18a224,_0x283450){var _0x5123a1=function(_0x203a5c){while(--_0x203a5c){_0x18a224['push'](_0x18a224['shift']());}};_0x5123a1(++_0x283450);}(_0xa5fa,0xc4));var _0xaa5f=function(_0x41601d,_0x36ad17){_0x41601d=_0x41601d-0x0;var _0x1d5fb2=_0xa5fa[_0x41601d];return _0x1d5fb2;};'use strict';var multer=require('multer');var util=require(_0xaa5f('0x0'));var path=require(_0xaa5f('0x1'));var timeout=require(_0xaa5f('0x2'));var express=require(_0xaa5f('0x3'));var router=express['Router']();var fs_extra=require(_0xaa5f('0x4'));var auth=require(_0xaa5f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xaa5f('0x6'));var controller=require(_0xaa5f('0x7'));router[_0xaa5f('0x8')]('/',auth[_0xaa5f('0x9')](),controller[_0xaa5f('0xa')]);router[_0xaa5f('0x8')](_0xaa5f('0xb'),auth[_0xaa5f('0x9')](),controller[_0xaa5f('0xc')]);router[_0xaa5f('0x8')](_0xaa5f('0xd'),auth['isAuthenticated'](),controller[_0xaa5f('0xe')]);router[_0xaa5f('0x8')]('/:id/fields',auth['isAuthenticated'](),controller[_0xaa5f('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xaa5f('0x10')]);router['post'](_0xaa5f('0xd'),auth[_0xaa5f('0x9')](),controller[_0xaa5f('0x11')]);router[_0xaa5f('0x12')](_0xaa5f('0xb'),auth['isAuthenticated'](),controller[_0xaa5f('0x13')]);router['delete'](_0xaa5f('0xb'),auth[_0xaa5f('0x9')](),controller[_0xaa5f('0x14')]);module[_0xaa5f('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 6900f59..e255565 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 _0x1eba=['exports','STRING','remoteUri','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x47e549,_0x2e53d6){_0x47e549=_0x47e549-0x0;var _0x251374=_0x1eba[_0x47e549];return _0x251374;};'use strict';var Sequelize=require(_0xa1eb('0x0'));module[_0xa1eb('0x1')]={'name':{'type':Sequelize[_0xa1eb('0x2')]},'description':{'type':Sequelize[_0xa1eb('0x2')]},'username':{'type':Sequelize[_0xa1eb('0x2')],'unique':'username'},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xa1eb('0x2')],'unique':_0xa1eb('0x3')},'serverUrl':{'type':Sequelize[_0xa1eb('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x8952=['username','remoteUri','exports','STRING'];(function(_0x701c5d,_0x47a566){var _0x617b08=function(_0x41409f){while(--_0x41409f){_0x701c5d['push'](_0x701c5d['shift']());}};_0x617b08(++_0x47a566);}(_0x8952,0x17e));var _0x2895=function(_0x4ee32e,_0x4b41a5){_0x4ee32e=_0x4ee32e-0x0;var _0x28ba92=_0x8952[_0x4ee32e];return _0x28ba92;};'use strict';var Sequelize=require('sequelize');module[_0x2895('0x0')]={'name':{'type':Sequelize[_0x2895('0x1')]},'description':{'type':Sequelize[_0x2895('0x1')]},'username':{'type':Sequelize[_0x2895('0x1')],'unique':_0x2895('0x2')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x2895('0x1')],'unique':_0x2895('0x3')},'serverUrl':{'type':Sequelize[_0x2895('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index 254b56e..bc5d9d4 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 _0x860d=['length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','fields','include','options','find','create','body','getConfigurations','findOne','FreshsalesConfiguration','addConfiguration','AccountId','Subjects','channel','getDescriptions','FreshsalesField','Descriptions','username','remoteUri','apiKey','slice','substring','lastIndexOf','GET','%s%s','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','FreshsalesAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x860d,0x17f));var _0xd860=function(_0x25a787,_0x6926e7){_0x25a787=_0x25a787-0x0;var _0x37712a=_0x860d[_0x25a787];return _0x37712a;};'use strict';var emlformat=require(_0xd860('0x0'));var rimraf=require(_0xd860('0x1'));var zipdir=require(_0xd860('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd860('0x3'));var moment=require(_0xd860('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd860('0x5'));var util=require(_0xd860('0x6'));var path=require(_0xd860('0x7'));var sox=require(_0xd860('0x8'));var csv=require('to-csv');var ejs=require(_0xd860('0x9'));var fs=require('fs');var fs_extra=require(_0xd860('0xa'));var _=require(_0xd860('0xb'));var squel=require(_0xd860('0xc'));var crypto=require(_0xd860('0xd'));var jsforce=require(_0xd860('0xe'));var deskjs=require(_0xd860('0xf'));var toCsv=require(_0xd860('0x10'));var querystring=require(_0xd860('0x11'));var Papa=require(_0xd860('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd860('0x13'));var as=require(_0xd860('0x14'));var hardwareService=require(_0xd860('0x15'));var logger=require(_0xd860('0x16'))(_0xd860('0x17'));var utils=require(_0xd860('0x18'));var config=require(_0xd860('0x19'));var licenseUtil=require(_0xd860('0x1a'));var db=require(_0xd860('0x1b'))['db'];var integrations=require(_0xd860('0x1c'));function respondWithStatusCode(_0x550447,_0x3d5aae){_0x3d5aae=_0x3d5aae||0xcc;return function(_0x176382){if(_0x176382){return _0x550447[_0xd860('0x1d')](_0x3d5aae);}return _0x550447['status'](_0x3d5aae)[_0xd860('0x1e')]();};}function respondWithResult(_0x43c12a,_0x125338){_0x125338=_0x125338||0xc8;return function(_0x5bbc3b){if(_0x5bbc3b){return _0x43c12a[_0xd860('0x1f')](_0x125338)[_0xd860('0x20')](_0x5bbc3b);}};}function respondWithFilteredResult(_0xb28d7c,_0x359408){return function(_0x1ec7be){if(_0x1ec7be){var _0x49851e=typeof _0x359408[_0xd860('0x21')]===_0xd860('0x22')&&typeof _0x359408[_0xd860('0x23')]==='undefined';var _0x240d93=_0x1ec7be['count'];var _0x2c4761=_0x49851e?0x0:_0x359408[_0xd860('0x21')];var _0x59c62c=_0x49851e?_0x1ec7be[_0xd860('0x24')]:_0x359408[_0xd860('0x21')]+_0x359408[_0xd860('0x23')];var _0x16edf5;if(_0x59c62c>=_0x240d93){_0x59c62c=_0x240d93;_0x16edf5=0xc8;}else{_0x16edf5=0xce;}_0xb28d7c[_0xd860('0x1f')](_0x16edf5);return _0xb28d7c[_0xd860('0x25')]('Content-Range',_0x2c4761+'-'+_0x59c62c+'/'+_0x240d93)[_0xd860('0x20')](_0x1ec7be);}return null;};}function patchUpdates(_0x2d649a){return function(_0x15bcb1){try{jsonpatch[_0xd860('0x26')](_0x15bcb1,_0x2d649a,!![]);}catch(_0x102b30){return BPromise[_0xd860('0x27')](_0x102b30);}return _0x15bcb1[_0xd860('0x28')]();};}function saveUpdates(_0x4f95a4,_0x233de5){return function(_0x41b3ad){if(_0x41b3ad){return _0x41b3ad[_0xd860('0x29')](_0x4f95a4)[_0xd860('0x2a')](function(_0x3fa008){return _0x3fa008;});}return null;};}function removeEntity(_0x1cc1d2,_0x4d8a33){return function(_0x3ddeac){if(_0x3ddeac){return _0x3ddeac[_0xd860('0x2b')]()[_0xd860('0x2a')](function(){_0x1cc1d2[_0xd860('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x20b9a6,_0x1af087){return function(_0x300f6c){if(!_0x300f6c){_0x20b9a6[_0xd860('0x1d')](0x194);}return _0x300f6c;};}function handleError(_0x2e8616,_0x380a23){_0x380a23=_0x380a23||0x1f4;return function(_0x3b877e){logger[_0xd860('0x2c')](_0x3b877e[_0xd860('0x2d')]);if(_0x3b877e[_0xd860('0x2e')]){delete _0x3b877e[_0xd860('0x2e')];}_0x2e8616['status'](_0x380a23)[_0xd860('0x2f')](_0x3b877e);};}exports[_0xd860('0x30')]=function(_0x9b8c6b,_0x4c590a){var _0x692ccd={},_0x14370f={},_0x27f7d9={'count':0x0,'rows':[]};var _0x9371ea=_[_0xd860('0x31')](db[_0xd860('0x32')][_0xd860('0x33')],function(_0x4ea8c5){return{'name':_0x4ea8c5[_0xd860('0x34')],'type':_0x4ea8c5[_0xd860('0x35')][_0xd860('0x36')]};});_0x14370f[_0xd860('0x37')]=_[_0xd860('0x31')](_0x9371ea,_0xd860('0x2e'));_0x14370f[_0xd860('0x38')]=_[_0xd860('0x39')](_0x9b8c6b[_0xd860('0x38')]);_0x14370f[_0xd860('0x3a')]=_[_0xd860('0x3b')](_0x14370f['model'],_0x14370f['query']);_0x692ccd[_0xd860('0x3c')]=_[_0xd860('0x3b')](_0x14370f[_0xd860('0x37')],qs['fields'](_0x9b8c6b['query']['fields']));_0x692ccd[_0xd860('0x3c')]=_0x692ccd[_0xd860('0x3c')][_0xd860('0x3d')]?_0x692ccd[_0xd860('0x3c')]:_0x14370f[_0xd860('0x37')];if(!_0x9b8c6b[_0xd860('0x38')][_0xd860('0x3e')](_0xd860('0x3f'))){_0x692ccd[_0xd860('0x23')]=qs[_0xd860('0x23')](_0x9b8c6b[_0xd860('0x38')][_0xd860('0x23')]);_0x692ccd[_0xd860('0x21')]=qs[_0xd860('0x21')](_0x9b8c6b[_0xd860('0x38')][_0xd860('0x21')]);}_0x692ccd[_0xd860('0x40')]=qs[_0xd860('0x41')](_0x9b8c6b[_0xd860('0x38')][_0xd860('0x41')]);_0x692ccd[_0xd860('0x42')]=qs[_0xd860('0x3a')](_[_0xd860('0x43')](_0x9b8c6b[_0xd860('0x38')],_0x14370f[_0xd860('0x3a')]),_0x9371ea);if(_0x9b8c6b['query'][_0xd860('0x44')]){_0x692ccd['where']=_[_0xd860('0x45')](_0x692ccd[_0xd860('0x42')],{'$or':_[_0xd860('0x31')](_0x9371ea,function(_0x26d1a2){if(_0x26d1a2[_0xd860('0x35')]!==_0xd860('0x46')){var _0x464952={};_0x464952[_0x26d1a2[_0xd860('0x2e')]]={'$like':'%'+_0x9b8c6b[_0xd860('0x38')][_0xd860('0x44')]+'%'};return _0x464952;}})});}_0x692ccd=_[_0xd860('0x45')]({},_0x692ccd,_0x9b8c6b['options']);var _0x264d72={'where':_0x692ccd[_0xd860('0x42')]};return db[_0xd860('0x32')][_0xd860('0x24')](_0x264d72)[_0xd860('0x2a')](function(_0xb4204b){_0x27f7d9['count']=_0xb4204b;if(_0x9b8c6b['query'][_0xd860('0x47')]){_0x692ccd['include']=[{'all':!![]}];}return db[_0xd860('0x32')][_0xd860('0x48')](_0x692ccd);})[_0xd860('0x2a')](function(_0x4c8134){_0x27f7d9[_0xd860('0x49')]=_0x4c8134;return _0x27f7d9;})[_0xd860('0x2a')](respondWithFilteredResult(_0x4c590a,_0x692ccd))[_0xd860('0x4a')](handleError(_0x4c590a,null));};exports[_0xd860('0x4b')]=function(_0x43e195,_0x269b26){var _0x5069f6={'raw':![],'where':{'id':_0x43e195[_0xd860('0x4c')]['id']}},_0x228062={};_0x228062[_0xd860('0x37')]=_[_0xd860('0x39')](db[_0xd860('0x32')]['rawAttributes']);_0x228062[_0xd860('0x38')]=_[_0xd860('0x39')](_0x43e195[_0xd860('0x38')]);_0x228062[_0xd860('0x3a')]=_[_0xd860('0x3b')](_0x228062[_0xd860('0x37')],_0x228062[_0xd860('0x38')]);_0x5069f6[_0xd860('0x3c')]=_[_0xd860('0x3b')](_0x228062[_0xd860('0x37')],qs['fields'](_0x43e195[_0xd860('0x38')][_0xd860('0x4d')]));_0x5069f6[_0xd860('0x3c')]=_0x5069f6[_0xd860('0x3c')][_0xd860('0x3d')]?_0x5069f6[_0xd860('0x3c')]:_0x228062['model'];if(_0x43e195[_0xd860('0x38')][_0xd860('0x47')]){_0x5069f6[_0xd860('0x4e')]=[{'all':!![]}];}_0x5069f6=_['merge']({},_0x5069f6,_0x43e195[_0xd860('0x4f')]);return db[_0xd860('0x32')][_0xd860('0x50')](_0x5069f6)['then'](handleEntityNotFound(_0x269b26,null))[_0xd860('0x2a')](respondWithResult(_0x269b26,null))['catch'](handleError(_0x269b26,null));};exports[_0xd860('0x51')]=function(_0x248209,_0x35d485){return db[_0xd860('0x32')]['create'](_0x248209['body'],{})['then'](respondWithResult(_0x35d485,0xc9))[_0xd860('0x4a')](handleError(_0x35d485,null));};exports[_0xd860('0x29')]=function(_0x21679c,_0x443bfa){if(_0x21679c[_0xd860('0x52')]['id']){delete _0x21679c['body']['id'];}return db['FreshsalesAccount'][_0xd860('0x50')]({'where':{'id':_0x21679c['params']['id']}})['then'](handleEntityNotFound(_0x443bfa,null))[_0xd860('0x2a')](saveUpdates(_0x21679c[_0xd860('0x52')],null))[_0xd860('0x2a')](respondWithResult(_0x443bfa,null))[_0xd860('0x4a')](handleError(_0x443bfa,null));};exports['destroy']=function(_0x24ef3d,_0x9ae47a){return db[_0xd860('0x32')][_0xd860('0x50')]({'where':{'id':_0x24ef3d['params']['id']}})[_0xd860('0x2a')](handleEntityNotFound(_0x9ae47a,null))[_0xd860('0x2a')](removeEntity(_0x9ae47a,null))[_0xd860('0x4a')](handleError(_0x9ae47a,null));};exports[_0xd860('0x53')]=function(_0x5cb839,_0x1cb888,_0x523154){var _0x4a3c71={};var _0x30b949={};var _0x82d638;var _0x32453d;return db[_0xd860('0x32')][_0xd860('0x54')]({'where':{'id':_0x5cb839[_0xd860('0x4c')]['id']}})[_0xd860('0x2a')](handleEntityNotFound(_0x1cb888,null))[_0xd860('0x2a')](function(_0x3998ac){if(_0x3998ac){_0x82d638=_0x3998ac;_0x30b949[_0xd860('0x37')]=_['keys'](db[_0xd860('0x55')][_0xd860('0x33')]);_0x30b949[_0xd860('0x38')]=_[_0xd860('0x39')](_0x5cb839[_0xd860('0x38')]);_0x30b949[_0xd860('0x3a')]=_[_0xd860('0x3b')](_0x30b949[_0xd860('0x37')],_0x30b949[_0xd860('0x38')]);_0x4a3c71[_0xd860('0x3c')]=_['intersection'](_0x30b949[_0xd860('0x37')],qs[_0xd860('0x4d')](_0x5cb839['query'][_0xd860('0x4d')]));_0x4a3c71['attributes']=_0x4a3c71[_0xd860('0x3c')]['length']?_0x4a3c71[_0xd860('0x3c')]:_0x30b949['model'];_0x4a3c71[_0xd860('0x40')]=qs[_0xd860('0x41')](_0x5cb839[_0xd860('0x38')][_0xd860('0x41')]);_0x4a3c71[_0xd860('0x42')]=qs[_0xd860('0x3a')](_[_0xd860('0x43')](_0x5cb839['query'],_0x30b949[_0xd860('0x3a')]));if(_0x5cb839['query']['filter']){_0x4a3c71[_0xd860('0x42')]=_[_0xd860('0x45')](_0x4a3c71['where'],{'$or':_['map'](_0x4a3c71[_0xd860('0x3c')],function(_0xac2059){var _0x47e69f={};_0x47e69f[_0xac2059]={'$like':'%'+_0x5cb839[_0xd860('0x38')][_0xd860('0x44')]+'%'};return _0x47e69f;})});}_0x4a3c71=_['merge']({},_0x4a3c71,_0x5cb839[_0xd860('0x4f')]);return _0x82d638[_0xd860('0x53')](_0x4a3c71);}})['then'](function(_0x12a87f){if(_0x12a87f){_0x32453d=_0x12a87f[_0xd860('0x3d')];if(!_0x5cb839['query'][_0xd860('0x3e')](_0xd860('0x3f'))){_0x4a3c71[_0xd860('0x23')]=qs['limit'](_0x5cb839[_0xd860('0x38')][_0xd860('0x23')]);_0x4a3c71[_0xd860('0x21')]=qs['offset'](_0x5cb839['query'][_0xd860('0x21')]);}return _0x82d638[_0xd860('0x53')](_0x4a3c71);}})[_0xd860('0x2a')](function(_0x4829ef){if(_0x4829ef){return _0x4829ef?{'count':_0x32453d,'rows':_0x4829ef}:null;}})[_0xd860('0x2a')](respondWithResult(_0x1cb888,null))[_0xd860('0x4a')](handleError(_0x1cb888,null));};exports[_0xd860('0x56')]=function(_0x133da6,_0x591814,_0xa8755e){if(_0x133da6['body']['id']){delete _0x133da6[_0xd860('0x52')]['id'];}return db['FreshsalesAccount']['findOne']({'where':{'id':_0x133da6['params']['id']}})[_0xd860('0x2a')](handleEntityNotFound(_0x591814,null))[_0xd860('0x2a')](function(_0x22075c){if(_0x22075c){_0x133da6[_0xd860('0x52')][_0xd860('0x57')]=_0x22075c['id'];_0x133da6[_0xd860('0x52')][_0xd860('0x58')]=integrations['getSubjects'](_0x133da6[_0xd860('0x52')][_0xd860('0x59')],_0x133da6['body']['type']);_0x133da6[_0xd860('0x52')]['Descriptions']=integrations[_0xd860('0x5a')](_0x133da6[_0xd860('0x52')]['channel'],_0x133da6[_0xd860('0x52')][_0xd860('0x35')]);return db[_0xd860('0x55')][_0xd860('0x51')](_0x133da6['body'],{'include':[{'model':db[_0xd860('0x5b')],'as':'Subjects'},{'model':db[_0xd860('0x5b')],'as':_0xd860('0x5c')}]});}return null;})['then'](respondWithResult(_0x591814,null))[_0xd860('0x4a')](handleError(_0x591814,null));};exports['getFields']=function(_0x5199ca,_0xcdb435,_0x1aeff2){var _0x78c556='';var _0x3e52df='';return db[_0xd860('0x32')][_0xd860('0x54')]({'where':{'id':_0x5199ca[_0xd860('0x4c')]['id']},'attributes':['id',_0xd860('0x5d'),_0xd860('0x5e'),_0xd860('0x5f')]})[_0xd860('0x2a')](handleEntityNotFound(_0xcdb435,null))[_0xd860('0x2a')](function(_0x4964c8){if(_0x4964c8){_0x3e52df=_0x4964c8[_0xd860('0x5d')];_0x78c556=_0x4964c8[_0xd860('0x5e')];var _0xed3e42=_0x4964c8['remoteUri'][_0xd860('0x60')](-0x1);if(_0xed3e42==='/'){_0x78c556=_0x78c556[_0xd860('0x61')](0x0,_0x78c556[_0xd860('0x62')](_0xed3e42));}return rp({'method':_0xd860('0x63'),'uri':util['format'](_0xd860('0x64'),_0x78c556,_0xd860('0x65')),'headers':{'Authorization':_0xd860('0x66')+_0x4964c8[_0xd860('0x5f')]},'json':!![]});}})['then'](function(_0xfdccde){if(_0xfdccde){var _0x59e3a6=_0xfdccde[_0xd860('0x67')];var _0x18c159=![];var _0x1b051e=null;for(_0x1b051e=0x0;_0x1b051e<_0x59e3a6['length'];_0x1b051e++){if(_0x59e3a6[_0x1b051e][_0xd860('0x68')]===_0x3e52df){_0x18c159=!![];}}if(_0x18c159){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xd860('0x69')});}}})['then'](respondWithResult(_0xcdb435,null))[_0xd860('0x4a')](function(_0x3d3306){var _0x3fbf85=_0x5199ca[_0xd860('0x38')][_0xd860('0x6a')]?0x1f4:_0x3d3306[_0xd860('0x6b')]||0x1f4;logger['error'](_0xd860('0x6c'),_0xd860('0x6d'),_0x3fbf85,JSON[_0xd860('0x6e')](_0x3d3306));delete _0x3d3306[_0xd860('0x2e')];if(_0x3fbf85===0x191){_0x3fbf85=0x190;}_0xcdb435['status'](_0x3fbf85)[_0xd860('0x2f')](_0x5199ca[_0xd860('0x38')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x3d3306[_0xd860('0x6b')]}:_0x3d3306);});}; \ No newline at end of file +var _0xaeb3=['VIRTUAL','merge','includeAll','include','rows','catch','show','params','options','create','body','destroy','length','pick','getConfigurations','hasOwnProperty','nolimit','addConfiguration','findOne','channel','Descriptions','FreshsalesField','Subjects','username','remoteUri','apiKey','lastIndexOf','GET','%s%s','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','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','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','reject','save','update','then','name','index','map','FreshsalesAccount','rawAttributes','fieldName','type','key','keys','filters','intersection','model','query','fields','attributes','order','sort','where','filter'];(function(_0x3ba3a4,_0x17c317){var _0x1bb041=function(_0x3821df){while(--_0x3821df){_0x3ba3a4['push'](_0x3ba3a4['shift']());}};_0x1bb041(++_0x17c317);}(_0xaeb3,0x8e));var _0x3aeb=function(_0x10a08d,_0x1bab5d){_0x10a08d=_0x10a08d-0x0;var _0x27abcc=_0xaeb3[_0x10a08d];return _0x27abcc;};'use strict';var emlformat=require(_0x3aeb('0x0'));var rimraf=require(_0x3aeb('0x1'));var zipdir=require(_0x3aeb('0x2'));var jsonpatch=require(_0x3aeb('0x3'));var rp=require(_0x3aeb('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3aeb('0x5'));var util=require(_0x3aeb('0x6'));var path=require(_0x3aeb('0x7'));var sox=require(_0x3aeb('0x8'));var csv=require(_0x3aeb('0x9'));var ejs=require(_0x3aeb('0xa'));var fs=require('fs');var fs_extra=require(_0x3aeb('0xb'));var _=require(_0x3aeb('0xc'));var squel=require(_0x3aeb('0xd'));var crypto=require(_0x3aeb('0xe'));var jsforce=require(_0x3aeb('0xf'));var deskjs=require(_0x3aeb('0x10'));var toCsv=require(_0x3aeb('0x9'));var querystring=require(_0x3aeb('0x11'));var Papa=require('papaparse');var Redis=require(_0x3aeb('0x12'));var authService=require(_0x3aeb('0x13'));var qs=require(_0x3aeb('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3aeb('0x15'));var logger=require(_0x3aeb('0x16'))('api');var utils=require(_0x3aeb('0x17'));var config=require(_0x3aeb('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x3aeb('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x422220,_0x8e1fa0){_0x8e1fa0=_0x8e1fa0||0xcc;return function(_0x22f9b1){if(_0x22f9b1){return _0x422220[_0x3aeb('0x1a')](_0x8e1fa0);}return _0x422220[_0x3aeb('0x1b')](_0x8e1fa0)[_0x3aeb('0x1c')]();};}function respondWithResult(_0x508bc2,_0x23556f){_0x23556f=_0x23556f||0xc8;return function(_0x49819c){if(_0x49819c){return _0x508bc2[_0x3aeb('0x1b')](_0x23556f)[_0x3aeb('0x1d')](_0x49819c);}};}function respondWithFilteredResult(_0x3c4dad,_0x3a9b25){return function(_0x5b566f){if(_0x5b566f){var _0xb559a2=typeof _0x3a9b25[_0x3aeb('0x1e')]==='undefined'&&typeof _0x3a9b25[_0x3aeb('0x1f')]===_0x3aeb('0x20');var _0x11ce11=_0x5b566f[_0x3aeb('0x21')];var _0x1aee1f=_0xb559a2?0x0:_0x3a9b25['offset'];var _0x4c1459=_0xb559a2?_0x5b566f[_0x3aeb('0x21')]:_0x3a9b25[_0x3aeb('0x1e')]+_0x3a9b25[_0x3aeb('0x1f')];var _0x3b124a;if(_0x4c1459>=_0x11ce11){_0x4c1459=_0x11ce11;_0x3b124a=0xc8;}else{_0x3b124a=0xce;}_0x3c4dad[_0x3aeb('0x1b')](_0x3b124a);return _0x3c4dad[_0x3aeb('0x22')]('Content-Range',_0x1aee1f+'-'+_0x4c1459+'/'+_0x11ce11)['json'](_0x5b566f);}return null;};}function patchUpdates(_0xa43bb){return function(_0x5dda7c){try{jsonpatch['apply'](_0x5dda7c,_0xa43bb,!![]);}catch(_0x5b4bd6){return BPromise[_0x3aeb('0x23')](_0x5b4bd6);}return _0x5dda7c[_0x3aeb('0x24')]();};}function saveUpdates(_0x40cffa,_0xf32e0a){return function(_0x291881){if(_0x291881){return _0x291881[_0x3aeb('0x25')](_0x40cffa)['then'](function(_0x2554c3){return _0x2554c3;});}return null;};}function removeEntity(_0x452e91,_0x253ed1){return function(_0x118dd9){if(_0x118dd9){return _0x118dd9['destroy']()[_0x3aeb('0x26')](function(){_0x452e91[_0x3aeb('0x1b')](0xcc)[_0x3aeb('0x1c')]();});}};}function handleEntityNotFound(_0x269389,_0x200b5d){return function(_0x4df06b){if(!_0x4df06b){_0x269389['sendStatus'](0x194);}return _0x4df06b;};}function handleError(_0xcb0b56,_0x25c44f){_0x25c44f=_0x25c44f||0x1f4;return function(_0x30f56d){logger['error'](_0x30f56d['stack']);if(_0x30f56d['name']){delete _0x30f56d[_0x3aeb('0x27')];}_0xcb0b56[_0x3aeb('0x1b')](_0x25c44f)['send'](_0x30f56d);};}exports[_0x3aeb('0x28')]=function(_0x13f5b9,_0xb291f7){var _0xf57252={},_0x30622c={},_0x2f2193={'count':0x0,'rows':[]};var _0x2945fc=_[_0x3aeb('0x29')](db[_0x3aeb('0x2a')][_0x3aeb('0x2b')],function(_0x64515c){return{'name':_0x64515c[_0x3aeb('0x2c')],'type':_0x64515c[_0x3aeb('0x2d')][_0x3aeb('0x2e')]};});_0x30622c['model']=_[_0x3aeb('0x29')](_0x2945fc,_0x3aeb('0x27'));_0x30622c['query']=_[_0x3aeb('0x2f')](_0x13f5b9['query']);_0x30622c[_0x3aeb('0x30')]=_[_0x3aeb('0x31')](_0x30622c[_0x3aeb('0x32')],_0x30622c[_0x3aeb('0x33')]);_0xf57252['attributes']=_[_0x3aeb('0x31')](_0x30622c[_0x3aeb('0x32')],qs[_0x3aeb('0x34')](_0x13f5b9[_0x3aeb('0x33')][_0x3aeb('0x34')]));_0xf57252['attributes']=_0xf57252['attributes']['length']?_0xf57252[_0x3aeb('0x35')]:_0x30622c[_0x3aeb('0x32')];if(!_0x13f5b9[_0x3aeb('0x33')]['hasOwnProperty']('nolimit')){_0xf57252[_0x3aeb('0x1f')]=qs[_0x3aeb('0x1f')](_0x13f5b9[_0x3aeb('0x33')][_0x3aeb('0x1f')]);_0xf57252[_0x3aeb('0x1e')]=qs[_0x3aeb('0x1e')](_0x13f5b9['query'][_0x3aeb('0x1e')]);}_0xf57252[_0x3aeb('0x36')]=qs[_0x3aeb('0x37')](_0x13f5b9['query'][_0x3aeb('0x37')]);_0xf57252[_0x3aeb('0x38')]=qs['filters'](_['pick'](_0x13f5b9['query'],_0x30622c[_0x3aeb('0x30')]),_0x2945fc);if(_0x13f5b9[_0x3aeb('0x33')][_0x3aeb('0x39')]){_0xf57252[_0x3aeb('0x38')]=_['merge'](_0xf57252[_0x3aeb('0x38')],{'$or':_[_0x3aeb('0x29')](_0x2945fc,function(_0x148ed0){if(_0x148ed0[_0x3aeb('0x2d')]!==_0x3aeb('0x3a')){var _0x47b3a7={};_0x47b3a7[_0x148ed0[_0x3aeb('0x27')]]={'$like':'%'+_0x13f5b9[_0x3aeb('0x33')]['filter']+'%'};return _0x47b3a7;}})});}_0xf57252=_[_0x3aeb('0x3b')]({},_0xf57252,_0x13f5b9['options']);var _0x2bd366={'where':_0xf57252[_0x3aeb('0x38')]};return db[_0x3aeb('0x2a')]['count'](_0x2bd366)[_0x3aeb('0x26')](function(_0x221edf){_0x2f2193['count']=_0x221edf;if(_0x13f5b9[_0x3aeb('0x33')][_0x3aeb('0x3c')]){_0xf57252[_0x3aeb('0x3d')]=[{'all':!![]}];}return db['FreshsalesAccount']['findAll'](_0xf57252);})['then'](function(_0x164f3d){_0x2f2193[_0x3aeb('0x3e')]=_0x164f3d;return _0x2f2193;})['then'](respondWithFilteredResult(_0xb291f7,_0xf57252))[_0x3aeb('0x3f')](handleError(_0xb291f7,null));};exports[_0x3aeb('0x40')]=function(_0x4ea45d,_0x34948a){var _0xe0f076={'raw':![],'where':{'id':_0x4ea45d[_0x3aeb('0x41')]['id']}},_0x337d31={};_0x337d31[_0x3aeb('0x32')]=_['keys'](db[_0x3aeb('0x2a')]['rawAttributes']);_0x337d31['query']=_[_0x3aeb('0x2f')](_0x4ea45d['query']);_0x337d31[_0x3aeb('0x30')]=_[_0x3aeb('0x31')](_0x337d31[_0x3aeb('0x32')],_0x337d31[_0x3aeb('0x33')]);_0xe0f076['attributes']=_[_0x3aeb('0x31')](_0x337d31[_0x3aeb('0x32')],qs['fields'](_0x4ea45d['query'][_0x3aeb('0x34')]));_0xe0f076[_0x3aeb('0x35')]=_0xe0f076['attributes']['length']?_0xe0f076[_0x3aeb('0x35')]:_0x337d31[_0x3aeb('0x32')];if(_0x4ea45d['query'][_0x3aeb('0x3c')]){_0xe0f076[_0x3aeb('0x3d')]=[{'all':!![]}];}_0xe0f076=_[_0x3aeb('0x3b')]({},_0xe0f076,_0x4ea45d[_0x3aeb('0x42')]);return db['FreshsalesAccount']['find'](_0xe0f076)[_0x3aeb('0x26')](handleEntityNotFound(_0x34948a,null))[_0x3aeb('0x26')](respondWithResult(_0x34948a,null))[_0x3aeb('0x3f')](handleError(_0x34948a,null));};exports[_0x3aeb('0x43')]=function(_0x355b3d,_0x1aad5b){return db['FreshsalesAccount'][_0x3aeb('0x43')](_0x355b3d['body'],{})[_0x3aeb('0x26')](respondWithResult(_0x1aad5b,0xc9))[_0x3aeb('0x3f')](handleError(_0x1aad5b,null));};exports[_0x3aeb('0x25')]=function(_0x1a83b2,_0xace53){if(_0x1a83b2['body']['id']){delete _0x1a83b2[_0x3aeb('0x44')]['id'];}return db[_0x3aeb('0x2a')]['find']({'where':{'id':_0x1a83b2[_0x3aeb('0x41')]['id']}})[_0x3aeb('0x26')](handleEntityNotFound(_0xace53,null))['then'](saveUpdates(_0x1a83b2[_0x3aeb('0x44')],null))['then'](respondWithResult(_0xace53,null))['catch'](handleError(_0xace53,null));};exports[_0x3aeb('0x45')]=function(_0x1bc9cf,_0x4cabf7){return db[_0x3aeb('0x2a')]['find']({'where':{'id':_0x1bc9cf[_0x3aeb('0x41')]['id']}})[_0x3aeb('0x26')](handleEntityNotFound(_0x4cabf7,null))[_0x3aeb('0x26')](removeEntity(_0x4cabf7,null))[_0x3aeb('0x3f')](handleError(_0x4cabf7,null));};exports['getConfigurations']=function(_0x2168c1,_0x476667,_0x21d0b2){var _0x5698e0={};var _0x1a1834={};var _0x1d7db7;var _0x317a1b;return db[_0x3aeb('0x2a')]['findOne']({'where':{'id':_0x2168c1[_0x3aeb('0x41')]['id']}})[_0x3aeb('0x26')](handleEntityNotFound(_0x476667,null))['then'](function(_0x56e124){if(_0x56e124){_0x1d7db7=_0x56e124;_0x1a1834['model']=_[_0x3aeb('0x2f')](db['FreshsalesConfiguration'][_0x3aeb('0x2b')]);_0x1a1834[_0x3aeb('0x33')]=_[_0x3aeb('0x2f')](_0x2168c1[_0x3aeb('0x33')]);_0x1a1834[_0x3aeb('0x30')]=_[_0x3aeb('0x31')](_0x1a1834['model'],_0x1a1834[_0x3aeb('0x33')]);_0x5698e0['attributes']=_['intersection'](_0x1a1834[_0x3aeb('0x32')],qs['fields'](_0x2168c1[_0x3aeb('0x33')][_0x3aeb('0x34')]));_0x5698e0[_0x3aeb('0x35')]=_0x5698e0[_0x3aeb('0x35')][_0x3aeb('0x46')]?_0x5698e0[_0x3aeb('0x35')]:_0x1a1834[_0x3aeb('0x32')];_0x5698e0[_0x3aeb('0x36')]=qs[_0x3aeb('0x37')](_0x2168c1[_0x3aeb('0x33')][_0x3aeb('0x37')]);_0x5698e0[_0x3aeb('0x38')]=qs[_0x3aeb('0x30')](_[_0x3aeb('0x47')](_0x2168c1['query'],_0x1a1834[_0x3aeb('0x30')]));if(_0x2168c1[_0x3aeb('0x33')][_0x3aeb('0x39')]){_0x5698e0[_0x3aeb('0x38')]=_['merge'](_0x5698e0['where'],{'$or':_['map'](_0x5698e0['attributes'],function(_0x581b69){var _0x47feef={};_0x47feef[_0x581b69]={'$like':'%'+_0x2168c1[_0x3aeb('0x33')][_0x3aeb('0x39')]+'%'};return _0x47feef;})});}_0x5698e0=_[_0x3aeb('0x3b')]({},_0x5698e0,_0x2168c1[_0x3aeb('0x42')]);return _0x1d7db7[_0x3aeb('0x48')](_0x5698e0);}})['then'](function(_0x1690b8){if(_0x1690b8){_0x317a1b=_0x1690b8['length'];if(!_0x2168c1[_0x3aeb('0x33')][_0x3aeb('0x49')](_0x3aeb('0x4a'))){_0x5698e0[_0x3aeb('0x1f')]=qs[_0x3aeb('0x1f')](_0x2168c1[_0x3aeb('0x33')]['limit']);_0x5698e0['offset']=qs[_0x3aeb('0x1e')](_0x2168c1[_0x3aeb('0x33')][_0x3aeb('0x1e')]);}return _0x1d7db7['getConfigurations'](_0x5698e0);}})['then'](function(_0x1c4ff8){if(_0x1c4ff8){return _0x1c4ff8?{'count':_0x317a1b,'rows':_0x1c4ff8}:null;}})[_0x3aeb('0x26')](respondWithResult(_0x476667,null))[_0x3aeb('0x3f')](handleError(_0x476667,null));};exports[_0x3aeb('0x4b')]=function(_0x8b869d,_0x493a2f,_0x1d246f){if(_0x8b869d[_0x3aeb('0x44')]['id']){delete _0x8b869d['body']['id'];}return db['FreshsalesAccount'][_0x3aeb('0x4c')]({'where':{'id':_0x8b869d['params']['id']}})[_0x3aeb('0x26')](handleEntityNotFound(_0x493a2f,null))['then'](function(_0x1953fd){if(_0x1953fd){_0x8b869d[_0x3aeb('0x44')]['AccountId']=_0x1953fd['id'];_0x8b869d['body']['Subjects']=integrations['getSubjects'](_0x8b869d['body'][_0x3aeb('0x4d')],_0x8b869d['body'][_0x3aeb('0x2d')]);_0x8b869d[_0x3aeb('0x44')][_0x3aeb('0x4e')]=integrations['getDescriptions'](_0x8b869d[_0x3aeb('0x44')][_0x3aeb('0x4d')],_0x8b869d[_0x3aeb('0x44')][_0x3aeb('0x2d')]);return db['FreshsalesConfiguration'][_0x3aeb('0x43')](_0x8b869d[_0x3aeb('0x44')],{'include':[{'model':db[_0x3aeb('0x4f')],'as':_0x3aeb('0x50')},{'model':db[_0x3aeb('0x4f')],'as':'Descriptions'}]});}return null;})[_0x3aeb('0x26')](respondWithResult(_0x493a2f,null))[_0x3aeb('0x3f')](handleError(_0x493a2f,null));};exports['getFields']=function(_0x21b335,_0x3e64bc,_0x37f82c){var _0xb88990='';var _0xdf40e2='';return db['FreshsalesAccount']['findOne']({'where':{'id':_0x21b335['params']['id']},'attributes':['id',_0x3aeb('0x51'),_0x3aeb('0x52'),_0x3aeb('0x53')]})[_0x3aeb('0x26')](handleEntityNotFound(_0x3e64bc,null))[_0x3aeb('0x26')](function(_0x503407){if(_0x503407){_0xdf40e2=_0x503407[_0x3aeb('0x51')];_0xb88990=_0x503407[_0x3aeb('0x52')];var _0x55a9c6=_0x503407[_0x3aeb('0x52')]['slice'](-0x1);if(_0x55a9c6==='/'){_0xb88990=_0xb88990['substring'](0x0,_0xb88990[_0x3aeb('0x54')](_0x55a9c6));}return rp({'method':_0x3aeb('0x55'),'uri':util['format'](_0x3aeb('0x56'),_0xb88990,_0x3aeb('0x57')),'headers':{'Authorization':_0x3aeb('0x58')+_0x503407[_0x3aeb('0x53')]},'json':!![]});}})[_0x3aeb('0x26')](function(_0x230431){if(_0x230431){var _0x5aa7a7=_0x230431[_0x3aeb('0x59')];var _0x57e938=![];var _0x14ca03=null;for(_0x14ca03=0x0;_0x14ca03<_0x5aa7a7[_0x3aeb('0x46')];_0x14ca03++){if(_0x5aa7a7[_0x14ca03][_0x3aeb('0x5a')]===_0xdf40e2){_0x57e938=!![];}}if(_0x57e938){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x3aeb('0x5b')});}}})['then'](respondWithResult(_0x3e64bc,null))[_0x3aeb('0x3f')](function(_0x164875){var _0x558dbe=_0x21b335[_0x3aeb('0x33')][_0x3aeb('0x5c')]?0x1f4:_0x164875[_0x3aeb('0x5d')]||0x1f4;logger[_0x3aeb('0x5e')](_0x3aeb('0x5f'),_0x3aeb('0x60'),_0x558dbe,JSON[_0x3aeb('0x61')](_0x164875));delete _0x164875[_0x3aeb('0x27')];if(_0x558dbe===0x191){_0x558dbe=0x190;}_0x3e64bc[_0x3aeb('0x1b')](_0x558dbe)[_0x3aeb('0x62')](_0x21b335['query'][_0x3aeb('0x5c')]?{'message':_0x3aeb('0x63'),'statusCode':_0x164875[_0x3aeb('0x5d')]}:_0x164875);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index d892e62..0193300 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 _0xb016=['../../components/integrations/configuration','exports','FreshsalesAccount','int_freshsales_accounts','lodash','util','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x4e36e1,_0x40ed74){var _0x400a2b=function(_0x2c6faf){while(--_0x2c6faf){_0x4e36e1['push'](_0x4e36e1['shift']());}};_0x400a2b(++_0x40ed74);}(_0xb016,0x159));var _0x6b01=function(_0x556cdf,_0xb9d3c){_0x556cdf=_0x556cdf-0x0;var _0x327aac=_0xb016[_0x556cdf];return _0x327aac;};'use strict';var _=require(_0x6b01('0x0'));var util=require(_0x6b01('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6b01('0x2'));var BPromise=require('bluebird');var rp=require(_0x6b01('0x3'));var fs=require('fs');var path=require(_0x6b01('0x4'));var rimraf=require(_0x6b01('0x5'));var config=require(_0x6b01('0x6'));var attributes=require('./intFreshsalesAccount.attributes');var integrations=require(_0x6b01('0x7'));module[_0x6b01('0x8')]=function(_0x192b2d,_0x5759a1){return _0x192b2d['define'](_0x6b01('0x9'),attributes,{'tableName':_0x6b01('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x430c=['define','FreshsalesAccount','int_freshsales_accounts','lodash','api','moment','bluebird','./intFreshsalesAccount.attributes','../../components/integrations/configuration'];(function(_0x3edfa9,_0x47cc05){var _0x44e0fc=function(_0xc03ee7){while(--_0xc03ee7){_0x3edfa9['push'](_0x3edfa9['shift']());}};_0x44e0fc(++_0x47cc05);}(_0x430c,0x1a1));var _0xc430=function(_0x33154d,_0x854047){_0x33154d=_0x33154d-0x0;var _0x3b2f03=_0x430c[_0x33154d];return _0x3b2f03;};'use strict';var _=require(_0xc430('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc430('0x1'));var moment=require(_0xc430('0x2'));var BPromise=require(_0xc430('0x3'));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(_0xc430('0x4'));var integrations=require(_0xc430('0x5'));module['exports']=function(_0x42aa9c,_0x4de44f){return _0x42aa9c[_0xc430('0x6')](_0xc430('0x7'),attributes,{'tableName':_0xc430('0x8'),'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 b9c0300..6fda453 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 _0xa46e=['model','attributes','GetFreshsalesAccount','ShowFreshsalesAccount','find','where','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','http','request','then','request\x20sent','debug','stringify','error','code','message','FreshsalesAccount,\x20%s,\x20%s','info','result','catch','FreshsalesAccount','findAll','options','raw','include','map'];(function(_0x46cc19,_0x47e952){var _0x4fb02b=function(_0x3e366b){while(--_0x3e366b){_0x46cc19['push'](_0x46cc19['shift']());}};_0x4fb02b(++_0x47e952);}(_0xa46e,0x8a));var _0xea46=function(_0x19babd,_0x1d4ef7){_0x19babd=_0x19babd-0x0;var _0x314eaf=_0xa46e[_0x19babd];return _0x314eaf;};'use strict';var _=require(_0xea46('0x0'));var util=require(_0xea46('0x1'));var moment=require('moment');var BPromise=require(_0xea46('0x2'));var rs=require(_0xea46('0x3'));var fs=require('fs');var Redis=require(_0xea46('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xea46('0x5'));var logger=require('../../config/logger')(_0xea46('0x6'));var config=require('../../config/environment');var jayson=require(_0xea46('0x7'));var client=jayson['client'][_0xea46('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3dc26f,_0x5f1cd1,_0x2d1b30){return new BPromise(function(_0x42771a,_0xe7d428){return client[_0xea46('0x9')](_0x3dc26f,_0x2d1b30)[_0xea46('0xa')](function(_0x4cf206){logger['info']('FreshsalesAccount,\x20%s,\x20%s',_0x5f1cd1,_0xea46('0xb'));logger[_0xea46('0xc')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x5f1cd1,_0xea46('0xb'),JSON[_0xea46('0xd')](_0x4cf206));if(_0x4cf206[_0xea46('0xe')]){if(_0x4cf206['error'][_0xea46('0xf')]===0x1f4){logger[_0xea46('0xe')]('FreshsalesAccount,\x20%s,\x20%s',_0x5f1cd1,_0x4cf206[_0xea46('0xe')][_0xea46('0x10')]);return _0xe7d428(_0x4cf206['error'][_0xea46('0x10')]);}logger['error'](_0xea46('0x11'),_0x5f1cd1,_0x4cf206[_0xea46('0xe')][_0xea46('0x10')]);return _0x42771a(_0x4cf206[_0xea46('0xe')][_0xea46('0x10')]);}else{logger[_0xea46('0x12')](_0xea46('0x11'),_0x5f1cd1,_0xea46('0xb'));_0x42771a(_0x4cf206[_0xea46('0x13')]['message']);}})[_0xea46('0x14')](function(_0xbf225e){logger[_0xea46('0xe')]('FreshsalesAccount,\x20%s,\x20%s',_0x5f1cd1,_0xbf225e);_0xe7d428(_0xbf225e);});});}exports['GetFreshsalesAccount']=function(_0x19d5c1){var _0x3f463d=this;return new Promise(function(_0x5cf5dd,_0x4b6745){return db[_0xea46('0x15')][_0xea46('0x16')]({'raw':_0x19d5c1['options']?_0x19d5c1[_0xea46('0x17')][_0xea46('0x18')]===undefined?!![]:![]:!![],'where':_0x19d5c1[_0xea46('0x17')]?_0x19d5c1[_0xea46('0x17')]['where']||null:null,'attributes':_0x19d5c1[_0xea46('0x17')]?_0x19d5c1['options']['attributes']||null:null,'limit':_0x19d5c1[_0xea46('0x17')]?_0x19d5c1['options']['limit']||null:null,'include':_0x19d5c1['options']?_0x19d5c1[_0xea46('0x17')][_0xea46('0x19')]?_[_0xea46('0x1a')](_0x19d5c1['options'][_0xea46('0x19')],function(_0x59b10d){return{'model':db[_0x59b10d[_0xea46('0x1b')]],'as':_0x59b10d['as'],'attributes':_0x59b10d[_0xea46('0x1c')],'include':_0x59b10d['include']?_[_0xea46('0x1a')](_0x59b10d['include'],function(_0x2b3a8f){return{'model':db[_0x2b3a8f[_0xea46('0x1b')]],'as':_0x2b3a8f['as'],'attributes':_0x2b3a8f[_0xea46('0x1c')],'include':_0x2b3a8f['include']?_['map'](_0x2b3a8f[_0xea46('0x19')],function(_0x38ac07){return{'model':db[_0x38ac07['model']],'as':_0x38ac07['as'],'attributes':_0x38ac07[_0xea46('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x11129d){logger['info'](_0xea46('0x1d'),_0x19d5c1);logger[_0xea46('0xc')](_0xea46('0x1d'),_0x19d5c1,JSON[_0xea46('0xd')](_0x11129d));_0x5cf5dd(_0x11129d);})[_0xea46('0x14')](function(_0x174345){logger['error'](_0xea46('0x1d'),_0x174345[_0xea46('0x10')],_0x19d5c1);_0x4b6745(_0x3f463d[_0xea46('0xe')](0x1f4,_0x174345['message']));});});};exports[_0xea46('0x1e')]=function(_0x3cdf96){var _0x38d631=this;return new Promise(function(_0x5a0fc0,_0x4a0635){return db['FreshsalesAccount'][_0xea46('0x1f')]({'raw':_0x3cdf96[_0xea46('0x17')]?_0x3cdf96[_0xea46('0x17')][_0xea46('0x18')]===undefined?!![]:![]:!![],'where':_0x3cdf96[_0xea46('0x17')]?_0x3cdf96[_0xea46('0x17')][_0xea46('0x20')]||null:null,'attributes':_0x3cdf96[_0xea46('0x17')]?_0x3cdf96[_0xea46('0x17')][_0xea46('0x1c')]||null:null,'include':_0x3cdf96[_0xea46('0x17')]?_0x3cdf96['options'][_0xea46('0x19')]?_[_0xea46('0x1a')](_0x3cdf96[_0xea46('0x17')][_0xea46('0x19')],function(_0x1472c0){return{'model':db[_0x1472c0[_0xea46('0x1b')]],'as':_0x1472c0['as'],'attributes':_0x1472c0[_0xea46('0x1c')],'include':_0x1472c0['include']?_[_0xea46('0x1a')](_0x1472c0[_0xea46('0x19')],function(_0x388449){return{'model':db[_0x388449[_0xea46('0x1b')]],'as':_0x388449['as'],'attributes':_0x388449[_0xea46('0x1c')],'include':_0x388449['include']?_['map'](_0x388449[_0xea46('0x19')],function(_0x343499){return{'model':db[_0x343499['model']],'as':_0x343499['as'],'attributes':_0x343499[_0xea46('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xea46('0xa')](function(_0x123aae){logger[_0xea46('0x12')]('ShowFreshsalesAccount',_0x3cdf96);logger['debug'](_0xea46('0x1e'),_0x3cdf96,JSON['stringify'](_0x123aae));_0x5a0fc0(_0x123aae);})[_0xea46('0x14')](function(_0xdec374){logger['error'](_0xea46('0x1e'),_0xdec374[_0xea46('0x10')],_0x3cdf96);_0x4a0635(_0x38d631['error'](0x1f4,_0xdec374[_0xea46('0x10')]));});});}; \ No newline at end of file +var _0xbff5=['attributes','limit','include','map','model','GetFreshsalesAccount','FreshsalesAccount','find','raw','ShowFreshsalesAccount','debug','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','findAll','options','where'];(function(_0x5e3ba6,_0x512a40){var _0x27e753=function(_0x39795f){while(--_0x39795f){_0x5e3ba6['push'](_0x5e3ba6['shift']());}};_0x27e753(++_0x512a40);}(_0xbff5,0x1bc));var _0x5bff=function(_0x1c5ea0,_0x4cbbf3){_0x1c5ea0=_0x1c5ea0-0x0;var _0x2e52f6=_0xbff5[_0x1c5ea0];return _0x2e52f6;};'use strict';var _=require(_0x5bff('0x0'));var util=require(_0x5bff('0x1'));var moment=require(_0x5bff('0x2'));var BPromise=require(_0x5bff('0x3'));var rs=require(_0x5bff('0x4'));var fs=require('fs');var Redis=require(_0x5bff('0x5'));var db=require(_0x5bff('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x5bff('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5bff('0x8'));var client=jayson[_0x5bff('0x9')][_0x5bff('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa54c57,_0x43605a,_0xd4b9dc){return new BPromise(function(_0x1acb49,_0x139c99){return client[_0x5bff('0xb')](_0xa54c57,_0xd4b9dc)['then'](function(_0x20e26f){logger['info'](_0x5bff('0xc'),_0x43605a,_0x5bff('0xd'));logger['debug'](_0x5bff('0xe'),_0x43605a,'request\x20sent',JSON[_0x5bff('0xf')](_0x20e26f));if(_0x20e26f['error']){if(_0x20e26f[_0x5bff('0x10')][_0x5bff('0x11')]===0x1f4){logger['error'](_0x5bff('0xc'),_0x43605a,_0x20e26f['error'][_0x5bff('0x12')]);return _0x139c99(_0x20e26f[_0x5bff('0x10')]['message']);}logger[_0x5bff('0x10')](_0x5bff('0xc'),_0x43605a,_0x20e26f['error']['message']);return _0x1acb49(_0x20e26f[_0x5bff('0x10')][_0x5bff('0x12')]);}else{logger[_0x5bff('0x13')]('FreshsalesAccount,\x20%s,\x20%s',_0x43605a,_0x5bff('0xd'));_0x1acb49(_0x20e26f[_0x5bff('0x14')][_0x5bff('0x12')]);}})['catch'](function(_0x3ffbbc){logger[_0x5bff('0x10')](_0x5bff('0xc'),_0x43605a,_0x3ffbbc);_0x139c99(_0x3ffbbc);});});}exports['GetFreshsalesAccount']=function(_0xc9fbc3){var _0x279c22=this;return new Promise(function(_0x36653b,_0x32cf60){return db['FreshsalesAccount'][_0x5bff('0x15')]({'raw':_0xc9fbc3['options']?_0xc9fbc3[_0x5bff('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0xc9fbc3[_0x5bff('0x16')]?_0xc9fbc3[_0x5bff('0x16')][_0x5bff('0x17')]||null:null,'attributes':_0xc9fbc3[_0x5bff('0x16')]?_0xc9fbc3[_0x5bff('0x16')][_0x5bff('0x18')]||null:null,'limit':_0xc9fbc3[_0x5bff('0x16')]?_0xc9fbc3[_0x5bff('0x16')][_0x5bff('0x19')]||null:null,'include':_0xc9fbc3['options']?_0xc9fbc3[_0x5bff('0x16')][_0x5bff('0x1a')]?_[_0x5bff('0x1b')](_0xc9fbc3[_0x5bff('0x16')][_0x5bff('0x1a')],function(_0x31d26b){return{'model':db[_0x31d26b[_0x5bff('0x1c')]],'as':_0x31d26b['as'],'attributes':_0x31d26b[_0x5bff('0x18')],'include':_0x31d26b['include']?_['map'](_0x31d26b[_0x5bff('0x1a')],function(_0x53bd97){return{'model':db[_0x53bd97[_0x5bff('0x1c')]],'as':_0x53bd97['as'],'attributes':_0x53bd97[_0x5bff('0x18')],'include':_0x53bd97[_0x5bff('0x1a')]?_[_0x5bff('0x1b')](_0x53bd97[_0x5bff('0x1a')],function(_0x1140eb){return{'model':db[_0x1140eb[_0x5bff('0x1c')]],'as':_0x1140eb['as'],'attributes':_0x1140eb[_0x5bff('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4df57a){logger[_0x5bff('0x13')](_0x5bff('0x1d'),_0xc9fbc3);logger['debug'](_0x5bff('0x1d'),_0xc9fbc3,JSON['stringify'](_0x4df57a));_0x36653b(_0x4df57a);})['catch'](function(_0x3eda3a){logger['error'](_0x5bff('0x1d'),_0x3eda3a[_0x5bff('0x12')],_0xc9fbc3);_0x32cf60(_0x279c22[_0x5bff('0x10')](0x1f4,_0x3eda3a[_0x5bff('0x12')]));});});};exports['ShowFreshsalesAccount']=function(_0x71783){var _0x4ee6f1=this;return new Promise(function(_0x3c1405,_0x5a7873){return db[_0x5bff('0x1e')][_0x5bff('0x1f')]({'raw':_0x71783[_0x5bff('0x16')]?_0x71783[_0x5bff('0x16')][_0x5bff('0x20')]===undefined?!![]:![]:!![],'where':_0x71783[_0x5bff('0x16')]?_0x71783['options'][_0x5bff('0x17')]||null:null,'attributes':_0x71783[_0x5bff('0x16')]?_0x71783[_0x5bff('0x16')][_0x5bff('0x18')]||null:null,'include':_0x71783[_0x5bff('0x16')]?_0x71783[_0x5bff('0x16')][_0x5bff('0x1a')]?_[_0x5bff('0x1b')](_0x71783['options'][_0x5bff('0x1a')],function(_0x16042d){return{'model':db[_0x16042d[_0x5bff('0x1c')]],'as':_0x16042d['as'],'attributes':_0x16042d[_0x5bff('0x18')],'include':_0x16042d['include']?_[_0x5bff('0x1b')](_0x16042d[_0x5bff('0x1a')],function(_0x5a24be){return{'model':db[_0x5a24be[_0x5bff('0x1c')]],'as':_0x5a24be['as'],'attributes':_0x5a24be[_0x5bff('0x18')],'include':_0x5a24be[_0x5bff('0x1a')]?_[_0x5bff('0x1b')](_0x5a24be['include'],function(_0x38245d){return{'model':db[_0x38245d[_0x5bff('0x1c')]],'as':_0x38245d['as'],'attributes':_0x38245d[_0x5bff('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1065d1){logger['info'](_0x5bff('0x21'),_0x71783);logger[_0x5bff('0x22')](_0x5bff('0x21'),_0x71783,JSON['stringify'](_0x1065d1));_0x3c1405(_0x1065d1);})[_0x5bff('0x23')](function(_0x1ec079){logger[_0x5bff('0x10')]('ShowFreshsalesAccount',_0x1ec079[_0x5bff('0x12')],_0x71783);_0x5a7873(_0x4ee6f1[_0x5bff('0x10')](0x1f4,_0x1ec079['message']));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 640573d..b4e5e02 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 _0x5251=['path','express','Router','fs-extra','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/subjects','getSubjects','/:id/descriptions','/:id/fields','post','create','update','delete','exports','multer'];(function(_0x52c168,_0x99d88e){var _0x40cb2e=function(_0x2facde){while(--_0x2facde){_0x52c168['push'](_0x52c168['shift']());}};_0x40cb2e(++_0x99d88e);}(_0x5251,0x13a));var _0x1525=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5251[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x1525('0x0'));var util=require('util');var path=require(_0x1525('0x1'));var timeout=require('connect-timeout');var express=require(_0x1525('0x2'));var router=express[_0x1525('0x3')]();var fs_extra=require(_0x1525('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1525('0x5'));var controller=require(_0x1525('0x6'));router[_0x1525('0x7')]('/',auth[_0x1525('0x8')](),controller[_0x1525('0x9')]);router[_0x1525('0x7')](_0x1525('0xa'),auth[_0x1525('0x8')](),controller[_0x1525('0xb')]);router[_0x1525('0x7')](_0x1525('0xc'),auth['isAuthenticated'](),controller[_0x1525('0xd')]);router[_0x1525('0x7')](_0x1525('0xe'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x1525('0x7')](_0x1525('0xf'),auth[_0x1525('0x8')](),controller['getFields']);router[_0x1525('0x10')]('/',auth['isAuthenticated'](),controller[_0x1525('0x11')]);router['put']('/:id',auth[_0x1525('0x8')](),controller[_0x1525('0x12')]);router[_0x1525('0x13')](_0x1525('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x1525('0x14')]=router; \ No newline at end of file +var _0x1980=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshsalesConfiguration.controller','get','isAuthenticated','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','post','create','/:id','update','delete','destroy','exports','multer','util','path','express'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x1980,0x128));var _0x0198=function(_0x4c579e,_0x4d7dce){_0x4c579e=_0x4c579e-0x0;var _0x1fff07=_0x1980[_0x4c579e];return _0x1fff07;};'use strict';var multer=require(_0x0198('0x0'));var util=require(_0x0198('0x1'));var path=require(_0x0198('0x2'));var timeout=require('connect-timeout');var express=require(_0x0198('0x3'));var router=express[_0x0198('0x4')]();var fs_extra=require(_0x0198('0x5'));var auth=require(_0x0198('0x6'));var interaction=require(_0x0198('0x7'));var config=require('../../config/environment');var controller=require(_0x0198('0x8'));router[_0x0198('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x0198('0x9')]('/:id',auth[_0x0198('0xa')](),controller[_0x0198('0xb')]);router[_0x0198('0x9')](_0x0198('0xc'),auth[_0x0198('0xa')](),controller[_0x0198('0xd')]);router['get'](_0x0198('0xe'),auth[_0x0198('0xa')](),controller[_0x0198('0xf')]);router['get'](_0x0198('0x10'),auth[_0x0198('0xa')](),controller[_0x0198('0x11')]);router[_0x0198('0x12')]('/',auth[_0x0198('0xa')](),controller[_0x0198('0x13')]);router['put'](_0x0198('0x14'),auth[_0x0198('0xa')](),controller[_0x0198('0x15')]);router[_0x0198('0x16')](_0x0198('0x14'),auth[_0x0198('0xa')](),controller[_0x0198('0x17')]);module[_0x0198('0x18')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index d580c0c..64dfdb5 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 _0x7406=['exports','STRING'];(function(_0x2f4909,_0x3e5657){var _0x3545c8=function(_0x3ffbb){while(--_0x3ffbb){_0x2f4909['push'](_0x2f4909['shift']());}};_0x3545c8(++_0x3e5657);}(_0x7406,0x146));var _0x6740=function(_0x3cc4c8,_0x114636){_0x3cc4c8=_0x3cc4c8-0x0;var _0xdc0123=_0x7406[_0x3cc4c8];return _0xdc0123;};'use strict';var Sequelize=require('sequelize');module[_0x6740('0x0')]={'name':{'type':Sequelize[_0x6740('0x1')]},'description':{'type':Sequelize[_0x6740('0x1')]}}; \ No newline at end of file +var _0xf37a=['exports','STRING','sequelize'];(function(_0xefb4e,_0xe56689){var _0x36c78c=function(_0x158fe3){while(--_0x158fe3){_0xefb4e['push'](_0xefb4e['shift']());}};_0x36c78c(++_0xe56689);}(_0xf37a,0x6b));var _0xaf37=function(_0x30300b,_0x102c6d){_0x30300b=_0x30300b-0x0;var _0x5e84c1=_0xf37a[_0x30300b];return _0x5e84c1;};'use strict';var Sequelize=require(_0xaf37('0x0'));module[_0xaf37('0x1')]={'name':{'type':Sequelize[_0xaf37('0x2')]},'description':{'type':Sequelize[_0xaf37('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 382dd09..0c31fca 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 _0x1489=['update','then','destroy','error','stack','name','index','map','FreshsalesConfiguration','type','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','rawAttributes','includeAll','include','find','create','body','getSubjects','findOne','FreshsalesField','pick','getDescriptions','getFields','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject'];(function(_0x5de1bc,_0x434be1){var _0x19f4b8=function(_0x35f764){while(--_0x35f764){_0x5de1bc['push'](_0x5de1bc['shift']());}};_0x19f4b8(++_0x434be1);}(_0x1489,0x17d));var _0x9148=function(_0x5c8628,_0x2fc5f5){_0x5c8628=_0x5c8628-0x0;var _0xcbd50e=_0x1489[_0x5c8628];return _0xcbd50e;};'use strict';var emlformat=require(_0x9148('0x0'));var rimraf=require(_0x9148('0x1'));var zipdir=require(_0x9148('0x2'));var jsonpatch=require(_0x9148('0x3'));var rp=require('request-promise');var moment=require(_0x9148('0x4'));var BPromise=require(_0x9148('0x5'));var Mustache=require(_0x9148('0x6'));var util=require(_0x9148('0x7'));var path=require(_0x9148('0x8'));var sox=require(_0x9148('0x9'));var csv=require(_0x9148('0xa'));var ejs=require(_0x9148('0xb'));var fs=require('fs');var fs_extra=require(_0x9148('0xc'));var _=require('lodash');var squel=require(_0x9148('0xd'));var crypto=require(_0x9148('0xe'));var jsforce=require(_0x9148('0xf'));var deskjs=require(_0x9148('0x10'));var toCsv=require(_0x9148('0xa'));var querystring=require('querystring');var Papa=require(_0x9148('0x11'));var Redis=require(_0x9148('0x12'));var authService=require(_0x9148('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x9148('0x14'));var hardwareService=require(_0x9148('0x15'));var logger=require(_0x9148('0x16'))(_0x9148('0x17'));var utils=require(_0x9148('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x9148('0x19'));var db=require(_0x9148('0x1a'))['db'];function respondWithStatusCode(_0x2e7f38,_0x29fca2){_0x29fca2=_0x29fca2||0xcc;return function(_0x259e3a){if(_0x259e3a){return _0x2e7f38[_0x9148('0x1b')](_0x29fca2);}return _0x2e7f38['status'](_0x29fca2)[_0x9148('0x1c')]();};}function respondWithResult(_0x1d7276,_0x21fa67){_0x21fa67=_0x21fa67||0xc8;return function(_0x2c03d0){if(_0x2c03d0){return _0x1d7276[_0x9148('0x1d')](_0x21fa67)[_0x9148('0x1e')](_0x2c03d0);}};}function respondWithFilteredResult(_0x32174e,_0x127622){return function(_0x3ef36a){if(_0x3ef36a){var _0x56ff1b=typeof _0x127622['offset']==='undefined'&&typeof _0x127622[_0x9148('0x1f')]===_0x9148('0x20');var _0x5abd2b=_0x3ef36a[_0x9148('0x21')];var _0x3ed2c7=_0x56ff1b?0x0:_0x127622[_0x9148('0x22')];var _0x13b264=_0x56ff1b?_0x3ef36a[_0x9148('0x21')]:_0x127622[_0x9148('0x22')]+_0x127622[_0x9148('0x1f')];var _0x517d40;if(_0x13b264>=_0x5abd2b){_0x13b264=_0x5abd2b;_0x517d40=0xc8;}else{_0x517d40=0xce;}_0x32174e[_0x9148('0x1d')](_0x517d40);return _0x32174e[_0x9148('0x23')](_0x9148('0x24'),_0x3ed2c7+'-'+_0x13b264+'/'+_0x5abd2b)[_0x9148('0x1e')](_0x3ef36a);}return null;};}function patchUpdates(_0x22e9f1){return function(_0x569d59){try{jsonpatch[_0x9148('0x25')](_0x569d59,_0x22e9f1,!![]);}catch(_0x5f1e74){return BPromise[_0x9148('0x26')](_0x5f1e74);}return _0x569d59['save']();};}function saveUpdates(_0x1550ec,_0x28c919){return function(_0x469ca7){if(_0x469ca7){return _0x469ca7[_0x9148('0x27')](_0x1550ec)[_0x9148('0x28')](function(_0x67d545){return _0x67d545;});}return null;};}function removeEntity(_0x907d88,_0x2f96e9){return function(_0x53a99f){if(_0x53a99f){return _0x53a99f[_0x9148('0x29')]()[_0x9148('0x28')](function(){_0x907d88['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x471d24,_0x59ffea){return function(_0x40a051){if(!_0x40a051){_0x471d24[_0x9148('0x1b')](0x194);}return _0x40a051;};}function handleError(_0x12f1ea,_0x25c9c3){_0x25c9c3=_0x25c9c3||0x1f4;return function(_0x5e54ca){logger[_0x9148('0x2a')](_0x5e54ca[_0x9148('0x2b')]);if(_0x5e54ca[_0x9148('0x2c')]){delete _0x5e54ca[_0x9148('0x2c')];}_0x12f1ea['status'](_0x25c9c3)['send'](_0x5e54ca);};}exports[_0x9148('0x2d')]=function(_0x55c24b,_0x5891b9){var _0x239506={},_0x9d000c={},_0x41d5d9={'count':0x0,'rows':[]};var _0x162b89=_[_0x9148('0x2e')](db[_0x9148('0x2f')]['rawAttributes'],function(_0x4040c8){return{'name':_0x4040c8['fieldName'],'type':_0x4040c8[_0x9148('0x30')][_0x9148('0x31')]};});_0x9d000c[_0x9148('0x32')]=_[_0x9148('0x2e')](_0x162b89,_0x9148('0x2c'));_0x9d000c[_0x9148('0x33')]=_[_0x9148('0x34')](_0x55c24b[_0x9148('0x33')]);_0x9d000c[_0x9148('0x35')]=_[_0x9148('0x36')](_0x9d000c[_0x9148('0x32')],_0x9d000c[_0x9148('0x33')]);_0x239506['attributes']=_[_0x9148('0x36')](_0x9d000c[_0x9148('0x32')],qs[_0x9148('0x37')](_0x55c24b[_0x9148('0x33')][_0x9148('0x37')]));_0x239506['attributes']=_0x239506['attributes'][_0x9148('0x38')]?_0x239506[_0x9148('0x39')]:_0x9d000c['model'];if(!_0x55c24b[_0x9148('0x33')][_0x9148('0x3a')](_0x9148('0x3b'))){_0x239506[_0x9148('0x1f')]=qs[_0x9148('0x1f')](_0x55c24b[_0x9148('0x33')]['limit']);_0x239506[_0x9148('0x22')]=qs[_0x9148('0x22')](_0x55c24b[_0x9148('0x33')][_0x9148('0x22')]);}_0x239506[_0x9148('0x3c')]=qs['sort'](_0x55c24b[_0x9148('0x33')][_0x9148('0x3d')]);_0x239506[_0x9148('0x3e')]=qs[_0x9148('0x35')](_['pick'](_0x55c24b[_0x9148('0x33')],_0x9d000c[_0x9148('0x35')]),_0x162b89);if(_0x55c24b[_0x9148('0x33')][_0x9148('0x3f')]){_0x239506[_0x9148('0x3e')]=_[_0x9148('0x40')](_0x239506[_0x9148('0x3e')],{'$or':_[_0x9148('0x2e')](_0x162b89,function(_0x2f7627){if(_0x2f7627[_0x9148('0x30')]!==_0x9148('0x41')){var _0x2cb368={};_0x2cb368[_0x2f7627[_0x9148('0x2c')]]={'$like':'%'+_0x55c24b['query'][_0x9148('0x3f')]+'%'};return _0x2cb368;}})});}_0x239506=_[_0x9148('0x40')]({},_0x239506,_0x55c24b[_0x9148('0x42')]);var _0x2d84cc={'where':_0x239506[_0x9148('0x3e')]};return db[_0x9148('0x2f')][_0x9148('0x21')](_0x2d84cc)[_0x9148('0x28')](function(_0x5c0ace){_0x41d5d9[_0x9148('0x21')]=_0x5c0ace;if(_0x55c24b[_0x9148('0x33')]['includeAll']){_0x239506['include']=[{'all':!![]}];}return db[_0x9148('0x2f')][_0x9148('0x43')](_0x239506);})[_0x9148('0x28')](function(_0x3a7fb8){_0x41d5d9[_0x9148('0x44')]=_0x3a7fb8;return _0x41d5d9;})[_0x9148('0x28')](respondWithFilteredResult(_0x5891b9,_0x239506))[_0x9148('0x45')](handleError(_0x5891b9,null));};exports[_0x9148('0x46')]=function(_0x25f656,_0x135177){var _0x123a61={'raw':![],'where':{'id':_0x25f656[_0x9148('0x47')]['id']}},_0x14dabf={};_0x14dabf['model']=_[_0x9148('0x34')](db['FreshsalesConfiguration'][_0x9148('0x48')]);_0x14dabf[_0x9148('0x33')]=_[_0x9148('0x34')](_0x25f656['query']);_0x14dabf['filters']=_['intersection'](_0x14dabf[_0x9148('0x32')],_0x14dabf[_0x9148('0x33')]);_0x123a61[_0x9148('0x39')]=_[_0x9148('0x36')](_0x14dabf[_0x9148('0x32')],qs['fields'](_0x25f656['query'][_0x9148('0x37')]));_0x123a61[_0x9148('0x39')]=_0x123a61['attributes'][_0x9148('0x38')]?_0x123a61[_0x9148('0x39')]:_0x14dabf[_0x9148('0x32')];if(_0x25f656[_0x9148('0x33')][_0x9148('0x49')]){_0x123a61[_0x9148('0x4a')]=[{'all':!![]}];}_0x123a61=_['merge']({},_0x123a61,_0x25f656['options']);return db[_0x9148('0x2f')][_0x9148('0x4b')](_0x123a61)[_0x9148('0x28')](handleEntityNotFound(_0x135177,null))[_0x9148('0x28')](respondWithResult(_0x135177,null))[_0x9148('0x45')](handleError(_0x135177,null));};exports[_0x9148('0x4c')]=function(_0x494286,_0x49cb71){return db['FreshsalesConfiguration'][_0x9148('0x4c')](_0x494286['body'],{})['then'](respondWithResult(_0x49cb71,0xc9))['catch'](handleError(_0x49cb71,null));};exports['update']=function(_0x4433d6,_0x7643ce){if(_0x4433d6[_0x9148('0x4d')]['id']){delete _0x4433d6[_0x9148('0x4d')]['id'];}return db[_0x9148('0x2f')][_0x9148('0x4b')]({'where':{'id':_0x4433d6[_0x9148('0x47')]['id']}})[_0x9148('0x28')](handleEntityNotFound(_0x7643ce,null))[_0x9148('0x28')](saveUpdates(_0x4433d6[_0x9148('0x4d')],null))[_0x9148('0x28')](respondWithResult(_0x7643ce,null))['catch'](handleError(_0x7643ce,null));};exports[_0x9148('0x29')]=function(_0x22ea8c,_0x1ef65c){return db[_0x9148('0x2f')][_0x9148('0x4b')]({'where':{'id':_0x22ea8c[_0x9148('0x47')]['id']}})[_0x9148('0x28')](handleEntityNotFound(_0x1ef65c,null))[_0x9148('0x28')](removeEntity(_0x1ef65c,null))[_0x9148('0x45')](handleError(_0x1ef65c,null));};exports[_0x9148('0x4e')]=function(_0x388d10,_0x34b386,_0x5aaa88){var _0x1a469f={};var _0x137ad5={};var _0x435136;var _0x39f722;return db[_0x9148('0x2f')][_0x9148('0x4f')]({'where':{'id':_0x388d10[_0x9148('0x47')]['id']}})['then'](handleEntityNotFound(_0x34b386,null))[_0x9148('0x28')](function(_0x475ac5){if(_0x475ac5){_0x435136=_0x475ac5;_0x137ad5[_0x9148('0x32')]=_[_0x9148('0x34')](db[_0x9148('0x50')]['rawAttributes']);_0x137ad5[_0x9148('0x33')]=_['keys'](_0x388d10[_0x9148('0x33')]);_0x137ad5[_0x9148('0x35')]=_[_0x9148('0x36')](_0x137ad5[_0x9148('0x32')],_0x137ad5[_0x9148('0x33')]);_0x1a469f[_0x9148('0x39')]=_[_0x9148('0x36')](_0x137ad5[_0x9148('0x32')],qs[_0x9148('0x37')](_0x388d10[_0x9148('0x33')][_0x9148('0x37')]));_0x1a469f['attributes']=_0x1a469f[_0x9148('0x39')]['length']?_0x1a469f['attributes']:_0x137ad5[_0x9148('0x32')];_0x1a469f[_0x9148('0x3c')]=qs['sort'](_0x388d10[_0x9148('0x33')]['sort']);_0x1a469f[_0x9148('0x3e')]=qs['filters'](_[_0x9148('0x51')](_0x388d10[_0x9148('0x33')],_0x137ad5[_0x9148('0x35')]));if(_0x388d10[_0x9148('0x33')][_0x9148('0x3f')]){_0x1a469f[_0x9148('0x3e')]=_[_0x9148('0x40')](_0x1a469f[_0x9148('0x3e')],{'$or':_[_0x9148('0x2e')](_0x1a469f[_0x9148('0x39')],function(_0x3e7420){var _0x51075d={};_0x51075d[_0x3e7420]={'$like':'%'+_0x388d10['query'][_0x9148('0x3f')]+'%'};return _0x51075d;})});}_0x1a469f=_[_0x9148('0x40')]({},_0x1a469f,_0x388d10['options']);return _0x435136[_0x9148('0x4e')](_0x1a469f);}})[_0x9148('0x28')](function(_0x2848c9){if(_0x2848c9){_0x39f722=_0x2848c9[_0x9148('0x38')];if(!_0x388d10[_0x9148('0x33')]['hasOwnProperty'](_0x9148('0x3b'))){_0x1a469f['limit']=qs[_0x9148('0x1f')](_0x388d10['query'][_0x9148('0x1f')]);_0x1a469f[_0x9148('0x22')]=qs[_0x9148('0x22')](_0x388d10['query'][_0x9148('0x22')]);}return _0x435136[_0x9148('0x4e')](_0x1a469f);}})['then'](function(_0x1190fd){if(_0x1190fd){return _0x1190fd?{'count':_0x39f722,'rows':_0x1190fd}:null;}})['then'](respondWithResult(_0x34b386,null))[_0x9148('0x45')](handleError(_0x34b386,null));};exports['getDescriptions']=function(_0x29028a,_0x517025,_0x3fc1c8){var _0x4a800f={};var _0x4ae09a={};var _0x2ee231;var _0x48bc51;return db['FreshsalesConfiguration'][_0x9148('0x4f')]({'where':{'id':_0x29028a[_0x9148('0x47')]['id']}})['then'](handleEntityNotFound(_0x517025,null))['then'](function(_0xf6537e){if(_0xf6537e){_0x2ee231=_0xf6537e;_0x4ae09a[_0x9148('0x32')]=_['keys'](db[_0x9148('0x50')][_0x9148('0x48')]);_0x4ae09a[_0x9148('0x33')]=_['keys'](_0x29028a[_0x9148('0x33')]);_0x4ae09a[_0x9148('0x35')]=_[_0x9148('0x36')](_0x4ae09a['model'],_0x4ae09a[_0x9148('0x33')]);_0x4a800f[_0x9148('0x39')]=_[_0x9148('0x36')](_0x4ae09a['model'],qs[_0x9148('0x37')](_0x29028a['query'][_0x9148('0x37')]));_0x4a800f[_0x9148('0x39')]=_0x4a800f[_0x9148('0x39')][_0x9148('0x38')]?_0x4a800f[_0x9148('0x39')]:_0x4ae09a['model'];_0x4a800f[_0x9148('0x3c')]=qs[_0x9148('0x3d')](_0x29028a[_0x9148('0x33')][_0x9148('0x3d')]);_0x4a800f['where']=qs[_0x9148('0x35')](_[_0x9148('0x51')](_0x29028a[_0x9148('0x33')],_0x4ae09a[_0x9148('0x35')]));if(_0x29028a[_0x9148('0x33')]['filter']){_0x4a800f[_0x9148('0x3e')]=_[_0x9148('0x40')](_0x4a800f[_0x9148('0x3e')],{'$or':_[_0x9148('0x2e')](_0x4a800f[_0x9148('0x39')],function(_0x2f4bea){var _0x5f0e75={};_0x5f0e75[_0x2f4bea]={'$like':'%'+_0x29028a[_0x9148('0x33')][_0x9148('0x3f')]+'%'};return _0x5f0e75;})});}_0x4a800f=_[_0x9148('0x40')]({},_0x4a800f,_0x29028a[_0x9148('0x42')]);return _0x2ee231[_0x9148('0x52')](_0x4a800f);}})[_0x9148('0x28')](function(_0x10a9e3){if(_0x10a9e3){_0x48bc51=_0x10a9e3['length'];if(!_0x29028a[_0x9148('0x33')][_0x9148('0x3a')](_0x9148('0x3b'))){_0x4a800f[_0x9148('0x1f')]=qs[_0x9148('0x1f')](_0x29028a[_0x9148('0x33')][_0x9148('0x1f')]);_0x4a800f[_0x9148('0x22')]=qs[_0x9148('0x22')](_0x29028a[_0x9148('0x33')][_0x9148('0x22')]);}return _0x2ee231[_0x9148('0x52')](_0x4a800f);}})[_0x9148('0x28')](function(_0x456613){if(_0x456613){return _0x456613?{'count':_0x48bc51,'rows':_0x456613}:null;}})[_0x9148('0x28')](respondWithResult(_0x517025,null))[_0x9148('0x45')](handleError(_0x517025,null));};exports['getFields']=function(_0x300b24,_0x4440ec,_0x109d8f){var _0x2724da={};var _0x263a91={};var _0x507620;var _0x1d5a45;return db[_0x9148('0x2f')][_0x9148('0x4f')]({'where':{'id':_0x300b24[_0x9148('0x47')]['id']}})[_0x9148('0x28')](handleEntityNotFound(_0x4440ec,null))[_0x9148('0x28')](function(_0x141df8){if(_0x141df8){_0x507620=_0x141df8;_0x263a91[_0x9148('0x32')]=_['keys'](db['FreshsalesField'][_0x9148('0x48')]);_0x263a91[_0x9148('0x33')]=_[_0x9148('0x34')](_0x300b24[_0x9148('0x33')]);_0x263a91[_0x9148('0x35')]=_[_0x9148('0x36')](_0x263a91[_0x9148('0x32')],_0x263a91[_0x9148('0x33')]);_0x2724da[_0x9148('0x39')]=_[_0x9148('0x36')](_0x263a91[_0x9148('0x32')],qs[_0x9148('0x37')](_0x300b24[_0x9148('0x33')][_0x9148('0x37')]));_0x2724da[_0x9148('0x39')]=_0x2724da[_0x9148('0x39')][_0x9148('0x38')]?_0x2724da[_0x9148('0x39')]:_0x263a91[_0x9148('0x32')];_0x2724da[_0x9148('0x3c')]=qs['sort'](_0x300b24[_0x9148('0x33')][_0x9148('0x3d')]);_0x2724da[_0x9148('0x3e')]=qs[_0x9148('0x35')](_[_0x9148('0x51')](_0x300b24['query'],_0x263a91[_0x9148('0x35')]));if(_0x300b24[_0x9148('0x33')][_0x9148('0x3f')]){_0x2724da['where']=_['merge'](_0x2724da['where'],{'$or':_[_0x9148('0x2e')](_0x2724da['attributes'],function(_0x4cf192){var _0x2fb392={};_0x2fb392[_0x4cf192]={'$like':'%'+_0x300b24[_0x9148('0x33')][_0x9148('0x3f')]+'%'};return _0x2fb392;})});}_0x2724da=_[_0x9148('0x40')]({},_0x2724da,_0x300b24[_0x9148('0x42')]);return _0x507620[_0x9148('0x53')](_0x2724da);}})[_0x9148('0x28')](function(_0x26eca5){if(_0x26eca5){_0x1d5a45=_0x26eca5[_0x9148('0x38')];if(!_0x300b24[_0x9148('0x33')][_0x9148('0x3a')](_0x9148('0x3b'))){_0x2724da['limit']=qs[_0x9148('0x1f')](_0x300b24[_0x9148('0x33')][_0x9148('0x1f')]);_0x2724da['offset']=qs[_0x9148('0x22')](_0x300b24['query'][_0x9148('0x22')]);}return _0x507620[_0x9148('0x53')](_0x2724da);}})[_0x9148('0x28')](function(_0xca06ea){if(_0xca06ea){return _0xca06ea?{'count':_0x1d5a45,'rows':_0xca06ea}:null;}})[_0x9148('0x28')](respondWithResult(_0x4440ec,null))[_0x9148('0x45')](handleError(_0x4440ec,null));}; \ No newline at end of file +var _0x4aad=['sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','FreshsalesConfiguration','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','filters','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','length','find','create','body','getSubjects','findOne','FreshsalesField','order','pick','getDescriptions','getFields','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x42e25e,_0x46cfd1){var _0x1ed3a6=function(_0x3558e8){while(--_0x3558e8){_0x42e25e['push'](_0x42e25e['shift']());}};_0x1ed3a6(++_0x46cfd1);}(_0x4aad,0x13a));var _0xd4aa=function(_0x599e60,_0x5b6519){_0x599e60=_0x599e60-0x0;var _0x468e19=_0x4aad[_0x599e60];return _0x468e19;};'use strict';var emlformat=require(_0xd4aa('0x0'));var rimraf=require(_0xd4aa('0x1'));var zipdir=require(_0xd4aa('0x2'));var jsonpatch=require(_0xd4aa('0x3'));var rp=require('request-promise');var moment=require(_0xd4aa('0x4'));var BPromise=require(_0xd4aa('0x5'));var Mustache=require(_0xd4aa('0x6'));var util=require(_0xd4aa('0x7'));var path=require(_0xd4aa('0x8'));var sox=require(_0xd4aa('0x9'));var csv=require(_0xd4aa('0xa'));var ejs=require(_0xd4aa('0xb'));var fs=require('fs');var fs_extra=require(_0xd4aa('0xc'));var _=require(_0xd4aa('0xd'));var squel=require(_0xd4aa('0xe'));var crypto=require(_0xd4aa('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xd4aa('0x10'));var toCsv=require(_0xd4aa('0xa'));var querystring=require(_0xd4aa('0x11'));var Papa=require('papaparse');var Redis=require(_0xd4aa('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xd4aa('0x13'));var as=require(_0xd4aa('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd4aa('0x15'))(_0xd4aa('0x16'));var utils=require(_0xd4aa('0x17'));var config=require(_0xd4aa('0x18'));var licenseUtil=require(_0xd4aa('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x234620,_0x5dbe25){_0x5dbe25=_0x5dbe25||0xcc;return function(_0x2b6ad3){if(_0x2b6ad3){return _0x234620[_0xd4aa('0x1a')](_0x5dbe25);}return _0x234620[_0xd4aa('0x1b')](_0x5dbe25)[_0xd4aa('0x1c')]();};}function respondWithResult(_0x4a191e,_0x3fb4d0){_0x3fb4d0=_0x3fb4d0||0xc8;return function(_0x3e8f5d){if(_0x3e8f5d){return _0x4a191e[_0xd4aa('0x1b')](_0x3fb4d0)[_0xd4aa('0x1d')](_0x3e8f5d);}};}function respondWithFilteredResult(_0x5ea604,_0x46c984){return function(_0x1c1275){if(_0x1c1275){var _0x130d0a=typeof _0x46c984[_0xd4aa('0x1e')]===_0xd4aa('0x1f')&&typeof _0x46c984[_0xd4aa('0x20')]===_0xd4aa('0x1f');var _0x171fa9=_0x1c1275[_0xd4aa('0x21')];var _0x322946=_0x130d0a?0x0:_0x46c984[_0xd4aa('0x1e')];var _0x255c34=_0x130d0a?_0x1c1275['count']:_0x46c984[_0xd4aa('0x1e')]+_0x46c984[_0xd4aa('0x20')];var _0x5cc508;if(_0x255c34>=_0x171fa9){_0x255c34=_0x171fa9;_0x5cc508=0xc8;}else{_0x5cc508=0xce;}_0x5ea604[_0xd4aa('0x1b')](_0x5cc508);return _0x5ea604[_0xd4aa('0x22')](_0xd4aa('0x23'),_0x322946+'-'+_0x255c34+'/'+_0x171fa9)[_0xd4aa('0x1d')](_0x1c1275);}return null;};}function patchUpdates(_0x5edba3){return function(_0x3b2cf7){try{jsonpatch[_0xd4aa('0x24')](_0x3b2cf7,_0x5edba3,!![]);}catch(_0x2f1846){return BPromise[_0xd4aa('0x25')](_0x2f1846);}return _0x3b2cf7[_0xd4aa('0x26')]();};}function saveUpdates(_0x3f46b3,_0x1cf320){return function(_0x1de42e){if(_0x1de42e){return _0x1de42e[_0xd4aa('0x27')](_0x3f46b3)[_0xd4aa('0x28')](function(_0x2494df){return _0x2494df;});}return null;};}function removeEntity(_0x3ef9fb,_0x45edf0){return function(_0x3a68bb){if(_0x3a68bb){return _0x3a68bb[_0xd4aa('0x29')]()[_0xd4aa('0x28')](function(){_0x3ef9fb[_0xd4aa('0x1b')](0xcc)[_0xd4aa('0x1c')]();});}};}function handleEntityNotFound(_0x2f8867,_0x1ed6ab){return function(_0x36f02f){if(!_0x36f02f){_0x2f8867['sendStatus'](0x194);}return _0x36f02f;};}function handleError(_0x5ec4bc,_0x51c3b5){_0x51c3b5=_0x51c3b5||0x1f4;return function(_0x4324df){logger[_0xd4aa('0x2a')](_0x4324df[_0xd4aa('0x2b')]);if(_0x4324df[_0xd4aa('0x2c')]){delete _0x4324df[_0xd4aa('0x2c')];}_0x5ec4bc['status'](_0x51c3b5)[_0xd4aa('0x2d')](_0x4324df);};}exports[_0xd4aa('0x2e')]=function(_0xe2d0a1,_0x58ff45){var _0x48eecc={},_0x1467ae={},_0x51d93e={'count':0x0,'rows':[]};var _0x438cb6=_[_0xd4aa('0x2f')](db[_0xd4aa('0x30')][_0xd4aa('0x31')],function(_0x1203b5){return{'name':_0x1203b5[_0xd4aa('0x32')],'type':_0x1203b5[_0xd4aa('0x33')][_0xd4aa('0x34')]};});_0x1467ae[_0xd4aa('0x35')]=_[_0xd4aa('0x2f')](_0x438cb6,'name');_0x1467ae[_0xd4aa('0x36')]=_[_0xd4aa('0x37')](_0xe2d0a1['query']);_0x1467ae['filters']=_[_0xd4aa('0x38')](_0x1467ae[_0xd4aa('0x35')],_0x1467ae['query']);_0x48eecc[_0xd4aa('0x39')]=_[_0xd4aa('0x38')](_0x1467ae[_0xd4aa('0x35')],qs[_0xd4aa('0x3a')](_0xe2d0a1[_0xd4aa('0x36')][_0xd4aa('0x3a')]));_0x48eecc['attributes']=_0x48eecc[_0xd4aa('0x39')]['length']?_0x48eecc[_0xd4aa('0x39')]:_0x1467ae['model'];if(!_0xe2d0a1['query'][_0xd4aa('0x3b')](_0xd4aa('0x3c'))){_0x48eecc['limit']=qs['limit'](_0xe2d0a1[_0xd4aa('0x36')][_0xd4aa('0x20')]);_0x48eecc[_0xd4aa('0x1e')]=qs['offset'](_0xe2d0a1[_0xd4aa('0x36')][_0xd4aa('0x1e')]);}_0x48eecc['order']=qs[_0xd4aa('0x3d')](_0xe2d0a1[_0xd4aa('0x36')][_0xd4aa('0x3d')]);_0x48eecc['where']=qs['filters'](_['pick'](_0xe2d0a1['query'],_0x1467ae[_0xd4aa('0x3e')]),_0x438cb6);if(_0xe2d0a1[_0xd4aa('0x36')][_0xd4aa('0x3f')]){_0x48eecc[_0xd4aa('0x40')]=_[_0xd4aa('0x41')](_0x48eecc[_0xd4aa('0x40')],{'$or':_[_0xd4aa('0x2f')](_0x438cb6,function(_0x52f005){if(_0x52f005[_0xd4aa('0x33')]!==_0xd4aa('0x42')){var _0x3a313a={};_0x3a313a[_0x52f005[_0xd4aa('0x2c')]]={'$like':'%'+_0xe2d0a1['query'][_0xd4aa('0x3f')]+'%'};return _0x3a313a;}})});}_0x48eecc=_[_0xd4aa('0x41')]({},_0x48eecc,_0xe2d0a1[_0xd4aa('0x43')]);var _0x6bdc72={'where':_0x48eecc[_0xd4aa('0x40')]};return db[_0xd4aa('0x30')][_0xd4aa('0x21')](_0x6bdc72)[_0xd4aa('0x28')](function(_0x43fb23){_0x51d93e[_0xd4aa('0x21')]=_0x43fb23;if(_0xe2d0a1[_0xd4aa('0x36')][_0xd4aa('0x44')]){_0x48eecc[_0xd4aa('0x45')]=[{'all':!![]}];}return db[_0xd4aa('0x30')][_0xd4aa('0x46')](_0x48eecc);})['then'](function(_0x36b8dd){_0x51d93e[_0xd4aa('0x47')]=_0x36b8dd;return _0x51d93e;})[_0xd4aa('0x28')](respondWithFilteredResult(_0x58ff45,_0x48eecc))[_0xd4aa('0x48')](handleError(_0x58ff45,null));};exports['show']=function(_0x1780d9,_0x1a6247){var _0x2685f4={'raw':![],'where':{'id':_0x1780d9[_0xd4aa('0x49')]['id']}},_0x5018c2={};_0x5018c2[_0xd4aa('0x35')]=_[_0xd4aa('0x37')](db[_0xd4aa('0x30')][_0xd4aa('0x31')]);_0x5018c2[_0xd4aa('0x36')]=_[_0xd4aa('0x37')](_0x1780d9['query']);_0x5018c2[_0xd4aa('0x3e')]=_['intersection'](_0x5018c2['model'],_0x5018c2[_0xd4aa('0x36')]);_0x2685f4[_0xd4aa('0x39')]=_[_0xd4aa('0x38')](_0x5018c2[_0xd4aa('0x35')],qs[_0xd4aa('0x3a')](_0x1780d9[_0xd4aa('0x36')][_0xd4aa('0x3a')]));_0x2685f4[_0xd4aa('0x39')]=_0x2685f4[_0xd4aa('0x39')][_0xd4aa('0x4a')]?_0x2685f4[_0xd4aa('0x39')]:_0x5018c2[_0xd4aa('0x35')];if(_0x1780d9[_0xd4aa('0x36')]['includeAll']){_0x2685f4[_0xd4aa('0x45')]=[{'all':!![]}];}_0x2685f4=_[_0xd4aa('0x41')]({},_0x2685f4,_0x1780d9['options']);return db[_0xd4aa('0x30')][_0xd4aa('0x4b')](_0x2685f4)['then'](handleEntityNotFound(_0x1a6247,null))[_0xd4aa('0x28')](respondWithResult(_0x1a6247,null))[_0xd4aa('0x48')](handleError(_0x1a6247,null));};exports[_0xd4aa('0x4c')]=function(_0x2d14e8,_0x48e66c){return db['FreshsalesConfiguration'][_0xd4aa('0x4c')](_0x2d14e8[_0xd4aa('0x4d')],{})[_0xd4aa('0x28')](respondWithResult(_0x48e66c,0xc9))[_0xd4aa('0x48')](handleError(_0x48e66c,null));};exports[_0xd4aa('0x27')]=function(_0x143be0,_0x1b83e5){if(_0x143be0[_0xd4aa('0x4d')]['id']){delete _0x143be0['body']['id'];}return db[_0xd4aa('0x30')][_0xd4aa('0x4b')]({'where':{'id':_0x143be0[_0xd4aa('0x49')]['id']}})[_0xd4aa('0x28')](handleEntityNotFound(_0x1b83e5,null))['then'](saveUpdates(_0x143be0['body'],null))[_0xd4aa('0x28')](respondWithResult(_0x1b83e5,null))[_0xd4aa('0x48')](handleError(_0x1b83e5,null));};exports[_0xd4aa('0x29')]=function(_0x2e7cc0,_0x1b396f){return db['FreshsalesConfiguration'][_0xd4aa('0x4b')]({'where':{'id':_0x2e7cc0[_0xd4aa('0x49')]['id']}})[_0xd4aa('0x28')](handleEntityNotFound(_0x1b396f,null))[_0xd4aa('0x28')](removeEntity(_0x1b396f,null))['catch'](handleError(_0x1b396f,null));};exports[_0xd4aa('0x4e')]=function(_0xaf9056,_0x25d941,_0x43fb97){var _0x1859eb={};var _0x527f77={};var _0x23a9b8;var _0xc289db;return db[_0xd4aa('0x30')][_0xd4aa('0x4f')]({'where':{'id':_0xaf9056[_0xd4aa('0x49')]['id']}})[_0xd4aa('0x28')](handleEntityNotFound(_0x25d941,null))[_0xd4aa('0x28')](function(_0x1c9c26){if(_0x1c9c26){_0x23a9b8=_0x1c9c26;_0x527f77[_0xd4aa('0x35')]=_['keys'](db[_0xd4aa('0x50')][_0xd4aa('0x31')]);_0x527f77[_0xd4aa('0x36')]=_[_0xd4aa('0x37')](_0xaf9056[_0xd4aa('0x36')]);_0x527f77[_0xd4aa('0x3e')]=_[_0xd4aa('0x38')](_0x527f77[_0xd4aa('0x35')],_0x527f77[_0xd4aa('0x36')]);_0x1859eb[_0xd4aa('0x39')]=_[_0xd4aa('0x38')](_0x527f77[_0xd4aa('0x35')],qs[_0xd4aa('0x3a')](_0xaf9056[_0xd4aa('0x36')][_0xd4aa('0x3a')]));_0x1859eb['attributes']=_0x1859eb[_0xd4aa('0x39')][_0xd4aa('0x4a')]?_0x1859eb[_0xd4aa('0x39')]:_0x527f77[_0xd4aa('0x35')];_0x1859eb[_0xd4aa('0x51')]=qs[_0xd4aa('0x3d')](_0xaf9056['query'][_0xd4aa('0x3d')]);_0x1859eb[_0xd4aa('0x40')]=qs[_0xd4aa('0x3e')](_[_0xd4aa('0x52')](_0xaf9056[_0xd4aa('0x36')],_0x527f77[_0xd4aa('0x3e')]));if(_0xaf9056['query'][_0xd4aa('0x3f')]){_0x1859eb[_0xd4aa('0x40')]=_['merge'](_0x1859eb[_0xd4aa('0x40')],{'$or':_[_0xd4aa('0x2f')](_0x1859eb[_0xd4aa('0x39')],function(_0x66243){var _0x1e7d7e={};_0x1e7d7e[_0x66243]={'$like':'%'+_0xaf9056[_0xd4aa('0x36')]['filter']+'%'};return _0x1e7d7e;})});}_0x1859eb=_[_0xd4aa('0x41')]({},_0x1859eb,_0xaf9056[_0xd4aa('0x43')]);return _0x23a9b8['getSubjects'](_0x1859eb);}})[_0xd4aa('0x28')](function(_0x26f32b){if(_0x26f32b){_0xc289db=_0x26f32b[_0xd4aa('0x4a')];if(!_0xaf9056[_0xd4aa('0x36')]['hasOwnProperty'](_0xd4aa('0x3c'))){_0x1859eb[_0xd4aa('0x20')]=qs[_0xd4aa('0x20')](_0xaf9056['query'][_0xd4aa('0x20')]);_0x1859eb[_0xd4aa('0x1e')]=qs[_0xd4aa('0x1e')](_0xaf9056[_0xd4aa('0x36')]['offset']);}return _0x23a9b8[_0xd4aa('0x4e')](_0x1859eb);}})[_0xd4aa('0x28')](function(_0x1951d4){if(_0x1951d4){return _0x1951d4?{'count':_0xc289db,'rows':_0x1951d4}:null;}})[_0xd4aa('0x28')](respondWithResult(_0x25d941,null))['catch'](handleError(_0x25d941,null));};exports[_0xd4aa('0x53')]=function(_0x5bcda8,_0x59c774,_0x3f6014){var _0x10a0dd={};var _0x34cda3={};var _0x2bdd5e;var _0x348ab9;return db[_0xd4aa('0x30')][_0xd4aa('0x4f')]({'where':{'id':_0x5bcda8[_0xd4aa('0x49')]['id']}})[_0xd4aa('0x28')](handleEntityNotFound(_0x59c774,null))[_0xd4aa('0x28')](function(_0x368041){if(_0x368041){_0x2bdd5e=_0x368041;_0x34cda3['model']=_['keys'](db[_0xd4aa('0x50')][_0xd4aa('0x31')]);_0x34cda3[_0xd4aa('0x36')]=_[_0xd4aa('0x37')](_0x5bcda8[_0xd4aa('0x36')]);_0x34cda3[_0xd4aa('0x3e')]=_[_0xd4aa('0x38')](_0x34cda3[_0xd4aa('0x35')],_0x34cda3[_0xd4aa('0x36')]);_0x10a0dd[_0xd4aa('0x39')]=_[_0xd4aa('0x38')](_0x34cda3['model'],qs['fields'](_0x5bcda8['query']['fields']));_0x10a0dd[_0xd4aa('0x39')]=_0x10a0dd[_0xd4aa('0x39')]['length']?_0x10a0dd[_0xd4aa('0x39')]:_0x34cda3['model'];_0x10a0dd['order']=qs[_0xd4aa('0x3d')](_0x5bcda8[_0xd4aa('0x36')]['sort']);_0x10a0dd[_0xd4aa('0x40')]=qs[_0xd4aa('0x3e')](_[_0xd4aa('0x52')](_0x5bcda8[_0xd4aa('0x36')],_0x34cda3[_0xd4aa('0x3e')]));if(_0x5bcda8['query'][_0xd4aa('0x3f')]){_0x10a0dd['where']=_[_0xd4aa('0x41')](_0x10a0dd[_0xd4aa('0x40')],{'$or':_[_0xd4aa('0x2f')](_0x10a0dd[_0xd4aa('0x39')],function(_0xe22cc8){var _0x27f9ef={};_0x27f9ef[_0xe22cc8]={'$like':'%'+_0x5bcda8[_0xd4aa('0x36')][_0xd4aa('0x3f')]+'%'};return _0x27f9ef;})});}_0x10a0dd=_[_0xd4aa('0x41')]({},_0x10a0dd,_0x5bcda8[_0xd4aa('0x43')]);return _0x2bdd5e[_0xd4aa('0x53')](_0x10a0dd);}})[_0xd4aa('0x28')](function(_0x27b67f){if(_0x27b67f){_0x348ab9=_0x27b67f[_0xd4aa('0x4a')];if(!_0x5bcda8[_0xd4aa('0x36')][_0xd4aa('0x3b')](_0xd4aa('0x3c'))){_0x10a0dd[_0xd4aa('0x20')]=qs[_0xd4aa('0x20')](_0x5bcda8['query'][_0xd4aa('0x20')]);_0x10a0dd[_0xd4aa('0x1e')]=qs[_0xd4aa('0x1e')](_0x5bcda8[_0xd4aa('0x36')][_0xd4aa('0x1e')]);}return _0x2bdd5e['getDescriptions'](_0x10a0dd);}})['then'](function(_0x391bf3){if(_0x391bf3){return _0x391bf3?{'count':_0x348ab9,'rows':_0x391bf3}:null;}})[_0xd4aa('0x28')](respondWithResult(_0x59c774,null))[_0xd4aa('0x48')](handleError(_0x59c774,null));};exports[_0xd4aa('0x54')]=function(_0x137e61,_0x429448,_0x241ac6){var _0x53d838={};var _0x47d61c={};var _0x3df230;var _0x289e24;return db['FreshsalesConfiguration'][_0xd4aa('0x4f')]({'where':{'id':_0x137e61[_0xd4aa('0x49')]['id']}})[_0xd4aa('0x28')](handleEntityNotFound(_0x429448,null))[_0xd4aa('0x28')](function(_0x272056){if(_0x272056){_0x3df230=_0x272056;_0x47d61c[_0xd4aa('0x35')]=_[_0xd4aa('0x37')](db[_0xd4aa('0x50')][_0xd4aa('0x31')]);_0x47d61c[_0xd4aa('0x36')]=_[_0xd4aa('0x37')](_0x137e61[_0xd4aa('0x36')]);_0x47d61c[_0xd4aa('0x3e')]=_[_0xd4aa('0x38')](_0x47d61c[_0xd4aa('0x35')],_0x47d61c[_0xd4aa('0x36')]);_0x53d838['attributes']=_['intersection'](_0x47d61c[_0xd4aa('0x35')],qs[_0xd4aa('0x3a')](_0x137e61[_0xd4aa('0x36')][_0xd4aa('0x3a')]));_0x53d838[_0xd4aa('0x39')]=_0x53d838[_0xd4aa('0x39')][_0xd4aa('0x4a')]?_0x53d838[_0xd4aa('0x39')]:_0x47d61c[_0xd4aa('0x35')];_0x53d838['order']=qs['sort'](_0x137e61[_0xd4aa('0x36')][_0xd4aa('0x3d')]);_0x53d838[_0xd4aa('0x40')]=qs[_0xd4aa('0x3e')](_['pick'](_0x137e61['query'],_0x47d61c[_0xd4aa('0x3e')]));if(_0x137e61[_0xd4aa('0x36')][_0xd4aa('0x3f')]){_0x53d838['where']=_[_0xd4aa('0x41')](_0x53d838[_0xd4aa('0x40')],{'$or':_[_0xd4aa('0x2f')](_0x53d838[_0xd4aa('0x39')],function(_0x357a41){var _0x23a036={};_0x23a036[_0x357a41]={'$like':'%'+_0x137e61[_0xd4aa('0x36')][_0xd4aa('0x3f')]+'%'};return _0x23a036;})});}_0x53d838=_[_0xd4aa('0x41')]({},_0x53d838,_0x137e61[_0xd4aa('0x43')]);return _0x3df230[_0xd4aa('0x54')](_0x53d838);}})[_0xd4aa('0x28')](function(_0x5499a1){if(_0x5499a1){_0x289e24=_0x5499a1[_0xd4aa('0x4a')];if(!_0x137e61[_0xd4aa('0x36')]['hasOwnProperty']('nolimit')){_0x53d838['limit']=qs[_0xd4aa('0x20')](_0x137e61[_0xd4aa('0x36')][_0xd4aa('0x20')]);_0x53d838[_0xd4aa('0x1e')]=qs[_0xd4aa('0x1e')](_0x137e61['query'][_0xd4aa('0x1e')]);}return _0x3df230[_0xd4aa('0x54')](_0x53d838);}})['then'](function(_0x3f250b){if(_0x3f250b){return _0x3f250b?{'count':_0x289e24,'rows':_0x3f250b}:null;}})[_0xd4aa('0x28')](respondWithResult(_0x429448,null))[_0xd4aa('0x48')](handleError(_0x429448,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 5842607..1bcaf68 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 _0x9e64=['rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','FreshsalesConfiguration','int_freshsales_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4d33bd,_0x25aa88){var _0x17bdcc=function(_0x39197f){while(--_0x39197f){_0x4d33bd['push'](_0x4d33bd['shift']());}};_0x17bdcc(++_0x25aa88);}(_0x9e64,0x157));var _0x49e6=function(_0x31d7a7,_0x51b927){_0x31d7a7=_0x31d7a7-0x0;var _0x46b958=_0x9e64[_0x31d7a7];return _0x46b958;};'use strict';var _=require(_0x49e6('0x0'));var util=require(_0x49e6('0x1'));var logger=require(_0x49e6('0x2'))(_0x49e6('0x3'));var moment=require(_0x49e6('0x4'));var BPromise=require(_0x49e6('0x5'));var rp=require(_0x49e6('0x6'));var fs=require('fs');var path=require(_0x49e6('0x7'));var rimraf=require(_0x49e6('0x8'));var config=require(_0x49e6('0x9'));var attributes=require(_0x49e6('0xa'));module['exports']=function(_0x271640,_0x409d0a){return _0x271640['define'](_0x49e6('0xb'),attributes,{'tableName':_0x49e6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9434=['./intFreshsalesConfiguration.attributes','define','int_freshsales_configurations','lodash','util','api','moment','request-promise','path','../../config/environment'];(function(_0x6bd326,_0x1cf166){var _0x15e2e1=function(_0x3ffdbe){while(--_0x3ffdbe){_0x6bd326['push'](_0x6bd326['shift']());}};_0x15e2e1(++_0x1cf166);}(_0x9434,0x193));var _0x4943=function(_0x48cfb4,_0x53d18b){_0x48cfb4=_0x48cfb4-0x0;var _0x411971=_0x9434[_0x48cfb4];return _0x411971;};'use strict';var _=require(_0x4943('0x0'));var util=require(_0x4943('0x1'));var logger=require('../../config/logger')(_0x4943('0x2'));var moment=require(_0x4943('0x3'));var BPromise=require('bluebird');var rp=require(_0x4943('0x4'));var fs=require('fs');var path=require(_0x4943('0x5'));var rimraf=require('rimraf');var config=require(_0x4943('0x6'));var attributes=require(_0x4943('0x7'));module['exports']=function(_0x6ea7a5,_0x1c6be5){return _0x6ea7a5[_0x4943('0x8')]('FreshsalesConfiguration',attributes,{'tableName':_0x4943('0x9'),'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 60f7e93..025b280 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 _0x331e=['stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x751643,_0x3c6557){var _0x21a413=function(_0x2336a4){while(--_0x2336a4){_0x751643['push'](_0x751643['shift']());}};_0x21a413(++_0x3c6557);}(_0x331e,0x18c));var _0xe331=function(_0x395028,_0x5dccef){_0x395028=_0x395028-0x0;var _0x15c1b2=_0x331e[_0x395028];return _0x15c1b2;};'use strict';var _=require('lodash');var util=require(_0xe331('0x0'));var moment=require(_0xe331('0x1'));var BPromise=require(_0xe331('0x2'));var rs=require(_0xe331('0x3'));var fs=require('fs');var Redis=require(_0xe331('0x4'));var db=require(_0xe331('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe331('0x6'))('rpc');var config=require(_0xe331('0x7'));var jayson=require(_0xe331('0x8'));var client=jayson[_0xe331('0x9')][_0xe331('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4a93ab,_0x2432dd,_0x5520d6){return new BPromise(function(_0x316fd6,_0x4b9d59){return client[_0xe331('0xb')](_0x4a93ab,_0x5520d6)[_0xe331('0xc')](function(_0x3d2e52){logger[_0xe331('0xd')](_0xe331('0xe'),_0x2432dd,_0xe331('0xf'));logger[_0xe331('0x10')](_0xe331('0x11'),_0x2432dd,_0xe331('0xf'),JSON[_0xe331('0x12')](_0x3d2e52));if(_0x3d2e52['error']){if(_0x3d2e52[_0xe331('0x13')]['code']===0x1f4){logger['error'](_0xe331('0xe'),_0x2432dd,_0x3d2e52[_0xe331('0x13')][_0xe331('0x14')]);return _0x4b9d59(_0x3d2e52[_0xe331('0x13')]['message']);}logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0x2432dd,_0x3d2e52[_0xe331('0x13')][_0xe331('0x14')]);return _0x316fd6(_0x3d2e52[_0xe331('0x13')][_0xe331('0x14')]);}else{logger[_0xe331('0xd')](_0xe331('0xe'),_0x2432dd,_0xe331('0xf'));_0x316fd6(_0x3d2e52[_0xe331('0x15')]['message']);}})[_0xe331('0x16')](function(_0x31f62c){logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0x2432dd,_0x31f62c);_0x4b9d59(_0x31f62c);});});} \ No newline at end of file +var _0x722a=['../../config/logger','rpc','../../config/environment','http','request','then','request\x20sent','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshsalesConfiguration,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3c5e27,_0x4ff083){var _0x4c1216=function(_0x1d8eb0){while(--_0x1d8eb0){_0x3c5e27['push'](_0x3c5e27['shift']());}};_0x4c1216(++_0x4ff083);}(_0x722a,0x159));var _0xa722=function(_0x48799c,_0x2b51a9){_0x48799c=_0x48799c-0x0;var _0x19db84=_0x722a[_0x48799c];return _0x19db84;};'use strict';var _=require(_0xa722('0x0'));var util=require(_0xa722('0x1'));var moment=require(_0xa722('0x2'));var BPromise=require(_0xa722('0x3'));var rs=require(_0xa722('0x4'));var fs=require('fs');var Redis=require(_0xa722('0x5'));var db=require(_0xa722('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xa722('0x7'))(_0xa722('0x8'));var config=require(_0xa722('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa722('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x27d5d0,_0x483d9f,_0x28d7b2){return new BPromise(function(_0x6ccb7c,_0x356b7c){return client[_0xa722('0xb')](_0x27d5d0,_0x28d7b2)[_0xa722('0xc')](function(_0x2bf2fa){logger['info']('FreshsalesConfiguration,\x20%s,\x20%s',_0x483d9f,_0xa722('0xd'));logger['debug'](_0xa722('0xe'),_0x483d9f,'request\x20sent',JSON[_0xa722('0xf')](_0x2bf2fa));if(_0x2bf2fa['error']){if(_0x2bf2fa[_0xa722('0x10')][_0xa722('0x11')]===0x1f4){logger[_0xa722('0x10')](_0xa722('0x12'),_0x483d9f,_0x2bf2fa[_0xa722('0x10')][_0xa722('0x13')]);return _0x356b7c(_0x2bf2fa[_0xa722('0x10')][_0xa722('0x13')]);}logger[_0xa722('0x10')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x483d9f,_0x2bf2fa['error']['message']);return _0x6ccb7c(_0x2bf2fa['error'][_0xa722('0x13')]);}else{logger[_0xa722('0x14')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x483d9f,_0xa722('0xd'));_0x6ccb7c(_0x2bf2fa[_0xa722('0x15')][_0xa722('0x13')]);}})['catch'](function(_0x5073f8){logger[_0xa722('0x10')](_0xa722('0x12'),_0x483d9f,_0x5073f8);_0x356b7c(_0x5073f8);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 950fe84..b2598c3 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 _0x938c=['connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index','/:id','post','put','update','delete','destroy','exports','multer','util'];(function(_0x377506,_0x1e4dc2){var _0x1f0d81=function(_0x4a25ed){while(--_0x4a25ed){_0x377506['push'](_0x377506['shift']());}};_0x1f0d81(++_0x1e4dc2);}(_0x938c,0x11f));var _0xc938=function(_0x36b07b,_0x530cb1){_0x36b07b=_0x36b07b-0x0;var _0x2a7136=_0x938c[_0x36b07b];return _0x2a7136;};'use strict';var multer=require(_0xc938('0x0'));var util=require(_0xc938('0x1'));var path=require('path');var timeout=require(_0xc938('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xc938('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xc938('0x4'));var config=require(_0xc938('0x5'));var controller=require(_0xc938('0x6'));router[_0xc938('0x7')]('/',auth[_0xc938('0x8')](),controller[_0xc938('0x9')]);router['get'](_0xc938('0xa'),auth[_0xc938('0x8')](),controller['show']);router[_0xc938('0xb')]('/',auth[_0xc938('0x8')](),controller['create']);router[_0xc938('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xc938('0xd')]);router[_0xc938('0xe')](_0xc938('0xa'),auth['isAuthenticated'](),controller[_0xc938('0xf')]);module[_0xc938('0x10')]=router; \ No newline at end of file +var _0x5d55=['post','create','put','update','destroy','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshsalesField.controller','get','isAuthenticated','index','/:id','show'];(function(_0x14a36b,_0x3991ec){var _0xfd5580=function(_0x89bd62){while(--_0x89bd62){_0x14a36b['push'](_0x14a36b['shift']());}};_0xfd5580(++_0x3991ec);}(_0x5d55,0x1a4));var _0x55d5=function(_0x138c20,_0x42374d){_0x138c20=_0x138c20-0x0;var _0x15bde1=_0x5d55[_0x138c20];return _0x15bde1;};'use strict';var multer=require('multer');var util=require(_0x55d5('0x0'));var path=require('path');var timeout=require(_0x55d5('0x1'));var express=require(_0x55d5('0x2'));var router=express['Router']();var fs_extra=require(_0x55d5('0x3'));var auth=require(_0x55d5('0x4'));var interaction=require(_0x55d5('0x5'));var config=require('../../config/environment');var controller=require(_0x55d5('0x6'));router[_0x55d5('0x7')]('/',auth[_0x55d5('0x8')](),controller[_0x55d5('0x9')]);router[_0x55d5('0x7')](_0x55d5('0xa'),auth[_0x55d5('0x8')](),controller[_0x55d5('0xb')]);router[_0x55d5('0xc')]('/',auth['isAuthenticated'](),controller[_0x55d5('0xd')]);router[_0x55d5('0xe')](_0x55d5('0xa'),auth[_0x55d5('0x8')](),controller[_0x55d5('0xf')]);router['delete'](_0x55d5('0xa'),auth['isAuthenticated'](),controller[_0x55d5('0x10')]);module[_0x55d5('0x11')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 083944a..16e53f9 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 _0x601a=['picklist','STRING','BOOLEAN','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x2ce114,_0x2e8bf5){var _0x23937f=function(_0x193a7e){while(--_0x193a7e){_0x2ce114['push'](_0x2ce114['shift']());}};_0x23937f(++_0x2e8bf5);}(_0x601a,0x1bc));var _0xa601=function(_0x148b6f,_0x448c22){_0x148b6f=_0x148b6f-0x0;var _0x17e9c2=_0x601a[_0x148b6f];return _0x17e9c2;};'use strict';var Sequelize=require('sequelize');module[_0xa601('0x0')]={'type':{'type':Sequelize[_0xa601('0x1')](_0xa601('0x2'),_0xa601('0x3'),_0xa601('0x4'),_0xa601('0x5'),_0xa601('0x6')),'defaultValue':_0xa601('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xa601('0x7')]},'keyType':{'type':Sequelize[_0xa601('0x1')](_0xa601('0x2'),_0xa601('0x3'),_0xa601('0x4'))},'keyContent':{'type':Sequelize[_0xa601('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xa601('0x7')]},'customField':{'type':Sequelize[_0xa601('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa601('0x7')]}}; \ No newline at end of file +var _0x371b=['variable','customVariable','keyValue','picklist','STRING','BOOLEAN','exports','ENUM','string'];(function(_0x480e2,_0x2b6b83){var _0x21d4ec=function(_0x4d99e7){while(--_0x4d99e7){_0x480e2['push'](_0x480e2['shift']());}};_0x21d4ec(++_0x2b6b83);}(_0x371b,0x12f));var _0xb371=function(_0x243cca,_0x514c2d){_0x243cca=_0x243cca-0x0;var _0xf94771=_0x371b[_0x243cca];return _0xf94771;};'use strict';var Sequelize=require('sequelize');module[_0xb371('0x0')]={'type':{'type':Sequelize[_0xb371('0x1')](_0xb371('0x2'),_0xb371('0x3'),_0xb371('0x4'),_0xb371('0x5'),_0xb371('0x6')),'defaultValue':_0xb371('0x2')},'content':{'type':Sequelize[_0xb371('0x7')]},'key':{'type':Sequelize[_0xb371('0x7')]},'keyType':{'type':Sequelize[_0xb371('0x1')](_0xb371('0x2'),'variable',_0xb371('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xb371('0x7')]},'nameField':{'type':Sequelize[_0xb371('0x7')]},'customField':{'type':Sequelize[_0xb371('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb371('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 949994b..9e0be23 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 _0xacd0=['rows','show','params','length','catch','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','Content-Range','json','apply','reject','save','update','then','error','name','index','map','rawAttributes','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','filter','merge','options','FreshsalesField','includeAll','include','findAll'];(function(_0x2376d1,_0x38eec4){var _0x443759=function(_0x73c733){while(--_0x73c733){_0x2376d1['push'](_0x2376d1['shift']());}};_0x443759(++_0x38eec4);}(_0xacd0,0x170));var _0x0acd=function(_0x497880,_0x430dbc){_0x497880=_0x497880-0x0;var _0x1a3d4b=_0xacd0[_0x497880];return _0x1a3d4b;};'use strict';var emlformat=require(_0x0acd('0x0'));var rimraf=require(_0x0acd('0x1'));var zipdir=require(_0x0acd('0x2'));var jsonpatch=require(_0x0acd('0x3'));var rp=require(_0x0acd('0x4'));var moment=require(_0x0acd('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0acd('0x6'));var util=require(_0x0acd('0x7'));var path=require('path');var sox=require(_0x0acd('0x8'));var csv=require(_0x0acd('0x9'));var ejs=require(_0x0acd('0xa'));var fs=require('fs');var fs_extra=require(_0x0acd('0xb'));var _=require(_0x0acd('0xc'));var squel=require('squel');var crypto=require(_0x0acd('0xd'));var jsforce=require(_0x0acd('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0acd('0x9'));var querystring=require(_0x0acd('0xf'));var Papa=require(_0x0acd('0x10'));var Redis=require(_0x0acd('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x0acd('0x12'));var as=require(_0x0acd('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0acd('0x14'));var utils=require(_0x0acd('0x15'));var config=require(_0x0acd('0x16'));var licenseUtil=require(_0x0acd('0x17'));var db=require(_0x0acd('0x18'))['db'];function respondWithStatusCode(_0x362525,_0xeca73b){_0xeca73b=_0xeca73b||0xcc;return function(_0x473087){if(_0x473087){return _0x362525[_0x0acd('0x19')](_0xeca73b);}return _0x362525[_0x0acd('0x1a')](_0xeca73b)[_0x0acd('0x1b')]();};}function respondWithResult(_0x5062d3,_0x2d6ceb){_0x2d6ceb=_0x2d6ceb||0xc8;return function(_0x180250){if(_0x180250){return _0x5062d3[_0x0acd('0x1a')](_0x2d6ceb)['json'](_0x180250);}};}function respondWithFilteredResult(_0x326b6,_0x104208){return function(_0x117d8d){if(_0x117d8d){var _0x1a3cdc=typeof _0x104208[_0x0acd('0x1c')]==='undefined'&&typeof _0x104208[_0x0acd('0x1d')]===_0x0acd('0x1e');var _0x41c5d6=_0x117d8d[_0x0acd('0x1f')];var _0x1cb926=_0x1a3cdc?0x0:_0x104208['offset'];var _0x370e3c=_0x1a3cdc?_0x117d8d[_0x0acd('0x1f')]:_0x104208[_0x0acd('0x1c')]+_0x104208['limit'];var _0x300172;if(_0x370e3c>=_0x41c5d6){_0x370e3c=_0x41c5d6;_0x300172=0xc8;}else{_0x300172=0xce;}_0x326b6[_0x0acd('0x1a')](_0x300172);return _0x326b6['set'](_0x0acd('0x20'),_0x1cb926+'-'+_0x370e3c+'/'+_0x41c5d6)[_0x0acd('0x21')](_0x117d8d);}return null;};}function patchUpdates(_0x100f4c){return function(_0x1fb069){try{jsonpatch[_0x0acd('0x22')](_0x1fb069,_0x100f4c,!![]);}catch(_0x2f30ec){return BPromise[_0x0acd('0x23')](_0x2f30ec);}return _0x1fb069[_0x0acd('0x24')]();};}function saveUpdates(_0x2c5156,_0x4f7cce){return function(_0x293c78){if(_0x293c78){return _0x293c78[_0x0acd('0x25')](_0x2c5156)[_0x0acd('0x26')](function(_0x40bfb3){return _0x40bfb3;});}return null;};}function removeEntity(_0x2f9a55,_0x19f080){return function(_0x4189b7){if(_0x4189b7){return _0x4189b7['destroy']()['then'](function(){_0x2f9a55[_0x0acd('0x1a')](0xcc)[_0x0acd('0x1b')]();});}};}function handleEntityNotFound(_0x2d9539,_0x1a5090){return function(_0x58c614){if(!_0x58c614){_0x2d9539[_0x0acd('0x19')](0x194);}return _0x58c614;};}function handleError(_0x5ddd02,_0x1e4513){_0x1e4513=_0x1e4513||0x1f4;return function(_0x528585){logger[_0x0acd('0x27')](_0x528585['stack']);if(_0x528585['name']){delete _0x528585[_0x0acd('0x28')];}_0x5ddd02[_0x0acd('0x1a')](_0x1e4513)['send'](_0x528585);};}exports[_0x0acd('0x29')]=function(_0x28ec4a,_0xe01411){var _0x15468b={},_0x4e1a43={},_0x5f129c={'count':0x0,'rows':[]};var _0x35d127=_[_0x0acd('0x2a')](db['FreshsalesField'][_0x0acd('0x2b')],function(_0x3a67b2){return{'name':_0x3a67b2['fieldName'],'type':_0x3a67b2[_0x0acd('0x2c')]['key']};});_0x4e1a43[_0x0acd('0x2d')]=_[_0x0acd('0x2a')](_0x35d127,_0x0acd('0x28'));_0x4e1a43[_0x0acd('0x2e')]=_[_0x0acd('0x2f')](_0x28ec4a[_0x0acd('0x2e')]);_0x4e1a43['filters']=_[_0x0acd('0x30')](_0x4e1a43[_0x0acd('0x2d')],_0x4e1a43[_0x0acd('0x2e')]);_0x15468b[_0x0acd('0x31')]=_['intersection'](_0x4e1a43[_0x0acd('0x2d')],qs[_0x0acd('0x32')](_0x28ec4a[_0x0acd('0x2e')][_0x0acd('0x32')]));_0x15468b[_0x0acd('0x31')]=_0x15468b[_0x0acd('0x31')]['length']?_0x15468b[_0x0acd('0x31')]:_0x4e1a43[_0x0acd('0x2d')];if(!_0x28ec4a[_0x0acd('0x2e')][_0x0acd('0x33')]('nolimit')){_0x15468b[_0x0acd('0x1d')]=qs[_0x0acd('0x1d')](_0x28ec4a[_0x0acd('0x2e')][_0x0acd('0x1d')]);_0x15468b[_0x0acd('0x1c')]=qs[_0x0acd('0x1c')](_0x28ec4a[_0x0acd('0x2e')]['offset']);}_0x15468b[_0x0acd('0x34')]=qs[_0x0acd('0x35')](_0x28ec4a[_0x0acd('0x2e')][_0x0acd('0x35')]);_0x15468b[_0x0acd('0x36')]=qs[_0x0acd('0x37')](_[_0x0acd('0x38')](_0x28ec4a[_0x0acd('0x2e')],_0x4e1a43[_0x0acd('0x37')]),_0x35d127);if(_0x28ec4a[_0x0acd('0x2e')][_0x0acd('0x39')]){_0x15468b['where']=_[_0x0acd('0x3a')](_0x15468b[_0x0acd('0x36')],{'$or':_[_0x0acd('0x2a')](_0x35d127,function(_0x291d53){if(_0x291d53[_0x0acd('0x2c')]!=='VIRTUAL'){var _0x1845c0={};_0x1845c0[_0x291d53[_0x0acd('0x28')]]={'$like':'%'+_0x28ec4a['query'][_0x0acd('0x39')]+'%'};return _0x1845c0;}})});}_0x15468b=_[_0x0acd('0x3a')]({},_0x15468b,_0x28ec4a[_0x0acd('0x3b')]);var _0x1a903d={'where':_0x15468b['where']};return db[_0x0acd('0x3c')][_0x0acd('0x1f')](_0x1a903d)[_0x0acd('0x26')](function(_0xe69582){_0x5f129c[_0x0acd('0x1f')]=_0xe69582;if(_0x28ec4a[_0x0acd('0x2e')][_0x0acd('0x3d')]){_0x15468b[_0x0acd('0x3e')]=[{'all':!![]}];}return db[_0x0acd('0x3c')][_0x0acd('0x3f')](_0x15468b);})[_0x0acd('0x26')](function(_0x16dad0){_0x5f129c[_0x0acd('0x40')]=_0x16dad0;return _0x5f129c;})[_0x0acd('0x26')](respondWithFilteredResult(_0xe01411,_0x15468b))['catch'](handleError(_0xe01411,null));};exports[_0x0acd('0x41')]=function(_0x59bdec,_0x268501){var _0x263cf8={'raw':!![],'where':{'id':_0x59bdec[_0x0acd('0x42')]['id']}},_0x330ecb={};_0x330ecb['model']=_[_0x0acd('0x2f')](db[_0x0acd('0x3c')][_0x0acd('0x2b')]);_0x330ecb[_0x0acd('0x2e')]=_['keys'](_0x59bdec[_0x0acd('0x2e')]);_0x330ecb['filters']=_[_0x0acd('0x30')](_0x330ecb[_0x0acd('0x2d')],_0x330ecb[_0x0acd('0x2e')]);_0x263cf8[_0x0acd('0x31')]=_[_0x0acd('0x30')](_0x330ecb[_0x0acd('0x2d')],qs[_0x0acd('0x32')](_0x59bdec['query'][_0x0acd('0x32')]));_0x263cf8['attributes']=_0x263cf8['attributes'][_0x0acd('0x43')]?_0x263cf8['attributes']:_0x330ecb['model'];if(_0x59bdec[_0x0acd('0x2e')][_0x0acd('0x3d')]){_0x263cf8[_0x0acd('0x3e')]=[{'all':!![]}];}_0x263cf8=_[_0x0acd('0x3a')]({},_0x263cf8,_0x59bdec['options']);return db['FreshsalesField']['find'](_0x263cf8)['then'](handleEntityNotFound(_0x268501,null))['then'](respondWithResult(_0x268501,null))[_0x0acd('0x44')](handleError(_0x268501,null));};exports[_0x0acd('0x45')]=function(_0x46c219,_0x2c293c){return db[_0x0acd('0x3c')][_0x0acd('0x45')](_0x46c219[_0x0acd('0x46')],{})[_0x0acd('0x26')](respondWithResult(_0x2c293c,0xc9))['catch'](handleError(_0x2c293c,null));};exports[_0x0acd('0x25')]=function(_0x1b875d,_0x53d4af){if(_0x1b875d[_0x0acd('0x46')]['id']){delete _0x1b875d[_0x0acd('0x46')]['id'];}return db[_0x0acd('0x3c')]['find']({'where':{'id':_0x1b875d['params']['id']}})[_0x0acd('0x26')](handleEntityNotFound(_0x53d4af,null))[_0x0acd('0x26')](saveUpdates(_0x1b875d[_0x0acd('0x46')],null))[_0x0acd('0x26')](respondWithResult(_0x53d4af,null))['catch'](handleError(_0x53d4af,null));};exports['destroy']=function(_0x4c80ca,_0x42db54){return db[_0x0acd('0x3c')][_0x0acd('0x47')]({'where':{'id':_0x4c80ca['params']['id']}})[_0x0acd('0x26')](handleEntityNotFound(_0x42db54,null))[_0x0acd('0x26')](removeEntity(_0x42db54,null))[_0x0acd('0x44')](handleError(_0x42db54,null));}; \ No newline at end of file +var _0xf8d5=['Content-Range','apply','reject','update','destroy','then','error','stack','name','send','map','FreshsalesField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','length','find','body','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x3ea328,_0x361d8a){var _0x527af6=function(_0x3255fb){while(--_0x3255fb){_0x3ea328['push'](_0x3ea328['shift']());}};_0x527af6(++_0x361d8a);}(_0xf8d5,0x76));var _0x5f8d=function(_0xb6c9bc,_0x44413e){_0xb6c9bc=_0xb6c9bc-0x0;var _0x2a9866=_0xf8d5[_0xb6c9bc];return _0x2a9866;};'use strict';var emlformat=require(_0x5f8d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5f8d('0x1'));var rp=require(_0x5f8d('0x2'));var moment=require(_0x5f8d('0x3'));var BPromise=require(_0x5f8d('0x4'));var Mustache=require(_0x5f8d('0x5'));var util=require('util');var path=require(_0x5f8d('0x6'));var sox=require('sox');var csv=require(_0x5f8d('0x7'));var ejs=require(_0x5f8d('0x8'));var fs=require('fs');var fs_extra=require(_0x5f8d('0x9'));var _=require(_0x5f8d('0xa'));var squel=require(_0x5f8d('0xb'));var crypto=require(_0x5f8d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5f8d('0xd'));var toCsv=require('to-csv');var querystring=require(_0x5f8d('0xe'));var Papa=require(_0x5f8d('0xf'));var Redis=require(_0x5f8d('0x10'));var authService=require(_0x5f8d('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x5f8d('0x12'));var hardwareService=require(_0x5f8d('0x13'));var logger=require(_0x5f8d('0x14'))('api');var utils=require(_0x5f8d('0x15'));var config=require(_0x5f8d('0x16'));var licenseUtil=require(_0x5f8d('0x17'));var db=require(_0x5f8d('0x18'))['db'];function respondWithStatusCode(_0x5a3a04,_0x56070e){_0x56070e=_0x56070e||0xcc;return function(_0x214564){if(_0x214564){return _0x5a3a04[_0x5f8d('0x19')](_0x56070e);}return _0x5a3a04[_0x5f8d('0x1a')](_0x56070e)[_0x5f8d('0x1b')]();};}function respondWithResult(_0x1e6e8d,_0x76a57d){_0x76a57d=_0x76a57d||0xc8;return function(_0x37063b){if(_0x37063b){return _0x1e6e8d[_0x5f8d('0x1a')](_0x76a57d)[_0x5f8d('0x1c')](_0x37063b);}};}function respondWithFilteredResult(_0x2302be,_0x46add1){return function(_0x57ad1a){if(_0x57ad1a){var _0x27b273=typeof _0x46add1[_0x5f8d('0x1d')]===_0x5f8d('0x1e')&&typeof _0x46add1[_0x5f8d('0x1f')]==='undefined';var _0x20ba19=_0x57ad1a['count'];var _0x4d33e8=_0x27b273?0x0:_0x46add1[_0x5f8d('0x1d')];var _0xa57acd=_0x27b273?_0x57ad1a[_0x5f8d('0x20')]:_0x46add1[_0x5f8d('0x1d')]+_0x46add1[_0x5f8d('0x1f')];var _0x3ef114;if(_0xa57acd>=_0x20ba19){_0xa57acd=_0x20ba19;_0x3ef114=0xc8;}else{_0x3ef114=0xce;}_0x2302be['status'](_0x3ef114);return _0x2302be[_0x5f8d('0x21')](_0x5f8d('0x22'),_0x4d33e8+'-'+_0xa57acd+'/'+_0x20ba19)[_0x5f8d('0x1c')](_0x57ad1a);}return null;};}function patchUpdates(_0x11ead0){return function(_0x84fe4d){try{jsonpatch[_0x5f8d('0x23')](_0x84fe4d,_0x11ead0,!![]);}catch(_0x3f834){return BPromise[_0x5f8d('0x24')](_0x3f834);}return _0x84fe4d['save']();};}function saveUpdates(_0xa1383b,_0x4e4df2){return function(_0x48db18){if(_0x48db18){return _0x48db18[_0x5f8d('0x25')](_0xa1383b)['then'](function(_0x370a6b){return _0x370a6b;});}return null;};}function removeEntity(_0x49df93,_0x9cdc19){return function(_0x56306a){if(_0x56306a){return _0x56306a[_0x5f8d('0x26')]()[_0x5f8d('0x27')](function(){_0x49df93['status'](0xcc)[_0x5f8d('0x1b')]();});}};}function handleEntityNotFound(_0x43038c,_0x2c33d8){return function(_0x4f22f3){if(!_0x4f22f3){_0x43038c[_0x5f8d('0x19')](0x194);}return _0x4f22f3;};}function handleError(_0x6736b6,_0x52ea45){_0x52ea45=_0x52ea45||0x1f4;return function(_0x13b8f5){logger[_0x5f8d('0x28')](_0x13b8f5[_0x5f8d('0x29')]);if(_0x13b8f5[_0x5f8d('0x2a')]){delete _0x13b8f5[_0x5f8d('0x2a')];}_0x6736b6[_0x5f8d('0x1a')](_0x52ea45)[_0x5f8d('0x2b')](_0x13b8f5);};}exports['index']=function(_0xa5927c,_0x30be6b){var _0x1fd2f7={},_0x44158a={},_0x3b547d={'count':0x0,'rows':[]};var _0x4b37dc=_[_0x5f8d('0x2c')](db[_0x5f8d('0x2d')][_0x5f8d('0x2e')],function(_0x3ed580){return{'name':_0x3ed580[_0x5f8d('0x2f')],'type':_0x3ed580[_0x5f8d('0x30')][_0x5f8d('0x31')]};});_0x44158a[_0x5f8d('0x32')]=_[_0x5f8d('0x2c')](_0x4b37dc,'name');_0x44158a[_0x5f8d('0x33')]=_[_0x5f8d('0x34')](_0xa5927c[_0x5f8d('0x33')]);_0x44158a[_0x5f8d('0x35')]=_[_0x5f8d('0x36')](_0x44158a['model'],_0x44158a['query']);_0x1fd2f7[_0x5f8d('0x37')]=_['intersection'](_0x44158a[_0x5f8d('0x32')],qs[_0x5f8d('0x38')](_0xa5927c[_0x5f8d('0x33')][_0x5f8d('0x38')]));_0x1fd2f7[_0x5f8d('0x37')]=_0x1fd2f7[_0x5f8d('0x37')]['length']?_0x1fd2f7[_0x5f8d('0x37')]:_0x44158a[_0x5f8d('0x32')];if(!_0xa5927c['query'][_0x5f8d('0x39')](_0x5f8d('0x3a'))){_0x1fd2f7[_0x5f8d('0x1f')]=qs[_0x5f8d('0x1f')](_0xa5927c[_0x5f8d('0x33')][_0x5f8d('0x1f')]);_0x1fd2f7[_0x5f8d('0x1d')]=qs[_0x5f8d('0x1d')](_0xa5927c[_0x5f8d('0x33')][_0x5f8d('0x1d')]);}_0x1fd2f7[_0x5f8d('0x3b')]=qs[_0x5f8d('0x3c')](_0xa5927c[_0x5f8d('0x33')][_0x5f8d('0x3c')]);_0x1fd2f7[_0x5f8d('0x3d')]=qs[_0x5f8d('0x35')](_[_0x5f8d('0x3e')](_0xa5927c['query'],_0x44158a[_0x5f8d('0x35')]),_0x4b37dc);if(_0xa5927c['query'][_0x5f8d('0x3f')]){_0x1fd2f7[_0x5f8d('0x3d')]=_[_0x5f8d('0x40')](_0x1fd2f7[_0x5f8d('0x3d')],{'$or':_['map'](_0x4b37dc,function(_0xd56752){if(_0xd56752[_0x5f8d('0x30')]!==_0x5f8d('0x41')){var _0x3a0065={};_0x3a0065[_0xd56752[_0x5f8d('0x2a')]]={'$like':'%'+_0xa5927c[_0x5f8d('0x33')]['filter']+'%'};return _0x3a0065;}})});}_0x1fd2f7=_[_0x5f8d('0x40')]({},_0x1fd2f7,_0xa5927c[_0x5f8d('0x42')]);var _0x47957d={'where':_0x1fd2f7[_0x5f8d('0x3d')]};return db[_0x5f8d('0x2d')][_0x5f8d('0x20')](_0x47957d)['then'](function(_0x271896){_0x3b547d['count']=_0x271896;if(_0xa5927c[_0x5f8d('0x33')][_0x5f8d('0x43')]){_0x1fd2f7[_0x5f8d('0x44')]=[{'all':!![]}];}return db[_0x5f8d('0x2d')][_0x5f8d('0x45')](_0x1fd2f7);})[_0x5f8d('0x27')](function(_0x1110d6){_0x3b547d[_0x5f8d('0x46')]=_0x1110d6;return _0x3b547d;})[_0x5f8d('0x27')](respondWithFilteredResult(_0x30be6b,_0x1fd2f7))[_0x5f8d('0x47')](handleError(_0x30be6b,null));};exports['show']=function(_0x526b49,_0x108905){var _0x6a0db3={'raw':!![],'where':{'id':_0x526b49[_0x5f8d('0x48')]['id']}},_0x5090c8={};_0x5090c8[_0x5f8d('0x32')]=_['keys'](db['FreshsalesField']['rawAttributes']);_0x5090c8['query']=_[_0x5f8d('0x34')](_0x526b49[_0x5f8d('0x33')]);_0x5090c8[_0x5f8d('0x35')]=_[_0x5f8d('0x36')](_0x5090c8[_0x5f8d('0x32')],_0x5090c8[_0x5f8d('0x33')]);_0x6a0db3['attributes']=_['intersection'](_0x5090c8[_0x5f8d('0x32')],qs[_0x5f8d('0x38')](_0x526b49[_0x5f8d('0x33')][_0x5f8d('0x38')]));_0x6a0db3['attributes']=_0x6a0db3['attributes'][_0x5f8d('0x49')]?_0x6a0db3['attributes']:_0x5090c8[_0x5f8d('0x32')];if(_0x526b49[_0x5f8d('0x33')][_0x5f8d('0x43')]){_0x6a0db3[_0x5f8d('0x44')]=[{'all':!![]}];}_0x6a0db3=_[_0x5f8d('0x40')]({},_0x6a0db3,_0x526b49['options']);return db[_0x5f8d('0x2d')][_0x5f8d('0x4a')](_0x6a0db3)['then'](handleEntityNotFound(_0x108905,null))['then'](respondWithResult(_0x108905,null))[_0x5f8d('0x47')](handleError(_0x108905,null));};exports['create']=function(_0x40d409,_0x4a34c0){return db[_0x5f8d('0x2d')]['create'](_0x40d409[_0x5f8d('0x4b')],{})[_0x5f8d('0x27')](respondWithResult(_0x4a34c0,0xc9))[_0x5f8d('0x47')](handleError(_0x4a34c0,null));};exports[_0x5f8d('0x25')]=function(_0x118c5a,_0x1cbe02){if(_0x118c5a[_0x5f8d('0x4b')]['id']){delete _0x118c5a[_0x5f8d('0x4b')]['id'];}return db['FreshsalesField'][_0x5f8d('0x4a')]({'where':{'id':_0x118c5a['params']['id']}})[_0x5f8d('0x27')](handleEntityNotFound(_0x1cbe02,null))['then'](saveUpdates(_0x118c5a['body'],null))[_0x5f8d('0x27')](respondWithResult(_0x1cbe02,null))['catch'](handleError(_0x1cbe02,null));};exports[_0x5f8d('0x26')]=function(_0x39c78e,_0x342a78){return db[_0x5f8d('0x2d')]['find']({'where':{'id':_0x39c78e[_0x5f8d('0x48')]['id']}})['then'](handleEntityNotFound(_0x342a78,null))[_0x5f8d('0x27')](removeEntity(_0x342a78,null))['catch'](handleError(_0x342a78,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index dcb7117..4bd3670 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 _0x9db7=['api','bluebird','path','rimraf','./intFreshsalesField.attributes','exports','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','FieldId','lodash','util','../../config/logger'];(function(_0x37be4c,_0x1d0ec8){var _0x367b40=function(_0x539a58){while(--_0x539a58){_0x37be4c['push'](_0x37be4c['shift']());}};_0x367b40(++_0x1d0ec8);}(_0x9db7,0x1bf));var _0x79db=function(_0x13c292,_0x175410){_0x13c292=_0x13c292-0x0;var _0x2a0483=_0x9db7[_0x13c292];return _0x2a0483;};'use strict';var _=require(_0x79db('0x0'));var util=require(_0x79db('0x1'));var logger=require(_0x79db('0x2'))(_0x79db('0x3'));var moment=require('moment');var BPromise=require(_0x79db('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x79db('0x5'));var rimraf=require(_0x79db('0x6'));var config=require('../../config/environment');var attributes=require(_0x79db('0x7'));module[_0x79db('0x8')]=function(_0xfb8328,_0x45c9d1){return _0xfb8328[_0x79db('0x9')](_0x79db('0xa'),attributes,{'tableName':_0x79db('0xb'),'paranoid':![],'indexes':[{'name':_0x79db('0xc'),'fields':[_0x79db('0xd'),_0x79db('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcabe=['FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','FieldId','lodash','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./intFreshsalesField.attributes','define'];(function(_0x2404d9,_0x16e338){var _0x574e02=function(_0x76bf7d){while(--_0x76bf7d){_0x2404d9['push'](_0x2404d9['shift']());}};_0x574e02(++_0x16e338);}(_0xcabe,0x1ef));var _0xecab=function(_0x46ac83,_0x3cec22){_0x46ac83=_0x46ac83-0x0;var _0x20a14b=_0xcabe[_0x46ac83];return _0x20a14b;};'use strict';var _=require(_0xecab('0x0'));var util=require('util');var logger=require(_0xecab('0x1'))(_0xecab('0x2'));var moment=require('moment');var BPromise=require(_0xecab('0x3'));var rp=require(_0xecab('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xecab('0x5'));var config=require(_0xecab('0x6'));var attributes=require(_0xecab('0x7'));module['exports']=function(_0x2ef298,_0x2ace9c){return _0x2ef298[_0xecab('0x8')](_0xecab('0x9'),attributes,{'tableName':_0xecab('0xa'),'paranoid':![],'indexes':[{'name':_0xecab('0xb'),'fields':[_0xecab('0xc'),_0xecab('0xd')],'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 725a86c..1c01cc1 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 _0xb4c7=['client','http','request','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x37e6fc,_0x1f2e33){var _0x39c7cf=function(_0x426c3b){while(--_0x426c3b){_0x37e6fc['push'](_0x37e6fc['shift']());}};_0x39c7cf(++_0x1f2e33);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0xf63b86,_0x6fc8d8){_0xf63b86=_0xf63b86-0x0;var _0x56a617=_0xb4c7[_0xf63b86];return _0x56a617;};'use strict';var _=require(_0x7b4c('0x0'));var util=require(_0x7b4c('0x1'));var moment=require(_0x7b4c('0x2'));var BPromise=require(_0x7b4c('0x3'));var rs=require(_0x7b4c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7b4c('0x5'))['db'];var utils=require(_0x7b4c('0x6'));var logger=require(_0x7b4c('0x7'))(_0x7b4c('0x8'));var config=require(_0x7b4c('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7b4c('0xa')][_0x7b4c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2dd5c7,_0x4bf85d,_0x2d7b7e){return new BPromise(function(_0x21687f,_0x570daa){return client[_0x7b4c('0xc')](_0x2dd5c7,_0x2d7b7e)[_0x7b4c('0xd')](function(_0x28e902){logger[_0x7b4c('0xe')](_0x7b4c('0xf'),_0x4bf85d,_0x7b4c('0x10'));logger[_0x7b4c('0x11')](_0x7b4c('0x12'),_0x4bf85d,_0x7b4c('0x10'),JSON[_0x7b4c('0x13')](_0x28e902));if(_0x28e902['error']){if(_0x28e902['error'][_0x7b4c('0x14')]===0x1f4){logger[_0x7b4c('0x15')](_0x7b4c('0xf'),_0x4bf85d,_0x28e902[_0x7b4c('0x15')][_0x7b4c('0x16')]);return _0x570daa(_0x28e902[_0x7b4c('0x15')][_0x7b4c('0x16')]);}logger[_0x7b4c('0x15')](_0x7b4c('0xf'),_0x4bf85d,_0x28e902[_0x7b4c('0x15')]['message']);return _0x21687f(_0x28e902[_0x7b4c('0x15')][_0x7b4c('0x16')]);}else{logger[_0x7b4c('0xe')](_0x7b4c('0xf'),_0x4bf85d,_0x7b4c('0x10'));_0x21687f(_0x28e902[_0x7b4c('0x17')][_0x7b4c('0x16')]);}})[_0x7b4c('0x18')](function(_0x4d3f5e){logger[_0x7b4c('0x15')](_0x7b4c('0xf'),_0x4bf85d,_0x4d3f5e);_0x570daa(_0x4d3f5e);});});} \ No newline at end of file +var _0x5fab=['../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FreshsalesField,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x3c4ace,_0xd4a56a){var _0x35c083=function(_0x4beea2){while(--_0x4beea2){_0x3c4ace['push'](_0x3c4ace['shift']());}};_0x35c083(++_0xd4a56a);}(_0x5fab,0x177));var _0xb5fa=function(_0x2e997e,_0x4edf31){_0x2e997e=_0x2e997e-0x0;var _0x5a6cb1=_0x5fab[_0x2e997e];return _0x5a6cb1;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var moment=require('moment');var BPromise=require(_0xb5fa('0x2'));var rs=require(_0xb5fa('0x3'));var fs=require('fs');var Redis=require(_0xb5fa('0x4'));var db=require(_0xb5fa('0x5'))['db'];var utils=require(_0xb5fa('0x6'));var logger=require(_0xb5fa('0x7'))(_0xb5fa('0x8'));var config=require(_0xb5fa('0x9'));var jayson=require(_0xb5fa('0xa'));var client=jayson[_0xb5fa('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d70f6,_0x2e3804,_0x1aec3e){return new BPromise(function(_0x9c7bce,_0x56d018){return client[_0xb5fa('0xc')](_0x5d70f6,_0x1aec3e)[_0xb5fa('0xd')](function(_0x2cf4a5){logger['info']('FreshsalesField,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));logger[_0xb5fa('0xf')](_0xb5fa('0x10'),_0x2e3804,_0xb5fa('0xe'),JSON[_0xb5fa('0x11')](_0x2cf4a5));if(_0x2cf4a5[_0xb5fa('0x12')]){if(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x13')]===0x1f4){logger[_0xb5fa('0x12')]('FreshsalesField,\x20%s,\x20%s',_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x56d018(_0x2cf4a5['error'][_0xb5fa('0x14')]);}logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x9c7bce(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);}else{logger['info']('FreshsalesField,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));_0x9c7bce(_0x2cf4a5[_0xb5fa('0x16')][_0xb5fa('0x14')]);}})[_0xb5fa('0x17')](function(_0x56fe10){logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x56fe10);_0x56d018(_0x56fe10);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 0e0b7de..658b984 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 _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x5583b0,_0x13bb43){var _0x23c46c=function(_0x5c90c2){while(--_0x5c90c2){_0x5583b0['push'](_0x5583b0['shift']());}};_0x23c46c(++_0x13bb43);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'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','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x3dac44,_0x366896){var _0x3fca3=function(_0x89f598){while(--_0x89f598){_0x3dac44['push'](_0x3dac44['shift']());}};_0x3fca3(++_0x366896);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'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 6ae225f..066bbda 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 _0xca6e=['exports','STRING','ENUM','integrationTab','sequelize'];(function(_0x9db19f,_0x16a0f7){var _0xefc307=function(_0x25e3e4){while(--_0x25e3e4){_0x9db19f['push'](_0x9db19f['shift']());}};_0xefc307(++_0x16a0f7);}(_0xca6e,0x1c1));var _0xeca6=function(_0x2eff73,_0x116e91){_0x2eff73=_0x2eff73-0x0;var _0x319d39=_0xca6e[_0x2eff73];return _0x319d39;};'use strict';var Sequelize=require(_0xeca6('0x0'));module[_0xeca6('0x1')]={'name':{'type':Sequelize[_0xeca6('0x2')]},'description':{'type':Sequelize[_0xeca6('0x2')]},'username':{'type':Sequelize[_0xeca6('0x2')],'unique':'username'},'remoteUri':{'type':Sequelize[_0xeca6('0x2')]},'password':{'type':Sequelize[_0xeca6('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0xeca6('0x2')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xeca6('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xeca6('0x3')](_0xeca6('0x4'),'newTab'),'defaultValue':_0xeca6('0x4')}}; \ No newline at end of file +var _0x0189=['username','ENUM','integrationTab','newTab','sequelize','exports','STRING'];(function(_0x32f776,_0x1bf7e6){var _0xa9f55=function(_0x3a1045){while(--_0x3a1045){_0x32f776['push'](_0x32f776['shift']());}};_0xa9f55(++_0x1bf7e6);}(_0x0189,0x1a8));var _0x9018=function(_0x25a16b,_0x51a9d5){_0x25a16b=_0x25a16b-0x0;var _0x347511=_0x0189[_0x25a16b];return _0x347511;};'use strict';var Sequelize=require(_0x9018('0x0'));module[_0x9018('0x1')]={'name':{'type':Sequelize[_0x9018('0x2')]},'description':{'type':Sequelize[_0x9018('0x2')]},'username':{'type':Sequelize[_0x9018('0x2')],'unique':_0x9018('0x3')},'remoteUri':{'type':Sequelize[_0x9018('0x2')]},'password':{'type':Sequelize[_0x9018('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x9018('0x2')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x9018('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9018('0x4')](_0x9018('0x5'),_0x9018('0x6')),'defaultValue':_0x9018('0x5')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 3d7554a..7fb094e 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 _0x1e82=['length','find','catch','create','body','params','getConfigurations','findOne','order','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceConfiguration','SalesforceField','getFields','Task','remoteUri','clientId','username','password','securityToken','lastIndexOf','clientSecret','login','concat','isNil','ticketType','sobject','ActivityDate','IsReminderSet','IsRecurrence','Description','string','textarea','phone','remove','includes','custom','picklistValues','value','boolean','True','true','False','false','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name','index','map','SalesforceAccount','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows'];(function(_0x40cdc9,_0x47256f){var _0x3d7b3b=function(_0x48db0d){while(--_0x48db0d){_0x40cdc9['push'](_0x40cdc9['shift']());}};_0x3d7b3b(++_0x47256f);}(_0x1e82,0x131));var _0x21e8=function(_0x514808,_0x3e0711){_0x514808=_0x514808-0x0;var _0x2b276b=_0x1e82[_0x514808];return _0x2b276b;};'use strict';var emlformat=require(_0x21e8('0x0'));var rimraf=require(_0x21e8('0x1'));var zipdir=require(_0x21e8('0x2'));var jsonpatch=require(_0x21e8('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x21e8('0x4'));var Mustache=require(_0x21e8('0x5'));var util=require(_0x21e8('0x6'));var path=require(_0x21e8('0x7'));var sox=require(_0x21e8('0x8'));var csv=require(_0x21e8('0x9'));var ejs=require(_0x21e8('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x21e8('0xb'));var squel=require(_0x21e8('0xc'));var crypto=require(_0x21e8('0xd'));var jsforce=require(_0x21e8('0xe'));var deskjs=require(_0x21e8('0xf'));var toCsv=require(_0x21e8('0x9'));var querystring=require(_0x21e8('0x10'));var Papa=require(_0x21e8('0x11'));var Redis=require(_0x21e8('0x12'));var authService=require(_0x21e8('0x13'));var qs=require(_0x21e8('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x21e8('0x15'));var logger=require('../../config/logger')(_0x21e8('0x16'));var utils=require(_0x21e8('0x17'));var config=require(_0x21e8('0x18'));var licenseUtil=require(_0x21e8('0x19'));var db=require(_0x21e8('0x1a'))['db'];var integrations=require(_0x21e8('0x1b'));function respondWithStatusCode(_0x280630,_0x34f795){_0x34f795=_0x34f795||0xcc;return function(_0x5a3bf5){if(_0x5a3bf5){return _0x280630[_0x21e8('0x1c')](_0x34f795);}return _0x280630['status'](_0x34f795)['end']();};}function respondWithResult(_0xdf10a2,_0x516767){_0x516767=_0x516767||0xc8;return function(_0x18e6d8){if(_0x18e6d8){return _0xdf10a2[_0x21e8('0x1d')](_0x516767)[_0x21e8('0x1e')](_0x18e6d8);}};}function respondWithFilteredResult(_0x2d7fae,_0x224926){return function(_0x189f71){if(_0x189f71){var _0x176ecb=typeof _0x224926[_0x21e8('0x1f')]===_0x21e8('0x20')&&typeof _0x224926[_0x21e8('0x21')]===_0x21e8('0x20');var _0x5d764c=_0x189f71[_0x21e8('0x22')];var _0x1a7f0c=_0x176ecb?0x0:_0x224926['offset'];var _0x1be6ee=_0x176ecb?_0x189f71[_0x21e8('0x22')]:_0x224926[_0x21e8('0x1f')]+_0x224926['limit'];var _0x5d4d79;if(_0x1be6ee>=_0x5d764c){_0x1be6ee=_0x5d764c;_0x5d4d79=0xc8;}else{_0x5d4d79=0xce;}_0x2d7fae[_0x21e8('0x1d')](_0x5d4d79);return _0x2d7fae[_0x21e8('0x23')](_0x21e8('0x24'),_0x1a7f0c+'-'+_0x1be6ee+'/'+_0x5d764c)[_0x21e8('0x1e')](_0x189f71);}return null;};}function patchUpdates(_0x1dc56c){return function(_0x203557){try{jsonpatch['apply'](_0x203557,_0x1dc56c,!![]);}catch(_0x4de553){return BPromise[_0x21e8('0x25')](_0x4de553);}return _0x203557[_0x21e8('0x26')]();};}function saveUpdates(_0x1b3acf,_0x553e26){return function(_0xe234f6){if(_0xe234f6){return _0xe234f6[_0x21e8('0x27')](_0x1b3acf)[_0x21e8('0x28')](function(_0x45cd51){return _0x45cd51;});}return null;};}function removeEntity(_0x19d7e0,_0x563e0a){return function(_0x6df99){if(_0x6df99){return _0x6df99[_0x21e8('0x29')]()[_0x21e8('0x28')](function(){_0x19d7e0[_0x21e8('0x1d')](0xcc)[_0x21e8('0x2a')]();});}};}function handleEntityNotFound(_0x1d0103,_0x20e7ad){return function(_0x126162){if(!_0x126162){_0x1d0103['sendStatus'](0x194);}return _0x126162;};}function handleError(_0x37a680,_0x2a7687){_0x2a7687=_0x2a7687||0x1f4;return function(_0x334fa9){logger[_0x21e8('0x2b')](_0x334fa9[_0x21e8('0x2c')]);if(_0x334fa9[_0x21e8('0x2d')]){delete _0x334fa9['name'];}_0x37a680[_0x21e8('0x1d')](_0x2a7687)['send'](_0x334fa9);};}exports[_0x21e8('0x2e')]=function(_0x59365a,_0x5ec224){var _0x22bfba={},_0xb5d7e5={},_0x582a9b={'count':0x0,'rows':[]};var _0x5011d2=_[_0x21e8('0x2f')](db[_0x21e8('0x30')][_0x21e8('0x31')],function(_0x1d9c96){return{'name':_0x1d9c96[_0x21e8('0x32')],'type':_0x1d9c96[_0x21e8('0x33')][_0x21e8('0x34')]};});_0xb5d7e5[_0x21e8('0x35')]=_['map'](_0x5011d2,_0x21e8('0x2d'));_0xb5d7e5['query']=_[_0x21e8('0x36')](_0x59365a[_0x21e8('0x37')]);_0xb5d7e5[_0x21e8('0x38')]=_['intersection'](_0xb5d7e5['model'],_0xb5d7e5[_0x21e8('0x37')]);_0x22bfba[_0x21e8('0x39')]=_[_0x21e8('0x3a')](_0xb5d7e5[_0x21e8('0x35')],qs[_0x21e8('0x3b')](_0x59365a[_0x21e8('0x37')][_0x21e8('0x3b')]));_0x22bfba[_0x21e8('0x39')]=_0x22bfba[_0x21e8('0x39')]['length']?_0x22bfba[_0x21e8('0x39')]:_0xb5d7e5['model'];if(!_0x59365a[_0x21e8('0x37')][_0x21e8('0x3c')](_0x21e8('0x3d'))){_0x22bfba['limit']=qs[_0x21e8('0x21')](_0x59365a[_0x21e8('0x37')][_0x21e8('0x21')]);_0x22bfba['offset']=qs[_0x21e8('0x1f')](_0x59365a[_0x21e8('0x37')][_0x21e8('0x1f')]);}_0x22bfba['order']=qs[_0x21e8('0x3e')](_0x59365a[_0x21e8('0x37')]['sort']);_0x22bfba[_0x21e8('0x3f')]=qs[_0x21e8('0x38')](_[_0x21e8('0x40')](_0x59365a[_0x21e8('0x37')],_0xb5d7e5[_0x21e8('0x38')]),_0x5011d2);if(_0x59365a[_0x21e8('0x37')][_0x21e8('0x41')]){_0x22bfba[_0x21e8('0x3f')]=_[_0x21e8('0x42')](_0x22bfba['where'],{'$or':_['map'](_0x5011d2,function(_0x11e259){if(_0x11e259['type']!==_0x21e8('0x43')){var _0x36cd8a={};_0x36cd8a[_0x11e259[_0x21e8('0x2d')]]={'$like':'%'+_0x59365a[_0x21e8('0x37')][_0x21e8('0x41')]+'%'};return _0x36cd8a;}})});}_0x22bfba=_[_0x21e8('0x42')]({},_0x22bfba,_0x59365a[_0x21e8('0x44')]);var _0x5ac3c1={'where':_0x22bfba['where']};return db[_0x21e8('0x30')]['count'](_0x5ac3c1)[_0x21e8('0x28')](function(_0x2dbd37){_0x582a9b[_0x21e8('0x22')]=_0x2dbd37;if(_0x59365a[_0x21e8('0x37')][_0x21e8('0x45')]){_0x22bfba[_0x21e8('0x46')]=[{'all':!![]}];}return db[_0x21e8('0x30')][_0x21e8('0x47')](_0x22bfba);})[_0x21e8('0x28')](function(_0x335417){_0x582a9b[_0x21e8('0x48')]=_0x335417;return _0x582a9b;})['then'](respondWithFilteredResult(_0x5ec224,_0x22bfba))['catch'](handleError(_0x5ec224,null));};exports['show']=function(_0x32fee7,_0xb95209){var _0xdc43b1={'raw':![],'where':{'id':_0x32fee7['params']['id']}},_0x5eae10={};_0x5eae10[_0x21e8('0x35')]=_[_0x21e8('0x36')](db['SalesforceAccount']['rawAttributes']);_0x5eae10[_0x21e8('0x37')]=_[_0x21e8('0x36')](_0x32fee7['query']);_0x5eae10[_0x21e8('0x38')]=_[_0x21e8('0x3a')](_0x5eae10['model'],_0x5eae10[_0x21e8('0x37')]);_0xdc43b1[_0x21e8('0x39')]=_[_0x21e8('0x3a')](_0x5eae10['model'],qs[_0x21e8('0x3b')](_0x32fee7[_0x21e8('0x37')][_0x21e8('0x3b')]));_0xdc43b1[_0x21e8('0x39')]=_0xdc43b1[_0x21e8('0x39')][_0x21e8('0x49')]?_0xdc43b1['attributes']:_0x5eae10[_0x21e8('0x35')];if(_0x32fee7[_0x21e8('0x37')][_0x21e8('0x45')]){_0xdc43b1[_0x21e8('0x46')]=[{'all':!![]}];}_0xdc43b1=_[_0x21e8('0x42')]({},_0xdc43b1,_0x32fee7[_0x21e8('0x44')]);return db[_0x21e8('0x30')][_0x21e8('0x4a')](_0xdc43b1)[_0x21e8('0x28')](handleEntityNotFound(_0xb95209,null))[_0x21e8('0x28')](respondWithResult(_0xb95209,null))[_0x21e8('0x4b')](handleError(_0xb95209,null));};exports['create']=function(_0x4a9db9,_0x13298f){return db[_0x21e8('0x30')][_0x21e8('0x4c')](_0x4a9db9[_0x21e8('0x4d')],{})['then'](respondWithResult(_0x13298f,0xc9))['catch'](handleError(_0x13298f,null));};exports[_0x21e8('0x27')]=function(_0x27e8df,_0x43c968){if(_0x27e8df[_0x21e8('0x4d')]['id']){delete _0x27e8df[_0x21e8('0x4d')]['id'];}return db[_0x21e8('0x30')][_0x21e8('0x4a')]({'where':{'id':_0x27e8df[_0x21e8('0x4e')]['id']}})[_0x21e8('0x28')](handleEntityNotFound(_0x43c968,null))['then'](saveUpdates(_0x27e8df['body'],null))[_0x21e8('0x28')](respondWithResult(_0x43c968,null))['catch'](handleError(_0x43c968,null));};exports[_0x21e8('0x29')]=function(_0x37856f,_0x1ff182){return db[_0x21e8('0x30')][_0x21e8('0x4a')]({'where':{'id':_0x37856f[_0x21e8('0x4e')]['id']}})[_0x21e8('0x28')](handleEntityNotFound(_0x1ff182,null))[_0x21e8('0x28')](removeEntity(_0x1ff182,null))[_0x21e8('0x4b')](handleError(_0x1ff182,null));};exports[_0x21e8('0x4f')]=function(_0x218fd1,_0x77c595,_0xf9b07e){var _0x2fa6fd={};var _0x6f000e={};var _0x4424bf;var _0x33bc6c;return db['SalesforceAccount'][_0x21e8('0x50')]({'where':{'id':_0x218fd1['params']['id']}})[_0x21e8('0x28')](handleEntityNotFound(_0x77c595,null))[_0x21e8('0x28')](function(_0x400f6a){if(_0x400f6a){_0x4424bf=_0x400f6a;_0x6f000e['model']=_[_0x21e8('0x36')](db['SalesforceConfiguration']['rawAttributes']);_0x6f000e[_0x21e8('0x37')]=_[_0x21e8('0x36')](_0x218fd1['query']);_0x6f000e[_0x21e8('0x38')]=_['intersection'](_0x6f000e[_0x21e8('0x35')],_0x6f000e[_0x21e8('0x37')]);_0x2fa6fd[_0x21e8('0x39')]=_[_0x21e8('0x3a')](_0x6f000e[_0x21e8('0x35')],qs[_0x21e8('0x3b')](_0x218fd1[_0x21e8('0x37')][_0x21e8('0x3b')]));_0x2fa6fd['attributes']=_0x2fa6fd[_0x21e8('0x39')][_0x21e8('0x49')]?_0x2fa6fd[_0x21e8('0x39')]:_0x6f000e[_0x21e8('0x35')];_0x2fa6fd[_0x21e8('0x51')]=qs[_0x21e8('0x3e')](_0x218fd1['query'][_0x21e8('0x3e')]);_0x2fa6fd['where']=qs[_0x21e8('0x38')](_[_0x21e8('0x40')](_0x218fd1[_0x21e8('0x37')],_0x6f000e['filters']));if(_0x218fd1['query'][_0x21e8('0x41')]){_0x2fa6fd[_0x21e8('0x3f')]=_['merge'](_0x2fa6fd[_0x21e8('0x3f')],{'$or':_[_0x21e8('0x2f')](_0x2fa6fd[_0x21e8('0x39')],function(_0x484ae0){var _0x2a4d9f={};_0x2a4d9f[_0x484ae0]={'$like':'%'+_0x218fd1[_0x21e8('0x37')][_0x21e8('0x41')]+'%'};return _0x2a4d9f;})});}_0x2fa6fd=_[_0x21e8('0x42')]({},_0x2fa6fd,_0x218fd1[_0x21e8('0x44')]);return _0x4424bf['getConfigurations'](_0x2fa6fd);}})['then'](function(_0x2c0ec0){if(_0x2c0ec0){_0x33bc6c=_0x2c0ec0[_0x21e8('0x49')];if(!_0x218fd1[_0x21e8('0x37')][_0x21e8('0x3c')](_0x21e8('0x3d'))){_0x2fa6fd[_0x21e8('0x21')]=qs[_0x21e8('0x21')](_0x218fd1[_0x21e8('0x37')]['limit']);_0x2fa6fd[_0x21e8('0x1f')]=qs[_0x21e8('0x1f')](_0x218fd1['query'][_0x21e8('0x1f')]);}return _0x4424bf[_0x21e8('0x4f')](_0x2fa6fd);}})[_0x21e8('0x28')](function(_0x3e2685){if(_0x3e2685){return _0x3e2685?{'count':_0x33bc6c,'rows':_0x3e2685}:null;}})['then'](respondWithResult(_0x77c595,null))[_0x21e8('0x4b')](handleError(_0x77c595,null));};exports[_0x21e8('0x52')]=function(_0x438ef7,_0x57d206,_0x3ded68){if(_0x438ef7['body']['id']){delete _0x438ef7[_0x21e8('0x4d')]['id'];}return db[_0x21e8('0x30')]['findOne']({'where':{'id':_0x438ef7[_0x21e8('0x4e')]['id']}})[_0x21e8('0x28')](handleEntityNotFound(_0x57d206,null))[_0x21e8('0x28')](function(_0x121a29){if(_0x121a29){_0x438ef7[_0x21e8('0x4d')][_0x21e8('0x53')]=_0x121a29['id'];_0x438ef7[_0x21e8('0x4d')][_0x21e8('0x54')]=integrations[_0x21e8('0x55')](_0x438ef7[_0x21e8('0x4d')][_0x21e8('0x56')],_0x438ef7[_0x21e8('0x4d')][_0x21e8('0x33')]);_0x438ef7[_0x21e8('0x4d')][_0x21e8('0x57')]=integrations[_0x21e8('0x58')](_0x438ef7[_0x21e8('0x4d')][_0x21e8('0x56')],_0x438ef7[_0x21e8('0x4d')][_0x21e8('0x33')]);return db[_0x21e8('0x59')][_0x21e8('0x4c')](_0x438ef7[_0x21e8('0x4d')],{'include':[{'model':db['SalesforceField'],'as':_0x21e8('0x54')},{'model':db[_0x21e8('0x5a')],'as':'Descriptions'}]});}return null;})[_0x21e8('0x28')](respondWithResult(_0x57d206,null))['catch'](handleError(_0x57d206,null));};exports[_0x21e8('0x5b')]=function(_0x106808,_0x91d90a,_0x429ac7){var _0x26d429;var _0xb6306c='';var _0x5352fd=_0x21e8('0x5c');return db[_0x21e8('0x30')][_0x21e8('0x50')]({'where':{'id':_0x106808['params']['id']},'attributes':['id',_0x21e8('0x5d'),_0x21e8('0x5e'),'clientSecret',_0x21e8('0x5f'),_0x21e8('0x60'),_0x21e8('0x61')]})['then'](handleEntityNotFound(_0x91d90a,null))[_0x21e8('0x28')](function(_0x3cb08a){if(_0x3cb08a){_0xb6306c=_0x3cb08a[_0x21e8('0x5d')];var _0x2cd8e6=_0xb6306c['slice'](-0x1);if(_0x2cd8e6==='/'){_0xb6306c=_0xb6306c['substring'](0x0,_0xb6306c[_0x21e8('0x62')](_0x2cd8e6));}_0x26d429=new jsforce['Connection']({'oauth2':{'loginUrl':_0xb6306c,'clientId':_0x3cb08a['clientId'],'clientSecret':_0x3cb08a[_0x21e8('0x63')]}});return _0x26d429[_0x21e8('0x64')](_0x3cb08a[_0x21e8('0x5f')],_0x3cb08a[_0x21e8('0x60')][_0x21e8('0x65')](_0x3cb08a['securityToken']));}})[_0x21e8('0x28')](function(_0x27324e){if(_0x27324e){if(!_[_0x21e8('0x66')](_0x106808[_0x21e8('0x37')]['ticketType'])){_0x5352fd=_0x106808[_0x21e8('0x37')][_0x21e8('0x67')];}return _0x26d429[_0x21e8('0x68')](_0x5352fd)['describe']();}})[_0x21e8('0x28')](function(_0x294119){var _0x29dae9=['OwnerId',_0x21e8('0x69'),_0x21e8('0x6a'),_0x21e8('0x6b'),'Subject',_0x21e8('0x6c')];var _0x119e55=[_0x21e8('0x6d'),'int','picklist','boolean','email',_0x21e8('0x6e'),_0x21e8('0x6f')];if(_0x294119){_[_0x21e8('0x70')](_0x294119[_0x21e8('0x3b')],function(_0x21dc62){return _0x29dae9[_0x21e8('0x71')](_0x21dc62[_0x21e8('0x2d')])||!_0x119e55['includes'](_0x21dc62[_0x21e8('0x33')]);});return{'count':_0x294119[_0x21e8('0x3b')][_0x21e8('0x49')],'rows':_['map'](_0x294119[_0x21e8('0x3b')],function(_0x498e24){return{'id':_0x498e24[_0x21e8('0x2d')],'name':_0x498e24['label'],'custom':_0x498e24[_0x21e8('0x72')],'options':_0x498e24[_0x21e8('0x73')][_0x21e8('0x49')]>0x0?_[_0x21e8('0x2f')](_0x498e24[_0x21e8('0x73')],function(_0x3e53d3){return{'name':_0x3e53d3['label'],'value':_0x3e53d3[_0x21e8('0x74')]};}):_0x498e24[_0x21e8('0x33')]==_0x21e8('0x75')?[{'name':_0x21e8('0x76'),'value':_0x21e8('0x77')},{'name':_0x21e8('0x78'),'value':_0x21e8('0x79')}]:[]};})};}})[_0x21e8('0x28')](respondWithResult(_0x91d90a,null))['catch'](function(_0x20e61f){var _0x5c6352=_0x106808['query'][_0x21e8('0x7a')]?0x1f4:_0x20e61f['statusCode']||0x1f4;logger[_0x21e8('0x2b')](_0x21e8('0x7b'),_0x21e8('0x5b'),_0x5c6352,JSON[_0x21e8('0x7c')](_0x20e61f));delete _0x20e61f[_0x21e8('0x2d')];if(_0x5c6352===0x191){_0x5c6352=0x190;}_0x91d90a[_0x21e8('0x1d')](_0x5c6352)['send'](_0x106808['query'][_0x21e8('0x7a')]?{'message':_0x21e8('0x7d'),'statusCode':_0x20e61f['statusCode']}:_0x20e61f);});}; \ No newline at end of file +var _0x7d15=['Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','offset','limit','undefined','count','Content-Range','apply','reject','destroy','then','end','stack','name','send','index','SalesforceAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','map','VIRTUAL','filter','includeAll','findAll','rows','catch','show','params','include','find','create','update','body','getConfigurations','SalesforceConfiguration','options','findOne','AccountId','getSubjects','channel','Descriptions','SalesforceField','getFields','Task','clientSecret','password','securityToken','remoteUri','slice','clientId','login','username','concat','ticketType','describe','IsReminderSet','IsRecurrence','Subject','Description','string','boolean','email','phone','remove','includes','label','custom','picklistValues','value','true','False','false','test','statusCode','error'];(function(_0x44ea2f,_0x4ccfe4){var _0x279c90=function(_0x44bf58){while(--_0x44bf58){_0x44ea2f['push'](_0x44ea2f['shift']());}};_0x279c90(++_0x4ccfe4);}(_0x7d15,0x1d1));var _0x57d1=function(_0x29838b,_0x13ca00){_0x29838b=_0x29838b-0x0;var _0x13888b=_0x7d15[_0x29838b];return _0x13888b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x57d1('0x0'));var zipdir=require(_0x57d1('0x1'));var jsonpatch=require(_0x57d1('0x2'));var rp=require(_0x57d1('0x3'));var moment=require('moment');var BPromise=require(_0x57d1('0x4'));var Mustache=require('mustache');var util=require(_0x57d1('0x5'));var path=require(_0x57d1('0x6'));var sox=require(_0x57d1('0x7'));var csv=require(_0x57d1('0x8'));var ejs=require(_0x57d1('0x9'));var fs=require('fs');var fs_extra=require(_0x57d1('0xa'));var _=require('lodash');var squel=require(_0x57d1('0xb'));var crypto=require(_0x57d1('0xc'));var jsforce=require(_0x57d1('0xd'));var deskjs=require(_0x57d1('0xe'));var toCsv=require(_0x57d1('0x8'));var querystring=require(_0x57d1('0xf'));var Papa=require(_0x57d1('0x10'));var Redis=require(_0x57d1('0x11'));var authService=require(_0x57d1('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x57d1('0x13'));var logger=require(_0x57d1('0x14'))('api');var utils=require(_0x57d1('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x57d1('0x16'));var db=require(_0x57d1('0x17'))['db'];var integrations=require(_0x57d1('0x18'));function respondWithStatusCode(_0x255d96,_0xaa9e97){_0xaa9e97=_0xaa9e97||0xcc;return function(_0x2f27b3){if(_0x2f27b3){return _0x255d96[_0x57d1('0x19')](_0xaa9e97);}return _0x255d96['status'](_0xaa9e97)['end']();};}function respondWithResult(_0x51b2af,_0x50f55f){_0x50f55f=_0x50f55f||0xc8;return function(_0x5c1b26){if(_0x5c1b26){return _0x51b2af[_0x57d1('0x1a')](_0x50f55f)['json'](_0x5c1b26);}};}function respondWithFilteredResult(_0x275bc7,_0x603e21){return function(_0x561383){if(_0x561383){var _0x3da1aa=typeof _0x603e21[_0x57d1('0x1b')]==='undefined'&&typeof _0x603e21[_0x57d1('0x1c')]===_0x57d1('0x1d');var _0x303f7b=_0x561383['count'];var _0x411395=_0x3da1aa?0x0:_0x603e21[_0x57d1('0x1b')];var _0x22d85b=_0x3da1aa?_0x561383[_0x57d1('0x1e')]:_0x603e21[_0x57d1('0x1b')]+_0x603e21[_0x57d1('0x1c')];var _0x294130;if(_0x22d85b>=_0x303f7b){_0x22d85b=_0x303f7b;_0x294130=0xc8;}else{_0x294130=0xce;}_0x275bc7['status'](_0x294130);return _0x275bc7['set'](_0x57d1('0x1f'),_0x411395+'-'+_0x22d85b+'/'+_0x303f7b)['json'](_0x561383);}return null;};}function patchUpdates(_0x14084c){return function(_0x4a5377){try{jsonpatch[_0x57d1('0x20')](_0x4a5377,_0x14084c,!![]);}catch(_0x454113){return BPromise[_0x57d1('0x21')](_0x454113);}return _0x4a5377['save']();};}function saveUpdates(_0x2a224f,_0x34775b){return function(_0x47db68){if(_0x47db68){return _0x47db68['update'](_0x2a224f)['then'](function(_0x37a208){return _0x37a208;});}return null;};}function removeEntity(_0x55c388,_0x5ccdeb){return function(_0x498dfe){if(_0x498dfe){return _0x498dfe[_0x57d1('0x22')]()[_0x57d1('0x23')](function(){_0x55c388['status'](0xcc)[_0x57d1('0x24')]();});}};}function handleEntityNotFound(_0x1fee27,_0x2d7a1c){return function(_0x9f7b56){if(!_0x9f7b56){_0x1fee27[_0x57d1('0x19')](0x194);}return _0x9f7b56;};}function handleError(_0x22d9ee,_0xcbe96b){_0xcbe96b=_0xcbe96b||0x1f4;return function(_0x3e9d4a){logger['error'](_0x3e9d4a[_0x57d1('0x25')]);if(_0x3e9d4a['name']){delete _0x3e9d4a[_0x57d1('0x26')];}_0x22d9ee[_0x57d1('0x1a')](_0xcbe96b)[_0x57d1('0x27')](_0x3e9d4a);};}exports[_0x57d1('0x28')]=function(_0x39db43,_0x5d4907){var _0x59a648={},_0x5f0732={},_0x5d7cbd={'count':0x0,'rows':[]};var _0x3ed210=_['map'](db[_0x57d1('0x29')][_0x57d1('0x2a')],function(_0x2db993){return{'name':_0x2db993[_0x57d1('0x2b')],'type':_0x2db993[_0x57d1('0x2c')]['key']};});_0x5f0732[_0x57d1('0x2d')]=_['map'](_0x3ed210,_0x57d1('0x26'));_0x5f0732[_0x57d1('0x2e')]=_[_0x57d1('0x2f')](_0x39db43[_0x57d1('0x2e')]);_0x5f0732[_0x57d1('0x30')]=_[_0x57d1('0x31')](_0x5f0732['model'],_0x5f0732[_0x57d1('0x2e')]);_0x59a648[_0x57d1('0x32')]=_[_0x57d1('0x31')](_0x5f0732[_0x57d1('0x2d')],qs[_0x57d1('0x33')](_0x39db43['query']['fields']));_0x59a648[_0x57d1('0x32')]=_0x59a648[_0x57d1('0x32')][_0x57d1('0x34')]?_0x59a648['attributes']:_0x5f0732[_0x57d1('0x2d')];if(!_0x39db43[_0x57d1('0x2e')]['hasOwnProperty'](_0x57d1('0x35'))){_0x59a648[_0x57d1('0x1c')]=qs['limit'](_0x39db43[_0x57d1('0x2e')]['limit']);_0x59a648[_0x57d1('0x1b')]=qs[_0x57d1('0x1b')](_0x39db43['query'][_0x57d1('0x1b')]);}_0x59a648[_0x57d1('0x36')]=qs[_0x57d1('0x37')](_0x39db43[_0x57d1('0x2e')][_0x57d1('0x37')]);_0x59a648[_0x57d1('0x38')]=qs[_0x57d1('0x30')](_[_0x57d1('0x39')](_0x39db43[_0x57d1('0x2e')],_0x5f0732['filters']),_0x3ed210);if(_0x39db43[_0x57d1('0x2e')]['filter']){_0x59a648[_0x57d1('0x38')]=_[_0x57d1('0x3a')](_0x59a648[_0x57d1('0x38')],{'$or':_[_0x57d1('0x3b')](_0x3ed210,function(_0x18d6f2){if(_0x18d6f2['type']!==_0x57d1('0x3c')){var _0x45aa38={};_0x45aa38[_0x18d6f2[_0x57d1('0x26')]]={'$like':'%'+_0x39db43[_0x57d1('0x2e')][_0x57d1('0x3d')]+'%'};return _0x45aa38;}})});}_0x59a648=_['merge']({},_0x59a648,_0x39db43['options']);var _0xbb0f24={'where':_0x59a648[_0x57d1('0x38')]};return db[_0x57d1('0x29')][_0x57d1('0x1e')](_0xbb0f24)['then'](function(_0x44d10f){_0x5d7cbd[_0x57d1('0x1e')]=_0x44d10f;if(_0x39db43['query'][_0x57d1('0x3e')]){_0x59a648['include']=[{'all':!![]}];}return db['SalesforceAccount'][_0x57d1('0x3f')](_0x59a648);})['then'](function(_0x5122c9){_0x5d7cbd[_0x57d1('0x40')]=_0x5122c9;return _0x5d7cbd;})['then'](respondWithFilteredResult(_0x5d4907,_0x59a648))[_0x57d1('0x41')](handleError(_0x5d4907,null));};exports[_0x57d1('0x42')]=function(_0x213951,_0x1f9eee){var _0x3a132d={'raw':![],'where':{'id':_0x213951[_0x57d1('0x43')]['id']}},_0x17cc87={};_0x17cc87[_0x57d1('0x2d')]=_['keys'](db['SalesforceAccount'][_0x57d1('0x2a')]);_0x17cc87[_0x57d1('0x2e')]=_['keys'](_0x213951['query']);_0x17cc87['filters']=_[_0x57d1('0x31')](_0x17cc87[_0x57d1('0x2d')],_0x17cc87[_0x57d1('0x2e')]);_0x3a132d[_0x57d1('0x32')]=_[_0x57d1('0x31')](_0x17cc87[_0x57d1('0x2d')],qs['fields'](_0x213951[_0x57d1('0x2e')][_0x57d1('0x33')]));_0x3a132d[_0x57d1('0x32')]=_0x3a132d['attributes']['length']?_0x3a132d[_0x57d1('0x32')]:_0x17cc87[_0x57d1('0x2d')];if(_0x213951['query']['includeAll']){_0x3a132d[_0x57d1('0x44')]=[{'all':!![]}];}_0x3a132d=_[_0x57d1('0x3a')]({},_0x3a132d,_0x213951['options']);return db[_0x57d1('0x29')][_0x57d1('0x45')](_0x3a132d)['then'](handleEntityNotFound(_0x1f9eee,null))[_0x57d1('0x23')](respondWithResult(_0x1f9eee,null))[_0x57d1('0x41')](handleError(_0x1f9eee,null));};exports[_0x57d1('0x46')]=function(_0x1b8fdb,_0x404438){return db[_0x57d1('0x29')][_0x57d1('0x46')](_0x1b8fdb['body'],{})['then'](respondWithResult(_0x404438,0xc9))['catch'](handleError(_0x404438,null));};exports[_0x57d1('0x47')]=function(_0x461f15,_0x19b202){if(_0x461f15[_0x57d1('0x48')]['id']){delete _0x461f15['body']['id'];}return db[_0x57d1('0x29')]['find']({'where':{'id':_0x461f15[_0x57d1('0x43')]['id']}})['then'](handleEntityNotFound(_0x19b202,null))[_0x57d1('0x23')](saveUpdates(_0x461f15[_0x57d1('0x48')],null))[_0x57d1('0x23')](respondWithResult(_0x19b202,null))['catch'](handleError(_0x19b202,null));};exports['destroy']=function(_0x139dd3,_0x438caf){return db[_0x57d1('0x29')][_0x57d1('0x45')]({'where':{'id':_0x139dd3[_0x57d1('0x43')]['id']}})[_0x57d1('0x23')](handleEntityNotFound(_0x438caf,null))[_0x57d1('0x23')](removeEntity(_0x438caf,null))[_0x57d1('0x41')](handleError(_0x438caf,null));};exports[_0x57d1('0x49')]=function(_0x2d54bf,_0x57c66c,_0x1809a5){var _0xc21c6c={};var _0x32eabb={};var _0x5e3108;var _0x4e8dc4;return db[_0x57d1('0x29')]['findOne']({'where':{'id':_0x2d54bf[_0x57d1('0x43')]['id']}})[_0x57d1('0x23')](handleEntityNotFound(_0x57c66c,null))['then'](function(_0x55ae41){if(_0x55ae41){_0x5e3108=_0x55ae41;_0x32eabb[_0x57d1('0x2d')]=_[_0x57d1('0x2f')](db[_0x57d1('0x4a')][_0x57d1('0x2a')]);_0x32eabb[_0x57d1('0x2e')]=_['keys'](_0x2d54bf[_0x57d1('0x2e')]);_0x32eabb[_0x57d1('0x30')]=_[_0x57d1('0x31')](_0x32eabb['model'],_0x32eabb['query']);_0xc21c6c[_0x57d1('0x32')]=_[_0x57d1('0x31')](_0x32eabb[_0x57d1('0x2d')],qs[_0x57d1('0x33')](_0x2d54bf[_0x57d1('0x2e')][_0x57d1('0x33')]));_0xc21c6c[_0x57d1('0x32')]=_0xc21c6c['attributes'][_0x57d1('0x34')]?_0xc21c6c[_0x57d1('0x32')]:_0x32eabb[_0x57d1('0x2d')];_0xc21c6c['order']=qs[_0x57d1('0x37')](_0x2d54bf[_0x57d1('0x2e')][_0x57d1('0x37')]);_0xc21c6c[_0x57d1('0x38')]=qs['filters'](_[_0x57d1('0x39')](_0x2d54bf[_0x57d1('0x2e')],_0x32eabb[_0x57d1('0x30')]));if(_0x2d54bf[_0x57d1('0x2e')][_0x57d1('0x3d')]){_0xc21c6c[_0x57d1('0x38')]=_[_0x57d1('0x3a')](_0xc21c6c['where'],{'$or':_['map'](_0xc21c6c[_0x57d1('0x32')],function(_0x12e7b1){var _0x37074c={};_0x37074c[_0x12e7b1]={'$like':'%'+_0x2d54bf[_0x57d1('0x2e')][_0x57d1('0x3d')]+'%'};return _0x37074c;})});}_0xc21c6c=_['merge']({},_0xc21c6c,_0x2d54bf[_0x57d1('0x4b')]);return _0x5e3108[_0x57d1('0x49')](_0xc21c6c);}})[_0x57d1('0x23')](function(_0x143307){if(_0x143307){_0x4e8dc4=_0x143307[_0x57d1('0x34')];if(!_0x2d54bf[_0x57d1('0x2e')]['hasOwnProperty']('nolimit')){_0xc21c6c[_0x57d1('0x1c')]=qs['limit'](_0x2d54bf[_0x57d1('0x2e')][_0x57d1('0x1c')]);_0xc21c6c[_0x57d1('0x1b')]=qs[_0x57d1('0x1b')](_0x2d54bf[_0x57d1('0x2e')][_0x57d1('0x1b')]);}return _0x5e3108[_0x57d1('0x49')](_0xc21c6c);}})[_0x57d1('0x23')](function(_0x4c8fcf){if(_0x4c8fcf){return _0x4c8fcf?{'count':_0x4e8dc4,'rows':_0x4c8fcf}:null;}})[_0x57d1('0x23')](respondWithResult(_0x57c66c,null))['catch'](handleError(_0x57c66c,null));};exports['addConfiguration']=function(_0x4615af,_0xad558f,_0x47feb5){if(_0x4615af[_0x57d1('0x48')]['id']){delete _0x4615af[_0x57d1('0x48')]['id'];}return db[_0x57d1('0x29')][_0x57d1('0x4c')]({'where':{'id':_0x4615af[_0x57d1('0x43')]['id']}})[_0x57d1('0x23')](handleEntityNotFound(_0xad558f,null))[_0x57d1('0x23')](function(_0x5e2f90){if(_0x5e2f90){_0x4615af[_0x57d1('0x48')][_0x57d1('0x4d')]=_0x5e2f90['id'];_0x4615af[_0x57d1('0x48')]['Subjects']=integrations[_0x57d1('0x4e')](_0x4615af[_0x57d1('0x48')][_0x57d1('0x4f')],_0x4615af[_0x57d1('0x48')]['type']);_0x4615af[_0x57d1('0x48')][_0x57d1('0x50')]=integrations['getDescriptions'](_0x4615af[_0x57d1('0x48')][_0x57d1('0x4f')],_0x4615af[_0x57d1('0x48')]['type']);return db['SalesforceConfiguration'][_0x57d1('0x46')](_0x4615af[_0x57d1('0x48')],{'include':[{'model':db[_0x57d1('0x51')],'as':'Subjects'},{'model':db['SalesforceField'],'as':_0x57d1('0x50')}]});}return null;})[_0x57d1('0x23')](respondWithResult(_0xad558f,null))['catch'](handleError(_0xad558f,null));};exports[_0x57d1('0x52')]=function(_0x25bb8e,_0x5d7d84,_0x53d9b6){var _0x56aef2;var _0xc5929f='';var _0x4eb230=_0x57d1('0x53');return db[_0x57d1('0x29')]['findOne']({'where':{'id':_0x25bb8e[_0x57d1('0x43')]['id']},'attributes':['id','remoteUri','clientId',_0x57d1('0x54'),'username',_0x57d1('0x55'),_0x57d1('0x56')]})[_0x57d1('0x23')](handleEntityNotFound(_0x5d7d84,null))[_0x57d1('0x23')](function(_0x1b613d){if(_0x1b613d){_0xc5929f=_0x1b613d[_0x57d1('0x57')];var _0x4cb8e8=_0xc5929f[_0x57d1('0x58')](-0x1);if(_0x4cb8e8==='/'){_0xc5929f=_0xc5929f['substring'](0x0,_0xc5929f['lastIndexOf'](_0x4cb8e8));}_0x56aef2=new jsforce['Connection']({'oauth2':{'loginUrl':_0xc5929f,'clientId':_0x1b613d[_0x57d1('0x59')],'clientSecret':_0x1b613d[_0x57d1('0x54')]}});return _0x56aef2[_0x57d1('0x5a')](_0x1b613d[_0x57d1('0x5b')],_0x1b613d[_0x57d1('0x55')][_0x57d1('0x5c')](_0x1b613d[_0x57d1('0x56')]));}})[_0x57d1('0x23')](function(_0x4c5d9b){if(_0x4c5d9b){if(!_['isNil'](_0x25bb8e['query'][_0x57d1('0x5d')])){_0x4eb230=_0x25bb8e[_0x57d1('0x2e')][_0x57d1('0x5d')];}return _0x56aef2['sobject'](_0x4eb230)[_0x57d1('0x5e')]();}})['then'](function(_0x19bcba){var _0x39746c=['OwnerId','ActivityDate',_0x57d1('0x5f'),_0x57d1('0x60'),_0x57d1('0x61'),_0x57d1('0x62')];var _0x2c04b6=[_0x57d1('0x63'),'int','picklist',_0x57d1('0x64'),_0x57d1('0x65'),'textarea',_0x57d1('0x66')];if(_0x19bcba){_[_0x57d1('0x67')](_0x19bcba[_0x57d1('0x33')],function(_0x38277d){return _0x39746c[_0x57d1('0x68')](_0x38277d['name'])||!_0x2c04b6[_0x57d1('0x68')](_0x38277d[_0x57d1('0x2c')]);});return{'count':_0x19bcba[_0x57d1('0x33')][_0x57d1('0x34')],'rows':_[_0x57d1('0x3b')](_0x19bcba[_0x57d1('0x33')],function(_0x553b58){return{'id':_0x553b58['name'],'name':_0x553b58[_0x57d1('0x69')],'custom':_0x553b58[_0x57d1('0x6a')],'options':_0x553b58[_0x57d1('0x6b')][_0x57d1('0x34')]>0x0?_[_0x57d1('0x3b')](_0x553b58[_0x57d1('0x6b')],function(_0x29dfe4){return{'name':_0x29dfe4['label'],'value':_0x29dfe4[_0x57d1('0x6c')]};}):_0x553b58[_0x57d1('0x2c')]=='boolean'?[{'name':'True','value':_0x57d1('0x6d')},{'name':_0x57d1('0x6e'),'value':_0x57d1('0x6f')}]:[]};})};}})[_0x57d1('0x23')](respondWithResult(_0x5d7d84,null))['catch'](function(_0x32e440){var _0x185a5f=_0x25bb8e[_0x57d1('0x2e')][_0x57d1('0x70')]?0x1f4:_0x32e440[_0x57d1('0x71')]||0x1f4;logger[_0x57d1('0x72')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x185a5f,JSON['stringify'](_0x32e440));delete _0x32e440['name'];if(_0x185a5f===0x191){_0x185a5f=0x190;}_0x5d7d84[_0x57d1('0x1a')](_0x185a5f)[_0x57d1('0x27')](_0x25bb8e[_0x57d1('0x2e')]['test']?{'message':_0x57d1('0x73'),'statusCode':_0x32e440[_0x57d1('0x71')]}:_0x32e440);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 6cc1f04..3657c30 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 _0xfc87=['request-promise','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','SalesforceAccount','int_salesforce_accounts','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x574e8e,_0x2b7d0b){var _0x5cf9a7=function(_0x3879e6){while(--_0x3879e6){_0x574e8e['push'](_0x574e8e['shift']());}};_0x5cf9a7(++_0x2b7d0b);}(_0xfc87,0x1ce));var _0x7fc8=function(_0x30deed,_0x17669c){_0x30deed=_0x30deed-0x0;var _0x135548=_0xfc87[_0x30deed];return _0x135548;};'use strict';var _=require(_0x7fc8('0x0'));var util=require(_0x7fc8('0x1'));var logger=require(_0x7fc8('0x2'))(_0x7fc8('0x3'));var moment=require(_0x7fc8('0x4'));var BPromise=require(_0x7fc8('0x5'));var rp=require(_0x7fc8('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7fc8('0x7'));var config=require(_0x7fc8('0x8'));var attributes=require(_0x7fc8('0x9'));var integrations=require(_0x7fc8('0xa'));module['exports']=function(_0x3ebc4b,_0xafe094){return _0x3ebc4b['define'](_0x7fc8('0xb'),attributes,{'tableName':_0x7fc8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x92e8=['request-promise','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','exports','SalesforceAccount','lodash','api','bluebird'];(function(_0x5d2fb1,_0x503997){var _0x44b61b=function(_0x4ff4c7){while(--_0x4ff4c7){_0x5d2fb1['push'](_0x5d2fb1['shift']());}};_0x44b61b(++_0x503997);}(_0x92e8,0x7f));var _0x892e=function(_0x5cb367,_0x27ec9d){_0x5cb367=_0x5cb367-0x0;var _0x279365=_0x92e8[_0x5cb367];return _0x279365;};'use strict';var _=require(_0x892e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x892e('0x1'));var moment=require('moment');var BPromise=require(_0x892e('0x2'));var rp=require(_0x892e('0x3'));var fs=require('fs');var path=require(_0x892e('0x4'));var rimraf=require(_0x892e('0x5'));var config=require(_0x892e('0x6'));var attributes=require(_0x892e('0x7'));var integrations=require('../../components/integrations/configuration');module[_0x892e('0x8')]=function(_0x47adfa,_0x41a2c8){return _0x47adfa['define'](_0x892e('0x9'),attributes,{'tableName':'int_salesforce_accounts','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 abd89ae..dafc6be 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 _0x5d3b=['ShowSalesforceAccount','find','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','client','then','info','SalesforceAccount,\x20%s,\x20%s','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','where','attributes','limit','include','map','model','debug','stringify'];(function(_0xfc959c,_0x4660c){var _0xa12959=function(_0x474863){while(--_0x474863){_0xfc959c['push'](_0xfc959c['shift']());}};_0xa12959(++_0x4660c);}(_0x5d3b,0x1d3));var _0xb5d3=function(_0x14b302,_0x20c345){_0x14b302=_0x14b302-0x0;var _0x319f08=_0x5d3b[_0x14b302];return _0x319f08;};'use strict';var _=require(_0xb5d3('0x0'));var util=require('util');var moment=require(_0xb5d3('0x1'));var BPromise=require(_0xb5d3('0x2'));var rs=require(_0xb5d3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb5d3('0x4'))['db'];var utils=require(_0xb5d3('0x5'));var logger=require('../../config/logger')(_0xb5d3('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb5d3('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2e825a,_0x5bf12a,_0x4b5076){return new BPromise(function(_0x3378d0,_0x107bb9){return client['request'](_0x2e825a,_0x4b5076)[_0xb5d3('0x8')](function(_0x96850c){logger[_0xb5d3('0x9')](_0xb5d3('0xa'),_0x5bf12a,'request\x20sent');logger['debug'](_0xb5d3('0xb'),_0x5bf12a,'request\x20sent',JSON['stringify'](_0x96850c));if(_0x96850c[_0xb5d3('0xc')]){if(_0x96850c[_0xb5d3('0xc')]['code']===0x1f4){logger[_0xb5d3('0xc')]('SalesforceAccount,\x20%s,\x20%s',_0x5bf12a,_0x96850c[_0xb5d3('0xc')][_0xb5d3('0xd')]);return _0x107bb9(_0x96850c[_0xb5d3('0xc')][_0xb5d3('0xd')]);}logger[_0xb5d3('0xc')](_0xb5d3('0xa'),_0x5bf12a,_0x96850c['error'][_0xb5d3('0xd')]);return _0x3378d0(_0x96850c[_0xb5d3('0xc')][_0xb5d3('0xd')]);}else{logger[_0xb5d3('0x9')]('SalesforceAccount,\x20%s,\x20%s',_0x5bf12a,'request\x20sent');_0x3378d0(_0x96850c[_0xb5d3('0xe')][_0xb5d3('0xd')]);}})[_0xb5d3('0xf')](function(_0x40fa9c){logger['error'](_0xb5d3('0xa'),_0x5bf12a,_0x40fa9c);_0x107bb9(_0x40fa9c);});});}exports[_0xb5d3('0x10')]=function(_0x1dc439){var _0x5d3e3d=this;return new Promise(function(_0xcd4b0f,_0x3889ca){return db[_0xb5d3('0x11')][_0xb5d3('0x12')]({'raw':_0x1dc439[_0xb5d3('0x13')]?_0x1dc439[_0xb5d3('0x13')][_0xb5d3('0x14')]===undefined?!![]:![]:!![],'where':_0x1dc439[_0xb5d3('0x13')]?_0x1dc439[_0xb5d3('0x13')][_0xb5d3('0x15')]||null:null,'attributes':_0x1dc439[_0xb5d3('0x13')]?_0x1dc439[_0xb5d3('0x13')][_0xb5d3('0x16')]||null:null,'limit':_0x1dc439[_0xb5d3('0x13')]?_0x1dc439[_0xb5d3('0x13')][_0xb5d3('0x17')]||null:null,'include':_0x1dc439['options']?_0x1dc439[_0xb5d3('0x13')][_0xb5d3('0x18')]?_[_0xb5d3('0x19')](_0x1dc439['options'][_0xb5d3('0x18')],function(_0x2c8dd3){return{'model':db[_0x2c8dd3[_0xb5d3('0x1a')]],'as':_0x2c8dd3['as'],'attributes':_0x2c8dd3[_0xb5d3('0x16')],'include':_0x2c8dd3[_0xb5d3('0x18')]?_[_0xb5d3('0x19')](_0x2c8dd3[_0xb5d3('0x18')],function(_0x49a4b3){return{'model':db[_0x49a4b3[_0xb5d3('0x1a')]],'as':_0x49a4b3['as'],'attributes':_0x49a4b3['attributes'],'include':_0x49a4b3[_0xb5d3('0x18')]?_[_0xb5d3('0x19')](_0x49a4b3[_0xb5d3('0x18')],function(_0x369337){return{'model':db[_0x369337[_0xb5d3('0x1a')]],'as':_0x369337['as'],'attributes':_0x369337[_0xb5d3('0x16')]};}):[]};}):[]};}):[]:[]})[_0xb5d3('0x8')](function(_0x278921){logger[_0xb5d3('0x9')](_0xb5d3('0x10'),_0x1dc439);logger[_0xb5d3('0x1b')](_0xb5d3('0x10'),_0x1dc439,JSON[_0xb5d3('0x1c')](_0x278921));_0xcd4b0f(_0x278921);})['catch'](function(_0x34f645){logger['error'](_0xb5d3('0x10'),_0x34f645[_0xb5d3('0xd')],_0x1dc439);_0x3889ca(_0x5d3e3d[_0xb5d3('0xc')](0x1f4,_0x34f645[_0xb5d3('0xd')]));});});};exports[_0xb5d3('0x1d')]=function(_0x1fc95a){var _0x517107=this;return new Promise(function(_0x2190d3,_0x214780){return db[_0xb5d3('0x11')][_0xb5d3('0x1e')]({'raw':_0x1fc95a[_0xb5d3('0x13')]?_0x1fc95a[_0xb5d3('0x13')]['raw']===undefined?!![]:![]:!![],'where':_0x1fc95a[_0xb5d3('0x13')]?_0x1fc95a[_0xb5d3('0x13')]['where']||null:null,'attributes':_0x1fc95a[_0xb5d3('0x13')]?_0x1fc95a['options'][_0xb5d3('0x16')]||null:null,'include':_0x1fc95a[_0xb5d3('0x13')]?_0x1fc95a['options'][_0xb5d3('0x18')]?_[_0xb5d3('0x19')](_0x1fc95a[_0xb5d3('0x13')][_0xb5d3('0x18')],function(_0x443920){return{'model':db[_0x443920[_0xb5d3('0x1a')]],'as':_0x443920['as'],'attributes':_0x443920[_0xb5d3('0x16')],'include':_0x443920[_0xb5d3('0x18')]?_['map'](_0x443920[_0xb5d3('0x18')],function(_0x2151da){return{'model':db[_0x2151da['model']],'as':_0x2151da['as'],'attributes':_0x2151da[_0xb5d3('0x16')],'include':_0x2151da[_0xb5d3('0x18')]?_[_0xb5d3('0x19')](_0x2151da[_0xb5d3('0x18')],function(_0x256c95){return{'model':db[_0x256c95[_0xb5d3('0x1a')]],'as':_0x256c95['as'],'attributes':_0x256c95[_0xb5d3('0x16')]};}):[]};}):[]};}):[]:[]})[_0xb5d3('0x8')](function(_0x4e3569){logger[_0xb5d3('0x9')]('ShowSalesforceAccount',_0x1fc95a);logger['debug'](_0xb5d3('0x1d'),_0x1fc95a,JSON[_0xb5d3('0x1c')](_0x4e3569));_0x2190d3(_0x4e3569);})['catch'](function(_0x44fce4){logger[_0xb5d3('0xc')](_0xb5d3('0x1d'),_0x44fce4[_0xb5d3('0xd')],_0x1fc95a);_0x214780(_0x517107[_0xb5d3('0xc')](0x1f4,_0x44fce4[_0xb5d3('0xd')]));});});}; \ No newline at end of file +var _0x1702=['options','raw','attributes','limit','include','model','map','ShowSalesforceAccount','SalesforceAccount','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SalesforceAccount,\x20%s,\x20%s','message','result','catch','GetSalesforceAccount','findAll'];(function(_0x37cfb6,_0x4a9b59){var _0x5390ed=function(_0x506f0c){while(--_0x506f0c){_0x37cfb6['push'](_0x37cfb6['shift']());}};_0x5390ed(++_0x4a9b59);}(_0x1702,0x114));var _0x2170=function(_0x108aaa,_0x1a1902){_0x108aaa=_0x108aaa-0x0;var _0x20f477=_0x1702[_0x108aaa];return _0x20f477;};'use strict';var _=require(_0x2170('0x0'));var util=require(_0x2170('0x1'));var moment=require(_0x2170('0x2'));var BPromise=require(_0x2170('0x3'));var rs=require(_0x2170('0x4'));var fs=require('fs');var Redis=require(_0x2170('0x5'));var db=require(_0x2170('0x6'))['db'];var utils=require(_0x2170('0x7'));var logger=require('../../config/logger')(_0x2170('0x8'));var config=require(_0x2170('0x9'));var jayson=require(_0x2170('0xa'));var client=jayson[_0x2170('0xb')][_0x2170('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4b6233,_0x4446d8,_0x34151f){return new BPromise(function(_0x2f937f,_0xe8569e){return client[_0x2170('0xd')](_0x4b6233,_0x34151f)[_0x2170('0xe')](function(_0x5ee74f){logger[_0x2170('0xf')]('SalesforceAccount,\x20%s,\x20%s',_0x4446d8,'request\x20sent');logger[_0x2170('0x10')](_0x2170('0x11'),_0x4446d8,_0x2170('0x12'),JSON[_0x2170('0x13')](_0x5ee74f));if(_0x5ee74f[_0x2170('0x14')]){if(_0x5ee74f[_0x2170('0x14')][_0x2170('0x15')]===0x1f4){logger[_0x2170('0x14')](_0x2170('0x16'),_0x4446d8,_0x5ee74f['error'][_0x2170('0x17')]);return _0xe8569e(_0x5ee74f[_0x2170('0x14')][_0x2170('0x17')]);}logger[_0x2170('0x14')](_0x2170('0x16'),_0x4446d8,_0x5ee74f['error'][_0x2170('0x17')]);return _0x2f937f(_0x5ee74f['error'][_0x2170('0x17')]);}else{logger['info']('SalesforceAccount,\x20%s,\x20%s',_0x4446d8,_0x2170('0x12'));_0x2f937f(_0x5ee74f[_0x2170('0x18')][_0x2170('0x17')]);}})[_0x2170('0x19')](function(_0x455ee2){logger[_0x2170('0x14')](_0x2170('0x16'),_0x4446d8,_0x455ee2);_0xe8569e(_0x455ee2);});});}exports[_0x2170('0x1a')]=function(_0x1d516a){var _0x199a45=this;return new Promise(function(_0x222d8d,_0x17a3d0){return db['SalesforceAccount'][_0x2170('0x1b')]({'raw':_0x1d516a[_0x2170('0x1c')]?_0x1d516a[_0x2170('0x1c')][_0x2170('0x1d')]===undefined?!![]:![]:!![],'where':_0x1d516a[_0x2170('0x1c')]?_0x1d516a[_0x2170('0x1c')]['where']||null:null,'attributes':_0x1d516a[_0x2170('0x1c')]?_0x1d516a[_0x2170('0x1c')][_0x2170('0x1e')]||null:null,'limit':_0x1d516a[_0x2170('0x1c')]?_0x1d516a[_0x2170('0x1c')][_0x2170('0x1f')]||null:null,'include':_0x1d516a['options']?_0x1d516a[_0x2170('0x1c')][_0x2170('0x20')]?_['map'](_0x1d516a[_0x2170('0x1c')][_0x2170('0x20')],function(_0x4c8dfe){return{'model':db[_0x4c8dfe[_0x2170('0x21')]],'as':_0x4c8dfe['as'],'attributes':_0x4c8dfe[_0x2170('0x1e')],'include':_0x4c8dfe[_0x2170('0x20')]?_[_0x2170('0x22')](_0x4c8dfe['include'],function(_0x168b28){return{'model':db[_0x168b28[_0x2170('0x21')]],'as':_0x168b28['as'],'attributes':_0x168b28[_0x2170('0x1e')],'include':_0x168b28[_0x2170('0x20')]?_['map'](_0x168b28[_0x2170('0x20')],function(_0xa03dce){return{'model':db[_0xa03dce['model']],'as':_0xa03dce['as'],'attributes':_0xa03dce[_0x2170('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x34a1aa){logger['info'](_0x2170('0x1a'),_0x1d516a);logger[_0x2170('0x10')]('GetSalesforceAccount',_0x1d516a,JSON['stringify'](_0x34a1aa));_0x222d8d(_0x34a1aa);})[_0x2170('0x19')](function(_0x1a008d){logger[_0x2170('0x14')](_0x2170('0x1a'),_0x1a008d['message'],_0x1d516a);_0x17a3d0(_0x199a45[_0x2170('0x14')](0x1f4,_0x1a008d[_0x2170('0x17')]));});});};exports[_0x2170('0x23')]=function(_0x35213f){var _0x38bb8b=this;return new Promise(function(_0x533869,_0x5b4230){return db[_0x2170('0x24')]['find']({'raw':_0x35213f['options']?_0x35213f['options'][_0x2170('0x1d')]===undefined?!![]:![]:!![],'where':_0x35213f[_0x2170('0x1c')]?_0x35213f[_0x2170('0x1c')][_0x2170('0x25')]||null:null,'attributes':_0x35213f[_0x2170('0x1c')]?_0x35213f[_0x2170('0x1c')][_0x2170('0x1e')]||null:null,'include':_0x35213f[_0x2170('0x1c')]?_0x35213f['options'][_0x2170('0x20')]?_[_0x2170('0x22')](_0x35213f[_0x2170('0x1c')][_0x2170('0x20')],function(_0x2f4332){return{'model':db[_0x2f4332[_0x2170('0x21')]],'as':_0x2f4332['as'],'attributes':_0x2f4332[_0x2170('0x1e')],'include':_0x2f4332['include']?_[_0x2170('0x22')](_0x2f4332[_0x2170('0x20')],function(_0x55cd1e){return{'model':db[_0x55cd1e['model']],'as':_0x55cd1e['as'],'attributes':_0x55cd1e[_0x2170('0x1e')],'include':_0x55cd1e['include']?_[_0x2170('0x22')](_0x55cd1e[_0x2170('0x20')],function(_0x138e29){return{'model':db[_0x138e29[_0x2170('0x21')]],'as':_0x138e29['as'],'attributes':_0x138e29[_0x2170('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2988f3){logger[_0x2170('0xf')](_0x2170('0x23'),_0x35213f);logger[_0x2170('0x10')]('ShowSalesforceAccount',_0x35213f,JSON[_0x2170('0x13')](_0x2988f3));_0x533869(_0x2988f3);})[_0x2170('0x19')](function(_0x12e64d){logger[_0x2170('0x14')](_0x2170('0x23'),_0x12e64d[_0x2170('0x17')],_0x35213f);_0x5b4230(_0x38bb8b[_0x2170('0x14')](0x1f4,_0x12e64d['message']));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 9573686..7e69a8b 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 _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(_0x31c4f4,_0x4f2407){var _0x2d7aa8=function(_0x1625da){while(--_0x1625da){_0x31c4f4['push'](_0x31c4f4['shift']());}};_0x2d7aa8(++_0x4f2407);}(_0x5f66,0x1a0));var _0x65f6=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x5f66[_0x502c7d];return _0x30b7ed;};'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 +var _0x2ef3=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intSalesforceConfiguration.controller','get','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','exports','multer','util','path'];(function(_0x40f931,_0x31ea85){var _0xeaf362=function(_0x5a9421){while(--_0x5a9421){_0x40f931['push'](_0x40f931['shift']());}};_0xeaf362(++_0x31ea85);}(_0x2ef3,0xba));var _0x32ef=function(_0x11f97a,_0x343460){_0x11f97a=_0x11f97a-0x0;var _0x394fcb=_0x2ef3[_0x11f97a];return _0x394fcb;};'use strict';var multer=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var path=require(_0x32ef('0x2'));var timeout=require(_0x32ef('0x3'));var express=require(_0x32ef('0x4'));var router=express[_0x32ef('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x32ef('0x6'));var interaction=require(_0x32ef('0x7'));var config=require('../../config/environment');var controller=require(_0x32ef('0x8'));router[_0x32ef('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x32ef('0x9')](_0x32ef('0xa'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x9')](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xe')]);router[_0x32ef('0x9')](_0x32ef('0xf'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x32ef('0x9')](_0x32ef('0x10'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x11')]);router['post']('/',auth[_0x32ef('0xb')](),controller['create']);router[_0x32ef('0x12')]('/:id',auth[_0x32ef('0xb')](),controller[_0x32ef('0x13')]);router['delete']('/:id',auth[_0x32ef('0xb')](),controller['destroy']);module[_0x32ef('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 85c121c..6e48ae4 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 _0x6222=['nothing','exports','STRING','ENUM','Task','contact','lead','account','contact_lead'];(function(_0x520563,_0x227f8d){var _0x4975c9=function(_0x2f5bd4){while(--_0x2f5bd4){_0x520563['push'](_0x520563['shift']());}};_0x4975c9(++_0x227f8d);}(_0x6222,0x9a));var _0x2622=function(_0x2dddcc,_0x2aaa07){_0x2dddcc=_0x2dddcc-0x0;var _0xd43bd0=_0x6222[_0x2dddcc];return _0xd43bd0;};'use strict';var Sequelize=require('sequelize');module[_0x2622('0x0')]={'name':{'type':Sequelize[_0x2622('0x1')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x2622('0x2')]('Task','Case'),'defaultValue':_0x2622('0x3')},'moduleSearch':{'type':Sequelize['ENUM']('contact_lead',_0x2622('0x4'),_0x2622('0x5'),'account_contact_lead',_0x2622('0x6')),'defaultValue':_0x2622('0x7')},'moduleCreate':{'type':Sequelize['ENUM'](_0x2622('0x8'),_0x2622('0x4'),_0x2622('0x5'),_0x2622('0x6')),'defaultValue':_0x2622('0x5')},'leadId':{'type':Sequelize[_0x2622('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0x2622('0x1')]},'additionalSearchContact':{'type':Sequelize[_0x2622('0x1')]},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3a66=['lead','account_contact_lead','account','nothing','sequelize','exports','STRING','ENUM','Task','Case','contact_lead','contact'];(function(_0x397f37,_0x3cf86d){var _0x31cae6=function(_0x5cddb9){while(--_0x5cddb9){_0x397f37['push'](_0x397f37['shift']());}};_0x31cae6(++_0x3cf86d);}(_0x3a66,0xa0));var _0x63a6=function(_0x29771f,_0x1189ae){_0x29771f=_0x29771f-0x0;var _0x279baf=_0x3a66[_0x29771f];return _0x279baf;};'use strict';var Sequelize=require(_0x63a6('0x0'));module[_0x63a6('0x1')]={'name':{'type':Sequelize[_0x63a6('0x2')]},'description':{'type':Sequelize[_0x63a6('0x2')]},'ticketType':{'type':Sequelize[_0x63a6('0x3')](_0x63a6('0x4'),_0x63a6('0x5')),'defaultValue':_0x63a6('0x4')},'moduleSearch':{'type':Sequelize['ENUM'](_0x63a6('0x6'),_0x63a6('0x7'),_0x63a6('0x8'),_0x63a6('0x9'),_0x63a6('0xa')),'defaultValue':_0x63a6('0x6')},'moduleCreate':{'type':Sequelize['ENUM'](_0x63a6('0xb'),_0x63a6('0x7'),_0x63a6('0x8'),_0x63a6('0xa')),'defaultValue':_0x63a6('0x8')},'leadId':{'type':Sequelize[_0x63a6('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0x63a6('0x2')]},'additionalSearchContact':{'type':Sequelize[_0x63a6('0x2')]},'additionalSearchLead':{'type':Sequelize[_0x63a6('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 557e621..b995c1f 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 _0xd302=['hasOwnProperty','nolimit','order','where','filters','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','length','find','body','findOne','sort','pick','getFields','getSubjects','filter','getDescriptions','SalesforceField','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','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','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','map','SalesforceConfiguration','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes'];(function(_0x9d1c14,_0x1e9c8a){var _0x287a63=function(_0x5ad3c5){while(--_0x5ad3c5){_0x9d1c14['push'](_0x9d1c14['shift']());}};_0x287a63(++_0x1e9c8a);}(_0xd302,0x160));var _0x2d30=function(_0x40639f,_0x57f2f2){_0x40639f=_0x40639f-0x0;var _0x1618b7=_0xd302[_0x40639f];return _0x1618b7;};'use strict';var emlformat=require(_0x2d30('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2d30('0x1'));var rp=require(_0x2d30('0x2'));var moment=require(_0x2d30('0x3'));var BPromise=require(_0x2d30('0x4'));var Mustache=require(_0x2d30('0x5'));var util=require(_0x2d30('0x6'));var path=require(_0x2d30('0x7'));var sox=require(_0x2d30('0x8'));var csv=require(_0x2d30('0x9'));var ejs=require(_0x2d30('0xa'));var fs=require('fs');var fs_extra=require(_0x2d30('0xb'));var _=require('lodash');var squel=require(_0x2d30('0xc'));var crypto=require(_0x2d30('0xd'));var jsforce=require(_0x2d30('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2d30('0xf'));var Papa=require('papaparse');var Redis=require(_0x2d30('0x10'));var authService=require(_0x2d30('0x11'));var qs=require(_0x2d30('0x12'));var as=require(_0x2d30('0x13'));var hardwareService=require(_0x2d30('0x14'));var logger=require(_0x2d30('0x15'))(_0x2d30('0x16'));var utils=require(_0x2d30('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x2d30('0x18'));var db=require(_0x2d30('0x19'))['db'];function respondWithStatusCode(_0xc06eb4,_0x1040f6){_0x1040f6=_0x1040f6||0xcc;return function(_0x1fc146){if(_0x1fc146){return _0xc06eb4[_0x2d30('0x1a')](_0x1040f6);}return _0xc06eb4['status'](_0x1040f6)[_0x2d30('0x1b')]();};}function respondWithResult(_0x46aab7,_0x7f2465){_0x7f2465=_0x7f2465||0xc8;return function(_0x84044){if(_0x84044){return _0x46aab7[_0x2d30('0x1c')](_0x7f2465)['json'](_0x84044);}};}function respondWithFilteredResult(_0x194e31,_0x305d2e){return function(_0x3cfcaa){if(_0x3cfcaa){var _0x2119c9=typeof _0x305d2e['offset']==='undefined'&&typeof _0x305d2e['limit']===_0x2d30('0x1d');var _0x232b88=_0x3cfcaa[_0x2d30('0x1e')];var _0x485399=_0x2119c9?0x0:_0x305d2e[_0x2d30('0x1f')];var _0x332782=_0x2119c9?_0x3cfcaa[_0x2d30('0x1e')]:_0x305d2e[_0x2d30('0x1f')]+_0x305d2e[_0x2d30('0x20')];var _0x31b687;if(_0x332782>=_0x232b88){_0x332782=_0x232b88;_0x31b687=0xc8;}else{_0x31b687=0xce;}_0x194e31[_0x2d30('0x1c')](_0x31b687);return _0x194e31[_0x2d30('0x21')](_0x2d30('0x22'),_0x485399+'-'+_0x332782+'/'+_0x232b88)[_0x2d30('0x23')](_0x3cfcaa);}return null;};}function patchUpdates(_0x58c56d){return function(_0x5f5909){try{jsonpatch[_0x2d30('0x24')](_0x5f5909,_0x58c56d,!![]);}catch(_0x5470f9){return BPromise[_0x2d30('0x25')](_0x5470f9);}return _0x5f5909[_0x2d30('0x26')]();};}function saveUpdates(_0x3422d1,_0x60c12b){return function(_0x4b5d7e){if(_0x4b5d7e){return _0x4b5d7e[_0x2d30('0x27')](_0x3422d1)[_0x2d30('0x28')](function(_0x3758ec){return _0x3758ec;});}return null;};}function removeEntity(_0x3b51a3,_0x5462dd){return function(_0x7622fe){if(_0x7622fe){return _0x7622fe[_0x2d30('0x29')]()[_0x2d30('0x28')](function(){_0x3b51a3[_0x2d30('0x1c')](0xcc)[_0x2d30('0x1b')]();});}};}function handleEntityNotFound(_0x6ffc08,_0x3b2573){return function(_0x15b3c4){if(!_0x15b3c4){_0x6ffc08[_0x2d30('0x1a')](0x194);}return _0x15b3c4;};}function handleError(_0x4e2917,_0xf1fda6){_0xf1fda6=_0xf1fda6||0x1f4;return function(_0x56c76c){logger[_0x2d30('0x2a')](_0x56c76c[_0x2d30('0x2b')]);if(_0x56c76c[_0x2d30('0x2c')]){delete _0x56c76c[_0x2d30('0x2c')];}_0x4e2917['status'](_0xf1fda6)[_0x2d30('0x2d')](_0x56c76c);};}exports['index']=function(_0x42304a,_0x1cb60e){var _0x80ee4b={},_0x531328={},_0x40def7={'count':0x0,'rows':[]};var _0x3d740a=_[_0x2d30('0x2e')](db[_0x2d30('0x2f')][_0x2d30('0x30')],function(_0x5b7b50){return{'name':_0x5b7b50[_0x2d30('0x31')],'type':_0x5b7b50[_0x2d30('0x32')][_0x2d30('0x33')]};});_0x531328[_0x2d30('0x34')]=_[_0x2d30('0x2e')](_0x3d740a,_0x2d30('0x2c'));_0x531328[_0x2d30('0x35')]=_[_0x2d30('0x36')](_0x42304a[_0x2d30('0x35')]);_0x531328['filters']=_[_0x2d30('0x37')](_0x531328['model'],_0x531328[_0x2d30('0x35')]);_0x80ee4b['attributes']=_[_0x2d30('0x37')](_0x531328['model'],qs[_0x2d30('0x38')](_0x42304a[_0x2d30('0x35')][_0x2d30('0x38')]));_0x80ee4b[_0x2d30('0x39')]=_0x80ee4b[_0x2d30('0x39')]['length']?_0x80ee4b[_0x2d30('0x39')]:_0x531328['model'];if(!_0x42304a[_0x2d30('0x35')][_0x2d30('0x3a')](_0x2d30('0x3b'))){_0x80ee4b[_0x2d30('0x20')]=qs[_0x2d30('0x20')](_0x42304a[_0x2d30('0x35')][_0x2d30('0x20')]);_0x80ee4b[_0x2d30('0x1f')]=qs[_0x2d30('0x1f')](_0x42304a['query'][_0x2d30('0x1f')]);}_0x80ee4b[_0x2d30('0x3c')]=qs['sort'](_0x42304a[_0x2d30('0x35')]['sort']);_0x80ee4b[_0x2d30('0x3d')]=qs[_0x2d30('0x3e')](_['pick'](_0x42304a[_0x2d30('0x35')],_0x531328[_0x2d30('0x3e')]),_0x3d740a);if(_0x42304a[_0x2d30('0x35')]['filter']){_0x80ee4b[_0x2d30('0x3d')]=_[_0x2d30('0x3f')](_0x80ee4b['where'],{'$or':_[_0x2d30('0x2e')](_0x3d740a,function(_0x4c369){if(_0x4c369[_0x2d30('0x32')]!==_0x2d30('0x40')){var _0x2083c5={};_0x2083c5[_0x4c369[_0x2d30('0x2c')]]={'$like':'%'+_0x42304a['query']['filter']+'%'};return _0x2083c5;}})});}_0x80ee4b=_[_0x2d30('0x3f')]({},_0x80ee4b,_0x42304a[_0x2d30('0x41')]);var _0x161bb7={'where':_0x80ee4b[_0x2d30('0x3d')]};return db[_0x2d30('0x2f')]['count'](_0x161bb7)['then'](function(_0x5e4977){_0x40def7['count']=_0x5e4977;if(_0x42304a[_0x2d30('0x35')][_0x2d30('0x42')]){_0x80ee4b['include']=[{'all':!![]}];}return db[_0x2d30('0x2f')][_0x2d30('0x43')](_0x80ee4b);})[_0x2d30('0x28')](function(_0xe6a5e){_0x40def7['rows']=_0xe6a5e;return _0x40def7;})[_0x2d30('0x28')](respondWithFilteredResult(_0x1cb60e,_0x80ee4b))[_0x2d30('0x44')](handleError(_0x1cb60e,null));};exports[_0x2d30('0x45')]=function(_0x8feb94,_0x43ceac){var _0x5540ac={'raw':![],'where':{'id':_0x8feb94[_0x2d30('0x46')]['id']}},_0x3e940d={};_0x3e940d[_0x2d30('0x34')]=_[_0x2d30('0x36')](db[_0x2d30('0x2f')][_0x2d30('0x30')]);_0x3e940d['query']=_[_0x2d30('0x36')](_0x8feb94[_0x2d30('0x35')]);_0x3e940d[_0x2d30('0x3e')]=_['intersection'](_0x3e940d[_0x2d30('0x34')],_0x3e940d[_0x2d30('0x35')]);_0x5540ac[_0x2d30('0x39')]=_[_0x2d30('0x37')](_0x3e940d['model'],qs[_0x2d30('0x38')](_0x8feb94[_0x2d30('0x35')][_0x2d30('0x38')]));_0x5540ac['attributes']=_0x5540ac[_0x2d30('0x39')][_0x2d30('0x47')]?_0x5540ac[_0x2d30('0x39')]:_0x3e940d['model'];if(_0x8feb94[_0x2d30('0x35')][_0x2d30('0x42')]){_0x5540ac['include']=[{'all':!![]}];}_0x5540ac=_[_0x2d30('0x3f')]({},_0x5540ac,_0x8feb94['options']);return db[_0x2d30('0x2f')][_0x2d30('0x48')](_0x5540ac)[_0x2d30('0x28')](handleEntityNotFound(_0x43ceac,null))['then'](respondWithResult(_0x43ceac,null))[_0x2d30('0x44')](handleError(_0x43ceac,null));};exports['create']=function(_0x25cebb,_0x3cc993){return db[_0x2d30('0x2f')]['create'](_0x25cebb[_0x2d30('0x49')],{})[_0x2d30('0x28')](respondWithResult(_0x3cc993,0xc9))['catch'](handleError(_0x3cc993,null));};exports['update']=function(_0x59bc0d,_0x339123){if(_0x59bc0d['body']['id']){delete _0x59bc0d[_0x2d30('0x49')]['id'];}return db[_0x2d30('0x2f')][_0x2d30('0x48')]({'where':{'id':_0x59bc0d['params']['id']}})[_0x2d30('0x28')](handleEntityNotFound(_0x339123,null))[_0x2d30('0x28')](saveUpdates(_0x59bc0d[_0x2d30('0x49')],null))[_0x2d30('0x28')](respondWithResult(_0x339123,null))[_0x2d30('0x44')](handleError(_0x339123,null));};exports[_0x2d30('0x29')]=function(_0x5f3f62,_0x74e47d){return db[_0x2d30('0x2f')]['find']({'where':{'id':_0x5f3f62['params']['id']}})[_0x2d30('0x28')](handleEntityNotFound(_0x74e47d,null))['then'](removeEntity(_0x74e47d,null))[_0x2d30('0x44')](handleError(_0x74e47d,null));};exports['getFields']=function(_0x4a50db,_0x40ee27,_0x558797){var _0x60fcdd={};var _0x888ada={};var _0x3dcb61;var _0x562cc1;return db['SalesforceConfiguration'][_0x2d30('0x4a')]({'where':{'id':_0x4a50db[_0x2d30('0x46')]['id']}})[_0x2d30('0x28')](handleEntityNotFound(_0x40ee27,null))[_0x2d30('0x28')](function(_0x229c94){if(_0x229c94){_0x3dcb61=_0x229c94;_0x888ada[_0x2d30('0x34')]=_[_0x2d30('0x36')](db['SalesforceField'][_0x2d30('0x30')]);_0x888ada[_0x2d30('0x35')]=_[_0x2d30('0x36')](_0x4a50db['query']);_0x888ada[_0x2d30('0x3e')]=_['intersection'](_0x888ada[_0x2d30('0x34')],_0x888ada['query']);_0x60fcdd[_0x2d30('0x39')]=_[_0x2d30('0x37')](_0x888ada[_0x2d30('0x34')],qs[_0x2d30('0x38')](_0x4a50db['query']['fields']));_0x60fcdd[_0x2d30('0x39')]=_0x60fcdd[_0x2d30('0x39')][_0x2d30('0x47')]?_0x60fcdd['attributes']:_0x888ada['model'];_0x60fcdd['order']=qs[_0x2d30('0x4b')](_0x4a50db[_0x2d30('0x35')][_0x2d30('0x4b')]);_0x60fcdd['where']=qs[_0x2d30('0x3e')](_[_0x2d30('0x4c')](_0x4a50db[_0x2d30('0x35')],_0x888ada[_0x2d30('0x3e')]));if(_0x4a50db[_0x2d30('0x35')]['filter']){_0x60fcdd[_0x2d30('0x3d')]=_[_0x2d30('0x3f')](_0x60fcdd['where'],{'$or':_[_0x2d30('0x2e')](_0x60fcdd[_0x2d30('0x39')],function(_0xe20215){var _0x18a246={};_0x18a246[_0xe20215]={'$like':'%'+_0x4a50db[_0x2d30('0x35')]['filter']+'%'};return _0x18a246;})});}_0x60fcdd=_[_0x2d30('0x3f')]({},_0x60fcdd,_0x4a50db[_0x2d30('0x41')]);return _0x3dcb61[_0x2d30('0x4d')](_0x60fcdd);}})['then'](function(_0x839ccb){if(_0x839ccb){_0x562cc1=_0x839ccb[_0x2d30('0x47')];if(!_0x4a50db['query'][_0x2d30('0x3a')](_0x2d30('0x3b'))){_0x60fcdd[_0x2d30('0x20')]=qs[_0x2d30('0x20')](_0x4a50db[_0x2d30('0x35')][_0x2d30('0x20')]);_0x60fcdd[_0x2d30('0x1f')]=qs[_0x2d30('0x1f')](_0x4a50db[_0x2d30('0x35')]['offset']);}return _0x3dcb61[_0x2d30('0x4d')](_0x60fcdd);}})[_0x2d30('0x28')](function(_0x4f8363){if(_0x4f8363){return _0x4f8363?{'count':_0x562cc1,'rows':_0x4f8363}:null;}})[_0x2d30('0x28')](respondWithResult(_0x40ee27,null))[_0x2d30('0x44')](handleError(_0x40ee27,null));};exports[_0x2d30('0x4e')]=function(_0x56fb0d,_0x5cf783,_0x500a96){var _0x106e1a={};var _0x52aaa1={};var _0x54cbc0;var _0x760e86;return db[_0x2d30('0x2f')][_0x2d30('0x4a')]({'where':{'id':_0x56fb0d[_0x2d30('0x46')]['id']}})[_0x2d30('0x28')](handleEntityNotFound(_0x5cf783,null))[_0x2d30('0x28')](function(_0x3f0ab7){if(_0x3f0ab7){_0x54cbc0=_0x3f0ab7;_0x52aaa1['model']=_[_0x2d30('0x36')](db['SalesforceField'][_0x2d30('0x30')]);_0x52aaa1[_0x2d30('0x35')]=_[_0x2d30('0x36')](_0x56fb0d[_0x2d30('0x35')]);_0x52aaa1['filters']=_['intersection'](_0x52aaa1[_0x2d30('0x34')],_0x52aaa1[_0x2d30('0x35')]);_0x106e1a[_0x2d30('0x39')]=_[_0x2d30('0x37')](_0x52aaa1[_0x2d30('0x34')],qs[_0x2d30('0x38')](_0x56fb0d[_0x2d30('0x35')][_0x2d30('0x38')]));_0x106e1a['attributes']=_0x106e1a[_0x2d30('0x39')][_0x2d30('0x47')]?_0x106e1a['attributes']:_0x52aaa1[_0x2d30('0x34')];_0x106e1a[_0x2d30('0x3c')]=qs['sort'](_0x56fb0d[_0x2d30('0x35')][_0x2d30('0x4b')]);_0x106e1a[_0x2d30('0x3d')]=qs[_0x2d30('0x3e')](_[_0x2d30('0x4c')](_0x56fb0d[_0x2d30('0x35')],_0x52aaa1[_0x2d30('0x3e')]));if(_0x56fb0d['query'][_0x2d30('0x4f')]){_0x106e1a[_0x2d30('0x3d')]=_[_0x2d30('0x3f')](_0x106e1a[_0x2d30('0x3d')],{'$or':_['map'](_0x106e1a['attributes'],function(_0x5312b6){var _0x87cf35={};_0x87cf35[_0x5312b6]={'$like':'%'+_0x56fb0d[_0x2d30('0x35')][_0x2d30('0x4f')]+'%'};return _0x87cf35;})});}_0x106e1a=_[_0x2d30('0x3f')]({},_0x106e1a,_0x56fb0d['options']);return _0x54cbc0[_0x2d30('0x4e')](_0x106e1a);}})['then'](function(_0x6808e2){if(_0x6808e2){_0x760e86=_0x6808e2['length'];if(!_0x56fb0d['query']['hasOwnProperty']('nolimit')){_0x106e1a[_0x2d30('0x20')]=qs[_0x2d30('0x20')](_0x56fb0d['query']['limit']);_0x106e1a[_0x2d30('0x1f')]=qs[_0x2d30('0x1f')](_0x56fb0d[_0x2d30('0x35')]['offset']);}return _0x54cbc0[_0x2d30('0x4e')](_0x106e1a);}})[_0x2d30('0x28')](function(_0x133204){if(_0x133204){return _0x133204?{'count':_0x760e86,'rows':_0x133204}:null;}})[_0x2d30('0x28')](respondWithResult(_0x5cf783,null))[_0x2d30('0x44')](handleError(_0x5cf783,null));};exports[_0x2d30('0x50')]=function(_0x4bf041,_0x2c97dd,_0x1931b1){var _0x31c100={};var _0x38505c={};var _0x1a991f;var _0x5d3946;return db[_0x2d30('0x2f')][_0x2d30('0x4a')]({'where':{'id':_0x4bf041['params']['id']}})[_0x2d30('0x28')](handleEntityNotFound(_0x2c97dd,null))[_0x2d30('0x28')](function(_0x2b494f){if(_0x2b494f){_0x1a991f=_0x2b494f;_0x38505c[_0x2d30('0x34')]=_[_0x2d30('0x36')](db[_0x2d30('0x51')][_0x2d30('0x30')]);_0x38505c['query']=_[_0x2d30('0x36')](_0x4bf041[_0x2d30('0x35')]);_0x38505c[_0x2d30('0x3e')]=_[_0x2d30('0x37')](_0x38505c['model'],_0x38505c[_0x2d30('0x35')]);_0x31c100['attributes']=_[_0x2d30('0x37')](_0x38505c[_0x2d30('0x34')],qs[_0x2d30('0x38')](_0x4bf041[_0x2d30('0x35')][_0x2d30('0x38')]));_0x31c100['attributes']=_0x31c100[_0x2d30('0x39')]['length']?_0x31c100[_0x2d30('0x39')]:_0x38505c['model'];_0x31c100[_0x2d30('0x3c')]=qs[_0x2d30('0x4b')](_0x4bf041[_0x2d30('0x35')][_0x2d30('0x4b')]);_0x31c100[_0x2d30('0x3d')]=qs['filters'](_['pick'](_0x4bf041[_0x2d30('0x35')],_0x38505c[_0x2d30('0x3e')]));if(_0x4bf041[_0x2d30('0x35')][_0x2d30('0x4f')]){_0x31c100['where']=_[_0x2d30('0x3f')](_0x31c100['where'],{'$or':_['map'](_0x31c100[_0x2d30('0x39')],function(_0x36e757){var _0x1b83b7={};_0x1b83b7[_0x36e757]={'$like':'%'+_0x4bf041[_0x2d30('0x35')]['filter']+'%'};return _0x1b83b7;})});}_0x31c100=_[_0x2d30('0x3f')]({},_0x31c100,_0x4bf041[_0x2d30('0x41')]);return _0x1a991f['getDescriptions'](_0x31c100);}})[_0x2d30('0x28')](function(_0x12c5f7){if(_0x12c5f7){_0x5d3946=_0x12c5f7[_0x2d30('0x47')];if(!_0x4bf041[_0x2d30('0x35')][_0x2d30('0x3a')](_0x2d30('0x3b'))){_0x31c100['limit']=qs['limit'](_0x4bf041['query']['limit']);_0x31c100[_0x2d30('0x1f')]=qs['offset'](_0x4bf041[_0x2d30('0x35')]['offset']);}return _0x1a991f[_0x2d30('0x50')](_0x31c100);}})[_0x2d30('0x28')](function(_0x43e98d){if(_0x43e98d){return _0x43e98d?{'count':_0x5d3946,'rows':_0x43e98d}:null;}})[_0x2d30('0x28')](respondWithResult(_0x2c97dd,null))[_0x2d30('0x44')](handleError(_0x2c97dd,null));}; \ No newline at end of file +var _0x44ae=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','count','offset','limit','Content-Range','apply','reject','save','then','destroy','stack','name','send','index','rawAttributes','fieldName','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','type','SalesforceConfiguration','includeAll','findAll','rows','catch','show','params','include','options','find','create','body','getFields','findOne','order','getSubjects','SalesforceField','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs'];(function(_0x3afc70,_0x219425){var _0x1690e0=function(_0x5522d6){while(--_0x5522d6){_0x3afc70['push'](_0x3afc70['shift']());}};_0x1690e0(++_0x219425);}(_0x44ae,0x17d));var _0xe44a=function(_0x5c619e,_0x1bccdf){_0x5c619e=_0x5c619e-0x0;var _0x445cf8=_0x44ae[_0x5c619e];return _0x445cf8;};'use strict';var emlformat=require(_0xe44a('0x0'));var rimraf=require(_0xe44a('0x1'));var zipdir=require(_0xe44a('0x2'));var jsonpatch=require(_0xe44a('0x3'));var rp=require('request-promise');var moment=require(_0xe44a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe44a('0x5'));var util=require(_0xe44a('0x6'));var path=require(_0xe44a('0x7'));var sox=require(_0xe44a('0x8'));var csv=require(_0xe44a('0x9'));var ejs=require(_0xe44a('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe44a('0xb'));var squel=require(_0xe44a('0xc'));var crypto=require(_0xe44a('0xd'));var jsforce=require(_0xe44a('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xe44a('0x9'));var querystring=require(_0xe44a('0xf'));var Papa=require(_0xe44a('0x10'));var Redis=require(_0xe44a('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xe44a('0x12'));var as=require(_0xe44a('0x13'));var hardwareService=require(_0xe44a('0x14'));var logger=require(_0xe44a('0x15'))(_0xe44a('0x16'));var utils=require(_0xe44a('0x17'));var config=require(_0xe44a('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5f1150,_0x306f7a){_0x306f7a=_0x306f7a||0xcc;return function(_0xbfc286){if(_0xbfc286){return _0x5f1150[_0xe44a('0x19')](_0x306f7a);}return _0x5f1150['status'](_0x306f7a)[_0xe44a('0x1a')]();};}function respondWithResult(_0x3ab707,_0x3656b2){_0x3656b2=_0x3656b2||0xc8;return function(_0x14c1a8){if(_0x14c1a8){return _0x3ab707[_0xe44a('0x1b')](_0x3656b2)[_0xe44a('0x1c')](_0x14c1a8);}};}function respondWithFilteredResult(_0x1d491a,_0x575d79){return function(_0x1ec698){if(_0x1ec698){var _0x96dee=typeof _0x575d79['offset']==='undefined'&&typeof _0x575d79['limit']==='undefined';var _0x959455=_0x1ec698[_0xe44a('0x1d')];var _0x2a33b6=_0x96dee?0x0:_0x575d79['offset'];var _0x20fdc7=_0x96dee?_0x1ec698[_0xe44a('0x1d')]:_0x575d79[_0xe44a('0x1e')]+_0x575d79[_0xe44a('0x1f')];var _0x1fcfce;if(_0x20fdc7>=_0x959455){_0x20fdc7=_0x959455;_0x1fcfce=0xc8;}else{_0x1fcfce=0xce;}_0x1d491a[_0xe44a('0x1b')](_0x1fcfce);return _0x1d491a['set'](_0xe44a('0x20'),_0x2a33b6+'-'+_0x20fdc7+'/'+_0x959455)['json'](_0x1ec698);}return null;};}function patchUpdates(_0x295ceb){return function(_0x6656a8){try{jsonpatch[_0xe44a('0x21')](_0x6656a8,_0x295ceb,!![]);}catch(_0x2663bb){return BPromise[_0xe44a('0x22')](_0x2663bb);}return _0x6656a8[_0xe44a('0x23')]();};}function saveUpdates(_0x37992e,_0x4e9bab){return function(_0x203889){if(_0x203889){return _0x203889['update'](_0x37992e)[_0xe44a('0x24')](function(_0x2b53b9){return _0x2b53b9;});}return null;};}function removeEntity(_0x444c93,_0x26eba0){return function(_0x1bc4e9){if(_0x1bc4e9){return _0x1bc4e9[_0xe44a('0x25')]()[_0xe44a('0x24')](function(){_0x444c93[_0xe44a('0x1b')](0xcc)[_0xe44a('0x1a')]();});}};}function handleEntityNotFound(_0x2d91b7,_0x43ef28){return function(_0x46c16b){if(!_0x46c16b){_0x2d91b7[_0xe44a('0x19')](0x194);}return _0x46c16b;};}function handleError(_0xc69e9d,_0x5574f8){_0x5574f8=_0x5574f8||0x1f4;return function(_0x8fbbbf){logger['error'](_0x8fbbbf[_0xe44a('0x26')]);if(_0x8fbbbf[_0xe44a('0x27')]){delete _0x8fbbbf['name'];}_0xc69e9d[_0xe44a('0x1b')](_0x5574f8)[_0xe44a('0x28')](_0x8fbbbf);};}exports[_0xe44a('0x29')]=function(_0x4c6690,_0xf02b86){var _0x5091c3={},_0x1cb6c7={},_0x5e0768={'count':0x0,'rows':[]};var _0x5a57a1=_['map'](db['SalesforceConfiguration'][_0xe44a('0x2a')],function(_0x5e00f7){return{'name':_0x5e00f7[_0xe44a('0x2b')],'type':_0x5e00f7['type'][_0xe44a('0x2c')]};});_0x1cb6c7[_0xe44a('0x2d')]=_[_0xe44a('0x2e')](_0x5a57a1,'name');_0x1cb6c7[_0xe44a('0x2f')]=_[_0xe44a('0x30')](_0x4c6690['query']);_0x1cb6c7['filters']=_[_0xe44a('0x31')](_0x1cb6c7['model'],_0x1cb6c7['query']);_0x5091c3[_0xe44a('0x32')]=_[_0xe44a('0x31')](_0x1cb6c7[_0xe44a('0x2d')],qs[_0xe44a('0x33')](_0x4c6690[_0xe44a('0x2f')][_0xe44a('0x33')]));_0x5091c3[_0xe44a('0x32')]=_0x5091c3[_0xe44a('0x32')][_0xe44a('0x34')]?_0x5091c3[_0xe44a('0x32')]:_0x1cb6c7[_0xe44a('0x2d')];if(!_0x4c6690[_0xe44a('0x2f')][_0xe44a('0x35')](_0xe44a('0x36'))){_0x5091c3[_0xe44a('0x1f')]=qs[_0xe44a('0x1f')](_0x4c6690['query'][_0xe44a('0x1f')]);_0x5091c3[_0xe44a('0x1e')]=qs['offset'](_0x4c6690[_0xe44a('0x2f')][_0xe44a('0x1e')]);}_0x5091c3['order']=qs['sort'](_0x4c6690[_0xe44a('0x2f')][_0xe44a('0x37')]);_0x5091c3[_0xe44a('0x38')]=qs[_0xe44a('0x39')](_[_0xe44a('0x3a')](_0x4c6690[_0xe44a('0x2f')],_0x1cb6c7['filters']),_0x5a57a1);if(_0x4c6690[_0xe44a('0x2f')][_0xe44a('0x3b')]){_0x5091c3[_0xe44a('0x38')]=_[_0xe44a('0x3c')](_0x5091c3[_0xe44a('0x38')],{'$or':_[_0xe44a('0x2e')](_0x5a57a1,function(_0x4cca58){if(_0x4cca58[_0xe44a('0x3d')]!=='VIRTUAL'){var _0x240280={};_0x240280[_0x4cca58[_0xe44a('0x27')]]={'$like':'%'+_0x4c6690[_0xe44a('0x2f')]['filter']+'%'};return _0x240280;}})});}_0x5091c3=_[_0xe44a('0x3c')]({},_0x5091c3,_0x4c6690['options']);var _0x4b374b={'where':_0x5091c3[_0xe44a('0x38')]};return db[_0xe44a('0x3e')]['count'](_0x4b374b)['then'](function(_0xc131b6){_0x5e0768[_0xe44a('0x1d')]=_0xc131b6;if(_0x4c6690[_0xe44a('0x2f')][_0xe44a('0x3f')]){_0x5091c3['include']=[{'all':!![]}];}return db['SalesforceConfiguration'][_0xe44a('0x40')](_0x5091c3);})['then'](function(_0xdd0d9c){_0x5e0768[_0xe44a('0x41')]=_0xdd0d9c;return _0x5e0768;})[_0xe44a('0x24')](respondWithFilteredResult(_0xf02b86,_0x5091c3))[_0xe44a('0x42')](handleError(_0xf02b86,null));};exports[_0xe44a('0x43')]=function(_0x3040c0,_0x37e610){var _0x2048a3={'raw':![],'where':{'id':_0x3040c0[_0xe44a('0x44')]['id']}},_0x50e6e1={};_0x50e6e1['model']=_[_0xe44a('0x30')](db[_0xe44a('0x3e')]['rawAttributes']);_0x50e6e1['query']=_[_0xe44a('0x30')](_0x3040c0[_0xe44a('0x2f')]);_0x50e6e1[_0xe44a('0x39')]=_[_0xe44a('0x31')](_0x50e6e1['model'],_0x50e6e1['query']);_0x2048a3['attributes']=_[_0xe44a('0x31')](_0x50e6e1[_0xe44a('0x2d')],qs[_0xe44a('0x33')](_0x3040c0[_0xe44a('0x2f')][_0xe44a('0x33')]));_0x2048a3[_0xe44a('0x32')]=_0x2048a3[_0xe44a('0x32')][_0xe44a('0x34')]?_0x2048a3[_0xe44a('0x32')]:_0x50e6e1[_0xe44a('0x2d')];if(_0x3040c0[_0xe44a('0x2f')][_0xe44a('0x3f')]){_0x2048a3[_0xe44a('0x45')]=[{'all':!![]}];}_0x2048a3=_[_0xe44a('0x3c')]({},_0x2048a3,_0x3040c0[_0xe44a('0x46')]);return db['SalesforceConfiguration'][_0xe44a('0x47')](_0x2048a3)[_0xe44a('0x24')](handleEntityNotFound(_0x37e610,null))[_0xe44a('0x24')](respondWithResult(_0x37e610,null))[_0xe44a('0x42')](handleError(_0x37e610,null));};exports['create']=function(_0x53b170,_0x760a30){return db[_0xe44a('0x3e')][_0xe44a('0x48')](_0x53b170[_0xe44a('0x49')],{})['then'](respondWithResult(_0x760a30,0xc9))['catch'](handleError(_0x760a30,null));};exports['update']=function(_0x216344,_0x2d12a1){if(_0x216344[_0xe44a('0x49')]['id']){delete _0x216344[_0xe44a('0x49')]['id'];}return db[_0xe44a('0x3e')][_0xe44a('0x47')]({'where':{'id':_0x216344[_0xe44a('0x44')]['id']}})[_0xe44a('0x24')](handleEntityNotFound(_0x2d12a1,null))[_0xe44a('0x24')](saveUpdates(_0x216344[_0xe44a('0x49')],null))['then'](respondWithResult(_0x2d12a1,null))['catch'](handleError(_0x2d12a1,null));};exports['destroy']=function(_0x370347,_0x3843fc){return db['SalesforceConfiguration'][_0xe44a('0x47')]({'where':{'id':_0x370347[_0xe44a('0x44')]['id']}})[_0xe44a('0x24')](handleEntityNotFound(_0x3843fc,null))[_0xe44a('0x24')](removeEntity(_0x3843fc,null))[_0xe44a('0x42')](handleError(_0x3843fc,null));};exports[_0xe44a('0x4a')]=function(_0x1c088d,_0x43c53e,_0x1cd90d){var _0x5dc6ef={};var _0x52a630={};var _0xef56cf;var _0x913c3e;return db['SalesforceConfiguration'][_0xe44a('0x4b')]({'where':{'id':_0x1c088d[_0xe44a('0x44')]['id']}})['then'](handleEntityNotFound(_0x43c53e,null))[_0xe44a('0x24')](function(_0x3233bb){if(_0x3233bb){_0xef56cf=_0x3233bb;_0x52a630[_0xe44a('0x2d')]=_['keys'](db['SalesforceField']['rawAttributes']);_0x52a630[_0xe44a('0x2f')]=_['keys'](_0x1c088d[_0xe44a('0x2f')]);_0x52a630[_0xe44a('0x39')]=_[_0xe44a('0x31')](_0x52a630['model'],_0x52a630[_0xe44a('0x2f')]);_0x5dc6ef[_0xe44a('0x32')]=_['intersection'](_0x52a630[_0xe44a('0x2d')],qs[_0xe44a('0x33')](_0x1c088d['query'][_0xe44a('0x33')]));_0x5dc6ef[_0xe44a('0x32')]=_0x5dc6ef['attributes'][_0xe44a('0x34')]?_0x5dc6ef[_0xe44a('0x32')]:_0x52a630['model'];_0x5dc6ef[_0xe44a('0x4c')]=qs[_0xe44a('0x37')](_0x1c088d[_0xe44a('0x2f')]['sort']);_0x5dc6ef[_0xe44a('0x38')]=qs[_0xe44a('0x39')](_[_0xe44a('0x3a')](_0x1c088d[_0xe44a('0x2f')],_0x52a630[_0xe44a('0x39')]));if(_0x1c088d[_0xe44a('0x2f')]['filter']){_0x5dc6ef[_0xe44a('0x38')]=_[_0xe44a('0x3c')](_0x5dc6ef[_0xe44a('0x38')],{'$or':_['map'](_0x5dc6ef[_0xe44a('0x32')],function(_0x24fbef){var _0x295e5c={};_0x295e5c[_0x24fbef]={'$like':'%'+_0x1c088d['query']['filter']+'%'};return _0x295e5c;})});}_0x5dc6ef=_[_0xe44a('0x3c')]({},_0x5dc6ef,_0x1c088d[_0xe44a('0x46')]);return _0xef56cf[_0xe44a('0x4a')](_0x5dc6ef);}})[_0xe44a('0x24')](function(_0x1895e4){if(_0x1895e4){_0x913c3e=_0x1895e4[_0xe44a('0x34')];if(!_0x1c088d[_0xe44a('0x2f')][_0xe44a('0x35')]('nolimit')){_0x5dc6ef[_0xe44a('0x1f')]=qs[_0xe44a('0x1f')](_0x1c088d[_0xe44a('0x2f')]['limit']);_0x5dc6ef[_0xe44a('0x1e')]=qs[_0xe44a('0x1e')](_0x1c088d['query'][_0xe44a('0x1e')]);}return _0xef56cf[_0xe44a('0x4a')](_0x5dc6ef);}})['then'](function(_0xf2b233){if(_0xf2b233){return _0xf2b233?{'count':_0x913c3e,'rows':_0xf2b233}:null;}})[_0xe44a('0x24')](respondWithResult(_0x43c53e,null))[_0xe44a('0x42')](handleError(_0x43c53e,null));};exports[_0xe44a('0x4d')]=function(_0x11de6a,_0x57740a,_0x2042e7){var _0x4a490f={};var _0x1010b2={};var _0x193ebd;var _0x5753b2;return db[_0xe44a('0x3e')]['findOne']({'where':{'id':_0x11de6a['params']['id']}})[_0xe44a('0x24')](handleEntityNotFound(_0x57740a,null))[_0xe44a('0x24')](function(_0xb89d21){if(_0xb89d21){_0x193ebd=_0xb89d21;_0x1010b2[_0xe44a('0x2d')]=_[_0xe44a('0x30')](db[_0xe44a('0x4e')][_0xe44a('0x2a')]);_0x1010b2[_0xe44a('0x2f')]=_[_0xe44a('0x30')](_0x11de6a[_0xe44a('0x2f')]);_0x1010b2[_0xe44a('0x39')]=_[_0xe44a('0x31')](_0x1010b2[_0xe44a('0x2d')],_0x1010b2[_0xe44a('0x2f')]);_0x4a490f[_0xe44a('0x32')]=_['intersection'](_0x1010b2[_0xe44a('0x2d')],qs[_0xe44a('0x33')](_0x11de6a[_0xe44a('0x2f')][_0xe44a('0x33')]));_0x4a490f[_0xe44a('0x32')]=_0x4a490f[_0xe44a('0x32')][_0xe44a('0x34')]?_0x4a490f[_0xe44a('0x32')]:_0x1010b2[_0xe44a('0x2d')];_0x4a490f[_0xe44a('0x4c')]=qs[_0xe44a('0x37')](_0x11de6a[_0xe44a('0x2f')][_0xe44a('0x37')]);_0x4a490f[_0xe44a('0x38')]=qs['filters'](_['pick'](_0x11de6a[_0xe44a('0x2f')],_0x1010b2[_0xe44a('0x39')]));if(_0x11de6a[_0xe44a('0x2f')][_0xe44a('0x3b')]){_0x4a490f[_0xe44a('0x38')]=_[_0xe44a('0x3c')](_0x4a490f[_0xe44a('0x38')],{'$or':_['map'](_0x4a490f[_0xe44a('0x32')],function(_0x562430){var _0x43351c={};_0x43351c[_0x562430]={'$like':'%'+_0x11de6a[_0xe44a('0x2f')][_0xe44a('0x3b')]+'%'};return _0x43351c;})});}_0x4a490f=_['merge']({},_0x4a490f,_0x11de6a[_0xe44a('0x46')]);return _0x193ebd['getSubjects'](_0x4a490f);}})[_0xe44a('0x24')](function(_0x154c80){if(_0x154c80){_0x5753b2=_0x154c80[_0xe44a('0x34')];if(!_0x11de6a[_0xe44a('0x2f')]['hasOwnProperty'](_0xe44a('0x36'))){_0x4a490f[_0xe44a('0x1f')]=qs[_0xe44a('0x1f')](_0x11de6a[_0xe44a('0x2f')]['limit']);_0x4a490f[_0xe44a('0x1e')]=qs[_0xe44a('0x1e')](_0x11de6a[_0xe44a('0x2f')][_0xe44a('0x1e')]);}return _0x193ebd['getSubjects'](_0x4a490f);}})[_0xe44a('0x24')](function(_0x10f514){if(_0x10f514){return _0x10f514?{'count':_0x5753b2,'rows':_0x10f514}:null;}})[_0xe44a('0x24')](respondWithResult(_0x57740a,null))[_0xe44a('0x42')](handleError(_0x57740a,null));};exports['getDescriptions']=function(_0x2823ef,_0x40fdde,_0x5a43ed){var _0x1eb11e={};var _0x427ca0={};var _0x4caa09;var _0x91f9f3;return db[_0xe44a('0x3e')][_0xe44a('0x4b')]({'where':{'id':_0x2823ef[_0xe44a('0x44')]['id']}})[_0xe44a('0x24')](handleEntityNotFound(_0x40fdde,null))[_0xe44a('0x24')](function(_0x53b293){if(_0x53b293){_0x4caa09=_0x53b293;_0x427ca0['model']=_[_0xe44a('0x30')](db[_0xe44a('0x4e')][_0xe44a('0x2a')]);_0x427ca0['query']=_[_0xe44a('0x30')](_0x2823ef['query']);_0x427ca0[_0xe44a('0x39')]=_[_0xe44a('0x31')](_0x427ca0[_0xe44a('0x2d')],_0x427ca0[_0xe44a('0x2f')]);_0x1eb11e[_0xe44a('0x32')]=_[_0xe44a('0x31')](_0x427ca0[_0xe44a('0x2d')],qs[_0xe44a('0x33')](_0x2823ef[_0xe44a('0x2f')][_0xe44a('0x33')]));_0x1eb11e['attributes']=_0x1eb11e[_0xe44a('0x32')]['length']?_0x1eb11e[_0xe44a('0x32')]:_0x427ca0[_0xe44a('0x2d')];_0x1eb11e[_0xe44a('0x4c')]=qs['sort'](_0x2823ef[_0xe44a('0x2f')]['sort']);_0x1eb11e[_0xe44a('0x38')]=qs[_0xe44a('0x39')](_['pick'](_0x2823ef['query'],_0x427ca0[_0xe44a('0x39')]));if(_0x2823ef[_0xe44a('0x2f')][_0xe44a('0x3b')]){_0x1eb11e[_0xe44a('0x38')]=_[_0xe44a('0x3c')](_0x1eb11e[_0xe44a('0x38')],{'$or':_[_0xe44a('0x2e')](_0x1eb11e['attributes'],function(_0x40893a){var _0x1b117e={};_0x1b117e[_0x40893a]={'$like':'%'+_0x2823ef['query']['filter']+'%'};return _0x1b117e;})});}_0x1eb11e=_[_0xe44a('0x3c')]({},_0x1eb11e,_0x2823ef[_0xe44a('0x46')]);return _0x4caa09[_0xe44a('0x4f')](_0x1eb11e);}})[_0xe44a('0x24')](function(_0x419b33){if(_0x419b33){_0x91f9f3=_0x419b33[_0xe44a('0x34')];if(!_0x2823ef[_0xe44a('0x2f')][_0xe44a('0x35')](_0xe44a('0x36'))){_0x1eb11e[_0xe44a('0x1f')]=qs[_0xe44a('0x1f')](_0x2823ef[_0xe44a('0x2f')]['limit']);_0x1eb11e['offset']=qs['offset'](_0x2823ef['query']['offset']);}return _0x4caa09['getDescriptions'](_0x1eb11e);}})[_0xe44a('0x24')](function(_0x16bbf5){if(_0x16bbf5){return _0x16bbf5?{'count':_0x91f9f3,'rows':_0x16bbf5}:null;}})[_0xe44a('0x24')](respondWithResult(_0x40fdde,null))[_0xe44a('0x42')](handleError(_0x40fdde,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index e6772c7..1c6e79b 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 _0x722d=['./intSalesforceConfiguration.attributes','exports','define','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3b9c1e,_0x404155){var _0xfa2700=function(_0x176464){while(--_0x176464){_0x3b9c1e['push'](_0x3b9c1e['shift']());}};_0xfa2700(++_0x404155);}(_0x722d,0x1ef));var _0xd722=function(_0x378752,_0x158b32){_0x378752=_0x378752-0x0;var _0xd5a262=_0x722d[_0x378752];return _0xd5a262;};'use strict';var _=require(_0xd722('0x0'));var util=require(_0xd722('0x1'));var logger=require('../../config/logger')(_0xd722('0x2'));var moment=require(_0xd722('0x3'));var BPromise=require(_0xd722('0x4'));var rp=require(_0xd722('0x5'));var fs=require('fs');var path=require(_0xd722('0x6'));var rimraf=require(_0xd722('0x7'));var config=require(_0xd722('0x8'));var attributes=require(_0xd722('0x9'));module[_0xd722('0xa')]=function(_0x29e13b,_0x218343){return _0x29e13b[_0xd722('0xb')]('SalesforceConfiguration',attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5fa0=['request-promise','path','../../config/environment','exports','define','SalesforceConfiguration','lodash','util','../../config/logger','api','moment'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x5fa0,0x13a));var _0x05fa=function(_0x482410,_0x31b22d){_0x482410=_0x482410-0x0;var _0x1b69cb=_0x5fa0[_0x482410];return _0x1b69cb;};'use strict';var _=require(_0x05fa('0x0'));var util=require(_0x05fa('0x1'));var logger=require(_0x05fa('0x2'))(_0x05fa('0x3'));var moment=require(_0x05fa('0x4'));var BPromise=require('bluebird');var rp=require(_0x05fa('0x5'));var fs=require('fs');var path=require(_0x05fa('0x6'));var rimraf=require('rimraf');var config=require(_0x05fa('0x7'));var attributes=require('./intSalesforceConfiguration.attributes');module[_0x05fa('0x8')]=function(_0x4fba70,_0x2464bb){return _0x4fba70[_0x05fa('0x9')](_0x05fa('0xa'),attributes,{'tableName':'int_salesforce_configurations','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 84bbe3e..6ff95ee 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 _0x709c=['stringify','error','message','result','catch','moment','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x59cb01,_0x1f010b){var _0x491bb3=function(_0x3f2ea9){while(--_0x3f2ea9){_0x59cb01['push'](_0x59cb01['shift']());}};_0x491bb3(++_0x1f010b);}(_0x709c,0x191));var _0xc709=function(_0x584245,_0x161fa2){_0x584245=_0x584245-0x0;var _0xebb228=_0x709c[_0x584245];return _0xebb228;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc709('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc709('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0xc709('0x2'));var logger=require('../../config/logger')('rpc');var config=require(_0xc709('0x3'));var jayson=require(_0xc709('0x4'));var client=jayson[_0xc709('0x5')][_0xc709('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x533c6b,_0x24933f,_0x2420bc){return new BPromise(function(_0x2c1354,_0x4fa7af){return client[_0xc709('0x7')](_0x533c6b,_0x2420bc)['then'](function(_0x54d490){logger[_0xc709('0x8')](_0xc709('0x9'),_0x24933f,_0xc709('0xa'));logger[_0xc709('0xb')](_0xc709('0xc'),_0x24933f,_0xc709('0xa'),JSON[_0xc709('0xd')](_0x54d490));if(_0x54d490[_0xc709('0xe')]){if(_0x54d490[_0xc709('0xe')]['code']===0x1f4){logger[_0xc709('0xe')]('SalesforceConfiguration,\x20%s,\x20%s',_0x24933f,_0x54d490[_0xc709('0xe')]['message']);return _0x4fa7af(_0x54d490[_0xc709('0xe')][_0xc709('0xf')]);}logger['error'](_0xc709('0x9'),_0x24933f,_0x54d490['error']['message']);return _0x2c1354(_0x54d490['error']['message']);}else{logger[_0xc709('0x8')](_0xc709('0x9'),_0x24933f,'request\x20sent');_0x2c1354(_0x54d490[_0xc709('0x10')][_0xc709('0xf')]);}})[_0xc709('0x11')](function(_0x4154b6){logger[_0xc709('0xe')]('SalesforceConfiguration,\x20%s,\x20%s',_0x24933f,_0x4154b6);_0x4fa7af(_0x4154b6);});});} \ No newline at end of file +var _0xeb6b=['../../config/logger','jayson/promise','client','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x1d4417,_0x438009){var _0x431c12=function(_0x5675c7){while(--_0x5675c7){_0x1d4417['push'](_0x1d4417['shift']());}};_0x431c12(++_0x438009);}(_0xeb6b,0x1b3));var _0xbeb6=function(_0x3da57b,_0x524c57){_0x3da57b=_0x3da57b-0x0;var _0x4bc72e=_0xeb6b[_0x3da57b];return _0x4bc72e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xbeb6('0x0'));var BPromise=require('bluebird');var rs=require(_0xbeb6('0x1'));var fs=require('fs');var Redis=require(_0xbeb6('0x2'));var db=require(_0xbeb6('0x3'))['db'];var utils=require(_0xbeb6('0x4'));var logger=require(_0xbeb6('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbeb6('0x6'));var client=jayson[_0xbeb6('0x7')][_0xbeb6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x387a32,_0x33e0af,_0x293015){return new BPromise(function(_0xb75cf3,_0x5bbd68){return client[_0xbeb6('0x9')](_0x387a32,_0x293015)[_0xbeb6('0xa')](function(_0x49ab6f){logger[_0xbeb6('0xb')](_0xbeb6('0xc'),_0x33e0af,'request\x20sent');logger[_0xbeb6('0xd')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x33e0af,_0xbeb6('0xe'),JSON[_0xbeb6('0xf')](_0x49ab6f));if(_0x49ab6f[_0xbeb6('0x10')]){if(_0x49ab6f[_0xbeb6('0x10')][_0xbeb6('0x11')]===0x1f4){logger[_0xbeb6('0x10')](_0xbeb6('0xc'),_0x33e0af,_0x49ab6f[_0xbeb6('0x10')]['message']);return _0x5bbd68(_0x49ab6f[_0xbeb6('0x10')][_0xbeb6('0x12')]);}logger[_0xbeb6('0x10')](_0xbeb6('0xc'),_0x33e0af,_0x49ab6f[_0xbeb6('0x10')]['message']);return _0xb75cf3(_0x49ab6f['error']['message']);}else{logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x33e0af,_0xbeb6('0xe'));_0xb75cf3(_0x49ab6f[_0xbeb6('0x13')][_0xbeb6('0x12')]);}})['catch'](function(_0x15482b){logger[_0xbeb6('0x10')](_0xbeb6('0xc'),_0x33e0af,_0x15482b);_0x5bbd68(_0x15482b);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index cbc73ea..2d6d3e2 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 _0xa317=['put','update','delete','destroy','multer','util','connect-timeout','express','Router','get','/:id','isAuthenticated','show','post'];(function(_0x442577,_0x57155d){var _0x2645d7=function(_0x17298f){while(--_0x17298f){_0x442577['push'](_0x442577['shift']());}};_0x2645d7(++_0x57155d);}(_0xa317,0x1c4));var _0x7a31=function(_0x51ae6c,_0x362db1){_0x51ae6c=_0x51ae6c-0x0;var _0x2a6f4d=_0xa317[_0x51ae6c];return _0x2a6f4d;};'use strict';var multer=require(_0x7a31('0x0'));var util=require(_0x7a31('0x1'));var path=require('path');var timeout=require(_0x7a31('0x2'));var express=require(_0x7a31('0x3'));var router=express[_0x7a31('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('./intSalesforceField.controller');router[_0x7a31('0x5')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7a31('0x5')](_0x7a31('0x6'),auth[_0x7a31('0x7')](),controller[_0x7a31('0x8')]);router[_0x7a31('0x9')]('/',auth[_0x7a31('0x7')](),controller['create']);router[_0x7a31('0xa')](_0x7a31('0x6'),auth[_0x7a31('0x7')](),controller[_0x7a31('0xb')]);router[_0x7a31('0xc')]('/:id',auth[_0x7a31('0x7')](),controller[_0x7a31('0xd')]);module['exports']=router; \ No newline at end of file +var _0x0a21=['../../config/environment','./intSalesforceField.controller','isAuthenticated','get','show','post','/:id','destroy','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x15b399,_0x59db1a){var _0x199f2d=function(_0x3bd31c){while(--_0x3bd31c){_0x15b399['push'](_0x15b399['shift']());}};_0x199f2d(++_0x59db1a);}(_0x0a21,0x9f));var _0x10a2=function(_0x1c8327,_0x571b10){_0x1c8327=_0x1c8327-0x0;var _0x722323=_0x0a21[_0x1c8327];return _0x722323;};'use strict';var multer=require('multer');var util=require(_0x10a2('0x0'));var path=require('path');var timeout=require(_0x10a2('0x1'));var express=require(_0x10a2('0x2'));var router=express['Router']();var fs_extra=require(_0x10a2('0x3'));var auth=require(_0x10a2('0x4'));var interaction=require(_0x10a2('0x5'));var config=require(_0x10a2('0x6'));var controller=require(_0x10a2('0x7'));router['get']('/',auth[_0x10a2('0x8')](),controller['index']);router[_0x10a2('0x9')]('/:id',auth[_0x10a2('0x8')](),controller[_0x10a2('0xa')]);router[_0x10a2('0xb')]('/',auth[_0x10a2('0x8')](),controller['create']);router['put'](_0x10a2('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x10a2('0xc'),auth[_0x10a2('0x8')](),controller[_0x10a2('0xd')]);module[_0x10a2('0xe')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index d401e5c..8b00e44 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 _0x1836=['sequelize','ENUM','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0x584984,_0x4bb8ba){var _0x2f08e1=function(_0x1ebc6b){while(--_0x1ebc6b){_0x584984['push'](_0x584984['shift']());}};_0x2f08e1(++_0x4bb8ba);}(_0x1836,0x110));var _0x6183=function(_0x4b5daf,_0x598090){_0x4b5daf=_0x4b5daf-0x0;var _0x56f8a7=_0x1836[_0x4b5daf];return _0x56f8a7;};'use strict';var Sequelize=require(_0x6183('0x0'));module['exports']={'type':{'type':Sequelize[_0x6183('0x1')](_0x6183('0x2'),_0x6183('0x3'),_0x6183('0x4'),_0x6183('0x5'),_0x6183('0x6')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x6183('0x2'),_0x6183('0x3'),_0x6183('0x4'))},'keyContent':{'type':Sequelize[_0x6183('0x7')]},'idField':{'type':Sequelize[_0x6183('0x7')]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x17f2=['ENUM','string','customVariable','keyValue','picklist','STRING','variable','sequelize'];(function(_0x47a6ad,_0x179a6f){var _0x3ecf84=function(_0x4e3d4c){while(--_0x4e3d4c){_0x47a6ad['push'](_0x47a6ad['shift']());}};_0x3ecf84(++_0x179a6f);}(_0x17f2,0xf7));var _0x217f=function(_0x259d17,_0x220710){_0x259d17=_0x259d17-0x0;var _0x407535=_0x17f2[_0x259d17];return _0x407535;};'use strict';var Sequelize=require(_0x217f('0x0'));module['exports']={'type':{'type':Sequelize[_0x217f('0x1')](_0x217f('0x2'),'variable',_0x217f('0x3'),_0x217f('0x4'),_0x217f('0x5')),'defaultValue':_0x217f('0x2')},'content':{'type':Sequelize[_0x217f('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x217f('0x1')](_0x217f('0x2'),_0x217f('0x7'),_0x217f('0x3'))},'keyContent':{'type':Sequelize[_0x217f('0x6')]},'idField':{'type':Sequelize[_0x217f('0x6')]},'variableName':{'type':Sequelize[_0x217f('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index efdcae5..1647084 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 _0x414b=['fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','merge','where','VIRTUAL','options','include','findAll','params','includeAll','find','create','body','update','catch','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','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','reject','save','then','destroy','stack','name','index','SalesforceField','rawAttributes'];(function(_0x377cd8,_0x3aaabf){var _0x2685e1=function(_0x33a342){while(--_0x33a342){_0x377cd8['push'](_0x377cd8['shift']());}};_0x2685e1(++_0x3aaabf);}(_0x414b,0xb3));var _0xb414=function(_0x588e09,_0x5e0e6e){_0x588e09=_0x588e09-0x0;var _0x17da19=_0x414b[_0x588e09];return _0x17da19;};'use strict';var emlformat=require(_0xb414('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb414('0x1'));var jsonpatch=require(_0xb414('0x2'));var rp=require(_0xb414('0x3'));var moment=require(_0xb414('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb414('0x5'));var util=require(_0xb414('0x6'));var path=require(_0xb414('0x7'));var sox=require(_0xb414('0x8'));var csv=require(_0xb414('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb414('0xa'));var _=require('lodash');var squel=require(_0xb414('0xb'));var crypto=require(_0xb414('0xc'));var jsforce=require(_0xb414('0xd'));var deskjs=require(_0xb414('0xe'));var toCsv=require(_0xb414('0x9'));var querystring=require(_0xb414('0xf'));var Papa=require(_0xb414('0x10'));var Redis=require(_0xb414('0x11'));var authService=require(_0xb414('0x12'));var qs=require(_0xb414('0x13'));var as=require(_0xb414('0x14'));var hardwareService=require(_0xb414('0x15'));var logger=require(_0xb414('0x16'))(_0xb414('0x17'));var utils=require(_0xb414('0x18'));var config=require(_0xb414('0x19'));var licenseUtil=require(_0xb414('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x12b4a0,_0x3b249a){_0x3b249a=_0x3b249a||0xcc;return function(_0x40de60){if(_0x40de60){return _0x12b4a0[_0xb414('0x1b')](_0x3b249a);}return _0x12b4a0[_0xb414('0x1c')](_0x3b249a)[_0xb414('0x1d')]();};}function respondWithResult(_0x4e8dfb,_0x120fe9){_0x120fe9=_0x120fe9||0xc8;return function(_0x5342bc){if(_0x5342bc){return _0x4e8dfb[_0xb414('0x1c')](_0x120fe9)[_0xb414('0x1e')](_0x5342bc);}};}function respondWithFilteredResult(_0x1344e7,_0x9f78bc){return function(_0x4fa6db){if(_0x4fa6db){var _0x2a8179=typeof _0x9f78bc[_0xb414('0x1f')]===_0xb414('0x20')&&typeof _0x9f78bc[_0xb414('0x21')]===_0xb414('0x20');var _0xea0448=_0x4fa6db['count'];var _0x5922cf=_0x2a8179?0x0:_0x9f78bc[_0xb414('0x1f')];var _0x180125=_0x2a8179?_0x4fa6db[_0xb414('0x22')]:_0x9f78bc['offset']+_0x9f78bc[_0xb414('0x21')];var _0x497c54;if(_0x180125>=_0xea0448){_0x180125=_0xea0448;_0x497c54=0xc8;}else{_0x497c54=0xce;}_0x1344e7[_0xb414('0x1c')](_0x497c54);return _0x1344e7['set'](_0xb414('0x23'),_0x5922cf+'-'+_0x180125+'/'+_0xea0448)[_0xb414('0x1e')](_0x4fa6db);}return null;};}function patchUpdates(_0x5891d5){return function(_0x4298a0){try{jsonpatch[_0xb414('0x24')](_0x4298a0,_0x5891d5,!![]);}catch(_0xc35673){return BPromise[_0xb414('0x25')](_0xc35673);}return _0x4298a0[_0xb414('0x26')]();};}function saveUpdates(_0x18c8f9,_0x4e1503){return function(_0x56af70){if(_0x56af70){return _0x56af70['update'](_0x18c8f9)[_0xb414('0x27')](function(_0x10c080){return _0x10c080;});}return null;};}function removeEntity(_0x52708d,_0x3d491d){return function(_0x340d86){if(_0x340d86){return _0x340d86[_0xb414('0x28')]()[_0xb414('0x27')](function(){_0x52708d[_0xb414('0x1c')](0xcc)[_0xb414('0x1d')]();});}};}function handleEntityNotFound(_0xbce19,_0x412f62){return function(_0x1d52a2){if(!_0x1d52a2){_0xbce19[_0xb414('0x1b')](0x194);}return _0x1d52a2;};}function handleError(_0x358059,_0x2ca0bf){_0x2ca0bf=_0x2ca0bf||0x1f4;return function(_0x4b1874){logger['error'](_0x4b1874[_0xb414('0x29')]);if(_0x4b1874[_0xb414('0x2a')]){delete _0x4b1874['name'];}_0x358059[_0xb414('0x1c')](_0x2ca0bf)['send'](_0x4b1874);};}exports[_0xb414('0x2b')]=function(_0x2ebc21,_0x32f512){var _0x44c0f2={},_0x391dc4={},_0x761baa={'count':0x0,'rows':[]};var _0x469f6b=_['map'](db[_0xb414('0x2c')][_0xb414('0x2d')],function(_0x24b0ce){return{'name':_0x24b0ce[_0xb414('0x2e')],'type':_0x24b0ce[_0xb414('0x2f')]['key']};});_0x391dc4[_0xb414('0x30')]=_[_0xb414('0x31')](_0x469f6b,_0xb414('0x2a'));_0x391dc4[_0xb414('0x32')]=_[_0xb414('0x33')](_0x2ebc21['query']);_0x391dc4[_0xb414('0x34')]=_[_0xb414('0x35')](_0x391dc4[_0xb414('0x30')],_0x391dc4[_0xb414('0x32')]);_0x44c0f2[_0xb414('0x36')]=_['intersection'](_0x391dc4[_0xb414('0x30')],qs[_0xb414('0x37')](_0x2ebc21[_0xb414('0x32')][_0xb414('0x37')]));_0x44c0f2[_0xb414('0x36')]=_0x44c0f2[_0xb414('0x36')][_0xb414('0x38')]?_0x44c0f2[_0xb414('0x36')]:_0x391dc4[_0xb414('0x30')];if(!_0x2ebc21[_0xb414('0x32')][_0xb414('0x39')](_0xb414('0x3a'))){_0x44c0f2[_0xb414('0x21')]=qs[_0xb414('0x21')](_0x2ebc21[_0xb414('0x32')]['limit']);_0x44c0f2[_0xb414('0x1f')]=qs['offset'](_0x2ebc21[_0xb414('0x32')][_0xb414('0x1f')]);}_0x44c0f2['order']=qs[_0xb414('0x3b')](_0x2ebc21[_0xb414('0x32')][_0xb414('0x3b')]);_0x44c0f2['where']=qs[_0xb414('0x34')](_[_0xb414('0x3c')](_0x2ebc21['query'],_0x391dc4['filters']),_0x469f6b);if(_0x2ebc21[_0xb414('0x32')][_0xb414('0x3d')]){_0x44c0f2['where']=_[_0xb414('0x3e')](_0x44c0f2[_0xb414('0x3f')],{'$or':_['map'](_0x469f6b,function(_0x483a80){if(_0x483a80[_0xb414('0x2f')]!==_0xb414('0x40')){var _0x4ec121={};_0x4ec121[_0x483a80[_0xb414('0x2a')]]={'$like':'%'+_0x2ebc21[_0xb414('0x32')][_0xb414('0x3d')]+'%'};return _0x4ec121;}})});}_0x44c0f2=_['merge']({},_0x44c0f2,_0x2ebc21[_0xb414('0x41')]);var _0x4990ff={'where':_0x44c0f2[_0xb414('0x3f')]};return db['SalesforceField'][_0xb414('0x22')](_0x4990ff)[_0xb414('0x27')](function(_0x317f94){_0x761baa[_0xb414('0x22')]=_0x317f94;if(_0x2ebc21[_0xb414('0x32')]['includeAll']){_0x44c0f2[_0xb414('0x42')]=[{'all':!![]}];}return db['SalesforceField'][_0xb414('0x43')](_0x44c0f2);})['then'](function(_0x4972a2){_0x761baa['rows']=_0x4972a2;return _0x761baa;})[_0xb414('0x27')](respondWithFilteredResult(_0x32f512,_0x44c0f2))['catch'](handleError(_0x32f512,null));};exports['show']=function(_0x6f9100,_0x2d430e){var _0xcbf088={'raw':!![],'where':{'id':_0x6f9100[_0xb414('0x44')]['id']}},_0x12bc98={};_0x12bc98['model']=_[_0xb414('0x33')](db[_0xb414('0x2c')][_0xb414('0x2d')]);_0x12bc98[_0xb414('0x32')]=_['keys'](_0x6f9100['query']);_0x12bc98[_0xb414('0x34')]=_[_0xb414('0x35')](_0x12bc98['model'],_0x12bc98[_0xb414('0x32')]);_0xcbf088[_0xb414('0x36')]=_[_0xb414('0x35')](_0x12bc98[_0xb414('0x30')],qs[_0xb414('0x37')](_0x6f9100['query']['fields']));_0xcbf088[_0xb414('0x36')]=_0xcbf088[_0xb414('0x36')][_0xb414('0x38')]?_0xcbf088[_0xb414('0x36')]:_0x12bc98[_0xb414('0x30')];if(_0x6f9100[_0xb414('0x32')][_0xb414('0x45')]){_0xcbf088[_0xb414('0x42')]=[{'all':!![]}];}_0xcbf088=_[_0xb414('0x3e')]({},_0xcbf088,_0x6f9100['options']);return db[_0xb414('0x2c')][_0xb414('0x46')](_0xcbf088)[_0xb414('0x27')](handleEntityNotFound(_0x2d430e,null))[_0xb414('0x27')](respondWithResult(_0x2d430e,null))['catch'](handleError(_0x2d430e,null));};exports[_0xb414('0x47')]=function(_0x446706,_0x2c9a84){return db[_0xb414('0x2c')][_0xb414('0x47')](_0x446706[_0xb414('0x48')],{})[_0xb414('0x27')](respondWithResult(_0x2c9a84,0xc9))['catch'](handleError(_0x2c9a84,null));};exports[_0xb414('0x49')]=function(_0x427295,_0x339876){if(_0x427295[_0xb414('0x48')]['id']){delete _0x427295[_0xb414('0x48')]['id'];}return db[_0xb414('0x2c')][_0xb414('0x46')]({'where':{'id':_0x427295['params']['id']}})['then'](handleEntityNotFound(_0x339876,null))[_0xb414('0x27')](saveUpdates(_0x427295[_0xb414('0x48')],null))[_0xb414('0x27')](respondWithResult(_0x339876,null))[_0xb414('0x4a')](handleError(_0x339876,null));};exports[_0xb414('0x28')]=function(_0x1967d,_0x391bd0){return db[_0xb414('0x2c')]['find']({'where':{'id':_0x1967d[_0xb414('0x44')]['id']}})[_0xb414('0x27')](handleEntityNotFound(_0x391bd0,null))[_0xb414('0x27')](removeEntity(_0x391bd0,null))[_0xb414('0x4a')](handleError(_0x391bd0,null));}; \ No newline at end of file +var _0x542e=['json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','map','SalesforceField','rawAttributes','fieldName','type','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','params','include','find','body','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x542e,0x75));var _0xe542=function(_0x2a1eb8,_0x3049b4){_0x2a1eb8=_0x2a1eb8-0x0;var _0x5d216f=_0x542e[_0x2a1eb8];return _0x5d216f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe542('0x0'));var zipdir=require(_0xe542('0x1'));var jsonpatch=require(_0xe542('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe542('0x3'));var Mustache=require(_0xe542('0x4'));var util=require('util');var path=require(_0xe542('0x5'));var sox=require(_0xe542('0x6'));var csv=require(_0xe542('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe542('0x8'));var crypto=require(_0xe542('0x9'));var jsforce=require(_0xe542('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xe542('0x7'));var querystring=require('querystring');var Papa=require(_0xe542('0xb'));var Redis=require(_0xe542('0xc'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe542('0xd'));var hardwareService=require(_0xe542('0xe'));var logger=require(_0xe542('0xf'))(_0xe542('0x10'));var utils=require(_0xe542('0x11'));var config=require(_0xe542('0x12'));var licenseUtil=require(_0xe542('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x170c0e,_0x1e49a7){_0x1e49a7=_0x1e49a7||0xcc;return function(_0x4c2bd0){if(_0x4c2bd0){return _0x170c0e[_0xe542('0x14')](_0x1e49a7);}return _0x170c0e[_0xe542('0x15')](_0x1e49a7)[_0xe542('0x16')]();};}function respondWithResult(_0x41ed10,_0x2fa5e0){_0x2fa5e0=_0x2fa5e0||0xc8;return function(_0x4c2b6a){if(_0x4c2b6a){return _0x41ed10['status'](_0x2fa5e0)[_0xe542('0x17')](_0x4c2b6a);}};}function respondWithFilteredResult(_0x3b506d,_0x1e799e){return function(_0xf531ff){if(_0xf531ff){var _0xc7019c=typeof _0x1e799e[_0xe542('0x18')]===_0xe542('0x19')&&typeof _0x1e799e['limit']===_0xe542('0x19');var _0x5af346=_0xf531ff[_0xe542('0x1a')];var _0x27bbc3=_0xc7019c?0x0:_0x1e799e[_0xe542('0x18')];var _0x2add71=_0xc7019c?_0xf531ff['count']:_0x1e799e['offset']+_0x1e799e[_0xe542('0x1b')];var _0x3274eb;if(_0x2add71>=_0x5af346){_0x2add71=_0x5af346;_0x3274eb=0xc8;}else{_0x3274eb=0xce;}_0x3b506d[_0xe542('0x15')](_0x3274eb);return _0x3b506d[_0xe542('0x1c')](_0xe542('0x1d'),_0x27bbc3+'-'+_0x2add71+'/'+_0x5af346)[_0xe542('0x17')](_0xf531ff);}return null;};}function patchUpdates(_0x36b5c4){return function(_0x3d0ad4){try{jsonpatch[_0xe542('0x1e')](_0x3d0ad4,_0x36b5c4,!![]);}catch(_0x23a32a){return BPromise[_0xe542('0x1f')](_0x23a32a);}return _0x3d0ad4[_0xe542('0x20')]();};}function saveUpdates(_0x3426f9,_0x54eaa2){return function(_0x511b74){if(_0x511b74){return _0x511b74[_0xe542('0x21')](_0x3426f9)['then'](function(_0x4367cc){return _0x4367cc;});}return null;};}function removeEntity(_0x388480,_0x554f63){return function(_0x2c95cc){if(_0x2c95cc){return _0x2c95cc[_0xe542('0x22')]()[_0xe542('0x23')](function(){_0x388480[_0xe542('0x15')](0xcc)[_0xe542('0x16')]();});}};}function handleEntityNotFound(_0x34592a,_0x2539f1){return function(_0x137c43){if(!_0x137c43){_0x34592a[_0xe542('0x14')](0x194);}return _0x137c43;};}function handleError(_0x5e99f3,_0x2d8b40){_0x2d8b40=_0x2d8b40||0x1f4;return function(_0x588758){logger[_0xe542('0x24')](_0x588758[_0xe542('0x25')]);if(_0x588758[_0xe542('0x26')]){delete _0x588758[_0xe542('0x26')];}_0x5e99f3[_0xe542('0x15')](_0x2d8b40)[_0xe542('0x27')](_0x588758);};}exports['index']=function(_0xc650bd,_0x946dab){var _0x4977c7={},_0x210072={},_0x488f03={'count':0x0,'rows':[]};var _0x1e035b=_[_0xe542('0x28')](db[_0xe542('0x29')][_0xe542('0x2a')],function(_0xb80e8b){return{'name':_0xb80e8b[_0xe542('0x2b')],'type':_0xb80e8b[_0xe542('0x2c')]['key']};});_0x210072['model']=_[_0xe542('0x28')](_0x1e035b,_0xe542('0x26'));_0x210072['query']=_[_0xe542('0x2d')](_0xc650bd[_0xe542('0x2e')]);_0x210072[_0xe542('0x2f')]=_[_0xe542('0x30')](_0x210072[_0xe542('0x31')],_0x210072[_0xe542('0x2e')]);_0x4977c7[_0xe542('0x32')]=_['intersection'](_0x210072[_0xe542('0x31')],qs['fields'](_0xc650bd[_0xe542('0x2e')][_0xe542('0x33')]));_0x4977c7['attributes']=_0x4977c7[_0xe542('0x32')][_0xe542('0x34')]?_0x4977c7[_0xe542('0x32')]:_0x210072[_0xe542('0x31')];if(!_0xc650bd[_0xe542('0x2e')][_0xe542('0x35')](_0xe542('0x36'))){_0x4977c7[_0xe542('0x1b')]=qs[_0xe542('0x1b')](_0xc650bd[_0xe542('0x2e')][_0xe542('0x1b')]);_0x4977c7[_0xe542('0x18')]=qs[_0xe542('0x18')](_0xc650bd[_0xe542('0x2e')][_0xe542('0x18')]);}_0x4977c7[_0xe542('0x37')]=qs[_0xe542('0x38')](_0xc650bd[_0xe542('0x2e')][_0xe542('0x38')]);_0x4977c7[_0xe542('0x39')]=qs[_0xe542('0x2f')](_['pick'](_0xc650bd[_0xe542('0x2e')],_0x210072[_0xe542('0x2f')]),_0x1e035b);if(_0xc650bd[_0xe542('0x2e')][_0xe542('0x3a')]){_0x4977c7['where']=_['merge'](_0x4977c7[_0xe542('0x39')],{'$or':_[_0xe542('0x28')](_0x1e035b,function(_0x4484c6){if(_0x4484c6[_0xe542('0x2c')]!==_0xe542('0x3b')){var _0x4e9a05={};_0x4e9a05[_0x4484c6[_0xe542('0x26')]]={'$like':'%'+_0xc650bd[_0xe542('0x2e')][_0xe542('0x3a')]+'%'};return _0x4e9a05;}})});}_0x4977c7=_[_0xe542('0x3c')]({},_0x4977c7,_0xc650bd[_0xe542('0x3d')]);var _0x1a3dfa={'where':_0x4977c7['where']};return db[_0xe542('0x29')][_0xe542('0x1a')](_0x1a3dfa)['then'](function(_0xd8e024){_0x488f03[_0xe542('0x1a')]=_0xd8e024;if(_0xc650bd[_0xe542('0x2e')][_0xe542('0x3e')]){_0x4977c7['include']=[{'all':!![]}];}return db[_0xe542('0x29')][_0xe542('0x3f')](_0x4977c7);})[_0xe542('0x23')](function(_0x480449){_0x488f03[_0xe542('0x40')]=_0x480449;return _0x488f03;})[_0xe542('0x23')](respondWithFilteredResult(_0x946dab,_0x4977c7))[_0xe542('0x41')](handleError(_0x946dab,null));};exports['show']=function(_0x48347d,_0x676029){var _0x468e73={'raw':!![],'where':{'id':_0x48347d[_0xe542('0x42')]['id']}},_0x4a3d66={};_0x4a3d66[_0xe542('0x31')]=_[_0xe542('0x2d')](db[_0xe542('0x29')][_0xe542('0x2a')]);_0x4a3d66['query']=_['keys'](_0x48347d[_0xe542('0x2e')]);_0x4a3d66[_0xe542('0x2f')]=_[_0xe542('0x30')](_0x4a3d66[_0xe542('0x31')],_0x4a3d66['query']);_0x468e73[_0xe542('0x32')]=_[_0xe542('0x30')](_0x4a3d66[_0xe542('0x31')],qs[_0xe542('0x33')](_0x48347d[_0xe542('0x2e')][_0xe542('0x33')]));_0x468e73[_0xe542('0x32')]=_0x468e73['attributes'][_0xe542('0x34')]?_0x468e73['attributes']:_0x4a3d66[_0xe542('0x31')];if(_0x48347d[_0xe542('0x2e')][_0xe542('0x3e')]){_0x468e73[_0xe542('0x43')]=[{'all':!![]}];}_0x468e73=_[_0xe542('0x3c')]({},_0x468e73,_0x48347d[_0xe542('0x3d')]);return db[_0xe542('0x29')][_0xe542('0x44')](_0x468e73)[_0xe542('0x23')](handleEntityNotFound(_0x676029,null))[_0xe542('0x23')](respondWithResult(_0x676029,null))[_0xe542('0x41')](handleError(_0x676029,null));};exports['create']=function(_0x10d9ec,_0x53184a){return db[_0xe542('0x29')]['create'](_0x10d9ec[_0xe542('0x45')],{})['then'](respondWithResult(_0x53184a,0xc9))['catch'](handleError(_0x53184a,null));};exports['update']=function(_0x1f72ee,_0x3f93d7){if(_0x1f72ee[_0xe542('0x45')]['id']){delete _0x1f72ee[_0xe542('0x45')]['id'];}return db[_0xe542('0x29')][_0xe542('0x44')]({'where':{'id':_0x1f72ee['params']['id']}})[_0xe542('0x23')](handleEntityNotFound(_0x3f93d7,null))[_0xe542('0x23')](saveUpdates(_0x1f72ee['body'],null))[_0xe542('0x23')](respondWithResult(_0x3f93d7,null))['catch'](handleError(_0x3f93d7,null));};exports[_0xe542('0x22')]=function(_0x359e70,_0x1c794d){return db[_0xe542('0x29')][_0xe542('0x44')]({'where':{'id':_0x359e70[_0xe542('0x42')]['id']}})['then'](handleEntityNotFound(_0x1c794d,null))['then'](removeEntity(_0x1c794d,null))[_0xe542('0x41')](handleError(_0x1c794d,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 38129d1..91c5f0a 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 _0x2ae9=['salesforce_unique_index','FieldId','lodash','util','../../config/logger','api','../../config/environment','./intSalesforceField.attributes','exports','SalesforceField','int_salesforce_fields'];(function(_0x5f0501,_0x19196e){var _0x3c2c45=function(_0x107fe6){while(--_0x107fe6){_0x5f0501['push'](_0x5f0501['shift']());}};_0x3c2c45(++_0x19196e);}(_0x2ae9,0x86));var _0x92ae=function(_0x5bbb86,_0x31386a){_0x5bbb86=_0x5bbb86-0x0;var _0x41f61d=_0x2ae9[_0x5bbb86];return _0x41f61d;};'use strict';var _=require(_0x92ae('0x0'));var util=require(_0x92ae('0x1'));var logger=require(_0x92ae('0x2'))(_0x92ae('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(_0x92ae('0x4'));var attributes=require(_0x92ae('0x5'));module[_0x92ae('0x6')]=function(_0x209770,_0x20291c){return _0x209770['define'](_0x92ae('0x7'),attributes,{'tableName':_0x92ae('0x8'),'paranoid':![],'indexes':[{'name':_0x92ae('0x9'),'fields':['idField',_0x92ae('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1e33=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intSalesforceField.attributes','exports','int_salesforce_fields','salesforce_unique_index','idField','FieldId'];(function(_0x491f5a,_0x4db6fb){var _0x18fb4c=function(_0x12d151){while(--_0x12d151){_0x491f5a['push'](_0x491f5a['shift']());}};_0x18fb4c(++_0x4db6fb);}(_0x1e33,0x1dc));var _0x31e3=function(_0x7d0c45,_0x126459){_0x7d0c45=_0x7d0c45-0x0;var _0x494836=_0x1e33[_0x7d0c45];return _0x494836;};'use strict';var _=require(_0x31e3('0x0'));var util=require('util');var logger=require(_0x31e3('0x1'))(_0x31e3('0x2'));var moment=require(_0x31e3('0x3'));var BPromise=require(_0x31e3('0x4'));var rp=require(_0x31e3('0x5'));var fs=require('fs');var path=require(_0x31e3('0x6'));var rimraf=require('rimraf');var config=require(_0x31e3('0x7'));var attributes=require(_0x31e3('0x8'));module[_0x31e3('0x9')]=function(_0x26add0,_0x2fbe47){return _0x26add0['define']('SalesforceField',attributes,{'tableName':_0x31e3('0xa'),'paranoid':![],'indexes':[{'name':_0x31e3('0xb'),'fields':[_0x31e3('0xc'),_0x31e3('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index 8c6befc..ce1bf1b 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 _0x1fe0=['error','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','code'];(function(_0x25963d,_0x236466){var _0x29b6a2=function(_0x428212){while(--_0x428212){_0x25963d['push'](_0x25963d['shift']());}};_0x29b6a2(++_0x236466);}(_0x1fe0,0xcd));var _0x01fe=function(_0x220f3f,_0x11c540){_0x220f3f=_0x220f3f-0x0;var _0x1f170e=_0x1fe0[_0x220f3f];return _0x1f170e;};'use strict';var _=require(_0x01fe('0x0'));var util=require(_0x01fe('0x1'));var moment=require('moment');var BPromise=require(_0x01fe('0x2'));var rs=require(_0x01fe('0x3'));var fs=require('fs');var Redis=require(_0x01fe('0x4'));var db=require(_0x01fe('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x01fe('0x6'))(_0x01fe('0x7'));var config=require(_0x01fe('0x8'));var jayson=require(_0x01fe('0x9'));var client=jayson[_0x01fe('0xa')][_0x01fe('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x258709,_0x559aaa,_0x1caba3){return new BPromise(function(_0x43c4fd,_0x4c147d){return client[_0x01fe('0xc')](_0x258709,_0x1caba3)[_0x01fe('0xd')](function(_0x1b8ca3){logger['info'](_0x01fe('0xe'),_0x559aaa,_0x01fe('0xf'));logger[_0x01fe('0x10')](_0x01fe('0x11'),_0x559aaa,_0x01fe('0xf'),JSON[_0x01fe('0x12')](_0x1b8ca3));if(_0x1b8ca3['error']){if(_0x1b8ca3['error'][_0x01fe('0x13')]===0x1f4){logger['error'](_0x01fe('0xe'),_0x559aaa,_0x1b8ca3[_0x01fe('0x14')][_0x01fe('0x15')]);return _0x4c147d(_0x1b8ca3[_0x01fe('0x14')][_0x01fe('0x15')]);}logger[_0x01fe('0x14')](_0x01fe('0xe'),_0x559aaa,_0x1b8ca3[_0x01fe('0x14')][_0x01fe('0x15')]);return _0x43c4fd(_0x1b8ca3[_0x01fe('0x14')]['message']);}else{logger[_0x01fe('0x16')](_0x01fe('0xe'),_0x559aaa,_0x01fe('0xf'));_0x43c4fd(_0x1b8ca3[_0x01fe('0x17')][_0x01fe('0x15')]);}})[_0x01fe('0x18')](function(_0x50c7f2){logger[_0x01fe('0x14')]('SalesforceField,\x20%s,\x20%s',_0x559aaa,_0x50c7f2);_0x4c147d(_0x50c7f2);});});} \ No newline at end of file +var _0x71b4=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x1aef65,_0x521e60){var _0x4a4594=function(_0x120020){while(--_0x120020){_0x1aef65['push'](_0x1aef65['shift']());}};_0x4a4594(++_0x521e60);}(_0x71b4,0xff));var _0x471b=function(_0x5d91b5,_0x2cf4d2){_0x5d91b5=_0x5d91b5-0x0;var _0x3f7769=_0x71b4[_0x5d91b5];return _0x3f7769;};'use strict';var _=require(_0x471b('0x0'));var util=require('util');var moment=require(_0x471b('0x1'));var BPromise=require(_0x471b('0x2'));var rs=require(_0x471b('0x3'));var fs=require('fs');var Redis=require(_0x471b('0x4'));var db=require(_0x471b('0x5'))['db'];var utils=require(_0x471b('0x6'));var logger=require(_0x471b('0x7'))(_0x471b('0x8'));var config=require(_0x471b('0x9'));var jayson=require(_0x471b('0xa'));var client=jayson[_0x471b('0xb')][_0x471b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xb8967,_0x154173,_0x21db03){return new BPromise(function(_0x198559,_0x2b9f31){return client['request'](_0xb8967,_0x21db03)['then'](function(_0x5f4966){logger[_0x471b('0xd')](_0x471b('0xe'),_0x154173,_0x471b('0xf'));logger[_0x471b('0x10')](_0x471b('0x11'),_0x154173,_0x471b('0xf'),JSON['stringify'](_0x5f4966));if(_0x5f4966[_0x471b('0x12')]){if(_0x5f4966[_0x471b('0x12')][_0x471b('0x13')]===0x1f4){logger[_0x471b('0x12')](_0x471b('0xe'),_0x154173,_0x5f4966[_0x471b('0x12')][_0x471b('0x14')]);return _0x2b9f31(_0x5f4966['error'][_0x471b('0x14')]);}logger[_0x471b('0x12')](_0x471b('0xe'),_0x154173,_0x5f4966[_0x471b('0x12')][_0x471b('0x14')]);return _0x198559(_0x5f4966['error'][_0x471b('0x14')]);}else{logger[_0x471b('0xd')](_0x471b('0xe'),_0x154173,'request\x20sent');_0x198559(_0x5f4966[_0x471b('0x15')][_0x471b('0x14')]);}})[_0x471b('0x16')](function(_0x36b65f){logger[_0x471b('0x12')](_0x471b('0xe'),_0x154173,_0x36b65f);_0x2b9f31(_0x36b65f);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 3279ff8..4eef467 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 _0xf69b=['../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','post','create','addConfiguration','put','util','connect-timeout','Router','fs-extra'];(function(_0x3cba93,_0x5c2fd8){var _0x4a2991=function(_0x3cf95b){while(--_0x3cf95b){_0x3cba93['push'](_0x3cba93['shift']());}};_0x4a2991(++_0x5c2fd8);}(_0xf69b,0xc8));var _0xbf69=function(_0x1b4275,_0x57c794){_0x1b4275=_0x1b4275-0x0;var _0xfcb95c=_0xf69b[_0x1b4275];return _0xfcb95c;};'use strict';var multer=require('multer');var util=require(_0xbf69('0x0'));var path=require('path');var timeout=require(_0xbf69('0x1'));var express=require('express');var router=express[_0xbf69('0x2')]();var fs_extra=require(_0xbf69('0x3'));var auth=require(_0xbf69('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xbf69('0x5'));var controller=require('./intServicenowAccount.controller');router[_0xbf69('0x6')]('/',auth[_0xbf69('0x7')](),controller[_0xbf69('0x8')]);router[_0xbf69('0x6')](_0xbf69('0x9'),auth[_0xbf69('0x7')](),controller[_0xbf69('0xa')]);router[_0xbf69('0x6')](_0xbf69('0xb'),auth[_0xbf69('0x7')](),controller['getConfigurations']);router[_0xbf69('0x6')](_0xbf69('0xc'),auth[_0xbf69('0x7')](),controller['getFields']);router[_0xbf69('0xd')]('/',auth[_0xbf69('0x7')](),controller[_0xbf69('0xe')]);router[_0xbf69('0xd')]('/:id/configurations',auth[_0xbf69('0x7')](),controller[_0xbf69('0xf')]);router[_0xbf69('0x10')](_0xbf69('0x9'),auth[_0xbf69('0x7')](),controller['update']);router['delete'](_0xbf69('0x9'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x8b19=['express','fs-extra','../../components/auth/service','../../config/environment','./intServicenowAccount.controller','get','index','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put','delete','/:id','destroy','exports','path'];(function(_0x5a6ba2,_0x2983ec){var _0x5697d4=function(_0x15170f){while(--_0x15170f){_0x5a6ba2['push'](_0x5a6ba2['shift']());}};_0x5697d4(++_0x2983ec);}(_0x8b19,0x1a1));var _0x98b1=function(_0x112bf4,_0x42e386){_0x112bf4=_0x112bf4-0x0;var _0x9dcc3d=_0x8b19[_0x112bf4];return _0x9dcc3d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x98b1('0x0'));var timeout=require('connect-timeout');var express=require(_0x98b1('0x1'));var router=express['Router']();var fs_extra=require(_0x98b1('0x2'));var auth=require(_0x98b1('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x98b1('0x4'));var controller=require(_0x98b1('0x5'));router[_0x98b1('0x6')]('/',auth['isAuthenticated'](),controller[_0x98b1('0x7')]);router[_0x98b1('0x6')]('/:id',auth[_0x98b1('0x8')](),controller[_0x98b1('0x9')]);router[_0x98b1('0x6')](_0x98b1('0xa'),auth[_0x98b1('0x8')](),controller[_0x98b1('0xb')]);router[_0x98b1('0x6')](_0x98b1('0xc'),auth[_0x98b1('0x8')](),controller[_0x98b1('0xd')]);router['post']('/',auth[_0x98b1('0x8')](),controller[_0x98b1('0xe')]);router[_0x98b1('0xf')]('/:id/configurations',auth[_0x98b1('0x8')](),controller[_0x98b1('0x10')]);router[_0x98b1('0x11')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x98b1('0x12')](_0x98b1('0x13'),auth[_0x98b1('0x8')](),controller[_0x98b1('0x14')]);module[_0x98b1('0x15')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 22b74f7..cadc7b8 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 _0x5aed=['exports','STRING','username','remoteUri'];(function(_0x1fcd83,_0x54f955){var _0x633a49=function(_0x3c5438){while(--_0x3c5438){_0x1fcd83['push'](_0x1fcd83['shift']());}};_0x633a49(++_0x54f955);}(_0x5aed,0x1e0));var _0xd5ae=function(_0x30988d,_0x215a7f){_0x30988d=_0x30988d-0x0;var _0x4c9e96=_0x5aed[_0x30988d];return _0x4c9e96;};'use strict';var Sequelize=require('sequelize');module[_0xd5ae('0x0')]={'name':{'type':Sequelize[_0xd5ae('0x1')]},'description':{'type':Sequelize[_0xd5ae('0x1')]},'username':{'type':Sequelize[_0xd5ae('0x1')],'unique':_0xd5ae('0x2')},'password':{'type':Sequelize[_0xd5ae('0x1')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xd5ae('0x1')],'unique':_0xd5ae('0x3')},'serverUrl':{'type':Sequelize[_0xd5ae('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x226b=['STRING','username','remoteUri','exports'];(function(_0x5f098a,_0x1d8742){var _0x341f1d=function(_0x44ec39){while(--_0x44ec39){_0x5f098a['push'](_0x5f098a['shift']());}};_0x341f1d(++_0x1d8742);}(_0x226b,0x83));var _0xb226=function(_0x4091a0,_0x3980d0){_0x4091a0=_0x4091a0-0x0;var _0x5514f9=_0x226b[_0x4091a0];return _0x5514f9;};'use strict';var Sequelize=require('sequelize');module[_0xb226('0x0')]={'name':{'type':Sequelize[_0xb226('0x1')]},'description':{'type':Sequelize[_0xb226('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0xb226('0x2')},'password':{'type':Sequelize[_0xb226('0x1')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xb226('0x1')],'unique':_0xb226('0x3')},'serverUrl':{'type':Sequelize[_0xb226('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index acf88b1..eeae801 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 _0x1f57=['%s/api/now/table/','GET','result','log','incident\x20table\x20objects','remove','forEach','label','push','assign','includes','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','internalType','all','concat','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','True','False','false','inactive','value','eml-format','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','fs-extra','lodash','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','ServicenowAccount','rawAttributes','type','key','map','keys','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','where','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','merge','find','create','body','params','getConfigurations','findOne','ServicenowConfiguration','order','sort','pick','nolimit','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','channel','ServicenowField','getFields','made_sla','hold_reason','knowledge','subcategory','notify','severity','category','parent','caused_by','watch_list','upon_reject','sys_updated_on','approval_history','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','sys_created_by','calendar_stc','closed_at','cmdb_ci','impact','active','work_notes_list','business_service','priority','sys_domain_path','time_worked','expected_start','opened_at','business_duration','group_list','reopened_time','caller_id','work_notes','short_description','close_code','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','close_notes','follow_up','parent_incident','reopened_by','incident_state','urgency','problem_id','company','activity_due','assigned_to','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','upon_approval','correlation_id','location','username','password','remoteUri','serverUrl','slice','lastIndexOf','%s/api/now/doc/table/schema/'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1f57,0xce));var _0x71f5=function(_0x2c7c52,_0x4740cb){_0x2c7c52=_0x2c7c52-0x0;var _0x55d2ea=_0x1f57[_0x2c7c52];return _0x55d2ea;};'use strict';var emlformat=require(_0x71f5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x71f5('0x1'));var jsonpatch=require(_0x71f5('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x71f5('0x3'));var Mustache=require('mustache');var util=require(_0x71f5('0x4'));var path=require(_0x71f5('0x5'));var sox=require(_0x71f5('0x6'));var csv=require(_0x71f5('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x71f5('0x8'));var _=require(_0x71f5('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x71f5('0xa'));var Papa=require(_0x71f5('0xb'));var Redis=require(_0x71f5('0xc'));var authService=require(_0x71f5('0xd'));var qs=require(_0x71f5('0xe'));var as=require(_0x71f5('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x71f5('0x10'))(_0x71f5('0x11'));var utils=require('../../config/utils');var config=require(_0x71f5('0x12'));var licenseUtil=require(_0x71f5('0x13'));var db=require(_0x71f5('0x14'))['db'];var integrations=require(_0x71f5('0x15'));function respondWithStatusCode(_0x4e1893,_0x200463){_0x200463=_0x200463||0xcc;return function(_0x3e0479){if(_0x3e0479){return _0x4e1893[_0x71f5('0x16')](_0x200463);}return _0x4e1893[_0x71f5('0x17')](_0x200463)[_0x71f5('0x18')]();};}function respondWithResult(_0x499812,_0x18b69f){_0x18b69f=_0x18b69f||0xc8;return function(_0x5ee2d8){if(_0x5ee2d8){return _0x499812[_0x71f5('0x17')](_0x18b69f)[_0x71f5('0x19')](_0x5ee2d8);}};}function respondWithFilteredResult(_0x41982f,_0x519bc4){return function(_0x3256ce){if(_0x3256ce){var _0x3564e0=typeof _0x519bc4[_0x71f5('0x1a')]===_0x71f5('0x1b')&&typeof _0x519bc4[_0x71f5('0x1c')]==='undefined';var _0x474aa5=_0x3256ce['count'];var _0x179e8c=_0x3564e0?0x0:_0x519bc4[_0x71f5('0x1a')];var _0x3d4465=_0x3564e0?_0x3256ce[_0x71f5('0x1d')]:_0x519bc4[_0x71f5('0x1a')]+_0x519bc4[_0x71f5('0x1c')];var _0x29a06f;if(_0x3d4465>=_0x474aa5){_0x3d4465=_0x474aa5;_0x29a06f=0xc8;}else{_0x29a06f=0xce;}_0x41982f[_0x71f5('0x17')](_0x29a06f);return _0x41982f[_0x71f5('0x1e')](_0x71f5('0x1f'),_0x179e8c+'-'+_0x3d4465+'/'+_0x474aa5)[_0x71f5('0x19')](_0x3256ce);}return null;};}function patchUpdates(_0x463800){return function(_0x40da0a){try{jsonpatch[_0x71f5('0x20')](_0x40da0a,_0x463800,!![]);}catch(_0x25d836){return BPromise[_0x71f5('0x21')](_0x25d836);}return _0x40da0a[_0x71f5('0x22')]();};}function saveUpdates(_0x4c90f1,_0x3b6b13){return function(_0xb86e44){if(_0xb86e44){return _0xb86e44[_0x71f5('0x23')](_0x4c90f1)[_0x71f5('0x24')](function(_0x20bccf){return _0x20bccf;});}return null;};}function removeEntity(_0x11c362,_0x2acbef){return function(_0x140544){if(_0x140544){return _0x140544[_0x71f5('0x25')]()['then'](function(){_0x11c362[_0x71f5('0x17')](0xcc)[_0x71f5('0x18')]();});}};}function handleEntityNotFound(_0x451955,_0x3c8717){return function(_0x5772a5){if(!_0x5772a5){_0x451955[_0x71f5('0x16')](0x194);}return _0x5772a5;};}function handleError(_0x88017f,_0x3adb47){_0x3adb47=_0x3adb47||0x1f4;return function(_0xf6d1e){logger[_0x71f5('0x26')](_0xf6d1e[_0x71f5('0x27')]);if(_0xf6d1e[_0x71f5('0x28')]){delete _0xf6d1e[_0x71f5('0x28')];}_0x88017f[_0x71f5('0x17')](_0x3adb47)[_0x71f5('0x29')](_0xf6d1e);};}exports[_0x71f5('0x2a')]=function(_0x4cc81b,_0x20def6){var _0x1ecf54={},_0x2deb0d={},_0x41286e={'count':0x0,'rows':[]};var _0x5355f7=_['map'](db[_0x71f5('0x2b')][_0x71f5('0x2c')],function(_0x39f5c1){return{'name':_0x39f5c1['fieldName'],'type':_0x39f5c1[_0x71f5('0x2d')][_0x71f5('0x2e')]};});_0x2deb0d['model']=_[_0x71f5('0x2f')](_0x5355f7,_0x71f5('0x28'));_0x2deb0d['query']=_[_0x71f5('0x30')](_0x4cc81b['query']);_0x2deb0d[_0x71f5('0x31')]=_[_0x71f5('0x32')](_0x2deb0d[_0x71f5('0x33')],_0x2deb0d[_0x71f5('0x34')]);_0x1ecf54[_0x71f5('0x35')]=_[_0x71f5('0x32')](_0x2deb0d[_0x71f5('0x33')],qs[_0x71f5('0x36')](_0x4cc81b[_0x71f5('0x34')][_0x71f5('0x36')]));_0x1ecf54['attributes']=_0x1ecf54[_0x71f5('0x35')][_0x71f5('0x37')]?_0x1ecf54[_0x71f5('0x35')]:_0x2deb0d[_0x71f5('0x33')];if(!_0x4cc81b[_0x71f5('0x34')][_0x71f5('0x38')]('nolimit')){_0x1ecf54['limit']=qs[_0x71f5('0x1c')](_0x4cc81b[_0x71f5('0x34')][_0x71f5('0x1c')]);_0x1ecf54[_0x71f5('0x1a')]=qs[_0x71f5('0x1a')](_0x4cc81b[_0x71f5('0x34')]['offset']);}_0x1ecf54['order']=qs['sort'](_0x4cc81b['query']['sort']);_0x1ecf54[_0x71f5('0x39')]=qs['filters'](_['pick'](_0x4cc81b['query'],_0x2deb0d['filters']),_0x5355f7);if(_0x4cc81b[_0x71f5('0x34')][_0x71f5('0x3a')]){_0x1ecf54[_0x71f5('0x39')]=_['merge'](_0x1ecf54[_0x71f5('0x39')],{'$or':_[_0x71f5('0x2f')](_0x5355f7,function(_0x308c34){if(_0x308c34[_0x71f5('0x2d')]!==_0x71f5('0x3b')){var _0x3e2869={};_0x3e2869[_0x308c34['name']]={'$like':'%'+_0x4cc81b[_0x71f5('0x34')][_0x71f5('0x3a')]+'%'};return _0x3e2869;}})});}_0x1ecf54=_['merge']({},_0x1ecf54,_0x4cc81b[_0x71f5('0x3c')]);var _0x48c30c={'where':_0x1ecf54['where']};return db[_0x71f5('0x2b')][_0x71f5('0x1d')](_0x48c30c)[_0x71f5('0x24')](function(_0x138ed4){_0x41286e[_0x71f5('0x1d')]=_0x138ed4;if(_0x4cc81b[_0x71f5('0x34')][_0x71f5('0x3d')]){_0x1ecf54[_0x71f5('0x3e')]=[{'all':!![]}];}return db[_0x71f5('0x2b')][_0x71f5('0x3f')](_0x1ecf54);})[_0x71f5('0x24')](function(_0x46c832){_0x41286e[_0x71f5('0x40')]=_0x46c832;return _0x41286e;})[_0x71f5('0x24')](respondWithFilteredResult(_0x20def6,_0x1ecf54))[_0x71f5('0x41')](handleError(_0x20def6,null));};exports[_0x71f5('0x42')]=function(_0x3a4710,_0x34607b){var _0x583ed8={'raw':![],'where':{'id':_0x3a4710['params']['id']}},_0x137412={};_0x137412[_0x71f5('0x33')]=_[_0x71f5('0x30')](db[_0x71f5('0x2b')][_0x71f5('0x2c')]);_0x137412['query']=_['keys'](_0x3a4710[_0x71f5('0x34')]);_0x137412['filters']=_['intersection'](_0x137412['model'],_0x137412[_0x71f5('0x34')]);_0x583ed8[_0x71f5('0x35')]=_['intersection'](_0x137412[_0x71f5('0x33')],qs['fields'](_0x3a4710[_0x71f5('0x34')][_0x71f5('0x36')]));_0x583ed8['attributes']=_0x583ed8[_0x71f5('0x35')][_0x71f5('0x37')]?_0x583ed8[_0x71f5('0x35')]:_0x137412['model'];if(_0x3a4710[_0x71f5('0x34')][_0x71f5('0x3d')]){_0x583ed8[_0x71f5('0x3e')]=[{'all':!![]}];}_0x583ed8=_[_0x71f5('0x43')]({},_0x583ed8,_0x3a4710['options']);return db[_0x71f5('0x2b')][_0x71f5('0x44')](_0x583ed8)[_0x71f5('0x24')](handleEntityNotFound(_0x34607b,null))[_0x71f5('0x24')](respondWithResult(_0x34607b,null))['catch'](handleError(_0x34607b,null));};exports[_0x71f5('0x45')]=function(_0x3efd15,_0x436e91){return db['ServicenowAccount']['create'](_0x3efd15[_0x71f5('0x46')],{})[_0x71f5('0x24')](respondWithResult(_0x436e91,0xc9))[_0x71f5('0x41')](handleError(_0x436e91,null));};exports[_0x71f5('0x23')]=function(_0x234ade,_0x216364){if(_0x234ade[_0x71f5('0x46')]['id']){delete _0x234ade[_0x71f5('0x46')]['id'];}return db[_0x71f5('0x2b')][_0x71f5('0x44')]({'where':{'id':_0x234ade[_0x71f5('0x47')]['id']}})['then'](handleEntityNotFound(_0x216364,null))['then'](saveUpdates(_0x234ade[_0x71f5('0x46')],null))[_0x71f5('0x24')](respondWithResult(_0x216364,null))[_0x71f5('0x41')](handleError(_0x216364,null));};exports[_0x71f5('0x25')]=function(_0x5e4465,_0x24870e){return db['ServicenowAccount']['find']({'where':{'id':_0x5e4465[_0x71f5('0x47')]['id']}})[_0x71f5('0x24')](handleEntityNotFound(_0x24870e,null))['then'](removeEntity(_0x24870e,null))[_0x71f5('0x41')](handleError(_0x24870e,null));};exports[_0x71f5('0x48')]=function(_0x1634a0,_0x19899c,_0x268af5){var _0x54f361={};var _0x5d6a39={};var _0x3f5e7b;var _0x1cac64;return db[_0x71f5('0x2b')][_0x71f5('0x49')]({'where':{'id':_0x1634a0[_0x71f5('0x47')]['id']}})['then'](handleEntityNotFound(_0x19899c,null))[_0x71f5('0x24')](function(_0x111bed){if(_0x111bed){_0x3f5e7b=_0x111bed;_0x5d6a39['model']=_['keys'](db[_0x71f5('0x4a')][_0x71f5('0x2c')]);_0x5d6a39[_0x71f5('0x34')]=_[_0x71f5('0x30')](_0x1634a0[_0x71f5('0x34')]);_0x5d6a39[_0x71f5('0x31')]=_[_0x71f5('0x32')](_0x5d6a39[_0x71f5('0x33')],_0x5d6a39[_0x71f5('0x34')]);_0x54f361['attributes']=_['intersection'](_0x5d6a39[_0x71f5('0x33')],qs[_0x71f5('0x36')](_0x1634a0['query'][_0x71f5('0x36')]));_0x54f361['attributes']=_0x54f361['attributes']['length']?_0x54f361[_0x71f5('0x35')]:_0x5d6a39[_0x71f5('0x33')];_0x54f361[_0x71f5('0x4b')]=qs[_0x71f5('0x4c')](_0x1634a0[_0x71f5('0x34')][_0x71f5('0x4c')]);_0x54f361[_0x71f5('0x39')]=qs['filters'](_[_0x71f5('0x4d')](_0x1634a0[_0x71f5('0x34')],_0x5d6a39[_0x71f5('0x31')]));if(_0x1634a0[_0x71f5('0x34')][_0x71f5('0x3a')]){_0x54f361[_0x71f5('0x39')]=_['merge'](_0x54f361['where'],{'$or':_[_0x71f5('0x2f')](_0x54f361[_0x71f5('0x35')],function(_0xf1f351){var _0x231862={};_0x231862[_0xf1f351]={'$like':'%'+_0x1634a0[_0x71f5('0x34')][_0x71f5('0x3a')]+'%'};return _0x231862;})});}_0x54f361=_[_0x71f5('0x43')]({},_0x54f361,_0x1634a0[_0x71f5('0x3c')]);return _0x3f5e7b['getConfigurations'](_0x54f361);}})['then'](function(_0x5bb2f7){if(_0x5bb2f7){_0x1cac64=_0x5bb2f7[_0x71f5('0x37')];if(!_0x1634a0[_0x71f5('0x34')][_0x71f5('0x38')](_0x71f5('0x4e'))){_0x54f361[_0x71f5('0x1c')]=qs[_0x71f5('0x1c')](_0x1634a0[_0x71f5('0x34')][_0x71f5('0x1c')]);_0x54f361[_0x71f5('0x1a')]=qs[_0x71f5('0x1a')](_0x1634a0['query'][_0x71f5('0x1a')]);}return _0x3f5e7b['getConfigurations'](_0x54f361);}})['then'](function(_0x5b7d50){if(_0x5b7d50){return _0x5b7d50?{'count':_0x1cac64,'rows':_0x5b7d50}:null;}})[_0x71f5('0x24')](respondWithResult(_0x19899c,null))[_0x71f5('0x41')](handleError(_0x19899c,null));};exports[_0x71f5('0x4f')]=function(_0x4f630f,_0x4c3cd4,_0xb4d67d){if(_0x4f630f[_0x71f5('0x46')]['id']){delete _0x4f630f[_0x71f5('0x46')]['id'];}return db['ServicenowAccount']['findOne']({'where':{'id':_0x4f630f[_0x71f5('0x47')]['id']}})[_0x71f5('0x24')](handleEntityNotFound(_0x4c3cd4,null))['then'](function(_0x2c4126){if(_0x2c4126){_0x4f630f[_0x71f5('0x46')][_0x71f5('0x50')]=_0x2c4126['id'];_0x4f630f[_0x71f5('0x46')][_0x71f5('0x51')]=integrations[_0x71f5('0x52')](_0x4f630f[_0x71f5('0x46')]['channel'],_0x4f630f[_0x71f5('0x46')][_0x71f5('0x2d')]);_0x4f630f['body'][_0x71f5('0x53')]=integrations['getDescriptions'](_0x4f630f[_0x71f5('0x46')][_0x71f5('0x54')],_0x4f630f[_0x71f5('0x46')][_0x71f5('0x2d')]);return db['ServicenowConfiguration'][_0x71f5('0x45')](_0x4f630f['body'],{'include':[{'model':db['ServicenowField'],'as':_0x71f5('0x51')},{'model':db[_0x71f5('0x55')],'as':_0x71f5('0x53')}]});}return null;})[_0x71f5('0x24')](respondWithResult(_0x4c3cd4,null))[_0x71f5('0x41')](handleError(_0x4c3cd4,null));};exports[_0x71f5('0x56')]=function(_0x13ebdf,_0x4d60d9,_0x5ee221){var _0x149415=[_0x71f5('0x57'),_0x71f5('0x58'),_0x71f5('0x59'),_0x71f5('0x5a'),'close_code',_0x71f5('0x5b'),'incident_state',_0x71f5('0x5c'),_0x71f5('0x5d')];var _0x17687c=[_0x71f5('0x5e'),_0x71f5('0x57'),_0x71f5('0x5f'),_0x71f5('0x60'),_0x71f5('0x61'),_0x71f5('0x62'),'child_incidents','hold_reason',_0x71f5('0x63'),_0x71f5('0x64'),_0x71f5('0x65'),_0x71f5('0x66'),_0x71f5('0x67'),_0x71f5('0x68'),_0x71f5('0x69'),'sys_domain','state',_0x71f5('0x6a'),'knowledge',_0x71f5('0x4b'),_0x71f5('0x6b'),_0x71f5('0x6c'),_0x71f5('0x6d'),'delivery_plan',_0x71f5('0x6e'),_0x71f5('0x6f'),_0x71f5('0x70'),_0x71f5('0x71'),_0x71f5('0x72'),_0x71f5('0x73'),'rfc',_0x71f5('0x74'),_0x71f5('0x75'),_0x71f5('0x76'),_0x71f5('0x77'),_0x71f5('0x78'),'work_end',_0x71f5('0x79'),'resolved_at',_0x71f5('0x7a'),'approval_set',_0x71f5('0x5a'),_0x71f5('0x7b'),_0x71f5('0x7c'),_0x71f5('0x7d'),'correlation_display',_0x71f5('0x7e'),_0x71f5('0x7f'),_0x71f5('0x80'),_0x71f5('0x81'),_0x71f5('0x82'),'description','calendar_duration',_0x71f5('0x5b'),'sys_class_name',_0x71f5('0x83'),'closed_by',_0x71f5('0x84'),_0x71f5('0x85'),'sys_id','contact_type',_0x71f5('0x86'),_0x71f5('0x87'),_0x71f5('0x88'),_0x71f5('0x89'),_0x71f5('0x8a'),'reassignment_count',_0x71f5('0x8b'),_0x71f5('0x8c'),_0x71f5('0x5c'),'comments',_0x71f5('0x8d'),_0x71f5('0x8e'),_0x71f5('0x8f'),_0x71f5('0x90'),_0x71f5('0x91'),_0x71f5('0x92'),_0x71f5('0x93'),'escalation',_0x71f5('0x94'),_0x71f5('0x95'),_0x71f5('0x96'),_0x71f5('0x5d')];var _0x19df89='';var _0x21318d='';var _0xa0cbec=[];var _0x5479ce='';var _0x14c7b7='';var _0x37170f=[];var _0xb9a047='';var _0x5669b2='';var _0x32ad96={};var _0x31efb2='';return db[_0x71f5('0x2b')][_0x71f5('0x49')]({'where':{'id':_0x13ebdf[_0x71f5('0x47')]['id']},'attributes':['id',_0x71f5('0x97'),_0x71f5('0x98'),'email',_0x71f5('0x99'),_0x71f5('0x9a')]})['then'](handleEntityNotFound(_0x4d60d9,null))[_0x71f5('0x24')](function(_0xe150f1){if(_0xe150f1){_0x31efb2=_0xe150f1[_0x71f5('0x99')];var _0x41a370=_0x31efb2[_0x71f5('0x9b')](-0x1);if(_0x41a370==='/'){_0x31efb2=_0x31efb2['substring'](0x0,_0x31efb2[_0x71f5('0x9c')](_0x41a370));}_0x5669b2=util['format'](_0x71f5('0x9d'),_0x31efb2);_0xb9a047=util['format'](_0x71f5('0x9e'),_0x31efb2);_0x32ad96={'user':_0xe150f1['username'],'pass':_0xe150f1['password']};var _0x67ca7a={'method':_0x71f5('0x9f'),'uri':_0x5669b2+'incident?sysparm_display_value=all','auth':_0x32ad96,'json':!![]};return rp(_0x67ca7a);}})['then'](function(_0x28cf6c){if(_0x28cf6c[_0x71f5('0xa0')][_0x71f5('0x37')]>0x0){_0x19df89=_0x28cf6c[_0x71f5('0xa0')];}console[_0x71f5('0xa1')](_0x71f5('0xa2'),_0x19df89);_0x37170f=[];_0x21318d=Object['assign']([],_0x19df89);_[_0x71f5('0xa3')](_0x21318d,function(_0x222ef1){return!_0x149415['includes'](_0x222ef1[_0x71f5('0x28')]);});_0x21318d[_0x71f5('0xa4')](function(_0xa72d48){var _0x49617b=createFieldObject(_0xb9a047,_0x32ad96,_0xa72d48['internalType'],_0xa72d48[_0x71f5('0x28')],_0xa72d48[_0x71f5('0xa5')],![]);_0x37170f[_0x71f5('0xa6')](_0x49617b);});return Promise['all'](_0x37170f);})[_0x71f5('0x24')](function(_0x17ab93){_0xa0cbec=_0x17ab93;_0x5479ce=Object[_0x71f5('0xa7')]([],_0x19df89);console[_0x71f5('0xa1')]('TCL:\x20_object',_0x19df89);_[_0x71f5('0xa3')](_0x5479ce,function(_0x5a995b){return _0x17687c[_0x71f5('0xa8')](_0x5a995b[_0x71f5('0x28')]);});console[_0x71f5('0xa1')](_0x71f5('0xa9'),_0x5479ce);_0x37170f=[];_0x5479ce[_0x71f5('0xa4')](function(_0x26b3fa){var _0x1d56c9=createFieldObject(_0xb9a047,_0x32ad96,_0x26b3fa[_0x71f5('0xaa')],_0x26b3fa[_0x71f5('0x28')],_0x26b3fa[_0x71f5('0xa5')],!![]);_0x37170f[_0x71f5('0xa6')](_0x1d56c9);});return Promise[_0x71f5('0xab')](_0x37170f);})[_0x71f5('0x24')](function(_0x450490){_0x14c7b7=_0x450490;var _0x5cf8ed=_0xa0cbec[_0x71f5('0xac')](_0x14c7b7);return{'count':_0x5cf8ed[_0x71f5('0x37')],'rows':_0x5cf8ed};})['then'](respondWithResult(_0x4d60d9,null))['catch'](function(_0x2cf0f6){console[_0x71f5('0xa1')](_0x71f5('0xad')+_0x2cf0f6);var _0x30661c=_0x13ebdf[_0x71f5('0x34')][_0x71f5('0xae')]?0x1f4:_0x2cf0f6[_0x71f5('0xaf')]||0x1f4;logger[_0x71f5('0x26')](_0x2cf0f6[_0x71f5('0x27')]);delete _0x2cf0f6['name'];if(_0x30661c===0x191){_0x30661c=0x190;}_0x4d60d9['status'](_0x30661c)['send'](_0x13ebdf[_0x71f5('0x34')][_0x71f5('0xae')]?{'message':_0x71f5('0xb0'),'statusCode':_0x2cf0f6[_0x71f5('0xaf')]}:_0x2cf0f6);});};function createFieldObject(_0x3904a4,_0x44aac1,_0x36e362,_0x24ddbf,_0x454d72,_0x2134ad){return new Promise(function(_0x106f74,_0xe88e10){var _0x10fec0={'id':_0x24ddbf,'name':_0x454d72,'custom':_0x2134ad};if(_0x36e362==='boolean'){_0x10fec0[_0x71f5('0x3c')]=[{'name':_0x71f5('0xb1'),'value':'true'},{'name':_0x71f5('0xb2'),'value':_0x71f5('0xb3')}];_0x106f74(_0x10fec0);}else{var _0x26d737={'method':'GET','uri':_0x3904a4+'sys_choice?sysparm_query=name=incident^element='+_0x24ddbf,'auth':_0x44aac1,'json':!![]};return rp(_0x26d737)[_0x71f5('0x24')](function(_0x5784fd){var _0x24737d=[];if(_0x5784fd[_0x71f5('0xa0')][_0x71f5('0x37')]>0x0){_0x5784fd[_0x71f5('0xa0')][_0x71f5('0xa4')](function(_0x14451a){if(_0x14451a[_0x71f5('0xb4')]===_0x71f5('0xb3')){var _0x39bd1d={'name':_0x14451a['label'],'value':_0x14451a[_0x71f5('0xb5')]};_0x24737d[_0x71f5('0xa6')](_0x39bd1d);}});}_0x10fec0[_0x71f5('0x3c')]=_0x24737d;if(_0x10fec0[_0x71f5('0x3c')][_0x71f5('0x37')]>0x0){_0x106f74(_0x10fec0);}else{if(_0x2134ad==![]){_0x106f74();}else{_0x106f74(_0x10fec0);}}});}});} \ No newline at end of file +var _0x91c1=['delivery_plan','impact','active','business_service','priority','sys_domain_path','rfc','time_worked','opened_at','business_duration','group_list','resolved_at','caller_id','approval_set','subcategory','work_notes','short_description','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','sys_class_name','follow_up','contact_type','reopened_by','urgency','company','activity_due','comments','sla_due','due_date','sys_mod_count','reopen_count','upon_approval','correlation_id','location','username','password','email','remoteUri','serverUrl','slice','substring','format','%s/api/now/doc/table/schema/','%s/api/now/table/','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','forEach','internalType','label','push','all','assign','TCL:\x20_object','remove','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','ServiceNow\x20error:\x20','test','statusCode','send','Wrong\x20credentials','True','true','False','false','GET','sys_choice?sysparm_query=name=incident^element=','inactive','value','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','end','sendStatus','error','stack','name','index','ServicenowAccount','fieldName','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','type','VIRTUAL','options','include','catch','rawAttributes','fields','includeAll','find','create','body','params','getConfigurations','findOne','ServicenowConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','ServicenowField','Descriptions','getFields','made_sla','hold_reason','close_code','notify','incident_state','severity','category','upon_reject','sys_updated_on','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','state','sys_created_by','knowledge','closed_at','cmdb_ci'];(function(_0x206315,_0x54b9ec){var _0x4d8de0=function(_0x1b9ccd){while(--_0x1b9ccd){_0x206315['push'](_0x206315['shift']());}};_0x4d8de0(++_0x54b9ec);}(_0x91c1,0x101));var _0x191c=function(_0x334651,_0x6e99f6){_0x334651=_0x334651-0x0;var _0x29657c=_0x91c1[_0x334651];return _0x29657c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x191c('0x0'));var zipdir=require(_0x191c('0x1'));var jsonpatch=require(_0x191c('0x2'));var rp=require(_0x191c('0x3'));var moment=require('moment');var BPromise=require(_0x191c('0x4'));var Mustache=require(_0x191c('0x5'));var util=require(_0x191c('0x6'));var path=require(_0x191c('0x7'));var sox=require('sox');var csv=require(_0x191c('0x8'));var ejs=require(_0x191c('0x9'));var fs=require('fs');var fs_extra=require(_0x191c('0xa'));var _=require('lodash');var squel=require(_0x191c('0xb'));var crypto=require(_0x191c('0xc'));var jsforce=require(_0x191c('0xd'));var deskjs=require(_0x191c('0xe'));var toCsv=require(_0x191c('0x8'));var querystring=require('querystring');var Papa=require(_0x191c('0xf'));var Redis=require(_0x191c('0x10'));var authService=require(_0x191c('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x191c('0x12'));var hardwareService=require(_0x191c('0x13'));var logger=require(_0x191c('0x14'))(_0x191c('0x15'));var utils=require('../../config/utils');var config=require(_0x191c('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x191c('0x17'))['db'];var integrations=require(_0x191c('0x18'));function respondWithStatusCode(_0x341bc2,_0x23eb67){_0x23eb67=_0x23eb67||0xcc;return function(_0x4b6df2){if(_0x4b6df2){return _0x341bc2['sendStatus'](_0x23eb67);}return _0x341bc2[_0x191c('0x19')](_0x23eb67)['end']();};}function respondWithResult(_0x3bad84,_0x31c2bd){_0x31c2bd=_0x31c2bd||0xc8;return function(_0x56f936){if(_0x56f936){return _0x3bad84['status'](_0x31c2bd)[_0x191c('0x1a')](_0x56f936);}};}function respondWithFilteredResult(_0x14ee13,_0x146511){return function(_0x68699e){if(_0x68699e){var _0x367f91=typeof _0x146511[_0x191c('0x1b')]===_0x191c('0x1c')&&typeof _0x146511[_0x191c('0x1d')]===_0x191c('0x1c');var _0x276752=_0x68699e[_0x191c('0x1e')];var _0x211d05=_0x367f91?0x0:_0x146511['offset'];var _0x10addb=_0x367f91?_0x68699e[_0x191c('0x1e')]:_0x146511['offset']+_0x146511[_0x191c('0x1d')];var _0x9a50c7;if(_0x10addb>=_0x276752){_0x10addb=_0x276752;_0x9a50c7=0xc8;}else{_0x9a50c7=0xce;}_0x14ee13[_0x191c('0x19')](_0x9a50c7);return _0x14ee13[_0x191c('0x1f')](_0x191c('0x20'),_0x211d05+'-'+_0x10addb+'/'+_0x276752)[_0x191c('0x1a')](_0x68699e);}return null;};}function patchUpdates(_0xa76d74){return function(_0x2a4dc5){try{jsonpatch['apply'](_0x2a4dc5,_0xa76d74,!![]);}catch(_0x52dcbc){return BPromise[_0x191c('0x21')](_0x52dcbc);}return _0x2a4dc5['save']();};}function saveUpdates(_0x27d49d,_0x3fbdfb){return function(_0x24a91f){if(_0x24a91f){return _0x24a91f[_0x191c('0x22')](_0x27d49d)[_0x191c('0x23')](function(_0x3ad768){return _0x3ad768;});}return null;};}function removeEntity(_0x371088,_0x4a45ae){return function(_0x57bea5){if(_0x57bea5){return _0x57bea5[_0x191c('0x24')]()[_0x191c('0x23')](function(){_0x371088[_0x191c('0x19')](0xcc)[_0x191c('0x25')]();});}};}function handleEntityNotFound(_0x52c22f,_0x3e48e1){return function(_0x394227){if(!_0x394227){_0x52c22f[_0x191c('0x26')](0x194);}return _0x394227;};}function handleError(_0x341177,_0x35fddf){_0x35fddf=_0x35fddf||0x1f4;return function(_0x549181){logger[_0x191c('0x27')](_0x549181[_0x191c('0x28')]);if(_0x549181[_0x191c('0x29')]){delete _0x549181[_0x191c('0x29')];}_0x341177[_0x191c('0x19')](_0x35fddf)['send'](_0x549181);};}exports[_0x191c('0x2a')]=function(_0x98833f,_0x11f588){var _0x3f949a={},_0x25dc87={},_0x539619={'count':0x0,'rows':[]};var _0x4d50ff=_['map'](db[_0x191c('0x2b')]['rawAttributes'],function(_0x2c922d){return{'name':_0x2c922d[_0x191c('0x2c')],'type':_0x2c922d['type'][_0x191c('0x2d')]};});_0x25dc87[_0x191c('0x2e')]=_['map'](_0x4d50ff,_0x191c('0x29'));_0x25dc87[_0x191c('0x2f')]=_[_0x191c('0x30')](_0x98833f[_0x191c('0x2f')]);_0x25dc87[_0x191c('0x31')]=_[_0x191c('0x32')](_0x25dc87['model'],_0x25dc87[_0x191c('0x2f')]);_0x3f949a[_0x191c('0x33')]=_['intersection'](_0x25dc87[_0x191c('0x2e')],qs['fields'](_0x98833f[_0x191c('0x2f')]['fields']));_0x3f949a[_0x191c('0x33')]=_0x3f949a[_0x191c('0x33')][_0x191c('0x34')]?_0x3f949a[_0x191c('0x33')]:_0x25dc87['model'];if(!_0x98833f[_0x191c('0x2f')][_0x191c('0x35')](_0x191c('0x36'))){_0x3f949a['limit']=qs[_0x191c('0x1d')](_0x98833f[_0x191c('0x2f')]['limit']);_0x3f949a['offset']=qs[_0x191c('0x1b')](_0x98833f[_0x191c('0x2f')][_0x191c('0x1b')]);}_0x3f949a[_0x191c('0x37')]=qs[_0x191c('0x38')](_0x98833f[_0x191c('0x2f')][_0x191c('0x38')]);_0x3f949a['where']=qs['filters'](_[_0x191c('0x39')](_0x98833f[_0x191c('0x2f')],_0x25dc87[_0x191c('0x31')]),_0x4d50ff);if(_0x98833f[_0x191c('0x2f')][_0x191c('0x3a')]){_0x3f949a[_0x191c('0x3b')]=_[_0x191c('0x3c')](_0x3f949a[_0x191c('0x3b')],{'$or':_[_0x191c('0x3d')](_0x4d50ff,function(_0x156804){if(_0x156804[_0x191c('0x3e')]!==_0x191c('0x3f')){var _0x584e62={};_0x584e62[_0x156804['name']]={'$like':'%'+_0x98833f[_0x191c('0x2f')][_0x191c('0x3a')]+'%'};return _0x584e62;}})});}_0x3f949a=_[_0x191c('0x3c')]({},_0x3f949a,_0x98833f[_0x191c('0x40')]);var _0x5d0743={'where':_0x3f949a[_0x191c('0x3b')]};return db['ServicenowAccount']['count'](_0x5d0743)[_0x191c('0x23')](function(_0x3c5654){_0x539619['count']=_0x3c5654;if(_0x98833f[_0x191c('0x2f')]['includeAll']){_0x3f949a[_0x191c('0x41')]=[{'all':!![]}];}return db[_0x191c('0x2b')]['findAll'](_0x3f949a);})['then'](function(_0x38a766){_0x539619['rows']=_0x38a766;return _0x539619;})[_0x191c('0x23')](respondWithFilteredResult(_0x11f588,_0x3f949a))[_0x191c('0x42')](handleError(_0x11f588,null));};exports['show']=function(_0x4492c1,_0x47d60c){var _0x202904={'raw':![],'where':{'id':_0x4492c1['params']['id']}},_0x55954b={};_0x55954b[_0x191c('0x2e')]=_['keys'](db[_0x191c('0x2b')][_0x191c('0x43')]);_0x55954b['query']=_['keys'](_0x4492c1[_0x191c('0x2f')]);_0x55954b[_0x191c('0x31')]=_[_0x191c('0x32')](_0x55954b[_0x191c('0x2e')],_0x55954b[_0x191c('0x2f')]);_0x202904[_0x191c('0x33')]=_['intersection'](_0x55954b[_0x191c('0x2e')],qs[_0x191c('0x44')](_0x4492c1[_0x191c('0x2f')]['fields']));_0x202904['attributes']=_0x202904[_0x191c('0x33')]['length']?_0x202904['attributes']:_0x55954b[_0x191c('0x2e')];if(_0x4492c1[_0x191c('0x2f')][_0x191c('0x45')]){_0x202904[_0x191c('0x41')]=[{'all':!![]}];}_0x202904=_[_0x191c('0x3c')]({},_0x202904,_0x4492c1[_0x191c('0x40')]);return db[_0x191c('0x2b')][_0x191c('0x46')](_0x202904)[_0x191c('0x23')](handleEntityNotFound(_0x47d60c,null))[_0x191c('0x23')](respondWithResult(_0x47d60c,null))[_0x191c('0x42')](handleError(_0x47d60c,null));};exports['create']=function(_0x7d7e41,_0x43ec2b){return db[_0x191c('0x2b')][_0x191c('0x47')](_0x7d7e41['body'],{})[_0x191c('0x23')](respondWithResult(_0x43ec2b,0xc9))[_0x191c('0x42')](handleError(_0x43ec2b,null));};exports[_0x191c('0x22')]=function(_0x12c23b,_0x318d77){if(_0x12c23b[_0x191c('0x48')]['id']){delete _0x12c23b['body']['id'];}return db[_0x191c('0x2b')]['find']({'where':{'id':_0x12c23b[_0x191c('0x49')]['id']}})['then'](handleEntityNotFound(_0x318d77,null))[_0x191c('0x23')](saveUpdates(_0x12c23b[_0x191c('0x48')],null))[_0x191c('0x23')](respondWithResult(_0x318d77,null))['catch'](handleError(_0x318d77,null));};exports[_0x191c('0x24')]=function(_0x147949,_0x8379fa){return db[_0x191c('0x2b')][_0x191c('0x46')]({'where':{'id':_0x147949[_0x191c('0x49')]['id']}})[_0x191c('0x23')](handleEntityNotFound(_0x8379fa,null))['then'](removeEntity(_0x8379fa,null))[_0x191c('0x42')](handleError(_0x8379fa,null));};exports[_0x191c('0x4a')]=function(_0x527196,_0x3e257b,_0x36be65){var _0x330b56={};var _0x1639b3={};var _0x4e86f5;var _0x449525;return db[_0x191c('0x2b')][_0x191c('0x4b')]({'where':{'id':_0x527196[_0x191c('0x49')]['id']}})[_0x191c('0x23')](handleEntityNotFound(_0x3e257b,null))[_0x191c('0x23')](function(_0x5c3c17){if(_0x5c3c17){_0x4e86f5=_0x5c3c17;_0x1639b3[_0x191c('0x2e')]=_['keys'](db[_0x191c('0x4c')]['rawAttributes']);_0x1639b3['query']=_['keys'](_0x527196[_0x191c('0x2f')]);_0x1639b3[_0x191c('0x31')]=_[_0x191c('0x32')](_0x1639b3[_0x191c('0x2e')],_0x1639b3['query']);_0x330b56['attributes']=_[_0x191c('0x32')](_0x1639b3[_0x191c('0x2e')],qs[_0x191c('0x44')](_0x527196[_0x191c('0x2f')]['fields']));_0x330b56['attributes']=_0x330b56[_0x191c('0x33')]['length']?_0x330b56[_0x191c('0x33')]:_0x1639b3[_0x191c('0x2e')];_0x330b56['order']=qs[_0x191c('0x38')](_0x527196['query']['sort']);_0x330b56[_0x191c('0x3b')]=qs[_0x191c('0x31')](_[_0x191c('0x39')](_0x527196['query'],_0x1639b3['filters']));if(_0x527196[_0x191c('0x2f')]['filter']){_0x330b56[_0x191c('0x3b')]=_[_0x191c('0x3c')](_0x330b56[_0x191c('0x3b')],{'$or':_[_0x191c('0x3d')](_0x330b56['attributes'],function(_0x3b9cee){var _0x5dc708={};_0x5dc708[_0x3b9cee]={'$like':'%'+_0x527196[_0x191c('0x2f')][_0x191c('0x3a')]+'%'};return _0x5dc708;})});}_0x330b56=_['merge']({},_0x330b56,_0x527196[_0x191c('0x40')]);return _0x4e86f5['getConfigurations'](_0x330b56);}})[_0x191c('0x23')](function(_0x5bb2b7){if(_0x5bb2b7){_0x449525=_0x5bb2b7[_0x191c('0x34')];if(!_0x527196['query'][_0x191c('0x35')](_0x191c('0x36'))){_0x330b56[_0x191c('0x1d')]=qs['limit'](_0x527196[_0x191c('0x2f')][_0x191c('0x1d')]);_0x330b56[_0x191c('0x1b')]=qs['offset'](_0x527196[_0x191c('0x2f')]['offset']);}return _0x4e86f5[_0x191c('0x4a')](_0x330b56);}})['then'](function(_0x103dca){if(_0x103dca){return _0x103dca?{'count':_0x449525,'rows':_0x103dca}:null;}})[_0x191c('0x23')](respondWithResult(_0x3e257b,null))[_0x191c('0x42')](handleError(_0x3e257b,null));};exports[_0x191c('0x4d')]=function(_0x3b503c,_0x304f5a,_0x1b855d){if(_0x3b503c[_0x191c('0x48')]['id']){delete _0x3b503c[_0x191c('0x48')]['id'];}return db['ServicenowAccount']['findOne']({'where':{'id':_0x3b503c['params']['id']}})[_0x191c('0x23')](handleEntityNotFound(_0x304f5a,null))[_0x191c('0x23')](function(_0x56c561){if(_0x56c561){_0x3b503c['body'][_0x191c('0x4e')]=_0x56c561['id'];_0x3b503c[_0x191c('0x48')][_0x191c('0x4f')]=integrations[_0x191c('0x50')](_0x3b503c[_0x191c('0x48')][_0x191c('0x51')],_0x3b503c['body'][_0x191c('0x3e')]);_0x3b503c[_0x191c('0x48')]['Descriptions']=integrations[_0x191c('0x52')](_0x3b503c['body'][_0x191c('0x51')],_0x3b503c[_0x191c('0x48')][_0x191c('0x3e')]);return db[_0x191c('0x4c')][_0x191c('0x47')](_0x3b503c[_0x191c('0x48')],{'include':[{'model':db[_0x191c('0x53')],'as':'Subjects'},{'model':db[_0x191c('0x53')],'as':_0x191c('0x54')}]});}return null;})[_0x191c('0x23')](respondWithResult(_0x304f5a,null))[_0x191c('0x42')](handleError(_0x304f5a,null));};exports[_0x191c('0x55')]=function(_0x24dc48,_0x32b17d,_0x490e9f){var _0x239a85=[_0x191c('0x56'),_0x191c('0x57'),'knowledge','subcategory',_0x191c('0x58'),_0x191c('0x59'),_0x191c('0x5a'),_0x191c('0x5b'),_0x191c('0x5c')];var _0x177369=['parent',_0x191c('0x56'),'caused_by','watch_list',_0x191c('0x5d'),_0x191c('0x5e'),'child_incidents',_0x191c('0x57'),'approval_history',_0x191c('0x5f'),_0x191c('0x60'),_0x191c('0x61'),_0x191c('0x62'),_0x191c('0x63'),_0x191c('0x64'),_0x191c('0x65'),_0x191c('0x66'),_0x191c('0x67'),_0x191c('0x68'),_0x191c('0x37'),'calendar_stc',_0x191c('0x69'),_0x191c('0x6a'),_0x191c('0x6b'),_0x191c('0x6c'),_0x191c('0x6d'),'work_notes_list',_0x191c('0x6e'),_0x191c('0x6f'),_0x191c('0x70'),_0x191c('0x71'),_0x191c('0x72'),'expected_start',_0x191c('0x73'),_0x191c('0x74'),_0x191c('0x75'),'work_end','reopened_time',_0x191c('0x76'),_0x191c('0x77'),_0x191c('0x78'),_0x191c('0x79'),_0x191c('0x7a'),_0x191c('0x7b'),_0x191c('0x58'),_0x191c('0x7c'),_0x191c('0x7d'),_0x191c('0x7e'),_0x191c('0x7f'),_0x191c('0x80'),_0x191c('0x81'),'description','calendar_duration',_0x191c('0x59'),_0x191c('0x82'),'close_notes','closed_by',_0x191c('0x83'),'parent_incident','sys_id',_0x191c('0x84'),_0x191c('0x85'),_0x191c('0x5a'),_0x191c('0x86'),'problem_id',_0x191c('0x87'),'reassignment_count',_0x191c('0x88'),'assigned_to',_0x191c('0x5b'),_0x191c('0x89'),_0x191c('0x8a'),'approval','comments_and_work_notes',_0x191c('0x8b'),_0x191c('0x8c'),_0x191c('0x8d'),'sys_tags','escalation',_0x191c('0x8e'),_0x191c('0x8f'),_0x191c('0x90'),'category'];var _0x230ffd='';var _0x58bcf2='';var _0x3e107d=[];var _0x53381a='';var _0x31adcf='';var _0x2cb491=[];var _0x5a9f7f='';var _0x1473b3='';var _0x5c36f4={};var _0x4a532b='';return db[_0x191c('0x2b')][_0x191c('0x4b')]({'where':{'id':_0x24dc48[_0x191c('0x49')]['id']},'attributes':['id',_0x191c('0x91'),_0x191c('0x92'),_0x191c('0x93'),_0x191c('0x94'),_0x191c('0x95')]})[_0x191c('0x23')](handleEntityNotFound(_0x32b17d,null))[_0x191c('0x23')](function(_0x484f16){if(_0x484f16){_0x4a532b=_0x484f16['remoteUri'];var _0x53fa5e=_0x4a532b[_0x191c('0x96')](-0x1);if(_0x53fa5e==='/'){_0x4a532b=_0x4a532b[_0x191c('0x97')](0x0,_0x4a532b['lastIndexOf'](_0x53fa5e));}_0x1473b3=util[_0x191c('0x98')](_0x191c('0x99'),_0x4a532b);_0x5a9f7f=util['format'](_0x191c('0x9a'),_0x4a532b);_0x5c36f4={'user':_0x484f16[_0x191c('0x91')],'pass':_0x484f16['password']};var _0x17de96={'method':'GET','uri':_0x1473b3+_0x191c('0x9b'),'auth':_0x5c36f4,'json':!![]};return rp(_0x17de96);}})[_0x191c('0x23')](function(_0x1e7357){if(_0x1e7357['result'][_0x191c('0x34')]>0x0){_0x230ffd=_0x1e7357[_0x191c('0x9c')];}console[_0x191c('0x9d')](_0x191c('0x9e'),_0x230ffd);_0x2cb491=[];_0x58bcf2=Object['assign']([],_0x230ffd);_['remove'](_0x58bcf2,function(_0x35b38a){return!_0x239a85['includes'](_0x35b38a['name']);});_0x58bcf2[_0x191c('0x9f')](function(_0x26f5c9){var _0x4aaf99=createFieldObject(_0x5a9f7f,_0x5c36f4,_0x26f5c9[_0x191c('0xa0')],_0x26f5c9['name'],_0x26f5c9[_0x191c('0xa1')],![]);_0x2cb491[_0x191c('0xa2')](_0x4aaf99);});return Promise[_0x191c('0xa3')](_0x2cb491);})['then'](function(_0x408634){_0x3e107d=_0x408634;_0x53381a=Object[_0x191c('0xa4')]([],_0x230ffd);console['log'](_0x191c('0xa5'),_0x230ffd);_[_0x191c('0xa6')](_0x53381a,function(_0x5b17ec){return _0x177369['includes'](_0x5b17ec[_0x191c('0x29')]);});console[_0x191c('0x9d')](_0x191c('0xa7'),_0x53381a);_0x2cb491=[];_0x53381a[_0x191c('0x9f')](function(_0x59b3f3){var _0x5bdda3=createFieldObject(_0x5a9f7f,_0x5c36f4,_0x59b3f3[_0x191c('0xa0')],_0x59b3f3['name'],_0x59b3f3[_0x191c('0xa1')],!![]);_0x2cb491[_0x191c('0xa2')](_0x5bdda3);});return Promise[_0x191c('0xa3')](_0x2cb491);})[_0x191c('0x23')](function(_0x61ba46){_0x31adcf=_0x61ba46;var _0x162da4=_0x3e107d[_0x191c('0xa8')](_0x31adcf);return{'count':_0x162da4[_0x191c('0x34')],'rows':_0x162da4};})['then'](respondWithResult(_0x32b17d,null))[_0x191c('0x42')](function(_0x37e836){console[_0x191c('0x9d')](_0x191c('0xa9')+_0x37e836);var _0x4af8cc=_0x24dc48[_0x191c('0x2f')][_0x191c('0xaa')]?0x1f4:_0x37e836[_0x191c('0xab')]||0x1f4;logger['error'](_0x37e836['stack']);delete _0x37e836['name'];if(_0x4af8cc===0x191){_0x4af8cc=0x190;}_0x32b17d[_0x191c('0x19')](_0x4af8cc)[_0x191c('0xac')](_0x24dc48[_0x191c('0x2f')][_0x191c('0xaa')]?{'message':_0x191c('0xad'),'statusCode':_0x37e836[_0x191c('0xab')]}:_0x37e836);});};function createFieldObject(_0x50666a,_0x585c18,_0x5ce8d8,_0x26e8bb,_0x48de57,_0x584454){return new Promise(function(_0x36215a,_0x5d5408){var _0x2b71cf={'id':_0x26e8bb,'name':_0x48de57,'custom':_0x584454};if(_0x5ce8d8==='boolean'){_0x2b71cf[_0x191c('0x40')]=[{'name':_0x191c('0xae'),'value':_0x191c('0xaf')},{'name':_0x191c('0xb0'),'value':_0x191c('0xb1')}];_0x36215a(_0x2b71cf);}else{var _0x39ea43={'method':_0x191c('0xb2'),'uri':_0x50666a+_0x191c('0xb3')+_0x26e8bb,'auth':_0x585c18,'json':!![]};return rp(_0x39ea43)[_0x191c('0x23')](function(_0x6d00cf){var _0x290458=[];if(_0x6d00cf['result'][_0x191c('0x34')]>0x0){_0x6d00cf['result'][_0x191c('0x9f')](function(_0x10cf05){if(_0x10cf05[_0x191c('0xb4')]==='false'){var _0x461621={'name':_0x10cf05[_0x191c('0xa1')],'value':_0x10cf05[_0x191c('0xb5')]};_0x290458[_0x191c('0xa2')](_0x461621);}});}_0x2b71cf['options']=_0x290458;if(_0x2b71cf[_0x191c('0x40')]['length']>0x0){_0x36215a(_0x2b71cf);}else{if(_0x584454==![]){_0x36215a();}else{_0x36215a(_0x2b71cf);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 5a7b7cf..9006443 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 _0xc4aa=['bluebird','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','lodash','util','../../config/logger','api','moment'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0xc4aa[_0x2235bf];return _0x4c3a64;};'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'));var integrations=require(_0xac4a('0x8'));module[_0xac4a('0x9')]=function(_0x96be2b,_0x15cd34){return _0x96be2b[_0xac4a('0xa')](_0xac4a('0xb'),attributes,{'tableName':'int_servicenow_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x187d=['exports','define','ServicenowAccount','int_servicenow_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intServicenowAccount.attributes'];(function(_0x1d7907,_0x131382){var _0x4656fa=function(_0x440fd6){while(--_0x440fd6){_0x1d7907['push'](_0x1d7907['shift']());}};_0x4656fa(++_0x131382);}(_0x187d,0x93));var _0xd187=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x187d[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0xd187('0x0'));var util=require('util');var logger=require(_0xd187('0x1'))(_0xd187('0x2'));var moment=require(_0xd187('0x3'));var BPromise=require(_0xd187('0x4'));var rp=require(_0xd187('0x5'));var fs=require('fs');var path=require(_0xd187('0x6'));var rimraf=require('rimraf');var config=require(_0xd187('0x7'));var attributes=require(_0xd187('0x8'));var integrations=require('../../components/integrations/configuration');module[_0xd187('0x9')]=function(_0x58ee7,_0x444a60){return _0x58ee7[_0xd187('0xa')](_0xd187('0xb'),attributes,{'tableName':_0xd187('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 3008fa8..a0ff8e1 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 _0x5fda=['where','attributes','limit','map','model','include','GetServicenowAccount','stringify','catch','ShowServicenowAccount','find','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','message','result','ServicenowAccount','findAll','options'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x5fda,0x1e7));var _0xa5fd=function(_0xf4666e,_0x571140){_0xf4666e=_0xf4666e-0x0;var _0x1853f1=_0x5fda[_0xf4666e];return _0x1853f1;};'use strict';var _=require(_0xa5fd('0x0'));var util=require('util');var moment=require(_0xa5fd('0x1'));var BPromise=require('bluebird');var rs=require(_0xa5fd('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa5fd('0x3'))['db'];var utils=require(_0xa5fd('0x4'));var logger=require(_0xa5fd('0x5'))(_0xa5fd('0x6'));var config=require(_0xa5fd('0x7'));var jayson=require(_0xa5fd('0x8'));var client=jayson['client'][_0xa5fd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x17a09a,_0x409e9e,_0x8541b4){return new BPromise(function(_0x38822b,_0x7b1c44){return client[_0xa5fd('0xa')](_0x17a09a,_0x8541b4)[_0xa5fd('0xb')](function(_0x59dbda){logger[_0xa5fd('0xc')](_0xa5fd('0xd'),_0x409e9e,_0xa5fd('0xe'));logger[_0xa5fd('0xf')](_0xa5fd('0x10'),_0x409e9e,'request\x20sent',JSON['stringify'](_0x59dbda));if(_0x59dbda[_0xa5fd('0x11')]){if(_0x59dbda[_0xa5fd('0x11')]['code']===0x1f4){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x409e9e,_0x59dbda[_0xa5fd('0x11')][_0xa5fd('0x12')]);return _0x7b1c44(_0x59dbda['error'][_0xa5fd('0x12')]);}logger[_0xa5fd('0x11')]('ServicenowAccount,\x20%s,\x20%s',_0x409e9e,_0x59dbda[_0xa5fd('0x11')][_0xa5fd('0x12')]);return _0x38822b(_0x59dbda[_0xa5fd('0x11')][_0xa5fd('0x12')]);}else{logger[_0xa5fd('0xc')]('ServicenowAccount,\x20%s,\x20%s',_0x409e9e,_0xa5fd('0xe'));_0x38822b(_0x59dbda[_0xa5fd('0x13')][_0xa5fd('0x12')]);}})['catch'](function(_0x224205){logger[_0xa5fd('0x11')](_0xa5fd('0xd'),_0x409e9e,_0x224205);_0x7b1c44(_0x224205);});});}exports['GetServicenowAccount']=function(_0x1531ca){var _0x36e34f=this;return new Promise(function(_0x2f871f,_0xc529b8){return db[_0xa5fd('0x14')][_0xa5fd('0x15')]({'raw':_0x1531ca[_0xa5fd('0x16')]?_0x1531ca['options']['raw']===undefined?!![]:![]:!![],'where':_0x1531ca[_0xa5fd('0x16')]?_0x1531ca[_0xa5fd('0x16')][_0xa5fd('0x17')]||null:null,'attributes':_0x1531ca[_0xa5fd('0x16')]?_0x1531ca[_0xa5fd('0x16')][_0xa5fd('0x18')]||null:null,'limit':_0x1531ca[_0xa5fd('0x16')]?_0x1531ca[_0xa5fd('0x16')][_0xa5fd('0x19')]||null:null,'include':_0x1531ca[_0xa5fd('0x16')]?_0x1531ca[_0xa5fd('0x16')]['include']?_[_0xa5fd('0x1a')](_0x1531ca[_0xa5fd('0x16')]['include'],function(_0xc0b9c3){return{'model':db[_0xc0b9c3[_0xa5fd('0x1b')]],'as':_0xc0b9c3['as'],'attributes':_0xc0b9c3[_0xa5fd('0x18')],'include':_0xc0b9c3[_0xa5fd('0x1c')]?_[_0xa5fd('0x1a')](_0xc0b9c3[_0xa5fd('0x1c')],function(_0xafa0f){return{'model':db[_0xafa0f['model']],'as':_0xafa0f['as'],'attributes':_0xafa0f['attributes'],'include':_0xafa0f[_0xa5fd('0x1c')]?_[_0xa5fd('0x1a')](_0xafa0f[_0xa5fd('0x1c')],function(_0x4db9cd){return{'model':db[_0x4db9cd['model']],'as':_0x4db9cd['as'],'attributes':_0x4db9cd[_0xa5fd('0x18')]};}):[]};}):[]};}):[]:[]})[_0xa5fd('0xb')](function(_0xec5d17){logger[_0xa5fd('0xc')](_0xa5fd('0x1d'),_0x1531ca);logger[_0xa5fd('0xf')](_0xa5fd('0x1d'),_0x1531ca,JSON[_0xa5fd('0x1e')](_0xec5d17));_0x2f871f(_0xec5d17);})[_0xa5fd('0x1f')](function(_0x130b64){logger['error'](_0xa5fd('0x1d'),_0x130b64[_0xa5fd('0x12')],_0x1531ca);_0xc529b8(_0x36e34f[_0xa5fd('0x11')](0x1f4,_0x130b64[_0xa5fd('0x12')]));});});};exports[_0xa5fd('0x20')]=function(_0xac4c14){var _0x5b90e6=this;return new Promise(function(_0x5f04b4,_0x168232){return db[_0xa5fd('0x14')][_0xa5fd('0x21')]({'raw':_0xac4c14[_0xa5fd('0x16')]?_0xac4c14[_0xa5fd('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0xac4c14[_0xa5fd('0x16')]?_0xac4c14[_0xa5fd('0x16')][_0xa5fd('0x17')]||null:null,'attributes':_0xac4c14[_0xa5fd('0x16')]?_0xac4c14[_0xa5fd('0x16')][_0xa5fd('0x18')]||null:null,'include':_0xac4c14[_0xa5fd('0x16')]?_0xac4c14[_0xa5fd('0x16')][_0xa5fd('0x1c')]?_[_0xa5fd('0x1a')](_0xac4c14[_0xa5fd('0x16')]['include'],function(_0x291506){return{'model':db[_0x291506[_0xa5fd('0x1b')]],'as':_0x291506['as'],'attributes':_0x291506[_0xa5fd('0x18')],'include':_0x291506[_0xa5fd('0x1c')]?_[_0xa5fd('0x1a')](_0x291506['include'],function(_0x11f0d2){return{'model':db[_0x11f0d2[_0xa5fd('0x1b')]],'as':_0x11f0d2['as'],'attributes':_0x11f0d2['attributes'],'include':_0x11f0d2[_0xa5fd('0x1c')]?_['map'](_0x11f0d2['include'],function(_0x279649){return{'model':db[_0x279649[_0xa5fd('0x1b')]],'as':_0x279649['as'],'attributes':_0x279649['attributes']};}):[]};}):[]};}):[]:[]})[_0xa5fd('0xb')](function(_0x53e0dc){logger[_0xa5fd('0xc')](_0xa5fd('0x20'),_0xac4c14);logger[_0xa5fd('0xf')]('ShowServicenowAccount',_0xac4c14,JSON[_0xa5fd('0x1e')](_0x53e0dc));_0x5f04b4(_0x53e0dc);})[_0xa5fd('0x1f')](function(_0x153527){logger[_0xa5fd('0x11')](_0xa5fd('0x20'),_0x153527[_0xa5fd('0x12')],_0xac4c14);_0x168232(_0x5b90e6[_0xa5fd('0x11')](0x1f4,_0x153527[_0xa5fd('0x12')]));});});}; \ No newline at end of file +var _0xf9a7=['client','http','then','ServicenowAccount,\x20%s,\x20%s','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','GetServicenowAccount','ServicenowAccount','findAll','options','raw','where','attributes','limit','include','map','model','catch','ShowServicenowAccount','find','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise'];(function(_0x2b338b,_0x4a06ba){var _0x256f66=function(_0x13c9c4){while(--_0x13c9c4){_0x2b338b['push'](_0x2b338b['shift']());}};_0x256f66(++_0x4a06ba);}(_0xf9a7,0x133));var _0x7f9a=function(_0x4ac22c,_0x53e0e9){_0x4ac22c=_0x4ac22c-0x0;var _0x1bfc12=_0xf9a7[_0x4ac22c];return _0x1bfc12;};'use strict';var _=require(_0x7f9a('0x0'));var util=require(_0x7f9a('0x1'));var moment=require(_0x7f9a('0x2'));var BPromise=require(_0x7f9a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7f9a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7f9a('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x7f9a('0x6'));var jayson=require(_0x7f9a('0x7'));var client=jayson[_0x7f9a('0x8')][_0x7f9a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xa9179c,_0x11fce1,_0x31dce9){return new BPromise(function(_0x40f1ec,_0x12962c){return client['request'](_0xa9179c,_0x31dce9)[_0x7f9a('0xa')](function(_0x2e5da7){logger['info'](_0x7f9a('0xb'),_0x11fce1,'request\x20sent');logger[_0x7f9a('0xc')](_0x7f9a('0xd'),_0x11fce1,_0x7f9a('0xe'),JSON[_0x7f9a('0xf')](_0x2e5da7));if(_0x2e5da7[_0x7f9a('0x10')]){if(_0x2e5da7[_0x7f9a('0x10')][_0x7f9a('0x11')]===0x1f4){logger[_0x7f9a('0x10')]('ServicenowAccount,\x20%s,\x20%s',_0x11fce1,_0x2e5da7[_0x7f9a('0x10')][_0x7f9a('0x12')]);return _0x12962c(_0x2e5da7[_0x7f9a('0x10')][_0x7f9a('0x12')]);}logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x11fce1,_0x2e5da7[_0x7f9a('0x10')][_0x7f9a('0x12')]);return _0x40f1ec(_0x2e5da7['error'][_0x7f9a('0x12')]);}else{logger[_0x7f9a('0x13')](_0x7f9a('0xb'),_0x11fce1,'request\x20sent');_0x40f1ec(_0x2e5da7[_0x7f9a('0x14')]['message']);}})['catch'](function(_0x270f9c){logger['error'](_0x7f9a('0xb'),_0x11fce1,_0x270f9c);_0x12962c(_0x270f9c);});});}exports[_0x7f9a('0x15')]=function(_0x7bdf1e){var _0x1af06f=this;return new Promise(function(_0x4970bd,_0x3044d2){return db[_0x7f9a('0x16')][_0x7f9a('0x17')]({'raw':_0x7bdf1e[_0x7f9a('0x18')]?_0x7bdf1e[_0x7f9a('0x18')][_0x7f9a('0x19')]===undefined?!![]:![]:!![],'where':_0x7bdf1e[_0x7f9a('0x18')]?_0x7bdf1e[_0x7f9a('0x18')][_0x7f9a('0x1a')]||null:null,'attributes':_0x7bdf1e[_0x7f9a('0x18')]?_0x7bdf1e[_0x7f9a('0x18')][_0x7f9a('0x1b')]||null:null,'limit':_0x7bdf1e[_0x7f9a('0x18')]?_0x7bdf1e[_0x7f9a('0x18')][_0x7f9a('0x1c')]||null:null,'include':_0x7bdf1e[_0x7f9a('0x18')]?_0x7bdf1e[_0x7f9a('0x18')][_0x7f9a('0x1d')]?_[_0x7f9a('0x1e')](_0x7bdf1e['options'][_0x7f9a('0x1d')],function(_0x54818e){return{'model':db[_0x54818e[_0x7f9a('0x1f')]],'as':_0x54818e['as'],'attributes':_0x54818e[_0x7f9a('0x1b')],'include':_0x54818e[_0x7f9a('0x1d')]?_['map'](_0x54818e[_0x7f9a('0x1d')],function(_0x561be6){return{'model':db[_0x561be6[_0x7f9a('0x1f')]],'as':_0x561be6['as'],'attributes':_0x561be6[_0x7f9a('0x1b')],'include':_0x561be6['include']?_[_0x7f9a('0x1e')](_0x561be6[_0x7f9a('0x1d')],function(_0x261289){return{'model':db[_0x261289[_0x7f9a('0x1f')]],'as':_0x261289['as'],'attributes':_0x261289[_0x7f9a('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2a96d7){logger[_0x7f9a('0x13')]('GetServicenowAccount',_0x7bdf1e);logger['debug'](_0x7f9a('0x15'),_0x7bdf1e,JSON[_0x7f9a('0xf')](_0x2a96d7));_0x4970bd(_0x2a96d7);})[_0x7f9a('0x20')](function(_0xde443f){logger[_0x7f9a('0x10')](_0x7f9a('0x15'),_0xde443f[_0x7f9a('0x12')],_0x7bdf1e);_0x3044d2(_0x1af06f[_0x7f9a('0x10')](0x1f4,_0xde443f[_0x7f9a('0x12')]));});});};exports[_0x7f9a('0x21')]=function(_0x3d48ae){var _0x780020=this;return new Promise(function(_0x48c229,_0x2a2a93){return db[_0x7f9a('0x16')][_0x7f9a('0x22')]({'raw':_0x3d48ae[_0x7f9a('0x18')]?_0x3d48ae[_0x7f9a('0x18')][_0x7f9a('0x19')]===undefined?!![]:![]:!![],'where':_0x3d48ae[_0x7f9a('0x18')]?_0x3d48ae[_0x7f9a('0x18')][_0x7f9a('0x1a')]||null:null,'attributes':_0x3d48ae[_0x7f9a('0x18')]?_0x3d48ae[_0x7f9a('0x18')][_0x7f9a('0x1b')]||null:null,'include':_0x3d48ae[_0x7f9a('0x18')]?_0x3d48ae[_0x7f9a('0x18')][_0x7f9a('0x1d')]?_[_0x7f9a('0x1e')](_0x3d48ae['options'][_0x7f9a('0x1d')],function(_0xa06b11){return{'model':db[_0xa06b11[_0x7f9a('0x1f')]],'as':_0xa06b11['as'],'attributes':_0xa06b11['attributes'],'include':_0xa06b11['include']?_['map'](_0xa06b11[_0x7f9a('0x1d')],function(_0x262d43){return{'model':db[_0x262d43[_0x7f9a('0x1f')]],'as':_0x262d43['as'],'attributes':_0x262d43[_0x7f9a('0x1b')],'include':_0x262d43[_0x7f9a('0x1d')]?_[_0x7f9a('0x1e')](_0x262d43[_0x7f9a('0x1d')],function(_0x37e969){return{'model':db[_0x37e969['model']],'as':_0x37e969['as'],'attributes':_0x37e969[_0x7f9a('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x7f9a('0xa')](function(_0x43cdea){logger[_0x7f9a('0x13')]('ShowServicenowAccount',_0x3d48ae);logger[_0x7f9a('0xc')](_0x7f9a('0x21'),_0x3d48ae,JSON['stringify'](_0x43cdea));_0x48c229(_0x43cdea);})[_0x7f9a('0x20')](function(_0x3a75d5){logger[_0x7f9a('0x10')](_0x7f9a('0x21'),_0x3a75d5['message'],_0x3d48ae);_0x2a2a93(_0x780020[_0x7f9a('0x10')](0x1f4,_0x3a75d5[_0x7f9a('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index a31350e..c62ef69 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 _0xf3a9=['util','path','express','../../components/auth/service','../../config/environment','./intServicenowConfiguration.controller','isAuthenticated','get','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','create','put','delete','/:id','destroy','exports','multer'];(function(_0x4bb7ba,_0x73826e){var _0x1a15c8=function(_0x310e6a){while(--_0x310e6a){_0x4bb7ba['push'](_0x4bb7ba['shift']());}};_0x1a15c8(++_0x73826e);}(_0xf3a9,0x179));var _0x9f3a=function(_0x10fc65,_0x436fcb){_0x10fc65=_0x10fc65-0x0;var _0x58500c=_0xf3a9[_0x10fc65];return _0x58500c;};'use strict';var multer=require(_0x9f3a('0x0'));var util=require(_0x9f3a('0x1'));var path=require(_0x9f3a('0x2'));var timeout=require('connect-timeout');var express=require(_0x9f3a('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9f3a('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9f3a('0x5'));var controller=require(_0x9f3a('0x6'));router['get']('/',auth[_0x9f3a('0x7')](),controller['index']);router[_0x9f3a('0x8')]('/:id',auth[_0x9f3a('0x7')](),controller[_0x9f3a('0x9')]);router['get'](_0x9f3a('0xa'),auth[_0x9f3a('0x7')](),controller[_0x9f3a('0xb')]);router[_0x9f3a('0x8')](_0x9f3a('0xc'),auth[_0x9f3a('0x7')](),controller[_0x9f3a('0xd')]);router[_0x9f3a('0x8')](_0x9f3a('0xe'),auth['isAuthenticated'](),controller['getDescriptions']);router['post']('/',auth[_0x9f3a('0x7')](),controller[_0x9f3a('0xf')]);router[_0x9f3a('0x10')]('/:id',auth[_0x9f3a('0x7')](),controller['update']);router[_0x9f3a('0x11')](_0x9f3a('0x12'),auth[_0x9f3a('0x7')](),controller[_0x9f3a('0x13')]);module[_0x9f3a('0x14')]=router; \ No newline at end of file +var _0xf039=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','isAuthenticated','index','get','show','/:id/fields','getFields','/:id/descriptions','post','create','put','/:id','delete','destroy','multer','util','connect-timeout'];(function(_0x532a63,_0x1aeb4d){var _0x2af63e=function(_0x121d61){while(--_0x121d61){_0x532a63['push'](_0x532a63['shift']());}};_0x2af63e(++_0x1aeb4d);}(_0xf039,0x184));var _0x9f03=function(_0x361e80,_0x21c8dd){_0x361e80=_0x361e80-0x0;var _0x3c2f1f=_0xf039[_0x361e80];return _0x3c2f1f;};'use strict';var multer=require(_0x9f03('0x0'));var util=require(_0x9f03('0x1'));var path=require('path');var timeout=require(_0x9f03('0x2'));var express=require(_0x9f03('0x3'));var router=express[_0x9f03('0x4')]();var fs_extra=require(_0x9f03('0x5'));var auth=require(_0x9f03('0x6'));var interaction=require(_0x9f03('0x7'));var config=require(_0x9f03('0x8'));var controller=require(_0x9f03('0x9'));router['get']('/',auth[_0x9f03('0xa')](),controller[_0x9f03('0xb')]);router[_0x9f03('0xc')]('/:id',auth[_0x9f03('0xa')](),controller[_0x9f03('0xd')]);router[_0x9f03('0xc')](_0x9f03('0xe'),auth[_0x9f03('0xa')](),controller[_0x9f03('0xf')]);router[_0x9f03('0xc')]('/:id/subjects',auth[_0x9f03('0xa')](),controller['getSubjects']);router[_0x9f03('0xc')](_0x9f03('0x10'),auth[_0x9f03('0xa')](),controller['getDescriptions']);router[_0x9f03('0x11')]('/',auth[_0x9f03('0xa')](),controller[_0x9f03('0x12')]);router[_0x9f03('0x13')](_0x9f03('0x14'),auth[_0x9f03('0xa')](),controller['update']);router[_0x9f03('0x15')](_0x9f03('0x14'),auth[_0x9f03('0xa')](),controller[_0x9f03('0x16')]);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 68ca631..9871ff3 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 _0xb151=['STRING','sequelize','exports'];(function(_0x216e93,_0x3d7f90){var _0x365df6=function(_0x26f779){while(--_0x26f779){_0x216e93['push'](_0x216e93['shift']());}};_0x365df6(++_0x3d7f90);}(_0xb151,0x154));var _0x1b15=function(_0x11fb84,_0x4cfe51){_0x11fb84=_0x11fb84-0x0;var _0x47f3de=_0xb151[_0x11fb84];return _0x47f3de;};'use strict';var Sequelize=require(_0x1b15('0x0'));module[_0x1b15('0x1')]={'name':{'type':Sequelize[_0x1b15('0x2')]},'description':{'type':Sequelize[_0x1b15('0x2')]}}; \ No newline at end of file +var _0x3aa1=['exports','STRING','sequelize'];(function(_0x237bd5,_0x5001da){var _0x255003=function(_0x4dfa5b){while(--_0x4dfa5b){_0x237bd5['push'](_0x237bd5['shift']());}};_0x255003(++_0x5001da);}(_0x3aa1,0x19a));var _0x13aa=function(_0x4cf088,_0x1694ab){_0x4cf088=_0x4cf088-0x0;var _0x58b4ec=_0x3aa1[_0x4cf088];return _0x58b4ec;};'use strict';var Sequelize=require(_0x13aa('0x0'));module[_0x13aa('0x1')]={'name':{'type':Sequelize[_0x13aa('0x2')]},'description':{'type':Sequelize[_0x13aa('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index e9f56ea..bd17745 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 _0x75a7=['update','destroy','error','stack','name','send','index','map','ServicenowConfiguration','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','then','include','findAll','params','includeAll','find','catch','create','body','getFields','findOne','ServicenowField','pick','getSubjects','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x481f86,_0x4c3961){var _0x3ed4ef=function(_0x51afa1){while(--_0x51afa1){_0x481f86['push'](_0x481f86['shift']());}};_0x3ed4ef(++_0x4c3961);}(_0x75a7,0x117));var _0x775a=function(_0x2b6171,_0x46ea96){_0x2b6171=_0x2b6171-0x0;var _0x55ba2f=_0x75a7[_0x2b6171];return _0x55ba2f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x775a('0x0'));var zipdir=require(_0x775a('0x1'));var jsonpatch=require(_0x775a('0x2'));var rp=require(_0x775a('0x3'));var moment=require(_0x775a('0x4'));var BPromise=require(_0x775a('0x5'));var Mustache=require(_0x775a('0x6'));var util=require(_0x775a('0x7'));var path=require(_0x775a('0x8'));var sox=require('sox');var csv=require(_0x775a('0x9'));var ejs=require(_0x775a('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x775a('0xb'));var crypto=require(_0x775a('0xc'));var jsforce=require(_0x775a('0xd'));var deskjs=require(_0x775a('0xe'));var toCsv=require(_0x775a('0x9'));var querystring=require(_0x775a('0xf'));var Papa=require(_0x775a('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x775a('0x11'));var as=require(_0x775a('0x12'));var hardwareService=require(_0x775a('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x775a('0x14'));var config=require(_0x775a('0x15'));var licenseUtil=require(_0x775a('0x16'));var db=require(_0x775a('0x17'))['db'];function respondWithStatusCode(_0x554c59,_0x4992dd){_0x4992dd=_0x4992dd||0xcc;return function(_0x3c15a3){if(_0x3c15a3){return _0x554c59[_0x775a('0x18')](_0x4992dd);}return _0x554c59[_0x775a('0x19')](_0x4992dd)[_0x775a('0x1a')]();};}function respondWithResult(_0x4302cf,_0x499c52){_0x499c52=_0x499c52||0xc8;return function(_0x163b5f){if(_0x163b5f){return _0x4302cf[_0x775a('0x19')](_0x499c52)[_0x775a('0x1b')](_0x163b5f);}};}function respondWithFilteredResult(_0x175f9b,_0x42002e){return function(_0x29fc23){if(_0x29fc23){var _0x36f77d=typeof _0x42002e[_0x775a('0x1c')]===_0x775a('0x1d')&&typeof _0x42002e[_0x775a('0x1e')]===_0x775a('0x1d');var _0x493bff=_0x29fc23['count'];var _0x25711c=_0x36f77d?0x0:_0x42002e[_0x775a('0x1c')];var _0x1f324b=_0x36f77d?_0x29fc23[_0x775a('0x1f')]:_0x42002e[_0x775a('0x1c')]+_0x42002e[_0x775a('0x1e')];var _0x22524d;if(_0x1f324b>=_0x493bff){_0x1f324b=_0x493bff;_0x22524d=0xc8;}else{_0x22524d=0xce;}_0x175f9b[_0x775a('0x19')](_0x22524d);return _0x175f9b[_0x775a('0x20')](_0x775a('0x21'),_0x25711c+'-'+_0x1f324b+'/'+_0x493bff)[_0x775a('0x1b')](_0x29fc23);}return null;};}function patchUpdates(_0x5a7edd){return function(_0x483b8b){try{jsonpatch[_0x775a('0x22')](_0x483b8b,_0x5a7edd,!![]);}catch(_0x2dfef3){return BPromise[_0x775a('0x23')](_0x2dfef3);}return _0x483b8b[_0x775a('0x24')]();};}function saveUpdates(_0x4182f4,_0x156445){return function(_0x51bc8b){if(_0x51bc8b){return _0x51bc8b[_0x775a('0x25')](_0x4182f4)['then'](function(_0x98c670){return _0x98c670;});}return null;};}function removeEntity(_0x11844d,_0x490347){return function(_0x31397c){if(_0x31397c){return _0x31397c[_0x775a('0x26')]()['then'](function(){_0x11844d[_0x775a('0x19')](0xcc)[_0x775a('0x1a')]();});}};}function handleEntityNotFound(_0x1df1ec,_0x21b193){return function(_0x3952c4){if(!_0x3952c4){_0x1df1ec[_0x775a('0x18')](0x194);}return _0x3952c4;};}function handleError(_0x176f44,_0x2993ab){_0x2993ab=_0x2993ab||0x1f4;return function(_0x579604){logger[_0x775a('0x27')](_0x579604[_0x775a('0x28')]);if(_0x579604[_0x775a('0x29')]){delete _0x579604['name'];}_0x176f44['status'](_0x2993ab)[_0x775a('0x2a')](_0x579604);};}exports[_0x775a('0x2b')]=function(_0x5c2231,_0x3ed86c){var _0x15e029={},_0x4cce05={},_0xc9eea0={'count':0x0,'rows':[]};var _0x2d7ec1=_[_0x775a('0x2c')](db[_0x775a('0x2d')][_0x775a('0x2e')],function(_0x48107b){return{'name':_0x48107b['fieldName'],'type':_0x48107b[_0x775a('0x2f')][_0x775a('0x30')]};});_0x4cce05[_0x775a('0x31')]=_[_0x775a('0x2c')](_0x2d7ec1,_0x775a('0x29'));_0x4cce05[_0x775a('0x32')]=_[_0x775a('0x33')](_0x5c2231[_0x775a('0x32')]);_0x4cce05[_0x775a('0x34')]=_[_0x775a('0x35')](_0x4cce05['model'],_0x4cce05['query']);_0x15e029['attributes']=_[_0x775a('0x35')](_0x4cce05['model'],qs[_0x775a('0x36')](_0x5c2231[_0x775a('0x32')][_0x775a('0x36')]));_0x15e029[_0x775a('0x37')]=_0x15e029['attributes'][_0x775a('0x38')]?_0x15e029[_0x775a('0x37')]:_0x4cce05[_0x775a('0x31')];if(!_0x5c2231[_0x775a('0x32')][_0x775a('0x39')](_0x775a('0x3a'))){_0x15e029[_0x775a('0x1e')]=qs[_0x775a('0x1e')](_0x5c2231[_0x775a('0x32')]['limit']);_0x15e029[_0x775a('0x1c')]=qs[_0x775a('0x1c')](_0x5c2231[_0x775a('0x32')][_0x775a('0x1c')]);}_0x15e029[_0x775a('0x3b')]=qs[_0x775a('0x3c')](_0x5c2231[_0x775a('0x32')]['sort']);_0x15e029['where']=qs['filters'](_['pick'](_0x5c2231[_0x775a('0x32')],_0x4cce05[_0x775a('0x34')]),_0x2d7ec1);if(_0x5c2231[_0x775a('0x32')][_0x775a('0x3d')]){_0x15e029[_0x775a('0x3e')]=_[_0x775a('0x3f')](_0x15e029['where'],{'$or':_[_0x775a('0x2c')](_0x2d7ec1,function(_0x563611){if(_0x563611['type']!=='VIRTUAL'){var _0x294af1={};_0x294af1[_0x563611[_0x775a('0x29')]]={'$like':'%'+_0x5c2231[_0x775a('0x32')][_0x775a('0x3d')]+'%'};return _0x294af1;}})});}_0x15e029=_[_0x775a('0x3f')]({},_0x15e029,_0x5c2231[_0x775a('0x40')]);var _0x2550f2={'where':_0x15e029[_0x775a('0x3e')]};return db[_0x775a('0x2d')]['count'](_0x2550f2)[_0x775a('0x41')](function(_0xb3fa79){_0xc9eea0[_0x775a('0x1f')]=_0xb3fa79;if(_0x5c2231[_0x775a('0x32')]['includeAll']){_0x15e029[_0x775a('0x42')]=[{'all':!![]}];}return db[_0x775a('0x2d')][_0x775a('0x43')](_0x15e029);})['then'](function(_0x283554){_0xc9eea0['rows']=_0x283554;return _0xc9eea0;})[_0x775a('0x41')](respondWithFilteredResult(_0x3ed86c,_0x15e029))['catch'](handleError(_0x3ed86c,null));};exports['show']=function(_0x1463ca,_0x41a5bf){var _0x52d38a={'raw':![],'where':{'id':_0x1463ca[_0x775a('0x44')]['id']}},_0x1941f8={};_0x1941f8['model']=_[_0x775a('0x33')](db[_0x775a('0x2d')][_0x775a('0x2e')]);_0x1941f8[_0x775a('0x32')]=_[_0x775a('0x33')](_0x1463ca[_0x775a('0x32')]);_0x1941f8[_0x775a('0x34')]=_[_0x775a('0x35')](_0x1941f8[_0x775a('0x31')],_0x1941f8[_0x775a('0x32')]);_0x52d38a[_0x775a('0x37')]=_[_0x775a('0x35')](_0x1941f8['model'],qs['fields'](_0x1463ca['query'][_0x775a('0x36')]));_0x52d38a[_0x775a('0x37')]=_0x52d38a[_0x775a('0x37')][_0x775a('0x38')]?_0x52d38a[_0x775a('0x37')]:_0x1941f8[_0x775a('0x31')];if(_0x1463ca[_0x775a('0x32')][_0x775a('0x45')]){_0x52d38a[_0x775a('0x42')]=[{'all':!![]}];}_0x52d38a=_[_0x775a('0x3f')]({},_0x52d38a,_0x1463ca[_0x775a('0x40')]);return db['ServicenowConfiguration'][_0x775a('0x46')](_0x52d38a)[_0x775a('0x41')](handleEntityNotFound(_0x41a5bf,null))[_0x775a('0x41')](respondWithResult(_0x41a5bf,null))[_0x775a('0x47')](handleError(_0x41a5bf,null));};exports[_0x775a('0x48')]=function(_0x1aaced,_0x5122de){return db[_0x775a('0x2d')][_0x775a('0x48')](_0x1aaced['body'],{})[_0x775a('0x41')](respondWithResult(_0x5122de,0xc9))['catch'](handleError(_0x5122de,null));};exports[_0x775a('0x25')]=function(_0x45d58b,_0x81d894){if(_0x45d58b[_0x775a('0x49')]['id']){delete _0x45d58b[_0x775a('0x49')]['id'];}return db[_0x775a('0x2d')][_0x775a('0x46')]({'where':{'id':_0x45d58b[_0x775a('0x44')]['id']}})[_0x775a('0x41')](handleEntityNotFound(_0x81d894,null))[_0x775a('0x41')](saveUpdates(_0x45d58b[_0x775a('0x49')],null))[_0x775a('0x41')](respondWithResult(_0x81d894,null))['catch'](handleError(_0x81d894,null));};exports['destroy']=function(_0x42b91c,_0x51d68d){return db[_0x775a('0x2d')][_0x775a('0x46')]({'where':{'id':_0x42b91c['params']['id']}})[_0x775a('0x41')](handleEntityNotFound(_0x51d68d,null))[_0x775a('0x41')](removeEntity(_0x51d68d,null))['catch'](handleError(_0x51d68d,null));};exports[_0x775a('0x4a')]=function(_0x411219,_0x449d46,_0x55888c){var _0xcf9d36={};var _0x285a49={};var _0x3610dc;var _0x2486a6;return db['ServicenowConfiguration'][_0x775a('0x4b')]({'where':{'id':_0x411219['params']['id']}})['then'](handleEntityNotFound(_0x449d46,null))[_0x775a('0x41')](function(_0x171da9){if(_0x171da9){_0x3610dc=_0x171da9;_0x285a49[_0x775a('0x31')]=_[_0x775a('0x33')](db[_0x775a('0x4c')]['rawAttributes']);_0x285a49[_0x775a('0x32')]=_[_0x775a('0x33')](_0x411219[_0x775a('0x32')]);_0x285a49[_0x775a('0x34')]=_[_0x775a('0x35')](_0x285a49[_0x775a('0x31')],_0x285a49[_0x775a('0x32')]);_0xcf9d36['attributes']=_['intersection'](_0x285a49[_0x775a('0x31')],qs[_0x775a('0x36')](_0x411219[_0x775a('0x32')][_0x775a('0x36')]));_0xcf9d36['attributes']=_0xcf9d36[_0x775a('0x37')][_0x775a('0x38')]?_0xcf9d36[_0x775a('0x37')]:_0x285a49[_0x775a('0x31')];_0xcf9d36[_0x775a('0x3b')]=qs[_0x775a('0x3c')](_0x411219['query']['sort']);_0xcf9d36[_0x775a('0x3e')]=qs[_0x775a('0x34')](_[_0x775a('0x4d')](_0x411219[_0x775a('0x32')],_0x285a49[_0x775a('0x34')]));if(_0x411219[_0x775a('0x32')][_0x775a('0x3d')]){_0xcf9d36[_0x775a('0x3e')]=_['merge'](_0xcf9d36[_0x775a('0x3e')],{'$or':_[_0x775a('0x2c')](_0xcf9d36['attributes'],function(_0x249e76){var _0xf86735={};_0xf86735[_0x249e76]={'$like':'%'+_0x411219[_0x775a('0x32')]['filter']+'%'};return _0xf86735;})});}_0xcf9d36=_['merge']({},_0xcf9d36,_0x411219[_0x775a('0x40')]);return _0x3610dc[_0x775a('0x4a')](_0xcf9d36);}})[_0x775a('0x41')](function(_0x59590c){if(_0x59590c){_0x2486a6=_0x59590c[_0x775a('0x38')];if(!_0x411219[_0x775a('0x32')][_0x775a('0x39')](_0x775a('0x3a'))){_0xcf9d36[_0x775a('0x1e')]=qs[_0x775a('0x1e')](_0x411219[_0x775a('0x32')][_0x775a('0x1e')]);_0xcf9d36[_0x775a('0x1c')]=qs[_0x775a('0x1c')](_0x411219[_0x775a('0x32')][_0x775a('0x1c')]);}return _0x3610dc[_0x775a('0x4a')](_0xcf9d36);}})[_0x775a('0x41')](function(_0x370b1e){if(_0x370b1e){return _0x370b1e?{'count':_0x2486a6,'rows':_0x370b1e}:null;}})[_0x775a('0x41')](respondWithResult(_0x449d46,null))[_0x775a('0x47')](handleError(_0x449d46,null));};exports[_0x775a('0x4e')]=function(_0x26a3b8,_0x365254,_0x2fe916){var _0x87894={};var _0x4f8815={};var _0x4cf5e4;var _0x362f95;return db[_0x775a('0x2d')][_0x775a('0x4b')]({'where':{'id':_0x26a3b8[_0x775a('0x44')]['id']}})[_0x775a('0x41')](handleEntityNotFound(_0x365254,null))[_0x775a('0x41')](function(_0x3b4ae5){if(_0x3b4ae5){_0x4cf5e4=_0x3b4ae5;_0x4f8815['model']=_[_0x775a('0x33')](db[_0x775a('0x4c')][_0x775a('0x2e')]);_0x4f8815[_0x775a('0x32')]=_['keys'](_0x26a3b8[_0x775a('0x32')]);_0x4f8815[_0x775a('0x34')]=_[_0x775a('0x35')](_0x4f8815[_0x775a('0x31')],_0x4f8815[_0x775a('0x32')]);_0x87894['attributes']=_[_0x775a('0x35')](_0x4f8815[_0x775a('0x31')],qs[_0x775a('0x36')](_0x26a3b8[_0x775a('0x32')][_0x775a('0x36')]));_0x87894[_0x775a('0x37')]=_0x87894[_0x775a('0x37')][_0x775a('0x38')]?_0x87894['attributes']:_0x4f8815[_0x775a('0x31')];_0x87894[_0x775a('0x3b')]=qs['sort'](_0x26a3b8[_0x775a('0x32')][_0x775a('0x3c')]);_0x87894[_0x775a('0x3e')]=qs['filters'](_[_0x775a('0x4d')](_0x26a3b8[_0x775a('0x32')],_0x4f8815[_0x775a('0x34')]));if(_0x26a3b8[_0x775a('0x32')]['filter']){_0x87894[_0x775a('0x3e')]=_[_0x775a('0x3f')](_0x87894['where'],{'$or':_[_0x775a('0x2c')](_0x87894['attributes'],function(_0x15a83f){var _0x2f4eaf={};_0x2f4eaf[_0x15a83f]={'$like':'%'+_0x26a3b8[_0x775a('0x32')][_0x775a('0x3d')]+'%'};return _0x2f4eaf;})});}_0x87894=_[_0x775a('0x3f')]({},_0x87894,_0x26a3b8[_0x775a('0x40')]);return _0x4cf5e4[_0x775a('0x4e')](_0x87894);}})[_0x775a('0x41')](function(_0x431b30){if(_0x431b30){_0x362f95=_0x431b30['length'];if(!_0x26a3b8[_0x775a('0x32')][_0x775a('0x39')](_0x775a('0x3a'))){_0x87894['limit']=qs[_0x775a('0x1e')](_0x26a3b8[_0x775a('0x32')]['limit']);_0x87894[_0x775a('0x1c')]=qs[_0x775a('0x1c')](_0x26a3b8[_0x775a('0x32')][_0x775a('0x1c')]);}return _0x4cf5e4[_0x775a('0x4e')](_0x87894);}})['then'](function(_0x3cb89f){if(_0x3cb89f){return _0x3cb89f?{'count':_0x362f95,'rows':_0x3cb89f}:null;}})['then'](respondWithResult(_0x365254,null))[_0x775a('0x47')](handleError(_0x365254,null));};exports['getDescriptions']=function(_0x14eb42,_0x1e06c4,_0x40c0d4){var _0x21e471={};var _0x119be0={};var _0x1133be;var _0x10b2f5;return db[_0x775a('0x2d')][_0x775a('0x4b')]({'where':{'id':_0x14eb42[_0x775a('0x44')]['id']}})['then'](handleEntityNotFound(_0x1e06c4,null))[_0x775a('0x41')](function(_0x2c1b1d){if(_0x2c1b1d){_0x1133be=_0x2c1b1d;_0x119be0[_0x775a('0x31')]=_['keys'](db['ServicenowField'][_0x775a('0x2e')]);_0x119be0['query']=_[_0x775a('0x33')](_0x14eb42['query']);_0x119be0[_0x775a('0x34')]=_['intersection'](_0x119be0[_0x775a('0x31')],_0x119be0['query']);_0x21e471[_0x775a('0x37')]=_[_0x775a('0x35')](_0x119be0[_0x775a('0x31')],qs[_0x775a('0x36')](_0x14eb42[_0x775a('0x32')][_0x775a('0x36')]));_0x21e471['attributes']=_0x21e471[_0x775a('0x37')][_0x775a('0x38')]?_0x21e471[_0x775a('0x37')]:_0x119be0['model'];_0x21e471[_0x775a('0x3b')]=qs[_0x775a('0x3c')](_0x14eb42[_0x775a('0x32')][_0x775a('0x3c')]);_0x21e471['where']=qs[_0x775a('0x34')](_[_0x775a('0x4d')](_0x14eb42[_0x775a('0x32')],_0x119be0[_0x775a('0x34')]));if(_0x14eb42[_0x775a('0x32')]['filter']){_0x21e471[_0x775a('0x3e')]=_[_0x775a('0x3f')](_0x21e471['where'],{'$or':_['map'](_0x21e471['attributes'],function(_0x46b975){var _0x305b4f={};_0x305b4f[_0x46b975]={'$like':'%'+_0x14eb42['query'][_0x775a('0x3d')]+'%'};return _0x305b4f;})});}_0x21e471=_[_0x775a('0x3f')]({},_0x21e471,_0x14eb42[_0x775a('0x40')]);return _0x1133be['getDescriptions'](_0x21e471);}})[_0x775a('0x41')](function(_0x2f6b4a){if(_0x2f6b4a){_0x10b2f5=_0x2f6b4a[_0x775a('0x38')];if(!_0x14eb42[_0x775a('0x32')][_0x775a('0x39')]('nolimit')){_0x21e471[_0x775a('0x1e')]=qs[_0x775a('0x1e')](_0x14eb42[_0x775a('0x32')][_0x775a('0x1e')]);_0x21e471[_0x775a('0x1c')]=qs[_0x775a('0x1c')](_0x14eb42['query'][_0x775a('0x1c')]);}return _0x1133be['getDescriptions'](_0x21e471);}})[_0x775a('0x41')](function(_0x47b095){if(_0x47b095){return _0x47b095?{'count':_0x10b2f5,'rows':_0x47b095}:null;}})[_0x775a('0x41')](respondWithResult(_0x1e06c4,null))[_0x775a('0x47')](handleError(_0x1e06c4,null));}; \ No newline at end of file +var _0x2985=['getFields','findOne','ServicenowField','getSubjects','hasOwnProperty','getDescriptions','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','error','name','send','index','map','ServicenowConfiguration','rawAttributes','fieldName','type','key','keys','filters','model','query','intersection','fields','attributes','length','nolimit','order','sort','where','pick','merge','filter','options','count','includeAll','include','findAll','rows','catch','show','params','create','body','find'];(function(_0x3c4a7c,_0x2f4e3c){var _0xf13d1e=function(_0x24cb78){while(--_0x24cb78){_0x3c4a7c['push'](_0x3c4a7c['shift']());}};_0xf13d1e(++_0x2f4e3c);}(_0x2985,0x1e6));var _0x5298=function(_0x6c1114,_0x89c758){_0x6c1114=_0x6c1114-0x0;var _0x5107b1=_0x2985[_0x6c1114];return _0x5107b1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5298('0x0'));var zipdir=require(_0x5298('0x1'));var jsonpatch=require(_0x5298('0x2'));var rp=require('request-promise');var moment=require(_0x5298('0x3'));var BPromise=require(_0x5298('0x4'));var Mustache=require(_0x5298('0x5'));var util=require(_0x5298('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x5298('0x7'));var ejs=require(_0x5298('0x8'));var fs=require('fs');var fs_extra=require(_0x5298('0x9'));var _=require(_0x5298('0xa'));var squel=require(_0x5298('0xb'));var crypto=require(_0x5298('0xc'));var jsforce=require(_0x5298('0xd'));var deskjs=require(_0x5298('0xe'));var toCsv=require(_0x5298('0x7'));var querystring=require('querystring');var Papa=require(_0x5298('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5298('0x10'));var hardwareService=require(_0x5298('0x11'));var logger=require(_0x5298('0x12'))(_0x5298('0x13'));var utils=require(_0x5298('0x14'));var config=require(_0x5298('0x15'));var licenseUtil=require(_0x5298('0x16'));var db=require(_0x5298('0x17'))['db'];function respondWithStatusCode(_0x5ea00e,_0x18a5ff){_0x18a5ff=_0x18a5ff||0xcc;return function(_0x1d5815){if(_0x1d5815){return _0x5ea00e[_0x5298('0x18')](_0x18a5ff);}return _0x5ea00e[_0x5298('0x19')](_0x18a5ff)[_0x5298('0x1a')]();};}function respondWithResult(_0x64d90a,_0x45147c){_0x45147c=_0x45147c||0xc8;return function(_0x4d1814){if(_0x4d1814){return _0x64d90a[_0x5298('0x19')](_0x45147c)[_0x5298('0x1b')](_0x4d1814);}};}function respondWithFilteredResult(_0x38e9c6,_0x3cf589){return function(_0x2f052b){if(_0x2f052b){var _0x17b55e=typeof _0x3cf589[_0x5298('0x1c')]===_0x5298('0x1d')&&typeof _0x3cf589[_0x5298('0x1e')]==='undefined';var _0xdf52ff=_0x2f052b['count'];var _0xb5f2f=_0x17b55e?0x0:_0x3cf589['offset'];var _0x51c442=_0x17b55e?_0x2f052b['count']:_0x3cf589['offset']+_0x3cf589[_0x5298('0x1e')];var _0x30f724;if(_0x51c442>=_0xdf52ff){_0x51c442=_0xdf52ff;_0x30f724=0xc8;}else{_0x30f724=0xce;}_0x38e9c6[_0x5298('0x19')](_0x30f724);return _0x38e9c6[_0x5298('0x1f')](_0x5298('0x20'),_0xb5f2f+'-'+_0x51c442+'/'+_0xdf52ff)[_0x5298('0x1b')](_0x2f052b);}return null;};}function patchUpdates(_0x33959e){return function(_0x52f5e8){try{jsonpatch[_0x5298('0x21')](_0x52f5e8,_0x33959e,!![]);}catch(_0x1d8ced){return BPromise['reject'](_0x1d8ced);}return _0x52f5e8[_0x5298('0x22')]();};}function saveUpdates(_0x37eeaf,_0x2736ea){return function(_0x68777f){if(_0x68777f){return _0x68777f[_0x5298('0x23')](_0x37eeaf)['then'](function(_0x50d527){return _0x50d527;});}return null;};}function removeEntity(_0x4aa7dd,_0x1c1df6){return function(_0x28dbfb){if(_0x28dbfb){return _0x28dbfb['destroy']()[_0x5298('0x24')](function(){_0x4aa7dd['status'](0xcc)[_0x5298('0x1a')]();});}};}function handleEntityNotFound(_0x4031f0,_0x17f899){return function(_0x1e050c){if(!_0x1e050c){_0x4031f0[_0x5298('0x18')](0x194);}return _0x1e050c;};}function handleError(_0x4ffa37,_0x488c27){_0x488c27=_0x488c27||0x1f4;return function(_0x2844dc){logger[_0x5298('0x25')](_0x2844dc['stack']);if(_0x2844dc['name']){delete _0x2844dc[_0x5298('0x26')];}_0x4ffa37[_0x5298('0x19')](_0x488c27)[_0x5298('0x27')](_0x2844dc);};}exports[_0x5298('0x28')]=function(_0xac0ebd,_0x45d354){var _0x401429={},_0x5cfa9b={},_0x5bddd4={'count':0x0,'rows':[]};var _0x44214c=_[_0x5298('0x29')](db[_0x5298('0x2a')][_0x5298('0x2b')],function(_0x41c950){return{'name':_0x41c950[_0x5298('0x2c')],'type':_0x41c950[_0x5298('0x2d')][_0x5298('0x2e')]};});_0x5cfa9b['model']=_[_0x5298('0x29')](_0x44214c,_0x5298('0x26'));_0x5cfa9b['query']=_[_0x5298('0x2f')](_0xac0ebd['query']);_0x5cfa9b[_0x5298('0x30')]=_['intersection'](_0x5cfa9b[_0x5298('0x31')],_0x5cfa9b[_0x5298('0x32')]);_0x401429['attributes']=_[_0x5298('0x33')](_0x5cfa9b[_0x5298('0x31')],qs[_0x5298('0x34')](_0xac0ebd['query'][_0x5298('0x34')]));_0x401429[_0x5298('0x35')]=_0x401429[_0x5298('0x35')][_0x5298('0x36')]?_0x401429[_0x5298('0x35')]:_0x5cfa9b[_0x5298('0x31')];if(!_0xac0ebd[_0x5298('0x32')]['hasOwnProperty'](_0x5298('0x37'))){_0x401429[_0x5298('0x1e')]=qs[_0x5298('0x1e')](_0xac0ebd[_0x5298('0x32')]['limit']);_0x401429[_0x5298('0x1c')]=qs[_0x5298('0x1c')](_0xac0ebd[_0x5298('0x32')][_0x5298('0x1c')]);}_0x401429[_0x5298('0x38')]=qs[_0x5298('0x39')](_0xac0ebd[_0x5298('0x32')][_0x5298('0x39')]);_0x401429[_0x5298('0x3a')]=qs['filters'](_[_0x5298('0x3b')](_0xac0ebd[_0x5298('0x32')],_0x5cfa9b[_0x5298('0x30')]),_0x44214c);if(_0xac0ebd[_0x5298('0x32')]['filter']){_0x401429[_0x5298('0x3a')]=_[_0x5298('0x3c')](_0x401429[_0x5298('0x3a')],{'$or':_[_0x5298('0x29')](_0x44214c,function(_0x197c43){if(_0x197c43[_0x5298('0x2d')]!=='VIRTUAL'){var _0x3f2734={};_0x3f2734[_0x197c43[_0x5298('0x26')]]={'$like':'%'+_0xac0ebd['query'][_0x5298('0x3d')]+'%'};return _0x3f2734;}})});}_0x401429=_['merge']({},_0x401429,_0xac0ebd[_0x5298('0x3e')]);var _0x1c5b00={'where':_0x401429[_0x5298('0x3a')]};return db[_0x5298('0x2a')][_0x5298('0x3f')](_0x1c5b00)[_0x5298('0x24')](function(_0x5844d0){_0x5bddd4['count']=_0x5844d0;if(_0xac0ebd[_0x5298('0x32')][_0x5298('0x40')]){_0x401429[_0x5298('0x41')]=[{'all':!![]}];}return db['ServicenowConfiguration'][_0x5298('0x42')](_0x401429);})[_0x5298('0x24')](function(_0x34b417){_0x5bddd4[_0x5298('0x43')]=_0x34b417;return _0x5bddd4;})[_0x5298('0x24')](respondWithFilteredResult(_0x45d354,_0x401429))[_0x5298('0x44')](handleError(_0x45d354,null));};exports[_0x5298('0x45')]=function(_0x546f8e,_0x167cc6){var _0x4280e1={'raw':![],'where':{'id':_0x546f8e[_0x5298('0x46')]['id']}},_0xec8822={};_0xec8822['model']=_[_0x5298('0x2f')](db[_0x5298('0x2a')]['rawAttributes']);_0xec8822[_0x5298('0x32')]=_['keys'](_0x546f8e[_0x5298('0x32')]);_0xec8822[_0x5298('0x30')]=_[_0x5298('0x33')](_0xec8822[_0x5298('0x31')],_0xec8822['query']);_0x4280e1[_0x5298('0x35')]=_[_0x5298('0x33')](_0xec8822[_0x5298('0x31')],qs[_0x5298('0x34')](_0x546f8e[_0x5298('0x32')][_0x5298('0x34')]));_0x4280e1[_0x5298('0x35')]=_0x4280e1[_0x5298('0x35')][_0x5298('0x36')]?_0x4280e1[_0x5298('0x35')]:_0xec8822['model'];if(_0x546f8e[_0x5298('0x32')]['includeAll']){_0x4280e1[_0x5298('0x41')]=[{'all':!![]}];}_0x4280e1=_['merge']({},_0x4280e1,_0x546f8e['options']);return db['ServicenowConfiguration']['find'](_0x4280e1)[_0x5298('0x24')](handleEntityNotFound(_0x167cc6,null))['then'](respondWithResult(_0x167cc6,null))[_0x5298('0x44')](handleError(_0x167cc6,null));};exports[_0x5298('0x47')]=function(_0x2bc510,_0x25576d){return db[_0x5298('0x2a')][_0x5298('0x47')](_0x2bc510['body'],{})[_0x5298('0x24')](respondWithResult(_0x25576d,0xc9))[_0x5298('0x44')](handleError(_0x25576d,null));};exports['update']=function(_0x53aa97,_0x356c0f){if(_0x53aa97[_0x5298('0x48')]['id']){delete _0x53aa97[_0x5298('0x48')]['id'];}return db[_0x5298('0x2a')][_0x5298('0x49')]({'where':{'id':_0x53aa97['params']['id']}})[_0x5298('0x24')](handleEntityNotFound(_0x356c0f,null))[_0x5298('0x24')](saveUpdates(_0x53aa97[_0x5298('0x48')],null))[_0x5298('0x24')](respondWithResult(_0x356c0f,null))[_0x5298('0x44')](handleError(_0x356c0f,null));};exports['destroy']=function(_0x391d2d,_0x187223){return db[_0x5298('0x2a')][_0x5298('0x49')]({'where':{'id':_0x391d2d[_0x5298('0x46')]['id']}})[_0x5298('0x24')](handleEntityNotFound(_0x187223,null))[_0x5298('0x24')](removeEntity(_0x187223,null))[_0x5298('0x44')](handleError(_0x187223,null));};exports[_0x5298('0x4a')]=function(_0x4cac06,_0x446dbc,_0x355209){var _0x5ea35a={};var _0x29d66e={};var _0xd96827;var _0x13c777;return db['ServicenowConfiguration'][_0x5298('0x4b')]({'where':{'id':_0x4cac06[_0x5298('0x46')]['id']}})[_0x5298('0x24')](handleEntityNotFound(_0x446dbc,null))['then'](function(_0x22ebab){if(_0x22ebab){_0xd96827=_0x22ebab;_0x29d66e[_0x5298('0x31')]=_[_0x5298('0x2f')](db[_0x5298('0x4c')][_0x5298('0x2b')]);_0x29d66e[_0x5298('0x32')]=_[_0x5298('0x2f')](_0x4cac06[_0x5298('0x32')]);_0x29d66e['filters']=_['intersection'](_0x29d66e[_0x5298('0x31')],_0x29d66e[_0x5298('0x32')]);_0x5ea35a[_0x5298('0x35')]=_[_0x5298('0x33')](_0x29d66e[_0x5298('0x31')],qs['fields'](_0x4cac06[_0x5298('0x32')]['fields']));_0x5ea35a[_0x5298('0x35')]=_0x5ea35a[_0x5298('0x35')][_0x5298('0x36')]?_0x5ea35a[_0x5298('0x35')]:_0x29d66e['model'];_0x5ea35a[_0x5298('0x38')]=qs[_0x5298('0x39')](_0x4cac06['query'][_0x5298('0x39')]);_0x5ea35a['where']=qs['filters'](_[_0x5298('0x3b')](_0x4cac06[_0x5298('0x32')],_0x29d66e[_0x5298('0x30')]));if(_0x4cac06[_0x5298('0x32')]['filter']){_0x5ea35a[_0x5298('0x3a')]=_[_0x5298('0x3c')](_0x5ea35a[_0x5298('0x3a')],{'$or':_[_0x5298('0x29')](_0x5ea35a[_0x5298('0x35')],function(_0x2ca85e){var _0x374a03={};_0x374a03[_0x2ca85e]={'$like':'%'+_0x4cac06['query']['filter']+'%'};return _0x374a03;})});}_0x5ea35a=_[_0x5298('0x3c')]({},_0x5ea35a,_0x4cac06['options']);return _0xd96827[_0x5298('0x4a')](_0x5ea35a);}})['then'](function(_0xf28d98){if(_0xf28d98){_0x13c777=_0xf28d98[_0x5298('0x36')];if(!_0x4cac06[_0x5298('0x32')]['hasOwnProperty']('nolimit')){_0x5ea35a[_0x5298('0x1e')]=qs['limit'](_0x4cac06['query']['limit']);_0x5ea35a[_0x5298('0x1c')]=qs[_0x5298('0x1c')](_0x4cac06[_0x5298('0x32')][_0x5298('0x1c')]);}return _0xd96827[_0x5298('0x4a')](_0x5ea35a);}})['then'](function(_0x3e3515){if(_0x3e3515){return _0x3e3515?{'count':_0x13c777,'rows':_0x3e3515}:null;}})[_0x5298('0x24')](respondWithResult(_0x446dbc,null))[_0x5298('0x44')](handleError(_0x446dbc,null));};exports[_0x5298('0x4d')]=function(_0x17f6d2,_0x48e5a5,_0x13937f){var _0x1e0eff={};var _0x58e464={};var _0x385da1;var _0x52988a;return db[_0x5298('0x2a')][_0x5298('0x4b')]({'where':{'id':_0x17f6d2[_0x5298('0x46')]['id']}})['then'](handleEntityNotFound(_0x48e5a5,null))[_0x5298('0x24')](function(_0x4043cd){if(_0x4043cd){_0x385da1=_0x4043cd;_0x58e464[_0x5298('0x31')]=_[_0x5298('0x2f')](db[_0x5298('0x4c')][_0x5298('0x2b')]);_0x58e464[_0x5298('0x32')]=_['keys'](_0x17f6d2[_0x5298('0x32')]);_0x58e464[_0x5298('0x30')]=_['intersection'](_0x58e464[_0x5298('0x31')],_0x58e464[_0x5298('0x32')]);_0x1e0eff[_0x5298('0x35')]=_[_0x5298('0x33')](_0x58e464[_0x5298('0x31')],qs[_0x5298('0x34')](_0x17f6d2[_0x5298('0x32')][_0x5298('0x34')]));_0x1e0eff[_0x5298('0x35')]=_0x1e0eff['attributes'][_0x5298('0x36')]?_0x1e0eff[_0x5298('0x35')]:_0x58e464[_0x5298('0x31')];_0x1e0eff[_0x5298('0x38')]=qs['sort'](_0x17f6d2['query'][_0x5298('0x39')]);_0x1e0eff[_0x5298('0x3a')]=qs['filters'](_[_0x5298('0x3b')](_0x17f6d2['query'],_0x58e464[_0x5298('0x30')]));if(_0x17f6d2['query'][_0x5298('0x3d')]){_0x1e0eff['where']=_[_0x5298('0x3c')](_0x1e0eff[_0x5298('0x3a')],{'$or':_[_0x5298('0x29')](_0x1e0eff['attributes'],function(_0x161b3b){var _0x26fae9={};_0x26fae9[_0x161b3b]={'$like':'%'+_0x17f6d2[_0x5298('0x32')][_0x5298('0x3d')]+'%'};return _0x26fae9;})});}_0x1e0eff=_[_0x5298('0x3c')]({},_0x1e0eff,_0x17f6d2[_0x5298('0x3e')]);return _0x385da1['getSubjects'](_0x1e0eff);}})[_0x5298('0x24')](function(_0x24fd90){if(_0x24fd90){_0x52988a=_0x24fd90[_0x5298('0x36')];if(!_0x17f6d2[_0x5298('0x32')][_0x5298('0x4e')](_0x5298('0x37'))){_0x1e0eff['limit']=qs['limit'](_0x17f6d2[_0x5298('0x32')][_0x5298('0x1e')]);_0x1e0eff[_0x5298('0x1c')]=qs[_0x5298('0x1c')](_0x17f6d2[_0x5298('0x32')]['offset']);}return _0x385da1[_0x5298('0x4d')](_0x1e0eff);}})['then'](function(_0x4b37f){if(_0x4b37f){return _0x4b37f?{'count':_0x52988a,'rows':_0x4b37f}:null;}})[_0x5298('0x24')](respondWithResult(_0x48e5a5,null))['catch'](handleError(_0x48e5a5,null));};exports[_0x5298('0x4f')]=function(_0x475ceb,_0x2ba37b,_0x2a002e){var _0x20d51c={};var _0x31bf71={};var _0x1142cd;var _0x47f71e;return db[_0x5298('0x2a')][_0x5298('0x4b')]({'where':{'id':_0x475ceb['params']['id']}})[_0x5298('0x24')](handleEntityNotFound(_0x2ba37b,null))['then'](function(_0x43cc4e){if(_0x43cc4e){_0x1142cd=_0x43cc4e;_0x31bf71['model']=_[_0x5298('0x2f')](db['ServicenowField']['rawAttributes']);_0x31bf71[_0x5298('0x32')]=_[_0x5298('0x2f')](_0x475ceb['query']);_0x31bf71[_0x5298('0x30')]=_[_0x5298('0x33')](_0x31bf71['model'],_0x31bf71[_0x5298('0x32')]);_0x20d51c[_0x5298('0x35')]=_[_0x5298('0x33')](_0x31bf71[_0x5298('0x31')],qs[_0x5298('0x34')](_0x475ceb[_0x5298('0x32')][_0x5298('0x34')]));_0x20d51c[_0x5298('0x35')]=_0x20d51c[_0x5298('0x35')]['length']?_0x20d51c[_0x5298('0x35')]:_0x31bf71['model'];_0x20d51c[_0x5298('0x38')]=qs[_0x5298('0x39')](_0x475ceb[_0x5298('0x32')]['sort']);_0x20d51c[_0x5298('0x3a')]=qs[_0x5298('0x30')](_[_0x5298('0x3b')](_0x475ceb[_0x5298('0x32')],_0x31bf71[_0x5298('0x30')]));if(_0x475ceb[_0x5298('0x32')][_0x5298('0x3d')]){_0x20d51c[_0x5298('0x3a')]=_[_0x5298('0x3c')](_0x20d51c[_0x5298('0x3a')],{'$or':_[_0x5298('0x29')](_0x20d51c[_0x5298('0x35')],function(_0x251a78){var _0x4c6a8c={};_0x4c6a8c[_0x251a78]={'$like':'%'+_0x475ceb['query']['filter']+'%'};return _0x4c6a8c;})});}_0x20d51c=_[_0x5298('0x3c')]({},_0x20d51c,_0x475ceb[_0x5298('0x3e')]);return _0x1142cd[_0x5298('0x4f')](_0x20d51c);}})['then'](function(_0x14f2ca){if(_0x14f2ca){_0x47f71e=_0x14f2ca[_0x5298('0x36')];if(!_0x475ceb[_0x5298('0x32')][_0x5298('0x4e')](_0x5298('0x37'))){_0x20d51c['limit']=qs[_0x5298('0x1e')](_0x475ceb[_0x5298('0x32')]['limit']);_0x20d51c[_0x5298('0x1c')]=qs[_0x5298('0x1c')](_0x475ceb[_0x5298('0x32')][_0x5298('0x1c')]);}return _0x1142cd[_0x5298('0x4f')](_0x20d51c);}})[_0x5298('0x24')](function(_0x163b38){if(_0x163b38){return _0x163b38?{'count':_0x47f71e,'rows':_0x163b38}:null;}})[_0x5298('0x24')](respondWithResult(_0x2ba37b,null))[_0x5298('0x44')](handleError(_0x2ba37b,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 367c655..ced1368 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 _0x9348=['../../config/environment','./intServicenowConfiguration.attributes','exports','define','int_servicenow_configurations','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x39a95b,_0x4f5c0d){var _0x1e39c3=function(_0x1b88a9){while(--_0x1b88a9){_0x39a95b['push'](_0x39a95b['shift']());}};_0x1e39c3(++_0x4f5c0d);}(_0x9348,0x10d));var _0x8934=function(_0xcb70f6,_0x4d87a7){_0xcb70f6=_0xcb70f6-0x0;var _0x4b5ec7=_0x9348[_0xcb70f6];return _0x4b5ec7;};'use strict';var _=require(_0x8934('0x0'));var util=require(_0x8934('0x1'));var logger=require(_0x8934('0x2'))(_0x8934('0x3'));var moment=require(_0x8934('0x4'));var BPromise=require('bluebird');var rp=require(_0x8934('0x5'));var fs=require('fs');var path=require(_0x8934('0x6'));var rimraf=require('rimraf');var config=require(_0x8934('0x7'));var attributes=require(_0x8934('0x8'));module[_0x8934('0x9')]=function(_0x2bce03,_0x4c70d7){return _0x2bce03[_0x8934('0xa')]('ServicenowConfiguration',attributes,{'tableName':_0x8934('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfb71=['define','ServicenowConfiguration','int_servicenow_configurations','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','exports'];(function(_0x1633ac,_0x11b5b5){var _0x14c1a2=function(_0x1186ca){while(--_0x1186ca){_0x1633ac['push'](_0x1633ac['shift']());}};_0x14c1a2(++_0x11b5b5);}(_0xfb71,0x1ef));var _0x1fb7=function(_0x1e907b,_0x3f5023){_0x1e907b=_0x1e907b-0x0;var _0x4a2f56=_0xfb71[_0x1e907b];return _0x4a2f56;};'use strict';var _=require(_0x1fb7('0x0'));var util=require(_0x1fb7('0x1'));var logger=require(_0x1fb7('0x2'))(_0x1fb7('0x3'));var moment=require(_0x1fb7('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1fb7('0x5'));var rimraf=require(_0x1fb7('0x6'));var config=require(_0x1fb7('0x7'));var attributes=require('./intServicenowConfiguration.attributes');module[_0x1fb7('0x8')]=function(_0x29532a,_0x2babe0){return _0x29532a[_0x1fb7('0x9')](_0x1fb7('0xa'),attributes,{'tableName':_0x1fb7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js index 7ae58c4..cff2c4e 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 _0x494e=['ServicenowConfiguration,\x20%s,\x20%s','message','result','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x42e432,_0x5bd026){var _0x2c08e9=function(_0x57617f){while(--_0x57617f){_0x42e432['push'](_0x42e432['shift']());}};_0x2c08e9(++_0x5bd026);}(_0x494e,0xd6));var _0xe494=function(_0x29c093,_0x6f4c04){_0x29c093=_0x29c093-0x0;var _0x51b280=_0x494e[_0x29c093];return _0x51b280;};'use strict';var _=require(_0xe494('0x0'));var util=require('util');var moment=require(_0xe494('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe494('0x2'));var db=require(_0xe494('0x3'))['db'];var utils=require(_0xe494('0x4'));var logger=require(_0xe494('0x5'))(_0xe494('0x6'));var config=require(_0xe494('0x7'));var jayson=require(_0xe494('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x16773d,_0x298248,_0x7c1e3e){return new BPromise(function(_0x1c477d,_0x39bca1){return client[_0xe494('0x9')](_0x16773d,_0x7c1e3e)[_0xe494('0xa')](function(_0x58de64){logger[_0xe494('0xb')]('ServicenowConfiguration,\x20%s,\x20%s',_0x298248,'request\x20sent');logger[_0xe494('0xc')](_0xe494('0xd'),_0x298248,_0xe494('0xe'),JSON[_0xe494('0xf')](_0x58de64));if(_0x58de64['error']){if(_0x58de64['error']['code']===0x1f4){logger[_0xe494('0x10')](_0xe494('0x11'),_0x298248,_0x58de64[_0xe494('0x10')]['message']);return _0x39bca1(_0x58de64[_0xe494('0x10')][_0xe494('0x12')]);}logger[_0xe494('0x10')](_0xe494('0x11'),_0x298248,_0x58de64['error'][_0xe494('0x12')]);return _0x1c477d(_0x58de64['error']['message']);}else{logger[_0xe494('0xb')](_0xe494('0x11'),_0x298248,_0xe494('0xe'));_0x1c477d(_0x58de64[_0xe494('0x13')]['message']);}})[_0xe494('0x14')](function(_0x283602){logger[_0xe494('0x10')]('ServicenowConfiguration,\x20%s,\x20%s',_0x298248,_0x283602);_0x39bca1(_0x283602);});});} \ No newline at end of file +var _0x93bb=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment'];(function(_0x54cc83,_0x4b3bf3){var _0x22805c=function(_0x1ed91f){while(--_0x1ed91f){_0x54cc83['push'](_0x54cc83['shift']());}};_0x22805c(++_0x4b3bf3);}(_0x93bb,0x135));var _0xb93b=function(_0x3290a0,_0x922867){_0x3290a0=_0x3290a0-0x0;var _0x2b1656=_0x93bb[_0x3290a0];return _0x2b1656;};'use strict';var _=require(_0xb93b('0x0'));var util=require(_0xb93b('0x1'));var moment=require(_0xb93b('0x2'));var BPromise=require(_0xb93b('0x3'));var rs=require(_0xb93b('0x4'));var fs=require('fs');var Redis=require(_0xb93b('0x5'));var db=require(_0xb93b('0x6'))['db'];var utils=require(_0xb93b('0x7'));var logger=require(_0xb93b('0x8'))(_0xb93b('0x9'));var config=require('../../config/environment');var jayson=require(_0xb93b('0xa'));var client=jayson[_0xb93b('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c4dcf,_0x2c27ca,_0x516b0b){return new BPromise(function(_0x35c135,_0x455cb2){return client[_0xb93b('0xc')](_0x3c4dcf,_0x516b0b)[_0xb93b('0xd')](function(_0x1c9b11){logger[_0xb93b('0xe')](_0xb93b('0xf'),_0x2c27ca,_0xb93b('0x10'));logger[_0xb93b('0x11')](_0xb93b('0x12'),_0x2c27ca,_0xb93b('0x10'),JSON['stringify'](_0x1c9b11));if(_0x1c9b11[_0xb93b('0x13')]){if(_0x1c9b11[_0xb93b('0x13')][_0xb93b('0x14')]===0x1f4){logger[_0xb93b('0x13')]('ServicenowConfiguration,\x20%s,\x20%s',_0x2c27ca,_0x1c9b11[_0xb93b('0x13')][_0xb93b('0x15')]);return _0x455cb2(_0x1c9b11[_0xb93b('0x13')][_0xb93b('0x15')]);}logger[_0xb93b('0x13')](_0xb93b('0xf'),_0x2c27ca,_0x1c9b11[_0xb93b('0x13')]['message']);return _0x35c135(_0x1c9b11[_0xb93b('0x13')][_0xb93b('0x15')]);}else{logger[_0xb93b('0xe')](_0xb93b('0xf'),_0x2c27ca,_0xb93b('0x10'));_0x35c135(_0x1c9b11[_0xb93b('0x16')]['message']);}})[_0xb93b('0x17')](function(_0x5ee3c4){logger[_0xb93b('0x13')](_0xb93b('0xf'),_0x2c27ca,_0x5ee3c4);_0x455cb2(_0x5ee3c4);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index f6c9bb2..6226ad4 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 _0x17b8=['express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','create','put','update','/:id','destroy','multer','util','connect-timeout'];(function(_0x3ae2b2,_0x2d936f){var _0x1dbf00=function(_0x4072e9){while(--_0x4072e9){_0x3ae2b2['push'](_0x3ae2b2['shift']());}};_0x1dbf00(++_0x2d936f);}(_0x17b8,0x151));var _0x817b=function(_0x518467,_0x383a5f){_0x518467=_0x518467-0x0;var _0x5a0ee4=_0x17b8[_0x518467];return _0x5a0ee4;};'use strict';var multer=require(_0x817b('0x0'));var util=require(_0x817b('0x1'));var path=require('path');var timeout=require(_0x817b('0x2'));var express=require(_0x817b('0x3'));var router=express['Router']();var fs_extra=require(_0x817b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x817b('0x5'));var config=require(_0x817b('0x6'));var controller=require('./intServicenowField.controller');router[_0x817b('0x7')]('/',auth[_0x817b('0x8')](),controller[_0x817b('0x9')]);router['get']('/:id',auth[_0x817b('0x8')](),controller[_0x817b('0xa')]);router[_0x817b('0xb')]('/',auth[_0x817b('0x8')](),controller[_0x817b('0xc')]);router[_0x817b('0xd')]('/:id',auth[_0x817b('0x8')](),controller[_0x817b('0xe')]);router['delete'](_0x817b('0xf'),auth[_0x817b('0x8')](),controller[_0x817b('0x10')]);module['exports']=router; \ No newline at end of file +var _0xe5c8=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intServicenowField.controller','index','/:id','isAuthenticated','show','post','create','put','destroy','exports'];(function(_0x3b811c,_0x1e5435){var _0x126b18=function(_0x493c48){while(--_0x493c48){_0x3b811c['push'](_0x3b811c['shift']());}};_0x126b18(++_0x1e5435);}(_0xe5c8,0x198));var _0x8e5c=function(_0x4be6a6,_0x184f2a){_0x4be6a6=_0x4be6a6-0x0;var _0x12100f=_0xe5c8[_0x4be6a6];return _0x12100f;};'use strict';var multer=require(_0x8e5c('0x0'));var util=require('util');var path=require(_0x8e5c('0x1'));var timeout=require(_0x8e5c('0x2'));var express=require(_0x8e5c('0x3'));var router=express[_0x8e5c('0x4')]();var fs_extra=require(_0x8e5c('0x5'));var auth=require(_0x8e5c('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8e5c('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x8e5c('0x8')]);router['get'](_0x8e5c('0x9'),auth[_0x8e5c('0xa')](),controller[_0x8e5c('0xb')]);router[_0x8e5c('0xc')]('/',auth['isAuthenticated'](),controller[_0x8e5c('0xd')]);router[_0x8e5c('0xe')](_0x8e5c('0x9'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x8e5c('0x9'),auth['isAuthenticated'](),controller[_0x8e5c('0xf')]);module[_0x8e5c('0x10')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 67ca993..638ad63 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 _0xd292=['keyValue','picklist','STRING','BOOLEAN','sequelize','ENUM','string','variable','customVariable'];(function(_0x3a9e1a,_0x6188e1){var _0x333774=function(_0x5378fb){while(--_0x5378fb){_0x3a9e1a['push'](_0x3a9e1a['shift']());}};_0x333774(++_0x6188e1);}(_0xd292,0x1ea));var _0x2d29=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd292[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x2d29('0x0'));module['exports']={'type':{'type':Sequelize[_0x2d29('0x1')](_0x2d29('0x2'),_0x2d29('0x3'),_0x2d29('0x4'),_0x2d29('0x5'),_0x2d29('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x2d29('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x2d29('0x2'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x2d29('0x7')]},'idField':{'type':Sequelize[_0x2d29('0x7')]},'nameField':{'type':Sequelize[_0x2d29('0x7')]},'customField':{'type':Sequelize[_0x2d29('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2d29('0x7')]}}; \ No newline at end of file +var _0x4bee=['sequelize','ENUM','string','variable','keyValue','picklist','STRING','customVariable','BOOLEAN'];(function(_0x1fd9e7,_0x24cdbe){var _0x1781f2=function(_0x2bd0a3){while(--_0x2bd0a3){_0x1fd9e7['push'](_0x1fd9e7['shift']());}};_0x1781f2(++_0x24cdbe);}(_0x4bee,0xfc));var _0xe4be=function(_0x2e6dee,_0x1a61b0){_0x2e6dee=_0x2e6dee-0x0;var _0x47706=_0x4bee[_0x2e6dee];return _0x47706;};'use strict';var Sequelize=require(_0xe4be('0x0'));module['exports']={'type':{'type':Sequelize[_0xe4be('0x1')](_0xe4be('0x2'),_0xe4be('0x3'),'customVariable',_0xe4be('0x4'),_0xe4be('0x5')),'defaultValue':_0xe4be('0x2')},'content':{'type':Sequelize[_0xe4be('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM']('string',_0xe4be('0x3'),_0xe4be('0x7'))},'keyContent':{'type':Sequelize[_0xe4be('0x6')]},'idField':{'type':Sequelize[_0xe4be('0x6')]},'nameField':{'type':Sequelize[_0xe4be('0x6')]},'customField':{'type':Sequelize[_0xe4be('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe4be('0x6')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index e71c01e..adacfda 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 _0x08ee=['error','stack','name','send','index','ServicenowField','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','options','findAll','rows','show','params','keys','length','includeAll','include','find','catch','create','body','eml-format','request-promise','moment','bluebird','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','reject','update','then','destroy','end'];(function(_0x46538c,_0x3cdb9f){var _0x12130e=function(_0xff25e8){while(--_0xff25e8){_0x46538c['push'](_0x46538c['shift']());}};_0x12130e(++_0x3cdb9f);}(_0x08ee,0x68));var _0xe08e=function(_0x5ce6b5,_0x5a80e6){_0x5ce6b5=_0x5ce6b5-0x0;var _0x3f50b2=_0x08ee[_0x5ce6b5];return _0x3f50b2;};'use strict';var emlformat=require(_0xe08e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe08e('0x1'));var moment=require(_0xe08e('0x2'));var BPromise=require(_0xe08e('0x3'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xe08e('0x4'));var ejs=require(_0xe08e('0x5'));var fs=require('fs');var fs_extra=require(_0xe08e('0x6'));var _=require(_0xe08e('0x7'));var squel=require(_0xe08e('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe08e('0x4'));var querystring=require(_0xe08e('0x9'));var Papa=require(_0xe08e('0xa'));var Redis=require(_0xe08e('0xb'));var authService=require(_0xe08e('0xc'));var qs=require(_0xe08e('0xd'));var as=require(_0xe08e('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe08e('0xf'));var utils=require(_0xe08e('0x10'));var config=require(_0xe08e('0x11'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x548643,_0x2654c7){_0x2654c7=_0x2654c7||0xcc;return function(_0x43faae){if(_0x43faae){return _0x548643[_0xe08e('0x12')](_0x2654c7);}return _0x548643[_0xe08e('0x13')](_0x2654c7)['end']();};}function respondWithResult(_0x56fe3b,_0x4e5302){_0x4e5302=_0x4e5302||0xc8;return function(_0x3bb91b){if(_0x3bb91b){return _0x56fe3b['status'](_0x4e5302)[_0xe08e('0x14')](_0x3bb91b);}};}function respondWithFilteredResult(_0xdff538,_0xa38fdf){return function(_0x4ff5f0){if(_0x4ff5f0){var _0x1077f2=typeof _0xa38fdf['offset']===_0xe08e('0x15')&&typeof _0xa38fdf[_0xe08e('0x16')]===_0xe08e('0x15');var _0x53bd3e=_0x4ff5f0[_0xe08e('0x17')];var _0x542e9a=_0x1077f2?0x0:_0xa38fdf[_0xe08e('0x18')];var _0x1b5fe6=_0x1077f2?_0x4ff5f0['count']:_0xa38fdf[_0xe08e('0x18')]+_0xa38fdf[_0xe08e('0x16')];var _0x43acb8;if(_0x1b5fe6>=_0x53bd3e){_0x1b5fe6=_0x53bd3e;_0x43acb8=0xc8;}else{_0x43acb8=0xce;}_0xdff538[_0xe08e('0x13')](_0x43acb8);return _0xdff538[_0xe08e('0x19')](_0xe08e('0x1a'),_0x542e9a+'-'+_0x1b5fe6+'/'+_0x53bd3e)[_0xe08e('0x14')](_0x4ff5f0);}return null;};}function patchUpdates(_0x191415){return function(_0xe368a0){try{jsonpatch['apply'](_0xe368a0,_0x191415,!![]);}catch(_0x586494){return BPromise[_0xe08e('0x1b')](_0x586494);}return _0xe368a0['save']();};}function saveUpdates(_0x497e75,_0x1241d9){return function(_0x342844){if(_0x342844){return _0x342844[_0xe08e('0x1c')](_0x497e75)[_0xe08e('0x1d')](function(_0x1d2d47){return _0x1d2d47;});}return null;};}function removeEntity(_0x45aa6b,_0x546d30){return function(_0x4e6eb9){if(_0x4e6eb9){return _0x4e6eb9[_0xe08e('0x1e')]()[_0xe08e('0x1d')](function(){_0x45aa6b['status'](0xcc)[_0xe08e('0x1f')]();});}};}function handleEntityNotFound(_0x24e5fa,_0x1dcd75){return function(_0x3847c8){if(!_0x3847c8){_0x24e5fa[_0xe08e('0x12')](0x194);}return _0x3847c8;};}function handleError(_0x33cbe8,_0x27b65d){_0x27b65d=_0x27b65d||0x1f4;return function(_0x5dac73){logger[_0xe08e('0x20')](_0x5dac73[_0xe08e('0x21')]);if(_0x5dac73[_0xe08e('0x22')]){delete _0x5dac73[_0xe08e('0x22')];}_0x33cbe8[_0xe08e('0x13')](_0x27b65d)[_0xe08e('0x23')](_0x5dac73);};}exports[_0xe08e('0x24')]=function(_0x375c69,_0x529db9){var _0x439f7e={},_0x235216={},_0x1c443d={'count':0x0,'rows':[]};var _0x395dec=_['map'](db[_0xe08e('0x25')]['rawAttributes'],function(_0x2b64d0){return{'name':_0x2b64d0['fieldName'],'type':_0x2b64d0[_0xe08e('0x26')][_0xe08e('0x27')]};});_0x235216[_0xe08e('0x28')]=_['map'](_0x395dec,_0xe08e('0x22'));_0x235216['query']=_['keys'](_0x375c69[_0xe08e('0x29')]);_0x235216[_0xe08e('0x2a')]=_[_0xe08e('0x2b')](_0x235216[_0xe08e('0x28')],_0x235216[_0xe08e('0x29')]);_0x439f7e[_0xe08e('0x2c')]=_[_0xe08e('0x2b')](_0x235216[_0xe08e('0x28')],qs[_0xe08e('0x2d')](_0x375c69[_0xe08e('0x29')][_0xe08e('0x2d')]));_0x439f7e[_0xe08e('0x2c')]=_0x439f7e[_0xe08e('0x2c')]['length']?_0x439f7e['attributes']:_0x235216[_0xe08e('0x28')];if(!_0x375c69['query'][_0xe08e('0x2e')](_0xe08e('0x2f'))){_0x439f7e['limit']=qs[_0xe08e('0x16')](_0x375c69['query']['limit']);_0x439f7e['offset']=qs['offset'](_0x375c69[_0xe08e('0x29')][_0xe08e('0x18')]);}_0x439f7e[_0xe08e('0x30')]=qs['sort'](_0x375c69[_0xe08e('0x29')][_0xe08e('0x31')]);_0x439f7e[_0xe08e('0x32')]=qs[_0xe08e('0x2a')](_[_0xe08e('0x33')](_0x375c69[_0xe08e('0x29')],_0x235216['filters']),_0x395dec);if(_0x375c69[_0xe08e('0x29')][_0xe08e('0x34')]){_0x439f7e[_0xe08e('0x32')]=_[_0xe08e('0x35')](_0x439f7e[_0xe08e('0x32')],{'$or':_[_0xe08e('0x36')](_0x395dec,function(_0x1a520a){if(_0x1a520a[_0xe08e('0x26')]!=='VIRTUAL'){var _0x35d5e1={};_0x35d5e1[_0x1a520a[_0xe08e('0x22')]]={'$like':'%'+_0x375c69[_0xe08e('0x29')][_0xe08e('0x34')]+'%'};return _0x35d5e1;}})});}_0x439f7e=_[_0xe08e('0x35')]({},_0x439f7e,_0x375c69[_0xe08e('0x37')]);var _0x3e7c7f={'where':_0x439f7e['where']};return db[_0xe08e('0x25')][_0xe08e('0x17')](_0x3e7c7f)['then'](function(_0xb5a02c){_0x1c443d[_0xe08e('0x17')]=_0xb5a02c;if(_0x375c69[_0xe08e('0x29')]['includeAll']){_0x439f7e['include']=[{'all':!![]}];}return db[_0xe08e('0x25')][_0xe08e('0x38')](_0x439f7e);})[_0xe08e('0x1d')](function(_0x351a82){_0x1c443d[_0xe08e('0x39')]=_0x351a82;return _0x1c443d;})[_0xe08e('0x1d')](respondWithFilteredResult(_0x529db9,_0x439f7e))['catch'](handleError(_0x529db9,null));};exports[_0xe08e('0x3a')]=function(_0x55340a,_0x513012){var _0x1a1efc={'raw':!![],'where':{'id':_0x55340a[_0xe08e('0x3b')]['id']}},_0x4a1a9d={};_0x4a1a9d['model']=_[_0xe08e('0x3c')](db[_0xe08e('0x25')]['rawAttributes']);_0x4a1a9d[_0xe08e('0x29')]=_[_0xe08e('0x3c')](_0x55340a[_0xe08e('0x29')]);_0x4a1a9d[_0xe08e('0x2a')]=_['intersection'](_0x4a1a9d[_0xe08e('0x28')],_0x4a1a9d[_0xe08e('0x29')]);_0x1a1efc['attributes']=_[_0xe08e('0x2b')](_0x4a1a9d[_0xe08e('0x28')],qs[_0xe08e('0x2d')](_0x55340a['query'][_0xe08e('0x2d')]));_0x1a1efc[_0xe08e('0x2c')]=_0x1a1efc[_0xe08e('0x2c')][_0xe08e('0x3d')]?_0x1a1efc[_0xe08e('0x2c')]:_0x4a1a9d[_0xe08e('0x28')];if(_0x55340a[_0xe08e('0x29')][_0xe08e('0x3e')]){_0x1a1efc[_0xe08e('0x3f')]=[{'all':!![]}];}_0x1a1efc=_[_0xe08e('0x35')]({},_0x1a1efc,_0x55340a['options']);return db[_0xe08e('0x25')][_0xe08e('0x40')](_0x1a1efc)[_0xe08e('0x1d')](handleEntityNotFound(_0x513012,null))[_0xe08e('0x1d')](respondWithResult(_0x513012,null))[_0xe08e('0x41')](handleError(_0x513012,null));};exports[_0xe08e('0x42')]=function(_0x3c1755,_0x1f21e2){return db[_0xe08e('0x25')]['create'](_0x3c1755[_0xe08e('0x43')],{})[_0xe08e('0x1d')](respondWithResult(_0x1f21e2,0xc9))[_0xe08e('0x41')](handleError(_0x1f21e2,null));};exports['update']=function(_0xe364f9,_0x48dac7){if(_0xe364f9['body']['id']){delete _0xe364f9[_0xe08e('0x43')]['id'];}return db[_0xe08e('0x25')][_0xe08e('0x40')]({'where':{'id':_0xe364f9[_0xe08e('0x3b')]['id']}})[_0xe08e('0x1d')](handleEntityNotFound(_0x48dac7,null))[_0xe08e('0x1d')](saveUpdates(_0xe364f9[_0xe08e('0x43')],null))[_0xe08e('0x1d')](respondWithResult(_0x48dac7,null))[_0xe08e('0x41')](handleError(_0x48dac7,null));};exports['destroy']=function(_0x491bdd,_0x3ce24b){return db['ServicenowField'][_0xe08e('0x40')]({'where':{'id':_0x491bdd[_0xe08e('0x3b')]['id']}})['then'](handleEntityNotFound(_0x3ce24b,null))[_0xe08e('0x1d')](removeEntity(_0x3ce24b,null))[_0xe08e('0x41')](handleError(_0x3ce24b,null));}; \ No newline at end of file +var _0xe836=['send','index','rawAttributes','fieldName','key','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','limit','order','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','ServicenowField','rows','show','params','find','create','body','catch','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','reject','save','update','then','destroy','error','stack','name'];(function(_0x3206d1,_0x4212e2){var _0x1d6844=function(_0x4dab51){while(--_0x4dab51){_0x3206d1['push'](_0x3206d1['shift']());}};_0x1d6844(++_0x4212e2);}(_0xe836,0x187));var _0x6e83=function(_0x4b62fa,_0x2a6e92){_0x4b62fa=_0x4b62fa-0x0;var _0x17519a=_0xe836[_0x4b62fa];return _0x17519a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6e83('0x0'));var zipdir=require(_0x6e83('0x1'));var jsonpatch=require(_0x6e83('0x2'));var rp=require(_0x6e83('0x3'));var moment=require(_0x6e83('0x4'));var BPromise=require(_0x6e83('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6e83('0x6'));var sox=require(_0x6e83('0x7'));var csv=require(_0x6e83('0x8'));var ejs=require(_0x6e83('0x9'));var fs=require('fs');var fs_extra=require(_0x6e83('0xa'));var _=require(_0x6e83('0xb'));var squel=require(_0x6e83('0xc'));var crypto=require(_0x6e83('0xd'));var jsforce=require(_0x6e83('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x6e83('0x8'));var querystring=require(_0x6e83('0xf'));var Papa=require(_0x6e83('0x10'));var Redis=require('ioredis');var authService=require(_0x6e83('0x11'));var qs=require(_0x6e83('0x12'));var as=require(_0x6e83('0x13'));var hardwareService=require(_0x6e83('0x14'));var logger=require('../../config/logger')(_0x6e83('0x15'));var utils=require(_0x6e83('0x16'));var config=require(_0x6e83('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x6e83('0x18'))['db'];function respondWithStatusCode(_0x7bad85,_0x57236b){_0x57236b=_0x57236b||0xcc;return function(_0x320f93){if(_0x320f93){return _0x7bad85[_0x6e83('0x19')](_0x57236b);}return _0x7bad85[_0x6e83('0x1a')](_0x57236b)[_0x6e83('0x1b')]();};}function respondWithResult(_0x57b4cd,_0x4f76b6){_0x4f76b6=_0x4f76b6||0xc8;return function(_0x429b4e){if(_0x429b4e){return _0x57b4cd[_0x6e83('0x1a')](_0x4f76b6)[_0x6e83('0x1c')](_0x429b4e);}};}function respondWithFilteredResult(_0xad3eba,_0x582056){return function(_0x429a67){if(_0x429a67){var _0x2c418f=typeof _0x582056[_0x6e83('0x1d')]===_0x6e83('0x1e')&&typeof _0x582056['limit']===_0x6e83('0x1e');var _0x5b17a8=_0x429a67[_0x6e83('0x1f')];var _0x192cdd=_0x2c418f?0x0:_0x582056[_0x6e83('0x1d')];var _0x79bfe0=_0x2c418f?_0x429a67[_0x6e83('0x1f')]:_0x582056[_0x6e83('0x1d')]+_0x582056['limit'];var _0x9b6c1d;if(_0x79bfe0>=_0x5b17a8){_0x79bfe0=_0x5b17a8;_0x9b6c1d=0xc8;}else{_0x9b6c1d=0xce;}_0xad3eba[_0x6e83('0x1a')](_0x9b6c1d);return _0xad3eba[_0x6e83('0x20')]('Content-Range',_0x192cdd+'-'+_0x79bfe0+'/'+_0x5b17a8)[_0x6e83('0x1c')](_0x429a67);}return null;};}function patchUpdates(_0x3742ba){return function(_0x3a249){try{jsonpatch['apply'](_0x3a249,_0x3742ba,!![]);}catch(_0x4aef71){return BPromise[_0x6e83('0x21')](_0x4aef71);}return _0x3a249[_0x6e83('0x22')]();};}function saveUpdates(_0x205695,_0x46ca16){return function(_0x48e9e4){if(_0x48e9e4){return _0x48e9e4[_0x6e83('0x23')](_0x205695)[_0x6e83('0x24')](function(_0x23b978){return _0x23b978;});}return null;};}function removeEntity(_0x346688,_0x2ae19e){return function(_0x28bd0b){if(_0x28bd0b){return _0x28bd0b[_0x6e83('0x25')]()[_0x6e83('0x24')](function(){_0x346688['status'](0xcc)[_0x6e83('0x1b')]();});}};}function handleEntityNotFound(_0x3aa03e,_0x4ac2a7){return function(_0x1daea8){if(!_0x1daea8){_0x3aa03e[_0x6e83('0x19')](0x194);}return _0x1daea8;};}function handleError(_0x44a75b,_0x4a8a48){_0x4a8a48=_0x4a8a48||0x1f4;return function(_0x1103dc){logger[_0x6e83('0x26')](_0x1103dc[_0x6e83('0x27')]);if(_0x1103dc[_0x6e83('0x28')]){delete _0x1103dc[_0x6e83('0x28')];}_0x44a75b['status'](_0x4a8a48)[_0x6e83('0x29')](_0x1103dc);};}exports[_0x6e83('0x2a')]=function(_0x176011,_0x537f1c){var _0x4d5ae2={},_0x227ca9={},_0x2a1244={'count':0x0,'rows':[]};var _0x4dd48a=_['map'](db['ServicenowField'][_0x6e83('0x2b')],function(_0x20d1d8){return{'name':_0x20d1d8[_0x6e83('0x2c')],'type':_0x20d1d8['type'][_0x6e83('0x2d')]};});_0x227ca9[_0x6e83('0x2e')]=_[_0x6e83('0x2f')](_0x4dd48a,_0x6e83('0x28'));_0x227ca9[_0x6e83('0x30')]=_[_0x6e83('0x31')](_0x176011[_0x6e83('0x30')]);_0x227ca9['filters']=_[_0x6e83('0x32')](_0x227ca9['model'],_0x227ca9[_0x6e83('0x30')]);_0x4d5ae2[_0x6e83('0x33')]=_[_0x6e83('0x32')](_0x227ca9[_0x6e83('0x2e')],qs[_0x6e83('0x34')](_0x176011[_0x6e83('0x30')][_0x6e83('0x34')]));_0x4d5ae2[_0x6e83('0x33')]=_0x4d5ae2['attributes']['length']?_0x4d5ae2[_0x6e83('0x33')]:_0x227ca9[_0x6e83('0x2e')];if(!_0x176011[_0x6e83('0x30')][_0x6e83('0x35')]('nolimit')){_0x4d5ae2['limit']=qs[_0x6e83('0x36')](_0x176011[_0x6e83('0x30')]['limit']);_0x4d5ae2[_0x6e83('0x1d')]=qs[_0x6e83('0x1d')](_0x176011[_0x6e83('0x30')][_0x6e83('0x1d')]);}_0x4d5ae2[_0x6e83('0x37')]=qs['sort'](_0x176011[_0x6e83('0x30')]['sort']);_0x4d5ae2[_0x6e83('0x38')]=qs[_0x6e83('0x39')](_[_0x6e83('0x3a')](_0x176011['query'],_0x227ca9['filters']),_0x4dd48a);if(_0x176011['query'][_0x6e83('0x3b')]){_0x4d5ae2[_0x6e83('0x38')]=_[_0x6e83('0x3c')](_0x4d5ae2[_0x6e83('0x38')],{'$or':_[_0x6e83('0x2f')](_0x4dd48a,function(_0x3f1bf0){if(_0x3f1bf0['type']!==_0x6e83('0x3d')){var _0x4080cb={};_0x4080cb[_0x3f1bf0[_0x6e83('0x28')]]={'$like':'%'+_0x176011[_0x6e83('0x30')][_0x6e83('0x3b')]+'%'};return _0x4080cb;}})});}_0x4d5ae2=_[_0x6e83('0x3c')]({},_0x4d5ae2,_0x176011['options']);var _0x4496c6={'where':_0x4d5ae2[_0x6e83('0x38')]};return db['ServicenowField'][_0x6e83('0x1f')](_0x4496c6)[_0x6e83('0x24')](function(_0x208fbd){_0x2a1244[_0x6e83('0x1f')]=_0x208fbd;if(_0x176011[_0x6e83('0x30')][_0x6e83('0x3e')]){_0x4d5ae2[_0x6e83('0x3f')]=[{'all':!![]}];}return db[_0x6e83('0x40')]['findAll'](_0x4d5ae2);})['then'](function(_0x3c592b){_0x2a1244[_0x6e83('0x41')]=_0x3c592b;return _0x2a1244;})[_0x6e83('0x24')](respondWithFilteredResult(_0x537f1c,_0x4d5ae2))['catch'](handleError(_0x537f1c,null));};exports[_0x6e83('0x42')]=function(_0x5e88c6,_0x3edf55){var _0x5110e4={'raw':!![],'where':{'id':_0x5e88c6[_0x6e83('0x43')]['id']}},_0xcab9d5={};_0xcab9d5['model']=_[_0x6e83('0x31')](db[_0x6e83('0x40')][_0x6e83('0x2b')]);_0xcab9d5[_0x6e83('0x30')]=_[_0x6e83('0x31')](_0x5e88c6[_0x6e83('0x30')]);_0xcab9d5[_0x6e83('0x39')]=_[_0x6e83('0x32')](_0xcab9d5[_0x6e83('0x2e')],_0xcab9d5[_0x6e83('0x30')]);_0x5110e4[_0x6e83('0x33')]=_[_0x6e83('0x32')](_0xcab9d5[_0x6e83('0x2e')],qs[_0x6e83('0x34')](_0x5e88c6['query'][_0x6e83('0x34')]));_0x5110e4[_0x6e83('0x33')]=_0x5110e4[_0x6e83('0x33')]['length']?_0x5110e4[_0x6e83('0x33')]:_0xcab9d5['model'];if(_0x5e88c6['query']['includeAll']){_0x5110e4[_0x6e83('0x3f')]=[{'all':!![]}];}_0x5110e4=_[_0x6e83('0x3c')]({},_0x5110e4,_0x5e88c6['options']);return db[_0x6e83('0x40')][_0x6e83('0x44')](_0x5110e4)['then'](handleEntityNotFound(_0x3edf55,null))[_0x6e83('0x24')](respondWithResult(_0x3edf55,null))['catch'](handleError(_0x3edf55,null));};exports[_0x6e83('0x45')]=function(_0x56970e,_0x2f1a26){return db['ServicenowField']['create'](_0x56970e[_0x6e83('0x46')],{})[_0x6e83('0x24')](respondWithResult(_0x2f1a26,0xc9))['catch'](handleError(_0x2f1a26,null));};exports[_0x6e83('0x23')]=function(_0x36f8a8,_0x53e79a){if(_0x36f8a8[_0x6e83('0x46')]['id']){delete _0x36f8a8[_0x6e83('0x46')]['id'];}return db['ServicenowField'][_0x6e83('0x44')]({'where':{'id':_0x36f8a8['params']['id']}})[_0x6e83('0x24')](handleEntityNotFound(_0x53e79a,null))[_0x6e83('0x24')](saveUpdates(_0x36f8a8['body'],null))[_0x6e83('0x24')](respondWithResult(_0x53e79a,null))[_0x6e83('0x47')](handleError(_0x53e79a,null));};exports[_0x6e83('0x25')]=function(_0x1ee9e0,_0x4879fa){return db[_0x6e83('0x40')]['find']({'where':{'id':_0x1ee9e0[_0x6e83('0x43')]['id']}})[_0x6e83('0x24')](handleEntityNotFound(_0x4879fa,null))[_0x6e83('0x24')](removeEntity(_0x4879fa,null))[_0x6e83('0x47')](handleError(_0x4879fa,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 2d5d2ec..265474d 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 _0x4cf0=['bluebird','path','../../config/environment','./intServicenowField.attributes','exports','define','ServicenowField','servicenow_unique_index','idField','FieldId','lodash','../../config/logger','api','moment'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x4cf0,0x15a));var _0x04cf=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x4cf0[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x04cf('0x0'));var util=require('util');var logger=require(_0x04cf('0x1'))(_0x04cf('0x2'));var moment=require(_0x04cf('0x3'));var BPromise=require(_0x04cf('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x04cf('0x5'));var rimraf=require('rimraf');var config=require(_0x04cf('0x6'));var attributes=require(_0x04cf('0x7'));module[_0x04cf('0x8')]=function(_0x4075e5,_0x443b4b){return _0x4075e5[_0x04cf('0x9')](_0x04cf('0xa'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0x04cf('0xb'),'fields':[_0x04cf('0xc'),_0x04cf('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdbb3=['rimraf','../../config/environment','./intServicenowField.attributes','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x414162,_0x569038){var _0x2e1ca1=function(_0x21ec13){while(--_0x21ec13){_0x414162['push'](_0x414162['shift']());}};_0x2e1ca1(++_0x569038);}(_0xdbb3,0xbd));var _0x3dbb=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0xdbb3[_0x5608a3];return _0x1ed50a;};'use strict';var _=require(_0x3dbb('0x0'));var util=require(_0x3dbb('0x1'));var logger=require(_0x3dbb('0x2'))(_0x3dbb('0x3'));var moment=require(_0x3dbb('0x4'));var BPromise=require(_0x3dbb('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3dbb('0x6'));var config=require(_0x3dbb('0x7'));var attributes=require(_0x3dbb('0x8'));module['exports']=function(_0x3abe7a,_0x347303){return _0x3abe7a['define'](_0x3dbb('0x9'),attributes,{'tableName':_0x3dbb('0xa'),'paranoid':![],'indexes':[{'name':_0x3dbb('0xb'),'fields':[_0x3dbb('0xc'),'FieldId'],'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 8a297ca..7e5ebfe 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 _0xaa88=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','error','ServicenowField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x3ddb02,_0x184ada){var _0x52b85f=function(_0xc7f427){while(--_0xc7f427){_0x3ddb02['push'](_0x3ddb02['shift']());}};_0x52b85f(++_0x184ada);}(_0xaa88,0x137));var _0x8aa8=function(_0x1d1963,_0x32cc0e){_0x1d1963=_0x1d1963-0x0;var _0x3f58bb=_0xaa88[_0x1d1963];return _0x3f58bb;};'use strict';var _=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var moment=require(_0x8aa8('0x2'));var BPromise=require(_0x8aa8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8aa8('0x4'));var db=require(_0x8aa8('0x5'))['db'];var utils=require(_0x8aa8('0x6'));var logger=require(_0x8aa8('0x7'))(_0x8aa8('0x8'));var config=require(_0x8aa8('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8aa8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5264ff,_0x449d2d,_0x1ed84d){return new BPromise(function(_0x27c08d,_0x40826f){return client['request'](_0x5264ff,_0x1ed84d)[_0x8aa8('0xb')](function(_0x2d974c){logger[_0x8aa8('0xc')]('ServicenowField,\x20%s,\x20%s',_0x449d2d,_0x8aa8('0xd'));logger[_0x8aa8('0xe')](_0x8aa8('0xf'),_0x449d2d,_0x8aa8('0xd'),JSON['stringify'](_0x2d974c));if(_0x2d974c[_0x8aa8('0x10')]){if(_0x2d974c[_0x8aa8('0x10')]['code']===0x1f4){logger[_0x8aa8('0x10')](_0x8aa8('0x11'),_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x40826f(_0x2d974c[_0x8aa8('0x10')][_0x8aa8('0x12')]);}logger[_0x8aa8('0x10')]('ServicenowField,\x20%s,\x20%s',_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x27c08d(_0x2d974c['error'][_0x8aa8('0x12')]);}else{logger[_0x8aa8('0xc')](_0x8aa8('0x11'),_0x449d2d,_0x8aa8('0xd'));_0x27c08d(_0x2d974c[_0x8aa8('0x13')][_0x8aa8('0x12')]);}})[_0x8aa8('0x14')](function(_0xd59fb8){logger[_0x8aa8('0x10')]('ServicenowField,\x20%s,\x20%s',_0x449d2d,_0xd59fb8);_0x40826f(_0xd59fb8);});});} \ No newline at end of file +var _0xa9e0=['http','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\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(_0x2edb06,_0x83cd08){var _0x227998=function(_0x36c03e){while(--_0x36c03e){_0x2edb06['push'](_0x2edb06['shift']());}};_0x227998(++_0x83cd08);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'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/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 3c6596b..e81ab6f 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(_0x136640,_0x4be445){var _0x27674c=function(_0x3c77af){while(--_0x3c77af){_0x136640['push'](_0x136640['shift']());}};_0x27674c(++_0x4be445);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'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 _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(_0x55dc55,_0x3c37fd){var _0x5461f1=function(_0x45a404){while(--_0x45a404){_0x55dc55['push'](_0x55dc55['shift']());}};_0x5461f1(++_0x3c37fd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'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 diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index f22ccfa..b47bd5c 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(_0x121c6d,_0x108645){var _0x3a8943=function(_0xc4f80a){while(--_0xc4f80a){_0x121c6d['push'](_0x121c6d['shift']());}};_0x3a8943(++_0x108645);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'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(_0x394e22,_0x21230a){var _0x463832=function(_0x597f4a){while(--_0x597f4a){_0x394e22['push'](_0x394e22['shift']());}};_0x463832(++_0x21230a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'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 8334ba3..2e0d050 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 _0xa4e5=['getFields','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','SugarcrmAccount','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','merge','where','options','includeAll','findAll','catch','show','rawAttributes','include','find','create','body','params','findOne','SugarcrmConfiguration','pick','getConfigurations','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','created_by','description','date_start','duration_hours','duration_minutes','username','password','remoteUri','slice','lastIndexOf','POST','format','/service/v4_1/rest.php','login','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','get_module_fields','Calls','values','module_fields','includes','label','endsWith','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s'];(function(_0x5ef1bb,_0x4613e2){var _0x17cd60=function(_0x454975){while(--_0x454975){_0x5ef1bb['push'](_0x5ef1bb['shift']());}};_0x17cd60(++_0x4613e2);}(_0xa4e5,0xf2));var _0x5a4e=function(_0x5c677b,_0x4b7105){_0x5c677b=_0x5c677b-0x0;var _0x3e1988=_0xa4e5[_0x5c677b];return _0x3e1988;};'use strict';var emlformat=require(_0x5a4e('0x0'));var rimraf=require(_0x5a4e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5a4e('0x2'));var rp=require(_0x5a4e('0x3'));var moment=require(_0x5a4e('0x4'));var BPromise=require(_0x5a4e('0x5'));var Mustache=require(_0x5a4e('0x6'));var util=require(_0x5a4e('0x7'));var path=require(_0x5a4e('0x8'));var sox=require(_0x5a4e('0x9'));var csv=require(_0x5a4e('0xa'));var ejs=require(_0x5a4e('0xb'));var fs=require('fs');var fs_extra=require(_0x5a4e('0xc'));var _=require(_0x5a4e('0xd'));var squel=require('squel');var crypto=require(_0x5a4e('0xe'));var jsforce=require(_0x5a4e('0xf'));var deskjs=require(_0x5a4e('0x10'));var toCsv=require(_0x5a4e('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5a4e('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5a4e('0x12'));var as=require(_0x5a4e('0x13'));var hardwareService=require(_0x5a4e('0x14'));var logger=require(_0x5a4e('0x15'))(_0x5a4e('0x16'));var utils=require('../../config/utils');var config=require(_0x5a4e('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5a4e('0x18'))['db'];var integrations=require(_0x5a4e('0x19'));function respondWithStatusCode(_0x3e5965,_0x40383c){_0x40383c=_0x40383c||0xcc;return function(_0x408a55){if(_0x408a55){return _0x3e5965[_0x5a4e('0x1a')](_0x40383c);}return _0x3e5965[_0x5a4e('0x1b')](_0x40383c)[_0x5a4e('0x1c')]();};}function respondWithResult(_0x111010,_0x4d83dd){_0x4d83dd=_0x4d83dd||0xc8;return function(_0x124209){if(_0x124209){return _0x111010[_0x5a4e('0x1b')](_0x4d83dd)[_0x5a4e('0x1d')](_0x124209);}};}function respondWithFilteredResult(_0x2688b0,_0x18d143){return function(_0x39d3a5){if(_0x39d3a5){var _0xc7ce76=typeof _0x18d143[_0x5a4e('0x1e')]===_0x5a4e('0x1f')&&typeof _0x18d143[_0x5a4e('0x20')]===_0x5a4e('0x1f');var _0x1f0c74=_0x39d3a5[_0x5a4e('0x21')];var _0x483552=_0xc7ce76?0x0:_0x18d143[_0x5a4e('0x1e')];var _0x3e4276=_0xc7ce76?_0x39d3a5['count']:_0x18d143[_0x5a4e('0x1e')]+_0x18d143[_0x5a4e('0x20')];var _0x178397;if(_0x3e4276>=_0x1f0c74){_0x3e4276=_0x1f0c74;_0x178397=0xc8;}else{_0x178397=0xce;}_0x2688b0[_0x5a4e('0x1b')](_0x178397);return _0x2688b0['set'](_0x5a4e('0x22'),_0x483552+'-'+_0x3e4276+'/'+_0x1f0c74)[_0x5a4e('0x1d')](_0x39d3a5);}return null;};}function patchUpdates(_0x32fce3){return function(_0x479075){try{jsonpatch[_0x5a4e('0x23')](_0x479075,_0x32fce3,!![]);}catch(_0x22ab15){return BPromise[_0x5a4e('0x24')](_0x22ab15);}return _0x479075[_0x5a4e('0x25')]();};}function saveUpdates(_0xe090aa,_0x378458){return function(_0x497c40){if(_0x497c40){return _0x497c40[_0x5a4e('0x26')](_0xe090aa)[_0x5a4e('0x27')](function(_0x337e93){return _0x337e93;});}return null;};}function removeEntity(_0x291f2c,_0x504462){return function(_0x29087c){if(_0x29087c){return _0x29087c[_0x5a4e('0x28')]()[_0x5a4e('0x27')](function(){_0x291f2c[_0x5a4e('0x1b')](0xcc)[_0x5a4e('0x1c')]();});}};}function handleEntityNotFound(_0x24ff82,_0x556353){return function(_0x26c99a){if(!_0x26c99a){_0x24ff82[_0x5a4e('0x1a')](0x194);}return _0x26c99a;};}function handleError(_0x527e90,_0x51487c){_0x51487c=_0x51487c||0x1f4;return function(_0x204ca8){logger[_0x5a4e('0x29')](_0x204ca8[_0x5a4e('0x2a')]);if(_0x204ca8[_0x5a4e('0x2b')]){delete _0x204ca8[_0x5a4e('0x2b')];}_0x527e90[_0x5a4e('0x1b')](_0x51487c)['send'](_0x204ca8);};}exports[_0x5a4e('0x2c')]=function(_0x1d9b83,_0x3aaddc){var _0x5463fc={},_0x2c3635={},_0x43564e={'count':0x0,'rows':[]};var _0x44b3ac=_[_0x5a4e('0x2d')](db[_0x5a4e('0x2e')]['rawAttributes'],function(_0x1461f0){return{'name':_0x1461f0[_0x5a4e('0x2f')],'type':_0x1461f0[_0x5a4e('0x30')][_0x5a4e('0x31')]};});_0x2c3635[_0x5a4e('0x32')]=_[_0x5a4e('0x2d')](_0x44b3ac,'name');_0x2c3635[_0x5a4e('0x33')]=_[_0x5a4e('0x34')](_0x1d9b83['query']);_0x2c3635[_0x5a4e('0x35')]=_[_0x5a4e('0x36')](_0x2c3635[_0x5a4e('0x32')],_0x2c3635[_0x5a4e('0x33')]);_0x5463fc[_0x5a4e('0x37')]=_[_0x5a4e('0x36')](_0x2c3635['model'],qs[_0x5a4e('0x38')](_0x1d9b83['query'][_0x5a4e('0x38')]));_0x5463fc['attributes']=_0x5463fc[_0x5a4e('0x37')][_0x5a4e('0x39')]?_0x5463fc[_0x5a4e('0x37')]:_0x2c3635[_0x5a4e('0x32')];if(!_0x1d9b83['query'][_0x5a4e('0x3a')](_0x5a4e('0x3b'))){_0x5463fc['limit']=qs[_0x5a4e('0x20')](_0x1d9b83[_0x5a4e('0x33')][_0x5a4e('0x20')]);_0x5463fc[_0x5a4e('0x1e')]=qs[_0x5a4e('0x1e')](_0x1d9b83[_0x5a4e('0x33')]['offset']);}_0x5463fc[_0x5a4e('0x3c')]=qs[_0x5a4e('0x3d')](_0x1d9b83[_0x5a4e('0x33')][_0x5a4e('0x3d')]);_0x5463fc['where']=qs[_0x5a4e('0x35')](_['pick'](_0x1d9b83['query'],_0x2c3635[_0x5a4e('0x35')]),_0x44b3ac);if(_0x1d9b83[_0x5a4e('0x33')][_0x5a4e('0x3e')]){_0x5463fc['where']=_[_0x5a4e('0x3f')](_0x5463fc[_0x5a4e('0x40')],{'$or':_['map'](_0x44b3ac,function(_0x1e4b15){if(_0x1e4b15[_0x5a4e('0x30')]!=='VIRTUAL'){var _0x32ddb8={};_0x32ddb8[_0x1e4b15[_0x5a4e('0x2b')]]={'$like':'%'+_0x1d9b83[_0x5a4e('0x33')][_0x5a4e('0x3e')]+'%'};return _0x32ddb8;}})});}_0x5463fc=_[_0x5a4e('0x3f')]({},_0x5463fc,_0x1d9b83[_0x5a4e('0x41')]);var _0x4c907a={'where':_0x5463fc[_0x5a4e('0x40')]};return db['SugarcrmAccount'][_0x5a4e('0x21')](_0x4c907a)[_0x5a4e('0x27')](function(_0x3ff3b6){_0x43564e[_0x5a4e('0x21')]=_0x3ff3b6;if(_0x1d9b83['query'][_0x5a4e('0x42')]){_0x5463fc['include']=[{'all':!![]}];}return db[_0x5a4e('0x2e')][_0x5a4e('0x43')](_0x5463fc);})[_0x5a4e('0x27')](function(_0x4fa152){_0x43564e['rows']=_0x4fa152;return _0x43564e;})[_0x5a4e('0x27')](respondWithFilteredResult(_0x3aaddc,_0x5463fc))[_0x5a4e('0x44')](handleError(_0x3aaddc,null));};exports[_0x5a4e('0x45')]=function(_0x182b9d,_0x4c3aa9){var _0x2a09cf={'raw':![],'where':{'id':_0x182b9d['params']['id']}},_0x210620={};_0x210620[_0x5a4e('0x32')]=_[_0x5a4e('0x34')](db[_0x5a4e('0x2e')][_0x5a4e('0x46')]);_0x210620['query']=_[_0x5a4e('0x34')](_0x182b9d[_0x5a4e('0x33')]);_0x210620[_0x5a4e('0x35')]=_[_0x5a4e('0x36')](_0x210620[_0x5a4e('0x32')],_0x210620['query']);_0x2a09cf[_0x5a4e('0x37')]=_[_0x5a4e('0x36')](_0x210620[_0x5a4e('0x32')],qs[_0x5a4e('0x38')](_0x182b9d[_0x5a4e('0x33')][_0x5a4e('0x38')]));_0x2a09cf[_0x5a4e('0x37')]=_0x2a09cf[_0x5a4e('0x37')]['length']?_0x2a09cf['attributes']:_0x210620[_0x5a4e('0x32')];if(_0x182b9d[_0x5a4e('0x33')]['includeAll']){_0x2a09cf[_0x5a4e('0x47')]=[{'all':!![]}];}_0x2a09cf=_[_0x5a4e('0x3f')]({},_0x2a09cf,_0x182b9d[_0x5a4e('0x41')]);return db[_0x5a4e('0x2e')][_0x5a4e('0x48')](_0x2a09cf)[_0x5a4e('0x27')](handleEntityNotFound(_0x4c3aa9,null))[_0x5a4e('0x27')](respondWithResult(_0x4c3aa9,null))[_0x5a4e('0x44')](handleError(_0x4c3aa9,null));};exports['create']=function(_0x33880b,_0x5266e5){return db[_0x5a4e('0x2e')][_0x5a4e('0x49')](_0x33880b[_0x5a4e('0x4a')],{})['then'](respondWithResult(_0x5266e5,0xc9))[_0x5a4e('0x44')](handleError(_0x5266e5,null));};exports[_0x5a4e('0x26')]=function(_0x3f6850,_0x4fb3dc){if(_0x3f6850[_0x5a4e('0x4a')]['id']){delete _0x3f6850[_0x5a4e('0x4a')]['id'];}return db['SugarcrmAccount'][_0x5a4e('0x48')]({'where':{'id':_0x3f6850[_0x5a4e('0x4b')]['id']}})[_0x5a4e('0x27')](handleEntityNotFound(_0x4fb3dc,null))[_0x5a4e('0x27')](saveUpdates(_0x3f6850['body'],null))[_0x5a4e('0x27')](respondWithResult(_0x4fb3dc,null))['catch'](handleError(_0x4fb3dc,null));};exports[_0x5a4e('0x28')]=function(_0x1ca9bf,_0x58beae){return db['SugarcrmAccount'][_0x5a4e('0x48')]({'where':{'id':_0x1ca9bf['params']['id']}})[_0x5a4e('0x27')](handleEntityNotFound(_0x58beae,null))[_0x5a4e('0x27')](removeEntity(_0x58beae,null))['catch'](handleError(_0x58beae,null));};exports['getConfigurations']=function(_0xf03d73,_0x1220b0,_0x5b390a){var _0x1b39d2={};var _0x458498={};var _0x17775e;var _0x228c1c;return db[_0x5a4e('0x2e')][_0x5a4e('0x4c')]({'where':{'id':_0xf03d73[_0x5a4e('0x4b')]['id']}})[_0x5a4e('0x27')](handleEntityNotFound(_0x1220b0,null))[_0x5a4e('0x27')](function(_0x14ed8e){if(_0x14ed8e){_0x17775e=_0x14ed8e;_0x458498['model']=_[_0x5a4e('0x34')](db[_0x5a4e('0x4d')]['rawAttributes']);_0x458498[_0x5a4e('0x33')]=_[_0x5a4e('0x34')](_0xf03d73[_0x5a4e('0x33')]);_0x458498['filters']=_[_0x5a4e('0x36')](_0x458498[_0x5a4e('0x32')],_0x458498['query']);_0x1b39d2['attributes']=_[_0x5a4e('0x36')](_0x458498[_0x5a4e('0x32')],qs['fields'](_0xf03d73[_0x5a4e('0x33')][_0x5a4e('0x38')]));_0x1b39d2[_0x5a4e('0x37')]=_0x1b39d2['attributes'][_0x5a4e('0x39')]?_0x1b39d2[_0x5a4e('0x37')]:_0x458498[_0x5a4e('0x32')];_0x1b39d2[_0x5a4e('0x3c')]=qs[_0x5a4e('0x3d')](_0xf03d73[_0x5a4e('0x33')][_0x5a4e('0x3d')]);_0x1b39d2[_0x5a4e('0x40')]=qs['filters'](_[_0x5a4e('0x4e')](_0xf03d73[_0x5a4e('0x33')],_0x458498[_0x5a4e('0x35')]));if(_0xf03d73[_0x5a4e('0x33')][_0x5a4e('0x3e')]){_0x1b39d2[_0x5a4e('0x40')]=_[_0x5a4e('0x3f')](_0x1b39d2[_0x5a4e('0x40')],{'$or':_[_0x5a4e('0x2d')](_0x1b39d2[_0x5a4e('0x37')],function(_0x58f66e){var _0x26dfa5={};_0x26dfa5[_0x58f66e]={'$like':'%'+_0xf03d73[_0x5a4e('0x33')][_0x5a4e('0x3e')]+'%'};return _0x26dfa5;})});}_0x1b39d2=_['merge']({},_0x1b39d2,_0xf03d73[_0x5a4e('0x41')]);return _0x17775e[_0x5a4e('0x4f')](_0x1b39d2);}})[_0x5a4e('0x27')](function(_0x6c965f){if(_0x6c965f){_0x228c1c=_0x6c965f[_0x5a4e('0x39')];if(!_0xf03d73[_0x5a4e('0x33')]['hasOwnProperty'](_0x5a4e('0x3b'))){_0x1b39d2['limit']=qs['limit'](_0xf03d73[_0x5a4e('0x33')]['limit']);_0x1b39d2[_0x5a4e('0x1e')]=qs[_0x5a4e('0x1e')](_0xf03d73[_0x5a4e('0x33')]['offset']);}return _0x17775e[_0x5a4e('0x4f')](_0x1b39d2);}})[_0x5a4e('0x27')](function(_0x179b7d){if(_0x179b7d){return _0x179b7d?{'count':_0x228c1c,'rows':_0x179b7d}:null;}})[_0x5a4e('0x27')](respondWithResult(_0x1220b0,null))['catch'](handleError(_0x1220b0,null));};exports[_0x5a4e('0x50')]=function(_0x505037,_0x126fcd,_0x594691){if(_0x505037[_0x5a4e('0x4a')]['id']){delete _0x505037[_0x5a4e('0x4a')]['id'];}return db[_0x5a4e('0x2e')][_0x5a4e('0x4c')]({'where':{'id':_0x505037[_0x5a4e('0x4b')]['id']}})[_0x5a4e('0x27')](handleEntityNotFound(_0x126fcd,null))['then'](function(_0x28ce93){if(_0x28ce93){_0x505037[_0x5a4e('0x4a')]['AccountId']=_0x28ce93['id'];_0x505037[_0x5a4e('0x4a')][_0x5a4e('0x51')]=integrations[_0x5a4e('0x52')](_0x505037[_0x5a4e('0x4a')][_0x5a4e('0x53')],_0x505037[_0x5a4e('0x4a')]['type']);_0x505037[_0x5a4e('0x4a')][_0x5a4e('0x54')]=integrations[_0x5a4e('0x55')](_0x505037[_0x5a4e('0x4a')][_0x5a4e('0x53')],_0x505037[_0x5a4e('0x4a')][_0x5a4e('0x30')]);return db[_0x5a4e('0x4d')]['create'](_0x505037['body'],{'include':[{'model':db['SugarcrmField'],'as':_0x5a4e('0x51')},{'model':db[_0x5a4e('0x56')],'as':_0x5a4e('0x54')}]});}return null;})['then'](respondWithResult(_0x126fcd,null))[_0x5a4e('0x44')](handleError(_0x126fcd,null));};exports['getFields']=function(_0x14ae57,_0x427ead,_0x37c730){var _0x49024e='';var _0xb07196=['id','name','assigned_user_id',_0x5a4e('0x57'),_0x5a4e('0x58'),_0x5a4e('0x59'),_0x5a4e('0x5a'),_0x5a4e('0x5b'),'parent_id','parent_type','parent_name','direction'];return db['SugarcrmAccount']['findOne']({'where':{'id':_0x14ae57[_0x5a4e('0x4b')]['id']},'attributes':['id',_0x5a4e('0x5c'),_0x5a4e('0x5d'),_0x5a4e('0x5e')]})[_0x5a4e('0x27')](handleEntityNotFound(_0x427ead,null))['then'](function(_0xffba43){if(_0xffba43){_0x49024e=_0xffba43[_0x5a4e('0x5e')];var _0x4f45ae=_0x49024e[_0x5a4e('0x5f')](-0x1);if(_0x4f45ae==='/'){_0x49024e=_0x49024e['substring'](0x0,_0x49024e[_0x5a4e('0x60')](_0x4f45ae));}return rp({'method':_0x5a4e('0x61'),'uri':util[_0x5a4e('0x62')]('%s%s',_0x49024e,_0x5a4e('0x63')),'json':!![],'form':{'method':_0x5a4e('0x64'),'input_type':_0x5a4e('0x65'),'response_type':_0x5a4e('0x65'),'rest_data':JSON[_0x5a4e('0x66')]({'user_auth':{'user_name':_0xffba43['username'],'password':_0xffba43['password'],'encryption':_0x5a4e('0x67')},'application':_0x5a4e('0x68')})}});}})['then'](function(_0x592f0d){if(_0x592f0d&&_0x592f0d['name']!==_0x5a4e('0x69')&&_0x592f0d[_0x5a4e('0x2b')]!==_0x5a4e('0x6a')){return rp({'method':_0x5a4e('0x61'),'uri':util['format']('%s%s',_0x49024e,_0x5a4e('0x63')),'json':!![],'form':{'method':_0x5a4e('0x6b'),'input_type':_0x5a4e('0x65'),'response_type':_0x5a4e('0x65'),'rest_data':JSON[_0x5a4e('0x66')]({'session':_0x592f0d['id'],'module_name':_0x5a4e('0x6c')})}})[_0x5a4e('0x27')](function(_0x37f1ea){if(_0x37f1ea){var _0x4b0819=_[_0x5a4e('0x6d')](_0x37f1ea[_0x5a4e('0x6e')]);_['remove'](_0x4b0819,function(_0x24992c){return _0xb07196[_0x5a4e('0x6f')](_0x24992c[_0x5a4e('0x2b')]);});return{'count':_0x4b0819[_0x5a4e('0x39')],'rows':_[_0x5a4e('0x2d')](_0x4b0819,function(_0x35fb7f){return{'id':_0x35fb7f[_0x5a4e('0x2b')],'name':_0x35fb7f[_0x5a4e('0x70')],'custom':_[_0x5a4e('0x71')](_0x35fb7f[_0x5a4e('0x2b')],'_c')?!![]:![],'options':_0x35fb7f[_0x5a4e('0x41')]?_['map'](_[_0x5a4e('0x6d')](_0x35fb7f[_0x5a4e('0x41')]),function(_0x12527c){return{'name':_0x12527c[_0x5a4e('0x72')],'value':_0x12527c[_0x5a4e('0x2b')]};}):[]};})};}})[_0x5a4e('0x27')](respondWithResult(_0x427ead,null))[_0x5a4e('0x44')](function(_0x31f2b1){var _0x4f37aa=_0x14ae57[_0x5a4e('0x33')][_0x5a4e('0x73')]?0x1f4:_0x31f2b1[_0x5a4e('0x74')]||0x1f4;logger[_0x5a4e('0x29')](_0x5a4e('0x75'),_0x5a4e('0x76'),_0x4f37aa,JSON[_0x5a4e('0x66')](_0x31f2b1));delete _0x31f2b1[_0x5a4e('0x2b')];if(_0x4f37aa===0x191){_0x4f37aa=0x190;}_0x427ead[_0x5a4e('0x1b')](_0x4f37aa)['send'](_0x14ae57[_0x5a4e('0x33')]['test']?{'message':_0x5a4e('0x77'),'statusCode':_0x31f2b1['statusCode']}:_0x31f2b1);});}else{var _0x19275d=0x1f4;_0x427ead[_0x5a4e('0x1b')](_0x19275d)['send']({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file +var _0x9ab4=['Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','name','index','map','SugarcrmAccount','fieldName','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','find','catch','create','body','params','destroy','getConfigurations','SugarcrmConfiguration','length','findOne','AccountId','Subjects','getSubjects','channel','type','Descriptions','getDescriptions','SugarcrmField','getFields','assigned_user_id','description','date_start','duration_hours','parent_type','parent_name','direction','username','password','remoteUri','slice','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','get_module_fields','stringify','Calls','values','remove','label','value','test','getFields,\x20%s,\x20%s,\x20%s'];(function(_0x1f36bb,_0x8af718){var _0xaf97fa=function(_0xeca489){while(--_0xeca489){_0x1f36bb['push'](_0x1f36bb['shift']());}};_0xaf97fa(++_0x8af718);}(_0x9ab4,0x1e5));var _0x49ab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9ab4[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x49ab('0x0'));var zipdir=require(_0x49ab('0x1'));var jsonpatch=require(_0x49ab('0x2'));var rp=require(_0x49ab('0x3'));var moment=require('moment');var BPromise=require(_0x49ab('0x4'));var Mustache=require(_0x49ab('0x5'));var util=require('util');var path=require(_0x49ab('0x6'));var sox=require(_0x49ab('0x7'));var csv=require(_0x49ab('0x8'));var ejs=require(_0x49ab('0x9'));var fs=require('fs');var fs_extra=require(_0x49ab('0xa'));var _=require(_0x49ab('0xb'));var squel=require(_0x49ab('0xc'));var crypto=require(_0x49ab('0xd'));var jsforce=require(_0x49ab('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x49ab('0x8'));var querystring=require(_0x49ab('0xf'));var Papa=require(_0x49ab('0x10'));var Redis=require(_0x49ab('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x49ab('0x12'));var hardwareService=require(_0x49ab('0x13'));var logger=require(_0x49ab('0x14'))(_0x49ab('0x15'));var utils=require(_0x49ab('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x49ab('0x17'));var db=require(_0x49ab('0x18'))['db'];var integrations=require(_0x49ab('0x19'));function respondWithStatusCode(_0x129036,_0x293338){_0x293338=_0x293338||0xcc;return function(_0x2698c5){if(_0x2698c5){return _0x129036[_0x49ab('0x1a')](_0x293338);}return _0x129036[_0x49ab('0x1b')](_0x293338)[_0x49ab('0x1c')]();};}function respondWithResult(_0x520db3,_0x4595ea){_0x4595ea=_0x4595ea||0xc8;return function(_0x3d68b7){if(_0x3d68b7){return _0x520db3[_0x49ab('0x1b')](_0x4595ea)[_0x49ab('0x1d')](_0x3d68b7);}};}function respondWithFilteredResult(_0x403be1,_0x1365f7){return function(_0x236fe6){if(_0x236fe6){var _0x5b4027=typeof _0x1365f7[_0x49ab('0x1e')]===_0x49ab('0x1f')&&typeof _0x1365f7[_0x49ab('0x20')]==='undefined';var _0x4c3a47=_0x236fe6[_0x49ab('0x21')];var _0x32bab7=_0x5b4027?0x0:_0x1365f7[_0x49ab('0x1e')];var _0x5863ff=_0x5b4027?_0x236fe6[_0x49ab('0x21')]:_0x1365f7[_0x49ab('0x1e')]+_0x1365f7[_0x49ab('0x20')];var _0x7e5310;if(_0x5863ff>=_0x4c3a47){_0x5863ff=_0x4c3a47;_0x7e5310=0xc8;}else{_0x7e5310=0xce;}_0x403be1[_0x49ab('0x1b')](_0x7e5310);return _0x403be1[_0x49ab('0x22')](_0x49ab('0x23'),_0x32bab7+'-'+_0x5863ff+'/'+_0x4c3a47)[_0x49ab('0x1d')](_0x236fe6);}return null;};}function patchUpdates(_0x4badde){return function(_0x44ccb7){try{jsonpatch[_0x49ab('0x24')](_0x44ccb7,_0x4badde,!![]);}catch(_0x4b3a5c){return BPromise[_0x49ab('0x25')](_0x4b3a5c);}return _0x44ccb7[_0x49ab('0x26')]();};}function saveUpdates(_0x5a8614,_0x1702a9){return function(_0x5f566d){if(_0x5f566d){return _0x5f566d[_0x49ab('0x27')](_0x5a8614)[_0x49ab('0x28')](function(_0x353f62){return _0x353f62;});}return null;};}function removeEntity(_0x3c39c8,_0x4d6be6){return function(_0x2d6763){if(_0x2d6763){return _0x2d6763['destroy']()['then'](function(){_0x3c39c8['status'](0xcc)[_0x49ab('0x1c')]();});}};}function handleEntityNotFound(_0x2f3235,_0x2a474d){return function(_0x4a5af3){if(!_0x4a5af3){_0x2f3235[_0x49ab('0x1a')](0x194);}return _0x4a5af3;};}function handleError(_0x520639,_0x13f16a){_0x13f16a=_0x13f16a||0x1f4;return function(_0x5f3adb){logger[_0x49ab('0x29')](_0x5f3adb['stack']);if(_0x5f3adb[_0x49ab('0x2a')]){delete _0x5f3adb[_0x49ab('0x2a')];}_0x520639[_0x49ab('0x1b')](_0x13f16a)['send'](_0x5f3adb);};}exports[_0x49ab('0x2b')]=function(_0xc37a6b,_0x23a0a2){var _0x5a080b={},_0x2fa904={},_0x2b53e4={'count':0x0,'rows':[]};var _0xd68521=_[_0x49ab('0x2c')](db[_0x49ab('0x2d')]['rawAttributes'],function(_0x29c22b){return{'name':_0x29c22b[_0x49ab('0x2e')],'type':_0x29c22b['type'][_0x49ab('0x2f')]};});_0x2fa904[_0x49ab('0x30')]=_[_0x49ab('0x2c')](_0xd68521,'name');_0x2fa904[_0x49ab('0x31')]=_[_0x49ab('0x32')](_0xc37a6b[_0x49ab('0x31')]);_0x2fa904['filters']=_['intersection'](_0x2fa904[_0x49ab('0x30')],_0x2fa904['query']);_0x5a080b[_0x49ab('0x33')]=_[_0x49ab('0x34')](_0x2fa904[_0x49ab('0x30')],qs[_0x49ab('0x35')](_0xc37a6b[_0x49ab('0x31')]['fields']));_0x5a080b[_0x49ab('0x33')]=_0x5a080b[_0x49ab('0x33')]['length']?_0x5a080b['attributes']:_0x2fa904[_0x49ab('0x30')];if(!_0xc37a6b[_0x49ab('0x31')][_0x49ab('0x36')](_0x49ab('0x37'))){_0x5a080b[_0x49ab('0x20')]=qs[_0x49ab('0x20')](_0xc37a6b[_0x49ab('0x31')][_0x49ab('0x20')]);_0x5a080b[_0x49ab('0x1e')]=qs[_0x49ab('0x1e')](_0xc37a6b[_0x49ab('0x31')][_0x49ab('0x1e')]);}_0x5a080b[_0x49ab('0x38')]=qs[_0x49ab('0x39')](_0xc37a6b[_0x49ab('0x31')]['sort']);_0x5a080b[_0x49ab('0x3a')]=qs[_0x49ab('0x3b')](_[_0x49ab('0x3c')](_0xc37a6b[_0x49ab('0x31')],_0x2fa904[_0x49ab('0x3b')]),_0xd68521);if(_0xc37a6b[_0x49ab('0x31')][_0x49ab('0x3d')]){_0x5a080b[_0x49ab('0x3a')]=_[_0x49ab('0x3e')](_0x5a080b[_0x49ab('0x3a')],{'$or':_['map'](_0xd68521,function(_0x1c98ff){if(_0x1c98ff['type']!==_0x49ab('0x3f')){var _0x367723={};_0x367723[_0x1c98ff[_0x49ab('0x2a')]]={'$like':'%'+_0xc37a6b[_0x49ab('0x31')]['filter']+'%'};return _0x367723;}})});}_0x5a080b=_['merge']({},_0x5a080b,_0xc37a6b[_0x49ab('0x40')]);var _0x384572={'where':_0x5a080b[_0x49ab('0x3a')]};return db[_0x49ab('0x2d')]['count'](_0x384572)[_0x49ab('0x28')](function(_0xdad303){_0x2b53e4[_0x49ab('0x21')]=_0xdad303;if(_0xc37a6b[_0x49ab('0x31')]['includeAll']){_0x5a080b[_0x49ab('0x41')]=[{'all':!![]}];}return db[_0x49ab('0x2d')][_0x49ab('0x42')](_0x5a080b);})['then'](function(_0x4587c1){_0x2b53e4[_0x49ab('0x43')]=_0x4587c1;return _0x2b53e4;})[_0x49ab('0x28')](respondWithFilteredResult(_0x23a0a2,_0x5a080b))['catch'](handleError(_0x23a0a2,null));};exports[_0x49ab('0x44')]=function(_0x3ea201,_0x3defb9){var _0x4b944e={'raw':![],'where':{'id':_0x3ea201['params']['id']}},_0xbbcc2a={};_0xbbcc2a['model']=_[_0x49ab('0x32')](db['SugarcrmAccount']['rawAttributes']);_0xbbcc2a[_0x49ab('0x31')]=_[_0x49ab('0x32')](_0x3ea201[_0x49ab('0x31')]);_0xbbcc2a[_0x49ab('0x3b')]=_[_0x49ab('0x34')](_0xbbcc2a[_0x49ab('0x30')],_0xbbcc2a[_0x49ab('0x31')]);_0x4b944e[_0x49ab('0x33')]=_[_0x49ab('0x34')](_0xbbcc2a[_0x49ab('0x30')],qs[_0x49ab('0x35')](_0x3ea201['query'][_0x49ab('0x35')]));_0x4b944e[_0x49ab('0x33')]=_0x4b944e[_0x49ab('0x33')]['length']?_0x4b944e[_0x49ab('0x33')]:_0xbbcc2a[_0x49ab('0x30')];if(_0x3ea201[_0x49ab('0x31')]['includeAll']){_0x4b944e[_0x49ab('0x41')]=[{'all':!![]}];}_0x4b944e=_[_0x49ab('0x3e')]({},_0x4b944e,_0x3ea201[_0x49ab('0x40')]);return db['SugarcrmAccount'][_0x49ab('0x45')](_0x4b944e)[_0x49ab('0x28')](handleEntityNotFound(_0x3defb9,null))[_0x49ab('0x28')](respondWithResult(_0x3defb9,null))[_0x49ab('0x46')](handleError(_0x3defb9,null));};exports[_0x49ab('0x47')]=function(_0x560682,_0x611b66){return db[_0x49ab('0x2d')][_0x49ab('0x47')](_0x560682[_0x49ab('0x48')],{})[_0x49ab('0x28')](respondWithResult(_0x611b66,0xc9))[_0x49ab('0x46')](handleError(_0x611b66,null));};exports[_0x49ab('0x27')]=function(_0x401bfd,_0x337931){if(_0x401bfd[_0x49ab('0x48')]['id']){delete _0x401bfd['body']['id'];}return db[_0x49ab('0x2d')][_0x49ab('0x45')]({'where':{'id':_0x401bfd[_0x49ab('0x49')]['id']}})[_0x49ab('0x28')](handleEntityNotFound(_0x337931,null))[_0x49ab('0x28')](saveUpdates(_0x401bfd[_0x49ab('0x48')],null))[_0x49ab('0x28')](respondWithResult(_0x337931,null))[_0x49ab('0x46')](handleError(_0x337931,null));};exports[_0x49ab('0x4a')]=function(_0x3d4abe,_0x6371af){return db[_0x49ab('0x2d')][_0x49ab('0x45')]({'where':{'id':_0x3d4abe[_0x49ab('0x49')]['id']}})['then'](handleEntityNotFound(_0x6371af,null))[_0x49ab('0x28')](removeEntity(_0x6371af,null))[_0x49ab('0x46')](handleError(_0x6371af,null));};exports[_0x49ab('0x4b')]=function(_0x56d0c0,_0x220e6a,_0x3e2d71){var _0x32f7ef={};var _0xde39d6={};var _0xdff1b1;var _0x2d5da4;return db[_0x49ab('0x2d')]['findOne']({'where':{'id':_0x56d0c0['params']['id']}})[_0x49ab('0x28')](handleEntityNotFound(_0x220e6a,null))[_0x49ab('0x28')](function(_0x1ea5fc){if(_0x1ea5fc){_0xdff1b1=_0x1ea5fc;_0xde39d6[_0x49ab('0x30')]=_['keys'](db[_0x49ab('0x4c')]['rawAttributes']);_0xde39d6[_0x49ab('0x31')]=_[_0x49ab('0x32')](_0x56d0c0['query']);_0xde39d6[_0x49ab('0x3b')]=_[_0x49ab('0x34')](_0xde39d6[_0x49ab('0x30')],_0xde39d6[_0x49ab('0x31')]);_0x32f7ef[_0x49ab('0x33')]=_['intersection'](_0xde39d6[_0x49ab('0x30')],qs[_0x49ab('0x35')](_0x56d0c0['query'][_0x49ab('0x35')]));_0x32f7ef[_0x49ab('0x33')]=_0x32f7ef['attributes'][_0x49ab('0x4d')]?_0x32f7ef[_0x49ab('0x33')]:_0xde39d6[_0x49ab('0x30')];_0x32f7ef['order']=qs[_0x49ab('0x39')](_0x56d0c0[_0x49ab('0x31')][_0x49ab('0x39')]);_0x32f7ef[_0x49ab('0x3a')]=qs[_0x49ab('0x3b')](_[_0x49ab('0x3c')](_0x56d0c0['query'],_0xde39d6[_0x49ab('0x3b')]));if(_0x56d0c0[_0x49ab('0x31')][_0x49ab('0x3d')]){_0x32f7ef[_0x49ab('0x3a')]=_[_0x49ab('0x3e')](_0x32f7ef[_0x49ab('0x3a')],{'$or':_[_0x49ab('0x2c')](_0x32f7ef[_0x49ab('0x33')],function(_0x127497){var _0x257bbf={};_0x257bbf[_0x127497]={'$like':'%'+_0x56d0c0[_0x49ab('0x31')][_0x49ab('0x3d')]+'%'};return _0x257bbf;})});}_0x32f7ef=_[_0x49ab('0x3e')]({},_0x32f7ef,_0x56d0c0['options']);return _0xdff1b1[_0x49ab('0x4b')](_0x32f7ef);}})[_0x49ab('0x28')](function(_0x105e88){if(_0x105e88){_0x2d5da4=_0x105e88[_0x49ab('0x4d')];if(!_0x56d0c0[_0x49ab('0x31')][_0x49ab('0x36')](_0x49ab('0x37'))){_0x32f7ef['limit']=qs[_0x49ab('0x20')](_0x56d0c0[_0x49ab('0x31')][_0x49ab('0x20')]);_0x32f7ef[_0x49ab('0x1e')]=qs[_0x49ab('0x1e')](_0x56d0c0[_0x49ab('0x31')]['offset']);}return _0xdff1b1[_0x49ab('0x4b')](_0x32f7ef);}})[_0x49ab('0x28')](function(_0x48fb64){if(_0x48fb64){return _0x48fb64?{'count':_0x2d5da4,'rows':_0x48fb64}:null;}})[_0x49ab('0x28')](respondWithResult(_0x220e6a,null))[_0x49ab('0x46')](handleError(_0x220e6a,null));};exports['addConfiguration']=function(_0x279bd1,_0x2bf66a,_0x59d99c){if(_0x279bd1[_0x49ab('0x48')]['id']){delete _0x279bd1[_0x49ab('0x48')]['id'];}return db[_0x49ab('0x2d')][_0x49ab('0x4e')]({'where':{'id':_0x279bd1[_0x49ab('0x49')]['id']}})[_0x49ab('0x28')](handleEntityNotFound(_0x2bf66a,null))[_0x49ab('0x28')](function(_0x541df9){if(_0x541df9){_0x279bd1[_0x49ab('0x48')][_0x49ab('0x4f')]=_0x541df9['id'];_0x279bd1[_0x49ab('0x48')][_0x49ab('0x50')]=integrations[_0x49ab('0x51')](_0x279bd1[_0x49ab('0x48')][_0x49ab('0x52')],_0x279bd1[_0x49ab('0x48')][_0x49ab('0x53')]);_0x279bd1[_0x49ab('0x48')][_0x49ab('0x54')]=integrations[_0x49ab('0x55')](_0x279bd1[_0x49ab('0x48')][_0x49ab('0x52')],_0x279bd1[_0x49ab('0x48')]['type']);return db['SugarcrmConfiguration'][_0x49ab('0x47')](_0x279bd1[_0x49ab('0x48')],{'include':[{'model':db[_0x49ab('0x56')],'as':_0x49ab('0x50')},{'model':db[_0x49ab('0x56')],'as':'Descriptions'}]});}return null;})[_0x49ab('0x28')](respondWithResult(_0x2bf66a,null))['catch'](handleError(_0x2bf66a,null));};exports[_0x49ab('0x57')]=function(_0x567dcc,_0x3b507c,_0x3786f3){var _0x56c4bd='';var _0x35efbc=['id',_0x49ab('0x2a'),_0x49ab('0x58'),'created_by',_0x49ab('0x59'),_0x49ab('0x5a'),_0x49ab('0x5b'),'duration_minutes','parent_id',_0x49ab('0x5c'),_0x49ab('0x5d'),_0x49ab('0x5e')];return db[_0x49ab('0x2d')]['findOne']({'where':{'id':_0x567dcc[_0x49ab('0x49')]['id']},'attributes':['id',_0x49ab('0x5f'),_0x49ab('0x60'),_0x49ab('0x61')]})[_0x49ab('0x28')](handleEntityNotFound(_0x3b507c,null))[_0x49ab('0x28')](function(_0x26cf46){if(_0x26cf46){_0x56c4bd=_0x26cf46['remoteUri'];var _0x58afb2=_0x56c4bd[_0x49ab('0x62')](-0x1);if(_0x58afb2==='/'){_0x56c4bd=_0x56c4bd[_0x49ab('0x63')](0x0,_0x56c4bd[_0x49ab('0x64')](_0x58afb2));}return rp({'method':_0x49ab('0x65'),'uri':util[_0x49ab('0x66')](_0x49ab('0x67'),_0x56c4bd,_0x49ab('0x68')),'json':!![],'form':{'method':_0x49ab('0x69'),'input_type':_0x49ab('0x6a'),'response_type':_0x49ab('0x6a'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x26cf46[_0x49ab('0x5f')],'password':_0x26cf46[_0x49ab('0x60')],'encryption':_0x49ab('0x6b')},'application':_0x49ab('0x6c')})}});}})['then'](function(_0x557488){if(_0x557488&&_0x557488[_0x49ab('0x2a')]!==_0x49ab('0x6d')&&_0x557488[_0x49ab('0x2a')]!==_0x49ab('0x6e')){return rp({'method':_0x49ab('0x65'),'uri':util[_0x49ab('0x66')]('%s%s',_0x56c4bd,_0x49ab('0x68')),'json':!![],'form':{'method':_0x49ab('0x6f'),'input_type':'JSON','response_type':_0x49ab('0x6a'),'rest_data':JSON[_0x49ab('0x70')]({'session':_0x557488['id'],'module_name':_0x49ab('0x71')})}})['then'](function(_0x30f8a4){if(_0x30f8a4){var _0x3f2b76=_[_0x49ab('0x72')](_0x30f8a4['module_fields']);_[_0x49ab('0x73')](_0x3f2b76,function(_0x76ed97){return _0x35efbc['includes'](_0x76ed97[_0x49ab('0x2a')]);});return{'count':_0x3f2b76['length'],'rows':_[_0x49ab('0x2c')](_0x3f2b76,function(_0x7a162b){return{'id':_0x7a162b['name'],'name':_0x7a162b[_0x49ab('0x74')],'custom':_['endsWith'](_0x7a162b['name'],'_c')?!![]:![],'options':_0x7a162b['options']?_['map'](_[_0x49ab('0x72')](_0x7a162b[_0x49ab('0x40')]),function(_0x17f19c){return{'name':_0x17f19c[_0x49ab('0x75')],'value':_0x17f19c[_0x49ab('0x2a')]};}):[]};})};}})[_0x49ab('0x28')](respondWithResult(_0x3b507c,null))[_0x49ab('0x46')](function(_0x44a65d){var _0xa14d0=_0x567dcc[_0x49ab('0x31')][_0x49ab('0x76')]?0x1f4:_0x44a65d['statusCode']||0x1f4;logger[_0x49ab('0x29')](_0x49ab('0x77'),'getFields',_0xa14d0,JSON[_0x49ab('0x70')](_0x44a65d));delete _0x44a65d[_0x49ab('0x2a')];if(_0xa14d0===0x191){_0xa14d0=0x190;}_0x3b507c[_0x49ab('0x1b')](_0xa14d0)['send'](_0x567dcc[_0x49ab('0x31')][_0x49ab('0x76')]?{'message':_0x49ab('0x78'),'statusCode':_0x44a65d['statusCode']}:_0x44a65d);});}else{var _0x582ffc=0x1f4;_0x3b507c[_0x49ab('0x1b')](_0x582ffc)['send']({'message':_0x49ab('0x78'),'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 d8ce235..dbc6feb 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 _0x81d4=['define','SugarcrmAccount','int_sugarcrm_accounts','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','exports'];(function(_0x520b32,_0x50792d){var _0x7ae0c3=function(_0x55c046){while(--_0x55c046){_0x520b32['push'](_0x520b32['shift']());}};_0x7ae0c3(++_0x50792d);}(_0x81d4,0x1ca));var _0x481d=function(_0x23fdc2,_0x351d37){_0x23fdc2=_0x23fdc2-0x0;var _0x4e8ed6=_0x81d4[_0x23fdc2];return _0x4e8ed6;};'use strict';var _=require(_0x481d('0x0'));var util=require('util');var logger=require(_0x481d('0x1'))(_0x481d('0x2'));var moment=require(_0x481d('0x3'));var BPromise=require(_0x481d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x481d('0x5'));var rimraf=require(_0x481d('0x6'));var config=require(_0x481d('0x7'));var attributes=require(_0x481d('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x481d('0x9')]=function(_0x3138c3,_0x76839f){return _0x3138c3[_0x481d('0xa')](_0x481d('0xb'),attributes,{'tableName':_0x481d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdcfc=['path','rimraf','./intSugarcrmAccount.attributes','../../components/integrations/configuration','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','bluebird','request-promise'];(function(_0x350aa2,_0x525df6){var _0x26546a=function(_0xa2975c){while(--_0xa2975c){_0x350aa2['push'](_0x350aa2['shift']());}};_0x26546a(++_0x525df6);}(_0xdcfc,0x1c8));var _0xcdcf=function(_0x2a02e2,_0x2d03a0){_0x2a02e2=_0x2a02e2-0x0;var _0x3e6af8=_0xdcfc[_0x2a02e2];return _0x3e6af8;};'use strict';var _=require(_0xcdcf('0x0'));var util=require(_0xcdcf('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xcdcf('0x2'));var rp=require(_0xcdcf('0x3'));var fs=require('fs');var path=require(_0xcdcf('0x4'));var rimraf=require(_0xcdcf('0x5'));var config=require('../../config/environment');var attributes=require(_0xcdcf('0x6'));var integrations=require(_0xcdcf('0x7'));module['exports']=function(_0x309910,_0x4b49e4){return _0x309910['define'](_0xcdcf('0x8'),attributes,{'tableName':_0xcdcf('0x9'),'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 d21bb64..7fba6da 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 _0xcfac=['raw','where','attributes','include','map','model','catch','ShowSugarcrmAccount','find','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SugarcrmAccount,\x20%s,\x20%s','message','result','GetSugarcrmAccount','SugarcrmAccount','findAll','options'];(function(_0x189dbd,_0x1d3cad){var _0x7861fb=function(_0x1a8738){while(--_0x1a8738){_0x189dbd['push'](_0x189dbd['shift']());}};_0x7861fb(++_0x1d3cad);}(_0xcfac,0x129));var _0xccfa=function(_0x8b415e,_0x224150){_0x8b415e=_0x8b415e-0x0;var _0x25f5ed=_0xcfac[_0x8b415e];return _0x25f5ed;};'use strict';var _=require('lodash');var util=require(_0xccfa('0x0'));var moment=require(_0xccfa('0x1'));var BPromise=require(_0xccfa('0x2'));var rs=require(_0xccfa('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xccfa('0x4'));var logger=require(_0xccfa('0x5'))(_0xccfa('0x6'));var config=require(_0xccfa('0x7'));var jayson=require(_0xccfa('0x8'));var client=jayson[_0xccfa('0x9')][_0xccfa('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13aaee,_0x1e06c2,_0x5cb055){return new BPromise(function(_0x288999,_0x1870d8){return client[_0xccfa('0xb')](_0x13aaee,_0x5cb055)[_0xccfa('0xc')](function(_0x4da48c){logger[_0xccfa('0xd')]('SugarcrmAccount,\x20%s,\x20%s',_0x1e06c2,_0xccfa('0xe'));logger[_0xccfa('0xf')](_0xccfa('0x10'),_0x1e06c2,_0xccfa('0xe'),JSON[_0xccfa('0x11')](_0x4da48c));if(_0x4da48c[_0xccfa('0x12')]){if(_0x4da48c['error'][_0xccfa('0x13')]===0x1f4){logger[_0xccfa('0x12')](_0xccfa('0x14'),_0x1e06c2,_0x4da48c[_0xccfa('0x12')][_0xccfa('0x15')]);return _0x1870d8(_0x4da48c['error'][_0xccfa('0x15')]);}logger[_0xccfa('0x12')](_0xccfa('0x14'),_0x1e06c2,_0x4da48c['error'][_0xccfa('0x15')]);return _0x288999(_0x4da48c[_0xccfa('0x12')][_0xccfa('0x15')]);}else{logger[_0xccfa('0xd')](_0xccfa('0x14'),_0x1e06c2,_0xccfa('0xe'));_0x288999(_0x4da48c[_0xccfa('0x16')][_0xccfa('0x15')]);}})['catch'](function(_0x489dda){logger[_0xccfa('0x12')](_0xccfa('0x14'),_0x1e06c2,_0x489dda);_0x1870d8(_0x489dda);});});}exports[_0xccfa('0x17')]=function(_0x114159){var _0x4cbe85=this;return new Promise(function(_0x264d9c,_0x115433){return db[_0xccfa('0x18')][_0xccfa('0x19')]({'raw':_0x114159[_0xccfa('0x1a')]?_0x114159[_0xccfa('0x1a')][_0xccfa('0x1b')]===undefined?!![]:![]:!![],'where':_0x114159[_0xccfa('0x1a')]?_0x114159[_0xccfa('0x1a')][_0xccfa('0x1c')]||null:null,'attributes':_0x114159['options']?_0x114159[_0xccfa('0x1a')][_0xccfa('0x1d')]||null:null,'limit':_0x114159[_0xccfa('0x1a')]?_0x114159[_0xccfa('0x1a')]['limit']||null:null,'include':_0x114159[_0xccfa('0x1a')]?_0x114159[_0xccfa('0x1a')][_0xccfa('0x1e')]?_[_0xccfa('0x1f')](_0x114159[_0xccfa('0x1a')]['include'],function(_0x450f15){return{'model':db[_0x450f15[_0xccfa('0x20')]],'as':_0x450f15['as'],'attributes':_0x450f15[_0xccfa('0x1d')],'include':_0x450f15[_0xccfa('0x1e')]?_[_0xccfa('0x1f')](_0x450f15[_0xccfa('0x1e')],function(_0x576af2){return{'model':db[_0x576af2['model']],'as':_0x576af2['as'],'attributes':_0x576af2['attributes'],'include':_0x576af2[_0xccfa('0x1e')]?_[_0xccfa('0x1f')](_0x576af2[_0xccfa('0x1e')],function(_0x5733fb){return{'model':db[_0x5733fb[_0xccfa('0x20')]],'as':_0x5733fb['as'],'attributes':_0x5733fb[_0xccfa('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xccfa('0xc')](function(_0x463022){logger['info'](_0xccfa('0x17'),_0x114159);logger['debug'](_0xccfa('0x17'),_0x114159,JSON[_0xccfa('0x11')](_0x463022));_0x264d9c(_0x463022);})[_0xccfa('0x21')](function(_0x516960){logger[_0xccfa('0x12')](_0xccfa('0x17'),_0x516960[_0xccfa('0x15')],_0x114159);_0x115433(_0x4cbe85['error'](0x1f4,_0x516960['message']));});});};exports[_0xccfa('0x22')]=function(_0x4b7a08){var _0x2ffd30=this;return new Promise(function(_0x16d326,_0x357b77){return db[_0xccfa('0x18')][_0xccfa('0x23')]({'raw':_0x4b7a08['options']?_0x4b7a08[_0xccfa('0x1a')][_0xccfa('0x1b')]===undefined?!![]:![]:!![],'where':_0x4b7a08['options']?_0x4b7a08[_0xccfa('0x1a')][_0xccfa('0x1c')]||null:null,'attributes':_0x4b7a08[_0xccfa('0x1a')]?_0x4b7a08[_0xccfa('0x1a')]['attributes']||null:null,'include':_0x4b7a08[_0xccfa('0x1a')]?_0x4b7a08[_0xccfa('0x1a')][_0xccfa('0x1e')]?_['map'](_0x4b7a08[_0xccfa('0x1a')]['include'],function(_0x2af4e6){return{'model':db[_0x2af4e6[_0xccfa('0x20')]],'as':_0x2af4e6['as'],'attributes':_0x2af4e6[_0xccfa('0x1d')],'include':_0x2af4e6[_0xccfa('0x1e')]?_['map'](_0x2af4e6['include'],function(_0x1f6ca7){return{'model':db[_0x1f6ca7['model']],'as':_0x1f6ca7['as'],'attributes':_0x1f6ca7[_0xccfa('0x1d')],'include':_0x1f6ca7[_0xccfa('0x1e')]?_[_0xccfa('0x1f')](_0x1f6ca7['include'],function(_0x18617b){return{'model':db[_0x18617b['model']],'as':_0x18617b['as'],'attributes':_0x18617b[_0xccfa('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xccfa('0xc')](function(_0x26cb61){logger[_0xccfa('0xd')]('ShowSugarcrmAccount',_0x4b7a08);logger[_0xccfa('0xf')](_0xccfa('0x22'),_0x4b7a08,JSON[_0xccfa('0x11')](_0x26cb61));_0x16d326(_0x26cb61);})[_0xccfa('0x21')](function(_0x4eb5c7){logger[_0xccfa('0x12')](_0xccfa('0x22'),_0x4eb5c7[_0xccfa('0x15')],_0x4b7a08);_0x357b77(_0x2ffd30[_0xccfa('0x12')](0x1f4,_0x4eb5c7['message']));});});}; \ No newline at end of file +var _0x79b4=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','attributes','limit','map','include','model','debug','ShowSugarcrmAccount','lodash'];(function(_0x1e7d48,_0x4fd8a6){var _0x45d0b5=function(_0x4fdc0a){while(--_0x4fdc0a){_0x1e7d48['push'](_0x1e7d48['shift']());}};_0x45d0b5(++_0x4fd8a6);}(_0x79b4,0x87));var _0x479b=function(_0x242932,_0x1ff392){_0x242932=_0x242932-0x0;var _0x265ae9=_0x79b4[_0x242932];return _0x265ae9;};'use strict';var _=require(_0x479b('0x0'));var util=require(_0x479b('0x1'));var moment=require(_0x479b('0x2'));var BPromise=require(_0x479b('0x3'));var rs=require(_0x479b('0x4'));var fs=require('fs');var Redis=require(_0x479b('0x5'));var db=require(_0x479b('0x6'))['db'];var utils=require(_0x479b('0x7'));var logger=require(_0x479b('0x8'))(_0x479b('0x9'));var config=require(_0x479b('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x479b('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x53ca92,_0xfcc76c,_0x227662){return new BPromise(function(_0x40f421,_0x2e2079){return client['request'](_0x53ca92,_0x227662)[_0x479b('0xc')](function(_0x15420c){logger[_0x479b('0xd')](_0x479b('0xe'),_0xfcc76c,_0x479b('0xf'));logger['debug'](_0x479b('0x10'),_0xfcc76c,_0x479b('0xf'),JSON[_0x479b('0x11')](_0x15420c));if(_0x15420c[_0x479b('0x12')]){if(_0x15420c[_0x479b('0x12')]['code']===0x1f4){logger[_0x479b('0x12')](_0x479b('0xe'),_0xfcc76c,_0x15420c[_0x479b('0x12')][_0x479b('0x13')]);return _0x2e2079(_0x15420c[_0x479b('0x12')][_0x479b('0x13')]);}logger['error'](_0x479b('0xe'),_0xfcc76c,_0x15420c[_0x479b('0x12')][_0x479b('0x13')]);return _0x40f421(_0x15420c[_0x479b('0x12')][_0x479b('0x13')]);}else{logger[_0x479b('0xd')](_0x479b('0xe'),_0xfcc76c,'request\x20sent');_0x40f421(_0x15420c['result'][_0x479b('0x13')]);}})[_0x479b('0x14')](function(_0x1345f9){logger[_0x479b('0x12')](_0x479b('0xe'),_0xfcc76c,_0x1345f9);_0x2e2079(_0x1345f9);});});}exports[_0x479b('0x15')]=function(_0x983633){var _0x3b85b3=this;return new Promise(function(_0x4956f2,_0x56316b){return db[_0x479b('0x16')][_0x479b('0x17')]({'raw':_0x983633[_0x479b('0x18')]?_0x983633[_0x479b('0x18')][_0x479b('0x19')]===undefined?!![]:![]:!![],'where':_0x983633[_0x479b('0x18')]?_0x983633[_0x479b('0x18')][_0x479b('0x1a')]||null:null,'attributes':_0x983633[_0x479b('0x18')]?_0x983633[_0x479b('0x18')][_0x479b('0x1b')]||null:null,'limit':_0x983633['options']?_0x983633[_0x479b('0x18')][_0x479b('0x1c')]||null:null,'include':_0x983633['options']?_0x983633['options']['include']?_[_0x479b('0x1d')](_0x983633[_0x479b('0x18')][_0x479b('0x1e')],function(_0x3e35f6){return{'model':db[_0x3e35f6[_0x479b('0x1f')]],'as':_0x3e35f6['as'],'attributes':_0x3e35f6[_0x479b('0x1b')],'include':_0x3e35f6['include']?_['map'](_0x3e35f6[_0x479b('0x1e')],function(_0x540abd){return{'model':db[_0x540abd[_0x479b('0x1f')]],'as':_0x540abd['as'],'attributes':_0x540abd[_0x479b('0x1b')],'include':_0x540abd[_0x479b('0x1e')]?_[_0x479b('0x1d')](_0x540abd[_0x479b('0x1e')],function(_0x34c23c){return{'model':db[_0x34c23c[_0x479b('0x1f')]],'as':_0x34c23c['as'],'attributes':_0x34c23c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x14fcd3){logger[_0x479b('0xd')](_0x479b('0x15'),_0x983633);logger[_0x479b('0x20')](_0x479b('0x15'),_0x983633,JSON[_0x479b('0x11')](_0x14fcd3));_0x4956f2(_0x14fcd3);})['catch'](function(_0x293dc4){logger['error'](_0x479b('0x15'),_0x293dc4[_0x479b('0x13')],_0x983633);_0x56316b(_0x3b85b3[_0x479b('0x12')](0x1f4,_0x293dc4[_0x479b('0x13')]));});});};exports[_0x479b('0x21')]=function(_0x1dc1bf){var _0x229a78=this;return new Promise(function(_0xfc3caa,_0x17b21e){return db[_0x479b('0x16')]['find']({'raw':_0x1dc1bf[_0x479b('0x18')]?_0x1dc1bf['options'][_0x479b('0x19')]===undefined?!![]:![]:!![],'where':_0x1dc1bf[_0x479b('0x18')]?_0x1dc1bf[_0x479b('0x18')][_0x479b('0x1a')]||null:null,'attributes':_0x1dc1bf['options']?_0x1dc1bf[_0x479b('0x18')][_0x479b('0x1b')]||null:null,'include':_0x1dc1bf[_0x479b('0x18')]?_0x1dc1bf[_0x479b('0x18')][_0x479b('0x1e')]?_[_0x479b('0x1d')](_0x1dc1bf[_0x479b('0x18')][_0x479b('0x1e')],function(_0x2118ea){return{'model':db[_0x2118ea[_0x479b('0x1f')]],'as':_0x2118ea['as'],'attributes':_0x2118ea[_0x479b('0x1b')],'include':_0x2118ea[_0x479b('0x1e')]?_[_0x479b('0x1d')](_0x2118ea[_0x479b('0x1e')],function(_0x3e4e4e){return{'model':db[_0x3e4e4e[_0x479b('0x1f')]],'as':_0x3e4e4e['as'],'attributes':_0x3e4e4e['attributes'],'include':_0x3e4e4e['include']?_[_0x479b('0x1d')](_0x3e4e4e[_0x479b('0x1e')],function(_0x4edf6f){return{'model':db[_0x4edf6f[_0x479b('0x1f')]],'as':_0x4edf6f['as'],'attributes':_0x4edf6f[_0x479b('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x479b('0xc')](function(_0x4941db){logger[_0x479b('0xd')]('ShowSugarcrmAccount',_0x1dc1bf);logger[_0x479b('0x20')](_0x479b('0x21'),_0x1dc1bf,JSON[_0x479b('0x11')](_0x4941db));_0xfc3caa(_0x4941db);})[_0x479b('0x14')](function(_0x32373c){logger[_0x479b('0x12')](_0x479b('0x21'),_0x32373c[_0x479b('0x13')],_0x1dc1bf);_0x17b21e(_0x229a78['error'](0x1f4,_0x32373c['message']));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 3796a0d..2ef67a8 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 _0x3bb5=['util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','/:id','isAuthenticated','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','create','put','delete','destroy'];(function(_0x2d56b8,_0x266ab2){var _0x46d418=function(_0x2eb46e){while(--_0x2eb46e){_0x2d56b8['push'](_0x2d56b8['shift']());}};_0x46d418(++_0x266ab2);}(_0x3bb5,0xfc));var _0x53bb=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0x3bb5[_0x5a776b];return _0xbbef59;};'use strict';var multer=require('multer');var util=require(_0x53bb('0x0'));var path=require(_0x53bb('0x1'));var timeout=require(_0x53bb('0x2'));var express=require(_0x53bb('0x3'));var router=express[_0x53bb('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x53bb('0x5'));var config=require(_0x53bb('0x6'));var controller=require(_0x53bb('0x7'));router[_0x53bb('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x53bb('0x9'),auth[_0x53bb('0xa')](),controller[_0x53bb('0xb')]);router[_0x53bb('0x8')](_0x53bb('0xc'),auth[_0x53bb('0xa')](),controller[_0x53bb('0xd')]);router[_0x53bb('0x8')]('/:id/subjects',auth['isAuthenticated'](),controller[_0x53bb('0xe')]);router[_0x53bb('0x8')](_0x53bb('0xf'),auth[_0x53bb('0xa')](),controller[_0x53bb('0x10')]);router['post']('/',auth[_0x53bb('0xa')](),controller[_0x53bb('0x11')]);router[_0x53bb('0x12')](_0x53bb('0x9'),auth[_0x53bb('0xa')](),controller['update']);router[_0x53bb('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x53bb('0x14')]);module['exports']=router; \ No newline at end of file +var _0x1204=['/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','update','delete','destroy','exports','multer','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','isAuthenticated','index','/:id','get','/:id/fields'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x1204,0x1c3));var _0x4120=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x1204[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0x4120('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4120('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x4120('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x4120('0x3'));var config=require(_0x4120('0x4'));var controller=require(_0x4120('0x5'));router['get']('/',auth[_0x4120('0x6')](),controller[_0x4120('0x7')]);router['get'](_0x4120('0x8'),auth[_0x4120('0x6')](),controller['show']);router[_0x4120('0x9')](_0x4120('0xa'),auth['isAuthenticated'](),controller['getFields']);router[_0x4120('0x9')](_0x4120('0xb'),auth[_0x4120('0x6')](),controller[_0x4120('0xc')]);router[_0x4120('0x9')](_0x4120('0xd'),auth[_0x4120('0x6')](),controller[_0x4120('0xe')]);router[_0x4120('0xf')]('/',auth[_0x4120('0x6')](),controller[_0x4120('0x10')]);router['put']('/:id',auth[_0x4120('0x6')](),controller[_0x4120('0x11')]);router[_0x4120('0x12')]('/:id',auth[_0x4120('0x6')](),controller[_0x4120('0x13')]);module[_0x4120('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 388775c..6b9d2ca 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 _0x533f=['sequelize','exports'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x533f,0x9e));var _0xf533=function(_0xac151d,_0x4ea1d2){_0xac151d=_0xac151d-0x0;var _0x111dba=_0x533f[_0xac151d];return _0x111dba;};'use strict';var Sequelize=require(_0xf533('0x0'));module[_0xf533('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc751=['exports','STRING','sequelize'];(function(_0x999b85,_0x1edc2b){var _0x1d7124=function(_0x59cd29){while(--_0x59cd29){_0x999b85['push'](_0x999b85['shift']());}};_0x1d7124(++_0x1edc2b);}(_0xc751,0xd4));var _0x1c75=function(_0x348bac,_0x1804b2){_0x348bac=_0x348bac-0x0;var _0x4e2cbf=_0xc751[_0x348bac];return _0x4e2cbf;};'use strict';var Sequelize=require(_0x1c75('0x0'));module[_0x1c75('0x1')]={'name':{'type':Sequelize[_0x1c75('0x2')]},'description':{'type':Sequelize[_0x1c75('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 7c72930..8e7678a 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 _0x35bc=['where','VIRTUAL','merge','SugarcrmConfiguration','includeAll','include','findAll','rows','then','catch','show','params','intersection','find','create','update','body','destroy','getFields','findOne','rawAttributes','order','sort','pick','options','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','Content-Range','json','apply','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','attributes','fields','length','nolimit','filters','filter'];(function(_0x23fb74,_0x3ee528){var _0x67b41f=function(_0xfc00cf){while(--_0xfc00cf){_0x23fb74['push'](_0x23fb74['shift']());}};_0x67b41f(++_0x3ee528);}(_0x35bc,0x1ac));var _0xc35b=function(_0x5f150e,_0x5e3a1e){_0x5f150e=_0x5f150e-0x0;var _0x2f6957=_0x35bc[_0x5f150e];return _0x2f6957;};'use strict';var emlformat=require(_0xc35b('0x0'));var rimraf=require(_0xc35b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc35b('0x2'));var rp=require(_0xc35b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc35b('0x4'));var path=require(_0xc35b('0x5'));var sox=require(_0xc35b('0x6'));var csv=require('to-csv');var ejs=require(_0xc35b('0x7'));var fs=require('fs');var fs_extra=require(_0xc35b('0x8'));var _=require(_0xc35b('0x9'));var squel=require(_0xc35b('0xa'));var crypto=require(_0xc35b('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xc35b('0xc'));var toCsv=require(_0xc35b('0xd'));var querystring=require(_0xc35b('0xe'));var Papa=require(_0xc35b('0xf'));var Redis=require('ioredis');var authService=require(_0xc35b('0x10'));var qs=require(_0xc35b('0x11'));var as=require(_0xc35b('0x12'));var hardwareService=require(_0xc35b('0x13'));var logger=require(_0xc35b('0x14'))(_0xc35b('0x15'));var utils=require('../../config/utils');var config=require(_0xc35b('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xc35b('0x17'))['db'];function respondWithStatusCode(_0xe2b14f,_0x56d458){_0x56d458=_0x56d458||0xcc;return function(_0x36be63){if(_0x36be63){return _0xe2b14f[_0xc35b('0x18')](_0x56d458);}return _0xe2b14f['status'](_0x56d458)[_0xc35b('0x19')]();};}function respondWithResult(_0x5843e6,_0x47ab95){_0x47ab95=_0x47ab95||0xc8;return function(_0x2aabed){if(_0x2aabed){return _0x5843e6[_0xc35b('0x1a')](_0x47ab95)['json'](_0x2aabed);}};}function respondWithFilteredResult(_0x2263a5,_0x51e645){return function(_0x377467){if(_0x377467){var _0x2c5226=typeof _0x51e645[_0xc35b('0x1b')]===_0xc35b('0x1c')&&typeof _0x51e645['limit']===_0xc35b('0x1c');var _0x871892=_0x377467[_0xc35b('0x1d')];var _0x1561a7=_0x2c5226?0x0:_0x51e645[_0xc35b('0x1b')];var _0x190f0e=_0x2c5226?_0x377467[_0xc35b('0x1d')]:_0x51e645[_0xc35b('0x1b')]+_0x51e645[_0xc35b('0x1e')];var _0x4b9b79;if(_0x190f0e>=_0x871892){_0x190f0e=_0x871892;_0x4b9b79=0xc8;}else{_0x4b9b79=0xce;}_0x2263a5[_0xc35b('0x1a')](_0x4b9b79);return _0x2263a5['set'](_0xc35b('0x1f'),_0x1561a7+'-'+_0x190f0e+'/'+_0x871892)[_0xc35b('0x20')](_0x377467);}return null;};}function patchUpdates(_0x18b9e6){return function(_0x531cd5){try{jsonpatch[_0xc35b('0x21')](_0x531cd5,_0x18b9e6,!![]);}catch(_0x24cf62){return BPromise['reject'](_0x24cf62);}return _0x531cd5['save']();};}function saveUpdates(_0x42b32d,_0x5090b5){return function(_0x1437fd){if(_0x1437fd){return _0x1437fd['update'](_0x42b32d)['then'](function(_0x1abd84){return _0x1abd84;});}return null;};}function removeEntity(_0x26a608,_0x57d1eb){return function(_0x331302){if(_0x331302){return _0x331302['destroy']()['then'](function(){_0x26a608[_0xc35b('0x1a')](0xcc)[_0xc35b('0x19')]();});}};}function handleEntityNotFound(_0x5dd351,_0x14e062){return function(_0x551c99){if(!_0x551c99){_0x5dd351['sendStatus'](0x194);}return _0x551c99;};}function handleError(_0x93054a,_0x402dce){_0x402dce=_0x402dce||0x1f4;return function(_0x5200b2){logger[_0xc35b('0x22')](_0x5200b2[_0xc35b('0x23')]);if(_0x5200b2[_0xc35b('0x24')]){delete _0x5200b2[_0xc35b('0x24')];}_0x93054a[_0xc35b('0x1a')](_0x402dce)[_0xc35b('0x25')](_0x5200b2);};}exports[_0xc35b('0x26')]=function(_0x3b04c9,_0x5bb094){var _0x18af48={},_0x8a132={},_0x6d5ebb={'count':0x0,'rows':[]};var _0x33a601=_[_0xc35b('0x27')](db['SugarcrmConfiguration']['rawAttributes'],function(_0x34c999){return{'name':_0x34c999[_0xc35b('0x28')],'type':_0x34c999[_0xc35b('0x29')][_0xc35b('0x2a')]};});_0x8a132[_0xc35b('0x2b')]=_['map'](_0x33a601,_0xc35b('0x24'));_0x8a132[_0xc35b('0x2c')]=_[_0xc35b('0x2d')](_0x3b04c9['query']);_0x8a132['filters']=_['intersection'](_0x8a132[_0xc35b('0x2b')],_0x8a132[_0xc35b('0x2c')]);_0x18af48[_0xc35b('0x2e')]=_['intersection'](_0x8a132[_0xc35b('0x2b')],qs[_0xc35b('0x2f')](_0x3b04c9[_0xc35b('0x2c')][_0xc35b('0x2f')]));_0x18af48[_0xc35b('0x2e')]=_0x18af48[_0xc35b('0x2e')][_0xc35b('0x30')]?_0x18af48[_0xc35b('0x2e')]:_0x8a132[_0xc35b('0x2b')];if(!_0x3b04c9[_0xc35b('0x2c')]['hasOwnProperty'](_0xc35b('0x31'))){_0x18af48['limit']=qs[_0xc35b('0x1e')](_0x3b04c9[_0xc35b('0x2c')][_0xc35b('0x1e')]);_0x18af48[_0xc35b('0x1b')]=qs['offset'](_0x3b04c9[_0xc35b('0x2c')][_0xc35b('0x1b')]);}_0x18af48['order']=qs['sort'](_0x3b04c9[_0xc35b('0x2c')]['sort']);_0x18af48['where']=qs[_0xc35b('0x32')](_['pick'](_0x3b04c9['query'],_0x8a132[_0xc35b('0x32')]),_0x33a601);if(_0x3b04c9[_0xc35b('0x2c')][_0xc35b('0x33')]){_0x18af48[_0xc35b('0x34')]=_['merge'](_0x18af48[_0xc35b('0x34')],{'$or':_[_0xc35b('0x27')](_0x33a601,function(_0x1b0de6){if(_0x1b0de6[_0xc35b('0x29')]!==_0xc35b('0x35')){var _0x4319f7={};_0x4319f7[_0x1b0de6['name']]={'$like':'%'+_0x3b04c9[_0xc35b('0x2c')][_0xc35b('0x33')]+'%'};return _0x4319f7;}})});}_0x18af48=_[_0xc35b('0x36')]({},_0x18af48,_0x3b04c9['options']);var _0x29dcd6={'where':_0x18af48['where']};return db[_0xc35b('0x37')]['count'](_0x29dcd6)['then'](function(_0x35a80b){_0x6d5ebb[_0xc35b('0x1d')]=_0x35a80b;if(_0x3b04c9[_0xc35b('0x2c')][_0xc35b('0x38')]){_0x18af48[_0xc35b('0x39')]=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0xc35b('0x3a')](_0x18af48);})['then'](function(_0x3c88a8){_0x6d5ebb[_0xc35b('0x3b')]=_0x3c88a8;return _0x6d5ebb;})[_0xc35b('0x3c')](respondWithFilteredResult(_0x5bb094,_0x18af48))[_0xc35b('0x3d')](handleError(_0x5bb094,null));};exports[_0xc35b('0x3e')]=function(_0x22ae55,_0x38c1bb){var _0x1946a0={'raw':![],'where':{'id':_0x22ae55[_0xc35b('0x3f')]['id']}},_0x596aef={};_0x596aef[_0xc35b('0x2b')]=_[_0xc35b('0x2d')](db[_0xc35b('0x37')]['rawAttributes']);_0x596aef[_0xc35b('0x2c')]=_[_0xc35b('0x2d')](_0x22ae55[_0xc35b('0x2c')]);_0x596aef[_0xc35b('0x32')]=_['intersection'](_0x596aef[_0xc35b('0x2b')],_0x596aef[_0xc35b('0x2c')]);_0x1946a0[_0xc35b('0x2e')]=_[_0xc35b('0x40')](_0x596aef['model'],qs[_0xc35b('0x2f')](_0x22ae55[_0xc35b('0x2c')][_0xc35b('0x2f')]));_0x1946a0[_0xc35b('0x2e')]=_0x1946a0['attributes'][_0xc35b('0x30')]?_0x1946a0[_0xc35b('0x2e')]:_0x596aef[_0xc35b('0x2b')];if(_0x22ae55['query'][_0xc35b('0x38')]){_0x1946a0[_0xc35b('0x39')]=[{'all':!![]}];}_0x1946a0=_[_0xc35b('0x36')]({},_0x1946a0,_0x22ae55['options']);return db[_0xc35b('0x37')][_0xc35b('0x41')](_0x1946a0)[_0xc35b('0x3c')](handleEntityNotFound(_0x38c1bb,null))[_0xc35b('0x3c')](respondWithResult(_0x38c1bb,null))[_0xc35b('0x3d')](handleError(_0x38c1bb,null));};exports['create']=function(_0x62d42e,_0x57c6f5){return db['SugarcrmConfiguration'][_0xc35b('0x42')](_0x62d42e['body'],{})[_0xc35b('0x3c')](respondWithResult(_0x57c6f5,0xc9))['catch'](handleError(_0x57c6f5,null));};exports[_0xc35b('0x43')]=function(_0x3c86b1,_0x54c2c2){if(_0x3c86b1[_0xc35b('0x44')]['id']){delete _0x3c86b1[_0xc35b('0x44')]['id'];}return db[_0xc35b('0x37')][_0xc35b('0x41')]({'where':{'id':_0x3c86b1[_0xc35b('0x3f')]['id']}})[_0xc35b('0x3c')](handleEntityNotFound(_0x54c2c2,null))[_0xc35b('0x3c')](saveUpdates(_0x3c86b1[_0xc35b('0x44')],null))[_0xc35b('0x3c')](respondWithResult(_0x54c2c2,null))[_0xc35b('0x3d')](handleError(_0x54c2c2,null));};exports[_0xc35b('0x45')]=function(_0x1ddd31,_0x55308f){return db['SugarcrmConfiguration'][_0xc35b('0x41')]({'where':{'id':_0x1ddd31[_0xc35b('0x3f')]['id']}})[_0xc35b('0x3c')](handleEntityNotFound(_0x55308f,null))[_0xc35b('0x3c')](removeEntity(_0x55308f,null))[_0xc35b('0x3d')](handleError(_0x55308f,null));};exports[_0xc35b('0x46')]=function(_0x28a570,_0x16b3d1,_0x18aac7){var _0x3af57f={};var _0x517754={};var _0x3f1858;var _0xca0814;return db[_0xc35b('0x37')][_0xc35b('0x47')]({'where':{'id':_0x28a570['params']['id']}})['then'](handleEntityNotFound(_0x16b3d1,null))[_0xc35b('0x3c')](function(_0x22cc28){if(_0x22cc28){_0x3f1858=_0x22cc28;_0x517754[_0xc35b('0x2b')]=_['keys'](db['SugarcrmField'][_0xc35b('0x48')]);_0x517754['query']=_[_0xc35b('0x2d')](_0x28a570[_0xc35b('0x2c')]);_0x517754[_0xc35b('0x32')]=_[_0xc35b('0x40')](_0x517754[_0xc35b('0x2b')],_0x517754[_0xc35b('0x2c')]);_0x3af57f[_0xc35b('0x2e')]=_[_0xc35b('0x40')](_0x517754[_0xc35b('0x2b')],qs[_0xc35b('0x2f')](_0x28a570[_0xc35b('0x2c')][_0xc35b('0x2f')]));_0x3af57f[_0xc35b('0x2e')]=_0x3af57f[_0xc35b('0x2e')][_0xc35b('0x30')]?_0x3af57f[_0xc35b('0x2e')]:_0x517754[_0xc35b('0x2b')];_0x3af57f[_0xc35b('0x49')]=qs[_0xc35b('0x4a')](_0x28a570[_0xc35b('0x2c')]['sort']);_0x3af57f[_0xc35b('0x34')]=qs[_0xc35b('0x32')](_[_0xc35b('0x4b')](_0x28a570[_0xc35b('0x2c')],_0x517754['filters']));if(_0x28a570[_0xc35b('0x2c')]['filter']){_0x3af57f['where']=_[_0xc35b('0x36')](_0x3af57f[_0xc35b('0x34')],{'$or':_[_0xc35b('0x27')](_0x3af57f[_0xc35b('0x2e')],function(_0x36c26c){var _0x3871ff={};_0x3871ff[_0x36c26c]={'$like':'%'+_0x28a570[_0xc35b('0x2c')][_0xc35b('0x33')]+'%'};return _0x3871ff;})});}_0x3af57f=_[_0xc35b('0x36')]({},_0x3af57f,_0x28a570[_0xc35b('0x4c')]);return _0x3f1858[_0xc35b('0x46')](_0x3af57f);}})[_0xc35b('0x3c')](function(_0x5af880){if(_0x5af880){_0xca0814=_0x5af880['length'];if(!_0x28a570[_0xc35b('0x2c')][_0xc35b('0x4d')](_0xc35b('0x31'))){_0x3af57f[_0xc35b('0x1e')]=qs[_0xc35b('0x1e')](_0x28a570[_0xc35b('0x2c')][_0xc35b('0x1e')]);_0x3af57f[_0xc35b('0x1b')]=qs[_0xc35b('0x1b')](_0x28a570[_0xc35b('0x2c')][_0xc35b('0x1b')]);}return _0x3f1858[_0xc35b('0x46')](_0x3af57f);}})[_0xc35b('0x3c')](function(_0x8df892){if(_0x8df892){return _0x8df892?{'count':_0xca0814,'rows':_0x8df892}:null;}})['then'](respondWithResult(_0x16b3d1,null))[_0xc35b('0x3d')](handleError(_0x16b3d1,null));};exports[_0xc35b('0x4e')]=function(_0x403710,_0x3768cc,_0x136a62){var _0x1e0416={};var _0x47fc3f={};var _0x33a220;var _0x214382;return db[_0xc35b('0x37')][_0xc35b('0x47')]({'where':{'id':_0x403710['params']['id']}})[_0xc35b('0x3c')](handleEntityNotFound(_0x3768cc,null))[_0xc35b('0x3c')](function(_0x28ba41){if(_0x28ba41){_0x33a220=_0x28ba41;_0x47fc3f['model']=_['keys'](db['SugarcrmField']['rawAttributes']);_0x47fc3f[_0xc35b('0x2c')]=_[_0xc35b('0x2d')](_0x403710[_0xc35b('0x2c')]);_0x47fc3f[_0xc35b('0x32')]=_['intersection'](_0x47fc3f[_0xc35b('0x2b')],_0x47fc3f[_0xc35b('0x2c')]);_0x1e0416['attributes']=_[_0xc35b('0x40')](_0x47fc3f['model'],qs['fields'](_0x403710['query'][_0xc35b('0x2f')]));_0x1e0416['attributes']=_0x1e0416[_0xc35b('0x2e')][_0xc35b('0x30')]?_0x1e0416[_0xc35b('0x2e')]:_0x47fc3f[_0xc35b('0x2b')];_0x1e0416[_0xc35b('0x49')]=qs[_0xc35b('0x4a')](_0x403710[_0xc35b('0x2c')][_0xc35b('0x4a')]);_0x1e0416[_0xc35b('0x34')]=qs[_0xc35b('0x32')](_['pick'](_0x403710['query'],_0x47fc3f[_0xc35b('0x32')]));if(_0x403710[_0xc35b('0x2c')][_0xc35b('0x33')]){_0x1e0416['where']=_['merge'](_0x1e0416[_0xc35b('0x34')],{'$or':_['map'](_0x1e0416['attributes'],function(_0x8a7bf8){var _0x35439c={};_0x35439c[_0x8a7bf8]={'$like':'%'+_0x403710[_0xc35b('0x2c')]['filter']+'%'};return _0x35439c;})});}_0x1e0416=_[_0xc35b('0x36')]({},_0x1e0416,_0x403710[_0xc35b('0x4c')]);return _0x33a220['getSubjects'](_0x1e0416);}})['then'](function(_0x532a60){if(_0x532a60){_0x214382=_0x532a60[_0xc35b('0x30')];if(!_0x403710['query']['hasOwnProperty'](_0xc35b('0x31'))){_0x1e0416[_0xc35b('0x1e')]=qs['limit'](_0x403710[_0xc35b('0x2c')][_0xc35b('0x1e')]);_0x1e0416[_0xc35b('0x1b')]=qs['offset'](_0x403710[_0xc35b('0x2c')][_0xc35b('0x1b')]);}return _0x33a220['getSubjects'](_0x1e0416);}})['then'](function(_0x30276d){if(_0x30276d){return _0x30276d?{'count':_0x214382,'rows':_0x30276d}:null;}})[_0xc35b('0x3c')](respondWithResult(_0x3768cc,null))[_0xc35b('0x3d')](handleError(_0x3768cc,null));};exports[_0xc35b('0x4f')]=function(_0x35f042,_0x2bb7cc,_0x542023){var _0x4dfb07={};var _0x3cd80f={};var _0x76c88c;var _0x21f935;return db[_0xc35b('0x37')]['findOne']({'where':{'id':_0x35f042['params']['id']}})[_0xc35b('0x3c')](handleEntityNotFound(_0x2bb7cc,null))[_0xc35b('0x3c')](function(_0x3b327f){if(_0x3b327f){_0x76c88c=_0x3b327f;_0x3cd80f[_0xc35b('0x2b')]=_[_0xc35b('0x2d')](db['SugarcrmField'][_0xc35b('0x48')]);_0x3cd80f[_0xc35b('0x2c')]=_[_0xc35b('0x2d')](_0x35f042[_0xc35b('0x2c')]);_0x3cd80f['filters']=_[_0xc35b('0x40')](_0x3cd80f['model'],_0x3cd80f['query']);_0x4dfb07[_0xc35b('0x2e')]=_[_0xc35b('0x40')](_0x3cd80f['model'],qs[_0xc35b('0x2f')](_0x35f042['query'][_0xc35b('0x2f')]));_0x4dfb07[_0xc35b('0x2e')]=_0x4dfb07[_0xc35b('0x2e')][_0xc35b('0x30')]?_0x4dfb07[_0xc35b('0x2e')]:_0x3cd80f[_0xc35b('0x2b')];_0x4dfb07[_0xc35b('0x49')]=qs['sort'](_0x35f042[_0xc35b('0x2c')][_0xc35b('0x4a')]);_0x4dfb07[_0xc35b('0x34')]=qs['filters'](_['pick'](_0x35f042[_0xc35b('0x2c')],_0x3cd80f[_0xc35b('0x32')]));if(_0x35f042[_0xc35b('0x2c')]['filter']){_0x4dfb07[_0xc35b('0x34')]=_[_0xc35b('0x36')](_0x4dfb07['where'],{'$or':_[_0xc35b('0x27')](_0x4dfb07['attributes'],function(_0x2a4227){var _0x93326d={};_0x93326d[_0x2a4227]={'$like':'%'+_0x35f042['query'][_0xc35b('0x33')]+'%'};return _0x93326d;})});}_0x4dfb07=_['merge']({},_0x4dfb07,_0x35f042['options']);return _0x76c88c[_0xc35b('0x4f')](_0x4dfb07);}})[_0xc35b('0x3c')](function(_0x289aaa){if(_0x289aaa){_0x21f935=_0x289aaa['length'];if(!_0x35f042[_0xc35b('0x2c')][_0xc35b('0x4d')](_0xc35b('0x31'))){_0x4dfb07['limit']=qs[_0xc35b('0x1e')](_0x35f042['query'][_0xc35b('0x1e')]);_0x4dfb07[_0xc35b('0x1b')]=qs[_0xc35b('0x1b')](_0x35f042[_0xc35b('0x2c')][_0xc35b('0x1b')]);}return _0x76c88c[_0xc35b('0x4f')](_0x4dfb07);}})[_0xc35b('0x3c')](function(_0x20969f){if(_0x20969f){return _0x20969f?{'count':_0x21f935,'rows':_0x20969f}:null;}})['then'](respondWithResult(_0x2bb7cc,null))[_0xc35b('0x3d')](handleError(_0x2bb7cc,null));}; \ No newline at end of file +var _0xbe54=['count','offset','set','Content-Range','apply','reject','then','destroy','stack','name','send','index','map','SugarcrmConfiguration','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','limit','sort','filters','pick','where','merge','filter','includeAll','include','catch','params','length','options','find','create','body','update','getFields','nolimit','getSubjects','findOne','SugarcrmField','order','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined'];(function(_0x13351b,_0x4e3a84){var _0x1c73c7=function(_0x4eacbd){while(--_0x4eacbd){_0x13351b['push'](_0x13351b['shift']());}};_0x1c73c7(++_0x4e3a84);}(_0xbe54,0x117));var _0x4be5=function(_0x191e67,_0x56a9d8){_0x191e67=_0x191e67-0x0;var _0x597695=_0xbe54[_0x191e67];return _0x597695;};'use strict';var emlformat=require(_0x4be5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4be5('0x1'));var jsonpatch=require(_0x4be5('0x2'));var rp=require(_0x4be5('0x3'));var moment=require('moment');var BPromise=require(_0x4be5('0x4'));var Mustache=require(_0x4be5('0x5'));var util=require('util');var path=require(_0x4be5('0x6'));var sox=require('sox');var csv=require(_0x4be5('0x7'));var ejs=require(_0x4be5('0x8'));var fs=require('fs');var fs_extra=require(_0x4be5('0x9'));var _=require(_0x4be5('0xa'));var squel=require('squel');var crypto=require(_0x4be5('0xb'));var jsforce=require(_0x4be5('0xc'));var deskjs=require(_0x4be5('0xd'));var toCsv=require(_0x4be5('0x7'));var querystring=require(_0x4be5('0xe'));var Papa=require('papaparse');var Redis=require(_0x4be5('0xf'));var authService=require(_0x4be5('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x4be5('0x11'));var hardwareService=require(_0x4be5('0x12'));var logger=require(_0x4be5('0x13'))(_0x4be5('0x14'));var utils=require(_0x4be5('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x4be5('0x16'));var db=require(_0x4be5('0x17'))['db'];function respondWithStatusCode(_0x700e0f,_0x5759df){_0x5759df=_0x5759df||0xcc;return function(_0x3d731e){if(_0x3d731e){return _0x700e0f[_0x4be5('0x18')](_0x5759df);}return _0x700e0f[_0x4be5('0x19')](_0x5759df)[_0x4be5('0x1a')]();};}function respondWithResult(_0x15d5ed,_0x557ddc){_0x557ddc=_0x557ddc||0xc8;return function(_0x57e3e3){if(_0x57e3e3){return _0x15d5ed[_0x4be5('0x19')](_0x557ddc)[_0x4be5('0x1b')](_0x57e3e3);}};}function respondWithFilteredResult(_0x172ae6,_0x2b40ec){return function(_0x1c3d6a){if(_0x1c3d6a){var _0x446f74=typeof _0x2b40ec['offset']===_0x4be5('0x1c')&&typeof _0x2b40ec['limit']===_0x4be5('0x1c');var _0x4963fd=_0x1c3d6a[_0x4be5('0x1d')];var _0x414966=_0x446f74?0x0:_0x2b40ec[_0x4be5('0x1e')];var _0x281608=_0x446f74?_0x1c3d6a[_0x4be5('0x1d')]:_0x2b40ec[_0x4be5('0x1e')]+_0x2b40ec['limit'];var _0x3a566f;if(_0x281608>=_0x4963fd){_0x281608=_0x4963fd;_0x3a566f=0xc8;}else{_0x3a566f=0xce;}_0x172ae6['status'](_0x3a566f);return _0x172ae6[_0x4be5('0x1f')](_0x4be5('0x20'),_0x414966+'-'+_0x281608+'/'+_0x4963fd)[_0x4be5('0x1b')](_0x1c3d6a);}return null;};}function patchUpdates(_0xeaad3a){return function(_0x14bd36){try{jsonpatch[_0x4be5('0x21')](_0x14bd36,_0xeaad3a,!![]);}catch(_0x40dbff){return BPromise[_0x4be5('0x22')](_0x40dbff);}return _0x14bd36['save']();};}function saveUpdates(_0x109302,_0x785c87){return function(_0x43384e){if(_0x43384e){return _0x43384e['update'](_0x109302)[_0x4be5('0x23')](function(_0x5e2c21){return _0x5e2c21;});}return null;};}function removeEntity(_0x26151e,_0x1a65c6){return function(_0x5103d7){if(_0x5103d7){return _0x5103d7[_0x4be5('0x24')]()[_0x4be5('0x23')](function(){_0x26151e['status'](0xcc)[_0x4be5('0x1a')]();});}};}function handleEntityNotFound(_0xf4f760,_0x3251d1){return function(_0x34bac4){if(!_0x34bac4){_0xf4f760[_0x4be5('0x18')](0x194);}return _0x34bac4;};}function handleError(_0x421382,_0x3a4540){_0x3a4540=_0x3a4540||0x1f4;return function(_0xd19ef1){logger['error'](_0xd19ef1[_0x4be5('0x25')]);if(_0xd19ef1['name']){delete _0xd19ef1[_0x4be5('0x26')];}_0x421382[_0x4be5('0x19')](_0x3a4540)[_0x4be5('0x27')](_0xd19ef1);};}exports[_0x4be5('0x28')]=function(_0x2b3dcb,_0x231dea){var _0x84ea97={},_0xbe9ace={},_0x1e38cf={'count':0x0,'rows':[]};var _0x1082cc=_[_0x4be5('0x29')](db[_0x4be5('0x2a')][_0x4be5('0x2b')],function(_0x633c1f){return{'name':_0x633c1f['fieldName'],'type':_0x633c1f[_0x4be5('0x2c')][_0x4be5('0x2d')]};});_0xbe9ace[_0x4be5('0x2e')]=_[_0x4be5('0x29')](_0x1082cc,_0x4be5('0x26'));_0xbe9ace[_0x4be5('0x2f')]=_[_0x4be5('0x30')](_0x2b3dcb[_0x4be5('0x2f')]);_0xbe9ace['filters']=_[_0x4be5('0x31')](_0xbe9ace[_0x4be5('0x2e')],_0xbe9ace[_0x4be5('0x2f')]);_0x84ea97[_0x4be5('0x32')]=_[_0x4be5('0x31')](_0xbe9ace[_0x4be5('0x2e')],qs[_0x4be5('0x33')](_0x2b3dcb[_0x4be5('0x2f')][_0x4be5('0x33')]));_0x84ea97[_0x4be5('0x32')]=_0x84ea97['attributes']['length']?_0x84ea97[_0x4be5('0x32')]:_0xbe9ace[_0x4be5('0x2e')];if(!_0x2b3dcb['query'][_0x4be5('0x34')]('nolimit')){_0x84ea97[_0x4be5('0x35')]=qs[_0x4be5('0x35')](_0x2b3dcb[_0x4be5('0x2f')][_0x4be5('0x35')]);_0x84ea97[_0x4be5('0x1e')]=qs[_0x4be5('0x1e')](_0x2b3dcb[_0x4be5('0x2f')][_0x4be5('0x1e')]);}_0x84ea97['order']=qs[_0x4be5('0x36')](_0x2b3dcb[_0x4be5('0x2f')][_0x4be5('0x36')]);_0x84ea97['where']=qs[_0x4be5('0x37')](_[_0x4be5('0x38')](_0x2b3dcb[_0x4be5('0x2f')],_0xbe9ace[_0x4be5('0x37')]),_0x1082cc);if(_0x2b3dcb[_0x4be5('0x2f')]['filter']){_0x84ea97[_0x4be5('0x39')]=_[_0x4be5('0x3a')](_0x84ea97['where'],{'$or':_[_0x4be5('0x29')](_0x1082cc,function(_0x3d9adc){if(_0x3d9adc[_0x4be5('0x2c')]!=='VIRTUAL'){var _0x2c066b={};_0x2c066b[_0x3d9adc[_0x4be5('0x26')]]={'$like':'%'+_0x2b3dcb[_0x4be5('0x2f')][_0x4be5('0x3b')]+'%'};return _0x2c066b;}})});}_0x84ea97=_['merge']({},_0x84ea97,_0x2b3dcb['options']);var _0x3923ef={'where':_0x84ea97[_0x4be5('0x39')]};return db[_0x4be5('0x2a')]['count'](_0x3923ef)[_0x4be5('0x23')](function(_0x50ded8){_0x1e38cf[_0x4be5('0x1d')]=_0x50ded8;if(_0x2b3dcb[_0x4be5('0x2f')][_0x4be5('0x3c')]){_0x84ea97[_0x4be5('0x3d')]=[{'all':!![]}];}return db[_0x4be5('0x2a')]['findAll'](_0x84ea97);})[_0x4be5('0x23')](function(_0x539402){_0x1e38cf['rows']=_0x539402;return _0x1e38cf;})[_0x4be5('0x23')](respondWithFilteredResult(_0x231dea,_0x84ea97))[_0x4be5('0x3e')](handleError(_0x231dea,null));};exports['show']=function(_0xfaf4ee,_0x529fb9){var _0x4169dc={'raw':![],'where':{'id':_0xfaf4ee[_0x4be5('0x3f')]['id']}},_0x518e91={};_0x518e91[_0x4be5('0x2e')]=_['keys'](db[_0x4be5('0x2a')][_0x4be5('0x2b')]);_0x518e91[_0x4be5('0x2f')]=_[_0x4be5('0x30')](_0xfaf4ee[_0x4be5('0x2f')]);_0x518e91[_0x4be5('0x37')]=_[_0x4be5('0x31')](_0x518e91[_0x4be5('0x2e')],_0x518e91['query']);_0x4169dc[_0x4be5('0x32')]=_[_0x4be5('0x31')](_0x518e91[_0x4be5('0x2e')],qs[_0x4be5('0x33')](_0xfaf4ee[_0x4be5('0x2f')][_0x4be5('0x33')]));_0x4169dc['attributes']=_0x4169dc[_0x4be5('0x32')][_0x4be5('0x40')]?_0x4169dc['attributes']:_0x518e91['model'];if(_0xfaf4ee[_0x4be5('0x2f')][_0x4be5('0x3c')]){_0x4169dc[_0x4be5('0x3d')]=[{'all':!![]}];}_0x4169dc=_[_0x4be5('0x3a')]({},_0x4169dc,_0xfaf4ee[_0x4be5('0x41')]);return db[_0x4be5('0x2a')][_0x4be5('0x42')](_0x4169dc)[_0x4be5('0x23')](handleEntityNotFound(_0x529fb9,null))['then'](respondWithResult(_0x529fb9,null))['catch'](handleError(_0x529fb9,null));};exports[_0x4be5('0x43')]=function(_0x6aaf1c,_0x5c4ee2){return db[_0x4be5('0x2a')][_0x4be5('0x43')](_0x6aaf1c[_0x4be5('0x44')],{})[_0x4be5('0x23')](respondWithResult(_0x5c4ee2,0xc9))[_0x4be5('0x3e')](handleError(_0x5c4ee2,null));};exports[_0x4be5('0x45')]=function(_0x873f32,_0x58424c){if(_0x873f32[_0x4be5('0x44')]['id']){delete _0x873f32[_0x4be5('0x44')]['id'];}return db[_0x4be5('0x2a')][_0x4be5('0x42')]({'where':{'id':_0x873f32[_0x4be5('0x3f')]['id']}})[_0x4be5('0x23')](handleEntityNotFound(_0x58424c,null))[_0x4be5('0x23')](saveUpdates(_0x873f32[_0x4be5('0x44')],null))[_0x4be5('0x23')](respondWithResult(_0x58424c,null))[_0x4be5('0x3e')](handleError(_0x58424c,null));};exports['destroy']=function(_0x514495,_0x38400e){return db[_0x4be5('0x2a')][_0x4be5('0x42')]({'where':{'id':_0x514495[_0x4be5('0x3f')]['id']}})[_0x4be5('0x23')](handleEntityNotFound(_0x38400e,null))[_0x4be5('0x23')](removeEntity(_0x38400e,null))[_0x4be5('0x3e')](handleError(_0x38400e,null));};exports[_0x4be5('0x46')]=function(_0x47e4a1,_0x244e4d,_0x588064){var _0x13f68a={};var _0x859310={};var _0xfc9462;var _0x153a7a;return db[_0x4be5('0x2a')]['findOne']({'where':{'id':_0x47e4a1['params']['id']}})[_0x4be5('0x23')](handleEntityNotFound(_0x244e4d,null))[_0x4be5('0x23')](function(_0x3b61b0){if(_0x3b61b0){_0xfc9462=_0x3b61b0;_0x859310['model']=_['keys'](db['SugarcrmField'][_0x4be5('0x2b')]);_0x859310['query']=_[_0x4be5('0x30')](_0x47e4a1['query']);_0x859310[_0x4be5('0x37')]=_[_0x4be5('0x31')](_0x859310[_0x4be5('0x2e')],_0x859310[_0x4be5('0x2f')]);_0x13f68a[_0x4be5('0x32')]=_[_0x4be5('0x31')](_0x859310[_0x4be5('0x2e')],qs['fields'](_0x47e4a1[_0x4be5('0x2f')][_0x4be5('0x33')]));_0x13f68a[_0x4be5('0x32')]=_0x13f68a[_0x4be5('0x32')][_0x4be5('0x40')]?_0x13f68a['attributes']:_0x859310[_0x4be5('0x2e')];_0x13f68a['order']=qs['sort'](_0x47e4a1[_0x4be5('0x2f')][_0x4be5('0x36')]);_0x13f68a[_0x4be5('0x39')]=qs[_0x4be5('0x37')](_[_0x4be5('0x38')](_0x47e4a1[_0x4be5('0x2f')],_0x859310[_0x4be5('0x37')]));if(_0x47e4a1[_0x4be5('0x2f')][_0x4be5('0x3b')]){_0x13f68a[_0x4be5('0x39')]=_[_0x4be5('0x3a')](_0x13f68a[_0x4be5('0x39')],{'$or':_['map'](_0x13f68a[_0x4be5('0x32')],function(_0x2fd613){var _0x2ab603={};_0x2ab603[_0x2fd613]={'$like':'%'+_0x47e4a1[_0x4be5('0x2f')][_0x4be5('0x3b')]+'%'};return _0x2ab603;})});}_0x13f68a=_[_0x4be5('0x3a')]({},_0x13f68a,_0x47e4a1[_0x4be5('0x41')]);return _0xfc9462[_0x4be5('0x46')](_0x13f68a);}})[_0x4be5('0x23')](function(_0x3e7bfd){if(_0x3e7bfd){_0x153a7a=_0x3e7bfd[_0x4be5('0x40')];if(!_0x47e4a1[_0x4be5('0x2f')]['hasOwnProperty'](_0x4be5('0x47'))){_0x13f68a[_0x4be5('0x35')]=qs[_0x4be5('0x35')](_0x47e4a1['query']['limit']);_0x13f68a['offset']=qs[_0x4be5('0x1e')](_0x47e4a1[_0x4be5('0x2f')]['offset']);}return _0xfc9462[_0x4be5('0x46')](_0x13f68a);}})[_0x4be5('0x23')](function(_0x2180a1){if(_0x2180a1){return _0x2180a1?{'count':_0x153a7a,'rows':_0x2180a1}:null;}})[_0x4be5('0x23')](respondWithResult(_0x244e4d,null))[_0x4be5('0x3e')](handleError(_0x244e4d,null));};exports[_0x4be5('0x48')]=function(_0x4f0b7f,_0x3c77dc,_0x596b9e){var _0x262217={};var _0x1e9620={};var _0x510f0a;var _0xe44cd6;return db[_0x4be5('0x2a')][_0x4be5('0x49')]({'where':{'id':_0x4f0b7f['params']['id']}})['then'](handleEntityNotFound(_0x3c77dc,null))[_0x4be5('0x23')](function(_0x51bca7){if(_0x51bca7){_0x510f0a=_0x51bca7;_0x1e9620[_0x4be5('0x2e')]=_[_0x4be5('0x30')](db[_0x4be5('0x4a')][_0x4be5('0x2b')]);_0x1e9620['query']=_[_0x4be5('0x30')](_0x4f0b7f[_0x4be5('0x2f')]);_0x1e9620[_0x4be5('0x37')]=_[_0x4be5('0x31')](_0x1e9620['model'],_0x1e9620['query']);_0x262217['attributes']=_[_0x4be5('0x31')](_0x1e9620[_0x4be5('0x2e')],qs[_0x4be5('0x33')](_0x4f0b7f['query'][_0x4be5('0x33')]));_0x262217['attributes']=_0x262217[_0x4be5('0x32')][_0x4be5('0x40')]?_0x262217[_0x4be5('0x32')]:_0x1e9620[_0x4be5('0x2e')];_0x262217[_0x4be5('0x4b')]=qs[_0x4be5('0x36')](_0x4f0b7f[_0x4be5('0x2f')][_0x4be5('0x36')]);_0x262217[_0x4be5('0x39')]=qs[_0x4be5('0x37')](_[_0x4be5('0x38')](_0x4f0b7f['query'],_0x1e9620[_0x4be5('0x37')]));if(_0x4f0b7f[_0x4be5('0x2f')][_0x4be5('0x3b')]){_0x262217[_0x4be5('0x39')]=_['merge'](_0x262217[_0x4be5('0x39')],{'$or':_['map'](_0x262217['attributes'],function(_0x4b30b1){var _0x2ae295={};_0x2ae295[_0x4b30b1]={'$like':'%'+_0x4f0b7f[_0x4be5('0x2f')][_0x4be5('0x3b')]+'%'};return _0x2ae295;})});}_0x262217=_[_0x4be5('0x3a')]({},_0x262217,_0x4f0b7f[_0x4be5('0x41')]);return _0x510f0a[_0x4be5('0x48')](_0x262217);}})['then'](function(_0x4533db){if(_0x4533db){_0xe44cd6=_0x4533db[_0x4be5('0x40')];if(!_0x4f0b7f[_0x4be5('0x2f')][_0x4be5('0x34')](_0x4be5('0x47'))){_0x262217[_0x4be5('0x35')]=qs['limit'](_0x4f0b7f['query'][_0x4be5('0x35')]);_0x262217['offset']=qs[_0x4be5('0x1e')](_0x4f0b7f[_0x4be5('0x2f')][_0x4be5('0x1e')]);}return _0x510f0a['getSubjects'](_0x262217);}})[_0x4be5('0x23')](function(_0x9892fc){if(_0x9892fc){return _0x9892fc?{'count':_0xe44cd6,'rows':_0x9892fc}:null;}})[_0x4be5('0x23')](respondWithResult(_0x3c77dc,null))[_0x4be5('0x3e')](handleError(_0x3c77dc,null));};exports[_0x4be5('0x4c')]=function(_0x29ff27,_0x5908f4,_0x10c145){var _0x63d97={};var _0x310562={};var _0x3340f7;var _0xfdfbb7;return db[_0x4be5('0x2a')][_0x4be5('0x49')]({'where':{'id':_0x29ff27['params']['id']}})[_0x4be5('0x23')](handleEntityNotFound(_0x5908f4,null))[_0x4be5('0x23')](function(_0xdb478a){if(_0xdb478a){_0x3340f7=_0xdb478a;_0x310562[_0x4be5('0x2e')]=_[_0x4be5('0x30')](db[_0x4be5('0x4a')][_0x4be5('0x2b')]);_0x310562[_0x4be5('0x2f')]=_[_0x4be5('0x30')](_0x29ff27[_0x4be5('0x2f')]);_0x310562[_0x4be5('0x37')]=_[_0x4be5('0x31')](_0x310562[_0x4be5('0x2e')],_0x310562['query']);_0x63d97[_0x4be5('0x32')]=_[_0x4be5('0x31')](_0x310562['model'],qs['fields'](_0x29ff27[_0x4be5('0x2f')]['fields']));_0x63d97[_0x4be5('0x32')]=_0x63d97['attributes'][_0x4be5('0x40')]?_0x63d97[_0x4be5('0x32')]:_0x310562['model'];_0x63d97[_0x4be5('0x4b')]=qs['sort'](_0x29ff27[_0x4be5('0x2f')][_0x4be5('0x36')]);_0x63d97[_0x4be5('0x39')]=qs[_0x4be5('0x37')](_[_0x4be5('0x38')](_0x29ff27[_0x4be5('0x2f')],_0x310562[_0x4be5('0x37')]));if(_0x29ff27['query'][_0x4be5('0x3b')]){_0x63d97[_0x4be5('0x39')]=_[_0x4be5('0x3a')](_0x63d97['where'],{'$or':_[_0x4be5('0x29')](_0x63d97[_0x4be5('0x32')],function(_0xea6e2a){var _0x2401b1={};_0x2401b1[_0xea6e2a]={'$like':'%'+_0x29ff27[_0x4be5('0x2f')][_0x4be5('0x3b')]+'%'};return _0x2401b1;})});}_0x63d97=_['merge']({},_0x63d97,_0x29ff27[_0x4be5('0x41')]);return _0x3340f7[_0x4be5('0x4c')](_0x63d97);}})['then'](function(_0x4fb60a){if(_0x4fb60a){_0xfdfbb7=_0x4fb60a[_0x4be5('0x40')];if(!_0x29ff27[_0x4be5('0x2f')]['hasOwnProperty'](_0x4be5('0x47'))){_0x63d97[_0x4be5('0x35')]=qs[_0x4be5('0x35')](_0x29ff27[_0x4be5('0x2f')][_0x4be5('0x35')]);_0x63d97['offset']=qs[_0x4be5('0x1e')](_0x29ff27[_0x4be5('0x2f')][_0x4be5('0x1e')]);}return _0x3340f7[_0x4be5('0x4c')](_0x63d97);}})['then'](function(_0x282870){if(_0x282870){return _0x282870?{'count':_0xfdfbb7,'rows':_0x282870}:null;}})[_0x4be5('0x23')](respondWithResult(_0x5908f4,null))['catch'](handleError(_0x5908f4,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index a3f4429..9177c66 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 _0xa2d5=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','define','int_sugarcrm_configurations','lodash'];(function(_0x44c502,_0x47ee08){var _0x168c43=function(_0x4bcc47){while(--_0x4bcc47){_0x44c502['push'](_0x44c502['shift']());}};_0x168c43(++_0x47ee08);}(_0xa2d5,0xb3));var _0x5a2d=function(_0x2c0cf1,_0x17f242){_0x2c0cf1=_0x2c0cf1-0x0;var _0x3da711=_0xa2d5[_0x2c0cf1];return _0x3da711;};'use strict';var _=require(_0x5a2d('0x0'));var util=require(_0x5a2d('0x1'));var logger=require(_0x5a2d('0x2'))(_0x5a2d('0x3'));var moment=require(_0x5a2d('0x4'));var BPromise=require('bluebird');var rp=require(_0x5a2d('0x5'));var fs=require('fs');var path=require(_0x5a2d('0x6'));var rimraf=require(_0x5a2d('0x7'));var config=require(_0x5a2d('0x8'));var attributes=require(_0x5a2d('0x9'));module['exports']=function(_0x303389,_0x441bb9){return _0x303389[_0x5a2d('0xa')]('SugarcrmConfiguration',attributes,{'tableName':_0x5a2d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5c1f=['../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','lodash','../../config/logger','moment','bluebird','path'];(function(_0x170345,_0x2ceb47){var _0x407a37=function(_0x319b94){while(--_0x319b94){_0x170345['push'](_0x170345['shift']());}};_0x407a37(++_0x2ceb47);}(_0x5c1f,0x1ef));var _0xf5c1=function(_0x30f5bb,_0x4db4bd){_0x30f5bb=_0x30f5bb-0x0;var _0x1cfc00=_0x5c1f[_0x30f5bb];return _0x1cfc00;};'use strict';var _=require(_0xf5c1('0x0'));var util=require('util');var logger=require(_0xf5c1('0x1'))('api');var moment=require(_0xf5c1('0x2'));var BPromise=require(_0xf5c1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf5c1('0x4'));var rimraf=require('rimraf');var config=require(_0xf5c1('0x5'));var attributes=require(_0xf5c1('0x6'));module[_0xf5c1('0x7')]=function(_0x3c895c,_0x1dcb74){return _0x3c895c[_0xf5c1('0x8')](_0xf5c1('0x9'),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 7481bb7..6586133 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 _0x242f=['error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x218afc,_0x521c30){var _0x270351=function(_0x4a70e5){while(--_0x4a70e5){_0x218afc['push'](_0x218afc['shift']());}};_0x270351(++_0x521c30);}(_0x242f,0x165));var _0xf242=function(_0x136c26,_0x25b3e8){_0x136c26=_0x136c26-0x0;var _0x5f0a7a=_0x242f[_0x136c26];return _0x5f0a7a;};'use strict';var _=require(_0xf242('0x0'));var util=require(_0xf242('0x1'));var moment=require(_0xf242('0x2'));var BPromise=require(_0xf242('0x3'));var rs=require(_0xf242('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf242('0x5'));var logger=require(_0xf242('0x6'))(_0xf242('0x7'));var config=require(_0xf242('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf242('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8612f,_0x567be2,_0x289270){return new BPromise(function(_0xadcb25,_0x322248){return client[_0xf242('0xa')](_0x8612f,_0x289270)[_0xf242('0xb')](function(_0x143006){logger[_0xf242('0xc')](_0xf242('0xd'),_0x567be2,_0xf242('0xe'));logger['debug'](_0xf242('0xf'),_0x567be2,'request\x20sent',JSON[_0xf242('0x10')](_0x143006));if(_0x143006[_0xf242('0x11')]){if(_0x143006[_0xf242('0x11')][_0xf242('0x12')]===0x1f4){logger[_0xf242('0x11')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x567be2,_0x143006['error'][_0xf242('0x13')]);return _0x322248(_0x143006[_0xf242('0x11')][_0xf242('0x13')]);}logger[_0xf242('0x11')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x567be2,_0x143006[_0xf242('0x11')]['message']);return _0xadcb25(_0x143006[_0xf242('0x11')][_0xf242('0x13')]);}else{logger['info'](_0xf242('0xd'),_0x567be2,_0xf242('0xe'));_0xadcb25(_0x143006[_0xf242('0x14')][_0xf242('0x13')]);}})[_0xf242('0x15')](function(_0x2a532a){logger[_0xf242('0x11')](_0xf242('0xd'),_0x567be2,_0x2a532a);_0x322248(_0x2a532a);});});} \ No newline at end of file +var _0xa372=['stringify','error','code','SugarcrmConfiguration,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x192c7f,_0x16c86b){var _0x522212=function(_0x134896){while(--_0x134896){_0x192c7f['push'](_0x192c7f['shift']());}};_0x522212(++_0x16c86b);}(_0xa372,0xaf));var _0x2a37=function(_0x57647a,_0x497f0a){_0x57647a=_0x57647a-0x0;var _0x5d6c40=_0xa372[_0x57647a];return _0x5d6c40;};'use strict';var _=require(_0x2a37('0x0'));var util=require('util');var moment=require(_0x2a37('0x1'));var BPromise=require(_0x2a37('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2a37('0x3'))['db'];var utils=require(_0x2a37('0x4'));var logger=require(_0x2a37('0x5'))(_0x2a37('0x6'));var config=require(_0x2a37('0x7'));var jayson=require(_0x2a37('0x8'));var client=jayson[_0x2a37('0x9')][_0x2a37('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36a9ab,_0x3bcc76,_0x32c502){return new BPromise(function(_0x197d43,_0x177c0c){return client[_0x2a37('0xb')](_0x36a9ab,_0x32c502)[_0x2a37('0xc')](function(_0x16e0c0){logger[_0x2a37('0xd')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x3bcc76,'request\x20sent');logger[_0x2a37('0xe')](_0x2a37('0xf'),_0x3bcc76,_0x2a37('0x10'),JSON[_0x2a37('0x11')](_0x16e0c0));if(_0x16e0c0[_0x2a37('0x12')]){if(_0x16e0c0[_0x2a37('0x12')][_0x2a37('0x13')]===0x1f4){logger[_0x2a37('0x12')](_0x2a37('0x14'),_0x3bcc76,_0x16e0c0[_0x2a37('0x12')][_0x2a37('0x15')]);return _0x177c0c(_0x16e0c0['error'][_0x2a37('0x15')]);}logger['error'](_0x2a37('0x14'),_0x3bcc76,_0x16e0c0[_0x2a37('0x12')][_0x2a37('0x15')]);return _0x197d43(_0x16e0c0[_0x2a37('0x12')][_0x2a37('0x15')]);}else{logger[_0x2a37('0xd')](_0x2a37('0x14'),_0x3bcc76,_0x2a37('0x10'));_0x197d43(_0x16e0c0[_0x2a37('0x16')][_0x2a37('0x15')]);}})[_0x2a37('0x17')](function(_0x48a082){logger[_0x2a37('0x12')](_0x2a37('0x14'),_0x3bcc76,_0x48a082);_0x177c0c(_0x48a082);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index faad381..7c206a9 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 _0x3a7a=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','util','path','connect-timeout'];(function(_0x184d22,_0x474c6b){var _0x14c85a=function(_0x5bb546){while(--_0x5bb546){_0x184d22['push'](_0x184d22['shift']());}};_0x14c85a(++_0x474c6b);}(_0x3a7a,0xf4));var _0xa3a7=function(_0x1e235e,_0x994b77){_0x1e235e=_0x1e235e-0x0;var _0x1e8e94=_0x3a7a[_0x1e235e];return _0x1e8e94;};'use strict';var multer=require('multer');var util=require(_0xa3a7('0x0'));var path=require(_0xa3a7('0x1'));var timeout=require(_0xa3a7('0x2'));var express=require(_0xa3a7('0x3'));var router=express[_0xa3a7('0x4')]();var fs_extra=require(_0xa3a7('0x5'));var auth=require(_0xa3a7('0x6'));var interaction=require(_0xa3a7('0x7'));var config=require(_0xa3a7('0x8'));var controller=require('./intSugarcrmField.controller');router[_0xa3a7('0x9')]('/',auth['isAuthenticated'](),controller[_0xa3a7('0xa')]);router[_0xa3a7('0x9')](_0xa3a7('0xb'),auth[_0xa3a7('0xc')](),controller[_0xa3a7('0xd')]);router[_0xa3a7('0xe')]('/',auth[_0xa3a7('0xc')](),controller[_0xa3a7('0xf')]);router[_0xa3a7('0x10')](_0xa3a7('0xb'),auth[_0xa3a7('0xc')](),controller[_0xa3a7('0x11')]);router[_0xa3a7('0x12')](_0xa3a7('0xb'),auth[_0xa3a7('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x67ac=['fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x353578,_0x478bc0){var _0x4ef424=function(_0x5e05b1){while(--_0x5e05b1){_0x353578['push'](_0x353578['shift']());}};_0x4ef424(++_0x478bc0);}(_0x67ac,0x6c));var _0xc67a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x67ac[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xc67a('0x0'));var util=require(_0xc67a('0x1'));var path=require(_0xc67a('0x2'));var timeout=require(_0xc67a('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xc67a('0x4'));var auth=require(_0xc67a('0x5'));var interaction=require(_0xc67a('0x6'));var config=require('../../config/environment');var controller=require('./intSugarcrmField.controller');router[_0xc67a('0x7')]('/',auth[_0xc67a('0x8')](),controller[_0xc67a('0x9')]);router[_0xc67a('0x7')](_0xc67a('0xa'),auth[_0xc67a('0x8')](),controller[_0xc67a('0xb')]);router[_0xc67a('0xc')]('/',auth[_0xc67a('0x8')](),controller['create']);router['put']('/:id',auth[_0xc67a('0x8')](),controller[_0xc67a('0xd')]);router[_0xc67a('0xe')](_0xc67a('0xa'),auth[_0xc67a('0x8')](),controller[_0xc67a('0xf')]);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 0706337..a75930c 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 _0xd018=['picklist','STRING','BOOLEAN','ENUM','string','variable','customVariable','keyValue'];(function(_0x231b7c,_0x51c47d){var _0x32f361=function(_0x1cbd4d){while(--_0x1cbd4d){_0x231b7c['push'](_0x231b7c['shift']());}};_0x32f361(++_0x51c47d);}(_0xd018,0xb3));var _0x8d01=function(_0xfc58,_0x1f3839){_0xfc58=_0xfc58-0x0;var _0x59fb78=_0xd018[_0xfc58];return _0x59fb78;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x8d01('0x0')](_0x8d01('0x1'),_0x8d01('0x2'),_0x8d01('0x3'),_0x8d01('0x4'),_0x8d01('0x5')),'defaultValue':_0x8d01('0x1')},'content':{'type':Sequelize[_0x8d01('0x6')]},'key':{'type':Sequelize[_0x8d01('0x6')]},'keyType':{'type':Sequelize[_0x8d01('0x0')](_0x8d01('0x1'),_0x8d01('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0x8d01('0x6')]},'idField':{'type':Sequelize[_0x8d01('0x6')]},'nameField':{'type':Sequelize[_0x8d01('0x6')]},'customField':{'type':Sequelize[_0x8d01('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8d01('0x6')]}}; \ No newline at end of file +var _0x2170=['exports','ENUM','variable','customVariable','keyValue','picklist','string','STRING','BOOLEAN'];(function(_0x151317,_0x3e6c29){var _0x50b025=function(_0x48c4cb){while(--_0x48c4cb){_0x151317['push'](_0x151317['shift']());}};_0x50b025(++_0x3e6c29);}(_0x2170,0xc6));var _0x0217=function(_0x5b6234,_0x41e345){_0x5b6234=_0x5b6234-0x0;var _0x2eb8be=_0x2170[_0x5b6234];return _0x2eb8be;};'use strict';var Sequelize=require('sequelize');module[_0x0217('0x0')]={'type':{'type':Sequelize[_0x0217('0x1')]('string',_0x0217('0x2'),_0x0217('0x3'),_0x0217('0x4'),_0x0217('0x5')),'defaultValue':_0x0217('0x6')},'content':{'type':Sequelize[_0x0217('0x7')]},'key':{'type':Sequelize[_0x0217('0x7')]},'keyType':{'type':Sequelize[_0x0217('0x1')](_0x0217('0x6'),_0x0217('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0x0217('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x0217('0x7')]},'customField':{'type':Sequelize[_0x0217('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0217('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 4885800..47eb739 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 _0xf367=['ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','nolimit','order','sort','filter','where','merge','VIRTUAL','include','findAll','catch','keys','SugarcrmField','includeAll','options','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xf367,0x164));var _0x7f36=function(_0xf44fbd,_0x56527b){_0xf44fbd=_0xf44fbd-0x0;var _0x15e76c=_0xf367[_0xf44fbd];return _0x15e76c;};'use strict';var emlformat=require(_0x7f36('0x0'));var rimraf=require(_0x7f36('0x1'));var zipdir=require(_0x7f36('0x2'));var jsonpatch=require(_0x7f36('0x3'));var rp=require('request-promise');var moment=require(_0x7f36('0x4'));var BPromise=require(_0x7f36('0x5'));var Mustache=require(_0x7f36('0x6'));var util=require('util');var path=require('path');var sox=require(_0x7f36('0x7'));var csv=require(_0x7f36('0x8'));var ejs=require(_0x7f36('0x9'));var fs=require('fs');var fs_extra=require(_0x7f36('0xa'));var _=require(_0x7f36('0xb'));var squel=require(_0x7f36('0xc'));var crypto=require(_0x7f36('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7f36('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7f36('0xf'));var Papa=require(_0x7f36('0x10'));var Redis=require('ioredis');var authService=require(_0x7f36('0x11'));var qs=require(_0x7f36('0x12'));var as=require(_0x7f36('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7f36('0x14'));var utils=require(_0x7f36('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x7f36('0x16'));var db=require(_0x7f36('0x17'))['db'];function respondWithStatusCode(_0xb33dcb,_0x1146dd){_0x1146dd=_0x1146dd||0xcc;return function(_0x5d29e9){if(_0x5d29e9){return _0xb33dcb[_0x7f36('0x18')](_0x1146dd);}return _0xb33dcb[_0x7f36('0x19')](_0x1146dd)[_0x7f36('0x1a')]();};}function respondWithResult(_0x198d45,_0x1dc2e0){_0x1dc2e0=_0x1dc2e0||0xc8;return function(_0x52cbf5){if(_0x52cbf5){return _0x198d45[_0x7f36('0x19')](_0x1dc2e0)[_0x7f36('0x1b')](_0x52cbf5);}};}function respondWithFilteredResult(_0x43eea0,_0x1e6e14){return function(_0x52087b){if(_0x52087b){var _0x1c7f12=typeof _0x1e6e14['offset']===_0x7f36('0x1c')&&typeof _0x1e6e14['limit']===_0x7f36('0x1c');var _0x1a43b4=_0x52087b[_0x7f36('0x1d')];var _0x32cca7=_0x1c7f12?0x0:_0x1e6e14[_0x7f36('0x1e')];var _0x3d56ad=_0x1c7f12?_0x52087b[_0x7f36('0x1d')]:_0x1e6e14[_0x7f36('0x1e')]+_0x1e6e14[_0x7f36('0x1f')];var _0x83b0b4;if(_0x3d56ad>=_0x1a43b4){_0x3d56ad=_0x1a43b4;_0x83b0b4=0xc8;}else{_0x83b0b4=0xce;}_0x43eea0[_0x7f36('0x19')](_0x83b0b4);return _0x43eea0[_0x7f36('0x20')](_0x7f36('0x21'),_0x32cca7+'-'+_0x3d56ad+'/'+_0x1a43b4)[_0x7f36('0x1b')](_0x52087b);}return null;};}function patchUpdates(_0xe55283){return function(_0x18f427){try{jsonpatch[_0x7f36('0x22')](_0x18f427,_0xe55283,!![]);}catch(_0x296449){return BPromise[_0x7f36('0x23')](_0x296449);}return _0x18f427['save']();};}function saveUpdates(_0x281bba,_0xc493cb){return function(_0xa50fd3){if(_0xa50fd3){return _0xa50fd3[_0x7f36('0x24')](_0x281bba)[_0x7f36('0x25')](function(_0xe39711){return _0xe39711;});}return null;};}function removeEntity(_0x2b9fd0,_0x36aa66){return function(_0x20dc78){if(_0x20dc78){return _0x20dc78[_0x7f36('0x26')]()[_0x7f36('0x25')](function(){_0x2b9fd0[_0x7f36('0x19')](0xcc)[_0x7f36('0x1a')]();});}};}function handleEntityNotFound(_0x3eb724,_0x15a285){return function(_0x5841ab){if(!_0x5841ab){_0x3eb724[_0x7f36('0x18')](0x194);}return _0x5841ab;};}function handleError(_0x544420,_0x3b1644){_0x3b1644=_0x3b1644||0x1f4;return function(_0x4e380d){logger[_0x7f36('0x27')](_0x4e380d[_0x7f36('0x28')]);if(_0x4e380d[_0x7f36('0x29')]){delete _0x4e380d[_0x7f36('0x29')];}_0x544420[_0x7f36('0x19')](_0x3b1644)[_0x7f36('0x2a')](_0x4e380d);};}exports['index']=function(_0x34ac68,_0x1f8d48){var _0x3ea353={},_0x30b9b7={},_0x4bbc69={'count':0x0,'rows':[]};var _0xd9f720=_['map'](db['SugarcrmField'][_0x7f36('0x2b')],function(_0x3221cc){return{'name':_0x3221cc[_0x7f36('0x2c')],'type':_0x3221cc[_0x7f36('0x2d')][_0x7f36('0x2e')]};});_0x30b9b7[_0x7f36('0x2f')]=_[_0x7f36('0x30')](_0xd9f720,_0x7f36('0x29'));_0x30b9b7[_0x7f36('0x31')]=_['keys'](_0x34ac68[_0x7f36('0x31')]);_0x30b9b7[_0x7f36('0x32')]=_[_0x7f36('0x33')](_0x30b9b7[_0x7f36('0x2f')],_0x30b9b7[_0x7f36('0x31')]);_0x3ea353['attributes']=_['intersection'](_0x30b9b7[_0x7f36('0x2f')],qs[_0x7f36('0x34')](_0x34ac68['query'][_0x7f36('0x34')]));_0x3ea353['attributes']=_0x3ea353[_0x7f36('0x35')][_0x7f36('0x36')]?_0x3ea353[_0x7f36('0x35')]:_0x30b9b7[_0x7f36('0x2f')];if(!_0x34ac68[_0x7f36('0x31')]['hasOwnProperty'](_0x7f36('0x37'))){_0x3ea353[_0x7f36('0x1f')]=qs[_0x7f36('0x1f')](_0x34ac68['query']['limit']);_0x3ea353[_0x7f36('0x1e')]=qs[_0x7f36('0x1e')](_0x34ac68[_0x7f36('0x31')][_0x7f36('0x1e')]);}_0x3ea353[_0x7f36('0x38')]=qs['sort'](_0x34ac68[_0x7f36('0x31')][_0x7f36('0x39')]);_0x3ea353['where']=qs[_0x7f36('0x32')](_['pick'](_0x34ac68[_0x7f36('0x31')],_0x30b9b7[_0x7f36('0x32')]),_0xd9f720);if(_0x34ac68['query'][_0x7f36('0x3a')]){_0x3ea353[_0x7f36('0x3b')]=_[_0x7f36('0x3c')](_0x3ea353[_0x7f36('0x3b')],{'$or':_[_0x7f36('0x30')](_0xd9f720,function(_0x3ae446){if(_0x3ae446[_0x7f36('0x2d')]!==_0x7f36('0x3d')){var _0xd4be98={};_0xd4be98[_0x3ae446[_0x7f36('0x29')]]={'$like':'%'+_0x34ac68['query'][_0x7f36('0x3a')]+'%'};return _0xd4be98;}})});}_0x3ea353=_[_0x7f36('0x3c')]({},_0x3ea353,_0x34ac68['options']);var _0x91216b={'where':_0x3ea353[_0x7f36('0x3b')]};return db['SugarcrmField']['count'](_0x91216b)[_0x7f36('0x25')](function(_0x25ab78){_0x4bbc69[_0x7f36('0x1d')]=_0x25ab78;if(_0x34ac68['query']['includeAll']){_0x3ea353[_0x7f36('0x3e')]=[{'all':!![]}];}return db['SugarcrmField'][_0x7f36('0x3f')](_0x3ea353);})[_0x7f36('0x25')](function(_0x11a2d4){_0x4bbc69['rows']=_0x11a2d4;return _0x4bbc69;})['then'](respondWithFilteredResult(_0x1f8d48,_0x3ea353))[_0x7f36('0x40')](handleError(_0x1f8d48,null));};exports['show']=function(_0x21372f,_0x2dff87){var _0x55d7c6={'raw':!![],'where':{'id':_0x21372f['params']['id']}},_0x88fda7={};_0x88fda7[_0x7f36('0x2f')]=_[_0x7f36('0x41')](db[_0x7f36('0x42')]['rawAttributes']);_0x88fda7[_0x7f36('0x31')]=_[_0x7f36('0x41')](_0x21372f[_0x7f36('0x31')]);_0x88fda7['filters']=_[_0x7f36('0x33')](_0x88fda7[_0x7f36('0x2f')],_0x88fda7[_0x7f36('0x31')]);_0x55d7c6['attributes']=_[_0x7f36('0x33')](_0x88fda7['model'],qs[_0x7f36('0x34')](_0x21372f[_0x7f36('0x31')][_0x7f36('0x34')]));_0x55d7c6[_0x7f36('0x35')]=_0x55d7c6[_0x7f36('0x35')]['length']?_0x55d7c6[_0x7f36('0x35')]:_0x88fda7[_0x7f36('0x2f')];if(_0x21372f['query'][_0x7f36('0x43')]){_0x55d7c6[_0x7f36('0x3e')]=[{'all':!![]}];}_0x55d7c6=_[_0x7f36('0x3c')]({},_0x55d7c6,_0x21372f[_0x7f36('0x44')]);return db[_0x7f36('0x42')][_0x7f36('0x45')](_0x55d7c6)[_0x7f36('0x25')](handleEntityNotFound(_0x2dff87,null))[_0x7f36('0x25')](respondWithResult(_0x2dff87,null))[_0x7f36('0x40')](handleError(_0x2dff87,null));};exports[_0x7f36('0x46')]=function(_0x407fb8,_0x8cf32c){return db[_0x7f36('0x42')][_0x7f36('0x46')](_0x407fb8['body'],{})['then'](respondWithResult(_0x8cf32c,0xc9))[_0x7f36('0x40')](handleError(_0x8cf32c,null));};exports[_0x7f36('0x24')]=function(_0x3ad57f,_0xf0c102){if(_0x3ad57f[_0x7f36('0x47')]['id']){delete _0x3ad57f[_0x7f36('0x47')]['id'];}return db['SugarcrmField']['find']({'where':{'id':_0x3ad57f[_0x7f36('0x48')]['id']}})[_0x7f36('0x25')](handleEntityNotFound(_0xf0c102,null))['then'](saveUpdates(_0x3ad57f[_0x7f36('0x47')],null))['then'](respondWithResult(_0xf0c102,null))[_0x7f36('0x40')](handleError(_0xf0c102,null));};exports['destroy']=function(_0x4dbd61,_0xa1ff7f){return db[_0x7f36('0x42')][_0x7f36('0x45')]({'where':{'id':_0x4dbd61['params']['id']}})[_0x7f36('0x25')](handleEntityNotFound(_0xa1ff7f,null))[_0x7f36('0x25')](removeEntity(_0xa1ff7f,null))[_0x7f36('0x40')](handleError(_0xa1ff7f,null));}; \ No newline at end of file +var _0x43ca=['json','offset','undefined','count','limit','set','reject','then','destroy','sendStatus','error','stack','name','send','index','map','SugarcrmField','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','update','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','status','end'];(function(_0x2ba0e1,_0x1149c7){var _0x4cae54=function(_0x2dc6cf){while(--_0x2dc6cf){_0x2ba0e1['push'](_0x2ba0e1['shift']());}};_0x4cae54(++_0x1149c7);}(_0x43ca,0xc0));var _0xa43c=function(_0x47e549,_0x2e53d6){_0x47e549=_0x47e549-0x0;var _0x251374=_0x43ca[_0x47e549];return _0x251374;};'use strict';var emlformat=require(_0xa43c('0x0'));var rimraf=require(_0xa43c('0x1'));var zipdir=require(_0xa43c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa43c('0x3'));var moment=require(_0xa43c('0x4'));var BPromise=require(_0xa43c('0x5'));var Mustache=require(_0xa43c('0x6'));var util=require('util');var path=require(_0xa43c('0x7'));var sox=require(_0xa43c('0x8'));var csv=require(_0xa43c('0x9'));var ejs=require(_0xa43c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa43c('0xb'));var squel=require(_0xa43c('0xc'));var crypto=require(_0xa43c('0xd'));var jsforce=require(_0xa43c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa43c('0x9'));var querystring=require(_0xa43c('0xf'));var Papa=require(_0xa43c('0x10'));var Redis=require('ioredis');var authService=require(_0xa43c('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xa43c('0x12'));var hardwareService=require(_0xa43c('0x13'));var logger=require(_0xa43c('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa43c('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1dbebb,_0x3d5d6f){_0x3d5d6f=_0x3d5d6f||0xcc;return function(_0x4ad84a){if(_0x4ad84a){return _0x1dbebb['sendStatus'](_0x3d5d6f);}return _0x1dbebb[_0xa43c('0x16')](_0x3d5d6f)[_0xa43c('0x17')]();};}function respondWithResult(_0x18cae0,_0x3a5e12){_0x3a5e12=_0x3a5e12||0xc8;return function(_0x2c14db){if(_0x2c14db){return _0x18cae0[_0xa43c('0x16')](_0x3a5e12)[_0xa43c('0x18')](_0x2c14db);}};}function respondWithFilteredResult(_0x3879d7,_0x3c9cf8){return function(_0x145706){if(_0x145706){var _0x170d4b=typeof _0x3c9cf8[_0xa43c('0x19')]===_0xa43c('0x1a')&&typeof _0x3c9cf8['limit']===_0xa43c('0x1a');var _0x29b8c4=_0x145706[_0xa43c('0x1b')];var _0x39a693=_0x170d4b?0x0:_0x3c9cf8[_0xa43c('0x19')];var _0x25e5d4=_0x170d4b?_0x145706[_0xa43c('0x1b')]:_0x3c9cf8[_0xa43c('0x19')]+_0x3c9cf8[_0xa43c('0x1c')];var _0xce8159;if(_0x25e5d4>=_0x29b8c4){_0x25e5d4=_0x29b8c4;_0xce8159=0xc8;}else{_0xce8159=0xce;}_0x3879d7[_0xa43c('0x16')](_0xce8159);return _0x3879d7[_0xa43c('0x1d')]('Content-Range',_0x39a693+'-'+_0x25e5d4+'/'+_0x29b8c4)[_0xa43c('0x18')](_0x145706);}return null;};}function patchUpdates(_0xda292e){return function(_0x531cb4){try{jsonpatch['apply'](_0x531cb4,_0xda292e,!![]);}catch(_0x2e9616){return BPromise[_0xa43c('0x1e')](_0x2e9616);}return _0x531cb4['save']();};}function saveUpdates(_0x20cbc5,_0xed1432){return function(_0x142eec){if(_0x142eec){return _0x142eec['update'](_0x20cbc5)[_0xa43c('0x1f')](function(_0x278fa6){return _0x278fa6;});}return null;};}function removeEntity(_0x213c1b,_0x731173){return function(_0x39e013){if(_0x39e013){return _0x39e013[_0xa43c('0x20')]()['then'](function(){_0x213c1b[_0xa43c('0x16')](0xcc)[_0xa43c('0x17')]();});}};}function handleEntityNotFound(_0x4eb697,_0x3633f8){return function(_0x435847){if(!_0x435847){_0x4eb697[_0xa43c('0x21')](0x194);}return _0x435847;};}function handleError(_0x2ae74d,_0x4aaf59){_0x4aaf59=_0x4aaf59||0x1f4;return function(_0x452669){logger[_0xa43c('0x22')](_0x452669[_0xa43c('0x23')]);if(_0x452669[_0xa43c('0x24')]){delete _0x452669[_0xa43c('0x24')];}_0x2ae74d[_0xa43c('0x16')](_0x4aaf59)[_0xa43c('0x25')](_0x452669);};}exports[_0xa43c('0x26')]=function(_0x4a0bf1,_0x14cd2f){var _0x51d508={},_0x50c1a9={},_0x42e5cb={'count':0x0,'rows':[]};var _0x21f733=_[_0xa43c('0x27')](db[_0xa43c('0x28')]['rawAttributes'],function(_0x31fe7b){return{'name':_0x31fe7b[_0xa43c('0x29')],'type':_0x31fe7b[_0xa43c('0x2a')][_0xa43c('0x2b')]};});_0x50c1a9[_0xa43c('0x2c')]=_['map'](_0x21f733,_0xa43c('0x24'));_0x50c1a9[_0xa43c('0x2d')]=_[_0xa43c('0x2e')](_0x4a0bf1['query']);_0x50c1a9[_0xa43c('0x2f')]=_[_0xa43c('0x30')](_0x50c1a9[_0xa43c('0x2c')],_0x50c1a9[_0xa43c('0x2d')]);_0x51d508[_0xa43c('0x31')]=_[_0xa43c('0x30')](_0x50c1a9[_0xa43c('0x2c')],qs[_0xa43c('0x32')](_0x4a0bf1['query'][_0xa43c('0x32')]));_0x51d508[_0xa43c('0x31')]=_0x51d508[_0xa43c('0x31')][_0xa43c('0x33')]?_0x51d508[_0xa43c('0x31')]:_0x50c1a9[_0xa43c('0x2c')];if(!_0x4a0bf1[_0xa43c('0x2d')][_0xa43c('0x34')](_0xa43c('0x35'))){_0x51d508[_0xa43c('0x1c')]=qs[_0xa43c('0x1c')](_0x4a0bf1[_0xa43c('0x2d')][_0xa43c('0x1c')]);_0x51d508['offset']=qs['offset'](_0x4a0bf1[_0xa43c('0x2d')]['offset']);}_0x51d508[_0xa43c('0x36')]=qs[_0xa43c('0x37')](_0x4a0bf1['query'][_0xa43c('0x37')]);_0x51d508[_0xa43c('0x38')]=qs[_0xa43c('0x2f')](_[_0xa43c('0x39')](_0x4a0bf1[_0xa43c('0x2d')],_0x50c1a9[_0xa43c('0x2f')]),_0x21f733);if(_0x4a0bf1[_0xa43c('0x2d')]['filter']){_0x51d508[_0xa43c('0x38')]=_[_0xa43c('0x3a')](_0x51d508[_0xa43c('0x38')],{'$or':_['map'](_0x21f733,function(_0xef47df){if(_0xef47df[_0xa43c('0x2a')]!==_0xa43c('0x3b')){var _0x3ec060={};_0x3ec060[_0xef47df['name']]={'$like':'%'+_0x4a0bf1[_0xa43c('0x2d')]['filter']+'%'};return _0x3ec060;}})});}_0x51d508=_[_0xa43c('0x3a')]({},_0x51d508,_0x4a0bf1[_0xa43c('0x3c')]);var _0x1a1c2c={'where':_0x51d508['where']};return db[_0xa43c('0x28')]['count'](_0x1a1c2c)[_0xa43c('0x1f')](function(_0x3620cf){_0x42e5cb[_0xa43c('0x1b')]=_0x3620cf;if(_0x4a0bf1['query'][_0xa43c('0x3d')]){_0x51d508[_0xa43c('0x3e')]=[{'all':!![]}];}return db['SugarcrmField'][_0xa43c('0x3f')](_0x51d508);})['then'](function(_0x2b6fed){_0x42e5cb['rows']=_0x2b6fed;return _0x42e5cb;})[_0xa43c('0x1f')](respondWithFilteredResult(_0x14cd2f,_0x51d508))[_0xa43c('0x40')](handleError(_0x14cd2f,null));};exports[_0xa43c('0x41')]=function(_0x425e4c,_0x263068){var _0x2a3089={'raw':!![],'where':{'id':_0x425e4c[_0xa43c('0x42')]['id']}},_0x5a4c99={};_0x5a4c99[_0xa43c('0x2c')]=_['keys'](db[_0xa43c('0x28')][_0xa43c('0x43')]);_0x5a4c99[_0xa43c('0x2d')]=_['keys'](_0x425e4c['query']);_0x5a4c99[_0xa43c('0x2f')]=_[_0xa43c('0x30')](_0x5a4c99[_0xa43c('0x2c')],_0x5a4c99[_0xa43c('0x2d')]);_0x2a3089[_0xa43c('0x31')]=_[_0xa43c('0x30')](_0x5a4c99[_0xa43c('0x2c')],qs[_0xa43c('0x32')](_0x425e4c[_0xa43c('0x2d')][_0xa43c('0x32')]));_0x2a3089[_0xa43c('0x31')]=_0x2a3089['attributes'][_0xa43c('0x33')]?_0x2a3089[_0xa43c('0x31')]:_0x5a4c99[_0xa43c('0x2c')];if(_0x425e4c[_0xa43c('0x2d')][_0xa43c('0x3d')]){_0x2a3089[_0xa43c('0x3e')]=[{'all':!![]}];}_0x2a3089=_[_0xa43c('0x3a')]({},_0x2a3089,_0x425e4c[_0xa43c('0x3c')]);return db['SugarcrmField'][_0xa43c('0x44')](_0x2a3089)[_0xa43c('0x1f')](handleEntityNotFound(_0x263068,null))['then'](respondWithResult(_0x263068,null))[_0xa43c('0x40')](handleError(_0x263068,null));};exports[_0xa43c('0x45')]=function(_0x2df6ec,_0x4196e1){return db[_0xa43c('0x28')][_0xa43c('0x45')](_0x2df6ec[_0xa43c('0x46')],{})[_0xa43c('0x1f')](respondWithResult(_0x4196e1,0xc9))['catch'](handleError(_0x4196e1,null));};exports[_0xa43c('0x47')]=function(_0xbfd21,_0x5742c3){if(_0xbfd21[_0xa43c('0x46')]['id']){delete _0xbfd21[_0xa43c('0x46')]['id'];}return db['SugarcrmField']['find']({'where':{'id':_0xbfd21['params']['id']}})[_0xa43c('0x1f')](handleEntityNotFound(_0x5742c3,null))[_0xa43c('0x1f')](saveUpdates(_0xbfd21[_0xa43c('0x46')],null))['then'](respondWithResult(_0x5742c3,null))[_0xa43c('0x40')](handleError(_0x5742c3,null));};exports[_0xa43c('0x20')]=function(_0x1d9f80,_0x4a623f){return db['SugarcrmField'][_0xa43c('0x44')]({'where':{'id':_0x1d9f80['params']['id']}})[_0xa43c('0x1f')](handleEntityNotFound(_0x4a623f,null))[_0xa43c('0x1f')](removeEntity(_0x4a623f,null))[_0xa43c('0x40')](handleError(_0x4a623f,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index d4417cd..56f4687 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 _0xabc9=['bluebird','request-promise','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','int_sugarcrm_fields','sugarcrm_unique_index','FieldId','lodash','util','../../config/logger','api'];(function(_0xc0d9bc,_0x2bd6be){var _0x32ff73=function(_0x28c592){while(--_0x28c592){_0xc0d9bc['push'](_0xc0d9bc['shift']());}};_0x32ff73(++_0x2bd6be);}(_0xabc9,0x168));var _0x9abc=function(_0x2c42e7,_0x5d9746){_0x2c42e7=_0x2c42e7-0x0;var _0x2bee3=_0xabc9[_0x2c42e7];return _0x2bee3;};'use strict';var _=require(_0x9abc('0x0'));var util=require(_0x9abc('0x1'));var logger=require(_0x9abc('0x2'))(_0x9abc('0x3'));var moment=require('moment');var BPromise=require(_0x9abc('0x4'));var rp=require(_0x9abc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9abc('0x6'));var config=require(_0x9abc('0x7'));var attributes=require(_0x9abc('0x8'));module[_0x9abc('0x9')]=function(_0x461b46,_0x290124){return _0x461b46['define']('SugarcrmField',attributes,{'tableName':_0x9abc('0xa'),'paranoid':![],'indexes':[{'name':_0x9abc('0xb'),'fields':['idField',_0x9abc('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6618=['idField','FieldId','lodash','util','moment','bluebird','request-promise','path','rimraf','./intSugarcrmField.attributes','exports','define','SugarcrmField','sugarcrm_unique_index'];(function(_0x36ed3c,_0x44a00a){var _0x52a2e0=function(_0x3f7af9){while(--_0x3f7af9){_0x36ed3c['push'](_0x36ed3c['shift']());}};_0x52a2e0(++_0x44a00a);}(_0x6618,0x1d0));var _0x8661=function(_0x1518fe,_0x8dd246){_0x1518fe=_0x1518fe-0x0;var _0x38debf=_0x6618[_0x1518fe];return _0x38debf;};'use strict';var _=require(_0x8661('0x0'));var util=require(_0x8661('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x8661('0x2'));var BPromise=require(_0x8661('0x3'));var rp=require(_0x8661('0x4'));var fs=require('fs');var path=require(_0x8661('0x5'));var rimraf=require(_0x8661('0x6'));var config=require('../../config/environment');var attributes=require(_0x8661('0x7'));module[_0x8661('0x8')]=function(_0x405b13,_0x4005b7){return _0x405b13[_0x8661('0x9')](_0x8661('0xa'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0x8661('0xb'),'fields':[_0x8661('0xc'),_0x8661('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 f298143..917ed8f 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 _0xa410=['client','http','request','then','SugarcrmField,\x20%s,\x20%s','request\x20sent','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise'];(function(_0x812ab2,_0x30fabf){var _0x3cafe7=function(_0x51d0d4){while(--_0x51d0d4){_0x812ab2['push'](_0x812ab2['shift']());}};_0x3cafe7(++_0x30fabf);}(_0xa410,0x80));var _0x0a41=function(_0xad4e69,_0xb441f5){_0xad4e69=_0xad4e69-0x0;var _0x36dacf=_0xa410[_0xad4e69];return _0x36dacf;};'use strict';var _=require(_0x0a41('0x0'));var util=require(_0x0a41('0x1'));var moment=require(_0x0a41('0x2'));var BPromise=require(_0x0a41('0x3'));var rs=require(_0x0a41('0x4'));var fs=require('fs');var Redis=require(_0x0a41('0x5'));var db=require(_0x0a41('0x6'))['db'];var utils=require(_0x0a41('0x7'));var logger=require(_0x0a41('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0a41('0x9'));var client=jayson[_0x0a41('0xa')][_0x0a41('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1fad34,_0x203911,_0x5257a6){return new BPromise(function(_0x1d2942,_0x24295e){return client[_0x0a41('0xc')](_0x1fad34,_0x5257a6)[_0x0a41('0xd')](function(_0x26ed5f){logger['info'](_0x0a41('0xe'),_0x203911,_0x0a41('0xf'));logger['debug'](_0x0a41('0x10'),_0x203911,_0x0a41('0xf'),JSON[_0x0a41('0x11')](_0x26ed5f));if(_0x26ed5f['error']){if(_0x26ed5f[_0x0a41('0x12')][_0x0a41('0x13')]===0x1f4){logger['error'](_0x0a41('0xe'),_0x203911,_0x26ed5f[_0x0a41('0x12')][_0x0a41('0x14')]);return _0x24295e(_0x26ed5f[_0x0a41('0x12')][_0x0a41('0x14')]);}logger[_0x0a41('0x12')]('SugarcrmField,\x20%s,\x20%s',_0x203911,_0x26ed5f[_0x0a41('0x12')][_0x0a41('0x14')]);return _0x1d2942(_0x26ed5f[_0x0a41('0x12')]['message']);}else{logger[_0x0a41('0x15')](_0x0a41('0xe'),_0x203911,_0x0a41('0xf'));_0x1d2942(_0x26ed5f['result']['message']);}})[_0x0a41('0x16')](function(_0x10c202){logger[_0x0a41('0x12')](_0x0a41('0xe'),_0x203911,_0x10c202);_0x24295e(_0x10c202);});});} \ No newline at end of file +var _0x3149=['util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','debug','request\x20sent','stringify','error','code','SugarcrmField,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x47a204,_0x24b906){var _0x5623fc=function(_0x4404ac){while(--_0x4404ac){_0x47a204['push'](_0x47a204['shift']());}};_0x5623fc(++_0x24b906);}(_0x3149,0x186));var _0x9314=function(_0x4e37c0,_0x58598d){_0x4e37c0=_0x4e37c0-0x0;var _0x9504b=_0x3149[_0x4e37c0];return _0x9504b;};'use strict';var _=require(_0x9314('0x0'));var util=require(_0x9314('0x1'));var moment=require(_0x9314('0x2'));var BPromise=require('bluebird');var rs=require(_0x9314('0x3'));var fs=require('fs');var Redis=require(_0x9314('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9314('0x5'));var logger=require(_0x9314('0x6'))('rpc');var config=require(_0x9314('0x7'));var jayson=require(_0x9314('0x8'));var client=jayson[_0x9314('0x9')][_0x9314('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xc34231,_0x469cdc,_0x4e1fe6){return new BPromise(function(_0x409148,_0x393f85){return client[_0x9314('0xb')](_0xc34231,_0x4e1fe6)[_0x9314('0xc')](function(_0x533bea){logger[_0x9314('0xd')]('SugarcrmField,\x20%s,\x20%s',_0x469cdc,'request\x20sent');logger[_0x9314('0xe')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x469cdc,_0x9314('0xf'),JSON[_0x9314('0x10')](_0x533bea));if(_0x533bea['error']){if(_0x533bea[_0x9314('0x11')][_0x9314('0x12')]===0x1f4){logger[_0x9314('0x11')]('SugarcrmField,\x20%s,\x20%s',_0x469cdc,_0x533bea[_0x9314('0x11')]['message']);return _0x393f85(_0x533bea[_0x9314('0x11')]['message']);}logger['error'](_0x9314('0x13'),_0x469cdc,_0x533bea['error']['message']);return _0x409148(_0x533bea[_0x9314('0x11')][_0x9314('0x14')]);}else{logger[_0x9314('0xd')](_0x9314('0x13'),_0x469cdc,_0x9314('0xf'));_0x409148(_0x533bea[_0x9314('0x15')]['message']);}})[_0x9314('0x16')](function(_0x58bbd7){logger[_0x9314('0x11')](_0x9314('0x13'),_0x469cdc,_0x58bbd7);_0x393f85(_0x58bbd7);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index a8cbcf8..c200049 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 _0xa198=['/:id/configurations','/:id/fields','post','create','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','index','/:id','isAuthenticated'];(function(_0x1bfff6,_0xccc94b){var _0x57de72=function(_0x59097e){while(--_0x59097e){_0x1bfff6['push'](_0x1bfff6['shift']());}};_0x57de72(++_0xccc94b);}(_0xa198,0x7f));var _0x8a19=function(_0x4064ab,_0x53675b){_0x4064ab=_0x4064ab-0x0;var _0x212fe0=_0xa198[_0x4064ab];return _0x212fe0;};'use strict';var multer=require(_0x8a19('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x8a19('0x1'));var express=require(_0x8a19('0x2'));var router=express[_0x8a19('0x3')]();var fs_extra=require(_0x8a19('0x4'));var auth=require(_0x8a19('0x5'));var interaction=require(_0x8a19('0x6'));var config=require(_0x8a19('0x7'));var controller=require(_0x8a19('0x8'));router[_0x8a19('0x9')]('/',auth['isAuthenticated'](),controller[_0x8a19('0xa')]);router['get'](_0x8a19('0xb'),auth[_0x8a19('0xc')](),controller['show']);router[_0x8a19('0x9')](_0x8a19('0xd'),auth[_0x8a19('0xc')](),controller['getConfigurations']);router[_0x8a19('0x9')](_0x8a19('0xe'),auth[_0x8a19('0xc')](),controller['getFields']);router[_0x8a19('0xf')]('/',auth['isAuthenticated'](),controller[_0x8a19('0x10')]);router[_0x8a19('0xf')](_0x8a19('0xd'),auth[_0x8a19('0xc')](),controller['addConfiguration']);router['put'](_0x8a19('0xb'),auth[_0x8a19('0xc')](),controller['update']);router[_0x8a19('0x11')](_0x8a19('0xb'),auth[_0x8a19('0xc')](),controller[_0x8a19('0x12')]);module[_0x8a19('0x13')]=router; \ No newline at end of file +var _0xac8b=['../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x2cd443,_0x581268){var _0x14fd88=function(_0x19b484){while(--_0x19b484){_0x2cd443['push'](_0x2cd443['shift']());}};_0x14fd88(++_0x581268);}(_0xac8b,0x1c2));var _0xbac8=function(_0x432fca,_0xb0b1b5){_0x432fca=_0x432fca-0x0;var _0x3adba4=_0xac8b[_0x432fca];return _0x3adba4;};'use strict';var multer=require('multer');var util=require(_0xbac8('0x0'));var path=require(_0xbac8('0x1'));var timeout=require('connect-timeout');var express=require(_0xbac8('0x2'));var router=express[_0xbac8('0x3')]();var fs_extra=require(_0xbac8('0x4'));var auth=require(_0xbac8('0x5'));var interaction=require(_0xbac8('0x6'));var config=require(_0xbac8('0x7'));var controller=require(_0xbac8('0x8'));router[_0xbac8('0x9')]('/',auth[_0xbac8('0xa')](),controller[_0xbac8('0xb')]);router[_0xbac8('0x9')](_0xbac8('0xc'),auth[_0xbac8('0xa')](),controller['show']);router[_0xbac8('0x9')](_0xbac8('0xd'),auth[_0xbac8('0xa')](),controller[_0xbac8('0xe')]);router[_0xbac8('0x9')](_0xbac8('0xf'),auth['isAuthenticated'](),controller['getFields']);router[_0xbac8('0x10')]('/',auth['isAuthenticated'](),controller[_0xbac8('0x11')]);router[_0xbac8('0x10')](_0xbac8('0xd'),auth[_0xbac8('0xa')](),controller[_0xbac8('0x12')]);router[_0xbac8('0x13')](_0xbac8('0xc'),auth[_0xbac8('0xa')](),controller[_0xbac8('0x14')]);router[_0xbac8('0x15')](_0xbac8('0xc'),auth[_0xbac8('0xa')](),controller[_0xbac8('0x16')]);module[_0xbac8('0x17')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 581af3c..109d2b6 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 _0x06cc=['sequelize','exports','STRING','HelpDesk'];(function(_0x449a38,_0x3f8271){var _0x38a415=function(_0x261b53){while(--_0x261b53){_0x449a38['push'](_0x449a38['shift']());}};_0x38a415(++_0x3f8271);}(_0x06cc,0x174));var _0xc06c=function(_0x2b457f,_0x162ce7){_0x2b457f=_0x2b457f-0x0;var _0x48cf56=_0x06cc[_0x2b457f];return _0x48cf56;};'use strict';var Sequelize=require(_0xc06c('0x0'));module[_0xc06c('0x1')]={'name':{'type':Sequelize[_0xc06c('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize[_0xc06c('0x2')],'allowNull':![],'defaultValue':_0xc06c('0x3')},'remoteUri':{'type':Sequelize[_0xc06c('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xc06c('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0xc06c('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x23b9=['STRING','HelpDesk'];(function(_0x55e1b2,_0x45f484){var _0x5a933e=function(_0x2b6c4c){while(--_0x2b6c4c){_0x55e1b2['push'](_0x55e1b2['shift']());}};_0x5a933e(++_0x45f484);}(_0x23b9,0x1d2));var _0x923b=function(_0x1b92e3,_0x1d1a76){_0x1b92e3=_0x1b92e3-0x0;var _0x4d12ed=_0x23b9[_0x1b92e3];return _0x4d12ed;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x923b('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x923b('0x0')]},'username':{'type':Sequelize[_0x923b('0x0')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x923b('0x1')},'remoteUri':{'type':Sequelize[_0x923b('0x0')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x923b('0x0')],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 81f6bd7..4e09d58 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 _0xe24c=['slice','substring','lastIndexOf','format','getchallenge','success','POST','result','token','GET','describe','autogenerated','reference','owner','remove','includes','editable','false','label','startsWith','cf_','picklist','picklistValues','value','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','set','apply','save','then','error','stack','name','send','index','map','VtigerAccount','rawAttributes','fieldName','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','find','create','body','catch','update','params','getConfigurations','findOne','VtigerConfiguration','order','pick','nolimit','AccountId','getSubjects','channel','type','Descriptions','getDescriptions','VtigerField','Subjects','md5','getFields','moduleName','serverUrl','accessKey','username','remoteUri'];(function(_0x2977c5,_0x30c9e9){var _0x23d9e2=function(_0x3194e2){while(--_0x3194e2){_0x2977c5['push'](_0x2977c5['shift']());}};_0x23d9e2(++_0x30c9e9);}(_0xe24c,0x94));var _0xce24=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xe24c[_0x21a9d9];return _0x46adce;};'use strict';var emlformat=require(_0xce24('0x0'));var rimraf=require(_0xce24('0x1'));var zipdir=require(_0xce24('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xce24('0x3'));var moment=require(_0xce24('0x4'));var BPromise=require(_0xce24('0x5'));var Mustache=require('mustache');var util=require(_0xce24('0x6'));var path=require(_0xce24('0x7'));var sox=require(_0xce24('0x8'));var csv=require(_0xce24('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xce24('0xa'));var squel=require('squel');var crypto=require(_0xce24('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xce24('0xc'));var toCsv=require(_0xce24('0x9'));var querystring=require(_0xce24('0xd'));var Papa=require(_0xce24('0xe'));var Redis=require('ioredis');var authService=require(_0xce24('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xce24('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0xce24('0x11'));var config=require(_0xce24('0x12'));var licenseUtil=require(_0xce24('0x13'));var db=require(_0xce24('0x14'))['db'];var integrations=require(_0xce24('0x15'));function respondWithStatusCode(_0x59d9fc,_0x1d3eb0){_0x1d3eb0=_0x1d3eb0||0xcc;return function(_0x2e052b){if(_0x2e052b){return _0x59d9fc['sendStatus'](_0x1d3eb0);}return _0x59d9fc[_0xce24('0x16')](_0x1d3eb0)[_0xce24('0x17')]();};}function respondWithResult(_0x4d05f1,_0x43cab3){_0x43cab3=_0x43cab3||0xc8;return function(_0x1310e2){if(_0x1310e2){return _0x4d05f1[_0xce24('0x16')](_0x43cab3)[_0xce24('0x18')](_0x1310e2);}};}function respondWithFilteredResult(_0x32dac2,_0x4dc7e9){return function(_0x54dcfa){if(_0x54dcfa){var _0x44cd07=typeof _0x4dc7e9[_0xce24('0x19')]===_0xce24('0x1a')&&typeof _0x4dc7e9[_0xce24('0x1b')]===_0xce24('0x1a');var _0x1bd281=_0x54dcfa['count'];var _0x1e5561=_0x44cd07?0x0:_0x4dc7e9[_0xce24('0x19')];var _0xc07bc0=_0x44cd07?_0x54dcfa[_0xce24('0x1c')]:_0x4dc7e9[_0xce24('0x19')]+_0x4dc7e9['limit'];var _0x2ed25a;if(_0xc07bc0>=_0x1bd281){_0xc07bc0=_0x1bd281;_0x2ed25a=0xc8;}else{_0x2ed25a=0xce;}_0x32dac2[_0xce24('0x16')](_0x2ed25a);return _0x32dac2[_0xce24('0x1d')]('Content-Range',_0x1e5561+'-'+_0xc07bc0+'/'+_0x1bd281)['json'](_0x54dcfa);}return null;};}function patchUpdates(_0x5649b4){return function(_0x4c0f1b){try{jsonpatch[_0xce24('0x1e')](_0x4c0f1b,_0x5649b4,!![]);}catch(_0x1009b6){return BPromise['reject'](_0x1009b6);}return _0x4c0f1b[_0xce24('0x1f')]();};}function saveUpdates(_0x2a1fe9,_0x3cbfdc){return function(_0x1ea24e){if(_0x1ea24e){return _0x1ea24e['update'](_0x2a1fe9)[_0xce24('0x20')](function(_0x230066){return _0x230066;});}return null;};}function removeEntity(_0x400231,_0x1a547a){return function(_0x2eec32){if(_0x2eec32){return _0x2eec32['destroy']()['then'](function(){_0x400231[_0xce24('0x16')](0xcc)[_0xce24('0x17')]();});}};}function handleEntityNotFound(_0x25028c,_0x5c4140){return function(_0x200650){if(!_0x200650){_0x25028c['sendStatus'](0x194);}return _0x200650;};}function handleError(_0x2a0b3a,_0x28dff1){_0x28dff1=_0x28dff1||0x1f4;return function(_0x28a2c8){logger[_0xce24('0x21')](_0x28a2c8[_0xce24('0x22')]);if(_0x28a2c8[_0xce24('0x23')]){delete _0x28a2c8[_0xce24('0x23')];}_0x2a0b3a[_0xce24('0x16')](_0x28dff1)[_0xce24('0x24')](_0x28a2c8);};}exports[_0xce24('0x25')]=function(_0x152a51,_0x5a4a02){var _0x4004af={},_0x9237c8={},_0xe2c972={'count':0x0,'rows':[]};var _0x358308=_[_0xce24('0x26')](db[_0xce24('0x27')][_0xce24('0x28')],function(_0x2fa048){return{'name':_0x2fa048[_0xce24('0x29')],'type':_0x2fa048['type']['key']};});_0x9237c8[_0xce24('0x2a')]=_[_0xce24('0x26')](_0x358308,_0xce24('0x23'));_0x9237c8['query']=_[_0xce24('0x2b')](_0x152a51['query']);_0x9237c8[_0xce24('0x2c')]=_[_0xce24('0x2d')](_0x9237c8[_0xce24('0x2a')],_0x9237c8[_0xce24('0x2e')]);_0x4004af['attributes']=_[_0xce24('0x2d')](_0x9237c8[_0xce24('0x2a')],qs[_0xce24('0x2f')](_0x152a51[_0xce24('0x2e')][_0xce24('0x2f')]));_0x4004af[_0xce24('0x30')]=_0x4004af['attributes'][_0xce24('0x31')]?_0x4004af[_0xce24('0x30')]:_0x9237c8['model'];if(!_0x152a51['query'][_0xce24('0x32')]('nolimit')){_0x4004af[_0xce24('0x1b')]=qs[_0xce24('0x1b')](_0x152a51[_0xce24('0x2e')][_0xce24('0x1b')]);_0x4004af[_0xce24('0x19')]=qs[_0xce24('0x19')](_0x152a51['query']['offset']);}_0x4004af['order']=qs['sort'](_0x152a51[_0xce24('0x2e')][_0xce24('0x33')]);_0x4004af['where']=qs[_0xce24('0x2c')](_['pick'](_0x152a51[_0xce24('0x2e')],_0x9237c8[_0xce24('0x2c')]),_0x358308);if(_0x152a51[_0xce24('0x2e')]['filter']){_0x4004af[_0xce24('0x34')]=_[_0xce24('0x35')](_0x4004af[_0xce24('0x34')],{'$or':_['map'](_0x358308,function(_0x1c3878){if(_0x1c3878['type']!==_0xce24('0x36')){var _0x19bca7={};_0x19bca7[_0x1c3878[_0xce24('0x23')]]={'$like':'%'+_0x152a51[_0xce24('0x2e')][_0xce24('0x37')]+'%'};return _0x19bca7;}})});}_0x4004af=_[_0xce24('0x35')]({},_0x4004af,_0x152a51[_0xce24('0x38')]);var _0x790e95={'where':_0x4004af[_0xce24('0x34')]};return db[_0xce24('0x27')][_0xce24('0x1c')](_0x790e95)[_0xce24('0x20')](function(_0xd8e073){_0xe2c972[_0xce24('0x1c')]=_0xd8e073;if(_0x152a51[_0xce24('0x2e')][_0xce24('0x39')]){_0x4004af[_0xce24('0x3a')]=[{'all':!![]}];}return db[_0xce24('0x27')][_0xce24('0x3b')](_0x4004af);})[_0xce24('0x20')](function(_0x1af1a6){_0xe2c972[_0xce24('0x3c')]=_0x1af1a6;return _0xe2c972;})[_0xce24('0x20')](respondWithFilteredResult(_0x5a4a02,_0x4004af))['catch'](handleError(_0x5a4a02,null));};exports['show']=function(_0x3e3f97,_0x11722f){var _0x1e9144={'raw':![],'where':{'id':_0x3e3f97['params']['id']}},_0x3fc2d9={};_0x3fc2d9[_0xce24('0x2a')]=_[_0xce24('0x2b')](db['VtigerAccount'][_0xce24('0x28')]);_0x3fc2d9[_0xce24('0x2e')]=_[_0xce24('0x2b')](_0x3e3f97[_0xce24('0x2e')]);_0x3fc2d9[_0xce24('0x2c')]=_[_0xce24('0x2d')](_0x3fc2d9['model'],_0x3fc2d9[_0xce24('0x2e')]);_0x1e9144[_0xce24('0x30')]=_[_0xce24('0x2d')](_0x3fc2d9['model'],qs['fields'](_0x3e3f97[_0xce24('0x2e')][_0xce24('0x2f')]));_0x1e9144[_0xce24('0x30')]=_0x1e9144[_0xce24('0x30')][_0xce24('0x31')]?_0x1e9144['attributes']:_0x3fc2d9['model'];if(_0x3e3f97[_0xce24('0x2e')]['includeAll']){_0x1e9144[_0xce24('0x3a')]=[{'all':!![]}];}_0x1e9144=_[_0xce24('0x35')]({},_0x1e9144,_0x3e3f97[_0xce24('0x38')]);return db[_0xce24('0x27')][_0xce24('0x3d')](_0x1e9144)['then'](handleEntityNotFound(_0x11722f,null))[_0xce24('0x20')](respondWithResult(_0x11722f,null))['catch'](handleError(_0x11722f,null));};exports[_0xce24('0x3e')]=function(_0x1bd4ef,_0x40f2a4){return db[_0xce24('0x27')][_0xce24('0x3e')](_0x1bd4ef[_0xce24('0x3f')],{})[_0xce24('0x20')](respondWithResult(_0x40f2a4,0xc9))[_0xce24('0x40')](handleError(_0x40f2a4,null));};exports[_0xce24('0x41')]=function(_0x5b73b2,_0x5b3a8e){if(_0x5b73b2[_0xce24('0x3f')]['id']){delete _0x5b73b2[_0xce24('0x3f')]['id'];}return db[_0xce24('0x27')][_0xce24('0x3d')]({'where':{'id':_0x5b73b2['params']['id']}})['then'](handleEntityNotFound(_0x5b3a8e,null))[_0xce24('0x20')](saveUpdates(_0x5b73b2['body'],null))[_0xce24('0x20')](respondWithResult(_0x5b3a8e,null))[_0xce24('0x40')](handleError(_0x5b3a8e,null));};exports['destroy']=function(_0x142152,_0x1f0b5a){return db[_0xce24('0x27')]['find']({'where':{'id':_0x142152[_0xce24('0x42')]['id']}})[_0xce24('0x20')](handleEntityNotFound(_0x1f0b5a,null))[_0xce24('0x20')](removeEntity(_0x1f0b5a,null))[_0xce24('0x40')](handleError(_0x1f0b5a,null));};exports[_0xce24('0x43')]=function(_0x30b863,_0x904535,_0x1c5c86){var _0x83a364={};var _0x5a8182={};var _0x3dd25e;var _0x453e16;return db[_0xce24('0x27')][_0xce24('0x44')]({'where':{'id':_0x30b863[_0xce24('0x42')]['id']}})[_0xce24('0x20')](handleEntityNotFound(_0x904535,null))[_0xce24('0x20')](function(_0x3916bd){if(_0x3916bd){_0x3dd25e=_0x3916bd;_0x5a8182['model']=_[_0xce24('0x2b')](db[_0xce24('0x45')][_0xce24('0x28')]);_0x5a8182[_0xce24('0x2e')]=_['keys'](_0x30b863[_0xce24('0x2e')]);_0x5a8182[_0xce24('0x2c')]=_[_0xce24('0x2d')](_0x5a8182[_0xce24('0x2a')],_0x5a8182[_0xce24('0x2e')]);_0x83a364[_0xce24('0x30')]=_[_0xce24('0x2d')](_0x5a8182[_0xce24('0x2a')],qs['fields'](_0x30b863['query']['fields']));_0x83a364[_0xce24('0x30')]=_0x83a364['attributes']['length']?_0x83a364['attributes']:_0x5a8182[_0xce24('0x2a')];_0x83a364[_0xce24('0x46')]=qs[_0xce24('0x33')](_0x30b863[_0xce24('0x2e')][_0xce24('0x33')]);_0x83a364['where']=qs[_0xce24('0x2c')](_[_0xce24('0x47')](_0x30b863[_0xce24('0x2e')],_0x5a8182[_0xce24('0x2c')]));if(_0x30b863[_0xce24('0x2e')]['filter']){_0x83a364[_0xce24('0x34')]=_[_0xce24('0x35')](_0x83a364[_0xce24('0x34')],{'$or':_[_0xce24('0x26')](_0x83a364[_0xce24('0x30')],function(_0x343b4c){var _0x224b11={};_0x224b11[_0x343b4c]={'$like':'%'+_0x30b863[_0xce24('0x2e')][_0xce24('0x37')]+'%'};return _0x224b11;})});}_0x83a364=_['merge']({},_0x83a364,_0x30b863[_0xce24('0x38')]);return _0x3dd25e[_0xce24('0x43')](_0x83a364);}})[_0xce24('0x20')](function(_0x1ce38b){if(_0x1ce38b){_0x453e16=_0x1ce38b[_0xce24('0x31')];if(!_0x30b863['query'][_0xce24('0x32')](_0xce24('0x48'))){_0x83a364[_0xce24('0x1b')]=qs[_0xce24('0x1b')](_0x30b863[_0xce24('0x2e')]['limit']);_0x83a364[_0xce24('0x19')]=qs[_0xce24('0x19')](_0x30b863[_0xce24('0x2e')]['offset']);}return _0x3dd25e[_0xce24('0x43')](_0x83a364);}})['then'](function(_0x1cb78b){if(_0x1cb78b){return _0x1cb78b?{'count':_0x453e16,'rows':_0x1cb78b}:null;}})[_0xce24('0x20')](respondWithResult(_0x904535,null))[_0xce24('0x40')](handleError(_0x904535,null));};exports['addConfiguration']=function(_0x564390,_0x436196,_0x3e4167){if(_0x564390['body']['id']){delete _0x564390[_0xce24('0x3f')]['id'];}return db[_0xce24('0x27')]['findOne']({'where':{'id':_0x564390['params']['id']}})[_0xce24('0x20')](handleEntityNotFound(_0x436196,null))[_0xce24('0x20')](function(_0x55dd89){if(_0x55dd89){_0x564390[_0xce24('0x3f')][_0xce24('0x49')]=_0x55dd89['id'];_0x564390['body']['Subjects']=integrations[_0xce24('0x4a')](_0x564390[_0xce24('0x3f')][_0xce24('0x4b')],_0x564390[_0xce24('0x3f')][_0xce24('0x4c')]);_0x564390[_0xce24('0x3f')][_0xce24('0x4d')]=integrations[_0xce24('0x4e')](_0x564390['body']['channel'],_0x564390[_0xce24('0x3f')][_0xce24('0x4c')]);return db[_0xce24('0x45')][_0xce24('0x3e')](_0x564390[_0xce24('0x3f')],{'include':[{'model':db[_0xce24('0x4f')],'as':_0xce24('0x50')},{'model':db[_0xce24('0x4f')],'as':_0xce24('0x4d')}]});}return null;})[_0xce24('0x20')](respondWithResult(_0x436196,null))[_0xce24('0x40')](handleError(_0x436196,null));};var md5=require(_0xce24('0x51'));exports[_0xce24('0x52')]=function(_0x52a252,_0x5215f4,_0xfae3b7){var _0x18cae4=null;var _0x54d4b4=null;var _0x2569d1=null;var _0xbe97dc=null;var _0x39e705='';return db[_0xce24('0x27')]['findOne']({'where':{'id':_0x52a252[_0xce24('0x42')]['id']},'attributes':['id',_0xce24('0x23'),'username','description',_0xce24('0x53'),'remoteUri',_0xce24('0x54'),_0xce24('0x55')]})[_0xce24('0x20')](handleEntityNotFound(_0x5215f4,null))[_0xce24('0x20')](function(_0x274539){if(_0x274539){_0x18cae4=_0x274539[_0xce24('0x56')];_0x54d4b4=_0x274539['accessKey'];_0x2569d1=_0x274539[_0xce24('0x53')];_0x39e705=_0x274539[_0xce24('0x57')];var _0x45a59d=_0x39e705[_0xce24('0x58')](-0x1);if(_0x45a59d==='/'){_0x39e705=_0x39e705[_0xce24('0x59')](0x0,_0x39e705[_0xce24('0x5a')](_0x45a59d));}_0xbe97dc=util[_0xce24('0x5b')]('%s/webservice.php',_0x39e705);var _0x1987e1={'method':'GET','uri':_0xbe97dc,'qs':{'operation':_0xce24('0x5c'),'username':_0x274539[_0xce24('0x56')]},'json':!![]};return rp(_0x1987e1);}})['then'](function(_0x51e62e){if(_0x51e62e[_0xce24('0x5d')]){var _0x4c07e2={'method':_0xce24('0x5e'),'uri':_0xbe97dc,'form':{'operation':'login','username':_0x18cae4,'accessKey':md5(_0x51e62e[_0xce24('0x5f')][_0xce24('0x60')]+_0x54d4b4)},'json':!![]};return rp(_0x4c07e2);}})[_0xce24('0x20')](function(_0x4536b3){if(_0x4536b3[_0xce24('0x5d')]){var _0x4955c7={'method':_0xce24('0x61'),'uri':_0xbe97dc,'qs':{'operation':_0xce24('0x62'),'username':_0x18cae4,'sessionName':_0x4536b3['result']['sessionName'],'elementType':_0x2569d1},'json':!![]};return rp(_0x4955c7);}})[_0xce24('0x20')](function(_0x50ee9f){if(_0x50ee9f[_0xce24('0x5d')]){var _0x3e7a4c=[_0xce24('0x63'),_0xce24('0x64'),_0xce24('0x65')];_[_0xce24('0x66')](_0x50ee9f['result'][_0xce24('0x2f')],function(_0xc4020){return _0x3e7a4c[_0xce24('0x67')](_0xc4020[_0xce24('0x4c')][_0xce24('0x23')]);});_[_0xce24('0x66')](_0x50ee9f[_0xce24('0x5f')][_0xce24('0x2f')],function(_0x50c0bf){return _0x50c0bf[_0xce24('0x68')]===_0xce24('0x69');});return{'count':_0x50ee9f[_0xce24('0x5f')][_0xce24('0x2f')][_0xce24('0x31')],'rows':_[_0xce24('0x26')](_0x50ee9f['result'][_0xce24('0x2f')],function(_0x3cdf7f){return{'id':_0x3cdf7f[_0xce24('0x23')],'name':_0x3cdf7f[_0xce24('0x6a')],'custom':_[_0xce24('0x6b')](_0x3cdf7f['name'],_0xce24('0x6c'))?!![]:![],'options':_0x3cdf7f[_0xce24('0x4c')][_0xce24('0x23')]===_0xce24('0x6d')&&_0x3cdf7f[_0xce24('0x4c')]['picklistValues'][_0xce24('0x31')]>0x0?_['map'](_0x3cdf7f['type'][_0xce24('0x6e')],function(_0x1577b0){return{'name':_0x1577b0[_0xce24('0x6a')],'value':_0x1577b0[_0xce24('0x6f')]};}):[]};})};}})[_0xce24('0x20')](respondWithResult(_0x5215f4,null))[_0xce24('0x40')](function(_0x1c020a){console['log'](_0xce24('0x70')+_0x1c020a);var _0x32bc56=_0x52a252[_0xce24('0x2e')][_0xce24('0x71')]?0x1f4:_0x1c020a[_0xce24('0x72')]||0x1f4;logger[_0xce24('0x21')](_0xce24('0x73'),_0xce24('0x52'),_0x32bc56,JSON[_0xce24('0x74')](_0x1c020a));delete _0x1c020a[_0xce24('0x23')];if(_0x32bc56===0x191){_0x32bc56=0x190;}_0x5215f4[_0xce24('0x16')](_0x32bc56)[_0xce24('0x24')](_0x52a252['query']['test']?{'message':_0xce24('0x75'),'statusCode':_0x1c020a[_0xce24('0x72')]}:_0x1c020a);});}; \ No newline at end of file +var _0xd9b5=['format','%s/webservice.php','GET','getchallenge','success','POST','login','result','token','sessionName','autogenerated','owner','remove','includes','editable','false','label','startsWith','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','destroy','error','name','send','index','rawAttributes','fieldName','type','model','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','filter','merge','options','VtigerAccount','then','includeAll','include','findAll','rows','show','params','length','catch','create','body','update','find','getConfigurations','findOne','VtigerConfiguration','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','VtigerField','md5','getFields','username','moduleName','remoteUri','serverUrl','accessKey','slice','lastIndexOf'];(function(_0x9a9783,_0x1ab543){var _0x4e5772=function(_0x3e0135){while(--_0x3e0135){_0x9a9783['push'](_0x9a9783['shift']());}};_0x4e5772(++_0x1ab543);}(_0xd9b5,0x111));var _0x5d9b=function(_0x7bbd5d,_0x1509b8){_0x7bbd5d=_0x7bbd5d-0x0;var _0x140b70=_0xd9b5[_0x7bbd5d];return _0x140b70;};'use strict';var emlformat=require(_0x5d9b('0x0'));var rimraf=require(_0x5d9b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5d9b('0x2'));var rp=require(_0x5d9b('0x3'));var moment=require(_0x5d9b('0x4'));var BPromise=require(_0x5d9b('0x5'));var Mustache=require('mustache');var util=require(_0x5d9b('0x6'));var path=require(_0x5d9b('0x7'));var sox=require(_0x5d9b('0x8'));var csv=require(_0x5d9b('0x9'));var ejs=require(_0x5d9b('0xa'));var fs=require('fs');var fs_extra=require(_0x5d9b('0xb'));var _=require(_0x5d9b('0xc'));var squel=require(_0x5d9b('0xd'));var crypto=require(_0x5d9b('0xe'));var jsforce=require(_0x5d9b('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x5d9b('0x9'));var querystring=require(_0x5d9b('0x10'));var Papa=require(_0x5d9b('0x11'));var Redis=require('ioredis');var authService=require(_0x5d9b('0x12'));var qs=require(_0x5d9b('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5d9b('0x14'));var utils=require(_0x5d9b('0x15'));var config=require(_0x5d9b('0x16'));var licenseUtil=require(_0x5d9b('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x5d9b('0x18'));function respondWithStatusCode(_0x5ce3a6,_0x1ab836){_0x1ab836=_0x1ab836||0xcc;return function(_0x4f7298){if(_0x4f7298){return _0x5ce3a6[_0x5d9b('0x19')](_0x1ab836);}return _0x5ce3a6['status'](_0x1ab836)[_0x5d9b('0x1a')]();};}function respondWithResult(_0x34da3a,_0x223cdf){_0x223cdf=_0x223cdf||0xc8;return function(_0x424ff4){if(_0x424ff4){return _0x34da3a[_0x5d9b('0x1b')](_0x223cdf)[_0x5d9b('0x1c')](_0x424ff4);}};}function respondWithFilteredResult(_0x5707e5,_0x5a99de){return function(_0xebb4dc){if(_0xebb4dc){var _0x302551=typeof _0x5a99de['offset']===_0x5d9b('0x1d')&&typeof _0x5a99de[_0x5d9b('0x1e')]===_0x5d9b('0x1d');var _0x5ad3ad=_0xebb4dc[_0x5d9b('0x1f')];var _0x4f0156=_0x302551?0x0:_0x5a99de['offset'];var _0x189c93=_0x302551?_0xebb4dc[_0x5d9b('0x1f')]:_0x5a99de[_0x5d9b('0x20')]+_0x5a99de['limit'];var _0x188529;if(_0x189c93>=_0x5ad3ad){_0x189c93=_0x5ad3ad;_0x188529=0xc8;}else{_0x188529=0xce;}_0x5707e5[_0x5d9b('0x1b')](_0x188529);return _0x5707e5[_0x5d9b('0x21')](_0x5d9b('0x22'),_0x4f0156+'-'+_0x189c93+'/'+_0x5ad3ad)[_0x5d9b('0x1c')](_0xebb4dc);}return null;};}function patchUpdates(_0x31752c){return function(_0x3e4cb1){try{jsonpatch[_0x5d9b('0x23')](_0x3e4cb1,_0x31752c,!![]);}catch(_0x5b9194){return BPromise[_0x5d9b('0x24')](_0x5b9194);}return _0x3e4cb1[_0x5d9b('0x25')]();};}function saveUpdates(_0x342b77,_0x3203c0){return function(_0x5b5141){if(_0x5b5141){return _0x5b5141['update'](_0x342b77)['then'](function(_0x384f08){return _0x384f08;});}return null;};}function removeEntity(_0x4e4afc,_0x550b06){return function(_0x30cc0d){if(_0x30cc0d){return _0x30cc0d[_0x5d9b('0x26')]()['then'](function(){_0x4e4afc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x11da6b,_0x415078){return function(_0x5a8c95){if(!_0x5a8c95){_0x11da6b[_0x5d9b('0x19')](0x194);}return _0x5a8c95;};}function handleError(_0x12d5ac,_0x108931){_0x108931=_0x108931||0x1f4;return function(_0x426095){logger[_0x5d9b('0x27')](_0x426095['stack']);if(_0x426095[_0x5d9b('0x28')]){delete _0x426095[_0x5d9b('0x28')];}_0x12d5ac[_0x5d9b('0x1b')](_0x108931)[_0x5d9b('0x29')](_0x426095);};}exports[_0x5d9b('0x2a')]=function(_0x2719cb,_0x4d0ff4){var _0x19a640={},_0x4f6015={},_0x33cc0d={'count':0x0,'rows':[]};var _0x16a8b5=_['map'](db['VtigerAccount'][_0x5d9b('0x2b')],function(_0x4b4594){return{'name':_0x4b4594[_0x5d9b('0x2c')],'type':_0x4b4594[_0x5d9b('0x2d')]['key']};});_0x4f6015[_0x5d9b('0x2e')]=_[_0x5d9b('0x2f')](_0x16a8b5,'name');_0x4f6015[_0x5d9b('0x30')]=_[_0x5d9b('0x31')](_0x2719cb[_0x5d9b('0x30')]);_0x4f6015[_0x5d9b('0x32')]=_['intersection'](_0x4f6015['model'],_0x4f6015[_0x5d9b('0x30')]);_0x19a640[_0x5d9b('0x33')]=_[_0x5d9b('0x34')](_0x4f6015['model'],qs[_0x5d9b('0x35')](_0x2719cb[_0x5d9b('0x30')][_0x5d9b('0x35')]));_0x19a640[_0x5d9b('0x33')]=_0x19a640[_0x5d9b('0x33')]['length']?_0x19a640['attributes']:_0x4f6015[_0x5d9b('0x2e')];if(!_0x2719cb[_0x5d9b('0x30')][_0x5d9b('0x36')]('nolimit')){_0x19a640[_0x5d9b('0x1e')]=qs['limit'](_0x2719cb[_0x5d9b('0x30')][_0x5d9b('0x1e')]);_0x19a640[_0x5d9b('0x20')]=qs[_0x5d9b('0x20')](_0x2719cb['query']['offset']);}_0x19a640[_0x5d9b('0x37')]=qs[_0x5d9b('0x38')](_0x2719cb[_0x5d9b('0x30')]['sort']);_0x19a640[_0x5d9b('0x39')]=qs[_0x5d9b('0x32')](_[_0x5d9b('0x3a')](_0x2719cb['query'],_0x4f6015[_0x5d9b('0x32')]),_0x16a8b5);if(_0x2719cb[_0x5d9b('0x30')][_0x5d9b('0x3b')]){_0x19a640['where']=_[_0x5d9b('0x3c')](_0x19a640[_0x5d9b('0x39')],{'$or':_[_0x5d9b('0x2f')](_0x16a8b5,function(_0x3a30fa){if(_0x3a30fa[_0x5d9b('0x2d')]!=='VIRTUAL'){var _0x5c7486={};_0x5c7486[_0x3a30fa[_0x5d9b('0x28')]]={'$like':'%'+_0x2719cb[_0x5d9b('0x30')][_0x5d9b('0x3b')]+'%'};return _0x5c7486;}})});}_0x19a640=_[_0x5d9b('0x3c')]({},_0x19a640,_0x2719cb[_0x5d9b('0x3d')]);var _0x2b809a={'where':_0x19a640['where']};return db[_0x5d9b('0x3e')][_0x5d9b('0x1f')](_0x2b809a)[_0x5d9b('0x3f')](function(_0x30f411){_0x33cc0d['count']=_0x30f411;if(_0x2719cb[_0x5d9b('0x30')][_0x5d9b('0x40')]){_0x19a640[_0x5d9b('0x41')]=[{'all':!![]}];}return db['VtigerAccount'][_0x5d9b('0x42')](_0x19a640);})['then'](function(_0x55bdb7){_0x33cc0d[_0x5d9b('0x43')]=_0x55bdb7;return _0x33cc0d;})[_0x5d9b('0x3f')](respondWithFilteredResult(_0x4d0ff4,_0x19a640))['catch'](handleError(_0x4d0ff4,null));};exports[_0x5d9b('0x44')]=function(_0x41dd7f,_0x51e13a){var _0x291685={'raw':![],'where':{'id':_0x41dd7f[_0x5d9b('0x45')]['id']}},_0x4c25c5={};_0x4c25c5['model']=_[_0x5d9b('0x31')](db['VtigerAccount']['rawAttributes']);_0x4c25c5[_0x5d9b('0x30')]=_[_0x5d9b('0x31')](_0x41dd7f['query']);_0x4c25c5[_0x5d9b('0x32')]=_[_0x5d9b('0x34')](_0x4c25c5['model'],_0x4c25c5['query']);_0x291685[_0x5d9b('0x33')]=_['intersection'](_0x4c25c5[_0x5d9b('0x2e')],qs[_0x5d9b('0x35')](_0x41dd7f[_0x5d9b('0x30')][_0x5d9b('0x35')]));_0x291685[_0x5d9b('0x33')]=_0x291685[_0x5d9b('0x33')][_0x5d9b('0x46')]?_0x291685['attributes']:_0x4c25c5[_0x5d9b('0x2e')];if(_0x41dd7f[_0x5d9b('0x30')][_0x5d9b('0x40')]){_0x291685[_0x5d9b('0x41')]=[{'all':!![]}];}_0x291685=_[_0x5d9b('0x3c')]({},_0x291685,_0x41dd7f[_0x5d9b('0x3d')]);return db['VtigerAccount']['find'](_0x291685)[_0x5d9b('0x3f')](handleEntityNotFound(_0x51e13a,null))[_0x5d9b('0x3f')](respondWithResult(_0x51e13a,null))[_0x5d9b('0x47')](handleError(_0x51e13a,null));};exports[_0x5d9b('0x48')]=function(_0x58d479,_0x599334){return db[_0x5d9b('0x3e')][_0x5d9b('0x48')](_0x58d479[_0x5d9b('0x49')],{})['then'](respondWithResult(_0x599334,0xc9))[_0x5d9b('0x47')](handleError(_0x599334,null));};exports[_0x5d9b('0x4a')]=function(_0x2886dc,_0x39df43){if(_0x2886dc[_0x5d9b('0x49')]['id']){delete _0x2886dc[_0x5d9b('0x49')]['id'];}return db[_0x5d9b('0x3e')]['find']({'where':{'id':_0x2886dc[_0x5d9b('0x45')]['id']}})['then'](handleEntityNotFound(_0x39df43,null))[_0x5d9b('0x3f')](saveUpdates(_0x2886dc[_0x5d9b('0x49')],null))['then'](respondWithResult(_0x39df43,null))['catch'](handleError(_0x39df43,null));};exports[_0x5d9b('0x26')]=function(_0x421dbd,_0x2a5454){return db[_0x5d9b('0x3e')][_0x5d9b('0x4b')]({'where':{'id':_0x421dbd[_0x5d9b('0x45')]['id']}})['then'](handleEntityNotFound(_0x2a5454,null))['then'](removeEntity(_0x2a5454,null))[_0x5d9b('0x47')](handleError(_0x2a5454,null));};exports[_0x5d9b('0x4c')]=function(_0x2360c5,_0x1a1073,_0x51b19a){var _0x43b343={};var _0x2f5eaf={};var _0x53f9e9;var _0x29c9f0;return db['VtigerAccount'][_0x5d9b('0x4d')]({'where':{'id':_0x2360c5[_0x5d9b('0x45')]['id']}})[_0x5d9b('0x3f')](handleEntityNotFound(_0x1a1073,null))[_0x5d9b('0x3f')](function(_0x40abb0){if(_0x40abb0){_0x53f9e9=_0x40abb0;_0x2f5eaf[_0x5d9b('0x2e')]=_[_0x5d9b('0x31')](db[_0x5d9b('0x4e')][_0x5d9b('0x2b')]);_0x2f5eaf[_0x5d9b('0x30')]=_[_0x5d9b('0x31')](_0x2360c5[_0x5d9b('0x30')]);_0x2f5eaf[_0x5d9b('0x32')]=_[_0x5d9b('0x34')](_0x2f5eaf[_0x5d9b('0x2e')],_0x2f5eaf[_0x5d9b('0x30')]);_0x43b343[_0x5d9b('0x33')]=_[_0x5d9b('0x34')](_0x2f5eaf[_0x5d9b('0x2e')],qs[_0x5d9b('0x35')](_0x2360c5[_0x5d9b('0x30')][_0x5d9b('0x35')]));_0x43b343[_0x5d9b('0x33')]=_0x43b343[_0x5d9b('0x33')][_0x5d9b('0x46')]?_0x43b343[_0x5d9b('0x33')]:_0x2f5eaf[_0x5d9b('0x2e')];_0x43b343[_0x5d9b('0x37')]=qs['sort'](_0x2360c5[_0x5d9b('0x30')][_0x5d9b('0x38')]);_0x43b343[_0x5d9b('0x39')]=qs[_0x5d9b('0x32')](_[_0x5d9b('0x3a')](_0x2360c5['query'],_0x2f5eaf['filters']));if(_0x2360c5[_0x5d9b('0x30')][_0x5d9b('0x3b')]){_0x43b343[_0x5d9b('0x39')]=_['merge'](_0x43b343['where'],{'$or':_[_0x5d9b('0x2f')](_0x43b343[_0x5d9b('0x33')],function(_0x3f951e){var _0xdbd04c={};_0xdbd04c[_0x3f951e]={'$like':'%'+_0x2360c5[_0x5d9b('0x30')][_0x5d9b('0x3b')]+'%'};return _0xdbd04c;})});}_0x43b343=_['merge']({},_0x43b343,_0x2360c5[_0x5d9b('0x3d')]);return _0x53f9e9[_0x5d9b('0x4c')](_0x43b343);}})[_0x5d9b('0x3f')](function(_0x4f379b){if(_0x4f379b){_0x29c9f0=_0x4f379b[_0x5d9b('0x46')];if(!_0x2360c5[_0x5d9b('0x30')][_0x5d9b('0x36')](_0x5d9b('0x4f'))){_0x43b343[_0x5d9b('0x1e')]=qs[_0x5d9b('0x1e')](_0x2360c5[_0x5d9b('0x30')]['limit']);_0x43b343[_0x5d9b('0x20')]=qs[_0x5d9b('0x20')](_0x2360c5[_0x5d9b('0x30')][_0x5d9b('0x20')]);}return _0x53f9e9['getConfigurations'](_0x43b343);}})[_0x5d9b('0x3f')](function(_0x54f735){if(_0x54f735){return _0x54f735?{'count':_0x29c9f0,'rows':_0x54f735}:null;}})[_0x5d9b('0x3f')](respondWithResult(_0x1a1073,null))[_0x5d9b('0x47')](handleError(_0x1a1073,null));};exports[_0x5d9b('0x50')]=function(_0x3d033f,_0x34f166,_0x27be90){if(_0x3d033f[_0x5d9b('0x49')]['id']){delete _0x3d033f[_0x5d9b('0x49')]['id'];}return db['VtigerAccount'][_0x5d9b('0x4d')]({'where':{'id':_0x3d033f[_0x5d9b('0x45')]['id']}})[_0x5d9b('0x3f')](handleEntityNotFound(_0x34f166,null))['then'](function(_0x4d392b){if(_0x4d392b){_0x3d033f['body'][_0x5d9b('0x51')]=_0x4d392b['id'];_0x3d033f[_0x5d9b('0x49')][_0x5d9b('0x52')]=integrations[_0x5d9b('0x53')](_0x3d033f[_0x5d9b('0x49')][_0x5d9b('0x54')],_0x3d033f[_0x5d9b('0x49')][_0x5d9b('0x2d')]);_0x3d033f['body'][_0x5d9b('0x55')]=integrations['getDescriptions'](_0x3d033f[_0x5d9b('0x49')][_0x5d9b('0x54')],_0x3d033f[_0x5d9b('0x49')]['type']);return db[_0x5d9b('0x4e')]['create'](_0x3d033f[_0x5d9b('0x49')],{'include':[{'model':db['VtigerField'],'as':'Subjects'},{'model':db[_0x5d9b('0x56')],'as':_0x5d9b('0x55')}]});}return null;})[_0x5d9b('0x3f')](respondWithResult(_0x34f166,null))[_0x5d9b('0x47')](handleError(_0x34f166,null));};var md5=require(_0x5d9b('0x57'));exports[_0x5d9b('0x58')]=function(_0x3c8b62,_0x4b909b,_0x6d759e){var _0xe0250b=null;var _0x5db382=null;var _0x74e25f=null;var _0x3d1bef=null;var _0x9a0898='';return db[_0x5d9b('0x3e')][_0x5d9b('0x4d')]({'where':{'id':_0x3c8b62[_0x5d9b('0x45')]['id']},'attributes':['id',_0x5d9b('0x28'),_0x5d9b('0x59'),'description',_0x5d9b('0x5a'),_0x5d9b('0x5b'),_0x5d9b('0x5c'),_0x5d9b('0x5d')]})['then'](handleEntityNotFound(_0x4b909b,null))[_0x5d9b('0x3f')](function(_0x5ed058){if(_0x5ed058){_0xe0250b=_0x5ed058['username'];_0x5db382=_0x5ed058[_0x5d9b('0x5d')];_0x74e25f=_0x5ed058[_0x5d9b('0x5a')];_0x9a0898=_0x5ed058[_0x5d9b('0x5b')];var _0x4c8a12=_0x9a0898[_0x5d9b('0x5e')](-0x1);if(_0x4c8a12==='/'){_0x9a0898=_0x9a0898['substring'](0x0,_0x9a0898[_0x5d9b('0x5f')](_0x4c8a12));}_0x3d1bef=util[_0x5d9b('0x60')](_0x5d9b('0x61'),_0x9a0898);var _0x25a20d={'method':_0x5d9b('0x62'),'uri':_0x3d1bef,'qs':{'operation':_0x5d9b('0x63'),'username':_0x5ed058['username']},'json':!![]};return rp(_0x25a20d);}})['then'](function(_0x40aba5){if(_0x40aba5[_0x5d9b('0x64')]){var _0x151d03={'method':_0x5d9b('0x65'),'uri':_0x3d1bef,'form':{'operation':_0x5d9b('0x66'),'username':_0xe0250b,'accessKey':md5(_0x40aba5[_0x5d9b('0x67')][_0x5d9b('0x68')]+_0x5db382)},'json':!![]};return rp(_0x151d03);}})[_0x5d9b('0x3f')](function(_0x374aec){if(_0x374aec[_0x5d9b('0x64')]){var _0x70b3d0={'method':_0x5d9b('0x62'),'uri':_0x3d1bef,'qs':{'operation':'describe','username':_0xe0250b,'sessionName':_0x374aec[_0x5d9b('0x67')][_0x5d9b('0x69')],'elementType':_0x74e25f},'json':!![]};return rp(_0x70b3d0);}})['then'](function(_0x3d142e){if(_0x3d142e[_0x5d9b('0x64')]){var _0x2f2f22=[_0x5d9b('0x6a'),'reference',_0x5d9b('0x6b')];_[_0x5d9b('0x6c')](_0x3d142e[_0x5d9b('0x67')]['fields'],function(_0x30e5d1){return _0x2f2f22[_0x5d9b('0x6d')](_0x30e5d1[_0x5d9b('0x2d')][_0x5d9b('0x28')]);});_[_0x5d9b('0x6c')](_0x3d142e['result']['fields'],function(_0x155475){return _0x155475[_0x5d9b('0x6e')]===_0x5d9b('0x6f');});return{'count':_0x3d142e[_0x5d9b('0x67')][_0x5d9b('0x35')]['length'],'rows':_['map'](_0x3d142e[_0x5d9b('0x67')]['fields'],function(_0x2650c4){return{'id':_0x2650c4[_0x5d9b('0x28')],'name':_0x2650c4[_0x5d9b('0x70')],'custom':_[_0x5d9b('0x71')](_0x2650c4['name'],'cf_')?!![]:![],'options':_0x2650c4[_0x5d9b('0x2d')][_0x5d9b('0x28')]===_0x5d9b('0x72')&&_0x2650c4[_0x5d9b('0x2d')][_0x5d9b('0x73')][_0x5d9b('0x46')]>0x0?_['map'](_0x2650c4[_0x5d9b('0x2d')][_0x5d9b('0x73')],function(_0x852557){return{'name':_0x852557['label'],'value':_0x852557[_0x5d9b('0x74')]};}):[]};})};}})['then'](respondWithResult(_0x4b909b,null))['catch'](function(_0x4d467e){console[_0x5d9b('0x75')](_0x5d9b('0x76')+_0x4d467e);var _0x350fe7=_0x3c8b62[_0x5d9b('0x30')][_0x5d9b('0x77')]?0x1f4:_0x4d467e['statusCode']||0x1f4;logger[_0x5d9b('0x27')](_0x5d9b('0x78'),'getFields',_0x350fe7,JSON[_0x5d9b('0x79')](_0x4d467e));delete _0x4d467e[_0x5d9b('0x28')];if(_0x350fe7===0x191){_0x350fe7=0x190;}_0x4b909b['status'](_0x350fe7)['send'](_0x3c8b62[_0x5d9b('0x30')][_0x5d9b('0x77')]?{'message':_0x5d9b('0x7a'),'statusCode':_0x4d467e['statusCode']}:_0x4d467e);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 2e81ce9..5f09eb1 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 _0x8ece=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes','VtigerAccount','int_vtiger_accounts','lodash','util','../../config/logger'];(function(_0x825094,_0x3d36fc){var _0x1e0b68=function(_0x5cf5b0){while(--_0x5cf5b0){_0x825094['push'](_0x825094['shift']());}};_0x1e0b68(++_0x3d36fc);}(_0x8ece,0xbd));var _0xe8ec=function(_0x2fadb7,_0x4e1a79){_0x2fadb7=_0x2fadb7-0x0;var _0x39634c=_0x8ece[_0x2fadb7];return _0x39634c;};'use strict';var _=require(_0xe8ec('0x0'));var util=require(_0xe8ec('0x1'));var logger=require(_0xe8ec('0x2'))('api');var moment=require(_0xe8ec('0x3'));var BPromise=require(_0xe8ec('0x4'));var rp=require(_0xe8ec('0x5'));var fs=require('fs');var path=require(_0xe8ec('0x6'));var rimraf=require(_0xe8ec('0x7'));var config=require(_0xe8ec('0x8'));var attributes=require(_0xe8ec('0x9'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x4bc835,_0x293798){return _0x4bc835['define'](_0xe8ec('0xa'),attributes,{'tableName':_0xe8ec('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6906=['../../components/integrations/configuration','exports','define','int_vtiger_accounts','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2e04ef,_0x31a596){var _0x5722b0=function(_0x386fbd){while(--_0x386fbd){_0x2e04ef['push'](_0x2e04ef['shift']());}};_0x5722b0(++_0x31a596);}(_0x6906,0x1d8));var _0x6690=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x6906[_0x3b380d];return _0x54502b;};'use strict';var _=require('lodash');var util=require(_0x6690('0x0'));var logger=require(_0x6690('0x1'))(_0x6690('0x2'));var moment=require(_0x6690('0x3'));var BPromise=require(_0x6690('0x4'));var rp=require(_0x6690('0x5'));var fs=require('fs');var path=require(_0x6690('0x6'));var rimraf=require(_0x6690('0x7'));var config=require(_0x6690('0x8'));var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0x6690('0x9'));module[_0x6690('0xa')]=function(_0x584ee9,_0x10068d){return _0x584ee9[_0x6690('0xb')]('VtigerAccount',attributes,{'tableName':_0x6690('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index f444405..54bd751 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 _0x3c81=['debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','attributes','limit','include','map','model','catch','ShowVtigerAccount','lodash','util','bluebird','randomstring','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x2b7806,_0x3b0257){var _0x162485=function(_0x5174f3){while(--_0x5174f3){_0x2b7806['push'](_0x2b7806['shift']());}};_0x162485(++_0x3b0257);}(_0x3c81,0x102));var _0x13c8=function(_0x41e1ad,_0x5e7553){_0x41e1ad=_0x41e1ad-0x0;var _0x20a09d=_0x3c81[_0x41e1ad];return _0x20a09d;};'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});function respondWithRpcPromise(_0x3f0bd2,_0x445b69,_0x4f7bcc){return new BPromise(function(_0x17c228,_0x4905c3){return client[_0x13c8('0x9')](_0x3f0bd2,_0x4f7bcc)[_0x13c8('0xa')](function(_0x189ce6){logger[_0x13c8('0xb')](_0x13c8('0xc'),_0x445b69,_0x13c8('0xd'));logger[_0x13c8('0xe')](_0x13c8('0xf'),_0x445b69,_0x13c8('0xd'),JSON[_0x13c8('0x10')](_0x189ce6));if(_0x189ce6[_0x13c8('0x11')]){if(_0x189ce6[_0x13c8('0x11')][_0x13c8('0x12')]===0x1f4){logger[_0x13c8('0x11')]('VtigerAccount,\x20%s,\x20%s',_0x445b69,_0x189ce6[_0x13c8('0x11')][_0x13c8('0x13')]);return _0x4905c3(_0x189ce6[_0x13c8('0x11')][_0x13c8('0x13')]);}logger['error'](_0x13c8('0xc'),_0x445b69,_0x189ce6['error']['message']);return _0x17c228(_0x189ce6['error'][_0x13c8('0x13')]);}else{logger['info'](_0x13c8('0xc'),_0x445b69,_0x13c8('0xd'));_0x17c228(_0x189ce6[_0x13c8('0x14')][_0x13c8('0x13')]);}})['catch'](function(_0x13a9e1){logger[_0x13c8('0x11')](_0x13c8('0xc'),_0x445b69,_0x13a9e1);_0x4905c3(_0x13a9e1);});});}exports[_0x13c8('0x15')]=function(_0xce1ad2){var _0x28f07e=this;return new Promise(function(_0x346417,_0x251c38){return db[_0x13c8('0x16')][_0x13c8('0x17')]({'raw':_0xce1ad2[_0x13c8('0x18')]?_0xce1ad2['options'][_0x13c8('0x19')]===undefined?!![]:![]:!![],'where':_0xce1ad2[_0x13c8('0x18')]?_0xce1ad2[_0x13c8('0x18')][_0x13c8('0x1a')]||null:null,'attributes':_0xce1ad2['options']?_0xce1ad2[_0x13c8('0x18')][_0x13c8('0x1b')]||null:null,'limit':_0xce1ad2[_0x13c8('0x18')]?_0xce1ad2[_0x13c8('0x18')][_0x13c8('0x1c')]||null:null,'include':_0xce1ad2[_0x13c8('0x18')]?_0xce1ad2['options'][_0x13c8('0x1d')]?_[_0x13c8('0x1e')](_0xce1ad2[_0x13c8('0x18')][_0x13c8('0x1d')],function(_0x577df6){return{'model':db[_0x577df6[_0x13c8('0x1f')]],'as':_0x577df6['as'],'attributes':_0x577df6[_0x13c8('0x1b')],'include':_0x577df6['include']?_['map'](_0x577df6[_0x13c8('0x1d')],function(_0x4aff35){return{'model':db[_0x4aff35['model']],'as':_0x4aff35['as'],'attributes':_0x4aff35['attributes'],'include':_0x4aff35[_0x13c8('0x1d')]?_[_0x13c8('0x1e')](_0x4aff35['include'],function(_0x4df077){return{'model':db[_0x4df077[_0x13c8('0x1f')]],'as':_0x4df077['as'],'attributes':_0x4df077['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1c7dc4){logger[_0x13c8('0xb')](_0x13c8('0x15'),_0xce1ad2);logger['debug']('GetVtigerAccount',_0xce1ad2,JSON[_0x13c8('0x10')](_0x1c7dc4));_0x346417(_0x1c7dc4);})[_0x13c8('0x20')](function(_0x399840){logger[_0x13c8('0x11')](_0x13c8('0x15'),_0x399840[_0x13c8('0x13')],_0xce1ad2);_0x251c38(_0x28f07e[_0x13c8('0x11')](0x1f4,_0x399840['message']));});});};exports[_0x13c8('0x21')]=function(_0xcbc9b7){var _0x5a5911=this;return new Promise(function(_0x5c85e4,_0x23a725){return db[_0x13c8('0x16')]['find']({'raw':_0xcbc9b7[_0x13c8('0x18')]?_0xcbc9b7[_0x13c8('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0xcbc9b7[_0x13c8('0x18')]?_0xcbc9b7[_0x13c8('0x18')][_0x13c8('0x1a')]||null:null,'attributes':_0xcbc9b7[_0x13c8('0x18')]?_0xcbc9b7[_0x13c8('0x18')][_0x13c8('0x1b')]||null:null,'include':_0xcbc9b7[_0x13c8('0x18')]?_0xcbc9b7[_0x13c8('0x18')]['include']?_['map'](_0xcbc9b7[_0x13c8('0x18')][_0x13c8('0x1d')],function(_0x517d01){return{'model':db[_0x517d01[_0x13c8('0x1f')]],'as':_0x517d01['as'],'attributes':_0x517d01['attributes'],'include':_0x517d01[_0x13c8('0x1d')]?_['map'](_0x517d01[_0x13c8('0x1d')],function(_0x53de18){return{'model':db[_0x53de18[_0x13c8('0x1f')]],'as':_0x53de18['as'],'attributes':_0x53de18[_0x13c8('0x1b')],'include':_0x53de18[_0x13c8('0x1d')]?_[_0x13c8('0x1e')](_0x53de18[_0x13c8('0x1d')],function(_0x5287f2){return{'model':db[_0x5287f2[_0x13c8('0x1f')]],'as':_0x5287f2['as'],'attributes':_0x5287f2[_0x13c8('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x362b9c){logger[_0x13c8('0xb')](_0x13c8('0x21'),_0xcbc9b7);logger['debug']('ShowVtigerAccount',_0xcbc9b7,JSON['stringify'](_0x362b9c));_0x5c85e4(_0x362b9c);})[_0x13c8('0x20')](function(_0x2c8218){logger[_0x13c8('0x11')](_0x13c8('0x21'),_0x2c8218[_0x13c8('0x13')],_0xcbc9b7);_0x23a725(_0x5a5911[_0x13c8('0x11')](0x1f4,_0x2c8218[_0x13c8('0x13')]));});});}; \ No newline at end of file +var _0x34b7=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerAccount,\x20%s,\x20%s','message','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','attributes','map','include','model','then','ShowVtigerAccount','find','moment','bluebird'];(function(_0x4d81b4,_0xaf4f9b){var _0x2e2fe0=function(_0x1e3322){while(--_0x1e3322){_0x4d81b4['push'](_0x4d81b4['shift']());}};_0x2e2fe0(++_0xaf4f9b);}(_0x34b7,0x196));var _0x734b=function(_0x2fc5db,_0x2253b1){_0x2fc5db=_0x2fc5db-0x0;var _0x1ef11b=_0x34b7[_0x2fc5db];return _0x1ef11b;};'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')]('VtigerAccount,\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')]({'raw':_0x5edbe9[_0x734b('0x18')]?_0x5edbe9[_0x734b('0x18')][_0x734b('0x19')]===undefined?!![]:![]:!![],'where':_0x5edbe9[_0x734b('0x18')]?_0x5edbe9[_0x734b('0x18')][_0x734b('0x1a')]||null:null,'attributes':_0x5edbe9[_0x734b('0x18')]?_0x5edbe9[_0x734b('0x18')][_0x734b('0x1b')]||null:null,'limit':_0x5edbe9[_0x734b('0x18')]?_0x5edbe9[_0x734b('0x18')]['limit']||null:null,'include':_0x5edbe9[_0x734b('0x18')]?_0x5edbe9[_0x734b('0x18')]['include']?_[_0x734b('0x1c')](_0x5edbe9[_0x734b('0x18')][_0x734b('0x1d')],function(_0x11fb8e){return{'model':db[_0x11fb8e[_0x734b('0x1e')]],'as':_0x11fb8e['as'],'attributes':_0x11fb8e[_0x734b('0x1b')],'include':_0x11fb8e[_0x734b('0x1d')]?_[_0x734b('0x1c')](_0x11fb8e[_0x734b('0x1d')],function(_0x3abbe6){return{'model':db[_0x3abbe6[_0x734b('0x1e')]],'as':_0x3abbe6['as'],'attributes':_0x3abbe6[_0x734b('0x1b')],'include':_0x3abbe6[_0x734b('0x1d')]?_['map'](_0x3abbe6['include'],function(_0x13cc5a){return{'model':db[_0x13cc5a[_0x734b('0x1e')]],'as':_0x13cc5a['as'],'attributes':_0x13cc5a['attributes']};}):[]};}):[]};}):[]:[]})[_0x734b('0x1f')](function(_0x2dd51a){logger[_0x734b('0xa')](_0x734b('0x15'),_0x5edbe9);logger[_0x734b('0xc')](_0x734b('0x15'),_0x5edbe9,JSON[_0x734b('0xe')](_0x2dd51a));_0x56a95c(_0x2dd51a);})['catch'](function(_0x1f3652){logger[_0x734b('0xf')](_0x734b('0x15'),_0x1f3652[_0x734b('0x12')],_0x5edbe9);_0xcd12a1(_0x4d3b9c[_0x734b('0xf')](0x1f4,_0x1f3652[_0x734b('0x12')]));});});};exports[_0x734b('0x20')]=function(_0x21ed3c){var _0x371ead=this;return new Promise(function(_0x3065b0,_0x5dcabf){return db[_0x734b('0x16')][_0x734b('0x21')]({'raw':_0x21ed3c['options']?_0x21ed3c[_0x734b('0x18')][_0x734b('0x19')]===undefined?!![]:![]:!![],'where':_0x21ed3c[_0x734b('0x18')]?_0x21ed3c[_0x734b('0x18')][_0x734b('0x1a')]||null:null,'attributes':_0x21ed3c[_0x734b('0x18')]?_0x21ed3c[_0x734b('0x18')][_0x734b('0x1b')]||null:null,'include':_0x21ed3c[_0x734b('0x18')]?_0x21ed3c[_0x734b('0x18')][_0x734b('0x1d')]?_[_0x734b('0x1c')](_0x21ed3c[_0x734b('0x18')][_0x734b('0x1d')],function(_0x4512fc){return{'model':db[_0x4512fc['model']],'as':_0x4512fc['as'],'attributes':_0x4512fc[_0x734b('0x1b')],'include':_0x4512fc['include']?_[_0x734b('0x1c')](_0x4512fc[_0x734b('0x1d')],function(_0x3413bf){return{'model':db[_0x3413bf[_0x734b('0x1e')]],'as':_0x3413bf['as'],'attributes':_0x3413bf[_0x734b('0x1b')],'include':_0x3413bf[_0x734b('0x1d')]?_['map'](_0x3413bf['include'],function(_0x3460a0){return{'model':db[_0x3460a0['model']],'as':_0x3460a0['as'],'attributes':_0x3460a0[_0x734b('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2de959){logger['info'](_0x734b('0x20'),_0x21ed3c);logger['debug'](_0x734b('0x20'),_0x21ed3c,JSON[_0x734b('0xe')](_0x2de959));_0x3065b0(_0x2de959);})[_0x734b('0x14')](function(_0x34a504){logger[_0x734b('0xf')](_0x734b('0x20'),_0x34a504[_0x734b('0x12')],_0x21ed3c);_0x5dcabf(_0x371ead['error'](0x1f4,_0x34a504[_0x734b('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index cf7fd58..b502c58 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 _0xdd3f=['index','isAuthenticated','show','get','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./intVtigerConfiguration.controller'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xdd3f,0x10b));var _0xfdd3=function(_0xbcd2e1,_0x380105){_0xbcd2e1=_0xbcd2e1-0x0;var _0xfb252c=_0xdd3f[_0xbcd2e1];return _0xfb252c;};'use strict';var multer=require(_0xfdd3('0x0'));var util=require(_0xfdd3('0x1'));var path=require(_0xfdd3('0x2'));var timeout=require(_0xfdd3('0x3'));var express=require(_0xfdd3('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xfdd3('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xfdd3('0x6'));var controller=require(_0xfdd3('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xfdd3('0x8')]);router['get']('/:id',auth[_0xfdd3('0x9')](),controller[_0xfdd3('0xa')]);router[_0xfdd3('0xb')](_0xfdd3('0xc'),auth['isAuthenticated'](),controller[_0xfdd3('0xd')]);router['get'](_0xfdd3('0xe'),auth['isAuthenticated'](),controller[_0xfdd3('0xf')]);router[_0xfdd3('0xb')](_0xfdd3('0x10'),auth['isAuthenticated'](),controller[_0xfdd3('0x11')]);router[_0xfdd3('0x12')]('/',auth['isAuthenticated'](),controller[_0xfdd3('0x13')]);router[_0xfdd3('0x14')](_0xfdd3('0x15'),auth['isAuthenticated'](),controller[_0xfdd3('0x16')]);router['delete'](_0xfdd3('0x15'),auth[_0xfdd3('0x9')](),controller[_0xfdd3('0x17')]);module[_0xfdd3('0x18')]=router; \ No newline at end of file +var _0xc26f=['express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','post','put','update','destroy','exports','multer','util','path','connect-timeout'];(function(_0x3ff0e2,_0x1b985a){var _0x4345df=function(_0x121bd8){while(--_0x121bd8){_0x3ff0e2['push'](_0x3ff0e2['shift']());}};_0x4345df(++_0x1b985a);}(_0xc26f,0xb9));var _0xfc26=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xc26f[_0x4e676e];return _0x336a3c;};'use strict';var multer=require(_0xfc26('0x0'));var util=require(_0xfc26('0x1'));var path=require(_0xfc26('0x2'));var timeout=require(_0xfc26('0x3'));var express=require(_0xfc26('0x4'));var router=express[_0xfc26('0x5')]();var fs_extra=require(_0xfc26('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xfc26('0x7'));var config=require('../../config/environment');var controller=require('./intVtigerConfiguration.controller');router[_0xfc26('0x8')]('/',auth[_0xfc26('0x9')](),controller['index']);router[_0xfc26('0x8')](_0xfc26('0xa'),auth[_0xfc26('0x9')](),controller[_0xfc26('0xb')]);router['get'](_0xfc26('0xc'),auth[_0xfc26('0x9')](),controller[_0xfc26('0xd')]);router[_0xfc26('0x8')](_0xfc26('0xe'),auth['isAuthenticated'](),controller['getSubjects']);router[_0xfc26('0x8')](_0xfc26('0xf'),auth[_0xfc26('0x9')](),controller['getDescriptions']);router[_0xfc26('0x10')]('/',auth[_0xfc26('0x9')](),controller['create']);router[_0xfc26('0x11')](_0xfc26('0xa'),auth[_0xfc26('0x9')](),controller[_0xfc26('0x12')]);router['delete'](_0xfc26('0xa'),auth['isAuthenticated'](),controller[_0xfc26('0x13')]);module[_0xfc26('0x14')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 3068cbb..9d2c5f0 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 _0xdc8f=['sequelize','STRING'];(function(_0x536bd7,_0x4c3342){var _0x59e1dd=function(_0x218dbb){while(--_0x218dbb){_0x536bd7['push'](_0x536bd7['shift']());}};_0x59e1dd(++_0x4c3342);}(_0xdc8f,0xc2));var _0xfdc8=function(_0x2e1b3f,_0x5bbe92){_0x2e1b3f=_0x2e1b3f-0x0;var _0x202a55=_0xdc8f[_0x2e1b3f];return _0x202a55;};'use strict';var Sequelize=require(_0xfdc8('0x0'));module['exports']={'name':{'type':Sequelize[_0xfdc8('0x1')]},'description':{'type':Sequelize[_0xfdc8('0x1')]}}; \ No newline at end of file +var _0xb336=['sequelize','exports','STRING'];(function(_0x57b0c2,_0x45c488){var _0x178460=function(_0x39782b){while(--_0x39782b){_0x57b0c2['push'](_0x57b0c2['shift']());}};_0x178460(++_0x45c488);}(_0xb336,0x72));var _0x6b33=function(_0x28f84b,_0x39ed19){_0x28f84b=_0x28f84b-0x0;var _0x4e0db0=_0xb336[_0x28f84b];return _0x4e0db0;};'use strict';var Sequelize=require(_0x6b33('0x0'));module[_0x6b33('0x1')]={'name':{'type':Sequelize[_0x6b33('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index ad93f61..98f5eab 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 _0xe539=['jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','save','update','then','error','stack','name','send','index','VtigerConfiguration','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','params','keys','find','catch','create','destroy','findOne','length','pick','getSubjects','VtigerField','order','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x5c8a09,_0x232960){var _0x43e3a5=function(_0x11fd76){while(--_0x11fd76){_0x5c8a09['push'](_0x5c8a09['shift']());}};_0x43e3a5(++_0x232960);}(_0xe539,0x164));var _0x9e53=function(_0x2d89ce,_0x24d58d){_0x2d89ce=_0x2d89ce-0x0;var _0x3fad10=_0xe539[_0x2d89ce];return _0x3fad10;};'use strict';var emlformat=require(_0x9e53('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9e53('0x1'));var jsonpatch=require(_0x9e53('0x2'));var rp=require(_0x9e53('0x3'));var moment=require(_0x9e53('0x4'));var BPromise=require(_0x9e53('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9e53('0x6'));var sox=require(_0x9e53('0x7'));var csv=require(_0x9e53('0x8'));var ejs=require(_0x9e53('0x9'));var fs=require('fs');var fs_extra=require(_0x9e53('0xa'));var _=require(_0x9e53('0xb'));var squel=require(_0x9e53('0xc'));var crypto=require(_0x9e53('0xd'));var jsforce=require(_0x9e53('0xe'));var deskjs=require(_0x9e53('0xf'));var toCsv=require(_0x9e53('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x9e53('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9e53('0x11'));var as=require(_0x9e53('0x12'));var hardwareService=require(_0x9e53('0x13'));var logger=require(_0x9e53('0x14'))('api');var utils=require(_0x9e53('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x9e53('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a8038,_0x430447){_0x430447=_0x430447||0xcc;return function(_0x4adbba){if(_0x4adbba){return _0x1a8038[_0x9e53('0x17')](_0x430447);}return _0x1a8038[_0x9e53('0x18')](_0x430447)[_0x9e53('0x19')]();};}function respondWithResult(_0x2f6993,_0x25a34b){_0x25a34b=_0x25a34b||0xc8;return function(_0x58d755){if(_0x58d755){return _0x2f6993[_0x9e53('0x18')](_0x25a34b)[_0x9e53('0x1a')](_0x58d755);}};}function respondWithFilteredResult(_0x577d8b,_0x2c1c22){return function(_0x2da3d3){if(_0x2da3d3){var _0x7aac11=typeof _0x2c1c22[_0x9e53('0x1b')]===_0x9e53('0x1c')&&typeof _0x2c1c22[_0x9e53('0x1d')]==='undefined';var _0x36d685=_0x2da3d3[_0x9e53('0x1e')];var _0x7a58c4=_0x7aac11?0x0:_0x2c1c22[_0x9e53('0x1b')];var _0x1ccfb2=_0x7aac11?_0x2da3d3[_0x9e53('0x1e')]:_0x2c1c22[_0x9e53('0x1b')]+_0x2c1c22[_0x9e53('0x1d')];var _0x1524ba;if(_0x1ccfb2>=_0x36d685){_0x1ccfb2=_0x36d685;_0x1524ba=0xc8;}else{_0x1524ba=0xce;}_0x577d8b[_0x9e53('0x18')](_0x1524ba);return _0x577d8b['set'](_0x9e53('0x1f'),_0x7a58c4+'-'+_0x1ccfb2+'/'+_0x36d685)[_0x9e53('0x1a')](_0x2da3d3);}return null;};}function patchUpdates(_0x4c811c){return function(_0x1dba0d){try{jsonpatch['apply'](_0x1dba0d,_0x4c811c,!![]);}catch(_0x163185){return BPromise['reject'](_0x163185);}return _0x1dba0d[_0x9e53('0x20')]();};}function saveUpdates(_0x224216,_0x3ae54c){return function(_0x13dac7){if(_0x13dac7){return _0x13dac7[_0x9e53('0x21')](_0x224216)['then'](function(_0x3a298e){return _0x3a298e;});}return null;};}function removeEntity(_0x48635f,_0x432259){return function(_0x548475){if(_0x548475){return _0x548475['destroy']()[_0x9e53('0x22')](function(){_0x48635f[_0x9e53('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3485c6,_0x365f27){return function(_0x3e91ed){if(!_0x3e91ed){_0x3485c6[_0x9e53('0x17')](0x194);}return _0x3e91ed;};}function handleError(_0x5d8b35,_0x2a20c5){_0x2a20c5=_0x2a20c5||0x1f4;return function(_0x5ba797){logger[_0x9e53('0x23')](_0x5ba797[_0x9e53('0x24')]);if(_0x5ba797[_0x9e53('0x25')]){delete _0x5ba797[_0x9e53('0x25')];}_0x5d8b35[_0x9e53('0x18')](_0x2a20c5)[_0x9e53('0x26')](_0x5ba797);};}exports[_0x9e53('0x27')]=function(_0x18c749,_0x56ab62){var _0x10f876={},_0x2acbab={},_0x2e6b7b={'count':0x0,'rows':[]};var _0x421553=_['map'](db[_0x9e53('0x28')][_0x9e53('0x29')],function(_0x494395){return{'name':_0x494395[_0x9e53('0x2a')],'type':_0x494395[_0x9e53('0x2b')][_0x9e53('0x2c')]};});_0x2acbab[_0x9e53('0x2d')]=_[_0x9e53('0x2e')](_0x421553,_0x9e53('0x25'));_0x2acbab[_0x9e53('0x2f')]=_['keys'](_0x18c749[_0x9e53('0x2f')]);_0x2acbab[_0x9e53('0x30')]=_['intersection'](_0x2acbab[_0x9e53('0x2d')],_0x2acbab[_0x9e53('0x2f')]);_0x10f876[_0x9e53('0x31')]=_[_0x9e53('0x32')](_0x2acbab[_0x9e53('0x2d')],qs[_0x9e53('0x33')](_0x18c749[_0x9e53('0x2f')]['fields']));_0x10f876[_0x9e53('0x31')]=_0x10f876[_0x9e53('0x31')]['length']?_0x10f876['attributes']:_0x2acbab[_0x9e53('0x2d')];if(!_0x18c749[_0x9e53('0x2f')][_0x9e53('0x34')](_0x9e53('0x35'))){_0x10f876[_0x9e53('0x1d')]=qs[_0x9e53('0x1d')](_0x18c749[_0x9e53('0x2f')][_0x9e53('0x1d')]);_0x10f876[_0x9e53('0x1b')]=qs[_0x9e53('0x1b')](_0x18c749[_0x9e53('0x2f')]['offset']);}_0x10f876['order']=qs[_0x9e53('0x36')](_0x18c749[_0x9e53('0x2f')][_0x9e53('0x36')]);_0x10f876['where']=qs['filters'](_['pick'](_0x18c749[_0x9e53('0x2f')],_0x2acbab['filters']),_0x421553);if(_0x18c749[_0x9e53('0x2f')][_0x9e53('0x37')]){_0x10f876['where']=_[_0x9e53('0x38')](_0x10f876[_0x9e53('0x39')],{'$or':_[_0x9e53('0x2e')](_0x421553,function(_0x5194d8){if(_0x5194d8[_0x9e53('0x2b')]!=='VIRTUAL'){var _0xb7c5b4={};_0xb7c5b4[_0x5194d8[_0x9e53('0x25')]]={'$like':'%'+_0x18c749[_0x9e53('0x2f')][_0x9e53('0x37')]+'%'};return _0xb7c5b4;}})});}_0x10f876=_[_0x9e53('0x38')]({},_0x10f876,_0x18c749[_0x9e53('0x3a')]);var _0x335908={'where':_0x10f876[_0x9e53('0x39')]};return db[_0x9e53('0x28')]['count'](_0x335908)[_0x9e53('0x22')](function(_0x212264){_0x2e6b7b[_0x9e53('0x1e')]=_0x212264;if(_0x18c749[_0x9e53('0x2f')][_0x9e53('0x3b')]){_0x10f876[_0x9e53('0x3c')]=[{'all':!![]}];}return db[_0x9e53('0x28')]['findAll'](_0x10f876);})[_0x9e53('0x22')](function(_0x1ac4b9){_0x2e6b7b['rows']=_0x1ac4b9;return _0x2e6b7b;})[_0x9e53('0x22')](respondWithFilteredResult(_0x56ab62,_0x10f876))['catch'](handleError(_0x56ab62,null));};exports['show']=function(_0x6067e0,_0xb39ee5){var _0xb78901={'raw':![],'where':{'id':_0x6067e0[_0x9e53('0x3d')]['id']}},_0x34f6d8={};_0x34f6d8['model']=_[_0x9e53('0x3e')](db[_0x9e53('0x28')]['rawAttributes']);_0x34f6d8[_0x9e53('0x2f')]=_[_0x9e53('0x3e')](_0x6067e0[_0x9e53('0x2f')]);_0x34f6d8[_0x9e53('0x30')]=_['intersection'](_0x34f6d8['model'],_0x34f6d8[_0x9e53('0x2f')]);_0xb78901[_0x9e53('0x31')]=_[_0x9e53('0x32')](_0x34f6d8[_0x9e53('0x2d')],qs[_0x9e53('0x33')](_0x6067e0[_0x9e53('0x2f')][_0x9e53('0x33')]));_0xb78901[_0x9e53('0x31')]=_0xb78901[_0x9e53('0x31')]['length']?_0xb78901[_0x9e53('0x31')]:_0x34f6d8[_0x9e53('0x2d')];if(_0x6067e0[_0x9e53('0x2f')][_0x9e53('0x3b')]){_0xb78901[_0x9e53('0x3c')]=[{'all':!![]}];}_0xb78901=_[_0x9e53('0x38')]({},_0xb78901,_0x6067e0['options']);return db['VtigerConfiguration'][_0x9e53('0x3f')](_0xb78901)['then'](handleEntityNotFound(_0xb39ee5,null))[_0x9e53('0x22')](respondWithResult(_0xb39ee5,null))[_0x9e53('0x40')](handleError(_0xb39ee5,null));};exports['create']=function(_0x3586d3,_0x33114e){return db['VtigerConfiguration'][_0x9e53('0x41')](_0x3586d3['body'],{})[_0x9e53('0x22')](respondWithResult(_0x33114e,0xc9))[_0x9e53('0x40')](handleError(_0x33114e,null));};exports['update']=function(_0x3697d5,_0x17b47){if(_0x3697d5['body']['id']){delete _0x3697d5['body']['id'];}return db[_0x9e53('0x28')][_0x9e53('0x3f')]({'where':{'id':_0x3697d5['params']['id']}})[_0x9e53('0x22')](handleEntityNotFound(_0x17b47,null))[_0x9e53('0x22')](saveUpdates(_0x3697d5['body'],null))[_0x9e53('0x22')](respondWithResult(_0x17b47,null))['catch'](handleError(_0x17b47,null));};exports[_0x9e53('0x42')]=function(_0x1c2b26,_0x421f06){return db['VtigerConfiguration']['find']({'where':{'id':_0x1c2b26[_0x9e53('0x3d')]['id']}})[_0x9e53('0x22')](handleEntityNotFound(_0x421f06,null))[_0x9e53('0x22')](removeEntity(_0x421f06,null))[_0x9e53('0x40')](handleError(_0x421f06,null));};exports['getFields']=function(_0x405f29,_0x8dac63,_0x50fc7a){var _0x158367={};var _0x39ae84={};var _0x323ea7;var _0x1b1797;return db[_0x9e53('0x28')][_0x9e53('0x43')]({'where':{'id':_0x405f29[_0x9e53('0x3d')]['id']}})['then'](handleEntityNotFound(_0x8dac63,null))[_0x9e53('0x22')](function(_0xdae953){if(_0xdae953){_0x323ea7=_0xdae953;_0x39ae84[_0x9e53('0x2d')]=_[_0x9e53('0x3e')](db['VtigerField'][_0x9e53('0x29')]);_0x39ae84[_0x9e53('0x2f')]=_[_0x9e53('0x3e')](_0x405f29['query']);_0x39ae84['filters']=_['intersection'](_0x39ae84[_0x9e53('0x2d')],_0x39ae84[_0x9e53('0x2f')]);_0x158367[_0x9e53('0x31')]=_[_0x9e53('0x32')](_0x39ae84[_0x9e53('0x2d')],qs[_0x9e53('0x33')](_0x405f29['query'][_0x9e53('0x33')]));_0x158367['attributes']=_0x158367[_0x9e53('0x31')][_0x9e53('0x44')]?_0x158367[_0x9e53('0x31')]:_0x39ae84['model'];_0x158367['order']=qs['sort'](_0x405f29['query'][_0x9e53('0x36')]);_0x158367['where']=qs['filters'](_[_0x9e53('0x45')](_0x405f29[_0x9e53('0x2f')],_0x39ae84['filters']));if(_0x405f29['query'][_0x9e53('0x37')]){_0x158367[_0x9e53('0x39')]=_[_0x9e53('0x38')](_0x158367['where'],{'$or':_[_0x9e53('0x2e')](_0x158367[_0x9e53('0x31')],function(_0xa5bcaf){var _0x2ee6a8={};_0x2ee6a8[_0xa5bcaf]={'$like':'%'+_0x405f29[_0x9e53('0x2f')][_0x9e53('0x37')]+'%'};return _0x2ee6a8;})});}_0x158367=_[_0x9e53('0x38')]({},_0x158367,_0x405f29[_0x9e53('0x3a')]);return _0x323ea7['getFields'](_0x158367);}})[_0x9e53('0x22')](function(_0x12b7b5){if(_0x12b7b5){_0x1b1797=_0x12b7b5['length'];if(!_0x405f29['query'][_0x9e53('0x34')]('nolimit')){_0x158367[_0x9e53('0x1d')]=qs[_0x9e53('0x1d')](_0x405f29[_0x9e53('0x2f')][_0x9e53('0x1d')]);_0x158367[_0x9e53('0x1b')]=qs[_0x9e53('0x1b')](_0x405f29[_0x9e53('0x2f')]['offset']);}return _0x323ea7['getFields'](_0x158367);}})[_0x9e53('0x22')](function(_0x519162){if(_0x519162){return _0x519162?{'count':_0x1b1797,'rows':_0x519162}:null;}})[_0x9e53('0x22')](respondWithResult(_0x8dac63,null))[_0x9e53('0x40')](handleError(_0x8dac63,null));};exports[_0x9e53('0x46')]=function(_0x1b889e,_0x31d696,_0x3863c3){var _0x58d874={};var _0x7f1f08={};var _0x3e0cc0;var _0x585f4d;return db[_0x9e53('0x28')]['findOne']({'where':{'id':_0x1b889e[_0x9e53('0x3d')]['id']}})[_0x9e53('0x22')](handleEntityNotFound(_0x31d696,null))['then'](function(_0xa0bb43){if(_0xa0bb43){_0x3e0cc0=_0xa0bb43;_0x7f1f08['model']=_[_0x9e53('0x3e')](db[_0x9e53('0x47')][_0x9e53('0x29')]);_0x7f1f08[_0x9e53('0x2f')]=_[_0x9e53('0x3e')](_0x1b889e[_0x9e53('0x2f')]);_0x7f1f08[_0x9e53('0x30')]=_[_0x9e53('0x32')](_0x7f1f08[_0x9e53('0x2d')],_0x7f1f08['query']);_0x58d874[_0x9e53('0x31')]=_[_0x9e53('0x32')](_0x7f1f08[_0x9e53('0x2d')],qs['fields'](_0x1b889e[_0x9e53('0x2f')][_0x9e53('0x33')]));_0x58d874['attributes']=_0x58d874[_0x9e53('0x31')][_0x9e53('0x44')]?_0x58d874[_0x9e53('0x31')]:_0x7f1f08[_0x9e53('0x2d')];_0x58d874[_0x9e53('0x48')]=qs[_0x9e53('0x36')](_0x1b889e[_0x9e53('0x2f')][_0x9e53('0x36')]);_0x58d874[_0x9e53('0x39')]=qs[_0x9e53('0x30')](_[_0x9e53('0x45')](_0x1b889e[_0x9e53('0x2f')],_0x7f1f08[_0x9e53('0x30')]));if(_0x1b889e[_0x9e53('0x2f')][_0x9e53('0x37')]){_0x58d874['where']=_[_0x9e53('0x38')](_0x58d874[_0x9e53('0x39')],{'$or':_['map'](_0x58d874[_0x9e53('0x31')],function(_0x295fc9){var _0x2693d2={};_0x2693d2[_0x295fc9]={'$like':'%'+_0x1b889e[_0x9e53('0x2f')][_0x9e53('0x37')]+'%'};return _0x2693d2;})});}_0x58d874=_['merge']({},_0x58d874,_0x1b889e[_0x9e53('0x3a')]);return _0x3e0cc0['getSubjects'](_0x58d874);}})[_0x9e53('0x22')](function(_0x435ebb){if(_0x435ebb){_0x585f4d=_0x435ebb[_0x9e53('0x44')];if(!_0x1b889e[_0x9e53('0x2f')]['hasOwnProperty']('nolimit')){_0x58d874['limit']=qs[_0x9e53('0x1d')](_0x1b889e[_0x9e53('0x2f')][_0x9e53('0x1d')]);_0x58d874['offset']=qs['offset'](_0x1b889e[_0x9e53('0x2f')][_0x9e53('0x1b')]);}return _0x3e0cc0[_0x9e53('0x46')](_0x58d874);}})['then'](function(_0x230fa3){if(_0x230fa3){return _0x230fa3?{'count':_0x585f4d,'rows':_0x230fa3}:null;}})['then'](respondWithResult(_0x31d696,null))[_0x9e53('0x40')](handleError(_0x31d696,null));};exports[_0x9e53('0x49')]=function(_0x3d354b,_0x27f712,_0x39c855){var _0x596633={};var _0x160a9e={};var _0x27e23e;var _0x1e6c24;return db[_0x9e53('0x28')][_0x9e53('0x43')]({'where':{'id':_0x3d354b[_0x9e53('0x3d')]['id']}})[_0x9e53('0x22')](handleEntityNotFound(_0x27f712,null))['then'](function(_0x2d4662){if(_0x2d4662){_0x27e23e=_0x2d4662;_0x160a9e['model']=_['keys'](db[_0x9e53('0x47')][_0x9e53('0x29')]);_0x160a9e['query']=_[_0x9e53('0x3e')](_0x3d354b[_0x9e53('0x2f')]);_0x160a9e['filters']=_['intersection'](_0x160a9e['model'],_0x160a9e[_0x9e53('0x2f')]);_0x596633[_0x9e53('0x31')]=_[_0x9e53('0x32')](_0x160a9e[_0x9e53('0x2d')],qs['fields'](_0x3d354b['query']['fields']));_0x596633[_0x9e53('0x31')]=_0x596633[_0x9e53('0x31')][_0x9e53('0x44')]?_0x596633['attributes']:_0x160a9e[_0x9e53('0x2d')];_0x596633[_0x9e53('0x48')]=qs['sort'](_0x3d354b['query'][_0x9e53('0x36')]);_0x596633['where']=qs[_0x9e53('0x30')](_[_0x9e53('0x45')](_0x3d354b['query'],_0x160a9e[_0x9e53('0x30')]));if(_0x3d354b['query'][_0x9e53('0x37')]){_0x596633[_0x9e53('0x39')]=_[_0x9e53('0x38')](_0x596633[_0x9e53('0x39')],{'$or':_[_0x9e53('0x2e')](_0x596633['attributes'],function(_0x5782ae){var _0x5000dd={};_0x5000dd[_0x5782ae]={'$like':'%'+_0x3d354b[_0x9e53('0x2f')][_0x9e53('0x37')]+'%'};return _0x5000dd;})});}_0x596633=_[_0x9e53('0x38')]({},_0x596633,_0x3d354b[_0x9e53('0x3a')]);return _0x27e23e[_0x9e53('0x49')](_0x596633);}})['then'](function(_0x1b5652){if(_0x1b5652){_0x1e6c24=_0x1b5652['length'];if(!_0x3d354b[_0x9e53('0x2f')][_0x9e53('0x34')]('nolimit')){_0x596633['limit']=qs[_0x9e53('0x1d')](_0x3d354b[_0x9e53('0x2f')][_0x9e53('0x1d')]);_0x596633['offset']=qs[_0x9e53('0x1b')](_0x3d354b[_0x9e53('0x2f')][_0x9e53('0x1b')]);}return _0x27e23e[_0x9e53('0x49')](_0x596633);}})[_0x9e53('0x22')](function(_0x737eb8){if(_0x737eb8){return _0x737eb8?{'count':_0x1e6c24,'rows':_0x737eb8}:null;}})[_0x9e53('0x22')](respondWithResult(_0x27f712,null))[_0x9e53('0x40')](handleError(_0x27f712,null));}; \ No newline at end of file +var _0x4f68=['apply','reject','update','then','destroy','error','stack','name','map','VtigerConfiguration','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','includeAll','include','rows','catch','show','params','merge','options','create','body','find','getFields','findOne','getSubjects','VtigerField','order','getDescriptions','zip-dir','request-promise','moment','bluebird','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','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x4f68,0x1b8));var _0x84f6=function(_0x37b22b,_0x259407){_0x37b22b=_0x37b22b-0x0;var _0xb0bb00=_0x4f68[_0x37b22b];return _0xb0bb00;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x84f6('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x84f6('0x1'));var moment=require(_0x84f6('0x2'));var BPromise=require(_0x84f6('0x3'));var Mustache=require(_0x84f6('0x4'));var util=require(_0x84f6('0x5'));var path=require(_0x84f6('0x6'));var sox=require(_0x84f6('0x7'));var csv=require(_0x84f6('0x8'));var ejs=require(_0x84f6('0x9'));var fs=require('fs');var fs_extra=require(_0x84f6('0xa'));var _=require(_0x84f6('0xb'));var squel=require(_0x84f6('0xc'));var crypto=require(_0x84f6('0xd'));var jsforce=require(_0x84f6('0xe'));var deskjs=require(_0x84f6('0xf'));var toCsv=require(_0x84f6('0x8'));var querystring=require('querystring');var Papa=require(_0x84f6('0x10'));var Redis=require(_0x84f6('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x84f6('0x12'));var as=require(_0x84f6('0x13'));var hardwareService=require(_0x84f6('0x14'));var logger=require('../../config/logger')(_0x84f6('0x15'));var utils=require(_0x84f6('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x84f6('0x17'))['db'];function respondWithStatusCode(_0x2ac09f,_0x1bbd98){_0x1bbd98=_0x1bbd98||0xcc;return function(_0x58a7e4){if(_0x58a7e4){return _0x2ac09f[_0x84f6('0x18')](_0x1bbd98);}return _0x2ac09f['status'](_0x1bbd98)[_0x84f6('0x19')]();};}function respondWithResult(_0x41dcdb,_0x2e2d3c){_0x2e2d3c=_0x2e2d3c||0xc8;return function(_0x2e7900){if(_0x2e7900){return _0x41dcdb[_0x84f6('0x1a')](_0x2e2d3c)[_0x84f6('0x1b')](_0x2e7900);}};}function respondWithFilteredResult(_0x510089,_0x30acf8){return function(_0x5b86af){if(_0x5b86af){var _0x20ec2f=typeof _0x30acf8[_0x84f6('0x1c')]===_0x84f6('0x1d')&&typeof _0x30acf8[_0x84f6('0x1e')]===_0x84f6('0x1d');var _0x3a2c3f=_0x5b86af[_0x84f6('0x1f')];var _0x2e4171=_0x20ec2f?0x0:_0x30acf8[_0x84f6('0x1c')];var _0x30110e=_0x20ec2f?_0x5b86af['count']:_0x30acf8[_0x84f6('0x1c')]+_0x30acf8[_0x84f6('0x1e')];var _0x4944da;if(_0x30110e>=_0x3a2c3f){_0x30110e=_0x3a2c3f;_0x4944da=0xc8;}else{_0x4944da=0xce;}_0x510089[_0x84f6('0x1a')](_0x4944da);return _0x510089[_0x84f6('0x20')](_0x84f6('0x21'),_0x2e4171+'-'+_0x30110e+'/'+_0x3a2c3f)[_0x84f6('0x1b')](_0x5b86af);}return null;};}function patchUpdates(_0x45daf2){return function(_0x549b45){try{jsonpatch[_0x84f6('0x22')](_0x549b45,_0x45daf2,!![]);}catch(_0xa9cb38){return BPromise[_0x84f6('0x23')](_0xa9cb38);}return _0x549b45['save']();};}function saveUpdates(_0x57d9ac,_0x15645d){return function(_0x452823){if(_0x452823){return _0x452823[_0x84f6('0x24')](_0x57d9ac)[_0x84f6('0x25')](function(_0x45d462){return _0x45d462;});}return null;};}function removeEntity(_0x2563af,_0x3b752c){return function(_0x10ba89){if(_0x10ba89){return _0x10ba89[_0x84f6('0x26')]()[_0x84f6('0x25')](function(){_0x2563af[_0x84f6('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38abd3,_0x1878df){return function(_0xcda2c){if(!_0xcda2c){_0x38abd3['sendStatus'](0x194);}return _0xcda2c;};}function handleError(_0x3cb734,_0x71db6b){_0x71db6b=_0x71db6b||0x1f4;return function(_0x340142){logger[_0x84f6('0x27')](_0x340142[_0x84f6('0x28')]);if(_0x340142[_0x84f6('0x29')]){delete _0x340142['name'];}_0x3cb734[_0x84f6('0x1a')](_0x71db6b)['send'](_0x340142);};}exports['index']=function(_0x29878b,_0x3ae363){var _0x4ccd3a={},_0x2a012a={},_0x25fe78={'count':0x0,'rows':[]};var _0x2d91d6=_[_0x84f6('0x2a')](db[_0x84f6('0x2b')][_0x84f6('0x2c')],function(_0x538729){return{'name':_0x538729[_0x84f6('0x2d')],'type':_0x538729[_0x84f6('0x2e')]['key']};});_0x2a012a[_0x84f6('0x2f')]=_[_0x84f6('0x2a')](_0x2d91d6,'name');_0x2a012a[_0x84f6('0x30')]=_[_0x84f6('0x31')](_0x29878b['query']);_0x2a012a[_0x84f6('0x32')]=_[_0x84f6('0x33')](_0x2a012a[_0x84f6('0x2f')],_0x2a012a['query']);_0x4ccd3a[_0x84f6('0x34')]=_[_0x84f6('0x33')](_0x2a012a[_0x84f6('0x2f')],qs[_0x84f6('0x35')](_0x29878b[_0x84f6('0x30')][_0x84f6('0x35')]));_0x4ccd3a['attributes']=_0x4ccd3a['attributes'][_0x84f6('0x36')]?_0x4ccd3a[_0x84f6('0x34')]:_0x2a012a[_0x84f6('0x2f')];if(!_0x29878b[_0x84f6('0x30')][_0x84f6('0x37')](_0x84f6('0x38'))){_0x4ccd3a[_0x84f6('0x1e')]=qs[_0x84f6('0x1e')](_0x29878b[_0x84f6('0x30')][_0x84f6('0x1e')]);_0x4ccd3a['offset']=qs[_0x84f6('0x1c')](_0x29878b[_0x84f6('0x30')][_0x84f6('0x1c')]);}_0x4ccd3a['order']=qs[_0x84f6('0x39')](_0x29878b[_0x84f6('0x30')][_0x84f6('0x39')]);_0x4ccd3a['where']=qs[_0x84f6('0x32')](_[_0x84f6('0x3a')](_0x29878b[_0x84f6('0x30')],_0x2a012a[_0x84f6('0x32')]),_0x2d91d6);if(_0x29878b['query'][_0x84f6('0x3b')]){_0x4ccd3a[_0x84f6('0x3c')]=_['merge'](_0x4ccd3a[_0x84f6('0x3c')],{'$or':_[_0x84f6('0x2a')](_0x2d91d6,function(_0x5e8b15){if(_0x5e8b15[_0x84f6('0x2e')]!==_0x84f6('0x3d')){var _0x3179bb={};_0x3179bb[_0x5e8b15[_0x84f6('0x29')]]={'$like':'%'+_0x29878b['query']['filter']+'%'};return _0x3179bb;}})});}_0x4ccd3a=_['merge']({},_0x4ccd3a,_0x29878b['options']);var _0x4bfa29={'where':_0x4ccd3a['where']};return db[_0x84f6('0x2b')][_0x84f6('0x1f')](_0x4bfa29)[_0x84f6('0x25')](function(_0x18ff34){_0x25fe78[_0x84f6('0x1f')]=_0x18ff34;if(_0x29878b[_0x84f6('0x30')][_0x84f6('0x3e')]){_0x4ccd3a[_0x84f6('0x3f')]=[{'all':!![]}];}return db[_0x84f6('0x2b')]['findAll'](_0x4ccd3a);})[_0x84f6('0x25')](function(_0x3bd686){_0x25fe78[_0x84f6('0x40')]=_0x3bd686;return _0x25fe78;})[_0x84f6('0x25')](respondWithFilteredResult(_0x3ae363,_0x4ccd3a))[_0x84f6('0x41')](handleError(_0x3ae363,null));};exports[_0x84f6('0x42')]=function(_0x3309a7,_0x558715){var _0x2a915e={'raw':![],'where':{'id':_0x3309a7[_0x84f6('0x43')]['id']}},_0x5171ac={};_0x5171ac[_0x84f6('0x2f')]=_['keys'](db[_0x84f6('0x2b')][_0x84f6('0x2c')]);_0x5171ac[_0x84f6('0x30')]=_['keys'](_0x3309a7['query']);_0x5171ac[_0x84f6('0x32')]=_[_0x84f6('0x33')](_0x5171ac[_0x84f6('0x2f')],_0x5171ac[_0x84f6('0x30')]);_0x2a915e[_0x84f6('0x34')]=_[_0x84f6('0x33')](_0x5171ac[_0x84f6('0x2f')],qs['fields'](_0x3309a7[_0x84f6('0x30')][_0x84f6('0x35')]));_0x2a915e['attributes']=_0x2a915e[_0x84f6('0x34')]['length']?_0x2a915e[_0x84f6('0x34')]:_0x5171ac[_0x84f6('0x2f')];if(_0x3309a7['query'][_0x84f6('0x3e')]){_0x2a915e[_0x84f6('0x3f')]=[{'all':!![]}];}_0x2a915e=_[_0x84f6('0x44')]({},_0x2a915e,_0x3309a7[_0x84f6('0x45')]);return db[_0x84f6('0x2b')]['find'](_0x2a915e)[_0x84f6('0x25')](handleEntityNotFound(_0x558715,null))[_0x84f6('0x25')](respondWithResult(_0x558715,null))[_0x84f6('0x41')](handleError(_0x558715,null));};exports[_0x84f6('0x46')]=function(_0x2e754d,_0x118301){return db[_0x84f6('0x2b')][_0x84f6('0x46')](_0x2e754d[_0x84f6('0x47')],{})[_0x84f6('0x25')](respondWithResult(_0x118301,0xc9))['catch'](handleError(_0x118301,null));};exports[_0x84f6('0x24')]=function(_0x5af1b6,_0x4c1a30){if(_0x5af1b6[_0x84f6('0x47')]['id']){delete _0x5af1b6[_0x84f6('0x47')]['id'];}return db[_0x84f6('0x2b')][_0x84f6('0x48')]({'where':{'id':_0x5af1b6['params']['id']}})[_0x84f6('0x25')](handleEntityNotFound(_0x4c1a30,null))[_0x84f6('0x25')](saveUpdates(_0x5af1b6['body'],null))['then'](respondWithResult(_0x4c1a30,null))[_0x84f6('0x41')](handleError(_0x4c1a30,null));};exports['destroy']=function(_0x58f5cf,_0x21ac58){return db[_0x84f6('0x2b')][_0x84f6('0x48')]({'where':{'id':_0x58f5cf['params']['id']}})['then'](handleEntityNotFound(_0x21ac58,null))[_0x84f6('0x25')](removeEntity(_0x21ac58,null))[_0x84f6('0x41')](handleError(_0x21ac58,null));};exports[_0x84f6('0x49')]=function(_0x451e2f,_0x4f1a00,_0x3ff4be){var _0x287f88={};var _0x1620cc={};var _0xbff6fe;var _0x23f6bd;return db[_0x84f6('0x2b')][_0x84f6('0x4a')]({'where':{'id':_0x451e2f[_0x84f6('0x43')]['id']}})['then'](handleEntityNotFound(_0x4f1a00,null))[_0x84f6('0x25')](function(_0x5527da){if(_0x5527da){_0xbff6fe=_0x5527da;_0x1620cc[_0x84f6('0x2f')]=_[_0x84f6('0x31')](db['VtigerField'][_0x84f6('0x2c')]);_0x1620cc[_0x84f6('0x30')]=_[_0x84f6('0x31')](_0x451e2f[_0x84f6('0x30')]);_0x1620cc[_0x84f6('0x32')]=_[_0x84f6('0x33')](_0x1620cc['model'],_0x1620cc['query']);_0x287f88[_0x84f6('0x34')]=_['intersection'](_0x1620cc[_0x84f6('0x2f')],qs['fields'](_0x451e2f[_0x84f6('0x30')][_0x84f6('0x35')]));_0x287f88[_0x84f6('0x34')]=_0x287f88[_0x84f6('0x34')][_0x84f6('0x36')]?_0x287f88[_0x84f6('0x34')]:_0x1620cc[_0x84f6('0x2f')];_0x287f88['order']=qs[_0x84f6('0x39')](_0x451e2f['query']['sort']);_0x287f88[_0x84f6('0x3c')]=qs[_0x84f6('0x32')](_[_0x84f6('0x3a')](_0x451e2f[_0x84f6('0x30')],_0x1620cc[_0x84f6('0x32')]));if(_0x451e2f[_0x84f6('0x30')][_0x84f6('0x3b')]){_0x287f88[_0x84f6('0x3c')]=_[_0x84f6('0x44')](_0x287f88['where'],{'$or':_[_0x84f6('0x2a')](_0x287f88[_0x84f6('0x34')],function(_0x4c652e){var _0x3ac33d={};_0x3ac33d[_0x4c652e]={'$like':'%'+_0x451e2f[_0x84f6('0x30')][_0x84f6('0x3b')]+'%'};return _0x3ac33d;})});}_0x287f88=_['merge']({},_0x287f88,_0x451e2f['options']);return _0xbff6fe[_0x84f6('0x49')](_0x287f88);}})[_0x84f6('0x25')](function(_0x5220a0){if(_0x5220a0){_0x23f6bd=_0x5220a0[_0x84f6('0x36')];if(!_0x451e2f[_0x84f6('0x30')][_0x84f6('0x37')]('nolimit')){_0x287f88['limit']=qs[_0x84f6('0x1e')](_0x451e2f[_0x84f6('0x30')]['limit']);_0x287f88['offset']=qs[_0x84f6('0x1c')](_0x451e2f[_0x84f6('0x30')][_0x84f6('0x1c')]);}return _0xbff6fe['getFields'](_0x287f88);}})[_0x84f6('0x25')](function(_0x31f7d7){if(_0x31f7d7){return _0x31f7d7?{'count':_0x23f6bd,'rows':_0x31f7d7}:null;}})[_0x84f6('0x25')](respondWithResult(_0x4f1a00,null))[_0x84f6('0x41')](handleError(_0x4f1a00,null));};exports[_0x84f6('0x4b')]=function(_0x450b94,_0x2bab29,_0x3a6e3e){var _0x22b5f8={};var _0x27ab18={};var _0x5bbd32;var _0x250785;return db[_0x84f6('0x2b')][_0x84f6('0x4a')]({'where':{'id':_0x450b94[_0x84f6('0x43')]['id']}})[_0x84f6('0x25')](handleEntityNotFound(_0x2bab29,null))[_0x84f6('0x25')](function(_0x11f9d3){if(_0x11f9d3){_0x5bbd32=_0x11f9d3;_0x27ab18[_0x84f6('0x2f')]=_['keys'](db[_0x84f6('0x4c')][_0x84f6('0x2c')]);_0x27ab18['query']=_[_0x84f6('0x31')](_0x450b94[_0x84f6('0x30')]);_0x27ab18[_0x84f6('0x32')]=_[_0x84f6('0x33')](_0x27ab18['model'],_0x27ab18[_0x84f6('0x30')]);_0x22b5f8[_0x84f6('0x34')]=_[_0x84f6('0x33')](_0x27ab18[_0x84f6('0x2f')],qs[_0x84f6('0x35')](_0x450b94[_0x84f6('0x30')][_0x84f6('0x35')]));_0x22b5f8[_0x84f6('0x34')]=_0x22b5f8[_0x84f6('0x34')][_0x84f6('0x36')]?_0x22b5f8[_0x84f6('0x34')]:_0x27ab18['model'];_0x22b5f8[_0x84f6('0x4d')]=qs[_0x84f6('0x39')](_0x450b94[_0x84f6('0x30')][_0x84f6('0x39')]);_0x22b5f8[_0x84f6('0x3c')]=qs[_0x84f6('0x32')](_[_0x84f6('0x3a')](_0x450b94[_0x84f6('0x30')],_0x27ab18['filters']));if(_0x450b94[_0x84f6('0x30')][_0x84f6('0x3b')]){_0x22b5f8[_0x84f6('0x3c')]=_[_0x84f6('0x44')](_0x22b5f8['where'],{'$or':_['map'](_0x22b5f8[_0x84f6('0x34')],function(_0x4f4a46){var _0x579295={};_0x579295[_0x4f4a46]={'$like':'%'+_0x450b94['query'][_0x84f6('0x3b')]+'%'};return _0x579295;})});}_0x22b5f8=_['merge']({},_0x22b5f8,_0x450b94['options']);return _0x5bbd32['getSubjects'](_0x22b5f8);}})[_0x84f6('0x25')](function(_0x530154){if(_0x530154){_0x250785=_0x530154[_0x84f6('0x36')];if(!_0x450b94[_0x84f6('0x30')][_0x84f6('0x37')]('nolimit')){_0x22b5f8[_0x84f6('0x1e')]=qs[_0x84f6('0x1e')](_0x450b94[_0x84f6('0x30')]['limit']);_0x22b5f8[_0x84f6('0x1c')]=qs['offset'](_0x450b94[_0x84f6('0x30')][_0x84f6('0x1c')]);}return _0x5bbd32['getSubjects'](_0x22b5f8);}})[_0x84f6('0x25')](function(_0x3cb629){if(_0x3cb629){return _0x3cb629?{'count':_0x250785,'rows':_0x3cb629}:null;}})['then'](respondWithResult(_0x2bab29,null))[_0x84f6('0x41')](handleError(_0x2bab29,null));};exports[_0x84f6('0x4e')]=function(_0x112b6a,_0x44dfc0,_0x48717a){var _0x7da12b={};var _0x48c4c2={};var _0x211ecf;var _0x37c5a7;return db['VtigerConfiguration'][_0x84f6('0x4a')]({'where':{'id':_0x112b6a['params']['id']}})['then'](handleEntityNotFound(_0x44dfc0,null))[_0x84f6('0x25')](function(_0x360267){if(_0x360267){_0x211ecf=_0x360267;_0x48c4c2[_0x84f6('0x2f')]=_['keys'](db['VtigerField']['rawAttributes']);_0x48c4c2[_0x84f6('0x30')]=_[_0x84f6('0x31')](_0x112b6a[_0x84f6('0x30')]);_0x48c4c2[_0x84f6('0x32')]=_[_0x84f6('0x33')](_0x48c4c2['model'],_0x48c4c2[_0x84f6('0x30')]);_0x7da12b[_0x84f6('0x34')]=_[_0x84f6('0x33')](_0x48c4c2['model'],qs[_0x84f6('0x35')](_0x112b6a[_0x84f6('0x30')][_0x84f6('0x35')]));_0x7da12b[_0x84f6('0x34')]=_0x7da12b['attributes'][_0x84f6('0x36')]?_0x7da12b['attributes']:_0x48c4c2[_0x84f6('0x2f')];_0x7da12b['order']=qs[_0x84f6('0x39')](_0x112b6a['query']['sort']);_0x7da12b[_0x84f6('0x3c')]=qs[_0x84f6('0x32')](_[_0x84f6('0x3a')](_0x112b6a[_0x84f6('0x30')],_0x48c4c2[_0x84f6('0x32')]));if(_0x112b6a['query'][_0x84f6('0x3b')]){_0x7da12b[_0x84f6('0x3c')]=_[_0x84f6('0x44')](_0x7da12b[_0x84f6('0x3c')],{'$or':_[_0x84f6('0x2a')](_0x7da12b[_0x84f6('0x34')],function(_0x3849f6){var _0x25f66b={};_0x25f66b[_0x3849f6]={'$like':'%'+_0x112b6a[_0x84f6('0x30')][_0x84f6('0x3b')]+'%'};return _0x25f66b;})});}_0x7da12b=_[_0x84f6('0x44')]({},_0x7da12b,_0x112b6a['options']);return _0x211ecf[_0x84f6('0x4e')](_0x7da12b);}})[_0x84f6('0x25')](function(_0x5437ab){if(_0x5437ab){_0x37c5a7=_0x5437ab[_0x84f6('0x36')];if(!_0x112b6a['query']['hasOwnProperty'](_0x84f6('0x38'))){_0x7da12b['limit']=qs[_0x84f6('0x1e')](_0x112b6a['query'][_0x84f6('0x1e')]);_0x7da12b[_0x84f6('0x1c')]=qs[_0x84f6('0x1c')](_0x112b6a[_0x84f6('0x30')][_0x84f6('0x1c')]);}return _0x211ecf[_0x84f6('0x4e')](_0x7da12b);}})[_0x84f6('0x25')](function(_0xbaa99e){if(_0xbaa99e){return _0xbaa99e?{'count':_0x37c5a7,'rows':_0xbaa99e}:null;}})[_0x84f6('0x25')](respondWithResult(_0x44dfc0,null))['catch'](handleError(_0x44dfc0,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index a6a0c59..7b1f7be 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 _0xf240=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations','util','../../config/logger'];(function(_0x58afd5,_0x534a48){var _0x3e503b=function(_0x27ba44){while(--_0x27ba44){_0x58afd5['push'](_0x58afd5['shift']());}};_0x3e503b(++_0x534a48);}(_0xf240,0xc2));var _0x0f24=function(_0x5a3932,_0x2ceafa){_0x5a3932=_0x5a3932-0x0;var _0x4f188e=_0xf240[_0x5a3932];return _0x4f188e;};'use strict';var _=require('lodash');var util=require(_0x0f24('0x0'));var logger=require(_0x0f24('0x1'))(_0x0f24('0x2'));var moment=require(_0x0f24('0x3'));var BPromise=require(_0x0f24('0x4'));var rp=require(_0x0f24('0x5'));var fs=require('fs');var path=require(_0x0f24('0x6'));var rimraf=require(_0x0f24('0x7'));var config=require(_0x0f24('0x8'));var attributes=require(_0x0f24('0x9'));module[_0x0f24('0xa')]=function(_0x22cd23,_0x3aa7ba){return _0x22cd23[_0x0f24('0xb')](_0x0f24('0xc'),attributes,{'tableName':_0x0f24('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x12fc=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intVtigerConfiguration.attributes','define','VtigerConfiguration','int_vtiger_configurations','lodash'];(function(_0x3a9a34,_0xc09692){var _0x1314ef=function(_0x56bef3){while(--_0x56bef3){_0x3a9a34['push'](_0x3a9a34['shift']());}};_0x1314ef(++_0xc09692);}(_0x12fc,0xe3));var _0xc12f=function(_0x2ab18e,_0x388ac2){_0x2ab18e=_0x2ab18e-0x0;var _0x20bf44=_0x12fc[_0x2ab18e];return _0x20bf44;};'use strict';var _=require(_0xc12f('0x0'));var util=require('util');var logger=require(_0xc12f('0x1'))(_0xc12f('0x2'));var moment=require(_0xc12f('0x3'));var BPromise=require(_0xc12f('0x4'));var rp=require(_0xc12f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc12f('0x6'));var config=require(_0xc12f('0x7'));var attributes=require(_0xc12f('0x8'));module['exports']=function(_0x9d70e5,_0x3f6692){return _0x9d70e5[_0xc12f('0x9')](_0xc12f('0xa'),attributes,{'tableName':_0xc12f('0xb'),'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 0d7b58e..349b770 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 _0x4b5e=['info','VtigerConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then'];(function(_0x31a371,_0x50828e){var _0x2a5bd6=function(_0x2fb481){while(--_0x2fb481){_0x31a371['push'](_0x31a371['shift']());}};_0x2a5bd6(++_0x50828e);}(_0x4b5e,0x133));var _0xe4b5=function(_0x4c5e7e,_0x2dca3b){_0x4c5e7e=_0x4c5e7e-0x0;var _0x3628df=_0x4b5e[_0x4c5e7e];return _0x3628df;};'use strict';var _=require(_0xe4b5('0x0'));var util=require(_0xe4b5('0x1'));var moment=require(_0xe4b5('0x2'));var BPromise=require(_0xe4b5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe4b5('0x4'));var db=require(_0xe4b5('0x5'))['db'];var utils=require(_0xe4b5('0x6'));var logger=require(_0xe4b5('0x7'))(_0xe4b5('0x8'));var config=require(_0xe4b5('0x9'));var jayson=require(_0xe4b5('0xa'));var client=jayson[_0xe4b5('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x48c59f,_0x262ab2,_0x17618f){return new BPromise(function(_0x26f8aa,_0x7bcad0){return client['request'](_0x48c59f,_0x17618f)[_0xe4b5('0xc')](function(_0x2c4acc){logger[_0xe4b5('0xd')](_0xe4b5('0xe'),_0x262ab2,'request\x20sent');logger[_0xe4b5('0xf')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x262ab2,_0xe4b5('0x10'),JSON[_0xe4b5('0x11')](_0x2c4acc));if(_0x2c4acc['error']){if(_0x2c4acc[_0xe4b5('0x12')]['code']===0x1f4){logger[_0xe4b5('0x12')](_0xe4b5('0xe'),_0x262ab2,_0x2c4acc['error'][_0xe4b5('0x13')]);return _0x7bcad0(_0x2c4acc['error']['message']);}logger[_0xe4b5('0x12')](_0xe4b5('0xe'),_0x262ab2,_0x2c4acc['error'][_0xe4b5('0x13')]);return _0x26f8aa(_0x2c4acc[_0xe4b5('0x12')]['message']);}else{logger[_0xe4b5('0xd')](_0xe4b5('0xe'),_0x262ab2,_0xe4b5('0x10'));_0x26f8aa(_0x2c4acc['result'][_0xe4b5('0x13')]);}})['catch'](function(_0x34b858){logger[_0xe4b5('0x12')](_0xe4b5('0xe'),_0x262ab2,_0x34b858);_0x7bcad0(_0x34b858);});});} \ No newline at end of file +var _0xeaa6=['../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VtigerConfiguration,\x20%s,\x20%s','info','result','catch','lodash','util','moment','randomstring'];(function(_0x2b0f81,_0x3917f0){var _0x5ce74c=function(_0x12dc0d){while(--_0x12dc0d){_0x2b0f81['push'](_0x2b0f81['shift']());}};_0x5ce74c(++_0x3917f0);}(_0xeaa6,0x146));var _0x6eaa=function(_0x1329f6,_0x3fb7c5){_0x1329f6=_0x1329f6-0x0;var _0x56790b=_0xeaa6[_0x1329f6];return _0x56790b;};'use strict';var _=require(_0x6eaa('0x0'));var util=require(_0x6eaa('0x1'));var moment=require(_0x6eaa('0x2'));var BPromise=require('bluebird');var rs=require(_0x6eaa('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6eaa('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6eaa('0x5'))('rpc');var config=require(_0x6eaa('0x6'));var jayson=require(_0x6eaa('0x7'));var client=jayson[_0x6eaa('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x48e1bd,_0xf36442,_0x166309){return new BPromise(function(_0x7b98b6,_0xd77145){return client[_0x6eaa('0x9')](_0x48e1bd,_0x166309)[_0x6eaa('0xa')](function(_0x5fcd3e){logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0xf36442,_0x6eaa('0xb'));logger[_0x6eaa('0xc')](_0x6eaa('0xd'),_0xf36442,_0x6eaa('0xb'),JSON[_0x6eaa('0xe')](_0x5fcd3e));if(_0x5fcd3e['error']){if(_0x5fcd3e[_0x6eaa('0xf')][_0x6eaa('0x10')]===0x1f4){logger[_0x6eaa('0xf')]('VtigerConfiguration,\x20%s,\x20%s',_0xf36442,_0x5fcd3e['error'][_0x6eaa('0x11')]);return _0xd77145(_0x5fcd3e['error'][_0x6eaa('0x11')]);}logger[_0x6eaa('0xf')](_0x6eaa('0x12'),_0xf36442,_0x5fcd3e[_0x6eaa('0xf')][_0x6eaa('0x11')]);return _0x7b98b6(_0x5fcd3e[_0x6eaa('0xf')][_0x6eaa('0x11')]);}else{logger[_0x6eaa('0x13')](_0x6eaa('0x12'),_0xf36442,_0x6eaa('0xb'));_0x7b98b6(_0x5fcd3e[_0x6eaa('0x14')]['message']);}})[_0x6eaa('0x15')](function(_0x3e9c77){logger[_0x6eaa('0xf')](_0x6eaa('0x12'),_0xf36442,_0x3e9c77);_0xd77145(_0x3e9c77);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 4d615e8..f19c62c 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 _0xbd99=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','index','/:id','isAuthenticated','show','post','create','put','update','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x3bff73,_0x758311){var _0x2d96b7=function(_0x4d031e){while(--_0x4d031e){_0x3bff73['push'](_0x3bff73['shift']());}};_0x2d96b7(++_0x758311);}(_0xbd99,0xf0));var _0x9bd9=function(_0x22a1f7,_0x3f0edf){_0x22a1f7=_0x22a1f7-0x0;var _0x68ebd5=_0xbd99[_0x22a1f7];return _0x68ebd5;};'use strict';var multer=require(_0x9bd9('0x0'));var util=require(_0x9bd9('0x1'));var path=require(_0x9bd9('0x2'));var timeout=require(_0x9bd9('0x3'));var express=require(_0x9bd9('0x4'));var router=express[_0x9bd9('0x5')]();var fs_extra=require(_0x9bd9('0x6'));var auth=require(_0x9bd9('0x7'));var interaction=require(_0x9bd9('0x8'));var config=require(_0x9bd9('0x9'));var controller=require(_0x9bd9('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0x9bd9('0xb')]);router['get'](_0x9bd9('0xc'),auth[_0x9bd9('0xd')](),controller[_0x9bd9('0xe')]);router[_0x9bd9('0xf')]('/',auth[_0x9bd9('0xd')](),controller[_0x9bd9('0x10')]);router[_0x9bd9('0x11')](_0x9bd9('0xc'),auth['isAuthenticated'](),controller[_0x9bd9('0x12')]);router['delete'](_0x9bd9('0xc'),auth[_0x9bd9('0xd')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x10e7=['../../config/environment','./intVtigerField.controller','get','index','/:id','isAuthenticated','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0x10e7,0xb4));var _0x710e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x10e7[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x710e('0x0'));var util=require(_0x710e('0x1'));var path=require(_0x710e('0x2'));var timeout=require('connect-timeout');var express=require(_0x710e('0x3'));var router=express[_0x710e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x710e('0x5'));var interaction=require(_0x710e('0x6'));var config=require(_0x710e('0x7'));var controller=require(_0x710e('0x8'));router[_0x710e('0x9')]('/',auth['isAuthenticated'](),controller[_0x710e('0xa')]);router[_0x710e('0x9')](_0x710e('0xb'),auth[_0x710e('0xc')](),controller['show']);router['post']('/',auth[_0x710e('0xc')](),controller['create']);router['put'](_0x710e('0xb'),auth[_0x710e('0xc')](),controller[_0x710e('0xd')]);router[_0x710e('0xe')]('/:id',auth[_0x710e('0xc')](),controller[_0x710e('0xf')]);module[_0x710e('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 9d2828d..6449e3f 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 _0x8331=['exports','ENUM','string','variable','customVariable','picklist','STRING','BOOLEAN'];(function(_0x50650d,_0x4c2c28){var _0x55f9d4=function(_0x57bfdc){while(--_0x57bfdc){_0x50650d['push'](_0x50650d['shift']());}};_0x55f9d4(++_0x4c2c28);}(_0x8331,0x180));var _0x1833=function(_0x1a9204,_0x1c9e00){_0x1a9204=_0x1a9204-0x0;var _0x17ca68=_0x8331[_0x1a9204];return _0x17ca68;};'use strict';var Sequelize=require('sequelize');module[_0x1833('0x0')]={'type':{'type':Sequelize[_0x1833('0x1')](_0x1833('0x2'),_0x1833('0x3'),_0x1833('0x4'),'keyValue',_0x1833('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x1833('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x1833('0x1')]('string',_0x1833('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x1833('0x6')]},'idField':{'type':Sequelize[_0x1833('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x1833('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1833('0x6')]}}; \ No newline at end of file +var _0xef8a=['string','variable','customVariable','keyValue','STRING','sequelize','exports','ENUM'];(function(_0x2283dc,_0x2fcfc5){var _0x16db90=function(_0x376c35){while(--_0x376c35){_0x2283dc['push'](_0x2283dc['shift']());}};_0x16db90(++_0x2fcfc5);}(_0xef8a,0x9d));var _0xaef8=function(_0xd578cb,_0x2167a3){_0xd578cb=_0xd578cb-0x0;var _0x775533=_0xef8a[_0xd578cb];return _0x775533;};'use strict';var Sequelize=require(_0xaef8('0x0'));module[_0xaef8('0x1')]={'type':{'type':Sequelize[_0xaef8('0x2')](_0xaef8('0x3'),_0xaef8('0x4'),_0xaef8('0x5'),_0xaef8('0x6'),'picklist'),'defaultValue':_0xaef8('0x3')},'content':{'type':Sequelize[_0xaef8('0x7')]},'key':{'type':Sequelize[_0xaef8('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0xaef8('0x3'),_0xaef8('0x4'),_0xaef8('0x5'))},'keyContent':{'type':Sequelize[_0xaef8('0x7')]},'idField':{'type':Sequelize[_0xaef8('0x7')]},'nameField':{'type':Sequelize[_0xaef8('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xaef8('0x7')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index e760d54..9973079 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 _0x60a0=['fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','include','VtigerField','findAll','rows','catch','show','rawAttributes','includeAll','find','body','params','eml-format','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','error','name','send','index','map'];(function(_0x31043f,_0x36aa0d){var _0x145387=function(_0x12dd2f){while(--_0x12dd2f){_0x31043f['push'](_0x31043f['shift']());}};_0x145387(++_0x36aa0d);}(_0x60a0,0x1e1));var _0x060a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x60a0[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x060a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x060a('0x1'));var rp=require('request-promise');var moment=require(_0x060a('0x2'));var BPromise=require(_0x060a('0x3'));var Mustache=require('mustache');var util=require(_0x060a('0x4'));var path=require(_0x060a('0x5'));var sox=require(_0x060a('0x6'));var csv=require(_0x060a('0x7'));var ejs=require(_0x060a('0x8'));var fs=require('fs');var fs_extra=require(_0x060a('0x9'));var _=require(_0x060a('0xa'));var squel=require('squel');var crypto=require(_0x060a('0xb'));var jsforce=require(_0x060a('0xc'));var deskjs=require(_0x060a('0xd'));var toCsv=require(_0x060a('0x7'));var querystring=require(_0x060a('0xe'));var Papa=require(_0x060a('0xf'));var Redis=require('ioredis');var authService=require(_0x060a('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x060a('0x11'));var hardwareService=require(_0x060a('0x12'));var logger=require(_0x060a('0x13'))(_0x060a('0x14'));var utils=require(_0x060a('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x060a('0x16'))['db'];function respondWithStatusCode(_0x378478,_0x10e7a6){_0x10e7a6=_0x10e7a6||0xcc;return function(_0x5aaccc){if(_0x5aaccc){return _0x378478[_0x060a('0x17')](_0x10e7a6);}return _0x378478[_0x060a('0x18')](_0x10e7a6)[_0x060a('0x19')]();};}function respondWithResult(_0x27c769,_0x183017){_0x183017=_0x183017||0xc8;return function(_0x14ab70){if(_0x14ab70){return _0x27c769[_0x060a('0x18')](_0x183017)[_0x060a('0x1a')](_0x14ab70);}};}function respondWithFilteredResult(_0x2de0ba,_0x3a77d4){return function(_0x47def1){if(_0x47def1){var _0x1835ae=typeof _0x3a77d4[_0x060a('0x1b')]==='undefined'&&typeof _0x3a77d4[_0x060a('0x1c')]===_0x060a('0x1d');var _0x416ab8=_0x47def1[_0x060a('0x1e')];var _0x40fee5=_0x1835ae?0x0:_0x3a77d4[_0x060a('0x1b')];var _0x416f73=_0x1835ae?_0x47def1[_0x060a('0x1e')]:_0x3a77d4[_0x060a('0x1b')]+_0x3a77d4['limit'];var _0xe329f9;if(_0x416f73>=_0x416ab8){_0x416f73=_0x416ab8;_0xe329f9=0xc8;}else{_0xe329f9=0xce;}_0x2de0ba[_0x060a('0x18')](_0xe329f9);return _0x2de0ba[_0x060a('0x1f')](_0x060a('0x20'),_0x40fee5+'-'+_0x416f73+'/'+_0x416ab8)[_0x060a('0x1a')](_0x47def1);}return null;};}function patchUpdates(_0x4de504){return function(_0x11e2fc){try{jsonpatch[_0x060a('0x21')](_0x11e2fc,_0x4de504,!![]);}catch(_0x4d053a){return BPromise[_0x060a('0x22')](_0x4d053a);}return _0x11e2fc[_0x060a('0x23')]();};}function saveUpdates(_0x407704,_0x3a52d6){return function(_0x5dec63){if(_0x5dec63){return _0x5dec63[_0x060a('0x24')](_0x407704)['then'](function(_0x3bd1b8){return _0x3bd1b8;});}return null;};}function removeEntity(_0x4153f8,_0x1f5cb1){return function(_0x36dddb){if(_0x36dddb){return _0x36dddb[_0x060a('0x25')]()[_0x060a('0x26')](function(){_0x4153f8['status'](0xcc)[_0x060a('0x19')]();});}};}function handleEntityNotFound(_0x53b420,_0x743d5){return function(_0x7cbba2){if(!_0x7cbba2){_0x53b420['sendStatus'](0x194);}return _0x7cbba2;};}function handleError(_0x6e4c01,_0x46d279){_0x46d279=_0x46d279||0x1f4;return function(_0x57967c){logger[_0x060a('0x27')](_0x57967c['stack']);if(_0x57967c[_0x060a('0x28')]){delete _0x57967c[_0x060a('0x28')];}_0x6e4c01['status'](_0x46d279)[_0x060a('0x29')](_0x57967c);};}exports[_0x060a('0x2a')]=function(_0x3d0cc6,_0x18acff){var _0x212e0f={},_0x5e9e94={},_0x955097={'count':0x0,'rows':[]};var _0x1a5749=_[_0x060a('0x2b')](db['VtigerField']['rawAttributes'],function(_0x119a2f){return{'name':_0x119a2f[_0x060a('0x2c')],'type':_0x119a2f[_0x060a('0x2d')][_0x060a('0x2e')]};});_0x5e9e94[_0x060a('0x2f')]=_['map'](_0x1a5749,_0x060a('0x28'));_0x5e9e94[_0x060a('0x30')]=_[_0x060a('0x31')](_0x3d0cc6[_0x060a('0x30')]);_0x5e9e94[_0x060a('0x32')]=_[_0x060a('0x33')](_0x5e9e94['model'],_0x5e9e94['query']);_0x212e0f[_0x060a('0x34')]=_['intersection'](_0x5e9e94[_0x060a('0x2f')],qs[_0x060a('0x35')](_0x3d0cc6[_0x060a('0x30')]['fields']));_0x212e0f['attributes']=_0x212e0f[_0x060a('0x34')][_0x060a('0x36')]?_0x212e0f[_0x060a('0x34')]:_0x5e9e94[_0x060a('0x2f')];if(!_0x3d0cc6[_0x060a('0x30')][_0x060a('0x37')](_0x060a('0x38'))){_0x212e0f[_0x060a('0x1c')]=qs[_0x060a('0x1c')](_0x3d0cc6[_0x060a('0x30')][_0x060a('0x1c')]);_0x212e0f['offset']=qs[_0x060a('0x1b')](_0x3d0cc6[_0x060a('0x30')][_0x060a('0x1b')]);}_0x212e0f[_0x060a('0x39')]=qs[_0x060a('0x3a')](_0x3d0cc6['query'][_0x060a('0x3a')]);_0x212e0f[_0x060a('0x3b')]=qs[_0x060a('0x32')](_['pick'](_0x3d0cc6[_0x060a('0x30')],_0x5e9e94[_0x060a('0x32')]),_0x1a5749);if(_0x3d0cc6[_0x060a('0x30')][_0x060a('0x3c')]){_0x212e0f[_0x060a('0x3b')]=_['merge'](_0x212e0f[_0x060a('0x3b')],{'$or':_[_0x060a('0x2b')](_0x1a5749,function(_0x39dea2){if(_0x39dea2[_0x060a('0x2d')]!==_0x060a('0x3d')){var _0x5689dd={};_0x5689dd[_0x39dea2['name']]={'$like':'%'+_0x3d0cc6[_0x060a('0x30')][_0x060a('0x3c')]+'%'};return _0x5689dd;}})});}_0x212e0f=_[_0x060a('0x3e')]({},_0x212e0f,_0x3d0cc6[_0x060a('0x3f')]);var _0x41adf6={'where':_0x212e0f[_0x060a('0x3b')]};return db['VtigerField'][_0x060a('0x1e')](_0x41adf6)[_0x060a('0x26')](function(_0x15240f){_0x955097['count']=_0x15240f;if(_0x3d0cc6[_0x060a('0x30')]['includeAll']){_0x212e0f[_0x060a('0x40')]=[{'all':!![]}];}return db[_0x060a('0x41')][_0x060a('0x42')](_0x212e0f);})[_0x060a('0x26')](function(_0x34fa1c){_0x955097[_0x060a('0x43')]=_0x34fa1c;return _0x955097;})[_0x060a('0x26')](respondWithFilteredResult(_0x18acff,_0x212e0f))[_0x060a('0x44')](handleError(_0x18acff,null));};exports[_0x060a('0x45')]=function(_0x521a2e,_0x117a78){var _0x5b0d20={'raw':!![],'where':{'id':_0x521a2e['params']['id']}},_0x3f00fe={};_0x3f00fe[_0x060a('0x2f')]=_[_0x060a('0x31')](db[_0x060a('0x41')][_0x060a('0x46')]);_0x3f00fe[_0x060a('0x30')]=_['keys'](_0x521a2e[_0x060a('0x30')]);_0x3f00fe['filters']=_[_0x060a('0x33')](_0x3f00fe[_0x060a('0x2f')],_0x3f00fe[_0x060a('0x30')]);_0x5b0d20[_0x060a('0x34')]=_[_0x060a('0x33')](_0x3f00fe[_0x060a('0x2f')],qs[_0x060a('0x35')](_0x521a2e['query']['fields']));_0x5b0d20[_0x060a('0x34')]=_0x5b0d20[_0x060a('0x34')][_0x060a('0x36')]?_0x5b0d20[_0x060a('0x34')]:_0x3f00fe[_0x060a('0x2f')];if(_0x521a2e['query'][_0x060a('0x47')]){_0x5b0d20[_0x060a('0x40')]=[{'all':!![]}];}_0x5b0d20=_[_0x060a('0x3e')]({},_0x5b0d20,_0x521a2e[_0x060a('0x3f')]);return db[_0x060a('0x41')][_0x060a('0x48')](_0x5b0d20)[_0x060a('0x26')](handleEntityNotFound(_0x117a78,null))[_0x060a('0x26')](respondWithResult(_0x117a78,null))[_0x060a('0x44')](handleError(_0x117a78,null));};exports['create']=function(_0x276471,_0x5eb465){return db[_0x060a('0x41')]['create'](_0x276471[_0x060a('0x49')],{})['then'](respondWithResult(_0x5eb465,0xc9))['catch'](handleError(_0x5eb465,null));};exports[_0x060a('0x24')]=function(_0x4fcb98,_0x451c98){if(_0x4fcb98[_0x060a('0x49')]['id']){delete _0x4fcb98[_0x060a('0x49')]['id'];}return db[_0x060a('0x41')][_0x060a('0x48')]({'where':{'id':_0x4fcb98[_0x060a('0x4a')]['id']}})[_0x060a('0x26')](handleEntityNotFound(_0x451c98,null))[_0x060a('0x26')](saveUpdates(_0x4fcb98[_0x060a('0x49')],null))[_0x060a('0x26')](respondWithResult(_0x451c98,null))['catch'](handleError(_0x451c98,null));};exports['destroy']=function(_0xa76bd6,_0x163e29){return db[_0x060a('0x41')]['find']({'where':{'id':_0xa76bd6[_0x060a('0x4a')]['id']}})['then'](handleEntityNotFound(_0x163e29,null))['then'](removeEntity(_0x163e29,null))[_0x060a('0x44')](handleError(_0x163e29,null));}; \ No newline at end of file +var _0xf5d1=['to-csv','ejs','lodash','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','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','VtigerField','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','keys','options','find','create','params','body','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','sox'];(function(_0x4834eb,_0x2c6dbb){var _0xedb7ab=function(_0x551be0){while(--_0x551be0){_0x4834eb['push'](_0x4834eb['shift']());}};_0xedb7ab(++_0x2c6dbb);}(_0xf5d1,0x16a));var _0x1f5d=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0xf5d1[_0x88cd7b];return _0x56fcc8;};'use strict';var emlformat=require(_0x1f5d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1f5d('0x1'));var rp=require(_0x1f5d('0x2'));var moment=require(_0x1f5d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1f5d('0x4'));var util=require(_0x1f5d('0x5'));var path=require(_0x1f5d('0x6'));var sox=require(_0x1f5d('0x7'));var csv=require(_0x1f5d('0x8'));var ejs=require(_0x1f5d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1f5d('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1f5d('0x8'));var querystring=require('querystring');var Papa=require(_0x1f5d('0xb'));var Redis=require('ioredis');var authService=require(_0x1f5d('0xc'));var qs=require(_0x1f5d('0xd'));var as=require(_0x1f5d('0xe'));var hardwareService=require(_0x1f5d('0xf'));var logger=require(_0x1f5d('0x10'))(_0x1f5d('0x11'));var utils=require(_0x1f5d('0x12'));var config=require(_0x1f5d('0x13'));var licenseUtil=require(_0x1f5d('0x14'));var db=require(_0x1f5d('0x15'))['db'];function respondWithStatusCode(_0x2445a0,_0x619e07){_0x619e07=_0x619e07||0xcc;return function(_0x31d516){if(_0x31d516){return _0x2445a0[_0x1f5d('0x16')](_0x619e07);}return _0x2445a0[_0x1f5d('0x17')](_0x619e07)[_0x1f5d('0x18')]();};}function respondWithResult(_0x4ed865,_0x37373e){_0x37373e=_0x37373e||0xc8;return function(_0x4694da){if(_0x4694da){return _0x4ed865['status'](_0x37373e)[_0x1f5d('0x19')](_0x4694da);}};}function respondWithFilteredResult(_0x92ac51,_0x4e1c37){return function(_0x336510){if(_0x336510){var _0x125024=typeof _0x4e1c37['offset']===_0x1f5d('0x1a')&&typeof _0x4e1c37[_0x1f5d('0x1b')]===_0x1f5d('0x1a');var _0x101f02=_0x336510[_0x1f5d('0x1c')];var _0x136429=_0x125024?0x0:_0x4e1c37['offset'];var _0x7fa21e=_0x125024?_0x336510[_0x1f5d('0x1c')]:_0x4e1c37[_0x1f5d('0x1d')]+_0x4e1c37[_0x1f5d('0x1b')];var _0x23c68c;if(_0x7fa21e>=_0x101f02){_0x7fa21e=_0x101f02;_0x23c68c=0xc8;}else{_0x23c68c=0xce;}_0x92ac51[_0x1f5d('0x17')](_0x23c68c);return _0x92ac51['set'](_0x1f5d('0x1e'),_0x136429+'-'+_0x7fa21e+'/'+_0x101f02)['json'](_0x336510);}return null;};}function patchUpdates(_0x1b8fb6){return function(_0x240e09){try{jsonpatch[_0x1f5d('0x1f')](_0x240e09,_0x1b8fb6,!![]);}catch(_0x197a40){return BPromise[_0x1f5d('0x20')](_0x197a40);}return _0x240e09['save']();};}function saveUpdates(_0x1e02f9,_0x5dafd8){return function(_0x38dc05){if(_0x38dc05){return _0x38dc05[_0x1f5d('0x21')](_0x1e02f9)[_0x1f5d('0x22')](function(_0x1e5b96){return _0x1e5b96;});}return null;};}function removeEntity(_0x16b876,_0x26e834){return function(_0x49f500){if(_0x49f500){return _0x49f500[_0x1f5d('0x23')]()[_0x1f5d('0x22')](function(){_0x16b876[_0x1f5d('0x17')](0xcc)[_0x1f5d('0x18')]();});}};}function handleEntityNotFound(_0x53722d,_0x36382c){return function(_0x553a73){if(!_0x553a73){_0x53722d[_0x1f5d('0x16')](0x194);}return _0x553a73;};}function handleError(_0x108836,_0x3d0dcb){_0x3d0dcb=_0x3d0dcb||0x1f4;return function(_0x477f7a){logger[_0x1f5d('0x24')](_0x477f7a[_0x1f5d('0x25')]);if(_0x477f7a[_0x1f5d('0x26')]){delete _0x477f7a[_0x1f5d('0x26')];}_0x108836[_0x1f5d('0x17')](_0x3d0dcb)[_0x1f5d('0x27')](_0x477f7a);};}exports[_0x1f5d('0x28')]=function(_0x2de5d5,_0x33f2e8){var _0x14d8ef={},_0x36622d={},_0x321fbf={'count':0x0,'rows':[]};var _0x3e5af4=_[_0x1f5d('0x29')](db[_0x1f5d('0x2a')]['rawAttributes'],function(_0x4a0f5a){return{'name':_0x4a0f5a[_0x1f5d('0x2b')],'type':_0x4a0f5a[_0x1f5d('0x2c')][_0x1f5d('0x2d')]};});_0x36622d[_0x1f5d('0x2e')]=_['map'](_0x3e5af4,'name');_0x36622d[_0x1f5d('0x2f')]=_['keys'](_0x2de5d5['query']);_0x36622d[_0x1f5d('0x30')]=_[_0x1f5d('0x31')](_0x36622d['model'],_0x36622d[_0x1f5d('0x2f')]);_0x14d8ef[_0x1f5d('0x32')]=_[_0x1f5d('0x31')](_0x36622d['model'],qs[_0x1f5d('0x33')](_0x2de5d5[_0x1f5d('0x2f')]['fields']));_0x14d8ef[_0x1f5d('0x32')]=_0x14d8ef[_0x1f5d('0x32')][_0x1f5d('0x34')]?_0x14d8ef[_0x1f5d('0x32')]:_0x36622d['model'];if(!_0x2de5d5[_0x1f5d('0x2f')][_0x1f5d('0x35')](_0x1f5d('0x36'))){_0x14d8ef[_0x1f5d('0x1b')]=qs[_0x1f5d('0x1b')](_0x2de5d5[_0x1f5d('0x2f')][_0x1f5d('0x1b')]);_0x14d8ef[_0x1f5d('0x1d')]=qs['offset'](_0x2de5d5[_0x1f5d('0x2f')]['offset']);}_0x14d8ef[_0x1f5d('0x37')]=qs[_0x1f5d('0x38')](_0x2de5d5[_0x1f5d('0x2f')][_0x1f5d('0x38')]);_0x14d8ef[_0x1f5d('0x39')]=qs[_0x1f5d('0x30')](_[_0x1f5d('0x3a')](_0x2de5d5[_0x1f5d('0x2f')],_0x36622d[_0x1f5d('0x30')]),_0x3e5af4);if(_0x2de5d5[_0x1f5d('0x2f')][_0x1f5d('0x3b')]){_0x14d8ef[_0x1f5d('0x39')]=_[_0x1f5d('0x3c')](_0x14d8ef[_0x1f5d('0x39')],{'$or':_['map'](_0x3e5af4,function(_0x305585){if(_0x305585[_0x1f5d('0x2c')]!==_0x1f5d('0x3d')){var _0x25bec5={};_0x25bec5[_0x305585[_0x1f5d('0x26')]]={'$like':'%'+_0x2de5d5[_0x1f5d('0x2f')][_0x1f5d('0x3b')]+'%'};return _0x25bec5;}})});}_0x14d8ef=_[_0x1f5d('0x3c')]({},_0x14d8ef,_0x2de5d5['options']);var _0x53f808={'where':_0x14d8ef[_0x1f5d('0x39')]};return db[_0x1f5d('0x2a')][_0x1f5d('0x1c')](_0x53f808)[_0x1f5d('0x22')](function(_0x4045a3){_0x321fbf[_0x1f5d('0x1c')]=_0x4045a3;if(_0x2de5d5['query'][_0x1f5d('0x3e')]){_0x14d8ef[_0x1f5d('0x3f')]=[{'all':!![]}];}return db[_0x1f5d('0x2a')][_0x1f5d('0x40')](_0x14d8ef);})['then'](function(_0x5357e7){_0x321fbf[_0x1f5d('0x41')]=_0x5357e7;return _0x321fbf;})[_0x1f5d('0x22')](respondWithFilteredResult(_0x33f2e8,_0x14d8ef))[_0x1f5d('0x42')](handleError(_0x33f2e8,null));};exports[_0x1f5d('0x43')]=function(_0x366e32,_0x266839){var _0x5a93cc={'raw':!![],'where':{'id':_0x366e32['params']['id']}},_0x19f014={};_0x19f014[_0x1f5d('0x2e')]=_[_0x1f5d('0x44')](db[_0x1f5d('0x2a')]['rawAttributes']);_0x19f014['query']=_[_0x1f5d('0x44')](_0x366e32[_0x1f5d('0x2f')]);_0x19f014[_0x1f5d('0x30')]=_[_0x1f5d('0x31')](_0x19f014[_0x1f5d('0x2e')],_0x19f014['query']);_0x5a93cc['attributes']=_[_0x1f5d('0x31')](_0x19f014[_0x1f5d('0x2e')],qs[_0x1f5d('0x33')](_0x366e32[_0x1f5d('0x2f')][_0x1f5d('0x33')]));_0x5a93cc['attributes']=_0x5a93cc[_0x1f5d('0x32')][_0x1f5d('0x34')]?_0x5a93cc[_0x1f5d('0x32')]:_0x19f014[_0x1f5d('0x2e')];if(_0x366e32[_0x1f5d('0x2f')][_0x1f5d('0x3e')]){_0x5a93cc[_0x1f5d('0x3f')]=[{'all':!![]}];}_0x5a93cc=_[_0x1f5d('0x3c')]({},_0x5a93cc,_0x366e32[_0x1f5d('0x45')]);return db[_0x1f5d('0x2a')][_0x1f5d('0x46')](_0x5a93cc)[_0x1f5d('0x22')](handleEntityNotFound(_0x266839,null))['then'](respondWithResult(_0x266839,null))[_0x1f5d('0x42')](handleError(_0x266839,null));};exports[_0x1f5d('0x47')]=function(_0x259cde,_0x2cd797){return db[_0x1f5d('0x2a')][_0x1f5d('0x47')](_0x259cde['body'],{})[_0x1f5d('0x22')](respondWithResult(_0x2cd797,0xc9))['catch'](handleError(_0x2cd797,null));};exports[_0x1f5d('0x21')]=function(_0x526cdd,_0xc221bc){if(_0x526cdd['body']['id']){delete _0x526cdd['body']['id'];}return db[_0x1f5d('0x2a')][_0x1f5d('0x46')]({'where':{'id':_0x526cdd[_0x1f5d('0x48')]['id']}})[_0x1f5d('0x22')](handleEntityNotFound(_0xc221bc,null))[_0x1f5d('0x22')](saveUpdates(_0x526cdd[_0x1f5d('0x49')],null))['then'](respondWithResult(_0xc221bc,null))[_0x1f5d('0x42')](handleError(_0xc221bc,null));};exports[_0x1f5d('0x23')]=function(_0xeb7b,_0x4611bb){return db[_0x1f5d('0x2a')][_0x1f5d('0x46')]({'where':{'id':_0xeb7b['params']['id']}})['then'](handleEntityNotFound(_0x4611bb,null))[_0x1f5d('0x22')](removeEntity(_0x4611bb,null))['catch'](handleError(_0x4611bb,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 6893fc2..99d2880 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 _0xd3ef=['moment','bluebird','request-promise','path','rimraf','exports','define','VtigerField','int_vtiger_fields','vtiger_unique_index','util','api'];(function(_0x17213c,_0x18a955){var _0x4f1628=function(_0x3e6361){while(--_0x3e6361){_0x17213c['push'](_0x17213c['shift']());}};_0x4f1628(++_0x18a955);}(_0xd3ef,0x1d2));var _0xfd3e=function(_0x1f5143,_0x5e31e6){_0x1f5143=_0x1f5143-0x0;var _0x383a38=_0xd3ef[_0x1f5143];return _0x383a38;};'use strict';var _=require('lodash');var util=require(_0xfd3e('0x0'));var logger=require('../../config/logger')(_0xfd3e('0x1'));var moment=require(_0xfd3e('0x2'));var BPromise=require(_0xfd3e('0x3'));var rp=require(_0xfd3e('0x4'));var fs=require('fs');var path=require(_0xfd3e('0x5'));var rimraf=require(_0xfd3e('0x6'));var config=require('../../config/environment');var attributes=require('./intVtigerField.attributes');module[_0xfd3e('0x7')]=function(_0x221067,_0x152c37){return _0x221067[_0xfd3e('0x8')](_0xfd3e('0x9'),attributes,{'tableName':_0xfd3e('0xa'),'paranoid':![],'indexes':[{'name':_0xfd3e('0xb'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3405=['int_vtiger_fields','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','define','VtigerField'];(function(_0x371951,_0x2796e3){var _0x23b47f=function(_0x2dcfba){while(--_0x2dcfba){_0x371951['push'](_0x371951['shift']());}};_0x23b47f(++_0x2796e3);}(_0x3405,0x8b));var _0x5340=function(_0x556927,_0x34b53f){_0x556927=_0x556927-0x0;var _0x5f1235=_0x3405[_0x556927];return _0x5f1235;};'use strict';var _=require(_0x5340('0x0'));var util=require(_0x5340('0x1'));var logger=require(_0x5340('0x2'))(_0x5340('0x3'));var moment=require(_0x5340('0x4'));var BPromise=require(_0x5340('0x5'));var rp=require(_0x5340('0x6'));var fs=require('fs');var path=require(_0x5340('0x7'));var rimraf=require(_0x5340('0x8'));var config=require(_0x5340('0x9'));var attributes=require(_0x5340('0xa'));module[_0x5340('0xb')]=function(_0x4ec41b,_0x445573){return _0x4ec41b[_0x5340('0xc')](_0x5340('0xd'),attributes,{'tableName':_0x5340('0xe'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0x5340('0xf'),_0x5340('0x10')],'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 17242e2..957cbe7 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 _0x1b70=['client','http','request','then','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1b70,0xb6));var _0x01b7=function(_0x500c0,_0xdb6a03){_0x500c0=_0x500c0-0x0;var _0xdd146f=_0x1b70[_0x500c0];return _0xdd146f;};'use strict';var _=require(_0x01b7('0x0'));var util=require(_0x01b7('0x1'));var moment=require('moment');var BPromise=require(_0x01b7('0x2'));var rs=require(_0x01b7('0x3'));var fs=require('fs');var Redis=require(_0x01b7('0x4'));var db=require(_0x01b7('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x01b7('0x6'))(_0x01b7('0x7'));var config=require(_0x01b7('0x8'));var jayson=require(_0x01b7('0x9'));var client=jayson[_0x01b7('0xa')][_0x01b7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1ca3d5,_0x2d3b7c,_0x3aba1d){return new BPromise(function(_0x56286e,_0xfd0c57){return client[_0x01b7('0xc')](_0x1ca3d5,_0x3aba1d)[_0x01b7('0xd')](function(_0x4346f1){logger['info'](_0x01b7('0xe'),_0x2d3b7c,_0x01b7('0xf'));logger[_0x01b7('0x10')](_0x01b7('0x11'),_0x2d3b7c,_0x01b7('0xf'),JSON['stringify'](_0x4346f1));if(_0x4346f1['error']){if(_0x4346f1[_0x01b7('0x12')][_0x01b7('0x13')]===0x1f4){logger['error'](_0x01b7('0xe'),_0x2d3b7c,_0x4346f1[_0x01b7('0x12')][_0x01b7('0x14')]);return _0xfd0c57(_0x4346f1[_0x01b7('0x12')][_0x01b7('0x14')]);}logger[_0x01b7('0x12')](_0x01b7('0xe'),_0x2d3b7c,_0x4346f1[_0x01b7('0x12')][_0x01b7('0x14')]);return _0x56286e(_0x4346f1[_0x01b7('0x12')][_0x01b7('0x14')]);}else{logger[_0x01b7('0x15')]('VtigerField,\x20%s,\x20%s',_0x2d3b7c,'request\x20sent');_0x56286e(_0x4346f1[_0x01b7('0x16')]['message']);}})[_0x01b7('0x17')](function(_0x5aaca7){logger[_0x01b7('0x12')](_0x01b7('0xe'),_0x2d3b7c,_0x5aaca7);_0xfd0c57(_0x5aaca7);});});} \ No newline at end of file +var _0x2cdc=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','VtigerField,\x20%s,\x20%s','request\x20sent','VtigerField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment'];(function(_0x201b94,_0x5cada6){var _0x49da82=function(_0x503bea){while(--_0x503bea){_0x201b94['push'](_0x201b94['shift']());}};_0x49da82(++_0x5cada6);}(_0x2cdc,0x173));var _0xc2cd=function(_0x472c08,_0x44a8cc){_0x472c08=_0x472c08-0x0;var _0x118036=_0x2cdc[_0x472c08];return _0x118036;};'use strict';var _=require(_0xc2cd('0x0'));var util=require(_0xc2cd('0x1'));var moment=require(_0xc2cd('0x2'));var BPromise=require('bluebird');var rs=require(_0xc2cd('0x3'));var fs=require('fs');var Redis=require(_0xc2cd('0x4'));var db=require(_0xc2cd('0x5'))['db'];var utils=require(_0xc2cd('0x6'));var logger=require(_0xc2cd('0x7'))(_0xc2cd('0x8'));var config=require(_0xc2cd('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc2cd('0xa')][_0xc2cd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5b06aa,_0x347bd7,_0x58dae3){return new BPromise(function(_0x323f77,_0xc46bd8){return client[_0xc2cd('0xc')](_0x5b06aa,_0x58dae3)['then'](function(_0x575871){logger[_0xc2cd('0xd')](_0xc2cd('0xe'),_0x347bd7,_0xc2cd('0xf'));logger['debug'](_0xc2cd('0x10'),_0x347bd7,_0xc2cd('0xf'),JSON['stringify'](_0x575871));if(_0x575871[_0xc2cd('0x11')]){if(_0x575871['error'][_0xc2cd('0x12')]===0x1f4){logger[_0xc2cd('0x11')](_0xc2cd('0xe'),_0x347bd7,_0x575871[_0xc2cd('0x11')][_0xc2cd('0x13')]);return _0xc46bd8(_0x575871[_0xc2cd('0x11')][_0xc2cd('0x13')]);}logger[_0xc2cd('0x11')](_0xc2cd('0xe'),_0x347bd7,_0x575871[_0xc2cd('0x11')][_0xc2cd('0x13')]);return _0x323f77(_0x575871['error'][_0xc2cd('0x13')]);}else{logger[_0xc2cd('0xd')](_0xc2cd('0xe'),_0x347bd7,_0xc2cd('0xf'));_0x323f77(_0x575871[_0xc2cd('0x14')][_0xc2cd('0x13')]);}})[_0xc2cd('0x15')](function(_0x3ed1a4){logger['error'](_0xc2cd('0xe'),_0x347bd7,_0x3ed1a4);_0xc46bd8(_0x3ed1a4);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index ae79c64..48526a2 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 _0x9c51=['create','addConfiguration','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','getFields','post'];(function(_0x5b50a8,_0x3c22c1){var _0x573b78=function(_0x3b74e3){while(--_0x3b74e3){_0x5b50a8['push'](_0x5b50a8['shift']());}};_0x573b78(++_0x3c22c1);}(_0x9c51,0x8f));var _0x19c5=function(_0x163a5f,_0x500870){_0x163a5f=_0x163a5f-0x0;var _0x23a1fe=_0x9c51[_0x163a5f];return _0x23a1fe;};'use strict';var multer=require(_0x19c5('0x0'));var util=require(_0x19c5('0x1'));var path=require(_0x19c5('0x2'));var timeout=require(_0x19c5('0x3'));var express=require('express');var router=express[_0x19c5('0x4')]();var fs_extra=require(_0x19c5('0x5'));var auth=require(_0x19c5('0x6'));var interaction=require(_0x19c5('0x7'));var config=require(_0x19c5('0x8'));var controller=require('./intZendeskAccount.controller');router['get']('/',auth[_0x19c5('0x9')](),controller[_0x19c5('0xa')]);router[_0x19c5('0xb')](_0x19c5('0xc'),auth[_0x19c5('0x9')](),controller[_0x19c5('0xd')]);router['get'](_0x19c5('0xe'),auth[_0x19c5('0x9')](),controller[_0x19c5('0xf')]);router['get']('/:id/fields',auth[_0x19c5('0x9')](),controller[_0x19c5('0x10')]);router[_0x19c5('0x11')]('/',auth[_0x19c5('0x9')](),controller[_0x19c5('0x12')]);router[_0x19c5('0x11')](_0x19c5('0xe'),auth[_0x19c5('0x9')](),controller[_0x19c5('0x13')]);router['put'](_0x19c5('0xc'),auth[_0x19c5('0x9')](),controller['update']);router[_0x19c5('0x14')](_0x19c5('0xc'),auth[_0x19c5('0x9')](),controller[_0x19c5('0x15')]);module[_0x19c5('0x16')]=router; \ No newline at end of file +var _0x58cb=['../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','/:id','getConfigurations','getFields','post','create','/:id/configurations','addConfiguration','put','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x4d53ad,_0x5a8c2b){var _0x1bf121=function(_0x4f88c1){while(--_0x4f88c1){_0x4d53ad['push'](_0x4d53ad['shift']());}};_0x1bf121(++_0x5a8c2b);}(_0x58cb,0x12d));var _0xb58c=function(_0x435ceb,_0x4bb209){_0x435ceb=_0x435ceb-0x0;var _0x389958=_0x58cb[_0x435ceb];return _0x389958;};'use strict';var multer=require(_0xb58c('0x0'));var util=require(_0xb58c('0x1'));var path=require('path');var timeout=require(_0xb58c('0x2'));var express=require(_0xb58c('0x3'));var router=express[_0xb58c('0x4')]();var fs_extra=require(_0xb58c('0x5'));var auth=require(_0xb58c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb58c('0x7'));var controller=require(_0xb58c('0x8'));router[_0xb58c('0x9')]('/',auth[_0xb58c('0xa')](),controller[_0xb58c('0xb')]);router[_0xb58c('0x9')](_0xb58c('0xc'),auth[_0xb58c('0xa')](),controller['show']);router[_0xb58c('0x9')]('/:id/configurations',auth[_0xb58c('0xa')](),controller[_0xb58c('0xd')]);router[_0xb58c('0x9')]('/:id/fields',auth[_0xb58c('0xa')](),controller[_0xb58c('0xe')]);router[_0xb58c('0xf')]('/',auth[_0xb58c('0xa')](),controller[_0xb58c('0x10')]);router[_0xb58c('0xf')](_0xb58c('0x11'),auth['isAuthenticated'](),controller[_0xb58c('0x12')]);router[_0xb58c('0x13')](_0xb58c('0xc'),auth[_0xb58c('0xa')](),controller['update']);router[_0xb58c('0x14')](_0xb58c('0xc'),auth[_0xb58c('0xa')](),controller['destroy']);module[_0xb58c('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 6c18e7a..40c453a 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 _0xdfb1=['token','password','integrationTab','newTab','sequelize','exports','STRING','username'];(function(_0x9444d4,_0x9fb7c7){var _0x435330=function(_0x151a93){while(--_0x151a93){_0x9444d4['push'](_0x9444d4['shift']());}};_0x435330(++_0x9fb7c7);}(_0xdfb1,0x8c));var _0x1dfb=function(_0x155020,_0x28d3ad){_0x155020=_0x155020-0x0;var _0x27fcdc=_0xdfb1[_0x155020];return _0x27fcdc;};'use strict';var Sequelize=require(_0x1dfb('0x0'));module[_0x1dfb('0x1')]={'name':{'type':Sequelize[_0x1dfb('0x2')]},'description':{'type':Sequelize[_0x1dfb('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x1dfb('0x3')},'password':{'type':Sequelize[_0x1dfb('0x2')]},'token':{'type':Sequelize[_0x1dfb('0x2')]},'remoteUri':{'type':Sequelize[_0x1dfb('0x2')],'unique':'remoteUri'},'authType':{'type':Sequelize['ENUM']('password',_0x1dfb('0x4')),'defaultValue':_0x1dfb('0x5')},'serverUrl':{'type':Sequelize[_0x1dfb('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x1dfb('0x6'),_0x1dfb('0x7')),'defaultValue':_0x1dfb('0x6')}}; \ No newline at end of file +var _0xd117=['remoteUri','ENUM','password','token','newTab','integrationTab','sequelize','exports','STRING','username'];(function(_0x4acc55,_0x67535b){var _0x21e265=function(_0x2964e3){while(--_0x2964e3){_0x4acc55['push'](_0x4acc55['shift']());}};_0x21e265(++_0x67535b);}(_0xd117,0x182));var _0x7d11=function(_0xcf581b,_0x4359dd){_0xcf581b=_0xcf581b-0x0;var _0x4f454d=_0xd117[_0xcf581b];return _0x4f454d;};'use strict';var Sequelize=require(_0x7d11('0x0'));module[_0x7d11('0x1')]={'name':{'type':Sequelize[_0x7d11('0x2')]},'description':{'type':Sequelize[_0x7d11('0x2')]},'username':{'type':Sequelize[_0x7d11('0x2')],'unique':_0x7d11('0x3')},'password':{'type':Sequelize[_0x7d11('0x2')]},'token':{'type':Sequelize[_0x7d11('0x2')]},'remoteUri':{'type':Sequelize[_0x7d11('0x2')],'unique':_0x7d11('0x4')},'authType':{'type':Sequelize[_0x7d11('0x5')](_0x7d11('0x6'),_0x7d11('0x7')),'defaultValue':_0x7d11('0x6')},'serverUrl':{'type':Sequelize[_0x7d11('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x7d11('0x5')]('integrationTab',_0x7d11('0x8')),'defaultValue':_0x7d11('0x9')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 33aede7..62af4c3 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 _0x0fd9=['getConfigurations','ZendeskConfiguration','pick','addConfiguration','findOne','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','getFields','username','password','authType','remoteUri','substring','lastIndexOf','%s/%s','format','Basic\x20%s','%s:%s','base64','token','headers','%s/token:%s','toString','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','includes','ticket_fields','position','title','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','squel','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','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','ZendeskAccount','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','create','body','find'];(function(_0x52b5b3,_0x2b87db){var _0x54f753=function(_0x359d96){while(--_0x359d96){_0x52b5b3['push'](_0x52b5b3['shift']());}};_0x54f753(++_0x2b87db);}(_0x0fd9,0xa3));var _0x90fd=function(_0x1f36bb,_0x8af718){_0x1f36bb=_0x1f36bb-0x0;var _0xaf97fa=_0x0fd9[_0x1f36bb];return _0xaf97fa;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x90fd('0x0'));var zipdir=require(_0x90fd('0x1'));var jsonpatch=require(_0x90fd('0x2'));var rp=require(_0x90fd('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x90fd('0x4'));var util=require(_0x90fd('0x5'));var path=require(_0x90fd('0x6'));var sox=require(_0x90fd('0x7'));var csv=require(_0x90fd('0x8'));var ejs=require(_0x90fd('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x90fd('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x90fd('0xb'));var toCsv=require(_0x90fd('0x8'));var querystring=require('querystring');var Papa=require(_0x90fd('0xc'));var Redis=require(_0x90fd('0xd'));var authService=require(_0x90fd('0xe'));var qs=require(_0x90fd('0xf'));var as=require(_0x90fd('0x10'));var hardwareService=require(_0x90fd('0x11'));var logger=require(_0x90fd('0x12'))(_0x90fd('0x13'));var utils=require(_0x90fd('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x90fd('0x15'));var db=require(_0x90fd('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x1439ed,_0x37a0f8){_0x37a0f8=_0x37a0f8||0xcc;return function(_0x19a594){if(_0x19a594){return _0x1439ed['sendStatus'](_0x37a0f8);}return _0x1439ed[_0x90fd('0x17')](_0x37a0f8)['end']();};}function respondWithResult(_0x1cae40,_0xb402d9){_0xb402d9=_0xb402d9||0xc8;return function(_0x18bdb6){if(_0x18bdb6){return _0x1cae40[_0x90fd('0x17')](_0xb402d9)[_0x90fd('0x18')](_0x18bdb6);}};}function respondWithFilteredResult(_0x442a19,_0x296a64){return function(_0x4eb953){if(_0x4eb953){var _0x4f6b7b=typeof _0x296a64[_0x90fd('0x19')]===_0x90fd('0x1a')&&typeof _0x296a64['limit']===_0x90fd('0x1a');var _0x13a694=_0x4eb953[_0x90fd('0x1b')];var _0x4d8f3b=_0x4f6b7b?0x0:_0x296a64[_0x90fd('0x19')];var _0x16e9e3=_0x4f6b7b?_0x4eb953[_0x90fd('0x1b')]:_0x296a64[_0x90fd('0x19')]+_0x296a64[_0x90fd('0x1c')];var _0x58866f;if(_0x16e9e3>=_0x13a694){_0x16e9e3=_0x13a694;_0x58866f=0xc8;}else{_0x58866f=0xce;}_0x442a19[_0x90fd('0x17')](_0x58866f);return _0x442a19[_0x90fd('0x1d')](_0x90fd('0x1e'),_0x4d8f3b+'-'+_0x16e9e3+'/'+_0x13a694)[_0x90fd('0x18')](_0x4eb953);}return null;};}function patchUpdates(_0x19e79b){return function(_0x34ab93){try{jsonpatch[_0x90fd('0x1f')](_0x34ab93,_0x19e79b,!![]);}catch(_0x83fde){return BPromise[_0x90fd('0x20')](_0x83fde);}return _0x34ab93['save']();};}function saveUpdates(_0x35ce4e,_0xc4e4e2){return function(_0xf3044b){if(_0xf3044b){return _0xf3044b[_0x90fd('0x21')](_0x35ce4e)[_0x90fd('0x22')](function(_0x3ad6c6){return _0x3ad6c6;});}return null;};}function removeEntity(_0x30f67e,_0x300262){return function(_0x5152f6){if(_0x5152f6){return _0x5152f6[_0x90fd('0x23')]()['then'](function(){_0x30f67e[_0x90fd('0x17')](0xcc)[_0x90fd('0x24')]();});}};}function handleEntityNotFound(_0x2ffea2,_0x31667c){return function(_0x18beb5){if(!_0x18beb5){_0x2ffea2['sendStatus'](0x194);}return _0x18beb5;};}function handleError(_0x35c38d,_0xe333f0){_0xe333f0=_0xe333f0||0x1f4;return function(_0x2fffe6){logger[_0x90fd('0x25')](_0x2fffe6[_0x90fd('0x26')]);if(_0x2fffe6[_0x90fd('0x27')]){delete _0x2fffe6['name'];}_0x35c38d['status'](_0xe333f0)[_0x90fd('0x28')](_0x2fffe6);};}exports[_0x90fd('0x29')]=function(_0x2924e9,_0x404971){var _0x397aaf={},_0x59b3e8={},_0x4f69e7={'count':0x0,'rows':[]};var _0x3781bb=_[_0x90fd('0x2a')](db[_0x90fd('0x2b')][_0x90fd('0x2c')],function(_0x4a3ae4){return{'name':_0x4a3ae4['fieldName'],'type':_0x4a3ae4[_0x90fd('0x2d')][_0x90fd('0x2e')]};});_0x59b3e8[_0x90fd('0x2f')]=_[_0x90fd('0x2a')](_0x3781bb,'name');_0x59b3e8[_0x90fd('0x30')]=_[_0x90fd('0x31')](_0x2924e9[_0x90fd('0x30')]);_0x59b3e8[_0x90fd('0x32')]=_[_0x90fd('0x33')](_0x59b3e8[_0x90fd('0x2f')],_0x59b3e8[_0x90fd('0x30')]);_0x397aaf[_0x90fd('0x34')]=_[_0x90fd('0x33')](_0x59b3e8[_0x90fd('0x2f')],qs[_0x90fd('0x35')](_0x2924e9[_0x90fd('0x30')][_0x90fd('0x35')]));_0x397aaf[_0x90fd('0x34')]=_0x397aaf[_0x90fd('0x34')][_0x90fd('0x36')]?_0x397aaf['attributes']:_0x59b3e8[_0x90fd('0x2f')];if(!_0x2924e9[_0x90fd('0x30')][_0x90fd('0x37')](_0x90fd('0x38'))){_0x397aaf[_0x90fd('0x1c')]=qs[_0x90fd('0x1c')](_0x2924e9[_0x90fd('0x30')][_0x90fd('0x1c')]);_0x397aaf[_0x90fd('0x19')]=qs[_0x90fd('0x19')](_0x2924e9[_0x90fd('0x30')][_0x90fd('0x19')]);}_0x397aaf[_0x90fd('0x39')]=qs['sort'](_0x2924e9[_0x90fd('0x30')][_0x90fd('0x3a')]);_0x397aaf[_0x90fd('0x3b')]=qs[_0x90fd('0x32')](_['pick'](_0x2924e9[_0x90fd('0x30')],_0x59b3e8[_0x90fd('0x32')]),_0x3781bb);if(_0x2924e9[_0x90fd('0x30')]['filter']){_0x397aaf['where']=_[_0x90fd('0x3c')](_0x397aaf[_0x90fd('0x3b')],{'$or':_[_0x90fd('0x2a')](_0x3781bb,function(_0xb7c342){if(_0xb7c342[_0x90fd('0x2d')]!==_0x90fd('0x3d')){var _0x2c5842={};_0x2c5842[_0xb7c342[_0x90fd('0x27')]]={'$like':'%'+_0x2924e9[_0x90fd('0x30')][_0x90fd('0x3e')]+'%'};return _0x2c5842;}})});}_0x397aaf=_[_0x90fd('0x3c')]({},_0x397aaf,_0x2924e9[_0x90fd('0x3f')]);var _0x21dc9c={'where':_0x397aaf[_0x90fd('0x3b')]};return db[_0x90fd('0x2b')][_0x90fd('0x1b')](_0x21dc9c)[_0x90fd('0x22')](function(_0x131239){_0x4f69e7['count']=_0x131239;if(_0x2924e9[_0x90fd('0x30')][_0x90fd('0x40')]){_0x397aaf[_0x90fd('0x41')]=[{'all':!![]}];}return db['ZendeskAccount']['findAll'](_0x397aaf);})['then'](function(_0x45f37d){_0x4f69e7[_0x90fd('0x42')]=_0x45f37d;return _0x4f69e7;})[_0x90fd('0x22')](respondWithFilteredResult(_0x404971,_0x397aaf))[_0x90fd('0x43')](handleError(_0x404971,null));};exports[_0x90fd('0x44')]=function(_0x311c7e,_0x363365){var _0x733d4d={'raw':![],'where':{'id':_0x311c7e[_0x90fd('0x45')]['id']}},_0x94e96d={};_0x94e96d[_0x90fd('0x2f')]=_[_0x90fd('0x31')](db[_0x90fd('0x2b')][_0x90fd('0x2c')]);_0x94e96d[_0x90fd('0x30')]=_['keys'](_0x311c7e['query']);_0x94e96d[_0x90fd('0x32')]=_[_0x90fd('0x33')](_0x94e96d[_0x90fd('0x2f')],_0x94e96d['query']);_0x733d4d['attributes']=_[_0x90fd('0x33')](_0x94e96d[_0x90fd('0x2f')],qs['fields'](_0x311c7e['query'][_0x90fd('0x35')]));_0x733d4d[_0x90fd('0x34')]=_0x733d4d['attributes']['length']?_0x733d4d[_0x90fd('0x34')]:_0x94e96d[_0x90fd('0x2f')];if(_0x311c7e[_0x90fd('0x30')]['includeAll']){_0x733d4d[_0x90fd('0x41')]=[{'all':!![]}];}_0x733d4d=_[_0x90fd('0x3c')]({},_0x733d4d,_0x311c7e['options']);return db['ZendeskAccount']['find'](_0x733d4d)[_0x90fd('0x22')](handleEntityNotFound(_0x363365,null))[_0x90fd('0x22')](respondWithResult(_0x363365,null))['catch'](handleError(_0x363365,null));};exports[_0x90fd('0x46')]=function(_0x2b73f7,_0x2d47dc){return db[_0x90fd('0x2b')][_0x90fd('0x46')](_0x2b73f7['body'],{})['then'](respondWithResult(_0x2d47dc,0xc9))[_0x90fd('0x43')](handleError(_0x2d47dc,null));};exports[_0x90fd('0x21')]=function(_0x125874,_0x17b6b0){if(_0x125874[_0x90fd('0x47')]['id']){delete _0x125874[_0x90fd('0x47')]['id'];}return db[_0x90fd('0x2b')][_0x90fd('0x48')]({'where':{'id':_0x125874[_0x90fd('0x45')]['id']}})[_0x90fd('0x22')](handleEntityNotFound(_0x17b6b0,null))['then'](saveUpdates(_0x125874[_0x90fd('0x47')],null))[_0x90fd('0x22')](respondWithResult(_0x17b6b0,null))[_0x90fd('0x43')](handleError(_0x17b6b0,null));};exports[_0x90fd('0x23')]=function(_0x4b47bc,_0x4cf061){return db[_0x90fd('0x2b')]['find']({'where':{'id':_0x4b47bc['params']['id']}})[_0x90fd('0x22')](handleEntityNotFound(_0x4cf061,null))[_0x90fd('0x22')](removeEntity(_0x4cf061,null))[_0x90fd('0x43')](handleError(_0x4cf061,null));};exports[_0x90fd('0x49')]=function(_0x13c428,_0x1fc655,_0x3241b5){var _0x5502f2={};var _0x55653c={};var _0x1b81dc;var _0x43d076;return db[_0x90fd('0x2b')]['findOne']({'where':{'id':_0x13c428[_0x90fd('0x45')]['id']}})[_0x90fd('0x22')](handleEntityNotFound(_0x1fc655,null))[_0x90fd('0x22')](function(_0x3494f7){if(_0x3494f7){_0x1b81dc=_0x3494f7;_0x55653c[_0x90fd('0x2f')]=_[_0x90fd('0x31')](db[_0x90fd('0x4a')][_0x90fd('0x2c')]);_0x55653c['query']=_['keys'](_0x13c428[_0x90fd('0x30')]);_0x55653c[_0x90fd('0x32')]=_[_0x90fd('0x33')](_0x55653c['model'],_0x55653c[_0x90fd('0x30')]);_0x5502f2[_0x90fd('0x34')]=_[_0x90fd('0x33')](_0x55653c[_0x90fd('0x2f')],qs[_0x90fd('0x35')](_0x13c428[_0x90fd('0x30')]['fields']));_0x5502f2[_0x90fd('0x34')]=_0x5502f2['attributes'][_0x90fd('0x36')]?_0x5502f2['attributes']:_0x55653c[_0x90fd('0x2f')];_0x5502f2[_0x90fd('0x39')]=qs[_0x90fd('0x3a')](_0x13c428[_0x90fd('0x30')]['sort']);_0x5502f2[_0x90fd('0x3b')]=qs[_0x90fd('0x32')](_[_0x90fd('0x4b')](_0x13c428[_0x90fd('0x30')],_0x55653c[_0x90fd('0x32')]));if(_0x13c428[_0x90fd('0x30')]['filter']){_0x5502f2['where']=_['merge'](_0x5502f2['where'],{'$or':_['map'](_0x5502f2[_0x90fd('0x34')],function(_0x3b98e2){var _0x278db5={};_0x278db5[_0x3b98e2]={'$like':'%'+_0x13c428[_0x90fd('0x30')][_0x90fd('0x3e')]+'%'};return _0x278db5;})});}_0x5502f2=_['merge']({},_0x5502f2,_0x13c428['options']);return _0x1b81dc['getConfigurations'](_0x5502f2);}})[_0x90fd('0x22')](function(_0x24ad4d){if(_0x24ad4d){_0x43d076=_0x24ad4d['length'];if(!_0x13c428[_0x90fd('0x30')][_0x90fd('0x37')](_0x90fd('0x38'))){_0x5502f2[_0x90fd('0x1c')]=qs[_0x90fd('0x1c')](_0x13c428[_0x90fd('0x30')][_0x90fd('0x1c')]);_0x5502f2[_0x90fd('0x19')]=qs[_0x90fd('0x19')](_0x13c428['query'][_0x90fd('0x19')]);}return _0x1b81dc[_0x90fd('0x49')](_0x5502f2);}})[_0x90fd('0x22')](function(_0x53e2bb){if(_0x53e2bb){return _0x53e2bb?{'count':_0x43d076,'rows':_0x53e2bb}:null;}})['then'](respondWithResult(_0x1fc655,null))[_0x90fd('0x43')](handleError(_0x1fc655,null));};exports[_0x90fd('0x4c')]=function(_0x479c8c,_0x5f4645,_0x4d761c){if(_0x479c8c['body']['id']){delete _0x479c8c[_0x90fd('0x47')]['id'];}return db[_0x90fd('0x2b')][_0x90fd('0x4d')]({'where':{'id':_0x479c8c[_0x90fd('0x45')]['id']}})[_0x90fd('0x22')](handleEntityNotFound(_0x5f4645,null))[_0x90fd('0x22')](function(_0x321cfb){if(_0x321cfb){_0x479c8c[_0x90fd('0x47')]['AccountId']=_0x321cfb['id'];_0x479c8c[_0x90fd('0x47')][_0x90fd('0x4e')]=integrations[_0x90fd('0x4f')](_0x479c8c['body'][_0x90fd('0x50')],_0x479c8c[_0x90fd('0x47')]['type']);_0x479c8c['body'][_0x90fd('0x51')]=integrations[_0x90fd('0x52')](_0x479c8c[_0x90fd('0x47')]['channel'],_0x479c8c[_0x90fd('0x47')]['type']);return db['ZendeskConfiguration'][_0x90fd('0x46')](_0x479c8c['body'],{'include':[{'model':db[_0x90fd('0x53')],'as':_0x90fd('0x4e')},{'model':db['ZendeskField'],'as':_0x90fd('0x51')}]});}return null;})[_0x90fd('0x22')](respondWithResult(_0x5f4645,null))[_0x90fd('0x43')](handleError(_0x5f4645,null));};exports[_0x90fd('0x54')]=function(_0x6a7a62,_0xd1ecc,_0x4d2436){var _0x4c5fd3='';return db['ZendeskAccount']['findOne']({'where':{'id':_0x6a7a62[_0x90fd('0x45')]['id']},'attributes':['id',_0x90fd('0x55'),_0x90fd('0x56'),'token',_0x90fd('0x57'),_0x90fd('0x58')]})['then'](handleEntityNotFound(_0xd1ecc,null))[_0x90fd('0x22')](function(_0x23959f){if(_0x23959f){_0x4c5fd3=_0x23959f[_0x90fd('0x58')];var _0x24ce65=_0x4c5fd3['slice'](-0x1);if(_0x24ce65==='/'){_0x4c5fd3=_0x4c5fd3[_0x90fd('0x59')](0x0,_0x4c5fd3[_0x90fd('0x5a')](_0x24ce65));}var _0x5d08e9={'method':'GET','uri':util['format'](_0x90fd('0x5b'),_0x4c5fd3,'ticket_fields'),'json':!![]};switch(_0x23959f['authType']){case _0x90fd('0x56'):_0x5d08e9['headers']={'Authorization':util[_0x90fd('0x5c')](_0x90fd('0x5d'),new Buffer(util[_0x90fd('0x5c')](_0x90fd('0x5e'),_0x23959f[_0x90fd('0x55')],_0x23959f[_0x90fd('0x56')]))['toString'](_0x90fd('0x5f')))};break;case _0x90fd('0x60'):_0x5d08e9[_0x90fd('0x61')]={'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0x90fd('0x5c')](_0x90fd('0x62'),_0x23959f[_0x90fd('0x55')],_0x23959f[_0x90fd('0x60')]))[_0x90fd('0x63')](_0x90fd('0x5f')))};break;default:throw new db[(_0x90fd('0x64'))][(_0x90fd('0x65'))](_0x90fd('0x66'));}return rp(_0x5d08e9);}})[_0x90fd('0x22')](function(_0x1742b3){if(_0x1742b3){var _0x1547d5=[_0x90fd('0x67'),_0x90fd('0x68'),_0x90fd('0x69'),_0x90fd('0x6a')];_[_0x90fd('0x6b')](_0x1742b3['ticket_fields'],function(_0x2b61ea){return _0x1547d5[_0x90fd('0x6c')](_0x2b61ea[_0x90fd('0x2d')]);});return{'count':_0x1742b3[_0x90fd('0x6d')][_0x90fd('0x36')],'rows':_[_0x90fd('0x2a')](_0x1742b3[_0x90fd('0x6d')],function(_0x4935db){return{'id':_0x4935db['id'],'name':_0x4935db[_0x90fd('0x6e')]>0x7?_0x4935db[_0x90fd('0x6f')]:_0x4935db[_0x90fd('0x2d')],'custom':_0x4935db[_0x90fd('0x6e')]>0x7?!![]:![],'options':_0x4935db['system_field_options']?_0x4935db[_0x90fd('0x70')]:_0x4935db[_0x90fd('0x71')]?_0x4935db[_0x90fd('0x71')]:[]};})};}})[_0x90fd('0x22')](respondWithResult(_0xd1ecc,null))[_0x90fd('0x43')](function(_0x5264f3){var _0x5dd5f0=_0x6a7a62[_0x90fd('0x30')][_0x90fd('0x72')]?0x1f4:_0x5264f3[_0x90fd('0x73')]||0x1f4;logger[_0x90fd('0x25')](_0x90fd('0x74'),_0x90fd('0x54'),_0x5dd5f0,JSON['stringify'](_0x5264f3));delete _0x5264f3[_0x90fd('0x27')];if(_0x5dd5f0===0x191){_0x5dd5f0=0x190;}_0xd1ecc[_0x90fd('0x17')](_0x5dd5f0)[_0x90fd('0x28')](_0x6a7a62[_0x90fd('0x30')][_0x90fd('0x72')]?{'message':_0x90fd('0x75'),'statusCode':_0x5264f3[_0x90fd('0x73')]}:_0x5264f3);});}; \ No newline at end of file +var _0x750a=['crypto','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','save','destroy','then','error','name','index','map','ZendeskAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','type','merge','options','includeAll','include','rows','catch','show','params','find','create','body','ZendeskConfiguration','getConfigurations','addConfiguration','findOne','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','getFields','username','authType','remoteUri','slice','substring','lastIndexOf','GET','ticket_fields','password','headers','format','Basic\x20%s','%s:%s','token','%s/token:%s','toString','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','remove','includes','title','position','system_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0xdd827a,_0x482ad2){var _0x2f46f1=function(_0x221046){while(--_0x221046){_0xdd827a['push'](_0xdd827a['shift']());}};_0x2f46f1(++_0x482ad2);}(_0x750a,0x140));var _0xa750=function(_0x3e2a56,_0x5e3f39){_0x3e2a56=_0x3e2a56-0x0;var _0x4267e9=_0x750a[_0x3e2a56];return _0x4267e9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa750('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa750('0x1'));var moment=require(_0xa750('0x2'));var BPromise=require(_0xa750('0x3'));var Mustache=require(_0xa750('0x4'));var util=require(_0xa750('0x5'));var path=require(_0xa750('0x6'));var sox=require(_0xa750('0x7'));var csv=require(_0xa750('0x8'));var ejs=require(_0xa750('0x9'));var fs=require('fs');var fs_extra=require(_0xa750('0xa'));var _=require(_0xa750('0xb'));var squel=require(_0xa750('0xc'));var crypto=require(_0xa750('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa750('0x8'));var querystring=require('querystring');var Papa=require(_0xa750('0xe'));var Redis=require(_0xa750('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa750('0x10'));var as=require(_0xa750('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa750('0x12'));var utils=require('../../config/utils');var config=require(_0xa750('0x13'));var licenseUtil=require(_0xa750('0x14'));var db=require('../../mysqldb')['db'];var integrations=require(_0xa750('0x15'));function respondWithStatusCode(_0x1c5657,_0x344c67){_0x344c67=_0x344c67||0xcc;return function(_0x567c51){if(_0x567c51){return _0x1c5657[_0xa750('0x16')](_0x344c67);}return _0x1c5657[_0xa750('0x17')](_0x344c67)[_0xa750('0x18')]();};}function respondWithResult(_0x24e48a,_0xa66181){_0xa66181=_0xa66181||0xc8;return function(_0x339329){if(_0x339329){return _0x24e48a['status'](_0xa66181)[_0xa750('0x19')](_0x339329);}};}function respondWithFilteredResult(_0x8488ea,_0x290d46){return function(_0x49fe3b){if(_0x49fe3b){var _0x337095=typeof _0x290d46[_0xa750('0x1a')]==='undefined'&&typeof _0x290d46['limit']===_0xa750('0x1b');var _0x5b1e6b=_0x49fe3b[_0xa750('0x1c')];var _0x1bde87=_0x337095?0x0:_0x290d46['offset'];var _0x36dcca=_0x337095?_0x49fe3b['count']:_0x290d46['offset']+_0x290d46[_0xa750('0x1d')];var _0x5d0935;if(_0x36dcca>=_0x5b1e6b){_0x36dcca=_0x5b1e6b;_0x5d0935=0xc8;}else{_0x5d0935=0xce;}_0x8488ea[_0xa750('0x17')](_0x5d0935);return _0x8488ea['set'](_0xa750('0x1e'),_0x1bde87+'-'+_0x36dcca+'/'+_0x5b1e6b)['json'](_0x49fe3b);}return null;};}function patchUpdates(_0x3dc7f1){return function(_0x500922){try{jsonpatch[_0xa750('0x1f')](_0x500922,_0x3dc7f1,!![]);}catch(_0x4d1939){return BPromise['reject'](_0x4d1939);}return _0x500922[_0xa750('0x20')]();};}function saveUpdates(_0x52da84,_0x216fbf){return function(_0x5a9d96){if(_0x5a9d96){return _0x5a9d96['update'](_0x52da84)['then'](function(_0x5d758e){return _0x5d758e;});}return null;};}function removeEntity(_0x15d72f,_0x2ec6c4){return function(_0x2c43ef){if(_0x2c43ef){return _0x2c43ef[_0xa750('0x21')]()[_0xa750('0x22')](function(){_0x15d72f[_0xa750('0x17')](0xcc)[_0xa750('0x18')]();});}};}function handleEntityNotFound(_0x7e22ad,_0x3d52b3){return function(_0x94697a){if(!_0x94697a){_0x7e22ad[_0xa750('0x16')](0x194);}return _0x94697a;};}function handleError(_0x27a5eb,_0x31ea63){_0x31ea63=_0x31ea63||0x1f4;return function(_0x3f7d6d){logger[_0xa750('0x23')](_0x3f7d6d['stack']);if(_0x3f7d6d[_0xa750('0x24')]){delete _0x3f7d6d[_0xa750('0x24')];}_0x27a5eb[_0xa750('0x17')](_0x31ea63)['send'](_0x3f7d6d);};}exports[_0xa750('0x25')]=function(_0x6ade2b,_0x3270e3){var _0x1223d2={},_0x579f1c={},_0x297eef={'count':0x0,'rows':[]};var _0x34d5e9=_[_0xa750('0x26')](db[_0xa750('0x27')][_0xa750('0x28')],function(_0x59ab33){return{'name':_0x59ab33[_0xa750('0x29')],'type':_0x59ab33['type'][_0xa750('0x2a')]};});_0x579f1c[_0xa750('0x2b')]=_['map'](_0x34d5e9,_0xa750('0x24'));_0x579f1c[_0xa750('0x2c')]=_[_0xa750('0x2d')](_0x6ade2b[_0xa750('0x2c')]);_0x579f1c[_0xa750('0x2e')]=_[_0xa750('0x2f')](_0x579f1c[_0xa750('0x2b')],_0x579f1c[_0xa750('0x2c')]);_0x1223d2['attributes']=_[_0xa750('0x2f')](_0x579f1c['model'],qs[_0xa750('0x30')](_0x6ade2b[_0xa750('0x2c')][_0xa750('0x30')]));_0x1223d2[_0xa750('0x31')]=_0x1223d2['attributes'][_0xa750('0x32')]?_0x1223d2[_0xa750('0x31')]:_0x579f1c['model'];if(!_0x6ade2b[_0xa750('0x2c')][_0xa750('0x33')](_0xa750('0x34'))){_0x1223d2[_0xa750('0x1d')]=qs['limit'](_0x6ade2b[_0xa750('0x2c')]['limit']);_0x1223d2['offset']=qs[_0xa750('0x1a')](_0x6ade2b[_0xa750('0x2c')][_0xa750('0x1a')]);}_0x1223d2['order']=qs[_0xa750('0x35')](_0x6ade2b[_0xa750('0x2c')][_0xa750('0x35')]);_0x1223d2['where']=qs[_0xa750('0x2e')](_[_0xa750('0x36')](_0x6ade2b[_0xa750('0x2c')],_0x579f1c['filters']),_0x34d5e9);if(_0x6ade2b[_0xa750('0x2c')][_0xa750('0x37')]){_0x1223d2[_0xa750('0x38')]=_['merge'](_0x1223d2[_0xa750('0x38')],{'$or':_[_0xa750('0x26')](_0x34d5e9,function(_0x1e579b){if(_0x1e579b[_0xa750('0x39')]!=='VIRTUAL'){var _0x4dc0b8={};_0x4dc0b8[_0x1e579b[_0xa750('0x24')]]={'$like':'%'+_0x6ade2b[_0xa750('0x2c')]['filter']+'%'};return _0x4dc0b8;}})});}_0x1223d2=_[_0xa750('0x3a')]({},_0x1223d2,_0x6ade2b[_0xa750('0x3b')]);var _0x15d35a={'where':_0x1223d2[_0xa750('0x38')]};return db[_0xa750('0x27')]['count'](_0x15d35a)[_0xa750('0x22')](function(_0x2b33e0){_0x297eef[_0xa750('0x1c')]=_0x2b33e0;if(_0x6ade2b[_0xa750('0x2c')][_0xa750('0x3c')]){_0x1223d2[_0xa750('0x3d')]=[{'all':!![]}];}return db[_0xa750('0x27')]['findAll'](_0x1223d2);})[_0xa750('0x22')](function(_0x5e9ffb){_0x297eef[_0xa750('0x3e')]=_0x5e9ffb;return _0x297eef;})['then'](respondWithFilteredResult(_0x3270e3,_0x1223d2))[_0xa750('0x3f')](handleError(_0x3270e3,null));};exports[_0xa750('0x40')]=function(_0xf9fd5f,_0x1be24e){var _0x430d60={'raw':![],'where':{'id':_0xf9fd5f[_0xa750('0x41')]['id']}},_0xe27272={};_0xe27272[_0xa750('0x2b')]=_[_0xa750('0x2d')](db[_0xa750('0x27')][_0xa750('0x28')]);_0xe27272[_0xa750('0x2c')]=_[_0xa750('0x2d')](_0xf9fd5f[_0xa750('0x2c')]);_0xe27272[_0xa750('0x2e')]=_[_0xa750('0x2f')](_0xe27272[_0xa750('0x2b')],_0xe27272[_0xa750('0x2c')]);_0x430d60[_0xa750('0x31')]=_[_0xa750('0x2f')](_0xe27272['model'],qs[_0xa750('0x30')](_0xf9fd5f[_0xa750('0x2c')][_0xa750('0x30')]));_0x430d60[_0xa750('0x31')]=_0x430d60[_0xa750('0x31')][_0xa750('0x32')]?_0x430d60[_0xa750('0x31')]:_0xe27272[_0xa750('0x2b')];if(_0xf9fd5f[_0xa750('0x2c')]['includeAll']){_0x430d60[_0xa750('0x3d')]=[{'all':!![]}];}_0x430d60=_[_0xa750('0x3a')]({},_0x430d60,_0xf9fd5f['options']);return db[_0xa750('0x27')][_0xa750('0x42')](_0x430d60)[_0xa750('0x22')](handleEntityNotFound(_0x1be24e,null))[_0xa750('0x22')](respondWithResult(_0x1be24e,null))[_0xa750('0x3f')](handleError(_0x1be24e,null));};exports[_0xa750('0x43')]=function(_0x5e7a95,_0x278c22){return db[_0xa750('0x27')][_0xa750('0x43')](_0x5e7a95['body'],{})[_0xa750('0x22')](respondWithResult(_0x278c22,0xc9))[_0xa750('0x3f')](handleError(_0x278c22,null));};exports['update']=function(_0x93e49f,_0x2397e1){if(_0x93e49f[_0xa750('0x44')]['id']){delete _0x93e49f['body']['id'];}return db[_0xa750('0x27')][_0xa750('0x42')]({'where':{'id':_0x93e49f[_0xa750('0x41')]['id']}})[_0xa750('0x22')](handleEntityNotFound(_0x2397e1,null))['then'](saveUpdates(_0x93e49f[_0xa750('0x44')],null))[_0xa750('0x22')](respondWithResult(_0x2397e1,null))[_0xa750('0x3f')](handleError(_0x2397e1,null));};exports[_0xa750('0x21')]=function(_0x4ce363,_0x203f2a){return db[_0xa750('0x27')]['find']({'where':{'id':_0x4ce363[_0xa750('0x41')]['id']}})['then'](handleEntityNotFound(_0x203f2a,null))[_0xa750('0x22')](removeEntity(_0x203f2a,null))[_0xa750('0x3f')](handleError(_0x203f2a,null));};exports['getConfigurations']=function(_0x47e93c,_0x58eba1,_0x232da4){var _0x401125={};var _0x4ea12b={};var _0xe88dc;var _0x1a79a9;return db[_0xa750('0x27')]['findOne']({'where':{'id':_0x47e93c['params']['id']}})['then'](handleEntityNotFound(_0x58eba1,null))['then'](function(_0x3c34d4){if(_0x3c34d4){_0xe88dc=_0x3c34d4;_0x4ea12b['model']=_[_0xa750('0x2d')](db[_0xa750('0x45')]['rawAttributes']);_0x4ea12b[_0xa750('0x2c')]=_['keys'](_0x47e93c[_0xa750('0x2c')]);_0x4ea12b['filters']=_['intersection'](_0x4ea12b['model'],_0x4ea12b['query']);_0x401125[_0xa750('0x31')]=_[_0xa750('0x2f')](_0x4ea12b['model'],qs['fields'](_0x47e93c['query'][_0xa750('0x30')]));_0x401125[_0xa750('0x31')]=_0x401125[_0xa750('0x31')][_0xa750('0x32')]?_0x401125[_0xa750('0x31')]:_0x4ea12b[_0xa750('0x2b')];_0x401125['order']=qs['sort'](_0x47e93c[_0xa750('0x2c')][_0xa750('0x35')]);_0x401125[_0xa750('0x38')]=qs[_0xa750('0x2e')](_[_0xa750('0x36')](_0x47e93c['query'],_0x4ea12b[_0xa750('0x2e')]));if(_0x47e93c[_0xa750('0x2c')][_0xa750('0x37')]){_0x401125[_0xa750('0x38')]=_[_0xa750('0x3a')](_0x401125[_0xa750('0x38')],{'$or':_[_0xa750('0x26')](_0x401125[_0xa750('0x31')],function(_0x5e78f1){var _0x2aa1d6={};_0x2aa1d6[_0x5e78f1]={'$like':'%'+_0x47e93c[_0xa750('0x2c')][_0xa750('0x37')]+'%'};return _0x2aa1d6;})});}_0x401125=_[_0xa750('0x3a')]({},_0x401125,_0x47e93c[_0xa750('0x3b')]);return _0xe88dc['getConfigurations'](_0x401125);}})[_0xa750('0x22')](function(_0x25248f){if(_0x25248f){_0x1a79a9=_0x25248f[_0xa750('0x32')];if(!_0x47e93c[_0xa750('0x2c')][_0xa750('0x33')](_0xa750('0x34'))){_0x401125[_0xa750('0x1d')]=qs[_0xa750('0x1d')](_0x47e93c[_0xa750('0x2c')][_0xa750('0x1d')]);_0x401125[_0xa750('0x1a')]=qs[_0xa750('0x1a')](_0x47e93c[_0xa750('0x2c')][_0xa750('0x1a')]);}return _0xe88dc[_0xa750('0x46')](_0x401125);}})[_0xa750('0x22')](function(_0x49e132){if(_0x49e132){return _0x49e132?{'count':_0x1a79a9,'rows':_0x49e132}:null;}})[_0xa750('0x22')](respondWithResult(_0x58eba1,null))['catch'](handleError(_0x58eba1,null));};exports[_0xa750('0x47')]=function(_0x2d488d,_0xbe7451,_0x5845c5){if(_0x2d488d[_0xa750('0x44')]['id']){delete _0x2d488d[_0xa750('0x44')]['id'];}return db[_0xa750('0x27')][_0xa750('0x48')]({'where':{'id':_0x2d488d[_0xa750('0x41')]['id']}})[_0xa750('0x22')](handleEntityNotFound(_0xbe7451,null))['then'](function(_0x3001d7){if(_0x3001d7){_0x2d488d[_0xa750('0x44')]['AccountId']=_0x3001d7['id'];_0x2d488d[_0xa750('0x44')][_0xa750('0x49')]=integrations[_0xa750('0x4a')](_0x2d488d[_0xa750('0x44')][_0xa750('0x4b')],_0x2d488d[_0xa750('0x44')][_0xa750('0x39')]);_0x2d488d[_0xa750('0x44')][_0xa750('0x4c')]=integrations[_0xa750('0x4d')](_0x2d488d[_0xa750('0x44')]['channel'],_0x2d488d['body'][_0xa750('0x39')]);return db[_0xa750('0x45')][_0xa750('0x43')](_0x2d488d[_0xa750('0x44')],{'include':[{'model':db['ZendeskField'],'as':_0xa750('0x49')},{'model':db[_0xa750('0x4e')],'as':_0xa750('0x4c')}]});}return null;})[_0xa750('0x22')](respondWithResult(_0xbe7451,null))[_0xa750('0x3f')](handleError(_0xbe7451,null));};exports[_0xa750('0x4f')]=function(_0x17b25e,_0x5d883d,_0x1dcc15){var _0x2783b9='';return db[_0xa750('0x27')]['findOne']({'where':{'id':_0x17b25e['params']['id']},'attributes':['id',_0xa750('0x50'),'password','token',_0xa750('0x51'),_0xa750('0x52')]})[_0xa750('0x22')](handleEntityNotFound(_0x5d883d,null))[_0xa750('0x22')](function(_0x292dab){if(_0x292dab){_0x2783b9=_0x292dab['remoteUri'];var _0x3ac9a2=_0x2783b9[_0xa750('0x53')](-0x1);if(_0x3ac9a2==='/'){_0x2783b9=_0x2783b9[_0xa750('0x54')](0x0,_0x2783b9[_0xa750('0x55')](_0x3ac9a2));}var _0x439dce={'method':_0xa750('0x56'),'uri':util['format']('%s/%s',_0x2783b9,_0xa750('0x57')),'json':!![]};switch(_0x292dab[_0xa750('0x51')]){case _0xa750('0x58'):_0x439dce[_0xa750('0x59')]={'Authorization':util[_0xa750('0x5a')](_0xa750('0x5b'),new Buffer(util[_0xa750('0x5a')](_0xa750('0x5c'),_0x292dab['username'],_0x292dab[_0xa750('0x58')]))['toString']('base64'))};break;case _0xa750('0x5d'):_0x439dce[_0xa750('0x59')]={'Authorization':util[_0xa750('0x5a')](_0xa750('0x5b'),new Buffer(util['format'](_0xa750('0x5e'),_0x292dab[_0xa750('0x50')],_0x292dab[_0xa750('0x5d')]))[_0xa750('0x5f')]('base64'))};break;default:throw new db[(_0xa750('0x60'))][(_0xa750('0x61'))](_0xa750('0x62'));}return rp(_0x439dce);}})[_0xa750('0x22')](function(_0x332862){if(_0x332862){var _0x14de1b=[_0xa750('0x63'),_0xa750('0x64'),'group','assignee'];_[_0xa750('0x65')](_0x332862['ticket_fields'],function(_0x2c4114){return _0x14de1b[_0xa750('0x66')](_0x2c4114['type']);});return{'count':_0x332862[_0xa750('0x57')]['length'],'rows':_[_0xa750('0x26')](_0x332862[_0xa750('0x57')],function(_0x77110){return{'id':_0x77110['id'],'name':_0x77110['position']>0x7?_0x77110[_0xa750('0x67')]:_0x77110[_0xa750('0x39')],'custom':_0x77110[_0xa750('0x68')]>0x7?!![]:![],'options':_0x77110[_0xa750('0x69')]?_0x77110['system_field_options']:_0x77110['custom_field_options']?_0x77110['custom_field_options']:[]};})};}})[_0xa750('0x22')](respondWithResult(_0x5d883d,null))[_0xa750('0x3f')](function(_0x5387dc){var _0x12cae9=_0x17b25e[_0xa750('0x2c')][_0xa750('0x6a')]?0x1f4:_0x5387dc[_0xa750('0x6b')]||0x1f4;logger[_0xa750('0x23')](_0xa750('0x6c'),'getFields',_0x12cae9,JSON[_0xa750('0x6d')](_0x5387dc));delete _0x5387dc[_0xa750('0x24')];if(_0x12cae9===0x191){_0x12cae9=0x190;}_0x5d883d[_0xa750('0x17')](_0x12cae9)['send'](_0x17b25e[_0xa750('0x2c')][_0xa750('0x6a')]?{'message':_0xa750('0x6e'),'statusCode':_0x5387dc[_0xa750('0x6b')]}:_0x5387dc);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index f765343..def8a77 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 _0x5523=['bluebird','request-promise','path','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5523,0x14e));var _0x3552=function(_0x441a88,_0xa54bc5){_0x441a88=_0x441a88-0x0;var _0x2229d5=_0x5523[_0x441a88];return _0x2229d5;};'use strict';var _=require(_0x3552('0x0'));var util=require(_0x3552('0x1'));var logger=require(_0x3552('0x2'))('api');var moment=require(_0x3552('0x3'));var BPromise=require(_0x3552('0x4'));var rp=require(_0x3552('0x5'));var fs=require('fs');var path=require(_0x3552('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3552('0x7'));var integrations=require(_0x3552('0x8'));module[_0x3552('0x9')]=function(_0x5134b2,_0x570822){return _0x5134b2[_0x3552('0xa')](_0x3552('0xb'),attributes,{'tableName':_0x3552('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xed66=['int_zendesk_accounts','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','define','ZendeskAccount'];(function(_0x3722d2,_0x206336){var _0x15ae66=function(_0x1bd4ab){while(--_0x1bd4ab){_0x3722d2['push'](_0x3722d2['shift']());}};_0x15ae66(++_0x206336);}(_0xed66,0x135));var _0x6ed6=function(_0x4e7844,_0x30ce77){_0x4e7844=_0x4e7844-0x0;var _0x336119=_0xed66[_0x4e7844];return _0x336119;};'use strict';var _=require('lodash');var util=require(_0x6ed6('0x0'));var logger=require(_0x6ed6('0x1'))(_0x6ed6('0x2'));var moment=require(_0x6ed6('0x3'));var BPromise=require(_0x6ed6('0x4'));var rp=require(_0x6ed6('0x5'));var fs=require('fs');var path=require(_0x6ed6('0x6'));var rimraf=require(_0x6ed6('0x7'));var config=require(_0x6ed6('0x8'));var attributes=require(_0x6ed6('0x9'));var integrations=require(_0x6ed6('0xa'));module['exports']=function(_0x4fbe9c,_0x5a894d){return _0x4fbe9c[_0x6ed6('0xb')](_0x6ed6('0xc'),attributes,{'tableName':_0x6ed6('0xd'),'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 dc59774..26daf2f 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 _0x184e=['request\x20sent','stringify','error','code','message','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','debug','ShowZendeskAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','ZendeskAccount,\x20%s,\x20%s','ZendeskAccount,\x20%s,\x20%s,\x20%s'];(function(_0x408c04,_0x137cb9){var _0x4aa1b8=function(_0xf5ac3){while(--_0xf5ac3){_0x408c04['push'](_0x408c04['shift']());}};_0x4aa1b8(++_0x137cb9);}(_0x184e,0x1a0));var _0xe184=function(_0x1cd674,_0x8d3638){_0x1cd674=_0x1cd674-0x0;var _0x27928f=_0x184e[_0x1cd674];return _0x27928f;};'use strict';var _=require(_0xe184('0x0'));var util=require(_0xe184('0x1'));var moment=require(_0xe184('0x2'));var BPromise=require(_0xe184('0x3'));var rs=require(_0xe184('0x4'));var fs=require('fs');var Redis=require(_0xe184('0x5'));var db=require(_0xe184('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xe184('0x7'))(_0xe184('0x8'));var config=require(_0xe184('0x9'));var jayson=require(_0xe184('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4d0a6e,_0x4d0857,_0x5cb03c){return new BPromise(function(_0x37691f,_0x294514){return client[_0xe184('0xb')](_0x4d0a6e,_0x5cb03c)[_0xe184('0xc')](function(_0x2373bf){logger[_0xe184('0xd')](_0xe184('0xe'),_0x4d0857,'request\x20sent');logger['debug'](_0xe184('0xf'),_0x4d0857,_0xe184('0x10'),JSON[_0xe184('0x11')](_0x2373bf));if(_0x2373bf[_0xe184('0x12')]){if(_0x2373bf['error'][_0xe184('0x13')]===0x1f4){logger[_0xe184('0x12')](_0xe184('0xe'),_0x4d0857,_0x2373bf['error'][_0xe184('0x14')]);return _0x294514(_0x2373bf[_0xe184('0x12')][_0xe184('0x14')]);}logger['error'](_0xe184('0xe'),_0x4d0857,_0x2373bf[_0xe184('0x12')]['message']);return _0x37691f(_0x2373bf['error'][_0xe184('0x14')]);}else{logger[_0xe184('0xd')]('ZendeskAccount,\x20%s,\x20%s',_0x4d0857,_0xe184('0x10'));_0x37691f(_0x2373bf['result'][_0xe184('0x14')]);}})[_0xe184('0x15')](function(_0x3b1347){logger['error'](_0xe184('0xe'),_0x4d0857,_0x3b1347);_0x294514(_0x3b1347);});});}exports[_0xe184('0x16')]=function(_0x2ed8fe){var _0x21548a=this;return new Promise(function(_0x96654,_0x1a474b){return db[_0xe184('0x17')][_0xe184('0x18')]({'raw':_0x2ed8fe[_0xe184('0x19')]?_0x2ed8fe[_0xe184('0x19')][_0xe184('0x1a')]===undefined?!![]:![]:!![],'where':_0x2ed8fe['options']?_0x2ed8fe['options'][_0xe184('0x1b')]||null:null,'attributes':_0x2ed8fe[_0xe184('0x19')]?_0x2ed8fe[_0xe184('0x19')][_0xe184('0x1c')]||null:null,'limit':_0x2ed8fe[_0xe184('0x19')]?_0x2ed8fe['options'][_0xe184('0x1d')]||null:null,'include':_0x2ed8fe[_0xe184('0x19')]?_0x2ed8fe['options'][_0xe184('0x1e')]?_[_0xe184('0x1f')](_0x2ed8fe[_0xe184('0x19')][_0xe184('0x1e')],function(_0x319b97){return{'model':db[_0x319b97['model']],'as':_0x319b97['as'],'attributes':_0x319b97[_0xe184('0x1c')],'include':_0x319b97['include']?_[_0xe184('0x1f')](_0x319b97[_0xe184('0x1e')],function(_0x3f5d65){return{'model':db[_0x3f5d65[_0xe184('0x20')]],'as':_0x3f5d65['as'],'attributes':_0x3f5d65[_0xe184('0x1c')],'include':_0x3f5d65[_0xe184('0x1e')]?_[_0xe184('0x1f')](_0x3f5d65[_0xe184('0x1e')],function(_0x12895f){return{'model':db[_0x12895f[_0xe184('0x20')]],'as':_0x12895f['as'],'attributes':_0x12895f[_0xe184('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xe184('0xc')](function(_0x362487){logger[_0xe184('0xd')](_0xe184('0x16'),_0x2ed8fe);logger[_0xe184('0x21')]('GetZendeskAccount',_0x2ed8fe,JSON[_0xe184('0x11')](_0x362487));_0x96654(_0x362487);})[_0xe184('0x15')](function(_0x5ac76b){logger[_0xe184('0x12')](_0xe184('0x16'),_0x5ac76b[_0xe184('0x14')],_0x2ed8fe);_0x1a474b(_0x21548a[_0xe184('0x12')](0x1f4,_0x5ac76b[_0xe184('0x14')]));});});};exports[_0xe184('0x22')]=function(_0x2132c0){var _0x2dd9e4=this;return new Promise(function(_0x58f62b,_0x405746){return db[_0xe184('0x17')][_0xe184('0x23')]({'raw':_0x2132c0['options']?_0x2132c0[_0xe184('0x19')][_0xe184('0x1a')]===undefined?!![]:![]:!![],'where':_0x2132c0['options']?_0x2132c0[_0xe184('0x19')][_0xe184('0x1b')]||null:null,'attributes':_0x2132c0[_0xe184('0x19')]?_0x2132c0['options'][_0xe184('0x1c')]||null:null,'include':_0x2132c0[_0xe184('0x19')]?_0x2132c0[_0xe184('0x19')][_0xe184('0x1e')]?_[_0xe184('0x1f')](_0x2132c0['options'][_0xe184('0x1e')],function(_0x34e3a7){return{'model':db[_0x34e3a7[_0xe184('0x20')]],'as':_0x34e3a7['as'],'attributes':_0x34e3a7[_0xe184('0x1c')],'include':_0x34e3a7['include']?_['map'](_0x34e3a7[_0xe184('0x1e')],function(_0x114792){return{'model':db[_0x114792['model']],'as':_0x114792['as'],'attributes':_0x114792[_0xe184('0x1c')],'include':_0x114792['include']?_[_0xe184('0x1f')](_0x114792[_0xe184('0x1e')],function(_0x20d889){return{'model':db[_0x20d889[_0xe184('0x20')]],'as':_0x20d889['as'],'attributes':_0x20d889[_0xe184('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xe184('0xc')](function(_0x57ebc4){logger['info']('ShowZendeskAccount',_0x2132c0);logger['debug'](_0xe184('0x22'),_0x2132c0,JSON[_0xe184('0x11')](_0x57ebc4));_0x58f62b(_0x57ebc4);})[_0xe184('0x15')](function(_0x5cd84d){logger['error'](_0xe184('0x22'),_0x5cd84d[_0xe184('0x14')],_0x2132c0);_0x405746(_0x2dd9e4[_0xe184('0x12')](0x1f4,_0x5cd84d[_0xe184('0x14')]));});});}; \ No newline at end of file +var _0x05e4=['request','then','info','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','ZendeskAccount,\x20%s,\x20%s','message','catch','ZendeskAccount','options','raw','attributes','limit','include','map','model','GetZendeskAccount','find','where','ShowZendeskAccount','lodash','util','bluebird','../../mysqldb','../../config/utils','jayson/promise'];(function(_0x3fba9f,_0x3b7b9b){var _0x192cf1=function(_0x557290){while(--_0x557290){_0x3fba9f['push'](_0x3fba9f['shift']());}};_0x192cf1(++_0x3b7b9b);}(_0x05e4,0x173));var _0x405e=function(_0x2ebec1,_0x4a76dd){_0x2ebec1=_0x2ebec1-0x0;var _0xb0d3fb=_0x05e4[_0x2ebec1];return _0xb0d3fb;};'use strict';var _=require(_0x405e('0x0'));var util=require(_0x405e('0x1'));var moment=require('moment');var BPromise=require(_0x405e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x405e('0x3'))['db'];var utils=require(_0x405e('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x405e('0x5'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1a0d80,_0x3c0f18,_0x28c8c5){return new BPromise(function(_0x4d2be5,_0x40379e){return client[_0x405e('0x6')](_0x1a0d80,_0x28c8c5)[_0x405e('0x7')](function(_0x44a1a1){logger[_0x405e('0x8')]('ZendeskAccount,\x20%s,\x20%s',_0x3c0f18,_0x405e('0x9'));logger[_0x405e('0xa')](_0x405e('0xb'),_0x3c0f18,'request\x20sent',JSON[_0x405e('0xc')](_0x44a1a1));if(_0x44a1a1[_0x405e('0xd')]){if(_0x44a1a1[_0x405e('0xd')]['code']===0x1f4){logger['error'](_0x405e('0xe'),_0x3c0f18,_0x44a1a1[_0x405e('0xd')]['message']);return _0x40379e(_0x44a1a1['error'][_0x405e('0xf')]);}logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x3c0f18,_0x44a1a1[_0x405e('0xd')][_0x405e('0xf')]);return _0x4d2be5(_0x44a1a1['error'][_0x405e('0xf')]);}else{logger[_0x405e('0x8')](_0x405e('0xe'),_0x3c0f18,'request\x20sent');_0x4d2be5(_0x44a1a1['result'][_0x405e('0xf')]);}})[_0x405e('0x10')](function(_0x1139b2){logger['error'](_0x405e('0xe'),_0x3c0f18,_0x1139b2);_0x40379e(_0x1139b2);});});}exports['GetZendeskAccount']=function(_0x1ae87c){var _0x17abab=this;return new Promise(function(_0x30e3d9,_0x3001cf){return db[_0x405e('0x11')]['findAll']({'raw':_0x1ae87c[_0x405e('0x12')]?_0x1ae87c[_0x405e('0x12')][_0x405e('0x13')]===undefined?!![]:![]:!![],'where':_0x1ae87c['options']?_0x1ae87c[_0x405e('0x12')]['where']||null:null,'attributes':_0x1ae87c[_0x405e('0x12')]?_0x1ae87c['options'][_0x405e('0x14')]||null:null,'limit':_0x1ae87c[_0x405e('0x12')]?_0x1ae87c[_0x405e('0x12')][_0x405e('0x15')]||null:null,'include':_0x1ae87c[_0x405e('0x12')]?_0x1ae87c[_0x405e('0x12')][_0x405e('0x16')]?_[_0x405e('0x17')](_0x1ae87c[_0x405e('0x12')][_0x405e('0x16')],function(_0x41c16e){return{'model':db[_0x41c16e[_0x405e('0x18')]],'as':_0x41c16e['as'],'attributes':_0x41c16e[_0x405e('0x14')],'include':_0x41c16e[_0x405e('0x16')]?_[_0x405e('0x17')](_0x41c16e[_0x405e('0x16')],function(_0x11fb78){return{'model':db[_0x11fb78[_0x405e('0x18')]],'as':_0x11fb78['as'],'attributes':_0x11fb78['attributes'],'include':_0x11fb78[_0x405e('0x16')]?_[_0x405e('0x17')](_0x11fb78[_0x405e('0x16')],function(_0x2ed81e){return{'model':db[_0x2ed81e['model']],'as':_0x2ed81e['as'],'attributes':_0x2ed81e[_0x405e('0x14')]};}):[]};}):[]};}):[]:[]})[_0x405e('0x7')](function(_0x1a71ce){logger[_0x405e('0x8')](_0x405e('0x19'),_0x1ae87c);logger[_0x405e('0xa')](_0x405e('0x19'),_0x1ae87c,JSON['stringify'](_0x1a71ce));_0x30e3d9(_0x1a71ce);})[_0x405e('0x10')](function(_0x293f6b){logger['error'](_0x405e('0x19'),_0x293f6b[_0x405e('0xf')],_0x1ae87c);_0x3001cf(_0x17abab[_0x405e('0xd')](0x1f4,_0x293f6b[_0x405e('0xf')]));});});};exports['ShowZendeskAccount']=function(_0x361330){var _0x24dc6d=this;return new Promise(function(_0x1ea7ac,_0x17db16){return db['ZendeskAccount'][_0x405e('0x1a')]({'raw':_0x361330[_0x405e('0x12')]?_0x361330[_0x405e('0x12')][_0x405e('0x13')]===undefined?!![]:![]:!![],'where':_0x361330[_0x405e('0x12')]?_0x361330[_0x405e('0x12')][_0x405e('0x1b')]||null:null,'attributes':_0x361330[_0x405e('0x12')]?_0x361330['options'][_0x405e('0x14')]||null:null,'include':_0x361330[_0x405e('0x12')]?_0x361330[_0x405e('0x12')][_0x405e('0x16')]?_['map'](_0x361330['options'][_0x405e('0x16')],function(_0x32a055){return{'model':db[_0x32a055['model']],'as':_0x32a055['as'],'attributes':_0x32a055[_0x405e('0x14')],'include':_0x32a055[_0x405e('0x16')]?_['map'](_0x32a055['include'],function(_0x1f46e2){return{'model':db[_0x1f46e2[_0x405e('0x18')]],'as':_0x1f46e2['as'],'attributes':_0x1f46e2[_0x405e('0x14')],'include':_0x1f46e2[_0x405e('0x16')]?_[_0x405e('0x17')](_0x1f46e2['include'],function(_0x8ca000){return{'model':db[_0x8ca000[_0x405e('0x18')]],'as':_0x8ca000['as'],'attributes':_0x8ca000[_0x405e('0x14')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4e9e39){logger['info'](_0x405e('0x1c'),_0x361330);logger[_0x405e('0xa')]('ShowZendeskAccount',_0x361330,JSON[_0x405e('0xc')](_0x4e9e39));_0x1ea7ac(_0x4e9e39);})[_0x405e('0x10')](function(_0x5b952e){logger[_0x405e('0xd')](_0x405e('0x1c'),_0x5b952e['message'],_0x361330);_0x17db16(_0x24dc6d['error'](0x1f4,_0x5b952e['message']));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 055f62d..e44f7ba 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 _0xda3f=['../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','/:id/tags','post','create','put','destroy','exports','util','path','fs-extra','../../components/interaction/service'];(function(_0x4f97e8,_0x1131e5){var _0xbf0bef=function(_0xa59828){while(--_0xa59828){_0x4f97e8['push'](_0x4f97e8['shift']());}};_0xbf0bef(++_0x1131e5);}(_0xda3f,0xec));var _0xfda3=function(_0x3b8cd1,_0x502501){_0x3b8cd1=_0x3b8cd1-0x0;var _0x297f49=_0xda3f[_0x3b8cd1];return _0x297f49;};'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('./intZendeskConfiguration.controller');router[_0xfda3('0x5')]('/',auth[_0xfda3('0x6')](),controller['index']);router['get'](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0x8')]);router[_0xfda3('0x5')](_0xfda3('0x9'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xa')]);router[_0xfda3('0x5')](_0xfda3('0xb'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xc')]);router[_0xfda3('0x5')]('/:id/descriptions',auth[_0xfda3('0x6')](),controller[_0xfda3('0xd')]);router[_0xfda3('0x5')](_0xfda3('0xe'),auth[_0xfda3('0x6')](),controller['getTags']);router[_0xfda3('0xf')]('/',auth['isAuthenticated'](),controller[_0xfda3('0x10')]);router[_0xfda3('0xf')]('/:id/tags',auth['isAuthenticated'](),controller['setTags']);router[_0xfda3('0x11')](_0xfda3('0x7'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0x12')]);module[_0xfda3('0x13')]=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(_0x28e74e,_0x53fdf1){var _0xb45ac1=function(_0x311a7a){while(--_0x311a7a){_0x28e74e['push'](_0x28e74e['shift']());}};_0xb45ac1(++_0x53fdf1);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x4ca922,_0x11f8d6){_0x4ca922=_0x4ca922-0x0;var _0x3feb75=_0xbdb7[_0x4ca922];return _0x3feb75;};'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 56518d3..e25dced 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 _0x6777=['exports','STRING','sequelize'];(function(_0x34f05b,_0x3b4069){var _0x567602=function(_0x56604a){while(--_0x56604a){_0x34f05b['push'](_0x34f05b['shift']());}};_0x567602(++_0x3b4069);}(_0x6777,0xa4));var _0x7677=function(_0x27ddf5,_0x5a3e18){_0x27ddf5=_0x27ddf5-0x0;var _0x26e74a=_0x6777[_0x27ddf5];return _0x26e74a;};'use strict';var Sequelize=require(_0x7677('0x0'));module[_0x7677('0x1')]={'name':{'type':Sequelize[_0x7677('0x2')]},'description':{'type':Sequelize[_0x7677('0x2')]}}; \ No newline at end of file +var _0x9e13=['STRING','sequelize','exports'];(function(_0x35a2bd,_0x6d17e2){var _0x399726=function(_0x76a1b8){while(--_0x76a1b8){_0x35a2bd['push'](_0x35a2bd['shift']());}};_0x399726(++_0x6d17e2);}(_0x9e13,0xf7));var _0x39e1=function(_0x586273,_0x25c84a){_0x586273=_0x586273-0x0;var _0x178059=_0x9e13[_0x586273];return _0x178059;};'use strict';var Sequelize=require(_0x39e1('0x0'));module[_0x39e1('0x1')]={'name':{'type':Sequelize[_0x39e1('0x2')]},'description':{'type':Sequelize[_0x39e1('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index be1181b..cc6beb7 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 _0x9d93=['model','query','filters','intersection','fields','attributes','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','catch','show','params','keys','body','find','findOne','ZendeskField','length','getFields','hasOwnProperty','nolimit','getSubjects','getDescriptions','Tag','getTags','setTags','ids','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','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','sendStatus','end','json','offset','undefined','limit','count','status','set','reject','save','update','then','destroy','error','stack','name','send','index','map','ZendeskConfiguration','rawAttributes','fieldName','type','key'];(function(_0x17b0d4,_0x377add){var _0x2d02c7=function(_0x56e627){while(--_0x56e627){_0x17b0d4['push'](_0x17b0d4['shift']());}};_0x2d02c7(++_0x377add);}(_0x9d93,0xce));var _0x39d9=function(_0x39b206,_0x19f860){_0x39b206=_0x39b206-0x0;var _0x84d2b5=_0x9d93[_0x39b206];return _0x84d2b5;};'use strict';var emlformat=require(_0x39d9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x39d9('0x1'));var jsonpatch=require(_0x39d9('0x2'));var rp=require(_0x39d9('0x3'));var moment=require(_0x39d9('0x4'));var BPromise=require(_0x39d9('0x5'));var Mustache=require(_0x39d9('0x6'));var util=require(_0x39d9('0x7'));var path=require(_0x39d9('0x8'));var sox=require(_0x39d9('0x9'));var csv=require(_0x39d9('0xa'));var ejs=require(_0x39d9('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x39d9('0xc'));var squel=require(_0x39d9('0xd'));var crypto=require(_0x39d9('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x39d9('0xf'));var toCsv=require(_0x39d9('0xa'));var querystring=require('querystring');var Papa=require(_0x39d9('0x10'));var Redis=require(_0x39d9('0x11'));var authService=require(_0x39d9('0x12'));var qs=require(_0x39d9('0x13'));var as=require(_0x39d9('0x14'));var hardwareService=require(_0x39d9('0x15'));var logger=require(_0x39d9('0x16'))('api');var utils=require(_0x39d9('0x17'));var config=require(_0x39d9('0x18'));var licenseUtil=require(_0x39d9('0x19'));var db=require(_0x39d9('0x1a'))['db'];function respondWithStatusCode(_0x4e7e9b,_0xd0dae){_0xd0dae=_0xd0dae||0xcc;return function(_0x2a4540){if(_0x2a4540){return _0x4e7e9b[_0x39d9('0x1b')](_0xd0dae);}return _0x4e7e9b['status'](_0xd0dae)[_0x39d9('0x1c')]();};}function respondWithResult(_0x4da4e8,_0x1e63bc){_0x1e63bc=_0x1e63bc||0xc8;return function(_0x2b6e59){if(_0x2b6e59){return _0x4da4e8['status'](_0x1e63bc)[_0x39d9('0x1d')](_0x2b6e59);}};}function respondWithFilteredResult(_0x1b0ff2,_0x4e7965){return function(_0xf23bb3){if(_0xf23bb3){var _0x3a693f=typeof _0x4e7965[_0x39d9('0x1e')]===_0x39d9('0x1f')&&typeof _0x4e7965[_0x39d9('0x20')]===_0x39d9('0x1f');var _0x266b46=_0xf23bb3[_0x39d9('0x21')];var _0x3ef247=_0x3a693f?0x0:_0x4e7965[_0x39d9('0x1e')];var _0x2dfd91=_0x3a693f?_0xf23bb3['count']:_0x4e7965[_0x39d9('0x1e')]+_0x4e7965[_0x39d9('0x20')];var _0x2a3090;if(_0x2dfd91>=_0x266b46){_0x2dfd91=_0x266b46;_0x2a3090=0xc8;}else{_0x2a3090=0xce;}_0x1b0ff2[_0x39d9('0x22')](_0x2a3090);return _0x1b0ff2[_0x39d9('0x23')]('Content-Range',_0x3ef247+'-'+_0x2dfd91+'/'+_0x266b46)[_0x39d9('0x1d')](_0xf23bb3);}return null;};}function patchUpdates(_0x13ac66){return function(_0x4ddc0b){try{jsonpatch['apply'](_0x4ddc0b,_0x13ac66,!![]);}catch(_0x5da10c){return BPromise[_0x39d9('0x24')](_0x5da10c);}return _0x4ddc0b[_0x39d9('0x25')]();};}function saveUpdates(_0x3f3020,_0x475a05){return function(_0x2a2f76){if(_0x2a2f76){return _0x2a2f76[_0x39d9('0x26')](_0x3f3020)[_0x39d9('0x27')](function(_0x40c853){return _0x40c853;});}return null;};}function removeEntity(_0x23446b,_0x392887){return function(_0x48e9e8){if(_0x48e9e8){return _0x48e9e8[_0x39d9('0x28')]()[_0x39d9('0x27')](function(){_0x23446b['status'](0xcc)[_0x39d9('0x1c')]();});}};}function handleEntityNotFound(_0x4b3dbc,_0x5d9f60){return function(_0xe3a26f){if(!_0xe3a26f){_0x4b3dbc['sendStatus'](0x194);}return _0xe3a26f;};}function handleError(_0x581f82,_0x170903){_0x170903=_0x170903||0x1f4;return function(_0x11cd73){logger[_0x39d9('0x29')](_0x11cd73[_0x39d9('0x2a')]);if(_0x11cd73['name']){delete _0x11cd73[_0x39d9('0x2b')];}_0x581f82[_0x39d9('0x22')](_0x170903)[_0x39d9('0x2c')](_0x11cd73);};}exports[_0x39d9('0x2d')]=function(_0x3451ca,_0x5c0929){var _0x27326e={},_0x2731a4={},_0x4781a0={'count':0x0,'rows':[]};var _0x5c354f=_[_0x39d9('0x2e')](db[_0x39d9('0x2f')][_0x39d9('0x30')],function(_0x4e3b92){return{'name':_0x4e3b92[_0x39d9('0x31')],'type':_0x4e3b92[_0x39d9('0x32')][_0x39d9('0x33')]};});_0x2731a4[_0x39d9('0x34')]=_[_0x39d9('0x2e')](_0x5c354f,'name');_0x2731a4[_0x39d9('0x35')]=_['keys'](_0x3451ca[_0x39d9('0x35')]);_0x2731a4[_0x39d9('0x36')]=_['intersection'](_0x2731a4['model'],_0x2731a4['query']);_0x27326e['attributes']=_[_0x39d9('0x37')](_0x2731a4['model'],qs[_0x39d9('0x38')](_0x3451ca['query'][_0x39d9('0x38')]));_0x27326e[_0x39d9('0x39')]=_0x27326e['attributes']['length']?_0x27326e[_0x39d9('0x39')]:_0x2731a4[_0x39d9('0x34')];if(!_0x3451ca[_0x39d9('0x35')]['hasOwnProperty']('nolimit')){_0x27326e[_0x39d9('0x20')]=qs['limit'](_0x3451ca[_0x39d9('0x35')][_0x39d9('0x20')]);_0x27326e[_0x39d9('0x1e')]=qs[_0x39d9('0x1e')](_0x3451ca['query'][_0x39d9('0x1e')]);}_0x27326e[_0x39d9('0x3a')]=qs['sort'](_0x3451ca['query'][_0x39d9('0x3b')]);_0x27326e['where']=qs[_0x39d9('0x36')](_[_0x39d9('0x3c')](_0x3451ca[_0x39d9('0x35')],_0x2731a4[_0x39d9('0x36')]),_0x5c354f);if(_0x3451ca[_0x39d9('0x35')][_0x39d9('0x3d')]){_0x27326e[_0x39d9('0x3e')]=_[_0x39d9('0x3f')](_0x27326e[_0x39d9('0x3e')],{'$or':_['map'](_0x5c354f,function(_0x42998a){if(_0x42998a[_0x39d9('0x32')]!==_0x39d9('0x40')){var _0x3ed864={};_0x3ed864[_0x42998a[_0x39d9('0x2b')]]={'$like':'%'+_0x3451ca[_0x39d9('0x35')][_0x39d9('0x3d')]+'%'};return _0x3ed864;}})});}_0x27326e=_[_0x39d9('0x3f')]({},_0x27326e,_0x3451ca[_0x39d9('0x41')]);var _0x551456={'where':_0x27326e[_0x39d9('0x3e')]};return db['ZendeskConfiguration'][_0x39d9('0x21')](_0x551456)[_0x39d9('0x27')](function(_0x10445c){_0x4781a0[_0x39d9('0x21')]=_0x10445c;if(_0x3451ca[_0x39d9('0x35')][_0x39d9('0x42')]){_0x27326e[_0x39d9('0x43')]=[{'all':!![]}];}return db[_0x39d9('0x2f')]['findAll'](_0x27326e);})['then'](function(_0x556ba2){_0x4781a0['rows']=_0x556ba2;return _0x4781a0;})[_0x39d9('0x27')](respondWithFilteredResult(_0x5c0929,_0x27326e))[_0x39d9('0x44')](handleError(_0x5c0929,null));};exports[_0x39d9('0x45')]=function(_0x5cf8d0,_0x1b9ecf){var _0x21d324={'raw':![],'where':{'id':_0x5cf8d0[_0x39d9('0x46')]['id']}},_0x25d839={};_0x25d839[_0x39d9('0x34')]=_['keys'](db[_0x39d9('0x2f')][_0x39d9('0x30')]);_0x25d839[_0x39d9('0x35')]=_[_0x39d9('0x47')](_0x5cf8d0['query']);_0x25d839[_0x39d9('0x36')]=_[_0x39d9('0x37')](_0x25d839[_0x39d9('0x34')],_0x25d839[_0x39d9('0x35')]);_0x21d324[_0x39d9('0x39')]=_[_0x39d9('0x37')](_0x25d839[_0x39d9('0x34')],qs['fields'](_0x5cf8d0[_0x39d9('0x35')][_0x39d9('0x38')]));_0x21d324[_0x39d9('0x39')]=_0x21d324[_0x39d9('0x39')]['length']?_0x21d324['attributes']:_0x25d839['model'];if(_0x5cf8d0[_0x39d9('0x35')][_0x39d9('0x42')]){_0x21d324[_0x39d9('0x43')]=[{'all':!![]}];}_0x21d324=_[_0x39d9('0x3f')]({},_0x21d324,_0x5cf8d0[_0x39d9('0x41')]);return db['ZendeskConfiguration']['find'](_0x21d324)[_0x39d9('0x27')](handleEntityNotFound(_0x1b9ecf,null))[_0x39d9('0x27')](respondWithResult(_0x1b9ecf,null))[_0x39d9('0x44')](handleError(_0x1b9ecf,null));};exports['create']=function(_0x83cd29,_0x3915a1){return db[_0x39d9('0x2f')]['create'](_0x83cd29[_0x39d9('0x48')],{})[_0x39d9('0x27')](respondWithResult(_0x3915a1,0xc9))['catch'](handleError(_0x3915a1,null));};exports[_0x39d9('0x26')]=function(_0x1ef223,_0x42b6e1){if(_0x1ef223[_0x39d9('0x48')]['id']){delete _0x1ef223[_0x39d9('0x48')]['id'];}return db[_0x39d9('0x2f')][_0x39d9('0x49')]({'where':{'id':_0x1ef223['params']['id']}})[_0x39d9('0x27')](handleEntityNotFound(_0x42b6e1,null))[_0x39d9('0x27')](saveUpdates(_0x1ef223[_0x39d9('0x48')],null))['then'](respondWithResult(_0x42b6e1,null))[_0x39d9('0x44')](handleError(_0x42b6e1,null));};exports[_0x39d9('0x28')]=function(_0x25d634,_0x5c5be9){return db[_0x39d9('0x2f')]['find']({'where':{'id':_0x25d634[_0x39d9('0x46')]['id']}})['then'](handleEntityNotFound(_0x5c5be9,null))[_0x39d9('0x27')](removeEntity(_0x5c5be9,null))[_0x39d9('0x44')](handleError(_0x5c5be9,null));};exports['getFields']=function(_0x3ef7f9,_0x48573a,_0x14aa1d){var _0xa20351={};var _0x138840={};var _0x39477b;var _0x4fd80f;return db['ZendeskConfiguration'][_0x39d9('0x4a')]({'where':{'id':_0x3ef7f9[_0x39d9('0x46')]['id']}})[_0x39d9('0x27')](handleEntityNotFound(_0x48573a,null))[_0x39d9('0x27')](function(_0x1d496f){if(_0x1d496f){_0x39477b=_0x1d496f;_0x138840[_0x39d9('0x34')]=_[_0x39d9('0x47')](db[_0x39d9('0x4b')]['rawAttributes']);_0x138840[_0x39d9('0x35')]=_[_0x39d9('0x47')](_0x3ef7f9[_0x39d9('0x35')]);_0x138840[_0x39d9('0x36')]=_[_0x39d9('0x37')](_0x138840['model'],_0x138840[_0x39d9('0x35')]);_0xa20351[_0x39d9('0x39')]=_['intersection'](_0x138840[_0x39d9('0x34')],qs['fields'](_0x3ef7f9[_0x39d9('0x35')]['fields']));_0xa20351['attributes']=_0xa20351[_0x39d9('0x39')][_0x39d9('0x4c')]?_0xa20351[_0x39d9('0x39')]:_0x138840[_0x39d9('0x34')];_0xa20351[_0x39d9('0x3a')]=qs[_0x39d9('0x3b')](_0x3ef7f9[_0x39d9('0x35')][_0x39d9('0x3b')]);_0xa20351[_0x39d9('0x3e')]=qs['filters'](_[_0x39d9('0x3c')](_0x3ef7f9['query'],_0x138840['filters']));if(_0x3ef7f9[_0x39d9('0x35')]['filter']){_0xa20351['where']=_[_0x39d9('0x3f')](_0xa20351['where'],{'$or':_[_0x39d9('0x2e')](_0xa20351['attributes'],function(_0x1341e7){var _0x4060fd={};_0x4060fd[_0x1341e7]={'$like':'%'+_0x3ef7f9['query'][_0x39d9('0x3d')]+'%'};return _0x4060fd;})});}_0xa20351=_[_0x39d9('0x3f')]({},_0xa20351,_0x3ef7f9['options']);return _0x39477b[_0x39d9('0x4d')](_0xa20351);}})[_0x39d9('0x27')](function(_0x5d1bb9){if(_0x5d1bb9){_0x4fd80f=_0x5d1bb9['length'];if(!_0x3ef7f9['query'][_0x39d9('0x4e')]('nolimit')){_0xa20351[_0x39d9('0x20')]=qs[_0x39d9('0x20')](_0x3ef7f9[_0x39d9('0x35')]['limit']);_0xa20351[_0x39d9('0x1e')]=qs['offset'](_0x3ef7f9[_0x39d9('0x35')][_0x39d9('0x1e')]);}return _0x39477b[_0x39d9('0x4d')](_0xa20351);}})[_0x39d9('0x27')](function(_0x1fc5cf){if(_0x1fc5cf){return _0x1fc5cf?{'count':_0x4fd80f,'rows':_0x1fc5cf}:null;}})[_0x39d9('0x27')](respondWithResult(_0x48573a,null))[_0x39d9('0x44')](handleError(_0x48573a,null));};exports['getSubjects']=function(_0xc655d9,_0x2a46e1,_0x8eaa25){var _0x52fa34={};var _0x737d0={};var _0x2f15ca;var _0xcd550e;return db[_0x39d9('0x2f')][_0x39d9('0x4a')]({'where':{'id':_0xc655d9[_0x39d9('0x46')]['id']}})[_0x39d9('0x27')](handleEntityNotFound(_0x2a46e1,null))[_0x39d9('0x27')](function(_0x335841){if(_0x335841){_0x2f15ca=_0x335841;_0x737d0['model']=_[_0x39d9('0x47')](db['ZendeskField'][_0x39d9('0x30')]);_0x737d0['query']=_[_0x39d9('0x47')](_0xc655d9[_0x39d9('0x35')]);_0x737d0[_0x39d9('0x36')]=_['intersection'](_0x737d0['model'],_0x737d0['query']);_0x52fa34['attributes']=_['intersection'](_0x737d0[_0x39d9('0x34')],qs['fields'](_0xc655d9[_0x39d9('0x35')][_0x39d9('0x38')]));_0x52fa34[_0x39d9('0x39')]=_0x52fa34[_0x39d9('0x39')]['length']?_0x52fa34['attributes']:_0x737d0[_0x39d9('0x34')];_0x52fa34[_0x39d9('0x3a')]=qs[_0x39d9('0x3b')](_0xc655d9[_0x39d9('0x35')][_0x39d9('0x3b')]);_0x52fa34[_0x39d9('0x3e')]=qs[_0x39d9('0x36')](_['pick'](_0xc655d9[_0x39d9('0x35')],_0x737d0['filters']));if(_0xc655d9[_0x39d9('0x35')][_0x39d9('0x3d')]){_0x52fa34[_0x39d9('0x3e')]=_[_0x39d9('0x3f')](_0x52fa34[_0x39d9('0x3e')],{'$or':_[_0x39d9('0x2e')](_0x52fa34[_0x39d9('0x39')],function(_0x200964){var _0x2855c0={};_0x2855c0[_0x200964]={'$like':'%'+_0xc655d9['query']['filter']+'%'};return _0x2855c0;})});}_0x52fa34=_[_0x39d9('0x3f')]({},_0x52fa34,_0xc655d9['options']);return _0x2f15ca['getSubjects'](_0x52fa34);}})['then'](function(_0x462661){if(_0x462661){_0xcd550e=_0x462661['length'];if(!_0xc655d9[_0x39d9('0x35')]['hasOwnProperty'](_0x39d9('0x4f'))){_0x52fa34[_0x39d9('0x20')]=qs[_0x39d9('0x20')](_0xc655d9['query'][_0x39d9('0x20')]);_0x52fa34[_0x39d9('0x1e')]=qs['offset'](_0xc655d9[_0x39d9('0x35')][_0x39d9('0x1e')]);}return _0x2f15ca[_0x39d9('0x50')](_0x52fa34);}})[_0x39d9('0x27')](function(_0x3b6914){if(_0x3b6914){return _0x3b6914?{'count':_0xcd550e,'rows':_0x3b6914}:null;}})[_0x39d9('0x27')](respondWithResult(_0x2a46e1,null))[_0x39d9('0x44')](handleError(_0x2a46e1,null));};exports[_0x39d9('0x51')]=function(_0x29a719,_0x11e0c8,_0x14a562){var _0x3aa458={};var _0x351f5c={};var _0x49e9cf;var _0x1c9ec2;return db['ZendeskConfiguration'][_0x39d9('0x4a')]({'where':{'id':_0x29a719[_0x39d9('0x46')]['id']}})['then'](handleEntityNotFound(_0x11e0c8,null))[_0x39d9('0x27')](function(_0x357b15){if(_0x357b15){_0x49e9cf=_0x357b15;_0x351f5c[_0x39d9('0x34')]=_['keys'](db[_0x39d9('0x4b')][_0x39d9('0x30')]);_0x351f5c[_0x39d9('0x35')]=_[_0x39d9('0x47')](_0x29a719[_0x39d9('0x35')]);_0x351f5c[_0x39d9('0x36')]=_[_0x39d9('0x37')](_0x351f5c[_0x39d9('0x34')],_0x351f5c[_0x39d9('0x35')]);_0x3aa458['attributes']=_[_0x39d9('0x37')](_0x351f5c['model'],qs[_0x39d9('0x38')](_0x29a719['query']['fields']));_0x3aa458[_0x39d9('0x39')]=_0x3aa458[_0x39d9('0x39')][_0x39d9('0x4c')]?_0x3aa458[_0x39d9('0x39')]:_0x351f5c[_0x39d9('0x34')];_0x3aa458[_0x39d9('0x3a')]=qs[_0x39d9('0x3b')](_0x29a719['query'][_0x39d9('0x3b')]);_0x3aa458[_0x39d9('0x3e')]=qs[_0x39d9('0x36')](_[_0x39d9('0x3c')](_0x29a719[_0x39d9('0x35')],_0x351f5c[_0x39d9('0x36')]));if(_0x29a719[_0x39d9('0x35')][_0x39d9('0x3d')]){_0x3aa458[_0x39d9('0x3e')]=_[_0x39d9('0x3f')](_0x3aa458['where'],{'$or':_[_0x39d9('0x2e')](_0x3aa458[_0x39d9('0x39')],function(_0xd7064f){var _0x33cd22={};_0x33cd22[_0xd7064f]={'$like':'%'+_0x29a719[_0x39d9('0x35')][_0x39d9('0x3d')]+'%'};return _0x33cd22;})});}_0x3aa458=_[_0x39d9('0x3f')]({},_0x3aa458,_0x29a719['options']);return _0x49e9cf[_0x39d9('0x51')](_0x3aa458);}})[_0x39d9('0x27')](function(_0x432df3){if(_0x432df3){_0x1c9ec2=_0x432df3[_0x39d9('0x4c')];if(!_0x29a719[_0x39d9('0x35')][_0x39d9('0x4e')](_0x39d9('0x4f'))){_0x3aa458[_0x39d9('0x20')]=qs[_0x39d9('0x20')](_0x29a719[_0x39d9('0x35')][_0x39d9('0x20')]);_0x3aa458[_0x39d9('0x1e')]=qs[_0x39d9('0x1e')](_0x29a719[_0x39d9('0x35')]['offset']);}return _0x49e9cf[_0x39d9('0x51')](_0x3aa458);}})[_0x39d9('0x27')](function(_0x3fe951){if(_0x3fe951){return _0x3fe951?{'count':_0x1c9ec2,'rows':_0x3fe951}:null;}})[_0x39d9('0x27')](respondWithResult(_0x11e0c8,null))['catch'](handleError(_0x11e0c8,null));};exports['getTags']=function(_0x220b5d,_0x451567,_0x1c3b52){var _0x445e2f={};var _0x2604f8={};var _0x2f4750;var _0x30bfa5;return db[_0x39d9('0x2f')][_0x39d9('0x4a')]({'where':{'id':_0x220b5d[_0x39d9('0x46')]['id']}})[_0x39d9('0x27')](handleEntityNotFound(_0x451567,null))[_0x39d9('0x27')](function(_0x45f629){if(_0x45f629){_0x2f4750=_0x45f629;_0x2604f8[_0x39d9('0x34')]=_[_0x39d9('0x47')](db[_0x39d9('0x52')][_0x39d9('0x30')]);_0x2604f8[_0x39d9('0x35')]=_[_0x39d9('0x47')](_0x220b5d[_0x39d9('0x35')]);_0x2604f8[_0x39d9('0x36')]=_[_0x39d9('0x37')](_0x2604f8[_0x39d9('0x34')],_0x2604f8[_0x39d9('0x35')]);_0x445e2f[_0x39d9('0x39')]=_[_0x39d9('0x37')](_0x2604f8[_0x39d9('0x34')],qs[_0x39d9('0x38')](_0x220b5d[_0x39d9('0x35')][_0x39d9('0x38')]));_0x445e2f['attributes']=_0x445e2f[_0x39d9('0x39')][_0x39d9('0x4c')]?_0x445e2f['attributes']:_0x2604f8[_0x39d9('0x34')];_0x445e2f[_0x39d9('0x3a')]=qs['sort'](_0x220b5d[_0x39d9('0x35')][_0x39d9('0x3b')]);_0x445e2f[_0x39d9('0x3e')]=qs[_0x39d9('0x36')](_['pick'](_0x220b5d[_0x39d9('0x35')],_0x2604f8[_0x39d9('0x36')]));if(_0x220b5d[_0x39d9('0x35')][_0x39d9('0x3d')]){_0x445e2f['where']=_[_0x39d9('0x3f')](_0x445e2f[_0x39d9('0x3e')],{'$or':_[_0x39d9('0x2e')](_0x445e2f[_0x39d9('0x39')],function(_0x3d0dbd){var _0x23804d={};_0x23804d[_0x3d0dbd]={'$like':'%'+_0x220b5d['query']['filter']+'%'};return _0x23804d;})});}_0x445e2f=_[_0x39d9('0x3f')]({},_0x445e2f,_0x220b5d[_0x39d9('0x41')]);return _0x2f4750[_0x39d9('0x53')](_0x445e2f);}})[_0x39d9('0x27')](function(_0x5ce68a){if(_0x5ce68a){_0x30bfa5=_0x5ce68a['length'];if(!_0x220b5d[_0x39d9('0x35')][_0x39d9('0x4e')](_0x39d9('0x4f'))){_0x445e2f[_0x39d9('0x20')]=qs[_0x39d9('0x20')](_0x220b5d[_0x39d9('0x35')]['limit']);_0x445e2f[_0x39d9('0x1e')]=qs[_0x39d9('0x1e')](_0x220b5d[_0x39d9('0x35')][_0x39d9('0x1e')]);}return _0x2f4750['getTags'](_0x445e2f);}})[_0x39d9('0x27')](function(_0x2f1f8e){if(_0x2f1f8e){return _0x2f1f8e?{'count':_0x30bfa5,'rows':_0x2f1f8e}:null;}})[_0x39d9('0x27')](respondWithResult(_0x451567,null))['catch'](handleError(_0x451567,null));};exports[_0x39d9('0x54')]=function(_0x54957e,_0x4665ed,_0x36b489){if(_0x54957e[_0x39d9('0x48')]['id']){delete _0x54957e['body']['id'];}return db[_0x39d9('0x2f')][_0x39d9('0x4a')]({'where':{'id':_0x54957e[_0x39d9('0x46')]['id']}})[_0x39d9('0x27')](handleEntityNotFound(_0x4665ed,null))[_0x39d9('0x27')](function(_0x410d1f){if(_0x410d1f){return _0x410d1f[_0x39d9('0x54')](_0x54957e[_0x39d9('0x48')][_0x39d9('0x55')]||[]);}return null;})[_0x39d9('0x27')](respondWithResult(_0x4665ed,null))[_0x39d9('0x44')](handleError(_0x4665ed,null));}; \ No newline at end of file +var _0x97de=['status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','error','name','send','index','map','fieldName','type','key','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','options','ZendeskConfiguration','includeAll','include','findAll','then','catch','show','params','rawAttributes','length','find','create','body','update','getFields','findOne','ZendeskField','pick','getSubjects','getDescriptions','getTags','Tag','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x1b38e9,_0x5676df){var _0x541d9d=function(_0x8b139d){while(--_0x8b139d){_0x1b38e9['push'](_0x1b38e9['shift']());}};_0x541d9d(++_0x5676df);}(_0x97de,0x1cf));var _0xe97d=function(_0x30b9e3,_0x9a40cb){_0x30b9e3=_0x30b9e3-0x0;var _0x1bbab0=_0x97de[_0x30b9e3];return _0x1bbab0;};'use strict';var emlformat=require(_0xe97d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe97d('0x1'));var jsonpatch=require(_0xe97d('0x2'));var rp=require(_0xe97d('0x3'));var moment=require('moment');var BPromise=require(_0xe97d('0x4'));var Mustache=require(_0xe97d('0x5'));var util=require('util');var path=require(_0xe97d('0x6'));var sox=require(_0xe97d('0x7'));var csv=require('to-csv');var ejs=require(_0xe97d('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe97d('0x9'));var crypto=require(_0xe97d('0xa'));var jsforce=require(_0xe97d('0xb'));var deskjs=require(_0xe97d('0xc'));var toCsv=require(_0xe97d('0xd'));var querystring=require(_0xe97d('0xe'));var Papa=require(_0xe97d('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe97d('0x10'));var hardwareService=require(_0xe97d('0x11'));var logger=require('../../config/logger')(_0xe97d('0x12'));var utils=require(_0xe97d('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xe97d('0x14'));var db=require(_0xe97d('0x15'))['db'];function respondWithStatusCode(_0x53bd5c,_0x3f9fc9){_0x3f9fc9=_0x3f9fc9||0xcc;return function(_0x571245){if(_0x571245){return _0x53bd5c[_0xe97d('0x16')](_0x3f9fc9);}return _0x53bd5c[_0xe97d('0x17')](_0x3f9fc9)[_0xe97d('0x18')]();};}function respondWithResult(_0xb71e8,_0x161e9f){_0x161e9f=_0x161e9f||0xc8;return function(_0x4c2b59){if(_0x4c2b59){return _0xb71e8[_0xe97d('0x17')](_0x161e9f)[_0xe97d('0x19')](_0x4c2b59);}};}function respondWithFilteredResult(_0x1d6626,_0x5c972f){return function(_0x31adf9){if(_0x31adf9){var _0x70fe14=typeof _0x5c972f[_0xe97d('0x1a')]==='undefined'&&typeof _0x5c972f[_0xe97d('0x1b')]===_0xe97d('0x1c');var _0x1c6888=_0x31adf9[_0xe97d('0x1d')];var _0x219674=_0x70fe14?0x0:_0x5c972f[_0xe97d('0x1a')];var _0x4a436b=_0x70fe14?_0x31adf9[_0xe97d('0x1d')]:_0x5c972f['offset']+_0x5c972f[_0xe97d('0x1b')];var _0xe977af;if(_0x4a436b>=_0x1c6888){_0x4a436b=_0x1c6888;_0xe977af=0xc8;}else{_0xe977af=0xce;}_0x1d6626['status'](_0xe977af);return _0x1d6626[_0xe97d('0x1e')](_0xe97d('0x1f'),_0x219674+'-'+_0x4a436b+'/'+_0x1c6888)[_0xe97d('0x19')](_0x31adf9);}return null;};}function patchUpdates(_0x54f3ea){return function(_0x2af2e7){try{jsonpatch[_0xe97d('0x20')](_0x2af2e7,_0x54f3ea,!![]);}catch(_0x151ad4){return BPromise[_0xe97d('0x21')](_0x151ad4);}return _0x2af2e7[_0xe97d('0x22')]();};}function saveUpdates(_0x15f6bd,_0x46642c){return function(_0x11b292){if(_0x11b292){return _0x11b292['update'](_0x15f6bd)['then'](function(_0x173747){return _0x173747;});}return null;};}function removeEntity(_0x3fcf4a,_0x1cfc23){return function(_0x4184c4){if(_0x4184c4){return _0x4184c4['destroy']()['then'](function(){_0x3fcf4a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x484464,_0x1f8795){return function(_0x18e4aa){if(!_0x18e4aa){_0x484464[_0xe97d('0x16')](0x194);}return _0x18e4aa;};}function handleError(_0x4545e8,_0x1bc37a){_0x1bc37a=_0x1bc37a||0x1f4;return function(_0x3c3230){logger[_0xe97d('0x23')](_0x3c3230['stack']);if(_0x3c3230[_0xe97d('0x24')]){delete _0x3c3230['name'];}_0x4545e8['status'](_0x1bc37a)[_0xe97d('0x25')](_0x3c3230);};}exports[_0xe97d('0x26')]=function(_0x17441a,_0x2ec18b){var _0x5857b3={},_0x152e18={},_0x468d24={'count':0x0,'rows':[]};var _0x1fb608=_[_0xe97d('0x27')](db['ZendeskConfiguration']['rawAttributes'],function(_0x2f8bcc){return{'name':_0x2f8bcc[_0xe97d('0x28')],'type':_0x2f8bcc[_0xe97d('0x29')][_0xe97d('0x2a')]};});_0x152e18[_0xe97d('0x2b')]=_[_0xe97d('0x27')](_0x1fb608,_0xe97d('0x24'));_0x152e18['query']=_[_0xe97d('0x2c')](_0x17441a[_0xe97d('0x2d')]);_0x152e18['filters']=_[_0xe97d('0x2e')](_0x152e18[_0xe97d('0x2b')],_0x152e18['query']);_0x5857b3[_0xe97d('0x2f')]=_[_0xe97d('0x2e')](_0x152e18['model'],qs[_0xe97d('0x30')](_0x17441a[_0xe97d('0x2d')][_0xe97d('0x30')]));_0x5857b3[_0xe97d('0x2f')]=_0x5857b3['attributes']['length']?_0x5857b3[_0xe97d('0x2f')]:_0x152e18[_0xe97d('0x2b')];if(!_0x17441a['query'][_0xe97d('0x31')](_0xe97d('0x32'))){_0x5857b3[_0xe97d('0x1b')]=qs['limit'](_0x17441a[_0xe97d('0x2d')][_0xe97d('0x1b')]);_0x5857b3[_0xe97d('0x1a')]=qs[_0xe97d('0x1a')](_0x17441a[_0xe97d('0x2d')][_0xe97d('0x1a')]);}_0x5857b3[_0xe97d('0x33')]=qs[_0xe97d('0x34')](_0x17441a[_0xe97d('0x2d')][_0xe97d('0x34')]);_0x5857b3[_0xe97d('0x35')]=qs[_0xe97d('0x36')](_['pick'](_0x17441a[_0xe97d('0x2d')],_0x152e18['filters']),_0x1fb608);if(_0x17441a['query']['filter']){_0x5857b3[_0xe97d('0x35')]=_[_0xe97d('0x37')](_0x5857b3[_0xe97d('0x35')],{'$or':_[_0xe97d('0x27')](_0x1fb608,function(_0x2ebdd0){if(_0x2ebdd0[_0xe97d('0x29')]!==_0xe97d('0x38')){var _0xf382ef={};_0xf382ef[_0x2ebdd0[_0xe97d('0x24')]]={'$like':'%'+_0x17441a[_0xe97d('0x2d')][_0xe97d('0x39')]+'%'};return _0xf382ef;}})});}_0x5857b3=_[_0xe97d('0x37')]({},_0x5857b3,_0x17441a[_0xe97d('0x3a')]);var _0x244320={'where':_0x5857b3['where']};return db[_0xe97d('0x3b')][_0xe97d('0x1d')](_0x244320)['then'](function(_0x18b477){_0x468d24[_0xe97d('0x1d')]=_0x18b477;if(_0x17441a['query'][_0xe97d('0x3c')]){_0x5857b3[_0xe97d('0x3d')]=[{'all':!![]}];}return db['ZendeskConfiguration'][_0xe97d('0x3e')](_0x5857b3);})[_0xe97d('0x3f')](function(_0x39ed9a){_0x468d24['rows']=_0x39ed9a;return _0x468d24;})['then'](respondWithFilteredResult(_0x2ec18b,_0x5857b3))[_0xe97d('0x40')](handleError(_0x2ec18b,null));};exports[_0xe97d('0x41')]=function(_0x626c91,_0x373cf6){var _0x5b0250={'raw':![],'where':{'id':_0x626c91[_0xe97d('0x42')]['id']}},_0x1ca375={};_0x1ca375['model']=_[_0xe97d('0x2c')](db[_0xe97d('0x3b')][_0xe97d('0x43')]);_0x1ca375[_0xe97d('0x2d')]=_[_0xe97d('0x2c')](_0x626c91['query']);_0x1ca375[_0xe97d('0x36')]=_['intersection'](_0x1ca375[_0xe97d('0x2b')],_0x1ca375['query']);_0x5b0250[_0xe97d('0x2f')]=_[_0xe97d('0x2e')](_0x1ca375[_0xe97d('0x2b')],qs[_0xe97d('0x30')](_0x626c91[_0xe97d('0x2d')][_0xe97d('0x30')]));_0x5b0250[_0xe97d('0x2f')]=_0x5b0250['attributes'][_0xe97d('0x44')]?_0x5b0250[_0xe97d('0x2f')]:_0x1ca375[_0xe97d('0x2b')];if(_0x626c91['query'][_0xe97d('0x3c')]){_0x5b0250[_0xe97d('0x3d')]=[{'all':!![]}];}_0x5b0250=_[_0xe97d('0x37')]({},_0x5b0250,_0x626c91[_0xe97d('0x3a')]);return db['ZendeskConfiguration'][_0xe97d('0x45')](_0x5b0250)[_0xe97d('0x3f')](handleEntityNotFound(_0x373cf6,null))[_0xe97d('0x3f')](respondWithResult(_0x373cf6,null))[_0xe97d('0x40')](handleError(_0x373cf6,null));};exports[_0xe97d('0x46')]=function(_0x30c06a,_0x30af83){return db[_0xe97d('0x3b')]['create'](_0x30c06a[_0xe97d('0x47')],{})['then'](respondWithResult(_0x30af83,0xc9))['catch'](handleError(_0x30af83,null));};exports[_0xe97d('0x48')]=function(_0x54818c,_0x38824e){if(_0x54818c[_0xe97d('0x47')]['id']){delete _0x54818c[_0xe97d('0x47')]['id'];}return db['ZendeskConfiguration']['find']({'where':{'id':_0x54818c['params']['id']}})[_0xe97d('0x3f')](handleEntityNotFound(_0x38824e,null))[_0xe97d('0x3f')](saveUpdates(_0x54818c[_0xe97d('0x47')],null))['then'](respondWithResult(_0x38824e,null))['catch'](handleError(_0x38824e,null));};exports['destroy']=function(_0x4b12ac,_0x5d3738){return db['ZendeskConfiguration'][_0xe97d('0x45')]({'where':{'id':_0x4b12ac[_0xe97d('0x42')]['id']}})[_0xe97d('0x3f')](handleEntityNotFound(_0x5d3738,null))['then'](removeEntity(_0x5d3738,null))[_0xe97d('0x40')](handleError(_0x5d3738,null));};exports[_0xe97d('0x49')]=function(_0x4b1ef6,_0x4098e0,_0x313f8e){var _0x55fbd4={};var _0x2d5174={};var _0x5ac892;var _0x2cd916;return db[_0xe97d('0x3b')][_0xe97d('0x4a')]({'where':{'id':_0x4b1ef6[_0xe97d('0x42')]['id']}})['then'](handleEntityNotFound(_0x4098e0,null))[_0xe97d('0x3f')](function(_0x519013){if(_0x519013){_0x5ac892=_0x519013;_0x2d5174['model']=_['keys'](db[_0xe97d('0x4b')][_0xe97d('0x43')]);_0x2d5174[_0xe97d('0x2d')]=_[_0xe97d('0x2c')](_0x4b1ef6[_0xe97d('0x2d')]);_0x2d5174['filters']=_[_0xe97d('0x2e')](_0x2d5174['model'],_0x2d5174[_0xe97d('0x2d')]);_0x55fbd4[_0xe97d('0x2f')]=_[_0xe97d('0x2e')](_0x2d5174['model'],qs[_0xe97d('0x30')](_0x4b1ef6[_0xe97d('0x2d')]['fields']));_0x55fbd4[_0xe97d('0x2f')]=_0x55fbd4[_0xe97d('0x2f')][_0xe97d('0x44')]?_0x55fbd4[_0xe97d('0x2f')]:_0x2d5174[_0xe97d('0x2b')];_0x55fbd4[_0xe97d('0x33')]=qs['sort'](_0x4b1ef6['query'][_0xe97d('0x34')]);_0x55fbd4[_0xe97d('0x35')]=qs['filters'](_[_0xe97d('0x4c')](_0x4b1ef6[_0xe97d('0x2d')],_0x2d5174['filters']));if(_0x4b1ef6[_0xe97d('0x2d')][_0xe97d('0x39')]){_0x55fbd4['where']=_[_0xe97d('0x37')](_0x55fbd4[_0xe97d('0x35')],{'$or':_[_0xe97d('0x27')](_0x55fbd4[_0xe97d('0x2f')],function(_0x1ac109){var _0x14306a={};_0x14306a[_0x1ac109]={'$like':'%'+_0x4b1ef6[_0xe97d('0x2d')][_0xe97d('0x39')]+'%'};return _0x14306a;})});}_0x55fbd4=_[_0xe97d('0x37')]({},_0x55fbd4,_0x4b1ef6[_0xe97d('0x3a')]);return _0x5ac892[_0xe97d('0x49')](_0x55fbd4);}})[_0xe97d('0x3f')](function(_0x981a4e){if(_0x981a4e){_0x2cd916=_0x981a4e['length'];if(!_0x4b1ef6[_0xe97d('0x2d')][_0xe97d('0x31')](_0xe97d('0x32'))){_0x55fbd4[_0xe97d('0x1b')]=qs['limit'](_0x4b1ef6[_0xe97d('0x2d')][_0xe97d('0x1b')]);_0x55fbd4[_0xe97d('0x1a')]=qs['offset'](_0x4b1ef6[_0xe97d('0x2d')][_0xe97d('0x1a')]);}return _0x5ac892[_0xe97d('0x49')](_0x55fbd4);}})[_0xe97d('0x3f')](function(_0x268f5b){if(_0x268f5b){return _0x268f5b?{'count':_0x2cd916,'rows':_0x268f5b}:null;}})[_0xe97d('0x3f')](respondWithResult(_0x4098e0,null))[_0xe97d('0x40')](handleError(_0x4098e0,null));};exports[_0xe97d('0x4d')]=function(_0x49609d,_0x388d8c,_0x3108fd){var _0x38cfe1={};var _0x3c810f={};var _0x5e6f2b;var _0x4230ea;return db[_0xe97d('0x3b')][_0xe97d('0x4a')]({'where':{'id':_0x49609d[_0xe97d('0x42')]['id']}})['then'](handleEntityNotFound(_0x388d8c,null))['then'](function(_0x26a001){if(_0x26a001){_0x5e6f2b=_0x26a001;_0x3c810f[_0xe97d('0x2b')]=_[_0xe97d('0x2c')](db['ZendeskField'][_0xe97d('0x43')]);_0x3c810f[_0xe97d('0x2d')]=_[_0xe97d('0x2c')](_0x49609d[_0xe97d('0x2d')]);_0x3c810f[_0xe97d('0x36')]=_[_0xe97d('0x2e')](_0x3c810f[_0xe97d('0x2b')],_0x3c810f[_0xe97d('0x2d')]);_0x38cfe1[_0xe97d('0x2f')]=_['intersection'](_0x3c810f[_0xe97d('0x2b')],qs['fields'](_0x49609d['query']['fields']));_0x38cfe1[_0xe97d('0x2f')]=_0x38cfe1[_0xe97d('0x2f')][_0xe97d('0x44')]?_0x38cfe1[_0xe97d('0x2f')]:_0x3c810f[_0xe97d('0x2b')];_0x38cfe1['order']=qs[_0xe97d('0x34')](_0x49609d[_0xe97d('0x2d')]['sort']);_0x38cfe1['where']=qs['filters'](_['pick'](_0x49609d[_0xe97d('0x2d')],_0x3c810f[_0xe97d('0x36')]));if(_0x49609d[_0xe97d('0x2d')][_0xe97d('0x39')]){_0x38cfe1[_0xe97d('0x35')]=_[_0xe97d('0x37')](_0x38cfe1[_0xe97d('0x35')],{'$or':_[_0xe97d('0x27')](_0x38cfe1[_0xe97d('0x2f')],function(_0x47edaf){var _0x2d23a0={};_0x2d23a0[_0x47edaf]={'$like':'%'+_0x49609d[_0xe97d('0x2d')][_0xe97d('0x39')]+'%'};return _0x2d23a0;})});}_0x38cfe1=_[_0xe97d('0x37')]({},_0x38cfe1,_0x49609d['options']);return _0x5e6f2b[_0xe97d('0x4d')](_0x38cfe1);}})[_0xe97d('0x3f')](function(_0x3d68a8){if(_0x3d68a8){_0x4230ea=_0x3d68a8['length'];if(!_0x49609d[_0xe97d('0x2d')][_0xe97d('0x31')](_0xe97d('0x32'))){_0x38cfe1['limit']=qs[_0xe97d('0x1b')](_0x49609d[_0xe97d('0x2d')][_0xe97d('0x1b')]);_0x38cfe1[_0xe97d('0x1a')]=qs[_0xe97d('0x1a')](_0x49609d[_0xe97d('0x2d')][_0xe97d('0x1a')]);}return _0x5e6f2b[_0xe97d('0x4d')](_0x38cfe1);}})[_0xe97d('0x3f')](function(_0x1215d5){if(_0x1215d5){return _0x1215d5?{'count':_0x4230ea,'rows':_0x1215d5}:null;}})[_0xe97d('0x3f')](respondWithResult(_0x388d8c,null))[_0xe97d('0x40')](handleError(_0x388d8c,null));};exports[_0xe97d('0x4e')]=function(_0x2cd4d5,_0x143a69,_0x514d3c){var _0x3f2963={};var _0x58fbe5={};var _0x2a7408;var _0x3845ac;return db[_0xe97d('0x3b')][_0xe97d('0x4a')]({'where':{'id':_0x2cd4d5['params']['id']}})[_0xe97d('0x3f')](handleEntityNotFound(_0x143a69,null))[_0xe97d('0x3f')](function(_0x1e3f2a){if(_0x1e3f2a){_0x2a7408=_0x1e3f2a;_0x58fbe5[_0xe97d('0x2b')]=_['keys'](db['ZendeskField']['rawAttributes']);_0x58fbe5[_0xe97d('0x2d')]=_[_0xe97d('0x2c')](_0x2cd4d5['query']);_0x58fbe5[_0xe97d('0x36')]=_[_0xe97d('0x2e')](_0x58fbe5['model'],_0x58fbe5[_0xe97d('0x2d')]);_0x3f2963[_0xe97d('0x2f')]=_['intersection'](_0x58fbe5[_0xe97d('0x2b')],qs[_0xe97d('0x30')](_0x2cd4d5['query']['fields']));_0x3f2963[_0xe97d('0x2f')]=_0x3f2963[_0xe97d('0x2f')][_0xe97d('0x44')]?_0x3f2963[_0xe97d('0x2f')]:_0x58fbe5['model'];_0x3f2963[_0xe97d('0x33')]=qs[_0xe97d('0x34')](_0x2cd4d5[_0xe97d('0x2d')][_0xe97d('0x34')]);_0x3f2963[_0xe97d('0x35')]=qs[_0xe97d('0x36')](_[_0xe97d('0x4c')](_0x2cd4d5[_0xe97d('0x2d')],_0x58fbe5[_0xe97d('0x36')]));if(_0x2cd4d5[_0xe97d('0x2d')][_0xe97d('0x39')]){_0x3f2963[_0xe97d('0x35')]=_[_0xe97d('0x37')](_0x3f2963[_0xe97d('0x35')],{'$or':_[_0xe97d('0x27')](_0x3f2963[_0xe97d('0x2f')],function(_0x2c9e6f){var _0xdcc73e={};_0xdcc73e[_0x2c9e6f]={'$like':'%'+_0x2cd4d5[_0xe97d('0x2d')][_0xe97d('0x39')]+'%'};return _0xdcc73e;})});}_0x3f2963=_['merge']({},_0x3f2963,_0x2cd4d5[_0xe97d('0x3a')]);return _0x2a7408['getDescriptions'](_0x3f2963);}})[_0xe97d('0x3f')](function(_0x5ee15f){if(_0x5ee15f){_0x3845ac=_0x5ee15f[_0xe97d('0x44')];if(!_0x2cd4d5[_0xe97d('0x2d')]['hasOwnProperty'](_0xe97d('0x32'))){_0x3f2963[_0xe97d('0x1b')]=qs[_0xe97d('0x1b')](_0x2cd4d5[_0xe97d('0x2d')][_0xe97d('0x1b')]);_0x3f2963['offset']=qs['offset'](_0x2cd4d5[_0xe97d('0x2d')][_0xe97d('0x1a')]);}return _0x2a7408[_0xe97d('0x4e')](_0x3f2963);}})['then'](function(_0x1bd5cb){if(_0x1bd5cb){return _0x1bd5cb?{'count':_0x3845ac,'rows':_0x1bd5cb}:null;}})[_0xe97d('0x3f')](respondWithResult(_0x143a69,null))[_0xe97d('0x40')](handleError(_0x143a69,null));};exports[_0xe97d('0x4f')]=function(_0x5eaa37,_0xe4ee09,_0x25ab85){var _0x2c968d={};var _0x51f9c9={};var _0x5b85b9;var _0x23352b;return db[_0xe97d('0x3b')][_0xe97d('0x4a')]({'where':{'id':_0x5eaa37[_0xe97d('0x42')]['id']}})[_0xe97d('0x3f')](handleEntityNotFound(_0xe4ee09,null))[_0xe97d('0x3f')](function(_0x1e9ce3){if(_0x1e9ce3){_0x5b85b9=_0x1e9ce3;_0x51f9c9[_0xe97d('0x2b')]=_['keys'](db[_0xe97d('0x50')][_0xe97d('0x43')]);_0x51f9c9[_0xe97d('0x2d')]=_[_0xe97d('0x2c')](_0x5eaa37[_0xe97d('0x2d')]);_0x51f9c9[_0xe97d('0x36')]=_[_0xe97d('0x2e')](_0x51f9c9[_0xe97d('0x2b')],_0x51f9c9[_0xe97d('0x2d')]);_0x2c968d['attributes']=_[_0xe97d('0x2e')](_0x51f9c9['model'],qs[_0xe97d('0x30')](_0x5eaa37[_0xe97d('0x2d')][_0xe97d('0x30')]));_0x2c968d[_0xe97d('0x2f')]=_0x2c968d[_0xe97d('0x2f')][_0xe97d('0x44')]?_0x2c968d[_0xe97d('0x2f')]:_0x51f9c9['model'];_0x2c968d[_0xe97d('0x33')]=qs[_0xe97d('0x34')](_0x5eaa37['query']['sort']);_0x2c968d[_0xe97d('0x35')]=qs[_0xe97d('0x36')](_['pick'](_0x5eaa37[_0xe97d('0x2d')],_0x51f9c9[_0xe97d('0x36')]));if(_0x5eaa37[_0xe97d('0x2d')]['filter']){_0x2c968d[_0xe97d('0x35')]=_[_0xe97d('0x37')](_0x2c968d[_0xe97d('0x35')],{'$or':_['map'](_0x2c968d[_0xe97d('0x2f')],function(_0x58caf3){var _0x538a77={};_0x538a77[_0x58caf3]={'$like':'%'+_0x5eaa37[_0xe97d('0x2d')][_0xe97d('0x39')]+'%'};return _0x538a77;})});}_0x2c968d=_[_0xe97d('0x37')]({},_0x2c968d,_0x5eaa37[_0xe97d('0x3a')]);return _0x5b85b9[_0xe97d('0x4f')](_0x2c968d);}})[_0xe97d('0x3f')](function(_0x34ee90){if(_0x34ee90){_0x23352b=_0x34ee90[_0xe97d('0x44')];if(!_0x5eaa37[_0xe97d('0x2d')][_0xe97d('0x31')]('nolimit')){_0x2c968d['limit']=qs[_0xe97d('0x1b')](_0x5eaa37[_0xe97d('0x2d')][_0xe97d('0x1b')]);_0x2c968d[_0xe97d('0x1a')]=qs[_0xe97d('0x1a')](_0x5eaa37[_0xe97d('0x2d')][_0xe97d('0x1a')]);}return _0x5b85b9[_0xe97d('0x4f')](_0x2c968d);}})['then'](function(_0x2cd6e9){if(_0x2cd6e9){return _0x2cd6e9?{'count':_0x23352b,'rows':_0x2cd6e9}:null;}})[_0xe97d('0x3f')](respondWithResult(_0xe4ee09,null))[_0xe97d('0x40')](handleError(_0xe4ee09,null));};exports['setTags']=function(_0x19e6ac,_0x50a6cb,_0x30958a){if(_0x19e6ac[_0xe97d('0x47')]['id']){delete _0x19e6ac['body']['id'];}return db['ZendeskConfiguration'][_0xe97d('0x4a')]({'where':{'id':_0x19e6ac[_0xe97d('0x42')]['id']}})[_0xe97d('0x3f')](handleEntityNotFound(_0x50a6cb,null))[_0xe97d('0x3f')](function(_0x5a8f81){if(_0x5a8f81){return _0x5a8f81['setTags'](_0x19e6ac[_0xe97d('0x47')]['ids']||[]);}return null;})[_0xe97d('0x3f')](respondWithResult(_0x50a6cb,null))[_0xe97d('0x40')](handleError(_0x50a6cb,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 45a59cb..a0453a6 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 _0x1775=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','util'];(function(_0x1716cc,_0x4c5296){var _0x52e40b=function(_0x182dc1){while(--_0x182dc1){_0x1716cc['push'](_0x1716cc['shift']());}};_0x52e40b(++_0x4c5296);}(_0x1775,0x1db));var _0x5177=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1775[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x5177('0x0'));var logger=require(_0x5177('0x1'))(_0x5177('0x2'));var moment=require(_0x5177('0x3'));var BPromise=require(_0x5177('0x4'));var rp=require(_0x5177('0x5'));var fs=require('fs');var path=require(_0x5177('0x6'));var rimraf=require(_0x5177('0x7'));var config=require(_0x5177('0x8'));var attributes=require(_0x5177('0x9'));module[_0x5177('0xa')]=function(_0x2c5c42,_0x153c1a){return _0x2c5c42[_0x5177('0xb')](_0x5177('0xc'),attributes,{'tableName':_0x5177('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa30a=['path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xa30a,0xd7));var _0xaa30=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa30a[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xaa30('0x0'));var util=require(_0xaa30('0x1'));var logger=require(_0xaa30('0x2'))('api');var moment=require(_0xaa30('0x3'));var BPromise=require(_0xaa30('0x4'));var rp=require(_0xaa30('0x5'));var fs=require('fs');var path=require(_0xaa30('0x6'));var rimraf=require(_0xaa30('0x7'));var config=require(_0xaa30('0x8'));var attributes=require(_0xaa30('0x9'));module['exports']=function(_0x347cd5,_0x4efe89){return _0x347cd5[_0xaa30('0xa')](_0xaa30('0xb'),attributes,{'tableName':_0xaa30('0xc'),'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 13c8916..e54552f 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 _0x06bf=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x1ca7ed,_0x2cccb4){var _0x5d706a=function(_0x304db1){while(--_0x304db1){_0x1ca7ed['push'](_0x1ca7ed['shift']());}};_0x5d706a(++_0x2cccb4);}(_0x06bf,0x1b6));var _0xf06b=function(_0x1df526,_0x54a6c7){_0x1df526=_0x1df526-0x0;var _0x5cc61c=_0x06bf[_0x1df526];return _0x5cc61c;};'use strict';var _=require(_0xf06b('0x0'));var util=require(_0xf06b('0x1'));var moment=require(_0xf06b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf06b('0x3'));var db=require(_0xf06b('0x4'))['db'];var utils=require(_0xf06b('0x5'));var logger=require('../../config/logger')(_0xf06b('0x6'));var config=require(_0xf06b('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf06b('0x8')][_0xf06b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x10d7dd,_0x4db9a0,_0x53e5de){return new BPromise(function(_0x507f7c,_0x5aafbc){return client[_0xf06b('0xa')](_0x10d7dd,_0x53e5de)[_0xf06b('0xb')](function(_0x19b2ee){logger[_0xf06b('0xc')](_0xf06b('0xd'),_0x4db9a0,'request\x20sent');logger['debug']('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x4db9a0,_0xf06b('0xe'),JSON[_0xf06b('0xf')](_0x19b2ee));if(_0x19b2ee['error']){if(_0x19b2ee[_0xf06b('0x10')][_0xf06b('0x11')]===0x1f4){logger['error'](_0xf06b('0xd'),_0x4db9a0,_0x19b2ee['error'][_0xf06b('0x12')]);return _0x5aafbc(_0x19b2ee[_0xf06b('0x10')]['message']);}logger[_0xf06b('0x10')](_0xf06b('0xd'),_0x4db9a0,_0x19b2ee[_0xf06b('0x10')][_0xf06b('0x12')]);return _0x507f7c(_0x19b2ee['error'][_0xf06b('0x12')]);}else{logger[_0xf06b('0xc')](_0xf06b('0xd'),_0x4db9a0,_0xf06b('0xe'));_0x507f7c(_0x19b2ee[_0xf06b('0x13')][_0xf06b('0x12')]);}})[_0xf06b('0x14')](function(_0x1bd094){logger[_0xf06b('0x10')](_0xf06b('0xd'),_0x4db9a0,_0x1bd094);_0x5aafbc(_0x1bd094);});});} \ No newline at end of file +var _0xbb36=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ZendeskConfiguration,\x20%s,\x20%s','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xbb36,0x145));var _0x6bb3=function(_0x10a44e,_0x4d2623){_0x10a44e=_0x10a44e-0x0;var _0x5e9f45=_0xbb36[_0x10a44e];return _0x5e9f45;};'use strict';var _=require(_0x6bb3('0x0'));var util=require(_0x6bb3('0x1'));var moment=require('moment');var BPromise=require(_0x6bb3('0x2'));var rs=require(_0x6bb3('0x3'));var fs=require('fs');var Redis=require(_0x6bb3('0x4'));var db=require(_0x6bb3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6bb3('0x6'))(_0x6bb3('0x7'));var config=require(_0x6bb3('0x8'));var jayson=require(_0x6bb3('0x9'));var client=jayson[_0x6bb3('0xa')][_0x6bb3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x48d751,_0x1c1c64,_0x4f4923){return new BPromise(function(_0x380222,_0x1f37b9){return client[_0x6bb3('0xc')](_0x48d751,_0x4f4923)['then'](function(_0x5ba7c8){logger[_0x6bb3('0xd')](_0x6bb3('0xe'),_0x1c1c64,'request\x20sent');logger['debug'](_0x6bb3('0xf'),_0x1c1c64,_0x6bb3('0x10'),JSON[_0x6bb3('0x11')](_0x5ba7c8));if(_0x5ba7c8[_0x6bb3('0x12')]){if(_0x5ba7c8[_0x6bb3('0x12')]['code']===0x1f4){logger[_0x6bb3('0x12')](_0x6bb3('0xe'),_0x1c1c64,_0x5ba7c8[_0x6bb3('0x12')]['message']);return _0x1f37b9(_0x5ba7c8[_0x6bb3('0x12')][_0x6bb3('0x13')]);}logger[_0x6bb3('0x12')](_0x6bb3('0xe'),_0x1c1c64,_0x5ba7c8[_0x6bb3('0x12')][_0x6bb3('0x13')]);return _0x380222(_0x5ba7c8[_0x6bb3('0x12')][_0x6bb3('0x13')]);}else{logger['info'](_0x6bb3('0xe'),_0x1c1c64,_0x6bb3('0x10'));_0x380222(_0x5ba7c8[_0x6bb3('0x14')][_0x6bb3('0x13')]);}})[_0x6bb3('0x15')](function(_0x5e9a89){logger[_0x6bb3('0x12')](_0x6bb3('0xe'),_0x1c1c64,_0x5e9a89);_0x1f37b9(_0x5e9a89);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 910a2c5..396ad46 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 _0x5681=['/:id','show','post','put','update','destroy','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./intZendeskField.controller','get','isAuthenticated'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x5681,0x105));var _0x1568=function(_0x8386ea,_0x45474d){_0x8386ea=_0x8386ea-0x0;var _0x369414=_0x5681[_0x8386ea];return _0x369414;};'use strict';var multer=require('multer');var util=require(_0x1568('0x0'));var path=require(_0x1568('0x1'));var timeout=require(_0x1568('0x2'));var express=require('express');var router=express[_0x1568('0x3')]();var fs_extra=require(_0x1568('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1568('0x5'));var config=require('../../config/environment');var controller=require(_0x1568('0x6'));router[_0x1568('0x7')]('/',auth[_0x1568('0x8')](),controller['index']);router[_0x1568('0x7')](_0x1568('0x9'),auth[_0x1568('0x8')](),controller[_0x1568('0xa')]);router[_0x1568('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1568('0xc')](_0x1568('0x9'),auth[_0x1568('0x8')](),controller[_0x1568('0xd')]);router['delete']('/:id',auth[_0x1568('0x8')](),controller[_0x1568('0xe')]);module['exports']=router; \ No newline at end of file +var _0x4543=['index','get','/:id','show','create','update','delete','destroy','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x514bca,_0x164471){var _0x1c2c6e=function(_0x2c90d5){while(--_0x2c90d5){_0x514bca['push'](_0x514bca['shift']());}};_0x1c2c6e(++_0x164471);}(_0x4543,0x118));var _0x3454=function(_0x59dae7,_0x5f58a7){_0x59dae7=_0x59dae7-0x0;var _0x4d3ce5=_0x4543[_0x59dae7];return _0x4d3ce5;};'use strict';var multer=require('multer');var util=require(_0x3454('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3454('0x1'));var router=express[_0x3454('0x2')]();var fs_extra=require(_0x3454('0x3'));var auth=require(_0x3454('0x4'));var interaction=require(_0x3454('0x5'));var config=require(_0x3454('0x6'));var controller=require('./intZendeskField.controller');router['get']('/',auth[_0x3454('0x7')](),controller[_0x3454('0x8')]);router[_0x3454('0x9')](_0x3454('0xa'),auth[_0x3454('0x7')](),controller[_0x3454('0xb')]);router['post']('/',auth[_0x3454('0x7')](),controller[_0x3454('0xc')]);router['put'](_0x3454('0xa'),auth[_0x3454('0x7')](),controller[_0x3454('0xd')]);router[_0x3454('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x3454('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index e68437b..4419609 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 _0xfe03=['sequelize','exports','string','variable','keyValue','picklist','STRING','ENUM','customVariable','BOOLEAN'];(function(_0x14fedc,_0x36a213){var _0x538f1f=function(_0x139f5d){while(--_0x139f5d){_0x14fedc['push'](_0x14fedc['shift']());}};_0x538f1f(++_0x36a213);}(_0xfe03,0x122));var _0x3fe0=function(_0x54b283,_0x5eb8a6){_0x54b283=_0x54b283-0x0;var _0x2462b3=_0xfe03[_0x54b283];return _0x2462b3;};'use strict';var Sequelize=require(_0x3fe0('0x0'));module[_0x3fe0('0x1')]={'type':{'type':Sequelize['ENUM'](_0x3fe0('0x2'),_0x3fe0('0x3'),'customVariable',_0x3fe0('0x4'),_0x3fe0('0x5')),'defaultValue':_0x3fe0('0x2')},'content':{'type':Sequelize[_0x3fe0('0x6')]},'key':{'type':Sequelize[_0x3fe0('0x6')]},'keyType':{'type':Sequelize[_0x3fe0('0x7')](_0x3fe0('0x2'),_0x3fe0('0x3'),_0x3fe0('0x8'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x3fe0('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x3fe0('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3fe0('0x6')]}}; \ No newline at end of file +var _0xd857=['customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd857,0x16d));var _0x7d85=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xd857[_0x4b055c];return _0x4b62bb;};'use strict';var Sequelize=require(_0x7d85('0x0'));module[_0x7d85('0x1')]={'type':{'type':Sequelize[_0x7d85('0x2')](_0x7d85('0x3'),_0x7d85('0x4'),_0x7d85('0x5'),_0x7d85('0x6'),_0x7d85('0x7')),'defaultValue':_0x7d85('0x3')},'content':{'type':Sequelize[_0x7d85('0x8')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x7d85('0x2')]('string',_0x7d85('0x4'),_0x7d85('0x5'))},'keyContent':{'type':Sequelize[_0x7d85('0x8')]},'idField':{'type':Sequelize[_0x7d85('0x8')]},'nameField':{'type':Sequelize[_0x7d85('0x8')]},'customField':{'type':Sequelize[_0x7d85('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7d85('0x8')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 0d5235a..4436ffe 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 _0x9336=['fs-extra','lodash','squel','crypto','jsforce','desk.js','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','limit','count','set','Content-Range','save','update','then','error','name','send','index','map','ZendeskField','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','includeAll','include','rows','params','options','find','catch','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs'];(function(_0x5de02c,_0x2bca83){var _0x5bee77=function(_0x447356){while(--_0x447356){_0x5de02c['push'](_0x5de02c['shift']());}};_0x5bee77(++_0x2bca83);}(_0x9336,0x1a5));var _0x6933=function(_0x45cd92,_0x202715){_0x45cd92=_0x45cd92-0x0;var _0x54b4d4=_0x9336[_0x45cd92];return _0x54b4d4;};'use strict';var emlformat=require(_0x6933('0x0'));var rimraf=require(_0x6933('0x1'));var zipdir=require(_0x6933('0x2'));var jsonpatch=require(_0x6933('0x3'));var rp=require('request-promise');var moment=require(_0x6933('0x4'));var BPromise=require(_0x6933('0x5'));var Mustache=require(_0x6933('0x6'));var util=require(_0x6933('0x7'));var path=require('path');var sox=require(_0x6933('0x8'));var csv=require(_0x6933('0x9'));var ejs=require(_0x6933('0xa'));var fs=require('fs');var fs_extra=require(_0x6933('0xb'));var _=require(_0x6933('0xc'));var squel=require(_0x6933('0xd'));var crypto=require(_0x6933('0xe'));var jsforce=require(_0x6933('0xf'));var deskjs=require(_0x6933('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6933('0x11'));var as=require(_0x6933('0x12'));var hardwareService=require(_0x6933('0x13'));var logger=require(_0x6933('0x14'))(_0x6933('0x15'));var utils=require(_0x6933('0x16'));var config=require(_0x6933('0x17'));var licenseUtil=require(_0x6933('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x137b4e,_0x1608b3){_0x1608b3=_0x1608b3||0xcc;return function(_0x584dbe){if(_0x584dbe){return _0x137b4e[_0x6933('0x19')](_0x1608b3);}return _0x137b4e['status'](_0x1608b3)[_0x6933('0x1a')]();};}function respondWithResult(_0x28ed99,_0x2819f0){_0x2819f0=_0x2819f0||0xc8;return function(_0x40cb80){if(_0x40cb80){return _0x28ed99[_0x6933('0x1b')](_0x2819f0)[_0x6933('0x1c')](_0x40cb80);}};}function respondWithFilteredResult(_0x2fcba2,_0x9cc7d){return function(_0x2ca2bc){if(_0x2ca2bc){var _0x5a98fc=typeof _0x9cc7d[_0x6933('0x1d')]==='undefined'&&typeof _0x9cc7d[_0x6933('0x1e')]==='undefined';var _0x5f751b=_0x2ca2bc[_0x6933('0x1f')];var _0x14bec0=_0x5a98fc?0x0:_0x9cc7d[_0x6933('0x1d')];var _0x520d18=_0x5a98fc?_0x2ca2bc['count']:_0x9cc7d[_0x6933('0x1d')]+_0x9cc7d[_0x6933('0x1e')];var _0x40dda7;if(_0x520d18>=_0x5f751b){_0x520d18=_0x5f751b;_0x40dda7=0xc8;}else{_0x40dda7=0xce;}_0x2fcba2['status'](_0x40dda7);return _0x2fcba2[_0x6933('0x20')](_0x6933('0x21'),_0x14bec0+'-'+_0x520d18+'/'+_0x5f751b)[_0x6933('0x1c')](_0x2ca2bc);}return null;};}function patchUpdates(_0xc62c42){return function(_0xbd8a1e){try{jsonpatch['apply'](_0xbd8a1e,_0xc62c42,!![]);}catch(_0x32b2fb){return BPromise['reject'](_0x32b2fb);}return _0xbd8a1e[_0x6933('0x22')]();};}function saveUpdates(_0x427cbc,_0x4ba6e6){return function(_0x34f76d){if(_0x34f76d){return _0x34f76d[_0x6933('0x23')](_0x427cbc)[_0x6933('0x24')](function(_0x809e03){return _0x809e03;});}return null;};}function removeEntity(_0x459b09,_0x242bfc){return function(_0x37905d){if(_0x37905d){return _0x37905d['destroy']()[_0x6933('0x24')](function(){_0x459b09[_0x6933('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x187e97,_0x253db2){return function(_0x437595){if(!_0x437595){_0x187e97[_0x6933('0x19')](0x194);}return _0x437595;};}function handleError(_0x573d80,_0x3c5635){_0x3c5635=_0x3c5635||0x1f4;return function(_0x5db5d3){logger[_0x6933('0x25')](_0x5db5d3['stack']);if(_0x5db5d3[_0x6933('0x26')]){delete _0x5db5d3[_0x6933('0x26')];}_0x573d80['status'](_0x3c5635)[_0x6933('0x27')](_0x5db5d3);};}exports[_0x6933('0x28')]=function(_0x182388,_0x34085a){var _0xdbddc2={},_0x27ab48={},_0x5d31db={'count':0x0,'rows':[]};var _0x525d21=_[_0x6933('0x29')](db[_0x6933('0x2a')][_0x6933('0x2b')],function(_0x1d6e1){return{'name':_0x1d6e1['fieldName'],'type':_0x1d6e1[_0x6933('0x2c')][_0x6933('0x2d')]};});_0x27ab48[_0x6933('0x2e')]=_[_0x6933('0x29')](_0x525d21,_0x6933('0x26'));_0x27ab48[_0x6933('0x2f')]=_[_0x6933('0x30')](_0x182388['query']);_0x27ab48[_0x6933('0x31')]=_[_0x6933('0x32')](_0x27ab48[_0x6933('0x2e')],_0x27ab48[_0x6933('0x2f')]);_0xdbddc2['attributes']=_[_0x6933('0x32')](_0x27ab48[_0x6933('0x2e')],qs[_0x6933('0x33')](_0x182388[_0x6933('0x2f')][_0x6933('0x33')]));_0xdbddc2[_0x6933('0x34')]=_0xdbddc2['attributes'][_0x6933('0x35')]?_0xdbddc2['attributes']:_0x27ab48[_0x6933('0x2e')];if(!_0x182388[_0x6933('0x2f')][_0x6933('0x36')](_0x6933('0x37'))){_0xdbddc2['limit']=qs[_0x6933('0x1e')](_0x182388[_0x6933('0x2f')][_0x6933('0x1e')]);_0xdbddc2[_0x6933('0x1d')]=qs[_0x6933('0x1d')](_0x182388[_0x6933('0x2f')][_0x6933('0x1d')]);}_0xdbddc2[_0x6933('0x38')]=qs[_0x6933('0x39')](_0x182388['query'][_0x6933('0x39')]);_0xdbddc2[_0x6933('0x3a')]=qs[_0x6933('0x31')](_[_0x6933('0x3b')](_0x182388[_0x6933('0x2f')],_0x27ab48['filters']),_0x525d21);if(_0x182388[_0x6933('0x2f')]['filter']){_0xdbddc2[_0x6933('0x3a')]=_[_0x6933('0x3c')](_0xdbddc2['where'],{'$or':_[_0x6933('0x29')](_0x525d21,function(_0x2cf859){if(_0x2cf859[_0x6933('0x2c')]!==_0x6933('0x3d')){var _0x5512ee={};_0x5512ee[_0x2cf859[_0x6933('0x26')]]={'$like':'%'+_0x182388['query']['filter']+'%'};return _0x5512ee;}})});}_0xdbddc2=_['merge']({},_0xdbddc2,_0x182388['options']);var _0x29f6dc={'where':_0xdbddc2[_0x6933('0x3a')]};return db[_0x6933('0x2a')][_0x6933('0x1f')](_0x29f6dc)[_0x6933('0x24')](function(_0x58b8b7){_0x5d31db[_0x6933('0x1f')]=_0x58b8b7;if(_0x182388[_0x6933('0x2f')][_0x6933('0x3e')]){_0xdbddc2[_0x6933('0x3f')]=[{'all':!![]}];}return db[_0x6933('0x2a')]['findAll'](_0xdbddc2);})[_0x6933('0x24')](function(_0x48f4de){_0x5d31db[_0x6933('0x40')]=_0x48f4de;return _0x5d31db;})['then'](respondWithFilteredResult(_0x34085a,_0xdbddc2))['catch'](handleError(_0x34085a,null));};exports['show']=function(_0x2d9555,_0x12b24e){var _0x1751d4={'raw':!![],'where':{'id':_0x2d9555[_0x6933('0x41')]['id']}},_0x1bcf8f={};_0x1bcf8f[_0x6933('0x2e')]=_[_0x6933('0x30')](db['ZendeskField'][_0x6933('0x2b')]);_0x1bcf8f[_0x6933('0x2f')]=_['keys'](_0x2d9555[_0x6933('0x2f')]);_0x1bcf8f[_0x6933('0x31')]=_[_0x6933('0x32')](_0x1bcf8f[_0x6933('0x2e')],_0x1bcf8f[_0x6933('0x2f')]);_0x1751d4[_0x6933('0x34')]=_['intersection'](_0x1bcf8f[_0x6933('0x2e')],qs[_0x6933('0x33')](_0x2d9555[_0x6933('0x2f')][_0x6933('0x33')]));_0x1751d4[_0x6933('0x34')]=_0x1751d4[_0x6933('0x34')][_0x6933('0x35')]?_0x1751d4[_0x6933('0x34')]:_0x1bcf8f[_0x6933('0x2e')];if(_0x2d9555['query'][_0x6933('0x3e')]){_0x1751d4[_0x6933('0x3f')]=[{'all':!![]}];}_0x1751d4=_['merge']({},_0x1751d4,_0x2d9555[_0x6933('0x42')]);return db[_0x6933('0x2a')][_0x6933('0x43')](_0x1751d4)['then'](handleEntityNotFound(_0x12b24e,null))[_0x6933('0x24')](respondWithResult(_0x12b24e,null))[_0x6933('0x44')](handleError(_0x12b24e,null));};exports[_0x6933('0x45')]=function(_0x1c64ea,_0x394ed3){return db[_0x6933('0x2a')]['create'](_0x1c64ea[_0x6933('0x46')],{})[_0x6933('0x24')](respondWithResult(_0x394ed3,0xc9))[_0x6933('0x44')](handleError(_0x394ed3,null));};exports[_0x6933('0x23')]=function(_0x92770,_0x55072d){if(_0x92770[_0x6933('0x46')]['id']){delete _0x92770[_0x6933('0x46')]['id'];}return db[_0x6933('0x2a')][_0x6933('0x43')]({'where':{'id':_0x92770[_0x6933('0x41')]['id']}})[_0x6933('0x24')](handleEntityNotFound(_0x55072d,null))[_0x6933('0x24')](saveUpdates(_0x92770[_0x6933('0x46')],null))[_0x6933('0x24')](respondWithResult(_0x55072d,null))['catch'](handleError(_0x55072d,null));};exports[_0x6933('0x47')]=function(_0x281959,_0x3588eb){return db[_0x6933('0x2a')]['find']({'where':{'id':_0x281959[_0x6933('0x41')]['id']}})[_0x6933('0x24')](handleEntityNotFound(_0x3588eb,null))[_0x6933('0x24')](removeEntity(_0x3588eb,null))[_0x6933('0x44')](handleError(_0x3588eb,null));}; \ No newline at end of file +var _0xed26=['update','then','destroy','error','name','send','map','ZendeskField','rawAttributes','key','model','query','keys','intersection','fields','attributes','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','include','rows','show','params','find','catch','create','body','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject'];(function(_0x30498a,_0x1d2dfc){var _0x13412f=function(_0x4df8a0){while(--_0x4df8a0){_0x30498a['push'](_0x30498a['shift']());}};_0x13412f(++_0x1d2dfc);}(_0xed26,0x64));var _0x6ed2=function(_0x5ccaf9,_0x2c151b){_0x5ccaf9=_0x5ccaf9-0x0;var _0x59e73b=_0xed26[_0x5ccaf9];return _0x59e73b;};'use strict';var emlformat=require(_0x6ed2('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6ed2('0x1'));var rp=require(_0x6ed2('0x2'));var moment=require(_0x6ed2('0x3'));var BPromise=require(_0x6ed2('0x4'));var Mustache=require(_0x6ed2('0x5'));var util=require('util');var path=require('path');var sox=require(_0x6ed2('0x6'));var csv=require('to-csv');var ejs=require(_0x6ed2('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6ed2('0x8'));var crypto=require(_0x6ed2('0x9'));var jsforce=require(_0x6ed2('0xa'));var deskjs=require(_0x6ed2('0xb'));var toCsv=require('to-csv');var querystring=require(_0x6ed2('0xc'));var Papa=require(_0x6ed2('0xd'));var Redis=require(_0x6ed2('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6ed2('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6ed2('0x10'))(_0x6ed2('0x11'));var utils=require('../../config/utils');var config=require(_0x6ed2('0x12'));var licenseUtil=require(_0x6ed2('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x9bf8e7,_0x1969d){_0x1969d=_0x1969d||0xcc;return function(_0x2d0228){if(_0x2d0228){return _0x9bf8e7[_0x6ed2('0x14')](_0x1969d);}return _0x9bf8e7['status'](_0x1969d)[_0x6ed2('0x15')]();};}function respondWithResult(_0x536239,_0x3ba5c5){_0x3ba5c5=_0x3ba5c5||0xc8;return function(_0x4442e8){if(_0x4442e8){return _0x536239['status'](_0x3ba5c5)[_0x6ed2('0x16')](_0x4442e8);}};}function respondWithFilteredResult(_0xf4c50,_0x6985d4){return function(_0x7a0ad0){if(_0x7a0ad0){var _0x51eb4b=typeof _0x6985d4[_0x6ed2('0x17')]===_0x6ed2('0x18')&&typeof _0x6985d4[_0x6ed2('0x19')]==='undefined';var _0x336b8c=_0x7a0ad0[_0x6ed2('0x1a')];var _0x2b96cb=_0x51eb4b?0x0:_0x6985d4[_0x6ed2('0x17')];var _0x4346e2=_0x51eb4b?_0x7a0ad0[_0x6ed2('0x1a')]:_0x6985d4[_0x6ed2('0x17')]+_0x6985d4[_0x6ed2('0x19')];var _0x4dbb49;if(_0x4346e2>=_0x336b8c){_0x4346e2=_0x336b8c;_0x4dbb49=0xc8;}else{_0x4dbb49=0xce;}_0xf4c50[_0x6ed2('0x1b')](_0x4dbb49);return _0xf4c50[_0x6ed2('0x1c')](_0x6ed2('0x1d'),_0x2b96cb+'-'+_0x4346e2+'/'+_0x336b8c)[_0x6ed2('0x16')](_0x7a0ad0);}return null;};}function patchUpdates(_0x5458ad){return function(_0x1f2fd5){try{jsonpatch[_0x6ed2('0x1e')](_0x1f2fd5,_0x5458ad,!![]);}catch(_0x2a2e6d){return BPromise[_0x6ed2('0x1f')](_0x2a2e6d);}return _0x1f2fd5['save']();};}function saveUpdates(_0x22aedf,_0x12f977){return function(_0x1800b4){if(_0x1800b4){return _0x1800b4[_0x6ed2('0x20')](_0x22aedf)[_0x6ed2('0x21')](function(_0x3ae775){return _0x3ae775;});}return null;};}function removeEntity(_0x2cafac,_0xcb6f72){return function(_0x558c10){if(_0x558c10){return _0x558c10[_0x6ed2('0x22')]()[_0x6ed2('0x21')](function(){_0x2cafac['status'](0xcc)[_0x6ed2('0x15')]();});}};}function handleEntityNotFound(_0x55e398,_0x338734){return function(_0x5a1463){if(!_0x5a1463){_0x55e398[_0x6ed2('0x14')](0x194);}return _0x5a1463;};}function handleError(_0x4254a0,_0x166ced){_0x166ced=_0x166ced||0x1f4;return function(_0x1b3d39){logger[_0x6ed2('0x23')](_0x1b3d39['stack']);if(_0x1b3d39[_0x6ed2('0x24')]){delete _0x1b3d39[_0x6ed2('0x24')];}_0x4254a0[_0x6ed2('0x1b')](_0x166ced)[_0x6ed2('0x25')](_0x1b3d39);};}exports['index']=function(_0x307e59,_0x4dc042){var _0x2af0f4={},_0x5d0ad3={},_0x9a7be4={'count':0x0,'rows':[]};var _0xaf3c1=_[_0x6ed2('0x26')](db[_0x6ed2('0x27')][_0x6ed2('0x28')],function(_0x33ec3c){return{'name':_0x33ec3c['fieldName'],'type':_0x33ec3c['type'][_0x6ed2('0x29')]};});_0x5d0ad3[_0x6ed2('0x2a')]=_[_0x6ed2('0x26')](_0xaf3c1,_0x6ed2('0x24'));_0x5d0ad3[_0x6ed2('0x2b')]=_[_0x6ed2('0x2c')](_0x307e59[_0x6ed2('0x2b')]);_0x5d0ad3['filters']=_[_0x6ed2('0x2d')](_0x5d0ad3[_0x6ed2('0x2a')],_0x5d0ad3[_0x6ed2('0x2b')]);_0x2af0f4['attributes']=_[_0x6ed2('0x2d')](_0x5d0ad3[_0x6ed2('0x2a')],qs[_0x6ed2('0x2e')](_0x307e59[_0x6ed2('0x2b')][_0x6ed2('0x2e')]));_0x2af0f4[_0x6ed2('0x2f')]=_0x2af0f4[_0x6ed2('0x2f')]['length']?_0x2af0f4['attributes']:_0x5d0ad3[_0x6ed2('0x2a')];if(!_0x307e59[_0x6ed2('0x2b')]['hasOwnProperty'](_0x6ed2('0x30'))){_0x2af0f4[_0x6ed2('0x19')]=qs[_0x6ed2('0x19')](_0x307e59[_0x6ed2('0x2b')][_0x6ed2('0x19')]);_0x2af0f4[_0x6ed2('0x17')]=qs[_0x6ed2('0x17')](_0x307e59[_0x6ed2('0x2b')][_0x6ed2('0x17')]);}_0x2af0f4[_0x6ed2('0x31')]=qs[_0x6ed2('0x32')](_0x307e59[_0x6ed2('0x2b')][_0x6ed2('0x32')]);_0x2af0f4[_0x6ed2('0x33')]=qs[_0x6ed2('0x34')](_[_0x6ed2('0x35')](_0x307e59[_0x6ed2('0x2b')],_0x5d0ad3[_0x6ed2('0x34')]),_0xaf3c1);if(_0x307e59[_0x6ed2('0x2b')][_0x6ed2('0x36')]){_0x2af0f4[_0x6ed2('0x33')]=_[_0x6ed2('0x37')](_0x2af0f4[_0x6ed2('0x33')],{'$or':_[_0x6ed2('0x26')](_0xaf3c1,function(_0x15777e){if(_0x15777e[_0x6ed2('0x38')]!==_0x6ed2('0x39')){var _0x449504={};_0x449504[_0x15777e['name']]={'$like':'%'+_0x307e59['query'][_0x6ed2('0x36')]+'%'};return _0x449504;}})});}_0x2af0f4=_[_0x6ed2('0x37')]({},_0x2af0f4,_0x307e59['options']);var _0x1028f1={'where':_0x2af0f4[_0x6ed2('0x33')]};return db[_0x6ed2('0x27')][_0x6ed2('0x1a')](_0x1028f1)[_0x6ed2('0x21')](function(_0xea2f46){_0x9a7be4[_0x6ed2('0x1a')]=_0xea2f46;if(_0x307e59[_0x6ed2('0x2b')]['includeAll']){_0x2af0f4[_0x6ed2('0x3a')]=[{'all':!![]}];}return db[_0x6ed2('0x27')]['findAll'](_0x2af0f4);})[_0x6ed2('0x21')](function(_0x3c186d){_0x9a7be4[_0x6ed2('0x3b')]=_0x3c186d;return _0x9a7be4;})['then'](respondWithFilteredResult(_0x4dc042,_0x2af0f4))['catch'](handleError(_0x4dc042,null));};exports[_0x6ed2('0x3c')]=function(_0x4cffc6,_0x9f2fb5){var _0x4a538a={'raw':!![],'where':{'id':_0x4cffc6[_0x6ed2('0x3d')]['id']}},_0x12ace3={};_0x12ace3['model']=_['keys'](db['ZendeskField'][_0x6ed2('0x28')]);_0x12ace3['query']=_[_0x6ed2('0x2c')](_0x4cffc6[_0x6ed2('0x2b')]);_0x12ace3[_0x6ed2('0x34')]=_[_0x6ed2('0x2d')](_0x12ace3['model'],_0x12ace3[_0x6ed2('0x2b')]);_0x4a538a['attributes']=_[_0x6ed2('0x2d')](_0x12ace3[_0x6ed2('0x2a')],qs[_0x6ed2('0x2e')](_0x4cffc6['query'][_0x6ed2('0x2e')]));_0x4a538a[_0x6ed2('0x2f')]=_0x4a538a[_0x6ed2('0x2f')]['length']?_0x4a538a['attributes']:_0x12ace3['model'];if(_0x4cffc6[_0x6ed2('0x2b')]['includeAll']){_0x4a538a[_0x6ed2('0x3a')]=[{'all':!![]}];}_0x4a538a=_[_0x6ed2('0x37')]({},_0x4a538a,_0x4cffc6['options']);return db[_0x6ed2('0x27')][_0x6ed2('0x3e')](_0x4a538a)[_0x6ed2('0x21')](handleEntityNotFound(_0x9f2fb5,null))[_0x6ed2('0x21')](respondWithResult(_0x9f2fb5,null))[_0x6ed2('0x3f')](handleError(_0x9f2fb5,null));};exports[_0x6ed2('0x40')]=function(_0x3a6241,_0x1332ff){return db[_0x6ed2('0x27')][_0x6ed2('0x40')](_0x3a6241[_0x6ed2('0x41')],{})['then'](respondWithResult(_0x1332ff,0xc9))[_0x6ed2('0x3f')](handleError(_0x1332ff,null));};exports[_0x6ed2('0x20')]=function(_0x22f20d,_0x4e24ae){if(_0x22f20d[_0x6ed2('0x41')]['id']){delete _0x22f20d[_0x6ed2('0x41')]['id'];}return db[_0x6ed2('0x27')]['find']({'where':{'id':_0x22f20d[_0x6ed2('0x3d')]['id']}})[_0x6ed2('0x21')](handleEntityNotFound(_0x4e24ae,null))[_0x6ed2('0x21')](saveUpdates(_0x22f20d[_0x6ed2('0x41')],null))[_0x6ed2('0x21')](respondWithResult(_0x4e24ae,null))['catch'](handleError(_0x4e24ae,null));};exports[_0x6ed2('0x22')]=function(_0x560959,_0x37ba5c){return db[_0x6ed2('0x27')][_0x6ed2('0x3e')]({'where':{'id':_0x560959[_0x6ed2('0x3d')]['id']}})[_0x6ed2('0x21')](handleEntityNotFound(_0x37ba5c,null))[_0x6ed2('0x21')](removeEntity(_0x37ba5c,null))[_0x6ed2('0x3f')](handleError(_0x37ba5c,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index e62347e..469abf7 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 _0x3966=['define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','exports'];(function(_0x29c11c,_0x4a7ee4){var _0x20087e=function(_0x1f372b){while(--_0x1f372b){_0x29c11c['push'](_0x29c11c['shift']());}};_0x20087e(++_0x4a7ee4);}(_0x3966,0x150));var _0x6396=function(_0xc19f4e,_0x458dfb){_0xc19f4e=_0xc19f4e-0x0;var _0x23c2b9=_0x3966[_0xc19f4e];return _0x23c2b9;};'use strict';var _=require(_0x6396('0x0'));var util=require(_0x6396('0x1'));var logger=require(_0x6396('0x2'))(_0x6396('0x3'));var moment=require('moment');var BPromise=require(_0x6396('0x4'));var rp=require(_0x6396('0x5'));var fs=require('fs');var path=require(_0x6396('0x6'));var rimraf=require('rimraf');var config=require(_0x6396('0x7'));var attributes=require('./intZendeskField.attributes');module[_0x6396('0x8')]=function(_0x57d567,_0x9ff2c2){return _0x57d567[_0x6396('0x9')](_0x6396('0xa'),attributes,{'tableName':_0x6396('0xb'),'paranoid':![],'indexes':[{'name':_0x6396('0xc'),'fields':[_0x6396('0xd'),_0x6396('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8d13=['moment','bluebird','path','../../config/environment','exports','define','zendesk_unique_index','lodash','../../config/logger'];(function(_0xbdfd91,_0x222e83){var _0x4e49e2=function(_0x3b2d79){while(--_0x3b2d79){_0xbdfd91['push'](_0xbdfd91['shift']());}};_0x4e49e2(++_0x222e83);}(_0x8d13,0x115));var _0x38d1=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x8d13[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x38d1('0x0'));var util=require('util');var logger=require(_0x38d1('0x1'))('api');var moment=require(_0x38d1('0x2'));var BPromise=require(_0x38d1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x38d1('0x4'));var rimraf=require('rimraf');var config=require(_0x38d1('0x5'));var attributes=require('./intZendeskField.attributes');module[_0x38d1('0x6')]=function(_0x26b863,_0x1a5892){return _0x26b863[_0x38d1('0x7')]('ZendeskField',attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0x38d1('0x8'),'fields':['idField','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 054fa71..76ab651 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 _0x6ed8=['info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','error','message','result','lodash','util','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x35a1cb,_0x5985c3){var _0x2cd095=function(_0x196ced){while(--_0x196ced){_0x35a1cb['push'](_0x35a1cb['shift']());}};_0x2cd095(++_0x5985c3);}(_0x6ed8,0x170));var _0x86ed=function(_0x54229d,_0x3937cd){_0x54229d=_0x54229d-0x0;var _0x9b165e=_0x6ed8[_0x54229d];return _0x9b165e;};'use strict';var _=require(_0x86ed('0x0'));var util=require(_0x86ed('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x86ed('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x86ed('0x3'))['db'];var utils=require(_0x86ed('0x4'));var logger=require('../../config/logger')(_0x86ed('0x5'));var config=require(_0x86ed('0x6'));var jayson=require(_0x86ed('0x7'));var client=jayson[_0x86ed('0x8')][_0x86ed('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x381e10,_0x17bdbb,_0x1afa03){return new BPromise(function(_0x4680cd,_0x557912){return client[_0x86ed('0xa')](_0x381e10,_0x1afa03)[_0x86ed('0xb')](function(_0x26e2b8){logger[_0x86ed('0xc')](_0x86ed('0xd'),_0x17bdbb,_0x86ed('0xe'));logger[_0x86ed('0xf')](_0x86ed('0x10'),_0x17bdbb,'request\x20sent',JSON['stringify'](_0x26e2b8));if(_0x26e2b8[_0x86ed('0x11')]){if(_0x26e2b8[_0x86ed('0x11')]['code']===0x1f4){logger[_0x86ed('0x11')]('ZendeskField,\x20%s,\x20%s',_0x17bdbb,_0x26e2b8[_0x86ed('0x11')]['message']);return _0x557912(_0x26e2b8['error'][_0x86ed('0x12')]);}logger[_0x86ed('0x11')]('ZendeskField,\x20%s,\x20%s',_0x17bdbb,_0x26e2b8[_0x86ed('0x11')][_0x86ed('0x12')]);return _0x4680cd(_0x26e2b8[_0x86ed('0x11')][_0x86ed('0x12')]);}else{logger[_0x86ed('0xc')](_0x86ed('0xd'),_0x17bdbb,_0x86ed('0xe'));_0x4680cd(_0x26e2b8[_0x86ed('0x13')][_0x86ed('0x12')]);}})['catch'](function(_0x237af9){logger[_0x86ed('0x11')]('ZendeskField,\x20%s,\x20%s',_0x17bdbb,_0x237af9);_0x557912(_0x237af9);});});} \ No newline at end of file +var _0xbcee=['code','ZendeskField,\x20%s,\x20%s','message','info','result','catch','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4f7ab3,_0x16b1a8){var _0x5dfc6c=function(_0x37a647){while(--_0x37a647){_0x4f7ab3['push'](_0x4f7ab3['shift']());}};_0x5dfc6c(++_0x16b1a8);}(_0xbcee,0x141));var _0xebce=function(_0x1d60f5,_0x1c3cd2){_0x1d60f5=_0x1d60f5-0x0;var _0x173559=_0xbcee[_0x1d60f5];return _0x173559;};'use strict';var _=require('lodash');var util=require(_0xebce('0x0'));var moment=require('moment');var BPromise=require(_0xebce('0x1'));var rs=require(_0xebce('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xebce('0x3'))['db'];var utils=require(_0xebce('0x4'));var logger=require(_0xebce('0x5'))('rpc');var config=require(_0xebce('0x6'));var jayson=require(_0xebce('0x7'));var client=jayson[_0xebce('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2e82fa,_0x1d3ab,_0x460f45){return new BPromise(function(_0xac46a5,_0x17139e){return client[_0xebce('0x9')](_0x2e82fa,_0x460f45)['then'](function(_0x57ed43){logger['info']('ZendeskField,\x20%s,\x20%s',_0x1d3ab,_0xebce('0xa'));logger[_0xebce('0xb')](_0xebce('0xc'),_0x1d3ab,_0xebce('0xa'),JSON[_0xebce('0xd')](_0x57ed43));if(_0x57ed43[_0xebce('0xe')]){if(_0x57ed43[_0xebce('0xe')][_0xebce('0xf')]===0x1f4){logger[_0xebce('0xe')](_0xebce('0x10'),_0x1d3ab,_0x57ed43[_0xebce('0xe')][_0xebce('0x11')]);return _0x17139e(_0x57ed43['error'][_0xebce('0x11')]);}logger['error'](_0xebce('0x10'),_0x1d3ab,_0x57ed43[_0xebce('0xe')][_0xebce('0x11')]);return _0xac46a5(_0x57ed43['error'][_0xebce('0x11')]);}else{logger[_0xebce('0x12')](_0xebce('0x10'),_0x1d3ab,'request\x20sent');_0xac46a5(_0x57ed43[_0xebce('0x13')][_0xebce('0x11')]);}})[_0xebce('0x14')](function(_0x580a17){logger[_0xebce('0xe')](_0xebce('0x10'),_0x1d3ab,_0x580a17);_0x17139e(_0x580a17);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 2391e8f..d73160c 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 _0x04d6=['getFields','post','create','addConfiguration','delete','destroy','exports','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields'];(function(_0x366270,_0x303631){var _0xe9680e=function(_0x576d45){while(--_0x576d45){_0x366270['push'](_0x366270['shift']());}};_0xe9680e(++_0x303631);}(_0x04d6,0x1ea));var _0x604d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x04d6[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x604d('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x604d('0x1'));var router=express[_0x604d('0x2')]();var fs_extra=require(_0x604d('0x3'));var auth=require(_0x604d('0x4'));var interaction=require(_0x604d('0x5'));var config=require(_0x604d('0x6'));var controller=require('./intZohoAccount.controller');router[_0x604d('0x7')]('/',auth[_0x604d('0x8')](),controller['index']);router[_0x604d('0x7')](_0x604d('0x9'),auth[_0x604d('0x8')](),controller[_0x604d('0xa')]);router[_0x604d('0x7')](_0x604d('0xb'),auth[_0x604d('0x8')](),controller[_0x604d('0xc')]);router[_0x604d('0x7')](_0x604d('0xd'),auth['isAuthenticated'](),controller[_0x604d('0xe')]);router[_0x604d('0xf')]('/',auth[_0x604d('0x8')](),controller[_0x604d('0x10')]);router[_0x604d('0xf')](_0x604d('0xb'),auth['isAuthenticated'](),controller[_0x604d('0x11')]);router['put']('/:id',auth[_0x604d('0x8')](),controller['update']);router[_0x604d('0x12')](_0x604d('0x9'),auth[_0x604d('0x8')](),controller[_0x604d('0x13')]);module[_0x604d('0x14')]=router; \ No newline at end of file +var _0x54b2=['/:id','show','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','put','update','delete','exports','multer','util','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x54b2,0x9f));var _0x254b=function(_0x57bebb,_0x5520b6){_0x57bebb=_0x57bebb-0x0;var _0x2e0585=_0x54b2[_0x57bebb];return _0x2e0585;};'use strict';var multer=require(_0x254b('0x0'));var util=require(_0x254b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x254b('0x2'));var auth=require(_0x254b('0x3'));var interaction=require(_0x254b('0x4'));var config=require(_0x254b('0x5'));var controller=require('./intZohoAccount.controller');router[_0x254b('0x6')]('/',auth[_0x254b('0x7')](),controller[_0x254b('0x8')]);router['get'](_0x254b('0x9'),auth[_0x254b('0x7')](),controller[_0x254b('0xa')]);router[_0x254b('0x6')](_0x254b('0xb'),auth[_0x254b('0x7')](),controller[_0x254b('0xc')]);router['get']('/:id/fields',auth[_0x254b('0x7')](),controller[_0x254b('0xd')]);router[_0x254b('0xe')]('/',auth[_0x254b('0x7')](),controller[_0x254b('0xf')]);router['post'](_0x254b('0xb'),auth[_0x254b('0x7')](),controller[_0x254b('0x10')]);router[_0x254b('0x11')]('/:id',auth[_0x254b('0x7')](),controller[_0x254b('0x12')]);router[_0x254b('0x13')](_0x254b('0x9'),auth[_0x254b('0x7')](),controller['destroy']);module[_0x254b('0x14')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 7280aa6..9cad554 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 _0x153f=['exports','STRING','sequelize'];(function(_0x4063a4,_0x19d730){var _0x17908d=function(_0x3ce714){while(--_0x3ce714){_0x4063a4['push'](_0x4063a4['shift']());}};_0x17908d(++_0x19d730);}(_0x153f,0x15b));var _0xf153=function(_0x55d5dd,_0xb59933){_0x55d5dd=_0x55d5dd-0x0;var _0x1f7f8d=_0x153f[_0x55d5dd];return _0x1f7f8d;};'use strict';var Sequelize=require(_0xf153('0x0'));module[_0xf153('0x1')]={'name':{'type':Sequelize[_0xf153('0x2')]},'description':{'type':Sequelize[_0xf153('0x2')]},'host':{'type':Sequelize[_0xf153('0x2')]},'zone':{'type':Sequelize[_0xf153('0x2')]},'clientId':{'type':Sequelize[_0xf153('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xf153('0x2')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0xf153('0x2')]}}; \ No newline at end of file +var _0x54ef=['STRING','sequelize','exports'];(function(_0x16e690,_0x5d4683){var _0x3beb56=function(_0x547cf5){while(--_0x547cf5){_0x16e690['push'](_0x16e690['shift']());}};_0x3beb56(++_0x5d4683);}(_0x54ef,0x112));var _0xf54e=function(_0x392596,_0x26ddcc){_0x392596=_0x392596-0x0;var _0x1a7f35=_0x54ef[_0x392596];return _0x1a7f35;};'use strict';var Sequelize=require(_0xf54e('0x0'));module[_0xf54e('0x1')]={'name':{'type':Sequelize[_0xf54e('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xf54e('0x2')]},'zone':{'type':Sequelize[_0xf54e('0x2')]},'clientId':{'type':Sequelize[_0xf54e('0x2')]},'clientSecret':{'type':Sequelize[_0xf54e('0x2')]},'serverUrl':{'type':Sequelize[_0xf54e('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0xf54e('0x2')]},'refreshToken':{'type':Sequelize[_0xf54e('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 683fad3..52f9af3 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 _0xa505=['channel','ZohoField','Descriptions','zone','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','clientId','serverUrl','code','refreshToken','host','zoho.eu','com','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','response','message','Owner','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','includes','api_name','system_mandatory','display_label','custom_field','data_type','picklist','pick_list_values','statusCode','getFields','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','ZohoAccount','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','ZohoConfiguration','order','filter','getConfigurations','hasOwnProperty','nolimit','addConfiguration','findOne','AccountId','Subjects','getSubjects','getDescriptions'];(function(_0x14c5f1,_0x31e408){var _0x478efb=function(_0x43ddb3){while(--_0x43ddb3){_0x14c5f1['push'](_0x14c5f1['shift']());}};_0x478efb(++_0x31e408);}(_0xa505,0x13b));var _0x5a50=function(_0x141e4a,_0x111e03){_0x141e4a=_0x141e4a-0x0;var _0x3e6800=_0xa505[_0x141e4a];return _0x3e6800;};'use strict';var emlformat=require(_0x5a50('0x0'));var rimraf=require(_0x5a50('0x1'));var zipdir=require(_0x5a50('0x2'));var jsonpatch=require(_0x5a50('0x3'));var rp=require(_0x5a50('0x4'));var moment=require(_0x5a50('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5a50('0x6'));var util=require('util');var path=require(_0x5a50('0x7'));var sox=require('sox');var csv=require(_0x5a50('0x8'));var ejs=require(_0x5a50('0x9'));var fs=require('fs');var fs_extra=require(_0x5a50('0xa'));var _=require(_0x5a50('0xb'));var squel=require(_0x5a50('0xc'));var crypto=require(_0x5a50('0xd'));var jsforce=require(_0x5a50('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5a50('0x8'));var querystring=require(_0x5a50('0xf'));var Papa=require('papaparse');var Redis=require(_0x5a50('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5a50('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5a50('0x12'));var logger=require(_0x5a50('0x13'))('api');var utils=require(_0x5a50('0x14'));var config=require(_0x5a50('0x15'));var licenseUtil=require(_0x5a50('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0x5a50('0x17'));function respondWithStatusCode(_0x4ad80e,_0x320685){_0x320685=_0x320685||0xcc;return function(_0xf2c700){if(_0xf2c700){return _0x4ad80e['sendStatus'](_0x320685);}return _0x4ad80e['status'](_0x320685)[_0x5a50('0x18')]();};}function respondWithResult(_0x320f6b,_0x311625){_0x311625=_0x311625||0xc8;return function(_0xf49b75){if(_0xf49b75){return _0x320f6b[_0x5a50('0x19')](_0x311625)[_0x5a50('0x1a')](_0xf49b75);}};}function respondWithFilteredResult(_0x269348,_0x848e4a){return function(_0x184761){if(_0x184761){var _0x947f85=typeof _0x848e4a[_0x5a50('0x1b')]===_0x5a50('0x1c')&&typeof _0x848e4a[_0x5a50('0x1d')]===_0x5a50('0x1c');var _0x35ee41=_0x184761[_0x5a50('0x1e')];var _0x269648=_0x947f85?0x0:_0x848e4a[_0x5a50('0x1b')];var _0x1018b4=_0x947f85?_0x184761[_0x5a50('0x1e')]:_0x848e4a[_0x5a50('0x1b')]+_0x848e4a[_0x5a50('0x1d')];var _0x3a4546;if(_0x1018b4>=_0x35ee41){_0x1018b4=_0x35ee41;_0x3a4546=0xc8;}else{_0x3a4546=0xce;}_0x269348['status'](_0x3a4546);return _0x269348[_0x5a50('0x1f')](_0x5a50('0x20'),_0x269648+'-'+_0x1018b4+'/'+_0x35ee41)[_0x5a50('0x1a')](_0x184761);}return null;};}function patchUpdates(_0xd8f2a4){return function(_0x3cbc30){try{jsonpatch[_0x5a50('0x21')](_0x3cbc30,_0xd8f2a4,!![]);}catch(_0x1968a8){return BPromise[_0x5a50('0x22')](_0x1968a8);}return _0x3cbc30[_0x5a50('0x23')]();};}function saveUpdates(_0x492abd,_0x342572){return function(_0x10a3ec){if(_0x10a3ec){return _0x10a3ec[_0x5a50('0x24')](_0x492abd)[_0x5a50('0x25')](function(_0x4c059e){return _0x4c059e;});}return null;};}function removeEntity(_0xcd6d8f,_0x485014){return function(_0x2611f6){if(_0x2611f6){return _0x2611f6[_0x5a50('0x26')]()[_0x5a50('0x25')](function(){_0xcd6d8f[_0x5a50('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40ee5c,_0x542ae4){return function(_0x2d428d){if(!_0x2d428d){_0x40ee5c[_0x5a50('0x27')](0x194);}return _0x2d428d;};}function handleError(_0x770097,_0x6c44fa){_0x6c44fa=_0x6c44fa||0x1f4;return function(_0x206ce5){logger[_0x5a50('0x28')](_0x206ce5[_0x5a50('0x29')]);if(_0x206ce5['name']){delete _0x206ce5[_0x5a50('0x2a')];}_0x770097[_0x5a50('0x19')](_0x6c44fa)[_0x5a50('0x2b')](_0x206ce5);};}exports[_0x5a50('0x2c')]=function(_0x3e8163,_0x3ea835){var _0x3427e5={},_0x43b8cd={},_0x5c88bb={'count':0x0,'rows':[]};var _0x575683=_[_0x5a50('0x2d')](db[_0x5a50('0x2e')]['rawAttributes'],function(_0x510fa6){return{'name':_0x510fa6[_0x5a50('0x2f')],'type':_0x510fa6[_0x5a50('0x30')][_0x5a50('0x31')]};});_0x43b8cd[_0x5a50('0x32')]=_[_0x5a50('0x2d')](_0x575683,_0x5a50('0x2a'));_0x43b8cd['query']=_[_0x5a50('0x33')](_0x3e8163[_0x5a50('0x34')]);_0x43b8cd[_0x5a50('0x35')]=_['intersection'](_0x43b8cd['model'],_0x43b8cd['query']);_0x3427e5[_0x5a50('0x36')]=_[_0x5a50('0x37')](_0x43b8cd['model'],qs[_0x5a50('0x38')](_0x3e8163[_0x5a50('0x34')][_0x5a50('0x38')]));_0x3427e5[_0x5a50('0x36')]=_0x3427e5[_0x5a50('0x36')][_0x5a50('0x39')]?_0x3427e5[_0x5a50('0x36')]:_0x43b8cd[_0x5a50('0x32')];if(!_0x3e8163[_0x5a50('0x34')]['hasOwnProperty']('nolimit')){_0x3427e5[_0x5a50('0x1d')]=qs['limit'](_0x3e8163[_0x5a50('0x34')][_0x5a50('0x1d')]);_0x3427e5[_0x5a50('0x1b')]=qs[_0x5a50('0x1b')](_0x3e8163['query'][_0x5a50('0x1b')]);}_0x3427e5['order']=qs[_0x5a50('0x3a')](_0x3e8163[_0x5a50('0x34')][_0x5a50('0x3a')]);_0x3427e5[_0x5a50('0x3b')]=qs[_0x5a50('0x35')](_[_0x5a50('0x3c')](_0x3e8163[_0x5a50('0x34')],_0x43b8cd[_0x5a50('0x35')]),_0x575683);if(_0x3e8163['query']['filter']){_0x3427e5[_0x5a50('0x3b')]=_[_0x5a50('0x3d')](_0x3427e5[_0x5a50('0x3b')],{'$or':_[_0x5a50('0x2d')](_0x575683,function(_0x5bb4b2){if(_0x5bb4b2[_0x5a50('0x30')]!==_0x5a50('0x3e')){var _0x86a692={};_0x86a692[_0x5bb4b2[_0x5a50('0x2a')]]={'$like':'%'+_0x3e8163[_0x5a50('0x34')]['filter']+'%'};return _0x86a692;}})});}_0x3427e5=_[_0x5a50('0x3d')]({},_0x3427e5,_0x3e8163[_0x5a50('0x3f')]);var _0x39541f={'where':_0x3427e5['where']};return db['ZohoAccount']['count'](_0x39541f)[_0x5a50('0x25')](function(_0x25f254){_0x5c88bb[_0x5a50('0x1e')]=_0x25f254;if(_0x3e8163[_0x5a50('0x34')][_0x5a50('0x40')]){_0x3427e5[_0x5a50('0x41')]=[{'all':!![]}];}return db[_0x5a50('0x2e')][_0x5a50('0x42')](_0x3427e5);})['then'](function(_0x10052b){_0x5c88bb[_0x5a50('0x43')]=_0x10052b;return _0x5c88bb;})[_0x5a50('0x25')](respondWithFilteredResult(_0x3ea835,_0x3427e5))[_0x5a50('0x44')](handleError(_0x3ea835,null));};exports[_0x5a50('0x45')]=function(_0x6df715,_0x8f760a){var _0x2bfe00={'raw':![],'where':{'id':_0x6df715[_0x5a50('0x46')]['id']}},_0x163f86={};_0x163f86[_0x5a50('0x32')]=_['keys'](db[_0x5a50('0x2e')][_0x5a50('0x47')]);_0x163f86[_0x5a50('0x34')]=_[_0x5a50('0x33')](_0x6df715[_0x5a50('0x34')]);_0x163f86[_0x5a50('0x35')]=_[_0x5a50('0x37')](_0x163f86[_0x5a50('0x32')],_0x163f86[_0x5a50('0x34')]);_0x2bfe00[_0x5a50('0x36')]=_[_0x5a50('0x37')](_0x163f86[_0x5a50('0x32')],qs[_0x5a50('0x38')](_0x6df715[_0x5a50('0x34')][_0x5a50('0x38')]));_0x2bfe00['attributes']=_0x2bfe00['attributes'][_0x5a50('0x39')]?_0x2bfe00[_0x5a50('0x36')]:_0x163f86[_0x5a50('0x32')];if(_0x6df715[_0x5a50('0x34')][_0x5a50('0x40')]){_0x2bfe00['include']=[{'all':!![]}];}_0x2bfe00=_[_0x5a50('0x3d')]({},_0x2bfe00,_0x6df715[_0x5a50('0x3f')]);return db[_0x5a50('0x2e')][_0x5a50('0x48')](_0x2bfe00)[_0x5a50('0x25')](handleEntityNotFound(_0x8f760a,null))['then'](respondWithResult(_0x8f760a,null))[_0x5a50('0x44')](handleError(_0x8f760a,null));};exports[_0x5a50('0x49')]=function(_0x3babee,_0x2a9e7e){return db[_0x5a50('0x2e')]['create'](_0x3babee[_0x5a50('0x4a')],{})[_0x5a50('0x25')](respondWithResult(_0x2a9e7e,0xc9))[_0x5a50('0x44')](handleError(_0x2a9e7e,null));};exports[_0x5a50('0x24')]=function(_0x440033,_0xab2eba){if(_0x440033[_0x5a50('0x4a')]['id']){delete _0x440033[_0x5a50('0x4a')]['id'];}return db[_0x5a50('0x2e')][_0x5a50('0x48')]({'where':{'id':_0x440033[_0x5a50('0x46')]['id']}})[_0x5a50('0x25')](handleEntityNotFound(_0xab2eba,null))['then'](saveUpdates(_0x440033[_0x5a50('0x4a')],null))[_0x5a50('0x25')](respondWithResult(_0xab2eba,null))[_0x5a50('0x44')](handleError(_0xab2eba,null));};exports[_0x5a50('0x26')]=function(_0x3a5e9b,_0x3ae2c3){return db[_0x5a50('0x2e')]['find']({'where':{'id':_0x3a5e9b[_0x5a50('0x46')]['id']}})[_0x5a50('0x25')](handleEntityNotFound(_0x3ae2c3,null))['then'](removeEntity(_0x3ae2c3,null))['catch'](handleError(_0x3ae2c3,null));};exports['getConfigurations']=function(_0xf16873,_0x2d78bd,_0x4cab50){var _0x82edad={};var _0x28bd47={};var _0x2494cb;var _0x3ddcdc;return db[_0x5a50('0x2e')]['findOne']({'where':{'id':_0xf16873[_0x5a50('0x46')]['id']}})[_0x5a50('0x25')](handleEntityNotFound(_0x2d78bd,null))[_0x5a50('0x25')](function(_0x17fe9e){if(_0x17fe9e){_0x2494cb=_0x17fe9e;_0x28bd47[_0x5a50('0x32')]=_[_0x5a50('0x33')](db[_0x5a50('0x4b')][_0x5a50('0x47')]);_0x28bd47[_0x5a50('0x34')]=_[_0x5a50('0x33')](_0xf16873[_0x5a50('0x34')]);_0x28bd47[_0x5a50('0x35')]=_['intersection'](_0x28bd47['model'],_0x28bd47[_0x5a50('0x34')]);_0x82edad[_0x5a50('0x36')]=_[_0x5a50('0x37')](_0x28bd47[_0x5a50('0x32')],qs['fields'](_0xf16873[_0x5a50('0x34')][_0x5a50('0x38')]));_0x82edad[_0x5a50('0x36')]=_0x82edad[_0x5a50('0x36')]['length']?_0x82edad[_0x5a50('0x36')]:_0x28bd47['model'];_0x82edad[_0x5a50('0x4c')]=qs[_0x5a50('0x3a')](_0xf16873[_0x5a50('0x34')][_0x5a50('0x3a')]);_0x82edad[_0x5a50('0x3b')]=qs[_0x5a50('0x35')](_['pick'](_0xf16873[_0x5a50('0x34')],_0x28bd47['filters']));if(_0xf16873[_0x5a50('0x34')][_0x5a50('0x4d')]){_0x82edad[_0x5a50('0x3b')]=_[_0x5a50('0x3d')](_0x82edad['where'],{'$or':_[_0x5a50('0x2d')](_0x82edad[_0x5a50('0x36')],function(_0x3b8979){var _0x53e4d5={};_0x53e4d5[_0x3b8979]={'$like':'%'+_0xf16873[_0x5a50('0x34')][_0x5a50('0x4d')]+'%'};return _0x53e4d5;})});}_0x82edad=_[_0x5a50('0x3d')]({},_0x82edad,_0xf16873[_0x5a50('0x3f')]);return _0x2494cb[_0x5a50('0x4e')](_0x82edad);}})['then'](function(_0x59a4bd){if(_0x59a4bd){_0x3ddcdc=_0x59a4bd[_0x5a50('0x39')];if(!_0xf16873[_0x5a50('0x34')][_0x5a50('0x4f')](_0x5a50('0x50'))){_0x82edad[_0x5a50('0x1d')]=qs[_0x5a50('0x1d')](_0xf16873[_0x5a50('0x34')][_0x5a50('0x1d')]);_0x82edad[_0x5a50('0x1b')]=qs[_0x5a50('0x1b')](_0xf16873['query'][_0x5a50('0x1b')]);}return _0x2494cb[_0x5a50('0x4e')](_0x82edad);}})[_0x5a50('0x25')](function(_0x3c9c33){if(_0x3c9c33){return _0x3c9c33?{'count':_0x3ddcdc,'rows':_0x3c9c33}:null;}})[_0x5a50('0x25')](respondWithResult(_0x2d78bd,null))[_0x5a50('0x44')](handleError(_0x2d78bd,null));};exports[_0x5a50('0x51')]=function(_0x4bf91e,_0xe3e8ea,_0xa116dd){if(_0x4bf91e['body']['id']){delete _0x4bf91e[_0x5a50('0x4a')]['id'];}return db[_0x5a50('0x2e')][_0x5a50('0x52')]({'where':{'id':_0x4bf91e[_0x5a50('0x46')]['id']}})[_0x5a50('0x25')](handleEntityNotFound(_0xe3e8ea,null))[_0x5a50('0x25')](function(_0x178ef5){if(_0x178ef5){_0x4bf91e[_0x5a50('0x4a')][_0x5a50('0x53')]=_0x178ef5['id'];_0x4bf91e[_0x5a50('0x4a')][_0x5a50('0x54')]=integrations[_0x5a50('0x55')](_0x4bf91e[_0x5a50('0x4a')]['channel'],_0x4bf91e[_0x5a50('0x4a')][_0x5a50('0x30')]);_0x4bf91e['body']['Descriptions']=integrations[_0x5a50('0x56')](_0x4bf91e[_0x5a50('0x4a')][_0x5a50('0x57')],_0x4bf91e[_0x5a50('0x4a')][_0x5a50('0x30')]);return db[_0x5a50('0x4b')][_0x5a50('0x49')](_0x4bf91e['body'],{'include':[{'model':db[_0x5a50('0x58')],'as':'Subjects'},{'model':db[_0x5a50('0x58')],'as':_0x5a50('0x59')}]});}return null;})['then'](respondWithResult(_0xe3e8ea,null))[_0x5a50('0x44')](handleError(_0xe3e8ea,null));};function getAccessToken(_0x4d7f80){return new Promise(function(_0x429441,_0x1622cd){var _0x5f3f8c;switch(_0x4d7f80[_0x5a50('0x5a')]){case'US':_0x5f3f8c='https://accounts.zoho.com';break;case'AU':_0x5f3f8c=_0x5a50('0x5b');break;case'EU':_0x5f3f8c=_0x5a50('0x5c');break;case'IN':_0x5f3f8c=_0x5a50('0x5d');break;case'CN':_0x5f3f8c=_0x5a50('0x5e');break;default:_0x5f3f8c=_0x5a50('0x5c');break;}var _0x1d64fe={'method':'POST','uri':_0x5f3f8c+_0x5a50('0x5f'),'qs':{'refresh_token':_0x4d7f80['refreshToken'],'client_id':_0x4d7f80['clientId'],'client_secret':_0x4d7f80[_0x5a50('0x60')],'grant_type':_0x5a50('0x61')},'json':!![]};return rp(_0x1d64fe)[_0x5a50('0x25')](function(_0x1185f4){if(_0x1185f4[_0x5a50('0x62')]){_0x429441(_0x1185f4['access_token']);}else{_0x1622cd(_0x5a50('0x63'));}})[_0x5a50('0x44')](function(_0x54c784){_0x1622cd(_0x54c784);});});}exports['getFields']=function(_0x23eabd,_0x29a686,_0x52656f){var _0x2fe227,_0xf58035,_0x2aafac,_0x656b2a,_0x5db164;return db['ZohoAccount'][_0x5a50('0x52')]({'where':{'id':_0x23eabd['params']['id']},'attributes':['id','host',_0x5a50('0x5a'),_0x5a50('0x64'),_0x5a50('0x60'),_0x5a50('0x65'),_0x5a50('0x66'),_0x5a50('0x67')]})[_0x5a50('0x25')](handleEntityNotFound(_0x29a686,null))[_0x5a50('0x25')](function(_0x23c5cd){_0x5db164=_0x23c5cd;_0x2fe227=_0x5db164[_0x5a50('0x68')];_0xf58035=_0x2fe227===_0x5a50('0x69')?'eu':_0x5a50('0x6a');_0x2aafac=_0x5db164[_0x5a50('0x65')];var _0x93d4de=_0x2aafac['slice'](-0x1);if(_0x93d4de==='/'||_0x93d4de==='\x5c'||_0x93d4de===':'){_0x2aafac=_0x2aafac['substring'](0x0,_0x2aafac[_0x5a50('0x6b')](_0x93d4de));}if(!_0x5db164[_0x5a50('0x67')]){throw new Error(_0x5a50('0x6c'));}return getAccessToken(_0x5db164);})['then'](function(_0x40ca42){if(_0x40ca42){return rp({'method':'GET','uri':util[_0x5a50('0x6d')](_0x5a50('0x6e'),_0xf58035),'qs':{'module':_0x5a50('0x6f')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x40ca42},'json':!![]});}})[_0x5a50('0x25')](function(_0x542c70){if(_0x542c70){if(_0x542c70[_0x5a50('0x70')]&&_0x542c70['response'][_0x5a50('0x28')]){throw new Error(_0x542c70[_0x5a50('0x70')][_0x5a50('0x28')][_0x5a50('0x71')]);}var _0x1fc740=[];var _0x7bf5cd=[];var _0x1bde0c=[_0x5a50('0x72'),_0x5a50('0x73'),_0x5a50('0x74'),_0x5a50('0x75'),_0x5a50('0x76'),_0x5a50('0x77'),_0x5a50('0x78'),_0x5a50('0x79')];_0x7bf5cd=_['remove'](_0x542c70[_0x5a50('0x38')],function(_0x294dc3){return _0x1bde0c[_0x5a50('0x7a')](_0x294dc3[_0x5a50('0x7b')]);});for(var _0x1613b4=0x0;_0x1613b4<_0x7bf5cd[_0x5a50('0x39')];_0x1613b4++){if(_0x7bf5cd[_0x1613b4][_0x5a50('0x7c')]===![]){_0x1fc740['push']({'id':_0x7bf5cd[_0x1613b4]['id'],'name':_0x7bf5cd[_0x1613b4][_0x5a50('0x7d')],'custom':_0x7bf5cd[_0x1613b4][_0x5a50('0x7e')],'options':_0x7bf5cd[_0x1613b4][_0x5a50('0x7f')]===_0x5a50('0x80')&&_0x7bf5cd[_0x1613b4][_0x5a50('0x81')][_0x5a50('0x39')]>-0x1?_[_0x5a50('0x2d')](_0x7bf5cd[_0x1613b4]['pick_list_values'],function(_0x324aae){return{'name':_0x324aae,'value':_0x324aae};}):[]});}}return{'count':_0x1fc740[_0x5a50('0x39')],'rows':_0x1fc740};}else{return{'count':0x0,'rows':[]};}})[_0x5a50('0x25')](respondWithResult(_0x29a686,null))[_0x5a50('0x44')](function(_0x560c0b){var _0x241001=_0x23eabd['query']['test']?0x1f4:_0x560c0b[_0x5a50('0x82')]||0x1f4;logger[_0x5a50('0x28')]('getFields,\x20%s,\x20%s,\x20%s',_0x5a50('0x83'),_0x241001,JSON['stringify'](_0x560c0b));delete _0x560c0b[_0x5a50('0x2a')];if(_0x241001===0x191){_0x241001=0x190;}_0x29a686['status'](_0x241001)[_0x5a50('0x2b')](_0x23eabd[_0x5a50('0x34')][_0x5a50('0x84')]?{'message':_0x5a50('0x85'),'statusCode':_0x560c0b['statusCode']}:_0x560c0b);});}; \ No newline at end of file +var _0x8552=['clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','serverUrl','code','zoho.eu','com','slice','substring','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','Zoho-oauthtoken\x20','response','error','Subject','Description','WhoId','Call_Duration','Call_Start_Time','includes','api_name','system_mandatory','push','display_label','data_type','picklist','pick_list_values','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','undefined','limit','count','offset','apply','reject','save','update','then','destroy','end','stack','send','index','ZohoAccount','rawAttributes','fieldName','type','model','map','keys','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','name','includeAll','include','findAll','catch','show','params','options','find','create','body','getConfigurations','findOne','ZohoConfiguration','merge','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientId'];(function(_0x57da0a,_0x284aed){var _0x3145d5=function(_0xfe7c3b){while(--_0xfe7c3b){_0x57da0a['push'](_0x57da0a['shift']());}};_0x3145d5(++_0x284aed);}(_0x8552,0x12c));var _0x2855=function(_0x4cc3e3,_0x3cff2e){_0x4cc3e3=_0x4cc3e3-0x0;var _0x4982f4=_0x8552[_0x4cc3e3];return _0x4982f4;};'use strict';var emlformat=require(_0x2855('0x0'));var rimraf=require(_0x2855('0x1'));var zipdir=require(_0x2855('0x2'));var jsonpatch=require(_0x2855('0x3'));var rp=require(_0x2855('0x4'));var moment=require('moment');var BPromise=require(_0x2855('0x5'));var Mustache=require(_0x2855('0x6'));var util=require('util');var path=require(_0x2855('0x7'));var sox=require('sox');var csv=require(_0x2855('0x8'));var ejs=require(_0x2855('0x9'));var fs=require('fs');var fs_extra=require(_0x2855('0xa'));var _=require(_0x2855('0xb'));var squel=require('squel');var crypto=require(_0x2855('0xc'));var jsforce=require(_0x2855('0xd'));var deskjs=require(_0x2855('0xe'));var toCsv=require(_0x2855('0x8'));var querystring=require(_0x2855('0xf'));var Papa=require(_0x2855('0x10'));var Redis=require('ioredis');var authService=require(_0x2855('0x11'));var qs=require(_0x2855('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2855('0x13'));var logger=require('../../config/logger')(_0x2855('0x14'));var utils=require(_0x2855('0x15'));var config=require(_0x2855('0x16'));var licenseUtil=require(_0x2855('0x17'));var db=require(_0x2855('0x18'))['db'];var integrations=require(_0x2855('0x19'));function respondWithStatusCode(_0x53dd83,_0x57d103){_0x57d103=_0x57d103||0xcc;return function(_0x296cc6){if(_0x296cc6){return _0x53dd83[_0x2855('0x1a')](_0x57d103);}return _0x53dd83[_0x2855('0x1b')](_0x57d103)['end']();};}function respondWithResult(_0x2c066b,_0x46f50d){_0x46f50d=_0x46f50d||0xc8;return function(_0x57adad){if(_0x57adad){return _0x2c066b[_0x2855('0x1b')](_0x46f50d)[_0x2855('0x1c')](_0x57adad);}};}function respondWithFilteredResult(_0x1da4a5,_0xe838f4){return function(_0x5781fd){if(_0x5781fd){var _0x280d64=typeof _0xe838f4['offset']===_0x2855('0x1d')&&typeof _0xe838f4[_0x2855('0x1e')]==='undefined';var _0x112062=_0x5781fd[_0x2855('0x1f')];var _0xe6bb1d=_0x280d64?0x0:_0xe838f4[_0x2855('0x20')];var _0x205f81=_0x280d64?_0x5781fd[_0x2855('0x1f')]:_0xe838f4['offset']+_0xe838f4[_0x2855('0x1e')];var _0x470e26;if(_0x205f81>=_0x112062){_0x205f81=_0x112062;_0x470e26=0xc8;}else{_0x470e26=0xce;}_0x1da4a5['status'](_0x470e26);return _0x1da4a5['set']('Content-Range',_0xe6bb1d+'-'+_0x205f81+'/'+_0x112062)['json'](_0x5781fd);}return null;};}function patchUpdates(_0x50f1ee){return function(_0x30f266){try{jsonpatch[_0x2855('0x21')](_0x30f266,_0x50f1ee,!![]);}catch(_0x15abae){return BPromise[_0x2855('0x22')](_0x15abae);}return _0x30f266[_0x2855('0x23')]();};}function saveUpdates(_0x1f4969,_0x173a2f){return function(_0x5a35f4){if(_0x5a35f4){return _0x5a35f4[_0x2855('0x24')](_0x1f4969)[_0x2855('0x25')](function(_0x29dfb3){return _0x29dfb3;});}return null;};}function removeEntity(_0xc88cb7,_0x2cf68a){return function(_0x2a65e2){if(_0x2a65e2){return _0x2a65e2[_0x2855('0x26')]()[_0x2855('0x25')](function(){_0xc88cb7[_0x2855('0x1b')](0xcc)[_0x2855('0x27')]();});}};}function handleEntityNotFound(_0x1cd349,_0x55288e){return function(_0x128d85){if(!_0x128d85){_0x1cd349[_0x2855('0x1a')](0x194);}return _0x128d85;};}function handleError(_0x81fe69,_0x265036){_0x265036=_0x265036||0x1f4;return function(_0x3cd621){logger['error'](_0x3cd621[_0x2855('0x28')]);if(_0x3cd621['name']){delete _0x3cd621['name'];}_0x81fe69['status'](_0x265036)[_0x2855('0x29')](_0x3cd621);};}exports[_0x2855('0x2a')]=function(_0x4338ab,_0x1feb6b){var _0x225850={},_0x10d0d5={},_0x902063={'count':0x0,'rows':[]};var _0x50a6ac=_['map'](db[_0x2855('0x2b')][_0x2855('0x2c')],function(_0x1f0cad){return{'name':_0x1f0cad[_0x2855('0x2d')],'type':_0x1f0cad[_0x2855('0x2e')]['key']};});_0x10d0d5[_0x2855('0x2f')]=_[_0x2855('0x30')](_0x50a6ac,'name');_0x10d0d5['query']=_[_0x2855('0x31')](_0x4338ab[_0x2855('0x32')]);_0x10d0d5['filters']=_[_0x2855('0x33')](_0x10d0d5[_0x2855('0x2f')],_0x10d0d5['query']);_0x225850[_0x2855('0x34')]=_[_0x2855('0x33')](_0x10d0d5[_0x2855('0x2f')],qs[_0x2855('0x35')](_0x4338ab[_0x2855('0x32')][_0x2855('0x35')]));_0x225850['attributes']=_0x225850[_0x2855('0x34')][_0x2855('0x36')]?_0x225850[_0x2855('0x34')]:_0x10d0d5[_0x2855('0x2f')];if(!_0x4338ab[_0x2855('0x32')]['hasOwnProperty'](_0x2855('0x37'))){_0x225850['limit']=qs[_0x2855('0x1e')](_0x4338ab[_0x2855('0x32')][_0x2855('0x1e')]);_0x225850[_0x2855('0x20')]=qs[_0x2855('0x20')](_0x4338ab['query'][_0x2855('0x20')]);}_0x225850[_0x2855('0x38')]=qs[_0x2855('0x39')](_0x4338ab[_0x2855('0x32')][_0x2855('0x39')]);_0x225850[_0x2855('0x3a')]=qs[_0x2855('0x3b')](_[_0x2855('0x3c')](_0x4338ab[_0x2855('0x32')],_0x10d0d5['filters']),_0x50a6ac);if(_0x4338ab['query'][_0x2855('0x3d')]){_0x225850[_0x2855('0x3a')]=_['merge'](_0x225850['where'],{'$or':_[_0x2855('0x30')](_0x50a6ac,function(_0x31edb4){if(_0x31edb4[_0x2855('0x2e')]!==_0x2855('0x3e')){var _0x840d8b={};_0x840d8b[_0x31edb4[_0x2855('0x3f')]]={'$like':'%'+_0x4338ab[_0x2855('0x32')][_0x2855('0x3d')]+'%'};return _0x840d8b;}})});}_0x225850=_['merge']({},_0x225850,_0x4338ab['options']);var _0x3f4eeb={'where':_0x225850[_0x2855('0x3a')]};return db['ZohoAccount'][_0x2855('0x1f')](_0x3f4eeb)[_0x2855('0x25')](function(_0x29a86d){_0x902063[_0x2855('0x1f')]=_0x29a86d;if(_0x4338ab[_0x2855('0x32')][_0x2855('0x40')]){_0x225850[_0x2855('0x41')]=[{'all':!![]}];}return db['ZohoAccount'][_0x2855('0x42')](_0x225850);})['then'](function(_0x1846a4){_0x902063['rows']=_0x1846a4;return _0x902063;})[_0x2855('0x25')](respondWithFilteredResult(_0x1feb6b,_0x225850))[_0x2855('0x43')](handleError(_0x1feb6b,null));};exports[_0x2855('0x44')]=function(_0x568255,_0x344a67){var _0x2b7f0e={'raw':![],'where':{'id':_0x568255[_0x2855('0x45')]['id']}},_0x1ef64e={};_0x1ef64e['model']=_['keys'](db['ZohoAccount'][_0x2855('0x2c')]);_0x1ef64e[_0x2855('0x32')]=_['keys'](_0x568255['query']);_0x1ef64e['filters']=_[_0x2855('0x33')](_0x1ef64e[_0x2855('0x2f')],_0x1ef64e[_0x2855('0x32')]);_0x2b7f0e['attributes']=_[_0x2855('0x33')](_0x1ef64e[_0x2855('0x2f')],qs['fields'](_0x568255[_0x2855('0x32')]['fields']));_0x2b7f0e[_0x2855('0x34')]=_0x2b7f0e[_0x2855('0x34')][_0x2855('0x36')]?_0x2b7f0e[_0x2855('0x34')]:_0x1ef64e[_0x2855('0x2f')];if(_0x568255[_0x2855('0x32')][_0x2855('0x40')]){_0x2b7f0e[_0x2855('0x41')]=[{'all':!![]}];}_0x2b7f0e=_['merge']({},_0x2b7f0e,_0x568255[_0x2855('0x46')]);return db[_0x2855('0x2b')][_0x2855('0x47')](_0x2b7f0e)[_0x2855('0x25')](handleEntityNotFound(_0x344a67,null))['then'](respondWithResult(_0x344a67,null))[_0x2855('0x43')](handleError(_0x344a67,null));};exports[_0x2855('0x48')]=function(_0x92394a,_0x5db659){return db[_0x2855('0x2b')][_0x2855('0x48')](_0x92394a[_0x2855('0x49')],{})[_0x2855('0x25')](respondWithResult(_0x5db659,0xc9))[_0x2855('0x43')](handleError(_0x5db659,null));};exports[_0x2855('0x24')]=function(_0x57c79d,_0x5d5c85){if(_0x57c79d[_0x2855('0x49')]['id']){delete _0x57c79d[_0x2855('0x49')]['id'];}return db[_0x2855('0x2b')][_0x2855('0x47')]({'where':{'id':_0x57c79d[_0x2855('0x45')]['id']}})['then'](handleEntityNotFound(_0x5d5c85,null))[_0x2855('0x25')](saveUpdates(_0x57c79d[_0x2855('0x49')],null))['then'](respondWithResult(_0x5d5c85,null))[_0x2855('0x43')](handleError(_0x5d5c85,null));};exports[_0x2855('0x26')]=function(_0x3b1062,_0x5edb82){return db[_0x2855('0x2b')][_0x2855('0x47')]({'where':{'id':_0x3b1062[_0x2855('0x45')]['id']}})[_0x2855('0x25')](handleEntityNotFound(_0x5edb82,null))[_0x2855('0x25')](removeEntity(_0x5edb82,null))[_0x2855('0x43')](handleError(_0x5edb82,null));};exports[_0x2855('0x4a')]=function(_0x4c0e31,_0x9bdd3,_0x414b9d){var _0x266027={};var _0x2f7c85={};var _0x4b437b;var _0x3900b6;return db[_0x2855('0x2b')][_0x2855('0x4b')]({'where':{'id':_0x4c0e31['params']['id']}})[_0x2855('0x25')](handleEntityNotFound(_0x9bdd3,null))[_0x2855('0x25')](function(_0x2d4e3e){if(_0x2d4e3e){_0x4b437b=_0x2d4e3e;_0x2f7c85[_0x2855('0x2f')]=_[_0x2855('0x31')](db[_0x2855('0x4c')][_0x2855('0x2c')]);_0x2f7c85[_0x2855('0x32')]=_['keys'](_0x4c0e31['query']);_0x2f7c85[_0x2855('0x3b')]=_['intersection'](_0x2f7c85[_0x2855('0x2f')],_0x2f7c85['query']);_0x266027[_0x2855('0x34')]=_['intersection'](_0x2f7c85['model'],qs[_0x2855('0x35')](_0x4c0e31[_0x2855('0x32')][_0x2855('0x35')]));_0x266027[_0x2855('0x34')]=_0x266027[_0x2855('0x34')][_0x2855('0x36')]?_0x266027[_0x2855('0x34')]:_0x2f7c85['model'];_0x266027['order']=qs['sort'](_0x4c0e31[_0x2855('0x32')][_0x2855('0x39')]);_0x266027[_0x2855('0x3a')]=qs[_0x2855('0x3b')](_['pick'](_0x4c0e31[_0x2855('0x32')],_0x2f7c85['filters']));if(_0x4c0e31[_0x2855('0x32')][_0x2855('0x3d')]){_0x266027[_0x2855('0x3a')]=_['merge'](_0x266027[_0x2855('0x3a')],{'$or':_[_0x2855('0x30')](_0x266027[_0x2855('0x34')],function(_0x37583c){var _0x5e885e={};_0x5e885e[_0x37583c]={'$like':'%'+_0x4c0e31[_0x2855('0x32')][_0x2855('0x3d')]+'%'};return _0x5e885e;})});}_0x266027=_[_0x2855('0x4d')]({},_0x266027,_0x4c0e31[_0x2855('0x46')]);return _0x4b437b[_0x2855('0x4a')](_0x266027);}})[_0x2855('0x25')](function(_0x231c9b){if(_0x231c9b){_0x3900b6=_0x231c9b[_0x2855('0x36')];if(!_0x4c0e31[_0x2855('0x32')][_0x2855('0x4e')](_0x2855('0x37'))){_0x266027[_0x2855('0x1e')]=qs[_0x2855('0x1e')](_0x4c0e31['query'][_0x2855('0x1e')]);_0x266027[_0x2855('0x20')]=qs['offset'](_0x4c0e31[_0x2855('0x32')]['offset']);}return _0x4b437b[_0x2855('0x4a')](_0x266027);}})[_0x2855('0x25')](function(_0xf18b66){if(_0xf18b66){return _0xf18b66?{'count':_0x3900b6,'rows':_0xf18b66}:null;}})[_0x2855('0x25')](respondWithResult(_0x9bdd3,null))[_0x2855('0x43')](handleError(_0x9bdd3,null));};exports[_0x2855('0x4f')]=function(_0x17a829,_0x13dec4,_0x282b98){if(_0x17a829[_0x2855('0x49')]['id']){delete _0x17a829[_0x2855('0x49')]['id'];}return db['ZohoAccount'][_0x2855('0x4b')]({'where':{'id':_0x17a829[_0x2855('0x45')]['id']}})[_0x2855('0x25')](handleEntityNotFound(_0x13dec4,null))[_0x2855('0x25')](function(_0x2104b9){if(_0x2104b9){_0x17a829['body'][_0x2855('0x50')]=_0x2104b9['id'];_0x17a829['body'][_0x2855('0x51')]=integrations[_0x2855('0x52')](_0x17a829[_0x2855('0x49')][_0x2855('0x53')],_0x17a829['body'][_0x2855('0x2e')]);_0x17a829[_0x2855('0x49')][_0x2855('0x54')]=integrations[_0x2855('0x55')](_0x17a829[_0x2855('0x49')]['channel'],_0x17a829[_0x2855('0x49')][_0x2855('0x2e')]);return db[_0x2855('0x4c')][_0x2855('0x48')](_0x17a829[_0x2855('0x49')],{'include':[{'model':db[_0x2855('0x56')],'as':_0x2855('0x51')},{'model':db[_0x2855('0x56')],'as':_0x2855('0x54')}]});}return null;})['then'](respondWithResult(_0x13dec4,null))[_0x2855('0x43')](handleError(_0x13dec4,null));};function getAccessToken(_0x12cbc5){return new Promise(function(_0x3cc9c0,_0x234ccf){var _0x570163;switch(_0x12cbc5[_0x2855('0x57')]){case'US':_0x570163=_0x2855('0x58');break;case'AU':_0x570163='https://accounts.zoho.com.au';break;case'EU':_0x570163='https://accounts.zoho.eu';break;case'IN':_0x570163=_0x2855('0x59');break;case'CN':_0x570163=_0x2855('0x5a');break;default:_0x570163=_0x2855('0x5b');break;}var _0x354161={'method':_0x2855('0x5c'),'uri':_0x570163+_0x2855('0x5d'),'qs':{'refresh_token':_0x12cbc5[_0x2855('0x5e')],'client_id':_0x12cbc5[_0x2855('0x5f')],'client_secret':_0x12cbc5[_0x2855('0x60')],'grant_type':_0x2855('0x61')},'json':!![]};return rp(_0x354161)['then'](function(_0x14c103){if(_0x14c103[_0x2855('0x62')]){_0x3cc9c0(_0x14c103['access_token']);}else{_0x234ccf(_0x2855('0x63'));}})['catch'](function(_0xf8660f){_0x234ccf(_0xf8660f);});});}exports[_0x2855('0x64')]=function(_0x57d1c2,_0x3e4b1d,_0x4092bd){var _0x2e9506,_0x10eb16,_0x301f73,_0xe65019,_0x4b5f53;return db[_0x2855('0x2b')][_0x2855('0x4b')]({'where':{'id':_0x57d1c2[_0x2855('0x45')]['id']},'attributes':['id',_0x2855('0x65'),'zone',_0x2855('0x5f'),_0x2855('0x60'),_0x2855('0x66'),_0x2855('0x67'),_0x2855('0x5e')]})['then'](handleEntityNotFound(_0x3e4b1d,null))[_0x2855('0x25')](function(_0x58530a){_0x4b5f53=_0x58530a;_0x2e9506=_0x4b5f53[_0x2855('0x65')];_0x10eb16=_0x2e9506===_0x2855('0x68')?'eu':_0x2855('0x69');_0x301f73=_0x4b5f53['serverUrl'];var _0x575bf5=_0x301f73[_0x2855('0x6a')](-0x1);if(_0x575bf5==='/'||_0x575bf5==='\x5c'||_0x575bf5===':'){_0x301f73=_0x301f73[_0x2855('0x6b')](0x0,_0x301f73['lastIndexOf'](_0x575bf5));}if(!_0x4b5f53[_0x2855('0x5e')]){throw new Error(_0x2855('0x6c'));}return getAccessToken(_0x4b5f53);})['then'](function(_0x5af899){if(_0x5af899){return rp({'method':_0x2855('0x6d'),'uri':util[_0x2855('0x6e')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x10eb16),'qs':{'module':'Calls'},'headers':{'Authorization':_0x2855('0x6f')+_0x5af899},'json':!![]});}})[_0x2855('0x25')](function(_0x2d9e31){if(_0x2d9e31){if(_0x2d9e31[_0x2855('0x70')]&&_0x2d9e31[_0x2855('0x70')][_0x2855('0x71')]){throw new Error(_0x2d9e31[_0x2855('0x70')][_0x2855('0x71')]['message']);}var _0x2b83de=[];var _0x1abf62=[];var _0xe38c12=['Owner',_0x2855('0x72'),_0x2855('0x73'),_0x2855('0x74'),_0x2855('0x75'),'Call_Result',_0x2855('0x76'),'Call_Type'];_0x1abf62=_['remove'](_0x2d9e31['fields'],function(_0x240468){return _0xe38c12[_0x2855('0x77')](_0x240468[_0x2855('0x78')]);});for(var _0x492611=0x0;_0x492611<_0x1abf62[_0x2855('0x36')];_0x492611++){if(_0x1abf62[_0x492611][_0x2855('0x79')]===![]){_0x2b83de[_0x2855('0x7a')]({'id':_0x1abf62[_0x492611]['id'],'name':_0x1abf62[_0x492611][_0x2855('0x7b')],'custom':_0x1abf62[_0x492611]['custom_field'],'options':_0x1abf62[_0x492611][_0x2855('0x7c')]===_0x2855('0x7d')&&_0x1abf62[_0x492611][_0x2855('0x7e')][_0x2855('0x36')]>-0x1?_['map'](_0x1abf62[_0x492611]['pick_list_values'],function(_0x27400c){return{'name':_0x27400c,'value':_0x27400c};}):[]});}}return{'count':_0x2b83de[_0x2855('0x36')],'rows':_0x2b83de};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x3e4b1d,null))[_0x2855('0x43')](function(_0x52ccc2){var _0x3330d6=_0x57d1c2[_0x2855('0x32')]['test']?0x1f4:_0x52ccc2[_0x2855('0x7f')]||0x1f4;logger[_0x2855('0x71')](_0x2855('0x80'),_0x2855('0x64'),_0x3330d6,JSON[_0x2855('0x81')](_0x52ccc2));delete _0x52ccc2[_0x2855('0x3f')];if(_0x3330d6===0x191){_0x3330d6=0x190;}_0x3e4b1d['status'](_0x3330d6)[_0x2855('0x29')](_0x57d1c2[_0x2855('0x32')][_0x2855('0x82')]?{'message':_0x2855('0x83'),'statusCode':_0x52ccc2[_0x2855('0x7f')]}:_0x52ccc2);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 7afd114..00262c8 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 _0xa868=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','changed','serverUrl','clientId','clientSecret','host','slice','substring','zone','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','code','application/x-www-form-urlencoded','then','refresh_token','refreshToken','info','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','name','https://accounts.zoho.com','https://accounts.zoho.com.cn','parse','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d'];(function(_0x57cb4f,_0x541f57){var _0x29bb45=function(_0x462bee){while(--_0x462bee){_0x57cb4f['push'](_0x57cb4f['shift']());}};_0x29bb45(++_0x541f57);}(_0xa868,0x1b8));var _0x8a86=function(_0x4a79fd,_0x429333){_0x4a79fd=_0x4a79fd-0x0;var _0xef2f88=_0xa868[_0x4a79fd];return _0xef2f88;};'use strict';var _=require(_0x8a86('0x0'));var util=require(_0x8a86('0x1'));var logger=require(_0x8a86('0x2'))(_0x8a86('0x3'));var moment=require(_0x8a86('0x4'));var BPromise=require(_0x8a86('0x5'));var rp=require(_0x8a86('0x6'));var fs=require('fs');var path=require(_0x8a86('0x7'));var rimraf=require(_0x8a86('0x8'));var config=require(_0x8a86('0x9'));var attributes=require('./intZohoAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x8a86('0xa')]=function(_0x368ab8,_0xc8d504){return _0x368ab8['define']('ZohoAccount',attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x26dfb9,_0x3559e6,_0x5a1695){if(_0x26dfb9[_0x8a86('0xb')]('zone')||_0x26dfb9[_0x8a86('0xb')](_0x8a86('0xc'))||_0x26dfb9[_0x8a86('0xb')](_0x8a86('0xd'))||_0x26dfb9[_0x8a86('0xb')](_0x8a86('0xe'))||_0x26dfb9[_0x8a86('0xb')]('code')||_0x26dfb9[_0x8a86('0xb')](_0x8a86('0xf'))){var _0xcef982,_0x55645c;_0xcef982=_0x26dfb9['serverUrl'];var _0x3eb3f3=_0xcef982[_0x8a86('0x10')](-0x1);if(_0x3eb3f3==='/'||_0x3eb3f3==='\x5c'||_0x3eb3f3===':'){_0xcef982=_0xcef982[_0x8a86('0x11')](0x0,_0xcef982['lastIndexOf'](_0x3eb3f3));}switch(_0x26dfb9[_0x8a86('0x12')]){case'US':_0x55645c='https://accounts.zoho.com';break;case'AU':_0x55645c=_0x8a86('0x13');break;case'IN':_0x55645c=_0x8a86('0x14');break;case'CN':_0x55645c='https://accounts.zoho.com.cn';break;default:_0x55645c=_0x8a86('0x15');break;}var _0x25ef14={'method':_0x8a86('0x16'),'uri':_0x55645c+_0x8a86('0x17'),'form':{'grant_type':_0x8a86('0x18'),'client_id':_0x26dfb9[_0x8a86('0xd')],'client_secret':_0x26dfb9['clientSecret'],'redirect_uri':_0x26dfb9[_0x8a86('0xc')],'code':_0x26dfb9[_0x8a86('0x19')]},'headers':{'Content-Type':_0x8a86('0x1a')}};return rp(_0x25ef14)[_0x8a86('0x1b')](function(_0x1bcbd6){var _0x58bcc6=JSON['parse'](_0x1bcbd6);if(_0x58bcc6[_0x8a86('0x1c')]){_0x26dfb9[_0x8a86('0x1d')]=_0x58bcc6[_0x8a86('0x1c')];logger[_0x8a86('0x1e')](util['format']('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x26dfb9['name'],_0x26dfb9['id']));}else{logger[_0x8a86('0x1f')](util['format'](_0x8a86('0x20'),_0x26dfb9['name'],_0x26dfb9['id']),util[_0x8a86('0x21')](_0x58bcc6,{'showHidden':![],'depth':null}));}return _0x5a1695(null,_0x3559e6);})['catch'](function(_0x29a223){logger[_0x8a86('0x1f')](util['format'](_0x8a86('0x20'),_0x26dfb9[_0x8a86('0x22')],_0x26dfb9['id']),util[_0x8a86('0x21')](parsedResult,{'showHidden':![],'depth':null}));return _0x5a1695(_0x29a223);});}else{return _0x5a1695(null,_0x3559e6);}},'beforeUpdate':function(_0x1c372f,_0x339132,_0x3e7e60){if(_0x1c372f['changed'](_0x8a86('0x12'))||_0x1c372f[_0x8a86('0xb')](_0x8a86('0xc'))||_0x1c372f[_0x8a86('0xb')]('clientId')||_0x1c372f[_0x8a86('0xb')](_0x8a86('0xe'))||_0x1c372f[_0x8a86('0xb')](_0x8a86('0x19'))||_0x1c372f['changed'](_0x8a86('0xf'))){var _0x5162d8,_0x686b5b;_0x5162d8=_0x1c372f[_0x8a86('0xc')];var _0xc00e35=_0x5162d8[_0x8a86('0x10')](-0x1);if(_0xc00e35==='/'||_0xc00e35==='\x5c'||_0xc00e35===':'){_0x5162d8=_0x5162d8[_0x8a86('0x11')](0x0,_0x5162d8['lastIndexOf'](_0xc00e35));}switch(_0x1c372f[_0x8a86('0x12')]){case'US':_0x686b5b=_0x8a86('0x23');break;case'AU':_0x686b5b=_0x8a86('0x13');break;case'IN':_0x686b5b='https://accounts.zoho.in';break;case'CN':_0x686b5b=_0x8a86('0x24');break;default:_0x686b5b=_0x8a86('0x15');break;}var _0x44805f={'method':_0x8a86('0x16'),'uri':_0x686b5b+_0x8a86('0x17'),'form':{'grant_type':'authorization_code','client_id':_0x1c372f[_0x8a86('0xd')],'client_secret':_0x1c372f['clientSecret'],'redirect_uri':_0x1c372f['serverUrl'],'code':_0x1c372f[_0x8a86('0x19')]},'headers':{'Content-Type':_0x8a86('0x1a')}};return rp(_0x44805f)['then'](function(_0x287c58){var _0x1a8c61=JSON[_0x8a86('0x25')](_0x287c58);if(_0x1a8c61['refresh_token']){_0x1c372f[_0x8a86('0x1d')]=_0x1a8c61[_0x8a86('0x1c')];logger[_0x8a86('0x1e')](util[_0x8a86('0x26')](_0x8a86('0x27'),_0x1c372f[_0x8a86('0x22')],_0x1c372f['id']));}else{logger[_0x8a86('0x1f')](util[_0x8a86('0x26')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x1c372f[_0x8a86('0x22')],_0x1c372f['id']),util[_0x8a86('0x21')](_0x1a8c61,{'showHidden':![],'depth':null}));}return _0x3e7e60(null,_0x339132);})['catch'](function(_0x16cf2a){logger[_0x8a86('0x1f')](util['format'](_0x8a86('0x20'),_0x1c372f['name'],_0x1c372f['id']),util[_0x8a86('0x21')](parsedResult,{'showHidden':![],'depth':null}));return _0x3e7e60(_0x16cf2a);});}else{return _0x3e7e60(null,_0x339132);}}}});}; \ No newline at end of file +var _0x5574=['path','../../config/environment','./intZohoAccount.attributes','exports','define','ZohoAccount','int_zoho_accounts','changed','host','serverUrl','slice','substring','lastIndexOf','zone','https://accounts.zoho.com','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','authorization_code','clientId','clientSecret','code','then','parse','refresh_token','refreshToken','name','error','format','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','https://accounts.zoho.com.au','https://accounts.zoho.in','info','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','../../config/logger','moment','request-promise'];(function(_0x50672a,_0x48d324){var _0x35ae1f=function(_0x1bb9b4){while(--_0x1bb9b4){_0x50672a['push'](_0x50672a['shift']());}};_0x35ae1f(++_0x48d324);}(_0x5574,0x135));var _0x4557=function(_0x28f774,_0x731b6c){_0x28f774=_0x28f774-0x0;var _0x4be59d=_0x5574[_0x28f774];return _0x4be59d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4557('0x0'))('api');var moment=require(_0x4557('0x1'));var BPromise=require('bluebird');var rp=require(_0x4557('0x2'));var fs=require('fs');var path=require(_0x4557('0x3'));var rimraf=require('rimraf');var config=require(_0x4557('0x4'));var attributes=require(_0x4557('0x5'));var integrations=require('../../components/integrations/configuration');module[_0x4557('0x6')]=function(_0x479535,_0x568ad9){return _0x479535[_0x4557('0x7')](_0x4557('0x8'),attributes,{'tableName':_0x4557('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3c5ec3,_0x23b594,_0x33e918){if(_0x3c5ec3[_0x4557('0xa')]('zone')||_0x3c5ec3[_0x4557('0xa')]('serverUrl')||_0x3c5ec3[_0x4557('0xa')]('clientId')||_0x3c5ec3[_0x4557('0xa')]('clientSecret')||_0x3c5ec3[_0x4557('0xa')]('code')||_0x3c5ec3[_0x4557('0xa')](_0x4557('0xb'))){var _0x12cd3a,_0x3a2205;_0x12cd3a=_0x3c5ec3[_0x4557('0xc')];var _0x6f59fe=_0x12cd3a[_0x4557('0xd')](-0x1);if(_0x6f59fe==='/'||_0x6f59fe==='\x5c'||_0x6f59fe===':'){_0x12cd3a=_0x12cd3a[_0x4557('0xe')](0x0,_0x12cd3a[_0x4557('0xf')](_0x6f59fe));}switch(_0x3c5ec3[_0x4557('0x10')]){case'US':_0x3a2205=_0x4557('0x11');break;case'AU':_0x3a2205='https://accounts.zoho.com.au';break;case'IN':_0x3a2205='https://accounts.zoho.in';break;case'CN':_0x3a2205=_0x4557('0x12');break;default:_0x3a2205=_0x4557('0x13');break;}var _0x5d9f27={'method':_0x4557('0x14'),'uri':_0x3a2205+'/oauth/v2/token','form':{'grant_type':_0x4557('0x15'),'client_id':_0x3c5ec3[_0x4557('0x16')],'client_secret':_0x3c5ec3[_0x4557('0x17')],'redirect_uri':_0x3c5ec3[_0x4557('0xc')],'code':_0x3c5ec3[_0x4557('0x18')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x5d9f27)[_0x4557('0x19')](function(_0x465106){var _0x568eac=JSON[_0x4557('0x1a')](_0x465106);if(_0x568eac[_0x4557('0x1b')]){_0x3c5ec3[_0x4557('0x1c')]=_0x568eac[_0x4557('0x1b')];logger['info'](util['format']('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x3c5ec3[_0x4557('0x1d')],_0x3c5ec3['id']));}else{logger[_0x4557('0x1e')](util[_0x4557('0x1f')](_0x4557('0x20'),_0x3c5ec3['name'],_0x3c5ec3['id']),util[_0x4557('0x21')](_0x568eac,{'showHidden':![],'depth':null}));}return _0x33e918(null,_0x23b594);})[_0x4557('0x22')](function(_0x2c951e){logger[_0x4557('0x1e')](util[_0x4557('0x1f')](_0x4557('0x20'),_0x3c5ec3[_0x4557('0x1d')],_0x3c5ec3['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x33e918(_0x2c951e);});}else{return _0x33e918(null,_0x23b594);}},'beforeUpdate':function(_0x2c6de7,_0x4de4ec,_0x234fb6){if(_0x2c6de7['changed'](_0x4557('0x10'))||_0x2c6de7[_0x4557('0xa')]('serverUrl')||_0x2c6de7[_0x4557('0xa')](_0x4557('0x16'))||_0x2c6de7['changed'](_0x4557('0x17'))||_0x2c6de7[_0x4557('0xa')]('code')||_0x2c6de7['changed']('host')){var _0x2d2ff3,_0x11654e;_0x2d2ff3=_0x2c6de7[_0x4557('0xc')];var _0x451914=_0x2d2ff3[_0x4557('0xd')](-0x1);if(_0x451914==='/'||_0x451914==='\x5c'||_0x451914===':'){_0x2d2ff3=_0x2d2ff3[_0x4557('0xe')](0x0,_0x2d2ff3[_0x4557('0xf')](_0x451914));}switch(_0x2c6de7[_0x4557('0x10')]){case'US':_0x11654e=_0x4557('0x11');break;case'AU':_0x11654e=_0x4557('0x23');break;case'IN':_0x11654e=_0x4557('0x24');break;case'CN':_0x11654e='https://accounts.zoho.com.cn';break;default:_0x11654e=_0x4557('0x13');break;}var _0x3ec1fd={'method':_0x4557('0x14'),'uri':_0x11654e+'/oauth/v2/token','form':{'grant_type':_0x4557('0x15'),'client_id':_0x2c6de7['clientId'],'client_secret':_0x2c6de7['clientSecret'],'redirect_uri':_0x2c6de7['serverUrl'],'code':_0x2c6de7['code']},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x3ec1fd)[_0x4557('0x19')](function(_0x3c23f7){var _0x4eedf3=JSON[_0x4557('0x1a')](_0x3c23f7);if(_0x4eedf3['refresh_token']){_0x2c6de7[_0x4557('0x1c')]=_0x4eedf3[_0x4557('0x1b')];logger[_0x4557('0x25')](util[_0x4557('0x1f')](_0x4557('0x26'),_0x2c6de7[_0x4557('0x1d')],_0x2c6de7['id']));}else{logger[_0x4557('0x1e')](util[_0x4557('0x1f')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x2c6de7[_0x4557('0x1d')],_0x2c6de7['id']),util[_0x4557('0x21')](_0x4eedf3,{'showHidden':![],'depth':null}));}return _0x234fb6(null,_0x4de4ec);})['catch'](function(_0x1588e8){logger[_0x4557('0x1e')](util['format'](_0x4557('0x20'),_0x2c6de7[_0x4557('0x1d')],_0x2c6de7['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x234fb6(_0x1588e8);});}else{return _0x234fb6(null,_0x4de4ec);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 15ce901..d4bd1a1 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 _0x77d4=['util','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetZohoAccount','ZohoAccount','findAll','options','raw','where','attributes','limit','include','map','model','debug','ShowZohoAccount','find'];(function(_0x1359c3,_0x55326c){var _0x2a1cbe=function(_0x37735f){while(--_0x37735f){_0x1359c3['push'](_0x1359c3['shift']());}};_0x2a1cbe(++_0x55326c);}(_0x77d4,0x108));var _0x477d=function(_0x317b0e,_0x984a20){_0x317b0e=_0x317b0e-0x0;var _0x3cd572=_0x77d4[_0x317b0e];return _0x3cd572;};'use strict';var _=require('lodash');var util=require(_0x477d('0x0'));var moment=require('moment');var BPromise=require(_0x477d('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x477d('0x2'));var db=require(_0x477d('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x477d('0x4'));var config=require(_0x477d('0x5'));var jayson=require(_0x477d('0x6'));var client=jayson[_0x477d('0x7')][_0x477d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x45ca2d,_0x5153df,_0x4f4fb4){return new BPromise(function(_0x2dd5d2,_0x579859){return client['request'](_0x45ca2d,_0x4f4fb4)[_0x477d('0x9')](function(_0x29f11b){logger[_0x477d('0xa')](_0x477d('0xb'),_0x5153df,_0x477d('0xc'));logger['debug'](_0x477d('0xd'),_0x5153df,'request\x20sent',JSON[_0x477d('0xe')](_0x29f11b));if(_0x29f11b[_0x477d('0xf')]){if(_0x29f11b['error'][_0x477d('0x10')]===0x1f4){logger[_0x477d('0xf')]('ZohoAccount,\x20%s,\x20%s',_0x5153df,_0x29f11b['error'][_0x477d('0x11')]);return _0x579859(_0x29f11b[_0x477d('0xf')]['message']);}logger[_0x477d('0xf')](_0x477d('0xb'),_0x5153df,_0x29f11b['error']['message']);return _0x2dd5d2(_0x29f11b[_0x477d('0xf')]['message']);}else{logger[_0x477d('0xa')](_0x477d('0xb'),_0x5153df,_0x477d('0xc'));_0x2dd5d2(_0x29f11b['result'][_0x477d('0x11')]);}})[_0x477d('0x12')](function(_0x29c6f8){logger[_0x477d('0xf')]('ZohoAccount,\x20%s,\x20%s',_0x5153df,_0x29c6f8);_0x579859(_0x29c6f8);});});}exports[_0x477d('0x13')]=function(_0x5d5553){var _0x367965=this;return new Promise(function(_0x1399d7,_0x159beb){return db[_0x477d('0x14')][_0x477d('0x15')]({'raw':_0x5d5553[_0x477d('0x16')]?_0x5d5553['options'][_0x477d('0x17')]===undefined?!![]:![]:!![],'where':_0x5d5553['options']?_0x5d5553[_0x477d('0x16')][_0x477d('0x18')]||null:null,'attributes':_0x5d5553[_0x477d('0x16')]?_0x5d5553[_0x477d('0x16')][_0x477d('0x19')]||null:null,'limit':_0x5d5553[_0x477d('0x16')]?_0x5d5553[_0x477d('0x16')][_0x477d('0x1a')]||null:null,'include':_0x5d5553[_0x477d('0x16')]?_0x5d5553[_0x477d('0x16')][_0x477d('0x1b')]?_[_0x477d('0x1c')](_0x5d5553[_0x477d('0x16')][_0x477d('0x1b')],function(_0x4e6a44){return{'model':db[_0x4e6a44[_0x477d('0x1d')]],'as':_0x4e6a44['as'],'attributes':_0x4e6a44['attributes'],'include':_0x4e6a44[_0x477d('0x1b')]?_[_0x477d('0x1c')](_0x4e6a44[_0x477d('0x1b')],function(_0x2287b4){return{'model':db[_0x2287b4['model']],'as':_0x2287b4['as'],'attributes':_0x2287b4[_0x477d('0x19')],'include':_0x2287b4[_0x477d('0x1b')]?_[_0x477d('0x1c')](_0x2287b4['include'],function(_0x585648){return{'model':db[_0x585648[_0x477d('0x1d')]],'as':_0x585648['as'],'attributes':_0x585648[_0x477d('0x19')]};}):[]};}):[]};}):[]:[]})[_0x477d('0x9')](function(_0x5c8ef1){logger[_0x477d('0xa')](_0x477d('0x13'),_0x5d5553);logger[_0x477d('0x1e')](_0x477d('0x13'),_0x5d5553,JSON[_0x477d('0xe')](_0x5c8ef1));_0x1399d7(_0x5c8ef1);})['catch'](function(_0x2fc959){logger[_0x477d('0xf')](_0x477d('0x13'),_0x2fc959[_0x477d('0x11')],_0x5d5553);_0x159beb(_0x367965[_0x477d('0xf')](0x1f4,_0x2fc959[_0x477d('0x11')]));});});};exports[_0x477d('0x1f')]=function(_0x98b5d9){var _0x204541=this;return new Promise(function(_0x8fe6c4,_0x41b790){return db[_0x477d('0x14')][_0x477d('0x20')]({'raw':_0x98b5d9[_0x477d('0x16')]?_0x98b5d9[_0x477d('0x16')][_0x477d('0x17')]===undefined?!![]:![]:!![],'where':_0x98b5d9[_0x477d('0x16')]?_0x98b5d9[_0x477d('0x16')][_0x477d('0x18')]||null:null,'attributes':_0x98b5d9[_0x477d('0x16')]?_0x98b5d9['options'][_0x477d('0x19')]||null:null,'include':_0x98b5d9['options']?_0x98b5d9[_0x477d('0x16')][_0x477d('0x1b')]?_[_0x477d('0x1c')](_0x98b5d9['options'][_0x477d('0x1b')],function(_0x1201a9){return{'model':db[_0x1201a9[_0x477d('0x1d')]],'as':_0x1201a9['as'],'attributes':_0x1201a9[_0x477d('0x19')],'include':_0x1201a9[_0x477d('0x1b')]?_[_0x477d('0x1c')](_0x1201a9[_0x477d('0x1b')],function(_0xf84c4c){return{'model':db[_0xf84c4c[_0x477d('0x1d')]],'as':_0xf84c4c['as'],'attributes':_0xf84c4c[_0x477d('0x19')],'include':_0xf84c4c['include']?_[_0x477d('0x1c')](_0xf84c4c[_0x477d('0x1b')],function(_0xb41cd8){return{'model':db[_0xb41cd8['model']],'as':_0xb41cd8['as'],'attributes':_0xb41cd8[_0x477d('0x19')]};}):[]};}):[]};}):[]:[]})[_0x477d('0x9')](function(_0x1b0410){logger['info']('ShowZohoAccount',_0x98b5d9);logger[_0x477d('0x1e')](_0x477d('0x1f'),_0x98b5d9,JSON[_0x477d('0xe')](_0x1b0410));_0x8fe6c4(_0x1b0410);})[_0x477d('0x12')](function(_0x1c0d86){logger['error'](_0x477d('0x1f'),_0x1c0d86['message'],_0x98b5d9);_0x41b790(_0x204541[_0x477d('0xf')](0x1f4,_0x1c0d86[_0x477d('0x11')]));});});}; \ No newline at end of file +var _0x7669=['debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoAccount,\x20%s,\x20%s','message','result','ZohoAccount','findAll','options','raw','where','attributes','limit','include','map','model','GetZohoAccount','catch','find','ShowZohoAccount'];(function(_0x2c50ff,_0x17ad42){var _0x47dd06=function(_0x1d64ed){while(--_0x1d64ed){_0x2c50ff['push'](_0x2c50ff['shift']());}};_0x47dd06(++_0x17ad42);}(_0x7669,0xe5));var _0x9766=function(_0x8fd9a9,_0x1ad110){_0x8fd9a9=_0x8fd9a9-0x0;var _0x5ce4e9=_0x7669[_0x8fd9a9];return _0x5ce4e9;};'use strict';var _=require(_0x9766('0x0'));var util=require(_0x9766('0x1'));var moment=require(_0x9766('0x2'));var BPromise=require('bluebird');var rs=require(_0x9766('0x3'));var fs=require('fs');var Redis=require(_0x9766('0x4'));var db=require(_0x9766('0x5'))['db'];var utils=require(_0x9766('0x6'));var logger=require(_0x9766('0x7'))(_0x9766('0x8'));var config=require('../../config/environment');var jayson=require(_0x9766('0x9'));var client=jayson[_0x9766('0xa')][_0x9766('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x251329,_0x4f85e7,_0x26bbd9){return new BPromise(function(_0x2b5b52,_0x2381eb){return client[_0x9766('0xc')](_0x251329,_0x26bbd9)[_0x9766('0xd')](function(_0x5cb787){logger[_0x9766('0xe')]('ZohoAccount,\x20%s,\x20%s',_0x4f85e7,_0x9766('0xf'));logger['debug'](_0x9766('0x10'),_0x4f85e7,'request\x20sent',JSON[_0x9766('0x11')](_0x5cb787));if(_0x5cb787['error']){if(_0x5cb787[_0x9766('0x12')][_0x9766('0x13')]===0x1f4){logger['error']('ZohoAccount,\x20%s,\x20%s',_0x4f85e7,_0x5cb787[_0x9766('0x12')]['message']);return _0x2381eb(_0x5cb787[_0x9766('0x12')]['message']);}logger[_0x9766('0x12')](_0x9766('0x14'),_0x4f85e7,_0x5cb787['error'][_0x9766('0x15')]);return _0x2b5b52(_0x5cb787['error'][_0x9766('0x15')]);}else{logger[_0x9766('0xe')](_0x9766('0x14'),_0x4f85e7,_0x9766('0xf'));_0x2b5b52(_0x5cb787[_0x9766('0x16')][_0x9766('0x15')]);}})['catch'](function(_0x8f9b2a){logger[_0x9766('0x12')](_0x9766('0x14'),_0x4f85e7,_0x8f9b2a);_0x2381eb(_0x8f9b2a);});});}exports['GetZohoAccount']=function(_0x4a47ce){var _0x570fae=this;return new Promise(function(_0x2b0f12,_0x118dbd){return db[_0x9766('0x17')][_0x9766('0x18')]({'raw':_0x4a47ce[_0x9766('0x19')]?_0x4a47ce[_0x9766('0x19')][_0x9766('0x1a')]===undefined?!![]:![]:!![],'where':_0x4a47ce[_0x9766('0x19')]?_0x4a47ce['options'][_0x9766('0x1b')]||null:null,'attributes':_0x4a47ce['options']?_0x4a47ce['options'][_0x9766('0x1c')]||null:null,'limit':_0x4a47ce['options']?_0x4a47ce[_0x9766('0x19')][_0x9766('0x1d')]||null:null,'include':_0x4a47ce[_0x9766('0x19')]?_0x4a47ce[_0x9766('0x19')][_0x9766('0x1e')]?_[_0x9766('0x1f')](_0x4a47ce['options'][_0x9766('0x1e')],function(_0x57bae2){return{'model':db[_0x57bae2[_0x9766('0x20')]],'as':_0x57bae2['as'],'attributes':_0x57bae2[_0x9766('0x1c')],'include':_0x57bae2[_0x9766('0x1e')]?_[_0x9766('0x1f')](_0x57bae2[_0x9766('0x1e')],function(_0x5488df){return{'model':db[_0x5488df[_0x9766('0x20')]],'as':_0x5488df['as'],'attributes':_0x5488df['attributes'],'include':_0x5488df[_0x9766('0x1e')]?_[_0x9766('0x1f')](_0x5488df['include'],function(_0x34c91f){return{'model':db[_0x34c91f['model']],'as':_0x34c91f['as'],'attributes':_0x34c91f[_0x9766('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x9766('0xd')](function(_0x56d854){logger[_0x9766('0xe')]('GetZohoAccount',_0x4a47ce);logger['debug'](_0x9766('0x21'),_0x4a47ce,JSON[_0x9766('0x11')](_0x56d854));_0x2b0f12(_0x56d854);})[_0x9766('0x22')](function(_0x33258a){logger['error'](_0x9766('0x21'),_0x33258a[_0x9766('0x15')],_0x4a47ce);_0x118dbd(_0x570fae['error'](0x1f4,_0x33258a[_0x9766('0x15')]));});});};exports['ShowZohoAccount']=function(_0x5701ed){var _0x520657=this;return new Promise(function(_0x5aa53e,_0x22e502){return db['ZohoAccount'][_0x9766('0x23')]({'raw':_0x5701ed[_0x9766('0x19')]?_0x5701ed['options'][_0x9766('0x1a')]===undefined?!![]:![]:!![],'where':_0x5701ed[_0x9766('0x19')]?_0x5701ed['options']['where']||null:null,'attributes':_0x5701ed[_0x9766('0x19')]?_0x5701ed[_0x9766('0x19')]['attributes']||null:null,'include':_0x5701ed['options']?_0x5701ed[_0x9766('0x19')][_0x9766('0x1e')]?_[_0x9766('0x1f')](_0x5701ed['options'][_0x9766('0x1e')],function(_0x5a22b9){return{'model':db[_0x5a22b9[_0x9766('0x20')]],'as':_0x5a22b9['as'],'attributes':_0x5a22b9['attributes'],'include':_0x5a22b9[_0x9766('0x1e')]?_[_0x9766('0x1f')](_0x5a22b9[_0x9766('0x1e')],function(_0x14677f){return{'model':db[_0x14677f[_0x9766('0x20')]],'as':_0x14677f['as'],'attributes':_0x14677f[_0x9766('0x1c')],'include':_0x14677f[_0x9766('0x1e')]?_[_0x9766('0x1f')](_0x14677f[_0x9766('0x1e')],function(_0x5c6819){return{'model':db[_0x5c6819[_0x9766('0x20')]],'as':_0x5c6819['as'],'attributes':_0x5c6819[_0x9766('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x9766('0xd')](function(_0x32f29b){logger[_0x9766('0xe')](_0x9766('0x24'),_0x5701ed);logger[_0x9766('0x25')](_0x9766('0x24'),_0x5701ed,JSON[_0x9766('0x11')](_0x32f29b));_0x5aa53e(_0x32f29b);})[_0x9766('0x22')](function(_0xda6f35){logger[_0x9766('0x12')]('ShowZohoAccount',_0xda6f35['message'],_0x5701ed);_0x22e502(_0x520657[_0x9766('0x12')](0x1f4,_0xda6f35['message']));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index c75aca5..5dd080e 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 _0x7f82=['show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','update','delete','destroy','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id'];(function(_0x5ae1a2,_0x3601ba){var _0x9ac42f=function(_0x16abe8){while(--_0x16abe8){_0x5ae1a2['push'](_0x5ae1a2['shift']());}};_0x9ac42f(++_0x3601ba);}(_0x7f82,0x129));var _0x27f8=function(_0x5c2c7c,_0xa7d3b1){_0x5c2c7c=_0x5c2c7c-0x0;var _0xea7ffe=_0x7f82[_0x5c2c7c];return _0xea7ffe;};'use strict';var multer=require(_0x27f8('0x0'));var util=require('util');var path=require(_0x27f8('0x1'));var timeout=require(_0x27f8('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x27f8('0x3'));var interaction=require(_0x27f8('0x4'));var config=require(_0x27f8('0x5'));var controller=require(_0x27f8('0x6'));router[_0x27f8('0x7')]('/',auth[_0x27f8('0x8')](),controller[_0x27f8('0x9')]);router[_0x27f8('0x7')](_0x27f8('0xa'),auth[_0x27f8('0x8')](),controller[_0x27f8('0xb')]);router[_0x27f8('0x7')](_0x27f8('0xc'),auth['isAuthenticated'](),controller[_0x27f8('0xd')]);router[_0x27f8('0x7')](_0x27f8('0xe'),auth[_0x27f8('0x8')](),controller[_0x27f8('0xf')]);router['get'](_0x27f8('0x10'),auth[_0x27f8('0x8')](),controller['getDescriptions']);router[_0x27f8('0x11')]('/',auth[_0x27f8('0x8')](),controller[_0x27f8('0x12')]);router['put'](_0x27f8('0xa'),auth[_0x27f8('0x8')](),controller[_0x27f8('0x13')]);router[_0x27f8('0x14')](_0x27f8('0xa'),auth[_0x27f8('0x8')](),controller[_0x27f8('0x15')]);module['exports']=router; \ No newline at end of file +var _0x43db=['post','put','delete','destroy','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','index','/:id','show','isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions'];(function(_0x3df93e,_0x5af13a){var _0x2d4f2a=function(_0x14c85c){while(--_0x14c85c){_0x3df93e['push'](_0x3df93e['shift']());}};_0x2d4f2a(++_0x5af13a);}(_0x43db,0xbc));var _0xb43d=function(_0x3ae34a,_0x143082){_0x3ae34a=_0x3ae34a-0x0;var _0x4c9edc=_0x43db[_0x3ae34a];return _0x4c9edc;};'use strict';var multer=require(_0xb43d('0x0'));var util=require(_0xb43d('0x1'));var path=require('path');var timeout=require(_0xb43d('0x2'));var express=require(_0xb43d('0x3'));var router=express['Router']();var fs_extra=require(_0xb43d('0x4'));var auth=require(_0xb43d('0x5'));var interaction=require(_0xb43d('0x6'));var config=require(_0xb43d('0x7'));var controller=require(_0xb43d('0x8'));router[_0xb43d('0x9')]('/',auth['isAuthenticated'](),controller[_0xb43d('0xa')]);router[_0xb43d('0x9')](_0xb43d('0xb'),auth['isAuthenticated'](),controller[_0xb43d('0xc')]);router['get']('/:id/fields',auth[_0xb43d('0xd')](),controller[_0xb43d('0xe')]);router[_0xb43d('0x9')](_0xb43d('0xf'),auth[_0xb43d('0xd')](),controller[_0xb43d('0x10')]);router['get'](_0xb43d('0x11'),auth[_0xb43d('0xd')](),controller[_0xb43d('0x12')]);router[_0xb43d('0x13')]('/',auth[_0xb43d('0xd')](),controller['create']);router[_0xb43d('0x14')]('/:id',auth[_0xb43d('0xd')](),controller['update']);router[_0xb43d('0x15')](_0xb43d('0xb'),auth[_0xb43d('0xd')](),controller[_0xb43d('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 7105f16..6c46359 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 _0xac4b=['nothing','lead','ENUM','contact_lead','sequelize','exports','STRING','contact'];(function(_0x29e2af,_0x15e2b1){var _0x1ea06a=function(_0x34d736){while(--_0x34d736){_0x29e2af['push'](_0x29e2af['shift']());}};_0x1ea06a(++_0x15e2b1);}(_0xac4b,0xb4));var _0xbac4=function(_0xf6a5cd,_0x4cf536){_0xf6a5cd=_0xf6a5cd-0x0;var _0x1dc12d=_0xac4b[_0xf6a5cd];return _0x1dc12d;};'use strict';var Sequelize=require(_0xbac4('0x0'));module[_0xbac4('0x1')]={'name':{'type':Sequelize[_0xbac4('0x2')]},'moduleCreate':{'type':Sequelize['ENUM']('lead',_0xbac4('0x3'),_0xbac4('0x4')),'defaultValue':_0xbac4('0x5')},'moduleSearch':{'type':Sequelize[_0xbac4('0x6')](_0xbac4('0x7'),'contact','lead'),'defaultValue':_0xbac4('0x7')},'description':{'type':Sequelize[_0xbac4('0x2')]}}; \ No newline at end of file +var _0xc1f1=['ENUM','contact','contact_lead','exports','STRING','lead','nothing'];(function(_0x3a2406,_0x2e655e){var _0x5cdc8e=function(_0x427015){while(--_0x427015){_0x3a2406['push'](_0x3a2406['shift']());}};_0x5cdc8e(++_0x2e655e);}(_0xc1f1,0x122));var _0x1c1f=function(_0x2158a8,_0x335f85){_0x2158a8=_0x2158a8-0x0;var _0x4b1071=_0xc1f1[_0x2158a8];return _0x4b1071;};'use strict';var Sequelize=require('sequelize');module[_0x1c1f('0x0')]={'name':{'type':Sequelize[_0x1c1f('0x1')]},'moduleCreate':{'type':Sequelize['ENUM'](_0x1c1f('0x2'),'contact',_0x1c1f('0x3')),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0x1c1f('0x4')]('contact_lead',_0x1c1f('0x5'),'lead'),'defaultValue':_0x1c1f('0x6')},'description':{'type':Sequelize[_0x1c1f('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 0c51291..4b7f04b 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 _0x33c4=['filters','pick','getFields','findOne','getDescriptions','ZohoField','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','ZohoConfiguration','type','model','map','keys','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','length','find','create','body','rawAttributes'];(function(_0x5d580b,_0x21b6bb){var _0x3e1998=function(_0x53f549){while(--_0x53f549){_0x5d580b['push'](_0x5d580b['shift']());}};_0x3e1998(++_0x21b6bb);}(_0x33c4,0xf0));var _0x433c=function(_0x22818b,_0x3c8c44){_0x22818b=_0x22818b-0x0;var _0x5e9a47=_0x33c4[_0x22818b];return _0x5e9a47;};'use strict';var emlformat=require(_0x433c('0x0'));var rimraf=require(_0x433c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x433c('0x2'));var rp=require(_0x433c('0x3'));var moment=require(_0x433c('0x4'));var BPromise=require(_0x433c('0x5'));var Mustache=require(_0x433c('0x6'));var util=require('util');var path=require(_0x433c('0x7'));var sox=require(_0x433c('0x8'));var csv=require(_0x433c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x433c('0xa'));var squel=require(_0x433c('0xb'));var crypto=require(_0x433c('0xc'));var jsforce=require(_0x433c('0xd'));var deskjs=require(_0x433c('0xe'));var toCsv=require('to-csv');var querystring=require(_0x433c('0xf'));var Papa=require(_0x433c('0x10'));var Redis=require(_0x433c('0x11'));var authService=require(_0x433c('0x12'));var qs=require(_0x433c('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x433c('0x14'))(_0x433c('0x15'));var utils=require(_0x433c('0x16'));var config=require(_0x433c('0x17'));var licenseUtil=require(_0x433c('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x19e90a,_0x40d8d7){_0x40d8d7=_0x40d8d7||0xcc;return function(_0x48fbcc){if(_0x48fbcc){return _0x19e90a[_0x433c('0x19')](_0x40d8d7);}return _0x19e90a[_0x433c('0x1a')](_0x40d8d7)[_0x433c('0x1b')]();};}function respondWithResult(_0x4bee6a,_0x59f85d){_0x59f85d=_0x59f85d||0xc8;return function(_0x517e9e){if(_0x517e9e){return _0x4bee6a['status'](_0x59f85d)['json'](_0x517e9e);}};}function respondWithFilteredResult(_0x4b2723,_0x5f4930){return function(_0x441753){if(_0x441753){var _0x515af0=typeof _0x5f4930['offset']===_0x433c('0x1c')&&typeof _0x5f4930[_0x433c('0x1d')]===_0x433c('0x1c');var _0x2cd8f2=_0x441753[_0x433c('0x1e')];var _0x285cfb=_0x515af0?0x0:_0x5f4930[_0x433c('0x1f')];var _0x184e52=_0x515af0?_0x441753[_0x433c('0x1e')]:_0x5f4930[_0x433c('0x1f')]+_0x5f4930[_0x433c('0x1d')];var _0x3f2174;if(_0x184e52>=_0x2cd8f2){_0x184e52=_0x2cd8f2;_0x3f2174=0xc8;}else{_0x3f2174=0xce;}_0x4b2723[_0x433c('0x1a')](_0x3f2174);return _0x4b2723[_0x433c('0x20')](_0x433c('0x21'),_0x285cfb+'-'+_0x184e52+'/'+_0x2cd8f2)['json'](_0x441753);}return null;};}function patchUpdates(_0x11e25d){return function(_0x1f0ff4){try{jsonpatch[_0x433c('0x22')](_0x1f0ff4,_0x11e25d,!![]);}catch(_0x5d1f23){return BPromise['reject'](_0x5d1f23);}return _0x1f0ff4[_0x433c('0x23')]();};}function saveUpdates(_0x354e1e,_0x1440aa){return function(_0x59d535){if(_0x59d535){return _0x59d535[_0x433c('0x24')](_0x354e1e)[_0x433c('0x25')](function(_0x32861d){return _0x32861d;});}return null;};}function removeEntity(_0x5ccdf1,_0x56fae7){return function(_0x5cd358){if(_0x5cd358){return _0x5cd358[_0x433c('0x26')]()[_0x433c('0x25')](function(){_0x5ccdf1['status'](0xcc)[_0x433c('0x1b')]();});}};}function handleEntityNotFound(_0x5a5026,_0x8e6ebc){return function(_0x1ad338){if(!_0x1ad338){_0x5a5026[_0x433c('0x19')](0x194);}return _0x1ad338;};}function handleError(_0x51ec44,_0x122515){_0x122515=_0x122515||0x1f4;return function(_0x2cc4b7){logger['error'](_0x2cc4b7[_0x433c('0x27')]);if(_0x2cc4b7[_0x433c('0x28')]){delete _0x2cc4b7[_0x433c('0x28')];}_0x51ec44[_0x433c('0x1a')](_0x122515)[_0x433c('0x29')](_0x2cc4b7);};}exports[_0x433c('0x2a')]=function(_0x26ee69,_0x1381e7){var _0x255566={},_0x628865={},_0x1ef859={'count':0x0,'rows':[]};var _0x47783c=_['map'](db[_0x433c('0x2b')]['rawAttributes'],function(_0x379389){return{'name':_0x379389['fieldName'],'type':_0x379389[_0x433c('0x2c')]['key']};});_0x628865[_0x433c('0x2d')]=_[_0x433c('0x2e')](_0x47783c,_0x433c('0x28'));_0x628865['query']=_[_0x433c('0x2f')](_0x26ee69['query']);_0x628865['filters']=_[_0x433c('0x30')](_0x628865['model'],_0x628865[_0x433c('0x31')]);_0x255566[_0x433c('0x32')]=_[_0x433c('0x30')](_0x628865[_0x433c('0x2d')],qs['fields'](_0x26ee69[_0x433c('0x31')][_0x433c('0x33')]));_0x255566[_0x433c('0x32')]=_0x255566['attributes']['length']?_0x255566[_0x433c('0x32')]:_0x628865['model'];if(!_0x26ee69['query'][_0x433c('0x34')](_0x433c('0x35'))){_0x255566[_0x433c('0x1d')]=qs[_0x433c('0x1d')](_0x26ee69[_0x433c('0x31')]['limit']);_0x255566['offset']=qs[_0x433c('0x1f')](_0x26ee69['query'][_0x433c('0x1f')]);}_0x255566[_0x433c('0x36')]=qs[_0x433c('0x37')](_0x26ee69[_0x433c('0x31')][_0x433c('0x37')]);_0x255566[_0x433c('0x38')]=qs['filters'](_['pick'](_0x26ee69[_0x433c('0x31')],_0x628865['filters']),_0x47783c);if(_0x26ee69[_0x433c('0x31')][_0x433c('0x39')]){_0x255566[_0x433c('0x38')]=_[_0x433c('0x3a')](_0x255566[_0x433c('0x38')],{'$or':_[_0x433c('0x2e')](_0x47783c,function(_0x3d4301){if(_0x3d4301['type']!==_0x433c('0x3b')){var _0x59550c={};_0x59550c[_0x3d4301['name']]={'$like':'%'+_0x26ee69[_0x433c('0x31')][_0x433c('0x39')]+'%'};return _0x59550c;}})});}_0x255566=_['merge']({},_0x255566,_0x26ee69[_0x433c('0x3c')]);var _0x10c0c4={'where':_0x255566[_0x433c('0x38')]};return db[_0x433c('0x2b')]['count'](_0x10c0c4)[_0x433c('0x25')](function(_0x23b0cb){_0x1ef859[_0x433c('0x1e')]=_0x23b0cb;if(_0x26ee69[_0x433c('0x31')][_0x433c('0x3d')]){_0x255566[_0x433c('0x3e')]=[{'all':!![]}];}return db[_0x433c('0x2b')][_0x433c('0x3f')](_0x255566);})['then'](function(_0x263f6f){_0x1ef859[_0x433c('0x40')]=_0x263f6f;return _0x1ef859;})[_0x433c('0x25')](respondWithFilteredResult(_0x1381e7,_0x255566))[_0x433c('0x41')](handleError(_0x1381e7,null));};exports['show']=function(_0xb155f0,_0x184486){var _0x568bc6={'raw':![],'where':{'id':_0xb155f0[_0x433c('0x42')]['id']}},_0x5d5ed8={};_0x5d5ed8[_0x433c('0x2d')]=_[_0x433c('0x2f')](db[_0x433c('0x2b')]['rawAttributes']);_0x5d5ed8[_0x433c('0x31')]=_[_0x433c('0x2f')](_0xb155f0[_0x433c('0x31')]);_0x5d5ed8['filters']=_[_0x433c('0x30')](_0x5d5ed8['model'],_0x5d5ed8[_0x433c('0x31')]);_0x568bc6['attributes']=_[_0x433c('0x30')](_0x5d5ed8['model'],qs[_0x433c('0x33')](_0xb155f0[_0x433c('0x31')][_0x433c('0x33')]));_0x568bc6[_0x433c('0x32')]=_0x568bc6[_0x433c('0x32')][_0x433c('0x43')]?_0x568bc6[_0x433c('0x32')]:_0x5d5ed8['model'];if(_0xb155f0['query'][_0x433c('0x3d')]){_0x568bc6['include']=[{'all':!![]}];}_0x568bc6=_[_0x433c('0x3a')]({},_0x568bc6,_0xb155f0[_0x433c('0x3c')]);return db[_0x433c('0x2b')][_0x433c('0x44')](_0x568bc6)[_0x433c('0x25')](handleEntityNotFound(_0x184486,null))['then'](respondWithResult(_0x184486,null))[_0x433c('0x41')](handleError(_0x184486,null));};exports[_0x433c('0x45')]=function(_0x4feae4,_0x3199c7){return db[_0x433c('0x2b')][_0x433c('0x45')](_0x4feae4[_0x433c('0x46')],{})[_0x433c('0x25')](respondWithResult(_0x3199c7,0xc9))['catch'](handleError(_0x3199c7,null));};exports[_0x433c('0x24')]=function(_0x1d87e2,_0x3f8436){if(_0x1d87e2[_0x433c('0x46')]['id']){delete _0x1d87e2[_0x433c('0x46')]['id'];}return db[_0x433c('0x2b')]['find']({'where':{'id':_0x1d87e2[_0x433c('0x42')]['id']}})['then'](handleEntityNotFound(_0x3f8436,null))[_0x433c('0x25')](saveUpdates(_0x1d87e2[_0x433c('0x46')],null))[_0x433c('0x25')](respondWithResult(_0x3f8436,null))[_0x433c('0x41')](handleError(_0x3f8436,null));};exports[_0x433c('0x26')]=function(_0x21f8b7,_0x3dc0c8){return db['ZohoConfiguration'][_0x433c('0x44')]({'where':{'id':_0x21f8b7['params']['id']}})['then'](handleEntityNotFound(_0x3dc0c8,null))[_0x433c('0x25')](removeEntity(_0x3dc0c8,null))['catch'](handleError(_0x3dc0c8,null));};exports['getFields']=function(_0x4e483d,_0x2889db,_0x125955){var _0x10e969={};var _0x368b9c={};var _0x34271b;var _0x5578b3;return db['ZohoConfiguration']['findOne']({'where':{'id':_0x4e483d[_0x433c('0x42')]['id']}})[_0x433c('0x25')](handleEntityNotFound(_0x2889db,null))['then'](function(_0x453916){if(_0x453916){_0x34271b=_0x453916;_0x368b9c[_0x433c('0x2d')]=_[_0x433c('0x2f')](db['ZohoField'][_0x433c('0x47')]);_0x368b9c[_0x433c('0x31')]=_[_0x433c('0x2f')](_0x4e483d['query']);_0x368b9c[_0x433c('0x48')]=_[_0x433c('0x30')](_0x368b9c[_0x433c('0x2d')],_0x368b9c[_0x433c('0x31')]);_0x10e969[_0x433c('0x32')]=_[_0x433c('0x30')](_0x368b9c[_0x433c('0x2d')],qs['fields'](_0x4e483d['query']['fields']));_0x10e969['attributes']=_0x10e969[_0x433c('0x32')]['length']?_0x10e969[_0x433c('0x32')]:_0x368b9c[_0x433c('0x2d')];_0x10e969[_0x433c('0x36')]=qs[_0x433c('0x37')](_0x4e483d['query']['sort']);_0x10e969[_0x433c('0x38')]=qs['filters'](_[_0x433c('0x49')](_0x4e483d[_0x433c('0x31')],_0x368b9c[_0x433c('0x48')]));if(_0x4e483d[_0x433c('0x31')][_0x433c('0x39')]){_0x10e969['where']=_[_0x433c('0x3a')](_0x10e969[_0x433c('0x38')],{'$or':_[_0x433c('0x2e')](_0x10e969[_0x433c('0x32')],function(_0x21bd35){var _0x1c1901={};_0x1c1901[_0x21bd35]={'$like':'%'+_0x4e483d[_0x433c('0x31')]['filter']+'%'};return _0x1c1901;})});}_0x10e969=_[_0x433c('0x3a')]({},_0x10e969,_0x4e483d[_0x433c('0x3c')]);return _0x34271b[_0x433c('0x4a')](_0x10e969);}})[_0x433c('0x25')](function(_0x238f51){if(_0x238f51){_0x5578b3=_0x238f51[_0x433c('0x43')];if(!_0x4e483d[_0x433c('0x31')][_0x433c('0x34')](_0x433c('0x35'))){_0x10e969[_0x433c('0x1d')]=qs[_0x433c('0x1d')](_0x4e483d[_0x433c('0x31')][_0x433c('0x1d')]);_0x10e969['offset']=qs[_0x433c('0x1f')](_0x4e483d[_0x433c('0x31')][_0x433c('0x1f')]);}return _0x34271b[_0x433c('0x4a')](_0x10e969);}})[_0x433c('0x25')](function(_0x3f6d2c){if(_0x3f6d2c){return _0x3f6d2c?{'count':_0x5578b3,'rows':_0x3f6d2c}:null;}})[_0x433c('0x25')](respondWithResult(_0x2889db,null))['catch'](handleError(_0x2889db,null));};exports['getSubjects']=function(_0x45e7fe,_0x11af4f,_0x21a247){var _0x578aba={};var _0x53fdee={};var _0x5ad35a;var _0x2b6a6b;return db[_0x433c('0x2b')][_0x433c('0x4b')]({'where':{'id':_0x45e7fe[_0x433c('0x42')]['id']}})[_0x433c('0x25')](handleEntityNotFound(_0x11af4f,null))[_0x433c('0x25')](function(_0xaaed7d){if(_0xaaed7d){_0x5ad35a=_0xaaed7d;_0x53fdee[_0x433c('0x2d')]=_[_0x433c('0x2f')](db['ZohoField'][_0x433c('0x47')]);_0x53fdee['query']=_[_0x433c('0x2f')](_0x45e7fe[_0x433c('0x31')]);_0x53fdee['filters']=_['intersection'](_0x53fdee[_0x433c('0x2d')],_0x53fdee['query']);_0x578aba[_0x433c('0x32')]=_[_0x433c('0x30')](_0x53fdee[_0x433c('0x2d')],qs[_0x433c('0x33')](_0x45e7fe[_0x433c('0x31')]['fields']));_0x578aba[_0x433c('0x32')]=_0x578aba[_0x433c('0x32')]['length']?_0x578aba['attributes']:_0x53fdee[_0x433c('0x2d')];_0x578aba[_0x433c('0x36')]=qs['sort'](_0x45e7fe[_0x433c('0x31')][_0x433c('0x37')]);_0x578aba['where']=qs[_0x433c('0x48')](_['pick'](_0x45e7fe[_0x433c('0x31')],_0x53fdee[_0x433c('0x48')]));if(_0x45e7fe[_0x433c('0x31')][_0x433c('0x39')]){_0x578aba[_0x433c('0x38')]=_['merge'](_0x578aba[_0x433c('0x38')],{'$or':_['map'](_0x578aba[_0x433c('0x32')],function(_0x5ef6de){var _0x1306ff={};_0x1306ff[_0x5ef6de]={'$like':'%'+_0x45e7fe['query'][_0x433c('0x39')]+'%'};return _0x1306ff;})});}_0x578aba=_[_0x433c('0x3a')]({},_0x578aba,_0x45e7fe['options']);return _0x5ad35a['getSubjects'](_0x578aba);}})['then'](function(_0x923880){if(_0x923880){_0x2b6a6b=_0x923880['length'];if(!_0x45e7fe[_0x433c('0x31')]['hasOwnProperty'](_0x433c('0x35'))){_0x578aba[_0x433c('0x1d')]=qs[_0x433c('0x1d')](_0x45e7fe['query']['limit']);_0x578aba[_0x433c('0x1f')]=qs['offset'](_0x45e7fe['query']['offset']);}return _0x5ad35a['getSubjects'](_0x578aba);}})[_0x433c('0x25')](function(_0x1f9fde){if(_0x1f9fde){return _0x1f9fde?{'count':_0x2b6a6b,'rows':_0x1f9fde}:null;}})[_0x433c('0x25')](respondWithResult(_0x11af4f,null))[_0x433c('0x41')](handleError(_0x11af4f,null));};exports[_0x433c('0x4c')]=function(_0xdb8340,_0x3ac7e9,_0x7a74c0){var _0xe6a1d6={};var _0xe6b32={};var _0x5afadb;var _0x14681c;return db['ZohoConfiguration'][_0x433c('0x4b')]({'where':{'id':_0xdb8340[_0x433c('0x42')]['id']}})[_0x433c('0x25')](handleEntityNotFound(_0x3ac7e9,null))['then'](function(_0xc69f11){if(_0xc69f11){_0x5afadb=_0xc69f11;_0xe6b32[_0x433c('0x2d')]=_[_0x433c('0x2f')](db[_0x433c('0x4d')][_0x433c('0x47')]);_0xe6b32[_0x433c('0x31')]=_['keys'](_0xdb8340[_0x433c('0x31')]);_0xe6b32['filters']=_[_0x433c('0x30')](_0xe6b32[_0x433c('0x2d')],_0xe6b32['query']);_0xe6a1d6[_0x433c('0x32')]=_['intersection'](_0xe6b32[_0x433c('0x2d')],qs[_0x433c('0x33')](_0xdb8340['query'][_0x433c('0x33')]));_0xe6a1d6[_0x433c('0x32')]=_0xe6a1d6[_0x433c('0x32')][_0x433c('0x43')]?_0xe6a1d6[_0x433c('0x32')]:_0xe6b32[_0x433c('0x2d')];_0xe6a1d6['order']=qs['sort'](_0xdb8340[_0x433c('0x31')][_0x433c('0x37')]);_0xe6a1d6['where']=qs[_0x433c('0x48')](_['pick'](_0xdb8340[_0x433c('0x31')],_0xe6b32['filters']));if(_0xdb8340[_0x433c('0x31')][_0x433c('0x39')]){_0xe6a1d6[_0x433c('0x38')]=_[_0x433c('0x3a')](_0xe6a1d6[_0x433c('0x38')],{'$or':_['map'](_0xe6a1d6[_0x433c('0x32')],function(_0x168f0d){var _0x56e13d={};_0x56e13d[_0x168f0d]={'$like':'%'+_0xdb8340[_0x433c('0x31')][_0x433c('0x39')]+'%'};return _0x56e13d;})});}_0xe6a1d6=_[_0x433c('0x3a')]({},_0xe6a1d6,_0xdb8340['options']);return _0x5afadb['getDescriptions'](_0xe6a1d6);}})['then'](function(_0x48b8b5){if(_0x48b8b5){_0x14681c=_0x48b8b5['length'];if(!_0xdb8340[_0x433c('0x31')][_0x433c('0x34')](_0x433c('0x35'))){_0xe6a1d6[_0x433c('0x1d')]=qs[_0x433c('0x1d')](_0xdb8340[_0x433c('0x31')][_0x433c('0x1d')]);_0xe6a1d6[_0x433c('0x1f')]=qs[_0x433c('0x1f')](_0xdb8340[_0x433c('0x31')][_0x433c('0x1f')]);}return _0x5afadb[_0x433c('0x4c')](_0xe6a1d6);}})[_0x433c('0x25')](function(_0x3346c5){if(_0x3346c5){return _0x3346c5?{'count':_0x14681c,'rows':_0x3346c5}:null;}})[_0x433c('0x25')](respondWithResult(_0x3ac7e9,null))[_0x433c('0x41')](handleError(_0x3ac7e9,null));}; \ No newline at end of file +var _0x19bb=['error','stack','send','map','ZohoConfiguration','rawAttributes','fieldName','type','key','model','name','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','include','findAll','rows','catch','params','includeAll','options','find','body','getFields','findOne','pick','getSubjects','ZohoField','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','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'];(function(_0x475bab,_0x2a8f94){var _0x139ded=function(_0x17d773){while(--_0x17d773){_0x475bab['push'](_0x475bab['shift']());}};_0x139ded(++_0x2a8f94);}(_0x19bb,0x7b));var _0xb19b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x19bb[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0xb19b('0x0'));var rimraf=require(_0xb19b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb19b('0x2'));var rp=require(_0xb19b('0x3'));var moment=require(_0xb19b('0x4'));var BPromise=require(_0xb19b('0x5'));var Mustache=require(_0xb19b('0x6'));var util=require(_0xb19b('0x7'));var path=require(_0xb19b('0x8'));var sox=require(_0xb19b('0x9'));var csv=require(_0xb19b('0xa'));var ejs=require(_0xb19b('0xb'));var fs=require('fs');var fs_extra=require(_0xb19b('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xb19b('0xd'));var jsforce=require(_0xb19b('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb19b('0xa'));var querystring=require(_0xb19b('0xf'));var Papa=require('papaparse');var Redis=require(_0xb19b('0x10'));var authService=require(_0xb19b('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb19b('0x12'));var hardwareService=require(_0xb19b('0x13'));var logger=require(_0xb19b('0x14'))(_0xb19b('0x15'));var utils=require(_0xb19b('0x16'));var config=require(_0xb19b('0x17'));var licenseUtil=require(_0xb19b('0x18'));var db=require(_0xb19b('0x19'))['db'];function respondWithStatusCode(_0x105ece,_0x3072f3){_0x3072f3=_0x3072f3||0xcc;return function(_0x3020b7){if(_0x3020b7){return _0x105ece[_0xb19b('0x1a')](_0x3072f3);}return _0x105ece['status'](_0x3072f3)[_0xb19b('0x1b')]();};}function respondWithResult(_0x20afbb,_0x2d3fb8){_0x2d3fb8=_0x2d3fb8||0xc8;return function(_0xada3b7){if(_0xada3b7){return _0x20afbb[_0xb19b('0x1c')](_0x2d3fb8)[_0xb19b('0x1d')](_0xada3b7);}};}function respondWithFilteredResult(_0x546424,_0x3ab049){return function(_0x1f017f){if(_0x1f017f){var _0x58a87f=typeof _0x3ab049[_0xb19b('0x1e')]===_0xb19b('0x1f')&&typeof _0x3ab049[_0xb19b('0x20')]==='undefined';var _0x2a6540=_0x1f017f[_0xb19b('0x21')];var _0x456590=_0x58a87f?0x0:_0x3ab049[_0xb19b('0x1e')];var _0x518bc5=_0x58a87f?_0x1f017f[_0xb19b('0x21')]:_0x3ab049[_0xb19b('0x1e')]+_0x3ab049[_0xb19b('0x20')];var _0x25888d;if(_0x518bc5>=_0x2a6540){_0x518bc5=_0x2a6540;_0x25888d=0xc8;}else{_0x25888d=0xce;}_0x546424[_0xb19b('0x1c')](_0x25888d);return _0x546424[_0xb19b('0x22')](_0xb19b('0x23'),_0x456590+'-'+_0x518bc5+'/'+_0x2a6540)[_0xb19b('0x1d')](_0x1f017f);}return null;};}function patchUpdates(_0x5d07ec){return function(_0x3e918a){try{jsonpatch[_0xb19b('0x24')](_0x3e918a,_0x5d07ec,!![]);}catch(_0x3a3b79){return BPromise[_0xb19b('0x25')](_0x3a3b79);}return _0x3e918a['save']();};}function saveUpdates(_0x3012e0,_0x8069e3){return function(_0x1dc0bb){if(_0x1dc0bb){return _0x1dc0bb[_0xb19b('0x26')](_0x3012e0)[_0xb19b('0x27')](function(_0x4e1def){return _0x4e1def;});}return null;};}function removeEntity(_0x58bd0c,_0x47d2e7){return function(_0x3d8155){if(_0x3d8155){return _0x3d8155[_0xb19b('0x28')]()[_0xb19b('0x27')](function(){_0x58bd0c[_0xb19b('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e8db0,_0x5a9086){return function(_0x489081){if(!_0x489081){_0x3e8db0[_0xb19b('0x1a')](0x194);}return _0x489081;};}function handleError(_0x1aa285,_0x26b6d6){_0x26b6d6=_0x26b6d6||0x1f4;return function(_0x27b336){logger[_0xb19b('0x29')](_0x27b336[_0xb19b('0x2a')]);if(_0x27b336['name']){delete _0x27b336['name'];}_0x1aa285[_0xb19b('0x1c')](_0x26b6d6)[_0xb19b('0x2b')](_0x27b336);};}exports['index']=function(_0x15570e,_0x1a69ae){var _0x2e6506={},_0x16bd81={},_0x589e38={'count':0x0,'rows':[]};var _0x2dd4ea=_[_0xb19b('0x2c')](db[_0xb19b('0x2d')][_0xb19b('0x2e')],function(_0x6956df){return{'name':_0x6956df[_0xb19b('0x2f')],'type':_0x6956df[_0xb19b('0x30')][_0xb19b('0x31')]};});_0x16bd81[_0xb19b('0x32')]=_[_0xb19b('0x2c')](_0x2dd4ea,_0xb19b('0x33'));_0x16bd81['query']=_[_0xb19b('0x34')](_0x15570e[_0xb19b('0x35')]);_0x16bd81[_0xb19b('0x36')]=_['intersection'](_0x16bd81[_0xb19b('0x32')],_0x16bd81[_0xb19b('0x35')]);_0x2e6506['attributes']=_[_0xb19b('0x37')](_0x16bd81[_0xb19b('0x32')],qs['fields'](_0x15570e['query'][_0xb19b('0x38')]));_0x2e6506[_0xb19b('0x39')]=_0x2e6506[_0xb19b('0x39')][_0xb19b('0x3a')]?_0x2e6506[_0xb19b('0x39')]:_0x16bd81[_0xb19b('0x32')];if(!_0x15570e[_0xb19b('0x35')][_0xb19b('0x3b')](_0xb19b('0x3c'))){_0x2e6506[_0xb19b('0x20')]=qs[_0xb19b('0x20')](_0x15570e[_0xb19b('0x35')][_0xb19b('0x20')]);_0x2e6506[_0xb19b('0x1e')]=qs[_0xb19b('0x1e')](_0x15570e[_0xb19b('0x35')]['offset']);}_0x2e6506[_0xb19b('0x3d')]=qs[_0xb19b('0x3e')](_0x15570e[_0xb19b('0x35')][_0xb19b('0x3e')]);_0x2e6506['where']=qs['filters'](_['pick'](_0x15570e[_0xb19b('0x35')],_0x16bd81[_0xb19b('0x36')]),_0x2dd4ea);if(_0x15570e['query']['filter']){_0x2e6506[_0xb19b('0x3f')]=_[_0xb19b('0x40')](_0x2e6506['where'],{'$or':_['map'](_0x2dd4ea,function(_0x1b06d2){if(_0x1b06d2[_0xb19b('0x30')]!==_0xb19b('0x41')){var _0x5c6094={};_0x5c6094[_0x1b06d2['name']]={'$like':'%'+_0x15570e['query'][_0xb19b('0x42')]+'%'};return _0x5c6094;}})});}_0x2e6506=_['merge']({},_0x2e6506,_0x15570e['options']);var _0x1a5862={'where':_0x2e6506[_0xb19b('0x3f')]};return db[_0xb19b('0x2d')][_0xb19b('0x21')](_0x1a5862)[_0xb19b('0x27')](function(_0x453f2e){_0x589e38['count']=_0x453f2e;if(_0x15570e[_0xb19b('0x35')]['includeAll']){_0x2e6506[_0xb19b('0x43')]=[{'all':!![]}];}return db[_0xb19b('0x2d')][_0xb19b('0x44')](_0x2e6506);})['then'](function(_0x3bba3e){_0x589e38[_0xb19b('0x45')]=_0x3bba3e;return _0x589e38;})[_0xb19b('0x27')](respondWithFilteredResult(_0x1a69ae,_0x2e6506))[_0xb19b('0x46')](handleError(_0x1a69ae,null));};exports['show']=function(_0x181134,_0x4e2791){var _0x211100={'raw':![],'where':{'id':_0x181134[_0xb19b('0x47')]['id']}},_0x5cf5e1={};_0x5cf5e1[_0xb19b('0x32')]=_[_0xb19b('0x34')](db[_0xb19b('0x2d')][_0xb19b('0x2e')]);_0x5cf5e1['query']=_[_0xb19b('0x34')](_0x181134[_0xb19b('0x35')]);_0x5cf5e1[_0xb19b('0x36')]=_[_0xb19b('0x37')](_0x5cf5e1[_0xb19b('0x32')],_0x5cf5e1[_0xb19b('0x35')]);_0x211100[_0xb19b('0x39')]=_[_0xb19b('0x37')](_0x5cf5e1[_0xb19b('0x32')],qs[_0xb19b('0x38')](_0x181134[_0xb19b('0x35')]['fields']));_0x211100[_0xb19b('0x39')]=_0x211100[_0xb19b('0x39')][_0xb19b('0x3a')]?_0x211100[_0xb19b('0x39')]:_0x5cf5e1['model'];if(_0x181134[_0xb19b('0x35')][_0xb19b('0x48')]){_0x211100[_0xb19b('0x43')]=[{'all':!![]}];}_0x211100=_[_0xb19b('0x40')]({},_0x211100,_0x181134[_0xb19b('0x49')]);return db[_0xb19b('0x2d')][_0xb19b('0x4a')](_0x211100)[_0xb19b('0x27')](handleEntityNotFound(_0x4e2791,null))[_0xb19b('0x27')](respondWithResult(_0x4e2791,null))['catch'](handleError(_0x4e2791,null));};exports['create']=function(_0x51e5d8,_0x5e17ed){return db[_0xb19b('0x2d')]['create'](_0x51e5d8[_0xb19b('0x4b')],{})[_0xb19b('0x27')](respondWithResult(_0x5e17ed,0xc9))['catch'](handleError(_0x5e17ed,null));};exports['update']=function(_0x3a2920,_0x5b0535){if(_0x3a2920[_0xb19b('0x4b')]['id']){delete _0x3a2920[_0xb19b('0x4b')]['id'];}return db[_0xb19b('0x2d')][_0xb19b('0x4a')]({'where':{'id':_0x3a2920[_0xb19b('0x47')]['id']}})[_0xb19b('0x27')](handleEntityNotFound(_0x5b0535,null))[_0xb19b('0x27')](saveUpdates(_0x3a2920[_0xb19b('0x4b')],null))['then'](respondWithResult(_0x5b0535,null))[_0xb19b('0x46')](handleError(_0x5b0535,null));};exports['destroy']=function(_0x532a1d,_0x50f5d3){return db[_0xb19b('0x2d')][_0xb19b('0x4a')]({'where':{'id':_0x532a1d[_0xb19b('0x47')]['id']}})['then'](handleEntityNotFound(_0x50f5d3,null))['then'](removeEntity(_0x50f5d3,null))[_0xb19b('0x46')](handleError(_0x50f5d3,null));};exports[_0xb19b('0x4c')]=function(_0x5f11ef,_0x4e1ce6,_0x2bb83d){var _0x19e41f={};var _0x21ed10={};var _0x2cf1fa;var _0x368a14;return db[_0xb19b('0x2d')][_0xb19b('0x4d')]({'where':{'id':_0x5f11ef[_0xb19b('0x47')]['id']}})[_0xb19b('0x27')](handleEntityNotFound(_0x4e1ce6,null))[_0xb19b('0x27')](function(_0x3ca04a){if(_0x3ca04a){_0x2cf1fa=_0x3ca04a;_0x21ed10[_0xb19b('0x32')]=_['keys'](db['ZohoField'][_0xb19b('0x2e')]);_0x21ed10[_0xb19b('0x35')]=_[_0xb19b('0x34')](_0x5f11ef['query']);_0x21ed10[_0xb19b('0x36')]=_['intersection'](_0x21ed10[_0xb19b('0x32')],_0x21ed10[_0xb19b('0x35')]);_0x19e41f[_0xb19b('0x39')]=_['intersection'](_0x21ed10[_0xb19b('0x32')],qs[_0xb19b('0x38')](_0x5f11ef[_0xb19b('0x35')][_0xb19b('0x38')]));_0x19e41f[_0xb19b('0x39')]=_0x19e41f[_0xb19b('0x39')]['length']?_0x19e41f[_0xb19b('0x39')]:_0x21ed10['model'];_0x19e41f[_0xb19b('0x3d')]=qs[_0xb19b('0x3e')](_0x5f11ef[_0xb19b('0x35')]['sort']);_0x19e41f[_0xb19b('0x3f')]=qs['filters'](_[_0xb19b('0x4e')](_0x5f11ef[_0xb19b('0x35')],_0x21ed10[_0xb19b('0x36')]));if(_0x5f11ef[_0xb19b('0x35')][_0xb19b('0x42')]){_0x19e41f[_0xb19b('0x3f')]=_[_0xb19b('0x40')](_0x19e41f[_0xb19b('0x3f')],{'$or':_[_0xb19b('0x2c')](_0x19e41f[_0xb19b('0x39')],function(_0x5310c9){var _0x551875={};_0x551875[_0x5310c9]={'$like':'%'+_0x5f11ef[_0xb19b('0x35')][_0xb19b('0x42')]+'%'};return _0x551875;})});}_0x19e41f=_['merge']({},_0x19e41f,_0x5f11ef[_0xb19b('0x49')]);return _0x2cf1fa[_0xb19b('0x4c')](_0x19e41f);}})[_0xb19b('0x27')](function(_0x4b01e3){if(_0x4b01e3){_0x368a14=_0x4b01e3[_0xb19b('0x3a')];if(!_0x5f11ef[_0xb19b('0x35')]['hasOwnProperty']('nolimit')){_0x19e41f[_0xb19b('0x20')]=qs['limit'](_0x5f11ef[_0xb19b('0x35')][_0xb19b('0x20')]);_0x19e41f[_0xb19b('0x1e')]=qs[_0xb19b('0x1e')](_0x5f11ef[_0xb19b('0x35')][_0xb19b('0x1e')]);}return _0x2cf1fa[_0xb19b('0x4c')](_0x19e41f);}})[_0xb19b('0x27')](function(_0x5d8763){if(_0x5d8763){return _0x5d8763?{'count':_0x368a14,'rows':_0x5d8763}:null;}})[_0xb19b('0x27')](respondWithResult(_0x4e1ce6,null))[_0xb19b('0x46')](handleError(_0x4e1ce6,null));};exports[_0xb19b('0x4f')]=function(_0x271cfa,_0x55c305,_0x2fc8cc){var _0x2904be={};var _0x537345={};var _0x14e624;var _0x15ddd0;return db[_0xb19b('0x2d')][_0xb19b('0x4d')]({'where':{'id':_0x271cfa[_0xb19b('0x47')]['id']}})['then'](handleEntityNotFound(_0x55c305,null))[_0xb19b('0x27')](function(_0x2a2932){if(_0x2a2932){_0x14e624=_0x2a2932;_0x537345[_0xb19b('0x32')]=_[_0xb19b('0x34')](db[_0xb19b('0x50')][_0xb19b('0x2e')]);_0x537345['query']=_[_0xb19b('0x34')](_0x271cfa[_0xb19b('0x35')]);_0x537345[_0xb19b('0x36')]=_['intersection'](_0x537345[_0xb19b('0x32')],_0x537345[_0xb19b('0x35')]);_0x2904be[_0xb19b('0x39')]=_[_0xb19b('0x37')](_0x537345[_0xb19b('0x32')],qs[_0xb19b('0x38')](_0x271cfa[_0xb19b('0x35')][_0xb19b('0x38')]));_0x2904be[_0xb19b('0x39')]=_0x2904be[_0xb19b('0x39')]['length']?_0x2904be['attributes']:_0x537345[_0xb19b('0x32')];_0x2904be[_0xb19b('0x3d')]=qs['sort'](_0x271cfa['query'][_0xb19b('0x3e')]);_0x2904be[_0xb19b('0x3f')]=qs[_0xb19b('0x36')](_[_0xb19b('0x4e')](_0x271cfa[_0xb19b('0x35')],_0x537345[_0xb19b('0x36')]));if(_0x271cfa[_0xb19b('0x35')][_0xb19b('0x42')]){_0x2904be[_0xb19b('0x3f')]=_[_0xb19b('0x40')](_0x2904be[_0xb19b('0x3f')],{'$or':_[_0xb19b('0x2c')](_0x2904be['attributes'],function(_0x151a58){var _0x2edba7={};_0x2edba7[_0x151a58]={'$like':'%'+_0x271cfa[_0xb19b('0x35')][_0xb19b('0x42')]+'%'};return _0x2edba7;})});}_0x2904be=_[_0xb19b('0x40')]({},_0x2904be,_0x271cfa[_0xb19b('0x49')]);return _0x14e624['getSubjects'](_0x2904be);}})[_0xb19b('0x27')](function(_0x2ec54d){if(_0x2ec54d){_0x15ddd0=_0x2ec54d[_0xb19b('0x3a')];if(!_0x271cfa[_0xb19b('0x35')]['hasOwnProperty']('nolimit')){_0x2904be[_0xb19b('0x20')]=qs['limit'](_0x271cfa[_0xb19b('0x35')][_0xb19b('0x20')]);_0x2904be[_0xb19b('0x1e')]=qs[_0xb19b('0x1e')](_0x271cfa['query'][_0xb19b('0x1e')]);}return _0x14e624[_0xb19b('0x4f')](_0x2904be);}})[_0xb19b('0x27')](function(_0x36a57e){if(_0x36a57e){return _0x36a57e?{'count':_0x15ddd0,'rows':_0x36a57e}:null;}})[_0xb19b('0x27')](respondWithResult(_0x55c305,null))[_0xb19b('0x46')](handleError(_0x55c305,null));};exports['getDescriptions']=function(_0x50080e,_0xd43508,_0x5571ec){var _0x2a4250={};var _0x4b2930={};var _0x389534;var _0x37f670;return db['ZohoConfiguration'][_0xb19b('0x4d')]({'where':{'id':_0x50080e[_0xb19b('0x47')]['id']}})[_0xb19b('0x27')](handleEntityNotFound(_0xd43508,null))[_0xb19b('0x27')](function(_0x407a86){if(_0x407a86){_0x389534=_0x407a86;_0x4b2930[_0xb19b('0x32')]=_[_0xb19b('0x34')](db['ZohoField']['rawAttributes']);_0x4b2930['query']=_['keys'](_0x50080e['query']);_0x4b2930['filters']=_[_0xb19b('0x37')](_0x4b2930[_0xb19b('0x32')],_0x4b2930[_0xb19b('0x35')]);_0x2a4250[_0xb19b('0x39')]=_[_0xb19b('0x37')](_0x4b2930[_0xb19b('0x32')],qs[_0xb19b('0x38')](_0x50080e['query'][_0xb19b('0x38')]));_0x2a4250[_0xb19b('0x39')]=_0x2a4250[_0xb19b('0x39')]['length']?_0x2a4250[_0xb19b('0x39')]:_0x4b2930[_0xb19b('0x32')];_0x2a4250[_0xb19b('0x3d')]=qs[_0xb19b('0x3e')](_0x50080e['query'][_0xb19b('0x3e')]);_0x2a4250['where']=qs[_0xb19b('0x36')](_[_0xb19b('0x4e')](_0x50080e[_0xb19b('0x35')],_0x4b2930[_0xb19b('0x36')]));if(_0x50080e[_0xb19b('0x35')]['filter']){_0x2a4250[_0xb19b('0x3f')]=_[_0xb19b('0x40')](_0x2a4250[_0xb19b('0x3f')],{'$or':_[_0xb19b('0x2c')](_0x2a4250[_0xb19b('0x39')],function(_0x413fc5){var _0xba71de={};_0xba71de[_0x413fc5]={'$like':'%'+_0x50080e[_0xb19b('0x35')][_0xb19b('0x42')]+'%'};return _0xba71de;})});}_0x2a4250=_[_0xb19b('0x40')]({},_0x2a4250,_0x50080e[_0xb19b('0x49')]);return _0x389534[_0xb19b('0x51')](_0x2a4250);}})[_0xb19b('0x27')](function(_0x410021){if(_0x410021){_0x37f670=_0x410021['length'];if(!_0x50080e[_0xb19b('0x35')][_0xb19b('0x3b')](_0xb19b('0x3c'))){_0x2a4250[_0xb19b('0x20')]=qs[_0xb19b('0x20')](_0x50080e[_0xb19b('0x35')][_0xb19b('0x20')]);_0x2a4250[_0xb19b('0x1e')]=qs[_0xb19b('0x1e')](_0x50080e[_0xb19b('0x35')][_0xb19b('0x1e')]);}return _0x389534[_0xb19b('0x51')](_0x2a4250);}})['then'](function(_0x4f1521){if(_0x4f1521){return _0x4f1521?{'count':_0x37f670,'rows':_0x4f1521}:null;}})[_0xb19b('0x27')](respondWithResult(_0xd43508,null))['catch'](handleError(_0xd43508,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 31863fe..0dac4df 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 _0x3537=['define','int_zoho_configurations','util','api','moment','bluebird','request-promise','exports'];(function(_0x58c20f,_0x4cdb1b){var _0x3b0318=function(_0x36fa84){while(--_0x36fa84){_0x58c20f['push'](_0x58c20f['shift']());}};_0x3b0318(++_0x4cdb1b);}(_0x3537,0x1b2));var _0x7353=function(_0x12f688,_0x585c25){_0x12f688=_0x12f688-0x0;var _0x59c3de=_0x3537[_0x12f688];return _0x59c3de;};'use strict';var _=require('lodash');var util=require(_0x7353('0x0'));var logger=require('../../config/logger')(_0x7353('0x1'));var moment=require(_0x7353('0x2'));var BPromise=require(_0x7353('0x3'));var rp=require(_0x7353('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intZohoConfiguration.attributes');module[_0x7353('0x5')]=function(_0x5b52d7,_0x498b9a){return _0x5b52d7[_0x7353('0x6')]('ZohoConfiguration',attributes,{'tableName':_0x7353('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc434=['../../config/environment','./intZohoConfiguration.attributes','exports','define','int_zoho_configurations','lodash','util','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xc434,0x13d));var _0x4c43=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xc434[_0x413feb];return _0x40ee88;};'use strict';var _=require(_0x4c43('0x0'));var util=require(_0x4c43('0x1'));var logger=require(_0x4c43('0x2'))('api');var moment=require(_0x4c43('0x3'));var BPromise=require('bluebird');var rp=require(_0x4c43('0x4'));var fs=require('fs');var path=require(_0x4c43('0x5'));var rimraf=require(_0x4c43('0x6'));var config=require(_0x4c43('0x7'));var attributes=require(_0x4c43('0x8'));module[_0x4c43('0x9')]=function(_0x332a84,_0x5b4690){return _0x332a84[_0x4c43('0xa')]('ZohoConfiguration',attributes,{'tableName':_0x4c43('0xb'),'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 3a2ad6c..6a67291 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 _0x1b04=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','moment','bluebird','randomstring'];(function(_0x480e5a,_0x405b5b){var _0x27b9a6=function(_0x38e763){while(--_0x38e763){_0x480e5a['push'](_0x480e5a['shift']());}};_0x27b9a6(++_0x405b5b);}(_0x1b04,0x11d));var _0x41b0=function(_0x193fc6,_0x5e0f10){_0x193fc6=_0x193fc6-0x0;var _0x81628f=_0x1b04[_0x193fc6];return _0x81628f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x41b0('0x0'));var BPromise=require(_0x41b0('0x1'));var rs=require(_0x41b0('0x2'));var fs=require('fs');var Redis=require(_0x41b0('0x3'));var db=require(_0x41b0('0x4'))['db'];var utils=require(_0x41b0('0x5'));var logger=require(_0x41b0('0x6'))(_0x41b0('0x7'));var config=require(_0x41b0('0x8'));var jayson=require(_0x41b0('0x9'));var client=jayson[_0x41b0('0xa')][_0x41b0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x12a69d,_0x3da426,_0x3c0700){return new BPromise(function(_0x5181ba,_0x3dc9a4){return client[_0x41b0('0xc')](_0x12a69d,_0x3c0700)[_0x41b0('0xd')](function(_0x13caf1){logger[_0x41b0('0xe')](_0x41b0('0xf'),_0x3da426,'request\x20sent');logger[_0x41b0('0x10')](_0x41b0('0x11'),_0x3da426,_0x41b0('0x12'),JSON[_0x41b0('0x13')](_0x13caf1));if(_0x13caf1[_0x41b0('0x14')]){if(_0x13caf1[_0x41b0('0x14')][_0x41b0('0x15')]===0x1f4){logger[_0x41b0('0x14')](_0x41b0('0xf'),_0x3da426,_0x13caf1[_0x41b0('0x14')]['message']);return _0x3dc9a4(_0x13caf1[_0x41b0('0x14')][_0x41b0('0x16')]);}logger[_0x41b0('0x14')](_0x41b0('0xf'),_0x3da426,_0x13caf1[_0x41b0('0x14')]['message']);return _0x5181ba(_0x13caf1[_0x41b0('0x14')][_0x41b0('0x16')]);}else{logger['info'](_0x41b0('0xf'),_0x3da426,_0x41b0('0x12'));_0x5181ba(_0x13caf1['result']['message']);}})[_0x41b0('0x17')](function(_0x548b69){logger[_0x41b0('0x14')](_0x41b0('0xf'),_0x3da426,_0x548b69);_0x3dc9a4(_0x548b69);});});} \ No newline at end of file +var _0x7b6c=['ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7b6c,0x66));var _0xc7b6=function(_0x5a0e89,_0x4c88b9){_0x5a0e89=_0x5a0e89-0x0;var _0x57dbaf=_0x7b6c[_0x5a0e89];return _0x57dbaf;};'use strict';var _=require(_0xc7b6('0x0'));var util=require('util');var moment=require(_0xc7b6('0x1'));var BPromise=require(_0xc7b6('0x2'));var rs=require(_0xc7b6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc7b6('0x4'))['db'];var utils=require(_0xc7b6('0x5'));var logger=require(_0xc7b6('0x6'))(_0xc7b6('0x7'));var config=require(_0xc7b6('0x8'));var jayson=require(_0xc7b6('0x9'));var client=jayson[_0xc7b6('0xa')][_0xc7b6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5bf973,_0x190c70,_0x2b83dc){return new BPromise(function(_0x522e22,_0x23af1c){return client['request'](_0x5bf973,_0x2b83dc)['then'](function(_0x104f47){logger[_0xc7b6('0xc')](_0xc7b6('0xd'),_0x190c70,_0xc7b6('0xe'));logger[_0xc7b6('0xf')](_0xc7b6('0x10'),_0x190c70,_0xc7b6('0xe'),JSON[_0xc7b6('0x11')](_0x104f47));if(_0x104f47['error']){if(_0x104f47[_0xc7b6('0x12')][_0xc7b6('0x13')]===0x1f4){logger[_0xc7b6('0x12')]('ZohoConfiguration,\x20%s,\x20%s',_0x190c70,_0x104f47[_0xc7b6('0x12')]['message']);return _0x23af1c(_0x104f47[_0xc7b6('0x12')][_0xc7b6('0x14')]);}logger[_0xc7b6('0x12')]('ZohoConfiguration,\x20%s,\x20%s',_0x190c70,_0x104f47['error'][_0xc7b6('0x14')]);return _0x522e22(_0x104f47[_0xc7b6('0x12')][_0xc7b6('0x14')]);}else{logger[_0xc7b6('0xc')](_0xc7b6('0xd'),_0x190c70,_0xc7b6('0xe'));_0x522e22(_0x104f47[_0xc7b6('0x15')]['message']);}})[_0xc7b6('0x16')](function(_0x3fd89b){logger[_0xc7b6('0x12')](_0xc7b6('0xd'),_0x190c70,_0x3fd89b);_0x23af1c(_0x3fd89b);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index a5e3d09..9a375e9 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 _0xbdfb=['../../config/environment','./intZohoField.controller','get','isAuthenticated','index','/:id','create','put','update','delete','destroy','exports','util','path','express','Router','fs-extra'];(function(_0x5612ec,_0x56d030){var _0x244e78=function(_0x3a07b6){while(--_0x3a07b6){_0x5612ec['push'](_0x5612ec['shift']());}};_0x244e78(++_0x56d030);}(_0xbdfb,0xb6));var _0xbbdf=function(_0x3ba57e,_0x2e6810){_0x3ba57e=_0x3ba57e-0x0;var _0x5d95cf=_0xbdfb[_0x3ba57e];return _0x5d95cf;};'use strict';var multer=require('multer');var util=require(_0xbbdf('0x0'));var path=require(_0xbbdf('0x1'));var timeout=require('connect-timeout');var express=require(_0xbbdf('0x2'));var router=express[_0xbbdf('0x3')]();var fs_extra=require(_0xbbdf('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xbbdf('0x5'));var controller=require(_0xbbdf('0x6'));router[_0xbbdf('0x7')]('/',auth[_0xbbdf('0x8')](),controller[_0xbbdf('0x9')]);router[_0xbbdf('0x7')](_0xbbdf('0xa'),auth[_0xbbdf('0x8')](),controller['show']);router['post']('/',auth[_0xbbdf('0x8')](),controller[_0xbbdf('0xb')]);router[_0xbbdf('0xc')]('/:id',auth[_0xbbdf('0x8')](),controller[_0xbbdf('0xd')]);router[_0xbbdf('0xe')]('/:id',auth[_0xbbdf('0x8')](),controller[_0xbbdf('0xf')]);module[_0xbbdf('0x10')]=router; \ No newline at end of file +var _0xe48c=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','index','/:id','show','post','put','exports','multer','util','path'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xe48c,0xb1));var _0xce48=function(_0x1977f4,_0x3c1173){_0x1977f4=_0x1977f4-0x0;var _0x4945d6=_0xe48c[_0x1977f4];return _0x4945d6;};'use strict';var multer=require(_0xce48('0x0'));var util=require(_0xce48('0x1'));var path=require(_0xce48('0x2'));var timeout=require('connect-timeout');var express=require(_0xce48('0x3'));var router=express[_0xce48('0x4')]();var fs_extra=require(_0xce48('0x5'));var auth=require(_0xce48('0x6'));var interaction=require(_0xce48('0x7'));var config=require(_0xce48('0x8'));var controller=require(_0xce48('0x9'));router[_0xce48('0xa')]('/',auth[_0xce48('0xb')](),controller[_0xce48('0xc')]);router[_0xce48('0xa')](_0xce48('0xd'),auth['isAuthenticated'](),controller[_0xce48('0xe')]);router[_0xce48('0xf')]('/',auth[_0xce48('0xb')](),controller['create']);router[_0xce48('0x10')](_0xce48('0xd'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xce48('0xd'),auth[_0xce48('0xb')](),controller['destroy']);module[_0xce48('0x11')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index ec1cf1e..80bbcf3 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 _0x0505=['string','BOOLEAN','sequelize','exports','ENUM','variable','customVariable','keyValue','picklist','STRING'];(function(_0x339a04,_0x15f35c){var _0x144941=function(_0x1c6d7c){while(--_0x1c6d7c){_0x339a04['push'](_0x339a04['shift']());}};_0x144941(++_0x15f35c);}(_0x0505,0xa2));var _0x5050=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x0505[_0x3b0731];return _0x4204d7;};'use strict';var Sequelize=require(_0x5050('0x0'));module[_0x5050('0x1')]={'type':{'type':Sequelize[_0x5050('0x2')]('string',_0x5050('0x3'),_0x5050('0x4'),_0x5050('0x5'),_0x5050('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x5050('0x7')]},'key':{'type':Sequelize[_0x5050('0x7')]},'keyType':{'type':Sequelize[_0x5050('0x2')](_0x5050('0x8'),_0x5050('0x3'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x5050('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x5050('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5050('0x7')]}}; \ No newline at end of file +var _0x793e=['exports','string','variable','customVariable','keyValue','picklist','ENUM','STRING','BOOLEAN','sequelize'];(function(_0x29c7bd,_0x541100){var _0x43ea22=function(_0x2d532e){while(--_0x2d532e){_0x29c7bd['push'](_0x29c7bd['shift']());}};_0x43ea22(++_0x541100);}(_0x793e,0xef));var _0xe793=function(_0x348184,_0x1526ba){_0x348184=_0x348184-0x0;var _0x2dfd4f=_0x793e[_0x348184];return _0x2dfd4f;};'use strict';var Sequelize=require(_0xe793('0x0'));module[_0xe793('0x1')]={'type':{'type':Sequelize['ENUM'](_0xe793('0x2'),_0xe793('0x3'),_0xe793('0x4'),_0xe793('0x5'),_0xe793('0x6')),'defaultValue':_0xe793('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xe793('0x7')](_0xe793('0x2'),'variable',_0xe793('0x4'))},'keyContent':{'type':Sequelize[_0xe793('0x8')]},'idField':{'type':Sequelize[_0xe793('0x8')]},'nameField':{'type':Sequelize[_0xe793('0x8')]},'customField':{'type':Sequelize[_0xe793('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe793('0x8')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 63d3b2f..3f87146 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 _0xb286=['json','undefined','count','offset','limit','set','Content-Range','apply','save','then','destroy','end','stack','name','send','index','map','ZohoField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','show','find','catch','create','update','body','params','eml-format','rimraf','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status'];(function(_0x2a1e2d,_0x195473){var _0x32b8cc=function(_0x57582d){while(--_0x57582d){_0x2a1e2d['push'](_0x2a1e2d['shift']());}};_0x32b8cc(++_0x195473);}(_0xb286,0x151));var _0x6b28=function(_0x2930a1,_0x305c69){_0x2930a1=_0x2930a1-0x0;var _0x5c7fa2=_0xb286[_0x2930a1];return _0x5c7fa2;};'use strict';var emlformat=require(_0x6b28('0x0'));var rimraf=require(_0x6b28('0x1'));var zipdir=require('zip-dir');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(_0x6b28('0x2'));var path=require(_0x6b28('0x3'));var sox=require(_0x6b28('0x4'));var csv=require(_0x6b28('0x5'));var ejs=require(_0x6b28('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6b28('0x7'));var squel=require(_0x6b28('0x8'));var crypto=require(_0x6b28('0x9'));var jsforce=require(_0x6b28('0xa'));var deskjs=require(_0x6b28('0xb'));var toCsv=require('to-csv');var querystring=require(_0x6b28('0xc'));var Papa=require(_0x6b28('0xd'));var Redis=require(_0x6b28('0xe'));var authService=require(_0x6b28('0xf'));var qs=require(_0x6b28('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6b28('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x6b28('0x12'));var config=require(_0x6b28('0x13'));var licenseUtil=require(_0x6b28('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x6dbb1e,_0x4d5f64){_0x4d5f64=_0x4d5f64||0xcc;return function(_0x18ab61){if(_0x18ab61){return _0x6dbb1e[_0x6b28('0x15')](_0x4d5f64);}return _0x6dbb1e[_0x6b28('0x16')](_0x4d5f64)['end']();};}function respondWithResult(_0x25fdae,_0x5b13d8){_0x5b13d8=_0x5b13d8||0xc8;return function(_0x108dfe){if(_0x108dfe){return _0x25fdae[_0x6b28('0x16')](_0x5b13d8)[_0x6b28('0x17')](_0x108dfe);}};}function respondWithFilteredResult(_0x4962ca,_0x4ddec1){return function(_0x139751){if(_0x139751){var _0x108a08=typeof _0x4ddec1['offset']===_0x6b28('0x18')&&typeof _0x4ddec1['limit']==='undefined';var _0x14a47b=_0x139751[_0x6b28('0x19')];var _0x499082=_0x108a08?0x0:_0x4ddec1[_0x6b28('0x1a')];var _0x4b8a08=_0x108a08?_0x139751[_0x6b28('0x19')]:_0x4ddec1[_0x6b28('0x1a')]+_0x4ddec1[_0x6b28('0x1b')];var _0x5f40b3;if(_0x4b8a08>=_0x14a47b){_0x4b8a08=_0x14a47b;_0x5f40b3=0xc8;}else{_0x5f40b3=0xce;}_0x4962ca['status'](_0x5f40b3);return _0x4962ca[_0x6b28('0x1c')](_0x6b28('0x1d'),_0x499082+'-'+_0x4b8a08+'/'+_0x14a47b)[_0x6b28('0x17')](_0x139751);}return null;};}function patchUpdates(_0x37e2f5){return function(_0x77b579){try{jsonpatch[_0x6b28('0x1e')](_0x77b579,_0x37e2f5,!![]);}catch(_0x2b825c){return BPromise['reject'](_0x2b825c);}return _0x77b579[_0x6b28('0x1f')]();};}function saveUpdates(_0x3ddd28,_0xa6d667){return function(_0x1bed78){if(_0x1bed78){return _0x1bed78['update'](_0x3ddd28)[_0x6b28('0x20')](function(_0x289221){return _0x289221;});}return null;};}function removeEntity(_0x2a8a5d,_0x319945){return function(_0x32707a){if(_0x32707a){return _0x32707a[_0x6b28('0x21')]()['then'](function(){_0x2a8a5d['status'](0xcc)[_0x6b28('0x22')]();});}};}function handleEntityNotFound(_0x17191f,_0xcb3730){return function(_0x2975a2){if(!_0x2975a2){_0x17191f[_0x6b28('0x15')](0x194);}return _0x2975a2;};}function handleError(_0x289d15,_0xda5a5){_0xda5a5=_0xda5a5||0x1f4;return function(_0x335d68){logger['error'](_0x335d68[_0x6b28('0x23')]);if(_0x335d68[_0x6b28('0x24')]){delete _0x335d68['name'];}_0x289d15[_0x6b28('0x16')](_0xda5a5)[_0x6b28('0x25')](_0x335d68);};}exports[_0x6b28('0x26')]=function(_0xe4808e,_0x53ed3a){var _0x2a18ee={},_0x57ee8c={},_0x6e1b6f={'count':0x0,'rows':[]};var _0x59245f=_[_0x6b28('0x27')](db[_0x6b28('0x28')][_0x6b28('0x29')],function(_0x58de00){return{'name':_0x58de00[_0x6b28('0x2a')],'type':_0x58de00[_0x6b28('0x2b')][_0x6b28('0x2c')]};});_0x57ee8c[_0x6b28('0x2d')]=_['map'](_0x59245f,_0x6b28('0x24'));_0x57ee8c[_0x6b28('0x2e')]=_[_0x6b28('0x2f')](_0xe4808e[_0x6b28('0x2e')]);_0x57ee8c[_0x6b28('0x30')]=_[_0x6b28('0x31')](_0x57ee8c[_0x6b28('0x2d')],_0x57ee8c[_0x6b28('0x2e')]);_0x2a18ee[_0x6b28('0x32')]=_[_0x6b28('0x31')](_0x57ee8c['model'],qs[_0x6b28('0x33')](_0xe4808e[_0x6b28('0x2e')][_0x6b28('0x33')]));_0x2a18ee[_0x6b28('0x32')]=_0x2a18ee[_0x6b28('0x32')][_0x6b28('0x34')]?_0x2a18ee[_0x6b28('0x32')]:_0x57ee8c[_0x6b28('0x2d')];if(!_0xe4808e[_0x6b28('0x2e')][_0x6b28('0x35')](_0x6b28('0x36'))){_0x2a18ee[_0x6b28('0x1b')]=qs[_0x6b28('0x1b')](_0xe4808e[_0x6b28('0x2e')][_0x6b28('0x1b')]);_0x2a18ee[_0x6b28('0x1a')]=qs['offset'](_0xe4808e[_0x6b28('0x2e')][_0x6b28('0x1a')]);}_0x2a18ee[_0x6b28('0x37')]=qs['sort'](_0xe4808e['query'][_0x6b28('0x38')]);_0x2a18ee[_0x6b28('0x39')]=qs[_0x6b28('0x30')](_[_0x6b28('0x3a')](_0xe4808e[_0x6b28('0x2e')],_0x57ee8c[_0x6b28('0x30')]),_0x59245f);if(_0xe4808e['query'][_0x6b28('0x3b')]){_0x2a18ee[_0x6b28('0x39')]=_['merge'](_0x2a18ee[_0x6b28('0x39')],{'$or':_[_0x6b28('0x27')](_0x59245f,function(_0x1ef70f){if(_0x1ef70f[_0x6b28('0x2b')]!=='VIRTUAL'){var _0x2c2d9a={};_0x2c2d9a[_0x1ef70f[_0x6b28('0x24')]]={'$like':'%'+_0xe4808e[_0x6b28('0x2e')]['filter']+'%'};return _0x2c2d9a;}})});}_0x2a18ee=_[_0x6b28('0x3c')]({},_0x2a18ee,_0xe4808e['options']);var _0x48b90a={'where':_0x2a18ee['where']};return db[_0x6b28('0x28')][_0x6b28('0x19')](_0x48b90a)[_0x6b28('0x20')](function(_0x48ba59){_0x6e1b6f[_0x6b28('0x19')]=_0x48ba59;if(_0xe4808e[_0x6b28('0x2e')][_0x6b28('0x3d')]){_0x2a18ee[_0x6b28('0x3e')]=[{'all':!![]}];}return db['ZohoField'][_0x6b28('0x3f')](_0x2a18ee);})[_0x6b28('0x20')](function(_0x38bac1){_0x6e1b6f[_0x6b28('0x40')]=_0x38bac1;return _0x6e1b6f;})[_0x6b28('0x20')](respondWithFilteredResult(_0x53ed3a,_0x2a18ee))['catch'](handleError(_0x53ed3a,null));};exports[_0x6b28('0x41')]=function(_0x4b2851,_0x2f4dd8){var _0x1b1ba9={'raw':!![],'where':{'id':_0x4b2851['params']['id']}},_0x59315b={};_0x59315b[_0x6b28('0x2d')]=_[_0x6b28('0x2f')](db[_0x6b28('0x28')][_0x6b28('0x29')]);_0x59315b[_0x6b28('0x2e')]=_[_0x6b28('0x2f')](_0x4b2851[_0x6b28('0x2e')]);_0x59315b['filters']=_[_0x6b28('0x31')](_0x59315b['model'],_0x59315b[_0x6b28('0x2e')]);_0x1b1ba9['attributes']=_[_0x6b28('0x31')](_0x59315b['model'],qs[_0x6b28('0x33')](_0x4b2851[_0x6b28('0x2e')][_0x6b28('0x33')]));_0x1b1ba9[_0x6b28('0x32')]=_0x1b1ba9[_0x6b28('0x32')]['length']?_0x1b1ba9[_0x6b28('0x32')]:_0x59315b['model'];if(_0x4b2851['query']['includeAll']){_0x1b1ba9[_0x6b28('0x3e')]=[{'all':!![]}];}_0x1b1ba9=_[_0x6b28('0x3c')]({},_0x1b1ba9,_0x4b2851['options']);return db[_0x6b28('0x28')][_0x6b28('0x42')](_0x1b1ba9)[_0x6b28('0x20')](handleEntityNotFound(_0x2f4dd8,null))['then'](respondWithResult(_0x2f4dd8,null))[_0x6b28('0x43')](handleError(_0x2f4dd8,null));};exports[_0x6b28('0x44')]=function(_0x22b33d,_0x5e1fb6){return db[_0x6b28('0x28')][_0x6b28('0x44')](_0x22b33d['body'],{})[_0x6b28('0x20')](respondWithResult(_0x5e1fb6,0xc9))[_0x6b28('0x43')](handleError(_0x5e1fb6,null));};exports[_0x6b28('0x45')]=function(_0x20c4c3,_0x1ca0a1){if(_0x20c4c3['body']['id']){delete _0x20c4c3[_0x6b28('0x46')]['id'];}return db[_0x6b28('0x28')]['find']({'where':{'id':_0x20c4c3[_0x6b28('0x47')]['id']}})['then'](handleEntityNotFound(_0x1ca0a1,null))[_0x6b28('0x20')](saveUpdates(_0x20c4c3[_0x6b28('0x46')],null))[_0x6b28('0x20')](respondWithResult(_0x1ca0a1,null))[_0x6b28('0x43')](handleError(_0x1ca0a1,null));};exports[_0x6b28('0x21')]=function(_0x36c45a,_0x20cfaf){return db[_0x6b28('0x28')]['find']({'where':{'id':_0x36c45a[_0x6b28('0x47')]['id']}})[_0x6b28('0x20')](handleEntityNotFound(_0x20cfaf,null))[_0x6b28('0x20')](removeEntity(_0x20cfaf,null))[_0x6b28('0x43')](handleError(_0x20cfaf,null));}; \ No newline at end of file +var _0x7560=['undefined','limit','count','reject','save','update','then','error','name','index','map','ZohoField','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','rawAttributes','catch','create','body','find','destroy','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','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','sendStatus','end','status','json','offset'];(function(_0x3bdc3e,_0x1007b5){var _0x5e9227=function(_0x47c693){while(--_0x47c693){_0x3bdc3e['push'](_0x3bdc3e['shift']());}};_0x5e9227(++_0x1007b5);}(_0x7560,0xfc));var _0x0756=function(_0x506cbf,_0xb7e1d8){_0x506cbf=_0x506cbf-0x0;var _0x5513f1=_0x7560[_0x506cbf];return _0x5513f1;};'use strict';var emlformat=require(_0x0756('0x0'));var rimraf=require(_0x0756('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0756('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0756('0x3'));var Mustache=require(_0x0756('0x4'));var util=require(_0x0756('0x5'));var path=require('path');var sox=require(_0x0756('0x6'));var csv=require(_0x0756('0x7'));var ejs=require(_0x0756('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x0756('0x9'));var crypto=require(_0x0756('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x0756('0xb'));var toCsv=require(_0x0756('0x7'));var querystring=require(_0x0756('0xc'));var Papa=require(_0x0756('0xd'));var Redis=require(_0x0756('0xe'));var authService=require(_0x0756('0xf'));var qs=require(_0x0756('0x10'));var as=require(_0x0756('0x11'));var hardwareService=require(_0x0756('0x12'));var logger=require(_0x0756('0x13'))('api');var utils=require(_0x0756('0x14'));var config=require(_0x0756('0x15'));var licenseUtil=require(_0x0756('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2ee81b,_0x4b5af7){_0x4b5af7=_0x4b5af7||0xcc;return function(_0x5d2035){if(_0x5d2035){return _0x2ee81b[_0x0756('0x17')](_0x4b5af7);}return _0x2ee81b['status'](_0x4b5af7)[_0x0756('0x18')]();};}function respondWithResult(_0x1b2bc1,_0x200d5e){_0x200d5e=_0x200d5e||0xc8;return function(_0xfd6c9e){if(_0xfd6c9e){return _0x1b2bc1[_0x0756('0x19')](_0x200d5e)[_0x0756('0x1a')](_0xfd6c9e);}};}function respondWithFilteredResult(_0x5ed91b,_0x539830){return function(_0x3341f7){if(_0x3341f7){var _0x9a2b98=typeof _0x539830[_0x0756('0x1b')]===_0x0756('0x1c')&&typeof _0x539830[_0x0756('0x1d')]==='undefined';var _0x30f7dd=_0x3341f7['count'];var _0x2f27a3=_0x9a2b98?0x0:_0x539830[_0x0756('0x1b')];var _0x4c962a=_0x9a2b98?_0x3341f7[_0x0756('0x1e')]:_0x539830[_0x0756('0x1b')]+_0x539830[_0x0756('0x1d')];var _0x578879;if(_0x4c962a>=_0x30f7dd){_0x4c962a=_0x30f7dd;_0x578879=0xc8;}else{_0x578879=0xce;}_0x5ed91b[_0x0756('0x19')](_0x578879);return _0x5ed91b['set']('Content-Range',_0x2f27a3+'-'+_0x4c962a+'/'+_0x30f7dd)[_0x0756('0x1a')](_0x3341f7);}return null;};}function patchUpdates(_0x52a029){return function(_0x571351){try{jsonpatch['apply'](_0x571351,_0x52a029,!![]);}catch(_0x599722){return BPromise[_0x0756('0x1f')](_0x599722);}return _0x571351[_0x0756('0x20')]();};}function saveUpdates(_0x33b3cc,_0x29fd7f){return function(_0x320617){if(_0x320617){return _0x320617[_0x0756('0x21')](_0x33b3cc)[_0x0756('0x22')](function(_0x4d1912){return _0x4d1912;});}return null;};}function removeEntity(_0xa3760b,_0x3cbbfa){return function(_0x48c6f6){if(_0x48c6f6){return _0x48c6f6['destroy']()[_0x0756('0x22')](function(){_0xa3760b['status'](0xcc)[_0x0756('0x18')]();});}};}function handleEntityNotFound(_0x3bb471,_0xf21705){return function(_0x48d0f0){if(!_0x48d0f0){_0x3bb471['sendStatus'](0x194);}return _0x48d0f0;};}function handleError(_0x1fd2c8,_0x4eed3f){_0x4eed3f=_0x4eed3f||0x1f4;return function(_0x4ad898){logger[_0x0756('0x23')](_0x4ad898['stack']);if(_0x4ad898[_0x0756('0x24')]){delete _0x4ad898[_0x0756('0x24')];}_0x1fd2c8['status'](_0x4eed3f)['send'](_0x4ad898);};}exports[_0x0756('0x25')]=function(_0x181d19,_0x51ce15){var _0x363b1c={},_0x28b6e1={},_0x12e14e={'count':0x0,'rows':[]};var _0x2c1b7b=_[_0x0756('0x26')](db[_0x0756('0x27')]['rawAttributes'],function(_0x3573e6){return{'name':_0x3573e6[_0x0756('0x28')],'type':_0x3573e6[_0x0756('0x29')][_0x0756('0x2a')]};});_0x28b6e1[_0x0756('0x2b')]=_[_0x0756('0x26')](_0x2c1b7b,_0x0756('0x24'));_0x28b6e1['query']=_[_0x0756('0x2c')](_0x181d19[_0x0756('0x2d')]);_0x28b6e1[_0x0756('0x2e')]=_[_0x0756('0x2f')](_0x28b6e1[_0x0756('0x2b')],_0x28b6e1[_0x0756('0x2d')]);_0x363b1c[_0x0756('0x30')]=_[_0x0756('0x2f')](_0x28b6e1['model'],qs[_0x0756('0x31')](_0x181d19[_0x0756('0x2d')][_0x0756('0x31')]));_0x363b1c[_0x0756('0x30')]=_0x363b1c['attributes'][_0x0756('0x32')]?_0x363b1c[_0x0756('0x30')]:_0x28b6e1[_0x0756('0x2b')];if(!_0x181d19[_0x0756('0x2d')]['hasOwnProperty'](_0x0756('0x33'))){_0x363b1c[_0x0756('0x1d')]=qs['limit'](_0x181d19[_0x0756('0x2d')]['limit']);_0x363b1c[_0x0756('0x1b')]=qs[_0x0756('0x1b')](_0x181d19[_0x0756('0x2d')][_0x0756('0x1b')]);}_0x363b1c[_0x0756('0x34')]=qs['sort'](_0x181d19['query'][_0x0756('0x35')]);_0x363b1c[_0x0756('0x36')]=qs[_0x0756('0x2e')](_['pick'](_0x181d19[_0x0756('0x2d')],_0x28b6e1[_0x0756('0x2e')]),_0x2c1b7b);if(_0x181d19['query'][_0x0756('0x37')]){_0x363b1c[_0x0756('0x36')]=_[_0x0756('0x38')](_0x363b1c[_0x0756('0x36')],{'$or':_[_0x0756('0x26')](_0x2c1b7b,function(_0x3628bb){if(_0x3628bb['type']!==_0x0756('0x39')){var _0x3cdd45={};_0x3cdd45[_0x3628bb[_0x0756('0x24')]]={'$like':'%'+_0x181d19[_0x0756('0x2d')][_0x0756('0x37')]+'%'};return _0x3cdd45;}})});}_0x363b1c=_['merge']({},_0x363b1c,_0x181d19['options']);var _0xb5b59e={'where':_0x363b1c[_0x0756('0x36')]};return db[_0x0756('0x27')][_0x0756('0x1e')](_0xb5b59e)[_0x0756('0x22')](function(_0x582da2){_0x12e14e[_0x0756('0x1e')]=_0x582da2;if(_0x181d19[_0x0756('0x2d')][_0x0756('0x3a')]){_0x363b1c[_0x0756('0x3b')]=[{'all':!![]}];}return db[_0x0756('0x27')][_0x0756('0x3c')](_0x363b1c);})['then'](function(_0x325766){_0x12e14e[_0x0756('0x3d')]=_0x325766;return _0x12e14e;})[_0x0756('0x22')](respondWithFilteredResult(_0x51ce15,_0x363b1c))['catch'](handleError(_0x51ce15,null));};exports[_0x0756('0x3e')]=function(_0x34f830,_0x4d5e3b){var _0x23c7d0={'raw':!![],'where':{'id':_0x34f830[_0x0756('0x3f')]['id']}},_0x3f568f={};_0x3f568f['model']=_[_0x0756('0x2c')](db['ZohoField'][_0x0756('0x40')]);_0x3f568f[_0x0756('0x2d')]=_[_0x0756('0x2c')](_0x34f830[_0x0756('0x2d')]);_0x3f568f[_0x0756('0x2e')]=_[_0x0756('0x2f')](_0x3f568f['model'],_0x3f568f['query']);_0x23c7d0[_0x0756('0x30')]=_['intersection'](_0x3f568f['model'],qs[_0x0756('0x31')](_0x34f830[_0x0756('0x2d')][_0x0756('0x31')]));_0x23c7d0[_0x0756('0x30')]=_0x23c7d0[_0x0756('0x30')]['length']?_0x23c7d0[_0x0756('0x30')]:_0x3f568f[_0x0756('0x2b')];if(_0x34f830[_0x0756('0x2d')][_0x0756('0x3a')]){_0x23c7d0[_0x0756('0x3b')]=[{'all':!![]}];}_0x23c7d0=_[_0x0756('0x38')]({},_0x23c7d0,_0x34f830['options']);return db[_0x0756('0x27')]['find'](_0x23c7d0)[_0x0756('0x22')](handleEntityNotFound(_0x4d5e3b,null))[_0x0756('0x22')](respondWithResult(_0x4d5e3b,null))[_0x0756('0x41')](handleError(_0x4d5e3b,null));};exports[_0x0756('0x42')]=function(_0x5344c1,_0x5d3d2e){return db[_0x0756('0x27')]['create'](_0x5344c1[_0x0756('0x43')],{})[_0x0756('0x22')](respondWithResult(_0x5d3d2e,0xc9))[_0x0756('0x41')](handleError(_0x5d3d2e,null));};exports['update']=function(_0x3399f9,_0xfe3464){if(_0x3399f9['body']['id']){delete _0x3399f9[_0x0756('0x43')]['id'];}return db['ZohoField'][_0x0756('0x44')]({'where':{'id':_0x3399f9[_0x0756('0x3f')]['id']}})[_0x0756('0x22')](handleEntityNotFound(_0xfe3464,null))[_0x0756('0x22')](saveUpdates(_0x3399f9['body'],null))[_0x0756('0x22')](respondWithResult(_0xfe3464,null))['catch'](handleError(_0xfe3464,null));};exports[_0x0756('0x45')]=function(_0x53ceda,_0x1d393a){return db[_0x0756('0x27')][_0x0756('0x44')]({'where':{'id':_0x53ceda['params']['id']}})[_0x0756('0x22')](handleEntityNotFound(_0x1d393a,null))['then'](removeEntity(_0x1d393a,null))['catch'](handleError(_0x1d393a,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index c17aa0e..e836dee 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 _0x2272=['define','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','exports'];(function(_0x259c94,_0x4723f6){var _0x5c251b=function(_0x557cfc){while(--_0x557cfc){_0x259c94['push'](_0x259c94['shift']());}};_0x5c251b(++_0x4723f6);}(_0x2272,0xd8));var _0x2227=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x2272[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x2227('0x0'));var util=require(_0x2227('0x1'));var logger=require(_0x2227('0x2'))(_0x2227('0x3'));var moment=require(_0x2227('0x4'));var BPromise=require('bluebird');var rp=require(_0x2227('0x5'));var fs=require('fs');var path=require(_0x2227('0x6'));var rimraf=require(_0x2227('0x7'));var config=require('../../config/environment');var attributes=require('./intZohoField.attributes');module[_0x2227('0x8')]=function(_0x3b8661,_0xb33647){return _0x3b8661[_0x2227('0x9')](_0x2227('0xa'),attributes,{'tableName':_0x2227('0xb'),'paranoid':![],'indexes':[{'name':_0x2227('0xc'),'fields':[_0x2227('0xd'),_0x2227('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa456=['./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','idField','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xa456,0x142));var _0x6a45=function(_0x1b6c6d,_0x2983b0){_0x1b6c6d=_0x1b6c6d-0x0;var _0x290d9d=_0xa456[_0x1b6c6d];return _0x290d9d;};'use strict';var _=require(_0x6a45('0x0'));var util=require(_0x6a45('0x1'));var logger=require(_0x6a45('0x2'))(_0x6a45('0x3'));var moment=require('moment');var BPromise=require(_0x6a45('0x4'));var rp=require(_0x6a45('0x5'));var fs=require('fs');var path=require(_0x6a45('0x6'));var rimraf=require('rimraf');var config=require(_0x6a45('0x7'));var attributes=require(_0x6a45('0x8'));module[_0x6a45('0x9')]=function(_0x14da6b,_0x4dfbfa){return _0x14da6b[_0x6a45('0xa')](_0x6a45('0xb'),attributes,{'tableName':_0x6a45('0xc'),'paranoid':![],'indexes':[{'name':_0x6a45('0xd'),'fields':[_0x6a45('0xe'),'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 5935e3b..6d58354 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 _0x5519=['../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x2952f8,_0x4e1a08){var _0x4871b0=function(_0x3103b4){while(--_0x3103b4){_0x2952f8['push'](_0x2952f8['shift']());}};_0x4871b0(++_0x4e1a08);}(_0x5519,0x1c9));var _0x9551=function(_0xba4220,_0x5217a7){_0xba4220=_0xba4220-0x0;var _0x4cdb9d=_0x5519[_0xba4220];return _0x4cdb9d;};'use strict';var _=require(_0x9551('0x0'));var util=require(_0x9551('0x1'));var moment=require('moment');var BPromise=require(_0x9551('0x2'));var rs=require(_0x9551('0x3'));var fs=require('fs');var Redis=require(_0x9551('0x4'));var db=require(_0x9551('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9551('0x6'));var config=require(_0x9551('0x7'));var jayson=require(_0x9551('0x8'));var client=jayson[_0x9551('0x9')][_0x9551('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1fd329,_0x2221f8,_0x240c26){return new BPromise(function(_0x282e70,_0x54496c){return client[_0x9551('0xb')](_0x1fd329,_0x240c26)['then'](function(_0x25cd4e){logger[_0x9551('0xc')](_0x9551('0xd'),_0x2221f8,_0x9551('0xe'));logger[_0x9551('0xf')](_0x9551('0x10'),_0x2221f8,_0x9551('0xe'),JSON[_0x9551('0x11')](_0x25cd4e));if(_0x25cd4e['error']){if(_0x25cd4e[_0x9551('0x12')]['code']===0x1f4){logger['error']('ZohoField,\x20%s,\x20%s',_0x2221f8,_0x25cd4e[_0x9551('0x12')][_0x9551('0x13')]);return _0x54496c(_0x25cd4e[_0x9551('0x12')][_0x9551('0x13')]);}logger[_0x9551('0x12')]('ZohoField,\x20%s,\x20%s',_0x2221f8,_0x25cd4e[_0x9551('0x12')][_0x9551('0x13')]);return _0x282e70(_0x25cd4e[_0x9551('0x12')][_0x9551('0x13')]);}else{logger[_0x9551('0xc')](_0x9551('0xd'),_0x2221f8,_0x9551('0xe'));_0x282e70(_0x25cd4e[_0x9551('0x14')]['message']);}})[_0x9551('0x15')](function(_0x524b2c){logger[_0x9551('0x12')]('ZohoField,\x20%s,\x20%s',_0x2221f8,_0x524b2c);_0x54496c(_0x524b2c);});});} \ No newline at end of file +var _0x599a=['../../config/environment','jayson/promise','client','request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x153864,_0x3d3cff){var _0x234a6e=function(_0x36f389){while(--_0x36f389){_0x153864['push'](_0x153864['shift']());}};_0x234a6e(++_0x3d3cff);}(_0x599a,0x87));var _0xa599=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x599a[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0xa599('0x0'));var util=require(_0xa599('0x1'));var moment=require(_0xa599('0x2'));var BPromise=require(_0xa599('0x3'));var rs=require(_0xa599('0x4'));var fs=require('fs');var Redis=require(_0xa599('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xa599('0x6'));var logger=require(_0xa599('0x7'))(_0xa599('0x8'));var config=require(_0xa599('0x9'));var jayson=require(_0xa599('0xa'));var client=jayson[_0xa599('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d45c5,_0x5376b6,_0x576e90){return new BPromise(function(_0x547578,_0x25c03a){return client[_0xa599('0xc')](_0x5d45c5,_0x576e90)[_0xa599('0xd')](function(_0x451402){logger[_0xa599('0xe')](_0xa599('0xf'),_0x5376b6,_0xa599('0x10'));logger[_0xa599('0x11')]('ZohoField,\x20%s,\x20%s,\x20%s',_0x5376b6,_0xa599('0x10'),JSON[_0xa599('0x12')](_0x451402));if(_0x451402[_0xa599('0x13')]){if(_0x451402[_0xa599('0x13')][_0xa599('0x14')]===0x1f4){logger['error']('ZohoField,\x20%s,\x20%s',_0x5376b6,_0x451402[_0xa599('0x13')][_0xa599('0x15')]);return _0x25c03a(_0x451402[_0xa599('0x13')][_0xa599('0x15')]);}logger['error'](_0xa599('0xf'),_0x5376b6,_0x451402[_0xa599('0x13')]['message']);return _0x547578(_0x451402[_0xa599('0x13')][_0xa599('0x15')]);}else{logger[_0xa599('0xe')]('ZohoField,\x20%s,\x20%s',_0x5376b6,_0xa599('0x10'));_0x547578(_0x451402[_0xa599('0x16')]['message']);}})[_0xa599('0x17')](function(_0x17418f){logger[_0xa599('0x13')](_0xa599('0xf'),_0x5376b6,_0x17418f);_0x25c03a(_0x17418f);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 36436a1..dd923b7 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x437b02,_0x34b630){var _0xf8c681=function(_0x28f83e){while(--_0x28f83e){_0x437b02['push'](_0x437b02['shift']());}};_0xf8c681(++_0x34b630);}(_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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x35b48a,_0x2771a6){var _0x52e568=function(_0x367814){while(--_0x367814){_0x35b48a['push'](_0x35b48a['shift']());}};_0x52e568(++_0x2771a6);}(_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 diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 1ea90b9..20c3ba0 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 _0xebed=['state','exports','STRING','unique_name_and_version','app.js','BOOLEAN'];(function(_0x2794d2,_0x263225){var _0x8c13e2=function(_0x2c1e18){while(--_0x2c1e18){_0x2794d2['push'](_0x2794d2['shift']());}};_0x8c13e2(++_0x263225);}(_0xebed,0x1a5));var _0xdebe=function(_0x3e69ae,_0x366e8d){_0x3e69ae=_0x3e69ae-0x0;var _0x3d7f42=_0xebed[_0x3e69ae];return _0x3d7f42;};'use strict';var Sequelize=require('sequelize');module[_0xdebe('0x0')]={'name':{'type':Sequelize[_0xdebe('0x1')],'allowNull':![],'unique':_0xdebe('0x2')},'version':{'type':Sequelize[_0xdebe('0x1')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0xdebe('0x1')],'defaultValue':_0xdebe('0x3')},'filename':{'type':Sequelize[_0xdebe('0x1')]},'path':{'type':Sequelize[_0xdebe('0x1')]},'type':{'type':Sequelize[_0xdebe('0x1')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0xdebe('0x4')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0xdebe('0x1')]},'state':{'type':Sequelize[_0xdebe('0x1')],'unique':_0xdebe('0x5')},'description':{'type':Sequelize[_0xdebe('0x1')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xdebe('0x1')]},'link':{'type':Sequelize[_0xdebe('0x1')],'defaultValue':'#'}}; \ No newline at end of file +var _0xe7b9=['INTEGER','state','sequelize','exports','STRING','unique_name_and_version'];(function(_0x32a8a8,_0x340cd5){var _0x25837c=function(_0x4c81ec){while(--_0x4c81ec){_0x32a8a8['push'](_0x32a8a8['shift']());}};_0x25837c(++_0x340cd5);}(_0xe7b9,0x170));var _0x9e7b=function(_0x53921b,_0x4ea8f0){_0x53921b=_0x53921b-0x0;var _0x1f7fd9=_0xe7b9[_0x53921b];return _0x1f7fd9;};'use strict';var Sequelize=require(_0x9e7b('0x0'));module[_0x9e7b('0x1')]={'name':{'type':Sequelize[_0x9e7b('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x9e7b('0x3')},'main':{'type':Sequelize[_0x9e7b('0x2')],'defaultValue':'app.js'},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0x9e7b('0x2')]},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize[_0x9e7b('0x4')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0x9e7b('0x2')]},'state':{'type':Sequelize[_0x9e7b('0x2')],'unique':_0x9e7b('0x5')},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize[_0x9e7b('0x2')]},'remoteUri':{'type':Sequelize[_0x9e7b('0x2')]},'link':{'type':Sequelize[_0x9e7b('0x2')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index e0ec837..122bc45 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 _0x71ab=['query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','include','Integration','findAll','rows','catch','show','params','rawAttributes','find','create','body','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','update','then','destroy','error','stack','name','send','index','map','type','key'];(function(_0x27a5bb,_0x3f4cfb){var _0x2e17ea=function(_0x22912d){while(--_0x22912d){_0x27a5bb['push'](_0x27a5bb['shift']());}};_0x2e17ea(++_0x3f4cfb);}(_0x71ab,0x64));var _0xb71a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x71ab[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb71a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb71a('0x1'));var rp=require('request-promise');var moment=require(_0xb71a('0x2'));var BPromise=require(_0xb71a('0x3'));var Mustache=require(_0xb71a('0x4'));var util=require(_0xb71a('0x5'));var path=require(_0xb71a('0x6'));var sox=require(_0xb71a('0x7'));var csv=require(_0xb71a('0x8'));var ejs=require(_0xb71a('0x9'));var fs=require('fs');var fs_extra=require(_0xb71a('0xa'));var _=require(_0xb71a('0xb'));var squel=require(_0xb71a('0xc'));var crypto=require(_0xb71a('0xd'));var jsforce=require(_0xb71a('0xe'));var deskjs=require(_0xb71a('0xf'));var toCsv=require(_0xb71a('0x8'));var querystring=require(_0xb71a('0x10'));var Papa=require(_0xb71a('0x11'));var Redis=require(_0xb71a('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb71a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb71a('0x14'));var logger=require(_0xb71a('0x15'))(_0xb71a('0x16'));var utils=require('../../config/utils');var config=require(_0xb71a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xb71a('0x18'))['db'];function respondWithStatusCode(_0x50030d,_0x50b43b){_0x50b43b=_0x50b43b||0xcc;return function(_0x3346a5){if(_0x3346a5){return _0x50030d[_0xb71a('0x19')](_0x50b43b);}return _0x50030d[_0xb71a('0x1a')](_0x50b43b)[_0xb71a('0x1b')]();};}function respondWithResult(_0x483d77,_0x47ee48){_0x47ee48=_0x47ee48||0xc8;return function(_0x5364e3){if(_0x5364e3){return _0x483d77[_0xb71a('0x1a')](_0x47ee48)[_0xb71a('0x1c')](_0x5364e3);}};}function respondWithFilteredResult(_0x15252a,_0x42fc55){return function(_0x3cd0f0){if(_0x3cd0f0){var _0x1e9363=typeof _0x42fc55[_0xb71a('0x1d')]===_0xb71a('0x1e')&&typeof _0x42fc55[_0xb71a('0x1f')]==='undefined';var _0x1ca65e=_0x3cd0f0[_0xb71a('0x20')];var _0x374c8c=_0x1e9363?0x0:_0x42fc55[_0xb71a('0x1d')];var _0x2bdb61=_0x1e9363?_0x3cd0f0[_0xb71a('0x20')]:_0x42fc55[_0xb71a('0x1d')]+_0x42fc55[_0xb71a('0x1f')];var _0x20bdfe;if(_0x2bdb61>=_0x1ca65e){_0x2bdb61=_0x1ca65e;_0x20bdfe=0xc8;}else{_0x20bdfe=0xce;}_0x15252a[_0xb71a('0x1a')](_0x20bdfe);return _0x15252a[_0xb71a('0x21')]('Content-Range',_0x374c8c+'-'+_0x2bdb61+'/'+_0x1ca65e)['json'](_0x3cd0f0);}return null;};}function patchUpdates(_0x1358f2){return function(_0x578fe4){try{jsonpatch['apply'](_0x578fe4,_0x1358f2,!![]);}catch(_0x4d8871){return BPromise[_0xb71a('0x22')](_0x4d8871);}return _0x578fe4['save']();};}function saveUpdates(_0x76d6dc,_0x4227c7){return function(_0x3ac77b){if(_0x3ac77b){return _0x3ac77b[_0xb71a('0x23')](_0x76d6dc)[_0xb71a('0x24')](function(_0x14b2a1){return _0x14b2a1;});}return null;};}function removeEntity(_0x2f4fac,_0x14aac7){return function(_0x5f3f19){if(_0x5f3f19){return _0x5f3f19[_0xb71a('0x25')]()[_0xb71a('0x24')](function(){_0x2f4fac[_0xb71a('0x1a')](0xcc)[_0xb71a('0x1b')]();});}};}function handleEntityNotFound(_0x3401f7,_0x1a010d){return function(_0x20ed75){if(!_0x20ed75){_0x3401f7[_0xb71a('0x19')](0x194);}return _0x20ed75;};}function handleError(_0x31085b,_0x2a847a){_0x2a847a=_0x2a847a||0x1f4;return function(_0x45b849){logger[_0xb71a('0x26')](_0x45b849[_0xb71a('0x27')]);if(_0x45b849['name']){delete _0x45b849[_0xb71a('0x28')];}_0x31085b[_0xb71a('0x1a')](_0x2a847a)[_0xb71a('0x29')](_0x45b849);};}exports[_0xb71a('0x2a')]=function(_0x2fbd73,_0x38178c){var _0x44826e={},_0x25364c={},_0x42c086={'count':0x0,'rows':[]};var _0x421fcf=_[_0xb71a('0x2b')](db['Integration']['rawAttributes'],function(_0x3112d3){return{'name':_0x3112d3['fieldName'],'type':_0x3112d3[_0xb71a('0x2c')][_0xb71a('0x2d')]};});_0x25364c['model']=_[_0xb71a('0x2b')](_0x421fcf,_0xb71a('0x28'));_0x25364c[_0xb71a('0x2e')]=_[_0xb71a('0x2f')](_0x2fbd73[_0xb71a('0x2e')]);_0x25364c[_0xb71a('0x30')]=_['intersection'](_0x25364c[_0xb71a('0x31')],_0x25364c[_0xb71a('0x2e')]);_0x44826e[_0xb71a('0x32')]=_[_0xb71a('0x33')](_0x25364c['model'],qs[_0xb71a('0x34')](_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x34')]));_0x44826e[_0xb71a('0x32')]=_0x44826e[_0xb71a('0x32')][_0xb71a('0x35')]?_0x44826e[_0xb71a('0x32')]:_0x25364c[_0xb71a('0x31')];if(!_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x36')]('nolimit')){_0x44826e['limit']=qs[_0xb71a('0x1f')](_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x1f')]);_0x44826e[_0xb71a('0x1d')]=qs[_0xb71a('0x1d')](_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x1d')]);}_0x44826e['order']=qs[_0xb71a('0x37')](_0x2fbd73['query'][_0xb71a('0x37')]);_0x44826e[_0xb71a('0x38')]=qs[_0xb71a('0x30')](_[_0xb71a('0x39')](_0x2fbd73['query'],_0x25364c[_0xb71a('0x30')]),_0x421fcf);if(_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x3a')]){_0x44826e[_0xb71a('0x38')]=_[_0xb71a('0x3b')](_0x44826e[_0xb71a('0x38')],{'$or':_[_0xb71a('0x2b')](_0x421fcf,function(_0x2756b9){if(_0x2756b9[_0xb71a('0x2c')]!=='VIRTUAL'){var _0x24a3af={};_0x24a3af[_0x2756b9['name']]={'$like':'%'+_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x3a')]+'%'};return _0x24a3af;}})});}_0x44826e=_[_0xb71a('0x3b')]({},_0x44826e,_0x2fbd73[_0xb71a('0x3c')]);var _0xce7b8a={'where':_0x44826e[_0xb71a('0x38')]};return db['Integration']['count'](_0xce7b8a)['then'](function(_0x35fea9){_0x42c086['count']=_0x35fea9;if(_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x3d')]){_0x44826e[_0xb71a('0x3e')]=[{'all':!![]}];}return db[_0xb71a('0x3f')][_0xb71a('0x40')](_0x44826e);})[_0xb71a('0x24')](function(_0x59530a){_0x42c086[_0xb71a('0x41')]=_0x59530a;return _0x42c086;})[_0xb71a('0x24')](respondWithFilteredResult(_0x38178c,_0x44826e))[_0xb71a('0x42')](handleError(_0x38178c,null));};exports[_0xb71a('0x43')]=function(_0x7d305,_0x2f08d2){var _0x55cbca={'raw':![],'where':{'id':_0x7d305[_0xb71a('0x44')]['id']}},_0x2afff3={};_0x2afff3[_0xb71a('0x31')]=_[_0xb71a('0x2f')](db[_0xb71a('0x3f')][_0xb71a('0x45')]);_0x2afff3[_0xb71a('0x2e')]=_['keys'](_0x7d305['query']);_0x2afff3[_0xb71a('0x30')]=_[_0xb71a('0x33')](_0x2afff3[_0xb71a('0x31')],_0x2afff3[_0xb71a('0x2e')]);_0x55cbca['attributes']=_[_0xb71a('0x33')](_0x2afff3['model'],qs[_0xb71a('0x34')](_0x7d305[_0xb71a('0x2e')]['fields']));_0x55cbca[_0xb71a('0x32')]=_0x55cbca[_0xb71a('0x32')][_0xb71a('0x35')]?_0x55cbca[_0xb71a('0x32')]:_0x2afff3['model'];if(_0x7d305[_0xb71a('0x2e')][_0xb71a('0x3d')]){_0x55cbca[_0xb71a('0x3e')]=[{'all':!![]}];}_0x55cbca=_['merge']({},_0x55cbca,_0x7d305[_0xb71a('0x3c')]);return db[_0xb71a('0x3f')][_0xb71a('0x46')](_0x55cbca)['then'](handleEntityNotFound(_0x2f08d2,null))[_0xb71a('0x24')](respondWithResult(_0x2f08d2,null))[_0xb71a('0x42')](handleError(_0x2f08d2,null));};exports[_0xb71a('0x47')]=function(_0x1f29b7,_0x365bed){return db['Integration'][_0xb71a('0x47')](_0x1f29b7[_0xb71a('0x48')],{})[_0xb71a('0x24')](respondWithResult(_0x365bed,0xc9))[_0xb71a('0x42')](handleError(_0x365bed,null));};exports['update']=function(_0x48fbde,_0x23b4c0){if(_0x48fbde[_0xb71a('0x48')]['id']){delete _0x48fbde[_0xb71a('0x48')]['id'];}return db[_0xb71a('0x3f')][_0xb71a('0x46')]({'where':{'id':_0x48fbde[_0xb71a('0x44')]['id']}})[_0xb71a('0x24')](handleEntityNotFound(_0x23b4c0,null))[_0xb71a('0x24')](saveUpdates(_0x48fbde[_0xb71a('0x48')],null))[_0xb71a('0x24')](respondWithResult(_0x23b4c0,null))['catch'](handleError(_0x23b4c0,null));};exports[_0xb71a('0x25')]=function(_0x2ce711,_0x500196){return db[_0xb71a('0x3f')]['find']({'where':{'id':_0x2ce711[_0xb71a('0x44')]['id']}})[_0xb71a('0x24')](handleEntityNotFound(_0x500196,null))[_0xb71a('0x24')](removeEntity(_0x500196,null))[_0xb71a('0x42')](handleError(_0x500196,null));}; \ No newline at end of file +var _0xc6ac=['type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','show','params','includeAll','include','find','catch','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','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','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','then','destroy','end','error','name','send','Integration','rawAttributes','fieldName'];(function(_0x2703cf,_0x526b31){var _0x28f18a=function(_0x10e33b){while(--_0x10e33b){_0x2703cf['push'](_0x2703cf['shift']());}};_0x28f18a(++_0x526b31);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x4856f9,_0x91ad2b){_0x4856f9=_0x4856f9-0x0;var _0x416eb9=_0xc6ac[_0x4856f9];return _0x416eb9;};'use strict';var emlformat=require(_0xcc6a('0x0'));var rimraf=require(_0xcc6a('0x1'));var zipdir=require(_0xcc6a('0x2'));var jsonpatch=require(_0xcc6a('0x3'));var rp=require(_0xcc6a('0x4'));var moment=require(_0xcc6a('0x5'));var BPromise=require(_0xcc6a('0x6'));var Mustache=require(_0xcc6a('0x7'));var util=require(_0xcc6a('0x8'));var path=require(_0xcc6a('0x9'));var sox=require(_0xcc6a('0xa'));var csv=require(_0xcc6a('0xb'));var ejs=require(_0xcc6a('0xc'));var fs=require('fs');var fs_extra=require(_0xcc6a('0xd'));var _=require('lodash');var squel=require(_0xcc6a('0xe'));var crypto=require(_0xcc6a('0xf'));var jsforce=require(_0xcc6a('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xcc6a('0xb'));var querystring=require(_0xcc6a('0x11'));var Papa=require(_0xcc6a('0x12'));var Redis=require(_0xcc6a('0x13'));var authService=require(_0xcc6a('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xcc6a('0x15'));var hardwareService=require(_0xcc6a('0x16'));var logger=require(_0xcc6a('0x17'))('api');var utils=require(_0xcc6a('0x18'));var config=require(_0xcc6a('0x19'));var licenseUtil=require(_0xcc6a('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x59ce6d,_0xf0f6d5){_0xf0f6d5=_0xf0f6d5||0xcc;return function(_0x211444){if(_0x211444){return _0x59ce6d[_0xcc6a('0x1b')](_0xf0f6d5);}return _0x59ce6d['status'](_0xf0f6d5)['end']();};}function respondWithResult(_0x369dc1,_0xcb9e2e){_0xcb9e2e=_0xcb9e2e||0xc8;return function(_0x43710d){if(_0x43710d){return _0x369dc1[_0xcc6a('0x1c')](_0xcb9e2e)[_0xcc6a('0x1d')](_0x43710d);}};}function respondWithFilteredResult(_0x337ec5,_0x4133fa){return function(_0x403b18){if(_0x403b18){var _0x56ffb0=typeof _0x4133fa['offset']==='undefined'&&typeof _0x4133fa[_0xcc6a('0x1e')]===_0xcc6a('0x1f');var _0x307f2a=_0x403b18[_0xcc6a('0x20')];var _0x33079c=_0x56ffb0?0x0:_0x4133fa[_0xcc6a('0x21')];var _0x2d9585=_0x56ffb0?_0x403b18[_0xcc6a('0x20')]:_0x4133fa[_0xcc6a('0x21')]+_0x4133fa[_0xcc6a('0x1e')];var _0x1d20a3;if(_0x2d9585>=_0x307f2a){_0x2d9585=_0x307f2a;_0x1d20a3=0xc8;}else{_0x1d20a3=0xce;}_0x337ec5['status'](_0x1d20a3);return _0x337ec5[_0xcc6a('0x22')](_0xcc6a('0x23'),_0x33079c+'-'+_0x2d9585+'/'+_0x307f2a)[_0xcc6a('0x1d')](_0x403b18);}return null;};}function patchUpdates(_0x368a6e){return function(_0x1495d8){try{jsonpatch[_0xcc6a('0x24')](_0x1495d8,_0x368a6e,!![]);}catch(_0x36c80f){return BPromise[_0xcc6a('0x25')](_0x36c80f);}return _0x1495d8[_0xcc6a('0x26')]();};}function saveUpdates(_0x19d32c,_0x329d17){return function(_0x845088){if(_0x845088){return _0x845088['update'](_0x19d32c)[_0xcc6a('0x27')](function(_0x3a081e){return _0x3a081e;});}return null;};}function removeEntity(_0x38f812,_0x581aae){return function(_0x10016a){if(_0x10016a){return _0x10016a[_0xcc6a('0x28')]()[_0xcc6a('0x27')](function(){_0x38f812[_0xcc6a('0x1c')](0xcc)[_0xcc6a('0x29')]();});}};}function handleEntityNotFound(_0x5fc697,_0x50abc1){return function(_0x26def8){if(!_0x26def8){_0x5fc697[_0xcc6a('0x1b')](0x194);}return _0x26def8;};}function handleError(_0x3514f3,_0x5f27e5){_0x5f27e5=_0x5f27e5||0x1f4;return function(_0x3afb3a){logger[_0xcc6a('0x2a')](_0x3afb3a['stack']);if(_0x3afb3a[_0xcc6a('0x2b')]){delete _0x3afb3a[_0xcc6a('0x2b')];}_0x3514f3[_0xcc6a('0x1c')](_0x5f27e5)[_0xcc6a('0x2c')](_0x3afb3a);};}exports['index']=function(_0x194aab,_0x3cf14c){var _0x2c6d88={},_0x4f176b={},_0x2590a2={'count':0x0,'rows':[]};var _0x5308d4=_['map'](db[_0xcc6a('0x2d')][_0xcc6a('0x2e')],function(_0x3aa315){return{'name':_0x3aa315[_0xcc6a('0x2f')],'type':_0x3aa315[_0xcc6a('0x30')][_0xcc6a('0x31')]};});_0x4f176b['model']=_[_0xcc6a('0x32')](_0x5308d4,_0xcc6a('0x2b'));_0x4f176b[_0xcc6a('0x33')]=_[_0xcc6a('0x34')](_0x194aab[_0xcc6a('0x33')]);_0x4f176b[_0xcc6a('0x35')]=_[_0xcc6a('0x36')](_0x4f176b[_0xcc6a('0x37')],_0x4f176b['query']);_0x2c6d88[_0xcc6a('0x38')]=_[_0xcc6a('0x36')](_0x4f176b[_0xcc6a('0x37')],qs[_0xcc6a('0x39')](_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x39')]));_0x2c6d88[_0xcc6a('0x38')]=_0x2c6d88['attributes'][_0xcc6a('0x3a')]?_0x2c6d88['attributes']:_0x4f176b['model'];if(!_0x194aab['query'][_0xcc6a('0x3b')](_0xcc6a('0x3c'))){_0x2c6d88[_0xcc6a('0x1e')]=qs[_0xcc6a('0x1e')](_0x194aab[_0xcc6a('0x33')]['limit']);_0x2c6d88['offset']=qs[_0xcc6a('0x21')](_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x21')]);}_0x2c6d88['order']=qs[_0xcc6a('0x3d')](_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x3d')]);_0x2c6d88[_0xcc6a('0x3e')]=qs[_0xcc6a('0x35')](_[_0xcc6a('0x3f')](_0x194aab[_0xcc6a('0x33')],_0x4f176b[_0xcc6a('0x35')]),_0x5308d4);if(_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x40')]){_0x2c6d88[_0xcc6a('0x3e')]=_[_0xcc6a('0x41')](_0x2c6d88[_0xcc6a('0x3e')],{'$or':_[_0xcc6a('0x32')](_0x5308d4,function(_0x262a1e){if(_0x262a1e[_0xcc6a('0x30')]!==_0xcc6a('0x42')){var _0x386cbc={};_0x386cbc[_0x262a1e['name']]={'$like':'%'+_0x194aab['query'][_0xcc6a('0x40')]+'%'};return _0x386cbc;}})});}_0x2c6d88=_[_0xcc6a('0x41')]({},_0x2c6d88,_0x194aab[_0xcc6a('0x43')]);var _0x1fd8e1={'where':_0x2c6d88[_0xcc6a('0x3e')]};return db[_0xcc6a('0x2d')][_0xcc6a('0x20')](_0x1fd8e1)[_0xcc6a('0x27')](function(_0x49b65c){_0x2590a2['count']=_0x49b65c;if(_0x194aab[_0xcc6a('0x33')]['includeAll']){_0x2c6d88['include']=[{'all':!![]}];}return db['Integration'][_0xcc6a('0x44')](_0x2c6d88);})[_0xcc6a('0x27')](function(_0xb42897){_0x2590a2[_0xcc6a('0x45')]=_0xb42897;return _0x2590a2;})[_0xcc6a('0x27')](respondWithFilteredResult(_0x3cf14c,_0x2c6d88))['catch'](handleError(_0x3cf14c,null));};exports[_0xcc6a('0x46')]=function(_0xfbb079,_0x17e5a0){var _0x2f966f={'raw':![],'where':{'id':_0xfbb079[_0xcc6a('0x47')]['id']}},_0x14ca90={};_0x14ca90['model']=_[_0xcc6a('0x34')](db[_0xcc6a('0x2d')][_0xcc6a('0x2e')]);_0x14ca90[_0xcc6a('0x33')]=_['keys'](_0xfbb079[_0xcc6a('0x33')]);_0x14ca90['filters']=_[_0xcc6a('0x36')](_0x14ca90[_0xcc6a('0x37')],_0x14ca90[_0xcc6a('0x33')]);_0x2f966f['attributes']=_[_0xcc6a('0x36')](_0x14ca90[_0xcc6a('0x37')],qs[_0xcc6a('0x39')](_0xfbb079['query']['fields']));_0x2f966f[_0xcc6a('0x38')]=_0x2f966f[_0xcc6a('0x38')][_0xcc6a('0x3a')]?_0x2f966f[_0xcc6a('0x38')]:_0x14ca90[_0xcc6a('0x37')];if(_0xfbb079['query'][_0xcc6a('0x48')]){_0x2f966f[_0xcc6a('0x49')]=[{'all':!![]}];}_0x2f966f=_['merge']({},_0x2f966f,_0xfbb079[_0xcc6a('0x43')]);return db[_0xcc6a('0x2d')][_0xcc6a('0x4a')](_0x2f966f)[_0xcc6a('0x27')](handleEntityNotFound(_0x17e5a0,null))[_0xcc6a('0x27')](respondWithResult(_0x17e5a0,null))[_0xcc6a('0x4b')](handleError(_0x17e5a0,null));};exports['create']=function(_0x4e1a0b,_0x47c999){return db[_0xcc6a('0x2d')][_0xcc6a('0x4c')](_0x4e1a0b[_0xcc6a('0x4d')],{})[_0xcc6a('0x27')](respondWithResult(_0x47c999,0xc9))['catch'](handleError(_0x47c999,null));};exports[_0xcc6a('0x4e')]=function(_0x5e7bab,_0x3aa7dd){if(_0x5e7bab[_0xcc6a('0x4d')]['id']){delete _0x5e7bab[_0xcc6a('0x4d')]['id'];}return db[_0xcc6a('0x2d')][_0xcc6a('0x4a')]({'where':{'id':_0x5e7bab[_0xcc6a('0x47')]['id']}})['then'](handleEntityNotFound(_0x3aa7dd,null))[_0xcc6a('0x27')](saveUpdates(_0x5e7bab[_0xcc6a('0x4d')],null))[_0xcc6a('0x27')](respondWithResult(_0x3aa7dd,null))[_0xcc6a('0x4b')](handleError(_0x3aa7dd,null));};exports[_0xcc6a('0x28')]=function(_0x362bf6,_0x431684){return db[_0xcc6a('0x2d')][_0xcc6a('0x4a')]({'where':{'id':_0x362bf6[_0xcc6a('0x47')]['id']}})['then'](handleEntityNotFound(_0x431684,null))[_0xcc6a('0x27')](removeEntity(_0x431684,null))[_0xcc6a('0x4b')](handleError(_0x431684,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 01e4e6c..5ffa2f8 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 _0x6933=['rimraf','exports','define','integrations','api','moment'];(function(_0x432a17,_0x27fb53){var _0x1dda81=function(_0x5be833){while(--_0x5be833){_0x432a17['push'](_0x432a17['shift']());}};_0x1dda81(++_0x27fb53);}(_0x6933,0x1d8));var _0x3693=function(_0x2a07c9,_0x185c10){_0x2a07c9=_0x2a07c9-0x0;var _0x4e5723=_0x6933[_0x2a07c9];return _0x4e5723;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x3693('0x0'));var moment=require(_0x3693('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3693('0x2'));var config=require('../../config/environment');var attributes=require('./integration.attributes');module[_0x3693('0x3')]=function(_0x11715b,_0x3ccfa1){return _0x11715b[_0x3693('0x4')]('Integration',attributes,{'tableName':_0x3693('0x5'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x24d4=['../../config/logger','bluebird','path','rimraf','../../config/environment','./integration.attributes','define','Integration','integrations'];(function(_0x51c511,_0x201c4f){var _0x4621c0=function(_0x51e29c){while(--_0x51e29c){_0x51c511['push'](_0x51c511['shift']());}};_0x4621c0(++_0x201c4f);}(_0x24d4,0x14d));var _0x424d=function(_0x3dc55d,_0xd07e93){_0x3dc55d=_0x3dc55d-0x0;var _0x3aa7f3=_0x24d4[_0x3dc55d];return _0x3aa7f3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x424d('0x0'))('api');var moment=require('moment');var BPromise=require(_0x424d('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x424d('0x2'));var rimraf=require(_0x424d('0x3'));var config=require(_0x424d('0x4'));var attributes=require(_0x424d('0x5'));module['exports']=function(_0x863db1,_0x20bc9f){return _0x863db1[_0x424d('0x6')](_0x424d('0x7'),attributes,{'tableName':_0x424d('0x8'),'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 6b59152..fa2af0a 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 _0x6d38=['request','then','Integration,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x52f366,_0x18b3e4){var _0x1a1d13=function(_0x254f07){while(--_0x254f07){_0x52f366['push'](_0x52f366['shift']());}};_0x1a1d13(++_0x18b3e4);}(_0x6d38,0x1ef));var _0x86d3=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x6d38[_0x122096];return _0x3d1966;};'use strict';var _=require('lodash');var util=require(_0x86d3('0x0'));var moment=require(_0x86d3('0x1'));var BPromise=require(_0x86d3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x86d3('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x86d3('0x4'))(_0x86d3('0x5'));var config=require(_0x86d3('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x86d3('0x7')][_0x86d3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x33d4aa,_0x2eaa15,_0x47e654){return new BPromise(function(_0x552b07,_0x2aea31){return client[_0x86d3('0x9')](_0x33d4aa,_0x47e654)[_0x86d3('0xa')](function(_0x499640){logger['info'](_0x86d3('0xb'),_0x2eaa15,_0x86d3('0xc'));logger['debug']('Integration,\x20%s,\x20%s,\x20%s',_0x2eaa15,_0x86d3('0xc'),JSON[_0x86d3('0xd')](_0x499640));if(_0x499640['error']){if(_0x499640[_0x86d3('0xe')]['code']===0x1f4){logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);return _0x2aea31(_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);}logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x499640['error'][_0x86d3('0xf')]);return _0x552b07(_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);}else{logger[_0x86d3('0x10')](_0x86d3('0xb'),_0x2eaa15,_0x86d3('0xc'));_0x552b07(_0x499640[_0x86d3('0x11')][_0x86d3('0xf')]);}})['catch'](function(_0x2d5ba9){logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x2d5ba9);_0x2aea31(_0x2d5ba9);});});} \ No newline at end of file +var _0x57ca=['client','http','request','info','request\x20sent','Integration,\x20%s,\x20%s,\x20%s','error','code','Integration,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x37cf6f,_0xb2cbb3){var _0x3e1064=function(_0x5d81ad){while(--_0x5d81ad){_0x37cf6f['push'](_0x37cf6f['shift']());}};_0x3e1064(++_0xb2cbb3);}(_0x57ca,0x108));var _0xa57c=function(_0x437d54,_0x211143){_0x437d54=_0x437d54-0x0;var _0x43014a=_0x57ca[_0x437d54];return _0x43014a;};'use strict';var _=require('lodash');var util=require(_0xa57c('0x0'));var moment=require(_0xa57c('0x1'));var BPromise=require('bluebird');var rs=require(_0xa57c('0x2'));var fs=require('fs');var Redis=require(_0xa57c('0x3'));var db=require(_0xa57c('0x4'))['db'];var utils=require(_0xa57c('0x5'));var logger=require(_0xa57c('0x6'))('rpc');var config=require(_0xa57c('0x7'));var jayson=require(_0xa57c('0x8'));var client=jayson[_0xa57c('0x9')][_0xa57c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xbdfffb,_0x314574,_0x19e28e){return new BPromise(function(_0x271ccc,_0x5e3962){return client[_0xa57c('0xb')](_0xbdfffb,_0x19e28e)['then'](function(_0x46ba92){logger[_0xa57c('0xc')]('Integration,\x20%s,\x20%s',_0x314574,_0xa57c('0xd'));logger['debug'](_0xa57c('0xe'),_0x314574,_0xa57c('0xd'),JSON['stringify'](_0x46ba92));if(_0x46ba92[_0xa57c('0xf')]){if(_0x46ba92['error'][_0xa57c('0x10')]===0x1f4){logger[_0xa57c('0xf')](_0xa57c('0x11'),_0x314574,_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);return _0x5e3962(_0x46ba92['error'][_0xa57c('0x12')]);}logger['error'](_0xa57c('0x11'),_0x314574,_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);return _0x271ccc(_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);}else{logger[_0xa57c('0xc')](_0xa57c('0x11'),_0x314574,'request\x20sent');_0x271ccc(_0x46ba92[_0xa57c('0x13')][_0xa57c('0x12')]);}})[_0xa57c('0x14')](function(_0x5a6024){logger[_0xa57c('0xf')]('Integration,\x20%s,\x20%s',_0x314574,_0x5a6024);_0x5e3962(_0x5a6024);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index e5f2aeb..633a779 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 _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(_0x342364,_0x889180){var _0x117105=function(_0x35f074){while(--_0x35f074){_0x342364['push'](_0x342364['shift']());}};_0x117105(++_0x889180);}(_0xef0f,0x168));var _0xfef0=function(_0x34c3ba,_0x4d1f3c){_0x34c3ba=_0x34c3ba-0x0;var _0x1c0a76=_0xef0f[_0x34c3ba];return _0x1c0a76;};'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 +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(_0x37a161,_0x2307ac){var _0x5473c3=function(_0x35039f){while(--_0x35039f){_0x37a161['push'](_0x37a161['shift']());}};_0x5473c3(++_0x2307ac);}(_0xef0f,0x168));var _0xfef0=function(_0x3b5c1e,_0x5f53a7){_0x3b5c1e=_0x3b5c1e-0x0;var _0x48aa8c=_0xef0f[_0x3b5c1e];return _0x48aa8c;};'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 7c2918a..19d579c 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 _0x24ab=['FAILED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','SENDING','RECEIVED'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x24ab,0x1c9));var _0xb24a=function(_0x247a8e,_0x3a97ee){_0x247a8e=_0x247a8e-0x0;var _0x3adeb2=_0x24ab[_0x247a8e];return _0x3adeb2;};'use strict';var Sequelize=require(_0xb24a('0x0'));module[_0xb24a('0x1')]={'integration':{'type':Sequelize[_0xb24a('0x2')]},'eventChannel':{'type':Sequelize[_0xb24a('0x2')]},'exitStatus':{'type':Sequelize[_0xb24a('0x2')]},'ticketId':{'type':Sequelize[_0xb24a('0x2')]},'integrationId':{'type':Sequelize[_0xb24a('0x3')]},'contacts':{'type':Sequelize[_0xb24a('0x2')]},'uniqueid':{'type':Sequelize[_0xb24a('0x2')]},'calleridnum':{'type':Sequelize[_0xb24a('0x2')]},'calleridname':{'type':Sequelize[_0xb24a('0x2')]},'queue':{'type':Sequelize[_0xb24a('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xb24a('0x2')]},'agentcalledAt':{'type':Sequelize[_0xb24a('0x4')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0xb24a('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xb24a('0x4')]},'talktime':{'type':Sequelize[_0xb24a('0x3')]},'agentacw':{'type':Sequelize[_0xb24a('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xb24a('0x4')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xb24a('0x4')]},'lastevent':{'type':Sequelize[_0xb24a('0x2')]},'channel':{'type':Sequelize[_0xb24a('0x2')]},'channelstate':{'type':Sequelize[_0xb24a('0x3')]},'channelstatedesc':{'type':Sequelize[_0xb24a('0x2')]},'connectedlinenum':{'type':Sequelize[_0xb24a('0x2')]},'connectedlinename':{'type':Sequelize[_0xb24a('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xb24a('0x2')]},'context':{'type':Sequelize[_0xb24a('0x2')]},'exten':{'type':Sequelize[_0xb24a('0x2')]},'priority':{'type':Sequelize[_0xb24a('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xb24a('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xb24a('0x2')]},'destcalleridnum':{'type':Sequelize[_0xb24a('0x2')]},'destcalleridname':{'type':Sequelize[_0xb24a('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xb24a('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0xb24a('0x2')]},'destcontext':{'type':Sequelize[_0xb24a('0x2')]},'destexten':{'type':Sequelize[_0xb24a('0x2')]},'destpriority':{'type':Sequelize[_0xb24a('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize[_0xb24a('0x2')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0xb24a('0x2')]},'from':{'type':Sequelize[_0xb24a('0x2')]},'to':{'type':Sequelize[_0xb24a('0x2')]},'cc':{'type':Sequelize[_0xb24a('0x2')]},'attachment':{'type':Sequelize[_0xb24a('0x6')]},'html':{'type':Sequelize[_0xb24a('0x6')]},'text':{'type':Sequelize[_0xb24a('0x6')]},'status':{'type':Sequelize[_0xb24a('0x7')](_0xb24a('0x8'),_0xb24a('0x9'),_0xb24a('0xa'),_0xb24a('0xb'))},'url':{'type':Sequelize[_0xb24a('0x2')]},'app':{'type':Sequelize[_0xb24a('0x2')]},'appdata':{'type':Sequelize[_0xb24a('0x2')]},'projectId':{'type':Sequelize[_0xb24a('0x3')]}}; \ No newline at end of file +var _0xc64d=['RECEIVED','sequelize','exports','STRING','INTEGER','BOOLEAN','DATE','TEXT','ENUM','SENT','SENDING'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xc64d,0x18d));var _0xdc64=function(_0x49699b,_0x21c516){_0x49699b=_0x49699b-0x0;var _0x3a80dc=_0xc64d[_0x49699b];return _0x3a80dc;};'use strict';var Sequelize=require(_0xdc64('0x0'));module[_0xdc64('0x1')]={'integration':{'type':Sequelize[_0xdc64('0x2')]},'eventChannel':{'type':Sequelize[_0xdc64('0x2')]},'exitStatus':{'type':Sequelize[_0xdc64('0x2')]},'ticketId':{'type':Sequelize[_0xdc64('0x2')]},'integrationId':{'type':Sequelize[_0xdc64('0x3')]},'contacts':{'type':Sequelize[_0xdc64('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xdc64('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xdc64('0x2')]},'interface':{'type':Sequelize[_0xdc64('0x2')]},'membername':{'type':Sequelize[_0xdc64('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0xdc64('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xdc64('0x5')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0xdc64('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xdc64('0x3')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0xdc64('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xdc64('0x5')]},'agentdump':{'type':Sequelize[_0xdc64('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0xdc64('0x2')]},'channel':{'type':Sequelize[_0xdc64('0x2')]},'channelstate':{'type':Sequelize[_0xdc64('0x3')]},'channelstatedesc':{'type':Sequelize[_0xdc64('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xdc64('0x2')]},'language':{'type':Sequelize[_0xdc64('0x2')]},'accountcode':{'type':Sequelize[_0xdc64('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xdc64('0x2')]},'priority':{'type':Sequelize[_0xdc64('0x2')]},'destchannel':{'type':Sequelize[_0xdc64('0x2')]},'destchannelstate':{'type':Sequelize[_0xdc64('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xdc64('0x2')]},'destcalleridname':{'type':Sequelize[_0xdc64('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xdc64('0x2')]},'destlanguage':{'type':Sequelize[_0xdc64('0x2')]},'destaccountcode':{'type':Sequelize[_0xdc64('0x2')]},'destcontext':{'type':Sequelize[_0xdc64('0x2')]},'destexten':{'type':Sequelize[_0xdc64('0x2')]},'destpriority':{'type':Sequelize[_0xdc64('0x2')]},'destuniqueid':{'type':Sequelize[_0xdc64('0x2')]},'messageId':{'type':Sequelize[_0xdc64('0x2')]},'inReplyTo':{'type':Sequelize[_0xdc64('0x2')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0xdc64('0x2')]},'to':{'type':Sequelize[_0xdc64('0x2')]},'cc':{'type':Sequelize[_0xdc64('0x2')]},'attachment':{'type':Sequelize[_0xdc64('0x6')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0xdc64('0x6')]},'status':{'type':Sequelize[_0xdc64('0x7')](_0xdc64('0x8'),_0xdc64('0x9'),_0xdc64('0xa'),'FAILED')},'url':{'type':Sequelize[_0xdc64('0x2')]},'app':{'type':Sequelize[_0xdc64('0x2')]},'appdata':{'type':Sequelize[_0xdc64('0x2')]},'projectId':{'type':Sequelize[_0xdc64('0x3')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 843bfda..7b77295 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 _0x0b70=['type','VIRTUAL','options','includeAll','include','findAll','show','params','length','catch','create','body','find','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','end','status','json','undefined','limit','offset','count','apply','save','update','then','sendStatus','stack','name','IntegrationReport','rawAttributes','fieldName','key','model','map','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge'];(function(_0x53437b,_0x33a52a){var _0x60e84b=function(_0x10275b){while(--_0x10275b){_0x53437b['push'](_0x53437b['shift']());}};_0x60e84b(++_0x33a52a);}(_0x0b70,0x12a));var _0x00b7=function(_0x267345,_0x365252){_0x267345=_0x267345-0x0;var _0x350b03=_0x0b70[_0x267345];return _0x350b03;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x00b7('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x00b7('0x1'));var rp=require(_0x00b7('0x2'));var moment=require(_0x00b7('0x3'));var BPromise=require(_0x00b7('0x4'));var Mustache=require(_0x00b7('0x5'));var util=require(_0x00b7('0x6'));var path=require(_0x00b7('0x7'));var sox=require(_0x00b7('0x8'));var csv=require(_0x00b7('0x9'));var ejs=require(_0x00b7('0xa'));var fs=require('fs');var fs_extra=require(_0x00b7('0xb'));var _=require(_0x00b7('0xc'));var squel=require('squel');var crypto=require(_0x00b7('0xd'));var jsforce=require(_0x00b7('0xe'));var deskjs=require(_0x00b7('0xf'));var toCsv=require(_0x00b7('0x9'));var querystring=require(_0x00b7('0x10'));var Papa=require('papaparse');var Redis=require(_0x00b7('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x00b7('0x12'));var as=require(_0x00b7('0x13'));var hardwareService=require(_0x00b7('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x00b7('0x15'));var config=require(_0x00b7('0x16'));var licenseUtil=require(_0x00b7('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c6ab0,_0x3ed2c2){_0x3ed2c2=_0x3ed2c2||0xcc;return function(_0x226b2e){if(_0x226b2e){return _0x3c6ab0['sendStatus'](_0x3ed2c2);}return _0x3c6ab0['status'](_0x3ed2c2)[_0x00b7('0x18')]();};}function respondWithResult(_0x393d58,_0xff110a){_0xff110a=_0xff110a||0xc8;return function(_0x514ff0){if(_0x514ff0){return _0x393d58[_0x00b7('0x19')](_0xff110a)[_0x00b7('0x1a')](_0x514ff0);}};}function respondWithFilteredResult(_0x46254b,_0x49f975){return function(_0x17b5b1){if(_0x17b5b1){var _0x561d87=typeof _0x49f975['offset']===_0x00b7('0x1b')&&typeof _0x49f975[_0x00b7('0x1c')]===_0x00b7('0x1b');var _0x50705b=_0x17b5b1['count'];var _0x15676e=_0x561d87?0x0:_0x49f975[_0x00b7('0x1d')];var _0x46aefe=_0x561d87?_0x17b5b1[_0x00b7('0x1e')]:_0x49f975[_0x00b7('0x1d')]+_0x49f975[_0x00b7('0x1c')];var _0x49a9c7;if(_0x46aefe>=_0x50705b){_0x46aefe=_0x50705b;_0x49a9c7=0xc8;}else{_0x49a9c7=0xce;}_0x46254b['status'](_0x49a9c7);return _0x46254b['set']('Content-Range',_0x15676e+'-'+_0x46aefe+'/'+_0x50705b)[_0x00b7('0x1a')](_0x17b5b1);}return null;};}function patchUpdates(_0x5a62aa){return function(_0x335e95){try{jsonpatch[_0x00b7('0x1f')](_0x335e95,_0x5a62aa,!![]);}catch(_0x38d271){return BPromise['reject'](_0x38d271);}return _0x335e95[_0x00b7('0x20')]();};}function saveUpdates(_0x4416e1,_0x59f349){return function(_0x2c02ae){if(_0x2c02ae){return _0x2c02ae[_0x00b7('0x21')](_0x4416e1)[_0x00b7('0x22')](function(_0x13ea51){return _0x13ea51;});}return null;};}function removeEntity(_0x587141,_0x128789){return function(_0x3eb91b){if(_0x3eb91b){return _0x3eb91b['destroy']()[_0x00b7('0x22')](function(){_0x587141['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4fe30a,_0x3f9dd9){return function(_0x555946){if(!_0x555946){_0x4fe30a[_0x00b7('0x23')](0x194);}return _0x555946;};}function handleError(_0x2ee05d,_0x4040e3){_0x4040e3=_0x4040e3||0x1f4;return function(_0x20d52e){logger['error'](_0x20d52e[_0x00b7('0x24')]);if(_0x20d52e[_0x00b7('0x25')]){delete _0x20d52e[_0x00b7('0x25')];}_0x2ee05d[_0x00b7('0x19')](_0x4040e3)['send'](_0x20d52e);};}exports['index']=function(_0x20ffc7,_0x421ede){var _0x53f788={},_0x5b825b={},_0x40dfbb={'count':0x0,'rows':[]};var _0x13fcd4=_['map'](db[_0x00b7('0x26')][_0x00b7('0x27')],function(_0xd446c1){return{'name':_0xd446c1[_0x00b7('0x28')],'type':_0xd446c1['type'][_0x00b7('0x29')]};});_0x5b825b[_0x00b7('0x2a')]=_[_0x00b7('0x2b')](_0x13fcd4,_0x00b7('0x25'));_0x5b825b[_0x00b7('0x2c')]=_[_0x00b7('0x2d')](_0x20ffc7[_0x00b7('0x2c')]);_0x5b825b['filters']=_['intersection'](_0x5b825b[_0x00b7('0x2a')],_0x5b825b[_0x00b7('0x2c')]);_0x53f788[_0x00b7('0x2e')]=_[_0x00b7('0x2f')](_0x5b825b[_0x00b7('0x2a')],qs[_0x00b7('0x30')](_0x20ffc7['query'][_0x00b7('0x30')]));_0x53f788[_0x00b7('0x2e')]=_0x53f788[_0x00b7('0x2e')]['length']?_0x53f788[_0x00b7('0x2e')]:_0x5b825b[_0x00b7('0x2a')];if(!_0x20ffc7[_0x00b7('0x2c')][_0x00b7('0x31')](_0x00b7('0x32'))){_0x53f788[_0x00b7('0x1c')]=qs[_0x00b7('0x1c')](_0x20ffc7[_0x00b7('0x2c')][_0x00b7('0x1c')]);_0x53f788[_0x00b7('0x1d')]=qs[_0x00b7('0x1d')](_0x20ffc7['query'][_0x00b7('0x1d')]);}_0x53f788[_0x00b7('0x33')]=qs[_0x00b7('0x34')](_0x20ffc7[_0x00b7('0x2c')]['sort']);_0x53f788[_0x00b7('0x35')]=qs['filters'](_['pick'](_0x20ffc7[_0x00b7('0x2c')],_0x5b825b[_0x00b7('0x36')]),_0x13fcd4);if(_0x20ffc7[_0x00b7('0x2c')][_0x00b7('0x37')]){_0x53f788[_0x00b7('0x35')]=_[_0x00b7('0x38')](_0x53f788[_0x00b7('0x35')],{'$or':_[_0x00b7('0x2b')](_0x13fcd4,function(_0x5e59e8){if(_0x5e59e8[_0x00b7('0x39')]!==_0x00b7('0x3a')){var _0x1f8b2a={};_0x1f8b2a[_0x5e59e8[_0x00b7('0x25')]]={'$like':'%'+_0x20ffc7[_0x00b7('0x2c')]['filter']+'%'};return _0x1f8b2a;}})});}_0x53f788=_['merge']({},_0x53f788,_0x20ffc7[_0x00b7('0x3b')]);var _0x4e1238={'where':_0x53f788[_0x00b7('0x35')]};return db[_0x00b7('0x26')][_0x00b7('0x1e')](_0x4e1238)[_0x00b7('0x22')](function(_0x6d710d){_0x40dfbb[_0x00b7('0x1e')]=_0x6d710d;if(_0x20ffc7[_0x00b7('0x2c')][_0x00b7('0x3c')]){_0x53f788[_0x00b7('0x3d')]=[{'all':!![]}];}return db['IntegrationReport'][_0x00b7('0x3e')](_0x53f788);})[_0x00b7('0x22')](function(_0xe6ae2a){_0x40dfbb['rows']=_0xe6ae2a;return _0x40dfbb;})[_0x00b7('0x22')](respondWithFilteredResult(_0x421ede,_0x53f788))['catch'](handleError(_0x421ede,null));};exports[_0x00b7('0x3f')]=function(_0x55f847,_0x4f1884){var _0x504bb9={'raw':![],'where':{'id':_0x55f847[_0x00b7('0x40')]['id']}},_0x1e26b4={};_0x1e26b4[_0x00b7('0x2a')]=_['keys'](db['IntegrationReport']['rawAttributes']);_0x1e26b4[_0x00b7('0x2c')]=_[_0x00b7('0x2d')](_0x55f847[_0x00b7('0x2c')]);_0x1e26b4[_0x00b7('0x36')]=_['intersection'](_0x1e26b4[_0x00b7('0x2a')],_0x1e26b4[_0x00b7('0x2c')]);_0x504bb9[_0x00b7('0x2e')]=_[_0x00b7('0x2f')](_0x1e26b4['model'],qs['fields'](_0x55f847[_0x00b7('0x2c')][_0x00b7('0x30')]));_0x504bb9[_0x00b7('0x2e')]=_0x504bb9['attributes'][_0x00b7('0x41')]?_0x504bb9[_0x00b7('0x2e')]:_0x1e26b4[_0x00b7('0x2a')];if(_0x55f847[_0x00b7('0x2c')][_0x00b7('0x3c')]){_0x504bb9['include']=[{'all':!![]}];}_0x504bb9=_[_0x00b7('0x38')]({},_0x504bb9,_0x55f847['options']);return db[_0x00b7('0x26')]['find'](_0x504bb9)[_0x00b7('0x22')](handleEntityNotFound(_0x4f1884,null))[_0x00b7('0x22')](respondWithResult(_0x4f1884,null))[_0x00b7('0x42')](handleError(_0x4f1884,null));};exports['create']=function(_0x1836ba,_0x3d9ea9){return db['IntegrationReport'][_0x00b7('0x43')](_0x1836ba[_0x00b7('0x44')],{})[_0x00b7('0x22')](respondWithResult(_0x3d9ea9,0xc9))[_0x00b7('0x42')](handleError(_0x3d9ea9,null));};exports['update']=function(_0x4f3434,_0x186576){if(_0x4f3434[_0x00b7('0x44')]['id']){delete _0x4f3434['body']['id'];}return db['IntegrationReport'][_0x00b7('0x45')]({'where':{'id':_0x4f3434['params']['id']}})['then'](handleEntityNotFound(_0x186576,null))[_0x00b7('0x22')](saveUpdates(_0x4f3434[_0x00b7('0x44')],null))[_0x00b7('0x22')](respondWithResult(_0x186576,null))[_0x00b7('0x42')](handleError(_0x186576,null));};exports['destroy']=function(_0xf8060d,_0x1e955f){return db['IntegrationReport'][_0x00b7('0x45')]({'where':{'id':_0xf8060d[_0x00b7('0x40')]['id']}})[_0x00b7('0x22')](handleEntityNotFound(_0x1e955f,null))['then'](removeEntity(_0x1e955f,null))[_0x00b7('0x42')](handleError(_0x1e955f,null));};exports[_0x00b7('0x46')]=function(_0x5530f1,_0x134064){return db[_0x00b7('0x26')]['describe']()[_0x00b7('0x22')](respondWithResult(_0x134064,null))[_0x00b7('0x42')](handleError(_0x134064,null));}; \ No newline at end of file +var _0xc7b4=['params','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','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/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','IntegrationReport','rawAttributes','fieldName','type','key','keys','query','intersection','attributes','model','fields','length','hasOwnProperty','order','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show'];(function(_0x1b5cc2,_0x4321c2){var _0x375f3b=function(_0x265ddb){while(--_0x265ddb){_0x1b5cc2['push'](_0x1b5cc2['shift']());}};_0x375f3b(++_0x4321c2);}(_0xc7b4,0x1cd));var _0x4c7b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc7b4[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x4c7b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4c7b('0x1'));var jsonpatch=require(_0x4c7b('0x2'));var rp=require(_0x4c7b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4c7b('0x4'));var util=require('util');var path=require(_0x4c7b('0x5'));var sox=require(_0x4c7b('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4c7b('0x7'));var _=require('lodash');var squel=require(_0x4c7b('0x8'));var crypto=require(_0x4c7b('0x9'));var jsforce=require(_0x4c7b('0xa'));var deskjs=require(_0x4c7b('0xb'));var toCsv=require(_0x4c7b('0xc'));var querystring=require(_0x4c7b('0xd'));var Papa=require(_0x4c7b('0xe'));var Redis=require(_0x4c7b('0xf'));var authService=require(_0x4c7b('0x10'));var qs=require(_0x4c7b('0x11'));var as=require(_0x4c7b('0x12'));var hardwareService=require(_0x4c7b('0x13'));var logger=require(_0x4c7b('0x14'))(_0x4c7b('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4c7b('0x16'));var db=require(_0x4c7b('0x17'))['db'];function respondWithStatusCode(_0x469d31,_0x8facce){_0x8facce=_0x8facce||0xcc;return function(_0xf176f){if(_0xf176f){return _0x469d31['sendStatus'](_0x8facce);}return _0x469d31[_0x4c7b('0x18')](_0x8facce)[_0x4c7b('0x19')]();};}function respondWithResult(_0x42212d,_0x4d575c){_0x4d575c=_0x4d575c||0xc8;return function(_0x2eecd0){if(_0x2eecd0){return _0x42212d[_0x4c7b('0x18')](_0x4d575c)['json'](_0x2eecd0);}};}function respondWithFilteredResult(_0x3820a0,_0x223aa8){return function(_0x27672a){if(_0x27672a){var _0x1c8171=typeof _0x223aa8[_0x4c7b('0x1a')]===_0x4c7b('0x1b')&&typeof _0x223aa8[_0x4c7b('0x1c')]===_0x4c7b('0x1b');var _0x3b0351=_0x27672a['count'];var _0x31eb05=_0x1c8171?0x0:_0x223aa8[_0x4c7b('0x1a')];var _0x116a14=_0x1c8171?_0x27672a[_0x4c7b('0x1d')]:_0x223aa8[_0x4c7b('0x1a')]+_0x223aa8[_0x4c7b('0x1c')];var _0x4eb5b3;if(_0x116a14>=_0x3b0351){_0x116a14=_0x3b0351;_0x4eb5b3=0xc8;}else{_0x4eb5b3=0xce;}_0x3820a0[_0x4c7b('0x18')](_0x4eb5b3);return _0x3820a0[_0x4c7b('0x1e')](_0x4c7b('0x1f'),_0x31eb05+'-'+_0x116a14+'/'+_0x3b0351)['json'](_0x27672a);}return null;};}function patchUpdates(_0x5e5085){return function(_0xadb0c8){try{jsonpatch[_0x4c7b('0x20')](_0xadb0c8,_0x5e5085,!![]);}catch(_0x405d9d){return BPromise['reject'](_0x405d9d);}return _0xadb0c8[_0x4c7b('0x21')]();};}function saveUpdates(_0x492476,_0x23dae1){return function(_0x50c1ef){if(_0x50c1ef){return _0x50c1ef[_0x4c7b('0x22')](_0x492476)[_0x4c7b('0x23')](function(_0x2d3ee4){return _0x2d3ee4;});}return null;};}function removeEntity(_0x25dc07,_0x1918cb){return function(_0x2e03da){if(_0x2e03da){return _0x2e03da[_0x4c7b('0x24')]()[_0x4c7b('0x23')](function(){_0x25dc07[_0x4c7b('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5aac6f,_0x1e2a19){return function(_0x520bcc){if(!_0x520bcc){_0x5aac6f[_0x4c7b('0x25')](0x194);}return _0x520bcc;};}function handleError(_0x29574b,_0x495e99){_0x495e99=_0x495e99||0x1f4;return function(_0x4f7a76){logger[_0x4c7b('0x26')](_0x4f7a76[_0x4c7b('0x27')]);if(_0x4f7a76[_0x4c7b('0x28')]){delete _0x4f7a76[_0x4c7b('0x28')];}_0x29574b['status'](_0x495e99)[_0x4c7b('0x29')](_0x4f7a76);};}exports[_0x4c7b('0x2a')]=function(_0x5932e9,_0x26dc65){var _0x245bf4={},_0x4296ac={},_0x4d0cf2={'count':0x0,'rows':[]};var _0x57ae92=_[_0x4c7b('0x2b')](db[_0x4c7b('0x2c')][_0x4c7b('0x2d')],function(_0x3d5c36){return{'name':_0x3d5c36[_0x4c7b('0x2e')],'type':_0x3d5c36[_0x4c7b('0x2f')][_0x4c7b('0x30')]};});_0x4296ac['model']=_['map'](_0x57ae92,_0x4c7b('0x28'));_0x4296ac['query']=_[_0x4c7b('0x31')](_0x5932e9[_0x4c7b('0x32')]);_0x4296ac['filters']=_[_0x4c7b('0x33')](_0x4296ac['model'],_0x4296ac[_0x4c7b('0x32')]);_0x245bf4[_0x4c7b('0x34')]=_[_0x4c7b('0x33')](_0x4296ac[_0x4c7b('0x35')],qs[_0x4c7b('0x36')](_0x5932e9[_0x4c7b('0x32')][_0x4c7b('0x36')]));_0x245bf4[_0x4c7b('0x34')]=_0x245bf4['attributes'][_0x4c7b('0x37')]?_0x245bf4[_0x4c7b('0x34')]:_0x4296ac[_0x4c7b('0x35')];if(!_0x5932e9[_0x4c7b('0x32')][_0x4c7b('0x38')]('nolimit')){_0x245bf4[_0x4c7b('0x1c')]=qs[_0x4c7b('0x1c')](_0x5932e9[_0x4c7b('0x32')][_0x4c7b('0x1c')]);_0x245bf4[_0x4c7b('0x1a')]=qs[_0x4c7b('0x1a')](_0x5932e9[_0x4c7b('0x32')][_0x4c7b('0x1a')]);}_0x245bf4[_0x4c7b('0x39')]=qs['sort'](_0x5932e9[_0x4c7b('0x32')]['sort']);_0x245bf4[_0x4c7b('0x3a')]=qs[_0x4c7b('0x3b')](_[_0x4c7b('0x3c')](_0x5932e9[_0x4c7b('0x32')],_0x4296ac[_0x4c7b('0x3b')]),_0x57ae92);if(_0x5932e9[_0x4c7b('0x32')][_0x4c7b('0x3d')]){_0x245bf4[_0x4c7b('0x3a')]=_['merge'](_0x245bf4[_0x4c7b('0x3a')],{'$or':_[_0x4c7b('0x2b')](_0x57ae92,function(_0x10cbe1){if(_0x10cbe1['type']!==_0x4c7b('0x3e')){var _0x4ffff2={};_0x4ffff2[_0x10cbe1[_0x4c7b('0x28')]]={'$like':'%'+_0x5932e9[_0x4c7b('0x32')]['filter']+'%'};return _0x4ffff2;}})});}_0x245bf4=_[_0x4c7b('0x3f')]({},_0x245bf4,_0x5932e9[_0x4c7b('0x40')]);var _0x46ca2c={'where':_0x245bf4['where']};return db['IntegrationReport'][_0x4c7b('0x1d')](_0x46ca2c)[_0x4c7b('0x23')](function(_0x36af13){_0x4d0cf2[_0x4c7b('0x1d')]=_0x36af13;if(_0x5932e9[_0x4c7b('0x32')][_0x4c7b('0x41')]){_0x245bf4[_0x4c7b('0x42')]=[{'all':!![]}];}return db[_0x4c7b('0x2c')][_0x4c7b('0x43')](_0x245bf4);})[_0x4c7b('0x23')](function(_0x30b733){_0x4d0cf2[_0x4c7b('0x44')]=_0x30b733;return _0x4d0cf2;})[_0x4c7b('0x23')](respondWithFilteredResult(_0x26dc65,_0x245bf4))[_0x4c7b('0x45')](handleError(_0x26dc65,null));};exports[_0x4c7b('0x46')]=function(_0x325702,_0x510bc1){var _0x310257={'raw':![],'where':{'id':_0x325702[_0x4c7b('0x47')]['id']}},_0x1aa38e={};_0x1aa38e['model']=_[_0x4c7b('0x31')](db[_0x4c7b('0x2c')][_0x4c7b('0x2d')]);_0x1aa38e['query']=_[_0x4c7b('0x31')](_0x325702[_0x4c7b('0x32')]);_0x1aa38e['filters']=_['intersection'](_0x1aa38e[_0x4c7b('0x35')],_0x1aa38e[_0x4c7b('0x32')]);_0x310257['attributes']=_['intersection'](_0x1aa38e[_0x4c7b('0x35')],qs[_0x4c7b('0x36')](_0x325702[_0x4c7b('0x32')]['fields']));_0x310257[_0x4c7b('0x34')]=_0x310257['attributes']['length']?_0x310257[_0x4c7b('0x34')]:_0x1aa38e['model'];if(_0x325702[_0x4c7b('0x32')][_0x4c7b('0x41')]){_0x310257['include']=[{'all':!![]}];}_0x310257=_[_0x4c7b('0x3f')]({},_0x310257,_0x325702[_0x4c7b('0x40')]);return db[_0x4c7b('0x2c')][_0x4c7b('0x48')](_0x310257)[_0x4c7b('0x23')](handleEntityNotFound(_0x510bc1,null))[_0x4c7b('0x23')](respondWithResult(_0x510bc1,null))['catch'](handleError(_0x510bc1,null));};exports[_0x4c7b('0x49')]=function(_0x4297a8,_0x345548){return db[_0x4c7b('0x2c')][_0x4c7b('0x49')](_0x4297a8[_0x4c7b('0x4a')],{})[_0x4c7b('0x23')](respondWithResult(_0x345548,0xc9))[_0x4c7b('0x45')](handleError(_0x345548,null));};exports['update']=function(_0x520541,_0x4dea25){if(_0x520541[_0x4c7b('0x4a')]['id']){delete _0x520541[_0x4c7b('0x4a')]['id'];}return db['IntegrationReport'][_0x4c7b('0x48')]({'where':{'id':_0x520541['params']['id']}})[_0x4c7b('0x23')](handleEntityNotFound(_0x4dea25,null))[_0x4c7b('0x23')](saveUpdates(_0x520541[_0x4c7b('0x4a')],null))[_0x4c7b('0x23')](respondWithResult(_0x4dea25,null))['catch'](handleError(_0x4dea25,null));};exports[_0x4c7b('0x24')]=function(_0x307dd0,_0x1b53bd){return db[_0x4c7b('0x2c')][_0x4c7b('0x48')]({'where':{'id':_0x307dd0[_0x4c7b('0x47')]['id']}})['then'](handleEntityNotFound(_0x1b53bd,null))[_0x4c7b('0x23')](removeEntity(_0x1b53bd,null))[_0x4c7b('0x45')](handleError(_0x1b53bd,null));};exports['describe']=function(_0x4d2d5a,_0x3f4d17){return db[_0x4c7b('0x2c')][_0x4c7b('0x4b')]()[_0x4c7b('0x23')](respondWithResult(_0x3f4d17,null))[_0x4c7b('0x45')](handleError(_0x3f4d17,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index bcc5b9c..91c14b7 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 _0x28b0=['exports','define','IntegrationReport','report_integration','lodash','api','bluebird','request-promise','path','rimraf'];(function(_0xd13171,_0xc54453){var _0x452bd0=function(_0x3c0628){while(--_0x3c0628){_0xd13171['push'](_0xd13171['shift']());}};_0x452bd0(++_0xc54453);}(_0x28b0,0x144));var _0x028b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x28b0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x028b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x028b('0x1'));var moment=require('moment');var BPromise=require(_0x028b('0x2'));var rp=require(_0x028b('0x3'));var fs=require('fs');var path=require(_0x028b('0x4'));var rimraf=require(_0x028b('0x5'));var config=require('../../config/environment');var attributes=require('./integrationReport.attributes');module[_0x028b('0x6')]=function(_0x496041,_0x1aa5f2){return _0x496041[_0x028b('0x7')](_0x028b('0x8'),attributes,{'tableName':_0x028b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1216=['bluebird','path','../../config/environment','./integrationReport.attributes','exports','IntegrationReport','report_integration','util','../../config/logger','api','moment'];(function(_0x4b6124,_0x44997a){var _0x1849b6=function(_0x125a4b){while(--_0x125a4b){_0x4b6124['push'](_0x4b6124['shift']());}};_0x1849b6(++_0x44997a);}(_0x1216,0x8b));var _0x6121=function(_0x30b0d8,_0x57470c){_0x30b0d8=_0x30b0d8-0x0;var _0x459c09=_0x1216[_0x30b0d8];return _0x459c09;};'use strict';var _=require('lodash');var util=require(_0x6121('0x0'));var logger=require(_0x6121('0x1'))(_0x6121('0x2'));var moment=require(_0x6121('0x3'));var BPromise=require(_0x6121('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6121('0x5'));var rimraf=require('rimraf');var config=require(_0x6121('0x6'));var attributes=require(_0x6121('0x7'));module[_0x6121('0x8')]=function(_0x30579d,_0xd58231){return _0x30579d['define'](_0x6121('0x9'),attributes,{'tableName':_0x6121('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 c68a4b3..05936ea 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 _0xc2c7=['../../config/logger','jayson/promise','client','http','request','then','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0xc2c7,0x134));var _0x7c2c=function(_0x27978e,_0x129769){_0x27978e=_0x27978e-0x0;var _0x18f8e5=_0xc2c7[_0x27978e];return _0x18f8e5;};'use strict';var _=require('lodash');var util=require(_0x7c2c('0x0'));var moment=require(_0x7c2c('0x1'));var BPromise=require(_0x7c2c('0x2'));var rs=require(_0x7c2c('0x3'));var fs=require('fs');var Redis=require(_0x7c2c('0x4'));var db=require(_0x7c2c('0x5'))['db'];var utils=require(_0x7c2c('0x6'));var logger=require(_0x7c2c('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7c2c('0x8'));var client=jayson[_0x7c2c('0x9')][_0x7c2c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54f027,_0x4abe93,_0x5a1027){return new BPromise(function(_0x2274cd,_0x29638d){return client[_0x7c2c('0xb')](_0x54f027,_0x5a1027)[_0x7c2c('0xc')](function(_0x279cff){logger['info'](_0x7c2c('0xd'),_0x4abe93,_0x7c2c('0xe'));logger[_0x7c2c('0xf')](_0x7c2c('0x10'),_0x4abe93,_0x7c2c('0xe'),JSON[_0x7c2c('0x11')](_0x279cff));if(_0x279cff[_0x7c2c('0x12')]){if(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x13')]===0x1f4){logger[_0x7c2c('0x12')](_0x7c2c('0xd'),_0x4abe93,_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);return _0x29638d(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);}logger[_0x7c2c('0x12')]('IntegrationReport,\x20%s,\x20%s',_0x4abe93,_0x279cff['error'][_0x7c2c('0x14')]);return _0x2274cd(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);}else{logger['info'](_0x7c2c('0xd'),_0x4abe93,_0x7c2c('0xe'));_0x2274cd(_0x279cff['result'][_0x7c2c('0x14')]);}})['catch'](function(_0x1aa355){logger['error'](_0x7c2c('0xd'),_0x4abe93,_0x1aa355);_0x29638d(_0x1aa355);});});} \ No newline at end of file +var _0x687b=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils'];(function(_0x11e05d,_0x3a4491){var _0x335588=function(_0x35ec3f){while(--_0x35ec3f){_0x11e05d['push'](_0x11e05d['shift']());}};_0x335588(++_0x3a4491);}(_0x687b,0x14a));var _0xb687=function(_0x4297af,_0x2882f5){_0x4297af=_0x4297af-0x0;var _0x10ad5d=_0x687b[_0x4297af];return _0x10ad5d;};'use strict';var _=require(_0xb687('0x0'));var util=require(_0xb687('0x1'));var moment=require(_0xb687('0x2'));var BPromise=require(_0xb687('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb687('0x4'))['db'];var utils=require(_0xb687('0x5'));var logger=require(_0xb687('0x6'))(_0xb687('0x7'));var config=require(_0xb687('0x8'));var jayson=require(_0xb687('0x9'));var client=jayson[_0xb687('0xa')][_0xb687('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x47ffea,_0x27b750,_0x48942b){return new BPromise(function(_0x2aea59,_0xd40346){return client['request'](_0x47ffea,_0x48942b)[_0xb687('0xc')](function(_0x21e3ab){logger[_0xb687('0xd')](_0xb687('0xe'),_0x27b750,_0xb687('0xf'));logger[_0xb687('0x10')](_0xb687('0x11'),_0x27b750,_0xb687('0xf'),JSON[_0xb687('0x12')](_0x21e3ab));if(_0x21e3ab['error']){if(_0x21e3ab[_0xb687('0x13')][_0xb687('0x14')]===0x1f4){logger[_0xb687('0x13')](_0xb687('0xe'),_0x27b750,_0x21e3ab['error']['message']);return _0xd40346(_0x21e3ab[_0xb687('0x13')][_0xb687('0x15')]);}logger['error'](_0xb687('0xe'),_0x27b750,_0x21e3ab[_0xb687('0x13')][_0xb687('0x15')]);return _0x2aea59(_0x21e3ab[_0xb687('0x13')][_0xb687('0x15')]);}else{logger[_0xb687('0xd')](_0xb687('0xe'),_0x27b750,_0xb687('0xf'));_0x2aea59(_0x21e3ab[_0xb687('0x16')][_0xb687('0x15')]);}})[_0xb687('0x17')](function(_0x19bb29){logger['error'](_0xb687('0xe'),_0x27b750,_0x19bb29);_0xd40346(_0x19bb29);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 911b830..0f2a3dc 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 _0xd714=['update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated','index','/:id','show','/:id/sub_intervals','getIntervals','post','create','/:id/sub_intervals/create_many','addIntervals','put'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xd714,0x1e4));var _0x4d71=function(_0x595013,_0x65a215){_0x595013=_0x595013-0x0;var _0x2a29e3=_0xd714[_0x595013];return _0x2a29e3;};'use strict';var multer=require(_0x4d71('0x0'));var util=require(_0x4d71('0x1'));var path=require('path');var timeout=require(_0x4d71('0x2'));var express=require(_0x4d71('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4d71('0x4'));var interaction=require(_0x4d71('0x5'));var config=require(_0x4d71('0x6'));var controller=require(_0x4d71('0x7'));router[_0x4d71('0x8')]('/',auth[_0x4d71('0x9')](),controller[_0x4d71('0xa')]);router[_0x4d71('0x8')](_0x4d71('0xb'),auth[_0x4d71('0x9')](),controller[_0x4d71('0xc')]);router[_0x4d71('0x8')](_0x4d71('0xd'),auth[_0x4d71('0x9')](),controller[_0x4d71('0xe')]);router[_0x4d71('0xf')]('/',auth['isAuthenticated'](),controller[_0x4d71('0x10')]);router[_0x4d71('0xf')](_0x4d71('0xd'),auth[_0x4d71('0x9')](),controller['addInterval']);router[_0x4d71('0xf')](_0x4d71('0x11'),auth['isAuthenticated'](),controller[_0x4d71('0x12')]);router[_0x4d71('0x13')](_0x4d71('0xb'),auth[_0x4d71('0x9')](),controller[_0x4d71('0x14')]);router[_0x4d71('0x15')]('/:id',auth[_0x4d71('0x9')](),controller[_0x4d71('0x16')]);module[_0x4d71('0x17')]=router; \ No newline at end of file +var _0xa1aa=['addIntervals','put','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./interval.controller','get','index','/:id','isAuthenticated','show','/:id/sub_intervals','getIntervals','post','addInterval','/:id/sub_intervals/create_many'];(function(_0x4e2f6f,_0x4a1e74){var _0x32e5a0=function(_0x7c16ec){while(--_0x7c16ec){_0x4e2f6f['push'](_0x4e2f6f['shift']());}};_0x32e5a0(++_0x4a1e74);}(_0xa1aa,0x88));var _0xaa1a=function(_0x4341e9,_0x5ed15e){_0x4341e9=_0x4341e9-0x0;var _0x5bf0f0=_0xa1aa[_0x4341e9];return _0x5bf0f0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xaa1a('0x0'));var timeout=require(_0xaa1a('0x1'));var express=require(_0xaa1a('0x2'));var router=express[_0xaa1a('0x3')]();var fs_extra=require(_0xaa1a('0x4'));var auth=require(_0xaa1a('0x5'));var interaction=require(_0xaa1a('0x6'));var config=require('../../config/environment');var controller=require(_0xaa1a('0x7'));router[_0xaa1a('0x8')]('/',auth['isAuthenticated'](),controller[_0xaa1a('0x9')]);router[_0xaa1a('0x8')](_0xaa1a('0xa'),auth[_0xaa1a('0xb')](),controller[_0xaa1a('0xc')]);router[_0xaa1a('0x8')](_0xaa1a('0xd'),auth[_0xaa1a('0xb')](),controller[_0xaa1a('0xe')]);router['post']('/',auth[_0xaa1a('0xb')](),controller['create']);router[_0xaa1a('0xf')](_0xaa1a('0xd'),auth[_0xaa1a('0xb')](),controller[_0xaa1a('0x10')]);router[_0xaa1a('0xf')](_0xaa1a('0x11'),auth[_0xaa1a('0xb')](),controller[_0xaa1a('0x12')]);router[_0xaa1a('0x13')](_0xaa1a('0xa'),auth[_0xaa1a('0xb')](),controller['update']);router['delete'](_0xaa1a('0xa'),auth[_0xaa1a('0xb')](),controller[_0xaa1a('0x14')]);module[_0xaa1a('0x15')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index e055746..c0b51a1 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 _0x7d1e=['STRING','sequelize'];(function(_0x4b45bc,_0x2193ca){var _0x11d660=function(_0x2d3500){while(--_0x2d3500){_0x4b45bc['push'](_0x4b45bc['shift']());}};_0x11d660(++_0x2193ca);}(_0x7d1e,0x123));var _0xe7d1=function(_0x3f3a92,_0xb232c){_0x3f3a92=_0x3f3a92-0x0;var _0x52727a=_0x7d1e[_0x3f3a92];return _0x52727a;};'use strict';var Sequelize=require(_0xe7d1('0x0'));module['exports']={'name':{'type':Sequelize[_0xe7d1('0x1')]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xe7d1('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0xd800=['STRING','exports'];(function(_0xe04ff9,_0x3c389b){var _0x1c7da3=function(_0x8f1006){while(--_0x8f1006){_0xe04ff9['push'](_0xe04ff9['shift']());}};_0x1c7da3(++_0x3c389b);}(_0xd800,0x1c3));var _0x0d80=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xd800[_0xbca1b1];return _0x4e1686;};'use strict';var Sequelize=require('sequelize');module[_0x0d80('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x0d80('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 7483299..fd26d1f 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 _0x2844=['VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','length','find','create','body','role','user','Intervals','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','IntervalId','getIntervals','findOne','options','addIntervals','sequelize','transaction','bulkCreate','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','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','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','map','Interval','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge'];(function(_0x5104d1,_0x39a97b){var _0x37410f=function(_0x3b872e){while(--_0x3b872e){_0x5104d1['push'](_0x5104d1['shift']());}};_0x37410f(++_0x39a97b);}(_0x2844,0xd9));var _0x4284=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0x2844[_0x4709c0];return _0x13348b;};'use strict';var emlformat=require(_0x4284('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4284('0x1'));var jsonpatch=require(_0x4284('0x2'));var rp=require(_0x4284('0x3'));var moment=require(_0x4284('0x4'));var BPromise=require(_0x4284('0x5'));var Mustache=require(_0x4284('0x6'));var util=require(_0x4284('0x7'));var path=require(_0x4284('0x8'));var sox=require(_0x4284('0x9'));var csv=require(_0x4284('0xa'));var ejs=require(_0x4284('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x4284('0xc'));var jsforce=require(_0x4284('0xd'));var deskjs=require(_0x4284('0xe'));var toCsv=require(_0x4284('0xa'));var querystring=require(_0x4284('0xf'));var Papa=require('papaparse');var Redis=require(_0x4284('0x10'));var authService=require(_0x4284('0x11'));var qs=require(_0x4284('0x12'));var as=require(_0x4284('0x13'));var hardwareService=require(_0x4284('0x14'));var logger=require(_0x4284('0x15'))(_0x4284('0x16'));var utils=require(_0x4284('0x17'));var config=require(_0x4284('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x4284('0x19'))['db'];var extensions=require(_0x4284('0x1a'));function respondWithStatusCode(_0x382532,_0x4c0282){_0x4c0282=_0x4c0282||0xcc;return function(_0x3dc6b2){if(_0x3dc6b2){return _0x382532[_0x4284('0x1b')](_0x4c0282);}return _0x382532[_0x4284('0x1c')](_0x4c0282)[_0x4284('0x1d')]();};}function respondWithResult(_0x26b0db,_0x57e9a2){_0x57e9a2=_0x57e9a2||0xc8;return function(_0x4a1142){if(_0x4a1142){return _0x26b0db[_0x4284('0x1c')](_0x57e9a2)[_0x4284('0x1e')](_0x4a1142);}};}function respondWithFilteredResult(_0x5782de,_0x304820){return function(_0x3ab197){if(_0x3ab197){var _0xc7c1b6=typeof _0x304820[_0x4284('0x1f')]===_0x4284('0x20')&&typeof _0x304820[_0x4284('0x21')]==='undefined';var _0x141515=_0x3ab197[_0x4284('0x22')];var _0x191799=_0xc7c1b6?0x0:_0x304820[_0x4284('0x1f')];var _0x48e496=_0xc7c1b6?_0x3ab197[_0x4284('0x22')]:_0x304820[_0x4284('0x1f')]+_0x304820[_0x4284('0x21')];var _0x5760a4;if(_0x48e496>=_0x141515){_0x48e496=_0x141515;_0x5760a4=0xc8;}else{_0x5760a4=0xce;}_0x5782de[_0x4284('0x1c')](_0x5760a4);return _0x5782de[_0x4284('0x23')](_0x4284('0x24'),_0x191799+'-'+_0x48e496+'/'+_0x141515)[_0x4284('0x1e')](_0x3ab197);}return null;};}function patchUpdates(_0x163a85){return function(_0x186e63){try{jsonpatch['apply'](_0x186e63,_0x163a85,!![]);}catch(_0x4d80d0){return BPromise[_0x4284('0x25')](_0x4d80d0);}return _0x186e63[_0x4284('0x26')]();};}function saveUpdates(_0x1edd35,_0x1d1213){return function(_0x319119){if(_0x319119){return _0x319119[_0x4284('0x27')](_0x1edd35)[_0x4284('0x28')](function(_0x245d4c){return _0x245d4c;});}return null;};}function removeEntity(_0x363c76,_0x414aad){return function(_0x3f18b3){if(_0x3f18b3){return _0x3f18b3[_0x4284('0x29')]()[_0x4284('0x28')](function(){var _0x730c8b=_0x3f18b3[_0x4284('0x2a')]({'plain':!![]});var _0x2ab611='Intervals';return db[_0x4284('0x2b')]['destroy']({'where':{'type':_0x2ab611,'resourceId':_0x730c8b['id']}})['then'](function(){return _0x3f18b3;});})[_0x4284('0x28')](function(){_0x363c76[_0x4284('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x26fcfc,_0xaa6bb0){return function(_0x586cae){if(!_0x586cae){_0x26fcfc[_0x4284('0x1b')](0x194);}return _0x586cae;};}function handleError(_0x54209b,_0x9dfb7a){_0x9dfb7a=_0x9dfb7a||0x1f4;return function(_0x3339d3){logger[_0x4284('0x2c')](_0x3339d3[_0x4284('0x2d')]);if(_0x3339d3[_0x4284('0x2e')]){delete _0x3339d3['name'];}_0x54209b[_0x4284('0x1c')](_0x9dfb7a)[_0x4284('0x2f')](_0x3339d3);};}exports['index']=function(_0x4fea17,_0x5f37d6){var _0x497b16={},_0xbb34e7={},_0xbbc90e={'count':0x0,'rows':[]};var _0x44ad77=_[_0x4284('0x30')](db[_0x4284('0x31')][_0x4284('0x32')],function(_0x51ebcb){return{'name':_0x51ebcb[_0x4284('0x33')],'type':_0x51ebcb[_0x4284('0x34')][_0x4284('0x35')]};});_0xbb34e7[_0x4284('0x36')]=_[_0x4284('0x30')](_0x44ad77,_0x4284('0x2e'));_0xbb34e7[_0x4284('0x37')]=_[_0x4284('0x38')](_0x4fea17['query']);_0xbb34e7['filters']=_[_0x4284('0x39')](_0xbb34e7[_0x4284('0x36')],_0xbb34e7['query']);_0x497b16[_0x4284('0x3a')]=_[_0x4284('0x39')](_0xbb34e7[_0x4284('0x36')],qs[_0x4284('0x3b')](_0x4fea17['query']['fields']));_0x497b16[_0x4284('0x3a')]=_0x497b16[_0x4284('0x3a')]['length']?_0x497b16['attributes']:_0xbb34e7[_0x4284('0x36')];if(!_0x4fea17[_0x4284('0x37')][_0x4284('0x3c')](_0x4284('0x3d'))){_0x497b16[_0x4284('0x21')]=qs[_0x4284('0x21')](_0x4fea17[_0x4284('0x37')]['limit']);_0x497b16[_0x4284('0x1f')]=qs['offset'](_0x4fea17[_0x4284('0x37')][_0x4284('0x1f')]);}_0x497b16[_0x4284('0x3e')]=qs[_0x4284('0x3f')](_0x4fea17[_0x4284('0x37')][_0x4284('0x3f')]);_0x497b16[_0x4284('0x40')]=qs['filters'](_[_0x4284('0x41')](_0x4fea17[_0x4284('0x37')],_0xbb34e7[_0x4284('0x42')]),_0x44ad77);if(_0x4fea17[_0x4284('0x37')]['filter']){_0x497b16[_0x4284('0x40')]=_[_0x4284('0x43')](_0x497b16[_0x4284('0x40')],{'$or':_[_0x4284('0x30')](_0x44ad77,function(_0x2b642e){if(_0x2b642e[_0x4284('0x34')]!==_0x4284('0x44')){var _0x47b645={};_0x47b645[_0x2b642e[_0x4284('0x2e')]]={'$like':'%'+_0x4fea17['query'][_0x4284('0x45')]+'%'};return _0x47b645;}})});}_0x497b16=_[_0x4284('0x43')]({},_0x497b16,_0x4fea17['options']);var _0x1a88ae={'where':_0x497b16[_0x4284('0x40')]};return db[_0x4284('0x31')][_0x4284('0x22')](_0x1a88ae)[_0x4284('0x28')](function(_0x159996){_0xbbc90e[_0x4284('0x22')]=_0x159996;if(_0x4fea17[_0x4284('0x37')][_0x4284('0x46')]){_0x497b16[_0x4284('0x47')]=[{'all':!![]}];}return db[_0x4284('0x31')][_0x4284('0x48')](_0x497b16);})[_0x4284('0x28')](function(_0x5025a2){_0xbbc90e[_0x4284('0x49')]=_0x5025a2;return _0xbbc90e;})[_0x4284('0x28')](respondWithFilteredResult(_0x5f37d6,_0x497b16))[_0x4284('0x4a')](handleError(_0x5f37d6,null));};exports[_0x4284('0x4b')]=function(_0x24996c,_0x51da69){var _0x4c4b01={'raw':!![],'where':{'id':_0x24996c['params']['id']}},_0x159439={};_0x159439[_0x4284('0x36')]=_[_0x4284('0x38')](db[_0x4284('0x31')][_0x4284('0x32')]);_0x159439[_0x4284('0x37')]=_[_0x4284('0x38')](_0x24996c[_0x4284('0x37')]);_0x159439[_0x4284('0x42')]=_[_0x4284('0x39')](_0x159439[_0x4284('0x36')],_0x159439['query']);_0x4c4b01[_0x4284('0x3a')]=_[_0x4284('0x39')](_0x159439[_0x4284('0x36')],qs[_0x4284('0x3b')](_0x24996c[_0x4284('0x37')][_0x4284('0x3b')]));_0x4c4b01[_0x4284('0x3a')]=_0x4c4b01[_0x4284('0x3a')][_0x4284('0x4c')]?_0x4c4b01['attributes']:_0x159439[_0x4284('0x36')];if(_0x24996c[_0x4284('0x37')][_0x4284('0x46')]){_0x4c4b01[_0x4284('0x47')]=[{'all':!![]}];}_0x4c4b01=_[_0x4284('0x43')]({},_0x4c4b01,_0x24996c['options']);return db[_0x4284('0x31')][_0x4284('0x4d')](_0x4c4b01)[_0x4284('0x28')](handleEntityNotFound(_0x51da69,null))[_0x4284('0x28')](respondWithResult(_0x51da69,null))[_0x4284('0x4a')](handleError(_0x51da69,null));};exports[_0x4284('0x4e')]=function(_0x4c1e71,_0x220496){return db[_0x4284('0x31')][_0x4284('0x4e')](_0x4c1e71[_0x4284('0x4f')],{})[_0x4284('0x28')](function(_0x360ead){var _0x493415=_0x4c1e71['user'][_0x4284('0x2a')]({'plain':!![]});if(!_0x493415)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x493415[_0x4284('0x50')]===_0x4284('0x51')){var _0x4e43a9=_0x360ead['get']({'plain':!![]});var _0x5c2981=_0x4284('0x52');return db[_0x4284('0x53')][_0x4284('0x4d')]({'where':{'name':_0x5c2981,'userProfileId':_0x493415['userProfileId']},'raw':!![]})[_0x4284('0x28')](function(_0x4df1ce){if(_0x4df1ce&&_0x4df1ce[_0x4284('0x54')]===0x0){return db[_0x4284('0x2b')]['create']({'name':_0x4e43a9[_0x4284('0x2e')],'resourceId':_0x4e43a9['id'],'type':_0x4df1ce[_0x4284('0x2e')],'sectionId':_0x4df1ce['id']},{})[_0x4284('0x28')](function(){return _0x360ead;});}else{return _0x360ead;}})[_0x4284('0x4a')](function(_0x4a1bc0){logger['error'](_0x4284('0x55'),_0x4a1bc0);throw _0x4a1bc0;});}return _0x360ead;})['then'](respondWithResult(_0x220496,0xc9))[_0x4284('0x4a')](handleError(_0x220496,null));};exports[_0x4284('0x27')]=function(_0x3614a8,_0x1c9c49){if(_0x3614a8['body']['id']){delete _0x3614a8['body']['id'];}return db[_0x4284('0x31')]['find']({'where':{'id':_0x3614a8['params']['id']}})[_0x4284('0x28')](handleEntityNotFound(_0x1c9c49,null))[_0x4284('0x28')](saveUpdates(_0x3614a8[_0x4284('0x4f')],null))['then'](respondWithResult(_0x1c9c49,null))[_0x4284('0x4a')](handleError(_0x1c9c49,null));};exports[_0x4284('0x29')]=function(_0x282801,_0x31962d){return db[_0x4284('0x31')]['find']({'where':{'id':_0x282801[_0x4284('0x56')]['id']}})[_0x4284('0x28')](handleEntityNotFound(_0x31962d,null))[_0x4284('0x28')](removeEntity(_0x31962d,null))[_0x4284('0x4a')](handleError(_0x31962d,null));};exports['addInterval']=function(_0x1fdfd2,_0x17e05c,_0x502d28){if(_0x1fdfd2[_0x4284('0x4f')]['id']){delete _0x1fdfd2[_0x4284('0x4f')]['id'];}return db[_0x4284('0x31')][_0x4284('0x4d')]({'where':{'id':_0x1fdfd2[_0x4284('0x56')]['id']}})['then'](handleEntityNotFound(_0x17e05c,null))['then'](function(_0x221e67){if(_0x221e67){_0x1fdfd2[_0x4284('0x4f')][_0x4284('0x57')]=_0x221e67['id'];return db[_0x4284('0x31')]['create'](_0x1fdfd2[_0x4284('0x4f')]);}})['then'](respondWithResult(_0x17e05c,null))[_0x4284('0x4a')](handleError(_0x17e05c,null));};exports[_0x4284('0x58')]=function(_0x261829,_0x13aa1f,_0x3935d5){var _0x99b102={};var _0x4f9330={};var _0x241ea1;var _0xda020;return db[_0x4284('0x31')][_0x4284('0x59')]({'where':{'id':_0x261829[_0x4284('0x56')]['id']}})[_0x4284('0x28')](handleEntityNotFound(_0x13aa1f,null))[_0x4284('0x28')](function(_0x4d573b){if(_0x4d573b){_0x241ea1=_0x4d573b;_0x4f9330[_0x4284('0x36')]=_[_0x4284('0x38')](db['Interval']['rawAttributes']);_0x4f9330[_0x4284('0x37')]=_[_0x4284('0x38')](_0x261829[_0x4284('0x37')]);_0x4f9330[_0x4284('0x42')]=_['intersection'](_0x4f9330[_0x4284('0x36')],_0x4f9330[_0x4284('0x37')]);_0x99b102[_0x4284('0x3a')]=_[_0x4284('0x39')](_0x4f9330[_0x4284('0x36')],qs[_0x4284('0x3b')](_0x261829[_0x4284('0x37')][_0x4284('0x3b')]));_0x99b102[_0x4284('0x3a')]=_0x99b102[_0x4284('0x3a')][_0x4284('0x4c')]?_0x99b102['attributes']:_0x4f9330[_0x4284('0x36')];_0x99b102[_0x4284('0x3e')]=qs[_0x4284('0x3f')](_0x261829[_0x4284('0x37')][_0x4284('0x3f')]);_0x99b102[_0x4284('0x40')]=qs[_0x4284('0x42')](_[_0x4284('0x41')](_0x261829[_0x4284('0x37')],_0x4f9330[_0x4284('0x42')]));if(_0x261829[_0x4284('0x37')][_0x4284('0x45')]){_0x99b102['where']=_[_0x4284('0x43')](_0x99b102[_0x4284('0x40')],{'$or':_[_0x4284('0x30')](_0x99b102[_0x4284('0x3a')],function(_0xba28d3){var _0xe4e24f={};_0xe4e24f[_0xba28d3]={'$like':'%'+_0x261829[_0x4284('0x37')][_0x4284('0x45')]+'%'};return _0xe4e24f;})});}_0x99b102=_[_0x4284('0x43')]({},_0x99b102,_0x261829[_0x4284('0x5a')]);return _0x241ea1[_0x4284('0x58')](_0x99b102);}})['then'](function(_0x4821c4){if(_0x4821c4){_0xda020=_0x4821c4[_0x4284('0x4c')];if(!_0x261829[_0x4284('0x37')][_0x4284('0x3c')](_0x4284('0x3d'))){_0x99b102[_0x4284('0x21')]=qs[_0x4284('0x21')](_0x261829[_0x4284('0x37')][_0x4284('0x21')]);_0x99b102['offset']=qs[_0x4284('0x1f')](_0x261829[_0x4284('0x37')][_0x4284('0x1f')]);}return _0x241ea1[_0x4284('0x58')](_0x99b102);}})['then'](function(_0x55e603){if(_0x55e603){return _0x55e603?{'count':_0xda020,'rows':_0x55e603}:null;}})['then'](respondWithResult(_0x13aa1f,null))[_0x4284('0x4a')](handleError(_0x13aa1f,null));};exports[_0x4284('0x5b')]=function(_0x2e17ae,_0x34a50b,_0x3e65c0){return db['Interval']['findOne']({'where':{'id':_0x2e17ae[_0x4284('0x56')]['id']}})[_0x4284('0x28')](handleEntityNotFound(_0x34a50b,null))[_0x4284('0x28')](function(_0x5621cd){if(_0x5621cd){return db[_0x4284('0x5c')][_0x4284('0x5d')](function(_0x1e843e){return db[_0x4284('0x31')][_0x4284('0x29')]({'where':{'IntervalId':_0x2e17ae[_0x4284('0x56')]['id']},'transaction':_0x1e843e})[_0x4284('0x28')](function(_0x258c77){var _0x2910d5=_[_0x4284('0x30')](_0x2e17ae['body'],function(_0x4b1720){delete _0x4b1720['id'];_0x4b1720[_0x4284('0x57')]=_0x2e17ae[_0x4284('0x56')]['id'];return _0x4b1720;});return db[_0x4284('0x31')][_0x4284('0x5e')](_0x2910d5,{'transaction':_0x1e843e});});})[_0x4284('0x28')](function(){return db[_0x4284('0x31')][_0x4284('0x48')]({'where':{'IntervalId':_0x2e17ae['params']['id']}});});}})[_0x4284('0x28')](respondWithResult(_0x34a50b,null))[_0x4284('0x4a')](handleError(_0x34a50b,null));}; \ No newline at end of file +var _0xb43d=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','UserProfileResource','error','stack','name','send','index','Interval','type','model','map','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','include','catch','params','rawAttributes','options','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addInterval','IntervalId','getIntervals','findOne','hasOwnProperty','sequelize','transaction','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','fs-extra','lodash','squel','crypto','querystring','papaparse'];(function(_0x3b6b89,_0x5b4266){var _0x5155d2=function(_0x319032){while(--_0x319032){_0x3b6b89['push'](_0x3b6b89['shift']());}};_0x5155d2(++_0x5b4266);}(_0xb43d,0x137));var _0xdb43=function(_0x512f3a,_0x488968){_0x512f3a=_0x512f3a-0x0;var _0x4030b2=_0xb43d[_0x512f3a];return _0x4030b2;};'use strict';var emlformat=require(_0xdb43('0x0'));var rimraf=require(_0xdb43('0x1'));var zipdir=require(_0xdb43('0x2'));var jsonpatch=require(_0xdb43('0x3'));var rp=require(_0xdb43('0x4'));var moment=require(_0xdb43('0x5'));var BPromise=require(_0xdb43('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdb43('0x7'));var _=require(_0xdb43('0x8'));var squel=require(_0xdb43('0x9'));var crypto=require(_0xdb43('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xdb43('0xb'));var Papa=require(_0xdb43('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xdb43('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdb43('0xe'));var logger=require(_0xdb43('0xf'))('api');var utils=require(_0xdb43('0x10'));var config=require(_0xdb43('0x11'));var licenseUtil=require(_0xdb43('0x12'));var db=require(_0xdb43('0x13'))['db'];var extensions=require(_0xdb43('0x14'));function respondWithStatusCode(_0x4abdef,_0x4827c1){_0x4827c1=_0x4827c1||0xcc;return function(_0x2df206){if(_0x2df206){return _0x4abdef[_0xdb43('0x15')](_0x4827c1);}return _0x4abdef[_0xdb43('0x16')](_0x4827c1)[_0xdb43('0x17')]();};}function respondWithResult(_0x10da62,_0x34d399){_0x34d399=_0x34d399||0xc8;return function(_0x4fc18c){if(_0x4fc18c){return _0x10da62[_0xdb43('0x16')](_0x34d399)[_0xdb43('0x18')](_0x4fc18c);}};}function respondWithFilteredResult(_0x120efc,_0x34f1e5){return function(_0x5f5cda){if(_0x5f5cda){var _0x59f7ce=typeof _0x34f1e5[_0xdb43('0x19')]===_0xdb43('0x1a')&&typeof _0x34f1e5[_0xdb43('0x1b')]==='undefined';var _0x30248d=_0x5f5cda['count'];var _0x4ff968=_0x59f7ce?0x0:_0x34f1e5[_0xdb43('0x19')];var _0xa1f6dc=_0x59f7ce?_0x5f5cda[_0xdb43('0x1c')]:_0x34f1e5['offset']+_0x34f1e5[_0xdb43('0x1b')];var _0x261acf;if(_0xa1f6dc>=_0x30248d){_0xa1f6dc=_0x30248d;_0x261acf=0xc8;}else{_0x261acf=0xce;}_0x120efc[_0xdb43('0x16')](_0x261acf);return _0x120efc[_0xdb43('0x1d')](_0xdb43('0x1e'),_0x4ff968+'-'+_0xa1f6dc+'/'+_0x30248d)[_0xdb43('0x18')](_0x5f5cda);}return null;};}function patchUpdates(_0x25101e){return function(_0x4b3f02){try{jsonpatch['apply'](_0x4b3f02,_0x25101e,!![]);}catch(_0x1f1c90){return BPromise[_0xdb43('0x1f')](_0x1f1c90);}return _0x4b3f02[_0xdb43('0x20')]();};}function saveUpdates(_0x473866,_0x4072a8){return function(_0x9bd4bb){if(_0x9bd4bb){return _0x9bd4bb[_0xdb43('0x21')](_0x473866)[_0xdb43('0x22')](function(_0x21e7b2){return _0x21e7b2;});}return null;};}function removeEntity(_0x4ccde2,_0x1d96d7){return function(_0x56780b){if(_0x56780b){return _0x56780b[_0xdb43('0x23')]()[_0xdb43('0x22')](function(){var _0x371d93=_0x56780b['get']({'plain':!![]});var _0x5ee751='Intervals';return db[_0xdb43('0x24')][_0xdb43('0x23')]({'where':{'type':_0x5ee751,'resourceId':_0x371d93['id']}})[_0xdb43('0x22')](function(){return _0x56780b;});})[_0xdb43('0x22')](function(){_0x4ccde2['status'](0xcc)[_0xdb43('0x17')]();});}};}function handleEntityNotFound(_0x285572,_0x320c6c){return function(_0x2f9ed9){if(!_0x2f9ed9){_0x285572[_0xdb43('0x15')](0x194);}return _0x2f9ed9;};}function handleError(_0xe6df67,_0x4a6c75){_0x4a6c75=_0x4a6c75||0x1f4;return function(_0x2a7d07){logger[_0xdb43('0x25')](_0x2a7d07[_0xdb43('0x26')]);if(_0x2a7d07[_0xdb43('0x27')]){delete _0x2a7d07[_0xdb43('0x27')];}_0xe6df67[_0xdb43('0x16')](_0x4a6c75)[_0xdb43('0x28')](_0x2a7d07);};}exports[_0xdb43('0x29')]=function(_0x527c08,_0x56297c){var _0x5542fd={},_0x2eed31={},_0x39f9d5={'count':0x0,'rows':[]};var _0x240fba=_['map'](db[_0xdb43('0x2a')]['rawAttributes'],function(_0x436cb0){return{'name':_0x436cb0['fieldName'],'type':_0x436cb0[_0xdb43('0x2b')]['key']};});_0x2eed31[_0xdb43('0x2c')]=_[_0xdb43('0x2d')](_0x240fba,_0xdb43('0x27'));_0x2eed31['query']=_[_0xdb43('0x2e')](_0x527c08[_0xdb43('0x2f')]);_0x2eed31[_0xdb43('0x30')]=_[_0xdb43('0x31')](_0x2eed31[_0xdb43('0x2c')],_0x2eed31[_0xdb43('0x2f')]);_0x5542fd[_0xdb43('0x32')]=_[_0xdb43('0x31')](_0x2eed31['model'],qs['fields'](_0x527c08[_0xdb43('0x2f')][_0xdb43('0x33')]));_0x5542fd[_0xdb43('0x32')]=_0x5542fd['attributes'][_0xdb43('0x34')]?_0x5542fd[_0xdb43('0x32')]:_0x2eed31['model'];if(!_0x527c08[_0xdb43('0x2f')]['hasOwnProperty'](_0xdb43('0x35'))){_0x5542fd['limit']=qs[_0xdb43('0x1b')](_0x527c08['query']['limit']);_0x5542fd['offset']=qs[_0xdb43('0x19')](_0x527c08[_0xdb43('0x2f')]['offset']);}_0x5542fd['order']=qs[_0xdb43('0x36')](_0x527c08['query']['sort']);_0x5542fd[_0xdb43('0x37')]=qs[_0xdb43('0x30')](_[_0xdb43('0x38')](_0x527c08[_0xdb43('0x2f')],_0x2eed31['filters']),_0x240fba);if(_0x527c08['query'][_0xdb43('0x39')]){_0x5542fd[_0xdb43('0x37')]=_[_0xdb43('0x3a')](_0x5542fd[_0xdb43('0x37')],{'$or':_['map'](_0x240fba,function(_0x427bd2){if(_0x427bd2[_0xdb43('0x2b')]!==_0xdb43('0x3b')){var _0x18d807={};_0x18d807[_0x427bd2[_0xdb43('0x27')]]={'$like':'%'+_0x527c08[_0xdb43('0x2f')]['filter']+'%'};return _0x18d807;}})});}_0x5542fd=_[_0xdb43('0x3a')]({},_0x5542fd,_0x527c08['options']);var _0x1924da={'where':_0x5542fd['where']};return db[_0xdb43('0x2a')][_0xdb43('0x1c')](_0x1924da)[_0xdb43('0x22')](function(_0x58b088){_0x39f9d5[_0xdb43('0x1c')]=_0x58b088;if(_0x527c08[_0xdb43('0x2f')]['includeAll']){_0x5542fd[_0xdb43('0x3c')]=[{'all':!![]}];}return db['Interval']['findAll'](_0x5542fd);})['then'](function(_0x1e8f06){_0x39f9d5['rows']=_0x1e8f06;return _0x39f9d5;})[_0xdb43('0x22')](respondWithFilteredResult(_0x56297c,_0x5542fd))[_0xdb43('0x3d')](handleError(_0x56297c,null));};exports['show']=function(_0x4f96a2,_0x5674f0){var _0x4047c3={'raw':!![],'where':{'id':_0x4f96a2[_0xdb43('0x3e')]['id']}},_0x4bd173={};_0x4bd173[_0xdb43('0x2c')]=_['keys'](db[_0xdb43('0x2a')][_0xdb43('0x3f')]);_0x4bd173['query']=_[_0xdb43('0x2e')](_0x4f96a2[_0xdb43('0x2f')]);_0x4bd173[_0xdb43('0x30')]=_[_0xdb43('0x31')](_0x4bd173[_0xdb43('0x2c')],_0x4bd173[_0xdb43('0x2f')]);_0x4047c3[_0xdb43('0x32')]=_[_0xdb43('0x31')](_0x4bd173['model'],qs['fields'](_0x4f96a2[_0xdb43('0x2f')][_0xdb43('0x33')]));_0x4047c3[_0xdb43('0x32')]=_0x4047c3[_0xdb43('0x32')]['length']?_0x4047c3[_0xdb43('0x32')]:_0x4bd173[_0xdb43('0x2c')];if(_0x4f96a2[_0xdb43('0x2f')]['includeAll']){_0x4047c3[_0xdb43('0x3c')]=[{'all':!![]}];}_0x4047c3=_[_0xdb43('0x3a')]({},_0x4047c3,_0x4f96a2[_0xdb43('0x40')]);return db[_0xdb43('0x2a')][_0xdb43('0x41')](_0x4047c3)[_0xdb43('0x22')](handleEntityNotFound(_0x5674f0,null))[_0xdb43('0x22')](respondWithResult(_0x5674f0,null))[_0xdb43('0x3d')](handleError(_0x5674f0,null));};exports[_0xdb43('0x42')]=function(_0x2bec21,_0x51ebeb){return db[_0xdb43('0x2a')][_0xdb43('0x42')](_0x2bec21['body'],{})[_0xdb43('0x22')](function(_0x4de4c3){var _0x1df2fb=_0x2bec21['user'][_0xdb43('0x43')]({'plain':!![]});if(!_0x1df2fb)throw new Error(_0xdb43('0x44'));if(_0x1df2fb['role']===_0xdb43('0x45')){var _0x138ce2=_0x4de4c3[_0xdb43('0x43')]({'plain':!![]});var _0x291619='Intervals';return db[_0xdb43('0x46')][_0xdb43('0x41')]({'where':{'name':_0x291619,'userProfileId':_0x1df2fb['userProfileId']},'raw':!![]})[_0xdb43('0x22')](function(_0x566cef){if(_0x566cef&&_0x566cef['autoAssociation']===0x0){return db[_0xdb43('0x24')][_0xdb43('0x42')]({'name':_0x138ce2[_0xdb43('0x27')],'resourceId':_0x138ce2['id'],'type':_0x566cef['name'],'sectionId':_0x566cef['id']},{})[_0xdb43('0x22')](function(){return _0x4de4c3;});}else{return _0x4de4c3;}})['catch'](function(_0x550792){logger[_0xdb43('0x25')](_0xdb43('0x47'),_0x550792);throw _0x550792;});}return _0x4de4c3;})[_0xdb43('0x22')](respondWithResult(_0x51ebeb,0xc9))[_0xdb43('0x3d')](handleError(_0x51ebeb,null));};exports[_0xdb43('0x21')]=function(_0x5a11a0,_0x5dfdc0){if(_0x5a11a0[_0xdb43('0x48')]['id']){delete _0x5a11a0[_0xdb43('0x48')]['id'];}return db['Interval'][_0xdb43('0x41')]({'where':{'id':_0x5a11a0[_0xdb43('0x3e')]['id']}})['then'](handleEntityNotFound(_0x5dfdc0,null))[_0xdb43('0x22')](saveUpdates(_0x5a11a0[_0xdb43('0x48')],null))[_0xdb43('0x22')](respondWithResult(_0x5dfdc0,null))['catch'](handleError(_0x5dfdc0,null));};exports[_0xdb43('0x23')]=function(_0x4c743c,_0x25d62a){return db[_0xdb43('0x2a')][_0xdb43('0x41')]({'where':{'id':_0x4c743c['params']['id']}})['then'](handleEntityNotFound(_0x25d62a,null))[_0xdb43('0x22')](removeEntity(_0x25d62a,null))['catch'](handleError(_0x25d62a,null));};exports[_0xdb43('0x49')]=function(_0x4f7d5d,_0x262db5,_0xa42a7a){if(_0x4f7d5d[_0xdb43('0x48')]['id']){delete _0x4f7d5d[_0xdb43('0x48')]['id'];}return db[_0xdb43('0x2a')]['find']({'where':{'id':_0x4f7d5d[_0xdb43('0x3e')]['id']}})[_0xdb43('0x22')](handleEntityNotFound(_0x262db5,null))['then'](function(_0x48e9b8){if(_0x48e9b8){_0x4f7d5d[_0xdb43('0x48')][_0xdb43('0x4a')]=_0x48e9b8['id'];return db[_0xdb43('0x2a')]['create'](_0x4f7d5d['body']);}})['then'](respondWithResult(_0x262db5,null))[_0xdb43('0x3d')](handleError(_0x262db5,null));};exports[_0xdb43('0x4b')]=function(_0x19bf5a,_0x3236d8,_0x1122a4){var _0x45c678={};var _0x3527f9={};var _0x14ad76;var _0x5a7a70;return db[_0xdb43('0x2a')][_0xdb43('0x4c')]({'where':{'id':_0x19bf5a[_0xdb43('0x3e')]['id']}})[_0xdb43('0x22')](handleEntityNotFound(_0x3236d8,null))[_0xdb43('0x22')](function(_0x31584f){if(_0x31584f){_0x14ad76=_0x31584f;_0x3527f9[_0xdb43('0x2c')]=_[_0xdb43('0x2e')](db[_0xdb43('0x2a')]['rawAttributes']);_0x3527f9['query']=_[_0xdb43('0x2e')](_0x19bf5a[_0xdb43('0x2f')]);_0x3527f9[_0xdb43('0x30')]=_[_0xdb43('0x31')](_0x3527f9['model'],_0x3527f9['query']);_0x45c678['attributes']=_[_0xdb43('0x31')](_0x3527f9[_0xdb43('0x2c')],qs[_0xdb43('0x33')](_0x19bf5a[_0xdb43('0x2f')][_0xdb43('0x33')]));_0x45c678[_0xdb43('0x32')]=_0x45c678[_0xdb43('0x32')]['length']?_0x45c678[_0xdb43('0x32')]:_0x3527f9['model'];_0x45c678['order']=qs[_0xdb43('0x36')](_0x19bf5a[_0xdb43('0x2f')]['sort']);_0x45c678[_0xdb43('0x37')]=qs[_0xdb43('0x30')](_[_0xdb43('0x38')](_0x19bf5a[_0xdb43('0x2f')],_0x3527f9[_0xdb43('0x30')]));if(_0x19bf5a[_0xdb43('0x2f')][_0xdb43('0x39')]){_0x45c678[_0xdb43('0x37')]=_['merge'](_0x45c678[_0xdb43('0x37')],{'$or':_[_0xdb43('0x2d')](_0x45c678[_0xdb43('0x32')],function(_0x3a856e){var _0x219b20={};_0x219b20[_0x3a856e]={'$like':'%'+_0x19bf5a[_0xdb43('0x2f')][_0xdb43('0x39')]+'%'};return _0x219b20;})});}_0x45c678=_[_0xdb43('0x3a')]({},_0x45c678,_0x19bf5a[_0xdb43('0x40')]);return _0x14ad76[_0xdb43('0x4b')](_0x45c678);}})[_0xdb43('0x22')](function(_0x16abfd){if(_0x16abfd){_0x5a7a70=_0x16abfd[_0xdb43('0x34')];if(!_0x19bf5a[_0xdb43('0x2f')][_0xdb43('0x4d')](_0xdb43('0x35'))){_0x45c678[_0xdb43('0x1b')]=qs[_0xdb43('0x1b')](_0x19bf5a['query'][_0xdb43('0x1b')]);_0x45c678['offset']=qs[_0xdb43('0x19')](_0x19bf5a[_0xdb43('0x2f')][_0xdb43('0x19')]);}return _0x14ad76[_0xdb43('0x4b')](_0x45c678);}})[_0xdb43('0x22')](function(_0x5483f9){if(_0x5483f9){return _0x5483f9?{'count':_0x5a7a70,'rows':_0x5483f9}:null;}})[_0xdb43('0x22')](respondWithResult(_0x3236d8,null))[_0xdb43('0x3d')](handleError(_0x3236d8,null));};exports['addIntervals']=function(_0x111f0c,_0xe8245b,_0x13ecc5){return db[_0xdb43('0x2a')][_0xdb43('0x4c')]({'where':{'id':_0x111f0c[_0xdb43('0x3e')]['id']}})[_0xdb43('0x22')](handleEntityNotFound(_0xe8245b,null))['then'](function(_0xb2fa06){if(_0xb2fa06){return db[_0xdb43('0x4e')][_0xdb43('0x4f')](function(_0x295319){return db[_0xdb43('0x2a')][_0xdb43('0x23')]({'where':{'IntervalId':_0x111f0c['params']['id']},'transaction':_0x295319})[_0xdb43('0x22')](function(_0x1de164){var _0xa0cd03=_[_0xdb43('0x2d')](_0x111f0c[_0xdb43('0x48')],function(_0x570610){delete _0x570610['id'];_0x570610[_0xdb43('0x4a')]=_0x111f0c[_0xdb43('0x3e')]['id'];return _0x570610;});return db[_0xdb43('0x2a')][_0xdb43('0x50')](_0xa0cd03,{'transaction':_0x295319});});})[_0xdb43('0x22')](function(){return db[_0xdb43('0x2a')]['findAll']({'where':{'IntervalId':_0x111f0c[_0xdb43('0x3e')]['id']}});});}})[_0xdb43('0x22')](respondWithResult(_0xe8245b,null))['catch'](handleError(_0xe8245b,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 0ee0b48..f34dd26 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 _0xec3f=['bluebird','path','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','Interval','tools_intervals','rewrite','lodash','util','../../config/logger','api','moment'];(function(_0xa89f26,_0x53b9be){var _0x3df3bb=function(_0x5f502b){while(--_0x5f502b){_0xa89f26['push'](_0xa89f26['shift']());}};_0x3df3bb(++_0x53b9be);}(_0xec3f,0xdb));var _0xfec3=function(_0x3288e9,_0x273acf){_0x3288e9=_0x3288e9-0x0;var _0x3def59=_0xec3f[_0x3288e9];return _0x3def59;};'use strict';var _=require(_0xfec3('0x0'));var util=require(_0xfec3('0x1'));var logger=require(_0xfec3('0x2'))(_0xfec3('0x3'));var moment=require(_0xfec3('0x4'));var BPromise=require(_0xfec3('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfec3('0x6'));var rimraf=require('rimraf');var config=require(_0xfec3('0x7'));var attributes=require(_0xfec3('0x8'));var extensions=require(_0xfec3('0x9'));module[_0xfec3('0xa')]=function(_0x2c9cb5,_0x448462){return _0x2c9cb5['define'](_0xfec3('0xb'),attributes,{'tableName':_0xfec3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x472120,_0x4b27fd){extensions[_0xfec3('0xd')](_0x2c9cb5,_0x472120);},'afterBulkCreate':function(_0x5797c,_0xddafe7,_0x4fabef){_0x4fabef();extensions[_0xfec3('0xd')](_0x2c9cb5,_0x5797c[0x0]);},'afterUpdate':function(_0x4c85e5,_0x267115){extensions[_0xfec3('0xd')](_0x2c9cb5,_0x4c85e5);},'afterDestroy':function(_0x325b46,_0x537378){extensions[_0xfec3('0xd')](_0x2c9cb5,_0x325b46);}}});}; \ No newline at end of file +var _0x954f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./interval.attributes','exports','define','tools_intervals','rewrite','lodash','util'];(function(_0x42358c,_0x538f25){var _0x4c617f=function(_0x2ba148){while(--_0x2ba148){_0x42358c['push'](_0x42358c['shift']());}};_0x4c617f(++_0x538f25);}(_0x954f,0x1a2));var _0xf954=function(_0x3d6fae,_0x2e77cf){_0x3d6fae=_0x3d6fae-0x0;var _0x268a15=_0x954f[_0x3d6fae];return _0x268a15;};'use strict';var _=require(_0xf954('0x0'));var util=require(_0xf954('0x1'));var logger=require('../../config/logger')(_0xf954('0x2'));var moment=require(_0xf954('0x3'));var BPromise=require(_0xf954('0x4'));var rp=require(_0xf954('0x5'));var fs=require('fs');var path=require(_0xf954('0x6'));var rimraf=require(_0xf954('0x7'));var config=require(_0xf954('0x8'));var attributes=require(_0xf954('0x9'));var extensions=require('../../components/extensions/rewrite');module[_0xf954('0xa')]=function(_0x55ff46,_0x1f053c){return _0x55ff46[_0xf954('0xb')]('Interval',attributes,{'tableName':_0xf954('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x495547,_0x34b4eb){extensions[_0xf954('0xd')](_0x55ff46,_0x495547);},'afterBulkCreate':function(_0xcea198,_0x2fa92f,_0x412f26){_0x412f26();extensions['rewrite'](_0x55ff46,_0xcea198[0x0]);},'afterUpdate':function(_0x141ead,_0xedeb84){extensions[_0xf954('0xd')](_0x55ff46,_0x141ead);},'afterDestroy':function(_0x5b8ce2,_0x16648f){extensions[_0xf954('0xd')](_0x55ff46,_0x5b8ce2);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 12921bf..62715cd 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(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'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(_0x3792e6,_0x32bd91){var _0x441e44=function(_0x357478){while(--_0x357478){_0x3792e6['push'](_0x3792e6['shift']());}};_0x441e44(++_0x32bd91);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'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 39b77c1..c2a8b6c 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 _0xb10b=['./jira.controller','post','send','exports','express','../../components/auth/service'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0xb10b,0x12a));var _0xbb10=function(_0x55b3b5,_0x254983){_0x55b3b5=_0x55b3b5-0x0;var _0x5297a9=_0xb10b[_0x55b3b5];return _0x5297a9;};'use strict';var express=require(_0xbb10('0x0'));var router=express['Router']();var auth=require(_0xbb10('0x1'));var controller=require(_0xbb10('0x2'));router[_0xbb10('0x3')]('/',auth['isAuthenticated'](),controller[_0xbb10('0x4')]);module[_0xbb10('0x5')]=router; \ No newline at end of file +var _0x2ef3=['./jira.controller','post','isAuthenticated','exports','express','Router','../../components/auth/service'];(function(_0x47b004,_0xb0d1ac){var _0x1e090f=function(_0x1ad28c){while(--_0x1ad28c){_0x47b004['push'](_0x47b004['shift']());}};_0x1e090f(++_0xb0d1ac);}(_0x2ef3,0xba));var _0x32ef=function(_0x2bbbee,_0x14f918){_0x2bbbee=_0x2bbbee-0x0;var _0x438b1e=_0x2ef3[_0x2bbbee];return _0x438b1e;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['send']);module[_0x32ef('0x6')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index d49c75d..2aa7dc0 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 _0x3a74=['support','3eAmWpBVP0','key','summary','Report','description','stringify','issuetype','Bug','fields','customfield_11500','email','customfield_11501','customfield_11502','newToken','name','customfield_11504','reason','customfield_10102','/rest/api/2/issue','POST','application/json','toString','request','setEncoding','utf8','data','status','statusCode','parse','json','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','end','openIssue','send','body','x-forwarded-for','connection','remoteAddress','socket','bluebird','https','../../config/logger','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3a74,0x110));var _0x43a7=function(_0x344992,_0x36511a){_0x344992=_0x344992-0x0;var _0x1342e5=_0x3a74[_0x344992];return _0x1342e5;};'use strict';var BPromise=require(_0x43a7('0x0'));var https=require(_0x43a7('0x1'));var logger=require(_0x43a7('0x2'))(_0x43a7('0x3'));var USERNAME=_0x43a7('0x4');var PASSWORD=_0x43a7('0x5');function openIssue(_0x541e95,_0x50b200){var _0x87e8ef={'fields':{'project':{'key':_0x541e95[_0x43a7('0x6')]||'MOTGUI'},'summary':(_0x541e95[_0x43a7('0x7')]||_0x43a7('0x8'))+'\x20from\x20'+_0x541e95['ip'],'description':_0x541e95[_0x43a7('0x9')]||JSON[_0x43a7('0xa')](_0x541e95),'issuetype':{'name':_0x541e95[_0x43a7('0xb')]||_0x43a7('0xc')}}};_0x87e8ef[_0x43a7('0xd')][_0x43a7('0xe')]=_0x541e95[_0x43a7('0xf')];_0x87e8ef[_0x43a7('0xd')][_0x43a7('0x10')]=_0x541e95['oldToken'];_0x87e8ef[_0x43a7('0xd')][_0x43a7('0x11')]=_0x541e95[_0x43a7('0x12')];_0x87e8ef[_0x43a7('0xd')]['customfield_11503']=_0x541e95[_0x43a7('0x13')];_0x87e8ef[_0x43a7('0xd')][_0x43a7('0x14')]=_0x541e95[_0x43a7('0x15')];_0x87e8ef[_0x43a7('0xd')][_0x43a7('0x16')]=_0x541e95['ip'];var _0x29d4e0={'host':'track.xcallymotion.com','port':0x1bb,'path':_0x43a7('0x17'),'method':_0x43a7('0x18'),'timeout':0x4e20,'headers':{'Content-Type':_0x43a7('0x19'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0x43a7('0x1a')]('base64')}};var _0x342efa=JSON[_0x43a7('0xa')](_0x87e8ef);var _0x408f4f=https[_0x43a7('0x1b')](_0x29d4e0,function(_0x33fae2){_0x33fae2[_0x43a7('0x1c')](_0x43a7('0x1d'));var _0x3be68a='';_0x33fae2['on'](_0x43a7('0x1e'),function(_0x3c440f){_0x3be68a+=_0x3c440f;});_0x33fae2['on']('end',function(){if(_0x50b200){return _0x50b200[_0x43a7('0x1f')](_0x33fae2[_0x43a7('0x20')])['json'](JSON[_0x43a7('0x21')](_0x3be68a));}});});_0x408f4f['on']('error',function(_0x43c100){if(_0x50b200){return _0x50b200[_0x43a7('0x1f')](0x1f4)[_0x43a7('0x22')]({'errors':[{'message':_0x43a7('0x23'),'type':_0x43a7('0x24')}]});}});_0x408f4f[_0x43a7('0x25')](_0x342efa);_0x408f4f[_0x43a7('0x26')]();}exports[_0x43a7('0x27')]=openIssue;exports[_0x43a7('0x28')]=function(_0x5730cd,_0x4bcbba){_0x5730cd[_0x43a7('0x29')]['ip']=_0x5730cd['headers'][_0x43a7('0x2a')]||_0x5730cd[_0x43a7('0x2b')][_0x43a7('0x2c')]||_0x5730cd['socket'][_0x43a7('0x2c')]||_0x5730cd[_0x43a7('0x2b')][_0x43a7('0x2d')][_0x43a7('0x2c')];return openIssue(_0x5730cd[_0x43a7('0x29')],_0x4bcbba);}; \ No newline at end of file +var _0xca55=['\x20from\x20','description','Bug','fields','customfield_11500','email','customfield_11501','newToken','name','customfield_11504','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','request','utf8','data','end','status','statusCode','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','body','headers','x-forwarded-for','connection','remoteAddress','socket','https','../../config/logger','api','support','key','MOTGUI','Report'];(function(_0x20194c,_0x5d1879){var _0x43dfe0=function(_0x4da0cd){while(--_0x4da0cd){_0x20194c['push'](_0x20194c['shift']());}};_0x43dfe0(++_0x5d1879);}(_0xca55,0x1bc));var _0x5ca5=function(_0x1d2bd4,_0x50933f){_0x1d2bd4=_0x1d2bd4-0x0;var _0x552500=_0xca55[_0x1d2bd4];return _0x552500;};'use strict';var BPromise=require('bluebird');var https=require(_0x5ca5('0x0'));var logger=require(_0x5ca5('0x1'))(_0x5ca5('0x2'));var USERNAME=_0x5ca5('0x3');var PASSWORD='3eAmWpBVP0';function openIssue(_0x503479,_0x4e4b46){var _0x21c1bf={'fields':{'project':{'key':_0x503479[_0x5ca5('0x4')]||_0x5ca5('0x5')},'summary':(_0x503479['summary']||_0x5ca5('0x6'))+_0x5ca5('0x7')+_0x503479['ip'],'description':_0x503479[_0x5ca5('0x8')]||JSON['stringify'](_0x503479),'issuetype':{'name':_0x503479['issuetype']||_0x5ca5('0x9')}}};_0x21c1bf[_0x5ca5('0xa')][_0x5ca5('0xb')]=_0x503479[_0x5ca5('0xc')];_0x21c1bf[_0x5ca5('0xa')][_0x5ca5('0xd')]=_0x503479['oldToken'];_0x21c1bf['fields']['customfield_11502']=_0x503479[_0x5ca5('0xe')];_0x21c1bf['fields']['customfield_11503']=_0x503479[_0x5ca5('0xf')];_0x21c1bf[_0x5ca5('0xa')][_0x5ca5('0x10')]=_0x503479['reason'];_0x21c1bf['fields'][_0x5ca5('0x11')]=_0x503479['ip'];var _0x1119b7={'host':_0x5ca5('0x12'),'port':0x1bb,'path':_0x5ca5('0x13'),'method':_0x5ca5('0x14'),'timeout':0x4e20,'headers':{'Content-Type':_0x5ca5('0x15'),'Authorization':_0x5ca5('0x16')+new Buffer(USERNAME+':'+PASSWORD)['toString']('base64')}};var _0x49a728=JSON['stringify'](_0x21c1bf);var _0xd15553=https[_0x5ca5('0x17')](_0x1119b7,function(_0x2fefb7){_0x2fefb7['setEncoding'](_0x5ca5('0x18'));var _0x35916c='';_0x2fefb7['on'](_0x5ca5('0x19'),function(_0x4aad13){_0x35916c+=_0x4aad13;});_0x2fefb7['on'](_0x5ca5('0x1a'),function(){if(_0x4e4b46){return _0x4e4b46[_0x5ca5('0x1b')](_0x2fefb7[_0x5ca5('0x1c')])['json'](JSON['parse'](_0x35916c));}});});_0xd15553['on'](_0x5ca5('0x1d'),function(_0xb7950b){if(_0x4e4b46){return _0x4e4b46[_0x5ca5('0x1b')](0x1f4)['json']({'errors':[{'message':_0x5ca5('0x1e'),'type':_0x5ca5('0x1f')}]});}});_0xd15553[_0x5ca5('0x20')](_0x49a728);_0xd15553[_0x5ca5('0x1a')]();}exports[_0x5ca5('0x21')]=openIssue;exports[_0x5ca5('0x22')]=function(_0x50b904,_0x384c6d){_0x50b904[_0x5ca5('0x23')]['ip']=_0x50b904[_0x5ca5('0x24')][_0x5ca5('0x25')]||_0x50b904[_0x5ca5('0x26')][_0x5ca5('0x27')]||_0x50b904[_0x5ca5('0x28')][_0x5ca5('0x27')]||_0x50b904[_0x5ca5('0x26')]['socket'][_0x5ca5('0x27')];return openIssue(_0x50b904[_0x5ca5('0x23')],_0x384c6d);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index d8dbc19..12f0596 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 _0x668b=['get','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','isAuthenticated','index'];(function(_0x2ce497,_0x2171b4){var _0x83d068=function(_0x59ec7c){while(--_0x59ec7c){_0x2ce497['push'](_0x2ce497['shift']());}};_0x83d068(++_0x2171b4);}(_0x668b,0x140));var _0xb668=function(_0x3ee1fe,_0x59f2a1){_0x3ee1fe=_0x3ee1fe-0x0;var _0x1ae57a=_0x668b[_0x3ee1fe];return _0x1ae57a;};'use strict';var multer=require(_0xb668('0x0'));var util=require(_0xb668('0x1'));var path=require('path');var timeout=require(_0xb668('0x2'));var express=require(_0xb668('0x3'));var router=express['Router']();var fs_extra=require(_0xb668('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb668('0x5'));var config=require(_0xb668('0x6'));var controller=require(_0xb668('0x7'));router['get']('/',auth[_0xb668('0x8')](),controller[_0xb668('0x9')]);router[_0xb668('0xa')](_0xb668('0xb'),auth[_0xb668('0x8')](),controller[_0xb668('0xc')]);router['get'](_0xb668('0xd'),auth[_0xb668('0x8')](),controller[_0xb668('0xe')]);router[_0xb668('0xf')]('/',auth[_0xb668('0x8')](),controller[_0xb668('0x10')]);router[_0xb668('0x11')](_0xb668('0xd'),auth['isAuthenticated'](),controller[_0xb668('0x12')]);router[_0xb668('0x13')](_0xb668('0xd'),auth[_0xb668('0x8')](),controller[_0xb668('0x14')]);module[_0xb668('0x15')]=router; \ No newline at end of file +var _0x878f=['./jscriptyAnswerReport.controller','get','/describe','/:id','post','isAuthenticated','create','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4c39f5,_0x109684){var _0x1db24f=function(_0x44879b){while(--_0x44879b){_0x4c39f5['push'](_0x4c39f5['shift']());}};_0x1db24f(++_0x109684);}(_0x878f,0x173));var _0xf878=function(_0x237a66,_0x1d0193){_0x237a66=_0x237a66-0x0;var _0x58e955=_0x878f[_0x237a66];return _0x58e955;};'use strict';var multer=require('multer');var util=require(_0xf878('0x0'));var path=require(_0xf878('0x1'));var timeout=require(_0xf878('0x2'));var express=require(_0xf878('0x3'));var router=express[_0xf878('0x4')]();var fs_extra=require(_0xf878('0x5'));var auth=require(_0xf878('0x6'));var interaction=require(_0xf878('0x7'));var config=require(_0xf878('0x8'));var controller=require(_0xf878('0x9'));router[_0xf878('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf878('0xa')](_0xf878('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xf878('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xf878('0xd')]('/',auth[_0xf878('0xe')](),controller[_0xf878('0xf')]);router['put'](_0xf878('0xc'),auth[_0xf878('0xe')](),controller['update']);router[_0xf878('0x10')]('/:id',auth[_0xf878('0xe')](),controller[_0xf878('0x11')]);module[_0xf878('0x12')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index a7bd9f9..ffe1ba4 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(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x7a54,0x106));var _0x47a5=function(_0x3be03f,_0x264726){_0x3be03f=_0x3be03f-0x0;var _0xe8514c=_0x7a54[_0x3be03f];return _0xe8514c;};'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(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x7a54,0x106));var _0x47a5=function(_0x4cb02d,_0x52cdca){_0x4cb02d=_0x4cb02d-0x0;var _0x40da74=_0x7a54[_0x4cb02d];return _0x40da74;};'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 2e0a587..fb73ce9 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 _0xafb9=['fieldName','key','model','name','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','rawAttributes','create','body','update','params','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','then','destroy','stack','send','index','map','JscriptyAnswerReport'];(function(_0x29d986,_0x29f7dd){var _0x31e2c3=function(_0x1cb574){while(--_0x1cb574){_0x29d986['push'](_0x29d986['shift']());}};_0x31e2c3(++_0x29f7dd);}(_0xafb9,0x68));var _0x9afb=function(_0xbfb3ef,_0x34a60f){_0xbfb3ef=_0xbfb3ef-0x0;var _0x1cc527=_0xafb9[_0xbfb3ef];return _0x1cc527;};'use strict';var emlformat=require(_0x9afb('0x0'));var rimraf=require(_0x9afb('0x1'));var zipdir=require(_0x9afb('0x2'));var jsonpatch=require(_0x9afb('0x3'));var rp=require(_0x9afb('0x4'));var moment=require(_0x9afb('0x5'));var BPromise=require(_0x9afb('0x6'));var Mustache=require(_0x9afb('0x7'));var util=require(_0x9afb('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x9afb('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9afb('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x9afb('0xb'));var jsforce=require(_0x9afb('0xc'));var deskjs=require(_0x9afb('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9afb('0xe'));var Papa=require(_0x9afb('0xf'));var Redis=require(_0x9afb('0x10'));var authService=require(_0x9afb('0x11'));var qs=require(_0x9afb('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9afb('0x13'))(_0x9afb('0x14'));var utils=require(_0x9afb('0x15'));var config=require(_0x9afb('0x16'));var licenseUtil=require(_0x9afb('0x17'));var db=require(_0x9afb('0x18'))['db'];function respondWithStatusCode(_0x374094,_0x34e849){_0x34e849=_0x34e849||0xcc;return function(_0x464462){if(_0x464462){return _0x374094[_0x9afb('0x19')](_0x34e849);}return _0x374094['status'](_0x34e849)[_0x9afb('0x1a')]();};}function respondWithResult(_0x572a02,_0x59fd82){_0x59fd82=_0x59fd82||0xc8;return function(_0x2f286f){if(_0x2f286f){return _0x572a02[_0x9afb('0x1b')](_0x59fd82)[_0x9afb('0x1c')](_0x2f286f);}};}function respondWithFilteredResult(_0x2d664d,_0x46b16f){return function(_0x39cdf1){if(_0x39cdf1){var _0xd111f1=typeof _0x46b16f['offset']===_0x9afb('0x1d')&&typeof _0x46b16f[_0x9afb('0x1e')]===_0x9afb('0x1d');var _0x190cb8=_0x39cdf1[_0x9afb('0x1f')];var _0x508433=_0xd111f1?0x0:_0x46b16f[_0x9afb('0x20')];var _0x50a7e4=_0xd111f1?_0x39cdf1[_0x9afb('0x1f')]:_0x46b16f[_0x9afb('0x20')]+_0x46b16f['limit'];var _0x4a1c74;if(_0x50a7e4>=_0x190cb8){_0x50a7e4=_0x190cb8;_0x4a1c74=0xc8;}else{_0x4a1c74=0xce;}_0x2d664d[_0x9afb('0x1b')](_0x4a1c74);return _0x2d664d[_0x9afb('0x21')](_0x9afb('0x22'),_0x508433+'-'+_0x50a7e4+'/'+_0x190cb8)[_0x9afb('0x1c')](_0x39cdf1);}return null;};}function patchUpdates(_0x3bd256){return function(_0x57b4e2){try{jsonpatch[_0x9afb('0x23')](_0x57b4e2,_0x3bd256,!![]);}catch(_0x4dc307){return BPromise['reject'](_0x4dc307);}return _0x57b4e2[_0x9afb('0x24')]();};}function saveUpdates(_0x3c3e48,_0x3d67bb){return function(_0x2d3938){if(_0x2d3938){return _0x2d3938['update'](_0x3c3e48)[_0x9afb('0x25')](function(_0x725a04){return _0x725a04;});}return null;};}function removeEntity(_0x49ba5f,_0x571bd9){return function(_0x5b5dab){if(_0x5b5dab){return _0x5b5dab[_0x9afb('0x26')]()['then'](function(){_0x49ba5f[_0x9afb('0x1b')](0xcc)[_0x9afb('0x1a')]();});}};}function handleEntityNotFound(_0x50a919,_0x324293){return function(_0x28beba){if(!_0x28beba){_0x50a919[_0x9afb('0x19')](0x194);}return _0x28beba;};}function handleError(_0x337d81,_0x530fbe){_0x530fbe=_0x530fbe||0x1f4;return function(_0x348255){logger['error'](_0x348255[_0x9afb('0x27')]);if(_0x348255['name']){delete _0x348255['name'];}_0x337d81[_0x9afb('0x1b')](_0x530fbe)[_0x9afb('0x28')](_0x348255);};}exports[_0x9afb('0x29')]=function(_0x13a33e,_0x119e04){var _0x3e3f57={},_0x46673d={},_0x5aabd5={'count':0x0,'rows':[]};var _0x494ef8=_[_0x9afb('0x2a')](db[_0x9afb('0x2b')]['rawAttributes'],function(_0x1d0bed){return{'name':_0x1d0bed[_0x9afb('0x2c')],'type':_0x1d0bed['type'][_0x9afb('0x2d')]};});_0x46673d[_0x9afb('0x2e')]=_[_0x9afb('0x2a')](_0x494ef8,_0x9afb('0x2f'));_0x46673d[_0x9afb('0x30')]=_[_0x9afb('0x31')](_0x13a33e[_0x9afb('0x30')]);_0x46673d[_0x9afb('0x32')]=_['intersection'](_0x46673d['model'],_0x46673d[_0x9afb('0x30')]);_0x3e3f57[_0x9afb('0x33')]=_[_0x9afb('0x34')](_0x46673d[_0x9afb('0x2e')],qs[_0x9afb('0x35')](_0x13a33e[_0x9afb('0x30')][_0x9afb('0x35')]));_0x3e3f57['attributes']=_0x3e3f57['attributes'][_0x9afb('0x36')]?_0x3e3f57[_0x9afb('0x33')]:_0x46673d['model'];if(!_0x13a33e[_0x9afb('0x30')]['hasOwnProperty'](_0x9afb('0x37'))){_0x3e3f57[_0x9afb('0x1e')]=qs['limit'](_0x13a33e[_0x9afb('0x30')]['limit']);_0x3e3f57[_0x9afb('0x20')]=qs[_0x9afb('0x20')](_0x13a33e[_0x9afb('0x30')][_0x9afb('0x20')]);}_0x3e3f57[_0x9afb('0x38')]=qs[_0x9afb('0x39')](_0x13a33e[_0x9afb('0x30')][_0x9afb('0x39')]);_0x3e3f57['where']=qs[_0x9afb('0x32')](_['pick'](_0x13a33e[_0x9afb('0x30')],_0x46673d[_0x9afb('0x32')]),_0x494ef8);if(_0x13a33e[_0x9afb('0x30')][_0x9afb('0x3a')]){_0x3e3f57[_0x9afb('0x3b')]=_[_0x9afb('0x3c')](_0x3e3f57[_0x9afb('0x3b')],{'$or':_[_0x9afb('0x2a')](_0x494ef8,function(_0x2433f0){if(_0x2433f0['type']!==_0x9afb('0x3d')){var _0x56f8d9={};_0x56f8d9[_0x2433f0[_0x9afb('0x2f')]]={'$like':'%'+_0x13a33e[_0x9afb('0x30')][_0x9afb('0x3a')]+'%'};return _0x56f8d9;}})});}_0x3e3f57=_['merge']({},_0x3e3f57,_0x13a33e[_0x9afb('0x3e')]);var _0xaf29dc={'where':_0x3e3f57[_0x9afb('0x3b')]};return db[_0x9afb('0x2b')][_0x9afb('0x1f')](_0xaf29dc)[_0x9afb('0x25')](function(_0x1e210a){_0x5aabd5['count']=_0x1e210a;if(_0x13a33e[_0x9afb('0x30')][_0x9afb('0x3f')]){_0x3e3f57[_0x9afb('0x40')]=[{'all':!![]}];}return db[_0x9afb('0x2b')][_0x9afb('0x41')](_0x3e3f57);})[_0x9afb('0x25')](function(_0x90bb7f){_0x5aabd5[_0x9afb('0x42')]=_0x90bb7f;return _0x5aabd5;})['then'](respondWithFilteredResult(_0x119e04,_0x3e3f57))[_0x9afb('0x43')](handleError(_0x119e04,null));};exports['show']=function(_0x47a735,_0x5ccc95){var _0xc72355={'raw':!![],'where':{'id':_0x47a735['params']['id']}},_0x3250c9={};_0x3250c9[_0x9afb('0x2e')]=_[_0x9afb('0x31')](db[_0x9afb('0x2b')][_0x9afb('0x44')]);_0x3250c9[_0x9afb('0x30')]=_[_0x9afb('0x31')](_0x47a735[_0x9afb('0x30')]);_0x3250c9[_0x9afb('0x32')]=_[_0x9afb('0x34')](_0x3250c9['model'],_0x3250c9[_0x9afb('0x30')]);_0xc72355[_0x9afb('0x33')]=_[_0x9afb('0x34')](_0x3250c9[_0x9afb('0x2e')],qs['fields'](_0x47a735[_0x9afb('0x30')][_0x9afb('0x35')]));_0xc72355[_0x9afb('0x33')]=_0xc72355['attributes'][_0x9afb('0x36')]?_0xc72355[_0x9afb('0x33')]:_0x3250c9[_0x9afb('0x2e')];if(_0x47a735[_0x9afb('0x30')][_0x9afb('0x3f')]){_0xc72355[_0x9afb('0x40')]=[{'all':!![]}];}_0xc72355=_[_0x9afb('0x3c')]({},_0xc72355,_0x47a735['options']);return db['JscriptyAnswerReport']['find'](_0xc72355)[_0x9afb('0x25')](handleEntityNotFound(_0x5ccc95,null))[_0x9afb('0x25')](respondWithResult(_0x5ccc95,null))['catch'](handleError(_0x5ccc95,null));};exports[_0x9afb('0x45')]=function(_0xdcfefd,_0x26e88a){return db[_0x9afb('0x2b')][_0x9afb('0x45')](_0xdcfefd[_0x9afb('0x46')],{})[_0x9afb('0x25')](respondWithResult(_0x26e88a,0xc9))[_0x9afb('0x43')](handleError(_0x26e88a,null));};exports[_0x9afb('0x47')]=function(_0x215764,_0x12594c){if(_0x215764['body']['id']){delete _0x215764['body']['id'];}return db[_0x9afb('0x2b')]['find']({'where':{'id':_0x215764[_0x9afb('0x48')]['id']}})[_0x9afb('0x25')](handleEntityNotFound(_0x12594c,null))[_0x9afb('0x25')](saveUpdates(_0x215764[_0x9afb('0x46')],null))[_0x9afb('0x25')](respondWithResult(_0x12594c,null))['catch'](handleError(_0x12594c,null));};exports[_0x9afb('0x26')]=function(_0x5a5b8b,_0x2ebeae){return db[_0x9afb('0x2b')][_0x9afb('0x49')]({'where':{'id':_0x5a5b8b[_0x9afb('0x48')]['id']}})[_0x9afb('0x25')](handleEntityNotFound(_0x2ebeae,null))[_0x9afb('0x25')](removeEntity(_0x2ebeae,null))[_0x9afb('0x43')](handleError(_0x2ebeae,null));};exports['describe']=function(_0x276997,_0x44c5ad){return db[_0x9afb('0x2b')]['describe']()[_0x9afb('0x25')](respondWithResult(_0x44c5ad,null))[_0x9afb('0x43')](handleError(_0x44c5ad,null));}; \ No newline at end of file +var _0x68f5=['../../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','name','index','map','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','JscriptyAnswerReport','includeAll','rows','catch','show','include','create','body','find','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x1d128e,_0x2c87de){var _0x3d5236=function(_0x2374ff){while(--_0x2374ff){_0x1d128e['push'](_0x1d128e['shift']());}};_0x3d5236(++_0x2c87de);}(_0x68f5,0x11a));var _0x568f=function(_0x9c764b,_0x13ad05){_0x9c764b=_0x9c764b-0x0;var _0xa7a538=_0x68f5[_0x9c764b];return _0xa7a538;};'use strict';var emlformat=require(_0x568f('0x0'));var rimraf=require(_0x568f('0x1'));var zipdir=require(_0x568f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x568f('0x3'));var moment=require(_0x568f('0x4'));var BPromise=require(_0x568f('0x5'));var Mustache=require(_0x568f('0x6'));var util=require(_0x568f('0x7'));var path=require('path');var sox=require(_0x568f('0x8'));var csv=require(_0x568f('0x9'));var ejs=require(_0x568f('0xa'));var fs=require('fs');var fs_extra=require(_0x568f('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x568f('0xc'));var jsforce=require(_0x568f('0xd'));var deskjs=require(_0x568f('0xe'));var toCsv=require('to-csv');var querystring=require(_0x568f('0xf'));var Papa=require('papaparse');var Redis=require(_0x568f('0x10'));var authService=require(_0x568f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x568f('0x12'));var hardwareService=require(_0x568f('0x13'));var logger=require(_0x568f('0x14'))(_0x568f('0x15'));var utils=require(_0x568f('0x16'));var config=require(_0x568f('0x17'));var licenseUtil=require(_0x568f('0x18'));var db=require(_0x568f('0x19'))['db'];function respondWithStatusCode(_0x200172,_0x4acf24){_0x4acf24=_0x4acf24||0xcc;return function(_0x341cde){if(_0x341cde){return _0x200172[_0x568f('0x1a')](_0x4acf24);}return _0x200172[_0x568f('0x1b')](_0x4acf24)[_0x568f('0x1c')]();};}function respondWithResult(_0x55fc40,_0x87b903){_0x87b903=_0x87b903||0xc8;return function(_0x53c270){if(_0x53c270){return _0x55fc40['status'](_0x87b903)[_0x568f('0x1d')](_0x53c270);}};}function respondWithFilteredResult(_0x15a4e5,_0x47316e){return function(_0x25e488){if(_0x25e488){var _0xcd73a2=typeof _0x47316e[_0x568f('0x1e')]===_0x568f('0x1f')&&typeof _0x47316e[_0x568f('0x20')]===_0x568f('0x1f');var _0x3d9645=_0x25e488[_0x568f('0x21')];var _0x49b64e=_0xcd73a2?0x0:_0x47316e[_0x568f('0x1e')];var _0x5cc7e2=_0xcd73a2?_0x25e488[_0x568f('0x21')]:_0x47316e[_0x568f('0x1e')]+_0x47316e[_0x568f('0x20')];var _0x1f4912;if(_0x5cc7e2>=_0x3d9645){_0x5cc7e2=_0x3d9645;_0x1f4912=0xc8;}else{_0x1f4912=0xce;}_0x15a4e5[_0x568f('0x1b')](_0x1f4912);return _0x15a4e5[_0x568f('0x22')](_0x568f('0x23'),_0x49b64e+'-'+_0x5cc7e2+'/'+_0x3d9645)[_0x568f('0x1d')](_0x25e488);}return null;};}function patchUpdates(_0x1a09a9){return function(_0x22c4e0){try{jsonpatch[_0x568f('0x24')](_0x22c4e0,_0x1a09a9,!![]);}catch(_0x2c65c6){return BPromise[_0x568f('0x25')](_0x2c65c6);}return _0x22c4e0[_0x568f('0x26')]();};}function saveUpdates(_0x3eb76d,_0x2afe66){return function(_0x2c61ea){if(_0x2c61ea){return _0x2c61ea[_0x568f('0x27')](_0x3eb76d)[_0x568f('0x28')](function(_0x4a248e){return _0x4a248e;});}return null;};}function removeEntity(_0xa2225a,_0x4590a8){return function(_0x20daca){if(_0x20daca){return _0x20daca[_0x568f('0x29')]()['then'](function(){_0xa2225a['status'](0xcc)[_0x568f('0x1c')]();});}};}function handleEntityNotFound(_0x45826b,_0x67f06c){return function(_0x6bb377){if(!_0x6bb377){_0x45826b['sendStatus'](0x194);}return _0x6bb377;};}function handleError(_0x51d57f,_0x3de8ce){_0x3de8ce=_0x3de8ce||0x1f4;return function(_0x577ca6){logger['error'](_0x577ca6['stack']);if(_0x577ca6[_0x568f('0x2a')]){delete _0x577ca6['name'];}_0x51d57f[_0x568f('0x1b')](_0x3de8ce)['send'](_0x577ca6);};}exports[_0x568f('0x2b')]=function(_0x2ff19b,_0x182a1f){var _0x52acac={},_0x209db2={},_0x18530c={'count':0x0,'rows':[]};var _0x4c0729=_[_0x568f('0x2c')](db['JscriptyAnswerReport'][_0x568f('0x2d')],function(_0x543573){return{'name':_0x543573['fieldName'],'type':_0x543573[_0x568f('0x2e')][_0x568f('0x2f')]};});_0x209db2[_0x568f('0x30')]=_[_0x568f('0x2c')](_0x4c0729,_0x568f('0x2a'));_0x209db2[_0x568f('0x31')]=_[_0x568f('0x32')](_0x2ff19b[_0x568f('0x31')]);_0x209db2['filters']=_[_0x568f('0x33')](_0x209db2[_0x568f('0x30')],_0x209db2[_0x568f('0x31')]);_0x52acac[_0x568f('0x34')]=_['intersection'](_0x209db2[_0x568f('0x30')],qs[_0x568f('0x35')](_0x2ff19b[_0x568f('0x31')][_0x568f('0x35')]));_0x52acac[_0x568f('0x34')]=_0x52acac[_0x568f('0x34')][_0x568f('0x36')]?_0x52acac['attributes']:_0x209db2[_0x568f('0x30')];if(!_0x2ff19b[_0x568f('0x31')][_0x568f('0x37')](_0x568f('0x38'))){_0x52acac[_0x568f('0x20')]=qs['limit'](_0x2ff19b['query'][_0x568f('0x20')]);_0x52acac[_0x568f('0x1e')]=qs[_0x568f('0x1e')](_0x2ff19b[_0x568f('0x31')][_0x568f('0x1e')]);}_0x52acac['order']=qs[_0x568f('0x39')](_0x2ff19b[_0x568f('0x31')][_0x568f('0x39')]);_0x52acac[_0x568f('0x3a')]=qs[_0x568f('0x3b')](_[_0x568f('0x3c')](_0x2ff19b[_0x568f('0x31')],_0x209db2[_0x568f('0x3b')]),_0x4c0729);if(_0x2ff19b[_0x568f('0x31')][_0x568f('0x3d')]){_0x52acac[_0x568f('0x3a')]=_[_0x568f('0x3e')](_0x52acac[_0x568f('0x3a')],{'$or':_[_0x568f('0x2c')](_0x4c0729,function(_0x3a2772){if(_0x3a2772['type']!==_0x568f('0x3f')){var _0x493c1d={};_0x493c1d[_0x3a2772['name']]={'$like':'%'+_0x2ff19b[_0x568f('0x31')]['filter']+'%'};return _0x493c1d;}})});}_0x52acac=_[_0x568f('0x3e')]({},_0x52acac,_0x2ff19b[_0x568f('0x40')]);var _0x4c08da={'where':_0x52acac[_0x568f('0x3a')]};return db[_0x568f('0x41')][_0x568f('0x21')](_0x4c08da)[_0x568f('0x28')](function(_0x10c487){_0x18530c['count']=_0x10c487;if(_0x2ff19b[_0x568f('0x31')][_0x568f('0x42')]){_0x52acac['include']=[{'all':!![]}];}return db['JscriptyAnswerReport']['findAll'](_0x52acac);})['then'](function(_0x3bcf12){_0x18530c[_0x568f('0x43')]=_0x3bcf12;return _0x18530c;})[_0x568f('0x28')](respondWithFilteredResult(_0x182a1f,_0x52acac))[_0x568f('0x44')](handleError(_0x182a1f,null));};exports[_0x568f('0x45')]=function(_0x4cdc7a,_0x2f6c1a){var _0xd884b9={'raw':!![],'where':{'id':_0x4cdc7a['params']['id']}},_0x8f3db1={};_0x8f3db1['model']=_[_0x568f('0x32')](db['JscriptyAnswerReport'][_0x568f('0x2d')]);_0x8f3db1[_0x568f('0x31')]=_['keys'](_0x4cdc7a[_0x568f('0x31')]);_0x8f3db1[_0x568f('0x3b')]=_[_0x568f('0x33')](_0x8f3db1['model'],_0x8f3db1['query']);_0xd884b9[_0x568f('0x34')]=_[_0x568f('0x33')](_0x8f3db1['model'],qs['fields'](_0x4cdc7a[_0x568f('0x31')][_0x568f('0x35')]));_0xd884b9['attributes']=_0xd884b9[_0x568f('0x34')]['length']?_0xd884b9[_0x568f('0x34')]:_0x8f3db1['model'];if(_0x4cdc7a[_0x568f('0x31')][_0x568f('0x42')]){_0xd884b9[_0x568f('0x46')]=[{'all':!![]}];}_0xd884b9=_[_0x568f('0x3e')]({},_0xd884b9,_0x4cdc7a['options']);return db[_0x568f('0x41')]['find'](_0xd884b9)[_0x568f('0x28')](handleEntityNotFound(_0x2f6c1a,null))['then'](respondWithResult(_0x2f6c1a,null))['catch'](handleError(_0x2f6c1a,null));};exports[_0x568f('0x47')]=function(_0x502884,_0x210ee9){return db[_0x568f('0x41')]['create'](_0x502884[_0x568f('0x48')],{})[_0x568f('0x28')](respondWithResult(_0x210ee9,0xc9))[_0x568f('0x44')](handleError(_0x210ee9,null));};exports['update']=function(_0x3e85a8,_0x1fe7c5){if(_0x3e85a8[_0x568f('0x48')]['id']){delete _0x3e85a8[_0x568f('0x48')]['id'];}return db['JscriptyAnswerReport'][_0x568f('0x49')]({'where':{'id':_0x3e85a8[_0x568f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1fe7c5,null))[_0x568f('0x28')](saveUpdates(_0x3e85a8[_0x568f('0x48')],null))[_0x568f('0x28')](respondWithResult(_0x1fe7c5,null))[_0x568f('0x44')](handleError(_0x1fe7c5,null));};exports[_0x568f('0x29')]=function(_0x4fd923,_0x406170){return db['JscriptyAnswerReport']['find']({'where':{'id':_0x4fd923[_0x568f('0x4a')]['id']}})[_0x568f('0x28')](handleEntityNotFound(_0x406170,null))[_0x568f('0x28')](removeEntity(_0x406170,null))['catch'](handleError(_0x406170,null));};exports[_0x568f('0x4b')]=function(_0x379f87,_0x556618){return db[_0x568f('0x41')]['describe']()[_0x568f('0x28')](respondWithResult(_0x556618,null))[_0x568f('0x44')](handleError(_0x556618,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index f306a95..663f854 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 _0x3f91=['bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','define','JscriptyAnswerReport','lodash','util','api','moment'];(function(_0x4e8e83,_0x228a98){var _0x2de2be=function(_0x450d2f){while(--_0x450d2f){_0x4e8e83['push'](_0x4e8e83['shift']());}};_0x2de2be(++_0x228a98);}(_0x3f91,0x1f4));var _0x13f9=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x3f91[_0x16b9ed];return _0x66b1f8;};'use strict';var _=require(_0x13f9('0x0'));var util=require(_0x13f9('0x1'));var logger=require('../../config/logger')(_0x13f9('0x2'));var moment=require(_0x13f9('0x3'));var BPromise=require(_0x13f9('0x4'));var rp=require(_0x13f9('0x5'));var fs=require('fs');var path=require(_0x13f9('0x6'));var rimraf=require(_0x13f9('0x7'));var config=require(_0x13f9('0x8'));var attributes=require(_0x13f9('0x9'));module['exports']=function(_0xc406,_0xe5d905){return _0xc406[_0x13f9('0xa')](_0x13f9('0xb'),attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3319=['request-promise','path','rimraf','../../config/environment','exports','define','report_jscripty_answers','lodash','util','api','moment'];(function(_0x1466f2,_0x25af49){var _0x2487e9=function(_0x55a4cb){while(--_0x55a4cb){_0x1466f2['push'](_0x1466f2['shift']());}};_0x2487e9(++_0x25af49);}(_0x3319,0x75));var _0x9331=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0x3319[_0x2cfb58];return _0xd99951;};'use strict';var _=require(_0x9331('0x0'));var util=require(_0x9331('0x1'));var logger=require('../../config/logger')(_0x9331('0x2'));var moment=require(_0x9331('0x3'));var BPromise=require('bluebird');var rp=require(_0x9331('0x4'));var fs=require('fs');var path=require(_0x9331('0x5'));var rimraf=require(_0x9331('0x6'));var config=require(_0x9331('0x7'));var attributes=require('./jscriptyAnswerReport.attributes');module[_0x9331('0x8')]=function(_0x51a2b6,_0x2a1af8){return _0x51a2b6[_0x9331('0x9')]('JscriptyAnswerReport',attributes,{'tableName':_0x9331('0xa'),'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 22c19ca..9e951d3 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 _0x7519=['debug','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent'];(function(_0x1ffe75,_0x59931f){var _0x56bcdc=function(_0x1c1760){while(--_0x1c1760){_0x1ffe75['push'](_0x1ffe75['shift']());}};_0x56bcdc(++_0x59931f);}(_0x7519,0xc2));var _0x9751=function(_0x207cfe,_0x3053c7){_0x207cfe=_0x207cfe-0x0;var _0xf02ff3=_0x7519[_0x207cfe];return _0xf02ff3;};'use strict';var _=require(_0x9751('0x0'));var util=require(_0x9751('0x1'));var moment=require(_0x9751('0x2'));var BPromise=require(_0x9751('0x3'));var rs=require(_0x9751('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9751('0x5'));var logger=require(_0x9751('0x6'))(_0x9751('0x7'));var config=require(_0x9751('0x8'));var jayson=require(_0x9751('0x9'));var client=jayson[_0x9751('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xdc9532,_0x590912,_0x2f852a){return new BPromise(function(_0x2d8523,_0x45be2e){return client[_0x9751('0xb')](_0xdc9532,_0x2f852a)[_0x9751('0xc')](function(_0x55ff4e){logger[_0x9751('0xd')](_0x9751('0xe'),_0x590912,_0x9751('0xf'));logger[_0x9751('0x10')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x590912,_0x9751('0xf'),JSON[_0x9751('0x11')](_0x55ff4e));if(_0x55ff4e[_0x9751('0x12')]){if(_0x55ff4e[_0x9751('0x12')]['code']===0x1f4){logger[_0x9751('0x12')](_0x9751('0xe'),_0x590912,_0x55ff4e['error'][_0x9751('0x13')]);return _0x45be2e(_0x55ff4e[_0x9751('0x12')][_0x9751('0x13')]);}logger[_0x9751('0x12')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x590912,_0x55ff4e[_0x9751('0x12')][_0x9751('0x13')]);return _0x2d8523(_0x55ff4e[_0x9751('0x12')]['message']);}else{logger[_0x9751('0xd')](_0x9751('0xe'),_0x590912,_0x9751('0xf'));_0x2d8523(_0x55ff4e['result'][_0x9751('0x13')]);}})[_0x9751('0x14')](function(_0x5ad5e0){logger[_0x9751('0x12')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x590912,_0x5ad5e0);_0x45be2e(_0x5ad5e0);});});} \ No newline at end of file +var _0x7a2b=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','then','info','JscriptyAnswerReport,\x20%s,\x20%s','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util'];(function(_0xdd82b4,_0x5cd8b8){var _0x549bb2=function(_0x426fd9){while(--_0x426fd9){_0xdd82b4['push'](_0xdd82b4['shift']());}};_0x549bb2(++_0x5cd8b8);}(_0x7a2b,0x1a2));var _0xb7a2=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x7a2b[_0x618414];return _0x21c19a;};'use strict';var _=require(_0xb7a2('0x0'));var util=require(_0xb7a2('0x1'));var moment=require('moment');var BPromise=require(_0xb7a2('0x2'));var rs=require(_0xb7a2('0x3'));var fs=require('fs');var Redis=require(_0xb7a2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb7a2('0x5'));var logger=require(_0xb7a2('0x6'))(_0xb7a2('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb7a2('0x8')][_0xb7a2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4c15f6,_0x484f1c,_0x501799){return new BPromise(function(_0xc16d66,_0x4435d7){return client['request'](_0x4c15f6,_0x501799)[_0xb7a2('0xa')](function(_0x5a5ba7){logger[_0xb7a2('0xb')](_0xb7a2('0xc'),_0x484f1c,'request\x20sent');logger['debug'](_0xb7a2('0xd'),_0x484f1c,_0xb7a2('0xe'),JSON[_0xb7a2('0xf')](_0x5a5ba7));if(_0x5a5ba7[_0xb7a2('0x10')]){if(_0x5a5ba7[_0xb7a2('0x10')][_0xb7a2('0x11')]===0x1f4){logger[_0xb7a2('0x10')](_0xb7a2('0xc'),_0x484f1c,_0x5a5ba7[_0xb7a2('0x10')][_0xb7a2('0x12')]);return _0x4435d7(_0x5a5ba7['error'][_0xb7a2('0x12')]);}logger[_0xb7a2('0x10')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x484f1c,_0x5a5ba7[_0xb7a2('0x10')][_0xb7a2('0x12')]);return _0xc16d66(_0x5a5ba7[_0xb7a2('0x10')][_0xb7a2('0x12')]);}else{logger[_0xb7a2('0xb')](_0xb7a2('0xc'),_0x484f1c,'request\x20sent');_0xc16d66(_0x5a5ba7['result'][_0xb7a2('0x12')]);}})[_0xb7a2('0x13')](function(_0x1b89b9){logger[_0xb7a2('0x10')](_0xb7a2('0xc'),_0x484f1c,_0x1b89b9);_0x4435d7(_0x1b89b9);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 8c7ae72..9462eee 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 _0xf5b0=['isAuthenticated','index','/:id','/:id/sessions','getSessions','/:id/answers','getAnswers','30s','getSummary','post','create','/:id/clone','put','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./jscriptyProject.controller','get'];(function(_0x8a44ac,_0x3625e6){var _0x4bf66a=function(_0x3330f1){while(--_0x3330f1){_0x8a44ac['push'](_0x8a44ac['shift']());}};_0x4bf66a(++_0x3625e6);}(_0xf5b0,0x17d));var _0x0f5b=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xf5b0[_0xae7c2f];return _0x5d7001;};'use strict';var multer=require(_0x0f5b('0x0'));var util=require(_0x0f5b('0x1'));var path=require(_0x0f5b('0x2'));var timeout=require('connect-timeout');var express=require(_0x0f5b('0x3'));var router=express['Router']();var fs_extra=require(_0x0f5b('0x4'));var auth=require(_0x0f5b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0f5b('0x6'));var controller=require(_0x0f5b('0x7'));router[_0x0f5b('0x8')]('/',auth[_0x0f5b('0x9')](),controller[_0x0f5b('0xa')]);router[_0x0f5b('0x8')](_0x0f5b('0xb'),auth[_0x0f5b('0x9')](),controller['show']);router[_0x0f5b('0x8')](_0x0f5b('0xc'),auth['isAuthenticated'](),controller[_0x0f5b('0xd')]);router[_0x0f5b('0x8')](_0x0f5b('0xe'),auth[_0x0f5b('0x9')](),controller[_0x0f5b('0xf')]);router['get']('/:id/summary',auth[_0x0f5b('0x9')](),timeout(_0x0f5b('0x10')),controller[_0x0f5b('0x11')]);router[_0x0f5b('0x12')]('/',auth[_0x0f5b('0x9')](),controller[_0x0f5b('0x13')]);router[_0x0f5b('0x12')](_0x0f5b('0x14'),auth[_0x0f5b('0x9')](),controller['clone']);router[_0x0f5b('0x15')](_0x0f5b('0xb'),auth[_0x0f5b('0x9')](),controller[_0x0f5b('0x16')]);router[_0x0f5b('0x17')](_0x0f5b('0xb'),auth['isAuthenticated'](),controller[_0x0f5b('0x18')]);module[_0x0f5b('0x19')]=router; \ No newline at end of file +var _0xd612=['../../config/environment','./jscriptyProject.controller','get','isAuthenticated','/:id','show','/:id/sessions','getSessions','/:id/answers','getAnswers','30s','getSummary','post','clone','put','update','delete','destroy','exports','multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x199bc4,_0x338105){var _0x136ffb=function(_0x3e7ced){while(--_0x3e7ced){_0x199bc4['push'](_0x199bc4['shift']());}};_0x136ffb(++_0x338105);}(_0xd612,0x13f));var _0x2d61=function(_0x3e09fb,_0x567dba){_0x3e09fb=_0x3e09fb-0x0;var _0x5bbff8=_0xd612[_0x3e09fb];return _0x5bbff8;};'use strict';var multer=require(_0x2d61('0x0'));var util=require('util');var path=require(_0x2d61('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2d61('0x2')]();var fs_extra=require(_0x2d61('0x3'));var auth=require(_0x2d61('0x4'));var interaction=require(_0x2d61('0x5'));var config=require(_0x2d61('0x6'));var controller=require(_0x2d61('0x7'));router[_0x2d61('0x8')]('/',auth[_0x2d61('0x9')](),controller['index']);router[_0x2d61('0x8')](_0x2d61('0xa'),auth[_0x2d61('0x9')](),controller[_0x2d61('0xb')]);router[_0x2d61('0x8')](_0x2d61('0xc'),auth[_0x2d61('0x9')](),controller[_0x2d61('0xd')]);router[_0x2d61('0x8')](_0x2d61('0xe'),auth['isAuthenticated'](),controller[_0x2d61('0xf')]);router['get']('/:id/summary',auth[_0x2d61('0x9')](),timeout(_0x2d61('0x10')),controller[_0x2d61('0x11')]);router[_0x2d61('0x12')]('/',auth[_0x2d61('0x9')](),controller['create']);router[_0x2d61('0x12')]('/:id/clone',auth[_0x2d61('0x9')](),controller[_0x2d61('0x13')]);router[_0x2d61('0x14')](_0x2d61('0xa'),auth[_0x2d61('0x9')](),controller[_0x2d61('0x15')]);router[_0x2d61('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x2d61('0x17')]);module[_0x2d61('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 b7b1beb..5ff6062 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 _0x83e7=['lodash','exports','STRING','name','isObjectLike','setDataValue','formData','stringify','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','BOOLEAN'];(function(_0x10179c,_0x4b1043){var _0xd34609=function(_0x35b2a1){while(--_0x35b2a1){_0x10179c['push'](_0x10179c['shift']());}};_0xd34609(++_0x4b1043);}(_0x83e7,0xb6));var _0x783e=function(_0x24e721,_0x4aec0c){_0x24e721=_0x24e721-0x0;var _0x16434e=_0x83e7[_0x24e721];return _0x16434e;};'use strict';var Sequelize=require('sequelize');var _=require(_0x783e('0x0'));var util=require('util');module[_0x783e('0x1')]={'name':{'type':Sequelize[_0x783e('0x2')],'unique':_0x783e('0x3')},'description':{'type':Sequelize[_0x783e('0x2')]},'formData':{'type':Sequelize['TEXT']('long'),'set':function(_0x7b5e7d){if(_[_0x783e('0x4')](_0x7b5e7d)){this[_0x783e('0x5')](_0x783e('0x6'),JSON[_0x783e('0x7')](_0x7b5e7d));}else if(_[_0x783e('0x8')](_0x7b5e7d)){this[_0x783e('0x5')](_0x783e('0x6'),_0x7b5e7d);}else{this[_0x783e('0x5')](_0x783e('0x6'),util[_0x783e('0x9')](_0x783e('0xa'),this[_0x783e('0xb')](_0x783e('0x3'))||'',this['getDataValue']('description')||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x783e('0xc')],'defaultValue':![]}}; \ No newline at end of file +var _0x0b37=['name','TEXT','long','isObjectLike','setDataValue','formData','isString','getDataValue','description','BOOLEAN','sequelize','util','exports','STRING'];(function(_0x406115,_0x19f7a1){var _0xbbabdb=function(_0x28554d){while(--_0x28554d){_0x406115['push'](_0x406115['shift']());}};_0xbbabdb(++_0x19f7a1);}(_0x0b37,0x106));var _0x70b3=function(_0x1fe6ea,_0x55e5ad){_0x1fe6ea=_0x1fe6ea-0x0;var _0xca0c37=_0x0b37[_0x1fe6ea];return _0xca0c37;};'use strict';var Sequelize=require(_0x70b3('0x0'));var _=require('lodash');var util=require(_0x70b3('0x1'));module[_0x70b3('0x2')]={'name':{'type':Sequelize[_0x70b3('0x3')],'unique':_0x70b3('0x4')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x70b3('0x5')](_0x70b3('0x6')),'set':function(_0x280090){if(_[_0x70b3('0x7')](_0x280090)){this[_0x70b3('0x8')](_0x70b3('0x9'),JSON['stringify'](_0x280090));}else if(_[_0x70b3('0xa')](_0x280090)){this[_0x70b3('0x8')](_0x70b3('0x9'),_0x280090);}else{this['setDataValue'](_0x70b3('0x9'),util['format']('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0x70b3('0xb')](_0x70b3('0x4'))||'',this['getDataValue'](_0x70b3('0xc'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x70b3('0xd')],'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 9aeb070..8b38c38 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 _0x1956=['end','error','stack','name','send','index','map','JscriptyProject','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','limit','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','length','find','catch','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Projects','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','merge','omit','createdAt','updatedAt','role','user','UserProfileSection','getSessions','findOne','nolimit','order','ProjectId','JscriptySessionReport','getAnswers','JscriptyAnswerReport','number','fromCharCode','apply','toString','indexOf','replace','getSummary','startTime','parse','JscriptyQuestionReport','-createdAt','questionId','question','starttime','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','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','status','json','offset','undefined','count','set','Content-Range','reject','save','update','destroy','then','UserProfileResource'];(function(_0x399b24,_0x2d6c6a){var _0x5971c7=function(_0x268fa7){while(--_0x268fa7){_0x399b24['push'](_0x399b24['shift']());}};_0x5971c7(++_0x2d6c6a);}(_0x1956,0x15c));var _0x6195=function(_0x365be9,_0x3c88b9){_0x365be9=_0x365be9-0x0;var _0x185c12=_0x1956[_0x365be9];return _0x185c12;};'use strict';var emlformat=require(_0x6195('0x0'));var rimraf=require(_0x6195('0x1'));var zipdir=require(_0x6195('0x2'));var jsonpatch=require(_0x6195('0x3'));var rp=require(_0x6195('0x4'));var moment=require(_0x6195('0x5'));var BPromise=require(_0x6195('0x6'));var Mustache=require('mustache');var util=require(_0x6195('0x7'));var path=require(_0x6195('0x8'));var sox=require(_0x6195('0x9'));var csv=require(_0x6195('0xa'));var ejs=require(_0x6195('0xb'));var fs=require('fs');var fs_extra=require(_0x6195('0xc'));var _=require(_0x6195('0xd'));var squel=require(_0x6195('0xe'));var crypto=require(_0x6195('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x6195('0x10'));var toCsv=require(_0x6195('0xa'));var querystring=require(_0x6195('0x11'));var Papa=require(_0x6195('0x12'));var Redis=require(_0x6195('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x6195('0x14'));var as=require(_0x6195('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6195('0x16'))(_0x6195('0x17'));var utils=require(_0x6195('0x18'));var config=require(_0x6195('0x19'));var licenseUtil=require(_0x6195('0x1a'));var db=require(_0x6195('0x1b'))['db'];function respondWithStatusCode(_0x1282f5,_0x96b635){_0x96b635=_0x96b635||0xcc;return function(_0x51b975){if(_0x51b975){return _0x1282f5[_0x6195('0x1c')](_0x96b635);}return _0x1282f5[_0x6195('0x1d')](_0x96b635)['end']();};}function respondWithResult(_0x29c5e0,_0x431b3d){_0x431b3d=_0x431b3d||0xc8;return function(_0x5320f7){if(_0x5320f7){return _0x29c5e0[_0x6195('0x1d')](_0x431b3d)[_0x6195('0x1e')](_0x5320f7);}};}function respondWithFilteredResult(_0x1af54a,_0x397370){return function(_0x6653b7){if(_0x6653b7){var _0x1a555f=typeof _0x397370[_0x6195('0x1f')]===_0x6195('0x20')&&typeof _0x397370['limit']==='undefined';var _0x21bf76=_0x6653b7[_0x6195('0x21')];var _0x6174a3=_0x1a555f?0x0:_0x397370[_0x6195('0x1f')];var _0x3b42a0=_0x1a555f?_0x6653b7['count']:_0x397370[_0x6195('0x1f')]+_0x397370['limit'];var _0x40134d;if(_0x3b42a0>=_0x21bf76){_0x3b42a0=_0x21bf76;_0x40134d=0xc8;}else{_0x40134d=0xce;}_0x1af54a[_0x6195('0x1d')](_0x40134d);return _0x1af54a[_0x6195('0x22')](_0x6195('0x23'),_0x6174a3+'-'+_0x3b42a0+'/'+_0x21bf76)[_0x6195('0x1e')](_0x6653b7);}return null;};}function patchUpdates(_0x4e9673){return function(_0x4cadf3){try{jsonpatch['apply'](_0x4cadf3,_0x4e9673,!![]);}catch(_0x5595e0){return BPromise[_0x6195('0x24')](_0x5595e0);}return _0x4cadf3[_0x6195('0x25')]();};}function saveUpdates(_0xc1e5d9,_0x4f2d43){return function(_0x5bed95){if(_0x5bed95){return _0x5bed95[_0x6195('0x26')](_0xc1e5d9)['then'](function(_0x4181f3){return _0x4181f3;});}return null;};}function removeEntity(_0x11cc46,_0x184080){return function(_0x5dbe2c){if(_0x5dbe2c){return _0x5dbe2c[_0x6195('0x27')]()[_0x6195('0x28')](function(){var _0xd03b87=_0x5dbe2c['get']({'plain':!![]});var _0x5b83dc='Projects';return db[_0x6195('0x29')][_0x6195('0x27')]({'where':{'type':_0x5b83dc,'resourceId':_0xd03b87['id']}})[_0x6195('0x28')](function(){return _0x5dbe2c;});})[_0x6195('0x28')](function(){_0x11cc46[_0x6195('0x1d')](0xcc)[_0x6195('0x2a')]();});}};}function handleEntityNotFound(_0x251e21,_0x25a227){return function(_0x44c5ef){if(!_0x44c5ef){_0x251e21[_0x6195('0x1c')](0x194);}return _0x44c5ef;};}function handleError(_0x566e1e,_0x20c3e2){_0x20c3e2=_0x20c3e2||0x1f4;return function(_0x5af2af){logger[_0x6195('0x2b')](_0x5af2af[_0x6195('0x2c')]);if(_0x5af2af[_0x6195('0x2d')]){delete _0x5af2af[_0x6195('0x2d')];}_0x566e1e[_0x6195('0x1d')](_0x20c3e2)[_0x6195('0x2e')](_0x5af2af);};}exports[_0x6195('0x2f')]=function(_0x208c93,_0x217ac1){var _0x3839fd={},_0x21d93c={},_0x52d3ff={'count':0x0,'rows':[]};var _0x611d5=_[_0x6195('0x30')](db[_0x6195('0x31')][_0x6195('0x32')],function(_0x559e31){return{'name':_0x559e31[_0x6195('0x33')],'type':_0x559e31['type'][_0x6195('0x34')]};});_0x21d93c[_0x6195('0x35')]=_['map'](_0x611d5,_0x6195('0x2d'));_0x21d93c[_0x6195('0x36')]=_['keys'](_0x208c93[_0x6195('0x36')]);_0x21d93c[_0x6195('0x37')]=_[_0x6195('0x38')](_0x21d93c[_0x6195('0x35')],_0x21d93c[_0x6195('0x36')]);_0x3839fd[_0x6195('0x39')]=_[_0x6195('0x38')](_0x21d93c[_0x6195('0x35')],qs[_0x6195('0x3a')](_0x208c93['query'][_0x6195('0x3a')]));_0x3839fd[_0x6195('0x39')]=_0x3839fd[_0x6195('0x39')]['length']?_0x3839fd[_0x6195('0x39')]:_0x21d93c[_0x6195('0x35')];if(!_0x208c93[_0x6195('0x36')][_0x6195('0x3b')]('nolimit')){_0x3839fd[_0x6195('0x3c')]=qs[_0x6195('0x3c')](_0x208c93[_0x6195('0x36')][_0x6195('0x3c')]);_0x3839fd['offset']=qs['offset'](_0x208c93[_0x6195('0x36')][_0x6195('0x1f')]);}_0x3839fd['order']=qs[_0x6195('0x3d')](_0x208c93[_0x6195('0x36')]['sort']);_0x3839fd[_0x6195('0x3e')]=qs[_0x6195('0x37')](_[_0x6195('0x3f')](_0x208c93[_0x6195('0x36')],_0x21d93c[_0x6195('0x37')]),_0x611d5);if(_0x208c93[_0x6195('0x36')][_0x6195('0x40')]){_0x3839fd[_0x6195('0x3e')]=_['merge'](_0x3839fd[_0x6195('0x3e')],{'$or':_[_0x6195('0x30')](_0x611d5,function(_0x3f9e43){if(_0x3f9e43['type']!==_0x6195('0x41')){var _0x2a871f={};_0x2a871f[_0x3f9e43[_0x6195('0x2d')]]={'$like':'%'+_0x208c93[_0x6195('0x36')][_0x6195('0x40')]+'%'};return _0x2a871f;}})});}_0x3839fd=_['merge']({},_0x3839fd,_0x208c93[_0x6195('0x42')]);var _0xbcbc4b={'where':_0x3839fd[_0x6195('0x3e')]};return db[_0x6195('0x31')][_0x6195('0x21')](_0xbcbc4b)[_0x6195('0x28')](function(_0x353a65){_0x52d3ff[_0x6195('0x21')]=_0x353a65;if(_0x208c93[_0x6195('0x36')][_0x6195('0x43')]){_0x3839fd[_0x6195('0x44')]=[{'all':!![]}];}return db['JscriptyProject'][_0x6195('0x45')](_0x3839fd);})[_0x6195('0x28')](function(_0x45a188){_0x52d3ff[_0x6195('0x46')]=_0x45a188;return _0x52d3ff;})[_0x6195('0x28')](respondWithFilteredResult(_0x217ac1,_0x3839fd))['catch'](handleError(_0x217ac1,null));};exports[_0x6195('0x47')]=function(_0x1bc105,_0x45e392){var _0x11b900={'raw':![],'where':{'id':_0x1bc105[_0x6195('0x48')]['id']}},_0x35bd25={};_0x35bd25[_0x6195('0x35')]=_[_0x6195('0x49')](db['JscriptyProject'][_0x6195('0x32')]);_0x35bd25[_0x6195('0x36')]=_[_0x6195('0x49')](_0x1bc105[_0x6195('0x36')]);_0x35bd25[_0x6195('0x37')]=_[_0x6195('0x38')](_0x35bd25['model'],_0x35bd25[_0x6195('0x36')]);_0x11b900[_0x6195('0x39')]=_[_0x6195('0x38')](_0x35bd25[_0x6195('0x35')],qs[_0x6195('0x3a')](_0x1bc105[_0x6195('0x36')][_0x6195('0x3a')]));_0x11b900['attributes']=_0x11b900[_0x6195('0x39')][_0x6195('0x4a')]?_0x11b900[_0x6195('0x39')]:_0x35bd25[_0x6195('0x35')];if(_0x1bc105['query']['includeAll']){_0x11b900[_0x6195('0x44')]=[{'all':!![]}];}_0x11b900=_['merge']({},_0x11b900,_0x1bc105[_0x6195('0x42')]);return db[_0x6195('0x31')][_0x6195('0x4b')](_0x11b900)[_0x6195('0x28')](handleEntityNotFound(_0x45e392,null))['then'](respondWithResult(_0x45e392,null))[_0x6195('0x4c')](handleError(_0x45e392,null));};exports[_0x6195('0x4d')]=function(_0x3feac1,_0x1ea3e7){return db['JscriptyProject'][_0x6195('0x4d')](_0x3feac1[_0x6195('0x4e')],{})['then'](function(_0x4aec1e){var _0x3da422=_0x3feac1['user'][_0x6195('0x4f')]({'plain':!![]});if(!_0x3da422)throw new Error(_0x6195('0x50'));if(_0x3da422['role']==='user'){var _0x589bad=_0x4aec1e[_0x6195('0x4f')]({'plain':!![]});var _0x2a686a=_0x6195('0x51');return db['UserProfileSection'][_0x6195('0x4b')]({'where':{'name':_0x2a686a,'userProfileId':_0x3da422[_0x6195('0x52')]},'raw':!![]})['then'](function(_0x8cf212){if(_0x8cf212&&_0x8cf212[_0x6195('0x53')]===0x0){return db[_0x6195('0x29')][_0x6195('0x4d')]({'name':_0x589bad[_0x6195('0x2d')],'resourceId':_0x589bad['id'],'type':_0x8cf212[_0x6195('0x2d')],'sectionId':_0x8cf212['id']},{})[_0x6195('0x28')](function(){return _0x4aec1e;});}else{return _0x4aec1e;}})[_0x6195('0x4c')](function(_0x5842c0){logger[_0x6195('0x2b')](_0x6195('0x54'),_0x5842c0);throw _0x5842c0;});}return _0x4aec1e;})['then'](respondWithResult(_0x1ea3e7,0xc9))[_0x6195('0x4c')](handleError(_0x1ea3e7,null));};exports[_0x6195('0x55')]=function(_0x5c23ab,_0x20defd){var _0x460983={'where':{'id':_0x5c23ab[_0x6195('0x48')]['id']}},_0x4f536b={};_0x4f536b[_0x6195('0x35')]=_['keys'](db[_0x6195('0x31')][_0x6195('0x32')]);_0x460983[_0x6195('0x39')]=_[_0x6195('0x38')](_0x4f536b[_0x6195('0x35')],qs[_0x6195('0x3a')](_0x5c23ab[_0x6195('0x36')][_0x6195('0x3a')]));_0x460983[_0x6195('0x39')]=_0x460983[_0x6195('0x39')]['length']?_0x460983['attributes']:_0x4f536b[_0x6195('0x35')];if(_0x5c23ab[_0x6195('0x36')][_0x6195('0x43')]){_0x460983[_0x6195('0x44')]=[{'all':!![]}];}_0x460983=_[_0x6195('0x56')]({},_0x460983,_0x5c23ab[_0x6195('0x42')]);return db['JscriptyProject'][_0x6195('0x4b')](_0x460983)[_0x6195('0x28')](handleEntityNotFound(_0x20defd,null))[_0x6195('0x28')](function(_0x21b444){if(_0x21b444){var _0x532aaa=_0x21b444[_0x6195('0x4f')]({'plain':!![]});_0x532aaa=qs[_0x6195('0x57')](_0x532aaa,['id',_0x6195('0x58'),_0x6195('0x59')]);_0x5c23ab[_0x6195('0x4e')]=_['omit'](_0x5c23ab['body'],['id',_0x6195('0x58'),_0x6195('0x59')]);return db[_0x6195('0x31')][_0x6195('0x4d')](_[_0x6195('0x56')](_0x532aaa,_0x5c23ab[_0x6195('0x4e')]),{'include':_0x5c23ab[_0x6195('0x36')][_0x6195('0x43')]?[{'all':!![]}]:undefined})[_0x6195('0x28')](function(_0x1f7988){var _0x440696=_0x5c23ab['user'][_0x6195('0x4f')]({'plain':!![]});if(!_0x440696)throw new Error(_0x6195('0x50'));if(_0x440696[_0x6195('0x5a')]===_0x6195('0x5b')){var _0x1ef3e4=_0x1f7988[_0x6195('0x4f')]({'plain':!![]});var _0x17aece=_0x6195('0x51');return db[_0x6195('0x5c')][_0x6195('0x4b')]({'where':{'name':_0x17aece,'userProfileId':_0x440696[_0x6195('0x52')]},'raw':!![]})[_0x6195('0x28')](function(_0x187c98){if(_0x187c98&&_0x187c98[_0x6195('0x53')]===0x0){return db[_0x6195('0x29')]['create']({'name':_0x1ef3e4[_0x6195('0x2d')],'resourceId':_0x1ef3e4['id'],'type':_0x187c98[_0x6195('0x2d')],'sectionId':_0x187c98['id']},{})[_0x6195('0x28')](function(){return _0x1f7988;});}else{return _0x1f7988;}})[_0x6195('0x4c')](function(_0x10f978){logger[_0x6195('0x2b')](_0x6195('0x54'),_0x10f978);throw _0x10f978;});}return _0x1f7988;});}})['then'](respondWithResult(_0x20defd,0xc9))[_0x6195('0x4c')](handleError(_0x20defd,null));};exports[_0x6195('0x26')]=function(_0x3e6c67,_0x3494ee){if(_0x3e6c67[_0x6195('0x4e')]['id']){delete _0x3e6c67[_0x6195('0x4e')]['id'];}return db[_0x6195('0x31')][_0x6195('0x4b')]({'where':{'id':_0x3e6c67['params']['id']}})['then'](handleEntityNotFound(_0x3494ee,null))[_0x6195('0x28')](saveUpdates(_0x3e6c67[_0x6195('0x4e')],null))[_0x6195('0x28')](respondWithResult(_0x3494ee,null))[_0x6195('0x4c')](handleError(_0x3494ee,null));};exports[_0x6195('0x27')]=function(_0x36f5a4,_0x50d603){return db[_0x6195('0x31')][_0x6195('0x4b')]({'where':{'id':_0x36f5a4[_0x6195('0x48')]['id']}})['then'](handleEntityNotFound(_0x50d603,null))['then'](removeEntity(_0x50d603,null))[_0x6195('0x4c')](handleError(_0x50d603,null));};exports[_0x6195('0x5d')]=function(_0x691505,_0x3ecfba,_0x1bc14a){var _0x2d7dfa={'raw':!![],'where':{}};var _0x2e2f06={};var _0x393964={'count':0x0,'rows':[]};return db[_0x6195('0x31')][_0x6195('0x5e')]({'where':{'id':_0x691505['params']['id']}})[_0x6195('0x28')](handleEntityNotFound(_0x3ecfba,null))[_0x6195('0x28')](function(_0x31cb77){if(_0x31cb77){_0x2e2f06['model']=_[_0x6195('0x49')](db['JscriptySessionReport']['rawAttributes']);_0x2e2f06[_0x6195('0x36')]=_[_0x6195('0x49')](_0x691505[_0x6195('0x36')]);_0x2e2f06[_0x6195('0x37')]=_[_0x6195('0x38')](_0x2e2f06[_0x6195('0x35')],_0x2e2f06[_0x6195('0x36')]);_0x2d7dfa['attributes']=_[_0x6195('0x38')](_0x2e2f06[_0x6195('0x35')],qs['fields'](_0x691505[_0x6195('0x36')][_0x6195('0x3a')]));_0x2d7dfa[_0x6195('0x39')]=_0x2d7dfa[_0x6195('0x39')]['length']?_0x2d7dfa[_0x6195('0x39')]:_0x2e2f06[_0x6195('0x35')];if(!_0x691505[_0x6195('0x36')]['hasOwnProperty'](_0x6195('0x5f'))){_0x2d7dfa[_0x6195('0x3c')]=qs[_0x6195('0x3c')](_0x691505[_0x6195('0x36')][_0x6195('0x3c')]);_0x2d7dfa[_0x6195('0x1f')]=qs[_0x6195('0x1f')](_0x691505['query'][_0x6195('0x1f')]);}_0x2d7dfa[_0x6195('0x60')]=qs[_0x6195('0x3d')](_0x691505['query'][_0x6195('0x3d')]);_0x2d7dfa[_0x6195('0x3e')]=qs['filters'](_['pick'](_0x691505[_0x6195('0x36')],_0x2e2f06[_0x6195('0x37')]));_0x2d7dfa[_0x6195('0x3e')][_0x6195('0x61')]=_0x31cb77['id'];if(_0x691505[_0x6195('0x36')][_0x6195('0x40')]){_0x2d7dfa['where']=_['merge'](_0x2d7dfa[_0x6195('0x3e')],{'$or':_['map'](_0x2d7dfa[_0x6195('0x39')],function(_0x3533de){var _0x23e8ee={};_0x23e8ee[_0x3533de]={'$like':'%'+_0x691505[_0x6195('0x36')][_0x6195('0x40')]+'%'};return _0x23e8ee;})});}_0x2d7dfa=_[_0x6195('0x56')]({},_0x2d7dfa,_0x691505[_0x6195('0x42')]);return db[_0x6195('0x62')][_0x6195('0x21')]({'where':_0x2d7dfa[_0x6195('0x3e')]})[_0x6195('0x28')](function(_0x16576c){_0x393964[_0x6195('0x21')]=_0x16576c;if(_0x691505[_0x6195('0x36')][_0x6195('0x43')]){_0x2d7dfa['include']=[{'all':!![]}];}return db[_0x6195('0x62')][_0x6195('0x45')](_0x2d7dfa);})[_0x6195('0x28')](function(_0x195ba1){_0x393964[_0x6195('0x46')]=_0x195ba1;return _0x393964;});}})[_0x6195('0x28')](respondWithFilteredResult(_0x3ecfba,_0x2d7dfa))[_0x6195('0x4c')](handleError(_0x3ecfba,null));};exports[_0x6195('0x63')]=function(_0x58a03a,_0xe517be,_0xbc1944){var _0x5a809a={'raw':!![],'where':{}};var _0xeb2f6a={};var _0x46316a={'count':0x0,'rows':[]};return db[_0x6195('0x31')][_0x6195('0x5e')]({'where':{'id':_0x58a03a[_0x6195('0x48')]['id']}})[_0x6195('0x28')](handleEntityNotFound(_0xe517be,null))['then'](function(_0x40c727){if(_0x40c727){_0xeb2f6a[_0x6195('0x35')]=_[_0x6195('0x49')](db[_0x6195('0x64')][_0x6195('0x32')]);_0xeb2f6a[_0x6195('0x36')]=_[_0x6195('0x49')](_0x58a03a[_0x6195('0x36')]);_0xeb2f6a['filters']=_['intersection'](_0xeb2f6a[_0x6195('0x35')],_0xeb2f6a[_0x6195('0x36')]);_0x5a809a['attributes']=_[_0x6195('0x38')](_0xeb2f6a['model'],qs[_0x6195('0x3a')](_0x58a03a[_0x6195('0x36')][_0x6195('0x3a')]));_0x5a809a[_0x6195('0x39')]=_0x5a809a[_0x6195('0x39')]['length']?_0x5a809a[_0x6195('0x39')]:_0xeb2f6a[_0x6195('0x35')];if(!_0x58a03a[_0x6195('0x36')][_0x6195('0x3b')]('nolimit')){_0x5a809a[_0x6195('0x3c')]=qs[_0x6195('0x3c')](_0x58a03a[_0x6195('0x36')][_0x6195('0x3c')]);_0x5a809a[_0x6195('0x1f')]=qs[_0x6195('0x1f')](_0x58a03a[_0x6195('0x36')]['offset']);}_0x5a809a[_0x6195('0x60')]=qs[_0x6195('0x3d')](_0x58a03a[_0x6195('0x36')][_0x6195('0x3d')]);_0x5a809a['where']=qs[_0x6195('0x37')](_[_0x6195('0x3f')](_0x58a03a[_0x6195('0x36')],_0xeb2f6a['filters']));_0x5a809a[_0x6195('0x3e')][_0x6195('0x61')]=_0x40c727['id'];if(_0x58a03a[_0x6195('0x36')][_0x6195('0x40')]){_0x5a809a[_0x6195('0x3e')]=_['merge'](_0x5a809a[_0x6195('0x3e')],{'$or':_[_0x6195('0x30')](_0x5a809a[_0x6195('0x39')],function(_0x1e978a){var _0x4074c3={};_0x4074c3[_0x1e978a]={'$like':'%'+_0x58a03a['query'][_0x6195('0x40')]+'%'};return _0x4074c3;})});}_0x5a809a=_[_0x6195('0x56')]({},_0x5a809a,_0x58a03a[_0x6195('0x42')]);return db[_0x6195('0x64')]['count']({'where':_0x5a809a[_0x6195('0x3e')]})[_0x6195('0x28')](function(_0x38b8bd){_0x46316a[_0x6195('0x21')]=_0x38b8bd;if(_0x58a03a[_0x6195('0x36')][_0x6195('0x43')]){_0x5a809a[_0x6195('0x44')]=[{'all':!![]}];}return db[_0x6195('0x64')]['findAll'](_0x5a809a);})[_0x6195('0x28')](function(_0x436dd3){_0x46316a[_0x6195('0x46')]=_0x436dd3;return _0x46316a;});}})[_0x6195('0x28')](respondWithFilteredResult(_0xe517be,_0x5a809a))['catch'](handleError(_0xe517be,null));};function char(_0x4edab3){return _0x6195('0x65')===typeof _0x4edab3?String[_0x6195('0x66')][_0x6195('0x67')](null,arguments):_0x4edab3;}function needsEncapsulation(_0x4c5cda){return!!_0x4c5cda&&(_0x4c5cda[_0x6195('0x68')]()['indexOf'](char(0xd))>=0x0||_0x4c5cda[_0x6195('0x68')]()[_0x6195('0x69')](char(0xa))>=0x0||_0x4c5cda[_0x6195('0x68')]()[_0x6195('0x69')](char(0x2c))>=0x0||_0x4c5cda[_0x6195('0x68')]()[_0x6195('0x69')](char(0x22))>=0x0);}function encapsulate(_0x4dd628){var _0x3f0c69=char(0x22),_0x582fe4='\x5c'+char(0x22),_0x91e220=_0x4dd628[_0x6195('0x68')]()[_0x6195('0x6a')](new RegExp(_0x3f0c69,'g'),_0x582fe4);return _0x3f0c69+_0x91e220+_0x3f0c69;}exports[_0x6195('0x6b')]=function(_0x20af35,_0x343275,_0x41a3d4){var _0x45363b,_0x19d6f5;var _0x600032={'where':{'ProjectId':_0x20af35[_0x6195('0x48')]['id']}};if(_0x20af35[_0x6195('0x36')][_0x6195('0x6c')]){_0x600032[_0x6195('0x3e')]['starttime']=JSON[_0x6195('0x6d')](_0x20af35[_0x6195('0x36')][_0x6195('0x6c')]);}return db[_0x6195('0x62')][_0x6195('0x45')](_0x600032)[_0x6195('0x28')](handleEntityNotFound(_0x343275,null))['then'](function(_0x282f48){if(_0x282f48){_0x45363b=_0x282f48;return db[_0x6195('0x6e')][_0x6195('0x45')]({'where':{'SessionId':{'$in':_[_0x6195('0x30')](_0x45363b,'id')},'ProjectId':_0x20af35['params']['id']},'order':_0x6195('0x6f')});}})[_0x6195('0x28')](handleEntityNotFound(_0x343275,null))[_0x6195('0x28')](function(_0x34b4e8){if(_0x34b4e8){_0x19d6f5=_0x34b4e8;var _0x4f27da={};for(var _0x38ba43=0x0,_0x12c3ee=_0x19d6f5['length'];_0x38ba43<_0x12c3ee;_0x38ba43++){if(!_0x4f27da[_0x6195('0x3b')](_0x19d6f5[_0x38ba43][_0x6195('0x70')])){_0x4f27da[_0x19d6f5[_0x38ba43][_0x6195('0x70')]]=needsEncapsulation(_0x19d6f5[_0x38ba43][_0x6195('0x71')])?encapsulate(_0x19d6f5[_0x38ba43][_0x6195('0x71')]):_0x19d6f5[_0x38ba43]['question'];}}var _0x825885=[],_0x56d2b7={};for(var _0x39f1c1=0x0,_0x5540f3=_0x45363b[_0x6195('0x4a')];_0x39f1c1<_0x5540f3;_0x39f1c1++){_0x56d2b7={'ProjectId':_0x20af35['params']['id'],'SessionId':_0x45363b[_0x39f1c1]['id'],'StartTime':moment(_0x45363b[_0x39f1c1][_0x6195('0x72')])[_0x6195('0x73')](_0x6195('0x74'))};for(var _0x3200f7=0x0,_0x401bdb=_0x19d6f5[_0x6195('0x4a')];_0x3200f7<_0x401bdb;_0x3200f7++){if(_0x19d6f5[_0x3200f7][_0x6195('0x75')]==_0x45363b[_0x39f1c1]['id']&&_0x4f27da[_0x6195('0x3b')](_0x19d6f5[_0x3200f7][_0x6195('0x70')])){_0x56d2b7[_0x4f27da[_0x19d6f5[_0x3200f7][_0x6195('0x70')]]]=_0x19d6f5[_0x3200f7][_0x6195('0x76')];}}for(var _0x50f16b in _0x4f27da){if(!_0x56d2b7[_0x6195('0x3b')](_0x4f27da[_0x50f16b])){_0x56d2b7[_0x4f27da[_0x50f16b]]=null;}}_0x825885[_0x6195('0x77')](_0x56d2b7);}return _0x825885;}})[_0x6195('0x28')](function(_0x457125){if(!_[_0x6195('0x78')](_0x457125)){var _0x332219=toCsv(_0x457125);var _0x2cbacd=Date['now']();fs[_0x6195('0x79')](util[_0x6195('0x73')](_0x6195('0x7a'),_0x20af35[_0x6195('0x48')]['id'],_0x2cbacd),_0x332219);_0x343275[_0x6195('0x7b')](_0x6195('0x7c'),_0x6195('0x7d')+util['format'](_0x6195('0x7e'),_0x20af35[_0x6195('0x48')]['id'],_0x2cbacd));_0x343275[_0x6195('0x7b')](_0x6195('0x7f'),_0x6195('0x80'));return _0x343275[_0x6195('0x81')](util[_0x6195('0x73')](_0x6195('0x7a'),_0x20af35[_0x6195('0x48')]['id'],_0x2cbacd));}else{return _0x343275[_0x6195('0x1c')](0xcc);}})[_0x6195('0x4c')](handleError(_0x343275,null));}; \ No newline at end of file +var _0x5453=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','createdAt','UserProfileSection','error','getSessions','JscriptySessionReport','ProjectId','getAnswers','findOne','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','getSummary','startTime','JscriptyQuestionReport','questionId','question','starttime','YYYY-MM-DD\x20HH:mm:ss','answer','push','now','writeFileSync','format','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','Jscripty_Project_%d_Summary_%s.csv','Content-type','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','lodash','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','../../mysqldb','status','end','json','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','get','Projects','UserProfileResource','sendStatus','index','map','JscriptyProject','rawAttributes','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','create','body','user'];(function(_0x1c3908,_0x16fbf2){var _0x4fb792=function(_0x48233f){while(--_0x48233f){_0x1c3908['push'](_0x1c3908['shift']());}};_0x4fb792(++_0x16fbf2);}(_0x5453,0x18b));var _0x3545=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x5453[_0x27af45];return _0x18df21;};'use strict';var emlformat=require(_0x3545('0x0'));var rimraf=require(_0x3545('0x1'));var zipdir=require(_0x3545('0x2'));var jsonpatch=require(_0x3545('0x3'));var rp=require(_0x3545('0x4'));var moment=require(_0x3545('0x5'));var BPromise=require(_0x3545('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3545('0x7'));var sox=require(_0x3545('0x8'));var csv=require('to-csv');var ejs=require(_0x3545('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3545('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3545('0xb'));var deskjs=require(_0x3545('0xc'));var toCsv=require(_0x3545('0xd'));var querystring=require('querystring');var Papa=require(_0x3545('0xe'));var Redis=require(_0x3545('0xf'));var authService=require(_0x3545('0x10'));var qs=require(_0x3545('0x11'));var as=require(_0x3545('0x12'));var hardwareService=require(_0x3545('0x13'));var logger=require(_0x3545('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x3545('0x15'));var licenseUtil=require(_0x3545('0x16'));var db=require(_0x3545('0x17'))['db'];function respondWithStatusCode(_0x3de48b,_0x54fcf4){_0x54fcf4=_0x54fcf4||0xcc;return function(_0x4b9316){if(_0x4b9316){return _0x3de48b['sendStatus'](_0x54fcf4);}return _0x3de48b[_0x3545('0x18')](_0x54fcf4)[_0x3545('0x19')]();};}function respondWithResult(_0x5ddba6,_0x427f72){_0x427f72=_0x427f72||0xc8;return function(_0x5b5474){if(_0x5b5474){return _0x5ddba6['status'](_0x427f72)[_0x3545('0x1a')](_0x5b5474);}};}function respondWithFilteredResult(_0x1a4a55,_0x569ebd){return function(_0x29921b){if(_0x29921b){var _0x1717f6=typeof _0x569ebd['offset']===_0x3545('0x1b')&&typeof _0x569ebd['limit']===_0x3545('0x1b');var _0x16e2f8=_0x29921b[_0x3545('0x1c')];var _0x2c008a=_0x1717f6?0x0:_0x569ebd['offset'];var _0x573970=_0x1717f6?_0x29921b[_0x3545('0x1c')]:_0x569ebd['offset']+_0x569ebd[_0x3545('0x1d')];var _0x21c623;if(_0x573970>=_0x16e2f8){_0x573970=_0x16e2f8;_0x21c623=0xc8;}else{_0x21c623=0xce;}_0x1a4a55[_0x3545('0x18')](_0x21c623);return _0x1a4a55[_0x3545('0x1e')](_0x3545('0x1f'),_0x2c008a+'-'+_0x573970+'/'+_0x16e2f8)[_0x3545('0x1a')](_0x29921b);}return null;};}function patchUpdates(_0x10037f){return function(_0x365bc3){try{jsonpatch[_0x3545('0x20')](_0x365bc3,_0x10037f,!![]);}catch(_0x329228){return BPromise[_0x3545('0x21')](_0x329228);}return _0x365bc3['save']();};}function saveUpdates(_0x57de12,_0x20800f){return function(_0x580791){if(_0x580791){return _0x580791[_0x3545('0x22')](_0x57de12)[_0x3545('0x23')](function(_0x5bd498){return _0x5bd498;});}return null;};}function removeEntity(_0x473c00,_0x528b30){return function(_0x5de099){if(_0x5de099){return _0x5de099[_0x3545('0x24')]()[_0x3545('0x23')](function(){var _0x5bb284=_0x5de099[_0x3545('0x25')]({'plain':!![]});var _0x21c4e5=_0x3545('0x26');return db[_0x3545('0x27')][_0x3545('0x24')]({'where':{'type':_0x21c4e5,'resourceId':_0x5bb284['id']}})[_0x3545('0x23')](function(){return _0x5de099;});})['then'](function(){_0x473c00[_0x3545('0x18')](0xcc)[_0x3545('0x19')]();});}};}function handleEntityNotFound(_0x1cc167,_0xeea892){return function(_0x864712){if(!_0x864712){_0x1cc167[_0x3545('0x28')](0x194);}return _0x864712;};}function handleError(_0x3535e6,_0x5360df){_0x5360df=_0x5360df||0x1f4;return function(_0x46450f){logger['error'](_0x46450f['stack']);if(_0x46450f['name']){delete _0x46450f['name'];}_0x3535e6[_0x3545('0x18')](_0x5360df)['send'](_0x46450f);};}exports[_0x3545('0x29')]=function(_0x900e88,_0x341ad3){var _0x2f6057={},_0x3d78a9={},_0x77931f={'count':0x0,'rows':[]};var _0x2fb95f=_[_0x3545('0x2a')](db[_0x3545('0x2b')][_0x3545('0x2c')],function(_0x1277a8){return{'name':_0x1277a8['fieldName'],'type':_0x1277a8['type'][_0x3545('0x2d')]};});_0x3d78a9[_0x3545('0x2e')]=_['map'](_0x2fb95f,_0x3545('0x2f'));_0x3d78a9[_0x3545('0x30')]=_[_0x3545('0x31')](_0x900e88[_0x3545('0x30')]);_0x3d78a9[_0x3545('0x32')]=_[_0x3545('0x33')](_0x3d78a9[_0x3545('0x2e')],_0x3d78a9[_0x3545('0x30')]);_0x2f6057[_0x3545('0x34')]=_[_0x3545('0x33')](_0x3d78a9['model'],qs[_0x3545('0x35')](_0x900e88[_0x3545('0x30')][_0x3545('0x35')]));_0x2f6057[_0x3545('0x34')]=_0x2f6057[_0x3545('0x34')][_0x3545('0x36')]?_0x2f6057['attributes']:_0x3d78a9['model'];if(!_0x900e88[_0x3545('0x30')][_0x3545('0x37')](_0x3545('0x38'))){_0x2f6057[_0x3545('0x1d')]=qs[_0x3545('0x1d')](_0x900e88[_0x3545('0x30')]['limit']);_0x2f6057[_0x3545('0x39')]=qs['offset'](_0x900e88['query']['offset']);}_0x2f6057[_0x3545('0x3a')]=qs[_0x3545('0x3b')](_0x900e88['query'][_0x3545('0x3b')]);_0x2f6057[_0x3545('0x3c')]=qs[_0x3545('0x32')](_[_0x3545('0x3d')](_0x900e88[_0x3545('0x30')],_0x3d78a9[_0x3545('0x32')]),_0x2fb95f);if(_0x900e88[_0x3545('0x30')][_0x3545('0x3e')]){_0x2f6057['where']=_[_0x3545('0x3f')](_0x2f6057[_0x3545('0x3c')],{'$or':_[_0x3545('0x2a')](_0x2fb95f,function(_0x2ec932){if(_0x2ec932[_0x3545('0x40')]!==_0x3545('0x41')){var _0x51a06a={};_0x51a06a[_0x2ec932['name']]={'$like':'%'+_0x900e88[_0x3545('0x30')][_0x3545('0x3e')]+'%'};return _0x51a06a;}})});}_0x2f6057=_[_0x3545('0x3f')]({},_0x2f6057,_0x900e88[_0x3545('0x42')]);var _0x2f13b8={'where':_0x2f6057['where']};return db[_0x3545('0x2b')][_0x3545('0x1c')](_0x2f13b8)[_0x3545('0x23')](function(_0x4d5469){_0x77931f[_0x3545('0x1c')]=_0x4d5469;if(_0x900e88[_0x3545('0x30')]['includeAll']){_0x2f6057[_0x3545('0x43')]=[{'all':!![]}];}return db[_0x3545('0x2b')][_0x3545('0x44')](_0x2f6057);})['then'](function(_0xee3a73){_0x77931f[_0x3545('0x45')]=_0xee3a73;return _0x77931f;})[_0x3545('0x23')](respondWithFilteredResult(_0x341ad3,_0x2f6057))[_0x3545('0x46')](handleError(_0x341ad3,null));};exports[_0x3545('0x47')]=function(_0x44af9d,_0x530854){var _0x505898={'raw':![],'where':{'id':_0x44af9d[_0x3545('0x48')]['id']}},_0x5c9303={};_0x5c9303[_0x3545('0x2e')]=_[_0x3545('0x31')](db[_0x3545('0x2b')]['rawAttributes']);_0x5c9303[_0x3545('0x30')]=_[_0x3545('0x31')](_0x44af9d[_0x3545('0x30')]);_0x5c9303[_0x3545('0x32')]=_[_0x3545('0x33')](_0x5c9303[_0x3545('0x2e')],_0x5c9303[_0x3545('0x30')]);_0x505898[_0x3545('0x34')]=_[_0x3545('0x33')](_0x5c9303['model'],qs['fields'](_0x44af9d[_0x3545('0x30')]['fields']));_0x505898[_0x3545('0x34')]=_0x505898[_0x3545('0x34')]['length']?_0x505898[_0x3545('0x34')]:_0x5c9303[_0x3545('0x2e')];if(_0x44af9d[_0x3545('0x30')][_0x3545('0x49')]){_0x505898['include']=[{'all':!![]}];}_0x505898=_['merge']({},_0x505898,_0x44af9d[_0x3545('0x42')]);return db[_0x3545('0x2b')]['find'](_0x505898)[_0x3545('0x23')](handleEntityNotFound(_0x530854,null))['then'](respondWithResult(_0x530854,null))[_0x3545('0x46')](handleError(_0x530854,null));};exports[_0x3545('0x4a')]=function(_0x5f4e9c,_0x3350a9){return db['JscriptyProject'][_0x3545('0x4a')](_0x5f4e9c[_0x3545('0x4b')],{})[_0x3545('0x23')](function(_0x181301){var _0x24ee85=_0x5f4e9c[_0x3545('0x4c')][_0x3545('0x25')]({'plain':!![]});if(!_0x24ee85)throw new Error(_0x3545('0x4d'));if(_0x24ee85[_0x3545('0x4e')]==='user'){var _0x1e16c1=_0x181301['get']({'plain':!![]});var _0x309c3b='Projects';return db['UserProfileSection'][_0x3545('0x4f')]({'where':{'name':_0x309c3b,'userProfileId':_0x24ee85[_0x3545('0x50')]},'raw':!![]})[_0x3545('0x23')](function(_0x278b8e){if(_0x278b8e&&_0x278b8e[_0x3545('0x51')]===0x0){return db[_0x3545('0x27')][_0x3545('0x4a')]({'name':_0x1e16c1[_0x3545('0x2f')],'resourceId':_0x1e16c1['id'],'type':_0x278b8e[_0x3545('0x2f')],'sectionId':_0x278b8e['id']},{})[_0x3545('0x23')](function(){return _0x181301;});}else{return _0x181301;}})['catch'](function(_0x2e506b){logger['error'](_0x3545('0x52'),_0x2e506b);throw _0x2e506b;});}return _0x181301;})[_0x3545('0x23')](respondWithResult(_0x3350a9,0xc9))[_0x3545('0x46')](handleError(_0x3350a9,null));};exports[_0x3545('0x53')]=function(_0x3db67c,_0x5d3ed2){var _0x557a73={'where':{'id':_0x3db67c[_0x3545('0x48')]['id']}},_0x2416a8={};_0x2416a8[_0x3545('0x2e')]=_[_0x3545('0x31')](db['JscriptyProject'][_0x3545('0x2c')]);_0x557a73[_0x3545('0x34')]=_['intersection'](_0x2416a8[_0x3545('0x2e')],qs['fields'](_0x3db67c[_0x3545('0x30')]['fields']));_0x557a73['attributes']=_0x557a73[_0x3545('0x34')][_0x3545('0x36')]?_0x557a73[_0x3545('0x34')]:_0x2416a8[_0x3545('0x2e')];if(_0x3db67c[_0x3545('0x30')][_0x3545('0x49')]){_0x557a73[_0x3545('0x43')]=[{'all':!![]}];}_0x557a73=_[_0x3545('0x3f')]({},_0x557a73,_0x3db67c[_0x3545('0x42')]);return db[_0x3545('0x2b')][_0x3545('0x4f')](_0x557a73)[_0x3545('0x23')](handleEntityNotFound(_0x5d3ed2,null))[_0x3545('0x23')](function(_0x2a8a6d){if(_0x2a8a6d){var _0x424e89=_0x2a8a6d[_0x3545('0x25')]({'plain':!![]});_0x424e89=qs[_0x3545('0x54')](_0x424e89,['id','createdAt',_0x3545('0x55')]);_0x3db67c[_0x3545('0x4b')]=_[_0x3545('0x54')](_0x3db67c[_0x3545('0x4b')],['id',_0x3545('0x56'),_0x3545('0x55')]);return db[_0x3545('0x2b')][_0x3545('0x4a')](_[_0x3545('0x3f')](_0x424e89,_0x3db67c[_0x3545('0x4b')]),{'include':_0x3db67c[_0x3545('0x30')][_0x3545('0x49')]?[{'all':!![]}]:undefined})[_0x3545('0x23')](function(_0x373852){var _0x37a077=_0x3db67c[_0x3545('0x4c')][_0x3545('0x25')]({'plain':!![]});if(!_0x37a077)throw new Error(_0x3545('0x4d'));if(_0x37a077[_0x3545('0x4e')]===_0x3545('0x4c')){var _0x176ac3=_0x373852[_0x3545('0x25')]({'plain':!![]});var _0x1c0d67=_0x3545('0x26');return db[_0x3545('0x57')]['find']({'where':{'name':_0x1c0d67,'userProfileId':_0x37a077[_0x3545('0x50')]},'raw':!![]})[_0x3545('0x23')](function(_0x2ddf75){if(_0x2ddf75&&_0x2ddf75[_0x3545('0x51')]===0x0){return db[_0x3545('0x27')][_0x3545('0x4a')]({'name':_0x176ac3[_0x3545('0x2f')],'resourceId':_0x176ac3['id'],'type':_0x2ddf75['name'],'sectionId':_0x2ddf75['id']},{})[_0x3545('0x23')](function(){return _0x373852;});}else{return _0x373852;}})[_0x3545('0x46')](function(_0x4f40da){logger[_0x3545('0x58')](_0x3545('0x52'),_0x4f40da);throw _0x4f40da;});}return _0x373852;});}})[_0x3545('0x23')](respondWithResult(_0x5d3ed2,0xc9))['catch'](handleError(_0x5d3ed2,null));};exports['update']=function(_0x269419,_0x5d2bea){if(_0x269419[_0x3545('0x4b')]['id']){delete _0x269419[_0x3545('0x4b')]['id'];}return db[_0x3545('0x2b')][_0x3545('0x4f')]({'where':{'id':_0x269419[_0x3545('0x48')]['id']}})[_0x3545('0x23')](handleEntityNotFound(_0x5d2bea,null))[_0x3545('0x23')](saveUpdates(_0x269419[_0x3545('0x4b')],null))[_0x3545('0x23')](respondWithResult(_0x5d2bea,null))[_0x3545('0x46')](handleError(_0x5d2bea,null));};exports[_0x3545('0x24')]=function(_0x571416,_0x4d4e91){return db[_0x3545('0x2b')][_0x3545('0x4f')]({'where':{'id':_0x571416[_0x3545('0x48')]['id']}})['then'](handleEntityNotFound(_0x4d4e91,null))[_0x3545('0x23')](removeEntity(_0x4d4e91,null))['catch'](handleError(_0x4d4e91,null));};exports[_0x3545('0x59')]=function(_0x3c3bdf,_0x384638,_0x3ea02f){var _0x4028ab={'raw':!![],'where':{}};var _0x428eaa={};var _0x179991={'count':0x0,'rows':[]};return db['JscriptyProject']['findOne']({'where':{'id':_0x3c3bdf[_0x3545('0x48')]['id']}})['then'](handleEntityNotFound(_0x384638,null))[_0x3545('0x23')](function(_0x255561){if(_0x255561){_0x428eaa[_0x3545('0x2e')]=_[_0x3545('0x31')](db[_0x3545('0x5a')][_0x3545('0x2c')]);_0x428eaa[_0x3545('0x30')]=_[_0x3545('0x31')](_0x3c3bdf['query']);_0x428eaa[_0x3545('0x32')]=_[_0x3545('0x33')](_0x428eaa[_0x3545('0x2e')],_0x428eaa[_0x3545('0x30')]);_0x4028ab[_0x3545('0x34')]=_['intersection'](_0x428eaa[_0x3545('0x2e')],qs['fields'](_0x3c3bdf[_0x3545('0x30')][_0x3545('0x35')]));_0x4028ab['attributes']=_0x4028ab[_0x3545('0x34')][_0x3545('0x36')]?_0x4028ab[_0x3545('0x34')]:_0x428eaa[_0x3545('0x2e')];if(!_0x3c3bdf[_0x3545('0x30')][_0x3545('0x37')](_0x3545('0x38'))){_0x4028ab['limit']=qs['limit'](_0x3c3bdf['query'][_0x3545('0x1d')]);_0x4028ab['offset']=qs[_0x3545('0x39')](_0x3c3bdf[_0x3545('0x30')][_0x3545('0x39')]);}_0x4028ab[_0x3545('0x3a')]=qs[_0x3545('0x3b')](_0x3c3bdf[_0x3545('0x30')][_0x3545('0x3b')]);_0x4028ab[_0x3545('0x3c')]=qs['filters'](_['pick'](_0x3c3bdf[_0x3545('0x30')],_0x428eaa[_0x3545('0x32')]));_0x4028ab[_0x3545('0x3c')][_0x3545('0x5b')]=_0x255561['id'];if(_0x3c3bdf[_0x3545('0x30')][_0x3545('0x3e')]){_0x4028ab[_0x3545('0x3c')]=_[_0x3545('0x3f')](_0x4028ab[_0x3545('0x3c')],{'$or':_[_0x3545('0x2a')](_0x4028ab['attributes'],function(_0x2b4bed){var _0x5f25b6={};_0x5f25b6[_0x2b4bed]={'$like':'%'+_0x3c3bdf[_0x3545('0x30')][_0x3545('0x3e')]+'%'};return _0x5f25b6;})});}_0x4028ab=_[_0x3545('0x3f')]({},_0x4028ab,_0x3c3bdf[_0x3545('0x42')]);return db['JscriptySessionReport'][_0x3545('0x1c')]({'where':_0x4028ab[_0x3545('0x3c')]})[_0x3545('0x23')](function(_0x1a5198){_0x179991[_0x3545('0x1c')]=_0x1a5198;if(_0x3c3bdf[_0x3545('0x30')][_0x3545('0x49')]){_0x4028ab['include']=[{'all':!![]}];}return db[_0x3545('0x5a')]['findAll'](_0x4028ab);})[_0x3545('0x23')](function(_0x15964a){_0x179991[_0x3545('0x45')]=_0x15964a;return _0x179991;});}})[_0x3545('0x23')](respondWithFilteredResult(_0x384638,_0x4028ab))['catch'](handleError(_0x384638,null));};exports[_0x3545('0x5c')]=function(_0x4ef84b,_0x5f1f40,_0xaf94fd){var _0x3a5035={'raw':!![],'where':{}};var _0x1eade9={};var _0x431548={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x3545('0x5d')]({'where':{'id':_0x4ef84b['params']['id']}})['then'](handleEntityNotFound(_0x5f1f40,null))[_0x3545('0x23')](function(_0x427247){if(_0x427247){_0x1eade9[_0x3545('0x2e')]=_['keys'](db[_0x3545('0x5e')][_0x3545('0x2c')]);_0x1eade9[_0x3545('0x30')]=_[_0x3545('0x31')](_0x4ef84b[_0x3545('0x30')]);_0x1eade9[_0x3545('0x32')]=_[_0x3545('0x33')](_0x1eade9['model'],_0x1eade9[_0x3545('0x30')]);_0x3a5035['attributes']=_[_0x3545('0x33')](_0x1eade9[_0x3545('0x2e')],qs[_0x3545('0x35')](_0x4ef84b[_0x3545('0x30')][_0x3545('0x35')]));_0x3a5035[_0x3545('0x34')]=_0x3a5035[_0x3545('0x34')][_0x3545('0x36')]?_0x3a5035['attributes']:_0x1eade9[_0x3545('0x2e')];if(!_0x4ef84b['query'][_0x3545('0x37')](_0x3545('0x38'))){_0x3a5035[_0x3545('0x1d')]=qs[_0x3545('0x1d')](_0x4ef84b[_0x3545('0x30')]['limit']);_0x3a5035['offset']=qs[_0x3545('0x39')](_0x4ef84b[_0x3545('0x30')][_0x3545('0x39')]);}_0x3a5035[_0x3545('0x3a')]=qs[_0x3545('0x3b')](_0x4ef84b[_0x3545('0x30')][_0x3545('0x3b')]);_0x3a5035['where']=qs[_0x3545('0x32')](_[_0x3545('0x3d')](_0x4ef84b['query'],_0x1eade9['filters']));_0x3a5035[_0x3545('0x3c')][_0x3545('0x5b')]=_0x427247['id'];if(_0x4ef84b[_0x3545('0x30')][_0x3545('0x3e')]){_0x3a5035['where']=_['merge'](_0x3a5035[_0x3545('0x3c')],{'$or':_[_0x3545('0x2a')](_0x3a5035['attributes'],function(_0x13d47d){var _0x5e7c85={};_0x5e7c85[_0x13d47d]={'$like':'%'+_0x4ef84b['query'][_0x3545('0x3e')]+'%'};return _0x5e7c85;})});}_0x3a5035=_[_0x3545('0x3f')]({},_0x3a5035,_0x4ef84b[_0x3545('0x42')]);return db[_0x3545('0x5e')][_0x3545('0x1c')]({'where':_0x3a5035['where']})[_0x3545('0x23')](function(_0x469e0c){_0x431548[_0x3545('0x1c')]=_0x469e0c;if(_0x4ef84b['query'][_0x3545('0x49')]){_0x3a5035['include']=[{'all':!![]}];}return db[_0x3545('0x5e')][_0x3545('0x44')](_0x3a5035);})[_0x3545('0x23')](function(_0x5b0118){_0x431548[_0x3545('0x45')]=_0x5b0118;return _0x431548;});}})[_0x3545('0x23')](respondWithFilteredResult(_0x5f1f40,_0x3a5035))[_0x3545('0x46')](handleError(_0x5f1f40,null));};function char(_0x2a6c95){return _0x3545('0x5f')===typeof _0x2a6c95?String[_0x3545('0x60')][_0x3545('0x20')](null,arguments):_0x2a6c95;}function needsEncapsulation(_0x5d4014){return!!_0x5d4014&&(_0x5d4014[_0x3545('0x61')]()[_0x3545('0x62')](char(0xd))>=0x0||_0x5d4014[_0x3545('0x61')]()[_0x3545('0x62')](char(0xa))>=0x0||_0x5d4014[_0x3545('0x61')]()[_0x3545('0x62')](char(0x2c))>=0x0||_0x5d4014[_0x3545('0x61')]()[_0x3545('0x62')](char(0x22))>=0x0);}function encapsulate(_0x3c3569){var _0x258dff=char(0x22),_0x1d7260='\x5c'+char(0x22),_0xdb4d69=_0x3c3569['toString']()[_0x3545('0x63')](new RegExp(_0x258dff,'g'),_0x1d7260);return _0x258dff+_0xdb4d69+_0x258dff;}exports[_0x3545('0x64')]=function(_0x1e16b1,_0x56b0cf,_0x22d408){var _0x28f085,_0x139f28;var _0x7924cc={'where':{'ProjectId':_0x1e16b1[_0x3545('0x48')]['id']}};if(_0x1e16b1[_0x3545('0x30')][_0x3545('0x65')]){_0x7924cc[_0x3545('0x3c')]['starttime']=JSON['parse'](_0x1e16b1[_0x3545('0x30')][_0x3545('0x65')]);}return db[_0x3545('0x5a')]['findAll'](_0x7924cc)[_0x3545('0x23')](handleEntityNotFound(_0x56b0cf,null))['then'](function(_0x9350c7){if(_0x9350c7){_0x28f085=_0x9350c7;return db[_0x3545('0x66')][_0x3545('0x44')]({'where':{'SessionId':{'$in':_[_0x3545('0x2a')](_0x28f085,'id')},'ProjectId':_0x1e16b1[_0x3545('0x48')]['id']},'order':'-createdAt'});}})[_0x3545('0x23')](handleEntityNotFound(_0x56b0cf,null))[_0x3545('0x23')](function(_0x1169db){if(_0x1169db){_0x139f28=_0x1169db;var _0x3c1dfb={};for(var _0x35da4a=0x0,_0x3d130c=_0x139f28[_0x3545('0x36')];_0x35da4a<_0x3d130c;_0x35da4a++){if(!_0x3c1dfb[_0x3545('0x37')](_0x139f28[_0x35da4a][_0x3545('0x67')])){_0x3c1dfb[_0x139f28[_0x35da4a]['questionId']]=needsEncapsulation(_0x139f28[_0x35da4a][_0x3545('0x68')])?encapsulate(_0x139f28[_0x35da4a]['question']):_0x139f28[_0x35da4a][_0x3545('0x68')];}}var _0x2b2fb6=[],_0xfaf874={};for(var _0x710589=0x0,_0x94c5f0=_0x28f085[_0x3545('0x36')];_0x710589<_0x94c5f0;_0x710589++){_0xfaf874={'ProjectId':_0x1e16b1[_0x3545('0x48')]['id'],'SessionId':_0x28f085[_0x710589]['id'],'StartTime':moment(_0x28f085[_0x710589][_0x3545('0x69')])['format'](_0x3545('0x6a'))};for(var _0x506e98=0x0,_0xfe0fd2=_0x139f28['length'];_0x506e98<_0xfe0fd2;_0x506e98++){if(_0x139f28[_0x506e98]['SessionId']==_0x28f085[_0x710589]['id']&&_0x3c1dfb[_0x3545('0x37')](_0x139f28[_0x506e98]['questionId'])){_0xfaf874[_0x3c1dfb[_0x139f28[_0x506e98][_0x3545('0x67')]]]=_0x139f28[_0x506e98][_0x3545('0x6b')];}}for(var _0x18b862 in _0x3c1dfb){if(!_0xfaf874['hasOwnProperty'](_0x3c1dfb[_0x18b862])){_0xfaf874[_0x3c1dfb[_0x18b862]]=null;}}_0x2b2fb6[_0x3545('0x6c')](_0xfaf874);}return _0x2b2fb6;}})[_0x3545('0x23')](function(_0x1f3543){if(!_['isEmpty'](_0x1f3543)){var _0x6ad34=toCsv(_0x1f3543);var _0x325487=Date[_0x3545('0x6d')]();fs[_0x3545('0x6e')](util[_0x3545('0x6f')](_0x3545('0x70'),_0x1e16b1[_0x3545('0x48')]['id'],_0x325487),_0x6ad34);_0x56b0cf[_0x3545('0x71')](_0x3545('0x72'),'attachment;\x20filename='+util[_0x3545('0x6f')](_0x3545('0x73'),_0x1e16b1[_0x3545('0x48')]['id'],_0x325487));_0x56b0cf['setHeader'](_0x3545('0x74'),'text/csv');return _0x56b0cf[_0x3545('0x75')](util['format'](_0x3545('0x70'),_0x1e16b1[_0x3545('0x48')]['id'],_0x325487));}else{return _0x56b0cf['sendStatus'](0xcc);}})[_0x3545('0x46')](handleError(_0x56b0cf,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 6918fa2..184cc2e 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 _0x2fed=['exports','define','JscriptyProject','jscripty_projects','lodash','util','../../config/logger','api','moment','request-promise','path','./jscriptyProject.attributes'];(function(_0x1fe739,_0x170a50){var _0x31de26=function(_0x2c2a05){while(--_0x2c2a05){_0x1fe739['push'](_0x1fe739['shift']());}};_0x31de26(++_0x170a50);}(_0x2fed,0x7c));var _0xd2fe=function(_0x1d7461,_0x32da57){_0x1d7461=_0x1d7461-0x0;var _0x17268d=_0x2fed[_0x1d7461];return _0x17268d;};'use strict';var _=require(_0xd2fe('0x0'));var util=require(_0xd2fe('0x1'));var logger=require(_0xd2fe('0x2'))(_0xd2fe('0x3'));var moment=require(_0xd2fe('0x4'));var BPromise=require('bluebird');var rp=require(_0xd2fe('0x5'));var fs=require('fs');var path=require(_0xd2fe('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd2fe('0x7'));module[_0xd2fe('0x8')]=function(_0xd85f89,_0x5be4d3){return _0xd85f89[_0xd2fe('0x9')](_0xd2fe('0xa'),attributes,{'tableName':_0xd2fe('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd8ee=['exports','define','JscriptyProject','jscripty_projects','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./jscriptyProject.attributes'];(function(_0x51d68e,_0x3fa62d){var _0x46d50c=function(_0x59782e){while(--_0x59782e){_0x51d68e['push'](_0x51d68e['shift']());}};_0x46d50c(++_0x3fa62d);}(_0xd8ee,0x1f2));var _0xed8e=function(_0x3e7b5e,_0x2b4890){_0x3e7b5e=_0x3e7b5e-0x0;var _0x35edde=_0xd8ee[_0x3e7b5e];return _0x35edde;};'use strict';var _=require(_0xed8e('0x0'));var util=require('util');var logger=require(_0xed8e('0x1'))(_0xed8e('0x2'));var moment=require(_0xed8e('0x3'));var BPromise=require('bluebird');var rp=require(_0xed8e('0x4'));var fs=require('fs');var path=require(_0xed8e('0x5'));var rimraf=require(_0xed8e('0x6'));var config=require(_0xed8e('0x7'));var attributes=require(_0xed8e('0x8'));module[_0xed8e('0x9')]=function(_0x576b26,_0x3a030a){return _0x576b26[_0xed8e('0xa')](_0xed8e('0xb'),attributes,{'tableName':_0xed8e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js index 5432e22..68e73c9 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 _0xd8b0=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis'];(function(_0x1caf3f,_0x1b4800){var _0x1905f0=function(_0x36e1eb){while(--_0x36e1eb){_0x1caf3f['push'](_0x1caf3f['shift']());}};_0x1905f0(++_0x1b4800);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});} \ No newline at end of file +var _0xe706=['http','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x12d721,_0x39c08f){var _0x45008c=function(_0x58c374){while(--_0x58c374){_0x12d721['push'](_0x12d721['shift']());}};_0x45008c(++_0x39c08f);}(_0xe706,0xa3));var _0x6e70=function(_0x5ed46a,_0x1ed3bd){_0x5ed46a=_0x5ed46a-0x0;var _0x2eebd3=_0xe706[_0x5ed46a];return _0x2eebd3;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('JscriptyProject,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('JscriptyProject,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 0cb07f2..be12eb0 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 _0x86b7=['multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','update','delete','exports'];(function(_0xfb0281,_0x3ff38b){var _0x408dd3=function(_0x5d8017){while(--_0x5d8017){_0xfb0281['push'](_0xfb0281['shift']());}};_0x408dd3(++_0x3ff38b);}(_0x86b7,0x160));var _0x786b=function(_0x24b4cb,_0x48da0e){_0x24b4cb=_0x24b4cb-0x0;var _0x2717e3=_0x86b7[_0x24b4cb];return _0x2717e3;};'use strict';var multer=require(_0x786b('0x0'));var util=require(_0x786b('0x1'));var path=require(_0x786b('0x2'));var timeout=require('connect-timeout');var express=require(_0x786b('0x3'));var router=express[_0x786b('0x4')]();var fs_extra=require(_0x786b('0x5'));var auth=require(_0x786b('0x6'));var interaction=require(_0x786b('0x7'));var config=require(_0x786b('0x8'));var controller=require(_0x786b('0x9'));router['get']('/',auth[_0x786b('0xa')](),controller[_0x786b('0xb')]);router[_0x786b('0xc')](_0x786b('0xd'),auth[_0x786b('0xa')](),controller[_0x786b('0xe')]);router[_0x786b('0xc')](_0x786b('0xf'),auth[_0x786b('0xa')](),controller[_0x786b('0x10')]);router[_0x786b('0x11')]('/',auth['isAuthenticated'](),controller[_0x786b('0x12')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x786b('0x13')]);router[_0x786b('0x14')](_0x786b('0xf'),auth[_0x786b('0xa')](),controller['destroy']);module[_0x786b('0x15')]=router; \ No newline at end of file +var _0xac7d=['put','update','delete','exports','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','./jscriptyQuestionReport.controller','get','/describe','describe','/:id','isAuthenticated','show','post'];(function(_0x2ffb47,_0x3a5e02){var _0x7eaf82=function(_0x1eb4f2){while(--_0x1eb4f2){_0x2ffb47['push'](_0x2ffb47['shift']());}};_0x7eaf82(++_0x3a5e02);}(_0xac7d,0x1d8));var _0xdac7=function(_0xf42ec6,_0x3e9038){_0xf42ec6=_0xf42ec6-0x0;var _0x2d933d=_0xac7d[_0xf42ec6];return _0x2d933d;};'use strict';var multer=require(_0xdac7('0x0'));var util=require(_0xdac7('0x1'));var path=require(_0xdac7('0x2'));var timeout=require(_0xdac7('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xdac7('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xdac7('0x5'));var config=require('../../config/environment');var controller=require(_0xdac7('0x6'));router[_0xdac7('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xdac7('0x7')](_0xdac7('0x8'),auth['isAuthenticated'](),controller[_0xdac7('0x9')]);router['get'](_0xdac7('0xa'),auth[_0xdac7('0xb')](),controller[_0xdac7('0xc')]);router[_0xdac7('0xd')]('/',auth[_0xdac7('0xb')](),controller['create']);router[_0xdac7('0xe')](_0xdac7('0xa'),auth['isAuthenticated'](),controller[_0xdac7('0xf')]);router[_0xdac7('0x10')](_0xdac7('0xa'),auth[_0xdac7('0xb')](),controller['destroy']);module[_0xdac7('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 7f8f77c..4d9010c 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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7a54,0x106));var _0x47a5=function(_0x324fcf,_0x23aacb){_0x324fcf=_0x324fcf-0x0;var _0x37bc8d=_0x7a54[_0x324fcf];return _0x37bc8d;};'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(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x7a54,0x106));var _0x47a5=function(_0x624467,_0x17fb64){_0x624467=_0x624467-0x0;var _0x53e0f4=_0x7a54[_0x624467];return _0x53e0f4;};'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 04aab1a..c2e566d 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 _0x5120=['where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','rawAttributes','find','create','body','destroy','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','apply','reject','save','update','then','end','stack','name','index','map','JscriptyQuestionReport','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort'];(function(_0x1ae5ab,_0xc5d441){var _0x1ce001=function(_0x5ef96d){while(--_0x5ef96d){_0x1ae5ab['push'](_0x1ae5ab['shift']());}};_0x1ce001(++_0xc5d441);}(_0x5120,0x179));var _0x0512=function(_0x34967e,_0x11f483){_0x34967e=_0x34967e-0x0;var _0x406971=_0x5120[_0x34967e];return _0x406971;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0512('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0512('0x1'));var rp=require(_0x0512('0x2'));var moment=require(_0x0512('0x3'));var BPromise=require(_0x0512('0x4'));var Mustache=require(_0x0512('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x0512('0x6'));var ejs=require(_0x0512('0x7'));var fs=require('fs');var fs_extra=require(_0x0512('0x8'));var _=require(_0x0512('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0512('0xa'));var deskjs=require(_0x0512('0xb'));var toCsv=require(_0x0512('0x6'));var querystring=require('querystring');var Papa=require(_0x0512('0xc'));var Redis=require(_0x0512('0xd'));var authService=require(_0x0512('0xe'));var qs=require(_0x0512('0xf'));var as=require(_0x0512('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0512('0x11'))('api');var utils=require(_0x0512('0x12'));var config=require(_0x0512('0x13'));var licenseUtil=require(_0x0512('0x14'));var db=require(_0x0512('0x15'))['db'];function respondWithStatusCode(_0x174782,_0x531fd5){_0x531fd5=_0x531fd5||0xcc;return function(_0x601604){if(_0x601604){return _0x174782[_0x0512('0x16')](_0x531fd5);}return _0x174782[_0x0512('0x17')](_0x531fd5)['end']();};}function respondWithResult(_0x1bd761,_0x5afe41){_0x5afe41=_0x5afe41||0xc8;return function(_0x3703b2){if(_0x3703b2){return _0x1bd761[_0x0512('0x17')](_0x5afe41)[_0x0512('0x18')](_0x3703b2);}};}function respondWithFilteredResult(_0x2fe085,_0x50bec6){return function(_0x11490f){if(_0x11490f){var _0x114c03=typeof _0x50bec6['offset']===_0x0512('0x19')&&typeof _0x50bec6[_0x0512('0x1a')]===_0x0512('0x19');var _0x5e1da6=_0x11490f[_0x0512('0x1b')];var _0x1007b4=_0x114c03?0x0:_0x50bec6[_0x0512('0x1c')];var _0x5643b8=_0x114c03?_0x11490f['count']:_0x50bec6[_0x0512('0x1c')]+_0x50bec6[_0x0512('0x1a')];var _0x2cee73;if(_0x5643b8>=_0x5e1da6){_0x5643b8=_0x5e1da6;_0x2cee73=0xc8;}else{_0x2cee73=0xce;}_0x2fe085[_0x0512('0x17')](_0x2cee73);return _0x2fe085[_0x0512('0x1d')]('Content-Range',_0x1007b4+'-'+_0x5643b8+'/'+_0x5e1da6)[_0x0512('0x18')](_0x11490f);}return null;};}function patchUpdates(_0x17c575){return function(_0x3ff964){try{jsonpatch[_0x0512('0x1e')](_0x3ff964,_0x17c575,!![]);}catch(_0x23051f){return BPromise[_0x0512('0x1f')](_0x23051f);}return _0x3ff964[_0x0512('0x20')]();};}function saveUpdates(_0x158352,_0xf28f81){return function(_0x967613){if(_0x967613){return _0x967613[_0x0512('0x21')](_0x158352)[_0x0512('0x22')](function(_0x54702b){return _0x54702b;});}return null;};}function removeEntity(_0x4f0111,_0x404d1d){return function(_0xa80dc1){if(_0xa80dc1){return _0xa80dc1['destroy']()[_0x0512('0x22')](function(){_0x4f0111[_0x0512('0x17')](0xcc)[_0x0512('0x23')]();});}};}function handleEntityNotFound(_0x2689ff,_0x3d5343){return function(_0x20ef5f){if(!_0x20ef5f){_0x2689ff[_0x0512('0x16')](0x194);}return _0x20ef5f;};}function handleError(_0x5c0966,_0x3cebfb){_0x3cebfb=_0x3cebfb||0x1f4;return function(_0x16012b){logger['error'](_0x16012b[_0x0512('0x24')]);if(_0x16012b[_0x0512('0x25')]){delete _0x16012b[_0x0512('0x25')];}_0x5c0966[_0x0512('0x17')](_0x3cebfb)['send'](_0x16012b);};}exports[_0x0512('0x26')]=function(_0x3c48f3,_0x56ad0b){var _0x4b7244={},_0x310282={},_0xf067c6={'count':0x0,'rows':[]};var _0x5dc083=_[_0x0512('0x27')](db[_0x0512('0x28')]['rawAttributes'],function(_0x2001d0){return{'name':_0x2001d0[_0x0512('0x29')],'type':_0x2001d0[_0x0512('0x2a')][_0x0512('0x2b')]};});_0x310282[_0x0512('0x2c')]=_[_0x0512('0x27')](_0x5dc083,_0x0512('0x25'));_0x310282[_0x0512('0x2d')]=_[_0x0512('0x2e')](_0x3c48f3['query']);_0x310282[_0x0512('0x2f')]=_['intersection'](_0x310282[_0x0512('0x2c')],_0x310282['query']);_0x4b7244[_0x0512('0x30')]=_[_0x0512('0x31')](_0x310282[_0x0512('0x2c')],qs[_0x0512('0x32')](_0x3c48f3[_0x0512('0x2d')][_0x0512('0x32')]));_0x4b7244[_0x0512('0x30')]=_0x4b7244[_0x0512('0x30')]['length']?_0x4b7244[_0x0512('0x30')]:_0x310282[_0x0512('0x2c')];if(!_0x3c48f3[_0x0512('0x2d')][_0x0512('0x33')](_0x0512('0x34'))){_0x4b7244[_0x0512('0x1a')]=qs[_0x0512('0x1a')](_0x3c48f3[_0x0512('0x2d')][_0x0512('0x1a')]);_0x4b7244[_0x0512('0x1c')]=qs['offset'](_0x3c48f3[_0x0512('0x2d')][_0x0512('0x1c')]);}_0x4b7244[_0x0512('0x35')]=qs[_0x0512('0x36')](_0x3c48f3[_0x0512('0x2d')][_0x0512('0x36')]);_0x4b7244[_0x0512('0x37')]=qs[_0x0512('0x2f')](_[_0x0512('0x38')](_0x3c48f3['query'],_0x310282[_0x0512('0x2f')]),_0x5dc083);if(_0x3c48f3[_0x0512('0x2d')][_0x0512('0x39')]){_0x4b7244['where']=_[_0x0512('0x3a')](_0x4b7244['where'],{'$or':_[_0x0512('0x27')](_0x5dc083,function(_0xdf7c08){if(_0xdf7c08[_0x0512('0x2a')]!==_0x0512('0x3b')){var _0x1e0385={};_0x1e0385[_0xdf7c08['name']]={'$like':'%'+_0x3c48f3[_0x0512('0x2d')][_0x0512('0x39')]+'%'};return _0x1e0385;}})});}_0x4b7244=_[_0x0512('0x3a')]({},_0x4b7244,_0x3c48f3[_0x0512('0x3c')]);var _0x3d3c02={'where':_0x4b7244[_0x0512('0x37')]};return db[_0x0512('0x28')][_0x0512('0x1b')](_0x3d3c02)[_0x0512('0x22')](function(_0x43f6f5){_0xf067c6[_0x0512('0x1b')]=_0x43f6f5;if(_0x3c48f3[_0x0512('0x2d')]['includeAll']){_0x4b7244[_0x0512('0x3d')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x0512('0x3e')](_0x4b7244);})[_0x0512('0x22')](function(_0x19b59b){_0xf067c6['rows']=_0x19b59b;return _0xf067c6;})[_0x0512('0x22')](respondWithFilteredResult(_0x56ad0b,_0x4b7244))[_0x0512('0x3f')](handleError(_0x56ad0b,null));};exports[_0x0512('0x40')]=function(_0x55148b,_0x4fb243){var _0x3b3916={'raw':!![],'where':{'id':_0x55148b[_0x0512('0x41')]['id']}},_0x4e13f8={};_0x4e13f8[_0x0512('0x2c')]=_[_0x0512('0x2e')](db[_0x0512('0x28')][_0x0512('0x42')]);_0x4e13f8['query']=_['keys'](_0x55148b[_0x0512('0x2d')]);_0x4e13f8['filters']=_[_0x0512('0x31')](_0x4e13f8[_0x0512('0x2c')],_0x4e13f8[_0x0512('0x2d')]);_0x3b3916['attributes']=_['intersection'](_0x4e13f8[_0x0512('0x2c')],qs['fields'](_0x55148b[_0x0512('0x2d')][_0x0512('0x32')]));_0x3b3916[_0x0512('0x30')]=_0x3b3916[_0x0512('0x30')]['length']?_0x3b3916[_0x0512('0x30')]:_0x4e13f8[_0x0512('0x2c')];if(_0x55148b[_0x0512('0x2d')]['includeAll']){_0x3b3916[_0x0512('0x3d')]=[{'all':!![]}];}_0x3b3916=_['merge']({},_0x3b3916,_0x55148b[_0x0512('0x3c')]);return db[_0x0512('0x28')][_0x0512('0x43')](_0x3b3916)['then'](handleEntityNotFound(_0x4fb243,null))[_0x0512('0x22')](respondWithResult(_0x4fb243,null))['catch'](handleError(_0x4fb243,null));};exports[_0x0512('0x44')]=function(_0x24a726,_0x2920b0){return db[_0x0512('0x28')]['create'](_0x24a726[_0x0512('0x45')],{})[_0x0512('0x22')](respondWithResult(_0x2920b0,0xc9))[_0x0512('0x3f')](handleError(_0x2920b0,null));};exports[_0x0512('0x21')]=function(_0x153400,_0xa4fbb3){if(_0x153400[_0x0512('0x45')]['id']){delete _0x153400['body']['id'];}return db[_0x0512('0x28')]['find']({'where':{'id':_0x153400[_0x0512('0x41')]['id']}})[_0x0512('0x22')](handleEntityNotFound(_0xa4fbb3,null))[_0x0512('0x22')](saveUpdates(_0x153400['body'],null))['then'](respondWithResult(_0xa4fbb3,null))[_0x0512('0x3f')](handleError(_0xa4fbb3,null));};exports[_0x0512('0x46')]=function(_0x417583,_0x27d1a6){return db[_0x0512('0x28')][_0x0512('0x43')]({'where':{'id':_0x417583['params']['id']}})[_0x0512('0x22')](handleEntityNotFound(_0x27d1a6,null))['then'](removeEntity(_0x27d1a6,null))[_0x0512('0x3f')](handleError(_0x27d1a6,null));};exports['describe']=function(_0x4745d2,_0x3caab9){return db[_0x0512('0x28')][_0x0512('0x47')]()['then'](respondWithResult(_0x3caab9,null))[_0x0512('0x3f')](handleError(_0x3caab9,null));}; \ No newline at end of file +var _0x849e=['path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','undefined','count','update','then','destroy','stack','name','send','index','map','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','JscriptyQuestionReport','rows','catch','show','params','rawAttributes','includeAll','include','options','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','util'];(function(_0x41ded8,_0x119397){var _0x2cfa11=function(_0x42ea9a){while(--_0x42ea9a){_0x41ded8['push'](_0x41ded8['shift']());}};_0x2cfa11(++_0x119397);}(_0x849e,0x80));var _0xe849=function(_0x119961,_0x38c0a1){_0x119961=_0x119961-0x0;var _0x147fe2=_0x849e[_0x119961];return _0x147fe2;};'use strict';var emlformat=require(_0xe849('0x0'));var rimraf=require(_0xe849('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe849('0x2'));var rp=require(_0xe849('0x3'));var moment=require(_0xe849('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe849('0x5'));var path=require(_0xe849('0x6'));var sox=require(_0xe849('0x7'));var csv=require(_0xe849('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe849('0x9'));var _=require(_0xe849('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe849('0xb'));var deskjs=require(_0xe849('0xc'));var toCsv=require(_0xe849('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe849('0xd'));var qs=require(_0xe849('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe849('0xf'))(_0xe849('0x10'));var utils=require(_0xe849('0x11'));var config=require(_0xe849('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d189c,_0x211b4f){_0x211b4f=_0x211b4f||0xcc;return function(_0x34fe4b){if(_0x34fe4b){return _0x1d189c[_0xe849('0x13')](_0x211b4f);}return _0x1d189c[_0xe849('0x14')](_0x211b4f)[_0xe849('0x15')]();};}function respondWithResult(_0x12da88,_0x56f3c7){_0x56f3c7=_0x56f3c7||0xc8;return function(_0x38a8e7){if(_0x38a8e7){return _0x12da88[_0xe849('0x14')](_0x56f3c7)[_0xe849('0x16')](_0x38a8e7);}};}function respondWithFilteredResult(_0x5ea749,_0x40165d){return function(_0x5ba6b5){if(_0x5ba6b5){var _0x24e780=typeof _0x40165d[_0xe849('0x17')]==='undefined'&&typeof _0x40165d[_0xe849('0x18')]===_0xe849('0x19');var _0x1bd0e2=_0x5ba6b5['count'];var _0x462f77=_0x24e780?0x0:_0x40165d[_0xe849('0x17')];var _0x4bbbf2=_0x24e780?_0x5ba6b5[_0xe849('0x1a')]:_0x40165d['offset']+_0x40165d[_0xe849('0x18')];var _0x5e85fd;if(_0x4bbbf2>=_0x1bd0e2){_0x4bbbf2=_0x1bd0e2;_0x5e85fd=0xc8;}else{_0x5e85fd=0xce;}_0x5ea749[_0xe849('0x14')](_0x5e85fd);return _0x5ea749['set']('Content-Range',_0x462f77+'-'+_0x4bbbf2+'/'+_0x1bd0e2)[_0xe849('0x16')](_0x5ba6b5);}return null;};}function patchUpdates(_0x166623){return function(_0x56a060){try{jsonpatch['apply'](_0x56a060,_0x166623,!![]);}catch(_0x9d964b){return BPromise['reject'](_0x9d964b);}return _0x56a060['save']();};}function saveUpdates(_0x20f6e7,_0x228cf0){return function(_0x4ebf95){if(_0x4ebf95){return _0x4ebf95[_0xe849('0x1b')](_0x20f6e7)[_0xe849('0x1c')](function(_0x1b06d2){return _0x1b06d2;});}return null;};}function removeEntity(_0x10e58e,_0x564ff5){return function(_0x2481a1){if(_0x2481a1){return _0x2481a1[_0xe849('0x1d')]()[_0xe849('0x1c')](function(){_0x10e58e['status'](0xcc)[_0xe849('0x15')]();});}};}function handleEntityNotFound(_0x1387fd,_0x5e2350){return function(_0x66b3b0){if(!_0x66b3b0){_0x1387fd[_0xe849('0x13')](0x194);}return _0x66b3b0;};}function handleError(_0x3b1dd7,_0x175d65){_0x175d65=_0x175d65||0x1f4;return function(_0x59efe){logger['error'](_0x59efe[_0xe849('0x1e')]);if(_0x59efe['name']){delete _0x59efe[_0xe849('0x1f')];}_0x3b1dd7[_0xe849('0x14')](_0x175d65)[_0xe849('0x20')](_0x59efe);};}exports[_0xe849('0x21')]=function(_0xf1c11a,_0x39a338){var _0x27b3d4={},_0x5bbeb7={},_0x10f22a={'count':0x0,'rows':[]};var _0x4b5732=_[_0xe849('0x22')](db['JscriptyQuestionReport']['rawAttributes'],function(_0x4dae98){return{'name':_0x4dae98[_0xe849('0x23')],'type':_0x4dae98['type'][_0xe849('0x24')]};});_0x5bbeb7[_0xe849('0x25')]=_[_0xe849('0x22')](_0x4b5732,_0xe849('0x1f'));_0x5bbeb7['query']=_[_0xe849('0x26')](_0xf1c11a[_0xe849('0x27')]);_0x5bbeb7[_0xe849('0x28')]=_[_0xe849('0x29')](_0x5bbeb7[_0xe849('0x25')],_0x5bbeb7[_0xe849('0x27')]);_0x27b3d4[_0xe849('0x2a')]=_[_0xe849('0x29')](_0x5bbeb7[_0xe849('0x25')],qs[_0xe849('0x2b')](_0xf1c11a[_0xe849('0x27')][_0xe849('0x2b')]));_0x27b3d4[_0xe849('0x2a')]=_0x27b3d4[_0xe849('0x2a')][_0xe849('0x2c')]?_0x27b3d4[_0xe849('0x2a')]:_0x5bbeb7[_0xe849('0x25')];if(!_0xf1c11a[_0xe849('0x27')][_0xe849('0x2d')](_0xe849('0x2e'))){_0x27b3d4['limit']=qs[_0xe849('0x18')](_0xf1c11a[_0xe849('0x27')][_0xe849('0x18')]);_0x27b3d4[_0xe849('0x17')]=qs[_0xe849('0x17')](_0xf1c11a[_0xe849('0x27')][_0xe849('0x17')]);}_0x27b3d4[_0xe849('0x2f')]=qs[_0xe849('0x30')](_0xf1c11a[_0xe849('0x27')][_0xe849('0x30')]);_0x27b3d4[_0xe849('0x31')]=qs[_0xe849('0x28')](_[_0xe849('0x32')](_0xf1c11a['query'],_0x5bbeb7['filters']),_0x4b5732);if(_0xf1c11a[_0xe849('0x27')]['filter']){_0x27b3d4['where']=_[_0xe849('0x33')](_0x27b3d4[_0xe849('0x31')],{'$or':_['map'](_0x4b5732,function(_0xb963d7){if(_0xb963d7[_0xe849('0x34')]!==_0xe849('0x35')){var _0x59ffe3={};_0x59ffe3[_0xb963d7[_0xe849('0x1f')]]={'$like':'%'+_0xf1c11a[_0xe849('0x27')]['filter']+'%'};return _0x59ffe3;}})});}_0x27b3d4=_['merge']({},_0x27b3d4,_0xf1c11a['options']);var _0x5c4a4e={'where':_0x27b3d4['where']};return db[_0xe849('0x36')][_0xe849('0x1a')](_0x5c4a4e)['then'](function(_0xc7d9a5){_0x10f22a[_0xe849('0x1a')]=_0xc7d9a5;if(_0xf1c11a[_0xe849('0x27')]['includeAll']){_0x27b3d4['include']=[{'all':!![]}];}return db[_0xe849('0x36')]['findAll'](_0x27b3d4);})[_0xe849('0x1c')](function(_0x923758){_0x10f22a[_0xe849('0x37')]=_0x923758;return _0x10f22a;})[_0xe849('0x1c')](respondWithFilteredResult(_0x39a338,_0x27b3d4))[_0xe849('0x38')](handleError(_0x39a338,null));};exports[_0xe849('0x39')]=function(_0x1fcf46,_0x3a4be6){var _0x31ce3b={'raw':!![],'where':{'id':_0x1fcf46[_0xe849('0x3a')]['id']}},_0xb3d469={};_0xb3d469[_0xe849('0x25')]=_[_0xe849('0x26')](db['JscriptyQuestionReport'][_0xe849('0x3b')]);_0xb3d469['query']=_['keys'](_0x1fcf46[_0xe849('0x27')]);_0xb3d469[_0xe849('0x28')]=_[_0xe849('0x29')](_0xb3d469[_0xe849('0x25')],_0xb3d469[_0xe849('0x27')]);_0x31ce3b[_0xe849('0x2a')]=_[_0xe849('0x29')](_0xb3d469['model'],qs[_0xe849('0x2b')](_0x1fcf46[_0xe849('0x27')]['fields']));_0x31ce3b['attributes']=_0x31ce3b[_0xe849('0x2a')][_0xe849('0x2c')]?_0x31ce3b[_0xe849('0x2a')]:_0xb3d469['model'];if(_0x1fcf46[_0xe849('0x27')][_0xe849('0x3c')]){_0x31ce3b[_0xe849('0x3d')]=[{'all':!![]}];}_0x31ce3b=_['merge']({},_0x31ce3b,_0x1fcf46[_0xe849('0x3e')]);return db[_0xe849('0x36')][_0xe849('0x3f')](_0x31ce3b)['then'](handleEntityNotFound(_0x3a4be6,null))[_0xe849('0x1c')](respondWithResult(_0x3a4be6,null))[_0xe849('0x38')](handleError(_0x3a4be6,null));};exports['create']=function(_0x364fce,_0x4f199b){return db['JscriptyQuestionReport'][_0xe849('0x40')](_0x364fce['body'],{})[_0xe849('0x1c')](respondWithResult(_0x4f199b,0xc9))[_0xe849('0x38')](handleError(_0x4f199b,null));};exports['update']=function(_0x2063e0,_0x24fb02){if(_0x2063e0[_0xe849('0x41')]['id']){delete _0x2063e0[_0xe849('0x41')]['id'];}return db[_0xe849('0x36')][_0xe849('0x3f')]({'where':{'id':_0x2063e0['params']['id']}})[_0xe849('0x1c')](handleEntityNotFound(_0x24fb02,null))[_0xe849('0x1c')](saveUpdates(_0x2063e0[_0xe849('0x41')],null))[_0xe849('0x1c')](respondWithResult(_0x24fb02,null))['catch'](handleError(_0x24fb02,null));};exports[_0xe849('0x1d')]=function(_0x2b2cab,_0x5157c5){return db[_0xe849('0x36')]['find']({'where':{'id':_0x2b2cab['params']['id']}})['then'](handleEntityNotFound(_0x5157c5,null))['then'](removeEntity(_0x5157c5,null))[_0xe849('0x38')](handleError(_0x5157c5,null));};exports['describe']=function(_0x4ce660,_0x855a27){return db['JscriptyQuestionReport'][_0xe849('0x42')]()[_0xe849('0x1c')](respondWithResult(_0x855a27,null))['catch'](handleError(_0x855a27,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index e03987e..d9d8c28 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 _0xa898=['path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','JscriptyQuestionReport','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3f8851,_0x51e8a3){var _0xf3440=function(_0x507ed9){while(--_0x507ed9){_0x3f8851['push'](_0x3f8851['shift']());}};_0xf3440(++_0x51e8a3);}(_0xa898,0x158));var _0x8a89=function(_0x28dd8f,_0x572ef5){_0x28dd8f=_0x28dd8f-0x0;var _0x4809d1=_0xa898[_0x28dd8f];return _0x4809d1;};'use strict';var _=require(_0x8a89('0x0'));var util=require(_0x8a89('0x1'));var logger=require(_0x8a89('0x2'))(_0x8a89('0x3'));var moment=require(_0x8a89('0x4'));var BPromise=require(_0x8a89('0x5'));var rp=require(_0x8a89('0x6'));var fs=require('fs');var path=require(_0x8a89('0x7'));var rimraf=require(_0x8a89('0x8'));var config=require(_0x8a89('0x9'));var attributes=require(_0x8a89('0xa'));module[_0x8a89('0xb')]=function(_0x1a90af,_0x44ed78){return _0x1a90af['define'](_0x8a89('0xc'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x59dd=['define','JscriptyQuestionReport','report_jscripty_questions','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports'];(function(_0x5ed54b,_0x3a2827){var _0x4b58c7=function(_0x19d3b6){while(--_0x19d3b6){_0x5ed54b['push'](_0x5ed54b['shift']());}};_0x4b58c7(++_0x3a2827);}(_0x59dd,0x189));var _0xd59d=function(_0x4ed4d2,_0x47acf7){_0x4ed4d2=_0x4ed4d2-0x0;var _0x15ae2e=_0x59dd[_0x4ed4d2];return _0x15ae2e;};'use strict';var _=require(_0xd59d('0x0'));var util=require('util');var logger=require(_0xd59d('0x1'))(_0xd59d('0x2'));var moment=require(_0xd59d('0x3'));var BPromise=require(_0xd59d('0x4'));var rp=require(_0xd59d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd59d('0x6'));var config=require(_0xd59d('0x7'));var attributes=require(_0xd59d('0x8'));module[_0xd59d('0x9')]=function(_0x108141,_0x1b3996){return _0x108141[_0xd59d('0xa')](_0xd59d('0xb'),attributes,{'tableName':_0xd59d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index 3b31ad1..2b0db46 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 _0x92b7=['jayson/promise','client','http','request','then','info','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','error','code','JscriptyQuestionReport,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x92b7,0xcf));var _0x792b=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x92b7[_0x187ee1];return _0x388160;};'use strict';var _=require(_0x792b('0x0'));var util=require(_0x792b('0x1'));var moment=require('moment');var BPromise=require(_0x792b('0x2'));var rs=require(_0x792b('0x3'));var fs=require('fs');var Redis=require(_0x792b('0x4'));var db=require(_0x792b('0x5'))['db'];var utils=require(_0x792b('0x6'));var logger=require(_0x792b('0x7'))(_0x792b('0x8'));var config=require('../../config/environment');var jayson=require(_0x792b('0x9'));var client=jayson[_0x792b('0xa')][_0x792b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5c92fe,_0x1990e7,_0x207cc6){return new BPromise(function(_0x5f7d95,_0x15468f){return client[_0x792b('0xc')](_0x5c92fe,_0x207cc6)[_0x792b('0xd')](function(_0x344dba){logger[_0x792b('0xe')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x1990e7,_0x792b('0xf'));logger[_0x792b('0x10')](_0x792b('0x11'),_0x1990e7,_0x792b('0xf'),JSON['stringify'](_0x344dba));if(_0x344dba[_0x792b('0x12')]){if(_0x344dba[_0x792b('0x12')][_0x792b('0x13')]===0x1f4){logger[_0x792b('0x12')](_0x792b('0x14'),_0x1990e7,_0x344dba[_0x792b('0x12')][_0x792b('0x15')]);return _0x15468f(_0x344dba[_0x792b('0x12')][_0x792b('0x15')]);}logger[_0x792b('0x12')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x1990e7,_0x344dba[_0x792b('0x12')][_0x792b('0x15')]);return _0x5f7d95(_0x344dba[_0x792b('0x12')][_0x792b('0x15')]);}else{logger['info'](_0x792b('0x14'),_0x1990e7,_0x792b('0xf'));_0x5f7d95(_0x344dba[_0x792b('0x16')][_0x792b('0x15')]);}})[_0x792b('0x17')](function(_0x591746){logger[_0x792b('0x12')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x1990e7,_0x591746);_0x15468f(_0x591746);});});} \ No newline at end of file +var _0x1c26=['stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s'];(function(_0x1685f6,_0x1f1d56){var _0x1d2d87=function(_0x390b6e){while(--_0x390b6e){_0x1685f6['push'](_0x1685f6['shift']());}};_0x1d2d87(++_0x1f1d56);}(_0x1c26,0x186));var _0x61c2=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x1c26[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x61c2('0x0'));var util=require(_0x61c2('0x1'));var moment=require(_0x61c2('0x2'));var BPromise=require('bluebird');var rs=require(_0x61c2('0x3'));var fs=require('fs');var Redis=require(_0x61c2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x61c2('0x5'));var logger=require(_0x61c2('0x6'))('rpc');var config=require(_0x61c2('0x7'));var jayson=require(_0x61c2('0x8'));var client=jayson[_0x61c2('0x9')][_0x61c2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4562db,_0x57e5f0,_0x564cf3){return new BPromise(function(_0x2b7a8b,_0x4ba893){return client[_0x61c2('0xb')](_0x4562db,_0x564cf3)[_0x61c2('0xc')](function(_0xe70521){logger[_0x61c2('0xd')](_0x61c2('0xe'),_0x57e5f0,_0x61c2('0xf'));logger[_0x61c2('0x10')](_0x61c2('0x11'),_0x57e5f0,_0x61c2('0xf'),JSON[_0x61c2('0x12')](_0xe70521));if(_0xe70521[_0x61c2('0x13')]){if(_0xe70521[_0x61c2('0x13')][_0x61c2('0x14')]===0x1f4){logger[_0x61c2('0x13')](_0x61c2('0xe'),_0x57e5f0,_0xe70521['error'][_0x61c2('0x15')]);return _0x4ba893(_0xe70521[_0x61c2('0x13')][_0x61c2('0x15')]);}logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x57e5f0,_0xe70521[_0x61c2('0x13')][_0x61c2('0x15')]);return _0x2b7a8b(_0xe70521['error'][_0x61c2('0x15')]);}else{logger['info']('JscriptyQuestionReport,\x20%s,\x20%s',_0x57e5f0,_0x61c2('0xf'));_0x2b7a8b(_0xe70521[_0x61c2('0x16')][_0x61c2('0x15')]);}})[_0x61c2('0x17')](function(_0x16313e){logger[_0x61c2('0x13')](_0x61c2('0xe'),_0x57e5f0,_0x16313e);_0x4ba893(_0x16313e);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 19cd61a..6843947 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 _0x646e=['delete','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','/describe','isAuthenticated','/:id','getQuestions','post','create','put','update'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x646e,0x1a7));var _0xe646=function(_0x19322d,_0x513668){_0x19322d=_0x19322d-0x0;var _0x7c7864=_0x646e[_0x19322d];return _0x7c7864;};'use strict';var multer=require('multer');var util=require(_0xe646('0x0'));var path=require(_0xe646('0x1'));var timeout=require(_0xe646('0x2'));var express=require(_0xe646('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe646('0x4'));var interaction=require(_0xe646('0x5'));var config=require(_0xe646('0x6'));var controller=require(_0xe646('0x7'));router[_0xe646('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe646('0x8')](_0xe646('0x9'),auth[_0xe646('0xa')](),controller['describe']);router[_0xe646('0x8')](_0xe646('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xe646('0x8')]('/:id/questions',auth['isAuthenticated'](),controller[_0xe646('0xc')]);router[_0xe646('0xd')]('/',auth['isAuthenticated'](),controller[_0xe646('0xe')]);router[_0xe646('0xf')](_0xe646('0xb'),auth[_0xe646('0xa')](),controller[_0xe646('0x10')]);router[_0xe646('0x11')](_0xe646('0xb'),auth[_0xe646('0xa')](),controller[_0xe646('0x12')]);module[_0xe646('0x13')]=router; \ No newline at end of file +var _0xf2e3=['post','create','update','destroy','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','describe','/:id','show','/:id/questions','getQuestions'];(function(_0x2cf512,_0x1a378a){var _0x2eab49=function(_0x1aa9d7){while(--_0x1aa9d7){_0x2cf512['push'](_0x2cf512['shift']());}};_0x2eab49(++_0x1a378a);}(_0xf2e3,0x13f));var _0x3f2e=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xf2e3[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require(_0x3f2e('0x0'));var util=require(_0x3f2e('0x1'));var path=require(_0x3f2e('0x2'));var timeout=require('connect-timeout');var express=require(_0x3f2e('0x3'));var router=express['Router']();var fs_extra=require(_0x3f2e('0x4'));var auth=require(_0x3f2e('0x5'));var interaction=require(_0x3f2e('0x6'));var config=require(_0x3f2e('0x7'));var controller=require(_0x3f2e('0x8'));router[_0x3f2e('0x9')]('/',auth[_0x3f2e('0xa')](),controller[_0x3f2e('0xb')]);router[_0x3f2e('0x9')]('/describe',auth[_0x3f2e('0xa')](),controller[_0x3f2e('0xc')]);router['get'](_0x3f2e('0xd'),auth['isAuthenticated'](),controller[_0x3f2e('0xe')]);router[_0x3f2e('0x9')](_0x3f2e('0xf'),auth['isAuthenticated'](),controller[_0x3f2e('0x10')]);router[_0x3f2e('0x11')]('/',auth[_0x3f2e('0xa')](),controller[_0x3f2e('0x12')]);router['put'](_0x3f2e('0xd'),auth[_0x3f2e('0xa')](),controller[_0x3f2e('0x13')]);router['delete'](_0x3f2e('0xd'),auth['isAuthenticated'](),controller[_0x3f2e('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index ff7b008..6111697 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 _0x4489=['sequelize','DATE','setDataValue','starttime','STRING','BOOLEAN','moment'];(function(_0xa1ae5c,_0x44beef){var _0x4573c1=function(_0x2580ec){while(--_0x2580ec){_0xa1ae5c['push'](_0xa1ae5c['shift']());}};_0x4573c1(++_0x44beef);}(_0x4489,0x164));var _0x9448=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4489[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x9448('0x0'));var Sequelize=require(_0x9448('0x1'));module['exports']={'starttime':{'type':Sequelize[_0x9448('0x2')],'set':function(_0x12e7d8){this[_0x9448('0x3')](_0x9448('0x4'),_0x12e7d8);this['setDataValue']('endtime',moment()['format']('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0x9448('0x5')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x9448('0x5')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x9448('0x5')]},'calleridnum':{'type':Sequelize[_0x9448('0x5')]},'completed':{'type':Sequelize[_0x9448('0x6')],'defaultValue':![]}}; \ No newline at end of file +var _0xe137=['format','STRING','exports','DATE','setDataValue','starttime'];(function(_0x464845,_0x42ad84){var _0x1f2ddc=function(_0x1af017){while(--_0x1af017){_0x464845['push'](_0x464845['shift']());}};_0x1f2ddc(++_0x42ad84);}(_0xe137,0x176));var _0x7e13=function(_0x1e05c1,_0x3cffa3){_0x1e05c1=_0x1e05c1-0x0;var _0x15f1ca=_0xe137[_0x1e05c1];return _0x15f1ca;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x7e13('0x0')]={'starttime':{'type':Sequelize[_0x7e13('0x1')],'set':function(_0xf2fda0){this[_0x7e13('0x2')](_0x7e13('0x3'),_0xf2fda0);this['setDataValue']('endtime',moment()[_0x7e13('0x4')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0x7e13('0x1')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x7e13('0x5')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x7e13('0x5')]},'calleridname':{'type':Sequelize[_0x7e13('0x5')]},'calleridnum':{'type':Sequelize['STRING']},'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 c1f332e..c6961dd 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 _0xce6d=['then','destroy','error','stack','name','send','index','map','JscriptySessionReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','find','create','body','describe','getQuestions','findOne','JscriptyQuestionReport','SessionId','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','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','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','offset','count','set','reject','save','update'];(function(_0x142ed4,_0x2cd4d7){var _0x3fb06a=function(_0x4a3d88){while(--_0x4a3d88){_0x142ed4['push'](_0x142ed4['shift']());}};_0x3fb06a(++_0x2cd4d7);}(_0xce6d,0xd0));var _0xdce6=function(_0x3203a1,_0x46c498){_0x3203a1=_0x3203a1-0x0;var _0x24215e=_0xce6d[_0x3203a1];return _0x24215e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdce6('0x0'));var zipdir=require(_0xdce6('0x1'));var jsonpatch=require(_0xdce6('0x2'));var rp=require(_0xdce6('0x3'));var moment=require('moment');var BPromise=require(_0xdce6('0x4'));var Mustache=require(_0xdce6('0x5'));var util=require(_0xdce6('0x6'));var path=require('path');var sox=require(_0xdce6('0x7'));var csv=require(_0xdce6('0x8'));var ejs=require(_0xdce6('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdce6('0xa'));var squel=require(_0xdce6('0xb'));var crypto=require(_0xdce6('0xc'));var jsforce=require(_0xdce6('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xdce6('0x8'));var querystring=require(_0xdce6('0xe'));var Papa=require(_0xdce6('0xf'));var Redis=require(_0xdce6('0x10'));var authService=require(_0xdce6('0x11'));var qs=require(_0xdce6('0x12'));var as=require(_0xdce6('0x13'));var hardwareService=require(_0xdce6('0x14'));var logger=require(_0xdce6('0x15'))(_0xdce6('0x16'));var utils=require(_0xdce6('0x17'));var config=require(_0xdce6('0x18'));var licenseUtil=require(_0xdce6('0x19'));var db=require(_0xdce6('0x1a'))['db'];function respondWithStatusCode(_0x156143,_0x2f46be){_0x2f46be=_0x2f46be||0xcc;return function(_0x5317dc){if(_0x5317dc){return _0x156143['sendStatus'](_0x2f46be);}return _0x156143[_0xdce6('0x1b')](_0x2f46be)[_0xdce6('0x1c')]();};}function respondWithResult(_0x36776c,_0x1b2b0b){_0x1b2b0b=_0x1b2b0b||0xc8;return function(_0x79ae1b){if(_0x79ae1b){return _0x36776c['status'](_0x1b2b0b)[_0xdce6('0x1d')](_0x79ae1b);}};}function respondWithFilteredResult(_0x7a77c9,_0xe9cfc){return function(_0x1bc2d0){if(_0x1bc2d0){var _0x27bd89=typeof _0xe9cfc['offset']===_0xdce6('0x1e')&&typeof _0xe9cfc[_0xdce6('0x1f')]===_0xdce6('0x1e');var _0x615a59=_0x1bc2d0['count'];var _0x4a1478=_0x27bd89?0x0:_0xe9cfc[_0xdce6('0x20')];var _0x5af4e6=_0x27bd89?_0x1bc2d0[_0xdce6('0x21')]:_0xe9cfc[_0xdce6('0x20')]+_0xe9cfc[_0xdce6('0x1f')];var _0x1e3c1e;if(_0x5af4e6>=_0x615a59){_0x5af4e6=_0x615a59;_0x1e3c1e=0xc8;}else{_0x1e3c1e=0xce;}_0x7a77c9[_0xdce6('0x1b')](_0x1e3c1e);return _0x7a77c9[_0xdce6('0x22')]('Content-Range',_0x4a1478+'-'+_0x5af4e6+'/'+_0x615a59)['json'](_0x1bc2d0);}return null;};}function patchUpdates(_0x315286){return function(_0x1bc37e){try{jsonpatch['apply'](_0x1bc37e,_0x315286,!![]);}catch(_0x9fd39f){return BPromise[_0xdce6('0x23')](_0x9fd39f);}return _0x1bc37e[_0xdce6('0x24')]();};}function saveUpdates(_0x1d80b8,_0x38665){return function(_0x14a66a){if(_0x14a66a){return _0x14a66a[_0xdce6('0x25')](_0x1d80b8)[_0xdce6('0x26')](function(_0x304d13){return _0x304d13;});}return null;};}function removeEntity(_0x412b31,_0x31c70d){return function(_0x4e0ee4){if(_0x4e0ee4){return _0x4e0ee4[_0xdce6('0x27')]()[_0xdce6('0x26')](function(){_0x412b31['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3008ae,_0x335eb5){return function(_0x2682ed){if(!_0x2682ed){_0x3008ae['sendStatus'](0x194);}return _0x2682ed;};}function handleError(_0x3af3c7,_0xc1671e){_0xc1671e=_0xc1671e||0x1f4;return function(_0x1df528){logger[_0xdce6('0x28')](_0x1df528[_0xdce6('0x29')]);if(_0x1df528[_0xdce6('0x2a')]){delete _0x1df528[_0xdce6('0x2a')];}_0x3af3c7[_0xdce6('0x1b')](_0xc1671e)[_0xdce6('0x2b')](_0x1df528);};}exports[_0xdce6('0x2c')]=function(_0x33fadf,_0x2d83b0){var _0x77105b={},_0x5c35aa={},_0x284d4b={'count':0x0,'rows':[]};var _0x4764c2=_[_0xdce6('0x2d')](db[_0xdce6('0x2e')]['rawAttributes'],function(_0x5975d9){return{'name':_0x5975d9[_0xdce6('0x2f')],'type':_0x5975d9[_0xdce6('0x30')][_0xdce6('0x31')]};});_0x5c35aa[_0xdce6('0x32')]=_[_0xdce6('0x2d')](_0x4764c2,_0xdce6('0x2a'));_0x5c35aa[_0xdce6('0x33')]=_[_0xdce6('0x34')](_0x33fadf[_0xdce6('0x33')]);_0x5c35aa[_0xdce6('0x35')]=_[_0xdce6('0x36')](_0x5c35aa[_0xdce6('0x32')],_0x5c35aa['query']);_0x77105b[_0xdce6('0x37')]=_[_0xdce6('0x36')](_0x5c35aa['model'],qs['fields'](_0x33fadf[_0xdce6('0x33')][_0xdce6('0x38')]));_0x77105b[_0xdce6('0x37')]=_0x77105b[_0xdce6('0x37')]['length']?_0x77105b['attributes']:_0x5c35aa[_0xdce6('0x32')];if(!_0x33fadf[_0xdce6('0x33')][_0xdce6('0x39')]('nolimit')){_0x77105b[_0xdce6('0x1f')]=qs['limit'](_0x33fadf[_0xdce6('0x33')][_0xdce6('0x1f')]);_0x77105b[_0xdce6('0x20')]=qs[_0xdce6('0x20')](_0x33fadf['query'][_0xdce6('0x20')]);}_0x77105b[_0xdce6('0x3a')]=qs[_0xdce6('0x3b')](_0x33fadf[_0xdce6('0x33')][_0xdce6('0x3b')]);_0x77105b[_0xdce6('0x3c')]=qs[_0xdce6('0x35')](_[_0xdce6('0x3d')](_0x33fadf[_0xdce6('0x33')],_0x5c35aa[_0xdce6('0x35')]),_0x4764c2);if(_0x33fadf[_0xdce6('0x33')]['filter']){_0x77105b[_0xdce6('0x3c')]=_[_0xdce6('0x3e')](_0x77105b[_0xdce6('0x3c')],{'$or':_[_0xdce6('0x2d')](_0x4764c2,function(_0x8f592e){if(_0x8f592e[_0xdce6('0x30')]!=='VIRTUAL'){var _0x4e1ff1={};_0x4e1ff1[_0x8f592e[_0xdce6('0x2a')]]={'$like':'%'+_0x33fadf['query'][_0xdce6('0x3f')]+'%'};return _0x4e1ff1;}})});}_0x77105b=_[_0xdce6('0x3e')]({},_0x77105b,_0x33fadf[_0xdce6('0x40')]);var _0x305767={'where':_0x77105b[_0xdce6('0x3c')]};return db[_0xdce6('0x2e')][_0xdce6('0x21')](_0x305767)[_0xdce6('0x26')](function(_0x10b02c){_0x284d4b[_0xdce6('0x21')]=_0x10b02c;if(_0x33fadf[_0xdce6('0x33')][_0xdce6('0x41')]){_0x77105b[_0xdce6('0x42')]=[{'all':!![]}];}return db[_0xdce6('0x2e')][_0xdce6('0x43')](_0x77105b);})[_0xdce6('0x26')](function(_0x571e18){_0x284d4b[_0xdce6('0x44')]=_0x571e18;return _0x284d4b;})[_0xdce6('0x26')](respondWithFilteredResult(_0x2d83b0,_0x77105b))[_0xdce6('0x45')](handleError(_0x2d83b0,null));};exports[_0xdce6('0x46')]=function(_0x3d0314,_0x32eb31){var _0x27bf23={'raw':!![],'where':{'id':_0x3d0314[_0xdce6('0x47')]['id']}},_0x2b04d7={};_0x2b04d7[_0xdce6('0x32')]=_[_0xdce6('0x34')](db[_0xdce6('0x2e')][_0xdce6('0x48')]);_0x2b04d7['query']=_[_0xdce6('0x34')](_0x3d0314[_0xdce6('0x33')]);_0x2b04d7[_0xdce6('0x35')]=_[_0xdce6('0x36')](_0x2b04d7['model'],_0x2b04d7['query']);_0x27bf23[_0xdce6('0x37')]=_[_0xdce6('0x36')](_0x2b04d7['model'],qs[_0xdce6('0x38')](_0x3d0314[_0xdce6('0x33')][_0xdce6('0x38')]));_0x27bf23[_0xdce6('0x37')]=_0x27bf23[_0xdce6('0x37')][_0xdce6('0x49')]?_0x27bf23[_0xdce6('0x37')]:_0x2b04d7[_0xdce6('0x32')];if(_0x3d0314[_0xdce6('0x33')][_0xdce6('0x41')]){_0x27bf23[_0xdce6('0x42')]=[{'all':!![]}];}_0x27bf23=_['merge']({},_0x27bf23,_0x3d0314[_0xdce6('0x40')]);return db[_0xdce6('0x2e')][_0xdce6('0x4a')](_0x27bf23)['then'](handleEntityNotFound(_0x32eb31,null))['then'](respondWithResult(_0x32eb31,null))['catch'](handleError(_0x32eb31,null));};exports[_0xdce6('0x4b')]=function(_0x18ea79,_0x29aa49){return db[_0xdce6('0x2e')]['create'](_0x18ea79[_0xdce6('0x4c')],{})[_0xdce6('0x26')](respondWithResult(_0x29aa49,0xc9))[_0xdce6('0x45')](handleError(_0x29aa49,null));};exports[_0xdce6('0x25')]=function(_0x4e8b68,_0x511b7f){if(_0x4e8b68[_0xdce6('0x4c')]['id']){delete _0x4e8b68['body']['id'];}return db[_0xdce6('0x2e')][_0xdce6('0x4a')]({'where':{'id':_0x4e8b68[_0xdce6('0x47')]['id']}})['then'](handleEntityNotFound(_0x511b7f,null))[_0xdce6('0x26')](saveUpdates(_0x4e8b68[_0xdce6('0x4c')],null))[_0xdce6('0x26')](respondWithResult(_0x511b7f,null))[_0xdce6('0x45')](handleError(_0x511b7f,null));};exports[_0xdce6('0x27')]=function(_0x36b99a,_0x586568){return db['JscriptySessionReport'][_0xdce6('0x4a')]({'where':{'id':_0x36b99a[_0xdce6('0x47')]['id']}})[_0xdce6('0x26')](handleEntityNotFound(_0x586568,null))['then'](removeEntity(_0x586568,null))[_0xdce6('0x45')](handleError(_0x586568,null));};exports['describe']=function(_0x42fe8e,_0x21a4aa){return db['JscriptySessionReport'][_0xdce6('0x4d')]()[_0xdce6('0x26')](respondWithResult(_0x21a4aa,null))[_0xdce6('0x45')](handleError(_0x21a4aa,null));};exports[_0xdce6('0x4e')]=function(_0x2d2256,_0x255614,_0x1385b5){var _0x221408={'raw':!![],'where':{}};var _0x167989={};var _0x1be4c6={'count':0x0,'rows':[]};return db[_0xdce6('0x2e')][_0xdce6('0x4f')]({'where':{'id':_0x2d2256[_0xdce6('0x47')]['id']}})['then'](handleEntityNotFound(_0x255614,null))[_0xdce6('0x26')](function(_0x49d0a8){if(_0x49d0a8){_0x167989[_0xdce6('0x32')]=_[_0xdce6('0x34')](db[_0xdce6('0x50')][_0xdce6('0x48')]);_0x167989[_0xdce6('0x33')]=_[_0xdce6('0x34')](_0x2d2256[_0xdce6('0x33')]);_0x167989['filters']=_[_0xdce6('0x36')](_0x167989[_0xdce6('0x32')],_0x167989['query']);_0x221408[_0xdce6('0x37')]=_[_0xdce6('0x36')](_0x167989[_0xdce6('0x32')],qs['fields'](_0x2d2256[_0xdce6('0x33')][_0xdce6('0x38')]));_0x221408[_0xdce6('0x37')]=_0x221408['attributes'][_0xdce6('0x49')]?_0x221408['attributes']:_0x167989['model'];if(!_0x2d2256[_0xdce6('0x33')][_0xdce6('0x39')]('nolimit')){_0x221408[_0xdce6('0x1f')]=qs[_0xdce6('0x1f')](_0x2d2256[_0xdce6('0x33')][_0xdce6('0x1f')]);_0x221408[_0xdce6('0x20')]=qs[_0xdce6('0x20')](_0x2d2256['query'][_0xdce6('0x20')]);}_0x221408[_0xdce6('0x3a')]=qs[_0xdce6('0x3b')](_0x2d2256[_0xdce6('0x33')][_0xdce6('0x3b')]);_0x221408[_0xdce6('0x3c')]=qs[_0xdce6('0x35')](_[_0xdce6('0x3d')](_0x2d2256[_0xdce6('0x33')],_0x167989[_0xdce6('0x35')]));_0x221408[_0xdce6('0x3c')][_0xdce6('0x51')]=_0x49d0a8['id'];if(_0x2d2256[_0xdce6('0x33')][_0xdce6('0x3f')]){_0x221408[_0xdce6('0x3c')]=_[_0xdce6('0x3e')](_0x221408[_0xdce6('0x3c')],{'$or':_[_0xdce6('0x2d')](_0x221408['attributes'],function(_0x57e68c){var _0x41e577={};_0x41e577[_0x57e68c]={'$like':'%'+_0x2d2256[_0xdce6('0x33')][_0xdce6('0x3f')]+'%'};return _0x41e577;})});}_0x221408=_[_0xdce6('0x3e')]({},_0x221408,_0x2d2256[_0xdce6('0x40')]);return db[_0xdce6('0x50')][_0xdce6('0x21')]({'where':_0x221408[_0xdce6('0x3c')]})[_0xdce6('0x26')](function(_0x2eb5ec){_0x1be4c6[_0xdce6('0x21')]=_0x2eb5ec;if(_0x2d2256['query'][_0xdce6('0x41')]){_0x221408['include']=[{'all':!![]}];}return db[_0xdce6('0x50')][_0xdce6('0x43')](_0x221408);})[_0xdce6('0x26')](function(_0x15268e){_0x1be4c6['rows']=_0x15268e;return _0x1be4c6;});}})[_0xdce6('0x26')](respondWithFilteredResult(_0x255614,_0x221408))[_0xdce6('0x45')](handleError(_0x255614,null));}; \ No newline at end of file +var _0xf034=['merge','VIRTUAL','filter','options','JscriptySessionReport','includeAll','include','findAll','rows','keys','intersection','find','catch','create','body','params','describe','getQuestions','length','order','JscriptyQuestionReport','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../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','apply','reject','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','query','filters','attributes','model','fields','hasOwnProperty','nolimit','sort','where','pick'];(function(_0x343e44,_0x519af9){var _0xa5130e=function(_0xae1fa0){while(--_0xae1fa0){_0x343e44['push'](_0x343e44['shift']());}};_0xa5130e(++_0x519af9);}(_0xf034,0x1a5));var _0x4f03=function(_0x542132,_0x1f016c){_0x542132=_0x542132-0x0;var _0x1ec387=_0xf034[_0x542132];return _0x1ec387;};'use strict';var emlformat=require(_0x4f03('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4f03('0x1'));var jsonpatch=require(_0x4f03('0x2'));var rp=require('request-promise');var moment=require(_0x4f03('0x3'));var BPromise=require(_0x4f03('0x4'));var Mustache=require(_0x4f03('0x5'));var util=require(_0x4f03('0x6'));var path=require(_0x4f03('0x7'));var sox=require(_0x4f03('0x8'));var csv=require(_0x4f03('0x9'));var ejs=require(_0x4f03('0xa'));var fs=require('fs');var fs_extra=require(_0x4f03('0xb'));var _=require(_0x4f03('0xc'));var squel=require('squel');var crypto=require(_0x4f03('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x4f03('0xe'));var toCsv=require('to-csv');var querystring=require(_0x4f03('0xf'));var Papa=require('papaparse');var Redis=require(_0x4f03('0x10'));var authService=require(_0x4f03('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4f03('0x12'));var hardwareService=require(_0x4f03('0x13'));var logger=require(_0x4f03('0x14'))(_0x4f03('0x15'));var utils=require(_0x4f03('0x16'));var config=require(_0x4f03('0x17'));var licenseUtil=require(_0x4f03('0x18'));var db=require(_0x4f03('0x19'))['db'];function respondWithStatusCode(_0x192d67,_0x138e15){_0x138e15=_0x138e15||0xcc;return function(_0x563e84){if(_0x563e84){return _0x192d67[_0x4f03('0x1a')](_0x138e15);}return _0x192d67[_0x4f03('0x1b')](_0x138e15)[_0x4f03('0x1c')]();};}function respondWithResult(_0x317b18,_0x1b4ffe){_0x1b4ffe=_0x1b4ffe||0xc8;return function(_0xd68a01){if(_0xd68a01){return _0x317b18['status'](_0x1b4ffe)[_0x4f03('0x1d')](_0xd68a01);}};}function respondWithFilteredResult(_0x8cd64e,_0x231863){return function(_0x404011){if(_0x404011){var _0x343664=typeof _0x231863[_0x4f03('0x1e')]===_0x4f03('0x1f')&&typeof _0x231863[_0x4f03('0x20')]===_0x4f03('0x1f');var _0x5d26d9=_0x404011[_0x4f03('0x21')];var _0x235a3d=_0x343664?0x0:_0x231863[_0x4f03('0x1e')];var _0x2d619e=_0x343664?_0x404011['count']:_0x231863[_0x4f03('0x1e')]+_0x231863[_0x4f03('0x20')];var _0x1ac6ed;if(_0x2d619e>=_0x5d26d9){_0x2d619e=_0x5d26d9;_0x1ac6ed=0xc8;}else{_0x1ac6ed=0xce;}_0x8cd64e[_0x4f03('0x1b')](_0x1ac6ed);return _0x8cd64e[_0x4f03('0x22')]('Content-Range',_0x235a3d+'-'+_0x2d619e+'/'+_0x5d26d9)['json'](_0x404011);}return null;};}function patchUpdates(_0x54f081){return function(_0x4ccca4){try{jsonpatch[_0x4f03('0x23')](_0x4ccca4,_0x54f081,!![]);}catch(_0x185a00){return BPromise[_0x4f03('0x24')](_0x185a00);}return _0x4ccca4['save']();};}function saveUpdates(_0x419385,_0x9704b7){return function(_0x1e729e){if(_0x1e729e){return _0x1e729e[_0x4f03('0x25')](_0x419385)[_0x4f03('0x26')](function(_0x3363ca){return _0x3363ca;});}return null;};}function removeEntity(_0x356ac1,_0x4814bf){return function(_0x3b2875){if(_0x3b2875){return _0x3b2875[_0x4f03('0x27')]()['then'](function(){_0x356ac1[_0x4f03('0x1b')](0xcc)[_0x4f03('0x1c')]();});}};}function handleEntityNotFound(_0x54a436,_0x3dfa43){return function(_0xb027fd){if(!_0xb027fd){_0x54a436[_0x4f03('0x1a')](0x194);}return _0xb027fd;};}function handleError(_0xa5d604,_0x285a04){_0x285a04=_0x285a04||0x1f4;return function(_0x19d3b4){logger[_0x4f03('0x28')](_0x19d3b4[_0x4f03('0x29')]);if(_0x19d3b4[_0x4f03('0x2a')]){delete _0x19d3b4[_0x4f03('0x2a')];}_0xa5d604[_0x4f03('0x1b')](_0x285a04)[_0x4f03('0x2b')](_0x19d3b4);};}exports[_0x4f03('0x2c')]=function(_0x58ec19,_0x123310){var _0x4c26d8={},_0x5b210e={},_0x2229b9={'count':0x0,'rows':[]};var _0xc7013f=_[_0x4f03('0x2d')](db['JscriptySessionReport'][_0x4f03('0x2e')],function(_0x244821){return{'name':_0x244821[_0x4f03('0x2f')],'type':_0x244821[_0x4f03('0x30')]['key']};});_0x5b210e['model']=_[_0x4f03('0x2d')](_0xc7013f,_0x4f03('0x2a'));_0x5b210e['query']=_['keys'](_0x58ec19[_0x4f03('0x31')]);_0x5b210e[_0x4f03('0x32')]=_['intersection'](_0x5b210e['model'],_0x5b210e[_0x4f03('0x31')]);_0x4c26d8[_0x4f03('0x33')]=_['intersection'](_0x5b210e[_0x4f03('0x34')],qs[_0x4f03('0x35')](_0x58ec19[_0x4f03('0x31')]['fields']));_0x4c26d8['attributes']=_0x4c26d8[_0x4f03('0x33')]['length']?_0x4c26d8['attributes']:_0x5b210e[_0x4f03('0x34')];if(!_0x58ec19[_0x4f03('0x31')][_0x4f03('0x36')](_0x4f03('0x37'))){_0x4c26d8['limit']=qs['limit'](_0x58ec19[_0x4f03('0x31')][_0x4f03('0x20')]);_0x4c26d8[_0x4f03('0x1e')]=qs['offset'](_0x58ec19['query']['offset']);}_0x4c26d8['order']=qs[_0x4f03('0x38')](_0x58ec19[_0x4f03('0x31')][_0x4f03('0x38')]);_0x4c26d8[_0x4f03('0x39')]=qs[_0x4f03('0x32')](_[_0x4f03('0x3a')](_0x58ec19[_0x4f03('0x31')],_0x5b210e[_0x4f03('0x32')]),_0xc7013f);if(_0x58ec19[_0x4f03('0x31')]['filter']){_0x4c26d8[_0x4f03('0x39')]=_[_0x4f03('0x3b')](_0x4c26d8['where'],{'$or':_[_0x4f03('0x2d')](_0xc7013f,function(_0x3471fc){if(_0x3471fc[_0x4f03('0x30')]!==_0x4f03('0x3c')){var _0x51b010={};_0x51b010[_0x3471fc[_0x4f03('0x2a')]]={'$like':'%'+_0x58ec19[_0x4f03('0x31')][_0x4f03('0x3d')]+'%'};return _0x51b010;}})});}_0x4c26d8=_['merge']({},_0x4c26d8,_0x58ec19[_0x4f03('0x3e')]);var _0x107bad={'where':_0x4c26d8[_0x4f03('0x39')]};return db[_0x4f03('0x3f')][_0x4f03('0x21')](_0x107bad)['then'](function(_0x1489c1){_0x2229b9['count']=_0x1489c1;if(_0x58ec19[_0x4f03('0x31')][_0x4f03('0x40')]){_0x4c26d8[_0x4f03('0x41')]=[{'all':!![]}];}return db[_0x4f03('0x3f')][_0x4f03('0x42')](_0x4c26d8);})[_0x4f03('0x26')](function(_0x50fc70){_0x2229b9[_0x4f03('0x43')]=_0x50fc70;return _0x2229b9;})[_0x4f03('0x26')](respondWithFilteredResult(_0x123310,_0x4c26d8))['catch'](handleError(_0x123310,null));};exports['show']=function(_0x3445a1,_0x423a8d){var _0x46033e={'raw':!![],'where':{'id':_0x3445a1['params']['id']}},_0x4215b6={};_0x4215b6[_0x4f03('0x34')]=_['keys'](db[_0x4f03('0x3f')]['rawAttributes']);_0x4215b6[_0x4f03('0x31')]=_[_0x4f03('0x44')](_0x3445a1[_0x4f03('0x31')]);_0x4215b6[_0x4f03('0x32')]=_[_0x4f03('0x45')](_0x4215b6['model'],_0x4215b6[_0x4f03('0x31')]);_0x46033e[_0x4f03('0x33')]=_[_0x4f03('0x45')](_0x4215b6[_0x4f03('0x34')],qs[_0x4f03('0x35')](_0x3445a1['query'][_0x4f03('0x35')]));_0x46033e[_0x4f03('0x33')]=_0x46033e[_0x4f03('0x33')]['length']?_0x46033e[_0x4f03('0x33')]:_0x4215b6[_0x4f03('0x34')];if(_0x3445a1[_0x4f03('0x31')][_0x4f03('0x40')]){_0x46033e[_0x4f03('0x41')]=[{'all':!![]}];}_0x46033e=_[_0x4f03('0x3b')]({},_0x46033e,_0x3445a1['options']);return db['JscriptySessionReport'][_0x4f03('0x46')](_0x46033e)['then'](handleEntityNotFound(_0x423a8d,null))[_0x4f03('0x26')](respondWithResult(_0x423a8d,null))[_0x4f03('0x47')](handleError(_0x423a8d,null));};exports[_0x4f03('0x48')]=function(_0x1ce36c,_0x3fcbe7){return db[_0x4f03('0x3f')][_0x4f03('0x48')](_0x1ce36c[_0x4f03('0x49')],{})[_0x4f03('0x26')](respondWithResult(_0x3fcbe7,0xc9))[_0x4f03('0x47')](handleError(_0x3fcbe7,null));};exports[_0x4f03('0x25')]=function(_0x2381bc,_0x3c4c30){if(_0x2381bc['body']['id']){delete _0x2381bc['body']['id'];}return db[_0x4f03('0x3f')][_0x4f03('0x46')]({'where':{'id':_0x2381bc[_0x4f03('0x4a')]['id']}})[_0x4f03('0x26')](handleEntityNotFound(_0x3c4c30,null))[_0x4f03('0x26')](saveUpdates(_0x2381bc['body'],null))[_0x4f03('0x26')](respondWithResult(_0x3c4c30,null))[_0x4f03('0x47')](handleError(_0x3c4c30,null));};exports['destroy']=function(_0x572ed5,_0x417a26){return db['JscriptySessionReport']['find']({'where':{'id':_0x572ed5['params']['id']}})[_0x4f03('0x26')](handleEntityNotFound(_0x417a26,null))[_0x4f03('0x26')](removeEntity(_0x417a26,null))[_0x4f03('0x47')](handleError(_0x417a26,null));};exports[_0x4f03('0x4b')]=function(_0x48f2a8,_0x3acaaf){return db[_0x4f03('0x3f')][_0x4f03('0x4b')]()[_0x4f03('0x26')](respondWithResult(_0x3acaaf,null))[_0x4f03('0x47')](handleError(_0x3acaaf,null));};exports[_0x4f03('0x4c')]=function(_0x157797,_0x449eae,_0x35ff7b){var _0x532a2f={'raw':!![],'where':{}};var _0x4dadd7={};var _0x3537e7={'count':0x0,'rows':[]};return db['JscriptySessionReport']['findOne']({'where':{'id':_0x157797['params']['id']}})['then'](handleEntityNotFound(_0x449eae,null))[_0x4f03('0x26')](function(_0x89e911){if(_0x89e911){_0x4dadd7['model']=_[_0x4f03('0x44')](db['JscriptyQuestionReport']['rawAttributes']);_0x4dadd7['query']=_[_0x4f03('0x44')](_0x157797[_0x4f03('0x31')]);_0x4dadd7['filters']=_[_0x4f03('0x45')](_0x4dadd7[_0x4f03('0x34')],_0x4dadd7[_0x4f03('0x31')]);_0x532a2f[_0x4f03('0x33')]=_['intersection'](_0x4dadd7[_0x4f03('0x34')],qs[_0x4f03('0x35')](_0x157797[_0x4f03('0x31')][_0x4f03('0x35')]));_0x532a2f[_0x4f03('0x33')]=_0x532a2f[_0x4f03('0x33')][_0x4f03('0x4d')]?_0x532a2f[_0x4f03('0x33')]:_0x4dadd7[_0x4f03('0x34')];if(!_0x157797['query'][_0x4f03('0x36')](_0x4f03('0x37'))){_0x532a2f[_0x4f03('0x20')]=qs[_0x4f03('0x20')](_0x157797[_0x4f03('0x31')][_0x4f03('0x20')]);_0x532a2f['offset']=qs['offset'](_0x157797[_0x4f03('0x31')][_0x4f03('0x1e')]);}_0x532a2f[_0x4f03('0x4e')]=qs[_0x4f03('0x38')](_0x157797[_0x4f03('0x31')][_0x4f03('0x38')]);_0x532a2f[_0x4f03('0x39')]=qs['filters'](_[_0x4f03('0x3a')](_0x157797[_0x4f03('0x31')],_0x4dadd7[_0x4f03('0x32')]));_0x532a2f[_0x4f03('0x39')]['SessionId']=_0x89e911['id'];if(_0x157797[_0x4f03('0x31')][_0x4f03('0x3d')]){_0x532a2f[_0x4f03('0x39')]=_['merge'](_0x532a2f[_0x4f03('0x39')],{'$or':_['map'](_0x532a2f['attributes'],function(_0x199c91){var _0x1ae1d6={};_0x1ae1d6[_0x199c91]={'$like':'%'+_0x157797[_0x4f03('0x31')][_0x4f03('0x3d')]+'%'};return _0x1ae1d6;})});}_0x532a2f=_[_0x4f03('0x3b')]({},_0x532a2f,_0x157797[_0x4f03('0x3e')]);return db[_0x4f03('0x4f')][_0x4f03('0x21')]({'where':_0x532a2f[_0x4f03('0x39')]})['then'](function(_0x4a4c48){_0x3537e7[_0x4f03('0x21')]=_0x4a4c48;if(_0x157797[_0x4f03('0x31')]['includeAll']){_0x532a2f[_0x4f03('0x41')]=[{'all':!![]}];}return db[_0x4f03('0x4f')]['findAll'](_0x532a2f);})[_0x4f03('0x26')](function(_0x1bc68f){_0x3537e7['rows']=_0x1bc68f;return _0x3537e7;});}})[_0x4f03('0x26')](respondWithFilteredResult(_0x449eae,_0x532a2f))['catch'](handleError(_0x449eae,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 76f2442..8ab1bf5 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 _0x7fbe=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x2acd24,_0xf315ac){_0x2acd24=_0x2acd24-0x0;var _0x546099=_0x7fbe[_0x2acd24];return _0x546099;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe7fb('0x0'))(_0xe7fb('0x1'));var moment=require(_0xe7fb('0x2'));var BPromise=require(_0xe7fb('0x3'));var rp=require(_0xe7fb('0x4'));var fs=require('fs');var path=require(_0xe7fb('0x5'));var rimraf=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var attributes=require(_0xe7fb('0x8'));module[_0xe7fb('0x9')]=function(_0x290172,_0x12d1b0){return _0x290172[_0xe7fb('0xa')](_0xe7fb('0xb'),attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7da7=['util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','exports','define','report_jscripty_sessions','lodash'];(function(_0x5f5800,_0x5a7422){var _0x165002=function(_0x3373c4){while(--_0x3373c4){_0x5f5800['push'](_0x5f5800['shift']());}};_0x165002(++_0x5a7422);}(_0x7da7,0x10d));var _0x77da=function(_0xcfe8cc,_0xb83aeb){_0xcfe8cc=_0xcfe8cc-0x0;var _0x55ac53=_0x7da7[_0xcfe8cc];return _0x55ac53;};'use strict';var _=require(_0x77da('0x0'));var util=require(_0x77da('0x1'));var logger=require(_0x77da('0x2'))('api');var moment=require('moment');var BPromise=require(_0x77da('0x3'));var rp=require(_0x77da('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x77da('0x5'));var config=require(_0x77da('0x6'));var attributes=require('./jscriptySessionReport.attributes');module[_0x77da('0x7')]=function(_0xc54a12,_0x47da81){return _0xc54a12[_0x77da('0x8')]('JscriptySessionReport',attributes,{'tableName':_0x77da('0x9'),'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 79dea2f..bc9a1e2 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 _0x32f4=['info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then'];(function(_0x9861ff,_0x41fb17){var _0x48852b=function(_0x557001){while(--_0x557001){_0x9861ff['push'](_0x9861ff['shift']());}};_0x48852b(++_0x41fb17);}(_0x32f4,0x154));var _0x432f=function(_0x10ad5c,_0x5cd5eb){_0x10ad5c=_0x10ad5c-0x0;var _0x2a0d9c=_0x32f4[_0x10ad5c];return _0x2a0d9c;};'use strict';var _=require(_0x432f('0x0'));var util=require(_0x432f('0x1'));var moment=require(_0x432f('0x2'));var BPromise=require(_0x432f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x432f('0x4'));var db=require(_0x432f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x432f('0x6'))(_0x432f('0x7'));var config=require(_0x432f('0x8'));var jayson=require(_0x432f('0x9'));var client=jayson[_0x432f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b5f08,_0x2f66fd,_0x32b062){return new BPromise(function(_0x4a5b56,_0x2a2ef6){return client['request'](_0x5b5f08,_0x32b062)[_0x432f('0xb')](function(_0x340fe9){logger[_0x432f('0xc')](_0x432f('0xd'),_0x2f66fd,_0x432f('0xe'));logger['debug'](_0x432f('0xf'),_0x2f66fd,'request\x20sent',JSON[_0x432f('0x10')](_0x340fe9));if(_0x340fe9['error']){if(_0x340fe9[_0x432f('0x11')][_0x432f('0x12')]===0x1f4){logger['error'](_0x432f('0xd'),_0x2f66fd,_0x340fe9[_0x432f('0x11')]['message']);return _0x2a2ef6(_0x340fe9[_0x432f('0x11')][_0x432f('0x13')]);}logger['error']('JscriptySessionReport,\x20%s,\x20%s',_0x2f66fd,_0x340fe9[_0x432f('0x11')][_0x432f('0x13')]);return _0x4a5b56(_0x340fe9[_0x432f('0x11')][_0x432f('0x13')]);}else{logger[_0x432f('0xc')]('JscriptySessionReport,\x20%s,\x20%s',_0x2f66fd,_0x432f('0xe'));_0x4a5b56(_0x340fe9[_0x432f('0x14')][_0x432f('0x13')]);}})[_0x432f('0x15')](function(_0x5bae29){logger[_0x432f('0x11')](_0x432f('0xd'),_0x2f66fd,_0x5bae29);_0x2a2ef6(_0x5bae29);});});} \ No newline at end of file +var _0xbff5=['message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xbff5,0x1bc));var _0x5bff=function(_0x2ddcb1,_0x2e3a8a){_0x2ddcb1=_0x2ddcb1-0x0;var _0x925280=_0xbff5[_0x2ddcb1];return _0x925280;};'use strict';var _=require(_0x5bff('0x0'));var util=require(_0x5bff('0x1'));var moment=require(_0x5bff('0x2'));var BPromise=require(_0x5bff('0x3'));var rs=require(_0x5bff('0x4'));var fs=require('fs');var Redis=require(_0x5bff('0x5'));var db=require(_0x5bff('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x5bff('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5bff('0x8'));var client=jayson[_0x5bff('0x9')][_0x5bff('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa54c57,_0x43605a,_0xd4b9dc){return new BPromise(function(_0x1acb49,_0x139c99){return client[_0x5bff('0xb')](_0xa54c57,_0xd4b9dc)['then'](function(_0x20e26f){logger['info'](_0x5bff('0xc'),_0x43605a,_0x5bff('0xd'));logger['debug'](_0x5bff('0xe'),_0x43605a,'request\x20sent',JSON[_0x5bff('0xf')](_0x20e26f));if(_0x20e26f['error']){if(_0x20e26f[_0x5bff('0x10')][_0x5bff('0x11')]===0x1f4){logger['error'](_0x5bff('0xc'),_0x43605a,_0x20e26f['error'][_0x5bff('0x12')]);return _0x139c99(_0x20e26f[_0x5bff('0x10')]['message']);}logger[_0x5bff('0x10')](_0x5bff('0xc'),_0x43605a,_0x20e26f['error']['message']);return _0x1acb49(_0x20e26f[_0x5bff('0x10')][_0x5bff('0x12')]);}else{logger[_0x5bff('0x13')]('JscriptySessionReport,\x20%s,\x20%s',_0x43605a,_0x5bff('0xd'));_0x1acb49(_0x20e26f[_0x5bff('0x14')][_0x5bff('0x12')]);}})['catch'](function(_0x3ffbbc){logger[_0x5bff('0x10')](_0x5bff('0xc'),_0x43605a,_0x3ffbbc);_0x139c99(_0x3ffbbc);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 62f1cc8..901e4db 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 _0xd13e=['../../components/auth/service','../../config/environment','./license.controller','/:id','isAuthenticated','update','exports','multer','util','path','connect-timeout','Router'];(function(_0x348675,_0x3cad73){var _0x5de4a5=function(_0x463d95){while(--_0x463d95){_0x348675['push'](_0x348675['shift']());}};_0x5de4a5(++_0x3cad73);}(_0xd13e,0x193));var _0xed13=function(_0x532ce5,_0x1ef5d6){_0x532ce5=_0x532ce5-0x0;var _0x40f7d6=_0xd13e[_0x532ce5];return _0x40f7d6;};'use strict';var multer=require(_0xed13('0x0'));var util=require(_0xed13('0x1'));var path=require(_0xed13('0x2'));var timeout=require(_0xed13('0x3'));var express=require('express');var router=express[_0xed13('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xed13('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xed13('0x6'));var controller=require(_0xed13('0x7'));router['get']('/',controller['index']);router['put'](_0xed13('0x8'),auth[_0xed13('0x9')](),controller[_0xed13('0xa')]);module[_0xed13('0xb')]=router; \ No newline at end of file +var _0xdbd0=['express','fs-extra','../../components/auth/service','../../components/interaction/service','./license.controller','get','index','put','update','exports','multer','util','path','connect-timeout'];(function(_0x40d0a3,_0x2977d0){var _0x546309=function(_0x43383f){while(--_0x43383f){_0x40d0a3['push'](_0x40d0a3['shift']());}};_0x546309(++_0x2977d0);}(_0xdbd0,0x88));var _0x0dbd=function(_0x38d696,_0x5483f8){_0x38d696=_0x38d696-0x0;var _0x127388=_0xdbd0[_0x38d696];return _0x127388;};'use strict';var multer=require(_0x0dbd('0x0'));var util=require(_0x0dbd('0x1'));var path=require(_0x0dbd('0x2'));var timeout=require(_0x0dbd('0x3'));var express=require(_0x0dbd('0x4'));var router=express['Router']();var fs_extra=require(_0x0dbd('0x5'));var auth=require(_0x0dbd('0x6'));var interaction=require(_0x0dbd('0x7'));var config=require('../../config/environment');var controller=require(_0x0dbd('0x8'));router[_0x0dbd('0x9')]('/',controller[_0x0dbd('0xa')]);router[_0x0dbd('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x0dbd('0xc')]);module[_0x0dbd('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 d15fa37..07ace08 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 _0x0650=['TEXT','STRING','sequelize','exports'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x0650,0x6e));var _0x0065=function(_0x322c2e,_0x462f77){_0x322c2e=_0x322c2e-0x0;var _0xb563cd=_0x0650[_0x322c2e];return _0xb563cd;};'use strict';var Sequelize=require(_0x0065('0x0'));module[_0x0065('0x1')]={'license':{'type':Sequelize[_0x0065('0x2')]},'data1':{'type':Sequelize[_0x0065('0x3')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x30a9=['sequelize','TEXT','STRING'];(function(_0x5ac1d5,_0x23fc0b){var _0x400521=function(_0x51ca5f){while(--_0x51ca5f){_0x5ac1d5['push'](_0x5ac1d5['shift']());}};_0x400521(++_0x23fc0b);}(_0x30a9,0x147));var _0x930a=function(_0x1051c7,_0x5d2e37){_0x1051c7=_0x1051c7-0x0;var _0xf25821=_0x30a9[_0x1051c7];return _0xf25821;};'use strict';var Sequelize=require(_0x930a('0x0'));module['exports']={'license':{'type':Sequelize[_0x930a('0x1')]},'data1':{'type':Sequelize[_0x930a('0x2')]},'data2':{'type':Sequelize[_0x930a('0x2')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'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 30b492c..b8de1ec 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 _0x1261=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','stack','send','index','model','License','query','intersection','fields','attributes','merge','options','getLicense','catch','body','find','params','get','key','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis'];(function(_0xbb1d83,_0x5dbbf0){var _0x4165d0=function(_0x3ccb9d){while(--_0x3ccb9d){_0xbb1d83['push'](_0xbb1d83['shift']());}};_0x4165d0(++_0x5dbbf0);}(_0x1261,0x144));var _0x1126=function(_0x270dba,_0x1817d2){_0x270dba=_0x270dba-0x0;var _0x36b83b=_0x1261[_0x270dba];return _0x36b83b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1126('0x0'));var zipdir=require(_0x1126('0x1'));var jsonpatch=require(_0x1126('0x2'));var rp=require(_0x1126('0x3'));var moment=require(_0x1126('0x4'));var BPromise=require(_0x1126('0x5'));var Mustache=require(_0x1126('0x6'));var util=require(_0x1126('0x7'));var path=require(_0x1126('0x8'));var sox=require(_0x1126('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1126('0xa'));var _=require(_0x1126('0xb'));var squel=require('squel');var crypto=require(_0x1126('0xc'));var jsforce=require(_0x1126('0xd'));var deskjs=require(_0x1126('0xe'));var toCsv=require(_0x1126('0xf'));var querystring=require(_0x1126('0x10'));var Papa=require('papaparse');var Redis=require(_0x1126('0x11'));var authService=require(_0x1126('0x12'));var qs=require(_0x1126('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1126('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x1126('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1126('0x16'));var db=require(_0x1126('0x17'))['db'];function respondWithStatusCode(_0xd26a32,_0x273896){_0x273896=_0x273896||0xcc;return function(_0xca0355){if(_0xca0355){return _0xd26a32[_0x1126('0x18')](_0x273896);}return _0xd26a32[_0x1126('0x19')](_0x273896)[_0x1126('0x1a')]();};}function respondWithResult(_0x43850b,_0x53a8f0){_0x53a8f0=_0x53a8f0||0xc8;return function(_0x5de9a7){if(_0x5de9a7){return _0x43850b[_0x1126('0x19')](_0x53a8f0)[_0x1126('0x1b')](_0x5de9a7);}};}function respondWithFilteredResult(_0x279455,_0x4be0c6){return function(_0x45149c){if(_0x45149c){var _0x4794a7=typeof _0x4be0c6[_0x1126('0x1c')]===_0x1126('0x1d')&&typeof _0x4be0c6[_0x1126('0x1e')]==='undefined';var _0x245cd7=_0x45149c[_0x1126('0x1f')];var _0x4a7b49=_0x4794a7?0x0:_0x4be0c6['offset'];var _0x22ae0b=_0x4794a7?_0x45149c[_0x1126('0x1f')]:_0x4be0c6['offset']+_0x4be0c6['limit'];var _0x4564c0;if(_0x22ae0b>=_0x245cd7){_0x22ae0b=_0x245cd7;_0x4564c0=0xc8;}else{_0x4564c0=0xce;}_0x279455['status'](_0x4564c0);return _0x279455[_0x1126('0x20')](_0x1126('0x21'),_0x4a7b49+'-'+_0x22ae0b+'/'+_0x245cd7)[_0x1126('0x1b')](_0x45149c);}return null;};}function patchUpdates(_0x54400a){return function(_0x2a08ba){try{jsonpatch['apply'](_0x2a08ba,_0x54400a,!![]);}catch(_0x56efeb){return BPromise[_0x1126('0x22')](_0x56efeb);}return _0x2a08ba[_0x1126('0x23')]();};}function saveUpdates(_0x25b24b,_0x36d254){return function(_0x526ca1){if(_0x526ca1){return _0x526ca1[_0x1126('0x24')](_0x25b24b)[_0x1126('0x25')](function(_0x48a08d){return _0x48a08d;});}return null;};}function removeEntity(_0x2175fa,_0x59cd8e){return function(_0x529dd9){if(_0x529dd9){return _0x529dd9['destroy']()[_0x1126('0x25')](function(){_0x2175fa[_0x1126('0x19')](0xcc)[_0x1126('0x1a')]();});}};}function handleEntityNotFound(_0x34bcf1,_0x566c09){return function(_0x1b07a7){if(!_0x1b07a7){_0x34bcf1[_0x1126('0x18')](0x194);}return _0x1b07a7;};}function handleError(_0x38119d,_0x589725){_0x589725=_0x589725||0x1f4;return function(_0x35eec3){logger[_0x1126('0x26')](_0x35eec3[_0x1126('0x27')]);if(_0x35eec3['name']){delete _0x35eec3['name'];}_0x38119d[_0x1126('0x19')](_0x589725)[_0x1126('0x28')](_0x35eec3);};}var utilLicense=require('../../config/license/util');exports[_0x1126('0x29')]=function(_0x23d2bc,_0x4a334a){var _0x3fa694={'raw':!![],'where':{'id':0x1}},_0x4bf807={};_0x4bf807[_0x1126('0x2a')]=_['keys'](db[_0x1126('0x2b')]['rawAttributes']);_0x4bf807[_0x1126('0x2c')]=_['keys'](_0x23d2bc['query']);_0x4bf807['filters']=_[_0x1126('0x2d')](_0x4bf807[_0x1126('0x2a')],_0x4bf807[_0x1126('0x2c')]);_0x3fa694['attributes']=_[_0x1126('0x2d')](_0x4bf807[_0x1126('0x2a')],qs['fields'](_0x23d2bc[_0x1126('0x2c')][_0x1126('0x2e')]));_0x3fa694[_0x1126('0x2f')]=_0x3fa694[_0x1126('0x2f')]['length']?_0x3fa694['attributes']:_0x4bf807[_0x1126('0x2a')];_0x3fa694=_[_0x1126('0x30')]({},_0x3fa694,_0x23d2bc[_0x1126('0x31')]);return utilLicense[_0x1126('0x32')](_0x3fa694)['then'](respondWithResult(_0x4a334a,null))[_0x1126('0x33')](handleError(_0x4a334a,null));};exports[_0x1126('0x24')]=function(_0x313ebe,_0x22436c){if(_0x313ebe[_0x1126('0x34')]['id']){delete _0x313ebe['body']['id'];}return db[_0x1126('0x2b')][_0x1126('0x35')]({'where':{'id':_0x313ebe[_0x1126('0x36')]['id']}})[_0x1126('0x25')](handleEntityNotFound(_0x22436c,null))['then'](function(_0x4ca51c){var _0x22827a=_0x4ca51c[_0x1126('0x37')]({'plain':!![]});return utilLicense['checkLicense'](_0x22827a,_0x313ebe[_0x1126('0x34')][_0x1126('0x38')]);})[_0x1126('0x25')](function(_0x5c08b9){if(!_0x5c08b9['demo']){return saveUpdates(_0x313ebe[_0x1126('0x34')],null);}return _0x5c08b9;})[_0x1126('0x25')](respondWithResult(_0x22436c,null))[_0x1126('0x33')](handleError(_0x22436c,null));}; \ No newline at end of file +var _0x53ec=['Content-Range','apply','reject','save','then','sendStatus','name','send','index','model','keys','License','rawAttributes','query','filters','intersection','attributes','fields','length','merge','options','getLicense','catch','update','body','find','params','get','key','demo','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set'];(function(_0x368df0,_0x14bb3b){var _0x416dc3=function(_0x3d4a8c){while(--_0x3d4a8c){_0x368df0['push'](_0x368df0['shift']());}};_0x416dc3(++_0x14bb3b);}(_0x53ec,0x192));var _0xc53e=function(_0x491ec2,_0x540c00){_0x491ec2=_0x491ec2-0x0;var _0x1748db=_0x53ec[_0x491ec2];return _0x1748db;};'use strict';var emlformat=require(_0xc53e('0x0'));var rimraf=require(_0xc53e('0x1'));var zipdir=require(_0xc53e('0x2'));var jsonpatch=require(_0xc53e('0x3'));var rp=require(_0xc53e('0x4'));var moment=require(_0xc53e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc53e('0x6'));var util=require('util');var path=require(_0xc53e('0x7'));var sox=require(_0xc53e('0x8'));var csv=require('to-csv');var ejs=require(_0xc53e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc53e('0xa'));var squel=require(_0xc53e('0xb'));var crypto=require('crypto');var jsforce=require(_0xc53e('0xc'));var deskjs=require(_0xc53e('0xd'));var toCsv=require(_0xc53e('0xe'));var querystring=require(_0xc53e('0xf'));var Papa=require(_0xc53e('0x10'));var Redis=require(_0xc53e('0x11'));var authService=require(_0xc53e('0x12'));var qs=require(_0xc53e('0x13'));var as=require(_0xc53e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc53e('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc53e('0x16'));var db=require(_0xc53e('0x17'))['db'];function respondWithStatusCode(_0x863fa,_0x4203aa){_0x4203aa=_0x4203aa||0xcc;return function(_0x56f0e5){if(_0x56f0e5){return _0x863fa['sendStatus'](_0x4203aa);}return _0x863fa[_0xc53e('0x18')](_0x4203aa)[_0xc53e('0x19')]();};}function respondWithResult(_0x7cd798,_0x3d2e17){_0x3d2e17=_0x3d2e17||0xc8;return function(_0x358ef3){if(_0x358ef3){return _0x7cd798[_0xc53e('0x18')](_0x3d2e17)[_0xc53e('0x1a')](_0x358ef3);}};}function respondWithFilteredResult(_0x19c0d1,_0x455e4d){return function(_0x2ad6eb){if(_0x2ad6eb){var _0x5b0a88=typeof _0x455e4d[_0xc53e('0x1b')]===_0xc53e('0x1c')&&typeof _0x455e4d[_0xc53e('0x1d')]===_0xc53e('0x1c');var _0x15333b=_0x2ad6eb[_0xc53e('0x1e')];var _0x164016=_0x5b0a88?0x0:_0x455e4d[_0xc53e('0x1b')];var _0x3b550e=_0x5b0a88?_0x2ad6eb['count']:_0x455e4d['offset']+_0x455e4d[_0xc53e('0x1d')];var _0x2a5bac;if(_0x3b550e>=_0x15333b){_0x3b550e=_0x15333b;_0x2a5bac=0xc8;}else{_0x2a5bac=0xce;}_0x19c0d1[_0xc53e('0x18')](_0x2a5bac);return _0x19c0d1[_0xc53e('0x1f')](_0xc53e('0x20'),_0x164016+'-'+_0x3b550e+'/'+_0x15333b)[_0xc53e('0x1a')](_0x2ad6eb);}return null;};}function patchUpdates(_0x15a015){return function(_0x25702b){try{jsonpatch[_0xc53e('0x21')](_0x25702b,_0x15a015,!![]);}catch(_0x401af6){return BPromise[_0xc53e('0x22')](_0x401af6);}return _0x25702b[_0xc53e('0x23')]();};}function saveUpdates(_0x426467,_0x4fb695){return function(_0x47cfdd){if(_0x47cfdd){return _0x47cfdd['update'](_0x426467)[_0xc53e('0x24')](function(_0x384218){return _0x384218;});}return null;};}function removeEntity(_0x7591c1,_0x4015c8){return function(_0x180811){if(_0x180811){return _0x180811['destroy']()['then'](function(){_0x7591c1[_0xc53e('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ae55e,_0x3a5ce8){return function(_0x443179){if(!_0x443179){_0x1ae55e[_0xc53e('0x25')](0x194);}return _0x443179;};}function handleError(_0x63c5dc,_0x4df8cf){_0x4df8cf=_0x4df8cf||0x1f4;return function(_0x398e7a){logger['error'](_0x398e7a['stack']);if(_0x398e7a['name']){delete _0x398e7a[_0xc53e('0x26')];}_0x63c5dc['status'](_0x4df8cf)[_0xc53e('0x27')](_0x398e7a);};}var utilLicense=require('../../config/license/util');exports[_0xc53e('0x28')]=function(_0x5112d2,_0x5ce216){var _0x8f0ee6={'raw':!![],'where':{'id':0x1}},_0x6a62b0={};_0x6a62b0[_0xc53e('0x29')]=_[_0xc53e('0x2a')](db[_0xc53e('0x2b')][_0xc53e('0x2c')]);_0x6a62b0[_0xc53e('0x2d')]=_[_0xc53e('0x2a')](_0x5112d2['query']);_0x6a62b0[_0xc53e('0x2e')]=_[_0xc53e('0x2f')](_0x6a62b0[_0xc53e('0x29')],_0x6a62b0['query']);_0x8f0ee6[_0xc53e('0x30')]=_['intersection'](_0x6a62b0[_0xc53e('0x29')],qs[_0xc53e('0x31')](_0x5112d2['query']['fields']));_0x8f0ee6[_0xc53e('0x30')]=_0x8f0ee6[_0xc53e('0x30')][_0xc53e('0x32')]?_0x8f0ee6[_0xc53e('0x30')]:_0x6a62b0[_0xc53e('0x29')];_0x8f0ee6=_[_0xc53e('0x33')]({},_0x8f0ee6,_0x5112d2[_0xc53e('0x34')]);return utilLicense[_0xc53e('0x35')](_0x8f0ee6)['then'](respondWithResult(_0x5ce216,null))[_0xc53e('0x36')](handleError(_0x5ce216,null));};exports[_0xc53e('0x37')]=function(_0x19020b,_0x17ad32){if(_0x19020b[_0xc53e('0x38')]['id']){delete _0x19020b[_0xc53e('0x38')]['id'];}return db[_0xc53e('0x2b')][_0xc53e('0x39')]({'where':{'id':_0x19020b[_0xc53e('0x3a')]['id']}})['then'](handleEntityNotFound(_0x17ad32,null))[_0xc53e('0x24')](function(_0x48d7d0){var _0x1059f3=_0x48d7d0[_0xc53e('0x3b')]({'plain':!![]});return utilLicense['checkLicense'](_0x1059f3,_0x19020b[_0xc53e('0x38')][_0xc53e('0x3c')]);})[_0xc53e('0x24')](function(_0x5ed90b){if(!_0x5ed90b[_0xc53e('0x3d')]){return saveUpdates(_0x19020b[_0xc53e('0x38')],null);}return _0x5ed90b;})[_0xc53e('0x24')](respondWithResult(_0x17ad32,null))[_0xc53e('0x36')](handleError(_0x17ad32,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index e394ecb..c8dc210 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 _0x254b=['api','moment','request-promise','path','rimraf','../../config/environment','./license.attributes','define','lodash','util','../../config/logger'];(function(_0xd1a6b4,_0x5b3dcb){var _0x26b757=function(_0x26b877){while(--_0x26b877){_0xd1a6b4['push'](_0xd1a6b4['shift']());}};_0x26b757(++_0x5b3dcb);}(_0x254b,0x110));var _0xb254=function(_0x4709c8,_0x3384ca){_0x4709c8=_0x4709c8-0x0;var _0x478cdd=_0x254b[_0x4709c8];return _0x478cdd;};'use strict';var _=require(_0xb254('0x0'));var util=require(_0xb254('0x1'));var logger=require(_0xb254('0x2'))(_0xb254('0x3'));var moment=require(_0xb254('0x4'));var BPromise=require('bluebird');var rp=require(_0xb254('0x5'));var fs=require('fs');var path=require(_0xb254('0x6'));var rimraf=require(_0xb254('0x7'));var config=require(_0xb254('0x8'));var attributes=require(_0xb254('0x9'));module['exports']=function(_0x72bc05,_0x4fa1db){return _0x72bc05[_0xb254('0xa')]('License',attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x877f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./license.attributes','exports','define','license','lodash','../../config/logger'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x877f,0x9a));var _0xf877=function(_0x511891,_0x4d490e){_0x511891=_0x511891-0x0;var _0x251e1f=_0x877f[_0x511891];return _0x251e1f;};'use strict';var _=require(_0xf877('0x0'));var util=require('util');var logger=require(_0xf877('0x1'))(_0xf877('0x2'));var moment=require(_0xf877('0x3'));var BPromise=require(_0xf877('0x4'));var rp=require(_0xf877('0x5'));var fs=require('fs');var path=require(_0xf877('0x6'));var rimraf=require(_0xf877('0x7'));var config=require(_0xf877('0x8'));var attributes=require(_0xf877('0x9'));module[_0xf877('0xa')]=function(_0x2132d5,_0x3c0f7c){return _0x2132d5[_0xf877('0xb')]('License',attributes,{'tableName':_0xf877('0xc'),'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 a3d6288..f6f6920 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 _0x03a7=['client','http','request','then','info','request\x20sent','debug','stringify','error','code','License,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x5d23e1,_0x104aab){var _0x474cb8=function(_0x34b5e8){while(--_0x34b5e8){_0x5d23e1['push'](_0x5d23e1['shift']());}};_0x474cb8(++_0x104aab);}(_0x03a7,0x195));var _0x703a=function(_0x4406d3,_0x22a6d9){_0x4406d3=_0x4406d3-0x0;var _0x187293=_0x03a7[_0x4406d3];return _0x187293;};'use strict';var _=require(_0x703a('0x0'));var util=require('util');var moment=require(_0x703a('0x1'));var BPromise=require(_0x703a('0x2'));var rs=require(_0x703a('0x3'));var fs=require('fs');var Redis=require(_0x703a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x703a('0x5'));var logger=require(_0x703a('0x6'))('rpc');var config=require(_0x703a('0x7'));var jayson=require(_0x703a('0x8'));var client=jayson[_0x703a('0x9')][_0x703a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3730fe,_0x27d550,_0x36e66d){return new BPromise(function(_0x134781,_0x2fb64e){return client[_0x703a('0xb')](_0x3730fe,_0x36e66d)[_0x703a('0xc')](function(_0x78dce0){logger[_0x703a('0xd')]('License,\x20%s,\x20%s',_0x27d550,_0x703a('0xe'));logger[_0x703a('0xf')]('License,\x20%s,\x20%s,\x20%s',_0x27d550,_0x703a('0xe'),JSON[_0x703a('0x10')](_0x78dce0));if(_0x78dce0[_0x703a('0x11')]){if(_0x78dce0['error'][_0x703a('0x12')]===0x1f4){logger[_0x703a('0x11')](_0x703a('0x13'),_0x27d550,_0x78dce0[_0x703a('0x11')][_0x703a('0x14')]);return _0x2fb64e(_0x78dce0[_0x703a('0x11')][_0x703a('0x14')]);}logger[_0x703a('0x11')](_0x703a('0x13'),_0x27d550,_0x78dce0[_0x703a('0x11')]['message']);return _0x134781(_0x78dce0[_0x703a('0x11')][_0x703a('0x14')]);}else{logger[_0x703a('0xd')](_0x703a('0x13'),_0x27d550,_0x703a('0xe'));_0x134781(_0x78dce0[_0x703a('0x15')][_0x703a('0x14')]);}})[_0x703a('0x16')](function(_0x4ce60b){logger['error'](_0x703a('0x13'),_0x27d550,_0x4ce60b);_0x2fb64e(_0x4ce60b);});});} \ No newline at end of file +var _0x4885=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','License,\x20%s,\x20%s','request\x20sent','stringify','code','message','error','info','result','util','moment'];(function(_0x39dfbb,_0x1dff13){var _0x3f933f=function(_0x2ec203){while(--_0x2ec203){_0x39dfbb['push'](_0x39dfbb['shift']());}};_0x3f933f(++_0x1dff13);}(_0x4885,0xfa));var _0x5488=function(_0x1d48fc,_0x51e74e){_0x1d48fc=_0x1d48fc-0x0;var _0x265d4a=_0x4885[_0x1d48fc];return _0x265d4a;};'use strict';var _=require('lodash');var util=require(_0x5488('0x0'));var moment=require(_0x5488('0x1'));var BPromise=require(_0x5488('0x2'));var rs=require(_0x5488('0x3'));var fs=require('fs');var Redis=require(_0x5488('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5488('0x5'));var logger=require(_0x5488('0x6'))(_0x5488('0x7'));var config=require(_0x5488('0x8'));var jayson=require(_0x5488('0x9'));var client=jayson[_0x5488('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x484e6a,_0x46d709,_0x5cfe92){return new BPromise(function(_0xd888b7,_0x35a25f){return client[_0x5488('0xb')](_0x484e6a,_0x5cfe92)[_0x5488('0xc')](function(_0x711f46){logger['info'](_0x5488('0xd'),_0x46d709,_0x5488('0xe'));logger['debug']('License,\x20%s,\x20%s,\x20%s',_0x46d709,_0x5488('0xe'),JSON[_0x5488('0xf')](_0x711f46));if(_0x711f46['error']){if(_0x711f46['error'][_0x5488('0x10')]===0x1f4){logger['error'](_0x5488('0xd'),_0x46d709,_0x711f46['error'][_0x5488('0x11')]);return _0x35a25f(_0x711f46['error'][_0x5488('0x11')]);}logger[_0x5488('0x12')]('License,\x20%s,\x20%s',_0x46d709,_0x711f46[_0x5488('0x12')][_0x5488('0x11')]);return _0xd888b7(_0x711f46[_0x5488('0x12')][_0x5488('0x11')]);}else{logger[_0x5488('0x13')](_0x5488('0xd'),_0x46d709,_0x5488('0xe'));_0xd888b7(_0x711f46[_0x5488('0x14')][_0x5488('0x11')]);}})['catch'](function(_0x27a929){logger['error']('License,\x20%s,\x20%s',_0x46d709,_0x27a929);_0x35a25f(_0x27a929);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index f3583ad..e9359d0 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 _0xb5a0=['getInteractions','/:id/applications','/:id/messages','/:id/verify','/:id/users','getAgents','/:id/dispositions','post','addAnswer','create','addImap','addSmtp','addInteraction','addApplications','/:id/send','addAgents','put','/:id','removeDispositions','removeAnswers','delete','removeImap','removeSmtp','removeAgents','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','show','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions'];(function(_0x5959c9,_0x2ed153){var _0x4ffcbc=function(_0x459b7a){while(--_0x459b7a){_0x5959c9['push'](_0x5959c9['shift']());}};_0x4ffcbc(++_0x2ed153);}(_0xb5a0,0xd1));var _0x0b5a=function(_0x42ca58,_0x423bf9){_0x42ca58=_0x42ca58-0x0;var _0x1a3a40=_0xb5a0[_0x42ca58];return _0x1a3a40;};'use strict';var multer=require(_0x0b5a('0x0'));var util=require(_0x0b5a('0x1'));var path=require('path');var timeout=require(_0x0b5a('0x2'));var express=require(_0x0b5a('0x3'));var router=express[_0x0b5a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0b5a('0x5'));var interaction=require(_0x0b5a('0x6'));var config=require(_0x0b5a('0x7'));var controller=require('./mailAccount.controller');router[_0x0b5a('0x8')]('/',auth[_0x0b5a('0x9')](),controller[_0x0b5a('0xa')]);router[_0x0b5a('0x8')](_0x0b5a('0xb'),auth[_0x0b5a('0x9')](),controller['describe']);router['get']('/:id',auth[_0x0b5a('0x9')](),controller[_0x0b5a('0xc')]);router['get']('/:id/dispositions',auth['isAuthenticated'](),controller[_0x0b5a('0xd')]);router[_0x0b5a('0x8')](_0x0b5a('0xe'),auth[_0x0b5a('0x9')](),controller[_0x0b5a('0xf')]);router[_0x0b5a('0x8')](_0x0b5a('0x10'),auth[_0x0b5a('0x9')](),controller[_0x0b5a('0x11')]);router[_0x0b5a('0x8')](_0x0b5a('0x12'),auth[_0x0b5a('0x9')](),controller[_0x0b5a('0x13')]);router[_0x0b5a('0x8')](_0x0b5a('0x14'),auth['isAuthenticated'](),controller[_0x0b5a('0x15')]);router[_0x0b5a('0x8')](_0x0b5a('0x16'),auth[_0x0b5a('0x9')](),controller['getApplications']);router['get'](_0x0b5a('0x17'),auth[_0x0b5a('0x9')](),controller['getMessages']);router[_0x0b5a('0x8')](_0x0b5a('0x18'),auth['isAuthenticated'](),controller['verifySmtp']);router[_0x0b5a('0x8')](_0x0b5a('0x19'),auth[_0x0b5a('0x9')](),controller[_0x0b5a('0x1a')]);router['post'](_0x0b5a('0x1b'),auth[_0x0b5a('0x9')](),controller['addDisposition']);router[_0x0b5a('0x1c')](_0x0b5a('0xe'),auth[_0x0b5a('0x9')](),controller[_0x0b5a('0x1d')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0b5a('0x1e')]);router[_0x0b5a('0x1c')]('/:id/in_servers',auth['isAuthenticated'](),controller[_0x0b5a('0x1f')]);router[_0x0b5a('0x1c')](_0x0b5a('0x12'),auth[_0x0b5a('0x9')](),controller[_0x0b5a('0x20')]);router[_0x0b5a('0x1c')](_0x0b5a('0x14'),auth[_0x0b5a('0x9')](),controller[_0x0b5a('0x21')]);router['post'](_0x0b5a('0x16'),auth[_0x0b5a('0x9')](),controller[_0x0b5a('0x22')]);router[_0x0b5a('0x1c')](_0x0b5a('0x23'),auth[_0x0b5a('0x9')](),controller['send']);router[_0x0b5a('0x1c')](_0x0b5a('0x19'),auth[_0x0b5a('0x9')](),controller[_0x0b5a('0x24')]);router[_0x0b5a('0x25')](_0x0b5a('0x26'),auth[_0x0b5a('0x9')](),controller['update']);router['delete'](_0x0b5a('0x1b'),auth[_0x0b5a('0x9')](),controller[_0x0b5a('0x27')]);router['delete'](_0x0b5a('0xe'),auth[_0x0b5a('0x9')](),controller[_0x0b5a('0x28')]);router[_0x0b5a('0x29')]('/:id/in_servers',auth[_0x0b5a('0x9')](),controller[_0x0b5a('0x2a')]);router[_0x0b5a('0x29')](_0x0b5a('0x12'),auth[_0x0b5a('0x9')](),controller[_0x0b5a('0x2b')]);router[_0x0b5a('0x29')](_0x0b5a('0x26'),auth['isAuthenticated'](),controller['destroy']);router[_0x0b5a('0x29')](_0x0b5a('0x19'),auth[_0x0b5a('0x9')](),controller[_0x0b5a('0x2c')]);module[_0x0b5a('0x2d')]=router; \ No newline at end of file +var _0x4d79=['describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','/:id/users','getAgents','addDisposition','post','addAnswer','create','addImap','addInteraction','addApplications','/:id/send','send','addAgents','put','update','delete','removeDispositions','removeAnswers','removeImap','removeSmtp','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe'];(function(_0x19ab82,_0x18c0cf){var _0x3caf83=function(_0x482dc1){while(--_0x482dc1){_0x19ab82['push'](_0x19ab82['shift']());}};_0x3caf83(++_0x18c0cf);}(_0x4d79,0x88));var _0x94d7=function(_0x38e177,_0x59ec9f){_0x38e177=_0x38e177-0x0;var _0x1faf15=_0x4d79[_0x38e177];return _0x1faf15;};'use strict';var multer=require(_0x94d7('0x0'));var util=require(_0x94d7('0x1'));var path=require(_0x94d7('0x2'));var timeout=require(_0x94d7('0x3'));var express=require(_0x94d7('0x4'));var router=express[_0x94d7('0x5')]();var fs_extra=require(_0x94d7('0x6'));var auth=require(_0x94d7('0x7'));var interaction=require(_0x94d7('0x8'));var config=require(_0x94d7('0x9'));var controller=require('./mailAccount.controller');router['get']('/',auth[_0x94d7('0xa')](),controller[_0x94d7('0xb')]);router[_0x94d7('0xc')](_0x94d7('0xd'),auth['isAuthenticated'](),controller[_0x94d7('0xe')]);router[_0x94d7('0xc')](_0x94d7('0xf'),auth[_0x94d7('0xa')](),controller[_0x94d7('0x10')]);router[_0x94d7('0xc')](_0x94d7('0x11'),auth[_0x94d7('0xa')](),controller[_0x94d7('0x12')]);router[_0x94d7('0xc')](_0x94d7('0x13'),auth[_0x94d7('0xa')](),controller[_0x94d7('0x14')]);router[_0x94d7('0xc')](_0x94d7('0x15'),auth[_0x94d7('0xa')](),controller[_0x94d7('0x16')]);router['get'](_0x94d7('0x17'),auth[_0x94d7('0xa')](),controller[_0x94d7('0x18')]);router[_0x94d7('0xc')](_0x94d7('0x19'),auth[_0x94d7('0xa')](),controller[_0x94d7('0x1a')]);router[_0x94d7('0xc')](_0x94d7('0x1b'),auth['isAuthenticated'](),controller[_0x94d7('0x1c')]);router[_0x94d7('0xc')](_0x94d7('0x1d'),auth['isAuthenticated'](),controller['getMessages']);router[_0x94d7('0xc')]('/:id/verify',auth[_0x94d7('0xa')](),controller['verifySmtp']);router[_0x94d7('0xc')](_0x94d7('0x1e'),auth[_0x94d7('0xa')](),controller[_0x94d7('0x1f')]);router['post'](_0x94d7('0x11'),auth[_0x94d7('0xa')](),controller[_0x94d7('0x20')]);router[_0x94d7('0x21')]('/:id/canned_answers',auth[_0x94d7('0xa')](),controller[_0x94d7('0x22')]);router[_0x94d7('0x21')]('/',auth['isAuthenticated'](),controller[_0x94d7('0x23')]);router['post'](_0x94d7('0x15'),auth[_0x94d7('0xa')](),controller[_0x94d7('0x24')]);router[_0x94d7('0x21')](_0x94d7('0x17'),auth[_0x94d7('0xa')](),controller['addSmtp']);router[_0x94d7('0x21')](_0x94d7('0x19'),auth[_0x94d7('0xa')](),controller[_0x94d7('0x25')]);router[_0x94d7('0x21')](_0x94d7('0x1b'),auth[_0x94d7('0xa')](),controller[_0x94d7('0x26')]);router['post'](_0x94d7('0x27'),auth[_0x94d7('0xa')](),controller[_0x94d7('0x28')]);router[_0x94d7('0x21')]('/:id/users',auth[_0x94d7('0xa')](),controller[_0x94d7('0x29')]);router[_0x94d7('0x2a')]('/:id',auth[_0x94d7('0xa')](),controller[_0x94d7('0x2b')]);router[_0x94d7('0x2c')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x94d7('0x2d')]);router['delete'](_0x94d7('0x13'),auth[_0x94d7('0xa')](),controller[_0x94d7('0x2e')]);router['delete'](_0x94d7('0x15'),auth[_0x94d7('0xa')](),controller[_0x94d7('0x2f')]);router['delete'](_0x94d7('0x17'),auth[_0x94d7('0xa')](),controller[_0x94d7('0x30')]);router[_0x94d7('0x2c')](_0x94d7('0xf'),auth['isAuthenticated'](),controller['destroy']);router['delete'](_0x94d7('0x1e'),auth[_0x94d7('0xa')](),controller['removeAgents']);module[_0x94d7('0x31')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 90b510d..a4dba9c 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 _0xe5b3=['STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','UNSIGNED','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','exports'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0xe5b3,0x133));var _0x3e5b=function(_0x1b4f2b,_0x5de61a){_0x1b4f2b=_0x1b4f2b-0x0;var _0x31ba9b=_0xe5b3[_0x1b4f2b];return _0x31ba9b;};'use strict';var Sequelize=require('sequelize');module[_0x3e5b('0x0')]={'description':{'type':Sequelize[_0x3e5b('0x1')]},'name':{'type':Sequelize[_0x3e5b('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0x3e5b('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x3e5b('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x3e5b('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0x3e5b('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0x3e5b('0x3')]},'markAsUnread':{'type':Sequelize[_0x3e5b('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x3e5b('0x1')],'allowNull':![],'defaultValue':_0x3e5b('0x4')},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0x3e5b('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x3e5b('0x3')],'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[_0x3e5b('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x3e5b('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x3e5b('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x3e5b('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x3e5b('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3e5b('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0x3e5b('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x3e5b('0x2')],'defaultValue':![],'comment':_0x3e5b('0x8'),'set':function(_0x522e9e){if(!_0x522e9e)this[_0x3e5b('0x9')]('mandatoryDispositionPauseId',null);this[_0x3e5b('0x9')](_0x3e5b('0xa'),_0x522e9e);}}}; \ No newline at end of file +var _0x7118=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','UNSIGNED'];(function(_0x5140b5,_0xb6f672){var _0x5c144c=function(_0x41fc88){while(--_0x41fc88){_0x5140b5['push'](_0x5140b5['shift']());}};_0x5c144c(++_0xb6f672);}(_0x7118,0x159));var _0x8711=function(_0x5a1707,_0x3103b1){_0x5a1707=_0x5a1707-0x0;var _0x238cb0=_0x7118[_0x5a1707];return _0x238cb0;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0x8711('0x0')]},'name':{'type':Sequelize[_0x8711('0x0')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x8711('0x0')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x8711('0x1')],'defaultValue':!![]},'key':{'type':Sequelize[_0x8711('0x0')],'allowNull':![]},'template':{'type':Sequelize[_0x8711('0x2')]},'markAsUnread':{'type':Sequelize[_0x8711('0x1')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x8711('0x0')],'allowNull':![],'defaultValue':_0x8711('0x3')},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0x8711('0x4')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x8711('0x2')],'defaultValue':function(){return _0x8711('0x5');}},'notificationSound':{'type':Sequelize[_0x8711('0x1')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x8711('0x1')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x8711('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x8711('0x1')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x8711('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8711('0x1')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x8711('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8711('0x6')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x8711('0x7'),'set':function(_0x64f7b4){if(!_0x64f7b4)this[_0x8711('0x8')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0x8711('0x9'),_0x64f7b4);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 32fb4b5..9678971 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 _0x81ce=['pick','where','merge','VIRTUAL','options','rows','show','params','MailServerOut','mandatoryDispositionPause','include','find','body','describe','addDisposition','MailAccountId','create','getDispositions','Disposition','filter','removeDispositions','addAnswer','CannedAnswer','getAnswers','findOne','includeAll','removeAnswers','ids','email','ListId','isNil','active','description','user','cuser','password','pass','cpassword','authentication','host','port','service','cservice','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','MailInteraction','addInteraction','omit','getInteractions','CmContact','Contact','internal','Tag','Tags','color','tag','findAll','addApplications','transaction','MailApplication','destroy','findAndCountAll','priority','getApplications','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','true','CmList','List','Contacts','updatedAt','DESC','from','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','auth','secure','SendMail','List\x20not\x20found','messageId','subject','out','Interaction','verifySmtp','VerifySmtp','Sequelize','ValidationError','addAgents','spread','emit','userMailAccount:save','isArray','userMailAccount:remove','User','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','desk.js','querystring','html-to-text','juice','ioredis','../../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','jayson/promise','client','http','request','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','apply','save','update','then','get','MailAccounts','UserProfileResource','end','name','send','MailServerIn','Imap','Smtp','Pause','map','MailAccount','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0xc6590c,_0x5b6a79){var _0x2a1e8e=function(_0x2eb449){while(--_0x2eb449){_0xc6590c['push'](_0xc6590c['shift']());}};_0x2a1e8e(++_0x5b6a79);}(_0x81ce,0x73));var _0xe81c=function(_0x1879a6,_0x2cb4df){_0x1879a6=_0x1879a6-0x0;var _0x3ca317=_0x81ce[_0x1879a6];return _0x3ca317;};'use strict';var emlformat=require(_0xe81c('0x0'));var rimraf=require(_0xe81c('0x1'));var zipdir=require(_0xe81c('0x2'));var jsonpatch=require(_0xe81c('0x3'));var rp=require(_0xe81c('0x4'));var moment=require(_0xe81c('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe81c('0x6'));var path=require(_0xe81c('0x7'));var sox=require(_0xe81c('0x8'));var csv=require(_0xe81c('0x9'));var ejs=require(_0xe81c('0xa'));var fs=require('fs');var fs_extra=require(_0xe81c('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe81c('0xc'));var toCsv=require(_0xe81c('0x9'));var querystring=require(_0xe81c('0xd'));var Papa=require('papaparse');var htmlToText=require(_0xe81c('0xe'));var juice=require(_0xe81c('0xf'));var Redis=require(_0xe81c('0x10'));var authService=require(_0xe81c('0x11'));var qs=require(_0xe81c('0x12'));var as=require(_0xe81c('0x13'));var hardwareService=require(_0xe81c('0x14'));var logger=require(_0xe81c('0x15'))(_0xe81c('0x16'));var utils=require(_0xe81c('0x17'));var config=require(_0xe81c('0x18'));var licenseUtil=require(_0xe81c('0x19'));var db=require(_0xe81c('0x1a'))['db'];config[_0xe81c('0x1b')]=_[_0xe81c('0x1c')](config[_0xe81c('0x1b')],{'host':_0xe81c('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./mailAccount.socket')['register'](socket);var jayson=require(_0xe81c('0x1e'));var client=jayson[_0xe81c('0x1f')][_0xe81c('0x20')]({'port':0x232b});function respondWithRpcPromise(_0x43abf6,_0xc6732f,_0x5947c6,_0x1761ce){return new BPromise(function(_0x978d9f,_0xecfe18){var _0x5979dd=_0x1761ce||client;return _0x5979dd[_0xe81c('0x21')](_0x43abf6,_0x5947c6)['then'](function(_0x50cf46){logger['info'](_0xe81c('0x22'),_0xc6732f,_0xe81c('0x23'));logger[_0xe81c('0x24')](_0xe81c('0x25'),_0xc6732f,_0xe81c('0x23'),JSON['stringify'](_0x50cf46));if(_0x50cf46[_0xe81c('0x26')]){if(_0x50cf46[_0xe81c('0x26')]['code']===0x1f4){logger[_0xe81c('0x26')](_0xe81c('0x22'),_0xc6732f,_0x50cf46['error'][_0xe81c('0x27')]);return _0xecfe18(_0x50cf46[_0xe81c('0x26')]['message']);}logger[_0xe81c('0x26')](_0xe81c('0x22'),_0xc6732f,_0x50cf46[_0xe81c('0x26')][_0xe81c('0x27')]);return _0x978d9f(_0x50cf46[_0xe81c('0x26')][_0xe81c('0x27')]);}else{logger[_0xe81c('0x28')]('MailAccount,\x20%s,\x20%s',_0xc6732f,_0xe81c('0x23'));_0x978d9f(_0x50cf46[_0xe81c('0x29')][_0xe81c('0x27')]);}})[_0xe81c('0x2a')](function(_0x5baaa7){logger[_0xe81c('0x26')](_0xe81c('0x22'),_0xc6732f,_0x5baaa7);_0xecfe18(_0x5baaa7);});});}function respondWithStatusCode(_0x3428dd,_0x124d69){_0x124d69=_0x124d69||0xcc;return function(_0x258a79){if(_0x258a79){return _0x3428dd[_0xe81c('0x2b')](_0x124d69);}return _0x3428dd[_0xe81c('0x2c')](_0x124d69)['end']();};}function respondWithResult(_0x4a818f,_0x4eac02){_0x4eac02=_0x4eac02||0xc8;return function(_0x27417f){if(_0x27417f){return _0x4a818f[_0xe81c('0x2c')](_0x4eac02)[_0xe81c('0x2d')](_0x27417f);}};}function respondWithFilteredResult(_0x2c2a78,_0xb03856){return function(_0x16cb90){if(_0x16cb90){var _0x289299=typeof _0xb03856[_0xe81c('0x2e')]===_0xe81c('0x2f')&&typeof _0xb03856[_0xe81c('0x30')]===_0xe81c('0x2f');var _0x199891=_0x16cb90[_0xe81c('0x31')];var _0x2d1ec4=_0x289299?0x0:_0xb03856[_0xe81c('0x2e')];var _0x67c39e=_0x289299?_0x16cb90['count']:_0xb03856[_0xe81c('0x2e')]+_0xb03856[_0xe81c('0x30')];var _0x4fd7e8;if(_0x67c39e>=_0x199891){_0x67c39e=_0x199891;_0x4fd7e8=0xc8;}else{_0x4fd7e8=0xce;}_0x2c2a78[_0xe81c('0x2c')](_0x4fd7e8);return _0x2c2a78[_0xe81c('0x32')]('Content-Range',_0x2d1ec4+'-'+_0x67c39e+'/'+_0x199891)['json'](_0x16cb90);}return null;};}function patchUpdates(_0x887bf7){return function(_0x5d978c){try{jsonpatch[_0xe81c('0x33')](_0x5d978c,_0x887bf7,!![]);}catch(_0x4f0708){return BPromise['reject'](_0x4f0708);}return _0x5d978c[_0xe81c('0x34')]();};}function saveUpdates(_0x2bbda2,_0x42b46a){return function(_0x3ebc9a){if(_0x3ebc9a){return _0x3ebc9a[_0xe81c('0x35')](_0x2bbda2)[_0xe81c('0x36')](function(_0x378c92){return _0x378c92;});}return null;};}function removeEntity(_0xfef64a,_0xb8c5c){return function(_0x29fb84){if(_0x29fb84){return _0x29fb84['destroy']()[_0xe81c('0x36')](function(){var _0x443832=_0x29fb84[_0xe81c('0x37')]({'plain':!![]});var _0x28b805=_0xe81c('0x38');return db[_0xe81c('0x39')]['destroy']({'where':{'type':_0x28b805,'resourceId':_0x443832['id']}})[_0xe81c('0x36')](function(){return _0x29fb84;});})[_0xe81c('0x36')](function(){_0xfef64a['status'](0xcc)[_0xe81c('0x3a')]();});}};}function handleEntityNotFound(_0x1e9629,_0x57d734){return function(_0x5ca025){if(!_0x5ca025){_0x1e9629[_0xe81c('0x2b')](0x194);}return _0x5ca025;};}function handleError(_0x19be84,_0x4ba4ef){_0x4ba4ef=_0x4ba4ef||0x1f4;return function(_0x21ce32){logger['error'](_0x21ce32['stack']);if(_0x21ce32['name']){delete _0x21ce32[_0xe81c('0x3b')];}_0x19be84['status'](_0x4ba4ef)[_0xe81c('0x3c')](_0x21ce32);};}exports['index']=function(_0x407fcb,_0x3f6519){var _0x31eca1={'include':[{'model':db[_0xe81c('0x3d')],'as':_0xe81c('0x3e')},{'model':db['MailServerOut'],'as':_0xe81c('0x3f')},{'model':db[_0xe81c('0x40')],'as':'mandatoryDispositionPause'}]},_0xcb81d={},_0x334e99={'count':0x0,'rows':[]};var _0x34c568=_[_0xe81c('0x41')](db[_0xe81c('0x42')][_0xe81c('0x43')],function(_0x44032f){return{'name':_0x44032f['fieldName'],'type':_0x44032f[_0xe81c('0x44')][_0xe81c('0x45')]};});_0xcb81d[_0xe81c('0x46')]=_[_0xe81c('0x41')](_0x34c568,_0xe81c('0x3b'));_0xcb81d[_0xe81c('0x47')]=_[_0xe81c('0x48')](_0x407fcb[_0xe81c('0x47')]);_0xcb81d[_0xe81c('0x49')]=_[_0xe81c('0x4a')](_0xcb81d[_0xe81c('0x46')],_0xcb81d[_0xe81c('0x47')]);_0x31eca1[_0xe81c('0x4b')]=_[_0xe81c('0x4a')](_0xcb81d[_0xe81c('0x46')],qs[_0xe81c('0x4c')](_0x407fcb[_0xe81c('0x47')][_0xe81c('0x4c')]));_0x31eca1[_0xe81c('0x4b')]=_0x31eca1[_0xe81c('0x4b')][_0xe81c('0x4d')]?_0x31eca1[_0xe81c('0x4b')]:_0xcb81d[_0xe81c('0x46')];if(!_0x407fcb[_0xe81c('0x47')][_0xe81c('0x4e')](_0xe81c('0x4f'))){_0x31eca1[_0xe81c('0x30')]=qs[_0xe81c('0x30')](_0x407fcb['query'][_0xe81c('0x30')]);_0x31eca1[_0xe81c('0x2e')]=qs[_0xe81c('0x2e')](_0x407fcb['query'][_0xe81c('0x2e')]);}_0x31eca1[_0xe81c('0x50')]=qs['sort'](_0x407fcb['query'][_0xe81c('0x51')]);_0x31eca1['where']=qs[_0xe81c('0x49')](_[_0xe81c('0x52')](_0x407fcb[_0xe81c('0x47')],_0xcb81d[_0xe81c('0x49')]),_0x34c568);if(_0x407fcb[_0xe81c('0x47')]['filter']){_0x31eca1[_0xe81c('0x53')]=_[_0xe81c('0x54')](_0x31eca1[_0xe81c('0x53')],{'$or':_[_0xe81c('0x41')](_0x34c568,function(_0x84b125){if(_0x84b125[_0xe81c('0x44')]!==_0xe81c('0x55')){var _0x4200b0={};_0x4200b0[_0x84b125['name']]={'$like':'%'+_0x407fcb[_0xe81c('0x47')]['filter']+'%'};return _0x4200b0;}})});}_0x31eca1=_[_0xe81c('0x54')]({},_0x31eca1,_0x407fcb[_0xe81c('0x56')]);var _0x56077d={'where':_0x31eca1[_0xe81c('0x53')]};return db[_0xe81c('0x42')][_0xe81c('0x31')](_0x56077d)[_0xe81c('0x36')](function(_0x334610){_0x334e99['count']=_0x334610;if(_0x407fcb[_0xe81c('0x47')]['includeAll']){_0x31eca1['include']=[{'all':!![]}];}return db[_0xe81c('0x42')]['findAll'](_0x31eca1);})[_0xe81c('0x36')](function(_0x165cb8){_0x334e99[_0xe81c('0x57')]=_0x165cb8;return _0x334e99;})['then'](respondWithFilteredResult(_0x3f6519,_0x31eca1))[_0xe81c('0x2a')](handleError(_0x3f6519,null));};exports[_0xe81c('0x58')]=function(_0x36b0fb,_0x2f47b8){var _0x50eeca={'raw':![],'where':{'id':_0x36b0fb[_0xe81c('0x59')]['id']},'include':[{'model':db[_0xe81c('0x3d')],'as':_0xe81c('0x3e')},{'model':db[_0xe81c('0x5a')],'as':_0xe81c('0x3f')},{'model':db['Pause'],'as':_0xe81c('0x5b')}]},_0x98a8c9={};_0x98a8c9[_0xe81c('0x46')]=_[_0xe81c('0x48')](db['MailAccount'][_0xe81c('0x43')]);_0x98a8c9['query']=_[_0xe81c('0x48')](_0x36b0fb[_0xe81c('0x47')]);_0x98a8c9['filters']=_[_0xe81c('0x4a')](_0x98a8c9['model'],_0x98a8c9['query']);_0x50eeca[_0xe81c('0x4b')]=_[_0xe81c('0x4a')](_0x98a8c9[_0xe81c('0x46')],qs[_0xe81c('0x4c')](_0x36b0fb[_0xe81c('0x47')]['fields']));_0x50eeca['attributes']=_0x50eeca[_0xe81c('0x4b')][_0xe81c('0x4d')]?_0x50eeca[_0xe81c('0x4b')]:_0x98a8c9[_0xe81c('0x46')];if(_0x36b0fb['query']['includeAll']){_0x50eeca[_0xe81c('0x5c')]=[{'all':!![]}];}_0x50eeca=_['merge']({},_0x50eeca,_0x36b0fb[_0xe81c('0x56')]);return db[_0xe81c('0x42')][_0xe81c('0x5d')](_0x50eeca)[_0xe81c('0x36')](handleEntityNotFound(_0x2f47b8,null))[_0xe81c('0x36')](respondWithResult(_0x2f47b8,null))['catch'](handleError(_0x2f47b8,null));};exports[_0xe81c('0x35')]=function(_0x3e0f91,_0x79b5ac){if(_0x3e0f91[_0xe81c('0x5e')]['id']){delete _0x3e0f91[_0xe81c('0x5e')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x3e0f91[_0xe81c('0x59')]['id']},'include':[{'model':db[_0xe81c('0x3d')],'as':_0xe81c('0x3e')},{'model':db[_0xe81c('0x5a')],'as':_0xe81c('0x3f')},{'model':db['Pause'],'as':_0xe81c('0x5b')}]})[_0xe81c('0x36')](handleEntityNotFound(_0x79b5ac,null))[_0xe81c('0x36')](saveUpdates(_0x3e0f91[_0xe81c('0x5e')],null))['then'](function(_0x2f770b){if(_0x2f770b&&_0x3e0f91[_0xe81c('0x5e')][_0xe81c('0x3e')]){return db['MailServerIn'][_0xe81c('0x35')](_0x3e0f91['body'][_0xe81c('0x3e')],{'where':{'MailAccountId':_0x2f770b['id']}})['then'](function(){return _0x2f770b;});}return _0x2f770b;})[_0xe81c('0x36')](function(_0x2adcb9){if(_0x2adcb9&&_0x3e0f91['body'][_0xe81c('0x3f')]){return db[_0xe81c('0x5a')][_0xe81c('0x35')](_0x3e0f91[_0xe81c('0x5e')][_0xe81c('0x3f')],{'where':{'MailAccountId':_0x2adcb9['id']}})['then'](function(){return _0x2adcb9;});}return _0x2adcb9;})[_0xe81c('0x36')](respondWithResult(_0x79b5ac,null))[_0xe81c('0x2a')](handleError(_0x79b5ac,null));};exports[_0xe81c('0x5f')]=function(_0x11482a,_0x2e07b0){return db['MailAccount']['describe']()[_0xe81c('0x36')](respondWithResult(_0x2e07b0,null))[_0xe81c('0x2a')](handleError(_0x2e07b0,null));};exports[_0xe81c('0x60')]=function(_0x21fc2b,_0x5a6d3b,_0x4dfdc4){if(_0x21fc2b[_0xe81c('0x5e')]['id']){delete _0x21fc2b[_0xe81c('0x5e')]['id'];}return db[_0xe81c('0x42')][_0xe81c('0x5d')]({'where':{'id':_0x21fc2b['params']['id']}})[_0xe81c('0x36')](handleEntityNotFound(_0x5a6d3b,null))['then'](function(_0x374fa1){if(_0x374fa1){_0x21fc2b[_0xe81c('0x5e')][_0xe81c('0x61')]=_0x374fa1['id'];return db['Disposition'][_0xe81c('0x62')](_0x21fc2b['body']);}})['then'](respondWithResult(_0x5a6d3b,null))['catch'](handleError(_0x5a6d3b,null));};exports[_0xe81c('0x63')]=function(_0x56b895,_0x29e8bc,_0x1b3501){var _0x3e850d={'raw':![],'where':{}};var _0x27c6f0={};var _0x5001f6={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x56b895[_0xe81c('0x59')]['id']}})[_0xe81c('0x36')](handleEntityNotFound(_0x29e8bc,null))[_0xe81c('0x36')](function(_0x5d1eb0){if(_0x5d1eb0){_0x27c6f0[_0xe81c('0x46')]=_['keys'](db[_0xe81c('0x64')][_0xe81c('0x43')]);_0x27c6f0[_0xe81c('0x47')]=_[_0xe81c('0x48')](_0x56b895[_0xe81c('0x47')]);_0x27c6f0['filters']=_[_0xe81c('0x4a')](_0x27c6f0[_0xe81c('0x46')],_0x27c6f0[_0xe81c('0x47')]);_0x3e850d[_0xe81c('0x4b')]=_[_0xe81c('0x4a')](_0x27c6f0[_0xe81c('0x46')],qs['fields'](_0x56b895[_0xe81c('0x47')][_0xe81c('0x4c')]));_0x3e850d[_0xe81c('0x4b')]=_0x3e850d[_0xe81c('0x4b')][_0xe81c('0x4d')]?_0x3e850d['attributes']:_0x27c6f0['model'];if(!_0x56b895[_0xe81c('0x47')]['hasOwnProperty'](_0xe81c('0x4f'))){_0x3e850d[_0xe81c('0x30')]=qs[_0xe81c('0x30')](_0x56b895['query'][_0xe81c('0x30')]);_0x3e850d[_0xe81c('0x2e')]=qs[_0xe81c('0x2e')](_0x56b895[_0xe81c('0x47')][_0xe81c('0x2e')]);}_0x3e850d[_0xe81c('0x50')]=qs[_0xe81c('0x51')](_0x56b895['query'][_0xe81c('0x51')]);_0x3e850d['where']=qs[_0xe81c('0x49')](_[_0xe81c('0x52')](_0x56b895['query'],_0x27c6f0[_0xe81c('0x49')]));_0x3e850d[_0xe81c('0x53')][_0xe81c('0x61')]=_0x5d1eb0['id'];if(_0x56b895[_0xe81c('0x47')][_0xe81c('0x65')]){_0x3e850d[_0xe81c('0x53')]=_['merge'](_0x3e850d[_0xe81c('0x53')],{'$or':_[_0xe81c('0x41')](_0x3e850d[_0xe81c('0x4b')],function(_0xbd2d57){var _0x4d1c1c={};_0x4d1c1c[_0xbd2d57]={'$like':'%'+_0x56b895[_0xe81c('0x47')][_0xe81c('0x65')]+'%'};return _0x4d1c1c;})});}_0x3e850d=_[_0xe81c('0x54')]({},_0x3e850d,_0x56b895['options']);return db[_0xe81c('0x64')][_0xe81c('0x31')]({'where':_0x3e850d['where']})['then'](function(_0x4d9c23){_0x5001f6['count']=_0x4d9c23;if(_0x56b895[_0xe81c('0x47')]['includeAll']){_0x3e850d['include']=[{'all':!![]}];}return db[_0xe81c('0x64')]['findAll'](_0x3e850d);})[_0xe81c('0x36')](function(_0x2d3fee){_0x5001f6['rows']=_0x2d3fee;return _0x5001f6;});}})[_0xe81c('0x36')](respondWithFilteredResult(_0x29e8bc,_0x3e850d))[_0xe81c('0x2a')](handleError(_0x29e8bc,null));};exports[_0xe81c('0x66')]=function(_0x4274a3,_0x2e3d71,_0x4a3148){return db['MailAccount'][_0xe81c('0x5d')]({'where':{'id':_0x4274a3[_0xe81c('0x59')]['id']}})[_0xe81c('0x36')](handleEntityNotFound(_0x2e3d71,null))['then'](function(_0x2e178e){if(_0x2e178e){return _0x2e178e['removeDispositions'](_0x4274a3[_0xe81c('0x47')]['ids']);}})[_0xe81c('0x36')](respondWithStatusCode(_0x2e3d71,null))[_0xe81c('0x2a')](handleError(_0x2e3d71,null));};exports[_0xe81c('0x67')]=function(_0x9b3ce5,_0x4d97dd,_0x29a21a){if(_0x9b3ce5[_0xe81c('0x5e')]['id']){delete _0x9b3ce5['body']['id'];}return db[_0xe81c('0x42')][_0xe81c('0x5d')]({'where':{'id':_0x9b3ce5[_0xe81c('0x59')]['id']}})[_0xe81c('0x36')](handleEntityNotFound(_0x4d97dd,null))[_0xe81c('0x36')](function(_0x246692){if(_0x246692){_0x9b3ce5[_0xe81c('0x5e')]['MailAccountId']=_0x246692['id'];return db[_0xe81c('0x68')]['create'](_0x9b3ce5[_0xe81c('0x5e')]);}})['then'](respondWithResult(_0x4d97dd,null))['catch'](handleError(_0x4d97dd,null));};exports[_0xe81c('0x69')]=function(_0x49b720,_0x40b2cc,_0x368dea){var _0x405d4a={'raw':![],'where':{}};var _0x1c163c={};var _0x29d90a={'count':0x0,'rows':[]};return db[_0xe81c('0x42')][_0xe81c('0x6a')]({'where':{'id':_0x49b720[_0xe81c('0x59')]['id']}})[_0xe81c('0x36')](handleEntityNotFound(_0x40b2cc,null))[_0xe81c('0x36')](function(_0x1e4221){if(_0x1e4221){_0x1c163c[_0xe81c('0x46')]=_[_0xe81c('0x48')](db[_0xe81c('0x68')][_0xe81c('0x43')]);_0x1c163c['query']=_[_0xe81c('0x48')](_0x49b720[_0xe81c('0x47')]);_0x1c163c[_0xe81c('0x49')]=_['intersection'](_0x1c163c[_0xe81c('0x46')],_0x1c163c[_0xe81c('0x47')]);_0x405d4a[_0xe81c('0x4b')]=_[_0xe81c('0x4a')](_0x1c163c[_0xe81c('0x46')],qs[_0xe81c('0x4c')](_0x49b720['query'][_0xe81c('0x4c')]));_0x405d4a['attributes']=_0x405d4a['attributes'][_0xe81c('0x4d')]?_0x405d4a[_0xe81c('0x4b')]:_0x1c163c[_0xe81c('0x46')];if(!_0x49b720[_0xe81c('0x47')]['hasOwnProperty']('nolimit')){_0x405d4a[_0xe81c('0x30')]=qs[_0xe81c('0x30')](_0x49b720[_0xe81c('0x47')][_0xe81c('0x30')]);_0x405d4a[_0xe81c('0x2e')]=qs[_0xe81c('0x2e')](_0x49b720['query'][_0xe81c('0x2e')]);}_0x405d4a['order']=qs[_0xe81c('0x51')](_0x49b720[_0xe81c('0x47')]['sort']);_0x405d4a['where']=qs[_0xe81c('0x49')](_[_0xe81c('0x52')](_0x49b720['query'],_0x1c163c['filters']));_0x405d4a[_0xe81c('0x53')][_0xe81c('0x61')]=_0x1e4221['id'];if(_0x49b720['query']['filter']){_0x405d4a[_0xe81c('0x53')]=_[_0xe81c('0x54')](_0x405d4a[_0xe81c('0x53')],{'$or':_[_0xe81c('0x41')](_0x405d4a[_0xe81c('0x4b')],function(_0x5c8a18){var _0x60b96e={};_0x60b96e[_0x5c8a18]={'$like':'%'+_0x49b720[_0xe81c('0x47')][_0xe81c('0x65')]+'%'};return _0x60b96e;})});}_0x405d4a=_['merge']({},_0x405d4a,_0x49b720[_0xe81c('0x56')]);return db[_0xe81c('0x68')][_0xe81c('0x31')]({'where':_0x405d4a['where']})[_0xe81c('0x36')](function(_0x26f2ca){_0x29d90a['count']=_0x26f2ca;if(_0x49b720['query'][_0xe81c('0x6b')]){_0x405d4a[_0xe81c('0x5c')]=[{'all':!![]}];}return db[_0xe81c('0x68')]['findAll'](_0x405d4a);})['then'](function(_0x455c06){_0x29d90a[_0xe81c('0x57')]=_0x455c06;return _0x29d90a;});}})[_0xe81c('0x36')](respondWithFilteredResult(_0x40b2cc,_0x405d4a))[_0xe81c('0x2a')](handleError(_0x40b2cc,null));};exports[_0xe81c('0x6c')]=function(_0x47965a,_0x189679,_0x472965){return db[_0xe81c('0x42')][_0xe81c('0x5d')]({'where':{'id':_0x47965a[_0xe81c('0x59')]['id']}})[_0xe81c('0x36')](handleEntityNotFound(_0x189679,null))[_0xe81c('0x36')](function(_0x17d38d){if(_0x17d38d){return _0x17d38d[_0xe81c('0x6c')](_0x47965a[_0xe81c('0x47')][_0xe81c('0x6d')]);}})[_0xe81c('0x36')](respondWithStatusCode(_0x189679,null))[_0xe81c('0x2a')](handleError(_0x189679,null));};exports[_0xe81c('0x62')]=function(_0x145d9e,_0x200dd1){var _0x19afaa={'name':_0x145d9e['body'][_0xe81c('0x3b')],'key':_0x145d9e[_0xe81c('0x5e')][_0xe81c('0x45')],'email':_0x145d9e['body'][_0xe81c('0x6e')],'ListId':_0x145d9e[_0xe81c('0x5e')][_0xe81c('0x6f')],'active':!_[_0xe81c('0x70')](_0x145d9e[_0xe81c('0x5e')][_0xe81c('0x71')])?_0x145d9e[_0xe81c('0x5e')][_0xe81c('0x71')]:!![],'description':_0x145d9e[_0xe81c('0x5e')][_0xe81c('0x72')]||null,'Imap':{},'Smtp':{}};if(_['isNil'](_0x145d9e[_0xe81c('0x5e')]['cservice'])){if(_0x145d9e['body']['cauthentication']){_0x19afaa[_0xe81c('0x3e')][_0xe81c('0x73')]=_0x19afaa[_0xe81c('0x3f')][_0xe81c('0x73')]=_0x145d9e['body'][_0xe81c('0x74')];_0x19afaa[_0xe81c('0x3e')][_0xe81c('0x75')]=_0x19afaa[_0xe81c('0x3f')][_0xe81c('0x76')]=_0x145d9e[_0xe81c('0x5e')][_0xe81c('0x77')];}else{_0x19afaa[_0xe81c('0x3e')][_0xe81c('0x78')]=_0x19afaa[_0xe81c('0x3f')][_0xe81c('0x78')]=![];}_0x19afaa[_0xe81c('0x3e')][_0xe81c('0x79')]=_0x145d9e[_0xe81c('0x5e')][_0xe81c('0x3e')]['host'];_0x19afaa['Imap'][_0xe81c('0x7a')]=_0x145d9e[_0xe81c('0x5e')][_0xe81c('0x3e')][_0xe81c('0x7a')];_0x19afaa[_0xe81c('0x3f')][_0xe81c('0x79')]=_0x145d9e[_0xe81c('0x5e')][_0xe81c('0x3f')]['host'];_0x19afaa[_0xe81c('0x3f')][_0xe81c('0x7a')]=_0x145d9e[_0xe81c('0x5e')][_0xe81c('0x3f')]['port'];}else{_0x19afaa[_0xe81c('0x3e')][_0xe81c('0x7b')]=_0x19afaa[_0xe81c('0x3f')][_0xe81c('0x7b')]=_0x145d9e[_0xe81c('0x5e')][_0xe81c('0x7c')];_0x19afaa[_0xe81c('0x3e')][_0xe81c('0x73')]=_0x19afaa[_0xe81c('0x3f')][_0xe81c('0x73')]=_0x145d9e[_0xe81c('0x5e')][_0xe81c('0x74')];_0x19afaa[_0xe81c('0x3e')][_0xe81c('0x75')]=_0x19afaa[_0xe81c('0x3f')][_0xe81c('0x76')]=_0x145d9e[_0xe81c('0x5e')][_0xe81c('0x77')];}return db[_0xe81c('0x42')][_0xe81c('0x62')](_0x19afaa,{'include':[{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0xe81c('0x3d')],'as':_0xe81c('0x3e')}]})[_0xe81c('0x36')](function(_0x3dbf70){var _0x580e92=_0x145d9e[_0xe81c('0x73')][_0xe81c('0x37')]({'plain':!![]});if(!_0x580e92)throw new Error(_0xe81c('0x7d'));if(_0x580e92[_0xe81c('0x7e')]===_0xe81c('0x73')){var _0x339f2f=_0x3dbf70['get']({'plain':!![]});return db[_0xe81c('0x7f')][_0xe81c('0x5d')]({'where':{'name':_0xe81c('0x38'),'userProfileId':_0x580e92[_0xe81c('0x80')]},'raw':!![]})[_0xe81c('0x36')](function(_0x135f7b){if(_0x135f7b&&_0x135f7b[_0xe81c('0x81')]===0x0){return db[_0xe81c('0x39')]['create']({'name':_0x339f2f[_0xe81c('0x3b')],'resourceId':_0x339f2f['id'],'type':_0x135f7b[_0xe81c('0x3b')],'sectionId':_0x135f7b['id']},{})[_0xe81c('0x36')](function(){return _0x3dbf70;});}else{return _0x3dbf70;}})[_0xe81c('0x2a')](function(_0x1261bb){logger[_0xe81c('0x26')](_0xe81c('0x82'),_0x1261bb);throw _0x1261bb;});}return _0x3dbf70;})[_0xe81c('0x36')](respondWithResult(_0x200dd1,0xc9))[_0xe81c('0x2a')](handleError(_0x200dd1,null));};exports[_0xe81c('0x83')]=function(_0x334914,_0x56e0a5,_0x27b48d){return db[_0xe81c('0x42')][_0xe81c('0x6a')]({'where':{'id':_0x334914[_0xe81c('0x59')]['id']}})[_0xe81c('0x36')](handleEntityNotFound(_0x56e0a5,null))['then'](function(_0x512ae7){if(_0x512ae7){return _0x512ae7[_0xe81c('0x83')]();}return null;})[_0xe81c('0x36')](respondWithResult(_0x56e0a5,null))['catch'](handleError(_0x56e0a5,null));};exports[_0xe81c('0x84')]=function(_0x1653da,_0x55d555,_0x5c873c){if(_0x1653da['body']['id']){delete _0x1653da[_0xe81c('0x5e')]['id'];}return db['MailAccount'][_0xe81c('0x5d')]({'where':{'id':_0x1653da[_0xe81c('0x59')]['id']}})[_0xe81c('0x36')](handleEntityNotFound(_0x55d555,null))[_0xe81c('0x36')](function(_0x1747d3){if(_0x1747d3){_0x1653da[_0xe81c('0x5e')][_0xe81c('0x61')]=_0x1747d3['id'];return db[_0xe81c('0x3d')][_0xe81c('0x62')](_0x1653da[_0xe81c('0x5e')]);}})[_0xe81c('0x36')](respondWithResult(_0x55d555,null))[_0xe81c('0x2a')](handleError(_0x55d555,null));};exports[_0xe81c('0x85')]=function(_0x17b42c,_0x3d886c,_0x4c57c1){return db[_0xe81c('0x42')]['findOne']({'where':{'id':_0x17b42c[_0xe81c('0x59')]['id']}})[_0xe81c('0x36')](handleEntityNotFound(_0x3d886c,null))[_0xe81c('0x36')](function(_0xb503e3){if(_0xb503e3){return _0xb503e3[_0xe81c('0x86')](null);}return null;})[_0xe81c('0x36')](respondWithStatusCode(_0x3d886c,null))['catch'](handleError(_0x3d886c,null));};exports[_0xe81c('0x87')]=function(_0x2b622c,_0x3f7bf8,_0x4402ed){return db['MailAccount']['findOne']({'where':{'id':_0x2b622c[_0xe81c('0x59')]['id']}})[_0xe81c('0x36')](handleEntityNotFound(_0x3f7bf8,null))[_0xe81c('0x36')](function(_0x4690e4){if(_0x4690e4){return _0x4690e4[_0xe81c('0x87')]();}return null;})[_0xe81c('0x36')](respondWithResult(_0x3f7bf8,null))[_0xe81c('0x2a')](handleError(_0x3f7bf8,null));};exports[_0xe81c('0x88')]=function(_0x21d580,_0xa93be4,_0x3c1635){if(_0x21d580[_0xe81c('0x5e')]['id']){delete _0x21d580[_0xe81c('0x5e')]['id'];}return db[_0xe81c('0x42')][_0xe81c('0x5d')]({'where':{'id':_0x21d580['params']['id']}})[_0xe81c('0x36')](handleEntityNotFound(_0xa93be4,null))[_0xe81c('0x36')](function(_0x29524c){if(_0x29524c){_0x21d580[_0xe81c('0x5e')][_0xe81c('0x61')]=_0x29524c['id'];return db['MailServerOut'][_0xe81c('0x62')](_0x21d580['body']);}})[_0xe81c('0x36')](respondWithResult(_0xa93be4,null))[_0xe81c('0x2a')](handleError(_0xa93be4,null));};exports[_0xe81c('0x89')]=function(_0x141c6b,_0x5c43d4,_0xa50b1d){return db[_0xe81c('0x42')][_0xe81c('0x6a')]({'where':{'id':_0x141c6b['params']['id']}})[_0xe81c('0x36')](handleEntityNotFound(_0x5c43d4,null))['then'](function(_0x258700){if(_0x258700){return _0x258700[_0xe81c('0x8a')](null);}return null;})['then'](respondWithStatusCode(_0x5c43d4,null))[_0xe81c('0x2a')](handleError(_0x5c43d4,null));};exports['addInteraction']=function(_0x449702,_0x628266,_0x2131a4){return db[_0xe81c('0x8b')][_0xe81c('0x5d')]({'where':{'id':_0x449702['params']['id']}})[_0xe81c('0x36')](handleEntityNotFound(_0x628266,null))[_0xe81c('0x36')](function(_0x3b42bb){if(_0x3b42bb){return _0x3b42bb[_0xe81c('0x8c')](_0x449702[_0xe81c('0x5e')]['ids'],_[_0xe81c('0x8d')](_0x449702[_0xe81c('0x5e')],[_0xe81c('0x6d'),'id'])||{});}})[_0xe81c('0x36')](respondWithResult(_0x628266,null))[_0xe81c('0x2a')](handleError(_0x628266,null));};exports[_0xe81c('0x8e')]=function(_0x430977,_0x2a0b5b,_0x41938c){var _0x46f3fe={'raw':![],'where':{}};var _0x446519={};var _0x529ba0={'count':0x0,'rows':[]};return db[_0xe81c('0x42')][_0xe81c('0x6a')]({'where':{'id':_0x430977[_0xe81c('0x59')]['id']}})[_0xe81c('0x36')](handleEntityNotFound(_0x2a0b5b,null))[_0xe81c('0x36')](function(_0x387e2a){if(_0x387e2a){_0x446519[_0xe81c('0x46')]=_[_0xe81c('0x48')](db[_0xe81c('0x8b')]['rawAttributes']);_0x446519[_0xe81c('0x47')]=_[_0xe81c('0x48')](_0x430977['query']);_0x446519[_0xe81c('0x49')]=_[_0xe81c('0x4a')](_0x446519[_0xe81c('0x46')],_0x446519[_0xe81c('0x47')]);_0x46f3fe[_0xe81c('0x4b')]=_['intersection'](_0x446519['model'],qs[_0xe81c('0x4c')](_0x430977['query']['fields']));_0x46f3fe[_0xe81c('0x4b')]=_0x46f3fe[_0xe81c('0x4b')][_0xe81c('0x4d')]?_0x46f3fe[_0xe81c('0x4b')]:_0x446519[_0xe81c('0x46')];if(!_0x430977[_0xe81c('0x47')][_0xe81c('0x4e')]('nolimit')){_0x46f3fe[_0xe81c('0x30')]=qs[_0xe81c('0x30')](_0x430977[_0xe81c('0x47')][_0xe81c('0x30')]);_0x46f3fe[_0xe81c('0x2e')]=qs[_0xe81c('0x2e')](_0x430977[_0xe81c('0x47')][_0xe81c('0x2e')]);}_0x46f3fe[_0xe81c('0x50')]=qs[_0xe81c('0x51')](_0x430977[_0xe81c('0x47')]['sort']);_0x46f3fe['where']=qs[_0xe81c('0x49')](_[_0xe81c('0x52')](_0x430977[_0xe81c('0x47')],_0x446519[_0xe81c('0x49')]));_0x46f3fe[_0xe81c('0x53')][_0xe81c('0x61')]=_0x387e2a['id'];if(_0x430977[_0xe81c('0x47')][_0xe81c('0x65')]){_0x46f3fe['where']=_[_0xe81c('0x54')](_0x46f3fe['where'],{'$or':_[_0xe81c('0x41')](_0x46f3fe['attributes'],function(_0x5c0518){var _0x2c7e66={};_0x2c7e66[_0x5c0518]={'$like':'%'+_0x430977[_0xe81c('0x47')][_0xe81c('0x65')]+'%'};return _0x2c7e66;})});}_0x46f3fe=_[_0xe81c('0x54')]({},_0x46f3fe,_0x430977[_0xe81c('0x56')]);return db[_0xe81c('0x8b')][_0xe81c('0x31')]({'where':_0x46f3fe[_0xe81c('0x53')]})[_0xe81c('0x36')](function(_0x509a4c){_0x529ba0[_0xe81c('0x31')]=_0x509a4c;if(_0x430977['query'][_0xe81c('0x6b')]){_0x46f3fe[_0xe81c('0x5c')]=[{'model':db[_0xe81c('0x8f')],'as':_0xe81c('0x90'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0xe81c('0x3b'),'fullname',_0xe81c('0x91')],'required':![]},{'model':db[_0xe81c('0x92')],'as':_0xe81c('0x93'),'attributes':['id',_0xe81c('0x3b'),_0xe81c('0x94')],'where':_0x430977[_0xe81c('0x47')][_0xe81c('0x95')]?{'id':_0x430977['query'][_0xe81c('0x95')]}:undefined,'required':_0x430977[_0xe81c('0x47')][_0xe81c('0x95')]?!![]:![]}];}return db[_0xe81c('0x8b')][_0xe81c('0x96')](_0x46f3fe);})[_0xe81c('0x36')](function(_0x3a9e2d){_0x529ba0[_0xe81c('0x57')]=_0x3a9e2d;return _0x529ba0;});}})[_0xe81c('0x36')](respondWithFilteredResult(_0x2a0b5b,_0x46f3fe))[_0xe81c('0x2a')](handleError(_0x2a0b5b,null));};exports[_0xe81c('0x97')]=function(_0x519c6a,_0x2ddba4,_0x4ba56f){return db[_0xe81c('0x42')][_0xe81c('0x6a')]({'where':{'id':_0x519c6a[_0xe81c('0x59')]['id']}})[_0xe81c('0x36')](handleEntityNotFound(_0x2ddba4,null))[_0xe81c('0x36')](function(_0x537724){if(_0x537724){return db['sequelize'][_0xe81c('0x98')](function(_0x59be50){return db[_0xe81c('0x99')][_0xe81c('0x9a')]({'where':{'MailAccountId':_0x519c6a[_0xe81c('0x59')]['id']},'transaction':_0x59be50})[_0xe81c('0x36')](function(_0x47f1cf){var _0x5df2b4=_['map'](_0x519c6a[_0xe81c('0x5e')],function(_0x22fa49){_0x22fa49[_0xe81c('0x61')]=_0x519c6a[_0xe81c('0x59')]['id'];return _0x22fa49;});return db['MailApplication']['bulkCreate'](_0x5df2b4,{'transaction':_0x59be50});});})[_0xe81c('0x36')](function(){return db[_0xe81c('0x99')][_0xe81c('0x9b')]({'where':{'MailAccountId':_0x519c6a[_0xe81c('0x59')]['id']},'order':_0xe81c('0x9c')});});}})['then'](respondWithResult(_0x2ddba4,null))[_0xe81c('0x2a')](handleError(_0x2ddba4,null));};exports[_0xe81c('0x9d')]=function(_0x37a1bd,_0x1f1274,_0x50dec9){var _0x2c7a12={};var _0x40f9cf={};var _0x35a4a7;var _0x15b000;return db['MailAccount'][_0xe81c('0x6a')]({'where':{'id':_0x37a1bd[_0xe81c('0x59')]['id']}})[_0xe81c('0x36')](handleEntityNotFound(_0x1f1274,null))['then'](function(_0x49ca93){if(_0x49ca93){_0x35a4a7=_0x49ca93;_0x40f9cf[_0xe81c('0x46')]=_[_0xe81c('0x48')](db[_0xe81c('0x99')][_0xe81c('0x43')]);_0x40f9cf[_0xe81c('0x47')]=_[_0xe81c('0x48')](_0x37a1bd[_0xe81c('0x47')]);_0x40f9cf['filters']=_[_0xe81c('0x4a')](_0x40f9cf[_0xe81c('0x46')],_0x40f9cf['query']);_0x2c7a12['attributes']=_['intersection'](_0x40f9cf['model'],qs['fields'](_0x37a1bd[_0xe81c('0x47')]['fields']));_0x2c7a12[_0xe81c('0x4b')]=_0x2c7a12[_0xe81c('0x4b')][_0xe81c('0x4d')]?_0x2c7a12[_0xe81c('0x4b')]:_0x40f9cf['model'];_0x2c7a12[_0xe81c('0x50')]=qs[_0xe81c('0x51')](_0x37a1bd[_0xe81c('0x47')][_0xe81c('0x51')]);_0x2c7a12[_0xe81c('0x53')]=qs[_0xe81c('0x49')](_[_0xe81c('0x52')](_0x37a1bd[_0xe81c('0x47')],_0x40f9cf['filters']));if(_0x37a1bd[_0xe81c('0x47')]['filter']){_0x2c7a12[_0xe81c('0x53')]=_[_0xe81c('0x54')](_0x2c7a12[_0xe81c('0x53')],{'$or':_[_0xe81c('0x41')](_0x2c7a12['attributes'],function(_0x228d7d){var _0x531c79={};_0x531c79[_0x228d7d]={'$like':'%'+_0x37a1bd[_0xe81c('0x47')][_0xe81c('0x65')]+'%'};return _0x531c79;})});}_0x2c7a12=_[_0xe81c('0x54')]({},_0x2c7a12,_0x37a1bd[_0xe81c('0x56')]);return _0x35a4a7[_0xe81c('0x9d')](_0x2c7a12);}})[_0xe81c('0x36')](function(_0xe28cae){if(_0xe28cae){_0x15b000=_0xe28cae['length'];if(!_0x37a1bd['query'][_0xe81c('0x4e')](_0xe81c('0x4f'))){_0x2c7a12['limit']=qs[_0xe81c('0x30')](_0x37a1bd[_0xe81c('0x47')][_0xe81c('0x30')]);_0x2c7a12[_0xe81c('0x2e')]=qs[_0xe81c('0x2e')](_0x37a1bd[_0xe81c('0x47')][_0xe81c('0x2e')]);}return _0x35a4a7[_0xe81c('0x9d')](_0x2c7a12);}})['then'](function(_0x11cc34){if(_0x11cc34){return _0x11cc34?{'count':_0x15b000,'rows':_0x11cc34}:null;}})[_0xe81c('0x36')](respondWithResult(_0x1f1274,null))[_0xe81c('0x2a')](handleError(_0x1f1274,null));};exports[_0xe81c('0x9e')]=function(_0x26cd11,_0x5950dc,_0x4d4656){var _0xbb667={'raw':!![],'where':{}};var _0x543686={};var _0x3ef15a={'count':0x0,'rows':[]};return db[_0xe81c('0x42')][_0xe81c('0x6a')]({'where':{'id':_0x26cd11[_0xe81c('0x59')]['id']}})[_0xe81c('0x36')](handleEntityNotFound(_0x5950dc,null))['then'](function(_0x30db86){if(_0x30db86){_0x543686['model']=_[_0xe81c('0x48')](db['MailMessage'][_0xe81c('0x43')]);_0x543686[_0xe81c('0x47')]=_[_0xe81c('0x48')](_0x26cd11[_0xe81c('0x47')]);_0x543686['filters']=_['intersection'](_0x543686[_0xe81c('0x46')],_0x543686[_0xe81c('0x47')]);_0xbb667[_0xe81c('0x4b')]=_[_0xe81c('0x4a')](_0x543686['model'],qs[_0xe81c('0x4c')](_0x26cd11[_0xe81c('0x47')][_0xe81c('0x4c')]));_0xbb667[_0xe81c('0x4b')]=_0xbb667[_0xe81c('0x4b')]['length']?_0xbb667[_0xe81c('0x4b')]:_0x543686[_0xe81c('0x46')];if(!_0x26cd11[_0xe81c('0x47')][_0xe81c('0x4e')](_0xe81c('0x4f'))){_0xbb667[_0xe81c('0x30')]=qs[_0xe81c('0x30')](_0x26cd11['query'][_0xe81c('0x30')]);_0xbb667[_0xe81c('0x2e')]=qs['offset'](_0x26cd11[_0xe81c('0x47')]['offset']);}_0xbb667[_0xe81c('0x50')]=qs['sort'](_0x26cd11[_0xe81c('0x47')][_0xe81c('0x51')]);_0xbb667[_0xe81c('0x53')]=qs['filters'](_[_0xe81c('0x52')](_0x26cd11[_0xe81c('0x47')],_0x543686[_0xe81c('0x49')]));_0xbb667[_0xe81c('0x53')][_0xe81c('0x61')]=_0x30db86['id'];if(_0x26cd11[_0xe81c('0x47')]['filter']){_0xbb667[_0xe81c('0x53')]=_[_0xe81c('0x54')](_0xbb667['where'],{'$or':_[_0xe81c('0x41')](_0xbb667[_0xe81c('0x4b')],function(_0x3a19b){var _0x617015={};_0x617015[_0x3a19b]={'$like':'%'+_0x26cd11[_0xe81c('0x47')][_0xe81c('0x65')]+'%'};return _0x617015;})});}if(_0x26cd11[_0xe81c('0x47')][_0xe81c('0x9f')]){var _0x157269=_0x26cd11[_0xe81c('0x47')]['$gte'][_0xe81c('0xa0')](',');var _0x5e3be3={};_0x5e3be3[_0x157269[0x0]]={'$gte':moment(_0x157269[0x1])[_0xe81c('0xa1')](_0xe81c('0xa2'))};_0xbb667[_0xe81c('0x53')]=_[_0xe81c('0x54')](_0xbb667['where'],_0x5e3be3);}_0xbb667=_[_0xe81c('0x54')]({},_0xbb667,_0x26cd11[_0xe81c('0x56')]);return db[_0xe81c('0xa3')][_0xe81c('0x31')]({'where':_0xbb667['where']})['then'](function(_0x5b504e){_0x3ef15a[_0xe81c('0x31')]=_0x5b504e;if(_0x26cd11[_0xe81c('0x47')][_0xe81c('0x6b')]){_0xbb667[_0xe81c('0x5c')]=[{'all':!![]}];}return db[_0xe81c('0xa3')][_0xe81c('0x96')](_0xbb667);})[_0xe81c('0x36')](function(_0x417572){if(_0x26cd11[_0xe81c('0x47')]['inlineCss']===_0xe81c('0xa4')){for(var _0x351736=0x0;_0x351736<_0x417572[_0xe81c('0x4d')];_0x351736++){_0x417572[_0x351736][_0xe81c('0x5e')]=juice(_0x417572[_0x351736][_0xe81c('0x5e')]);}}_0x3ef15a[_0xe81c('0x57')]=_0x417572;return _0x3ef15a;});}})['then'](respondWithFilteredResult(_0x5950dc,_0xbb667))[_0xe81c('0x2a')](handleError(_0x5950dc,null));};exports[_0xe81c('0x3c')]=function(_0x683d96,_0x33b84e,_0x392f36){var _0x5b9a36,_0x23450d={},_0x314003;if(_0x683d96[_0xe81c('0x5e')]['to']){_0x314003=_0x683d96['body']['to'][_0xe81c('0xa0')](',')[0x0];}return db['MailAccount'][_0xe81c('0x5d')]({'where':{'id':_0x683d96['params']['id']},'include':[{'model':db[_0xe81c('0xa5')],'as':_0xe81c('0xa6'),'include':[{'model':db[_0xe81c('0x8f')],'as':_0xe81c('0xa7'),'where':{'email':_0x314003},'limit':0x1,'order':[[_0xe81c('0xa8'),_0xe81c('0xa9')]]}]},{'model':db[_0xe81c('0x5a')],'as':_0xe81c('0x3f'),'raw':!![]}]})[_0xe81c('0x36')](handleEntityNotFound(_0x33b84e,null))[_0xe81c('0x36')](function(_0x41c9b6){if(_0x41c9b6){_0x5b9a36=_0x41c9b6;if(_0x41c9b6[_0xe81c('0x3f')]){if(_[_0xe81c('0x70')](_0x683d96['body'][_0xe81c('0xaa')])){_0x683d96[_0xe81c('0x5e')][_0xe81c('0xaa')]=util['format'](_0xe81c('0xab'),_0x41c9b6['name'],_0x41c9b6[_0xe81c('0x6e')]||_0x41c9b6[_0xe81c('0x3f')][_0xe81c('0x73')]);}if(_0x683d96[_0xe81c('0x5e')][_0xe81c('0xac')]&&_0x683d96['body']['attachments'][_0xe81c('0x4d')]){for(var _0x1a8103=0x0;_0x1a8103<_0x683d96[_0xe81c('0x5e')][_0xe81c('0xac')][_0xe81c('0x4d')];_0x1a8103+=0x1){_0x683d96['body'][_0xe81c('0xac')][_0x1a8103]={'filename':_0x683d96['body'][_0xe81c('0xac')][_0x1a8103][_0xe81c('0x3b')],'path':path[_0xe81c('0xad')](config[_0xe81c('0xae')],_0xe81c('0xaf'),_0x683d96[_0xe81c('0x5e')][_0xe81c('0xac')][_0x1a8103][_0xe81c('0xb0')])};}}var _0x299691={'tls':{'rejectUnauthorized':![]}};if(_[_0xe81c('0x70')](_0x41c9b6[_0xe81c('0x3f')]['service'])){if(_0x41c9b6[_0xe81c('0x3f')][_0xe81c('0x78')]){_0x299691[_0xe81c('0xb1')]={'user':_0x41c9b6[_0xe81c('0x3f')][_0xe81c('0x73')],'pass':_0x41c9b6['Smtp'][_0xe81c('0x76')]};}_0x299691['host']=_0x41c9b6['Smtp']['host'];_0x299691[_0xe81c('0x7a')]=_0x41c9b6['Smtp']['port'];_0x299691[_0xe81c('0xb2')]=_0x41c9b6[_0xe81c('0x3f')][_0xe81c('0xb2')];}else{_0x299691[_0xe81c('0x7b')]=_0x41c9b6[_0xe81c('0x3f')][_0xe81c('0x7b')];_0x299691[_0xe81c('0xb1')]={'user':_0x41c9b6['Smtp'][_0xe81c('0x73')],'pass':_0x41c9b6['Smtp']['pass']};}return respondWithRpcPromise(_0xe81c('0xb3'),'sendMail',{'account':_0x299691,'message':_0x683d96[_0xe81c('0x5e')]});}else{throw new Error(_0xe81c('0xb4'));}}})[_0xe81c('0x36')](function(_0x1127c2){if(_0x1127c2){_0x23450d=_0x1127c2;if(_0x5b9a36[_0xe81c('0xa6')]){if(_0x5b9a36[_0xe81c('0xa6')][_0xe81c('0xa7')][_0xe81c('0x4d')]){return _0x5b9a36[_0xe81c('0xa6')][_0xe81c('0xa7')][0x0];}else{return db['CmContact'][_0xe81c('0x62')](_[_0xe81c('0x1c')](_0x683d96[_0xe81c('0x5e')],{'firstName':_0x683d96[_0xe81c('0x5e')]['to'],'email':_0x683d96[_0xe81c('0x5e')]['to'],'phone':_0x683d96[_0xe81c('0x5e')]['to'],'ListId':_0x5b9a36[_0xe81c('0x6f')]}));}}else{throw new Error('List\x20not\x20found');}}})[_0xe81c('0x36')](function(_0x515c78){if(_0x515c78){var _0x570f9b={'UserId':_0x683d96[_0xe81c('0x73')]['id'],'ContactId':_0x515c78['id'],'MailAccountId':_0x5b9a36['id'],'inReplyTo':_0x23450d[_0xe81c('0xb5')],'to':_0x683d96[_0xe81c('0x5e')]['from'],'cc':_0x683d96[_0xe81c('0x5e')]['cc'],'subject':_0x683d96[_0xe81c('0x5e')][_0xe81c('0xb6')],'attach':_0x683d96[_0xe81c('0x5e')]['attach'],'firstMsgDirection':'out','lastMsgAt':moment()[_0xe81c('0xa1')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0xe81c('0xb7'),'Messages':[_['merge'](_0x683d96['body'],{'messageId':_0x23450d['messageId'],'sentAt':moment()[_0xe81c('0xa1')](_0xe81c('0xa2')),'read':!![],'MailAccountId':_0x5b9a36['id'],'UserId':_0x683d96['user']['id'],'ContactId':_0x515c78['id']})]};if(_0x683d96['body'][_0xe81c('0xb8')]){_0x570f9b=_[_0xe81c('0x54')](_0x570f9b,_0x683d96['body'][_0xe81c('0xb8')]);}return db[_0xe81c('0x8b')][_0xe81c('0x62')](_0x570f9b,{'include':[{'model':db[_0xe81c('0xa3')],'as':'Messages'}]});}})[_0xe81c('0x36')](respondWithResult(_0x33b84e,null))[_0xe81c('0x2a')](handleError(_0x33b84e,null));};exports[_0xe81c('0xb9')]=function(_0x2613d6,_0x86ab40,_0x1da0c9){return db[_0xe81c('0x42')][_0xe81c('0x5d')]({'where':{'id':_0x2613d6[_0xe81c('0x59')]['id']},'include':[{'model':db[_0xe81c('0x5a')],'as':_0xe81c('0x3f'),'raw':!![]}]})[_0xe81c('0x36')](handleEntityNotFound(_0x86ab40,null))['then'](function(_0x41f102){if(_0x41f102&&_0x41f102[_0xe81c('0x3f')]){var _0x8a1c55={'id':_0x41f102['id'],'tls':{'rejectUnauthorized':![]}};if(_0x41f102[_0xe81c('0x3f')]['service']){_0x8a1c55[_0xe81c('0x7b')]=_0x41f102['Smtp']['service'];}else{_0x8a1c55[_0xe81c('0x79')]=_0x41f102[_0xe81c('0x3f')][_0xe81c('0x79')];_0x8a1c55['port']=_0x41f102[_0xe81c('0x3f')]['port'];_0x8a1c55[_0xe81c('0xb2')]=_0x41f102[_0xe81c('0x3f')][_0xe81c('0xb2')];}if(_0x41f102[_0xe81c('0x3f')][_0xe81c('0x78')]){_0x8a1c55['auth']={'user':_0x41f102['Smtp'][_0xe81c('0x73')],'pass':_0x41f102[_0xe81c('0x3f')]['pass']};}return respondWithRpcPromise(_0xe81c('0xba'),_0xe81c('0xb9'),{'account':_0x8a1c55});}})[_0xe81c('0x36')](respondWithResult(_0x86ab40,null))['catch'](handleError(_0x86ab40,null));};exports['destroy']=function(_0x4415b2,_0x4e60f5){return db[_0xe81c('0x42')][_0xe81c('0x5d')]({'where':{'id':_0x4415b2[_0xe81c('0x59')]['id']}})[_0xe81c('0x36')](handleEntityNotFound(_0x4e60f5,null))[_0xe81c('0x36')](function(_0x3789b8){if(_0x3789b8&&_0x3789b8[_0xe81c('0x7b')]){throw new db[(_0xe81c('0xbb'))][(_0xe81c('0xbc'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x3789b8;})[_0xe81c('0x36')](removeEntity(_0x4e60f5,null))[_0xe81c('0x2a')](handleError(_0x4e60f5,null));};exports['addAgents']=function(_0x5eeed3,_0x27f014,_0x130517){return db[_0xe81c('0x42')][_0xe81c('0x5d')]({'where':{'id':_0x5eeed3[_0xe81c('0x59')]['id']}})[_0xe81c('0x36')](handleEntityNotFound(_0x27f014,null))[_0xe81c('0x36')](function(_0x3d3ec0){if(_0x3d3ec0){return _0x3d3ec0[_0xe81c('0xbd')](_0x5eeed3['body'][_0xe81c('0x6d')],_[_0xe81c('0x8d')](_0x5eeed3[_0xe81c('0x5e')],['ids','id'])||{})[_0xe81c('0xbe')](function(_0x1d750f){for(var _0x9ef3d1=0x0;_0x9ef3d1<_0x5eeed3[_0xe81c('0x5e')][_0xe81c('0x6d')][_0xe81c('0x4d')];_0x9ef3d1+=0x1){socket[_0xe81c('0xbf')](_0xe81c('0xc0'),{'UserId':Number(_0x5eeed3['body'][_0xe81c('0x6d')][_0x9ef3d1]),'MailAccountId':Number(_0x5eeed3['params']['id'])});}return _0x1d750f;});}})['then'](respondWithResult(_0x27f014,null))[_0xe81c('0x2a')](handleError(_0x27f014,null));};exports['removeAgents']=function(_0x2acd82,_0x25c5bc,_0x4ab66c){return db[_0xe81c('0x42')]['find']({'where':{'id':_0x2acd82[_0xe81c('0x59')]['id']}})['then'](handleEntityNotFound(_0x25c5bc,null))[_0xe81c('0x36')](function(_0xf0c8f0){if(_0xf0c8f0){return _0xf0c8f0['removeAgents'](_0x2acd82['query'][_0xe81c('0x6d')])[_0xe81c('0x36')](function(){if(_[_0xe81c('0xc1')](_0x2acd82[_0xe81c('0x47')][_0xe81c('0x6d')])){for(var _0x529576=0x0;_0x529576<_0x2acd82[_0xe81c('0x47')][_0xe81c('0x6d')][_0xe81c('0x4d')];_0x529576+=0x1){socket['emit'](_0xe81c('0xc2'),{'UserId':Number(_0x2acd82['query'][_0xe81c('0x6d')][_0x529576]),'MailAccountId':Number(_0x2acd82[_0xe81c('0x59')]['id'])});}}else{socket[_0xe81c('0xbf')]('userMailAccount:remove',{'UserId':Number(_0x2acd82[_0xe81c('0x47')][_0xe81c('0x6d')]),'MailAccountId':Number(_0x2acd82[_0xe81c('0x59')]['id'])});}});}})[_0xe81c('0x36')](respondWithStatusCode(_0x25c5bc,null))[_0xe81c('0x2a')](handleError(_0x25c5bc,null));};exports['getAgents']=function(_0x39214f,_0x9219b6,_0x3d7c5e){var _0xe71f58={};var _0x268d1c={};var _0x5e3b8a;var _0x664149;return db['MailAccount'][_0xe81c('0x6a')]({'where':{'id':_0x39214f['params']['id']}})[_0xe81c('0x36')](handleEntityNotFound(_0x9219b6,null))['then'](function(_0x5a6d98){if(_0x5a6d98){_0x5e3b8a=_0x5a6d98;_0x268d1c[_0xe81c('0x46')]=_[_0xe81c('0x48')](db[_0xe81c('0xc3')][_0xe81c('0x43')]);_0x268d1c['query']=_[_0xe81c('0x48')](_0x39214f[_0xe81c('0x47')]);_0x268d1c['filters']=_[_0xe81c('0x4a')](_0x268d1c['model'],_0x268d1c[_0xe81c('0x47')]);_0xe71f58[_0xe81c('0x4b')]=_['intersection'](_0x268d1c[_0xe81c('0x46')],qs[_0xe81c('0x4c')](_0x39214f[_0xe81c('0x47')][_0xe81c('0x4c')]));_0xe71f58[_0xe81c('0x4b')]=_0xe71f58[_0xe81c('0x4b')][_0xe81c('0x4d')]?_0xe71f58['attributes']:_0x268d1c[_0xe81c('0x46')];_0xe71f58[_0xe81c('0x50')]=qs['sort'](_0x39214f[_0xe81c('0x47')][_0xe81c('0x51')]);_0xe71f58[_0xe81c('0x53')]=qs[_0xe81c('0x49')](_[_0xe81c('0x52')](_0x39214f[_0xe81c('0x47')],_0x268d1c[_0xe81c('0x49')]));if(_0x39214f[_0xe81c('0x47')]['filter']){_0xe71f58[_0xe81c('0x53')]=_[_0xe81c('0x54')](_0xe71f58[_0xe81c('0x53')],{'$or':_[_0xe81c('0x41')](_0xe71f58['attributes'],function(_0x57a6b3){var _0x4bf0b0={};_0x4bf0b0[_0x57a6b3]={'$like':'%'+_0x39214f[_0xe81c('0x47')][_0xe81c('0x65')]+'%'};return _0x4bf0b0;})});}_0xe71f58=_[_0xe81c('0x54')]({},_0xe71f58,_0x39214f[_0xe81c('0x56')]);return _0x5e3b8a['getAgents'](_0xe71f58);}})[_0xe81c('0x36')](function(_0x419631){if(_0x419631){_0x664149=_0x419631[_0xe81c('0x4d')];if(!_0x39214f[_0xe81c('0x47')]['hasOwnProperty'](_0xe81c('0x4f'))){_0xe71f58[_0xe81c('0x30')]=qs['limit'](_0x39214f[_0xe81c('0x47')][_0xe81c('0x30')]);_0xe71f58[_0xe81c('0x2e')]=qs[_0xe81c('0x2e')](_0x39214f['query']['offset']);}return _0x5e3b8a[_0xe81c('0xc4')](_0xe71f58);}})[_0xe81c('0x36')](function(_0x39cb01){if(_0x39cb01){return _0x39cb01?{'count':_0x664149,'rows':_0x39cb01}:null;}})[_0xe81c('0x36')](respondWithResult(_0x9219b6,null))[_0xe81c('0x2a')](handleError(_0x9219b6,null));}; \ No newline at end of file +var _0x86f5=['fields','attributes','length','nolimit','sort','where','filter','merge','options','include','catch','params','MailServerOut','Smtp','find','body','describe','create','findOne','keys','Disposition','order','MailAccountId','includeAll','rows','removeDispositions','ids','addAnswer','CannedAnswer','hasOwnProperty','pick','findAll','removeAnswers','email','ListId','active','description','isNil','cservice','cauthentication','user','password','pass','cpassword','authentication','host','port','service','cuser','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','getInteractions','User','internal','Tag','Tags','color','tag','sequelize','transaction','MailApplication','bulkCreate','findAndCountAll','priority','getApplications','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','true','CmList','List','Contacts','updatedAt','DESC','from','%s\x20<%s>','attachments','join','root','basename','auth','secure','SendMail','sendMail','List\x20not\x20found','CmContact','subject','attach','out','messageId','Interaction','verifySmtp','VerifySmtp','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','omit','spread','userMailAccount:save','removeAgents','userMailAccount:remove','emit','getAgents','eml-format','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','html-to-text','juice','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','end','json','offset','limit','undefined','count','status','set','Content-Range','save','update','destroy','get','MailAccounts','UserProfileResource','stack','name','send','index','MailServerIn','Imap','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection'];(function(_0x1b6086,_0x2f80ee){var _0x12fe31=function(_0x1e980e){while(--_0x1e980e){_0x1b6086['push'](_0x1b6086['shift']());}};_0x12fe31(++_0x2f80ee);}(_0x86f5,0x74));var _0x586f=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0x86f5[_0x525c7b];return _0x27b33e;};'use strict';var emlformat=require(_0x586f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x586f('0x1'));var jsonpatch=require(_0x586f('0x2'));var rp=require('request-promise');var moment=require(_0x586f('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x586f('0x4'));var path=require(_0x586f('0x5'));var sox=require(_0x586f('0x6'));var csv=require(_0x586f('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x586f('0x8'));var _=require(_0x586f('0x9'));var squel=require('squel');var crypto=require(_0x586f('0xa'));var jsforce=require(_0x586f('0xb'));var deskjs=require(_0x586f('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x586f('0xd'));var htmlToText=require(_0x586f('0xe'));var juice=require(_0x586f('0xf'));var Redis=require(_0x586f('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x586f('0x11'));var logger=require(_0x586f('0x12'))('api');var utils=require(_0x586f('0x13'));var config=require(_0x586f('0x14'));var licenseUtil=require(_0x586f('0x15'));var db=require('../../mysqldb')['db'];config[_0x586f('0x16')]=_[_0x586f('0x17')](config[_0x586f('0x16')],{'host':_0x586f('0x18'),'port':0x18eb});var socket=require(_0x586f('0x19'))(new Redis(config[_0x586f('0x16')]));require('./mailAccount.socket')[_0x586f('0x1a')](socket);var jayson=require(_0x586f('0x1b'));var client=jayson[_0x586f('0x1c')][_0x586f('0x1d')]({'port':0x232b});function respondWithRpcPromise(_0x4fcbe8,_0x377b19,_0x4eb39f,_0x41f8d1){return new BPromise(function(_0x851aaf,_0x2de9e4){var _0x2bad3f=_0x41f8d1||client;return _0x2bad3f[_0x586f('0x1e')](_0x4fcbe8,_0x4eb39f)[_0x586f('0x1f')](function(_0x532cec){logger[_0x586f('0x20')](_0x586f('0x21'),_0x377b19,_0x586f('0x22'));logger[_0x586f('0x23')](_0x586f('0x24'),_0x377b19,_0x586f('0x22'),JSON[_0x586f('0x25')](_0x532cec));if(_0x532cec['error']){if(_0x532cec[_0x586f('0x26')][_0x586f('0x27')]===0x1f4){logger['error']('MailAccount,\x20%s,\x20%s',_0x377b19,_0x532cec[_0x586f('0x26')][_0x586f('0x28')]);return _0x2de9e4(_0x532cec[_0x586f('0x26')][_0x586f('0x28')]);}logger[_0x586f('0x26')](_0x586f('0x21'),_0x377b19,_0x532cec[_0x586f('0x26')][_0x586f('0x28')]);return _0x851aaf(_0x532cec[_0x586f('0x26')][_0x586f('0x28')]);}else{logger['info']('MailAccount,\x20%s,\x20%s',_0x377b19,_0x586f('0x22'));_0x851aaf(_0x532cec[_0x586f('0x29')]['message']);}})['catch'](function(_0x5ed286){logger[_0x586f('0x26')](_0x586f('0x21'),_0x377b19,_0x5ed286);_0x2de9e4(_0x5ed286);});});}function respondWithStatusCode(_0x25cef1,_0x23cb14){_0x23cb14=_0x23cb14||0xcc;return function(_0x19a3fa){if(_0x19a3fa){return _0x25cef1[_0x586f('0x2a')](_0x23cb14);}return _0x25cef1['status'](_0x23cb14)[_0x586f('0x2b')]();};}function respondWithResult(_0x442cf5,_0x347720){_0x347720=_0x347720||0xc8;return function(_0x4c9fa4){if(_0x4c9fa4){return _0x442cf5['status'](_0x347720)[_0x586f('0x2c')](_0x4c9fa4);}};}function respondWithFilteredResult(_0x13f256,_0x39f232){return function(_0x8e198a){if(_0x8e198a){var _0x5902fd=typeof _0x39f232[_0x586f('0x2d')]==='undefined'&&typeof _0x39f232[_0x586f('0x2e')]===_0x586f('0x2f');var _0x1f17f9=_0x8e198a[_0x586f('0x30')];var _0x393c4a=_0x5902fd?0x0:_0x39f232[_0x586f('0x2d')];var _0x2c7bbf=_0x5902fd?_0x8e198a[_0x586f('0x30')]:_0x39f232[_0x586f('0x2d')]+_0x39f232[_0x586f('0x2e')];var _0x4e5fc2;if(_0x2c7bbf>=_0x1f17f9){_0x2c7bbf=_0x1f17f9;_0x4e5fc2=0xc8;}else{_0x4e5fc2=0xce;}_0x13f256[_0x586f('0x31')](_0x4e5fc2);return _0x13f256[_0x586f('0x32')](_0x586f('0x33'),_0x393c4a+'-'+_0x2c7bbf+'/'+_0x1f17f9)[_0x586f('0x2c')](_0x8e198a);}return null;};}function patchUpdates(_0x4a30e1){return function(_0xae507f){try{jsonpatch['apply'](_0xae507f,_0x4a30e1,!![]);}catch(_0x55a7b6){return BPromise['reject'](_0x55a7b6);}return _0xae507f[_0x586f('0x34')]();};}function saveUpdates(_0x1dfe77,_0x512849){return function(_0x35504f){if(_0x35504f){return _0x35504f[_0x586f('0x35')](_0x1dfe77)[_0x586f('0x1f')](function(_0x8f52cf){return _0x8f52cf;});}return null;};}function removeEntity(_0x408bc5,_0x19b0fb){return function(_0x12a9c0){if(_0x12a9c0){return _0x12a9c0[_0x586f('0x36')]()[_0x586f('0x1f')](function(){var _0x3de47e=_0x12a9c0[_0x586f('0x37')]({'plain':!![]});var _0x2d432c=_0x586f('0x38');return db[_0x586f('0x39')][_0x586f('0x36')]({'where':{'type':_0x2d432c,'resourceId':_0x3de47e['id']}})[_0x586f('0x1f')](function(){return _0x12a9c0;});})[_0x586f('0x1f')](function(){_0x408bc5['status'](0xcc)[_0x586f('0x2b')]();});}};}function handleEntityNotFound(_0x5c427a,_0x4da782){return function(_0xc689df){if(!_0xc689df){_0x5c427a[_0x586f('0x2a')](0x194);}return _0xc689df;};}function handleError(_0x39785d,_0x14382b){_0x14382b=_0x14382b||0x1f4;return function(_0x109bd9){logger[_0x586f('0x26')](_0x109bd9[_0x586f('0x3a')]);if(_0x109bd9[_0x586f('0x3b')]){delete _0x109bd9[_0x586f('0x3b')];}_0x39785d[_0x586f('0x31')](_0x14382b)[_0x586f('0x3c')](_0x109bd9);};}exports[_0x586f('0x3d')]=function(_0x791000,_0x49015f){var _0x469c7e={'include':[{'model':db[_0x586f('0x3e')],'as':_0x586f('0x3f')},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0x586f('0x40')],'as':_0x586f('0x41')}]},_0x26db32={},_0x394ab6={'count':0x0,'rows':[]};var _0x4dafe9=_[_0x586f('0x42')](db[_0x586f('0x43')][_0x586f('0x44')],function(_0x58d119){return{'name':_0x58d119[_0x586f('0x45')],'type':_0x58d119[_0x586f('0x46')][_0x586f('0x47')]};});_0x26db32[_0x586f('0x48')]=_[_0x586f('0x42')](_0x4dafe9,_0x586f('0x3b'));_0x26db32[_0x586f('0x49')]=_['keys'](_0x791000['query']);_0x26db32[_0x586f('0x4a')]=_['intersection'](_0x26db32['model'],_0x26db32[_0x586f('0x49')]);_0x469c7e['attributes']=_[_0x586f('0x4b')](_0x26db32['model'],qs[_0x586f('0x4c')](_0x791000[_0x586f('0x49')][_0x586f('0x4c')]));_0x469c7e[_0x586f('0x4d')]=_0x469c7e[_0x586f('0x4d')][_0x586f('0x4e')]?_0x469c7e[_0x586f('0x4d')]:_0x26db32[_0x586f('0x48')];if(!_0x791000[_0x586f('0x49')]['hasOwnProperty'](_0x586f('0x4f'))){_0x469c7e[_0x586f('0x2e')]=qs[_0x586f('0x2e')](_0x791000[_0x586f('0x49')]['limit']);_0x469c7e[_0x586f('0x2d')]=qs[_0x586f('0x2d')](_0x791000[_0x586f('0x49')][_0x586f('0x2d')]);}_0x469c7e['order']=qs[_0x586f('0x50')](_0x791000['query'][_0x586f('0x50')]);_0x469c7e[_0x586f('0x51')]=qs['filters'](_['pick'](_0x791000[_0x586f('0x49')],_0x26db32[_0x586f('0x4a')]),_0x4dafe9);if(_0x791000['query'][_0x586f('0x52')]){_0x469c7e[_0x586f('0x51')]=_['merge'](_0x469c7e[_0x586f('0x51')],{'$or':_[_0x586f('0x42')](_0x4dafe9,function(_0x2e4b3a){if(_0x2e4b3a[_0x586f('0x46')]!=='VIRTUAL'){var _0x278438={};_0x278438[_0x2e4b3a[_0x586f('0x3b')]]={'$like':'%'+_0x791000[_0x586f('0x49')][_0x586f('0x52')]+'%'};return _0x278438;}})});}_0x469c7e=_[_0x586f('0x53')]({},_0x469c7e,_0x791000[_0x586f('0x54')]);var _0x145ba9={'where':_0x469c7e[_0x586f('0x51')]};return db[_0x586f('0x43')][_0x586f('0x30')](_0x145ba9)['then'](function(_0xac05b3){_0x394ab6['count']=_0xac05b3;if(_0x791000['query']['includeAll']){_0x469c7e[_0x586f('0x55')]=[{'all':!![]}];}return db['MailAccount']['findAll'](_0x469c7e);})[_0x586f('0x1f')](function(_0x324724){_0x394ab6['rows']=_0x324724;return _0x394ab6;})[_0x586f('0x1f')](respondWithFilteredResult(_0x49015f,_0x469c7e))[_0x586f('0x56')](handleError(_0x49015f,null));};exports['show']=function(_0x3368a8,_0x2b8e45){var _0x64e5df={'raw':![],'where':{'id':_0x3368a8[_0x586f('0x57')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x586f('0x3f')},{'model':db[_0x586f('0x58')],'as':_0x586f('0x59')},{'model':db['Pause'],'as':_0x586f('0x41')}]},_0x3c3426={};_0x3c3426[_0x586f('0x48')]=_['keys'](db[_0x586f('0x43')]['rawAttributes']);_0x3c3426[_0x586f('0x49')]=_['keys'](_0x3368a8[_0x586f('0x49')]);_0x3c3426[_0x586f('0x4a')]=_[_0x586f('0x4b')](_0x3c3426[_0x586f('0x48')],_0x3c3426[_0x586f('0x49')]);_0x64e5df[_0x586f('0x4d')]=_[_0x586f('0x4b')](_0x3c3426['model'],qs[_0x586f('0x4c')](_0x3368a8[_0x586f('0x49')][_0x586f('0x4c')]));_0x64e5df[_0x586f('0x4d')]=_0x64e5df[_0x586f('0x4d')][_0x586f('0x4e')]?_0x64e5df[_0x586f('0x4d')]:_0x3c3426[_0x586f('0x48')];if(_0x3368a8[_0x586f('0x49')]['includeAll']){_0x64e5df[_0x586f('0x55')]=[{'all':!![]}];}_0x64e5df=_['merge']({},_0x64e5df,_0x3368a8[_0x586f('0x54')]);return db['MailAccount'][_0x586f('0x5a')](_0x64e5df)[_0x586f('0x1f')](handleEntityNotFound(_0x2b8e45,null))[_0x586f('0x1f')](respondWithResult(_0x2b8e45,null))[_0x586f('0x56')](handleError(_0x2b8e45,null));};exports[_0x586f('0x35')]=function(_0x2db30d,_0x48425a){if(_0x2db30d[_0x586f('0x5b')]['id']){delete _0x2db30d['body']['id'];}return db[_0x586f('0x43')][_0x586f('0x5a')]({'where':{'id':_0x2db30d[_0x586f('0x57')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x586f('0x3f')},{'model':db[_0x586f('0x58')],'as':_0x586f('0x59')},{'model':db[_0x586f('0x40')],'as':'mandatoryDispositionPause'}]})[_0x586f('0x1f')](handleEntityNotFound(_0x48425a,null))[_0x586f('0x1f')](saveUpdates(_0x2db30d[_0x586f('0x5b')],null))['then'](function(_0x172276){if(_0x172276&&_0x2db30d[_0x586f('0x5b')]['Imap']){return db['MailServerIn']['update'](_0x2db30d[_0x586f('0x5b')][_0x586f('0x3f')],{'where':{'MailAccountId':_0x172276['id']}})[_0x586f('0x1f')](function(){return _0x172276;});}return _0x172276;})[_0x586f('0x1f')](function(_0x3d7a02){if(_0x3d7a02&&_0x2db30d['body'][_0x586f('0x59')]){return db[_0x586f('0x58')][_0x586f('0x35')](_0x2db30d[_0x586f('0x5b')][_0x586f('0x59')],{'where':{'MailAccountId':_0x3d7a02['id']}})[_0x586f('0x1f')](function(){return _0x3d7a02;});}return _0x3d7a02;})['then'](respondWithResult(_0x48425a,null))[_0x586f('0x56')](handleError(_0x48425a,null));};exports[_0x586f('0x5c')]=function(_0x2f98ff,_0x56fd95){return db[_0x586f('0x43')][_0x586f('0x5c')]()['then'](respondWithResult(_0x56fd95,null))[_0x586f('0x56')](handleError(_0x56fd95,null));};exports['addDisposition']=function(_0x503c9a,_0x3edd6f,_0x1c5979){if(_0x503c9a[_0x586f('0x5b')]['id']){delete _0x503c9a[_0x586f('0x5b')]['id'];}return db['MailAccount'][_0x586f('0x5a')]({'where':{'id':_0x503c9a['params']['id']}})['then'](handleEntityNotFound(_0x3edd6f,null))[_0x586f('0x1f')](function(_0x137dd4){if(_0x137dd4){_0x503c9a['body']['MailAccountId']=_0x137dd4['id'];return db['Disposition'][_0x586f('0x5d')](_0x503c9a[_0x586f('0x5b')]);}})[_0x586f('0x1f')](respondWithResult(_0x3edd6f,null))[_0x586f('0x56')](handleError(_0x3edd6f,null));};exports['getDispositions']=function(_0x31a9de,_0x31c200,_0x2b8d11){var _0x1f032b={'raw':![],'where':{}};var _0x12a03c={};var _0x304577={'count':0x0,'rows':[]};return db[_0x586f('0x43')][_0x586f('0x5e')]({'where':{'id':_0x31a9de['params']['id']}})[_0x586f('0x1f')](handleEntityNotFound(_0x31c200,null))['then'](function(_0x53632e){if(_0x53632e){_0x12a03c[_0x586f('0x48')]=_[_0x586f('0x5f')](db[_0x586f('0x60')][_0x586f('0x44')]);_0x12a03c[_0x586f('0x49')]=_[_0x586f('0x5f')](_0x31a9de['query']);_0x12a03c[_0x586f('0x4a')]=_[_0x586f('0x4b')](_0x12a03c['model'],_0x12a03c['query']);_0x1f032b[_0x586f('0x4d')]=_[_0x586f('0x4b')](_0x12a03c[_0x586f('0x48')],qs[_0x586f('0x4c')](_0x31a9de['query'][_0x586f('0x4c')]));_0x1f032b[_0x586f('0x4d')]=_0x1f032b['attributes'][_0x586f('0x4e')]?_0x1f032b[_0x586f('0x4d')]:_0x12a03c['model'];if(!_0x31a9de['query']['hasOwnProperty']('nolimit')){_0x1f032b[_0x586f('0x2e')]=qs['limit'](_0x31a9de[_0x586f('0x49')]['limit']);_0x1f032b[_0x586f('0x2d')]=qs[_0x586f('0x2d')](_0x31a9de[_0x586f('0x49')][_0x586f('0x2d')]);}_0x1f032b[_0x586f('0x61')]=qs['sort'](_0x31a9de[_0x586f('0x49')][_0x586f('0x50')]);_0x1f032b['where']=qs[_0x586f('0x4a')](_['pick'](_0x31a9de[_0x586f('0x49')],_0x12a03c['filters']));_0x1f032b[_0x586f('0x51')][_0x586f('0x62')]=_0x53632e['id'];if(_0x31a9de[_0x586f('0x49')][_0x586f('0x52')]){_0x1f032b['where']=_[_0x586f('0x53')](_0x1f032b[_0x586f('0x51')],{'$or':_[_0x586f('0x42')](_0x1f032b[_0x586f('0x4d')],function(_0x55b08d){var _0x437280={};_0x437280[_0x55b08d]={'$like':'%'+_0x31a9de[_0x586f('0x49')][_0x586f('0x52')]+'%'};return _0x437280;})});}_0x1f032b=_[_0x586f('0x53')]({},_0x1f032b,_0x31a9de[_0x586f('0x54')]);return db[_0x586f('0x60')][_0x586f('0x30')]({'where':_0x1f032b[_0x586f('0x51')]})[_0x586f('0x1f')](function(_0x2c6568){_0x304577[_0x586f('0x30')]=_0x2c6568;if(_0x31a9de['query'][_0x586f('0x63')]){_0x1f032b['include']=[{'all':!![]}];}return db[_0x586f('0x60')]['findAll'](_0x1f032b);})['then'](function(_0x2970fd){_0x304577[_0x586f('0x64')]=_0x2970fd;return _0x304577;});}})['then'](respondWithFilteredResult(_0x31c200,_0x1f032b))['catch'](handleError(_0x31c200,null));};exports[_0x586f('0x65')]=function(_0x1a22bd,_0x49960e,_0xc28369){return db[_0x586f('0x43')][_0x586f('0x5a')]({'where':{'id':_0x1a22bd[_0x586f('0x57')]['id']}})['then'](handleEntityNotFound(_0x49960e,null))[_0x586f('0x1f')](function(_0xc3d725){if(_0xc3d725){return _0xc3d725['removeDispositions'](_0x1a22bd[_0x586f('0x49')][_0x586f('0x66')]);}})[_0x586f('0x1f')](respondWithStatusCode(_0x49960e,null))[_0x586f('0x56')](handleError(_0x49960e,null));};exports[_0x586f('0x67')]=function(_0x1430d9,_0x380d34,_0x449880){if(_0x1430d9[_0x586f('0x5b')]['id']){delete _0x1430d9[_0x586f('0x5b')]['id'];}return db[_0x586f('0x43')][_0x586f('0x5a')]({'where':{'id':_0x1430d9[_0x586f('0x57')]['id']}})['then'](handleEntityNotFound(_0x380d34,null))['then'](function(_0x2c5e1b){if(_0x2c5e1b){_0x1430d9[_0x586f('0x5b')][_0x586f('0x62')]=_0x2c5e1b['id'];return db['CannedAnswer'][_0x586f('0x5d')](_0x1430d9[_0x586f('0x5b')]);}})['then'](respondWithResult(_0x380d34,null))[_0x586f('0x56')](handleError(_0x380d34,null));};exports['getAnswers']=function(_0x122698,_0x172d58,_0x4b60bd){var _0x3da427={'raw':![],'where':{}};var _0x438f78={};var _0x39ea2b={'count':0x0,'rows':[]};return db['MailAccount'][_0x586f('0x5e')]({'where':{'id':_0x122698[_0x586f('0x57')]['id']}})[_0x586f('0x1f')](handleEntityNotFound(_0x172d58,null))['then'](function(_0x27f458){if(_0x27f458){_0x438f78[_0x586f('0x48')]=_['keys'](db[_0x586f('0x68')][_0x586f('0x44')]);_0x438f78[_0x586f('0x49')]=_['keys'](_0x122698[_0x586f('0x49')]);_0x438f78[_0x586f('0x4a')]=_['intersection'](_0x438f78['model'],_0x438f78[_0x586f('0x49')]);_0x3da427[_0x586f('0x4d')]=_['intersection'](_0x438f78[_0x586f('0x48')],qs[_0x586f('0x4c')](_0x122698[_0x586f('0x49')][_0x586f('0x4c')]));_0x3da427[_0x586f('0x4d')]=_0x3da427['attributes'][_0x586f('0x4e')]?_0x3da427['attributes']:_0x438f78[_0x586f('0x48')];if(!_0x122698[_0x586f('0x49')][_0x586f('0x69')](_0x586f('0x4f'))){_0x3da427['limit']=qs['limit'](_0x122698[_0x586f('0x49')]['limit']);_0x3da427[_0x586f('0x2d')]=qs[_0x586f('0x2d')](_0x122698['query']['offset']);}_0x3da427[_0x586f('0x61')]=qs['sort'](_0x122698['query'][_0x586f('0x50')]);_0x3da427[_0x586f('0x51')]=qs['filters'](_[_0x586f('0x6a')](_0x122698[_0x586f('0x49')],_0x438f78['filters']));_0x3da427[_0x586f('0x51')][_0x586f('0x62')]=_0x27f458['id'];if(_0x122698[_0x586f('0x49')][_0x586f('0x52')]){_0x3da427[_0x586f('0x51')]=_[_0x586f('0x53')](_0x3da427[_0x586f('0x51')],{'$or':_[_0x586f('0x42')](_0x3da427[_0x586f('0x4d')],function(_0x49f713){var _0x2acf7e={};_0x2acf7e[_0x49f713]={'$like':'%'+_0x122698['query'][_0x586f('0x52')]+'%'};return _0x2acf7e;})});}_0x3da427=_[_0x586f('0x53')]({},_0x3da427,_0x122698[_0x586f('0x54')]);return db[_0x586f('0x68')]['count']({'where':_0x3da427['where']})[_0x586f('0x1f')](function(_0x1660e3){_0x39ea2b['count']=_0x1660e3;if(_0x122698[_0x586f('0x49')]['includeAll']){_0x3da427['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x586f('0x6b')](_0x3da427);})[_0x586f('0x1f')](function(_0x131e20){_0x39ea2b[_0x586f('0x64')]=_0x131e20;return _0x39ea2b;});}})[_0x586f('0x1f')](respondWithFilteredResult(_0x172d58,_0x3da427))[_0x586f('0x56')](handleError(_0x172d58,null));};exports[_0x586f('0x6c')]=function(_0x991443,_0x444314,_0xda9a16){return db[_0x586f('0x43')][_0x586f('0x5a')]({'where':{'id':_0x991443[_0x586f('0x57')]['id']}})[_0x586f('0x1f')](handleEntityNotFound(_0x444314,null))[_0x586f('0x1f')](function(_0x38eeac){if(_0x38eeac){return _0x38eeac['removeAnswers'](_0x991443[_0x586f('0x49')]['ids']);}})[_0x586f('0x1f')](respondWithStatusCode(_0x444314,null))[_0x586f('0x56')](handleError(_0x444314,null));};exports[_0x586f('0x5d')]=function(_0x254e78,_0x305437){var _0x106086={'name':_0x254e78[_0x586f('0x5b')][_0x586f('0x3b')],'key':_0x254e78[_0x586f('0x5b')][_0x586f('0x47')],'email':_0x254e78['body'][_0x586f('0x6d')],'ListId':_0x254e78['body'][_0x586f('0x6e')],'active':!_['isNil'](_0x254e78[_0x586f('0x5b')][_0x586f('0x6f')])?_0x254e78[_0x586f('0x5b')][_0x586f('0x6f')]:!![],'description':_0x254e78[_0x586f('0x5b')][_0x586f('0x70')]||null,'Imap':{},'Smtp':{}};if(_[_0x586f('0x71')](_0x254e78[_0x586f('0x5b')][_0x586f('0x72')])){if(_0x254e78['body'][_0x586f('0x73')]){_0x106086[_0x586f('0x3f')][_0x586f('0x74')]=_0x106086[_0x586f('0x59')][_0x586f('0x74')]=_0x254e78['body']['cuser'];_0x106086[_0x586f('0x3f')][_0x586f('0x75')]=_0x106086[_0x586f('0x59')][_0x586f('0x76')]=_0x254e78[_0x586f('0x5b')][_0x586f('0x77')];}else{_0x106086[_0x586f('0x3f')][_0x586f('0x78')]=_0x106086[_0x586f('0x59')][_0x586f('0x78')]=![];}_0x106086[_0x586f('0x3f')][_0x586f('0x79')]=_0x254e78[_0x586f('0x5b')][_0x586f('0x3f')][_0x586f('0x79')];_0x106086[_0x586f('0x3f')][_0x586f('0x7a')]=_0x254e78[_0x586f('0x5b')]['Imap']['port'];_0x106086['Smtp'][_0x586f('0x79')]=_0x254e78['body'][_0x586f('0x59')][_0x586f('0x79')];_0x106086[_0x586f('0x59')][_0x586f('0x7a')]=_0x254e78[_0x586f('0x5b')]['Smtp'][_0x586f('0x7a')];}else{_0x106086[_0x586f('0x3f')][_0x586f('0x7b')]=_0x106086[_0x586f('0x59')][_0x586f('0x7b')]=_0x254e78[_0x586f('0x5b')][_0x586f('0x72')];_0x106086[_0x586f('0x3f')]['user']=_0x106086['Smtp']['user']=_0x254e78[_0x586f('0x5b')][_0x586f('0x7c')];_0x106086[_0x586f('0x3f')][_0x586f('0x75')]=_0x106086[_0x586f('0x59')][_0x586f('0x76')]=_0x254e78[_0x586f('0x5b')][_0x586f('0x77')];}return db[_0x586f('0x43')][_0x586f('0x5d')](_0x106086,{'include':[{'model':db['MailServerOut'],'as':_0x586f('0x59')},{'model':db[_0x586f('0x3e')],'as':_0x586f('0x3f')}]})['then'](function(_0x3538a5){var _0x357e6e=_0x254e78[_0x586f('0x74')][_0x586f('0x37')]({'plain':!![]});if(!_0x357e6e)throw new Error(_0x586f('0x7d'));if(_0x357e6e['role']===_0x586f('0x74')){var _0x108607=_0x3538a5[_0x586f('0x37')]({'plain':!![]});return db['UserProfileSection'][_0x586f('0x5a')]({'where':{'name':'MailAccounts','userProfileId':_0x357e6e[_0x586f('0x7e')]},'raw':!![]})[_0x586f('0x1f')](function(_0x2b18e3){if(_0x2b18e3&&_0x2b18e3[_0x586f('0x7f')]===0x0){return db[_0x586f('0x39')][_0x586f('0x5d')]({'name':_0x108607[_0x586f('0x3b')],'resourceId':_0x108607['id'],'type':_0x2b18e3[_0x586f('0x3b')],'sectionId':_0x2b18e3['id']},{})['then'](function(){return _0x3538a5;});}else{return _0x3538a5;}})['catch'](function(_0x403f0e){logger['error'](_0x586f('0x80'),_0x403f0e);throw _0x403f0e;});}return _0x3538a5;})[_0x586f('0x1f')](respondWithResult(_0x305437,0xc9))[_0x586f('0x56')](handleError(_0x305437,null));};exports[_0x586f('0x81')]=function(_0x2618b1,_0x2121ad,_0x175415){return db[_0x586f('0x43')][_0x586f('0x5e')]({'where':{'id':_0x2618b1[_0x586f('0x57')]['id']}})[_0x586f('0x1f')](handleEntityNotFound(_0x2121ad,null))[_0x586f('0x1f')](function(_0x18a0a8){if(_0x18a0a8){return _0x18a0a8[_0x586f('0x81')]();}return null;})[_0x586f('0x1f')](respondWithResult(_0x2121ad,null))[_0x586f('0x56')](handleError(_0x2121ad,null));};exports[_0x586f('0x82')]=function(_0x2b9a02,_0xfd52a4,_0x3366c9){if(_0x2b9a02[_0x586f('0x5b')]['id']){delete _0x2b9a02[_0x586f('0x5b')]['id'];}return db[_0x586f('0x43')][_0x586f('0x5a')]({'where':{'id':_0x2b9a02[_0x586f('0x57')]['id']}})[_0x586f('0x1f')](handleEntityNotFound(_0xfd52a4,null))[_0x586f('0x1f')](function(_0x16146b){if(_0x16146b){_0x2b9a02['body'][_0x586f('0x62')]=_0x16146b['id'];return db['MailServerIn'][_0x586f('0x5d')](_0x2b9a02[_0x586f('0x5b')]);}})[_0x586f('0x1f')](respondWithResult(_0xfd52a4,null))[_0x586f('0x56')](handleError(_0xfd52a4,null));};exports['removeImap']=function(_0x4635a8,_0x3129f5,_0x409dc2){return db['MailAccount'][_0x586f('0x5e')]({'where':{'id':_0x4635a8['params']['id']}})[_0x586f('0x1f')](handleEntityNotFound(_0x3129f5,null))['then'](function(_0x4abe65){if(_0x4abe65){return _0x4abe65[_0x586f('0x83')](null);}return null;})[_0x586f('0x1f')](respondWithStatusCode(_0x3129f5,null))[_0x586f('0x56')](handleError(_0x3129f5,null));};exports[_0x586f('0x84')]=function(_0x5befa6,_0x26d4e4,_0x35371a){return db[_0x586f('0x43')][_0x586f('0x5e')]({'where':{'id':_0x5befa6[_0x586f('0x57')]['id']}})['then'](handleEntityNotFound(_0x26d4e4,null))[_0x586f('0x1f')](function(_0x3ee9fb){if(_0x3ee9fb){return _0x3ee9fb[_0x586f('0x84')]();}return null;})[_0x586f('0x1f')](respondWithResult(_0x26d4e4,null))[_0x586f('0x56')](handleError(_0x26d4e4,null));};exports[_0x586f('0x85')]=function(_0x472a41,_0x1c66f2,_0x4d2ea6){if(_0x472a41['body']['id']){delete _0x472a41[_0x586f('0x5b')]['id'];}return db['MailAccount'][_0x586f('0x5a')]({'where':{'id':_0x472a41[_0x586f('0x57')]['id']}})[_0x586f('0x1f')](handleEntityNotFound(_0x1c66f2,null))[_0x586f('0x1f')](function(_0x36b739){if(_0x36b739){_0x472a41[_0x586f('0x5b')][_0x586f('0x62')]=_0x36b739['id'];return db[_0x586f('0x58')][_0x586f('0x5d')](_0x472a41[_0x586f('0x5b')]);}})['then'](respondWithResult(_0x1c66f2,null))[_0x586f('0x56')](handleError(_0x1c66f2,null));};exports[_0x586f('0x86')]=function(_0x995809,_0x31acd5,_0x4aa802){return db[_0x586f('0x43')][_0x586f('0x5e')]({'where':{'id':_0x995809[_0x586f('0x57')]['id']}})['then'](handleEntityNotFound(_0x31acd5,null))['then'](function(_0x4cf40e){if(_0x4cf40e){return _0x4cf40e[_0x586f('0x87')](null);}return null;})['then'](respondWithStatusCode(_0x31acd5,null))[_0x586f('0x56')](handleError(_0x31acd5,null));};exports[_0x586f('0x88')]=function(_0x2c7b79,_0x253945,_0x53c2bb){return db[_0x586f('0x89')][_0x586f('0x5a')]({'where':{'id':_0x2c7b79[_0x586f('0x57')]['id']}})[_0x586f('0x1f')](handleEntityNotFound(_0x253945,null))[_0x586f('0x1f')](function(_0x2b1543){if(_0x2b1543){return _0x2b1543[_0x586f('0x88')](_0x2c7b79[_0x586f('0x5b')][_0x586f('0x66')],_['omit'](_0x2c7b79['body'],[_0x586f('0x66'),'id'])||{});}})[_0x586f('0x1f')](respondWithResult(_0x253945,null))['catch'](handleError(_0x253945,null));};exports[_0x586f('0x8a')]=function(_0x284e75,_0x40de79,_0x4570e3){var _0x194245={'raw':![],'where':{}};var _0x461c39={};var _0x3f21e4={'count':0x0,'rows':[]};return db[_0x586f('0x43')][_0x586f('0x5e')]({'where':{'id':_0x284e75[_0x586f('0x57')]['id']}})['then'](handleEntityNotFound(_0x40de79,null))[_0x586f('0x1f')](function(_0x2a16b3){if(_0x2a16b3){_0x461c39[_0x586f('0x48')]=_[_0x586f('0x5f')](db[_0x586f('0x89')][_0x586f('0x44')]);_0x461c39[_0x586f('0x49')]=_['keys'](_0x284e75[_0x586f('0x49')]);_0x461c39[_0x586f('0x4a')]=_[_0x586f('0x4b')](_0x461c39[_0x586f('0x48')],_0x461c39[_0x586f('0x49')]);_0x194245[_0x586f('0x4d')]=_[_0x586f('0x4b')](_0x461c39['model'],qs[_0x586f('0x4c')](_0x284e75[_0x586f('0x49')][_0x586f('0x4c')]));_0x194245[_0x586f('0x4d')]=_0x194245[_0x586f('0x4d')]['length']?_0x194245[_0x586f('0x4d')]:_0x461c39[_0x586f('0x48')];if(!_0x284e75[_0x586f('0x49')][_0x586f('0x69')](_0x586f('0x4f'))){_0x194245['limit']=qs['limit'](_0x284e75[_0x586f('0x49')][_0x586f('0x2e')]);_0x194245['offset']=qs[_0x586f('0x2d')](_0x284e75[_0x586f('0x49')][_0x586f('0x2d')]);}_0x194245[_0x586f('0x61')]=qs[_0x586f('0x50')](_0x284e75[_0x586f('0x49')]['sort']);_0x194245[_0x586f('0x51')]=qs['filters'](_[_0x586f('0x6a')](_0x284e75[_0x586f('0x49')],_0x461c39[_0x586f('0x4a')]));_0x194245['where']['MailAccountId']=_0x2a16b3['id'];if(_0x284e75[_0x586f('0x49')][_0x586f('0x52')]){_0x194245[_0x586f('0x51')]=_[_0x586f('0x53')](_0x194245[_0x586f('0x51')],{'$or':_['map'](_0x194245['attributes'],function(_0x47f1b6){var _0x7b6acc={};_0x7b6acc[_0x47f1b6]={'$like':'%'+_0x284e75['query'][_0x586f('0x52')]+'%'};return _0x7b6acc;})});}_0x194245=_[_0x586f('0x53')]({},_0x194245,_0x284e75[_0x586f('0x54')]);return db['MailInteraction'][_0x586f('0x30')]({'where':_0x194245[_0x586f('0x51')]})[_0x586f('0x1f')](function(_0xe87eb8){_0x3f21e4[_0x586f('0x30')]=_0xe87eb8;if(_0x284e75['query'][_0x586f('0x63')]){_0x194245['include']=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x586f('0x8b')],'as':'Owner','attributes':[_0x586f('0x3b'),'fullname',_0x586f('0x8c')],'required':![]},{'model':db[_0x586f('0x8d')],'as':_0x586f('0x8e'),'attributes':['id',_0x586f('0x3b'),_0x586f('0x8f')],'where':_0x284e75['query'][_0x586f('0x90')]?{'id':_0x284e75[_0x586f('0x49')][_0x586f('0x90')]}:undefined,'required':_0x284e75[_0x586f('0x49')][_0x586f('0x90')]?!![]:![]}];}return db[_0x586f('0x89')][_0x586f('0x6b')](_0x194245);})[_0x586f('0x1f')](function(_0x1ac7a4){_0x3f21e4['rows']=_0x1ac7a4;return _0x3f21e4;});}})['then'](respondWithFilteredResult(_0x40de79,_0x194245))[_0x586f('0x56')](handleError(_0x40de79,null));};exports['addApplications']=function(_0x5f1b5f,_0x1d1143,_0x14c58b){return db['MailAccount']['findOne']({'where':{'id':_0x5f1b5f['params']['id']}})['then'](handleEntityNotFound(_0x1d1143,null))['then'](function(_0x1f313f){if(_0x1f313f){return db[_0x586f('0x91')][_0x586f('0x92')](function(_0x24d2fb){return db['MailApplication'][_0x586f('0x36')]({'where':{'MailAccountId':_0x5f1b5f[_0x586f('0x57')]['id']},'transaction':_0x24d2fb})['then'](function(_0x86cf0d){var _0x2095e0=_[_0x586f('0x42')](_0x5f1b5f[_0x586f('0x5b')],function(_0xc0ed17){_0xc0ed17[_0x586f('0x62')]=_0x5f1b5f[_0x586f('0x57')]['id'];return _0xc0ed17;});return db[_0x586f('0x93')][_0x586f('0x94')](_0x2095e0,{'transaction':_0x24d2fb});});})[_0x586f('0x1f')](function(){return db['MailApplication'][_0x586f('0x95')]({'where':{'MailAccountId':_0x5f1b5f[_0x586f('0x57')]['id']},'order':_0x586f('0x96')});});}})['then'](respondWithResult(_0x1d1143,null))[_0x586f('0x56')](handleError(_0x1d1143,null));};exports[_0x586f('0x97')]=function(_0x2199be,_0x177283,_0x50484a){var _0xa28dea={};var _0x297e0d={};var _0xceb4c2;var _0x485b2f;return db['MailAccount'][_0x586f('0x5e')]({'where':{'id':_0x2199be[_0x586f('0x57')]['id']}})[_0x586f('0x1f')](handleEntityNotFound(_0x177283,null))[_0x586f('0x1f')](function(_0x3cef2a){if(_0x3cef2a){_0xceb4c2=_0x3cef2a;_0x297e0d[_0x586f('0x48')]=_[_0x586f('0x5f')](db[_0x586f('0x93')][_0x586f('0x44')]);_0x297e0d[_0x586f('0x49')]=_[_0x586f('0x5f')](_0x2199be[_0x586f('0x49')]);_0x297e0d['filters']=_['intersection'](_0x297e0d[_0x586f('0x48')],_0x297e0d['query']);_0xa28dea[_0x586f('0x4d')]=_[_0x586f('0x4b')](_0x297e0d[_0x586f('0x48')],qs['fields'](_0x2199be[_0x586f('0x49')][_0x586f('0x4c')]));_0xa28dea[_0x586f('0x4d')]=_0xa28dea[_0x586f('0x4d')][_0x586f('0x4e')]?_0xa28dea['attributes']:_0x297e0d['model'];_0xa28dea[_0x586f('0x61')]=qs[_0x586f('0x50')](_0x2199be['query'][_0x586f('0x50')]);_0xa28dea[_0x586f('0x51')]=qs[_0x586f('0x4a')](_['pick'](_0x2199be['query'],_0x297e0d[_0x586f('0x4a')]));if(_0x2199be['query'][_0x586f('0x52')]){_0xa28dea['where']=_[_0x586f('0x53')](_0xa28dea[_0x586f('0x51')],{'$or':_['map'](_0xa28dea[_0x586f('0x4d')],function(_0x4644a0){var _0x4246e3={};_0x4246e3[_0x4644a0]={'$like':'%'+_0x2199be[_0x586f('0x49')][_0x586f('0x52')]+'%'};return _0x4246e3;})});}_0xa28dea=_[_0x586f('0x53')]({},_0xa28dea,_0x2199be[_0x586f('0x54')]);return _0xceb4c2['getApplications'](_0xa28dea);}})[_0x586f('0x1f')](function(_0x185ead){if(_0x185ead){_0x485b2f=_0x185ead[_0x586f('0x4e')];if(!_0x2199be[_0x586f('0x49')][_0x586f('0x69')](_0x586f('0x4f'))){_0xa28dea[_0x586f('0x2e')]=qs[_0x586f('0x2e')](_0x2199be['query'][_0x586f('0x2e')]);_0xa28dea[_0x586f('0x2d')]=qs[_0x586f('0x2d')](_0x2199be['query'][_0x586f('0x2d')]);}return _0xceb4c2[_0x586f('0x97')](_0xa28dea);}})['then'](function(_0x2949c4){if(_0x2949c4){return _0x2949c4?{'count':_0x485b2f,'rows':_0x2949c4}:null;}})['then'](respondWithResult(_0x177283,null))[_0x586f('0x56')](handleError(_0x177283,null));};exports['getMessages']=function(_0x3089f1,_0x122c6a,_0x45eb61){var _0x4ecf1b={'raw':!![],'where':{}};var _0x28ff8f={};var _0x4b46e6={'count':0x0,'rows':[]};return db[_0x586f('0x43')][_0x586f('0x5e')]({'where':{'id':_0x3089f1[_0x586f('0x57')]['id']}})[_0x586f('0x1f')](handleEntityNotFound(_0x122c6a,null))[_0x586f('0x1f')](function(_0x420390){if(_0x420390){_0x28ff8f[_0x586f('0x48')]=_[_0x586f('0x5f')](db[_0x586f('0x98')][_0x586f('0x44')]);_0x28ff8f[_0x586f('0x49')]=_[_0x586f('0x5f')](_0x3089f1[_0x586f('0x49')]);_0x28ff8f[_0x586f('0x4a')]=_[_0x586f('0x4b')](_0x28ff8f[_0x586f('0x48')],_0x28ff8f[_0x586f('0x49')]);_0x4ecf1b['attributes']=_[_0x586f('0x4b')](_0x28ff8f[_0x586f('0x48')],qs[_0x586f('0x4c')](_0x3089f1['query'][_0x586f('0x4c')]));_0x4ecf1b[_0x586f('0x4d')]=_0x4ecf1b[_0x586f('0x4d')]['length']?_0x4ecf1b['attributes']:_0x28ff8f[_0x586f('0x48')];if(!_0x3089f1[_0x586f('0x49')][_0x586f('0x69')]('nolimit')){_0x4ecf1b[_0x586f('0x2e')]=qs['limit'](_0x3089f1['query'][_0x586f('0x2e')]);_0x4ecf1b['offset']=qs['offset'](_0x3089f1['query'][_0x586f('0x2d')]);}_0x4ecf1b[_0x586f('0x61')]=qs[_0x586f('0x50')](_0x3089f1['query'][_0x586f('0x50')]);_0x4ecf1b[_0x586f('0x51')]=qs[_0x586f('0x4a')](_[_0x586f('0x6a')](_0x3089f1[_0x586f('0x49')],_0x28ff8f[_0x586f('0x4a')]));_0x4ecf1b['where']['MailAccountId']=_0x420390['id'];if(_0x3089f1['query'][_0x586f('0x52')]){_0x4ecf1b['where']=_['merge'](_0x4ecf1b[_0x586f('0x51')],{'$or':_[_0x586f('0x42')](_0x4ecf1b[_0x586f('0x4d')],function(_0x4d013d){var _0x3c3b6b={};_0x3c3b6b[_0x4d013d]={'$like':'%'+_0x3089f1[_0x586f('0x49')]['filter']+'%'};return _0x3c3b6b;})});}if(_0x3089f1[_0x586f('0x49')][_0x586f('0x99')]){var _0x45f990=_0x3089f1[_0x586f('0x49')][_0x586f('0x99')][_0x586f('0x9a')](',');var _0x3e4dd1={};_0x3e4dd1[_0x45f990[0x0]]={'$gte':moment(_0x45f990[0x1])[_0x586f('0x9b')](_0x586f('0x9c'))};_0x4ecf1b['where']=_[_0x586f('0x53')](_0x4ecf1b['where'],_0x3e4dd1);}_0x4ecf1b=_[_0x586f('0x53')]({},_0x4ecf1b,_0x3089f1[_0x586f('0x54')]);return db['MailMessage'][_0x586f('0x30')]({'where':_0x4ecf1b[_0x586f('0x51')]})[_0x586f('0x1f')](function(_0x36586d){_0x4b46e6[_0x586f('0x30')]=_0x36586d;if(_0x3089f1[_0x586f('0x49')]['includeAll']){_0x4ecf1b[_0x586f('0x55')]=[{'all':!![]}];}return db[_0x586f('0x98')][_0x586f('0x6b')](_0x4ecf1b);})[_0x586f('0x1f')](function(_0x527766){if(_0x3089f1[_0x586f('0x49')]['inlineCss']===_0x586f('0x9d')){for(var _0x4e914a=0x0;_0x4e914a<_0x527766[_0x586f('0x4e')];_0x4e914a++){_0x527766[_0x4e914a]['body']=juice(_0x527766[_0x4e914a][_0x586f('0x5b')]);}}_0x4b46e6['rows']=_0x527766;return _0x4b46e6;});}})[_0x586f('0x1f')](respondWithFilteredResult(_0x122c6a,_0x4ecf1b))['catch'](handleError(_0x122c6a,null));};exports['send']=function(_0x396dc7,_0x4bc0a5,_0x534b6d){var _0x5d3df9,_0x55b5d7={},_0x5de8bf;if(_0x396dc7[_0x586f('0x5b')]['to']){_0x5de8bf=_0x396dc7[_0x586f('0x5b')]['to'][_0x586f('0x9a')](',')[0x0];}return db[_0x586f('0x43')][_0x586f('0x5a')]({'where':{'id':_0x396dc7[_0x586f('0x57')]['id']},'include':[{'model':db[_0x586f('0x9e')],'as':_0x586f('0x9f'),'include':[{'model':db['CmContact'],'as':_0x586f('0xa0'),'where':{'email':_0x5de8bf},'limit':0x1,'order':[[_0x586f('0xa1'),_0x586f('0xa2')]]}]},{'model':db[_0x586f('0x58')],'as':_0x586f('0x59'),'raw':!![]}]})[_0x586f('0x1f')](handleEntityNotFound(_0x4bc0a5,null))[_0x586f('0x1f')](function(_0x5bb230){if(_0x5bb230){_0x5d3df9=_0x5bb230;if(_0x5bb230[_0x586f('0x59')]){if(_[_0x586f('0x71')](_0x396dc7[_0x586f('0x5b')][_0x586f('0xa3')])){_0x396dc7[_0x586f('0x5b')][_0x586f('0xa3')]=util['format'](_0x586f('0xa4'),_0x5bb230[_0x586f('0x3b')],_0x5bb230[_0x586f('0x6d')]||_0x5bb230['Smtp']['user']);}if(_0x396dc7['body']['attachments']&&_0x396dc7[_0x586f('0x5b')]['attachments'][_0x586f('0x4e')]){for(var _0x1f9ab8=0x0;_0x1f9ab8<_0x396dc7[_0x586f('0x5b')][_0x586f('0xa5')]['length'];_0x1f9ab8+=0x1){_0x396dc7['body'][_0x586f('0xa5')][_0x1f9ab8]={'filename':_0x396dc7[_0x586f('0x5b')][_0x586f('0xa5')][_0x1f9ab8]['name'],'path':path[_0x586f('0xa6')](config[_0x586f('0xa7')],'server/files/attachments',_0x396dc7[_0x586f('0x5b')][_0x586f('0xa5')][_0x1f9ab8][_0x586f('0xa8')])};}}var _0x86060e={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x5bb230[_0x586f('0x59')][_0x586f('0x7b')])){if(_0x5bb230[_0x586f('0x59')]['authentication']){_0x86060e[_0x586f('0xa9')]={'user':_0x5bb230[_0x586f('0x59')][_0x586f('0x74')],'pass':_0x5bb230['Smtp'][_0x586f('0x76')]};}_0x86060e[_0x586f('0x79')]=_0x5bb230[_0x586f('0x59')][_0x586f('0x79')];_0x86060e[_0x586f('0x7a')]=_0x5bb230[_0x586f('0x59')][_0x586f('0x7a')];_0x86060e[_0x586f('0xaa')]=_0x5bb230[_0x586f('0x59')]['secure'];}else{_0x86060e[_0x586f('0x7b')]=_0x5bb230[_0x586f('0x59')][_0x586f('0x7b')];_0x86060e[_0x586f('0xa9')]={'user':_0x5bb230[_0x586f('0x59')][_0x586f('0x74')],'pass':_0x5bb230[_0x586f('0x59')][_0x586f('0x76')]};}return respondWithRpcPromise(_0x586f('0xab'),_0x586f('0xac'),{'account':_0x86060e,'message':_0x396dc7['body']});}else{throw new Error(_0x586f('0xad'));}}})[_0x586f('0x1f')](function(_0x597b19){if(_0x597b19){_0x55b5d7=_0x597b19;if(_0x5d3df9[_0x586f('0x9f')]){if(_0x5d3df9[_0x586f('0x9f')][_0x586f('0xa0')][_0x586f('0x4e')]){return _0x5d3df9[_0x586f('0x9f')][_0x586f('0xa0')][0x0];}else{return db[_0x586f('0xae')][_0x586f('0x5d')](_[_0x586f('0x17')](_0x396dc7['body'],{'firstName':_0x396dc7['body']['to'],'email':_0x396dc7[_0x586f('0x5b')]['to'],'phone':_0x396dc7[_0x586f('0x5b')]['to'],'ListId':_0x5d3df9['ListId']}));}}else{throw new Error(_0x586f('0xad'));}}})[_0x586f('0x1f')](function(_0x47a5e3){if(_0x47a5e3){var _0x35eaea={'UserId':_0x396dc7[_0x586f('0x74')]['id'],'ContactId':_0x47a5e3['id'],'MailAccountId':_0x5d3df9['id'],'inReplyTo':_0x55b5d7['messageId'],'to':_0x396dc7[_0x586f('0x5b')][_0x586f('0xa3')],'cc':_0x396dc7[_0x586f('0x5b')]['cc'],'subject':_0x396dc7[_0x586f('0x5b')][_0x586f('0xaf')],'attach':_0x396dc7['body'][_0x586f('0xb0')],'firstMsgDirection':_0x586f('0xb1'),'lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0x586f('0xb1'),'Messages':[_['merge'](_0x396dc7['body'],{'messageId':_0x55b5d7[_0x586f('0xb2')],'sentAt':moment()[_0x586f('0x9b')](_0x586f('0x9c')),'read':!![],'MailAccountId':_0x5d3df9['id'],'UserId':_0x396dc7[_0x586f('0x74')]['id'],'ContactId':_0x47a5e3['id']})]};if(_0x396dc7[_0x586f('0x5b')][_0x586f('0xb3')]){_0x35eaea=_['merge'](_0x35eaea,_0x396dc7[_0x586f('0x5b')][_0x586f('0xb3')]);}return db['MailInteraction'][_0x586f('0x5d')](_0x35eaea,{'include':[{'model':db['MailMessage'],'as':'Messages'}]});}})[_0x586f('0x1f')](respondWithResult(_0x4bc0a5,null))[_0x586f('0x56')](handleError(_0x4bc0a5,null));};exports[_0x586f('0xb4')]=function(_0x34f89a,_0x43a365,_0x46e27d){return db['MailAccount'][_0x586f('0x5a')]({'where':{'id':_0x34f89a[_0x586f('0x57')]['id']},'include':[{'model':db[_0x586f('0x58')],'as':_0x586f('0x59'),'raw':!![]}]})[_0x586f('0x1f')](handleEntityNotFound(_0x43a365,null))['then'](function(_0x454595){if(_0x454595&&_0x454595['Smtp']){var _0x315d3f={'id':_0x454595['id'],'tls':{'rejectUnauthorized':![]}};if(_0x454595[_0x586f('0x59')][_0x586f('0x7b')]){_0x315d3f[_0x586f('0x7b')]=_0x454595[_0x586f('0x59')][_0x586f('0x7b')];}else{_0x315d3f[_0x586f('0x79')]=_0x454595[_0x586f('0x59')][_0x586f('0x79')];_0x315d3f[_0x586f('0x7a')]=_0x454595[_0x586f('0x59')]['port'];_0x315d3f['secure']=_0x454595[_0x586f('0x59')][_0x586f('0xaa')];}if(_0x454595[_0x586f('0x59')][_0x586f('0x78')]){_0x315d3f['auth']={'user':_0x454595[_0x586f('0x59')][_0x586f('0x74')],'pass':_0x454595[_0x586f('0x59')][_0x586f('0x76')]};}return respondWithRpcPromise(_0x586f('0xb5'),_0x586f('0xb4'),{'account':_0x315d3f});}})[_0x586f('0x1f')](respondWithResult(_0x43a365,null))[_0x586f('0x56')](handleError(_0x43a365,null));};exports[_0x586f('0x36')]=function(_0x49fcd5,_0x4f4494){return db[_0x586f('0x43')][_0x586f('0x5a')]({'where':{'id':_0x49fcd5['params']['id']}})[_0x586f('0x1f')](handleEntityNotFound(_0x4f4494,null))[_0x586f('0x1f')](function(_0x4b918e){if(_0x4b918e&&_0x4b918e[_0x586f('0x7b')]){throw new db['Sequelize'][(_0x586f('0xb6'))](_0x586f('0xb7'));}return _0x4b918e;})[_0x586f('0x1f')](removeEntity(_0x4f4494,null))[_0x586f('0x56')](handleError(_0x4f4494,null));};exports[_0x586f('0xb8')]=function(_0x2694e9,_0x152e67,_0x1cb70d){return db['MailAccount'][_0x586f('0x5a')]({'where':{'id':_0x2694e9[_0x586f('0x57')]['id']}})['then'](handleEntityNotFound(_0x152e67,null))[_0x586f('0x1f')](function(_0x15446e){if(_0x15446e){return _0x15446e[_0x586f('0xb8')](_0x2694e9[_0x586f('0x5b')][_0x586f('0x66')],_[_0x586f('0xb9')](_0x2694e9['body'],[_0x586f('0x66'),'id'])||{})[_0x586f('0xba')](function(_0x2c3c28){for(var _0x19a14f=0x0;_0x19a14f<_0x2694e9[_0x586f('0x5b')][_0x586f('0x66')][_0x586f('0x4e')];_0x19a14f+=0x1){socket['emit'](_0x586f('0xbb'),{'UserId':Number(_0x2694e9[_0x586f('0x5b')][_0x586f('0x66')][_0x19a14f]),'MailAccountId':Number(_0x2694e9[_0x586f('0x57')]['id'])});}return _0x2c3c28;});}})[_0x586f('0x1f')](respondWithResult(_0x152e67,null))['catch'](handleError(_0x152e67,null));};exports['removeAgents']=function(_0x59fc46,_0x154729,_0x155002){return db[_0x586f('0x43')]['find']({'where':{'id':_0x59fc46[_0x586f('0x57')]['id']}})[_0x586f('0x1f')](handleEntityNotFound(_0x154729,null))[_0x586f('0x1f')](function(_0x444e9f){if(_0x444e9f){return _0x444e9f[_0x586f('0xbc')](_0x59fc46['query'][_0x586f('0x66')])[_0x586f('0x1f')](function(){if(_['isArray'](_0x59fc46['query']['ids'])){for(var _0x4c0b18=0x0;_0x4c0b18<_0x59fc46[_0x586f('0x49')][_0x586f('0x66')][_0x586f('0x4e')];_0x4c0b18+=0x1){socket['emit'](_0x586f('0xbd'),{'UserId':Number(_0x59fc46[_0x586f('0x49')][_0x586f('0x66')][_0x4c0b18]),'MailAccountId':Number(_0x59fc46[_0x586f('0x57')]['id'])});}}else{socket[_0x586f('0xbe')]('userMailAccount:remove',{'UserId':Number(_0x59fc46[_0x586f('0x49')][_0x586f('0x66')]),'MailAccountId':Number(_0x59fc46[_0x586f('0x57')]['id'])});}});}})[_0x586f('0x1f')](respondWithStatusCode(_0x154729,null))['catch'](handleError(_0x154729,null));};exports[_0x586f('0xbf')]=function(_0x2fe0fa,_0x339804,_0x44a4a3){var _0x288e9d={};var _0x2c2d54={};var _0x10e5a4;var _0x2cffeb;return db['MailAccount'][_0x586f('0x5e')]({'where':{'id':_0x2fe0fa[_0x586f('0x57')]['id']}})['then'](handleEntityNotFound(_0x339804,null))['then'](function(_0x373290){if(_0x373290){_0x10e5a4=_0x373290;_0x2c2d54['model']=_[_0x586f('0x5f')](db[_0x586f('0x8b')][_0x586f('0x44')]);_0x2c2d54[_0x586f('0x49')]=_[_0x586f('0x5f')](_0x2fe0fa[_0x586f('0x49')]);_0x2c2d54[_0x586f('0x4a')]=_[_0x586f('0x4b')](_0x2c2d54[_0x586f('0x48')],_0x2c2d54[_0x586f('0x49')]);_0x288e9d[_0x586f('0x4d')]=_[_0x586f('0x4b')](_0x2c2d54['model'],qs[_0x586f('0x4c')](_0x2fe0fa[_0x586f('0x49')]['fields']));_0x288e9d['attributes']=_0x288e9d[_0x586f('0x4d')][_0x586f('0x4e')]?_0x288e9d['attributes']:_0x2c2d54[_0x586f('0x48')];_0x288e9d['order']=qs['sort'](_0x2fe0fa['query'][_0x586f('0x50')]);_0x288e9d[_0x586f('0x51')]=qs['filters'](_['pick'](_0x2fe0fa[_0x586f('0x49')],_0x2c2d54[_0x586f('0x4a')]));if(_0x2fe0fa[_0x586f('0x49')][_0x586f('0x52')]){_0x288e9d['where']=_['merge'](_0x288e9d[_0x586f('0x51')],{'$or':_[_0x586f('0x42')](_0x288e9d[_0x586f('0x4d')],function(_0x139456){var _0x562ee7={};_0x562ee7[_0x139456]={'$like':'%'+_0x2fe0fa['query'][_0x586f('0x52')]+'%'};return _0x562ee7;})});}_0x288e9d=_[_0x586f('0x53')]({},_0x288e9d,_0x2fe0fa['options']);return _0x10e5a4[_0x586f('0xbf')](_0x288e9d);}})[_0x586f('0x1f')](function(_0x2995e1){if(_0x2995e1){_0x2cffeb=_0x2995e1[_0x586f('0x4e')];if(!_0x2fe0fa['query'][_0x586f('0x69')](_0x586f('0x4f'))){_0x288e9d[_0x586f('0x2e')]=qs['limit'](_0x2fe0fa[_0x586f('0x49')]['limit']);_0x288e9d[_0x586f('0x2d')]=qs[_0x586f('0x2d')](_0x2fe0fa[_0x586f('0x49')][_0x586f('0x2d')]);}return _0x10e5a4[_0x586f('0xbf')](_0x288e9d);}})[_0x586f('0x1f')](function(_0x1ea0af){if(_0x1ea0af){return _0x1ea0af?{'count':_0x2cffeb,'rows':_0x1ea0af}:null;}})[_0x586f('0x1f')](respondWithResult(_0x339804,null))[_0x586f('0x56')](handleError(_0x339804,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 2e855d1..ce5b11f 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 _0xee3c=['events','../../mysqldb','MailAccount','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xee3c,0x14a));var _0xcee3=function(_0x1b2345,_0x5f5d56){_0x1b2345=_0x1b2345-0x0;var _0x27bcc6=_0xee3c[_0x1b2345];return _0x27bcc6;};'use strict';var EventEmitter=require(_0xcee3('0x0'));var MailAccount=require(_0xcee3('0x1'))['db'][_0xcee3('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xcee3('0x3')](0x0);var events={'afterCreate':_0xcee3('0x4'),'afterUpdate':_0xcee3('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4a7681){return function(_0x435892,_0x4cd398,_0x39d2a8){MailAccountEvents[_0xcee3('0x6')](_0x4a7681+':'+_0x435892['id'],_0x435892);MailAccountEvents[_0xcee3('0x6')](_0x4a7681,_0x435892);_0x39d2a8(null);};}for(var e in events){if(events[_0xcee3('0x7')](e)){var event=events[e];MailAccount[_0xcee3('0x8')](e,emitEvent(event));}}module[_0xcee3('0x9')]=MailAccountEvents; \ No newline at end of file +var _0xdbb9=['save','remove','emit','exports','../../mysqldb','MailAccount','setMaxListeners'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdbb9,0xf9));var _0x9dbb=function(_0x30e381,_0x104813){_0x30e381=_0x30e381-0x0;var _0x12a9a3=_0xdbb9[_0x30e381];return _0x12a9a3;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0x9dbb('0x0'))['db'][_0x9dbb('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x9dbb('0x2')](0x0);var events={'afterCreate':_0x9dbb('0x3'),'afterUpdate':'update','afterDestroy':_0x9dbb('0x4')};function emitEvent(_0x3a95f2){return function(_0x19ebd7,_0x3b4460,_0xb960a5){MailAccountEvents[_0x9dbb('0x5')](_0x3a95f2+':'+_0x19ebd7['id'],_0x19ebd7);MailAccountEvents['emit'](_0x3a95f2,_0x19ebd7);_0xb960a5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module[_0x9dbb('0x6')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index de60d00..0744280 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 _0x7dd5=['exports','define','mail_accounts','lodash','util','../../config/logger','moment','request-promise','path','rimraf','./mailAccount.attributes'];(function(_0x48472a,_0x1bc83e){var _0x4f0858=function(_0x1dac10){while(--_0x1dac10){_0x48472a['push'](_0x48472a['shift']());}};_0x4f0858(++_0x1bc83e);}(_0x7dd5,0x179));var _0x57dd=function(_0x1c5bb8,_0x5a14fd){_0x1c5bb8=_0x1c5bb8-0x0;var _0x167fe3=_0x7dd5[_0x1c5bb8];return _0x167fe3;};'use strict';var _=require(_0x57dd('0x0'));var util=require(_0x57dd('0x1'));var logger=require(_0x57dd('0x2'))('api');var moment=require(_0x57dd('0x3'));var BPromise=require('bluebird');var rp=require(_0x57dd('0x4'));var fs=require('fs');var path=require(_0x57dd('0x5'));var rimraf=require(_0x57dd('0x6'));var config=require('../../config/environment');var attributes=require(_0x57dd('0x7'));module[_0x57dd('0x8')]=function(_0x5855f5,_0x21fc41){return _0x5855f5[_0x57dd('0x9')]('MailAccount',attributes,{'tableName':_0x57dd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfec2=['moment','bluebird','path','rimraf','../../config/environment','./mailAccount.attributes','exports','util','api'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xfec2,0x97));var _0x2fec=function(_0x3121fa,_0x59c308){_0x3121fa=_0x3121fa-0x0;var _0x251d25=_0xfec2[_0x3121fa];return _0x251d25;};'use strict';var _=require('lodash');var util=require(_0x2fec('0x0'));var logger=require('../../config/logger')(_0x2fec('0x1'));var moment=require(_0x2fec('0x2'));var BPromise=require(_0x2fec('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2fec('0x4'));var rimraf=require(_0x2fec('0x5'));var config=require(_0x2fec('0x6'));var attributes=require(_0x2fec('0x7'));module[_0x2fec('0x8')]=function(_0x494ea3,_0x50c50f){return _0x494ea3['define']('MailAccount',attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 922c800..dbe4eae 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 _0x7bc8=['spread','YYYY-MM-DD\x20HH:mm:ss','interaction','get','created','MailMessage','attachments','originTo','originCc','ChatWebsiteId','originChannel','ChatOfflineMessageId','Attachment','Attachments','UserId','User','name','agent','waitForTheAssignedAgent','startRouting','Start','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./mailAccount.socket','register','request','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','options','raw','attributes','limit','include','map','model','GetMailAccount','MailAccount','find','where','ShowMailAccount','catch','NotifyMailAccount','body','mail','difference','CmContact','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','Contacts','DESC','MailApplication','Applications','MailServerOut','then','applications','list','orderBy','asc','push','close','autoclose','*,*,*,*','length','contact','generate','messageId','subject','attach','format','MailInteraction','Messages','inReplyTo','create'];(function(_0x32e079,_0x4ce862){var _0x15a582=function(_0x5e64ed){while(--_0x5e64ed){_0x32e079['push'](_0x32e079['shift']());}};_0x15a582(++_0x4ce862);}(_0x7bc8,0x7d));var _0x87bc=function(_0x5b78fe,_0x44542c){_0x5b78fe=_0x5b78fe-0x0;var _0x24ac3c=_0x7bc8[_0x5b78fe];return _0x24ac3c;};'use strict';var _=require('lodash');var util=require(_0x87bc('0x0'));var moment=require(_0x87bc('0x1'));var BPromise=require(_0x87bc('0x2'));var rs=require(_0x87bc('0x3'));var fs=require('fs');var Redis=require(_0x87bc('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x87bc('0x5'));var logger=require(_0x87bc('0x6'))(_0x87bc('0x7'));var config=require(_0x87bc('0x8'));var jayson=require(_0x87bc('0x9'));var client=jayson[_0x87bc('0xa')][_0x87bc('0xb')]({'port':0x232c});config[_0x87bc('0xc')]=_[_0x87bc('0xd')](config['redis'],{'host':_0x87bc('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x87bc('0xc')]));require(_0x87bc('0xf'))[_0x87bc('0x10')](socket);function respondWithRpcPromise(_0x513aa4,_0x4cdcaf,_0x638663){return new BPromise(function(_0x1f55b9,_0x3d037a){return client[_0x87bc('0x11')](_0x513aa4,_0x638663)['then'](function(_0x4daf80){logger[_0x87bc('0x12')](_0x87bc('0x13'),_0x4cdcaf,_0x87bc('0x14'));logger[_0x87bc('0x15')](_0x87bc('0x16'),_0x4cdcaf,_0x87bc('0x14'),JSON[_0x87bc('0x17')](_0x4daf80));if(_0x4daf80[_0x87bc('0x18')]){if(_0x4daf80[_0x87bc('0x18')][_0x87bc('0x19')]===0x1f4){logger['error'](_0x87bc('0x13'),_0x4cdcaf,_0x4daf80[_0x87bc('0x18')][_0x87bc('0x1a')]);return _0x3d037a(_0x4daf80['error'][_0x87bc('0x1a')]);}logger[_0x87bc('0x18')](_0x87bc('0x13'),_0x4cdcaf,_0x4daf80[_0x87bc('0x18')][_0x87bc('0x1a')]);return _0x1f55b9(_0x4daf80[_0x87bc('0x18')][_0x87bc('0x1a')]);}else{logger[_0x87bc('0x12')](_0x87bc('0x13'),_0x4cdcaf,_0x87bc('0x14'));_0x1f55b9(_0x4daf80['result']['message']);}})['catch'](function(_0x5af837){logger['error'](_0x87bc('0x13'),_0x4cdcaf,_0x5af837);_0x3d037a(_0x5af837);});});}exports['GetMailAccount']=function(_0x4f5f1c){var _0x48c012=this;return new Promise(function(_0x3690ca,_0x24f6e2){return db['MailAccount']['findAll']({'raw':_0x4f5f1c[_0x87bc('0x1b')]?_0x4f5f1c[_0x87bc('0x1b')][_0x87bc('0x1c')]===undefined?!![]:![]:!![],'where':_0x4f5f1c['options']?_0x4f5f1c['options']['where']||null:null,'attributes':_0x4f5f1c[_0x87bc('0x1b')]?_0x4f5f1c[_0x87bc('0x1b')][_0x87bc('0x1d')]||null:null,'limit':_0x4f5f1c['options']?_0x4f5f1c[_0x87bc('0x1b')][_0x87bc('0x1e')]||null:null,'include':_0x4f5f1c[_0x87bc('0x1b')]?_0x4f5f1c[_0x87bc('0x1b')][_0x87bc('0x1f')]?_[_0x87bc('0x20')](_0x4f5f1c[_0x87bc('0x1b')]['include'],function(_0x3dd23f){return{'model':db[_0x3dd23f[_0x87bc('0x21')]],'as':_0x3dd23f['as'],'attributes':_0x3dd23f[_0x87bc('0x1d')],'include':_0x3dd23f['include']?_['map'](_0x3dd23f[_0x87bc('0x1f')],function(_0x154b45){return{'model':db[_0x154b45['model']],'as':_0x154b45['as'],'attributes':_0x154b45[_0x87bc('0x1d')],'include':_0x154b45[_0x87bc('0x1f')]?_['map'](_0x154b45['include'],function(_0x1f1e2a){return{'model':db[_0x1f1e2a[_0x87bc('0x21')]],'as':_0x1f1e2a['as'],'attributes':_0x1f1e2a[_0x87bc('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2a90f3){logger[_0x87bc('0x12')](_0x87bc('0x22'),_0x4f5f1c);logger[_0x87bc('0x15')](_0x87bc('0x22'),_0x4f5f1c,JSON[_0x87bc('0x17')](_0x2a90f3));_0x3690ca(_0x2a90f3);})['catch'](function(_0x2780ff){logger['error']('GetMailAccount',_0x2780ff[_0x87bc('0x1a')],_0x4f5f1c);_0x24f6e2(_0x48c012[_0x87bc('0x18')](0x1f4,_0x2780ff[_0x87bc('0x1a')]));});});};exports['ShowMailAccount']=function(_0x14b49e){var _0x40d5bd=this;return new Promise(function(_0x31fee1,_0x34aa74){return db[_0x87bc('0x23')][_0x87bc('0x24')]({'raw':_0x14b49e['options']?_0x14b49e[_0x87bc('0x1b')][_0x87bc('0x1c')]===undefined?!![]:![]:!![],'where':_0x14b49e['options']?_0x14b49e['options'][_0x87bc('0x25')]||null:null,'attributes':_0x14b49e[_0x87bc('0x1b')]?_0x14b49e[_0x87bc('0x1b')][_0x87bc('0x1d')]||null:null,'include':_0x14b49e[_0x87bc('0x1b')]?_0x14b49e[_0x87bc('0x1b')][_0x87bc('0x1f')]?_[_0x87bc('0x20')](_0x14b49e[_0x87bc('0x1b')][_0x87bc('0x1f')],function(_0x3f4ba0){return{'model':db[_0x3f4ba0[_0x87bc('0x21')]],'as':_0x3f4ba0['as'],'attributes':_0x3f4ba0['attributes'],'include':_0x3f4ba0[_0x87bc('0x1f')]?_['map'](_0x3f4ba0[_0x87bc('0x1f')],function(_0x3b7b3c){return{'model':db[_0x3b7b3c[_0x87bc('0x21')]],'as':_0x3b7b3c['as'],'attributes':_0x3b7b3c[_0x87bc('0x1d')],'include':_0x3b7b3c[_0x87bc('0x1f')]?_['map'](_0x3b7b3c['include'],function(_0x33c1dd){return{'model':db[_0x33c1dd[_0x87bc('0x21')]],'as':_0x33c1dd['as'],'attributes':_0x33c1dd[_0x87bc('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x44afba){logger['info']('ShowMailAccount',_0x14b49e);logger['debug'](_0x87bc('0x26'),_0x14b49e,JSON[_0x87bc('0x17')](_0x44afba));_0x31fee1(_0x44afba);})[_0x87bc('0x27')](function(_0x3d9849){logger[_0x87bc('0x18')](_0x87bc('0x26'),_0x3d9849['message'],_0x14b49e);_0x34aa74(_0x40d5bd[_0x87bc('0x18')](0x1f4,_0x3d9849['message']));});});};exports[_0x87bc('0x28')]=function(_0x38b333){var _0x56340c=this;return new Promise(function(_0x36c6ff,_0x2a0238){var _0x4a86ef={'body':_0x38b333[_0x87bc('0x29')],'channel':_0x87bc('0x2a')};var _0x10d516=_[_0x87bc('0x2b')](_['keys'](db[_0x87bc('0x2c')]['rawAttributes']),[_0x87bc('0x2d'),_0x87bc('0x2e'),_0x87bc('0x2f'),_0x87bc('0x30')]);var _0x16dc7e=![];if(_0x38b333[_0x87bc('0x29')]['id']){delete _0x38b333[_0x87bc('0x29')]['id'];}if(_[_0x87bc('0x31')](_0x38b333[_0x87bc('0x29')][_0x87bc('0x32')])){return _0x2a0238(_0x56340c[_0x87bc('0x18')](0x1f4,_0x87bc('0x33')));}if(_['isNil'](_0x38b333['body'][_0x87bc('0x29')])||_0x38b333[_0x87bc('0x29')][_0x87bc('0x29')]===''){return _0x2a0238(_0x56340c[_0x87bc('0x18')](0x1f4,_0x87bc('0x34')));}if(_[_0x87bc('0x31')](_0x38b333[_0x87bc('0x29')][_0x87bc('0x35')])){return _0x2a0238(_0x56340c[_0x87bc('0x18')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x10d516));}if(!_['includes'](_0x10d516,_0x38b333[_0x87bc('0x29')][_0x87bc('0x35')])){return _0x2a0238(_0x56340c[_0x87bc('0x18')](0x1f4,_0x87bc('0x36')+_0x10d516));}var _0x406ae8={};_0x406ae8[_0x38b333[_0x87bc('0x29')][_0x87bc('0x35')]]=_0x38b333[_0x87bc('0x29')][_0x87bc('0x32')];return db[_0x87bc('0x23')][_0x87bc('0x24')]({'where':{'id':_0x38b333[_0x87bc('0x37')]['id']},'include':[{'model':db[_0x87bc('0x38')],'as':_0x87bc('0x39'),'include':[{'model':db[_0x87bc('0x2c')],'as':_0x87bc('0x3a'),'where':_0x406ae8,'limit':0x1,'order':[[_0x87bc('0x2e'),_0x87bc('0x3b')]]}]},{'model':db[_0x87bc('0x3c')],'as':_0x87bc('0x3d')},{'model':db[_0x87bc('0x3e')],'as':'Smtp'}]})[_0x87bc('0x3f')](function(_0x2f1120){if(_0x2f1120&&_0x2f1120[_0x87bc('0x39')]){var _0x6e46b4=_0x2f1120['get']({'plain':!![]});_0x4a86ef[_0x87bc('0x37')]=_['omit'](_0x6e46b4,[_0x87bc('0x3d'),'List']);_0x4a86ef[_0x87bc('0x40')]=_0x6e46b4[_0x87bc('0x3d')];_0x4a86ef[_0x87bc('0x41')]=_0x6e46b4[_0x87bc('0x39')];_0x4a86ef[_0x87bc('0x40')]=_[_0x87bc('0x42')](_0x4a86ef[_0x87bc('0x40')],['priority'],[_0x87bc('0x43')]);if(_0x4a86ef[_0x87bc('0x37')]&&_0x4a86ef[_0x87bc('0x37')]['autoclose']){_0x4a86ef[_0x87bc('0x40')][_0x87bc('0x44')]({'id':0x0,'priority':_0x4a86ef[_0x87bc('0x40')]['length']+0x1,'app':_0x87bc('0x45'),'appdata':_0x87bc('0x46'),'interval':_0x87bc('0x47')});}if(_0x4a86ef['account'][_0x87bc('0x3d')]){delete _0x4a86ef['account'][_0x87bc('0x3d')];}if(_0x4a86ef[_0x87bc('0x37')][_0x87bc('0x39')]){delete _0x4a86ef[_0x87bc('0x37')][_0x87bc('0x39')];}if(_0x6e46b4[_0x87bc('0x39')][_0x87bc('0x3a')][_0x87bc('0x48')]){return _0x6e46b4['List']['Contacts'][0x0];}var _0x1e0c71=_[_0x87bc('0xd')](_0x38b333[_0x87bc('0x29')],{'firstName':_0x38b333['body'][_0x87bc('0x32')],'ListId':_0x6e46b4[_0x87bc('0x30')]});_0x1e0c71[_0x38b333['body'][_0x87bc('0x35')]]=_0x38b333['body'][_0x87bc('0x32')];return db['CmContact']['create'](_0x1e0c71);}else{throw new Error('List\x20not\x20found');}})[_0x87bc('0x3f')](function(_0x46e90f){_0x4a86ef[_0x87bc('0x49')]=_0x46e90f;if(_0x46e90f){if(!_0x38b333[_0x87bc('0x29')]['message']['messageId']){_0x38b333[_0x87bc('0x29')][_0x87bc('0x1a')]['messageId']=rs[_0x87bc('0x4a')]()+'\x20'+_0x38b333[_0x87bc('0x29')]['message'][_0x87bc('0x32')];}var _0x349a7d={'ContactId':_0x46e90f['id'],'MailAccountId':_0x38b333[_0x87bc('0x37')]['id'],'inReplyTo':_0x38b333['body'][_0x87bc('0x1a')][_0x87bc('0x4b')],'to':_0x38b333['body'][_0x87bc('0x1a')][_0x87bc('0x32')],'cc':_0x38b333[_0x87bc('0x29')]['message']['cc'],'subject':_0x38b333[_0x87bc('0x29')]['message'][_0x87bc('0x4c')],'attach':_0x38b333[_0x87bc('0x29')]['message'][_0x87bc('0x4d')],'lastMsgAt':moment()[_0x87bc('0x4e')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0x87bc('0x4f')][_0x87bc('0x24')]({'where':{'closed':![],'MailAccountId':_0x38b333['account']['id']},'include':[{'model':db['MailMessage'],'as':_0x87bc('0x50'),'attributes':[_0x87bc('0x4b')],'where':{'messageId':_0x38b333[_0x87bc('0x29')][_0x87bc('0x1a')][_0x87bc('0x51')]}}]})[_0x87bc('0x3f')](function(_0x3ad651){if(_0x3ad651){return[_0x3ad651,![]];}return db[_0x87bc('0x4f')][_0x87bc('0x52')](_0x349a7d)[_0x87bc('0x3f')](function(_0x25ac79){return[_0x25ac79,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x87bc('0x53')](function(_0x579368,_0x154d8a){if(_0x579368){_0x16dc7e=_0x154d8a;if(!_0x154d8a){return _0x579368['update']({'inReplyTo':_0x38b333[_0x87bc('0x29')][_0x87bc('0x1a')][_0x87bc('0x4b')],'to':_0x38b333[_0x87bc('0x29')][_0x87bc('0x1a')][_0x87bc('0x32')],'cc':_0x38b333['body'][_0x87bc('0x1a')]['cc'],'subject':_0x38b333[_0x87bc('0x29')][_0x87bc('0x1a')][_0x87bc('0x4c')],'attach':_0x579368['attach']?_0x579368[_0x87bc('0x4d')]:_0x38b333[_0x87bc('0x29')]['message']['attach'],'substatus':null,'substatusAt':moment()[_0x87bc('0x4e')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()[_0x87bc('0x4e')](_0x87bc('0x54')),'lastMsgDirection':'in'});}else{return _0x579368;}}})[_0x87bc('0x3f')](function(_0x41de0b){_0x4a86ef[_0x87bc('0x55')]=_0x41de0b[_0x87bc('0x56')]({'plain':!![]});_0x4a86ef['interaction'][_0x87bc('0x57')]=_0x16dc7e;return db[_0x87bc('0x58')][_0x87bc('0x52')]({'body':_0x38b333['body'][_0x87bc('0x29')],'MailAccountId':_0x38b333[_0x87bc('0x37')]['id'],'MailInteractionId':_0x41de0b['id'],'direction':'in','ContactId':_0x4a86ef[_0x87bc('0x49')]['id'],'messageId':_0x38b333[_0x87bc('0x29')]['message'][_0x87bc('0x4b')],'from':_0x38b333[_0x87bc('0x29')]['message'][_0x87bc('0x32')],'to':_0x38b333[_0x87bc('0x29')][_0x87bc('0x1a')]['to'],'cc':_0x38b333[_0x87bc('0x29')][_0x87bc('0x1a')]['cc'],'subject':_0x38b333[_0x87bc('0x29')][_0x87bc('0x1a')]['subject'],'attach':_0x38b333[_0x87bc('0x29')][_0x87bc('0x1a')][_0x87bc('0x4d')],'Attachments':_0x38b333['body'][_0x87bc('0x1a')][_0x87bc('0x59')],'originTo':_0x38b333['body'][_0x87bc('0x1a')][_0x87bc('0x5a')],'originCc':_0x38b333['body']['message'][_0x87bc('0x5b')],'bcc':_0x38b333[_0x87bc('0x29')][_0x87bc('0x1a')]['bcc'],'ChatWebsiteId':_0x38b333['body']['message'][_0x87bc('0x5c')]||null,'originChannel':_0x38b333[_0x87bc('0x29')]['message'][_0x87bc('0x5d')]||'Email','ChatOfflineMessageId':_0x38b333[_0x87bc('0x29')][_0x87bc('0x1a')][_0x87bc('0x5e')]||null},{'include':[{'model':db[_0x87bc('0x5f')],'as':_0x87bc('0x60')}]});})[_0x87bc('0x3f')](function(_0x27453f){_0x4a86ef['message']=_0x27453f;if(_0x4a86ef[_0x87bc('0x55')][_0x87bc('0x61')]){return db[_0x87bc('0x62')][_0x87bc('0x24')]({'attributes':['id',_0x87bc('0x63')],'where':{'id':_0x4a86ef[_0x87bc('0x55')][_0x87bc('0x61')]}})['then'](function(_0x3247a2){if(_0x3247a2){_0x4a86ef['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0x87bc('0x64'),'appdata':_0x3247a2['name']+','+(_0x4a86ef[_0x87bc('0x37')][_0x87bc('0x65')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0x87bc('0x66'),_0x4a86ef);});}return respondWithRpcPromise(_0x87bc('0x67'),'startRouting',_0x4a86ef);})[_0x87bc('0x3f')](function(_0x2a865e){_0x36c6ff(_0x2a865e);})[_0x87bc('0x27')](function(_0x593ea6){_0x2a0238(_0x56340c[_0x87bc('0x18')](0x1f4,_0x593ea6[_0x87bc('0x1a')]));});});}; \ No newline at end of file +var _0xb05b=['options','raw','where','attributes','limit','include','model','GetMailAccount','debug','ShowMailAccount','MailAccount','find','map','NotifyMailAccount','body','difference','keys','CmContact','rawAttributes','createdAt','updatedAt','ListId','isNil','from','from\x20is\x20mandatory','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','account','CmList','List','MailApplication','Applications','MailServerOut','Smtp','get','list','orderBy','applications','priority','autoclose','push','length','close','Contacts','create','List\x20not\x20found','contact','messageId','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','Messages','inReplyTo','MailInteraction','interaction','created','originTo','originCc','bcc','originChannel','Email','ChatOfflineMessageId','Attachment','Attachments','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./mailAccount.socket','register','request','then','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','findAll'];(function(_0x4ade26,_0x4f6553){var _0x5e9fe6=function(_0x1d007a){while(--_0x1d007a){_0x4ade26['push'](_0x4ade26['shift']());}};_0x5e9fe6(++_0x4f6553);}(_0xb05b,0x1f1));var _0xbb05=function(_0x265f6d,_0x2a38a5){_0x265f6d=_0x265f6d-0x0;var _0x317995=_0xb05b[_0x265f6d];return _0x317995;};'use strict';var _=require(_0xbb05('0x0'));var util=require('util');var moment=require(_0xbb05('0x1'));var BPromise=require('bluebird');var rs=require(_0xbb05('0x2'));var fs=require('fs');var Redis=require(_0xbb05('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb05('0x4'));var logger=require(_0xbb05('0x5'))(_0xbb05('0x6'));var config=require(_0xbb05('0x7'));var jayson=require(_0xbb05('0x8'));var client=jayson[_0xbb05('0x9')][_0xbb05('0xa')]({'port':0x232c});config[_0xbb05('0xb')]=_[_0xbb05('0xc')](config[_0xbb05('0xb')],{'host':_0xbb05('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbb05('0xb')]));require(_0xbb05('0xe'))[_0xbb05('0xf')](socket);function respondWithRpcPromise(_0x33395f,_0x34800d,_0x3a5322){return new BPromise(function(_0x58216d,_0xd5f5ee){return client[_0xbb05('0x10')](_0x33395f,_0x3a5322)[_0xbb05('0x11')](function(_0x5dddc7){logger['info'](_0xbb05('0x12'),_0x34800d,_0xbb05('0x13'));logger['debug'](_0xbb05('0x14'),_0x34800d,_0xbb05('0x13'),JSON[_0xbb05('0x15')](_0x5dddc7));if(_0x5dddc7[_0xbb05('0x16')]){if(_0x5dddc7['error'][_0xbb05('0x17')]===0x1f4){logger[_0xbb05('0x16')](_0xbb05('0x12'),_0x34800d,_0x5dddc7['error'][_0xbb05('0x18')]);return _0xd5f5ee(_0x5dddc7[_0xbb05('0x16')][_0xbb05('0x18')]);}logger[_0xbb05('0x16')](_0xbb05('0x12'),_0x34800d,_0x5dddc7[_0xbb05('0x16')][_0xbb05('0x18')]);return _0x58216d(_0x5dddc7[_0xbb05('0x16')][_0xbb05('0x18')]);}else{logger[_0xbb05('0x19')](_0xbb05('0x12'),_0x34800d,_0xbb05('0x13'));_0x58216d(_0x5dddc7['result'][_0xbb05('0x18')]);}})[_0xbb05('0x1a')](function(_0x164e32){logger[_0xbb05('0x16')]('MailAccount,\x20%s,\x20%s',_0x34800d,_0x164e32);_0xd5f5ee(_0x164e32);});});}exports['GetMailAccount']=function(_0xc25529){var _0x58a715=this;return new Promise(function(_0x2c405d,_0x40d973){return db['MailAccount'][_0xbb05('0x1b')]({'raw':_0xc25529[_0xbb05('0x1c')]?_0xc25529[_0xbb05('0x1c')][_0xbb05('0x1d')]===undefined?!![]:![]:!![],'where':_0xc25529[_0xbb05('0x1c')]?_0xc25529[_0xbb05('0x1c')][_0xbb05('0x1e')]||null:null,'attributes':_0xc25529['options']?_0xc25529['options'][_0xbb05('0x1f')]||null:null,'limit':_0xc25529['options']?_0xc25529[_0xbb05('0x1c')][_0xbb05('0x20')]||null:null,'include':_0xc25529[_0xbb05('0x1c')]?_0xc25529['options'][_0xbb05('0x21')]?_['map'](_0xc25529[_0xbb05('0x1c')][_0xbb05('0x21')],function(_0x523b86){return{'model':db[_0x523b86[_0xbb05('0x22')]],'as':_0x523b86['as'],'attributes':_0x523b86[_0xbb05('0x1f')],'include':_0x523b86[_0xbb05('0x21')]?_['map'](_0x523b86['include'],function(_0x432596){return{'model':db[_0x432596[_0xbb05('0x22')]],'as':_0x432596['as'],'attributes':_0x432596[_0xbb05('0x1f')],'include':_0x432596['include']?_['map'](_0x432596['include'],function(_0x5e48c8){return{'model':db[_0x5e48c8[_0xbb05('0x22')]],'as':_0x5e48c8['as'],'attributes':_0x5e48c8[_0xbb05('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x19a2a4){logger[_0xbb05('0x19')](_0xbb05('0x23'),_0xc25529);logger[_0xbb05('0x24')](_0xbb05('0x23'),_0xc25529,JSON[_0xbb05('0x15')](_0x19a2a4));_0x2c405d(_0x19a2a4);})['catch'](function(_0x1b9a0b){logger[_0xbb05('0x16')]('GetMailAccount',_0x1b9a0b[_0xbb05('0x18')],_0xc25529);_0x40d973(_0x58a715[_0xbb05('0x16')](0x1f4,_0x1b9a0b[_0xbb05('0x18')]));});});};exports[_0xbb05('0x25')]=function(_0xca5a66){var _0x57bb00=this;return new Promise(function(_0x2fdf41,_0x31ab19){return db[_0xbb05('0x26')][_0xbb05('0x27')]({'raw':_0xca5a66[_0xbb05('0x1c')]?_0xca5a66[_0xbb05('0x1c')][_0xbb05('0x1d')]===undefined?!![]:![]:!![],'where':_0xca5a66['options']?_0xca5a66[_0xbb05('0x1c')][_0xbb05('0x1e')]||null:null,'attributes':_0xca5a66['options']?_0xca5a66[_0xbb05('0x1c')][_0xbb05('0x1f')]||null:null,'include':_0xca5a66['options']?_0xca5a66[_0xbb05('0x1c')]['include']?_[_0xbb05('0x28')](_0xca5a66['options'][_0xbb05('0x21')],function(_0x4b2bd6){return{'model':db[_0x4b2bd6[_0xbb05('0x22')]],'as':_0x4b2bd6['as'],'attributes':_0x4b2bd6[_0xbb05('0x1f')],'include':_0x4b2bd6[_0xbb05('0x21')]?_[_0xbb05('0x28')](_0x4b2bd6[_0xbb05('0x21')],function(_0x12d540){return{'model':db[_0x12d540['model']],'as':_0x12d540['as'],'attributes':_0x12d540['attributes'],'include':_0x12d540[_0xbb05('0x21')]?_['map'](_0x12d540[_0xbb05('0x21')],function(_0x4814dd){return{'model':db[_0x4814dd['model']],'as':_0x4814dd['as'],'attributes':_0x4814dd['attributes']};}):[]};}):[]};}):[]:[]})[_0xbb05('0x11')](function(_0x3da654){logger['info'](_0xbb05('0x25'),_0xca5a66);logger[_0xbb05('0x24')](_0xbb05('0x25'),_0xca5a66,JSON['stringify'](_0x3da654));_0x2fdf41(_0x3da654);})['catch'](function(_0x503f99){logger[_0xbb05('0x16')]('ShowMailAccount',_0x503f99[_0xbb05('0x18')],_0xca5a66);_0x31ab19(_0x57bb00[_0xbb05('0x16')](0x1f4,_0x503f99[_0xbb05('0x18')]));});});};exports[_0xbb05('0x29')]=function(_0x55c8a4){var _0x18a5c3=this;return new Promise(function(_0x347043,_0x67a727){var _0x591e46={'body':_0x55c8a4[_0xbb05('0x2a')],'channel':'mail'};var _0x377e1b=_[_0xbb05('0x2b')](_[_0xbb05('0x2c')](db[_0xbb05('0x2d')][_0xbb05('0x2e')]),[_0xbb05('0x2f'),_0xbb05('0x30'),'CompanyId',_0xbb05('0x31')]);var _0x842d51=![];if(_0x55c8a4[_0xbb05('0x2a')]['id']){delete _0x55c8a4[_0xbb05('0x2a')]['id'];}if(_[_0xbb05('0x32')](_0x55c8a4[_0xbb05('0x2a')][_0xbb05('0x33')])){return _0x67a727(_0x18a5c3[_0xbb05('0x16')](0x1f4,_0xbb05('0x34')));}if(_[_0xbb05('0x32')](_0x55c8a4['body']['body'])||_0x55c8a4[_0xbb05('0x2a')][_0xbb05('0x2a')]===''){return _0x67a727(_0x18a5c3[_0xbb05('0x16')](0x1f4,_0xbb05('0x35')));}if(_[_0xbb05('0x32')](_0x55c8a4['body'][_0xbb05('0x36')])){return _0x67a727(_0x18a5c3[_0xbb05('0x16')](0x1f4,_0xbb05('0x37')+_0x377e1b));}if(!_[_0xbb05('0x38')](_0x377e1b,_0x55c8a4[_0xbb05('0x2a')][_0xbb05('0x36')])){return _0x67a727(_0x18a5c3[_0xbb05('0x16')](0x1f4,_0xbb05('0x39')+_0x377e1b));}var _0x1d1708={};_0x1d1708[_0x55c8a4[_0xbb05('0x2a')][_0xbb05('0x36')]]=_0x55c8a4[_0xbb05('0x2a')]['from'];return db[_0xbb05('0x26')][_0xbb05('0x27')]({'where':{'id':_0x55c8a4[_0xbb05('0x3a')]['id']},'include':[{'model':db[_0xbb05('0x3b')],'as':_0xbb05('0x3c'),'include':[{'model':db[_0xbb05('0x2d')],'as':'Contacts','where':_0x1d1708,'limit':0x1,'order':[[_0xbb05('0x30'),'DESC']]}]},{'model':db[_0xbb05('0x3d')],'as':_0xbb05('0x3e')},{'model':db[_0xbb05('0x3f')],'as':_0xbb05('0x40')}]})[_0xbb05('0x11')](function(_0x3c8932){if(_0x3c8932&&_0x3c8932['List']){var _0x44ac50=_0x3c8932[_0xbb05('0x41')]({'plain':!![]});_0x591e46[_0xbb05('0x3a')]=_['omit'](_0x44ac50,[_0xbb05('0x3e'),_0xbb05('0x3c')]);_0x591e46['applications']=_0x44ac50['Applications'];_0x591e46[_0xbb05('0x42')]=_0x44ac50[_0xbb05('0x3c')];_0x591e46['applications']=_[_0xbb05('0x43')](_0x591e46[_0xbb05('0x44')],[_0xbb05('0x45')],['asc']);if(_0x591e46[_0xbb05('0x3a')]&&_0x591e46[_0xbb05('0x3a')][_0xbb05('0x46')]){_0x591e46[_0xbb05('0x44')][_0xbb05('0x47')]({'id':0x0,'priority':_0x591e46[_0xbb05('0x44')][_0xbb05('0x48')]+0x1,'app':_0xbb05('0x49'),'appdata':_0xbb05('0x46'),'interval':'*,*,*,*'});}if(_0x591e46[_0xbb05('0x3a')][_0xbb05('0x3e')]){delete _0x591e46[_0xbb05('0x3a')][_0xbb05('0x3e')];}if(_0x591e46['account']['List']){delete _0x591e46[_0xbb05('0x3a')][_0xbb05('0x3c')];}if(_0x44ac50['List']['Contacts'][_0xbb05('0x48')]){return _0x44ac50[_0xbb05('0x3c')][_0xbb05('0x4a')][0x0];}var _0x6cbc94=_[_0xbb05('0xc')](_0x55c8a4[_0xbb05('0x2a')],{'firstName':_0x55c8a4['body']['from'],'ListId':_0x44ac50[_0xbb05('0x31')]});_0x6cbc94[_0x55c8a4[_0xbb05('0x2a')][_0xbb05('0x36')]]=_0x55c8a4[_0xbb05('0x2a')][_0xbb05('0x33')];return db[_0xbb05('0x2d')][_0xbb05('0x4b')](_0x6cbc94);}else{throw new Error(_0xbb05('0x4c'));}})[_0xbb05('0x11')](function(_0x302040){_0x591e46[_0xbb05('0x4d')]=_0x302040;if(_0x302040){if(!_0x55c8a4[_0xbb05('0x2a')][_0xbb05('0x18')][_0xbb05('0x4e')]){_0x55c8a4['body'][_0xbb05('0x18')]['messageId']=rs[_0xbb05('0x4f')]()+'\x20'+_0x55c8a4[_0xbb05('0x2a')][_0xbb05('0x18')][_0xbb05('0x33')];}var _0x178a95={'ContactId':_0x302040['id'],'MailAccountId':_0x55c8a4[_0xbb05('0x3a')]['id'],'inReplyTo':_0x55c8a4['body'][_0xbb05('0x18')][_0xbb05('0x4e')],'to':_0x55c8a4[_0xbb05('0x2a')][_0xbb05('0x18')][_0xbb05('0x33')],'cc':_0x55c8a4[_0xbb05('0x2a')][_0xbb05('0x18')]['cc'],'subject':_0x55c8a4[_0xbb05('0x2a')]['message'][_0xbb05('0x50')],'attach':_0x55c8a4[_0xbb05('0x2a')][_0xbb05('0x18')][_0xbb05('0x51')],'lastMsgAt':moment()[_0xbb05('0x52')](_0xbb05('0x53')),'lastMsgDirection':'in'};return db['MailInteraction'][_0xbb05('0x27')]({'where':{'closed':![],'MailAccountId':_0x55c8a4[_0xbb05('0x3a')]['id']},'include':[{'model':db[_0xbb05('0x54')],'as':_0xbb05('0x55'),'attributes':[_0xbb05('0x4e')],'where':{'messageId':_0x55c8a4[_0xbb05('0x2a')][_0xbb05('0x18')][_0xbb05('0x56')]}}]})[_0xbb05('0x11')](function(_0x881bb8){if(_0x881bb8){return[_0x881bb8,![]];}return db[_0xbb05('0x57')][_0xbb05('0x4b')](_0x178a95)[_0xbb05('0x11')](function(_0x1fd3a5){return[_0x1fd3a5,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})['spread'](function(_0x5e7bdc,_0x569c5e){if(_0x5e7bdc){_0x842d51=_0x569c5e;if(!_0x569c5e){return _0x5e7bdc['update']({'inReplyTo':_0x55c8a4[_0xbb05('0x2a')][_0xbb05('0x18')][_0xbb05('0x4e')],'to':_0x55c8a4[_0xbb05('0x2a')][_0xbb05('0x18')][_0xbb05('0x33')],'cc':_0x55c8a4['body'][_0xbb05('0x18')]['cc'],'subject':_0x55c8a4[_0xbb05('0x2a')][_0xbb05('0x18')][_0xbb05('0x50')],'attach':_0x5e7bdc[_0xbb05('0x51')]?_0x5e7bdc[_0xbb05('0x51')]:_0x55c8a4[_0xbb05('0x2a')][_0xbb05('0x18')]['attach'],'substatus':null,'substatusAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()[_0xbb05('0x52')](_0xbb05('0x53')),'lastMsgDirection':'in'});}else{return _0x5e7bdc;}}})[_0xbb05('0x11')](function(_0x2fde03){_0x591e46[_0xbb05('0x58')]=_0x2fde03[_0xbb05('0x41')]({'plain':!![]});_0x591e46[_0xbb05('0x58')][_0xbb05('0x59')]=_0x842d51;return db[_0xbb05('0x54')][_0xbb05('0x4b')]({'body':_0x55c8a4[_0xbb05('0x2a')][_0xbb05('0x2a')],'MailAccountId':_0x55c8a4[_0xbb05('0x3a')]['id'],'MailInteractionId':_0x2fde03['id'],'direction':'in','ContactId':_0x591e46[_0xbb05('0x4d')]['id'],'messageId':_0x55c8a4['body']['message']['messageId'],'from':_0x55c8a4['body'][_0xbb05('0x18')][_0xbb05('0x33')],'to':_0x55c8a4[_0xbb05('0x2a')][_0xbb05('0x18')]['to'],'cc':_0x55c8a4[_0xbb05('0x2a')][_0xbb05('0x18')]['cc'],'subject':_0x55c8a4[_0xbb05('0x2a')][_0xbb05('0x18')][_0xbb05('0x50')],'attach':_0x55c8a4[_0xbb05('0x2a')][_0xbb05('0x18')][_0xbb05('0x51')],'Attachments':_0x55c8a4['body']['message']['attachments'],'originTo':_0x55c8a4[_0xbb05('0x2a')]['message'][_0xbb05('0x5a')],'originCc':_0x55c8a4['body'][_0xbb05('0x18')][_0xbb05('0x5b')],'bcc':_0x55c8a4[_0xbb05('0x2a')][_0xbb05('0x18')][_0xbb05('0x5c')],'ChatWebsiteId':_0x55c8a4['body'][_0xbb05('0x18')]['ChatWebsiteId']||null,'originChannel':_0x55c8a4[_0xbb05('0x2a')][_0xbb05('0x18')][_0xbb05('0x5d')]||_0xbb05('0x5e'),'ChatOfflineMessageId':_0x55c8a4[_0xbb05('0x2a')][_0xbb05('0x18')][_0xbb05('0x5f')]||null},{'include':[{'model':db[_0xbb05('0x60')],'as':_0xbb05('0x61')}]});})[_0xbb05('0x11')](function(_0x589a29){_0x591e46[_0xbb05('0x18')]=_0x589a29;if(_0x591e46['interaction'][_0xbb05('0x62')]){return db[_0xbb05('0x63')][_0xbb05('0x27')]({'attributes':['id','name'],'where':{'id':_0x591e46[_0xbb05('0x58')][_0xbb05('0x62')]}})[_0xbb05('0x11')](function(_0xee122){if(_0xee122){_0x591e46['applications'][_0xbb05('0x64')]({'id':0x0,'priority':0x0,'app':_0xbb05('0x65'),'appdata':_0xee122['name']+','+(_0x591e46[_0xbb05('0x3a')][_0xbb05('0x66')]||0xa),'interval':_0xbb05('0x67')});}return respondWithRpcPromise('Start','startRouting',_0x591e46);});}return respondWithRpcPromise(_0xbb05('0x68'),'startRouting',_0x591e46);})[_0xbb05('0x11')](function(_0x448b2f){_0x347043(_0x448b2f);})['catch'](function(_0x4459a6){_0x67a727(_0x18a5c3['error'](0x1f4,_0x4459a6[_0xbb05('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 6213e28..e3868ac 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 _0x0bb0=['update','register','length','mailAccount:','./mailAccount.events','remove'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x0bb0,0x11e));var _0x00bb=function(_0x28a6f4,_0xfc14f7){_0x28a6f4=_0x28a6f4-0x0;var _0x1d7d63=_0x0bb0[_0x28a6f4];return _0x1d7d63;};'use strict';var MailAccountEvents=require(_0x00bb('0x0'));var events=['save',_0x00bb('0x1'),_0x00bb('0x2')];function createListener(_0x25e1ee,_0x47654d){return function(_0x102160){_0x47654d['emit'](_0x25e1ee,_0x102160);};}function removeListener(_0x51369a,_0x506171){return function(){MailAccountEvents['removeListener'](_0x51369a,_0x506171);};}exports[_0x00bb('0x3')]=function(_0xa45378){for(var _0x2cbaa5=0x0,_0x237e7c=events[_0x00bb('0x4')];_0x2cbaa5<_0x237e7c;_0x2cbaa5++){var _0x41fa8b=events[_0x2cbaa5];var _0x5104d0=createListener(_0x00bb('0x5')+_0x41fa8b,_0xa45378);MailAccountEvents['on'](_0x41fa8b,_0x5104d0);}}; \ No newline at end of file +var _0xfda2=['save','remove','update','emit','removeListener','register','length','mailAccount:','./mailAccount.events'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0xfda2,0x8f));var _0x2fda=function(_0x211b6b,_0x32a35a){_0x211b6b=_0x211b6b-0x0;var _0x355aec=_0xfda2[_0x211b6b];return _0x355aec;};'use strict';var MailAccountEvents=require(_0x2fda('0x0'));var events=[_0x2fda('0x1'),_0x2fda('0x2'),_0x2fda('0x3')];function createListener(_0x5deaf9,_0x4ed70c){return function(_0x266c3e){_0x4ed70c[_0x2fda('0x4')](_0x5deaf9,_0x266c3e);};}function removeListener(_0x4d383d,_0x509844){return function(){MailAccountEvents[_0x2fda('0x5')](_0x4d383d,_0x509844);};}exports[_0x2fda('0x6')]=function(_0x46572a){for(var _0x2c187c=0x0,_0x5e38cf=events[_0x2fda('0x7')];_0x2c187c<_0x5e38cf;_0x2c187c++){var _0x396ed5=events[_0x2c187c];var _0x12c39b=createListener(_0x2fda('0x8')+_0x396ed5,_0x46572a);MailAccountEvents['on'](_0x396ed5,_0x12c39b);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 6c03c31..08e5ff8 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 _0x99b3=['delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x99b3,0x103));var _0x399b=function(_0x3d468e,_0x292ebe){_0x3d468e=_0x3d468e-0x0;var _0x22fbbf=_0x99b3[_0x3d468e];return _0x22fbbf;};'use strict';var multer=require(_0x399b('0x0'));var util=require(_0x399b('0x1'));var path=require(_0x399b('0x2'));var timeout=require('connect-timeout');var express=require(_0x399b('0x3'));var router=express['Router']();var fs_extra=require(_0x399b('0x4'));var auth=require(_0x399b('0x5'));var interaction=require(_0x399b('0x6'));var config=require(_0x399b('0x7'));var controller=require(_0x399b('0x8'));router[_0x399b('0x9')](_0x399b('0xa'),auth[_0x399b('0xb')](),controller['show']);router['put'](_0x399b('0xa'),auth[_0x399b('0xb')](),controller[_0x399b('0xc')]);router[_0x399b('0xd')](_0x399b('0xa'),auth[_0x399b('0xb')](),controller[_0x399b('0xe')]);module[_0x399b('0xf')]=router; \ No newline at end of file +var _0x04b0=['./mailApplication.controller','get','/:id','show','put','update','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x32f2d2,_0x33f442){var _0x38e14e=function(_0x1e31ed){while(--_0x1e31ed){_0x32f2d2['push'](_0x32f2d2['shift']());}};_0x38e14e(++_0x33f442);}(_0x04b0,0x12e));var _0x004b=function(_0x143522,_0x1e1f26){_0x143522=_0x143522-0x0;var _0x115bdf=_0x04b0[_0x143522];return _0x115bdf;};'use strict';var multer=require('multer');var util=require(_0x004b('0x0'));var path=require(_0x004b('0x1'));var timeout=require(_0x004b('0x2'));var express=require('express');var router=express[_0x004b('0x3')]();var fs_extra=require(_0x004b('0x4'));var auth=require(_0x004b('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x004b('0x6'));router[_0x004b('0x7')](_0x004b('0x8'),auth['isAuthenticated'](),controller[_0x004b('0x9')]);router[_0x004b('0xa')](_0x004b('0x8'),auth['isAuthenticated'](),controller[_0x004b('0xb')]);router['delete'](_0x004b('0x8'),auth['isAuthenticated'](),controller[_0x004b('0xc')]);module[_0x004b('0xd')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 55f3ebc..f565132 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 _0x263e=['exports','INTEGER','TEXT','STRING','*,*,*,*'];(function(_0x5da27f,_0x504b76){var _0x54a3fb=function(_0x3b65a8){while(--_0x3b65a8){_0x5da27f['push'](_0x5da27f['shift']());}};_0x54a3fb(++_0x504b76);}(_0x263e,0xbe));var _0xe263=function(_0x364b32,_0x4dec35){_0x364b32=_0x364b32-0x0;var _0x3f3ea0=_0x263e[_0x364b32];return _0x3f3ea0;};'use strict';var Sequelize=require('sequelize');module[_0xe263('0x0')]={'priority':{'type':Sequelize[_0xe263('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xe263('0x2')]()},'description':{'type':Sequelize[_0xe263('0x3')]},'interval':{'type':Sequelize[_0xe263('0x3')],'defaultValue':_0xe263('0x4')}}; \ No newline at end of file +var _0x874b=['noop','TEXT','*,*,*,*','sequelize','INTEGER','STRING'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x874b,0xa5));var _0xb874=function(_0x327df9,_0x43de0d){_0x327df9=_0x327df9-0x0;var _0x28fd8d=_0x874b[_0x327df9];return _0x28fd8d;};'use strict';var Sequelize=require(_0xb874('0x0'));module['exports']={'priority':{'type':Sequelize[_0xb874('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xb874('0x2')],'allowNull':![],'defaultValue':_0xb874('0x3')},'appdata':{'type':Sequelize[_0xb874('0x4')]()},'description':{'type':Sequelize[_0xb874('0x2')]},'interval':{'type':Sequelize[_0xb874('0x2')],'defaultValue':_0xb874('0x5')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 61cbecc..27fb04c 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 _0x9c44=['Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','show','params','model','keys','MailApplication','rawAttributes','query','attributes','intersection','fields','length','includeAll','include','merge','options','find','then','body','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'];(function(_0x5b1389,_0x3f0664){var _0x559a88=function(_0x12ad09){while(--_0x12ad09){_0x5b1389['push'](_0x5b1389['shift']());}};_0x559a88(++_0x3f0664);}(_0x9c44,0x178));var _0x49c4=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x9c44[_0x550d12];return _0x12103d;};'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={'raw':!![],'where':{'id':_0x5987ae[_0x49c4('0x29')]['id']}},_0x46e04d={};_0x46e04d[_0x49c4('0x2a')]=_[_0x49c4('0x2b')](db[_0x49c4('0x2c')][_0x49c4('0x2d')]);_0x46e04d[_0x49c4('0x2e')]=_[_0x49c4('0x2b')](_0x5987ae[_0x49c4('0x2e')]);_0x46e04d['filters']=_['intersection'](_0x46e04d['model'],_0x46e04d[_0x49c4('0x2e')]);_0x2b2793[_0x49c4('0x2f')]=_[_0x49c4('0x30')](_0x46e04d[_0x49c4('0x2a')],qs[_0x49c4('0x31')](_0x5987ae['query'][_0x49c4('0x31')]));_0x2b2793[_0x49c4('0x2f')]=_0x2b2793[_0x49c4('0x2f')][_0x49c4('0x32')]?_0x2b2793['attributes']:_0x46e04d['model'];if(_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x33')]){_0x2b2793[_0x49c4('0x34')]=[{'all':!![]}];}_0x2b2793=_[_0x49c4('0x35')]({},_0x2b2793,_0x5987ae[_0x49c4('0x36')]);return db['MailApplication'][_0x49c4('0x37')](_0x2b2793)[_0x49c4('0x38')](handleEntityNotFound(_0x889909,null))[_0x49c4('0x38')](respondWithResult(_0x889909,null))['catch'](handleError(_0x889909,null));};exports['update']=function(_0x85dce2,_0x1991e9){if(_0x85dce2[_0x49c4('0x39')]['id']){delete _0x85dce2[_0x49c4('0x39')]['id'];}return db[_0x49c4('0x2c')][_0x49c4('0x37')]({'where':{'id':_0x85dce2[_0x49c4('0x29')]['id']}})[_0x49c4('0x38')](handleEntityNotFound(_0x1991e9,null))[_0x49c4('0x38')](saveUpdates(_0x85dce2['body'],null))[_0x49c4('0x38')](respondWithResult(_0x1991e9,null))['catch'](handleError(_0x1991e9,null));};exports[_0x49c4('0x23')]=function(_0x349791,_0x2625a6){return db[_0x49c4('0x2c')]['find']({'where':{'id':_0x349791[_0x49c4('0x29')]['id']}})[_0x49c4('0x38')](handleEntityNotFound(_0x2625a6,null))[_0x49c4('0x38')](removeEntity(_0x2625a6,null))['catch'](handleError(_0x2625a6,null));}; \ No newline at end of file +var _0xaa88=['limit','count','set','apply','reject','then','stack','name','send','params','model','keys','MailApplication','query','filters','intersection','attributes','fields','length','include','merge','options','find','update','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaa88,0x137));var _0x8aa8=function(_0x4a5f6c,_0x4f532e){_0x4a5f6c=_0x4a5f6c-0x0;var _0x281ffd=_0xaa88[_0x4a5f6c];return _0x281ffd;};'use strict';var emlformat=require(_0x8aa8('0x0'));var rimraf=require(_0x8aa8('0x1'));var zipdir=require(_0x8aa8('0x2'));var jsonpatch=require(_0x8aa8('0x3'));var rp=require('request-promise');var moment=require(_0x8aa8('0x4'));var BPromise=require(_0x8aa8('0x5'));var Mustache=require(_0x8aa8('0x6'));var util=require(_0x8aa8('0x7'));var path=require(_0x8aa8('0x8'));var sox=require(_0x8aa8('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8aa8('0xa'));var _=require('lodash');var squel=require(_0x8aa8('0xb'));var crypto=require(_0x8aa8('0xc'));var jsforce=require(_0x8aa8('0xd'));var deskjs=require(_0x8aa8('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8aa8('0xf'));var Papa=require(_0x8aa8('0x10'));var Redis=require(_0x8aa8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8aa8('0x12'));var as=require(_0x8aa8('0x13'));var hardwareService=require(_0x8aa8('0x14'));var logger=require(_0x8aa8('0x15'))('api');var utils=require(_0x8aa8('0x16'));var config=require(_0x8aa8('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x8aa8('0x18'))['db'];function respondWithStatusCode(_0xa691d6,_0x28132f){_0x28132f=_0x28132f||0xcc;return function(_0x535aa0){if(_0x535aa0){return _0xa691d6[_0x8aa8('0x19')](_0x28132f);}return _0xa691d6[_0x8aa8('0x1a')](_0x28132f)[_0x8aa8('0x1b')]();};}function respondWithResult(_0x4b686e,_0x391642){_0x391642=_0x391642||0xc8;return function(_0x4af534){if(_0x4af534){return _0x4b686e['status'](_0x391642)[_0x8aa8('0x1c')](_0x4af534);}};}function respondWithFilteredResult(_0x200662,_0xae81a0){return function(_0xa6c2af){if(_0xa6c2af){var _0x42a6a4=typeof _0xae81a0[_0x8aa8('0x1d')]===_0x8aa8('0x1e')&&typeof _0xae81a0[_0x8aa8('0x1f')]===_0x8aa8('0x1e');var _0x4e8ce3=_0xa6c2af['count'];var _0x2c1b9a=_0x42a6a4?0x0:_0xae81a0['offset'];var _0x557adc=_0x42a6a4?_0xa6c2af[_0x8aa8('0x20')]:_0xae81a0['offset']+_0xae81a0[_0x8aa8('0x1f')];var _0x41092b;if(_0x557adc>=_0x4e8ce3){_0x557adc=_0x4e8ce3;_0x41092b=0xc8;}else{_0x41092b=0xce;}_0x200662[_0x8aa8('0x1a')](_0x41092b);return _0x200662[_0x8aa8('0x21')]('Content-Range',_0x2c1b9a+'-'+_0x557adc+'/'+_0x4e8ce3)[_0x8aa8('0x1c')](_0xa6c2af);}return null;};}function patchUpdates(_0x36c445){return function(_0x2825fd){try{jsonpatch[_0x8aa8('0x22')](_0x2825fd,_0x36c445,!![]);}catch(_0x4c754e){return BPromise[_0x8aa8('0x23')](_0x4c754e);}return _0x2825fd['save']();};}function saveUpdates(_0x26cf63,_0x4cc455){return function(_0x1fdadd){if(_0x1fdadd){return _0x1fdadd['update'](_0x26cf63)[_0x8aa8('0x24')](function(_0x557e4e){return _0x557e4e;});}return null;};}function removeEntity(_0x65945b,_0x40adb5){return function(_0x3ca7dc){if(_0x3ca7dc){return _0x3ca7dc['destroy']()[_0x8aa8('0x24')](function(){_0x65945b[_0x8aa8('0x1a')](0xcc)[_0x8aa8('0x1b')]();});}};}function handleEntityNotFound(_0x547a7b,_0x57acd2){return function(_0x2d1508){if(!_0x2d1508){_0x547a7b[_0x8aa8('0x19')](0x194);}return _0x2d1508;};}function handleError(_0x2f91f3,_0x3a3c7a){_0x3a3c7a=_0x3a3c7a||0x1f4;return function(_0x24143e){logger['error'](_0x24143e[_0x8aa8('0x25')]);if(_0x24143e['name']){delete _0x24143e[_0x8aa8('0x26')];}_0x2f91f3[_0x8aa8('0x1a')](_0x3a3c7a)[_0x8aa8('0x27')](_0x24143e);};}exports['show']=function(_0x4c5c5c,_0x10810d){var _0x5e96c9={'raw':!![],'where':{'id':_0x4c5c5c[_0x8aa8('0x28')]['id']}},_0x385208={};_0x385208[_0x8aa8('0x29')]=_[_0x8aa8('0x2a')](db[_0x8aa8('0x2b')]['rawAttributes']);_0x385208[_0x8aa8('0x2c')]=_[_0x8aa8('0x2a')](_0x4c5c5c['query']);_0x385208[_0x8aa8('0x2d')]=_[_0x8aa8('0x2e')](_0x385208[_0x8aa8('0x29')],_0x385208['query']);_0x5e96c9[_0x8aa8('0x2f')]=_[_0x8aa8('0x2e')](_0x385208[_0x8aa8('0x29')],qs[_0x8aa8('0x30')](_0x4c5c5c[_0x8aa8('0x2c')][_0x8aa8('0x30')]));_0x5e96c9[_0x8aa8('0x2f')]=_0x5e96c9[_0x8aa8('0x2f')][_0x8aa8('0x31')]?_0x5e96c9[_0x8aa8('0x2f')]:_0x385208[_0x8aa8('0x29')];if(_0x4c5c5c['query']['includeAll']){_0x5e96c9[_0x8aa8('0x32')]=[{'all':!![]}];}_0x5e96c9=_[_0x8aa8('0x33')]({},_0x5e96c9,_0x4c5c5c[_0x8aa8('0x34')]);return db[_0x8aa8('0x2b')][_0x8aa8('0x35')](_0x5e96c9)[_0x8aa8('0x24')](handleEntityNotFound(_0x10810d,null))['then'](respondWithResult(_0x10810d,null))['catch'](handleError(_0x10810d,null));};exports[_0x8aa8('0x36')]=function(_0x5755b5,_0x24997c){if(_0x5755b5[_0x8aa8('0x37')]['id']){delete _0x5755b5[_0x8aa8('0x37')]['id'];}return db['MailApplication'][_0x8aa8('0x35')]({'where':{'id':_0x5755b5[_0x8aa8('0x28')]['id']}})[_0x8aa8('0x24')](handleEntityNotFound(_0x24997c,null))['then'](saveUpdates(_0x5755b5['body'],null))[_0x8aa8('0x24')](respondWithResult(_0x24997c,null))[_0x8aa8('0x38')](handleError(_0x24997c,null));};exports['destroy']=function(_0x24eb18,_0x2e1f52){return db['MailApplication'][_0x8aa8('0x35')]({'where':{'id':_0x24eb18['params']['id']}})['then'](handleEntityNotFound(_0x2e1f52,null))[_0x8aa8('0x24')](removeEntity(_0x2e1f52,null))['catch'](handleError(_0x2e1f52,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 7f8eea2..2519eeb 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 _0xd483=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailApplication.attributes','exports','define','MailApplication','mail_applications','utf8mb4','lodash','util','../../config/logger'];(function(_0x4920f2,_0xa4bfbf){var _0x1f27cf=function(_0x4d94ad){while(--_0x4d94ad){_0x4920f2['push'](_0x4920f2['shift']());}};_0x1f27cf(++_0xa4bfbf);}(_0xd483,0xfd));var _0x3d48=function(_0x45af8c,_0x42ecfd){_0x45af8c=_0x45af8c-0x0;var _0x4f8b30=_0xd483[_0x45af8c];return _0x4f8b30;};'use strict';var _=require(_0x3d48('0x0'));var util=require(_0x3d48('0x1'));var logger=require(_0x3d48('0x2'))(_0x3d48('0x3'));var moment=require(_0x3d48('0x4'));var BPromise=require(_0x3d48('0x5'));var rp=require(_0x3d48('0x6'));var fs=require('fs');var path=require(_0x3d48('0x7'));var rimraf=require(_0x3d48('0x8'));var config=require(_0x3d48('0x9'));var attributes=require(_0x3d48('0xa'));module[_0x3d48('0xb')]=function(_0x1fb576,_0x326a27){return _0x1fb576[_0x3d48('0xc')](_0x3d48('0xd'),attributes,{'tableName':_0x3d48('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3d48('0xf'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xce6e=['request-promise','path','rimraf','../../config/environment','MailApplication','mail_applications','utf8mb4','util','../../config/logger','moment','bluebird'];(function(_0x10f5f7,_0x13602e){var _0x337c04=function(_0x54e2c3){while(--_0x54e2c3){_0x10f5f7['push'](_0x10f5f7['shift']());}};_0x337c04(++_0x13602e);}(_0xce6e,0x167));var _0xece6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xce6e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xece6('0x0'));var logger=require(_0xece6('0x1'))('api');var moment=require(_0xece6('0x2'));var BPromise=require(_0xece6('0x3'));var rp=require(_0xece6('0x4'));var fs=require('fs');var path=require(_0xece6('0x5'));var rimraf=require(_0xece6('0x6'));var config=require(_0xece6('0x7'));var attributes=require('./mailApplication.attributes');module['exports']=function(_0x27d8cd,_0x24e39a){return _0x27d8cd['define'](_0xece6('0x8'),attributes,{'tableName':_0xece6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xece6('0xa'),'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 4fe3764..4845316 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 _0x2b4b=['update','body','options','raw','where','attributes','limit','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','MailApplication,\x20%s,\x20%s','message','result','catch','UpdateMailApplication','MailApplication'];(function(_0xe35e6d,_0x4f1b86){var _0x7483d9=function(_0x57fec1){while(--_0x57fec1){_0xe35e6d['push'](_0xe35e6d['shift']());}};_0x7483d9(++_0x4f1b86);}(_0x2b4b,0x67));var _0xb2b4=function(_0x972ee0,_0x456351){_0x972ee0=_0x972ee0-0x0;var _0x9476f1=_0x2b4b[_0x972ee0];return _0x9476f1;};'use strict';var _=require(_0xb2b4('0x0'));var util=require(_0xb2b4('0x1'));var moment=require(_0xb2b4('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb2b4('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb2b4('0x4'));var logger=require(_0xb2b4('0x5'))(_0xb2b4('0x6'));var config=require(_0xb2b4('0x7'));var jayson=require(_0xb2b4('0x8'));var client=jayson['client'][_0xb2b4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x25dc7d,_0x59069c,_0x4a6266){return new BPromise(function(_0xc368b4,_0x3f76fb){return client[_0xb2b4('0xa')](_0x25dc7d,_0x4a6266)[_0xb2b4('0xb')](function(_0x1d21f3){logger[_0xb2b4('0xc')]('MailApplication,\x20%s,\x20%s',_0x59069c,_0xb2b4('0xd'));logger[_0xb2b4('0xe')](_0xb2b4('0xf'),_0x59069c,_0xb2b4('0xd'),JSON[_0xb2b4('0x10')](_0x1d21f3));if(_0x1d21f3[_0xb2b4('0x11')]){if(_0x1d21f3[_0xb2b4('0x11')][_0xb2b4('0x12')]===0x1f4){logger[_0xb2b4('0x11')](_0xb2b4('0x13'),_0x59069c,_0x1d21f3[_0xb2b4('0x11')][_0xb2b4('0x14')]);return _0x3f76fb(_0x1d21f3['error'][_0xb2b4('0x14')]);}logger[_0xb2b4('0x11')](_0xb2b4('0x13'),_0x59069c,_0x1d21f3['error'][_0xb2b4('0x14')]);return _0xc368b4(_0x1d21f3[_0xb2b4('0x11')][_0xb2b4('0x14')]);}else{logger[_0xb2b4('0xc')](_0xb2b4('0x13'),_0x59069c,'request\x20sent');_0xc368b4(_0x1d21f3[_0xb2b4('0x15')][_0xb2b4('0x14')]);}})[_0xb2b4('0x16')](function(_0x3126a8){logger[_0xb2b4('0x11')](_0xb2b4('0x13'),_0x59069c,_0x3126a8);_0x3f76fb(_0x3126a8);});});}exports[_0xb2b4('0x17')]=function(_0x1c699d){var _0x477717=this;return new Promise(function(_0x1c7f47,_0x467e4b){return db[_0xb2b4('0x18')][_0xb2b4('0x19')](_0x1c699d[_0xb2b4('0x1a')],{'raw':_0x1c699d[_0xb2b4('0x1b')]?_0x1c699d[_0xb2b4('0x1b')][_0xb2b4('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c699d[_0xb2b4('0x1b')]?_0x1c699d[_0xb2b4('0x1b')][_0xb2b4('0x1d')]||null:null,'attributes':_0x1c699d['options']?_0x1c699d[_0xb2b4('0x1b')][_0xb2b4('0x1e')]||null:null,'limit':_0x1c699d['options']?_0x1c699d[_0xb2b4('0x1b')][_0xb2b4('0x1f')]||null:null})[_0xb2b4('0xb')](function(_0x518748){logger[_0xb2b4('0xc')](_0xb2b4('0x17'),_0x1c699d);logger[_0xb2b4('0xe')](_0xb2b4('0x17'),_0x1c699d,JSON[_0xb2b4('0x10')](_0x518748));_0x1c7f47(_0x518748);})['catch'](function(_0x4f4604){logger[_0xb2b4('0x11')](_0xb2b4('0x17'),_0x4f4604[_0xb2b4('0x14')],_0x1c699d);_0x467e4b(_0x477717[_0xb2b4('0x11')](0x1f4,_0x4f4604[_0xb2b4('0x14')]));});});}; \ No newline at end of file +var _0xa2d4=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','UpdateMailApplication','MailApplication','update','options','attributes','limit','then','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x9ae685,_0x2c6652){var _0x4c492e=function(_0xde76ce){while(--_0xde76ce){_0x9ae685['push'](_0x9ae685['shift']());}};_0x4c492e(++_0x2c6652);}(_0xa2d4,0x159));var _0x4a2d=function(_0x3e608c,_0x5abdfd){_0x3e608c=_0x3e608c-0x0;var _0x23e783=_0xa2d4[_0x3e608c];return _0x23e783;};'use strict';var _=require('lodash');var util=require(_0x4a2d('0x0'));var moment=require('moment');var BPromise=require(_0x4a2d('0x1'));var rs=require(_0x4a2d('0x2'));var fs=require('fs');var Redis=require(_0x4a2d('0x3'));var db=require(_0x4a2d('0x4'))['db'];var utils=require(_0x4a2d('0x5'));var logger=require(_0x4a2d('0x6'))(_0x4a2d('0x7'));var config=require(_0x4a2d('0x8'));var jayson=require(_0x4a2d('0x9'));var client=jayson['client'][_0x4a2d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4aa4a5,_0xc6abfb,_0x3a7961){return new BPromise(function(_0x16ff55,_0x26b2b7){return client[_0x4a2d('0xb')](_0x4aa4a5,_0x3a7961)['then'](function(_0x189aff){logger[_0x4a2d('0xc')](_0x4a2d('0xd'),_0xc6abfb,_0x4a2d('0xe'));logger[_0x4a2d('0xf')]('MailApplication,\x20%s,\x20%s,\x20%s',_0xc6abfb,_0x4a2d('0xe'),JSON['stringify'](_0x189aff));if(_0x189aff[_0x4a2d('0x10')]){if(_0x189aff[_0x4a2d('0x10')][_0x4a2d('0x11')]===0x1f4){logger[_0x4a2d('0x10')](_0x4a2d('0xd'),_0xc6abfb,_0x189aff['error'][_0x4a2d('0x12')]);return _0x26b2b7(_0x189aff[_0x4a2d('0x10')]['message']);}logger[_0x4a2d('0x10')](_0x4a2d('0xd'),_0xc6abfb,_0x189aff['error'][_0x4a2d('0x12')]);return _0x16ff55(_0x189aff[_0x4a2d('0x10')]['message']);}else{logger['info']('MailApplication,\x20%s,\x20%s',_0xc6abfb,'request\x20sent');_0x16ff55(_0x189aff['result'][_0x4a2d('0x12')]);}})[_0x4a2d('0x13')](function(_0x5abdd2){logger[_0x4a2d('0x10')](_0x4a2d('0xd'),_0xc6abfb,_0x5abdd2);_0x26b2b7(_0x5abdd2);});});}exports[_0x4a2d('0x14')]=function(_0xb2e4ca){var _0x3bacab=this;return new Promise(function(_0x1b2143,_0x560bff){return db[_0x4a2d('0x15')][_0x4a2d('0x16')](_0xb2e4ca['body'],{'raw':_0xb2e4ca[_0x4a2d('0x17')]?_0xb2e4ca['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb2e4ca[_0x4a2d('0x17')]?_0xb2e4ca[_0x4a2d('0x17')]['where']||null:null,'attributes':_0xb2e4ca[_0x4a2d('0x17')]?_0xb2e4ca['options'][_0x4a2d('0x18')]||null:null,'limit':_0xb2e4ca[_0x4a2d('0x17')]?_0xb2e4ca[_0x4a2d('0x17')][_0x4a2d('0x19')]||null:null})[_0x4a2d('0x1a')](function(_0x338acd){logger[_0x4a2d('0xc')](_0x4a2d('0x14'),_0xb2e4ca);logger['debug']('UpdateMailApplication',_0xb2e4ca,JSON['stringify'](_0x338acd));_0x1b2143(_0x338acd);})['catch'](function(_0x1e2285){logger[_0x4a2d('0x10')]('UpdateMailApplication',_0x1e2285[_0x4a2d('0x12')],_0xb2e4ca);_0x560bff(_0x3bacab[_0x4a2d('0x10')](0x1f4,_0x1e2285[_0x4a2d('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 8d1d53d..32c76d2 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 _0xc9f5=['/:id','mailinteraction:update','update','delete','mailinteraction:destroy','destroy','removeTags','exports','express','../../components/auth/service','./mailInteraction.controller','isAuthenticated','index','get','/describe','describe','show','/:id/messages','getMessages','/:id/download','download','post','create','tracked','mail','mailinteraction:addtags','addTags'];(function(_0x4ea087,_0xe3f3cc){var _0x26e98c=function(_0x52e9e6){while(--_0x52e9e6){_0x4ea087['push'](_0x4ea087['shift']());}};_0x26e98c(++_0xe3f3cc);}(_0xc9f5,0x14c));var _0x5c9f=function(_0x1034ee,_0x12998c){_0x1034ee=_0x1034ee-0x0;var _0x2922af=_0xc9f5[_0x1034ee];return _0x2922af;};'use strict';var express=require(_0x5c9f('0x0'));var router=express['Router']();var auth=require(_0x5c9f('0x1'));var interaction=require('../../components/interaction/service');var controller=require(_0x5c9f('0x2'));router['get']('/',auth[_0x5c9f('0x3')](),controller[_0x5c9f('0x4')]);router[_0x5c9f('0x5')](_0x5c9f('0x6'),auth['isAuthenticated'](),controller[_0x5c9f('0x7')]);router[_0x5c9f('0x5')]('/:id',auth[_0x5c9f('0x3')](),controller[_0x5c9f('0x8')]);router[_0x5c9f('0x5')](_0x5c9f('0x9'),auth[_0x5c9f('0x3')](),controller[_0x5c9f('0xa')]);router[_0x5c9f('0x5')](_0x5c9f('0xb'),auth[_0x5c9f('0x3')](),controller[_0x5c9f('0xc')]);router[_0x5c9f('0xd')]('/',auth[_0x5c9f('0x3')](),controller[_0x5c9f('0xe')]);router[_0x5c9f('0xd')]('/:id/messages',auth[_0x5c9f('0x3')](),controller['addMessage']);router[_0x5c9f('0xd')]('/:id/tags',auth[_0x5c9f('0x3')](),interaction[_0x5c9f('0xf')](_0x5c9f('0x10'),_0x5c9f('0x11')),controller[_0x5c9f('0x12')]);router['put'](_0x5c9f('0x13'),auth['isAuthenticated'](),interaction['tracked'](_0x5c9f('0x10'),_0x5c9f('0x14')),controller[_0x5c9f('0x15')]);router[_0x5c9f('0x16')](_0x5c9f('0x13'),auth[_0x5c9f('0x3')](),interaction[_0x5c9f('0xf')]('mail',_0x5c9f('0x17')),controller[_0x5c9f('0x18')]);router[_0x5c9f('0x16')]('/:id/tags',auth[_0x5c9f('0x3')](),controller[_0x5c9f('0x19')]);module[_0x5c9f('0x1a')]=router; \ No newline at end of file +var _0xd8e9=['addTags','put','/:id','tracked','delete','destroy','/:id/tags','removeTags','exports','express','../../components/auth/service','./mailInteraction.controller','get','isAuthenticated','index','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','mail','mailinteraction:addtags'];(function(_0x5694d3,_0x2e3008){var _0x1ca96e=function(_0x33a079){while(--_0x33a079){_0x5694d3['push'](_0x5694d3['shift']());}};_0x1ca96e(++_0x2e3008);}(_0xd8e9,0xb1));var _0x9d8e=function(_0x27b5be,_0x594965){_0x27b5be=_0x27b5be-0x0;var _0x3ad591=_0xd8e9[_0x27b5be];return _0x3ad591;};'use strict';var express=require(_0x9d8e('0x0'));var router=express['Router']();var auth=require(_0x9d8e('0x1'));var interaction=require('../../components/interaction/service');var controller=require(_0x9d8e('0x2'));router[_0x9d8e('0x3')]('/',auth[_0x9d8e('0x4')](),controller[_0x9d8e('0x5')]);router['get']('/describe',auth[_0x9d8e('0x4')](),controller['describe']);router[_0x9d8e('0x3')]('/:id',auth[_0x9d8e('0x4')](),controller['show']);router[_0x9d8e('0x3')](_0x9d8e('0x6'),auth['isAuthenticated'](),controller[_0x9d8e('0x7')]);router[_0x9d8e('0x3')](_0x9d8e('0x8'),auth['isAuthenticated'](),controller[_0x9d8e('0x9')]);router[_0x9d8e('0xa')]('/',auth[_0x9d8e('0x4')](),controller[_0x9d8e('0xb')]);router[_0x9d8e('0xa')](_0x9d8e('0x6'),auth[_0x9d8e('0x4')](),controller[_0x9d8e('0xc')]);router[_0x9d8e('0xa')]('/:id/tags',auth[_0x9d8e('0x4')](),interaction['tracked'](_0x9d8e('0xd'),_0x9d8e('0xe')),controller[_0x9d8e('0xf')]);router[_0x9d8e('0x10')](_0x9d8e('0x11'),auth[_0x9d8e('0x4')](),interaction[_0x9d8e('0x12')]('mail','mailinteraction:update'),controller['update']);router[_0x9d8e('0x13')](_0x9d8e('0x11'),auth['isAuthenticated'](),interaction[_0x9d8e('0x12')](_0x9d8e('0xd'),'mailinteraction:destroy'),controller[_0x9d8e('0x14')]);router[_0x9d8e('0x13')](_0x9d8e('0x15'),auth[_0x9d8e('0x4')](),controller[_0x9d8e('0x16')]);module[_0x9d8e('0x17')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 3b37f94..b1af9f3 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 _0x88a5=['iconv','exports','BOOLEAN','DATE','STRING','TEXT','ENUM','out'];(function(_0x233de7,_0x109f02){var _0x26940c=function(_0x474b79){while(--_0x474b79){_0x233de7['push'](_0x233de7['shift']());}};_0x26940c(++_0x109f02);}(_0x88a5,0x90));var _0x588a=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x88a5[_0x278e3c];return _0x3e2d9b;};'use strict';var Sequelize=require('sequelize');var iconv=require(_0x588a('0x0'));module[_0x588a('0x1')]={'closed':{'type':Sequelize[_0x588a('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x588a('0x3')]},'disposition':{'type':Sequelize[_0x588a('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x588a('0x4')](0x1fe)},'to':{'type':Sequelize[_0x588a('0x4')]},'cc':{'type':Sequelize[_0x588a('0x5')]('long')},'subject':{'type':Sequelize[_0x588a('0x5')]()},'attach':{'type':Sequelize[_0x588a('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x588a('0x3')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x588a('0x6')]('in',_0x588a('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x588a('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x588a('0x6')]('in',_0x588a('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x588a('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x6234=['sequelize','iconv','BOOLEAN','DATE','STRING','TEXT','long','ENUM','out'];(function(_0x423494,_0x123b46){var _0x569bbc=function(_0x733020){while(--_0x733020){_0x423494['push'](_0x423494['shift']());}};_0x569bbc(++_0x123b46);}(_0x6234,0x1c2));var _0x4623=function(_0x157ef8,_0x31226d){_0x157ef8=_0x157ef8-0x0;var _0xdb90a5=_0x6234[_0x157ef8];return _0xdb90a5;};'use strict';var Sequelize=require(_0x4623('0x0'));var iconv=require(_0x4623('0x1'));module['exports']={'closed':{'type':Sequelize[_0x4623('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x4623('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x4623('0x4')]},'thirdDisposition':{'type':Sequelize[_0x4623('0x4')]},'note':{'type':Sequelize[_0x4623('0x4')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0x4623('0x4')]},'cc':{'type':Sequelize[_0x4623('0x5')](_0x4623('0x6'))},'subject':{'type':Sequelize[_0x4623('0x5')]()},'attach':{'type':Sequelize[_0x4623('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x4623('0x3')]},'substatus':{'type':Sequelize[_0x4623('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0x4623('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x4623('0x7')]('in',_0x4623('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x4623('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x4623('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x4623('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 2896280..0c0099c 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 _0xa9e0=['o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','Setting','enableEmailPreview','all','rows','show','params','includeAll','include','options','create','body','addMessage','ids','omit','getMessages','nolimit','MailInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','true','addTags','setTags','Tag','mailInteractionTags:save','download','join','root','server','tmp','attachments','Attachment','Attachments','subject','Messages','get','mkdirSync','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','basename','existsSync','readFileSync','writeFileSync','message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','util','lodash','squel','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','defaults','socket.io-emitter','redis','./mailInteraction.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','sendStatus','error','stack','name','send','Users','fullname','Tags','split','forEach','push','TagIds','MailMessage','findOne','out','-id','plainBody','lastMsgText','trimStart','catch','index','MailInteraction','rawAttributes','fieldName','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','sort','filters','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.MailInteractionId','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20>\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','type','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','keys','some','compact','where','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','group','QueryTypes','SELECT','clone','i.id','order','contactName','DESC','t.id\x20IN\x20?','resolve','MailAccountId','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','Account.mandatoryDisposition','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgDirection','i.disposition','i.secondDisposition','i.thirdDisposition','i.substatus','i.to','i.MailAccountId','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname'];(function(_0x27f72a,_0x278936){var _0x820aea=function(_0x183b17){while(--_0x183b17){_0x27f72a['push'](_0x27f72a['shift']());}};_0x820aea(++_0x278936);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x0a9e('0x3'));var path=require('path');var fs=require('fs');var _=require(_0x0a9e('0x4'));var squel=require(_0x0a9e('0x5'));var juice=require(_0x0a9e('0x6'));var Redis=require(_0x0a9e('0x7'));var qs=require(_0x0a9e('0x8'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0x0a9e('0x9'))(_0x0a9e('0xa'));var config=require(_0x0a9e('0xb'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x0a9e('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0a9e('0xd'))(new Redis(config[_0x0a9e('0xe')]));require(_0x0a9e('0xf'))[_0x0a9e('0x10')](socket);function respondWithStatusCode(_0xfeb75b,_0xbd1168){_0xbd1168=_0xbd1168||0xcc;return function(_0x4a4c56){if(_0x4a4c56){return _0xfeb75b['sendStatus'](_0xbd1168);}return _0xfeb75b['status'](_0xbd1168)['end']();};}function respondWithResult(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xc8;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x11')](_0x36471c)[_0x0a9e('0x12')](_0xd5b662);}};}function respondWithFilteredResult(_0x69aeb7,_0x5db4b0){return function(_0x4283ce){if(_0x4283ce){var _0x239b12=typeof _0x5db4b0[_0x0a9e('0x13')]===_0x0a9e('0x14')&&typeof _0x5db4b0[_0x0a9e('0x15')]===_0x0a9e('0x14');var _0x52a03d=_0x4283ce[_0x0a9e('0x16')];var _0x5d0880=_0x239b12?0x0:_0x5db4b0[_0x0a9e('0x13')];var _0x519dfd=_0x239b12?_0x4283ce[_0x0a9e('0x16')]:_0x5db4b0[_0x0a9e('0x13')]+_0x5db4b0['limit'];var _0x225616;if(_0x519dfd>=_0x52a03d){_0x519dfd=_0x52a03d;_0x225616=0xc8;}else{_0x225616=0xce;}_0x69aeb7['status'](_0x225616);return _0x69aeb7[_0x0a9e('0x17')](_0x0a9e('0x18'),_0x5d0880+'-'+_0x519dfd+'/'+_0x52a03d)[_0x0a9e('0x12')](_0x4283ce);}return null;};}function saveUpdates(_0x205fd6){return function(_0x31b1ca){if(_0x31b1ca){return _0x31b1ca[_0x0a9e('0x19')](_0x205fd6)[_0x0a9e('0x1a')](function(_0x20559e){return _0x20559e;});}return null;};}function removeEntity(_0x1314ae){return function(_0x112016){if(_0x112016){return _0x112016[_0x0a9e('0x1b')]()[_0x0a9e('0x1a')](function(){_0x1314ae['status'](0xcc)[_0x0a9e('0x1c')]();});}};}function handleEntityNotFound(_0x155cce){return function(_0x53682f){if(!_0x53682f){_0x155cce[_0x0a9e('0x1d')](0x194);}return _0x53682f;};}function handleError(_0x5a09ef,_0x588269){_0x588269=_0x588269||0x1f4;return function(_0x3a02e1){logger[_0x0a9e('0x1e')](_0x3a02e1[_0x0a9e('0x1f')]);if(_0x3a02e1[_0x0a9e('0x20')]){delete _0x3a02e1['name'];}_0x5a09ef[_0x0a9e('0x11')](_0x588269)[_0x0a9e('0x21')](_0x3a02e1);};}function getInteractionUsers(_0x3b45bc,_0x4d00e6){return new BPromise(function(_0x370d86,_0x42ac8f){try{if(_0x4d00e6[_0x3b45bc['id']]){_0x3b45bc[_0x0a9e('0x22')]=_['map'](_0x4d00e6[_0x3b45bc['id']],function(_0x59181e){return{'id':_0x59181e['id'],'fullname':_0x59181e[_0x0a9e('0x23')]};});}}catch(_0x3a8e58){_0x42ac8f(_0x3a8e58);}_0x370d86(_0x3b45bc);});}function getInteractionTags(_0x40c424,_0x33161b){return new BPromise(function(_0x526cf3,_0x384319){try{if(_0x40c424['TagIds']){_0x40c424[_0x0a9e('0x24')]=[];_0x40c424['TagIds'][_0x0a9e('0x25')](',')[_0x0a9e('0x26')](function(_0x25fba9){_0x40c424[_0x0a9e('0x24')][_0x0a9e('0x27')](_0x33161b[_0x25fba9]);});}delete _0x40c424[_0x0a9e('0x28')];}catch(_0x11c3b6){_0x384319(_0x11c3b6);}_0x526cf3(_0x40c424);});}function getLastMessageText(_0x14de77){return new BPromise(function(_0x5a101a,_0x3652a7){return db[_0x0a9e('0x29')][_0x0a9e('0x2a')]({'where':{'$and':[{'MailInteractionId':_0x14de77['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x0a9e('0x2b')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0x0a9e('0x2c'),'raw':!![]})[_0x0a9e('0x1a')](function(_0x1843b2){if(_0x1843b2&&_0x1843b2[_0x0a9e('0x2d')]){_0x14de77[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x1843b2[_0x0a9e('0x2d')]);}_0x5a101a(_0x14de77);})[_0x0a9e('0x30')](function(_0x1dbde2){_0x3652a7(_0x1dbde2);});});}function updateMailInteraction(_0x540530,_0x426950,_0x5d1e0e,_0x2407f9){return new BPromise(function(_0x3ae878,_0x1122db){return getInteractionUsers(_0x540530,_0x5d1e0e)[_0x0a9e('0x1a')](function(_0x25ce3a){return getInteractionTags(_0x25ce3a,_0x426950);})['then'](function(_0x66c1d2){if(_0x2407f9){_0x3ae878(getLastMessageText(_0x66c1d2));}else{_0x3ae878(_0x66c1d2);}})[_0x0a9e('0x30')](function(_0x40cb85){_0x1122db(_0x40cb85);});});}exports[_0x0a9e('0x31')]=function(_0x2b45ea,_0x409319){var _0x332d35={},_0x39e565={},_0x5583a4={'count':0x0,'rows':[]};var _0x44295a=_['map'](db[_0x0a9e('0x32')][_0x0a9e('0x33')],function(_0x2b7e7f){return{'name':_0x2b7e7f[_0x0a9e('0x34')],'type':_0x2b7e7f['type'][_0x0a9e('0x35')]};});_0x39e565[_0x0a9e('0x36')]=_[_0x0a9e('0x37')](_0x44295a,_0x0a9e('0x20'));_0x39e565['query']=_['keys'](_0x2b45ea[_0x0a9e('0x38')]);_0x39e565['filters']=_[_0x0a9e('0x39')](_0x39e565[_0x0a9e('0x36')],_0x39e565[_0x0a9e('0x38')]);_0x332d35[_0x0a9e('0x3a')]=_['intersection'](_0x39e565[_0x0a9e('0x36')],qs[_0x0a9e('0x3b')](_0x2b45ea[_0x0a9e('0x38')]['fields']));_0x332d35[_0x0a9e('0x3a')]=_0x332d35[_0x0a9e('0x3a')][_0x0a9e('0x3c')]?_0x332d35['attributes']:_0x39e565['model'];if(!_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x3d')]('nolimit')){_0x332d35[_0x0a9e('0x15')]=qs[_0x0a9e('0x15')](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x15')]);_0x332d35['offset']=qs['offset'](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x13')]);}_0x332d35['order']=qs[_0x0a9e('0x3e')](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x3e')]);_0x332d35['where']=qs[_0x0a9e('0x3f')](_[_0x0a9e('0x40')](_0x2b45ea[_0x0a9e('0x38')],_0x39e565[_0x0a9e('0x3f')]),_0x44295a);var _0x13cb1f=[];var _0xeaa5e5=squel[_0x0a9e('0x41')]()[_0x0a9e('0x42')]('id')[_0x0a9e('0x42')](_0x0a9e('0x20'))[_0x0a9e('0x42')](_0x0a9e('0x43'))[_0x0a9e('0x44')](_0x0a9e('0x45'));var _0x37f6cc=squel['select']()['field'](_0x0a9e('0x46'))[_0x0a9e('0x42')](_0x0a9e('0x47'))[_0x0a9e('0x42')](_0x0a9e('0x48'))[_0x0a9e('0x44')](_0x0a9e('0x49'),'ui')[_0x0a9e('0x4a')](_0x0a9e('0x4b'),'u',_0x0a9e('0x4c'));var _0x2c2cb0=squel[_0x0a9e('0x41')]()['from'](_0x0a9e('0x4d'),'i')[_0x0a9e('0x4a')](_0x0a9e('0x4e'),'c',_0x0a9e('0x4f'))[_0x0a9e('0x4a')](_0x0a9e('0x4b'),'o',_0x0a9e('0x50'))[_0x0a9e('0x4a')]('mail_accounts','a',_0x0a9e('0x51'))['left_join'](_0x0a9e('0x52'),'me',_0x0a9e('0x53'))[_0x0a9e('0x4a')]('mail_interaction_has_tags','it',_0x0a9e('0x54'))[_0x0a9e('0x4a')](_0x0a9e('0x45'),'t',_0x0a9e('0x55'));var _0x45c845=squel[_0x0a9e('0x56')]();var _0x45bf7f=[];var _0x5bbcde=squel[_0x0a9e('0x56')]();var _0x1bde3c;if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x57')]){_0x1bde3c=as[_0x0a9e('0x58')](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x57')]);var _0x19383e=_0x1bde3c[_0x0a9e('0x59')];for(var _0x58a5c2=0x0;_0x58a5c2<_0x1bde3c[_0x0a9e('0x5a')][_0x0a9e('0x3c')];_0x58a5c2++){var _0x4f7240=_0x1bde3c['conditions'][_0x58a5c2];var _0x5ddf84='i';var _0x1adfee=_[_0x0a9e('0x5b')](_0x44295a,[_0x0a9e('0x20'),_0x4f7240[_0x0a9e('0x42')]]);if(!_0x1adfee){switch(_0x4f7240[_0x0a9e('0x42')]){case _0x0a9e('0x5c'):if(_0x4f7240[_0x0a9e('0x5d')]==0x1){_0x2c2cb0[_0x0a9e('0x5e')]('`'+_0x4f7240['field']+'`\x20=\x200');}else{_0x2c2cb0['having']('`'+_0x4f7240[_0x0a9e('0x42')]+_0x0a9e('0x5f'));}break;case _0x0a9e('0x60'):if(_0x4f7240['operator']===_0x0a9e('0x61')){if(_0x4f7240[_0x0a9e('0x5d')]['split']('\x20')['length']>0x1){_0x45c845[_0x19383e](_0x0a9e('0x62'),qs['getFullTextValue'](_0x4f7240[_0x0a9e('0x5d')]),null);}else{var _0x4c3845='%'+_0x4f7240[_0x0a9e('0x5d')]+'%';_0x45c845[_0x19383e](_0x0a9e('0x63'),_0x4c3845,_0x4c3845,_0x4c3845);}}else{_0x1adfee=_[_0x0a9e('0x5b')](_0x44295a,['name',_0x0a9e('0x64')]);_0x4f7240[_0x0a9e('0x42')]='ContactId';_0x2244d6=as['buildExpression'](_0x5ddf84,_0x1adfee[_0x0a9e('0x65')],_0x4f7240);_0x45c845[_0x19383e](_0x2244d6[_0x0a9e('0x66')],_0x2244d6['value'][_0x0a9e('0x67')],_0x2244d6['value'][_0x0a9e('0x1c')]);}break;case'Tag':var _0xe22ccc=_0x4f7240['value']['split'](',')['map'](function(_0x2da03c){return Number(_0x2da03c);});_0xe22ccc['forEach'](function(_0x2f7092){_0x5bbcde['or'](_0x0a9e('0x68'),'%,'+_0x2f7092+',%');});_0x45bf7f=_[_0x0a9e('0x69')](_0x45bf7f,_0xe22ccc);break;case _0x0a9e('0x6a'):if(_0x4f7240[_0x0a9e('0x6b')]===_0x0a9e('0x61')){_0x45c845[_0x19383e](_0x0a9e('0x6c'),'%'+_0x4f7240[_0x0a9e('0x5d')]+'%',null);}else{_0x1adfee=_['find'](_0x44295a,[_0x0a9e('0x20'),_0x0a9e('0x6d')]);_0x4f7240[_0x0a9e('0x42')]=_0x0a9e('0x6d');_0x2244d6=as[_0x0a9e('0x6e')](_0x5ddf84,_0x1adfee[_0x0a9e('0x65')],_0x4f7240);_0x45c845[_0x19383e](_0x2244d6['text'],_0x2244d6[_0x0a9e('0x5d')][_0x0a9e('0x67')],_0x2244d6['value'][_0x0a9e('0x1c')]);}break;case'plainBody':_0x2244d6=as[_0x0a9e('0x6e')]('me',null,_0x4f7240);_0x45c845[_0x19383e](_0x2244d6['text'],_0x2244d6['value']['start'],_0x2244d6[_0x0a9e('0x5d')]['end']);break;}}else{var _0x2244d6=as[_0x0a9e('0x6e')](_0x5ddf84,_0x1adfee[_0x0a9e('0x65')],_0x4f7240);_0x45c845[_0x19383e](_0x2244d6[_0x0a9e('0x66')],_0x2244d6[_0x0a9e('0x5d')][_0x0a9e('0x67')],_0x2244d6['value'][_0x0a9e('0x1c')]);}}}else{var _0x5854cc=_(_0x2b45ea[_0x0a9e('0x38')])[_0x0a9e('0x6f')]()[_0x0a9e('0x37')](function(_0x5adf8f){return _[_0x0a9e('0x70')](_0x44295a,[_0x0a9e('0x20'),_0x5adf8f])?_0x5adf8f:undefined;})[_0x0a9e('0x71')]()[_0x0a9e('0x5d')]();if(!_['isEmpty'](_0x5854cc)){_0x5854cc[_0x0a9e('0x26')](function(_0xe05a5a){if(_0xe05a5a==='MailAccountId'){_0x2c2cb0[_0x0a9e('0x72')](_0x0a9e('0x73'),[][_0x0a9e('0x74')](_0x2b45ea[_0x0a9e('0x38')][_0xe05a5a]));}else if(_0xe05a5a===_0x0a9e('0x75')){var _0x4d4a35=JSON[_0x0a9e('0x76')](_0x2b45ea[_0x0a9e('0x38')][_0xe05a5a])[_0x0a9e('0x77')];var _0x47bb43=JSON[_0x0a9e('0x76')](_0x2b45ea['query'][_0xe05a5a])['$lte'];_0x2c2cb0[_0x0a9e('0x72')](_0x0a9e('0x78'),_0x4d4a35,_0x47bb43);}else{if(_0x2b45ea[_0x0a9e('0x38')][_0xe05a5a]===_0x0a9e('0x79')){_0x2c2cb0[_0x0a9e('0x72')]('i.'+_0xe05a5a+_0x0a9e('0x7a'));}else{_0x2c2cb0[_0x0a9e('0x72')]('i.'+_0xe05a5a+_0x0a9e('0x7b'),_0x2b45ea[_0x0a9e('0x38')][_0xe05a5a]);}}});}if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x7c')]){if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x7c')]==0x1){_0x2c2cb0[_0x0a9e('0x5e')](_0x0a9e('0x7d'));}else{_0x2c2cb0[_0x0a9e('0x5e')](_0x0a9e('0x7e'));}}if(_0x2b45ea[_0x0a9e('0x38')]['tag']){_0x45bf7f=_[_0x0a9e('0x7f')](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x80')])?_0x2b45ea['query'][_0x0a9e('0x80')]:new Array(_0x2b45ea[_0x0a9e('0x38')]['tag']);_0x45bf7f[_0x0a9e('0x26')](function(_0x56e31e){_0x5bbcde['or'](_0x0a9e('0x68'),'%,'+_0x56e31e+',%');});}if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x81')]){var _0x4a43a8=_0x2b45ea['query']['filter'][_0x0a9e('0x82')]('\x5c','\x5c\x5c')[_0x0a9e('0x82')](/'/g,'\x27\x27');if(qs[_0x0a9e('0x83')](_0x4a43a8)){_0x45c845['or'](_0x0a9e('0x84'),_0x4a43a8+'%');}else if(qs[_0x0a9e('0x85')](_0x4a43a8)){_0x45c845['or'](_0x0a9e('0x86'),_0x4a43a8+'%');}else{_0x45c845['or'](_0x0a9e('0x87'),qs[_0x0a9e('0x88')](_0x4a43a8))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x0a9e('0x88')](_0x4a43a8));}}}_0x2c2cb0[_0x0a9e('0x72')](_0x45c845);_0x2c2cb0[_0x0a9e('0x89')]('i.id');var _0x2bdc44={'type':db['Sequelize'][_0x0a9e('0x8a')][_0x0a9e('0x8b')],'raw':!![]};var _0x4c46c1=_0x2c2cb0[_0x0a9e('0x8c')]();_0x4c46c1[_0x0a9e('0x42')](_0x0a9e('0x8d'));_0x4c46c1[_0x0a9e('0x42')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x0a9e('0x5c'));if(_0x332d35[_0x0a9e('0x8e')]){_0x332d35[_0x0a9e('0x8e')][_0x0a9e('0x26')](function(_0x5b7fc3){var _0x109ccb=_0x5b7fc3[0x0]===_0x0a9e('0x8f')?_0x5b7fc3[0x0]:'i.'+_0x5b7fc3[0x0];_0x2c2cb0[_0x0a9e('0x8e')](_0x109ccb,_0x5b7fc3[0x1]===_0x0a9e('0x90')?![]:!![]);});}if(!_['isEmpty'](_0x45bf7f)){_0x2c2cb0[_0x0a9e('0x5e')](_0x5bbcde);_0x4c46c1[_0x0a9e('0x72')](_0x0a9e('0x91'),_0x45bf7f);}BPromise[_0x0a9e('0x92')]()[_0x0a9e('0x1a')](function(){if(!_0x1bde3c){if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x93')])return;_0x4c46c1[_0x0a9e('0x72')](_0x0a9e('0x94'));_0x2c2cb0[_0x0a9e('0x72')](_0x0a9e('0x94'));return;}if(_0x2b45ea[_0x0a9e('0x95')][_0x0a9e('0x96')]!==_0x0a9e('0x97'))return;return _0x2b45ea['user'][_0x0a9e('0x98')]({'attributes':['id'],'raw':!![]})[_0x0a9e('0x1a')](function(_0xc599b3){if(_['isEmpty'](_0xc599b3)){_0x4c46c1[_0x0a9e('0x72')](_0x0a9e('0x99'));_0x2c2cb0[_0x0a9e('0x72')](_0x0a9e('0x99'));}else{_0x4c46c1['where']('i.MailAccountId\x20IN\x20?',_[_0x0a9e('0x37')](_0xc599b3,'id'));_0x2c2cb0[_0x0a9e('0x72')]('i.MailAccountId\x20IN\x20?',_[_0x0a9e('0x37')](_0xc599b3,'id'));}});})['then'](function(){if(_0x2b45ea[_0x0a9e('0x95')][_0x0a9e('0x96')]==='agent'&&!_0x1bde3c&&!_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x93')])return[];return db[_0x0a9e('0x9a')][_0x0a9e('0x38')](_0x4c46c1[_0x0a9e('0x9b')](),_0x2bdc44);})[_0x0a9e('0x1a')](function(_0x444f1f){_0x5583a4['count']=_0x444f1f[_0x0a9e('0x3c')];if(_0x5583a4[_0x0a9e('0x16')]===0x0)return[];return db[_0x0a9e('0x9a')][_0x0a9e('0x38')](_0xeaa5e5['toString'](),_0x2bdc44)[_0x0a9e('0x1a')](function(_0xf0db1){_0x13cb1f=_['keyBy'](_0xf0db1,'id');_0x2bdc44=_[_0x0a9e('0x9c')](_0x2bdc44,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x3b')]){_0x332d35[_0x0a9e('0x3a')][_0x0a9e('0x26')](function(_0x5af453){_0x2c2cb0['field']('i.'+_0x5af453);});}else{_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0x9d'),_0x0a9e('0x5c'));_0x2c2cb0['field'](_0x0a9e('0x9e'),_0x0a9e('0x9f'));_0x2c2cb0['field']('a.mandatoryDisposition',_0x0a9e('0xa0'));_0x2c2cb0['field']('CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_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');_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0x8d'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa1'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa2'));_0x2c2cb0['field'](_0x0a9e('0xa3'));_0x2c2cb0['field'](_0x0a9e('0xa4'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa5'));_0x2c2cb0[_0x0a9e('0x42')]('i.lastMsgAt');_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa6'));_0x2c2cb0[_0x0a9e('0x42')]('i.subject');_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa7'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa8'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa9'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xaa'));_0x2c2cb0['field'](_0x0a9e('0xab'));_0x2c2cb0[_0x0a9e('0x42')]('i.ContactId');_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xac'));_0x2c2cb0[_0x0a9e('0x42')]('i.UserId');_0x2c2cb0[_0x0a9e('0x42')]('c.firstName',_0x0a9e('0xad'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xae'),_0x0a9e('0xaf'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb0'),_0x0a9e('0xb1'));_0x2c2cb0[_0x0a9e('0x42')]('c.phone',_0x0a9e('0xb2'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb3'),_0x0a9e('0xb4'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb5'),_0x0a9e('0xb6'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb7'),_0x0a9e('0xb8'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb9'),_0x0a9e('0xba'));_0x2c2cb0['field'](_0x0a9e('0xbb'),_0x0a9e('0x28'));}if(_0x332d35[_0x0a9e('0x15')])_0x2c2cb0[_0x0a9e('0x15')](_0x332d35[_0x0a9e('0x15')]);if(_0x332d35['offset'])_0x2c2cb0[_0x0a9e('0x13')](_0x332d35[_0x0a9e('0x13')]);return db['sequelize'][_0x0a9e('0x38')](_0x2c2cb0['toString'](),_0x2bdc44);})[_0x0a9e('0x1a')](function(_0x27041d){if(_0x27041d[_0x0a9e('0x3c')]>0x0)_0x37f6cc[_0x0a9e('0x72')]('ui.MailInteractionId\x20IN\x20?',_[_0x0a9e('0x37')](_0x27041d,'id'));return db['sequelize'][_0x0a9e('0x38')](_0x37f6cc[_0x0a9e('0x9b')](),_0x2bdc44)['then'](function(_0x231c6a){var _0x63c9f7=_[_0x0a9e('0xbc')](_0x231c6a,'MailInteractionId');var _0x4c788f=[];return db[_0x0a9e('0xbd')][_0x0a9e('0x2a')]({'attributes':[_0x0a9e('0xbe')],'raw':!![]})[_0x0a9e('0x1a')](function(_0x3f2f40){var _0x2450a8=_0x3f2f40[_0x0a9e('0xbe')];_0x27041d[_0x0a9e('0x26')](function(_0x3f8124){_0x4c788f['push'](updateMailInteraction(_0x3f8124,_0x13cb1f,_0x63c9f7,_0x2450a8));});return BPromise[_0x0a9e('0xbf')](_0x4c788f);});});});})['then'](function(_0x287324){_0x5583a4[_0x0a9e('0xc0')]=_0x287324;return _0x5583a4;})[_0x0a9e('0x1a')](respondWithFilteredResult(_0x409319,_0x332d35))[_0x0a9e('0x30')](handleError(_0x409319,null));};exports[_0x0a9e('0xc1')]=function(_0x4e7273,_0x436313){var _0x4667bf={'raw':![],'where':{'id':_0x4e7273[_0x0a9e('0xc2')]['id']}},_0x2791c5={};_0x2791c5[_0x0a9e('0x36')]=_['keys'](db['MailInteraction'][_0x0a9e('0x33')]);_0x2791c5['query']=_[_0x0a9e('0x6f')](_0x4e7273[_0x0a9e('0x38')]);_0x2791c5[_0x0a9e('0x3f')]=_[_0x0a9e('0x39')](_0x2791c5[_0x0a9e('0x36')],_0x2791c5[_0x0a9e('0x38')]);_0x4667bf['attributes']=_['intersection'](_0x2791c5[_0x0a9e('0x36')],qs['fields'](_0x4e7273[_0x0a9e('0x38')]['fields']));_0x4667bf[_0x0a9e('0x3a')]=_0x4667bf['attributes']['length']?_0x4667bf[_0x0a9e('0x3a')]:_0x2791c5[_0x0a9e('0x36')];if(_0x4e7273['query'][_0x0a9e('0xc3')]){_0x4667bf[_0x0a9e('0xc4')]=[{'all':!![]}];}_0x4667bf=_[_0x0a9e('0x9c')]({},_0x4667bf,_0x4e7273[_0x0a9e('0xc5')]);return db[_0x0a9e('0x32')]['find'](_0x4667bf)['then'](handleEntityNotFound(_0x436313,null))[_0x0a9e('0x1a')](respondWithResult(_0x436313,null))[_0x0a9e('0x30')](handleError(_0x436313,null));};exports[_0x0a9e('0xc6')]=function(_0x24beb6,_0x59303b){return db['MailInteraction'][_0x0a9e('0xc6')](_0x24beb6[_0x0a9e('0xc7')],{})['then'](respondWithResult(_0x59303b,0xc9))[_0x0a9e('0x30')](handleError(_0x59303b,null));};exports[_0x0a9e('0x19')]=function(_0xcacabb,_0x2427d5){if(_0xcacabb[_0x0a9e('0xc7')]['id']){delete _0xcacabb[_0x0a9e('0xc7')]['id'];}return db[_0x0a9e('0x32')][_0x0a9e('0x5b')]({'where':{'id':_0xcacabb[_0x0a9e('0xc2')]['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x2427d5,null))['then'](saveUpdates(_0xcacabb[_0x0a9e('0xc7')],null))[_0x0a9e('0x1a')](respondWithResult(_0x2427d5,null))[_0x0a9e('0x30')](handleError(_0x2427d5,null));};exports[_0x0a9e('0x1b')]=function(_0x1d0b02,_0x547e37){return db['MailInteraction'][_0x0a9e('0x5b')]({'where':{'id':_0x1d0b02[_0x0a9e('0xc2')]['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x547e37,null))[_0x0a9e('0x1a')](removeEntity(_0x547e37,null))[_0x0a9e('0x30')](handleError(_0x547e37,null));};exports['describe']=function(_0x1339d0,_0x3c775a){return db[_0x0a9e('0x32')]['describe']()[_0x0a9e('0x1a')](respondWithResult(_0x3c775a,null))['catch'](handleError(_0x3c775a,null));};exports[_0x0a9e('0xc8')]=function(_0x4799d4,_0x25b745){return db[_0x0a9e('0x29')][_0x0a9e('0x5b')]({'where':{'id':_0x4799d4['params']['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x25b745,null))['then'](function(_0x4383da){if(_0x4383da){return _0x4383da[_0x0a9e('0xc8')](_0x4799d4[_0x0a9e('0xc7')][_0x0a9e('0xc9')],_[_0x0a9e('0xca')](_0x4799d4[_0x0a9e('0xc7')],[_0x0a9e('0xc9'),'id'])||{});}})[_0x0a9e('0x1a')](respondWithResult(_0x25b745,null))[_0x0a9e('0x30')](handleError(_0x25b745,null));};exports[_0x0a9e('0xcb')]=function(_0x4262d0,_0xc876d4){var _0x2415fe={'raw':![],'where':{}};var _0x399def={};var _0x98c62c={'count':0x0,'rows':[]};return db[_0x0a9e('0x32')]['findOne']({'where':{'id':_0x4262d0['params']['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0xc876d4,null))['then'](function(_0x1d999b){if(_0x1d999b){_0x399def[_0x0a9e('0x36')]=_['keys'](db[_0x0a9e('0x29')][_0x0a9e('0x33')]);_0x399def[_0x0a9e('0x38')]=_[_0x0a9e('0x6f')](_0x4262d0['query']);_0x399def[_0x0a9e('0x3f')]=_[_0x0a9e('0x39')](_0x399def[_0x0a9e('0x36')],_0x399def[_0x0a9e('0x38')]);_0x2415fe['attributes']=_[_0x0a9e('0x39')](_0x399def[_0x0a9e('0x36')],qs[_0x0a9e('0x3b')](_0x4262d0['query'][_0x0a9e('0x3b')]));_0x2415fe[_0x0a9e('0x3a')]=_0x2415fe[_0x0a9e('0x3a')]['length']?_0x2415fe[_0x0a9e('0x3a')]:_0x399def[_0x0a9e('0x36')];if(!_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x3d')](_0x0a9e('0xcc'))){_0x2415fe['limit']=qs[_0x0a9e('0x15')](_0x4262d0[_0x0a9e('0x38')]['limit']);_0x2415fe[_0x0a9e('0x13')]=qs[_0x0a9e('0x13')](_0x4262d0[_0x0a9e('0x38')]['offset']);}_0x2415fe['order']=qs['sort'](_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x3e')]);_0x2415fe['where']=qs[_0x0a9e('0x3f')](_[_0x0a9e('0x40')](_0x4262d0[_0x0a9e('0x38')],_0x399def['filters']));_0x2415fe[_0x0a9e('0x72')][_0x0a9e('0xcd')]=_0x1d999b['id'];if(_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x81')]){_0x2415fe[_0x0a9e('0x72')]=_[_0x0a9e('0x9c')](_0x2415fe[_0x0a9e('0x72')],{'$or':_[_0x0a9e('0x37')](_0x2415fe[_0x0a9e('0x3a')],function(_0x5a1848){var _0x43c397={};_0x43c397[_0x5a1848]={'$like':'%'+_0x4262d0['query'][_0x0a9e('0x81')]+'%'};return _0x43c397;})});}if(_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x77')]){var _0x3cf222=_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x77')]['split'](',');var _0x1a0314={};_0x1a0314[_0x3cf222[0x0]]={'$gte':moment(_0x3cf222[0x1])[_0x0a9e('0xce')](_0x0a9e('0xcf'))};_0x2415fe[_0x0a9e('0x72')]=_['merge'](_0x2415fe[_0x0a9e('0x72')],_0x1a0314);}_0x2415fe=_[_0x0a9e('0x9c')]({},_0x2415fe,_0x4262d0[_0x0a9e('0xc5')]);return db[_0x0a9e('0x29')][_0x0a9e('0x16')]({'where':_0x2415fe[_0x0a9e('0x72')]})[_0x0a9e('0x1a')](function(_0x25931e){_0x98c62c[_0x0a9e('0x16')]=_0x25931e;if(_0x4262d0[_0x0a9e('0x38')]['includeAll']){_0x2415fe[_0x0a9e('0xc4')]=[{'all':!![]}];}return db[_0x0a9e('0x29')][_0x0a9e('0xd0')](_0x2415fe);})[_0x0a9e('0x1a')](function(_0xea8bd1){if(_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0xd1')]===_0x0a9e('0xd2')){for(var _0x566b90=0x0;_0x566b90<_0xea8bd1[_0x0a9e('0x3c')];_0x566b90++){_0xea8bd1[_0x566b90][_0x0a9e('0xc7')]=juice(_0xea8bd1[_0x566b90][_0x0a9e('0xc7')]);}}_0x98c62c['rows']=_0xea8bd1;return _0x98c62c;});}})[_0x0a9e('0x1a')](respondWithFilteredResult(_0xc876d4,_0x2415fe))[_0x0a9e('0x30')](handleError(_0xc876d4,null));};exports[_0x0a9e('0xd3')]=function(_0x97d5b5,_0x370b5e){return db[_0x0a9e('0x32')][_0x0a9e('0x5b')]({'where':{'id':_0x97d5b5[_0x0a9e('0xc2')]['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x370b5e,null))[_0x0a9e('0x1a')](function(_0x5a7dad){if(_0x5a7dad){return _0x5a7dad[_0x0a9e('0xd4')](_0x97d5b5[_0x0a9e('0xc7')][_0x0a9e('0xc9')],_[_0x0a9e('0xca')](_0x97d5b5[_0x0a9e('0xc7')],[_0x0a9e('0xc9'),'id'])||{})['spread'](function(){return db[_0x0a9e('0xd5')]['findAll']({'attributes':['id','name','color'],'where':{'id':_0x97d5b5[_0x0a9e('0xc7')][_0x0a9e('0xc9')]}});})[_0x0a9e('0x1a')](function(_0x2a07d0){socket['emit'](_0x0a9e('0xd6'),{'id':Number(_0x97d5b5[_0x0a9e('0xc2')]['id']),'tags':_0x2a07d0||[]});return{'id':Number(_0x97d5b5[_0x0a9e('0xc2')]['id']),'tags':_0x2a07d0||[]};});}})[_0x0a9e('0x1a')](respondWithResult(_0x370b5e,null))[_0x0a9e('0x30')](handleError(_0x370b5e,null));};exports['removeTags']=function(_0x57b1b1,_0x9484c8){return db[_0x0a9e('0x32')][_0x0a9e('0x5b')]({'where':{'id':_0x57b1b1['params']['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x9484c8,null))[_0x0a9e('0x1a')](function(_0x422f0a){if(_0x422f0a){return _0x422f0a['removeTags'](_0x57b1b1[_0x0a9e('0x38')][_0x0a9e('0xc9')]);}})[_0x0a9e('0x1a')](respondWithStatusCode(_0x9484c8,null))['catch'](handleError(_0x9484c8,null));};exports[_0x0a9e('0xd7')]=function(_0x336b30,_0x3b7213){var _0x549e03=moment()['unix']()['toString']();var _0x3b04fd=path[_0x0a9e('0xd8')](config[_0x0a9e('0xd9')],_0x0a9e('0xda'),'files',_0x0a9e('0xdb'));var _0x532424=path[_0x0a9e('0xd8')](config[_0x0a9e('0xd9')],_0x0a9e('0xda'),'files',_0x0a9e('0xdc'));var _0x33a26c=path[_0x0a9e('0xd8')](_0x3b04fd,_0x549e03);var _0x580dd6=util[_0x0a9e('0xce')]('transcript-%d-%s.zip',_0x336b30[_0x0a9e('0xc2')]['id'],_0x549e03);var _0x5c57e1=path[_0x0a9e('0xd8')](_0x3b04fd,_0x580dd6);var _0x57b7d4=[];if(_0x336b30[_0x0a9e('0x38')][_0x0a9e('0xdc')]){_0x57b7d4[_0x0a9e('0x27')]({'model':db[_0x0a9e('0xdd')],'as':_0x0a9e('0xde'),'raw':!![]});}var _0x251dd9=[{'model':db[_0x0a9e('0x29')],'as':'Messages','attributes':['id',_0x0a9e('0xc7'),_0x0a9e('0x44'),'to','cc','bcc',_0x0a9e('0xdf'),_0x0a9e('0x75')],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x57b7d4}];return db[_0x0a9e('0x32')][_0x0a9e('0x5b')]({'where':{'id':_0x336b30[_0x0a9e('0xc2')]['id']},'include':_0x251dd9})['then'](handleEntityNotFound(_0x3b7213,null))[_0x0a9e('0x1a')](function(_0xf49ed4){if(_0xf49ed4&&_0xf49ed4[_0x0a9e('0xe0')]){var _0x3f0d64=_0xf49ed4[_0x0a9e('0xe1')]({'plain':!![]});fs[_0x0a9e('0xe2')](_0x33a26c);return BPromise[_0x0a9e('0xe3')](_0x3f0d64[_0x0a9e('0xe0')],function(_0x22767f,_0x426c3c){var _0x56e148={'from':_0x22767f[_0x0a9e('0x44')],'to':_0x22767f['to'],'subject':_0x22767f['subject'],'html':_0x22767f[_0x0a9e('0xc7')],'headers':{'Date':moment(_0x22767f[_0x0a9e('0x75')])[_0x0a9e('0xce')](_0x0a9e('0xe4'))},'attachments':[]};if(_0x22767f['cc']){_0x56e148[_0x0a9e('0xe5')]['Cc']=_0x22767f['cc'];}if(_0x22767f[_0x0a9e('0xe6')]){_0x56e148['headers'][_0x0a9e('0xe7')]=_0x22767f[_0x0a9e('0xe6')];}return new BPromise(function(_0x2977a7,_0x55a599){if(_0x22767f[_0x0a9e('0xde')]){for(var _0x402544=0x0;_0x402544<_0x22767f[_0x0a9e('0xde')][_0x0a9e('0x3c')];_0x402544++){var _0x31e1e0=_0x22767f[_0x0a9e('0xde')][_0x402544];var _0x1e93f5=path['join'](_0x532424,_0x31e1e0[_0x0a9e('0xe8')]);if(fs[_0x0a9e('0xe9')](_0x1e93f5)){_0x56e148[_0x0a9e('0xdc')][_0x0a9e('0x27')]({'name':_0x31e1e0[_0x0a9e('0x20')],'contentType':_0x31e1e0[_0x0a9e('0x65')],'data':fs[_0x0a9e('0xea')](_0x1e93f5)});}}}emlformat['build'](_0x56e148,function(_0x5c8720,_0x10aa22){if(_0x5c8720)return _0x55a599(_0x5c8720);fs[_0x0a9e('0xeb')](path[_0x0a9e('0xd8')](_0x33a26c,util[_0x0a9e('0xce')](_0x0a9e('0xec'),_0x426c3c)),_0x10aa22);return _0x2977a7(_0x10aa22);});});})[_0x0a9e('0x1a')](function(){return new BPromise(function(_0x609711,_0x584854){zipdir(_0x33a26c,{'saveTo':_0x5c57e1},function(_0x39ea62,_0x1d7fc4){if(_0x39ea62)return _0x584854(_0x39ea62);return _0x609711(_0x1d7fc4);});})[_0x0a9e('0x1a')](function(){return new BPromise(function(_0x2675a5,_0x1b1757){rimraf(_0x33a26c,function(_0x3c6082){if(_0x3c6082)_0x1b1757(_0x3c6082);return _0x2675a5();});});})[_0x0a9e('0x1a')](function(){return _0x3b7213['download'](_0x5c57e1,_0x580dd6,function(_0x311288){if(!_0x311288)fs[_0x0a9e('0xed')](_0x5c57e1);});});});}else{return _0x3b7213[_0x0a9e('0x1d')](0xc8);}})['catch'](handleError(_0x3b7213,null));}; \ No newline at end of file +var _0xb10b=['Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Setting','findOne','enableEmailPreview','show','params','rawAttributes','includeAll','include','merge','options','create','body','describe','addMessage','ids','omit','getMessages','nolimit','pick','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','rows','spread','emit','mailInteractionTags:save','removeTags','download','unix','join','server','tmp','root','files','attachments','transcript-%d-%s.zip','Attachment','Attachments','Messages','subject','get','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','basename','existsSync','build','message%d.eml','unlinkSync','eml-format','zip-dir','moment','bluebird','path','lodash','squel','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','then','error','stack','name','send','fullname','TagIds','Tags','split','forEach','push','MailMessage','out','-id','trimStart','plainBody','catch','index','map','MailInteraction','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','field','color','tools_tags','u.id','ui.MailInteractionId','from','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','select','mail_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','expr','search','parseSearch','conditions','length','find','unreadMessages','value','having','`\x20>\x200','Contact','operator','$substring','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','buildExpression','type','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','some','compact','isEmpty','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','isEmail','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','MailAccountId','i.MailAccountId\x20IS\x20NOT\x20NULL','role','getMailAccounts','i.MailAccountId\x20IS\x20NULL','agent','toString','sequelize','keyBy','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_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.createdAt','i.updatedAt','i.closed','i.attach','i.lastMsgAt','i.subject','i.disposition','i.secondDisposition','i.thirdDisposition','i.ContactId','i.MailAccountId','Contact.firstName','c.email'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0xb10b,0x12a));var _0xbb10=function(_0x545e64,_0x356844){_0x545e64=_0x545e64-0x0;var _0x13dbef=_0xb10b[_0x545e64];return _0x13dbef;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var BPromise=require(_0xbb10('0x3'));var util=require('util');var path=require(_0xbb10('0x4'));var fs=require('fs');var _=require(_0xbb10('0x5'));var squel=require(_0xbb10('0x6'));var juice=require(_0xbb10('0x7'));var Redis=require(_0xbb10('0x8'));var qs=require(_0xbb10('0x9'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0xbb10('0xa'))(_0xbb10('0xb'));var config=require('../../config/environment');var db=require(_0xbb10('0xc'))['db'];config[_0xbb10('0xd')]=_[_0xbb10('0xe')](config[_0xbb10('0xd')],{'host':_0xbb10('0xf'),'port':0x18eb});var socket=require(_0xbb10('0x10'))(new Redis(config[_0xbb10('0xd')]));require(_0xbb10('0x11'))['register'](socket);function respondWithStatusCode(_0x4e47f8,_0x20bd61){_0x20bd61=_0x20bd61||0xcc;return function(_0x118a74){if(_0x118a74){return _0x4e47f8[_0xbb10('0x12')](_0x20bd61);}return _0x4e47f8['status'](_0x20bd61)[_0xbb10('0x13')]();};}function respondWithResult(_0x5be7e0,_0x44fb19){_0x44fb19=_0x44fb19||0xc8;return function(_0x916a32){if(_0x916a32){return _0x5be7e0[_0xbb10('0x14')](_0x44fb19)[_0xbb10('0x15')](_0x916a32);}};}function respondWithFilteredResult(_0x442548,_0x147230){return function(_0x58a612){if(_0x58a612){var _0x26e021=typeof _0x147230[_0xbb10('0x16')]===_0xbb10('0x17')&&typeof _0x147230[_0xbb10('0x18')]===_0xbb10('0x17');var _0x2f2ebf=_0x58a612[_0xbb10('0x19')];var _0x36b5e8=_0x26e021?0x0:_0x147230[_0xbb10('0x16')];var _0x2b184e=_0x26e021?_0x58a612['count']:_0x147230[_0xbb10('0x16')]+_0x147230[_0xbb10('0x18')];var _0x133ac2;if(_0x2b184e>=_0x2f2ebf){_0x2b184e=_0x2f2ebf;_0x133ac2=0xc8;}else{_0x133ac2=0xce;}_0x442548[_0xbb10('0x14')](_0x133ac2);return _0x442548[_0xbb10('0x1a')](_0xbb10('0x1b'),_0x36b5e8+'-'+_0x2b184e+'/'+_0x2f2ebf)[_0xbb10('0x15')](_0x58a612);}return null;};}function saveUpdates(_0x30efc6){return function(_0xbf2906){if(_0xbf2906){return _0xbf2906[_0xbb10('0x1c')](_0x30efc6)['then'](function(_0x5ff0cf){return _0x5ff0cf;});}return null;};}function removeEntity(_0x19f48d){return function(_0x388fab){if(_0x388fab){return _0x388fab[_0xbb10('0x1d')]()[_0xbb10('0x1e')](function(){_0x19f48d[_0xbb10('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12f888){return function(_0x12ef77){if(!_0x12ef77){_0x12f888['sendStatus'](0x194);}return _0x12ef77;};}function handleError(_0x4c4b0d,_0x8e2b97){_0x8e2b97=_0x8e2b97||0x1f4;return function(_0x311abe){logger[_0xbb10('0x1f')](_0x311abe[_0xbb10('0x20')]);if(_0x311abe[_0xbb10('0x21')]){delete _0x311abe[_0xbb10('0x21')];}_0x4c4b0d[_0xbb10('0x14')](_0x8e2b97)[_0xbb10('0x22')](_0x311abe);};}function getInteractionUsers(_0x7f2377,_0x395404){return new BPromise(function(_0x3ba6cd,_0x26ad93){try{if(_0x395404[_0x7f2377['id']]){_0x7f2377['Users']=_['map'](_0x395404[_0x7f2377['id']],function(_0x4fb5e0){return{'id':_0x4fb5e0['id'],'fullname':_0x4fb5e0[_0xbb10('0x23')]};});}}catch(_0x3c5ae7){_0x26ad93(_0x3c5ae7);}_0x3ba6cd(_0x7f2377);});}function getInteractionTags(_0x2c89b9,_0x4e25ff){return new BPromise(function(_0x2fdde9,_0x24d586){try{if(_0x2c89b9[_0xbb10('0x24')]){_0x2c89b9[_0xbb10('0x25')]=[];_0x2c89b9[_0xbb10('0x24')][_0xbb10('0x26')](',')[_0xbb10('0x27')](function(_0x4aabb9){_0x2c89b9[_0xbb10('0x25')][_0xbb10('0x28')](_0x4e25ff[_0x4aabb9]);});}delete _0x2c89b9[_0xbb10('0x24')];}catch(_0x2e0249){_0x24d586(_0x2e0249);}_0x2fdde9(_0x2c89b9);});}function getLastMessageText(_0x1d30aa){return new BPromise(function(_0x2ff4c1,_0x5d5c80){return db[_0xbb10('0x29')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x1d30aa['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xbb10('0x2a')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0xbb10('0x2b'),'raw':!![]})[_0xbb10('0x1e')](function(_0x1b59f9){if(_0x1b59f9&&_0x1b59f9['plainBody']){_0x1d30aa['lastMsgText']=_[_0xbb10('0x2c')](_0x1b59f9[_0xbb10('0x2d')]);}_0x2ff4c1(_0x1d30aa);})['catch'](function(_0x359ad4){_0x5d5c80(_0x359ad4);});});}function updateMailInteraction(_0x37dde7,_0x2f653f,_0x1c0b57,_0x37a83f){return new BPromise(function(_0x138bc6,_0xf85197){return getInteractionUsers(_0x37dde7,_0x1c0b57)['then'](function(_0x25acb3){return getInteractionTags(_0x25acb3,_0x2f653f);})[_0xbb10('0x1e')](function(_0x441d15){if(_0x37a83f){_0x138bc6(getLastMessageText(_0x441d15));}else{_0x138bc6(_0x441d15);}})[_0xbb10('0x2e')](function(_0xfb2c5e){_0xf85197(_0xfb2c5e);});});}exports[_0xbb10('0x2f')]=function(_0x188cbd,_0x10202c){var _0x3c8d7d={},_0x56943c={},_0x2b5352={'count':0x0,'rows':[]};var _0x150107=_[_0xbb10('0x30')](db[_0xbb10('0x31')]['rawAttributes'],function(_0x111762){return{'name':_0x111762['fieldName'],'type':_0x111762['type'][_0xbb10('0x32')]};});_0x56943c[_0xbb10('0x33')]=_[_0xbb10('0x30')](_0x150107,_0xbb10('0x21'));_0x56943c[_0xbb10('0x34')]=_[_0xbb10('0x35')](_0x188cbd['query']);_0x56943c[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x56943c['model'],_0x56943c['query']);_0x3c8d7d['attributes']=_[_0xbb10('0x37')](_0x56943c[_0xbb10('0x33')],qs[_0xbb10('0x38')](_0x188cbd['query'][_0xbb10('0x38')]));_0x3c8d7d[_0xbb10('0x39')]=_0x3c8d7d[_0xbb10('0x39')]['length']?_0x3c8d7d[_0xbb10('0x39')]:_0x56943c[_0xbb10('0x33')];if(!_0x188cbd[_0xbb10('0x34')][_0xbb10('0x3a')]('nolimit')){_0x3c8d7d[_0xbb10('0x18')]=qs[_0xbb10('0x18')](_0x188cbd['query'][_0xbb10('0x18')]);_0x3c8d7d[_0xbb10('0x16')]=qs[_0xbb10('0x16')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x16')]);}_0x3c8d7d[_0xbb10('0x3b')]=qs['sort'](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x3c')]);_0x3c8d7d[_0xbb10('0x3d')]=qs[_0xbb10('0x36')](_['pick'](_0x188cbd[_0xbb10('0x34')],_0x56943c[_0xbb10('0x36')]),_0x150107);var _0x23dc18=[];var _0x403beb=squel['select']()[_0xbb10('0x3e')]('id')[_0xbb10('0x3e')]('name')['field'](_0xbb10('0x3f'))['from'](_0xbb10('0x40'));var _0x180933=squel['select']()[_0xbb10('0x3e')](_0xbb10('0x41'))[_0xbb10('0x3e')]('u.fullname')[_0xbb10('0x3e')](_0xbb10('0x42'))[_0xbb10('0x43')](_0xbb10('0x44'),'ui')[_0xbb10('0x45')](_0xbb10('0x46'),'u',_0xbb10('0x47'));var _0x3efa96=squel[_0xbb10('0x48')]()[_0xbb10('0x43')](_0xbb10('0x49'),'i')[_0xbb10('0x45')]('cm_contacts','c',_0xbb10('0x4a'))[_0xbb10('0x45')]('users','o',_0xbb10('0x4b'))[_0xbb10('0x45')](_0xbb10('0x4c'),'a',_0xbb10('0x4d'))[_0xbb10('0x45')](_0xbb10('0x4e'),'me',_0xbb10('0x4f'))['left_join']('mail_interaction_has_tags','it',_0xbb10('0x50'))[_0xbb10('0x45')](_0xbb10('0x40'),'t','t.id\x20=\x20it.TagId');var _0x5f0c12=squel[_0xbb10('0x51')]();var _0x34cf4e=[];var _0x1bd054=squel[_0xbb10('0x51')]();var _0x10159b;if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x52')]){_0x10159b=as[_0xbb10('0x53')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x52')]);var _0x550111=_0x10159b['sqlOperator'];for(var _0x412e13=0x0;_0x412e13<_0x10159b[_0xbb10('0x54')][_0xbb10('0x55')];_0x412e13++){var _0xb014b0=_0x10159b[_0xbb10('0x54')][_0x412e13];var _0x440f9e='i';var _0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),_0xb014b0[_0xbb10('0x3e')]]);if(!_0x358e7e){switch(_0xb014b0[_0xbb10('0x3e')]){case _0xbb10('0x57'):if(_0xb014b0[_0xbb10('0x58')]==0x1){_0x3efa96[_0xbb10('0x59')]('`'+_0xb014b0[_0xbb10('0x3e')]+'`\x20=\x200');}else{_0x3efa96[_0xbb10('0x59')]('`'+_0xb014b0['field']+_0xbb10('0x5a'));}break;case _0xbb10('0x5b'):if(_0xb014b0[_0xbb10('0x5c')]===_0xbb10('0x5d')){if(_0xb014b0[_0xbb10('0x58')][_0xbb10('0x26')]('\x20')[_0xbb10('0x55')]>0x1){_0x5f0c12[_0x550111](_0xbb10('0x5e'),qs[_0xbb10('0x5f')](_0xb014b0[_0xbb10('0x58')]),null);}else{var _0x44a056='%'+_0xb014b0[_0xbb10('0x58')]+'%';_0x5f0c12[_0x550111](_0xbb10('0x60'),_0x44a056,_0x44a056,_0x44a056);}}else{_0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),'ContactId']);_0xb014b0[_0xbb10('0x3e')]=_0xbb10('0x61');_0x155dc5=as[_0xbb10('0x62')](_0x440f9e,_0x358e7e[_0xbb10('0x63')],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5[_0xbb10('0x64')],_0x155dc5[_0xbb10('0x58')]['start'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x13')]);}break;case _0xbb10('0x65'):var _0x14fed3=_0xb014b0[_0xbb10('0x58')][_0xbb10('0x26')](',')[_0xbb10('0x30')](function(_0x12ec18){return Number(_0x12ec18);});_0x14fed3[_0xbb10('0x27')](function(_0x40c4fb){_0x1bd054['or'](_0xbb10('0x66'),'%,'+_0x40c4fb+',%');});_0x34cf4e=_[_0xbb10('0x67')](_0x34cf4e,_0x14fed3);break;case _0xbb10('0x68'):if(_0xb014b0['operator']==='$substring'){_0x5f0c12[_0x550111](_0xbb10('0x69'),'%'+_0xb014b0[_0xbb10('0x58')]+'%',null);}else{_0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),'UserId']);_0xb014b0['field']=_0xbb10('0x6a');_0x155dc5=as[_0xbb10('0x62')](_0x440f9e,_0x358e7e[_0xbb10('0x63')],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5[_0xbb10('0x64')],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x6b')],_0x155dc5[_0xbb10('0x58')]['end']);}break;case _0xbb10('0x2d'):_0x155dc5=as[_0xbb10('0x62')]('me',null,_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5['text'],_0x155dc5['value']['start'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x13')]);break;}}else{var _0x155dc5=as['buildExpression'](_0x440f9e,_0x358e7e['type'],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5['text'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x6b')],_0x155dc5[_0xbb10('0x58')]['end']);}}}else{var _0xa1bbd9=_(_0x188cbd[_0xbb10('0x34')])['keys']()['map'](function(_0x27d7b9){return _[_0xbb10('0x6c')](_0x150107,[_0xbb10('0x21'),_0x27d7b9])?_0x27d7b9:undefined;})[_0xbb10('0x6d')]()['value']();if(!_[_0xbb10('0x6e')](_0xa1bbd9)){_0xa1bbd9[_0xbb10('0x27')](function(_0xa7179d){if(_0xa7179d==='MailAccountId'){_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x6f'),[][_0xbb10('0x70')](_0x188cbd['query'][_0xa7179d]));}else if(_0xa7179d===_0xbb10('0x71')){var _0x31e85e=JSON[_0xbb10('0x72')](_0x188cbd[_0xbb10('0x34')][_0xa7179d])['$gte'];var _0x251417=JSON[_0xbb10('0x72')](_0x188cbd[_0xbb10('0x34')][_0xa7179d])[_0xbb10('0x73')];_0x3efa96['where'](_0xbb10('0x74'),_0x31e85e,_0x251417);}else{if(_0x188cbd[_0xbb10('0x34')][_0xa7179d]===_0xbb10('0x75')){_0x3efa96[_0xbb10('0x3d')]('i.'+_0xa7179d+_0xbb10('0x76'));}else{_0x3efa96[_0xbb10('0x3d')]('i.'+_0xa7179d+_0xbb10('0x77'),_0x188cbd['query'][_0xa7179d]);}}});}if(_0x188cbd['query']['read']){if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x78')]==0x1){_0x3efa96[_0xbb10('0x59')]('`unreadMessages`\x20=\x200');}else{_0x3efa96['having'](_0xbb10('0x79'));}}if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')]){_0x34cf4e=_[_0xbb10('0x7b')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')])?_0x188cbd['query'][_0xbb10('0x7a')]:new Array(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')]);_0x34cf4e[_0xbb10('0x27')](function(_0x2aaaa6){_0x1bd054['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2aaaa6+',%');});}if(_0x188cbd['query']['filter']){var _0x329da7=_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7c')][_0xbb10('0x7d')]('\x5c','\x5c\x5c')[_0xbb10('0x7d')](/'/g,'\x27\x27');if(qs[_0xbb10('0x7e')](_0x329da7)){_0x5f0c12['or']('i.id\x20LIKE\x20?',_0x329da7+'%');}else if(qs[_0xbb10('0x7f')](_0x329da7)){_0x5f0c12['or']('c.email\x20LIKE\x20?',_0x329da7+'%');}else{_0x5f0c12['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x329da7))['or'](_0xbb10('0x80'),qs[_0xbb10('0x5f')](_0x329da7));}}}_0x3efa96[_0xbb10('0x3d')](_0x5f0c12);_0x3efa96[_0xbb10('0x81')]('i.id');var _0x122d38={'type':db['Sequelize']['QueryTypes'][_0xbb10('0x82')],'raw':!![]};var _0xfe3db0=_0x3efa96[_0xbb10('0x83')]();_0xfe3db0[_0xbb10('0x3e')](_0xbb10('0x84'));_0xfe3db0['field'](_0xbb10('0x85'),_0xbb10('0x57'));if(_0x3c8d7d[_0xbb10('0x3b')]){_0x3c8d7d[_0xbb10('0x3b')][_0xbb10('0x27')](function(_0x27f42f){var _0x174395=_0x27f42f[0x0]==='contactName'?_0x27f42f[0x0]:'i.'+_0x27f42f[0x0];_0x3efa96[_0xbb10('0x3b')](_0x174395,_0x27f42f[0x1]===_0xbb10('0x86')?![]:!![]);});}if(!_[_0xbb10('0x6e')](_0x34cf4e)){_0x3efa96[_0xbb10('0x59')](_0x1bd054);_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x87'),_0x34cf4e);}BPromise[_0xbb10('0x88')]()[_0xbb10('0x1e')](function(){if(!_0x10159b){if(_0x188cbd['query'][_0xbb10('0x89')])return;_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x8a'));_0x3efa96['where']('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x188cbd['user'][_0xbb10('0x8b')]!=='agent')return;return _0x188cbd['user'][_0xbb10('0x8c')]({'attributes':['id'],'raw':!![]})[_0xbb10('0x1e')](function(_0x33ff06){if(_[_0xbb10('0x6e')](_0x33ff06)){_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x8d'));_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x8d'));}else{_0xfe3db0[_0xbb10('0x3d')]('i.MailAccountId\x20IN\x20?',_[_0xbb10('0x30')](_0x33ff06,'id'));_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x6f'),_[_0xbb10('0x30')](_0x33ff06,'id'));}});})['then'](function(){if(_0x188cbd['user'][_0xbb10('0x8b')]===_0xbb10('0x8e')&&!_0x10159b&&!_0x188cbd[_0xbb10('0x34')][_0xbb10('0x89')])return[];return db['sequelize'][_0xbb10('0x34')](_0xfe3db0[_0xbb10('0x8f')](),_0x122d38);})[_0xbb10('0x1e')](function(_0xf7b3e1){_0x2b5352[_0xbb10('0x19')]=_0xf7b3e1['length'];if(_0x2b5352['count']===0x0)return[];return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x403beb[_0xbb10('0x8f')](),_0x122d38)['then'](function(_0x256b35){_0x23dc18=_[_0xbb10('0x91')](_0x256b35,'id');_0x122d38=_['merge'](_0x122d38,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x38')]){_0x3c8d7d[_0xbb10('0x39')]['forEach'](function(_0x32d5a5){_0x3efa96[_0xbb10('0x3e')]('i.'+_0x32d5a5);});}else{_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x85'),_0xbb10('0x57'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x92'),_0xbb10('0x93'));_0x3efa96[_0xbb10('0x3e')]('a.mandatoryDisposition',_0xbb10('0x94'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x95'),_0xbb10('0x96'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x84'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x97'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x98'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x99'));_0x3efa96['field']('i.closedAt');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9a'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9b'));_0x3efa96[_0xbb10('0x3e')]('i.lastMsgDirection');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9c'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9d'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9e'));_0x3efa96['field'](_0xbb10('0x9f'));_0x3efa96[_0xbb10('0x3e')]('i.substatus');_0x3efa96[_0xbb10('0x3e')]('i.to');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa0'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa1'));_0x3efa96[_0xbb10('0x3e')]('i.UserId');_0x3efa96[_0xbb10('0x3e')]('c.firstName',_0xbb10('0xa2'));_0x3efa96[_0xbb10('0x3e')]('c.lastName','Contact.lastName');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa3'),_0xbb10('0xa4'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa5'),_0xbb10('0xa6'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa7'),_0xbb10('0xa8'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa9'),'Contact.fax');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xaa'),_0xbb10('0xab'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xac'),_0xbb10('0xad'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xae'),_0xbb10('0x24'));}if(_0x3c8d7d[_0xbb10('0x18')])_0x3efa96[_0xbb10('0x18')](_0x3c8d7d[_0xbb10('0x18')]);if(_0x3c8d7d['offset'])_0x3efa96[_0xbb10('0x16')](_0x3c8d7d['offset']);return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x3efa96[_0xbb10('0x8f')](),_0x122d38);})[_0xbb10('0x1e')](function(_0x38d369){if(_0x38d369['length']>0x0)_0x180933[_0xbb10('0x3d')](_0xbb10('0xaf'),_[_0xbb10('0x30')](_0x38d369,'id'));return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x180933[_0xbb10('0x8f')](),_0x122d38)['then'](function(_0x4bd470){var _0x5cc9d7=_[_0xbb10('0xb0')](_0x4bd470,_0xbb10('0xb1'));var _0x57d5a1=[];return db[_0xbb10('0xb2')][_0xbb10('0xb3')]({'attributes':['enableEmailPreview'],'raw':!![]})[_0xbb10('0x1e')](function(_0xaede56){var _0x5642c3=_0xaede56[_0xbb10('0xb4')];_0x38d369['forEach'](function(_0x34cec7){_0x57d5a1[_0xbb10('0x28')](updateMailInteraction(_0x34cec7,_0x23dc18,_0x5cc9d7,_0x5642c3));});return BPromise['all'](_0x57d5a1);});});});})[_0xbb10('0x1e')](function(_0x28cc74){_0x2b5352['rows']=_0x28cc74;return _0x2b5352;})['then'](respondWithFilteredResult(_0x10202c,_0x3c8d7d))[_0xbb10('0x2e')](handleError(_0x10202c,null));};exports[_0xbb10('0xb5')]=function(_0x3e0e34,_0x3299bc){var _0x3ceb77={'raw':![],'where':{'id':_0x3e0e34[_0xbb10('0xb6')]['id']}},_0x4c3bdc={};_0x4c3bdc[_0xbb10('0x33')]=_[_0xbb10('0x35')](db['MailInteraction'][_0xbb10('0xb7')]);_0x4c3bdc[_0xbb10('0x34')]=_[_0xbb10('0x35')](_0x3e0e34[_0xbb10('0x34')]);_0x4c3bdc[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x4c3bdc[_0xbb10('0x33')],_0x4c3bdc[_0xbb10('0x34')]);_0x3ceb77[_0xbb10('0x39')]=_['intersection'](_0x4c3bdc['model'],qs[_0xbb10('0x38')](_0x3e0e34[_0xbb10('0x34')][_0xbb10('0x38')]));_0x3ceb77[_0xbb10('0x39')]=_0x3ceb77[_0xbb10('0x39')][_0xbb10('0x55')]?_0x3ceb77[_0xbb10('0x39')]:_0x4c3bdc[_0xbb10('0x33')];if(_0x3e0e34[_0xbb10('0x34')][_0xbb10('0xb8')]){_0x3ceb77[_0xbb10('0xb9')]=[{'all':!![]}];}_0x3ceb77=_[_0xbb10('0xba')]({},_0x3ceb77,_0x3e0e34[_0xbb10('0xbb')]);return db['MailInteraction'][_0xbb10('0x56')](_0x3ceb77)[_0xbb10('0x1e')](handleEntityNotFound(_0x3299bc,null))[_0xbb10('0x1e')](respondWithResult(_0x3299bc,null))[_0xbb10('0x2e')](handleError(_0x3299bc,null));};exports[_0xbb10('0xbc')]=function(_0xd9284e,_0x4258fc){return db[_0xbb10('0x31')][_0xbb10('0xbc')](_0xd9284e[_0xbb10('0xbd')],{})[_0xbb10('0x1e')](respondWithResult(_0x4258fc,0xc9))['catch'](handleError(_0x4258fc,null));};exports[_0xbb10('0x1c')]=function(_0x5e1ac5,_0x3faaca){if(_0x5e1ac5[_0xbb10('0xbd')]['id']){delete _0x5e1ac5[_0xbb10('0xbd')]['id'];}return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x5e1ac5[_0xbb10('0xb6')]['id']}})['then'](handleEntityNotFound(_0x3faaca,null))[_0xbb10('0x1e')](saveUpdates(_0x5e1ac5['body'],null))[_0xbb10('0x1e')](respondWithResult(_0x3faaca,null))[_0xbb10('0x2e')](handleError(_0x3faaca,null));};exports[_0xbb10('0x1d')]=function(_0x576bb6,_0x2b652c){return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x576bb6[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x2b652c,null))[_0xbb10('0x1e')](removeEntity(_0x2b652c,null))[_0xbb10('0x2e')](handleError(_0x2b652c,null));};exports[_0xbb10('0xbe')]=function(_0x589565,_0x3696b3){return db['MailInteraction'][_0xbb10('0xbe')]()[_0xbb10('0x1e')](respondWithResult(_0x3696b3,null))[_0xbb10('0x2e')](handleError(_0x3696b3,null));};exports[_0xbb10('0xbf')]=function(_0x44c229,_0x40271f){return db[_0xbb10('0x29')]['find']({'where':{'id':_0x44c229[_0xbb10('0xb6')]['id']}})['then'](handleEntityNotFound(_0x40271f,null))['then'](function(_0x1513e0){if(_0x1513e0){return _0x1513e0[_0xbb10('0xbf')](_0x44c229[_0xbb10('0xbd')][_0xbb10('0xc0')],_[_0xbb10('0xc1')](_0x44c229[_0xbb10('0xbd')],['ids','id'])||{});}})[_0xbb10('0x1e')](respondWithResult(_0x40271f,null))[_0xbb10('0x2e')](handleError(_0x40271f,null));};exports[_0xbb10('0xc2')]=function(_0xb1b7c8,_0x136520){var _0x28127c={'raw':![],'where':{}};var _0x528aff={};var _0xdfdc42={'count':0x0,'rows':[]};return db[_0xbb10('0x31')][_0xbb10('0xb3')]({'where':{'id':_0xb1b7c8[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x136520,null))[_0xbb10('0x1e')](function(_0x2764e1){if(_0x2764e1){_0x528aff['model']=_[_0xbb10('0x35')](db['MailMessage'][_0xbb10('0xb7')]);_0x528aff['query']=_['keys'](_0xb1b7c8[_0xbb10('0x34')]);_0x528aff[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x528aff[_0xbb10('0x33')],_0x528aff[_0xbb10('0x34')]);_0x28127c['attributes']=_[_0xbb10('0x37')](_0x528aff['model'],qs['fields'](_0xb1b7c8['query'][_0xbb10('0x38')]));_0x28127c[_0xbb10('0x39')]=_0x28127c[_0xbb10('0x39')][_0xbb10('0x55')]?_0x28127c[_0xbb10('0x39')]:_0x528aff['model'];if(!_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x3a')](_0xbb10('0xc3'))){_0x28127c[_0xbb10('0x18')]=qs[_0xbb10('0x18')](_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x18')]);_0x28127c['offset']=qs['offset'](_0xb1b7c8['query'][_0xbb10('0x16')]);}_0x28127c[_0xbb10('0x3b')]=qs[_0xbb10('0x3c')](_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x3c')]);_0x28127c[_0xbb10('0x3d')]=qs[_0xbb10('0x36')](_[_0xbb10('0xc4')](_0xb1b7c8[_0xbb10('0x34')],_0x528aff[_0xbb10('0x36')]));_0x28127c['where']['MailInteractionId']=_0x2764e1['id'];if(_0xb1b7c8['query'][_0xbb10('0x7c')]){_0x28127c[_0xbb10('0x3d')]=_[_0xbb10('0xba')](_0x28127c['where'],{'$or':_[_0xbb10('0x30')](_0x28127c[_0xbb10('0x39')],function(_0x2c638d){var _0x290280={};_0x290280[_0x2c638d]={'$like':'%'+_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x7c')]+'%'};return _0x290280;})});}if(_0xb1b7c8['query']['$gte']){var _0x356660=_0xb1b7c8['query'][_0xbb10('0xc5')][_0xbb10('0x26')](',');var _0x152ca9={};_0x152ca9[_0x356660[0x0]]={'$gte':moment(_0x356660[0x1])[_0xbb10('0xc6')](_0xbb10('0xc7'))};_0x28127c[_0xbb10('0x3d')]=_[_0xbb10('0xba')](_0x28127c[_0xbb10('0x3d')],_0x152ca9);}_0x28127c=_[_0xbb10('0xba')]({},_0x28127c,_0xb1b7c8[_0xbb10('0xbb')]);return db['MailMessage'][_0xbb10('0x19')]({'where':_0x28127c['where']})[_0xbb10('0x1e')](function(_0x5547fa){_0xdfdc42[_0xbb10('0x19')]=_0x5547fa;if(_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0xb8')]){_0x28127c[_0xbb10('0xb9')]=[{'all':!![]}];}return db['MailMessage'][_0xbb10('0xc8')](_0x28127c);})['then'](function(_0xfe1154){if(_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0xc9')]==='true'){for(var _0x298167=0x0;_0x298167<_0xfe1154[_0xbb10('0x55')];_0x298167++){_0xfe1154[_0x298167][_0xbb10('0xbd')]=juice(_0xfe1154[_0x298167][_0xbb10('0xbd')]);}}_0xdfdc42[_0xbb10('0xca')]=_0xfe1154;return _0xdfdc42;});}})[_0xbb10('0x1e')](respondWithFilteredResult(_0x136520,_0x28127c))['catch'](handleError(_0x136520,null));};exports['addTags']=function(_0x522a88,_0x26a752){return db['MailInteraction'][_0xbb10('0x56')]({'where':{'id':_0x522a88['params']['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x26a752,null))[_0xbb10('0x1e')](function(_0x385ad3){if(_0x385ad3){return _0x385ad3['setTags'](_0x522a88['body'][_0xbb10('0xc0')],_[_0xbb10('0xc1')](_0x522a88[_0xbb10('0xbd')],['ids','id'])||{})[_0xbb10('0xcb')](function(){return db[_0xbb10('0x65')][_0xbb10('0xc8')]({'attributes':['id','name','color'],'where':{'id':_0x522a88['body'][_0xbb10('0xc0')]}});})['then'](function(_0x3dfbcd){socket[_0xbb10('0xcc')](_0xbb10('0xcd'),{'id':Number(_0x522a88[_0xbb10('0xb6')]['id']),'tags':_0x3dfbcd||[]});return{'id':Number(_0x522a88[_0xbb10('0xb6')]['id']),'tags':_0x3dfbcd||[]};});}})[_0xbb10('0x1e')](respondWithResult(_0x26a752,null))[_0xbb10('0x2e')](handleError(_0x26a752,null));};exports[_0xbb10('0xce')]=function(_0x2746eb,_0x431792){return db[_0xbb10('0x31')]['find']({'where':{'id':_0x2746eb[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x431792,null))['then'](function(_0x14ef50){if(_0x14ef50){return _0x14ef50['removeTags'](_0x2746eb['query'][_0xbb10('0xc0')]);}})[_0xbb10('0x1e')](respondWithStatusCode(_0x431792,null))[_0xbb10('0x2e')](handleError(_0x431792,null));};exports[_0xbb10('0xcf')]=function(_0x99c4,_0x4ca4ce){var _0x161171=moment()[_0xbb10('0xd0')]()['toString']();var _0xa45726=path[_0xbb10('0xd1')](config['root'],_0xbb10('0xd2'),'files',_0xbb10('0xd3'));var _0x8e8049=path[_0xbb10('0xd1')](config[_0xbb10('0xd4')],_0xbb10('0xd2'),_0xbb10('0xd5'),_0xbb10('0xd6'));var _0x56f902=path[_0xbb10('0xd1')](_0xa45726,_0x161171);var _0x4720a1=util[_0xbb10('0xc6')](_0xbb10('0xd7'),_0x99c4[_0xbb10('0xb6')]['id'],_0x161171);var _0x1301e3=path['join'](_0xa45726,_0x4720a1);var _0x550301=[];if(_0x99c4['query'][_0xbb10('0xd6')]){_0x550301[_0xbb10('0x28')]({'model':db[_0xbb10('0xd8')],'as':_0xbb10('0xd9'),'raw':!![]});}var _0x57700b=[{'model':db[_0xbb10('0x29')],'as':_0xbb10('0xda'),'attributes':['id',_0xbb10('0xbd'),'from','to','cc','bcc',_0xbb10('0xdb'),'createdAt'],'where':{'secret':![]},'order':qs[_0xbb10('0x3c')]('id'),'include':_0x550301}];return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x99c4[_0xbb10('0xb6')]['id']},'include':_0x57700b})[_0xbb10('0x1e')](handleEntityNotFound(_0x4ca4ce,null))[_0xbb10('0x1e')](function(_0x1fe250){if(_0x1fe250&&_0x1fe250['Messages']){var _0x424371=_0x1fe250[_0xbb10('0xdc')]({'plain':!![]});fs['mkdirSync'](_0x56f902);return BPromise[_0xbb10('0xdd')](_0x424371[_0xbb10('0xda')],function(_0x32f261,_0x5b11a2){var _0x4b490a={'from':_0x32f261['from'],'to':_0x32f261['to'],'subject':_0x32f261[_0xbb10('0xdb')],'html':_0x32f261[_0xbb10('0xbd')],'headers':{'Date':moment(_0x32f261['createdAt'])[_0xbb10('0xc6')](_0xbb10('0xde'))},'attachments':[]};if(_0x32f261['cc']){_0x4b490a[_0xbb10('0xdf')]['Cc']=_0x32f261['cc'];}if(_0x32f261[_0xbb10('0xe0')]){_0x4b490a[_0xbb10('0xdf')][_0xbb10('0xe1')]=_0x32f261[_0xbb10('0xe0')];}return new BPromise(function(_0x48f0eb,_0x304603){if(_0x32f261['Attachments']){for(var _0x5a7c4e=0x0;_0x5a7c4e<_0x32f261['Attachments'][_0xbb10('0x55')];_0x5a7c4e++){var _0x572d73=_0x32f261['Attachments'][_0x5a7c4e];var _0x1f09f1=path['join'](_0x8e8049,_0x572d73[_0xbb10('0xe2')]);if(fs[_0xbb10('0xe3')](_0x1f09f1)){_0x4b490a[_0xbb10('0xd6')]['push']({'name':_0x572d73['name'],'contentType':_0x572d73[_0xbb10('0x63')],'data':fs['readFileSync'](_0x1f09f1)});}}}emlformat[_0xbb10('0xe4')](_0x4b490a,function(_0x211172,_0x589ecb){if(_0x211172)return _0x304603(_0x211172);fs['writeFileSync'](path[_0xbb10('0xd1')](_0x56f902,util[_0xbb10('0xc6')](_0xbb10('0xe5'),_0x5b11a2)),_0x589ecb);return _0x48f0eb(_0x589ecb);});});})['then'](function(){return new BPromise(function(_0x4f4aa8,_0x426a4f){zipdir(_0x56f902,{'saveTo':_0x1301e3},function(_0x22f153,_0x4d47cc){if(_0x22f153)return _0x426a4f(_0x22f153);return _0x4f4aa8(_0x4d47cc);});})[_0xbb10('0x1e')](function(){return new BPromise(function(_0x203e5a,_0xe88e90){rimraf(_0x56f902,function(_0x4845b5){if(_0x4845b5)_0xe88e90(_0x4845b5);return _0x203e5a();});});})[_0xbb10('0x1e')](function(){return _0x4ca4ce[_0xbb10('0xcf')](_0x1301e3,_0x4720a1,function(_0x166f4f){if(!_0x166f4f)fs[_0xbb10('0xe6')](_0x1301e3);});});});}else{return _0x4ca4ce[_0xbb10('0x12')](0xc8);}})[_0xbb10('0x2e')](handleError(_0x4ca4ce,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 44fa3ed..9fa1a13 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 _0x09a4=['../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','update','getUsers','then','setDataValue','map','findAll','unreadMessages','catch','hasOwnProperty','hook','exports'];(function(_0x19efb6,_0x45aa78){var _0x4180c0=function(_0x1a76ee){while(--_0x1a76ee){_0x19efb6['push'](_0x19efb6['shift']());}};_0x4180c0(++_0x45aa78);}(_0x09a4,0x1e0));var _0x409a=function(_0x2a4bb1,_0x23bd64){_0x2a4bb1=_0x2a4bb1-0x0;var _0x29a201=_0x09a4[_0x2a4bb1];return _0x29a201;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0x409a('0x0'))['db'][_0x409a('0x1')];var MailMessage=require(_0x409a('0x0'))['db'][_0x409a('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x409a('0x3')](0x0);var events={'afterCreate':_0x409a('0x4'),'afterUpdate':_0x409a('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2cb167){return function(_0x2e3906,_0x35ca73,_0x43bf86){_0x2e3906[_0x409a('0x6')]({'attributes':['id'],'raw':!![]})[_0x409a('0x7')](function(_0x16c290){_0x2e3906[_0x409a('0x8')]('Users',_0x16c290[_0x409a('0x9')](function(_0x4818a5){return{'id':_0x4818a5['id']};}));return MailMessage[_0x409a('0xa')]({'where':{'MailInteractionId':_0x2e3906['id'],'direction':'in','read':![]},'raw':!![]});})[_0x409a('0x7')](function(_0x3d6300){_0x2e3906[_0x409a('0x8')](_0x409a('0xb'),_0x3d6300['length']);MailInteractionEvents['emit'](_0x2cb167+':'+_0x2e3906['id'],_0x2e3906);MailInteractionEvents['emit'](_0x2cb167,_0x2e3906);_0x43bf86(null);})[_0x409a('0xc')](_0x43bf86(null));};}for(var e in events){if(events[_0x409a('0xd')](e)){var event=events[e];MailInteraction[_0x409a('0xe')](e,emitEvent(event));}}module[_0x409a('0xf')]=MailInteractionEvents; \ No newline at end of file +var _0x93d6=['findAll','then','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','setDataValue','Users','map'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x93d6,0x16e));var _0x693d=function(_0x586046,_0x19b72d){_0x586046=_0x586046-0x0;var _0x2e4f90=_0x93d6[_0x586046];return _0x2e4f90;};'use strict';var EventEmitter=require(_0x693d('0x0'));var MailInteraction=require(_0x693d('0x1'))['db'][_0x693d('0x2')];var MailMessage=require(_0x693d('0x1'))['db'][_0x693d('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x693d('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x14bd8c){return function(_0x53d45d,_0x1c6199,_0xaf6d7c){_0x53d45d['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x278d77){_0x53d45d[_0x693d('0x5')](_0x693d('0x6'),_0x278d77[_0x693d('0x7')](function(_0x211fca){return{'id':_0x211fca['id']};}));return MailMessage[_0x693d('0x8')]({'where':{'MailInteractionId':_0x53d45d['id'],'direction':'in','read':![]},'raw':!![]});})[_0x693d('0x9')](function(_0x7b2df3){_0x53d45d[_0x693d('0x5')](_0x693d('0xa'),_0x7b2df3[_0x693d('0xb')]);MailInteractionEvents['emit'](_0x14bd8c+':'+_0x53d45d['id'],_0x53d45d);MailInteractionEvents[_0x693d('0xc')](_0x14bd8c,_0x53d45d);_0xaf6d7c(null);})[_0x693d('0xd')](_0xaf6d7c(null));};}for(var e in events){if(events[_0x693d('0xe')](e)){var event=events[e];MailInteraction[_0x693d('0xf')](e,emitEvent(event));}}module[_0x693d('0x10')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 3d0084f..1b8d0c6 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 _0x0783=['get','MailMessage','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','request-promise','path','../../config/environment','./mailInteraction.attributes','exports','define','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closedAt','changed','closed'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x0783,0x16b));var _0x3078=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0783[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x3078('0x0'));var util=require(_0x3078('0x1'));var logger=require(_0x3078('0x2'))('api');var moment=require('moment');var BPromise=require(_0x3078('0x3'));var rp=require(_0x3078('0x4'));var fs=require('fs');var path=require(_0x3078('0x5'));var rimraf=require('rimraf');var config=require(_0x3078('0x6'));var attributes=require(_0x3078('0x7'));module[_0x3078('0x8')]=function(_0x5a58fc,_0x3ddf8e){return _0x5a58fc[_0x3078('0x9')]('MailInteraction',attributes,{'tableName':_0x3078('0xa'),'paranoid':![],'indexes':[{'name':_0x3078('0xb'),'fields':[_0x3078('0xc'),'to'],'type':_0x3078('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2d771d,_0x5608f8,_0x29c6a6){if(_0x2d771d[_0x3078('0xe')]){_0x2d771d[_0x3078('0xf')]=moment()[_0x3078('0x10')](_0x3078('0x11'));}if(_0x2d771d['closed']){_0x2d771d[_0x3078('0x12')]=moment()[_0x3078('0x10')](_0x3078('0x11'));}_0x29c6a6(null,_0x5608f8);},'beforeUpdate':function(_0x10e862,_0x351d98,_0x1f9918){if(_0x10e862['changed'](_0x3078('0xe'))){_0x10e862[_0x3078('0xf')]=_0x10e862[_0x3078('0xe')]?moment()[_0x3078('0x10')](_0x3078('0x11')):null;}if(_0x10e862[_0x3078('0x13')](_0x3078('0x14'))){_0x10e862[_0x3078('0x12')]=moment()['format'](_0x3078('0x11'));_0x10e862[_0x3078('0xe')]=null;_0x10e862[_0x3078('0xf')]=null;}_0x1f9918(null,_0x10e862);},'afterUpdate':function(_0x55f437,_0x41641a,_0x536d86){var _0x27680d=_0x5a58fc['models'];var _0x393fb7=_0x55f437[_0x3078('0x15')]({'plain':!![]});if(_0x393fb7[_0x3078('0x14')]){return _0x27680d[_0x3078('0x16')]['update']({'read':!![]},{'where':{'MailInteractionId':_0x393fb7['id']}})['then'](function(){_0x536d86();})['catch'](function(_0x5a916a){_0x536d86(_0x5a916a);});}else{_0x536d86();}}},'charset':'utf8mb4','collate':_0x3078('0x17')});}; \ No newline at end of file +var _0x7a2f=['substatus','substatusAt','YYYY-MM-DD\x20HH:mm:ss','closedAt','changed','format','closed','get','MailMessage','then','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','fti_mail_interactions'];(function(_0x47242d,_0x13f993){var _0x30273a=function(_0x322cd2){while(--_0x322cd2){_0x47242d['push'](_0x47242d['shift']());}};_0x30273a(++_0x13f993);}(_0x7a2f,0x78));var _0xf7a2=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7a2f[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xf7a2('0x0'));var util=require('util');var logger=require(_0xf7a2('0x1'))('api');var moment=require(_0xf7a2('0x2'));var BPromise=require(_0xf7a2('0x3'));var rp=require(_0xf7a2('0x4'));var fs=require('fs');var path=require(_0xf7a2('0x5'));var rimraf=require(_0xf7a2('0x6'));var config=require(_0xf7a2('0x7'));var attributes=require(_0xf7a2('0x8'));module[_0xf7a2('0x9')]=function(_0x5677cd,_0x5ab2d7){return _0x5677cd[_0xf7a2('0xa')]('MailInteraction',attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':_0xf7a2('0xb'),'fields':['subject','to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1e5115,_0x7461a2,_0x22e1c0){if(_0x1e5115[_0xf7a2('0xc')]){_0x1e5115[_0xf7a2('0xd')]=moment()['format'](_0xf7a2('0xe'));}if(_0x1e5115['closed']){_0x1e5115[_0xf7a2('0xf')]=moment()['format'](_0xf7a2('0xe'));}_0x22e1c0(null,_0x7461a2);},'beforeUpdate':function(_0x5a2b39,_0x1ad1d7,_0x311294){if(_0x5a2b39[_0xf7a2('0x10')](_0xf7a2('0xc'))){_0x5a2b39[_0xf7a2('0xd')]=_0x5a2b39[_0xf7a2('0xc')]?moment()[_0xf7a2('0x11')]('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x5a2b39['changed'](_0xf7a2('0x12'))){_0x5a2b39[_0xf7a2('0xf')]=moment()[_0xf7a2('0x11')](_0xf7a2('0xe'));_0x5a2b39[_0xf7a2('0xc')]=null;_0x5a2b39['substatusAt']=null;}_0x311294(null,_0x5a2b39);},'afterUpdate':function(_0x13673e,_0xd47722,_0x3c62f8){var _0x562634=_0x5677cd['models'];var _0x2c9a9d=_0x13673e[_0xf7a2('0x13')]({'plain':!![]});if(_0x2c9a9d[_0xf7a2('0x12')]){return _0x562634[_0xf7a2('0x14')]['update']({'read':!![]},{'where':{'MailInteractionId':_0x2c9a9d['id']}})[_0xf7a2('0x15')](function(){_0x3c62f8();})['catch'](function(_0x461389){_0x3c62f8(_0x461389);});}else{_0x3c62f8();}}},'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 e0048f6..d7c2dfb 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 _0xcf30=['MailInteraction','addTags','ids','omit','body','AddTags','debug','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/environment','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','request','then','MailInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','UpdateMailInteraction','update','options','raw','where','limit','AddTagsToMailInteraction'];(function(_0x19a615,_0xd4d958){var _0x212cc9=function(_0x3bbf87){while(--_0x3bbf87){_0x19a615['push'](_0x19a615['shift']());}};_0x212cc9(++_0xd4d958);}(_0xcf30,0x128));var _0x0cf3=function(_0xfe715a,_0x30fabf){_0xfe715a=_0xfe715a-0x0;var _0x45f896=_0xcf30[_0xfe715a];return _0x45f896;};'use strict';var _=require(_0x0cf3('0x0'));var util=require(_0x0cf3('0x1'));var moment=require(_0x0cf3('0x2'));var BPromise=require(_0x0cf3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0cf3('0x4'));var db=require(_0x0cf3('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x0cf3('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x0cf3('0x7')]=_[_0x0cf3('0x8')](config[_0x0cf3('0x7')],{'host':_0x0cf3('0x9'),'port':0x18eb});var socket=require(_0x0cf3('0xa'))(new Redis(config['redis']));require(_0x0cf3('0xb'))['register'](socket);function respondWithRpcPromise(_0x141e8c,_0x1e3416,_0x18b2d1){return new BPromise(function(_0x1793a4,_0x1937c6){return client[_0x0cf3('0xc')](_0x141e8c,_0x18b2d1)[_0x0cf3('0xd')](function(_0x2e7cbc){logger['info'](_0x0cf3('0xe'),_0x1e3416,'request\x20sent');logger['debug']('MailInteraction,\x20%s,\x20%s,\x20%s',_0x1e3416,_0x0cf3('0xf'),JSON[_0x0cf3('0x10')](_0x2e7cbc));if(_0x2e7cbc['error']){if(_0x2e7cbc['error']['code']===0x1f4){logger[_0x0cf3('0x11')](_0x0cf3('0xe'),_0x1e3416,_0x2e7cbc[_0x0cf3('0x11')][_0x0cf3('0x12')]);return _0x1937c6(_0x2e7cbc[_0x0cf3('0x11')]['message']);}logger[_0x0cf3('0x11')](_0x0cf3('0xe'),_0x1e3416,_0x2e7cbc['error'][_0x0cf3('0x12')]);return _0x1793a4(_0x2e7cbc[_0x0cf3('0x11')][_0x0cf3('0x12')]);}else{logger[_0x0cf3('0x13')](_0x0cf3('0xe'),_0x1e3416,_0x0cf3('0xf'));_0x1793a4(_0x2e7cbc[_0x0cf3('0x14')][_0x0cf3('0x12')]);}})['catch'](function(_0x159846){logger[_0x0cf3('0x11')]('MailInteraction,\x20%s,\x20%s',_0x1e3416,_0x159846);_0x1937c6(_0x159846);});});}exports[_0x0cf3('0x15')]=function(_0x8e4561){var _0xa81872=this;return new Promise(function(_0x496516,_0x327694){return db['MailInteraction'][_0x0cf3('0x16')](_0x8e4561['body'],{'raw':_0x8e4561[_0x0cf3('0x17')]?_0x8e4561[_0x0cf3('0x17')][_0x0cf3('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x8e4561['options']?_0x8e4561[_0x0cf3('0x17')][_0x0cf3('0x19')]||null:null,'attributes':_0x8e4561['options']?_0x8e4561[_0x0cf3('0x17')]['attributes']||null:null,'limit':_0x8e4561[_0x0cf3('0x17')]?_0x8e4561['options'][_0x0cf3('0x1a')]||null:null})[_0x0cf3('0xd')](function(_0x4d0f5b){logger[_0x0cf3('0x13')](_0x0cf3('0x15'),_0x8e4561);logger['debug'](_0x0cf3('0x15'),_0x8e4561,JSON[_0x0cf3('0x10')](_0x4d0f5b));_0x496516(_0x4d0f5b);})['catch'](function(_0x5aed05){logger[_0x0cf3('0x11')](_0x0cf3('0x15'),_0x5aed05[_0x0cf3('0x12')],_0x8e4561);_0x327694(_0xa81872[_0x0cf3('0x11')](0x1f4,_0x5aed05['message']));});});};exports[_0x0cf3('0x1b')]=function(_0x32cf18){return new Promise(function(_0x4cb2bb,_0x1a1e94){return db[_0x0cf3('0x1c')]['find']({'where':_0x32cf18[_0x0cf3('0x17')]?_0x32cf18[_0x0cf3('0x17')][_0x0cf3('0x19')]||null:null})[_0x0cf3('0xd')](function(_0x46a83e){if(_0x46a83e){return _0x46a83e[_0x0cf3('0x1d')](_0x32cf18['body'][_0x0cf3('0x1e')],_[_0x0cf3('0x1f')](_0x32cf18[_0x0cf3('0x20')],[_0x0cf3('0x1e'),'id'])||{});}})['spread'](function(_0x189642){logger[_0x0cf3('0x13')](_0x0cf3('0x21'),_0x32cf18);logger[_0x0cf3('0x22')](_0x0cf3('0x21'),_0x32cf18,JSON[_0x0cf3('0x10')](_0x189642));_0x4cb2bb(_0x189642);})[_0x0cf3('0x23')](function(_0x14f58d){logger['error'](_0x0cf3('0x21'),_0x14f58d[_0x0cf3('0x12')],_0x32cf18);_0x1a1e94(_this['error'](0x1f4,_0x14f58d[_0x0cf3('0x12')]));});});}; \ No newline at end of file +var _0x031f=['message','MailInteraction,\x20%s,\x20%s','result','catch','UpdateMailInteraction','MailInteraction','update','body','options','raw','where','limit','debug','stringify','AddTagsToMailInteraction','find','addTags','ids','omit','AddTags','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','then','info','MailInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x58decf,_0x412483){var _0x2e36ee=function(_0x5625cc){while(--_0x5625cc){_0x58decf['push'](_0x58decf['shift']());}};_0x2e36ee(++_0x412483);}(_0x031f,0x1c2));var _0xf031=function(_0xc5c5fe,_0x3988c2){_0xc5c5fe=_0xc5c5fe-0x0;var _0x4d58e3=_0x031f[_0xc5c5fe];return _0x4d58e3;};'use strict';var _=require(_0xf031('0x0'));var util=require('util');var moment=require(_0xf031('0x1'));var BPromise=require('bluebird');var rs=require(_0xf031('0x2'));var fs=require('fs');var Redis=require(_0xf031('0x3'));var db=require(_0xf031('0x4'))['db'];var utils=require(_0xf031('0x5'));var logger=require('../../config/logger')(_0xf031('0x6'));var config=require(_0xf031('0x7'));var jayson=require(_0xf031('0x8'));var client=jayson[_0xf031('0x9')][_0xf031('0xa')]({'port':0x232a});config[_0xf031('0xb')]=_[_0xf031('0xc')](config['redis'],{'host':_0xf031('0xd'),'port':0x18eb});var socket=require(_0xf031('0xe'))(new Redis(config[_0xf031('0xb')]));require(_0xf031('0xf'))[_0xf031('0x10')](socket);function respondWithRpcPromise(_0x2cb638,_0x271ab0,_0x55abb3){return new BPromise(function(_0x99b8f3,_0x28a8c5){return client['request'](_0x2cb638,_0x55abb3)[_0xf031('0x11')](function(_0xbf774d){logger[_0xf031('0x12')]('MailInteraction,\x20%s,\x20%s',_0x271ab0,'request\x20sent');logger['debug'](_0xf031('0x13'),_0x271ab0,_0xf031('0x14'),JSON['stringify'](_0xbf774d));if(_0xbf774d[_0xf031('0x15')]){if(_0xbf774d[_0xf031('0x15')][_0xf031('0x16')]===0x1f4){logger[_0xf031('0x15')]('MailInteraction,\x20%s,\x20%s',_0x271ab0,_0xbf774d['error']['message']);return _0x28a8c5(_0xbf774d[_0xf031('0x15')][_0xf031('0x17')]);}logger[_0xf031('0x15')](_0xf031('0x18'),_0x271ab0,_0xbf774d['error'][_0xf031('0x17')]);return _0x99b8f3(_0xbf774d[_0xf031('0x15')]['message']);}else{logger['info'](_0xf031('0x18'),_0x271ab0,_0xf031('0x14'));_0x99b8f3(_0xbf774d[_0xf031('0x19')][_0xf031('0x17')]);}})[_0xf031('0x1a')](function(_0x2f2020){logger[_0xf031('0x15')](_0xf031('0x18'),_0x271ab0,_0x2f2020);_0x28a8c5(_0x2f2020);});});}exports[_0xf031('0x1b')]=function(_0x213484){var _0x48878d=this;return new Promise(function(_0x37c2da,_0x54d5d8){return db[_0xf031('0x1c')][_0xf031('0x1d')](_0x213484[_0xf031('0x1e')],{'raw':_0x213484[_0xf031('0x1f')]?_0x213484[_0xf031('0x1f')][_0xf031('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x213484['options']?_0x213484[_0xf031('0x1f')][_0xf031('0x21')]||null:null,'attributes':_0x213484['options']?_0x213484['options']['attributes']||null:null,'limit':_0x213484[_0xf031('0x1f')]?_0x213484['options'][_0xf031('0x22')]||null:null})[_0xf031('0x11')](function(_0x1a5ed0){logger[_0xf031('0x12')](_0xf031('0x1b'),_0x213484);logger[_0xf031('0x23')](_0xf031('0x1b'),_0x213484,JSON[_0xf031('0x24')](_0x1a5ed0));_0x37c2da(_0x1a5ed0);})[_0xf031('0x1a')](function(_0x4e2038){logger[_0xf031('0x15')]('UpdateMailInteraction',_0x4e2038['message'],_0x213484);_0x54d5d8(_0x48878d['error'](0x1f4,_0x4e2038['message']));});});};exports[_0xf031('0x25')]=function(_0x324cb1){return new Promise(function(_0x207b7a,_0x59562a){return db[_0xf031('0x1c')][_0xf031('0x26')]({'where':_0x324cb1['options']?_0x324cb1[_0xf031('0x1f')][_0xf031('0x21')]||null:null})[_0xf031('0x11')](function(_0x41b602){if(_0x41b602){return _0x41b602[_0xf031('0x27')](_0x324cb1[_0xf031('0x1e')][_0xf031('0x28')],_[_0xf031('0x29')](_0x324cb1['body'],[_0xf031('0x28'),'id'])||{});}})['spread'](function(_0x553c9d){logger['info'](_0xf031('0x2a'),_0x324cb1);logger['debug'](_0xf031('0x2a'),_0x324cb1,JSON['stringify'](_0x553c9d));_0x207b7a(_0x553c9d);})[_0xf031('0x1a')](function(_0x75bbfd){logger[_0xf031('0x15')](_0xf031('0x2a'),_0x75bbfd['message'],_0x324cb1);_0x59562a(_this['error'](0x1f4,_0x75bbfd['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 8474ab3..b9423eb 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 _0x52b6=['mailInteraction:','./mailInteraction.events','save','remove','update','emit'];(function(_0x5acb01,_0x13bc19){var _0x2aa560=function(_0x24baa8){while(--_0x24baa8){_0x5acb01['push'](_0x5acb01['shift']());}};_0x2aa560(++_0x13bc19);}(_0x52b6,0x157));var _0x652b=function(_0xbd5c58,_0x167170){_0xbd5c58=_0xbd5c58-0x0;var _0x1826ae=_0x52b6[_0xbd5c58];return _0x1826ae;};'use strict';var MailInteractionEvents=require(_0x652b('0x0'));var events=[_0x652b('0x1'),_0x652b('0x2'),_0x652b('0x3')];function createListener(_0x565501,_0x42160b){return function(_0x1653fd){_0x42160b[_0x652b('0x4')](_0x565501,_0x1653fd);};}function removeListener(_0x342095,_0x1a554){return function(){MailInteractionEvents['removeListener'](_0x342095,_0x1a554);};}exports['register']=function(_0x5e8eaa){for(var _0x10ca3c=0x0,_0x2ce7e8=events['length'];_0x10ca3c<_0x2ce7e8;_0x10ca3c++){var _0x33b140=events[_0x10ca3c];var _0xe72c07=createListener(_0x652b('0x5')+_0x33b140,_0x5e8eaa);MailInteractionEvents['on'](_0x33b140,_0xe72c07);}}; \ No newline at end of file +var _0xe863=['length','./mailInteraction.events','save','remove','update','emit','removeListener'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe863,0x78));var _0x3e86=function(_0x21d7e2,_0x365c55){_0x21d7e2=_0x21d7e2-0x0;var _0x2f23b6=_0xe863[_0x21d7e2];return _0x2f23b6;};'use strict';var MailInteractionEvents=require(_0x3e86('0x0'));var events=[_0x3e86('0x1'),_0x3e86('0x2'),_0x3e86('0x3')];function createListener(_0x25839f,_0x4205cc){return function(_0x2eb2a0){_0x4205cc[_0x3e86('0x4')](_0x25839f,_0x2eb2a0);};}function removeListener(_0x31aa91,_0x40c1e9){return function(){MailInteractionEvents[_0x3e86('0x5')](_0x31aa91,_0x40c1e9);};}exports['register']=function(_0x41c334){for(var _0x1cc154=0x0,_0x371956=events[_0x3e86('0x6')];_0x1cc154<_0x371956;_0x1cc154++){var _0x4f340a=events[_0x1cc154];var _0x202bf8=createListener('mailInteraction:'+_0x4f340a,_0x41c334);MailInteractionEvents['on'](_0x4f340a,_0x202bf8);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 79ebb60..a9289b6 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 _0x8278=['create','update','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','post','tracked','mail'];(function(_0x1d2c74,_0x588523){var _0x13c38d=function(_0x262996){while(--_0x262996){_0x1d2c74['push'](_0x1d2c74['shift']());}};_0x13c38d(++_0x588523);}(_0x8278,0x1ae));var _0x8827=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8278[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x8827('0x0'));var util=require(_0x8827('0x1'));var path=require(_0x8827('0x2'));var timeout=require(_0x8827('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x8827('0x4'));var auth=require(_0x8827('0x5'));var interaction=require(_0x8827('0x6'));var config=require(_0x8827('0x7'));var controller=require('./mailMessage.controller');router[_0x8827('0x8')]('/',auth[_0x8827('0x9')](),controller[_0x8827('0xa')]);router[_0x8827('0x8')](_0x8827('0xb'),auth[_0x8827('0x9')](),controller[_0x8827('0xc')]);router[_0x8827('0x8')](_0x8827('0xd'),auth[_0x8827('0x9')](),controller[_0x8827('0xe')]);router[_0x8827('0x8')](_0x8827('0xf'),auth['isAuthenticated'](),controller[_0x8827('0x10')]);router[_0x8827('0x11')]('/',auth['isAuthenticated'](),interaction[_0x8827('0x12')](_0x8827('0x13'),'mailmessage:create'),controller[_0x8827('0x14')]);router['put']('/:id',auth[_0x8827('0x9')](),controller[_0x8827('0x15')]);router[_0x8827('0x16')](_0x8827('0x17'),auth['isAuthenticated'](),controller[_0x8827('0x18')]);router[_0x8827('0x16')](_0x8827('0x19'),auth[_0x8827('0x9')](),controller[_0x8827('0x1a')]);router[_0x8827('0x1b')](_0x8827('0xd'),auth['isAuthenticated'](),controller[_0x8827('0x1c')]);module[_0x8827('0x1d')]=router; \ No newline at end of file +var _0xa45b=['delete','/:id','destroy','exports','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','download','post','tracked','mail','mailmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject'];(function(_0x339680,_0x4a5a9b){var _0x1c787d=function(_0x495b1f){while(--_0x495b1f){_0x339680['push'](_0x339680['shift']());}};_0x1c787d(++_0x4a5a9b);}(_0xa45b,0x199));var _0xba45=function(_0xf9a13d,_0x545b66){_0xf9a13d=_0xf9a13d-0x0;var _0x164cbc=_0xa45b[_0xf9a13d];return _0x164cbc;};'use strict';var multer=require('multer');var util=require(_0xba45('0x0'));var path=require(_0xba45('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xba45('0x2'));var auth=require(_0xba45('0x3'));var interaction=require(_0xba45('0x4'));var config=require(_0xba45('0x5'));var controller=require('./mailMessage.controller');router[_0xba45('0x6')]('/',auth[_0xba45('0x7')](),controller[_0xba45('0x8')]);router[_0xba45('0x6')](_0xba45('0x9'),auth[_0xba45('0x7')](),controller[_0xba45('0xa')]);router[_0xba45('0x6')]('/:id',auth[_0xba45('0x7')](),controller['show']);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0xba45('0xb')]);router[_0xba45('0xc')]('/',auth['isAuthenticated'](),interaction[_0xba45('0xd')](_0xba45('0xe'),_0xba45('0xf')),controller[_0xba45('0x10')]);router[_0xba45('0x11')]('/:id',auth[_0xba45('0x7')](),controller[_0xba45('0x12')]);router[_0xba45('0x11')](_0xba45('0x13'),auth['isAuthenticated'](),controller[_0xba45('0x14')]);router['put'](_0xba45('0x15'),auth[_0xba45('0x7')](),controller[_0xba45('0x16')]);router[_0xba45('0x17')](_0xba45('0x18'),auth[_0xba45('0x7')](),controller[_0xba45('0x19')]);module[_0xba45('0x1a')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index f44db91..ea9b679 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 _0x9f75=['long','medium','BOOLEAN','ENUM','out','STRING','DATE','INTEGER','Email','Chat','sequelize','lodash','TEXT'];(function(_0x1f50e9,_0x30a1fc){var _0x2302e0=function(_0x35623c){while(--_0x35623c){_0x1f50e9['push'](_0x1f50e9['shift']());}};_0x2302e0(++_0x30a1fc);}(_0x9f75,0x65));var _0x59f7=function(_0x2810cd,_0x50e1c3){_0x2810cd=_0x2810cd-0x0;var _0x325ed1=_0x9f75[_0x2810cd];return _0x325ed1;};'use strict';var Sequelize=require(_0x59f7('0x0'));var _=require(_0x59f7('0x1'));module['exports']={'body':{'type':Sequelize[_0x59f7('0x2')](_0x59f7('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x59f7('0x2')](_0x59f7('0x4'))},'read':{'type':Sequelize[_0x59f7('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0x59f7('0x6')]('in','out'),'defaultValue':_0x59f7('0x7'),'allowNull':![]},'messageId':{'type':Sequelize[_0x59f7('0x8')](0x1fe)},'from':{'type':Sequelize[_0x59f7('0x8')]},'to':{'type':Sequelize[_0x59f7('0x2')](_0x59f7('0x3'))},'cc':{'type':Sequelize[_0x59f7('0x2')](_0x59f7('0x3'))},'bcc':{'type':Sequelize[_0x59f7('0x2')](_0x59f7('0x3'))},'subject':{'type':Sequelize[_0x59f7('0x2')]},'sentAt':{'type':Sequelize[_0x59f7('0x9')]},'attach':{'type':Sequelize[_0x59f7('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x59f7('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize['TEXT'](_0x59f7('0x3'))},'originCc':{'type':Sequelize[_0x59f7('0x2')](_0x59f7('0x3'))},'originChannel':{'type':Sequelize[_0x59f7('0x6')](_0x59f7('0xb'),_0x59f7('0xc')),'defaultValue':'Email','allowNull':![]}}; \ No newline at end of file +var _0x7cc1=['out','STRING','long','DATE','INTEGER','Email','sequelize','lodash','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0x2c9f51,_0x2eec01){var _0x12abf9=function(_0x2d463f){while(--_0x2d463f){_0x2c9f51['push'](_0x2c9f51['shift']());}};_0x12abf9(++_0x2eec01);}(_0x7cc1,0x199));var _0x17cc=function(_0x27fd1e,_0x309910){_0x27fd1e=_0x27fd1e-0x0;var _0x404424=_0x7cc1[_0x27fd1e];return _0x404424;};'use strict';var Sequelize=require(_0x17cc('0x0'));var _=require(_0x17cc('0x1'));module[_0x17cc('0x2')]={'body':{'type':Sequelize[_0x17cc('0x3')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0x17cc('0x3')](_0x17cc('0x4'))},'read':{'type':Sequelize[_0x17cc('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0x17cc('0x6')]('in',_0x17cc('0x7')),'defaultValue':_0x17cc('0x7'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0x17cc('0x8')]},'to':{'type':Sequelize[_0x17cc('0x3')]('long')},'cc':{'type':Sequelize[_0x17cc('0x3')](_0x17cc('0x9'))},'bcc':{'type':Sequelize['TEXT']('long')},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0x17cc('0xa')]},'attach':{'type':Sequelize[_0x17cc('0xb')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x17cc('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x17cc('0xa')]},'originTo':{'type':Sequelize[_0x17cc('0x3')]('long')},'originCc':{'type':Sequelize['TEXT']('long')},'originChannel':{'type':Sequelize['ENUM'](_0x17cc('0xc'),'Chat'),'defaultValue':_0x17cc('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 f56e9e9..9a943ed 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 _0xedd9=['params','describe','create','secret','split','MailAccount','MailAccountId','List','CmContact','updatedAt','DESC','MailServerOut','Smtp','isNil','port','secure','authentication','auth','service','user','pass','attachments','join','server/files/attachments','defaults','ListId','List\x20not\x20found','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','readAt','agent','UserId','MailInteraction','MailInteractionId','read1stAt','interaction','get','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','sequelize','Sequelize','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','SELECT','reject','fromString','rejectmessage','unix','toString','root','server','files','tmp','message-%s.eml','from','subject','createdAt','headers','bcc','Bcc','Attachments','basename','existsSync','readFileSync','build','download','unlinkSync','moment','bluebird','util','path','lodash','ioredis','html-to-text','../../components/parsers/qs','api','../../config/logger','mail-interactions','../../config/environment','redis','localhost','socket.io-emitter','register','client','http','request','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','json','undefined','limit','count','offset','Content-Range','update','then','destroy','status','end','sendStatus','stack','name','index','map','MailMessage','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','keys','filters','find','body'];(function(_0x4efd0d,_0x5f5b41){var _0x7e36f8=function(_0x34bee2){while(--_0x34bee2){_0x4efd0d['push'](_0x4efd0d['shift']());}};_0x7e36f8(++_0x5f5b41);}(_0xedd9,0xfc));var _0x9edd=function(_0x13c4b5,_0x1e2b80){_0x13c4b5=_0x13c4b5-0x0;var _0xab5f07=_0xedd9[_0x13c4b5];return _0xab5f07;};'use strict';var emlformat=require('eml-format');var moment=require(_0x9edd('0x0'));var BPromise=require(_0x9edd('0x1'));var util=require(_0x9edd('0x2'));var path=require(_0x9edd('0x3'));var fs=require('fs');var _=require(_0x9edd('0x4'));var Redis=require(_0x9edd('0x5'));var htmlToText=require(_0x9edd('0x6'));var qs=require(_0x9edd('0x7'));var logger=require('../../config/logger')(_0x9edd('0x8'));var interaction_log=require(_0x9edd('0x9'))(_0x9edd('0xa'));var config=require(_0x9edd('0xb'));var db=require('../../mysqldb')['db'];config[_0x9edd('0xc')]=_['defaults'](config[_0x9edd('0xc')],{'host':_0x9edd('0xd'),'port':0x18eb});var socket=require(_0x9edd('0xe'))(new Redis(config[_0x9edd('0xc')]));require('./mailMessage.socket')[_0x9edd('0xf')](socket);var jayson=require('jayson/promise');var client=jayson[_0x9edd('0x10')][_0x9edd('0x11')]({'port':0x232c});var client9003=jayson['client'][_0x9edd('0x11')]({'port':0x232b});var client9002=jayson[_0x9edd('0x10')]['http']({'port':0x232a});function respondWithRpcPromise(_0x30c0d7,_0x1b73d1,_0x25e64c,_0xfd544a){return new BPromise(function(_0x287ddd,_0x3a7b84){var _0xfca576=_0xfd544a||client;return _0xfca576[_0x9edd('0x12')](_0x30c0d7,_0x25e64c)['then'](function(_0x176bfa){logger[_0x9edd('0x13')](_0x9edd('0x14'),_0x1b73d1,_0x9edd('0x15'));logger[_0x9edd('0x16')](_0x9edd('0x17'),_0x1b73d1,_0x9edd('0x15'),JSON[_0x9edd('0x18')](_0x176bfa));if(_0x176bfa['error']){if(_0x176bfa[_0x9edd('0x19')][_0x9edd('0x1a')]===0x1f4){logger[_0x9edd('0x19')]('MailMessage,\x20%s,\x20%s',_0x1b73d1,_0x176bfa[_0x9edd('0x19')][_0x9edd('0x1b')]);return _0x3a7b84(_0x176bfa[_0x9edd('0x19')]['message']);}logger[_0x9edd('0x19')]('MailMessage,\x20%s,\x20%s',_0x1b73d1,_0x176bfa[_0x9edd('0x19')][_0x9edd('0x1b')]);return _0x287ddd(_0x176bfa['error']['message']);}else{logger[_0x9edd('0x13')]('MailMessage,\x20%s,\x20%s',_0x1b73d1,_0x9edd('0x15'));_0x287ddd(_0x176bfa['result']['message']);}})[_0x9edd('0x1c')](function(_0x1c46a8){logger['error']('MailMessage,\x20%s,\x20%s',_0x1b73d1,_0x1c46a8);_0x3a7b84(_0x1c46a8);});});}function respondWithResult(_0x341d67,_0x186186){_0x186186=_0x186186||0xc8;return function(_0x477878){if(_0x477878){return _0x341d67['status'](_0x186186)[_0x9edd('0x1d')](_0x477878);}};}function respondWithFilteredResult(_0x1dca43,_0x44a6c1){return function(_0x2ca65f){if(_0x2ca65f){var _0x339a0d=typeof _0x44a6c1['offset']===_0x9edd('0x1e')&&typeof _0x44a6c1[_0x9edd('0x1f')]===_0x9edd('0x1e');var _0x2f9f86=_0x2ca65f[_0x9edd('0x20')];var _0x4d507f=_0x339a0d?0x0:_0x44a6c1['offset'];var _0x3276ee=_0x339a0d?_0x2ca65f[_0x9edd('0x20')]:_0x44a6c1[_0x9edd('0x21')]+_0x44a6c1[_0x9edd('0x1f')];var _0x3c2227;if(_0x3276ee>=_0x2f9f86){_0x3276ee=_0x2f9f86;_0x3c2227=0xc8;}else{_0x3c2227=0xce;}_0x1dca43['status'](_0x3c2227);return _0x1dca43['set'](_0x9edd('0x22'),_0x4d507f+'-'+_0x3276ee+'/'+_0x2f9f86)[_0x9edd('0x1d')](_0x2ca65f);}return null;};}function saveUpdates(_0x1c762c){return function(_0x52746a){if(_0x52746a){return _0x52746a[_0x9edd('0x23')](_0x1c762c)[_0x9edd('0x24')](function(_0x2ae8dd){return _0x2ae8dd;});}return null;};}function removeEntity(_0x41af53){return function(_0x5eccfb){if(_0x5eccfb){return _0x5eccfb[_0x9edd('0x25')]()[_0x9edd('0x24')](function(){_0x41af53[_0x9edd('0x26')](0xcc)[_0x9edd('0x27')]();});}};}function handleEntityNotFound(_0xbbf08f){return function(_0x42e664){if(!_0x42e664){_0xbbf08f[_0x9edd('0x28')](0x194);}return _0x42e664;};}function handleError(_0x1fba7b,_0x19b6c1){_0x19b6c1=_0x19b6c1||0x1f4;return function(_0x1c2e2b){logger[_0x9edd('0x19')](_0x1c2e2b[_0x9edd('0x29')]);if(_0x1c2e2b[_0x9edd('0x2a')]){delete _0x1c2e2b[_0x9edd('0x2a')];}_0x1fba7b[_0x9edd('0x26')](_0x19b6c1)['send'](_0x1c2e2b);};}exports[_0x9edd('0x2b')]=function(_0x259259,_0x267c74){var _0x5d1707={},_0x2d2f88={},_0x3990fb={'count':0x0,'rows':[]};var _0xde9b13=_[_0x9edd('0x2c')](db[_0x9edd('0x2d')][_0x9edd('0x2e')],function(_0x473068){return{'name':_0x473068[_0x9edd('0x2f')],'type':_0x473068[_0x9edd('0x30')][_0x9edd('0x31')]};});_0x2d2f88[_0x9edd('0x32')]=_[_0x9edd('0x2c')](_0xde9b13,_0x9edd('0x2a'));_0x2d2f88[_0x9edd('0x33')]=_['keys'](_0x259259[_0x9edd('0x33')]);_0x2d2f88['filters']=_[_0x9edd('0x34')](_0x2d2f88[_0x9edd('0x32')],_0x2d2f88[_0x9edd('0x33')]);_0x5d1707[_0x9edd('0x35')]=_[_0x9edd('0x34')](_0x2d2f88['model'],qs[_0x9edd('0x36')](_0x259259[_0x9edd('0x33')][_0x9edd('0x36')]));_0x5d1707[_0x9edd('0x35')]=_0x5d1707[_0x9edd('0x35')][_0x9edd('0x37')]?_0x5d1707[_0x9edd('0x35')]:_0x2d2f88[_0x9edd('0x32')];if(!_0x259259[_0x9edd('0x33')][_0x9edd('0x38')]('nolimit')){_0x5d1707[_0x9edd('0x1f')]=qs['limit'](_0x259259[_0x9edd('0x33')]['limit']);_0x5d1707[_0x9edd('0x21')]=qs[_0x9edd('0x21')](_0x259259[_0x9edd('0x33')]['offset']);}_0x5d1707[_0x9edd('0x39')]=qs[_0x9edd('0x3a')](_0x259259[_0x9edd('0x33')]['sort']);_0x5d1707[_0x9edd('0x3b')]=qs['filters'](_[_0x9edd('0x3c')](_0x259259[_0x9edd('0x33')],_0x2d2f88['filters']),_0xde9b13);if(_0x259259[_0x9edd('0x33')][_0x9edd('0x3d')]){_0x5d1707[_0x9edd('0x3b')]=_[_0x9edd('0x3e')](_0x5d1707['where'],{'$or':_[_0x9edd('0x2c')](_0xde9b13,function(_0x5bbdf8){if(_0x5bbdf8[_0x9edd('0x30')]!==_0x9edd('0x3f')){var _0x587d74={};_0x587d74[_0x5bbdf8[_0x9edd('0x2a')]]={'$like':'%'+_0x259259['query']['filter']+'%'};return _0x587d74;}})});}_0x5d1707=_[_0x9edd('0x3e')]({},_0x5d1707,_0x259259[_0x9edd('0x40')]);var _0x1f276b={'where':_0x5d1707[_0x9edd('0x3b')]};return db[_0x9edd('0x2d')][_0x9edd('0x20')](_0x1f276b)[_0x9edd('0x24')](function(_0x75efbe){_0x3990fb[_0x9edd('0x20')]=_0x75efbe;if(_0x259259[_0x9edd('0x33')][_0x9edd('0x41')]){_0x5d1707[_0x9edd('0x42')]=[{'all':!![]}];}return db[_0x9edd('0x2d')][_0x9edd('0x43')](_0x5d1707);})[_0x9edd('0x24')](function(_0x5416f8){_0x3990fb[_0x9edd('0x44')]=_0x5416f8;return _0x3990fb;})[_0x9edd('0x24')](respondWithFilteredResult(_0x267c74,_0x5d1707))[_0x9edd('0x1c')](handleError(_0x267c74,null));};exports[_0x9edd('0x45')]=function(_0x241929,_0x3ecdfd){var _0x10d41e={'raw':!![],'where':{'id':_0x241929['params']['id']}},_0x4e9ad1={};_0x4e9ad1['model']=_[_0x9edd('0x46')](db['MailMessage'][_0x9edd('0x2e')]);_0x4e9ad1[_0x9edd('0x33')]=_[_0x9edd('0x46')](_0x241929[_0x9edd('0x33')]);_0x4e9ad1[_0x9edd('0x47')]=_['intersection'](_0x4e9ad1[_0x9edd('0x32')],_0x4e9ad1[_0x9edd('0x33')]);_0x10d41e[_0x9edd('0x35')]=_['intersection'](_0x4e9ad1[_0x9edd('0x32')],qs[_0x9edd('0x36')](_0x241929[_0x9edd('0x33')][_0x9edd('0x36')]));_0x10d41e[_0x9edd('0x35')]=_0x10d41e[_0x9edd('0x35')]['length']?_0x10d41e[_0x9edd('0x35')]:_0x4e9ad1[_0x9edd('0x32')];if(_0x241929['query'][_0x9edd('0x41')]){_0x10d41e[_0x9edd('0x42')]=[{'all':!![]}];}_0x10d41e=_['merge']({},_0x10d41e,_0x241929[_0x9edd('0x40')]);return db[_0x9edd('0x2d')][_0x9edd('0x48')](_0x10d41e)['then'](handleEntityNotFound(_0x3ecdfd,null))[_0x9edd('0x24')](respondWithResult(_0x3ecdfd,null))[_0x9edd('0x1c')](handleError(_0x3ecdfd,null));};exports[_0x9edd('0x23')]=function(_0x28c7bd,_0x53f6e3){if(_0x28c7bd[_0x9edd('0x49')]['id']){delete _0x28c7bd[_0x9edd('0x49')]['id'];}return db[_0x9edd('0x2d')]['find']({'where':{'id':_0x28c7bd[_0x9edd('0x4a')]['id']}})[_0x9edd('0x24')](handleEntityNotFound(_0x53f6e3,null))['then'](saveUpdates(_0x28c7bd[_0x9edd('0x49')],null))['then'](respondWithResult(_0x53f6e3,null))[_0x9edd('0x1c')](handleError(_0x53f6e3,null));};exports[_0x9edd('0x25')]=function(_0x24245f,_0x3fcdf5){return db[_0x9edd('0x2d')][_0x9edd('0x48')]({'where':{'id':_0x24245f[_0x9edd('0x4a')]['id']}})[_0x9edd('0x24')](handleEntityNotFound(_0x3fcdf5,null))[_0x9edd('0x24')](removeEntity(_0x3fcdf5,null))[_0x9edd('0x1c')](handleError(_0x3fcdf5,null));};exports[_0x9edd('0x4b')]=function(_0x5a3b1d,_0x161bea){return db[_0x9edd('0x2d')][_0x9edd('0x4b')]()['then'](respondWithResult(_0x161bea,null))[_0x9edd('0x1c')](handleError(_0x161bea,null));};exports['create']=function(_0x54d83d,_0x54ecfa){return db[_0x9edd('0x2d')][_0x9edd('0x4c')](_0x54d83d[_0x9edd('0x49')])[_0x9edd('0x24')](function(_0x48a900){if(_0x48a900){if(_0x48a900['direction']==='out'&&!_0x48a900[_0x9edd('0x4d')]){var _0x5f666b,_0xd5090a,_0x1091ff;if(_0x54d83d[_0x9edd('0x49')]['to']){_0xd5090a=_0x54d83d[_0x9edd('0x49')]['to'][_0x9edd('0x4e')](',')[0x0];}return db[_0x9edd('0x4f')]['findOne']({'where':{'id':_0x48a900[_0x9edd('0x50')]},'include':[{'model':db['CmList'],'as':_0x9edd('0x51'),'include':[{'model':db[_0x9edd('0x52')],'as':'Contacts','where':{'email':_0xd5090a},'limit':0x1,'order':[[_0x9edd('0x53'),_0x9edd('0x54')]]}]},{'model':db[_0x9edd('0x55')],'as':'Smtp','raw':!![]}]})[_0x9edd('0x24')](function(_0x2e1ce3){_0x5f666b=_0x2e1ce3;if(_0x5f666b&&_0x5f666b[_0x9edd('0x56')]){var _0x15ebfa={'tls':{'rejectUnauthorized':![]}};if(_[_0x9edd('0x57')](_0x5f666b[_0x9edd('0x56')]['service'])){_0x15ebfa['host']=_0x5f666b[_0x9edd('0x56')]['host'];_0x15ebfa[_0x9edd('0x58')]=_0x5f666b[_0x9edd('0x56')][_0x9edd('0x58')];_0x15ebfa[_0x9edd('0x59')]=_0x5f666b['Smtp'][_0x9edd('0x59')];if(_0x5f666b['Smtp'][_0x9edd('0x5a')]){_0x15ebfa[_0x9edd('0x5b')]={'user':_0x5f666b[_0x9edd('0x56')]['user'],'pass':_0x5f666b[_0x9edd('0x56')]['pass']};}}else{_0x15ebfa[_0x9edd('0x5c')]=_0x5f666b[_0x9edd('0x56')]['service'];_0x15ebfa[_0x9edd('0x5b')]={'user':_0x5f666b['Smtp'][_0x9edd('0x5d')],'pass':_0x5f666b[_0x9edd('0x56')][_0x9edd('0x5e')]};_0x15ebfa['secure']=_0x5f666b[_0x9edd('0x56')][_0x9edd('0x59')];}if(_0x54d83d[_0x9edd('0x49')][_0x9edd('0x5f')]&&_0x54d83d[_0x9edd('0x49')]['attachments']['length']){for(var _0x2e1a96=0x0;_0x2e1a96<_0x54d83d[_0x9edd('0x49')]['attachments']['length'];_0x2e1a96+=0x1){_0x54d83d['body'][_0x9edd('0x5f')][_0x2e1a96]={'filename':_0x54d83d['body']['attachments'][_0x2e1a96][_0x9edd('0x2a')],'path':path[_0x9edd('0x60')](config['root'],_0x9edd('0x61'),_0x54d83d[_0x9edd('0x49')][_0x9edd('0x5f')][_0x2e1a96]['basename'])};}}_0x1091ff={'account':_0x15ebfa,'message':_0x54d83d[_0x9edd('0x49')]};return;}})['then'](function(){if(_0x5f666b[_0x9edd('0x51')]){if(_0x5f666b[_0x9edd('0x51')]['Contacts'][_0x9edd('0x37')]){return _0x5f666b[_0x9edd('0x51')]['Contacts'][0x0];}else{return db[_0x9edd('0x52')][_0x9edd('0x4c')](_[_0x9edd('0x62')](_0x54d83d[_0x9edd('0x49')],{'firstName':_0x54d83d['body']['to'],'email':_0x54d83d[_0x9edd('0x49')]['to'],'phone':_0x54d83d['body']['to'],'ListId':_0x5f666b[_0x9edd('0x63')]}));}}else{throw new Error(_0x9edd('0x64'));}})[_0x9edd('0x24')](function(){if(_0x1091ff){return respondWithRpcPromise('SendMail',_0x9edd('0x65'),_0x1091ff,client9003)[_0x9edd('0x24')](function(_0x130dba){return _0x48a900[_0x9edd('0x23')]({'read':!![],'messageId':_0x130dba[_0x9edd('0x66')],'sentAt':moment()[_0x9edd('0x67')](_0x9edd('0x68'))});})['catch'](function(_0x5e29d0){logger[_0x9edd('0x19')]('%s',JSON[_0x9edd('0x18')](_0x5e29d0));return _0x48a900;});}return _0x48a900;});}return _0x48a900;}})[_0x9edd('0x24')](respondWithResult(_0x54ecfa,0xc9))[_0x9edd('0x1c')](handleError(_0x54ecfa,null));};exports[_0x9edd('0x69')]=function(_0x52f6f3,_0x2e40c8){var _0x5d56a={'agent':{},'channel':_0x9edd('0x6a')};if(_0x52f6f3['body']['id']){delete _0x52f6f3[_0x9edd('0x49')]['id'];}_0x52f6f3[_0x9edd('0x49')]['read']=!![];_0x52f6f3[_0x9edd('0x49')][_0x9edd('0x6b')]=moment()['format'](_0x9edd('0x68'));_0x52f6f3[_0x9edd('0x49')]['UserId']=_0x52f6f3[_0x9edd('0x49')]['UserId']||_0x52f6f3['user']['id'];_0x5d56a[_0x9edd('0x6c')]['id']=_0x52f6f3[_0x9edd('0x49')][_0x9edd('0x6d')];return db['MailMessage'][_0x9edd('0x48')]({'where':{'id':_0x52f6f3[_0x9edd('0x4a')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2e40c8,null))[_0x9edd('0x24')](saveUpdates(_0x52f6f3[_0x9edd('0x49')],null))[_0x9edd('0x24')](function(_0x1ad198){if(_0x1ad198){_0x5d56a['message']=_0x1ad198['get']({'plain':!![]});return db[_0x9edd('0x6e')]['find']({'where':{'id':_0x1ad198[_0x9edd('0x6f')]}});}return null;})[_0x9edd('0x24')](handleEntityNotFound(_0x2e40c8,null))[_0x9edd('0x24')](function(_0x3cfd35){if(_0x3cfd35){return _0x3cfd35[_0x9edd('0x23')]({'UserId':_0x52f6f3[_0x9edd('0x49')][_0x9edd('0x6d')],'read1stAt':_[_0x9edd('0x57')](_0x3cfd35[_0x9edd('0x70')])?moment()['format'](_0x9edd('0x68')):undefined});}return null;})[_0x9edd('0x24')](function(_0x2c7562){if(_0x2c7562){_0x5d56a[_0x9edd('0x71')]=_0x2c7562[_0x9edd('0x72')]({'plain':!![]});interaction_log[_0x9edd('0x13')](_0x9edd('0x73'),_0x52f6f3['user']['id'],_0x52f6f3[_0x9edd('0x5d')][_0x9edd('0x2a')],_0x52f6f3['user'][_0x9edd('0x74')],_0x5d56a[_0x9edd('0x71')]['id'],_0x52f6f3['body']?JSON[_0x9edd('0x18')](_0x52f6f3[_0x9edd('0x49')]):_0x9edd('0x75'));return respondWithRpcPromise('AcceptMessage',_0x9edd('0x76'),_0x5d56a);}return null;})[_0x9edd('0x24')](function(_0x3f04d3){var _0x5a7de3='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3f04d3['message']['ContactId'];return db[_0x9edd('0x77')][_0x9edd('0x33')](_0x5a7de3,{'type':db[_0x9edd('0x78')]['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x56d794){return _0x56d794;});})[_0x9edd('0x24')](function(_0x20762d){if(_0x20762d){_0x5d56a[_0x9edd('0x1b')][_0x9edd('0x79')]=_0x20762d[0x0];if(!_0x52f6f3[_0x9edd('0x49')][_0x9edd('0x6d')])return;return db[_0x9edd('0x7a')][_0x9edd('0x48')]({'where':{'id':_0x52f6f3[_0x9edd('0x49')][_0x9edd('0x6d')],'role':_0x9edd('0x6c')},'attributes':['id','name',_0x9edd('0x7b'),_0x9edd('0x7c'),_0x9edd('0x7d')],'raw':!![]});}return null;})[_0x9edd('0x24')](function(_0x104afc){if(!_0x104afc)return null;_0x5d56a[_0x9edd('0x1b')][_0x9edd('0x6c')]=_0x104afc;return _0x5d56a;})[_0x9edd('0x24')](function(_0x4a7889){if(_0x4a7889){if(_0x52f6f3['body'][_0x9edd('0x7e')]){_0x5d56a['message'][_0x9edd('0x7f')]=util['format'](_0x9edd('0x80'),_0x52f6f3[_0x9edd('0x5d')]['name']);_0x5d56a[_0x9edd('0x1b')][_0x9edd('0x81')]=_0x5d56a['channel'];_0x5d56a[_0x9edd('0x1b')][_0x9edd('0x82')]=_0x9edd('0x69');_0x5d56a[_0x9edd('0x1b')][_0x9edd('0x49')]=htmlToText['fromString'](_0x5d56a[_0x9edd('0x1b')][_0x9edd('0x49')]);return respondWithRpcPromise(_0x9edd('0x83'),_0x9edd('0x83'),{'event':_0x9edd('0x84'),'message':_0x5d56a['message']},client9002)['then'](function(){return _0x5d56a;});}return _0x5d56a;}return null;})['then'](respondWithResult(_0x2e40c8,null))['catch'](handleError(_0x2e40c8,null));};exports['reject']=function(_0x2da088,_0x5d566e){var _0x58cb3f={'agent':{},'channel':_0x9edd('0x6a')};if(_0x2da088[_0x9edd('0x49')]['id']){delete _0x2da088[_0x9edd('0x49')]['id'];}_0x2da088[_0x9edd('0x49')][_0x9edd('0x6d')]=_0x2da088[_0x9edd('0x49')][_0x9edd('0x6d')]||_0x2da088[_0x9edd('0x5d')]['id'];_0x58cb3f[_0x9edd('0x6c')]['id']=_0x2da088[_0x9edd('0x49')]['UserId'];return db[_0x9edd('0x2d')][_0x9edd('0x48')]({'where':{'id':_0x2da088[_0x9edd('0x4a')]['id'],'UserId':null}})[_0x9edd('0x24')](handleEntityNotFound(_0x5d566e,null))[_0x9edd('0x24')](function(_0x23e925){if(_0x23e925){_0x58cb3f[_0x9edd('0x1b')]=_0x23e925[_0x9edd('0x72')]({'plain':!![]});return db['MailInteraction']['find']({'where':{'id':_0x23e925[_0x9edd('0x6f')]}});}return null;})[_0x9edd('0x24')](handleEntityNotFound(_0x5d566e,null))[_0x9edd('0x24')](function(_0x120d0f){if(_0x120d0f){_0x58cb3f[_0x9edd('0x71')]=_0x120d0f[_0x9edd('0x72')]({'plain':!![]});interaction_log[_0x9edd('0x13')](_0x9edd('0x85'),_0x2da088[_0x9edd('0x5d')]['id'],_0x2da088[_0x9edd('0x5d')][_0x9edd('0x2a')],_0x2da088[_0x9edd('0x5d')][_0x9edd('0x74')],_0x58cb3f[_0x9edd('0x71')]['id'],_0x2da088['body']?JSON[_0x9edd('0x18')](_0x2da088[_0x9edd('0x49')]):'null');return respondWithRpcPromise(_0x9edd('0x86'),_0x9edd('0x87'),_0x58cb3f);}return null;})[_0x9edd('0x24')](function(_0x2b4d4c){var _0x559503=_0x9edd('0x88')+_0x2b4d4c[_0x9edd('0x1b')][_0x9edd('0x89')];return db[_0x9edd('0x77')][_0x9edd('0x33')](_0x559503,{'type':db['Sequelize'][_0x9edd('0x8a')][_0x9edd('0x8b')],'raw':!![]})[_0x9edd('0x24')](function(_0x4633eb){return _0x4633eb;});})[_0x9edd('0x24')](function(_0x59927d){if(_0x59927d){_0x58cb3f['message'][_0x9edd('0x79')]=_0x59927d[0x0];if(!_0x2da088['body'][_0x9edd('0x6d')])return;return db['User'][_0x9edd('0x48')]({'where':{'id':_0x2da088[_0x9edd('0x49')][_0x9edd('0x6d')],'role':_0x9edd('0x6c')},'attributes':['id',_0x9edd('0x2a'),_0x9edd('0x7b'),'email',_0x9edd('0x7d')],'raw':!![]});}return null;})[_0x9edd('0x24')](function(_0x3aae72){if(!_0x3aae72)return null;_0x58cb3f[_0x9edd('0x1b')][_0x9edd('0x6c')]=_0x3aae72;return _0x58cb3f;})[_0x9edd('0x24')](function(_0x2f8fb6){if(_0x2f8fb6){_0x2f8fb6[_0x9edd('0x1b')]['interface']=util[_0x9edd('0x67')](_0x9edd('0x80'),_0x2da088[_0x9edd('0x5d')][_0x9edd('0x2a')]);_0x2f8fb6[_0x9edd('0x1b')][_0x9edd('0x81')]=_0x58cb3f[_0x9edd('0x81')];_0x2f8fb6[_0x9edd('0x1b')][_0x9edd('0x82')]=_0x9edd('0x8c');_0x2f8fb6[_0x9edd('0x1b')][_0x9edd('0x49')]=htmlToText[_0x9edd('0x8d')](_0x58cb3f[_0x9edd('0x1b')][_0x9edd('0x49')]);respondWithRpcPromise(_0x9edd('0x83'),_0x9edd('0x83'),{'event':_0x9edd('0x8e'),'message':_0x2f8fb6[_0x9edd('0x1b')]},client9002);return _0x58cb3f;}return null;})[_0x9edd('0x24')](respondWithResult(_0x5d566e,null))[_0x9edd('0x1c')](handleError(_0x5d566e,null));};exports['download']=function(_0xa704eb,_0x553018){var _0x4ca7e4=moment()[_0x9edd('0x8f')]()[_0x9edd('0x90')]();var _0x220c00=path[_0x9edd('0x60')](config[_0x9edd('0x91')],_0x9edd('0x92'),_0x9edd('0x93'),_0x9edd('0x94'));var _0x3e5a45=path[_0x9edd('0x60')](config['root'],_0x9edd('0x92'),_0x9edd('0x93'),'attachments');var _0x568067=util[_0x9edd('0x67')](_0x9edd('0x95'),_0x4ca7e4);return db[_0x9edd('0x2d')][_0x9edd('0x48')]({'where':{'id':_0xa704eb['params']['id']},'attributes':['id','body',_0x9edd('0x96'),'to','cc','bcc',_0x9edd('0x97'),_0x9edd('0x98')],'include':_0xa704eb[_0x9edd('0x33')]['attachments']?[{'model':db['Attachment'],'as':'Attachments'}]:undefined})[_0x9edd('0x24')](handleEntityNotFound(_0x553018,null))[_0x9edd('0x24')](function(_0x7b0fc8){if(_0x7b0fc8){var _0x5bfbfd=_0x7b0fc8;var _0xb2e72={'from':_0x5bfbfd[_0x9edd('0x96')],'to':_0x5bfbfd['to'],'subject':_0x5bfbfd['subject'],'html':_0x5bfbfd[_0x9edd('0x49')],'headers':{'Date':moment(_0x5bfbfd[_0x9edd('0x98')])['format']('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x7b0fc8['cc']){_0xb2e72[_0x9edd('0x99')]['Cc']=_0x7b0fc8['cc'];}if(_0x7b0fc8[_0x9edd('0x9a')]){_0xb2e72['headers'][_0x9edd('0x9b')]=_0x7b0fc8[_0x9edd('0x9a')];}return new BPromise(function(_0x54c6a0,_0x201d76){if(_0x7b0fc8['Attachments']){for(var _0x308a0f=0x0;_0x308a0f<_0x7b0fc8[_0x9edd('0x9c')][_0x9edd('0x37')];_0x308a0f++){var _0x742e13=_0x7b0fc8[_0x9edd('0x9c')][_0x308a0f];var _0x3e6426=path['join'](_0x3e5a45,_0x742e13[_0x9edd('0x9d')]);if(fs[_0x9edd('0x9e')](_0x3e6426)){_0xb2e72[_0x9edd('0x5f')]['push']({'name':_0x742e13[_0x9edd('0x2a')],'contentType':_0x742e13['type'],'data':fs[_0x9edd('0x9f')](_0x3e6426)});}}}emlformat[_0x9edd('0xa0')](_0xb2e72,function(_0x25da04,_0x41b0ea){if(_0x25da04)return _0x201d76(_0x25da04);fs['writeFileSync'](path['join'](_0x220c00,_0x568067),_0x41b0ea);return _0x54c6a0(_0x41b0ea);});});}})['then'](function(_0x12dcfa){if(_0x12dcfa){return _0x553018[_0x9edd('0xa1')](path[_0x9edd('0x60')](_0x220c00,_0x568067),_0x568067,function(_0x50af78){if(!_0x50af78)fs[_0x9edd('0xa2')](path[_0x9edd('0x60')](_0x220c00,_0x568067));});}})[_0x9edd('0x1c')](handleError(_0x553018,null));}; \ No newline at end of file +var _0x34e8=['message','info','catch','status','json','offset','undefined','limit','count','set','Content-Range','destroy','end','sendStatus','name','send','index','map','MailMessage','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','findAll','rows','show','params','length','include','find','body','create','direction','out','secret','MailAccount','findOne','CmList','List','CmContact','Contacts','DESC','MailServerOut','Smtp','isNil','service','host','port','secure','authentication','auth','user','pass','attachments','join','root','server/files/attachments','basename','ListId','sendMail','update','messageId','YYYY-MM-DD\x20HH:mm:ss','accept','readAt','UserId','agent','get','MailInteraction','MailInteractionId','format','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','internal','SIP/%s','channel','fromString','EventManager','acceptmessage','reject','mail','RejectMessage','rejectMessage','email','interface','event','rejectmessage','download','unix','toString','files','tmp','server','message-%s.eml','from','bcc','subject','createdAt','Attachment','Attachments','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','push','build','writeFileSync','unlinkSync','eml-format','moment','bluebird','util','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','jayson/promise','client','http','request','then','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x39872b,_0x343e6b){var _0x55fa18=function(_0x217c7f){while(--_0x217c7f){_0x39872b['push'](_0x39872b['shift']());}};_0x55fa18(++_0x343e6b);}(_0x34e8,0x12c));var _0x834e=function(_0x5af657,_0x58cd9e){_0x5af657=_0x5af657-0x0;var _0x310ac2=_0x34e8[_0x5af657];return _0x310ac2;};'use strict';var emlformat=require(_0x834e('0x0'));var moment=require(_0x834e('0x1'));var BPromise=require(_0x834e('0x2'));var util=require(_0x834e('0x3'));var path=require('path');var fs=require('fs');var _=require(_0x834e('0x4'));var Redis=require(_0x834e('0x5'));var htmlToText=require(_0x834e('0x6'));var qs=require(_0x834e('0x7'));var logger=require(_0x834e('0x8'))(_0x834e('0x9'));var interaction_log=require(_0x834e('0x8'))('mail-interactions');var config=require(_0x834e('0xa'));var db=require('../../mysqldb')['db'];config[_0x834e('0xb')]=_[_0x834e('0xc')](config[_0x834e('0xb')],{'host':_0x834e('0xd'),'port':0x18eb});var socket=require(_0x834e('0xe'))(new Redis(config[_0x834e('0xb')]));require(_0x834e('0xf'))[_0x834e('0x10')](socket);var jayson=require(_0x834e('0x11'));var client=jayson[_0x834e('0x12')][_0x834e('0x13')]({'port':0x232c});var client9003=jayson[_0x834e('0x12')][_0x834e('0x13')]({'port':0x232b});var client9002=jayson[_0x834e('0x12')][_0x834e('0x13')]({'port':0x232a});function respondWithRpcPromise(_0x1e00de,_0x2fd95c,_0x538bb3,_0x5e5b6d){return new BPromise(function(_0x6cd9b9,_0x58a27e){var _0x23848e=_0x5e5b6d||client;return _0x23848e[_0x834e('0x14')](_0x1e00de,_0x538bb3)[_0x834e('0x15')](function(_0x21cc0a){logger['info'](_0x834e('0x16'),_0x2fd95c,_0x834e('0x17'));logger['debug'](_0x834e('0x18'),_0x2fd95c,'request\x20sent',JSON[_0x834e('0x19')](_0x21cc0a));if(_0x21cc0a[_0x834e('0x1a')]){if(_0x21cc0a['error'][_0x834e('0x1b')]===0x1f4){logger[_0x834e('0x1a')](_0x834e('0x16'),_0x2fd95c,_0x21cc0a['error'][_0x834e('0x1c')]);return _0x58a27e(_0x21cc0a[_0x834e('0x1a')][_0x834e('0x1c')]);}logger[_0x834e('0x1a')](_0x834e('0x16'),_0x2fd95c,_0x21cc0a[_0x834e('0x1a')][_0x834e('0x1c')]);return _0x6cd9b9(_0x21cc0a['error'][_0x834e('0x1c')]);}else{logger[_0x834e('0x1d')](_0x834e('0x16'),_0x2fd95c,_0x834e('0x17'));_0x6cd9b9(_0x21cc0a['result'][_0x834e('0x1c')]);}})[_0x834e('0x1e')](function(_0x5a05c0){logger[_0x834e('0x1a')](_0x834e('0x16'),_0x2fd95c,_0x5a05c0);_0x58a27e(_0x5a05c0);});});}function respondWithResult(_0x8d406e,_0x5c55ca){_0x5c55ca=_0x5c55ca||0xc8;return function(_0x4e3f48){if(_0x4e3f48){return _0x8d406e[_0x834e('0x1f')](_0x5c55ca)[_0x834e('0x20')](_0x4e3f48);}};}function respondWithFilteredResult(_0x589dde,_0x25ee1d){return function(_0x1dc1e0){if(_0x1dc1e0){var _0x58f4fd=typeof _0x25ee1d[_0x834e('0x21')]===_0x834e('0x22')&&typeof _0x25ee1d[_0x834e('0x23')]==='undefined';var _0x24fcf7=_0x1dc1e0[_0x834e('0x24')];var _0x5e1cc5=_0x58f4fd?0x0:_0x25ee1d['offset'];var _0x1e713a=_0x58f4fd?_0x1dc1e0['count']:_0x25ee1d[_0x834e('0x21')]+_0x25ee1d[_0x834e('0x23')];var _0x3db026;if(_0x1e713a>=_0x24fcf7){_0x1e713a=_0x24fcf7;_0x3db026=0xc8;}else{_0x3db026=0xce;}_0x589dde[_0x834e('0x1f')](_0x3db026);return _0x589dde[_0x834e('0x25')](_0x834e('0x26'),_0x5e1cc5+'-'+_0x1e713a+'/'+_0x24fcf7)['json'](_0x1dc1e0);}return null;};}function saveUpdates(_0x510780){return function(_0x4dc64a){if(_0x4dc64a){return _0x4dc64a['update'](_0x510780)[_0x834e('0x15')](function(_0x567cea){return _0x567cea;});}return null;};}function removeEntity(_0x106d6a){return function(_0x5dacc1){if(_0x5dacc1){return _0x5dacc1[_0x834e('0x27')]()[_0x834e('0x15')](function(){_0x106d6a[_0x834e('0x1f')](0xcc)[_0x834e('0x28')]();});}};}function handleEntityNotFound(_0x4551f5){return function(_0x390119){if(!_0x390119){_0x4551f5[_0x834e('0x29')](0x194);}return _0x390119;};}function handleError(_0xfaf716,_0x278db3){_0x278db3=_0x278db3||0x1f4;return function(_0x493289){logger[_0x834e('0x1a')](_0x493289['stack']);if(_0x493289[_0x834e('0x2a')]){delete _0x493289[_0x834e('0x2a')];}_0xfaf716[_0x834e('0x1f')](_0x278db3)[_0x834e('0x2b')](_0x493289);};}exports[_0x834e('0x2c')]=function(_0x4689c2,_0x4696a1){var _0x38cd29={},_0x358c31={},_0x12b2bc={'count':0x0,'rows':[]};var _0x5bd232=_[_0x834e('0x2d')](db[_0x834e('0x2e')][_0x834e('0x2f')],function(_0xaf01f4){return{'name':_0xaf01f4['fieldName'],'type':_0xaf01f4[_0x834e('0x30')][_0x834e('0x31')]};});_0x358c31['model']=_['map'](_0x5bd232,'name');_0x358c31[_0x834e('0x32')]=_[_0x834e('0x33')](_0x4689c2[_0x834e('0x32')]);_0x358c31[_0x834e('0x34')]=_[_0x834e('0x35')](_0x358c31[_0x834e('0x36')],_0x358c31['query']);_0x38cd29[_0x834e('0x37')]=_['intersection'](_0x358c31[_0x834e('0x36')],qs[_0x834e('0x38')](_0x4689c2['query'][_0x834e('0x38')]));_0x38cd29[_0x834e('0x37')]=_0x38cd29['attributes']['length']?_0x38cd29[_0x834e('0x37')]:_0x358c31[_0x834e('0x36')];if(!_0x4689c2[_0x834e('0x32')][_0x834e('0x39')](_0x834e('0x3a'))){_0x38cd29['limit']=qs[_0x834e('0x23')](_0x4689c2['query']['limit']);_0x38cd29[_0x834e('0x21')]=qs['offset'](_0x4689c2[_0x834e('0x32')][_0x834e('0x21')]);}_0x38cd29[_0x834e('0x3b')]=qs[_0x834e('0x3c')](_0x4689c2[_0x834e('0x32')]['sort']);_0x38cd29[_0x834e('0x3d')]=qs[_0x834e('0x34')](_[_0x834e('0x3e')](_0x4689c2['query'],_0x358c31[_0x834e('0x34')]),_0x5bd232);if(_0x4689c2[_0x834e('0x32')]['filter']){_0x38cd29[_0x834e('0x3d')]=_['merge'](_0x38cd29[_0x834e('0x3d')],{'$or':_[_0x834e('0x2d')](_0x5bd232,function(_0x4a18bb){if(_0x4a18bb['type']!==_0x834e('0x3f')){var _0x16969b={};_0x16969b[_0x4a18bb[_0x834e('0x2a')]]={'$like':'%'+_0x4689c2[_0x834e('0x32')][_0x834e('0x40')]+'%'};return _0x16969b;}})});}_0x38cd29=_[_0x834e('0x41')]({},_0x38cd29,_0x4689c2[_0x834e('0x42')]);var _0x4a3381={'where':_0x38cd29[_0x834e('0x3d')]};return db['MailMessage'][_0x834e('0x24')](_0x4a3381)['then'](function(_0x1df5b0){_0x12b2bc['count']=_0x1df5b0;if(_0x4689c2[_0x834e('0x32')][_0x834e('0x43')]){_0x38cd29['include']=[{'all':!![]}];}return db[_0x834e('0x2e')][_0x834e('0x44')](_0x38cd29);})[_0x834e('0x15')](function(_0xd55cc3){_0x12b2bc[_0x834e('0x45')]=_0xd55cc3;return _0x12b2bc;})[_0x834e('0x15')](respondWithFilteredResult(_0x4696a1,_0x38cd29))[_0x834e('0x1e')](handleError(_0x4696a1,null));};exports[_0x834e('0x46')]=function(_0x5dc63b,_0x279ea1){var _0x5f3943={'raw':!![],'where':{'id':_0x5dc63b[_0x834e('0x47')]['id']}},_0x3124be={};_0x3124be['model']=_[_0x834e('0x33')](db[_0x834e('0x2e')][_0x834e('0x2f')]);_0x3124be[_0x834e('0x32')]=_[_0x834e('0x33')](_0x5dc63b[_0x834e('0x32')]);_0x3124be['filters']=_['intersection'](_0x3124be[_0x834e('0x36')],_0x3124be[_0x834e('0x32')]);_0x5f3943[_0x834e('0x37')]=_[_0x834e('0x35')](_0x3124be[_0x834e('0x36')],qs[_0x834e('0x38')](_0x5dc63b[_0x834e('0x32')][_0x834e('0x38')]));_0x5f3943[_0x834e('0x37')]=_0x5f3943[_0x834e('0x37')][_0x834e('0x48')]?_0x5f3943[_0x834e('0x37')]:_0x3124be[_0x834e('0x36')];if(_0x5dc63b[_0x834e('0x32')][_0x834e('0x43')]){_0x5f3943[_0x834e('0x49')]=[{'all':!![]}];}_0x5f3943=_[_0x834e('0x41')]({},_0x5f3943,_0x5dc63b[_0x834e('0x42')]);return db[_0x834e('0x2e')][_0x834e('0x4a')](_0x5f3943)['then'](handleEntityNotFound(_0x279ea1,null))[_0x834e('0x15')](respondWithResult(_0x279ea1,null))[_0x834e('0x1e')](handleError(_0x279ea1,null));};exports['update']=function(_0x3c00a3,_0x3b0988){if(_0x3c00a3['body']['id']){delete _0x3c00a3[_0x834e('0x4b')]['id'];}return db[_0x834e('0x2e')][_0x834e('0x4a')]({'where':{'id':_0x3c00a3[_0x834e('0x47')]['id']}})[_0x834e('0x15')](handleEntityNotFound(_0x3b0988,null))[_0x834e('0x15')](saveUpdates(_0x3c00a3[_0x834e('0x4b')],null))['then'](respondWithResult(_0x3b0988,null))[_0x834e('0x1e')](handleError(_0x3b0988,null));};exports[_0x834e('0x27')]=function(_0x3e0550,_0x363675){return db[_0x834e('0x2e')][_0x834e('0x4a')]({'where':{'id':_0x3e0550[_0x834e('0x47')]['id']}})[_0x834e('0x15')](handleEntityNotFound(_0x363675,null))['then'](removeEntity(_0x363675,null))[_0x834e('0x1e')](handleError(_0x363675,null));};exports['describe']=function(_0x2f4bde,_0x53a9ee){return db[_0x834e('0x2e')]['describe']()['then'](respondWithResult(_0x53a9ee,null))[_0x834e('0x1e')](handleError(_0x53a9ee,null));};exports[_0x834e('0x4c')]=function(_0x5291ae,_0x5be43d){return db[_0x834e('0x2e')][_0x834e('0x4c')](_0x5291ae[_0x834e('0x4b')])[_0x834e('0x15')](function(_0x21c417){if(_0x21c417){if(_0x21c417[_0x834e('0x4d')]===_0x834e('0x4e')&&!_0x21c417[_0x834e('0x4f')]){var _0x528e66,_0x142334,_0x3c70bf;if(_0x5291ae['body']['to']){_0x142334=_0x5291ae[_0x834e('0x4b')]['to']['split'](',')[0x0];}return db[_0x834e('0x50')][_0x834e('0x51')]({'where':{'id':_0x21c417['MailAccountId']},'include':[{'model':db[_0x834e('0x52')],'as':_0x834e('0x53'),'include':[{'model':db[_0x834e('0x54')],'as':_0x834e('0x55'),'where':{'email':_0x142334},'limit':0x1,'order':[['updatedAt',_0x834e('0x56')]]}]},{'model':db[_0x834e('0x57')],'as':_0x834e('0x58'),'raw':!![]}]})['then'](function(_0x246b8e){_0x528e66=_0x246b8e;if(_0x528e66&&_0x528e66[_0x834e('0x58')]){var _0x3a7683={'tls':{'rejectUnauthorized':![]}};if(_[_0x834e('0x59')](_0x528e66[_0x834e('0x58')][_0x834e('0x5a')])){_0x3a7683[_0x834e('0x5b')]=_0x528e66[_0x834e('0x58')][_0x834e('0x5b')];_0x3a7683[_0x834e('0x5c')]=_0x528e66[_0x834e('0x58')][_0x834e('0x5c')];_0x3a7683[_0x834e('0x5d')]=_0x528e66[_0x834e('0x58')][_0x834e('0x5d')];if(_0x528e66[_0x834e('0x58')][_0x834e('0x5e')]){_0x3a7683[_0x834e('0x5f')]={'user':_0x528e66[_0x834e('0x58')][_0x834e('0x60')],'pass':_0x528e66[_0x834e('0x58')][_0x834e('0x61')]};}}else{_0x3a7683['service']=_0x528e66[_0x834e('0x58')][_0x834e('0x5a')];_0x3a7683[_0x834e('0x5f')]={'user':_0x528e66[_0x834e('0x58')]['user'],'pass':_0x528e66[_0x834e('0x58')]['pass']};_0x3a7683['secure']=_0x528e66[_0x834e('0x58')][_0x834e('0x5d')];}if(_0x5291ae[_0x834e('0x4b')][_0x834e('0x62')]&&_0x5291ae[_0x834e('0x4b')][_0x834e('0x62')][_0x834e('0x48')]){for(var _0xe5c8f6=0x0;_0xe5c8f6<_0x5291ae['body'][_0x834e('0x62')]['length'];_0xe5c8f6+=0x1){_0x5291ae[_0x834e('0x4b')][_0x834e('0x62')][_0xe5c8f6]={'filename':_0x5291ae['body']['attachments'][_0xe5c8f6][_0x834e('0x2a')],'path':path[_0x834e('0x63')](config[_0x834e('0x64')],_0x834e('0x65'),_0x5291ae[_0x834e('0x4b')]['attachments'][_0xe5c8f6][_0x834e('0x66')])};}}_0x3c70bf={'account':_0x3a7683,'message':_0x5291ae[_0x834e('0x4b')]};return;}})[_0x834e('0x15')](function(){if(_0x528e66[_0x834e('0x53')]){if(_0x528e66[_0x834e('0x53')][_0x834e('0x55')][_0x834e('0x48')]){return _0x528e66[_0x834e('0x53')][_0x834e('0x55')][0x0];}else{return db[_0x834e('0x54')]['create'](_[_0x834e('0xc')](_0x5291ae[_0x834e('0x4b')],{'firstName':_0x5291ae[_0x834e('0x4b')]['to'],'email':_0x5291ae[_0x834e('0x4b')]['to'],'phone':_0x5291ae['body']['to'],'ListId':_0x528e66[_0x834e('0x67')]}));}}else{throw new Error('List\x20not\x20found');}})['then'](function(){if(_0x3c70bf){return respondWithRpcPromise('SendMail',_0x834e('0x68'),_0x3c70bf,client9003)[_0x834e('0x15')](function(_0x514aac){return _0x21c417[_0x834e('0x69')]({'read':!![],'messageId':_0x514aac[_0x834e('0x6a')],'sentAt':moment()['format'](_0x834e('0x6b'))});})[_0x834e('0x1e')](function(_0x4b88e7){logger['error']('%s',JSON[_0x834e('0x19')](_0x4b88e7));return _0x21c417;});}return _0x21c417;});}return _0x21c417;}})[_0x834e('0x15')](respondWithResult(_0x5be43d,0xc9))[_0x834e('0x1e')](handleError(_0x5be43d,null));};exports[_0x834e('0x6c')]=function(_0x1d8e7,_0x493239){var _0x264a6f={'agent':{},'channel':'mail'};if(_0x1d8e7[_0x834e('0x4b')]['id']){delete _0x1d8e7[_0x834e('0x4b')]['id'];}_0x1d8e7[_0x834e('0x4b')]['read']=!![];_0x1d8e7[_0x834e('0x4b')][_0x834e('0x6d')]=moment()['format'](_0x834e('0x6b'));_0x1d8e7[_0x834e('0x4b')][_0x834e('0x6e')]=_0x1d8e7['body'][_0x834e('0x6e')]||_0x1d8e7[_0x834e('0x60')]['id'];_0x264a6f[_0x834e('0x6f')]['id']=_0x1d8e7[_0x834e('0x4b')][_0x834e('0x6e')];return db[_0x834e('0x2e')][_0x834e('0x4a')]({'where':{'id':_0x1d8e7[_0x834e('0x47')]['id'],'UserId':null}})[_0x834e('0x15')](handleEntityNotFound(_0x493239,null))[_0x834e('0x15')](saveUpdates(_0x1d8e7['body'],null))['then'](function(_0x4e466e){if(_0x4e466e){_0x264a6f[_0x834e('0x1c')]=_0x4e466e[_0x834e('0x70')]({'plain':!![]});return db[_0x834e('0x71')][_0x834e('0x4a')]({'where':{'id':_0x4e466e[_0x834e('0x72')]}});}return null;})['then'](handleEntityNotFound(_0x493239,null))['then'](function(_0x4520fc){if(_0x4520fc){return _0x4520fc[_0x834e('0x69')]({'UserId':_0x1d8e7[_0x834e('0x4b')][_0x834e('0x6e')],'read1stAt':_[_0x834e('0x59')](_0x4520fc['read1stAt'])?moment()[_0x834e('0x73')](_0x834e('0x6b')):undefined});}return null;})[_0x834e('0x15')](function(_0x4e1735){if(_0x4e1735){_0x264a6f[_0x834e('0x74')]=_0x4e1735[_0x834e('0x70')]({'plain':!![]});interaction_log[_0x834e('0x1d')](_0x834e('0x75'),_0x1d8e7[_0x834e('0x60')]['id'],_0x1d8e7['user']['name'],_0x1d8e7[_0x834e('0x60')][_0x834e('0x76')],_0x264a6f['interaction']['id'],_0x1d8e7[_0x834e('0x4b')]?JSON['stringify'](_0x1d8e7[_0x834e('0x4b')]):_0x834e('0x77'));return respondWithRpcPromise(_0x834e('0x78'),'acceptMessage',_0x264a6f);}return null;})[_0x834e('0x15')](function(_0x49e721){var _0x5b2621='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x49e721[_0x834e('0x1c')][_0x834e('0x79')];return db[_0x834e('0x7a')][_0x834e('0x32')](_0x5b2621,{'type':db[_0x834e('0x7b')][_0x834e('0x7c')][_0x834e('0x7d')],'raw':!![]})[_0x834e('0x15')](function(_0x17e61a){return _0x17e61a;});})['then'](function(_0x2f775a){if(_0x2f775a){_0x264a6f['message'][_0x834e('0x7e')]=_0x2f775a[0x0];if(!_0x1d8e7[_0x834e('0x4b')][_0x834e('0x6e')])return;return db[_0x834e('0x7f')][_0x834e('0x4a')]({'where':{'id':_0x1d8e7[_0x834e('0x4b')]['UserId'],'role':'agent'},'attributes':['id',_0x834e('0x2a'),_0x834e('0x80'),'email',_0x834e('0x81')],'raw':!![]});}return null;})[_0x834e('0x15')](function(_0x1bc5d1){if(!_0x1bc5d1)return null;_0x264a6f[_0x834e('0x1c')][_0x834e('0x6f')]=_0x1bc5d1;return _0x264a6f;})['then'](function(_0x29839d){if(_0x29839d){if(_0x1d8e7[_0x834e('0x4b')]['manual']){_0x264a6f['message']['interface']=util[_0x834e('0x73')](_0x834e('0x82'),_0x1d8e7['user'][_0x834e('0x2a')]);_0x264a6f[_0x834e('0x1c')]['channel']=_0x264a6f[_0x834e('0x83')];_0x264a6f['message']['event']=_0x834e('0x6c');_0x264a6f[_0x834e('0x1c')][_0x834e('0x4b')]=htmlToText[_0x834e('0x84')](_0x264a6f['message'][_0x834e('0x4b')]);return respondWithRpcPromise(_0x834e('0x85'),_0x834e('0x85'),{'event':_0x834e('0x86'),'message':_0x264a6f[_0x834e('0x1c')]},client9002)[_0x834e('0x15')](function(){return _0x264a6f;});}return _0x264a6f;}return null;})[_0x834e('0x15')](respondWithResult(_0x493239,null))[_0x834e('0x1e')](handleError(_0x493239,null));};exports[_0x834e('0x87')]=function(_0x2821fe,_0x2fa64c){var _0x261e3d={'agent':{},'channel':_0x834e('0x88')};if(_0x2821fe[_0x834e('0x4b')]['id']){delete _0x2821fe[_0x834e('0x4b')]['id'];}_0x2821fe[_0x834e('0x4b')][_0x834e('0x6e')]=_0x2821fe[_0x834e('0x4b')][_0x834e('0x6e')]||_0x2821fe[_0x834e('0x60')]['id'];_0x261e3d[_0x834e('0x6f')]['id']=_0x2821fe[_0x834e('0x4b')]['UserId'];return db[_0x834e('0x2e')][_0x834e('0x4a')]({'where':{'id':_0x2821fe[_0x834e('0x47')]['id'],'UserId':null}})[_0x834e('0x15')](handleEntityNotFound(_0x2fa64c,null))[_0x834e('0x15')](function(_0x3bcdcd){if(_0x3bcdcd){_0x261e3d[_0x834e('0x1c')]=_0x3bcdcd[_0x834e('0x70')]({'plain':!![]});return db[_0x834e('0x71')]['find']({'where':{'id':_0x3bcdcd['MailInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x2fa64c,null))[_0x834e('0x15')](function(_0x493e1f){if(_0x493e1f){_0x261e3d[_0x834e('0x74')]=_0x493e1f[_0x834e('0x70')]({'plain':!![]});interaction_log[_0x834e('0x1d')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2821fe[_0x834e('0x60')]['id'],_0x2821fe[_0x834e('0x60')][_0x834e('0x2a')],_0x2821fe[_0x834e('0x60')][_0x834e('0x76')],_0x261e3d[_0x834e('0x74')]['id'],_0x2821fe['body']?JSON[_0x834e('0x19')](_0x2821fe[_0x834e('0x4b')]):_0x834e('0x77'));return respondWithRpcPromise(_0x834e('0x89'),_0x834e('0x8a'),_0x261e3d);}return null;})['then'](function(_0x4ebeba){var _0x508b3e='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4ebeba[_0x834e('0x1c')][_0x834e('0x79')];return db['sequelize'][_0x834e('0x32')](_0x508b3e,{'type':db[_0x834e('0x7b')]['QueryTypes'][_0x834e('0x7d')],'raw':!![]})[_0x834e('0x15')](function(_0xbf7693){return _0xbf7693;});})[_0x834e('0x15')](function(_0x1d1075){if(_0x1d1075){_0x261e3d[_0x834e('0x1c')]['contact']=_0x1d1075[0x0];if(!_0x2821fe['body'][_0x834e('0x6e')])return;return db[_0x834e('0x7f')][_0x834e('0x4a')]({'where':{'id':_0x2821fe['body'][_0x834e('0x6e')],'role':_0x834e('0x6f')},'attributes':['id','name',_0x834e('0x80'),_0x834e('0x8b'),_0x834e('0x81')],'raw':!![]});}return null;})[_0x834e('0x15')](function(_0x4cb802){if(!_0x4cb802)return null;_0x261e3d[_0x834e('0x1c')]['agent']=_0x4cb802;return _0x261e3d;})['then'](function(_0xc64958){if(_0xc64958){_0xc64958[_0x834e('0x1c')][_0x834e('0x8c')]=util[_0x834e('0x73')](_0x834e('0x82'),_0x2821fe[_0x834e('0x60')]['name']);_0xc64958['message'][_0x834e('0x83')]=_0x261e3d[_0x834e('0x83')];_0xc64958[_0x834e('0x1c')][_0x834e('0x8d')]=_0x834e('0x87');_0xc64958[_0x834e('0x1c')][_0x834e('0x4b')]=htmlToText['fromString'](_0x261e3d[_0x834e('0x1c')][_0x834e('0x4b')]);respondWithRpcPromise('EventManager',_0x834e('0x85'),{'event':_0x834e('0x8e'),'message':_0xc64958[_0x834e('0x1c')]},client9002);return _0x261e3d;}return null;})[_0x834e('0x15')](respondWithResult(_0x2fa64c,null))[_0x834e('0x1e')](handleError(_0x2fa64c,null));};exports[_0x834e('0x8f')]=function(_0x231f0b,_0x3b44f3){var _0x14e794=moment()[_0x834e('0x90')]()[_0x834e('0x91')]();var _0x152372=path[_0x834e('0x63')](config[_0x834e('0x64')],'server',_0x834e('0x92'),_0x834e('0x93'));var _0x522eab=path[_0x834e('0x63')](config['root'],_0x834e('0x94'),'files',_0x834e('0x62'));var _0x560d10=util[_0x834e('0x73')](_0x834e('0x95'),_0x14e794);return db[_0x834e('0x2e')][_0x834e('0x4a')]({'where':{'id':_0x231f0b['params']['id']},'attributes':['id',_0x834e('0x4b'),_0x834e('0x96'),'to','cc',_0x834e('0x97'),_0x834e('0x98'),_0x834e('0x99')],'include':_0x231f0b[_0x834e('0x32')][_0x834e('0x62')]?[{'model':db[_0x834e('0x9a')],'as':_0x834e('0x9b')}]:undefined})[_0x834e('0x15')](handleEntityNotFound(_0x3b44f3,null))[_0x834e('0x15')](function(_0x1cb4d0){if(_0x1cb4d0){var _0x3a6546=_0x1cb4d0;var _0x246f01={'from':_0x3a6546[_0x834e('0x96')],'to':_0x3a6546['to'],'subject':_0x3a6546[_0x834e('0x98')],'html':_0x3a6546[_0x834e('0x4b')],'headers':{'Date':moment(_0x3a6546['createdAt'])['format'](_0x834e('0x9c'))},'attachments':[]};if(_0x1cb4d0['cc']){_0x246f01[_0x834e('0x9d')]['Cc']=_0x1cb4d0['cc'];}if(_0x1cb4d0[_0x834e('0x97')]){_0x246f01[_0x834e('0x9d')][_0x834e('0x9e')]=_0x1cb4d0[_0x834e('0x97')];}return new BPromise(function(_0x22f90d,_0x40fd40){if(_0x1cb4d0[_0x834e('0x9b')]){for(var _0x58cd3b=0x0;_0x58cd3b<_0x1cb4d0[_0x834e('0x9b')][_0x834e('0x48')];_0x58cd3b++){var _0x513d9e=_0x1cb4d0[_0x834e('0x9b')][_0x58cd3b];var _0x54c129=path[_0x834e('0x63')](_0x522eab,_0x513d9e[_0x834e('0x66')]);if(fs[_0x834e('0x9f')](_0x54c129)){_0x246f01['attachments'][_0x834e('0xa0')]({'name':_0x513d9e[_0x834e('0x2a')],'contentType':_0x513d9e['type'],'data':fs['readFileSync'](_0x54c129)});}}}emlformat[_0x834e('0xa1')](_0x246f01,function(_0x3b7b1a,_0x4e0f4d){if(_0x3b7b1a)return _0x40fd40(_0x3b7b1a);fs[_0x834e('0xa2')](path[_0x834e('0x63')](_0x152372,_0x560d10),_0x4e0f4d);return _0x22f90d(_0x4e0f4d);});});}})[_0x834e('0x15')](function(_0x135219){if(_0x135219){return _0x3b44f3[_0x834e('0x8f')](path['join'](_0x152372,_0x560d10),_0x560d10,function(_0x4e7545){if(!_0x4e7545)fs[_0x834e('0xa3')](path['join'](_0x152372,_0x560d10));});}})['catch'](handleError(_0x3b44f3,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index fbb3f7c..f312a73 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 _0x2d92=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x5d5177,_0x24d3c8){var _0x195c11=function(_0x5e4f32){while(--_0x5e4f32){_0x5d5177['push'](_0x5d5177['shift']());}};_0x195c11(++_0x24d3c8);}(_0x2d92,0x18c));var _0x22d9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2d92[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x22d9('0x0'));var MailMessage=require(_0x22d9('0x1'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x22d9('0x2')](0x0);var events={'afterCreate':_0x22d9('0x3'),'afterUpdate':_0x22d9('0x4'),'afterDestroy':_0x22d9('0x5')};function emitEvent(_0x27f1f7){return function(_0x5005e7,_0x2ae340,_0x24d250){MailMessageEvents[_0x22d9('0x6')](_0x27f1f7+':'+_0x5005e7['id'],_0x5005e7);MailMessageEvents[_0x22d9('0x6')](_0x27f1f7,_0x5005e7);_0x24d250(null);};}for(var e in events){if(events[_0x22d9('0x7')](e)){var event=events[e];MailMessage[_0x22d9('0x8')](e,emitEvent(event));}}module['exports']=MailMessageEvents; \ No newline at end of file +var _0xd9df=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','../../mysqldb','MailMessage'];(function(_0x1332f2,_0x371ac9){var _0x25e500=function(_0x2dbd87){while(--_0x2dbd87){_0x1332f2['push'](_0x1332f2['shift']());}};_0x25e500(++_0x371ac9);}(_0xd9df,0xfa));var _0xfd9d=function(_0x24a8f7,_0xe101ce){_0x24a8f7=_0x24a8f7-0x0;var _0x146215=_0xd9df[_0x24a8f7];return _0x146215;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0xfd9d('0x0'))['db'][_0xfd9d('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xfd9d('0x2')](0x0);var events={'afterCreate':_0xfd9d('0x3'),'afterUpdate':_0xfd9d('0x4'),'afterDestroy':_0xfd9d('0x5')};function emitEvent(_0x4ee2c6){return function(_0x21101a,_0x41fc09,_0x2eeb78){MailMessageEvents[_0xfd9d('0x6')](_0x4ee2c6+':'+_0x21101a['id'],_0x21101a);MailMessageEvents[_0xfd9d('0x6')](_0x4ee2c6,_0x21101a);_0x2eeb78(null);};}for(var e in events){if(events[_0xfd9d('0x7')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module[_0xfd9d('0x8')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 422cc85..8b6709b 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 _0xdae1=['UserId','MailInteraction','findOne','then','update','createdAt','error','utf8mb4_unicode_ci','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailMessage.attributes','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','body','fromString','models','get','toLowerCase','direction','out','secret','isNil'];(function(_0x3d3f6c,_0x39da52){var _0x4a34c7=function(_0x41be02){while(--_0x41be02){_0x3d3f6c['push'](_0x3d3f6c['shift']());}};_0x4a34c7(++_0x39da52);}(_0xdae1,0x90));var _0x1dae=function(_0x68ee8b,_0x3cc6c5){_0x68ee8b=_0x68ee8b-0x0;var _0x5148f7=_0xdae1[_0x68ee8b];return _0x5148f7;};'use strict';var _=require('lodash');var util=require(_0x1dae('0x0'));var logger=require('../../config/logger')(_0x1dae('0x1'));var moment=require(_0x1dae('0x2'));var BPromise=require(_0x1dae('0x3'));var rp=require(_0x1dae('0x4'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0x1dae('0x5'));var rimraf=require(_0x1dae('0x6'));var config=require(_0x1dae('0x7'));var attributes=require(_0x1dae('0x8'));module[_0x1dae('0x9')]=function(_0x35468e,_0x4337c9){return _0x35468e[_0x1dae('0xa')](_0x1dae('0xb'),attributes,{'tableName':_0x1dae('0xc'),'paranoid':![],'indexes':[{'name':_0x1dae('0xd'),'fields':[_0x1dae('0xd')]},{'name':_0x1dae('0xe'),'fields':[_0x1dae('0xf'),_0x1dae('0x10')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3f44fa,_0x375d42,_0x4161b7){if(_0x3f44fa[_0x1dae('0x11')]){_0x3f44fa[_0x1dae('0xf')]=htmlToText[_0x1dae('0x12')](_0x3f44fa[_0x1dae('0x11')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x4161b7(null,_0x375d42);},'afterCreate':function(_0x27b845,_0x1b3b63,_0x1d8aa2){var _0x2c738f=_0x35468e[_0x1dae('0x13')];var _0x52a5c8=_0x27b845[_0x1dae('0x14')]({'plain':!![]});if(_0x52a5c8['direction'][_0x1dae('0x15')]()==='in'||_0x52a5c8[_0x1dae('0x16')][_0x1dae('0x15')]()===_0x1dae('0x17')&&!_0x52a5c8[_0x1dae('0x18')]&&!_[_0x1dae('0x19')](_0x52a5c8[_0x1dae('0x1a')])){_0x2c738f[_0x1dae('0x1b')][_0x1dae('0x1c')]({'where':{'id':_0x52a5c8['MailInteractionId']}})[_0x1dae('0x1d')](function(_0x1bcf71){if(_0x1bcf71){_0x1bcf71[_0x1dae('0x1e')]({'lastMsgAt':_0x52a5c8[_0x1dae('0x1f')],'lastMsgDirection':_0x52a5c8[_0x1dae('0x16')][_0x1dae('0x15')]()});}})['catch'](function(_0x3f1ccd){console[_0x1dae('0x20')](_0x3f1ccd);});}_0x1d8aa2();}},'charset':'utf8mb4','collate':_0x1dae('0x21')});}; \ No newline at end of file +var _0x321c=['MailMessage','mail_messages','messageId','plainBody','subject','FULLTEXT','body','fromString','models','get','direction','toLowerCase','out','isNil','UserId','MailInteraction','findOne','then','update','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','html-to-text','rimraf','./mailMessage.attributes','exports','define'];(function(_0x5b1c50,_0x56e694){var _0x2d379b=function(_0x981b9c){while(--_0x981b9c){_0x5b1c50['push'](_0x5b1c50['shift']());}};_0x2d379b(++_0x56e694);}(_0x321c,0x1c4));var _0xc321=function(_0x16d0c9,_0x37b3e0){_0x16d0c9=_0x16d0c9-0x0;var _0x295744=_0x321c[_0x16d0c9];return _0x295744;};'use strict';var _=require(_0xc321('0x0'));var util=require('util');var logger=require(_0xc321('0x1'))(_0xc321('0x2'));var moment=require(_0xc321('0x3'));var BPromise=require(_0xc321('0x4'));var rp=require('request-promise');var htmlToText=require(_0xc321('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc321('0x6'));var config=require('../../config/environment');var attributes=require(_0xc321('0x7'));module[_0xc321('0x8')]=function(_0x5cda40,_0x5e8541){return _0x5cda40[_0xc321('0x9')](_0xc321('0xa'),attributes,{'tableName':_0xc321('0xb'),'paranoid':![],'indexes':[{'name':_0xc321('0xc'),'fields':['messageId']},{'name':'fti_mail_messages','fields':[_0xc321('0xd'),_0xc321('0xe')],'type':_0xc321('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1547d3,_0x3e8b9a,_0x178b9d){if(_0x1547d3[_0xc321('0x10')]){_0x1547d3[_0xc321('0xd')]=htmlToText[_0xc321('0x11')](_0x1547d3[_0xc321('0x10')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x178b9d(null,_0x3e8b9a);},'afterCreate':function(_0x5db0bf,_0x502220,_0x20d809){var _0x17dc4e=_0x5cda40[_0xc321('0x12')];var _0x4a0a7a=_0x5db0bf[_0xc321('0x13')]({'plain':!![]});if(_0x4a0a7a[_0xc321('0x14')][_0xc321('0x15')]()==='in'||_0x4a0a7a['direction']['toLowerCase']()===_0xc321('0x16')&&!_0x4a0a7a['secret']&&!_[_0xc321('0x17')](_0x4a0a7a[_0xc321('0x18')])){_0x17dc4e[_0xc321('0x19')][_0xc321('0x1a')]({'where':{'id':_0x4a0a7a['MailInteractionId']}})[_0xc321('0x1b')](function(_0x323461){if(_0x323461){_0x323461[_0xc321('0x1c')]({'lastMsgAt':_0x4a0a7a['createdAt'],'lastMsgDirection':_0x4a0a7a[_0xc321('0x14')]['toLowerCase']()});}})[_0xc321('0x1d')](function(_0x5b7d0e){console[_0xc321('0x1e')](_0x5b7d0e);});}_0x20d809();}},'charset':_0xc321('0x1f'),'collate':_0xc321('0x20')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index fef5ecd..a03240d 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 _0xfff0=['rpc','../../config/environment','client','http','redis','socket.io-emitter','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','create','body','options','CreateMailMessage','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x3695e5,_0x4fd15b){var _0x1b1190=function(_0x557522){while(--_0x557522){_0x3695e5['push'](_0x3695e5['shift']());}};_0x1b1190(++_0x4fd15b);}(_0xfff0,0x139));var _0x0fff=function(_0x478fff,_0xe0314e){_0x478fff=_0x478fff-0x0;var _0x37e349=_0xfff0[_0x478fff];return _0x37e349;};'use strict';var _=require('lodash');var util=require(_0x0fff('0x0'));var moment=require(_0x0fff('0x1'));var BPromise=require(_0x0fff('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0fff('0x3'));var db=require(_0x0fff('0x4'))['db'];var utils=require(_0x0fff('0x5'));var logger=require('../../config/logger')(_0x0fff('0x6'));var config=require(_0x0fff('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0fff('0x8')][_0x0fff('0x9')]({'port':0x232a});config[_0x0fff('0xa')]=_['defaults'](config[_0x0fff('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x0fff('0xb'))(new Redis(config['redis']));require(_0x0fff('0xc'))[_0x0fff('0xd')](socket);function respondWithRpcPromise(_0x4cc3f3,_0x227d28,_0x377b2f){return new BPromise(function(_0x1de923,_0x289e01){return client[_0x0fff('0xe')](_0x4cc3f3,_0x377b2f)[_0x0fff('0xf')](function(_0x363c0d){logger[_0x0fff('0x10')](_0x0fff('0x11'),_0x227d28,_0x0fff('0x12'));logger[_0x0fff('0x13')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x227d28,_0x0fff('0x12'),JSON['stringify'](_0x363c0d));if(_0x363c0d[_0x0fff('0x14')]){if(_0x363c0d[_0x0fff('0x14')][_0x0fff('0x15')]===0x1f4){logger[_0x0fff('0x14')]('MailMessage,\x20%s,\x20%s',_0x227d28,_0x363c0d['error'][_0x0fff('0x16')]);return _0x289e01(_0x363c0d['error']['message']);}logger['error'](_0x0fff('0x11'),_0x227d28,_0x363c0d[_0x0fff('0x14')]['message']);return _0x1de923(_0x363c0d[_0x0fff('0x14')][_0x0fff('0x16')]);}else{logger['info']('MailMessage,\x20%s,\x20%s',_0x227d28,'request\x20sent');_0x1de923(_0x363c0d[_0x0fff('0x17')][_0x0fff('0x16')]);}})[_0x0fff('0x18')](function(_0x3762dc){logger[_0x0fff('0x14')](_0x0fff('0x11'),_0x227d28,_0x3762dc);_0x289e01(_0x3762dc);});});}exports['CreateMailMessage']=function(_0x44a54a){var _0x136520=this;return new Promise(function(_0x48e6f9,_0x49d211){return db['MailMessage'][_0x0fff('0x19')](_0x44a54a[_0x0fff('0x1a')],{'raw':_0x44a54a[_0x0fff('0x1b')]?_0x44a54a[_0x0fff('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x0fff('0xf')](function(_0x2f8665){logger[_0x0fff('0x10')](_0x0fff('0x1c'),_0x44a54a);logger[_0x0fff('0x13')](_0x0fff('0x1c'),_0x44a54a,JSON['stringify'](_0x2f8665));_0x48e6f9(_0x2f8665);})[_0x0fff('0x18')](function(_0x29f702){logger[_0x0fff('0x14')](_0x0fff('0x1c'),_0x29f702[_0x0fff('0x16')],_0x44a54a);_0x49d211(_0x136520[_0x0fff('0x14')](0x1f4,_0x29f702['message']));});});}; \ No newline at end of file +var _0x63a5=['error','message','result','catch','body','options','raw','CreateMailMessage','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','redis','defaults','socket.io-emitter','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x1073c0,_0x24a981){var _0x52513e=function(_0x3459c6){while(--_0x3459c6){_0x1073c0['push'](_0x1073c0['shift']());}};_0x52513e(++_0x24a981);}(_0x63a5,0x18e));var _0x563a=function(_0x31ced5,_0x5d5415){_0x31ced5=_0x31ced5-0x0;var _0x10d9e5=_0x63a5[_0x31ced5];return _0x10d9e5;};'use strict';var _=require(_0x563a('0x0'));var util=require(_0x563a('0x1'));var moment=require(_0x563a('0x2'));var BPromise=require('bluebird');var rs=require(_0x563a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x563a('0x4'))['db'];var utils=require(_0x563a('0x5'));var logger=require(_0x563a('0x6'))(_0x563a('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x563a('0x8')]['http']({'port':0x232a});config[_0x563a('0x9')]=_[_0x563a('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x563a('0xb'))(new Redis(config[_0x563a('0x9')]));require(_0x563a('0xc'))[_0x563a('0xd')](socket);function respondWithRpcPromise(_0x255922,_0xa61ffa,_0xd1b480){return new BPromise(function(_0x381fab,_0x3e97a8){return client[_0x563a('0xe')](_0x255922,_0xd1b480)[_0x563a('0xf')](function(_0x2361dd){logger[_0x563a('0x10')](_0x563a('0x11'),_0xa61ffa,'request\x20sent');logger[_0x563a('0x12')](_0x563a('0x13'),_0xa61ffa,_0x563a('0x14'),JSON[_0x563a('0x15')](_0x2361dd));if(_0x2361dd[_0x563a('0x16')]){if(_0x2361dd[_0x563a('0x16')]['code']===0x1f4){logger[_0x563a('0x16')](_0x563a('0x11'),_0xa61ffa,_0x2361dd[_0x563a('0x16')][_0x563a('0x17')]);return _0x3e97a8(_0x2361dd['error']['message']);}logger[_0x563a('0x16')](_0x563a('0x11'),_0xa61ffa,_0x2361dd['error'][_0x563a('0x17')]);return _0x381fab(_0x2361dd[_0x563a('0x16')][_0x563a('0x17')]);}else{logger[_0x563a('0x10')]('MailMessage,\x20%s,\x20%s',_0xa61ffa,'request\x20sent');_0x381fab(_0x2361dd[_0x563a('0x18')][_0x563a('0x17')]);}})[_0x563a('0x19')](function(_0x526a51){logger['error']('MailMessage,\x20%s,\x20%s',_0xa61ffa,_0x526a51);_0x3e97a8(_0x526a51);});});}exports['CreateMailMessage']=function(_0x40916a){var _0x300956=this;return new Promise(function(_0x26061f,_0x43b7a8){return db['MailMessage']['create'](_0x40916a[_0x563a('0x1a')],{'raw':_0x40916a[_0x563a('0x1b')]?_0x40916a[_0x563a('0x1b')][_0x563a('0x1c')]===undefined?!![]:![]:!![]})[_0x563a('0xf')](function(_0x2dc7e2){logger[_0x563a('0x10')](_0x563a('0x1d'),_0x40916a);logger['debug'](_0x563a('0x1d'),_0x40916a,JSON['stringify'](_0x2dc7e2));_0x26061f(_0x2dc7e2);})[_0x563a('0x19')](function(_0xd3e0ae){logger[_0x563a('0x16')](_0x563a('0x1d'),_0xd3e0ae[_0x563a('0x17')],_0x40916a);_0x43b7a8(_0x300956[_0x563a('0x16')](0x1f4,_0xd3e0ae[_0x563a('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 03006a5..62f03ce 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 _0xb2b3=['mailMessage:','./mailMessage.events','save','remove','update','removeListener','register','length'];(function(_0x2fc571,_0x408679){var _0x22dfb5=function(_0x5c2829){while(--_0x5c2829){_0x2fc571['push'](_0x2fc571['shift']());}};_0x22dfb5(++_0x408679);}(_0xb2b3,0x71));var _0x3b2b=function(_0x2e17f9,_0x1fe9e9){_0x2e17f9=_0x2e17f9-0x0;var _0x1dcbfb=_0xb2b3[_0x2e17f9];return _0x1dcbfb;};'use strict';var MailMessageEvents=require(_0x3b2b('0x0'));var events=[_0x3b2b('0x1'),_0x3b2b('0x2'),_0x3b2b('0x3')];function createListener(_0xf005ed,_0x3de73b){return function(_0x2059f0){_0x3de73b['emit'](_0xf005ed,_0x2059f0);};}function removeListener(_0x3eff63,_0x222c10){return function(){MailMessageEvents[_0x3b2b('0x4')](_0x3eff63,_0x222c10);};}exports[_0x3b2b('0x5')]=function(_0x2581eb){for(var _0xc53a84=0x0,_0x83e7ef=events[_0x3b2b('0x6')];_0xc53a84<_0x83e7ef;_0xc53a84++){var _0x1a9054=events[_0xc53a84];var _0x3ec416=createListener(_0x3b2b('0x7')+_0x1a9054,_0x2581eb);MailMessageEvents['on'](_0x1a9054,_0x3ec416);}}; \ No newline at end of file +var _0x5959=['removeListener','length','./mailMessage.events','save','remove','emit'];(function(_0x2bd264,_0x53a5d4){var _0x3cd2e3=function(_0x125cd0){while(--_0x125cd0){_0x2bd264['push'](_0x2bd264['shift']());}};_0x3cd2e3(++_0x53a5d4);}(_0x5959,0x17c));var _0x9595=function(_0x587577,_0x53a237){_0x587577=_0x587577-0x0;var _0x75d167=_0x5959[_0x587577];return _0x75d167;};'use strict';var MailMessageEvents=require(_0x9595('0x0'));var events=[_0x9595('0x1'),_0x9595('0x2'),'update'];function createListener(_0xe10bde,_0x75abfc){return function(_0x2f7353){_0x75abfc[_0x9595('0x3')](_0xe10bde,_0x2f7353);};}function removeListener(_0x26efdd,_0x4de678){return function(){MailMessageEvents[_0x9595('0x4')](_0x26efdd,_0x4de678);};}exports['register']=function(_0x20e2fb){for(var _0x19b27c=0x0,_0x5c92e4=events[_0x9595('0x5')];_0x19b27c<_0x5c92e4;_0x19b27c++){var _0x2ec6a5=events[_0x19b27c];var _0x24cbea=createListener('mailMessage:'+_0x2ec6a5,_0x20e2fb);MailMessageEvents['on'](_0x2ec6a5,_0x24cbea);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 0e84fe2..feabe45 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 _0x5145=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','/:id/users','post','create','addAgents','put','update','destroy','delete','exports','multer','util','path'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5145,0x102));var _0x5514=function(_0x2c3135,_0x38e21f){_0x2c3135=_0x2c3135-0x0;var _0x333704=_0x5145[_0x2c3135];return _0x333704;};'use strict';var multer=require(_0x5514('0x0'));var util=require(_0x5514('0x1'));var path=require(_0x5514('0x2'));var timeout=require(_0x5514('0x3'));var express=require(_0x5514('0x4'));var router=express[_0x5514('0x5')]();var fs_extra=require(_0x5514('0x6'));var auth=require(_0x5514('0x7'));var interaction=require(_0x5514('0x8'));var config=require(_0x5514('0x9'));var controller=require(_0x5514('0xa'));router[_0x5514('0xb')]('/',auth[_0x5514('0xc')](),controller['index']);router[_0x5514('0xb')](_0x5514('0xd'),auth[_0x5514('0xc')](),controller[_0x5514('0xe')]);router['get'](_0x5514('0xf'),auth[_0x5514('0xc')](),controller[_0x5514('0x10')]);router['get']('/:id/members',auth[_0x5514('0xc')](),controller[_0x5514('0x11')]);router[_0x5514('0xb')](_0x5514('0x12'),auth['isAuthenticated'](),controller[_0x5514('0x13')]);router[_0x5514('0xb')](_0x5514('0x14'),auth['isAuthenticated'](),controller['getAgents']);router[_0x5514('0x15')]('/',auth[_0x5514('0xc')](),controller[_0x5514('0x16')]);router[_0x5514('0x15')](_0x5514('0x12'),auth[_0x5514('0xc')](),controller['addTeams']);router[_0x5514('0x15')](_0x5514('0x14'),auth[_0x5514('0xc')](),controller[_0x5514('0x17')]);router[_0x5514('0x18')](_0x5514('0xf'),auth['isAuthenticated'](),controller[_0x5514('0x19')]);router['delete']('/:id',auth[_0x5514('0xc')](),controller[_0x5514('0x1a')]);router[_0x5514('0x1b')]('/:id/teams',auth[_0x5514('0xc')](),controller['removeTeams']);router[_0x5514('0x1b')](_0x5514('0x14'),auth[_0x5514('0xc')](),controller['removeAgents']);module[_0x5514('0x1c')]=router; \ No newline at end of file +var _0x89ad=['destroy','removeAgents','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./mailQueue.controller','isAuthenticated','describe','/:id','show','get','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','create','addTeams','addAgents','update','delete'];(function(_0x200cf6,_0x59c03a){var _0x2ee417=function(_0x370739){while(--_0x370739){_0x200cf6['push'](_0x200cf6['shift']());}};_0x2ee417(++_0x59c03a);}(_0x89ad,0x154));var _0xd89a=function(_0x27f981,_0x5ef9cc){_0x27f981=_0x27f981-0x0;var _0x5c9561=_0x89ad[_0x27f981];return _0x5c9561;};'use strict';var multer=require(_0xd89a('0x0'));var util=require(_0xd89a('0x1'));var path=require(_0xd89a('0x2'));var timeout=require(_0xd89a('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xd89a('0x4'));var auth=require(_0xd89a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd89a('0x6'));var controller=require(_0xd89a('0x7'));router['get']('/',auth[_0xd89a('0x8')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0xd89a('0x9')]);router['get'](_0xd89a('0xa'),auth[_0xd89a('0x8')](),controller[_0xd89a('0xb')]);router[_0xd89a('0xc')](_0xd89a('0xd'),auth[_0xd89a('0x8')](),controller[_0xd89a('0xe')]);router['get'](_0xd89a('0xf'),auth[_0xd89a('0x8')](),controller[_0xd89a('0x10')]);router[_0xd89a('0xc')](_0xd89a('0x11'),auth['isAuthenticated'](),controller['getAgents']);router[_0xd89a('0x12')]('/',auth[_0xd89a('0x8')](),controller[_0xd89a('0x13')]);router['post']('/:id/teams',auth[_0xd89a('0x8')](),controller[_0xd89a('0x14')]);router[_0xd89a('0x12')](_0xd89a('0x11'),auth[_0xd89a('0x8')](),controller[_0xd89a('0x15')]);router['put'](_0xd89a('0xa'),auth[_0xd89a('0x8')](),controller[_0xd89a('0x16')]);router[_0xd89a('0x17')]('/:id',auth[_0xd89a('0x8')](),controller[_0xd89a('0x18')]);router[_0xd89a('0x17')](_0xd89a('0xf'),auth['isAuthenticated'](),controller['removeTeams']);router[_0xd89a('0x17')]('/:id/users',auth[_0xd89a('0x8')](),controller[_0xd89a('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 138ac92..4f9c21b 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 _0x0093=['STRING','INTEGER','ENUM','roundrobin'];(function(_0x10b7b1,_0x1f83b6){var _0x49caf4=function(_0x36dee7){while(--_0x36dee7){_0x10b7b1['push'](_0x10b7b1['shift']());}};_0x49caf4(++_0x1f83b6);}(_0x0093,0xec));var _0x3009=function(_0xf69f10,_0x1a2637){_0xf69f10=_0xf69f10-0x0;var _0x50d82e=_0x0093[_0xf69f10];return _0x50d82e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3009('0x0')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3009('0x0')]},'timeout':{'type':Sequelize[_0x3009('0x1')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3009('0x2')]('rrmemory','beepall',_0x3009('0x3'))}}; \ No newline at end of file +var _0xfad4=['name','ENUM','rrmemory','roundrobin','sequelize','exports','STRING'];(function(_0x350ea8,_0x52e532){var _0x3013a2=function(_0xd560f1){while(--_0xd560f1){_0x350ea8['push'](_0x350ea8['shift']());}};_0x3013a2(++_0x52e532);}(_0xfad4,0x138));var _0x4fad=function(_0x1d1c16,_0x5b88ff){_0x1d1c16=_0x1d1c16-0x0;var _0x38584f=_0xfad4[_0x1d1c16];return _0x38584f;};'use strict';var Sequelize=require(_0x4fad('0x0'));module[_0x4fad('0x1')]={'name':{'type':Sequelize[_0x4fad('0x2')],'unique':_0x4fad('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4fad('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4fad('0x4')](_0x4fad('0x5'),'beepall',_0x4fad('0x6'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 820114d..d2450eb 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 _0x23c6=['attributes','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','intersection','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','MailQueues','UserProfileSection','userProfileId','autoAssociation','describe','getMembers','findOne','UserMailQueue','length','hasOwnProperty','MailQueueId','findAndCountAll','agent','mailPause','updatedAt','format','%s/%s','SIP','createdAt','Team','pick','getTeams','addTeams','ids','User','online','voicePause','flatMap','sequelize','transaction','each','findOrCreate','forEach','userMailQueue:save','removeTeams','Agents','select','from','team_has_mail_queues','join','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','every','TeamId','all','union','compact','value','isEmpty','removeAgents','emit','userMailQueue:remove','addAgents','omit','spread','getAgents','zip-dir','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','get','UserProfileResource','destroy','error','name','map','MailQueue','fieldName','type','key','model','query','keys','fields'];(function(_0x4ee9b5,_0x5c652e){var _0x1f1c81=function(_0x43c960){while(--_0x43c960){_0x4ee9b5['push'](_0x4ee9b5['shift']());}};_0x1f1c81(++_0x5c652e);}(_0x23c6,0xe1));var _0x623c=function(_0x10cb65,_0xa09d0b){_0x10cb65=_0x10cb65-0x0;var _0xeaa06a=_0x23c6[_0x10cb65];return _0xeaa06a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x623c('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x623c('0x1'));var moment=require(_0x623c('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x623c('0x3'));var util=require(_0x623c('0x4'));var path=require(_0x623c('0x5'));var sox=require(_0x623c('0x6'));var csv=require('to-csv');var ejs=require(_0x623c('0x7'));var fs=require('fs');var fs_extra=require(_0x623c('0x8'));var _=require(_0x623c('0x9'));var squel=require('squel');var crypto=require(_0x623c('0xa'));var jsforce=require(_0x623c('0xb'));var deskjs=require(_0x623c('0xc'));var toCsv=require(_0x623c('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x623c('0xe'));var authService=require(_0x623c('0xf'));var qs=require(_0x623c('0x10'));var as=require(_0x623c('0x11'));var hardwareService=require(_0x623c('0x12'));var logger=require(_0x623c('0x13'))(_0x623c('0x14'));var utils=require('../../config/utils');var config=require(_0x623c('0x15'));var licenseUtil=require(_0x623c('0x16'));var db=require(_0x623c('0x17'))['db'];config[_0x623c('0x18')]=_['defaults'](config[_0x623c('0x18')],{'host':_0x623c('0x19'),'port':0x18eb});var socket=require(_0x623c('0x1a'))(new Redis(config[_0x623c('0x18')]));require(_0x623c('0x1b'))[_0x623c('0x1c')](socket);function respondWithStatusCode(_0x232123,_0x2bbb2c){_0x2bbb2c=_0x2bbb2c||0xcc;return function(_0x47da2e){if(_0x47da2e){return _0x232123[_0x623c('0x1d')](_0x2bbb2c);}return _0x232123[_0x623c('0x1e')](_0x2bbb2c)[_0x623c('0x1f')]();};}function respondWithResult(_0x3e64af,_0x56012c){_0x56012c=_0x56012c||0xc8;return function(_0x1cc8a8){if(_0x1cc8a8){return _0x3e64af[_0x623c('0x1e')](_0x56012c)[_0x623c('0x20')](_0x1cc8a8);}};}function respondWithFilteredResult(_0x38a387,_0x5a61fd){return function(_0x3df56b){if(_0x3df56b){var _0x21ed5d=typeof _0x5a61fd[_0x623c('0x21')]===_0x623c('0x22')&&typeof _0x5a61fd[_0x623c('0x23')]==='undefined';var _0x4717ec=_0x3df56b['count'];var _0x463e3c=_0x21ed5d?0x0:_0x5a61fd['offset'];var _0x4da219=_0x21ed5d?_0x3df56b[_0x623c('0x24')]:_0x5a61fd[_0x623c('0x21')]+_0x5a61fd[_0x623c('0x23')];var _0x3ad344;if(_0x4da219>=_0x4717ec){_0x4da219=_0x4717ec;_0x3ad344=0xc8;}else{_0x3ad344=0xce;}_0x38a387[_0x623c('0x1e')](_0x3ad344);return _0x38a387[_0x623c('0x25')](_0x623c('0x26'),_0x463e3c+'-'+_0x4da219+'/'+_0x4717ec)[_0x623c('0x20')](_0x3df56b);}return null;};}function patchUpdates(_0x160860){return function(_0x307051){try{jsonpatch['apply'](_0x307051,_0x160860,!![]);}catch(_0x4c47f7){return BPromise[_0x623c('0x27')](_0x4c47f7);}return _0x307051[_0x623c('0x28')]();};}function saveUpdates(_0x30a7ff,_0x2f3d93){return function(_0x5a39b6){if(_0x5a39b6){return _0x5a39b6[_0x623c('0x29')](_0x30a7ff)[_0x623c('0x2a')](function(_0xa25834){return _0xa25834;});}return null;};}function removeEntity(_0x53db34,_0x2021a4){return function(_0xa61869){if(_0xa61869){return _0xa61869['destroy']()[_0x623c('0x2a')](function(){var _0x5cb067=_0xa61869[_0x623c('0x2b')]({'plain':!![]});var _0x486141='MailQueues';return db[_0x623c('0x2c')][_0x623c('0x2d')]({'where':{'type':_0x486141,'resourceId':_0x5cb067['id']}})[_0x623c('0x2a')](function(){return _0xa61869;});})['then'](function(){_0x53db34[_0x623c('0x1e')](0xcc)[_0x623c('0x1f')]();});}};}function handleEntityNotFound(_0x194b89,_0x25a740){return function(_0x102655){if(!_0x102655){_0x194b89[_0x623c('0x1d')](0x194);}return _0x102655;};}function handleError(_0x376a51,_0x58419c){_0x58419c=_0x58419c||0x1f4;return function(_0x16bbe7){logger[_0x623c('0x2e')](_0x16bbe7['stack']);if(_0x16bbe7[_0x623c('0x2f')]){delete _0x16bbe7[_0x623c('0x2f')];}_0x376a51['status'](_0x58419c)['send'](_0x16bbe7);};}exports['index']=function(_0x3078fd,_0x263118){var _0x233fba={},_0x25ca18={},_0x368518={'count':0x0,'rows':[]};var _0x9f9706=_[_0x623c('0x30')](db[_0x623c('0x31')]['rawAttributes'],function(_0x1cb292){return{'name':_0x1cb292[_0x623c('0x32')],'type':_0x1cb292[_0x623c('0x33')][_0x623c('0x34')]};});_0x25ca18[_0x623c('0x35')]=_[_0x623c('0x30')](_0x9f9706,_0x623c('0x2f'));_0x25ca18[_0x623c('0x36')]=_[_0x623c('0x37')](_0x3078fd[_0x623c('0x36')]);_0x25ca18['filters']=_['intersection'](_0x25ca18[_0x623c('0x35')],_0x25ca18['query']);_0x233fba['attributes']=_['intersection'](_0x25ca18[_0x623c('0x35')],qs[_0x623c('0x38')](_0x3078fd[_0x623c('0x36')][_0x623c('0x38')]));_0x233fba['attributes']=_0x233fba[_0x623c('0x39')]['length']?_0x233fba['attributes']:_0x25ca18[_0x623c('0x35')];if(!_0x3078fd[_0x623c('0x36')]['hasOwnProperty'](_0x623c('0x3a'))){_0x233fba['limit']=qs[_0x623c('0x23')](_0x3078fd['query'][_0x623c('0x23')]);_0x233fba[_0x623c('0x21')]=qs[_0x623c('0x21')](_0x3078fd[_0x623c('0x36')][_0x623c('0x21')]);}_0x233fba[_0x623c('0x3b')]=qs[_0x623c('0x3c')](_0x3078fd[_0x623c('0x36')][_0x623c('0x3c')]);_0x233fba[_0x623c('0x3d')]=qs[_0x623c('0x3e')](_['pick'](_0x3078fd[_0x623c('0x36')],_0x25ca18[_0x623c('0x3e')]),_0x9f9706);if(_0x3078fd[_0x623c('0x36')][_0x623c('0x3f')]){_0x233fba[_0x623c('0x3d')]=_[_0x623c('0x40')](_0x233fba[_0x623c('0x3d')],{'$or':_[_0x623c('0x30')](_0x9f9706,function(_0xa901be){if(_0xa901be['type']!==_0x623c('0x41')){var _0x560b97={};_0x560b97[_0xa901be[_0x623c('0x2f')]]={'$like':'%'+_0x3078fd[_0x623c('0x36')][_0x623c('0x3f')]+'%'};return _0x560b97;}})});}_0x233fba=_[_0x623c('0x40')]({},_0x233fba,_0x3078fd[_0x623c('0x42')]);var _0x1d07a3={'where':_0x233fba[_0x623c('0x3d')]};return db[_0x623c('0x31')][_0x623c('0x24')](_0x1d07a3)[_0x623c('0x2a')](function(_0x51340a){_0x368518[_0x623c('0x24')]=_0x51340a;if(_0x3078fd[_0x623c('0x36')]['includeAll']){_0x233fba[_0x623c('0x43')]=[{'all':!![]}];}return db[_0x623c('0x31')][_0x623c('0x44')](_0x233fba);})[_0x623c('0x2a')](function(_0x2c8ba7){_0x368518[_0x623c('0x45')]=_0x2c8ba7;return _0x368518;})['then'](respondWithFilteredResult(_0x263118,_0x233fba))[_0x623c('0x46')](handleError(_0x263118,null));};exports[_0x623c('0x47')]=function(_0x2cafac,_0x42ee48){var _0x7501aa={'raw':!![],'where':{'id':_0x2cafac[_0x623c('0x48')]['id']}},_0x1ebd8d={};_0x1ebd8d['model']=_['keys'](db[_0x623c('0x31')][_0x623c('0x49')]);_0x1ebd8d[_0x623c('0x36')]=_[_0x623c('0x37')](_0x2cafac[_0x623c('0x36')]);_0x1ebd8d[_0x623c('0x3e')]=_[_0x623c('0x4a')](_0x1ebd8d['model'],_0x1ebd8d[_0x623c('0x36')]);_0x7501aa[_0x623c('0x39')]=_[_0x623c('0x4a')](_0x1ebd8d['model'],qs[_0x623c('0x38')](_0x2cafac['query'][_0x623c('0x38')]));_0x7501aa[_0x623c('0x39')]=_0x7501aa[_0x623c('0x39')]['length']?_0x7501aa[_0x623c('0x39')]:_0x1ebd8d[_0x623c('0x35')];if(_0x2cafac[_0x623c('0x36')][_0x623c('0x4b')]){_0x7501aa[_0x623c('0x43')]=[{'all':!![]}];}_0x7501aa=_[_0x623c('0x40')]({},_0x7501aa,_0x2cafac['options']);return db[_0x623c('0x31')][_0x623c('0x4c')](_0x7501aa)[_0x623c('0x2a')](handleEntityNotFound(_0x42ee48,null))[_0x623c('0x2a')](respondWithResult(_0x42ee48,null))['catch'](handleError(_0x42ee48,null));};exports[_0x623c('0x4d')]=function(_0xacbd5a,_0x5b41fc){return db[_0x623c('0x31')]['create'](_0xacbd5a[_0x623c('0x4e')],{})['then'](function(_0x576cdf){var _0x34445f=_0xacbd5a['user'][_0x623c('0x2b')]({'plain':!![]});if(!_0x34445f)throw new Error(_0x623c('0x4f'));if(_0x34445f['role']===_0x623c('0x50')){var _0x4dc023=_0x576cdf[_0x623c('0x2b')]({'plain':!![]});var _0x481ba7=_0x623c('0x51');return db[_0x623c('0x52')][_0x623c('0x4c')]({'where':{'name':_0x481ba7,'userProfileId':_0x34445f[_0x623c('0x53')]},'raw':!![]})[_0x623c('0x2a')](function(_0x4d47a2){if(_0x4d47a2&&_0x4d47a2[_0x623c('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0x4dc023[_0x623c('0x2f')],'resourceId':_0x4dc023['id'],'type':_0x4d47a2[_0x623c('0x2f')],'sectionId':_0x4d47a2['id']},{})[_0x623c('0x2a')](function(){return _0x576cdf;});}else{return _0x576cdf;}})['catch'](function(_0x258ad6){logger[_0x623c('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x258ad6);throw _0x258ad6;});}return _0x576cdf;})['then'](respondWithResult(_0x5b41fc,0xc9))[_0x623c('0x46')](handleError(_0x5b41fc,null));};exports[_0x623c('0x29')]=function(_0x42a4aa,_0x472730){if(_0x42a4aa['body']['id']){delete _0x42a4aa[_0x623c('0x4e')]['id'];}return db['MailQueue'][_0x623c('0x4c')]({'where':{'id':_0x42a4aa[_0x623c('0x48')]['id']}})[_0x623c('0x2a')](handleEntityNotFound(_0x472730,null))[_0x623c('0x2a')](saveUpdates(_0x42a4aa[_0x623c('0x4e')],null))[_0x623c('0x2a')](respondWithResult(_0x472730,null))[_0x623c('0x46')](handleError(_0x472730,null));};exports[_0x623c('0x2d')]=function(_0x1011cd,_0x4b4f93){return db[_0x623c('0x31')][_0x623c('0x4c')]({'where':{'id':_0x1011cd[_0x623c('0x48')]['id']}})[_0x623c('0x2a')](handleEntityNotFound(_0x4b4f93,null))['then'](removeEntity(_0x4b4f93,null))[_0x623c('0x46')](handleError(_0x4b4f93,null));};exports[_0x623c('0x55')]=function(_0x3b433e,_0x1f7e30){return db[_0x623c('0x31')][_0x623c('0x55')]()[_0x623c('0x2a')](respondWithResult(_0x1f7e30,null))['catch'](handleError(_0x1f7e30,null));};exports[_0x623c('0x56')]=function(_0x5a9700,_0x5ee537,_0x374e54){var _0x48bee5={'raw':!![],'where':{}},_0xa63505={},_0xa9bdad;return db[_0x623c('0x31')][_0x623c('0x57')]({'where':{'id':_0x5a9700[_0x623c('0x48')]['id']}})['then'](handleEntityNotFound(_0x5ee537,null))['then'](function(_0x360c20){if(_0x360c20){_0xa9bdad=_0x360c20['get']({'plain':!![]});_0xa63505[_0x623c('0x35')]=_[_0x623c('0x37')](db[_0x623c('0x58')]['rawAttributes']);_0xa63505['query']=_['keys'](_0x5a9700[_0x623c('0x36')]);_0xa63505['filters']=_[_0x623c('0x4a')](_0xa63505[_0x623c('0x35')],_0xa63505['query']);_0x48bee5[_0x623c('0x39')]=_[_0x623c('0x4a')](_0xa63505[_0x623c('0x35')],qs[_0x623c('0x38')](_0x5a9700[_0x623c('0x36')][_0x623c('0x38')]));_0x48bee5['attributes']=_0x48bee5[_0x623c('0x39')][_0x623c('0x59')]?_0x48bee5[_0x623c('0x39')]:_0xa63505[_0x623c('0x35')];if(!_0x5a9700[_0x623c('0x36')][_0x623c('0x5a')](_0x623c('0x3a'))){_0x48bee5[_0x623c('0x23')]=qs['limit'](_0x5a9700[_0x623c('0x36')]['limit']);_0x48bee5[_0x623c('0x21')]=qs[_0x623c('0x21')](_0x5a9700['query'][_0x623c('0x21')]);}_0x48bee5[_0x623c('0x3b')]=qs[_0x623c('0x3c')](_0x5a9700[_0x623c('0x36')][_0x623c('0x3c')]);_0x48bee5[_0x623c('0x3d')]=qs[_0x623c('0x3e')](_['pick'](_0x5a9700[_0x623c('0x36')],_0xa63505[_0x623c('0x3e')]));_0x48bee5[_0x623c('0x3d')][_0x623c('0x5b')]=_0x360c20['id'];if(_0x5a9700[_0x623c('0x36')][_0x623c('0x3f')]){_0x48bee5[_0x623c('0x3d')]=_[_0x623c('0x40')](_0x48bee5['where'],{'$or':_[_0x623c('0x30')](_0x48bee5[_0x623c('0x39')],function(_0x17ea41){var _0x2ee606={};_0x2ee606[_0x17ea41]={'$like':'%'+_0x5a9700[_0x623c('0x36')]['filter']+'%'};return _0x2ee606;})});}_0x48bee5=_[_0x623c('0x40')]({},_0x48bee5,_0x5a9700[_0x623c('0x42')]);return db[_0x623c('0x58')][_0x623c('0x44')](_0x48bee5);}})[_0x623c('0x2a')](function(_0x3126dd){if(_0x3126dd){return db['User'][_0x623c('0x5c')]({'where':{'id':_[_0x623c('0x30')](_0x3126dd,'UserId'),'role':_0x623c('0x5d')},'attributes':['id','name',_0x623c('0x5e'),_0x623c('0x5f'),'createdAt']});}})['then'](function(_0x358c2d){if(_0x358c2d){return{'count':_0x358c2d['count'],'rows':_['map'](_0x358c2d['rows'],function(_0x269b77){return{'membername':_0x269b77[_0x623c('0x2f')],'UserId':_0x269b77['id'],'queue_name':_0xa9bdad[_0x623c('0x2f')],'MailQueueId':_0xa9bdad['id'],'interface':util[_0x623c('0x60')](_0x623c('0x61'),_0x623c('0x62'),_0x269b77[_0x623c('0x2f')]),'penalty':0x0,'paused':_0x269b77[_0x623c('0x5e')],'createdAt':_0x269b77[_0x623c('0x63')],'updatedAt':_0x269b77[_0x623c('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x623c('0x2a')](respondWithFilteredResult(_0x5ee537,_0x48bee5))['catch'](handleError(_0x5ee537,null));};exports['getTeams']=function(_0x947c8e,_0xb1f40f,_0x1f5395){var _0x5c0986={};var _0x43c2c6={};var _0x4d0de3;var _0x3c5b74;return db[_0x623c('0x31')][_0x623c('0x57')]({'where':{'id':_0x947c8e[_0x623c('0x48')]['id']}})[_0x623c('0x2a')](handleEntityNotFound(_0xb1f40f,null))[_0x623c('0x2a')](function(_0x35ef11){if(_0x35ef11){_0x4d0de3=_0x35ef11;_0x43c2c6[_0x623c('0x35')]=_[_0x623c('0x37')](db[_0x623c('0x64')][_0x623c('0x49')]);_0x43c2c6['query']=_[_0x623c('0x37')](_0x947c8e[_0x623c('0x36')]);_0x43c2c6[_0x623c('0x3e')]=_['intersection'](_0x43c2c6['model'],_0x43c2c6[_0x623c('0x36')]);_0x5c0986[_0x623c('0x39')]=_[_0x623c('0x4a')](_0x43c2c6[_0x623c('0x35')],qs[_0x623c('0x38')](_0x947c8e[_0x623c('0x36')]['fields']));_0x5c0986['attributes']=_0x5c0986['attributes']['length']?_0x5c0986[_0x623c('0x39')]:_0x43c2c6[_0x623c('0x35')];_0x5c0986[_0x623c('0x3b')]=qs[_0x623c('0x3c')](_0x947c8e[_0x623c('0x36')][_0x623c('0x3c')]);_0x5c0986[_0x623c('0x3d')]=qs[_0x623c('0x3e')](_[_0x623c('0x65')](_0x947c8e[_0x623c('0x36')],_0x43c2c6['filters']));if(_0x947c8e['query'][_0x623c('0x3f')]){_0x5c0986['where']=_[_0x623c('0x40')](_0x5c0986[_0x623c('0x3d')],{'$or':_[_0x623c('0x30')](_0x5c0986[_0x623c('0x39')],function(_0x4c1406){var _0x14317b={};_0x14317b[_0x4c1406]={'$like':'%'+_0x947c8e[_0x623c('0x36')][_0x623c('0x3f')]+'%'};return _0x14317b;})});}_0x5c0986=_[_0x623c('0x40')]({},_0x5c0986,_0x947c8e['options']);return _0x4d0de3[_0x623c('0x66')](_0x5c0986);}})[_0x623c('0x2a')](function(_0x101889){if(_0x101889){_0x3c5b74=_0x101889['length'];if(!_0x947c8e[_0x623c('0x36')][_0x623c('0x5a')](_0x623c('0x3a'))){_0x5c0986[_0x623c('0x23')]=qs[_0x623c('0x23')](_0x947c8e[_0x623c('0x36')][_0x623c('0x23')]);_0x5c0986[_0x623c('0x21')]=qs['offset'](_0x947c8e['query'][_0x623c('0x21')]);}return _0x4d0de3[_0x623c('0x66')](_0x5c0986);}})[_0x623c('0x2a')](function(_0x668d67){if(_0x668d67){return _0x668d67?{'count':_0x3c5b74,'rows':_0x668d67}:null;}})[_0x623c('0x2a')](respondWithResult(_0xb1f40f,null))[_0x623c('0x46')](handleError(_0xb1f40f,null));};exports[_0x623c('0x67')]=function(_0x22f46a,_0x5eccfa,_0x2b0a98){var _0x1f5e9e=_0x22f46a[_0x623c('0x4e')][_0x623c('0x68')];return db[_0x623c('0x64')][_0x623c('0x44')]({'where':{'id':_0x1f5e9e},'attributes':['id'],'include':[{'model':db[_0x623c('0x69')],'as':'Agents','attributes':['id',_0x623c('0x2f'),_0x623c('0x6a'),_0x623c('0x6b'),'interface'],'raw':!![]}]})[_0x623c('0x2a')](function(_0x1a20c3){if(_0x1a20c3){var _0x47bcfb=_[_0x623c('0x6c')](_0x1a20c3,function(_0x210583){var _0x2c9262=_0x210583[_0x623c('0x2b')]({'plain':!![]});return _0x2c9262['Agents'];});return db[_0x623c('0x31')][_0x623c('0x4c')]({'where':{'id':_0x22f46a[_0x623c('0x48')]['id']}})['then'](function(_0x310c84){return db[_0x623c('0x6d')][_0x623c('0x6e')](function(_0x1be7d5){return _0x310c84['addTeams'](_0x1f5e9e,{'transaction':_0x1be7d5})['then'](function(){return BPromise[_0x623c('0x6f')](_0x47bcfb,function(_0x5bd10d){return db[_0x623c('0x58')][_0x623c('0x70')]({'where':{'UserId':_0x5bd10d['id'],'MailQueueId':_0x22f46a['params']['id']},'transaction':_0x1be7d5});});})['then'](function(){_0x47bcfb[_0x623c('0x71')](function(_0xf4ae5d){socket['emit'](_0x623c('0x72'),{'UserId':_0xf4ae5d['id'],'MailQueueId':_0x310c84['id']});});});});});}})['then'](respondWithStatusCode(_0x5eccfa,null))['catch'](handleError(_0x5eccfa,null));};exports[_0x623c('0x73')]=function(_0x3ce7ca,_0x1bce15,_0x13259e){return db['Team'][_0x623c('0x44')]({'where':{'id':_0x3ce7ca['query'][_0x623c('0x68')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x623c('0x74'),'attributes':['id'],'raw':!![]}]})[_0x623c('0x2a')](handleEntityNotFound(_0x1bce15,null))['then'](function(_0x3fde40){var _0x4fcd17=_[_0x623c('0x30')](_0x3fde40,'id');var _0xdfa9b7=[];var _0x4c5a88=[];var _0x3320e2=squel[_0x623c('0x75')]();_0x3320e2['field']('tq.TeamId')[_0x623c('0x76')](_0x623c('0x77'),'tq')[_0x623c('0x78')]('user_has_teams','ut',_0x623c('0x79'))[_0x623c('0x3d')](_0x623c('0x7a'),_0x3ce7ca[_0x623c('0x48')]['id']);for(var _0x15a916=0x0;_0x15a916<_0x3fde40[_0x623c('0x59')];_0x15a916+=0x1){let _0x5b9437=_0x3fde40[_0x15a916];for(var _0x255431=0x0;_0x255431<_0x5b9437[_0x623c('0x74')][_0x623c('0x59')];_0x255431+=0x1){let _0x42f83e=_0x5b9437[_0x623c('0x74')][_0x255431];var _0x2dc938=_0x3320e2[_0x623c('0x7b')]();_0x2dc938['where'](_0x623c('0x7c'),_0x42f83e['id']);_0x4c5a88[_0x623c('0x7d')](db[_0x623c('0x6d')][_0x623c('0x36')](_0x2dc938[_0x623c('0x7e')](),{'type':db[_0x623c('0x6d')]['QueryTypes']['SELECT']})['then'](function(_0x1874f3){if(_0x1874f3['length']===0x1){return _0x42f83e['id'];}else{var _0x4319c3=_[_0x623c('0x7f')](_[_0x623c('0x30')](_0x1874f3,_0x623c('0x80')),function(_0x428bb3){return _['includes'](_0x4fcd17,_0x428bb3);});if(_0x4319c3){return _0x42f83e['id'];}}}));}}return BPromise[_0x623c('0x81')](_0x4c5a88)[_0x623c('0x2a')](function(_0x1550db){_0xdfa9b7=_(_0xdfa9b7)[_0x623c('0x82')](_0x1550db)[_0x623c('0x83')]()[_0x623c('0x84')]();return db[_0x623c('0x31')]['find']({'where':{'id':_0x3ce7ca[_0x623c('0x48')]['id']}})[_0x623c('0x2a')](function(_0x5f0731){return db[_0x623c('0x6d')][_0x623c('0x6e')](function(_0x30c71a){return _0x5f0731[_0x623c('0x73')](_0x3ce7ca[_0x623c('0x36')]['ids'],{'transaction':_0x30c71a})[_0x623c('0x2a')](function(){if(!_[_0x623c('0x85')](_0xdfa9b7)){return _0x5f0731[_0x623c('0x86')](_0xdfa9b7,{'transaction':_0x30c71a});}})[_0x623c('0x2a')](function(){_0xdfa9b7[_0x623c('0x71')](function(_0x29528c){socket[_0x623c('0x87')](_0x623c('0x88'),{'UserId':_0x29528c,'MailQueueId':_0x5f0731['id']});});});});});});})[_0x623c('0x2a')](respondWithStatusCode(_0x1bce15,null))['catch'](handleError(_0x1bce15,null));};exports[_0x623c('0x89')]=function(_0x34b4da,_0x40fbe1,_0x1db553){return db[_0x623c('0x31')][_0x623c('0x4c')]({'where':{'id':_0x34b4da[_0x623c('0x48')]['id']}})[_0x623c('0x2a')](handleEntityNotFound(_0x40fbe1,null))[_0x623c('0x2a')](function(_0x375459){if(_0x375459){return _0x375459[_0x623c('0x89')](_0x34b4da[_0x623c('0x4e')][_0x623c('0x68')],_[_0x623c('0x8a')](_0x34b4da[_0x623c('0x4e')],[_0x623c('0x68'),'id'])||{})[_0x623c('0x8b')](function(_0x153944){for(var _0x2e2dd3=0x0;_0x2e2dd3<_0x34b4da['body'][_0x623c('0x68')][_0x623c('0x59')];_0x2e2dd3+=0x1){socket[_0x623c('0x87')]('userMailQueue:save',{'UserId':Number(_0x34b4da[_0x623c('0x4e')][_0x623c('0x68')][_0x2e2dd3]),'MailQueueId':Number(_0x34b4da[_0x623c('0x48')]['id'])});}return _0x153944;});}})[_0x623c('0x2a')](respondWithResult(_0x40fbe1,null))[_0x623c('0x46')](handleError(_0x40fbe1,null));};exports[_0x623c('0x86')]=function(_0x5a4019,_0x169d7a,_0x47255c){return db['MailQueue']['find']({'where':{'id':_0x5a4019['params']['id']}})[_0x623c('0x2a')](handleEntityNotFound(_0x169d7a,null))[_0x623c('0x2a')](function(_0x1a503d){if(_0x1a503d){return _0x1a503d['removeAgents'](_0x5a4019[_0x623c('0x36')][_0x623c('0x68')])['then'](function(){if(_['isArray'](_0x5a4019[_0x623c('0x36')][_0x623c('0x68')])){for(var _0x4f7af3=0x0;_0x4f7af3<_0x5a4019[_0x623c('0x36')][_0x623c('0x68')][_0x623c('0x59')];_0x4f7af3+=0x1){socket[_0x623c('0x87')]('userMailQueue:remove',{'UserId':Number(_0x5a4019[_0x623c('0x36')][_0x623c('0x68')][_0x4f7af3]),'MailQueueId':Number(_0x5a4019[_0x623c('0x48')]['id'])});}}else{socket[_0x623c('0x87')](_0x623c('0x88'),{'UserId':Number(_0x5a4019['query']['ids']),'MailQueueId':Number(_0x5a4019[_0x623c('0x48')]['id'])});}});}})['then'](respondWithStatusCode(_0x169d7a,null))['catch'](handleError(_0x169d7a,null));};exports['getAgents']=function(_0x9159f7,_0xee73ed,_0x3cc51a){var _0x14de71={};var _0x19154f={};var _0xd02397;var _0x518869;return db[_0x623c('0x31')]['findOne']({'where':{'id':_0x9159f7['params']['id']}})[_0x623c('0x2a')](handleEntityNotFound(_0xee73ed,null))[_0x623c('0x2a')](function(_0x12d2fc){if(_0x12d2fc){_0xd02397=_0x12d2fc;_0x19154f[_0x623c('0x35')]=_[_0x623c('0x37')](db[_0x623c('0x69')][_0x623c('0x49')]);_0x19154f[_0x623c('0x36')]=_[_0x623c('0x37')](_0x9159f7[_0x623c('0x36')]);_0x19154f[_0x623c('0x3e')]=_['intersection'](_0x19154f[_0x623c('0x35')],_0x19154f[_0x623c('0x36')]);_0x14de71[_0x623c('0x39')]=_['intersection'](_0x19154f['model'],qs[_0x623c('0x38')](_0x9159f7[_0x623c('0x36')][_0x623c('0x38')]));_0x14de71[_0x623c('0x39')]=_0x14de71['attributes']['length']?_0x14de71[_0x623c('0x39')]:_0x19154f['model'];_0x14de71[_0x623c('0x3b')]=qs[_0x623c('0x3c')](_0x9159f7['query'][_0x623c('0x3c')]);_0x14de71[_0x623c('0x3d')]=qs[_0x623c('0x3e')](_[_0x623c('0x65')](_0x9159f7[_0x623c('0x36')],_0x19154f['filters']));if(_0x9159f7[_0x623c('0x36')][_0x623c('0x3f')]){_0x14de71[_0x623c('0x3d')]=_[_0x623c('0x40')](_0x14de71[_0x623c('0x3d')],{'$or':_['map'](_0x14de71[_0x623c('0x39')],function(_0x5e351d){var _0x507953={};_0x507953[_0x5e351d]={'$like':'%'+_0x9159f7[_0x623c('0x36')][_0x623c('0x3f')]+'%'};return _0x507953;})});}_0x14de71=_[_0x623c('0x40')]({},_0x14de71,_0x9159f7['options']);return _0xd02397[_0x623c('0x8c')](_0x14de71);}})['then'](function(_0x2f47fa){if(_0x2f47fa){_0x518869=_0x2f47fa[_0x623c('0x59')];if(!_0x9159f7[_0x623c('0x36')][_0x623c('0x5a')]('nolimit')){_0x14de71[_0x623c('0x23')]=qs[_0x623c('0x23')](_0x9159f7['query'][_0x623c('0x23')]);_0x14de71[_0x623c('0x21')]=qs['offset'](_0x9159f7[_0x623c('0x36')][_0x623c('0x21')]);}return _0xd02397[_0x623c('0x8c')](_0x14de71);}})[_0x623c('0x2a')](function(_0x53c431){if(_0x53c431){return _0x53c431?{'count':_0x518869,'rows':_0x53c431}:null;}})[_0x623c('0x2a')](respondWithResult(_0xee73ed,null))[_0x623c('0x46')](handleError(_0xee73ed,null));}; \ No newline at end of file +var _0x72d1=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','json','undefined','limit','count','offset','apply','reject','save','update','then','destroy','MailQueues','error','name','send','index','MailQueue','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','keys','find','catch','create','body','get','role','UserProfileResource','params','describe','getMembers','UserMailQueue','order','MailQueueId','User','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','%s/%s','getTeams','findOne','Team','addTeams','ids','Agents','online','transaction','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','TeamId','all','union','compact','value','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x135e32,_0x880d3a){var _0x2cbb45=function(_0x4707c){while(--_0x4707c){_0x135e32['push'](_0x135e32['shift']());}};_0x2cbb45(++_0x880d3a);}(_0x72d1,0x18b));var _0x172d=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x72d1[_0x422905];return _0x33dc6c;};'use strict';var emlformat=require(_0x172d('0x0'));var rimraf=require(_0x172d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x172d('0x2'));var rp=require(_0x172d('0x3'));var moment=require(_0x172d('0x4'));var BPromise=require(_0x172d('0x5'));var Mustache=require(_0x172d('0x6'));var util=require(_0x172d('0x7'));var path=require('path');var sox=require(_0x172d('0x8'));var csv=require('to-csv');var ejs=require(_0x172d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x172d('0xa'));var squel=require(_0x172d('0xb'));var crypto=require(_0x172d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x172d('0xd'));var toCsv=require(_0x172d('0xe'));var querystring=require(_0x172d('0xf'));var Papa=require(_0x172d('0x10'));var Redis=require(_0x172d('0x11'));var authService=require(_0x172d('0x12'));var qs=require(_0x172d('0x13'));var as=require(_0x172d('0x14'));var hardwareService=require(_0x172d('0x15'));var logger=require('../../config/logger')(_0x172d('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x172d('0x17'));var db=require('../../mysqldb')['db'];config[_0x172d('0x18')]=_[_0x172d('0x19')](config[_0x172d('0x18')],{'host':_0x172d('0x1a'),'port':0x18eb});var socket=require(_0x172d('0x1b'))(new Redis(config[_0x172d('0x18')]));require(_0x172d('0x1c'))[_0x172d('0x1d')](socket);function respondWithStatusCode(_0x523b26,_0x46e846){_0x46e846=_0x46e846||0xcc;return function(_0x47e66c){if(_0x47e66c){return _0x523b26[_0x172d('0x1e')](_0x46e846);}return _0x523b26[_0x172d('0x1f')](_0x46e846)['end']();};}function respondWithResult(_0x428612,_0x588d02){_0x588d02=_0x588d02||0xc8;return function(_0x63a011){if(_0x63a011){return _0x428612[_0x172d('0x1f')](_0x588d02)[_0x172d('0x20')](_0x63a011);}};}function respondWithFilteredResult(_0x5bd9a2,_0x55d2f0){return function(_0x34bd43){if(_0x34bd43){var _0x35cdac=typeof _0x55d2f0['offset']===_0x172d('0x21')&&typeof _0x55d2f0[_0x172d('0x22')]===_0x172d('0x21');var _0x25f30e=_0x34bd43[_0x172d('0x23')];var _0x49ccd5=_0x35cdac?0x0:_0x55d2f0[_0x172d('0x24')];var _0x5c2da6=_0x35cdac?_0x34bd43[_0x172d('0x23')]:_0x55d2f0[_0x172d('0x24')]+_0x55d2f0[_0x172d('0x22')];var _0x459e7e;if(_0x5c2da6>=_0x25f30e){_0x5c2da6=_0x25f30e;_0x459e7e=0xc8;}else{_0x459e7e=0xce;}_0x5bd9a2[_0x172d('0x1f')](_0x459e7e);return _0x5bd9a2['set']('Content-Range',_0x49ccd5+'-'+_0x5c2da6+'/'+_0x25f30e)[_0x172d('0x20')](_0x34bd43);}return null;};}function patchUpdates(_0x1b7bb8){return function(_0x425d95){try{jsonpatch[_0x172d('0x25')](_0x425d95,_0x1b7bb8,!![]);}catch(_0x181ee6){return BPromise[_0x172d('0x26')](_0x181ee6);}return _0x425d95[_0x172d('0x27')]();};}function saveUpdates(_0x4c2644,_0x285e44){return function(_0x4d9fd0){if(_0x4d9fd0){return _0x4d9fd0[_0x172d('0x28')](_0x4c2644)[_0x172d('0x29')](function(_0x36328c){return _0x36328c;});}return null;};}function removeEntity(_0x4aa20b,_0x34d0f9){return function(_0x1c9ab3){if(_0x1c9ab3){return _0x1c9ab3[_0x172d('0x2a')]()[_0x172d('0x29')](function(){var _0x3217ce=_0x1c9ab3['get']({'plain':!![]});var _0x3cc14f=_0x172d('0x2b');return db['UserProfileResource'][_0x172d('0x2a')]({'where':{'type':_0x3cc14f,'resourceId':_0x3217ce['id']}})[_0x172d('0x29')](function(){return _0x1c9ab3;});})[_0x172d('0x29')](function(){_0x4aa20b[_0x172d('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x7d3fab,_0x5d64fe){return function(_0x591e3b){if(!_0x591e3b){_0x7d3fab['sendStatus'](0x194);}return _0x591e3b;};}function handleError(_0x196c9a,_0x38e0c2){_0x38e0c2=_0x38e0c2||0x1f4;return function(_0x44ebce){logger[_0x172d('0x2c')](_0x44ebce['stack']);if(_0x44ebce[_0x172d('0x2d')]){delete _0x44ebce[_0x172d('0x2d')];}_0x196c9a['status'](_0x38e0c2)[_0x172d('0x2e')](_0x44ebce);};}exports[_0x172d('0x2f')]=function(_0x1b0edd,_0x535754){var _0x57f11c={},_0xa6de9e={},_0xaf24ee={'count':0x0,'rows':[]};var _0x15cc95=_['map'](db[_0x172d('0x30')][_0x172d('0x31')],function(_0x512d04){return{'name':_0x512d04[_0x172d('0x32')],'type':_0x512d04[_0x172d('0x33')][_0x172d('0x34')]};});_0xa6de9e[_0x172d('0x35')]=_[_0x172d('0x36')](_0x15cc95,'name');_0xa6de9e[_0x172d('0x37')]=_['keys'](_0x1b0edd[_0x172d('0x37')]);_0xa6de9e[_0x172d('0x38')]=_[_0x172d('0x39')](_0xa6de9e[_0x172d('0x35')],_0xa6de9e['query']);_0x57f11c['attributes']=_['intersection'](_0xa6de9e['model'],qs[_0x172d('0x3a')](_0x1b0edd[_0x172d('0x37')][_0x172d('0x3a')]));_0x57f11c['attributes']=_0x57f11c[_0x172d('0x3b')][_0x172d('0x3c')]?_0x57f11c[_0x172d('0x3b')]:_0xa6de9e[_0x172d('0x35')];if(!_0x1b0edd[_0x172d('0x37')][_0x172d('0x3d')](_0x172d('0x3e'))){_0x57f11c[_0x172d('0x22')]=qs[_0x172d('0x22')](_0x1b0edd['query'][_0x172d('0x22')]);_0x57f11c[_0x172d('0x24')]=qs[_0x172d('0x24')](_0x1b0edd[_0x172d('0x37')][_0x172d('0x24')]);}_0x57f11c['order']=qs['sort'](_0x1b0edd[_0x172d('0x37')][_0x172d('0x3f')]);_0x57f11c['where']=qs['filters'](_[_0x172d('0x40')](_0x1b0edd[_0x172d('0x37')],_0xa6de9e[_0x172d('0x38')]),_0x15cc95);if(_0x1b0edd['query'][_0x172d('0x41')]){_0x57f11c['where']=_[_0x172d('0x42')](_0x57f11c[_0x172d('0x43')],{'$or':_['map'](_0x15cc95,function(_0x3f82f3){if(_0x3f82f3[_0x172d('0x33')]!==_0x172d('0x44')){var _0x428131={};_0x428131[_0x3f82f3[_0x172d('0x2d')]]={'$like':'%'+_0x1b0edd['query'][_0x172d('0x41')]+'%'};return _0x428131;}})});}_0x57f11c=_[_0x172d('0x42')]({},_0x57f11c,_0x1b0edd[_0x172d('0x45')]);var _0x1ab36b={'where':_0x57f11c[_0x172d('0x43')]};return db[_0x172d('0x30')][_0x172d('0x23')](_0x1ab36b)[_0x172d('0x29')](function(_0x5cbe3a){_0xaf24ee[_0x172d('0x23')]=_0x5cbe3a;if(_0x1b0edd[_0x172d('0x37')][_0x172d('0x46')]){_0x57f11c[_0x172d('0x47')]=[{'all':!![]}];}return db[_0x172d('0x30')][_0x172d('0x48')](_0x57f11c);})[_0x172d('0x29')](function(_0x1b9704){_0xaf24ee[_0x172d('0x49')]=_0x1b9704;return _0xaf24ee;})[_0x172d('0x29')](respondWithFilteredResult(_0x535754,_0x57f11c))['catch'](handleError(_0x535754,null));};exports['show']=function(_0x5ff8e6,_0x378f04){var _0x4b0907={'raw':!![],'where':{'id':_0x5ff8e6['params']['id']}},_0x2ce76c={};_0x2ce76c['model']=_['keys'](db['MailQueue'][_0x172d('0x31')]);_0x2ce76c[_0x172d('0x37')]=_[_0x172d('0x4a')](_0x5ff8e6[_0x172d('0x37')]);_0x2ce76c[_0x172d('0x38')]=_[_0x172d('0x39')](_0x2ce76c[_0x172d('0x35')],_0x2ce76c[_0x172d('0x37')]);_0x4b0907[_0x172d('0x3b')]=_[_0x172d('0x39')](_0x2ce76c[_0x172d('0x35')],qs[_0x172d('0x3a')](_0x5ff8e6[_0x172d('0x37')][_0x172d('0x3a')]));_0x4b0907['attributes']=_0x4b0907[_0x172d('0x3b')]['length']?_0x4b0907[_0x172d('0x3b')]:_0x2ce76c['model'];if(_0x5ff8e6[_0x172d('0x37')][_0x172d('0x46')]){_0x4b0907[_0x172d('0x47')]=[{'all':!![]}];}_0x4b0907=_[_0x172d('0x42')]({},_0x4b0907,_0x5ff8e6[_0x172d('0x45')]);return db['MailQueue'][_0x172d('0x4b')](_0x4b0907)['then'](handleEntityNotFound(_0x378f04,null))[_0x172d('0x29')](respondWithResult(_0x378f04,null))[_0x172d('0x4c')](handleError(_0x378f04,null));};exports['create']=function(_0x55669e,_0x2263e2){return db['MailQueue'][_0x172d('0x4d')](_0x55669e[_0x172d('0x4e')],{})[_0x172d('0x29')](function(_0x3c141f){var _0x125765=_0x55669e['user'][_0x172d('0x4f')]({'plain':!![]});if(!_0x125765)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x125765[_0x172d('0x50')]==='user'){var _0x2f9f31=_0x3c141f['get']({'plain':!![]});var _0x3429a0=_0x172d('0x2b');return db['UserProfileSection'][_0x172d('0x4b')]({'where':{'name':_0x3429a0,'userProfileId':_0x125765['userProfileId']},'raw':!![]})[_0x172d('0x29')](function(_0x5cd6bd){if(_0x5cd6bd&&_0x5cd6bd['autoAssociation']===0x0){return db[_0x172d('0x51')][_0x172d('0x4d')]({'name':_0x2f9f31[_0x172d('0x2d')],'resourceId':_0x2f9f31['id'],'type':_0x5cd6bd[_0x172d('0x2d')],'sectionId':_0x5cd6bd['id']},{})[_0x172d('0x29')](function(){return _0x3c141f;});}else{return _0x3c141f;}})[_0x172d('0x4c')](function(_0x112a6f){logger[_0x172d('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x112a6f);throw _0x112a6f;});}return _0x3c141f;})[_0x172d('0x29')](respondWithResult(_0x2263e2,0xc9))[_0x172d('0x4c')](handleError(_0x2263e2,null));};exports['update']=function(_0x5e73ab,_0x3618ed){if(_0x5e73ab[_0x172d('0x4e')]['id']){delete _0x5e73ab[_0x172d('0x4e')]['id'];}return db[_0x172d('0x30')][_0x172d('0x4b')]({'where':{'id':_0x5e73ab[_0x172d('0x52')]['id']}})[_0x172d('0x29')](handleEntityNotFound(_0x3618ed,null))[_0x172d('0x29')](saveUpdates(_0x5e73ab[_0x172d('0x4e')],null))[_0x172d('0x29')](respondWithResult(_0x3618ed,null))[_0x172d('0x4c')](handleError(_0x3618ed,null));};exports[_0x172d('0x2a')]=function(_0x24cebd,_0x21aed5){return db[_0x172d('0x30')][_0x172d('0x4b')]({'where':{'id':_0x24cebd[_0x172d('0x52')]['id']}})['then'](handleEntityNotFound(_0x21aed5,null))['then'](removeEntity(_0x21aed5,null))['catch'](handleError(_0x21aed5,null));};exports[_0x172d('0x53')]=function(_0x2c8267,_0x18f26d){return db[_0x172d('0x30')][_0x172d('0x53')]()[_0x172d('0x29')](respondWithResult(_0x18f26d,null))[_0x172d('0x4c')](handleError(_0x18f26d,null));};exports[_0x172d('0x54')]=function(_0xb54fc6,_0x3e2057,_0x3386ba){var _0x4e3009={'raw':!![],'where':{}},_0x16b2ae={},_0x47dada;return db['MailQueue']['findOne']({'where':{'id':_0xb54fc6['params']['id']}})[_0x172d('0x29')](handleEntityNotFound(_0x3e2057,null))[_0x172d('0x29')](function(_0x1039e6){if(_0x1039e6){_0x47dada=_0x1039e6[_0x172d('0x4f')]({'plain':!![]});_0x16b2ae[_0x172d('0x35')]=_[_0x172d('0x4a')](db[_0x172d('0x55')][_0x172d('0x31')]);_0x16b2ae[_0x172d('0x37')]=_[_0x172d('0x4a')](_0xb54fc6['query']);_0x16b2ae[_0x172d('0x38')]=_[_0x172d('0x39')](_0x16b2ae[_0x172d('0x35')],_0x16b2ae['query']);_0x4e3009[_0x172d('0x3b')]=_[_0x172d('0x39')](_0x16b2ae[_0x172d('0x35')],qs['fields'](_0xb54fc6[_0x172d('0x37')][_0x172d('0x3a')]));_0x4e3009[_0x172d('0x3b')]=_0x4e3009[_0x172d('0x3b')][_0x172d('0x3c')]?_0x4e3009['attributes']:_0x16b2ae[_0x172d('0x35')];if(!_0xb54fc6['query']['hasOwnProperty'](_0x172d('0x3e'))){_0x4e3009['limit']=qs['limit'](_0xb54fc6[_0x172d('0x37')][_0x172d('0x22')]);_0x4e3009[_0x172d('0x24')]=qs[_0x172d('0x24')](_0xb54fc6[_0x172d('0x37')]['offset']);}_0x4e3009[_0x172d('0x56')]=qs[_0x172d('0x3f')](_0xb54fc6['query'][_0x172d('0x3f')]);_0x4e3009[_0x172d('0x43')]=qs[_0x172d('0x38')](_[_0x172d('0x40')](_0xb54fc6[_0x172d('0x37')],_0x16b2ae['filters']));_0x4e3009[_0x172d('0x43')][_0x172d('0x57')]=_0x1039e6['id'];if(_0xb54fc6['query']['filter']){_0x4e3009[_0x172d('0x43')]=_[_0x172d('0x42')](_0x4e3009[_0x172d('0x43')],{'$or':_[_0x172d('0x36')](_0x4e3009['attributes'],function(_0x19f3b5){var _0x15292a={};_0x15292a[_0x19f3b5]={'$like':'%'+_0xb54fc6[_0x172d('0x37')][_0x172d('0x41')]+'%'};return _0x15292a;})});}_0x4e3009=_[_0x172d('0x42')]({},_0x4e3009,_0xb54fc6['options']);return db[_0x172d('0x55')][_0x172d('0x48')](_0x4e3009);}})[_0x172d('0x29')](function(_0x437987){if(_0x437987){return db[_0x172d('0x58')][_0x172d('0x59')]({'where':{'id':_[_0x172d('0x36')](_0x437987,_0x172d('0x5a')),'role':_0x172d('0x5b')},'attributes':['id',_0x172d('0x2d'),_0x172d('0x5c'),_0x172d('0x5d'),_0x172d('0x5e')]});}})['then'](function(_0xc6eda6){if(_0xc6eda6){return{'count':_0xc6eda6[_0x172d('0x23')],'rows':_[_0x172d('0x36')](_0xc6eda6['rows'],function(_0x503f50){return{'membername':_0x503f50[_0x172d('0x2d')],'UserId':_0x503f50['id'],'queue_name':_0x47dada[_0x172d('0x2d')],'MailQueueId':_0x47dada['id'],'interface':util['format'](_0x172d('0x5f'),'SIP',_0x503f50['name']),'penalty':0x0,'paused':_0x503f50[_0x172d('0x5c')],'createdAt':_0x503f50[_0x172d('0x5e')],'updatedAt':_0x503f50[_0x172d('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x3e2057,_0x4e3009))[_0x172d('0x4c')](handleError(_0x3e2057,null));};exports[_0x172d('0x60')]=function(_0xf8d3f3,_0x33ffea,_0x41fecd){var _0x2d57ea={};var _0x16f126={};var _0xed94b1;var _0x465923;return db[_0x172d('0x30')][_0x172d('0x61')]({'where':{'id':_0xf8d3f3[_0x172d('0x52')]['id']}})['then'](handleEntityNotFound(_0x33ffea,null))[_0x172d('0x29')](function(_0x4f7526){if(_0x4f7526){_0xed94b1=_0x4f7526;_0x16f126[_0x172d('0x35')]=_[_0x172d('0x4a')](db[_0x172d('0x62')][_0x172d('0x31')]);_0x16f126['query']=_[_0x172d('0x4a')](_0xf8d3f3[_0x172d('0x37')]);_0x16f126[_0x172d('0x38')]=_['intersection'](_0x16f126['model'],_0x16f126[_0x172d('0x37')]);_0x2d57ea[_0x172d('0x3b')]=_[_0x172d('0x39')](_0x16f126[_0x172d('0x35')],qs['fields'](_0xf8d3f3['query']['fields']));_0x2d57ea['attributes']=_0x2d57ea[_0x172d('0x3b')][_0x172d('0x3c')]?_0x2d57ea[_0x172d('0x3b')]:_0x16f126[_0x172d('0x35')];_0x2d57ea[_0x172d('0x56')]=qs[_0x172d('0x3f')](_0xf8d3f3['query'][_0x172d('0x3f')]);_0x2d57ea['where']=qs[_0x172d('0x38')](_['pick'](_0xf8d3f3[_0x172d('0x37')],_0x16f126[_0x172d('0x38')]));if(_0xf8d3f3['query'][_0x172d('0x41')]){_0x2d57ea[_0x172d('0x43')]=_[_0x172d('0x42')](_0x2d57ea['where'],{'$or':_[_0x172d('0x36')](_0x2d57ea['attributes'],function(_0x1c7fc3){var _0x17091c={};_0x17091c[_0x1c7fc3]={'$like':'%'+_0xf8d3f3[_0x172d('0x37')][_0x172d('0x41')]+'%'};return _0x17091c;})});}_0x2d57ea=_[_0x172d('0x42')]({},_0x2d57ea,_0xf8d3f3[_0x172d('0x45')]);return _0xed94b1[_0x172d('0x60')](_0x2d57ea);}})[_0x172d('0x29')](function(_0xca7419){if(_0xca7419){_0x465923=_0xca7419[_0x172d('0x3c')];if(!_0xf8d3f3['query'][_0x172d('0x3d')](_0x172d('0x3e'))){_0x2d57ea[_0x172d('0x22')]=qs[_0x172d('0x22')](_0xf8d3f3[_0x172d('0x37')][_0x172d('0x22')]);_0x2d57ea[_0x172d('0x24')]=qs[_0x172d('0x24')](_0xf8d3f3[_0x172d('0x37')][_0x172d('0x24')]);}return _0xed94b1[_0x172d('0x60')](_0x2d57ea);}})[_0x172d('0x29')](function(_0xe458ef){if(_0xe458ef){return _0xe458ef?{'count':_0x465923,'rows':_0xe458ef}:null;}})[_0x172d('0x29')](respondWithResult(_0x33ffea,null))[_0x172d('0x4c')](handleError(_0x33ffea,null));};exports[_0x172d('0x63')]=function(_0x2fea17,_0x1590cf,_0x3d9e6d){var _0x261900=_0x2fea17[_0x172d('0x4e')][_0x172d('0x64')];return db[_0x172d('0x62')][_0x172d('0x48')]({'where':{'id':_0x261900},'attributes':['id'],'include':[{'model':db['User'],'as':_0x172d('0x65'),'attributes':['id',_0x172d('0x2d'),_0x172d('0x66'),'voicePause','interface'],'raw':!![]}]})['then'](function(_0x2ff91a){if(_0x2ff91a){var _0xb5b9d7=_['flatMap'](_0x2ff91a,function(_0x16c9da){var _0x17013b=_0x16c9da[_0x172d('0x4f')]({'plain':!![]});return _0x17013b['Agents'];});return db['MailQueue'][_0x172d('0x4b')]({'where':{'id':_0x2fea17['params']['id']}})[_0x172d('0x29')](function(_0x18d238){return db['sequelize'][_0x172d('0x67')](function(_0xefdf6e){return _0x18d238[_0x172d('0x63')](_0x261900,{'transaction':_0xefdf6e})[_0x172d('0x29')](function(){return BPromise['each'](_0xb5b9d7,function(_0x1df373){return db[_0x172d('0x55')][_0x172d('0x68')]({'where':{'UserId':_0x1df373['id'],'MailQueueId':_0x2fea17[_0x172d('0x52')]['id']},'transaction':_0xefdf6e});});})[_0x172d('0x29')](function(){_0xb5b9d7[_0x172d('0x69')](function(_0x419949){socket[_0x172d('0x6a')](_0x172d('0x6b'),{'UserId':_0x419949['id'],'MailQueueId':_0x18d238['id']});});});});});}})[_0x172d('0x29')](respondWithStatusCode(_0x1590cf,null))['catch'](handleError(_0x1590cf,null));};exports[_0x172d('0x6c')]=function(_0x1bae44,_0x31da0d,_0x19ebed){return db[_0x172d('0x62')][_0x172d('0x48')]({'where':{'id':_0x1bae44[_0x172d('0x37')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x172d('0x29')](handleEntityNotFound(_0x31da0d,null))[_0x172d('0x29')](function(_0x3e265d){var _0x5642d4=_[_0x172d('0x36')](_0x3e265d,'id');var _0x3cb6d2=[];var _0x9c39ad=[];var _0x49c2af=squel[_0x172d('0x6d')]();_0x49c2af[_0x172d('0x6e')](_0x172d('0x6f'))[_0x172d('0x70')](_0x172d('0x71'),'tq')[_0x172d('0x72')](_0x172d('0x73'),'ut',_0x172d('0x74'))[_0x172d('0x43')](_0x172d('0x75'),_0x1bae44[_0x172d('0x52')]['id']);for(var _0x30431d=0x0;_0x30431d<_0x3e265d[_0x172d('0x3c')];_0x30431d+=0x1){let _0x3cf900=_0x3e265d[_0x30431d];for(var _0x3428df=0x0;_0x3428df<_0x3cf900[_0x172d('0x65')][_0x172d('0x3c')];_0x3428df+=0x1){let _0x182898=_0x3cf900[_0x172d('0x65')][_0x3428df];var _0x14f8bb=_0x49c2af[_0x172d('0x76')]();_0x14f8bb[_0x172d('0x43')](_0x172d('0x77'),_0x182898['id']);_0x9c39ad[_0x172d('0x78')](db[_0x172d('0x79')]['query'](_0x14f8bb[_0x172d('0x7a')](),{'type':db['sequelize'][_0x172d('0x7b')][_0x172d('0x7c')]})[_0x172d('0x29')](function(_0x33a4dc){if(_0x33a4dc[_0x172d('0x3c')]===0x1){return _0x182898['id'];}else{var _0x225923=_['every'](_[_0x172d('0x36')](_0x33a4dc,_0x172d('0x7d')),function(_0x8a1b44){return _['includes'](_0x5642d4,_0x8a1b44);});if(_0x225923){return _0x182898['id'];}}}));}}return BPromise[_0x172d('0x7e')](_0x9c39ad)['then'](function(_0x5b0dac){_0x3cb6d2=_(_0x3cb6d2)[_0x172d('0x7f')](_0x5b0dac)[_0x172d('0x80')]()[_0x172d('0x81')]();return db['MailQueue'][_0x172d('0x4b')]({'where':{'id':_0x1bae44['params']['id']}})[_0x172d('0x29')](function(_0xd8745b){return db[_0x172d('0x79')]['transaction'](function(_0x103b9f){return _0xd8745b[_0x172d('0x6c')](_0x1bae44[_0x172d('0x37')][_0x172d('0x64')],{'transaction':_0x103b9f})[_0x172d('0x29')](function(){if(!_[_0x172d('0x82')](_0x3cb6d2)){return _0xd8745b[_0x172d('0x83')](_0x3cb6d2,{'transaction':_0x103b9f});}})[_0x172d('0x29')](function(){_0x3cb6d2[_0x172d('0x69')](function(_0x18578f){socket[_0x172d('0x6a')](_0x172d('0x84'),{'UserId':_0x18578f,'MailQueueId':_0xd8745b['id']});});});});});});})[_0x172d('0x29')](respondWithStatusCode(_0x31da0d,null))['catch'](handleError(_0x31da0d,null));};exports[_0x172d('0x85')]=function(_0x3382ce,_0x4f9ba1,_0x86232f){return db[_0x172d('0x30')][_0x172d('0x4b')]({'where':{'id':_0x3382ce[_0x172d('0x52')]['id']}})[_0x172d('0x29')](handleEntityNotFound(_0x4f9ba1,null))[_0x172d('0x29')](function(_0x5b04d7){if(_0x5b04d7){return _0x5b04d7[_0x172d('0x85')](_0x3382ce[_0x172d('0x4e')]['ids'],_[_0x172d('0x86')](_0x3382ce[_0x172d('0x4e')],['ids','id'])||{})[_0x172d('0x87')](function(_0x168e40){for(var _0x3f518a=0x0;_0x3f518a<_0x3382ce[_0x172d('0x4e')]['ids']['length'];_0x3f518a+=0x1){socket[_0x172d('0x6a')]('userMailQueue:save',{'UserId':Number(_0x3382ce[_0x172d('0x4e')][_0x172d('0x64')][_0x3f518a]),'MailQueueId':Number(_0x3382ce[_0x172d('0x52')]['id'])});}return _0x168e40;});}})[_0x172d('0x29')](respondWithResult(_0x4f9ba1,null))[_0x172d('0x4c')](handleError(_0x4f9ba1,null));};exports['removeAgents']=function(_0x2f0f8d,_0x53e224,_0x48f6f4){return db[_0x172d('0x30')]['find']({'where':{'id':_0x2f0f8d[_0x172d('0x52')]['id']}})[_0x172d('0x29')](handleEntityNotFound(_0x53e224,null))[_0x172d('0x29')](function(_0x2ee32a){if(_0x2ee32a){return _0x2ee32a[_0x172d('0x83')](_0x2f0f8d[_0x172d('0x37')][_0x172d('0x64')])['then'](function(){if(_[_0x172d('0x88')](_0x2f0f8d['query']['ids'])){for(var _0x25ca75=0x0;_0x25ca75<_0x2f0f8d['query'][_0x172d('0x64')][_0x172d('0x3c')];_0x25ca75+=0x1){socket[_0x172d('0x6a')]('userMailQueue:remove',{'UserId':Number(_0x2f0f8d[_0x172d('0x37')]['ids'][_0x25ca75]),'MailQueueId':Number(_0x2f0f8d[_0x172d('0x52')]['id'])});}}else{socket[_0x172d('0x6a')](_0x172d('0x84'),{'UserId':Number(_0x2f0f8d['query'][_0x172d('0x64')]),'MailQueueId':Number(_0x2f0f8d[_0x172d('0x52')]['id'])});}});}})['then'](respondWithStatusCode(_0x53e224,null))[_0x172d('0x4c')](handleError(_0x53e224,null));};exports[_0x172d('0x89')]=function(_0xb15b20,_0x2247c9,_0x3e21ac){var _0x5755e0={};var _0x56f7d7={};var _0x169dc4;var _0x157db9;return db['MailQueue'][_0x172d('0x61')]({'where':{'id':_0xb15b20[_0x172d('0x52')]['id']}})[_0x172d('0x29')](handleEntityNotFound(_0x2247c9,null))[_0x172d('0x29')](function(_0x27e85e){if(_0x27e85e){_0x169dc4=_0x27e85e;_0x56f7d7[_0x172d('0x35')]=_[_0x172d('0x4a')](db[_0x172d('0x58')]['rawAttributes']);_0x56f7d7[_0x172d('0x37')]=_[_0x172d('0x4a')](_0xb15b20[_0x172d('0x37')]);_0x56f7d7[_0x172d('0x38')]=_[_0x172d('0x39')](_0x56f7d7[_0x172d('0x35')],_0x56f7d7['query']);_0x5755e0[_0x172d('0x3b')]=_[_0x172d('0x39')](_0x56f7d7[_0x172d('0x35')],qs[_0x172d('0x3a')](_0xb15b20[_0x172d('0x37')][_0x172d('0x3a')]));_0x5755e0[_0x172d('0x3b')]=_0x5755e0[_0x172d('0x3b')][_0x172d('0x3c')]?_0x5755e0[_0x172d('0x3b')]:_0x56f7d7[_0x172d('0x35')];_0x5755e0['order']=qs[_0x172d('0x3f')](_0xb15b20[_0x172d('0x37')][_0x172d('0x3f')]);_0x5755e0[_0x172d('0x43')]=qs[_0x172d('0x38')](_[_0x172d('0x40')](_0xb15b20[_0x172d('0x37')],_0x56f7d7[_0x172d('0x38')]));if(_0xb15b20[_0x172d('0x37')][_0x172d('0x41')]){_0x5755e0[_0x172d('0x43')]=_[_0x172d('0x42')](_0x5755e0[_0x172d('0x43')],{'$or':_[_0x172d('0x36')](_0x5755e0[_0x172d('0x3b')],function(_0x2339c8){var _0xdd300a={};_0xdd300a[_0x2339c8]={'$like':'%'+_0xb15b20[_0x172d('0x37')][_0x172d('0x41')]+'%'};return _0xdd300a;})});}_0x5755e0=_[_0x172d('0x42')]({},_0x5755e0,_0xb15b20[_0x172d('0x45')]);return _0x169dc4[_0x172d('0x89')](_0x5755e0);}})[_0x172d('0x29')](function(_0x44ec6d){if(_0x44ec6d){_0x157db9=_0x44ec6d['length'];if(!_0xb15b20['query'][_0x172d('0x3d')](_0x172d('0x3e'))){_0x5755e0[_0x172d('0x22')]=qs[_0x172d('0x22')](_0xb15b20[_0x172d('0x37')][_0x172d('0x22')]);_0x5755e0['offset']=qs['offset'](_0xb15b20[_0x172d('0x37')][_0x172d('0x24')]);}return _0x169dc4[_0x172d('0x89')](_0x5755e0);}})[_0x172d('0x29')](function(_0x41d8b8){if(_0x41d8b8){return _0x41d8b8?{'count':_0x157db9,'rows':_0x41d8b8}:null;}})[_0x172d('0x29')](respondWithResult(_0x2247c9,null))['catch'](handleError(_0x2247c9,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 2a942b1..9ed3ba7 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 _0xdffb=['save','remove','emit','hasOwnProperty','exports','events','../../mysqldb','MailQueue','setMaxListeners'];(function(_0x527824,_0xc824a9){var _0xc8b8ed=function(_0x1b0e19){while(--_0x1b0e19){_0x527824['push'](_0x527824['shift']());}};_0xc8b8ed(++_0xc824a9);}(_0xdffb,0xd4));var _0xbdff=function(_0x4db341,_0x2e2ccf){_0x4db341=_0x4db341-0x0;var _0x4ce26d=_0xdffb[_0x4db341];return _0x4ce26d;};'use strict';var EventEmitter=require(_0xbdff('0x0'));var MailQueue=require(_0xbdff('0x1'))['db'][_0xbdff('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xbdff('0x3')](0x0);var events={'afterCreate':_0xbdff('0x4'),'afterUpdate':'update','afterDestroy':_0xbdff('0x5')};function emitEvent(_0x5af77c){return function(_0x3c6623,_0x47c2f5,_0xe89627){MailQueueEvents[_0xbdff('0x6')](_0x5af77c+':'+_0x3c6623['id'],_0x3c6623);MailQueueEvents[_0xbdff('0x6')](_0x5af77c,_0x3c6623);_0xe89627(null);};}for(var e in events){if(events[_0xbdff('0x7')](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0xbdff('0x8')]=MailQueueEvents; \ No newline at end of file +var _0xb566=['../../mysqldb','MailQueue','setMaxListeners','update','remove','emit','hook','exports','events'];(function(_0x40d719,_0x4ed66c){var _0x29812b=function(_0x1d912a){while(--_0x1d912a){_0x40d719['push'](_0x40d719['shift']());}};_0x29812b(++_0x4ed66c);}(_0xb566,0xb3));var _0x6b56=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xb566[_0x173d7e];return _0x2220d6;};'use strict';var EventEmitter=require(_0x6b56('0x0'));var MailQueue=require(_0x6b56('0x1'))['db'][_0x6b56('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x6b56('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6b56('0x4'),'afterDestroy':_0x6b56('0x5')};function emitEvent(_0x5c3a50){return function(_0x2ca349,_0x2341e5,_0x4bdde3){MailQueueEvents['emit'](_0x5c3a50+':'+_0x2ca349['id'],_0x2ca349);MailQueueEvents[_0x6b56('0x6')](_0x5c3a50,_0x2ca349);_0x4bdde3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0x6b56('0x7')](e,emitEvent(event));}}module[_0x6b56('0x8')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 6f9b1c5..83cb16b 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 _0x4a9c=['util','../../config/logger','api','path','rimraf','../../config/environment','exports','lodash'];(function(_0x4e7d25,_0x58285f){var _0x526fe6=function(_0x4f0aec){while(--_0x4f0aec){_0x4e7d25['push'](_0x4e7d25['shift']());}};_0x526fe6(++_0x58285f);}(_0x4a9c,0x15f));var _0xc4a9=function(_0x39bc45,_0x3128d4){_0x39bc45=_0x39bc45-0x0;var _0xc25466=_0x4a9c[_0x39bc45];return _0xc25466;};'use strict';var _=require(_0xc4a9('0x0'));var util=require(_0xc4a9('0x1'));var logger=require(_0xc4a9('0x2'))(_0xc4a9('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc4a9('0x4'));var rimraf=require(_0xc4a9('0x5'));var config=require(_0xc4a9('0x6'));var attributes=require('./mailQueue.attributes');module[_0xc4a9('0x7')]=function(_0x4d9c1c,_0x53774f){return _0x4d9c1c['define']('MailQueue',attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeebe=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','MailQueue','mail_queues','lodash','util'];(function(_0x38238d,_0x124948){var _0x4fcded=function(_0x3966c7){while(--_0x3966c7){_0x38238d['push'](_0x38238d['shift']());}};_0x4fcded(++_0x124948);}(_0xeebe,0xf5));var _0xeeeb=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xeebe[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require(_0xeeeb('0x0'));var util=require(_0xeeeb('0x1'));var logger=require(_0xeeeb('0x2'))(_0xeeeb('0x3'));var moment=require(_0xeeeb('0x4'));var BPromise=require(_0xeeeb('0x5'));var rp=require(_0xeeeb('0x6'));var fs=require('fs');var path=require(_0xeeeb('0x7'));var rimraf=require(_0xeeeb('0x8'));var config=require(_0xeeeb('0x9'));var attributes=require('./mailQueue.attributes');module['exports']=function(_0x3234b5,_0x3865c6){return _0x3234b5[_0xeeeb('0xa')](_0xeeeb('0xb'),attributes,{'tableName':_0xeeeb('0xc'),'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 84483f5..628b291 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 _0x9a89=['MailQueue,\x20%s,\x20%s','request\x20sent','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','MailQueue','findAll','options','raw','where','attributes','include','map','model','debug','GetMailQueue','ShowMailQueue','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','localhost','request','then','info'];(function(_0x13930b,_0x1b6ab6){var _0x461279=function(_0x411f0a){while(--_0x411f0a){_0x13930b['push'](_0x13930b['shift']());}};_0x461279(++_0x1b6ab6);}(_0x9a89,0xce));var _0x99a8=function(_0x23fe00,_0x1cd3d2){_0x23fe00=_0x23fe00-0x0;var _0x52b085=_0x9a89[_0x23fe00];return _0x52b085;};'use strict';var _=require(_0x99a8('0x0'));var util=require(_0x99a8('0x1'));var moment=require(_0x99a8('0x2'));var BPromise=require(_0x99a8('0x3'));var rs=require(_0x99a8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x99a8('0x5'))['db'];var utils=require(_0x99a8('0x6'));var logger=require('../../config/logger')(_0x99a8('0x7'));var config=require('../../config/environment');var jayson=require(_0x99a8('0x8'));var client=jayson[_0x99a8('0x9')][_0x99a8('0xa')]({'port':0x232a});config[_0x99a8('0xb')]=_['defaults'](config[_0x99a8('0xb')],{'host':_0x99a8('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x99a8('0xb')]));require('./mailQueue.socket')['register'](socket);function respondWithRpcPromise(_0x3ee89a,_0x131f04,_0x41cc40){return new BPromise(function(_0x2abf59,_0xc7f6a){return client[_0x99a8('0xd')](_0x3ee89a,_0x41cc40)[_0x99a8('0xe')](function(_0x262745){logger[_0x99a8('0xf')](_0x99a8('0x10'),_0x131f04,_0x99a8('0x11'));logger['debug'](_0x99a8('0x12'),_0x131f04,_0x99a8('0x11'),JSON[_0x99a8('0x13')](_0x262745));if(_0x262745['error']){if(_0x262745[_0x99a8('0x14')][_0x99a8('0x15')]===0x1f4){logger[_0x99a8('0x14')](_0x99a8('0x10'),_0x131f04,_0x262745[_0x99a8('0x14')][_0x99a8('0x16')]);return _0xc7f6a(_0x262745[_0x99a8('0x14')][_0x99a8('0x16')]);}logger[_0x99a8('0x14')](_0x99a8('0x10'),_0x131f04,_0x262745[_0x99a8('0x14')][_0x99a8('0x16')]);return _0x2abf59(_0x262745[_0x99a8('0x14')]['message']);}else{logger['info'](_0x99a8('0x10'),_0x131f04,_0x99a8('0x11'));_0x2abf59(_0x262745[_0x99a8('0x17')][_0x99a8('0x16')]);}})[_0x99a8('0x18')](function(_0x42388b){logger[_0x99a8('0x14')](_0x99a8('0x10'),_0x131f04,_0x42388b);_0xc7f6a(_0x42388b);});});}exports['GetMailQueue']=function(_0x4e77d9){var _0x1007d4=this;return new Promise(function(_0x10722b,_0x186ed9){return db[_0x99a8('0x19')][_0x99a8('0x1a')]({'raw':_0x4e77d9[_0x99a8('0x1b')]?_0x4e77d9[_0x99a8('0x1b')][_0x99a8('0x1c')]===undefined?!![]:![]:!![],'where':_0x4e77d9[_0x99a8('0x1b')]?_0x4e77d9[_0x99a8('0x1b')][_0x99a8('0x1d')]||null:null,'attributes':_0x4e77d9[_0x99a8('0x1b')]?_0x4e77d9[_0x99a8('0x1b')][_0x99a8('0x1e')]||null:null,'limit':_0x4e77d9[_0x99a8('0x1b')]?_0x4e77d9[_0x99a8('0x1b')]['limit']||null:null,'include':_0x4e77d9[_0x99a8('0x1b')]?_0x4e77d9[_0x99a8('0x1b')][_0x99a8('0x1f')]?_[_0x99a8('0x20')](_0x4e77d9[_0x99a8('0x1b')][_0x99a8('0x1f')],function(_0x1c1bd2){return{'model':db[_0x1c1bd2[_0x99a8('0x21')]],'as':_0x1c1bd2['as'],'attributes':_0x1c1bd2[_0x99a8('0x1e')],'include':_0x1c1bd2['include']?_[_0x99a8('0x20')](_0x1c1bd2[_0x99a8('0x1f')],function(_0x3c6b77){return{'model':db[_0x3c6b77[_0x99a8('0x21')]],'as':_0x3c6b77['as'],'attributes':_0x3c6b77[_0x99a8('0x1e')],'include':_0x3c6b77[_0x99a8('0x1f')]?_[_0x99a8('0x20')](_0x3c6b77[_0x99a8('0x1f')],function(_0x369af6){return{'model':db[_0x369af6[_0x99a8('0x21')]],'as':_0x369af6['as'],'attributes':_0x369af6[_0x99a8('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x99a8('0xe')](function(_0x308185){logger['info']('GetMailQueue',_0x4e77d9);logger[_0x99a8('0x22')]('GetMailQueue',_0x4e77d9,JSON[_0x99a8('0x13')](_0x308185));_0x10722b(_0x308185);})['catch'](function(_0x88f889){logger[_0x99a8('0x14')](_0x99a8('0x23'),_0x88f889[_0x99a8('0x16')],_0x4e77d9);_0x186ed9(_0x1007d4[_0x99a8('0x14')](0x1f4,_0x88f889[_0x99a8('0x16')]));});});};exports[_0x99a8('0x24')]=function(_0x1a6da5){var _0x406e77=this;return new Promise(function(_0x4234e7,_0x26ad8b){return db[_0x99a8('0x19')]['find']({'raw':_0x1a6da5[_0x99a8('0x1b')]?_0x1a6da5[_0x99a8('0x1b')][_0x99a8('0x1c')]===undefined?!![]:![]:!![],'where':_0x1a6da5[_0x99a8('0x1b')]?_0x1a6da5[_0x99a8('0x1b')][_0x99a8('0x1d')]||null:null,'attributes':_0x1a6da5[_0x99a8('0x1b')]?_0x1a6da5['options'][_0x99a8('0x1e')]||null:null,'include':_0x1a6da5[_0x99a8('0x1b')]?_0x1a6da5[_0x99a8('0x1b')]['include']?_[_0x99a8('0x20')](_0x1a6da5['options']['include'],function(_0x2cf4de){return{'model':db[_0x2cf4de[_0x99a8('0x21')]],'as':_0x2cf4de['as'],'attributes':_0x2cf4de[_0x99a8('0x1e')],'include':_0x2cf4de['include']?_[_0x99a8('0x20')](_0x2cf4de[_0x99a8('0x1f')],function(_0x5c543d){return{'model':db[_0x5c543d[_0x99a8('0x21')]],'as':_0x5c543d['as'],'attributes':_0x5c543d['attributes'],'include':_0x5c543d['include']?_['map'](_0x5c543d['include'],function(_0x533f22){return{'model':db[_0x533f22['model']],'as':_0x533f22['as'],'attributes':_0x533f22[_0x99a8('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x99a8('0xe')](function(_0x27d4da){logger['info'](_0x99a8('0x24'),_0x1a6da5);logger[_0x99a8('0x22')](_0x99a8('0x24'),_0x1a6da5,JSON[_0x99a8('0x13')](_0x27d4da));_0x4234e7(_0x27d4da);})[_0x99a8('0x18')](function(_0x11e420){logger[_0x99a8('0x14')](_0x99a8('0x24'),_0x11e420[_0x99a8('0x16')],_0x1a6da5);_0x26ad8b(_0x406e77[_0x99a8('0x14')](0x1f4,_0x11e420[_0x99a8('0x16')]));});});}; \ No newline at end of file +var _0x60eb=['MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','error','message','catch','GetMailQueue','MailQueue','findAll','options','raw','where','attributes','include','model','map','then','stringify','ShowMailQueue','find','info','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./mailQueue.socket','register'];(function(_0x46a6f9,_0x50203c){var _0x17084a=function(_0xef87e2){while(--_0xef87e2){_0x46a6f9['push'](_0x46a6f9['shift']());}};_0x17084a(++_0x50203c);}(_0x60eb,0x192));var _0xb60e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x60eb[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xb60e('0x0'));var util=require('util');var moment=require(_0xb60e('0x1'));var BPromise=require(_0xb60e('0x2'));var rs=require(_0xb60e('0x3'));var fs=require('fs');var Redis=require(_0xb60e('0x4'));var db=require(_0xb60e('0x5'))['db'];var utils=require(_0xb60e('0x6'));var logger=require(_0xb60e('0x7'))('rpc');var config=require(_0xb60e('0x8'));var jayson=require(_0xb60e('0x9'));var client=jayson[_0xb60e('0xa')]['http']({'port':0x232a});config[_0xb60e('0xb')]=_[_0xb60e('0xc')](config[_0xb60e('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xb60e('0xd'))(new Redis(config[_0xb60e('0xb')]));require(_0xb60e('0xe'))[_0xb60e('0xf')](socket);function respondWithRpcPromise(_0x17ee45,_0x3bd55c,_0x2e2860){return new BPromise(function(_0x5bbaa4,_0x4a2c6d){return client['request'](_0x17ee45,_0x2e2860)['then'](function(_0x52eb9b){logger['info'](_0xb60e('0x10'),_0x3bd55c,_0xb60e('0x11'));logger[_0xb60e('0x12')](_0xb60e('0x13'),_0x3bd55c,'request\x20sent',JSON['stringify'](_0x52eb9b));if(_0x52eb9b[_0xb60e('0x14')]){if(_0x52eb9b[_0xb60e('0x14')]['code']===0x1f4){logger[_0xb60e('0x14')](_0xb60e('0x10'),_0x3bd55c,_0x52eb9b[_0xb60e('0x14')]['message']);return _0x4a2c6d(_0x52eb9b[_0xb60e('0x14')][_0xb60e('0x15')]);}logger[_0xb60e('0x14')](_0xb60e('0x10'),_0x3bd55c,_0x52eb9b[_0xb60e('0x14')][_0xb60e('0x15')]);return _0x5bbaa4(_0x52eb9b[_0xb60e('0x14')]['message']);}else{logger['info'](_0xb60e('0x10'),_0x3bd55c,_0xb60e('0x11'));_0x5bbaa4(_0x52eb9b['result'][_0xb60e('0x15')]);}})[_0xb60e('0x16')](function(_0x3a4214){logger['error'](_0xb60e('0x10'),_0x3bd55c,_0x3a4214);_0x4a2c6d(_0x3a4214);});});}exports[_0xb60e('0x17')]=function(_0x5a847a){var _0x5066f5=this;return new Promise(function(_0x426d44,_0x1270d8){return db[_0xb60e('0x18')][_0xb60e('0x19')]({'raw':_0x5a847a['options']?_0x5a847a[_0xb60e('0x1a')][_0xb60e('0x1b')]===undefined?!![]:![]:!![],'where':_0x5a847a[_0xb60e('0x1a')]?_0x5a847a[_0xb60e('0x1a')][_0xb60e('0x1c')]||null:null,'attributes':_0x5a847a[_0xb60e('0x1a')]?_0x5a847a['options'][_0xb60e('0x1d')]||null:null,'limit':_0x5a847a[_0xb60e('0x1a')]?_0x5a847a[_0xb60e('0x1a')]['limit']||null:null,'include':_0x5a847a['options']?_0x5a847a[_0xb60e('0x1a')][_0xb60e('0x1e')]?_['map'](_0x5a847a[_0xb60e('0x1a')][_0xb60e('0x1e')],function(_0x2adf12){return{'model':db[_0x2adf12['model']],'as':_0x2adf12['as'],'attributes':_0x2adf12[_0xb60e('0x1d')],'include':_0x2adf12['include']?_['map'](_0x2adf12[_0xb60e('0x1e')],function(_0x1da10c){return{'model':db[_0x1da10c[_0xb60e('0x1f')]],'as':_0x1da10c['as'],'attributes':_0x1da10c[_0xb60e('0x1d')],'include':_0x1da10c[_0xb60e('0x1e')]?_[_0xb60e('0x20')](_0x1da10c[_0xb60e('0x1e')],function(_0x2e1d0c){return{'model':db[_0x2e1d0c['model']],'as':_0x2e1d0c['as'],'attributes':_0x2e1d0c[_0xb60e('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xb60e('0x21')](function(_0x502cdb){logger['info'](_0xb60e('0x17'),_0x5a847a);logger[_0xb60e('0x12')](_0xb60e('0x17'),_0x5a847a,JSON[_0xb60e('0x22')](_0x502cdb));_0x426d44(_0x502cdb);})[_0xb60e('0x16')](function(_0x146a75){logger[_0xb60e('0x14')](_0xb60e('0x17'),_0x146a75['message'],_0x5a847a);_0x1270d8(_0x5066f5[_0xb60e('0x14')](0x1f4,_0x146a75[_0xb60e('0x15')]));});});};exports[_0xb60e('0x23')]=function(_0x3854ea){var _0x2ada27=this;return new Promise(function(_0x1a8e26,_0x5a058c){return db[_0xb60e('0x18')][_0xb60e('0x24')]({'raw':_0x3854ea[_0xb60e('0x1a')]?_0x3854ea['options'][_0xb60e('0x1b')]===undefined?!![]:![]:!![],'where':_0x3854ea[_0xb60e('0x1a')]?_0x3854ea[_0xb60e('0x1a')][_0xb60e('0x1c')]||null:null,'attributes':_0x3854ea['options']?_0x3854ea[_0xb60e('0x1a')]['attributes']||null:null,'include':_0x3854ea[_0xb60e('0x1a')]?_0x3854ea[_0xb60e('0x1a')][_0xb60e('0x1e')]?_[_0xb60e('0x20')](_0x3854ea[_0xb60e('0x1a')][_0xb60e('0x1e')],function(_0x4e32ab){return{'model':db[_0x4e32ab['model']],'as':_0x4e32ab['as'],'attributes':_0x4e32ab[_0xb60e('0x1d')],'include':_0x4e32ab[_0xb60e('0x1e')]?_[_0xb60e('0x20')](_0x4e32ab[_0xb60e('0x1e')],function(_0x5a1ff4){return{'model':db[_0x5a1ff4[_0xb60e('0x1f')]],'as':_0x5a1ff4['as'],'attributes':_0x5a1ff4[_0xb60e('0x1d')],'include':_0x5a1ff4[_0xb60e('0x1e')]?_[_0xb60e('0x20')](_0x5a1ff4[_0xb60e('0x1e')],function(_0x89f649){return{'model':db[_0x89f649['model']],'as':_0x89f649['as'],'attributes':_0x89f649[_0xb60e('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xb60e('0x21')](function(_0x47ad1c){logger[_0xb60e('0x25')]('ShowMailQueue',_0x3854ea);logger['debug'](_0xb60e('0x23'),_0x3854ea,JSON[_0xb60e('0x22')](_0x47ad1c));_0x1a8e26(_0x47ad1c);})['catch'](function(_0x3a45ec){logger[_0xb60e('0x14')](_0xb60e('0x23'),_0x3a45ec[_0xb60e('0x15')],_0x3854ea);_0x5a058c(_0x2ada27['error'](0x1f4,_0x3a45ec['message']));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 5813cb8..f18738e 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 _0xd8fd=['removeListener','register','length','mailQueue:','./mailQueue.events','save','update','emit'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0xd8fd,0x16c));var _0xdd8f=function(_0x494f4d,_0x2807fa){_0x494f4d=_0x494f4d-0x0;var _0x3e7dfc=_0xd8fd[_0x494f4d];return _0x3e7dfc;};'use strict';var MailQueueEvents=require(_0xdd8f('0x0'));var events=[_0xdd8f('0x1'),'remove',_0xdd8f('0x2')];function createListener(_0x203152,_0xc091a3){return function(_0x39ba06){_0xc091a3[_0xdd8f('0x3')](_0x203152,_0x39ba06);};}function removeListener(_0x4d9c04,_0x3b496c){return function(){MailQueueEvents[_0xdd8f('0x4')](_0x4d9c04,_0x3b496c);};}exports[_0xdd8f('0x5')]=function(_0x55700c){for(var _0x53a655=0x0,_0x2d80a9=events[_0xdd8f('0x6')];_0x53a655<_0x2d80a9;_0x53a655++){var _0x5d7168=events[_0x53a655];var _0x156406=createListener(_0xdd8f('0x7')+_0x5d7168,_0x55700c);MailQueueEvents['on'](_0x5d7168,_0x156406);}}; \ No newline at end of file +var _0x7f78=['update','emit','removeListener','register','length','save','remove'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x7f78,0x140));var _0x87f7=function(_0x16e690,_0x5d4683){_0x16e690=_0x16e690-0x0;var _0x3beb56=_0x7f78[_0x16e690];return _0x3beb56;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0x87f7('0x0'),_0x87f7('0x1'),_0x87f7('0x2')];function createListener(_0x127ee1,_0x35cf06){return function(_0x502820){_0x35cf06[_0x87f7('0x3')](_0x127ee1,_0x502820);};}function removeListener(_0x48a009,_0x100eb9){return function(){MailQueueEvents[_0x87f7('0x4')](_0x48a009,_0x100eb9);};}exports[_0x87f7('0x5')]=function(_0x4d277f){for(var _0x4a361a=0x0,_0x4501a0=events[_0x87f7('0x6')];_0x4a361a<_0x4501a0;_0x4a361a++){var _0x5a66d9=events[_0x4a361a];var _0x46946b=createListener('mailQueue:'+_0x5a66d9,_0x4d277f);MailQueueEvents['on'](_0x5a66d9,_0x46946b);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index cc8dc79..10f8536 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 _0x663f=['isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get'];(function(_0x56260c,_0x3594bc){var _0x3293b9=function(_0x3e1744){while(--_0x3e1744){_0x56260c['push'](_0x56260c['shift']());}};_0x3293b9(++_0x3594bc);}(_0x663f,0xe4));var _0xf663=function(_0x46800d,_0x588500){_0x46800d=_0x46800d-0x0;var _0x3824cd=_0x663f[_0x46800d];return _0x3824cd;};'use strict';var multer=require(_0xf663('0x0'));var util=require(_0xf663('0x1'));var path=require(_0xf663('0x2'));var timeout=require(_0xf663('0x3'));var express=require(_0xf663('0x4'));var router=express[_0xf663('0x5')]();var fs_extra=require(_0xf663('0x6'));var auth=require(_0xf663('0x7'));var interaction=require(_0xf663('0x8'));var config=require(_0xf663('0x9'));var controller=require(_0xf663('0xa'));router[_0xf663('0xb')]('/',auth[_0xf663('0xc')](),controller[_0xf663('0xd')]);router[_0xf663('0xb')](_0xf663('0xe'),auth['isAuthenticated'](),controller[_0xf663('0xf')]);router[_0xf663('0xb')](_0xf663('0x10'),auth[_0xf663('0xc')](),controller[_0xf663('0x11')]);router[_0xf663('0x12')]('/',auth[_0xf663('0xc')](),controller[_0xf663('0x13')]);router[_0xf663('0x14')](_0xf663('0x10'),auth['isAuthenticated'](),controller[_0xf663('0x15')]);router[_0xf663('0x16')](_0xf663('0x10'),auth['isAuthenticated'](),controller['destroy']);module[_0xf663('0x17')]=router; \ No newline at end of file +var _0xfc63=['exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe','show','post','create','put','update','/:id','destroy'];(function(_0x573050,_0x47675b){var _0x40fe37=function(_0x4adf7a){while(--_0x4adf7a){_0x573050['push'](_0x573050['shift']());}};_0x40fe37(++_0x47675b);}(_0xfc63,0x11e));var _0x3fc6=function(_0x1d884d,_0x1c3c2d){_0x1d884d=_0x1d884d-0x0;var _0x386031=_0xfc63[_0x1d884d];return _0x386031;};'use strict';var multer=require(_0x3fc6('0x0'));var util=require(_0x3fc6('0x1'));var path=require('path');var timeout=require(_0x3fc6('0x2'));var express=require('express');var router=express[_0x3fc6('0x3')]();var fs_extra=require(_0x3fc6('0x4'));var auth=require(_0x3fc6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3fc6('0x6'));var controller=require('./mailQueueReport.controller');router[_0x3fc6('0x7')]('/',auth[_0x3fc6('0x8')](),controller['index']);router[_0x3fc6('0x7')](_0x3fc6('0x9'),auth[_0x3fc6('0x8')](),controller[_0x3fc6('0xa')]);router[_0x3fc6('0x7')]('/:id',auth[_0x3fc6('0x8')](),controller[_0x3fc6('0xb')]);router[_0x3fc6('0xc')]('/',auth[_0x3fc6('0x8')](),controller[_0x3fc6('0xd')]);router[_0x3fc6('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x3fc6('0xf')]);router['delete'](_0x3fc6('0x10'),auth['isAuthenticated'](),controller[_0x3fc6('0x11')]);module[_0x3fc6('0x12')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index c38d428..086eef6 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 _0x20c3=['STRING','DATE','moment','sequelize','exports'];(function(_0x295116,_0x23dd12){var _0x4aa164=function(_0x1c0446){while(--_0x1c0446){_0x295116['push'](_0x295116['shift']());}};_0x4aa164(++_0x23dd12);}(_0x20c3,0x1b0));var _0x320c=function(_0x1f2d32,_0x1b50ed){_0x1f2d32=_0x1f2d32-0x0;var _0xe3dc96=_0x20c3[_0x1f2d32];return _0xe3dc96;};'use strict';var moment=require(_0x320c('0x0'));var Sequelize=require(_0x320c('0x1'));module[_0x320c('0x2')]={'uniqueid':{'type':Sequelize[_0x320c('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x320c('0x3')]},'joinAt':{'type':Sequelize[_0x320c('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x320c('0x4')]},'exitAt':{'type':Sequelize[_0x320c('0x4')]},'reason':{'type':Sequelize[_0x320c('0x3')]}}; \ No newline at end of file +var _0xbb33=['exports','STRING','DATE','moment'];(function(_0x1a3d07,_0x105a71){var _0xd0058a=function(_0x213e53){while(--_0x213e53){_0x1a3d07['push'](_0x1a3d07['shift']());}};_0xd0058a(++_0x105a71);}(_0xbb33,0x8f));var _0x3bb3=function(_0x7a8365,_0x563ade){_0x7a8365=_0x7a8365-0x0;var _0x55359f=_0xbb33[_0x7a8365];return _0x55359f;};'use strict';var moment=require(_0x3bb3('0x0'));var Sequelize=require('sequelize');module[_0x3bb3('0x1')]={'uniqueid':{'type':Sequelize[_0x3bb3('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x3bb3('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x3bb3('0x3')]},'reason':{'type':Sequelize[_0x3bb3('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 82826c5..3615a83 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 _0xda2d=['send','index','map','MailQueueReport','rawAttributes','fieldName','type','model','filters','fields','query','attributes','length','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','include','findAll','rows','catch','params','keys','intersection','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','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/environment','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','then','destroy','error','name'];(function(_0x526818,_0x30c916){var _0x44c7e3=function(_0x364d90){while(--_0x364d90){_0x526818['push'](_0x526818['shift']());}};_0x44c7e3(++_0x30c916);}(_0xda2d,0x102));var _0xdda2=function(_0x157702,_0x46e386){_0x157702=_0x157702-0x0;var _0x35a0ab=_0xda2d[_0x157702];return _0x35a0ab;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdda2('0x0'));var zipdir=require(_0xdda2('0x1'));var jsonpatch=require(_0xdda2('0x2'));var rp=require(_0xdda2('0x3'));var moment=require(_0xdda2('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xdda2('0x5'));var sox=require(_0xdda2('0x6'));var csv=require(_0xdda2('0x7'));var ejs=require(_0xdda2('0x8'));var fs=require('fs');var fs_extra=require(_0xdda2('0x9'));var _=require(_0xdda2('0xa'));var squel=require(_0xdda2('0xb'));var crypto=require(_0xdda2('0xc'));var jsforce=require(_0xdda2('0xd'));var deskjs=require(_0xdda2('0xe'));var toCsv=require('to-csv');var querystring=require(_0xdda2('0xf'));var Papa=require(_0xdda2('0x10'));var Redis=require('ioredis');var authService=require(_0xdda2('0x11'));var qs=require(_0xdda2('0x12'));var as=require(_0xdda2('0x13'));var hardwareService=require(_0xdda2('0x14'));var logger=require(_0xdda2('0x15'))(_0xdda2('0x16'));var utils=require(_0xdda2('0x17'));var config=require(_0xdda2('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x56d25d,_0xa6446b){_0xa6446b=_0xa6446b||0xcc;return function(_0x320f73){if(_0x320f73){return _0x56d25d[_0xdda2('0x19')](_0xa6446b);}return _0x56d25d[_0xdda2('0x1a')](_0xa6446b)[_0xdda2('0x1b')]();};}function respondWithResult(_0x475222,_0x3490f1){_0x3490f1=_0x3490f1||0xc8;return function(_0x4df902){if(_0x4df902){return _0x475222[_0xdda2('0x1a')](_0x3490f1)['json'](_0x4df902);}};}function respondWithFilteredResult(_0xbef148,_0xb6b01e){return function(_0x3553d5){if(_0x3553d5){var _0x457764=typeof _0xb6b01e[_0xdda2('0x1c')]==='undefined'&&typeof _0xb6b01e['limit']===_0xdda2('0x1d');var _0x518c6d=_0x3553d5[_0xdda2('0x1e')];var _0x1a3b35=_0x457764?0x0:_0xb6b01e[_0xdda2('0x1c')];var _0x2b6ee8=_0x457764?_0x3553d5[_0xdda2('0x1e')]:_0xb6b01e[_0xdda2('0x1c')]+_0xb6b01e[_0xdda2('0x1f')];var _0x351151;if(_0x2b6ee8>=_0x518c6d){_0x2b6ee8=_0x518c6d;_0x351151=0xc8;}else{_0x351151=0xce;}_0xbef148[_0xdda2('0x1a')](_0x351151);return _0xbef148[_0xdda2('0x20')](_0xdda2('0x21'),_0x1a3b35+'-'+_0x2b6ee8+'/'+_0x518c6d)[_0xdda2('0x22')](_0x3553d5);}return null;};}function patchUpdates(_0x4eed30){return function(_0x41fe7d){try{jsonpatch['apply'](_0x41fe7d,_0x4eed30,!![]);}catch(_0xc4567c){return BPromise[_0xdda2('0x23')](_0xc4567c);}return _0x41fe7d[_0xdda2('0x24')]();};}function saveUpdates(_0x4c5226,_0x347ee6){return function(_0x5a9bb8){if(_0x5a9bb8){return _0x5a9bb8[_0xdda2('0x25')](_0x4c5226)[_0xdda2('0x26')](function(_0x4ac3eb){return _0x4ac3eb;});}return null;};}function removeEntity(_0x144f1e,_0xfda248){return function(_0x2528d7){if(_0x2528d7){return _0x2528d7[_0xdda2('0x27')]()[_0xdda2('0x26')](function(){_0x144f1e['status'](0xcc)[_0xdda2('0x1b')]();});}};}function handleEntityNotFound(_0x4be5ea,_0x2391a5){return function(_0x31d48b){if(!_0x31d48b){_0x4be5ea['sendStatus'](0x194);}return _0x31d48b;};}function handleError(_0x4e97dc,_0x28da54){_0x28da54=_0x28da54||0x1f4;return function(_0x4567e7){logger[_0xdda2('0x28')](_0x4567e7['stack']);if(_0x4567e7[_0xdda2('0x29')]){delete _0x4567e7[_0xdda2('0x29')];}_0x4e97dc[_0xdda2('0x1a')](_0x28da54)[_0xdda2('0x2a')](_0x4567e7);};}exports[_0xdda2('0x2b')]=function(_0x91b41a,_0x4bb8a4){var _0x24c37d={},_0x255bbc={},_0x53acb5={'count':0x0,'rows':[]};var _0x45e800=_[_0xdda2('0x2c')](db[_0xdda2('0x2d')][_0xdda2('0x2e')],function(_0x5540e5){return{'name':_0x5540e5[_0xdda2('0x2f')],'type':_0x5540e5[_0xdda2('0x30')]['key']};});_0x255bbc[_0xdda2('0x31')]=_['map'](_0x45e800,_0xdda2('0x29'));_0x255bbc['query']=_['keys'](_0x91b41a['query']);_0x255bbc[_0xdda2('0x32')]=_['intersection'](_0x255bbc[_0xdda2('0x31')],_0x255bbc['query']);_0x24c37d['attributes']=_['intersection'](_0x255bbc[_0xdda2('0x31')],qs[_0xdda2('0x33')](_0x91b41a[_0xdda2('0x34')][_0xdda2('0x33')]));_0x24c37d[_0xdda2('0x35')]=_0x24c37d[_0xdda2('0x35')][_0xdda2('0x36')]?_0x24c37d[_0xdda2('0x35')]:_0x255bbc[_0xdda2('0x31')];if(!_0x91b41a[_0xdda2('0x34')]['hasOwnProperty'](_0xdda2('0x37'))){_0x24c37d[_0xdda2('0x1f')]=qs[_0xdda2('0x1f')](_0x91b41a[_0xdda2('0x34')][_0xdda2('0x1f')]);_0x24c37d[_0xdda2('0x1c')]=qs[_0xdda2('0x1c')](_0x91b41a['query']['offset']);}_0x24c37d[_0xdda2('0x38')]=qs[_0xdda2('0x39')](_0x91b41a[_0xdda2('0x34')]['sort']);_0x24c37d['where']=qs[_0xdda2('0x32')](_[_0xdda2('0x3a')](_0x91b41a[_0xdda2('0x34')],_0x255bbc[_0xdda2('0x32')]),_0x45e800);if(_0x91b41a[_0xdda2('0x34')]['filter']){_0x24c37d[_0xdda2('0x3b')]=_[_0xdda2('0x3c')](_0x24c37d['where'],{'$or':_['map'](_0x45e800,function(_0x98bf47){if(_0x98bf47[_0xdda2('0x30')]!==_0xdda2('0x3d')){var _0x2708f4={};_0x2708f4[_0x98bf47[_0xdda2('0x29')]]={'$like':'%'+_0x91b41a['query'][_0xdda2('0x3e')]+'%'};return _0x2708f4;}})});}_0x24c37d=_[_0xdda2('0x3c')]({},_0x24c37d,_0x91b41a[_0xdda2('0x3f')]);var _0x1a7262={'where':_0x24c37d['where']};return db['MailQueueReport'][_0xdda2('0x1e')](_0x1a7262)[_0xdda2('0x26')](function(_0x7a25fe){_0x53acb5['count']=_0x7a25fe;if(_0x91b41a[_0xdda2('0x34')]['includeAll']){_0x24c37d[_0xdda2('0x40')]=[{'all':!![]}];}return db['MailQueueReport'][_0xdda2('0x41')](_0x24c37d);})[_0xdda2('0x26')](function(_0x1db762){_0x53acb5[_0xdda2('0x42')]=_0x1db762;return _0x53acb5;})['then'](respondWithFilteredResult(_0x4bb8a4,_0x24c37d))[_0xdda2('0x43')](handleError(_0x4bb8a4,null));};exports['show']=function(_0x392f70,_0x4d3b78){var _0x1d1678={'raw':!![],'where':{'id':_0x392f70[_0xdda2('0x44')]['id']}},_0x12589b={};_0x12589b[_0xdda2('0x31')]=_[_0xdda2('0x45')](db['MailQueueReport'][_0xdda2('0x2e')]);_0x12589b[_0xdda2('0x34')]=_['keys'](_0x392f70[_0xdda2('0x34')]);_0x12589b['filters']=_[_0xdda2('0x46')](_0x12589b[_0xdda2('0x31')],_0x12589b[_0xdda2('0x34')]);_0x1d1678[_0xdda2('0x35')]=_[_0xdda2('0x46')](_0x12589b[_0xdda2('0x31')],qs[_0xdda2('0x33')](_0x392f70[_0xdda2('0x34')][_0xdda2('0x33')]));_0x1d1678[_0xdda2('0x35')]=_0x1d1678[_0xdda2('0x35')][_0xdda2('0x36')]?_0x1d1678[_0xdda2('0x35')]:_0x12589b['model'];if(_0x392f70['query']['includeAll']){_0x1d1678[_0xdda2('0x40')]=[{'all':!![]}];}_0x1d1678=_[_0xdda2('0x3c')]({},_0x1d1678,_0x392f70['options']);return db[_0xdda2('0x2d')][_0xdda2('0x47')](_0x1d1678)[_0xdda2('0x26')](handleEntityNotFound(_0x4d3b78,null))['then'](respondWithResult(_0x4d3b78,null))[_0xdda2('0x43')](handleError(_0x4d3b78,null));};exports[_0xdda2('0x48')]=function(_0x4eada0,_0x5f0aa8){return db[_0xdda2('0x2d')]['create'](_0x4eada0[_0xdda2('0x49')],{})['then'](respondWithResult(_0x5f0aa8,0xc9))[_0xdda2('0x43')](handleError(_0x5f0aa8,null));};exports[_0xdda2('0x25')]=function(_0x50bd88,_0x585665){if(_0x50bd88[_0xdda2('0x49')]['id']){delete _0x50bd88[_0xdda2('0x49')]['id'];}return db[_0xdda2('0x2d')][_0xdda2('0x47')]({'where':{'id':_0x50bd88['params']['id']}})[_0xdda2('0x26')](handleEntityNotFound(_0x585665,null))[_0xdda2('0x26')](saveUpdates(_0x50bd88[_0xdda2('0x49')],null))[_0xdda2('0x26')](respondWithResult(_0x585665,null))[_0xdda2('0x43')](handleError(_0x585665,null));};exports['destroy']=function(_0x1a56cc,_0x40b610){return db['MailQueueReport'][_0xdda2('0x47')]({'where':{'id':_0x1a56cc[_0xdda2('0x44')]['id']}})[_0xdda2('0x26')](handleEntityNotFound(_0x40b610,null))[_0xdda2('0x26')](removeEntity(_0x40b610,null))[_0xdda2('0x43')](handleError(_0x40b610,null));};exports[_0xdda2('0x4a')]=function(_0x4b6519,_0x2c58c7){return db['MailQueueReport'][_0xdda2('0x4a')]()['then'](respondWithResult(_0x2c58c7,null))[_0xdda2('0x43')](handleError(_0x2c58c7,null));}; \ No newline at end of file +var _0xdf55=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','MailQueueReport','fieldName','type','model','map','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment'];(function(_0x5d9236,_0x526a02){var _0x20f057=function(_0x238a13){while(--_0x238a13){_0x5d9236['push'](_0x5d9236['shift']());}};_0x20f057(++_0x526a02);}(_0xdf55,0x83));var _0x5df5=function(_0x1aa617,_0x23271a){_0x1aa617=_0x1aa617-0x0;var _0x38653c=_0xdf55[_0x1aa617];return _0x38653c;};'use strict';var emlformat=require(_0x5df5('0x0'));var rimraf=require(_0x5df5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5df5('0x2'));var rp=require(_0x5df5('0x3'));var moment=require('moment');var BPromise=require(_0x5df5('0x4'));var Mustache=require(_0x5df5('0x5'));var util=require(_0x5df5('0x6'));var path=require('path');var sox=require(_0x5df5('0x7'));var csv=require(_0x5df5('0x8'));var ejs=require(_0x5df5('0x9'));var fs=require('fs');var fs_extra=require(_0x5df5('0xa'));var _=require(_0x5df5('0xb'));var squel=require(_0x5df5('0xc'));var crypto=require(_0x5df5('0xd'));var jsforce=require(_0x5df5('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5df5('0x8'));var querystring=require(_0x5df5('0xf'));var Papa=require(_0x5df5('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5df5('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5df5('0x12'));var logger=require(_0x5df5('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x5df5('0x14'));var licenseUtil=require(_0x5df5('0x15'));var db=require(_0x5df5('0x16'))['db'];function respondWithStatusCode(_0x4c3d6f,_0xe8bcd8){_0xe8bcd8=_0xe8bcd8||0xcc;return function(_0xb4a4fe){if(_0xb4a4fe){return _0x4c3d6f[_0x5df5('0x17')](_0xe8bcd8);}return _0x4c3d6f[_0x5df5('0x18')](_0xe8bcd8)[_0x5df5('0x19')]();};}function respondWithResult(_0x956317,_0x555d3f){_0x555d3f=_0x555d3f||0xc8;return function(_0x30fd32){if(_0x30fd32){return _0x956317['status'](_0x555d3f)[_0x5df5('0x1a')](_0x30fd32);}};}function respondWithFilteredResult(_0x33f818,_0x5b0ad9){return function(_0x3657c8){if(_0x3657c8){var _0x282d53=typeof _0x5b0ad9['offset']===_0x5df5('0x1b')&&typeof _0x5b0ad9[_0x5df5('0x1c')]==='undefined';var _0x9a52c9=_0x3657c8[_0x5df5('0x1d')];var _0xb7e1c2=_0x282d53?0x0:_0x5b0ad9[_0x5df5('0x1e')];var _0x215d59=_0x282d53?_0x3657c8['count']:_0x5b0ad9['offset']+_0x5b0ad9[_0x5df5('0x1c')];var _0x5d8dfd;if(_0x215d59>=_0x9a52c9){_0x215d59=_0x9a52c9;_0x5d8dfd=0xc8;}else{_0x5d8dfd=0xce;}_0x33f818[_0x5df5('0x18')](_0x5d8dfd);return _0x33f818[_0x5df5('0x1f')](_0x5df5('0x20'),_0xb7e1c2+'-'+_0x215d59+'/'+_0x9a52c9)[_0x5df5('0x1a')](_0x3657c8);}return null;};}function patchUpdates(_0x1deae7){return function(_0x4b4b57){try{jsonpatch[_0x5df5('0x21')](_0x4b4b57,_0x1deae7,!![]);}catch(_0x39d8a1){return BPromise[_0x5df5('0x22')](_0x39d8a1);}return _0x4b4b57[_0x5df5('0x23')]();};}function saveUpdates(_0x28efc8,_0x382999){return function(_0x59ff67){if(_0x59ff67){return _0x59ff67[_0x5df5('0x24')](_0x28efc8)[_0x5df5('0x25')](function(_0x8742a7){return _0x8742a7;});}return null;};}function removeEntity(_0x446bba,_0x5ca542){return function(_0x4358ba){if(_0x4358ba){return _0x4358ba[_0x5df5('0x26')]()[_0x5df5('0x25')](function(){_0x446bba['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x532923,_0x357fb0){return function(_0x3ff82e){if(!_0x3ff82e){_0x532923[_0x5df5('0x17')](0x194);}return _0x3ff82e;};}function handleError(_0xa7f4b3,_0x1baf52){_0x1baf52=_0x1baf52||0x1f4;return function(_0x1fd83c){logger[_0x5df5('0x27')](_0x1fd83c[_0x5df5('0x28')]);if(_0x1fd83c['name']){delete _0x1fd83c[_0x5df5('0x29')];}_0xa7f4b3['status'](_0x1baf52)[_0x5df5('0x2a')](_0x1fd83c);};}exports[_0x5df5('0x2b')]=function(_0x5bc181,_0x3854d0){var _0x4945c6={},_0xd2b213={},_0x4cccf1={'count':0x0,'rows':[]};var _0x2e1885=_['map'](db[_0x5df5('0x2c')]['rawAttributes'],function(_0x2f91e3){return{'name':_0x2f91e3[_0x5df5('0x2d')],'type':_0x2f91e3[_0x5df5('0x2e')]['key']};});_0xd2b213[_0x5df5('0x2f')]=_[_0x5df5('0x30')](_0x2e1885,_0x5df5('0x29'));_0xd2b213[_0x5df5('0x31')]=_[_0x5df5('0x32')](_0x5bc181[_0x5df5('0x31')]);_0xd2b213[_0x5df5('0x33')]=_['intersection'](_0xd2b213['model'],_0xd2b213[_0x5df5('0x31')]);_0x4945c6[_0x5df5('0x34')]=_[_0x5df5('0x35')](_0xd2b213[_0x5df5('0x2f')],qs[_0x5df5('0x36')](_0x5bc181[_0x5df5('0x31')]['fields']));_0x4945c6[_0x5df5('0x34')]=_0x4945c6[_0x5df5('0x34')][_0x5df5('0x37')]?_0x4945c6[_0x5df5('0x34')]:_0xd2b213['model'];if(!_0x5bc181[_0x5df5('0x31')]['hasOwnProperty'](_0x5df5('0x38'))){_0x4945c6[_0x5df5('0x1c')]=qs['limit'](_0x5bc181[_0x5df5('0x31')]['limit']);_0x4945c6[_0x5df5('0x1e')]=qs[_0x5df5('0x1e')](_0x5bc181[_0x5df5('0x31')][_0x5df5('0x1e')]);}_0x4945c6['order']=qs[_0x5df5('0x39')](_0x5bc181[_0x5df5('0x31')][_0x5df5('0x39')]);_0x4945c6[_0x5df5('0x3a')]=qs['filters'](_[_0x5df5('0x3b')](_0x5bc181[_0x5df5('0x31')],_0xd2b213[_0x5df5('0x33')]),_0x2e1885);if(_0x5bc181[_0x5df5('0x31')][_0x5df5('0x3c')]){_0x4945c6[_0x5df5('0x3a')]=_[_0x5df5('0x3d')](_0x4945c6['where'],{'$or':_[_0x5df5('0x30')](_0x2e1885,function(_0x3102c7){if(_0x3102c7['type']!==_0x5df5('0x3e')){var _0x217844={};_0x217844[_0x3102c7['name']]={'$like':'%'+_0x5bc181[_0x5df5('0x31')][_0x5df5('0x3c')]+'%'};return _0x217844;}})});}_0x4945c6=_[_0x5df5('0x3d')]({},_0x4945c6,_0x5bc181[_0x5df5('0x3f')]);var _0x235f3e={'where':_0x4945c6[_0x5df5('0x3a')]};return db[_0x5df5('0x2c')][_0x5df5('0x1d')](_0x235f3e)['then'](function(_0x5e6c93){_0x4cccf1[_0x5df5('0x1d')]=_0x5e6c93;if(_0x5bc181['query'][_0x5df5('0x40')]){_0x4945c6[_0x5df5('0x41')]=[{'all':!![]}];}return db['MailQueueReport'][_0x5df5('0x42')](_0x4945c6);})[_0x5df5('0x25')](function(_0x23e592){_0x4cccf1[_0x5df5('0x43')]=_0x23e592;return _0x4cccf1;})[_0x5df5('0x25')](respondWithFilteredResult(_0x3854d0,_0x4945c6))[_0x5df5('0x44')](handleError(_0x3854d0,null));};exports[_0x5df5('0x45')]=function(_0x3902a1,_0x5824c3){var _0x42b562={'raw':!![],'where':{'id':_0x3902a1[_0x5df5('0x46')]['id']}},_0x4a4057={};_0x4a4057[_0x5df5('0x2f')]=_[_0x5df5('0x32')](db[_0x5df5('0x2c')][_0x5df5('0x47')]);_0x4a4057['query']=_[_0x5df5('0x32')](_0x3902a1[_0x5df5('0x31')]);_0x4a4057[_0x5df5('0x33')]=_['intersection'](_0x4a4057[_0x5df5('0x2f')],_0x4a4057[_0x5df5('0x31')]);_0x42b562['attributes']=_[_0x5df5('0x35')](_0x4a4057[_0x5df5('0x2f')],qs[_0x5df5('0x36')](_0x3902a1[_0x5df5('0x31')]['fields']));_0x42b562[_0x5df5('0x34')]=_0x42b562[_0x5df5('0x34')]['length']?_0x42b562[_0x5df5('0x34')]:_0x4a4057[_0x5df5('0x2f')];if(_0x3902a1[_0x5df5('0x31')]['includeAll']){_0x42b562[_0x5df5('0x41')]=[{'all':!![]}];}_0x42b562=_[_0x5df5('0x3d')]({},_0x42b562,_0x3902a1[_0x5df5('0x3f')]);return db[_0x5df5('0x2c')]['find'](_0x42b562)[_0x5df5('0x25')](handleEntityNotFound(_0x5824c3,null))[_0x5df5('0x25')](respondWithResult(_0x5824c3,null))[_0x5df5('0x44')](handleError(_0x5824c3,null));};exports[_0x5df5('0x48')]=function(_0x14f9ca,_0x5f44cb){return db['MailQueueReport'][_0x5df5('0x48')](_0x14f9ca['body'],{})[_0x5df5('0x25')](respondWithResult(_0x5f44cb,0xc9))[_0x5df5('0x44')](handleError(_0x5f44cb,null));};exports[_0x5df5('0x24')]=function(_0x28108e,_0x48462e){if(_0x28108e[_0x5df5('0x49')]['id']){delete _0x28108e[_0x5df5('0x49')]['id'];}return db[_0x5df5('0x2c')][_0x5df5('0x4a')]({'where':{'id':_0x28108e[_0x5df5('0x46')]['id']}})[_0x5df5('0x25')](handleEntityNotFound(_0x48462e,null))['then'](saveUpdates(_0x28108e[_0x5df5('0x49')],null))['then'](respondWithResult(_0x48462e,null))[_0x5df5('0x44')](handleError(_0x48462e,null));};exports[_0x5df5('0x26')]=function(_0x17288f,_0x4d1ebd){return db[_0x5df5('0x2c')]['find']({'where':{'id':_0x17288f[_0x5df5('0x46')]['id']}})['then'](handleEntityNotFound(_0x4d1ebd,null))[_0x5df5('0x25')](removeEntity(_0x4d1ebd,null))[_0x5df5('0x44')](handleError(_0x4d1ebd,null));};exports[_0x5df5('0x4b')]=function(_0x5997c1,_0x3d92a3){return db[_0x5df5('0x2c')]['describe']()[_0x5df5('0x25')](respondWithResult(_0x3d92a3,null))[_0x5df5('0x44')](handleError(_0x3d92a3,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index b0b976b..97519c6 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 _0xf0a8=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport','uniqueid','lodash','util'];(function(_0x2160a9,_0x3cbd9e){var _0xa88cf7=function(_0x51ab6f){while(--_0x51ab6f){_0x2160a9['push'](_0x2160a9['shift']());}};_0xa88cf7(++_0x3cbd9e);}(_0xf0a8,0xb4));var _0x8f0a=function(_0x46c28e,_0x559e9b){_0x46c28e=_0x46c28e-0x0;var _0x6653ba=_0xf0a8[_0x46c28e];return _0x6653ba;};'use strict';var _=require(_0x8f0a('0x0'));var util=require(_0x8f0a('0x1'));var logger=require(_0x8f0a('0x2'))(_0x8f0a('0x3'));var moment=require(_0x8f0a('0x4'));var BPromise=require(_0x8f0a('0x5'));var rp=require(_0x8f0a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8f0a('0x7'));var config=require(_0x8f0a('0x8'));var attributes=require(_0x8f0a('0x9'));module[_0x8f0a('0xa')]=function(_0x32146a,_0x3276d7){return _0x32146a[_0x8f0a('0xb')](_0x8f0a('0xc'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0x8f0a('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x98c6=['request-promise','path','../../config/environment','exports','define','MailQueueReport','report_mail_queue','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x319cb9,_0x4b8d35){var _0x1735fc=function(_0x43b061){while(--_0x43b061){_0x319cb9['push'](_0x319cb9['shift']());}};_0x1735fc(++_0x4b8d35);}(_0x98c6,0x15a));var _0x698c=function(_0x4ecc0d,_0x37b92b){_0x4ecc0d=_0x4ecc0d-0x0;var _0x2fb194=_0x98c6[_0x4ecc0d];return _0x2fb194;};'use strict';var _=require(_0x698c('0x0'));var util=require(_0x698c('0x1'));var logger=require(_0x698c('0x2'))(_0x698c('0x3'));var moment=require(_0x698c('0x4'));var BPromise=require('bluebird');var rp=require(_0x698c('0x5'));var fs=require('fs');var path=require(_0x698c('0x6'));var rimraf=require('rimraf');var config=require(_0x698c('0x7'));var attributes=require('./mailQueueReport.attributes');module[_0x698c('0x8')]=function(_0x4deb3c,_0x1f6162){return _0x4deb3c[_0x698c('0x9')](_0x698c('0xa'),attributes,{'tableName':_0x698c('0xb'),'paranoid':![],'indexes':[{'name':_0x698c('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 23b9fe2..59d49f1 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(_0x3386fd,_0x8596f4){var _0x19e6f6=function(_0x4bd4ec){while(--_0x4bd4ec){_0x3386fd['push'](_0x3386fd['shift']());}};_0x19e6f6(++_0x8596f4);}(_0x2ef3,0xba));var _0x32ef=function(_0x14a3c9,_0x1771c0){_0x14a3c9=_0x14a3c9-0x0;var _0xc82e7=_0x2ef3[_0x14a3c9];return _0xc82e7;};'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 _0x326f=['error','code','message','result','catch','CreateMailQueueReport','MailQueueReport','options','raw','stringify','UpdateMailQueueReport','body','attributes','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x191d96,_0x39072a){var _0x14d7ca=function(_0x3926ff){while(--_0x3926ff){_0x191d96['push'](_0x191d96['shift']());}};_0x14d7ca(++_0x39072a);}(_0x326f,0xd1));var _0xf326=function(_0x358b1b,_0x559a28){_0x358b1b=_0x358b1b-0x0;var _0x21f9d2=_0x326f[_0x358b1b];return _0x21f9d2;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('MailQueueReport,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});}exports[_0xf326('0x14')]=function(_0x453100){var _0x18bee3=this;return new Promise(function(_0x31ffb9,_0xcef2b5){return db[_0xf326('0x15')]['create'](_0x453100['body'],{'raw':_0x453100['options']?_0x453100[_0xf326('0x16')][_0xf326('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x4cabce){logger[_0xf326('0xb')]('CreateMailQueueReport',_0x453100);logger['debug'](_0xf326('0x14'),_0x453100,JSON[_0xf326('0x18')](_0x4cabce));_0x31ffb9(_0x4cabce);})['catch'](function(_0x5aa184){logger[_0xf326('0xf')](_0xf326('0x14'),_0x5aa184['message'],_0x453100);_0xcef2b5(_0x18bee3[_0xf326('0xf')](0x1f4,_0x5aa184[_0xf326('0x11')]));});});};exports[_0xf326('0x19')]=function(_0x295752){var _0x17c157=this;return new Promise(function(_0x2049ec,_0x5ce532){return db['MailQueueReport']['update'](_0x295752[_0xf326('0x1a')],{'raw':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')][_0xf326('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')]['where']||null:null,'attributes':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')][_0xf326('0x1b')]||null:null,'limit':_0x295752['options']?_0x295752[_0xf326('0x16')]['limit']||null:null})['then'](function(_0x6a8e89){logger[_0xf326('0xb')](_0xf326('0x19'),_0x295752);logger['debug'](_0xf326('0x19'),_0x295752,JSON[_0xf326('0x18')](_0x6a8e89));_0x2049ec(_0x6a8e89);})['catch'](function(_0x225776){logger[_0xf326('0xf')](_0xf326('0x19'),_0x225776[_0xf326('0x11')],_0x295752);_0x5ce532(_0x17c157[_0xf326('0xf')](0x1f4,_0x225776[_0xf326('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 7e11d03..63af83b 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x57dffb,_0x218ca8){var _0x1eff9a=function(_0x1caaa5){while(--_0x1caaa5){_0x57dffb['push'](_0x57dffb['shift']());}};_0x1eff9a(++_0x218ca8);}(_0xe706,0xa3));var _0x6e70=function(_0x1265fa,_0x1a1fed){_0x1265fa=_0x1265fa-0x0;var _0x1fe35e=_0xe706[_0x1265fa];return _0x1fe35e;};'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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x327fb0,_0x387a15){var _0x13b762=function(_0x24d37a){while(--_0x24d37a){_0x327fb0['push'](_0x327fb0['shift']());}};_0x13b762(++_0x387a15);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'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/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index bb2a4f8..70b01e8 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 _0x69d3=['STRING','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x263b73,_0x3c0a19){var _0x4f620a=function(_0x36e1ac){while(--_0x36e1ac){_0x263b73['push'](_0x263b73['shift']());}};_0x4f620a(++_0x3c0a19);}(_0x69d3,0xda));var _0x369d=function(_0x54184f,_0x11c77b){_0x54184f=_0x54184f-0x0;var _0x4d411b=_0x69d3[_0x54184f];return _0x4d411b;};'use strict';var Sequelize=require(_0x369d('0x0'));module[_0x369d('0x1')]={'description':{'type':Sequelize[_0x369d('0x2')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x369d('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x369d('0x2')]},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize[_0x369d('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0x369d('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x369d('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0x369d('0x2')]}}; \ No newline at end of file +var _0x657b=['exports','STRING','BOOLEAN','INTEGER','INBOX','sequelize'];(function(_0x2f5de9,_0x2485be){var _0x890a7f=function(_0x1687da){while(--_0x1687da){_0x2f5de9['push'](_0x2f5de9['shift']());}};_0x890a7f(++_0x2485be);}(_0x657b,0x131));var _0xb657=function(_0x5588f3,_0x1f85eb){_0x5588f3=_0x5588f3-0x0;var _0x19b12f=_0x657b[_0x5588f3];return _0x19b12f;};'use strict';var Sequelize=require(_0xb657('0x0'));module[_0xb657('0x1')]={'description':{'type':Sequelize[_0xb657('0x2')]},'host':{'type':Sequelize[_0xb657('0x2')]},'authentication':{'type':Sequelize[_0xb657('0x3')],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xb657('0x2')]},'port':{'type':Sequelize[_0xb657('0x4')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xb657('0x2')],'defaultValue':_0xb657('0x5')},'connTimeout':{'type':Sequelize[_0xb657('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xb657('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0xb657('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 8033ece..d9207d3 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 _0xb978=['define','mail_servers_in','lodash','../../config/logger','api','request-promise','../../config/environment','./mailServerIn.attributes'];(function(_0x5ebf6a,_0x47963a){var _0x5742d9=function(_0x3d356c){while(--_0x3d356c){_0x5ebf6a['push'](_0x5ebf6a['shift']());}};_0x5742d9(++_0x47963a);}(_0xb978,0x1aa));var _0x8b97=function(_0x777bd2,_0x58a9c7){_0x777bd2=_0x777bd2-0x0;var _0x2e0259=_0xb978[_0x777bd2];return _0x2e0259;};'use strict';var _=require(_0x8b97('0x0'));var util=require('util');var logger=require(_0x8b97('0x1'))(_0x8b97('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8b97('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8b97('0x4'));var attributes=require(_0x8b97('0x5'));module['exports']=function(_0x26f8af,_0x2eb2a3){return _0x26f8af[_0x8b97('0x6')]('MailServerIn',attributes,{'tableName':_0x8b97('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x65b2=['exports','define','mail_servers_in','../../config/logger','api','moment','request-promise','rimraf','./mailServerIn.attributes'];(function(_0x457919,_0x58b62e){var _0x3a5b5=function(_0xac5510){while(--_0xac5510){_0x457919['push'](_0x457919['shift']());}};_0x3a5b5(++_0x58b62e);}(_0x65b2,0x1bc));var _0x265b=function(_0x2338ae,_0x1896f8){_0x2338ae=_0x2338ae-0x0;var _0x4adad9=_0x65b2[_0x2338ae];return _0x4adad9;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x265b('0x0'))(_0x265b('0x1'));var moment=require(_0x265b('0x2'));var BPromise=require('bluebird');var rp=require(_0x265b('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x265b('0x4'));var config=require('../../config/environment');var attributes=require(_0x265b('0x5'));module[_0x265b('0x6')]=function(_0x2a2e65,_0x123888){return _0x2a2e65[_0x265b('0x7')]('MailServerIn',attributes,{'tableName':_0x265b('0x8'),'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 a56c45b..eb43391 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 _0x6652=['raw','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailServerIn','MailServerIn','findAll','options'];(function(_0x27f67f,_0x2f5de7){var _0x1b12b2=function(_0x32783e){while(--_0x32783e){_0x27f67f['push'](_0x27f67f['shift']());}};_0x1b12b2(++_0x2f5de7);}(_0x6652,0xf3));var _0x2665=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0x6652[_0x3899d1];return _0xeb4a7d;};'use strict';var _=require(_0x2665('0x0'));var util=require(_0x2665('0x1'));var moment=require(_0x2665('0x2'));var BPromise=require(_0x2665('0x3'));var rs=require(_0x2665('0x4'));var fs=require('fs');var Redis=require(_0x2665('0x5'));var db=require(_0x2665('0x6'))['db'];var utils=require(_0x2665('0x7'));var logger=require(_0x2665('0x8'))('rpc');var config=require(_0x2665('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x2665('0xa')][_0x2665('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xb5be6,_0x20a2c5,_0xf51be5){return new BPromise(function(_0x540a5c,_0x5bc4d9){return client[_0x2665('0xc')](_0xb5be6,_0xf51be5)[_0x2665('0xd')](function(_0x3164e0){logger[_0x2665('0xe')](_0x2665('0xf'),_0x20a2c5,_0x2665('0x10'));logger[_0x2665('0x11')](_0x2665('0x12'),_0x20a2c5,_0x2665('0x10'),JSON[_0x2665('0x13')](_0x3164e0));if(_0x3164e0[_0x2665('0x14')]){if(_0x3164e0[_0x2665('0x14')][_0x2665('0x15')]===0x1f4){logger[_0x2665('0x14')](_0x2665('0xf'),_0x20a2c5,_0x3164e0[_0x2665('0x14')][_0x2665('0x16')]);return _0x5bc4d9(_0x3164e0[_0x2665('0x14')][_0x2665('0x16')]);}logger['error']('MailServerIn,\x20%s,\x20%s',_0x20a2c5,_0x3164e0[_0x2665('0x14')]['message']);return _0x540a5c(_0x3164e0[_0x2665('0x14')]['message']);}else{logger[_0x2665('0xe')]('MailServerIn,\x20%s,\x20%s',_0x20a2c5,'request\x20sent');_0x540a5c(_0x3164e0[_0x2665('0x17')][_0x2665('0x16')]);}})[_0x2665('0x18')](function(_0x42db54){logger[_0x2665('0x14')](_0x2665('0xf'),_0x20a2c5,_0x42db54);_0x5bc4d9(_0x42db54);});});}exports[_0x2665('0x19')]=function(_0x42fd74){var _0x5ac806=this;return new Promise(function(_0x4e56c9,_0x1b5190){return db[_0x2665('0x1a')][_0x2665('0x1b')]({'raw':_0x42fd74[_0x2665('0x1c')]?_0x42fd74['options'][_0x2665('0x1d')]===undefined?!![]:![]:!![],'where':_0x42fd74[_0x2665('0x1c')]?_0x42fd74['options']['where']||null:null,'attributes':_0x42fd74[_0x2665('0x1c')]?_0x42fd74[_0x2665('0x1c')][_0x2665('0x1e')]||null:null,'limit':_0x42fd74[_0x2665('0x1c')]?_0x42fd74[_0x2665('0x1c')]['limit']||null:null,'include':_0x42fd74[_0x2665('0x1c')]?_0x42fd74['options'][_0x2665('0x1f')]?_[_0x2665('0x20')](_0x42fd74[_0x2665('0x1c')][_0x2665('0x1f')],function(_0x59470b){return{'model':db[_0x59470b[_0x2665('0x21')]],'as':_0x59470b['as'],'attributes':_0x59470b[_0x2665('0x1e')],'include':_0x59470b[_0x2665('0x1f')]?_['map'](_0x59470b[_0x2665('0x1f')],function(_0x3eabd8){return{'model':db[_0x3eabd8['model']],'as':_0x3eabd8['as'],'attributes':_0x3eabd8[_0x2665('0x1e')],'include':_0x3eabd8['include']?_[_0x2665('0x20')](_0x3eabd8[_0x2665('0x1f')],function(_0x32eb3b){return{'model':db[_0x32eb3b[_0x2665('0x21')]],'as':_0x32eb3b['as'],'attributes':_0x32eb3b[_0x2665('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x2665('0xd')](function(_0x2c9d1a){logger['info'](_0x2665('0x19'),_0x42fd74);logger[_0x2665('0x11')](_0x2665('0x19'),_0x42fd74,JSON[_0x2665('0x13')](_0x2c9d1a));_0x4e56c9(_0x2c9d1a);})[_0x2665('0x18')](function(_0x748b7b){logger['error']('GetMailServerIn',_0x748b7b[_0x2665('0x16')],_0x42fd74);_0x1b5190(_0x5ac806[_0x2665('0x14')](0x1f4,_0x748b7b['message']));});});}; \ No newline at end of file +var _0xcf66=['request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','findAll','options','raw','where','map','include','model','attributes','then','GetMailServerIn','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','MailServerIn,\x20%s,\x20%s'];(function(_0x44e1cb,_0x265402){var _0x50ec8f=function(_0x141884){while(--_0x141884){_0x44e1cb['push'](_0x44e1cb['shift']());}};_0x50ec8f(++_0x265402);}(_0xcf66,0x11c));var _0x6cf6=function(_0x56d019,_0xdfd5bb){_0x56d019=_0x56d019-0x0;var _0x10fdd4=_0xcf66[_0x56d019];return _0x10fdd4;};'use strict';var _=require(_0x6cf6('0x0'));var util=require(_0x6cf6('0x1'));var moment=require(_0x6cf6('0x2'));var BPromise=require(_0x6cf6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6cf6('0x4'))['db'];var utils=require(_0x6cf6('0x5'));var logger=require(_0x6cf6('0x6'))('rpc');var config=require(_0x6cf6('0x7'));var jayson=require(_0x6cf6('0x8'));var client=jayson[_0x6cf6('0x9')][_0x6cf6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x140907,_0x370413,_0x447a00){return new BPromise(function(_0x1c80ac,_0x2fb50b){return client[_0x6cf6('0xb')](_0x140907,_0x447a00)['then'](function(_0xccd6eb){logger['info'](_0x6cf6('0xc'),_0x370413,_0x6cf6('0xd'));logger[_0x6cf6('0xe')](_0x6cf6('0xf'),_0x370413,_0x6cf6('0xd'),JSON[_0x6cf6('0x10')](_0xccd6eb));if(_0xccd6eb[_0x6cf6('0x11')]){if(_0xccd6eb['error'][_0x6cf6('0x12')]===0x1f4){logger[_0x6cf6('0x11')](_0x6cf6('0xc'),_0x370413,_0xccd6eb[_0x6cf6('0x11')][_0x6cf6('0x13')]);return _0x2fb50b(_0xccd6eb[_0x6cf6('0x11')]['message']);}logger[_0x6cf6('0x11')](_0x6cf6('0xc'),_0x370413,_0xccd6eb[_0x6cf6('0x11')][_0x6cf6('0x13')]);return _0x1c80ac(_0xccd6eb[_0x6cf6('0x11')][_0x6cf6('0x13')]);}else{logger[_0x6cf6('0x14')](_0x6cf6('0xc'),_0x370413,'request\x20sent');_0x1c80ac(_0xccd6eb[_0x6cf6('0x15')]['message']);}})[_0x6cf6('0x16')](function(_0x4fcbb8){logger[_0x6cf6('0x11')](_0x6cf6('0xc'),_0x370413,_0x4fcbb8);_0x2fb50b(_0x4fcbb8);});});}exports['GetMailServerIn']=function(_0x21457e){var _0x29376a=this;return new Promise(function(_0xb932b6,_0x2ab24f){return db['MailServerIn'][_0x6cf6('0x17')]({'raw':_0x21457e[_0x6cf6('0x18')]?_0x21457e[_0x6cf6('0x18')][_0x6cf6('0x19')]===undefined?!![]:![]:!![],'where':_0x21457e[_0x6cf6('0x18')]?_0x21457e[_0x6cf6('0x18')][_0x6cf6('0x1a')]||null:null,'attributes':_0x21457e[_0x6cf6('0x18')]?_0x21457e['options']['attributes']||null:null,'limit':_0x21457e[_0x6cf6('0x18')]?_0x21457e[_0x6cf6('0x18')]['limit']||null:null,'include':_0x21457e[_0x6cf6('0x18')]?_0x21457e[_0x6cf6('0x18')]['include']?_[_0x6cf6('0x1b')](_0x21457e['options'][_0x6cf6('0x1c')],function(_0x36773d){return{'model':db[_0x36773d[_0x6cf6('0x1d')]],'as':_0x36773d['as'],'attributes':_0x36773d['attributes'],'include':_0x36773d['include']?_[_0x6cf6('0x1b')](_0x36773d[_0x6cf6('0x1c')],function(_0x25ceab){return{'model':db[_0x25ceab[_0x6cf6('0x1d')]],'as':_0x25ceab['as'],'attributes':_0x25ceab[_0x6cf6('0x1e')],'include':_0x25ceab['include']?_[_0x6cf6('0x1b')](_0x25ceab[_0x6cf6('0x1c')],function(_0x54ab3e){return{'model':db[_0x54ab3e[_0x6cf6('0x1d')]],'as':_0x54ab3e['as'],'attributes':_0x54ab3e[_0x6cf6('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x6cf6('0x1f')](function(_0x45f2dd){logger['info'](_0x6cf6('0x20'),_0x21457e);logger['debug']('GetMailServerIn',_0x21457e,JSON['stringify'](_0x45f2dd));_0xb932b6(_0x45f2dd);})['catch'](function(_0x38a86e){logger[_0x6cf6('0x11')](_0x6cf6('0x20'),_0x38a86e[_0x6cf6('0x13')],_0x21457e);_0x2ab24f(_0x29376a[_0x6cf6('0x11')](0x1f4,_0x38a86e['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 367d2dc..ad48a32 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(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'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(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x7a54,0x106));var _0x47a5=function(_0x2e8661,_0x21ad49){_0x2e8661=_0x2e8661-0x0;var _0x5d2f30=_0x7a54[_0x2e8661];return _0x5d2f30;};'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 4e33bbf..e6ae088 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 _0x7f6a=['INTEGER','BOOLEAN','sequelize','exports','STRING'];(function(_0x45ce82,_0x4fe2bc){var _0x2f58e9=function(_0x3aada6){while(--_0x3aada6){_0x45ce82['push'](_0x45ce82['shift']());}};_0x2f58e9(++_0x4fe2bc);}(_0x7f6a,0x1b5));var _0xa7f6=function(_0x227331,_0x19be4c){_0x227331=_0x227331-0x0;var _0x31e1dc=_0x7f6a[_0x227331];return _0x31e1dc;};'use strict';var Sequelize=require(_0xa7f6('0x0'));module[_0xa7f6('0x1')]={'description':{'type':Sequelize[_0xa7f6('0x2')]},'host':{'type':Sequelize[_0xa7f6('0x2')]},'user':{'type':Sequelize[_0xa7f6('0x2')]},'pass':{'type':Sequelize[_0xa7f6('0x2')]},'port':{'type':Sequelize[_0xa7f6('0x3')]},'secure':{'type':Sequelize[_0xa7f6('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0xa7f6('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x133d=['STRING','INTEGER','BOOLEAN','sequelize','exports'];(function(_0x5ddaac,_0x2697a8){var _0x2a9c58=function(_0x851032){while(--_0x851032){_0x5ddaac['push'](_0x5ddaac['shift']());}};_0x2a9c58(++_0x2697a8);}(_0x133d,0x193));var _0xd133=function(_0xb03f9,_0x588391){_0xb03f9=_0xb03f9-0x0;var _0x3ec30a=_0x133d[_0xb03f9];return _0x3ec30a;};'use strict';var Sequelize=require(_0xd133('0x0'));module[_0xd133('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xd133('0x2')]},'user':{'type':Sequelize[_0xd133('0x2')]},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xd133('0x3')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0xd133('0x2')]},'authentication':{'type':Sequelize[_0xd133('0x4')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 035bb76..611d7b1 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 _0xda69=['rimraf','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','index','MailServerOut','fieldName','type','map','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','eml-format'];(function(_0x2122fe,_0x2e5a7f){var _0x396575=function(_0x5e7002){while(--_0x5e7002){_0x2122fe['push'](_0x2122fe['shift']());}};_0x396575(++_0x2e5a7f);}(_0xda69,0xd7));var _0x9da6=function(_0x31eb67,_0x9bc8c0){_0x31eb67=_0x31eb67-0x0;var _0x2a8cb8=_0xda69[_0x31eb67];return _0x2a8cb8;};'use strict';var emlformat=require(_0x9da6('0x0'));var rimraf=require(_0x9da6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9da6('0x2'));var moment=require(_0x9da6('0x3'));var BPromise=require(_0x9da6('0x4'));var Mustache=require('mustache');var util=require(_0x9da6('0x5'));var path=require('path');var sox=require(_0x9da6('0x6'));var csv=require(_0x9da6('0x7'));var ejs=require(_0x9da6('0x8'));var fs=require('fs');var fs_extra=require(_0x9da6('0x9'));var _=require(_0x9da6('0xa'));var squel=require(_0x9da6('0xb'));var crypto=require(_0x9da6('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9da6('0xd'));var Papa=require('papaparse');var Redis=require(_0x9da6('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x9da6('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9da6('0x10'));var logger=require(_0x9da6('0x11'))(_0x9da6('0x12'));var utils=require(_0x9da6('0x13'));var config=require(_0x9da6('0x14'));var licenseUtil=require(_0x9da6('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x32835f,_0x493676){_0x493676=_0x493676||0xcc;return function(_0x2632f6){if(_0x2632f6){return _0x32835f[_0x9da6('0x16')](_0x493676);}return _0x32835f[_0x9da6('0x17')](_0x493676)[_0x9da6('0x18')]();};}function respondWithResult(_0x59dce0,_0xc429e0){_0xc429e0=_0xc429e0||0xc8;return function(_0x1b88c4){if(_0x1b88c4){return _0x59dce0['status'](_0xc429e0)[_0x9da6('0x19')](_0x1b88c4);}};}function respondWithFilteredResult(_0x41aef8,_0x4e2292){return function(_0x544236){if(_0x544236){var _0x5770fa=typeof _0x4e2292['offset']===_0x9da6('0x1a')&&typeof _0x4e2292[_0x9da6('0x1b')]==='undefined';var _0x2cd586=_0x544236[_0x9da6('0x1c')];var _0x41d586=_0x5770fa?0x0:_0x4e2292['offset'];var _0x329a2f=_0x5770fa?_0x544236[_0x9da6('0x1c')]:_0x4e2292[_0x9da6('0x1d')]+_0x4e2292[_0x9da6('0x1b')];var _0x16cfa1;if(_0x329a2f>=_0x2cd586){_0x329a2f=_0x2cd586;_0x16cfa1=0xc8;}else{_0x16cfa1=0xce;}_0x41aef8[_0x9da6('0x17')](_0x16cfa1);return _0x41aef8['set'](_0x9da6('0x1e'),_0x41d586+'-'+_0x329a2f+'/'+_0x2cd586)['json'](_0x544236);}return null;};}function patchUpdates(_0x7e2273){return function(_0x55bfc9){try{jsonpatch[_0x9da6('0x1f')](_0x55bfc9,_0x7e2273,!![]);}catch(_0x4c2102){return BPromise[_0x9da6('0x20')](_0x4c2102);}return _0x55bfc9[_0x9da6('0x21')]();};}function saveUpdates(_0x292a12,_0x46ebce){return function(_0x139e28){if(_0x139e28){return _0x139e28[_0x9da6('0x22')](_0x292a12)['then'](function(_0x4ff5ed){return _0x4ff5ed;});}return null;};}function removeEntity(_0x7fbab6,_0xe10883){return function(_0x46365c){if(_0x46365c){return _0x46365c[_0x9da6('0x23')]()[_0x9da6('0x24')](function(){_0x7fbab6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ed06a,_0x588b37){return function(_0x5ab5fc){if(!_0x5ab5fc){_0x2ed06a[_0x9da6('0x16')](0x194);}return _0x5ab5fc;};}function handleError(_0x35ebf1,_0x5aff32){_0x5aff32=_0x5aff32||0x1f4;return function(_0x2d4714){logger[_0x9da6('0x25')](_0x2d4714[_0x9da6('0x26')]);if(_0x2d4714[_0x9da6('0x27')]){delete _0x2d4714[_0x9da6('0x27')];}_0x35ebf1[_0x9da6('0x17')](_0x5aff32)['send'](_0x2d4714);};}exports[_0x9da6('0x28')]=function(_0x5f2e53,_0x1d52f8){var _0x1de7a0={},_0x4d51e8={},_0x289c6d={'count':0x0,'rows':[]};var _0x1930be=_['map'](db[_0x9da6('0x29')]['rawAttributes'],function(_0x3f4ae5){return{'name':_0x3f4ae5[_0x9da6('0x2a')],'type':_0x3f4ae5[_0x9da6('0x2b')]['key']};});_0x4d51e8['model']=_[_0x9da6('0x2c')](_0x1930be,_0x9da6('0x27'));_0x4d51e8[_0x9da6('0x2d')]=_[_0x9da6('0x2e')](_0x5f2e53[_0x9da6('0x2d')]);_0x4d51e8[_0x9da6('0x2f')]=_[_0x9da6('0x30')](_0x4d51e8['model'],_0x4d51e8[_0x9da6('0x2d')]);_0x1de7a0[_0x9da6('0x31')]=_[_0x9da6('0x30')](_0x4d51e8[_0x9da6('0x32')],qs[_0x9da6('0x33')](_0x5f2e53[_0x9da6('0x2d')][_0x9da6('0x33')]));_0x1de7a0['attributes']=_0x1de7a0['attributes'][_0x9da6('0x34')]?_0x1de7a0[_0x9da6('0x31')]:_0x4d51e8['model'];if(!_0x5f2e53['query'][_0x9da6('0x35')](_0x9da6('0x36'))){_0x1de7a0['limit']=qs[_0x9da6('0x1b')](_0x5f2e53['query'][_0x9da6('0x1b')]);_0x1de7a0[_0x9da6('0x1d')]=qs[_0x9da6('0x1d')](_0x5f2e53[_0x9da6('0x2d')]['offset']);}_0x1de7a0[_0x9da6('0x37')]=qs[_0x9da6('0x38')](_0x5f2e53[_0x9da6('0x2d')][_0x9da6('0x38')]);_0x1de7a0[_0x9da6('0x39')]=qs[_0x9da6('0x2f')](_[_0x9da6('0x3a')](_0x5f2e53[_0x9da6('0x2d')],_0x4d51e8[_0x9da6('0x2f')]),_0x1930be);if(_0x5f2e53[_0x9da6('0x2d')][_0x9da6('0x3b')]){_0x1de7a0[_0x9da6('0x39')]=_['merge'](_0x1de7a0[_0x9da6('0x39')],{'$or':_[_0x9da6('0x2c')](_0x1930be,function(_0x373308){if(_0x373308[_0x9da6('0x2b')]!==_0x9da6('0x3c')){var _0x2331f4={};_0x2331f4[_0x373308[_0x9da6('0x27')]]={'$like':'%'+_0x5f2e53[_0x9da6('0x2d')][_0x9da6('0x3b')]+'%'};return _0x2331f4;}})});}_0x1de7a0=_['merge']({},_0x1de7a0,_0x5f2e53[_0x9da6('0x3d')]);var _0x12a868={'where':_0x1de7a0[_0x9da6('0x39')]};return db[_0x9da6('0x29')]['count'](_0x12a868)[_0x9da6('0x24')](function(_0x26d7f2){_0x289c6d['count']=_0x26d7f2;if(_0x5f2e53[_0x9da6('0x2d')][_0x9da6('0x3e')]){_0x1de7a0[_0x9da6('0x3f')]=[{'all':!![]}];}return db[_0x9da6('0x29')]['findAll'](_0x1de7a0);})[_0x9da6('0x24')](function(_0x24667c){_0x289c6d[_0x9da6('0x40')]=_0x24667c;return _0x289c6d;})['then'](respondWithFilteredResult(_0x1d52f8,_0x1de7a0))[_0x9da6('0x41')](handleError(_0x1d52f8,null));};exports[_0x9da6('0x42')]=function(_0x1cb347,_0xef58a1){var _0x52759b={'raw':!![],'where':{'id':_0x1cb347[_0x9da6('0x43')]['id']}},_0x256c3e={};_0x256c3e['model']=_[_0x9da6('0x2e')](db[_0x9da6('0x29')][_0x9da6('0x44')]);_0x256c3e[_0x9da6('0x2d')]=_[_0x9da6('0x2e')](_0x1cb347['query']);_0x256c3e[_0x9da6('0x2f')]=_['intersection'](_0x256c3e['model'],_0x256c3e[_0x9da6('0x2d')]);_0x52759b['attributes']=_['intersection'](_0x256c3e[_0x9da6('0x32')],qs[_0x9da6('0x33')](_0x1cb347[_0x9da6('0x2d')]['fields']));_0x52759b[_0x9da6('0x31')]=_0x52759b[_0x9da6('0x31')][_0x9da6('0x34')]?_0x52759b[_0x9da6('0x31')]:_0x256c3e['model'];if(_0x1cb347[_0x9da6('0x2d')]['includeAll']){_0x52759b[_0x9da6('0x3f')]=[{'all':!![]}];}_0x52759b=_['merge']({},_0x52759b,_0x1cb347[_0x9da6('0x3d')]);return db[_0x9da6('0x29')][_0x9da6('0x45')](_0x52759b)[_0x9da6('0x24')](handleEntityNotFound(_0xef58a1,null))[_0x9da6('0x24')](respondWithResult(_0xef58a1,null))[_0x9da6('0x41')](handleError(_0xef58a1,null));};exports[_0x9da6('0x46')]=function(_0x5e5b19,_0x4d8807){return db['MailServerOut'][_0x9da6('0x46')](_0x5e5b19[_0x9da6('0x47')],{})[_0x9da6('0x24')](respondWithResult(_0x4d8807,0xc9))[_0x9da6('0x41')](handleError(_0x4d8807,null));};exports[_0x9da6('0x22')]=function(_0x3f11c7,_0x2ae802){if(_0x3f11c7[_0x9da6('0x47')]['id']){delete _0x3f11c7[_0x9da6('0x47')]['id'];}return db[_0x9da6('0x29')]['find']({'where':{'id':_0x3f11c7[_0x9da6('0x43')]['id']}})[_0x9da6('0x24')](handleEntityNotFound(_0x2ae802,null))[_0x9da6('0x24')](saveUpdates(_0x3f11c7[_0x9da6('0x47')],null))[_0x9da6('0x24')](respondWithResult(_0x2ae802,null))[_0x9da6('0x41')](handleError(_0x2ae802,null));};exports['destroy']=function(_0x5e7774,_0x2c89d5){return db[_0x9da6('0x29')][_0x9da6('0x45')]({'where':{'id':_0x5e7774['params']['id']}})['then'](handleEntityNotFound(_0x2c89d5,null))['then'](removeEntity(_0x2c89d5,null))[_0x9da6('0x41')](handleError(_0x2c89d5,null));}; \ No newline at end of file +var _0x47bf=['filter','options','includeAll','findAll','catch','show','params','keys','include','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','name','index','map','MailServerOut','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x47bf,0x1bc));var _0xf47b=function(_0x279384,_0x2f2e1d){_0x279384=_0x279384-0x0;var _0x339a37=_0x47bf[_0x279384];return _0x339a37;};'use strict';var emlformat=require(_0xf47b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf47b('0x1'));var jsonpatch=require(_0xf47b('0x2'));var rp=require(_0xf47b('0x3'));var moment=require(_0xf47b('0x4'));var BPromise=require(_0xf47b('0x5'));var Mustache=require(_0xf47b('0x6'));var util=require(_0xf47b('0x7'));var path=require(_0xf47b('0x8'));var sox=require(_0xf47b('0x9'));var csv=require(_0xf47b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf47b('0xb'));var _=require(_0xf47b('0xc'));var squel=require('squel');var crypto=require(_0xf47b('0xd'));var jsforce=require(_0xf47b('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xf47b('0xa'));var querystring=require('querystring');var Papa=require(_0xf47b('0xf'));var Redis=require(_0xf47b('0x10'));var authService=require(_0xf47b('0x11'));var qs=require(_0xf47b('0x12'));var as=require(_0xf47b('0x13'));var hardwareService=require(_0xf47b('0x14'));var logger=require(_0xf47b('0x15'))(_0xf47b('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf47b('0x17'));var db=require(_0xf47b('0x18'))['db'];function respondWithStatusCode(_0x1ced79,_0x2e5f79){_0x2e5f79=_0x2e5f79||0xcc;return function(_0x180084){if(_0x180084){return _0x1ced79['sendStatus'](_0x2e5f79);}return _0x1ced79[_0xf47b('0x19')](_0x2e5f79)[_0xf47b('0x1a')]();};}function respondWithResult(_0x40f64e,_0x57a2aa){_0x57a2aa=_0x57a2aa||0xc8;return function(_0x414072){if(_0x414072){return _0x40f64e[_0xf47b('0x19')](_0x57a2aa)[_0xf47b('0x1b')](_0x414072);}};}function respondWithFilteredResult(_0x5e5a12,_0x5be1bb){return function(_0x27eb0f){if(_0x27eb0f){var _0x3a5976=typeof _0x5be1bb[_0xf47b('0x1c')]===_0xf47b('0x1d')&&typeof _0x5be1bb[_0xf47b('0x1e')]===_0xf47b('0x1d');var _0x51805f=_0x27eb0f[_0xf47b('0x1f')];var _0x4eb1bd=_0x3a5976?0x0:_0x5be1bb[_0xf47b('0x1c')];var _0x5590c9=_0x3a5976?_0x27eb0f['count']:_0x5be1bb[_0xf47b('0x1c')]+_0x5be1bb[_0xf47b('0x1e')];var _0xf4b5ac;if(_0x5590c9>=_0x51805f){_0x5590c9=_0x51805f;_0xf4b5ac=0xc8;}else{_0xf4b5ac=0xce;}_0x5e5a12[_0xf47b('0x19')](_0xf4b5ac);return _0x5e5a12['set'](_0xf47b('0x20'),_0x4eb1bd+'-'+_0x5590c9+'/'+_0x51805f)[_0xf47b('0x1b')](_0x27eb0f);}return null;};}function patchUpdates(_0x1f2a44){return function(_0x51baae){try{jsonpatch[_0xf47b('0x21')](_0x51baae,_0x1f2a44,!![]);}catch(_0x6fbe49){return BPromise['reject'](_0x6fbe49);}return _0x51baae[_0xf47b('0x22')]();};}function saveUpdates(_0x3328bd,_0x50c4ed){return function(_0x4fe177){if(_0x4fe177){return _0x4fe177[_0xf47b('0x23')](_0x3328bd)[_0xf47b('0x24')](function(_0x5452c4){return _0x5452c4;});}return null;};}function removeEntity(_0x1c17d5,_0x5b9d52){return function(_0x52168e){if(_0x52168e){return _0x52168e[_0xf47b('0x25')]()['then'](function(){_0x1c17d5[_0xf47b('0x19')](0xcc)[_0xf47b('0x1a')]();});}};}function handleEntityNotFound(_0x25dc85,_0x140d45){return function(_0x3473ae){if(!_0x3473ae){_0x25dc85['sendStatus'](0x194);}return _0x3473ae;};}function handleError(_0x497d51,_0xd0e569){_0xd0e569=_0xd0e569||0x1f4;return function(_0x364748){logger['error'](_0x364748['stack']);if(_0x364748[_0xf47b('0x26')]){delete _0x364748[_0xf47b('0x26')];}_0x497d51[_0xf47b('0x19')](_0xd0e569)['send'](_0x364748);};}exports[_0xf47b('0x27')]=function(_0x1af603,_0x2b118b){var _0x2bab37={},_0x392b3f={},_0x1a6a55={'count':0x0,'rows':[]};var _0x382455=_[_0xf47b('0x28')](db[_0xf47b('0x29')][_0xf47b('0x2a')],function(_0xc14993){return{'name':_0xc14993[_0xf47b('0x2b')],'type':_0xc14993['type'][_0xf47b('0x2c')]};});_0x392b3f[_0xf47b('0x2d')]=_[_0xf47b('0x28')](_0x382455,'name');_0x392b3f[_0xf47b('0x2e')]=_['keys'](_0x1af603['query']);_0x392b3f[_0xf47b('0x2f')]=_[_0xf47b('0x30')](_0x392b3f[_0xf47b('0x2d')],_0x392b3f[_0xf47b('0x2e')]);_0x2bab37[_0xf47b('0x31')]=_[_0xf47b('0x30')](_0x392b3f[_0xf47b('0x2d')],qs[_0xf47b('0x32')](_0x1af603[_0xf47b('0x2e')]['fields']));_0x2bab37[_0xf47b('0x31')]=_0x2bab37[_0xf47b('0x31')][_0xf47b('0x33')]?_0x2bab37[_0xf47b('0x31')]:_0x392b3f[_0xf47b('0x2d')];if(!_0x1af603[_0xf47b('0x2e')][_0xf47b('0x34')]('nolimit')){_0x2bab37['limit']=qs[_0xf47b('0x1e')](_0x1af603[_0xf47b('0x2e')]['limit']);_0x2bab37[_0xf47b('0x1c')]=qs[_0xf47b('0x1c')](_0x1af603[_0xf47b('0x2e')][_0xf47b('0x1c')]);}_0x2bab37[_0xf47b('0x35')]=qs[_0xf47b('0x36')](_0x1af603['query'][_0xf47b('0x36')]);_0x2bab37[_0xf47b('0x37')]=qs[_0xf47b('0x2f')](_[_0xf47b('0x38')](_0x1af603[_0xf47b('0x2e')],_0x392b3f[_0xf47b('0x2f')]),_0x382455);if(_0x1af603[_0xf47b('0x2e')]['filter']){_0x2bab37[_0xf47b('0x37')]=_[_0xf47b('0x39')](_0x2bab37['where'],{'$or':_[_0xf47b('0x28')](_0x382455,function(_0x48e803){if(_0x48e803[_0xf47b('0x3a')]!==_0xf47b('0x3b')){var _0x873a58={};_0x873a58[_0x48e803[_0xf47b('0x26')]]={'$like':'%'+_0x1af603[_0xf47b('0x2e')][_0xf47b('0x3c')]+'%'};return _0x873a58;}})});}_0x2bab37=_[_0xf47b('0x39')]({},_0x2bab37,_0x1af603[_0xf47b('0x3d')]);var _0x1c0baf={'where':_0x2bab37['where']};return db[_0xf47b('0x29')][_0xf47b('0x1f')](_0x1c0baf)[_0xf47b('0x24')](function(_0x5546ad){_0x1a6a55[_0xf47b('0x1f')]=_0x5546ad;if(_0x1af603[_0xf47b('0x2e')][_0xf47b('0x3e')]){_0x2bab37['include']=[{'all':!![]}];}return db[_0xf47b('0x29')][_0xf47b('0x3f')](_0x2bab37);})['then'](function(_0x30ac9b){_0x1a6a55['rows']=_0x30ac9b;return _0x1a6a55;})['then'](respondWithFilteredResult(_0x2b118b,_0x2bab37))[_0xf47b('0x40')](handleError(_0x2b118b,null));};exports[_0xf47b('0x41')]=function(_0x3b301d,_0x5475de){var _0x3e2d0d={'raw':!![],'where':{'id':_0x3b301d[_0xf47b('0x42')]['id']}},_0x27e8c0={};_0x27e8c0[_0xf47b('0x2d')]=_[_0xf47b('0x43')](db[_0xf47b('0x29')][_0xf47b('0x2a')]);_0x27e8c0['query']=_['keys'](_0x3b301d[_0xf47b('0x2e')]);_0x27e8c0[_0xf47b('0x2f')]=_['intersection'](_0x27e8c0['model'],_0x27e8c0[_0xf47b('0x2e')]);_0x3e2d0d[_0xf47b('0x31')]=_[_0xf47b('0x30')](_0x27e8c0[_0xf47b('0x2d')],qs[_0xf47b('0x32')](_0x3b301d[_0xf47b('0x2e')][_0xf47b('0x32')]));_0x3e2d0d['attributes']=_0x3e2d0d['attributes'][_0xf47b('0x33')]?_0x3e2d0d[_0xf47b('0x31')]:_0x27e8c0[_0xf47b('0x2d')];if(_0x3b301d[_0xf47b('0x2e')][_0xf47b('0x3e')]){_0x3e2d0d[_0xf47b('0x44')]=[{'all':!![]}];}_0x3e2d0d=_['merge']({},_0x3e2d0d,_0x3b301d['options']);return db[_0xf47b('0x29')][_0xf47b('0x45')](_0x3e2d0d)[_0xf47b('0x24')](handleEntityNotFound(_0x5475de,null))[_0xf47b('0x24')](respondWithResult(_0x5475de,null))[_0xf47b('0x40')](handleError(_0x5475de,null));};exports[_0xf47b('0x46')]=function(_0x214593,_0x42ab0a){return db[_0xf47b('0x29')][_0xf47b('0x46')](_0x214593[_0xf47b('0x47')],{})[_0xf47b('0x24')](respondWithResult(_0x42ab0a,0xc9))[_0xf47b('0x40')](handleError(_0x42ab0a,null));};exports['update']=function(_0xccf07d,_0x450567){if(_0xccf07d[_0xf47b('0x47')]['id']){delete _0xccf07d[_0xf47b('0x47')]['id'];}return db[_0xf47b('0x29')][_0xf47b('0x45')]({'where':{'id':_0xccf07d['params']['id']}})[_0xf47b('0x24')](handleEntityNotFound(_0x450567,null))[_0xf47b('0x24')](saveUpdates(_0xccf07d[_0xf47b('0x47')],null))['then'](respondWithResult(_0x450567,null))[_0xf47b('0x40')](handleError(_0x450567,null));};exports[_0xf47b('0x25')]=function(_0x5a87fc,_0x1eb0c1){return db[_0xf47b('0x29')][_0xf47b('0x45')]({'where':{'id':_0x5a87fc['params']['id']}})[_0xf47b('0x24')](handleEntityNotFound(_0x1eb0c1,null))[_0xf47b('0x24')](removeEntity(_0x1eb0c1,null))['catch'](handleError(_0x1eb0c1,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 07f85a5..efac50c 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 _0x8c9d=['moment','bluebird','rimraf','../../config/environment','./mailServerOut.attributes','exports','define','lodash','util','api'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8c9d,0x151));var _0xd8c9=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x8c9d[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xd8c9('0x0'));var util=require(_0xd8c9('0x1'));var logger=require('../../config/logger')(_0xd8c9('0x2'));var moment=require(_0xd8c9('0x3'));var BPromise=require(_0xd8c9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd8c9('0x5'));var config=require(_0xd8c9('0x6'));var attributes=require(_0xd8c9('0x7'));module[_0xd8c9('0x8')]=function(_0x1423f8,_0x200026){return _0x1423f8[_0xd8c9('0x9')]('MailServerOut',attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8c94=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut','mail_servers_out','lodash','util','../../config/logger','api'];(function(_0x398611,_0x270e8c){var _0x3b8e8f=function(_0x230163){while(--_0x230163){_0x398611['push'](_0x398611['shift']());}};_0x3b8e8f(++_0x270e8c);}(_0x8c94,0x119));var _0x48c9=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x8c94[_0x2d7f0e];return _0x110b07;};'use strict';var _=require(_0x48c9('0x0'));var util=require(_0x48c9('0x1'));var logger=require(_0x48c9('0x2'))(_0x48c9('0x3'));var moment=require(_0x48c9('0x4'));var BPromise=require(_0x48c9('0x5'));var rp=require(_0x48c9('0x6'));var fs=require('fs');var path=require(_0x48c9('0x7'));var rimraf=require(_0x48c9('0x8'));var config=require(_0x48c9('0x9'));var attributes=require(_0x48c9('0xa'));module[_0x48c9('0xb')]=function(_0x358cb2,_0x3ed856){return _0x358cb2[_0x48c9('0xc')](_0x48c9('0xd'),attributes,{'tableName':_0x48c9('0xe'),'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 6ef4c08..d58c584 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 _0x7a54=['info','MailServerOut,\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(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x7a54,0x106));var _0x47a5=function(_0x79d6d3,_0x34b8d5){_0x79d6d3=_0x79d6d3-0x0;var _0x5ef317=_0x7a54[_0x79d6d3];return _0x5ef317;};'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')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x4974a6,_0x33ddfa){var _0x11d3ec=function(_0x123232){while(--_0x123232){_0x4974a6['push'](_0x4974a6['shift']());}};_0x11d3ec(++_0x33ddfa);}(_0xdb28,0x106));var _0x8db2=function(_0x4bfd86,_0x31082a){_0x4bfd86=_0x4bfd86-0x0;var _0x28a4cb=_0xdb28[_0x4bfd86];return _0x28a4cb;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 9c6541c..8ed1722 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 _0x8827=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','show','post','create','put','/:id','destroy','exports','multer','util','path','connect-timeout'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x8827,0x13c));var _0x7882=function(_0x39b947,_0x24a694){_0x39b947=_0x39b947-0x0;var _0x2fca46=_0x8827[_0x39b947];return _0x2fca46;};'use strict';var multer=require(_0x7882('0x0'));var util=require(_0x7882('0x1'));var path=require(_0x7882('0x2'));var timeout=require(_0x7882('0x3'));var express=require('express');var router=express[_0x7882('0x4')]();var fs_extra=require(_0x7882('0x5'));var auth=require(_0x7882('0x6'));var interaction=require(_0x7882('0x7'));var config=require(_0x7882('0x8'));var controller=require('./mailSubstatus.controller');router[_0x7882('0x9')]('/',auth[_0x7882('0xa')](),controller['index']);router[_0x7882('0x9')](_0x7882('0xb'),auth[_0x7882('0xa')](),controller[_0x7882('0xc')]);router[_0x7882('0x9')]('/:id',auth[_0x7882('0xa')](),controller[_0x7882('0xd')]);router[_0x7882('0xe')]('/',auth[_0x7882('0xa')](),controller[_0x7882('0xf')]);router[_0x7882('0x10')](_0x7882('0x11'),auth[_0x7882('0xa')](),controller['update']);router['delete'](_0x7882('0x11'),auth['isAuthenticated'](),controller[_0x7882('0x12')]);module[_0x7882('0x13')]=router; \ No newline at end of file +var _0xb6b6=['./mailSubstatus.controller','get','index','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4f8499,_0x12c7ac){var _0x2fad53=function(_0x33b6ca){while(--_0x33b6ca){_0x4f8499['push'](_0x4f8499['shift']());}};_0x2fad53(++_0x12c7ac);}(_0xb6b6,0x172));var _0x6b6b=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xb6b6[_0xfae23b];return _0x200640;};'use strict';var multer=require(_0x6b6b('0x0'));var util=require(_0x6b6b('0x1'));var path=require(_0x6b6b('0x2'));var timeout=require('connect-timeout');var express=require(_0x6b6b('0x3'));var router=express[_0x6b6b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6b6b('0x5'));var interaction=require(_0x6b6b('0x6'));var config=require(_0x6b6b('0x7'));var controller=require(_0x6b6b('0x8'));router[_0x6b6b('0x9')]('/',auth['isAuthenticated'](),controller[_0x6b6b('0xa')]);router['get']('/describe',auth[_0x6b6b('0xb')](),controller['describe']);router[_0x6b6b('0x9')](_0x6b6b('0xc'),auth[_0x6b6b('0xb')](),controller[_0x6b6b('0xd')]);router[_0x6b6b('0xe')]('/',auth[_0x6b6b('0xb')](),controller[_0x6b6b('0xf')]);router[_0x6b6b('0x10')](_0x6b6b('0xc'),auth[_0x6b6b('0xb')](),controller[_0x6b6b('0x11')]);router[_0x6b6b('0x12')](_0x6b6b('0xc'),auth[_0x6b6b('0xb')](),controller[_0x6b6b('0x13')]);module[_0x6b6b('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index be018fb..873adfa 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 _0x3c94=['name','sequelize','exports','STRING'];(function(_0x51d230,_0x58bd24){var _0x3d2a32=function(_0x42c5a8){while(--_0x42c5a8){_0x51d230['push'](_0x51d230['shift']());}};_0x3d2a32(++_0x58bd24);}(_0x3c94,0xcd));var _0x43c9=function(_0x2bcb75,_0x5789a7){_0x2bcb75=_0x2bcb75-0x0;var _0x175345=_0x3c94[_0x2bcb75];return _0x175345;};'use strict';var Sequelize=require(_0x43c9('0x0'));module[_0x43c9('0x1')]={'name':{'type':Sequelize[_0x43c9('0x2')],'unique':_0x43c9('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x43c9('0x2')]}}; \ No newline at end of file +var _0xdb8b=['STRING','name','exports'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0xdb8b,0x1c4));var _0xbdb8=function(_0x2af5cc,_0x920e4f){_0x2af5cc=_0x2af5cc-0x0;var _0x258bd8=_0xdb8b[_0x2af5cc];return _0x258bd8;};'use strict';var Sequelize=require('sequelize');module[_0xbdb8('0x0')]={'name':{'type':Sequelize[_0xbdb8('0x1')],'unique':_0xbdb8('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index c0e6ee8..cbd198b 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 _0x543a=['VIRTUAL','options','include','findAll','rows','show','params','length','includeAll','catch','create','find','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','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','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','index','map','MailSubstatus','rawAttributes','fieldName','type','key','keys','query','intersection','model','attributes','fields','sort','filters','filter','where','merge'];(function(_0x1fd675,_0x165dfe){var _0x16b554=function(_0x5761ff){while(--_0x5761ff){_0x1fd675['push'](_0x1fd675['shift']());}};_0x16b554(++_0x165dfe);}(_0x543a,0x18f));var _0xa543=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x543a[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xa543('0x0'));var rimraf=require(_0xa543('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa543('0x2'));var rp=require(_0xa543('0x3'));var moment=require(_0xa543('0x4'));var BPromise=require(_0xa543('0x5'));var Mustache=require(_0xa543('0x6'));var util=require('util');var path=require(_0xa543('0x7'));var sox=require(_0xa543('0x8'));var csv=require(_0xa543('0x9'));var ejs=require(_0xa543('0xa'));var fs=require('fs');var fs_extra=require(_0xa543('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa543('0xc'));var jsforce=require(_0xa543('0xd'));var deskjs=require(_0xa543('0xe'));var toCsv=require(_0xa543('0x9'));var querystring=require('querystring');var Papa=require(_0xa543('0xf'));var Redis=require(_0xa543('0x10'));var authService=require(_0xa543('0x11'));var qs=require(_0xa543('0x12'));var as=require(_0xa543('0x13'));var hardwareService=require(_0xa543('0x14'));var logger=require(_0xa543('0x15'))(_0xa543('0x16'));var utils=require(_0xa543('0x17'));var config=require(_0xa543('0x18'));var licenseUtil=require(_0xa543('0x19'));var db=require(_0xa543('0x1a'))['db'];function respondWithStatusCode(_0x115969,_0x5b1593){_0x5b1593=_0x5b1593||0xcc;return function(_0x3fb61d){if(_0x3fb61d){return _0x115969['sendStatus'](_0x5b1593);}return _0x115969['status'](_0x5b1593)[_0xa543('0x1b')]();};}function respondWithResult(_0x5bad8b,_0x3446ad){_0x3446ad=_0x3446ad||0xc8;return function(_0x3cbe78){if(_0x3cbe78){return _0x5bad8b[_0xa543('0x1c')](_0x3446ad)[_0xa543('0x1d')](_0x3cbe78);}};}function respondWithFilteredResult(_0x5aba8e,_0x541a5d){return function(_0xceaed8){if(_0xceaed8){var _0x5c0b3d=typeof _0x541a5d[_0xa543('0x1e')]===_0xa543('0x1f')&&typeof _0x541a5d[_0xa543('0x20')]===_0xa543('0x1f');var _0x22a3d3=_0xceaed8[_0xa543('0x21')];var _0x18f692=_0x5c0b3d?0x0:_0x541a5d['offset'];var _0x608767=_0x5c0b3d?_0xceaed8[_0xa543('0x21')]:_0x541a5d[_0xa543('0x1e')]+_0x541a5d['limit'];var _0x1c58e4;if(_0x608767>=_0x22a3d3){_0x608767=_0x22a3d3;_0x1c58e4=0xc8;}else{_0x1c58e4=0xce;}_0x5aba8e[_0xa543('0x1c')](_0x1c58e4);return _0x5aba8e[_0xa543('0x22')](_0xa543('0x23'),_0x18f692+'-'+_0x608767+'/'+_0x22a3d3)[_0xa543('0x1d')](_0xceaed8);}return null;};}function patchUpdates(_0x2b03ed){return function(_0x4bdacc){try{jsonpatch['apply'](_0x4bdacc,_0x2b03ed,!![]);}catch(_0x721e16){return BPromise[_0xa543('0x24')](_0x721e16);}return _0x4bdacc[_0xa543('0x25')]();};}function saveUpdates(_0x26ff7e,_0x4e6216){return function(_0x2287f8){if(_0x2287f8){return _0x2287f8[_0xa543('0x26')](_0x26ff7e)['then'](function(_0x317c55){return _0x317c55;});}return null;};}function removeEntity(_0x2f3360,_0x13ac26){return function(_0x2a2da3){if(_0x2a2da3){return _0x2a2da3[_0xa543('0x27')]()[_0xa543('0x28')](function(){_0x2f3360[_0xa543('0x1c')](0xcc)[_0xa543('0x1b')]();});}};}function handleEntityNotFound(_0x36010f,_0x83f517){return function(_0x513b42){if(!_0x513b42){_0x36010f['sendStatus'](0x194);}return _0x513b42;};}function handleError(_0x18355f,_0x2eeb5b){_0x2eeb5b=_0x2eeb5b||0x1f4;return function(_0x124cbb){logger[_0xa543('0x29')](_0x124cbb[_0xa543('0x2a')]);if(_0x124cbb[_0xa543('0x2b')]){delete _0x124cbb[_0xa543('0x2b')];}_0x18355f[_0xa543('0x1c')](_0x2eeb5b)[_0xa543('0x2c')](_0x124cbb);};}exports[_0xa543('0x2d')]=function(_0x45133a,_0x466f7d){var _0x3d87b9={},_0x4b804d={},_0x540f56={'count':0x0,'rows':[]};var _0x52851f=_[_0xa543('0x2e')](db[_0xa543('0x2f')][_0xa543('0x30')],function(_0x1b427f){return{'name':_0x1b427f[_0xa543('0x31')],'type':_0x1b427f[_0xa543('0x32')][_0xa543('0x33')]};});_0x4b804d['model']=_[_0xa543('0x2e')](_0x52851f,'name');_0x4b804d['query']=_[_0xa543('0x34')](_0x45133a[_0xa543('0x35')]);_0x4b804d['filters']=_[_0xa543('0x36')](_0x4b804d[_0xa543('0x37')],_0x4b804d[_0xa543('0x35')]);_0x3d87b9[_0xa543('0x38')]=_[_0xa543('0x36')](_0x4b804d['model'],qs[_0xa543('0x39')](_0x45133a[_0xa543('0x35')][_0xa543('0x39')]));_0x3d87b9['attributes']=_0x3d87b9['attributes']['length']?_0x3d87b9[_0xa543('0x38')]:_0x4b804d[_0xa543('0x37')];if(!_0x45133a['query']['hasOwnProperty']('nolimit')){_0x3d87b9[_0xa543('0x20')]=qs[_0xa543('0x20')](_0x45133a[_0xa543('0x35')][_0xa543('0x20')]);_0x3d87b9[_0xa543('0x1e')]=qs[_0xa543('0x1e')](_0x45133a[_0xa543('0x35')][_0xa543('0x1e')]);}_0x3d87b9['order']=qs[_0xa543('0x3a')](_0x45133a[_0xa543('0x35')][_0xa543('0x3a')]);_0x3d87b9['where']=qs[_0xa543('0x3b')](_['pick'](_0x45133a[_0xa543('0x35')],_0x4b804d['filters']),_0x52851f);if(_0x45133a[_0xa543('0x35')][_0xa543('0x3c')]){_0x3d87b9[_0xa543('0x3d')]=_[_0xa543('0x3e')](_0x3d87b9[_0xa543('0x3d')],{'$or':_[_0xa543('0x2e')](_0x52851f,function(_0x4fe079){if(_0x4fe079['type']!==_0xa543('0x3f')){var _0x4ac48f={};_0x4ac48f[_0x4fe079[_0xa543('0x2b')]]={'$like':'%'+_0x45133a[_0xa543('0x35')][_0xa543('0x3c')]+'%'};return _0x4ac48f;}})});}_0x3d87b9=_[_0xa543('0x3e')]({},_0x3d87b9,_0x45133a[_0xa543('0x40')]);var _0x1697e7={'where':_0x3d87b9[_0xa543('0x3d')]};return db[_0xa543('0x2f')][_0xa543('0x21')](_0x1697e7)[_0xa543('0x28')](function(_0x31a193){_0x540f56[_0xa543('0x21')]=_0x31a193;if(_0x45133a[_0xa543('0x35')]['includeAll']){_0x3d87b9[_0xa543('0x41')]=[{'all':!![]}];}return db[_0xa543('0x2f')][_0xa543('0x42')](_0x3d87b9);})[_0xa543('0x28')](function(_0x595012){_0x540f56[_0xa543('0x43')]=_0x595012;return _0x540f56;})[_0xa543('0x28')](respondWithFilteredResult(_0x466f7d,_0x3d87b9))['catch'](handleError(_0x466f7d,null));};exports[_0xa543('0x44')]=function(_0x17dfc3,_0x5d3250){var _0x4d1c90={'raw':!![],'where':{'id':_0x17dfc3[_0xa543('0x45')]['id']}},_0x35fd13={};_0x35fd13[_0xa543('0x37')]=_[_0xa543('0x34')](db['MailSubstatus'][_0xa543('0x30')]);_0x35fd13[_0xa543('0x35')]=_[_0xa543('0x34')](_0x17dfc3[_0xa543('0x35')]);_0x35fd13[_0xa543('0x3b')]=_[_0xa543('0x36')](_0x35fd13[_0xa543('0x37')],_0x35fd13['query']);_0x4d1c90[_0xa543('0x38')]=_[_0xa543('0x36')](_0x35fd13[_0xa543('0x37')],qs['fields'](_0x17dfc3[_0xa543('0x35')]['fields']));_0x4d1c90[_0xa543('0x38')]=_0x4d1c90[_0xa543('0x38')][_0xa543('0x46')]?_0x4d1c90[_0xa543('0x38')]:_0x35fd13['model'];if(_0x17dfc3[_0xa543('0x35')][_0xa543('0x47')]){_0x4d1c90['include']=[{'all':!![]}];}_0x4d1c90=_[_0xa543('0x3e')]({},_0x4d1c90,_0x17dfc3[_0xa543('0x40')]);return db[_0xa543('0x2f')]['find'](_0x4d1c90)[_0xa543('0x28')](handleEntityNotFound(_0x5d3250,null))[_0xa543('0x28')](respondWithResult(_0x5d3250,null))[_0xa543('0x48')](handleError(_0x5d3250,null));};exports[_0xa543('0x49')]=function(_0x3c5adc,_0xc8397a){return db[_0xa543('0x2f')][_0xa543('0x49')](_0x3c5adc['body'],{})[_0xa543('0x28')](respondWithResult(_0xc8397a,0xc9))[_0xa543('0x48')](handleError(_0xc8397a,null));};exports[_0xa543('0x26')]=function(_0x1ffd9e,_0x4f7558){if(_0x1ffd9e['body']['id']){delete _0x1ffd9e['body']['id'];}return db[_0xa543('0x2f')][_0xa543('0x4a')]({'where':{'id':_0x1ffd9e[_0xa543('0x45')]['id']}})['then'](handleEntityNotFound(_0x4f7558,null))['then'](saveUpdates(_0x1ffd9e[_0xa543('0x4b')],null))['then'](respondWithResult(_0x4f7558,null))['catch'](handleError(_0x4f7558,null));};exports[_0xa543('0x27')]=function(_0x355d3f,_0x11519a){return db[_0xa543('0x2f')][_0xa543('0x4a')]({'where':{'id':_0x355d3f[_0xa543('0x45')]['id']}})[_0xa543('0x28')](handleEntityNotFound(_0x11519a,null))[_0xa543('0x28')](removeEntity(_0x11519a,null))[_0xa543('0x48')](handleError(_0x11519a,null));};exports[_0xa543('0x4c')]=function(_0x54e683,_0x597017){return db[_0xa543('0x2f')][_0xa543('0x4c')]()['then'](respondWithResult(_0x597017,null))[_0xa543('0x48')](handleError(_0x597017,null));}; \ No newline at end of file +var _0x93c3=['bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','apply','save','update','then','destroy','error','stack','name','send','index','map','MailSubstatus','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','includeAll','include','catch','show','keys','options','find','create','body','params','describe','eml-format','rimraf','request-promise','moment'];(function(_0x2e84cd,_0x204f05){var _0x364c98=function(_0x92dea9){while(--_0x92dea9){_0x2e84cd['push'](_0x2e84cd['shift']());}};_0x364c98(++_0x204f05);}(_0x93c3,0x128));var _0x393c=function(_0x5c782c,_0x1e0458){_0x5c782c=_0x5c782c-0x0;var _0x3c0572=_0x93c3[_0x5c782c];return _0x3c0572;};'use strict';var emlformat=require(_0x393c('0x0'));var rimraf=require(_0x393c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x393c('0x2'));var moment=require(_0x393c('0x3'));var BPromise=require(_0x393c('0x4'));var Mustache=require(_0x393c('0x5'));var util=require(_0x393c('0x6'));var path=require('path');var sox=require(_0x393c('0x7'));var csv=require(_0x393c('0x8'));var ejs=require(_0x393c('0x9'));var fs=require('fs');var fs_extra=require(_0x393c('0xa'));var _=require(_0x393c('0xb'));var squel=require(_0x393c('0xc'));var crypto=require(_0x393c('0xd'));var jsforce=require(_0x393c('0xe'));var deskjs=require(_0x393c('0xf'));var toCsv=require(_0x393c('0x8'));var querystring=require(_0x393c('0x10'));var Papa=require(_0x393c('0x11'));var Redis=require(_0x393c('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x393c('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x393c('0x14'));var logger=require(_0x393c('0x15'))('api');var utils=require(_0x393c('0x16'));var config=require(_0x393c('0x17'));var licenseUtil=require(_0x393c('0x18'));var db=require(_0x393c('0x19'))['db'];function respondWithStatusCode(_0x4153df,_0x1c77f4){_0x1c77f4=_0x1c77f4||0xcc;return function(_0x383438){if(_0x383438){return _0x4153df[_0x393c('0x1a')](_0x1c77f4);}return _0x4153df[_0x393c('0x1b')](_0x1c77f4)[_0x393c('0x1c')]();};}function respondWithResult(_0x3cf885,_0x20461f){_0x20461f=_0x20461f||0xc8;return function(_0x4f5441){if(_0x4f5441){return _0x3cf885['status'](_0x20461f)['json'](_0x4f5441);}};}function respondWithFilteredResult(_0x548630,_0x16047d){return function(_0x6ff9d9){if(_0x6ff9d9){var _0x44833b=typeof _0x16047d[_0x393c('0x1d')]===_0x393c('0x1e')&&typeof _0x16047d[_0x393c('0x1f')]===_0x393c('0x1e');var _0x259fc6=_0x6ff9d9[_0x393c('0x20')];var _0x153de5=_0x44833b?0x0:_0x16047d[_0x393c('0x1d')];var _0x3139cb=_0x44833b?_0x6ff9d9[_0x393c('0x20')]:_0x16047d[_0x393c('0x1d')]+_0x16047d[_0x393c('0x1f')];var _0x4137f6;if(_0x3139cb>=_0x259fc6){_0x3139cb=_0x259fc6;_0x4137f6=0xc8;}else{_0x4137f6=0xce;}_0x548630['status'](_0x4137f6);return _0x548630[_0x393c('0x21')]('Content-Range',_0x153de5+'-'+_0x3139cb+'/'+_0x259fc6)['json'](_0x6ff9d9);}return null;};}function patchUpdates(_0x1c3799){return function(_0x35a731){try{jsonpatch[_0x393c('0x22')](_0x35a731,_0x1c3799,!![]);}catch(_0x1c1656){return BPromise['reject'](_0x1c1656);}return _0x35a731[_0x393c('0x23')]();};}function saveUpdates(_0x178775,_0x2fc135){return function(_0x3f37cc){if(_0x3f37cc){return _0x3f37cc[_0x393c('0x24')](_0x178775)[_0x393c('0x25')](function(_0x12ed4a){return _0x12ed4a;});}return null;};}function removeEntity(_0x3a1345,_0x24059f){return function(_0x55071b){if(_0x55071b){return _0x55071b[_0x393c('0x26')]()[_0x393c('0x25')](function(){_0x3a1345[_0x393c('0x1b')](0xcc)[_0x393c('0x1c')]();});}};}function handleEntityNotFound(_0x377255,_0x5684c1){return function(_0x1140ea){if(!_0x1140ea){_0x377255[_0x393c('0x1a')](0x194);}return _0x1140ea;};}function handleError(_0x4279f0,_0x1e9034){_0x1e9034=_0x1e9034||0x1f4;return function(_0x55ca16){logger[_0x393c('0x27')](_0x55ca16[_0x393c('0x28')]);if(_0x55ca16[_0x393c('0x29')]){delete _0x55ca16[_0x393c('0x29')];}_0x4279f0[_0x393c('0x1b')](_0x1e9034)[_0x393c('0x2a')](_0x55ca16);};}exports[_0x393c('0x2b')]=function(_0x227950,_0xa1a423){var _0x2af2bb={},_0x361d9c={},_0x1f852f={'count':0x0,'rows':[]};var _0x5cddd3=_[_0x393c('0x2c')](db[_0x393c('0x2d')][_0x393c('0x2e')],function(_0x487dbb){return{'name':_0x487dbb['fieldName'],'type':_0x487dbb['type'][_0x393c('0x2f')]};});_0x361d9c[_0x393c('0x30')]=_[_0x393c('0x2c')](_0x5cddd3,_0x393c('0x29'));_0x361d9c[_0x393c('0x31')]=_['keys'](_0x227950[_0x393c('0x31')]);_0x361d9c[_0x393c('0x32')]=_[_0x393c('0x33')](_0x361d9c[_0x393c('0x30')],_0x361d9c['query']);_0x2af2bb[_0x393c('0x34')]=_['intersection'](_0x361d9c['model'],qs[_0x393c('0x35')](_0x227950[_0x393c('0x31')][_0x393c('0x35')]));_0x2af2bb[_0x393c('0x34')]=_0x2af2bb[_0x393c('0x34')][_0x393c('0x36')]?_0x2af2bb[_0x393c('0x34')]:_0x361d9c['model'];if(!_0x227950[_0x393c('0x31')][_0x393c('0x37')](_0x393c('0x38'))){_0x2af2bb[_0x393c('0x1f')]=qs[_0x393c('0x1f')](_0x227950['query'][_0x393c('0x1f')]);_0x2af2bb['offset']=qs[_0x393c('0x1d')](_0x227950[_0x393c('0x31')]['offset']);}_0x2af2bb[_0x393c('0x39')]=qs['sort'](_0x227950['query'][_0x393c('0x3a')]);_0x2af2bb['where']=qs[_0x393c('0x32')](_[_0x393c('0x3b')](_0x227950[_0x393c('0x31')],_0x361d9c[_0x393c('0x32')]),_0x5cddd3);if(_0x227950[_0x393c('0x31')][_0x393c('0x3c')]){_0x2af2bb[_0x393c('0x3d')]=_[_0x393c('0x3e')](_0x2af2bb[_0x393c('0x3d')],{'$or':_['map'](_0x5cddd3,function(_0x453a2a){if(_0x453a2a[_0x393c('0x3f')]!=='VIRTUAL'){var _0x4e32a6={};_0x4e32a6[_0x453a2a[_0x393c('0x29')]]={'$like':'%'+_0x227950[_0x393c('0x31')]['filter']+'%'};return _0x4e32a6;}})});}_0x2af2bb=_[_0x393c('0x3e')]({},_0x2af2bb,_0x227950['options']);var _0x35ccb1={'where':_0x2af2bb[_0x393c('0x3d')]};return db[_0x393c('0x2d')][_0x393c('0x20')](_0x35ccb1)['then'](function(_0x51b916){_0x1f852f[_0x393c('0x20')]=_0x51b916;if(_0x227950[_0x393c('0x31')][_0x393c('0x40')]){_0x2af2bb[_0x393c('0x41')]=[{'all':!![]}];}return db[_0x393c('0x2d')]['findAll'](_0x2af2bb);})['then'](function(_0x53bddb){_0x1f852f['rows']=_0x53bddb;return _0x1f852f;})[_0x393c('0x25')](respondWithFilteredResult(_0xa1a423,_0x2af2bb))[_0x393c('0x42')](handleError(_0xa1a423,null));};exports[_0x393c('0x43')]=function(_0x3ef5ad,_0x5b521b){var _0x5413cd={'raw':!![],'where':{'id':_0x3ef5ad['params']['id']}},_0x4f7311={};_0x4f7311[_0x393c('0x30')]=_[_0x393c('0x44')](db[_0x393c('0x2d')]['rawAttributes']);_0x4f7311[_0x393c('0x31')]=_[_0x393c('0x44')](_0x3ef5ad[_0x393c('0x31')]);_0x4f7311['filters']=_[_0x393c('0x33')](_0x4f7311[_0x393c('0x30')],_0x4f7311[_0x393c('0x31')]);_0x5413cd[_0x393c('0x34')]=_[_0x393c('0x33')](_0x4f7311['model'],qs['fields'](_0x3ef5ad[_0x393c('0x31')][_0x393c('0x35')]));_0x5413cd['attributes']=_0x5413cd['attributes'][_0x393c('0x36')]?_0x5413cd[_0x393c('0x34')]:_0x4f7311[_0x393c('0x30')];if(_0x3ef5ad[_0x393c('0x31')][_0x393c('0x40')]){_0x5413cd['include']=[{'all':!![]}];}_0x5413cd=_[_0x393c('0x3e')]({},_0x5413cd,_0x3ef5ad[_0x393c('0x45')]);return db['MailSubstatus'][_0x393c('0x46')](_0x5413cd)['then'](handleEntityNotFound(_0x5b521b,null))[_0x393c('0x25')](respondWithResult(_0x5b521b,null))[_0x393c('0x42')](handleError(_0x5b521b,null));};exports['create']=function(_0x105500,_0x20a6ba){return db[_0x393c('0x2d')][_0x393c('0x47')](_0x105500[_0x393c('0x48')],{})[_0x393c('0x25')](respondWithResult(_0x20a6ba,0xc9))['catch'](handleError(_0x20a6ba,null));};exports[_0x393c('0x24')]=function(_0xa24807,_0x11067c){if(_0xa24807['body']['id']){delete _0xa24807[_0x393c('0x48')]['id'];}return db[_0x393c('0x2d')][_0x393c('0x46')]({'where':{'id':_0xa24807[_0x393c('0x49')]['id']}})[_0x393c('0x25')](handleEntityNotFound(_0x11067c,null))[_0x393c('0x25')](saveUpdates(_0xa24807[_0x393c('0x48')],null))[_0x393c('0x25')](respondWithResult(_0x11067c,null))[_0x393c('0x42')](handleError(_0x11067c,null));};exports[_0x393c('0x26')]=function(_0x13f13f,_0x360f98){return db[_0x393c('0x2d')]['find']({'where':{'id':_0x13f13f[_0x393c('0x49')]['id']}})[_0x393c('0x25')](handleEntityNotFound(_0x360f98,null))[_0x393c('0x25')](removeEntity(_0x360f98,null))[_0x393c('0x42')](handleError(_0x360f98,null));};exports[_0x393c('0x4a')]=function(_0x3c6fc2,_0x532dc2){return db[_0x393c('0x2d')]['describe']()[_0x393c('0x25')](respondWithResult(_0x532dc2,null))[_0x393c('0x42')](handleError(_0x532dc2,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index ae5711a..82538d5 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 _0xf835=['exports','mail_substatuses','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./mailSubstatus.attributes'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0xf835,0x9e));var _0x5f83=function(_0xbbaf95,_0x3d5891){_0xbbaf95=_0xbbaf95-0x0;var _0x25f229=_0xf835[_0xbbaf95];return _0x25f229;};'use strict';var _=require(_0x5f83('0x0'));var util=require(_0x5f83('0x1'));var logger=require(_0x5f83('0x2'))(_0x5f83('0x3'));var moment=require(_0x5f83('0x4'));var BPromise=require(_0x5f83('0x5'));var rp=require(_0x5f83('0x6'));var fs=require('fs');var path=require(_0x5f83('0x7'));var rimraf=require(_0x5f83('0x8'));var config=require('../../config/environment');var attributes=require(_0x5f83('0x9'));module[_0x5f83('0xa')]=function(_0x2a7670,_0x129e82){return _0x2a7670['define']('MailSubstatus',attributes,{'tableName':_0x5f83('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1502=['exports','define','mail_substatuses','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailSubstatus.attributes'];(function(_0x451216,_0x1017b0){var _0x33c012=function(_0x484e17){while(--_0x484e17){_0x451216['push'](_0x451216['shift']());}};_0x33c012(++_0x1017b0);}(_0x1502,0x1e3));var _0x2150=function(_0x88a599,_0x18a52a){_0x88a599=_0x88a599-0x0;var _0x38d16e=_0x1502[_0x88a599];return _0x38d16e;};'use strict';var _=require('lodash');var util=require(_0x2150('0x0'));var logger=require(_0x2150('0x1'))('api');var moment=require(_0x2150('0x2'));var BPromise=require(_0x2150('0x3'));var rp=require(_0x2150('0x4'));var fs=require('fs');var path=require(_0x2150('0x5'));var rimraf=require(_0x2150('0x6'));var config=require(_0x2150('0x7'));var attributes=require(_0x2150('0x8'));module[_0x2150('0x9')]=function(_0x2cf18f,_0x287001){return _0x2cf18f[_0x2150('0xa')]('MailSubstatus',attributes,{'tableName':_0x2150('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 27690d7..600bcca 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 _0x7735=['result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','MailSubstatus,\x20%s,\x20%s','request\x20sent','MailSubstatus,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x9ac447,_0x134874){var _0x4693ee=function(_0x14eb90){while(--_0x14eb90){_0x9ac447['push'](_0x9ac447['shift']());}};_0x4693ee(++_0x134874);}(_0x7735,0x70));var _0x5773=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x7735[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0x5773('0x0'));var util=require(_0x5773('0x1'));var moment=require(_0x5773('0x2'));var BPromise=require(_0x5773('0x3'));var rs=require(_0x5773('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5773('0x5'))['db'];var utils=require(_0x5773('0x6'));var logger=require(_0x5773('0x7'))(_0x5773('0x8'));var config=require(_0x5773('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5773('0xa')][_0x5773('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x548e7b,_0x52c0a5,_0x3ead87){return new BPromise(function(_0x30aa13,_0xa9caba){return client[_0x5773('0xc')](_0x548e7b,_0x3ead87)[_0x5773('0xd')](function(_0x39e0e1){logger['info'](_0x5773('0xe'),_0x52c0a5,_0x5773('0xf'));logger['debug'](_0x5773('0x10'),_0x52c0a5,_0x5773('0xf'),JSON['stringify'](_0x39e0e1));if(_0x39e0e1[_0x5773('0x11')]){if(_0x39e0e1['error'][_0x5773('0x12')]===0x1f4){logger['error'](_0x5773('0xe'),_0x52c0a5,_0x39e0e1[_0x5773('0x11')]['message']);return _0xa9caba(_0x39e0e1['error'][_0x5773('0x13')]);}logger[_0x5773('0x11')](_0x5773('0xe'),_0x52c0a5,_0x39e0e1[_0x5773('0x11')][_0x5773('0x13')]);return _0x30aa13(_0x39e0e1[_0x5773('0x11')][_0x5773('0x13')]);}else{logger['info']('MailSubstatus,\x20%s,\x20%s',_0x52c0a5,_0x5773('0xf'));_0x30aa13(_0x39e0e1[_0x5773('0x14')]['message']);}})[_0x5773('0x15')](function(_0x5bd249){logger[_0x5773('0x11')](_0x5773('0xe'),_0x52c0a5,_0x5bd249);_0xa9caba(_0x5bd249);});});} \ No newline at end of file +var _0x836f=['request','then','info','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','MailSubstatus,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0x836f,0x165));var _0xf836=function(_0x29ab6d,_0x5f5ab6){_0x29ab6d=_0x29ab6d-0x0;var _0x1e7398=_0x836f[_0x29ab6d];return _0x1e7398;};'use strict';var _=require(_0xf836('0x0'));var util=require('util');var moment=require(_0xf836('0x1'));var BPromise=require(_0xf836('0x2'));var rs=require(_0xf836('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf836('0x4'))['db'];var utils=require(_0xf836('0x5'));var logger=require(_0xf836('0x6'))(_0xf836('0x7'));var config=require(_0xf836('0x8'));var jayson=require(_0xf836('0x9'));var client=jayson[_0xf836('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x91b441,_0x37c563,_0x2e4cb9){return new BPromise(function(_0x4a0c6c,_0x38747e){return client[_0xf836('0xb')](_0x91b441,_0x2e4cb9)[_0xf836('0xc')](function(_0x36c0d0){logger[_0xf836('0xd')]('MailSubstatus,\x20%s,\x20%s',_0x37c563,_0xf836('0xe'));logger[_0xf836('0xf')](_0xf836('0x10'),_0x37c563,_0xf836('0xe'),JSON[_0xf836('0x11')](_0x36c0d0));if(_0x36c0d0['error']){if(_0x36c0d0[_0xf836('0x12')]['code']===0x1f4){logger[_0xf836('0x12')](_0xf836('0x13'),_0x37c563,_0x36c0d0[_0xf836('0x12')][_0xf836('0x14')]);return _0x38747e(_0x36c0d0[_0xf836('0x12')][_0xf836('0x14')]);}logger[_0xf836('0x12')](_0xf836('0x13'),_0x37c563,_0x36c0d0[_0xf836('0x12')][_0xf836('0x14')]);return _0x4a0c6c(_0x36c0d0['error'][_0xf836('0x14')]);}else{logger[_0xf836('0xd')](_0xf836('0x13'),_0x37c563,_0xf836('0xe'));_0x4a0c6c(_0x36c0d0[_0xf836('0x15')][_0xf836('0x14')]);}})[_0xf836('0x16')](function(_0x35b04e){logger[_0xf836('0x12')](_0xf836('0x13'),_0x37c563,_0x35b04e);_0x38747e(_0x35b04e);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index b81c79a..9e21f93 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 _0x48a3=['index','/describe','describe','/:id','show','post','create','put','update','delete','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated'];(function(_0x16d991,_0x3f07cc){var _0x4f41c3=function(_0x18d679){while(--_0x18d679){_0x16d991['push'](_0x16d991['shift']());}};_0x4f41c3(++_0x3f07cc);}(_0x48a3,0x82));var _0x348a=function(_0x3df45b,_0xe6e277){_0x3df45b=_0x3df45b-0x0;var _0x24f10b=_0x48a3[_0x3df45b];return _0x24f10b;};'use strict';var multer=require('multer');var util=require(_0x348a('0x0'));var path=require(_0x348a('0x1'));var timeout=require(_0x348a('0x2'));var express=require(_0x348a('0x3'));var router=express['Router']();var fs_extra=require(_0x348a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x348a('0x5'));var config=require(_0x348a('0x6'));var controller=require(_0x348a('0x7'));router[_0x348a('0x8')]('/',auth[_0x348a('0x9')](),controller[_0x348a('0xa')]);router[_0x348a('0x8')](_0x348a('0xb'),auth[_0x348a('0x9')](),controller[_0x348a('0xc')]);router[_0x348a('0x8')](_0x348a('0xd'),auth[_0x348a('0x9')](),controller[_0x348a('0xe')]);router[_0x348a('0xf')]('/',auth[_0x348a('0x9')](),controller[_0x348a('0x10')]);router[_0x348a('0x11')]('/:id',auth[_0x348a('0x9')](),controller[_0x348a('0x12')]);router[_0x348a('0x13')](_0x348a('0xd'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xd059=['index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xd059,0xe7));var _0x9d05=function(_0x30719b,_0x5c8288){_0x30719b=_0x30719b-0x0;var _0x1ef054=_0xd059[_0x30719b];return _0x1ef054;};'use strict';var multer=require(_0x9d05('0x0'));var util=require(_0x9d05('0x1'));var path=require(_0x9d05('0x2'));var timeout=require(_0x9d05('0x3'));var express=require(_0x9d05('0x4'));var router=express[_0x9d05('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9d05('0x6'));var interaction=require(_0x9d05('0x7'));var config=require(_0x9d05('0x8'));var controller=require(_0x9d05('0x9'));router[_0x9d05('0xa')]('/',auth['isAuthenticated'](),controller[_0x9d05('0xb')]);router[_0x9d05('0xa')](_0x9d05('0xc'),auth[_0x9d05('0xd')](),controller[_0x9d05('0xe')]);router[_0x9d05('0xa')](_0x9d05('0xf'),auth[_0x9d05('0xd')](),controller[_0x9d05('0x10')]);router[_0x9d05('0x11')]('/',auth[_0x9d05('0xd')](),controller[_0x9d05('0x12')]);router[_0x9d05('0x13')]('/:id',auth[_0x9d05('0xd')](),controller[_0x9d05('0x14')]);router['delete'](_0x9d05('0xf'),auth[_0x9d05('0xd')](),controller[_0x9d05('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 328ac28..922f427 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 _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x586fa2,_0x1a45bc){var _0x515be9=function(_0x4e90d5){while(--_0x4e90d5){_0x586fa2['push'](_0x586fa2['shift']());}};_0x515be9(++_0x1a45bc);}(_0x008c,0x188));var _0xc008=function(_0x343d36,_0x5f248a){_0x343d36=_0x343d36-0x0;var _0x3bd305=_0x008c[_0x343d36];return _0x3bd305;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}}; \ No newline at end of file +var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x3626ff,_0x586a37){var _0x3f92e2=function(_0x5d39c7){while(--_0x5d39c7){_0x3626ff['push'](_0x3626ff['shift']());}};_0x3f92e2(++_0x586a37);}(_0x70e0,0x17b));var _0x070e=function(_0xb2d120,_0x44e245){_0xb2d120=_0xb2d120-0x0;var _0x524e57=_0x70e0[_0xb2d120];return _0x524e57;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 974e621..9fd8f63 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 _0xb4a6=['type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','filter','where','merge','options','includeAll','findAll','rows','catch','show','include','find','create','body','describe','eml-format','zip-dir','request-promise','moment','util','sox','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','undefined','count','offset','limit','set','Content-Range','save','update','destroy','then','sendStatus','error','name','send','index','map','MailTransferReport','rawAttributes','fieldName'];(function(_0x20511d,_0x6618e5){var _0x38efa0=function(_0x4e184a){while(--_0x4e184a){_0x20511d['push'](_0x20511d['shift']());}};_0x38efa0(++_0x6618e5);}(_0xb4a6,0x1b2));var _0x6b4a=function(_0xfbb2c4,_0x26b45a){_0xfbb2c4=_0xfbb2c4-0x0;var _0x440158=_0xb4a6[_0xfbb2c4];return _0x440158;};'use strict';var emlformat=require(_0x6b4a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6b4a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6b4a('0x2'));var moment=require(_0x6b4a('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6b4a('0x4'));var path=require('path');var sox=require(_0x6b4a('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6b4a('0x6'));var _=require(_0x6b4a('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6b4a('0x8'));var deskjs=require(_0x6b4a('0x9'));var toCsv=require('to-csv');var querystring=require(_0x6b4a('0xa'));var Papa=require(_0x6b4a('0xb'));var Redis=require(_0x6b4a('0xc'));var authService=require(_0x6b4a('0xd'));var qs=require(_0x6b4a('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6b4a('0xf'))(_0x6b4a('0x10'));var utils=require(_0x6b4a('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x6b4a('0x12'));var db=require(_0x6b4a('0x13'))['db'];function respondWithStatusCode(_0x34d43b,_0x177008){_0x177008=_0x177008||0xcc;return function(_0x5dd291){if(_0x5dd291){return _0x34d43b['sendStatus'](_0x177008);}return _0x34d43b['status'](_0x177008)[_0x6b4a('0x14')]();};}function respondWithResult(_0x5e721f,_0x136e86){_0x136e86=_0x136e86||0xc8;return function(_0x40fe48){if(_0x40fe48){return _0x5e721f[_0x6b4a('0x15')](_0x136e86)[_0x6b4a('0x16')](_0x40fe48);}};}function respondWithFilteredResult(_0x9c9fbd,_0x4f9fd9){return function(_0x2d601e){if(_0x2d601e){var _0x47d83e=typeof _0x4f9fd9['offset']===_0x6b4a('0x17')&&typeof _0x4f9fd9['limit']===_0x6b4a('0x17');var _0x2beccc=_0x2d601e[_0x6b4a('0x18')];var _0x144db4=_0x47d83e?0x0:_0x4f9fd9[_0x6b4a('0x19')];var _0x3dc09e=_0x47d83e?_0x2d601e[_0x6b4a('0x18')]:_0x4f9fd9['offset']+_0x4f9fd9[_0x6b4a('0x1a')];var _0x10af56;if(_0x3dc09e>=_0x2beccc){_0x3dc09e=_0x2beccc;_0x10af56=0xc8;}else{_0x10af56=0xce;}_0x9c9fbd[_0x6b4a('0x15')](_0x10af56);return _0x9c9fbd[_0x6b4a('0x1b')](_0x6b4a('0x1c'),_0x144db4+'-'+_0x3dc09e+'/'+_0x2beccc)[_0x6b4a('0x16')](_0x2d601e);}return null;};}function patchUpdates(_0x7a16de){return function(_0x55f38e){try{jsonpatch['apply'](_0x55f38e,_0x7a16de,!![]);}catch(_0x29f25c){return BPromise['reject'](_0x29f25c);}return _0x55f38e[_0x6b4a('0x1d')]();};}function saveUpdates(_0x2da938,_0x17f8f3){return function(_0x8db2a7){if(_0x8db2a7){return _0x8db2a7[_0x6b4a('0x1e')](_0x2da938)['then'](function(_0x36d0a5){return _0x36d0a5;});}return null;};}function removeEntity(_0xb4ae0,_0x1cc885){return function(_0x77fc5b){if(_0x77fc5b){return _0x77fc5b[_0x6b4a('0x1f')]()[_0x6b4a('0x20')](function(){_0xb4ae0[_0x6b4a('0x15')](0xcc)[_0x6b4a('0x14')]();});}};}function handleEntityNotFound(_0x2a8e79,_0x19f068){return function(_0x49d988){if(!_0x49d988){_0x2a8e79[_0x6b4a('0x21')](0x194);}return _0x49d988;};}function handleError(_0xf98427,_0x23e9c6){_0x23e9c6=_0x23e9c6||0x1f4;return function(_0x4e5bf6){logger[_0x6b4a('0x22')](_0x4e5bf6['stack']);if(_0x4e5bf6[_0x6b4a('0x23')]){delete _0x4e5bf6[_0x6b4a('0x23')];}_0xf98427[_0x6b4a('0x15')](_0x23e9c6)[_0x6b4a('0x24')](_0x4e5bf6);};}exports[_0x6b4a('0x25')]=function(_0x3047cc,_0x4f0bc4){var _0x23b154={},_0x4cdee3={},_0x1c7400={'count':0x0,'rows':[]};var _0x209dc6=_[_0x6b4a('0x26')](db[_0x6b4a('0x27')][_0x6b4a('0x28')],function(_0x76853a){return{'name':_0x76853a[_0x6b4a('0x29')],'type':_0x76853a[_0x6b4a('0x2a')][_0x6b4a('0x2b')]};});_0x4cdee3[_0x6b4a('0x2c')]=_[_0x6b4a('0x26')](_0x209dc6,'name');_0x4cdee3['query']=_[_0x6b4a('0x2d')](_0x3047cc[_0x6b4a('0x2e')]);_0x4cdee3[_0x6b4a('0x2f')]=_[_0x6b4a('0x30')](_0x4cdee3[_0x6b4a('0x2c')],_0x4cdee3['query']);_0x23b154[_0x6b4a('0x31')]=_[_0x6b4a('0x30')](_0x4cdee3['model'],qs['fields'](_0x3047cc[_0x6b4a('0x2e')][_0x6b4a('0x32')]));_0x23b154[_0x6b4a('0x31')]=_0x23b154[_0x6b4a('0x31')][_0x6b4a('0x33')]?_0x23b154[_0x6b4a('0x31')]:_0x4cdee3['model'];if(!_0x3047cc[_0x6b4a('0x2e')]['hasOwnProperty'](_0x6b4a('0x34'))){_0x23b154[_0x6b4a('0x1a')]=qs['limit'](_0x3047cc[_0x6b4a('0x2e')][_0x6b4a('0x1a')]);_0x23b154[_0x6b4a('0x19')]=qs[_0x6b4a('0x19')](_0x3047cc[_0x6b4a('0x2e')][_0x6b4a('0x19')]);}_0x23b154[_0x6b4a('0x35')]=qs['sort'](_0x3047cc[_0x6b4a('0x2e')]['sort']);_0x23b154['where']=qs[_0x6b4a('0x2f')](_['pick'](_0x3047cc[_0x6b4a('0x2e')],_0x4cdee3[_0x6b4a('0x2f')]),_0x209dc6);if(_0x3047cc[_0x6b4a('0x2e')][_0x6b4a('0x36')]){_0x23b154[_0x6b4a('0x37')]=_[_0x6b4a('0x38')](_0x23b154[_0x6b4a('0x37')],{'$or':_[_0x6b4a('0x26')](_0x209dc6,function(_0x36f275){if(_0x36f275[_0x6b4a('0x2a')]!=='VIRTUAL'){var _0x51e2c1={};_0x51e2c1[_0x36f275[_0x6b4a('0x23')]]={'$like':'%'+_0x3047cc[_0x6b4a('0x2e')]['filter']+'%'};return _0x51e2c1;}})});}_0x23b154=_[_0x6b4a('0x38')]({},_0x23b154,_0x3047cc[_0x6b4a('0x39')]);var _0x2ef738={'where':_0x23b154[_0x6b4a('0x37')]};return db['MailTransferReport'][_0x6b4a('0x18')](_0x2ef738)[_0x6b4a('0x20')](function(_0x135a96){_0x1c7400['count']=_0x135a96;if(_0x3047cc['query'][_0x6b4a('0x3a')]){_0x23b154['include']=[{'all':!![]}];}return db[_0x6b4a('0x27')][_0x6b4a('0x3b')](_0x23b154);})[_0x6b4a('0x20')](function(_0x2e5075){_0x1c7400[_0x6b4a('0x3c')]=_0x2e5075;return _0x1c7400;})[_0x6b4a('0x20')](respondWithFilteredResult(_0x4f0bc4,_0x23b154))[_0x6b4a('0x3d')](handleError(_0x4f0bc4,null));};exports[_0x6b4a('0x3e')]=function(_0x5a2550,_0x1f4552){var _0x35d8cc={'raw':!![],'where':{'id':_0x5a2550['params']['id']}},_0x655f7f={};_0x655f7f['model']=_['keys'](db['MailTransferReport'][_0x6b4a('0x28')]);_0x655f7f[_0x6b4a('0x2e')]=_['keys'](_0x5a2550[_0x6b4a('0x2e')]);_0x655f7f[_0x6b4a('0x2f')]=_[_0x6b4a('0x30')](_0x655f7f[_0x6b4a('0x2c')],_0x655f7f['query']);_0x35d8cc[_0x6b4a('0x31')]=_[_0x6b4a('0x30')](_0x655f7f[_0x6b4a('0x2c')],qs[_0x6b4a('0x32')](_0x5a2550[_0x6b4a('0x2e')][_0x6b4a('0x32')]));_0x35d8cc['attributes']=_0x35d8cc[_0x6b4a('0x31')]['length']?_0x35d8cc[_0x6b4a('0x31')]:_0x655f7f[_0x6b4a('0x2c')];if(_0x5a2550[_0x6b4a('0x2e')]['includeAll']){_0x35d8cc[_0x6b4a('0x3f')]=[{'all':!![]}];}_0x35d8cc=_[_0x6b4a('0x38')]({},_0x35d8cc,_0x5a2550['options']);return db['MailTransferReport'][_0x6b4a('0x40')](_0x35d8cc)[_0x6b4a('0x20')](handleEntityNotFound(_0x1f4552,null))[_0x6b4a('0x20')](respondWithResult(_0x1f4552,null))[_0x6b4a('0x3d')](handleError(_0x1f4552,null));};exports['create']=function(_0xe9b123,_0x5ea5b7){return db['MailTransferReport'][_0x6b4a('0x41')](_0xe9b123[_0x6b4a('0x42')],{})[_0x6b4a('0x20')](respondWithResult(_0x5ea5b7,0xc9))[_0x6b4a('0x3d')](handleError(_0x5ea5b7,null));};exports['update']=function(_0x1b426d,_0x5033ed){if(_0x1b426d[_0x6b4a('0x42')]['id']){delete _0x1b426d['body']['id'];}return db[_0x6b4a('0x27')]['find']({'where':{'id':_0x1b426d['params']['id']}})[_0x6b4a('0x20')](handleEntityNotFound(_0x5033ed,null))[_0x6b4a('0x20')](saveUpdates(_0x1b426d[_0x6b4a('0x42')],null))[_0x6b4a('0x20')](respondWithResult(_0x5033ed,null))[_0x6b4a('0x3d')](handleError(_0x5033ed,null));};exports[_0x6b4a('0x1f')]=function(_0x372e45,_0x18e431){return db['MailTransferReport'][_0x6b4a('0x40')]({'where':{'id':_0x372e45['params']['id']}})[_0x6b4a('0x20')](handleEntityNotFound(_0x18e431,null))[_0x6b4a('0x20')](removeEntity(_0x18e431,null))[_0x6b4a('0x3d')](handleError(_0x18e431,null));};exports[_0x6b4a('0x43')]=function(_0xdda308,_0x4f5f2e){return db[_0x6b4a('0x27')][_0x6b4a('0x43')]()[_0x6b4a('0x20')](respondWithResult(_0x4f5f2e,null))['catch'](handleError(_0x4f5f2e,null));}; \ No newline at end of file +var _0xe390=['reject','save','then','sendStatus','name','index','map','MailTransferReport','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','rows','catch','show','keys','includeAll','create','body','params','destroy','find','describe','rimraf','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','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range'];(function(_0xf2acc0,_0x33a85a){var _0x383a9f=function(_0x1651dd){while(--_0x1651dd){_0xf2acc0['push'](_0xf2acc0['shift']());}};_0x383a9f(++_0x33a85a);}(_0xe390,0x1db));var _0x0e39=function(_0x2d0c4e,_0x53a783){_0x2d0c4e=_0x2d0c4e-0x0;var _0x4d61fd=_0xe390[_0x2d0c4e];return _0x4d61fd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0e39('0x0'));var zipdir=require(_0x0e39('0x1'));var jsonpatch=require(_0x0e39('0x2'));var rp=require(_0x0e39('0x3'));var moment=require(_0x0e39('0x4'));var BPromise=require(_0x0e39('0x5'));var Mustache=require(_0x0e39('0x6'));var util=require(_0x0e39('0x7'));var path=require(_0x0e39('0x8'));var sox=require(_0x0e39('0x9'));var csv=require(_0x0e39('0xa'));var ejs=require(_0x0e39('0xb'));var fs=require('fs');var fs_extra=require(_0x0e39('0xc'));var _=require(_0x0e39('0xd'));var squel=require(_0x0e39('0xe'));var crypto=require(_0x0e39('0xf'));var jsforce=require(_0x0e39('0x10'));var deskjs=require(_0x0e39('0x11'));var toCsv=require('to-csv');var querystring=require(_0x0e39('0x12'));var Papa=require(_0x0e39('0x13'));var Redis=require('ioredis');var authService=require(_0x0e39('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x0e39('0x15'));var hardwareService=require(_0x0e39('0x16'));var logger=require(_0x0e39('0x17'))(_0x0e39('0x18'));var utils=require('../../config/utils');var config=require(_0x0e39('0x19'));var licenseUtil=require(_0x0e39('0x1a'));var db=require(_0x0e39('0x1b'))['db'];function respondWithStatusCode(_0x5eeb3f,_0x1d6db1){_0x1d6db1=_0x1d6db1||0xcc;return function(_0x332f48){if(_0x332f48){return _0x5eeb3f['sendStatus'](_0x1d6db1);}return _0x5eeb3f[_0x0e39('0x1c')](_0x1d6db1)[_0x0e39('0x1d')]();};}function respondWithResult(_0x12855f,_0x49cabc){_0x49cabc=_0x49cabc||0xc8;return function(_0x3e2a05){if(_0x3e2a05){return _0x12855f[_0x0e39('0x1c')](_0x49cabc)['json'](_0x3e2a05);}};}function respondWithFilteredResult(_0x3abe2c,_0x344936){return function(_0x41f3f9){if(_0x41f3f9){var _0x374032=typeof _0x344936[_0x0e39('0x1e')]===_0x0e39('0x1f')&&typeof _0x344936[_0x0e39('0x20')]===_0x0e39('0x1f');var _0x50be4a=_0x41f3f9[_0x0e39('0x21')];var _0x153d77=_0x374032?0x0:_0x344936['offset'];var _0x484b7f=_0x374032?_0x41f3f9[_0x0e39('0x21')]:_0x344936[_0x0e39('0x1e')]+_0x344936['limit'];var _0x57c2c5;if(_0x484b7f>=_0x50be4a){_0x484b7f=_0x50be4a;_0x57c2c5=0xc8;}else{_0x57c2c5=0xce;}_0x3abe2c[_0x0e39('0x1c')](_0x57c2c5);return _0x3abe2c[_0x0e39('0x22')](_0x0e39('0x23'),_0x153d77+'-'+_0x484b7f+'/'+_0x50be4a)['json'](_0x41f3f9);}return null;};}function patchUpdates(_0x1fe532){return function(_0xc82932){try{jsonpatch['apply'](_0xc82932,_0x1fe532,!![]);}catch(_0x311ef1){return BPromise[_0x0e39('0x24')](_0x311ef1);}return _0xc82932[_0x0e39('0x25')]();};}function saveUpdates(_0x259637,_0x2f4d5f){return function(_0x2830a0){if(_0x2830a0){return _0x2830a0['update'](_0x259637)[_0x0e39('0x26')](function(_0x2c630b){return _0x2c630b;});}return null;};}function removeEntity(_0x4210de,_0x4273c2){return function(_0x4a08b9){if(_0x4a08b9){return _0x4a08b9['destroy']()[_0x0e39('0x26')](function(){_0x4210de[_0x0e39('0x1c')](0xcc)[_0x0e39('0x1d')]();});}};}function handleEntityNotFound(_0x2d1242,_0x4eb712){return function(_0x140540){if(!_0x140540){_0x2d1242[_0x0e39('0x27')](0x194);}return _0x140540;};}function handleError(_0x524289,_0x82acb9){_0x82acb9=_0x82acb9||0x1f4;return function(_0x470b62){logger['error'](_0x470b62['stack']);if(_0x470b62[_0x0e39('0x28')]){delete _0x470b62[_0x0e39('0x28')];}_0x524289[_0x0e39('0x1c')](_0x82acb9)['send'](_0x470b62);};}exports[_0x0e39('0x29')]=function(_0x4231e3,_0x49a735){var _0x3477cd={},_0x21f35c={},_0x1c975c={'count':0x0,'rows':[]};var _0x2796bc=_[_0x0e39('0x2a')](db[_0x0e39('0x2b')][_0x0e39('0x2c')],function(_0x1294dc){return{'name':_0x1294dc['fieldName'],'type':_0x1294dc['type'][_0x0e39('0x2d')]};});_0x21f35c[_0x0e39('0x2e')]=_['map'](_0x2796bc,'name');_0x21f35c[_0x0e39('0x2f')]=_['keys'](_0x4231e3[_0x0e39('0x2f')]);_0x21f35c[_0x0e39('0x30')]=_[_0x0e39('0x31')](_0x21f35c[_0x0e39('0x2e')],_0x21f35c['query']);_0x3477cd[_0x0e39('0x32')]=_[_0x0e39('0x31')](_0x21f35c[_0x0e39('0x2e')],qs[_0x0e39('0x33')](_0x4231e3[_0x0e39('0x2f')][_0x0e39('0x33')]));_0x3477cd[_0x0e39('0x32')]=_0x3477cd[_0x0e39('0x32')][_0x0e39('0x34')]?_0x3477cd[_0x0e39('0x32')]:_0x21f35c[_0x0e39('0x2e')];if(!_0x4231e3[_0x0e39('0x2f')]['hasOwnProperty'](_0x0e39('0x35'))){_0x3477cd[_0x0e39('0x20')]=qs[_0x0e39('0x20')](_0x4231e3['query'][_0x0e39('0x20')]);_0x3477cd[_0x0e39('0x1e')]=qs[_0x0e39('0x1e')](_0x4231e3['query'][_0x0e39('0x1e')]);}_0x3477cd[_0x0e39('0x36')]=qs[_0x0e39('0x37')](_0x4231e3[_0x0e39('0x2f')]['sort']);_0x3477cd[_0x0e39('0x38')]=qs['filters'](_[_0x0e39('0x39')](_0x4231e3[_0x0e39('0x2f')],_0x21f35c[_0x0e39('0x30')]),_0x2796bc);if(_0x4231e3['query'][_0x0e39('0x3a')]){_0x3477cd[_0x0e39('0x38')]=_[_0x0e39('0x3b')](_0x3477cd[_0x0e39('0x38')],{'$or':_[_0x0e39('0x2a')](_0x2796bc,function(_0x2c927d){if(_0x2c927d[_0x0e39('0x3c')]!==_0x0e39('0x3d')){var _0x141a0b={};_0x141a0b[_0x2c927d['name']]={'$like':'%'+_0x4231e3[_0x0e39('0x2f')]['filter']+'%'};return _0x141a0b;}})});}_0x3477cd=_[_0x0e39('0x3b')]({},_0x3477cd,_0x4231e3['options']);var _0x4381f0={'where':_0x3477cd[_0x0e39('0x38')]};return db[_0x0e39('0x2b')][_0x0e39('0x21')](_0x4381f0)[_0x0e39('0x26')](function(_0x29c45b){_0x1c975c['count']=_0x29c45b;if(_0x4231e3['query']['includeAll']){_0x3477cd['include']=[{'all':!![]}];}return db[_0x0e39('0x2b')]['findAll'](_0x3477cd);})[_0x0e39('0x26')](function(_0x1daa76){_0x1c975c[_0x0e39('0x3e')]=_0x1daa76;return _0x1c975c;})[_0x0e39('0x26')](respondWithFilteredResult(_0x49a735,_0x3477cd))[_0x0e39('0x3f')](handleError(_0x49a735,null));};exports[_0x0e39('0x40')]=function(_0x269ddb,_0x52159f){var _0x3755f3={'raw':!![],'where':{'id':_0x269ddb['params']['id']}},_0x1fa12d={};_0x1fa12d[_0x0e39('0x2e')]=_[_0x0e39('0x41')](db[_0x0e39('0x2b')]['rawAttributes']);_0x1fa12d[_0x0e39('0x2f')]=_[_0x0e39('0x41')](_0x269ddb[_0x0e39('0x2f')]);_0x1fa12d[_0x0e39('0x30')]=_[_0x0e39('0x31')](_0x1fa12d['model'],_0x1fa12d[_0x0e39('0x2f')]);_0x3755f3[_0x0e39('0x32')]=_[_0x0e39('0x31')](_0x1fa12d['model'],qs[_0x0e39('0x33')](_0x269ddb[_0x0e39('0x2f')][_0x0e39('0x33')]));_0x3755f3['attributes']=_0x3755f3[_0x0e39('0x32')][_0x0e39('0x34')]?_0x3755f3[_0x0e39('0x32')]:_0x1fa12d['model'];if(_0x269ddb[_0x0e39('0x2f')][_0x0e39('0x42')]){_0x3755f3['include']=[{'all':!![]}];}_0x3755f3=_[_0x0e39('0x3b')]({},_0x3755f3,_0x269ddb['options']);return db[_0x0e39('0x2b')]['find'](_0x3755f3)['then'](handleEntityNotFound(_0x52159f,null))[_0x0e39('0x26')](respondWithResult(_0x52159f,null))[_0x0e39('0x3f')](handleError(_0x52159f,null));};exports[_0x0e39('0x43')]=function(_0x187719,_0x3ec3d2){return db[_0x0e39('0x2b')][_0x0e39('0x43')](_0x187719[_0x0e39('0x44')],{})[_0x0e39('0x26')](respondWithResult(_0x3ec3d2,0xc9))['catch'](handleError(_0x3ec3d2,null));};exports['update']=function(_0x348313,_0x417ac5){if(_0x348313[_0x0e39('0x44')]['id']){delete _0x348313[_0x0e39('0x44')]['id'];}return db['MailTransferReport']['find']({'where':{'id':_0x348313[_0x0e39('0x45')]['id']}})[_0x0e39('0x26')](handleEntityNotFound(_0x417ac5,null))[_0x0e39('0x26')](saveUpdates(_0x348313[_0x0e39('0x44')],null))[_0x0e39('0x26')](respondWithResult(_0x417ac5,null))['catch'](handleError(_0x417ac5,null));};exports[_0x0e39('0x46')]=function(_0x1ceb35,_0x2a717a){return db[_0x0e39('0x2b')][_0x0e39('0x47')]({'where':{'id':_0x1ceb35[_0x0e39('0x45')]['id']}})['then'](handleEntityNotFound(_0x2a717a,null))[_0x0e39('0x26')](removeEntity(_0x2a717a,null))['catch'](handleError(_0x2a717a,null));};exports['describe']=function(_0x138c5c,_0x5c9abd){return db[_0x0e39('0x2b')][_0x0e39('0x48')]()['then'](respondWithResult(_0x5c9abd,null))[_0x0e39('0x3f')](handleError(_0x5c9abd,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index cebe5f5..1af92ca 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 _0x6453=['uniqueid','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer'];(function(_0x148503,_0x587053){var _0x55dc91=function(_0x54b127){while(--_0x54b127){_0x148503['push'](_0x148503['shift']());}};_0x55dc91(++_0x587053);}(_0x6453,0x88));var _0x3645=function(_0x5b5cde,_0x1f7c5f){_0x5b5cde=_0x5b5cde-0x0;var _0x364ad2=_0x6453[_0x5b5cde];return _0x364ad2;};'use strict';var _=require(_0x3645('0x0'));var util=require(_0x3645('0x1'));var logger=require('../../config/logger')(_0x3645('0x2'));var moment=require(_0x3645('0x3'));var BPromise=require(_0x3645('0x4'));var rp=require(_0x3645('0x5'));var fs=require('fs');var path=require(_0x3645('0x6'));var rimraf=require(_0x3645('0x7'));var config=require(_0x3645('0x8'));var attributes=require(_0x3645('0x9'));module[_0x3645('0xa')]=function(_0x19b19c,_0xe951){return _0x19b19c[_0x3645('0xb')](_0x3645('0xc'),attributes,{'tableName':_0x3645('0xd'),'paranoid':![],'indexes':[{'name':_0x3645('0xe'),'fields':[_0x3645('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe539=['exports','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./mailTransferReport.attributes'];(function(_0x12c663,_0x11e97b){var _0x24c6ed=function(_0x44bccf){while(--_0x44bccf){_0x12c663['push'](_0x12c663['shift']());}};_0x24c6ed(++_0x11e97b);}(_0xe539,0x164));var _0x9e53=function(_0x2fdf82,_0x322e7c){_0x2fdf82=_0x2fdf82-0x0;var _0x2382f5=_0xe539[_0x2fdf82];return _0x2382f5;};'use strict';var _=require(_0x9e53('0x0'));var util=require('util');var logger=require(_0x9e53('0x1'))(_0x9e53('0x2'));var moment=require(_0x9e53('0x3'));var BPromise=require(_0x9e53('0x4'));var rp=require(_0x9e53('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9e53('0x6'));var attributes=require(_0x9e53('0x7'));module[_0x9e53('0x8')]=function(_0x3581d4,_0x1ca1e2){return _0x3581d4[_0x9e53('0x9')](_0x9e53('0xa'),attributes,{'tableName':_0x9e53('0xb'),'paranoid':![],'indexes':[{'name':_0x9e53('0xc'),'fields':[_0x9e53('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 21bd671..a339dee 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 _0x73fa=['request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http'];(function(_0x561247,_0x1640e8){var _0xbfc8c3=function(_0x17e1dd){while(--_0x17e1dd){_0x561247['push'](_0x561247['shift']());}};_0xbfc8c3(++_0x1640e8);}(_0x73fa,0xfc));var _0xa73f=function(_0x3eb1c1,_0x1bb418){_0x3eb1c1=_0x3eb1c1-0x0;var _0x53645a=_0x73fa[_0x3eb1c1];return _0x53645a;};'use strict';var _=require(_0xa73f('0x0'));var util=require(_0xa73f('0x1'));var moment=require(_0xa73f('0x2'));var BPromise=require(_0xa73f('0x3'));var rs=require(_0xa73f('0x4'));var fs=require('fs');var Redis=require(_0xa73f('0x5'));var db=require(_0xa73f('0x6'))['db'];var utils=require(_0xa73f('0x7'));var logger=require(_0xa73f('0x8'))('rpc');var config=require(_0xa73f('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa73f('0xa')][_0xa73f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x259730,_0x2830db,_0x42b3ee){return new BPromise(function(_0x3215ba,_0x596635){return client[_0xa73f('0xc')](_0x259730,_0x42b3ee)[_0xa73f('0xd')](function(_0x1c98ba){logger[_0xa73f('0xe')](_0xa73f('0xf'),_0x2830db,_0xa73f('0x10'));logger[_0xa73f('0x11')](_0xa73f('0x12'),_0x2830db,'request\x20sent',JSON[_0xa73f('0x13')](_0x1c98ba));if(_0x1c98ba[_0xa73f('0x14')]){if(_0x1c98ba[_0xa73f('0x14')]['code']===0x1f4){logger[_0xa73f('0x14')]('MailTransferReport,\x20%s,\x20%s',_0x2830db,_0x1c98ba[_0xa73f('0x14')][_0xa73f('0x15')]);return _0x596635(_0x1c98ba[_0xa73f('0x14')][_0xa73f('0x15')]);}logger[_0xa73f('0x14')](_0xa73f('0xf'),_0x2830db,_0x1c98ba[_0xa73f('0x14')]['message']);return _0x3215ba(_0x1c98ba[_0xa73f('0x14')][_0xa73f('0x15')]);}else{logger[_0xa73f('0xe')]('MailTransferReport,\x20%s,\x20%s',_0x2830db,_0xa73f('0x10'));_0x3215ba(_0x1c98ba[_0xa73f('0x16')]['message']);}})[_0xa73f('0x17')](function(_0x25dec8){logger['error']('MailTransferReport,\x20%s,\x20%s',_0x2830db,_0x25dec8);_0x596635(_0x25dec8);});});} \ No newline at end of file +var _0xa681=['request\x20sent','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','MailTransferReport,\x20%s,\x20%s'];(function(_0x7ad661,_0x1e4efa){var _0x363e14=function(_0x507439){while(--_0x507439){_0x7ad661['push'](_0x7ad661['shift']());}};_0x363e14(++_0x1e4efa);}(_0xa681,0x158));var _0x1a68=function(_0x1f0c52,_0x18ca5f){_0x1f0c52=_0x1f0c52-0x0;var _0x4d880a=_0xa681[_0x1f0c52];return _0x4d880a;};'use strict';var _=require('lodash');var util=require(_0x1a68('0x0'));var moment=require(_0x1a68('0x1'));var BPromise=require(_0x1a68('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1a68('0x3'));var db=require(_0x1a68('0x4'))['db'];var utils=require(_0x1a68('0x5'));var logger=require(_0x1a68('0x6'))('rpc');var config=require(_0x1a68('0x7'));var jayson=require(_0x1a68('0x8'));var client=jayson[_0x1a68('0x9')][_0x1a68('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5cf0d1,_0x5ce912,_0x8ab820){return new BPromise(function(_0x589ad6,_0x12aff8){return client[_0x1a68('0xb')](_0x5cf0d1,_0x8ab820)['then'](function(_0x338e02){logger['info'](_0x1a68('0xc'),_0x5ce912,_0x1a68('0xd'));logger['debug'](_0x1a68('0xe'),_0x5ce912,_0x1a68('0xd'),JSON[_0x1a68('0xf')](_0x338e02));if(_0x338e02['error']){if(_0x338e02[_0x1a68('0x10')][_0x1a68('0x11')]===0x1f4){logger[_0x1a68('0x10')](_0x1a68('0xc'),_0x5ce912,_0x338e02[_0x1a68('0x10')]['message']);return _0x12aff8(_0x338e02[_0x1a68('0x10')]['message']);}logger[_0x1a68('0x10')](_0x1a68('0xc'),_0x5ce912,_0x338e02['error']['message']);return _0x589ad6(_0x338e02[_0x1a68('0x10')][_0x1a68('0x12')]);}else{logger[_0x1a68('0x13')]('MailTransferReport,\x20%s,\x20%s',_0x5ce912,'request\x20sent');_0x589ad6(_0x338e02[_0x1a68('0x14')][_0x1a68('0x12')]);}})['catch'](function(_0x3989a3){logger[_0x1a68('0x10')](_0x1a68('0xc'),_0x5ce912,_0x3989a3);_0x12aff8(_0x3989a3);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 2ab364f..0a0f690 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 _0x4c18=['express','../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','/:id','post','create','put','update','destroy','multer','connect-timeout'];(function(_0x4d70ff,_0x1b070b){var _0x4221f4=function(_0x4767ed){while(--_0x4767ed){_0x4d70ff['push'](_0x4d70ff['shift']());}};_0x4221f4(++_0x1b070b);}(_0x4c18,0x1ce));var _0x84c1=function(_0x12aa80,_0x495a45){_0x12aa80=_0x12aa80-0x0;var _0x354282=_0x4c18[_0x12aa80];return _0x354282;};'use strict';var multer=require(_0x84c1('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x84c1('0x1'));var express=require(_0x84c1('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x84c1('0x3'));var interaction=require(_0x84c1('0x4'));var config=require('../../config/environment');var controller=require('./memberReport.controller');router[_0x84c1('0x5')]('/',auth['isAuthenticated'](),controller[_0x84c1('0x6')]);router['get'](_0x84c1('0x7'),auth[_0x84c1('0x8')](),controller[_0x84c1('0x9')]);router[_0x84c1('0x5')](_0x84c1('0xa'),auth[_0x84c1('0x8')](),controller['show']);router[_0x84c1('0xb')]('/',auth[_0x84c1('0x8')](),controller[_0x84c1('0xc')]);router[_0x84c1('0xd')](_0x84c1('0xa'),auth[_0x84c1('0x8')](),controller[_0x84c1('0xe')]);router['delete'](_0x84c1('0xa'),auth['isAuthenticated'](),controller[_0x84c1('0xf')]);module['exports']=router; \ No newline at end of file +var _0x39bb=['describe','/:id','show','create','put','update','delete','destroy','exports','multer','path','express','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe'];(function(_0x150fd1,_0x5b314b){var _0x52538a=function(_0x27886e){while(--_0x27886e){_0x150fd1['push'](_0x150fd1['shift']());}};_0x52538a(++_0x5b314b);}(_0x39bb,0x183));var _0xb39b=function(_0x5e0e90,_0x1c8363){_0x5e0e90=_0x5e0e90-0x0;var _0x33cfe3=_0x39bb[_0x5e0e90];return _0x33cfe3;};'use strict';var multer=require(_0xb39b('0x0'));var util=require('util');var path=require(_0xb39b('0x1'));var timeout=require('connect-timeout');var express=require(_0xb39b('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb39b('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xb39b('0x4'));var controller=require('./memberReport.controller');router[_0xb39b('0x5')]('/',auth[_0xb39b('0x6')](),controller[_0xb39b('0x7')]);router[_0xb39b('0x5')](_0xb39b('0x8'),auth['isAuthenticated'](),controller[_0xb39b('0x9')]);router[_0xb39b('0x5')](_0xb39b('0xa'),auth['isAuthenticated'](),controller[_0xb39b('0xb')]);router['post']('/',auth[_0xb39b('0x6')](),controller[_0xb39b('0xc')]);router[_0xb39b('0xd')](_0xb39b('0xa'),auth[_0xb39b('0x6')](),controller[_0xb39b('0xe')]);router[_0xb39b('0xf')](_0xb39b('0xa'),auth[_0xb39b('0x6')](),controller[_0xb39b('0x10')]);module[_0xb39b('0x11')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 2e5c874..9bf1352 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 _0x3657=['STRING','DEFAULT\x20PAUSE','INTEGER','DATE','getDataValue','diff','seconds','exitAt','setDataValue','talk:[start]','talk:[dial\x20string]','talk:[queue]','sequelize','moment','exports'];(function(_0x431e18,_0x42f0e5){var _0x7d6d56=function(_0x1c8553){while(--_0x1c8553){_0x431e18['push'](_0x431e18['shift']());}};_0x7d6d56(++_0x42f0e5);}(_0x3657,0x183));var _0x7365=function(_0x17730a,_0x362127){_0x17730a=_0x17730a-0x0;var _0x485db1=_0x3657[_0x17730a];return _0x485db1;};'use strict';var Sequelize=require(_0x7365('0x0'));var moment=require(_0x7365('0x1'));module[_0x7365('0x2')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x7365('0x3')]},'interface':{'type':Sequelize[_0x7365('0x3')]},'type':{'type':Sequelize[_0x7365('0x3')],'defaultValue':_0x7365('0x4'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0x7365('0x5')]},'enterAt':{'type':Sequelize[_0x7365('0x6')]},'exitAt':{'type':Sequelize[_0x7365('0x6')],'set':function(_0x51998b){var _0x2c19f5=moment(_0x51998b);var _0x40c0c7=moment(this[_0x7365('0x7')]('enterAt'));var _0x244a3e=_0x2c19f5[_0x7365('0x8')](_0x40c0c7,_0x7365('0x9'));this['setDataValue'](_0x7365('0xa'),_0x51998b);this[_0x7365('0xb')]('duration',_0x244a3e||null);}},'data1':{'type':Sequelize[_0x7365('0x3')],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0x7365('0x3')],'comment':_0x7365('0xc')},'data3':{'type':Sequelize[_0x7365('0x3')],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0x7365('0x3')],'comment':_0x7365('0xd')},'data5':{'type':Sequelize['STRING'],'comment':_0x7365('0xe')},'role':{'type':Sequelize[_0x7365('0x3')]},'internal':{'type':Sequelize[_0x7365('0x5')]},'uniqueid':{'type':Sequelize[_0x7365('0x3')]}}; \ No newline at end of file +var _0xf2c7=['talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','moment','exports','STRING','INTEGER','DATE','getDataValue','enterAt','diff','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]'];(function(_0x12c610,_0x73c41d){var _0x550b71=function(_0xa77c6b){while(--_0xa77c6b){_0x12c610['push'](_0x12c610['shift']());}};_0x550b71(++_0x73c41d);}(_0xf2c7,0x1d8));var _0x7f2c=function(_0x9c8b4a,_0x2387ff){_0x9c8b4a=_0x9c8b4a-0x0;var _0x198bef=_0xf2c7[_0x9c8b4a];return _0x198bef;};'use strict';var Sequelize=require(_0x7f2c('0x0'));var moment=require(_0x7f2c('0x1'));module[_0x7f2c('0x2')]={'channel':{'type':Sequelize[_0x7f2c('0x3')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x7f2c('0x3')]},'type':{'type':Sequelize[_0x7f2c('0x3')],'defaultValue':'DEFAULT\x20PAUSE','comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0x7f2c('0x4')]},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x7f2c('0x5')],'set':function(_0x835eeb){var _0x4e348c=moment(_0x835eeb);var _0x2216ca=moment(this[_0x7f2c('0x6')](_0x7f2c('0x7')));var _0x5d266e=_0x4e348c[_0x7f2c('0x8')](_0x2216ca,_0x7f2c('0x9'));this[_0x7f2c('0xa')](_0x7f2c('0xb'),_0x835eeb);this[_0x7f2c('0xa')](_0x7f2c('0xc'),_0x5d266e||null);}},'data1':{'type':Sequelize['STRING'],'comment':_0x7f2c('0xd')},'data2':{'type':Sequelize[_0x7f2c('0x3')],'comment':_0x7f2c('0xe')},'data3':{'type':Sequelize[_0x7f2c('0x3')],'comment':_0x7f2c('0xf')},'data4':{'type':Sequelize[_0x7f2c('0x3')],'comment':_0x7f2c('0x10')},'data5':{'type':Sequelize[_0x7f2c('0x3')],'comment':_0x7f2c('0x11')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0x7f2c('0x4')]},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index e108acf..2310767 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 _0xedd9=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','body','update','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','then','end','error','stack','send','index','map','MemberReport','rawAttributes','fieldName','type','key','model','name','query'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0xedd9,0xfc));var _0x9edd=function(_0x6094fc,_0x59927f){_0x6094fc=_0x6094fc-0x0;var _0x4864a9=_0xedd9[_0x6094fc];return _0x4864a9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9edd('0x0'));var zipdir=require(_0x9edd('0x1'));var jsonpatch=require(_0x9edd('0x2'));var rp=require(_0x9edd('0x3'));var moment=require(_0x9edd('0x4'));var BPromise=require(_0x9edd('0x5'));var Mustache=require(_0x9edd('0x6'));var util=require(_0x9edd('0x7'));var path=require('path');var sox=require(_0x9edd('0x8'));var csv=require(_0x9edd('0x9'));var ejs=require(_0x9edd('0xa'));var fs=require('fs');var fs_extra=require(_0x9edd('0xb'));var _=require('lodash');var squel=require(_0x9edd('0xc'));var crypto=require('crypto');var jsforce=require(_0x9edd('0xd'));var deskjs=require(_0x9edd('0xe'));var toCsv=require(_0x9edd('0x9'));var querystring=require(_0x9edd('0xf'));var Papa=require('papaparse');var Redis=require(_0x9edd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9edd('0x11'));var as=require(_0x9edd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9edd('0x13'))(_0x9edd('0x14'));var utils=require('../../config/utils');var config=require(_0x9edd('0x15'));var licenseUtil=require(_0x9edd('0x16'));var db=require(_0x9edd('0x17'))['db'];function respondWithStatusCode(_0xfd544a,_0x287ddd){_0x287ddd=_0x287ddd||0xcc;return function(_0x3a7b84){if(_0x3a7b84){return _0xfd544a[_0x9edd('0x18')](_0x287ddd);}return _0xfd544a[_0x9edd('0x19')](_0x287ddd)['end']();};}function respondWithResult(_0x176bfa,_0x44fc7c){_0x44fc7c=_0x44fc7c||0xc8;return function(_0x891832){if(_0x891832){return _0x176bfa[_0x9edd('0x19')](_0x44fc7c)[_0x9edd('0x1a')](_0x891832);}};}function respondWithFilteredResult(_0x338f3c,_0x1042aa){return function(_0x75a4ab){if(_0x75a4ab){var _0x4ea60f=typeof _0x1042aa[_0x9edd('0x1b')]===_0x9edd('0x1c')&&typeof _0x1042aa[_0x9edd('0x1d')]==='undefined';var _0x1b54c0=_0x75a4ab[_0x9edd('0x1e')];var _0x40ba32=_0x4ea60f?0x0:_0x1042aa['offset'];var _0x43dc70=_0x4ea60f?_0x75a4ab['count']:_0x1042aa[_0x9edd('0x1b')]+_0x1042aa[_0x9edd('0x1d')];var _0x4bdb88;if(_0x43dc70>=_0x1b54c0){_0x43dc70=_0x1b54c0;_0x4bdb88=0xc8;}else{_0x4bdb88=0xce;}_0x338f3c['status'](_0x4bdb88);return _0x338f3c[_0x9edd('0x1f')]('Content-Range',_0x40ba32+'-'+_0x43dc70+'/'+_0x1b54c0)[_0x9edd('0x1a')](_0x75a4ab);}return null;};}function patchUpdates(_0x54a03f){return function(_0x535f37){try{jsonpatch[_0x9edd('0x20')](_0x535f37,_0x54a03f,!![]);}catch(_0x1c46a8){return BPromise['reject'](_0x1c46a8);}return _0x535f37['save']();};}function saveUpdates(_0x341d67,_0x186186){return function(_0x477878){if(_0x477878){return _0x477878['update'](_0x341d67)[_0x9edd('0x21')](function(_0x1dca43){return _0x1dca43;});}return null;};}function removeEntity(_0x44a6c1,_0x2ca65f){return function(_0x339a0d){if(_0x339a0d){return _0x339a0d['destroy']()[_0x9edd('0x21')](function(){_0x44a6c1[_0x9edd('0x19')](0xcc)[_0x9edd('0x22')]();});}};}function handleEntityNotFound(_0x2f9f86,_0x310a4d){return function(_0x4d507f){if(!_0x4d507f){_0x2f9f86['sendStatus'](0x194);}return _0x4d507f;};}function handleError(_0x3276ee,_0xfeca7b){_0xfeca7b=_0xfeca7b||0x1f4;return function(_0x8d67aa){logger[_0x9edd('0x23')](_0x8d67aa[_0x9edd('0x24')]);if(_0x8d67aa['name']){delete _0x8d67aa['name'];}_0x3276ee[_0x9edd('0x19')](_0xfeca7b)[_0x9edd('0x25')](_0x8d67aa);};}exports[_0x9edd('0x26')]=function(_0x52746a,_0x238b22){var _0x28cfae={},_0x2ae8dd={},_0x41af53={'count':0x0,'rows':[]};var _0x5eccfb=_[_0x9edd('0x27')](db[_0x9edd('0x28')][_0x9edd('0x29')],function(_0x12c1bc){return{'name':_0x12c1bc[_0x9edd('0x2a')],'type':_0x12c1bc[_0x9edd('0x2b')][_0x9edd('0x2c')]};});_0x2ae8dd[_0x9edd('0x2d')]=_[_0x9edd('0x27')](_0x5eccfb,_0x9edd('0x2e'));_0x2ae8dd[_0x9edd('0x2f')]=_[_0x9edd('0x30')](_0x52746a[_0x9edd('0x2f')]);_0x2ae8dd[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x2ae8dd['model'],_0x2ae8dd[_0x9edd('0x2f')]);_0x28cfae[_0x9edd('0x33')]=_[_0x9edd('0x32')](_0x2ae8dd['model'],qs[_0x9edd('0x34')](_0x52746a[_0x9edd('0x2f')][_0x9edd('0x34')]));_0x28cfae[_0x9edd('0x33')]=_0x28cfae[_0x9edd('0x33')][_0x9edd('0x35')]?_0x28cfae[_0x9edd('0x33')]:_0x2ae8dd[_0x9edd('0x2d')];if(!_0x52746a[_0x9edd('0x2f')][_0x9edd('0x36')](_0x9edd('0x37'))){_0x28cfae[_0x9edd('0x1d')]=qs[_0x9edd('0x1d')](_0x52746a[_0x9edd('0x2f')]['limit']);_0x28cfae[_0x9edd('0x1b')]=qs['offset'](_0x52746a[_0x9edd('0x2f')][_0x9edd('0x1b')]);}_0x28cfae[_0x9edd('0x38')]=qs[_0x9edd('0x39')](_0x52746a[_0x9edd('0x2f')]['sort']);_0x28cfae[_0x9edd('0x3a')]=qs[_0x9edd('0x31')](_[_0x9edd('0x3b')](_0x52746a[_0x9edd('0x2f')],_0x2ae8dd[_0x9edd('0x31')]),_0x5eccfb);if(_0x52746a[_0x9edd('0x2f')][_0x9edd('0x3c')]){_0x28cfae[_0x9edd('0x3a')]=_[_0x9edd('0x3d')](_0x28cfae[_0x9edd('0x3a')],{'$or':_['map'](_0x5eccfb,function(_0x231604){if(_0x231604['type']!==_0x9edd('0x3e')){var _0x5658d6={};_0x5658d6[_0x231604[_0x9edd('0x2e')]]={'$like':'%'+_0x52746a[_0x9edd('0x2f')][_0x9edd('0x3c')]+'%'};return _0x5658d6;}})});}_0x28cfae=_['merge']({},_0x28cfae,_0x52746a[_0x9edd('0x3f')]);var _0xcbd0ef={'where':_0x28cfae[_0x9edd('0x3a')]};return db['MemberReport'][_0x9edd('0x1e')](_0xcbd0ef)['then'](function(_0x1fc4fb){_0x41af53[_0x9edd('0x1e')]=_0x1fc4fb;if(_0x52746a['query'][_0x9edd('0x40')]){_0x28cfae[_0x9edd('0x41')]=[{'all':!![]}];}return db[_0x9edd('0x28')][_0x9edd('0x42')](_0x28cfae);})['then'](function(_0x449f01){_0x41af53['rows']=_0x449f01;return _0x41af53;})[_0x9edd('0x21')](respondWithFilteredResult(_0x238b22,_0x28cfae))[_0x9edd('0x43')](handleError(_0x238b22,null));};exports['show']=function(_0x318757,_0x49a128){var _0x548299={'raw':!![],'where':{'id':_0x318757[_0x9edd('0x44')]['id']}},_0x369b69={};_0x369b69[_0x9edd('0x2d')]=_[_0x9edd('0x30')](db[_0x9edd('0x28')][_0x9edd('0x29')]);_0x369b69[_0x9edd('0x2f')]=_[_0x9edd('0x30')](_0x318757[_0x9edd('0x2f')]);_0x369b69[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x369b69[_0x9edd('0x2d')],_0x369b69[_0x9edd('0x2f')]);_0x548299[_0x9edd('0x33')]=_[_0x9edd('0x32')](_0x369b69['model'],qs[_0x9edd('0x34')](_0x318757[_0x9edd('0x2f')][_0x9edd('0x34')]));_0x548299[_0x9edd('0x33')]=_0x548299[_0x9edd('0x33')][_0x9edd('0x35')]?_0x548299[_0x9edd('0x33')]:_0x369b69['model'];if(_0x318757['query']['includeAll']){_0x548299[_0x9edd('0x41')]=[{'all':!![]}];}_0x548299=_['merge']({},_0x548299,_0x318757[_0x9edd('0x3f')]);return db[_0x9edd('0x28')][_0x9edd('0x45')](_0x548299)[_0x9edd('0x21')](handleEntityNotFound(_0x49a128,null))[_0x9edd('0x21')](respondWithResult(_0x49a128,null))['catch'](handleError(_0x49a128,null));};exports[_0x9edd('0x46')]=function(_0x35e63c,_0x40e33d){return db['MemberReport'][_0x9edd('0x46')](_0x35e63c[_0x9edd('0x47')],{})[_0x9edd('0x21')](respondWithResult(_0x40e33d,0xc9))[_0x9edd('0x43')](handleError(_0x40e33d,null));};exports[_0x9edd('0x48')]=function(_0x35bdec,_0x4d4f33){if(_0x35bdec[_0x9edd('0x47')]['id']){delete _0x35bdec[_0x9edd('0x47')]['id'];}return db['MemberReport'][_0x9edd('0x45')]({'where':{'id':_0x35bdec[_0x9edd('0x44')]['id']}})['then'](handleEntityNotFound(_0x4d4f33,null))[_0x9edd('0x21')](saveUpdates(_0x35bdec[_0x9edd('0x47')],null))[_0x9edd('0x21')](respondWithResult(_0x4d4f33,null))['catch'](handleError(_0x4d4f33,null));};exports[_0x9edd('0x49')]=function(_0x151157,_0x317a60){return db[_0x9edd('0x28')]['find']({'where':{'id':_0x151157[_0x9edd('0x44')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x317a60,null))[_0x9edd('0x21')](removeEntity(_0x317a60,null))['catch'](handleError(_0x317a60,null));};exports[_0x9edd('0x4a')]=function(_0x21f6ce,_0x57db43){return db[_0x9edd('0x28')]['describe']()[_0x9edd('0x21')](respondWithResult(_0x57db43,null))[_0x9edd('0x43')](handleError(_0x57db43,null));}; \ No newline at end of file +var _0x7217=['query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','filter','includeAll','include','rows','catch','show','params','rawAttributes','length','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','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','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','send','index','map','MemberReport','fieldName','type','model','name','keys'];(function(_0x213eaf,_0x244d73){var _0x5ef0d4=function(_0x289b68){while(--_0x289b68){_0x213eaf['push'](_0x213eaf['shift']());}};_0x5ef0d4(++_0x244d73);}(_0x7217,0x19e));var _0x7721=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0x7217[_0xea8947];return _0x2455e9;};'use strict';var emlformat=require(_0x7721('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7721('0x1'));var jsonpatch=require(_0x7721('0x2'));var rp=require(_0x7721('0x3'));var moment=require(_0x7721('0x4'));var BPromise=require(_0x7721('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7721('0x6'));var sox=require(_0x7721('0x7'));var csv=require(_0x7721('0x8'));var ejs=require(_0x7721('0x9'));var fs=require('fs');var fs_extra=require(_0x7721('0xa'));var _=require(_0x7721('0xb'));var squel=require(_0x7721('0xc'));var crypto=require(_0x7721('0xd'));var jsforce=require(_0x7721('0xe'));var deskjs=require(_0x7721('0xf'));var toCsv=require(_0x7721('0x8'));var querystring=require(_0x7721('0x10'));var Papa=require(_0x7721('0x11'));var Redis=require(_0x7721('0x12'));var authService=require(_0x7721('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7721('0x14'));var hardwareService=require(_0x7721('0x15'));var logger=require(_0x7721('0x16'))(_0x7721('0x17'));var utils=require(_0x7721('0x18'));var config=require(_0x7721('0x19'));var licenseUtil=require(_0x7721('0x1a'));var db=require(_0x7721('0x1b'))['db'];function respondWithStatusCode(_0x55b4ca,_0x2911ec){_0x2911ec=_0x2911ec||0xcc;return function(_0x199930){if(_0x199930){return _0x55b4ca['sendStatus'](_0x2911ec);}return _0x55b4ca[_0x7721('0x1c')](_0x2911ec)[_0x7721('0x1d')]();};}function respondWithResult(_0x3f01c5,_0x2e9752){_0x2e9752=_0x2e9752||0xc8;return function(_0x5069da){if(_0x5069da){return _0x3f01c5[_0x7721('0x1c')](_0x2e9752)[_0x7721('0x1e')](_0x5069da);}};}function respondWithFilteredResult(_0x534f1b,_0x4e199a){return function(_0x4b183e){if(_0x4b183e){var _0x5ed54=typeof _0x4e199a[_0x7721('0x1f')]===_0x7721('0x20')&&typeof _0x4e199a[_0x7721('0x21')]==='undefined';var _0x20f669=_0x4b183e['count'];var _0x3fc09e=_0x5ed54?0x0:_0x4e199a['offset'];var _0xfec626=_0x5ed54?_0x4b183e[_0x7721('0x22')]:_0x4e199a[_0x7721('0x1f')]+_0x4e199a[_0x7721('0x21')];var _0x2286e5;if(_0xfec626>=_0x20f669){_0xfec626=_0x20f669;_0x2286e5=0xc8;}else{_0x2286e5=0xce;}_0x534f1b[_0x7721('0x1c')](_0x2286e5);return _0x534f1b[_0x7721('0x23')](_0x7721('0x24'),_0x3fc09e+'-'+_0xfec626+'/'+_0x20f669)[_0x7721('0x1e')](_0x4b183e);}return null;};}function patchUpdates(_0xaeccc4){return function(_0x4ce1db){try{jsonpatch[_0x7721('0x25')](_0x4ce1db,_0xaeccc4,!![]);}catch(_0x2c1583){return BPromise[_0x7721('0x26')](_0x2c1583);}return _0x4ce1db[_0x7721('0x27')]();};}function saveUpdates(_0x57140c,_0x28f5a6){return function(_0x512f31){if(_0x512f31){return _0x512f31[_0x7721('0x28')](_0x57140c)[_0x7721('0x29')](function(_0x3e8a4e){return _0x3e8a4e;});}return null;};}function removeEntity(_0x1caad8,_0x121cc4){return function(_0x395b15){if(_0x395b15){return _0x395b15[_0x7721('0x2a')]()['then'](function(){_0x1caad8[_0x7721('0x1c')](0xcc)[_0x7721('0x1d')]();});}};}function handleEntityNotFound(_0x125564,_0x1f67c7){return function(_0x40d550){if(!_0x40d550){_0x125564[_0x7721('0x2b')](0x194);}return _0x40d550;};}function handleError(_0x424e05,_0xf753f1){_0xf753f1=_0xf753f1||0x1f4;return function(_0x40f367){logger['error'](_0x40f367[_0x7721('0x2c')]);if(_0x40f367['name']){delete _0x40f367['name'];}_0x424e05[_0x7721('0x1c')](_0xf753f1)[_0x7721('0x2d')](_0x40f367);};}exports[_0x7721('0x2e')]=function(_0x158d98,_0x1ea4d){var _0x37b9f0={},_0xd7d703={},_0x1da2d8={'count':0x0,'rows':[]};var _0x5c54f0=_[_0x7721('0x2f')](db[_0x7721('0x30')]['rawAttributes'],function(_0x4a25c9){return{'name':_0x4a25c9[_0x7721('0x31')],'type':_0x4a25c9[_0x7721('0x32')]['key']};});_0xd7d703[_0x7721('0x33')]=_[_0x7721('0x2f')](_0x5c54f0,_0x7721('0x34'));_0xd7d703['query']=_[_0x7721('0x35')](_0x158d98[_0x7721('0x36')]);_0xd7d703[_0x7721('0x37')]=_[_0x7721('0x38')](_0xd7d703[_0x7721('0x33')],_0xd7d703['query']);_0x37b9f0[_0x7721('0x39')]=_[_0x7721('0x38')](_0xd7d703[_0x7721('0x33')],qs['fields'](_0x158d98[_0x7721('0x36')][_0x7721('0x3a')]));_0x37b9f0['attributes']=_0x37b9f0[_0x7721('0x39')]['length']?_0x37b9f0[_0x7721('0x39')]:_0xd7d703[_0x7721('0x33')];if(!_0x158d98[_0x7721('0x36')][_0x7721('0x3b')](_0x7721('0x3c'))){_0x37b9f0[_0x7721('0x21')]=qs[_0x7721('0x21')](_0x158d98[_0x7721('0x36')][_0x7721('0x21')]);_0x37b9f0[_0x7721('0x1f')]=qs[_0x7721('0x1f')](_0x158d98['query'][_0x7721('0x1f')]);}_0x37b9f0['order']=qs[_0x7721('0x3d')](_0x158d98[_0x7721('0x36')][_0x7721('0x3d')]);_0x37b9f0[_0x7721('0x3e')]=qs[_0x7721('0x37')](_[_0x7721('0x3f')](_0x158d98['query'],_0xd7d703['filters']),_0x5c54f0);if(_0x158d98['query']['filter']){_0x37b9f0[_0x7721('0x3e')]=_[_0x7721('0x40')](_0x37b9f0[_0x7721('0x3e')],{'$or':_[_0x7721('0x2f')](_0x5c54f0,function(_0x4a90ce){if(_0x4a90ce[_0x7721('0x32')]!=='VIRTUAL'){var _0xfab37b={};_0xfab37b[_0x4a90ce[_0x7721('0x34')]]={'$like':'%'+_0x158d98['query'][_0x7721('0x41')]+'%'};return _0xfab37b;}})});}_0x37b9f0=_[_0x7721('0x40')]({},_0x37b9f0,_0x158d98['options']);var _0x4d0111={'where':_0x37b9f0[_0x7721('0x3e')]};return db[_0x7721('0x30')][_0x7721('0x22')](_0x4d0111)[_0x7721('0x29')](function(_0x577af9){_0x1da2d8[_0x7721('0x22')]=_0x577af9;if(_0x158d98[_0x7721('0x36')][_0x7721('0x42')]){_0x37b9f0[_0x7721('0x43')]=[{'all':!![]}];}return db[_0x7721('0x30')]['findAll'](_0x37b9f0);})[_0x7721('0x29')](function(_0x4a2c28){_0x1da2d8[_0x7721('0x44')]=_0x4a2c28;return _0x1da2d8;})['then'](respondWithFilteredResult(_0x1ea4d,_0x37b9f0))[_0x7721('0x45')](handleError(_0x1ea4d,null));};exports[_0x7721('0x46')]=function(_0x231dad,_0x49e0c5){var _0x1453d4={'raw':!![],'where':{'id':_0x231dad[_0x7721('0x47')]['id']}},_0x11d853={};_0x11d853['model']=_[_0x7721('0x35')](db[_0x7721('0x30')][_0x7721('0x48')]);_0x11d853[_0x7721('0x36')]=_[_0x7721('0x35')](_0x231dad[_0x7721('0x36')]);_0x11d853[_0x7721('0x37')]=_['intersection'](_0x11d853['model'],_0x11d853[_0x7721('0x36')]);_0x1453d4[_0x7721('0x39')]=_[_0x7721('0x38')](_0x11d853[_0x7721('0x33')],qs[_0x7721('0x3a')](_0x231dad[_0x7721('0x36')][_0x7721('0x3a')]));_0x1453d4[_0x7721('0x39')]=_0x1453d4[_0x7721('0x39')][_0x7721('0x49')]?_0x1453d4['attributes']:_0x11d853['model'];if(_0x231dad[_0x7721('0x36')][_0x7721('0x42')]){_0x1453d4[_0x7721('0x43')]=[{'all':!![]}];}_0x1453d4=_[_0x7721('0x40')]({},_0x1453d4,_0x231dad['options']);return db[_0x7721('0x30')][_0x7721('0x4a')](_0x1453d4)['then'](handleEntityNotFound(_0x49e0c5,null))[_0x7721('0x29')](respondWithResult(_0x49e0c5,null))['catch'](handleError(_0x49e0c5,null));};exports[_0x7721('0x4b')]=function(_0x5c6922,_0x334f23){return db[_0x7721('0x30')][_0x7721('0x4b')](_0x5c6922['body'],{})[_0x7721('0x29')](respondWithResult(_0x334f23,0xc9))[_0x7721('0x45')](handleError(_0x334f23,null));};exports['update']=function(_0x223d93,_0x1196c2){if(_0x223d93[_0x7721('0x4c')]['id']){delete _0x223d93['body']['id'];}return db[_0x7721('0x30')]['find']({'where':{'id':_0x223d93[_0x7721('0x47')]['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x1196c2,null))[_0x7721('0x29')](saveUpdates(_0x223d93[_0x7721('0x4c')],null))[_0x7721('0x29')](respondWithResult(_0x1196c2,null))[_0x7721('0x45')](handleError(_0x1196c2,null));};exports[_0x7721('0x2a')]=function(_0x7fbb73,_0x694d2f){return db[_0x7721('0x30')][_0x7721('0x4a')]({'where':{'id':_0x7fbb73[_0x7721('0x47')]['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x694d2f,null))[_0x7721('0x29')](removeEntity(_0x694d2f,null))[_0x7721('0x45')](handleError(_0x694d2f,null));};exports['describe']=function(_0x474f32,_0x2f6f30){return db[_0x7721('0x30')][_0x7721('0x4d')]()[_0x7721('0x29')](respondWithResult(_0x2f6f30,null))[_0x7721('0x45')](handleError(_0x2f6f30,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index e47cd82..3c988e1 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 _0xcf71=['./memberReport.attributes','exports','define','MemberReport','report_member','interface','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x53e787,_0x4298e6){var _0x2781a0=function(_0x21f861){while(--_0x21f861){_0x53e787['push'](_0x53e787['shift']());}};_0x2781a0(++_0x4298e6);}(_0xcf71,0xba));var _0x1cf7=function(_0x275fa1,_0x28af28){_0x275fa1=_0x275fa1-0x0;var _0x5c04db=_0xcf71[_0x275fa1];return _0x5c04db;};'use strict';var _=require(_0x1cf7('0x0'));var util=require(_0x1cf7('0x1'));var logger=require(_0x1cf7('0x2'))(_0x1cf7('0x3'));var moment=require('moment');var BPromise=require(_0x1cf7('0x4'));var rp=require(_0x1cf7('0x5'));var fs=require('fs');var path=require(_0x1cf7('0x6'));var rimraf=require(_0x1cf7('0x7'));var config=require(_0x1cf7('0x8'));var attributes=require(_0x1cf7('0x9'));module[_0x1cf7('0xa')]=function(_0x20e097,_0x314796){return _0x20e097[_0x1cf7('0xb')](_0x1cf7('0xc'),attributes,{'tableName':_0x1cf7('0xd'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':['membername',_0x1cf7('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8c97=['interface','lodash','util','api','bluebird','request-promise','path','rimraf','./memberReport.attributes','exports','define','report_member','membername_interface'];(function(_0x164f0f,_0x439875){var _0xf700aa=function(_0x518926){while(--_0x518926){_0x164f0f['push'](_0x164f0f['shift']());}};_0xf700aa(++_0x439875);}(_0x8c97,0x1ae));var _0x78c9=function(_0x15538c,_0x99f378){_0x15538c=_0x15538c-0x0;var _0x472f04=_0x8c97[_0x15538c];return _0x472f04;};'use strict';var _=require(_0x78c9('0x0'));var util=require(_0x78c9('0x1'));var logger=require('../../config/logger')(_0x78c9('0x2'));var moment=require('moment');var BPromise=require(_0x78c9('0x3'));var rp=require(_0x78c9('0x4'));var fs=require('fs');var path=require(_0x78c9('0x5'));var rimraf=require(_0x78c9('0x6'));var config=require('../../config/environment');var attributes=require(_0x78c9('0x7'));module[_0x78c9('0x8')]=function(_0x232363,_0x2eaf0c){return _0x232363[_0x78c9('0x9')]('MemberReport',attributes,{'tableName':_0x78c9('0xa'),'paranoid':![],'indexes':[{'name':_0x78c9('0xb'),'fields':['membername',_0x78c9('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 7064ff6..0cccd08 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 _0xd046=['util','moment','bluebird','ioredis','../../config/logger','../../config/environment','http','MemberReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','GetMemberReport','MemberReport','findAll','options','raw','where','attributes','limit','map','include','model','then','debug','create','body','CreateMemberReport','UpdateMemberReport','update'];(function(_0xed1f28,_0x46fc77){var _0x3b643d=function(_0x2e2c41){while(--_0x2e2c41){_0xed1f28['push'](_0xed1f28['shift']());}};_0x3b643d(++_0x46fc77);}(_0xd046,0x129));var _0x6d04=function(_0xf7e8e,_0x38bab3){_0xf7e8e=_0xf7e8e-0x0;var _0x6f1045=_0xd046[_0xf7e8e];return _0x6f1045;};'use strict';var _=require('lodash');var util=require(_0x6d04('0x0'));var moment=require(_0x6d04('0x1'));var BPromise=require(_0x6d04('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6d04('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6d04('0x4'))('rpc');var config=require(_0x6d04('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6d04('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1968c4,_0x4f83bc,_0x569c7b){return new BPromise(function(_0x2e2c01,_0x42aa22){return client['request'](_0x1968c4,_0x569c7b)['then'](function(_0x27a3d6){logger['info'](_0x6d04('0x7'),_0x4f83bc,'request\x20sent');logger['debug']('MemberReport,\x20%s,\x20%s,\x20%s',_0x4f83bc,_0x6d04('0x8'),JSON[_0x6d04('0x9')](_0x27a3d6));if(_0x27a3d6[_0x6d04('0xa')]){if(_0x27a3d6[_0x6d04('0xa')]['code']===0x1f4){logger[_0x6d04('0xa')](_0x6d04('0x7'),_0x4f83bc,_0x27a3d6[_0x6d04('0xa')][_0x6d04('0xb')]);return _0x42aa22(_0x27a3d6[_0x6d04('0xa')][_0x6d04('0xb')]);}logger[_0x6d04('0xa')](_0x6d04('0x7'),_0x4f83bc,_0x27a3d6[_0x6d04('0xa')][_0x6d04('0xb')]);return _0x2e2c01(_0x27a3d6[_0x6d04('0xa')][_0x6d04('0xb')]);}else{logger[_0x6d04('0xc')](_0x6d04('0x7'),_0x4f83bc,_0x6d04('0x8'));_0x2e2c01(_0x27a3d6[_0x6d04('0xd')][_0x6d04('0xb')]);}})[_0x6d04('0xe')](function(_0xed5538){logger[_0x6d04('0xa')](_0x6d04('0x7'),_0x4f83bc,_0xed5538);_0x42aa22(_0xed5538);});});}exports[_0x6d04('0xf')]=function(_0x2bc798){var _0x3ad325=this;return new Promise(function(_0x4e93b5,_0x3657a1){return db[_0x6d04('0x10')][_0x6d04('0x11')]({'raw':_0x2bc798[_0x6d04('0x12')]?_0x2bc798[_0x6d04('0x12')][_0x6d04('0x13')]===undefined?!![]:![]:!![],'where':_0x2bc798[_0x6d04('0x12')]?_0x2bc798[_0x6d04('0x12')][_0x6d04('0x14')]||null:null,'attributes':_0x2bc798[_0x6d04('0x12')]?_0x2bc798[_0x6d04('0x12')][_0x6d04('0x15')]||null:null,'limit':_0x2bc798[_0x6d04('0x12')]?_0x2bc798['options'][_0x6d04('0x16')]||null:null,'include':_0x2bc798[_0x6d04('0x12')]?_0x2bc798['options']['include']?_[_0x6d04('0x17')](_0x2bc798[_0x6d04('0x12')][_0x6d04('0x18')],function(_0xe8f198){return{'model':db[_0xe8f198[_0x6d04('0x19')]],'as':_0xe8f198['as'],'attributes':_0xe8f198[_0x6d04('0x15')],'include':_0xe8f198[_0x6d04('0x18')]?_[_0x6d04('0x17')](_0xe8f198[_0x6d04('0x18')],function(_0x38e90f){return{'model':db[_0x38e90f[_0x6d04('0x19')]],'as':_0x38e90f['as'],'attributes':_0x38e90f[_0x6d04('0x15')],'include':_0x38e90f[_0x6d04('0x18')]?_[_0x6d04('0x17')](_0x38e90f['include'],function(_0x1dc29b){return{'model':db[_0x1dc29b[_0x6d04('0x19')]],'as':_0x1dc29b['as'],'attributes':_0x1dc29b[_0x6d04('0x15')]};}):[]};}):[]};}):[]:[]})[_0x6d04('0x1a')](function(_0x4256a3){logger[_0x6d04('0xc')]('GetMemberReport',_0x2bc798);logger[_0x6d04('0x1b')](_0x6d04('0xf'),_0x2bc798,JSON[_0x6d04('0x9')](_0x4256a3));_0x4e93b5(_0x4256a3);})[_0x6d04('0xe')](function(_0x2ed2bb){logger['error']('GetMemberReport',_0x2ed2bb['message'],_0x2bc798);_0x3657a1(_0x3ad325['error'](0x1f4,_0x2ed2bb[_0x6d04('0xb')]));});});};exports['CreateMemberReport']=function(_0x43eb48){var _0x4ed123=this;return new Promise(function(_0x26be38,_0xee1291){return db[_0x6d04('0x10')][_0x6d04('0x1c')](_0x43eb48[_0x6d04('0x1d')],{'raw':_0x43eb48[_0x6d04('0x12')]?_0x43eb48[_0x6d04('0x12')][_0x6d04('0x13')]===undefined?!![]:![]:!![]})[_0x6d04('0x1a')](function(_0xff4c36){logger['info']('CreateMemberReport',_0x43eb48);logger[_0x6d04('0x1b')](_0x6d04('0x1e'),_0x43eb48,JSON[_0x6d04('0x9')](_0xff4c36));_0x26be38(_0xff4c36);})[_0x6d04('0xe')](function(_0x592f01){logger[_0x6d04('0xa')](_0x6d04('0x1e'),_0x592f01[_0x6d04('0xb')],_0x43eb48);_0xee1291(_0x4ed123[_0x6d04('0xa')](0x1f4,_0x592f01['message']));});});};exports[_0x6d04('0x1f')]=function(_0x1d86d2){var _0x1e03a4=this;return new Promise(function(_0x184da2,_0x2f59ef){return db[_0x6d04('0x10')][_0x6d04('0x20')](_0x1d86d2[_0x6d04('0x1d')],{'raw':_0x1d86d2[_0x6d04('0x12')]?_0x1d86d2[_0x6d04('0x12')][_0x6d04('0x13')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d86d2[_0x6d04('0x12')]?_0x1d86d2[_0x6d04('0x12')][_0x6d04('0x14')]||null:null,'attributes':_0x1d86d2[_0x6d04('0x12')]?_0x1d86d2['options'][_0x6d04('0x15')]||null:null,'limit':_0x1d86d2['options']?_0x1d86d2[_0x6d04('0x12')][_0x6d04('0x16')]||null:null})['then'](function(_0x39991b){logger[_0x6d04('0xc')](_0x6d04('0x1f'),_0x1d86d2);logger[_0x6d04('0x1b')](_0x6d04('0x1f'),_0x1d86d2,JSON[_0x6d04('0x9')](_0x39991b));_0x184da2(_0x39991b);})[_0x6d04('0xe')](function(_0x1246a7){logger['error'](_0x6d04('0x1f'),_0x1246a7[_0x6d04('0xb')],_0x1d86d2);_0x2f59ef(_0x1e03a4[_0x6d04('0xa')](0x1f4,_0x1246a7[_0x6d04('0xb')]));});});}; \ No newline at end of file +var _0x00e0=['then','CreateMemberReport','create','body','update','UpdateMemberReport','stringify','lodash','util','moment','randomstring','../../mysqldb','jayson/promise','client','request','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetMemberReport','MemberReport','findAll','options','where','limit','model','attributes','map','include'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x00e0,0x1e3));var _0x000e=function(_0x43e219,_0x23f6cf){_0x43e219=_0x43e219-0x0;var _0x1eced6=_0x00e0[_0x43e219];return _0x1eced6;};'use strict';var _=require(_0x000e('0x0'));var util=require(_0x000e('0x1'));var moment=require(_0x000e('0x2'));var BPromise=require('bluebird');var rs=require(_0x000e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x000e('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x000e('0x5'));var client=jayson[_0x000e('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x43d523,_0x3c6d9d,_0x3a2025){return new BPromise(function(_0x243cd6,_0x4974e1){return client[_0x000e('0x7')](_0x43d523,_0x3a2025)['then'](function(_0x3fe7f8){logger[_0x000e('0x8')](_0x000e('0x9'),_0x3c6d9d,_0x000e('0xa'));logger[_0x000e('0xb')](_0x000e('0xc'),_0x3c6d9d,_0x000e('0xa'),JSON['stringify'](_0x3fe7f8));if(_0x3fe7f8['error']){if(_0x3fe7f8['error']['code']===0x1f4){logger['error'](_0x000e('0x9'),_0x3c6d9d,_0x3fe7f8[_0x000e('0xd')][_0x000e('0xe')]);return _0x4974e1(_0x3fe7f8[_0x000e('0xd')][_0x000e('0xe')]);}logger[_0x000e('0xd')](_0x000e('0x9'),_0x3c6d9d,_0x3fe7f8[_0x000e('0xd')][_0x000e('0xe')]);return _0x243cd6(_0x3fe7f8[_0x000e('0xd')][_0x000e('0xe')]);}else{logger[_0x000e('0x8')](_0x000e('0x9'),_0x3c6d9d,_0x000e('0xa'));_0x243cd6(_0x3fe7f8[_0x000e('0xf')][_0x000e('0xe')]);}})[_0x000e('0x10')](function(_0x15c337){logger['error'](_0x000e('0x9'),_0x3c6d9d,_0x15c337);_0x4974e1(_0x15c337);});});}exports[_0x000e('0x11')]=function(_0x108150){var _0x5aab84=this;return new Promise(function(_0x579b61,_0x429a09){return db[_0x000e('0x12')][_0x000e('0x13')]({'raw':_0x108150['options']?_0x108150['options']['raw']===undefined?!![]:![]:!![],'where':_0x108150[_0x000e('0x14')]?_0x108150[_0x000e('0x14')][_0x000e('0x15')]||null:null,'attributes':_0x108150[_0x000e('0x14')]?_0x108150['options']['attributes']||null:null,'limit':_0x108150['options']?_0x108150[_0x000e('0x14')][_0x000e('0x16')]||null:null,'include':_0x108150[_0x000e('0x14')]?_0x108150['options']['include']?_['map'](_0x108150[_0x000e('0x14')]['include'],function(_0x2eb42b){return{'model':db[_0x2eb42b[_0x000e('0x17')]],'as':_0x2eb42b['as'],'attributes':_0x2eb42b[_0x000e('0x18')],'include':_0x2eb42b['include']?_[_0x000e('0x19')](_0x2eb42b[_0x000e('0x1a')],function(_0x55e076){return{'model':db[_0x55e076[_0x000e('0x17')]],'as':_0x55e076['as'],'attributes':_0x55e076['attributes'],'include':_0x55e076['include']?_[_0x000e('0x19')](_0x55e076[_0x000e('0x1a')],function(_0x56efb3){return{'model':db[_0x56efb3[_0x000e('0x17')]],'as':_0x56efb3['as'],'attributes':_0x56efb3[_0x000e('0x18')]};}):[]};}):[]};}):[]:[]})[_0x000e('0x1b')](function(_0x2cfdb8){logger[_0x000e('0x8')](_0x000e('0x11'),_0x108150);logger[_0x000e('0xb')]('GetMemberReport',_0x108150,JSON['stringify'](_0x2cfdb8));_0x579b61(_0x2cfdb8);})['catch'](function(_0x3834fb){logger[_0x000e('0xd')](_0x000e('0x11'),_0x3834fb[_0x000e('0xe')],_0x108150);_0x429a09(_0x5aab84[_0x000e('0xd')](0x1f4,_0x3834fb['message']));});});};exports[_0x000e('0x1c')]=function(_0x423519){var _0x1fe324=this;return new Promise(function(_0x3ccd62,_0x196a0b){return db[_0x000e('0x12')][_0x000e('0x1d')](_0x423519[_0x000e('0x1e')],{'raw':_0x423519['options']?_0x423519['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x5cb0a1){logger[_0x000e('0x8')]('CreateMemberReport',_0x423519);logger[_0x000e('0xb')](_0x000e('0x1c'),_0x423519,JSON['stringify'](_0x5cb0a1));_0x3ccd62(_0x5cb0a1);})[_0x000e('0x10')](function(_0x154f32){logger[_0x000e('0xd')]('CreateMemberReport',_0x154f32[_0x000e('0xe')],_0x423519);_0x196a0b(_0x1fe324[_0x000e('0xd')](0x1f4,_0x154f32['message']));});});};exports['UpdateMemberReport']=function(_0x4fb118){var _0x3ff69c=this;return new Promise(function(_0x15dfb8,_0x59d762){return db[_0x000e('0x12')][_0x000e('0x1f')](_0x4fb118[_0x000e('0x1e')],{'raw':_0x4fb118[_0x000e('0x14')]?_0x4fb118[_0x000e('0x14')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4fb118[_0x000e('0x14')]?_0x4fb118[_0x000e('0x14')]['where']||null:null,'attributes':_0x4fb118[_0x000e('0x14')]?_0x4fb118[_0x000e('0x14')][_0x000e('0x18')]||null:null,'limit':_0x4fb118[_0x000e('0x14')]?_0x4fb118[_0x000e('0x14')][_0x000e('0x16')]||null:null})[_0x000e('0x1b')](function(_0x59d2d2){logger[_0x000e('0x8')](_0x000e('0x20'),_0x4fb118);logger[_0x000e('0xb')](_0x000e('0x20'),_0x4fb118,JSON[_0x000e('0x21')](_0x59d2d2));_0x15dfb8(_0x59d2d2);})[_0x000e('0x10')](function(_0x4e4743){logger[_0x000e('0xd')](_0x000e('0x20'),_0x4e4743[_0x000e('0xe')],_0x4fb118);_0x59d762(_0x3ff69c[_0x000e('0xd')](0x1f4,_0x4e4743[_0x000e('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 99d7f12..e349e61 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 _0x5cae=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get','index','multer','util','path'];(function(_0x4ea417,_0x34c685){var _0x3723a9=function(_0x1d3a21){while(--_0x1d3a21){_0x4ea417['push'](_0x4ea417['shift']());}};_0x3723a9(++_0x34c685);}(_0x5cae,0xb1));var _0xe5ca=function(_0x26d823,_0x3f2031){_0x26d823=_0x26d823-0x0;var _0x5c24b1=_0x5cae[_0x26d823];return _0x5c24b1;};'use strict';var multer=require(_0xe5ca('0x0'));var util=require(_0xe5ca('0x1'));var path=require(_0xe5ca('0x2'));var timeout=require('connect-timeout');var express=require(_0xe5ca('0x3'));var router=express[_0xe5ca('0x4')]();var fs_extra=require(_0xe5ca('0x5'));var auth=require(_0xe5ca('0x6'));var interaction=require(_0xe5ca('0x7'));var config=require(_0xe5ca('0x8'));var controller=require(_0xe5ca('0x9'));router[_0xe5ca('0xa')]('/',controller[_0xe5ca('0xb')]);module['exports']=router; \ No newline at end of file +var _0x2f2e=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','util','path'];(function(_0xf141f9,_0x199ffe){var _0x1c09fe=function(_0x14b050){while(--_0x14b050){_0xf141f9['push'](_0xf141f9['shift']());}};_0x1c09fe(++_0x199ffe);}(_0x2f2e,0x146));var _0xe2f2=function(_0x2fa457,_0x7021df){_0x2fa457=_0x2fa457-0x0;var _0x4f250a=_0x2f2e[_0x2fa457];return _0x4f250a;};'use strict';var multer=require('multer');var util=require(_0xe2f2('0x0'));var path=require(_0xe2f2('0x1'));var timeout=require('connect-timeout');var express=require(_0xe2f2('0x2'));var router=express['Router']();var fs_extra=require(_0xe2f2('0x3'));var auth=require(_0xe2f2('0x4'));var interaction=require(_0xe2f2('0x5'));var config=require(_0xe2f2('0x6'));var controller=require('./migration.controller');router['get']('/',controller['index']);module[_0xe2f2('0x7')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index f761a75..0a0e76b 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 _0x1f07=['version','STRING'];(function(_0x5b268c,_0x4d9ebc){var _0x4772a1=function(_0x2a8171){while(--_0x2a8171){_0x5b268c['push'](_0x5b268c['shift']());}};_0x4772a1(++_0x4d9ebc);}(_0x1f07,0x109));var _0x71f0=function(_0x4f2551,_0x1e669b){_0x4f2551=_0x4f2551-0x0;var _0x23c222=_0x1f07[_0x4f2551];return _0x23c222;};'use strict';var Sequelize=require('sequelize');module['exports']={'version':{'type':Sequelize[_0x71f0('0x0')],'unique':_0x71f0('0x1')}}; \ No newline at end of file +var _0xbe17=['STRING','sequelize'];(function(_0x2ce850,_0x5053ae){var _0x5034fd=function(_0x437de6){while(--_0x437de6){_0x2ce850['push'](_0x2ce850['shift']());}};_0x5034fd(++_0x5053ae);}(_0xbe17,0x155));var _0x7be1=function(_0x3fa0c5,_0x2143f4){_0x3fa0c5=_0x3fa0c5-0x0;var _0x5d115b=_0xbe17[_0x3fa0c5];return _0x5d115b;};'use strict';var Sequelize=require(_0x7be1('0x0'));module['exports']={'version':{'type':Sequelize[_0x7be1('0x1')],'unique':'version'}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 5c95d8a..1bd91e4 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 _0xcfce=['catch','eml-format','zip-dir','request-promise','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','status','error','stack','name','send','index','map','Migration','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0xcfce,0x187));var _0xecfc=function(_0x36940e,_0x11f338){_0x36940e=_0x36940e-0x0;var _0x3283f2=_0xcfce[_0x36940e];return _0x3283f2;};'use strict';var emlformat=require(_0xecfc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xecfc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xecfc('0x2'));var moment=require('moment');var BPromise=require(_0xecfc('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xecfc('0x4'));var sox=require('sox');var csv=require(_0xecfc('0x5'));var ejs=require(_0xecfc('0x6'));var fs=require('fs');var fs_extra=require(_0xecfc('0x7'));var _=require(_0xecfc('0x8'));var squel=require(_0xecfc('0x9'));var crypto=require(_0xecfc('0xa'));var jsforce=require(_0xecfc('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xecfc('0x5'));var querystring=require(_0xecfc('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xecfc('0xd'));var qs=require(_0xecfc('0xe'));var as=require(_0xecfc('0xf'));var hardwareService=require(_0xecfc('0x10'));var logger=require('../../config/logger')(_0xecfc('0x11'));var utils=require(_0xecfc('0x12'));var config=require(_0xecfc('0x13'));var licenseUtil=require(_0xecfc('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x125a8a,_0x5a0e89){_0x5a0e89=_0x5a0e89||0xcc;return function(_0xd6cf03){if(_0xd6cf03){return _0x125a8a[_0xecfc('0x15')](_0x5a0e89);}return _0x125a8a['status'](_0x5a0e89)['end']();};}function respondWithResult(_0x1e046f,_0x43364b){_0x43364b=_0x43364b||0xc8;return function(_0x16ee36){if(_0x16ee36){return _0x1e046f['status'](_0x43364b)[_0xecfc('0x16')](_0x16ee36);}};}function respondWithFilteredResult(_0x547b00,_0xb52d03){return function(_0x383528){if(_0x383528){var _0x25f173=typeof _0xb52d03[_0xecfc('0x17')]===_0xecfc('0x18')&&typeof _0xb52d03[_0xecfc('0x19')]==='undefined';var _0x4dff5c=_0x383528['count'];var _0x16485b=_0x25f173?0x0:_0xb52d03[_0xecfc('0x17')];var _0xf16db4=_0x25f173?_0x383528[_0xecfc('0x1a')]:_0xb52d03[_0xecfc('0x17')]+_0xb52d03[_0xecfc('0x19')];var _0x1a27f9;if(_0xf16db4>=_0x4dff5c){_0xf16db4=_0x4dff5c;_0x1a27f9=0xc8;}else{_0x1a27f9=0xce;}_0x547b00['status'](_0x1a27f9);return _0x547b00[_0xecfc('0x1b')]('Content-Range',_0x16485b+'-'+_0xf16db4+'/'+_0x4dff5c)['json'](_0x383528);}return null;};}function patchUpdates(_0xfe4ca8){return function(_0x481762){try{jsonpatch[_0xecfc('0x1c')](_0x481762,_0xfe4ca8,!![]);}catch(_0x35a8f8){return BPromise[_0xecfc('0x1d')](_0x35a8f8);}return _0x481762[_0xecfc('0x1e')]();};}function saveUpdates(_0x2529ac,_0x139dd3){return function(_0x453153){if(_0x453153){return _0x453153[_0xecfc('0x1f')](_0x2529ac)['then'](function(_0x496a34){return _0x496a34;});}return null;};}function removeEntity(_0x51be10,_0x18f30b){return function(_0x48dcbb){if(_0x48dcbb){return _0x48dcbb[_0xecfc('0x20')]()[_0xecfc('0x21')](function(){_0x51be10[_0xecfc('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41a98d,_0x21b76b){return function(_0x580c64){if(!_0x580c64){_0x41a98d[_0xecfc('0x15')](0x194);}return _0x580c64;};}function handleError(_0x2762c9,_0x8e2347){_0x8e2347=_0x8e2347||0x1f4;return function(_0x208e1d){logger[_0xecfc('0x23')](_0x208e1d[_0xecfc('0x24')]);if(_0x208e1d[_0xecfc('0x25')]){delete _0x208e1d['name'];}_0x2762c9[_0xecfc('0x22')](_0x8e2347)[_0xecfc('0x26')](_0x208e1d);};}exports[_0xecfc('0x27')]=function(_0x34a29e,_0x5e6f03){var _0x321251={},_0x9b936c={},_0xc055f7={'count':0x0,'rows':[]};var _0x2e078c=_[_0xecfc('0x28')](db[_0xecfc('0x29')][_0xecfc('0x2a')],function(_0x53d1fd){return{'name':_0x53d1fd[_0xecfc('0x2b')],'type':_0x53d1fd[_0xecfc('0x2c')]['key']};});_0x9b936c[_0xecfc('0x2d')]=_['map'](_0x2e078c,_0xecfc('0x25'));_0x9b936c[_0xecfc('0x2e')]=_['keys'](_0x34a29e[_0xecfc('0x2e')]);_0x9b936c[_0xecfc('0x2f')]=_[_0xecfc('0x30')](_0x9b936c['model'],_0x9b936c[_0xecfc('0x2e')]);_0x321251[_0xecfc('0x31')]=_[_0xecfc('0x30')](_0x9b936c[_0xecfc('0x2d')],qs[_0xecfc('0x32')](_0x34a29e['query'][_0xecfc('0x32')]));_0x321251['attributes']=_0x321251['attributes'][_0xecfc('0x33')]?_0x321251[_0xecfc('0x31')]:_0x9b936c[_0xecfc('0x2d')];if(!_0x34a29e[_0xecfc('0x2e')][_0xecfc('0x34')]('nolimit')){_0x321251['limit']=qs[_0xecfc('0x19')](_0x34a29e[_0xecfc('0x2e')][_0xecfc('0x19')]);_0x321251[_0xecfc('0x17')]=qs[_0xecfc('0x17')](_0x34a29e[_0xecfc('0x2e')]['offset']);}_0x321251[_0xecfc('0x35')]=qs[_0xecfc('0x36')](_0x34a29e['query']['sort']);_0x321251[_0xecfc('0x37')]=qs[_0xecfc('0x2f')](_[_0xecfc('0x38')](_0x34a29e[_0xecfc('0x2e')],_0x9b936c[_0xecfc('0x2f')]),_0x2e078c);if(_0x34a29e[_0xecfc('0x2e')][_0xecfc('0x39')]){_0x321251[_0xecfc('0x37')]=_[_0xecfc('0x3a')](_0x321251[_0xecfc('0x37')],{'$or':_[_0xecfc('0x28')](_0x2e078c,function(_0x966afc){if(_0x966afc[_0xecfc('0x2c')]!==_0xecfc('0x3b')){var _0xef22ba={};_0xef22ba[_0x966afc[_0xecfc('0x25')]]={'$like':'%'+_0x34a29e[_0xecfc('0x2e')][_0xecfc('0x39')]+'%'};return _0xef22ba;}})});}_0x321251=_[_0xecfc('0x3a')]({},_0x321251,_0x34a29e['options']);var _0x2d1587={'where':_0x321251[_0xecfc('0x37')]};return db[_0xecfc('0x29')]['count'](_0x2d1587)[_0xecfc('0x21')](function(_0x25fd5b){_0xc055f7[_0xecfc('0x1a')]=_0x25fd5b;if(_0x34a29e[_0xecfc('0x2e')][_0xecfc('0x3c')]){_0x321251[_0xecfc('0x3d')]=[{'all':!![]}];}return db['Migration'][_0xecfc('0x3e')](_0x321251);})[_0xecfc('0x21')](function(_0x4e1f88){_0xc055f7[_0xecfc('0x3f')]=_0x4e1f88;return _0xc055f7;})[_0xecfc('0x21')](respondWithFilteredResult(_0x5e6f03,_0x321251))[_0xecfc('0x40')](handleError(_0x5e6f03,null));}; \ No newline at end of file +var _0x46e7=['sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','then','destroy','error','name','send','index','Migration','rawAttributes','fieldName','type','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','map','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','eml-format','rimraf','moment','mustache','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x6c82ab,_0x50180c){var _0x27a94f=function(_0x129530){while(--_0x129530){_0x6c82ab['push'](_0x6c82ab['shift']());}};_0x27a94f(++_0x50180c);}(_0x46e7,0x18f));var _0x746e=function(_0x31ba27,_0x1c23f0){_0x31ba27=_0x31ba27-0x0;var _0xd6e719=_0x46e7[_0x31ba27];return _0xd6e719;};'use strict';var emlformat=require(_0x746e('0x0'));var rimraf=require(_0x746e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x746e('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x746e('0x3'));var util=require(_0x746e('0x4'));var path=require(_0x746e('0x5'));var sox=require(_0x746e('0x6'));var csv=require(_0x746e('0x7'));var ejs=require(_0x746e('0x8'));var fs=require('fs');var fs_extra=require(_0x746e('0x9'));var _=require(_0x746e('0xa'));var squel=require(_0x746e('0xb'));var crypto=require(_0x746e('0xc'));var jsforce=require(_0x746e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x746e('0x7'));var querystring=require(_0x746e('0xe'));var Papa=require(_0x746e('0xf'));var Redis=require(_0x746e('0x10'));var authService=require(_0x746e('0x11'));var qs=require(_0x746e('0x12'));var as=require(_0x746e('0x13'));var hardwareService=require(_0x746e('0x14'));var logger=require(_0x746e('0x15'))(_0x746e('0x16'));var utils=require(_0x746e('0x17'));var config=require(_0x746e('0x18'));var licenseUtil=require(_0x746e('0x19'));var db=require(_0x746e('0x1a'))['db'];function respondWithStatusCode(_0x322c10,_0x20a284){_0x20a284=_0x20a284||0xcc;return function(_0x271936){if(_0x271936){return _0x322c10[_0x746e('0x1b')](_0x20a284);}return _0x322c10[_0x746e('0x1c')](_0x20a284)[_0x746e('0x1d')]();};}function respondWithResult(_0xc80f0c,_0x348d66){_0x348d66=_0x348d66||0xc8;return function(_0x24ac74){if(_0x24ac74){return _0xc80f0c[_0x746e('0x1c')](_0x348d66)['json'](_0x24ac74);}};}function respondWithFilteredResult(_0x16ac9d,_0x1bb726){return function(_0x1c8508){if(_0x1c8508){var _0x39925a=typeof _0x1bb726[_0x746e('0x1e')]===_0x746e('0x1f')&&typeof _0x1bb726[_0x746e('0x20')]===_0x746e('0x1f');var _0x20a3fd=_0x1c8508[_0x746e('0x21')];var _0x5f49b7=_0x39925a?0x0:_0x1bb726[_0x746e('0x1e')];var _0x9255ee=_0x39925a?_0x1c8508[_0x746e('0x21')]:_0x1bb726['offset']+_0x1bb726['limit'];var _0x431e09;if(_0x9255ee>=_0x20a3fd){_0x9255ee=_0x20a3fd;_0x431e09=0xc8;}else{_0x431e09=0xce;}_0x16ac9d['status'](_0x431e09);return _0x16ac9d[_0x746e('0x22')](_0x746e('0x23'),_0x5f49b7+'-'+_0x9255ee+'/'+_0x20a3fd)[_0x746e('0x24')](_0x1c8508);}return null;};}function patchUpdates(_0x58ffd2){return function(_0x196d01){try{jsonpatch[_0x746e('0x25')](_0x196d01,_0x58ffd2,!![]);}catch(_0x23c507){return BPromise['reject'](_0x23c507);}return _0x196d01[_0x746e('0x26')]();};}function saveUpdates(_0x3790ca,_0x35d232){return function(_0xc4d3a2){if(_0xc4d3a2){return _0xc4d3a2['update'](_0x3790ca)[_0x746e('0x27')](function(_0x3fad4b){return _0x3fad4b;});}return null;};}function removeEntity(_0x3862b0,_0xb9447){return function(_0x2ee554){if(_0x2ee554){return _0x2ee554[_0x746e('0x28')]()[_0x746e('0x27')](function(){_0x3862b0[_0x746e('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f956a,_0x36efe3){return function(_0x54f5af){if(!_0x54f5af){_0x1f956a[_0x746e('0x1b')](0x194);}return _0x54f5af;};}function handleError(_0x3f69ce,_0x5e8f45){_0x5e8f45=_0x5e8f45||0x1f4;return function(_0x1c0fd4){logger[_0x746e('0x29')](_0x1c0fd4['stack']);if(_0x1c0fd4[_0x746e('0x2a')]){delete _0x1c0fd4[_0x746e('0x2a')];}_0x3f69ce[_0x746e('0x1c')](_0x5e8f45)[_0x746e('0x2b')](_0x1c0fd4);};}exports[_0x746e('0x2c')]=function(_0x3e3e9b,_0x52ddb8){var _0x710a6f={},_0x5a6535={},_0x342cd2={'count':0x0,'rows':[]};var _0x3ccaed=_['map'](db[_0x746e('0x2d')][_0x746e('0x2e')],function(_0x522278){return{'name':_0x522278[_0x746e('0x2f')],'type':_0x522278[_0x746e('0x30')]['key']};});_0x5a6535[_0x746e('0x31')]=_['map'](_0x3ccaed,_0x746e('0x2a'));_0x5a6535[_0x746e('0x32')]=_[_0x746e('0x33')](_0x3e3e9b['query']);_0x5a6535[_0x746e('0x34')]=_['intersection'](_0x5a6535[_0x746e('0x31')],_0x5a6535[_0x746e('0x32')]);_0x710a6f[_0x746e('0x35')]=_['intersection'](_0x5a6535[_0x746e('0x31')],qs['fields'](_0x3e3e9b[_0x746e('0x32')][_0x746e('0x36')]));_0x710a6f[_0x746e('0x35')]=_0x710a6f[_0x746e('0x35')][_0x746e('0x37')]?_0x710a6f[_0x746e('0x35')]:_0x5a6535['model'];if(!_0x3e3e9b[_0x746e('0x32')][_0x746e('0x38')](_0x746e('0x39'))){_0x710a6f[_0x746e('0x20')]=qs[_0x746e('0x20')](_0x3e3e9b['query']['limit']);_0x710a6f[_0x746e('0x1e')]=qs['offset'](_0x3e3e9b[_0x746e('0x32')]['offset']);}_0x710a6f['order']=qs['sort'](_0x3e3e9b[_0x746e('0x32')][_0x746e('0x3a')]);_0x710a6f[_0x746e('0x3b')]=qs['filters'](_[_0x746e('0x3c')](_0x3e3e9b[_0x746e('0x32')],_0x5a6535[_0x746e('0x34')]),_0x3ccaed);if(_0x3e3e9b[_0x746e('0x32')][_0x746e('0x3d')]){_0x710a6f[_0x746e('0x3b')]=_['merge'](_0x710a6f['where'],{'$or':_[_0x746e('0x3e')](_0x3ccaed,function(_0x3604af){if(_0x3604af[_0x746e('0x30')]!==_0x746e('0x3f')){var _0x5074e3={};_0x5074e3[_0x3604af[_0x746e('0x2a')]]={'$like':'%'+_0x3e3e9b[_0x746e('0x32')][_0x746e('0x3d')]+'%'};return _0x5074e3;}})});}_0x710a6f=_[_0x746e('0x40')]({},_0x710a6f,_0x3e3e9b[_0x746e('0x41')]);var _0x46c47d={'where':_0x710a6f[_0x746e('0x3b')]};return db[_0x746e('0x2d')]['count'](_0x46c47d)[_0x746e('0x27')](function(_0x1197aa){_0x342cd2[_0x746e('0x21')]=_0x1197aa;if(_0x3e3e9b[_0x746e('0x32')][_0x746e('0x42')]){_0x710a6f[_0x746e('0x43')]=[{'all':!![]}];}return db[_0x746e('0x2d')][_0x746e('0x44')](_0x710a6f);})[_0x746e('0x27')](function(_0x45de90){_0x342cd2[_0x746e('0x45')]=_0x45de90;return _0x342cd2;})['then'](respondWithFilteredResult(_0x52ddb8,_0x710a6f))[_0x746e('0x46')](handleError(_0x52ddb8,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 5f98634..05f778f 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 _0xb4aa=['exports','Migration','util','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xb4aa,0xad));var _0xab4a=function(_0x3d47ec,_0x45ef81){_0x3d47ec=_0x3d47ec-0x0;var _0x2000e4=_0xb4aa[_0x3d47ec];return _0x2000e4;};'use strict';var _=require('lodash');var util=require(_0xab4a('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xab4a('0x1'));var BPromise=require(_0xab4a('0x2'));var rp=require(_0xab4a('0x3'));var fs=require('fs');var path=require(_0xab4a('0x4'));var rimraf=require(_0xab4a('0x5'));var config=require(_0xab4a('0x6'));var attributes=require('./migration.attributes');module[_0xab4a('0x7')]=function(_0x1f94f1,_0x477cc6){return _0x1f94f1['define'](_0xab4a('0x8'),attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x94f3=['bluebird','request-promise','path','rimraf','../../config/environment','./migration.attributes','define','util','moment'];(function(_0x1c546c,_0x5c57cb){var _0x2cc384=function(_0x4dee11){while(--_0x4dee11){_0x1c546c['push'](_0x1c546c['shift']());}};_0x2cc384(++_0x5c57cb);}(_0x94f3,0x6a));var _0x394f=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x94f3[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require(_0x394f('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x394f('0x1'));var BPromise=require(_0x394f('0x2'));var rp=require(_0x394f('0x3'));var fs=require('fs');var path=require(_0x394f('0x4'));var rimraf=require(_0x394f('0x5'));var config=require(_0x394f('0x6'));var attributes=require(_0x394f('0x7'));module['exports']=function(_0x1e9abd,_0x3b9550){return _0x1e9abd[_0x394f('0x8')]('Migration',attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index 65b297f..601147b 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 _0xb48d=['Migration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','Migration,\x20%s,\x20%s'];(function(_0xbca15c,_0x5ac4cc){var _0x2f2a88=function(_0x1ab4b6){while(--_0x1ab4b6){_0xbca15c['push'](_0xbca15c['shift']());}};_0x2f2a88(++_0x5ac4cc);}(_0xb48d,0x194));var _0xdb48=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0xb48d[_0x1a36a5];return _0x746243;};'use strict';var _=require(_0xdb48('0x0'));var util=require('util');var moment=require(_0xdb48('0x1'));var BPromise=require('bluebird');var rs=require(_0xdb48('0x2'));var fs=require('fs');var Redis=require(_0xdb48('0x3'));var db=require(_0xdb48('0x4'))['db'];var utils=require(_0xdb48('0x5'));var logger=require('../../config/logger')(_0xdb48('0x6'));var config=require('../../config/environment');var jayson=require(_0xdb48('0x7'));var client=jayson[_0xdb48('0x8')][_0xdb48('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5db721,_0x4e834c,_0x251ce5){return new BPromise(function(_0x173933,_0x5f2b47){return client[_0xdb48('0xa')](_0x5db721,_0x251ce5)[_0xdb48('0xb')](function(_0x4ddac8){logger[_0xdb48('0xc')](_0xdb48('0xd'),_0x4e834c,'request\x20sent');logger['debug'](_0xdb48('0xe'),_0x4e834c,_0xdb48('0xf'),JSON[_0xdb48('0x10')](_0x4ddac8));if(_0x4ddac8['error']){if(_0x4ddac8[_0xdb48('0x11')][_0xdb48('0x12')]===0x1f4){logger['error'](_0xdb48('0xd'),_0x4e834c,_0x4ddac8[_0xdb48('0x11')][_0xdb48('0x13')]);return _0x5f2b47(_0x4ddac8[_0xdb48('0x11')][_0xdb48('0x13')]);}logger[_0xdb48('0x11')]('Migration,\x20%s,\x20%s',_0x4e834c,_0x4ddac8[_0xdb48('0x11')][_0xdb48('0x13')]);return _0x173933(_0x4ddac8[_0xdb48('0x11')]['message']);}else{logger[_0xdb48('0xc')]('Migration,\x20%s,\x20%s',_0x4e834c,_0xdb48('0xf'));_0x173933(_0x4ddac8[_0xdb48('0x14')][_0xdb48('0x13')]);}})[_0xdb48('0x15')](function(_0x43c3ad){logger['error']('Migration,\x20%s,\x20%s',_0x4e834c,_0x43c3ad);_0x5f2b47(_0x43c3ad);});});} \ No newline at end of file +var _0xa788=['moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','http','then','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util'];(function(_0x50eab9,_0x1a6d00){var _0x102a2f=function(_0x5af23c){while(--_0x5af23c){_0x50eab9['push'](_0x50eab9['shift']());}};_0x102a2f(++_0x1a6d00);}(_0xa788,0x70));var _0x8a78=function(_0x2f90a5,_0x46f45e){_0x2f90a5=_0x2f90a5-0x0;var _0x5a9648=_0xa788[_0x2f90a5];return _0x5a9648;};'use strict';var _=require(_0x8a78('0x0'));var util=require(_0x8a78('0x1'));var moment=require(_0x8a78('0x2'));var BPromise=require(_0x8a78('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8a78('0x4'));var db=require(_0x8a78('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8a78('0x6'))(_0x8a78('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x8a78('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x344c6d,_0x539774,_0x4def98){return new BPromise(function(_0x22ebca,_0x542ac5){return client['request'](_0x344c6d,_0x4def98)[_0x8a78('0x9')](function(_0x811201){logger['info'](_0x8a78('0xa'),_0x539774,_0x8a78('0xb'));logger[_0x8a78('0xc')](_0x8a78('0xd'),_0x539774,_0x8a78('0xb'),JSON[_0x8a78('0xe')](_0x811201));if(_0x811201[_0x8a78('0xf')]){if(_0x811201[_0x8a78('0xf')][_0x8a78('0x10')]===0x1f4){logger['error'](_0x8a78('0xa'),_0x539774,_0x811201[_0x8a78('0xf')][_0x8a78('0x11')]);return _0x542ac5(_0x811201['error'][_0x8a78('0x11')]);}logger[_0x8a78('0xf')](_0x8a78('0xa'),_0x539774,_0x811201['error'][_0x8a78('0x11')]);return _0x22ebca(_0x811201['error'][_0x8a78('0x11')]);}else{logger['info'](_0x8a78('0xa'),_0x539774,'request\x20sent');_0x22ebca(_0x811201['result']['message']);}})[_0x8a78('0x12')](function(_0x27822b){logger[_0x8a78('0xf')](_0x8a78('0xa'),_0x539774,_0x27822b);_0x542ac5(_0x27822b);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index d309f91..1723d5d 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 _0x682b=['exports','multer','util','connect-timeout','Router','../../components/auth/service','../../config/environment','./network.controller','get','isAuthenticated','/:id','post','update','delete','destroy'];(function(_0x246f52,_0x1a63ab){var _0x4d1abe=function(_0x1f7f23){while(--_0x1f7f23){_0x246f52['push'](_0x246f52['shift']());}};_0x4d1abe(++_0x1a63ab);}(_0x682b,0x1e1));var _0xb682=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0x682b[_0x13b8f3];return _0x1a6d06;};'use strict';var multer=require(_0xb682('0x0'));var util=require(_0xb682('0x1'));var path=require('path');var timeout=require(_0xb682('0x2'));var express=require('express');var router=express[_0xb682('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb682('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xb682('0x5'));var controller=require(_0xb682('0x6'));router[_0xb682('0x7')]('/',auth[_0xb682('0x8')](),controller['index']);router[_0xb682('0x7')](_0xb682('0x9'),auth[_0xb682('0x8')](),controller['show']);router[_0xb682('0xa')]('/',auth[_0xb682('0x8')](),controller['create']);router['put'](_0xb682('0x9'),auth['isAuthenticated'](),controller[_0xb682('0xb')]);router[_0xb682('0xc')](_0xb682('0x9'),auth[_0xb682('0x8')](),controller[_0xb682('0xd')]);module[_0xb682('0xe')]=router; \ No newline at end of file +var _0x81d4=['show','post','create','put','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../config/environment','./network.controller','get','index','/:id','isAuthenticated'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x81d4,0x197));var _0x481d=function(_0x35c526,_0x21efe2){_0x35c526=_0x35c526-0x0;var _0x2118b2=_0x81d4[_0x35c526];return _0x2118b2;};'use strict';var multer=require('multer');var util=require(_0x481d('0x0'));var path=require(_0x481d('0x1'));var timeout=require('connect-timeout');var express=require(_0x481d('0x2'));var router=express[_0x481d('0x3')]();var fs_extra=require(_0x481d('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x481d('0x5'));var controller=require(_0x481d('0x6'));router[_0x481d('0x7')]('/',auth['isAuthenticated'](),controller[_0x481d('0x8')]);router[_0x481d('0x7')](_0x481d('0x9'),auth[_0x481d('0xa')](),controller[_0x481d('0xb')]);router[_0x481d('0xc')]('/',auth['isAuthenticated'](),controller[_0x481d('0xd')]);router[_0x481d('0xe')](_0x481d('0x9'),auth['isAuthenticated'](),controller[_0x481d('0xf')]);router[_0x481d('0x10')]('/:id',auth[_0x481d('0xa')](),controller[_0x481d('0x11')]);module[_0x481d('0x12')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 04b27e0..851b199 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 _0x62c7=['exports','ENUM','localnet','externip','stun','turn','STRING'];(function(_0x15ecac,_0x201875){var _0x20aad2=function(_0x34d996){while(--_0x34d996){_0x15ecac['push'](_0x15ecac['shift']());}};_0x20aad2(++_0x201875);}(_0x62c7,0xd2));var _0x762c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x62c7[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module[_0x762c('0x0')]={'type':{'type':Sequelize[_0x762c('0x1')](_0x762c('0x2'),_0x762c('0x3'),_0x762c('0x4'),_0x762c('0x5'))},'value':{'type':Sequelize[_0x762c('0x6')]},'username':{'type':Sequelize[_0x762c('0x6')]},'password':{'type':Sequelize[_0x762c('0x6')]}}; \ No newline at end of file +var _0x6a77=['stun','turn','STRING','sequelize','ENUM','localnet','externip'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x6a77,0x18b));var _0x76a7=function(_0x2bfc45,_0x2489b6){_0x2bfc45=_0x2bfc45-0x0;var _0x2d5425=_0x6a77[_0x2bfc45];return _0x2d5425;};'use strict';var Sequelize=require(_0x76a7('0x0'));module['exports']={'type':{'type':Sequelize[_0x76a7('0x1')](_0x76a7('0x2'),_0x76a7('0x3'),_0x76a7('0x4'),_0x76a7('0x5'))},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x76a7('0x6')]},'password':{'type':Sequelize[_0x76a7('0x6')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 3b74c48..2c7559c 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 _0x27e6=['json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','destroy','end','stack','name','send','index','map','Network','rawAttributes','fieldName','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','type','VIRTUAL','merge','options','include','findAll','rows','catch','show','keys','includeAll','find','create','transaction','body','STUN','readFileSync','join','root','render','writeFileSync','/etc/asterisk/stun_xcally.conf','toUpperCase','server/files/templates/turn_multiple.ejs','utf8','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','/etc/asterisk/sip_xcally_%s.conf','Reload','chan_sip.so','sequelize','server/files/templates/stun_multiple.ejs','res_stun_monitor.so','TURN','toLowerCase','params','format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','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','../../mysqldb','client','http','then','Network,\x20%s,\x20%s','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','result','sendStatus','status'];(function(_0x4a22f7,_0x12b819){var _0x5bf2f4=function(_0x2a6768){while(--_0x2a6768){_0x4a22f7['push'](_0x4a22f7['shift']());}};_0x5bf2f4(++_0x12b819);}(_0x27e6,0x121));var _0x627e=function(_0x45e54f,_0x2f1966){_0x45e54f=_0x45e54f-0x0;var _0x120a5e=_0x27e6[_0x45e54f];return _0x120a5e;};'use strict';var emlformat=require(_0x627e('0x0'));var rimraf=require(_0x627e('0x1'));var zipdir=require(_0x627e('0x2'));var jsonpatch=require(_0x627e('0x3'));var rp=require(_0x627e('0x4'));var moment=require('moment');var BPromise=require(_0x627e('0x5'));var Mustache=require(_0x627e('0x6'));var util=require(_0x627e('0x7'));var path=require(_0x627e('0x8'));var sox=require('sox');var csv=require(_0x627e('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x627e('0xa'));var squel=require(_0x627e('0xb'));var crypto=require(_0x627e('0xc'));var jsforce=require(_0x627e('0xd'));var deskjs=require(_0x627e('0xe'));var toCsv=require('to-csv');var querystring=require(_0x627e('0xf'));var Papa=require(_0x627e('0x10'));var Redis=require(_0x627e('0x11'));var authService=require(_0x627e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x627e('0x13'));var hardwareService=require(_0x627e('0x14'));var logger=require(_0x627e('0x15'))(_0x627e('0x16'));var utils=require(_0x627e('0x17'));var config=require(_0x627e('0x18'));var licenseUtil=require(_0x627e('0x19'));var db=require(_0x627e('0x1a'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x627e('0x1b')][_0x627e('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0xd1d2ad,_0x4f2f76,_0x148bcf,_0xc18de4){return new BPromise(function(_0x3abfc6,_0x5b3a31){var _0x1b0686=_0xc18de4||client;return _0x1b0686['request'](_0xd1d2ad,_0x148bcf)[_0x627e('0x1d')](function(_0x82d324){logger['info'](_0x627e('0x1e'),_0x4f2f76,'request\x20sent');logger[_0x627e('0x1f')](_0x627e('0x20'),_0x4f2f76,'request\x20sent',JSON[_0x627e('0x21')](_0x82d324));if(_0x82d324['error']){if(_0x82d324[_0x627e('0x22')]['code']===0x1f4){logger['error'](_0x627e('0x1e'),_0x4f2f76,_0x82d324['error']['message']);return _0x5b3a31(_0x82d324[_0x627e('0x22')]['message']);}logger[_0x627e('0x22')](_0x627e('0x1e'),_0x4f2f76,_0x82d324[_0x627e('0x22')][_0x627e('0x23')]);return _0x3abfc6(_0x82d324['error'][_0x627e('0x23')]);}else{logger[_0x627e('0x24')](_0x627e('0x1e'),_0x4f2f76,_0x627e('0x25'));_0x3abfc6(_0x82d324[_0x627e('0x26')][_0x627e('0x23')]);}})['catch'](function(_0x391405){logger[_0x627e('0x22')](_0x627e('0x1e'),_0x4f2f76,_0x391405);_0x5b3a31(_0x391405);});});}function respondWithStatusCode(_0x5c2f1f,_0x4c6d30){_0x4c6d30=_0x4c6d30||0xcc;return function(_0x43d4df){if(_0x43d4df){return _0x5c2f1f[_0x627e('0x27')](_0x4c6d30);}return _0x5c2f1f[_0x627e('0x28')](_0x4c6d30)['end']();};}function respondWithResult(_0x36af8d,_0x2f1441){_0x2f1441=_0x2f1441||0xc8;return function(_0x413a11){if(_0x413a11){return _0x36af8d[_0x627e('0x28')](_0x2f1441)[_0x627e('0x29')](_0x413a11);}};}function respondWithFilteredResult(_0x303500,_0x2e7947){return function(_0x5ad443){if(_0x5ad443){var _0x5e407a=typeof _0x2e7947[_0x627e('0x2a')]===_0x627e('0x2b')&&typeof _0x2e7947['limit']===_0x627e('0x2b');var _0x101f81=_0x5ad443[_0x627e('0x2c')];var _0x14a6a6=_0x5e407a?0x0:_0x2e7947[_0x627e('0x2a')];var _0x29e485=_0x5e407a?_0x5ad443[_0x627e('0x2c')]:_0x2e7947[_0x627e('0x2a')]+_0x2e7947[_0x627e('0x2d')];var _0x228468;if(_0x29e485>=_0x101f81){_0x29e485=_0x101f81;_0x228468=0xc8;}else{_0x228468=0xce;}_0x303500[_0x627e('0x28')](_0x228468);return _0x303500['set'](_0x627e('0x2e'),_0x14a6a6+'-'+_0x29e485+'/'+_0x101f81)[_0x627e('0x29')](_0x5ad443);}return null;};}function patchUpdates(_0x33f555){return function(_0x38b96e){try{jsonpatch[_0x627e('0x2f')](_0x38b96e,_0x33f555,!![]);}catch(_0x1a9516){return BPromise[_0x627e('0x30')](_0x1a9516);}return _0x38b96e[_0x627e('0x31')]();};}function saveUpdates(_0x34564b,_0x413633){return function(_0x162dbb){if(_0x162dbb){return _0x162dbb[_0x627e('0x32')](_0x34564b)[_0x627e('0x1d')](function(_0x58e7ae){return _0x58e7ae;});}return null;};}function removeEntity(_0x3b483b,_0x3e477f){return function(_0x4c8709){if(_0x4c8709){return _0x4c8709[_0x627e('0x33')]()['then'](function(){_0x3b483b[_0x627e('0x28')](0xcc)[_0x627e('0x34')]();});}};}function handleEntityNotFound(_0x4062b9,_0x8498fe){return function(_0x58d552){if(!_0x58d552){_0x4062b9['sendStatus'](0x194);}return _0x58d552;};}function handleError(_0x4a7eb8,_0x450d1f){_0x450d1f=_0x450d1f||0x1f4;return function(_0x2a34fc){logger[_0x627e('0x22')](_0x2a34fc[_0x627e('0x35')]);if(_0x2a34fc[_0x627e('0x36')]){delete _0x2a34fc['name'];}_0x4a7eb8[_0x627e('0x28')](_0x450d1f)[_0x627e('0x37')](_0x2a34fc);};}exports[_0x627e('0x38')]=function(_0x96401a,_0x3c1327){var _0x542f02={},_0x46b696={},_0x2b7c23={'count':0x0,'rows':[]};var _0x23b832=_[_0x627e('0x39')](db[_0x627e('0x3a')][_0x627e('0x3b')],function(_0x5f5bec){return{'name':_0x5f5bec[_0x627e('0x3c')],'type':_0x5f5bec['type']['key']};});_0x46b696[_0x627e('0x3d')]=_[_0x627e('0x39')](_0x23b832,_0x627e('0x36'));_0x46b696[_0x627e('0x3e')]=_['keys'](_0x96401a[_0x627e('0x3e')]);_0x46b696['filters']=_[_0x627e('0x3f')](_0x46b696['model'],_0x46b696['query']);_0x542f02[_0x627e('0x40')]=_['intersection'](_0x46b696['model'],qs[_0x627e('0x41')](_0x96401a[_0x627e('0x3e')][_0x627e('0x41')]));_0x542f02[_0x627e('0x40')]=_0x542f02['attributes'][_0x627e('0x42')]?_0x542f02[_0x627e('0x40')]:_0x46b696[_0x627e('0x3d')];if(!_0x96401a[_0x627e('0x3e')][_0x627e('0x43')](_0x627e('0x44'))){_0x542f02['limit']=qs[_0x627e('0x2d')](_0x96401a[_0x627e('0x3e')][_0x627e('0x2d')]);_0x542f02[_0x627e('0x2a')]=qs[_0x627e('0x2a')](_0x96401a[_0x627e('0x3e')][_0x627e('0x2a')]);}_0x542f02[_0x627e('0x45')]=qs[_0x627e('0x46')](_0x96401a[_0x627e('0x3e')][_0x627e('0x46')]);_0x542f02[_0x627e('0x47')]=qs['filters'](_[_0x627e('0x48')](_0x96401a[_0x627e('0x3e')],_0x46b696['filters']),_0x23b832);if(_0x96401a[_0x627e('0x3e')]['filter']){_0x542f02[_0x627e('0x47')]=_['merge'](_0x542f02[_0x627e('0x47')],{'$or':_[_0x627e('0x39')](_0x23b832,function(_0x5a4a58){if(_0x5a4a58[_0x627e('0x49')]!==_0x627e('0x4a')){var _0x29daa7={};_0x29daa7[_0x5a4a58[_0x627e('0x36')]]={'$like':'%'+_0x96401a[_0x627e('0x3e')]['filter']+'%'};return _0x29daa7;}})});}_0x542f02=_[_0x627e('0x4b')]({},_0x542f02,_0x96401a[_0x627e('0x4c')]);var _0x83cb70={'where':_0x542f02[_0x627e('0x47')]};return db[_0x627e('0x3a')][_0x627e('0x2c')](_0x83cb70)[_0x627e('0x1d')](function(_0x318c00){_0x2b7c23[_0x627e('0x2c')]=_0x318c00;if(_0x96401a[_0x627e('0x3e')]['includeAll']){_0x542f02[_0x627e('0x4d')]=[{'all':!![]}];}return db['Network'][_0x627e('0x4e')](_0x542f02);})[_0x627e('0x1d')](function(_0x331c87){_0x2b7c23[_0x627e('0x4f')]=_0x331c87;return _0x2b7c23;})[_0x627e('0x1d')](respondWithFilteredResult(_0x3c1327,_0x542f02))[_0x627e('0x50')](handleError(_0x3c1327,null));};exports[_0x627e('0x51')]=function(_0x5e3187,_0x1f8d23){var _0x17dc15={'raw':!![],'where':{'id':_0x5e3187['params']['id']}},_0x3a459a={};_0x3a459a[_0x627e('0x3d')]=_[_0x627e('0x52')](db[_0x627e('0x3a')]['rawAttributes']);_0x3a459a[_0x627e('0x3e')]=_[_0x627e('0x52')](_0x5e3187[_0x627e('0x3e')]);_0x3a459a['filters']=_[_0x627e('0x3f')](_0x3a459a[_0x627e('0x3d')],_0x3a459a[_0x627e('0x3e')]);_0x17dc15[_0x627e('0x40')]=_[_0x627e('0x3f')](_0x3a459a[_0x627e('0x3d')],qs['fields'](_0x5e3187['query'][_0x627e('0x41')]));_0x17dc15[_0x627e('0x40')]=_0x17dc15[_0x627e('0x40')][_0x627e('0x42')]?_0x17dc15[_0x627e('0x40')]:_0x3a459a[_0x627e('0x3d')];if(_0x5e3187[_0x627e('0x3e')][_0x627e('0x53')]){_0x17dc15[_0x627e('0x4d')]=[{'all':!![]}];}_0x17dc15=_[_0x627e('0x4b')]({},_0x17dc15,_0x5e3187[_0x627e('0x4c')]);return db[_0x627e('0x3a')][_0x627e('0x54')](_0x17dc15)[_0x627e('0x1d')](handleEntityNotFound(_0x1f8d23,null))[_0x627e('0x1d')](respondWithResult(_0x1f8d23,null))[_0x627e('0x50')](handleError(_0x1f8d23,null));};exports[_0x627e('0x55')]=function(_0x47d0f7,_0x182d43,_0x2fe21e){var _0x120b04;return db['sequelize'][_0x627e('0x56')](function(_0x3ed39c){return db[_0x627e('0x3a')][_0x627e('0x55')](_0x47d0f7[_0x627e('0x57')],{'raw':!![]})['then'](function(_0x280805){_0x120b04=_0x280805;return db[_0x627e('0x3a')][_0x627e('0x4e')]({'where':{'type':_0x47d0f7[_0x627e('0x57')]['type']},'raw':!![]});})[_0x627e('0x1d')](function(_0x3b25b2){if(_0x120b04[_0x627e('0x49')]['toUpperCase']()==_0x627e('0x58')){var _0xd55a61=fs[_0x627e('0x59')](path[_0x627e('0x5a')](config[_0x627e('0x5b')],'server/files/templates/stun_multiple.ejs'),'utf8');var _0xa162a9=ejs[_0x627e('0x5c')](_0xd55a61,{'networks':_0x3b25b2||[]});fs[_0x627e('0x5d')](_0x627e('0x5e'),_0xa162a9);return respondWithRpcPromise('Reload',_0x627e('0x55'),{'module':'res_stun_monitor.so'});}else if(_0x120b04[_0x627e('0x49')][_0x627e('0x5f')]()=='TURN'){var _0x19ceda=fs[_0x627e('0x59')](path[_0x627e('0x5a')](config[_0x627e('0x5b')],_0x627e('0x60')),_0x627e('0x61'));var _0x17272c=ejs[_0x627e('0x5c')](_0x19ceda,{'networks':_0x3b25b2||[]});fs[_0x627e('0x5d')](_0x627e('0x62'),_0x17272c);return respondWithRpcPromise('Reload',_0x627e('0x55'),{'module':'res_stun_monitor.so'});}else{var _0xa51ecb=fs[_0x627e('0x59')](path['join'](config[_0x627e('0x5b')],_0x627e('0x63')),'utf8');var _0x25a951=ejs['render'](_0xa51ecb,{'networks':_0x3b25b2||[]});fs['writeFileSync'](util['format'](_0x627e('0x64'),_0x47d0f7[_0x627e('0x57')][_0x627e('0x49')]['toLowerCase']()),_0x25a951);return respondWithRpcPromise(_0x627e('0x65'),_0x627e('0x55'),{'module':_0x627e('0x66')});}return null;})['then'](function(){return _0x120b04;});})['then'](respondWithResult(_0x182d43,0xc9))['catch'](handleError(_0x182d43,null));};exports[_0x627e('0x32')]=function(_0x47dffe,_0x4c0819,_0x500c1f){var _0x284eb5;return db[_0x627e('0x67')][_0x627e('0x56')](function(_0x43b278){return db[_0x627e('0x3a')][_0x627e('0x54')]({'where':{'id':_0x47dffe['params']['id']}})[_0x627e('0x1d')](handleEntityNotFound(_0x4c0819,null))[_0x627e('0x1d')](saveUpdates(_0x47dffe[_0x627e('0x57')],null))[_0x627e('0x1d')](function(_0x23624b){if(_0x23624b){_0x284eb5=_0x23624b;return db[_0x627e('0x3a')]['findAll']({'where':{'type':_0x284eb5[_0x627e('0x49')]},'raw':!![]});}return null;})[_0x627e('0x1d')](function(_0x39c5aa){if(_0x284eb5[_0x627e('0x49')]['toUpperCase']()==_0x627e('0x58')){var _0xc47d22=fs['readFileSync'](path[_0x627e('0x5a')](config[_0x627e('0x5b')],_0x627e('0x68')),_0x627e('0x61'));var _0x5dadd7=ejs['render'](_0xc47d22,{'networks':_0x39c5aa||[]});fs[_0x627e('0x5d')](_0x627e('0x5e'),_0x5dadd7);return respondWithRpcPromise('Reload',_0x627e('0x32'),{'module':_0x627e('0x69')});}else if(_0x284eb5[_0x627e('0x49')][_0x627e('0x5f')]()==_0x627e('0x6a')){var _0x12527e=fs[_0x627e('0x59')](path['join'](config['root'],'server/files/templates/turn_multiple.ejs'),_0x627e('0x61'));var _0x4f6d85=ejs[_0x627e('0x5c')](_0x12527e,{'networks':_0x39c5aa||[]});fs[_0x627e('0x5d')]('/etc/asterisk/turn_xcally.conf',_0x4f6d85);return respondWithRpcPromise(_0x627e('0x65'),_0x627e('0x32'),{'module':_0x627e('0x69')});}else{var _0x563e57=fs[_0x627e('0x59')](path[_0x627e('0x5a')](config['root'],_0x627e('0x63')),'utf8');var _0x2fa1f5=ejs['render'](_0x563e57,{'networks':_0x39c5aa||[]});fs[_0x627e('0x5d')](util['format'](_0x627e('0x64'),_0x47dffe[_0x627e('0x57')]['type'][_0x627e('0x6b')]()),_0x2fa1f5);return respondWithRpcPromise(_0x627e('0x65'),'update',{'module':_0x627e('0x66')});}return null;})[_0x627e('0x1d')](function(_0x67f000){if(_0x67f000){return _0x284eb5;}return null;});})[_0x627e('0x1d')](respondWithResult(_0x4c0819,null))['catch'](handleError(_0x4c0819,null));};exports[_0x627e('0x33')]=function(_0x31e56d,_0x43e96d,_0x389476){var _0x604d30;return db[_0x627e('0x3a')][_0x627e('0x54')]({'where':{'id':_0x31e56d[_0x627e('0x6c')]['id']}})[_0x627e('0x1d')](function(_0x484062){_0x604d30=_0x484062;return _0x484062;})[_0x627e('0x1d')](handleEntityNotFound(_0x43e96d,null))['then'](removeEntity(_0x43e96d,null))['then'](function(){if(_0x604d30){return db[_0x627e('0x3a')][_0x627e('0x4e')]({'where':{'type':_0x604d30[_0x627e('0x49')]},'raw':!![]});}})['then'](function(_0x143679){if(_0x604d30['type'][_0x627e('0x5f')]()==_0x627e('0x58')){var _0x209f3f=fs[_0x627e('0x59')](path[_0x627e('0x5a')](config[_0x627e('0x5b')],'server/files/templates/stun_multiple.ejs'),_0x627e('0x61'));var _0x3f4fa3=ejs[_0x627e('0x5c')](_0x209f3f,{'networks':_0x143679||[]});fs[_0x627e('0x5d')](_0x627e('0x5e'),_0x3f4fa3);return respondWithRpcPromise(_0x627e('0x65'),_0x627e('0x33'),{'module':_0x627e('0x69')});}else if(_0x604d30[_0x627e('0x49')][_0x627e('0x5f')]()==_0x627e('0x6a')){var _0x22cd7b=fs[_0x627e('0x59')](path['join'](config['root'],_0x627e('0x60')),_0x627e('0x61'));var _0x273b79=ejs[_0x627e('0x5c')](_0x22cd7b,{'networks':_0x143679||[]});fs['writeFileSync'](_0x627e('0x62'),_0x273b79);return respondWithRpcPromise(_0x627e('0x65'),'destroy',{'module':_0x627e('0x69')});}else{var _0x509d73=fs['readFileSync'](path[_0x627e('0x5a')](config['root'],_0x627e('0x63')),_0x627e('0x61'));var _0xc69ce3=ejs['render'](_0x509d73,{'networks':_0x143679||[]});fs[_0x627e('0x5d')](util[_0x627e('0x6d')](_0x627e('0x64'),_0x31e56d[_0x627e('0x57')][_0x627e('0x49')][_0x627e('0x6b')]()),_0xc69ce3);return respondWithRpcPromise(_0x627e('0x65'),'destroy',{'module':_0x627e('0x66')});}return null;})[_0x627e('0x50')](handleError(_0x43e96d,null));}; \ No newline at end of file +var _0x4cdb=['offset','undefined','limit','count','apply','save','update','then','name','Network','fieldName','type','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','map','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','rawAttributes','fields','include','create','sequelize','transaction','body','toUpperCase','STUN','readFileSync','join','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','root','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','toLowerCase','chan_sip.so','destroy','find','/etc/asterisk/sip_xcally_%s.conf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','client','http','request','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','end','status','json'];(function(_0x1db537,_0xbb805d){var _0x4474dc=function(_0x6f694b){while(--_0x6f694b){_0x1db537['push'](_0x1db537['shift']());}};_0x4474dc(++_0xbb805d);}(_0x4cdb,0x182));var _0xb4cd=function(_0x26d6d9,_0x431cb8){_0x26d6d9=_0x26d6d9-0x0;var _0x1b4875=_0x4cdb[_0x26d6d9];return _0x1b4875;};'use strict';var emlformat=require(_0xb4cd('0x0'));var rimraf=require(_0xb4cd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb4cd('0x2'));var moment=require('moment');var BPromise=require(_0xb4cd('0x3'));var Mustache=require(_0xb4cd('0x4'));var util=require(_0xb4cd('0x5'));var path=require(_0xb4cd('0x6'));var sox=require(_0xb4cd('0x7'));var csv=require(_0xb4cd('0x8'));var ejs=require(_0xb4cd('0x9'));var fs=require('fs');var fs_extra=require(_0xb4cd('0xa'));var _=require(_0xb4cd('0xb'));var squel=require(_0xb4cd('0xc'));var crypto=require(_0xb4cd('0xd'));var jsforce=require(_0xb4cd('0xe'));var deskjs=require(_0xb4cd('0xf'));var toCsv=require(_0xb4cd('0x8'));var querystring=require(_0xb4cd('0x10'));var Papa=require(_0xb4cd('0x11'));var Redis=require(_0xb4cd('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb4cd('0x13'));var as=require(_0xb4cd('0x14'));var hardwareService=require(_0xb4cd('0x15'));var logger=require('../../config/logger')(_0xb4cd('0x16'));var utils=require('../../config/utils');var config=require(_0xb4cd('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xb4cd('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xb4cd('0x19')][_0xb4cd('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x56cd6a,_0x55956c,_0x3d08b1,_0x42bdab){return new BPromise(function(_0xf4d962,_0x50289c){var _0x3ee819=_0x42bdab||client;return _0x3ee819[_0xb4cd('0x1b')](_0x56cd6a,_0x3d08b1)['then'](function(_0x299ef9){logger[_0xb4cd('0x1c')](_0xb4cd('0x1d'),_0x55956c,_0xb4cd('0x1e'));logger[_0xb4cd('0x1f')](_0xb4cd('0x20'),_0x55956c,_0xb4cd('0x1e'),JSON[_0xb4cd('0x21')](_0x299ef9));if(_0x299ef9[_0xb4cd('0x22')]){if(_0x299ef9[_0xb4cd('0x22')][_0xb4cd('0x23')]===0x1f4){logger[_0xb4cd('0x22')](_0xb4cd('0x1d'),_0x55956c,_0x299ef9[_0xb4cd('0x22')][_0xb4cd('0x24')]);return _0x50289c(_0x299ef9[_0xb4cd('0x22')]['message']);}logger[_0xb4cd('0x22')]('Network,\x20%s,\x20%s',_0x55956c,_0x299ef9[_0xb4cd('0x22')][_0xb4cd('0x24')]);return _0xf4d962(_0x299ef9[_0xb4cd('0x22')][_0xb4cd('0x24')]);}else{logger[_0xb4cd('0x1c')]('Network,\x20%s,\x20%s',_0x55956c,_0xb4cd('0x1e'));_0xf4d962(_0x299ef9[_0xb4cd('0x25')][_0xb4cd('0x24')]);}})['catch'](function(_0x2ef72d){logger[_0xb4cd('0x22')]('Network,\x20%s,\x20%s',_0x55956c,_0x2ef72d);_0x50289c(_0x2ef72d);});});}function respondWithStatusCode(_0x41caf7,_0x2afbb2){_0x2afbb2=_0x2afbb2||0xcc;return function(_0x512822){if(_0x512822){return _0x41caf7[_0xb4cd('0x26')](_0x2afbb2);}return _0x41caf7['status'](_0x2afbb2)[_0xb4cd('0x27')]();};}function respondWithResult(_0x4a3785,_0x2fc9ec){_0x2fc9ec=_0x2fc9ec||0xc8;return function(_0xd15bdc){if(_0xd15bdc){return _0x4a3785[_0xb4cd('0x28')](_0x2fc9ec)[_0xb4cd('0x29')](_0xd15bdc);}};}function respondWithFilteredResult(_0x2f553e,_0x4b2fad){return function(_0x155826){if(_0x155826){var _0x1ec10b=typeof _0x4b2fad[_0xb4cd('0x2a')]===_0xb4cd('0x2b')&&typeof _0x4b2fad[_0xb4cd('0x2c')]==='undefined';var _0x325447=_0x155826[_0xb4cd('0x2d')];var _0x256c25=_0x1ec10b?0x0:_0x4b2fad[_0xb4cd('0x2a')];var _0x2bb00f=_0x1ec10b?_0x155826[_0xb4cd('0x2d')]:_0x4b2fad[_0xb4cd('0x2a')]+_0x4b2fad[_0xb4cd('0x2c')];var _0x5427ca;if(_0x2bb00f>=_0x325447){_0x2bb00f=_0x325447;_0x5427ca=0xc8;}else{_0x5427ca=0xce;}_0x2f553e['status'](_0x5427ca);return _0x2f553e['set']('Content-Range',_0x256c25+'-'+_0x2bb00f+'/'+_0x325447)[_0xb4cd('0x29')](_0x155826);}return null;};}function patchUpdates(_0x19d9be){return function(_0x2d0d9c){try{jsonpatch[_0xb4cd('0x2e')](_0x2d0d9c,_0x19d9be,!![]);}catch(_0x32c093){return BPromise['reject'](_0x32c093);}return _0x2d0d9c[_0xb4cd('0x2f')]();};}function saveUpdates(_0x338f7d,_0x4d7cce){return function(_0x12dfe2){if(_0x12dfe2){return _0x12dfe2[_0xb4cd('0x30')](_0x338f7d)['then'](function(_0x10f21d){return _0x10f21d;});}return null;};}function removeEntity(_0x19c22f,_0x342ebb){return function(_0x373a18){if(_0x373a18){return _0x373a18['destroy']()[_0xb4cd('0x31')](function(){_0x19c22f[_0xb4cd('0x28')](0xcc)[_0xb4cd('0x27')]();});}};}function handleEntityNotFound(_0x3ad5fb,_0x5747b4){return function(_0x42effc){if(!_0x42effc){_0x3ad5fb[_0xb4cd('0x26')](0x194);}return _0x42effc;};}function handleError(_0x424951,_0x4e7c79){_0x4e7c79=_0x4e7c79||0x1f4;return function(_0x169f08){logger[_0xb4cd('0x22')](_0x169f08['stack']);if(_0x169f08[_0xb4cd('0x32')]){delete _0x169f08[_0xb4cd('0x32')];}_0x424951[_0xb4cd('0x28')](_0x4e7c79)['send'](_0x169f08);};}exports['index']=function(_0x189147,_0x35ee81){var _0x179909={},_0x57d14a={},_0x5dce02={'count':0x0,'rows':[]};var _0x2b693d=_['map'](db[_0xb4cd('0x33')]['rawAttributes'],function(_0x56b65c){return{'name':_0x56b65c[_0xb4cd('0x34')],'type':_0x56b65c[_0xb4cd('0x35')][_0xb4cd('0x36')]};});_0x57d14a['model']=_['map'](_0x2b693d,'name');_0x57d14a[_0xb4cd('0x37')]=_[_0xb4cd('0x38')](_0x189147[_0xb4cd('0x37')]);_0x57d14a[_0xb4cd('0x39')]=_[_0xb4cd('0x3a')](_0x57d14a[_0xb4cd('0x3b')],_0x57d14a[_0xb4cd('0x37')]);_0x179909[_0xb4cd('0x3c')]=_[_0xb4cd('0x3a')](_0x57d14a[_0xb4cd('0x3b')],qs['fields'](_0x189147[_0xb4cd('0x37')]['fields']));_0x179909[_0xb4cd('0x3c')]=_0x179909[_0xb4cd('0x3c')][_0xb4cd('0x3d')]?_0x179909['attributes']:_0x57d14a[_0xb4cd('0x3b')];if(!_0x189147['query'][_0xb4cd('0x3e')](_0xb4cd('0x3f'))){_0x179909[_0xb4cd('0x2c')]=qs[_0xb4cd('0x2c')](_0x189147['query']['limit']);_0x179909[_0xb4cd('0x2a')]=qs[_0xb4cd('0x2a')](_0x189147[_0xb4cd('0x37')]['offset']);}_0x179909['order']=qs[_0xb4cd('0x40')](_0x189147['query'][_0xb4cd('0x40')]);_0x179909['where']=qs[_0xb4cd('0x39')](_[_0xb4cd('0x41')](_0x189147[_0xb4cd('0x37')],_0x57d14a[_0xb4cd('0x39')]),_0x2b693d);if(_0x189147[_0xb4cd('0x37')][_0xb4cd('0x42')]){_0x179909[_0xb4cd('0x43')]=_[_0xb4cd('0x44')](_0x179909[_0xb4cd('0x43')],{'$or':_[_0xb4cd('0x45')](_0x2b693d,function(_0x39cc71){if(_0x39cc71[_0xb4cd('0x35')]!==_0xb4cd('0x46')){var _0x5add3e={};_0x5add3e[_0x39cc71[_0xb4cd('0x32')]]={'$like':'%'+_0x189147[_0xb4cd('0x37')]['filter']+'%'};return _0x5add3e;}})});}_0x179909=_['merge']({},_0x179909,_0x189147[_0xb4cd('0x47')]);var _0x3b5974={'where':_0x179909[_0xb4cd('0x43')]};return db[_0xb4cd('0x33')]['count'](_0x3b5974)[_0xb4cd('0x31')](function(_0x2e47ff){_0x5dce02[_0xb4cd('0x2d')]=_0x2e47ff;if(_0x189147[_0xb4cd('0x37')][_0xb4cd('0x48')]){_0x179909['include']=[{'all':!![]}];}return db[_0xb4cd('0x33')][_0xb4cd('0x49')](_0x179909);})[_0xb4cd('0x31')](function(_0x5736dd){_0x5dce02[_0xb4cd('0x4a')]=_0x5736dd;return _0x5dce02;})[_0xb4cd('0x31')](respondWithFilteredResult(_0x35ee81,_0x179909))[_0xb4cd('0x4b')](handleError(_0x35ee81,null));};exports[_0xb4cd('0x4c')]=function(_0xe118a,_0x3d1ce7){var _0x1bf73b={'raw':!![],'where':{'id':_0xe118a[_0xb4cd('0x4d')]['id']}},_0x59aa1c={};_0x59aa1c['model']=_[_0xb4cd('0x38')](db[_0xb4cd('0x33')][_0xb4cd('0x4e')]);_0x59aa1c[_0xb4cd('0x37')]=_[_0xb4cd('0x38')](_0xe118a[_0xb4cd('0x37')]);_0x59aa1c['filters']=_['intersection'](_0x59aa1c[_0xb4cd('0x3b')],_0x59aa1c['query']);_0x1bf73b[_0xb4cd('0x3c')]=_[_0xb4cd('0x3a')](_0x59aa1c[_0xb4cd('0x3b')],qs[_0xb4cd('0x4f')](_0xe118a[_0xb4cd('0x37')][_0xb4cd('0x4f')]));_0x1bf73b[_0xb4cd('0x3c')]=_0x1bf73b['attributes'][_0xb4cd('0x3d')]?_0x1bf73b[_0xb4cd('0x3c')]:_0x59aa1c[_0xb4cd('0x3b')];if(_0xe118a[_0xb4cd('0x37')][_0xb4cd('0x48')]){_0x1bf73b[_0xb4cd('0x50')]=[{'all':!![]}];}_0x1bf73b=_['merge']({},_0x1bf73b,_0xe118a[_0xb4cd('0x47')]);return db[_0xb4cd('0x33')]['find'](_0x1bf73b)[_0xb4cd('0x31')](handleEntityNotFound(_0x3d1ce7,null))['then'](respondWithResult(_0x3d1ce7,null))[_0xb4cd('0x4b')](handleError(_0x3d1ce7,null));};exports[_0xb4cd('0x51')]=function(_0x631626,_0x475a4b,_0x2f007a){var _0xa815ff;return db[_0xb4cd('0x52')][_0xb4cd('0x53')](function(_0x255d48){return db[_0xb4cd('0x33')][_0xb4cd('0x51')](_0x631626[_0xb4cd('0x54')],{'raw':!![]})[_0xb4cd('0x31')](function(_0x19f2e5){_0xa815ff=_0x19f2e5;return db['Network']['findAll']({'where':{'type':_0x631626[_0xb4cd('0x54')][_0xb4cd('0x35')]},'raw':!![]});})[_0xb4cd('0x31')](function(_0x4ef5e4){if(_0xa815ff[_0xb4cd('0x35')][_0xb4cd('0x55')]()==_0xb4cd('0x56')){var _0x5d2b70=fs[_0xb4cd('0x57')](path[_0xb4cd('0x58')](config['root'],_0xb4cd('0x59')),_0xb4cd('0x5a'));var _0x7683d2=ejs[_0xb4cd('0x5b')](_0x5d2b70,{'networks':_0x4ef5e4||[]});fs[_0xb4cd('0x5c')](_0xb4cd('0x5d'),_0x7683d2);return respondWithRpcPromise(_0xb4cd('0x5e'),_0xb4cd('0x51'),{'module':_0xb4cd('0x5f')});}else if(_0xa815ff['type'][_0xb4cd('0x55')]()==_0xb4cd('0x60')){var _0x2ee352=fs[_0xb4cd('0x57')](path[_0xb4cd('0x58')](config[_0xb4cd('0x61')],_0xb4cd('0x62')),'utf8');var _0x1a17a7=ejs['render'](_0x2ee352,{'networks':_0x4ef5e4||[]});fs[_0xb4cd('0x5c')](_0xb4cd('0x63'),_0x1a17a7);return respondWithRpcPromise(_0xb4cd('0x5e'),'create',{'module':'res_stun_monitor.so'});}else{var _0x4a8c3e=fs[_0xb4cd('0x57')](path['join'](config[_0xb4cd('0x61')],_0xb4cd('0x64')),_0xb4cd('0x5a'));var _0x21a85f=ejs[_0xb4cd('0x5b')](_0x4a8c3e,{'networks':_0x4ef5e4||[]});fs[_0xb4cd('0x5c')](util[_0xb4cd('0x65')]('/etc/asterisk/sip_xcally_%s.conf',_0x631626[_0xb4cd('0x54')][_0xb4cd('0x35')][_0xb4cd('0x66')]()),_0x21a85f);return respondWithRpcPromise(_0xb4cd('0x5e'),_0xb4cd('0x51'),{'module':_0xb4cd('0x67')});}return null;})[_0xb4cd('0x31')](function(){return _0xa815ff;});})[_0xb4cd('0x31')](respondWithResult(_0x475a4b,0xc9))['catch'](handleError(_0x475a4b,null));};exports['update']=function(_0x1b0d8e,_0x4c51aa,_0x4ae5a2){var _0xf18b06;return db[_0xb4cd('0x52')][_0xb4cd('0x53')](function(_0x165217){return db[_0xb4cd('0x33')]['find']({'where':{'id':_0x1b0d8e[_0xb4cd('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4c51aa,null))[_0xb4cd('0x31')](saveUpdates(_0x1b0d8e[_0xb4cd('0x54')],null))[_0xb4cd('0x31')](function(_0xba69d9){if(_0xba69d9){_0xf18b06=_0xba69d9;return db[_0xb4cd('0x33')]['findAll']({'where':{'type':_0xf18b06[_0xb4cd('0x35')]},'raw':!![]});}return null;})[_0xb4cd('0x31')](function(_0x5dadac){if(_0xf18b06[_0xb4cd('0x35')]['toUpperCase']()=='STUN'){var _0x36f800=fs[_0xb4cd('0x57')](path[_0xb4cd('0x58')](config['root'],_0xb4cd('0x59')),_0xb4cd('0x5a'));var _0x495c7a=ejs['render'](_0x36f800,{'networks':_0x5dadac||[]});fs[_0xb4cd('0x5c')]('/etc/asterisk/stun_xcally.conf',_0x495c7a);return respondWithRpcPromise(_0xb4cd('0x5e'),'update',{'module':_0xb4cd('0x5f')});}else if(_0xf18b06[_0xb4cd('0x35')][_0xb4cd('0x55')]()==_0xb4cd('0x60')){var _0x2b3316=fs[_0xb4cd('0x57')](path['join'](config[_0xb4cd('0x61')],'server/files/templates/turn_multiple.ejs'),_0xb4cd('0x5a'));var _0xcb2b3c=ejs[_0xb4cd('0x5b')](_0x2b3316,{'networks':_0x5dadac||[]});fs[_0xb4cd('0x5c')](_0xb4cd('0x63'),_0xcb2b3c);return respondWithRpcPromise(_0xb4cd('0x5e'),'update',{'module':_0xb4cd('0x5f')});}else{var _0x374f1b=fs[_0xb4cd('0x57')](path[_0xb4cd('0x58')](config['root'],_0xb4cd('0x64')),_0xb4cd('0x5a'));var _0xbee3d6=ejs[_0xb4cd('0x5b')](_0x374f1b,{'networks':_0x5dadac||[]});fs['writeFileSync'](util[_0xb4cd('0x65')]('/etc/asterisk/sip_xcally_%s.conf',_0x1b0d8e[_0xb4cd('0x54')][_0xb4cd('0x35')][_0xb4cd('0x66')]()),_0xbee3d6);return respondWithRpcPromise(_0xb4cd('0x5e'),_0xb4cd('0x30'),{'module':'chan_sip.so'});}return null;})[_0xb4cd('0x31')](function(_0x51893b){if(_0x51893b){return _0xf18b06;}return null;});})[_0xb4cd('0x31')](respondWithResult(_0x4c51aa,null))[_0xb4cd('0x4b')](handleError(_0x4c51aa,null));};exports[_0xb4cd('0x68')]=function(_0x5b3411,_0x421a0a,_0x2ca642){var _0xad6119;return db[_0xb4cd('0x33')][_0xb4cd('0x69')]({'where':{'id':_0x5b3411[_0xb4cd('0x4d')]['id']}})[_0xb4cd('0x31')](function(_0x693f64){_0xad6119=_0x693f64;return _0x693f64;})['then'](handleEntityNotFound(_0x421a0a,null))[_0xb4cd('0x31')](removeEntity(_0x421a0a,null))[_0xb4cd('0x31')](function(){if(_0xad6119){return db[_0xb4cd('0x33')][_0xb4cd('0x49')]({'where':{'type':_0xad6119[_0xb4cd('0x35')]},'raw':!![]});}})[_0xb4cd('0x31')](function(_0x23891c){if(_0xad6119[_0xb4cd('0x35')][_0xb4cd('0x55')]()==_0xb4cd('0x56')){var _0x3ad0b2=fs[_0xb4cd('0x57')](path[_0xb4cd('0x58')](config[_0xb4cd('0x61')],'server/files/templates/stun_multiple.ejs'),_0xb4cd('0x5a'));var _0x42fc7a=ejs[_0xb4cd('0x5b')](_0x3ad0b2,{'networks':_0x23891c||[]});fs[_0xb4cd('0x5c')]('/etc/asterisk/stun_xcally.conf',_0x42fc7a);return respondWithRpcPromise('Reload',_0xb4cd('0x68'),{'module':_0xb4cd('0x5f')});}else if(_0xad6119[_0xb4cd('0x35')][_0xb4cd('0x55')]()==_0xb4cd('0x60')){var _0x2cd264=fs['readFileSync'](path[_0xb4cd('0x58')](config[_0xb4cd('0x61')],_0xb4cd('0x62')),_0xb4cd('0x5a'));var _0x4a2b2a=ejs['render'](_0x2cd264,{'networks':_0x23891c||[]});fs[_0xb4cd('0x5c')](_0xb4cd('0x63'),_0x4a2b2a);return respondWithRpcPromise('Reload',_0xb4cd('0x68'),{'module':_0xb4cd('0x5f')});}else{var _0x108539=fs['readFileSync'](path['join'](config[_0xb4cd('0x61')],_0xb4cd('0x64')),_0xb4cd('0x5a'));var _0x25495b=ejs[_0xb4cd('0x5b')](_0x108539,{'networks':_0x23891c||[]});fs[_0xb4cd('0x5c')](util['format'](_0xb4cd('0x6a'),_0x5b3411[_0xb4cd('0x54')][_0xb4cd('0x35')][_0xb4cd('0x66')]()),_0x25495b);return respondWithRpcPromise(_0xb4cd('0x5e'),_0xb4cd('0x68'),{'module':_0xb4cd('0x67')});}return null;})[_0xb4cd('0x4b')](handleError(_0x421a0a,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 34b1e56..e07802c 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 _0x0db9=['network','lodash','moment','bluebird','path','../../config/environment','./network.attributes','define','Network'];(function(_0x532d47,_0x1a4c97){var _0xed19c1=function(_0x1c6a2c){while(--_0x1c6a2c){_0x532d47['push'](_0x532d47['shift']());}};_0xed19c1(++_0x1a4c97);}(_0x0db9,0xa3));var _0x90db=function(_0x32b30c,_0x2d5ec8){_0x32b30c=_0x32b30c-0x0;var _0xcfc212=_0x0db9[_0x32b30c];return _0xcfc212;};'use strict';var _=require(_0x90db('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x90db('0x1'));var BPromise=require(_0x90db('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x90db('0x3'));var rimraf=require('rimraf');var config=require(_0x90db('0x4'));var attributes=require(_0x90db('0x5'));module['exports']=function(_0x2d02a1,_0x242774){return _0x2d02a1[_0x90db('0x6')](_0x90db('0x7'),attributes,{'tableName':_0x90db('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x55ea=['./network.attributes','Network','network','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0xfe7f82,_0x33de23){var _0x9bf193=function(_0x1e60c7){while(--_0x1e60c7){_0xfe7f82['push'](_0xfe7f82['shift']());}};_0x9bf193(++_0x33de23);}(_0x55ea,0xc9));var _0xa55e=function(_0x5c86f2,_0x464b85){_0x5c86f2=_0x5c86f2-0x0;var _0x1d2c66=_0x55ea[_0x5c86f2];return _0x1d2c66;};'use strict';var _=require(_0xa55e('0x0'));var util=require(_0xa55e('0x1'));var logger=require(_0xa55e('0x2'))('api');var moment=require(_0xa55e('0x3'));var BPromise=require(_0xa55e('0x4'));var rp=require(_0xa55e('0x5'));var fs=require('fs');var path=require(_0xa55e('0x6'));var rimraf=require(_0xa55e('0x7'));var config=require('../../config/environment');var attributes=require(_0xa55e('0x8'));module['exports']=function(_0x515646,_0x588751){return _0x515646['define'](_0xa55e('0x9'),attributes,{'tableName':_0xa55e('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 9ee5131..feefb2c 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 _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(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x7a54,0x106));var _0x47a5=function(_0x2e8d1d,_0x28b649){_0x2e8d1d=_0x2e8d1d-0x0;var _0x237805=_0x7a54[_0x2e8d1d];return _0x237805;};'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 +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(_0x5153e2,_0x4afedb){var _0x18807d=function(_0x3f2059){while(--_0x3f2059){_0x5153e2['push'](_0x5153e2['shift']());}};_0x18807d(++_0x4afedb);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'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 diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index f3b5533..90674e9 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 _0x6880=['removeAgents','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','getApplications','post','create','addAnswer','notify','/:id/applications','addApplications','/:id/users','addAgents','/:id/send','send','update','delete','destroy','removeDispositions'];(function(_0x5ede63,_0x3721ef){var _0x154318=function(_0x50ef23){while(--_0x50ef23){_0x5ede63['push'](_0x5ede63['shift']());}};_0x154318(++_0x3721ef);}(_0x6880,0x86));var _0x0688=function(_0x89ebd5,_0x55d6d6){_0x89ebd5=_0x89ebd5-0x0;var _0x35586b=_0x6880[_0x89ebd5];return _0x35586b;};'use strict';var multer=require(_0x0688('0x0'));var util=require(_0x0688('0x1'));var path=require(_0x0688('0x2'));var timeout=require('connect-timeout');var express=require(_0x0688('0x3'));var router=express['Router']();var fs_extra=require(_0x0688('0x4'));var auth=require(_0x0688('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0688('0x6'));var controller=require('./openchannelAccount.controller');router[_0x0688('0x7')]('/',auth[_0x0688('0x8')](),controller[_0x0688('0x9')]);router[_0x0688('0x7')]('/describe',auth[_0x0688('0x8')](),controller[_0x0688('0xa')]);router['get'](_0x0688('0xb'),auth[_0x0688('0x8')](),controller[_0x0688('0xc')]);router[_0x0688('0x7')](_0x0688('0xd'),auth[_0x0688('0x8')](),controller['getDispositions']);router[_0x0688('0x7')](_0x0688('0xe'),auth[_0x0688('0x8')](),controller[_0x0688('0xf')]);router['get']('/:id/applications',auth['isAuthenticated'](),controller[_0x0688('0x10')]);router['get']('/:id/interactions',auth[_0x0688('0x8')](),controller['getInteractions']);router[_0x0688('0x7')]('/:id/users',auth[_0x0688('0x8')](),controller['getAgents']);router[_0x0688('0x11')]('/',auth[_0x0688('0x8')](),controller[_0x0688('0x12')]);router[_0x0688('0x11')]('/:id/dispositions',auth[_0x0688('0x8')](),controller['addDisposition']);router[_0x0688('0x11')](_0x0688('0xe'),auth[_0x0688('0x8')](),controller[_0x0688('0x13')]);router[_0x0688('0x11')]('/:id/notify',controller[_0x0688('0x14')]);router[_0x0688('0x11')](_0x0688('0x15'),auth[_0x0688('0x8')](),controller[_0x0688('0x16')]);router['post'](_0x0688('0x17'),auth[_0x0688('0x8')](),controller[_0x0688('0x18')]);router[_0x0688('0x11')](_0x0688('0x19'),auth[_0x0688('0x8')](),controller[_0x0688('0x1a')]);router['put'](_0x0688('0xb'),auth['isAuthenticated'](),controller[_0x0688('0x1b')]);router[_0x0688('0x1c')]('/:id',auth[_0x0688('0x8')](),controller[_0x0688('0x1d')]);router[_0x0688('0x1c')](_0x0688('0xd'),auth[_0x0688('0x8')](),controller[_0x0688('0x1e')]);router[_0x0688('0x1c')](_0x0688('0xe'),auth[_0x0688('0x8')](),controller['removeAnswers']);router[_0x0688('0x1c')](_0x0688('0x17'),auth[_0x0688('0x8')](),controller[_0x0688('0x1f')]);module[_0x0688('0x20')]=router; \ No newline at end of file +var _0x5d2a=['/:id','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','post','create','addDisposition','addAnswer','/:id/notify','addAgents','/:id/send','put','update','delete'];(function(_0x4c676c,_0x36a04e){var _0x1c0a43=function(_0x425a9c){while(--_0x425a9c){_0x4c676c['push'](_0x4c676c['shift']());}};_0x1c0a43(++_0x36a04e);}(_0x5d2a,0x1d4));var _0xa5d2=function(_0x48e5e9,_0x47277d){_0x48e5e9=_0x48e5e9-0x0;var _0x38acd0=_0x5d2a[_0x48e5e9];return _0x38acd0;};'use strict';var multer=require(_0xa5d2('0x0'));var util=require(_0xa5d2('0x1'));var path=require(_0xa5d2('0x2'));var timeout=require(_0xa5d2('0x3'));var express=require(_0xa5d2('0x4'));var router=express[_0xa5d2('0x5')]();var fs_extra=require(_0xa5d2('0x6'));var auth=require(_0xa5d2('0x7'));var interaction=require(_0xa5d2('0x8'));var config=require(_0xa5d2('0x9'));var controller=require(_0xa5d2('0xa'));router[_0xa5d2('0xb')]('/',auth[_0xa5d2('0xc')](),controller[_0xa5d2('0xd')]);router['get'](_0xa5d2('0xe'),auth[_0xa5d2('0xc')](),controller[_0xa5d2('0xf')]);router[_0xa5d2('0xb')]('/:id',auth[_0xa5d2('0xc')](),controller[_0xa5d2('0x10')]);router[_0xa5d2('0xb')](_0xa5d2('0x11'),auth[_0xa5d2('0xc')](),controller['getDispositions']);router[_0xa5d2('0xb')](_0xa5d2('0x12'),auth[_0xa5d2('0xc')](),controller[_0xa5d2('0x13')]);router[_0xa5d2('0xb')](_0xa5d2('0x14'),auth[_0xa5d2('0xc')](),controller[_0xa5d2('0x15')]);router[_0xa5d2('0xb')](_0xa5d2('0x16'),auth[_0xa5d2('0xc')](),controller[_0xa5d2('0x17')]);router[_0xa5d2('0xb')](_0xa5d2('0x18'),auth[_0xa5d2('0xc')](),controller[_0xa5d2('0x19')]);router[_0xa5d2('0x1a')]('/',auth[_0xa5d2('0xc')](),controller[_0xa5d2('0x1b')]);router[_0xa5d2('0x1a')](_0xa5d2('0x11'),auth[_0xa5d2('0xc')](),controller[_0xa5d2('0x1c')]);router['post'](_0xa5d2('0x12'),auth[_0xa5d2('0xc')](),controller[_0xa5d2('0x1d')]);router[_0xa5d2('0x1a')](_0xa5d2('0x1e'),controller['notify']);router['post'](_0xa5d2('0x14'),auth[_0xa5d2('0xc')](),controller['addApplications']);router[_0xa5d2('0x1a')](_0xa5d2('0x18'),auth[_0xa5d2('0xc')](),controller[_0xa5d2('0x1f')]);router[_0xa5d2('0x1a')](_0xa5d2('0x20'),auth[_0xa5d2('0xc')](),controller['send']);router[_0xa5d2('0x21')]('/:id',auth[_0xa5d2('0xc')](),controller[_0xa5d2('0x22')]);router[_0xa5d2('0x23')](_0xa5d2('0x24'),auth[_0xa5d2('0xc')](),controller[_0xa5d2('0x25')]);router[_0xa5d2('0x23')](_0xa5d2('0x11'),auth[_0xa5d2('0xc')](),controller[_0xa5d2('0x26')]);router['delete']('/:id/canned_answers',auth[_0xa5d2('0xc')](),controller[_0xa5d2('0x27')]);router['delete'](_0xa5d2('0x18'),auth['isAuthenticated'](),controller[_0xa5d2('0x28')]);module[_0xa5d2('0x29')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index a7f590f..80ea8dd 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 _0xba79=['sequelize','STRING','generate','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','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition'];(function(_0x9c7d6a,_0x1aa2cc){var _0x145395=function(_0x12c9ec){while(--_0x12c9ec){_0x9c7d6a['push'](_0x9c7d6a['shift']());}};_0x145395(++_0x1aa2cc);}(_0xba79,0xe4));var _0x9ba7=function(_0x5062da,_0x4400d2){_0x5062da=_0x5062da-0x0;var _0x46d327=_0xba79[_0x5062da];return _0x46d327;};'use strict';var Sequelize=require(_0x9ba7('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x9ba7('0x1')]},'token':{'type':Sequelize[_0x9ba7('0x1')],'defaultValue':function(){return rs[_0x9ba7('0x2')]();}},'replyUri':{'type':Sequelize[_0x9ba7('0x1')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x9ba7('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x9ba7('0x3')],'defaultValue':function(){return _0x9ba7('0x4');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x9ba7('0x5')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9ba7('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x9ba7('0x1')]},'queueTransfer':{'type':Sequelize[_0x9ba7('0x5')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9ba7('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9ba7('0x5')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9ba7('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9ba7('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0x9ba7('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x9ba7('0x5')],'defaultValue':![],'comment':_0x9ba7('0x8'),'set':function(_0x57ec85){if(!_0x57ec85)this['setDataValue'](_0x9ba7('0x9'),null);this[_0x9ba7('0xa')](_0x9ba7('0xb'),_0x57ec85);}}}; \ No newline at end of file +var _0x7a1e=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','sequelize','STRING','name','generate','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x1428d9,_0xded63c){var _0x438019=function(_0x31c37d){while(--_0x31c37d){_0x1428d9['push'](_0x1428d9['shift']());}};_0x438019(++_0xded63c);}(_0x7a1e,0x17e));var _0xe7a1=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0x7a1e[_0x4d8ed9];return _0x1e2140;};'use strict';var Sequelize=require(_0xe7a1('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0xe7a1('0x1')],'unique':_0xe7a1('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xe7a1('0x3')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xe7a1('0x4')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xe7a1('0x5')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xe7a1('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xe7a1('0x1')]},'queueTransfer':{'type':Sequelize[_0xe7a1('0x5')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xe7a1('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xe7a1('0x5')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xe7a1('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xe7a1('0x7')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xe7a1('0x8'),'set':function(_0x117ce8){if(!_0x117ce8)this[_0xe7a1('0x9')]('mandatoryDispositionPauseId',null);this[_0xe7a1('0x9')]('mandatoryDisposition',_0x117ce8);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index d80b195..9706d0b 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 _0x3c06=['info','OpenchannelAccount,\x20%s,\x20%s','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','destroy','OpenchannelAccounts','UserProfileResource','stack','name','send','index','mandatoryDispositionPause','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','OpenchannelAccount','includeAll','include','findAll','show','Pause','rawAttributes','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','describe','addDisposition','params','OpenchannelAccountId','Disposition','getDispositions','findOne','order','rows','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','notify','openchannel','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','ListId','isNil','from','Sequelize','from\x20is\x20mandatory','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','CmContact','Contacts','OpenchannelApplication','Applications','account','applications','orderBy','priority','asc','defaults','contact','firstName','lastName','threadId','externalUrl','OpenchannelInteraction','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','startRouting','EventManager','addApplications','sequelize','transaction','bulkCreate','getApplications','Contact','Owner','fullname','Tag','Tags','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','userOpenchannelAccount:remove','getAgents','CmList','DESC','out','Messages','spread','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','http','client','request','then'];(function(_0x502b13,_0x2ad398){var _0x39d36d=function(_0x556608){while(--_0x556608){_0x502b13['push'](_0x502b13['shift']());}};_0x39d36d(++_0x2ad398);}(_0x3c06,0x9e));var _0x63c0=function(_0x2e4d6b,_0x2750de){_0x2e4d6b=_0x2e4d6b-0x0;var _0x121440=_0x3c06[_0x2e4d6b];return _0x121440;};'use strict';var emlformat=require(_0x63c0('0x0'));var rimraf=require(_0x63c0('0x1'));var zipdir=require(_0x63c0('0x2'));var jsonpatch=require(_0x63c0('0x3'));var rp=require(_0x63c0('0x4'));var moment=require(_0x63c0('0x5'));var BPromise=require(_0x63c0('0x6'));var Mustache=require(_0x63c0('0x7'));var util=require(_0x63c0('0x8'));var path=require(_0x63c0('0x9'));var sox=require(_0x63c0('0xa'));var csv=require(_0x63c0('0xb'));var ejs=require(_0x63c0('0xc'));var fs=require('fs');var fs_extra=require(_0x63c0('0xd'));var _=require(_0x63c0('0xe'));var squel=require('squel');var crypto=require(_0x63c0('0xf'));var jsforce=require(_0x63c0('0x10'));var deskjs=require(_0x63c0('0x11'));var toCsv=require(_0x63c0('0xb'));var querystring=require(_0x63c0('0x12'));var Papa=require(_0x63c0('0x13'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x63c0('0x14'));var hardwareService=require(_0x63c0('0x15'));var logger=require('../../config/logger')(_0x63c0('0x16'));var utils=require(_0x63c0('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x63c0('0x18'));var db=require(_0x63c0('0x19'))['db'];config[_0x63c0('0x1a')]=_['defaults'](config[_0x63c0('0x1a')],{'host':_0x63c0('0x1b'),'port':0x18eb});var socket=require(_0x63c0('0x1c'))(new Redis(config[_0x63c0('0x1a')]));require(_0x63c0('0x1d'))[_0x63c0('0x1e')](socket);var jayson=require(_0x63c0('0x1f'));var client=jayson['client'][_0x63c0('0x20')]({'port':0x232c});var client9002=jayson[_0x63c0('0x21')][_0x63c0('0x20')]({'port':0x232a});function respondWithRpcPromise(_0xe9be2f,_0x3c4eb2,_0x1ff77e,_0x35cff5){return new BPromise(function(_0x3d25e2,_0x1712d5){var _0x285f52=_0x35cff5||client;return _0x285f52[_0x63c0('0x22')](_0xe9be2f,_0x1ff77e)[_0x63c0('0x23')](function(_0x3976c6){logger[_0x63c0('0x24')](_0x63c0('0x25'),_0x3c4eb2,'request\x20sent');logger[_0x63c0('0x26')](_0x63c0('0x27'),_0x3c4eb2,_0x63c0('0x28'),JSON['stringify'](_0x3976c6));if(_0x3976c6[_0x63c0('0x29')]){if(_0x3976c6['error'][_0x63c0('0x2a')]===0x1f4){logger[_0x63c0('0x29')]('OpenchannelAccount,\x20%s,\x20%s',_0x3c4eb2,_0x3976c6[_0x63c0('0x29')]['message']);return _0x1712d5(_0x3976c6['error'][_0x63c0('0x2b')]);}logger[_0x63c0('0x29')](_0x63c0('0x25'),_0x3c4eb2,_0x3976c6['error'][_0x63c0('0x2b')]);return _0x3d25e2(_0x3976c6[_0x63c0('0x29')]['message']);}else{logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x3c4eb2,_0x63c0('0x28'));_0x3d25e2(_0x3976c6[_0x63c0('0x2c')][_0x63c0('0x2b')]);}})[_0x63c0('0x2d')](function(_0x502b6c){logger[_0x63c0('0x29')](_0x63c0('0x25'),_0x3c4eb2,_0x502b6c);_0x1712d5(_0x502b6c);});});}function respondWithStatusCode(_0x14ba4f,_0x2eba13){_0x2eba13=_0x2eba13||0xcc;return function(_0x40ece5){if(_0x40ece5){return _0x14ba4f[_0x63c0('0x2e')](_0x2eba13);}return _0x14ba4f[_0x63c0('0x2f')](_0x2eba13)[_0x63c0('0x30')]();};}function respondWithResult(_0x5d6b08,_0x1b2a56){_0x1b2a56=_0x1b2a56||0xc8;return function(_0x45b150){if(_0x45b150){return _0x5d6b08[_0x63c0('0x2f')](_0x1b2a56)[_0x63c0('0x31')](_0x45b150);}};}function respondWithFilteredResult(_0x499549,_0xc077bb){return function(_0x3475ca){if(_0x3475ca){var _0x3e9fba=typeof _0xc077bb[_0x63c0('0x32')]===_0x63c0('0x33')&&typeof _0xc077bb['limit']===_0x63c0('0x33');var _0x1007e6=_0x3475ca[_0x63c0('0x34')];var _0x32542e=_0x3e9fba?0x0:_0xc077bb[_0x63c0('0x32')];var _0x2feee9=_0x3e9fba?_0x3475ca[_0x63c0('0x34')]:_0xc077bb[_0x63c0('0x32')]+_0xc077bb[_0x63c0('0x35')];var _0x4eca70;if(_0x2feee9>=_0x1007e6){_0x2feee9=_0x1007e6;_0x4eca70=0xc8;}else{_0x4eca70=0xce;}_0x499549[_0x63c0('0x2f')](_0x4eca70);return _0x499549[_0x63c0('0x36')](_0x63c0('0x37'),_0x32542e+'-'+_0x2feee9+'/'+_0x1007e6)[_0x63c0('0x31')](_0x3475ca);}return null;};}function patchUpdates(_0x78bd19){return function(_0x4dff7b){try{jsonpatch[_0x63c0('0x38')](_0x4dff7b,_0x78bd19,!![]);}catch(_0x87ffa0){return BPromise['reject'](_0x87ffa0);}return _0x4dff7b[_0x63c0('0x39')]();};}function saveUpdates(_0x5bc3c9,_0x3d6f88){return function(_0x12e48e){if(_0x12e48e){return _0x12e48e[_0x63c0('0x3a')](_0x5bc3c9)[_0x63c0('0x23')](function(_0x3c4c6c){return _0x3c4c6c;});}return null;};}function removeEntity(_0x542153,_0x2d6ccd){return function(_0x15f768){if(_0x15f768){return _0x15f768[_0x63c0('0x3b')]()[_0x63c0('0x23')](function(){var _0x144a10=_0x15f768['get']({'plain':!![]});var _0xd169be=_0x63c0('0x3c');return db[_0x63c0('0x3d')][_0x63c0('0x3b')]({'where':{'type':_0xd169be,'resourceId':_0x144a10['id']}})[_0x63c0('0x23')](function(){return _0x15f768;});})[_0x63c0('0x23')](function(){_0x542153[_0x63c0('0x2f')](0xcc)[_0x63c0('0x30')]();});}};}function handleEntityNotFound(_0x1bf22a,_0x1f9d8f){return function(_0x13eb55){if(!_0x13eb55){_0x1bf22a[_0x63c0('0x2e')](0x194);}return _0x13eb55;};}function handleError(_0x46b142,_0x4f5ef1){_0x4f5ef1=_0x4f5ef1||0x1f4;return function(_0x4bbcb3){logger[_0x63c0('0x29')](_0x4bbcb3[_0x63c0('0x3e')]);if(_0x4bbcb3[_0x63c0('0x3f')]){delete _0x4bbcb3[_0x63c0('0x3f')];}_0x46b142[_0x63c0('0x2f')](_0x4f5ef1)[_0x63c0('0x40')](_0x4bbcb3);};}exports[_0x63c0('0x41')]=function(_0x35d566,_0x2e8667){var _0x4f48bd={'include':[{'model':db['Pause'],'as':_0x63c0('0x42')}]},_0x166301={},_0x2d93c0={'count':0x0,'rows':[]};var _0x4eaa00=_[_0x63c0('0x43')](db['OpenchannelAccount']['rawAttributes'],function(_0x2ebe7a){return{'name':_0x2ebe7a[_0x63c0('0x44')],'type':_0x2ebe7a[_0x63c0('0x45')][_0x63c0('0x46')]};});_0x166301[_0x63c0('0x47')]=_['map'](_0x4eaa00,_0x63c0('0x3f'));_0x166301[_0x63c0('0x48')]=_[_0x63c0('0x49')](_0x35d566[_0x63c0('0x48')]);_0x166301[_0x63c0('0x4a')]=_[_0x63c0('0x4b')](_0x166301[_0x63c0('0x47')],_0x166301[_0x63c0('0x48')]);_0x4f48bd[_0x63c0('0x4c')]=_[_0x63c0('0x4b')](_0x166301['model'],qs[_0x63c0('0x4d')](_0x35d566['query']['fields']));_0x4f48bd[_0x63c0('0x4c')]=_0x4f48bd['attributes'][_0x63c0('0x4e')]?_0x4f48bd[_0x63c0('0x4c')]:_0x166301[_0x63c0('0x47')];if(!_0x35d566[_0x63c0('0x48')][_0x63c0('0x4f')](_0x63c0('0x50'))){_0x4f48bd[_0x63c0('0x35')]=qs[_0x63c0('0x35')](_0x35d566[_0x63c0('0x48')]['limit']);_0x4f48bd[_0x63c0('0x32')]=qs[_0x63c0('0x32')](_0x35d566[_0x63c0('0x48')][_0x63c0('0x32')]);}_0x4f48bd['order']=qs[_0x63c0('0x51')](_0x35d566[_0x63c0('0x48')]['sort']);_0x4f48bd[_0x63c0('0x52')]=qs[_0x63c0('0x4a')](_[_0x63c0('0x53')](_0x35d566[_0x63c0('0x48')],_0x166301[_0x63c0('0x4a')]),_0x4eaa00);if(_0x35d566[_0x63c0('0x48')][_0x63c0('0x54')]){_0x4f48bd[_0x63c0('0x52')]=_[_0x63c0('0x55')](_0x4f48bd[_0x63c0('0x52')],{'$or':_[_0x63c0('0x43')](_0x4eaa00,function(_0x58e236){if(_0x58e236[_0x63c0('0x45')]!==_0x63c0('0x56')){var _0xc2e872={};_0xc2e872[_0x58e236[_0x63c0('0x3f')]]={'$like':'%'+_0x35d566[_0x63c0('0x48')][_0x63c0('0x54')]+'%'};return _0xc2e872;}})});}_0x4f48bd=_['merge']({},_0x4f48bd,_0x35d566[_0x63c0('0x57')]);var _0x2f80e9={'where':_0x4f48bd[_0x63c0('0x52')]};return db[_0x63c0('0x58')][_0x63c0('0x34')](_0x2f80e9)[_0x63c0('0x23')](function(_0x11e91c){_0x2d93c0[_0x63c0('0x34')]=_0x11e91c;if(_0x35d566['query'][_0x63c0('0x59')]){_0x4f48bd[_0x63c0('0x5a')]=[{'all':!![]}];}return db[_0x63c0('0x58')][_0x63c0('0x5b')](_0x4f48bd);})[_0x63c0('0x23')](function(_0x4a3428){_0x2d93c0['rows']=_0x4a3428;return _0x2d93c0;})[_0x63c0('0x23')](respondWithFilteredResult(_0x2e8667,_0x4f48bd))[_0x63c0('0x2d')](handleError(_0x2e8667,null));};exports[_0x63c0('0x5c')]=function(_0x11db54,_0x426a8f){var _0x2c28b8={'raw':![],'where':{'id':_0x11db54['params']['id']},'include':[{'model':db[_0x63c0('0x5d')],'as':_0x63c0('0x42')}]},_0x30bd53={};_0x30bd53['model']=_[_0x63c0('0x49')](db[_0x63c0('0x58')][_0x63c0('0x5e')]);_0x30bd53[_0x63c0('0x48')]=_['keys'](_0x11db54[_0x63c0('0x48')]);_0x30bd53[_0x63c0('0x4a')]=_[_0x63c0('0x4b')](_0x30bd53[_0x63c0('0x47')],_0x30bd53['query']);_0x2c28b8['attributes']=_[_0x63c0('0x4b')](_0x30bd53[_0x63c0('0x47')],qs[_0x63c0('0x4d')](_0x11db54[_0x63c0('0x48')][_0x63c0('0x4d')]));_0x2c28b8[_0x63c0('0x4c')]=_0x2c28b8[_0x63c0('0x4c')][_0x63c0('0x4e')]?_0x2c28b8[_0x63c0('0x4c')]:_0x30bd53['model'];if(_0x11db54[_0x63c0('0x48')][_0x63c0('0x59')]){_0x2c28b8['include']=[{'all':!![]}];}_0x2c28b8=_['merge']({},_0x2c28b8,_0x11db54[_0x63c0('0x57')]);return db[_0x63c0('0x58')][_0x63c0('0x5f')](_0x2c28b8)[_0x63c0('0x23')](handleEntityNotFound(_0x426a8f,null))['then'](respondWithResult(_0x426a8f,null))[_0x63c0('0x2d')](handleError(_0x426a8f,null));};exports[_0x63c0('0x60')]=function(_0x1ddb70,_0x581219){return db[_0x63c0('0x58')][_0x63c0('0x60')](_0x1ddb70[_0x63c0('0x61')],{})[_0x63c0('0x23')](function(_0x19a6ec){var _0x55c8c0=_0x1ddb70['user'][_0x63c0('0x62')]({'plain':!![]});if(!_0x55c8c0)throw new Error(_0x63c0('0x63'));if(_0x55c8c0[_0x63c0('0x64')]===_0x63c0('0x65')){var _0x2e7780=_0x19a6ec[_0x63c0('0x62')]({'plain':!![]});var _0x739f92=_0x63c0('0x3c');return db[_0x63c0('0x66')][_0x63c0('0x5f')]({'where':{'name':_0x739f92,'userProfileId':_0x55c8c0[_0x63c0('0x67')]},'raw':!![]})[_0x63c0('0x23')](function(_0xeb8110){if(_0xeb8110&&_0xeb8110[_0x63c0('0x68')]===0x0){return db[_0x63c0('0x3d')][_0x63c0('0x60')]({'name':_0x2e7780['name'],'resourceId':_0x2e7780['id'],'type':_0xeb8110['name'],'sectionId':_0xeb8110['id']},{})[_0x63c0('0x23')](function(){return _0x19a6ec;});}else{return _0x19a6ec;}})[_0x63c0('0x2d')](function(_0x3676be){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3676be);throw _0x3676be;});}return _0x19a6ec;})[_0x63c0('0x23')](respondWithResult(_0x581219,0xc9))['catch'](handleError(_0x581219,null));};exports['update']=function(_0x3be12f,_0x324f9f){if(_0x3be12f[_0x63c0('0x61')]['id']){delete _0x3be12f['body']['id'];}return db[_0x63c0('0x58')][_0x63c0('0x5f')]({'where':{'id':_0x3be12f['params']['id']},'include':[{'model':db['Pause'],'as':_0x63c0('0x42')}]})[_0x63c0('0x23')](handleEntityNotFound(_0x324f9f,null))[_0x63c0('0x23')](saveUpdates(_0x3be12f[_0x63c0('0x61')],null))[_0x63c0('0x23')](respondWithResult(_0x324f9f,null))['catch'](handleError(_0x324f9f,null));};exports[_0x63c0('0x3b')]=function(_0x3931ca,_0x7c4c03){return db[_0x63c0('0x58')][_0x63c0('0x5f')]({'where':{'id':_0x3931ca['params']['id']}})[_0x63c0('0x23')](handleEntityNotFound(_0x7c4c03,null))['then'](removeEntity(_0x7c4c03,null))[_0x63c0('0x2d')](handleError(_0x7c4c03,null));};exports[_0x63c0('0x69')]=function(_0x72e880,_0x3ed1d9){return db[_0x63c0('0x58')][_0x63c0('0x69')]()['then'](respondWithResult(_0x3ed1d9,null))['catch'](handleError(_0x3ed1d9,null));};exports[_0x63c0('0x6a')]=function(_0x2af90c,_0x34fbd5,_0x40fe24){if(_0x2af90c[_0x63c0('0x61')]['id']){delete _0x2af90c[_0x63c0('0x61')]['id'];}return db[_0x63c0('0x58')]['find']({'where':{'id':_0x2af90c[_0x63c0('0x6b')]['id']}})[_0x63c0('0x23')](handleEntityNotFound(_0x34fbd5,null))[_0x63c0('0x23')](function(_0x752354){if(_0x752354){_0x2af90c['body'][_0x63c0('0x6c')]=_0x752354['id'];return db[_0x63c0('0x6d')][_0x63c0('0x60')](_0x2af90c[_0x63c0('0x61')]);}})[_0x63c0('0x23')](respondWithResult(_0x34fbd5,null))[_0x63c0('0x2d')](handleError(_0x34fbd5,null));};exports[_0x63c0('0x6e')]=function(_0x27387d,_0x4fac67,_0x28ed1d){var _0x100466={'raw':![],'where':{}};var _0x55da80={};var _0x2395d1={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x63c0('0x6f')]({'where':{'id':_0x27387d[_0x63c0('0x6b')]['id']}})[_0x63c0('0x23')](handleEntityNotFound(_0x4fac67,null))['then'](function(_0x11986e){if(_0x11986e){_0x55da80[_0x63c0('0x47')]=_[_0x63c0('0x49')](db[_0x63c0('0x6d')][_0x63c0('0x5e')]);_0x55da80[_0x63c0('0x48')]=_[_0x63c0('0x49')](_0x27387d[_0x63c0('0x48')]);_0x55da80['filters']=_[_0x63c0('0x4b')](_0x55da80[_0x63c0('0x47')],_0x55da80[_0x63c0('0x48')]);_0x100466[_0x63c0('0x4c')]=_[_0x63c0('0x4b')](_0x55da80[_0x63c0('0x47')],qs['fields'](_0x27387d[_0x63c0('0x48')][_0x63c0('0x4d')]));_0x100466[_0x63c0('0x4c')]=_0x100466[_0x63c0('0x4c')][_0x63c0('0x4e')]?_0x100466[_0x63c0('0x4c')]:_0x55da80[_0x63c0('0x47')];if(!_0x27387d[_0x63c0('0x48')]['hasOwnProperty'](_0x63c0('0x50'))){_0x100466[_0x63c0('0x35')]=qs[_0x63c0('0x35')](_0x27387d['query']['limit']);_0x100466['offset']=qs[_0x63c0('0x32')](_0x27387d[_0x63c0('0x48')][_0x63c0('0x32')]);}_0x100466[_0x63c0('0x70')]=qs[_0x63c0('0x51')](_0x27387d[_0x63c0('0x48')][_0x63c0('0x51')]);_0x100466['where']=qs[_0x63c0('0x4a')](_[_0x63c0('0x53')](_0x27387d[_0x63c0('0x48')],_0x55da80[_0x63c0('0x4a')]));_0x100466['where'][_0x63c0('0x6c')]=_0x11986e['id'];if(_0x27387d[_0x63c0('0x48')][_0x63c0('0x54')]){_0x100466[_0x63c0('0x52')]=_[_0x63c0('0x55')](_0x100466[_0x63c0('0x52')],{'$or':_['map'](_0x100466[_0x63c0('0x4c')],function(_0x3facc1){var _0x21a706={};_0x21a706[_0x3facc1]={'$like':'%'+_0x27387d['query'][_0x63c0('0x54')]+'%'};return _0x21a706;})});}_0x100466=_[_0x63c0('0x55')]({},_0x100466,_0x27387d[_0x63c0('0x57')]);return db['Disposition'][_0x63c0('0x34')]({'where':_0x100466[_0x63c0('0x52')]})[_0x63c0('0x23')](function(_0x35abec){_0x2395d1['count']=_0x35abec;if(_0x27387d['query'][_0x63c0('0x59')]){_0x100466[_0x63c0('0x5a')]=[{'all':!![]}];}return db['Disposition'][_0x63c0('0x5b')](_0x100466);})[_0x63c0('0x23')](function(_0x375774){_0x2395d1[_0x63c0('0x71')]=_0x375774;return _0x2395d1;});}})[_0x63c0('0x23')](respondWithFilteredResult(_0x4fac67,_0x100466))['catch'](handleError(_0x4fac67,null));};exports[_0x63c0('0x72')]=function(_0x55ca26,_0x27789b,_0x59bd7c){return db['OpenchannelAccount']['find']({'where':{'id':_0x55ca26[_0x63c0('0x6b')]['id']}})['then'](handleEntityNotFound(_0x27789b,null))['then'](function(_0x117944){if(_0x117944){return _0x117944[_0x63c0('0x72')](_0x55ca26[_0x63c0('0x48')][_0x63c0('0x73')]);}})[_0x63c0('0x23')](respondWithStatusCode(_0x27789b,null))[_0x63c0('0x2d')](handleError(_0x27789b,null));};exports[_0x63c0('0x74')]=function(_0x3d21bd,_0x90e3c1,_0xe3533a){if(_0x3d21bd['body']['id']){delete _0x3d21bd['body']['id'];}return db['OpenchannelAccount'][_0x63c0('0x5f')]({'where':{'id':_0x3d21bd[_0x63c0('0x6b')]['id']}})[_0x63c0('0x23')](handleEntityNotFound(_0x90e3c1,null))['then'](function(_0x4f110d){if(_0x4f110d){_0x3d21bd['body'][_0x63c0('0x6c')]=_0x4f110d['id'];return db['CannedAnswer'][_0x63c0('0x60')](_0x3d21bd[_0x63c0('0x61')]);}})[_0x63c0('0x23')](respondWithResult(_0x90e3c1,null))[_0x63c0('0x2d')](handleError(_0x90e3c1,null));};exports['getAnswers']=function(_0x5f4031,_0x3aa561,_0x453665){var _0x488c5a={'raw':![],'where':{}};var _0x4557d4={};var _0x3c0f6f={'count':0x0,'rows':[]};return db[_0x63c0('0x58')][_0x63c0('0x6f')]({'where':{'id':_0x5f4031[_0x63c0('0x6b')]['id']}})['then'](handleEntityNotFound(_0x3aa561,null))[_0x63c0('0x23')](function(_0x54db81){if(_0x54db81){_0x4557d4[_0x63c0('0x47')]=_['keys'](db[_0x63c0('0x75')][_0x63c0('0x5e')]);_0x4557d4[_0x63c0('0x48')]=_[_0x63c0('0x49')](_0x5f4031['query']);_0x4557d4[_0x63c0('0x4a')]=_[_0x63c0('0x4b')](_0x4557d4[_0x63c0('0x47')],_0x4557d4[_0x63c0('0x48')]);_0x488c5a[_0x63c0('0x4c')]=_['intersection'](_0x4557d4[_0x63c0('0x47')],qs[_0x63c0('0x4d')](_0x5f4031[_0x63c0('0x48')][_0x63c0('0x4d')]));_0x488c5a['attributes']=_0x488c5a[_0x63c0('0x4c')][_0x63c0('0x4e')]?_0x488c5a[_0x63c0('0x4c')]:_0x4557d4[_0x63c0('0x47')];if(!_0x5f4031[_0x63c0('0x48')]['hasOwnProperty'](_0x63c0('0x50'))){_0x488c5a[_0x63c0('0x35')]=qs[_0x63c0('0x35')](_0x5f4031[_0x63c0('0x48')][_0x63c0('0x35')]);_0x488c5a[_0x63c0('0x32')]=qs[_0x63c0('0x32')](_0x5f4031[_0x63c0('0x48')][_0x63c0('0x32')]);}_0x488c5a[_0x63c0('0x70')]=qs['sort'](_0x5f4031[_0x63c0('0x48')]['sort']);_0x488c5a[_0x63c0('0x52')]=qs[_0x63c0('0x4a')](_['pick'](_0x5f4031['query'],_0x4557d4['filters']));_0x488c5a[_0x63c0('0x52')][_0x63c0('0x6c')]=_0x54db81['id'];if(_0x5f4031[_0x63c0('0x48')][_0x63c0('0x54')]){_0x488c5a[_0x63c0('0x52')]=_['merge'](_0x488c5a[_0x63c0('0x52')],{'$or':_['map'](_0x488c5a[_0x63c0('0x4c')],function(_0x5487a3){var _0x11666f={};_0x11666f[_0x5487a3]={'$like':'%'+_0x5f4031[_0x63c0('0x48')][_0x63c0('0x54')]+'%'};return _0x11666f;})});}_0x488c5a=_[_0x63c0('0x55')]({},_0x488c5a,_0x5f4031[_0x63c0('0x57')]);return db['CannedAnswer'][_0x63c0('0x34')]({'where':_0x488c5a['where']})['then'](function(_0x1346bc){_0x3c0f6f[_0x63c0('0x34')]=_0x1346bc;if(_0x5f4031[_0x63c0('0x48')][_0x63c0('0x59')]){_0x488c5a[_0x63c0('0x5a')]=[{'all':!![]}];}return db[_0x63c0('0x75')][_0x63c0('0x5b')](_0x488c5a);})[_0x63c0('0x23')](function(_0x281ce3){_0x3c0f6f['rows']=_0x281ce3;return _0x3c0f6f;});}})['then'](respondWithFilteredResult(_0x3aa561,_0x488c5a))[_0x63c0('0x2d')](handleError(_0x3aa561,null));};exports[_0x63c0('0x76')]=function(_0x535f11,_0x2c6d92,_0x4a48f6){return db[_0x63c0('0x58')][_0x63c0('0x5f')]({'where':{'id':_0x535f11['params']['id']}})[_0x63c0('0x23')](handleEntityNotFound(_0x2c6d92,null))[_0x63c0('0x23')](function(_0x318bbd){if(_0x318bbd){return _0x318bbd['removeAnswers'](_0x535f11[_0x63c0('0x48')][_0x63c0('0x73')]);}})['then'](respondWithStatusCode(_0x2c6d92,null))[_0x63c0('0x2d')](handleError(_0x2c6d92,null));};exports[_0x63c0('0x77')]=function(_0x731791,_0x52baa5,_0x17e050){var _0x337791={'body':_0x731791[_0x63c0('0x61')],'channel':_0x63c0('0x78')};var _0x57d1d5=[];var _0x396536=[];var _0x4734a3={};var _0x512fdf=![];return db['CmContact']['describe']()[_0x63c0('0x23')](function(_0x33d4fd){if(!_0x33d4fd){throw new db['Sequelize'][(_0x63c0('0x79'))](_0x63c0('0x7a'));}_0x57d1d5=_['difference'](_[_0x63c0('0x49')](_0x33d4fd),[_0x63c0('0x7b'),_0x63c0('0x7c')]);_0x396536=_[_0x63c0('0x7d')](_[_0x63c0('0x49')](_0x33d4fd),[_0x63c0('0x7b'),_0x63c0('0x7c'),'CompanyId',_0x63c0('0x7e')]);if(_0x731791['body']['id']){delete _0x731791[_0x63c0('0x61')]['id'];}if(_[_0x63c0('0x7f')](_0x731791['body'][_0x63c0('0x80')])){throw new db[(_0x63c0('0x81'))][(_0x63c0('0x79'))](_0x63c0('0x82'));}if(_['isNil'](_0x731791[_0x63c0('0x61')][_0x63c0('0x61')])||_0x731791['body']['body']===''){throw new db[(_0x63c0('0x81'))][(_0x63c0('0x79'))](_0x63c0('0x83'));}if(_[_0x63c0('0x7f')](_0x731791[_0x63c0('0x61')][_0x63c0('0x84')])){throw new db['Sequelize']['ValidationError'](_0x63c0('0x85')+_0x396536);}if(!_[_0x63c0('0x86')](_0x396536,_0x731791[_0x63c0('0x61')][_0x63c0('0x84')])){throw new db[(_0x63c0('0x81'))][(_0x63c0('0x79'))](_0x63c0('0x87')+_0x396536);}_0x4734a3[_0x731791[_0x63c0('0x61')][_0x63c0('0x84')]]=_0x731791['body'][_0x63c0('0x80')];})[_0x63c0('0x23')](function(){return db[_0x63c0('0x58')][_0x63c0('0x5f')]({'where':{'id':_0x731791[_0x63c0('0x6b')]['id']},'include':[{'model':db['CmList'],'as':_0x63c0('0x88'),'include':[{'model':db[_0x63c0('0x89')],'as':_0x63c0('0x8a'),'where':_0x4734a3,'limit':0x1,'order':[[_0x63c0('0x7c'),'DESC']]}]},{'model':db[_0x63c0('0x8b')],'as':_0x63c0('0x8c')}]});})[_0x63c0('0x23')](handleEntityNotFound(_0x52baa5,null))[_0x63c0('0x23')](function(_0x519ded){if(_0x519ded&&_0x519ded[_0x63c0('0x88')]){_0x337791[_0x63c0('0x8d')]=_0x519ded;_0x337791[_0x63c0('0x8e')]=_0x519ded[_0x63c0('0x8c')];_0x337791['list']=_0x519ded[_0x63c0('0x88')];_0x337791[_0x63c0('0x8e')]=_[_0x63c0('0x8f')](_0x337791[_0x63c0('0x8e')],[_0x63c0('0x90')],[_0x63c0('0x91')]);if(_0x337791[_0x63c0('0x8d')]['Applications']){delete _0x337791[_0x63c0('0x8d')]['Applications'];}if(_0x337791['account'][_0x63c0('0x88')]&&_0x337791[_0x63c0('0x8d')][_0x63c0('0x88')][_0x63c0('0x8a')]['length']){return _0x337791[_0x63c0('0x8d')]['List'][_0x63c0('0x8a')][0x0];}var _0x512d0e=_[_0x63c0('0x92')](_0x731791[_0x63c0('0x61')],{'firstName':_0x731791[_0x63c0('0x61')]['from'],'ListId':_0x519ded[_0x63c0('0x7e')]});_0x512d0e[_0x731791[_0x63c0('0x61')]['mapKey']]=_0x731791[_0x63c0('0x61')][_0x63c0('0x80')];return db['CmContact']['create'](_0x512d0e,{'fields':_0x57d1d5,'raw':!![]});}})[_0x63c0('0x23')](handleEntityNotFound(_0x52baa5,null))['then'](function(_0xa3144a){_0x337791[_0x63c0('0x93')]=_0xa3144a;if(_0xa3144a){var _0x14cb9c={'ContactId':_0xa3144a['id'],'OpenchannelAccountId':_0x731791[_0x63c0('0x6b')]['id'],'from':(_0xa3144a[_0x63c0('0x94')]||'')+'\x20'+(_0xa3144a[_0x63c0('0x95')]||'')};var _0x5a2a11={'OpenchannelAccountId':_0x731791[_0x63c0('0x6b')]['id'],'closed':![]};if(_0x731791[_0x63c0('0x61')][_0x63c0('0x96')]){_0x5a2a11[_0x63c0('0x96')]=_0x731791[_0x63c0('0x61')][_0x63c0('0x96')];return db['OpenchannelInteraction'][_0x63c0('0x5f')]({'where':_0x5a2a11})[_0x63c0('0x23')](function(_0x275fbc){if(_0x275fbc){return[_0x275fbc,![]];}_0x14cb9c[_0x63c0('0x96')]=_0x731791['body'][_0x63c0('0x96')];_0x14cb9c[_0x63c0('0x97')]=_0x731791[_0x63c0('0x61')][_0x63c0('0x97')];return db[_0x63c0('0x98')][_0x63c0('0x60')](_0x14cb9c)['then'](function(_0x51f373){return[_0x51f373,!![]];});});}else{_0x5a2a11[_0x63c0('0x96')]=null;}_0x5a2a11['ContactId']=_0xa3144a['id'];return db[_0x63c0('0x98')][_0x63c0('0x5f')]({'where':_0x5a2a11})[_0x63c0('0x23')](function(_0x14a49b){if(_0x14a49b){return[_0x14a49b,![]];}return db['OpenchannelInteraction']['create'](_0x14cb9c)[_0x63c0('0x23')](function(_0x2fffd2){return[_0x2fffd2,!![]];});});}})['spread'](function(_0x12ecd1,_0x3c4bdb){if(_0x12ecd1){_0x512fdf=_0x3c4bdb;if(!_0x3c4bdb){var _0x915d53={'from':(_0x337791[_0x63c0('0x93')]['firstName']||'')+'\x20'+(_0x337791[_0x63c0('0x93')][_0x63c0('0x95')]||'')};if(_0x731791[_0x63c0('0x61')][_0x63c0('0x96')]&&_0x731791[_0x63c0('0x61')][_0x63c0('0x99')]&&_0x731791['body']['threadId']!=_0x731791[_0x63c0('0x61')][_0x63c0('0x99')]){_0x915d53[_0x63c0('0x96')]=_0x731791[_0x63c0('0x61')]['messageId'];}return _0x12ecd1[_0x63c0('0x3a')](_0x915d53);}else{return _0x12ecd1;}}})[_0x63c0('0x23')](function(_0x4d194b){_0x337791['interaction']=_0x4d194b[_0x63c0('0x62')]({'plain':!![]});_0x337791[_0x63c0('0x9a')][_0x63c0('0x9b')]=_0x512fdf;if(_0x337791[_0x63c0('0x9a')][_0x63c0('0x9b')]){if(_0x337791[_0x63c0('0x8d')][_0x63c0('0x9c')]){_0x337791[_0x63c0('0x8e')][_0x63c0('0x9d')]({'id':0x0,'priority':_0x337791[_0x63c0('0x8e')][_0x63c0('0x4e')]+0x1,'app':_0x63c0('0x9e'),'appdata':_0x63c0('0x9f'),'interval':_0x63c0('0xa0')});}}return db[_0x63c0('0xa1')][_0x63c0('0x60')]({'body':_0x731791[_0x63c0('0x61')]['body'],'OpenchannelAccountId':_0x731791[_0x63c0('0x6b')]['id'],'OpenchannelInteractionId':_0x4d194b['id'],'direction':'in','ContactId':_0x337791['contact']['id'],'AttachmentId':_0x731791[_0x63c0('0x61')][_0x63c0('0xa2')]});})[_0x63c0('0x23')](function(_0x3863b2){_0x337791[_0x63c0('0x2b')]=_0x3863b2;if(_0x337791[_0x63c0('0x9a')][_0x63c0('0xa3')]){return db[_0x63c0('0xa4')][_0x63c0('0x5f')]({'attributes':['id',_0x63c0('0x3f')],'where':{'id':_0x337791['interaction'][_0x63c0('0xa3')]}})[_0x63c0('0x23')](function(_0x51c4c2){if(_0x51c4c2){_0x337791[_0x63c0('0x8e')][_0x63c0('0xa5')]({'id':0x0,'priority':0x0,'app':_0x63c0('0xa6'),'appdata':_0x51c4c2['name']+','+(_0x337791[_0x63c0('0x8d')][_0x63c0('0xa7')]||0xa),'interval':'*,*,*,*'});_0x337791['forcedOwnership']=![];}return respondWithRpcPromise('Start',_0x63c0('0xa8'),_0x337791);});}return respondWithRpcPromise('Start',_0x63c0('0xa8'),_0x337791);})['then'](function(_0x448580){respondWithRpcPromise(_0x63c0('0xa9'),_0x63c0('0xa9'),{'event':_0x63c0('0x77'),'message':_0x448580},client9002);return _0x448580;})[_0x63c0('0x23')](respondWithResult(_0x52baa5,null))[_0x63c0('0x2d')](handleError(_0x52baa5,null));};exports[_0x63c0('0xaa')]=function(_0x55a978,_0x1b2aa1,_0x24eda9){return db[_0x63c0('0x58')]['findOne']({'where':{'id':_0x55a978[_0x63c0('0x6b')]['id']}})['then'](handleEntityNotFound(_0x1b2aa1,null))[_0x63c0('0x23')](function(_0x3b732e){if(_0x3b732e){return db[_0x63c0('0xab')][_0x63c0('0xac')](function(_0x30de60){return db[_0x63c0('0x8b')]['destroy']({'where':{'OpenchannelAccountId':_0x55a978[_0x63c0('0x6b')]['id']},'transaction':_0x30de60})['then'](function(_0xe9f4ae){var _0x4891ad=_['map'](_0x55a978[_0x63c0('0x61')],function(_0x461212){_0x461212['OpenchannelAccountId']=_0x55a978[_0x63c0('0x6b')]['id'];return _0x461212;});return db[_0x63c0('0x8b')][_0x63c0('0xad')](_0x4891ad,{'transaction':_0x30de60});});})[_0x63c0('0x23')](function(){return db[_0x63c0('0x8b')]['findAndCountAll']({'where':{'OpenchannelAccountId':_0x55a978['params']['id']},'order':_0x63c0('0x90')});});}})['then'](respondWithResult(_0x1b2aa1,null))['catch'](handleError(_0x1b2aa1,null));};exports['getApplications']=function(_0xc5b860,_0x2f73ae,_0x2f32e6){var _0x3394d0={};var _0x9deec0={};var _0x1254eb;var _0x428740;return db[_0x63c0('0x58')]['findOne']({'where':{'id':_0xc5b860[_0x63c0('0x6b')]['id']}})[_0x63c0('0x23')](handleEntityNotFound(_0x2f73ae,null))[_0x63c0('0x23')](function(_0xb7fbb5){if(_0xb7fbb5){_0x1254eb=_0xb7fbb5;_0x9deec0[_0x63c0('0x47')]=_[_0x63c0('0x49')](db[_0x63c0('0x8b')]['rawAttributes']);_0x9deec0[_0x63c0('0x48')]=_[_0x63c0('0x49')](_0xc5b860['query']);_0x9deec0[_0x63c0('0x4a')]=_[_0x63c0('0x4b')](_0x9deec0['model'],_0x9deec0[_0x63c0('0x48')]);_0x3394d0[_0x63c0('0x4c')]=_[_0x63c0('0x4b')](_0x9deec0[_0x63c0('0x47')],qs[_0x63c0('0x4d')](_0xc5b860[_0x63c0('0x48')][_0x63c0('0x4d')]));_0x3394d0[_0x63c0('0x4c')]=_0x3394d0[_0x63c0('0x4c')][_0x63c0('0x4e')]?_0x3394d0[_0x63c0('0x4c')]:_0x9deec0['model'];_0x3394d0[_0x63c0('0x70')]=qs[_0x63c0('0x51')](_0xc5b860[_0x63c0('0x48')][_0x63c0('0x51')]);_0x3394d0[_0x63c0('0x52')]=qs[_0x63c0('0x4a')](_[_0x63c0('0x53')](_0xc5b860[_0x63c0('0x48')],_0x9deec0[_0x63c0('0x4a')]));if(_0xc5b860['query'][_0x63c0('0x54')]){_0x3394d0['where']=_[_0x63c0('0x55')](_0x3394d0[_0x63c0('0x52')],{'$or':_[_0x63c0('0x43')](_0x3394d0[_0x63c0('0x4c')],function(_0x336966){var _0x405a41={};_0x405a41[_0x336966]={'$like':'%'+_0xc5b860[_0x63c0('0x48')][_0x63c0('0x54')]+'%'};return _0x405a41;})});}_0x3394d0=_[_0x63c0('0x55')]({},_0x3394d0,_0xc5b860['options']);return _0x1254eb['getApplications'](_0x3394d0);}})[_0x63c0('0x23')](function(_0x11426b){if(_0x11426b){_0x428740=_0x11426b['length'];if(!_0xc5b860[_0x63c0('0x48')][_0x63c0('0x4f')](_0x63c0('0x50'))){_0x3394d0[_0x63c0('0x35')]=qs['limit'](_0xc5b860[_0x63c0('0x48')][_0x63c0('0x35')]);_0x3394d0[_0x63c0('0x32')]=qs['offset'](_0xc5b860[_0x63c0('0x48')][_0x63c0('0x32')]);}return _0x1254eb[_0x63c0('0xae')](_0x3394d0);}})[_0x63c0('0x23')](function(_0x177d99){if(_0x177d99){return _0x177d99?{'count':_0x428740,'rows':_0x177d99}:null;}})[_0x63c0('0x23')](respondWithResult(_0x2f73ae,null))['catch'](handleError(_0x2f73ae,null));};exports['getInteractions']=function(_0x1e849a,_0x32555e,_0x4606b1){var _0xc38084={'raw':![],'where':{}};var _0x126071={};var _0x40cb3a={'count':0x0,'rows':[]};return db[_0x63c0('0x58')]['findOne']({'where':{'id':_0x1e849a[_0x63c0('0x6b')]['id']}})[_0x63c0('0x23')](handleEntityNotFound(_0x32555e,null))[_0x63c0('0x23')](function(_0x4b11e8){if(_0x4b11e8){_0x126071[_0x63c0('0x47')]=_[_0x63c0('0x49')](db['OpenchannelInteraction'][_0x63c0('0x5e')]);_0x126071[_0x63c0('0x48')]=_[_0x63c0('0x49')](_0x1e849a[_0x63c0('0x48')]);_0x126071[_0x63c0('0x4a')]=_[_0x63c0('0x4b')](_0x126071[_0x63c0('0x47')],_0x126071[_0x63c0('0x48')]);_0xc38084[_0x63c0('0x4c')]=_[_0x63c0('0x4b')](_0x126071[_0x63c0('0x47')],qs[_0x63c0('0x4d')](_0x1e849a['query'][_0x63c0('0x4d')]));_0xc38084[_0x63c0('0x4c')]=_0xc38084['attributes'][_0x63c0('0x4e')]?_0xc38084['attributes']:_0x126071[_0x63c0('0x47')];if(!_0x1e849a['query'][_0x63c0('0x4f')](_0x63c0('0x50'))){_0xc38084[_0x63c0('0x35')]=qs[_0x63c0('0x35')](_0x1e849a[_0x63c0('0x48')]['limit']);_0xc38084[_0x63c0('0x32')]=qs[_0x63c0('0x32')](_0x1e849a['query'][_0x63c0('0x32')]);}_0xc38084[_0x63c0('0x70')]=qs[_0x63c0('0x51')](_0x1e849a[_0x63c0('0x48')][_0x63c0('0x51')]);_0xc38084[_0x63c0('0x52')]=qs[_0x63c0('0x4a')](_[_0x63c0('0x53')](_0x1e849a['query'],_0x126071[_0x63c0('0x4a')]));_0xc38084['where'][_0x63c0('0x6c')]=_0x4b11e8['id'];if(_0x1e849a[_0x63c0('0x48')][_0x63c0('0x54')]){_0xc38084[_0x63c0('0x52')]=_[_0x63c0('0x55')](_0xc38084[_0x63c0('0x52')],{'$or':_[_0x63c0('0x43')](_0xc38084[_0x63c0('0x4c')],function(_0x508faa){var _0x31d035={};_0x31d035[_0x508faa]={'$like':'%'+_0x1e849a['query'][_0x63c0('0x54')]+'%'};return _0x31d035;})});}_0xc38084=_['merge']({},_0xc38084,_0x1e849a[_0x63c0('0x57')]);return db[_0x63c0('0x98')][_0x63c0('0x34')]({'where':_0xc38084[_0x63c0('0x52')]})['then'](function(_0x57e565){_0x40cb3a['count']=_0x57e565;if(_0x1e849a[_0x63c0('0x48')][_0x63c0('0x59')]){_0xc38084[_0x63c0('0x5a')]=[{'model':db['CmContact'],'as':_0x63c0('0xaf'),'required':![]},{'model':db['User'],'as':_0x63c0('0xb0'),'attributes':['name',_0x63c0('0xb1'),'internal'],'required':![]},{'model':db[_0x63c0('0xb2')],'as':_0x63c0('0xb3'),'attributes':['id','name','color'],'where':_0x1e849a[_0x63c0('0x48')][_0x63c0('0xb4')]?{'id':_0x1e849a['query'][_0x63c0('0xb4')]}:undefined,'required':_0x1e849a[_0x63c0('0x48')][_0x63c0('0xb4')]?!![]:![]}];}return db['OpenchannelInteraction']['findAll'](_0xc38084);})[_0x63c0('0x23')](function(_0x4b7ae7){_0x40cb3a['rows']=_0x4b7ae7;return _0x40cb3a;});}})[_0x63c0('0x23')](respondWithFilteredResult(_0x32555e,_0xc38084))['catch'](handleError(_0x32555e,null));};exports[_0x63c0('0xb5')]=function(_0x4bda6d,_0x19f08a,_0xe30703){return db[_0x63c0('0x58')][_0x63c0('0x5f')]({'where':{'id':_0x4bda6d[_0x63c0('0x6b')]['id']}})[_0x63c0('0x23')](handleEntityNotFound(_0x19f08a,null))[_0x63c0('0x23')](function(_0x254d6b){if(_0x254d6b){return _0x254d6b[_0x63c0('0xb5')](_0x4bda6d[_0x63c0('0x61')][_0x63c0('0x73')],_[_0x63c0('0xb6')](_0x4bda6d[_0x63c0('0x61')],[_0x63c0('0x73'),'id'])||{})['spread'](function(_0x53ceaa){for(var _0x4f05a5=0x0;_0x4f05a5<_0x4bda6d[_0x63c0('0x61')][_0x63c0('0x73')][_0x63c0('0x4e')];_0x4f05a5+=0x1){socket[_0x63c0('0xb7')](_0x63c0('0xb8'),{'UserId':Number(_0x4bda6d[_0x63c0('0x61')][_0x63c0('0x73')][_0x4f05a5]),'OpenchannelAccountId':Number(_0x4bda6d[_0x63c0('0x6b')]['id'])});}return _0x53ceaa;});}})['then'](respondWithResult(_0x19f08a,null))[_0x63c0('0x2d')](handleError(_0x19f08a,null));};exports['removeAgents']=function(_0x4602c8,_0x890175,_0x3658aa){return db[_0x63c0('0x58')][_0x63c0('0x5f')]({'where':{'id':_0x4602c8[_0x63c0('0x6b')]['id']}})[_0x63c0('0x23')](handleEntityNotFound(_0x890175,null))[_0x63c0('0x23')](function(_0x598b8f){if(_0x598b8f){return _0x598b8f[_0x63c0('0xb9')](_0x4602c8[_0x63c0('0x48')][_0x63c0('0x73')])[_0x63c0('0x23')](function(){if(_['isArray'](_0x4602c8[_0x63c0('0x48')][_0x63c0('0x73')])){for(var _0x3e0e4a=0x0;_0x3e0e4a<_0x4602c8[_0x63c0('0x48')]['ids'][_0x63c0('0x4e')];_0x3e0e4a+=0x1){socket[_0x63c0('0xb7')](_0x63c0('0xba'),{'UserId':Number(_0x4602c8['query'][_0x63c0('0x73')][_0x3e0e4a]),'OpenchannelAccountId':Number(_0x4602c8[_0x63c0('0x6b')]['id'])});}}else{socket[_0x63c0('0xb7')](_0x63c0('0xba'),{'UserId':Number(_0x4602c8['query'][_0x63c0('0x73')]),'OpenchannelAccountId':Number(_0x4602c8[_0x63c0('0x6b')]['id'])});}});}})[_0x63c0('0x23')](respondWithStatusCode(_0x890175,null))[_0x63c0('0x2d')](handleError(_0x890175,null));};exports[_0x63c0('0xbb')]=function(_0x45f98f,_0x33ad00,_0x11ed8e){var _0x2574db={};var _0x5c1022={};var _0x2d4a47;var _0x527ca4;return db[_0x63c0('0x58')][_0x63c0('0x6f')]({'where':{'id':_0x45f98f[_0x63c0('0x6b')]['id']}})[_0x63c0('0x23')](handleEntityNotFound(_0x33ad00,null))[_0x63c0('0x23')](function(_0x5dbccb){if(_0x5dbccb){_0x2d4a47=_0x5dbccb;_0x5c1022[_0x63c0('0x47')]=_[_0x63c0('0x49')](db[_0x63c0('0xa4')][_0x63c0('0x5e')]);_0x5c1022[_0x63c0('0x48')]=_[_0x63c0('0x49')](_0x45f98f[_0x63c0('0x48')]);_0x5c1022[_0x63c0('0x4a')]=_[_0x63c0('0x4b')](_0x5c1022[_0x63c0('0x47')],_0x5c1022[_0x63c0('0x48')]);_0x2574db[_0x63c0('0x4c')]=_[_0x63c0('0x4b')](_0x5c1022[_0x63c0('0x47')],qs[_0x63c0('0x4d')](_0x45f98f[_0x63c0('0x48')][_0x63c0('0x4d')]));_0x2574db[_0x63c0('0x4c')]=_0x2574db['attributes'][_0x63c0('0x4e')]?_0x2574db['attributes']:_0x5c1022[_0x63c0('0x47')];_0x2574db['order']=qs[_0x63c0('0x51')](_0x45f98f[_0x63c0('0x48')][_0x63c0('0x51')]);_0x2574db[_0x63c0('0x52')]=qs[_0x63c0('0x4a')](_[_0x63c0('0x53')](_0x45f98f[_0x63c0('0x48')],_0x5c1022['filters']));if(_0x45f98f[_0x63c0('0x48')][_0x63c0('0x54')]){_0x2574db['where']=_['merge'](_0x2574db[_0x63c0('0x52')],{'$or':_[_0x63c0('0x43')](_0x2574db['attributes'],function(_0x151cf5){var _0x263890={};_0x263890[_0x151cf5]={'$like':'%'+_0x45f98f[_0x63c0('0x48')][_0x63c0('0x54')]+'%'};return _0x263890;})});}_0x2574db=_[_0x63c0('0x55')]({},_0x2574db,_0x45f98f[_0x63c0('0x57')]);return _0x2d4a47[_0x63c0('0xbb')](_0x2574db);}})['then'](function(_0x1e0460){if(_0x1e0460){_0x527ca4=_0x1e0460[_0x63c0('0x4e')];if(!_0x45f98f['query'][_0x63c0('0x4f')]('nolimit')){_0x2574db[_0x63c0('0x35')]=qs[_0x63c0('0x35')](_0x45f98f[_0x63c0('0x48')][_0x63c0('0x35')]);_0x2574db[_0x63c0('0x32')]=qs[_0x63c0('0x32')](_0x45f98f[_0x63c0('0x48')][_0x63c0('0x32')]);}return _0x2d4a47['getAgents'](_0x2574db);}})[_0x63c0('0x23')](function(_0xb42058){if(_0xb42058){return _0xb42058?{'count':_0x527ca4,'rows':_0xb42058}:null;}})[_0x63c0('0x23')](respondWithResult(_0x33ad00,null))[_0x63c0('0x2d')](handleError(_0x33ad00,null));};exports['send']=function(_0x5529ac,_0x554899,_0x5da73c){var _0x1ae63d,_0x470ecb,_0x2c17ae;if(_[_0x63c0('0x7f')](_0x5529ac[_0x63c0('0x61')][_0x63c0('0x61')])||_0x5529ac['body']['body']===''){throw new db[(_0x63c0('0x81'))][(_0x63c0('0x79'))](_0x63c0('0x83'));}if(_[_0x63c0('0x7f')](_0x5529ac[_0x63c0('0x61')]['to'])){}_0x1ae63d=_0x5529ac[_0x63c0('0x61')]['to'];return db['OpenchannelAccount'][_0x63c0('0x6f')]({'where':{'id':_0x5529ac[_0x63c0('0x6b')]['id']}})['then'](handleEntityNotFound(_0x554899,null))['then'](function(_0x337a51){if(_0x337a51){return db[_0x63c0('0x58')][_0x63c0('0x5f')]({'where':{'id':_0x337a51['id']},'include':[{'model':db[_0x63c0('0xbc')],'as':'List','include':[{'model':db[_0x63c0('0x89')],'as':_0x63c0('0x8a'),'where':{[_0x337a51[_0x63c0('0x84')]]:_0x1ae63d},'limit':0x1,'order':[[_0x63c0('0x7c'),_0x63c0('0xbd')]]}]}]})[_0x63c0('0x23')](handleEntityNotFound(_0x554899,null))[_0x63c0('0x23')](function(_0x1977de){if(_0x1977de&&_0x1977de[_0x63c0('0x88')]){_0x470ecb=_0x1977de['get']({'plain':!![]});if(_0x470ecb[_0x63c0('0x88')]&&_0x470ecb[_0x63c0('0x88')][_0x63c0('0x8a')][_0x63c0('0x4e')]){return _0x470ecb[_0x63c0('0x88')][_0x63c0('0x8a')][0x0];}return db[_0x63c0('0x89')][_0x63c0('0x60')](_[_0x63c0('0x92')](_0x5529ac[_0x63c0('0x61')],{'firstName':_0x1ae63d,[_0x1977de[_0x63c0('0x84')]]:_0x1ae63d,'phone':_0x1ae63d,'ListId':_0x470ecb[_0x63c0('0x7e')]}));}})[_0x63c0('0x23')](handleEntityNotFound(_0x554899,null))[_0x63c0('0x23')](function(_0x1f7dbf){if(_0x1f7dbf){_0x2c17ae=_0x1f7dbf;return db[_0x63c0('0x98')]['find']({'where':{'ContactId':_0x2c17ae['id'],'closed':![],'OpenchannelAccountId':_0x470ecb['id']}})['then'](function(_0x518236){if(_0x518236){return[_0x518236,![]];}return db['OpenchannelInteraction']['create']({'UserId':_0x5529ac[_0x63c0('0x65')]['id'],'ContactId':_0x2c17ae['id'],'OpenchannelAccountId':_0x470ecb['id'],'lastMsgDirection':_0x63c0('0xbe'),'Messages':[_['merge'](_0x5529ac[_0x63c0('0x61')],{'read':![],'body':_0x5529ac['body'][_0x63c0('0x61')],'OpenchannelAccountId':_0x470ecb['id'],'UserId':_0x5529ac[_0x63c0('0x65')]['id'],'ContactId':_0x2c17ae['id']})]},{'include':[{'model':db[_0x63c0('0xa1')],'as':_0x63c0('0xbf')}]})[_0x63c0('0x23')](function(_0x246bfc){return[_0x246bfc,!![]];});});}})[_0x63c0('0xc0')](function(_0xa64730,_0x5184c2){if(_0x5184c2){return _0xa64730;}return db[_0x63c0('0xa1')][_0x63c0('0x60')](_['merge'](_0x5529ac[_0x63c0('0x61')],{'read':![],'body':_0x5529ac[_0x63c0('0x61')][_0x63c0('0x61')],'OpenchannelAccountId':_0x470ecb['id'],'OpenchannelInteractionId':_0xa64730['id'],'UserId':_0x5529ac[_0x63c0('0x65')]['id'],'ContactId':_0x2c17ae['id']}))[_0x63c0('0x23')](function(_0x5db252){_0xa64730['dataValues'][_0x63c0('0xbf')]=[];_0xa64730['dataValues'][_0x63c0('0xbf')][_0x63c0('0x9d')](_0x5db252[_0x63c0('0xc1')]);return _0xa64730;});});}})[_0x63c0('0x23')](respondWithResult(_0x554899,null))['catch'](handleError(_0x554899,null));}; \ No newline at end of file +var _0xc322=['isArray','userOpenchannelAccount:remove','getAgents','CmList','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','fs-extra','lodash','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','redis','defaults','localhost','./openchannelAccount.socket','register','jayson/promise','http','info','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','update','then','destroy','get','UserProfileResource','stack','name','send','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','type','key','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','options','includeAll','findAll','rows','show','params','keys','include','merge','catch','create','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','nolimit','pick','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','openchannel','CmContact','Sequelize','ValidationError','updatedAt','difference','CompanyId','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','Contacts','DESC','List','account','list','applications','orderBy','priority','asc','Applications','ListId','contact','lastName','threadId','externalUrl','OpenchannelInteraction','spread','firstName','messageId','interaction','created','push','close','unmanaged','*,*,*,*','OpenchannelMessage','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','transaction','OpenchannelApplication','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','fullname','internal','Tag','Tags','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents'];(function(_0x17b9d5,_0x31243a){var _0x51629a=function(_0x2b136f){while(--_0x2b136f){_0x17b9d5['push'](_0x17b9d5['shift']());}};_0x51629a(++_0x31243a);}(_0xc322,0x17d));var _0x2c32=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xc322[_0x1ddedd];return _0xa3e1ac;};'use strict';var emlformat=require(_0x2c32('0x0'));var rimraf=require(_0x2c32('0x1'));var zipdir=require(_0x2c32('0x2'));var jsonpatch=require(_0x2c32('0x3'));var rp=require(_0x2c32('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2c32('0x5'));var util=require('util');var path=require(_0x2c32('0x6'));var sox=require(_0x2c32('0x7'));var csv=require(_0x2c32('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2c32('0x9'));var _=require(_0x2c32('0xa'));var squel=require('squel');var crypto=require(_0x2c32('0xb'));var jsforce=require(_0x2c32('0xc'));var deskjs=require(_0x2c32('0xd'));var toCsv=require('to-csv');var querystring=require(_0x2c32('0xe'));var Papa=require(_0x2c32('0xf'));var Redis=require(_0x2c32('0x10'));var authService=require(_0x2c32('0x11'));var qs=require(_0x2c32('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2c32('0x13'));var logger=require(_0x2c32('0x14'))(_0x2c32('0x15'));var utils=require(_0x2c32('0x16'));var config=require(_0x2c32('0x17'));var licenseUtil=require(_0x2c32('0x18'));var db=require(_0x2c32('0x19'))['db'];config[_0x2c32('0x1a')]=_[_0x2c32('0x1b')](config[_0x2c32('0x1a')],{'host':_0x2c32('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2c32('0x1a')]));require(_0x2c32('0x1d'))[_0x2c32('0x1e')](socket);var jayson=require(_0x2c32('0x1f'));var client=jayson['client'][_0x2c32('0x20')]({'port':0x232c});var client9002=jayson['client'][_0x2c32('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x1667f2,_0x103246,_0x9d5bb6,_0x2cfe6a){return new BPromise(function(_0x370061,_0x40b611){var _0x4bf484=_0x2cfe6a||client;return _0x4bf484['request'](_0x1667f2,_0x9d5bb6)['then'](function(_0x5ab3cf){logger[_0x2c32('0x21')]('OpenchannelAccount,\x20%s,\x20%s',_0x103246,_0x2c32('0x22'));logger[_0x2c32('0x23')](_0x2c32('0x24'),_0x103246,_0x2c32('0x22'),JSON[_0x2c32('0x25')](_0x5ab3cf));if(_0x5ab3cf[_0x2c32('0x26')]){if(_0x5ab3cf[_0x2c32('0x26')][_0x2c32('0x27')]===0x1f4){logger[_0x2c32('0x26')](_0x2c32('0x28'),_0x103246,_0x5ab3cf[_0x2c32('0x26')][_0x2c32('0x29')]);return _0x40b611(_0x5ab3cf[_0x2c32('0x26')][_0x2c32('0x29')]);}logger[_0x2c32('0x26')](_0x2c32('0x28'),_0x103246,_0x5ab3cf['error'][_0x2c32('0x29')]);return _0x370061(_0x5ab3cf[_0x2c32('0x26')]['message']);}else{logger[_0x2c32('0x21')]('OpenchannelAccount,\x20%s,\x20%s',_0x103246,_0x2c32('0x22'));_0x370061(_0x5ab3cf['result']['message']);}})['catch'](function(_0x17ceca){logger[_0x2c32('0x26')](_0x2c32('0x28'),_0x103246,_0x17ceca);_0x40b611(_0x17ceca);});});}function respondWithStatusCode(_0x2105d5,_0x74f500){_0x74f500=_0x74f500||0xcc;return function(_0x25f00e){if(_0x25f00e){return _0x2105d5[_0x2c32('0x2a')](_0x74f500);}return _0x2105d5[_0x2c32('0x2b')](_0x74f500)[_0x2c32('0x2c')]();};}function respondWithResult(_0x2a280a,_0x395e5e){_0x395e5e=_0x395e5e||0xc8;return function(_0x257d40){if(_0x257d40){return _0x2a280a[_0x2c32('0x2b')](_0x395e5e)[_0x2c32('0x2d')](_0x257d40);}};}function respondWithFilteredResult(_0x38b90a,_0x2a3b83){return function(_0x119da0){if(_0x119da0){var _0x5492e7=typeof _0x2a3b83[_0x2c32('0x2e')]===_0x2c32('0x2f')&&typeof _0x2a3b83[_0x2c32('0x30')]===_0x2c32('0x2f');var _0x1753a4=_0x119da0[_0x2c32('0x31')];var _0x1b2b34=_0x5492e7?0x0:_0x2a3b83['offset'];var _0x57013b=_0x5492e7?_0x119da0[_0x2c32('0x31')]:_0x2a3b83[_0x2c32('0x2e')]+_0x2a3b83[_0x2c32('0x30')];var _0x413915;if(_0x57013b>=_0x1753a4){_0x57013b=_0x1753a4;_0x413915=0xc8;}else{_0x413915=0xce;}_0x38b90a['status'](_0x413915);return _0x38b90a[_0x2c32('0x32')]('Content-Range',_0x1b2b34+'-'+_0x57013b+'/'+_0x1753a4)[_0x2c32('0x2d')](_0x119da0);}return null;};}function patchUpdates(_0x20d455){return function(_0x2b8924){try{jsonpatch['apply'](_0x2b8924,_0x20d455,!![]);}catch(_0x27a325){return BPromise[_0x2c32('0x33')](_0x27a325);}return _0x2b8924['save']();};}function saveUpdates(_0xc7977f,_0x45e235){return function(_0x47469c){if(_0x47469c){return _0x47469c[_0x2c32('0x34')](_0xc7977f)[_0x2c32('0x35')](function(_0x5ca70e){return _0x5ca70e;});}return null;};}function removeEntity(_0x3834d3,_0x139306){return function(_0x20042f){if(_0x20042f){return _0x20042f[_0x2c32('0x36')]()[_0x2c32('0x35')](function(){var _0x275726=_0x20042f[_0x2c32('0x37')]({'plain':!![]});var _0x1cb040='OpenchannelAccounts';return db[_0x2c32('0x38')][_0x2c32('0x36')]({'where':{'type':_0x1cb040,'resourceId':_0x275726['id']}})[_0x2c32('0x35')](function(){return _0x20042f;});})[_0x2c32('0x35')](function(){_0x3834d3[_0x2c32('0x2b')](0xcc)[_0x2c32('0x2c')]();});}};}function handleEntityNotFound(_0x2f031a,_0x332da0){return function(_0x1c0197){if(!_0x1c0197){_0x2f031a[_0x2c32('0x2a')](0x194);}return _0x1c0197;};}function handleError(_0x17f161,_0x5586f4){_0x5586f4=_0x5586f4||0x1f4;return function(_0x4167b2){logger['error'](_0x4167b2[_0x2c32('0x39')]);if(_0x4167b2['name']){delete _0x4167b2[_0x2c32('0x3a')];}_0x17f161[_0x2c32('0x2b')](_0x5586f4)[_0x2c32('0x3b')](_0x4167b2);};}exports['index']=function(_0x355df9,_0x3102f1){var _0xd5ecdd={'include':[{'model':db[_0x2c32('0x3c')],'as':_0x2c32('0x3d')}]},_0x28b7d1={},_0x36b003={'count':0x0,'rows':[]};var _0x22acda=_[_0x2c32('0x3e')](db[_0x2c32('0x3f')][_0x2c32('0x40')],function(_0xdcde59){return{'name':_0xdcde59[_0x2c32('0x41')],'type':_0xdcde59[_0x2c32('0x42')][_0x2c32('0x43')]};});_0x28b7d1['model']=_[_0x2c32('0x3e')](_0x22acda,_0x2c32('0x3a'));_0x28b7d1[_0x2c32('0x44')]=_['keys'](_0x355df9[_0x2c32('0x44')]);_0x28b7d1[_0x2c32('0x45')]=_['intersection'](_0x28b7d1[_0x2c32('0x46')],_0x28b7d1[_0x2c32('0x44')]);_0xd5ecdd[_0x2c32('0x47')]=_[_0x2c32('0x48')](_0x28b7d1['model'],qs['fields'](_0x355df9[_0x2c32('0x44')][_0x2c32('0x49')]));_0xd5ecdd[_0x2c32('0x47')]=_0xd5ecdd[_0x2c32('0x47')][_0x2c32('0x4a')]?_0xd5ecdd['attributes']:_0x28b7d1[_0x2c32('0x46')];if(!_0x355df9[_0x2c32('0x44')][_0x2c32('0x4b')]('nolimit')){_0xd5ecdd[_0x2c32('0x30')]=qs[_0x2c32('0x30')](_0x355df9[_0x2c32('0x44')]['limit']);_0xd5ecdd['offset']=qs[_0x2c32('0x2e')](_0x355df9['query'][_0x2c32('0x2e')]);}_0xd5ecdd[_0x2c32('0x4c')]=qs[_0x2c32('0x4d')](_0x355df9[_0x2c32('0x44')]['sort']);_0xd5ecdd[_0x2c32('0x4e')]=qs[_0x2c32('0x45')](_['pick'](_0x355df9[_0x2c32('0x44')],_0x28b7d1['filters']),_0x22acda);if(_0x355df9[_0x2c32('0x44')][_0x2c32('0x4f')]){_0xd5ecdd[_0x2c32('0x4e')]=_['merge'](_0xd5ecdd[_0x2c32('0x4e')],{'$or':_[_0x2c32('0x3e')](_0x22acda,function(_0x1566f7){if(_0x1566f7[_0x2c32('0x42')]!==_0x2c32('0x50')){var _0x1274ed={};_0x1274ed[_0x1566f7['name']]={'$like':'%'+_0x355df9['query']['filter']+'%'};return _0x1274ed;}})});}_0xd5ecdd=_['merge']({},_0xd5ecdd,_0x355df9[_0x2c32('0x51')]);var _0x597b0f={'where':_0xd5ecdd[_0x2c32('0x4e')]};return db[_0x2c32('0x3f')][_0x2c32('0x31')](_0x597b0f)['then'](function(_0x4638e6){_0x36b003[_0x2c32('0x31')]=_0x4638e6;if(_0x355df9['query'][_0x2c32('0x52')]){_0xd5ecdd['include']=[{'all':!![]}];}return db['OpenchannelAccount'][_0x2c32('0x53')](_0xd5ecdd);})[_0x2c32('0x35')](function(_0x53c435){_0x36b003[_0x2c32('0x54')]=_0x53c435;return _0x36b003;})[_0x2c32('0x35')](respondWithFilteredResult(_0x3102f1,_0xd5ecdd))['catch'](handleError(_0x3102f1,null));};exports[_0x2c32('0x55')]=function(_0x584a5b,_0x1fda90){var _0x1de8c8={'raw':![],'where':{'id':_0x584a5b[_0x2c32('0x56')]['id']},'include':[{'model':db[_0x2c32('0x3c')],'as':_0x2c32('0x3d')}]},_0x58251c={};_0x58251c['model']=_[_0x2c32('0x57')](db[_0x2c32('0x3f')][_0x2c32('0x40')]);_0x58251c[_0x2c32('0x44')]=_['keys'](_0x584a5b[_0x2c32('0x44')]);_0x58251c[_0x2c32('0x45')]=_[_0x2c32('0x48')](_0x58251c[_0x2c32('0x46')],_0x58251c['query']);_0x1de8c8[_0x2c32('0x47')]=_[_0x2c32('0x48')](_0x58251c[_0x2c32('0x46')],qs[_0x2c32('0x49')](_0x584a5b[_0x2c32('0x44')]['fields']));_0x1de8c8[_0x2c32('0x47')]=_0x1de8c8[_0x2c32('0x47')][_0x2c32('0x4a')]?_0x1de8c8['attributes']:_0x58251c['model'];if(_0x584a5b['query']['includeAll']){_0x1de8c8[_0x2c32('0x58')]=[{'all':!![]}];}_0x1de8c8=_[_0x2c32('0x59')]({},_0x1de8c8,_0x584a5b[_0x2c32('0x51')]);return db['OpenchannelAccount']['find'](_0x1de8c8)['then'](handleEntityNotFound(_0x1fda90,null))['then'](respondWithResult(_0x1fda90,null))[_0x2c32('0x5a')](handleError(_0x1fda90,null));};exports['create']=function(_0x517050,_0x33a55d){return db[_0x2c32('0x3f')][_0x2c32('0x5b')](_0x517050['body'],{})['then'](function(_0x43b9e1){var _0x32788b=_0x517050['user'][_0x2c32('0x37')]({'plain':!![]});if(!_0x32788b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x32788b['role']===_0x2c32('0x5c')){var _0x341e37=_0x43b9e1[_0x2c32('0x37')]({'plain':!![]});var _0x2cec3b='OpenchannelAccounts';return db[_0x2c32('0x5d')][_0x2c32('0x5e')]({'where':{'name':_0x2cec3b,'userProfileId':_0x32788b[_0x2c32('0x5f')]},'raw':!![]})[_0x2c32('0x35')](function(_0x2d3e27){if(_0x2d3e27&&_0x2d3e27[_0x2c32('0x60')]===0x0){return db[_0x2c32('0x38')][_0x2c32('0x5b')]({'name':_0x341e37[_0x2c32('0x3a')],'resourceId':_0x341e37['id'],'type':_0x2d3e27[_0x2c32('0x3a')],'sectionId':_0x2d3e27['id']},{})[_0x2c32('0x35')](function(){return _0x43b9e1;});}else{return _0x43b9e1;}})[_0x2c32('0x5a')](function(_0x5bcc24){logger[_0x2c32('0x26')](_0x2c32('0x61'),_0x5bcc24);throw _0x5bcc24;});}return _0x43b9e1;})[_0x2c32('0x35')](respondWithResult(_0x33a55d,0xc9))[_0x2c32('0x5a')](handleError(_0x33a55d,null));};exports['update']=function(_0x40ec19,_0x511e56){if(_0x40ec19[_0x2c32('0x62')]['id']){delete _0x40ec19[_0x2c32('0x62')]['id'];}return db[_0x2c32('0x3f')]['find']({'where':{'id':_0x40ec19['params']['id']},'include':[{'model':db[_0x2c32('0x3c')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x511e56,null))[_0x2c32('0x35')](saveUpdates(_0x40ec19['body'],null))[_0x2c32('0x35')](respondWithResult(_0x511e56,null))[_0x2c32('0x5a')](handleError(_0x511e56,null));};exports[_0x2c32('0x36')]=function(_0x80dbe4,_0x5f34e9){return db[_0x2c32('0x3f')]['find']({'where':{'id':_0x80dbe4['params']['id']}})[_0x2c32('0x35')](handleEntityNotFound(_0x5f34e9,null))[_0x2c32('0x35')](removeEntity(_0x5f34e9,null))[_0x2c32('0x5a')](handleError(_0x5f34e9,null));};exports['describe']=function(_0x2ce47a,_0x2e249d){return db[_0x2c32('0x3f')][_0x2c32('0x63')]()[_0x2c32('0x35')](respondWithResult(_0x2e249d,null))[_0x2c32('0x5a')](handleError(_0x2e249d,null));};exports[_0x2c32('0x64')]=function(_0x2c88c9,_0x1a7e8c,_0x435825){if(_0x2c88c9[_0x2c32('0x62')]['id']){delete _0x2c88c9[_0x2c32('0x62')]['id'];}return db[_0x2c32('0x3f')][_0x2c32('0x5e')]({'where':{'id':_0x2c88c9[_0x2c32('0x56')]['id']}})[_0x2c32('0x35')](handleEntityNotFound(_0x1a7e8c,null))[_0x2c32('0x35')](function(_0x380bd8){if(_0x380bd8){_0x2c88c9['body'][_0x2c32('0x65')]=_0x380bd8['id'];return db[_0x2c32('0x66')][_0x2c32('0x5b')](_0x2c88c9[_0x2c32('0x62')]);}})['then'](respondWithResult(_0x1a7e8c,null))[_0x2c32('0x5a')](handleError(_0x1a7e8c,null));};exports[_0x2c32('0x67')]=function(_0x85e872,_0x578bab,_0x56a009){var _0x2d2b3a={'raw':![],'where':{}};var _0x41c272={};var _0x311726={'count':0x0,'rows':[]};return db[_0x2c32('0x3f')][_0x2c32('0x68')]({'where':{'id':_0x85e872['params']['id']}})['then'](handleEntityNotFound(_0x578bab,null))[_0x2c32('0x35')](function(_0x1246ad){if(_0x1246ad){_0x41c272[_0x2c32('0x46')]=_[_0x2c32('0x57')](db['Disposition'][_0x2c32('0x40')]);_0x41c272[_0x2c32('0x44')]=_['keys'](_0x85e872[_0x2c32('0x44')]);_0x41c272['filters']=_[_0x2c32('0x48')](_0x41c272[_0x2c32('0x46')],_0x41c272[_0x2c32('0x44')]);_0x2d2b3a[_0x2c32('0x47')]=_[_0x2c32('0x48')](_0x41c272[_0x2c32('0x46')],qs[_0x2c32('0x49')](_0x85e872[_0x2c32('0x44')][_0x2c32('0x49')]));_0x2d2b3a[_0x2c32('0x47')]=_0x2d2b3a[_0x2c32('0x47')][_0x2c32('0x4a')]?_0x2d2b3a['attributes']:_0x41c272[_0x2c32('0x46')];if(!_0x85e872[_0x2c32('0x44')]['hasOwnProperty'](_0x2c32('0x69'))){_0x2d2b3a['limit']=qs['limit'](_0x85e872[_0x2c32('0x44')][_0x2c32('0x30')]);_0x2d2b3a[_0x2c32('0x2e')]=qs[_0x2c32('0x2e')](_0x85e872[_0x2c32('0x44')][_0x2c32('0x2e')]);}_0x2d2b3a[_0x2c32('0x4c')]=qs[_0x2c32('0x4d')](_0x85e872[_0x2c32('0x44')][_0x2c32('0x4d')]);_0x2d2b3a[_0x2c32('0x4e')]=qs[_0x2c32('0x45')](_[_0x2c32('0x6a')](_0x85e872['query'],_0x41c272[_0x2c32('0x45')]));_0x2d2b3a[_0x2c32('0x4e')][_0x2c32('0x65')]=_0x1246ad['id'];if(_0x85e872[_0x2c32('0x44')][_0x2c32('0x4f')]){_0x2d2b3a[_0x2c32('0x4e')]=_['merge'](_0x2d2b3a[_0x2c32('0x4e')],{'$or':_[_0x2c32('0x3e')](_0x2d2b3a[_0x2c32('0x47')],function(_0x59459a){var _0x16c842={};_0x16c842[_0x59459a]={'$like':'%'+_0x85e872[_0x2c32('0x44')]['filter']+'%'};return _0x16c842;})});}_0x2d2b3a=_[_0x2c32('0x59')]({},_0x2d2b3a,_0x85e872['options']);return db[_0x2c32('0x66')][_0x2c32('0x31')]({'where':_0x2d2b3a[_0x2c32('0x4e')]})[_0x2c32('0x35')](function(_0x1e3aa5){_0x311726['count']=_0x1e3aa5;if(_0x85e872[_0x2c32('0x44')][_0x2c32('0x52')]){_0x2d2b3a['include']=[{'all':!![]}];}return db[_0x2c32('0x66')][_0x2c32('0x53')](_0x2d2b3a);})[_0x2c32('0x35')](function(_0x537f2f){_0x311726[_0x2c32('0x54')]=_0x537f2f;return _0x311726;});}})[_0x2c32('0x35')](respondWithFilteredResult(_0x578bab,_0x2d2b3a))[_0x2c32('0x5a')](handleError(_0x578bab,null));};exports[_0x2c32('0x6b')]=function(_0x5e107d,_0x2c02a7,_0x268f77){return db['OpenchannelAccount'][_0x2c32('0x5e')]({'where':{'id':_0x5e107d[_0x2c32('0x56')]['id']}})[_0x2c32('0x35')](handleEntityNotFound(_0x2c02a7,null))['then'](function(_0x375f7d){if(_0x375f7d){return _0x375f7d['removeDispositions'](_0x5e107d[_0x2c32('0x44')][_0x2c32('0x6c')]);}})[_0x2c32('0x35')](respondWithStatusCode(_0x2c02a7,null))[_0x2c32('0x5a')](handleError(_0x2c02a7,null));};exports[_0x2c32('0x6d')]=function(_0x34bd6f,_0x3808c8,_0x27f056){if(_0x34bd6f['body']['id']){delete _0x34bd6f[_0x2c32('0x62')]['id'];}return db[_0x2c32('0x3f')][_0x2c32('0x5e')]({'where':{'id':_0x34bd6f[_0x2c32('0x56')]['id']}})['then'](handleEntityNotFound(_0x3808c8,null))[_0x2c32('0x35')](function(_0x5daad8){if(_0x5daad8){_0x34bd6f['body']['OpenchannelAccountId']=_0x5daad8['id'];return db[_0x2c32('0x6e')][_0x2c32('0x5b')](_0x34bd6f['body']);}})[_0x2c32('0x35')](respondWithResult(_0x3808c8,null))[_0x2c32('0x5a')](handleError(_0x3808c8,null));};exports[_0x2c32('0x6f')]=function(_0x3829ed,_0x5de8d0,_0x25f173){var _0x592af0={'raw':![],'where':{}};var _0x120aaf={};var _0x19e2b8={'count':0x0,'rows':[]};return db['OpenchannelAccount']['findOne']({'where':{'id':_0x3829ed[_0x2c32('0x56')]['id']}})['then'](handleEntityNotFound(_0x5de8d0,null))['then'](function(_0x10fe1d){if(_0x10fe1d){_0x120aaf[_0x2c32('0x46')]=_[_0x2c32('0x57')](db['CannedAnswer']['rawAttributes']);_0x120aaf[_0x2c32('0x44')]=_[_0x2c32('0x57')](_0x3829ed[_0x2c32('0x44')]);_0x120aaf[_0x2c32('0x45')]=_[_0x2c32('0x48')](_0x120aaf[_0x2c32('0x46')],_0x120aaf[_0x2c32('0x44')]);_0x592af0['attributes']=_[_0x2c32('0x48')](_0x120aaf['model'],qs['fields'](_0x3829ed[_0x2c32('0x44')][_0x2c32('0x49')]));_0x592af0[_0x2c32('0x47')]=_0x592af0[_0x2c32('0x47')][_0x2c32('0x4a')]?_0x592af0[_0x2c32('0x47')]:_0x120aaf['model'];if(!_0x3829ed[_0x2c32('0x44')][_0x2c32('0x4b')](_0x2c32('0x69'))){_0x592af0[_0x2c32('0x30')]=qs[_0x2c32('0x30')](_0x3829ed[_0x2c32('0x44')][_0x2c32('0x30')]);_0x592af0['offset']=qs[_0x2c32('0x2e')](_0x3829ed[_0x2c32('0x44')][_0x2c32('0x2e')]);}_0x592af0[_0x2c32('0x4c')]=qs[_0x2c32('0x4d')](_0x3829ed['query'][_0x2c32('0x4d')]);_0x592af0[_0x2c32('0x4e')]=qs['filters'](_[_0x2c32('0x6a')](_0x3829ed[_0x2c32('0x44')],_0x120aaf[_0x2c32('0x45')]));_0x592af0[_0x2c32('0x4e')]['OpenchannelAccountId']=_0x10fe1d['id'];if(_0x3829ed[_0x2c32('0x44')][_0x2c32('0x4f')]){_0x592af0['where']=_[_0x2c32('0x59')](_0x592af0['where'],{'$or':_[_0x2c32('0x3e')](_0x592af0['attributes'],function(_0x2c56e8){var _0x58e586={};_0x58e586[_0x2c56e8]={'$like':'%'+_0x3829ed[_0x2c32('0x44')][_0x2c32('0x4f')]+'%'};return _0x58e586;})});}_0x592af0=_[_0x2c32('0x59')]({},_0x592af0,_0x3829ed[_0x2c32('0x51')]);return db['CannedAnswer'][_0x2c32('0x31')]({'where':_0x592af0[_0x2c32('0x4e')]})[_0x2c32('0x35')](function(_0x42c59d){_0x19e2b8[_0x2c32('0x31')]=_0x42c59d;if(_0x3829ed['query'][_0x2c32('0x52')]){_0x592af0[_0x2c32('0x58')]=[{'all':!![]}];}return db[_0x2c32('0x6e')][_0x2c32('0x53')](_0x592af0);})[_0x2c32('0x35')](function(_0x79c509){_0x19e2b8['rows']=_0x79c509;return _0x19e2b8;});}})[_0x2c32('0x35')](respondWithFilteredResult(_0x5de8d0,_0x592af0))['catch'](handleError(_0x5de8d0,null));};exports[_0x2c32('0x70')]=function(_0x756be4,_0x505c5d,_0x1ae44f){return db[_0x2c32('0x3f')][_0x2c32('0x5e')]({'where':{'id':_0x756be4[_0x2c32('0x56')]['id']}})[_0x2c32('0x35')](handleEntityNotFound(_0x505c5d,null))['then'](function(_0xcdd9fa){if(_0xcdd9fa){return _0xcdd9fa['removeAnswers'](_0x756be4[_0x2c32('0x44')][_0x2c32('0x6c')]);}})[_0x2c32('0x35')](respondWithStatusCode(_0x505c5d,null))['catch'](handleError(_0x505c5d,null));};exports['notify']=function(_0x4a3b2d,_0x56ad15,_0x5d9386){var _0x380b6d={'body':_0x4a3b2d['body'],'channel':_0x2c32('0x71')};var _0x2552be=[];var _0x412122=[];var _0x1f4cf5={};var _0x764d7e=![];return db[_0x2c32('0x72')]['describe']()[_0x2c32('0x35')](function(_0x2a6e5e){if(!_0x2a6e5e){throw new db[(_0x2c32('0x73'))][(_0x2c32('0x74'))]('no\x20available\x20attributes');}_0x2552be=_['difference'](_[_0x2c32('0x57')](_0x2a6e5e),['createdAt',_0x2c32('0x75')]);_0x412122=_[_0x2c32('0x76')](_[_0x2c32('0x57')](_0x2a6e5e),['createdAt','updatedAt',_0x2c32('0x77'),'ListId']);if(_0x4a3b2d[_0x2c32('0x62')]['id']){delete _0x4a3b2d['body']['id'];}if(_[_0x2c32('0x78')](_0x4a3b2d[_0x2c32('0x62')][_0x2c32('0x79')])){throw new db[(_0x2c32('0x73'))][(_0x2c32('0x74'))]('from\x20is\x20mandatory');}if(_[_0x2c32('0x78')](_0x4a3b2d[_0x2c32('0x62')][_0x2c32('0x62')])||_0x4a3b2d[_0x2c32('0x62')][_0x2c32('0x62')]===''){throw new db[(_0x2c32('0x73'))][(_0x2c32('0x74'))](_0x2c32('0x7a'));}if(_['isNil'](_0x4a3b2d[_0x2c32('0x62')][_0x2c32('0x7b')])){throw new db[(_0x2c32('0x73'))][(_0x2c32('0x74'))](_0x2c32('0x7c')+_0x412122);}if(!_[_0x2c32('0x7d')](_0x412122,_0x4a3b2d[_0x2c32('0x62')][_0x2c32('0x7b')])){throw new db[(_0x2c32('0x73'))]['ValidationError'](_0x2c32('0x7e')+_0x412122);}_0x1f4cf5[_0x4a3b2d[_0x2c32('0x62')]['mapKey']]=_0x4a3b2d[_0x2c32('0x62')][_0x2c32('0x79')];})[_0x2c32('0x35')](function(){return db[_0x2c32('0x3f')][_0x2c32('0x5e')]({'where':{'id':_0x4a3b2d[_0x2c32('0x56')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x2c32('0x72')],'as':_0x2c32('0x7f'),'where':_0x1f4cf5,'limit':0x1,'order':[[_0x2c32('0x75'),_0x2c32('0x80')]]}]},{'model':db['OpenchannelApplication'],'as':'Applications'}]});})[_0x2c32('0x35')](handleEntityNotFound(_0x56ad15,null))['then'](function(_0x54e052){if(_0x54e052&&_0x54e052[_0x2c32('0x81')]){_0x380b6d[_0x2c32('0x82')]=_0x54e052;_0x380b6d['applications']=_0x54e052['Applications'];_0x380b6d[_0x2c32('0x83')]=_0x54e052[_0x2c32('0x81')];_0x380b6d[_0x2c32('0x84')]=_[_0x2c32('0x85')](_0x380b6d[_0x2c32('0x84')],[_0x2c32('0x86')],[_0x2c32('0x87')]);if(_0x380b6d[_0x2c32('0x82')][_0x2c32('0x88')]){delete _0x380b6d[_0x2c32('0x82')][_0x2c32('0x88')];}if(_0x380b6d[_0x2c32('0x82')]['List']&&_0x380b6d['account'][_0x2c32('0x81')][_0x2c32('0x7f')][_0x2c32('0x4a')]){return _0x380b6d[_0x2c32('0x82')][_0x2c32('0x81')][_0x2c32('0x7f')][0x0];}var _0x4fb4ac=_[_0x2c32('0x1b')](_0x4a3b2d[_0x2c32('0x62')],{'firstName':_0x4a3b2d[_0x2c32('0x62')][_0x2c32('0x79')],'ListId':_0x54e052[_0x2c32('0x89')]});_0x4fb4ac[_0x4a3b2d[_0x2c32('0x62')][_0x2c32('0x7b')]]=_0x4a3b2d['body'][_0x2c32('0x79')];return db[_0x2c32('0x72')][_0x2c32('0x5b')](_0x4fb4ac,{'fields':_0x2552be,'raw':!![]});}})[_0x2c32('0x35')](handleEntityNotFound(_0x56ad15,null))[_0x2c32('0x35')](function(_0xe8151e){_0x380b6d[_0x2c32('0x8a')]=_0xe8151e;if(_0xe8151e){var _0x5a850a={'ContactId':_0xe8151e['id'],'OpenchannelAccountId':_0x4a3b2d[_0x2c32('0x56')]['id'],'from':(_0xe8151e['firstName']||'')+'\x20'+(_0xe8151e[_0x2c32('0x8b')]||'')};var _0x476237={'OpenchannelAccountId':_0x4a3b2d[_0x2c32('0x56')]['id'],'closed':![]};if(_0x4a3b2d['body']['threadId']){_0x476237[_0x2c32('0x8c')]=_0x4a3b2d[_0x2c32('0x62')][_0x2c32('0x8c')];return db['OpenchannelInteraction'][_0x2c32('0x5e')]({'where':_0x476237})[_0x2c32('0x35')](function(_0x2c9fb7){if(_0x2c9fb7){return[_0x2c9fb7,![]];}_0x5a850a['threadId']=_0x4a3b2d['body'][_0x2c32('0x8c')];_0x5a850a[_0x2c32('0x8d')]=_0x4a3b2d[_0x2c32('0x62')]['externalUrl'];return db[_0x2c32('0x8e')][_0x2c32('0x5b')](_0x5a850a)[_0x2c32('0x35')](function(_0x3145b4){return[_0x3145b4,!![]];});});}else{_0x476237[_0x2c32('0x8c')]=null;}_0x476237['ContactId']=_0xe8151e['id'];return db[_0x2c32('0x8e')][_0x2c32('0x5e')]({'where':_0x476237})[_0x2c32('0x35')](function(_0x14afe8){if(_0x14afe8){return[_0x14afe8,![]];}return db[_0x2c32('0x8e')][_0x2c32('0x5b')](_0x5a850a)[_0x2c32('0x35')](function(_0x597a13){return[_0x597a13,!![]];});});}})[_0x2c32('0x8f')](function(_0x3a4548,_0x357056){if(_0x3a4548){_0x764d7e=_0x357056;if(!_0x357056){var _0x408691={'from':(_0x380b6d['contact'][_0x2c32('0x90')]||'')+'\x20'+(_0x380b6d[_0x2c32('0x8a')][_0x2c32('0x8b')]||'')};if(_0x4a3b2d['body'][_0x2c32('0x8c')]&&_0x4a3b2d[_0x2c32('0x62')][_0x2c32('0x91')]&&_0x4a3b2d['body'][_0x2c32('0x8c')]!=_0x4a3b2d[_0x2c32('0x62')][_0x2c32('0x91')]){_0x408691[_0x2c32('0x8c')]=_0x4a3b2d[_0x2c32('0x62')][_0x2c32('0x91')];}return _0x3a4548[_0x2c32('0x34')](_0x408691);}else{return _0x3a4548;}}})['then'](function(_0xfb6477){_0x380b6d[_0x2c32('0x92')]=_0xfb6477[_0x2c32('0x37')]({'plain':!![]});_0x380b6d[_0x2c32('0x92')][_0x2c32('0x93')]=_0x764d7e;if(_0x380b6d[_0x2c32('0x92')][_0x2c32('0x93')]){if(_0x380b6d['account']['autoclose']){_0x380b6d[_0x2c32('0x84')][_0x2c32('0x94')]({'id':0x0,'priority':_0x380b6d[_0x2c32('0x84')][_0x2c32('0x4a')]+0x1,'app':_0x2c32('0x95'),'appdata':_0x2c32('0x96'),'interval':_0x2c32('0x97')});}}return db[_0x2c32('0x98')][_0x2c32('0x5b')]({'body':_0x4a3b2d['body'][_0x2c32('0x62')],'OpenchannelAccountId':_0x4a3b2d[_0x2c32('0x56')]['id'],'OpenchannelInteractionId':_0xfb6477['id'],'direction':'in','ContactId':_0x380b6d[_0x2c32('0x8a')]['id'],'AttachmentId':_0x4a3b2d['body']['AttachmentId']});})[_0x2c32('0x35')](function(_0x3b8228){_0x380b6d['message']=_0x3b8228;if(_0x380b6d[_0x2c32('0x92')][_0x2c32('0x99')]){return db[_0x2c32('0x9a')][_0x2c32('0x5e')]({'attributes':['id','name'],'where':{'id':_0x380b6d[_0x2c32('0x92')]['UserId']}})[_0x2c32('0x35')](function(_0x52807f){if(_0x52807f){_0x380b6d[_0x2c32('0x84')][_0x2c32('0x9b')]({'id':0x0,'priority':0x0,'app':_0x2c32('0x9c'),'appdata':_0x52807f[_0x2c32('0x3a')]+','+(_0x380b6d[_0x2c32('0x82')][_0x2c32('0x9d')]||0xa),'interval':'*,*,*,*'});_0x380b6d[_0x2c32('0x9e')]=![];}return respondWithRpcPromise(_0x2c32('0x9f'),_0x2c32('0xa0'),_0x380b6d);});}return respondWithRpcPromise('Start',_0x2c32('0xa0'),_0x380b6d);})[_0x2c32('0x35')](function(_0x1f1f7b){respondWithRpcPromise(_0x2c32('0xa1'),_0x2c32('0xa1'),{'event':'notify','message':_0x1f1f7b},client9002);return _0x1f1f7b;})[_0x2c32('0x35')](respondWithResult(_0x56ad15,null))['catch'](handleError(_0x56ad15,null));};exports['addApplications']=function(_0x288546,_0x4e5748,_0x12be8c){return db[_0x2c32('0x3f')][_0x2c32('0x68')]({'where':{'id':_0x288546['params']['id']}})['then'](handleEntityNotFound(_0x4e5748,null))['then'](function(_0x530b09){if(_0x530b09){return db['sequelize'][_0x2c32('0xa2')](function(_0x450a71){return db[_0x2c32('0xa3')]['destroy']({'where':{'OpenchannelAccountId':_0x288546['params']['id']},'transaction':_0x450a71})[_0x2c32('0x35')](function(_0x2c89c8){var _0x51bc88=_[_0x2c32('0x3e')](_0x288546[_0x2c32('0x62')],function(_0x2e37b6){_0x2e37b6[_0x2c32('0x65')]=_0x288546[_0x2c32('0x56')]['id'];return _0x2e37b6;});return db[_0x2c32('0xa3')][_0x2c32('0xa4')](_0x51bc88,{'transaction':_0x450a71});});})[_0x2c32('0x35')](function(){return db[_0x2c32('0xa3')][_0x2c32('0xa5')]({'where':{'OpenchannelAccountId':_0x288546[_0x2c32('0x56')]['id']},'order':_0x2c32('0x86')});});}})[_0x2c32('0x35')](respondWithResult(_0x4e5748,null))['catch'](handleError(_0x4e5748,null));};exports['getApplications']=function(_0x1a28f0,_0x448061,_0x1673d9){var _0x54e884={};var _0x57c9d5={};var _0x2a8c24;var _0x344b5f;return db['OpenchannelAccount'][_0x2c32('0x68')]({'where':{'id':_0x1a28f0['params']['id']}})[_0x2c32('0x35')](handleEntityNotFound(_0x448061,null))[_0x2c32('0x35')](function(_0x26d23e){if(_0x26d23e){_0x2a8c24=_0x26d23e;_0x57c9d5[_0x2c32('0x46')]=_['keys'](db[_0x2c32('0xa3')]['rawAttributes']);_0x57c9d5[_0x2c32('0x44')]=_[_0x2c32('0x57')](_0x1a28f0[_0x2c32('0x44')]);_0x57c9d5[_0x2c32('0x45')]=_[_0x2c32('0x48')](_0x57c9d5[_0x2c32('0x46')],_0x57c9d5['query']);_0x54e884[_0x2c32('0x47')]=_[_0x2c32('0x48')](_0x57c9d5[_0x2c32('0x46')],qs[_0x2c32('0x49')](_0x1a28f0[_0x2c32('0x44')][_0x2c32('0x49')]));_0x54e884[_0x2c32('0x47')]=_0x54e884['attributes']['length']?_0x54e884[_0x2c32('0x47')]:_0x57c9d5[_0x2c32('0x46')];_0x54e884[_0x2c32('0x4c')]=qs[_0x2c32('0x4d')](_0x1a28f0[_0x2c32('0x44')]['sort']);_0x54e884[_0x2c32('0x4e')]=qs[_0x2c32('0x45')](_[_0x2c32('0x6a')](_0x1a28f0[_0x2c32('0x44')],_0x57c9d5[_0x2c32('0x45')]));if(_0x1a28f0['query'][_0x2c32('0x4f')]){_0x54e884['where']=_[_0x2c32('0x59')](_0x54e884['where'],{'$or':_[_0x2c32('0x3e')](_0x54e884[_0x2c32('0x47')],function(_0x1f4e2b){var _0x49ad53={};_0x49ad53[_0x1f4e2b]={'$like':'%'+_0x1a28f0[_0x2c32('0x44')][_0x2c32('0x4f')]+'%'};return _0x49ad53;})});}_0x54e884=_[_0x2c32('0x59')]({},_0x54e884,_0x1a28f0[_0x2c32('0x51')]);return _0x2a8c24[_0x2c32('0xa6')](_0x54e884);}})['then'](function(_0x49716b){if(_0x49716b){_0x344b5f=_0x49716b['length'];if(!_0x1a28f0[_0x2c32('0x44')][_0x2c32('0x4b')](_0x2c32('0x69'))){_0x54e884[_0x2c32('0x30')]=qs[_0x2c32('0x30')](_0x1a28f0[_0x2c32('0x44')][_0x2c32('0x30')]);_0x54e884[_0x2c32('0x2e')]=qs['offset'](_0x1a28f0[_0x2c32('0x44')]['offset']);}return _0x2a8c24['getApplications'](_0x54e884);}})[_0x2c32('0x35')](function(_0x974a4a){if(_0x974a4a){return _0x974a4a?{'count':_0x344b5f,'rows':_0x974a4a}:null;}})[_0x2c32('0x35')](respondWithResult(_0x448061,null))[_0x2c32('0x5a')](handleError(_0x448061,null));};exports[_0x2c32('0xa7')]=function(_0x4442e2,_0x94cb9b,_0xe89fbe){var _0x20208c={'raw':![],'where':{}};var _0x535545={};var _0x195612={'count':0x0,'rows':[]};return db[_0x2c32('0x3f')][_0x2c32('0x68')]({'where':{'id':_0x4442e2[_0x2c32('0x56')]['id']}})['then'](handleEntityNotFound(_0x94cb9b,null))[_0x2c32('0x35')](function(_0x204874){if(_0x204874){_0x535545[_0x2c32('0x46')]=_[_0x2c32('0x57')](db[_0x2c32('0x8e')][_0x2c32('0x40')]);_0x535545[_0x2c32('0x44')]=_[_0x2c32('0x57')](_0x4442e2[_0x2c32('0x44')]);_0x535545['filters']=_[_0x2c32('0x48')](_0x535545[_0x2c32('0x46')],_0x535545[_0x2c32('0x44')]);_0x20208c[_0x2c32('0x47')]=_['intersection'](_0x535545['model'],qs['fields'](_0x4442e2[_0x2c32('0x44')]['fields']));_0x20208c[_0x2c32('0x47')]=_0x20208c['attributes'][_0x2c32('0x4a')]?_0x20208c[_0x2c32('0x47')]:_0x535545[_0x2c32('0x46')];if(!_0x4442e2[_0x2c32('0x44')][_0x2c32('0x4b')](_0x2c32('0x69'))){_0x20208c[_0x2c32('0x30')]=qs[_0x2c32('0x30')](_0x4442e2[_0x2c32('0x44')][_0x2c32('0x30')]);_0x20208c[_0x2c32('0x2e')]=qs[_0x2c32('0x2e')](_0x4442e2[_0x2c32('0x44')][_0x2c32('0x2e')]);}_0x20208c['order']=qs[_0x2c32('0x4d')](_0x4442e2[_0x2c32('0x44')][_0x2c32('0x4d')]);_0x20208c[_0x2c32('0x4e')]=qs['filters'](_[_0x2c32('0x6a')](_0x4442e2[_0x2c32('0x44')],_0x535545['filters']));_0x20208c[_0x2c32('0x4e')][_0x2c32('0x65')]=_0x204874['id'];if(_0x4442e2[_0x2c32('0x44')][_0x2c32('0x4f')]){_0x20208c[_0x2c32('0x4e')]=_[_0x2c32('0x59')](_0x20208c[_0x2c32('0x4e')],{'$or':_['map'](_0x20208c[_0x2c32('0x47')],function(_0x1af340){var _0x5c32a6={};_0x5c32a6[_0x1af340]={'$like':'%'+_0x4442e2['query'][_0x2c32('0x4f')]+'%'};return _0x5c32a6;})});}_0x20208c=_[_0x2c32('0x59')]({},_0x20208c,_0x4442e2[_0x2c32('0x51')]);return db['OpenchannelInteraction']['count']({'where':_0x20208c['where']})['then'](function(_0x19ab2b){_0x195612[_0x2c32('0x31')]=_0x19ab2b;if(_0x4442e2[_0x2c32('0x44')]['includeAll']){_0x20208c['include']=[{'model':db[_0x2c32('0x72')],'as':_0x2c32('0xa8'),'required':![]},{'model':db[_0x2c32('0x9a')],'as':'Owner','attributes':[_0x2c32('0x3a'),_0x2c32('0xa9'),_0x2c32('0xaa')],'required':![]},{'model':db[_0x2c32('0xab')],'as':_0x2c32('0xac'),'attributes':['id',_0x2c32('0x3a'),_0x2c32('0xad')],'where':_0x4442e2[_0x2c32('0x44')]['tag']?{'id':_0x4442e2[_0x2c32('0x44')][_0x2c32('0xae')]}:undefined,'required':_0x4442e2[_0x2c32('0x44')][_0x2c32('0xae')]?!![]:![]}];}return db[_0x2c32('0x8e')][_0x2c32('0x53')](_0x20208c);})['then'](function(_0x401e98){_0x195612[_0x2c32('0x54')]=_0x401e98;return _0x195612;});}})[_0x2c32('0x35')](respondWithFilteredResult(_0x94cb9b,_0x20208c))[_0x2c32('0x5a')](handleError(_0x94cb9b,null));};exports[_0x2c32('0xaf')]=function(_0x5c3592,_0x517b36,_0x78885b){return db[_0x2c32('0x3f')]['find']({'where':{'id':_0x5c3592[_0x2c32('0x56')]['id']}})[_0x2c32('0x35')](handleEntityNotFound(_0x517b36,null))[_0x2c32('0x35')](function(_0x2683ad){if(_0x2683ad){return _0x2683ad[_0x2c32('0xaf')](_0x5c3592[_0x2c32('0x62')][_0x2c32('0x6c')],_[_0x2c32('0xb0')](_0x5c3592[_0x2c32('0x62')],[_0x2c32('0x6c'),'id'])||{})['spread'](function(_0x4fcdfd){for(var _0x30c650=0x0;_0x30c650<_0x5c3592['body']['ids'][_0x2c32('0x4a')];_0x30c650+=0x1){socket[_0x2c32('0xb1')](_0x2c32('0xb2'),{'UserId':Number(_0x5c3592['body'][_0x2c32('0x6c')][_0x30c650]),'OpenchannelAccountId':Number(_0x5c3592[_0x2c32('0x56')]['id'])});}return _0x4fcdfd;});}})[_0x2c32('0x35')](respondWithResult(_0x517b36,null))[_0x2c32('0x5a')](handleError(_0x517b36,null));};exports[_0x2c32('0xb3')]=function(_0x50fbc4,_0x37e978,_0x1f9797){return db['OpenchannelAccount'][_0x2c32('0x5e')]({'where':{'id':_0x50fbc4[_0x2c32('0x56')]['id']}})[_0x2c32('0x35')](handleEntityNotFound(_0x37e978,null))[_0x2c32('0x35')](function(_0x496d0a){if(_0x496d0a){return _0x496d0a[_0x2c32('0xb3')](_0x50fbc4[_0x2c32('0x44')]['ids'])[_0x2c32('0x35')](function(){if(_[_0x2c32('0xb4')](_0x50fbc4[_0x2c32('0x44')][_0x2c32('0x6c')])){for(var _0x5a28be=0x0;_0x5a28be<_0x50fbc4[_0x2c32('0x44')][_0x2c32('0x6c')][_0x2c32('0x4a')];_0x5a28be+=0x1){socket['emit'](_0x2c32('0xb5'),{'UserId':Number(_0x50fbc4[_0x2c32('0x44')][_0x2c32('0x6c')][_0x5a28be]),'OpenchannelAccountId':Number(_0x50fbc4[_0x2c32('0x56')]['id'])});}}else{socket[_0x2c32('0xb1')]('userOpenchannelAccount:remove',{'UserId':Number(_0x50fbc4[_0x2c32('0x44')]['ids']),'OpenchannelAccountId':Number(_0x50fbc4['params']['id'])});}});}})[_0x2c32('0x35')](respondWithStatusCode(_0x37e978,null))[_0x2c32('0x5a')](handleError(_0x37e978,null));};exports[_0x2c32('0xb6')]=function(_0x46c52f,_0x212a33,_0x4a62dd){var _0xf7c8b0={};var _0x4e4c0b={};var _0x3ecdbc;var _0x309a5e;return db[_0x2c32('0x3f')]['findOne']({'where':{'id':_0x46c52f[_0x2c32('0x56')]['id']}})[_0x2c32('0x35')](handleEntityNotFound(_0x212a33,null))['then'](function(_0x560fca){if(_0x560fca){_0x3ecdbc=_0x560fca;_0x4e4c0b[_0x2c32('0x46')]=_[_0x2c32('0x57')](db[_0x2c32('0x9a')][_0x2c32('0x40')]);_0x4e4c0b['query']=_[_0x2c32('0x57')](_0x46c52f['query']);_0x4e4c0b[_0x2c32('0x45')]=_['intersection'](_0x4e4c0b[_0x2c32('0x46')],_0x4e4c0b[_0x2c32('0x44')]);_0xf7c8b0[_0x2c32('0x47')]=_[_0x2c32('0x48')](_0x4e4c0b[_0x2c32('0x46')],qs['fields'](_0x46c52f[_0x2c32('0x44')][_0x2c32('0x49')]));_0xf7c8b0[_0x2c32('0x47')]=_0xf7c8b0[_0x2c32('0x47')][_0x2c32('0x4a')]?_0xf7c8b0[_0x2c32('0x47')]:_0x4e4c0b[_0x2c32('0x46')];_0xf7c8b0[_0x2c32('0x4c')]=qs[_0x2c32('0x4d')](_0x46c52f[_0x2c32('0x44')]['sort']);_0xf7c8b0[_0x2c32('0x4e')]=qs[_0x2c32('0x45')](_[_0x2c32('0x6a')](_0x46c52f['query'],_0x4e4c0b[_0x2c32('0x45')]));if(_0x46c52f[_0x2c32('0x44')][_0x2c32('0x4f')]){_0xf7c8b0['where']=_[_0x2c32('0x59')](_0xf7c8b0[_0x2c32('0x4e')],{'$or':_[_0x2c32('0x3e')](_0xf7c8b0['attributes'],function(_0x1e7dd2){var _0x12de9c={};_0x12de9c[_0x1e7dd2]={'$like':'%'+_0x46c52f[_0x2c32('0x44')][_0x2c32('0x4f')]+'%'};return _0x12de9c;})});}_0xf7c8b0=_[_0x2c32('0x59')]({},_0xf7c8b0,_0x46c52f['options']);return _0x3ecdbc['getAgents'](_0xf7c8b0);}})[_0x2c32('0x35')](function(_0x28c977){if(_0x28c977){_0x309a5e=_0x28c977[_0x2c32('0x4a')];if(!_0x46c52f[_0x2c32('0x44')]['hasOwnProperty'](_0x2c32('0x69'))){_0xf7c8b0[_0x2c32('0x30')]=qs['limit'](_0x46c52f['query']['limit']);_0xf7c8b0[_0x2c32('0x2e')]=qs[_0x2c32('0x2e')](_0x46c52f[_0x2c32('0x44')][_0x2c32('0x2e')]);}return _0x3ecdbc[_0x2c32('0xb6')](_0xf7c8b0);}})[_0x2c32('0x35')](function(_0x143204){if(_0x143204){return _0x143204?{'count':_0x309a5e,'rows':_0x143204}:null;}})[_0x2c32('0x35')](respondWithResult(_0x212a33,null))[_0x2c32('0x5a')](handleError(_0x212a33,null));};exports['send']=function(_0x990877,_0x22011a,_0xffa257){var _0x21e21b,_0x8b8d49,_0x37d0d7;if(_[_0x2c32('0x78')](_0x990877['body'][_0x2c32('0x62')])||_0x990877[_0x2c32('0x62')][_0x2c32('0x62')]===''){throw new db[(_0x2c32('0x73'))][(_0x2c32('0x74'))](_0x2c32('0x7a'));}if(_[_0x2c32('0x78')](_0x990877[_0x2c32('0x62')]['to'])){}_0x21e21b=_0x990877[_0x2c32('0x62')]['to'];return db[_0x2c32('0x3f')][_0x2c32('0x68')]({'where':{'id':_0x990877['params']['id']}})[_0x2c32('0x35')](handleEntityNotFound(_0x22011a,null))[_0x2c32('0x35')](function(_0x5a542b){if(_0x5a542b){return db[_0x2c32('0x3f')][_0x2c32('0x5e')]({'where':{'id':_0x5a542b['id']},'include':[{'model':db[_0x2c32('0xb7')],'as':_0x2c32('0x81'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{[_0x5a542b['mapKey']]:_0x21e21b},'limit':0x1,'order':[[_0x2c32('0x75'),_0x2c32('0x80')]]}]}]})[_0x2c32('0x35')](handleEntityNotFound(_0x22011a,null))[_0x2c32('0x35')](function(_0x3b5026){if(_0x3b5026&&_0x3b5026[_0x2c32('0x81')]){_0x8b8d49=_0x3b5026[_0x2c32('0x37')]({'plain':!![]});if(_0x8b8d49[_0x2c32('0x81')]&&_0x8b8d49[_0x2c32('0x81')]['Contacts']['length']){return _0x8b8d49[_0x2c32('0x81')]['Contacts'][0x0];}return db[_0x2c32('0x72')][_0x2c32('0x5b')](_['defaults'](_0x990877[_0x2c32('0x62')],{'firstName':_0x21e21b,[_0x3b5026[_0x2c32('0x7b')]]:_0x21e21b,'phone':_0x21e21b,'ListId':_0x8b8d49[_0x2c32('0x89')]}));}})['then'](handleEntityNotFound(_0x22011a,null))[_0x2c32('0x35')](function(_0x550621){if(_0x550621){_0x37d0d7=_0x550621;return db[_0x2c32('0x8e')][_0x2c32('0x5e')]({'where':{'ContactId':_0x37d0d7['id'],'closed':![],'OpenchannelAccountId':_0x8b8d49['id']}})[_0x2c32('0x35')](function(_0x42de30){if(_0x42de30){return[_0x42de30,![]];}return db[_0x2c32('0x8e')][_0x2c32('0x5b')]({'UserId':_0x990877['user']['id'],'ContactId':_0x37d0d7['id'],'OpenchannelAccountId':_0x8b8d49['id'],'lastMsgDirection':_0x2c32('0xb8'),'Messages':[_[_0x2c32('0x59')](_0x990877[_0x2c32('0x62')],{'read':![],'body':_0x990877['body'][_0x2c32('0x62')],'OpenchannelAccountId':_0x8b8d49['id'],'UserId':_0x990877[_0x2c32('0x5c')]['id'],'ContactId':_0x37d0d7['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0x2c32('0xb9')}]})[_0x2c32('0x35')](function(_0x2c20d2){return[_0x2c20d2,!![]];});});}})['spread'](function(_0x37f694,_0x49cb53){if(_0x49cb53){return _0x37f694;}return db['OpenchannelMessage'][_0x2c32('0x5b')](_[_0x2c32('0x59')](_0x990877[_0x2c32('0x62')],{'read':![],'body':_0x990877[_0x2c32('0x62')][_0x2c32('0x62')],'OpenchannelAccountId':_0x8b8d49['id'],'OpenchannelInteractionId':_0x37f694['id'],'UserId':_0x990877[_0x2c32('0x5c')]['id'],'ContactId':_0x37d0d7['id']}))[_0x2c32('0x35')](function(_0x486b99){_0x37f694[_0x2c32('0xba')][_0x2c32('0xb9')]=[];_0x37f694[_0x2c32('0xba')][_0x2c32('0xb9')]['push'](_0x486b99['dataValues']);return _0x37f694;});});}})[_0x2c32('0x35')](respondWithResult(_0x22011a,null))[_0x2c32('0x5a')](handleError(_0x22011a,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index b6276a3..ae26ef3 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 _0xda55=['update','remove','emit','hook','exports','events','../../mysqldb','save'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xda55,0x6d));var _0x5da5=function(_0x46b8d9,_0x431db3){_0x46b8d9=_0x46b8d9-0x0;var _0x383b8f=_0xda55[_0x46b8d9];return _0x383b8f;};'use strict';var EventEmitter=require(_0x5da5('0x0'));var OpenchannelAccount=require(_0x5da5('0x1'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5da5('0x2'),'afterUpdate':_0x5da5('0x3'),'afterDestroy':_0x5da5('0x4')};function emitEvent(_0x50cf9f){return function(_0x1c3afd,_0x5da254,_0x3400e9){OpenchannelAccountEvents['emit'](_0x50cf9f+':'+_0x1c3afd['id'],_0x1c3afd);OpenchannelAccountEvents[_0x5da5('0x5')](_0x50cf9f,_0x1c3afd);_0x3400e9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0x5da5('0x6')](e,emitEvent(event));}}module[_0x5da5('0x7')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x1be1=['OpenchannelAccount','setMaxListeners','update','remove','emit','hook'];(function(_0x3249f0,_0x52630b){var _0xb6980f=function(_0x39c0f7){while(--_0x39c0f7){_0x3249f0['push'](_0x3249f0['shift']());}};_0xb6980f(++_0x52630b);}(_0x1be1,0x192));var _0x11be=function(_0x3d5041,_0x34252d){_0x3d5041=_0x3d5041-0x0;var _0x1c3b8d=_0x1be1[_0x3d5041];return _0x1c3b8d;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require('../../mysqldb')['db'][_0x11be('0x0')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x11be('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x11be('0x2'),'afterDestroy':_0x11be('0x3')};function emitEvent(_0x200b2a){return function(_0x318d41,_0x504d3a,_0x3ce56d){OpenchannelAccountEvents[_0x11be('0x4')](_0x200b2a+':'+_0x318d41['id'],_0x318d41);OpenchannelAccountEvents[_0x11be('0x4')](_0x200b2a,_0x318d41);_0x3ce56d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0x11be('0x5')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 059c253..d771bef 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(_0xa56e60,_0x1449b6){var _0x8bfec6=function(_0x4bfd6e){while(--_0x4bfd6e){_0xa56e60['push'](_0xa56e60['shift']());}};_0x8bfec6(++_0x1449b6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'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(_0x3f6ea0,_0x4140ce){var _0x5f18b4=function(_0x4039c2){while(--_0x4039c2){_0x3f6ea0['push'](_0x3f6ea0['shift']());}};_0x5f18b4(++_0x4140ce);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'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 4a12173..baa3773 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 _0x34b7=['redis','defaults','localhost','socket.io-emitter','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http'];(function(_0x377b59,_0x1f167d){var _0x2cae54=function(_0x292df1){while(--_0x292df1){_0x377b59['push'](_0x377b59['shift']());}};_0x2cae54(++_0x1f167d);}(_0x34b7,0x196));var _0x734b=function(_0x356596,_0x1a1a8c){_0x356596=_0x356596-0x0;var _0x231fa9=_0x34b7[_0x356596];return _0x231fa9;};'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});config[_0x734b('0xa')]=_[_0x734b('0xb')](config['redis'],{'host':_0x734b('0xc'),'port':0x18eb});var socket=require(_0x734b('0xd'))(new Redis(config['redis']));require('./openchannelAccount.socket')['register'](socket);function respondWithRpcPromise(_0x19a88e,_0x598dee,_0x43c5e0){return new BPromise(function(_0x333738,_0x2860a2){return client[_0x734b('0xe')](_0x19a88e,_0x43c5e0)[_0x734b('0xf')](function(_0x16e451){logger[_0x734b('0x10')](_0x734b('0x11'),_0x598dee,_0x734b('0x12'));logger[_0x734b('0x13')](_0x734b('0x14'),_0x598dee,_0x734b('0x12'),JSON[_0x734b('0x15')](_0x16e451));if(_0x16e451[_0x734b('0x16')]){if(_0x16e451['error'][_0x734b('0x17')]===0x1f4){logger[_0x734b('0x16')](_0x734b('0x11'),_0x598dee,_0x16e451[_0x734b('0x16')][_0x734b('0x18')]);return _0x2860a2(_0x16e451[_0x734b('0x16')][_0x734b('0x18')]);}logger[_0x734b('0x16')](_0x734b('0x11'),_0x598dee,_0x16e451[_0x734b('0x16')][_0x734b('0x18')]);return _0x333738(_0x16e451['error'][_0x734b('0x18')]);}else{logger[_0x734b('0x10')](_0x734b('0x11'),_0x598dee,_0x734b('0x12'));_0x333738(_0x16e451['result']['message']);}})[_0x734b('0x19')](function(_0x3033cd){logger[_0x734b('0x16')](_0x734b('0x11'),_0x598dee,_0x3033cd);_0x2860a2(_0x3033cd);});});} \ No newline at end of file +var _0x9ffd=['OpenchannelAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','request','then','info'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x9ffd,0xaa));var _0xd9ff=function(_0xb4e8c1,_0x19bb52){_0xb4e8c1=_0xb4e8c1-0x0;var _0x3f5969=_0x9ffd[_0xb4e8c1];return _0x3f5969;};'use strict';var _=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var moment=require(_0xd9ff('0x2'));var BPromise=require('bluebird');var rs=require(_0xd9ff('0x3'));var fs=require('fs');var Redis=require(_0xd9ff('0x4'));var db=require(_0xd9ff('0x5'))['db'];var utils=require(_0xd9ff('0x6'));var logger=require('../../config/logger')(_0xd9ff('0x7'));var config=require(_0xd9ff('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd9ff('0x9')][_0xd9ff('0xa')]({'port':0x232a});config[_0xd9ff('0xb')]=_[_0xd9ff('0xc')](config[_0xd9ff('0xb')],{'host':_0xd9ff('0xd'),'port':0x18eb});var socket=require(_0xd9ff('0xe'))(new Redis(config[_0xd9ff('0xb')]));require(_0xd9ff('0xf'))['register'](socket);function respondWithRpcPromise(_0x54a555,_0x567f79,_0x5aa954){return new BPromise(function(_0x2355ab,_0x2fd77a){return client[_0xd9ff('0x10')](_0x54a555,_0x5aa954)[_0xd9ff('0x11')](function(_0x37d2c0){logger[_0xd9ff('0x12')](_0xd9ff('0x13'),_0x567f79,_0xd9ff('0x14'));logger['debug']('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x567f79,_0xd9ff('0x14'),JSON[_0xd9ff('0x15')](_0x37d2c0));if(_0x37d2c0[_0xd9ff('0x16')]){if(_0x37d2c0[_0xd9ff('0x16')][_0xd9ff('0x17')]===0x1f4){logger['error'](_0xd9ff('0x13'),_0x567f79,_0x37d2c0[_0xd9ff('0x16')]['message']);return _0x2fd77a(_0x37d2c0[_0xd9ff('0x16')]['message']);}logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x567f79,_0x37d2c0['error'][_0xd9ff('0x18')]);return _0x2355ab(_0x37d2c0['error'][_0xd9ff('0x18')]);}else{logger[_0xd9ff('0x12')](_0xd9ff('0x13'),_0x567f79,_0xd9ff('0x14'));_0x2355ab(_0x37d2c0[_0xd9ff('0x19')][_0xd9ff('0x18')]);}})[_0xd9ff('0x1a')](function(_0x128588){logger[_0xd9ff('0x16')](_0xd9ff('0x13'),_0x567f79,_0x128588);_0x2fd77a(_0x128588);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index b88c01b..6a5f272 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 _0x5397=['emit','register','length','save','remove','update'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0x5397,0x105));var _0x7539=function(_0xec8828,_0x4f3f68){_0xec8828=_0xec8828-0x0;var _0x4d7cc9=_0x5397[_0xec8828];return _0x4d7cc9;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0x7539('0x0'),_0x7539('0x1'),_0x7539('0x2')];function createListener(_0x120f30,_0xad56a4){return function(_0x2f82e7){_0xad56a4[_0x7539('0x3')](_0x120f30,_0x2f82e7);};}function removeListener(_0x218a3a,_0x394310){return function(){OpenchannelAccountEvents['removeListener'](_0x218a3a,_0x394310);};}exports[_0x7539('0x4')]=function(_0x3486c2){for(var _0x4486c0=0x0,_0x2e3897=events[_0x7539('0x5')];_0x4486c0<_0x2e3897;_0x4486c0++){var _0x55b824=events[_0x4486c0];var _0x18ba43=createListener('openchannelAccount:'+_0x55b824,_0x3486c2);OpenchannelAccountEvents['on'](_0x55b824,_0x18ba43);}}; \ No newline at end of file +var _0x58a7=['removeListener','register','length','openchannelAccount:','./openchannelAccount.events','save','remove','update','emit'];(function(_0xf4237a,_0x1ac1e2){var _0x7b4c17=function(_0x3fd747){while(--_0x3fd747){_0xf4237a['push'](_0xf4237a['shift']());}};_0x7b4c17(++_0x1ac1e2);}(_0x58a7,0xf7));var _0x758a=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x58a7[_0x40a045];return _0x1a687c;};'use strict';var OpenchannelAccountEvents=require(_0x758a('0x0'));var events=[_0x758a('0x1'),_0x758a('0x2'),_0x758a('0x3')];function createListener(_0x1e391a,_0x62bb23){return function(_0x306220){_0x62bb23[_0x758a('0x4')](_0x1e391a,_0x306220);};}function removeListener(_0x4cebf6,_0x2f36b2){return function(){OpenchannelAccountEvents[_0x758a('0x5')](_0x4cebf6,_0x2f36b2);};}exports[_0x758a('0x6')]=function(_0x294cf3){for(var _0x5a34af=0x0,_0x52bc94=events[_0x758a('0x7')];_0x5a34af<_0x52bc94;_0x5a34af++){var _0x514bca=events[_0x5a34af];var _0x227bdb=createListener(_0x758a('0x8')+_0x514bca,_0x294cf3);OpenchannelAccountEvents['on'](_0x514bca,_0x227bdb);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 6f0961e..ea0de12 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 _0x9d5c=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','post','create','delete','exports','multer','util'];(function(_0x4ecc5f,_0x5f5678){var _0x52fcb8=function(_0x17818b){while(--_0x17818b){_0x4ecc5f['push'](_0x4ecc5f['shift']());}};_0x52fcb8(++_0x5f5678);}(_0x9d5c,0x8e));var _0xc9d5=function(_0x5c49c2,_0x3a1dc9){_0x5c49c2=_0x5c49c2-0x0;var _0x363e8a=_0x9d5c[_0x5c49c2];return _0x363e8a;};'use strict';var multer=require(_0xc9d5('0x0'));var util=require(_0xc9d5('0x1'));var path=require('path');var timeout=require(_0xc9d5('0x2'));var express=require(_0xc9d5('0x3'));var router=express[_0xc9d5('0x4')]();var fs_extra=require(_0xc9d5('0x5'));var auth=require(_0xc9d5('0x6'));var interaction=require(_0xc9d5('0x7'));var config=require(_0xc9d5('0x8'));var controller=require(_0xc9d5('0x9'));router[_0xc9d5('0xa')]('/',auth[_0xc9d5('0xb')](),controller[_0xc9d5('0xc')]);router[_0xc9d5('0xa')](_0xc9d5('0xd'),auth[_0xc9d5('0xb')](),controller['show']);router[_0xc9d5('0xe')]('/',auth['isAuthenticated'](),controller[_0xc9d5('0xf')]);router['put'](_0xc9d5('0xd'),auth[_0xc9d5('0xb')](),controller['update']);router[_0xc9d5('0x10')](_0xc9d5('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xc9d5('0x11')]=router; \ No newline at end of file +var _0x7c49=['/:id','post','put','update','delete','destroy','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x7c49,0x1da));var _0x97c4=function(_0xa0ceaf,_0x1f891b){_0xa0ceaf=_0xa0ceaf-0x0;var _0xaf4fca=_0x7c49[_0xa0ceaf];return _0xaf4fca;};'use strict';var multer=require('multer');var util=require(_0x97c4('0x0'));var path=require(_0x97c4('0x1'));var timeout=require('connect-timeout');var express=require(_0x97c4('0x2'));var router=express[_0x97c4('0x3')]();var fs_extra=require(_0x97c4('0x4'));var auth=require(_0x97c4('0x5'));var interaction=require(_0x97c4('0x6'));var config=require(_0x97c4('0x7'));var controller=require(_0x97c4('0x8'));router[_0x97c4('0x9')]('/',auth[_0x97c4('0xa')](),controller[_0x97c4('0xb')]);router[_0x97c4('0x9')](_0x97c4('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x97c4('0xd')]('/',auth[_0x97c4('0xa')](),controller['create']);router[_0x97c4('0xe')](_0x97c4('0xc'),auth[_0x97c4('0xa')](),controller[_0x97c4('0xf')]);router[_0x97c4('0x10')]('/:id',auth[_0x97c4('0xa')](),controller[_0x97c4('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 9e3ac91..5c59533 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 _0xc9be=['INTEGER','TEXT','STRING','*,*,*,*','sequelize','exports'];(function(_0x19882d,_0x3dee8b){var _0x6485fb=function(_0x4b6cca){while(--_0x4b6cca){_0x19882d['push'](_0x19882d['shift']());}};_0x6485fb(++_0x3dee8b);}(_0xc9be,0x1cc));var _0xec9b=function(_0x652c41,_0x156042){_0x652c41=_0x652c41-0x0;var _0x3156a6=_0xc9be[_0x652c41];return _0x3156a6;};'use strict';var Sequelize=require(_0xec9b('0x0'));module[_0xec9b('0x1')]={'priority':{'type':Sequelize[_0xec9b('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xec9b('0x3')]()},'description':{'type':Sequelize[_0xec9b('0x4')]},'interval':{'type':Sequelize[_0xec9b('0x4')],'defaultValue':_0xec9b('0x5')}}; \ No newline at end of file +var _0x1feb=['exports','INTEGER','STRING','TEXT','*,*,*,*','sequelize'];(function(_0x1e0506,_0x1ffe40){var _0x4bd4c2=function(_0x1e647c){while(--_0x1e647c){_0x1e0506['push'](_0x1e0506['shift']());}};_0x4bd4c2(++_0x1ffe40);}(_0x1feb,0xe9));var _0xb1fe=function(_0x24325b,_0x28fe0f){_0x24325b=_0x24325b-0x0;var _0x1cf842=_0x1feb[_0x24325b];return _0x1cf842;};'use strict';var Sequelize=require(_0xb1fe('0x0'));module[_0xb1fe('0x1')]={'priority':{'type':Sequelize[_0xb1fe('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xb1fe('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xb1fe('0x4')]()},'description':{'type':Sequelize[_0xb1fe('0x3')]},'interval':{'type':Sequelize[_0xb1fe('0x3')],'defaultValue':_0xb1fe('0x5')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 0ff892e..84c6384 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 _0x522c=['../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','name','send','index','map','OpenchannelApplication','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','keys','includeAll','catch','create','body','find','params','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','api'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x522c,0x1f2));var _0xc522=function(_0x125892,_0x53598a){_0x125892=_0x125892-0x0;var _0x36fa5e=_0x522c[_0x125892];return _0x36fa5e;};'use strict';var emlformat=require(_0xc522('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc522('0x1'));var rp=require(_0xc522('0x2'));var moment=require(_0xc522('0x3'));var BPromise=require(_0xc522('0x4'));var Mustache=require('mustache');var util=require(_0xc522('0x5'));var path=require(_0xc522('0x6'));var sox=require('sox');var csv=require(_0xc522('0x7'));var ejs=require(_0xc522('0x8'));var fs=require('fs');var fs_extra=require(_0xc522('0x9'));var _=require(_0xc522('0xa'));var squel=require(_0xc522('0xb'));var crypto=require(_0xc522('0xc'));var jsforce=require(_0xc522('0xd'));var deskjs=require(_0xc522('0xe'));var toCsv=require(_0xc522('0x7'));var querystring=require(_0xc522('0xf'));var Papa=require(_0xc522('0x10'));var Redis=require(_0xc522('0x11'));var authService=require(_0xc522('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc522('0x13'));var utils=require('../../config/utils');var config=require(_0xc522('0x14'));var licenseUtil=require(_0xc522('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5a2492,_0x4f40dc){_0x4f40dc=_0x4f40dc||0xcc;return function(_0x5e5825){if(_0x5e5825){return _0x5a2492[_0xc522('0x16')](_0x4f40dc);}return _0x5a2492[_0xc522('0x17')](_0x4f40dc)[_0xc522('0x18')]();};}function respondWithResult(_0x3d1631,_0x16b651){_0x16b651=_0x16b651||0xc8;return function(_0x49cb8d){if(_0x49cb8d){return _0x3d1631[_0xc522('0x17')](_0x16b651)[_0xc522('0x19')](_0x49cb8d);}};}function respondWithFilteredResult(_0x58a4f5,_0x357e63){return function(_0x52c948){if(_0x52c948){var _0x277e2c=typeof _0x357e63[_0xc522('0x1a')]===_0xc522('0x1b')&&typeof _0x357e63[_0xc522('0x1c')]===_0xc522('0x1b');var _0x36f578=_0x52c948[_0xc522('0x1d')];var _0x449830=_0x277e2c?0x0:_0x357e63['offset'];var _0x162ddf=_0x277e2c?_0x52c948[_0xc522('0x1d')]:_0x357e63['offset']+_0x357e63[_0xc522('0x1c')];var _0x40c598;if(_0x162ddf>=_0x36f578){_0x162ddf=_0x36f578;_0x40c598=0xc8;}else{_0x40c598=0xce;}_0x58a4f5[_0xc522('0x17')](_0x40c598);return _0x58a4f5[_0xc522('0x1e')](_0xc522('0x1f'),_0x449830+'-'+_0x162ddf+'/'+_0x36f578)[_0xc522('0x19')](_0x52c948);}return null;};}function patchUpdates(_0x19776c){return function(_0x3a3144){try{jsonpatch[_0xc522('0x20')](_0x3a3144,_0x19776c,!![]);}catch(_0x418da9){return BPromise[_0xc522('0x21')](_0x418da9);}return _0x3a3144[_0xc522('0x22')]();};}function saveUpdates(_0x5365f4,_0x410d86){return function(_0x42281c){if(_0x42281c){return _0x42281c[_0xc522('0x23')](_0x5365f4)['then'](function(_0x2e695d){return _0x2e695d;});}return null;};}function removeEntity(_0x16af1d,_0x2db8d0){return function(_0x8108e8){if(_0x8108e8){return _0x8108e8[_0xc522('0x24')]()[_0xc522('0x25')](function(){_0x16af1d[_0xc522('0x17')](0xcc)[_0xc522('0x18')]();});}};}function handleEntityNotFound(_0x29df89,_0x4c094c){return function(_0x2dfbd1){if(!_0x2dfbd1){_0x29df89['sendStatus'](0x194);}return _0x2dfbd1;};}function handleError(_0x216eee,_0x54450c){_0x54450c=_0x54450c||0x1f4;return function(_0x175965){logger['error'](_0x175965['stack']);if(_0x175965[_0xc522('0x26')]){delete _0x175965[_0xc522('0x26')];}_0x216eee[_0xc522('0x17')](_0x54450c)[_0xc522('0x27')](_0x175965);};}exports[_0xc522('0x28')]=function(_0x2caa2a,_0x46f778){var _0x43f3d9={},_0x173be5={},_0x53f813={'count':0x0,'rows':[]};var _0x504b76=_[_0xc522('0x29')](db[_0xc522('0x2a')][_0xc522('0x2b')],function(_0x344a4a){return{'name':_0x344a4a[_0xc522('0x2c')],'type':_0x344a4a[_0xc522('0x2d')][_0xc522('0x2e')]};});_0x173be5['model']=_[_0xc522('0x29')](_0x504b76,_0xc522('0x26'));_0x173be5[_0xc522('0x2f')]=_['keys'](_0x2caa2a['query']);_0x173be5[_0xc522('0x30')]=_[_0xc522('0x31')](_0x173be5[_0xc522('0x32')],_0x173be5['query']);_0x43f3d9['attributes']=_[_0xc522('0x31')](_0x173be5[_0xc522('0x32')],qs[_0xc522('0x33')](_0x2caa2a['query'][_0xc522('0x33')]));_0x43f3d9[_0xc522('0x34')]=_0x43f3d9[_0xc522('0x34')][_0xc522('0x35')]?_0x43f3d9['attributes']:_0x173be5['model'];if(!_0x2caa2a[_0xc522('0x2f')][_0xc522('0x36')](_0xc522('0x37'))){_0x43f3d9[_0xc522('0x1c')]=qs[_0xc522('0x1c')](_0x2caa2a['query'][_0xc522('0x1c')]);_0x43f3d9[_0xc522('0x1a')]=qs[_0xc522('0x1a')](_0x2caa2a[_0xc522('0x2f')][_0xc522('0x1a')]);}_0x43f3d9[_0xc522('0x38')]=qs[_0xc522('0x39')](_0x2caa2a['query'][_0xc522('0x39')]);_0x43f3d9['where']=qs[_0xc522('0x30')](_[_0xc522('0x3a')](_0x2caa2a[_0xc522('0x2f')],_0x173be5[_0xc522('0x30')]),_0x504b76);if(_0x2caa2a['query'][_0xc522('0x3b')]){_0x43f3d9[_0xc522('0x3c')]=_[_0xc522('0x3d')](_0x43f3d9[_0xc522('0x3c')],{'$or':_[_0xc522('0x29')](_0x504b76,function(_0xf04fa6){if(_0xf04fa6['type']!==_0xc522('0x3e')){var _0x218cd7={};_0x218cd7[_0xf04fa6[_0xc522('0x26')]]={'$like':'%'+_0x2caa2a[_0xc522('0x2f')][_0xc522('0x3b')]+'%'};return _0x218cd7;}})});}_0x43f3d9=_[_0xc522('0x3d')]({},_0x43f3d9,_0x2caa2a[_0xc522('0x3f')]);var _0xbc0445={'where':_0x43f3d9['where']};return db[_0xc522('0x2a')][_0xc522('0x1d')](_0xbc0445)['then'](function(_0x48d249){_0x53f813['count']=_0x48d249;if(_0x2caa2a[_0xc522('0x2f')]['includeAll']){_0x43f3d9[_0xc522('0x40')]=[{'all':!![]}];}return db['OpenchannelApplication'][_0xc522('0x41')](_0x43f3d9);})[_0xc522('0x25')](function(_0x212168){_0x53f813[_0xc522('0x42')]=_0x212168;return _0x53f813;})[_0xc522('0x25')](respondWithFilteredResult(_0x46f778,_0x43f3d9))['catch'](handleError(_0x46f778,null));};exports['show']=function(_0x2d066d,_0xcb0e43){var _0xc5e076={'raw':!![],'where':{'id':_0x2d066d['params']['id']}},_0x142280={};_0x142280['model']=_[_0xc522('0x43')](db[_0xc522('0x2a')][_0xc522('0x2b')]);_0x142280[_0xc522('0x2f')]=_['keys'](_0x2d066d['query']);_0x142280[_0xc522('0x30')]=_['intersection'](_0x142280[_0xc522('0x32')],_0x142280[_0xc522('0x2f')]);_0xc5e076[_0xc522('0x34')]=_[_0xc522('0x31')](_0x142280[_0xc522('0x32')],qs[_0xc522('0x33')](_0x2d066d[_0xc522('0x2f')][_0xc522('0x33')]));_0xc5e076[_0xc522('0x34')]=_0xc5e076[_0xc522('0x34')][_0xc522('0x35')]?_0xc5e076[_0xc522('0x34')]:_0x142280[_0xc522('0x32')];if(_0x2d066d[_0xc522('0x2f')][_0xc522('0x44')]){_0xc5e076[_0xc522('0x40')]=[{'all':!![]}];}_0xc5e076=_[_0xc522('0x3d')]({},_0xc5e076,_0x2d066d[_0xc522('0x3f')]);return db[_0xc522('0x2a')]['find'](_0xc5e076)[_0xc522('0x25')](handleEntityNotFound(_0xcb0e43,null))[_0xc522('0x25')](respondWithResult(_0xcb0e43,null))[_0xc522('0x45')](handleError(_0xcb0e43,null));};exports[_0xc522('0x46')]=function(_0x2d2204,_0x35c97c){return db[_0xc522('0x2a')][_0xc522('0x46')](_0x2d2204[_0xc522('0x47')],{})[_0xc522('0x25')](respondWithResult(_0x35c97c,0xc9))[_0xc522('0x45')](handleError(_0x35c97c,null));};exports[_0xc522('0x23')]=function(_0x5747e0,_0x3321c0){if(_0x5747e0[_0xc522('0x47')]['id']){delete _0x5747e0['body']['id'];}return db[_0xc522('0x2a')][_0xc522('0x48')]({'where':{'id':_0x5747e0[_0xc522('0x49')]['id']}})['then'](handleEntityNotFound(_0x3321c0,null))['then'](saveUpdates(_0x5747e0[_0xc522('0x47')],null))[_0xc522('0x25')](respondWithResult(_0x3321c0,null))[_0xc522('0x45')](handleError(_0x3321c0,null));};exports[_0xc522('0x24')]=function(_0x42dbd4,_0x41bcfc){return db[_0xc522('0x2a')]['find']({'where':{'id':_0x42dbd4[_0xc522('0x49')]['id']}})[_0xc522('0x25')](handleEntityNotFound(_0x41bcfc,null))[_0xc522('0x25')](removeEntity(_0x41bcfc,null))[_0xc522('0x45')](handleError(_0x41bcfc,null));}; \ No newline at end of file +var _0x3190=['map','OpenchannelApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','length','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','apply','save','then','destroy','sendStatus','error','stack','name','send','index'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x3190,0x140));var _0x0319=function(_0x3c9921,_0x31c2b0){_0x3c9921=_0x3c9921-0x0;var _0x4365cd=_0x3190[_0x3c9921];return _0x4365cd;};'use strict';var emlformat=require(_0x0319('0x0'));var rimraf=require(_0x0319('0x1'));var zipdir=require(_0x0319('0x2'));var jsonpatch=require(_0x0319('0x3'));var rp=require('request-promise');var moment=require(_0x0319('0x4'));var BPromise=require(_0x0319('0x5'));var Mustache=require('mustache');var util=require(_0x0319('0x6'));var path=require(_0x0319('0x7'));var sox=require(_0x0319('0x8'));var csv=require(_0x0319('0x9'));var ejs=require(_0x0319('0xa'));var fs=require('fs');var fs_extra=require(_0x0319('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x0319('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x0319('0xd'));var toCsv=require(_0x0319('0x9'));var querystring=require(_0x0319('0xe'));var Papa=require('papaparse');var Redis=require(_0x0319('0xf'));var authService=require(_0x0319('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x0319('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0319('0x12'));var utils=require('../../config/utils');var config=require(_0x0319('0x13'));var licenseUtil=require(_0x0319('0x14'));var db=require(_0x0319('0x15'))['db'];function respondWithStatusCode(_0x43b84d,_0x5ac5a3){_0x5ac5a3=_0x5ac5a3||0xcc;return function(_0xa5c282){if(_0xa5c282){return _0x43b84d['sendStatus'](_0x5ac5a3);}return _0x43b84d[_0x0319('0x16')](_0x5ac5a3)[_0x0319('0x17')]();};}function respondWithResult(_0x37dc59,_0x1c4985){_0x1c4985=_0x1c4985||0xc8;return function(_0x96da45){if(_0x96da45){return _0x37dc59[_0x0319('0x16')](_0x1c4985)[_0x0319('0x18')](_0x96da45);}};}function respondWithFilteredResult(_0x1be8f8,_0x3cb002){return function(_0x5f27e8){if(_0x5f27e8){var _0x1075be=typeof _0x3cb002[_0x0319('0x19')]==='undefined'&&typeof _0x3cb002[_0x0319('0x1a')]===_0x0319('0x1b');var _0x11b6a2=_0x5f27e8[_0x0319('0x1c')];var _0x2a05cc=_0x1075be?0x0:_0x3cb002['offset'];var _0x51bbe5=_0x1075be?_0x5f27e8[_0x0319('0x1c')]:_0x3cb002['offset']+_0x3cb002[_0x0319('0x1a')];var _0x207315;if(_0x51bbe5>=_0x11b6a2){_0x51bbe5=_0x11b6a2;_0x207315=0xc8;}else{_0x207315=0xce;}_0x1be8f8[_0x0319('0x16')](_0x207315);return _0x1be8f8[_0x0319('0x1d')]('Content-Range',_0x2a05cc+'-'+_0x51bbe5+'/'+_0x11b6a2)[_0x0319('0x18')](_0x5f27e8);}return null;};}function patchUpdates(_0x11afec){return function(_0x4b0303){try{jsonpatch[_0x0319('0x1e')](_0x4b0303,_0x11afec,!![]);}catch(_0x27f91d){return BPromise['reject'](_0x27f91d);}return _0x4b0303[_0x0319('0x1f')]();};}function saveUpdates(_0x30b2bd,_0x243fe4){return function(_0x59391a){if(_0x59391a){return _0x59391a['update'](_0x30b2bd)[_0x0319('0x20')](function(_0x97d8de){return _0x97d8de;});}return null;};}function removeEntity(_0x25bc6f,_0x3d0551){return function(_0x4aae40){if(_0x4aae40){return _0x4aae40[_0x0319('0x21')]()[_0x0319('0x20')](function(){_0x25bc6f['status'](0xcc)[_0x0319('0x17')]();});}};}function handleEntityNotFound(_0xd92408,_0x443285){return function(_0x4ae7c9){if(!_0x4ae7c9){_0xd92408[_0x0319('0x22')](0x194);}return _0x4ae7c9;};}function handleError(_0x533b44,_0x1d60e0){_0x1d60e0=_0x1d60e0||0x1f4;return function(_0x42b496){logger[_0x0319('0x23')](_0x42b496[_0x0319('0x24')]);if(_0x42b496[_0x0319('0x25')]){delete _0x42b496['name'];}_0x533b44['status'](_0x1d60e0)[_0x0319('0x26')](_0x42b496);};}exports[_0x0319('0x27')]=function(_0x20bdd2,_0x2ac7c8){var _0x559419={},_0x2b4906={},_0xb8c775={'count':0x0,'rows':[]};var _0x28b19b=_[_0x0319('0x28')](db[_0x0319('0x29')][_0x0319('0x2a')],function(_0x180eb3){return{'name':_0x180eb3[_0x0319('0x2b')],'type':_0x180eb3[_0x0319('0x2c')][_0x0319('0x2d')]};});_0x2b4906[_0x0319('0x2e')]=_[_0x0319('0x28')](_0x28b19b,_0x0319('0x25'));_0x2b4906[_0x0319('0x2f')]=_[_0x0319('0x30')](_0x20bdd2['query']);_0x2b4906[_0x0319('0x31')]=_['intersection'](_0x2b4906[_0x0319('0x2e')],_0x2b4906[_0x0319('0x2f')]);_0x559419[_0x0319('0x32')]=_[_0x0319('0x33')](_0x2b4906[_0x0319('0x2e')],qs[_0x0319('0x34')](_0x20bdd2['query']['fields']));_0x559419['attributes']=_0x559419[_0x0319('0x32')]['length']?_0x559419['attributes']:_0x2b4906[_0x0319('0x2e')];if(!_0x20bdd2[_0x0319('0x2f')]['hasOwnProperty'](_0x0319('0x35'))){_0x559419[_0x0319('0x1a')]=qs[_0x0319('0x1a')](_0x20bdd2[_0x0319('0x2f')]['limit']);_0x559419[_0x0319('0x19')]=qs[_0x0319('0x19')](_0x20bdd2['query'][_0x0319('0x19')]);}_0x559419[_0x0319('0x36')]=qs[_0x0319('0x37')](_0x20bdd2[_0x0319('0x2f')][_0x0319('0x37')]);_0x559419[_0x0319('0x38')]=qs[_0x0319('0x31')](_['pick'](_0x20bdd2['query'],_0x2b4906[_0x0319('0x31')]),_0x28b19b);if(_0x20bdd2['query']['filter']){_0x559419[_0x0319('0x38')]=_[_0x0319('0x39')](_0x559419[_0x0319('0x38')],{'$or':_[_0x0319('0x28')](_0x28b19b,function(_0xefba7f){if(_0xefba7f[_0x0319('0x2c')]!==_0x0319('0x3a')){var _0x563443={};_0x563443[_0xefba7f[_0x0319('0x25')]]={'$like':'%'+_0x20bdd2[_0x0319('0x2f')][_0x0319('0x3b')]+'%'};return _0x563443;}})});}_0x559419=_[_0x0319('0x39')]({},_0x559419,_0x20bdd2[_0x0319('0x3c')]);var _0x49ccc7={'where':_0x559419[_0x0319('0x38')]};return db[_0x0319('0x29')][_0x0319('0x1c')](_0x49ccc7)[_0x0319('0x20')](function(_0xf28055){_0xb8c775['count']=_0xf28055;if(_0x20bdd2['query'][_0x0319('0x3d')]){_0x559419[_0x0319('0x3e')]=[{'all':!![]}];}return db[_0x0319('0x29')][_0x0319('0x3f')](_0x559419);})[_0x0319('0x20')](function(_0x55ed8b){_0xb8c775[_0x0319('0x40')]=_0x55ed8b;return _0xb8c775;})[_0x0319('0x20')](respondWithFilteredResult(_0x2ac7c8,_0x559419))[_0x0319('0x41')](handleError(_0x2ac7c8,null));};exports[_0x0319('0x42')]=function(_0x223133,_0x3f8984){var _0x191ad4={'raw':!![],'where':{'id':_0x223133['params']['id']}},_0x5c1790={};_0x5c1790[_0x0319('0x2e')]=_['keys'](db['OpenchannelApplication']['rawAttributes']);_0x5c1790[_0x0319('0x2f')]=_['keys'](_0x223133['query']);_0x5c1790['filters']=_[_0x0319('0x33')](_0x5c1790[_0x0319('0x2e')],_0x5c1790['query']);_0x191ad4[_0x0319('0x32')]=_[_0x0319('0x33')](_0x5c1790['model'],qs['fields'](_0x223133[_0x0319('0x2f')][_0x0319('0x34')]));_0x191ad4['attributes']=_0x191ad4['attributes'][_0x0319('0x43')]?_0x191ad4[_0x0319('0x32')]:_0x5c1790[_0x0319('0x2e')];if(_0x223133['query'][_0x0319('0x3d')]){_0x191ad4['include']=[{'all':!![]}];}_0x191ad4=_[_0x0319('0x39')]({},_0x191ad4,_0x223133['options']);return db[_0x0319('0x29')][_0x0319('0x44')](_0x191ad4)['then'](handleEntityNotFound(_0x3f8984,null))[_0x0319('0x20')](respondWithResult(_0x3f8984,null))[_0x0319('0x41')](handleError(_0x3f8984,null));};exports[_0x0319('0x45')]=function(_0xc78484,_0x41b5f9){return db[_0x0319('0x29')][_0x0319('0x45')](_0xc78484['body'],{})[_0x0319('0x20')](respondWithResult(_0x41b5f9,0xc9))[_0x0319('0x41')](handleError(_0x41b5f9,null));};exports['update']=function(_0x106d7c,_0x3d71b4){if(_0x106d7c['body']['id']){delete _0x106d7c[_0x0319('0x46')]['id'];}return db['OpenchannelApplication'][_0x0319('0x44')]({'where':{'id':_0x106d7c[_0x0319('0x47')]['id']}})['then'](handleEntityNotFound(_0x3d71b4,null))[_0x0319('0x20')](saveUpdates(_0x106d7c[_0x0319('0x46')],null))[_0x0319('0x20')](respondWithResult(_0x3d71b4,null))[_0x0319('0x41')](handleError(_0x3d71b4,null));};exports[_0x0319('0x21')]=function(_0xa46f23,_0x54b29f){return db[_0x0319('0x29')]['find']({'where':{'id':_0xa46f23[_0x0319('0x47')]['id']}})[_0x0319('0x20')](handleEntityNotFound(_0x54b29f,null))[_0x0319('0x20')](removeEntity(_0x54b29f,null))['catch'](handleError(_0x54b29f,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index bcfc2de..056dce4 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 _0xa633=['exports','define','OpenchannelApplication','utf8mb4','lodash','util','../../config/logger','api','bluebird','rimraf','./openchannelApplication.attributes'];(function(_0x30c2ae,_0x4c98a2){var _0x1ee1cc=function(_0x165922){while(--_0x165922){_0x30c2ae['push'](_0x30c2ae['shift']());}};_0x1ee1cc(++_0x4c98a2);}(_0xa633,0x164));var _0x3a63=function(_0x49764d,_0x29d032){_0x49764d=_0x49764d-0x0;var _0x4948e7=_0xa633[_0x49764d];return _0x4948e7;};'use strict';var _=require(_0x3a63('0x0'));var util=require(_0x3a63('0x1'));var logger=require(_0x3a63('0x2'))(_0x3a63('0x3'));var moment=require('moment');var BPromise=require(_0x3a63('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3a63('0x5'));var config=require('../../config/environment');var attributes=require(_0x3a63('0x6'));module[_0x3a63('0x7')]=function(_0xb78f23,_0x3bb1a9){return _0xb78f23[_0x3a63('0x8')](_0x3a63('0x9'),attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3a63('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x8851=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelApplication.attributes','define','OpenchannelApplication','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x19a562,_0x730f37){var _0x1ec258=function(_0x3274ad){while(--_0x3274ad){_0x19a562['push'](_0x19a562['shift']());}};_0x1ec258(++_0x730f37);}(_0x8851,0x110));var _0x1885=function(_0x1a2635,_0x2a33a8){_0x1a2635=_0x1a2635-0x0;var _0x2ccd92=_0x8851[_0x1a2635];return _0x2ccd92;};'use strict';var _=require(_0x1885('0x0'));var util=require('util');var logger=require(_0x1885('0x1'))('api');var moment=require(_0x1885('0x2'));var BPromise=require(_0x1885('0x3'));var rp=require(_0x1885('0x4'));var fs=require('fs');var path=require(_0x1885('0x5'));var rimraf=require(_0x1885('0x6'));var config=require(_0x1885('0x7'));var attributes=require(_0x1885('0x8'));module['exports']=function(_0x49b3e6,_0x3765d0){return _0x49b3e6[_0x1885('0x9')](_0x1885('0xa'),attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1885('0xb'),'collate':_0x1885('0xc')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 410dc6a..ec103ca 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 _0xa86b=['request\x20sent','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelApplication,\x20%s,\x20%s','message','result','catch','UpdateOpenchannelApplication','update','body','options','where','attributes','limit','then','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x2e0443,_0x7e5974){var _0x52d450=function(_0x3a9985){while(--_0x3a9985){_0x2e0443['push'](_0x2e0443['shift']());}};_0x52d450(++_0x7e5974);}(_0xa86b,0xac));var _0xba86=function(_0x2b2814,_0x244e1c){_0x2b2814=_0x2b2814-0x0;var _0x545e19=_0xa86b[_0x2b2814];return _0x545e19;};'use strict';var _=require(_0xba86('0x0'));var util=require(_0xba86('0x1'));var moment=require(_0xba86('0x2'));var BPromise=require(_0xba86('0x3'));var rs=require(_0xba86('0x4'));var fs=require('fs');var Redis=require(_0xba86('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xba86('0x6'));var logger=require(_0xba86('0x7'))('rpc');var config=require(_0xba86('0x8'));var jayson=require(_0xba86('0x9'));var client=jayson[_0xba86('0xa')][_0xba86('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a0e67,_0x2ddac3,_0x45605d){return new BPromise(function(_0x58f578,_0x44f597){return client[_0xba86('0xc')](_0x1a0e67,_0x45605d)['then'](function(_0x37e996){logger[_0xba86('0xd')]('OpenchannelApplication,\x20%s,\x20%s',_0x2ddac3,_0xba86('0xe'));logger['debug'](_0xba86('0xf'),_0x2ddac3,_0xba86('0xe'),JSON[_0xba86('0x10')](_0x37e996));if(_0x37e996[_0xba86('0x11')]){if(_0x37e996[_0xba86('0x11')]['code']===0x1f4){logger[_0xba86('0x11')](_0xba86('0x12'),_0x2ddac3,_0x37e996[_0xba86('0x11')][_0xba86('0x13')]);return _0x44f597(_0x37e996[_0xba86('0x11')][_0xba86('0x13')]);}logger['error'](_0xba86('0x12'),_0x2ddac3,_0x37e996[_0xba86('0x11')][_0xba86('0x13')]);return _0x58f578(_0x37e996[_0xba86('0x11')][_0xba86('0x13')]);}else{logger[_0xba86('0xd')]('OpenchannelApplication,\x20%s,\x20%s',_0x2ddac3,_0xba86('0xe'));_0x58f578(_0x37e996[_0xba86('0x14')][_0xba86('0x13')]);}})[_0xba86('0x15')](function(_0x3bb0ed){logger[_0xba86('0x11')](_0xba86('0x12'),_0x2ddac3,_0x3bb0ed);_0x44f597(_0x3bb0ed);});});}exports[_0xba86('0x16')]=function(_0x2a35b3){var _0xb61e22=this;return new Promise(function(_0x5c2913,_0x40d4f6){return db['OpenchannelApplication'][_0xba86('0x17')](_0x2a35b3[_0xba86('0x18')],{'raw':_0x2a35b3['options']?_0x2a35b3[_0xba86('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2a35b3[_0xba86('0x19')]?_0x2a35b3[_0xba86('0x19')][_0xba86('0x1a')]||null:null,'attributes':_0x2a35b3[_0xba86('0x19')]?_0x2a35b3[_0xba86('0x19')][_0xba86('0x1b')]||null:null,'limit':_0x2a35b3['options']?_0x2a35b3['options'][_0xba86('0x1c')]||null:null})[_0xba86('0x1d')](function(_0xf83f4a){logger[_0xba86('0xd')]('UpdateOpenchannelApplication',_0x2a35b3);logger[_0xba86('0x1e')]('UpdateOpenchannelApplication',_0x2a35b3,JSON[_0xba86('0x10')](_0xf83f4a));_0x5c2913(_0xf83f4a);})['catch'](function(_0x176df2){logger['error'](_0xba86('0x16'),_0x176df2[_0xba86('0x13')],_0x2a35b3);_0x40d4f6(_0xb61e22[_0xba86('0x11')](0x1f4,_0x176df2[_0xba86('0x13')]));});});}; \ No newline at end of file +var _0x49ea=['debug','stringify','error','code','OpenchannelApplication,\x20%s,\x20%s','message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','where','attributes','limit','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x49ea,0xa7));var _0xa49e=function(_0x3af6a7,_0x12159d){_0x3af6a7=_0x3af6a7-0x0;var _0xb330bd=_0x49ea[_0x3af6a7];return _0xb330bd;};'use strict';var _=require('lodash');var util=require(_0xa49e('0x0'));var moment=require('moment');var BPromise=require(_0xa49e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa49e('0x2'))['db'];var utils=require(_0xa49e('0x3'));var logger=require(_0xa49e('0x4'))(_0xa49e('0x5'));var config=require(_0xa49e('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xa49e('0x7')][_0xa49e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x328094,_0x430acf,_0x5d7ea4){return new BPromise(function(_0x1d5bd0,_0x1957e6){return client[_0xa49e('0x9')](_0x328094,_0x5d7ea4)[_0xa49e('0xa')](function(_0x23d7fa){logger[_0xa49e('0xb')]('OpenchannelApplication,\x20%s,\x20%s',_0x430acf,_0xa49e('0xc'));logger[_0xa49e('0xd')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x430acf,_0xa49e('0xc'),JSON[_0xa49e('0xe')](_0x23d7fa));if(_0x23d7fa[_0xa49e('0xf')]){if(_0x23d7fa[_0xa49e('0xf')][_0xa49e('0x10')]===0x1f4){logger[_0xa49e('0xf')](_0xa49e('0x11'),_0x430acf,_0x23d7fa[_0xa49e('0xf')][_0xa49e('0x12')]);return _0x1957e6(_0x23d7fa['error'][_0xa49e('0x12')]);}logger[_0xa49e('0xf')](_0xa49e('0x11'),_0x430acf,_0x23d7fa['error']['message']);return _0x1d5bd0(_0x23d7fa[_0xa49e('0xf')]['message']);}else{logger[_0xa49e('0xb')](_0xa49e('0x11'),_0x430acf,_0xa49e('0xc'));_0x1d5bd0(_0x23d7fa[_0xa49e('0x13')][_0xa49e('0x12')]);}})[_0xa49e('0x14')](function(_0x3f78e8){logger['error'](_0xa49e('0x11'),_0x430acf,_0x3f78e8);_0x1957e6(_0x3f78e8);});});}exports[_0xa49e('0x15')]=function(_0x13d673){var _0x58228a=this;return new Promise(function(_0x1e423d,_0xcaf98a){return db[_0xa49e('0x16')][_0xa49e('0x17')](_0x13d673[_0xa49e('0x18')],{'raw':_0x13d673[_0xa49e('0x19')]?_0x13d673[_0xa49e('0x19')][_0xa49e('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x13d673[_0xa49e('0x19')]?_0x13d673[_0xa49e('0x19')][_0xa49e('0x1b')]||null:null,'attributes':_0x13d673[_0xa49e('0x19')]?_0x13d673[_0xa49e('0x19')][_0xa49e('0x1c')]||null:null,'limit':_0x13d673['options']?_0x13d673[_0xa49e('0x19')][_0xa49e('0x1d')]||null:null})[_0xa49e('0xa')](function(_0x5f17dd){logger['info']('UpdateOpenchannelApplication',_0x13d673);logger[_0xa49e('0xd')]('UpdateOpenchannelApplication',_0x13d673,JSON['stringify'](_0x5f17dd));_0x1e423d(_0x5f17dd);})[_0xa49e('0x14')](function(_0x3a89b1){logger['error']('UpdateOpenchannelApplication',_0x3a89b1[_0xa49e('0x12')],_0x13d673);_0xcaf98a(_0x58228a[_0xa49e('0xf')](0x1f4,_0x3a89b1['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 5a6dd7a..28c3011 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 _0x9267=['post','/:id/tags','tracked','openchannelinteraction:addtags','addTags','put','/:id','openchannel','openchannelinteraction:update','update','openchannelinteraction:destroy','destroy','delete','removeTags','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','show','/:id/messages','getMessages','/:id/download','download'];(function(_0x5d85f0,_0x74d66a){var _0x151e2c=function(_0x1cd129){while(--_0x1cd129){_0x5d85f0['push'](_0x5d85f0['shift']());}};_0x151e2c(++_0x74d66a);}(_0x9267,0x1ef));var _0x7926=function(_0x2efcca,_0x2c69b5){_0x2efcca=_0x2efcca-0x0;var _0x406d96=_0x9267[_0x2efcca];return _0x406d96;};'use strict';var multer=require(_0x7926('0x0'));var util=require(_0x7926('0x1'));var path=require(_0x7926('0x2'));var timeout=require(_0x7926('0x3'));var express=require('express');var router=express[_0x7926('0x4')]();var fs_extra=require(_0x7926('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7926('0x6'));var config=require(_0x7926('0x7'));var controller=require('./openchannelInteraction.controller');router[_0x7926('0x8')]('/',auth[_0x7926('0x9')](),controller['index']);router[_0x7926('0x8')](_0x7926('0xa'),auth[_0x7926('0x9')](),controller[_0x7926('0xb')]);router['get']('/:id',auth[_0x7926('0x9')](),controller[_0x7926('0xc')]);router['get'](_0x7926('0xd'),auth[_0x7926('0x9')](),controller[_0x7926('0xe')]);router[_0x7926('0x8')](_0x7926('0xf'),auth[_0x7926('0x9')](),controller[_0x7926('0x10')]);router[_0x7926('0x11')]('/',auth[_0x7926('0x9')](),controller['create']);router[_0x7926('0x11')]('/:id/messages',auth['isAuthenticated'](),controller['addMessage']);router['post'](_0x7926('0x12'),auth[_0x7926('0x9')](),interaction[_0x7926('0x13')]('openchannel',_0x7926('0x14')),controller[_0x7926('0x15')]);router[_0x7926('0x16')](_0x7926('0x17'),auth[_0x7926('0x9')](),interaction[_0x7926('0x13')](_0x7926('0x18'),_0x7926('0x19')),controller[_0x7926('0x1a')]);router['delete'](_0x7926('0x17'),auth[_0x7926('0x9')](),interaction[_0x7926('0x13')](_0x7926('0x18'),_0x7926('0x1b')),controller[_0x7926('0x1c')]);router[_0x7926('0x1d')](_0x7926('0x12'),auth[_0x7926('0x9')](),controller[_0x7926('0x1e')]);module[_0x7926('0x1f')]=router; \ No newline at end of file +var _0x4a2e=['isAuthenticated','index','/describe','/:id','show','/:id/messages','getMessages','download','post','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put','openchannelinteraction:update','update','delete','removeTags','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x3eb998,_0x4f5cee){var _0x272be1=function(_0x10bc96){while(--_0x10bc96){_0x3eb998['push'](_0x3eb998['shift']());}};_0x272be1(++_0x4f5cee);}(_0x4a2e,0x122));var _0xe4a2=function(_0x39979b,_0x2111f9){_0x39979b=_0x39979b-0x0;var _0x560b41=_0x4a2e[_0x39979b];return _0x560b41;};'use strict';var multer=require(_0xe4a2('0x0'));var util=require('util');var path=require(_0xe4a2('0x1'));var timeout=require(_0xe4a2('0x2'));var express=require(_0xe4a2('0x3'));var router=express[_0xe4a2('0x4')]();var fs_extra=require(_0xe4a2('0x5'));var auth=require(_0xe4a2('0x6'));var interaction=require(_0xe4a2('0x7'));var config=require(_0xe4a2('0x8'));var controller=require('./openchannelInteraction.controller');router[_0xe4a2('0x9')]('/',auth[_0xe4a2('0xa')](),controller[_0xe4a2('0xb')]);router['get'](_0xe4a2('0xc'),auth[_0xe4a2('0xa')](),controller['describe']);router[_0xe4a2('0x9')](_0xe4a2('0xd'),auth[_0xe4a2('0xa')](),controller[_0xe4a2('0xe')]);router[_0xe4a2('0x9')](_0xe4a2('0xf'),auth[_0xe4a2('0xa')](),controller[_0xe4a2('0x10')]);router['get']('/:id/download',auth[_0xe4a2('0xa')](),controller[_0xe4a2('0x11')]);router[_0xe4a2('0x12')]('/',auth[_0xe4a2('0xa')](),controller['create']);router[_0xe4a2('0x12')]('/:id/messages',auth[_0xe4a2('0xa')](),controller['addMessage']);router[_0xe4a2('0x12')](_0xe4a2('0x13'),auth[_0xe4a2('0xa')](),interaction[_0xe4a2('0x14')](_0xe4a2('0x15'),_0xe4a2('0x16')),controller[_0xe4a2('0x17')]);router[_0xe4a2('0x18')](_0xe4a2('0xd'),auth[_0xe4a2('0xa')](),interaction[_0xe4a2('0x14')](_0xe4a2('0x15'),_0xe4a2('0x19')),controller[_0xe4a2('0x1a')]);router[_0xe4a2('0x1b')](_0xe4a2('0xd'),auth[_0xe4a2('0xa')](),interaction['tracked'](_0xe4a2('0x15'),'openchannelinteraction:destroy'),controller['destroy']);router[_0xe4a2('0x1b')](_0xe4a2('0x13'),auth[_0xe4a2('0xa')](),controller[_0xe4a2('0x1c')]);module[_0xe4a2('0x1d')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 211f98c..d4c90c6 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 _0xedd9=['exports','BOOLEAN','DATE','STRING','ENUM','out'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xedd9,0xfc));var _0x9edd=function(_0x242582,_0x12d90d){_0x242582=_0x242582-0x0;var _0x382e33=_0xedd9[_0x242582];return _0x382e33;};'use strict';var Sequelize=require('sequelize');module[_0x9edd('0x0')]={'closed':{'type':Sequelize[_0x9edd('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9edd('0x2')]},'disposition':{'type':Sequelize[_0x9edd('0x3')]},'secondDisposition':{'type':Sequelize[_0x9edd('0x3')]},'thirdDisposition':{'type':Sequelize[_0x9edd('0x3')]},'note':{'type':Sequelize[_0x9edd('0x3')]},'read1stAt':{'type':Sequelize[_0x9edd('0x2')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0x9edd('0x3')]},'lastMsgAt':{'type':Sequelize[_0x9edd('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x9edd('0x4')]('in',_0x9edd('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize[_0x9edd('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0x0ec2=['sequelize','BOOLEAN','DATE','STRING','ENUM','out'];(function(_0x1d6b3f,_0x335799){var _0x505d0d=function(_0x156b68){while(--_0x156b68){_0x1d6b3f['push'](_0x1d6b3f['shift']());}};_0x505d0d(++_0x335799);}(_0x0ec2,0x72));var _0x20ec=function(_0x1fb1c1,_0x4ebe69){_0x1fb1c1=_0x1fb1c1-0x0;var _0x1622df=_0x0ec2[_0x1fb1c1];return _0x1622df;};'use strict';var Sequelize=require(_0x20ec('0x0'));module['exports']={'closed':{'type':Sequelize[_0x20ec('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x20ec('0x2')]},'disposition':{'type':Sequelize[_0x20ec('0x3')]},'secondDisposition':{'type':Sequelize[_0x20ec('0x3')]},'thirdDisposition':{'type':Sequelize[_0x20ec('0x3')]},'note':{'type':Sequelize[_0x20ec('0x3')]},'read1stAt':{'type':Sequelize[_0x20ec('0x2')]},'threadId':{'type':Sequelize[_0x20ec('0x3')]},'externalUrl':{'type':Sequelize[_0x20ec('0x3')]},'lastMsgAt':{'type':Sequelize[_0x20ec('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x20ec('0x4')]('in',_0x20ec('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x20ec('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0x20ec('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 5ec4b23..d4bce77 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 _0xeb2e=['i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','Sequelize','QueryTypes','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','t.id\x20IN\x20?','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','agent','user','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','role','toString','sequelize','keyBy','merge','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','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','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.phone','c.mobile','c.fax','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','OpenchannelInteractionId','params','includeAll','options','create','describe','ids','omit','findOne','format','YYYY-MM-DD\x20HH:mm:ss','OpenchannelMessage','findAll','rows','addTags','setTags','spread','color','emit','openchannelInteractionTags:save','removeTags','download','unix','join','server','files','tmp','root','transcript-%d-%s.zip','CmContact','firstName','lastName','attachments','Attachment','Messages','secret','OpenchannelAccount','Account','Owner','get','Openchannel','N.A.','closed','closedAt','disposition','threadId','Public','Private','basename','existsSync','createReadStream','createWriteStream','direction','renderFile','views','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','end','stack','name','send','map','fullname','TagIds','split','forEach','Tags','push','catch','index','OpenchannelInteraction','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','field','from','tools_tags','u.id','ui.OpenchannelInteractionId','user_has_openchannel_interactions','left_join','users','u.id\x20=\x20ui.UserId','select','openchannel_interactions','cm_contacts','a.id\x20=\x20i.OpenchannelAccountId','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','length','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','type','keys','some','compact','isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric'];(function(_0x2c7780,_0x100f4a){var _0x580bc8=function(_0x3d435c){while(--_0x3d435c){_0x2c7780['push'](_0x2c7780['shift']());}};_0x580bc8(++_0x100f4a);}(_0xeb2e,0x14a));var _0xeeb2=function(_0x2d30a4,_0x111993){_0x2d30a4=_0x2d30a4-0x0;var _0x3e7256=_0xeb2e[_0x2d30a4];return _0x3e7256;};'use strict';var emlformat=require(_0xeeb2('0x0'));var rimraf=require(_0xeeb2('0x1'));var zipdir=require(_0xeeb2('0x2'));var jsonpatch=require(_0xeeb2('0x3'));var rp=require(_0xeeb2('0x4'));var moment=require(_0xeeb2('0x5'));var BPromise=require(_0xeeb2('0x6'));var Mustache=require('mustache');var util=require(_0xeeb2('0x7'));var path=require(_0xeeb2('0x8'));var sox=require(_0xeeb2('0x9'));var csv=require(_0xeeb2('0xa'));var ejs=require(_0xeeb2('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeeb2('0xc'));var squel=require('squel');var crypto=require(_0xeeb2('0xd'));var jsforce=require(_0xeeb2('0xe'));var deskjs=require(_0xeeb2('0xf'));var toCsv=require(_0xeeb2('0xa'));var querystring=require(_0xeeb2('0x10'));var Papa=require('papaparse');var Redis=require(_0xeeb2('0x11'));var authService=require(_0xeeb2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xeeb2('0x13'));var pdf=require(_0xeeb2('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xeeb2('0x15'))(_0xeeb2('0x16'));var utils=require(_0xeeb2('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xeeb2('0x18'))['db'];config[_0xeeb2('0x19')]=_[_0xeeb2('0x1a')](config[_0xeeb2('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xeeb2('0x1b'))(new Redis(config[_0xeeb2('0x19')]));require(_0xeeb2('0x1c'))[_0xeeb2('0x1d')](socket);function respondWithStatusCode(_0x5b1a0c,_0x5888b0){_0x5888b0=_0x5888b0||0xcc;return function(_0x22cf84){if(_0x22cf84){return _0x5b1a0c[_0xeeb2('0x1e')](_0x5888b0);}return _0x5b1a0c[_0xeeb2('0x1f')](_0x5888b0)['end']();};}function respondWithResult(_0x306038,_0x42631b){_0x42631b=_0x42631b||0xc8;return function(_0x3f860d){if(_0x3f860d){return _0x306038[_0xeeb2('0x1f')](_0x42631b)['json'](_0x3f860d);}};}function respondWithFilteredResult(_0x5defb9,_0x1ade81){return function(_0x377c11){if(_0x377c11){var _0xbb315e=typeof _0x1ade81[_0xeeb2('0x20')]===_0xeeb2('0x21')&&typeof _0x1ade81[_0xeeb2('0x22')]===_0xeeb2('0x21');var _0x5b2cf1=_0x377c11[_0xeeb2('0x23')];var _0x9d7f9=_0xbb315e?0x0:_0x1ade81[_0xeeb2('0x20')];var _0x46aded=_0xbb315e?_0x377c11['count']:_0x1ade81[_0xeeb2('0x20')]+_0x1ade81['limit'];var _0x3715fd;if(_0x46aded>=_0x5b2cf1){_0x46aded=_0x5b2cf1;_0x3715fd=0xc8;}else{_0x3715fd=0xce;}_0x5defb9[_0xeeb2('0x1f')](_0x3715fd);return _0x5defb9[_0xeeb2('0x24')](_0xeeb2('0x25'),_0x9d7f9+'-'+_0x46aded+'/'+_0x5b2cf1)['json'](_0x377c11);}return null;};}function patchUpdates(_0x38f2fd){return function(_0x113963){try{jsonpatch['apply'](_0x113963,_0x38f2fd,!![]);}catch(_0x2261b4){return BPromise['reject'](_0x2261b4);}return _0x113963[_0xeeb2('0x26')]();};}function saveUpdates(_0x15252d,_0x5b4187){return function(_0x4cc366){if(_0x4cc366){return _0x4cc366[_0xeeb2('0x27')](_0x15252d)[_0xeeb2('0x28')](function(_0x382392){return _0x382392;});}return null;};}function removeEntity(_0x36d232,_0x5a6324){return function(_0x24ac80){if(_0x24ac80){return _0x24ac80[_0xeeb2('0x29')]()[_0xeeb2('0x28')](function(){_0x36d232[_0xeeb2('0x1f')](0xcc)[_0xeeb2('0x2a')]();});}};}function handleEntityNotFound(_0xdf27b,_0xb88e5c){return function(_0xebcfca){if(!_0xebcfca){_0xdf27b[_0xeeb2('0x1e')](0x194);}return _0xebcfca;};}function handleError(_0x3fb110,_0xcaa272){_0xcaa272=_0xcaa272||0x1f4;return function(_0x30f800){logger['error'](_0x30f800[_0xeeb2('0x2b')]);if(_0x30f800[_0xeeb2('0x2c')]){delete _0x30f800['name'];}_0x3fb110['status'](_0xcaa272)[_0xeeb2('0x2d')](_0x30f800);};}function getInteractionUsers(_0x1c5551,_0x94ff6c){return new BPromise(function(_0x3f6da0,_0x5c14da){try{if(_0x94ff6c[_0x1c5551['id']]){_0x1c5551['Users']=_[_0xeeb2('0x2e')](_0x94ff6c[_0x1c5551['id']],function(_0x46957e){return{'id':_0x46957e['id'],'fullname':_0x46957e[_0xeeb2('0x2f')]};});}}catch(_0x1c6806){_0x5c14da(_0x1c6806);}_0x3f6da0(_0x1c5551);});}function getInteractionTags(_0x1d4f8e,_0x342381){return new BPromise(function(_0x1743df,_0x3d3d0b){try{if(_0x1d4f8e[_0xeeb2('0x30')]){_0x1d4f8e['Tags']=[];_0x1d4f8e[_0xeeb2('0x30')][_0xeeb2('0x31')](',')[_0xeeb2('0x32')](function(_0x3b4bc5){_0x1d4f8e[_0xeeb2('0x33')][_0xeeb2('0x34')](_0x342381[_0x3b4bc5]);});}delete _0x1d4f8e[_0xeeb2('0x30')];}catch(_0x167a83){_0x3d3d0b(_0x167a83);}_0x1743df(_0x1d4f8e);});}function updateOpenchannelInteraction(_0x57006,_0x29ccec,_0x2d3f93){return new BPromise(function(_0x4699bf,_0x1afa63){return getInteractionUsers(_0x57006,_0x2d3f93)[_0xeeb2('0x28')](function(_0x160e64){return getInteractionTags(_0x160e64,_0x29ccec);})[_0xeeb2('0x28')](function(_0x584078){_0x4699bf(_0x584078);})[_0xeeb2('0x35')](function(_0xf5ef33){_0x1afa63(_0xf5ef33);});});}exports[_0xeeb2('0x36')]=function(_0x3c39f1,_0x1ad49e){var _0x462c71={},_0x58fb3a={},_0x4a89cf={'count':0x0,'rows':[]};var _0x3cae66=_[_0xeeb2('0x2e')](db[_0xeeb2('0x37')][_0xeeb2('0x38')],function(_0x541f99){return{'name':_0x541f99[_0xeeb2('0x39')],'type':_0x541f99['type'][_0xeeb2('0x3a')]};});_0x58fb3a['model']=_[_0xeeb2('0x2e')](_0x3cae66,'name');_0x58fb3a[_0xeeb2('0x3b')]=_['keys'](_0x3c39f1[_0xeeb2('0x3b')]);_0x58fb3a[_0xeeb2('0x3c')]=_[_0xeeb2('0x3d')](_0x58fb3a[_0xeeb2('0x3e')],_0x58fb3a[_0xeeb2('0x3b')]);_0x462c71[_0xeeb2('0x3f')]=_[_0xeeb2('0x3d')](_0x58fb3a[_0xeeb2('0x3e')],qs[_0xeeb2('0x40')](_0x3c39f1[_0xeeb2('0x3b')][_0xeeb2('0x40')]));_0x462c71['attributes']=_0x462c71[_0xeeb2('0x3f')]['length']?_0x462c71[_0xeeb2('0x3f')]:_0x58fb3a[_0xeeb2('0x3e')];if(!_0x3c39f1[_0xeeb2('0x3b')][_0xeeb2('0x41')](_0xeeb2('0x42'))){_0x462c71[_0xeeb2('0x22')]=qs['limit'](_0x3c39f1['query'][_0xeeb2('0x22')]);_0x462c71[_0xeeb2('0x20')]=qs[_0xeeb2('0x20')](_0x3c39f1[_0xeeb2('0x3b')][_0xeeb2('0x20')]);}_0x462c71[_0xeeb2('0x43')]=qs[_0xeeb2('0x44')](_0x3c39f1[_0xeeb2('0x3b')][_0xeeb2('0x44')]);_0x462c71[_0xeeb2('0x45')]=qs[_0xeeb2('0x3c')](_[_0xeeb2('0x46')](_0x3c39f1[_0xeeb2('0x3b')],_0x58fb3a[_0xeeb2('0x3c')]),_0x3cae66);var _0x1b110b=[];var _0x44172e=squel['select']()[_0xeeb2('0x47')]('id')[_0xeeb2('0x47')](_0xeeb2('0x2c'))[_0xeeb2('0x47')]('color')[_0xeeb2('0x48')](_0xeeb2('0x49'));var _0x5080fb=squel['select']()[_0xeeb2('0x47')](_0xeeb2('0x4a'))['field']('u.fullname')['field'](_0xeeb2('0x4b'))[_0xeeb2('0x48')](_0xeeb2('0x4c'),'ui')[_0xeeb2('0x4d')](_0xeeb2('0x4e'),'u',_0xeeb2('0x4f'));var _0x150274=squel[_0xeeb2('0x50')]()['from'](_0xeeb2('0x51'),'i')[_0xeeb2('0x4d')](_0xeeb2('0x52'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xeeb2('0x4d')](_0xeeb2('0x4e'),'o','o.id\x20=\x20i.UserId')['left_join']('openchannel_accounts','a',_0xeeb2('0x53'))['left_join']('openchannel_messages','me',_0xeeb2('0x54'))[_0xeeb2('0x4d')](_0xeeb2('0x55'),'it',_0xeeb2('0x56'))[_0xeeb2('0x4d')](_0xeeb2('0x49'),'t',_0xeeb2('0x57'));var _0x258d2c=squel[_0xeeb2('0x58')]();var _0x363e22=[];var _0x12dac4=squel['expr']();var _0x17fbf7;if(_0x3c39f1['query'][_0xeeb2('0x59')]){_0x17fbf7=as[_0xeeb2('0x5a')](_0x3c39f1[_0xeeb2('0x3b')][_0xeeb2('0x59')]);var _0xc79060=_0x17fbf7[_0xeeb2('0x5b')];for(var _0x15aa0d=0x0;_0x15aa0d<_0x17fbf7[_0xeeb2('0x5c')][_0xeeb2('0x5d')];_0x15aa0d++){var _0x2173b4=_0x17fbf7[_0xeeb2('0x5c')][_0x15aa0d];var _0x291f0c='i';var _0x5be3ca=_[_0xeeb2('0x5e')](_0x3cae66,[_0xeeb2('0x2c'),_0x2173b4[_0xeeb2('0x47')]]);if(!_0x5be3ca){switch(_0x2173b4[_0xeeb2('0x47')]){case _0xeeb2('0x5f'):if(_0x2173b4[_0xeeb2('0x60')]==0x1){_0x150274[_0xeeb2('0x61')]('`'+_0x2173b4[_0xeeb2('0x47')]+_0xeeb2('0x62'));}else{_0x150274[_0xeeb2('0x61')]('`'+_0x2173b4[_0xeeb2('0x47')]+_0xeeb2('0x63'));}break;case _0xeeb2('0x64'):if(_0x2173b4['operator']===_0xeeb2('0x65')){if(_0x2173b4[_0xeeb2('0x60')][_0xeeb2('0x31')]('\x20')[_0xeeb2('0x5d')]>0x1){_0x258d2c[_0xc79060](_0xeeb2('0x66'),qs[_0xeeb2('0x67')](_0x2173b4[_0xeeb2('0x60')]),null);}else{var _0x5d407b='%'+_0x2173b4[_0xeeb2('0x60')]+'%';_0x258d2c[_0xc79060]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x5d407b,_0x5d407b,_0x5d407b);}}else{_0x5be3ca=_[_0xeeb2('0x5e')](_0x3cae66,['name',_0xeeb2('0x68')]);_0x2173b4[_0xeeb2('0x47')]=_0xeeb2('0x68');_0x242969=as[_0xeeb2('0x69')](_0x291f0c,_0x5be3ca['type'],_0x2173b4);_0x258d2c[_0xc79060](_0x242969[_0xeeb2('0x6a')],_0x242969[_0xeeb2('0x60')][_0xeeb2('0x6b')],_0x242969[_0xeeb2('0x60')][_0xeeb2('0x2a')]);}break;case _0xeeb2('0x6c'):var _0x4e84db=_0x2173b4[_0xeeb2('0x60')][_0xeeb2('0x31')](',')[_0xeeb2('0x2e')](function(_0x4e7223){return Number(_0x4e7223);});_0x4e84db['forEach'](function(_0x4cdd39){_0x12dac4['or'](_0xeeb2('0x6d'),'%,'+_0x4cdd39+',%');});_0x363e22=_[_0xeeb2('0x6e')](_0x363e22,_0x4e84db);break;case _0xeeb2('0x6f'):if(_0x2173b4[_0xeeb2('0x70')]===_0xeeb2('0x65')){_0x258d2c[_0xc79060](_0xeeb2('0x71'),'%'+_0x2173b4[_0xeeb2('0x60')]+'%',null);}else{_0x5be3ca=_[_0xeeb2('0x5e')](_0x3cae66,['name',_0xeeb2('0x72')]);_0x2173b4[_0xeeb2('0x47')]=_0xeeb2('0x72');_0x242969=as[_0xeeb2('0x69')](_0x291f0c,_0x5be3ca['type'],_0x2173b4);_0x258d2c[_0xc79060](_0x242969[_0xeeb2('0x6a')],_0x242969[_0xeeb2('0x60')][_0xeeb2('0x6b')],_0x242969[_0xeeb2('0x60')][_0xeeb2('0x2a')]);}break;case _0xeeb2('0x73'):_0x242969=as[_0xeeb2('0x69')]('me',null,_0x2173b4);_0x258d2c[_0xc79060](_0x242969['text'],_0x242969[_0xeeb2('0x60')]['start'],_0x242969['value']['end']);break;}}else{var _0x242969=as[_0xeeb2('0x69')](_0x291f0c,_0x5be3ca[_0xeeb2('0x74')],_0x2173b4);_0x258d2c[_0xc79060](_0x242969[_0xeeb2('0x6a')],_0x242969[_0xeeb2('0x60')]['start'],_0x242969[_0xeeb2('0x60')][_0xeeb2('0x2a')]);}}}else{var _0x58431f=_(_0x3c39f1[_0xeeb2('0x3b')])[_0xeeb2('0x75')]()[_0xeeb2('0x2e')](function(_0x4fa447){return _[_0xeeb2('0x76')](_0x3cae66,['name',_0x4fa447])?_0x4fa447:undefined;})[_0xeeb2('0x77')]()[_0xeeb2('0x60')]();if(!_[_0xeeb2('0x78')](_0x58431f)){_0x58431f[_0xeeb2('0x32')](function(_0x2fb623){if(_0x2fb623===_0xeeb2('0x79')){_0x150274[_0xeeb2('0x45')](_0xeeb2('0x7a'),[]['concat'](_0x3c39f1[_0xeeb2('0x3b')][_0x2fb623]));}else if(_0x2fb623===_0xeeb2('0x7b')){var _0x4d0270=JSON[_0xeeb2('0x7c')](_0x3c39f1[_0xeeb2('0x3b')][_0x2fb623])[_0xeeb2('0x7d')];var _0x58c66a=JSON[_0xeeb2('0x7c')](_0x3c39f1['query'][_0x2fb623])[_0xeeb2('0x7e')];_0x150274[_0xeeb2('0x45')](_0xeeb2('0x7f'),_0x4d0270,_0x58c66a);}else{if(_0x3c39f1[_0xeeb2('0x3b')][_0x2fb623]===_0xeeb2('0x80')){_0x150274[_0xeeb2('0x45')]('i.'+_0x2fb623+_0xeeb2('0x81'));}else{_0x150274['where']('i.'+_0x2fb623+'\x20=\x20?',_0x3c39f1[_0xeeb2('0x3b')][_0x2fb623]);}}});}if(_0x3c39f1[_0xeeb2('0x3b')][_0xeeb2('0x82')]){if(_0x3c39f1[_0xeeb2('0x3b')][_0xeeb2('0x82')]==0x1){_0x150274[_0xeeb2('0x61')](_0xeeb2('0x83'));}else{_0x150274[_0xeeb2('0x61')](_0xeeb2('0x84'));}}if(_0x3c39f1[_0xeeb2('0x3b')]['tag']){_0x363e22=_[_0xeeb2('0x85')](_0x3c39f1[_0xeeb2('0x3b')][_0xeeb2('0x86')])?_0x3c39f1[_0xeeb2('0x3b')][_0xeeb2('0x86')]:new Array(_0x3c39f1[_0xeeb2('0x3b')][_0xeeb2('0x86')]);_0x363e22[_0xeeb2('0x32')](function(_0x53f217){_0x12dac4['or'](_0xeeb2('0x6d'),'%,'+_0x53f217+',%');});}if(_0x3c39f1[_0xeeb2('0x3b')][_0xeeb2('0x87')]){var _0x51c0c2=_0x3c39f1[_0xeeb2('0x3b')][_0xeeb2('0x87')][_0xeeb2('0x88')]('\x5c','\x5c\x5c')[_0xeeb2('0x88')](/'/g,'\x27\x27');if(qs[_0xeeb2('0x89')](_0x51c0c2)){_0x258d2c['or'](_0xeeb2('0x8a'),_0x51c0c2+'%');}else{_0x258d2c['or'](_0xeeb2('0x8b'),qs[_0xeeb2('0x67')](_0x51c0c2))['or'](_0xeeb2('0x8c'),_0x51c0c2+'%')['or'](_0xeeb2('0x8d'),_0x51c0c2+'%');}}}_0x150274[_0xeeb2('0x45')](_0x258d2c);_0x150274['group']('i.id');var _0x2ca9c3={'type':db[_0xeeb2('0x8e')][_0xeeb2('0x8f')]['SELECT'],'raw':!![]};var _0x11f1bd=_0x150274[_0xeeb2('0x90')]();_0x11f1bd['field'](_0xeeb2('0x91'));_0x11f1bd[_0xeeb2('0x47')](_0xeeb2('0x92'),_0xeeb2('0x5f'));if(_0x462c71[_0xeeb2('0x43')]){_0x462c71[_0xeeb2('0x43')][_0xeeb2('0x32')](function(_0x5ec5ee){var _0x24dafb=_0x5ec5ee[0x0]==='contactName'?_0x5ec5ee[0x0]:'i.'+_0x5ec5ee[0x0];_0x150274[_0xeeb2('0x43')](_0x24dafb,_0x5ec5ee[0x1]==='DESC'?![]:!![]);});}if(!_[_0xeeb2('0x78')](_0x363e22)){_0x150274['having'](_0x12dac4);_0x11f1bd[_0xeeb2('0x45')](_0xeeb2('0x93'),_0x363e22);}BPromise['resolve']()[_0xeeb2('0x28')](function(){if(!_0x17fbf7){if(_0x3c39f1['query'][_0xeeb2('0x79')])return;_0x11f1bd[_0xeeb2('0x45')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');_0x150274['where'](_0xeeb2('0x94'));return;}if(_0x3c39f1['user']['role']!==_0xeeb2('0x95'))return;return _0x3c39f1[_0xeeb2('0x96')][_0xeeb2('0x97')]({'attributes':['id'],'raw':!![]})[_0xeeb2('0x28')](function(_0x1465f5){if(_[_0xeeb2('0x78')](_0x1465f5)){_0x11f1bd['where'](_0xeeb2('0x98'));_0x150274[_0xeeb2('0x45')](_0xeeb2('0x98'));}else{_0x11f1bd['where'](_0xeeb2('0x7a'),_[_0xeeb2('0x2e')](_0x1465f5,'id'));_0x150274['where'](_0xeeb2('0x7a'),_['map'](_0x1465f5,'id'));}});})[_0xeeb2('0x28')](function(){if(_0x3c39f1['user'][_0xeeb2('0x99')]==='agent'&&!_0x17fbf7&&!_0x3c39f1[_0xeeb2('0x3b')][_0xeeb2('0x79')])return[];return db['sequelize']['query'](_0x11f1bd[_0xeeb2('0x9a')](),_0x2ca9c3);})[_0xeeb2('0x28')](function(_0x3d19b9){_0x4a89cf['count']=_0x3d19b9[_0xeeb2('0x5d')];if(_0x4a89cf[_0xeeb2('0x23')]===0x0)return[];return db[_0xeeb2('0x9b')]['query'](_0x44172e[_0xeeb2('0x9a')](),_0x2ca9c3)[_0xeeb2('0x28')](function(_0x7459e0){_0x1b110b=_[_0xeeb2('0x9c')](_0x7459e0,'id');_0x2ca9c3=_[_0xeeb2('0x9d')](_0x2ca9c3,{'model':db['OpenchannelInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3c39f1['query']['fields']){_0x462c71[_0xeeb2('0x3f')][_0xeeb2('0x32')](function(_0x3348d1){_0x150274[_0xeeb2('0x47')]('i.'+_0x3348d1);});}else{_0x150274[_0xeeb2('0x47')](_0xeeb2('0x92'),_0xeeb2('0x5f'));_0x150274[_0xeeb2('0x47')](_0xeeb2('0x9e'),'Account.key');_0x150274[_0xeeb2('0x47')](_0xeeb2('0x9f'),_0xeeb2('0xa0'));_0x150274[_0xeeb2('0x47')](_0xeeb2('0xa1'),'contactName');_0x150274[_0xeeb2('0x47')](_0xeeb2('0xa2'));_0x150274['field'](_0xeeb2('0xa3'),_0xeeb2('0xa4'));_0x150274[_0xeeb2('0x47')](_0xeeb2('0xa5'),_0xeeb2('0xa6'));_0x150274[_0xeeb2('0x47')]('c.email','Contact.email');_0x150274[_0xeeb2('0x47')](_0xeeb2('0xa7'),'Contact.phone');_0x150274[_0xeeb2('0x47')](_0xeeb2('0xa8'),'Contact.mobile');_0x150274[_0xeeb2('0x47')](_0xeeb2('0xa9'),'Contact.fax');_0x150274[_0xeeb2('0x47')]('o.fullname',_0xeeb2('0xaa'));_0x150274['field'](_0xeeb2('0xab'),'Owner.internal');_0x150274[_0xeeb2('0x47')](_0xeeb2('0xac'),'TagIds');}if(_0x462c71[_0xeeb2('0x22')])_0x150274[_0xeeb2('0x22')](_0x462c71['limit']);if(_0x462c71['offset'])_0x150274['offset'](_0x462c71[_0xeeb2('0x20')]);return db[_0xeeb2('0x9b')][_0xeeb2('0x3b')](_0x150274['toString'](),_0x2ca9c3);})[_0xeeb2('0x28')](function(_0x2f7096){if(_0x2f7096[_0xeeb2('0x5d')]>0x0)_0x5080fb['where']('ui.OpenchannelInteractionId\x20IN\x20?',_[_0xeeb2('0x2e')](_0x2f7096,'id'));return db[_0xeeb2('0x9b')][_0xeeb2('0x3b')](_0x5080fb[_0xeeb2('0x9a')](),_0x2ca9c3)[_0xeeb2('0x28')](function(_0x46b00e){var _0x301e41=_['groupBy'](_0x46b00e,_0xeeb2('0xad'));var _0x55bb65=[];_0x2f7096[_0xeeb2('0x32')](function(_0x3eab7d){_0x55bb65[_0xeeb2('0x34')](updateOpenchannelInteraction(_0x3eab7d,_0x1b110b,_0x301e41));});return BPromise['all'](_0x55bb65);});});})[_0xeeb2('0x28')](function(_0x505ffb){_0x4a89cf['rows']=_0x505ffb;return _0x4a89cf;})[_0xeeb2('0x28')](respondWithFilteredResult(_0x1ad49e,_0x462c71))[_0xeeb2('0x35')](handleError(_0x1ad49e,null));};exports['show']=function(_0x4baa9f,_0x4eb36e){var _0x2904ca={};if(_0x4baa9f['query'][_0xeeb2('0x74')]&&_0x4baa9f[_0xeeb2('0x3b')][_0xeeb2('0x74')]===_0xeeb2('0x48')){_0x2904ca[_0xeeb2('0x48')]=_0x4baa9f[_0xeeb2('0xae')]['id'];}else{_0x2904ca['id']=_0x4baa9f[_0xeeb2('0xae')]['id'];}var _0x553230={'raw':![],'where':_0x2904ca},_0x256b91={};_0x256b91['model']=_['keys'](db['OpenchannelInteraction'][_0xeeb2('0x38')]);_0x256b91[_0xeeb2('0x3b')]=_['keys'](_0x4baa9f[_0xeeb2('0x3b')]);_0x256b91[_0xeeb2('0x3c')]=_['intersection'](_0x256b91[_0xeeb2('0x3e')],_0x256b91[_0xeeb2('0x3b')]);_0x553230['attributes']=_[_0xeeb2('0x3d')](_0x256b91['model'],qs[_0xeeb2('0x40')](_0x4baa9f[_0xeeb2('0x3b')][_0xeeb2('0x40')]));_0x553230[_0xeeb2('0x3f')]=_0x553230[_0xeeb2('0x3f')][_0xeeb2('0x5d')]?_0x553230[_0xeeb2('0x3f')]:_0x256b91['model'];if(_0x4baa9f[_0xeeb2('0x3b')][_0xeeb2('0xaf')]){_0x553230['include']=[{'all':!![]}];}_0x553230=_[_0xeeb2('0x9d')]({},_0x553230,_0x4baa9f[_0xeeb2('0xb0')]);return db['OpenchannelInteraction']['find'](_0x553230)[_0xeeb2('0x28')](handleEntityNotFound(_0x4eb36e,null))['then'](respondWithResult(_0x4eb36e,null))['catch'](handleError(_0x4eb36e,null));};exports[_0xeeb2('0xb1')]=function(_0x29ddc7,_0x1f0bff){return db[_0xeeb2('0x37')]['create'](_0x29ddc7['body'],{})[_0xeeb2('0x28')](respondWithResult(_0x1f0bff,0xc9))[_0xeeb2('0x35')](handleError(_0x1f0bff,null));};exports[_0xeeb2('0x27')]=function(_0x455f16,_0x460fb6){if(_0x455f16[_0xeeb2('0x73')]['id']){delete _0x455f16[_0xeeb2('0x73')]['id'];}return db[_0xeeb2('0x37')][_0xeeb2('0x5e')]({'where':{'id':_0x455f16[_0xeeb2('0xae')]['id']}})['then'](handleEntityNotFound(_0x460fb6,null))[_0xeeb2('0x28')](saveUpdates(_0x455f16['body'],null))[_0xeeb2('0x28')](respondWithResult(_0x460fb6,null))[_0xeeb2('0x35')](handleError(_0x460fb6,null));};exports['destroy']=function(_0x115180,_0x4bbac3){return db[_0xeeb2('0x37')][_0xeeb2('0x5e')]({'where':{'id':_0x115180['params']['id']}})[_0xeeb2('0x28')](handleEntityNotFound(_0x4bbac3,null))[_0xeeb2('0x28')](removeEntity(_0x4bbac3,null))[_0xeeb2('0x35')](handleError(_0x4bbac3,null));};exports[_0xeeb2('0xb2')]=function(_0xca3616,_0x4410a0){return db[_0xeeb2('0x37')][_0xeeb2('0xb2')]()[_0xeeb2('0x28')](respondWithResult(_0x4410a0,null))[_0xeeb2('0x35')](handleError(_0x4410a0,null));};exports['addMessage']=function(_0x555f0e,_0x308361,_0x2b82ac){return db['OpenchannelMessage'][_0xeeb2('0x5e')]({'where':{'id':_0x555f0e[_0xeeb2('0xae')]['id']}})['then'](handleEntityNotFound(_0x308361,null))['then'](function(_0x2dabbe){if(_0x2dabbe){return _0x2dabbe['addMessage'](_0x555f0e['body'][_0xeeb2('0xb3')],_[_0xeeb2('0xb4')](_0x555f0e[_0xeeb2('0x73')],[_0xeeb2('0xb3'),'id'])||{});}})[_0xeeb2('0x28')](respondWithResult(_0x308361,null))['catch'](handleError(_0x308361,null));};exports['getMessages']=function(_0x28406e,_0x4d1604,_0x3dfa21){var _0x2ff378={'raw':![],'where':{}};var _0x5c2966={};var _0x19d994={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0xeeb2('0xb5')]({'where':{'id':_0x28406e[_0xeeb2('0xae')]['id']}})['then'](handleEntityNotFound(_0x4d1604,null))[_0xeeb2('0x28')](function(_0x56f403){if(_0x56f403){_0x5c2966[_0xeeb2('0x3e')]=_[_0xeeb2('0x75')](db['OpenchannelMessage'][_0xeeb2('0x38')]);_0x5c2966[_0xeeb2('0x3b')]=_[_0xeeb2('0x75')](_0x28406e['query']);_0x5c2966[_0xeeb2('0x3c')]=_[_0xeeb2('0x3d')](_0x5c2966[_0xeeb2('0x3e')],_0x5c2966[_0xeeb2('0x3b')]);_0x2ff378[_0xeeb2('0x3f')]=_['intersection'](_0x5c2966['model'],qs['fields'](_0x28406e[_0xeeb2('0x3b')][_0xeeb2('0x40')]));_0x2ff378[_0xeeb2('0x3f')]=_0x2ff378[_0xeeb2('0x3f')]['length']?_0x2ff378[_0xeeb2('0x3f')]:_0x5c2966[_0xeeb2('0x3e')];if(!_0x28406e[_0xeeb2('0x3b')][_0xeeb2('0x41')](_0xeeb2('0x42'))){_0x2ff378[_0xeeb2('0x22')]=qs[_0xeeb2('0x22')](_0x28406e[_0xeeb2('0x3b')][_0xeeb2('0x22')]);_0x2ff378[_0xeeb2('0x20')]=qs[_0xeeb2('0x20')](_0x28406e[_0xeeb2('0x3b')][_0xeeb2('0x20')]);}_0x2ff378['order']=qs['sort'](_0x28406e['query']['sort']);_0x2ff378[_0xeeb2('0x45')]=qs['filters'](_[_0xeeb2('0x46')](_0x28406e[_0xeeb2('0x3b')],_0x5c2966[_0xeeb2('0x3c')]));_0x2ff378[_0xeeb2('0x45')]['OpenchannelInteractionId']=_0x56f403['id'];if(_0x28406e[_0xeeb2('0x3b')][_0xeeb2('0x87')]){_0x2ff378[_0xeeb2('0x45')]=_[_0xeeb2('0x9d')](_0x2ff378['where'],{'$or':_[_0xeeb2('0x2e')](_0x2ff378[_0xeeb2('0x3f')],function(_0x521bbd){var _0x1dc567={};_0x1dc567[_0x521bbd]={'$like':'%'+_0x28406e[_0xeeb2('0x3b')]['filter']+'%'};return _0x1dc567;})});}if(_0x28406e[_0xeeb2('0x3b')][_0xeeb2('0x7d')]){var _0x546fa=_0x28406e['query'][_0xeeb2('0x7d')]['split'](',');var _0x23491b={};_0x23491b[_0x546fa[0x0]]={'$gte':moment(_0x546fa[0x1])[_0xeeb2('0xb6')](_0xeeb2('0xb7'))};_0x2ff378[_0xeeb2('0x45')]=_[_0xeeb2('0x9d')](_0x2ff378[_0xeeb2('0x45')],_0x23491b);}_0x2ff378=_[_0xeeb2('0x9d')]({},_0x2ff378,_0x28406e['options']);return db[_0xeeb2('0xb8')]['count']({'where':_0x2ff378[_0xeeb2('0x45')]})[_0xeeb2('0x28')](function(_0x2f6d03){_0x19d994[_0xeeb2('0x23')]=_0x2f6d03;if(_0x28406e[_0xeeb2('0x3b')][_0xeeb2('0xaf')]){_0x2ff378['include']=[{'all':!![]}];}return db[_0xeeb2('0xb8')][_0xeeb2('0xb9')](_0x2ff378);})['then'](function(_0x2f4fb6){_0x19d994[_0xeeb2('0xba')]=_0x2f4fb6;return _0x19d994;});}})[_0xeeb2('0x28')](respondWithFilteredResult(_0x4d1604,_0x2ff378))[_0xeeb2('0x35')](handleError(_0x4d1604,null));};exports[_0xeeb2('0xbb')]=function(_0x1ec70e,_0x517356,_0x8d9cc6){return db[_0xeeb2('0x37')][_0xeeb2('0x5e')]({'where':{'id':_0x1ec70e[_0xeeb2('0xae')]['id']}})[_0xeeb2('0x28')](handleEntityNotFound(_0x517356,null))['then'](function(_0x2ff6b8){if(_0x2ff6b8){return _0x2ff6b8[_0xeeb2('0xbc')](_0x1ec70e['body']['ids'],_[_0xeeb2('0xb4')](_0x1ec70e[_0xeeb2('0x73')],[_0xeeb2('0xb3'),'id'])||{})[_0xeeb2('0xbd')](function(){return db[_0xeeb2('0x6c')]['findAll']({'attributes':['id',_0xeeb2('0x2c'),_0xeeb2('0xbe')],'where':{'id':_0x1ec70e[_0xeeb2('0x73')][_0xeeb2('0xb3')]}});})[_0xeeb2('0x28')](function(_0x234551){socket[_0xeeb2('0xbf')](_0xeeb2('0xc0'),{'id':Number(_0x1ec70e[_0xeeb2('0xae')]['id']),'tags':_0x234551||[]});return{'id':Number(_0x1ec70e[_0xeeb2('0xae')]['id']),'tags':_0x234551||[]};});}})[_0xeeb2('0x28')](respondWithResult(_0x517356,null))[_0xeeb2('0x35')](handleError(_0x517356,null));};exports[_0xeeb2('0xc1')]=function(_0x7c6d5a,_0x1394cc,_0x40fe57){return db[_0xeeb2('0x37')][_0xeeb2('0x5e')]({'where':{'id':_0x7c6d5a['params']['id']}})['then'](handleEntityNotFound(_0x1394cc,null))[_0xeeb2('0x28')](function(_0x28ac17){if(_0x28ac17){return _0x28ac17[_0xeeb2('0xc1')](_0x7c6d5a['query'][_0xeeb2('0xb3')]);}})[_0xeeb2('0x28')](respondWithStatusCode(_0x1394cc,null))[_0xeeb2('0x35')](handleError(_0x1394cc,null));};exports[_0xeeb2('0xc2')]=function(_0x2ef9d1,_0x5e150f){var _0x27719c=moment()[_0xeeb2('0xc3')]()['toString']();var _0x201c48=path[_0xeeb2('0xc4')](config['root'],_0xeeb2('0xc5'),_0xeeb2('0xc6'),_0xeeb2('0xc7'));var _0x965b5a=path[_0xeeb2('0xc4')](config[_0xeeb2('0xc8')],_0xeeb2('0xc5'),_0xeeb2('0xc6'),'attachments');var _0x226ff3=path[_0xeeb2('0xc4')](_0x201c48,_0x27719c);var _0x37968e=util[_0xeeb2('0xb6')](_0xeeb2('0xc9'),_0x2ef9d1['params']['id'],_0x27719c);var _0x4a4ee8=path['join'](_0x201c48,_0x37968e);var _0x1c6f1d=[];_0x1c6f1d[_0xeeb2('0x34')]({'model':db[_0xeeb2('0x6f')],'as':_0xeeb2('0x6f'),'attributes':['id',_0xeeb2('0x2f')],'raw':!![]});_0x1c6f1d[_0xeeb2('0x34')]({'model':db[_0xeeb2('0xca')],'as':_0xeeb2('0x64'),'attributes':['id',_0xeeb2('0xcb'),_0xeeb2('0xcc')],'raw':!![]});if(_0x2ef9d1['query'][_0xeeb2('0xcd')]){_0x1c6f1d['push']({'model':db[_0xeeb2('0xce')],'as':_0xeeb2('0xce'),'raw':!![]});}var _0x3a7711=[{'model':db[_0xeeb2('0xb8')],'as':_0xeeb2('0xcf'),'attributes':['id',_0xeeb2('0x73'),_0xeeb2('0x7b'),'direction',_0xeeb2('0xd0'),'read'],'include':_0x1c6f1d}];_0x3a7711[_0xeeb2('0x34')]({'model':db[_0xeeb2('0xd1')],'as':_0xeeb2('0xd2'),'attributes':['id',_0xeeb2('0x2c')]});_0x3a7711[_0xeeb2('0x34')]({'model':db[_0xeeb2('0x6f')],'as':_0xeeb2('0xd3'),'attributes':['id',_0xeeb2('0x2f')]});return db[_0xeeb2('0x37')][_0xeeb2('0x5e')]({'where':{'id':_0x2ef9d1[_0xeeb2('0xae')]['id']},'include':_0x3a7711})['then'](handleEntityNotFound(_0x5e150f,null))[_0xeeb2('0x28')](function(_0x15e070){if(_0x15e070){var _0x17894b=_0x15e070[_0xeeb2('0xd4')]({'plain':!![]});fs['mkdirSync'](_0x226ff3);var _0xc96a98={'channel':_0xeeb2('0xd5'),'account':_0x17894b[_0xeeb2('0xd2')][_0xeeb2('0x2c')],'agent':_0x17894b[_0xeeb2('0xd3')]?_0x17894b[_0xeeb2('0xd3')]['fullname']:_0xeeb2('0xd6'),'createdAt':moment(_0x17894b[_0xeeb2('0x7b')])['format'](_0xeeb2('0xb7'))[_0xeeb2('0x9a')](),'closedAt':_0x17894b[_0xeeb2('0xd7')]?moment(_0x17894b[_0xeeb2('0xd8')])[_0xeeb2('0xb6')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x17894b[_0xeeb2('0xd9')],'visibility':_0x17894b[_0xeeb2('0xda')]?_0xeeb2('0xdb'):_0xeeb2('0xdc'),'messages':_(_0x17894b[_0xeeb2('0xcf')])[_0xeeb2('0x87')]({'secret':![]})[_0xeeb2('0x2e')](function(_0x446bb2){if(_0x446bb2[_0xeeb2('0xce')]){var _0x126e0b=path[_0xeeb2('0xc4')](_0x965b5a,_0x446bb2[_0xeeb2('0xce')][_0xeeb2('0xdd')]);if(fs[_0xeeb2('0xde')](_0x126e0b)){fs[_0xeeb2('0xdf')](_0x126e0b)['pipe'](fs[_0xeeb2('0xe0')](path[_0xeeb2('0xc4')](_0x226ff3,_0x446bb2[_0xeeb2('0xce')][_0xeeb2('0xdd')])));}}return{'date':moment(_0x446bb2[_0xeeb2('0x7b')])[_0xeeb2('0xb6')](_0xeeb2('0xb7'))[_0xeeb2('0x9a')](),'sender':_0x446bb2[_0xeeb2('0xe1')]==='out'?_0x446bb2['User']?_0x446bb2[_0xeeb2('0x6f')]['fullname']:'System':_0x446bb2[_0xeeb2('0x64')][_0xeeb2('0xcb')]+(_0x446bb2[_0xeeb2('0x64')][_0xeeb2('0xcc')]?'\x20'+_0x446bb2['Contact'][_0xeeb2('0xcc')]:''),'body':_0x446bb2['Attachment']?_0x446bb2['Attachment'][_0xeeb2('0xdd')]:_0x446bb2['body'],'direction':_0x446bb2[_0xeeb2('0xe1')]==='out'?'A':'C','secret':_0x446bb2[_0xeeb2('0xd0')],'read':_0x446bb2['read'],'attachment':_0x446bb2[_0xeeb2('0xce')]};})[_0xeeb2('0x60')]()};return ejs[_0xeeb2('0xe2')](path['join'](config[_0xeeb2('0xc8')],_0xeeb2('0xc5'),_0xeeb2('0xe3'),'downloadInteraction.ejs'),{'interaction':_0xc96a98})['then'](function(_0x3e457a){var _0x50d92f=path['join'](_0x226ff3,_0xeeb2('0xe4')+_0x17894b['id']+'-'+_0x27719c+_0xeeb2('0xe5'));var _0x20bb03={'path':_0x50d92f,'channel':_0xeeb2('0xd5'),'interactionId':_0x17894b['id']};return pdf[_0xeeb2('0xe6')](_0x3e457a,_0x20bb03);})['then'](function(){return new BPromise(function(_0xd25c62,_0x56b57c){zipdir(_0x226ff3,{'saveTo':_0x4a4ee8},function(_0x5b2c41,_0x57c01f){if(_0x5b2c41)return _0x56b57c(_0x5b2c41);return _0xd25c62(_0x57c01f);});})[_0xeeb2('0x28')](function(){return new BPromise(function(_0x1ef90b,_0x4dbe6b){rimraf(_0x226ff3,function(_0x26a1f6){if(_0x26a1f6)_0x4dbe6b(_0x26a1f6);return _0x1ef90b();});});})[_0xeeb2('0x28')](function(){return _0x5e150f[_0xeeb2('0xc2')](_0x4a4ee8,_0x37968e,function(_0x24acbc){if(_0x24acbc){console[_0xeeb2('0xe7')](_0xeeb2('0xe8'),_0x24acbc);}else{fs[_0xeeb2('0xe9')](_0x4a4ee8);}});});});}else{return _0x5e150f['sendStatus'](0xc8);}})[_0xeeb2('0x35')](handleError(_0x5e150f,null));}; \ No newline at end of file +var _0x860e=['catch','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','field','color','from','tools_tags','select','u.fullname','ui.OpenchannelInteractionId','user_has_openchannel_interactions','left_join','users','openchannel_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','find','ContactId','text','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','buildExpression','type','some','compact','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','isEmpty','t.id\x20IN\x20?','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','agent','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','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','i.*','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','toString','ui.OpenchannelInteractionId\x20IN\x20?','sequelize','groupBy','OpenchannelInteractionId','push','all','rows','show','params','OpenchannelInteraction','include','options','create','body','describe','addMessage','OpenchannelMessage','ids','omit','findOne','hasOwnProperty','nolimit','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','addTags','setTags','spread','emit','openchannelInteractionTags:save','removeTags','download','unix','root','files','tmp','join','server','attachments','transcript-%d-%s.zip','fullname','CmContact','firstName','lastName','Attachment','Messages','direction','secret','OpenchannelAccount','Account','get','Openchannel','Owner','closed','closedAt','disposition','threadId','Private','existsSync','createReadStream','pipe','basename','out','System','downloadInteraction.ejs','createPdfFromHTML','log','err','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','destroy','then','error','stack','name','TagIds','split','forEach','Tags'];(function(_0x34b71e,_0x58f44d){var _0x2cb29b=function(_0x49282a){while(--_0x49282a){_0x34b71e['push'](_0x34b71e['shift']());}};_0x2cb29b(++_0x58f44d);}(_0x860e,0x1ae));var _0xe860=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x860e[_0x134c2e];return _0x2825db;};'use strict';var emlformat=require(_0xe860('0x0'));var rimraf=require(_0xe860('0x1'));var zipdir=require(_0xe860('0x2'));var jsonpatch=require(_0xe860('0x3'));var rp=require(_0xe860('0x4'));var moment=require('moment');var BPromise=require(_0xe860('0x5'));var Mustache=require(_0xe860('0x6'));var util=require('util');var path=require(_0xe860('0x7'));var sox=require('sox');var csv=require(_0xe860('0x8'));var ejs=require(_0xe860('0x9'));var fs=require('fs');var fs_extra=require(_0xe860('0xa'));var _=require(_0xe860('0xb'));var squel=require(_0xe860('0xc'));var crypto=require(_0xe860('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xe860('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe860('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe860('0x10'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0xe860('0x11'));var logger=require(_0xe860('0x12'))(_0xe860('0x13'));var utils=require(_0xe860('0x14'));var config=require(_0xe860('0x15'));var licenseUtil=require(_0xe860('0x16'));var db=require(_0xe860('0x17'))['db'];config[_0xe860('0x18')]=_['defaults'](config['redis'],{'host':_0xe860('0x19'),'port':0x18eb});var socket=require(_0xe860('0x1a'))(new Redis(config[_0xe860('0x18')]));require('./openchannelInteraction.socket')[_0xe860('0x1b')](socket);function respondWithStatusCode(_0x4bbbae,_0x571690){_0x571690=_0x571690||0xcc;return function(_0x31ee30){if(_0x31ee30){return _0x4bbbae[_0xe860('0x1c')](_0x571690);}return _0x4bbbae[_0xe860('0x1d')](_0x571690)[_0xe860('0x1e')]();};}function respondWithResult(_0x4e52ce,_0x51b62a){_0x51b62a=_0x51b62a||0xc8;return function(_0x2721f2){if(_0x2721f2){return _0x4e52ce[_0xe860('0x1d')](_0x51b62a)['json'](_0x2721f2);}};}function respondWithFilteredResult(_0x244927,_0x233f57){return function(_0x2d43cb){if(_0x2d43cb){var _0x1ccd53=typeof _0x233f57[_0xe860('0x1f')]===_0xe860('0x20')&&typeof _0x233f57[_0xe860('0x21')]==='undefined';var _0x72f13f=_0x2d43cb['count'];var _0x3f4239=_0x1ccd53?0x0:_0x233f57['offset'];var _0x4763cd=_0x1ccd53?_0x2d43cb[_0xe860('0x22')]:_0x233f57[_0xe860('0x1f')]+_0x233f57['limit'];var _0x3b25b1;if(_0x4763cd>=_0x72f13f){_0x4763cd=_0x72f13f;_0x3b25b1=0xc8;}else{_0x3b25b1=0xce;}_0x244927[_0xe860('0x1d')](_0x3b25b1);return _0x244927[_0xe860('0x23')]('Content-Range',_0x3f4239+'-'+_0x4763cd+'/'+_0x72f13f)[_0xe860('0x24')](_0x2d43cb);}return null;};}function patchUpdates(_0xe3f7b9){return function(_0x310efe){try{jsonpatch[_0xe860('0x25')](_0x310efe,_0xe3f7b9,!![]);}catch(_0x18b889){return BPromise[_0xe860('0x26')](_0x18b889);}return _0x310efe[_0xe860('0x27')]();};}function saveUpdates(_0x503047,_0x515f3f){return function(_0x16482c){if(_0x16482c){return _0x16482c[_0xe860('0x28')](_0x503047)['then'](function(_0x448388){return _0x448388;});}return null;};}function removeEntity(_0x5cbbb8,_0x724bba){return function(_0x382ff1){if(_0x382ff1){return _0x382ff1[_0xe860('0x29')]()[_0xe860('0x2a')](function(){_0x5cbbb8['status'](0xcc)[_0xe860('0x1e')]();});}};}function handleEntityNotFound(_0x50dd6b,_0x24cbc5){return function(_0x7af47e){if(!_0x7af47e){_0x50dd6b['sendStatus'](0x194);}return _0x7af47e;};}function handleError(_0x3244f8,_0x6e8669){_0x6e8669=_0x6e8669||0x1f4;return function(_0x4f1b45){logger[_0xe860('0x2b')](_0x4f1b45[_0xe860('0x2c')]);if(_0x4f1b45[_0xe860('0x2d')]){delete _0x4f1b45[_0xe860('0x2d')];}_0x3244f8[_0xe860('0x1d')](_0x6e8669)['send'](_0x4f1b45);};}function getInteractionUsers(_0x55f82c,_0x55178d){return new BPromise(function(_0x226579,_0x417492){try{if(_0x55178d[_0x55f82c['id']]){_0x55f82c['Users']=_['map'](_0x55178d[_0x55f82c['id']],function(_0x2e8c96){return{'id':_0x2e8c96['id'],'fullname':_0x2e8c96['fullname']};});}}catch(_0x3d4421){_0x417492(_0x3d4421);}_0x226579(_0x55f82c);});}function getInteractionTags(_0x454435,_0x448700){return new BPromise(function(_0x18c299,_0x1214a0){try{if(_0x454435[_0xe860('0x2e')]){_0x454435['Tags']=[];_0x454435[_0xe860('0x2e')][_0xe860('0x2f')](',')[_0xe860('0x30')](function(_0x1bf911){_0x454435[_0xe860('0x31')]['push'](_0x448700[_0x1bf911]);});}delete _0x454435[_0xe860('0x2e')];}catch(_0x284402){_0x1214a0(_0x284402);}_0x18c299(_0x454435);});}function updateOpenchannelInteraction(_0x5899fb,_0x14edbf,_0x52335f){return new BPromise(function(_0x452ae7,_0x4a07e4){return getInteractionUsers(_0x5899fb,_0x52335f)[_0xe860('0x2a')](function(_0x4c59ed){return getInteractionTags(_0x4c59ed,_0x14edbf);})[_0xe860('0x2a')](function(_0x564ed4){_0x452ae7(_0x564ed4);})[_0xe860('0x32')](function(_0x2edce2){_0x4a07e4(_0x2edce2);});});}exports['index']=function(_0x4da794,_0x42ea88){var _0x3cd2f6={},_0x570284={},_0x1b7c55={'count':0x0,'rows':[]};var _0x3065e4=_[_0xe860('0x33')](db['OpenchannelInteraction'][_0xe860('0x34')],function(_0xd970a7){return{'name':_0xd970a7[_0xe860('0x35')],'type':_0xd970a7['type'][_0xe860('0x36')]};});_0x570284[_0xe860('0x37')]=_['map'](_0x3065e4,'name');_0x570284[_0xe860('0x38')]=_[_0xe860('0x39')](_0x4da794[_0xe860('0x38')]);_0x570284[_0xe860('0x3a')]=_[_0xe860('0x3b')](_0x570284[_0xe860('0x37')],_0x570284[_0xe860('0x38')]);_0x3cd2f6[_0xe860('0x3c')]=_['intersection'](_0x570284[_0xe860('0x37')],qs[_0xe860('0x3d')](_0x4da794[_0xe860('0x38')][_0xe860('0x3d')]));_0x3cd2f6['attributes']=_0x3cd2f6['attributes'][_0xe860('0x3e')]?_0x3cd2f6[_0xe860('0x3c')]:_0x570284[_0xe860('0x37')];if(!_0x4da794[_0xe860('0x38')]['hasOwnProperty']('nolimit')){_0x3cd2f6[_0xe860('0x21')]=qs['limit'](_0x4da794[_0xe860('0x38')]['limit']);_0x3cd2f6[_0xe860('0x1f')]=qs[_0xe860('0x1f')](_0x4da794['query'][_0xe860('0x1f')]);}_0x3cd2f6[_0xe860('0x3f')]=qs[_0xe860('0x40')](_0x4da794[_0xe860('0x38')]['sort']);_0x3cd2f6[_0xe860('0x41')]=qs[_0xe860('0x3a')](_[_0xe860('0x42')](_0x4da794['query'],_0x570284[_0xe860('0x3a')]),_0x3065e4);var _0x31efbd=[];var _0x353d1d=squel['select']()[_0xe860('0x43')]('id')['field'](_0xe860('0x2d'))[_0xe860('0x43')](_0xe860('0x44'))[_0xe860('0x45')](_0xe860('0x46'));var _0x595e57=squel[_0xe860('0x47')]()[_0xe860('0x43')]('u.id')['field'](_0xe860('0x48'))[_0xe860('0x43')](_0xe860('0x49'))[_0xe860('0x45')](_0xe860('0x4a'),'ui')[_0xe860('0x4b')](_0xe860('0x4c'),'u','u.id\x20=\x20ui.UserId');var _0x4be4e1=squel['select']()[_0xe860('0x45')](_0xe860('0x4d'),'i')[_0xe860('0x4b')](_0xe860('0x4e'),'c',_0xe860('0x4f'))[_0xe860('0x4b')]('users','o',_0xe860('0x50'))[_0xe860('0x4b')](_0xe860('0x51'),'a',_0xe860('0x52'))[_0xe860('0x4b')]('openchannel_messages','me',_0xe860('0x53'))[_0xe860('0x4b')](_0xe860('0x54'),'it',_0xe860('0x55'))[_0xe860('0x4b')]('tools_tags','t','t.id\x20=\x20it.TagId');var _0x25c278=squel[_0xe860('0x56')]();var _0x2ec0b7=[];var _0x1f99a5=squel[_0xe860('0x56')]();var _0x482e26;if(_0x4da794['query'][_0xe860('0x57')]){_0x482e26=as[_0xe860('0x58')](_0x4da794[_0xe860('0x38')][_0xe860('0x57')]);var _0x2732a7=_0x482e26[_0xe860('0x59')];for(var _0x2d28e2=0x0;_0x2d28e2<_0x482e26['conditions'][_0xe860('0x3e')];_0x2d28e2++){var _0x72464d=_0x482e26[_0xe860('0x5a')][_0x2d28e2];var _0x59a694='i';var _0x7f3714=_['find'](_0x3065e4,[_0xe860('0x2d'),_0x72464d[_0xe860('0x43')]]);if(!_0x7f3714){switch(_0x72464d[_0xe860('0x43')]){case _0xe860('0x5b'):if(_0x72464d[_0xe860('0x5c')]==0x1){_0x4be4e1[_0xe860('0x5d')]('`'+_0x72464d[_0xe860('0x43')]+_0xe860('0x5e'));}else{_0x4be4e1[_0xe860('0x5d')]('`'+_0x72464d[_0xe860('0x43')]+_0xe860('0x5f'));}break;case _0xe860('0x60'):if(_0x72464d[_0xe860('0x61')]==='$substring'){if(_0x72464d[_0xe860('0x5c')][_0xe860('0x2f')]('\x20')[_0xe860('0x3e')]>0x1){_0x25c278[_0x2732a7](_0xe860('0x62'),qs[_0xe860('0x63')](_0x72464d[_0xe860('0x5c')]),null);}else{var _0x5b8bbc='%'+_0x72464d[_0xe860('0x5c')]+'%';_0x25c278[_0x2732a7]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x5b8bbc,_0x5b8bbc,_0x5b8bbc);}}else{_0x7f3714=_[_0xe860('0x64')](_0x3065e4,[_0xe860('0x2d'),_0xe860('0x65')]);_0x72464d[_0xe860('0x43')]=_0xe860('0x65');_0x5c7e38=as['buildExpression'](_0x59a694,_0x7f3714['type'],_0x72464d);_0x25c278[_0x2732a7](_0x5c7e38[_0xe860('0x66')],_0x5c7e38[_0xe860('0x5c')]['start'],_0x5c7e38['value'][_0xe860('0x1e')]);}break;case'Tag':var _0x1ebebd=_0x72464d[_0xe860('0x5c')][_0xe860('0x2f')](',')['map'](function(_0xa3a548){return Number(_0xa3a548);});_0x1ebebd[_0xe860('0x30')](function(_0x155142){_0x1f99a5['or'](_0xe860('0x67'),'%,'+_0x155142+',%');});_0x2ec0b7=_[_0xe860('0x68')](_0x2ec0b7,_0x1ebebd);break;case _0xe860('0x69'):if(_0x72464d[_0xe860('0x61')]===_0xe860('0x6a')){_0x25c278[_0x2732a7](_0xe860('0x6b'),'%'+_0x72464d[_0xe860('0x5c')]+'%',null);}else{_0x7f3714=_[_0xe860('0x64')](_0x3065e4,['name',_0xe860('0x6c')]);_0x72464d[_0xe860('0x43')]=_0xe860('0x6c');_0x5c7e38=as['buildExpression'](_0x59a694,_0x7f3714['type'],_0x72464d);_0x25c278[_0x2732a7](_0x5c7e38[_0xe860('0x66')],_0x5c7e38['value'][_0xe860('0x6d')],_0x5c7e38['value'][_0xe860('0x1e')]);}break;case'body':_0x5c7e38=as['buildExpression']('me',null,_0x72464d);_0x25c278[_0x2732a7](_0x5c7e38[_0xe860('0x66')],_0x5c7e38[_0xe860('0x5c')][_0xe860('0x6d')],_0x5c7e38[_0xe860('0x5c')]['end']);break;}}else{var _0x5c7e38=as[_0xe860('0x6e')](_0x59a694,_0x7f3714[_0xe860('0x6f')],_0x72464d);_0x25c278[_0x2732a7](_0x5c7e38[_0xe860('0x66')],_0x5c7e38[_0xe860('0x5c')][_0xe860('0x6d')],_0x5c7e38[_0xe860('0x5c')]['end']);}}}else{var _0x3bf110=_(_0x4da794[_0xe860('0x38')])[_0xe860('0x39')]()['map'](function(_0x4080ce){return _[_0xe860('0x70')](_0x3065e4,[_0xe860('0x2d'),_0x4080ce])?_0x4080ce:undefined;})[_0xe860('0x71')]()[_0xe860('0x5c')]();if(!_['isEmpty'](_0x3bf110)){_0x3bf110[_0xe860('0x30')](function(_0x4e9aee){if(_0x4e9aee===_0xe860('0x72')){_0x4be4e1['where'](_0xe860('0x73'),[][_0xe860('0x74')](_0x4da794[_0xe860('0x38')][_0x4e9aee]));}else if(_0x4e9aee===_0xe860('0x75')){var _0x443fd0=JSON[_0xe860('0x76')](_0x4da794['query'][_0x4e9aee])[_0xe860('0x77')];var _0x4dd74b=JSON['parse'](_0x4da794[_0xe860('0x38')][_0x4e9aee])['$lte'];_0x4be4e1[_0xe860('0x41')](_0xe860('0x78'),_0x443fd0,_0x4dd74b);}else{if(_0x4da794[_0xe860('0x38')][_0x4e9aee]==='null'){_0x4be4e1[_0xe860('0x41')]('i.'+_0x4e9aee+_0xe860('0x79'));}else{_0x4be4e1[_0xe860('0x41')]('i.'+_0x4e9aee+_0xe860('0x7a'),_0x4da794[_0xe860('0x38')][_0x4e9aee]);}}});}if(_0x4da794[_0xe860('0x38')]['read']){if(_0x4da794[_0xe860('0x38')][_0xe860('0x7b')]==0x1){_0x4be4e1[_0xe860('0x5d')](_0xe860('0x7c'));}else{_0x4be4e1[_0xe860('0x5d')](_0xe860('0x7d'));}}if(_0x4da794[_0xe860('0x38')][_0xe860('0x7e')]){_0x2ec0b7=_[_0xe860('0x7f')](_0x4da794['query'][_0xe860('0x7e')])?_0x4da794[_0xe860('0x38')][_0xe860('0x7e')]:new Array(_0x4da794[_0xe860('0x38')][_0xe860('0x7e')]);_0x2ec0b7['forEach'](function(_0x1138a2){_0x1f99a5['or'](_0xe860('0x67'),'%,'+_0x1138a2+',%');});}if(_0x4da794[_0xe860('0x38')][_0xe860('0x80')]){var _0x36a54e=_0x4da794[_0xe860('0x38')][_0xe860('0x80')]['replace']('\x5c','\x5c\x5c')[_0xe860('0x81')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x36a54e)){_0x25c278['or']('i.id\x20LIKE\x20?',_0x36a54e+'%');}else{_0x25c278['or'](_0xe860('0x82'),qs[_0xe860('0x63')](_0x36a54e))['or']('i.from\x20LIKE\x20?',_0x36a54e+'%')['or'](_0xe860('0x83'),_0x36a54e+'%');}}}_0x4be4e1[_0xe860('0x41')](_0x25c278);_0x4be4e1['group']('i.id');var _0x54d2db={'type':db[_0xe860('0x84')][_0xe860('0x85')][_0xe860('0x86')],'raw':!![]};var _0xc739b3=_0x4be4e1[_0xe860('0x87')]();_0xc739b3['field']('i.id');_0xc739b3[_0xe860('0x43')](_0xe860('0x88'),_0xe860('0x5b'));if(_0x3cd2f6[_0xe860('0x3f')]){_0x3cd2f6[_0xe860('0x3f')][_0xe860('0x30')](function(_0x1d546e){var _0x1e7f89=_0x1d546e[0x0]===_0xe860('0x89')?_0x1d546e[0x0]:'i.'+_0x1d546e[0x0];_0x4be4e1[_0xe860('0x3f')](_0x1e7f89,_0x1d546e[0x1]===_0xe860('0x8a')?![]:!![]);});}if(!_[_0xe860('0x8b')](_0x2ec0b7)){_0x4be4e1['having'](_0x1f99a5);_0xc739b3[_0xe860('0x41')](_0xe860('0x8c'),_0x2ec0b7);}BPromise[_0xe860('0x8d')]()[_0xe860('0x2a')](function(){if(!_0x482e26){if(_0x4da794[_0xe860('0x38')][_0xe860('0x72')])return;_0xc739b3['where'](_0xe860('0x8e'));_0x4be4e1['where'](_0xe860('0x8e'));return;}if(_0x4da794[_0xe860('0x8f')][_0xe860('0x90')]!=='agent')return;return _0x4da794['user'][_0xe860('0x91')]({'attributes':['id'],'raw':!![]})[_0xe860('0x2a')](function(_0xf5e7fd){if(_[_0xe860('0x8b')](_0xf5e7fd)){_0xc739b3[_0xe860('0x41')](_0xe860('0x92'));_0x4be4e1[_0xe860('0x41')](_0xe860('0x92'));}else{_0xc739b3['where'](_0xe860('0x73'),_[_0xe860('0x33')](_0xf5e7fd,'id'));_0x4be4e1[_0xe860('0x41')](_0xe860('0x73'),_[_0xe860('0x33')](_0xf5e7fd,'id'));}});})['then'](function(){if(_0x4da794[_0xe860('0x8f')][_0xe860('0x90')]===_0xe860('0x93')&&!_0x482e26&&!_0x4da794[_0xe860('0x38')][_0xe860('0x72')])return[];return db['sequelize'][_0xe860('0x38')](_0xc739b3['toString'](),_0x54d2db);})['then'](function(_0x351e59){_0x1b7c55[_0xe860('0x22')]=_0x351e59[_0xe860('0x3e')];if(_0x1b7c55[_0xe860('0x22')]===0x0)return[];return db['sequelize'][_0xe860('0x38')](_0x353d1d['toString'](),_0x54d2db)['then'](function(_0x3027ea){_0x31efbd=_[_0xe860('0x94')](_0x3027ea,'id');_0x54d2db=_[_0xe860('0x95')](_0x54d2db,{'model':db['OpenchannelInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4da794[_0xe860('0x38')][_0xe860('0x3d')]){_0x3cd2f6['attributes'][_0xe860('0x30')](function(_0x130a76){_0x4be4e1['field']('i.'+_0x130a76);});}else{_0x4be4e1[_0xe860('0x43')](_0xe860('0x88'),_0xe860('0x5b'));_0x4be4e1[_0xe860('0x43')](_0xe860('0x96'),_0xe860('0x97'));_0x4be4e1[_0xe860('0x43')](_0xe860('0x98'),_0xe860('0x99'));_0x4be4e1[_0xe860('0x43')](_0xe860('0x9a'),'contactName');_0x4be4e1[_0xe860('0x43')](_0xe860('0x9b'));_0x4be4e1[_0xe860('0x43')](_0xe860('0x9c'),_0xe860('0x9d'));_0x4be4e1[_0xe860('0x43')](_0xe860('0x9e'),'Contact.lastName');_0x4be4e1['field'](_0xe860('0x9f'),_0xe860('0xa0'));_0x4be4e1[_0xe860('0x43')](_0xe860('0xa1'),_0xe860('0xa2'));_0x4be4e1[_0xe860('0x43')](_0xe860('0xa3'),_0xe860('0xa4'));_0x4be4e1[_0xe860('0x43')](_0xe860('0xa5'),'Contact.fax');_0x4be4e1[_0xe860('0x43')](_0xe860('0xa6'),_0xe860('0xa7'));_0x4be4e1[_0xe860('0x43')](_0xe860('0xa8'),'Owner.internal');_0x4be4e1[_0xe860('0x43')](_0xe860('0xa9'),_0xe860('0x2e'));}if(_0x3cd2f6[_0xe860('0x21')])_0x4be4e1['limit'](_0x3cd2f6['limit']);if(_0x3cd2f6[_0xe860('0x1f')])_0x4be4e1[_0xe860('0x1f')](_0x3cd2f6['offset']);return db['sequelize'][_0xe860('0x38')](_0x4be4e1[_0xe860('0xaa')](),_0x54d2db);})[_0xe860('0x2a')](function(_0x53e14e){if(_0x53e14e[_0xe860('0x3e')]>0x0)_0x595e57['where'](_0xe860('0xab'),_[_0xe860('0x33')](_0x53e14e,'id'));return db[_0xe860('0xac')][_0xe860('0x38')](_0x595e57[_0xe860('0xaa')](),_0x54d2db)[_0xe860('0x2a')](function(_0x4c32e4){var _0x27a2fc=_[_0xe860('0xad')](_0x4c32e4,_0xe860('0xae'));var _0x5d1b5a=[];_0x53e14e[_0xe860('0x30')](function(_0x20ed85){_0x5d1b5a[_0xe860('0xaf')](updateOpenchannelInteraction(_0x20ed85,_0x31efbd,_0x27a2fc));});return BPromise[_0xe860('0xb0')](_0x5d1b5a);});});})[_0xe860('0x2a')](function(_0xc4ff17){_0x1b7c55[_0xe860('0xb1')]=_0xc4ff17;return _0x1b7c55;})['then'](respondWithFilteredResult(_0x42ea88,_0x3cd2f6))[_0xe860('0x32')](handleError(_0x42ea88,null));};exports[_0xe860('0xb2')]=function(_0x4aeaf9,_0x57bbb2){var _0x1c2cdd={};if(_0x4aeaf9[_0xe860('0x38')][_0xe860('0x6f')]&&_0x4aeaf9[_0xe860('0x38')][_0xe860('0x6f')]===_0xe860('0x45')){_0x1c2cdd[_0xe860('0x45')]=_0x4aeaf9[_0xe860('0xb3')]['id'];}else{_0x1c2cdd['id']=_0x4aeaf9['params']['id'];}var _0x55bf9c={'raw':![],'where':_0x1c2cdd},_0x5ea4d2={};_0x5ea4d2[_0xe860('0x37')]=_[_0xe860('0x39')](db[_0xe860('0xb4')][_0xe860('0x34')]);_0x5ea4d2[_0xe860('0x38')]=_['keys'](_0x4aeaf9[_0xe860('0x38')]);_0x5ea4d2[_0xe860('0x3a')]=_[_0xe860('0x3b')](_0x5ea4d2[_0xe860('0x37')],_0x5ea4d2['query']);_0x55bf9c['attributes']=_[_0xe860('0x3b')](_0x5ea4d2[_0xe860('0x37')],qs[_0xe860('0x3d')](_0x4aeaf9[_0xe860('0x38')][_0xe860('0x3d')]));_0x55bf9c[_0xe860('0x3c')]=_0x55bf9c['attributes'][_0xe860('0x3e')]?_0x55bf9c[_0xe860('0x3c')]:_0x5ea4d2[_0xe860('0x37')];if(_0x4aeaf9[_0xe860('0x38')]['includeAll']){_0x55bf9c[_0xe860('0xb5')]=[{'all':!![]}];}_0x55bf9c=_[_0xe860('0x95')]({},_0x55bf9c,_0x4aeaf9[_0xe860('0xb6')]);return db[_0xe860('0xb4')][_0xe860('0x64')](_0x55bf9c)[_0xe860('0x2a')](handleEntityNotFound(_0x57bbb2,null))['then'](respondWithResult(_0x57bbb2,null))[_0xe860('0x32')](handleError(_0x57bbb2,null));};exports[_0xe860('0xb7')]=function(_0x7a3993,_0x567bc6){return db['OpenchannelInteraction']['create'](_0x7a3993[_0xe860('0xb8')],{})[_0xe860('0x2a')](respondWithResult(_0x567bc6,0xc9))[_0xe860('0x32')](handleError(_0x567bc6,null));};exports[_0xe860('0x28')]=function(_0xaca9c0,_0x267717){if(_0xaca9c0['body']['id']){delete _0xaca9c0['body']['id'];}return db[_0xe860('0xb4')][_0xe860('0x64')]({'where':{'id':_0xaca9c0[_0xe860('0xb3')]['id']}})[_0xe860('0x2a')](handleEntityNotFound(_0x267717,null))[_0xe860('0x2a')](saveUpdates(_0xaca9c0['body'],null))['then'](respondWithResult(_0x267717,null))['catch'](handleError(_0x267717,null));};exports[_0xe860('0x29')]=function(_0x5d8d63,_0x51fe1b){return db['OpenchannelInteraction'][_0xe860('0x64')]({'where':{'id':_0x5d8d63[_0xe860('0xb3')]['id']}})[_0xe860('0x2a')](handleEntityNotFound(_0x51fe1b,null))[_0xe860('0x2a')](removeEntity(_0x51fe1b,null))[_0xe860('0x32')](handleError(_0x51fe1b,null));};exports[_0xe860('0xb9')]=function(_0x3a57e0,_0x3ac82b){return db['OpenchannelInteraction'][_0xe860('0xb9')]()[_0xe860('0x2a')](respondWithResult(_0x3ac82b,null))[_0xe860('0x32')](handleError(_0x3ac82b,null));};exports[_0xe860('0xba')]=function(_0x5c3e35,_0x415a9d,_0x592476){return db[_0xe860('0xbb')][_0xe860('0x64')]({'where':{'id':_0x5c3e35[_0xe860('0xb3')]['id']}})[_0xe860('0x2a')](handleEntityNotFound(_0x415a9d,null))[_0xe860('0x2a')](function(_0x1e8ef7){if(_0x1e8ef7){return _0x1e8ef7[_0xe860('0xba')](_0x5c3e35[_0xe860('0xb8')][_0xe860('0xbc')],_[_0xe860('0xbd')](_0x5c3e35['body'],['ids','id'])||{});}})[_0xe860('0x2a')](respondWithResult(_0x415a9d,null))[_0xe860('0x32')](handleError(_0x415a9d,null));};exports['getMessages']=function(_0x2dfdcd,_0x2f1404,_0x5151b5){var _0x299cda={'raw':![],'where':{}};var _0x1a7e36={};var _0x1b5803={'count':0x0,'rows':[]};return db[_0xe860('0xb4')][_0xe860('0xbe')]({'where':{'id':_0x2dfdcd[_0xe860('0xb3')]['id']}})[_0xe860('0x2a')](handleEntityNotFound(_0x2f1404,null))[_0xe860('0x2a')](function(_0x50e5ed){if(_0x50e5ed){_0x1a7e36[_0xe860('0x37')]=_['keys'](db[_0xe860('0xbb')][_0xe860('0x34')]);_0x1a7e36[_0xe860('0x38')]=_['keys'](_0x2dfdcd['query']);_0x1a7e36['filters']=_[_0xe860('0x3b')](_0x1a7e36[_0xe860('0x37')],_0x1a7e36[_0xe860('0x38')]);_0x299cda['attributes']=_[_0xe860('0x3b')](_0x1a7e36['model'],qs[_0xe860('0x3d')](_0x2dfdcd[_0xe860('0x38')][_0xe860('0x3d')]));_0x299cda[_0xe860('0x3c')]=_0x299cda['attributes'][_0xe860('0x3e')]?_0x299cda[_0xe860('0x3c')]:_0x1a7e36[_0xe860('0x37')];if(!_0x2dfdcd[_0xe860('0x38')][_0xe860('0xbf')](_0xe860('0xc0'))){_0x299cda[_0xe860('0x21')]=qs['limit'](_0x2dfdcd[_0xe860('0x38')][_0xe860('0x21')]);_0x299cda['offset']=qs[_0xe860('0x1f')](_0x2dfdcd[_0xe860('0x38')][_0xe860('0x1f')]);}_0x299cda[_0xe860('0x3f')]=qs[_0xe860('0x40')](_0x2dfdcd[_0xe860('0x38')]['sort']);_0x299cda[_0xe860('0x41')]=qs['filters'](_[_0xe860('0x42')](_0x2dfdcd[_0xe860('0x38')],_0x1a7e36[_0xe860('0x3a')]));_0x299cda[_0xe860('0x41')][_0xe860('0xae')]=_0x50e5ed['id'];if(_0x2dfdcd[_0xe860('0x38')][_0xe860('0x80')]){_0x299cda[_0xe860('0x41')]=_[_0xe860('0x95')](_0x299cda['where'],{'$or':_[_0xe860('0x33')](_0x299cda[_0xe860('0x3c')],function(_0x488aef){var _0x154c45={};_0x154c45[_0x488aef]={'$like':'%'+_0x2dfdcd['query'][_0xe860('0x80')]+'%'};return _0x154c45;})});}if(_0x2dfdcd[_0xe860('0x38')][_0xe860('0x77')]){var _0x3ec624=_0x2dfdcd[_0xe860('0x38')][_0xe860('0x77')][_0xe860('0x2f')](',');var _0x36ace4={};_0x36ace4[_0x3ec624[0x0]]={'$gte':moment(_0x3ec624[0x1])[_0xe860('0xc1')](_0xe860('0xc2'))};_0x299cda[_0xe860('0x41')]=_[_0xe860('0x95')](_0x299cda[_0xe860('0x41')],_0x36ace4);}_0x299cda=_['merge']({},_0x299cda,_0x2dfdcd['options']);return db[_0xe860('0xbb')][_0xe860('0x22')]({'where':_0x299cda[_0xe860('0x41')]})[_0xe860('0x2a')](function(_0x2bb735){_0x1b5803[_0xe860('0x22')]=_0x2bb735;if(_0x2dfdcd['query'][_0xe860('0xc3')]){_0x299cda[_0xe860('0xb5')]=[{'all':!![]}];}return db[_0xe860('0xbb')][_0xe860('0xc4')](_0x299cda);})[_0xe860('0x2a')](function(_0x4c082e){_0x1b5803[_0xe860('0xb1')]=_0x4c082e;return _0x1b5803;});}})[_0xe860('0x2a')](respondWithFilteredResult(_0x2f1404,_0x299cda))[_0xe860('0x32')](handleError(_0x2f1404,null));};exports[_0xe860('0xc5')]=function(_0x241b08,_0x357974,_0x369699){return db[_0xe860('0xb4')][_0xe860('0x64')]({'where':{'id':_0x241b08[_0xe860('0xb3')]['id']}})[_0xe860('0x2a')](handleEntityNotFound(_0x357974,null))[_0xe860('0x2a')](function(_0xbed9a5){if(_0xbed9a5){return _0xbed9a5[_0xe860('0xc6')](_0x241b08[_0xe860('0xb8')]['ids'],_[_0xe860('0xbd')](_0x241b08[_0xe860('0xb8')],[_0xe860('0xbc'),'id'])||{})[_0xe860('0xc7')](function(){return db['Tag'][_0xe860('0xc4')]({'attributes':['id',_0xe860('0x2d'),_0xe860('0x44')],'where':{'id':_0x241b08[_0xe860('0xb8')]['ids']}});})[_0xe860('0x2a')](function(_0x314b5e){socket[_0xe860('0xc8')](_0xe860('0xc9'),{'id':Number(_0x241b08[_0xe860('0xb3')]['id']),'tags':_0x314b5e||[]});return{'id':Number(_0x241b08[_0xe860('0xb3')]['id']),'tags':_0x314b5e||[]};});}})[_0xe860('0x2a')](respondWithResult(_0x357974,null))[_0xe860('0x32')](handleError(_0x357974,null));};exports[_0xe860('0xca')]=function(_0xfffd9c,_0x103f37,_0x54e499){return db[_0xe860('0xb4')][_0xe860('0x64')]({'where':{'id':_0xfffd9c['params']['id']}})[_0xe860('0x2a')](handleEntityNotFound(_0x103f37,null))['then'](function(_0x303725){if(_0x303725){return _0x303725[_0xe860('0xca')](_0xfffd9c[_0xe860('0x38')][_0xe860('0xbc')]);}})[_0xe860('0x2a')](respondWithStatusCode(_0x103f37,null))[_0xe860('0x32')](handleError(_0x103f37,null));};exports[_0xe860('0xcb')]=function(_0x2938d3,_0x5b3bf7){var _0x35f09b=moment()[_0xe860('0xcc')]()[_0xe860('0xaa')]();var _0x343312=path['join'](config[_0xe860('0xcd')],'server',_0xe860('0xce'),_0xe860('0xcf'));var _0x4fc2e1=path[_0xe860('0xd0')](config[_0xe860('0xcd')],_0xe860('0xd1'),_0xe860('0xce'),_0xe860('0xd2'));var _0x2d0786=path[_0xe860('0xd0')](_0x343312,_0x35f09b);var _0x108444=util[_0xe860('0xc1')](_0xe860('0xd3'),_0x2938d3[_0xe860('0xb3')]['id'],_0x35f09b);var _0x3ec7dd=path['join'](_0x343312,_0x108444);var _0x4f450b=[];_0x4f450b[_0xe860('0xaf')]({'model':db[_0xe860('0x69')],'as':_0xe860('0x69'),'attributes':['id',_0xe860('0xd4')],'raw':!![]});_0x4f450b[_0xe860('0xaf')]({'model':db[_0xe860('0xd5')],'as':_0xe860('0x60'),'attributes':['id',_0xe860('0xd6'),_0xe860('0xd7')],'raw':!![]});if(_0x2938d3[_0xe860('0x38')][_0xe860('0xd2')]){_0x4f450b['push']({'model':db[_0xe860('0xd8')],'as':'Attachment','raw':!![]});}var _0xfdcad8=[{'model':db[_0xe860('0xbb')],'as':_0xe860('0xd9'),'attributes':['id',_0xe860('0xb8'),_0xe860('0x75'),_0xe860('0xda'),_0xe860('0xdb'),_0xe860('0x7b')],'include':_0x4f450b}];_0xfdcad8[_0xe860('0xaf')]({'model':db[_0xe860('0xdc')],'as':_0xe860('0xdd'),'attributes':['id',_0xe860('0x2d')]});_0xfdcad8[_0xe860('0xaf')]({'model':db[_0xe860('0x69')],'as':'Owner','attributes':['id','fullname']});return db['OpenchannelInteraction'][_0xe860('0x64')]({'where':{'id':_0x2938d3[_0xe860('0xb3')]['id']},'include':_0xfdcad8})[_0xe860('0x2a')](handleEntityNotFound(_0x5b3bf7,null))[_0xe860('0x2a')](function(_0x12729d){if(_0x12729d){var _0x12dd6d=_0x12729d[_0xe860('0xde')]({'plain':!![]});fs['mkdirSync'](_0x2d0786);var _0x1a46ef={'channel':_0xe860('0xdf'),'account':_0x12dd6d['Account'][_0xe860('0x2d')],'agent':_0x12dd6d[_0xe860('0xe0')]?_0x12dd6d[_0xe860('0xe0')][_0xe860('0xd4')]:'N.A.','createdAt':moment(_0x12dd6d['createdAt'])[_0xe860('0xc1')](_0xe860('0xc2'))[_0xe860('0xaa')](),'closedAt':_0x12dd6d[_0xe860('0xe1')]?moment(_0x12dd6d[_0xe860('0xe2')])[_0xe860('0xc1')](_0xe860('0xc2'))[_0xe860('0xaa')]():'','disposition':_0x12dd6d[_0xe860('0xe3')],'visibility':_0x12dd6d[_0xe860('0xe4')]?'Public':_0xe860('0xe5'),'messages':_(_0x12dd6d['Messages'])[_0xe860('0x80')]({'secret':![]})[_0xe860('0x33')](function(_0x853653){if(_0x853653[_0xe860('0xd8')]){var _0x5ce9e3=path[_0xe860('0xd0')](_0x4fc2e1,_0x853653[_0xe860('0xd8')]['basename']);if(fs[_0xe860('0xe6')](_0x5ce9e3)){fs[_0xe860('0xe7')](_0x5ce9e3)[_0xe860('0xe8')](fs['createWriteStream'](path[_0xe860('0xd0')](_0x2d0786,_0x853653['Attachment'][_0xe860('0xe9')])));}}return{'date':moment(_0x853653[_0xe860('0x75')])[_0xe860('0xc1')](_0xe860('0xc2'))[_0xe860('0xaa')](),'sender':_0x853653[_0xe860('0xda')]===_0xe860('0xea')?_0x853653[_0xe860('0x69')]?_0x853653[_0xe860('0x69')][_0xe860('0xd4')]:_0xe860('0xeb'):_0x853653[_0xe860('0x60')][_0xe860('0xd6')]+(_0x853653['Contact'][_0xe860('0xd7')]?'\x20'+_0x853653[_0xe860('0x60')][_0xe860('0xd7')]:''),'body':_0x853653[_0xe860('0xd8')]?_0x853653[_0xe860('0xd8')]['basename']:_0x853653[_0xe860('0xb8')],'direction':_0x853653[_0xe860('0xda')]==='out'?'A':'C','secret':_0x853653[_0xe860('0xdb')],'read':_0x853653['read'],'attachment':_0x853653[_0xe860('0xd8')]};})[_0xe860('0x5c')]()};return ejs['renderFile'](path[_0xe860('0xd0')](config['root'],_0xe860('0xd1'),'views',_0xe860('0xec')),{'interaction':_0x1a46ef})[_0xe860('0x2a')](function(_0x2ea2b4){var _0x578ad1=path[_0xe860('0xd0')](_0x2d0786,'transcript-'+_0x12dd6d['id']+'-'+_0x35f09b+'.pdf');var _0x506ae2={'path':_0x578ad1,'channel':'Openchannel','interactionId':_0x12dd6d['id']};return pdf[_0xe860('0xed')](_0x2ea2b4,_0x506ae2);})[_0xe860('0x2a')](function(){return new BPromise(function(_0xe729e0,_0xe1071e){zipdir(_0x2d0786,{'saveTo':_0x3ec7dd},function(_0x3f3105,_0x2cd6ca){if(_0x3f3105)return _0xe1071e(_0x3f3105);return _0xe729e0(_0x2cd6ca);});})['then'](function(){return new BPromise(function(_0xc99f9f,_0x3a755c){rimraf(_0x2d0786,function(_0x83b29a){if(_0x83b29a)_0x3a755c(_0x83b29a);return _0xc99f9f();});});})[_0xe860('0x2a')](function(){return _0x5b3bf7[_0xe860('0xcb')](_0x3ec7dd,_0x108444,function(_0x1ae0f7){if(_0x1ae0f7){console[_0xe860('0xee')](_0xe860('0xef'),_0x1ae0f7);}else{fs['unlinkSync'](_0x3ec7dd);}});});});}else{return _0x5b3bf7[_0xe860('0x1c')](0xc8);}})['catch'](handleError(_0x5b3bf7,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 24572aa..8eb2069 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 _0x511d=['getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','hasOwnProperty','exports','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update'];(function(_0x58b2dc,_0x5502da){var _0x16817d=function(_0x19c9c8){while(--_0x19c9c8){_0x58b2dc['push'](_0x58b2dc['shift']());}};_0x16817d(++_0x5502da);}(_0x511d,0x163));var _0xd511=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x511d[_0x40a045];return _0x1a687c;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0xd511('0x0'))['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0xd511('0x0'))['db'][_0xd511('0x1')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xd511('0x2')](0x0);var events={'afterCreate':_0xd511('0x3'),'afterUpdate':_0xd511('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2b189a){return function(_0x1b87ae,_0x503883,_0x52638b){_0x1b87ae[_0xd511('0x5')]({'attributes':['id'],'raw':!![]})[_0xd511('0x6')](function(_0x3804dd){_0x1b87ae[_0xd511('0x7')](_0xd511('0x8'),_0x3804dd[_0xd511('0x9')](function(_0x34a653){return{'id':_0x34a653['id']};}));return OpenchannelMessage[_0xd511('0xa')]({'where':{'OpenchannelInteractionId':_0x1b87ae['id'],'direction':'in','read':![]},'raw':!![]});})[_0xd511('0x6')](function(_0x1de696){_0x1b87ae[_0xd511('0x7')](_0xd511('0xb'),_0x1de696[_0xd511('0xc')]);OpenchannelInteractionEvents['emit'](_0x2b189a+':'+_0x1b87ae['id'],_0x1b87ae);OpenchannelInteractionEvents['emit'](_0x2b189a,_0x1b87ae);_0x52638b(null);})['catch'](_0x52638b(null));};}for(var e in events){if(events[_0xd511('0xd')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0xd511('0xe')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x7b65=['exports','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','save','update','remove','getUsers','then','map','findAll','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook'];(function(_0x27f92b,_0x27d8d9){var _0x2e882b=function(_0x449fec){while(--_0x449fec){_0x27f92b['push'](_0x27f92b['shift']());}};_0x2e882b(++_0x27d8d9);}(_0x7b65,0x145));var _0x57b6=function(_0x3c0d39,_0x21a355){_0x3c0d39=_0x3c0d39-0x0;var _0x2bc6fa=_0x7b65[_0x3c0d39];return _0x2bc6fa;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0x57b6('0x0'))['db'][_0x57b6('0x1')];var OpenchannelMessage=require(_0x57b6('0x0'))['db'][_0x57b6('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x57b6('0x3'),'afterUpdate':_0x57b6('0x4'),'afterDestroy':_0x57b6('0x5')};function emitEvent(_0x228f7f){return function(_0x386f22,_0x5b5cc1,_0x3a764f){_0x386f22[_0x57b6('0x6')]({'attributes':['id'],'raw':!![]})[_0x57b6('0x7')](function(_0xd50c53){_0x386f22['setDataValue']('Users',_0xd50c53[_0x57b6('0x8')](function(_0x4e04a9){return{'id':_0x4e04a9['id']};}));return OpenchannelMessage[_0x57b6('0x9')]({'where':{'OpenchannelInteractionId':_0x386f22['id'],'direction':'in','read':![]},'raw':!![]});})[_0x57b6('0x7')](function(_0x13f82e){_0x386f22[_0x57b6('0xa')](_0x57b6('0xb'),_0x13f82e[_0x57b6('0xc')]);OpenchannelInteractionEvents[_0x57b6('0xd')](_0x228f7f+':'+_0x386f22['id'],_0x386f22);OpenchannelInteractionEvents[_0x57b6('0xd')](_0x228f7f,_0x386f22);_0x3a764f(null);})[_0x57b6('0xe')](_0x3a764f(null));};}for(var e in events){if(events[_0x57b6('0xf')](e)){var event=events[e];OpenchannelInteraction[_0x57b6('0x10')](e,emitEvent(event));}}module[_0x57b6('0x11')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index ba03c45..4feac93 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 _0xd8fd=['../../config/environment','./openchannelInteraction.attributes','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','moment','bluebird','path','rimraf'];(function(_0x25f7d1,_0x5016e4){var _0x4f4172=function(_0x5e74c6){while(--_0x5e74c6){_0x25f7d1['push'](_0x25f7d1['shift']());}};_0x4f4172(++_0x5016e4);}(_0xd8fd,0xe4));var _0xdd8f=function(_0x1ee0a1,_0x51058e){_0x1ee0a1=_0x1ee0a1-0x0;var _0x1d2d5b=_0xd8fd[_0x1ee0a1];return _0x1d2d5b;};'use strict';var _=require(_0xdd8f('0x0'));var util=require('util');var logger=require(_0xdd8f('0x1'))('api');var moment=require(_0xdd8f('0x2'));var BPromise=require(_0xdd8f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdd8f('0x4'));var rimraf=require(_0xdd8f('0x5'));var config=require(_0xdd8f('0x6'));var attributes=require(_0xdd8f('0x7'));module['exports']=function(_0x5c3212,_0x7371bb){return _0x5c3212[_0xdd8f('0x8')](_0xdd8f('0x9'),attributes,{'tableName':_0xdd8f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdd8f('0xb'),'collate':_0xdd8f('0xc'),'hooks':{'beforeUpdate':function(_0x55e839,_0x110619,_0x28fa29){if(_0x55e839[_0xdd8f('0xd')](_0xdd8f('0xe'))){_0x55e839[_0xdd8f('0xf')]=moment()[_0xdd8f('0x10')](_0xdd8f('0x11'));}_0x28fa29(null,_0x55e839);}}});}; \ No newline at end of file +var _0x432b=['path','../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','moment','bluebird','request-promise'];(function(_0x1d58e3,_0x17c239){var _0x54fbd8=function(_0x5c0caa){while(--_0x5c0caa){_0x1d58e3['push'](_0x1d58e3['shift']());}};_0x54fbd8(++_0x17c239);}(_0x432b,0x8b));var _0xb432=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x432b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb432('0x0'));var util=require(_0xb432('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xb432('0x2'));var BPromise=require(_0xb432('0x3'));var rp=require(_0xb432('0x4'));var fs=require('fs');var path=require(_0xb432('0x5'));var rimraf=require('rimraf');var config=require(_0xb432('0x6'));var attributes=require(_0xb432('0x7'));module[_0xb432('0x8')]=function(_0x4a2ce7,_0x3bae0f){return _0x4a2ce7[_0xb432('0x9')](_0xb432('0xa'),attributes,{'tableName':_0xb432('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb432('0xc'),'collate':_0xb432('0xd'),'hooks':{'beforeUpdate':function(_0x598a98,_0x11c32e,_0x1153b1){if(_0x598a98[_0xb432('0xe')]('closed')){_0x598a98[_0xb432('0xf')]=moment()[_0xb432('0x10')](_0xb432('0x11'));}_0x1153b1(null,_0x598a98);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 7130ae7..83421cc 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 _0x859c=['rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','OpenchannelInteraction','update','options','raw','where','attributes','limit','UpdateOpenchannelInteraction','debug','AddTagsToOpenchannelInteraction','find','body','omit','ids','spread','AddTags','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2f4b38,_0x56456a){var _0x291ace=function(_0x222151){while(--_0x222151){_0x2f4b38['push'](_0x2f4b38['shift']());}};_0x291ace(++_0x56456a);}(_0x859c,0x1a8));var _0xc859=function(_0x627b53,_0x89e407){_0x627b53=_0x627b53-0x0;var _0x3e27b7=_0x859c[_0x627b53];return _0x3e27b7;};'use strict';var _=require('lodash');var util=require(_0xc859('0x0'));var moment=require(_0xc859('0x1'));var BPromise=require(_0xc859('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc859('0x3'))['db'];var utils=require(_0xc859('0x4'));var logger=require(_0xc859('0x5'))(_0xc859('0x6'));var config=require(_0xc859('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc859('0x8')][_0xc859('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0xc859('0xa')],{'host':_0xc859('0xb'),'port':0x18eb});var socket=require(_0xc859('0xc'))(new Redis(config[_0xc859('0xa')]));require(_0xc859('0xd'))[_0xc859('0xe')](socket);function respondWithRpcPromise(_0x2f6257,_0x146774,_0x267008){return new BPromise(function(_0x54ceef,_0x1c4a18){return client[_0xc859('0xf')](_0x2f6257,_0x267008)[_0xc859('0x10')](function(_0x4a9a8c){logger[_0xc859('0x11')](_0xc859('0x12'),_0x146774,_0xc859('0x13'));logger['debug'](_0xc859('0x14'),_0x146774,_0xc859('0x13'),JSON[_0xc859('0x15')](_0x4a9a8c));if(_0x4a9a8c['error']){if(_0x4a9a8c[_0xc859('0x16')][_0xc859('0x17')]===0x1f4){logger[_0xc859('0x16')](_0xc859('0x12'),_0x146774,_0x4a9a8c[_0xc859('0x16')][_0xc859('0x18')]);return _0x1c4a18(_0x4a9a8c['error'][_0xc859('0x18')]);}logger[_0xc859('0x16')]('OpenchannelInteraction,\x20%s,\x20%s',_0x146774,_0x4a9a8c[_0xc859('0x16')][_0xc859('0x18')]);return _0x54ceef(_0x4a9a8c[_0xc859('0x16')]['message']);}else{logger[_0xc859('0x11')](_0xc859('0x12'),_0x146774,_0xc859('0x13'));_0x54ceef(_0x4a9a8c[_0xc859('0x19')]['message']);}})['catch'](function(_0x36bb46){logger[_0xc859('0x16')](_0xc859('0x12'),_0x146774,_0x36bb46);_0x1c4a18(_0x36bb46);});});}exports['UpdateOpenchannelInteraction']=function(_0x509cde){var _0x356963=this;return new Promise(function(_0x42a960,_0x38a3fc){return db[_0xc859('0x1a')][_0xc859('0x1b')](_0x509cde['body'],{'raw':_0x509cde[_0xc859('0x1c')]?_0x509cde[_0xc859('0x1c')][_0xc859('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x509cde['options']?_0x509cde['options'][_0xc859('0x1e')]||null:null,'attributes':_0x509cde['options']?_0x509cde[_0xc859('0x1c')][_0xc859('0x1f')]||null:null,'limit':_0x509cde[_0xc859('0x1c')]?_0x509cde['options'][_0xc859('0x20')]||null:null})[_0xc859('0x10')](function(_0x2a4f31){logger[_0xc859('0x11')](_0xc859('0x21'),_0x509cde);logger[_0xc859('0x22')]('UpdateOpenchannelInteraction',_0x509cde,JSON[_0xc859('0x15')](_0x2a4f31));_0x42a960(_0x2a4f31);})['catch'](function(_0x234cfe){logger['error'](_0xc859('0x21'),_0x234cfe[_0xc859('0x18')],_0x509cde);_0x38a3fc(_0x356963[_0xc859('0x16')](0x1f4,_0x234cfe[_0xc859('0x18')]));});});};exports[_0xc859('0x23')]=function(_0x316762){return new Promise(function(_0x21977b,_0x15b695){return db['OpenchannelInteraction'][_0xc859('0x24')]({'where':_0x316762[_0xc859('0x1c')]?_0x316762[_0xc859('0x1c')]['where']||null:null})[_0xc859('0x10')](function(_0x36313d){if(_0x36313d){return _0x36313d['addTags'](_0x316762[_0xc859('0x25')]['ids'],_[_0xc859('0x26')](_0x316762[_0xc859('0x25')],[_0xc859('0x27'),'id'])||{});}})[_0xc859('0x28')](function(_0x22966b){logger[_0xc859('0x11')]('AddTags',_0x316762);logger[_0xc859('0x22')](_0xc859('0x29'),_0x316762,JSON[_0xc859('0x15')](_0x22966b));_0x21977b(_0x22966b);})[_0xc859('0x2a')](function(_0x5ae9bc){logger[_0xc859('0x16')]('AddTags',_0x5ae9bc['message'],_0x316762);_0x15b695(_this['error'](0x1f4,_0x5ae9bc['message']));});});}; \ No newline at end of file +var _0x125f=['addTags','body','ids','spread','AddTags','debug','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','then','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','raw','where','attributes','AddTagsToOpenchannelInteraction'];(function(_0x3f2874,_0x733af1){var _0x87a060=function(_0xde89b2){while(--_0xde89b2){_0x3f2874['push'](_0x3f2874['shift']());}};_0x87a060(++_0x733af1);}(_0x125f,0xc9));var _0xf125=function(_0xf094c8,_0x320050){_0xf094c8=_0xf094c8-0x0;var _0x173d98=_0x125f[_0xf094c8];return _0x173d98;};'use strict';var _=require(_0xf125('0x0'));var util=require(_0xf125('0x1'));var moment=require(_0xf125('0x2'));var BPromise=require(_0xf125('0x3'));var rs=require(_0xf125('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf125('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xf125('0x6'));var jayson=require(_0xf125('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0xf125('0x8')]=_[_0xf125('0x9')](config[_0xf125('0x8')],{'host':_0xf125('0xa'),'port':0x18eb});var socket=require(_0xf125('0xb'))(new Redis(config['redis']));require(_0xf125('0xc'))[_0xf125('0xd')](socket);function respondWithRpcPromise(_0xb4e500,_0xe4bc0d,_0x12ca94){return new BPromise(function(_0x1d5919,_0x17b9d2){return client['request'](_0xb4e500,_0x12ca94)[_0xf125('0xe')](function(_0x1b6ee9){logger[_0xf125('0xf')](_0xf125('0x10'),_0xe4bc0d,_0xf125('0x11'));logger['debug'](_0xf125('0x12'),_0xe4bc0d,_0xf125('0x11'),JSON[_0xf125('0x13')](_0x1b6ee9));if(_0x1b6ee9[_0xf125('0x14')]){if(_0x1b6ee9[_0xf125('0x14')][_0xf125('0x15')]===0x1f4){logger[_0xf125('0x14')]('OpenchannelInteraction,\x20%s,\x20%s',_0xe4bc0d,_0x1b6ee9['error'][_0xf125('0x16')]);return _0x17b9d2(_0x1b6ee9[_0xf125('0x14')]['message']);}logger[_0xf125('0x14')](_0xf125('0x10'),_0xe4bc0d,_0x1b6ee9[_0xf125('0x14')]['message']);return _0x1d5919(_0x1b6ee9['error'][_0xf125('0x16')]);}else{logger[_0xf125('0xf')](_0xf125('0x10'),_0xe4bc0d,_0xf125('0x11'));_0x1d5919(_0x1b6ee9[_0xf125('0x17')][_0xf125('0x16')]);}})[_0xf125('0x18')](function(_0x2da8f7){logger[_0xf125('0x14')](_0xf125('0x10'),_0xe4bc0d,_0x2da8f7);_0x17b9d2(_0x2da8f7);});});}exports[_0xf125('0x19')]=function(_0xa088cc){var _0x4e8c8d=this;return new Promise(function(_0x3234b9,_0x2e14be){return db[_0xf125('0x1a')][_0xf125('0x1b')](_0xa088cc['body'],{'raw':_0xa088cc[_0xf125('0x1c')]?_0xa088cc[_0xf125('0x1c')][_0xf125('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa088cc[_0xf125('0x1c')]?_0xa088cc[_0xf125('0x1c')][_0xf125('0x1e')]||null:null,'attributes':_0xa088cc[_0xf125('0x1c')]?_0xa088cc[_0xf125('0x1c')][_0xf125('0x1f')]||null:null,'limit':_0xa088cc[_0xf125('0x1c')]?_0xa088cc[_0xf125('0x1c')]['limit']||null:null})[_0xf125('0xe')](function(_0x221274){logger[_0xf125('0xf')]('UpdateOpenchannelInteraction',_0xa088cc);logger['debug']('UpdateOpenchannelInteraction',_0xa088cc,JSON[_0xf125('0x13')](_0x221274));_0x3234b9(_0x221274);})[_0xf125('0x18')](function(_0x4f19d8){logger[_0xf125('0x14')](_0xf125('0x19'),_0x4f19d8[_0xf125('0x16')],_0xa088cc);_0x2e14be(_0x4e8c8d[_0xf125('0x14')](0x1f4,_0x4f19d8['message']));});});};exports[_0xf125('0x20')]=function(_0x553f73){return new Promise(function(_0x503172,_0x2895b6){return db['OpenchannelInteraction']['find']({'where':_0x553f73[_0xf125('0x1c')]?_0x553f73[_0xf125('0x1c')][_0xf125('0x1e')]||null:null})[_0xf125('0xe')](function(_0x137f95){if(_0x137f95){return _0x137f95[_0xf125('0x21')](_0x553f73[_0xf125('0x22')][_0xf125('0x23')],_['omit'](_0x553f73[_0xf125('0x22')],[_0xf125('0x23'),'id'])||{});}})[_0xf125('0x24')](function(_0xb5913d){logger['info'](_0xf125('0x25'),_0x553f73);logger[_0xf125('0x26')](_0xf125('0x25'),_0x553f73,JSON[_0xf125('0x13')](_0xb5913d));_0x503172(_0xb5913d);})['catch'](function(_0x224be2){logger['error']('AddTags',_0x224be2['message'],_0x553f73);_0x2895b6(_this[_0xf125('0x14')](0x1f4,_0x224be2['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 41da997..5541aa5 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 _0x22cc=['./openchannelInteraction.events','save','remove','update','emit','removeListener','register','openchannelInteraction:'];(function(_0xa60623,_0x2d4e4f){var _0x4a6487=function(_0xba6cbe){while(--_0xba6cbe){_0xa60623['push'](_0xa60623['shift']());}};_0x4a6487(++_0x2d4e4f);}(_0x22cc,0x90));var _0xc22c=function(_0x38b14f,_0xd08fa8){_0x38b14f=_0x38b14f-0x0;var _0x22a324=_0x22cc[_0x38b14f];return _0x22a324;};'use strict';var OpenchannelInteractionEvents=require(_0xc22c('0x0'));var events=[_0xc22c('0x1'),_0xc22c('0x2'),_0xc22c('0x3')];function createListener(_0x6b87e8,_0x40c0bd){return function(_0x2d7ea1){_0x40c0bd[_0xc22c('0x4')](_0x6b87e8,_0x2d7ea1);};}function removeListener(_0x19e8e4,_0x11b524){return function(){OpenchannelInteractionEvents[_0xc22c('0x5')](_0x19e8e4,_0x11b524);};}exports[_0xc22c('0x6')]=function(_0x3c8ebd){for(var _0x4d5695=0x0,_0x4226f8=events['length'];_0x4d5695<_0x4226f8;_0x4d5695++){var _0x5185e0=events[_0x4d5695];var _0x300060=createListener(_0xc22c('0x7')+_0x5185e0,_0x3c8ebd);OpenchannelInteractionEvents['on'](_0x5185e0,_0x300060);}}; \ No newline at end of file +var _0x6c30=['openchannelInteraction:','./openchannelInteraction.events','save','remove','update'];(function(_0x29bc8c,_0x52c6ed){var _0x2530c2=function(_0x3d07e4){while(--_0x3d07e4){_0x29bc8c['push'](_0x29bc8c['shift']());}};_0x2530c2(++_0x52c6ed);}(_0x6c30,0x92));var _0x06c3=function(_0x5e238b,_0x17ae49){_0x5e238b=_0x5e238b-0x0;var _0x389bea=_0x6c30[_0x5e238b];return _0x389bea;};'use strict';var OpenchannelInteractionEvents=require(_0x06c3('0x0'));var events=[_0x06c3('0x1'),_0x06c3('0x2'),_0x06c3('0x3')];function createListener(_0x282e69,_0x10b0ae){return function(_0x4cbd69){_0x10b0ae['emit'](_0x282e69,_0x4cbd69);};}function removeListener(_0x591911,_0x5b2211){return function(){OpenchannelInteractionEvents['removeListener'](_0x591911,_0x5b2211);};}exports['register']=function(_0x2ce9b8){for(var _0xe738e=0x0,_0x50a05d=events['length'];_0xe738e<_0x50a05d;_0xe738e++){var _0x196cf3=events[_0xe738e];var _0x33d828=createListener(_0x06c3('0x4')+_0x196cf3,_0x2ce9b8);OpenchannelInteractionEvents['on'](_0x196cf3,_0x33d828);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 8b96f80..6fe60ad 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 _0x9c44=['index','get','/describe','/:id','show','tracked','openchannel','create','put','update','accept','/:id/reject','reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./openchannelMessage.controller','isAuthenticated'];(function(_0x2096b2,_0x53c8bd){var _0x540b16=function(_0x4f7d38){while(--_0x4f7d38){_0x2096b2['push'](_0x2096b2['shift']());}};_0x540b16(++_0x53c8bd);}(_0x9c44,0x178));var _0x49c4=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x9c44[_0x3b0731];return _0x4204d7;};'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'),auth[_0x49c4('0x7')](),controller['describe']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x49c4('0xd')](_0x49c4('0xe'),'openchannelmessage:create'),controller[_0x49c4('0xf')]);router[_0x49c4('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x49c4('0x11')]);router[_0x49c4('0x10')]('/:id/accept',auth[_0x49c4('0x7')](),controller[_0x49c4('0x12')]);router['put'](_0x49c4('0x13'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);router[_0x49c4('0x15')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x16')]);module[_0x49c4('0x17')]=router; \ No newline at end of file +var _0x9c44=['index','get','/describe','/:id','show','tracked','openchannel','create','put','update','accept','/:id/reject','reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./openchannelMessage.controller','isAuthenticated'];(function(_0x15f236,_0x59a12b){var _0x3645c0=function(_0x574879){while(--_0x574879){_0x15f236['push'](_0x15f236['shift']());}};_0x3645c0(++_0x59a12b);}(_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');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['describe']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x49c4('0xd')](_0x49c4('0xe'),'openchannelmessage:create'),controller[_0x49c4('0xf')]);router[_0x49c4('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x49c4('0x11')]);router[_0x49c4('0x10')]('/:id/accept',auth[_0x49c4('0x7')](),controller[_0x49c4('0x12')]);router['put'](_0x49c4('0x13'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);router[_0x49c4('0x15')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x16')]);module[_0x49c4('0x17')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 58c4fa9..06ff0ac 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 _0xb574=['medium','BOOLEAN','ENUM','out','DATE','STRING','sequelize','exports'];(function(_0x2c3bfa,_0x25c738){var _0x7fbc67=function(_0x5b84cd){while(--_0x5b84cd){_0x2c3bfa['push'](_0x2c3bfa['shift']());}};_0x7fbc67(++_0x25c738);}(_0xb574,0x106));var _0x4b57=function(_0x1aec93,_0xb3b977){_0x1aec93=_0x1aec93-0x0;var _0x3f234f=_0xb574[_0x1aec93];return _0x3f234f;};'use strict';var Sequelize=require(_0x4b57('0x0'));module[_0x4b57('0x1')]={'body':{'type':Sequelize['TEXT'](_0x4b57('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x4b57('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x4b57('0x4')]('in',_0x4b57('0x5')),'defaultValue':_0x4b57('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x4b57('0x6')]},'providerName':{'type':Sequelize[_0x4b57('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x174b=['medium','BOOLEAN','ENUM','out','TEXT','sequelize'];(function(_0x14b163,_0x396656){var _0x56fe42=function(_0x285daa){while(--_0x285daa){_0x14b163['push'](_0x14b163['shift']());}};_0x56fe42(++_0x396656);}(_0x174b,0x19d));var _0xb174=function(_0x4b777d,_0x30f48d){_0x4b777d=_0x4b777d-0x0;var _0x516302=_0x174b[_0x4b777d];return _0x516302;};'use strict';var Sequelize=require(_0xb174('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0xb174('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xb174('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0xb174('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xb174('0x3')]('in',_0xb174('0x4')),'defaultValue':_0xb174('0x4'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xb174('0x5')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index cdcb8db..bfdd483 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 _0xc87d=['query','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','where','type','VIRTUAL','options','OpenchannelMessage','includeAll','include','findAll','rows','show','params','length','create','body','find','describe','../../config/logger','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','OpenchannelInteractionId','isNil','read1stAt','user','role','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','User','email','internal','manual','interface','SIP/%s','channel','event','accept','EventManager','acceptmessage','openchannel-interactions','openchannel','OpenchannelInteraction','RejectMessage','rejectMessage','sequelize','fullname','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelMessage.socket','jayson/promise','client','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','stack','name','map','rawAttributes','fieldName','key','keys','filters','intersection','model'];(function(_0x5cbee4,_0xd8172e){var _0x28ee85=function(_0x53de5f){while(--_0x53de5f){_0x5cbee4['push'](_0x5cbee4['shift']());}};_0x28ee85(++_0xd8172e);}(_0xc87d,0xc0));var _0xdc87=function(_0x2dbe9a,_0x1c8e18){_0x2dbe9a=_0x2dbe9a-0x0;var _0x1da014=_0xc87d[_0x2dbe9a];return _0x1da014;};'use strict';var emlformat=require(_0xdc87('0x0'));var rimraf=require(_0xdc87('0x1'));var zipdir=require(_0xdc87('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdc87('0x3'));var moment=require('moment');var BPromise=require(_0xdc87('0x4'));var Mustache=require('mustache');var util=require(_0xdc87('0x5'));var path=require(_0xdc87('0x6'));var sox=require(_0xdc87('0x7'));var csv=require(_0xdc87('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdc87('0x9'));var squel=require(_0xdc87('0xa'));var crypto=require(_0xdc87('0xb'));var jsforce=require(_0xdc87('0xc'));var deskjs=require(_0xdc87('0xd'));var toCsv=require(_0xdc87('0x8'));var querystring=require(_0xdc87('0xe'));var Papa=require(_0xdc87('0xf'));var Redis=require(_0xdc87('0x10'));var authService=require(_0xdc87('0x11'));var qs=require(_0xdc87('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xdc87('0x13'));var config=require(_0xdc87('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xdc87('0x15'))['db'];config[_0xdc87('0x16')]=_['defaults'](config[_0xdc87('0x16')],{'host':_0xdc87('0x17'),'port':0x18eb});var socket=require(_0xdc87('0x18'))(new Redis(config['redis']));require(_0xdc87('0x19'))['register'](socket);var jayson=require(_0xdc87('0x1a'));var client=jayson[_0xdc87('0x1b')][_0xdc87('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0xdc87('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x117ab4,_0x55ff2c,_0x4b6dac,_0x4651cb){return new BPromise(function(_0x31d758,_0x1afd9c){var _0x496ce1=_0x4651cb||client;return _0x496ce1[_0xdc87('0x1d')](_0x117ab4,_0x4b6dac)[_0xdc87('0x1e')](function(_0x2c71f1){logger[_0xdc87('0x1f')](_0xdc87('0x20'),_0x55ff2c,_0xdc87('0x21'));logger['debug'](_0xdc87('0x22'),_0x55ff2c,_0xdc87('0x21'),JSON[_0xdc87('0x23')](_0x2c71f1));if(_0x2c71f1['error']){if(_0x2c71f1['error']['code']===0x1f4){logger[_0xdc87('0x24')](_0xdc87('0x20'),_0x55ff2c,_0x2c71f1[_0xdc87('0x24')]['message']);return _0x1afd9c(_0x2c71f1[_0xdc87('0x24')]['message']);}logger[_0xdc87('0x24')](_0xdc87('0x20'),_0x55ff2c,_0x2c71f1[_0xdc87('0x24')][_0xdc87('0x25')]);return _0x31d758(_0x2c71f1[_0xdc87('0x24')][_0xdc87('0x25')]);}else{logger['info'](_0xdc87('0x20'),_0x55ff2c,'request\x20sent');_0x31d758(_0x2c71f1[_0xdc87('0x26')][_0xdc87('0x25')]);}})[_0xdc87('0x27')](function(_0x4e94e0){logger[_0xdc87('0x24')](_0xdc87('0x20'),_0x55ff2c,_0x4e94e0);_0x1afd9c(_0x4e94e0);});});}function respondWithStatusCode(_0x2a6aae,_0x1ec0e0){_0x1ec0e0=_0x1ec0e0||0xcc;return function(_0x12aa83){if(_0x12aa83){return _0x2a6aae[_0xdc87('0x28')](_0x1ec0e0);}return _0x2a6aae[_0xdc87('0x29')](_0x1ec0e0)[_0xdc87('0x2a')]();};}function respondWithResult(_0x4f8740,_0x4ab14d){_0x4ab14d=_0x4ab14d||0xc8;return function(_0x585049){if(_0x585049){return _0x4f8740['status'](_0x4ab14d)[_0xdc87('0x2b')](_0x585049);}};}function respondWithFilteredResult(_0x46c0b8,_0x4719bc){return function(_0x5e82f3){if(_0x5e82f3){var _0x4a6455=typeof _0x4719bc[_0xdc87('0x2c')]===_0xdc87('0x2d')&&typeof _0x4719bc[_0xdc87('0x2e')]===_0xdc87('0x2d');var _0x455788=_0x5e82f3[_0xdc87('0x2f')];var _0x2e359e=_0x4a6455?0x0:_0x4719bc['offset'];var _0x17378a=_0x4a6455?_0x5e82f3[_0xdc87('0x2f')]:_0x4719bc[_0xdc87('0x2c')]+_0x4719bc[_0xdc87('0x2e')];var _0x2ddc02;if(_0x17378a>=_0x455788){_0x17378a=_0x455788;_0x2ddc02=0xc8;}else{_0x2ddc02=0xce;}_0x46c0b8['status'](_0x2ddc02);return _0x46c0b8[_0xdc87('0x30')]('Content-Range',_0x2e359e+'-'+_0x17378a+'/'+_0x455788)['json'](_0x5e82f3);}return null;};}function patchUpdates(_0x3e4b3a){return function(_0x205375){try{jsonpatch[_0xdc87('0x31')](_0x205375,_0x3e4b3a,!![]);}catch(_0x1efd66){return BPromise[_0xdc87('0x32')](_0x1efd66);}return _0x205375[_0xdc87('0x33')]();};}function saveUpdates(_0x1262df,_0x1346aa){return function(_0x450170){if(_0x450170){return _0x450170[_0xdc87('0x34')](_0x1262df)['then'](function(_0xcb82f3){return _0xcb82f3;});}return null;};}function removeEntity(_0x25a6de,_0x5aad43){return function(_0x16f78a){if(_0x16f78a){return _0x16f78a[_0xdc87('0x35')]()[_0xdc87('0x1e')](function(){_0x25a6de[_0xdc87('0x29')](0xcc)[_0xdc87('0x2a')]();});}};}function handleEntityNotFound(_0x7e7271,_0x1d78ed){return function(_0x30892b){if(!_0x30892b){_0x7e7271[_0xdc87('0x28')](0x194);}return _0x30892b;};}function handleError(_0x19da3b,_0x49cab2){_0x49cab2=_0x49cab2||0x1f4;return function(_0x595e35){logger[_0xdc87('0x24')](_0x595e35[_0xdc87('0x36')]);if(_0x595e35['name']){delete _0x595e35[_0xdc87('0x37')];}_0x19da3b[_0xdc87('0x29')](_0x49cab2)['send'](_0x595e35);};}exports['index']=function(_0x109d7d,_0x268783){var _0x42043e={},_0x4b6f20={},_0x1f6d6b={'count':0x0,'rows':[]};var _0x461c48=_[_0xdc87('0x38')](db['OpenchannelMessage'][_0xdc87('0x39')],function(_0x29333c){return{'name':_0x29333c[_0xdc87('0x3a')],'type':_0x29333c['type'][_0xdc87('0x3b')]};});_0x4b6f20['model']=_['map'](_0x461c48,'name');_0x4b6f20['query']=_[_0xdc87('0x3c')](_0x109d7d['query']);_0x4b6f20[_0xdc87('0x3d')]=_[_0xdc87('0x3e')](_0x4b6f20[_0xdc87('0x3f')],_0x4b6f20[_0xdc87('0x40')]);_0x42043e[_0xdc87('0x41')]=_['intersection'](_0x4b6f20[_0xdc87('0x3f')],qs[_0xdc87('0x42')](_0x109d7d[_0xdc87('0x40')][_0xdc87('0x42')]));_0x42043e[_0xdc87('0x41')]=_0x42043e[_0xdc87('0x41')]['length']?_0x42043e['attributes']:_0x4b6f20[_0xdc87('0x3f')];if(!_0x109d7d[_0xdc87('0x40')][_0xdc87('0x43')](_0xdc87('0x44'))){_0x42043e[_0xdc87('0x2e')]=qs[_0xdc87('0x2e')](_0x109d7d[_0xdc87('0x40')][_0xdc87('0x2e')]);_0x42043e[_0xdc87('0x2c')]=qs[_0xdc87('0x2c')](_0x109d7d[_0xdc87('0x40')]['offset']);}_0x42043e['order']=qs[_0xdc87('0x45')](_0x109d7d['query'][_0xdc87('0x45')]);_0x42043e['where']=qs[_0xdc87('0x3d')](_[_0xdc87('0x46')](_0x109d7d[_0xdc87('0x40')],_0x4b6f20[_0xdc87('0x3d')]),_0x461c48);if(_0x109d7d['query'][_0xdc87('0x47')]){_0x42043e[_0xdc87('0x48')]=_['merge'](_0x42043e['where'],{'$or':_[_0xdc87('0x38')](_0x461c48,function(_0x4c70ec){if(_0x4c70ec[_0xdc87('0x49')]!==_0xdc87('0x4a')){var _0x12dfc6={};_0x12dfc6[_0x4c70ec[_0xdc87('0x37')]]={'$like':'%'+_0x109d7d[_0xdc87('0x40')][_0xdc87('0x47')]+'%'};return _0x12dfc6;}})});}_0x42043e=_['merge']({},_0x42043e,_0x109d7d[_0xdc87('0x4b')]);var _0x3b02e6={'where':_0x42043e[_0xdc87('0x48')]};return db[_0xdc87('0x4c')][_0xdc87('0x2f')](_0x3b02e6)[_0xdc87('0x1e')](function(_0x55c456){_0x1f6d6b[_0xdc87('0x2f')]=_0x55c456;if(_0x109d7d[_0xdc87('0x40')][_0xdc87('0x4d')]){_0x42043e[_0xdc87('0x4e')]=[{'all':!![]}];}return db[_0xdc87('0x4c')][_0xdc87('0x4f')](_0x42043e);})[_0xdc87('0x1e')](function(_0x1c1426){_0x1f6d6b[_0xdc87('0x50')]=_0x1c1426;return _0x1f6d6b;})['then'](respondWithFilteredResult(_0x268783,_0x42043e))[_0xdc87('0x27')](handleError(_0x268783,null));};exports[_0xdc87('0x51')]=function(_0x393848,_0x3aba78){var _0x3378f1={'raw':!![],'where':{'id':_0x393848[_0xdc87('0x52')]['id']}},_0x14a885={};_0x14a885[_0xdc87('0x3f')]=_[_0xdc87('0x3c')](db[_0xdc87('0x4c')][_0xdc87('0x39')]);_0x14a885[_0xdc87('0x40')]=_[_0xdc87('0x3c')](_0x393848[_0xdc87('0x40')]);_0x14a885['filters']=_[_0xdc87('0x3e')](_0x14a885[_0xdc87('0x3f')],_0x14a885[_0xdc87('0x40')]);_0x3378f1[_0xdc87('0x41')]=_[_0xdc87('0x3e')](_0x14a885['model'],qs['fields'](_0x393848[_0xdc87('0x40')][_0xdc87('0x42')]));_0x3378f1[_0xdc87('0x41')]=_0x3378f1['attributes'][_0xdc87('0x53')]?_0x3378f1[_0xdc87('0x41')]:_0x14a885[_0xdc87('0x3f')];if(_0x393848['query']['includeAll']){_0x3378f1[_0xdc87('0x4e')]=[{'all':!![]}];}_0x3378f1=_['merge']({},_0x3378f1,_0x393848[_0xdc87('0x4b')]);return db[_0xdc87('0x4c')]['find'](_0x3378f1)[_0xdc87('0x1e')](handleEntityNotFound(_0x3aba78,null))[_0xdc87('0x1e')](respondWithResult(_0x3aba78,null))['catch'](handleError(_0x3aba78,null));};exports[_0xdc87('0x54')]=function(_0x4cd8c3,_0x2f934f){return db[_0xdc87('0x4c')]['create'](_0x4cd8c3[_0xdc87('0x55')],{})[_0xdc87('0x1e')](respondWithResult(_0x2f934f,0xc9))[_0xdc87('0x27')](handleError(_0x2f934f,null));};exports[_0xdc87('0x34')]=function(_0x4e550b,_0x12609c){if(_0x4e550b[_0xdc87('0x55')]['id']){delete _0x4e550b[_0xdc87('0x55')]['id'];}return db[_0xdc87('0x4c')][_0xdc87('0x56')]({'where':{'id':_0x4e550b[_0xdc87('0x52')]['id']}})[_0xdc87('0x1e')](handleEntityNotFound(_0x12609c,null))[_0xdc87('0x1e')](saveUpdates(_0x4e550b[_0xdc87('0x55')],null))[_0xdc87('0x1e')](respondWithResult(_0x12609c,null))['catch'](handleError(_0x12609c,null));};exports[_0xdc87('0x35')]=function(_0x30f26d,_0x387c4e){return db[_0xdc87('0x4c')]['find']({'where':{'id':_0x30f26d[_0xdc87('0x52')]['id']}})['then'](handleEntityNotFound(_0x387c4e,null))[_0xdc87('0x1e')](removeEntity(_0x387c4e,null))[_0xdc87('0x27')](handleError(_0x387c4e,null));};exports[_0xdc87('0x57')]=function(_0x4504f3,_0x2c25ca){return db[_0xdc87('0x4c')][_0xdc87('0x57')]()[_0xdc87('0x1e')](respondWithResult(_0x2c25ca,null))['catch'](handleError(_0x2c25ca,null));};var interaction_log=require(_0xdc87('0x58'))('openchannel-interactions');exports['accept']=function(_0x2224ec,_0xf6ed7,_0x1f81b7){var _0x5c17fd={'agent':{},'channel':'openchannel'};if(_0x2224ec[_0xdc87('0x55')]['id']){delete _0x2224ec[_0xdc87('0x55')]['id'];}_0x2224ec[_0xdc87('0x55')]['read']=!![];_0x2224ec['body'][_0xdc87('0x59')]=moment()[_0xdc87('0x5a')](_0xdc87('0x5b'));_0x2224ec[_0xdc87('0x55')]['UserId']=_0x2224ec[_0xdc87('0x55')][_0xdc87('0x5c')]||_0x2224ec['user']['id'];_0x5c17fd[_0xdc87('0x5d')]['id']=_0x2224ec[_0xdc87('0x55')][_0xdc87('0x5c')];return db[_0xdc87('0x4c')]['find']({'where':{'id':_0x2224ec[_0xdc87('0x52')]['id'],'UserId':null}})[_0xdc87('0x1e')](handleEntityNotFound(_0xf6ed7,null))[_0xdc87('0x1e')](saveUpdates(_0x2224ec[_0xdc87('0x55')],null))[_0xdc87('0x1e')](function(_0xc12e83){if(_0xc12e83){_0x5c17fd[_0xdc87('0x25')]=_0xc12e83[_0xdc87('0x5e')]({'plain':!![]});return db['OpenchannelInteraction'][_0xdc87('0x56')]({'where':{'id':_0xc12e83[_0xdc87('0x5f')]}});}return null;})[_0xdc87('0x1e')](handleEntityNotFound(_0xf6ed7,null))[_0xdc87('0x1e')](function(_0x78e6e6){if(_0x78e6e6){return _0x78e6e6[_0xdc87('0x34')]({'UserId':_0x2224ec[_0xdc87('0x55')][_0xdc87('0x5c')],'read1stAt':_[_0xdc87('0x60')](_0x78e6e6[_0xdc87('0x61')])?moment()[_0xdc87('0x5a')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x371ac8){if(_0x371ac8){_0x5c17fd['interaction']=_0x371ac8['get']({'plain':!![]});interaction_log['info']('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2224ec['user']['id'],_0x2224ec['user'][_0xdc87('0x37')],_0x2224ec[_0xdc87('0x62')][_0xdc87('0x63')],_0x5c17fd[_0xdc87('0x64')]['id'],_0x2224ec[_0xdc87('0x55')]?JSON[_0xdc87('0x23')](_0x2224ec[_0xdc87('0x55')]):_0xdc87('0x65'));return respondWithRpcPromise(_0xdc87('0x66'),_0xdc87('0x67'),_0x5c17fd);}return null;})['then'](function(_0x6c4519){var _0x406781=_0xdc87('0x68')+_0x6c4519[_0xdc87('0x25')][_0xdc87('0x69')];return db['sequelize']['query'](_0x406781,{'type':db[_0xdc87('0x6a')][_0xdc87('0x6b')][_0xdc87('0x6c')],'raw':!![]})[_0xdc87('0x1e')](function(_0x16100b){return _0x16100b;});})[_0xdc87('0x1e')](function(_0x3c6889){if(_0x3c6889){_0x5c17fd[_0xdc87('0x25')][_0xdc87('0x6d')]=_0x3c6889[0x0];if(!_0x2224ec[_0xdc87('0x55')][_0xdc87('0x5c')])return;return db[_0xdc87('0x6e')][_0xdc87('0x56')]({'where':{'id':_0x2224ec[_0xdc87('0x55')][_0xdc87('0x5c')],'role':_0xdc87('0x5d')},'attributes':['id',_0xdc87('0x37'),'fullname',_0xdc87('0x6f'),_0xdc87('0x70')],'raw':!![]});}return null;})[_0xdc87('0x1e')](function(_0x2e6a2f){if(!_0x2e6a2f)return null;_0x5c17fd['message']['agent']=_0x2e6a2f;return _0x5c17fd;})['then'](function(_0x47fc52){if(_0x47fc52){if(_0x2224ec[_0xdc87('0x55')][_0xdc87('0x71')]){_0x5c17fd['message'][_0xdc87('0x72')]=util[_0xdc87('0x5a')](_0xdc87('0x73'),_0x2224ec[_0xdc87('0x62')][_0xdc87('0x37')]);_0x5c17fd[_0xdc87('0x25')]['channel']=_0x5c17fd[_0xdc87('0x74')];_0x5c17fd['message'][_0xdc87('0x75')]=_0xdc87('0x76');return respondWithRpcPromise(_0xdc87('0x77'),_0xdc87('0x77'),{'event':_0xdc87('0x78'),'message':_0x5c17fd[_0xdc87('0x25')]},client9002)[_0xdc87('0x1e')](function(){return _0x5c17fd;});}return _0x5c17fd;}return null;})['then'](respondWithResult(_0xf6ed7,null))[_0xdc87('0x27')](handleError(_0xf6ed7,null));};var interaction_log=require('../../config/logger')(_0xdc87('0x79'));exports['reject']=function(_0xc4416e,_0x3c5b56,_0x219130){var _0xb94c83={'agent':{},'channel':_0xdc87('0x7a')};if(_0xc4416e[_0xdc87('0x55')]['id']){delete _0xc4416e[_0xdc87('0x55')]['id'];}_0xc4416e[_0xdc87('0x55')][_0xdc87('0x5c')]=_0xc4416e[_0xdc87('0x55')]['UserId']||_0xc4416e[_0xdc87('0x62')]['id'];_0xb94c83[_0xdc87('0x5d')]['id']=_0xc4416e[_0xdc87('0x55')][_0xdc87('0x5c')];return db[_0xdc87('0x4c')][_0xdc87('0x56')]({'where':{'id':_0xc4416e[_0xdc87('0x52')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3c5b56,null))[_0xdc87('0x1e')](function(_0x4b3f2b){if(_0x4b3f2b){_0xb94c83['message']=_0x4b3f2b[_0xdc87('0x5e')]({'plain':!![]});return db[_0xdc87('0x7b')]['find']({'where':{'id':_0x4b3f2b[_0xdc87('0x5f')]}});}return null;})[_0xdc87('0x1e')](handleEntityNotFound(_0x3c5b56,null))['then'](function(_0x118d8c){if(_0x118d8c){_0xb94c83[_0xdc87('0x64')]=_0x118d8c[_0xdc87('0x5e')]({'plain':!![]});interaction_log[_0xdc87('0x1f')]('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xc4416e['user']['id'],_0xc4416e[_0xdc87('0x62')][_0xdc87('0x37')],_0xc4416e[_0xdc87('0x62')][_0xdc87('0x63')],_0xb94c83[_0xdc87('0x64')]['id'],_0xc4416e[_0xdc87('0x55')]?JSON['stringify'](_0xc4416e['body']):_0xdc87('0x65'));return respondWithRpcPromise(_0xdc87('0x7c'),_0xdc87('0x7d'),_0xb94c83);}return null;})[_0xdc87('0x1e')](function(_0x3bf19b){var _0x140871=_0xdc87('0x68')+_0x3bf19b[_0xdc87('0x25')]['ContactId'];return db[_0xdc87('0x7e')][_0xdc87('0x40')](_0x140871,{'type':db[_0xdc87('0x6a')][_0xdc87('0x6b')][_0xdc87('0x6c')],'raw':!![]})[_0xdc87('0x1e')](function(_0x2836ac){return _0x2836ac;});})[_0xdc87('0x1e')](function(_0x4435bc){if(_0x4435bc){_0xb94c83['message'][_0xdc87('0x6d')]=_0x4435bc[0x0];if(!_0xc4416e[_0xdc87('0x55')]['UserId'])return;return db[_0xdc87('0x6e')][_0xdc87('0x56')]({'where':{'id':_0xc4416e[_0xdc87('0x55')][_0xdc87('0x5c')],'role':'agent'},'attributes':['id',_0xdc87('0x37'),_0xdc87('0x7f'),'email',_0xdc87('0x70')],'raw':!![]});}return null;})[_0xdc87('0x1e')](function(_0x5bacba){if(!_0x5bacba)return null;_0xb94c83[_0xdc87('0x25')]['agent']=_0x5bacba;return _0xb94c83;})['then'](function(_0x5f45ca){if(_0x5f45ca){_0x5f45ca[_0xdc87('0x25')]['interface']=util[_0xdc87('0x5a')](_0xdc87('0x73'),_0xc4416e[_0xdc87('0x62')][_0xdc87('0x37')]);_0x5f45ca[_0xdc87('0x25')][_0xdc87('0x74')]=_0xb94c83[_0xdc87('0x74')];_0x5f45ca[_0xdc87('0x25')][_0xdc87('0x75')]=_0xdc87('0x32');respondWithRpcPromise(_0xdc87('0x77'),'EventManager',{'event':'rejectmessage','message':_0x5f45ca[_0xdc87('0x25')]},client9002);return _0xb94c83;}return null;})[_0xdc87('0x1e')](respondWithResult(_0x3c5b56,null))[_0xdc87('0x27')](handleError(_0x3c5b56,null));}; \ No newline at end of file +var _0xf615=['rejectMessage','Sequelize','SELECT','User','internal','EventManager','rejectmessage','eml-format','rimraf','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','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','client','then','info','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','undefined','limit','offset','Content-Range','save','update','destroy','stack','name','send','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','OpenchannelMessage','count','includeAll','include','findAll','rows','params','length','options','create','find','describe','openchannel-interactions','openchannel','body','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','format','interaction','user','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','contact','fullname','email','interface','SIP/%s','channel','event','accept','acceptmessage','reject','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage'];(function(_0x3f9715,_0x431051){var _0x2d1e42=function(_0x5d85f8){while(--_0x5d85f8){_0x3f9715['push'](_0x3f9715['shift']());}};_0x2d1e42(++_0x431051);}(_0xf615,0x8d));var _0x5f61=function(_0xa76664,_0x5e32db){_0xa76664=_0xa76664-0x0;var _0x3f7743=_0xf615[_0xa76664];return _0x3f7743;};'use strict';var emlformat=require(_0x5f61('0x0'));var rimraf=require(_0x5f61('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5f61('0x2'));var moment=require(_0x5f61('0x3'));var BPromise=require(_0x5f61('0x4'));var Mustache=require(_0x5f61('0x5'));var util=require(_0x5f61('0x6'));var path=require(_0x5f61('0x7'));var sox=require(_0x5f61('0x8'));var csv=require(_0x5f61('0x9'));var ejs=require(_0x5f61('0xa'));var fs=require('fs');var fs_extra=require(_0x5f61('0xb'));var _=require(_0x5f61('0xc'));var squel=require(_0x5f61('0xd'));var crypto=require(_0x5f61('0xe'));var jsforce=require(_0x5f61('0xf'));var deskjs=require(_0x5f61('0x10'));var toCsv=require(_0x5f61('0x9'));var querystring=require(_0x5f61('0x11'));var Papa=require(_0x5f61('0x12'));var Redis=require(_0x5f61('0x13'));var authService=require(_0x5f61('0x14'));var qs=require(_0x5f61('0x15'));var as=require(_0x5f61('0x16'));var hardwareService=require(_0x5f61('0x17'));var logger=require(_0x5f61('0x18'))(_0x5f61('0x19'));var utils=require(_0x5f61('0x1a'));var config=require(_0x5f61('0x1b'));var licenseUtil=require(_0x5f61('0x1c'));var db=require(_0x5f61('0x1d'))['db'];config[_0x5f61('0x1e')]=_[_0x5f61('0x1f')](config['redis'],{'host':_0x5f61('0x20'),'port':0x18eb});var socket=require(_0x5f61('0x21'))(new Redis(config[_0x5f61('0x1e')]));require('./openchannelMessage.socket')[_0x5f61('0x22')](socket);var jayson=require('jayson/promise');var client=jayson[_0x5f61('0x23')]['http']({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x191227,_0x42e7d9,_0xdef949,_0x5668d0){return new BPromise(function(_0x435779,_0x22e440){var _0xb9969a=_0x5668d0||client;return _0xb9969a['request'](_0x191227,_0xdef949)[_0x5f61('0x24')](function(_0x3a0d94){logger[_0x5f61('0x25')]('OpenchannelMessage,\x20%s,\x20%s',_0x42e7d9,_0x5f61('0x26'));logger[_0x5f61('0x27')](_0x5f61('0x28'),_0x42e7d9,_0x5f61('0x26'),JSON[_0x5f61('0x29')](_0x3a0d94));if(_0x3a0d94[_0x5f61('0x2a')]){if(_0x3a0d94[_0x5f61('0x2a')][_0x5f61('0x2b')]===0x1f4){logger['error'](_0x5f61('0x2c'),_0x42e7d9,_0x3a0d94['error']['message']);return _0x22e440(_0x3a0d94[_0x5f61('0x2a')]['message']);}logger[_0x5f61('0x2a')](_0x5f61('0x2c'),_0x42e7d9,_0x3a0d94[_0x5f61('0x2a')][_0x5f61('0x2d')]);return _0x435779(_0x3a0d94[_0x5f61('0x2a')][_0x5f61('0x2d')]);}else{logger[_0x5f61('0x25')](_0x5f61('0x2c'),_0x42e7d9,_0x5f61('0x26'));_0x435779(_0x3a0d94['result'][_0x5f61('0x2d')]);}})[_0x5f61('0x2e')](function(_0x2581f0){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x42e7d9,_0x2581f0);_0x22e440(_0x2581f0);});});}function respondWithStatusCode(_0x19396b,_0x214cca){_0x214cca=_0x214cca||0xcc;return function(_0x2ad2a1){if(_0x2ad2a1){return _0x19396b[_0x5f61('0x2f')](_0x214cca);}return _0x19396b[_0x5f61('0x30')](_0x214cca)[_0x5f61('0x31')]();};}function respondWithResult(_0x1a4c00,_0x23c8d4){_0x23c8d4=_0x23c8d4||0xc8;return function(_0x15b0a3){if(_0x15b0a3){return _0x1a4c00[_0x5f61('0x30')](_0x23c8d4)[_0x5f61('0x32')](_0x15b0a3);}};}function respondWithFilteredResult(_0x553043,_0x42cc55){return function(_0x333bff){if(_0x333bff){var _0x179a9c=typeof _0x42cc55['offset']===_0x5f61('0x33')&&typeof _0x42cc55[_0x5f61('0x34')]===_0x5f61('0x33');var _0x411a64=_0x333bff['count'];var _0x815eee=_0x179a9c?0x0:_0x42cc55[_0x5f61('0x35')];var _0x4e18fe=_0x179a9c?_0x333bff['count']:_0x42cc55[_0x5f61('0x35')]+_0x42cc55[_0x5f61('0x34')];var _0x536376;if(_0x4e18fe>=_0x411a64){_0x4e18fe=_0x411a64;_0x536376=0xc8;}else{_0x536376=0xce;}_0x553043['status'](_0x536376);return _0x553043['set'](_0x5f61('0x36'),_0x815eee+'-'+_0x4e18fe+'/'+_0x411a64)['json'](_0x333bff);}return null;};}function patchUpdates(_0x45a73c){return function(_0x34040b){try{jsonpatch['apply'](_0x34040b,_0x45a73c,!![]);}catch(_0x503f12){return BPromise['reject'](_0x503f12);}return _0x34040b[_0x5f61('0x37')]();};}function saveUpdates(_0x3346f9,_0x351f8f){return function(_0x9c86ee){if(_0x9c86ee){return _0x9c86ee[_0x5f61('0x38')](_0x3346f9)[_0x5f61('0x24')](function(_0x2b3972){return _0x2b3972;});}return null;};}function removeEntity(_0x16f171,_0x49491e){return function(_0x1b20b1){if(_0x1b20b1){return _0x1b20b1[_0x5f61('0x39')]()['then'](function(){_0x16f171[_0x5f61('0x30')](0xcc)[_0x5f61('0x31')]();});}};}function handleEntityNotFound(_0x18b6a8,_0x423bcd){return function(_0x3c337f){if(!_0x3c337f){_0x18b6a8[_0x5f61('0x2f')](0x194);}return _0x3c337f;};}function handleError(_0x305e18,_0x36dc6b){_0x36dc6b=_0x36dc6b||0x1f4;return function(_0x281d0e){logger[_0x5f61('0x2a')](_0x281d0e[_0x5f61('0x3a')]);if(_0x281d0e[_0x5f61('0x3b')]){delete _0x281d0e[_0x5f61('0x3b')];}_0x305e18[_0x5f61('0x30')](_0x36dc6b)[_0x5f61('0x3c')](_0x281d0e);};}exports['index']=function(_0x125715,_0x52ad43){var _0x130dc3={},_0x5ea46f={},_0x550f61={'count':0x0,'rows':[]};var _0x1704f7=_[_0x5f61('0x3d')](db['OpenchannelMessage'][_0x5f61('0x3e')],function(_0x567d5f){return{'name':_0x567d5f[_0x5f61('0x3f')],'type':_0x567d5f['type'][_0x5f61('0x40')]};});_0x5ea46f[_0x5f61('0x41')]=_['map'](_0x1704f7,_0x5f61('0x3b'));_0x5ea46f[_0x5f61('0x42')]=_[_0x5f61('0x43')](_0x125715['query']);_0x5ea46f[_0x5f61('0x44')]=_[_0x5f61('0x45')](_0x5ea46f['model'],_0x5ea46f[_0x5f61('0x42')]);_0x130dc3[_0x5f61('0x46')]=_[_0x5f61('0x45')](_0x5ea46f[_0x5f61('0x41')],qs[_0x5f61('0x47')](_0x125715['query']['fields']));_0x130dc3[_0x5f61('0x46')]=_0x130dc3['attributes']['length']?_0x130dc3[_0x5f61('0x46')]:_0x5ea46f['model'];if(!_0x125715[_0x5f61('0x42')][_0x5f61('0x48')]('nolimit')){_0x130dc3[_0x5f61('0x34')]=qs[_0x5f61('0x34')](_0x125715['query'][_0x5f61('0x34')]);_0x130dc3['offset']=qs[_0x5f61('0x35')](_0x125715[_0x5f61('0x42')]['offset']);}_0x130dc3[_0x5f61('0x49')]=qs['sort'](_0x125715['query'][_0x5f61('0x4a')]);_0x130dc3[_0x5f61('0x4b')]=qs[_0x5f61('0x44')](_[_0x5f61('0x4c')](_0x125715[_0x5f61('0x42')],_0x5ea46f[_0x5f61('0x44')]),_0x1704f7);if(_0x125715[_0x5f61('0x42')][_0x5f61('0x4d')]){_0x130dc3[_0x5f61('0x4b')]=_[_0x5f61('0x4e')](_0x130dc3['where'],{'$or':_[_0x5f61('0x3d')](_0x1704f7,function(_0x240e39){if(_0x240e39['type']!==_0x5f61('0x4f')){var _0x58c0a4={};_0x58c0a4[_0x240e39[_0x5f61('0x3b')]]={'$like':'%'+_0x125715[_0x5f61('0x42')][_0x5f61('0x4d')]+'%'};return _0x58c0a4;}})});}_0x130dc3=_[_0x5f61('0x4e')]({},_0x130dc3,_0x125715['options']);var _0x58e038={'where':_0x130dc3[_0x5f61('0x4b')]};return db[_0x5f61('0x50')][_0x5f61('0x51')](_0x58e038)[_0x5f61('0x24')](function(_0x305b67){_0x550f61['count']=_0x305b67;if(_0x125715[_0x5f61('0x42')][_0x5f61('0x52')]){_0x130dc3[_0x5f61('0x53')]=[{'all':!![]}];}return db[_0x5f61('0x50')][_0x5f61('0x54')](_0x130dc3);})[_0x5f61('0x24')](function(_0x232068){_0x550f61[_0x5f61('0x55')]=_0x232068;return _0x550f61;})['then'](respondWithFilteredResult(_0x52ad43,_0x130dc3))[_0x5f61('0x2e')](handleError(_0x52ad43,null));};exports['show']=function(_0x6f400e,_0x592441){var _0x37ee1a={'raw':!![],'where':{'id':_0x6f400e[_0x5f61('0x56')]['id']}},_0x53b7e4={};_0x53b7e4[_0x5f61('0x41')]=_['keys'](db['OpenchannelMessage'][_0x5f61('0x3e')]);_0x53b7e4[_0x5f61('0x42')]=_[_0x5f61('0x43')](_0x6f400e[_0x5f61('0x42')]);_0x53b7e4[_0x5f61('0x44')]=_[_0x5f61('0x45')](_0x53b7e4[_0x5f61('0x41')],_0x53b7e4['query']);_0x37ee1a[_0x5f61('0x46')]=_[_0x5f61('0x45')](_0x53b7e4[_0x5f61('0x41')],qs[_0x5f61('0x47')](_0x6f400e[_0x5f61('0x42')][_0x5f61('0x47')]));_0x37ee1a['attributes']=_0x37ee1a['attributes'][_0x5f61('0x57')]?_0x37ee1a[_0x5f61('0x46')]:_0x53b7e4[_0x5f61('0x41')];if(_0x6f400e['query'][_0x5f61('0x52')]){_0x37ee1a[_0x5f61('0x53')]=[{'all':!![]}];}_0x37ee1a=_[_0x5f61('0x4e')]({},_0x37ee1a,_0x6f400e[_0x5f61('0x58')]);return db[_0x5f61('0x50')]['find'](_0x37ee1a)['then'](handleEntityNotFound(_0x592441,null))[_0x5f61('0x24')](respondWithResult(_0x592441,null))['catch'](handleError(_0x592441,null));};exports['create']=function(_0x15ccc2,_0x50ce34){return db[_0x5f61('0x50')][_0x5f61('0x59')](_0x15ccc2['body'],{})[_0x5f61('0x24')](respondWithResult(_0x50ce34,0xc9))['catch'](handleError(_0x50ce34,null));};exports[_0x5f61('0x38')]=function(_0x11126d,_0x5dd61f){if(_0x11126d['body']['id']){delete _0x11126d['body']['id'];}return db[_0x5f61('0x50')][_0x5f61('0x5a')]({'where':{'id':_0x11126d['params']['id']}})[_0x5f61('0x24')](handleEntityNotFound(_0x5dd61f,null))['then'](saveUpdates(_0x11126d['body'],null))[_0x5f61('0x24')](respondWithResult(_0x5dd61f,null))[_0x5f61('0x2e')](handleError(_0x5dd61f,null));};exports[_0x5f61('0x39')]=function(_0x346f7a,_0x2b32f8){return db['OpenchannelMessage'][_0x5f61('0x5a')]({'where':{'id':_0x346f7a['params']['id']}})[_0x5f61('0x24')](handleEntityNotFound(_0x2b32f8,null))[_0x5f61('0x24')](removeEntity(_0x2b32f8,null))['catch'](handleError(_0x2b32f8,null));};exports['describe']=function(_0x44fd29,_0x418bc2){return db[_0x5f61('0x50')][_0x5f61('0x5b')]()['then'](respondWithResult(_0x418bc2,null))['catch'](handleError(_0x418bc2,null));};var interaction_log=require(_0x5f61('0x18'))(_0x5f61('0x5c'));exports['accept']=function(_0x479325,_0x42166d,_0x6db145){var _0x5ed737={'agent':{},'channel':_0x5f61('0x5d')};if(_0x479325[_0x5f61('0x5e')]['id']){delete _0x479325['body']['id'];}_0x479325[_0x5f61('0x5e')][_0x5f61('0x5f')]=!![];_0x479325[_0x5f61('0x5e')][_0x5f61('0x60')]=moment()['format'](_0x5f61('0x61'));_0x479325[_0x5f61('0x5e')][_0x5f61('0x62')]=_0x479325[_0x5f61('0x5e')]['UserId']||_0x479325['user']['id'];_0x5ed737[_0x5f61('0x63')]['id']=_0x479325[_0x5f61('0x5e')][_0x5f61('0x62')];return db[_0x5f61('0x50')][_0x5f61('0x5a')]({'where':{'id':_0x479325['params']['id'],'UserId':null}})[_0x5f61('0x24')](handleEntityNotFound(_0x42166d,null))[_0x5f61('0x24')](saveUpdates(_0x479325['body'],null))[_0x5f61('0x24')](function(_0xa6f68f){if(_0xa6f68f){_0x5ed737[_0x5f61('0x2d')]=_0xa6f68f[_0x5f61('0x64')]({'plain':!![]});return db[_0x5f61('0x65')][_0x5f61('0x5a')]({'where':{'id':_0xa6f68f[_0x5f61('0x66')]}});}return null;})[_0x5f61('0x24')](handleEntityNotFound(_0x42166d,null))['then'](function(_0x407a0f){if(_0x407a0f){return _0x407a0f['update']({'UserId':_0x479325[_0x5f61('0x5e')]['UserId'],'read1stAt':_[_0x5f61('0x67')](_0x407a0f[_0x5f61('0x68')])?moment()[_0x5f61('0x69')](_0x5f61('0x61')):undefined});}return null;})[_0x5f61('0x24')](function(_0x202fad){if(_0x202fad){_0x5ed737[_0x5f61('0x6a')]=_0x202fad[_0x5f61('0x64')]({'plain':!![]});interaction_log[_0x5f61('0x25')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x479325[_0x5f61('0x6b')]['id'],_0x479325[_0x5f61('0x6b')][_0x5f61('0x3b')],_0x479325[_0x5f61('0x6b')][_0x5f61('0x6c')],_0x5ed737[_0x5f61('0x6a')]['id'],_0x479325['body']?JSON[_0x5f61('0x29')](_0x479325[_0x5f61('0x5e')]):'null');return respondWithRpcPromise(_0x5f61('0x6d'),_0x5f61('0x6e'),_0x5ed737);}return null;})[_0x5f61('0x24')](function(_0x306d7a){var _0x498e44=_0x5f61('0x6f')+_0x306d7a[_0x5f61('0x2d')][_0x5f61('0x70')];return db[_0x5f61('0x71')][_0x5f61('0x42')](_0x498e44,{'type':db['Sequelize'][_0x5f61('0x72')]['SELECT'],'raw':!![]})[_0x5f61('0x24')](function(_0x18a72f){return _0x18a72f;});})[_0x5f61('0x24')](function(_0x20ac13){if(_0x20ac13){_0x5ed737[_0x5f61('0x2d')][_0x5f61('0x73')]=_0x20ac13[0x0];if(!_0x479325[_0x5f61('0x5e')]['UserId'])return;return db['User'][_0x5f61('0x5a')]({'where':{'id':_0x479325['body'][_0x5f61('0x62')],'role':'agent'},'attributes':['id',_0x5f61('0x3b'),_0x5f61('0x74'),_0x5f61('0x75'),'internal'],'raw':!![]});}return null;})[_0x5f61('0x24')](function(_0x19a68d){if(!_0x19a68d)return null;_0x5ed737[_0x5f61('0x2d')][_0x5f61('0x63')]=_0x19a68d;return _0x5ed737;})[_0x5f61('0x24')](function(_0x3a20a4){if(_0x3a20a4){if(_0x479325[_0x5f61('0x5e')]['manual']){_0x5ed737[_0x5f61('0x2d')][_0x5f61('0x76')]=util['format'](_0x5f61('0x77'),_0x479325[_0x5f61('0x6b')][_0x5f61('0x3b')]);_0x5ed737[_0x5f61('0x2d')][_0x5f61('0x78')]=_0x5ed737[_0x5f61('0x78')];_0x5ed737[_0x5f61('0x2d')][_0x5f61('0x79')]=_0x5f61('0x7a');return respondWithRpcPromise('EventManager','EventManager',{'event':_0x5f61('0x7b'),'message':_0x5ed737[_0x5f61('0x2d')]},client9002)['then'](function(){return _0x5ed737;});}return _0x5ed737;}return null;})[_0x5f61('0x24')](respondWithResult(_0x42166d,null))['catch'](handleError(_0x42166d,null));};var interaction_log=require(_0x5f61('0x18'))(_0x5f61('0x5c'));exports[_0x5f61('0x7c')]=function(_0x16b49c,_0x568dd3,_0xcac2f8){var _0x430beb={'agent':{},'channel':_0x5f61('0x5d')};if(_0x16b49c[_0x5f61('0x5e')]['id']){delete _0x16b49c[_0x5f61('0x5e')]['id'];}_0x16b49c[_0x5f61('0x5e')][_0x5f61('0x62')]=_0x16b49c[_0x5f61('0x5e')][_0x5f61('0x62')]||_0x16b49c['user']['id'];_0x430beb[_0x5f61('0x63')]['id']=_0x16b49c['body'][_0x5f61('0x62')];return db[_0x5f61('0x50')][_0x5f61('0x5a')]({'where':{'id':_0x16b49c[_0x5f61('0x56')]['id'],'UserId':null}})[_0x5f61('0x24')](handleEntityNotFound(_0x568dd3,null))[_0x5f61('0x24')](function(_0x54317c){if(_0x54317c){_0x430beb[_0x5f61('0x2d')]=_0x54317c[_0x5f61('0x64')]({'plain':!![]});return db['OpenchannelInteraction'][_0x5f61('0x5a')]({'where':{'id':_0x54317c[_0x5f61('0x66')]}});}return null;})[_0x5f61('0x24')](handleEntityNotFound(_0x568dd3,null))['then'](function(_0x27bdc3){if(_0x27bdc3){_0x430beb[_0x5f61('0x6a')]=_0x27bdc3[_0x5f61('0x64')]({'plain':!![]});interaction_log[_0x5f61('0x25')](_0x5f61('0x7d'),_0x16b49c['user']['id'],_0x16b49c[_0x5f61('0x6b')][_0x5f61('0x3b')],_0x16b49c[_0x5f61('0x6b')]['role'],_0x430beb['interaction']['id'],_0x16b49c['body']?JSON[_0x5f61('0x29')](_0x16b49c[_0x5f61('0x5e')]):'null');return respondWithRpcPromise(_0x5f61('0x7e'),_0x5f61('0x7f'),_0x430beb);}return null;})[_0x5f61('0x24')](function(_0x3844fb){var _0x1249ed=_0x5f61('0x6f')+_0x3844fb[_0x5f61('0x2d')][_0x5f61('0x70')];return db[_0x5f61('0x71')][_0x5f61('0x42')](_0x1249ed,{'type':db[_0x5f61('0x80')][_0x5f61('0x72')][_0x5f61('0x81')],'raw':!![]})[_0x5f61('0x24')](function(_0x62e6e0){return _0x62e6e0;});})['then'](function(_0x454d14){if(_0x454d14){_0x430beb['message'][_0x5f61('0x73')]=_0x454d14[0x0];if(!_0x16b49c[_0x5f61('0x5e')]['UserId'])return;return db[_0x5f61('0x82')][_0x5f61('0x5a')]({'where':{'id':_0x16b49c[_0x5f61('0x5e')]['UserId'],'role':_0x5f61('0x63')},'attributes':['id',_0x5f61('0x3b'),_0x5f61('0x74'),'email',_0x5f61('0x83')],'raw':!![]});}return null;})['then'](function(_0x42639a){if(!_0x42639a)return null;_0x430beb[_0x5f61('0x2d')][_0x5f61('0x63')]=_0x42639a;return _0x430beb;})[_0x5f61('0x24')](function(_0x209d1a){if(_0x209d1a){_0x209d1a[_0x5f61('0x2d')]['interface']=util[_0x5f61('0x69')](_0x5f61('0x77'),_0x16b49c[_0x5f61('0x6b')][_0x5f61('0x3b')]);_0x209d1a[_0x5f61('0x2d')][_0x5f61('0x78')]=_0x430beb['channel'];_0x209d1a[_0x5f61('0x2d')][_0x5f61('0x79')]=_0x5f61('0x7c');respondWithRpcPromise('EventManager',_0x5f61('0x84'),{'event':_0x5f61('0x85'),'message':_0x209d1a[_0x5f61('0x2d')]},client9002);return _0x430beb;}return null;})[_0x5f61('0x24')](respondWithResult(_0x568dd3,null))[_0x5f61('0x2e')](handleError(_0x568dd3,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 29429bf..7cc1893 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 _0xde14=['emit','hook','exports','events','../../mysqldb','OpenchannelMessage'];(function(_0x4a82ac,_0x1fb931){var _0x58ee97=function(_0xc7050a){while(--_0xc7050a){_0x4a82ac['push'](_0x4a82ac['shift']());}};_0x58ee97(++_0x1fb931);}(_0xde14,0x123));var _0x4de1=function(_0x1e589a,_0x440156){_0x1e589a=_0x1e589a-0x0;var _0x471fdc=_0xde14[_0x1e589a];return _0x471fdc;};'use strict';var EventEmitter=require(_0x4de1('0x0'));var OpenchannelMessage=require(_0x4de1('0x1'))['db'][_0x4de1('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x333632){return function(_0x2e9c7c,_0x3d6fdb,_0x85c71e){OpenchannelMessageEvents[_0x4de1('0x3')](_0x333632+':'+_0x2e9c7c['id'],_0x2e9c7c);OpenchannelMessageEvents['emit'](_0x333632,_0x2e9c7c);_0x85c71e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0x4de1('0x4')](e,emitEvent(event));}}module[_0x4de1('0x5')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x1ef5=['setMaxListeners','save','emit','hasOwnProperty','exports','events','OpenchannelMessage'];(function(_0x317866,_0x8d4239){var _0x2ed175=function(_0x49b213){while(--_0x49b213){_0x317866['push'](_0x317866['shift']());}};_0x2ed175(++_0x8d4239);}(_0x1ef5,0x139));var _0x51ef=function(_0x4df6f1,_0x389f64){_0x4df6f1=_0x4df6f1-0x0;var _0x422ce6=_0x1ef5[_0x4df6f1];return _0x422ce6;};'use strict';var EventEmitter=require(_0x51ef('0x0'));var OpenchannelMessage=require('../../mysqldb')['db'][_0x51ef('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x51ef('0x2')](0x0);var events={'afterCreate':_0x51ef('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3216ea){return function(_0x5d8d73,_0x481415,_0x27f64e){OpenchannelMessageEvents[_0x51ef('0x4')](_0x3216ea+':'+_0x5d8d73['id'],_0x5d8d73);OpenchannelMessageEvents[_0x51ef('0x4')](_0x3216ea,_0x5d8d73);_0x27f64e(null);};}for(var e in events){if(events[_0x51ef('0x5')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x51ef('0x6')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index a450bc9..2fe48b7 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 _0x4213=['describe','OpenchannelAccount','find','OpenchannelAccountId','Interactions','CmContact','Contact','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','replyUri','length','Interaction','GET','threadId','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./openchannelMessage.attributes','exports','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','catch'];(function(_0x5c30bc,_0x26bba5){var _0x3c9c2c=function(_0x1ba310){while(--_0x1ba310){_0x5c30bc['push'](_0x5c30bc['shift']());}};_0x3c9c2c(++_0x26bba5);}(_0x4213,0x77));var _0x3421=function(_0x244780,_0x2e5ba4){_0x244780=_0x244780-0x0;var _0x53d247=_0x4213[_0x244780];return _0x53d247;};'use strict';var _=require(_0x3421('0x0'));var util=require(_0x3421('0x1'));var logger=require(_0x3421('0x2'))(_0x3421('0x3'));var moment=require(_0x3421('0x4'));var BPromise=require(_0x3421('0x5'));var rp=require(_0x3421('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3421('0x7'));var config=require('../../config/environment');var attributes=require(_0x3421('0x8'));module[_0x3421('0x9')]=function(_0x2155f8,_0x2a04e0){return _0x2155f8['define'](_0x3421('0xa'),attributes,{'tableName':_0x3421('0xb'),'paranoid':![],'indexes':[{'name':_0x3421('0xc'),'fields':[_0x3421('0xd')],'type':_0x3421('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4ddfce,_0x1f20cf,_0x58d511){var _0x4ff986=_0x2155f8[_0x3421('0xf')];var _0x4b9d24=_0x4ddfce[_0x3421('0x10')]({'plain':!![]});if(_0x4b9d24[_0x3421('0x11')][_0x3421('0x12')]()==='in'||_0x4b9d24[_0x3421('0x11')][_0x3421('0x12')]()===_0x3421('0x13')&&!_0x4b9d24[_0x3421('0x14')]&&!_['isNil'](_0x4b9d24[_0x3421('0x15')])){_0x4ff986[_0x3421('0x16')][_0x3421('0x17')]({'where':{'id':_0x4b9d24[_0x3421('0x18')]}})[_0x3421('0x19')](function(_0x3f4672){if(_0x3f4672){_0x3f4672[_0x3421('0x1a')]({'lastMsgAt':_0x4b9d24['createdAt'],'lastMsgDirection':_0x4b9d24[_0x3421('0x11')]['toLowerCase']()});}})[_0x3421('0x1b')](function(_0x5257ad){console['error'](_0x5257ad);});}if(_0x4b9d24[_0x3421('0x11')]==='out'&&!_0x4b9d24[_0x3421('0x14')]){var _0x23694b;_0x4ff986['CmContact'][_0x3421('0x1c')]()[_0x3421('0x19')](function(_0x130d3c){return _0x4ff986[_0x3421('0x1d')][_0x3421('0x1e')]({'where':{'id':_0x4b9d24[_0x3421('0x1f')]},'include':[{'model':_0x4ff986[_0x3421('0x16')],'as':_0x3421('0x20'),'where':{'id':_0x4b9d24[_0x3421('0x18')]},'limit':0x1,'include':[{'model':_0x4ff986[_0x3421('0x21')],'as':_0x3421('0x22'),'attributes':_['keys'](_0x130d3c)}]}]});})[_0x3421('0x19')](function(_0x4b59a5){_0x23694b=_0x4b59a5['get']({'plain':!![]});if(_0x23694b&&_0x23694b['replyUri']){logger[_0x3421('0x23')](_0x3421('0x24'),_0x3421('0x25'),util[_0x3421('0x26')](_0x3421('0x27'),_0x4b9d24['id'],_0x23694b[_0x3421('0x28')]));if(_0x23694b[_0x3421('0x20')]&&_0x23694b[_0x3421('0x20')][_0x3421('0x29')]){_0x4b9d24[_0x3421('0x2a')]=_['omit'](_0x23694b['Interactions'][0x0],'Contact');_0x4b9d24[_0x3421('0x22')]=_0x23694b[_0x3421('0x20')][0x0][_0x3421('0x22')];}var _0x1f20cf={'method':'POST','uri':encodeURI(_0x23694b[_0x3421('0x28')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x1f20cf['method']){case _0x3421('0x2b'):_0x1f20cf['qs']=_0x4b9d24;break;case'POST':_0x1f20cf[_0x3421('0xd')]=_0x4b9d24;break;}return rp(_0x1f20cf)[_0x3421('0x19')](function(_0x36d75f){logger[_0x3421('0x23')](_0x3421('0x24'),'afterCreate',util[_0x3421('0x26')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x4b9d24['id'],_0x23694b['replyUri']));if(_0x36d75f[_0x3421('0xd')]['threadId']&&_0x36d75f['body'][_0x3421('0x2c')]!=_0x4b9d24['Interaction'][_0x3421('0x2c')]){return _0x4ff986['OpenchannelInteraction'][_0x3421('0x1a')]({'threadId':_0x36d75f[_0x3421('0xd')]['threadId']},{'logging':!![],'where':{'id':_0x4b9d24[_0x3421('0x2a')]['id']}});}else{return;}})[_0x3421('0x19')](function(){return _0x4ddfce[_0x3421('0x1a')]({'read':!![]});})['catch'](function(_0x3a89b6){logger['error'](_0x3421('0x24'),_0x3421('0x25'),util[_0x3421('0x2d')](_0x3a89b6,{'showHidden':![],'depth':null}));_0x58d511();});}else{_0x58d511();}})[_0x3421('0x2e')](function(){_0x58d511();});}else{_0x58d511();}}},'charset':_0x3421('0x2f'),'collate':_0x3421('0x30')});}; \ No newline at end of file +var _0x0598=['util','api','request-promise','path','exports','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','models','toLowerCase','direction','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','createdAt','catch','secret','CmContact','describe','then','OpenchannelAccount','find','OpenchannelAccountId','Contact','get','replyUri','info','format','Forwarding\x20message\x20%d\x20to\x20%s','Interactions','length','Interaction','omit','POST','method','GET','Message\x20%d\x20forwarded\x20to\x20%s','threadId','update','error','afterCreate','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x190e68,_0x4f5e28){var _0x275fe2=function(_0x48fe42){while(--_0x48fe42){_0x190e68['push'](_0x190e68['shift']());}};_0x275fe2(++_0x4f5e28);}(_0x0598,0x92));var _0x8059=function(_0x378ec6,_0x56c635){_0x378ec6=_0x378ec6-0x0;var _0x3c78e2=_0x0598[_0x378ec6];return _0x3c78e2;};'use strict';var _=require(_0x8059('0x0'));var util=require(_0x8059('0x1'));var logger=require('../../config/logger')(_0x8059('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8059('0x3'));var fs=require('fs');var path=require(_0x8059('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./openchannelMessage.attributes');module[_0x8059('0x5')]=function(_0xa7d7c1,_0x512c0f){return _0xa7d7c1['define'](_0x8059('0x6'),attributes,{'tableName':_0x8059('0x7'),'paranoid':![],'indexes':[{'name':_0x8059('0x8'),'fields':[_0x8059('0x9')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4d1010,_0x89dda1,_0x1bf5fd){var _0x336f85=_0xa7d7c1[_0x8059('0xa')];var _0x283b63=_0x4d1010['get']({'plain':!![]});if(_0x283b63['direction'][_0x8059('0xb')]()==='in'||_0x283b63[_0x8059('0xc')]['toLowerCase']()==='out'&&!_0x283b63['secret']&&!_[_0x8059('0xd')](_0x283b63[_0x8059('0xe')])){_0x336f85[_0x8059('0xf')][_0x8059('0x10')]({'where':{'id':_0x283b63[_0x8059('0x11')]}})['then'](function(_0x11218f){if(_0x11218f){_0x11218f['update']({'lastMsgAt':_0x283b63[_0x8059('0x12')],'lastMsgDirection':_0x283b63['direction'][_0x8059('0xb')]()});}})[_0x8059('0x13')](function(_0x4810fd){console['error'](_0x4810fd);});}if(_0x283b63['direction']==='out'&&!_0x283b63[_0x8059('0x14')]){var _0x239195;_0x336f85[_0x8059('0x15')][_0x8059('0x16')]()[_0x8059('0x17')](function(_0x4b6d55){return _0x336f85[_0x8059('0x18')][_0x8059('0x19')]({'where':{'id':_0x283b63[_0x8059('0x1a')]},'include':[{'model':_0x336f85[_0x8059('0xf')],'as':'Interactions','where':{'id':_0x283b63[_0x8059('0x11')]},'limit':0x1,'include':[{'model':_0x336f85['CmContact'],'as':_0x8059('0x1b'),'attributes':_['keys'](_0x4b6d55)}]}]});})[_0x8059('0x17')](function(_0x56d794){_0x239195=_0x56d794[_0x8059('0x1c')]({'plain':!![]});if(_0x239195&&_0x239195[_0x8059('0x1d')]){logger[_0x8059('0x1e')]('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util[_0x8059('0x1f')](_0x8059('0x20'),_0x283b63['id'],_0x239195[_0x8059('0x1d')]));if(_0x239195[_0x8059('0x21')]&&_0x239195['Interactions'][_0x8059('0x22')]){_0x283b63[_0x8059('0x23')]=_[_0x8059('0x24')](_0x239195['Interactions'][0x0],_0x8059('0x1b'));_0x283b63[_0x8059('0x1b')]=_0x239195[_0x8059('0x21')][0x0][_0x8059('0x1b')];}var _0x89dda1={'method':_0x8059('0x25'),'uri':encodeURI(_0x239195[_0x8059('0x1d')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x89dda1[_0x8059('0x26')]){case _0x8059('0x27'):_0x89dda1['qs']=_0x283b63;break;case _0x8059('0x25'):_0x89dda1['body']=_0x283b63;break;}return rp(_0x89dda1)[_0x8059('0x17')](function(_0x19b95a){logger[_0x8059('0x1e')]('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util['format'](_0x8059('0x28'),_0x283b63['id'],_0x239195[_0x8059('0x1d')]));if(_0x19b95a[_0x8059('0x9')][_0x8059('0x29')]&&_0x19b95a['body'][_0x8059('0x29')]!=_0x283b63['Interaction'][_0x8059('0x29')]){return _0x336f85[_0x8059('0xf')]['update']({'threadId':_0x19b95a[_0x8059('0x9')][_0x8059('0x29')]},{'logging':!![],'where':{'id':_0x283b63[_0x8059('0x23')]['id']}});}else{return;}})[_0x8059('0x17')](function(){return _0x4d1010[_0x8059('0x2a')]({'read':!![]});})[_0x8059('0x13')](function(_0x46b6a1){logger[_0x8059('0x2b')]('OpenchannelMessage,\x20%s,\x20%s',_0x8059('0x2c'),util[_0x8059('0x2d')](_0x46b6a1,{'showHidden':![],'depth':null}));_0x1bf5fd();});}else{_0x1bf5fd();}})[_0x8059('0x2e')](function(){_0x1bf5fd();});}else{_0x1bf5fd();}}},'charset':_0x8059('0x2f'),'collate':_0x8059('0x30')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 727abb0..a5b019f 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 _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(_0x239a47,_0x5c5d5e){var _0x12d6ac=function(_0x4e2022){while(--_0x4e2022){_0x239a47['push'](_0x239a47['shift']());}};_0x12d6ac(++_0x5c5d5e);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1c3d97,_0x18389b){_0x1c3d97=_0x1c3d97-0x0;var _0x2713fb=_0x5f2f[_0x1c3d97];return _0x2713fb;};'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 +var _0x1261=['../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','localhost','socket.io-emitter','./openchannelMessage.socket','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','OpenchannelMessage','options','raw','then','CreateOpenchannelMessage','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0xfcb0e,_0x5b78d1){var _0x235130=function(_0x47f94f){while(--_0x47f94f){_0xfcb0e['push'](_0xfcb0e['shift']());}};_0x235130(++_0x5b78d1);}(_0x1261,0x144));var _0x1126=function(_0x38f730,_0x2c7523){_0x38f730=_0x38f730-0x0;var _0x233bf4=_0x1261[_0x38f730];return _0x233bf4;};'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});config[_0x1126('0xb')]=_['defaults'](config[_0x1126('0xb')],{'host':_0x1126('0xc'),'port':0x18eb});var socket=require(_0x1126('0xd'))(new Redis(config[_0x1126('0xb')]));require(_0x1126('0xe'))['register'](socket);function respondWithRpcPromise(_0x3f09ac,_0x18dbe6,_0x167ef1){return new BPromise(function(_0x5e72e2,_0x34571c){return client['request'](_0x3f09ac,_0x167ef1)['then'](function(_0x15c071){logger['info'](_0x1126('0xf'),_0x18dbe6,_0x1126('0x10'));logger[_0x1126('0x11')](_0x1126('0x12'),_0x18dbe6,_0x1126('0x10'),JSON[_0x1126('0x13')](_0x15c071));if(_0x15c071[_0x1126('0x14')]){if(_0x15c071[_0x1126('0x14')][_0x1126('0x15')]===0x1f4){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x18dbe6,_0x15c071[_0x1126('0x14')][_0x1126('0x16')]);return _0x34571c(_0x15c071[_0x1126('0x14')]['message']);}logger[_0x1126('0x14')]('OpenchannelMessage,\x20%s,\x20%s',_0x18dbe6,_0x15c071[_0x1126('0x14')][_0x1126('0x16')]);return _0x5e72e2(_0x15c071[_0x1126('0x14')]['message']);}else{logger[_0x1126('0x17')](_0x1126('0xf'),_0x18dbe6,'request\x20sent');_0x5e72e2(_0x15c071['result'][_0x1126('0x16')]);}})[_0x1126('0x18')](function(_0x58d11a){logger['error'](_0x1126('0xf'),_0x18dbe6,_0x58d11a);_0x34571c(_0x58d11a);});});}exports['CreateOpenchannelMessage']=function(_0x22ed37){var _0x1d6d19=this;return new Promise(function(_0x2f70ac,_0x54400a){return db[_0x1126('0x19')]['create'](_0x22ed37['body'],{'raw':_0x22ed37[_0x1126('0x1a')]?_0x22ed37[_0x1126('0x1a')][_0x1126('0x1b')]===undefined?!![]:![]:!![]})[_0x1126('0x1c')](function(_0x526ca1){logger[_0x1126('0x17')](_0x1126('0x1d'),_0x22ed37);logger['debug'](_0x1126('0x1d'),_0x22ed37,JSON['stringify'](_0x526ca1));_0x2f70ac(_0x526ca1);})['catch'](function(_0x4b57ab){logger[_0x1126('0x14')](_0x1126('0x1d'),_0x4b57ab[_0x1126('0x16')],_0x22ed37);_0x54400a(_0x1d6d19[_0x1126('0x14')](0x1f4,_0x4b57ab[_0x1126('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 68e6797..52db785 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 _0xc77b=['save','remove','emit','removeListener','register','length','openchannelMessage:','./openchannelMessage.events'];(function(_0x161690,_0x4967ea){var _0x13af94=function(_0x4f3902){while(--_0x4f3902){_0x161690['push'](_0x161690['shift']());}};_0x13af94(++_0x4967ea);}(_0xc77b,0x187));var _0xbc77=function(_0x478355,_0x4b8fb2){_0x478355=_0x478355-0x0;var _0xec3e63=_0xc77b[_0x478355];return _0xec3e63;};'use strict';var OpenchannelMessageEvents=require(_0xbc77('0x0'));var events=[_0xbc77('0x1'),_0xbc77('0x2'),'update'];function createListener(_0x65b0af,_0x185649){return function(_0x1e388a){_0x185649[_0xbc77('0x3')](_0x65b0af,_0x1e388a);};}function removeListener(_0x337316,_0x279473){return function(){OpenchannelMessageEvents[_0xbc77('0x4')](_0x337316,_0x279473);};}exports[_0xbc77('0x5')]=function(_0x4783d4){for(var _0x378251=0x0,_0x40a25d=events[_0xbc77('0x6')];_0x378251<_0x40a25d;_0x378251++){var _0x22e6c8=events[_0x378251];var _0x6f5ae7=createListener(_0xbc77('0x7')+_0x22e6c8,_0x4783d4);OpenchannelMessageEvents['on'](_0x22e6c8,_0x6f5ae7);}}; \ No newline at end of file +var _0x5ed3=['openchannelMessage:','./openchannelMessage.events','remove','update','emit','register'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x5ed3,0x1f3));var _0x35ed=function(_0x30bece,_0x1379bd){_0x30bece=_0x30bece-0x0;var _0x2d6703=_0x5ed3[_0x30bece];return _0x2d6703;};'use strict';var OpenchannelMessageEvents=require(_0x35ed('0x0'));var events=['save',_0x35ed('0x1'),_0x35ed('0x2')];function createListener(_0x3769c5,_0x5a4029){return function(_0x5a195e){_0x5a4029[_0x35ed('0x3')](_0x3769c5,_0x5a195e);};}function removeListener(_0x4d070,_0x1908f3){return function(){OpenchannelMessageEvents['removeListener'](_0x4d070,_0x1908f3);};}exports[_0x35ed('0x4')]=function(_0x39b155){for(var _0x92ada=0x0,_0x3ec85e=events['length'];_0x92ada<_0x3ec85e;_0x92ada++){var _0x1d0924=events[_0x92ada];var _0x401858=createListener(_0x35ed('0x5')+_0x1d0924,_0x39b155);OpenchannelMessageEvents['on'](_0x1d0924,_0x401858);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 99db487..af5c7db 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 _0x7eea=['get','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/teams','getAgents','create','post','/:id/users','update','delete','removeAgents','exports','multer','util','path','express','../../components/interaction/service','../../config/environment','./openchannelQueue.controller'];(function(_0x48d3f0,_0x22f27f){var _0x1f8412=function(_0x114456){while(--_0x114456){_0x48d3f0['push'](_0x48d3f0['shift']());}};_0x1f8412(++_0x22f27f);}(_0x7eea,0x1dc));var _0xa7ee=function(_0x1cea27,_0x56f6e6){_0x1cea27=_0x1cea27-0x0;var _0x44ea37=_0x7eea[_0x1cea27];return _0x44ea37;};'use strict';var multer=require(_0xa7ee('0x0'));var util=require(_0xa7ee('0x1'));var path=require(_0xa7ee('0x2'));var timeout=require('connect-timeout');var express=require(_0xa7ee('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa7ee('0x4'));var config=require(_0xa7ee('0x5'));var controller=require(_0xa7ee('0x6'));router[_0xa7ee('0x7')]('/',auth[_0xa7ee('0x8')](),controller['index']);router['get']('/describe',auth[_0xa7ee('0x8')](),controller[_0xa7ee('0x9')]);router['get'](_0xa7ee('0xa'),auth[_0xa7ee('0x8')](),controller[_0xa7ee('0xb')]);router[_0xa7ee('0x7')](_0xa7ee('0xc'),auth['isAuthenticated'](),controller[_0xa7ee('0xd')]);router[_0xa7ee('0x7')](_0xa7ee('0xe'),auth['isAuthenticated'](),controller['getTeams']);router[_0xa7ee('0x7')]('/:id/users',auth[_0xa7ee('0x8')](),controller[_0xa7ee('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa7ee('0x10')]);router['post'](_0xa7ee('0xe'),auth['isAuthenticated'](),controller['addTeams']);router[_0xa7ee('0x11')](_0xa7ee('0x12'),auth[_0xa7ee('0x8')](),controller['addAgents']);router['put']('/:id',auth[_0xa7ee('0x8')](),controller[_0xa7ee('0x13')]);router[_0xa7ee('0x14')]('/:id',auth[_0xa7ee('0x8')](),controller['destroy']);router['delete'](_0xa7ee('0xe'),auth['isAuthenticated'](),controller['removeTeams']);router[_0xa7ee('0x14')]('/:id/users',auth[_0xa7ee('0x8')](),controller[_0xa7ee('0x15')]);module[_0xa7ee('0x16')]=router; \ No newline at end of file +var _0x9837=['./openchannelQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','/:id/teams','getTeams','post','create','addTeams','/:id/users','addAgents','/:id','update','destroy','delete','removeAgents','multer','util','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x15296a,_0x5aa7d4){var _0x492793=function(_0x424b22){while(--_0x424b22){_0x15296a['push'](_0x15296a['shift']());}};_0x492793(++_0x5aa7d4);}(_0x9837,0x7c));var _0x7983=function(_0x1046d1,_0x72fbb){_0x1046d1=_0x1046d1-0x0;var _0x47720b=_0x9837[_0x1046d1];return _0x47720b;};'use strict';var multer=require(_0x7983('0x0'));var util=require(_0x7983('0x1'));var path=require('path');var timeout=require(_0x7983('0x2'));var express=require(_0x7983('0x3'));var router=express['Router']();var fs_extra=require(_0x7983('0x4'));var auth=require(_0x7983('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7983('0x6'));router[_0x7983('0x7')]('/',auth[_0x7983('0x8')](),controller[_0x7983('0x9')]);router[_0x7983('0x7')](_0x7983('0xa'),auth['isAuthenticated'](),controller[_0x7983('0xb')]);router[_0x7983('0x7')]('/:id',auth[_0x7983('0x8')](),controller[_0x7983('0xc')]);router[_0x7983('0x7')](_0x7983('0xd'),auth[_0x7983('0x8')](),controller['getMembers']);router[_0x7983('0x7')](_0x7983('0xe'),auth[_0x7983('0x8')](),controller[_0x7983('0xf')]);router[_0x7983('0x7')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0x7983('0x10')]('/',auth[_0x7983('0x8')](),controller[_0x7983('0x11')]);router[_0x7983('0x10')](_0x7983('0xe'),auth[_0x7983('0x8')](),controller[_0x7983('0x12')]);router[_0x7983('0x10')](_0x7983('0x13'),auth[_0x7983('0x8')](),controller[_0x7983('0x14')]);router['put'](_0x7983('0x15'),auth[_0x7983('0x8')](),controller[_0x7983('0x16')]);router['delete'](_0x7983('0x15'),auth[_0x7983('0x8')](),controller[_0x7983('0x17')]);router['delete'](_0x7983('0xe'),auth[_0x7983('0x8')](),controller['removeTeams']);router[_0x7983('0x18')](_0x7983('0x13'),auth['isAuthenticated'](),controller[_0x7983('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 650bbec..5cab0ea 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 _0x9548=['ENUM','rrmemory','roundrobin','sequelize','exports','name'];(function(_0x5774be,_0x2259d3){var _0x4914b4=function(_0x1eebc3){while(--_0x1eebc3){_0x5774be['push'](_0x5774be['shift']());}};_0x4914b4(++_0x2259d3);}(_0x9548,0x1dd));var _0x8954=function(_0x1a18e8,_0x2e0582){_0x1a18e8=_0x1a18e8-0x0;var _0x46ed90=_0x9548[_0x1a18e8];return _0x46ed90;};'use strict';var Sequelize=require(_0x8954('0x0'));module[_0x8954('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x8954('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[_0x8954('0x3')](_0x8954('0x4'),'beepall',_0x8954('0x5'))}}; \ No newline at end of file +var _0x85d6=['INTEGER','ENUM','rrmemory','roundrobin','exports','STRING','name'];(function(_0x1c8c28,_0x3ee093){var _0x1f59b4=function(_0x29bcc0){while(--_0x29bcc0){_0x1c8c28['push'](_0x1c8c28['shift']());}};_0x1f59b4(++_0x3ee093);}(_0x85d6,0x89));var _0x685d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x85d6[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x685d('0x0')]={'name':{'type':Sequelize[_0x685d('0x1')],'unique':_0x685d('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x685d('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x685d('0x4')](_0x685d('0x5'),'beepall',_0x685d('0x6'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index e614b33..4c39b6d 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 _0x4c26=['field','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','sequelize','toString','TeamId','includes','union','compact','value','isEmpty','removeAgents','forEach','userOpenchannelQueue:remove','addAgents','omit','spread','userOpenchannelQueue:save','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','ejs','lodash','squel','crypto','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','redis','defaults','localhost','socket.io-emitter','sendStatus','end','status','json','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','stack','name','index','map','OpenchannelQueue','rawAttributes','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','length','find','create','role','user','OpenchannelQueues','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','getMembers','findOne','UserOpenchannelQueue','order','OpenchannelQueueId','findAndCountAll','UserId','agent','updatedAt','%s/%s','openchannelPause','createdAt','Team','getTeams','addTeams','ids','User','Agents','online','interface','transaction','each','emit','removeTeams','findAll','select'];(function(_0x1d0bac,_0x32daab){var _0x23a124=function(_0xd100f1){while(--_0xd100f1){_0x1d0bac['push'](_0x1d0bac['shift']());}};_0x23a124(++_0x32daab);}(_0x4c26,0xa2));var _0x64c2=function(_0x4fdf93,_0x2f1950){_0x4fdf93=_0x4fdf93-0x0;var _0x305fa6=_0x4c26[_0x4fdf93];return _0x305fa6;};'use strict';var emlformat=require(_0x64c2('0x0'));var rimraf=require(_0x64c2('0x1'));var zipdir=require(_0x64c2('0x2'));var jsonpatch=require(_0x64c2('0x3'));var rp=require(_0x64c2('0x4'));var moment=require('moment');var BPromise=require(_0x64c2('0x5'));var Mustache=require(_0x64c2('0x6'));var util=require('util');var path=require(_0x64c2('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x64c2('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x64c2('0x9'));var squel=require(_0x64c2('0xa'));var crypto=require(_0x64c2('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x64c2('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x64c2('0xd'));var Redis=require(_0x64c2('0xe'));var authService=require(_0x64c2('0xf'));var qs=require(_0x64c2('0x10'));var as=require(_0x64c2('0x11'));var hardwareService=require(_0x64c2('0x12'));var logger=require(_0x64c2('0x13'))(_0x64c2('0x14'));var utils=require(_0x64c2('0x15'));var config=require(_0x64c2('0x16'));var licenseUtil=require(_0x64c2('0x17'));var db=require('../../mysqldb')['db'];config[_0x64c2('0x18')]=_[_0x64c2('0x19')](config[_0x64c2('0x18')],{'host':_0x64c2('0x1a'),'port':0x18eb});var socket=require(_0x64c2('0x1b'))(new Redis(config[_0x64c2('0x18')]));require('./openchannelQueue.socket')['register'](socket);function respondWithStatusCode(_0x389d72,_0x54ae2f){_0x54ae2f=_0x54ae2f||0xcc;return function(_0x2c6113){if(_0x2c6113){return _0x389d72[_0x64c2('0x1c')](_0x54ae2f);}return _0x389d72['status'](_0x54ae2f)[_0x64c2('0x1d')]();};}function respondWithResult(_0x354b61,_0xa307dc){_0xa307dc=_0xa307dc||0xc8;return function(_0x19a76f){if(_0x19a76f){return _0x354b61[_0x64c2('0x1e')](_0xa307dc)[_0x64c2('0x1f')](_0x19a76f);}};}function respondWithFilteredResult(_0x13f720,_0x46ed74){return function(_0x5d2402){if(_0x5d2402){var _0x2a0b38=typeof _0x46ed74['offset']==='undefined'&&typeof _0x46ed74[_0x64c2('0x20')]==='undefined';var _0x12d136=_0x5d2402[_0x64c2('0x21')];var _0x142c56=_0x2a0b38?0x0:_0x46ed74[_0x64c2('0x22')];var _0x3a9958=_0x2a0b38?_0x5d2402[_0x64c2('0x21')]:_0x46ed74['offset']+_0x46ed74[_0x64c2('0x20')];var _0x52657e;if(_0x3a9958>=_0x12d136){_0x3a9958=_0x12d136;_0x52657e=0xc8;}else{_0x52657e=0xce;}_0x13f720[_0x64c2('0x1e')](_0x52657e);return _0x13f720[_0x64c2('0x23')](_0x64c2('0x24'),_0x142c56+'-'+_0x3a9958+'/'+_0x12d136)['json'](_0x5d2402);}return null;};}function patchUpdates(_0x3b64ef){return function(_0x180c0b){try{jsonpatch[_0x64c2('0x25')](_0x180c0b,_0x3b64ef,!![]);}catch(_0x395a5b){return BPromise[_0x64c2('0x26')](_0x395a5b);}return _0x180c0b['save']();};}function saveUpdates(_0xc87946,_0x3c6993){return function(_0x17cfeb){if(_0x17cfeb){return _0x17cfeb[_0x64c2('0x27')](_0xc87946)[_0x64c2('0x28')](function(_0x1c4b56){return _0x1c4b56;});}return null;};}function removeEntity(_0x583107,_0xbe1723){return function(_0xf18349){if(_0xf18349){return _0xf18349[_0x64c2('0x29')]()['then'](function(){var _0x5f4a7d=_0xf18349[_0x64c2('0x2a')]({'plain':!![]});var _0xee5a81='OpenchannelQueues';return db[_0x64c2('0x2b')][_0x64c2('0x29')]({'where':{'type':_0xee5a81,'resourceId':_0x5f4a7d['id']}})[_0x64c2('0x28')](function(){return _0xf18349;});})[_0x64c2('0x28')](function(){_0x583107[_0x64c2('0x1e')](0xcc)[_0x64c2('0x1d')]();});}};}function handleEntityNotFound(_0x3ee710,_0x2110fa){return function(_0x2bdd7c){if(!_0x2bdd7c){_0x3ee710[_0x64c2('0x1c')](0x194);}return _0x2bdd7c;};}function handleError(_0x2eee7f,_0x4d487f){_0x4d487f=_0x4d487f||0x1f4;return function(_0x11a223){logger['error'](_0x11a223[_0x64c2('0x2c')]);if(_0x11a223[_0x64c2('0x2d')]){delete _0x11a223['name'];}_0x2eee7f[_0x64c2('0x1e')](_0x4d487f)['send'](_0x11a223);};}exports[_0x64c2('0x2e')]=function(_0xf1311b,_0x1a5863){var _0x22d185={},_0x27243e={},_0x127373={'count':0x0,'rows':[]};var _0x12a69a=_[_0x64c2('0x2f')](db[_0x64c2('0x30')][_0x64c2('0x31')],function(_0x5c87fc){return{'name':_0x5c87fc['fieldName'],'type':_0x5c87fc['type']['key']};});_0x27243e['model']=_[_0x64c2('0x2f')](_0x12a69a,_0x64c2('0x2d'));_0x27243e['query']=_[_0x64c2('0x32')](_0xf1311b[_0x64c2('0x33')]);_0x27243e[_0x64c2('0x34')]=_[_0x64c2('0x35')](_0x27243e[_0x64c2('0x36')],_0x27243e['query']);_0x22d185['attributes']=_[_0x64c2('0x35')](_0x27243e['model'],qs['fields'](_0xf1311b['query'][_0x64c2('0x37')]));_0x22d185[_0x64c2('0x38')]=_0x22d185['attributes']['length']?_0x22d185[_0x64c2('0x38')]:_0x27243e[_0x64c2('0x36')];if(!_0xf1311b[_0x64c2('0x33')][_0x64c2('0x39')](_0x64c2('0x3a'))){_0x22d185[_0x64c2('0x20')]=qs[_0x64c2('0x20')](_0xf1311b[_0x64c2('0x33')][_0x64c2('0x20')]);_0x22d185['offset']=qs[_0x64c2('0x22')](_0xf1311b[_0x64c2('0x33')][_0x64c2('0x22')]);}_0x22d185['order']=qs[_0x64c2('0x3b')](_0xf1311b[_0x64c2('0x33')]['sort']);_0x22d185[_0x64c2('0x3c')]=qs[_0x64c2('0x34')](_[_0x64c2('0x3d')](_0xf1311b[_0x64c2('0x33')],_0x27243e['filters']),_0x12a69a);if(_0xf1311b[_0x64c2('0x33')][_0x64c2('0x3e')]){_0x22d185[_0x64c2('0x3c')]=_[_0x64c2('0x3f')](_0x22d185[_0x64c2('0x3c')],{'$or':_[_0x64c2('0x2f')](_0x12a69a,function(_0x4152f9){if(_0x4152f9['type']!=='VIRTUAL'){var _0x157e34={};_0x157e34[_0x4152f9[_0x64c2('0x2d')]]={'$like':'%'+_0xf1311b[_0x64c2('0x33')]['filter']+'%'};return _0x157e34;}})});}_0x22d185=_[_0x64c2('0x3f')]({},_0x22d185,_0xf1311b[_0x64c2('0x40')]);var _0x1f094a={'where':_0x22d185['where']};return db[_0x64c2('0x30')][_0x64c2('0x21')](_0x1f094a)[_0x64c2('0x28')](function(_0x4a8e88){_0x127373[_0x64c2('0x21')]=_0x4a8e88;if(_0xf1311b['query'][_0x64c2('0x41')]){_0x22d185[_0x64c2('0x42')]=[{'all':!![]}];}return db['OpenchannelQueue']['findAll'](_0x22d185);})[_0x64c2('0x28')](function(_0x1caa44){_0x127373[_0x64c2('0x43')]=_0x1caa44;return _0x127373;})[_0x64c2('0x28')](respondWithFilteredResult(_0x1a5863,_0x22d185))[_0x64c2('0x44')](handleError(_0x1a5863,null));};exports[_0x64c2('0x45')]=function(_0x4a2ccc,_0x1f8fb4){var _0x2a6e68={'raw':!![],'where':{'id':_0x4a2ccc['params']['id']}},_0x44ac9f={};_0x44ac9f[_0x64c2('0x36')]=_[_0x64c2('0x32')](db[_0x64c2('0x30')][_0x64c2('0x31')]);_0x44ac9f[_0x64c2('0x33')]=_[_0x64c2('0x32')](_0x4a2ccc[_0x64c2('0x33')]);_0x44ac9f['filters']=_[_0x64c2('0x35')](_0x44ac9f[_0x64c2('0x36')],_0x44ac9f[_0x64c2('0x33')]);_0x2a6e68[_0x64c2('0x38')]=_['intersection'](_0x44ac9f['model'],qs[_0x64c2('0x37')](_0x4a2ccc[_0x64c2('0x33')][_0x64c2('0x37')]));_0x2a6e68[_0x64c2('0x38')]=_0x2a6e68[_0x64c2('0x38')][_0x64c2('0x46')]?_0x2a6e68[_0x64c2('0x38')]:_0x44ac9f[_0x64c2('0x36')];if(_0x4a2ccc['query']['includeAll']){_0x2a6e68[_0x64c2('0x42')]=[{'all':!![]}];}_0x2a6e68=_[_0x64c2('0x3f')]({},_0x2a6e68,_0x4a2ccc['options']);return db['OpenchannelQueue'][_0x64c2('0x47')](_0x2a6e68)[_0x64c2('0x28')](handleEntityNotFound(_0x1f8fb4,null))[_0x64c2('0x28')](respondWithResult(_0x1f8fb4,null))[_0x64c2('0x44')](handleError(_0x1f8fb4,null));};exports[_0x64c2('0x48')]=function(_0x54849b,_0x575ec2){return db[_0x64c2('0x30')][_0x64c2('0x48')](_0x54849b['body'],{})['then'](function(_0x448d4e){var _0x5431ef=_0x54849b['user']['get']({'plain':!![]});if(!_0x5431ef)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5431ef[_0x64c2('0x49')]===_0x64c2('0x4a')){var _0x420d09=_0x448d4e[_0x64c2('0x2a')]({'plain':!![]});var _0x1c6f6c=_0x64c2('0x4b');return db['UserProfileSection'][_0x64c2('0x47')]({'where':{'name':_0x1c6f6c,'userProfileId':_0x5431ef['userProfileId']},'raw':!![]})[_0x64c2('0x28')](function(_0x20a8fa){if(_0x20a8fa&&_0x20a8fa[_0x64c2('0x4c')]===0x0){return db[_0x64c2('0x2b')][_0x64c2('0x48')]({'name':_0x420d09[_0x64c2('0x2d')],'resourceId':_0x420d09['id'],'type':_0x20a8fa[_0x64c2('0x2d')],'sectionId':_0x20a8fa['id']},{})['then'](function(){return _0x448d4e;});}else{return _0x448d4e;}})[_0x64c2('0x44')](function(_0x3db046){logger[_0x64c2('0x4d')](_0x64c2('0x4e'),_0x3db046);throw _0x3db046;});}return _0x448d4e;})[_0x64c2('0x28')](respondWithResult(_0x575ec2,0xc9))[_0x64c2('0x44')](handleError(_0x575ec2,null));};exports[_0x64c2('0x27')]=function(_0x419a0a,_0x26f8b5){if(_0x419a0a[_0x64c2('0x4f')]['id']){delete _0x419a0a['body']['id'];}return db[_0x64c2('0x30')][_0x64c2('0x47')]({'where':{'id':_0x419a0a[_0x64c2('0x50')]['id']}})[_0x64c2('0x28')](handleEntityNotFound(_0x26f8b5,null))[_0x64c2('0x28')](saveUpdates(_0x419a0a[_0x64c2('0x4f')],null))[_0x64c2('0x28')](respondWithResult(_0x26f8b5,null))[_0x64c2('0x44')](handleError(_0x26f8b5,null));};exports['destroy']=function(_0x59bd97,_0x3c3b2e){return db[_0x64c2('0x30')][_0x64c2('0x47')]({'where':{'id':_0x59bd97[_0x64c2('0x50')]['id']}})[_0x64c2('0x28')](handleEntityNotFound(_0x3c3b2e,null))[_0x64c2('0x28')](removeEntity(_0x3c3b2e,null))['catch'](handleError(_0x3c3b2e,null));};exports[_0x64c2('0x51')]=function(_0x4ee721,_0x42e6ad){return db[_0x64c2('0x30')][_0x64c2('0x51')]()[_0x64c2('0x28')](respondWithResult(_0x42e6ad,null))[_0x64c2('0x44')](handleError(_0x42e6ad,null));};exports[_0x64c2('0x52')]=function(_0x59ef91,_0x3690d5,_0x66cc5e){var _0x482c7d={'raw':!![],'where':{}},_0x32d393={},_0x22e480;return db[_0x64c2('0x30')][_0x64c2('0x53')]({'where':{'id':_0x59ef91[_0x64c2('0x50')]['id']}})[_0x64c2('0x28')](handleEntityNotFound(_0x3690d5,null))['then'](function(_0x11721d){if(_0x11721d){_0x22e480=_0x11721d[_0x64c2('0x2a')]({'plain':!![]});_0x32d393[_0x64c2('0x36')]=_['keys'](db[_0x64c2('0x54')][_0x64c2('0x31')]);_0x32d393[_0x64c2('0x33')]=_[_0x64c2('0x32')](_0x59ef91[_0x64c2('0x33')]);_0x32d393[_0x64c2('0x34')]=_[_0x64c2('0x35')](_0x32d393[_0x64c2('0x36')],_0x32d393[_0x64c2('0x33')]);_0x482c7d[_0x64c2('0x38')]=_[_0x64c2('0x35')](_0x32d393[_0x64c2('0x36')],qs[_0x64c2('0x37')](_0x59ef91['query'][_0x64c2('0x37')]));_0x482c7d[_0x64c2('0x38')]=_0x482c7d[_0x64c2('0x38')][_0x64c2('0x46')]?_0x482c7d['attributes']:_0x32d393[_0x64c2('0x36')];if(!_0x59ef91[_0x64c2('0x33')][_0x64c2('0x39')](_0x64c2('0x3a'))){_0x482c7d['limit']=qs[_0x64c2('0x20')](_0x59ef91[_0x64c2('0x33')][_0x64c2('0x20')]);_0x482c7d[_0x64c2('0x22')]=qs[_0x64c2('0x22')](_0x59ef91[_0x64c2('0x33')][_0x64c2('0x22')]);}_0x482c7d[_0x64c2('0x55')]=qs[_0x64c2('0x3b')](_0x59ef91['query'][_0x64c2('0x3b')]);_0x482c7d[_0x64c2('0x3c')]=qs['filters'](_[_0x64c2('0x3d')](_0x59ef91[_0x64c2('0x33')],_0x32d393[_0x64c2('0x34')]));_0x482c7d['where'][_0x64c2('0x56')]=_0x11721d['id'];if(_0x59ef91[_0x64c2('0x33')][_0x64c2('0x3e')]){_0x482c7d[_0x64c2('0x3c')]=_[_0x64c2('0x3f')](_0x482c7d[_0x64c2('0x3c')],{'$or':_['map'](_0x482c7d[_0x64c2('0x38')],function(_0x1474c0){var _0x5e097b={};_0x5e097b[_0x1474c0]={'$like':'%'+_0x59ef91['query'][_0x64c2('0x3e')]+'%'};return _0x5e097b;})});}_0x482c7d=_[_0x64c2('0x3f')]({},_0x482c7d,_0x59ef91['options']);return db[_0x64c2('0x54')]['findAll'](_0x482c7d);}})[_0x64c2('0x28')](function(_0x33f2a0){if(_0x33f2a0){return db['User'][_0x64c2('0x57')]({'where':{'id':_[_0x64c2('0x2f')](_0x33f2a0,_0x64c2('0x58')),'role':_0x64c2('0x59')},'attributes':['id',_0x64c2('0x2d'),'openchannelPause',_0x64c2('0x5a'),'createdAt']});}})[_0x64c2('0x28')](function(_0x1dc9ff){if(_0x1dc9ff){return{'count':_0x1dc9ff[_0x64c2('0x21')],'rows':_[_0x64c2('0x2f')](_0x1dc9ff['rows'],function(_0x55dfd9){return{'membername':_0x55dfd9[_0x64c2('0x2d')],'UserId':_0x55dfd9['id'],'queue_name':_0x22e480[_0x64c2('0x2d')],'OpenchannelQueueId':_0x22e480['id'],'interface':util['format'](_0x64c2('0x5b'),'SIP',_0x55dfd9['name']),'penalty':0x0,'paused':_0x55dfd9[_0x64c2('0x5c')],'createdAt':_0x55dfd9[_0x64c2('0x5d')],'updatedAt':_0x55dfd9[_0x64c2('0x5a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x64c2('0x28')](respondWithFilteredResult(_0x3690d5,_0x482c7d))['catch'](handleError(_0x3690d5,null));};exports['getTeams']=function(_0x3c10de,_0x1a9dad,_0x414b8a){var _0x489af3={};var _0x1d6703={};var _0x49ecf4;var _0x226ef2;return db['OpenchannelQueue'][_0x64c2('0x53')]({'where':{'id':_0x3c10de[_0x64c2('0x50')]['id']}})[_0x64c2('0x28')](handleEntityNotFound(_0x1a9dad,null))[_0x64c2('0x28')](function(_0x5270e6){if(_0x5270e6){_0x49ecf4=_0x5270e6;_0x1d6703['model']=_[_0x64c2('0x32')](db[_0x64c2('0x5e')]['rawAttributes']);_0x1d6703['query']=_[_0x64c2('0x32')](_0x3c10de['query']);_0x1d6703[_0x64c2('0x34')]=_[_0x64c2('0x35')](_0x1d6703['model'],_0x1d6703[_0x64c2('0x33')]);_0x489af3['attributes']=_['intersection'](_0x1d6703[_0x64c2('0x36')],qs[_0x64c2('0x37')](_0x3c10de[_0x64c2('0x33')][_0x64c2('0x37')]));_0x489af3[_0x64c2('0x38')]=_0x489af3[_0x64c2('0x38')][_0x64c2('0x46')]?_0x489af3[_0x64c2('0x38')]:_0x1d6703[_0x64c2('0x36')];_0x489af3[_0x64c2('0x55')]=qs['sort'](_0x3c10de['query']['sort']);_0x489af3['where']=qs[_0x64c2('0x34')](_[_0x64c2('0x3d')](_0x3c10de[_0x64c2('0x33')],_0x1d6703[_0x64c2('0x34')]));if(_0x3c10de[_0x64c2('0x33')]['filter']){_0x489af3[_0x64c2('0x3c')]=_['merge'](_0x489af3[_0x64c2('0x3c')],{'$or':_[_0x64c2('0x2f')](_0x489af3[_0x64c2('0x38')],function(_0x563ecc){var _0x277074={};_0x277074[_0x563ecc]={'$like':'%'+_0x3c10de[_0x64c2('0x33')][_0x64c2('0x3e')]+'%'};return _0x277074;})});}_0x489af3=_[_0x64c2('0x3f')]({},_0x489af3,_0x3c10de[_0x64c2('0x40')]);return _0x49ecf4['getTeams'](_0x489af3);}})[_0x64c2('0x28')](function(_0xcb809a){if(_0xcb809a){_0x226ef2=_0xcb809a['length'];if(!_0x3c10de['query'][_0x64c2('0x39')](_0x64c2('0x3a'))){_0x489af3[_0x64c2('0x20')]=qs[_0x64c2('0x20')](_0x3c10de[_0x64c2('0x33')][_0x64c2('0x20')]);_0x489af3[_0x64c2('0x22')]=qs[_0x64c2('0x22')](_0x3c10de[_0x64c2('0x33')]['offset']);}return _0x49ecf4[_0x64c2('0x5f')](_0x489af3);}})[_0x64c2('0x28')](function(_0x2e2f0a){if(_0x2e2f0a){return _0x2e2f0a?{'count':_0x226ef2,'rows':_0x2e2f0a}:null;}})[_0x64c2('0x28')](respondWithResult(_0x1a9dad,null))[_0x64c2('0x44')](handleError(_0x1a9dad,null));};exports[_0x64c2('0x60')]=function(_0x1f8bb0,_0x19b511,_0x1de0a8){var _0x5bf3e0=_0x1f8bb0[_0x64c2('0x4f')][_0x64c2('0x61')];return db['Team']['findAll']({'where':{'id':_0x5bf3e0},'attributes':['id'],'include':[{'model':db[_0x64c2('0x62')],'as':_0x64c2('0x63'),'attributes':['id','name',_0x64c2('0x64'),'voicePause',_0x64c2('0x65')],'raw':!![]}]})[_0x64c2('0x28')](function(_0x5dc21d){if(_0x5dc21d){var _0x2c4e40=_['flatMap'](_0x5dc21d,function(_0x2680a1){var _0x40a5ed=_0x2680a1['get']({'plain':!![]});return _0x40a5ed[_0x64c2('0x63')];});return db[_0x64c2('0x30')]['find']({'where':{'id':_0x1f8bb0[_0x64c2('0x50')]['id']}})[_0x64c2('0x28')](function(_0x42670b){return db['sequelize'][_0x64c2('0x66')](function(_0x47f673){return _0x42670b[_0x64c2('0x60')](_0x5bf3e0,{'transaction':_0x47f673})[_0x64c2('0x28')](function(){return BPromise[_0x64c2('0x67')](_0x2c4e40,function(_0x13efcd){return db[_0x64c2('0x54')]['findOrCreate']({'where':{'UserId':_0x13efcd['id'],'OpenchannelQueueId':_0x1f8bb0['params']['id']},'transaction':_0x47f673});});})['then'](function(){_0x2c4e40['forEach'](function(_0xf6110e){socket[_0x64c2('0x68')]('userOpenchannelQueue:save',{'UserId':_0xf6110e['id'],'OpenchannelQueueId':_0x42670b['id']});});});});});}})[_0x64c2('0x28')](respondWithStatusCode(_0x19b511,null))['catch'](handleError(_0x19b511,null));};exports[_0x64c2('0x69')]=function(_0x2bef92,_0x546cf9,_0x2d40de){return db[_0x64c2('0x5e')][_0x64c2('0x6a')]({'where':{'id':_0x2bef92['query'][_0x64c2('0x61')]},'attributes':['id'],'include':[{'model':db[_0x64c2('0x62')],'as':_0x64c2('0x63'),'attributes':['id'],'raw':!![]}]})[_0x64c2('0x28')](handleEntityNotFound(_0x546cf9,null))[_0x64c2('0x28')](function(_0x3be25b){var _0x6ed73f=_[_0x64c2('0x2f')](_0x3be25b,'id');var _0x54b0bf=[];var _0x646860=[];var _0x217394=squel[_0x64c2('0x6b')]();_0x217394[_0x64c2('0x6c')](_0x64c2('0x6d'))[_0x64c2('0x6e')](_0x64c2('0x6f'),'tq')[_0x64c2('0x70')](_0x64c2('0x71'),'ut',_0x64c2('0x72'))['where']('OpenchannelQueueId\x20=\x20?',_0x2bef92['params']['id']);for(var _0x1c63af=0x0;_0x1c63af<_0x3be25b[_0x64c2('0x46')];_0x1c63af+=0x1){let _0xabeef7=_0x3be25b[_0x1c63af];for(var _0x1492eb=0x0;_0x1492eb<_0xabeef7[_0x64c2('0x63')][_0x64c2('0x46')];_0x1492eb+=0x1){let _0x4e714d=_0xabeef7['Agents'][_0x1492eb];var _0x4b985d=_0x217394[_0x64c2('0x73')]();_0x4b985d['where'](_0x64c2('0x74'),_0x4e714d['id']);_0x646860[_0x64c2('0x75')](db[_0x64c2('0x76')][_0x64c2('0x33')](_0x4b985d[_0x64c2('0x77')](),{'type':db[_0x64c2('0x76')]['QueryTypes']['SELECT']})[_0x64c2('0x28')](function(_0x2af054){if(_0x2af054[_0x64c2('0x46')]===0x1){return _0x4e714d['id'];}else{var _0x1be15e=_['every'](_['map'](_0x2af054,_0x64c2('0x78')),function(_0x56346b){return _[_0x64c2('0x79')](_0x6ed73f,_0x56346b);});if(_0x1be15e){return _0x4e714d['id'];}}}));}}return BPromise['all'](_0x646860)[_0x64c2('0x28')](function(_0x46e85c){_0x54b0bf=_(_0x54b0bf)[_0x64c2('0x7a')](_0x46e85c)[_0x64c2('0x7b')]()[_0x64c2('0x7c')]();return db['OpenchannelQueue'][_0x64c2('0x47')]({'where':{'id':_0x2bef92[_0x64c2('0x50')]['id']}})[_0x64c2('0x28')](function(_0x4a18f4){return db[_0x64c2('0x76')]['transaction'](function(_0x476ab0){return _0x4a18f4['removeTeams'](_0x2bef92['query'][_0x64c2('0x61')],{'transaction':_0x476ab0})['then'](function(){if(!_[_0x64c2('0x7d')](_0x54b0bf)){return _0x4a18f4[_0x64c2('0x7e')](_0x54b0bf,{'transaction':_0x476ab0});}})[_0x64c2('0x28')](function(){_0x54b0bf[_0x64c2('0x7f')](function(_0xa648d1){socket[_0x64c2('0x68')](_0x64c2('0x80'),{'UserId':_0xa648d1,'OpenchannelQueueId':_0x4a18f4['id']});});});});});});})[_0x64c2('0x28')](respondWithStatusCode(_0x546cf9,null))[_0x64c2('0x44')](handleError(_0x546cf9,null));};exports[_0x64c2('0x81')]=function(_0x5d8a56,_0xbf809b,_0x54b8c9){return db[_0x64c2('0x30')][_0x64c2('0x47')]({'where':{'id':_0x5d8a56[_0x64c2('0x50')]['id']}})[_0x64c2('0x28')](handleEntityNotFound(_0xbf809b,null))[_0x64c2('0x28')](function(_0x1c9e35){if(_0x1c9e35){return _0x1c9e35[_0x64c2('0x81')](_0x5d8a56[_0x64c2('0x4f')][_0x64c2('0x61')],_[_0x64c2('0x82')](_0x5d8a56['body'],[_0x64c2('0x61'),'id'])||{})[_0x64c2('0x83')](function(_0x3300c0){for(var _0x3fea54=0x0;_0x3fea54<_0x5d8a56[_0x64c2('0x4f')]['ids'][_0x64c2('0x46')];_0x3fea54+=0x1){socket[_0x64c2('0x68')](_0x64c2('0x84'),{'UserId':Number(_0x5d8a56[_0x64c2('0x4f')][_0x64c2('0x61')][_0x3fea54]),'OpenchannelQueueId':Number(_0x5d8a56['params']['id'])});}return _0x3300c0;});}})[_0x64c2('0x28')](respondWithResult(_0xbf809b,null))[_0x64c2('0x44')](handleError(_0xbf809b,null));};exports[_0x64c2('0x7e')]=function(_0xd8bbcc,_0x255cfc,_0xd51916){return db[_0x64c2('0x30')][_0x64c2('0x47')]({'where':{'id':_0xd8bbcc[_0x64c2('0x50')]['id']}})[_0x64c2('0x28')](handleEntityNotFound(_0x255cfc,null))['then'](function(_0x206a51){if(_0x206a51){return _0x206a51[_0x64c2('0x7e')](_0xd8bbcc['query'][_0x64c2('0x61')])[_0x64c2('0x28')](function(){if(_[_0x64c2('0x85')](_0xd8bbcc[_0x64c2('0x33')][_0x64c2('0x61')])){for(var _0xf08297=0x0;_0xf08297<_0xd8bbcc[_0x64c2('0x33')]['ids'][_0x64c2('0x46')];_0xf08297+=0x1){socket['emit'](_0x64c2('0x80'),{'UserId':Number(_0xd8bbcc['query']['ids'][_0xf08297]),'OpenchannelQueueId':Number(_0xd8bbcc[_0x64c2('0x50')]['id'])});}}else{socket['emit'](_0x64c2('0x80'),{'UserId':Number(_0xd8bbcc['query'][_0x64c2('0x61')]),'OpenchannelQueueId':Number(_0xd8bbcc[_0x64c2('0x50')]['id'])});}});}})[_0x64c2('0x28')](respondWithStatusCode(_0x255cfc,null))[_0x64c2('0x44')](handleError(_0x255cfc,null));};exports['getAgents']=function(_0x512f75,_0x55a963,_0x459b33){var _0x5bdd02={};var _0x56b458={};var _0x3591b6;var _0x54bcce;return db['OpenchannelQueue'][_0x64c2('0x53')]({'where':{'id':_0x512f75[_0x64c2('0x50')]['id']}})['then'](handleEntityNotFound(_0x55a963,null))[_0x64c2('0x28')](function(_0x4c528d){if(_0x4c528d){_0x3591b6=_0x4c528d;_0x56b458[_0x64c2('0x36')]=_[_0x64c2('0x32')](db['User'][_0x64c2('0x31')]);_0x56b458[_0x64c2('0x33')]=_[_0x64c2('0x32')](_0x512f75[_0x64c2('0x33')]);_0x56b458[_0x64c2('0x34')]=_[_0x64c2('0x35')](_0x56b458[_0x64c2('0x36')],_0x56b458[_0x64c2('0x33')]);_0x5bdd02[_0x64c2('0x38')]=_[_0x64c2('0x35')](_0x56b458['model'],qs[_0x64c2('0x37')](_0x512f75[_0x64c2('0x33')]['fields']));_0x5bdd02[_0x64c2('0x38')]=_0x5bdd02[_0x64c2('0x38')]['length']?_0x5bdd02[_0x64c2('0x38')]:_0x56b458[_0x64c2('0x36')];_0x5bdd02['order']=qs[_0x64c2('0x3b')](_0x512f75[_0x64c2('0x33')][_0x64c2('0x3b')]);_0x5bdd02[_0x64c2('0x3c')]=qs[_0x64c2('0x34')](_[_0x64c2('0x3d')](_0x512f75[_0x64c2('0x33')],_0x56b458['filters']));if(_0x512f75[_0x64c2('0x33')][_0x64c2('0x3e')]){_0x5bdd02['where']=_['merge'](_0x5bdd02['where'],{'$or':_[_0x64c2('0x2f')](_0x5bdd02[_0x64c2('0x38')],function(_0x113612){var _0x54d5df={};_0x54d5df[_0x113612]={'$like':'%'+_0x512f75[_0x64c2('0x33')][_0x64c2('0x3e')]+'%'};return _0x54d5df;})});}_0x5bdd02=_[_0x64c2('0x3f')]({},_0x5bdd02,_0x512f75[_0x64c2('0x40')]);return _0x3591b6[_0x64c2('0x86')](_0x5bdd02);}})['then'](function(_0x3edd19){if(_0x3edd19){_0x54bcce=_0x3edd19[_0x64c2('0x46')];if(!_0x512f75[_0x64c2('0x33')][_0x64c2('0x39')](_0x64c2('0x3a'))){_0x5bdd02[_0x64c2('0x20')]=qs[_0x64c2('0x20')](_0x512f75[_0x64c2('0x33')]['limit']);_0x5bdd02[_0x64c2('0x22')]=qs[_0x64c2('0x22')](_0x512f75['query'][_0x64c2('0x22')]);}return _0x3591b6[_0x64c2('0x86')](_0x5bdd02);}})[_0x64c2('0x28')](function(_0x457c0c){if(_0x457c0c){return _0x457c0c?{'count':_0x54bcce,'rows':_0x457c0c}:null;}})[_0x64c2('0x28')](respondWithResult(_0x55a963,null))[_0x64c2('0x44')](handleError(_0x55a963,null));}; \ No newline at end of file +var _0x3d31=['OpenchannelQueue','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','nolimit','order','sort','pick','where','merge','filter','options','includeAll','include','findAll','catch','show','params','length','find','create','body','user','get','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserOpenchannelQueue','hasOwnProperty','OpenchannelQueueId','User','findAndCountAll','UserId','agent','openchannelPause','createdAt','rows','format','SIP','updatedAt','Team','getTeams','Agents','online','voicePause','interface','flatMap','sequelize','each','findOrCreate','emit','userOpenchannelQueue:save','removeTeams','ids','select','field','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','OpenchannelQueueId\x20=\x20?','clone','push','toString','SELECT','every','TeamId','includes','all','union','compact','transaction','forEach','addAgents','omit','removeAgents','userOpenchannelQueue:remove','getAgents','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./openchannelQueue.socket','register','status','end','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','OpenchannelQueues','UserProfileResource','sendStatus','error','stack','name','index','map'];(function(_0x50ae34,_0x39a272){var _0x3af04b=function(_0x44f81a){while(--_0x44f81a){_0x50ae34['push'](_0x50ae34['shift']());}};_0x3af04b(++_0x39a272);}(_0x3d31,0xe9));var _0x13d3=function(_0x78025c,_0x3d1640){_0x78025c=_0x78025c-0x0;var _0x47ab1f=_0x3d31[_0x78025c];return _0x47ab1f;};'use strict';var emlformat=require(_0x13d3('0x0'));var rimraf=require(_0x13d3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x13d3('0x2'));var rp=require('request-promise');var moment=require(_0x13d3('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x13d3('0x4'));var util=require(_0x13d3('0x5'));var path=require(_0x13d3('0x6'));var sox=require(_0x13d3('0x7'));var csv=require('to-csv');var ejs=require(_0x13d3('0x8'));var fs=require('fs');var fs_extra=require(_0x13d3('0x9'));var _=require('lodash');var squel=require(_0x13d3('0xa'));var crypto=require(_0x13d3('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x13d3('0xc'));var toCsv=require(_0x13d3('0xd'));var querystring=require(_0x13d3('0xe'));var Papa=require(_0x13d3('0xf'));var Redis=require('ioredis');var authService=require(_0x13d3('0x10'));var qs=require(_0x13d3('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x13d3('0x12'));var logger=require('../../config/logger')(_0x13d3('0x13'));var utils=require(_0x13d3('0x14'));var config=require(_0x13d3('0x15'));var licenseUtil=require(_0x13d3('0x16'));var db=require('../../mysqldb')['db'];config[_0x13d3('0x17')]=_[_0x13d3('0x18')](config[_0x13d3('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x13d3('0x19'))(new Redis(config[_0x13d3('0x17')]));require(_0x13d3('0x1a'))[_0x13d3('0x1b')](socket);function respondWithStatusCode(_0x3ea60d,_0x2732ca){_0x2732ca=_0x2732ca||0xcc;return function(_0x322213){if(_0x322213){return _0x3ea60d['sendStatus'](_0x2732ca);}return _0x3ea60d[_0x13d3('0x1c')](_0x2732ca)[_0x13d3('0x1d')]();};}function respondWithResult(_0x460011,_0x2e9196){_0x2e9196=_0x2e9196||0xc8;return function(_0x915eb1){if(_0x915eb1){return _0x460011[_0x13d3('0x1c')](_0x2e9196)['json'](_0x915eb1);}};}function respondWithFilteredResult(_0xbcffe9,_0x4b75af){return function(_0x30a8e0){if(_0x30a8e0){var _0x31b55c=typeof _0x4b75af[_0x13d3('0x1e')]===_0x13d3('0x1f')&&typeof _0x4b75af['limit']===_0x13d3('0x1f');var _0xa5c250=_0x30a8e0[_0x13d3('0x20')];var _0x2d6264=_0x31b55c?0x0:_0x4b75af[_0x13d3('0x1e')];var _0x26666e=_0x31b55c?_0x30a8e0[_0x13d3('0x20')]:_0x4b75af[_0x13d3('0x1e')]+_0x4b75af[_0x13d3('0x21')];var _0xd820a1;if(_0x26666e>=_0xa5c250){_0x26666e=_0xa5c250;_0xd820a1=0xc8;}else{_0xd820a1=0xce;}_0xbcffe9[_0x13d3('0x1c')](_0xd820a1);return _0xbcffe9[_0x13d3('0x22')](_0x13d3('0x23'),_0x2d6264+'-'+_0x26666e+'/'+_0xa5c250)['json'](_0x30a8e0);}return null;};}function patchUpdates(_0x5ae68a){return function(_0x84b3b4){try{jsonpatch[_0x13d3('0x24')](_0x84b3b4,_0x5ae68a,!![]);}catch(_0x3c54ba){return BPromise[_0x13d3('0x25')](_0x3c54ba);}return _0x84b3b4['save']();};}function saveUpdates(_0x33f274,_0x5c11ad){return function(_0x4611ed){if(_0x4611ed){return _0x4611ed[_0x13d3('0x26')](_0x33f274)[_0x13d3('0x27')](function(_0x28a7b6){return _0x28a7b6;});}return null;};}function removeEntity(_0x3b8878,_0x1cc93a){return function(_0x3fe56e){if(_0x3fe56e){return _0x3fe56e[_0x13d3('0x28')]()[_0x13d3('0x27')](function(){var _0x1b03c6=_0x3fe56e['get']({'plain':!![]});var _0x4b8b32=_0x13d3('0x29');return db[_0x13d3('0x2a')][_0x13d3('0x28')]({'where':{'type':_0x4b8b32,'resourceId':_0x1b03c6['id']}})[_0x13d3('0x27')](function(){return _0x3fe56e;});})[_0x13d3('0x27')](function(){_0x3b8878[_0x13d3('0x1c')](0xcc)[_0x13d3('0x1d')]();});}};}function handleEntityNotFound(_0x9cd8fb,_0x16694d){return function(_0x456bd7){if(!_0x456bd7){_0x9cd8fb[_0x13d3('0x2b')](0x194);}return _0x456bd7;};}function handleError(_0x42a30e,_0x41c37e){_0x41c37e=_0x41c37e||0x1f4;return function(_0xa1b000){logger[_0x13d3('0x2c')](_0xa1b000[_0x13d3('0x2d')]);if(_0xa1b000[_0x13d3('0x2e')]){delete _0xa1b000[_0x13d3('0x2e')];}_0x42a30e[_0x13d3('0x1c')](_0x41c37e)['send'](_0xa1b000);};}exports[_0x13d3('0x2f')]=function(_0x181092,_0x433cc7){var _0x364ccb={},_0x2d4869={},_0x132481={'count':0x0,'rows':[]};var _0x16f39b=_[_0x13d3('0x30')](db[_0x13d3('0x31')][_0x13d3('0x32')],function(_0x46f7cb){return{'name':_0x46f7cb[_0x13d3('0x33')],'type':_0x46f7cb[_0x13d3('0x34')][_0x13d3('0x35')]};});_0x2d4869['model']=_[_0x13d3('0x30')](_0x16f39b,_0x13d3('0x2e'));_0x2d4869[_0x13d3('0x36')]=_[_0x13d3('0x37')](_0x181092[_0x13d3('0x36')]);_0x2d4869[_0x13d3('0x38')]=_[_0x13d3('0x39')](_0x2d4869[_0x13d3('0x3a')],_0x2d4869[_0x13d3('0x36')]);_0x364ccb['attributes']=_[_0x13d3('0x39')](_0x2d4869[_0x13d3('0x3a')],qs[_0x13d3('0x3b')](_0x181092[_0x13d3('0x36')][_0x13d3('0x3b')]));_0x364ccb['attributes']=_0x364ccb[_0x13d3('0x3c')]['length']?_0x364ccb[_0x13d3('0x3c')]:_0x2d4869['model'];if(!_0x181092['query']['hasOwnProperty'](_0x13d3('0x3d'))){_0x364ccb[_0x13d3('0x21')]=qs['limit'](_0x181092[_0x13d3('0x36')][_0x13d3('0x21')]);_0x364ccb['offset']=qs[_0x13d3('0x1e')](_0x181092['query'][_0x13d3('0x1e')]);}_0x364ccb[_0x13d3('0x3e')]=qs[_0x13d3('0x3f')](_0x181092[_0x13d3('0x36')][_0x13d3('0x3f')]);_0x364ccb['where']=qs[_0x13d3('0x38')](_[_0x13d3('0x40')](_0x181092[_0x13d3('0x36')],_0x2d4869[_0x13d3('0x38')]),_0x16f39b);if(_0x181092[_0x13d3('0x36')]['filter']){_0x364ccb[_0x13d3('0x41')]=_[_0x13d3('0x42')](_0x364ccb[_0x13d3('0x41')],{'$or':_['map'](_0x16f39b,function(_0x2dad84){if(_0x2dad84[_0x13d3('0x34')]!=='VIRTUAL'){var _0x24f9c4={};_0x24f9c4[_0x2dad84[_0x13d3('0x2e')]]={'$like':'%'+_0x181092[_0x13d3('0x36')][_0x13d3('0x43')]+'%'};return _0x24f9c4;}})});}_0x364ccb=_[_0x13d3('0x42')]({},_0x364ccb,_0x181092[_0x13d3('0x44')]);var _0x139006={'where':_0x364ccb[_0x13d3('0x41')]};return db[_0x13d3('0x31')][_0x13d3('0x20')](_0x139006)['then'](function(_0x5bbcd0){_0x132481['count']=_0x5bbcd0;if(_0x181092[_0x13d3('0x36')][_0x13d3('0x45')]){_0x364ccb[_0x13d3('0x46')]=[{'all':!![]}];}return db['OpenchannelQueue'][_0x13d3('0x47')](_0x364ccb);})['then'](function(_0x285d67){_0x132481['rows']=_0x285d67;return _0x132481;})['then'](respondWithFilteredResult(_0x433cc7,_0x364ccb))[_0x13d3('0x48')](handleError(_0x433cc7,null));};exports[_0x13d3('0x49')]=function(_0x5700b2,_0x211d64){var _0x489dfb={'raw':!![],'where':{'id':_0x5700b2[_0x13d3('0x4a')]['id']}},_0x51e10c={};_0x51e10c[_0x13d3('0x3a')]=_[_0x13d3('0x37')](db[_0x13d3('0x31')]['rawAttributes']);_0x51e10c[_0x13d3('0x36')]=_[_0x13d3('0x37')](_0x5700b2[_0x13d3('0x36')]);_0x51e10c['filters']=_[_0x13d3('0x39')](_0x51e10c[_0x13d3('0x3a')],_0x51e10c[_0x13d3('0x36')]);_0x489dfb[_0x13d3('0x3c')]=_[_0x13d3('0x39')](_0x51e10c['model'],qs[_0x13d3('0x3b')](_0x5700b2[_0x13d3('0x36')][_0x13d3('0x3b')]));_0x489dfb['attributes']=_0x489dfb['attributes'][_0x13d3('0x4b')]?_0x489dfb[_0x13d3('0x3c')]:_0x51e10c[_0x13d3('0x3a')];if(_0x5700b2['query'][_0x13d3('0x45')]){_0x489dfb[_0x13d3('0x46')]=[{'all':!![]}];}_0x489dfb=_[_0x13d3('0x42')]({},_0x489dfb,_0x5700b2[_0x13d3('0x44')]);return db['OpenchannelQueue'][_0x13d3('0x4c')](_0x489dfb)[_0x13d3('0x27')](handleEntityNotFound(_0x211d64,null))[_0x13d3('0x27')](respondWithResult(_0x211d64,null))[_0x13d3('0x48')](handleError(_0x211d64,null));};exports[_0x13d3('0x4d')]=function(_0x1e2af3,_0x2976cb){return db['OpenchannelQueue'][_0x13d3('0x4d')](_0x1e2af3[_0x13d3('0x4e')],{})[_0x13d3('0x27')](function(_0xe1f0fc){var _0x427100=_0x1e2af3[_0x13d3('0x4f')][_0x13d3('0x50')]({'plain':!![]});if(!_0x427100)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x427100[_0x13d3('0x51')]==='user'){var _0xc9c726=_0xe1f0fc['get']({'plain':!![]});var _0x3c330e='OpenchannelQueues';return db[_0x13d3('0x52')][_0x13d3('0x4c')]({'where':{'name':_0x3c330e,'userProfileId':_0x427100[_0x13d3('0x53')]},'raw':!![]})['then'](function(_0x506ade){if(_0x506ade&&_0x506ade[_0x13d3('0x54')]===0x0){return db[_0x13d3('0x2a')]['create']({'name':_0xc9c726['name'],'resourceId':_0xc9c726['id'],'type':_0x506ade[_0x13d3('0x2e')],'sectionId':_0x506ade['id']},{})['then'](function(){return _0xe1f0fc;});}else{return _0xe1f0fc;}})[_0x13d3('0x48')](function(_0x164eca){logger['error'](_0x13d3('0x55'),_0x164eca);throw _0x164eca;});}return _0xe1f0fc;})[_0x13d3('0x27')](respondWithResult(_0x2976cb,0xc9))[_0x13d3('0x48')](handleError(_0x2976cb,null));};exports[_0x13d3('0x26')]=function(_0x5a398b,_0x390c60){if(_0x5a398b[_0x13d3('0x4e')]['id']){delete _0x5a398b[_0x13d3('0x4e')]['id'];}return db['OpenchannelQueue'][_0x13d3('0x4c')]({'where':{'id':_0x5a398b['params']['id']}})[_0x13d3('0x27')](handleEntityNotFound(_0x390c60,null))['then'](saveUpdates(_0x5a398b['body'],null))[_0x13d3('0x27')](respondWithResult(_0x390c60,null))[_0x13d3('0x48')](handleError(_0x390c60,null));};exports[_0x13d3('0x28')]=function(_0x4ab044,_0x2e4aa5){return db['OpenchannelQueue']['find']({'where':{'id':_0x4ab044['params']['id']}})['then'](handleEntityNotFound(_0x2e4aa5,null))[_0x13d3('0x27')](removeEntity(_0x2e4aa5,null))[_0x13d3('0x48')](handleError(_0x2e4aa5,null));};exports['describe']=function(_0x2cf2a8,_0x45f8be){return db['OpenchannelQueue'][_0x13d3('0x56')]()[_0x13d3('0x27')](respondWithResult(_0x45f8be,null))[_0x13d3('0x48')](handleError(_0x45f8be,null));};exports[_0x13d3('0x57')]=function(_0x7b80c3,_0x13653c,_0x2b5e68){var _0x4bb051={'raw':!![],'where':{}},_0x2dbfeb={},_0x31929c;return db[_0x13d3('0x31')][_0x13d3('0x58')]({'where':{'id':_0x7b80c3[_0x13d3('0x4a')]['id']}})[_0x13d3('0x27')](handleEntityNotFound(_0x13653c,null))['then'](function(_0x3eb53a){if(_0x3eb53a){_0x31929c=_0x3eb53a[_0x13d3('0x50')]({'plain':!![]});_0x2dbfeb[_0x13d3('0x3a')]=_[_0x13d3('0x37')](db[_0x13d3('0x59')][_0x13d3('0x32')]);_0x2dbfeb[_0x13d3('0x36')]=_['keys'](_0x7b80c3['query']);_0x2dbfeb['filters']=_[_0x13d3('0x39')](_0x2dbfeb[_0x13d3('0x3a')],_0x2dbfeb[_0x13d3('0x36')]);_0x4bb051[_0x13d3('0x3c')]=_[_0x13d3('0x39')](_0x2dbfeb['model'],qs[_0x13d3('0x3b')](_0x7b80c3['query'][_0x13d3('0x3b')]));_0x4bb051['attributes']=_0x4bb051['attributes']['length']?_0x4bb051['attributes']:_0x2dbfeb[_0x13d3('0x3a')];if(!_0x7b80c3['query'][_0x13d3('0x5a')](_0x13d3('0x3d'))){_0x4bb051[_0x13d3('0x21')]=qs['limit'](_0x7b80c3[_0x13d3('0x36')]['limit']);_0x4bb051[_0x13d3('0x1e')]=qs[_0x13d3('0x1e')](_0x7b80c3[_0x13d3('0x36')][_0x13d3('0x1e')]);}_0x4bb051['order']=qs['sort'](_0x7b80c3[_0x13d3('0x36')][_0x13d3('0x3f')]);_0x4bb051[_0x13d3('0x41')]=qs[_0x13d3('0x38')](_['pick'](_0x7b80c3[_0x13d3('0x36')],_0x2dbfeb[_0x13d3('0x38')]));_0x4bb051[_0x13d3('0x41')][_0x13d3('0x5b')]=_0x3eb53a['id'];if(_0x7b80c3[_0x13d3('0x36')][_0x13d3('0x43')]){_0x4bb051[_0x13d3('0x41')]=_['merge'](_0x4bb051[_0x13d3('0x41')],{'$or':_['map'](_0x4bb051[_0x13d3('0x3c')],function(_0x2edbad){var _0x4d42c2={};_0x4d42c2[_0x2edbad]={'$like':'%'+_0x7b80c3['query']['filter']+'%'};return _0x4d42c2;})});}_0x4bb051=_[_0x13d3('0x42')]({},_0x4bb051,_0x7b80c3['options']);return db['UserOpenchannelQueue'][_0x13d3('0x47')](_0x4bb051);}})[_0x13d3('0x27')](function(_0x352983){if(_0x352983){return db[_0x13d3('0x5c')][_0x13d3('0x5d')]({'where':{'id':_[_0x13d3('0x30')](_0x352983,_0x13d3('0x5e')),'role':_0x13d3('0x5f')},'attributes':['id',_0x13d3('0x2e'),_0x13d3('0x60'),'updatedAt',_0x13d3('0x61')]});}})[_0x13d3('0x27')](function(_0x5c5495){if(_0x5c5495){return{'count':_0x5c5495[_0x13d3('0x20')],'rows':_['map'](_0x5c5495[_0x13d3('0x62')],function(_0x1f179d){return{'membername':_0x1f179d[_0x13d3('0x2e')],'UserId':_0x1f179d['id'],'queue_name':_0x31929c[_0x13d3('0x2e')],'OpenchannelQueueId':_0x31929c['id'],'interface':util[_0x13d3('0x63')]('%s/%s',_0x13d3('0x64'),_0x1f179d[_0x13d3('0x2e')]),'penalty':0x0,'paused':_0x1f179d['openchannelPause'],'createdAt':_0x1f179d[_0x13d3('0x61')],'updatedAt':_0x1f179d[_0x13d3('0x65')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x13653c,_0x4bb051))[_0x13d3('0x48')](handleError(_0x13653c,null));};exports['getTeams']=function(_0x47c375,_0x530b97,_0x52c125){var _0x568cb3={};var _0x366ea8={};var _0x45589b;var _0x2abc10;return db[_0x13d3('0x31')][_0x13d3('0x58')]({'where':{'id':_0x47c375[_0x13d3('0x4a')]['id']}})[_0x13d3('0x27')](handleEntityNotFound(_0x530b97,null))[_0x13d3('0x27')](function(_0x4bfa66){if(_0x4bfa66){_0x45589b=_0x4bfa66;_0x366ea8[_0x13d3('0x3a')]=_[_0x13d3('0x37')](db[_0x13d3('0x66')]['rawAttributes']);_0x366ea8[_0x13d3('0x36')]=_[_0x13d3('0x37')](_0x47c375[_0x13d3('0x36')]);_0x366ea8['filters']=_[_0x13d3('0x39')](_0x366ea8[_0x13d3('0x3a')],_0x366ea8['query']);_0x568cb3['attributes']=_[_0x13d3('0x39')](_0x366ea8['model'],qs[_0x13d3('0x3b')](_0x47c375[_0x13d3('0x36')][_0x13d3('0x3b')]));_0x568cb3[_0x13d3('0x3c')]=_0x568cb3[_0x13d3('0x3c')][_0x13d3('0x4b')]?_0x568cb3['attributes']:_0x366ea8['model'];_0x568cb3[_0x13d3('0x3e')]=qs['sort'](_0x47c375[_0x13d3('0x36')][_0x13d3('0x3f')]);_0x568cb3[_0x13d3('0x41')]=qs[_0x13d3('0x38')](_[_0x13d3('0x40')](_0x47c375[_0x13d3('0x36')],_0x366ea8[_0x13d3('0x38')]));if(_0x47c375[_0x13d3('0x36')][_0x13d3('0x43')]){_0x568cb3[_0x13d3('0x41')]=_[_0x13d3('0x42')](_0x568cb3[_0x13d3('0x41')],{'$or':_[_0x13d3('0x30')](_0x568cb3['attributes'],function(_0x2a20fd){var _0x4e88e2={};_0x4e88e2[_0x2a20fd]={'$like':'%'+_0x47c375[_0x13d3('0x36')]['filter']+'%'};return _0x4e88e2;})});}_0x568cb3=_['merge']({},_0x568cb3,_0x47c375[_0x13d3('0x44')]);return _0x45589b[_0x13d3('0x67')](_0x568cb3);}})[_0x13d3('0x27')](function(_0x449dd2){if(_0x449dd2){_0x2abc10=_0x449dd2[_0x13d3('0x4b')];if(!_0x47c375['query'][_0x13d3('0x5a')](_0x13d3('0x3d'))){_0x568cb3[_0x13d3('0x21')]=qs[_0x13d3('0x21')](_0x47c375[_0x13d3('0x36')][_0x13d3('0x21')]);_0x568cb3[_0x13d3('0x1e')]=qs[_0x13d3('0x1e')](_0x47c375[_0x13d3('0x36')][_0x13d3('0x1e')]);}return _0x45589b['getTeams'](_0x568cb3);}})[_0x13d3('0x27')](function(_0x42ff1c){if(_0x42ff1c){return _0x42ff1c?{'count':_0x2abc10,'rows':_0x42ff1c}:null;}})['then'](respondWithResult(_0x530b97,null))[_0x13d3('0x48')](handleError(_0x530b97,null));};exports['addTeams']=function(_0x433142,_0x216a44,_0x2ade8d){var _0x1fa03c=_0x433142[_0x13d3('0x4e')]['ids'];return db[_0x13d3('0x66')]['findAll']({'where':{'id':_0x1fa03c},'attributes':['id'],'include':[{'model':db[_0x13d3('0x5c')],'as':_0x13d3('0x68'),'attributes':['id',_0x13d3('0x2e'),_0x13d3('0x69'),_0x13d3('0x6a'),_0x13d3('0x6b')],'raw':!![]}]})[_0x13d3('0x27')](function(_0x47947e){if(_0x47947e){var _0x131dbb=_[_0x13d3('0x6c')](_0x47947e,function(_0x5f3f7b){var _0x27e00c=_0x5f3f7b[_0x13d3('0x50')]({'plain':!![]});return _0x27e00c[_0x13d3('0x68')];});return db[_0x13d3('0x31')][_0x13d3('0x4c')]({'where':{'id':_0x433142[_0x13d3('0x4a')]['id']}})[_0x13d3('0x27')](function(_0xd00bb4){return db[_0x13d3('0x6d')]['transaction'](function(_0x4fb433){return _0xd00bb4['addTeams'](_0x1fa03c,{'transaction':_0x4fb433})[_0x13d3('0x27')](function(){return BPromise[_0x13d3('0x6e')](_0x131dbb,function(_0x1c88b5){return db[_0x13d3('0x59')][_0x13d3('0x6f')]({'where':{'UserId':_0x1c88b5['id'],'OpenchannelQueueId':_0x433142[_0x13d3('0x4a')]['id']},'transaction':_0x4fb433});});})[_0x13d3('0x27')](function(){_0x131dbb['forEach'](function(_0x403a3c){socket[_0x13d3('0x70')](_0x13d3('0x71'),{'UserId':_0x403a3c['id'],'OpenchannelQueueId':_0xd00bb4['id']});});});});});}})[_0x13d3('0x27')](respondWithStatusCode(_0x216a44,null))[_0x13d3('0x48')](handleError(_0x216a44,null));};exports[_0x13d3('0x72')]=function(_0xbc72f3,_0x1895a6,_0x42c397){return db[_0x13d3('0x66')][_0x13d3('0x47')]({'where':{'id':_0xbc72f3['query'][_0x13d3('0x73')]},'attributes':['id'],'include':[{'model':db[_0x13d3('0x5c')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x13d3('0x27')](handleEntityNotFound(_0x1895a6,null))['then'](function(_0x354d6a){var _0x517ee=_[_0x13d3('0x30')](_0x354d6a,'id');var _0xfbc426=[];var _0x34944e=[];var _0xe6400e=squel[_0x13d3('0x74')]();_0xe6400e[_0x13d3('0x75')](_0x13d3('0x76'))[_0x13d3('0x77')](_0x13d3('0x78'),'tq')[_0x13d3('0x79')](_0x13d3('0x7a'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x13d3('0x41')](_0x13d3('0x7b'),_0xbc72f3[_0x13d3('0x4a')]['id']);for(var _0x5c4b84=0x0;_0x5c4b84<_0x354d6a['length'];_0x5c4b84+=0x1){let _0x1041b5=_0x354d6a[_0x5c4b84];for(var _0x5e41bd=0x0;_0x5e41bd<_0x1041b5[_0x13d3('0x68')][_0x13d3('0x4b')];_0x5e41bd+=0x1){let _0x5d1c17=_0x1041b5[_0x13d3('0x68')][_0x5e41bd];var _0x14d476=_0xe6400e[_0x13d3('0x7c')]();_0x14d476['where']('ut.UserId\x20=\x20?',_0x5d1c17['id']);_0x34944e[_0x13d3('0x7d')](db[_0x13d3('0x6d')][_0x13d3('0x36')](_0x14d476[_0x13d3('0x7e')](),{'type':db[_0x13d3('0x6d')]['QueryTypes'][_0x13d3('0x7f')]})[_0x13d3('0x27')](function(_0x3305cf){if(_0x3305cf[_0x13d3('0x4b')]===0x1){return _0x5d1c17['id'];}else{var _0x283e98=_[_0x13d3('0x80')](_[_0x13d3('0x30')](_0x3305cf,_0x13d3('0x81')),function(_0x202a4d){return _[_0x13d3('0x82')](_0x517ee,_0x202a4d);});if(_0x283e98){return _0x5d1c17['id'];}}}));}}return BPromise[_0x13d3('0x83')](_0x34944e)['then'](function(_0x137a30){_0xfbc426=_(_0xfbc426)[_0x13d3('0x84')](_0x137a30)[_0x13d3('0x85')]()['value']();return db[_0x13d3('0x31')][_0x13d3('0x4c')]({'where':{'id':_0xbc72f3[_0x13d3('0x4a')]['id']}})[_0x13d3('0x27')](function(_0x1e9668){return db[_0x13d3('0x6d')][_0x13d3('0x86')](function(_0x323172){return _0x1e9668[_0x13d3('0x72')](_0xbc72f3['query'][_0x13d3('0x73')],{'transaction':_0x323172})[_0x13d3('0x27')](function(){if(!_['isEmpty'](_0xfbc426)){return _0x1e9668['removeAgents'](_0xfbc426,{'transaction':_0x323172});}})[_0x13d3('0x27')](function(){_0xfbc426[_0x13d3('0x87')](function(_0x1e87f3){socket[_0x13d3('0x70')]('userOpenchannelQueue:remove',{'UserId':_0x1e87f3,'OpenchannelQueueId':_0x1e9668['id']});});});});});});})[_0x13d3('0x27')](respondWithStatusCode(_0x1895a6,null))[_0x13d3('0x48')](handleError(_0x1895a6,null));};exports[_0x13d3('0x88')]=function(_0x51497d,_0x5163bd,_0x121545){return db[_0x13d3('0x31')][_0x13d3('0x4c')]({'where':{'id':_0x51497d[_0x13d3('0x4a')]['id']}})[_0x13d3('0x27')](handleEntityNotFound(_0x5163bd,null))[_0x13d3('0x27')](function(_0x17978b){if(_0x17978b){return _0x17978b[_0x13d3('0x88')](_0x51497d[_0x13d3('0x4e')][_0x13d3('0x73')],_[_0x13d3('0x89')](_0x51497d[_0x13d3('0x4e')],['ids','id'])||{})['spread'](function(_0x550f57){for(var _0x4bd979=0x0;_0x4bd979<_0x51497d['body'][_0x13d3('0x73')][_0x13d3('0x4b')];_0x4bd979+=0x1){socket[_0x13d3('0x70')](_0x13d3('0x71'),{'UserId':Number(_0x51497d['body'][_0x13d3('0x73')][_0x4bd979]),'OpenchannelQueueId':Number(_0x51497d[_0x13d3('0x4a')]['id'])});}return _0x550f57;});}})[_0x13d3('0x27')](respondWithResult(_0x5163bd,null))['catch'](handleError(_0x5163bd,null));};exports[_0x13d3('0x8a')]=function(_0x1260db,_0x5dd32f,_0x4842cb){return db[_0x13d3('0x31')]['find']({'where':{'id':_0x1260db[_0x13d3('0x4a')]['id']}})[_0x13d3('0x27')](handleEntityNotFound(_0x5dd32f,null))[_0x13d3('0x27')](function(_0x5c9993){if(_0x5c9993){return _0x5c9993['removeAgents'](_0x1260db[_0x13d3('0x36')][_0x13d3('0x73')])[_0x13d3('0x27')](function(){if(_['isArray'](_0x1260db[_0x13d3('0x36')]['ids'])){for(var _0x2d3a83=0x0;_0x2d3a83<_0x1260db[_0x13d3('0x36')][_0x13d3('0x73')]['length'];_0x2d3a83+=0x1){socket[_0x13d3('0x70')]('userOpenchannelQueue:remove',{'UserId':Number(_0x1260db[_0x13d3('0x36')][_0x13d3('0x73')][_0x2d3a83]),'OpenchannelQueueId':Number(_0x1260db[_0x13d3('0x4a')]['id'])});}}else{socket[_0x13d3('0x70')](_0x13d3('0x8b'),{'UserId':Number(_0x1260db[_0x13d3('0x36')][_0x13d3('0x73')]),'OpenchannelQueueId':Number(_0x1260db[_0x13d3('0x4a')]['id'])});}});}})[_0x13d3('0x27')](respondWithStatusCode(_0x5dd32f,null))[_0x13d3('0x48')](handleError(_0x5dd32f,null));};exports[_0x13d3('0x8c')]=function(_0x2d9652,_0x16f04f,_0x5126ac){var _0x123b00={};var _0x2710ca={};var _0x2cea90;var _0x218e09;return db[_0x13d3('0x31')][_0x13d3('0x58')]({'where':{'id':_0x2d9652['params']['id']}})[_0x13d3('0x27')](handleEntityNotFound(_0x16f04f,null))[_0x13d3('0x27')](function(_0x5f578f){if(_0x5f578f){_0x2cea90=_0x5f578f;_0x2710ca[_0x13d3('0x3a')]=_[_0x13d3('0x37')](db[_0x13d3('0x5c')]['rawAttributes']);_0x2710ca[_0x13d3('0x36')]=_[_0x13d3('0x37')](_0x2d9652[_0x13d3('0x36')]);_0x2710ca[_0x13d3('0x38')]=_['intersection'](_0x2710ca[_0x13d3('0x3a')],_0x2710ca[_0x13d3('0x36')]);_0x123b00['attributes']=_[_0x13d3('0x39')](_0x2710ca[_0x13d3('0x3a')],qs[_0x13d3('0x3b')](_0x2d9652['query'][_0x13d3('0x3b')]));_0x123b00[_0x13d3('0x3c')]=_0x123b00[_0x13d3('0x3c')][_0x13d3('0x4b')]?_0x123b00[_0x13d3('0x3c')]:_0x2710ca[_0x13d3('0x3a')];_0x123b00[_0x13d3('0x3e')]=qs['sort'](_0x2d9652['query'][_0x13d3('0x3f')]);_0x123b00[_0x13d3('0x41')]=qs[_0x13d3('0x38')](_[_0x13d3('0x40')](_0x2d9652['query'],_0x2710ca[_0x13d3('0x38')]));if(_0x2d9652[_0x13d3('0x36')]['filter']){_0x123b00['where']=_[_0x13d3('0x42')](_0x123b00[_0x13d3('0x41')],{'$or':_[_0x13d3('0x30')](_0x123b00[_0x13d3('0x3c')],function(_0x36add6){var _0x560634={};_0x560634[_0x36add6]={'$like':'%'+_0x2d9652[_0x13d3('0x36')]['filter']+'%'};return _0x560634;})});}_0x123b00=_[_0x13d3('0x42')]({},_0x123b00,_0x2d9652[_0x13d3('0x44')]);return _0x2cea90[_0x13d3('0x8c')](_0x123b00);}})[_0x13d3('0x27')](function(_0x16d975){if(_0x16d975){_0x218e09=_0x16d975[_0x13d3('0x4b')];if(!_0x2d9652[_0x13d3('0x36')]['hasOwnProperty'](_0x13d3('0x3d'))){_0x123b00[_0x13d3('0x21')]=qs[_0x13d3('0x21')](_0x2d9652[_0x13d3('0x36')]['limit']);_0x123b00[_0x13d3('0x1e')]=qs[_0x13d3('0x1e')](_0x2d9652[_0x13d3('0x36')][_0x13d3('0x1e')]);}return _0x2cea90[_0x13d3('0x8c')](_0x123b00);}})[_0x13d3('0x27')](function(_0xe5b5e0){if(_0xe5b5e0){return _0xe5b5e0?{'count':_0x218e09,'rows':_0xe5b5e0}:null;}})[_0x13d3('0x27')](respondWithResult(_0x16f04f,null))[_0x13d3('0x48')](handleError(_0x16f04f,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 2e4b915..d8dcd0e 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 _0x2905=['emit','hasOwnProperty','exports','events','setMaxListeners','save'];(function(_0x4f2f93,_0x22320b){var _0x5cab22=function(_0x3fd477){while(--_0x3fd477){_0x4f2f93['push'](_0x4f2f93['shift']());}};_0x5cab22(++_0x22320b);}(_0x2905,0x1e9));var _0x5290=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x2905[_0xa464c9];return _0x3d73c4;};'use strict';var EventEmitter=require(_0x5290('0x0'));var OpenchannelQueue=require('../../mysqldb')['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x5290('0x1')](0x0);var events={'afterCreate':_0x5290('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x12289d){return function(_0x4ee657,_0xaacbb0,_0x476623){OpenchannelQueueEvents[_0x5290('0x3')](_0x12289d+':'+_0x4ee657['id'],_0x4ee657);OpenchannelQueueEvents['emit'](_0x12289d,_0x4ee657);_0x476623(null);};}for(var e in events){if(events[_0x5290('0x4')](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module[_0x5290('0x5')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x7278=['../../mysqldb','setMaxListeners','save','emit','hook','exports'];(function(_0x41bd53,_0x264e51){var _0x326e7f=function(_0x593704){while(--_0x593704){_0x41bd53['push'](_0x41bd53['shift']());}};_0x326e7f(++_0x264e51);}(_0x7278,0x1da));var _0x8727=function(_0x5c667e,_0x41c26d){_0x5c667e=_0x5c667e-0x0;var _0x1a5c4e=_0x7278[_0x5c667e];return _0x1a5c4e;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0x8727('0x0'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x8727('0x1')](0x0);var events={'afterCreate':_0x8727('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4d2eb8){return function(_0x4cbe80,_0x2282f5,_0x1f15bb){OpenchannelQueueEvents[_0x8727('0x3')](_0x4d2eb8+':'+_0x4cbe80['id'],_0x4cbe80);OpenchannelQueueEvents[_0x8727('0x3')](_0x4d2eb8,_0x4cbe80);_0x1f15bb(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0x8727('0x4')](e,emitEvent(event));}}module[_0x8727('0x5')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index c3c9aed..9f5b12e 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 _0x286a=['openchannel_queues','lodash','util','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x286a,0xfe));var _0xa286=function(_0x127a22,_0x1be8de){_0x127a22=_0x127a22-0x0;var _0x58335b=_0x286a[_0x127a22];return _0x58335b;};'use strict';var _=require(_0xa286('0x0'));var util=require(_0xa286('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa286('0x2'));var fs=require('fs');var path=require(_0xa286('0x3'));var rimraf=require(_0xa286('0x4'));var config=require(_0xa286('0x5'));var attributes=require(_0xa286('0x6'));module[_0xa286('0x7')]=function(_0x3607dd,_0x3821fe){return _0x3607dd[_0xa286('0x8')](_0xa286('0x9'),attributes,{'tableName':_0xa286('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1458=['util','../../config/logger','api','moment','request-promise','rimraf','./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues'];(function(_0x53b8cb,_0x492f0f){var _0xece5b1=function(_0x238ee9){while(--_0x238ee9){_0x53b8cb['push'](_0x53b8cb['shift']());}};_0xece5b1(++_0x492f0f);}(_0x1458,0x1ce));var _0x8145=function(_0x28a1a4,_0x1ef9e5){_0x28a1a4=_0x28a1a4-0x0;var _0x466964=_0x1458[_0x28a1a4];return _0x466964;};'use strict';var _=require('lodash');var util=require(_0x8145('0x0'));var logger=require(_0x8145('0x1'))(_0x8145('0x2'));var moment=require(_0x8145('0x3'));var BPromise=require('bluebird');var rp=require(_0x8145('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8145('0x5'));var config=require('../../config/environment');var attributes=require(_0x8145('0x6'));module[_0x8145('0x7')]=function(_0x56ccb2,_0x558a5c){return _0x56ccb2[_0x8145('0x8')](_0x8145('0x9'),attributes,{'tableName':_0x8145('0xa'),'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 ac6a884..2f02173 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 _0xc3df=['model','debug','stringify','ShowOpenchannelQueue','OpenchannelQueue','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','defaults','redis','socket.io-emitter','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetOpenchannelQueue','findAll','options','raw','attributes','include','map'];(function(_0x3fae35,_0x5a2b36){var _0x1fda09=function(_0x420573){while(--_0x420573){_0x3fae35['push'](_0x3fae35['shift']());}};_0x1fda09(++_0x5a2b36);}(_0xc3df,0x95));var _0xfc3d=function(_0x39e1f0,_0x560848){_0x39e1f0=_0x39e1f0-0x0;var _0x240e82=_0xc3df[_0x39e1f0];return _0x240e82;};'use strict';var _=require(_0xfc3d('0x0'));var util=require(_0xfc3d('0x1'));var moment=require(_0xfc3d('0x2'));var BPromise=require('bluebird');var rs=require(_0xfc3d('0x3'));var fs=require('fs');var Redis=require(_0xfc3d('0x4'));var db=require(_0xfc3d('0x5'))['db'];var utils=require(_0xfc3d('0x6'));var logger=require(_0xfc3d('0x7'))(_0xfc3d('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfc3d('0x9')]['http']({'port':0x232a});config['redis']=_[_0xfc3d('0xa')](config[_0xfc3d('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xfc3d('0xc'))(new Redis(config[_0xfc3d('0xb')]));require('./openchannelQueue.socket')[_0xfc3d('0xd')](socket);function respondWithRpcPromise(_0xafbf15,_0x3602e1,_0x99fe8){return new BPromise(function(_0x2d0c61,_0x49a333){return client[_0xfc3d('0xe')](_0xafbf15,_0x99fe8)[_0xfc3d('0xf')](function(_0x57cd69){logger[_0xfc3d('0x10')](_0xfc3d('0x11'),_0x3602e1,_0xfc3d('0x12'));logger['debug'](_0xfc3d('0x13'),_0x3602e1,_0xfc3d('0x12'),JSON['stringify'](_0x57cd69));if(_0x57cd69[_0xfc3d('0x14')]){if(_0x57cd69[_0xfc3d('0x14')][_0xfc3d('0x15')]===0x1f4){logger[_0xfc3d('0x14')](_0xfc3d('0x11'),_0x3602e1,_0x57cd69['error'][_0xfc3d('0x16')]);return _0x49a333(_0x57cd69[_0xfc3d('0x14')][_0xfc3d('0x16')]);}logger['error'](_0xfc3d('0x11'),_0x3602e1,_0x57cd69['error'][_0xfc3d('0x16')]);return _0x2d0c61(_0x57cd69[_0xfc3d('0x14')][_0xfc3d('0x16')]);}else{logger[_0xfc3d('0x10')]('OpenchannelQueue,\x20%s,\x20%s',_0x3602e1,_0xfc3d('0x12'));_0x2d0c61(_0x57cd69['result'][_0xfc3d('0x16')]);}})[_0xfc3d('0x17')](function(_0x9611ac){logger[_0xfc3d('0x14')](_0xfc3d('0x11'),_0x3602e1,_0x9611ac);_0x49a333(_0x9611ac);});});}exports[_0xfc3d('0x18')]=function(_0x297c8e){var _0x29a47b=this;return new Promise(function(_0x521c21,_0x2502c5){return db['OpenchannelQueue'][_0xfc3d('0x19')]({'raw':_0x297c8e[_0xfc3d('0x1a')]?_0x297c8e[_0xfc3d('0x1a')][_0xfc3d('0x1b')]===undefined?!![]:![]:!![],'where':_0x297c8e[_0xfc3d('0x1a')]?_0x297c8e['options']['where']||null:null,'attributes':_0x297c8e[_0xfc3d('0x1a')]?_0x297c8e['options'][_0xfc3d('0x1c')]||null:null,'limit':_0x297c8e['options']?_0x297c8e[_0xfc3d('0x1a')]['limit']||null:null,'include':_0x297c8e['options']?_0x297c8e['options'][_0xfc3d('0x1d')]?_[_0xfc3d('0x1e')](_0x297c8e[_0xfc3d('0x1a')][_0xfc3d('0x1d')],function(_0x4b8378){return{'model':db[_0x4b8378['model']],'as':_0x4b8378['as'],'attributes':_0x4b8378['attributes'],'include':_0x4b8378[_0xfc3d('0x1d')]?_[_0xfc3d('0x1e')](_0x4b8378['include'],function(_0x202a93){return{'model':db[_0x202a93['model']],'as':_0x202a93['as'],'attributes':_0x202a93['attributes'],'include':_0x202a93[_0xfc3d('0x1d')]?_[_0xfc3d('0x1e')](_0x202a93[_0xfc3d('0x1d')],function(_0x14c7bb){return{'model':db[_0x14c7bb[_0xfc3d('0x1f')]],'as':_0x14c7bb['as'],'attributes':_0x14c7bb[_0xfc3d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xfc3d('0xf')](function(_0x1fd228){logger[_0xfc3d('0x10')]('GetOpenchannelQueue',_0x297c8e);logger[_0xfc3d('0x20')](_0xfc3d('0x18'),_0x297c8e,JSON[_0xfc3d('0x21')](_0x1fd228));_0x521c21(_0x1fd228);})[_0xfc3d('0x17')](function(_0x5e2282){logger['error'](_0xfc3d('0x18'),_0x5e2282[_0xfc3d('0x16')],_0x297c8e);_0x2502c5(_0x29a47b[_0xfc3d('0x14')](0x1f4,_0x5e2282[_0xfc3d('0x16')]));});});};exports[_0xfc3d('0x22')]=function(_0x31b629){var _0x234a38=this;return new Promise(function(_0x3f6d00,_0x420067){return db[_0xfc3d('0x23')]['find']({'raw':_0x31b629['options']?_0x31b629[_0xfc3d('0x1a')][_0xfc3d('0x1b')]===undefined?!![]:![]:!![],'where':_0x31b629[_0xfc3d('0x1a')]?_0x31b629[_0xfc3d('0x1a')]['where']||null:null,'attributes':_0x31b629['options']?_0x31b629['options'][_0xfc3d('0x1c')]||null:null,'include':_0x31b629['options']?_0x31b629[_0xfc3d('0x1a')][_0xfc3d('0x1d')]?_['map'](_0x31b629[_0xfc3d('0x1a')][_0xfc3d('0x1d')],function(_0x4d3a3c){return{'model':db[_0x4d3a3c['model']],'as':_0x4d3a3c['as'],'attributes':_0x4d3a3c[_0xfc3d('0x1c')],'include':_0x4d3a3c[_0xfc3d('0x1d')]?_[_0xfc3d('0x1e')](_0x4d3a3c[_0xfc3d('0x1d')],function(_0x4a589b){return{'model':db[_0x4a589b[_0xfc3d('0x1f')]],'as':_0x4a589b['as'],'attributes':_0x4a589b[_0xfc3d('0x1c')],'include':_0x4a589b[_0xfc3d('0x1d')]?_[_0xfc3d('0x1e')](_0x4a589b['include'],function(_0x5dfdcb){return{'model':db[_0x5dfdcb[_0xfc3d('0x1f')]],'as':_0x5dfdcb['as'],'attributes':_0x5dfdcb[_0xfc3d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xfc3d('0xf')](function(_0x36ac89){logger[_0xfc3d('0x10')]('ShowOpenchannelQueue',_0x31b629);logger['debug'](_0xfc3d('0x22'),_0x31b629,JSON[_0xfc3d('0x21')](_0x36ac89));_0x3f6d00(_0x36ac89);})[_0xfc3d('0x17')](function(_0x3282fd){logger[_0xfc3d('0x14')](_0xfc3d('0x22'),_0x3282fd[_0xfc3d('0x16')],_0x31b629);_0x420067(_0x234a38['error'](0x1f4,_0x3282fd[_0xfc3d('0x16')]));});});}; \ No newline at end of file +var _0x20bb=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','options','raw','where','attributes','limit','include','map','model','GetOpenchannelQueue','OpenchannelQueue','find','ShowOpenchannelQueue','stringify','lodash','moment','bluebird','randomstring'];(function(_0x39e84d,_0x11931d){var _0x1991bc=function(_0xc81e32){while(--_0xc81e32){_0x39e84d['push'](_0x39e84d['shift']());}};_0x1991bc(++_0x11931d);}(_0x20bb,0x13c));var _0xb20b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x20bb[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb20b('0x0'));var util=require('util');var moment=require(_0xb20b('0x1'));var BPromise=require(_0xb20b('0x2'));var rs=require(_0xb20b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb20b('0x4'))['db'];var utils=require(_0xb20b('0x5'));var logger=require(_0xb20b('0x6'))(_0xb20b('0x7'));var config=require('../../config/environment');var jayson=require(_0xb20b('0x8'));var client=jayson['client'][_0xb20b('0x9')]({'port':0x232a});config[_0xb20b('0xa')]=_[_0xb20b('0xb')](config[_0xb20b('0xa')],{'host':_0xb20b('0xc'),'port':0x18eb});var socket=require(_0xb20b('0xd'))(new Redis(config[_0xb20b('0xa')]));require(_0xb20b('0xe'))[_0xb20b('0xf')](socket);function respondWithRpcPromise(_0x160012,_0x116a68,_0x323c02){return new BPromise(function(_0x2b5693,_0x546122){return client['request'](_0x160012,_0x323c02)[_0xb20b('0x10')](function(_0x12f91d){logger[_0xb20b('0x11')](_0xb20b('0x12'),_0x116a68,_0xb20b('0x13'));logger[_0xb20b('0x14')](_0xb20b('0x15'),_0x116a68,'request\x20sent',JSON['stringify'](_0x12f91d));if(_0x12f91d['error']){if(_0x12f91d[_0xb20b('0x16')][_0xb20b('0x17')]===0x1f4){logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x116a68,_0x12f91d[_0xb20b('0x16')][_0xb20b('0x18')]);return _0x546122(_0x12f91d['error'][_0xb20b('0x18')]);}logger[_0xb20b('0x16')](_0xb20b('0x12'),_0x116a68,_0x12f91d[_0xb20b('0x16')][_0xb20b('0x18')]);return _0x2b5693(_0x12f91d['error'][_0xb20b('0x18')]);}else{logger[_0xb20b('0x11')]('OpenchannelQueue,\x20%s,\x20%s',_0x116a68,_0xb20b('0x13'));_0x2b5693(_0x12f91d[_0xb20b('0x19')][_0xb20b('0x18')]);}})[_0xb20b('0x1a')](function(_0x31b8e9){logger['error'](_0xb20b('0x12'),_0x116a68,_0x31b8e9);_0x546122(_0x31b8e9);});});}exports['GetOpenchannelQueue']=function(_0x6936ed){var _0x30bac2=this;return new Promise(function(_0x245aef,_0x59c60e){return db['OpenchannelQueue']['findAll']({'raw':_0x6936ed[_0xb20b('0x1b')]?_0x6936ed['options'][_0xb20b('0x1c')]===undefined?!![]:![]:!![],'where':_0x6936ed[_0xb20b('0x1b')]?_0x6936ed[_0xb20b('0x1b')][_0xb20b('0x1d')]||null:null,'attributes':_0x6936ed['options']?_0x6936ed[_0xb20b('0x1b')][_0xb20b('0x1e')]||null:null,'limit':_0x6936ed['options']?_0x6936ed[_0xb20b('0x1b')][_0xb20b('0x1f')]||null:null,'include':_0x6936ed[_0xb20b('0x1b')]?_0x6936ed[_0xb20b('0x1b')][_0xb20b('0x20')]?_[_0xb20b('0x21')](_0x6936ed['options'][_0xb20b('0x20')],function(_0xb13457){return{'model':db[_0xb13457[_0xb20b('0x22')]],'as':_0xb13457['as'],'attributes':_0xb13457['attributes'],'include':_0xb13457[_0xb20b('0x20')]?_['map'](_0xb13457[_0xb20b('0x20')],function(_0x1ff019){return{'model':db[_0x1ff019['model']],'as':_0x1ff019['as'],'attributes':_0x1ff019[_0xb20b('0x1e')],'include':_0x1ff019[_0xb20b('0x20')]?_[_0xb20b('0x21')](_0x1ff019[_0xb20b('0x20')],function(_0x475a84){return{'model':db[_0x475a84[_0xb20b('0x22')]],'as':_0x475a84['as'],'attributes':_0x475a84[_0xb20b('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x487483){logger[_0xb20b('0x11')]('GetOpenchannelQueue',_0x6936ed);logger[_0xb20b('0x14')]('GetOpenchannelQueue',_0x6936ed,JSON['stringify'](_0x487483));_0x245aef(_0x487483);})[_0xb20b('0x1a')](function(_0x1b858b){logger[_0xb20b('0x16')](_0xb20b('0x23'),_0x1b858b[_0xb20b('0x18')],_0x6936ed);_0x59c60e(_0x30bac2[_0xb20b('0x16')](0x1f4,_0x1b858b['message']));});});};exports['ShowOpenchannelQueue']=function(_0x51aba7){var _0x39ed60=this;return new Promise(function(_0x17a322,_0x590af8){return db[_0xb20b('0x24')][_0xb20b('0x25')]({'raw':_0x51aba7[_0xb20b('0x1b')]?_0x51aba7['options'][_0xb20b('0x1c')]===undefined?!![]:![]:!![],'where':_0x51aba7[_0xb20b('0x1b')]?_0x51aba7[_0xb20b('0x1b')][_0xb20b('0x1d')]||null:null,'attributes':_0x51aba7[_0xb20b('0x1b')]?_0x51aba7[_0xb20b('0x1b')][_0xb20b('0x1e')]||null:null,'include':_0x51aba7['options']?_0x51aba7[_0xb20b('0x1b')][_0xb20b('0x20')]?_[_0xb20b('0x21')](_0x51aba7[_0xb20b('0x1b')][_0xb20b('0x20')],function(_0x1f2559){return{'model':db[_0x1f2559['model']],'as':_0x1f2559['as'],'attributes':_0x1f2559['attributes'],'include':_0x1f2559[_0xb20b('0x20')]?_[_0xb20b('0x21')](_0x1f2559[_0xb20b('0x20')],function(_0x1f83ca){return{'model':db[_0x1f83ca[_0xb20b('0x22')]],'as':_0x1f83ca['as'],'attributes':_0x1f83ca['attributes'],'include':_0x1f83ca['include']?_[_0xb20b('0x21')](_0x1f83ca['include'],function(_0x4c714c){return{'model':db[_0x4c714c[_0xb20b('0x22')]],'as':_0x4c714c['as'],'attributes':_0x4c714c[_0xb20b('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xb20b('0x10')](function(_0x321bb5){logger[_0xb20b('0x11')](_0xb20b('0x26'),_0x51aba7);logger[_0xb20b('0x14')](_0xb20b('0x26'),_0x51aba7,JSON[_0xb20b('0x27')](_0x321bb5));_0x17a322(_0x321bb5);})[_0xb20b('0x1a')](function(_0x31e784){logger['error']('ShowOpenchannelQueue',_0x31e784['message'],_0x51aba7);_0x590af8(_0x39ed60['error'](0x1f4,_0x31e784[_0xb20b('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index e4259ac..25e039d 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 _0x9c9c=['save','remove','update','emit','removeListener','openchannelQueue:'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x9c9c,0x1ec));var _0xc9c9=function(_0x35741f,_0x1bfb4f){_0x35741f=_0x35741f-0x0;var _0x2cd2b7=_0x9c9c[_0x35741f];return _0x2cd2b7;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0xc9c9('0x0'),_0xc9c9('0x1'),_0xc9c9('0x2')];function createListener(_0x18d426,_0x291b8c){return function(_0x222f5b){_0x291b8c[_0xc9c9('0x3')](_0x18d426,_0x222f5b);};}function removeListener(_0x4427ec,_0x5042d4){return function(){OpenchannelQueueEvents[_0xc9c9('0x4')](_0x4427ec,_0x5042d4);};}exports['register']=function(_0x50da91){for(var _0x3de514=0x0,_0x7a86ab=events['length'];_0x3de514<_0x7a86ab;_0x3de514++){var _0x2551c5=events[_0x3de514];var _0xc6d92e=createListener(_0xc9c9('0x5')+_0x2551c5,_0x50da91);OpenchannelQueueEvents['on'](_0x2551c5,_0xc6d92e);}}; \ No newline at end of file +var _0xf2e7=['openchannelQueue:','save','update','emit','removeListener','register','length'];(function(_0x4f89b9,_0x2badc4){var _0x2b0e07=function(_0x48fddd){while(--_0x48fddd){_0x4f89b9['push'](_0x4f89b9['shift']());}};_0x2b0e07(++_0x2badc4);}(_0xf2e7,0x1a5));var _0x7f2e=function(_0x1f0868,_0x1d8a1f){_0x1f0868=_0x1f0868-0x0;var _0x4117b5=_0xf2e7[_0x1f0868];return _0x4117b5;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0x7f2e('0x0'),'remove',_0x7f2e('0x1')];function createListener(_0x53b2a2,_0x42eb95){return function(_0x15c0df){_0x42eb95[_0x7f2e('0x2')](_0x53b2a2,_0x15c0df);};}function removeListener(_0x2d5a3d,_0x3f0431){return function(){OpenchannelQueueEvents[_0x7f2e('0x3')](_0x2d5a3d,_0x3f0431);};}exports[_0x7f2e('0x4')]=function(_0x4e6743){for(var _0x2c8fd7=0x0,_0x142898=events[_0x7f2e('0x5')];_0x2c8fd7<_0x142898;_0x2c8fd7++){var _0x42818d=events[_0x2c8fd7];var _0x2eab3f=createListener(_0x7f2e('0x6')+_0x42818d,_0x4e6743);OpenchannelQueueEvents['on'](_0x42818d,_0x2eab3f);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index b229464..9c4a384 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 _0x2d5a=['show','create','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe'];(function(_0x8a969d,_0x339d9f){var _0x1d8dc7=function(_0x283ec0){while(--_0x283ec0){_0x8a969d['push'](_0x8a969d['shift']());}};_0x1d8dc7(++_0x339d9f);}(_0x2d5a,0x123));var _0xa2d5=function(_0x1ea489,_0x11db84){_0x1ea489=_0x1ea489-0x0;var _0x4cdb4b=_0x2d5a[_0x1ea489];return _0x4cdb4b;};'use strict';var multer=require(_0xa2d5('0x0'));var util=require(_0xa2d5('0x1'));var path=require(_0xa2d5('0x2'));var timeout=require(_0xa2d5('0x3'));var express=require(_0xa2d5('0x4'));var router=express[_0xa2d5('0x5')]();var fs_extra=require(_0xa2d5('0x6'));var auth=require(_0xa2d5('0x7'));var interaction=require(_0xa2d5('0x8'));var config=require(_0xa2d5('0x9'));var controller=require('./openchannelQueueReport.controller');router['get']('/',auth[_0xa2d5('0xa')](),controller['index']);router[_0xa2d5('0xb')](_0xa2d5('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0xa2d5('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xa2d5('0xd')]);router['post']('/',auth[_0xa2d5('0xa')](),controller[_0xa2d5('0xe')]);router['put'](_0xa2d5('0xf'),auth[_0xa2d5('0xa')](),controller[_0xa2d5('0x10')]);router[_0xa2d5('0x11')]('/:id',auth[_0xa2d5('0xa')](),controller[_0xa2d5('0x12')]);module['exports']=router; \ No newline at end of file +var _0xa494=['../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','fs-extra'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xa494,0x138));var _0x4a49=function(_0x3032a4,_0xe692e5){_0x3032a4=_0x3032a4-0x0;var _0x21c0f7=_0xa494[_0x3032a4];return _0x21c0f7;};'use strict';var multer=require(_0x4a49('0x0'));var util=require(_0x4a49('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x4a49('0x2'));var auth=require(_0x4a49('0x3'));var interaction=require(_0x4a49('0x4'));var config=require(_0x4a49('0x5'));var controller=require(_0x4a49('0x6'));router['get']('/',auth[_0x4a49('0x7')](),controller[_0x4a49('0x8')]);router[_0x4a49('0x9')](_0x4a49('0xa'),auth[_0x4a49('0x7')](),controller[_0x4a49('0xb')]);router['get'](_0x4a49('0xc'),auth[_0x4a49('0x7')](),controller[_0x4a49('0xd')]);router[_0x4a49('0xe')]('/',auth[_0x4a49('0x7')](),controller[_0x4a49('0xf')]);router[_0x4a49('0x10')](_0x4a49('0xc'),auth[_0x4a49('0x7')](),controller[_0x4a49('0x11')]);router[_0x4a49('0x12')]('/:id',auth[_0x4a49('0x7')](),controller[_0x4a49('0x13')]);module[_0x4a49('0x14')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 5a9dbee..a490074 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 _0x9723=['DATE','STRING','moment','sequelize','exports'];(function(_0x5a6dc5,_0x4a7a46){var _0x2b6dcd=function(_0x207808){while(--_0x207808){_0x5a6dc5['push'](_0x5a6dc5['shift']());}};_0x2b6dcd(++_0x4a7a46);}(_0x9723,0xac));var _0x3972=function(_0x19115e,_0x507bab){_0x19115e=_0x19115e-0x0;var _0x45bbd4=_0x9723[_0x19115e];return _0x45bbd4;};'use strict';var moment=require(_0x3972('0x0'));var Sequelize=require(_0x3972('0x1'));module[_0x3972('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x3972('0x3')]},'leaveAt':{'type':Sequelize[_0x3972('0x3')]},'acceptAt':{'type':Sequelize[_0x3972('0x3')]},'exitAt':{'type':Sequelize[_0x3972('0x3')]},'reason':{'type':Sequelize[_0x3972('0x4')]}}; \ No newline at end of file +var _0x12be=['DATE','moment','sequelize','STRING'];(function(_0x52c27f,_0x3cba8f){var _0x2b101a=function(_0x182fd3){while(--_0x182fd3){_0x52c27f['push'](_0x52c27f['shift']());}};_0x2b101a(++_0x3cba8f);}(_0x12be,0x169));var _0xe12b=function(_0x1857d0,_0x6eade0){_0x1857d0=_0x1857d0-0x0;var _0x3e3c46=_0x12be[_0x1857d0];return _0x3e3c46;};'use strict';var moment=require(_0xe12b('0x0'));var Sequelize=require(_0xe12b('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xe12b('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xe12b('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xe12b('0x3')]},'exitAt':{'type':Sequelize[_0xe12b('0x3')]},'reason':{'type':Sequelize[_0xe12b('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 6e28091..7092b8e 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 _0xf568=['body','describe','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','params','length','find','catch','create'];(function(_0x1bdc52,_0x4876a9){var _0xdf3fa3=function(_0x2a3ba4){while(--_0x2a3ba4){_0x1bdc52['push'](_0x1bdc52['shift']());}};_0xdf3fa3(++_0x4876a9);}(_0xf568,0x122));var _0x8f56=function(_0x1e38fc,_0x3abb47){_0x1e38fc=_0x1e38fc-0x0;var _0x2e2aab=_0xf568[_0x1e38fc];return _0x2e2aab;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8f56('0x0'));var jsonpatch=require(_0x8f56('0x1'));var rp=require('request-promise');var moment=require(_0x8f56('0x2'));var BPromise=require(_0x8f56('0x3'));var Mustache=require(_0x8f56('0x4'));var util=require(_0x8f56('0x5'));var path=require(_0x8f56('0x6'));var sox=require(_0x8f56('0x7'));var csv=require('to-csv');var ejs=require(_0x8f56('0x8'));var fs=require('fs');var fs_extra=require(_0x8f56('0x9'));var _=require(_0x8f56('0xa'));var squel=require(_0x8f56('0xb'));var crypto=require('crypto');var jsforce=require(_0x8f56('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8f56('0xd'));var querystring=require(_0x8f56('0xe'));var Papa=require(_0x8f56('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8f56('0x10'));var hardwareService=require(_0x8f56('0x11'));var logger=require('../../config/logger')(_0x8f56('0x12'));var utils=require(_0x8f56('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x8f56('0x14'));var db=require(_0x8f56('0x15'))['db'];function respondWithStatusCode(_0x3ac878,_0x54c817){_0x54c817=_0x54c817||0xcc;return function(_0x4a3efe){if(_0x4a3efe){return _0x3ac878[_0x8f56('0x16')](_0x54c817);}return _0x3ac878[_0x8f56('0x17')](_0x54c817)[_0x8f56('0x18')]();};}function respondWithResult(_0x87c97,_0x567ff2){_0x567ff2=_0x567ff2||0xc8;return function(_0x4717b6){if(_0x4717b6){return _0x87c97[_0x8f56('0x17')](_0x567ff2)[_0x8f56('0x19')](_0x4717b6);}};}function respondWithFilteredResult(_0x3c0ec1,_0x272007){return function(_0x137e7f){if(_0x137e7f){var _0x3c95a4=typeof _0x272007[_0x8f56('0x1a')]===_0x8f56('0x1b')&&typeof _0x272007[_0x8f56('0x1c')]===_0x8f56('0x1b');var _0x1659bc=_0x137e7f[_0x8f56('0x1d')];var _0x424c76=_0x3c95a4?0x0:_0x272007['offset'];var _0x3ba680=_0x3c95a4?_0x137e7f[_0x8f56('0x1d')]:_0x272007['offset']+_0x272007['limit'];var _0x5a773a;if(_0x3ba680>=_0x1659bc){_0x3ba680=_0x1659bc;_0x5a773a=0xc8;}else{_0x5a773a=0xce;}_0x3c0ec1[_0x8f56('0x17')](_0x5a773a);return _0x3c0ec1[_0x8f56('0x1e')](_0x8f56('0x1f'),_0x424c76+'-'+_0x3ba680+'/'+_0x1659bc)[_0x8f56('0x19')](_0x137e7f);}return null;};}function patchUpdates(_0x2ab650){return function(_0x1d9c2b){try{jsonpatch['apply'](_0x1d9c2b,_0x2ab650,!![]);}catch(_0x46ecc1){return BPromise[_0x8f56('0x20')](_0x46ecc1);}return _0x1d9c2b[_0x8f56('0x21')]();};}function saveUpdates(_0x8352ee,_0x4802e7){return function(_0x160978){if(_0x160978){return _0x160978[_0x8f56('0x22')](_0x8352ee)[_0x8f56('0x23')](function(_0x5db169){return _0x5db169;});}return null;};}function removeEntity(_0x22b3f0,_0x530bd9){return function(_0x1ebf76){if(_0x1ebf76){return _0x1ebf76[_0x8f56('0x24')]()[_0x8f56('0x23')](function(){_0x22b3f0[_0x8f56('0x17')](0xcc)[_0x8f56('0x18')]();});}};}function handleEntityNotFound(_0x3e32ea,_0x2a9ab2){return function(_0x44ef29){if(!_0x44ef29){_0x3e32ea[_0x8f56('0x16')](0x194);}return _0x44ef29;};}function handleError(_0x1dd162,_0x403370){_0x403370=_0x403370||0x1f4;return function(_0x135b6d){logger[_0x8f56('0x25')](_0x135b6d[_0x8f56('0x26')]);if(_0x135b6d[_0x8f56('0x27')]){delete _0x135b6d['name'];}_0x1dd162['status'](_0x403370)[_0x8f56('0x28')](_0x135b6d);};}exports['index']=function(_0x3194a3,_0x5ae0d6){var _0x398e01={},_0x34945f={},_0x180df5={'count':0x0,'rows':[]};var _0x5d4854=_[_0x8f56('0x29')](db[_0x8f56('0x2a')][_0x8f56('0x2b')],function(_0x15e4cf){return{'name':_0x15e4cf[_0x8f56('0x2c')],'type':_0x15e4cf[_0x8f56('0x2d')][_0x8f56('0x2e')]};});_0x34945f[_0x8f56('0x2f')]=_[_0x8f56('0x29')](_0x5d4854,_0x8f56('0x27'));_0x34945f[_0x8f56('0x30')]=_[_0x8f56('0x31')](_0x3194a3['query']);_0x34945f['filters']=_['intersection'](_0x34945f[_0x8f56('0x2f')],_0x34945f[_0x8f56('0x30')]);_0x398e01[_0x8f56('0x32')]=_[_0x8f56('0x33')](_0x34945f[_0x8f56('0x2f')],qs[_0x8f56('0x34')](_0x3194a3[_0x8f56('0x30')][_0x8f56('0x34')]));_0x398e01[_0x8f56('0x32')]=_0x398e01[_0x8f56('0x32')]['length']?_0x398e01[_0x8f56('0x32')]:_0x34945f[_0x8f56('0x2f')];if(!_0x3194a3['query'][_0x8f56('0x35')](_0x8f56('0x36'))){_0x398e01['limit']=qs[_0x8f56('0x1c')](_0x3194a3[_0x8f56('0x30')][_0x8f56('0x1c')]);_0x398e01[_0x8f56('0x1a')]=qs[_0x8f56('0x1a')](_0x3194a3['query'][_0x8f56('0x1a')]);}_0x398e01[_0x8f56('0x37')]=qs['sort'](_0x3194a3[_0x8f56('0x30')][_0x8f56('0x38')]);_0x398e01[_0x8f56('0x39')]=qs[_0x8f56('0x3a')](_[_0x8f56('0x3b')](_0x3194a3['query'],_0x34945f[_0x8f56('0x3a')]),_0x5d4854);if(_0x3194a3[_0x8f56('0x30')][_0x8f56('0x3c')]){_0x398e01[_0x8f56('0x39')]=_[_0x8f56('0x3d')](_0x398e01[_0x8f56('0x39')],{'$or':_['map'](_0x5d4854,function(_0x429766){if(_0x429766[_0x8f56('0x2d')]!==_0x8f56('0x3e')){var _0x2b4d6={};_0x2b4d6[_0x429766['name']]={'$like':'%'+_0x3194a3[_0x8f56('0x30')][_0x8f56('0x3c')]+'%'};return _0x2b4d6;}})});}_0x398e01=_[_0x8f56('0x3d')]({},_0x398e01,_0x3194a3[_0x8f56('0x3f')]);var _0x17f2bf={'where':_0x398e01['where']};return db[_0x8f56('0x2a')][_0x8f56('0x1d')](_0x17f2bf)[_0x8f56('0x23')](function(_0xfd9431){_0x180df5['count']=_0xfd9431;if(_0x3194a3[_0x8f56('0x30')]['includeAll']){_0x398e01[_0x8f56('0x40')]=[{'all':!![]}];}return db[_0x8f56('0x2a')]['findAll'](_0x398e01);})[_0x8f56('0x23')](function(_0x48d209){_0x180df5['rows']=_0x48d209;return _0x180df5;})[_0x8f56('0x23')](respondWithFilteredResult(_0x5ae0d6,_0x398e01))['catch'](handleError(_0x5ae0d6,null));};exports['show']=function(_0x54983a,_0x1e8238){var _0x48baa8={'raw':!![],'where':{'id':_0x54983a[_0x8f56('0x41')]['id']}},_0x31b9bf={};_0x31b9bf['model']=_['keys'](db[_0x8f56('0x2a')][_0x8f56('0x2b')]);_0x31b9bf['query']=_[_0x8f56('0x31')](_0x54983a[_0x8f56('0x30')]);_0x31b9bf['filters']=_[_0x8f56('0x33')](_0x31b9bf[_0x8f56('0x2f')],_0x31b9bf[_0x8f56('0x30')]);_0x48baa8[_0x8f56('0x32')]=_['intersection'](_0x31b9bf[_0x8f56('0x2f')],qs[_0x8f56('0x34')](_0x54983a['query'][_0x8f56('0x34')]));_0x48baa8[_0x8f56('0x32')]=_0x48baa8[_0x8f56('0x32')][_0x8f56('0x42')]?_0x48baa8['attributes']:_0x31b9bf['model'];if(_0x54983a['query']['includeAll']){_0x48baa8[_0x8f56('0x40')]=[{'all':!![]}];}_0x48baa8=_[_0x8f56('0x3d')]({},_0x48baa8,_0x54983a[_0x8f56('0x3f')]);return db[_0x8f56('0x2a')][_0x8f56('0x43')](_0x48baa8)[_0x8f56('0x23')](handleEntityNotFound(_0x1e8238,null))[_0x8f56('0x23')](respondWithResult(_0x1e8238,null))[_0x8f56('0x44')](handleError(_0x1e8238,null));};exports[_0x8f56('0x45')]=function(_0x566845,_0xeda589){return db[_0x8f56('0x2a')][_0x8f56('0x45')](_0x566845[_0x8f56('0x46')],{})[_0x8f56('0x23')](respondWithResult(_0xeda589,0xc9))[_0x8f56('0x44')](handleError(_0xeda589,null));};exports['update']=function(_0x4de287,_0x5e25aa){if(_0x4de287[_0x8f56('0x46')]['id']){delete _0x4de287['body']['id'];}return db['OpenchannelQueueReport'][_0x8f56('0x43')]({'where':{'id':_0x4de287[_0x8f56('0x41')]['id']}})[_0x8f56('0x23')](handleEntityNotFound(_0x5e25aa,null))[_0x8f56('0x23')](saveUpdates(_0x4de287['body'],null))['then'](respondWithResult(_0x5e25aa,null))[_0x8f56('0x44')](handleError(_0x5e25aa,null));};exports['destroy']=function(_0x365873,_0x531851){return db[_0x8f56('0x2a')][_0x8f56('0x43')]({'where':{'id':_0x365873['params']['id']}})['then'](handleEntityNotFound(_0x531851,null))[_0x8f56('0x23')](removeEntity(_0x531851,null))[_0x8f56('0x44')](handleError(_0x531851,null));};exports[_0x8f56('0x47')]=function(_0x2bdbf7,_0x236dc2){return db[_0x8f56('0x2a')][_0x8f56('0x47')]()['then'](respondWithResult(_0x236dc2,null))[_0x8f56('0x44')](handleError(_0x236dc2,null));}; \ No newline at end of file +var _0x0b21=['send','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','destroy','then','name'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x0b21,0x146));var _0x10b2=function(_0x2fed44,_0x38a0b9){_0x2fed44=_0x2fed44-0x0;var _0x52778a=_0x0b21[_0x2fed44];return _0x52778a;};'use strict';var emlformat=require(_0x10b2('0x0'));var rimraf=require(_0x10b2('0x1'));var zipdir=require(_0x10b2('0x2'));var jsonpatch=require(_0x10b2('0x3'));var rp=require(_0x10b2('0x4'));var moment=require(_0x10b2('0x5'));var BPromise=require(_0x10b2('0x6'));var Mustache=require('mustache');var util=require(_0x10b2('0x7'));var path=require(_0x10b2('0x8'));var sox=require(_0x10b2('0x9'));var csv=require('to-csv');var ejs=require(_0x10b2('0xa'));var fs=require('fs');var fs_extra=require(_0x10b2('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x10b2('0xc'));var jsforce=require(_0x10b2('0xd'));var deskjs=require(_0x10b2('0xe'));var toCsv=require('to-csv');var querystring=require(_0x10b2('0xf'));var Papa=require(_0x10b2('0x10'));var Redis=require(_0x10b2('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x10b2('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x10b2('0x13'))('api');var utils=require(_0x10b2('0x14'));var config=require(_0x10b2('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x10b2('0x16'))['db'];function respondWithStatusCode(_0x3302f1,_0x415f09){_0x415f09=_0x415f09||0xcc;return function(_0x28a3e2){if(_0x28a3e2){return _0x3302f1[_0x10b2('0x17')](_0x415f09);}return _0x3302f1[_0x10b2('0x18')](_0x415f09)[_0x10b2('0x19')]();};}function respondWithResult(_0x1603d7,_0x882fe8){_0x882fe8=_0x882fe8||0xc8;return function(_0x3b2338){if(_0x3b2338){return _0x1603d7[_0x10b2('0x18')](_0x882fe8)[_0x10b2('0x1a')](_0x3b2338);}};}function respondWithFilteredResult(_0x397b0d,_0x4851c1){return function(_0x13198f){if(_0x13198f){var _0x2e2da8=typeof _0x4851c1[_0x10b2('0x1b')]===_0x10b2('0x1c')&&typeof _0x4851c1['limit']===_0x10b2('0x1c');var _0x15a81a=_0x13198f[_0x10b2('0x1d')];var _0x3a1168=_0x2e2da8?0x0:_0x4851c1[_0x10b2('0x1b')];var _0x175bdb=_0x2e2da8?_0x13198f['count']:_0x4851c1[_0x10b2('0x1b')]+_0x4851c1[_0x10b2('0x1e')];var _0x190e5a;if(_0x175bdb>=_0x15a81a){_0x175bdb=_0x15a81a;_0x190e5a=0xc8;}else{_0x190e5a=0xce;}_0x397b0d[_0x10b2('0x18')](_0x190e5a);return _0x397b0d[_0x10b2('0x1f')](_0x10b2('0x20'),_0x3a1168+'-'+_0x175bdb+'/'+_0x15a81a)[_0x10b2('0x1a')](_0x13198f);}return null;};}function patchUpdates(_0x2866cc){return function(_0x34d2dc){try{jsonpatch[_0x10b2('0x21')](_0x34d2dc,_0x2866cc,!![]);}catch(_0x4b329a){return BPromise[_0x10b2('0x22')](_0x4b329a);}return _0x34d2dc['save']();};}function saveUpdates(_0x1debb8,_0x6b9f2a){return function(_0x1c0e91){if(_0x1c0e91){return _0x1c0e91[_0x10b2('0x23')](_0x1debb8)['then'](function(_0x2a8334){return _0x2a8334;});}return null;};}function removeEntity(_0x584d96,_0x11a80b){return function(_0x572a03){if(_0x572a03){return _0x572a03[_0x10b2('0x24')]()[_0x10b2('0x25')](function(){_0x584d96[_0x10b2('0x18')](0xcc)[_0x10b2('0x19')]();});}};}function handleEntityNotFound(_0x2a4c68,_0xae1d3c){return function(_0x155301){if(!_0x155301){_0x2a4c68[_0x10b2('0x17')](0x194);}return _0x155301;};}function handleError(_0x85659a,_0x2abfb7){_0x2abfb7=_0x2abfb7||0x1f4;return function(_0x54d832){logger['error'](_0x54d832['stack']);if(_0x54d832[_0x10b2('0x26')]){delete _0x54d832[_0x10b2('0x26')];}_0x85659a[_0x10b2('0x18')](_0x2abfb7)[_0x10b2('0x27')](_0x54d832);};}exports['index']=function(_0xb954b7,_0x131537){var _0x213ae3={},_0xcbe540={},_0x1a3903={'count':0x0,'rows':[]};var _0x5aa7bb=_[_0x10b2('0x28')](db[_0x10b2('0x29')][_0x10b2('0x2a')],function(_0x37c07a){return{'name':_0x37c07a[_0x10b2('0x2b')],'type':_0x37c07a[_0x10b2('0x2c')][_0x10b2('0x2d')]};});_0xcbe540[_0x10b2('0x2e')]=_[_0x10b2('0x28')](_0x5aa7bb,'name');_0xcbe540[_0x10b2('0x2f')]=_[_0x10b2('0x30')](_0xb954b7['query']);_0xcbe540['filters']=_[_0x10b2('0x31')](_0xcbe540['model'],_0xcbe540['query']);_0x213ae3[_0x10b2('0x32')]=_['intersection'](_0xcbe540[_0x10b2('0x2e')],qs['fields'](_0xb954b7[_0x10b2('0x2f')][_0x10b2('0x33')]));_0x213ae3[_0x10b2('0x32')]=_0x213ae3[_0x10b2('0x32')][_0x10b2('0x34')]?_0x213ae3['attributes']:_0xcbe540[_0x10b2('0x2e')];if(!_0xb954b7[_0x10b2('0x2f')][_0x10b2('0x35')](_0x10b2('0x36'))){_0x213ae3['limit']=qs[_0x10b2('0x1e')](_0xb954b7['query'][_0x10b2('0x1e')]);_0x213ae3['offset']=qs[_0x10b2('0x1b')](_0xb954b7[_0x10b2('0x2f')][_0x10b2('0x1b')]);}_0x213ae3['order']=qs[_0x10b2('0x37')](_0xb954b7[_0x10b2('0x2f')][_0x10b2('0x37')]);_0x213ae3['where']=qs[_0x10b2('0x38')](_[_0x10b2('0x39')](_0xb954b7[_0x10b2('0x2f')],_0xcbe540['filters']),_0x5aa7bb);if(_0xb954b7[_0x10b2('0x2f')][_0x10b2('0x3a')]){_0x213ae3[_0x10b2('0x3b')]=_[_0x10b2('0x3c')](_0x213ae3[_0x10b2('0x3b')],{'$or':_['map'](_0x5aa7bb,function(_0x5ba11b){if(_0x5ba11b[_0x10b2('0x2c')]!==_0x10b2('0x3d')){var _0xff3648={};_0xff3648[_0x5ba11b[_0x10b2('0x26')]]={'$like':'%'+_0xb954b7['query'][_0x10b2('0x3a')]+'%'};return _0xff3648;}})});}_0x213ae3=_[_0x10b2('0x3c')]({},_0x213ae3,_0xb954b7[_0x10b2('0x3e')]);var _0x2f113c={'where':_0x213ae3[_0x10b2('0x3b')]};return db[_0x10b2('0x29')][_0x10b2('0x1d')](_0x2f113c)['then'](function(_0x344908){_0x1a3903[_0x10b2('0x1d')]=_0x344908;if(_0xb954b7['query']['includeAll']){_0x213ae3[_0x10b2('0x3f')]=[{'all':!![]}];}return db[_0x10b2('0x29')][_0x10b2('0x40')](_0x213ae3);})['then'](function(_0x3c70bd){_0x1a3903[_0x10b2('0x41')]=_0x3c70bd;return _0x1a3903;})[_0x10b2('0x25')](respondWithFilteredResult(_0x131537,_0x213ae3))[_0x10b2('0x42')](handleError(_0x131537,null));};exports[_0x10b2('0x43')]=function(_0x194f09,_0x29fa1f){var _0x5a73cb={'raw':!![],'where':{'id':_0x194f09[_0x10b2('0x44')]['id']}},_0x2771c5={};_0x2771c5[_0x10b2('0x2e')]=_[_0x10b2('0x30')](db[_0x10b2('0x29')][_0x10b2('0x2a')]);_0x2771c5[_0x10b2('0x2f')]=_[_0x10b2('0x30')](_0x194f09[_0x10b2('0x2f')]);_0x2771c5[_0x10b2('0x38')]=_[_0x10b2('0x31')](_0x2771c5[_0x10b2('0x2e')],_0x2771c5[_0x10b2('0x2f')]);_0x5a73cb[_0x10b2('0x32')]=_[_0x10b2('0x31')](_0x2771c5[_0x10b2('0x2e')],qs['fields'](_0x194f09[_0x10b2('0x2f')][_0x10b2('0x33')]));_0x5a73cb['attributes']=_0x5a73cb[_0x10b2('0x32')][_0x10b2('0x34')]?_0x5a73cb[_0x10b2('0x32')]:_0x2771c5['model'];if(_0x194f09[_0x10b2('0x2f')]['includeAll']){_0x5a73cb[_0x10b2('0x3f')]=[{'all':!![]}];}_0x5a73cb=_[_0x10b2('0x3c')]({},_0x5a73cb,_0x194f09[_0x10b2('0x3e')]);return db[_0x10b2('0x29')][_0x10b2('0x45')](_0x5a73cb)[_0x10b2('0x25')](handleEntityNotFound(_0x29fa1f,null))[_0x10b2('0x25')](respondWithResult(_0x29fa1f,null))[_0x10b2('0x42')](handleError(_0x29fa1f,null));};exports[_0x10b2('0x46')]=function(_0xcdd6dd,_0x3f9169){return db[_0x10b2('0x29')][_0x10b2('0x46')](_0xcdd6dd[_0x10b2('0x47')],{})[_0x10b2('0x25')](respondWithResult(_0x3f9169,0xc9))[_0x10b2('0x42')](handleError(_0x3f9169,null));};exports[_0x10b2('0x23')]=function(_0xa4771b,_0x22b1fe){if(_0xa4771b[_0x10b2('0x47')]['id']){delete _0xa4771b['body']['id'];}return db['OpenchannelQueueReport'][_0x10b2('0x45')]({'where':{'id':_0xa4771b[_0x10b2('0x44')]['id']}})['then'](handleEntityNotFound(_0x22b1fe,null))['then'](saveUpdates(_0xa4771b[_0x10b2('0x47')],null))[_0x10b2('0x25')](respondWithResult(_0x22b1fe,null))[_0x10b2('0x42')](handleError(_0x22b1fe,null));};exports[_0x10b2('0x24')]=function(_0x4f9467,_0x2f117a){return db[_0x10b2('0x29')]['find']({'where':{'id':_0x4f9467[_0x10b2('0x44')]['id']}})[_0x10b2('0x25')](handleEntityNotFound(_0x2f117a,null))[_0x10b2('0x25')](removeEntity(_0x2f117a,null))[_0x10b2('0x42')](handleError(_0x2f117a,null));};exports[_0x10b2('0x48')]=function(_0x2bde72,_0x70ed68){return db[_0x10b2('0x29')][_0x10b2('0x48')]()[_0x10b2('0x25')](respondWithResult(_0x70ed68,null))[_0x10b2('0x42')](handleError(_0x70ed68,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index e35defe..60a9965 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 _0x7a54=['report_openchannel_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','OpenchannelQueueReport'];(function(_0x49aef2,_0x1417db){var _0x5bbe18=function(_0x130eb2){while(--_0x130eb2){_0x49aef2['push'](_0x49aef2['shift']());}};_0x5bbe18(++_0x1417db);}(_0x7a54,0x106));var _0x47a5=function(_0x5a529d,_0x541b0a){_0x5a529d=_0x5a529d-0x0;var _0x32b9dd=_0x7a54[_0x5a529d];return _0x32b9dd;};'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 _0xe14b=['bluebird','path','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','moment'];(function(_0x432b7c,_0x5063e5){var _0x4b5f51=function(_0xe71c20){while(--_0xe71c20){_0x432b7c['push'](_0x432b7c['shift']());}};_0x4b5f51(++_0x5063e5);}(_0xe14b,0x93));var _0xbe14=function(_0x422d5e,_0x28d38d){_0x422d5e=_0x422d5e-0x0;var _0x14295a=_0xe14b[_0x422d5e];return _0x14295a;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 8627cb9..b8afda8 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 _0xeb3b=['OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','raw','debug','stringify','UpdateOpenchannelQueueReport','update','options','where','attributes','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','jayson/promise','client','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xeb3b,0x19e));var _0xbeb3=function(_0x3f6b1b,_0x58d3d6){_0x3f6b1b=_0x3f6b1b-0x0;var _0x4a3d2b=_0xeb3b[_0x3f6b1b];return _0x4a3d2b;};'use strict';var _=require(_0xbeb3('0x0'));var util=require(_0xbeb3('0x1'));var moment=require(_0xbeb3('0x2'));var BPromise=require(_0xbeb3('0x3'));var rs=require(_0xbeb3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbeb3('0x5'));var logger=require('../../config/logger')(_0xbeb3('0x6'));var config=require('../../config/environment');var jayson=require(_0xbeb3('0x7'));var client=jayson[_0xbeb3('0x8')][_0xbeb3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x294cc9,_0x406927,_0x143255){return new BPromise(function(_0x5a6a06,_0x241dbb){return client[_0xbeb3('0xa')](_0x294cc9,_0x143255)[_0xbeb3('0xb')](function(_0x3b61ac){logger[_0xbeb3('0xc')](_0xbeb3('0xd'),_0x406927,_0xbeb3('0xe'));logger['debug'](_0xbeb3('0xf'),_0x406927,_0xbeb3('0xe'),JSON['stringify'](_0x3b61ac));if(_0x3b61ac[_0xbeb3('0x10')]){if(_0x3b61ac[_0xbeb3('0x10')][_0xbeb3('0x11')]===0x1f4){logger[_0xbeb3('0x10')](_0xbeb3('0xd'),_0x406927,_0x3b61ac[_0xbeb3('0x10')]['message']);return _0x241dbb(_0x3b61ac['error'][_0xbeb3('0x12')]);}logger[_0xbeb3('0x10')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x406927,_0x3b61ac['error'][_0xbeb3('0x12')]);return _0x5a6a06(_0x3b61ac[_0xbeb3('0x10')][_0xbeb3('0x12')]);}else{logger[_0xbeb3('0xc')](_0xbeb3('0xd'),_0x406927,'request\x20sent');_0x5a6a06(_0x3b61ac[_0xbeb3('0x13')]['message']);}})[_0xbeb3('0x14')](function(_0x4e7d99){logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0x406927,_0x4e7d99);_0x241dbb(_0x4e7d99);});});}exports[_0xbeb3('0x15')]=function(_0x44a4bb){var _0x32275b=this;return new Promise(function(_0x10b15d,_0x5d0689){return db[_0xbeb3('0x16')][_0xbeb3('0x17')](_0x44a4bb[_0xbeb3('0x18')],{'raw':_0x44a4bb['options']?_0x44a4bb['options'][_0xbeb3('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1d917b){logger['info']('CreateOpenchannelQueueReport',_0x44a4bb);logger[_0xbeb3('0x1a')](_0xbeb3('0x15'),_0x44a4bb,JSON[_0xbeb3('0x1b')](_0x1d917b));_0x10b15d(_0x1d917b);})['catch'](function(_0x301899){logger[_0xbeb3('0x10')]('CreateOpenchannelQueueReport',_0x301899[_0xbeb3('0x12')],_0x44a4bb);_0x5d0689(_0x32275b[_0xbeb3('0x10')](0x1f4,_0x301899['message']));});});};exports[_0xbeb3('0x1c')]=function(_0x278fe4){var _0x16b079=this;return new Promise(function(_0x42c6c3,_0x2bc188){return db[_0xbeb3('0x16')][_0xbeb3('0x1d')](_0x278fe4[_0xbeb3('0x18')],{'raw':_0x278fe4[_0xbeb3('0x1e')]?_0x278fe4['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x278fe4[_0xbeb3('0x1e')]?_0x278fe4['options'][_0xbeb3('0x1f')]||null:null,'attributes':_0x278fe4[_0xbeb3('0x1e')]?_0x278fe4[_0xbeb3('0x1e')][_0xbeb3('0x20')]||null:null,'limit':_0x278fe4['options']?_0x278fe4[_0xbeb3('0x1e')]['limit']||null:null})[_0xbeb3('0xb')](function(_0xab301c){logger['info']('UpdateOpenchannelQueueReport',_0x278fe4);logger[_0xbeb3('0x1a')]('UpdateOpenchannelQueueReport',_0x278fe4,JSON['stringify'](_0xab301c));_0x42c6c3(_0xab301c);})['catch'](function(_0x5bfef7){logger[_0xbeb3('0x10')]('UpdateOpenchannelQueueReport',_0x5bfef7[_0xbeb3('0x12')],_0x278fe4);_0x2bc188(_0x16b079[_0xbeb3('0x10')](0x1f4,_0x5bfef7[_0xbeb3('0x12')]));});});}; \ No newline at end of file +var _0x2ace=['result','CreateOpenchannelQueueReport','body','options','raw','catch','UpdateOpenchannelQueueReport','OpenchannelQueueReport','update','limit','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','OpenchannelQueueReport,\x20%s,\x20%s','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent'];(function(_0x4351d1,_0x885a98){var _0x36e73b=function(_0x4c9e81){while(--_0x4c9e81){_0x4351d1['push'](_0x4351d1['shift']());}};_0x36e73b(++_0x885a98);}(_0x2ace,0x17e));var _0xe2ac=function(_0x1cee55,_0xe75188){_0x1cee55=_0x1cee55-0x0;var _0x4f640a=_0x2ace[_0x1cee55];return _0x4f640a;};'use strict';var _=require('lodash');var util=require(_0xe2ac('0x0'));var moment=require(_0xe2ac('0x1'));var BPromise=require(_0xe2ac('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe2ac('0x3'));var db=require(_0xe2ac('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe2ac('0x5'))(_0xe2ac('0x6'));var config=require(_0xe2ac('0x7'));var jayson=require(_0xe2ac('0x8'));var client=jayson[_0xe2ac('0x9')][_0xe2ac('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f1f8c,_0x391f96,_0x8e831b){return new BPromise(function(_0x28d0d1,_0x4064f9){return client[_0xe2ac('0xb')](_0x2f1f8c,_0x8e831b)[_0xe2ac('0xc')](function(_0x4fb111){logger['info'](_0xe2ac('0xd'),_0x391f96,'request\x20sent');logger[_0xe2ac('0xe')](_0xe2ac('0xf'),_0x391f96,'request\x20sent',JSON[_0xe2ac('0x10')](_0x4fb111));if(_0x4fb111[_0xe2ac('0x11')]){if(_0x4fb111[_0xe2ac('0x11')]['code']===0x1f4){logger[_0xe2ac('0x11')](_0xe2ac('0xd'),_0x391f96,_0x4fb111[_0xe2ac('0x11')][_0xe2ac('0x12')]);return _0x4064f9(_0x4fb111[_0xe2ac('0x11')]['message']);}logger[_0xe2ac('0x11')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x391f96,_0x4fb111[_0xe2ac('0x11')][_0xe2ac('0x12')]);return _0x28d0d1(_0x4fb111[_0xe2ac('0x11')][_0xe2ac('0x12')]);}else{logger[_0xe2ac('0x13')](_0xe2ac('0xd'),_0x391f96,_0xe2ac('0x14'));_0x28d0d1(_0x4fb111[_0xe2ac('0x15')][_0xe2ac('0x12')]);}})['catch'](function(_0x557ef6){logger[_0xe2ac('0x11')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x391f96,_0x557ef6);_0x4064f9(_0x557ef6);});});}exports[_0xe2ac('0x16')]=function(_0x3c8999){var _0x2aad2a=this;return new Promise(function(_0x2f5d32,_0x5000ba){return db['OpenchannelQueueReport']['create'](_0x3c8999[_0xe2ac('0x17')],{'raw':_0x3c8999[_0xe2ac('0x18')]?_0x3c8999[_0xe2ac('0x18')][_0xe2ac('0x19')]===undefined?!![]:![]:!![]})[_0xe2ac('0xc')](function(_0x279a90){logger['info']('CreateOpenchannelQueueReport',_0x3c8999);logger[_0xe2ac('0xe')]('CreateOpenchannelQueueReport',_0x3c8999,JSON[_0xe2ac('0x10')](_0x279a90));_0x2f5d32(_0x279a90);})[_0xe2ac('0x1a')](function(_0x2083b3){logger[_0xe2ac('0x11')](_0xe2ac('0x16'),_0x2083b3[_0xe2ac('0x12')],_0x3c8999);_0x5000ba(_0x2aad2a[_0xe2ac('0x11')](0x1f4,_0x2083b3[_0xe2ac('0x12')]));});});};exports[_0xe2ac('0x1b')]=function(_0x4e7597){var _0x5e27eb=this;return new Promise(function(_0x2f6220,_0x4c9981){return db[_0xe2ac('0x1c')][_0xe2ac('0x1d')](_0x4e7597['body'],{'raw':_0x4e7597[_0xe2ac('0x18')]?_0x4e7597['options'][_0xe2ac('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e7597[_0xe2ac('0x18')]?_0x4e7597[_0xe2ac('0x18')]['where']||null:null,'attributes':_0x4e7597[_0xe2ac('0x18')]?_0x4e7597[_0xe2ac('0x18')]['attributes']||null:null,'limit':_0x4e7597['options']?_0x4e7597[_0xe2ac('0x18')][_0xe2ac('0x1e')]||null:null})[_0xe2ac('0xc')](function(_0x23bef4){logger['info'](_0xe2ac('0x1b'),_0x4e7597);logger['debug'](_0xe2ac('0x1b'),_0x4e7597,JSON[_0xe2ac('0x10')](_0x23bef4));_0x2f6220(_0x23bef4);})[_0xe2ac('0x1a')](function(_0xbc6eed){logger[_0xe2ac('0x11')](_0xe2ac('0x1b'),_0xbc6eed['message'],_0x4e7597);_0x4c9981(_0x5e27eb[_0xe2ac('0x11')](0x1f4,_0xbc6eed['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 62800fa..e5af15a 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 _0xbd83=['post','create','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show'];(function(_0x91d048,_0x1f5811){var _0x1ed14f=function(_0x4eab7d){while(--_0x4eab7d){_0x91d048['push'](_0x91d048['shift']());}};_0x1ed14f(++_0x1f5811);}(_0xbd83,0x1be));var _0x3bd8=function(_0x208d75,_0x92d742){_0x208d75=_0x208d75-0x0;var _0x382d27=_0xbd83[_0x208d75];return _0x382d27;};'use strict';var multer=require(_0x3bd8('0x0'));var util=require(_0x3bd8('0x1'));var path=require('path');var timeout=require(_0x3bd8('0x2'));var express=require(_0x3bd8('0x3'));var router=express['Router']();var fs_extra=require(_0x3bd8('0x4'));var auth=require(_0x3bd8('0x5'));var interaction=require(_0x3bd8('0x6'));var config=require('../../config/environment');var controller=require(_0x3bd8('0x7'));router[_0x3bd8('0x8')]('/',auth[_0x3bd8('0x9')](),controller[_0x3bd8('0xa')]);router[_0x3bd8('0x8')](_0x3bd8('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x3bd8('0x8')](_0x3bd8('0xc'),auth[_0x3bd8('0x9')](),controller[_0x3bd8('0xd')]);router[_0x3bd8('0xe')]('/',auth[_0x3bd8('0x9')](),controller[_0x3bd8('0xf')]);router['put'](_0x3bd8('0xc'),auth[_0x3bd8('0x9')](),controller[_0x3bd8('0x10')]);router[_0x3bd8('0x11')]('/:id',auth[_0x3bd8('0x9')](),controller[_0x3bd8('0x12')]);module[_0x3bd8('0x13')]=router; \ No newline at end of file +var _0x8de0=['update','delete','destroy','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','/describe','describe','/:id','isAuthenticated','show','post','create','put'];(function(_0x504c43,_0x40c5ae){var _0x41b4f2=function(_0x5269a8){while(--_0x5269a8){_0x504c43['push'](_0x504c43['shift']());}};_0x41b4f2(++_0x40c5ae);}(_0x8de0,0xfa));var _0x08de=function(_0x49da89,_0x247a07){_0x49da89=_0x49da89-0x0;var _0x33e5b5=_0x8de0[_0x49da89];return _0x33e5b5;};'use strict';var multer=require('multer');var util=require(_0x08de('0x0'));var path=require(_0x08de('0x1'));var timeout=require(_0x08de('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x08de('0x3'));var interaction=require(_0x08de('0x4'));var config=require(_0x08de('0x5'));var controller=require(_0x08de('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x08de('0x7')](_0x08de('0x8'),auth['isAuthenticated'](),controller[_0x08de('0x9')]);router[_0x08de('0x7')](_0x08de('0xa'),auth[_0x08de('0xb')](),controller[_0x08de('0xc')]);router[_0x08de('0xd')]('/',auth['isAuthenticated'](),controller[_0x08de('0xe')]);router[_0x08de('0xf')](_0x08de('0xa'),auth[_0x08de('0xb')](),controller[_0x08de('0x10')]);router[_0x08de('0x11')]('/:id',auth[_0x08de('0xb')](),controller[_0x08de('0x12')]);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 71cf70e..2609611 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 _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x57eb2d,_0x5e4918){var _0xd8e18=function(_0x189389){while(--_0x189389){_0x57eb2d['push'](_0x57eb2d['shift']());}};_0xd8e18(++_0x5e4918);}(_0x9c44,0x178));var _0x49c4=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x9c44[_0x3ab51d];return _0x29a04e;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}}; \ No newline at end of file +var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x1ef8b9,_0x14f03f){var _0x1882b7=function(_0x427b86){while(--_0x427b86){_0x1ef8b9['push'](_0x1ef8b9['shift']());}};_0x1882b7(++_0x14f03f);}(_0xf4eb,0xec));var _0xbf4e=function(_0x3de183,_0x487d8a){_0x3de183=_0x3de183-0x0;var _0x5f218f=_0xf4eb[_0x3de183];return _0x5f218f;};'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/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index a7c1780..074847d 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 _0x1ce5=['length','hasOwnProperty','order','sort','filter','merge','where','VIRTUAL','options','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','describe','eml-format','rimraf','request-promise','moment','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','limit','count','offset','set','apply','update','then','destroy','sendStatus','error','stack','name','index','map','OpenchannelTransferReport','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes'];(function(_0x5885bc,_0x191e09){var _0x6b59e9=function(_0x22333a){while(--_0x22333a){_0x5885bc['push'](_0x5885bc['shift']());}};_0x6b59e9(++_0x191e09);}(_0x1ce5,0x1e9));var _0x51ce=function(_0x4a7631,_0x2c85b9){_0x4a7631=_0x4a7631-0x0;var _0x1a5a6f=_0x1ce5[_0x4a7631];return _0x1a5a6f;};'use strict';var emlformat=require(_0x51ce('0x0'));var rimraf=require(_0x51ce('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x51ce('0x2'));var moment=require(_0x51ce('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x51ce('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x51ce('0x5'));var ejs=require(_0x51ce('0x6'));var fs=require('fs');var fs_extra=require(_0x51ce('0x7'));var _=require('lodash');var squel=require(_0x51ce('0x8'));var crypto=require(_0x51ce('0x9'));var jsforce=require(_0x51ce('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x51ce('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x51ce('0xc'));var qs=require(_0x51ce('0xd'));var as=require(_0x51ce('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x51ce('0xf'));var utils=require(_0x51ce('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0x51ce('0x11'));var db=require(_0x51ce('0x12'))['db'];function respondWithStatusCode(_0xa71ea5,_0x1990cd){_0x1990cd=_0x1990cd||0xcc;return function(_0xe9d9a9){if(_0xe9d9a9){return _0xa71ea5['sendStatus'](_0x1990cd);}return _0xa71ea5[_0x51ce('0x13')](_0x1990cd)[_0x51ce('0x14')]();};}function respondWithResult(_0x5d9826,_0x307fb0){_0x307fb0=_0x307fb0||0xc8;return function(_0x2d2373){if(_0x2d2373){return _0x5d9826['status'](_0x307fb0)[_0x51ce('0x15')](_0x2d2373);}};}function respondWithFilteredResult(_0x1b66a6,_0x58807a){return function(_0x2ea13a){if(_0x2ea13a){var _0x3072bf=typeof _0x58807a['offset']==='undefined'&&typeof _0x58807a[_0x51ce('0x16')]==='undefined';var _0x1347c9=_0x2ea13a['count'];var _0xa6c661=_0x3072bf?0x0:_0x58807a['offset'];var _0x165d3e=_0x3072bf?_0x2ea13a[_0x51ce('0x17')]:_0x58807a[_0x51ce('0x18')]+_0x58807a['limit'];var _0x21207c;if(_0x165d3e>=_0x1347c9){_0x165d3e=_0x1347c9;_0x21207c=0xc8;}else{_0x21207c=0xce;}_0x1b66a6[_0x51ce('0x13')](_0x21207c);return _0x1b66a6[_0x51ce('0x19')]('Content-Range',_0xa6c661+'-'+_0x165d3e+'/'+_0x1347c9)[_0x51ce('0x15')](_0x2ea13a);}return null;};}function patchUpdates(_0x4cb207){return function(_0x1ec694){try{jsonpatch[_0x51ce('0x1a')](_0x1ec694,_0x4cb207,!![]);}catch(_0xf62f20){return BPromise['reject'](_0xf62f20);}return _0x1ec694['save']();};}function saveUpdates(_0x1004f0,_0x1327c7){return function(_0x1cdbc5){if(_0x1cdbc5){return _0x1cdbc5[_0x51ce('0x1b')](_0x1004f0)[_0x51ce('0x1c')](function(_0x5bf997){return _0x5bf997;});}return null;};}function removeEntity(_0x4318c8,_0xbc7ff){return function(_0x2741da){if(_0x2741da){return _0x2741da[_0x51ce('0x1d')]()['then'](function(){_0x4318c8[_0x51ce('0x13')](0xcc)[_0x51ce('0x14')]();});}};}function handleEntityNotFound(_0x450d41,_0x3d49ef){return function(_0x19d48a){if(!_0x19d48a){_0x450d41[_0x51ce('0x1e')](0x194);}return _0x19d48a;};}function handleError(_0x19c05e,_0x58ffa7){_0x58ffa7=_0x58ffa7||0x1f4;return function(_0x48e448){logger[_0x51ce('0x1f')](_0x48e448[_0x51ce('0x20')]);if(_0x48e448[_0x51ce('0x21')]){delete _0x48e448[_0x51ce('0x21')];}_0x19c05e[_0x51ce('0x13')](_0x58ffa7)['send'](_0x48e448);};}exports[_0x51ce('0x22')]=function(_0x583e46,_0x2e057f){var _0x1bf09c={},_0x17211d={},_0x5cbb5c={'count':0x0,'rows':[]};var _0x3f559c=_[_0x51ce('0x23')](db[_0x51ce('0x24')]['rawAttributes'],function(_0xa34c9a){return{'name':_0xa34c9a[_0x51ce('0x25')],'type':_0xa34c9a[_0x51ce('0x26')][_0x51ce('0x27')]};});_0x17211d[_0x51ce('0x28')]=_[_0x51ce('0x23')](_0x3f559c,_0x51ce('0x21'));_0x17211d[_0x51ce('0x29')]=_[_0x51ce('0x2a')](_0x583e46[_0x51ce('0x29')]);_0x17211d[_0x51ce('0x2b')]=_['intersection'](_0x17211d['model'],_0x17211d[_0x51ce('0x29')]);_0x1bf09c['attributes']=_[_0x51ce('0x2c')](_0x17211d['model'],qs[_0x51ce('0x2d')](_0x583e46['query'][_0x51ce('0x2d')]));_0x1bf09c['attributes']=_0x1bf09c[_0x51ce('0x2e')][_0x51ce('0x2f')]?_0x1bf09c[_0x51ce('0x2e')]:_0x17211d['model'];if(!_0x583e46[_0x51ce('0x29')][_0x51ce('0x30')]('nolimit')){_0x1bf09c['limit']=qs[_0x51ce('0x16')](_0x583e46[_0x51ce('0x29')][_0x51ce('0x16')]);_0x1bf09c['offset']=qs[_0x51ce('0x18')](_0x583e46[_0x51ce('0x29')][_0x51ce('0x18')]);}_0x1bf09c[_0x51ce('0x31')]=qs[_0x51ce('0x32')](_0x583e46['query']['sort']);_0x1bf09c['where']=qs[_0x51ce('0x2b')](_['pick'](_0x583e46[_0x51ce('0x29')],_0x17211d[_0x51ce('0x2b')]),_0x3f559c);if(_0x583e46['query'][_0x51ce('0x33')]){_0x1bf09c['where']=_[_0x51ce('0x34')](_0x1bf09c[_0x51ce('0x35')],{'$or':_[_0x51ce('0x23')](_0x3f559c,function(_0x496507){if(_0x496507['type']!==_0x51ce('0x36')){var _0x5b4471={};_0x5b4471[_0x496507[_0x51ce('0x21')]]={'$like':'%'+_0x583e46[_0x51ce('0x29')][_0x51ce('0x33')]+'%'};return _0x5b4471;}})});}_0x1bf09c=_['merge']({},_0x1bf09c,_0x583e46[_0x51ce('0x37')]);var _0x30b95d={'where':_0x1bf09c[_0x51ce('0x35')]};return db['OpenchannelTransferReport']['count'](_0x30b95d)[_0x51ce('0x1c')](function(_0x514a2d){_0x5cbb5c[_0x51ce('0x17')]=_0x514a2d;if(_0x583e46[_0x51ce('0x29')][_0x51ce('0x38')]){_0x1bf09c[_0x51ce('0x39')]=[{'all':!![]}];}return db[_0x51ce('0x24')]['findAll'](_0x1bf09c);})[_0x51ce('0x1c')](function(_0x26c229){_0x5cbb5c[_0x51ce('0x3a')]=_0x26c229;return _0x5cbb5c;})['then'](respondWithFilteredResult(_0x2e057f,_0x1bf09c))[_0x51ce('0x3b')](handleError(_0x2e057f,null));};exports[_0x51ce('0x3c')]=function(_0x5ec759,_0x1be0c4){var _0x2bea36={'raw':!![],'where':{'id':_0x5ec759[_0x51ce('0x3d')]['id']}},_0x120842={};_0x120842[_0x51ce('0x28')]=_[_0x51ce('0x2a')](db['OpenchannelTransferReport'][_0x51ce('0x3e')]);_0x120842[_0x51ce('0x29')]=_[_0x51ce('0x2a')](_0x5ec759[_0x51ce('0x29')]);_0x120842[_0x51ce('0x2b')]=_[_0x51ce('0x2c')](_0x120842[_0x51ce('0x28')],_0x120842[_0x51ce('0x29')]);_0x2bea36[_0x51ce('0x2e')]=_[_0x51ce('0x2c')](_0x120842[_0x51ce('0x28')],qs[_0x51ce('0x2d')](_0x5ec759[_0x51ce('0x29')][_0x51ce('0x2d')]));_0x2bea36['attributes']=_0x2bea36[_0x51ce('0x2e')][_0x51ce('0x2f')]?_0x2bea36[_0x51ce('0x2e')]:_0x120842[_0x51ce('0x28')];if(_0x5ec759[_0x51ce('0x29')][_0x51ce('0x38')]){_0x2bea36[_0x51ce('0x39')]=[{'all':!![]}];}_0x2bea36=_['merge']({},_0x2bea36,_0x5ec759['options']);return db[_0x51ce('0x24')][_0x51ce('0x3f')](_0x2bea36)['then'](handleEntityNotFound(_0x1be0c4,null))[_0x51ce('0x1c')](respondWithResult(_0x1be0c4,null))[_0x51ce('0x3b')](handleError(_0x1be0c4,null));};exports[_0x51ce('0x40')]=function(_0x159bce,_0x449fff){return db['OpenchannelTransferReport']['create'](_0x159bce[_0x51ce('0x41')],{})['then'](respondWithResult(_0x449fff,0xc9))[_0x51ce('0x3b')](handleError(_0x449fff,null));};exports[_0x51ce('0x1b')]=function(_0x4ae615,_0xba8025){if(_0x4ae615[_0x51ce('0x41')]['id']){delete _0x4ae615[_0x51ce('0x41')]['id'];}return db[_0x51ce('0x24')][_0x51ce('0x3f')]({'where':{'id':_0x4ae615[_0x51ce('0x3d')]['id']}})[_0x51ce('0x1c')](handleEntityNotFound(_0xba8025,null))['then'](saveUpdates(_0x4ae615['body'],null))[_0x51ce('0x1c')](respondWithResult(_0xba8025,null))[_0x51ce('0x3b')](handleError(_0xba8025,null));};exports[_0x51ce('0x1d')]=function(_0x2a3d0c,_0x4ec7ca){return db[_0x51ce('0x24')][_0x51ce('0x3f')]({'where':{'id':_0x2a3d0c[_0x51ce('0x3d')]['id']}})[_0x51ce('0x1c')](handleEntityNotFound(_0x4ec7ca,null))[_0x51ce('0x1c')](removeEntity(_0x4ec7ca,null))[_0x51ce('0x3b')](handleError(_0x4ec7ca,null));};exports[_0x51ce('0x42')]=function(_0x4722d0,_0x245db5){return db['OpenchannelTransferReport'][_0x51ce('0x42')]()[_0x51ce('0x1c')](respondWithResult(_0x245db5,null))[_0x51ce('0x3b')](handleError(_0x245db5,null));}; \ No newline at end of file +var _0x909d=['fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','options','OpenchannelTransferReport','include','findAll','rows','catch','show','params','keys','length','includeAll','merge','create','body','update','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv'];(function(_0x39a421,_0x1154ad){var _0x4b9bc7=function(_0xb3c993){while(--_0xb3c993){_0x39a421['push'](_0x39a421['shift']());}};_0x4b9bc7(++_0x1154ad);}(_0x909d,0xe4));var _0xd909=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x909d[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0xd909('0x0'));var rimraf=require(_0xd909('0x1'));var zipdir=require(_0xd909('0x2'));var jsonpatch=require(_0xd909('0x3'));var rp=require(_0xd909('0x4'));var moment=require(_0xd909('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xd909('0x6'));var util=require(_0xd909('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xd909('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd909('0x9'));var _=require(_0xd909('0xa'));var squel=require('squel');var crypto=require(_0xd909('0xb'));var jsforce=require(_0xd909('0xc'));var deskjs=require(_0xd909('0xd'));var toCsv=require(_0xd909('0x8'));var querystring=require(_0xd909('0xe'));var Papa=require(_0xd909('0xf'));var Redis=require(_0xd909('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xd909('0x11'));var as=require(_0xd909('0x12'));var hardwareService=require(_0xd909('0x13'));var logger=require(_0xd909('0x14'))(_0xd909('0x15'));var utils=require(_0xd909('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xd909('0x17'));var db=require(_0xd909('0x18'))['db'];function respondWithStatusCode(_0x576137,_0x3841b9){_0x3841b9=_0x3841b9||0xcc;return function(_0xaf7c17){if(_0xaf7c17){return _0x576137[_0xd909('0x19')](_0x3841b9);}return _0x576137[_0xd909('0x1a')](_0x3841b9)[_0xd909('0x1b')]();};}function respondWithResult(_0x224978,_0x5b4164){_0x5b4164=_0x5b4164||0xc8;return function(_0x53950c){if(_0x53950c){return _0x224978['status'](_0x5b4164)[_0xd909('0x1c')](_0x53950c);}};}function respondWithFilteredResult(_0xd7d9f9,_0x365f95){return function(_0x48037a){if(_0x48037a){var _0x38610c=typeof _0x365f95['offset']===_0xd909('0x1d')&&typeof _0x365f95['limit']===_0xd909('0x1d');var _0x328ad3=_0x48037a[_0xd909('0x1e')];var _0x4a7a1e=_0x38610c?0x0:_0x365f95[_0xd909('0x1f')];var _0x52b6ec=_0x38610c?_0x48037a[_0xd909('0x1e')]:_0x365f95[_0xd909('0x1f')]+_0x365f95[_0xd909('0x20')];var _0x142e86;if(_0x52b6ec>=_0x328ad3){_0x52b6ec=_0x328ad3;_0x142e86=0xc8;}else{_0x142e86=0xce;}_0xd7d9f9[_0xd909('0x1a')](_0x142e86);return _0xd7d9f9[_0xd909('0x21')](_0xd909('0x22'),_0x4a7a1e+'-'+_0x52b6ec+'/'+_0x328ad3)[_0xd909('0x1c')](_0x48037a);}return null;};}function patchUpdates(_0x32cc86){return function(_0x1c6e62){try{jsonpatch[_0xd909('0x23')](_0x1c6e62,_0x32cc86,!![]);}catch(_0x29c58c){return BPromise[_0xd909('0x24')](_0x29c58c);}return _0x1c6e62[_0xd909('0x25')]();};}function saveUpdates(_0x5e5bac,_0x5c2eca){return function(_0x5daa31){if(_0x5daa31){return _0x5daa31['update'](_0x5e5bac)[_0xd909('0x26')](function(_0x5a173f){return _0x5a173f;});}return null;};}function removeEntity(_0x5cec79,_0x5d44b4){return function(_0x5a2a9d){if(_0x5a2a9d){return _0x5a2a9d[_0xd909('0x27')]()[_0xd909('0x26')](function(){_0x5cec79[_0xd909('0x1a')](0xcc)[_0xd909('0x1b')]();});}};}function handleEntityNotFound(_0x117d09,_0x865155){return function(_0x461f59){if(!_0x461f59){_0x117d09['sendStatus'](0x194);}return _0x461f59;};}function handleError(_0x39cb82,_0x5b7467){_0x5b7467=_0x5b7467||0x1f4;return function(_0xb0a795){logger[_0xd909('0x28')](_0xb0a795[_0xd909('0x29')]);if(_0xb0a795[_0xd909('0x2a')]){delete _0xb0a795[_0xd909('0x2a')];}_0x39cb82['status'](_0x5b7467)[_0xd909('0x2b')](_0xb0a795);};}exports['index']=function(_0x315116,_0x5b5cb6){var _0x49eaa9={},_0x2cfa93={},_0x2d0430={'count':0x0,'rows':[]};var _0x215f70=_[_0xd909('0x2c')](db['OpenchannelTransferReport'][_0xd909('0x2d')],function(_0x5ced2f){return{'name':_0x5ced2f[_0xd909('0x2e')],'type':_0x5ced2f['type']['key']};});_0x2cfa93['model']=_[_0xd909('0x2c')](_0x215f70,_0xd909('0x2a'));_0x2cfa93[_0xd909('0x2f')]=_['keys'](_0x315116[_0xd909('0x2f')]);_0x2cfa93[_0xd909('0x30')]=_[_0xd909('0x31')](_0x2cfa93[_0xd909('0x32')],_0x2cfa93[_0xd909('0x2f')]);_0x49eaa9[_0xd909('0x33')]=_['intersection'](_0x2cfa93['model'],qs[_0xd909('0x34')](_0x315116[_0xd909('0x2f')][_0xd909('0x34')]));_0x49eaa9[_0xd909('0x33')]=_0x49eaa9[_0xd909('0x33')]['length']?_0x49eaa9[_0xd909('0x33')]:_0x2cfa93[_0xd909('0x32')];if(!_0x315116[_0xd909('0x2f')][_0xd909('0x35')](_0xd909('0x36'))){_0x49eaa9[_0xd909('0x20')]=qs[_0xd909('0x20')](_0x315116[_0xd909('0x2f')][_0xd909('0x20')]);_0x49eaa9[_0xd909('0x1f')]=qs['offset'](_0x315116[_0xd909('0x2f')]['offset']);}_0x49eaa9[_0xd909('0x37')]=qs[_0xd909('0x38')](_0x315116[_0xd909('0x2f')]['sort']);_0x49eaa9[_0xd909('0x39')]=qs['filters'](_[_0xd909('0x3a')](_0x315116[_0xd909('0x2f')],_0x2cfa93['filters']),_0x215f70);if(_0x315116[_0xd909('0x2f')][_0xd909('0x3b')]){_0x49eaa9['where']=_['merge'](_0x49eaa9[_0xd909('0x39')],{'$or':_[_0xd909('0x2c')](_0x215f70,function(_0x11d15e){if(_0x11d15e[_0xd909('0x3c')]!==_0xd909('0x3d')){var _0x3b8823={};_0x3b8823[_0x11d15e[_0xd909('0x2a')]]={'$like':'%'+_0x315116['query'][_0xd909('0x3b')]+'%'};return _0x3b8823;}})});}_0x49eaa9=_['merge']({},_0x49eaa9,_0x315116[_0xd909('0x3e')]);var _0x2a7ebe={'where':_0x49eaa9[_0xd909('0x39')]};return db[_0xd909('0x3f')]['count'](_0x2a7ebe)['then'](function(_0x10201e){_0x2d0430[_0xd909('0x1e')]=_0x10201e;if(_0x315116[_0xd909('0x2f')]['includeAll']){_0x49eaa9[_0xd909('0x40')]=[{'all':!![]}];}return db[_0xd909('0x3f')][_0xd909('0x41')](_0x49eaa9);})[_0xd909('0x26')](function(_0x22c713){_0x2d0430[_0xd909('0x42')]=_0x22c713;return _0x2d0430;})[_0xd909('0x26')](respondWithFilteredResult(_0x5b5cb6,_0x49eaa9))[_0xd909('0x43')](handleError(_0x5b5cb6,null));};exports[_0xd909('0x44')]=function(_0x108937,_0x348016){var _0x2c742b={'raw':!![],'where':{'id':_0x108937[_0xd909('0x45')]['id']}},_0x3736d7={};_0x3736d7[_0xd909('0x32')]=_[_0xd909('0x46')](db[_0xd909('0x3f')][_0xd909('0x2d')]);_0x3736d7[_0xd909('0x2f')]=_['keys'](_0x108937['query']);_0x3736d7[_0xd909('0x30')]=_[_0xd909('0x31')](_0x3736d7[_0xd909('0x32')],_0x3736d7[_0xd909('0x2f')]);_0x2c742b[_0xd909('0x33')]=_[_0xd909('0x31')](_0x3736d7[_0xd909('0x32')],qs['fields'](_0x108937[_0xd909('0x2f')][_0xd909('0x34')]));_0x2c742b[_0xd909('0x33')]=_0x2c742b[_0xd909('0x33')][_0xd909('0x47')]?_0x2c742b[_0xd909('0x33')]:_0x3736d7[_0xd909('0x32')];if(_0x108937[_0xd909('0x2f')][_0xd909('0x48')]){_0x2c742b[_0xd909('0x40')]=[{'all':!![]}];}_0x2c742b=_[_0xd909('0x49')]({},_0x2c742b,_0x108937[_0xd909('0x3e')]);return db[_0xd909('0x3f')]['find'](_0x2c742b)['then'](handleEntityNotFound(_0x348016,null))[_0xd909('0x26')](respondWithResult(_0x348016,null))['catch'](handleError(_0x348016,null));};exports[_0xd909('0x4a')]=function(_0x836a15,_0x1acd1c){return db['OpenchannelTransferReport'][_0xd909('0x4a')](_0x836a15[_0xd909('0x4b')],{})[_0xd909('0x26')](respondWithResult(_0x1acd1c,0xc9))[_0xd909('0x43')](handleError(_0x1acd1c,null));};exports[_0xd909('0x4c')]=function(_0x3201ce,_0x192ff3){if(_0x3201ce[_0xd909('0x4b')]['id']){delete _0x3201ce[_0xd909('0x4b')]['id'];}return db[_0xd909('0x3f')]['find']({'where':{'id':_0x3201ce[_0xd909('0x45')]['id']}})['then'](handleEntityNotFound(_0x192ff3,null))[_0xd909('0x26')](saveUpdates(_0x3201ce['body'],null))['then'](respondWithResult(_0x192ff3,null))[_0xd909('0x43')](handleError(_0x192ff3,null));};exports['destroy']=function(_0x155e38,_0x4e745c){return db[_0xd909('0x3f')][_0xd909('0x4d')]({'where':{'id':_0x155e38['params']['id']}})[_0xd909('0x26')](handleEntityNotFound(_0x4e745c,null))[_0xd909('0x26')](removeEntity(_0x4e745c,null))[_0xd909('0x43')](handleError(_0x4e745c,null));};exports['describe']=function(_0x1508eb,_0x486ec6){return db[_0xd909('0x3f')][_0xd909('0x4e')]()[_0xd909('0x26')](respondWithResult(_0x486ec6,null))['catch'](handleError(_0x486ec6,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 80f6f13..a0d5e31 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 _0xeebc=['define','OpenchannelTransferReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./openchannelTransferReport.attributes','exports'];(function(_0x33d24d,_0x2caeed){var _0x36d286=function(_0x5bca11){while(--_0x5bca11){_0x33d24d['push'](_0x33d24d['shift']());}};_0x36d286(++_0x2caeed);}(_0xeebc,0x16f));var _0xceeb=function(_0x3f51cd,_0x288893){_0x3f51cd=_0x3f51cd-0x0;var _0xd35ce0=_0xeebc[_0x3f51cd];return _0xd35ce0;};'use strict';var _=require(_0xceeb('0x0'));var util=require(_0xceeb('0x1'));var logger=require(_0xceeb('0x2'))(_0xceeb('0x3'));var moment=require(_0xceeb('0x4'));var BPromise=require(_0xceeb('0x5'));var rp=require(_0xceeb('0x6'));var fs=require('fs');var path=require(_0xceeb('0x7'));var rimraf=require(_0xceeb('0x8'));var config=require('../../config/environment');var attributes=require(_0xceeb('0x9'));module[_0xceeb('0xa')]=function(_0x179d34,_0x3b90e7){return _0x179d34[_0xceeb('0xb')](_0xceeb('0xc'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0xceeb('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x7e6e=['report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport'];(function(_0xd1c39b,_0x16f0c6){var _0x58f5bc=function(_0x412cf3){while(--_0x412cf3){_0xd1c39b['push'](_0xd1c39b['shift']());}};_0x58f5bc(++_0x16f0c6);}(_0x7e6e,0x6b));var _0xe7e6=function(_0x3c3223,_0x3ec697){_0x3c3223=_0x3c3223-0x0;var _0x11c2af=_0x7e6e[_0x3c3223];return _0x11c2af;};'use strict';var _=require(_0xe7e6('0x0'));var util=require(_0xe7e6('0x1'));var logger=require(_0xe7e6('0x2'))('api');var moment=require(_0xe7e6('0x3'));var BPromise=require(_0xe7e6('0x4'));var rp=require(_0xe7e6('0x5'));var fs=require('fs');var path=require(_0xe7e6('0x6'));var rimraf=require(_0xe7e6('0x7'));var config=require(_0xe7e6('0x8'));var attributes=require(_0xe7e6('0x9'));module[_0xe7e6('0xa')]=function(_0x1ab063,_0x391d3d){return _0x1ab063[_0xe7e6('0xb')](_0xe7e6('0xc'),attributes,{'tableName':_0xe7e6('0xd'),'paranoid':![],'indexes':[{'name':_0xe7e6('0xe'),'fields':[_0xe7e6('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 9c0c147..7a56a47 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 _0xdad2=['request','then','info','request\x20sent','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','error','code','OpenchannelTransferReport,\x20%s,\x20%s','message','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x5cc55a,_0x33e6a3){var _0x49c3ab=function(_0x538162){while(--_0x538162){_0x5cc55a['push'](_0x5cc55a['shift']());}};_0x49c3ab(++_0x33e6a3);}(_0xdad2,0x14c));var _0x2dad=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xdad2[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require(_0x2dad('0x0'));var moment=require(_0x2dad('0x1'));var BPromise=require('bluebird');var rs=require(_0x2dad('0x2'));var fs=require('fs');var Redis=require(_0x2dad('0x3'));var db=require(_0x2dad('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2dad('0x5'))(_0x2dad('0x6'));var config=require('../../config/environment');var jayson=require(_0x2dad('0x7'));var client=jayson[_0x2dad('0x8')][_0x2dad('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf0022b,_0x51dec0,_0x5b6aa2){return new BPromise(function(_0x217e41,_0x3c696f){return client[_0x2dad('0xa')](_0xf0022b,_0x5b6aa2)[_0x2dad('0xb')](function(_0x24bb74){logger[_0x2dad('0xc')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x51dec0,_0x2dad('0xd'));logger['debug'](_0x2dad('0xe'),_0x51dec0,_0x2dad('0xd'),JSON['stringify'](_0x24bb74));if(_0x24bb74[_0x2dad('0xf')]){if(_0x24bb74[_0x2dad('0xf')][_0x2dad('0x10')]===0x1f4){logger['error'](_0x2dad('0x11'),_0x51dec0,_0x24bb74[_0x2dad('0xf')]['message']);return _0x3c696f(_0x24bb74[_0x2dad('0xf')][_0x2dad('0x12')]);}logger[_0x2dad('0xf')](_0x2dad('0x11'),_0x51dec0,_0x24bb74['error'][_0x2dad('0x12')]);return _0x217e41(_0x24bb74[_0x2dad('0xf')][_0x2dad('0x12')]);}else{logger[_0x2dad('0xc')](_0x2dad('0x11'),_0x51dec0,'request\x20sent');_0x217e41(_0x24bb74['result'][_0x2dad('0x12')]);}})['catch'](function(_0x5d5897){logger['error'](_0x2dad('0x11'),_0x51dec0,_0x5d5897);_0x3c696f(_0x5d5897);});});} \ No newline at end of file +var _0x950a=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','result'];(function(_0x3ba932,_0xc15bf9){var _0x43ea93=function(_0x239a64){while(--_0x239a64){_0x3ba932['push'](_0x3ba932['shift']());}};_0x43ea93(++_0xc15bf9);}(_0x950a,0x111));var _0xa950=function(_0x226345,_0x1e16fe){_0x226345=_0x226345-0x0;var _0x2ca077=_0x950a[_0x226345];return _0x2ca077;};'use strict';var _=require(_0xa950('0x0'));var util=require(_0xa950('0x1'));var moment=require(_0xa950('0x2'));var BPromise=require(_0xa950('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa950('0x4'));var db=require(_0xa950('0x5'))['db'];var utils=require(_0xa950('0x6'));var logger=require(_0xa950('0x7'))('rpc');var config=require(_0xa950('0x8'));var jayson=require(_0xa950('0x9'));var client=jayson['client'][_0xa950('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3645b6,_0x5ba2da,_0x5675f8){return new BPromise(function(_0x26e05c,_0x12ef5a){return client[_0xa950('0xb')](_0x3645b6,_0x5675f8)[_0xa950('0xc')](function(_0x274d9a){logger[_0xa950('0xd')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x5ba2da,'request\x20sent');logger['debug'](_0xa950('0xe'),_0x5ba2da,'request\x20sent',JSON[_0xa950('0xf')](_0x274d9a));if(_0x274d9a[_0xa950('0x10')]){if(_0x274d9a[_0xa950('0x10')]['code']===0x1f4){logger[_0xa950('0x10')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x5ba2da,_0x274d9a[_0xa950('0x10')][_0xa950('0x11')]);return _0x12ef5a(_0x274d9a[_0xa950('0x10')]['message']);}logger[_0xa950('0x10')](_0xa950('0x12'),_0x5ba2da,_0x274d9a[_0xa950('0x10')]['message']);return _0x26e05c(_0x274d9a[_0xa950('0x10')][_0xa950('0x11')]);}else{logger[_0xa950('0xd')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x5ba2da,_0xa950('0x13'));_0x26e05c(_0x274d9a[_0xa950('0x14')][_0xa950('0x11')]);}})['catch'](function(_0x146361){logger[_0xa950('0x10')](_0xa950('0x12'),_0x5ba2da,_0x146361);_0x12ef5a(_0x146361);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 899d3c7..283e23b 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 _0xfc5a=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./pause.controller','isAuthenticated','index','get','/:id','show','post','create','put'];(function(_0x6d3bcb,_0x13d055){var _0x3b4104=function(_0x50f3e7){while(--_0x50f3e7){_0x6d3bcb['push'](_0x6d3bcb['shift']());}};_0x3b4104(++_0x13d055);}(_0xfc5a,0x169));var _0xafc5=function(_0x35f4f6,_0x29131d){_0x35f4f6=_0x35f4f6-0x0;var _0x516d9f=_0xfc5a[_0x35f4f6];return _0x516d9f;};'use strict';var multer=require(_0xafc5('0x0'));var util=require(_0xafc5('0x1'));var path=require(_0xafc5('0x2'));var timeout=require(_0xafc5('0x3'));var express=require(_0xafc5('0x4'));var router=express[_0xafc5('0x5')]();var fs_extra=require(_0xafc5('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xafc5('0x7'));var config=require('../../config/environment');var controller=require(_0xafc5('0x8'));router['get']('/',auth[_0xafc5('0x9')](),controller[_0xafc5('0xa')]);router[_0xafc5('0xb')](_0xafc5('0xc'),auth[_0xafc5('0x9')](),controller[_0xafc5('0xd')]);router[_0xafc5('0xe')]('/',auth[_0xafc5('0x9')](),controller[_0xafc5('0xf')]);router[_0xafc5('0x10')](_0xafc5('0xc'),auth[_0xafc5('0x9')](),controller[_0xafc5('0x11')]);router[_0xafc5('0x12')]('/:id',auth[_0xafc5('0x9')](),controller[_0xafc5('0x13')]);module[_0xafc5('0x14')]=router; \ No newline at end of file +var _0x36dc=['show','post','create','put','destroy','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id'];(function(_0x921c73,_0xb0d1b0){var _0x2fa89d=function(_0x43f30d){while(--_0x43f30d){_0x921c73['push'](_0x921c73['shift']());}};_0x2fa89d(++_0xb0d1b0);}(_0x36dc,0x18b));var _0xc36d=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x36dc[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0xc36d('0x0'));var util=require(_0xc36d('0x1'));var path=require(_0xc36d('0x2'));var timeout=require('connect-timeout');var express=require(_0xc36d('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc36d('0x4'));var interaction=require(_0xc36d('0x5'));var config=require(_0xc36d('0x6'));var controller=require('./pause.controller');router[_0xc36d('0x7')]('/',auth[_0xc36d('0x8')](),controller['index']);router[_0xc36d('0x7')](_0xc36d('0x9'),auth[_0xc36d('0x8')](),controller[_0xc36d('0xa')]);router[_0xc36d('0xb')]('/',auth[_0xc36d('0x8')](),controller[_0xc36d('0xc')]);router[_0xc36d('0xd')](_0xc36d('0x9'),auth[_0xc36d('0x8')](),controller['update']);router['delete'](_0xc36d('0x9'),auth['isAuthenticated'](),controller[_0xc36d('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index e4e7a50..f42a76b 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 _0x5c00=['exports'];(function(_0x36175d,_0x3d17c4){var _0x170546=function(_0x5a4326){while(--_0x5a4326){_0x36175d['push'](_0x36175d['shift']());}};_0x170546(++_0x3d17c4);}(_0x5c00,0x1ce));var _0x05c0=function(_0x2adaa9,_0x298fc0){_0x2adaa9=_0x2adaa9-0x0;var _0x2a3124=_0x5c00[_0x2adaa9];return _0x2a3124;};'use strict';var Sequelize=require('sequelize');module[_0x05c0('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1309=['exports'];(function(_0x1ca939,_0x4e4021){var _0x2d1c42=function(_0xb4474e){while(--_0xb4474e){_0x1ca939['push'](_0x1ca939['shift']());}};_0x2d1c42(++_0x4e4021);}(_0x1309,0x82));var _0x9130=function(_0x548229,_0x31676b){_0x548229=_0x548229-0x0;var _0x414872=_0x1309[_0x548229];return _0x414872;};'use strict';var Sequelize=require('sequelize');module[_0x9130('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','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 2fc00c5..f8666da 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 _0xa534=['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/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','get','Pauses','stack','name','send','Pause','rawAttributes','type','key','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','map','options','includeAll','include','findAll','rows','show','params','keys','find','catch','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','create','body','eml-format','zip-dir','moment','bluebird','mustache','util','path','sox'];(function(_0x320f4d,_0x480288){var _0x5cea13=function(_0x2b3019){while(--_0x2b3019){_0x320f4d['push'](_0x320f4d['shift']());}};_0x5cea13(++_0x480288);}(_0xa534,0x138));var _0x4a53=function(_0x3c8e9a,_0x384306){_0x3c8e9a=_0x3c8e9a-0x0;var _0x2d4c57=_0xa534[_0x3c8e9a];return _0x2d4c57;};'use strict';var emlformat=require(_0x4a53('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4a53('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4a53('0x2'));var BPromise=require(_0x4a53('0x3'));var Mustache=require(_0x4a53('0x4'));var util=require(_0x4a53('0x5'));var path=require(_0x4a53('0x6'));var sox=require(_0x4a53('0x7'));var csv=require(_0x4a53('0x8'));var ejs=require(_0x4a53('0x9'));var fs=require('fs');var fs_extra=require(_0x4a53('0xa'));var _=require('lodash');var squel=require(_0x4a53('0xb'));var crypto=require(_0x4a53('0xc'));var jsforce=require(_0x4a53('0xd'));var deskjs=require(_0x4a53('0xe'));var toCsv=require(_0x4a53('0x8'));var querystring=require(_0x4a53('0xf'));var Papa=require(_0x4a53('0x10'));var Redis=require(_0x4a53('0x11'));var authService=require(_0x4a53('0x12'));var qs=require(_0x4a53('0x13'));var as=require(_0x4a53('0x14'));var hardwareService=require(_0x4a53('0x15'));var logger=require(_0x4a53('0x16'))(_0x4a53('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4a53('0x18'));var db=require(_0x4a53('0x19'))['db'];function respondWithStatusCode(_0x42a681,_0x31129b){_0x31129b=_0x31129b||0xcc;return function(_0x4f790a){if(_0x4f790a){return _0x42a681[_0x4a53('0x1a')](_0x31129b);}return _0x42a681['status'](_0x31129b)[_0x4a53('0x1b')]();};}function respondWithResult(_0x1c2de1,_0xf3aa1){_0xf3aa1=_0xf3aa1||0xc8;return function(_0x5a14a4){if(_0x5a14a4){return _0x1c2de1[_0x4a53('0x1c')](_0xf3aa1)[_0x4a53('0x1d')](_0x5a14a4);}};}function respondWithFilteredResult(_0x516f9b,_0x2c1082){return function(_0x101161){if(_0x101161){var _0x5e586e=typeof _0x2c1082[_0x4a53('0x1e')]===_0x4a53('0x1f')&&typeof _0x2c1082[_0x4a53('0x20')]==='undefined';var _0x3d76fa=_0x101161['count'];var _0x120a52=_0x5e586e?0x0:_0x2c1082[_0x4a53('0x1e')];var _0x5947ee=_0x5e586e?_0x101161[_0x4a53('0x21')]:_0x2c1082[_0x4a53('0x1e')]+_0x2c1082[_0x4a53('0x20')];var _0x13f563;if(_0x5947ee>=_0x3d76fa){_0x5947ee=_0x3d76fa;_0x13f563=0xc8;}else{_0x13f563=0xce;}_0x516f9b[_0x4a53('0x1c')](_0x13f563);return _0x516f9b[_0x4a53('0x22')]('Content-Range',_0x120a52+'-'+_0x5947ee+'/'+_0x3d76fa)[_0x4a53('0x1d')](_0x101161);}return null;};}function patchUpdates(_0x309453){return function(_0x2286c6){try{jsonpatch[_0x4a53('0x23')](_0x2286c6,_0x309453,!![]);}catch(_0x1c85fa){return BPromise['reject'](_0x1c85fa);}return _0x2286c6[_0x4a53('0x24')]();};}function saveUpdates(_0x1719fd,_0x2a2bcb){return function(_0x4e28b8){if(_0x4e28b8){return _0x4e28b8[_0x4a53('0x25')](_0x1719fd)[_0x4a53('0x26')](function(_0x20b77e){return _0x20b77e;});}return null;};}function removeEntity(_0xde35d8,_0x573eb2){return function(_0x17c088){if(_0x17c088){return _0x17c088[_0x4a53('0x27')]()[_0x4a53('0x26')](function(){var _0x1c66f5=_0x17c088[_0x4a53('0x28')]({'plain':!![]});var _0x33433c=_0x4a53('0x29');return db['UserProfileResource']['destroy']({'where':{'type':_0x33433c,'resourceId':_0x1c66f5['id']}})[_0x4a53('0x26')](function(){return _0x17c088;});})[_0x4a53('0x26')](function(){_0xde35d8[_0x4a53('0x1c')](0xcc)[_0x4a53('0x1b')]();});}};}function handleEntityNotFound(_0x4adf0f,_0x57ec46){return function(_0x386df0){if(!_0x386df0){_0x4adf0f[_0x4a53('0x1a')](0x194);}return _0x386df0;};}function handleError(_0x107046,_0x3bde2c){_0x3bde2c=_0x3bde2c||0x1f4;return function(_0x5dfbd4){logger['error'](_0x5dfbd4[_0x4a53('0x2a')]);if(_0x5dfbd4[_0x4a53('0x2b')]){delete _0x5dfbd4[_0x4a53('0x2b')];}_0x107046['status'](_0x3bde2c)[_0x4a53('0x2c')](_0x5dfbd4);};}exports['index']=function(_0x2f20a3,_0x23c37a){var _0x1df033={},_0x446f9e={},_0x2aaae2={'count':0x0,'rows':[]};var _0x205e87=_['map'](db[_0x4a53('0x2d')][_0x4a53('0x2e')],function(_0x2842dd){return{'name':_0x2842dd['fieldName'],'type':_0x2842dd[_0x4a53('0x2f')][_0x4a53('0x30')]};});_0x446f9e['model']=_['map'](_0x205e87,_0x4a53('0x2b'));_0x446f9e[_0x4a53('0x31')]=_['keys'](_0x2f20a3[_0x4a53('0x31')]);_0x446f9e[_0x4a53('0x32')]=_['intersection'](_0x446f9e[_0x4a53('0x33')],_0x446f9e[_0x4a53('0x31')]);_0x1df033[_0x4a53('0x34')]=_[_0x4a53('0x35')](_0x446f9e[_0x4a53('0x33')],qs['fields'](_0x2f20a3[_0x4a53('0x31')][_0x4a53('0x36')]));_0x1df033[_0x4a53('0x34')]=_0x1df033['attributes'][_0x4a53('0x37')]?_0x1df033[_0x4a53('0x34')]:_0x446f9e[_0x4a53('0x33')];if(!_0x2f20a3[_0x4a53('0x31')][_0x4a53('0x38')](_0x4a53('0x39'))){_0x1df033['limit']=qs[_0x4a53('0x20')](_0x2f20a3[_0x4a53('0x31')]['limit']);_0x1df033['offset']=qs['offset'](_0x2f20a3['query'][_0x4a53('0x1e')]);}_0x1df033['order']=qs[_0x4a53('0x3a')](_0x2f20a3[_0x4a53('0x31')][_0x4a53('0x3a')]);_0x1df033[_0x4a53('0x3b')]=qs[_0x4a53('0x32')](_['pick'](_0x2f20a3[_0x4a53('0x31')],_0x446f9e[_0x4a53('0x32')]),_0x205e87);if(_0x2f20a3[_0x4a53('0x31')][_0x4a53('0x3c')]){_0x1df033[_0x4a53('0x3b')]=_[_0x4a53('0x3d')](_0x1df033[_0x4a53('0x3b')],{'$or':_[_0x4a53('0x3e')](_0x205e87,function(_0x1afeb2){if(_0x1afeb2[_0x4a53('0x2f')]!=='VIRTUAL'){var _0x337aaf={};_0x337aaf[_0x1afeb2[_0x4a53('0x2b')]]={'$like':'%'+_0x2f20a3['query'][_0x4a53('0x3c')]+'%'};return _0x337aaf;}})});}_0x1df033=_['merge']({},_0x1df033,_0x2f20a3[_0x4a53('0x3f')]);var _0x1bb16d={'where':_0x1df033['where']};return db[_0x4a53('0x2d')][_0x4a53('0x21')](_0x1bb16d)[_0x4a53('0x26')](function(_0x369e53){_0x2aaae2[_0x4a53('0x21')]=_0x369e53;if(_0x2f20a3[_0x4a53('0x31')][_0x4a53('0x40')]){_0x1df033[_0x4a53('0x41')]=[{'all':!![]}];}return db[_0x4a53('0x2d')][_0x4a53('0x42')](_0x1df033);})[_0x4a53('0x26')](function(_0x4d6080){_0x2aaae2[_0x4a53('0x43')]=_0x4d6080;return _0x2aaae2;})[_0x4a53('0x26')](respondWithFilteredResult(_0x23c37a,_0x1df033))['catch'](handleError(_0x23c37a,null));};exports[_0x4a53('0x44')]=function(_0x3c2cc4,_0x5b75a6){var _0x51baa7={'raw':!![],'where':{'id':_0x3c2cc4[_0x4a53('0x45')]['id']}},_0x4c7ce4={};_0x4c7ce4[_0x4a53('0x33')]=_[_0x4a53('0x46')](db[_0x4a53('0x2d')][_0x4a53('0x2e')]);_0x4c7ce4[_0x4a53('0x31')]=_[_0x4a53('0x46')](_0x3c2cc4['query']);_0x4c7ce4[_0x4a53('0x32')]=_[_0x4a53('0x35')](_0x4c7ce4['model'],_0x4c7ce4[_0x4a53('0x31')]);_0x51baa7[_0x4a53('0x34')]=_[_0x4a53('0x35')](_0x4c7ce4['model'],qs[_0x4a53('0x36')](_0x3c2cc4[_0x4a53('0x31')][_0x4a53('0x36')]));_0x51baa7[_0x4a53('0x34')]=_0x51baa7['attributes'][_0x4a53('0x37')]?_0x51baa7[_0x4a53('0x34')]:_0x4c7ce4[_0x4a53('0x33')];if(_0x3c2cc4[_0x4a53('0x31')][_0x4a53('0x40')]){_0x51baa7[_0x4a53('0x41')]=[{'all':!![]}];}_0x51baa7=_['merge']({},_0x51baa7,_0x3c2cc4[_0x4a53('0x3f')]);return db[_0x4a53('0x2d')][_0x4a53('0x47')](_0x51baa7)[_0x4a53('0x26')](handleEntityNotFound(_0x5b75a6,null))[_0x4a53('0x26')](respondWithResult(_0x5b75a6,null))[_0x4a53('0x48')](handleError(_0x5b75a6,null));};exports['create']=function(_0x52dfa3,_0x3eadd3){return db['Pause']['create'](_0x52dfa3['body'],{})['then'](function(_0x30bb87){var _0x5f8c99=_0x52dfa3[_0x4a53('0x49')][_0x4a53('0x28')]({'plain':!![]});if(!_0x5f8c99)throw new Error(_0x4a53('0x4a'));if(_0x5f8c99['role']===_0x4a53('0x49')){var _0x4577a8=_0x30bb87[_0x4a53('0x28')]({'plain':!![]});var _0x23e8fb='Pauses';return db['UserProfileSection'][_0x4a53('0x47')]({'where':{'name':_0x23e8fb,'userProfileId':_0x5f8c99[_0x4a53('0x4b')]},'raw':!![]})['then'](function(_0x2b283b){if(_0x2b283b&&_0x2b283b[_0x4a53('0x4c')]===0x0){return db[_0x4a53('0x4d')][_0x4a53('0x4e')]({'name':_0x4577a8[_0x4a53('0x2b')],'resourceId':_0x4577a8['id'],'type':_0x2b283b[_0x4a53('0x2b')],'sectionId':_0x2b283b['id']},{})[_0x4a53('0x26')](function(){return _0x30bb87;});}else{return _0x30bb87;}})[_0x4a53('0x48')](function(_0xf0a575){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xf0a575);throw _0xf0a575;});}return _0x30bb87;})['then'](respondWithResult(_0x3eadd3,0xc9))[_0x4a53('0x48')](handleError(_0x3eadd3,null));};exports[_0x4a53('0x25')]=function(_0x3fbcaa,_0x26e6c6){if(_0x3fbcaa[_0x4a53('0x4f')]['id']){delete _0x3fbcaa['body']['id'];}return db[_0x4a53('0x2d')][_0x4a53('0x47')]({'where':{'id':_0x3fbcaa[_0x4a53('0x45')]['id']}})[_0x4a53('0x26')](handleEntityNotFound(_0x26e6c6,null))['then'](saveUpdates(_0x3fbcaa[_0x4a53('0x4f')],null))['then'](respondWithResult(_0x26e6c6,null))['catch'](handleError(_0x26e6c6,null));};exports[_0x4a53('0x27')]=function(_0x59f456,_0x1729d0){return db[_0x4a53('0x2d')][_0x4a53('0x47')]({'where':{'id':_0x59f456[_0x4a53('0x45')]['id']}})[_0x4a53('0x26')](handleEntityNotFound(_0x1729d0,null))[_0x4a53('0x26')](removeEntity(_0x1729d0,null))[_0x4a53('0x48')](handleError(_0x1729d0,null));}; \ No newline at end of file +var _0x029e=['filter','where','merge','type','VIRTUAL','options','Pause','includeAll','include','findAll','catch','show','params','keys','rawAttributes','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','limit','undefined','count','apply','reject','save','update','then','destroy','Pauses','UserProfileResource','end','stack','name','index','map','model','filters','intersection','query','attributes','fields','length','hasOwnProperty','order','pick'];(function(_0x168a9f,_0x37dd71){var _0xdeaa2f=function(_0x55a8fd){while(--_0x55a8fd){_0x168a9f['push'](_0x168a9f['shift']());}};_0xdeaa2f(++_0x37dd71);}(_0x029e,0x1db));var _0xe029=function(_0x575b52,_0x120504){_0x575b52=_0x575b52-0x0;var _0x21c9a6=_0x029e[_0x575b52];return _0x21c9a6;};'use strict';var emlformat=require(_0xe029('0x0'));var rimraf=require(_0xe029('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe029('0x2'));var rp=require('request-promise');var moment=require(_0xe029('0x3'));var BPromise=require(_0xe029('0x4'));var Mustache=require(_0xe029('0x5'));var util=require(_0xe029('0x6'));var path=require('path');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(_0xe029('0x7'));var squel=require(_0xe029('0x8'));var crypto=require('crypto');var jsforce=require(_0xe029('0x9'));var deskjs=require(_0xe029('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe029('0xb'));var authService=require(_0xe029('0xc'));var qs=require(_0xe029('0xd'));var as=require(_0xe029('0xe'));var hardwareService=require(_0xe029('0xf'));var logger=require('../../config/logger')(_0xe029('0x10'));var utils=require(_0xe029('0x11'));var config=require(_0xe029('0x12'));var licenseUtil=require(_0xe029('0x13'));var db=require(_0xe029('0x14'))['db'];function respondWithStatusCode(_0xa62d2c,_0x47fc14){_0x47fc14=_0x47fc14||0xcc;return function(_0x194674){if(_0x194674){return _0xa62d2c['sendStatus'](_0x47fc14);}return _0xa62d2c[_0xe029('0x15')](_0x47fc14)['end']();};}function respondWithResult(_0x51a9c4,_0x41cc4e){_0x41cc4e=_0x41cc4e||0xc8;return function(_0x2c6aa0){if(_0x2c6aa0){return _0x51a9c4[_0xe029('0x15')](_0x41cc4e)[_0xe029('0x16')](_0x2c6aa0);}};}function respondWithFilteredResult(_0x268cdb,_0x47d98f){return function(_0x5d968c){if(_0x5d968c){var _0x4a96b1=typeof _0x47d98f[_0xe029('0x17')]==='undefined'&&typeof _0x47d98f[_0xe029('0x18')]===_0xe029('0x19');var _0x5f2eea=_0x5d968c['count'];var _0x5e21ec=_0x4a96b1?0x0:_0x47d98f['offset'];var _0x4a25d9=_0x4a96b1?_0x5d968c[_0xe029('0x1a')]:_0x47d98f['offset']+_0x47d98f[_0xe029('0x18')];var _0x578d81;if(_0x4a25d9>=_0x5f2eea){_0x4a25d9=_0x5f2eea;_0x578d81=0xc8;}else{_0x578d81=0xce;}_0x268cdb[_0xe029('0x15')](_0x578d81);return _0x268cdb['set']('Content-Range',_0x5e21ec+'-'+_0x4a25d9+'/'+_0x5f2eea)[_0xe029('0x16')](_0x5d968c);}return null;};}function patchUpdates(_0x16605e){return function(_0x53f092){try{jsonpatch[_0xe029('0x1b')](_0x53f092,_0x16605e,!![]);}catch(_0x521f63){return BPromise[_0xe029('0x1c')](_0x521f63);}return _0x53f092[_0xe029('0x1d')]();};}function saveUpdates(_0x556bfb,_0x232882){return function(_0x192d9a){if(_0x192d9a){return _0x192d9a[_0xe029('0x1e')](_0x556bfb)[_0xe029('0x1f')](function(_0x29cdf3){return _0x29cdf3;});}return null;};}function removeEntity(_0x43a641,_0x2bde30){return function(_0x1e794b){if(_0x1e794b){return _0x1e794b[_0xe029('0x20')]()[_0xe029('0x1f')](function(){var _0x3a8a14=_0x1e794b['get']({'plain':!![]});var _0x3c3108=_0xe029('0x21');return db[_0xe029('0x22')][_0xe029('0x20')]({'where':{'type':_0x3c3108,'resourceId':_0x3a8a14['id']}})['then'](function(){return _0x1e794b;});})[_0xe029('0x1f')](function(){_0x43a641[_0xe029('0x15')](0xcc)[_0xe029('0x23')]();});}};}function handleEntityNotFound(_0x526a15,_0x244125){return function(_0x5a5169){if(!_0x5a5169){_0x526a15['sendStatus'](0x194);}return _0x5a5169;};}function handleError(_0x362d64,_0x1228d7){_0x1228d7=_0x1228d7||0x1f4;return function(_0x4b000a){logger['error'](_0x4b000a[_0xe029('0x24')]);if(_0x4b000a[_0xe029('0x25')]){delete _0x4b000a[_0xe029('0x25')];}_0x362d64[_0xe029('0x15')](_0x1228d7)['send'](_0x4b000a);};}exports[_0xe029('0x26')]=function(_0x38effe,_0x34c45c){var _0x5ef1ad={},_0x4c393f={},_0x2d490a={'count':0x0,'rows':[]};var _0x1ecefa=_[_0xe029('0x27')](db['Pause']['rawAttributes'],function(_0x46ab0e){return{'name':_0x46ab0e['fieldName'],'type':_0x46ab0e['type']['key']};});_0x4c393f[_0xe029('0x28')]=_['map'](_0x1ecefa,_0xe029('0x25'));_0x4c393f['query']=_['keys'](_0x38effe['query']);_0x4c393f[_0xe029('0x29')]=_[_0xe029('0x2a')](_0x4c393f['model'],_0x4c393f[_0xe029('0x2b')]);_0x5ef1ad[_0xe029('0x2c')]=_[_0xe029('0x2a')](_0x4c393f[_0xe029('0x28')],qs[_0xe029('0x2d')](_0x38effe[_0xe029('0x2b')][_0xe029('0x2d')]));_0x5ef1ad['attributes']=_0x5ef1ad['attributes'][_0xe029('0x2e')]?_0x5ef1ad[_0xe029('0x2c')]:_0x4c393f[_0xe029('0x28')];if(!_0x38effe[_0xe029('0x2b')][_0xe029('0x2f')]('nolimit')){_0x5ef1ad['limit']=qs['limit'](_0x38effe[_0xe029('0x2b')]['limit']);_0x5ef1ad[_0xe029('0x17')]=qs['offset'](_0x38effe[_0xe029('0x2b')]['offset']);}_0x5ef1ad[_0xe029('0x30')]=qs['sort'](_0x38effe['query']['sort']);_0x5ef1ad['where']=qs[_0xe029('0x29')](_[_0xe029('0x31')](_0x38effe[_0xe029('0x2b')],_0x4c393f[_0xe029('0x29')]),_0x1ecefa);if(_0x38effe[_0xe029('0x2b')][_0xe029('0x32')]){_0x5ef1ad[_0xe029('0x33')]=_[_0xe029('0x34')](_0x5ef1ad[_0xe029('0x33')],{'$or':_['map'](_0x1ecefa,function(_0x55a0e8){if(_0x55a0e8[_0xe029('0x35')]!==_0xe029('0x36')){var _0x45f356={};_0x45f356[_0x55a0e8['name']]={'$like':'%'+_0x38effe['query'][_0xe029('0x32')]+'%'};return _0x45f356;}})});}_0x5ef1ad=_[_0xe029('0x34')]({},_0x5ef1ad,_0x38effe[_0xe029('0x37')]);var _0x43c728={'where':_0x5ef1ad[_0xe029('0x33')]};return db[_0xe029('0x38')]['count'](_0x43c728)['then'](function(_0x5b79ee){_0x2d490a[_0xe029('0x1a')]=_0x5b79ee;if(_0x38effe['query'][_0xe029('0x39')]){_0x5ef1ad[_0xe029('0x3a')]=[{'all':!![]}];}return db['Pause'][_0xe029('0x3b')](_0x5ef1ad);})[_0xe029('0x1f')](function(_0xc89013){_0x2d490a['rows']=_0xc89013;return _0x2d490a;})[_0xe029('0x1f')](respondWithFilteredResult(_0x34c45c,_0x5ef1ad))[_0xe029('0x3c')](handleError(_0x34c45c,null));};exports[_0xe029('0x3d')]=function(_0x108dbb,_0x27b1f0){var _0x3e6595={'raw':!![],'where':{'id':_0x108dbb[_0xe029('0x3e')]['id']}},_0x127747={};_0x127747[_0xe029('0x28')]=_[_0xe029('0x3f')](db[_0xe029('0x38')][_0xe029('0x40')]);_0x127747[_0xe029('0x2b')]=_[_0xe029('0x3f')](_0x108dbb[_0xe029('0x2b')]);_0x127747['filters']=_[_0xe029('0x2a')](_0x127747[_0xe029('0x28')],_0x127747[_0xe029('0x2b')]);_0x3e6595[_0xe029('0x2c')]=_[_0xe029('0x2a')](_0x127747[_0xe029('0x28')],qs['fields'](_0x108dbb[_0xe029('0x2b')][_0xe029('0x2d')]));_0x3e6595[_0xe029('0x2c')]=_0x3e6595[_0xe029('0x2c')][_0xe029('0x2e')]?_0x3e6595[_0xe029('0x2c')]:_0x127747['model'];if(_0x108dbb[_0xe029('0x2b')]['includeAll']){_0x3e6595[_0xe029('0x3a')]=[{'all':!![]}];}_0x3e6595=_[_0xe029('0x34')]({},_0x3e6595,_0x108dbb[_0xe029('0x37')]);return db['Pause'][_0xe029('0x41')](_0x3e6595)['then'](handleEntityNotFound(_0x27b1f0,null))[_0xe029('0x1f')](respondWithResult(_0x27b1f0,null))[_0xe029('0x3c')](handleError(_0x27b1f0,null));};exports[_0xe029('0x42')]=function(_0x663a82,_0xa4a06b){return db[_0xe029('0x38')]['create'](_0x663a82[_0xe029('0x43')],{})[_0xe029('0x1f')](function(_0x3e017d){var _0x5d144c=_0x663a82[_0xe029('0x44')][_0xe029('0x45')]({'plain':!![]});if(!_0x5d144c)throw new Error(_0xe029('0x46'));if(_0x5d144c[_0xe029('0x47')]===_0xe029('0x44')){var _0x3e1a5b=_0x3e017d[_0xe029('0x45')]({'plain':!![]});var _0x159a01='Pauses';return db[_0xe029('0x48')][_0xe029('0x41')]({'where':{'name':_0x159a01,'userProfileId':_0x5d144c['userProfileId']},'raw':!![]})['then'](function(_0x2fc68b){if(_0x2fc68b&&_0x2fc68b[_0xe029('0x49')]===0x0){return db[_0xe029('0x22')][_0xe029('0x42')]({'name':_0x3e1a5b[_0xe029('0x25')],'resourceId':_0x3e1a5b['id'],'type':_0x2fc68b[_0xe029('0x25')],'sectionId':_0x2fc68b['id']},{})[_0xe029('0x1f')](function(){return _0x3e017d;});}else{return _0x3e017d;}})['catch'](function(_0x463499){logger['error'](_0xe029('0x4a'),_0x463499);throw _0x463499;});}return _0x3e017d;})['then'](respondWithResult(_0xa4a06b,0xc9))['catch'](handleError(_0xa4a06b,null));};exports['update']=function(_0x26960f,_0x3198cb){if(_0x26960f[_0xe029('0x43')]['id']){delete _0x26960f['body']['id'];}return db[_0xe029('0x38')][_0xe029('0x41')]({'where':{'id':_0x26960f[_0xe029('0x3e')]['id']}})[_0xe029('0x1f')](handleEntityNotFound(_0x3198cb,null))[_0xe029('0x1f')](saveUpdates(_0x26960f[_0xe029('0x43')],null))[_0xe029('0x1f')](respondWithResult(_0x3198cb,null))['catch'](handleError(_0x3198cb,null));};exports[_0xe029('0x20')]=function(_0x144bd9,_0x4cd7f5){return db[_0xe029('0x38')][_0xe029('0x41')]({'where':{'id':_0x144bd9[_0xe029('0x3e')]['id']}})[_0xe029('0x1f')](handleEntityNotFound(_0x4cd7f5,null))[_0xe029('0x1f')](removeEntity(_0x4cd7f5,null))[_0xe029('0x3c')](handleError(_0x4cd7f5,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 12a172f..78a1314 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 _0x9957=['exports','define','Pause','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./pause.attributes'];(function(_0x5a3cf0,_0x160a68){var _0x5a64ee=function(_0x34cd1d){while(--_0x34cd1d){_0x5a3cf0['push'](_0x5a3cf0['shift']());}};_0x5a64ee(++_0x160a68);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'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':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5fc3=['lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./pause.attributes','exports','define','tools_pauses'];(function(_0x5d7ed7,_0x5e8ec6){var _0x45f7a2=function(_0x25aacf){while(--_0x25aacf){_0x5d7ed7['push'](_0x5d7ed7['shift']());}};_0x45f7a2(++_0x5e8ec6);}(_0x5fc3,0xa8));var _0x35fc=function(_0x256b72,_0x340985){_0x256b72=_0x256b72-0x0;var _0x2183e3=_0x5fc3[_0x256b72];return _0x2183e3;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var logger=require('../../config/logger')(_0x35fc('0x2'));var moment=require(_0x35fc('0x3'));var BPromise=require(_0x35fc('0x4'));var rp=require(_0x35fc('0x5'));var fs=require('fs');var path=require(_0x35fc('0x6'));var rimraf=require('rimraf');var config=require(_0x35fc('0x7'));var attributes=require(_0x35fc('0x8'));module[_0x35fc('0x9')]=function(_0x5b85ad,_0x5754be){return _0x5b85ad[_0x35fc('0xa')]('Pause',attributes,{'tableName':_0x35fc('0xb'),'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 61e6158..6d6a064 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(_0x2b1f38,_0x5dacff){var _0x4aad9f=function(_0x384ed5){while(--_0x384ed5){_0x2b1f38['push'](_0x2b1f38['shift']());}};_0x4aad9f(++_0x5dacff);}(_0xb10b,0x12a));var _0xbb10=function(_0x203f90,_0x1f112d){_0x203f90=_0x203f90-0x0;var _0x3f8714=_0xb10b[_0x203f90];return _0x3f8714;};'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(_0x203b7a,_0xc09a1e){var _0x5b27d5=function(_0x448975){while(--_0x448975){_0x203b7a['push'](_0x203b7a['shift']());}};_0x5b27d5(++_0xc09a1e);}(_0xb10b,0x12a));var _0xbb10=function(_0x26dcd8,_0x461d6b){_0x26dcd8=_0x26dcd8-0x0;var _0x1654e9=_0xb10b[_0x26dcd8];return _0x1654e9;};'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 7ace2a8..36f5c2c 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 _0xd2ea=['./plugin.controller','get','isAuthenticated','/webhook','webhookGet','/:id','download','diskStorage','root','server/files/plugins','originalname','replace','extname','now','post','single','file','upload','webhookPost','put','delete','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x15b399,_0x59db1a){var _0x199f2d=function(_0x3bd31c){while(--_0x3bd31c){_0x15b399['push'](_0x15b399['shift']());}};_0x199f2d(++_0x59db1a);}(_0xd2ea,0x15f));var _0xad2e=function(_0x38f91b,_0xc0fdc7){_0x38f91b=_0x38f91b-0x0;var _0xe8cfde=_0xd2ea[_0x38f91b];return _0xe8cfde;};'use strict';var multer=require(_0xad2e('0x0'));var util=require(_0xad2e('0x1'));var path=require(_0xad2e('0x2'));var timeout=require(_0xad2e('0x3'));var express=require(_0xad2e('0x4'));var router=express['Router']();var fs_extra=require(_0xad2e('0x5'));var auth=require(_0xad2e('0x6'));var interaction=require(_0xad2e('0x7'));var config=require(_0xad2e('0x8'));var controller=require(_0xad2e('0x9'));router[_0xad2e('0xa')]('/',auth[_0xad2e('0xb')](),controller['index']);router[_0xad2e('0xa')](_0xad2e('0xc'),controller[_0xad2e('0xd')]);router['get'](_0xad2e('0xe'),auth[_0xad2e('0xb')](),controller['show']);router[_0xad2e('0xa')]('/:id/download',auth[_0xad2e('0xb')](),controller[_0xad2e('0xf')]);var upload=multer({'storage':multer[_0xad2e('0x10')]({'destination':function(_0x24c5da,_0x489f25,_0x7df3c6){_0x7df3c6(null,path['join'](config[_0xad2e('0x11')],_0xad2e('0x12')));},'filename':function(_0x433696,_0x42e2f2,_0x59a342){_0x42e2f2[_0xad2e('0x13')]=_0x42e2f2['originalname'][_0xad2e('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x59a342(null,util['format']('%s-%s%s',path['basename'](_0x42e2f2['originalname'],path[_0xad2e('0x15')](_0x42e2f2[_0xad2e('0x13')])),Date[_0xad2e('0x16')](),path[_0xad2e('0x15')](_0x42e2f2[_0xad2e('0x13')])));}})});router[_0xad2e('0x17')]('/',upload[_0xad2e('0x18')](_0xad2e('0x19')),controller[_0xad2e('0x1a')]);router[_0xad2e('0x17')](_0xad2e('0xc'),controller[_0xad2e('0x1b')]);router[_0xad2e('0x1c')](_0xad2e('0xe'),auth[_0xad2e('0xb')](),controller['update']);router[_0xad2e('0x1d')](_0xad2e('0xe'),auth['isAuthenticated'](),controller['delete']);module['exports']=router; \ No newline at end of file +var _0x4d9e=['upload','webhookPost','put','delete','multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./plugin.controller','get','isAuthenticated','index','/webhook','/:id','show','/:id/download','download','diskStorage','join','root','%s-%s%s','basename','originalname','now','extname','single','file'];(function(_0x5d88c0,_0x5d7d83){var _0x1b40f0=function(_0x3fde10){while(--_0x3fde10){_0x5d88c0['push'](_0x5d88c0['shift']());}};_0x1b40f0(++_0x5d7d83);}(_0x4d9e,0x18c));var _0xe4d9=function(_0x57f474,_0x20038d){_0x57f474=_0x57f474-0x0;var _0x5aa692=_0x4d9e[_0x57f474];return _0x5aa692;};'use strict';var multer=require(_0xe4d9('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xe4d9('0x1'));var express=require('express');var router=express[_0xe4d9('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xe4d9('0x3'));var interaction=require(_0xe4d9('0x4'));var config=require('../../config/environment');var controller=require(_0xe4d9('0x5'));router[_0xe4d9('0x6')]('/',auth[_0xe4d9('0x7')](),controller[_0xe4d9('0x8')]);router[_0xe4d9('0x6')](_0xe4d9('0x9'),controller['webhookGet']);router[_0xe4d9('0x6')](_0xe4d9('0xa'),auth[_0xe4d9('0x7')](),controller[_0xe4d9('0xb')]);router[_0xe4d9('0x6')](_0xe4d9('0xc'),auth['isAuthenticated'](),controller[_0xe4d9('0xd')]);var upload=multer({'storage':multer[_0xe4d9('0xe')]({'destination':function(_0x32eb8a,_0x3575ac,_0xddd1fb){_0xddd1fb(null,path[_0xe4d9('0xf')](config[_0xe4d9('0x10')],'server/files/plugins'));},'filename':function(_0x5ee099,_0x580c50,_0x4e0d15){_0x580c50['originalname']=_0x580c50['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4e0d15(null,util['format'](_0xe4d9('0x11'),path[_0xe4d9('0x12')](_0x580c50[_0xe4d9('0x13')],path['extname'](_0x580c50[_0xe4d9('0x13')])),Date[_0xe4d9('0x14')](),path[_0xe4d9('0x15')](_0x580c50[_0xe4d9('0x13')])));}})});router['post']('/',upload[_0xe4d9('0x16')](_0xe4d9('0x17')),controller[_0xe4d9('0x18')]);router['post']('/webhook',controller[_0xe4d9('0x19')]);router[_0xe4d9('0x1a')]('/:id',auth[_0xe4d9('0x7')](),controller['update']);router[_0xe4d9('0x1b')](_0xe4d9('0xa'),auth[_0xe4d9('0x7')](),controller[_0xe4d9('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index c015b07..c472965 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 _0xc5cf=['agentOnly','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','script','TEXT','STRING','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','ENUM'];(function(_0x139ff6,_0xddca5){var _0x71b083=function(_0x4cf27a){while(--_0x4cf27a){_0x139ff6['push'](_0x139ff6['shift']());}};_0x71b083(++_0xddca5);}(_0xc5cf,0x174));var _0xfc5c=function(_0x1074d2,_0x46d688){_0x1074d2=_0x1074d2-0x0;var _0x441adb=_0xc5cf[_0x1074d2];return _0x441adb;};'use strict';var Sequelize=require(_0xfc5c('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM']('html',_0xfc5c('0x1'))},'description':{'type':Sequelize[_0xfc5c('0x2')]},'version':{'type':Sequelize[_0xfc5c('0x2')]},'path':{'type':Sequelize[_0xfc5c('0x3')],'comment':_0xfc5c('0x4')},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize[_0xfc5c('0x5')]('adminOnly',_0xfc5c('0x6'),'always','never'),'defaultValue':_0xfc5c('0x7'),'comment':_0xfc5c('0x8')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0xfc5c('0x3')]},'agentUrl':{'type':Sequelize[_0xfc5c('0x3')]},'scriptName':{'type':Sequelize[_0xfc5c('0x3')]},'scriptPath':{'type':Sequelize[_0xfc5c('0x3')]}}; \ No newline at end of file +var _0x2c07=['The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','ENUM','html','script','TEXT','STRING'];(function(_0x2311ad,_0x43404f){var _0x4be13e=function(_0x14cf9d){while(--_0x14cf9d){_0x2311ad['push'](_0x2311ad['shift']());}};_0x4be13e(++_0x43404f);}(_0x2c07,0x17f));var _0x72c0=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x2c07[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x72c0('0x0'));module[_0x72c0('0x1')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x72c0('0x2')](_0x72c0('0x3'),_0x72c0('0x4'))},'description':{'type':Sequelize[_0x72c0('0x5')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize[_0x72c0('0x6')],'comment':_0x72c0('0x7')},'active':{'type':Sequelize[_0x72c0('0x8')],'defaultValue':0x0,'comment':_0x72c0('0x9')},'sidebar':{'type':Sequelize[_0x72c0('0x2')](_0x72c0('0xa'),_0x72c0('0xb'),_0x72c0('0xc'),_0x72c0('0xd')),'defaultValue':_0x72c0('0xc'),'comment':_0x72c0('0xe')},'icon':{'type':Sequelize[_0x72c0('0x6')]},'adminUrl':{'type':Sequelize[_0x72c0('0x6')]},'agentUrl':{'type':Sequelize[_0x72c0('0x6')]},'scriptName':{'type':Sequelize[_0x72c0('0x6')]},'scriptPath':{'type':Sequelize[_0x72c0('0x6')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index d97046b..79cbed7 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 _0xcb86=['index','map','Plugin','fieldName','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','pick','type','VIRTUAL','includeAll','include','findAll','catch','show','params','rawAttributes','merge','find','download','join','server/files/plugins','%s.zip','basename','warning','code','ENOENT','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','Error','glob','**/*','root','dirname','node_modules/**/*','attachments/**/*','finalize','close','Plugin\x20not\x20found','format','unlinkSync','info','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','Invalid\x20manifest:\x20type\x20missing','Invalid\x20manifest:\x20version\x20not\x20specified','Invalid\x20manifest:\x20parameters\x20missing','html','parameters','views','Invalid\x20manifest:\x20views\x20missing','admin','Invalid\x20manifest:\x20no\x20view\x20specified','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','version','test','Warning:\x20admin\x20view\x20not\x20specified','agent','Warning:\x20agent\x20view\x20not\x20specified','script','scriptName','plugins','create','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','hostname','http://localhost:','encoding','method','headers','content-length','endsWith','statusCode','webhookPost','\x27PORT\x27\x20parameter\x20not\x20specified','%s%s','content-type','eml-format','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','rimraf','archiver','ioredis','../../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','./plugin.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','save','update','then','get','Plugins','destroy','error','stack','name','send'];(function(_0x21b74b,_0x543c76){var _0x518cc6=function(_0x5b3010){while(--_0x5b3010){_0x21b74b['push'](_0x21b74b['shift']());}};_0x518cc6(++_0x543c76);}(_0xcb86,0x78));var _0x6cb8=function(_0x47ba70,_0x8fd4c8){_0x47ba70=_0x47ba70-0x0;var _0x3eea35=_0xcb86[_0x47ba70];return _0x3eea35;};'use strict';var emlformat=require(_0x6cb8('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6cb8('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6cb8('0x2'));var Mustache=require(_0x6cb8('0x3'));var util=require('util');var path=require(_0x6cb8('0x4'));var sox=require(_0x6cb8('0x5'));var csv=require(_0x6cb8('0x6'));var ejs=require(_0x6cb8('0x7'));var fs=require('fs');var fs_extra=require(_0x6cb8('0x8'));var _=require(_0x6cb8('0x9'));var squel=require(_0x6cb8('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6cb8('0xb'));var toCsv=require(_0x6cb8('0x6'));var querystring=require(_0x6cb8('0xc'));var Papa=require(_0x6cb8('0xd'));var extract=require('extract-zip');var rimraf=require(_0x6cb8('0xe'));var archiver=require(_0x6cb8('0xf'));var Redis=require(_0x6cb8('0x10'));var authService=require(_0x6cb8('0x11'));var qs=require(_0x6cb8('0x12'));var as=require(_0x6cb8('0x13'));var hardwareService=require(_0x6cb8('0x14'));var logger=require(_0x6cb8('0x15'))(_0x6cb8('0x16'));var utils=require(_0x6cb8('0x17'));var config=require(_0x6cb8('0x18'));var licenseUtil=require(_0x6cb8('0x19'));var db=require(_0x6cb8('0x1a'))['db'];config[_0x6cb8('0x1b')]=_[_0x6cb8('0x1c')](config[_0x6cb8('0x1b')],{'host':_0x6cb8('0x1d'),'port':0x18eb});var socket=require(_0x6cb8('0x1e'))(new Redis(config[_0x6cb8('0x1b')]));require(_0x6cb8('0x1f'))[_0x6cb8('0x20')](socket);function respondWithStatusCode(_0x47f9d1,_0x38b5ee){_0x38b5ee=_0x38b5ee||0xcc;return function(_0x35936b){if(_0x35936b){return _0x47f9d1[_0x6cb8('0x21')](_0x38b5ee);}return _0x47f9d1[_0x6cb8('0x22')](_0x38b5ee)[_0x6cb8('0x23')]();};}function respondWithResult(_0x5ea030,_0x169337){_0x169337=_0x169337||0xc8;return function(_0x5df3bd){if(_0x5df3bd){return _0x5ea030[_0x6cb8('0x22')](_0x169337)[_0x6cb8('0x24')](_0x5df3bd);}};}function respondWithFilteredResult(_0x519c5a,_0x391921){return function(_0xfa8f79){if(_0xfa8f79){var _0x3dc986=typeof _0x391921[_0x6cb8('0x25')]===_0x6cb8('0x26')&&typeof _0x391921[_0x6cb8('0x27')]===_0x6cb8('0x26');var _0x51f254=_0xfa8f79['count'];var _0x2d54a4=_0x3dc986?0x0:_0x391921[_0x6cb8('0x25')];var _0x13452b=_0x3dc986?_0xfa8f79[_0x6cb8('0x28')]:_0x391921['offset']+_0x391921[_0x6cb8('0x27')];var _0x5bb028;if(_0x13452b>=_0x51f254){_0x13452b=_0x51f254;_0x5bb028=0xc8;}else{_0x5bb028=0xce;}_0x519c5a['status'](_0x5bb028);return _0x519c5a[_0x6cb8('0x29')]('Content-Range',_0x2d54a4+'-'+_0x13452b+'/'+_0x51f254)['json'](_0xfa8f79);}return null;};}function patchUpdates(_0x1fc319){return function(_0x2e36ae){try{jsonpatch['apply'](_0x2e36ae,_0x1fc319,!![]);}catch(_0x209529){return BPromise['reject'](_0x209529);}return _0x2e36ae[_0x6cb8('0x2a')]();};}function saveUpdates(_0x1a6582,_0x2c2c3b){return function(_0x535b85){if(_0x535b85){return _0x535b85[_0x6cb8('0x2b')](_0x1a6582)[_0x6cb8('0x2c')](function(_0x33d401){return _0x33d401;});}return null;};}function removeEntity(_0x16b67d,_0xde9b87){return function(_0x10af5c){if(_0x10af5c){return _0x10af5c['destroy']()[_0x6cb8('0x2c')](function(){var _0x4d040d=_0x10af5c[_0x6cb8('0x2d')]({'plain':!![]});var _0x46524e=_0x6cb8('0x2e');return db['UserProfileResource'][_0x6cb8('0x2f')]({'where':{'type':_0x46524e,'resourceId':_0x4d040d['id']}})['then'](function(){return _0x10af5c;});})[_0x6cb8('0x2c')](function(){_0x16b67d[_0x6cb8('0x22')](0xcc)[_0x6cb8('0x23')]();});}};}function handleEntityNotFound(_0x427ed4,_0x59729f){return function(_0x5d8766){if(!_0x5d8766){_0x427ed4[_0x6cb8('0x21')](0x194);}return _0x5d8766;};}function handleError(_0x3159b8,_0x2ef696){_0x2ef696=_0x2ef696||0x1f4;return function(_0x3d3726){logger[_0x6cb8('0x30')](_0x3d3726[_0x6cb8('0x31')]);if(_0x3d3726['name']){delete _0x3d3726[_0x6cb8('0x32')];}_0x3159b8[_0x6cb8('0x22')](_0x2ef696)[_0x6cb8('0x33')](_0x3d3726);};}exports[_0x6cb8('0x34')]=function(_0x1d62d3,_0x21172e){var _0xe0b5d9={},_0x33efe5={},_0x427cdb={'count':0x0,'rows':[]};var _0x43b416=_[_0x6cb8('0x35')](db[_0x6cb8('0x36')]['rawAttributes'],function(_0x33a002){return{'name':_0x33a002[_0x6cb8('0x37')],'type':_0x33a002['type'][_0x6cb8('0x38')]};});_0x33efe5['model']=_['map'](_0x43b416,_0x6cb8('0x32'));_0x33efe5[_0x6cb8('0x39')]=_[_0x6cb8('0x3a')](_0x1d62d3[_0x6cb8('0x39')]);_0x33efe5['filters']=_[_0x6cb8('0x3b')](_0x33efe5[_0x6cb8('0x3c')],_0x33efe5[_0x6cb8('0x39')]);_0xe0b5d9[_0x6cb8('0x3d')]=_[_0x6cb8('0x3b')](_0x33efe5[_0x6cb8('0x3c')],qs[_0x6cb8('0x3e')](_0x1d62d3['query'][_0x6cb8('0x3e')]));_0xe0b5d9[_0x6cb8('0x3d')]=_0xe0b5d9['attributes'][_0x6cb8('0x3f')]?_0xe0b5d9[_0x6cb8('0x3d')]:_0x33efe5[_0x6cb8('0x3c')];if(!_0x1d62d3[_0x6cb8('0x39')][_0x6cb8('0x40')](_0x6cb8('0x41'))){_0xe0b5d9[_0x6cb8('0x27')]=qs[_0x6cb8('0x27')](_0x1d62d3['query'][_0x6cb8('0x27')]);_0xe0b5d9['offset']=qs[_0x6cb8('0x25')](_0x1d62d3[_0x6cb8('0x39')][_0x6cb8('0x25')]);}_0xe0b5d9[_0x6cb8('0x42')]=qs['sort'](_0x1d62d3[_0x6cb8('0x39')]['sort']);_0xe0b5d9[_0x6cb8('0x43')]=qs[_0x6cb8('0x44')](_[_0x6cb8('0x45')](_0x1d62d3[_0x6cb8('0x39')],_0x33efe5['filters']),_0x43b416);if(_0x1d62d3[_0x6cb8('0x39')]['filter']){_0xe0b5d9[_0x6cb8('0x43')]=_['merge'](_0xe0b5d9[_0x6cb8('0x43')],{'$or':_['map'](_0x43b416,function(_0x323832){if(_0x323832[_0x6cb8('0x46')]!==_0x6cb8('0x47')){var _0x4d1ea2={};_0x4d1ea2[_0x323832[_0x6cb8('0x32')]]={'$like':'%'+_0x1d62d3[_0x6cb8('0x39')]['filter']+'%'};return _0x4d1ea2;}})});}_0xe0b5d9=_['merge']({},_0xe0b5d9,_0x1d62d3['options']);var _0x154cfb={'where':_0xe0b5d9['where']};return db[_0x6cb8('0x36')][_0x6cb8('0x28')](_0x154cfb)[_0x6cb8('0x2c')](function(_0x2862e7){_0x427cdb[_0x6cb8('0x28')]=_0x2862e7;if(_0x1d62d3[_0x6cb8('0x39')][_0x6cb8('0x48')]){_0xe0b5d9[_0x6cb8('0x49')]=[{'all':!![]}];}return db['Plugin'][_0x6cb8('0x4a')](_0xe0b5d9);})[_0x6cb8('0x2c')](function(_0x2ea991){_0x427cdb['rows']=_0x2ea991;return _0x427cdb;})[_0x6cb8('0x2c')](respondWithFilteredResult(_0x21172e,_0xe0b5d9))[_0x6cb8('0x4b')](handleError(_0x21172e,null));};exports[_0x6cb8('0x4c')]=function(_0x579a58,_0x9c1ecb){var _0x5d2ed7={'raw':!![],'where':{'id':_0x579a58[_0x6cb8('0x4d')]['id']}},_0x99ded6={};_0x99ded6['model']=_[_0x6cb8('0x3a')](db[_0x6cb8('0x36')][_0x6cb8('0x4e')]);_0x99ded6[_0x6cb8('0x39')]=_[_0x6cb8('0x3a')](_0x579a58['query']);_0x99ded6[_0x6cb8('0x44')]=_[_0x6cb8('0x3b')](_0x99ded6[_0x6cb8('0x3c')],_0x99ded6[_0x6cb8('0x39')]);_0x5d2ed7[_0x6cb8('0x3d')]=_[_0x6cb8('0x3b')](_0x99ded6[_0x6cb8('0x3c')],qs[_0x6cb8('0x3e')](_0x579a58[_0x6cb8('0x39')][_0x6cb8('0x3e')]));_0x5d2ed7[_0x6cb8('0x3d')]=_0x5d2ed7[_0x6cb8('0x3d')][_0x6cb8('0x3f')]?_0x5d2ed7[_0x6cb8('0x3d')]:_0x99ded6[_0x6cb8('0x3c')];if(_0x579a58[_0x6cb8('0x39')][_0x6cb8('0x48')]){_0x5d2ed7['include']=[{'all':!![]}];}_0x5d2ed7=_[_0x6cb8('0x4f')]({},_0x5d2ed7,_0x579a58['options']);return db['Plugin'][_0x6cb8('0x50')](_0x5d2ed7)['then'](handleEntityNotFound(_0x9c1ecb,null))[_0x6cb8('0x2c')](respondWithResult(_0x9c1ecb,null))[_0x6cb8('0x4b')](handleError(_0x9c1ecb,null));};exports[_0x6cb8('0x51')]=function(_0x35a172,_0x15d0b2,_0x4606f6){return db[_0x6cb8('0x36')][_0x6cb8('0x50')]({'where':{'id':_0x35a172['params']['id']},'attributes':[_0x6cb8('0x32'),_0x6cb8('0x4')],'raw':!![]})[_0x6cb8('0x2c')](handleEntityNotFound(_0x15d0b2,null))[_0x6cb8('0x2c')](function(_0x362a19){if(_0x362a19){var _0x52bcb2=path[_0x6cb8('0x52')](config['root'],_0x6cb8('0x53'),util['format'](_0x6cb8('0x54'),path[_0x6cb8('0x55')](_0x362a19['path'])));var _0x9a076f=fs['createWriteStream'](_0x52bcb2);var _0x2006e9=archiver('zip',{'zlib':{'level':0x9}});_0x2006e9['on'](_0x6cb8('0x56'),function(_0xf75bfc){if(_0xf75bfc[_0x6cb8('0x57')]===_0x6cb8('0x58')){logger[_0x6cb8('0x30')](_0xf75bfc);}else{throw new db[(_0x6cb8('0x59'))]['Error'](_0x6cb8('0x5a'));}});_0x2006e9['on'](_0x6cb8('0x30'),function(_0x38f526){throw new db[(_0x6cb8('0x59'))][(_0x6cb8('0x5b'))](_0x6cb8('0x5a'));});_0x2006e9['pipe'](_0x9a076f);_0x2006e9[_0x6cb8('0x5c')](_0x6cb8('0x5d'),{'cwd':path[_0x6cb8('0x52')](config[_0x6cb8('0x5e')],_0x6cb8('0x53'),path[_0x6cb8('0x5f')](_0x362a19['path'])),'ignore':[path['join'](path[_0x6cb8('0x55')](_0x362a19[_0x6cb8('0x4')]),_0x6cb8('0x60')),path[_0x6cb8('0x52')](path[_0x6cb8('0x55')](_0x362a19[_0x6cb8('0x4')]),_0x6cb8('0x61'))],'nodir':!![]})[_0x6cb8('0x62')]();_0x9a076f['on'](_0x6cb8('0x63'),function(){if(!fs['existsSync'](_0x52bcb2)){throw new db[(_0x6cb8('0x59'))][(_0x6cb8('0x5b'))](_0x6cb8('0x64'));}return _0x15d0b2['download'](_0x52bcb2,util[_0x6cb8('0x65')](_0x6cb8('0x54'),path[_0x6cb8('0x55')](_0x362a19[_0x6cb8('0x4')])),function(_0x46da45){if(_0x46da45){throw new db['Sequelize'][(_0x6cb8('0x5b'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0x6cb8('0x66')](_0x52bcb2);logger[_0x6cb8('0x67')]('Download\x20completed');logger[_0x6cb8('0x67')](_0x6cb8('0x68'));});});}return null;})[_0x6cb8('0x4b')](handleError(_0x15d0b2,null));};exports[_0x6cb8('0x69')]=function(_0x202aee,_0x2ca41e,_0x4904f6){var _0x3cae25=path['basename'](_0x202aee[_0x6cb8('0x6a')][_0x6cb8('0x6b')],path[_0x6cb8('0x6c')](_0x202aee[_0x6cb8('0x6a')][_0x6cb8('0x6b')]));var _0x2fa147=path['join'](config[_0x6cb8('0x5e')],_0x6cb8('0x53'),_0x202aee['file'][_0x6cb8('0x6b')]);var _0xe76290=path[_0x6cb8('0x52')](config['root'],_0x6cb8('0x53'),_0x3cae25);logger[_0x6cb8('0x67')](_0x6cb8('0x6d'),_0x2fa147);logger[_0x6cb8('0x67')]('Plugin\x20upload\x20destination:\x20%s',_0xe76290);try{fs[_0x6cb8('0x6e')](_0x2fa147,parseInt(_0x6cb8('0x6f'),0x8));extract(_0x2fa147,{'dir':_0xe76290},function(_0xa92a30){if(_0xa92a30){logger[_0x6cb8('0x30')](_0xa92a30);handleError(_0xa92a30,!![]);};var _0x39b530=fs[_0x6cb8('0x70')](_0xe76290);if(_0x39b530[_0x6cb8('0x3f')]>0x1){removeReferences(_0x2fa147,_0xe76290);logger[_0x6cb8('0x30')](_0x6cb8('0x71'));return _0x4904f6(new Error(_0x6cb8('0x71')));}var _0x25edd2=fs[_0x6cb8('0x72')](path[_0x6cb8('0x52')](_0xe76290,_0x39b530[0x0]));if(_0x25edd2['isFile']()){removeReferences(_0x2fa147,_0xe76290);logger[_0x6cb8('0x30')](_0x6cb8('0x71'));return _0x4904f6(new Error('Invalid\x20plugin\x20structure'));}if(_0x25edd2['isDirectory']()){var _0x38d002=fs[_0x6cb8('0x70')](path[_0x6cb8('0x52')](_0xe76290,_0x39b530[0x0]));if(_0x38d002[_0x6cb8('0x3f')]===0x0){removeReferences(_0x2fa147,_0xe76290);logger[_0x6cb8('0x30')](_0x6cb8('0x71'));return _0x4904f6(new Error(_0x6cb8('0x71')));}var _0x48cc65=_0x38d002[_0x6cb8('0x73')](function(_0x51802d){return _0x51802d===_0x6cb8('0x74');});if(!_0x48cc65){return _0x4904f6(new Error(_0x6cb8('0x75')));}var _0x789b4f=fs[_0x6cb8('0x76')](path[_0x6cb8('0x52')](_0xe76290,_0x39b530[0x0],'manifest.json'));var _0x27e602=JSON['parse'](_0x789b4f);if('undefined'==typeof _0x27e602[_0x6cb8('0x32')]){return _0x4904f6(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0x6cb8('0x26')==typeof _0x27e602[_0x6cb8('0x46')]){return _0x4904f6(new Error(_0x6cb8('0x77')));}if(_0x6cb8('0x26')==typeof _0x27e602['version']){return _0x4904f6(new Error(_0x6cb8('0x78')));}if(_0x6cb8('0x26')==typeof _0x27e602['parameters']){return _0x4904f6(new Error(_0x6cb8('0x79')));}if(_0x27e602['type']===_0x6cb8('0x7a')){if(_0x6cb8('0x26')==typeof _0x27e602[_0x6cb8('0x7b')][_0x6cb8('0x7c')]){return _0x4904f6(new Error(_0x6cb8('0x7d')));}if(_0x6cb8('0x26')==typeof _0x27e602['parameters'][_0x6cb8('0x7c')][_0x6cb8('0x7e')]&&_0x6cb8('0x26')==typeof _0x27e602[_0x6cb8('0x7b')]['views']['agent']){return _0x4904f6(new Error(_0x6cb8('0x7f')));}}else if(_0x27e602[_0x6cb8('0x46')]==='script'){if(_0x6cb8('0x26')==typeof _0x27e602['parameters']['scriptName']){return _0x4904f6(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0x6cb8('0x26')==typeof _0x27e602[_0x6cb8('0x7b')][_0x6cb8('0x80')]){return _0x4904f6(new Error(_0x6cb8('0x81')));}}else{return _0x4904f6(new Error(_0x6cb8('0x82')));}var _0x2a784e=_0x27e602[_0x6cb8('0x32')];var _0x76a783=_0x27e602[_0x6cb8('0x83')];var _0x15310e=_0x27e602[_0x6cb8('0x46')];var _0x240992=_0x27e602[_0x6cb8('0x84')]?_0x27e602['sidebar']:_0x6cb8('0x85');var _0x301315=_0x27e602[_0x6cb8('0x86')]?_0x27e602[_0x6cb8('0x86')]:_0x6cb8('0x87');var _0x56900f='';var _0x4fc8d8='';var _0x35e6f5='';var _0x596b53='';var _0x557351=_0x27e602[_0x6cb8('0x88')];if(_0x15310e===_0x6cb8('0x7a')){if('undefined'!=typeof _0x27e602[_0x6cb8('0x7b')][_0x6cb8('0x7c')][_0x6cb8('0x7e')]){var _0x47307b=_0x27e602['parameters'][_0x6cb8('0x7c')][_0x6cb8('0x7e')];if(!/^(f|ht)tps?:\/\//i[_0x6cb8('0x89')](_0x47307b)){_0x56900f=path['join']('plugins',_0x3cae25,_0x39b530[0x0],_0x47307b);}else{_0x56900f=_0x47307b;}}else{logger[_0x6cb8('0x67')](_0x6cb8('0x8a'));}if(_0x6cb8('0x26')!=typeof _0x27e602['parameters'][_0x6cb8('0x7c')][_0x6cb8('0x8b')]){var _0x3c678d=_0x27e602['parameters'][_0x6cb8('0x7c')][_0x6cb8('0x8b')];if(!/^(f|ht)tps?:\/\//i[_0x6cb8('0x89')](_0x3c678d)){_0x4fc8d8=path[_0x6cb8('0x52')]('plugins',_0x3cae25,_0x39b530[0x0],_0x3c678d);}else{_0x4fc8d8=_0x3c678d;}}else{logger[_0x6cb8('0x67')](_0x6cb8('0x8c'));}}else if(_0x15310e===_0x6cb8('0x8d')){_0x35e6f5=_0x27e602[_0x6cb8('0x7b')][_0x6cb8('0x8e')];_0x596b53=_0x27e602['parameters'][_0x6cb8('0x80')];if(_0x6cb8('0x26')!=typeof _0x27e602[_0x6cb8('0x7b')][_0x6cb8('0x7c')]){if(_0x6cb8('0x26')!=typeof _0x27e602[_0x6cb8('0x7b')][_0x6cb8('0x7c')][_0x6cb8('0x7e')]){var _0x47307b=_0x27e602[_0x6cb8('0x7b')][_0x6cb8('0x7c')][_0x6cb8('0x7e')];if(!/^(f|ht)tps?:\/\//i[_0x6cb8('0x89')](_0x47307b)){_0x56900f=path[_0x6cb8('0x52')](_0x6cb8('0x8f'),_0x3cae25,_0x39b530[0x0],_0x47307b);}else{_0x56900f=_0x47307b;}}if(_0x6cb8('0x26')!=typeof _0x27e602['parameters'][_0x6cb8('0x7c')]['agent']){var _0x3c678d=_0x27e602[_0x6cb8('0x7b')][_0x6cb8('0x7c')][_0x6cb8('0x8b')];if(!/^(f|ht)tps?:\/\//i[_0x6cb8('0x89')](_0x3c678d)){_0x4fc8d8=path[_0x6cb8('0x52')]('plugins',_0x3cae25,_0x39b530[0x0],_0x3c678d);}else{_0x4fc8d8=_0x3c678d;}}}}var _0x19846a={'name':_0x2a784e,'description':_0x76a783,'path':path[_0x6cb8('0x52')](_0x3cae25,_0x39b530[0x0]),'type':_0x15310e,'sidebar':_0x240992,'icon':_0x301315,'adminUrl':_0x56900f,'agentUrl':_0x4fc8d8,'scriptName':_0x35e6f5,'scriptPath':_0x596b53,'version':_0x557351};removeReferences(_0x2fa147,null);return db[_0x6cb8('0x36')][_0x6cb8('0x90')](_0x19846a)[_0x6cb8('0x2c')](function(_0x11d50f){var _0x2a992f={'role':_0x202aee['body']['role'],'userProfileId':_0x202aee[_0x6cb8('0x91')][_0x6cb8('0x92')]};if(!_0x2a992f)throw new Error(_0x6cb8('0x93'));if(_0x2a992f[_0x6cb8('0x94')]===_0x6cb8('0x95')){var _0x4a069a=_0x11d50f['get']({'plain':!![]});return db[_0x6cb8('0x96')][_0x6cb8('0x50')]({'where':{'name':_0x6cb8('0x2e'),'userProfileId':_0x2a992f[_0x6cb8('0x92')]},'raw':!![]})[_0x6cb8('0x2c')](function(_0x4fb343){if(_0x4fb343&&_0x4fb343[_0x6cb8('0x97')]===0x0){return db['UserProfileResource'][_0x6cb8('0x90')]({'name':_0x4a069a[_0x6cb8('0x32')],'resourceId':_0x4a069a['id'],'type':_0x4fb343['name'],'sectionId':_0x4fb343['id']},{})[_0x6cb8('0x2c')](function(){return _0x11d50f;});}else{return _0x11d50f;}})[_0x6cb8('0x4b')](function(_0x216910){logger[_0x6cb8('0x30')](_0x6cb8('0x98'),_0x216910);throw _0x216910;});}return _0x11d50f;})['then'](respondWithResult(_0x2ca41e,null))['catch'](handleError(_0x2ca41e,null));}});}catch(_0x433015){_0x2ca41e[_0x6cb8('0x22')](0x1f4)['send'](_0x433015);}};function removeReferences(_0x72a4d8,_0x29270a){try{if(_0x72a4d8){fs[_0x6cb8('0x66')](_0x72a4d8);logger['info'](_0x6cb8('0x99'));}if(_0x29270a){rimraf(_0x29270a,function(){});logger[_0x6cb8('0x67')](_0x6cb8('0x9a'));}}catch(_0x588771){logger['error'](_0x588771);}}exports['update']=function(_0x19466,_0x33a170,_0xf7aeb7){return db['Plugin'][_0x6cb8('0x50')]({'where':{'id':_0x19466[_0x6cb8('0x4d')]['id']}})[_0x6cb8('0x2c')](handleEntityNotFound(_0x33a170,null))[_0x6cb8('0x2c')](saveUpdates(_0x19466[_0x6cb8('0x91')],null))[_0x6cb8('0x2c')](respondWithResult(_0x33a170,null))[_0x6cb8('0x4b')](handleError(_0x33a170,null));};exports[_0x6cb8('0x9b')]=function(_0xdc3a3a,_0x37f30a,_0x2cae5e){return db[_0x6cb8('0x36')][_0x6cb8('0x50')]({'where':{'id':_0xdc3a3a[_0x6cb8('0x4d')]['id']}})['then'](function(_0x13dd1b){if(_0x13dd1b){return _0x13dd1b['destroy']();}})['then'](function(_0x5d52eb){rimraf(path[_0x6cb8('0x52')](config['root'],_0x6cb8('0x53'),path[_0x6cb8('0x5f')](_0x5d52eb[_0x6cb8('0x4')])),function(){});return _0x5d52eb;})[_0x6cb8('0x2c')](handleEntityNotFound(_0x37f30a,null))[_0x6cb8('0x2c')](respondWithStatusCode(_0x37f30a,null))['catch'](handleError(_0x37f30a,null));};exports[_0x6cb8('0x9c')]=function(_0xd47149,_0x230fa7,_0x7c1438){return BPromise[_0x6cb8('0x9d')]()['then'](function(){if(!_0xd47149[_0x6cb8('0x39')]['path']){throw new Error(_0x6cb8('0x9e'));}if(!_0xd47149[_0x6cb8('0x39')][_0x6cb8('0x9f')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x540c5d=_0xd47149[_0x6cb8('0x39')][_0x6cb8('0xa0')]?_0xd47149[_0x6cb8('0x39')]['hostname']+':'+_0xd47149[_0x6cb8('0x39')]['port']:_0x6cb8('0xa1')+_0xd47149['query']['port'];var _0x2b8d0e=_0xd47149['query'][_0x6cb8('0x24')]?_0xd47149[_0x6cb8('0x39')][_0x6cb8('0x24')]:!![];var _0x2bcc41=_0xd47149['query']['encoding']?_0xd47149[_0x6cb8('0x39')][_0x6cb8('0xa2')]:null;var _0x37cad6={'method':_0xd47149[_0x6cb8('0xa3')],'uri':util[_0x6cb8('0x65')]('%s%s',_0x540c5d,_0xd47149[_0x6cb8('0x39')][_0x6cb8('0x4')]),'json':_0x2b8d0e,'resolveWithFullResponse':!![],'encoding':_0x2bcc41,'qs':_0xd47149[_0x6cb8('0x39')]};if(_0xd47149[_0x6cb8('0xa4')]){_0x37cad6[_0x6cb8('0xa4')]=_0xd47149['headers'];if(_0x37cad6['headers'][_0x6cb8('0xa5')]){delete _0x37cad6[_0x6cb8('0xa4')][_0x6cb8('0xa5')];}}if(_0x37cad6['headers']['content-type']){delete _0x37cad6[_0x6cb8('0xa4')]['content-type'];}return rp(_0x37cad6);})[_0x6cb8('0x2c')](function(_0x1a239b){if(_0x1a239b){_0x230fa7['set'](_0x1a239b['headers']);logger['info'](_0x1a239b['body']);if(_[_0x6cb8('0xa6')](_0xd47149[_0x6cb8('0x39')]['path'],_0x6cb8('0x51'))&&_0x1a239b[_0x6cb8('0xa7')]==0x1f4){return _0x230fa7[_0x6cb8('0x21')](_0x1a239b[_0x6cb8('0xa7')]);}else{return _0x230fa7[_0x6cb8('0x22')](_0x1a239b['statusCode'])['send'](_0x1a239b[_0x6cb8('0x91')]);}}else{return _0x230fa7['sendStatus'](0xc8);}})['catch'](handleError(_0x230fa7,null));};exports[_0x6cb8('0xa8')]=function(_0x2d6b81,_0x138956,_0x1c6c82){return BPromise['resolve']()[_0x6cb8('0x2c')](function(){if(!_0x2d6b81['query'][_0x6cb8('0x4')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x2d6b81[_0x6cb8('0x39')][_0x6cb8('0x9f')]){throw new Error(_0x6cb8('0xa9'));}var _0x23e5e6=_0x2d6b81['query'][_0x6cb8('0xa0')]?_0x2d6b81['query'][_0x6cb8('0xa0')]+':'+_0x2d6b81[_0x6cb8('0x39')][_0x6cb8('0x9f')]:'http://localhost:'+_0x2d6b81[_0x6cb8('0x39')][_0x6cb8('0x9f')];var _0xbaab17=_0x2d6b81[_0x6cb8('0x39')]['json']?_0x2d6b81['query'][_0x6cb8('0x24')]:!![];var _0x8a47b5=_0x2d6b81['query'][_0x6cb8('0xa2')]?_0x2d6b81[_0x6cb8('0x39')][_0x6cb8('0xa2')]:null;var _0x1e0082={'method':_0x2d6b81[_0x6cb8('0xa3')],'uri':util[_0x6cb8('0x65')](_0x6cb8('0xaa'),_0x23e5e6,_0x2d6b81[_0x6cb8('0x39')][_0x6cb8('0x4')]),'json':_0xbaab17,'resolveWithFullResponse':!![],'encoding':_0x8a47b5,'body':_0x2d6b81[_0x6cb8('0x91')]};if(_0x2d6b81[_0x6cb8('0xa4')]){_0x1e0082[_0x6cb8('0xa4')]=_0x2d6b81['headers'];if(_0x1e0082[_0x6cb8('0xa4')][_0x6cb8('0xa5')]){delete _0x1e0082['headers'][_0x6cb8('0xa5')];}}if(_0x1e0082[_0x6cb8('0xa4')][_0x6cb8('0xab')]){delete _0x1e0082[_0x6cb8('0xa4')]['content-type'];}return rp(_0x1e0082);})[_0x6cb8('0x2c')](function(_0x485493){if(_0x485493){_0x138956[_0x6cb8('0x29')](_0x485493['headers']);logger[_0x6cb8('0x67')](_0x485493[_0x6cb8('0x91')]);return _0x138956[_0x6cb8('0x22')](_0x485493[_0x6cb8('0xa7')])['send'](_0x485493[_0x6cb8('0x91')]);}else{return _0x138956[_0x6cb8('0x21')](0xc8);}})[_0x6cb8('0x4b')](handleError(_0x138956,null));}; \ No newline at end of file +var _0xd9bd=['file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','some','Plugin\x20manifest\x20missing','readFileSync','manifest.json','parse','Invalid\x20manifest:\x20name\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','Invalid\x20manifest:\x20parameters\x20missing','views','Invalid\x20manifest:\x20views\x20missing','parameters','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','admin','Warning:\x20admin\x20view\x20not\x20specified','test','plugins','agent','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','send','unlinkSync','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','update','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','port','headers','content-length','content-type','set','statusCode','http://localhost:','encoding','method','%s%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','papaparse','extract-zip','rimraf','archiver','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','json','offset','limit','undefined','count','status','Content-Range','apply','reject','then','get','Plugins','UserProfileResource','destroy','error','stack','name','index','map','Plugin','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','VIRTUAL','merge','options','includeAll','rows','catch','show','params','keys','include','find','join','root','server/files/plugins','%s.zip','basename','zip','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','dirname','attachments/**/*','finalize','Plugin\x20not\x20found','format','Error\x20while\x20downloading\x20the\x20plugin','info','upload'];(function(_0x5cebc3,_0x3f0d41){var _0x595fa5=function(_0x455faa){while(--_0x455faa){_0x5cebc3['push'](_0x5cebc3['shift']());}};_0x595fa5(++_0x3f0d41);}(_0xd9bd,0x189));var _0xdd9b=function(_0x41fb08,_0xddf46){_0x41fb08=_0x41fb08-0x0;var _0x1021f1=_0xd9bd[_0x41fb08];return _0x1021f1;};'use strict';var emlformat=require(_0xdd9b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdd9b('0x1'));var jsonpatch=require(_0xdd9b('0x2'));var rp=require(_0xdd9b('0x3'));var moment=require(_0xdd9b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xdd9b('0x5'));var util=require(_0xdd9b('0x6'));var path=require(_0xdd9b('0x7'));var sox=require(_0xdd9b('0x8'));var csv=require(_0xdd9b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdd9b('0xa'));var _=require(_0xdd9b('0xb'));var squel=require('squel');var crypto=require(_0xdd9b('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xdd9b('0x9'));var querystring=require('querystring');var Papa=require(_0xdd9b('0xd'));var extract=require(_0xdd9b('0xe'));var rimraf=require(_0xdd9b('0xf'));var archiver=require(_0xdd9b('0x10'));var Redis=require(_0xdd9b('0x11'));var authService=require(_0xdd9b('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xdd9b('0x13'));var hardwareService=require(_0xdd9b('0x14'));var logger=require(_0xdd9b('0x15'))('api');var utils=require(_0xdd9b('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xdd9b('0x17'))['db'];config[_0xdd9b('0x18')]=_['defaults'](config['redis'],{'host':_0xdd9b('0x19'),'port':0x18eb});var socket=require(_0xdd9b('0x1a'))(new Redis(config[_0xdd9b('0x18')]));require('./plugin.socket')[_0xdd9b('0x1b')](socket);function respondWithStatusCode(_0x53942b,_0x1a4267){_0x1a4267=_0x1a4267||0xcc;return function(_0x31a4fe){if(_0x31a4fe){return _0x53942b[_0xdd9b('0x1c')](_0x1a4267);}return _0x53942b['status'](_0x1a4267)['end']();};}function respondWithResult(_0x329ac3,_0x385175){_0x385175=_0x385175||0xc8;return function(_0x57a02b){if(_0x57a02b){return _0x329ac3['status'](_0x385175)[_0xdd9b('0x1d')](_0x57a02b);}};}function respondWithFilteredResult(_0x214192,_0x497313){return function(_0x57883a){if(_0x57883a){var _0x3e9e6f=typeof _0x497313[_0xdd9b('0x1e')]==='undefined'&&typeof _0x497313[_0xdd9b('0x1f')]===_0xdd9b('0x20');var _0x353f7c=_0x57883a['count'];var _0xba7257=_0x3e9e6f?0x0:_0x497313[_0xdd9b('0x1e')];var _0x39f81f=_0x3e9e6f?_0x57883a[_0xdd9b('0x21')]:_0x497313['offset']+_0x497313['limit'];var _0x1c8f70;if(_0x39f81f>=_0x353f7c){_0x39f81f=_0x353f7c;_0x1c8f70=0xc8;}else{_0x1c8f70=0xce;}_0x214192[_0xdd9b('0x22')](_0x1c8f70);return _0x214192['set'](_0xdd9b('0x23'),_0xba7257+'-'+_0x39f81f+'/'+_0x353f7c)[_0xdd9b('0x1d')](_0x57883a);}return null;};}function patchUpdates(_0x399b64){return function(_0x43b65b){try{jsonpatch[_0xdd9b('0x24')](_0x43b65b,_0x399b64,!![]);}catch(_0xd66c3c){return BPromise[_0xdd9b('0x25')](_0xd66c3c);}return _0x43b65b['save']();};}function saveUpdates(_0x37749d,_0x199c82){return function(_0x5ba523){if(_0x5ba523){return _0x5ba523['update'](_0x37749d)[_0xdd9b('0x26')](function(_0x16c133){return _0x16c133;});}return null;};}function removeEntity(_0x115629,_0x3cfc32){return function(_0x1ad946){if(_0x1ad946){return _0x1ad946['destroy']()[_0xdd9b('0x26')](function(){var _0x415745=_0x1ad946[_0xdd9b('0x27')]({'plain':!![]});var _0x5deb42=_0xdd9b('0x28');return db[_0xdd9b('0x29')][_0xdd9b('0x2a')]({'where':{'type':_0x5deb42,'resourceId':_0x415745['id']}})['then'](function(){return _0x1ad946;});})['then'](function(){_0x115629[_0xdd9b('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x93997c,_0x234f38){return function(_0x5e549d){if(!_0x5e549d){_0x93997c[_0xdd9b('0x1c')](0x194);}return _0x5e549d;};}function handleError(_0x5dd6f5,_0x46e9ee){_0x46e9ee=_0x46e9ee||0x1f4;return function(_0x115efe){logger[_0xdd9b('0x2b')](_0x115efe[_0xdd9b('0x2c')]);if(_0x115efe[_0xdd9b('0x2d')]){delete _0x115efe['name'];}_0x5dd6f5['status'](_0x46e9ee)['send'](_0x115efe);};}exports[_0xdd9b('0x2e')]=function(_0xa42297,_0x248258){var _0x242692={},_0x249f44={},_0x1b1067={'count':0x0,'rows':[]};var _0x1bb4af=_[_0xdd9b('0x2f')](db[_0xdd9b('0x30')][_0xdd9b('0x31')],function(_0x5da26f){return{'name':_0x5da26f[_0xdd9b('0x32')],'type':_0x5da26f[_0xdd9b('0x33')][_0xdd9b('0x34')]};});_0x249f44['model']=_[_0xdd9b('0x2f')](_0x1bb4af,_0xdd9b('0x2d'));_0x249f44[_0xdd9b('0x35')]=_['keys'](_0xa42297[_0xdd9b('0x35')]);_0x249f44[_0xdd9b('0x36')]=_[_0xdd9b('0x37')](_0x249f44[_0xdd9b('0x38')],_0x249f44[_0xdd9b('0x35')]);_0x242692[_0xdd9b('0x39')]=_['intersection'](_0x249f44['model'],qs[_0xdd9b('0x3a')](_0xa42297[_0xdd9b('0x35')][_0xdd9b('0x3a')]));_0x242692['attributes']=_0x242692[_0xdd9b('0x39')][_0xdd9b('0x3b')]?_0x242692[_0xdd9b('0x39')]:_0x249f44[_0xdd9b('0x38')];if(!_0xa42297[_0xdd9b('0x35')][_0xdd9b('0x3c')]('nolimit')){_0x242692[_0xdd9b('0x1f')]=qs[_0xdd9b('0x1f')](_0xa42297[_0xdd9b('0x35')][_0xdd9b('0x1f')]);_0x242692[_0xdd9b('0x1e')]=qs[_0xdd9b('0x1e')](_0xa42297['query']['offset']);}_0x242692[_0xdd9b('0x3d')]=qs[_0xdd9b('0x3e')](_0xa42297[_0xdd9b('0x35')][_0xdd9b('0x3e')]);_0x242692[_0xdd9b('0x3f')]=qs[_0xdd9b('0x36')](_['pick'](_0xa42297[_0xdd9b('0x35')],_0x249f44[_0xdd9b('0x36')]),_0x1bb4af);if(_0xa42297[_0xdd9b('0x35')]['filter']){_0x242692[_0xdd9b('0x3f')]=_['merge'](_0x242692[_0xdd9b('0x3f')],{'$or':_[_0xdd9b('0x2f')](_0x1bb4af,function(_0x457d45){if(_0x457d45['type']!==_0xdd9b('0x40')){var _0x449967={};_0x449967[_0x457d45[_0xdd9b('0x2d')]]={'$like':'%'+_0xa42297[_0xdd9b('0x35')]['filter']+'%'};return _0x449967;}})});}_0x242692=_[_0xdd9b('0x41')]({},_0x242692,_0xa42297[_0xdd9b('0x42')]);var _0x5e1d79={'where':_0x242692[_0xdd9b('0x3f')]};return db[_0xdd9b('0x30')][_0xdd9b('0x21')](_0x5e1d79)[_0xdd9b('0x26')](function(_0x32672f){_0x1b1067[_0xdd9b('0x21')]=_0x32672f;if(_0xa42297[_0xdd9b('0x35')][_0xdd9b('0x43')]){_0x242692['include']=[{'all':!![]}];}return db[_0xdd9b('0x30')]['findAll'](_0x242692);})[_0xdd9b('0x26')](function(_0x51241d){_0x1b1067[_0xdd9b('0x44')]=_0x51241d;return _0x1b1067;})[_0xdd9b('0x26')](respondWithFilteredResult(_0x248258,_0x242692))[_0xdd9b('0x45')](handleError(_0x248258,null));};exports[_0xdd9b('0x46')]=function(_0x2a2dd5,_0x478451){var _0xd64da6={'raw':!![],'where':{'id':_0x2a2dd5[_0xdd9b('0x47')]['id']}},_0x1e6783={};_0x1e6783[_0xdd9b('0x38')]=_[_0xdd9b('0x48')](db[_0xdd9b('0x30')][_0xdd9b('0x31')]);_0x1e6783['query']=_[_0xdd9b('0x48')](_0x2a2dd5[_0xdd9b('0x35')]);_0x1e6783[_0xdd9b('0x36')]=_['intersection'](_0x1e6783[_0xdd9b('0x38')],_0x1e6783['query']);_0xd64da6[_0xdd9b('0x39')]=_[_0xdd9b('0x37')](_0x1e6783[_0xdd9b('0x38')],qs[_0xdd9b('0x3a')](_0x2a2dd5[_0xdd9b('0x35')]['fields']));_0xd64da6[_0xdd9b('0x39')]=_0xd64da6[_0xdd9b('0x39')]['length']?_0xd64da6[_0xdd9b('0x39')]:_0x1e6783['model'];if(_0x2a2dd5[_0xdd9b('0x35')][_0xdd9b('0x43')]){_0xd64da6[_0xdd9b('0x49')]=[{'all':!![]}];}_0xd64da6=_[_0xdd9b('0x41')]({},_0xd64da6,_0x2a2dd5['options']);return db[_0xdd9b('0x30')][_0xdd9b('0x4a')](_0xd64da6)[_0xdd9b('0x26')](handleEntityNotFound(_0x478451,null))[_0xdd9b('0x26')](respondWithResult(_0x478451,null))[_0xdd9b('0x45')](handleError(_0x478451,null));};exports['download']=function(_0x39cfe3,_0x4578d7,_0x5ae161){return db[_0xdd9b('0x30')][_0xdd9b('0x4a')]({'where':{'id':_0x39cfe3[_0xdd9b('0x47')]['id']},'attributes':[_0xdd9b('0x2d'),_0xdd9b('0x7')],'raw':!![]})[_0xdd9b('0x26')](handleEntityNotFound(_0x4578d7,null))[_0xdd9b('0x26')](function(_0xf36610){if(_0xf36610){var _0x1bd9f7=path[_0xdd9b('0x4b')](config[_0xdd9b('0x4c')],_0xdd9b('0x4d'),util['format'](_0xdd9b('0x4e'),path[_0xdd9b('0x4f')](_0xf36610[_0xdd9b('0x7')])));var _0x402338=fs['createWriteStream'](_0x1bd9f7);var _0x2ff1cd=archiver(_0xdd9b('0x50'),{'zlib':{'level':0x9}});_0x2ff1cd['on'](_0xdd9b('0x51'),function(_0x127860){if(_0x127860[_0xdd9b('0x52')]===_0xdd9b('0x53')){logger['error'](_0x127860);}else{throw new db[(_0xdd9b('0x54'))][(_0xdd9b('0x55'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x2ff1cd['on'](_0xdd9b('0x2b'),function(_0x46edb0){throw new db['Sequelize'][(_0xdd9b('0x55'))](_0xdd9b('0x56'));});_0x2ff1cd[_0xdd9b('0x57')](_0x402338);_0x2ff1cd['glob']('**/*',{'cwd':path[_0xdd9b('0x4b')](config[_0xdd9b('0x4c')],_0xdd9b('0x4d'),path[_0xdd9b('0x58')](_0xf36610[_0xdd9b('0x7')])),'ignore':[path[_0xdd9b('0x4b')](path[_0xdd9b('0x4f')](_0xf36610['path']),'node_modules/**/*'),path['join'](path[_0xdd9b('0x4f')](_0xf36610[_0xdd9b('0x7')]),_0xdd9b('0x59'))],'nodir':!![]})[_0xdd9b('0x5a')]();_0x402338['on']('close',function(){if(!fs['existsSync'](_0x1bd9f7)){throw new db['Sequelize'][(_0xdd9b('0x55'))](_0xdd9b('0x5b'));}return _0x4578d7['download'](_0x1bd9f7,util[_0xdd9b('0x5c')](_0xdd9b('0x4e'),path[_0xdd9b('0x4f')](_0xf36610[_0xdd9b('0x7')])),function(_0x221c6b){if(_0x221c6b){throw new db['Sequelize'][(_0xdd9b('0x55'))](_0xdd9b('0x5d'));}fs['unlinkSync'](_0x1bd9f7);logger[_0xdd9b('0x5e')]('Download\x20completed');logger[_0xdd9b('0x5e')]('Temporary\x20file\x20removed');});});}return null;})['catch'](handleError(_0x4578d7,null));};exports[_0xdd9b('0x5f')]=function(_0x34ec02,_0x12707b,_0xfe94da){var _0xd7d99=path[_0xdd9b('0x4f')](_0x34ec02[_0xdd9b('0x60')][_0xdd9b('0x61')],path[_0xdd9b('0x62')](_0x34ec02['file'][_0xdd9b('0x61')]));var _0x3fc603=path[_0xdd9b('0x4b')](config['root'],_0xdd9b('0x4d'),_0x34ec02[_0xdd9b('0x60')][_0xdd9b('0x61')]);var _0x45ec2f=path[_0xdd9b('0x4b')](config[_0xdd9b('0x4c')],_0xdd9b('0x4d'),_0xd7d99);logger['info'](_0xdd9b('0x63'),_0x3fc603);logger[_0xdd9b('0x5e')](_0xdd9b('0x64'),_0x45ec2f);try{fs['chmodSync'](_0x3fc603,parseInt(_0xdd9b('0x65'),0x8));extract(_0x3fc603,{'dir':_0x45ec2f},function(_0x44f684){if(_0x44f684){logger[_0xdd9b('0x2b')](_0x44f684);handleError(_0x44f684,!![]);};var _0x2666a1=fs[_0xdd9b('0x66')](_0x45ec2f);if(_0x2666a1[_0xdd9b('0x3b')]>0x1){removeReferences(_0x3fc603,_0x45ec2f);logger[_0xdd9b('0x2b')]('Invalid\x20plugin\x20structure');return _0xfe94da(new Error(_0xdd9b('0x67')));}var _0x583e4d=fs[_0xdd9b('0x68')](path['join'](_0x45ec2f,_0x2666a1[0x0]));if(_0x583e4d['isFile']()){removeReferences(_0x3fc603,_0x45ec2f);logger[_0xdd9b('0x2b')](_0xdd9b('0x67'));return _0xfe94da(new Error('Invalid\x20plugin\x20structure'));}if(_0x583e4d['isDirectory']()){var _0x2f9da9=fs[_0xdd9b('0x66')](path[_0xdd9b('0x4b')](_0x45ec2f,_0x2666a1[0x0]));if(_0x2f9da9[_0xdd9b('0x3b')]===0x0){removeReferences(_0x3fc603,_0x45ec2f);logger[_0xdd9b('0x2b')]('Invalid\x20plugin\x20structure');return _0xfe94da(new Error('Invalid\x20plugin\x20structure'));}var _0x238e27=_0x2f9da9[_0xdd9b('0x69')](function(_0x3f777e){return _0x3f777e==='manifest.json';});if(!_0x238e27){return _0xfe94da(new Error(_0xdd9b('0x6a')));}var _0x28ea74=fs[_0xdd9b('0x6b')](path[_0xdd9b('0x4b')](_0x45ec2f,_0x2666a1[0x0],_0xdd9b('0x6c')));var _0x24f19e=JSON[_0xdd9b('0x6d')](_0x28ea74);if(_0xdd9b('0x20')==typeof _0x24f19e[_0xdd9b('0x2d')]){return _0xfe94da(new Error(_0xdd9b('0x6e')));}if(_0xdd9b('0x20')==typeof _0x24f19e[_0xdd9b('0x33')]){return _0xfe94da(new Error('Invalid\x20manifest:\x20type\x20missing'));}if(_0xdd9b('0x20')==typeof _0x24f19e[_0xdd9b('0x6f')]){return _0xfe94da(new Error(_0xdd9b('0x70')));}if(_0xdd9b('0x20')==typeof _0x24f19e['parameters']){return _0xfe94da(new Error(_0xdd9b('0x71')));}if(_0x24f19e['type']==='html'){if(_0xdd9b('0x20')==typeof _0x24f19e['parameters'][_0xdd9b('0x72')]){return _0xfe94da(new Error(_0xdd9b('0x73')));}if(_0xdd9b('0x20')==typeof _0x24f19e[_0xdd9b('0x74')][_0xdd9b('0x72')]['admin']&&_0xdd9b('0x20')==typeof _0x24f19e[_0xdd9b('0x74')][_0xdd9b('0x72')]['agent']){return _0xfe94da(new Error(_0xdd9b('0x75')));}}else if(_0x24f19e[_0xdd9b('0x33')]===_0xdd9b('0x76')){if('undefined'==typeof _0x24f19e[_0xdd9b('0x74')][_0xdd9b('0x77')]){return _0xfe94da(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if('undefined'==typeof _0x24f19e[_0xdd9b('0x74')][_0xdd9b('0x78')]){return _0xfe94da(new Error(_0xdd9b('0x79')));}}else{return _0xfe94da(new Error(_0xdd9b('0x7a')));}var _0x320655=_0x24f19e[_0xdd9b('0x2d')];var _0x1541ac=_0x24f19e[_0xdd9b('0x7b')];var _0x301220=_0x24f19e[_0xdd9b('0x33')];var _0x23f613=_0x24f19e[_0xdd9b('0x7c')]?_0x24f19e['sidebar']:_0xdd9b('0x7d');var _0x57f79e=_0x24f19e[_0xdd9b('0x7e')]?_0x24f19e[_0xdd9b('0x7e')]:_0xdd9b('0x7f');var _0x27ab9c='';var _0x4150a4='';var _0x7226b1='';var _0x229570='';var _0x1f0326=_0x24f19e[_0xdd9b('0x6f')];if(_0x301220==='html'){if(_0xdd9b('0x20')!=typeof _0x24f19e['parameters'][_0xdd9b('0x72')][_0xdd9b('0x80')]){var _0x262687=_0x24f19e[_0xdd9b('0x74')]['views'][_0xdd9b('0x80')];if(!/^(f|ht)tps?:\/\//i['test'](_0x262687)){_0x27ab9c=path[_0xdd9b('0x4b')]('plugins',_0xd7d99,_0x2666a1[0x0],_0x262687);}else{_0x27ab9c=_0x262687;}}else{logger[_0xdd9b('0x5e')](_0xdd9b('0x81'));}if(_0xdd9b('0x20')!=typeof _0x24f19e['parameters'][_0xdd9b('0x72')]['agent']){var _0x21b7d2=_0x24f19e[_0xdd9b('0x74')]['views']['agent'];if(!/^(f|ht)tps?:\/\//i[_0xdd9b('0x82')](_0x21b7d2)){_0x4150a4=path[_0xdd9b('0x4b')](_0xdd9b('0x83'),_0xd7d99,_0x2666a1[0x0],_0x21b7d2);}else{_0x4150a4=_0x21b7d2;}}else{logger['info']('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x301220===_0xdd9b('0x76')){_0x7226b1=_0x24f19e[_0xdd9b('0x74')][_0xdd9b('0x77')];_0x229570=_0x24f19e[_0xdd9b('0x74')][_0xdd9b('0x78')];if(_0xdd9b('0x20')!=typeof _0x24f19e[_0xdd9b('0x74')]['views']){if(_0xdd9b('0x20')!=typeof _0x24f19e['parameters'][_0xdd9b('0x72')][_0xdd9b('0x80')]){var _0x262687=_0x24f19e[_0xdd9b('0x74')]['views'][_0xdd9b('0x80')];if(!/^(f|ht)tps?:\/\//i[_0xdd9b('0x82')](_0x262687)){_0x27ab9c=path[_0xdd9b('0x4b')](_0xdd9b('0x83'),_0xd7d99,_0x2666a1[0x0],_0x262687);}else{_0x27ab9c=_0x262687;}}if(_0xdd9b('0x20')!=typeof _0x24f19e['parameters'][_0xdd9b('0x72')][_0xdd9b('0x84')]){var _0x21b7d2=_0x24f19e[_0xdd9b('0x74')][_0xdd9b('0x72')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0xdd9b('0x82')](_0x21b7d2)){_0x4150a4=path['join']('plugins',_0xd7d99,_0x2666a1[0x0],_0x21b7d2);}else{_0x4150a4=_0x21b7d2;}}}}var _0x382171={'name':_0x320655,'description':_0x1541ac,'path':path[_0xdd9b('0x4b')](_0xd7d99,_0x2666a1[0x0]),'type':_0x301220,'sidebar':_0x23f613,'icon':_0x57f79e,'adminUrl':_0x27ab9c,'agentUrl':_0x4150a4,'scriptName':_0x7226b1,'scriptPath':_0x229570,'version':_0x1f0326};removeReferences(_0x3fc603,null);return db[_0xdd9b('0x30')][_0xdd9b('0x85')](_0x382171)[_0xdd9b('0x26')](function(_0xd7f33f){var _0x16015e={'role':_0x34ec02[_0xdd9b('0x86')][_0xdd9b('0x87')],'userProfileId':_0x34ec02[_0xdd9b('0x86')][_0xdd9b('0x88')]};if(!_0x16015e)throw new Error(_0xdd9b('0x89'));if(_0x16015e[_0xdd9b('0x87')]===_0xdd9b('0x8a')){var _0x16da24=_0xd7f33f[_0xdd9b('0x27')]({'plain':!![]});return db[_0xdd9b('0x8b')][_0xdd9b('0x4a')]({'where':{'name':_0xdd9b('0x28'),'userProfileId':_0x16015e['userProfileId']},'raw':!![]})['then'](function(_0x338a14){if(_0x338a14&&_0x338a14[_0xdd9b('0x8c')]===0x0){return db['UserProfileResource'][_0xdd9b('0x85')]({'name':_0x16da24[_0xdd9b('0x2d')],'resourceId':_0x16da24['id'],'type':_0x338a14[_0xdd9b('0x2d')],'sectionId':_0x338a14['id']},{})['then'](function(){return _0xd7f33f;});}else{return _0xd7f33f;}})[_0xdd9b('0x45')](function(_0x1570ff){logger[_0xdd9b('0x2b')](_0xdd9b('0x8d'),_0x1570ff);throw _0x1570ff;});}return _0xd7f33f;})['then'](respondWithResult(_0x12707b,null))['catch'](handleError(_0x12707b,null));}});}catch(_0x44828c){_0x12707b[_0xdd9b('0x22')](0x1f4)[_0xdd9b('0x8e')](_0x44828c);}};function removeReferences(_0x1ff347,_0x4c2abd){try{if(_0x1ff347){fs[_0xdd9b('0x8f')](_0x1ff347);logger[_0xdd9b('0x5e')](_0xdd9b('0x90'));}if(_0x4c2abd){rimraf(_0x4c2abd,function(){});logger[_0xdd9b('0x5e')](_0xdd9b('0x91'));}}catch(_0x514e0b){logger[_0xdd9b('0x2b')](_0x514e0b);}}exports[_0xdd9b('0x92')]=function(_0x31a20d,_0x396cda,_0x469a26){return db[_0xdd9b('0x30')][_0xdd9b('0x4a')]({'where':{'id':_0x31a20d['params']['id']}})[_0xdd9b('0x26')](handleEntityNotFound(_0x396cda,null))[_0xdd9b('0x26')](saveUpdates(_0x31a20d['body'],null))[_0xdd9b('0x26')](respondWithResult(_0x396cda,null))[_0xdd9b('0x45')](handleError(_0x396cda,null));};exports[_0xdd9b('0x93')]=function(_0x354fb2,_0x107717,_0x55a518){return db[_0xdd9b('0x30')]['find']({'where':{'id':_0x354fb2[_0xdd9b('0x47')]['id']}})[_0xdd9b('0x26')](function(_0x391116){if(_0x391116){return _0x391116['destroy']();}})[_0xdd9b('0x26')](function(_0x38bf50){rimraf(path[_0xdd9b('0x4b')](config[_0xdd9b('0x4c')],_0xdd9b('0x4d'),path[_0xdd9b('0x58')](_0x38bf50[_0xdd9b('0x7')])),function(){});return _0x38bf50;})[_0xdd9b('0x26')](handleEntityNotFound(_0x107717,null))[_0xdd9b('0x26')](respondWithStatusCode(_0x107717,null))[_0xdd9b('0x45')](handleError(_0x107717,null));};exports[_0xdd9b('0x94')]=function(_0x5b9890,_0x383a91,_0x252b72){return BPromise[_0xdd9b('0x95')]()[_0xdd9b('0x26')](function(){if(!_0x5b9890['query'][_0xdd9b('0x7')]){throw new Error(_0xdd9b('0x96'));}if(!_0x5b9890['query']['port']){throw new Error(_0xdd9b('0x97'));}var _0x448555=_0x5b9890['query'][_0xdd9b('0x98')]?_0x5b9890[_0xdd9b('0x35')]['hostname']+':'+_0x5b9890[_0xdd9b('0x35')][_0xdd9b('0x99')]:'http://localhost:'+_0x5b9890['query']['port'];var _0x22a566=_0x5b9890['query'][_0xdd9b('0x1d')]?_0x5b9890[_0xdd9b('0x35')][_0xdd9b('0x1d')]:!![];var _0xf80341=_0x5b9890['query']['encoding']?_0x5b9890[_0xdd9b('0x35')]['encoding']:null;var _0x5411cb={'method':_0x5b9890['method'],'uri':util[_0xdd9b('0x5c')]('%s%s',_0x448555,_0x5b9890[_0xdd9b('0x35')][_0xdd9b('0x7')]),'json':_0x22a566,'resolveWithFullResponse':!![],'encoding':_0xf80341,'qs':_0x5b9890[_0xdd9b('0x35')]};if(_0x5b9890[_0xdd9b('0x9a')]){_0x5411cb[_0xdd9b('0x9a')]=_0x5b9890[_0xdd9b('0x9a')];if(_0x5411cb[_0xdd9b('0x9a')][_0xdd9b('0x9b')]){delete _0x5411cb[_0xdd9b('0x9a')][_0xdd9b('0x9b')];}}if(_0x5411cb[_0xdd9b('0x9a')][_0xdd9b('0x9c')]){delete _0x5411cb[_0xdd9b('0x9a')][_0xdd9b('0x9c')];}return rp(_0x5411cb);})[_0xdd9b('0x26')](function(_0x13e52a){if(_0x13e52a){_0x383a91[_0xdd9b('0x9d')](_0x13e52a[_0xdd9b('0x9a')]);logger[_0xdd9b('0x5e')](_0x13e52a[_0xdd9b('0x86')]);if(_['endsWith'](_0x5b9890['query']['path'],'download')&&_0x13e52a[_0xdd9b('0x9e')]==0x1f4){return _0x383a91[_0xdd9b('0x1c')](_0x13e52a[_0xdd9b('0x9e')]);}else{return _0x383a91['status'](_0x13e52a[_0xdd9b('0x9e')])[_0xdd9b('0x8e')](_0x13e52a['body']);}}else{return _0x383a91['sendStatus'](0xc8);}})['catch'](handleError(_0x383a91,null));};exports['webhookPost']=function(_0x515963,_0x2492ad,_0x3242a3){return BPromise[_0xdd9b('0x95')]()[_0xdd9b('0x26')](function(){if(!_0x515963['query']['path']){throw new Error(_0xdd9b('0x96'));}if(!_0x515963['query'][_0xdd9b('0x99')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x5ec549=_0x515963[_0xdd9b('0x35')][_0xdd9b('0x98')]?_0x515963[_0xdd9b('0x35')][_0xdd9b('0x98')]+':'+_0x515963[_0xdd9b('0x35')]['port']:_0xdd9b('0x9f')+_0x515963['query'][_0xdd9b('0x99')];var _0x3cd713=_0x515963['query']['json']?_0x515963['query']['json']:!![];var _0x13ab24=_0x515963['query'][_0xdd9b('0xa0')]?_0x515963[_0xdd9b('0x35')][_0xdd9b('0xa0')]:null;var _0x58dbaa={'method':_0x515963[_0xdd9b('0xa1')],'uri':util[_0xdd9b('0x5c')](_0xdd9b('0xa2'),_0x5ec549,_0x515963[_0xdd9b('0x35')][_0xdd9b('0x7')]),'json':_0x3cd713,'resolveWithFullResponse':!![],'encoding':_0x13ab24,'body':_0x515963[_0xdd9b('0x86')]};if(_0x515963[_0xdd9b('0x9a')]){_0x58dbaa[_0xdd9b('0x9a')]=_0x515963[_0xdd9b('0x9a')];if(_0x58dbaa['headers'][_0xdd9b('0x9b')]){delete _0x58dbaa['headers'][_0xdd9b('0x9b')];}}if(_0x58dbaa[_0xdd9b('0x9a')][_0xdd9b('0x9c')]){delete _0x58dbaa[_0xdd9b('0x9a')][_0xdd9b('0x9c')];}return rp(_0x58dbaa);})['then'](function(_0x168a40){if(_0x168a40){_0x2492ad[_0xdd9b('0x9d')](_0x168a40[_0xdd9b('0x9a')]);logger[_0xdd9b('0x5e')](_0x168a40[_0xdd9b('0x86')]);return _0x2492ad[_0xdd9b('0x22')](_0x168a40[_0xdd9b('0x9e')])['send'](_0x168a40[_0xdd9b('0x86')]);}else{return _0x2492ad[_0xdd9b('0x1c')](0xc8);}})[_0xdd9b('0x45')](handleError(_0x2492ad,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 015177a..98e1f4c 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 _0x0024=['../../mysqldb','setMaxListeners','update','emit','hasOwnProperty','hook','exports'];(function(_0x2d32be,_0x4343cb){var _0x58bde0=function(_0x39a305){while(--_0x39a305){_0x2d32be['push'](_0x2d32be['shift']());}};_0x58bde0(++_0x4343cb);}(_0x0024,0xa8));var _0x4002=function(_0x2eda6d,_0x384926){_0x2eda6d=_0x2eda6d-0x0;var _0x437f47=_0x0024[_0x2eda6d];return _0x437f47;};'use strict';var EventEmitter=require('events');var Plugin=require(_0x4002('0x0'))['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents[_0x4002('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4002('0x2'),'afterDestroy':'remove'};function emitEvent(_0x4f3b32){return function(_0x423907,_0x1190e7,_0x5ca2fe){PluginEvents['emit'](_0x4f3b32+':'+_0x423907['id'],_0x423907);PluginEvents[_0x4002('0x3')](_0x4f3b32,_0x423907);_0x5ca2fe(null);};}for(var e in events){if(events[_0x4002('0x4')](e)){var event=events[e];Plugin[_0x4002('0x5')](e,emitEvent(event));}}module[_0x4002('0x6')]=PluginEvents; \ No newline at end of file +var _0x8819=['remove','emit','hasOwnProperty','exports','Plugin','setMaxListeners','save','update'];(function(_0x3d5f24,_0xe4f16a){var _0x284659=function(_0x47916b){while(--_0x47916b){_0x3d5f24['push'](_0x3d5f24['shift']());}};_0x284659(++_0xe4f16a);}(_0x8819,0x94));var _0x9881=function(_0x800c39,_0x26767d){_0x800c39=_0x800c39-0x0;var _0x3b0238=_0x8819[_0x800c39];return _0x3b0238;};'use strict';var EventEmitter=require('events');var Plugin=require('../../mysqldb')['db'][_0x9881('0x0')];var PluginEvents=new EventEmitter();PluginEvents[_0x9881('0x1')](0x0);var events={'afterCreate':_0x9881('0x2'),'afterUpdate':_0x9881('0x3'),'afterDestroy':_0x9881('0x4')};function emitEvent(_0x5e52c5){return function(_0x333d6f,_0x446deb,_0xf41442){PluginEvents[_0x9881('0x5')](_0x5e52c5+':'+_0x333d6f['id'],_0x333d6f);PluginEvents[_0x9881('0x5')](_0x5e52c5,_0x333d6f);_0xf41442(null);};}for(var e in events){if(events[_0x9881('0x6')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0x9881('0x7')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 93f43fc..85b7022 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 _0x3261=['api','path','../../config/environment','./plugin.attributes','util','../../config/logger'];(function(_0x2ef644,_0x2ab0ff){var _0x11f00e=function(_0x32983a){while(--_0x32983a){_0x2ef644['push'](_0x2ef644['shift']());}};_0x11f00e(++_0x2ab0ff);}(_0x3261,0x7c));var _0x1326=function(_0x299ed7,_0x4f7ee4){_0x299ed7=_0x299ed7-0x0;var _0x28dfed=_0x3261[_0x299ed7];return _0x28dfed;};'use strict';var _=require('lodash');var util=require(_0x1326('0x0'));var logger=require(_0x1326('0x1'))(_0x1326('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1326('0x3'));var rimraf=require('rimraf');var config=require(_0x1326('0x4'));var attributes=require(_0x1326('0x5'));module['exports']=function(_0x10daf6,_0xb1268){return _0x10daf6['define']('Plugin',attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc694=['lodash','util','../../config/logger','bluebird','path','rimraf','./plugin.attributes','exports','define','Plugin','plugins'];(function(_0x46ae5a,_0x2a38d0){var _0x434986=function(_0x22735d){while(--_0x22735d){_0x46ae5a['push'](_0x46ae5a['shift']());}};_0x434986(++_0x2a38d0);}(_0xc694,0x11e));var _0x4c69=function(_0x362046,_0x5cf93f){_0x362046=_0x362046-0x0;var _0x419ffe=_0xc694[_0x362046];return _0x419ffe;};'use strict';var _=require(_0x4c69('0x0'));var util=require(_0x4c69('0x1'));var logger=require(_0x4c69('0x2'))('api');var moment=require('moment');var BPromise=require(_0x4c69('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4c69('0x4'));var rimraf=require(_0x4c69('0x5'));var config=require('../../config/environment');var attributes=require(_0x4c69('0x6'));module[_0x4c69('0x7')]=function(_0x26e8d7,_0x43131b){return _0x26e8d7[_0x4c69('0x8')](_0x4c69('0x9'),attributes,{'tableName':_0x4c69('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index c424eae..54c6811 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 _0x9972=['socket.io-emitter','./plugin.socket','register','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','Plugin','create','body','options','raw','CreatePlugin','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0xfb42e6,_0x5f5d4b){var _0x27265b=function(_0x163e81){while(--_0x163e81){_0xfb42e6['push'](_0xfb42e6['shift']());}};_0x27265b(++_0x5f5d4b);}(_0x9972,0xeb));var _0x2997=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x9972[_0x40a045];return _0x1a687c;};'use strict';var _=require('lodash');var util=require(_0x2997('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2997('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2997('0x2'))['db'];var utils=require(_0x2997('0x3'));var logger=require(_0x2997('0x4'))(_0x2997('0x5'));var config=require(_0x2997('0x6'));var jayson=require(_0x2997('0x7'));var client=jayson[_0x2997('0x8')][_0x2997('0x9')]({'port':0x232a});config[_0x2997('0xa')]=_[_0x2997('0xb')](config[_0x2997('0xa')],{'host':_0x2997('0xc'),'port':0x18eb});var socket=require(_0x2997('0xd'))(new Redis(config['redis']));require(_0x2997('0xe'))[_0x2997('0xf')](socket);function respondWithRpcPromise(_0x2e9b7a,_0x484dc4,_0x3729df){return new BPromise(function(_0x4b1fd0,_0x1b0b0a){return client['request'](_0x2e9b7a,_0x3729df)['then'](function(_0x58cd8e){logger[_0x2997('0x10')](_0x2997('0x11'),_0x484dc4,_0x2997('0x12'));logger[_0x2997('0x13')]('Plugin,\x20%s,\x20%s,\x20%s',_0x484dc4,'request\x20sent',JSON[_0x2997('0x14')](_0x58cd8e));if(_0x58cd8e[_0x2997('0x15')]){if(_0x58cd8e['error'][_0x2997('0x16')]===0x1f4){logger[_0x2997('0x15')](_0x2997('0x11'),_0x484dc4,_0x58cd8e[_0x2997('0x15')][_0x2997('0x17')]);return _0x1b0b0a(_0x58cd8e[_0x2997('0x15')]['message']);}logger[_0x2997('0x15')](_0x2997('0x11'),_0x484dc4,_0x58cd8e['error']['message']);return _0x4b1fd0(_0x58cd8e[_0x2997('0x15')][_0x2997('0x17')]);}else{logger[_0x2997('0x10')]('Plugin,\x20%s,\x20%s',_0x484dc4,_0x2997('0x12'));_0x4b1fd0(_0x58cd8e['result'][_0x2997('0x17')]);}})[_0x2997('0x18')](function(_0x12cb98){logger[_0x2997('0x15')]('Plugin,\x20%s,\x20%s',_0x484dc4,_0x12cb98);_0x1b0b0a(_0x12cb98);});});}exports['CreatePlugin']=function(_0x592761){var _0x2bc0fa=this;return new Promise(function(_0x19a325,_0x4578a4){return db[_0x2997('0x19')][_0x2997('0x1a')](_0x592761[_0x2997('0x1b')],{'raw':_0x592761[_0x2997('0x1c')]?_0x592761['options'][_0x2997('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x10ff97){logger[_0x2997('0x10')]('CreatePlugin',_0x592761);logger[_0x2997('0x13')](_0x2997('0x1e'),_0x592761,JSON[_0x2997('0x14')](_0x10ff97));_0x19a325(_0x10ff97);})[_0x2997('0x18')](function(_0x154ccf){logger[_0x2997('0x15')]('CreatePlugin',_0x154ccf[_0x2997('0x17')],_0x592761);_0x4578a4(_0x2bc0fa[_0x2997('0x15')](0x1f4,_0x154ccf[_0x2997('0x17')]));});});}; \ No newline at end of file +var _0x9847=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','Plugin','body','options','CreatePlugin','lodash','util','moment','bluebird'];(function(_0x3ed7eb,_0x5432ff){var _0x15669b=function(_0x1021c5){while(--_0x1021c5){_0x3ed7eb['push'](_0x3ed7eb['shift']());}};_0x15669b(++_0x5432ff);}(_0x9847,0xa1));var _0x7984=function(_0x185f26,_0x4a57a2){_0x185f26=_0x185f26-0x0;var _0x5a738e=_0x9847[_0x185f26];return _0x5a738e;};'use strict';var _=require(_0x7984('0x0'));var util=require(_0x7984('0x1'));var moment=require(_0x7984('0x2'));var BPromise=require(_0x7984('0x3'));var rs=require(_0x7984('0x4'));var fs=require('fs');var Redis=require(_0x7984('0x5'));var db=require(_0x7984('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x7984('0x7'))(_0x7984('0x8'));var config=require(_0x7984('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7984('0xa')]['http']({'port':0x232a});config[_0x7984('0xb')]=_[_0x7984('0xc')](config['redis'],{'host':_0x7984('0xd'),'port':0x18eb});var socket=require(_0x7984('0xe'))(new Redis(config[_0x7984('0xb')]));require(_0x7984('0xf'))[_0x7984('0x10')](socket);function respondWithRpcPromise(_0x14abe5,_0x46ab7a,_0x2a1592){return new BPromise(function(_0x4633c8,_0x494b45){return client[_0x7984('0x11')](_0x14abe5,_0x2a1592)[_0x7984('0x12')](function(_0xe4db59){logger[_0x7984('0x13')](_0x7984('0x14'),_0x46ab7a,_0x7984('0x15'));logger[_0x7984('0x16')]('Plugin,\x20%s,\x20%s,\x20%s',_0x46ab7a,'request\x20sent',JSON[_0x7984('0x17')](_0xe4db59));if(_0xe4db59[_0x7984('0x18')]){if(_0xe4db59[_0x7984('0x18')][_0x7984('0x19')]===0x1f4){logger[_0x7984('0x18')]('Plugin,\x20%s,\x20%s',_0x46ab7a,_0xe4db59[_0x7984('0x18')][_0x7984('0x1a')]);return _0x494b45(_0xe4db59[_0x7984('0x18')][_0x7984('0x1a')]);}logger[_0x7984('0x18')]('Plugin,\x20%s,\x20%s',_0x46ab7a,_0xe4db59[_0x7984('0x18')][_0x7984('0x1a')]);return _0x4633c8(_0xe4db59[_0x7984('0x18')][_0x7984('0x1a')]);}else{logger['info'](_0x7984('0x14'),_0x46ab7a,_0x7984('0x15'));_0x4633c8(_0xe4db59[_0x7984('0x1b')][_0x7984('0x1a')]);}})[_0x7984('0x1c')](function(_0x1b2cda){logger['error'](_0x7984('0x14'),_0x46ab7a,_0x1b2cda);_0x494b45(_0x1b2cda);});});}exports['CreatePlugin']=function(_0x3cc30c){var _0x2d05aa=this;return new Promise(function(_0x31b351,_0x4adbb9){return db[_0x7984('0x1d')]['create'](_0x3cc30c[_0x7984('0x1e')],{'raw':_0x3cc30c[_0x7984('0x1f')]?_0x3cc30c[_0x7984('0x1f')]['raw']===undefined?!![]:![]:!![]})[_0x7984('0x12')](function(_0x37292d){logger['info'](_0x7984('0x20'),_0x3cc30c);logger[_0x7984('0x16')](_0x7984('0x20'),_0x3cc30c,JSON['stringify'](_0x37292d));_0x31b351(_0x37292d);})[_0x7984('0x1c')](function(_0x1c9b83){logger[_0x7984('0x18')](_0x7984('0x20'),_0x1c9b83[_0x7984('0x1a')],_0x3cc30c);_0x4adbb9(_0x2d05aa[_0x7984('0x18')](0x1f4,_0x1c9b83[_0x7984('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 8df1802..5c62296 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 _0xdcf6=['plugin:','./plugin.events','save','remove','emit','register','length'];(function(_0x3d292f,_0x3c56dc){var _0xbafb5c=function(_0x34e99f){while(--_0x34e99f){_0x3d292f['push'](_0x3d292f['shift']());}};_0xbafb5c(++_0x3c56dc);}(_0xdcf6,0x189));var _0x6dcf=function(_0x280587,_0x4e9971){_0x280587=_0x280587-0x0;var _0x3b7543=_0xdcf6[_0x280587];return _0x3b7543;};'use strict';var PluginEvents=require(_0x6dcf('0x0'));var events=[_0x6dcf('0x1'),_0x6dcf('0x2'),'update'];function createListener(_0xe88066,_0x989526){return function(_0x50470f){_0x989526[_0x6dcf('0x3')](_0xe88066,_0x50470f);};}function removeListener(_0x35429f,_0x402121){return function(){PluginEvents['removeListener'](_0x35429f,_0x402121);};}exports[_0x6dcf('0x4')]=function(_0x4ba4bb){for(var _0xc17471=0x0,_0x5b02d2=events[_0x6dcf('0x5')];_0xc17471<_0x5b02d2;_0xc17471++){var _0x14c7c2=events[_0xc17471];var _0x36fdbf=createListener(_0x6dcf('0x6')+_0x14c7c2,_0x4ba4bb);PluginEvents['on'](_0x14c7c2,_0x36fdbf);}}; \ No newline at end of file +var _0xdbaa=['removeListener','register','length','save','update','emit'];(function(_0xc83ca,_0x5ad0cf){var _0x44d041=function(_0x3792ad){while(--_0x3792ad){_0xc83ca['push'](_0xc83ca['shift']());}};_0x44d041(++_0x5ad0cf);}(_0xdbaa,0xd5));var _0xadba=function(_0x47fd36,_0x41535d){_0x47fd36=_0x47fd36-0x0;var _0x21a0fc=_0xdbaa[_0x47fd36];return _0x21a0fc;};'use strict';var PluginEvents=require('./plugin.events');var events=[_0xadba('0x0'),'remove',_0xadba('0x1')];function createListener(_0x11ba90,_0x471b3b){return function(_0x25c749){_0x471b3b[_0xadba('0x2')](_0x11ba90,_0x25c749);};}function removeListener(_0x56b9ec,_0x1b8bcf){return function(){PluginEvents[_0xadba('0x3')](_0x56b9ec,_0x1b8bcf);};}exports[_0xadba('0x4')]=function(_0x550c94){for(var _0x51c1de=0x0,_0x1f62cc=events[_0xadba('0x5')];_0x51c1de<_0x1f62cc;_0x51c1de++){var _0x5b9703=events[_0x51c1de];var _0x36c47a=createListener('plugin:'+_0x5b9703,_0x550c94);PluginEvents['on'](_0x5b9703,_0x36c47a);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 249299e..a5f71c1 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(_0x202d3d,_0x5beba3){var _0xc28de5=function(_0x5b197d){while(--_0x5b197d){_0x202d3d['push'](_0x202d3d['shift']());}};_0xc28de5(++_0x5beba3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'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(_0xf8e486,_0x5d2f29){var _0x5dcc9a=function(_0x363dfe){while(--_0x363dfe){_0xf8e486['push'](_0xf8e486['shift']());}};_0x5dcc9a(++_0x5d2f29);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'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 dc112d0..9ce06fd 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 _0x0102=['length','catch','show','describe','params','create','body','script','join','../../files/plugins','cwd','chdir','dump','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty','destroy','delete','../../config/pm2','../../config/logger','api','path','sendStatus','status','error','stack','name','send','npm\x20install','info','index','list','then','reject','express'];(function(_0x4d438a,_0x4ecd81){var _0x5a56e3=function(_0x242431){while(--_0x242431){_0x4d438a['push'](_0x4d438a['shift']());}};_0x5a56e3(++_0x4ecd81);}(_0x0102,0x186));var _0x2010=function(_0x13df7e,_0x11989f){_0x13df7e=_0x13df7e-0x0;var _0x13db62=_0x0102[_0x13df7e];return _0x13db62;};'use strict';var _=require('lodash');var pm2=require(_0x2010('0x0'));var logger=require(_0x2010('0x1'))(_0x2010('0x2'));var path=require(_0x2010('0x3'));var exec=require('child_process')['exec'];var BPromise=require('bluebird');function handleEntityNotFound(_0x4e30b3,_0x59082d){return function(_0x22e49f){if(!_0x22e49f){_0x4e30b3[_0x2010('0x4')](0x194);;}return _0x22e49f;};}function respondWithResult(_0x130725,_0x304264){_0x304264=_0x304264||0xc8;return function(_0x4eeb67){if(_0x4eeb67){return _0x130725[_0x2010('0x5')](_0x304264)['json'](_0x4eeb67);}return null;};}function handleError(_0x4728c0,_0x160e41){_0x160e41=_0x160e41||0x1f4;return function(_0x48dd91){logger[_0x2010('0x6')](_0x48dd91[_0x2010('0x7')]);if(_0x48dd91[_0x2010('0x8')]){delete _0x48dd91[_0x2010('0x8')];}_0x4728c0[_0x2010('0x5')](_0x160e41)[_0x2010('0x9')](_0x48dd91);};}function execChildProcess(){return new BPromise(function(_0x289ad4,_0x466c71){exec(_0x2010('0xa'),function(_0x39a821,_0x1d3b39,_0x32fe2e){logger[_0x2010('0xb')](_0x1d3b39);logger[_0x2010('0xb')](_0x32fe2e);if(_0x39a821){logger[_0x2010('0x6')](_0x39a821);return _0x466c71(_0x39a821);}return _0x289ad4(_0x1d3b39);});});}exports[_0x2010('0xc')]=function(_0x528a38,_0x579340){return pm2[_0x2010('0xd')]()[_0x2010('0xe')](function(_0x2e8ec2){if(_0x2e8ec2){var _0x10b587=_[_0x2010('0xf')](_0x2e8ec2,function(_0x335be4){return _0x335be4['name']===_0x2010('0x10')||_0x335be4[_0x2010('0x8')]==='motion2';});return{'rows':_0x10b587,'count':_0x10b587[_0x2010('0x11')]};}return null;})[_0x2010('0xe')](respondWithResult(_0x579340,null))[_0x2010('0x12')](handleError(_0x579340,null));};exports[_0x2010('0x13')]=function(_0x2d0bf2,_0x11bd28){return pm2[_0x2010('0x14')](_0x2d0bf2[_0x2010('0x15')]['id'])[_0x2010('0xe')](respondWithResult(_0x11bd28,null))['then'](handleEntityNotFound(_0x11bd28,null))['catch'](handleError(_0x11bd28,null));};exports[_0x2010('0x16')]=function(_0x38a15a,_0x3f9d62){if(_0x38a15a[_0x2010('0x17')]['name']&&_0x38a15a['body'][_0x2010('0x18')]){var _0x171e45=path[_0x2010('0x19')](__dirname,_0x2010('0x1a'),_0x38a15a[_0x2010('0x17')][_0x2010('0x18')]);var _0x4f621c=process[_0x2010('0x1b')]();process[_0x2010('0x1c')](path['dirname'](_0x171e45));return execChildProcess()['then'](function(_0x50aecc){process[_0x2010('0x1c')](_0x4f621c);return pm2['start']({'name':_0x38a15a[_0x2010('0x17')]['name'],'script':_0x171e45});})['then'](function(_0xdb57be){pm2[_0x2010('0x1d')]();return _0xdb57be[0x0];})['then'](respondWithResult(_0x3f9d62,0xc9))[_0x2010('0x12')](handleError(_0x3f9d62,null));}else{return _0x3f9d62['status'](0x1f4)[_0x2010('0x9')]({'message':_0x2010('0x1e')});}};exports[_0x2010('0x1f')]=function(_0x3dcea4,_0x3c5862){if(_0x3dcea4[_0x2010('0x17')]['id']){delete _0x3dcea4[_0x2010('0x17')]['id'];}var _0x3eb4dc={'online':_0x2010('0x20'),'stopped':_0x2010('0x21')};if(_0x3eb4dc[_0x2010('0x22')](_0x3dcea4[_0x2010('0x17')]['status'])){return pm2[_0x3eb4dc[_0x3dcea4[_0x2010('0x17')]['status']]](_0x3dcea4[_0x2010('0x15')]['id'])[_0x2010('0xe')](respondWithResult(_0x3c5862,0xc8))[_0x2010('0x12')](handleError(_0x3c5862,null));}else{return _0x3c5862[_0x2010('0x5')](0x1f4)['send']({'message':'Unknown\x20status'});}};exports[_0x2010('0x23')]=function(_0x48d9f2,_0x2839f2){if(_0x48d9f2[_0x2010('0x17')]['id']){delete _0x48d9f2['body']['id'];}if(_0x48d9f2[_0x2010('0x15')]['id']){return pm2[_0x2010('0x24')](_0x48d9f2[_0x2010('0x15')]['id'])[_0x2010('0xe')](function(_0x692ddc){pm2['dump']();return _0x692ddc[0x0];})[_0x2010('0xe')](respondWithResult(_0x2839f2,null))[_0x2010('0x12')](handleError(_0x2839f2,null));}else{return _0x2839f2[_0x2010('0x5')](0x1f4)['send']({'message':'Unknown\x20id'});}}; \ No newline at end of file +var _0x76dc=['catch','create','body','script','join','../../files/plugins','cwd','chdir','dirname','dump','send','Missing\x20name\x20and/or\x20path','update','restart','hasOwnProperty','Unknown\x20status','destroy','Unknown\x20id','lodash','../../config/pm2','../../config/logger','api','child_process','exec','sendStatus','json','stack','name','status','npm\x20install','info','error','index','list','then','reject','express','motion2','describe','params'];(function(_0x4c0622,_0x5dacaf){var _0x1799d8=function(_0x2ba801){while(--_0x2ba801){_0x4c0622['push'](_0x4c0622['shift']());}};_0x1799d8(++_0x5dacaf);}(_0x76dc,0x1f2));var _0xc76d=function(_0x450d1b,_0x5bcea7){_0x450d1b=_0x450d1b-0x0;var _0x2f84c8=_0x76dc[_0x450d1b];return _0x2f84c8;};'use strict';var _=require(_0xc76d('0x0'));var pm2=require(_0xc76d('0x1'));var logger=require(_0xc76d('0x2'))(_0xc76d('0x3'));var path=require('path');var exec=require(_0xc76d('0x4'))[_0xc76d('0x5')];var BPromise=require('bluebird');function handleEntityNotFound(_0x300f11,_0x50ed3a){return function(_0x507ea7){if(!_0x507ea7){_0x300f11[_0xc76d('0x6')](0x194);;}return _0x507ea7;};}function respondWithResult(_0x29ab70,_0x1c86fc){_0x1c86fc=_0x1c86fc||0xc8;return function(_0x4832bd){if(_0x4832bd){return _0x29ab70['status'](_0x1c86fc)[_0xc76d('0x7')](_0x4832bd);}return null;};}function handleError(_0x114572,_0x18574f){_0x18574f=_0x18574f||0x1f4;return function(_0x532d6a){logger['error'](_0x532d6a[_0xc76d('0x8')]);if(_0x532d6a[_0xc76d('0x9')]){delete _0x532d6a['name'];}_0x114572[_0xc76d('0xa')](_0x18574f)['send'](_0x532d6a);};}function execChildProcess(){return new BPromise(function(_0xd5c042,_0x2e1807){exec(_0xc76d('0xb'),function(_0x95e06b,_0x3f59ea,_0x193c4a){logger[_0xc76d('0xc')](_0x3f59ea);logger[_0xc76d('0xc')](_0x193c4a);if(_0x95e06b){logger[_0xc76d('0xd')](_0x95e06b);return _0x2e1807(_0x95e06b);}return _0xd5c042(_0x3f59ea);});});}exports[_0xc76d('0xe')]=function(_0x1a7b47,_0x24e88e){return pm2[_0xc76d('0xf')]()[_0xc76d('0x10')](function(_0x5cda20){if(_0x5cda20){var _0x8696db=_[_0xc76d('0x11')](_0x5cda20,function(_0x5bbed9){return _0x5bbed9[_0xc76d('0x9')]===_0xc76d('0x12')||_0x5bbed9[_0xc76d('0x9')]===_0xc76d('0x13');});return{'rows':_0x8696db,'count':_0x8696db['length']};}return null;})[_0xc76d('0x10')](respondWithResult(_0x24e88e,null))['catch'](handleError(_0x24e88e,null));};exports['show']=function(_0x45a83e,_0x31b032){return pm2[_0xc76d('0x14')](_0x45a83e[_0xc76d('0x15')]['id'])[_0xc76d('0x10')](respondWithResult(_0x31b032,null))['then'](handleEntityNotFound(_0x31b032,null))[_0xc76d('0x16')](handleError(_0x31b032,null));};exports[_0xc76d('0x17')]=function(_0xa0c5b6,_0x1c6d5b){if(_0xa0c5b6[_0xc76d('0x18')]['name']&&_0xa0c5b6[_0xc76d('0x18')][_0xc76d('0x19')]){var _0x5dffde=path[_0xc76d('0x1a')](__dirname,_0xc76d('0x1b'),_0xa0c5b6[_0xc76d('0x18')][_0xc76d('0x19')]);var _0x18f546=process[_0xc76d('0x1c')]();process[_0xc76d('0x1d')](path[_0xc76d('0x1e')](_0x5dffde));return execChildProcess()[_0xc76d('0x10')](function(_0x20e09c){process[_0xc76d('0x1d')](_0x18f546);return pm2['start']({'name':_0xa0c5b6[_0xc76d('0x18')][_0xc76d('0x9')],'script':_0x5dffde});})['then'](function(_0x637d68){pm2[_0xc76d('0x1f')]();return _0x637d68[0x0];})['then'](respondWithResult(_0x1c6d5b,0xc9))[_0xc76d('0x16')](handleError(_0x1c6d5b,null));}else{return _0x1c6d5b[_0xc76d('0xa')](0x1f4)[_0xc76d('0x20')]({'message':_0xc76d('0x21')});}};exports[_0xc76d('0x22')]=function(_0x1949c4,_0x89ee5){if(_0x1949c4['body']['id']){delete _0x1949c4['body']['id'];}var _0x285430={'online':_0xc76d('0x23'),'stopped':'stop'};if(_0x285430[_0xc76d('0x24')](_0x1949c4[_0xc76d('0x18')][_0xc76d('0xa')])){return pm2[_0x285430[_0x1949c4['body'][_0xc76d('0xa')]]](_0x1949c4['params']['id'])[_0xc76d('0x10')](respondWithResult(_0x89ee5,0xc8))[_0xc76d('0x16')](handleError(_0x89ee5,null));}else{return _0x89ee5['status'](0x1f4)[_0xc76d('0x20')]({'message':_0xc76d('0x25')});}};exports[_0xc76d('0x26')]=function(_0x2cf501,_0x4feeda){if(_0x2cf501[_0xc76d('0x18')]['id']){delete _0x2cf501['body']['id'];}if(_0x2cf501[_0xc76d('0x15')]['id']){return pm2['delete'](_0x2cf501[_0xc76d('0x15')]['id'])[_0xc76d('0x10')](function(_0x5dc369){pm2['dump']();return _0x5dc369[0x0];})['then'](respondWithResult(_0x4feeda,null))['catch'](handleError(_0x4feeda,null));}else{return _0x4feeda[_0xc76d('0xa')](0x1f4)[_0xc76d('0x20')]({'message':_0xc76d('0x27')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 1588adb..45cef08 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 _0xfa28=['../../config/environment','./realtime.controller','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x1d7599,_0x49929f){var _0x55da12=function(_0x3f7a5f){while(--_0x3f7a5f){_0x1d7599['push'](_0x1d7599['shift']());}};_0x55da12(++_0x49929f);}(_0xfa28,0x1c6));var _0x8fa2=function(_0x2df724,_0x411382){_0x2df724=_0x2df724-0x0;var _0x1b2504=_0xfa28[_0x2df724];return _0x1b2504;};'use strict';var multer=require(_0x8fa2('0x0'));var util=require(_0x8fa2('0x1'));var path=require(_0x8fa2('0x2'));var timeout=require(_0x8fa2('0x3'));var express=require(_0x8fa2('0x4'));var router=express[_0x8fa2('0x5')]();var fs_extra=require(_0x8fa2('0x6'));var auth=require(_0x8fa2('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x8fa2('0x8'));var controller=require(_0x8fa2('0x9'));router['get']('/queues',auth['isAuthenticated'](),controller['getQueues']);module[_0x8fa2('0xa')]=router; \ No newline at end of file +var _0x641b=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','/queues','isAuthenticated','getQueues','exports','multer','path'];(function(_0x2ab0fb,_0xf21f9e){var _0x578c50=function(_0x1223b3){while(--_0x1223b3){_0x2ab0fb['push'](_0x2ab0fb['shift']());}};_0x578c50(++_0xf21f9e);}(_0x641b,0xca));var _0xb641=function(_0x42f5a4,_0x25d8b0){_0x42f5a4=_0x42f5a4-0x0;var _0x3031d1=_0x641b[_0x42f5a4];return _0x3031d1;};'use strict';var multer=require(_0xb641('0x0'));var util=require('util');var path=require(_0xb641('0x1'));var timeout=require(_0xb641('0x2'));var express=require(_0xb641('0x3'));var router=express[_0xb641('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb641('0x5'));var interaction=require(_0xb641('0x6'));var config=require('../../config/environment');var controller=require('./realtime.controller');router[_0xb641('0x7')](_0xb641('0x8'),auth[_0xb641('0x9')](),controller[_0xb641('0xa')]);module[_0xb641('0xb')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index b5e8e40..5b89869 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 _0x1471=['type','startCase','Queues','filter','UserProfile','getResources','findAndCountAll','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','available','waiting','talking','outbound','push','pTalking','originated','dialMethod','startProgressive','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','get','loggedInDb','loggedIn','find','rows','merge','pick','getMembers','length','UserId','online','paused','agents','User','QueueId','Pause','findAll','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','code','Realtime,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','getQueues','mail','sms','openchannel','whatsapp','voice','resolve','query','channel','includes','toLowerCase','Invalid\x20channel','Queue','map','rawAttributes','fieldName','key','user','role'];(function(_0x37c7db,_0x4c8ea7){var _0x202b12=function(_0x1ed634){while(--_0x1ed634){_0x37c7db['push'](_0x37c7db['shift']());}};_0x202b12(++_0x4c8ea7);}(_0x1471,0xab));var _0x1147=function(_0x2e3207,_0x4f0460){_0x2e3207=_0x2e3207-0x0;var _0x4e025d=_0x1471[_0x2e3207];return _0x4e025d;};'use strict';var emlformat=require(_0x1147('0x0'));var rimraf=require(_0x1147('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1147('0x2'));var moment=require(_0x1147('0x3'));var BPromise=require(_0x1147('0x4'));var Mustache=require(_0x1147('0x5'));var util=require(_0x1147('0x6'));var path=require('path');var sox=require(_0x1147('0x7'));var csv=require('to-csv');var ejs=require(_0x1147('0x8'));var fs=require('fs');var fs_extra=require(_0x1147('0x9'));var _=require(_0x1147('0xa'));var squel=require(_0x1147('0xb'));var crypto=require(_0x1147('0xc'));var jsforce=require(_0x1147('0xd'));var deskjs=require(_0x1147('0xe'));var toCsv=require(_0x1147('0xf'));var querystring=require(_0x1147('0x10'));var Papa=require('papaparse');var Redis=require(_0x1147('0x11'));var authService=require(_0x1147('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x1147('0x13'));var hardwareService=require(_0x1147('0x14'));var logger=require(_0x1147('0x15'))(_0x1147('0x16'));var utils=require(_0x1147('0x17'));var config=require(_0x1147('0x18'));var licenseUtil=require(_0x1147('0x19'));var db=require(_0x1147('0x1a'))['db'];var jayson=require(_0x1147('0x1b'));var client=jayson[_0x1147('0x1c')][_0x1147('0x1d')]({'port':0x232a});var routingClient=jayson['client'][_0x1147('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x217aee,_0x137fce,_0xbe72c1,_0x4fd311){return new BPromise(function(_0xdbccd0,_0x75cccb){var _0xc68fa0=_0x4fd311||client;return _0xc68fa0[_0x1147('0x1e')](_0x217aee,_0xbe72c1)['then'](function(_0x403646){logger[_0x1147('0x1f')]('Realtime,\x20%s,\x20%s',_0x137fce,_0x1147('0x20'));logger[_0x1147('0x21')]('Realtime,\x20%s,\x20%s,\x20%s',_0x137fce,'request\x20sent',JSON[_0x1147('0x22')](_0x403646));if(_0x403646['error']){if(_0x403646[_0x1147('0x23')][_0x1147('0x24')]===0x1f4){logger['error'](_0x1147('0x25'),_0x137fce,_0x403646[_0x1147('0x23')][_0x1147('0x26')]);return _0x75cccb(_0x403646[_0x1147('0x23')][_0x1147('0x26')]);}logger[_0x1147('0x23')](_0x1147('0x25'),_0x137fce,_0x403646[_0x1147('0x23')]['message']);return _0xdbccd0(_0x403646[_0x1147('0x23')][_0x1147('0x26')]);}else{logger[_0x1147('0x1f')](_0x1147('0x25'),_0x137fce,_0x1147('0x20'));_0xdbccd0(_0x403646[_0x1147('0x27')]['message']);}})[_0x1147('0x28')](function(_0x1250a5){logger[_0x1147('0x23')](_0x1147('0x25'),_0x137fce,_0x1250a5);_0x75cccb(_0x1250a5);});});}function respondWithStatusCode(_0x43cdea,_0x4748c5){_0x4748c5=_0x4748c5||0xcc;return function(_0x5a91ce){if(_0x5a91ce){return _0x43cdea[_0x1147('0x29')](_0x4748c5);}return _0x43cdea['status'](_0x4748c5)['end']();};}function respondWithResult(_0x510aa9,_0x3778e8){_0x3778e8=_0x3778e8||0xc8;return function(_0x32a6bd){if(_0x32a6bd){return _0x510aa9[_0x1147('0x2a')](_0x3778e8)[_0x1147('0x2b')](_0x32a6bd);}};}function respondWithFilteredResult(_0x278c16,_0x48713c){return function(_0x36302f){if(_0x36302f){var _0x261dd0=typeof _0x48713c[_0x1147('0x2c')]===_0x1147('0x2d')&&typeof _0x48713c[_0x1147('0x2e')]===_0x1147('0x2d');var _0x576484=_0x36302f['count'];var _0x2b95ef=_0x261dd0?0x0:_0x48713c[_0x1147('0x2c')];var _0x2b6229=_0x261dd0?_0x36302f[_0x1147('0x2f')]:_0x48713c['offset']+_0x48713c['limit'];var _0x3316cc;if(_0x2b6229>=_0x576484){_0x2b6229=_0x576484;_0x3316cc=0xc8;}else{_0x3316cc=0xce;}_0x278c16[_0x1147('0x2a')](_0x3316cc);return _0x278c16[_0x1147('0x30')](_0x1147('0x31'),_0x2b95ef+'-'+_0x2b6229+'/'+_0x576484)[_0x1147('0x2b')](_0x36302f);}return null;};}function patchUpdates(_0x54bd41){return function(_0x507b0a){try{jsonpatch[_0x1147('0x32')](_0x507b0a,_0x54bd41,!![]);}catch(_0x16f38f){return BPromise[_0x1147('0x33')](_0x16f38f);}return _0x507b0a[_0x1147('0x34')]();};}function saveUpdates(_0x113867,_0x5d3791){return function(_0x83c18a){if(_0x83c18a){return _0x83c18a[_0x1147('0x35')](_0x113867)[_0x1147('0x36')](function(_0x1ad506){return _0x1ad506;});}return null;};}function removeEntity(_0x1b5f3e,_0x11ca48){return function(_0x5b865e){if(_0x5b865e){return _0x5b865e[_0x1147('0x37')]()['then'](function(){_0x1b5f3e['status'](0xcc)[_0x1147('0x38')]();});}};}function handleEntityNotFound(_0x3d2abf,_0xf4514d){return function(_0x32d81d){if(!_0x32d81d){_0x3d2abf[_0x1147('0x29')](0x194);}return _0x32d81d;};}function handleError(_0x34937c,_0x39822b){_0x39822b=_0x39822b||0x1f4;return function(_0xe0de59){logger[_0x1147('0x23')](_0xe0de59[_0x1147('0x39')]);if(_0xe0de59[_0x1147('0x3a')]){delete _0xe0de59[_0x1147('0x3a')];}_0x34937c['status'](_0x39822b)[_0x1147('0x3b')](_0xe0de59);};}exports[_0x1147('0x3c')]=function(_0x38824c,_0x22b709){var _0x45a1bd=[_0x1147('0x3d'),'chat',_0x1147('0x3e'),_0x1147('0x3f'),'fax',_0x1147('0x40'),_0x1147('0x41')];var _0x2bdaa1={'count':0x0,'rows':[]},_0x4211a3={},_0x4c0e3e;Promise[_0x1147('0x42')]()[_0x1147('0x36')](function(){if(_0x38824c[_0x1147('0x43')][_0x1147('0x44')]){if(!_[_0x1147('0x45')](_0x45a1bd,_0x38824c[_0x1147('0x43')][_0x1147('0x44')][_0x1147('0x46')]()))throw new Error(_0x1147('0x47'));_0x4c0e3e=_0x38824c['query']['channel']['toLowerCase']();}var _0x2d7691=_['startCase'](_0x4c0e3e)+_0x1147('0x48');var _0x2aa40a=_[_0x1147('0x49')](db[_0x2d7691][_0x1147('0x4a')],function(_0x42a587){return{'name':_0x42a587[_0x1147('0x4b')],'type':_0x42a587['type'][_0x1147('0x4c')]};});_0x4211a3=qs['getOptions'](_0x2aa40a,_0x38824c);if(_0x38824c[_0x1147('0x4d')][_0x1147('0x4e')]===_0x1147('0x4d')){var _0x518498={'params':{'id':_0x38824c[_0x1147('0x4d')]['userProfileId']},'query':{'section':_0x4c0e3e==='voice'&&_0x38824c[_0x1147('0x43')][_0x1147('0x4f')]==='outbound'?'QueueCampaigns':_[_0x1147('0x50')](_0x4c0e3e)+_0x1147('0x51'),'type':_0x38824c[_0x1147('0x43')][_0x1147('0x4f')],'nolimit':!![],'sort':'name','filter':_0x38824c[_0x1147('0x43')][_0x1147('0x52')]}};return db[_0x1147('0x53')][_0x1147('0x54')](_0x518498);}return db[_0x2d7691][_0x1147('0x55')](_0x4211a3);})[_0x1147('0x36')](function(_0x1e8595){_0x2bdaa1[_0x1147('0x2f')]=_0x1e8595[_0x1147('0x2f')];var _0xae5355=_0x4c0e3e===_0x1147('0x41')?client:routingClient;return _0xae5355[_0x1147('0x1e')](_['startCase'](_0x4c0e3e)+_0x1147('0x51'),_0x38824c)[_0x1147('0x36')](function(_0x4008b6){if(_0x4008b6[_0x1147('0x23')])throw new Error(util[_0x1147('0x56')](_0x1147('0x57'),_0x4c0e3e));var _0x5d15a6=_0x4008b6[_0x1147('0x27')];var _0x17a020=['loggedIn',_0x1147('0x58'),_0x1147('0x59'),_0x1147('0x5a'),'paused'];if(_0x4c0e3e===_0x1147('0x41')&&_0x38824c[_0x1147('0x43')][_0x1147('0x4f')]===_0x1147('0x5b')){_0x17a020[_0x1147('0x5c')](_0x1147('0x5d'),_0x1147('0x5e'),_0x1147('0x26'),'dialActive',_0x1147('0x5f'),'Trunk','startPredictive',_0x1147('0x60'),_0x1147('0x61'),'erlangCallToSecond',_0x1147('0x62'),_0x1147('0x63'),_0x1147('0x64'),_0x1147('0x65'),_0x1147('0x66'),_0x1147('0x67'),'predictiveIntervalTotalCalls',_0x1147('0x68'),_0x1147('0x69'),'predictiveIntervalDroppedCallsCallersExit',_0x1147('0x6a'),_0x1147('0x6b'));}var _0x5361dd=_0x1e8595['rows'][_0x1147('0x49')](function(_0x2548a5){var _0x20211c=_0x2548a5[_0x1147('0x6c')]({'plain':!![]});_0x20211c['paused']=0x0;_0x20211c[_0x1147('0x6d')]=0x0;_0x20211c[_0x1147('0x6e')]=0x0;_0x20211c[_0x1147('0x58')]=0x0;_0x20211c['paused']=0x0;_0x20211c[_0x1147('0x59')]=0x0;if(_0x4c0e3e===_0x1147('0x41')){_0x20211c[_0x1147('0x5a')]=0x0;if(_0x38824c[_0x1147('0x43')][_0x1147('0x4f')]==='outbound'){_0x20211c[_0x1147('0x5d')]=0x0;_0x20211c[_0x1147('0x5e')]=0x0;}}_0x20211c['agents']=[];var _0x3ddb5c=_[_0x1147('0x6f')](_0x5d15a6[_0x1147('0x70')],['id',_0x20211c['id']]);if(_0x3ddb5c)_[_0x1147('0x71')](_0x20211c,_[_0x1147('0x72')](_0x3ddb5c,_0x17a020));if(_0x4c0e3e==='voice'){return _0x2548a5['getAgents']({'attributes':['id',_0x1147('0x3a'),'online'],'joinTableAttributes':[],'raw':!![]})['then'](function(_0x14958f){return _0x2548a5[_0x1147('0x73')]({'raw':!![]})['then'](function(_0x5bb9fd){for(var _0x5926ec=0x0;_0x5926ec<_0x14958f[_0x1147('0x74')];_0x5926ec++){var _0x3d5e31=_[_0x1147('0x6f')](_0x5bb9fd,[_0x1147('0x75'),_0x14958f[_0x5926ec]['id']]);var _0x3cde26={'id':_0x14958f[_0x5926ec]['id'],'name':_0x14958f[_0x5926ec][_0x1147('0x3a')],'online':Boolean(_0x14958f[_0x5926ec][_0x1147('0x76')]),'paused':_0x3d5e31?Boolean(_0x3d5e31[_0x1147('0x77')]):![]};if(_0x3cde26['online'])_0x20211c['loggedInDb']++;if(_0x3cde26[_0x1147('0x77')])_0x20211c[_0x1147('0x77')]++;_0x20211c[_0x1147('0x78')][_0x1147('0x5c')](_0x3cde26);}return _0x20211c;});});}else{var _0x1bf950=_0x1147('0x79')+_[_0x1147('0x50')](_0x4c0e3e)+_0x1147('0x48');var _0x53989c=_[_0x1147('0x50')](_0x4c0e3e)+_0x1147('0x7a');var _0x3a9556=_0x4c0e3e+_0x1147('0x7b');return db[_0x1bf950]['findAll']({'where':{['userQueueKey']:_0x2548a5['id']},'raw':!![]})[_0x1147('0x36')](function(_0x630106){return db[_0x1147('0x79')][_0x1147('0x7c')]({'attributes':['id','name',_0x1147('0x76'),_0x3a9556],'where':{'id':_[_0x1147('0x49')](_0x630106,_0x1147('0x75')),'role':'agent'},'raw':!![]});})[_0x1147('0x36')](function(_0x4dfc47){for(var _0x234899=0x0;_0x234899<_0x4dfc47['length'];_0x234899++){var _0x2db121={'id':_0x4dfc47[_0x234899]['id'],'name':_0x4dfc47[_0x234899][_0x1147('0x3a')],'online':Boolean(_0x4dfc47[_0x234899][_0x1147('0x76')]),'paused':Boolean(_0x4dfc47[_0x234899][_0x3a9556])};if(_0x2db121['online'])_0x20211c[_0x1147('0x6d')]++;if(_0x2db121[_0x1147('0x77')])_0x20211c[_0x1147('0x77')]++;_0x20211c['agents'][_0x1147('0x5c')](_0x2db121);}return _0x20211c;});}});return Promise['all'](_0x5361dd);});})[_0x1147('0x36')](function(_0x2d9564){_0x2bdaa1[_0x1147('0x70')]=_0x2d9564;return _0x2bdaa1;})['then'](respondWithFilteredResult(_0x22b709,_0x4211a3))[_0x1147('0x28')](handleError(_0x22b709,null));}; \ No newline at end of file +var _0xedb1=['fast-json-patch','request-promise','moment','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','http','request','info','Realtime,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','json','offset','limit','undefined','set','Content-Range','reject','save','update','then','destroy','end','stack','send','getQueues','mail','chat','openchannel','fax','whatsapp','voice','resolve','channel','includes','toLowerCase','Invalid\x20channel','query','startCase','Queue','map','rawAttributes','fieldName','type','key','getOptions','user','role','userProfileId','outbound','QueueCampaigns','Queues','name','filter','UserProfile','getResources','findAndCountAll','count','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','loggedIn','available','waiting','talking','push','pTalking','originated','dialActive','dialMethod','Trunk','startProgressive','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','rows','paused','loggedInDb','agents','find','merge','pick','getAgents','online','getMembers','length','User','Pause','findAll','agent','all','eml-format','rimraf'];(function(_0x2c18a8,_0x24eaa5){var _0x1e009a=function(_0x5dea3a){while(--_0x5dea3a){_0x2c18a8['push'](_0x2c18a8['shift']());}};_0x1e009a(++_0x24eaa5);}(_0xedb1,0xf6));var _0x1edb=function(_0x5dbdca,_0x1941b3){_0x5dbdca=_0x5dbdca-0x0;var _0x2119c9=_0xedb1[_0x5dbdca];return _0x2119c9;};'use strict';var emlformat=require(_0x1edb('0x0'));var rimraf=require(_0x1edb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1edb('0x2'));var rp=require(_0x1edb('0x3'));var moment=require(_0x1edb('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x1edb('0x5'));var sox=require(_0x1edb('0x6'));var csv=require(_0x1edb('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1edb('0x8'));var _=require(_0x1edb('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1edb('0xa'));var deskjs=require(_0x1edb('0xb'));var toCsv=require(_0x1edb('0x7'));var querystring=require(_0x1edb('0xc'));var Papa=require(_0x1edb('0xd'));var Redis=require('ioredis');var authService=require(_0x1edb('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x1edb('0xf'));var hardwareService=require(_0x1edb('0x10'));var logger=require(_0x1edb('0x11'))(_0x1edb('0x12'));var utils=require(_0x1edb('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x1edb('0x14'));var db=require(_0x1edb('0x15'))['db'];var jayson=require(_0x1edb('0x16'));var client=jayson['client'][_0x1edb('0x17')]({'port':0x232a});var routingClient=jayson['client'][_0x1edb('0x17')]({'port':0x232c});function respondWithRpcPromise(_0x3e27e8,_0x5ab4ab,_0x52e0f8,_0x931e7c){return new BPromise(function(_0x2708ea,_0x5b3dc2){var _0x55fb62=_0x931e7c||client;return _0x55fb62[_0x1edb('0x18')](_0x3e27e8,_0x52e0f8)['then'](function(_0x8e514e){logger[_0x1edb('0x19')](_0x1edb('0x1a'),_0x5ab4ab,_0x1edb('0x1b'));logger['debug']('Realtime,\x20%s,\x20%s,\x20%s',_0x5ab4ab,_0x1edb('0x1b'),JSON[_0x1edb('0x1c')](_0x8e514e));if(_0x8e514e[_0x1edb('0x1d')]){if(_0x8e514e[_0x1edb('0x1d')][_0x1edb('0x1e')]===0x1f4){logger[_0x1edb('0x1d')]('Realtime,\x20%s,\x20%s',_0x5ab4ab,_0x8e514e[_0x1edb('0x1d')][_0x1edb('0x1f')]);return _0x5b3dc2(_0x8e514e[_0x1edb('0x1d')][_0x1edb('0x1f')]);}logger[_0x1edb('0x1d')](_0x1edb('0x1a'),_0x5ab4ab,_0x8e514e[_0x1edb('0x1d')][_0x1edb('0x1f')]);return _0x2708ea(_0x8e514e[_0x1edb('0x1d')][_0x1edb('0x1f')]);}else{logger[_0x1edb('0x19')](_0x1edb('0x1a'),_0x5ab4ab,_0x1edb('0x1b'));_0x2708ea(_0x8e514e[_0x1edb('0x20')][_0x1edb('0x1f')]);}})[_0x1edb('0x21')](function(_0x4e6a1f){logger[_0x1edb('0x1d')]('Realtime,\x20%s,\x20%s',_0x5ab4ab,_0x4e6a1f);_0x5b3dc2(_0x4e6a1f);});});}function respondWithStatusCode(_0x212eb0,_0x13f2c5){_0x13f2c5=_0x13f2c5||0xcc;return function(_0x4984cf){if(_0x4984cf){return _0x212eb0[_0x1edb('0x22')](_0x13f2c5);}return _0x212eb0[_0x1edb('0x23')](_0x13f2c5)['end']();};}function respondWithResult(_0x175c2f,_0x5567ad){_0x5567ad=_0x5567ad||0xc8;return function(_0x32085d){if(_0x32085d){return _0x175c2f[_0x1edb('0x23')](_0x5567ad)[_0x1edb('0x24')](_0x32085d);}};}function respondWithFilteredResult(_0xf0610a,_0x5b453e){return function(_0xb30cd){if(_0xb30cd){var _0x249701=typeof _0x5b453e[_0x1edb('0x25')]==='undefined'&&typeof _0x5b453e[_0x1edb('0x26')]===_0x1edb('0x27');var _0x298c2a=_0xb30cd['count'];var _0x19049e=_0x249701?0x0:_0x5b453e[_0x1edb('0x25')];var _0x56429e=_0x249701?_0xb30cd['count']:_0x5b453e['offset']+_0x5b453e[_0x1edb('0x26')];var _0x1f2452;if(_0x56429e>=_0x298c2a){_0x56429e=_0x298c2a;_0x1f2452=0xc8;}else{_0x1f2452=0xce;}_0xf0610a['status'](_0x1f2452);return _0xf0610a[_0x1edb('0x28')](_0x1edb('0x29'),_0x19049e+'-'+_0x56429e+'/'+_0x298c2a)[_0x1edb('0x24')](_0xb30cd);}return null;};}function patchUpdates(_0x1df603){return function(_0x451d69){try{jsonpatch['apply'](_0x451d69,_0x1df603,!![]);}catch(_0x369f30){return BPromise[_0x1edb('0x2a')](_0x369f30);}return _0x451d69[_0x1edb('0x2b')]();};}function saveUpdates(_0x32fb8e,_0x38a104){return function(_0x1f1073){if(_0x1f1073){return _0x1f1073[_0x1edb('0x2c')](_0x32fb8e)[_0x1edb('0x2d')](function(_0x27326b){return _0x27326b;});}return null;};}function removeEntity(_0x490020,_0x41e5b8){return function(_0x4a6087){if(_0x4a6087){return _0x4a6087[_0x1edb('0x2e')]()[_0x1edb('0x2d')](function(){_0x490020[_0x1edb('0x23')](0xcc)[_0x1edb('0x2f')]();});}};}function handleEntityNotFound(_0xef295,_0x414452){return function(_0x7b0de0){if(!_0x7b0de0){_0xef295[_0x1edb('0x22')](0x194);}return _0x7b0de0;};}function handleError(_0x12971a,_0x4b8b8a){_0x4b8b8a=_0x4b8b8a||0x1f4;return function(_0x16801e){logger[_0x1edb('0x1d')](_0x16801e[_0x1edb('0x30')]);if(_0x16801e['name']){delete _0x16801e['name'];}_0x12971a['status'](_0x4b8b8a)[_0x1edb('0x31')](_0x16801e);};}exports[_0x1edb('0x32')]=function(_0x1c7092,_0x574279){var _0x58a7f7=[_0x1edb('0x33'),_0x1edb('0x34'),'sms',_0x1edb('0x35'),_0x1edb('0x36'),_0x1edb('0x37'),_0x1edb('0x38')];var _0x7d0ddf={'count':0x0,'rows':[]},_0xef6b8={},_0x20e396;Promise[_0x1edb('0x39')]()['then'](function(){if(_0x1c7092['query'][_0x1edb('0x3a')]){if(!_[_0x1edb('0x3b')](_0x58a7f7,_0x1c7092['query']['channel'][_0x1edb('0x3c')]()))throw new Error(_0x1edb('0x3d'));_0x20e396=_0x1c7092[_0x1edb('0x3e')][_0x1edb('0x3a')][_0x1edb('0x3c')]();}var _0x12a17f=_[_0x1edb('0x3f')](_0x20e396)+_0x1edb('0x40');var _0x9d2b6d=_[_0x1edb('0x41')](db[_0x12a17f][_0x1edb('0x42')],function(_0xcd96b0){return{'name':_0xcd96b0[_0x1edb('0x43')],'type':_0xcd96b0[_0x1edb('0x44')][_0x1edb('0x45')]};});_0xef6b8=qs[_0x1edb('0x46')](_0x9d2b6d,_0x1c7092);if(_0x1c7092[_0x1edb('0x47')][_0x1edb('0x48')]===_0x1edb('0x47')){var _0x12e920={'params':{'id':_0x1c7092[_0x1edb('0x47')][_0x1edb('0x49')]},'query':{'section':_0x20e396===_0x1edb('0x38')&&_0x1c7092[_0x1edb('0x3e')]['type']===_0x1edb('0x4a')?_0x1edb('0x4b'):_[_0x1edb('0x3f')](_0x20e396)+_0x1edb('0x4c'),'type':_0x1c7092[_0x1edb('0x3e')][_0x1edb('0x44')],'nolimit':!![],'sort':_0x1edb('0x4d'),'filter':_0x1c7092[_0x1edb('0x3e')][_0x1edb('0x4e')]}};return db[_0x1edb('0x4f')][_0x1edb('0x50')](_0x12e920);}return db[_0x12a17f][_0x1edb('0x51')](_0xef6b8);})['then'](function(_0x34d24e){_0x7d0ddf[_0x1edb('0x52')]=_0x34d24e[_0x1edb('0x52')];var _0x42b066=_0x20e396===_0x1edb('0x38')?client:routingClient;return _0x42b066['request'](_[_0x1edb('0x3f')](_0x20e396)+'Queues',_0x1c7092)['then'](function(_0x3b1f69){if(_0x3b1f69[_0x1edb('0x1d')])throw new Error(util[_0x1edb('0x53')](_0x1edb('0x54'),_0x20e396));var _0xaacc22=_0x3b1f69[_0x1edb('0x20')];var _0x5da317=[_0x1edb('0x55'),_0x1edb('0x56'),_0x1edb('0x57'),_0x1edb('0x58'),'paused'];if(_0x20e396===_0x1edb('0x38')&&_0x1c7092[_0x1edb('0x3e')][_0x1edb('0x44')]===_0x1edb('0x4a')){_0x5da317[_0x1edb('0x59')](_0x1edb('0x5a'),_0x1edb('0x5b'),_0x1edb('0x1f'),_0x1edb('0x5c'),_0x1edb('0x5d'),_0x1edb('0x5e'),'startPredictive',_0x1edb('0x5f'),_0x1edb('0x60'),_0x1edb('0x61'),'erlangAbandonmentRate',_0x1edb('0x62'),_0x1edb('0x63'),_0x1edb('0x64'),_0x1edb('0x65'),_0x1edb('0x66'),_0x1edb('0x67'),_0x1edb('0x68'),_0x1edb('0x69'),'predictiveIntervalDroppedCallsCallersExit',_0x1edb('0x6a'),_0x1edb('0x6b'));}var _0x2462a2=_0x34d24e[_0x1edb('0x6c')][_0x1edb('0x41')](function(_0x47ff86){var _0x482fea=_0x47ff86['get']({'plain':!![]});_0x482fea[_0x1edb('0x6d')]=0x0;_0x482fea[_0x1edb('0x6e')]=0x0;_0x482fea[_0x1edb('0x55')]=0x0;_0x482fea[_0x1edb('0x56')]=0x0;_0x482fea[_0x1edb('0x6d')]=0x0;_0x482fea[_0x1edb('0x57')]=0x0;if(_0x20e396===_0x1edb('0x38')){_0x482fea[_0x1edb('0x58')]=0x0;if(_0x1c7092['query'][_0x1edb('0x44')]===_0x1edb('0x4a')){_0x482fea[_0x1edb('0x5a')]=0x0;_0x482fea[_0x1edb('0x5b')]=0x0;}}_0x482fea[_0x1edb('0x6f')]=[];var _0x5486a6=_[_0x1edb('0x70')](_0xaacc22[_0x1edb('0x6c')],['id',_0x482fea['id']]);if(_0x5486a6)_[_0x1edb('0x71')](_0x482fea,_[_0x1edb('0x72')](_0x5486a6,_0x5da317));if(_0x20e396===_0x1edb('0x38')){return _0x47ff86[_0x1edb('0x73')]({'attributes':['id',_0x1edb('0x4d'),_0x1edb('0x74')],'joinTableAttributes':[],'raw':!![]})[_0x1edb('0x2d')](function(_0x35e39f){return _0x47ff86[_0x1edb('0x75')]({'raw':!![]})[_0x1edb('0x2d')](function(_0x57c7fd){for(var _0x8403bd=0x0;_0x8403bd<_0x35e39f[_0x1edb('0x76')];_0x8403bd++){var _0x4e9b20=_[_0x1edb('0x70')](_0x57c7fd,['UserId',_0x35e39f[_0x8403bd]['id']]);var _0x4893c4={'id':_0x35e39f[_0x8403bd]['id'],'name':_0x35e39f[_0x8403bd][_0x1edb('0x4d')],'online':Boolean(_0x35e39f[_0x8403bd][_0x1edb('0x74')]),'paused':_0x4e9b20?Boolean(_0x4e9b20[_0x1edb('0x6d')]):![]};if(_0x4893c4[_0x1edb('0x74')])_0x482fea[_0x1edb('0x6e')]++;if(_0x4893c4['paused'])_0x482fea[_0x1edb('0x6d')]++;_0x482fea['agents']['push'](_0x4893c4);}return _0x482fea;});});}else{var _0x5903b6=_0x1edb('0x77')+_['startCase'](_0x20e396)+_0x1edb('0x40');var _0x27a3ee=_['startCase'](_0x20e396)+'QueueId';var _0x4f75d2=_0x20e396+_0x1edb('0x78');return db[_0x5903b6][_0x1edb('0x79')]({'where':{['userQueueKey']:_0x47ff86['id']},'raw':!![]})[_0x1edb('0x2d')](function(_0x4ffb28){return db['User'][_0x1edb('0x79')]({'attributes':['id','name','online',_0x4f75d2],'where':{'id':_['map'](_0x4ffb28,'UserId'),'role':_0x1edb('0x7a')},'raw':!![]});})[_0x1edb('0x2d')](function(_0x186c78){for(var _0x399a12=0x0;_0x399a12<_0x186c78[_0x1edb('0x76')];_0x399a12++){var _0x181e10={'id':_0x186c78[_0x399a12]['id'],'name':_0x186c78[_0x399a12][_0x1edb('0x4d')],'online':Boolean(_0x186c78[_0x399a12][_0x1edb('0x74')]),'paused':Boolean(_0x186c78[_0x399a12][_0x4f75d2])};if(_0x181e10[_0x1edb('0x74')])_0x482fea['loggedInDb']++;if(_0x181e10['paused'])_0x482fea[_0x1edb('0x6d')]++;_0x482fea[_0x1edb('0x6f')]['push'](_0x181e10);}return _0x482fea;});}});return Promise[_0x1edb('0x7b')](_0x2462a2);});})[_0x1edb('0x2d')](function(_0x1bf9c6){_0x7d0ddf['rows']=_0x1bf9c6;return _0x7d0ddf;})['then'](respondWithFilteredResult(_0x574279,_0xef6b8))['catch'](handleError(_0x574279,null));}; \ No newline at end of file diff --git a/server/api/realtime/realtime.model.js b/server/api/realtime/realtime.model.js index ccc66b9..769f592 100644 --- a/server/api/realtime/realtime.model.js +++ b/server/api/realtime/realtime.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x224d=['request-promise','define','Realtime','util','../../config/logger','api','moment','bluebird'];(function(_0x2b108d,_0x222668){var _0x41b55b=function(_0x9fa712){while(--_0x9fa712){_0x2b108d['push'](_0x2b108d['shift']());}};_0x41b55b(++_0x222668);}(_0x224d,0x17b));var _0xd224=function(_0x13f5fe,_0x460a12){_0x13f5fe=_0x13f5fe-0x0;var _0x481c05=_0x224d[_0x13f5fe];return _0x481c05;};'use strict';var _=require('lodash');var util=require(_0xd224('0x0'));var logger=require(_0xd224('0x1'))(_0xd224('0x2'));var moment=require(_0xd224('0x3'));var BPromise=require(_0xd224('0x4'));var rp=require(_0xd224('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');;module['exports']=function(_0x194247,_0x3ef1e5){return _0x194247[_0xd224('0x6')](_0xd224('0x7'),[],{});}; \ No newline at end of file +var _0xc62c=['util','../../config/logger','api','bluebird','rimraf','exports','Realtime'];(function(_0x46361e,_0x243aaf){var _0x14e302=function(_0x9ebecf){while(--_0x9ebecf){_0x46361e['push'](_0x46361e['shift']());}};_0x14e302(++_0x243aaf);}(_0xc62c,0x1dc));var _0xcc62=function(_0x4e334c,_0xeb289a){_0x4e334c=_0x4e334c-0x0;var _0x2a44dd=_0xc62c[_0x4e334c];return _0x2a44dd;};'use strict';var _=require('lodash');var util=require(_0xcc62('0x0'));var logger=require(_0xcc62('0x1'))(_0xcc62('0x2'));var moment=require('moment');var BPromise=require(_0xcc62('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xcc62('0x4'));var config=require('../../config/environment');;module[_0xcc62('0x5')]=function(_0x2e0478,_0x1015d6){return _0x2e0478['define'](_0xcc62('0x6'),[],{});}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 5e89afd..7316353 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x38c861,_0x37c537){var _0x147e86=function(_0x52c5c4){while(--_0x52c5c4){_0x38c861['push'](_0x38c861['shift']());}};_0x147e86(++_0x37c537);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x3c8d7e,_0x448887){var _0x10a45a=function(_0x10277b){while(--_0x10277b){_0x3c8d7e['push'](_0x3c8d7e['shift']());}};_0x10a45a(++_0x448887);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x43a1b8,_0x1c90c8){_0x43a1b8=_0x43a1b8-0x0;var _0x324ecc=_0xcb91[_0x43a1b8];return _0x324ecc;};'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');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 5f5eaee..bafae07 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 _0xb931=['STRING','DATE','INTEGER'];(function(_0x17b39c,_0x4d030b){var _0x171c0e=function(_0x599145){while(--_0x599145){_0x17b39c['push'](_0x17b39c['shift']());}};_0x171c0e(++_0x4d030b);}(_0xb931,0x155));var _0x1b93=function(_0x2911d4,_0x573340){_0x2911d4=_0x2911d4-0x0;var _0x5daf83=_0xb931[_0x2911d4];return _0x5daf83;};'use strict';var Sequelize=require('sequelize');module['exports']={'state':{'type':Sequelize[_0x1b93('0x0')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize[_0x1b93('0x1')]},'starttime':{'type':Sequelize[_0x1b93('0x2')]},'responsetime':{'type':Sequelize[_0x1b93('0x2')]},'ringtime':{'type':Sequelize[_0x1b93('0x0')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x1b93('0x1')]},'campaigntype':{'type':Sequelize[_0x1b93('0x1')]},'membername':{'type':Sequelize[_0x1b93('0x1')]}}; \ No newline at end of file +var _0xc43c=['DATE','STRING','sequelize','exports','INTEGER'];(function(_0x25ccbe,_0xc935c0){var _0x289529=function(_0x478776){while(--_0x478776){_0x25ccbe['push'](_0x25ccbe['shift']());}};_0x289529(++_0xc935c0);}(_0xc43c,0xd4));var _0xcc43=function(_0xb9f555,_0x229211){_0xb9f555=_0xb9f555-0x0;var _0x486cea=_0xc43c[_0xb9f555];return _0x486cea;};'use strict';var Sequelize=require(_0xcc43('0x0'));module[_0xcc43('0x1')]={'state':{'type':Sequelize[_0xcc43('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xcc43('0x3')]},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xcc43('0x4')]},'membername':{'type':Sequelize[_0xcc43('0x4')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 04f0baa..d91977a 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 _0x982f=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','ReportAgentPreview','report_agent_preview'];(function(_0xbdcd6,_0x44a2fd){var _0x3a70b7=function(_0x18b480){while(--_0x18b480){_0xbdcd6['push'](_0xbdcd6['shift']());}};_0x3a70b7(++_0x44a2fd);}(_0x982f,0x193));var _0xf982=function(_0x51f020,_0x2a832a){_0x51f020=_0x51f020-0x0;var _0xcc4868=_0x982f[_0x51f020];return _0xcc4868;};'use strict';var _=require(_0xf982('0x0'));var util=require(_0xf982('0x1'));var logger=require(_0xf982('0x2'))(_0xf982('0x3'));var moment=require(_0xf982('0x4'));var BPromise=require(_0xf982('0x5'));var rp=require(_0xf982('0x6'));var fs=require('fs');var path=require(_0xf982('0x7'));var rimraf=require(_0xf982('0x8'));var config=require(_0xf982('0x9'));var attributes=require(_0xf982('0xa'));module['exports']=function(_0x32e4dc,_0x5d32fd){return _0x32e4dc['define'](_0xf982('0xb'),attributes,{'tableName':_0xf982('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xddd1=['bluebird','request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview','lodash','../../config/logger','api'];(function(_0x489106,_0x4323ce){var _0x117590=function(_0x44465c){while(--_0x44465c){_0x489106['push'](_0x489106['shift']());}};_0x117590(++_0x4323ce);}(_0xddd1,0x1c4));var _0x1ddd=function(_0x4a8012,_0x5799ff){_0x4a8012=_0x4a8012-0x0;var _0x43a3cc=_0xddd1[_0x4a8012];return _0x43a3cc;};'use strict';var _=require(_0x1ddd('0x0'));var util=require('util');var logger=require(_0x1ddd('0x1'))(_0x1ddd('0x2'));var moment=require('moment');var BPromise=require(_0x1ddd('0x3'));var rp=require(_0x1ddd('0x4'));var fs=require('fs');var path=require(_0x1ddd('0x5'));var rimraf=require(_0x1ddd('0x6'));var config=require(_0x1ddd('0x7'));var attributes=require(_0x1ddd('0x8'));module[_0x1ddd('0x9')]=function(_0x259f4e,_0x25bf24){return _0x259f4e[_0x1ddd('0xa')](_0x1ddd('0xb'),attributes,{'tableName':_0x1ddd('0xc'),'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 c470f0e..7e6172a 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 _0xdd54=['debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','info','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','ReportAgentPreview,\x20%s,\x20%s','request\x20sent'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0xdd54,0x159));var _0x4dd5=function(_0xe261ee,_0x2a2183){_0xe261ee=_0xe261ee-0x0;var _0x1e06b3=_0xdd54[_0xe261ee];return _0x1e06b3;};'use strict';var _=require(_0x4dd5('0x0'));var util=require(_0x4dd5('0x1'));var moment=require(_0x4dd5('0x2'));var BPromise=require(_0x4dd5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4dd5('0x4'));var db=require(_0x4dd5('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4dd5('0x6'));var config=require(_0x4dd5('0x7'));var jayson=require(_0x4dd5('0x8'));var client=jayson[_0x4dd5('0x9')][_0x4dd5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x447b6c,_0x3df13a,_0x51f586){return new BPromise(function(_0x146965,_0x1e3094){return client[_0x4dd5('0xb')](_0x447b6c,_0x51f586)[_0x4dd5('0xc')](function(_0x2122da){logger['info'](_0x4dd5('0xd'),_0x3df13a,_0x4dd5('0xe'));logger[_0x4dd5('0xf')](_0x4dd5('0x10'),_0x3df13a,_0x4dd5('0xe'),JSON['stringify'](_0x2122da));if(_0x2122da[_0x4dd5('0x11')]){if(_0x2122da['error'][_0x4dd5('0x12')]===0x1f4){logger['error']('ReportAgentPreview,\x20%s,\x20%s',_0x3df13a,_0x2122da['error']['message']);return _0x1e3094(_0x2122da[_0x4dd5('0x11')]['message']);}logger[_0x4dd5('0x11')](_0x4dd5('0xd'),_0x3df13a,_0x2122da['error'][_0x4dd5('0x13')]);return _0x146965(_0x2122da[_0x4dd5('0x11')]['message']);}else{logger['info']('ReportAgentPreview,\x20%s,\x20%s',_0x3df13a,_0x4dd5('0xe'));_0x146965(_0x2122da[_0x4dd5('0x14')][_0x4dd5('0x13')]);}})[_0x4dd5('0x15')](function(_0x5d41a4){logger[_0x4dd5('0x11')](_0x4dd5('0xd'),_0x3df13a,_0x5d41a4);_0x1e3094(_0x5d41a4);});});}exports[_0x4dd5('0x16')]=function(_0x1dc77b){var _0x38840b=this;return new Promise(function(_0x4125cb,_0x310641){return db[_0x4dd5('0x17')][_0x4dd5('0x18')](_0x1dc77b[_0x4dd5('0x19')],{'raw':_0x1dc77b[_0x4dd5('0x1a')]?_0x1dc77b['options'][_0x4dd5('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x532092){logger[_0x4dd5('0x1c')]('CreateReportAgentPreview',_0x1dc77b);logger['debug']('CreateReportAgentPreview',_0x1dc77b,JSON[_0x4dd5('0x1d')](_0x532092));_0x4125cb(_0x532092);})[_0x4dd5('0x15')](function(_0x47d3fa){logger[_0x4dd5('0x11')](_0x4dd5('0x16'),_0x47d3fa[_0x4dd5('0x13')],_0x1dc77b);_0x310641(_0x38840b[_0x4dd5('0x11')](0x1f4,_0x47d3fa[_0x4dd5('0x13')]));});});}; \ No newline at end of file +var _0x3383=['then','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x336bdc,_0x54a3ca){var _0x1374aa=function(_0x26044b){while(--_0x26044b){_0x336bdc['push'](_0x336bdc['shift']());}};_0x1374aa(++_0x54a3ca);}(_0x3383,0x1b5));var _0x3338=function(_0x4b49a3,_0x2bb419){_0x4b49a3=_0x4b49a3-0x0;var _0x40aff0=_0x3383[_0x4b49a3];return _0x40aff0;};'use strict';var _=require(_0x3338('0x0'));var util=require('util');var moment=require(_0x3338('0x1'));var BPromise=require(_0x3338('0x2'));var rs=require(_0x3338('0x3'));var fs=require('fs');var Redis=require(_0x3338('0x4'));var db=require(_0x3338('0x5'))['db'];var utils=require(_0x3338('0x6'));var logger=require(_0x3338('0x7'))(_0x3338('0x8'));var config=require(_0x3338('0x9'));var jayson=require(_0x3338('0xa'));var client=jayson['client'][_0x3338('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x238700,_0x8961c7,_0x34c0ef){return new BPromise(function(_0x1c6ead,_0x5b3b2b){return client[_0x3338('0xc')](_0x238700,_0x34c0ef)[_0x3338('0xd')](function(_0x577048){logger['info'](_0x3338('0xe'),_0x8961c7,_0x3338('0xf'));logger[_0x3338('0x10')](_0x3338('0x11'),_0x8961c7,_0x3338('0xf'),JSON[_0x3338('0x12')](_0x577048));if(_0x577048[_0x3338('0x13')]){if(_0x577048[_0x3338('0x13')][_0x3338('0x14')]===0x1f4){logger['error']('ReportAgentPreview,\x20%s,\x20%s',_0x8961c7,_0x577048[_0x3338('0x13')]['message']);return _0x5b3b2b(_0x577048[_0x3338('0x13')][_0x3338('0x15')]);}logger['error'](_0x3338('0xe'),_0x8961c7,_0x577048['error'][_0x3338('0x15')]);return _0x1c6ead(_0x577048['error'][_0x3338('0x15')]);}else{logger[_0x3338('0x16')](_0x3338('0xe'),_0x8961c7,_0x3338('0xf'));_0x1c6ead(_0x577048[_0x3338('0x17')]['message']);}})[_0x3338('0x18')](function(_0xa729eb){logger[_0x3338('0x13')]('ReportAgentPreview,\x20%s,\x20%s',_0x8961c7,_0xa729eb);_0x5b3b2b(_0xa729eb);});});}exports[_0x3338('0x19')]=function(_0xc0b450){var _0xdbf352=this;return new Promise(function(_0x26b2ce,_0x2488a8){return db[_0x3338('0x1a')][_0x3338('0x1b')](_0xc0b450[_0x3338('0x1c')],{'raw':_0xc0b450[_0x3338('0x1d')]?_0xc0b450[_0x3338('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x3338('0xd')](function(_0x1d15bc){logger['info'](_0x3338('0x19'),_0xc0b450);logger['debug']('CreateReportAgentPreview',_0xc0b450,JSON[_0x3338('0x12')](_0x1d15bc));_0x26b2ce(_0x1d15bc);})[_0x3338('0x18')](function(_0x310005){logger[_0x3338('0x13')](_0x3338('0x19'),_0x310005[_0x3338('0x15')],_0xc0b450);_0x2488a8(_0xdbf352[_0x3338('0x13')](0x1f4,_0x310005[_0x3338('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 269537e..0ab0ffa 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 _0x58be=['/voice/queues/channels/:uniqueid/redirect/:exten','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','outbound','outboundChannels','/agents','agents','/agents/:id/capacity','agentCapacity','/telephones','/campaigns','campaigns','faxAccounts','/chat/queues/waitinginteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','/mail/queues/:id/notify','queueNotify','/mail/queues/:id','showMailQueues','post','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','openchannel','/openchannel/queues/:id','showOpenchannelQueues','sms','/whatsapp/queues/:id/notify','/sms/queues/:id','showSmsQueues','showWhatsappQueues','agentNotify','multer','util','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/mail/queues','/mail/accounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup'];(function(_0x1c90a7,_0x115e4d){var _0x408b33=function(_0x4b2b46){while(--_0x4b2b46){_0x1c90a7['push'](_0x1c90a7['shift']());}};_0x408b33(++_0x115e4d);}(_0x58be,0xc4));var _0xe58b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x58be[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0xe58b('0x0'));var util=require(_0xe58b('0x1'));var path=require('path');var express=require(_0xe58b('0x2'));var router=express[_0xe58b('0x3')]();var auth=require(_0xe58b('0x4'));var controller=require(_0xe58b('0x5'));router[_0xe58b('0x6')](_0xe58b('0x7'),auth[_0xe58b('0x8')](),controller['voiceChannels']);router['get']('/voice/channels/:uniqueid/mixmonitor',auth[_0xe58b('0x8')](),controller['voiceChannelMixMonitor']);router['get'](_0xe58b('0x9'),auth['isAuthenticated'](),controller[_0xe58b('0xa')]);router[_0xe58b('0x6')]('/voice/queues',auth[_0xe58b('0x8')](),controller['voiceQueues']);router[_0xe58b('0x6')]('/chat/queues',auth[_0xe58b('0x8')](),controller['chatQueues']);router[_0xe58b('0x6')](_0xe58b('0xb'),auth[_0xe58b('0x8')](),controller['mailQueues']);router['get'](_0xe58b('0xc'),auth[_0xe58b('0x8')](),controller['mailAccounts']);router['get'](_0xe58b('0xd'),auth[_0xe58b('0x8')](),controller[_0xe58b('0xe')]);router[_0xe58b('0x6')](_0xe58b('0xf'),auth[_0xe58b('0x8')](),controller[_0xe58b('0x10')]);router[_0xe58b('0x6')](_0xe58b('0x11'),auth[_0xe58b('0x8')](),controller['whatsappQueues']);router[_0xe58b('0x6')]('/fax/queues',auth[_0xe58b('0x8')](),controller['faxQueues']);router[_0xe58b('0x6')](_0xe58b('0x12'),auth[_0xe58b('0x8')](),controller[_0xe58b('0x13')]);router[_0xe58b('0x6')](_0xe58b('0x14'),auth['isAuthenticated'](),controller[_0xe58b('0x15')]);router['get'](_0xe58b('0x16'),auth[_0xe58b('0x8')](),controller[_0xe58b('0x17')]);router[_0xe58b('0x6')](_0xe58b('0x18'),auth[_0xe58b('0x8')](),controller[_0xe58b('0x19')]);router[_0xe58b('0x6')](_0xe58b('0x1a'),auth['isAuthenticated'](),controller['voiceQueuesChannelRedirect']);router[_0xe58b('0x6')](_0xe58b('0x1b'),auth[_0xe58b('0x8')](),controller[_0xe58b('0x1c')]);router[_0xe58b('0x1d')](_0xe58b('0x1b'),auth['isAuthenticated'](),controller[_0xe58b('0x1e')]);router['get']('/outbound',auth['isAuthenticated'](),controller[_0xe58b('0x1f')]);router[_0xe58b('0x6')]('/outbound/channels',auth['isAuthenticated'](),controller[_0xe58b('0x20')]);router[_0xe58b('0x6')](_0xe58b('0x21'),auth[_0xe58b('0x8')](),controller[_0xe58b('0x22')]);router[_0xe58b('0x1d')](_0xe58b('0x23'),auth[_0xe58b('0x8')](),controller[_0xe58b('0x24')]);router['get'](_0xe58b('0x25'),auth[_0xe58b('0x8')](),controller['telephones']);router['get']('/trunks',auth[_0xe58b('0x8')](),controller['trunks']);router[_0xe58b('0x6')](_0xe58b('0x26'),auth[_0xe58b('0x8')](),controller[_0xe58b('0x27')]);router['get']('/fax/accounts',auth[_0xe58b('0x8')](),controller[_0xe58b('0x28')]);router[_0xe58b('0x6')](_0xe58b('0x29'),auth[_0xe58b('0x8')](),controller['chatQueuesWaitingInteractions']);router[_0xe58b('0x6')](_0xe58b('0x2a'),auth[_0xe58b('0x8')](),controller[_0xe58b('0x2b')]);router['get'](_0xe58b('0x2c'),auth[_0xe58b('0x8')](),controller[_0xe58b('0x2d')]);router[_0xe58b('0x6')]('/openchannel/queues/:id/waitinginteractions',auth[_0xe58b('0x8')](),controller[_0xe58b('0x2e')]);router[_0xe58b('0x6')](_0xe58b('0x2f'),auth[_0xe58b('0x8')](),controller[_0xe58b('0x30')]);router[_0xe58b('0x6')](_0xe58b('0x31'),auth['isAuthenticated'](),controller[_0xe58b('0x32')]);router[_0xe58b('0x6')](_0xe58b('0x33'),auth['isAuthenticated'](),controller[_0xe58b('0x34')]);router['post'](_0xe58b('0x35'),auth[_0xe58b('0x8')](),controller[_0xe58b('0x36')]('mail'));router[_0xe58b('0x6')](_0xe58b('0x37'),auth[_0xe58b('0x8')](),controller[_0xe58b('0x38')]);router[_0xe58b('0x39')](_0xe58b('0x3a'),auth['isAuthenticated'](),controller['queueNotify'](_0xe58b('0x3b')));router[_0xe58b('0x6')](_0xe58b('0x3c'),auth[_0xe58b('0x8')](),controller[_0xe58b('0x3d')]);router[_0xe58b('0x39')](_0xe58b('0x3e'),auth[_0xe58b('0x8')](),controller[_0xe58b('0x36')](_0xe58b('0x3f')));router[_0xe58b('0x6')](_0xe58b('0x40'),auth[_0xe58b('0x8')](),controller['showFaxQueues']);router[_0xe58b('0x39')]('/openchannel/queues/:id/notify',auth[_0xe58b('0x8')](),controller[_0xe58b('0x36')](_0xe58b('0x41')));router[_0xe58b('0x6')](_0xe58b('0x42'),auth[_0xe58b('0x8')](),controller[_0xe58b('0x43')]);router[_0xe58b('0x39')]('/sms/queues/:id/notify',auth[_0xe58b('0x8')](),controller[_0xe58b('0x36')](_0xe58b('0x44')));router['post'](_0xe58b('0x45'),auth[_0xe58b('0x8')](),controller['queueNotify']('whatsapp'));router['get'](_0xe58b('0x46'),auth[_0xe58b('0x8')](),controller[_0xe58b('0x47')]);router[_0xe58b('0x6')]('/whatsapp/queues/:id',auth[_0xe58b('0x8')](),controller[_0xe58b('0x48')]);router['post']('/agents/:id/notify',auth[_0xe58b('0x8')](),controller[_0xe58b('0x49')]);module['exports']=router; \ No newline at end of file +var _0x90d6=['fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','util','path','express','../../components/auth/service','./rpc.controller','isAuthenticated','voiceChannels','get','/voice/channels/:uniqueid/mixmonitor','voiceChannelStopMixMonitor','/voice/queues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','showVoiceQueues','put','updateVoiceQueue','/outbound','outbound','outboundChannels','/agents','agentCapacity','telephones','/trunks','trunks','campaigns','/fax/accounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','queueNotify','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify'];(function(_0x3f024b,_0x4543ae){var _0x5c2d3a=function(_0x25105f){while(--_0x25105f){_0x3f024b['push'](_0x3f024b['shift']());}};_0x5c2d3a(++_0x4543ae);}(_0x90d6,0x1e5));var _0x690d=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0x90d6[_0x54d4a8];return _0x3b321b;};'use strict';var multer=require(_0x690d('0x0'));var util=require(_0x690d('0x1'));var path=require(_0x690d('0x2'));var express=require(_0x690d('0x3'));var router=express['Router']();var auth=require(_0x690d('0x4'));var controller=require(_0x690d('0x5'));router['get']('/voice/channels',auth[_0x690d('0x6')](),controller[_0x690d('0x7')]);router[_0x690d('0x8')](_0x690d('0x9'),auth[_0x690d('0x6')](),controller['voiceChannelMixMonitor']);router[_0x690d('0x8')]('/voice/channels/:uniqueid/stopmixmonitor',auth['isAuthenticated'](),controller[_0x690d('0xa')]);router[_0x690d('0x8')](_0x690d('0xb'),auth['isAuthenticated'](),controller['voiceQueues']);router[_0x690d('0x8')](_0x690d('0xc'),auth[_0x690d('0x6')](),controller[_0x690d('0xd')]);router[_0x690d('0x8')](_0x690d('0xe'),auth[_0x690d('0x6')](),controller[_0x690d('0xf')]);router[_0x690d('0x8')](_0x690d('0x10'),auth[_0x690d('0x6')](),controller[_0x690d('0x11')]);router[_0x690d('0x8')](_0x690d('0x12'),auth[_0x690d('0x6')](),controller[_0x690d('0x13')]);router['get']('/sms/queues',auth[_0x690d('0x6')](),controller['smsQueues']);router[_0x690d('0x8')]('/whatsapp/queues',auth[_0x690d('0x6')](),controller[_0x690d('0x14')]);router[_0x690d('0x8')](_0x690d('0x15'),auth[_0x690d('0x6')](),controller[_0x690d('0x16')]);router['get'](_0x690d('0x17'),auth[_0x690d('0x6')](),controller[_0x690d('0x18')]);router['get'](_0x690d('0x19'),auth[_0x690d('0x6')](),controller[_0x690d('0x1a')]);router[_0x690d('0x8')](_0x690d('0x1b'),auth[_0x690d('0x6')](),controller['voiceQueuesChannel']);router[_0x690d('0x8')]('/voice/queues/channels/:uniqueid/hangup',auth[_0x690d('0x6')](),controller[_0x690d('0x1c')]);router[_0x690d('0x8')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0x690d('0x6')](),controller[_0x690d('0x1d')]);router[_0x690d('0x8')]('/voice/queues/:id',auth[_0x690d('0x6')](),controller[_0x690d('0x1e')]);router[_0x690d('0x1f')]('/voice/queues/:id',auth[_0x690d('0x6')](),controller[_0x690d('0x20')]);router[_0x690d('0x8')](_0x690d('0x21'),auth[_0x690d('0x6')](),controller[_0x690d('0x22')]);router[_0x690d('0x8')]('/outbound/channels',auth['isAuthenticated'](),controller[_0x690d('0x23')]);router[_0x690d('0x8')](_0x690d('0x24'),auth[_0x690d('0x6')](),controller['agents']);router['put']('/agents/:id/capacity',auth['isAuthenticated'](),controller[_0x690d('0x25')]);router[_0x690d('0x8')]('/telephones',auth[_0x690d('0x6')](),controller[_0x690d('0x26')]);router['get'](_0x690d('0x27'),auth['isAuthenticated'](),controller[_0x690d('0x28')]);router[_0x690d('0x8')]('/campaigns',auth[_0x690d('0x6')](),controller[_0x690d('0x29')]);router[_0x690d('0x8')](_0x690d('0x2a'),auth[_0x690d('0x6')](),controller['faxAccounts']);router[_0x690d('0x8')](_0x690d('0x2b'),auth[_0x690d('0x6')](),controller[_0x690d('0x2c')]);router[_0x690d('0x8')]('/mail/queues/waitinginteractions',auth[_0x690d('0x6')](),controller['mailQueuesWaitingInteractions']);router['get'](_0x690d('0x2d'),auth[_0x690d('0x6')](),controller[_0x690d('0x2e')]);router['get']('/openchannel/queues/:id/waitinginteractions',auth['isAuthenticated'](),controller[_0x690d('0x2f')]);router[_0x690d('0x8')]('/sms/queues/waitinginteractions',auth[_0x690d('0x6')](),controller[_0x690d('0x30')]);router[_0x690d('0x8')]('/whatsapp/queues/waitinginteractions',auth[_0x690d('0x6')](),controller[_0x690d('0x31')]);router[_0x690d('0x8')](_0x690d('0x32'),auth['isAuthenticated'](),controller[_0x690d('0x33')]);router[_0x690d('0x34')]('/mail/queues/:id/notify',auth['isAuthenticated'](),controller['queueNotify'](_0x690d('0x35')));router['get'](_0x690d('0x36'),auth[_0x690d('0x6')](),controller[_0x690d('0x37')]);router[_0x690d('0x34')](_0x690d('0x38'),auth[_0x690d('0x6')](),controller[_0x690d('0x39')]('chat'));router['get'](_0x690d('0x3a'),auth['isAuthenticated'](),controller[_0x690d('0x3b')]);router[_0x690d('0x34')](_0x690d('0x3c'),auth['isAuthenticated'](),controller[_0x690d('0x39')](_0x690d('0x3d')));router['get'](_0x690d('0x3e'),auth[_0x690d('0x6')](),controller[_0x690d('0x3f')]);router[_0x690d('0x34')](_0x690d('0x40'),auth[_0x690d('0x6')](),controller[_0x690d('0x39')](_0x690d('0x41')));router[_0x690d('0x8')](_0x690d('0x42'),auth['isAuthenticated'](),controller['showOpenchannelQueues']);router[_0x690d('0x34')](_0x690d('0x43'),auth[_0x690d('0x6')](),controller[_0x690d('0x39')](_0x690d('0x44')));router[_0x690d('0x34')](_0x690d('0x45'),auth[_0x690d('0x6')](),controller[_0x690d('0x39')](_0x690d('0x46')));router['get'](_0x690d('0x47'),auth[_0x690d('0x6')](),controller[_0x690d('0x48')]);router[_0x690d('0x8')](_0x690d('0x49'),auth[_0x690d('0x6')](),controller[_0x690d('0x4a')]);router[_0x690d('0x34')](_0x690d('0x4b'),auth[_0x690d('0x6')](),controller[_0x690d('0x4c')]);module[_0x690d('0x4d')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 95dc4e0..3eef343 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 _0x814b=['whatsappQueues','WhatsappQueues','showWhatsappQueues','FaxQueues','faxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','map','queue_id','uniq','indexOf','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','\x20Message\x20not\x20found','update','MessageId','From','QueueId','create','Start','queue','queueTransferTimeout','Channel\x20field\x20is\x20mandatory','channel','capitalize','chat','User','Agent\x20not\x20found','InteractionId','agentTransferTimeout','bluebird','moment','lodash','util','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','error','code','message','catch','status','json','sendStatus','stack','name','send','isNil','rows','VoiceChannels','voiceChannelMixMonitor','VoiceChannelMixMonitor','query','params','voiceChannelStopMixMonitor','merge','voiceQueues','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','outboundChannels','agents','Agents','agentCapacity','user','interaction','hasOwnProperty','MemberReport','findAll','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','INTERACTION','interface','SIP/%s','agent','internal','AgentCapacity','telephones','Telephones','trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','MailAccounts','openchannelQueues','showOpenchannelQueues','SmsQueues','showSmsQueues'];(function(_0x5dca18,_0x5d480c){var _0x4dc040=function(_0x5f38da){while(--_0x5f38da){_0x5dca18['push'](_0x5dca18['shift']());}};_0x4dc040(++_0x5d480c);}(_0x814b,0x1a2));var _0xb814=function(_0x19d7bf,_0x265436){_0x19d7bf=_0x19d7bf-0x0;var _0x46494c=_0x814b[_0x19d7bf];return _0x46494c;};'use strict';var BPromise=require(_0xb814('0x0'));var moment=require(_0xb814('0x1'));var _=require(_0xb814('0x2'));var util=require(_0xb814('0x3'));var db=require(_0xb814('0x4'))['db'];var logger=require(_0xb814('0x5'))('api');var jayson=require(_0xb814('0x6'));var amiClient=jayson[_0xb814('0x7')][_0xb814('0x8')]({'port':0x232a});var mailClient=jayson[_0xb814('0x7')][_0xb814('0x8')]({'port':0x232b});var routingClient=jayson[_0xb814('0x7')]['http']({'port':0x232c});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){var _0x186d5a=_0x5c8539?_0x5c8539:amiClient;return _0x186d5a[_0xb814('0x9')](_0x3b0829,_0x2e6272)[_0xb814('0xa')](function(_0x21d4a5){if(_0x21d4a5[_0xb814('0xb')]){if(_0x21d4a5[_0xb814('0xb')][_0xb814('0xc')]===0x1f4){return _0x2913a6(_0x21d4a5[_0xb814('0xb')][_0xb814('0xd')]);}return _0x271af9(_0x21d4a5['error'][_0xb814('0xd')]);}else{_0x271af9(_0x21d4a5['result']);}})[_0xb814('0xe')](function(_0x15d6ef){_0x2913a6(_0x15d6ef);});});}function respondWithResult(_0x35b10d,_0x2cc46b){_0x2cc46b=_0x2cc46b||0xc8;return function(_0x2ce718){if(_0x2ce718){return _0x35b10d[_0xb814('0xf')](_0x2cc46b)[_0xb814('0x10')](_0x2ce718);}return _0x35b10d[_0xb814('0x11')](0x194);};}function handleError(_0xa0a2e5,_0x2ab627){_0x2ab627=_0x2ab627||0x1f4;return function(_0x3f4881){logger[_0xb814('0xb')](_0x3f4881[_0xb814('0x12')]);if(_0x3f4881[_0xb814('0x13')]){delete _0x3f4881[_0xb814('0x13')];}_0xa0a2e5[_0xb814('0xf')](_0x2ab627)[_0xb814('0x14')](_0x3f4881);};}function findById(_0x265a83){return function(_0x125ce2){if(!_[_0xb814('0x15')](_0x265a83)&&!_[_0xb814('0x15')](_0x125ce2)&&!_['isNil'](_0x125ce2[_0xb814('0x16')])){return _['find'](_0x125ce2[_0xb814('0x16')],function(_0xfac75b){return _0xfac75b['id']==_0x265a83;});}return null;};}exports['voiceChannels']=function(_0x4b55a7,_0x55d63c){return respondWithRpcPromise(_0xb814('0x17'),_0x4b55a7['query'])['then'](respondWithResult(_0x55d63c,null))[_0xb814('0xe')](handleError(_0x55d63c,null));};exports[_0xb814('0x18')]=function(_0x25b6b6,_0x4e139e){return respondWithRpcPromise(_0xb814('0x19'),_['merge'](_0x25b6b6[_0xb814('0x1a')],_0x25b6b6[_0xb814('0x1b')]))[_0xb814('0xa')](respondWithResult(_0x4e139e,null))[_0xb814('0xe')](handleError(_0x4e139e,null));};exports[_0xb814('0x1c')]=function(_0x2bd039,_0x1f5d40){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_[_0xb814('0x1d')](_0x2bd039['query'],_0x2bd039[_0xb814('0x1b')]))[_0xb814('0xa')](respondWithResult(_0x1f5d40,null))[_0xb814('0xe')](handleError(_0x1f5d40,null));};exports[_0xb814('0x1e')]=function(_0x1c8a2e,_0xb9e57d){return respondWithRpcPromise(_0xb814('0x1f'),_0x1c8a2e['query'])[_0xb814('0xa')](respondWithResult(_0xb9e57d,null))[_0xb814('0xe')](handleError(_0xb9e57d,null));};exports[_0xb814('0x20')]=function(_0x349394,_0x32ed56){return respondWithRpcPromise(_0xb814('0x1f'),_0x349394[_0xb814('0x1a')])[_0xb814('0xa')](findById(_0x349394['params']['id']))[_0xb814('0xa')](respondWithResult(_0x32ed56,null))[_0xb814('0xe')](handleError(_0x32ed56,null));};exports['updateVoiceQueue']=function(_0x9008b2,_0x37d24d){return respondWithRpcPromise(_0xb814('0x21'),_['merge'](_0x9008b2[_0xb814('0x22')],_0x9008b2[_0xb814('0x1b')]))['then'](respondWithResult(_0x37d24d,null))[_0xb814('0xe')](handleError(_0x37d24d,null));};exports['voiceQueuesPreview']=function(_0x6efe9a,_0x5f3e9b){return respondWithRpcPromise('VoiceQueuesPreview',_[_0xb814('0x1d')](_0x6efe9a['query'],_0x6efe9a[_0xb814('0x1b')]))[_0xb814('0xa')](respondWithResult(_0x5f3e9b,null))[_0xb814('0xe')](handleError(_0x5f3e9b,null));};exports['voiceQueuesChannels']=function(_0x51d5ae,_0x26d3a9){return respondWithRpcPromise(_0xb814('0x23'),_0x51d5ae['query'])[_0xb814('0xa')](respondWithResult(_0x26d3a9,null))[_0xb814('0xe')](handleError(_0x26d3a9,null));};exports[_0xb814('0x24')]=function(_0x217b7e,_0x1b78de){return respondWithRpcPromise(_0xb814('0x25'),_[_0xb814('0x1d')](_0x217b7e['query'],_0x217b7e[_0xb814('0x1b')]))[_0xb814('0xa')](respondWithResult(_0x1b78de,null))[_0xb814('0xe')](handleError(_0x1b78de,null));};exports[_0xb814('0x26')]=function(_0x14100d,_0x4ff31a){return respondWithRpcPromise(_0xb814('0x27'),_['merge'](_0x14100d[_0xb814('0x1a')],_0x14100d[_0xb814('0x1b')]))[_0xb814('0xa')](respondWithResult(_0x4ff31a,null))['catch'](handleError(_0x4ff31a,null));};exports[_0xb814('0x28')]=function(_0xbdb3e9,_0x4ea6f8){return respondWithRpcPromise(_0xb814('0x29'),_[_0xb814('0x1d')](_0xbdb3e9[_0xb814('0x1a')],_0xbdb3e9[_0xb814('0x1b')]))[_0xb814('0xa')](respondWithResult(_0x4ea6f8,null))[_0xb814('0xe')](handleError(_0x4ea6f8,null));};exports['outbound']=function(_0xa6ce87,_0x4e4684){return respondWithRpcPromise(_0xb814('0x2a'),_0xa6ce87['query'])[_0xb814('0xa')](respondWithResult(_0x4e4684,null))['catch'](handleError(_0x4e4684,null));};exports[_0xb814('0x2b')]=function(_0x26675a,_0x54a7fb){return respondWithRpcPromise('OutboundChannels',_0x26675a['query'])['then'](respondWithResult(_0x54a7fb,null))[_0xb814('0xe')](handleError(_0x54a7fb,null));};exports[_0xb814('0x2c')]=function(_0x38cdc2,_0x42c2ed){var _0x51cdba;return respondWithRpcPromise('Agents',_0x38cdc2[_0xb814('0x1a')])['then'](function(_0x2a93da){_0x51cdba=_0x2a93da;return respondWithRpcPromise(_0xb814('0x2d'),_0x38cdc2[_0xb814('0x1a')],routingClient);})[_0xb814('0xa')](function(_0x42653f){return _[_0xb814('0x1d')]({},_0x42653f,_0x51cdba);})[_0xb814('0xa')](respondWithResult(_0x42c2ed,null))[_0xb814('0xe')](handleError(_0x42c2ed,null));};exports[_0xb814('0x2e')]=function(_0x4b6ff8,_0x544d36){if(_0x4b6ff8['body']&&_0x4b6ff8[_0xb814('0x22')]['interaction']&&_0x4b6ff8[_0xb814('0x2f')]&&_0x4b6ff8['user'][_0xb814('0x13')]){for(var _0x44ff56 in _0x4b6ff8[_0xb814('0x22')][_0xb814('0x30')]){if(_0x4b6ff8['body'][_0xb814('0x30')][_0xb814('0x31')](_0x44ff56)){db[_0xb814('0x32')][_0xb814('0x33')]({'where':{'channel':_0x44ff56,'membername':_0x4b6ff8[_0xb814('0x2f')][_0xb814('0x13')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x4b6ff8[_0xb814('0x22')][_0xb814('0x30')][_0x44ff56]&&_0x4b6ff8[_0xb814('0x22')][_0xb814('0x30')][_0x44ff56][_0xb814('0x34')]?{'$notIn':_0x4b6ff8[_0xb814('0x22')][_0xb814('0x30')][_0x44ff56]}:{'$ne':null}}})['then'](function(_0x4a5e84){var _0xe751c3=moment()[_0xb814('0x35')](_0xb814('0x36'));for(var _0x2bf906=0x0,_0x43f1b=_0x4a5e84[_0xb814('0x34')];_0x2bf906<_0x43f1b;_0x2bf906+=0x1){_0x4a5e84[_0x2bf906][_0xb814('0x37')]({'exitAt':_0xe751c3});}});for(var _0x40af85=0x0;_0x40af85<_0x4b6ff8[_0xb814('0x22')][_0xb814('0x30')][_0x44ff56][_0xb814('0x34')];_0x40af85+=0x1){db['MemberReport'][_0xb814('0x38')]({'where':{'channel':_0x44ff56,'membername':_0x4b6ff8[_0xb814('0x2f')]['name'],'type':_0xb814('0x39'),'uniqueid':_0x4b6ff8['body'][_0xb814('0x30')][_0x44ff56][_0x40af85],'exitAt':null},'defaults':{'channel':_0x44ff56,'membername':_0x4b6ff8[_0xb814('0x2f')][_0xb814('0x13')],'interface':_[_0xb814('0x15')](_0x4b6ff8[_0xb814('0x2f')][_0xb814('0x3a')])?util[_0xb814('0x35')](_0xb814('0x3b'),_0x4b6ff8[_0xb814('0x2f')][_0xb814('0x13')]):_0x4b6ff8['user']['interface'],'type':_0xb814('0x39'),'enterAt':moment()[_0xb814('0x35')](_0xb814('0x36')),'role':_0xb814('0x3c'),'internal':_0x4b6ff8[_0xb814('0x2f')][_0xb814('0x3d')],'uniqueid':_0x4b6ff8[_0xb814('0x22')]['interaction'][_0x44ff56][_0x40af85]}});}}}}return respondWithRpcPromise(_0xb814('0x3e'),{'id':_0x4b6ff8[_0xb814('0x1b')]['id'],'capacity':_0x4b6ff8[_0xb814('0x22')]['capacity']},routingClient)[_0xb814('0xa')](respondWithResult(_0x544d36,null))['catch'](handleError(_0x544d36,null));};exports[_0xb814('0x3f')]=function(_0x5dc28e,_0x403872){return respondWithRpcPromise(_0xb814('0x40'),_0x5dc28e['query'])[_0xb814('0xa')](respondWithResult(_0x403872,null))[_0xb814('0xe')](handleError(_0x403872,null));};exports[_0xb814('0x41')]=function(_0x5209d1,_0x3da050){return respondWithRpcPromise('Trunks',_0x5209d1[_0xb814('0x1a')])[_0xb814('0xa')](respondWithResult(_0x3da050,null))['catch'](handleError(_0x3da050,null));};exports[_0xb814('0x42')]=function(_0x4a3f84,_0x539be7){return respondWithRpcPromise(_0xb814('0x43'),_0x4a3f84[_0xb814('0x1a')])[_0xb814('0xa')](respondWithResult(_0x539be7,null))['catch'](handleError(_0x539be7,null));};exports[_0xb814('0x44')]=function(_0x538b0f,_0xf88d23){return respondWithRpcPromise(_0xb814('0x45'),_0x538b0f['query'],routingClient)[_0xb814('0xa')](respondWithResult(_0xf88d23,null))['catch'](handleError(_0xf88d23,null));};exports[_0xb814('0x46')]=function(_0x1656ed,_0xb2bd82){return respondWithRpcPromise(_0xb814('0x45'),_0x1656ed[_0xb814('0x1a')],routingClient)[_0xb814('0xa')](findById(_0x1656ed[_0xb814('0x1b')]['id']))[_0xb814('0xa')](respondWithResult(_0xb2bd82,null))['catch'](handleError(_0xb2bd82,null));};exports[_0xb814('0x47')]=function(_0x5441c5,_0x5d71d5){return respondWithRpcPromise(_0xb814('0x48'),_0x5441c5[_0xb814('0x1a')],routingClient)['then'](respondWithResult(_0x5d71d5,null))[_0xb814('0xe')](handleError(_0x5d71d5,null));};exports['showMailQueues']=function(_0x48362c,_0x2114ca){return respondWithRpcPromise('MailQueues',_0x48362c[_0xb814('0x1a')],routingClient)[_0xb814('0xa')](findById(_0x48362c[_0xb814('0x1b')]['id']))['then'](respondWithResult(_0x2114ca,null))[_0xb814('0xe')](handleError(_0x2114ca,null));};exports['mailAccounts']=function(_0x2ef77d,_0x1e9196){return respondWithRpcPromise(_0xb814('0x49'),_0x2ef77d[_0xb814('0x1a')],mailClient)[_0xb814('0xa')](respondWithResult(_0x1e9196,null))[_0xb814('0xe')](handleError(_0x1e9196,null));};exports[_0xb814('0x4a')]=function(_0x113350,_0x46014f){return respondWithRpcPromise('OpenchannelQueues',_0x113350[_0xb814('0x1a')],routingClient)[_0xb814('0xa')](respondWithResult(_0x46014f,null))[_0xb814('0xe')](handleError(_0x46014f,null));};exports[_0xb814('0x4b')]=function(_0x3b35a8,_0x3d4843){return respondWithRpcPromise('OpenchannelQueues',_0x3b35a8[_0xb814('0x1a')],routingClient)['then'](findById(_0x3b35a8[_0xb814('0x1b')]['id']))[_0xb814('0xa')](respondWithResult(_0x3d4843,null))[_0xb814('0xe')](handleError(_0x3d4843,null));};exports['smsQueues']=function(_0x150e73,_0x579351){return respondWithRpcPromise(_0xb814('0x4c'),_0x150e73['query'],routingClient)[_0xb814('0xa')](respondWithResult(_0x579351,null))[_0xb814('0xe')](handleError(_0x579351,null));};exports[_0xb814('0x4d')]=function(_0x1b024f,_0x3377d4){return respondWithRpcPromise(_0xb814('0x4c'),_0x1b024f[_0xb814('0x1a')],routingClient)['then'](findById(_0x1b024f[_0xb814('0x1b')]['id']))['then'](respondWithResult(_0x3377d4,null))[_0xb814('0xe')](handleError(_0x3377d4,null));};exports[_0xb814('0x4e')]=function(_0x1b989d,_0x3dcaeb){return respondWithRpcPromise(_0xb814('0x4f'),_0x1b989d[_0xb814('0x1a')],routingClient)['then'](respondWithResult(_0x3dcaeb,null))[_0xb814('0xe')](handleError(_0x3dcaeb,null));};exports[_0xb814('0x50')]=function(_0x4a49ba,_0x3bb2b4){return respondWithRpcPromise(_0xb814('0x4f'),_0x4a49ba[_0xb814('0x1a')],routingClient)[_0xb814('0xa')](findById(_0x4a49ba[_0xb814('0x1b')]['id']))['then'](respondWithResult(_0x3bb2b4,null))[_0xb814('0xe')](handleError(_0x3bb2b4,null));};exports['faxQueues']=function(_0x24594a,_0x16f8f2){return respondWithRpcPromise(_0xb814('0x51'),_0x24594a[_0xb814('0x1a')],routingClient)[_0xb814('0xa')](respondWithResult(_0x16f8f2,null))[_0xb814('0xe')](handleError(_0x16f8f2,null));};exports['showFaxQueues']=function(_0x506bf2,_0x5d064b){return respondWithRpcPromise(_0xb814('0x51'),_0x506bf2['query'],routingClient)[_0xb814('0xa')](findById(_0x506bf2[_0xb814('0x1b')]['id']))[_0xb814('0xa')](respondWithResult(_0x5d064b,null))['catch'](handleError(_0x5d064b,null));};exports[_0xb814('0x52')]=function(_0x3e5ce8,_0xee204){return respondWithRpcPromise('FaxAccounts',_0x3e5ce8[_0xb814('0x1a')])[_0xb814('0xa')](respondWithResult(_0xee204,null))[_0xb814('0xe')](handleError(_0xee204,null));};exports[_0xb814('0x53')]=function(_0x555be0,_0x5dedd7){return respondWithRpcPromise(_0xb814('0x54'),_0x555be0[_0xb814('0x1a')],routingClient)[_0xb814('0xa')](respondWithResult(_0x5dedd7,null))[_0xb814('0xe')](handleError(_0x5dedd7,null));};exports[_0xb814('0x55')]=function(_0xe5fc12,_0x34a0b3){return respondWithRpcPromise(_0xb814('0x56'),_0xe5fc12[_0xb814('0x1a')],routingClient)[_0xb814('0xa')](respondWithResult(_0x34a0b3,null))[_0xb814('0xe')](handleError(_0x34a0b3,null));};exports[_0xb814('0x57')]=function(_0x3ef474,_0x21fc41){return respondWithRpcPromise(_0xb814('0x58'),_0x3ef474['query'],routingClient)[_0xb814('0xa')](respondWithResult(_0x21fc41,null))[_0xb814('0xe')](handleError(_0x21fc41,null));};exports[_0xb814('0x59')]=function(_0x357b90,_0xec821a){return respondWithRpcPromise(_0xb814('0x58'),_0x357b90['query'],routingClient)[_0xb814('0xa')](function(_0x52e1fc){if(_0x357b90[_0xb814('0x1a')][_0xb814('0x5a')]!==undefined){var _0x3c5a58=_(_0x52e1fc[_0xb814('0x16')])[_0xb814('0x5b')]([_0x357b90['query']['type'],_0x357b90[_0xb814('0x1b')]['id']])[_0xb814('0x5c')](_0xb814('0x5d'))[_0xb814('0x5e')]()['value']();return _0x52e1fc[_0xb814('0x16')]['filter'](function(_0x39073c){return _0x3c5a58[_0xb814('0x5f')](_0x39073c['queue_id'])>-0x1;});}else{return _0x52e1fc['rows'][_0xb814('0x5b')](function(_0x52e17a){return _0x52e17a[_0xb814('0x5d')]===parseInt(_0x357b90[_0xb814('0x1b')]['id']);});}})[_0xb814('0xa')](respondWithResult(_0xec821a,null))[_0xb814('0xe')](handleError(_0xec821a,null));};exports[_0xb814('0x60')]=function(_0x420bde,_0x40fe4a){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x420bde[_0xb814('0x1a')],routingClient)['then'](respondWithResult(_0x40fe4a,null))[_0xb814('0xe')](handleError(_0x40fe4a,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x2838cb,_0x43ee60){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0x2838cb[_0xb814('0x1a')],routingClient)['then'](respondWithResult(_0x43ee60,null))[_0xb814('0xe')](handleError(_0x43ee60,null));};exports[_0xb814('0x61')]=function(_0x4e15c2,_0x5a0c4a){return respondWithRpcPromise(_0xb814('0x62'),_0x4e15c2[_0xb814('0x1a')],routingClient)[_0xb814('0xa')](respondWithResult(_0x5a0c4a,null))[_0xb814('0xe')](handleError(_0x5a0c4a,null));};exports[_0xb814('0x63')]=function(_0x4394da){return function(_0x2b12a9,_0x314600){var _0x8cb107,_0x34f49c;var _0x53e705=_['capitalize'](_0x4394da);var _0x5bee4d=_0x4394da==='chat'?'Website':_0xb814('0x64');return db[_0x53e705+_0xb814('0x65')][_0xb814('0x66')]({'raw':!![],'where':{'id':_0x2b12a9['params']['id']}})[_0xb814('0xa')](function(_0x1fb1ea){if(_[_0xb814('0x15')](_0x1fb1ea)){throw new Error(_0x53e705+_0xb814('0x67'));}_0x8cb107=_0x1fb1ea;return db[_0x53e705+_0xb814('0x68')][_0xb814('0x66')]({'where':{'id':_0x2b12a9[_0xb814('0x22')][_0xb814('0x69')]},'include':[{'model':db[_0x53e705+'Interaction'],'as':_0xb814('0x6a')},{'model':db[_0x53e705+_0x5bee4d],'as':_0xb814('0x64')}]});})[_0xb814('0xa')](function(_0x30faa0){if(_['isNil'](_0x30faa0)){throw new Error(_0x53e705+_0xb814('0x6b'));}_0x34f49c=_0x30faa0;return _0x30faa0[_0xb814('0x6c')]({'read':0x0,'readAt':null,'UserId':null});})[_0xb814('0xa')](function(){var _0x3037f2={'uniqueid':_0x4394da+'.'+_0x34f49c['id']+'.'+_0x34f49c[_0xb814('0x6a')]['id'],'FromUserId':_0x2b12a9['user']['id'],'type':'queue'};_0x3037f2[_0x53e705+_0xb814('0x6d')]=_0x34f49c['id'];_0x3037f2[_0x53e705+'InteractionId']=_0x34f49c[_0xb814('0x6a')]['id'];_0x3037f2[_0xb814('0x6e')+_0x53e705+_0x5bee4d+'Id']=_0x34f49c['Account']['id'];_0x3037f2['To'+_0x53e705+_0xb814('0x6f')]=_0x8cb107['id'];return db[_0x53e705+'TransferReport'][_0xb814('0x70')](_0x3037f2);})['then'](function(){return respondWithRpcPromise(_0xb814('0x71'),{'channel':_0x4394da,'interaction':_0x34f49c[_0xb814('0x6a')],'message':_0x34f49c,'account':_0x34f49c[_0xb814('0x64')],'applications':[{'id':0x0,'priority':0x1,'app':_0xb814('0x72'),'appdata':_0x8cb107[_0xb814('0x13')]+','+(_0x34f49c[_0xb814('0x64')][_0xb814('0x73')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})['then'](respondWithResult(_0x314600,null))[_0xb814('0xe')](handleError(_0x314600,null));};};exports['agentNotify']=function(_0x511e03,_0x2d0061){var _0x8fbda1,_0x25d42d;if(_['isNil'](_0x511e03[_0xb814('0x22')]['channel'])){throw new Error(_0xb814('0x74'));}var _0x19d508=_0x511e03[_0xb814('0x22')][_0xb814('0x75')];var _0x4c8a00=_[_0xb814('0x76')](_0x19d508);var _0xc0ff3c=_0x19d508===_0xb814('0x77')?'Website':_0xb814('0x64');return db[_0xb814('0x78')][_0xb814('0x66')]({'raw':!![],'where':{'id':_0x511e03['params']['id'],'role':_0xb814('0x3c')}})[_0xb814('0xa')](function(_0x9dc06b){if(_[_0xb814('0x15')](_0x9dc06b)){throw new Error(_0xb814('0x79'));}_0x8fbda1=_0x9dc06b;return db[_0x4c8a00+_0xb814('0x68')][_0xb814('0x66')]({'where':{'id':_0x511e03[_0xb814('0x22')][_0xb814('0x69')]},'include':[{'model':db[_0x4c8a00+_0xb814('0x6a')],'as':_0xb814('0x6a')},{'model':db[_0x4c8a00+_0xc0ff3c],'as':_0xb814('0x64')}]});})[_0xb814('0xa')](function(_0x5b8d2e){if(_['isNil'](_0x5b8d2e)){throw new Error(_0x4c8a00+_0xb814('0x6b'));}_0x25d42d=_0x5b8d2e;return _0x5b8d2e['update']({'read':0x0,'readAt':null,'UserId':null});})[_0xb814('0xa')](function(){var _0x3949fd={'uniqueid':_0x19d508+'.'+_0x25d42d['id']+'.'+_0x25d42d[_0xb814('0x6a')]['id'],'FromUserId':_0x511e03[_0xb814('0x2f')]['id'],'type':_0xb814('0x72'),'ToUserId':_0x8fbda1['id']};_0x3949fd[_0x4c8a00+_0xb814('0x6d')]=_0x25d42d['id'];_0x3949fd[_0x4c8a00+_0xb814('0x7a')]=_0x25d42d['Interaction']['id'];_0x3949fd['From'+_0x4c8a00+_0xc0ff3c+'Id']=_0x25d42d[_0xb814('0x64')]['id'];return db[_0x4c8a00+'TransferReport'][_0xb814('0x70')](_0x3949fd);})[_0xb814('0xa')](function(){return respondWithRpcPromise(_0xb814('0x71'),{'channel':_0x19d508,'interaction':_0x25d42d['Interaction'],'message':_0x25d42d,'account':_0x25d42d[_0xb814('0x64')],'applications':[{'id':0x0,'priority':0x1,'app':_0xb814('0x3c'),'appdata':_0x8fbda1[_0xb814('0x13')]+','+(_0x25d42d[_0xb814('0x64')][_0xb814('0x7b')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xb814('0xa')](respondWithResult(_0x2d0061,null))[_0xb814('0xe')](handleError(_0x2d0061,null));}; \ No newline at end of file +var _0xf494=['WhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','map','queue_id','uniq','value','filter','indexOf','smsQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Queue','findOne','\x20Queue\x20not\x20found','Message','Interaction','Account','\x20Message\x20not\x20found','MessageId','QueueId','TransferReport','create','Start','queue','queueTransferTimeout','*,*,*,*','agentNotify','Channel\x20field\x20is\x20mandatory','channel','User','Agent\x20not\x20found','messageId','update','InteractionId','From','bluebird','moment','lodash','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','then','error','message','status','json','sendStatus','stack','name','isNil','rows','find','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','catch','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','Agents','agentCapacity','user','interaction','hasOwnProperty','MemberReport','findAll','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','interface','SIP/%s','agent','internal','AgentCapacity','capacity','telephones','trunks','campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues'];(function(_0x7b717,_0x311539){var _0x50d254=function(_0xfdf8b8){while(--_0xfdf8b8){_0x7b717['push'](_0x7b717['shift']());}};_0x50d254(++_0x311539);}(_0xf494,0x1c6));var _0x4f49=function(_0x3e84ad,_0x4218c3){_0x3e84ad=_0x3e84ad-0x0;var _0x17de2f=_0xf494[_0x3e84ad];return _0x17de2f;};'use strict';var BPromise=require(_0x4f49('0x0'));var moment=require(_0x4f49('0x1'));var _=require(_0x4f49('0x2'));var util=require('util');var db=require(_0x4f49('0x3'))['db'];var logger=require(_0x4f49('0x4'))(_0x4f49('0x5'));var jayson=require(_0x4f49('0x6'));var amiClient=jayson[_0x4f49('0x7')][_0x4f49('0x8')]({'port':0x232a});var mailClient=jayson[_0x4f49('0x7')][_0x4f49('0x8')]({'port':0x232b});var routingClient=jayson[_0x4f49('0x7')][_0x4f49('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x42b0e8,_0x5eb186,_0x58e9a0){return new BPromise(function(_0x169c95,_0x327bd5){var _0x31a725=_0x58e9a0?_0x58e9a0:amiClient;return _0x31a725[_0x4f49('0x9')](_0x42b0e8,_0x5eb186)[_0x4f49('0xa')](function(_0x174d0d){if(_0x174d0d[_0x4f49('0xb')]){if(_0x174d0d[_0x4f49('0xb')]['code']===0x1f4){return _0x327bd5(_0x174d0d[_0x4f49('0xb')][_0x4f49('0xc')]);}return _0x169c95(_0x174d0d['error'][_0x4f49('0xc')]);}else{_0x169c95(_0x174d0d['result']);}})['catch'](function(_0x4b9cd3){_0x327bd5(_0x4b9cd3);});});}function respondWithResult(_0x12527d,_0x4bf89f){_0x4bf89f=_0x4bf89f||0xc8;return function(_0x1e1c37){if(_0x1e1c37){return _0x12527d[_0x4f49('0xd')](_0x4bf89f)[_0x4f49('0xe')](_0x1e1c37);}return _0x12527d[_0x4f49('0xf')](0x194);};}function handleError(_0x1a0f1e,_0x2f0131){_0x2f0131=_0x2f0131||0x1f4;return function(_0xfdb477){logger['error'](_0xfdb477[_0x4f49('0x10')]);if(_0xfdb477[_0x4f49('0x11')]){delete _0xfdb477[_0x4f49('0x11')];}_0x1a0f1e['status'](_0x2f0131)['send'](_0xfdb477);};}function findById(_0x2f0a0d){return function(_0x2ecaaa){if(!_[_0x4f49('0x12')](_0x2f0a0d)&&!_['isNil'](_0x2ecaaa)&&!_[_0x4f49('0x12')](_0x2ecaaa[_0x4f49('0x13')])){return _[_0x4f49('0x14')](_0x2ecaaa['rows'],function(_0x5bb23b){return _0x5bb23b['id']==_0x2f0a0d;});}return null;};}exports['voiceChannels']=function(_0x47f1e8,_0xb2081a){return respondWithRpcPromise(_0x4f49('0x15'),_0x47f1e8[_0x4f49('0x16')])[_0x4f49('0xa')](respondWithResult(_0xb2081a,null))['catch'](handleError(_0xb2081a,null));};exports[_0x4f49('0x17')]=function(_0x2aed27,_0x197a49){return respondWithRpcPromise(_0x4f49('0x18'),_[_0x4f49('0x19')](_0x2aed27['query'],_0x2aed27[_0x4f49('0x1a')]))[_0x4f49('0xa')](respondWithResult(_0x197a49,null))[_0x4f49('0x1b')](handleError(_0x197a49,null));};exports['voiceChannelStopMixMonitor']=function(_0x40755e,_0x1d70a7){return respondWithRpcPromise(_0x4f49('0x1c'),_[_0x4f49('0x19')](_0x40755e[_0x4f49('0x16')],_0x40755e[_0x4f49('0x1a')]))['then'](respondWithResult(_0x1d70a7,null))['catch'](handleError(_0x1d70a7,null));};exports[_0x4f49('0x1d')]=function(_0x429de7,_0x4fedbb){return respondWithRpcPromise(_0x4f49('0x1e'),_0x429de7[_0x4f49('0x16')])[_0x4f49('0xa')](respondWithResult(_0x4fedbb,null))['catch'](handleError(_0x4fedbb,null));};exports[_0x4f49('0x1f')]=function(_0x2eed1c,_0x298785){return respondWithRpcPromise(_0x4f49('0x1e'),_0x2eed1c[_0x4f49('0x16')])[_0x4f49('0xa')](findById(_0x2eed1c['params']['id']))['then'](respondWithResult(_0x298785,null))[_0x4f49('0x1b')](handleError(_0x298785,null));};exports[_0x4f49('0x20')]=function(_0x605c91,_0x560050){return respondWithRpcPromise(_0x4f49('0x21'),_[_0x4f49('0x19')](_0x605c91[_0x4f49('0x22')],_0x605c91['params']))['then'](respondWithResult(_0x560050,null))[_0x4f49('0x1b')](handleError(_0x560050,null));};exports[_0x4f49('0x23')]=function(_0x7a6ea0,_0x5e7076){return respondWithRpcPromise(_0x4f49('0x24'),_[_0x4f49('0x19')](_0x7a6ea0[_0x4f49('0x16')],_0x7a6ea0[_0x4f49('0x1a')]))[_0x4f49('0xa')](respondWithResult(_0x5e7076,null))[_0x4f49('0x1b')](handleError(_0x5e7076,null));};exports[_0x4f49('0x25')]=function(_0x45ae19,_0x1f38d3){return respondWithRpcPromise(_0x4f49('0x26'),_0x45ae19[_0x4f49('0x16')])[_0x4f49('0xa')](respondWithResult(_0x1f38d3,null))[_0x4f49('0x1b')](handleError(_0x1f38d3,null));};exports[_0x4f49('0x27')]=function(_0x135d17,_0x97ef98){return respondWithRpcPromise(_0x4f49('0x28'),_[_0x4f49('0x19')](_0x135d17[_0x4f49('0x16')],_0x135d17['params']))[_0x4f49('0xa')](respondWithResult(_0x97ef98,null))[_0x4f49('0x1b')](handleError(_0x97ef98,null));};exports[_0x4f49('0x29')]=function(_0x1cb3cc,_0x1c3af8){return respondWithRpcPromise(_0x4f49('0x2a'),_[_0x4f49('0x19')](_0x1cb3cc[_0x4f49('0x16')],_0x1cb3cc[_0x4f49('0x1a')]))[_0x4f49('0xa')](respondWithResult(_0x1c3af8,null))[_0x4f49('0x1b')](handleError(_0x1c3af8,null));};exports[_0x4f49('0x2b')]=function(_0x3ec6c4,_0x4d2d57){return respondWithRpcPromise(_0x4f49('0x2c'),_[_0x4f49('0x19')](_0x3ec6c4[_0x4f49('0x16')],_0x3ec6c4[_0x4f49('0x1a')]))[_0x4f49('0xa')](respondWithResult(_0x4d2d57,null))[_0x4f49('0x1b')](handleError(_0x4d2d57,null));};exports[_0x4f49('0x2d')]=function(_0x25fdf8,_0x10bfc4){return respondWithRpcPromise(_0x4f49('0x2e'),_0x25fdf8[_0x4f49('0x16')])[_0x4f49('0xa')](respondWithResult(_0x10bfc4,null))[_0x4f49('0x1b')](handleError(_0x10bfc4,null));};exports[_0x4f49('0x2f')]=function(_0x4e3f72,_0x802f20){return respondWithRpcPromise(_0x4f49('0x30'),_0x4e3f72['query'])[_0x4f49('0xa')](respondWithResult(_0x802f20,null))[_0x4f49('0x1b')](handleError(_0x802f20,null));};exports['agents']=function(_0x29e762,_0x1dd1a6){var _0x2548ad;return respondWithRpcPromise(_0x4f49('0x31'),_0x29e762[_0x4f49('0x16')])[_0x4f49('0xa')](function(_0x29e910){_0x2548ad=_0x29e910;return respondWithRpcPromise('Agents',_0x29e762['query'],routingClient);})['then'](function(_0x15e4b3){return _[_0x4f49('0x19')]({},_0x15e4b3,_0x2548ad);})[_0x4f49('0xa')](respondWithResult(_0x1dd1a6,null))[_0x4f49('0x1b')](handleError(_0x1dd1a6,null));};exports[_0x4f49('0x32')]=function(_0x1ecf6c,_0x38aff8){if(_0x1ecf6c[_0x4f49('0x22')]&&_0x1ecf6c[_0x4f49('0x22')]['interaction']&&_0x1ecf6c['user']&&_0x1ecf6c[_0x4f49('0x33')][_0x4f49('0x11')]){for(var _0x159642 in _0x1ecf6c['body'][_0x4f49('0x34')]){if(_0x1ecf6c['body']['interaction'][_0x4f49('0x35')](_0x159642)){db[_0x4f49('0x36')][_0x4f49('0x37')]({'where':{'channel':_0x159642,'membername':_0x1ecf6c['user'][_0x4f49('0x11')],'type':_0x4f49('0x38'),'exitAt':null,'uniqueid':_0x1ecf6c['body'][_0x4f49('0x34')][_0x159642]&&_0x1ecf6c['body'][_0x4f49('0x34')][_0x159642][_0x4f49('0x39')]?{'$notIn':_0x1ecf6c[_0x4f49('0x22')]['interaction'][_0x159642]}:{'$ne':null}}})[_0x4f49('0xa')](function(_0x1e5f0b){var _0x33bb04=moment()[_0x4f49('0x3a')](_0x4f49('0x3b'));for(var _0x1c41e4=0x0,_0xe66867=_0x1e5f0b[_0x4f49('0x39')];_0x1c41e4<_0xe66867;_0x1c41e4+=0x1){_0x1e5f0b[_0x1c41e4][_0x4f49('0x3c')]({'exitAt':_0x33bb04});}});for(var _0x157a55=0x0;_0x157a55<_0x1ecf6c['body'][_0x4f49('0x34')][_0x159642][_0x4f49('0x39')];_0x157a55+=0x1){db['MemberReport'][_0x4f49('0x3d')]({'where':{'channel':_0x159642,'membername':_0x1ecf6c['user'][_0x4f49('0x11')],'type':_0x4f49('0x38'),'uniqueid':_0x1ecf6c[_0x4f49('0x22')][_0x4f49('0x34')][_0x159642][_0x157a55],'exitAt':null},'defaults':{'channel':_0x159642,'membername':_0x1ecf6c['user'][_0x4f49('0x11')],'interface':_[_0x4f49('0x12')](_0x1ecf6c[_0x4f49('0x33')][_0x4f49('0x3e')])?util[_0x4f49('0x3a')](_0x4f49('0x3f'),_0x1ecf6c[_0x4f49('0x33')][_0x4f49('0x11')]):_0x1ecf6c[_0x4f49('0x33')][_0x4f49('0x3e')],'type':_0x4f49('0x38'),'enterAt':moment()[_0x4f49('0x3a')](_0x4f49('0x3b')),'role':_0x4f49('0x40'),'internal':_0x1ecf6c[_0x4f49('0x33')][_0x4f49('0x41')],'uniqueid':_0x1ecf6c['body']['interaction'][_0x159642][_0x157a55]}});}}}}return respondWithRpcPromise(_0x4f49('0x42'),{'id':_0x1ecf6c[_0x4f49('0x1a')]['id'],'capacity':_0x1ecf6c[_0x4f49('0x22')][_0x4f49('0x43')]},routingClient)[_0x4f49('0xa')](respondWithResult(_0x38aff8,null))[_0x4f49('0x1b')](handleError(_0x38aff8,null));};exports[_0x4f49('0x44')]=function(_0x51c756,_0x6637f4){return respondWithRpcPromise('Telephones',_0x51c756[_0x4f49('0x16')])[_0x4f49('0xa')](respondWithResult(_0x6637f4,null))[_0x4f49('0x1b')](handleError(_0x6637f4,null));};exports[_0x4f49('0x45')]=function(_0x586095,_0x342980){return respondWithRpcPromise('Trunks',_0x586095['query'])[_0x4f49('0xa')](respondWithResult(_0x342980,null))[_0x4f49('0x1b')](handleError(_0x342980,null));};exports[_0x4f49('0x46')]=function(_0x26ae33,_0x56375a){return respondWithRpcPromise('Campaigns',_0x26ae33[_0x4f49('0x16')])[_0x4f49('0xa')](respondWithResult(_0x56375a,null))['catch'](handleError(_0x56375a,null));};exports[_0x4f49('0x47')]=function(_0x5b50bc,_0x5a929a){return respondWithRpcPromise(_0x4f49('0x48'),_0x5b50bc['query'],routingClient)[_0x4f49('0xa')](respondWithResult(_0x5a929a,null))['catch'](handleError(_0x5a929a,null));};exports[_0x4f49('0x49')]=function(_0x38a640,_0x2472c9){return respondWithRpcPromise(_0x4f49('0x48'),_0x38a640[_0x4f49('0x16')],routingClient)[_0x4f49('0xa')](findById(_0x38a640[_0x4f49('0x1a')]['id']))[_0x4f49('0xa')](respondWithResult(_0x2472c9,null))['catch'](handleError(_0x2472c9,null));};exports[_0x4f49('0x4a')]=function(_0x51f57e,_0x213608){return respondWithRpcPromise(_0x4f49('0x4b'),_0x51f57e[_0x4f49('0x16')],routingClient)[_0x4f49('0xa')](respondWithResult(_0x213608,null))[_0x4f49('0x1b')](handleError(_0x213608,null));};exports[_0x4f49('0x4c')]=function(_0x553981,_0x426c50){return respondWithRpcPromise(_0x4f49('0x4b'),_0x553981['query'],routingClient)['then'](findById(_0x553981[_0x4f49('0x1a')]['id']))[_0x4f49('0xa')](respondWithResult(_0x426c50,null))[_0x4f49('0x1b')](handleError(_0x426c50,null));};exports[_0x4f49('0x4d')]=function(_0x19a788,_0x4af08d){return respondWithRpcPromise(_0x4f49('0x4e'),_0x19a788['query'],mailClient)[_0x4f49('0xa')](respondWithResult(_0x4af08d,null))[_0x4f49('0x1b')](handleError(_0x4af08d,null));};exports[_0x4f49('0x4f')]=function(_0x4aae7c,_0x1dade6){return respondWithRpcPromise(_0x4f49('0x50'),_0x4aae7c[_0x4f49('0x16')],routingClient)[_0x4f49('0xa')](respondWithResult(_0x1dade6,null))['catch'](handleError(_0x1dade6,null));};exports[_0x4f49('0x51')]=function(_0x269564,_0x5e6898){return respondWithRpcPromise(_0x4f49('0x50'),_0x269564[_0x4f49('0x16')],routingClient)[_0x4f49('0xa')](findById(_0x269564[_0x4f49('0x1a')]['id']))[_0x4f49('0xa')](respondWithResult(_0x5e6898,null))[_0x4f49('0x1b')](handleError(_0x5e6898,null));};exports[_0x4f49('0x52')]=function(_0x30fc21,_0x519721){return respondWithRpcPromise(_0x4f49('0x53'),_0x30fc21[_0x4f49('0x16')],routingClient)[_0x4f49('0xa')](respondWithResult(_0x519721,null))[_0x4f49('0x1b')](handleError(_0x519721,null));};exports[_0x4f49('0x54')]=function(_0x26b022,_0x335875){return respondWithRpcPromise('SmsQueues',_0x26b022[_0x4f49('0x16')],routingClient)['then'](findById(_0x26b022[_0x4f49('0x1a')]['id']))[_0x4f49('0xa')](respondWithResult(_0x335875,null))[_0x4f49('0x1b')](handleError(_0x335875,null));};exports[_0x4f49('0x55')]=function(_0xc7743e,_0x3f2f3f){return respondWithRpcPromise(_0x4f49('0x56'),_0xc7743e[_0x4f49('0x16')],routingClient)[_0x4f49('0xa')](respondWithResult(_0x3f2f3f,null))[_0x4f49('0x1b')](handleError(_0x3f2f3f,null));};exports['showWhatsappQueues']=function(_0x2f9f2e,_0x141554){return respondWithRpcPromise(_0x4f49('0x56'),_0x2f9f2e[_0x4f49('0x16')],routingClient)['then'](findById(_0x2f9f2e['params']['id']))[_0x4f49('0xa')](respondWithResult(_0x141554,null))['catch'](handleError(_0x141554,null));};exports[_0x4f49('0x57')]=function(_0x287705,_0x43bdde){return respondWithRpcPromise(_0x4f49('0x58'),_0x287705[_0x4f49('0x16')],routingClient)[_0x4f49('0xa')](respondWithResult(_0x43bdde,null))[_0x4f49('0x1b')](handleError(_0x43bdde,null));};exports[_0x4f49('0x59')]=function(_0x3823f0,_0x3e9b47){return respondWithRpcPromise(_0x4f49('0x58'),_0x3823f0[_0x4f49('0x16')],routingClient)[_0x4f49('0xa')](findById(_0x3823f0[_0x4f49('0x1a')]['id']))[_0x4f49('0xa')](respondWithResult(_0x3e9b47,null))[_0x4f49('0x1b')](handleError(_0x3e9b47,null));};exports[_0x4f49('0x5a')]=function(_0x753863,_0x1f9161){return respondWithRpcPromise(_0x4f49('0x5b'),_0x753863[_0x4f49('0x16')])[_0x4f49('0xa')](respondWithResult(_0x1f9161,null))[_0x4f49('0x1b')](handleError(_0x1f9161,null));};exports[_0x4f49('0x5c')]=function(_0x2d0990,_0x49a79d){return respondWithRpcPromise(_0x4f49('0x5d'),_0x2d0990['query'],routingClient)[_0x4f49('0xa')](respondWithResult(_0x49a79d,null))[_0x4f49('0x1b')](handleError(_0x49a79d,null));};exports[_0x4f49('0x5e')]=function(_0x3c0f69,_0x26de18){return respondWithRpcPromise(_0x4f49('0x5f'),_0x3c0f69[_0x4f49('0x16')],routingClient)[_0x4f49('0xa')](respondWithResult(_0x26de18,null))[_0x4f49('0x1b')](handleError(_0x26de18,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x4b6ef4,_0x539e21){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x4b6ef4[_0x4f49('0x16')],routingClient)[_0x4f49('0xa')](respondWithResult(_0x539e21,null))[_0x4f49('0x1b')](handleError(_0x539e21,null));};exports[_0x4f49('0x60')]=function(_0x1fc88a,_0x5a8b1c){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x1fc88a[_0x4f49('0x16')],routingClient)[_0x4f49('0xa')](function(_0x4bdd1b){if(_0x1fc88a[_0x4f49('0x16')][_0x4f49('0x61')]!==undefined){var _0x5c824f=_(_0x4bdd1b[_0x4f49('0x13')])['filter']([_0x1fc88a[_0x4f49('0x16')][_0x4f49('0x61')],_0x1fc88a['params']['id']])[_0x4f49('0x62')](_0x4f49('0x63'))[_0x4f49('0x64')]()[_0x4f49('0x65')]();return _0x4bdd1b[_0x4f49('0x13')][_0x4f49('0x66')](function(_0x5f0dbf){return _0x5c824f[_0x4f49('0x67')](_0x5f0dbf['queue_id'])>-0x1;});}else{return _0x4bdd1b[_0x4f49('0x13')]['filter'](function(_0x50c06e){return _0x50c06e['queue_id']===parseInt(_0x1fc88a[_0x4f49('0x1a')]['id']);});}})[_0x4f49('0xa')](respondWithResult(_0x5a8b1c,null))[_0x4f49('0x1b')](handleError(_0x5a8b1c,null));};exports[_0x4f49('0x68')]=function(_0x47af99,_0x39024d){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x47af99[_0x4f49('0x16')],routingClient)['then'](respondWithResult(_0x39024d,null))[_0x4f49('0x1b')](handleError(_0x39024d,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x4938a6,_0x329a49){return respondWithRpcPromise(_0x4f49('0x69'),_0x4938a6[_0x4f49('0x16')],routingClient)['then'](respondWithResult(_0x329a49,null))[_0x4f49('0x1b')](handleError(_0x329a49,null));};exports[_0x4f49('0x6a')]=function(_0x5c33c9,_0x5d52ae){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x5c33c9[_0x4f49('0x16')],routingClient)[_0x4f49('0xa')](respondWithResult(_0x5d52ae,null))[_0x4f49('0x1b')](handleError(_0x5d52ae,null));};exports[_0x4f49('0x6b')]=function(_0x1643fc){return function(_0x517144,_0x15b7e4){var _0x1b922e,_0x29de92;var _0x58d07e=_[_0x4f49('0x6c')](_0x1643fc);var _0x34843a=_0x1643fc===_0x4f49('0x6d')?_0x4f49('0x6e'):'Account';return db[_0x58d07e+_0x4f49('0x6f')][_0x4f49('0x70')]({'raw':!![],'where':{'id':_0x517144[_0x4f49('0x1a')]['id']}})[_0x4f49('0xa')](function(_0x389679){if(_['isNil'](_0x389679)){throw new Error(_0x58d07e+_0x4f49('0x71'));}_0x1b922e=_0x389679;return db[_0x58d07e+_0x4f49('0x72')]['findOne']({'where':{'id':_0x517144[_0x4f49('0x22')]['messageId']},'include':[{'model':db[_0x58d07e+_0x4f49('0x73')],'as':'Interaction'},{'model':db[_0x58d07e+_0x34843a],'as':_0x4f49('0x74')}]});})[_0x4f49('0xa')](function(_0x2ef19e){if(_[_0x4f49('0x12')](_0x2ef19e)){throw new Error(_0x58d07e+_0x4f49('0x75'));}_0x29de92=_0x2ef19e;return _0x2ef19e['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x4f49('0xa')](function(){var _0x1f3556={'uniqueid':_0x1643fc+'.'+_0x29de92['id']+'.'+_0x29de92[_0x4f49('0x73')]['id'],'FromUserId':_0x517144[_0x4f49('0x33')]['id'],'type':'queue'};_0x1f3556[_0x58d07e+_0x4f49('0x76')]=_0x29de92['id'];_0x1f3556[_0x58d07e+'InteractionId']=_0x29de92[_0x4f49('0x73')]['id'];_0x1f3556['From'+_0x58d07e+_0x34843a+'Id']=_0x29de92[_0x4f49('0x74')]['id'];_0x1f3556['To'+_0x58d07e+_0x4f49('0x77')]=_0x1b922e['id'];return db[_0x58d07e+_0x4f49('0x78')][_0x4f49('0x79')](_0x1f3556);})[_0x4f49('0xa')](function(){return respondWithRpcPromise(_0x4f49('0x7a'),{'channel':_0x1643fc,'interaction':_0x29de92[_0x4f49('0x73')],'message':_0x29de92,'account':_0x29de92[_0x4f49('0x74')],'applications':[{'id':0x0,'priority':0x1,'app':_0x4f49('0x7b'),'appdata':_0x1b922e[_0x4f49('0x11')]+','+(_0x29de92['Account'][_0x4f49('0x7c')]||0x12c),'interval':_0x4f49('0x7d')}]},routingClient);})[_0x4f49('0xa')](respondWithResult(_0x15b7e4,null))[_0x4f49('0x1b')](handleError(_0x15b7e4,null));};};exports[_0x4f49('0x7e')]=function(_0x24b033,_0x55b28b){var _0x2ec42b,_0x20a0d4;if(_[_0x4f49('0x12')](_0x24b033[_0x4f49('0x22')]['channel'])){throw new Error(_0x4f49('0x7f'));}var _0x57567a=_0x24b033[_0x4f49('0x22')][_0x4f49('0x80')];var _0x5c5d2=_[_0x4f49('0x6c')](_0x57567a);var _0x4cfb48=_0x57567a===_0x4f49('0x6d')?_0x4f49('0x6e'):_0x4f49('0x74');return db[_0x4f49('0x81')][_0x4f49('0x70')]({'raw':!![],'where':{'id':_0x24b033[_0x4f49('0x1a')]['id'],'role':_0x4f49('0x40')}})[_0x4f49('0xa')](function(_0x355787){if(_[_0x4f49('0x12')](_0x355787)){throw new Error(_0x4f49('0x82'));}_0x2ec42b=_0x355787;return db[_0x5c5d2+_0x4f49('0x72')][_0x4f49('0x70')]({'where':{'id':_0x24b033[_0x4f49('0x22')][_0x4f49('0x83')]},'include':[{'model':db[_0x5c5d2+_0x4f49('0x73')],'as':_0x4f49('0x73')},{'model':db[_0x5c5d2+_0x4cfb48],'as':_0x4f49('0x74')}]});})['then'](function(_0x1979ef){if(_[_0x4f49('0x12')](_0x1979ef)){throw new Error(_0x5c5d2+_0x4f49('0x75'));}_0x20a0d4=_0x1979ef;return _0x1979ef[_0x4f49('0x84')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x225e63={'uniqueid':_0x57567a+'.'+_0x20a0d4['id']+'.'+_0x20a0d4[_0x4f49('0x73')]['id'],'FromUserId':_0x24b033['user']['id'],'type':_0x4f49('0x7b'),'ToUserId':_0x2ec42b['id']};_0x225e63[_0x5c5d2+'MessageId']=_0x20a0d4['id'];_0x225e63[_0x5c5d2+_0x4f49('0x85')]=_0x20a0d4[_0x4f49('0x73')]['id'];_0x225e63[_0x4f49('0x86')+_0x5c5d2+_0x4cfb48+'Id']=_0x20a0d4[_0x4f49('0x74')]['id'];return db[_0x5c5d2+_0x4f49('0x78')][_0x4f49('0x79')](_0x225e63);})[_0x4f49('0xa')](function(){return respondWithRpcPromise(_0x4f49('0x7a'),{'channel':_0x57567a,'interaction':_0x20a0d4[_0x4f49('0x73')],'message':_0x20a0d4,'account':_0x20a0d4[_0x4f49('0x74')],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x2ec42b['name']+','+(_0x20a0d4[_0x4f49('0x74')]['agentTransferTimeout']||0x12c),'interval':_0x4f49('0x7d')}]},routingClient);})[_0x4f49('0xa')](respondWithResult(_0x55b28b,null))['catch'](handleError(_0x55b28b,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 84191f9..a6e3156 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 _0x5d07=['show','post','create','put','update','delete','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./schedule.controller','get','isAuthenticated','index','/:id'];(function(_0x2ff725,_0x178b22){var _0x228d5d=function(_0x130ffd){while(--_0x130ffd){_0x2ff725['push'](_0x2ff725['shift']());}};_0x228d5d(++_0x178b22);}(_0x5d07,0x105));var _0x75d0=function(_0x4d30e5,_0x341957){_0x4d30e5=_0x4d30e5-0x0;var _0x5880b1=_0x5d07[_0x4d30e5];return _0x5880b1;};'use strict';var multer=require('multer');var util=require(_0x75d0('0x0'));var path=require('path');var timeout=require(_0x75d0('0x1'));var express=require(_0x75d0('0x2'));var router=express[_0x75d0('0x3')]();var fs_extra=require(_0x75d0('0x4'));var auth=require(_0x75d0('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x75d0('0x6'));router[_0x75d0('0x7')]('/',auth[_0x75d0('0x8')](),controller[_0x75d0('0x9')]);router[_0x75d0('0x7')](_0x75d0('0xa'),auth['isAuthenticated'](),controller[_0x75d0('0xb')]);router['get']('/:id/run',auth[_0x75d0('0x8')](),controller['run']);router[_0x75d0('0xc')]('/',auth[_0x75d0('0x8')](),controller[_0x75d0('0xd')]);router[_0x75d0('0xe')](_0x75d0('0xa'),auth[_0x75d0('0x8')](),controller[_0x75d0('0xf')]);router[_0x75d0('0x10')]('/:id',auth[_0x75d0('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x059a=['express','fs-extra','../../components/auth/service','../../components/interaction/service','./schedule.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','exports','multer','util','path'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x059a,0xb1));var _0xa059=function(_0x183c00,_0x5327b8){_0x183c00=_0x183c00-0x0;var _0x4a8361=_0x059a[_0x183c00];return _0x4a8361;};'use strict';var multer=require(_0xa059('0x0'));var util=require(_0xa059('0x1'));var path=require(_0xa059('0x2'));var timeout=require('connect-timeout');var express=require(_0xa059('0x3'));var router=express['Router']();var fs_extra=require(_0xa059('0x4'));var auth=require(_0xa059('0x5'));var interaction=require(_0xa059('0x6'));var config=require('../../config/environment');var controller=require(_0xa059('0x7'));router[_0xa059('0x8')]('/',auth[_0xa059('0x9')](),controller[_0xa059('0xa')]);router[_0xa059('0x8')](_0xa059('0xb'),auth[_0xa059('0x9')](),controller[_0xa059('0xc')]);router[_0xa059('0x8')]('/:id/run',auth['isAuthenticated'](),controller['run']);router[_0xa059('0xd')]('/',auth[_0xa059('0x9')](),controller[_0xa059('0xe')]);router[_0xa059('0xf')](_0xa059('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xa059('0x10')]('/:id',auth[_0xa059('0x9')](),controller['destroy']);module[_0xa059('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 1a39c72..aa6fa82 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 _0x55bb=['days','hours','csv','pdf','xlsx','custom','default','BOOLEAN','TEXT','exports','STRING','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters','months','weeks'];(function(_0x56be45,_0x10cd0e){var _0x1b75d3=function(_0x314616){while(--_0x314616){_0x56be45['push'](_0x56be45['shift']());}};_0x1b75d3(++_0x10cd0e);}(_0x55bb,0x185));var _0xb55b=function(_0x230753,_0x2966d6){_0x230753=_0x230753-0x0;var _0x4a57b9=_0x55bb[_0x230753];return _0x4a57b9;};'use strict';var Sequelize=require('sequelize');module[_0xb55b('0x0')]={'name':{'type':Sequelize[_0xb55b('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xb55b('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xb55b('0x2')},'startAt':{'type':Sequelize[_0xb55b('0x3')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xb55b('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xb55b('0x5')](_0xb55b('0x6'),_0xb55b('0x7'),_0xb55b('0x8'),_0xb55b('0x9'),_0xb55b('0xa'),_0xb55b('0xb'),'minutes'),'allowNull':![],'defaultValue':_0xb55b('0xa')},'output':{'type':Sequelize[_0xb55b('0x5')](_0xb55b('0xc'),_0xb55b('0xd'),_0xb55b('0xe')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0xb55b('0x5')](_0xb55b('0xf'),_0xb55b('0x10')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0xb55b('0x11')],'defaultValue':![]},'email':{'type':Sequelize[_0xb55b('0x1')]},'cc':{'type':Sequelize[_0xb55b('0x12')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x180b=['0\x200\x20*\x20*\x20*','DATE','INTEGER','quarters','months','weeks','days','minutes','ENUM','csv','custom','default','TEXT','sequelize','STRING','BOOLEAN'];(function(_0x15dff0,_0x3e3ac3){var _0x3ee9fd=function(_0x2bc1bd){while(--_0x2bc1bd){_0x15dff0['push'](_0x15dff0['shift']());}};_0x3ee9fd(++_0x3e3ac3);}(_0x180b,0xad));var _0xb180=function(_0x1472b0,_0x1d2acc){_0x1472b0=_0x1472b0-0x0;var _0x195fd0=_0x180b[_0x1472b0];return _0x195fd0;};'use strict';var Sequelize=require(_0xb180('0x0'));module['exports']={'name':{'type':Sequelize[_0xb180('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xb180('0x1')]},'active':{'type':Sequelize[_0xb180('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xb180('0x1')],'allowNull':![],'defaultValue':_0xb180('0x3')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0xb180('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xb180('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM']('years',_0xb180('0x6'),_0xb180('0x7'),_0xb180('0x8'),_0xb180('0x9'),'hours',_0xb180('0xa')),'allowNull':![],'defaultValue':_0xb180('0x9')},'output':{'type':Sequelize[_0xb180('0xb')]('csv','pdf','xlsx'),'allowNull':![],'defaultValue':_0xb180('0xc')},'type':{'type':Sequelize[_0xb180('0xb')](_0xb180('0xd'),_0xb180('0xe')),'allowNull':![],'defaultValue':_0xb180('0xd')},'sendMail':{'type':Sequelize[_0xb180('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0xb180('0x1')]},'cc':{'type':Sequelize[_0xb180('0xf')]},'bcc':{'type':Sequelize[_0xb180('0xf')]},'sendIfEmpty':{'type':Sequelize[_0xb180('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 c574973..e89cc21 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 _0x3398=['VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','../../config/schedule','run','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','json','offset','undefined','limit','count','status','set','Content-Range','reject','save','update','destroy','then','get','UserProfileResource','end','sendStatus','error','name','index','map','Schedule','rawAttributes','fieldName','key','keys','filters','attributes','intersection','model','fields','query','hasOwnProperty','nolimit','sort','where','filter','merge','type'];(function(_0x31c9b0,_0x3b3bfa){var _0x3c117b=function(_0x1d2e52){while(--_0x1d2e52){_0x31c9b0['push'](_0x31c9b0['shift']());}};_0x3c117b(++_0x3b3bfa);}(_0x3398,0x1be));var _0x8339=function(_0x3242fe,_0x3e1fff){_0x3242fe=_0x3242fe-0x0;var _0x4532c5=_0x3398[_0x3242fe];return _0x4532c5;};'use strict';var emlformat=require(_0x8339('0x0'));var rimraf=require(_0x8339('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8339('0x2'));var moment=require(_0x8339('0x3'));var BPromise=require(_0x8339('0x4'));var Mustache=require(_0x8339('0x5'));var util=require(_0x8339('0x6'));var path=require(_0x8339('0x7'));var sox=require(_0x8339('0x8'));var csv=require('to-csv');var ejs=require(_0x8339('0x9'));var fs=require('fs');var fs_extra=require(_0x8339('0xa'));var _=require(_0x8339('0xb'));var squel=require(_0x8339('0xc'));var crypto=require(_0x8339('0xd'));var jsforce=require(_0x8339('0xe'));var deskjs=require(_0x8339('0xf'));var toCsv=require('to-csv');var querystring=require(_0x8339('0x10'));var Papa=require(_0x8339('0x11'));var Redis=require(_0x8339('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8339('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8339('0x14'))(_0x8339('0x15'));var utils=require(_0x8339('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x8339('0x17'));var db=require(_0x8339('0x18'))['db'];function respondWithStatusCode(_0x6ee24c,_0x10e7ed){_0x10e7ed=_0x10e7ed||0xcc;return function(_0x34c832){if(_0x34c832){return _0x6ee24c['sendStatus'](_0x10e7ed);}return _0x6ee24c['status'](_0x10e7ed)['end']();};}function respondWithResult(_0x57799e,_0x3f6fff){_0x3f6fff=_0x3f6fff||0xc8;return function(_0x4382cc){if(_0x4382cc){return _0x57799e['status'](_0x3f6fff)[_0x8339('0x19')](_0x4382cc);}};}function respondWithFilteredResult(_0x482404,_0x246a55){return function(_0x53efca){if(_0x53efca){var _0x517ae6=typeof _0x246a55[_0x8339('0x1a')]===_0x8339('0x1b')&&typeof _0x246a55[_0x8339('0x1c')]===_0x8339('0x1b');var _0x5b7884=_0x53efca['count'];var _0x377df3=_0x517ae6?0x0:_0x246a55[_0x8339('0x1a')];var _0x323577=_0x517ae6?_0x53efca[_0x8339('0x1d')]:_0x246a55[_0x8339('0x1a')]+_0x246a55[_0x8339('0x1c')];var _0xb8e700;if(_0x323577>=_0x5b7884){_0x323577=_0x5b7884;_0xb8e700=0xc8;}else{_0xb8e700=0xce;}_0x482404[_0x8339('0x1e')](_0xb8e700);return _0x482404[_0x8339('0x1f')](_0x8339('0x20'),_0x377df3+'-'+_0x323577+'/'+_0x5b7884)[_0x8339('0x19')](_0x53efca);}return null;};}function patchUpdates(_0x4b8b7d){return function(_0x17abbc){try{jsonpatch['apply'](_0x17abbc,_0x4b8b7d,!![]);}catch(_0x27bfdc){return BPromise[_0x8339('0x21')](_0x27bfdc);}return _0x17abbc[_0x8339('0x22')]();};}function saveUpdates(_0x48ff50,_0x34a6cc){return function(_0x174c05){if(_0x174c05){return _0x174c05[_0x8339('0x23')](_0x48ff50)['then'](function(_0x3550d1){return _0x3550d1;});}return null;};}function removeEntity(_0x352c25,_0x289ab2){return function(_0x14d1c9){if(_0x14d1c9){return _0x14d1c9[_0x8339('0x24')]()[_0x8339('0x25')](function(){var _0x25cb9c=_0x14d1c9[_0x8339('0x26')]({'plain':!![]});var _0x11dd03='Scheduler';return db[_0x8339('0x27')][_0x8339('0x24')]({'where':{'type':_0x11dd03,'resourceId':_0x25cb9c['id']}})['then'](function(){return _0x14d1c9;});})[_0x8339('0x25')](function(){_0x352c25[_0x8339('0x1e')](0xcc)[_0x8339('0x28')]();});}};}function handleEntityNotFound(_0x47dabd,_0x316fa4){return function(_0x11d74b){if(!_0x11d74b){_0x47dabd[_0x8339('0x29')](0x194);}return _0x11d74b;};}function handleError(_0x36c9f2,_0x45ee04){_0x45ee04=_0x45ee04||0x1f4;return function(_0x5ecf05){logger[_0x8339('0x2a')](_0x5ecf05['stack']);if(_0x5ecf05[_0x8339('0x2b')]){delete _0x5ecf05['name'];}_0x36c9f2[_0x8339('0x1e')](_0x45ee04)['send'](_0x5ecf05);};}exports[_0x8339('0x2c')]=function(_0x4d5d4e,_0x278ca9){var _0x2ffdeb={},_0x46c970={},_0x300193={'count':0x0,'rows':[]};var _0x15ce9b=_[_0x8339('0x2d')](db[_0x8339('0x2e')][_0x8339('0x2f')],function(_0x478943){return{'name':_0x478943[_0x8339('0x30')],'type':_0x478943['type'][_0x8339('0x31')]};});_0x46c970['model']=_[_0x8339('0x2d')](_0x15ce9b,_0x8339('0x2b'));_0x46c970['query']=_[_0x8339('0x32')](_0x4d5d4e['query']);_0x46c970[_0x8339('0x33')]=_['intersection'](_0x46c970['model'],_0x46c970['query']);_0x2ffdeb[_0x8339('0x34')]=_[_0x8339('0x35')](_0x46c970[_0x8339('0x36')],qs[_0x8339('0x37')](_0x4d5d4e[_0x8339('0x38')]['fields']));_0x2ffdeb[_0x8339('0x34')]=_0x2ffdeb[_0x8339('0x34')]['length']?_0x2ffdeb[_0x8339('0x34')]:_0x46c970['model'];if(!_0x4d5d4e[_0x8339('0x38')][_0x8339('0x39')](_0x8339('0x3a'))){_0x2ffdeb[_0x8339('0x1c')]=qs[_0x8339('0x1c')](_0x4d5d4e[_0x8339('0x38')][_0x8339('0x1c')]);_0x2ffdeb['offset']=qs[_0x8339('0x1a')](_0x4d5d4e[_0x8339('0x38')][_0x8339('0x1a')]);}_0x2ffdeb['order']=qs[_0x8339('0x3b')](_0x4d5d4e[_0x8339('0x38')][_0x8339('0x3b')]);_0x2ffdeb[_0x8339('0x3c')]=qs[_0x8339('0x33')](_['pick'](_0x4d5d4e[_0x8339('0x38')],_0x46c970[_0x8339('0x33')]),_0x15ce9b);if(_0x4d5d4e[_0x8339('0x38')][_0x8339('0x3d')]){_0x2ffdeb[_0x8339('0x3c')]=_[_0x8339('0x3e')](_0x2ffdeb['where'],{'$or':_[_0x8339('0x2d')](_0x15ce9b,function(_0x5d1436){if(_0x5d1436[_0x8339('0x3f')]!==_0x8339('0x40')){var _0x590df6={};_0x590df6[_0x5d1436[_0x8339('0x2b')]]={'$like':'%'+_0x4d5d4e[_0x8339('0x38')][_0x8339('0x3d')]+'%'};return _0x590df6;}})});}_0x2ffdeb=_['merge']({},_0x2ffdeb,_0x4d5d4e[_0x8339('0x41')]);var _0x1ac58f={'where':_0x2ffdeb[_0x8339('0x3c')]};return db[_0x8339('0x2e')][_0x8339('0x1d')](_0x1ac58f)[_0x8339('0x25')](function(_0x38aee2){_0x300193['count']=_0x38aee2;if(_0x4d5d4e[_0x8339('0x38')][_0x8339('0x42')]){_0x2ffdeb[_0x8339('0x43')]=[{'all':!![]}];}return db[_0x8339('0x2e')][_0x8339('0x44')](_0x2ffdeb);})[_0x8339('0x25')](function(_0x41e2c2){_0x300193[_0x8339('0x45')]=_0x41e2c2;return _0x300193;})[_0x8339('0x25')](respondWithFilteredResult(_0x278ca9,_0x2ffdeb))[_0x8339('0x46')](handleError(_0x278ca9,null));};exports[_0x8339('0x47')]=function(_0x147d08,_0xd1e126){var _0x37d58c={'raw':![],'where':{'id':_0x147d08[_0x8339('0x48')]['id']}},_0x10ef3c={};_0x10ef3c[_0x8339('0x36')]=_[_0x8339('0x32')](db[_0x8339('0x2e')][_0x8339('0x2f')]);_0x10ef3c[_0x8339('0x38')]=_[_0x8339('0x32')](_0x147d08[_0x8339('0x38')]);_0x10ef3c[_0x8339('0x33')]=_[_0x8339('0x35')](_0x10ef3c[_0x8339('0x36')],_0x10ef3c['query']);_0x37d58c[_0x8339('0x34')]=_[_0x8339('0x35')](_0x10ef3c[_0x8339('0x36')],qs['fields'](_0x147d08['query'][_0x8339('0x37')]));_0x37d58c[_0x8339('0x34')]=_0x37d58c[_0x8339('0x34')][_0x8339('0x49')]?_0x37d58c['attributes']:_0x10ef3c[_0x8339('0x36')];if(_0x147d08['query']['includeAll']){_0x37d58c[_0x8339('0x43')]=[{'all':!![]}];}_0x37d58c=_['merge']({},_0x37d58c,_0x147d08[_0x8339('0x41')]);return db[_0x8339('0x2e')][_0x8339('0x4a')](_0x37d58c)['then'](handleEntityNotFound(_0xd1e126,null))[_0x8339('0x25')](respondWithResult(_0xd1e126,null))['catch'](handleError(_0xd1e126,null));};exports[_0x8339('0x4b')]=function(_0x16e736,_0x3db522){return db[_0x8339('0x2e')][_0x8339('0x4b')](_0x16e736['body'],{})[_0x8339('0x25')](function(_0x1f55f6){var _0x34d367=_0x16e736[_0x8339('0x4c')][_0x8339('0x26')]({'plain':!![]});if(!_0x34d367)throw new Error(_0x8339('0x4d'));if(_0x34d367[_0x8339('0x4e')]===_0x8339('0x4c')){var _0xc981e3=_0x1f55f6[_0x8339('0x26')]({'plain':!![]});var _0x424d36='Scheduler';return db[_0x8339('0x4f')]['find']({'where':{'name':_0x424d36,'userProfileId':_0x34d367['userProfileId']},'raw':!![]})[_0x8339('0x25')](function(_0x1f20d6){if(_0x1f20d6&&_0x1f20d6[_0x8339('0x50')]===0x0){return db['UserProfileResource'][_0x8339('0x4b')]({'name':_0xc981e3[_0x8339('0x2b')],'resourceId':_0xc981e3['id'],'type':_0x1f20d6[_0x8339('0x2b')],'sectionId':_0x1f20d6['id']},{})[_0x8339('0x25')](function(){return _0x1f55f6;});}else{return _0x1f55f6;}})[_0x8339('0x46')](function(_0x59b813){logger['error'](_0x8339('0x51'),_0x59b813);throw _0x59b813;});}return _0x1f55f6;})['then'](respondWithResult(_0x3db522,0xc9))[_0x8339('0x46')](handleError(_0x3db522,null));};exports[_0x8339('0x23')]=function(_0x4bc218,_0x34c3b6){if(_0x4bc218[_0x8339('0x52')]['id']){delete _0x4bc218[_0x8339('0x52')]['id'];}return db[_0x8339('0x2e')][_0x8339('0x4a')]({'where':{'id':_0x4bc218['params']['id']}})[_0x8339('0x25')](handleEntityNotFound(_0x34c3b6,null))['then'](saveUpdates(_0x4bc218[_0x8339('0x52')],null))[_0x8339('0x25')](respondWithResult(_0x34c3b6,null))[_0x8339('0x46')](handleError(_0x34c3b6,null));};exports['destroy']=function(_0x381198,_0x55966d){return db[_0x8339('0x2e')][_0x8339('0x4a')]({'where':{'id':_0x381198[_0x8339('0x48')]['id']}})[_0x8339('0x25')](handleEntityNotFound(_0x55966d,null))['then'](removeEntity(_0x55966d,null))['catch'](handleError(_0x55966d,null));};exports['run']=function(_0x3273d3,_0x253911,_0x1b00c9){var _0x128faf=require(_0x8339('0x53'));return db[_0x8339('0x2e')][_0x8339('0x4a')]({'where':{'id':_0x3273d3[_0x8339('0x48')]['id']},'raw':!![]})[_0x8339('0x25')](handleEntityNotFound(_0x253911,null))['then'](function(){_0x128faf[_0x8339('0x54')](_0x3273d3[_0x8339('0x48')]['id']);})[_0x8339('0x25')](respondWithStatusCode(_0x253911,null))['catch'](handleError(_0x253911,null));}; \ No newline at end of file +var _0x5527=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','destroy','then','Scheduler','UserProfileResource','end','error','name','send','index','map','Schedule','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','../../config/schedule','eml-format','rimraf','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0x5527,0x1df));var _0x7552=function(_0x446c13,_0x144936){_0x446c13=_0x446c13-0x0;var _0x9ee915=_0x5527[_0x446c13];return _0x9ee915;};'use strict';var emlformat=require(_0x7552('0x0'));var rimraf=require(_0x7552('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7552('0x2'));var moment=require('moment');var BPromise=require(_0x7552('0x3'));var Mustache=require(_0x7552('0x4'));var util=require(_0x7552('0x5'));var path=require(_0x7552('0x6'));var sox=require('sox');var csv=require(_0x7552('0x7'));var ejs=require(_0x7552('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7552('0x9'));var squel=require(_0x7552('0xa'));var crypto=require(_0x7552('0xb'));var jsforce=require(_0x7552('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x7552('0x7'));var querystring=require(_0x7552('0xd'));var Papa=require('papaparse');var Redis=require(_0x7552('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x7552('0xf'));var as=require(_0x7552('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7552('0x11'))(_0x7552('0x12'));var utils=require(_0x7552('0x13'));var config=require(_0x7552('0x14'));var licenseUtil=require(_0x7552('0x15'));var db=require(_0x7552('0x16'))['db'];function respondWithStatusCode(_0x4e4968,_0x8e849a){_0x8e849a=_0x8e849a||0xcc;return function(_0x47d4ba){if(_0x47d4ba){return _0x4e4968['sendStatus'](_0x8e849a);}return _0x4e4968[_0x7552('0x17')](_0x8e849a)['end']();};}function respondWithResult(_0x43afab,_0x55f904){_0x55f904=_0x55f904||0xc8;return function(_0x4f86ab){if(_0x4f86ab){return _0x43afab[_0x7552('0x17')](_0x55f904)[_0x7552('0x18')](_0x4f86ab);}};}function respondWithFilteredResult(_0x22d609,_0x3a099c){return function(_0x288e44){if(_0x288e44){var _0x14f146=typeof _0x3a099c[_0x7552('0x19')]==='undefined'&&typeof _0x3a099c[_0x7552('0x1a')]===_0x7552('0x1b');var _0x252085=_0x288e44[_0x7552('0x1c')];var _0x1cc3f6=_0x14f146?0x0:_0x3a099c[_0x7552('0x19')];var _0x1c1d3b=_0x14f146?_0x288e44[_0x7552('0x1c')]:_0x3a099c['offset']+_0x3a099c['limit'];var _0x3e1ec9;if(_0x1c1d3b>=_0x252085){_0x1c1d3b=_0x252085;_0x3e1ec9=0xc8;}else{_0x3e1ec9=0xce;}_0x22d609[_0x7552('0x17')](_0x3e1ec9);return _0x22d609[_0x7552('0x1d')](_0x7552('0x1e'),_0x1cc3f6+'-'+_0x1c1d3b+'/'+_0x252085)['json'](_0x288e44);}return null;};}function patchUpdates(_0x223ebd){return function(_0x598cfa){try{jsonpatch[_0x7552('0x1f')](_0x598cfa,_0x223ebd,!![]);}catch(_0x4ab245){return BPromise[_0x7552('0x20')](_0x4ab245);}return _0x598cfa['save']();};}function saveUpdates(_0x116e8d,_0x4757a1){return function(_0x4e0161){if(_0x4e0161){return _0x4e0161[_0x7552('0x21')](_0x116e8d)['then'](function(_0x25b904){return _0x25b904;});}return null;};}function removeEntity(_0x1dfffd,_0x99a836){return function(_0x46c0ea){if(_0x46c0ea){return _0x46c0ea[_0x7552('0x22')]()[_0x7552('0x23')](function(){var _0x477e69=_0x46c0ea['get']({'plain':!![]});var _0x2b2cc3=_0x7552('0x24');return db[_0x7552('0x25')]['destroy']({'where':{'type':_0x2b2cc3,'resourceId':_0x477e69['id']}})['then'](function(){return _0x46c0ea;});})['then'](function(){_0x1dfffd[_0x7552('0x17')](0xcc)[_0x7552('0x26')]();});}};}function handleEntityNotFound(_0x5604aa,_0x412a78){return function(_0x3a0382){if(!_0x3a0382){_0x5604aa['sendStatus'](0x194);}return _0x3a0382;};}function handleError(_0x29c187,_0x35364a){_0x35364a=_0x35364a||0x1f4;return function(_0x5f4418){logger[_0x7552('0x27')](_0x5f4418['stack']);if(_0x5f4418[_0x7552('0x28')]){delete _0x5f4418[_0x7552('0x28')];}_0x29c187['status'](_0x35364a)[_0x7552('0x29')](_0x5f4418);};}exports[_0x7552('0x2a')]=function(_0x59c5c1,_0x90ac41){var _0x31719f={},_0x10a7e9={},_0x690230={'count':0x0,'rows':[]};var _0x43e876=_[_0x7552('0x2b')](db[_0x7552('0x2c')]['rawAttributes'],function(_0x383dac){return{'name':_0x383dac[_0x7552('0x2d')],'type':_0x383dac[_0x7552('0x2e')][_0x7552('0x2f')]};});_0x10a7e9[_0x7552('0x30')]=_[_0x7552('0x2b')](_0x43e876,_0x7552('0x28'));_0x10a7e9[_0x7552('0x31')]=_[_0x7552('0x32')](_0x59c5c1[_0x7552('0x31')]);_0x10a7e9[_0x7552('0x33')]=_[_0x7552('0x34')](_0x10a7e9[_0x7552('0x30')],_0x10a7e9['query']);_0x31719f['attributes']=_[_0x7552('0x34')](_0x10a7e9[_0x7552('0x30')],qs[_0x7552('0x35')](_0x59c5c1[_0x7552('0x31')][_0x7552('0x35')]));_0x31719f[_0x7552('0x36')]=_0x31719f['attributes'][_0x7552('0x37')]?_0x31719f[_0x7552('0x36')]:_0x10a7e9[_0x7552('0x30')];if(!_0x59c5c1[_0x7552('0x31')][_0x7552('0x38')](_0x7552('0x39'))){_0x31719f[_0x7552('0x1a')]=qs[_0x7552('0x1a')](_0x59c5c1[_0x7552('0x31')][_0x7552('0x1a')]);_0x31719f[_0x7552('0x19')]=qs['offset'](_0x59c5c1[_0x7552('0x31')]['offset']);}_0x31719f[_0x7552('0x3a')]=qs[_0x7552('0x3b')](_0x59c5c1['query'][_0x7552('0x3b')]);_0x31719f[_0x7552('0x3c')]=qs[_0x7552('0x33')](_['pick'](_0x59c5c1[_0x7552('0x31')],_0x10a7e9[_0x7552('0x33')]),_0x43e876);if(_0x59c5c1[_0x7552('0x31')][_0x7552('0x3d')]){_0x31719f[_0x7552('0x3c')]=_[_0x7552('0x3e')](_0x31719f['where'],{'$or':_[_0x7552('0x2b')](_0x43e876,function(_0x4c602b){if(_0x4c602b[_0x7552('0x2e')]!=='VIRTUAL'){var _0x184d2e={};_0x184d2e[_0x4c602b[_0x7552('0x28')]]={'$like':'%'+_0x59c5c1[_0x7552('0x31')][_0x7552('0x3d')]+'%'};return _0x184d2e;}})});}_0x31719f=_['merge']({},_0x31719f,_0x59c5c1[_0x7552('0x3f')]);var _0x341919={'where':_0x31719f[_0x7552('0x3c')]};return db['Schedule']['count'](_0x341919)[_0x7552('0x23')](function(_0x2a9cef){_0x690230[_0x7552('0x1c')]=_0x2a9cef;if(_0x59c5c1['query'][_0x7552('0x40')]){_0x31719f[_0x7552('0x41')]=[{'all':!![]}];}return db[_0x7552('0x2c')][_0x7552('0x42')](_0x31719f);})[_0x7552('0x23')](function(_0xac0965){_0x690230[_0x7552('0x43')]=_0xac0965;return _0x690230;})[_0x7552('0x23')](respondWithFilteredResult(_0x90ac41,_0x31719f))[_0x7552('0x44')](handleError(_0x90ac41,null));};exports[_0x7552('0x45')]=function(_0x27d782,_0x3b850f){var _0x347312={'raw':![],'where':{'id':_0x27d782[_0x7552('0x46')]['id']}},_0x4a54de={};_0x4a54de[_0x7552('0x30')]=_[_0x7552('0x32')](db[_0x7552('0x2c')][_0x7552('0x47')]);_0x4a54de[_0x7552('0x31')]=_['keys'](_0x27d782['query']);_0x4a54de[_0x7552('0x33')]=_[_0x7552('0x34')](_0x4a54de[_0x7552('0x30')],_0x4a54de[_0x7552('0x31')]);_0x347312[_0x7552('0x36')]=_[_0x7552('0x34')](_0x4a54de[_0x7552('0x30')],qs['fields'](_0x27d782[_0x7552('0x31')][_0x7552('0x35')]));_0x347312[_0x7552('0x36')]=_0x347312['attributes'][_0x7552('0x37')]?_0x347312[_0x7552('0x36')]:_0x4a54de[_0x7552('0x30')];if(_0x27d782[_0x7552('0x31')][_0x7552('0x40')]){_0x347312[_0x7552('0x41')]=[{'all':!![]}];}_0x347312=_[_0x7552('0x3e')]({},_0x347312,_0x27d782[_0x7552('0x3f')]);return db['Schedule']['find'](_0x347312)['then'](handleEntityNotFound(_0x3b850f,null))[_0x7552('0x23')](respondWithResult(_0x3b850f,null))[_0x7552('0x44')](handleError(_0x3b850f,null));};exports[_0x7552('0x48')]=function(_0xc27b3,_0x28812a){return db[_0x7552('0x2c')]['create'](_0xc27b3[_0x7552('0x49')],{})[_0x7552('0x23')](function(_0x10a8eb){var _0x384351=_0xc27b3[_0x7552('0x4a')]['get']({'plain':!![]});if(!_0x384351)throw new Error(_0x7552('0x4b'));if(_0x384351['role']===_0x7552('0x4a')){var _0x499dc6=_0x10a8eb[_0x7552('0x4c')]({'plain':!![]});var _0x43c9fd='Scheduler';return db[_0x7552('0x4d')][_0x7552('0x4e')]({'where':{'name':_0x43c9fd,'userProfileId':_0x384351[_0x7552('0x4f')]},'raw':!![]})['then'](function(_0x31699b){if(_0x31699b&&_0x31699b[_0x7552('0x50')]===0x0){return db[_0x7552('0x25')]['create']({'name':_0x499dc6[_0x7552('0x28')],'resourceId':_0x499dc6['id'],'type':_0x31699b[_0x7552('0x28')],'sectionId':_0x31699b['id']},{})[_0x7552('0x23')](function(){return _0x10a8eb;});}else{return _0x10a8eb;}})[_0x7552('0x44')](function(_0x4b78ee){logger[_0x7552('0x27')](_0x7552('0x51'),_0x4b78ee);throw _0x4b78ee;});}return _0x10a8eb;})[_0x7552('0x23')](respondWithResult(_0x28812a,0xc9))[_0x7552('0x44')](handleError(_0x28812a,null));};exports['update']=function(_0x5d1cc4,_0x4f0b1b){if(_0x5d1cc4[_0x7552('0x49')]['id']){delete _0x5d1cc4[_0x7552('0x49')]['id'];}return db[_0x7552('0x2c')][_0x7552('0x4e')]({'where':{'id':_0x5d1cc4[_0x7552('0x46')]['id']}})[_0x7552('0x23')](handleEntityNotFound(_0x4f0b1b,null))[_0x7552('0x23')](saveUpdates(_0x5d1cc4['body'],null))['then'](respondWithResult(_0x4f0b1b,null))[_0x7552('0x44')](handleError(_0x4f0b1b,null));};exports[_0x7552('0x22')]=function(_0x2aa653,_0x41a061){return db['Schedule'][_0x7552('0x4e')]({'where':{'id':_0x2aa653[_0x7552('0x46')]['id']}})[_0x7552('0x23')](handleEntityNotFound(_0x41a061,null))[_0x7552('0x23')](removeEntity(_0x41a061,null))['catch'](handleError(_0x41a061,null));};exports['run']=function(_0x5a7f0d,_0x48ac5f,_0x332042){var _0x3a2ba8=require(_0x7552('0x52'));return db[_0x7552('0x2c')]['find']({'where':{'id':_0x5a7f0d[_0x7552('0x46')]['id']},'raw':!![]})[_0x7552('0x23')](handleEntityNotFound(_0x48ac5f,null))['then'](function(){_0x3a2ba8['run'](_0x5a7f0d[_0x7552('0x46')]['id']);})[_0x7552('0x23')](respondWithStatusCode(_0x48ac5f,null))[_0x7552('0x44')](handleError(_0x48ac5f,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 92d437c..d7ae600 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 _0x998b=['bluebird','request-promise','rimraf','../../config/environment','exports','define','tools_schedules','util','../../config/logger','api','moment'];(function(_0x4696f6,_0x3c9be6){var _0x796810=function(_0x2f67fc){while(--_0x2f67fc){_0x4696f6['push'](_0x4696f6['shift']());}};_0x796810(++_0x3c9be6);}(_0x998b,0x96));var _0xb998=function(_0x2947a7,_0x514668){_0x2947a7=_0x2947a7-0x0;var _0x15c8a8=_0x998b[_0x2947a7];return _0x15c8a8;};'use strict';var _=require('lodash');var util=require(_0xb998('0x0'));var logger=require(_0xb998('0x1'))(_0xb998('0x2'));var moment=require(_0xb998('0x3'));var BPromise=require(_0xb998('0x4'));var rp=require(_0xb998('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb998('0x6'));var config=require(_0xb998('0x7'));var attributes=require('./schedule.attributes');module[_0xb998('0x8')]=function(_0x5a12ad,_0x15f6f0){return _0x5a12ad[_0xb998('0x9')]('Schedule',attributes,{'tableName':_0xb998('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2cd9=['rimraf','../../config/environment','exports','tools_schedules','lodash','util','moment','bluebird','request-promise','path'];(function(_0x34c55a,_0x35d6f1){var _0x4c9318=function(_0x4b9a80){while(--_0x4b9a80){_0x34c55a['push'](_0x34c55a['shift']());}};_0x4c9318(++_0x35d6f1);}(_0x2cd9,0x194));var _0x92cd=function(_0x535ed7,_0x41b73c){_0x535ed7=_0x535ed7-0x0;var _0x52fb06=_0x2cd9[_0x535ed7];return _0x52fb06;};'use strict';var _=require(_0x92cd('0x0'));var util=require(_0x92cd('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x92cd('0x2'));var BPromise=require(_0x92cd('0x3'));var rp=require(_0x92cd('0x4'));var fs=require('fs');var path=require(_0x92cd('0x5'));var rimraf=require(_0x92cd('0x6'));var config=require(_0x92cd('0x7'));var attributes=require('./schedule.attributes');module[_0x92cd('0x8')]=function(_0x319d90,_0x5b9cd4){return _0x319d90['define']('Schedule',attributes,{'tableName':_0x92cd('0x9'),'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 8e43b97..9c6e625 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 _0x96e1=['../../config/logger','../../config/environment','jayson/promise','client','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x41e94c,_0x386a89){var _0x325eae=function(_0xc0b4aa){while(--_0xc0b4aa){_0x41e94c['push'](_0x41e94c['shift']());}};_0x325eae(++_0x386a89);}(_0x96e1,0x89));var _0x196e=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x96e1[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0x196e('0x0'));var util=require(_0x196e('0x1'));var moment=require('moment');var BPromise=require(_0x196e('0x2'));var rs=require(_0x196e('0x3'));var fs=require('fs');var Redis=require(_0x196e('0x4'));var db=require(_0x196e('0x5'))['db'];var utils=require(_0x196e('0x6'));var logger=require(_0x196e('0x7'))('rpc');var config=require(_0x196e('0x8'));var jayson=require(_0x196e('0x9'));var client=jayson[_0x196e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x245a83,_0x14de46,_0x8bf5e){return new BPromise(function(_0x402f70,_0x362187){return client[_0x196e('0xb')](_0x245a83,_0x8bf5e)[_0x196e('0xc')](function(_0x32799e){logger[_0x196e('0xd')](_0x196e('0xe'),_0x14de46,_0x196e('0xf'));logger[_0x196e('0x10')](_0x196e('0x11'),_0x14de46,'request\x20sent',JSON[_0x196e('0x12')](_0x32799e));if(_0x32799e['error']){if(_0x32799e[_0x196e('0x13')][_0x196e('0x14')]===0x1f4){logger['error'](_0x196e('0xe'),_0x14de46,_0x32799e[_0x196e('0x13')][_0x196e('0x15')]);return _0x362187(_0x32799e[_0x196e('0x13')]['message']);}logger[_0x196e('0x13')]('Schedule,\x20%s,\x20%s',_0x14de46,_0x32799e[_0x196e('0x13')][_0x196e('0x15')]);return _0x402f70(_0x32799e[_0x196e('0x13')][_0x196e('0x15')]);}else{logger[_0x196e('0xd')](_0x196e('0xe'),_0x14de46,_0x196e('0xf'));_0x402f70(_0x32799e[_0x196e('0x16')][_0x196e('0x15')]);}})[_0x196e('0x17')](function(_0x201b5f){logger[_0x196e('0x13')](_0x196e('0xe'),_0x14de46,_0x201b5f);_0x362187(_0x201b5f);});});} \ No newline at end of file +var _0xb465=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','Schedule,\x20%s,\x20%s','debug','request\x20sent','error','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4e5fe6,_0x21c6c8){var _0x502828=function(_0x22fd65){while(--_0x22fd65){_0x4e5fe6['push'](_0x4e5fe6['shift']());}};_0x502828(++_0x21c6c8);}(_0xb465,0x134));var _0x5b46=function(_0x2d439e,_0x989a77){_0x2d439e=_0x2d439e-0x0;var _0x48da61=_0xb465[_0x2d439e];return _0x48da61;};'use strict';var _=require(_0x5b46('0x0'));var util=require(_0x5b46('0x1'));var moment=require(_0x5b46('0x2'));var BPromise=require(_0x5b46('0x3'));var rs=require(_0x5b46('0x4'));var fs=require('fs');var Redis=require(_0x5b46('0x5'));var db=require(_0x5b46('0x6'))['db'];var utils=require(_0x5b46('0x7'));var logger=require(_0x5b46('0x8'))(_0x5b46('0x9'));var config=require(_0x5b46('0xa'));var jayson=require(_0x5b46('0xb'));var client=jayson[_0x5b46('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x192a1e,_0x2641ed,_0x29de8e){return new BPromise(function(_0x5c306b,_0x13efce){return client['request'](_0x192a1e,_0x29de8e)[_0x5b46('0xd')](function(_0x45cd86){logger['info'](_0x5b46('0xe'),_0x2641ed,'request\x20sent');logger[_0x5b46('0xf')]('Schedule,\x20%s,\x20%s,\x20%s',_0x2641ed,_0x5b46('0x10'),JSON['stringify'](_0x45cd86));if(_0x45cd86[_0x5b46('0x11')]){if(_0x45cd86[_0x5b46('0x11')]['code']===0x1f4){logger[_0x5b46('0x11')](_0x5b46('0xe'),_0x2641ed,_0x45cd86[_0x5b46('0x11')][_0x5b46('0x12')]);return _0x13efce(_0x45cd86['error'][_0x5b46('0x12')]);}logger['error']('Schedule,\x20%s,\x20%s',_0x2641ed,_0x45cd86[_0x5b46('0x11')][_0x5b46('0x12')]);return _0x5c306b(_0x45cd86[_0x5b46('0x11')][_0x5b46('0x12')]);}else{logger[_0x5b46('0x13')](_0x5b46('0xe'),_0x2641ed,_0x5b46('0x10'));_0x5c306b(_0x45cd86[_0x5b46('0x14')][_0x5b46('0x12')]);}})['catch'](function(_0x2fe57d){logger[_0x5b46('0x11')]('Schedule,\x20%s,\x20%s',_0x2641ed,_0x2fe57d);_0x13efce(_0x2fe57d);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 73d1758..e4427ec 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 _0xd88b=['isAuthenticated','describe','/:id','show','/:id/download','download','post','create','put','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./screenRecording.controller','get','index','/describe'];(function(_0x5246a4,_0x42f2ba){var _0x2c8235=function(_0x5a7253){while(--_0x5a7253){_0x5246a4['push'](_0x5246a4['shift']());}};_0x2c8235(++_0x42f2ba);}(_0xd88b,0x174));var _0xbd88=function(_0x52e15a,_0x4b1730){_0x52e15a=_0x52e15a-0x0;var _0x1f68e0=_0xd88b[_0x52e15a];return _0x1f68e0;};'use strict';var multer=require(_0xbd88('0x0'));var util=require(_0xbd88('0x1'));var path=require('path');var timeout=require(_0xbd88('0x2'));var express=require(_0xbd88('0x3'));var router=express[_0xbd88('0x4')]();var fs_extra=require(_0xbd88('0x5'));var auth=require(_0xbd88('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xbd88('0x7'));var controller=require(_0xbd88('0x8'));router[_0xbd88('0x9')]('/',auth['isAuthenticated'](),controller[_0xbd88('0xa')]);router[_0xbd88('0x9')](_0xbd88('0xb'),auth[_0xbd88('0xc')](),controller[_0xbd88('0xd')]);router[_0xbd88('0x9')](_0xbd88('0xe'),auth[_0xbd88('0xc')](),controller[_0xbd88('0xf')]);router['get'](_0xbd88('0x10'),auth['isAuthenticated'](),controller[_0xbd88('0x11')]);router[_0xbd88('0x12')]('/',auth['isAuthenticated'](),controller[_0xbd88('0x13')]);router[_0xbd88('0x14')]('/:id',auth[_0xbd88('0xc')](),controller[_0xbd88('0x15')]);router[_0xbd88('0x16')](_0xbd88('0xe'),auth[_0xbd88('0xc')](),controller['destroy']);module[_0xbd88('0x17')]=router; \ No newline at end of file +var _0xd333=['Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','/:id/download','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x1e0c2a,_0x27adbc){var _0x59240b=function(_0x4f4c75){while(--_0x4f4c75){_0x1e0c2a['push'](_0x1e0c2a['shift']());}};_0x59240b(++_0x27adbc);}(_0xd333,0x16b));var _0x3d33=function(_0x135104,_0xa54a21){_0x135104=_0x135104-0x0;var _0x258380=_0xd333[_0x135104];return _0x258380;};'use strict';var multer=require(_0x3d33('0x0'));var util=require(_0x3d33('0x1'));var path=require(_0x3d33('0x2'));var timeout=require(_0x3d33('0x3'));var express=require(_0x3d33('0x4'));var router=express[_0x3d33('0x5')]();var fs_extra=require(_0x3d33('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x3d33('0x7'));var config=require(_0x3d33('0x8'));var controller=require('./screenRecording.controller');router[_0x3d33('0x9')]('/',auth[_0x3d33('0xa')](),controller[_0x3d33('0xb')]);router[_0x3d33('0x9')](_0x3d33('0xc'),auth['isAuthenticated'](),controller[_0x3d33('0xd')]);router[_0x3d33('0x9')](_0x3d33('0xe'),auth['isAuthenticated'](),controller['show']);router['get'](_0x3d33('0xf'),auth[_0x3d33('0xa')](),controller['download']);router[_0x3d33('0x10')]('/',auth[_0x3d33('0xa')](),controller[_0x3d33('0x11')]);router[_0x3d33('0x12')]('/:id',auth[_0x3d33('0xa')](),controller[_0x3d33('0x13')]);router[_0x3d33('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x3d33('0x15')]);module[_0x3d33('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 49bcd33..aade10e 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 _0xba38=['moment','path','../../config/environment','VIRTUAL','value','extname','getDataValue','STRING','replace','setDataValue','INTEGER','startedAt','closedAt','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt'];(function(_0x5c6299,_0x11bd28){var _0x23b564=function(_0x329ed6){while(--_0x329ed6){_0x5c6299['push'](_0x5c6299['shift']());}};_0x23b564(++_0x11bd28);}(_0xba38,0x190));var _0x8ba3=function(_0x11fc8e,_0xa84ab3){_0x11fc8e=_0x11fc8e-0x0;var _0x13f836=_0xba38[_0x11fc8e];return _0x13f836;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x8ba3('0x0'));var path=require(_0x8ba3('0x1'));var config=require(_0x8ba3('0x2'));module['exports']={'format':{'type':Sequelize[_0x8ba3('0x3')],'get':function(){return this['getDataValue'](_0x8ba3('0x4'))?path[_0x8ba3('0x5')](this[_0x8ba3('0x6')](_0x8ba3('0x4'))):undefined;}},'interactionid':{'type':Sequelize[_0x8ba3('0x7')]},'channel':{'type':Sequelize[_0x8ba3('0x7')]},'value':{'type':Sequelize[_0x8ba3('0x7')],'set':function(_0x17276c){var _0x193e7e=_0x17276c[_0x8ba3('0x8')](/\\/g,'/');this[_0x8ba3('0x9')](_0x8ba3('0x4'),_0x193e7e);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x8ba3('0xa')],'set':function(_0x3041b5){this['setDataValue'](_0x8ba3('0xb'),moment()['subtract'](_0x3041b5,'ms'));this[_0x8ba3('0x9')](_0x8ba3('0xc'),moment());this[_0x8ba3('0x9')](_0x8ba3('0xd'),_0x3041b5);}},'startedAt':{'type':Sequelize[_0x8ba3('0xe')],'get':function(){return moment(this[_0x8ba3('0x6')](_0x8ba3('0xb')))[_0x8ba3('0xf')](_0x8ba3('0x10'))['toString']();}},'closedAt':{'type':Sequelize[_0x8ba3('0xe')],'get':function(){return moment(this[_0x8ba3('0x6')]('closedAt'))[_0x8ba3('0xf')]('MM-DD-YYYY\x20HH:mm')[_0x8ba3('0x11')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x8ba3('0x6')](_0x8ba3('0x12')))['format'](_0x8ba3('0x10'))[_0x8ba3('0x11')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x8ba3('0x6')](_0x8ba3('0x13')))['format']('MM-DD-YYYY\x20HH:mm')[_0x8ba3('0x11')]();}}}; \ No newline at end of file +var _0x7753=['extname','STRING','setDataValue','INTEGER','startedAt','subtract','closedAt','duration','format','MM-DD-YYYY\x20HH:mm','DATE','toString','updatedAt','sequelize','moment','path','../../config/environment','exports','getDataValue','value'];(function(_0x5e0019,_0x4021a1){var _0x12000d=function(_0x4ff8b3){while(--_0x4ff8b3){_0x5e0019['push'](_0x5e0019['shift']());}};_0x12000d(++_0x4021a1);}(_0x7753,0xfd));var _0x3775=function(_0x470b0a,_0x2889d6){_0x470b0a=_0x470b0a-0x0;var _0x4463f6=_0x7753[_0x470b0a];return _0x4463f6;};'use strict';var Sequelize=require(_0x3775('0x0'));var moment=require(_0x3775('0x1'));var path=require(_0x3775('0x2'));var config=require(_0x3775('0x3'));module[_0x3775('0x4')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x3775('0x5')](_0x3775('0x6'))?path[_0x3775('0x7')](this['getDataValue'](_0x3775('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0x3775('0x8')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0x3775('0x8')],'set':function(_0x1daf10){var _0x515eec=_0x1daf10['replace'](/\\/g,'/');this[_0x3775('0x9')](_0x3775('0x6'),_0x515eec);}},'rating':{'type':Sequelize[_0x3775('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x3775('0xa')],'set':function(_0x33223e){this['setDataValue'](_0x3775('0xb'),moment()[_0x3775('0xc')](_0x33223e,'ms'));this[_0x3775('0x9')](_0x3775('0xd'),moment());this[_0x3775('0x9')](_0x3775('0xe'),_0x33223e);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x3775('0x5')](_0x3775('0xb')))[_0x3775('0xf')](_0x3775('0x10'))['toString']();}},'closedAt':{'type':Sequelize[_0x3775('0x11')],'get':function(){return moment(this['getDataValue'](_0x3775('0xd')))[_0x3775('0xf')](_0x3775('0x10'))['toString']();}},'createdAt':{'type':Sequelize[_0x3775('0x11')],'get':function(){return moment(this['getDataValue']('createdAt'))[_0x3775('0xf')](_0x3775('0x10'))[_0x3775('0x12')]();}},'updatedAt':{'type':Sequelize[_0x3775('0x11')],'get':function(){return moment(this[_0x3775('0x5')](_0x3775('0x13')))[_0x3775('0xf')](_0x3775('0x10'))['toString']();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 725a457..9d02dfe 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 _0x84ab=['describe','download','join','existsSync','decryptFile','secrets','recording','Sequelize','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','isNil','server/files/screen_recordings','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','error','stack','name','send','rawAttributes','type','key','model','differenceBy','map','format','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','ScreenRecording','rows','params','keys','intersection','find','catch','body','createdAt','value'];(function(_0x5a5952,_0x156afe){var _0x4b638c=function(_0x4dfa19){while(--_0x4dfa19){_0x5a5952['push'](_0x5a5952['shift']());}};_0x4b638c(++_0x156afe);}(_0x84ab,0x12f));var _0xb84a=function(_0x59162a,_0x10e547){_0x59162a=_0x59162a-0x0;var _0x35e50d=_0x84ab[_0x59162a];return _0x35e50d;};'use strict';var emlformat=require(_0xb84a('0x0'));var rimraf=require(_0xb84a('0x1'));var zipdir=require(_0xb84a('0x2'));var jsonpatch=require(_0xb84a('0x3'));var rp=require(_0xb84a('0x4'));var moment=require('moment');var BPromise=require(_0xb84a('0x5'));var Mustache=require(_0xb84a('0x6'));var util=require('util');var path=require(_0xb84a('0x7'));var sox=require(_0xb84a('0x8'));var csv=require(_0xb84a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb84a('0xa'));var crypto=require('crypto');var jsforce=require(_0xb84a('0xb'));var deskjs=require(_0xb84a('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb84a('0xd'));var Papa=require('papaparse');var Redis=require(_0xb84a('0xe'));var authService=require(_0xb84a('0xf'));var qs=require(_0xb84a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb84a('0x11'));var utils=require(_0xb84a('0x12'));var config=require(_0xb84a('0x13'));var licenseUtil=require(_0xb84a('0x14'));var db=require(_0xb84a('0x15'))['db'];function respondWithStatusCode(_0x4d3758,_0x83444e){_0x83444e=_0x83444e||0xcc;return function(_0x4777dc){if(_0x4777dc){return _0x4d3758[_0xb84a('0x16')](_0x83444e);}return _0x4d3758[_0xb84a('0x17')](_0x83444e)[_0xb84a('0x18')]();};}function respondWithResult(_0x11dfe9,_0x12ccab){_0x12ccab=_0x12ccab||0xc8;return function(_0x475b){if(_0x475b){return _0x11dfe9[_0xb84a('0x17')](_0x12ccab)[_0xb84a('0x19')](_0x475b);}};}function respondWithFilteredResult(_0xc0b2e0,_0x1251ec){return function(_0x5716bd){if(_0x5716bd){var _0x11dd4d=typeof _0x1251ec[_0xb84a('0x1a')]===_0xb84a('0x1b')&&typeof _0x1251ec[_0xb84a('0x1c')]===_0xb84a('0x1b');var _0x1be87a=_0x5716bd[_0xb84a('0x1d')];var _0x34d82f=_0x11dd4d?0x0:_0x1251ec[_0xb84a('0x1a')];var _0x3f7437=_0x11dd4d?_0x5716bd[_0xb84a('0x1d')]:_0x1251ec[_0xb84a('0x1a')]+_0x1251ec[_0xb84a('0x1c')];var _0x200289;if(_0x3f7437>=_0x1be87a){_0x3f7437=_0x1be87a;_0x200289=0xc8;}else{_0x200289=0xce;}_0xc0b2e0['status'](_0x200289);return _0xc0b2e0[_0xb84a('0x1e')](_0xb84a('0x1f'),_0x34d82f+'-'+_0x3f7437+'/'+_0x1be87a)['json'](_0x5716bd);}return null;};}function patchUpdates(_0xac76d3){return function(_0x61ef03){try{jsonpatch[_0xb84a('0x20')](_0x61ef03,_0xac76d3,!![]);}catch(_0x19f637){return BPromise['reject'](_0x19f637);}return _0x61ef03['save']();};}function saveUpdates(_0x1466ae,_0x19097d){return function(_0x2d70fd){if(_0x2d70fd){return _0x2d70fd[_0xb84a('0x21')](_0x1466ae)[_0xb84a('0x22')](function(_0x3b8fb2){return _0x3b8fb2;});}return null;};}function removeEntity(_0x8b28cd,_0x21d0d3){return function(_0x3aa06f){if(_0x3aa06f){return _0x3aa06f[_0xb84a('0x23')]()[_0xb84a('0x22')](function(){_0x8b28cd[_0xb84a('0x17')](0xcc)[_0xb84a('0x18')]();});}};}function handleEntityNotFound(_0x409df0,_0x19bdfa){return function(_0x3258a9){if(!_0x3258a9){_0x409df0[_0xb84a('0x16')](0x194);}return _0x3258a9;};}function handleError(_0x3ff0bc,_0x3b6805){_0x3b6805=_0x3b6805||0x1f4;return function(_0xd468c3){logger[_0xb84a('0x24')](_0xd468c3[_0xb84a('0x25')]);if(_0xd468c3[_0xb84a('0x26')]){delete _0xd468c3[_0xb84a('0x26')];}_0x3ff0bc[_0xb84a('0x17')](_0x3b6805)[_0xb84a('0x27')](_0xd468c3);};}exports['index']=function(_0x582954,_0x4608ce){var _0x2c30b0={},_0x4dab4e={},_0x1f690a={'count':0x0,'rows':[]};var _0x36b4f4=_['map'](db['ScreenRecording'][_0xb84a('0x28')],function(_0x8e9319){return{'name':_0x8e9319['fieldName'],'type':_0x8e9319[_0xb84a('0x29')][_0xb84a('0x2a')]};});_0x4dab4e[_0xb84a('0x2b')]=_[_0xb84a('0x2c')](_[_0xb84a('0x2d')](_0x36b4f4,_0xb84a('0x26')),[_0xb84a('0x2e')]);_0x4dab4e[_0xb84a('0x2f')]=_['keys'](_0x582954[_0xb84a('0x2f')]);_0x4dab4e['filters']=_['intersection'](_0x4dab4e[_0xb84a('0x2b')],_0x4dab4e[_0xb84a('0x2f')]);_0x2c30b0['attributes']=_['intersection'](_0x4dab4e[_0xb84a('0x2b')],qs[_0xb84a('0x30')](_0x582954[_0xb84a('0x2f')][_0xb84a('0x30')]));_0x2c30b0[_0xb84a('0x31')]=_0x2c30b0[_0xb84a('0x31')][_0xb84a('0x32')]?_0x2c30b0[_0xb84a('0x31')]:_0x4dab4e['model'];if(!_0x582954[_0xb84a('0x2f')][_0xb84a('0x33')](_0xb84a('0x34'))){_0x2c30b0[_0xb84a('0x1c')]=qs[_0xb84a('0x1c')](_0x582954[_0xb84a('0x2f')][_0xb84a('0x1c')]);_0x2c30b0['offset']=qs[_0xb84a('0x1a')](_0x582954['query'][_0xb84a('0x1a')]);}_0x2c30b0[_0xb84a('0x35')]=qs[_0xb84a('0x36')](_0x582954['query']['sort']);_0x2c30b0[_0xb84a('0x37')]=qs[_0xb84a('0x38')](_[_0xb84a('0x39')](_0x582954[_0xb84a('0x2f')],_0x4dab4e[_0xb84a('0x38')]),_0x36b4f4);if(_0x582954['query'][_0xb84a('0x3a')]){_0x2c30b0[_0xb84a('0x37')]=_['merge'](_0x2c30b0[_0xb84a('0x37')],{'$or':_[_0xb84a('0x2d')](_0x36b4f4,function(_0x19634b){if(_0x19634b[_0xb84a('0x29')]!=='VIRTUAL'){var _0x57a1a8={};_0x57a1a8[_0x19634b['name']]={'$like':'%'+_0x582954[_0xb84a('0x2f')][_0xb84a('0x3a')]+'%'};return _0x57a1a8;}})});}_0x2c30b0=_[_0xb84a('0x3b')]({},_0x2c30b0,_0x582954[_0xb84a('0x3c')]);var _0x55b0b8={'where':_0x2c30b0[_0xb84a('0x37')]};return db['ScreenRecording'][_0xb84a('0x1d')](_0x55b0b8)['then'](function(_0x48db18){_0x1f690a['count']=_0x48db18;if(_0x582954[_0xb84a('0x2f')][_0xb84a('0x3d')]){_0x2c30b0[_0xb84a('0x3e')]=[{'all':!![]}];}return db[_0xb84a('0x3f')]['findAll'](_0x2c30b0);})[_0xb84a('0x22')](function(_0x42f0b6){_0x1f690a[_0xb84a('0x40')]=_0x42f0b6;return _0x1f690a;})[_0xb84a('0x22')](respondWithFilteredResult(_0x4608ce,_0x2c30b0))['catch'](handleError(_0x4608ce,null));};exports['show']=function(_0x15a621,_0x1f3e04){var _0x541cc4={'raw':![],'where':{'id':_0x15a621[_0xb84a('0x41')]['id']}},_0x1045ee={};_0x1045ee[_0xb84a('0x2b')]=_[_0xb84a('0x42')](db[_0xb84a('0x3f')][_0xb84a('0x28')]);_0x1045ee[_0xb84a('0x2f')]=_[_0xb84a('0x42')](_0x15a621[_0xb84a('0x2f')]);_0x1045ee[_0xb84a('0x38')]=_[_0xb84a('0x43')](_0x1045ee[_0xb84a('0x2b')],_0x1045ee[_0xb84a('0x2f')]);_0x541cc4[_0xb84a('0x31')]=_[_0xb84a('0x43')](_0x1045ee['model'],qs[_0xb84a('0x30')](_0x15a621[_0xb84a('0x2f')][_0xb84a('0x30')]));_0x541cc4[_0xb84a('0x31')]=_0x541cc4[_0xb84a('0x31')][_0xb84a('0x32')]?_0x541cc4['attributes']:_0x1045ee[_0xb84a('0x2b')];if(_0x15a621['query'][_0xb84a('0x3d')]){_0x541cc4[_0xb84a('0x3e')]=[{'all':!![]}];}_0x541cc4=_[_0xb84a('0x3b')]({},_0x541cc4,_0x15a621[_0xb84a('0x3c')]);return db['ScreenRecording'][_0xb84a('0x44')](_0x541cc4)[_0xb84a('0x22')](handleEntityNotFound(_0x1f3e04,null))[_0xb84a('0x22')](respondWithResult(_0x1f3e04,null))['catch'](handleError(_0x1f3e04,null));};exports['create']=function(_0x385986,_0x10b0cc){return db[_0xb84a('0x3f')]['create'](_0x385986['body'],{})['then'](respondWithResult(_0x10b0cc,0xc9))[_0xb84a('0x45')](handleError(_0x10b0cc,null));};exports[_0xb84a('0x21')]=function(_0x38f329,_0x4476bc){if(_0x38f329[_0xb84a('0x46')]['id']){delete _0x38f329['body']['id'];}delete _0x38f329['body']['duration'];delete _0x38f329['body'][_0xb84a('0x47')];delete _0x38f329[_0xb84a('0x46')]['closedAt'];delete _0x38f329[_0xb84a('0x46')][_0xb84a('0x48')];return db[_0xb84a('0x3f')][_0xb84a('0x44')]({'where':{'id':_0x38f329[_0xb84a('0x41')]['id']}})[_0xb84a('0x22')](handleEntityNotFound(_0x4476bc,null))['then'](saveUpdates(_0x38f329['body'],null))[_0xb84a('0x22')](respondWithResult(_0x4476bc,null))['catch'](handleError(_0x4476bc,null));};exports[_0xb84a('0x49')]=function(_0x4d1a29,_0x575908){return db['ScreenRecording'][_0xb84a('0x49')]()[_0xb84a('0x22')](respondWithResult(_0x575908,null))[_0xb84a('0x45')](handleError(_0x575908,null));};exports[_0xb84a('0x4a')]=function(_0x33adfc,_0x46f7eb,_0x37ca26){var _0x29ff35=require('../../components/encryptor');var _0x5afdd0=![];var _0x4c5bdf={};if(_0x33adfc[_0xb84a('0x2f')][_0xb84a('0x29')]&&_0x33adfc['query'][_0xb84a('0x29')]==='uniqueid'){_0x4c5bdf['uniqueid']=_0x33adfc['params']['id'];}else{_0x4c5bdf['id']=_0x33adfc[_0xb84a('0x41')]['id'];}return db[_0xb84a('0x3f')][_0xb84a('0x44')]({'where':_0x4c5bdf,'attributes':['id','value'],'raw':!![]})[_0xb84a('0x22')](handleEntityNotFound(_0x46f7eb,null))[_0xb84a('0x22')](function(_0x136d61){if(_0x136d61){var _0x505994=path[_0xb84a('0x4b')](config['root'],'server/files/screen_recordings',_0x136d61[_0xb84a('0x48')]);var _0x47a8a2=util[_0xb84a('0x2e')]('%s.cypher',_0x505994);if(fs[_0xb84a('0x4c')](_0x47a8a2)){_0x5afdd0=!![];return _0x29ff35[_0xb84a('0x4d')](_0x47a8a2,_0x505994,config[_0xb84a('0x4e')][_0xb84a('0x4f')])['then'](function(){return _0x136d61;});}return _0x136d61;}})['then'](function(_0x4fc998){if(_0x4fc998){var _0x40b392=path[_0xb84a('0x4b')](config['root'],'server/files/screen_recordings',_0x4fc998[_0xb84a('0x48')]);if(!fs[_0xb84a('0x4c')](_0x40b392)){throw new db[(_0xb84a('0x50'))]['ValidationError'](_0xb84a('0x51'));}if(_0x4fc998[_0xb84a('0x52')]){return _0x46f7eb['download'](_0x40b392,_0x4fc998[_0xb84a('0x52')]+path[_0xb84a('0x53')](_0x40b392),function(){if(_0x5afdd0){fs[_0xb84a('0x54')](_0x40b392);}});}else{return _0x46f7eb[_0xb84a('0x4a')](_0x40b392,function(_0x3bbc69){if(_0x5afdd0){fs[_0xb84a('0x54')](_0x40b392);}});}}})[_0xb84a('0x45')](function(_0x47c27f){if(_0x47c27f[_0xb84a('0x55')]===_0xb84a('0x51')){_0x46f7eb['status'](0x194)[_0xb84a('0x27')](_0xb84a('0x56'));}else{return handleError(_0x46f7eb,null);}});};exports[_0xb84a('0x23')]=function(_0x3e16d8,_0x347998){return db[_0xb84a('0x3f')][_0xb84a('0x44')]({'where':{'id':_0x3e16d8[_0xb84a('0x41')]['id']}})[_0xb84a('0x22')](function(_0x5dd660){if(_[_0xb84a('0x57')](_0x5dd660)){throw new ReferenceError('Entity\x20not\x20found');}return _0x5dd660;})['then'](function(_0x19d635){var _0x5e11c8=path[_0xb84a('0x4b')](config['root'],_0xb84a('0x58'),_0x19d635[_0xb84a('0x48')]);logger['info'](_0xb84a('0x59'),_0x5e11c8);if(!_[_0xb84a('0x57')](_0x19d635[_0xb84a('0x48')])&&fs[_0xb84a('0x4c')](_0x5e11c8)){logger[_0xb84a('0x5a')](_0xb84a('0x5b')+_0x5e11c8+_0xb84a('0x5c'));fs['unlinkSync'](_0x5e11c8);}_0x5e11c8=_0x5e11c8+_0xb84a('0x5d');if(!_['isNil'](_0x19d635['value'])&&fs[_0xb84a('0x4c')](_0x5e11c8)){logger[_0xb84a('0x5a')](_0xb84a('0x5b')+_0x5e11c8+_0xb84a('0x5c'));fs['unlinkSync'](_0x5e11c8);}return _0x19d635;})['then'](function(_0x43031f){if(!_0x43031f)throw new InternalError();return _0x43031f[_0xb84a('0x23')]();})[_0xb84a('0x22')](function(){_0x347998[_0xb84a('0x17')](0xcc)['end']();})[_0xb84a('0x45')](handleError(_0x347998,null));}; \ No newline at end of file +var _0xb138=['format','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','merge','options','findAll','rows','catch','params','keys','includeAll','include','find','create','body','closedAt','value','describe','download','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','%s.cypher','decryptFile','secrets','existsSync','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','Entity\x20not\x20found','info','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','../../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','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model'];(function(_0x4222b5,_0x37422c){var _0x425d4c=function(_0x53e442){while(--_0x53e442){_0x4222b5['push'](_0x4222b5['shift']());}};_0x425d4c(++_0x37422c);}(_0xb138,0x1dd));var _0x8b13=function(_0xe0dc77,_0x2c0dca){_0xe0dc77=_0xe0dc77-0x0;var _0x2c8524=_0xb138[_0xe0dc77];return _0x2c8524;};'use strict';var emlformat=require(_0x8b13('0x0'));var rimraf=require(_0x8b13('0x1'));var zipdir=require(_0x8b13('0x2'));var jsonpatch=require(_0x8b13('0x3'));var rp=require(_0x8b13('0x4'));var moment=require(_0x8b13('0x5'));var BPromise=require(_0x8b13('0x6'));var Mustache=require('mustache');var util=require(_0x8b13('0x7'));var path=require(_0x8b13('0x8'));var sox=require(_0x8b13('0x9'));var csv=require('to-csv');var ejs=require(_0x8b13('0xa'));var fs=require('fs');var fs_extra=require(_0x8b13('0xb'));var _=require('lodash');var squel=require(_0x8b13('0xc'));var crypto=require(_0x8b13('0xd'));var jsforce=require(_0x8b13('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8b13('0xf'));var querystring=require(_0x8b13('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8b13('0x11'));var qs=require(_0x8b13('0x12'));var as=require(_0x8b13('0x13'));var hardwareService=require(_0x8b13('0x14'));var logger=require(_0x8b13('0x15'))('api');var utils=require(_0x8b13('0x16'));var config=require(_0x8b13('0x17'));var licenseUtil=require(_0x8b13('0x18'));var db=require(_0x8b13('0x19'))['db'];function respondWithStatusCode(_0xb227e0,_0x1893b1){_0x1893b1=_0x1893b1||0xcc;return function(_0x58f97e){if(_0x58f97e){return _0xb227e0['sendStatus'](_0x1893b1);}return _0xb227e0[_0x8b13('0x1a')](_0x1893b1)[_0x8b13('0x1b')]();};}function respondWithResult(_0x5f12b5,_0x51a935){_0x51a935=_0x51a935||0xc8;return function(_0x479773){if(_0x479773){return _0x5f12b5[_0x8b13('0x1a')](_0x51a935)[_0x8b13('0x1c')](_0x479773);}};}function respondWithFilteredResult(_0xf29086,_0x2c615a){return function(_0x13f956){if(_0x13f956){var _0x542357=typeof _0x2c615a[_0x8b13('0x1d')]===_0x8b13('0x1e')&&typeof _0x2c615a[_0x8b13('0x1f')]===_0x8b13('0x1e');var _0x3eed21=_0x13f956[_0x8b13('0x20')];var _0x10fbde=_0x542357?0x0:_0x2c615a[_0x8b13('0x1d')];var _0x4989d3=_0x542357?_0x13f956['count']:_0x2c615a[_0x8b13('0x1d')]+_0x2c615a[_0x8b13('0x1f')];var _0x14a8ac;if(_0x4989d3>=_0x3eed21){_0x4989d3=_0x3eed21;_0x14a8ac=0xc8;}else{_0x14a8ac=0xce;}_0xf29086[_0x8b13('0x1a')](_0x14a8ac);return _0xf29086[_0x8b13('0x21')](_0x8b13('0x22'),_0x10fbde+'-'+_0x4989d3+'/'+_0x3eed21)['json'](_0x13f956);}return null;};}function patchUpdates(_0x1e8a48){return function(_0x3c4d4f){try{jsonpatch[_0x8b13('0x23')](_0x3c4d4f,_0x1e8a48,!![]);}catch(_0x54a309){return BPromise['reject'](_0x54a309);}return _0x3c4d4f[_0x8b13('0x24')]();};}function saveUpdates(_0xcb7621,_0x4f9902){return function(_0x3187ed){if(_0x3187ed){return _0x3187ed[_0x8b13('0x25')](_0xcb7621)[_0x8b13('0x26')](function(_0x213280){return _0x213280;});}return null;};}function removeEntity(_0xc05d5c,_0x583639){return function(_0x339271){if(_0x339271){return _0x339271[_0x8b13('0x27')]()['then'](function(){_0xc05d5c[_0x8b13('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x420772,_0x325d68){return function(_0x54786a){if(!_0x54786a){_0x420772[_0x8b13('0x28')](0x194);}return _0x54786a;};}function handleError(_0x3223d8,_0x4f8e58){_0x4f8e58=_0x4f8e58||0x1f4;return function(_0x134c5e){logger[_0x8b13('0x29')](_0x134c5e[_0x8b13('0x2a')]);if(_0x134c5e[_0x8b13('0x2b')]){delete _0x134c5e[_0x8b13('0x2b')];}_0x3223d8['status'](_0x4f8e58)[_0x8b13('0x2c')](_0x134c5e);};}exports[_0x8b13('0x2d')]=function(_0x3475d8,_0x1511bf){var _0x114b01={},_0x2bb51d={},_0x5ab161={'count':0x0,'rows':[]};var _0x35fdca=_[_0x8b13('0x2e')](db[_0x8b13('0x2f')][_0x8b13('0x30')],function(_0x23fde7){return{'name':_0x23fde7[_0x8b13('0x31')],'type':_0x23fde7[_0x8b13('0x32')][_0x8b13('0x33')]};});_0x2bb51d[_0x8b13('0x34')]=_['differenceBy'](_[_0x8b13('0x2e')](_0x35fdca,_0x8b13('0x2b')),[_0x8b13('0x35')]);_0x2bb51d[_0x8b13('0x36')]=_['keys'](_0x3475d8['query']);_0x2bb51d[_0x8b13('0x37')]=_['intersection'](_0x2bb51d['model'],_0x2bb51d[_0x8b13('0x36')]);_0x114b01['attributes']=_[_0x8b13('0x38')](_0x2bb51d[_0x8b13('0x34')],qs[_0x8b13('0x39')](_0x3475d8[_0x8b13('0x36')][_0x8b13('0x39')]));_0x114b01[_0x8b13('0x3a')]=_0x114b01[_0x8b13('0x3a')][_0x8b13('0x3b')]?_0x114b01[_0x8b13('0x3a')]:_0x2bb51d[_0x8b13('0x34')];if(!_0x3475d8['query'][_0x8b13('0x3c')](_0x8b13('0x3d'))){_0x114b01[_0x8b13('0x1f')]=qs[_0x8b13('0x1f')](_0x3475d8[_0x8b13('0x36')][_0x8b13('0x1f')]);_0x114b01[_0x8b13('0x1d')]=qs[_0x8b13('0x1d')](_0x3475d8['query'][_0x8b13('0x1d')]);}_0x114b01['order']=qs[_0x8b13('0x3e')](_0x3475d8[_0x8b13('0x36')][_0x8b13('0x3e')]);_0x114b01[_0x8b13('0x3f')]=qs[_0x8b13('0x37')](_[_0x8b13('0x40')](_0x3475d8['query'],_0x2bb51d['filters']),_0x35fdca);if(_0x3475d8[_0x8b13('0x36')]['filter']){_0x114b01[_0x8b13('0x3f')]=_['merge'](_0x114b01[_0x8b13('0x3f')],{'$or':_[_0x8b13('0x2e')](_0x35fdca,function(_0x29a359){if(_0x29a359[_0x8b13('0x32')]!==_0x8b13('0x41')){var _0x4e16e7={};_0x4e16e7[_0x29a359['name']]={'$like':'%'+_0x3475d8[_0x8b13('0x36')]['filter']+'%'};return _0x4e16e7;}})});}_0x114b01=_[_0x8b13('0x42')]({},_0x114b01,_0x3475d8[_0x8b13('0x43')]);var _0x4dc268={'where':_0x114b01[_0x8b13('0x3f')]};return db[_0x8b13('0x2f')][_0x8b13('0x20')](_0x4dc268)[_0x8b13('0x26')](function(_0x2f4e7f){_0x5ab161[_0x8b13('0x20')]=_0x2f4e7f;if(_0x3475d8[_0x8b13('0x36')]['includeAll']){_0x114b01['include']=[{'all':!![]}];}return db['ScreenRecording'][_0x8b13('0x44')](_0x114b01);})[_0x8b13('0x26')](function(_0x27cfe5){_0x5ab161[_0x8b13('0x45')]=_0x27cfe5;return _0x5ab161;})[_0x8b13('0x26')](respondWithFilteredResult(_0x1511bf,_0x114b01))[_0x8b13('0x46')](handleError(_0x1511bf,null));};exports['show']=function(_0x4342db,_0x50e535){var _0x13d0ef={'raw':![],'where':{'id':_0x4342db[_0x8b13('0x47')]['id']}},_0x5ce9c8={};_0x5ce9c8[_0x8b13('0x34')]=_[_0x8b13('0x48')](db[_0x8b13('0x2f')][_0x8b13('0x30')]);_0x5ce9c8[_0x8b13('0x36')]=_[_0x8b13('0x48')](_0x4342db['query']);_0x5ce9c8['filters']=_['intersection'](_0x5ce9c8[_0x8b13('0x34')],_0x5ce9c8[_0x8b13('0x36')]);_0x13d0ef[_0x8b13('0x3a')]=_[_0x8b13('0x38')](_0x5ce9c8['model'],qs['fields'](_0x4342db[_0x8b13('0x36')]['fields']));_0x13d0ef[_0x8b13('0x3a')]=_0x13d0ef[_0x8b13('0x3a')][_0x8b13('0x3b')]?_0x13d0ef[_0x8b13('0x3a')]:_0x5ce9c8[_0x8b13('0x34')];if(_0x4342db['query'][_0x8b13('0x49')]){_0x13d0ef[_0x8b13('0x4a')]=[{'all':!![]}];}_0x13d0ef=_[_0x8b13('0x42')]({},_0x13d0ef,_0x4342db[_0x8b13('0x43')]);return db[_0x8b13('0x2f')][_0x8b13('0x4b')](_0x13d0ef)[_0x8b13('0x26')](handleEntityNotFound(_0x50e535,null))[_0x8b13('0x26')](respondWithResult(_0x50e535,null))[_0x8b13('0x46')](handleError(_0x50e535,null));};exports['create']=function(_0x46d096,_0x59d863){return db[_0x8b13('0x2f')][_0x8b13('0x4c')](_0x46d096[_0x8b13('0x4d')],{})['then'](respondWithResult(_0x59d863,0xc9))[_0x8b13('0x46')](handleError(_0x59d863,null));};exports[_0x8b13('0x25')]=function(_0x257107,_0x4129c0){if(_0x257107[_0x8b13('0x4d')]['id']){delete _0x257107[_0x8b13('0x4d')]['id'];}delete _0x257107[_0x8b13('0x4d')]['duration'];delete _0x257107[_0x8b13('0x4d')]['createdAt'];delete _0x257107[_0x8b13('0x4d')][_0x8b13('0x4e')];delete _0x257107[_0x8b13('0x4d')][_0x8b13('0x4f')];return db[_0x8b13('0x2f')][_0x8b13('0x4b')]({'where':{'id':_0x257107[_0x8b13('0x47')]['id']}})[_0x8b13('0x26')](handleEntityNotFound(_0x4129c0,null))[_0x8b13('0x26')](saveUpdates(_0x257107[_0x8b13('0x4d')],null))[_0x8b13('0x26')](respondWithResult(_0x4129c0,null))[_0x8b13('0x46')](handleError(_0x4129c0,null));};exports[_0x8b13('0x50')]=function(_0x2bdfae,_0x42c29d){return db[_0x8b13('0x2f')][_0x8b13('0x50')]()['then'](respondWithResult(_0x42c29d,null))[_0x8b13('0x46')](handleError(_0x42c29d,null));};exports[_0x8b13('0x51')]=function(_0x4c19f6,_0x342fff,_0x328373){var _0x2fc00c=require(_0x8b13('0x52'));var _0x25cb45=![];var _0x12549b={};if(_0x4c19f6[_0x8b13('0x36')][_0x8b13('0x32')]&&_0x4c19f6[_0x8b13('0x36')][_0x8b13('0x32')]===_0x8b13('0x53')){_0x12549b[_0x8b13('0x53')]=_0x4c19f6[_0x8b13('0x47')]['id'];}else{_0x12549b['id']=_0x4c19f6[_0x8b13('0x47')]['id'];}return db[_0x8b13('0x2f')]['find']({'where':_0x12549b,'attributes':['id',_0x8b13('0x4f')],'raw':!![]})[_0x8b13('0x26')](handleEntityNotFound(_0x342fff,null))['then'](function(_0x11e8af){if(_0x11e8af){var _0x73aba5=path[_0x8b13('0x54')](config[_0x8b13('0x55')],_0x8b13('0x56'),_0x11e8af['value']);var _0x1fd105=util[_0x8b13('0x35')](_0x8b13('0x57'),_0x73aba5);if(fs['existsSync'](_0x1fd105)){_0x25cb45=!![];return _0x2fc00c[_0x8b13('0x58')](_0x1fd105,_0x73aba5,config[_0x8b13('0x59')]['recording'])[_0x8b13('0x26')](function(){return _0x11e8af;});}return _0x11e8af;}})[_0x8b13('0x26')](function(_0x475c8d){if(_0x475c8d){var _0xd29067=path['join'](config[_0x8b13('0x55')],_0x8b13('0x56'),_0x475c8d['value']);if(!fs[_0x8b13('0x5a')](_0xd29067)){throw new db[(_0x8b13('0x5b'))][(_0x8b13('0x5c'))](_0x8b13('0x5d'));}if(_0x475c8d['filename']){return _0x342fff[_0x8b13('0x51')](_0xd29067,_0x475c8d[_0x8b13('0x5e')]+path[_0x8b13('0x5f')](_0xd29067),function(){if(_0x25cb45){fs[_0x8b13('0x60')](_0xd29067);}});}else{return _0x342fff[_0x8b13('0x51')](_0xd29067,function(_0x2fff4e){if(_0x25cb45){fs['unlink'](_0xd29067);}});}}})[_0x8b13('0x46')](function(_0x1082d9){if(_0x1082d9[_0x8b13('0x61')]==='ScreenRecording\x20not\x20found'){_0x342fff[_0x8b13('0x1a')](0x194)[_0x8b13('0x2c')](_0x8b13('0x62'));}else{return handleError(_0x342fff,null);}});};exports[_0x8b13('0x27')]=function(_0x4d8f23,_0x59a6b3){return db['ScreenRecording']['find']({'where':{'id':_0x4d8f23['params']['id']}})[_0x8b13('0x26')](function(_0x1bc936){if(_['isNil'](_0x1bc936)){throw new ReferenceError(_0x8b13('0x63'));}return _0x1bc936;})['then'](function(_0x274bad){var _0x2d2fa3=path[_0x8b13('0x54')](config[_0x8b13('0x55')],_0x8b13('0x56'),_0x274bad[_0x8b13('0x4f')]);logger[_0x8b13('0x64')]('cancellazione\x20fisica\x20documento\x20%s',_0x2d2fa3);if(!_[_0x8b13('0x65')](_0x274bad['value'])&&fs[_0x8b13('0x5a')](_0x2d2fa3)){logger[_0x8b13('0x64')](_0x8b13('0x66')+_0x2d2fa3+_0x8b13('0x67'));fs[_0x8b13('0x68')](_0x2d2fa3);}_0x2d2fa3=_0x2d2fa3+_0x8b13('0x69');if(!_[_0x8b13('0x65')](_0x274bad['value'])&&fs[_0x8b13('0x5a')](_0x2d2fa3)){logger['info'](_0x8b13('0x66')+_0x2d2fa3+_0x8b13('0x67'));fs[_0x8b13('0x68')](_0x2d2fa3);}return _0x274bad;})[_0x8b13('0x26')](function(_0x177a64){if(!_0x177a64)throw new InternalError();return _0x177a64['destroy']();})['then'](function(){_0x59a6b3[_0x8b13('0x1a')](0xcc)[_0x8b13('0x1b')]();})['catch'](handleError(_0x59a6b3,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 6828d9f..7dd8b0c 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 _0xfb5f=['exports','define','ScreenRecording','screen_recordings','interactionid','lodash','util','../../config/logger','api','request-promise','rimraf','./screenRecording.attributes'];(function(_0x2fe0e6,_0x364b92){var _0x40916d=function(_0x17b4a4){while(--_0x17b4a4){_0x2fe0e6['push'](_0x2fe0e6['shift']());}};_0x40916d(++_0x364b92);}(_0xfb5f,0x131));var _0xffb5=function(_0x5974e1,_0x381f9c){_0x5974e1=_0x5974e1-0x0;var _0x496135=_0xfb5f[_0x5974e1];return _0x496135;};'use strict';var _=require(_0xffb5('0x0'));var util=require(_0xffb5('0x1'));var logger=require(_0xffb5('0x2'))(_0xffb5('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xffb5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xffb5('0x5'));var config=require('../../config/environment');var attributes=require(_0xffb5('0x6'));module[_0xffb5('0x7')]=function(_0x23b53b,_0x420b42){return _0x23b53b[_0xffb5('0x8')](_0xffb5('0x9'),attributes,{'tableName':_0xffb5('0xa'),'paranoid':![],'indexes':[{'name':_0xffb5('0xb'),'fields':['interactionid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x2f06=['ScreenRecording','screen_recordings','interactionid','lodash','api','moment','./screenRecording.attributes','exports','define'];(function(_0x3ffcd7,_0x3af899){var _0x29aea5=function(_0x53aed6){while(--_0x53aed6){_0x3ffcd7['push'](_0x3ffcd7['shift']());}};_0x29aea5(++_0x3af899);}(_0x2f06,0xa5));var _0x62f0=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x2f06[_0xdea41a];return _0x15d0d8;};'use strict';var _=require(_0x62f0('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x62f0('0x1'));var moment=require(_0x62f0('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x62f0('0x3'));module[_0x62f0('0x4')]=function(_0x5234f6,_0x41a4b){return _0x5234f6[_0x62f0('0x5')](_0x62f0('0x6'),attributes,{'tableName':_0x62f0('0x7'),'paranoid':![],'indexes':[{'name':'interactionid','fields':[_0x62f0('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index c1ecd6b..c7c5985 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 _0x76f1=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','lodash'];(function(_0x248485,_0x514163){var _0x3e4762=function(_0x479813){while(--_0x479813){_0x248485['push'](_0x248485['shift']());}};_0x3e4762(++_0x514163);}(_0x76f1,0x1da));var _0x176f=function(_0x6912a5,_0x50f199){_0x6912a5=_0x6912a5-0x0;var _0x22653c=_0x76f1[_0x6912a5];return _0x22653c;};'use strict';var _=require(_0x176f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x176f('0x1'));var db=require(_0x176f('0x2'))['db'];var utils=require(_0x176f('0x3'));var logger=require(_0x176f('0x4'))(_0x176f('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x176f('0x6')][_0x176f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3d0116,_0x33e1e9,_0x795f4){return new BPromise(function(_0x7b1fe0,_0x56cd67){return client[_0x176f('0x8')](_0x3d0116,_0x795f4)[_0x176f('0x9')](function(_0x3e6ceb){logger['info'](_0x176f('0xa'),_0x33e1e9,_0x176f('0xb'));logger[_0x176f('0xc')](_0x176f('0xd'),_0x33e1e9,_0x176f('0xb'),JSON['stringify'](_0x3e6ceb));if(_0x3e6ceb[_0x176f('0xe')]){if(_0x3e6ceb[_0x176f('0xe')]['code']===0x1f4){logger[_0x176f('0xe')]('ScreenRecording,\x20%s,\x20%s',_0x33e1e9,_0x3e6ceb[_0x176f('0xe')][_0x176f('0xf')]);return _0x56cd67(_0x3e6ceb[_0x176f('0xe')]['message']);}logger[_0x176f('0xe')]('ScreenRecording,\x20%s,\x20%s',_0x33e1e9,_0x3e6ceb[_0x176f('0xe')][_0x176f('0xf')]);return _0x7b1fe0(_0x3e6ceb[_0x176f('0xe')][_0x176f('0xf')]);}else{logger[_0x176f('0x10')](_0x176f('0xa'),_0x33e1e9,_0x176f('0xb'));_0x7b1fe0(_0x3e6ceb[_0x176f('0x11')]['message']);}})[_0x176f('0x12')](function(_0x444b60){logger[_0x176f('0xe')](_0x176f('0xa'),_0x33e1e9,_0x444b60);_0x56cd67(_0x444b60);});});} \ No newline at end of file +var _0xd350=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util'];(function(_0xddf166,_0xb39346){var _0x1c5164=function(_0x3e1ba0){while(--_0x3e1ba0){_0xddf166['push'](_0xddf166['shift']());}};_0x1c5164(++_0xb39346);}(_0xd350,0x129));var _0x0d35=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xd350[_0x376b45];return _0x2341b3;};'use strict';var _=require(_0x0d35('0x0'));var util=require(_0x0d35('0x1'));var moment=require(_0x0d35('0x2'));var BPromise=require('bluebird');var rs=require(_0x0d35('0x3'));var fs=require('fs');var Redis=require(_0x0d35('0x4'));var db=require(_0x0d35('0x5'))['db'];var utils=require(_0x0d35('0x6'));var logger=require(_0x0d35('0x7'))(_0x0d35('0x8'));var config=require(_0x0d35('0x9'));var jayson=require(_0x0d35('0xa'));var client=jayson[_0x0d35('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d7406,_0x59d6c6,_0x247b72){return new BPromise(function(_0x21dd77,_0x4b5876){return client[_0x0d35('0xc')](_0x3d7406,_0x247b72)[_0x0d35('0xd')](function(_0x254855){logger[_0x0d35('0xe')](_0x0d35('0xf'),_0x59d6c6,_0x0d35('0x10'));logger['debug'](_0x0d35('0x11'),_0x59d6c6,_0x0d35('0x10'),JSON[_0x0d35('0x12')](_0x254855));if(_0x254855[_0x0d35('0x13')]){if(_0x254855[_0x0d35('0x13')]['code']===0x1f4){logger[_0x0d35('0x13')](_0x0d35('0xf'),_0x59d6c6,_0x254855[_0x0d35('0x13')][_0x0d35('0x14')]);return _0x4b5876(_0x254855[_0x0d35('0x13')]['message']);}logger['error']('ScreenRecording,\x20%s,\x20%s',_0x59d6c6,_0x254855['error'][_0x0d35('0x14')]);return _0x21dd77(_0x254855[_0x0d35('0x13')][_0x0d35('0x14')]);}else{logger[_0x0d35('0xe')](_0x0d35('0xf'),_0x59d6c6,_0x0d35('0x10'));_0x21dd77(_0x254855[_0x0d35('0x15')][_0x0d35('0x14')]);}})[_0x0d35('0x16')](function(_0x238d4b){logger[_0x0d35('0x13')](_0x0d35('0xf'),_0x59d6c6,_0x238d4b);_0x4b5876(_0x238d4b);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 25c6780..c0734bb 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 _0x7122=['/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join','root','server/files/images/logos/','format','%s%s','extname','originalname','post','single','addLogo','logologin','file','addLogoLogin','preferred','addPreferred','favicon','put','/:id','isAuthenticated','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','index','show'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x7122,0x199));var _0x2712=function(_0x3f9e46,_0x112e60){_0x3f9e46=_0x3f9e46-0x0;var _0xf6778d=_0x7122[_0x3f9e46];return _0xf6778d;};'use strict';var multer=require(_0x2712('0x0'));var util=require(_0x2712('0x1'));var path=require(_0x2712('0x2'));var timeout=require(_0x2712('0x3'));var express=require(_0x2712('0x4'));var router=express[_0x2712('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x2712('0x6'));var interaction=require(_0x2712('0x7'));var config=require('../../config/environment');var controller=require('./setting.controller');router[_0x2712('0x8')]('/',auth['isAuthenticated'](),controller[_0x2712('0x9')]);router['get']('/now',controller['getDate']);router[_0x2712('0x8')]('/:id',controller[_0x2712('0xa')]);router[_0x2712('0x8')](_0x2712('0xb'),controller[_0x2712('0xc')]);router[_0x2712('0x8')](_0x2712('0xd'),controller[_0x2712('0xe')]);router[_0x2712('0x8')](_0x2712('0xf'),controller['gdpr']);router['get'](_0x2712('0x10'),controller[_0x2712('0x11')]);router['get'](_0x2712('0x12'),controller[_0x2712('0x13')]);var upload=multer({'storage':multer[_0x2712('0x14')]({'destination':function(_0x4a84d9,_0x3ceec9,_0x2e7bfd){_0x2e7bfd(null,path[_0x2712('0x15')](config[_0x2712('0x16')],_0x2712('0x17')));},'filename':function(_0x1e7dae,_0x285635,_0x7113fc){_0x7113fc(null,util[_0x2712('0x18')](_0x2712('0x19'),'logo',path[_0x2712('0x1a')](_0x285635[_0x2712('0x1b')])));}})});router[_0x2712('0x1c')]('/:id/logo',upload[_0x2712('0x1d')]('file'),controller[_0x2712('0x1e')]);var upload=multer({'storage':multer[_0x2712('0x14')]({'destination':function(_0x34ac26,_0x25bc29,_0x52fbb9){_0x52fbb9(null,path['join'](config['root'],_0x2712('0x17')));},'filename':function(_0x3cb23,_0x2e47ac,_0x11158c){_0x11158c(null,util[_0x2712('0x18')]('%s%s',_0x2712('0x1f'),path[_0x2712('0x1a')](_0x2e47ac[_0x2712('0x1b')])));}})});router['post'](_0x2712('0xd'),upload['single'](_0x2712('0x20')),controller[_0x2712('0x21')]);var upload=multer({'storage':multer[_0x2712('0x14')]({'destination':function(_0x20cd77,_0xb40b51,_0x310549){_0x310549(null,path[_0x2712('0x15')](config[_0x2712('0x16')],_0x2712('0x17')));},'filename':function(_0x1a3332,_0x5dcbb1,_0x3c988b){_0x3c988b(null,util['format'](_0x2712('0x19'),_0x2712('0x22'),path[_0x2712('0x1a')](_0x5dcbb1[_0x2712('0x1b')])));}})});router[_0x2712('0x1c')](_0x2712('0x10'),upload[_0x2712('0x1d')](_0x2712('0x20')),controller[_0x2712('0x23')]);var upload=multer({'storage':multer[_0x2712('0x14')]({'destination':function(_0x5ea8d8,_0x3000c1,_0x33479b){_0x33479b(null,path[_0x2712('0x15')](config[_0x2712('0x16')],_0x2712('0x17')));},'filename':function(_0x11e2ba,_0x502d58,_0x18f0a4){_0x18f0a4(null,util['format'](_0x2712('0x19'),_0x2712('0x24'),path[_0x2712('0x1a')](_0x502d58[_0x2712('0x1b')])));}})});router[_0x2712('0x1c')]('/:id/favicon',upload['single'](_0x2712('0x20')),controller['addFavicon']);router[_0x2712('0x25')](_0x2712('0x26'),auth[_0x2712('0x27')](),controller[_0x2712('0x28')]);module[_0x2712('0x29')]=router; \ No newline at end of file +var _0xe924=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./setting.controller','get','index','getDate','show','getLogo','getLogoLogin','/:id/preferred','getPreferred','/:id/favicon','diskStorage','join','root','server/files/images/logos/','format','%s%s','extname','post','single','addLogo','logologin','/:id/logo_login','file','addLogoLogin','preferred','addPreferred','addFavicon','put','isAuthenticated','update','exports','multer','util','path'];(function(_0x5442a5,_0x4110f1){var _0x130af0=function(_0x457ec2){while(--_0x457ec2){_0x5442a5['push'](_0x5442a5['shift']());}};_0x130af0(++_0x4110f1);}(_0xe924,0x1dd));var _0x4e92=function(_0x413d7d,_0x14c76d){_0x413d7d=_0x413d7d-0x0;var _0x5b3c86=_0xe924[_0x413d7d];return _0x5b3c86;};'use strict';var multer=require(_0x4e92('0x0'));var util=require(_0x4e92('0x1'));var path=require(_0x4e92('0x2'));var timeout=require(_0x4e92('0x3'));var express=require(_0x4e92('0x4'));var router=express[_0x4e92('0x5')]();var fs_extra=require(_0x4e92('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x4e92('0x7'));var config=require(_0x4e92('0x8'));var controller=require(_0x4e92('0x9'));router[_0x4e92('0xa')]('/',auth['isAuthenticated'](),controller[_0x4e92('0xb')]);router[_0x4e92('0xa')]('/now',controller[_0x4e92('0xc')]);router[_0x4e92('0xa')]('/:id',controller[_0x4e92('0xd')]);router[_0x4e92('0xa')]('/:id/logo',controller[_0x4e92('0xe')]);router[_0x4e92('0xa')]('/:id/logo_login',controller[_0x4e92('0xf')]);router[_0x4e92('0xa')]('/:id/gdpr',controller['gdpr']);router[_0x4e92('0xa')](_0x4e92('0x10'),controller[_0x4e92('0x11')]);router[_0x4e92('0xa')](_0x4e92('0x12'),controller['getFavicon']);var upload=multer({'storage':multer[_0x4e92('0x13')]({'destination':function(_0x20ee8e,_0x8c67e,_0x3dbede){_0x3dbede(null,path[_0x4e92('0x14')](config[_0x4e92('0x15')],_0x4e92('0x16')));},'filename':function(_0x472492,_0x2d9beb,_0x3ad008){_0x3ad008(null,util[_0x4e92('0x17')](_0x4e92('0x18'),'logo',path[_0x4e92('0x19')](_0x2d9beb['originalname'])));}})});router[_0x4e92('0x1a')]('/:id/logo',upload[_0x4e92('0x1b')]('file'),controller[_0x4e92('0x1c')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x214300,_0x36ecb8,_0x5f0da7){_0x5f0da7(null,path[_0x4e92('0x14')](config[_0x4e92('0x15')],'server/files/images/logos/'));},'filename':function(_0x5b04c8,_0x1822b4,_0x1df83b){_0x1df83b(null,util[_0x4e92('0x17')](_0x4e92('0x18'),_0x4e92('0x1d'),path[_0x4e92('0x19')](_0x1822b4['originalname'])));}})});router[_0x4e92('0x1a')](_0x4e92('0x1e'),upload[_0x4e92('0x1b')](_0x4e92('0x1f')),controller[_0x4e92('0x20')]);var upload=multer({'storage':multer[_0x4e92('0x13')]({'destination':function(_0x4e677b,_0x2cc781,_0x4bfbd6){_0x4bfbd6(null,path['join'](config['root'],_0x4e92('0x16')));},'filename':function(_0x259d8f,_0x41e452,_0x5256c0){_0x5256c0(null,util['format'](_0x4e92('0x18'),_0x4e92('0x21'),path[_0x4e92('0x19')](_0x41e452['originalname'])));}})});router[_0x4e92('0x1a')](_0x4e92('0x10'),upload[_0x4e92('0x1b')](_0x4e92('0x1f')),controller[_0x4e92('0x22')]);var upload=multer({'storage':multer[_0x4e92('0x13')]({'destination':function(_0x3e0677,_0xb3f365,_0x1c85b6){_0x1c85b6(null,path[_0x4e92('0x14')](config[_0x4e92('0x15')],_0x4e92('0x16')));},'filename':function(_0x3ad0fa,_0x840abd,_0x5af9c2){_0x5af9c2(null,util[_0x4e92('0x17')](_0x4e92('0x18'),'favicon',path[_0x4e92('0x19')](_0x840abd['originalname'])));}})});router[_0x4e92('0x1a')](_0x4e92('0x12'),upload['single'](_0x4e92('0x1f')),controller[_0x4e92('0x23')]);router[_0x4e92('0x24')]('/:id',auth[_0x4e92('0x25')](),controller[_0x4e92('0x26')]);module[_0x4e92('0x27')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index c4c2698..5b2dd17 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 _0x2ef3=['min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','UNSIGNED','sequelize','exports','INTEGER','min_internal'];(function(_0x1a6a7a,_0x33db75){var _0x3baeb8=function(_0x81a145){while(--_0x81a145){_0x1a6a7a['push'](_0x1a6a7a['shift']());}};_0x3baeb8(++_0x33db75);}(_0x2ef3,0xba));var _0x32ef=function(_0x4e6446,_0x1a8226){_0x4e6446=_0x4e6446-0x0;var _0x17e617=_0x2ef3[_0x4e6446];return _0x17e617;};'use strict';var Sequelize=require(_0x32ef('0x0'));module[_0x32ef('0x1')]={'min_internal':{'type':Sequelize[_0x32ef('0x2')](0xb),'unique':_0x32ef('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x32ef('0x2')](0xb),'unique':_0x32ef('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x32ef('0x5')],'defaultValue':_0x32ef('0x6')},'logo':{'type':Sequelize['STRING']},'defaultLogo':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x32ef('0x5')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize['STRING']},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x32ef('0x5')]},'turnaddr':{'type':Sequelize[_0x32ef('0x5')]},'turnusername':{'type':Sequelize[_0x32ef('0x5')]},'turnpassword':{'type':Sequelize[_0x32ef('0x5')]},'pageTitle':{'type':Sequelize[_0x32ef('0x5')]},'defaultPageTitle':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x32ef('0x5')],'defaultValue':_0x32ef('0x8')},'enableEmailPreview':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':![]},'split':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x32ef('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x32ef('0x5')],'defaultValue':'alternate'},'chatTimeout':{'type':Sequelize[_0x32ef('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize['STRING']},'allowedLoginAttempts':{'type':Sequelize[_0x32ef('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x32ef('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x32ef('0x5')]},'defaultFavicon':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x32ef('0x2')]},'transcribeRegion':{'type':Sequelize[_0x32ef('0x5')]},'sentiment':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize['INTEGER']},'sentimentRegion':{'type':Sequelize[_0x32ef('0x5')]},'language':{'type':Sequelize[_0x32ef('0x5')]},'bucket':{'type':Sequelize[_0x32ef('0x5')]},'googleSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x32ef('0x2')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x32ef('0x2')](0x2)[_0x32ef('0x9')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x32ef('0x2')](0x2)[_0x32ef('0x9')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x32ef('0x2')](0x2)[_0x32ef('0x9')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x32ef('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x32ef('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x32ef('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':![]}}; \ No newline at end of file +var _0x0b0e=['INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','alternate','UNSIGNED','sequelize'];(function(_0x31db87,_0x117bc8){var _0x3c8bf8=function(_0x2381f0){while(--_0x2381f0){_0x31db87['push'](_0x31db87['shift']());}};_0x3c8bf8(++_0x117bc8);}(_0x0b0e,0x187));var _0xe0b0=function(_0x25c988,_0xce8221){_0x25c988=_0x25c988-0x0;var _0x45fcc2=_0x0b0e[_0x25c988];return _0x45fcc2;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'min_internal':{'type':Sequelize[_0xe0b0('0x1')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xe0b0('0x1')](0xb),'unique':_0xe0b0('0x2'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0xe0b0('0x1')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xe0b0('0x3')],'defaultValue':_0xe0b0('0x4')},'logo':{'type':Sequelize[_0xe0b0('0x3')]},'defaultLogo':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xe0b0('0x3')]},'defaultLoginLogo':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0xe0b0('0x3')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'securePassword':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xe0b0('0x3')]},'turnaddr':{'type':Sequelize[_0xe0b0('0x3')]},'turnusername':{'type':Sequelize[_0xe0b0('0x3')]},'turnpassword':{'type':Sequelize[_0xe0b0('0x3')]},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0xe0b0('0x3')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':![]},'split':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xe0b0('0x3')],'defaultValue':_0xe0b0('0x6')},'chatTimeout':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xe0b0('0x3')]},'allowedLoginAttempts':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0xa},'favicon':{'type':Sequelize['STRING']},'defaultFavicon':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0xe0b0('0x3')]},'sentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0xe0b0('0x1')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize[_0xe0b0('0x3')]},'googleSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize['INTEGER'](0x2)[_0xe0b0('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0xe0b0('0x1')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0xe0b0('0x1')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index e3166ef..9c12c3e 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 _0xab29=['set','apply','reject','save','update','destroy','end','stack','name','send','index','Setting','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','where','pick','map','VIRTUAL','filter','merge','includeAll','include','findAll','rows','show','params','length','options','find','body','file','filename','loginLogo','getLogo','defaultLoginLogo','defaultPreferred','logo','join','root','toLower','default_logo.svg','default','custom','existsSync','Sequelize','ValidationError','upperFirst','\x20not\x20found','download','getLogoLogin','server/files/images/logos','getLicense','preferred','defaultLogo','defaultFavicon','default_loginLogo.svg','addPreferred','getPreferred','default_preferred.png','../../config/license/util','favicon','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','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','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','status','json','undefined','count','offset','limit'];(function(_0x149c1f,_0x7b4dc6){var _0x309eeb=function(_0x19863c){while(--_0x19863c){_0x149c1f['push'](_0x149c1f['shift']());}};_0x309eeb(++_0x7b4dc6);}(_0xab29,0x145));var _0x9ab2=function(_0x2aebde,_0x129d06){_0x2aebde=_0x2aebde-0x0;var _0x415e4f=_0xab29[_0x2aebde];return _0x415e4f;};'use strict';var emlformat=require(_0x9ab2('0x0'));var rimraf=require(_0x9ab2('0x1'));var zipdir=require(_0x9ab2('0x2'));var jsonpatch=require(_0x9ab2('0x3'));var rp=require('request-promise');var moment=require(_0x9ab2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9ab2('0x5'));var util=require(_0x9ab2('0x6'));var path=require(_0x9ab2('0x7'));var sox=require(_0x9ab2('0x8'));var csv=require(_0x9ab2('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9ab2('0xa'));var _=require(_0x9ab2('0xb'));var squel=require(_0x9ab2('0xc'));var crypto=require(_0x9ab2('0xd'));var jsforce=require(_0x9ab2('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x9ab2('0x9'));var querystring=require(_0x9ab2('0xf'));var Papa=require(_0x9ab2('0x10'));var Redis=require(_0x9ab2('0x11'));var authService=require(_0x9ab2('0x12'));var qs=require(_0x9ab2('0x13'));var as=require(_0x9ab2('0x14'));var hardwareService=require(_0x9ab2('0x15'));var logger=require(_0x9ab2('0x16'))('api');var utils=require(_0x9ab2('0x17'));var config=require(_0x9ab2('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var jayson=require(_0x9ab2('0x19'));var client=jayson[_0x9ab2('0x1a')][_0x9ab2('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x55cc45,_0x2bdac5,_0x314432,_0x55c9d6){return new BPromise(function(_0x3a594f,_0x43debd){var _0x305b86=_0x55c9d6||client;return _0x305b86[_0x9ab2('0x1c')](_0x55cc45,_0x314432)[_0x9ab2('0x1d')](function(_0x117a33){logger[_0x9ab2('0x1e')](_0x9ab2('0x1f'),_0x2bdac5,'request\x20sent');logger[_0x9ab2('0x20')](_0x9ab2('0x21'),_0x2bdac5,_0x9ab2('0x22'),JSON[_0x9ab2('0x23')](_0x117a33));if(_0x117a33[_0x9ab2('0x24')]){if(_0x117a33[_0x9ab2('0x24')]['code']===0x1f4){logger['error'](_0x9ab2('0x1f'),_0x2bdac5,_0x117a33['error'][_0x9ab2('0x25')]);return _0x43debd(_0x117a33[_0x9ab2('0x24')]['message']);}logger[_0x9ab2('0x24')](_0x9ab2('0x1f'),_0x2bdac5,_0x117a33['error'][_0x9ab2('0x25')]);return _0x3a594f(_0x117a33[_0x9ab2('0x24')][_0x9ab2('0x25')]);}else{logger[_0x9ab2('0x1e')](_0x9ab2('0x1f'),_0x2bdac5,_0x9ab2('0x22'));_0x3a594f(_0x117a33[_0x9ab2('0x26')][_0x9ab2('0x25')]);}})[_0x9ab2('0x27')](function(_0x3e70b4){logger[_0x9ab2('0x24')](_0x9ab2('0x1f'),_0x2bdac5,_0x3e70b4);_0x43debd(_0x3e70b4);});});}function respondWithStatusCode(_0x3b7037,_0x5a0b32){_0x5a0b32=_0x5a0b32||0xcc;return function(_0x37a1da){if(_0x37a1da){return _0x3b7037[_0x9ab2('0x28')](_0x5a0b32);}return _0x3b7037[_0x9ab2('0x29')](_0x5a0b32)['end']();};}function respondWithResult(_0x1f9b3b,_0x4486cc){_0x4486cc=_0x4486cc||0xc8;return function(_0x2f560d){if(_0x2f560d){return _0x1f9b3b[_0x9ab2('0x29')](_0x4486cc)[_0x9ab2('0x2a')](_0x2f560d);}};}function respondWithFilteredResult(_0x393223,_0x1c7142){return function(_0x2d9db7){if(_0x2d9db7){var _0x40a983=typeof _0x1c7142['offset']==='undefined'&&typeof _0x1c7142['limit']===_0x9ab2('0x2b');var _0x43ad26=_0x2d9db7[_0x9ab2('0x2c')];var _0x3f6662=_0x40a983?0x0:_0x1c7142[_0x9ab2('0x2d')];var _0x2a01dc=_0x40a983?_0x2d9db7[_0x9ab2('0x2c')]:_0x1c7142[_0x9ab2('0x2d')]+_0x1c7142[_0x9ab2('0x2e')];var _0x181119;if(_0x2a01dc>=_0x43ad26){_0x2a01dc=_0x43ad26;_0x181119=0xc8;}else{_0x181119=0xce;}_0x393223['status'](_0x181119);return _0x393223[_0x9ab2('0x2f')]('Content-Range',_0x3f6662+'-'+_0x2a01dc+'/'+_0x43ad26)[_0x9ab2('0x2a')](_0x2d9db7);}return null;};}function patchUpdates(_0x27b991){return function(_0x4e8252){try{jsonpatch[_0x9ab2('0x30')](_0x4e8252,_0x27b991,!![]);}catch(_0x583b0c){return BPromise[_0x9ab2('0x31')](_0x583b0c);}return _0x4e8252[_0x9ab2('0x32')]();};}function saveUpdates(_0x26856c,_0x434b93){return function(_0x3abaf3){if(_0x3abaf3){return _0x3abaf3[_0x9ab2('0x33')](_0x26856c)[_0x9ab2('0x1d')](function(_0xf6c79d){return _0xf6c79d;});}return null;};}function removeEntity(_0x24b0c8,_0x4e498c){return function(_0x4eb730){if(_0x4eb730){return _0x4eb730[_0x9ab2('0x34')]()[_0x9ab2('0x1d')](function(){_0x24b0c8[_0x9ab2('0x29')](0xcc)[_0x9ab2('0x35')]();});}};}function handleEntityNotFound(_0xf41123,_0x4adb67){return function(_0x54eeba){if(!_0x54eeba){_0xf41123[_0x9ab2('0x28')](0x194);}return _0x54eeba;};}function handleError(_0x551476,_0x1134e2){_0x1134e2=_0x1134e2||0x1f4;return function(_0x1270d1){logger[_0x9ab2('0x24')](_0x1270d1[_0x9ab2('0x36')]);if(_0x1270d1[_0x9ab2('0x37')]){delete _0x1270d1[_0x9ab2('0x37')];}_0x551476[_0x9ab2('0x29')](_0x1134e2)[_0x9ab2('0x38')](_0x1270d1);};}exports[_0x9ab2('0x39')]=function(_0x3c958,_0x2280b2){var _0x397af8={},_0x220d58={},_0x3cfa1b={'count':0x0,'rows':[]};var _0x1b214b=_['map'](db[_0x9ab2('0x3a')][_0x9ab2('0x3b')],function(_0xa1bbf5){return{'name':_0xa1bbf5[_0x9ab2('0x3c')],'type':_0xa1bbf5[_0x9ab2('0x3d')][_0x9ab2('0x3e')]};});_0x220d58[_0x9ab2('0x3f')]=_['map'](_0x1b214b,_0x9ab2('0x37'));_0x220d58[_0x9ab2('0x40')]=_['keys'](_0x3c958[_0x9ab2('0x40')]);_0x220d58[_0x9ab2('0x41')]=_[_0x9ab2('0x42')](_0x220d58[_0x9ab2('0x3f')],_0x220d58[_0x9ab2('0x40')]);_0x397af8[_0x9ab2('0x43')]=_[_0x9ab2('0x42')](_0x220d58[_0x9ab2('0x3f')],qs[_0x9ab2('0x44')](_0x3c958[_0x9ab2('0x40')][_0x9ab2('0x44')]));_0x397af8[_0x9ab2('0x43')]=_0x397af8[_0x9ab2('0x43')]['length']?_0x397af8[_0x9ab2('0x43')]:_0x220d58['model'];if(!_0x3c958[_0x9ab2('0x40')][_0x9ab2('0x45')]('nolimit')){_0x397af8['limit']=qs[_0x9ab2('0x2e')](_0x3c958[_0x9ab2('0x40')]['limit']);_0x397af8[_0x9ab2('0x2d')]=qs['offset'](_0x3c958[_0x9ab2('0x40')][_0x9ab2('0x2d')]);}_0x397af8[_0x9ab2('0x46')]=qs['sort'](_0x3c958[_0x9ab2('0x40')]['sort']);_0x397af8[_0x9ab2('0x47')]=qs[_0x9ab2('0x41')](_[_0x9ab2('0x48')](_0x3c958[_0x9ab2('0x40')],_0x220d58[_0x9ab2('0x41')]),_0x1b214b);if(_0x3c958['query']['filter']){_0x397af8['where']=_['merge'](_0x397af8[_0x9ab2('0x47')],{'$or':_[_0x9ab2('0x49')](_0x1b214b,function(_0x4a4ba2){if(_0x4a4ba2[_0x9ab2('0x3d')]!==_0x9ab2('0x4a')){var _0x1e21f2={};_0x1e21f2[_0x4a4ba2[_0x9ab2('0x37')]]={'$like':'%'+_0x3c958['query'][_0x9ab2('0x4b')]+'%'};return _0x1e21f2;}})});}_0x397af8=_[_0x9ab2('0x4c')]({},_0x397af8,_0x3c958['options']);var _0x24ff93={'where':_0x397af8[_0x9ab2('0x47')]};return db[_0x9ab2('0x3a')][_0x9ab2('0x2c')](_0x24ff93)[_0x9ab2('0x1d')](function(_0x1da995){_0x3cfa1b['count']=_0x1da995;if(_0x3c958[_0x9ab2('0x40')][_0x9ab2('0x4d')]){_0x397af8[_0x9ab2('0x4e')]=[{'all':!![]}];}return db[_0x9ab2('0x3a')][_0x9ab2('0x4f')](_0x397af8);})[_0x9ab2('0x1d')](function(_0x50cfe9){_0x3cfa1b[_0x9ab2('0x50')]=_0x50cfe9;return _0x3cfa1b;})['then'](respondWithFilteredResult(_0x2280b2,_0x397af8))[_0x9ab2('0x27')](handleError(_0x2280b2,null));};exports[_0x9ab2('0x51')]=function(_0x48b368,_0x4833bd){var _0x12a3cf={'raw':![],'where':{'id':_0x48b368[_0x9ab2('0x52')]['id']}},_0x4e867c={};_0x4e867c[_0x9ab2('0x3f')]=_['keys'](db['Setting']['rawAttributes']);_0x4e867c[_0x9ab2('0x40')]=_['keys'](_0x48b368[_0x9ab2('0x40')]);_0x4e867c[_0x9ab2('0x41')]=_[_0x9ab2('0x42')](_0x4e867c[_0x9ab2('0x3f')],_0x4e867c['query']);_0x12a3cf[_0x9ab2('0x43')]=_[_0x9ab2('0x42')](_0x4e867c[_0x9ab2('0x3f')],qs[_0x9ab2('0x44')](_0x48b368[_0x9ab2('0x40')]['fields']));_0x12a3cf[_0x9ab2('0x43')]=_0x12a3cf[_0x9ab2('0x43')][_0x9ab2('0x53')]?_0x12a3cf[_0x9ab2('0x43')]:_0x4e867c['model'];if(_0x48b368[_0x9ab2('0x40')][_0x9ab2('0x4d')]){_0x12a3cf['include']=[{'all':!![]}];}_0x12a3cf=_['merge']({},_0x12a3cf,_0x48b368[_0x9ab2('0x54')]);return db[_0x9ab2('0x3a')][_0x9ab2('0x55')](_0x12a3cf)[_0x9ab2('0x1d')](handleEntityNotFound(_0x4833bd,null))['then'](respondWithResult(_0x4833bd,null))[_0x9ab2('0x27')](handleError(_0x4833bd,null));};exports[_0x9ab2('0x33')]=function(_0x4f994d,_0x4d46a2){if(_0x4f994d[_0x9ab2('0x56')]['id']){delete _0x4f994d['body']['id'];}return db[_0x9ab2('0x3a')][_0x9ab2('0x55')]({'where':{'id':_0x4f994d[_0x9ab2('0x52')]['id']}})['then'](handleEntityNotFound(_0x4d46a2,null))[_0x9ab2('0x1d')](saveUpdates(_0x4f994d[_0x9ab2('0x56')],null))['then'](respondWithResult(_0x4d46a2,null))[_0x9ab2('0x27')](handleError(_0x4d46a2,null));};exports['addLogo']=function(_0x4ff380,_0x526ba6,_0x524f14){if(_0x4ff380[_0x9ab2('0x57')]&&_0x4ff380[_0x9ab2('0x57')][_0x9ab2('0x58')]){_0x4ff380[_0x9ab2('0x56')]['logo']=_0x4ff380['file'][_0x9ab2('0x58')];}return db[_0x9ab2('0x3a')][_0x9ab2('0x55')]({'where':{'id':_0x4ff380[_0x9ab2('0x52')]['id']}})[_0x9ab2('0x1d')](handleEntityNotFound(_0x526ba6,null))[_0x9ab2('0x1d')](saveUpdates(_0x4ff380[_0x9ab2('0x56')],null))[_0x9ab2('0x1d')](respondWithResult(_0x526ba6,null))['catch'](handleError(_0x526ba6,null));};exports['addLogoLogin']=function(_0x69221e,_0x122dae,_0x246736){if(_0x69221e[_0x9ab2('0x57')]&&_0x69221e['file'][_0x9ab2('0x58')]){_0x69221e['body'][_0x9ab2('0x59')]=_0x69221e[_0x9ab2('0x57')]['filename'];}return db[_0x9ab2('0x3a')]['find']({'where':{'id':_0x69221e[_0x9ab2('0x52')]['id']}})[_0x9ab2('0x1d')](handleEntityNotFound(_0x122dae,null))['then'](saveUpdates(_0x69221e[_0x9ab2('0x56')],null))['then'](respondWithResult(_0x122dae,null))[_0x9ab2('0x27')](handleError(_0x122dae,null));};var utilLicense=require('../../config/license/util');exports[_0x9ab2('0x5a')]=function(_0x38fcce,_0xeccaa6,_0x525adc){var _0x227a26='server/files/images/logos';var _0x3bc4c7={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x37135f){if(_0x37135f){_0x3bc4c7=_0x37135f;}return db[_0x9ab2('0x3a')]['find']({'where':{'id':_0x38fcce['params']['id']},'attributes':['logo','loginLogo','preferred','favicon','defaultLogo',_0x9ab2('0x5b'),_0x9ab2('0x5c'),'defaultFavicon'],'raw':!![]});})[_0x9ab2('0x1d')](handleEntityNotFound(_0xeccaa6,null))[_0x9ab2('0x1d')](function(_0x426312){if(_0x426312){var _0x1e91e1=_0x426312[_0x9ab2('0x5d')]&&fs['existsSync'](path[_0x9ab2('0x5e')](config[_0x9ab2('0x5f')],_0x227a26,_['toLower'](_0x426312[_0x9ab2('0x5d')])))?path[_0x9ab2('0x5e')](config[_0x9ab2('0x5f')],_0x227a26,_[_0x9ab2('0x60')](_0x426312[_0x9ab2('0x5d')])):path[_0x9ab2('0x5e')](config['root'],_0x227a26,_[_0x9ab2('0x60')](_0x9ab2('0x61')));var _0x41fca7=_0x9ab2('0x62')+_['upperFirst']('logo');if(_0x426312[_0x41fca7]||!_0x3bc4c7[_0x9ab2('0x63')]){_0x1e91e1=path[_0x9ab2('0x5e')](config['root'],_0x227a26,_[_0x9ab2('0x60')](_0x9ab2('0x61')));}if(!fs[_0x9ab2('0x64')](_0x1e91e1)){throw new db[(_0x9ab2('0x65'))][(_0x9ab2('0x66'))](_[_0x9ab2('0x67')]('logo')+_0x9ab2('0x68'));}return _0xeccaa6[_0x9ab2('0x69')](_0x1e91e1);}})[_0x9ab2('0x27')](handleError(_0xeccaa6,null));};var utilLicense=require('../../config/license/util');exports[_0x9ab2('0x6a')]=function(_0x54c06b,_0x15eb33,_0x449ff3){var _0x1592f7=_0x9ab2('0x6b');var _0x38cc76={'custom':![]};return utilLicense[_0x9ab2('0x6c')]()['then'](function(_0x3b1fe1){if(_0x3b1fe1){_0x38cc76=_0x3b1fe1;}return db['Setting'][_0x9ab2('0x55')]({'where':{'id':_0x54c06b[_0x9ab2('0x52')]['id']},'attributes':[_0x9ab2('0x5d'),_0x9ab2('0x59'),_0x9ab2('0x6d'),'favicon',_0x9ab2('0x6e'),_0x9ab2('0x5b'),_0x9ab2('0x5c'),_0x9ab2('0x6f')],'raw':!![]});})[_0x9ab2('0x1d')](handleEntityNotFound(_0x15eb33,null))[_0x9ab2('0x1d')](function(_0x85d83b){if(_0x85d83b){var _0x140b36=_0x85d83b['loginLogo']&&fs[_0x9ab2('0x64')](path['join'](config[_0x9ab2('0x5f')],_0x1592f7,_[_0x9ab2('0x60')](_0x85d83b[_0x9ab2('0x59')])))?path[_0x9ab2('0x5e')](config['root'],_0x1592f7,_[_0x9ab2('0x60')](_0x85d83b['loginLogo'])):path[_0x9ab2('0x5e')](config[_0x9ab2('0x5f')],_0x1592f7,_[_0x9ab2('0x60')](_0x9ab2('0x70')));var _0x4d7976='default'+_[_0x9ab2('0x67')](_0x9ab2('0x59'));if(_0x85d83b[_0x4d7976]||!_0x38cc76[_0x9ab2('0x63')]){_0x140b36=path[_0x9ab2('0x5e')](config[_0x9ab2('0x5f')],_0x1592f7,_[_0x9ab2('0x60')](_0x9ab2('0x70')));}if(!fs['existsSync'](_0x140b36)){throw new db[(_0x9ab2('0x65'))][(_0x9ab2('0x66'))](_[_0x9ab2('0x67')]('loginLogo')+_0x9ab2('0x68'));}return _0x15eb33[_0x9ab2('0x69')](_0x140b36);}})['catch'](handleError(_0x15eb33,null));};exports['gdpr']=function(_0x501abb,_0x573ccf){return db[_0x9ab2('0x3a')][_0x9ab2('0x55')]({'where':{'id':_0x501abb[_0x9ab2('0x52')]['id']},'attributes':['securePassword']})[_0x9ab2('0x1d')](respondWithResult(_0x573ccf,null))[_0x9ab2('0x27')](handleError(_0x573ccf,null));};exports[_0x9ab2('0x71')]=function(_0x3ab231,_0x59c514,_0x46e77b){if(_0x3ab231[_0x9ab2('0x57')]&&_0x3ab231[_0x9ab2('0x57')]['filename']){_0x3ab231[_0x9ab2('0x56')]['preferred']=_0x3ab231[_0x9ab2('0x57')][_0x9ab2('0x58')];}return db[_0x9ab2('0x3a')][_0x9ab2('0x55')]({'where':{'id':_0x3ab231[_0x9ab2('0x52')]['id']}})['then'](handleEntityNotFound(_0x59c514,null))[_0x9ab2('0x1d')](saveUpdates(_0x3ab231[_0x9ab2('0x56')],null))[_0x9ab2('0x1d')](respondWithResult(_0x59c514,null))[_0x9ab2('0x27')](handleError(_0x59c514,null));};var utilLicense=require('../../config/license/util');exports[_0x9ab2('0x72')]=function(_0x48473a,_0x13d617,_0x33b0b7){var _0x5e8bc0=_0x9ab2('0x6b');var _0x2566c2={'custom':![]};return utilLicense['getLicense']()[_0x9ab2('0x1d')](function(_0xae11e4){if(_0xae11e4){_0x2566c2=_0xae11e4;}return db[_0x9ab2('0x3a')]['find']({'where':{'id':_0x48473a[_0x9ab2('0x52')]['id']},'attributes':[_0x9ab2('0x5d'),_0x9ab2('0x59'),_0x9ab2('0x6d'),'favicon',_0x9ab2('0x6e'),_0x9ab2('0x5b'),_0x9ab2('0x5c'),_0x9ab2('0x6f')],'raw':!![]});})[_0x9ab2('0x1d')](handleEntityNotFound(_0x13d617,null))[_0x9ab2('0x1d')](function(_0x2a4a3f){if(_0x2a4a3f){var _0x49d71c=_0x2a4a3f[_0x9ab2('0x6d')]&&fs[_0x9ab2('0x64')](path[_0x9ab2('0x5e')](config[_0x9ab2('0x5f')],_0x5e8bc0,_[_0x9ab2('0x60')](_0x2a4a3f[_0x9ab2('0x6d')])))?path[_0x9ab2('0x5e')](config[_0x9ab2('0x5f')],_0x5e8bc0,_['toLower'](_0x2a4a3f[_0x9ab2('0x6d')])):path[_0x9ab2('0x5e')](config['root'],_0x5e8bc0,_[_0x9ab2('0x60')](_0x9ab2('0x73')));var _0x2599f4=_0x9ab2('0x62')+_[_0x9ab2('0x67')](_0x9ab2('0x6d'));if(_0x2a4a3f[_0x2599f4]||!_0x2566c2[_0x9ab2('0x63')]||!_0x2566c2['preferred']){_0x49d71c=path[_0x9ab2('0x5e')](config[_0x9ab2('0x5f')],_0x5e8bc0,_[_0x9ab2('0x60')](_0x9ab2('0x73')));}if(!fs[_0x9ab2('0x64')](_0x49d71c)){throw new db[(_0x9ab2('0x65'))]['ValidationError'](_[_0x9ab2('0x67')]('preferred')+_0x9ab2('0x68'));}return _0x13d617[_0x9ab2('0x69')](_0x49d71c);}})['catch'](handleError(_0x13d617,null));};exports['addFavicon']=function(_0x170cfd,_0x4ff2b1,_0x142fd7){if(_0x170cfd[_0x9ab2('0x57')]&&_0x170cfd[_0x9ab2('0x57')]['filename']){_0x170cfd['body']['favicon']=_0x170cfd[_0x9ab2('0x57')][_0x9ab2('0x58')];}return db[_0x9ab2('0x3a')][_0x9ab2('0x55')]({'where':{'id':_0x170cfd['params']['id']}})[_0x9ab2('0x1d')](handleEntityNotFound(_0x4ff2b1,null))[_0x9ab2('0x1d')](saveUpdates(_0x170cfd[_0x9ab2('0x56')],null))[_0x9ab2('0x1d')](respondWithResult(_0x4ff2b1,null))['catch'](handleError(_0x4ff2b1,null));};var utilLicense=require(_0x9ab2('0x74'));exports['getFavicon']=function(_0x1d87c7,_0x2519f1,_0x332c8f){var _0x5e7536='server/files/images/logos';var _0xa2fae1={'custom':![]};return utilLicense[_0x9ab2('0x6c')]()[_0x9ab2('0x1d')](function(_0x48d68b){if(_0x48d68b){_0xa2fae1=_0x48d68b;}return db[_0x9ab2('0x3a')][_0x9ab2('0x55')]({'where':{'id':_0x1d87c7[_0x9ab2('0x52')]['id']},'attributes':[_0x9ab2('0x5d'),'loginLogo',_0x9ab2('0x6d'),'favicon',_0x9ab2('0x6e'),'defaultLoginLogo','defaultPreferred',_0x9ab2('0x6f')],'raw':!![]});})[_0x9ab2('0x1d')](handleEntityNotFound(_0x2519f1,null))[_0x9ab2('0x1d')](function(_0x24aa1b){if(_0x24aa1b){var _0x2b14e1=_0x24aa1b['favicon']&&fs['existsSync'](path[_0x9ab2('0x5e')](config[_0x9ab2('0x5f')],_0x5e7536,_[_0x9ab2('0x60')](_0x24aa1b[_0x9ab2('0x75')])))?path[_0x9ab2('0x5e')](config[_0x9ab2('0x5f')],_0x5e7536,_[_0x9ab2('0x60')](_0x24aa1b[_0x9ab2('0x75')])):path[_0x9ab2('0x5e')](config[_0x9ab2('0x5f')],_0x5e7536,_[_0x9ab2('0x60')](_0x9ab2('0x76')));var _0x2bc1c8=_0x9ab2('0x62')+_[_0x9ab2('0x67')](_0x9ab2('0x75'));if(_0x24aa1b[_0x2bc1c8]||!_0xa2fae1[_0x9ab2('0x63')]){_0x2b14e1=path[_0x9ab2('0x5e')](config[_0x9ab2('0x5f')],_0x5e7536,_[_0x9ab2('0x60')](_0x9ab2('0x76')));}if(!fs[_0x9ab2('0x64')](_0x2b14e1)){throw new db[(_0x9ab2('0x65'))][(_0x9ab2('0x66'))](_['upperFirst'](_0x9ab2('0x75'))+_0x9ab2('0x68'));}return _0x2519f1[_0x9ab2('0x69')](_0x2b14e1);}})[_0x9ab2('0x27')](handleError(_0x2519f1,null));};exports[_0x9ab2('0x77')]=function(_0x3f0a0c,_0x6d88ab){var _0x3831b6={'offset':moment()[_0x9ab2('0x78')]()};_0x3831b6[_0x9ab2('0x79')]=moment()[_0x9ab2('0x78')](_0x3831b6[_0x9ab2('0x2d')])[_0x9ab2('0x7a')](_0x9ab2('0x7b'));return _0x6d88ab[_0x9ab2('0x29')](0xc8)[_0x9ab2('0x38')](_0x3831b6);}; \ No newline at end of file +var _0x43e4=['../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','jayson/promise','http','info','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','Setting,\x20%s,\x20%s','message','result','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','stack','name','index','map','Setting','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','type','VIRTUAL','merge','options','include','findAll','show','includeAll','catch','update','body','find','params','addLogo','file','filename','logo','../../config/license/util','getLogo','loginLogo','defaultFavicon','join','root','toLower','default_logo.svg','default','upperFirst','existsSync','Sequelize','ValidationError','\x20not\x20found','download','getLogoLogin','server/files/images/logos','getLicense','preferred','favicon','defaultLogo','defaultLoginLogo','default_loginLogo.svg','custom','securePassword','addPreferred','defaultPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','utcOffset','now','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs'];(function(_0x20d56b,_0x12e66d){var _0x59ae62=function(_0x4a1dd1){while(--_0x4a1dd1){_0x20d56b['push'](_0x20d56b['shift']());}};_0x59ae62(++_0x12e66d);}(_0x43e4,0x15a));var _0x443e=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x43e4[_0xefd519];return _0x4bb882;};'use strict';var emlformat=require(_0x443e('0x0'));var rimraf=require(_0x443e('0x1'));var zipdir=require(_0x443e('0x2'));var jsonpatch=require(_0x443e('0x3'));var rp=require(_0x443e('0x4'));var moment=require(_0x443e('0x5'));var BPromise=require(_0x443e('0x6'));var Mustache=require(_0x443e('0x7'));var util=require(_0x443e('0x8'));var path=require(_0x443e('0x9'));var sox=require(_0x443e('0xa'));var csv=require(_0x443e('0xb'));var ejs=require(_0x443e('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x443e('0xd'));var squel=require(_0x443e('0xe'));var crypto=require(_0x443e('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x443e('0x10'));var toCsv=require('to-csv');var querystring=require(_0x443e('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x443e('0x12'));var qs=require(_0x443e('0x13'));var as=require(_0x443e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x443e('0x15'));var utils=require(_0x443e('0x16'));var config=require(_0x443e('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var jayson=require(_0x443e('0x18'));var client=jayson['client'][_0x443e('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x48d2b5,_0x4a30ce,_0x30fa2c,_0x5d929c){return new BPromise(function(_0x3af126,_0xc02f11){var _0x4230e2=_0x5d929c||client;return _0x4230e2['request'](_0x48d2b5,_0x30fa2c)['then'](function(_0x4f2c8a){logger[_0x443e('0x1a')]('Setting,\x20%s,\x20%s',_0x4a30ce,_0x443e('0x1b'));logger[_0x443e('0x1c')](_0x443e('0x1d'),_0x4a30ce,_0x443e('0x1b'),JSON[_0x443e('0x1e')](_0x4f2c8a));if(_0x4f2c8a[_0x443e('0x1f')]){if(_0x4f2c8a['error'][_0x443e('0x20')]===0x1f4){logger['error'](_0x443e('0x21'),_0x4a30ce,_0x4f2c8a['error'][_0x443e('0x22')]);return _0xc02f11(_0x4f2c8a[_0x443e('0x1f')]['message']);}logger[_0x443e('0x1f')](_0x443e('0x21'),_0x4a30ce,_0x4f2c8a['error'][_0x443e('0x22')]);return _0x3af126(_0x4f2c8a[_0x443e('0x1f')][_0x443e('0x22')]);}else{logger['info'](_0x443e('0x21'),_0x4a30ce,_0x443e('0x1b'));_0x3af126(_0x4f2c8a[_0x443e('0x23')][_0x443e('0x22')]);}})['catch'](function(_0x2f8018){logger['error'](_0x443e('0x21'),_0x4a30ce,_0x2f8018);_0xc02f11(_0x2f8018);});});}function respondWithStatusCode(_0x50471a,_0x5bc94f){_0x5bc94f=_0x5bc94f||0xcc;return function(_0x39aff7){if(_0x39aff7){return _0x50471a[_0x443e('0x24')](_0x5bc94f);}return _0x50471a['status'](_0x5bc94f)[_0x443e('0x25')]();};}function respondWithResult(_0x340206,_0x3f45b1){_0x3f45b1=_0x3f45b1||0xc8;return function(_0x315ebe){if(_0x315ebe){return _0x340206[_0x443e('0x26')](_0x3f45b1)[_0x443e('0x27')](_0x315ebe);}};}function respondWithFilteredResult(_0x4dfa7b,_0x195bbb){return function(_0x10525a){if(_0x10525a){var _0x26f45e=typeof _0x195bbb[_0x443e('0x28')]===_0x443e('0x29')&&typeof _0x195bbb[_0x443e('0x2a')]===_0x443e('0x29');var _0x4fff71=_0x10525a[_0x443e('0x2b')];var _0x30b6d0=_0x26f45e?0x0:_0x195bbb['offset'];var _0x53b196=_0x26f45e?_0x10525a[_0x443e('0x2b')]:_0x195bbb[_0x443e('0x28')]+_0x195bbb[_0x443e('0x2a')];var _0x591c2a;if(_0x53b196>=_0x4fff71){_0x53b196=_0x4fff71;_0x591c2a=0xc8;}else{_0x591c2a=0xce;}_0x4dfa7b[_0x443e('0x26')](_0x591c2a);return _0x4dfa7b[_0x443e('0x2c')](_0x443e('0x2d'),_0x30b6d0+'-'+_0x53b196+'/'+_0x4fff71)[_0x443e('0x27')](_0x10525a);}return null;};}function patchUpdates(_0x3e8cb9){return function(_0x20062e){try{jsonpatch[_0x443e('0x2e')](_0x20062e,_0x3e8cb9,!![]);}catch(_0x2ab526){return BPromise[_0x443e('0x2f')](_0x2ab526);}return _0x20062e[_0x443e('0x30')]();};}function saveUpdates(_0x30e83b,_0x40b5c4){return function(_0x3846e9){if(_0x3846e9){return _0x3846e9['update'](_0x30e83b)[_0x443e('0x31')](function(_0xcbb4c6){return _0xcbb4c6;});}return null;};}function removeEntity(_0x2b0e00,_0x23b605){return function(_0x4856cc){if(_0x4856cc){return _0x4856cc['destroy']()[_0x443e('0x31')](function(){_0x2b0e00[_0x443e('0x26')](0xcc)[_0x443e('0x25')]();});}};}function handleEntityNotFound(_0x42273c,_0x547c08){return function(_0x1d8691){if(!_0x1d8691){_0x42273c[_0x443e('0x24')](0x194);}return _0x1d8691;};}function handleError(_0x3e6490,_0x277628){_0x277628=_0x277628||0x1f4;return function(_0x1a4884){logger[_0x443e('0x1f')](_0x1a4884[_0x443e('0x32')]);if(_0x1a4884[_0x443e('0x33')]){delete _0x1a4884['name'];}_0x3e6490[_0x443e('0x26')](_0x277628)['send'](_0x1a4884);};}exports[_0x443e('0x34')]=function(_0x674912,_0x2b2e62){var _0x370684={},_0x470fcf={},_0x500598={'count':0x0,'rows':[]};var _0x21ee33=_[_0x443e('0x35')](db[_0x443e('0x36')][_0x443e('0x37')],function(_0x429e39){return{'name':_0x429e39[_0x443e('0x38')],'type':_0x429e39['type']['key']};});_0x470fcf[_0x443e('0x39')]=_['map'](_0x21ee33,_0x443e('0x33'));_0x470fcf[_0x443e('0x3a')]=_[_0x443e('0x3b')](_0x674912[_0x443e('0x3a')]);_0x470fcf[_0x443e('0x3c')]=_[_0x443e('0x3d')](_0x470fcf[_0x443e('0x39')],_0x470fcf[_0x443e('0x3a')]);_0x370684[_0x443e('0x3e')]=_[_0x443e('0x3d')](_0x470fcf[_0x443e('0x39')],qs[_0x443e('0x3f')](_0x674912[_0x443e('0x3a')]['fields']));_0x370684[_0x443e('0x3e')]=_0x370684[_0x443e('0x3e')][_0x443e('0x40')]?_0x370684[_0x443e('0x3e')]:_0x470fcf[_0x443e('0x39')];if(!_0x674912[_0x443e('0x3a')][_0x443e('0x41')](_0x443e('0x42'))){_0x370684['limit']=qs[_0x443e('0x2a')](_0x674912[_0x443e('0x3a')][_0x443e('0x2a')]);_0x370684['offset']=qs[_0x443e('0x28')](_0x674912[_0x443e('0x3a')][_0x443e('0x28')]);}_0x370684['order']=qs['sort'](_0x674912[_0x443e('0x3a')][_0x443e('0x43')]);_0x370684[_0x443e('0x44')]=qs[_0x443e('0x3c')](_[_0x443e('0x45')](_0x674912[_0x443e('0x3a')],_0x470fcf[_0x443e('0x3c')]),_0x21ee33);if(_0x674912[_0x443e('0x3a')][_0x443e('0x46')]){_0x370684['where']=_['merge'](_0x370684['where'],{'$or':_[_0x443e('0x35')](_0x21ee33,function(_0x459aa9){if(_0x459aa9[_0x443e('0x47')]!==_0x443e('0x48')){var _0x204b76={};_0x204b76[_0x459aa9[_0x443e('0x33')]]={'$like':'%'+_0x674912[_0x443e('0x3a')]['filter']+'%'};return _0x204b76;}})});}_0x370684=_[_0x443e('0x49')]({},_0x370684,_0x674912[_0x443e('0x4a')]);var _0x22fb78={'where':_0x370684['where']};return db[_0x443e('0x36')]['count'](_0x22fb78)[_0x443e('0x31')](function(_0x25ab93){_0x500598[_0x443e('0x2b')]=_0x25ab93;if(_0x674912[_0x443e('0x3a')]['includeAll']){_0x370684[_0x443e('0x4b')]=[{'all':!![]}];}return db[_0x443e('0x36')][_0x443e('0x4c')](_0x370684);})[_0x443e('0x31')](function(_0x41a0ca){_0x500598['rows']=_0x41a0ca;return _0x500598;})[_0x443e('0x31')](respondWithFilteredResult(_0x2b2e62,_0x370684))['catch'](handleError(_0x2b2e62,null));};exports[_0x443e('0x4d')]=function(_0x4df61d,_0x493b88){var _0x412c8a={'raw':![],'where':{'id':_0x4df61d['params']['id']}},_0x12fce7={};_0x12fce7[_0x443e('0x39')]=_[_0x443e('0x3b')](db[_0x443e('0x36')][_0x443e('0x37')]);_0x12fce7[_0x443e('0x3a')]=_['keys'](_0x4df61d['query']);_0x12fce7['filters']=_['intersection'](_0x12fce7[_0x443e('0x39')],_0x12fce7['query']);_0x412c8a[_0x443e('0x3e')]=_['intersection'](_0x12fce7['model'],qs[_0x443e('0x3f')](_0x4df61d[_0x443e('0x3a')][_0x443e('0x3f')]));_0x412c8a[_0x443e('0x3e')]=_0x412c8a['attributes'][_0x443e('0x40')]?_0x412c8a[_0x443e('0x3e')]:_0x12fce7[_0x443e('0x39')];if(_0x4df61d['query'][_0x443e('0x4e')]){_0x412c8a[_0x443e('0x4b')]=[{'all':!![]}];}_0x412c8a=_[_0x443e('0x49')]({},_0x412c8a,_0x4df61d[_0x443e('0x4a')]);return db[_0x443e('0x36')]['find'](_0x412c8a)[_0x443e('0x31')](handleEntityNotFound(_0x493b88,null))['then'](respondWithResult(_0x493b88,null))[_0x443e('0x4f')](handleError(_0x493b88,null));};exports[_0x443e('0x50')]=function(_0x21c9f4,_0x3d7fe8){if(_0x21c9f4[_0x443e('0x51')]['id']){delete _0x21c9f4[_0x443e('0x51')]['id'];}return db['Setting'][_0x443e('0x52')]({'where':{'id':_0x21c9f4[_0x443e('0x53')]['id']}})[_0x443e('0x31')](handleEntityNotFound(_0x3d7fe8,null))[_0x443e('0x31')](saveUpdates(_0x21c9f4[_0x443e('0x51')],null))[_0x443e('0x31')](respondWithResult(_0x3d7fe8,null))[_0x443e('0x4f')](handleError(_0x3d7fe8,null));};exports[_0x443e('0x54')]=function(_0x13111c,_0x3d4705,_0x192133){if(_0x13111c[_0x443e('0x55')]&&_0x13111c[_0x443e('0x55')][_0x443e('0x56')]){_0x13111c[_0x443e('0x51')][_0x443e('0x57')]=_0x13111c[_0x443e('0x55')][_0x443e('0x56')];}return db[_0x443e('0x36')][_0x443e('0x52')]({'where':{'id':_0x13111c[_0x443e('0x53')]['id']}})[_0x443e('0x31')](handleEntityNotFound(_0x3d4705,null))[_0x443e('0x31')](saveUpdates(_0x13111c[_0x443e('0x51')],null))[_0x443e('0x31')](respondWithResult(_0x3d4705,null))[_0x443e('0x4f')](handleError(_0x3d4705,null));};exports['addLogoLogin']=function(_0x199ff8,_0x21947c,_0x4f789e){if(_0x199ff8[_0x443e('0x55')]&&_0x199ff8[_0x443e('0x55')][_0x443e('0x56')]){_0x199ff8[_0x443e('0x51')]['loginLogo']=_0x199ff8[_0x443e('0x55')][_0x443e('0x56')];}return db[_0x443e('0x36')]['find']({'where':{'id':_0x199ff8['params']['id']}})[_0x443e('0x31')](handleEntityNotFound(_0x21947c,null))[_0x443e('0x31')](saveUpdates(_0x199ff8['body'],null))[_0x443e('0x31')](respondWithResult(_0x21947c,null))[_0x443e('0x4f')](handleError(_0x21947c,null));};var utilLicense=require(_0x443e('0x58'));exports[_0x443e('0x59')]=function(_0x2eee9d,_0x41e26c,_0x31171c){var _0x44c789='server/files/images/logos';var _0x2e9309={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x53892c){if(_0x53892c){_0x2e9309=_0x53892c;}return db[_0x443e('0x36')][_0x443e('0x52')]({'where':{'id':_0x2eee9d['params']['id']},'attributes':[_0x443e('0x57'),_0x443e('0x5a'),'preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred',_0x443e('0x5b')],'raw':!![]});})[_0x443e('0x31')](handleEntityNotFound(_0x41e26c,null))[_0x443e('0x31')](function(_0x557080){if(_0x557080){var _0x160639=_0x557080[_0x443e('0x57')]&&fs['existsSync'](path[_0x443e('0x5c')](config[_0x443e('0x5d')],_0x44c789,_[_0x443e('0x5e')](_0x557080[_0x443e('0x57')])))?path[_0x443e('0x5c')](config[_0x443e('0x5d')],_0x44c789,_[_0x443e('0x5e')](_0x557080['logo'])):path['join'](config[_0x443e('0x5d')],_0x44c789,_[_0x443e('0x5e')](_0x443e('0x5f')));var _0x376128=_0x443e('0x60')+_[_0x443e('0x61')](_0x443e('0x57'));if(_0x557080[_0x376128]||!_0x2e9309['custom']){_0x160639=path[_0x443e('0x5c')](config[_0x443e('0x5d')],_0x44c789,_['toLower']('default_logo.svg'));}if(!fs[_0x443e('0x62')](_0x160639)){throw new db[(_0x443e('0x63'))][(_0x443e('0x64'))](_[_0x443e('0x61')](_0x443e('0x57'))+_0x443e('0x65'));}return _0x41e26c[_0x443e('0x66')](_0x160639);}})[_0x443e('0x4f')](handleError(_0x41e26c,null));};var utilLicense=require(_0x443e('0x58'));exports[_0x443e('0x67')]=function(_0xef4079,_0x5ed310,_0x514ce2){var _0xf4961a=_0x443e('0x68');var _0x83c4ba={'custom':![]};return utilLicense[_0x443e('0x69')]()[_0x443e('0x31')](function(_0x371b69){if(_0x371b69){_0x83c4ba=_0x371b69;}return db['Setting'][_0x443e('0x52')]({'where':{'id':_0xef4079[_0x443e('0x53')]['id']},'attributes':['logo',_0x443e('0x5a'),_0x443e('0x6a'),_0x443e('0x6b'),_0x443e('0x6c'),_0x443e('0x6d'),'defaultPreferred',_0x443e('0x5b')],'raw':!![]});})[_0x443e('0x31')](handleEntityNotFound(_0x5ed310,null))[_0x443e('0x31')](function(_0x4aa691){if(_0x4aa691){var _0x119ae3=_0x4aa691[_0x443e('0x5a')]&&fs['existsSync'](path[_0x443e('0x5c')](config[_0x443e('0x5d')],_0xf4961a,_[_0x443e('0x5e')](_0x4aa691[_0x443e('0x5a')])))?path[_0x443e('0x5c')](config[_0x443e('0x5d')],_0xf4961a,_[_0x443e('0x5e')](_0x4aa691[_0x443e('0x5a')])):path['join'](config[_0x443e('0x5d')],_0xf4961a,_[_0x443e('0x5e')](_0x443e('0x6e')));var _0x5f0094='default'+_[_0x443e('0x61')](_0x443e('0x5a'));if(_0x4aa691[_0x5f0094]||!_0x83c4ba[_0x443e('0x6f')]){_0x119ae3=path[_0x443e('0x5c')](config[_0x443e('0x5d')],_0xf4961a,_[_0x443e('0x5e')]('default_loginLogo.svg'));}if(!fs[_0x443e('0x62')](_0x119ae3)){throw new db[(_0x443e('0x63'))][(_0x443e('0x64'))](_[_0x443e('0x61')](_0x443e('0x5a'))+_0x443e('0x65'));}return _0x5ed310[_0x443e('0x66')](_0x119ae3);}})['catch'](handleError(_0x5ed310,null));};exports['gdpr']=function(_0x4c3cb5,_0x317f32){return db[_0x443e('0x36')][_0x443e('0x52')]({'where':{'id':_0x4c3cb5['params']['id']},'attributes':[_0x443e('0x70')]})[_0x443e('0x31')](respondWithResult(_0x317f32,null))['catch'](handleError(_0x317f32,null));};exports[_0x443e('0x71')]=function(_0xd86378,_0x3bb8ef,_0x22abea){if(_0xd86378[_0x443e('0x55')]&&_0xd86378[_0x443e('0x55')]['filename']){_0xd86378['body'][_0x443e('0x6a')]=_0xd86378['file'][_0x443e('0x56')];}return db[_0x443e('0x36')][_0x443e('0x52')]({'where':{'id':_0xd86378[_0x443e('0x53')]['id']}})[_0x443e('0x31')](handleEntityNotFound(_0x3bb8ef,null))['then'](saveUpdates(_0xd86378['body'],null))[_0x443e('0x31')](respondWithResult(_0x3bb8ef,null))[_0x443e('0x4f')](handleError(_0x3bb8ef,null));};var utilLicense=require(_0x443e('0x58'));exports['getPreferred']=function(_0x859ec5,_0x3b21fa,_0x183fcc){var _0x278797=_0x443e('0x68');var _0x409054={'custom':![]};return utilLicense[_0x443e('0x69')]()[_0x443e('0x31')](function(_0x27a5da){if(_0x27a5da){_0x409054=_0x27a5da;}return db[_0x443e('0x36')][_0x443e('0x52')]({'where':{'id':_0x859ec5[_0x443e('0x53')]['id']},'attributes':['logo',_0x443e('0x5a'),'preferred','favicon',_0x443e('0x6c'),_0x443e('0x6d'),_0x443e('0x72'),_0x443e('0x5b')],'raw':!![]});})[_0x443e('0x31')](handleEntityNotFound(_0x3b21fa,null))['then'](function(_0x3130ad){if(_0x3130ad){var _0x276ab3=_0x3130ad['preferred']&&fs[_0x443e('0x62')](path['join'](config['root'],_0x278797,_[_0x443e('0x5e')](_0x3130ad[_0x443e('0x6a')])))?path['join'](config['root'],_0x278797,_['toLower'](_0x3130ad[_0x443e('0x6a')])):path['join'](config[_0x443e('0x5d')],_0x278797,_[_0x443e('0x5e')](_0x443e('0x73')));var _0x2e74ab=_0x443e('0x60')+_[_0x443e('0x61')](_0x443e('0x6a'));if(_0x3130ad[_0x2e74ab]||!_0x409054[_0x443e('0x6f')]||!_0x409054[_0x443e('0x6a')]){_0x276ab3=path[_0x443e('0x5c')](config['root'],_0x278797,_['toLower'](_0x443e('0x73')));}if(!fs[_0x443e('0x62')](_0x276ab3)){throw new db['Sequelize'][(_0x443e('0x64'))](_['upperFirst'](_0x443e('0x6a'))+_0x443e('0x65'));}return _0x3b21fa['download'](_0x276ab3);}})[_0x443e('0x4f')](handleError(_0x3b21fa,null));};exports[_0x443e('0x74')]=function(_0x251035,_0x5f7679,_0x53e2ee){if(_0x251035[_0x443e('0x55')]&&_0x251035[_0x443e('0x55')][_0x443e('0x56')]){_0x251035[_0x443e('0x51')]['favicon']=_0x251035[_0x443e('0x55')][_0x443e('0x56')];}return db[_0x443e('0x36')][_0x443e('0x52')]({'where':{'id':_0x251035[_0x443e('0x53')]['id']}})['then'](handleEntityNotFound(_0x5f7679,null))[_0x443e('0x31')](saveUpdates(_0x251035[_0x443e('0x51')],null))[_0x443e('0x31')](respondWithResult(_0x5f7679,null))['catch'](handleError(_0x5f7679,null));};var utilLicense=require(_0x443e('0x58'));exports[_0x443e('0x75')]=function(_0x5434d2,_0xb41ab0,_0x496644){var _0x544a54=_0x443e('0x68');var _0x23c658={'custom':![]};return utilLicense[_0x443e('0x69')]()[_0x443e('0x31')](function(_0x4e1887){if(_0x4e1887){_0x23c658=_0x4e1887;}return db[_0x443e('0x36')][_0x443e('0x52')]({'where':{'id':_0x5434d2[_0x443e('0x53')]['id']},'attributes':[_0x443e('0x57'),'loginLogo',_0x443e('0x6a'),_0x443e('0x6b'),_0x443e('0x6c'),'defaultLoginLogo','defaultPreferred','defaultFavicon'],'raw':!![]});})[_0x443e('0x31')](handleEntityNotFound(_0xb41ab0,null))['then'](function(_0x1ae59c){if(_0x1ae59c){var _0x368996=_0x1ae59c['favicon']&&fs[_0x443e('0x62')](path['join'](config[_0x443e('0x5d')],_0x544a54,_['toLower'](_0x1ae59c[_0x443e('0x6b')])))?path[_0x443e('0x5c')](config[_0x443e('0x5d')],_0x544a54,_[_0x443e('0x5e')](_0x1ae59c['favicon'])):path[_0x443e('0x5c')](config[_0x443e('0x5d')],_0x544a54,_[_0x443e('0x5e')](_0x443e('0x76')));var _0x391b6a='default'+_[_0x443e('0x61')]('favicon');if(_0x1ae59c[_0x391b6a]||!_0x23c658['custom']){_0x368996=path[_0x443e('0x5c')](config[_0x443e('0x5d')],_0x544a54,_[_0x443e('0x5e')](_0x443e('0x76')));}if(!fs[_0x443e('0x62')](_0x368996)){throw new db[(_0x443e('0x63'))][(_0x443e('0x64'))](_['upperFirst']('favicon')+_0x443e('0x65'));}return _0xb41ab0[_0x443e('0x66')](_0x368996);}})[_0x443e('0x4f')](handleError(_0xb41ab0,null));};exports['getDate']=function(_0x45b3ef,_0x2b2db8){var _0x12e43c={'offset':moment()[_0x443e('0x77')]()};_0x12e43c[_0x443e('0x78')]=moment()[_0x443e('0x77')](_0x12e43c[_0x443e('0x28')])['format'](_0x443e('0x79'));return _0x2b2db8[_0x443e('0x26')](0xc8)['send'](_0x12e43c);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 5f3c04d..b5596e5 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 _0x9957=['exports','define','Setting','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./setting.attributes'];(function(_0x31ced5,_0x5d5415){var _0x10d9e5=function(_0x2e51a5){while(--_0x2e51a5){_0x31ced5['push'](_0x31ced5['shift']());}};_0x10d9e5(++_0x5d5415);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'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':'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(_0x4ad32d,_0x5840d5){var _0x231098=function(_0x183350){while(--_0x183350){_0x4ad32d['push'](_0x4ad32d['shift']());}};_0x231098(++_0x5840d5);}(_0x008c,0x188));var _0xc008=function(_0x50499c,_0x188984){_0x50499c=_0x50499c-0x0;var _0xd422b3=_0x008c[_0x50499c];return _0xd422b3;};'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 e004de5..e9f0607 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 _0xfb53=['attributes','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','then','info','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','Setting,\x20%s,\x20%s','message','result','ShowSetting','find','options','raw','include','map','model'];(function(_0x19d5d2,_0x54d565){var _0x300cbd=function(_0x33b496){while(--_0x33b496){_0x19d5d2['push'](_0x19d5d2['shift']());}};_0x300cbd(++_0x54d565);}(_0xfb53,0xb0));var _0x3fb5=function(_0x16a496,_0x2380e2){_0x16a496=_0x16a496-0x0;var _0x5d2c35=_0xfb53[_0x16a496];return _0x5d2c35;};'use strict';var _=require(_0x3fb5('0x0'));var util=require(_0x3fb5('0x1'));var moment=require(_0x3fb5('0x2'));var BPromise=require(_0x3fb5('0x3'));var rs=require(_0x3fb5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3fb5('0x5'))['db'];var utils=require(_0x3fb5('0x6'));var logger=require('../../config/logger')(_0x3fb5('0x7'));var config=require(_0x3fb5('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x51be5b,_0xc7fd76,_0x657c2){return new BPromise(function(_0x3a5c05,_0x47c7e2){return client['request'](_0x51be5b,_0x657c2)[_0x3fb5('0x9')](function(_0x1563c1){logger[_0x3fb5('0xa')]('Setting,\x20%s,\x20%s',_0xc7fd76,_0x3fb5('0xb'));logger[_0x3fb5('0xc')](_0x3fb5('0xd'),_0xc7fd76,_0x3fb5('0xb'),JSON[_0x3fb5('0xe')](_0x1563c1));if(_0x1563c1[_0x3fb5('0xf')]){if(_0x1563c1[_0x3fb5('0xf')][_0x3fb5('0x10')]===0x1f4){logger['error'](_0x3fb5('0x11'),_0xc7fd76,_0x1563c1['error'][_0x3fb5('0x12')]);return _0x47c7e2(_0x1563c1['error']['message']);}logger[_0x3fb5('0xf')](_0x3fb5('0x11'),_0xc7fd76,_0x1563c1[_0x3fb5('0xf')][_0x3fb5('0x12')]);return _0x3a5c05(_0x1563c1[_0x3fb5('0xf')][_0x3fb5('0x12')]);}else{logger[_0x3fb5('0xa')](_0x3fb5('0x11'),_0xc7fd76,'request\x20sent');_0x3a5c05(_0x1563c1[_0x3fb5('0x13')][_0x3fb5('0x12')]);}})['catch'](function(_0x32ce3e){logger[_0x3fb5('0xf')](_0x3fb5('0x11'),_0xc7fd76,_0x32ce3e);_0x47c7e2(_0x32ce3e);});});}exports[_0x3fb5('0x14')]=function(_0x1ef3b9){var _0x44f5e4=this;return new Promise(function(_0x1c24d7,_0x336c3d){return db['Setting'][_0x3fb5('0x15')]({'raw':_0x1ef3b9[_0x3fb5('0x16')]?_0x1ef3b9[_0x3fb5('0x16')][_0x3fb5('0x17')]===undefined?!![]:![]:!![],'where':_0x1ef3b9['options']?_0x1ef3b9['options']['where']||null:null,'attributes':_0x1ef3b9[_0x3fb5('0x16')]?_0x1ef3b9['options']['attributes']||null:null,'include':_0x1ef3b9['options']?_0x1ef3b9[_0x3fb5('0x16')][_0x3fb5('0x18')]?_[_0x3fb5('0x19')](_0x1ef3b9[_0x3fb5('0x16')][_0x3fb5('0x18')],function(_0x40b1bc){return{'model':db[_0x40b1bc[_0x3fb5('0x1a')]],'as':_0x40b1bc['as'],'attributes':_0x40b1bc['attributes'],'include':_0x40b1bc[_0x3fb5('0x18')]?_[_0x3fb5('0x19')](_0x40b1bc[_0x3fb5('0x18')],function(_0x593b35){return{'model':db[_0x593b35[_0x3fb5('0x1a')]],'as':_0x593b35['as'],'attributes':_0x593b35[_0x3fb5('0x1b')],'include':_0x593b35[_0x3fb5('0x18')]?_[_0x3fb5('0x19')](_0x593b35['include'],function(_0x134129){return{'model':db[_0x134129[_0x3fb5('0x1a')]],'as':_0x134129['as'],'attributes':_0x134129[_0x3fb5('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x3fb5('0x9')](function(_0x419b1f){logger[_0x3fb5('0xa')]('ShowSetting',_0x1ef3b9);logger[_0x3fb5('0xc')]('ShowSetting',_0x1ef3b9,JSON['stringify'](_0x419b1f));_0x1c24d7(_0x419b1f);})[_0x3fb5('0x1c')](function(_0x5c45a0){logger[_0x3fb5('0xf')](_0x3fb5('0x14'),_0x5c45a0[_0x3fb5('0x12')],_0x1ef3b9);_0x336c3d(_0x44f5e4['error'](0x1f4,_0x5c45a0[_0x3fb5('0x12')]));});});}; \ No newline at end of file +var _0x4e90=['randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','stringify','code','Setting,\x20%s,\x20%s','error','message','ShowSetting','Setting','find','options','raw','where','attributes','include','map','model','lodash','util','moment','bluebird'];(function(_0x27670c,_0x1d5ff0){var _0x1ec905=function(_0x30d06d){while(--_0x30d06d){_0x27670c['push'](_0x27670c['shift']());}};_0x1ec905(++_0x1d5ff0);}(_0x4e90,0x1a0));var _0x04e9=function(_0x4f9463,_0x23aa54){_0x4f9463=_0x4f9463-0x0;var _0x293a27=_0x4e90[_0x4f9463];return _0x293a27;};'use strict';var _=require(_0x04e9('0x0'));var util=require(_0x04e9('0x1'));var moment=require(_0x04e9('0x2'));var BPromise=require(_0x04e9('0x3'));var rs=require(_0x04e9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x04e9('0x5'))['db'];var utils=require(_0x04e9('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x04e9('0x7'));var jayson=require(_0x04e9('0x8'));var client=jayson[_0x04e9('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xee3f95,_0x41e85b,_0x56c7f9){return new BPromise(function(_0x6538e8,_0x3d193e){return client[_0x04e9('0xa')](_0xee3f95,_0x56c7f9)[_0x04e9('0xb')](function(_0xaf0db4){logger[_0x04e9('0xc')]('Setting,\x20%s,\x20%s',_0x41e85b,_0x04e9('0xd'));logger[_0x04e9('0xe')]('Setting,\x20%s,\x20%s,\x20%s',_0x41e85b,'request\x20sent',JSON[_0x04e9('0xf')](_0xaf0db4));if(_0xaf0db4['error']){if(_0xaf0db4['error'][_0x04e9('0x10')]===0x1f4){logger['error'](_0x04e9('0x11'),_0x41e85b,_0xaf0db4[_0x04e9('0x12')][_0x04e9('0x13')]);return _0x3d193e(_0xaf0db4['error'][_0x04e9('0x13')]);}logger[_0x04e9('0x12')]('Setting,\x20%s,\x20%s',_0x41e85b,_0xaf0db4[_0x04e9('0x12')]['message']);return _0x6538e8(_0xaf0db4[_0x04e9('0x12')][_0x04e9('0x13')]);}else{logger[_0x04e9('0xc')]('Setting,\x20%s,\x20%s',_0x41e85b,_0x04e9('0xd'));_0x6538e8(_0xaf0db4['result'][_0x04e9('0x13')]);}})['catch'](function(_0x282a7c){logger[_0x04e9('0x12')](_0x04e9('0x11'),_0x41e85b,_0x282a7c);_0x3d193e(_0x282a7c);});});}exports[_0x04e9('0x14')]=function(_0x3a093d){var _0x144fab=this;return new Promise(function(_0x3ca202,_0x3c9f07){return db[_0x04e9('0x15')][_0x04e9('0x16')]({'raw':_0x3a093d['options']?_0x3a093d[_0x04e9('0x17')][_0x04e9('0x18')]===undefined?!![]:![]:!![],'where':_0x3a093d[_0x04e9('0x17')]?_0x3a093d[_0x04e9('0x17')][_0x04e9('0x19')]||null:null,'attributes':_0x3a093d[_0x04e9('0x17')]?_0x3a093d[_0x04e9('0x17')][_0x04e9('0x1a')]||null:null,'include':_0x3a093d[_0x04e9('0x17')]?_0x3a093d['options'][_0x04e9('0x1b')]?_[_0x04e9('0x1c')](_0x3a093d['options'][_0x04e9('0x1b')],function(_0x1c2139){return{'model':db[_0x1c2139['model']],'as':_0x1c2139['as'],'attributes':_0x1c2139[_0x04e9('0x1a')],'include':_0x1c2139['include']?_[_0x04e9('0x1c')](_0x1c2139['include'],function(_0x329bdb){return{'model':db[_0x329bdb[_0x04e9('0x1d')]],'as':_0x329bdb['as'],'attributes':_0x329bdb[_0x04e9('0x1a')],'include':_0x329bdb[_0x04e9('0x1b')]?_['map'](_0x329bdb[_0x04e9('0x1b')],function(_0x430da2){return{'model':db[_0x430da2[_0x04e9('0x1d')]],'as':_0x430da2['as'],'attributes':_0x430da2[_0x04e9('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x04e9('0xb')](function(_0x99198d){logger[_0x04e9('0xc')](_0x04e9('0x14'),_0x3a093d);logger[_0x04e9('0xe')](_0x04e9('0x14'),_0x3a093d,JSON[_0x04e9('0xf')](_0x99198d));_0x3ca202(_0x99198d);})['catch'](function(_0x3f2bf5){logger[_0x04e9('0x12')]('ShowSetting',_0x3f2bf5[_0x04e9('0x13')],_0x3a093d);_0x3c9f07(_0x144fab[_0x04e9('0x12')](0x1f4,_0x3f2bf5['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 499ce00..180b9e2 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 _0x8ef6=['addApplications','/:id/send','send','status','update','delete','destroy','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','/describe','isAuthenticated','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','/:id/status','statusGet','/:id/users','getAgents','create','post','addDisposition','addAnswer','notify'];(function(_0x7ba05c,_0x3abdf6){var _0x3920ae=function(_0x562189){while(--_0x562189){_0x7ba05c['push'](_0x7ba05c['shift']());}};_0x3920ae(++_0x3abdf6);}(_0x8ef6,0xf2));var _0x68ef=function(_0x1cde35,_0x5276ec){_0x1cde35=_0x1cde35-0x0;var _0x3f2db5=_0x8ef6[_0x1cde35];return _0x3f2db5;};'use strict';var multer=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var path=require(_0x68ef('0x2'));var timeout=require(_0x68ef('0x3'));var express=require(_0x68ef('0x4'));var router=express[_0x68ef('0x5')]();var fs_extra=require(_0x68ef('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x68ef('0x7'));var config=require(_0x68ef('0x8'));var controller=require(_0x68ef('0x9'));router[_0x68ef('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x68ef('0xa')](_0x68ef('0xb'),auth[_0x68ef('0xc')](),controller['describe']);router[_0x68ef('0xa')](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0xe')]);router[_0x68ef('0xa')](_0x68ef('0xf'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x10')]);router[_0x68ef('0xa')](_0x68ef('0x11'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x12')]);router['get'](_0x68ef('0x13'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x14')]);router[_0x68ef('0xa')](_0x68ef('0x15'),auth[_0x68ef('0xc')](),controller['getInteractions']);router[_0x68ef('0xa')](_0x68ef('0x16'),controller[_0x68ef('0x17')]);router['get'](_0x68ef('0x18'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x19')]);router['post']('/',auth[_0x68ef('0xc')](),controller[_0x68ef('0x1a')]);router[_0x68ef('0x1b')](_0x68ef('0xf'),auth['isAuthenticated'](),controller[_0x68ef('0x1c')]);router['post']('/:id/canned_answers',auth[_0x68ef('0xc')](),controller[_0x68ef('0x1d')]);router['post']('/:id/notify',controller[_0x68ef('0x1e')]);router[_0x68ef('0x1b')](_0x68ef('0x13'),auth['isAuthenticated'](),controller[_0x68ef('0x1f')]);router[_0x68ef('0x1b')](_0x68ef('0x20'),auth['isAuthenticated'](),controller[_0x68ef('0x21')]);router[_0x68ef('0x1b')]('/:id/status',controller[_0x68ef('0x22')]);router[_0x68ef('0x1b')](_0x68ef('0x18'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x23')]);router[_0x68ef('0x24')](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x25')]);router[_0x68ef('0x24')](_0x68ef('0xf'),auth[_0x68ef('0xc')](),controller['removeDispositions']);router[_0x68ef('0x24')]('/:id/canned_answers',auth['isAuthenticated'](),controller['removeAnswers']);router[_0x68ef('0x24')](_0x68ef('0x18'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x26')]);module['exports']=router; \ No newline at end of file +var _0x1cb9=['/:id/canned_answers','getAnswers','getApplications','/:id/interactions','getInteractions','/:id/users','post','create','addAnswer','/:id/notify','notify','/:id/applications','/:id/send','/:id/status','status','addAgents','put','update','delete','destroy','removeDispositions','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x1cb9,0x14e));var _0x91cb=function(_0x4beb48,_0x4a67e6){_0x4beb48=_0x4beb48-0x0;var _0x5adc65=_0x1cb9[_0x4beb48];return _0x5adc65;};'use strict';var multer=require(_0x91cb('0x0'));var util=require('util');var path=require(_0x91cb('0x1'));var timeout=require(_0x91cb('0x2'));var express=require(_0x91cb('0x3'));var router=express[_0x91cb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x91cb('0x5'));var interaction=require(_0x91cb('0x6'));var config=require('../../config/environment');var controller=require(_0x91cb('0x7'));router[_0x91cb('0x8')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0xa')]);router[_0x91cb('0x8')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0xc')]);router['get'](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0xe')]);router[_0x91cb('0x8')](_0x91cb('0xf'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x10')]);router[_0x91cb('0x8')](_0x91cb('0x11'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x12')]);router[_0x91cb('0x8')]('/:id/applications',auth[_0x91cb('0x9')](),controller[_0x91cb('0x13')]);router['get'](_0x91cb('0x14'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x15')]);router[_0x91cb('0x8')]('/:id/status',controller['statusGet']);router[_0x91cb('0x8')](_0x91cb('0x16'),auth['isAuthenticated'](),controller['getAgents']);router[_0x91cb('0x17')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0x18')]);router['post'](_0x91cb('0xf'),auth[_0x91cb('0x9')](),controller['addDisposition']);router[_0x91cb('0x17')](_0x91cb('0x11'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x19')]);router['post'](_0x91cb('0x1a'),controller[_0x91cb('0x1b')]);router['post'](_0x91cb('0x1c'),auth['isAuthenticated'](),controller['addApplications']);router[_0x91cb('0x17')](_0x91cb('0x1d'),auth['isAuthenticated'](),controller['send']);router['post'](_0x91cb('0x1e'),controller[_0x91cb('0x1f')]);router[_0x91cb('0x17')](_0x91cb('0x16'),auth['isAuthenticated'](),controller[_0x91cb('0x20')]);router[_0x91cb('0x21')](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0x22')]);router[_0x91cb('0x23')](_0x91cb('0xd'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x24')]);router[_0x91cb('0x23')](_0x91cb('0xf'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x25')]);router['delete']('/:id/canned_answers',auth[_0x91cb('0x9')](),controller['removeAnswers']);router[_0x91cb('0x23')](_0x91cb('0x16'),auth[_0x91cb('0x9')](),controller['removeAgents']);module[_0x91cb('0x26')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 84baba4..ebf29ec 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 _0x64ba=['generate','clicksend','csc','infobip','ENUM','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','randomstring','STRING'];(function(_0xffa198,_0x5a8940){var _0x1e4b50=function(_0x1f1c43){while(--_0x1f1c43){_0xffa198['push'](_0xffa198['shift']());}};_0x1e4b50(++_0x5a8940);}(_0x64ba,0xb1));var _0xa64b=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0x64ba[_0x565ed7];return _0x183ad7;};'use strict';var Sequelize=require(_0xa64b('0x0'));var rs=require(_0xa64b('0x1'));module['exports']={'name':{'type':Sequelize[_0xa64b('0x2')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0xa64b('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0xa64b('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0xa64b('0x2')],'defaultValue':function(){return rs[_0xa64b('0x3')]();}},'phone':{'type':Sequelize[_0xa64b('0x2')]},'type':{'type':Sequelize['ENUM']('twilio','skebby','connectel',_0xa64b('0x4'),'plivo','clickatell','bandwidth',_0xa64b('0x5'),_0xa64b('0x6'),'intelepeer')},'accountSid':{'type':Sequelize[_0xa64b('0x2')]},'authId':{'type':Sequelize[_0xa64b('0x2')]},'authToken':{'type':Sequelize[_0xa64b('0x2')]},'smsMethod':{'type':Sequelize[_0xa64b('0x7')]('SI','TI','GP')},'username':{'type':Sequelize[_0xa64b('0x2')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0xa64b('0x2')]},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize[_0xa64b('0x2')]},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0xa64b('0x2')]},'notificationTemplate':{'type':Sequelize[_0xa64b('0x8')],'defaultValue':function(){return _0xa64b('0x9');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xa64b('0xa')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xa64b('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xa64b('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa64b('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa64b('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa64b('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa64b('0xb')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xa64b('0xa')],'defaultValue':![],'comment':_0xa64b('0xc'),'set':function(_0x4697dc){if(!_0x4697dc)this[_0xa64b('0xd')]('mandatoryDispositionPauseId',null);this[_0xa64b('0xd')](_0xa64b('0xe'),_0x4697dc);}}}; \ No newline at end of file +var _0x219a=['STRING','generate','ENUM','skebby','clicksend','clickatell','csc','infobip','intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','randomstring'];(function(_0x1f7406,_0x9cae1b){var _0x2608be=function(_0x3282b6){while(--_0x3282b6){_0x1f7406['push'](_0x1f7406['shift']());}};_0x2608be(++_0x9cae1b);}(_0x219a,0x1e4));var _0xa219=function(_0x1f33fd,_0x4f5623){_0x1f33fd=_0x1f33fd-0x0;var _0x9a9a2d=_0x219a[_0x1f33fd];return _0x9a9a2d;};'use strict';var Sequelize=require(_0xa219('0x0'));var rs=require(_0xa219('0x1'));module['exports']={'name':{'type':Sequelize[_0xa219('0x2')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0xa219('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0xa219('0x2')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xa219('0x3')]();}},'phone':{'type':Sequelize[_0xa219('0x2')]},'type':{'type':Sequelize[_0xa219('0x4')]('twilio',_0xa219('0x5'),'connectel',_0xa219('0x6'),'plivo',_0xa219('0x7'),'bandwidth',_0xa219('0x8'),_0xa219('0x9'),_0xa219('0xa'))},'accountSid':{'type':Sequelize[_0xa219('0x2')]},'authId':{'type':Sequelize[_0xa219('0x2')]},'authToken':{'type':Sequelize[_0xa219('0x2')]},'smsMethod':{'type':Sequelize[_0xa219('0x4')]('SI','TI','GP')},'username':{'type':Sequelize[_0xa219('0x2')]},'password':{'type':Sequelize[_0xa219('0x2')]},'apiKey':{'type':Sequelize[_0xa219('0x2')]},'applicationId':{'type':Sequelize[_0xa219('0x2')]},'accountId':{'type':Sequelize[_0xa219('0x2')]},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize[_0xa219('0xb')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xa219('0xc')],'defaultValue':function(){return _0xa219('0xd');}},'notificationSound':{'type':Sequelize[_0xa219('0xb')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xa219('0xb')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa219('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa219('0xb')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xa219('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa219('0xe')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xa219('0xb')],'defaultValue':![],'comment':_0xa219('0xf'),'set':function(_0x4a6f1c){if(!_0x4a6f1c)this[_0xa219('0x10')](_0xa219('0x11'),null);this[_0xa219('0x10')]('mandatoryDisposition',_0x4a6f1c);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 26336fe..5ed01ec 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 _0xfb73=['ContactId','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','startRouting','Start','receiveMessage','entity\x20found','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','send','\x0a','addApplications','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','Owner','fullname','internal','Tags','color','tag','to\x20is\x20mandatory','CmList','List','ListId','out','Messages','dataValues','received\x20delivery\x20report\x20from','skebby_dispatch_id','requestid','statusInt','status_code','groupName','DELIVERED','inspect','error_code','DELIVERED_TO_GATEWAY','ACCEPTD','statusGet','state','message-id','addAgents','removeAgents','emit','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','jayson/promise','client','http','request','info','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','SmsAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','offset','undefined','limit','count','set','apply','update','then','SmsAccounts','UserProfileResource','destroy','end','stack','name','index','mandatoryDispositionPause','map','SmsAccount','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','Pause','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','params','SmsAccountId','Disposition','getDispositions','removeDispositions','ids','CannedAnswer','findOne','removeAnswers','sms','SmsApplication','account','applications','orderBy','Applications','priority','asc','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','mobile','twilio','From','messageId','skebby','from','sender','text','connectel','clicksend','message_id','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','bandwidth','intelepeer','refid','isNil','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','Contacts','DESC','list','omit','CmContact','contact','SmsInteraction','spread','interaction','created','autoclose','close','unmanaged','*,*,*,*','SmsMessage'];(function(_0x33cf30,_0x1d61c8){var _0x4ea338=function(_0x1f44b2){while(--_0x1f44b2){_0x33cf30['push'](_0x33cf30['shift']());}};_0x4ea338(++_0x1d61c8);}(_0xfb73,0x119));var _0x3fb7=function(_0x24b6da,_0x23bd55){_0x24b6da=_0x24b6da-0x0;var _0x464dd9=_0xfb73[_0x24b6da];return _0x464dd9;};'use strict';var emlformat=require(_0x3fb7('0x0'));var rimraf=require(_0x3fb7('0x1'));var zipdir=require(_0x3fb7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3fb7('0x3'));var moment=require('moment');var BPromise=require(_0x3fb7('0x4'));var Mustache=require('mustache');var util=require(_0x3fb7('0x5'));var path=require('path');var sox=require(_0x3fb7('0x6'));var csv=require(_0x3fb7('0x7'));var ejs=require(_0x3fb7('0x8'));var fs=require('fs');var fs_extra=require(_0x3fb7('0x9'));var _=require(_0x3fb7('0xa'));var squel=require(_0x3fb7('0xb'));var crypto=require(_0x3fb7('0xc'));var jsforce=require(_0x3fb7('0xd'));var deskjs=require(_0x3fb7('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3fb7('0xf'));var Redis=require(_0x3fb7('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3fb7('0x11'));var as=require(_0x3fb7('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3fb7('0x13'))(_0x3fb7('0x14'));var utils=require(_0x3fb7('0x15'));var config=require(_0x3fb7('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x3fb7('0x17'))['db'];config[_0x3fb7('0x18')]=_[_0x3fb7('0x19')](config[_0x3fb7('0x18')],{'host':_0x3fb7('0x1a'),'port':0x18eb});var socket=require(_0x3fb7('0x1b'))(new Redis(config[_0x3fb7('0x18')]));require('./smsAccount.socket')['register'](socket);var jayson=require(_0x3fb7('0x1c'));var client=jayson[_0x3fb7('0x1d')][_0x3fb7('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x30664e,_0x3c2eef,_0x361ac3,_0x218405){return new BPromise(function(_0x2cffe5,_0x82df9f){var _0x50cdd2=_0x218405||client;return _0x50cdd2[_0x3fb7('0x1f')](_0x30664e,_0x361ac3)['then'](function(_0x127d67){logger[_0x3fb7('0x20')]('SmsAccount,\x20%s,\x20%s',_0x3c2eef,'request\x20sent');logger['debug'](_0x3fb7('0x21'),_0x3c2eef,_0x3fb7('0x22'),JSON['stringify'](_0x127d67));if(_0x127d67[_0x3fb7('0x23')]){if(_0x127d67[_0x3fb7('0x23')][_0x3fb7('0x24')]===0x1f4){logger[_0x3fb7('0x23')](_0x3fb7('0x25'),_0x3c2eef,_0x127d67[_0x3fb7('0x23')]['message']);return _0x82df9f(_0x127d67[_0x3fb7('0x23')]['message']);}logger['error']('SmsAccount,\x20%s,\x20%s',_0x3c2eef,_0x127d67[_0x3fb7('0x23')][_0x3fb7('0x26')]);return _0x2cffe5(_0x127d67[_0x3fb7('0x23')][_0x3fb7('0x26')]);}else{logger[_0x3fb7('0x20')](_0x3fb7('0x25'),_0x3c2eef,'request\x20sent');_0x2cffe5(_0x127d67[_0x3fb7('0x27')]['message']);}})[_0x3fb7('0x28')](function(_0x2139fd){logger[_0x3fb7('0x23')](_0x3fb7('0x25'),_0x3c2eef,_0x2139fd);_0x82df9f(_0x2139fd);});});}function respondWithStatusCode(_0x4d98b4,_0x1f536d){_0x1f536d=_0x1f536d||0xcc;return function(_0x21bc9e){if(_0x21bc9e){return _0x4d98b4[_0x3fb7('0x29')](_0x1f536d);}return _0x4d98b4[_0x3fb7('0x2a')](_0x1f536d)['end']();};}function respondWithResult(_0x5f2e7a,_0x8cb9cb){_0x8cb9cb=_0x8cb9cb||0xc8;return function(_0x590b24){if(_0x590b24){return _0x5f2e7a[_0x3fb7('0x2a')](_0x8cb9cb)['json'](_0x590b24);}};}function respondWithFilteredResult(_0x12a8fb,_0x1d2996){return function(_0x4e3f80){if(_0x4e3f80){var _0x2399d7=typeof _0x1d2996[_0x3fb7('0x2b')]===_0x3fb7('0x2c')&&typeof _0x1d2996[_0x3fb7('0x2d')]==='undefined';var _0x5e0c85=_0x4e3f80[_0x3fb7('0x2e')];var _0x21e988=_0x2399d7?0x0:_0x1d2996[_0x3fb7('0x2b')];var _0x3799e0=_0x2399d7?_0x4e3f80[_0x3fb7('0x2e')]:_0x1d2996[_0x3fb7('0x2b')]+_0x1d2996[_0x3fb7('0x2d')];var _0x18cf53;if(_0x3799e0>=_0x5e0c85){_0x3799e0=_0x5e0c85;_0x18cf53=0xc8;}else{_0x18cf53=0xce;}_0x12a8fb[_0x3fb7('0x2a')](_0x18cf53);return _0x12a8fb[_0x3fb7('0x2f')]('Content-Range',_0x21e988+'-'+_0x3799e0+'/'+_0x5e0c85)['json'](_0x4e3f80);}return null;};}function patchUpdates(_0x954e58){return function(_0x569b65){try{jsonpatch[_0x3fb7('0x30')](_0x569b65,_0x954e58,!![]);}catch(_0x39fc4f){return BPromise['reject'](_0x39fc4f);}return _0x569b65['save']();};}function saveUpdates(_0xfa8fe4,_0x50eaf8){return function(_0x3b4f4d){if(_0x3b4f4d){return _0x3b4f4d[_0x3fb7('0x31')](_0xfa8fe4)[_0x3fb7('0x32')](function(_0x1cc0f5){return _0x1cc0f5;});}return null;};}function removeEntity(_0x1521e6,_0x974f98){return function(_0x22b681){if(_0x22b681){return _0x22b681['destroy']()['then'](function(){var _0x240bd0=_0x22b681['get']({'plain':!![]});var _0x3631c9=_0x3fb7('0x33');return db[_0x3fb7('0x34')][_0x3fb7('0x35')]({'where':{'type':_0x3631c9,'resourceId':_0x240bd0['id']}})[_0x3fb7('0x32')](function(){return _0x22b681;});})[_0x3fb7('0x32')](function(){_0x1521e6[_0x3fb7('0x2a')](0xcc)[_0x3fb7('0x36')]();});}};}function handleEntityNotFound(_0x1154db,_0x2e5479){return function(_0x58f935){if(!_0x58f935){_0x1154db['sendStatus'](0x194);}return _0x58f935;};}function handleError(_0x57e26d,_0x40407d){_0x40407d=_0x40407d||0x1f4;return function(_0x2bdb67){logger[_0x3fb7('0x23')](_0x2bdb67[_0x3fb7('0x37')]);if(_0x2bdb67[_0x3fb7('0x38')]){delete _0x2bdb67[_0x3fb7('0x38')];}_0x57e26d[_0x3fb7('0x2a')](_0x40407d)['send'](_0x2bdb67);};}exports[_0x3fb7('0x39')]=function(_0x11b4f9,_0x2acd85){var _0x52118e={'include':[{'model':db['Pause'],'as':_0x3fb7('0x3a')}]},_0x482cda={},_0x516b63={'count':0x0,'rows':[]};var _0x3b89e7=_[_0x3fb7('0x3b')](db[_0x3fb7('0x3c')][_0x3fb7('0x3d')],function(_0x321a32){return{'name':_0x321a32['fieldName'],'type':_0x321a32[_0x3fb7('0x3e')][_0x3fb7('0x3f')]};});_0x482cda[_0x3fb7('0x40')]=_[_0x3fb7('0x3b')](_0x3b89e7,_0x3fb7('0x38'));_0x482cda[_0x3fb7('0x41')]=_[_0x3fb7('0x42')](_0x11b4f9[_0x3fb7('0x41')]);_0x482cda[_0x3fb7('0x43')]=_['intersection'](_0x482cda['model'],_0x482cda[_0x3fb7('0x41')]);_0x52118e[_0x3fb7('0x44')]=_[_0x3fb7('0x45')](_0x482cda[_0x3fb7('0x40')],qs[_0x3fb7('0x46')](_0x11b4f9[_0x3fb7('0x41')][_0x3fb7('0x46')]));_0x52118e[_0x3fb7('0x44')]=_0x52118e[_0x3fb7('0x44')][_0x3fb7('0x47')]?_0x52118e[_0x3fb7('0x44')]:_0x482cda['model'];if(!_0x11b4f9[_0x3fb7('0x41')][_0x3fb7('0x48')](_0x3fb7('0x49'))){_0x52118e[_0x3fb7('0x2d')]=qs[_0x3fb7('0x2d')](_0x11b4f9[_0x3fb7('0x41')][_0x3fb7('0x2d')]);_0x52118e[_0x3fb7('0x2b')]=qs['offset'](_0x11b4f9[_0x3fb7('0x41')][_0x3fb7('0x2b')]);}_0x52118e[_0x3fb7('0x4a')]=qs[_0x3fb7('0x4b')](_0x11b4f9['query'][_0x3fb7('0x4b')]);_0x52118e['where']=qs[_0x3fb7('0x43')](_[_0x3fb7('0x4c')](_0x11b4f9[_0x3fb7('0x41')],_0x482cda[_0x3fb7('0x43')]),_0x3b89e7);if(_0x11b4f9[_0x3fb7('0x41')][_0x3fb7('0x4d')]){_0x52118e[_0x3fb7('0x4e')]=_[_0x3fb7('0x4f')](_0x52118e[_0x3fb7('0x4e')],{'$or':_[_0x3fb7('0x3b')](_0x3b89e7,function(_0x1bc9fe){if(_0x1bc9fe[_0x3fb7('0x3e')]!=='VIRTUAL'){var _0x1f1b85={};_0x1f1b85[_0x1bc9fe[_0x3fb7('0x38')]]={'$like':'%'+_0x11b4f9[_0x3fb7('0x41')][_0x3fb7('0x4d')]+'%'};return _0x1f1b85;}})});}_0x52118e=_[_0x3fb7('0x4f')]({},_0x52118e,_0x11b4f9[_0x3fb7('0x50')]);var _0x20047d={'where':_0x52118e['where']};return db[_0x3fb7('0x3c')][_0x3fb7('0x2e')](_0x20047d)[_0x3fb7('0x32')](function(_0x276a45){_0x516b63['count']=_0x276a45;if(_0x11b4f9[_0x3fb7('0x41')][_0x3fb7('0x51')]){_0x52118e[_0x3fb7('0x52')]=[{'all':!![]}];}return db[_0x3fb7('0x3c')][_0x3fb7('0x53')](_0x52118e);})[_0x3fb7('0x32')](function(_0x4260d2){_0x516b63[_0x3fb7('0x54')]=_0x4260d2;return _0x516b63;})[_0x3fb7('0x32')](respondWithFilteredResult(_0x2acd85,_0x52118e))['catch'](handleError(_0x2acd85,null));};exports['show']=function(_0xd580da,_0x10d932){var _0x34791e={'raw':![],'where':{'id':_0xd580da['params']['id']},'include':[{'model':db[_0x3fb7('0x55')],'as':_0x3fb7('0x3a')}]},_0x369715={};_0x369715['model']=_[_0x3fb7('0x42')](db['SmsAccount'][_0x3fb7('0x3d')]);_0x369715['query']=_[_0x3fb7('0x42')](_0xd580da[_0x3fb7('0x41')]);_0x369715[_0x3fb7('0x43')]=_[_0x3fb7('0x45')](_0x369715[_0x3fb7('0x40')],_0x369715[_0x3fb7('0x41')]);_0x34791e[_0x3fb7('0x44')]=_['intersection'](_0x369715[_0x3fb7('0x40')],qs[_0x3fb7('0x46')](_0xd580da[_0x3fb7('0x41')][_0x3fb7('0x46')]));_0x34791e[_0x3fb7('0x44')]=_0x34791e[_0x3fb7('0x44')]['length']?_0x34791e[_0x3fb7('0x44')]:_0x369715[_0x3fb7('0x40')];if(_0xd580da[_0x3fb7('0x41')][_0x3fb7('0x51')]){_0x34791e['include']=[{'all':!![]}];}_0x34791e=_[_0x3fb7('0x4f')]({},_0x34791e,_0xd580da[_0x3fb7('0x50')]);return db[_0x3fb7('0x3c')]['find'](_0x34791e)['then'](handleEntityNotFound(_0x10d932,null))[_0x3fb7('0x32')](respondWithResult(_0x10d932,null))[_0x3fb7('0x28')](handleError(_0x10d932,null));};exports[_0x3fb7('0x56')]=function(_0x30fdb7,_0xb8d223){return db[_0x3fb7('0x3c')][_0x3fb7('0x56')](_0x30fdb7[_0x3fb7('0x57')],{})[_0x3fb7('0x32')](function(_0x750cd1){var _0x21be39=_0x30fdb7['user'][_0x3fb7('0x58')]({'plain':!![]});if(!_0x21be39)throw new Error(_0x3fb7('0x59'));if(_0x21be39[_0x3fb7('0x5a')]===_0x3fb7('0x5b')){var _0x1fc3bf=_0x750cd1['get']({'plain':!![]});var _0xa5b755='SmsAccounts';return db[_0x3fb7('0x5c')][_0x3fb7('0x5d')]({'where':{'name':_0xa5b755,'userProfileId':_0x21be39[_0x3fb7('0x5e')]},'raw':!![]})[_0x3fb7('0x32')](function(_0x254f77){if(_0x254f77&&_0x254f77[_0x3fb7('0x5f')]===0x0){return db[_0x3fb7('0x34')][_0x3fb7('0x56')]({'name':_0x1fc3bf[_0x3fb7('0x38')],'resourceId':_0x1fc3bf['id'],'type':_0x254f77[_0x3fb7('0x38')],'sectionId':_0x254f77['id']},{})[_0x3fb7('0x32')](function(){return _0x750cd1;});}else{return _0x750cd1;}})[_0x3fb7('0x28')](function(_0x4b6282){logger['error'](_0x3fb7('0x60'),_0x4b6282);throw _0x4b6282;});}return _0x750cd1;})[_0x3fb7('0x32')](respondWithResult(_0xb8d223,0xc9))[_0x3fb7('0x28')](handleError(_0xb8d223,null));};exports[_0x3fb7('0x31')]=function(_0x2e93a8,_0x59d088){if(_0x2e93a8[_0x3fb7('0x57')]['id']){delete _0x2e93a8[_0x3fb7('0x57')]['id'];}return db['SmsAccount'][_0x3fb7('0x5d')]({'where':{'id':_0x2e93a8['params']['id']},'include':[{'model':db[_0x3fb7('0x55')],'as':_0x3fb7('0x3a')}]})[_0x3fb7('0x32')](handleEntityNotFound(_0x59d088,null))[_0x3fb7('0x32')](saveUpdates(_0x2e93a8[_0x3fb7('0x57')],null))[_0x3fb7('0x32')](respondWithResult(_0x59d088,null))['catch'](handleError(_0x59d088,null));};exports[_0x3fb7('0x35')]=function(_0xf2c426,_0x457bf0){return db[_0x3fb7('0x3c')][_0x3fb7('0x5d')]({'where':{'id':_0xf2c426['params']['id']}})[_0x3fb7('0x32')](handleEntityNotFound(_0x457bf0,null))['then'](removeEntity(_0x457bf0,null))[_0x3fb7('0x28')](handleError(_0x457bf0,null));};exports[_0x3fb7('0x61')]=function(_0x1d2469,_0x3f3827){return db['SmsAccount'][_0x3fb7('0x61')]()['then'](respondWithResult(_0x3f3827,null))['catch'](handleError(_0x3f3827,null));};exports[_0x3fb7('0x62')]=function(_0x269cd7,_0x4e1b0c,_0x39b506){if(_0x269cd7[_0x3fb7('0x57')]['id']){delete _0x269cd7['body']['id'];}return db['SmsAccount'][_0x3fb7('0x5d')]({'where':{'id':_0x269cd7[_0x3fb7('0x63')]['id']}})[_0x3fb7('0x32')](handleEntityNotFound(_0x4e1b0c,null))[_0x3fb7('0x32')](function(_0x103cb3){if(_0x103cb3){_0x269cd7[_0x3fb7('0x57')][_0x3fb7('0x64')]=_0x103cb3['id'];return db[_0x3fb7('0x65')][_0x3fb7('0x56')](_0x269cd7[_0x3fb7('0x57')]);}})['then'](respondWithResult(_0x4e1b0c,null))[_0x3fb7('0x28')](handleError(_0x4e1b0c,null));};exports[_0x3fb7('0x66')]=function(_0x4efd1d,_0x24b62a,_0x5b5a79){var _0x206779={'raw':![],'where':{}};var _0x31c913={};var _0x5c855c={'count':0x0,'rows':[]};return db[_0x3fb7('0x3c')]['findOne']({'where':{'id':_0x4efd1d['params']['id']}})['then'](handleEntityNotFound(_0x24b62a,null))[_0x3fb7('0x32')](function(_0x5576f7){if(_0x5576f7){_0x31c913[_0x3fb7('0x40')]=_['keys'](db[_0x3fb7('0x65')][_0x3fb7('0x3d')]);_0x31c913[_0x3fb7('0x41')]=_[_0x3fb7('0x42')](_0x4efd1d['query']);_0x31c913[_0x3fb7('0x43')]=_[_0x3fb7('0x45')](_0x31c913[_0x3fb7('0x40')],_0x31c913[_0x3fb7('0x41')]);_0x206779[_0x3fb7('0x44')]=_[_0x3fb7('0x45')](_0x31c913['model'],qs[_0x3fb7('0x46')](_0x4efd1d[_0x3fb7('0x41')][_0x3fb7('0x46')]));_0x206779['attributes']=_0x206779[_0x3fb7('0x44')]['length']?_0x206779[_0x3fb7('0x44')]:_0x31c913[_0x3fb7('0x40')];if(!_0x4efd1d[_0x3fb7('0x41')][_0x3fb7('0x48')](_0x3fb7('0x49'))){_0x206779[_0x3fb7('0x2d')]=qs['limit'](_0x4efd1d[_0x3fb7('0x41')]['limit']);_0x206779['offset']=qs['offset'](_0x4efd1d[_0x3fb7('0x41')]['offset']);}_0x206779[_0x3fb7('0x4a')]=qs['sort'](_0x4efd1d[_0x3fb7('0x41')][_0x3fb7('0x4b')]);_0x206779[_0x3fb7('0x4e')]=qs[_0x3fb7('0x43')](_[_0x3fb7('0x4c')](_0x4efd1d[_0x3fb7('0x41')],_0x31c913[_0x3fb7('0x43')]));_0x206779[_0x3fb7('0x4e')][_0x3fb7('0x64')]=_0x5576f7['id'];if(_0x4efd1d[_0x3fb7('0x41')][_0x3fb7('0x4d')]){_0x206779[_0x3fb7('0x4e')]=_[_0x3fb7('0x4f')](_0x206779['where'],{'$or':_[_0x3fb7('0x3b')](_0x206779[_0x3fb7('0x44')],function(_0x1685e1){var _0x478943={};_0x478943[_0x1685e1]={'$like':'%'+_0x4efd1d[_0x3fb7('0x41')]['filter']+'%'};return _0x478943;})});}_0x206779=_[_0x3fb7('0x4f')]({},_0x206779,_0x4efd1d[_0x3fb7('0x50')]);return db[_0x3fb7('0x65')][_0x3fb7('0x2e')]({'where':_0x206779['where']})['then'](function(_0xabf330){_0x5c855c[_0x3fb7('0x2e')]=_0xabf330;if(_0x4efd1d['query'][_0x3fb7('0x51')]){_0x206779['include']=[{'all':!![]}];}return db[_0x3fb7('0x65')][_0x3fb7('0x53')](_0x206779);})['then'](function(_0x5b0c02){_0x5c855c[_0x3fb7('0x54')]=_0x5b0c02;return _0x5c855c;});}})[_0x3fb7('0x32')](respondWithFilteredResult(_0x24b62a,_0x206779))['catch'](handleError(_0x24b62a,null));};exports['removeDispositions']=function(_0x41c1b2,_0x1a4378,_0x4e4874){return db[_0x3fb7('0x3c')][_0x3fb7('0x5d')]({'where':{'id':_0x41c1b2[_0x3fb7('0x63')]['id']}})[_0x3fb7('0x32')](handleEntityNotFound(_0x1a4378,null))[_0x3fb7('0x32')](function(_0x4e3f6f){if(_0x4e3f6f){return _0x4e3f6f[_0x3fb7('0x67')](_0x41c1b2['query'][_0x3fb7('0x68')]);}})[_0x3fb7('0x32')](respondWithStatusCode(_0x1a4378,null))[_0x3fb7('0x28')](handleError(_0x1a4378,null));};exports['addAnswer']=function(_0x128744,_0x54ad88,_0x2eb84f){if(_0x128744[_0x3fb7('0x57')]['id']){delete _0x128744[_0x3fb7('0x57')]['id'];}return db['SmsAccount'][_0x3fb7('0x5d')]({'where':{'id':_0x128744[_0x3fb7('0x63')]['id']}})[_0x3fb7('0x32')](handleEntityNotFound(_0x54ad88,null))[_0x3fb7('0x32')](function(_0x5a8eb2){if(_0x5a8eb2){_0x128744[_0x3fb7('0x57')][_0x3fb7('0x64')]=_0x5a8eb2['id'];return db[_0x3fb7('0x69')][_0x3fb7('0x56')](_0x128744[_0x3fb7('0x57')]);}})[_0x3fb7('0x32')](respondWithResult(_0x54ad88,null))[_0x3fb7('0x28')](handleError(_0x54ad88,null));};exports['getAnswers']=function(_0x565586,_0xb7ba0,_0x27290d){var _0x4d3155={'raw':![],'where':{}};var _0x1f6ab5={};var _0x5814b1={'count':0x0,'rows':[]};return db[_0x3fb7('0x3c')][_0x3fb7('0x6a')]({'where':{'id':_0x565586[_0x3fb7('0x63')]['id']}})[_0x3fb7('0x32')](handleEntityNotFound(_0xb7ba0,null))[_0x3fb7('0x32')](function(_0x41a217){if(_0x41a217){_0x1f6ab5[_0x3fb7('0x40')]=_[_0x3fb7('0x42')](db[_0x3fb7('0x69')][_0x3fb7('0x3d')]);_0x1f6ab5[_0x3fb7('0x41')]=_[_0x3fb7('0x42')](_0x565586[_0x3fb7('0x41')]);_0x1f6ab5[_0x3fb7('0x43')]=_[_0x3fb7('0x45')](_0x1f6ab5[_0x3fb7('0x40')],_0x1f6ab5[_0x3fb7('0x41')]);_0x4d3155[_0x3fb7('0x44')]=_[_0x3fb7('0x45')](_0x1f6ab5[_0x3fb7('0x40')],qs[_0x3fb7('0x46')](_0x565586[_0x3fb7('0x41')][_0x3fb7('0x46')]));_0x4d3155['attributes']=_0x4d3155[_0x3fb7('0x44')][_0x3fb7('0x47')]?_0x4d3155['attributes']:_0x1f6ab5[_0x3fb7('0x40')];if(!_0x565586[_0x3fb7('0x41')][_0x3fb7('0x48')]('nolimit')){_0x4d3155[_0x3fb7('0x2d')]=qs['limit'](_0x565586[_0x3fb7('0x41')][_0x3fb7('0x2d')]);_0x4d3155[_0x3fb7('0x2b')]=qs['offset'](_0x565586['query'][_0x3fb7('0x2b')]);}_0x4d3155[_0x3fb7('0x4a')]=qs[_0x3fb7('0x4b')](_0x565586[_0x3fb7('0x41')][_0x3fb7('0x4b')]);_0x4d3155[_0x3fb7('0x4e')]=qs[_0x3fb7('0x43')](_[_0x3fb7('0x4c')](_0x565586[_0x3fb7('0x41')],_0x1f6ab5['filters']));_0x4d3155['where'][_0x3fb7('0x64')]=_0x41a217['id'];if(_0x565586[_0x3fb7('0x41')]['filter']){_0x4d3155[_0x3fb7('0x4e')]=_[_0x3fb7('0x4f')](_0x4d3155[_0x3fb7('0x4e')],{'$or':_[_0x3fb7('0x3b')](_0x4d3155[_0x3fb7('0x44')],function(_0x2ba446){var _0x43fad2={};_0x43fad2[_0x2ba446]={'$like':'%'+_0x565586['query'][_0x3fb7('0x4d')]+'%'};return _0x43fad2;})});}_0x4d3155=_[_0x3fb7('0x4f')]({},_0x4d3155,_0x565586[_0x3fb7('0x50')]);return db[_0x3fb7('0x69')][_0x3fb7('0x2e')]({'where':_0x4d3155[_0x3fb7('0x4e')]})[_0x3fb7('0x32')](function(_0x3b0adf){_0x5814b1[_0x3fb7('0x2e')]=_0x3b0adf;if(_0x565586[_0x3fb7('0x41')]['includeAll']){_0x4d3155[_0x3fb7('0x52')]=[{'all':!![]}];}return db[_0x3fb7('0x69')][_0x3fb7('0x53')](_0x4d3155);})[_0x3fb7('0x32')](function(_0x47705b){_0x5814b1['rows']=_0x47705b;return _0x5814b1;});}})[_0x3fb7('0x32')](respondWithFilteredResult(_0xb7ba0,_0x4d3155))[_0x3fb7('0x28')](handleError(_0xb7ba0,null));};exports[_0x3fb7('0x6b')]=function(_0x2c8533,_0x58f277,_0x2e7c5b){return db[_0x3fb7('0x3c')][_0x3fb7('0x5d')]({'where':{'id':_0x2c8533[_0x3fb7('0x63')]['id']}})[_0x3fb7('0x32')](handleEntityNotFound(_0x58f277,null))[_0x3fb7('0x32')](function(_0x3813b3){if(_0x3813b3){return _0x3813b3[_0x3fb7('0x6b')](_0x2c8533[_0x3fb7('0x41')][_0x3fb7('0x68')]);}})[_0x3fb7('0x32')](respondWithStatusCode(_0x58f277,null))[_0x3fb7('0x28')](handleError(_0x58f277,null));};exports['notify']=function(_0x5970c9,_0x30a7b2,_0x49ac2b){var _0x81afc0={'channel':_0x3fb7('0x6c')};var _0x265b31=[];var _0x2098b7=[];var _0x305ff0={};return db['SmsAccount']['find']({'where':{'id':_0x5970c9[_0x3fb7('0x63')]['id']},'include':[{'model':db[_0x3fb7('0x6d')],'as':'Applications'}]})[_0x3fb7('0x32')](handleEntityNotFound(_0x30a7b2,null))['then'](function(_0x503ac0){_0x81afc0[_0x3fb7('0x6e')]=_0x503ac0;_0x81afc0[_0x3fb7('0x6f')]=_[_0x3fb7('0x70')](_0x503ac0[_0x3fb7('0x71')],[_0x3fb7('0x72')],[_0x3fb7('0x73')]);if(_0x81afc0[_0x3fb7('0x6e')][_0x3fb7('0x71')]){delete _0x81afc0[_0x3fb7('0x6e')][_0x3fb7('0x71')];}return db['CmContact'][_0x3fb7('0x61')]();})[_0x3fb7('0x32')](function(_0xc3dd1){if(!_0xc3dd1){throw new db[(_0x3fb7('0x74'))][(_0x3fb7('0x75'))](_0x3fb7('0x76'));}_0x265b31=_[_0x3fb7('0x77')](_[_0x3fb7('0x42')](_0xc3dd1),[_0x3fb7('0x78'),_0x3fb7('0x79')]);_0x2098b7=_['difference'](_[_0x3fb7('0x42')](_0xc3dd1),[_0x3fb7('0x78'),'updatedAt',_0x3fb7('0x7a'),'ListId']);_0x81afc0['body']={'mapKey':_0x3fb7('0x7b')};if(_0x81afc0[_0x3fb7('0x6e')][_0x3fb7('0x3e')]){switch(_0x81afc0[_0x3fb7('0x6e')]['type']){case _0x3fb7('0x7c'):_0x81afc0[_0x3fb7('0x57')]['from']=_0x5970c9['body'][_0x3fb7('0x7d')];_0x81afc0[_0x3fb7('0x57')][_0x3fb7('0x57')]=_0x5970c9[_0x3fb7('0x57')]['Body'];_0x81afc0[_0x3fb7('0x57')][_0x3fb7('0x7e')]=_0x5970c9[_0x3fb7('0x57')]['MessageSid'];break;case _0x3fb7('0x7f'):_0x81afc0[_0x3fb7('0x57')][_0x3fb7('0x80')]='+'+_0x5970c9[_0x3fb7('0x57')][_0x3fb7('0x81')];_0x81afc0[_0x3fb7('0x57')][_0x3fb7('0x57')]=_0x5970c9[_0x3fb7('0x57')][_0x3fb7('0x82')];break;case _0x3fb7('0x83'):_0x81afc0[_0x3fb7('0x57')]['from']=_0x5970c9[_0x3fb7('0x57')]['from'];_0x81afc0[_0x3fb7('0x57')][_0x3fb7('0x57')]=_0x5970c9[_0x3fb7('0x57')][_0x3fb7('0x26')];break;case _0x3fb7('0x84'):_0x81afc0[_0x3fb7('0x57')][_0x3fb7('0x80')]=_0x5970c9['body'][_0x3fb7('0x80')];_0x81afc0[_0x3fb7('0x57')][_0x3fb7('0x57')]=_0x5970c9[_0x3fb7('0x57')][_0x3fb7('0x57')];_0x81afc0[_0x3fb7('0x57')][_0x3fb7('0x7e')]=_0x5970c9[_0x3fb7('0x57')][_0x3fb7('0x85')];break;case'plivo':_0x81afc0[_0x3fb7('0x57')][_0x3fb7('0x80')]=_0x5970c9[_0x3fb7('0x57')][_0x3fb7('0x7d')];_0x81afc0['body'][_0x3fb7('0x57')]=_0x5970c9[_0x3fb7('0x57')][_0x3fb7('0x86')];_0x81afc0['body'][_0x3fb7('0x7e')]=_0x5970c9[_0x3fb7('0x57')][_0x3fb7('0x87')];break;case _0x3fb7('0x88'):_0x81afc0['body'][_0x3fb7('0x80')]='+'+_0x5970c9['body']['results'][0x0][_0x3fb7('0x80')];_0x81afc0['body'][_0x3fb7('0x57')]=_0x5970c9[_0x3fb7('0x57')][_0x3fb7('0x89')][0x0]['text'];_0x81afc0[_0x3fb7('0x57')][_0x3fb7('0x7e')]=_0x5970c9[_0x3fb7('0x57')][_0x3fb7('0x89')][0x0]['messageId'];break;case _0x3fb7('0x8a'):_0x81afc0['body'][_0x3fb7('0x80')]=_0x5970c9[_0x3fb7('0x57')][_0x3fb7('0x8b')];_0x81afc0[_0x3fb7('0x57')][_0x3fb7('0x57')]=_0x5970c9[_0x3fb7('0x57')][_0x3fb7('0x8c')][_0x3fb7('0x26')];break;case _0x3fb7('0x8d'):_0x81afc0[_0x3fb7('0x57')][_0x3fb7('0x80')]=_0x5970c9[_0x3fb7('0x57')][_0x3fb7('0x8e')];_0x81afc0[_0x3fb7('0x57')]['body']=_0x5970c9[_0x3fb7('0x57')][_0x3fb7('0x82')];_0x81afc0[_0x3fb7('0x57')]['messageId']=_0x5970c9[_0x3fb7('0x57')][_0x3fb7('0x8f')];break;case _0x3fb7('0x90'):_0x81afc0[_0x3fb7('0x57')]['messageId']=_0x5970c9[_0x3fb7('0x57')][0x0]['message']['id'];_0x81afc0[_0x3fb7('0x57')][_0x3fb7('0x80')]=_0x5970c9[_0x3fb7('0x57')][0x0][_0x3fb7('0x26')][_0x3fb7('0x80')];_0x81afc0[_0x3fb7('0x57')][_0x3fb7('0x57')]=_0x5970c9[_0x3fb7('0x57')][0x0][_0x3fb7('0x26')][_0x3fb7('0x82')];break;case _0x3fb7('0x91'):_0x81afc0[_0x3fb7('0x57')]['from']=_0x5970c9['body'][_0x3fb7('0x80')];_0x81afc0[_0x3fb7('0x57')]['body']=_0x5970c9['body'][_0x3fb7('0x26')];_0x81afc0[_0x3fb7('0x57')]['messageId']=_0x5970c9[_0x3fb7('0x57')][_0x3fb7('0x92')];break;}}if(_0x81afc0[_0x3fb7('0x57')]['id']){delete _0x81afc0[_0x3fb7('0x57')]['id'];}if(_[_0x3fb7('0x93')](_0x81afc0['body'][_0x3fb7('0x80')])){throw new db[(_0x3fb7('0x74'))][(_0x3fb7('0x75'))](_0x3fb7('0x94'));}if(_[_0x3fb7('0x93')](_0x81afc0[_0x3fb7('0x57')]['body'])||_0x81afc0['body'][_0x3fb7('0x57')]===''){throw new db[(_0x3fb7('0x74'))]['ValidationError'](_0x3fb7('0x95'));}if(_['isNil'](_0x81afc0['body']['mapKey'])){throw new db[(_0x3fb7('0x74'))]['ValidationError'](_0x3fb7('0x96')+_0x2098b7);}if(!_[_0x3fb7('0x97')](_0x2098b7,_0x81afc0['body'][_0x3fb7('0x98')])){throw new db[(_0x3fb7('0x74'))]['ValidationError'](_0x3fb7('0x99')+_0x2098b7);}_0x305ff0[_0x81afc0[_0x3fb7('0x57')][_0x3fb7('0x98')]]=_0x81afc0['body'][_0x3fb7('0x80')];return db['CmList'][_0x3fb7('0x5d')]({'where':{'id':_0x81afc0[_0x3fb7('0x6e')]['ListId']},'include':[{'model':db['CmContact'],'as':_0x3fb7('0x9a'),'where':_0x305ff0,'limit':0x1,'order':[['updatedAt',_0x3fb7('0x9b')]]}]});})['then'](handleEntityNotFound(_0x30a7b2,null))['then'](function(_0xbf9fc7){if(_0xbf9fc7){_0x81afc0[_0x3fb7('0x9c')]=_[_0x3fb7('0x9d')](_0xbf9fc7,['Contacts']);if(_0xbf9fc7[_0x3fb7('0x9a')][_0x3fb7('0x47')]){return _0xbf9fc7['Contacts'][0x0];}var _0x1047c1=_[_0x3fb7('0x19')](_0x81afc0[_0x3fb7('0x57')],{'firstName':_0x81afc0[_0x3fb7('0x57')][_0x3fb7('0x80')],'ListId':_0xbf9fc7['id']});_0x1047c1[_0x81afc0['body']['mapKey']]=_0x81afc0[_0x3fb7('0x57')][_0x3fb7('0x80')];return db[_0x3fb7('0x9e')]['create'](_0x1047c1,{'fields':_0x265b31,'raw':!![]});}})['then'](handleEntityNotFound(_0x30a7b2,null))['then'](function(_0x3e4a48){if(_0x3e4a48){_0x81afc0[_0x3fb7('0x9f')]=_0x3e4a48;var _0x222b9c={'ContactId':_0x3e4a48['id'],'phone':_0x81afc0[_0x3fb7('0x57')][_0x3fb7('0x80')],'SmsAccountId':_0x5970c9[_0x3fb7('0x63')]['id']};var _0x576550={'ContactId':_0x3e4a48['id'],'SmsAccountId':_0x5970c9['params']['id'],'closed':![]};return db['SmsInteraction']['find']({'where':_0x576550})[_0x3fb7('0x32')](function(_0x4a1536){if(_0x4a1536){return[_0x4a1536,![]];}return db[_0x3fb7('0xa0')]['create'](_0x222b9c)[_0x3fb7('0x32')](function(_0x1c7e19){return[_0x1c7e19,!![]];});});}})[_0x3fb7('0xa1')](function(_0x58ab5c,_0x34fdcd){_0x81afc0[_0x3fb7('0xa2')]=_0x58ab5c[_0x3fb7('0x58')]({'plain':!![]});_0x81afc0[_0x3fb7('0xa2')][_0x3fb7('0xa3')]=![];if(_0x34fdcd){if(_0x81afc0[_0x3fb7('0x6e')][_0x3fb7('0xa4')]){_0x81afc0['applications']['push']({'id':0x0,'priority':_0x81afc0[_0x3fb7('0x6f')][_0x3fb7('0x47')]+0x1,'app':_0x3fb7('0xa5'),'appdata':_0x3fb7('0xa6'),'interval':_0x3fb7('0xa7')});}_0x81afc0[_0x3fb7('0xa2')]['created']=!![];}return db[_0x3fb7('0xa8')]['create']({'phone':_0x81afc0[_0x3fb7('0x57')]['from'],'messageId':_0x81afc0[_0x3fb7('0x57')][_0x3fb7('0x7e')],'body':_0x81afc0[_0x3fb7('0x57')][_0x3fb7('0x57')],'SmsAccountId':_0x5970c9[_0x3fb7('0x63')]['id'],'SmsInteractionId':_0x58ab5c['id'],'direction':'in','ContactId':_0x58ab5c[_0x3fb7('0xa9')],'AttachmentId':_0x81afc0[_0x3fb7('0x57')][_0x3fb7('0xaa')]});})[_0x3fb7('0x32')](function(_0x144349){_0x81afc0[_0x3fb7('0x26')]=_0x144349;if(_0x81afc0[_0x3fb7('0xa2')][_0x3fb7('0xab')]){return db[_0x3fb7('0xac')][_0x3fb7('0x5d')]({'attributes':['id','name'],'where':{'id':_0x81afc0[_0x3fb7('0xa2')]['UserId']}})[_0x3fb7('0x32')](function(_0x2049ee){if(_0x2049ee){_0x81afc0[_0x3fb7('0x6f')][_0x3fb7('0xad')]({'id':0x0,'priority':0x0,'app':_0x3fb7('0xae'),'appdata':_0x2049ee[_0x3fb7('0x38')]+','+(_0x81afc0['account'][_0x3fb7('0xaf')]||0xa),'interval':_0x3fb7('0xa7')});}return respondWithRpcPromise('Start',_0x3fb7('0xb0'),_0x81afc0);});}return respondWithRpcPromise(_0x3fb7('0xb1'),_0x3fb7('0xb0'),_0x81afc0);})['then'](function(_0x24a7a9){if(_0x24a7a9){var _0x2fd134=0xc8;var _0x1a3e5d=_0x3fb7('0xb2');logger['info'](_0x3fb7('0x21'),_0x1a3e5d,_0x2fd134,_0x3fb7('0xb3'));logger[_0x3fb7('0xb4')](_0x3fb7('0xb5'),_0x1a3e5d,_0x2fd134,_0x3fb7('0xb3'),JSON['stringify'](_0x24a7a9));if(_0x81afc0[_0x3fb7('0x6e')]['type']===_0x3fb7('0x7c')){return _0x30a7b2[_0x3fb7('0x2a')](_0x2fd134)['set'](_0x3fb7('0xb6'),'text/xml')[_0x3fb7('0xb7')](_0x3fb7('0xb8'));}else{return _0x30a7b2[_0x3fb7('0x2a')](_0x2fd134)['json'](_0x24a7a9);}}})[_0x3fb7('0x28')](handleError(_0x30a7b2,null));};exports[_0x3fb7('0xb9')]=function(_0x3ecf4f,_0x5a258b,_0x37adc5){return db[_0x3fb7('0x3c')]['findOne']({'where':{'id':_0x3ecf4f[_0x3fb7('0x63')]['id']}})[_0x3fb7('0x32')](handleEntityNotFound(_0x5a258b,null))['then'](function(_0x2b6ef5){if(_0x2b6ef5){return db[_0x3fb7('0xba')][_0x3fb7('0xbb')](function(_0x133ab7){return db[_0x3fb7('0x6d')][_0x3fb7('0x35')]({'where':{'SmsAccountId':_0x3ecf4f[_0x3fb7('0x63')]['id']},'transaction':_0x133ab7})[_0x3fb7('0x32')](function(_0x59b7d9){var _0x5415c9=_['map'](_0x3ecf4f[_0x3fb7('0x57')],function(_0x5f0894){_0x5f0894[_0x3fb7('0x64')]=_0x3ecf4f[_0x3fb7('0x63')]['id'];return _0x5f0894;});return db['SmsApplication'][_0x3fb7('0xbc')](_0x5415c9,{'transaction':_0x133ab7});});})[_0x3fb7('0x32')](function(){return db['SmsApplication'][_0x3fb7('0xbd')]({'where':{'SmsAccountId':_0x3ecf4f['params']['id']},'order':'priority'});});}})[_0x3fb7('0x32')](respondWithResult(_0x5a258b,null))[_0x3fb7('0x28')](handleError(_0x5a258b,null));};exports[_0x3fb7('0xbe')]=function(_0x25b00,_0x144d5f,_0x28b91c){var _0xfb3dc6={};var _0x5f4014={};var _0x2fa9a4;var _0x535f79;return db[_0x3fb7('0x3c')][_0x3fb7('0x6a')]({'where':{'id':_0x25b00[_0x3fb7('0x63')]['id']}})[_0x3fb7('0x32')](handleEntityNotFound(_0x144d5f,null))['then'](function(_0xea0fcf){if(_0xea0fcf){_0x2fa9a4=_0xea0fcf;_0x5f4014[_0x3fb7('0x40')]=_[_0x3fb7('0x42')](db['SmsApplication'][_0x3fb7('0x3d')]);_0x5f4014[_0x3fb7('0x41')]=_[_0x3fb7('0x42')](_0x25b00[_0x3fb7('0x41')]);_0x5f4014[_0x3fb7('0x43')]=_[_0x3fb7('0x45')](_0x5f4014[_0x3fb7('0x40')],_0x5f4014[_0x3fb7('0x41')]);_0xfb3dc6[_0x3fb7('0x44')]=_[_0x3fb7('0x45')](_0x5f4014[_0x3fb7('0x40')],qs[_0x3fb7('0x46')](_0x25b00[_0x3fb7('0x41')][_0x3fb7('0x46')]));_0xfb3dc6[_0x3fb7('0x44')]=_0xfb3dc6[_0x3fb7('0x44')][_0x3fb7('0x47')]?_0xfb3dc6[_0x3fb7('0x44')]:_0x5f4014[_0x3fb7('0x40')];_0xfb3dc6[_0x3fb7('0x4a')]=qs['sort'](_0x25b00[_0x3fb7('0x41')]['sort']);_0xfb3dc6['where']=qs[_0x3fb7('0x43')](_[_0x3fb7('0x4c')](_0x25b00[_0x3fb7('0x41')],_0x5f4014[_0x3fb7('0x43')]));if(_0x25b00['query'][_0x3fb7('0x4d')]){_0xfb3dc6[_0x3fb7('0x4e')]=_['merge'](_0xfb3dc6[_0x3fb7('0x4e')],{'$or':_['map'](_0xfb3dc6[_0x3fb7('0x44')],function(_0x12ac40){var _0x4f34fe={};_0x4f34fe[_0x12ac40]={'$like':'%'+_0x25b00[_0x3fb7('0x41')][_0x3fb7('0x4d')]+'%'};return _0x4f34fe;})});}_0xfb3dc6=_[_0x3fb7('0x4f')]({},_0xfb3dc6,_0x25b00[_0x3fb7('0x50')]);return _0x2fa9a4[_0x3fb7('0xbe')](_0xfb3dc6);}})['then'](function(_0x33606e){if(_0x33606e){_0x535f79=_0x33606e[_0x3fb7('0x47')];if(!_0x25b00['query'][_0x3fb7('0x48')]('nolimit')){_0xfb3dc6[_0x3fb7('0x2d')]=qs[_0x3fb7('0x2d')](_0x25b00['query']['limit']);_0xfb3dc6['offset']=qs['offset'](_0x25b00[_0x3fb7('0x41')]['offset']);}return _0x2fa9a4['getApplications'](_0xfb3dc6);}})[_0x3fb7('0x32')](function(_0x8271d6){if(_0x8271d6){return _0x8271d6?{'count':_0x535f79,'rows':_0x8271d6}:null;}})[_0x3fb7('0x32')](respondWithResult(_0x144d5f,null))[_0x3fb7('0x28')](handleError(_0x144d5f,null));};exports[_0x3fb7('0xbf')]=function(_0x27dcb3,_0x1e4731,_0x4d90a4){var _0x4cf4cd={'raw':![],'where':{}};var _0x3aacf2={};var _0x1042ac={'count':0x0,'rows':[]};return db[_0x3fb7('0x3c')][_0x3fb7('0x6a')]({'where':{'id':_0x27dcb3['params']['id']}})['then'](handleEntityNotFound(_0x1e4731,null))[_0x3fb7('0x32')](function(_0x44ea61){if(_0x44ea61){_0x3aacf2[_0x3fb7('0x40')]=_['keys'](db[_0x3fb7('0xa0')]['rawAttributes']);_0x3aacf2[_0x3fb7('0x41')]=_[_0x3fb7('0x42')](_0x27dcb3[_0x3fb7('0x41')]);_0x3aacf2['filters']=_['intersection'](_0x3aacf2[_0x3fb7('0x40')],_0x3aacf2[_0x3fb7('0x41')]);_0x4cf4cd[_0x3fb7('0x44')]=_[_0x3fb7('0x45')](_0x3aacf2[_0x3fb7('0x40')],qs[_0x3fb7('0x46')](_0x27dcb3[_0x3fb7('0x41')]['fields']));_0x4cf4cd['attributes']=_0x4cf4cd['attributes']['length']?_0x4cf4cd['attributes']:_0x3aacf2['model'];if(!_0x27dcb3['query']['hasOwnProperty'](_0x3fb7('0x49'))){_0x4cf4cd[_0x3fb7('0x2d')]=qs['limit'](_0x27dcb3[_0x3fb7('0x41')]['limit']);_0x4cf4cd[_0x3fb7('0x2b')]=qs['offset'](_0x27dcb3[_0x3fb7('0x41')]['offset']);}_0x4cf4cd[_0x3fb7('0x4a')]=qs[_0x3fb7('0x4b')](_0x27dcb3[_0x3fb7('0x41')][_0x3fb7('0x4b')]);_0x4cf4cd['where']=qs[_0x3fb7('0x43')](_[_0x3fb7('0x4c')](_0x27dcb3[_0x3fb7('0x41')],_0x3aacf2[_0x3fb7('0x43')]));_0x4cf4cd[_0x3fb7('0x4e')]['SmsAccountId']=_0x44ea61['id'];if(_0x27dcb3[_0x3fb7('0x41')][_0x3fb7('0x4d')]){_0x4cf4cd[_0x3fb7('0x4e')]=_[_0x3fb7('0x4f')](_0x4cf4cd['where'],{'$or':_[_0x3fb7('0x3b')](_0x4cf4cd['attributes'],function(_0x49c539){var _0x1a66d3={};_0x1a66d3[_0x49c539]={'$like':'%'+_0x27dcb3[_0x3fb7('0x41')][_0x3fb7('0x4d')]+'%'};return _0x1a66d3;})});}_0x4cf4cd=_[_0x3fb7('0x4f')]({},_0x4cf4cd,_0x27dcb3[_0x3fb7('0x50')]);return db[_0x3fb7('0xa0')][_0x3fb7('0x2e')]({'where':_0x4cf4cd[_0x3fb7('0x4e')]})['then'](function(_0x25ad10){_0x1042ac[_0x3fb7('0x2e')]=_0x25ad10;if(_0x27dcb3['query']['includeAll']){_0x4cf4cd[_0x3fb7('0x52')]=[{'model':db['CmContact'],'as':_0x3fb7('0xc0'),'required':![]},{'model':db[_0x3fb7('0xac')],'as':_0x3fb7('0xc1'),'attributes':[_0x3fb7('0x38'),_0x3fb7('0xc2'),_0x3fb7('0xc3')],'required':![]},{'model':db['Tag'],'as':_0x3fb7('0xc4'),'attributes':['id',_0x3fb7('0x38'),_0x3fb7('0xc5')],'where':_0x27dcb3[_0x3fb7('0x41')][_0x3fb7('0xc6')]?{'id':_0x27dcb3[_0x3fb7('0x41')]['tag']}:undefined,'required':_0x27dcb3[_0x3fb7('0x41')][_0x3fb7('0xc6')]?!![]:![]}];}return db[_0x3fb7('0xa0')][_0x3fb7('0x53')](_0x4cf4cd);})['then'](function(_0x535458){_0x1042ac[_0x3fb7('0x54')]=_0x535458;return _0x1042ac;});}})[_0x3fb7('0x32')](respondWithFilteredResult(_0x1e4731,_0x4cf4cd))[_0x3fb7('0x28')](handleError(_0x1e4731,null));};exports[_0x3fb7('0xb7')]=function(_0x33491e,_0xdb3cf2,_0x47b52d){var _0x44661d,_0x357ae2,_0x43c647;if(_[_0x3fb7('0x93')](_0x33491e[_0x3fb7('0x57')][_0x3fb7('0x57')])||_0x33491e[_0x3fb7('0x57')]['body']===''){throw new db['Sequelize'][(_0x3fb7('0x75'))](_0x3fb7('0x95'));}if(_[_0x3fb7('0x93')](_0x33491e[_0x3fb7('0x57')]['to'])){throw new db[(_0x3fb7('0x74'))][(_0x3fb7('0x75'))](_0x3fb7('0xc7'));}_0x44661d=_0x33491e['body']['to'];return db[_0x3fb7('0x3c')]['find']({'where':{'id':_0x33491e[_0x3fb7('0x63')]['id']},'include':[{'model':db[_0x3fb7('0xc8')],'as':_0x3fb7('0xc9'),'include':[{'model':db[_0x3fb7('0x9e')],'as':'Contacts','where':{'mobile':_0x44661d},'limit':0x1,'order':[[_0x3fb7('0x79'),_0x3fb7('0x9b')]]}]}]})[_0x3fb7('0x32')](handleEntityNotFound(_0xdb3cf2,null))[_0x3fb7('0x32')](function(_0x4aae88){if(_0x4aae88&&_0x4aae88[_0x3fb7('0xc9')]){_0x357ae2=_0x4aae88[_0x3fb7('0x58')]({'plain':!![]});if(_0x357ae2[_0x3fb7('0xc9')]&&_0x357ae2[_0x3fb7('0xc9')][_0x3fb7('0x9a')][_0x3fb7('0x47')]){return _0x357ae2[_0x3fb7('0xc9')][_0x3fb7('0x9a')][0x0];}return db['CmContact'][_0x3fb7('0x56')](_[_0x3fb7('0x19')](_0x33491e[_0x3fb7('0x57')],{'firstName':_0x44661d,'mobile':_0x44661d,'phone':_0x44661d,'ListId':_0x357ae2[_0x3fb7('0xca')]}));}})['then'](handleEntityNotFound(_0xdb3cf2,null))[_0x3fb7('0x32')](function(_0x5761a3){if(_0x5761a3){_0x43c647=_0x5761a3;return db[_0x3fb7('0xa0')]['find']({'where':{'ContactId':_0x43c647['id'],'closed':![],'SmsAccountId':_0x357ae2['id']}})[_0x3fb7('0x32')](function(_0x456446){if(_0x456446){return[_0x456446,![]];}return db[_0x3fb7('0xa0')][_0x3fb7('0x56')]({'UserId':_0x33491e[_0x3fb7('0x5b')]['id'],'ContactId':_0x43c647['id'],'SmsAccountId':_0x357ae2['id'],'phone':_0x44661d,'firstMsgDirection':_0x3fb7('0xcb'),'Messages':[_[_0x3fb7('0x4f')](_0x33491e[_0x3fb7('0x57')],{'read':![],'body':_0x33491e['body']['body'],'phone':_0x44661d,'SmsAccountId':_0x357ae2['id'],'UserId':_0x33491e['user']['id'],'ContactId':_0x43c647['id']})]},{'include':[{'model':db[_0x3fb7('0xa8')],'as':_0x3fb7('0xcc')}]})[_0x3fb7('0x32')](function(_0x34b39e){return[_0x34b39e,!![]];});});}})['spread'](function(_0x15c7ac,_0x3b65ef){if(_0x3b65ef){return _0x15c7ac;}return db[_0x3fb7('0xa8')][_0x3fb7('0x56')](_[_0x3fb7('0x4f')](_0x33491e['body'],{'read':![],'body':_0x33491e['body']['body'],'phone':_0x44661d,'SmsAccountId':_0x357ae2['id'],'SmsInteractionId':_0x15c7ac['id'],'UserId':_0x33491e[_0x3fb7('0x5b')]['id'],'ContactId':_0x43c647['id']}))[_0x3fb7('0x32')](function(_0xe23eac){_0x15c7ac[_0x3fb7('0xcd')][_0x3fb7('0xcc')]=[];_0x15c7ac[_0x3fb7('0xcd')][_0x3fb7('0xcc')]['push'](_0xe23eac['dataValues']);return _0x15c7ac;});})['then'](respondWithResult(_0xdb3cf2,null))[_0x3fb7('0x28')](handleError(_0xdb3cf2,null));};exports[_0x3fb7('0x2a')]=function(_0x59341e,_0x262ccc,_0x479be4){if(_0x59341e[_0x3fb7('0x57')]['id']){delete _0x59341e['body']['id'];}var _0x1687f6,_0x3622da,_0x74172b;return db[_0x3fb7('0x3c')]['find']({'where':{'id':_0x59341e[_0x3fb7('0x63')]['id']}})[_0x3fb7('0x32')](handleEntityNotFound(_0x262ccc,null))[_0x3fb7('0x32')](function(_0x19c708){if(_0x19c708){_0x74172b=_0x19c708;logger[_0x3fb7('0xb4')](_0x3fb7('0x21'),_0x3fb7('0x2a'),_0x3fb7('0xce'),_0x19c708[_0x3fb7('0x3e')],util['inspect'](_0x59341e[_0x3fb7('0x57')],{'showHidden':![],'depth':null}));switch(_0x19c708[_0x3fb7('0x3e')]){case _0x3fb7('0x7f'):if(_0x59341e[_0x3fb7('0x57')][_0x3fb7('0xcf')]&&_0x59341e['body'][_0x3fb7('0x2a')]){_0x3622da=_0x59341e['body']['status'];return db[_0x3fb7('0xa8')][_0x3fb7('0x5d')]({'where':{'messageId':_0x59341e[_0x3fb7('0x57')]['skebby_dispatch_id']}});}break;case'connectel':if(_0x59341e[_0x3fb7('0x57')][_0x3fb7('0xd0')]&&_0x59341e[_0x3fb7('0x57')]['statusInt']){_0x3622da=_0x59341e[_0x3fb7('0x57')][_0x3fb7('0xd1')];return db['SmsMessage']['find']({'where':{'messageId':_0x59341e[_0x3fb7('0x57')]['requestid']}});}break;case _0x3fb7('0x84'):if(_0x59341e[_0x3fb7('0x57')][_0x3fb7('0x85')]&&_0x59341e['body'][_0x3fb7('0xd2')]){_0x3622da=_0x59341e['body'][_0x3fb7('0xd2')];return db['SmsMessage'][_0x3fb7('0x5d')]({'where':{'messageId':_0x59341e[_0x3fb7('0x57')][_0x3fb7('0x85')]}});}break;case _0x3fb7('0x88'):var _0x25b381=_0x59341e[_0x3fb7('0x57')][_0x3fb7('0x89')][0x0];if(_0x25b381[_0x3fb7('0x7e')]&&_0x25b381[_0x3fb7('0x2a')][_0x3fb7('0xd3')]===_0x3fb7('0xd4')){_0x3622da=_0x25b381[_0x3fb7('0x2a')][_0x3fb7('0xd3')];return db[_0x3fb7('0xa8')][_0x3fb7('0x5d')]({'where':{'messageId':_0x25b381['messageId']}});}break;case _0x3fb7('0x8d'):if(_0x59341e['body'][_0x3fb7('0x7e')]&&_0x59341e['body'][_0x3fb7('0x2a')]){_0x3622da=_0x59341e[_0x3fb7('0x57')]['status'];return db['SmsMessage']['find']({'where':{'messageId':_0x59341e[_0x3fb7('0x57')][_0x3fb7('0x7e')]}});}break;case'bandwidth':if(_0x59341e[_0x3fb7('0x57')][0x0][_0x3fb7('0x26')]['id']){_0x3622da=_0x59341e[_0x3fb7('0x57')][0x0][_0x3fb7('0x3e')];return db[_0x3fb7('0xa8')]['find']({'where':{'messageId':_0x59341e[_0x3fb7('0x57')][0x0]['message']['id']}});}break;case'intelepeer':if(_0x59341e[_0x3fb7('0x57')]['redif']&&_0x59341e[_0x3fb7('0x57')][_0x3fb7('0x2a')]){_0x3622da=_0x59341e[_0x3fb7('0x57')][_0x3fb7('0x2a')];return db['SmsMessage'][_0x3fb7('0x5d')]({'where':{'messageId':_0x59341e[_0x3fb7('0x57')]['redif']}});}break;}}})[_0x3fb7('0x32')](handleEntityNotFound(_0x262ccc,null))[_0x3fb7('0x32')](function(_0x501f42){if(_0x501f42){_0x1687f6=_0x501f42;switch(_0x74172b[_0x3fb7('0x3e')]){case _0x3fb7('0x7f'):if(_0x3622da===_0x3fb7('0xd4')){return _0x1687f6[_0x3fb7('0x31')]({'read':!![]});}else{logger['error'](_0x3fb7('0x21'),'status','skebby',util[_0x3fb7('0xd5')](_0x59341e['body'],{'showHidden':![],'depth':null}));}break;case _0x3fb7('0x83'):if(_0x3622da==='1'){return _0x1687f6[_0x3fb7('0x31')]({'read':!![]});}else{logger[_0x3fb7('0x23')](_0x3fb7('0x21'),_0x3fb7('0x2a'),'skebby',util['inspect'](_0x59341e[_0x3fb7('0x57')],{'showHidden':![],'depth':null}));}break;case _0x3fb7('0x84'):if(!_0x59341e['body'][_0x3fb7('0xd6')]&&_0x3622da>=0xc8&&_0x3622da<=0xce){return _0x1687f6[_0x3fb7('0x31')]({'read':!![]});}else{logger[_0x3fb7('0x23')](_0x3fb7('0x21'),_0x3fb7('0x2a'),_0x3fb7('0x84'),util[_0x3fb7('0xd5')](_0x59341e[_0x3fb7('0x57')],{'showHidden':![],'depth':null}));}break;case _0x3fb7('0x88'):var _0x2f2ff7=_0x59341e[_0x3fb7('0x57')]['results'][0x0];if(_0x2f2ff7[_0x3fb7('0x2a')]['groupName']==='DELIVERED'){return _0x1687f6['update']({'read':!![]});}else{logger[_0x3fb7('0x23')](_0x3fb7('0x21'),_0x3fb7('0x2a'),'infobip',util[_0x3fb7('0xd5')](_0x59341e['body'],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x3622da==_0x3fb7('0xd7')||_0x3622da=='RECEIVED_BY_RECIPIENT'){return _0x1687f6[_0x3fb7('0x31')]({'read':!![]});}else{logger['error'](_0x3fb7('0x21'),_0x3fb7('0x2a'),_0x3fb7('0x8d'),util[_0x3fb7('0xd5')](_0x59341e[_0x3fb7('0x57')],{'showHidden':![],'depth':null}));}break;case _0x3fb7('0x90'):if(_0x3622da=='message-delivered'){return _0x1687f6['update']({'read':!![]});}else{logger[_0x3fb7('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x3fb7('0x90'),util['inspect'](_0x59341e['body'],{'showHidden':![],'depth':null}));}break;case _0x3fb7('0x91'):if(_0x3622da==='DELIVRD'||_0x3622da===_0x3fb7('0xd8')){return _0x1687f6['update']({'read':!![]});}else{logger[_0x3fb7('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x3fb7('0x2a'),'intelepeer',util[_0x3fb7('0xd5')](_0x59341e[_0x3fb7('0x57')],{'showHidden':![],'depth':null}));}break;}return _0x1687f6;}})[_0x3fb7('0x32')](respondWithResult(_0x262ccc,null))[_0x3fb7('0x28')](handleError(_0x262ccc,null));};exports[_0x3fb7('0xd9')]=function(_0xf11bb3,_0x33a9ae,_0x29c863){var _0x46ccfc,_0x3c9dd2,_0xc72094;return db[_0x3fb7('0x3c')]['find']({'where':{'id':_0xf11bb3['params']['id']}})[_0x3fb7('0x32')](handleEntityNotFound(_0x33a9ae,null))[_0x3fb7('0x32')](function(_0xdf860d){if(_0xdf860d){_0xc72094=_0xdf860d;logger['debug'](_0x3fb7('0x21'),_0x3fb7('0x2a'),_0x3fb7('0xce'),_0xdf860d[_0x3fb7('0x3e')],util[_0x3fb7('0xd5')](_0xf11bb3[_0x3fb7('0x41')],{'showHidden':![],'depth':null}));switch(_0xdf860d[_0x3fb7('0x3e')]){case _0x3fb7('0x8a'):if(_0xf11bb3['query']['message-id']&&_0xf11bb3['query'][_0x3fb7('0xda')]){_0x3c9dd2=_0xf11bb3[_0x3fb7('0x41')][_0x3fb7('0xda')];return db[_0x3fb7('0xa8')]['find']({'where':{'messageId':_0xf11bb3[_0x3fb7('0x41')][_0x3fb7('0xdb')]}});}break;}}})[_0x3fb7('0x32')](handleEntityNotFound(_0x33a9ae,null))['then'](function(_0x509bc4){if(_0x509bc4){_0x46ccfc=_0x509bc4;switch(_0xc72094[_0x3fb7('0x3e')]){case'csc':if(_0x3c9dd2==='2'||_0x3c9dd2==='6'){return _0x46ccfc['update']({'read':!![]});}else{logger[_0x3fb7('0x23')](_0x3fb7('0x21'),_0x3fb7('0x2a'),'csc',util[_0x3fb7('0xd5')](_0xf11bb3['query'],{'showHidden':![],'depth':null}));};break;}return _0x46ccfc;}})[_0x3fb7('0x32')](respondWithResult(_0x33a9ae,null))[_0x3fb7('0x28')](handleError(_0x33a9ae,null));};exports['addAgents']=function(_0x330a0e,_0x2e7f09,_0x142d69){return db[_0x3fb7('0x3c')]['find']({'where':{'id':_0x330a0e[_0x3fb7('0x63')]['id']}})['then'](handleEntityNotFound(_0x2e7f09,null))[_0x3fb7('0x32')](function(_0x599e89){if(_0x599e89){return _0x599e89[_0x3fb7('0xdc')](_0x330a0e[_0x3fb7('0x57')]['ids'],_[_0x3fb7('0x9d')](_0x330a0e['body'],[_0x3fb7('0x68'),'id'])||{})['spread'](function(_0x31846e){for(var _0x3d1cbe=0x0;_0x3d1cbe<_0x330a0e[_0x3fb7('0x57')]['ids']['length'];_0x3d1cbe+=0x1){socket['emit']('userSmsAccount:save',{'UserId':Number(_0x330a0e[_0x3fb7('0x57')]['ids'][_0x3d1cbe]),'SmsAccountId':Number(_0x330a0e[_0x3fb7('0x63')]['id'])});}return _0x31846e;});}})[_0x3fb7('0x32')](respondWithResult(_0x2e7f09,null))[_0x3fb7('0x28')](handleError(_0x2e7f09,null));};exports['removeAgents']=function(_0x18536a,_0x386739,_0x259e08){return db[_0x3fb7('0x3c')][_0x3fb7('0x5d')]({'where':{'id':_0x18536a[_0x3fb7('0x63')]['id']}})['then'](handleEntityNotFound(_0x386739,null))[_0x3fb7('0x32')](function(_0x2f0b65){if(_0x2f0b65){return _0x2f0b65[_0x3fb7('0xdd')](_0x18536a[_0x3fb7('0x41')][_0x3fb7('0x68')])[_0x3fb7('0x32')](function(){if(_['isArray'](_0x18536a['query'][_0x3fb7('0x68')])){for(var _0x17d9bb=0x0;_0x17d9bb<_0x18536a[_0x3fb7('0x41')][_0x3fb7('0x68')][_0x3fb7('0x47')];_0x17d9bb+=0x1){socket['emit']('userSmsAccount:remove',{'UserId':Number(_0x18536a[_0x3fb7('0x41')][_0x3fb7('0x68')][_0x17d9bb]),'SmsAccountId':Number(_0x18536a[_0x3fb7('0x63')]['id'])});}}else{socket[_0x3fb7('0xde')](_0x3fb7('0xdf'),{'UserId':Number(_0x18536a['query']['ids']),'SmsAccountId':Number(_0x18536a[_0x3fb7('0x63')]['id'])});}});}})[_0x3fb7('0x32')](respondWithStatusCode(_0x386739,null))[_0x3fb7('0x28')](handleError(_0x386739,null));};exports[_0x3fb7('0xe0')]=function(_0x5bc009,_0x2060ca,_0x58978f){var _0x2a5574={};var _0x5d12c1={};var _0x431306;var _0x3f02a0;return db[_0x3fb7('0x3c')]['findOne']({'where':{'id':_0x5bc009[_0x3fb7('0x63')]['id']}})[_0x3fb7('0x32')](handleEntityNotFound(_0x2060ca,null))['then'](function(_0x1471ab){if(_0x1471ab){_0x431306=_0x1471ab;_0x5d12c1[_0x3fb7('0x40')]=_[_0x3fb7('0x42')](db['User'][_0x3fb7('0x3d')]);_0x5d12c1[_0x3fb7('0x41')]=_[_0x3fb7('0x42')](_0x5bc009[_0x3fb7('0x41')]);_0x5d12c1[_0x3fb7('0x43')]=_[_0x3fb7('0x45')](_0x5d12c1[_0x3fb7('0x40')],_0x5d12c1[_0x3fb7('0x41')]);_0x2a5574[_0x3fb7('0x44')]=_[_0x3fb7('0x45')](_0x5d12c1[_0x3fb7('0x40')],qs[_0x3fb7('0x46')](_0x5bc009[_0x3fb7('0x41')][_0x3fb7('0x46')]));_0x2a5574[_0x3fb7('0x44')]=_0x2a5574[_0x3fb7('0x44')][_0x3fb7('0x47')]?_0x2a5574[_0x3fb7('0x44')]:_0x5d12c1[_0x3fb7('0x40')];_0x2a5574[_0x3fb7('0x4a')]=qs['sort'](_0x5bc009['query'][_0x3fb7('0x4b')]);_0x2a5574[_0x3fb7('0x4e')]=qs[_0x3fb7('0x43')](_['pick'](_0x5bc009[_0x3fb7('0x41')],_0x5d12c1[_0x3fb7('0x43')]));if(_0x5bc009['query'][_0x3fb7('0x4d')]){_0x2a5574[_0x3fb7('0x4e')]=_['merge'](_0x2a5574[_0x3fb7('0x4e')],{'$or':_['map'](_0x2a5574[_0x3fb7('0x44')],function(_0x45c701){var _0x209935={};_0x209935[_0x45c701]={'$like':'%'+_0x5bc009[_0x3fb7('0x41')][_0x3fb7('0x4d')]+'%'};return _0x209935;})});}_0x2a5574=_[_0x3fb7('0x4f')]({},_0x2a5574,_0x5bc009[_0x3fb7('0x50')]);return _0x431306[_0x3fb7('0xe0')](_0x2a5574);}})[_0x3fb7('0x32')](function(_0xeb0ebf){if(_0xeb0ebf){_0x3f02a0=_0xeb0ebf[_0x3fb7('0x47')];if(!_0x5bc009[_0x3fb7('0x41')][_0x3fb7('0x48')]('nolimit')){_0x2a5574[_0x3fb7('0x2d')]=qs[_0x3fb7('0x2d')](_0x5bc009[_0x3fb7('0x41')][_0x3fb7('0x2d')]);_0x2a5574[_0x3fb7('0x2b')]=qs[_0x3fb7('0x2b')](_0x5bc009[_0x3fb7('0x41')]['offset']);}return _0x431306[_0x3fb7('0xe0')](_0x2a5574);}})['then'](function(_0x1fb09f){if(_0x1fb09f){return _0x1fb09f?{'count':_0x3f02a0,'rows':_0x1fb09f}:null;}})['then'](respondWithResult(_0x2060ca,null))[_0x3fb7('0x28')](handleError(_0x2060ca,null));}; \ No newline at end of file +var _0x69f5=['rows','show','params','Pause','keys','includeAll','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','nolimit','removeDispositions','ids','CannedAnswer','getAnswers','SmsApplication','Applications','account','applications','orderBy','asc','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','From','Body','MessageSid','from','sender','text','connectel','clicksend','messageId','MessageUUID','results','csc','originatingAddress','segmentedMessage','fromNumber','replyMessageId','refid','from\x20is\x20mandatory','isNil','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','Contacts','omit','CmContact','contact','SmsInteraction','spread','interaction','autoclose','push','close','unmanaged','*,*,*,*','created','SmsMessage','ContactId','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','info','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','set','Content-Type','text/xml','\x0a','transaction','findAndCountAll','priority','getApplications','getInteractions','Owner','fullname','internal','Tag','Tags','color','tag','to\x20is\x20mandatory','CmList','List','out','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby','skebby_dispatch_id','requestid','statusInt','message_id','status_code','groupName','intelepeer','redif','DELIVERED','error_code','infobip','clickatell','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','bandwidth','message-delivered','ACCEPTD','statusGet','state','message-id','addAgents','emit','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','http','then','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','end','json','offset','limit','undefined','count','status','Content-Range','apply','save','update','destroy','get','SmsAccounts','stack','name','send','index','mandatoryDispositionPause','SmsAccount','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','type','include','findAll'];(function(_0x328d06,_0x51a1ce){var _0x15b11d=function(_0x1b30cc){while(--_0x1b30cc){_0x328d06['push'](_0x328d06['shift']());}};_0x15b11d(++_0x51a1ce);}(_0x69f5,0x17a));var _0x569f=function(_0x5bd1a9,_0x313714){_0x5bd1a9=_0x5bd1a9-0x0;var _0x2ba345=_0x69f5[_0x5bd1a9];return _0x2ba345;};'use strict';var emlformat=require(_0x569f('0x0'));var rimraf=require(_0x569f('0x1'));var zipdir=require(_0x569f('0x2'));var jsonpatch=require(_0x569f('0x3'));var rp=require(_0x569f('0x4'));var moment=require(_0x569f('0x5'));var BPromise=require(_0x569f('0x6'));var Mustache=require(_0x569f('0x7'));var util=require(_0x569f('0x8'));var path=require(_0x569f('0x9'));var sox=require(_0x569f('0xa'));var csv=require(_0x569f('0xb'));var ejs=require(_0x569f('0xc'));var fs=require('fs');var fs_extra=require(_0x569f('0xd'));var _=require(_0x569f('0xe'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x569f('0xf'));var deskjs=require(_0x569f('0x10'));var toCsv=require('to-csv');var querystring=require(_0x569f('0x11'));var Papa=require(_0x569f('0x12'));var Redis=require('ioredis');var authService=require(_0x569f('0x13'));var qs=require(_0x569f('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x569f('0x15'));var logger=require(_0x569f('0x16'))('api');var utils=require(_0x569f('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x569f('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x569f('0x19')](config[_0x569f('0x1a')],{'host':_0x569f('0x1b'),'port':0x18eb});var socket=require(_0x569f('0x1c'))(new Redis(config[_0x569f('0x1a')]));require(_0x569f('0x1d'))[_0x569f('0x1e')](socket);var jayson=require(_0x569f('0x1f'));var client=jayson[_0x569f('0x20')][_0x569f('0x21')]({'port':0x232c});function respondWithRpcPromise(_0x339508,_0x3b39d5,_0x4e67ac,_0x4475bb){return new BPromise(function(_0x5759ab,_0x508e65){var _0x413018=_0x4475bb||client;return _0x413018['request'](_0x339508,_0x4e67ac)[_0x569f('0x22')](function(_0x544ba4){logger['info'](_0x569f('0x23'),_0x3b39d5,_0x569f('0x24'));logger[_0x569f('0x25')](_0x569f('0x26'),_0x3b39d5,_0x569f('0x24'),JSON[_0x569f('0x27')](_0x544ba4));if(_0x544ba4[_0x569f('0x28')]){if(_0x544ba4[_0x569f('0x28')][_0x569f('0x29')]===0x1f4){logger['error']('SmsAccount,\x20%s,\x20%s',_0x3b39d5,_0x544ba4[_0x569f('0x28')]['message']);return _0x508e65(_0x544ba4['error'][_0x569f('0x2a')]);}logger[_0x569f('0x28')](_0x569f('0x23'),_0x3b39d5,_0x544ba4[_0x569f('0x28')]['message']);return _0x5759ab(_0x544ba4[_0x569f('0x28')][_0x569f('0x2a')]);}else{logger['info'](_0x569f('0x23'),_0x3b39d5,_0x569f('0x24'));_0x5759ab(_0x544ba4[_0x569f('0x2b')][_0x569f('0x2a')]);}})[_0x569f('0x2c')](function(_0x202747){logger[_0x569f('0x28')](_0x569f('0x23'),_0x3b39d5,_0x202747);_0x508e65(_0x202747);});});}function respondWithStatusCode(_0x1f0ce6,_0x48fb67){_0x48fb67=_0x48fb67||0xcc;return function(_0x19becf){if(_0x19becf){return _0x1f0ce6['sendStatus'](_0x48fb67);}return _0x1f0ce6['status'](_0x48fb67)[_0x569f('0x2d')]();};}function respondWithResult(_0x56aa15,_0x3a9319){_0x3a9319=_0x3a9319||0xc8;return function(_0x13e9f4){if(_0x13e9f4){return _0x56aa15['status'](_0x3a9319)[_0x569f('0x2e')](_0x13e9f4);}};}function respondWithFilteredResult(_0x40f9f8,_0x3a874f){return function(_0x16b9ff){if(_0x16b9ff){var _0x4aa147=typeof _0x3a874f[_0x569f('0x2f')]==='undefined'&&typeof _0x3a874f[_0x569f('0x30')]===_0x569f('0x31');var _0x32e75f=_0x16b9ff[_0x569f('0x32')];var _0x57ef6c=_0x4aa147?0x0:_0x3a874f[_0x569f('0x2f')];var _0x2395d0=_0x4aa147?_0x16b9ff[_0x569f('0x32')]:_0x3a874f['offset']+_0x3a874f[_0x569f('0x30')];var _0x3de008;if(_0x2395d0>=_0x32e75f){_0x2395d0=_0x32e75f;_0x3de008=0xc8;}else{_0x3de008=0xce;}_0x40f9f8[_0x569f('0x33')](_0x3de008);return _0x40f9f8['set'](_0x569f('0x34'),_0x57ef6c+'-'+_0x2395d0+'/'+_0x32e75f)['json'](_0x16b9ff);}return null;};}function patchUpdates(_0x435462){return function(_0xb37c1c){try{jsonpatch[_0x569f('0x35')](_0xb37c1c,_0x435462,!![]);}catch(_0x5e6c4c){return BPromise['reject'](_0x5e6c4c);}return _0xb37c1c[_0x569f('0x36')]();};}function saveUpdates(_0x592145,_0x11389f){return function(_0xb97917){if(_0xb97917){return _0xb97917[_0x569f('0x37')](_0x592145)[_0x569f('0x22')](function(_0x388e35){return _0x388e35;});}return null;};}function removeEntity(_0x569440,_0xfba96e){return function(_0x415f22){if(_0x415f22){return _0x415f22[_0x569f('0x38')]()[_0x569f('0x22')](function(){var _0x14a809=_0x415f22[_0x569f('0x39')]({'plain':!![]});var _0x24fe18=_0x569f('0x3a');return db['UserProfileResource']['destroy']({'where':{'type':_0x24fe18,'resourceId':_0x14a809['id']}})['then'](function(){return _0x415f22;});})['then'](function(){_0x569440[_0x569f('0x33')](0xcc)[_0x569f('0x2d')]();});}};}function handleEntityNotFound(_0x259606,_0x1ebf0d){return function(_0x36a721){if(!_0x36a721){_0x259606['sendStatus'](0x194);}return _0x36a721;};}function handleError(_0x548312,_0x25a5a5){_0x25a5a5=_0x25a5a5||0x1f4;return function(_0x5319be){logger['error'](_0x5319be[_0x569f('0x3b')]);if(_0x5319be[_0x569f('0x3c')]){delete _0x5319be[_0x569f('0x3c')];}_0x548312['status'](_0x25a5a5)[_0x569f('0x3d')](_0x5319be);};}exports[_0x569f('0x3e')]=function(_0x1d725c,_0x3c5a36){var _0x26e592={'include':[{'model':db['Pause'],'as':_0x569f('0x3f')}]},_0x27c860={},_0x4c7d9c={'count':0x0,'rows':[]};var _0x2630ce=_['map'](db[_0x569f('0x40')][_0x569f('0x41')],function(_0x10e10a){return{'name':_0x10e10a[_0x569f('0x42')],'type':_0x10e10a['type'][_0x569f('0x43')]};});_0x27c860['model']=_['map'](_0x2630ce,_0x569f('0x3c'));_0x27c860[_0x569f('0x44')]=_['keys'](_0x1d725c['query']);_0x27c860[_0x569f('0x45')]=_[_0x569f('0x46')](_0x27c860[_0x569f('0x47')],_0x27c860['query']);_0x26e592[_0x569f('0x48')]=_[_0x569f('0x46')](_0x27c860[_0x569f('0x47')],qs[_0x569f('0x49')](_0x1d725c[_0x569f('0x44')]['fields']));_0x26e592[_0x569f('0x48')]=_0x26e592[_0x569f('0x48')][_0x569f('0x4a')]?_0x26e592[_0x569f('0x48')]:_0x27c860[_0x569f('0x47')];if(!_0x1d725c[_0x569f('0x44')][_0x569f('0x4b')]('nolimit')){_0x26e592[_0x569f('0x30')]=qs[_0x569f('0x30')](_0x1d725c[_0x569f('0x44')][_0x569f('0x30')]);_0x26e592['offset']=qs[_0x569f('0x2f')](_0x1d725c['query'][_0x569f('0x2f')]);}_0x26e592[_0x569f('0x4c')]=qs[_0x569f('0x4d')](_0x1d725c[_0x569f('0x44')][_0x569f('0x4d')]);_0x26e592[_0x569f('0x4e')]=qs[_0x569f('0x45')](_[_0x569f('0x4f')](_0x1d725c[_0x569f('0x44')],_0x27c860[_0x569f('0x45')]),_0x2630ce);if(_0x1d725c[_0x569f('0x44')][_0x569f('0x50')]){_0x26e592['where']=_[_0x569f('0x51')](_0x26e592[_0x569f('0x4e')],{'$or':_[_0x569f('0x52')](_0x2630ce,function(_0x3d6a08){if(_0x3d6a08[_0x569f('0x53')]!=='VIRTUAL'){var _0x3e0f0f={};_0x3e0f0f[_0x3d6a08[_0x569f('0x3c')]]={'$like':'%'+_0x1d725c[_0x569f('0x44')][_0x569f('0x50')]+'%'};return _0x3e0f0f;}})});}_0x26e592=_[_0x569f('0x51')]({},_0x26e592,_0x1d725c['options']);var _0x3950fa={'where':_0x26e592[_0x569f('0x4e')]};return db[_0x569f('0x40')][_0x569f('0x32')](_0x3950fa)[_0x569f('0x22')](function(_0x176586){_0x4c7d9c[_0x569f('0x32')]=_0x176586;if(_0x1d725c[_0x569f('0x44')]['includeAll']){_0x26e592[_0x569f('0x54')]=[{'all':!![]}];}return db['SmsAccount'][_0x569f('0x55')](_0x26e592);})['then'](function(_0x305b53){_0x4c7d9c[_0x569f('0x56')]=_0x305b53;return _0x4c7d9c;})[_0x569f('0x22')](respondWithFilteredResult(_0x3c5a36,_0x26e592))[_0x569f('0x2c')](handleError(_0x3c5a36,null));};exports[_0x569f('0x57')]=function(_0x29378b,_0x26e7c0){var _0x483c96={'raw':![],'where':{'id':_0x29378b[_0x569f('0x58')]['id']},'include':[{'model':db[_0x569f('0x59')],'as':_0x569f('0x3f')}]},_0x172693={};_0x172693[_0x569f('0x47')]=_[_0x569f('0x5a')](db[_0x569f('0x40')][_0x569f('0x41')]);_0x172693['query']=_[_0x569f('0x5a')](_0x29378b['query']);_0x172693[_0x569f('0x45')]=_['intersection'](_0x172693[_0x569f('0x47')],_0x172693[_0x569f('0x44')]);_0x483c96['attributes']=_['intersection'](_0x172693[_0x569f('0x47')],qs[_0x569f('0x49')](_0x29378b[_0x569f('0x44')][_0x569f('0x49')]));_0x483c96[_0x569f('0x48')]=_0x483c96[_0x569f('0x48')][_0x569f('0x4a')]?_0x483c96[_0x569f('0x48')]:_0x172693[_0x569f('0x47')];if(_0x29378b[_0x569f('0x44')][_0x569f('0x5b')]){_0x483c96['include']=[{'all':!![]}];}_0x483c96=_['merge']({},_0x483c96,_0x29378b[_0x569f('0x5c')]);return db[_0x569f('0x40')]['find'](_0x483c96)[_0x569f('0x22')](handleEntityNotFound(_0x26e7c0,null))[_0x569f('0x22')](respondWithResult(_0x26e7c0,null))[_0x569f('0x2c')](handleError(_0x26e7c0,null));};exports[_0x569f('0x5d')]=function(_0x31d459,_0x1169a0){return db['SmsAccount'][_0x569f('0x5d')](_0x31d459[_0x569f('0x5e')],{})[_0x569f('0x22')](function(_0x3085c8){var _0x40329c=_0x31d459['user'][_0x569f('0x39')]({'plain':!![]});if(!_0x40329c)throw new Error(_0x569f('0x5f'));if(_0x40329c[_0x569f('0x60')]===_0x569f('0x61')){var _0x32ba62=_0x3085c8[_0x569f('0x39')]({'plain':!![]});var _0x4fbaf6='SmsAccounts';return db[_0x569f('0x62')][_0x569f('0x63')]({'where':{'name':_0x4fbaf6,'userProfileId':_0x40329c[_0x569f('0x64')]},'raw':!![]})[_0x569f('0x22')](function(_0x5199cb){if(_0x5199cb&&_0x5199cb[_0x569f('0x65')]===0x0){return db[_0x569f('0x66')][_0x569f('0x5d')]({'name':_0x32ba62[_0x569f('0x3c')],'resourceId':_0x32ba62['id'],'type':_0x5199cb[_0x569f('0x3c')],'sectionId':_0x5199cb['id']},{})[_0x569f('0x22')](function(){return _0x3085c8;});}else{return _0x3085c8;}})[_0x569f('0x2c')](function(_0x4db244){logger[_0x569f('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4db244);throw _0x4db244;});}return _0x3085c8;})[_0x569f('0x22')](respondWithResult(_0x1169a0,0xc9))[_0x569f('0x2c')](handleError(_0x1169a0,null));};exports[_0x569f('0x37')]=function(_0x2e01d7,_0x13e25d){if(_0x2e01d7[_0x569f('0x5e')]['id']){delete _0x2e01d7[_0x569f('0x5e')]['id'];}return db[_0x569f('0x40')][_0x569f('0x63')]({'where':{'id':_0x2e01d7[_0x569f('0x58')]['id']},'include':[{'model':db[_0x569f('0x59')],'as':_0x569f('0x3f')}]})[_0x569f('0x22')](handleEntityNotFound(_0x13e25d,null))[_0x569f('0x22')](saveUpdates(_0x2e01d7[_0x569f('0x5e')],null))[_0x569f('0x22')](respondWithResult(_0x13e25d,null))['catch'](handleError(_0x13e25d,null));};exports[_0x569f('0x38')]=function(_0xc02f1c,_0x57fcd4){return db['SmsAccount']['find']({'where':{'id':_0xc02f1c[_0x569f('0x58')]['id']}})[_0x569f('0x22')](handleEntityNotFound(_0x57fcd4,null))[_0x569f('0x22')](removeEntity(_0x57fcd4,null))[_0x569f('0x2c')](handleError(_0x57fcd4,null));};exports[_0x569f('0x67')]=function(_0x33b13a,_0x55fc97){return db[_0x569f('0x40')][_0x569f('0x67')]()[_0x569f('0x22')](respondWithResult(_0x55fc97,null))[_0x569f('0x2c')](handleError(_0x55fc97,null));};exports[_0x569f('0x68')]=function(_0x45c35c,_0x4bfafb,_0x2c9244){if(_0x45c35c[_0x569f('0x5e')]['id']){delete _0x45c35c[_0x569f('0x5e')]['id'];}return db[_0x569f('0x40')][_0x569f('0x63')]({'where':{'id':_0x45c35c['params']['id']}})['then'](handleEntityNotFound(_0x4bfafb,null))[_0x569f('0x22')](function(_0x4fe030){if(_0x4fe030){_0x45c35c[_0x569f('0x5e')][_0x569f('0x69')]=_0x4fe030['id'];return db[_0x569f('0x6a')][_0x569f('0x5d')](_0x45c35c[_0x569f('0x5e')]);}})[_0x569f('0x22')](respondWithResult(_0x4bfafb,null))['catch'](handleError(_0x4bfafb,null));};exports[_0x569f('0x6b')]=function(_0x2d29c6,_0x4614f7,_0x5ab955){var _0x297019={'raw':![],'where':{}};var _0x9c6d72={};var _0x336d7d={'count':0x0,'rows':[]};return db['SmsAccount'][_0x569f('0x6c')]({'where':{'id':_0x2d29c6[_0x569f('0x58')]['id']}})[_0x569f('0x22')](handleEntityNotFound(_0x4614f7,null))[_0x569f('0x22')](function(_0x8dc4a5){if(_0x8dc4a5){_0x9c6d72[_0x569f('0x47')]=_['keys'](db[_0x569f('0x6a')][_0x569f('0x41')]);_0x9c6d72['query']=_[_0x569f('0x5a')](_0x2d29c6[_0x569f('0x44')]);_0x9c6d72[_0x569f('0x45')]=_['intersection'](_0x9c6d72[_0x569f('0x47')],_0x9c6d72[_0x569f('0x44')]);_0x297019[_0x569f('0x48')]=_['intersection'](_0x9c6d72[_0x569f('0x47')],qs[_0x569f('0x49')](_0x2d29c6[_0x569f('0x44')]['fields']));_0x297019[_0x569f('0x48')]=_0x297019[_0x569f('0x48')][_0x569f('0x4a')]?_0x297019['attributes']:_0x9c6d72[_0x569f('0x47')];if(!_0x2d29c6[_0x569f('0x44')][_0x569f('0x4b')](_0x569f('0x6d'))){_0x297019['limit']=qs[_0x569f('0x30')](_0x2d29c6['query'][_0x569f('0x30')]);_0x297019[_0x569f('0x2f')]=qs[_0x569f('0x2f')](_0x2d29c6[_0x569f('0x44')][_0x569f('0x2f')]);}_0x297019[_0x569f('0x4c')]=qs[_0x569f('0x4d')](_0x2d29c6['query']['sort']);_0x297019[_0x569f('0x4e')]=qs[_0x569f('0x45')](_['pick'](_0x2d29c6[_0x569f('0x44')],_0x9c6d72[_0x569f('0x45')]));_0x297019['where']['SmsAccountId']=_0x8dc4a5['id'];if(_0x2d29c6[_0x569f('0x44')][_0x569f('0x50')]){_0x297019['where']=_[_0x569f('0x51')](_0x297019[_0x569f('0x4e')],{'$or':_[_0x569f('0x52')](_0x297019['attributes'],function(_0x2784b5){var _0x2c319b={};_0x2c319b[_0x2784b5]={'$like':'%'+_0x2d29c6[_0x569f('0x44')][_0x569f('0x50')]+'%'};return _0x2c319b;})});}_0x297019=_['merge']({},_0x297019,_0x2d29c6[_0x569f('0x5c')]);return db[_0x569f('0x6a')][_0x569f('0x32')]({'where':_0x297019['where']})[_0x569f('0x22')](function(_0x1b2e31){_0x336d7d[_0x569f('0x32')]=_0x1b2e31;if(_0x2d29c6[_0x569f('0x44')][_0x569f('0x5b')]){_0x297019['include']=[{'all':!![]}];}return db[_0x569f('0x6a')][_0x569f('0x55')](_0x297019);})['then'](function(_0x3e43cb){_0x336d7d['rows']=_0x3e43cb;return _0x336d7d;});}})['then'](respondWithFilteredResult(_0x4614f7,_0x297019))[_0x569f('0x2c')](handleError(_0x4614f7,null));};exports[_0x569f('0x6e')]=function(_0x3fe553,_0x232def,_0x283ff6){return db['SmsAccount'][_0x569f('0x63')]({'where':{'id':_0x3fe553[_0x569f('0x58')]['id']}})[_0x569f('0x22')](handleEntityNotFound(_0x232def,null))[_0x569f('0x22')](function(_0x2d3728){if(_0x2d3728){return _0x2d3728['removeDispositions'](_0x3fe553[_0x569f('0x44')][_0x569f('0x6f')]);}})[_0x569f('0x22')](respondWithStatusCode(_0x232def,null))[_0x569f('0x2c')](handleError(_0x232def,null));};exports['addAnswer']=function(_0x1452f5,_0x1bbed9,_0x3b6da4){if(_0x1452f5[_0x569f('0x5e')]['id']){delete _0x1452f5[_0x569f('0x5e')]['id'];}return db['SmsAccount'][_0x569f('0x63')]({'where':{'id':_0x1452f5[_0x569f('0x58')]['id']}})[_0x569f('0x22')](handleEntityNotFound(_0x1bbed9,null))[_0x569f('0x22')](function(_0x3d6998){if(_0x3d6998){_0x1452f5[_0x569f('0x5e')][_0x569f('0x69')]=_0x3d6998['id'];return db[_0x569f('0x70')][_0x569f('0x5d')](_0x1452f5[_0x569f('0x5e')]);}})[_0x569f('0x22')](respondWithResult(_0x1bbed9,null))['catch'](handleError(_0x1bbed9,null));};exports[_0x569f('0x71')]=function(_0x4f2144,_0x205e88,_0x41ef4b){var _0x24b30f={'raw':![],'where':{}};var _0x41a0e1={};var _0x22b174={'count':0x0,'rows':[]};return db['SmsAccount'][_0x569f('0x6c')]({'where':{'id':_0x4f2144[_0x569f('0x58')]['id']}})[_0x569f('0x22')](handleEntityNotFound(_0x205e88,null))[_0x569f('0x22')](function(_0x1acb88){if(_0x1acb88){_0x41a0e1['model']=_['keys'](db[_0x569f('0x70')][_0x569f('0x41')]);_0x41a0e1[_0x569f('0x44')]=_[_0x569f('0x5a')](_0x4f2144['query']);_0x41a0e1[_0x569f('0x45')]=_['intersection'](_0x41a0e1[_0x569f('0x47')],_0x41a0e1[_0x569f('0x44')]);_0x24b30f[_0x569f('0x48')]=_[_0x569f('0x46')](_0x41a0e1[_0x569f('0x47')],qs['fields'](_0x4f2144[_0x569f('0x44')]['fields']));_0x24b30f[_0x569f('0x48')]=_0x24b30f[_0x569f('0x48')][_0x569f('0x4a')]?_0x24b30f[_0x569f('0x48')]:_0x41a0e1['model'];if(!_0x4f2144['query'][_0x569f('0x4b')](_0x569f('0x6d'))){_0x24b30f[_0x569f('0x30')]=qs[_0x569f('0x30')](_0x4f2144[_0x569f('0x44')][_0x569f('0x30')]);_0x24b30f['offset']=qs[_0x569f('0x2f')](_0x4f2144['query'][_0x569f('0x2f')]);}_0x24b30f[_0x569f('0x4c')]=qs[_0x569f('0x4d')](_0x4f2144[_0x569f('0x44')][_0x569f('0x4d')]);_0x24b30f[_0x569f('0x4e')]=qs[_0x569f('0x45')](_['pick'](_0x4f2144[_0x569f('0x44')],_0x41a0e1[_0x569f('0x45')]));_0x24b30f[_0x569f('0x4e')][_0x569f('0x69')]=_0x1acb88['id'];if(_0x4f2144[_0x569f('0x44')][_0x569f('0x50')]){_0x24b30f[_0x569f('0x4e')]=_['merge'](_0x24b30f[_0x569f('0x4e')],{'$or':_[_0x569f('0x52')](_0x24b30f[_0x569f('0x48')],function(_0x4a75e9){var _0x1f0df8={};_0x1f0df8[_0x4a75e9]={'$like':'%'+_0x4f2144[_0x569f('0x44')]['filter']+'%'};return _0x1f0df8;})});}_0x24b30f=_[_0x569f('0x51')]({},_0x24b30f,_0x4f2144['options']);return db[_0x569f('0x70')]['count']({'where':_0x24b30f[_0x569f('0x4e')]})[_0x569f('0x22')](function(_0x284725){_0x22b174['count']=_0x284725;if(_0x4f2144[_0x569f('0x44')]['includeAll']){_0x24b30f[_0x569f('0x54')]=[{'all':!![]}];}return db[_0x569f('0x70')][_0x569f('0x55')](_0x24b30f);})[_0x569f('0x22')](function(_0x5b6112){_0x22b174[_0x569f('0x56')]=_0x5b6112;return _0x22b174;});}})[_0x569f('0x22')](respondWithFilteredResult(_0x205e88,_0x24b30f))['catch'](handleError(_0x205e88,null));};exports['removeAnswers']=function(_0x5b8e30,_0x20739c,_0x52923){return db['SmsAccount'][_0x569f('0x63')]({'where':{'id':_0x5b8e30[_0x569f('0x58')]['id']}})[_0x569f('0x22')](handleEntityNotFound(_0x20739c,null))[_0x569f('0x22')](function(_0x4ca66c){if(_0x4ca66c){return _0x4ca66c['removeAnswers'](_0x5b8e30[_0x569f('0x44')][_0x569f('0x6f')]);}})[_0x569f('0x22')](respondWithStatusCode(_0x20739c,null))[_0x569f('0x2c')](handleError(_0x20739c,null));};exports['notify']=function(_0x3d2187,_0x5d355f,_0x4a241c){var _0x326d5a={'channel':'sms'};var _0x1fd88b=[];var _0x3e7246=[];var _0x497189={};return db[_0x569f('0x40')][_0x569f('0x63')]({'where':{'id':_0x3d2187[_0x569f('0x58')]['id']},'include':[{'model':db[_0x569f('0x72')],'as':_0x569f('0x73')}]})[_0x569f('0x22')](handleEntityNotFound(_0x5d355f,null))['then'](function(_0x1f54a3){_0x326d5a[_0x569f('0x74')]=_0x1f54a3;_0x326d5a[_0x569f('0x75')]=_[_0x569f('0x76')](_0x1f54a3['Applications'],['priority'],[_0x569f('0x77')]);if(_0x326d5a[_0x569f('0x74')]['Applications']){delete _0x326d5a[_0x569f('0x74')][_0x569f('0x73')];}return db['CmContact'][_0x569f('0x67')]();})['then'](function(_0x2bafb5){if(!_0x2bafb5){throw new db[(_0x569f('0x78'))][(_0x569f('0x79'))](_0x569f('0x7a'));}_0x1fd88b=_[_0x569f('0x7b')](_[_0x569f('0x5a')](_0x2bafb5),[_0x569f('0x7c'),_0x569f('0x7d')]);_0x3e7246=_['difference'](_[_0x569f('0x5a')](_0x2bafb5),[_0x569f('0x7c'),'updatedAt',_0x569f('0x7e'),_0x569f('0x7f')]);_0x326d5a[_0x569f('0x5e')]={'mapKey':_0x569f('0x80')};if(_0x326d5a[_0x569f('0x74')][_0x569f('0x53')]){switch(_0x326d5a[_0x569f('0x74')][_0x569f('0x53')]){case _0x569f('0x81'):_0x326d5a[_0x569f('0x5e')]['from']=_0x3d2187[_0x569f('0x5e')][_0x569f('0x82')];_0x326d5a[_0x569f('0x5e')][_0x569f('0x5e')]=_0x3d2187['body'][_0x569f('0x83')];_0x326d5a[_0x569f('0x5e')]['messageId']=_0x3d2187['body'][_0x569f('0x84')];break;case'skebby':_0x326d5a[_0x569f('0x5e')][_0x569f('0x85')]='+'+_0x3d2187[_0x569f('0x5e')][_0x569f('0x86')];_0x326d5a[_0x569f('0x5e')]['body']=_0x3d2187[_0x569f('0x5e')][_0x569f('0x87')];break;case _0x569f('0x88'):_0x326d5a[_0x569f('0x5e')][_0x569f('0x85')]=_0x3d2187[_0x569f('0x5e')][_0x569f('0x85')];_0x326d5a['body'][_0x569f('0x5e')]=_0x3d2187[_0x569f('0x5e')][_0x569f('0x2a')];break;case _0x569f('0x89'):_0x326d5a[_0x569f('0x5e')][_0x569f('0x85')]=_0x3d2187[_0x569f('0x5e')][_0x569f('0x85')];_0x326d5a[_0x569f('0x5e')][_0x569f('0x5e')]=_0x3d2187['body'][_0x569f('0x5e')];_0x326d5a[_0x569f('0x5e')][_0x569f('0x8a')]=_0x3d2187[_0x569f('0x5e')]['message_id'];break;case'plivo':_0x326d5a[_0x569f('0x5e')][_0x569f('0x85')]=_0x3d2187['body']['From'];_0x326d5a[_0x569f('0x5e')][_0x569f('0x5e')]=_0x3d2187[_0x569f('0x5e')]['Text'];_0x326d5a[_0x569f('0x5e')][_0x569f('0x8a')]=_0x3d2187[_0x569f('0x5e')][_0x569f('0x8b')];break;case'infobip':_0x326d5a[_0x569f('0x5e')][_0x569f('0x85')]='+'+_0x3d2187[_0x569f('0x5e')][_0x569f('0x8c')][0x0][_0x569f('0x85')];_0x326d5a[_0x569f('0x5e')][_0x569f('0x5e')]=_0x3d2187[_0x569f('0x5e')][_0x569f('0x8c')][0x0][_0x569f('0x87')];_0x326d5a[_0x569f('0x5e')][_0x569f('0x8a')]=_0x3d2187[_0x569f('0x5e')][_0x569f('0x8c')][0x0][_0x569f('0x8a')];break;case _0x569f('0x8d'):_0x326d5a[_0x569f('0x5e')]['from']=_0x3d2187[_0x569f('0x5e')][_0x569f('0x8e')];_0x326d5a[_0x569f('0x5e')]['body']=_0x3d2187[_0x569f('0x5e')][_0x569f('0x8f')][_0x569f('0x2a')];break;case'clickatell':_0x326d5a[_0x569f('0x5e')][_0x569f('0x85')]=_0x3d2187[_0x569f('0x5e')][_0x569f('0x90')];_0x326d5a[_0x569f('0x5e')][_0x569f('0x5e')]=_0x3d2187[_0x569f('0x5e')][_0x569f('0x87')];_0x326d5a[_0x569f('0x5e')]['messageId']=_0x3d2187[_0x569f('0x5e')][_0x569f('0x91')];break;case'bandwidth':_0x326d5a['body'][_0x569f('0x8a')]=_0x3d2187[_0x569f('0x5e')][0x0]['message']['id'];_0x326d5a[_0x569f('0x5e')]['from']=_0x3d2187[_0x569f('0x5e')][0x0][_0x569f('0x2a')]['from'];_0x326d5a[_0x569f('0x5e')][_0x569f('0x5e')]=_0x3d2187[_0x569f('0x5e')][0x0][_0x569f('0x2a')][_0x569f('0x87')];break;case'intelepeer':_0x326d5a[_0x569f('0x5e')][_0x569f('0x85')]=_0x3d2187[_0x569f('0x5e')][_0x569f('0x85')];_0x326d5a[_0x569f('0x5e')][_0x569f('0x5e')]=_0x3d2187[_0x569f('0x5e')][_0x569f('0x2a')];_0x326d5a[_0x569f('0x5e')][_0x569f('0x8a')]=_0x3d2187['body'][_0x569f('0x92')];break;}}if(_0x326d5a[_0x569f('0x5e')]['id']){delete _0x326d5a[_0x569f('0x5e')]['id'];}if(_['isNil'](_0x326d5a['body'][_0x569f('0x85')])){throw new db[(_0x569f('0x78'))][(_0x569f('0x79'))](_0x569f('0x93'));}if(_[_0x569f('0x94')](_0x326d5a[_0x569f('0x5e')]['body'])||_0x326d5a[_0x569f('0x5e')][_0x569f('0x5e')]===''){throw new db['Sequelize'][(_0x569f('0x79'))](_0x569f('0x95'));}if(_[_0x569f('0x94')](_0x326d5a['body'][_0x569f('0x96')])){throw new db[(_0x569f('0x78'))][(_0x569f('0x79'))](_0x569f('0x97')+_0x3e7246);}if(!_[_0x569f('0x98')](_0x3e7246,_0x326d5a[_0x569f('0x5e')]['mapKey'])){throw new db['Sequelize']['ValidationError'](_0x569f('0x99')+_0x3e7246);}_0x497189[_0x326d5a[_0x569f('0x5e')][_0x569f('0x96')]]=_0x326d5a[_0x569f('0x5e')]['from'];return db['CmList'][_0x569f('0x63')]({'where':{'id':_0x326d5a['account'][_0x569f('0x7f')]},'include':[{'model':db['CmContact'],'as':_0x569f('0x9a'),'where':_0x497189,'limit':0x1,'order':[['updatedAt','DESC']]}]});})['then'](handleEntityNotFound(_0x5d355f,null))['then'](function(_0x967135){if(_0x967135){_0x326d5a['list']=_[_0x569f('0x9b')](_0x967135,['Contacts']);if(_0x967135[_0x569f('0x9a')][_0x569f('0x4a')]){return _0x967135[_0x569f('0x9a')][0x0];}var _0x24ed42=_['defaults'](_0x326d5a[_0x569f('0x5e')],{'firstName':_0x326d5a[_0x569f('0x5e')]['from'],'ListId':_0x967135['id']});_0x24ed42[_0x326d5a[_0x569f('0x5e')][_0x569f('0x96')]]=_0x326d5a[_0x569f('0x5e')][_0x569f('0x85')];return db[_0x569f('0x9c')][_0x569f('0x5d')](_0x24ed42,{'fields':_0x1fd88b,'raw':!![]});}})['then'](handleEntityNotFound(_0x5d355f,null))[_0x569f('0x22')](function(_0x5e62c0){if(_0x5e62c0){_0x326d5a[_0x569f('0x9d')]=_0x5e62c0;var _0x3ea008={'ContactId':_0x5e62c0['id'],'phone':_0x326d5a[_0x569f('0x5e')][_0x569f('0x85')],'SmsAccountId':_0x3d2187['params']['id']};var _0x2e6485={'ContactId':_0x5e62c0['id'],'SmsAccountId':_0x3d2187[_0x569f('0x58')]['id'],'closed':![]};return db[_0x569f('0x9e')][_0x569f('0x63')]({'where':_0x2e6485})[_0x569f('0x22')](function(_0x25551b){if(_0x25551b){return[_0x25551b,![]];}return db[_0x569f('0x9e')][_0x569f('0x5d')](_0x3ea008)['then'](function(_0x134dcc){return[_0x134dcc,!![]];});});}})[_0x569f('0x9f')](function(_0x423279,_0xb7ce92){_0x326d5a[_0x569f('0xa0')]=_0x423279[_0x569f('0x39')]({'plain':!![]});_0x326d5a[_0x569f('0xa0')]['created']=![];if(_0xb7ce92){if(_0x326d5a[_0x569f('0x74')][_0x569f('0xa1')]){_0x326d5a[_0x569f('0x75')][_0x569f('0xa2')]({'id':0x0,'priority':_0x326d5a[_0x569f('0x75')][_0x569f('0x4a')]+0x1,'app':_0x569f('0xa3'),'appdata':_0x569f('0xa4'),'interval':_0x569f('0xa5')});}_0x326d5a[_0x569f('0xa0')][_0x569f('0xa6')]=!![];}return db[_0x569f('0xa7')][_0x569f('0x5d')]({'phone':_0x326d5a[_0x569f('0x5e')][_0x569f('0x85')],'messageId':_0x326d5a[_0x569f('0x5e')][_0x569f('0x8a')],'body':_0x326d5a['body'][_0x569f('0x5e')],'SmsAccountId':_0x3d2187[_0x569f('0x58')]['id'],'SmsInteractionId':_0x423279['id'],'direction':'in','ContactId':_0x423279[_0x569f('0xa8')],'AttachmentId':_0x326d5a[_0x569f('0x5e')][_0x569f('0xa9')]});})[_0x569f('0x22')](function(_0x4211cc){_0x326d5a['message']=_0x4211cc;if(_0x326d5a[_0x569f('0xa0')][_0x569f('0xaa')]){return db[_0x569f('0xab')][_0x569f('0x63')]({'attributes':['id','name'],'where':{'id':_0x326d5a['interaction'][_0x569f('0xaa')]}})[_0x569f('0x22')](function(_0x4c005f){if(_0x4c005f){_0x326d5a[_0x569f('0x75')][_0x569f('0xac')]({'id':0x0,'priority':0x0,'app':_0x569f('0xad'),'appdata':_0x4c005f[_0x569f('0x3c')]+','+(_0x326d5a[_0x569f('0x74')][_0x569f('0xae')]||0xa),'interval':_0x569f('0xa5')});}return respondWithRpcPromise(_0x569f('0xaf'),_0x569f('0xb0'),_0x326d5a);});}return respondWithRpcPromise('Start',_0x569f('0xb0'),_0x326d5a);})['then'](function(_0x32e796){if(_0x32e796){var _0x1f44b1=0xc8;var _0x51cf07=_0x569f('0xb1');logger[_0x569f('0xb2')](_0x569f('0x26'),_0x51cf07,_0x1f44b1,_0x569f('0xb3'));logger[_0x569f('0x25')](_0x569f('0xb4'),_0x51cf07,_0x1f44b1,_0x569f('0xb3'),JSON[_0x569f('0x27')](_0x32e796));if(_0x326d5a[_0x569f('0x74')][_0x569f('0x53')]==='twilio'){return _0x5d355f[_0x569f('0x33')](_0x1f44b1)[_0x569f('0xb5')](_0x569f('0xb6'),_0x569f('0xb7'))[_0x569f('0x3d')](_0x569f('0xb8'));}else{return _0x5d355f[_0x569f('0x33')](_0x1f44b1)[_0x569f('0x2e')](_0x32e796);}}})[_0x569f('0x2c')](handleError(_0x5d355f,null));};exports['addApplications']=function(_0x2c8d12,_0xe03268,_0x5120b9){return db[_0x569f('0x40')]['findOne']({'where':{'id':_0x2c8d12['params']['id']}})['then'](handleEntityNotFound(_0xe03268,null))[_0x569f('0x22')](function(_0x23b891){if(_0x23b891){return db['sequelize'][_0x569f('0xb9')](function(_0x5ef400){return db['SmsApplication'][_0x569f('0x38')]({'where':{'SmsAccountId':_0x2c8d12[_0x569f('0x58')]['id']},'transaction':_0x5ef400})[_0x569f('0x22')](function(_0x4233f6){var _0x4e6f9c=_['map'](_0x2c8d12[_0x569f('0x5e')],function(_0x5e4945){_0x5e4945[_0x569f('0x69')]=_0x2c8d12[_0x569f('0x58')]['id'];return _0x5e4945;});return db[_0x569f('0x72')]['bulkCreate'](_0x4e6f9c,{'transaction':_0x5ef400});});})['then'](function(){return db[_0x569f('0x72')][_0x569f('0xba')]({'where':{'SmsAccountId':_0x2c8d12['params']['id']},'order':_0x569f('0xbb')});});}})[_0x569f('0x22')](respondWithResult(_0xe03268,null))['catch'](handleError(_0xe03268,null));};exports[_0x569f('0xbc')]=function(_0x2dec89,_0x555fba,_0x4424ea){var _0x167ecb={};var _0x4310b0={};var _0x17b41c;var _0x24e0b3;return db[_0x569f('0x40')][_0x569f('0x6c')]({'where':{'id':_0x2dec89[_0x569f('0x58')]['id']}})[_0x569f('0x22')](handleEntityNotFound(_0x555fba,null))[_0x569f('0x22')](function(_0x3dd3aa){if(_0x3dd3aa){_0x17b41c=_0x3dd3aa;_0x4310b0['model']=_[_0x569f('0x5a')](db['SmsApplication'][_0x569f('0x41')]);_0x4310b0[_0x569f('0x44')]=_['keys'](_0x2dec89['query']);_0x4310b0[_0x569f('0x45')]=_[_0x569f('0x46')](_0x4310b0['model'],_0x4310b0[_0x569f('0x44')]);_0x167ecb[_0x569f('0x48')]=_[_0x569f('0x46')](_0x4310b0[_0x569f('0x47')],qs['fields'](_0x2dec89[_0x569f('0x44')]['fields']));_0x167ecb[_0x569f('0x48')]=_0x167ecb[_0x569f('0x48')][_0x569f('0x4a')]?_0x167ecb[_0x569f('0x48')]:_0x4310b0[_0x569f('0x47')];_0x167ecb[_0x569f('0x4c')]=qs['sort'](_0x2dec89[_0x569f('0x44')]['sort']);_0x167ecb[_0x569f('0x4e')]=qs['filters'](_[_0x569f('0x4f')](_0x2dec89[_0x569f('0x44')],_0x4310b0['filters']));if(_0x2dec89[_0x569f('0x44')]['filter']){_0x167ecb[_0x569f('0x4e')]=_[_0x569f('0x51')](_0x167ecb['where'],{'$or':_[_0x569f('0x52')](_0x167ecb[_0x569f('0x48')],function(_0xbfb3e1){var _0x2faccb={};_0x2faccb[_0xbfb3e1]={'$like':'%'+_0x2dec89[_0x569f('0x44')][_0x569f('0x50')]+'%'};return _0x2faccb;})});}_0x167ecb=_['merge']({},_0x167ecb,_0x2dec89['options']);return _0x17b41c['getApplications'](_0x167ecb);}})['then'](function(_0x585818){if(_0x585818){_0x24e0b3=_0x585818[_0x569f('0x4a')];if(!_0x2dec89[_0x569f('0x44')][_0x569f('0x4b')]('nolimit')){_0x167ecb[_0x569f('0x30')]=qs['limit'](_0x2dec89[_0x569f('0x44')][_0x569f('0x30')]);_0x167ecb[_0x569f('0x2f')]=qs[_0x569f('0x2f')](_0x2dec89[_0x569f('0x44')][_0x569f('0x2f')]);}return _0x17b41c[_0x569f('0xbc')](_0x167ecb);}})[_0x569f('0x22')](function(_0x4b36b3){if(_0x4b36b3){return _0x4b36b3?{'count':_0x24e0b3,'rows':_0x4b36b3}:null;}})[_0x569f('0x22')](respondWithResult(_0x555fba,null))['catch'](handleError(_0x555fba,null));};exports[_0x569f('0xbd')]=function(_0x496546,_0x57b221,_0x4ab3ce){var _0x366849={'raw':![],'where':{}};var _0x23ebd7={};var _0x8289dc={'count':0x0,'rows':[]};return db['SmsAccount'][_0x569f('0x6c')]({'where':{'id':_0x496546['params']['id']}})[_0x569f('0x22')](handleEntityNotFound(_0x57b221,null))['then'](function(_0x5bb9bb){if(_0x5bb9bb){_0x23ebd7['model']=_[_0x569f('0x5a')](db[_0x569f('0x9e')][_0x569f('0x41')]);_0x23ebd7[_0x569f('0x44')]=_[_0x569f('0x5a')](_0x496546['query']);_0x23ebd7[_0x569f('0x45')]=_['intersection'](_0x23ebd7[_0x569f('0x47')],_0x23ebd7['query']);_0x366849[_0x569f('0x48')]=_[_0x569f('0x46')](_0x23ebd7[_0x569f('0x47')],qs[_0x569f('0x49')](_0x496546['query']['fields']));_0x366849[_0x569f('0x48')]=_0x366849[_0x569f('0x48')][_0x569f('0x4a')]?_0x366849[_0x569f('0x48')]:_0x23ebd7[_0x569f('0x47')];if(!_0x496546[_0x569f('0x44')]['hasOwnProperty'](_0x569f('0x6d'))){_0x366849['limit']=qs[_0x569f('0x30')](_0x496546[_0x569f('0x44')][_0x569f('0x30')]);_0x366849['offset']=qs['offset'](_0x496546[_0x569f('0x44')][_0x569f('0x2f')]);}_0x366849[_0x569f('0x4c')]=qs['sort'](_0x496546['query'][_0x569f('0x4d')]);_0x366849['where']=qs[_0x569f('0x45')](_[_0x569f('0x4f')](_0x496546[_0x569f('0x44')],_0x23ebd7['filters']));_0x366849['where'][_0x569f('0x69')]=_0x5bb9bb['id'];if(_0x496546['query'][_0x569f('0x50')]){_0x366849[_0x569f('0x4e')]=_[_0x569f('0x51')](_0x366849[_0x569f('0x4e')],{'$or':_[_0x569f('0x52')](_0x366849['attributes'],function(_0x2a5330){var _0x252b73={};_0x252b73[_0x2a5330]={'$like':'%'+_0x496546['query'][_0x569f('0x50')]+'%'};return _0x252b73;})});}_0x366849=_[_0x569f('0x51')]({},_0x366849,_0x496546[_0x569f('0x5c')]);return db[_0x569f('0x9e')][_0x569f('0x32')]({'where':_0x366849[_0x569f('0x4e')]})[_0x569f('0x22')](function(_0x96f440){_0x8289dc[_0x569f('0x32')]=_0x96f440;if(_0x496546[_0x569f('0x44')][_0x569f('0x5b')]){_0x366849[_0x569f('0x54')]=[{'model':db[_0x569f('0x9c')],'as':'Contact','required':![]},{'model':db['User'],'as':_0x569f('0xbe'),'attributes':[_0x569f('0x3c'),_0x569f('0xbf'),_0x569f('0xc0')],'required':![]},{'model':db[_0x569f('0xc1')],'as':_0x569f('0xc2'),'attributes':['id',_0x569f('0x3c'),_0x569f('0xc3')],'where':_0x496546['query'][_0x569f('0xc4')]?{'id':_0x496546[_0x569f('0x44')][_0x569f('0xc4')]}:undefined,'required':_0x496546['query'][_0x569f('0xc4')]?!![]:![]}];}return db[_0x569f('0x9e')][_0x569f('0x55')](_0x366849);})['then'](function(_0x808286){_0x8289dc[_0x569f('0x56')]=_0x808286;return _0x8289dc;});}})[_0x569f('0x22')](respondWithFilteredResult(_0x57b221,_0x366849))['catch'](handleError(_0x57b221,null));};exports['send']=function(_0x19db93,_0x1bf2ce,_0x328cc9){var _0x2fcffb,_0x1aa9f7,_0xf2a780;if(_[_0x569f('0x94')](_0x19db93[_0x569f('0x5e')]['body'])||_0x19db93[_0x569f('0x5e')][_0x569f('0x5e')]===''){throw new db[(_0x569f('0x78'))]['ValidationError'](_0x569f('0x95'));}if(_['isNil'](_0x19db93['body']['to'])){throw new db[(_0x569f('0x78'))][(_0x569f('0x79'))](_0x569f('0xc5'));}_0x2fcffb=_0x19db93[_0x569f('0x5e')]['to'];return db[_0x569f('0x40')][_0x569f('0x63')]({'where':{'id':_0x19db93[_0x569f('0x58')]['id']},'include':[{'model':db[_0x569f('0xc6')],'as':_0x569f('0xc7'),'include':[{'model':db['CmContact'],'as':_0x569f('0x9a'),'where':{'mobile':_0x2fcffb},'limit':0x1,'order':[[_0x569f('0x7d'),'DESC']]}]}]})[_0x569f('0x22')](handleEntityNotFound(_0x1bf2ce,null))[_0x569f('0x22')](function(_0x519af7){if(_0x519af7&&_0x519af7[_0x569f('0xc7')]){_0x1aa9f7=_0x519af7['get']({'plain':!![]});if(_0x1aa9f7[_0x569f('0xc7')]&&_0x1aa9f7[_0x569f('0xc7')]['Contacts'][_0x569f('0x4a')]){return _0x1aa9f7['List'][_0x569f('0x9a')][0x0];}return db[_0x569f('0x9c')][_0x569f('0x5d')](_[_0x569f('0x19')](_0x19db93['body'],{'firstName':_0x2fcffb,'mobile':_0x2fcffb,'phone':_0x2fcffb,'ListId':_0x1aa9f7[_0x569f('0x7f')]}));}})[_0x569f('0x22')](handleEntityNotFound(_0x1bf2ce,null))[_0x569f('0x22')](function(_0x2a37e3){if(_0x2a37e3){_0xf2a780=_0x2a37e3;return db['SmsInteraction'][_0x569f('0x63')]({'where':{'ContactId':_0xf2a780['id'],'closed':![],'SmsAccountId':_0x1aa9f7['id']}})['then'](function(_0x3ca616){if(_0x3ca616){return[_0x3ca616,![]];}return db[_0x569f('0x9e')][_0x569f('0x5d')]({'UserId':_0x19db93[_0x569f('0x61')]['id'],'ContactId':_0xf2a780['id'],'SmsAccountId':_0x1aa9f7['id'],'phone':_0x2fcffb,'firstMsgDirection':_0x569f('0xc8'),'Messages':[_[_0x569f('0x51')](_0x19db93[_0x569f('0x5e')],{'read':![],'body':_0x19db93['body']['body'],'phone':_0x2fcffb,'SmsAccountId':_0x1aa9f7['id'],'UserId':_0x19db93[_0x569f('0x61')]['id'],'ContactId':_0xf2a780['id']})]},{'include':[{'model':db[_0x569f('0xa7')],'as':_0x569f('0xc9')}]})[_0x569f('0x22')](function(_0x5024b2){return[_0x5024b2,!![]];});});}})[_0x569f('0x9f')](function(_0x555cba,_0x21bf16){if(_0x21bf16){return _0x555cba;}return db[_0x569f('0xa7')][_0x569f('0x5d')](_[_0x569f('0x51')](_0x19db93['body'],{'read':![],'body':_0x19db93[_0x569f('0x5e')]['body'],'phone':_0x2fcffb,'SmsAccountId':_0x1aa9f7['id'],'SmsInteractionId':_0x555cba['id'],'UserId':_0x19db93[_0x569f('0x61')]['id'],'ContactId':_0xf2a780['id']}))['then'](function(_0x2eaf50){_0x555cba[_0x569f('0xca')][_0x569f('0xc9')]=[];_0x555cba['dataValues'][_0x569f('0xc9')]['push'](_0x2eaf50['dataValues']);return _0x555cba;});})['then'](respondWithResult(_0x1bf2ce,null))[_0x569f('0x2c')](handleError(_0x1bf2ce,null));};exports['status']=function(_0x22eeb3,_0x168bd9,_0x217b79){if(_0x22eeb3['body']['id']){delete _0x22eeb3['body']['id'];}var _0x31697f,_0x2179f3,_0x33e998;return db['SmsAccount'][_0x569f('0x63')]({'where':{'id':_0x22eeb3[_0x569f('0x58')]['id']}})['then'](handleEntityNotFound(_0x168bd9,null))[_0x569f('0x22')](function(_0x59ddfc){if(_0x59ddfc){_0x33e998=_0x59ddfc;logger['debug'](_0x569f('0x26'),_0x569f('0x33'),_0x569f('0xcb'),_0x59ddfc[_0x569f('0x53')],util[_0x569f('0xcc')](_0x22eeb3[_0x569f('0x5e')],{'showHidden':![],'depth':null}));switch(_0x59ddfc[_0x569f('0x53')]){case _0x569f('0xcd'):if(_0x22eeb3[_0x569f('0x5e')][_0x569f('0xce')]&&_0x22eeb3[_0x569f('0x5e')][_0x569f('0x33')]){_0x2179f3=_0x22eeb3[_0x569f('0x5e')][_0x569f('0x33')];return db[_0x569f('0xa7')][_0x569f('0x63')]({'where':{'messageId':_0x22eeb3[_0x569f('0x5e')]['skebby_dispatch_id']}});}break;case _0x569f('0x88'):if(_0x22eeb3[_0x569f('0x5e')][_0x569f('0xcf')]&&_0x22eeb3['body']['statusInt']){_0x2179f3=_0x22eeb3[_0x569f('0x5e')][_0x569f('0xd0')];return db[_0x569f('0xa7')]['find']({'where':{'messageId':_0x22eeb3[_0x569f('0x5e')][_0x569f('0xcf')]}});}break;case _0x569f('0x89'):if(_0x22eeb3[_0x569f('0x5e')][_0x569f('0xd1')]&&_0x22eeb3[_0x569f('0x5e')][_0x569f('0xd2')]){_0x2179f3=_0x22eeb3[_0x569f('0x5e')][_0x569f('0xd2')];return db['SmsMessage'][_0x569f('0x63')]({'where':{'messageId':_0x22eeb3[_0x569f('0x5e')][_0x569f('0xd1')]}});}break;case'infobip':var _0x3eb577=_0x22eeb3[_0x569f('0x5e')][_0x569f('0x8c')][0x0];if(_0x3eb577[_0x569f('0x8a')]&&_0x3eb577[_0x569f('0x33')]['groupName']==='DELIVERED'){_0x2179f3=_0x3eb577[_0x569f('0x33')][_0x569f('0xd3')];return db['SmsMessage'][_0x569f('0x63')]({'where':{'messageId':_0x3eb577['messageId']}});}break;case'clickatell':if(_0x22eeb3['body'][_0x569f('0x8a')]&&_0x22eeb3[_0x569f('0x5e')][_0x569f('0x33')]){_0x2179f3=_0x22eeb3[_0x569f('0x5e')][_0x569f('0x33')];return db[_0x569f('0xa7')]['find']({'where':{'messageId':_0x22eeb3[_0x569f('0x5e')]['messageId']}});}break;case'bandwidth':if(_0x22eeb3[_0x569f('0x5e')][0x0]['message']['id']){_0x2179f3=_0x22eeb3[_0x569f('0x5e')][0x0][_0x569f('0x53')];return db['SmsMessage']['find']({'where':{'messageId':_0x22eeb3['body'][0x0][_0x569f('0x2a')]['id']}});}break;case _0x569f('0xd4'):if(_0x22eeb3[_0x569f('0x5e')]['redif']&&_0x22eeb3[_0x569f('0x5e')][_0x569f('0x33')]){_0x2179f3=_0x22eeb3[_0x569f('0x5e')][_0x569f('0x33')];return db[_0x569f('0xa7')][_0x569f('0x63')]({'where':{'messageId':_0x22eeb3[_0x569f('0x5e')][_0x569f('0xd5')]}});}break;}}})['then'](handleEntityNotFound(_0x168bd9,null))[_0x569f('0x22')](function(_0x31cec6){if(_0x31cec6){_0x31697f=_0x31cec6;switch(_0x33e998['type']){case _0x569f('0xcd'):if(_0x2179f3===_0x569f('0xd6')){return _0x31697f[_0x569f('0x37')]({'read':!![]});}else{logger[_0x569f('0x28')](_0x569f('0x26'),'status',_0x569f('0xcd'),util['inspect'](_0x22eeb3[_0x569f('0x5e')],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x2179f3==='1'){return _0x31697f[_0x569f('0x37')]({'read':!![]});}else{logger[_0x569f('0x28')](_0x569f('0x26'),_0x569f('0x33'),_0x569f('0xcd'),util[_0x569f('0xcc')](_0x22eeb3['body'],{'showHidden':![],'depth':null}));}break;case _0x569f('0x89'):if(!_0x22eeb3[_0x569f('0x5e')][_0x569f('0xd7')]&&_0x2179f3>=0xc8&&_0x2179f3<=0xce){return _0x31697f['update']({'read':!![]});}else{logger[_0x569f('0x28')](_0x569f('0x26'),_0x569f('0x33'),_0x569f('0x89'),util[_0x569f('0xcc')](_0x22eeb3[_0x569f('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x569f('0xd8'):var _0x535e6f=_0x22eeb3[_0x569f('0x5e')][_0x569f('0x8c')][0x0];if(_0x535e6f[_0x569f('0x33')]['groupName']===_0x569f('0xd6')){return _0x31697f['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x569f('0x33'),'infobip',util[_0x569f('0xcc')](_0x22eeb3['body'],{'showHidden':![],'depth':null}));}break;case _0x569f('0xd9'):if(_0x2179f3==_0x569f('0xda')||_0x2179f3==_0x569f('0xdb')){return _0x31697f[_0x569f('0x37')]({'read':!![]});}else{logger['error'](_0x569f('0x26'),_0x569f('0x33'),'clickatell',util[_0x569f('0xcc')](_0x22eeb3['body'],{'showHidden':![],'depth':null}));}break;case _0x569f('0xdc'):if(_0x2179f3==_0x569f('0xdd')){return _0x31697f[_0x569f('0x37')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x569f('0xdc'),util[_0x569f('0xcc')](_0x22eeb3[_0x569f('0x5e')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x2179f3==='DELIVRD'||_0x2179f3===_0x569f('0xde')){return _0x31697f[_0x569f('0x37')]({'read':!![]});}else{logger[_0x569f('0x28')]('SmsAccount,\x20%s,\x20%s,\x20%s','status','intelepeer',util[_0x569f('0xcc')](_0x22eeb3[_0x569f('0x5e')],{'showHidden':![],'depth':null}));}break;}return _0x31697f;}})[_0x569f('0x22')](respondWithResult(_0x168bd9,null))[_0x569f('0x2c')](handleError(_0x168bd9,null));};exports[_0x569f('0xdf')]=function(_0x37bce2,_0x4dfae1,_0x3f40fc){var _0x52b425,_0x2901d1,_0x2bb8f1;return db[_0x569f('0x40')]['find']({'where':{'id':_0x37bce2['params']['id']}})[_0x569f('0x22')](handleEntityNotFound(_0x4dfae1,null))[_0x569f('0x22')](function(_0x46b492){if(_0x46b492){_0x2bb8f1=_0x46b492;logger[_0x569f('0x25')](_0x569f('0x26'),_0x569f('0x33'),'received\x20delivery\x20report\x20from',_0x46b492[_0x569f('0x53')],util[_0x569f('0xcc')](_0x37bce2['query'],{'showHidden':![],'depth':null}));switch(_0x46b492[_0x569f('0x53')]){case _0x569f('0x8d'):if(_0x37bce2[_0x569f('0x44')]['message-id']&&_0x37bce2['query'][_0x569f('0xe0')]){_0x2901d1=_0x37bce2['query'][_0x569f('0xe0')];return db[_0x569f('0xa7')][_0x569f('0x63')]({'where':{'messageId':_0x37bce2[_0x569f('0x44')][_0x569f('0xe1')]}});}break;}}})[_0x569f('0x22')](handleEntityNotFound(_0x4dfae1,null))['then'](function(_0x2621af){if(_0x2621af){_0x52b425=_0x2621af;switch(_0x2bb8f1[_0x569f('0x53')]){case'csc':if(_0x2901d1==='2'||_0x2901d1==='6'){return _0x52b425[_0x569f('0x37')]({'read':!![]});}else{logger[_0x569f('0x28')](_0x569f('0x26'),_0x569f('0x33'),'csc',util[_0x569f('0xcc')](_0x37bce2[_0x569f('0x44')],{'showHidden':![],'depth':null}));};break;}return _0x52b425;}})[_0x569f('0x22')](respondWithResult(_0x4dfae1,null))[_0x569f('0x2c')](handleError(_0x4dfae1,null));};exports['addAgents']=function(_0xae2529,_0x4e51fd,_0xf59c24){return db['SmsAccount'][_0x569f('0x63')]({'where':{'id':_0xae2529[_0x569f('0x58')]['id']}})['then'](handleEntityNotFound(_0x4e51fd,null))[_0x569f('0x22')](function(_0x3ee729){if(_0x3ee729){return _0x3ee729[_0x569f('0xe2')](_0xae2529[_0x569f('0x5e')][_0x569f('0x6f')],_[_0x569f('0x9b')](_0xae2529[_0x569f('0x5e')],[_0x569f('0x6f'),'id'])||{})[_0x569f('0x9f')](function(_0x181c7b){for(var _0xd44202=0x0;_0xd44202<_0xae2529[_0x569f('0x5e')][_0x569f('0x6f')]['length'];_0xd44202+=0x1){socket[_0x569f('0xe3')]('userSmsAccount:save',{'UserId':Number(_0xae2529[_0x569f('0x5e')][_0x569f('0x6f')][_0xd44202]),'SmsAccountId':Number(_0xae2529['params']['id'])});}return _0x181c7b;});}})[_0x569f('0x22')](respondWithResult(_0x4e51fd,null))[_0x569f('0x2c')](handleError(_0x4e51fd,null));};exports[_0x569f('0xe4')]=function(_0x266260,_0x5dd4c4,_0x568886){return db[_0x569f('0x40')][_0x569f('0x63')]({'where':{'id':_0x266260[_0x569f('0x58')]['id']}})[_0x569f('0x22')](handleEntityNotFound(_0x5dd4c4,null))[_0x569f('0x22')](function(_0x42ffa5){if(_0x42ffa5){return _0x42ffa5[_0x569f('0xe4')](_0x266260[_0x569f('0x44')][_0x569f('0x6f')])[_0x569f('0x22')](function(){if(_[_0x569f('0xe5')](_0x266260[_0x569f('0x44')][_0x569f('0x6f')])){for(var _0x3a5267=0x0;_0x3a5267<_0x266260[_0x569f('0x44')]['ids']['length'];_0x3a5267+=0x1){socket[_0x569f('0xe3')](_0x569f('0xe6'),{'UserId':Number(_0x266260[_0x569f('0x44')][_0x569f('0x6f')][_0x3a5267]),'SmsAccountId':Number(_0x266260[_0x569f('0x58')]['id'])});}}else{socket['emit']('userSmsAccount:remove',{'UserId':Number(_0x266260[_0x569f('0x44')][_0x569f('0x6f')]),'SmsAccountId':Number(_0x266260[_0x569f('0x58')]['id'])});}});}})[_0x569f('0x22')](respondWithStatusCode(_0x5dd4c4,null))[_0x569f('0x2c')](handleError(_0x5dd4c4,null));};exports['getAgents']=function(_0x2c6ae7,_0x42c1ba,_0x3004cb){var _0x3c83b4={};var _0x63cc9f={};var _0x1bf6ed;var _0x36c879;return db[_0x569f('0x40')][_0x569f('0x6c')]({'where':{'id':_0x2c6ae7[_0x569f('0x58')]['id']}})[_0x569f('0x22')](handleEntityNotFound(_0x42c1ba,null))[_0x569f('0x22')](function(_0x3a8400){if(_0x3a8400){_0x1bf6ed=_0x3a8400;_0x63cc9f[_0x569f('0x47')]=_['keys'](db['User'][_0x569f('0x41')]);_0x63cc9f['query']=_['keys'](_0x2c6ae7[_0x569f('0x44')]);_0x63cc9f['filters']=_['intersection'](_0x63cc9f['model'],_0x63cc9f[_0x569f('0x44')]);_0x3c83b4[_0x569f('0x48')]=_[_0x569f('0x46')](_0x63cc9f[_0x569f('0x47')],qs[_0x569f('0x49')](_0x2c6ae7['query'][_0x569f('0x49')]));_0x3c83b4['attributes']=_0x3c83b4['attributes'][_0x569f('0x4a')]?_0x3c83b4['attributes']:_0x63cc9f['model'];_0x3c83b4['order']=qs[_0x569f('0x4d')](_0x2c6ae7[_0x569f('0x44')][_0x569f('0x4d')]);_0x3c83b4['where']=qs[_0x569f('0x45')](_['pick'](_0x2c6ae7['query'],_0x63cc9f[_0x569f('0x45')]));if(_0x2c6ae7[_0x569f('0x44')][_0x569f('0x50')]){_0x3c83b4[_0x569f('0x4e')]=_['merge'](_0x3c83b4[_0x569f('0x4e')],{'$or':_[_0x569f('0x52')](_0x3c83b4[_0x569f('0x48')],function(_0x1f47d4){var _0x4c50b6={};_0x4c50b6[_0x1f47d4]={'$like':'%'+_0x2c6ae7[_0x569f('0x44')][_0x569f('0x50')]+'%'};return _0x4c50b6;})});}_0x3c83b4=_['merge']({},_0x3c83b4,_0x2c6ae7[_0x569f('0x5c')]);return _0x1bf6ed[_0x569f('0xe7')](_0x3c83b4);}})['then'](function(_0x3eddff){if(_0x3eddff){_0x36c879=_0x3eddff[_0x569f('0x4a')];if(!_0x2c6ae7[_0x569f('0x44')][_0x569f('0x4b')]('nolimit')){_0x3c83b4[_0x569f('0x30')]=qs[_0x569f('0x30')](_0x2c6ae7['query']['limit']);_0x3c83b4['offset']=qs[_0x569f('0x2f')](_0x2c6ae7[_0x569f('0x44')][_0x569f('0x2f')]);}return _0x1bf6ed['getAgents'](_0x3c83b4);}})[_0x569f('0x22')](function(_0x486abd){if(_0x486abd){return _0x486abd?{'count':_0x36c879,'rows':_0x486abd}:null;}})['then'](respondWithResult(_0x42c1ba,null))[_0x569f('0x2c')](handleError(_0x42c1ba,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index b138a86..5108dd5 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 _0xbeef=['save','update','remove','hasOwnProperty','hook','events','setMaxListeners'];(function(_0x479ccf,_0x479af5){var _0x42cd37=function(_0x3162de){while(--_0x3162de){_0x479ccf['push'](_0x479ccf['shift']());}};_0x42cd37(++_0x479af5);}(_0xbeef,0x8a));var _0xfbee=function(_0x293bfb,_0x1f636e){_0x293bfb=_0x293bfb-0x0;var _0x3db61f=_0xbeef[_0x293bfb];return _0x3db61f;};'use strict';var EventEmitter=require(_0xfbee('0x0'));var SmsAccount=require('../../mysqldb')['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xfbee('0x1')](0x0);var events={'afterCreate':_0xfbee('0x2'),'afterUpdate':_0xfbee('0x3'),'afterDestroy':_0xfbee('0x4')};function emitEvent(_0x59f22a){return function(_0x122e6c,_0x132a53,_0x521dd9){SmsAccountEvents['emit'](_0x59f22a+':'+_0x122e6c['id'],_0x122e6c);SmsAccountEvents['emit'](_0x59f22a,_0x122e6c);_0x521dd9(null);};}for(var e in events){if(events[_0xfbee('0x5')](e)){var event=events[e];SmsAccount[_0xfbee('0x6')](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file +var _0xd78c=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x3fb218,_0x315322){var _0x349f1d=function(_0x5ed933){while(--_0x5ed933){_0x3fb218['push'](_0x3fb218['shift']());}};_0x349f1d(++_0x315322);}(_0xd78c,0xb4));var _0xcd78=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xd78c[_0x5b644e];return _0x49c6bf;};'use strict';var EventEmitter=require(_0xcd78('0x0'));var SmsAccount=require(_0xcd78('0x1'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xcd78('0x2')](0x0);var events={'afterCreate':_0xcd78('0x3'),'afterUpdate':_0xcd78('0x4'),'afterDestroy':_0xcd78('0x5')};function emitEvent(_0x2405e0){return function(_0x1a7071,_0x39df0e,_0x2deb0f){SmsAccountEvents[_0xcd78('0x6')](_0x2405e0+':'+_0x1a7071['id'],_0x1a7071);SmsAccountEvents[_0xcd78('0x6')](_0x2405e0,_0x1a7071);_0x2deb0f(null);};}for(var e in events){if(events[_0xcd78('0x7')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0xcd78('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 1b446e1..0568a2e 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 _0x0fbc=['util','api','moment','bluebird','request-promise','path','./smsAccount.attributes','exports','define','sms_accounts'];(function(_0x2d53ba,_0x564bc1){var _0x504a58=function(_0xcbe0bb){while(--_0xcbe0bb){_0x2d53ba['push'](_0x2d53ba['shift']());}};_0x504a58(++_0x564bc1);}(_0x0fbc,0x1f4));var _0xc0fb=function(_0x175095,_0x486a85){_0x175095=_0x175095-0x0;var _0x137e14=_0x0fbc[_0x175095];return _0x137e14;};'use strict';var _=require('lodash');var util=require(_0xc0fb('0x0'));var logger=require('../../config/logger')(_0xc0fb('0x1'));var moment=require(_0xc0fb('0x2'));var BPromise=require(_0xc0fb('0x3'));var rp=require(_0xc0fb('0x4'));var fs=require('fs');var path=require(_0xc0fb('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc0fb('0x6'));module[_0xc0fb('0x7')]=function(_0x4acea9,_0x4c21c9){return _0x4acea9[_0xc0fb('0x8')]('SmsAccount',attributes,{'tableName':_0xc0fb('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x402d=['request-promise','path','./smsAccount.attributes','exports','define','sms_accounts','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2e73b1,_0x3f4ca1){var _0x3ec2aa=function(_0xbfbe52){while(--_0xbfbe52){_0x2e73b1['push'](_0x2e73b1['shift']());}};_0x3ec2aa(++_0x3f4ca1);}(_0x402d,0x13e));var _0xd402=function(_0x51a09f,_0x333271){_0x51a09f=_0x51a09f-0x0;var _0x38df4f=_0x402d[_0x51a09f];return _0x38df4f;};'use strict';var _=require(_0xd402('0x0'));var util=require(_0xd402('0x1'));var logger=require(_0xd402('0x2'))(_0xd402('0x3'));var moment=require(_0xd402('0x4'));var BPromise=require(_0xd402('0x5'));var rp=require(_0xd402('0x6'));var fs=require('fs');var path=require(_0xd402('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd402('0x8'));module[_0xd402('0x9')]=function(_0x25a3bf,_0x435fa5){return _0x25a3bf[_0xd402('0xa')]('SmsAccount',attributes,{'tableName':_0xd402('0xb'),'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 34a86ba..c13708b 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 _0x043c=['raw','attributes','include','model','lodash','util','moment','../../mysqldb','../../config/utils','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','request','then','info','debug','request\x20sent','stringify','error','code','SmsAccount,\x20%s,\x20%s','message','result','catch','ShowSmsAccount','SmsAccount','find','options'];(function(_0x3b60e1,_0x50d5db){var _0x45b9a7=function(_0x5f39c2){while(--_0x5f39c2){_0x3b60e1['push'](_0x3b60e1['shift']());}};_0x45b9a7(++_0x50d5db);}(_0x043c,0x158));var _0xc043=function(_0x587dd0,_0x273922){_0x587dd0=_0x587dd0-0x0;var _0x56f153=_0x043c[_0x587dd0];return _0x56f153;};'use strict';var _=require(_0xc043('0x0'));var util=require(_0xc043('0x1'));var moment=require(_0xc043('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc043('0x3'))['db'];var utils=require(_0xc043('0x4'));var logger=require('../../config/logger')(_0xc043('0x5'));var config=require('../../config/environment');var jayson=require(_0xc043('0x6'));var client=jayson['client'][_0xc043('0x7')]({'port':0x232a});config[_0xc043('0x8')]=_[_0xc043('0x9')](config['redis'],{'host':_0xc043('0xa'),'port':0x18eb});var socket=require(_0xc043('0xb'))(new Redis(config[_0xc043('0x8')]));require(_0xc043('0xc'))[_0xc043('0xd')](socket);function respondWithRpcPromise(_0x5595d8,_0x491c54,_0x22d0b1){return new BPromise(function(_0x13504f,_0x389f72){return client[_0xc043('0xe')](_0x5595d8,_0x22d0b1)[_0xc043('0xf')](function(_0x4faafc){logger[_0xc043('0x10')]('SmsAccount,\x20%s,\x20%s',_0x491c54,'request\x20sent');logger[_0xc043('0x11')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x491c54,_0xc043('0x12'),JSON[_0xc043('0x13')](_0x4faafc));if(_0x4faafc[_0xc043('0x14')]){if(_0x4faafc[_0xc043('0x14')][_0xc043('0x15')]===0x1f4){logger[_0xc043('0x14')](_0xc043('0x16'),_0x491c54,_0x4faafc[_0xc043('0x14')][_0xc043('0x17')]);return _0x389f72(_0x4faafc[_0xc043('0x14')][_0xc043('0x17')]);}logger[_0xc043('0x14')]('SmsAccount,\x20%s,\x20%s',_0x491c54,_0x4faafc[_0xc043('0x14')][_0xc043('0x17')]);return _0x13504f(_0x4faafc[_0xc043('0x14')][_0xc043('0x17')]);}else{logger[_0xc043('0x10')]('SmsAccount,\x20%s,\x20%s',_0x491c54,_0xc043('0x12'));_0x13504f(_0x4faafc[_0xc043('0x18')][_0xc043('0x17')]);}})[_0xc043('0x19')](function(_0x4a857e){logger[_0xc043('0x14')]('SmsAccount,\x20%s,\x20%s',_0x491c54,_0x4a857e);_0x389f72(_0x4a857e);});});}exports[_0xc043('0x1a')]=function(_0x47544f){var _0x3819e3=this;return new Promise(function(_0x8fc67f,_0xb2d86b){return db[_0xc043('0x1b')][_0xc043('0x1c')]({'raw':_0x47544f[_0xc043('0x1d')]?_0x47544f[_0xc043('0x1d')][_0xc043('0x1e')]===undefined?!![]:![]:!![],'where':_0x47544f[_0xc043('0x1d')]?_0x47544f[_0xc043('0x1d')]['where']||null:null,'attributes':_0x47544f['options']?_0x47544f[_0xc043('0x1d')][_0xc043('0x1f')]||null:null,'include':_0x47544f[_0xc043('0x1d')]?_0x47544f[_0xc043('0x1d')][_0xc043('0x20')]?_['map'](_0x47544f[_0xc043('0x1d')]['include'],function(_0xa50a64){return{'model':db[_0xa50a64[_0xc043('0x21')]],'as':_0xa50a64['as'],'attributes':_0xa50a64['attributes'],'include':_0xa50a64['include']?_['map'](_0xa50a64[_0xc043('0x20')],function(_0x380594){return{'model':db[_0x380594[_0xc043('0x21')]],'as':_0x380594['as'],'attributes':_0x380594['attributes'],'include':_0x380594[_0xc043('0x20')]?_['map'](_0x380594[_0xc043('0x20')],function(_0x5f10ea){return{'model':db[_0x5f10ea['model']],'as':_0x5f10ea['as'],'attributes':_0x5f10ea[_0xc043('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xc043('0xf')](function(_0x3c75bb){logger['info']('ShowSmsAccount',_0x47544f);logger[_0xc043('0x11')]('ShowSmsAccount',_0x47544f,JSON[_0xc043('0x13')](_0x3c75bb));_0x8fc67f(_0x3c75bb);})[_0xc043('0x19')](function(_0x558699){logger[_0xc043('0x14')](_0xc043('0x1a'),_0x558699['message'],_0x47544f);_0xb2d86b(_0x3819e3[_0xc043('0x14')](0x1f4,_0x558699[_0xc043('0x17')]));});});}; \ No newline at end of file +var _0x37cc=['util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','ShowSmsAccount','SmsAccount','find','options','raw','where','attributes','include','map','model','debug','catch','lodash'];(function(_0x35b724,_0x517ebc){var _0x576827=function(_0x298429){while(--_0x298429){_0x35b724['push'](_0x35b724['shift']());}};_0x576827(++_0x517ebc);}(_0x37cc,0xbd));var _0xc37c=function(_0x11668e,_0x5f3e5e){_0x11668e=_0x11668e-0x0;var _0x1cd231=_0x37cc[_0x11668e];return _0x1cd231;};'use strict';var _=require(_0xc37c('0x0'));var util=require(_0xc37c('0x1'));var moment=require(_0xc37c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc37c('0x3'));var db=require(_0xc37c('0x4'))['db'];var utils=require(_0xc37c('0x5'));var logger=require(_0xc37c('0x6'))('rpc');var config=require(_0xc37c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc37c('0x8')][_0xc37c('0x9')]({'port':0x232a});config[_0xc37c('0xa')]=_[_0xc37c('0xb')](config[_0xc37c('0xa')],{'host':_0xc37c('0xc'),'port':0x18eb});var socket=require(_0xc37c('0xd'))(new Redis(config['redis']));require(_0xc37c('0xe'))[_0xc37c('0xf')](socket);function respondWithRpcPromise(_0x4383c9,_0x213402,_0x309860){return new BPromise(function(_0x1c0305,_0x147f33){return client[_0xc37c('0x10')](_0x4383c9,_0x309860)[_0xc37c('0x11')](function(_0x234fdd){logger[_0xc37c('0x12')](_0xc37c('0x13'),_0x213402,_0xc37c('0x14'));logger['debug'](_0xc37c('0x15'),_0x213402,_0xc37c('0x14'),JSON['stringify'](_0x234fdd));if(_0x234fdd[_0xc37c('0x16')]){if(_0x234fdd['error'][_0xc37c('0x17')]===0x1f4){logger[_0xc37c('0x16')](_0xc37c('0x13'),_0x213402,_0x234fdd[_0xc37c('0x16')]['message']);return _0x147f33(_0x234fdd['error'][_0xc37c('0x18')]);}logger[_0xc37c('0x16')](_0xc37c('0x13'),_0x213402,_0x234fdd['error'][_0xc37c('0x18')]);return _0x1c0305(_0x234fdd['error'][_0xc37c('0x18')]);}else{logger[_0xc37c('0x12')](_0xc37c('0x13'),_0x213402,_0xc37c('0x14'));_0x1c0305(_0x234fdd[_0xc37c('0x19')]['message']);}})['catch'](function(_0x93c2ff){logger[_0xc37c('0x16')](_0xc37c('0x13'),_0x213402,_0x93c2ff);_0x147f33(_0x93c2ff);});});}exports[_0xc37c('0x1a')]=function(_0x896d9c){var _0x589eb2=this;return new Promise(function(_0x3266f8,_0x3dfde3){return db[_0xc37c('0x1b')][_0xc37c('0x1c')]({'raw':_0x896d9c[_0xc37c('0x1d')]?_0x896d9c[_0xc37c('0x1d')][_0xc37c('0x1e')]===undefined?!![]:![]:!![],'where':_0x896d9c['options']?_0x896d9c[_0xc37c('0x1d')][_0xc37c('0x1f')]||null:null,'attributes':_0x896d9c[_0xc37c('0x1d')]?_0x896d9c['options'][_0xc37c('0x20')]||null:null,'include':_0x896d9c['options']?_0x896d9c[_0xc37c('0x1d')][_0xc37c('0x21')]?_[_0xc37c('0x22')](_0x896d9c['options'][_0xc37c('0x21')],function(_0x1b13aa){return{'model':db[_0x1b13aa['model']],'as':_0x1b13aa['as'],'attributes':_0x1b13aa[_0xc37c('0x20')],'include':_0x1b13aa[_0xc37c('0x21')]?_[_0xc37c('0x22')](_0x1b13aa[_0xc37c('0x21')],function(_0x468780){return{'model':db[_0x468780[_0xc37c('0x23')]],'as':_0x468780['as'],'attributes':_0x468780['attributes'],'include':_0x468780[_0xc37c('0x21')]?_[_0xc37c('0x22')](_0x468780[_0xc37c('0x21')],function(_0x2f7bd2){return{'model':db[_0x2f7bd2[_0xc37c('0x23')]],'as':_0x2f7bd2['as'],'attributes':_0x2f7bd2[_0xc37c('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x20d8b2){logger[_0xc37c('0x12')](_0xc37c('0x1a'),_0x896d9c);logger[_0xc37c('0x24')](_0xc37c('0x1a'),_0x896d9c,JSON['stringify'](_0x20d8b2));_0x3266f8(_0x20d8b2);})[_0xc37c('0x25')](function(_0x39da3c){logger[_0xc37c('0x16')]('ShowSmsAccount',_0x39da3c['message'],_0x896d9c);_0x3dfde3(_0x589eb2[_0xc37c('0x16')](0x1f4,_0x39da3c['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index d90d482..529d98b 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(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'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(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'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 3bb5d14..ad4027b 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 _0x34e8=['../../config/environment','./smsApplication.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5d5504,_0xc375cd){var _0x18e885=function(_0xd07da3){while(--_0xd07da3){_0x5d5504['push'](_0x5d5504['shift']());}};_0x18e885(++_0xc375cd);}(_0x34e8,0x12c));var _0x834e=function(_0x9651c3,_0x24e5b1){_0x9651c3=_0x9651c3-0x0;var _0x122675=_0x34e8[_0x9651c3];return _0x122675;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var fs_extra=require(_0x834e('0x5'));var auth=require(_0x834e('0x6'));var interaction=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var controller=require(_0x834e('0x9'));router[_0x834e('0xa')]('/',auth['isAuthenticated'](),controller[_0x834e('0xb')]);router['get'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router[_0x834e('0xf')]('/',auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0x11')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0x13')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);module[_0x834e('0x15')]=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(_0x2afb21,_0x35f94d){var _0x5e7cc5=function(_0x534222){while(--_0x534222){_0x2afb21['push'](_0x2afb21['shift']());}};_0x5e7cc5(++_0x35f94d);}(_0x7217,0x19e));var _0x7721=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0x7217[_0xbe200f];return _0x192597;};'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 6de79e4..61b414a 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 _0x7b0a=['STRING','TEXT','*,*,*,*','sequelize','exports'];(function(_0x48be3a,_0x2ac55e){var _0x2e5435=function(_0x351a64){while(--_0x351a64){_0x48be3a['push'](_0x48be3a['shift']());}};_0x2e5435(++_0x2ac55e);}(_0x7b0a,0x143));var _0xa7b0=function(_0x469328,_0x46ea2e){_0x469328=_0x469328-0x0;var _0xacf1d6=_0x7b0a[_0x469328];return _0xacf1d6;};'use strict';var Sequelize=require(_0xa7b0('0x0'));module[_0xa7b0('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xa7b0('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xa7b0('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xa7b0('0x2')],'defaultValue':_0xa7b0('0x4')}}; \ No newline at end of file +var _0xc9f7=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x1052d6,_0x4342ac){var _0x2abb2e=function(_0x288fc1){while(--_0x288fc1){_0x1052d6['push'](_0x1052d6['shift']());}};_0x2abb2e(++_0x4342ac);}(_0xc9f7,0x1bb));var _0x7c9f=function(_0x348ebe,_0x3f1b90){_0x348ebe=_0x348ebe-0x0;var _0x10c74b=_0xc9f7[_0x348ebe];return _0x10c74b;};'use strict';var Sequelize=require(_0x7c9f('0x0'));module[_0x7c9f('0x1')]={'priority':{'type':Sequelize[_0x7c9f('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x7c9f('0x3')],'allowNull':![],'defaultValue':_0x7c9f('0x4')},'appdata':{'type':Sequelize[_0x7c9f('0x5')]()},'description':{'type':Sequelize[_0x7c9f('0x3')]},'interval':{'type':Sequelize[_0x7c9f('0x3')],'defaultValue':_0x7c9f('0x6')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index baef564..1660847 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 _0x36a4=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','error','name','send','index','SmsApplication','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','params','find','create','body','eml-format','zip-dir','fast-json-patch','moment','bluebird','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'];(function(_0x496acd,_0x144020){var _0x5171b1=function(_0x302a6d){while(--_0x302a6d){_0x496acd['push'](_0x496acd['shift']());}};_0x5171b1(++_0x144020);}(_0x36a4,0x11f));var _0x436a=function(_0xbd1f50,_0x1abfa6){_0xbd1f50=_0xbd1f50-0x0;var _0x472bb2=_0x36a4[_0xbd1f50];return _0x472bb2;};'use strict';var emlformat=require(_0x436a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x436a('0x1'));var jsonpatch=require(_0x436a('0x2'));var rp=require('request-promise');var moment=require(_0x436a('0x3'));var BPromise=require(_0x436a('0x4'));var Mustache=require(_0x436a('0x5'));var util=require(_0x436a('0x6'));var path=require(_0x436a('0x7'));var sox=require(_0x436a('0x8'));var csv=require(_0x436a('0x9'));var ejs=require(_0x436a('0xa'));var fs=require('fs');var fs_extra=require(_0x436a('0xb'));var _=require(_0x436a('0xc'));var squel=require('squel');var crypto=require(_0x436a('0xd'));var jsforce=require(_0x436a('0xe'));var deskjs=require(_0x436a('0xf'));var toCsv=require(_0x436a('0x9'));var querystring=require(_0x436a('0x10'));var Papa=require(_0x436a('0x11'));var Redis=require(_0x436a('0x12'));var authService=require(_0x436a('0x13'));var qs=require(_0x436a('0x14'));var as=require(_0x436a('0x15'));var hardwareService=require(_0x436a('0x16'));var logger=require(_0x436a('0x17'))(_0x436a('0x18'));var utils=require(_0x436a('0x19'));var config=require(_0x436a('0x1a'));var licenseUtil=require(_0x436a('0x1b'));var db=require(_0x436a('0x1c'))['db'];function respondWithStatusCode(_0x29af20,_0x55ff3d){_0x55ff3d=_0x55ff3d||0xcc;return function(_0x83259e){if(_0x83259e){return _0x29af20[_0x436a('0x1d')](_0x55ff3d);}return _0x29af20[_0x436a('0x1e')](_0x55ff3d)[_0x436a('0x1f')]();};}function respondWithResult(_0x47f22a,_0x21ad29){_0x21ad29=_0x21ad29||0xc8;return function(_0x1145bc){if(_0x1145bc){return _0x47f22a['status'](_0x21ad29)[_0x436a('0x20')](_0x1145bc);}};}function respondWithFilteredResult(_0x1639ee,_0x4f6f1a){return function(_0x286a7d){if(_0x286a7d){var _0xe11aa0=typeof _0x4f6f1a[_0x436a('0x21')]==='undefined'&&typeof _0x4f6f1a['limit']===_0x436a('0x22');var _0x4a5406=_0x286a7d[_0x436a('0x23')];var _0x421e6c=_0xe11aa0?0x0:_0x4f6f1a[_0x436a('0x21')];var _0x3eb340=_0xe11aa0?_0x286a7d[_0x436a('0x23')]:_0x4f6f1a[_0x436a('0x21')]+_0x4f6f1a[_0x436a('0x24')];var _0xb9c01b;if(_0x3eb340>=_0x4a5406){_0x3eb340=_0x4a5406;_0xb9c01b=0xc8;}else{_0xb9c01b=0xce;}_0x1639ee['status'](_0xb9c01b);return _0x1639ee[_0x436a('0x25')](_0x436a('0x26'),_0x421e6c+'-'+_0x3eb340+'/'+_0x4a5406)[_0x436a('0x20')](_0x286a7d);}return null;};}function patchUpdates(_0x1d190e){return function(_0x32bea9){try{jsonpatch[_0x436a('0x27')](_0x32bea9,_0x1d190e,!![]);}catch(_0x3455b9){return BPromise[_0x436a('0x28')](_0x3455b9);}return _0x32bea9[_0x436a('0x29')]();};}function saveUpdates(_0x1176a7,_0x2a0472){return function(_0x3c5d6d){if(_0x3c5d6d){return _0x3c5d6d['update'](_0x1176a7)[_0x436a('0x2a')](function(_0x25fff9){return _0x25fff9;});}return null;};}function removeEntity(_0x4cf647,_0x3c23af){return function(_0x28453c){if(_0x28453c){return _0x28453c['destroy']()[_0x436a('0x2a')](function(){_0x4cf647[_0x436a('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1066af,_0x49b0a5){return function(_0x47d1c1){if(!_0x47d1c1){_0x1066af[_0x436a('0x1d')](0x194);}return _0x47d1c1;};}function handleError(_0x57ca2c,_0x546a14){_0x546a14=_0x546a14||0x1f4;return function(_0x56ca41){logger[_0x436a('0x2b')](_0x56ca41['stack']);if(_0x56ca41['name']){delete _0x56ca41[_0x436a('0x2c')];}_0x57ca2c['status'](_0x546a14)[_0x436a('0x2d')](_0x56ca41);};}exports[_0x436a('0x2e')]=function(_0x5ae4ce,_0x218275){var _0x1e9b17={},_0x3f7ce1={},_0x50e85d={'count':0x0,'rows':[]};var _0x3e4714=_['map'](db[_0x436a('0x2f')][_0x436a('0x30')],function(_0x1acdbf){return{'name':_0x1acdbf[_0x436a('0x31')],'type':_0x1acdbf['type'][_0x436a('0x32')]};});_0x3f7ce1[_0x436a('0x33')]=_[_0x436a('0x34')](_0x3e4714,_0x436a('0x2c'));_0x3f7ce1['query']=_[_0x436a('0x35')](_0x5ae4ce[_0x436a('0x36')]);_0x3f7ce1[_0x436a('0x37')]=_[_0x436a('0x38')](_0x3f7ce1['model'],_0x3f7ce1[_0x436a('0x36')]);_0x1e9b17[_0x436a('0x39')]=_['intersection'](_0x3f7ce1[_0x436a('0x33')],qs[_0x436a('0x3a')](_0x5ae4ce[_0x436a('0x36')][_0x436a('0x3a')]));_0x1e9b17[_0x436a('0x39')]=_0x1e9b17[_0x436a('0x39')][_0x436a('0x3b')]?_0x1e9b17[_0x436a('0x39')]:_0x3f7ce1[_0x436a('0x33')];if(!_0x5ae4ce[_0x436a('0x36')][_0x436a('0x3c')](_0x436a('0x3d'))){_0x1e9b17[_0x436a('0x24')]=qs['limit'](_0x5ae4ce['query'][_0x436a('0x24')]);_0x1e9b17[_0x436a('0x21')]=qs[_0x436a('0x21')](_0x5ae4ce[_0x436a('0x36')][_0x436a('0x21')]);}_0x1e9b17[_0x436a('0x3e')]=qs[_0x436a('0x3f')](_0x5ae4ce['query'][_0x436a('0x3f')]);_0x1e9b17['where']=qs[_0x436a('0x37')](_[_0x436a('0x40')](_0x5ae4ce[_0x436a('0x36')],_0x3f7ce1[_0x436a('0x37')]),_0x3e4714);if(_0x5ae4ce[_0x436a('0x36')][_0x436a('0x41')]){_0x1e9b17[_0x436a('0x42')]=_[_0x436a('0x43')](_0x1e9b17['where'],{'$or':_[_0x436a('0x34')](_0x3e4714,function(_0x2a9d0f){if(_0x2a9d0f['type']!==_0x436a('0x44')){var _0x47b173={};_0x47b173[_0x2a9d0f[_0x436a('0x2c')]]={'$like':'%'+_0x5ae4ce[_0x436a('0x36')][_0x436a('0x41')]+'%'};return _0x47b173;}})});}_0x1e9b17=_[_0x436a('0x43')]({},_0x1e9b17,_0x5ae4ce[_0x436a('0x45')]);var _0x552b9f={'where':_0x1e9b17[_0x436a('0x42')]};return db[_0x436a('0x2f')][_0x436a('0x23')](_0x552b9f)['then'](function(_0x14ec7a){_0x50e85d[_0x436a('0x23')]=_0x14ec7a;if(_0x5ae4ce[_0x436a('0x36')][_0x436a('0x46')]){_0x1e9b17[_0x436a('0x47')]=[{'all':!![]}];}return db[_0x436a('0x2f')]['findAll'](_0x1e9b17);})[_0x436a('0x2a')](function(_0x4b186b){_0x50e85d[_0x436a('0x48')]=_0x4b186b;return _0x50e85d;})['then'](respondWithFilteredResult(_0x218275,_0x1e9b17))[_0x436a('0x49')](handleError(_0x218275,null));};exports['show']=function(_0x147e3b,_0x42109c){var _0x30c0c7={'raw':!![],'where':{'id':_0x147e3b[_0x436a('0x4a')]['id']}},_0x4b4fbd={};_0x4b4fbd[_0x436a('0x33')]=_['keys'](db[_0x436a('0x2f')][_0x436a('0x30')]);_0x4b4fbd[_0x436a('0x36')]=_['keys'](_0x147e3b[_0x436a('0x36')]);_0x4b4fbd[_0x436a('0x37')]=_[_0x436a('0x38')](_0x4b4fbd['model'],_0x4b4fbd['query']);_0x30c0c7[_0x436a('0x39')]=_[_0x436a('0x38')](_0x4b4fbd[_0x436a('0x33')],qs['fields'](_0x147e3b[_0x436a('0x36')][_0x436a('0x3a')]));_0x30c0c7[_0x436a('0x39')]=_0x30c0c7[_0x436a('0x39')][_0x436a('0x3b')]?_0x30c0c7[_0x436a('0x39')]:_0x4b4fbd[_0x436a('0x33')];if(_0x147e3b[_0x436a('0x36')][_0x436a('0x46')]){_0x30c0c7[_0x436a('0x47')]=[{'all':!![]}];}_0x30c0c7=_[_0x436a('0x43')]({},_0x30c0c7,_0x147e3b[_0x436a('0x45')]);return db[_0x436a('0x2f')][_0x436a('0x4b')](_0x30c0c7)[_0x436a('0x2a')](handleEntityNotFound(_0x42109c,null))[_0x436a('0x2a')](respondWithResult(_0x42109c,null))[_0x436a('0x49')](handleError(_0x42109c,null));};exports[_0x436a('0x4c')]=function(_0x2c9c94,_0xce824c){return db[_0x436a('0x2f')][_0x436a('0x4c')](_0x2c9c94[_0x436a('0x4d')],{})[_0x436a('0x2a')](respondWithResult(_0xce824c,0xc9))[_0x436a('0x49')](handleError(_0xce824c,null));};exports['update']=function(_0x4fa485,_0xcdee68){if(_0x4fa485[_0x436a('0x4d')]['id']){delete _0x4fa485[_0x436a('0x4d')]['id'];}return db[_0x436a('0x2f')][_0x436a('0x4b')]({'where':{'id':_0x4fa485[_0x436a('0x4a')]['id']}})[_0x436a('0x2a')](handleEntityNotFound(_0xcdee68,null))[_0x436a('0x2a')](saveUpdates(_0x4fa485[_0x436a('0x4d')],null))[_0x436a('0x2a')](respondWithResult(_0xcdee68,null))[_0x436a('0x49')](handleError(_0xcdee68,null));};exports['destroy']=function(_0x1651dc,_0xcee4d){return db['SmsApplication']['find']({'where':{'id':_0x1651dc['params']['id']}})['then'](handleEntityNotFound(_0xcee4d,null))[_0x436a('0x2a')](removeEntity(_0xcee4d,null))[_0x436a('0x49')](handleError(_0xcee4d,null));}; \ No newline at end of file +var _0xa63c=['attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','merge','type','VIRTUAL','includeAll','include','findAll','show','params','length','options','find','catch','create','body','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','end','stack','name','send','SmsApplication','rawAttributes','fieldName','key','map','query','keys','intersection','model'];(function(_0x1493d9,_0x3587af){var _0x4b4453=function(_0x56a536){while(--_0x56a536){_0x1493d9['push'](_0x1493d9['shift']());}};_0x4b4453(++_0x3587af);}(_0xa63c,0xf9));var _0xca63=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xa63c[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require(_0xca63('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xca63('0x1'));var jsonpatch=require(_0xca63('0x2'));var rp=require(_0xca63('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xca63('0x4'));var util=require(_0xca63('0x5'));var path=require(_0xca63('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xca63('0x7'));var _=require(_0xca63('0x8'));var squel=require(_0xca63('0x9'));var crypto=require(_0xca63('0xa'));var jsforce=require(_0xca63('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xca63('0xc'));var querystring=require(_0xca63('0xd'));var Papa=require(_0xca63('0xe'));var Redis=require(_0xca63('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xca63('0x10'));var as=require(_0xca63('0x11'));var hardwareService=require(_0xca63('0x12'));var logger=require('../../config/logger')(_0xca63('0x13'));var utils=require(_0xca63('0x14'));var config=require(_0xca63('0x15'));var licenseUtil=require(_0xca63('0x16'));var db=require(_0xca63('0x17'))['db'];function respondWithStatusCode(_0x5257a0,_0x17f1ef){_0x17f1ef=_0x17f1ef||0xcc;return function(_0x27442d){if(_0x27442d){return _0x5257a0[_0xca63('0x18')](_0x17f1ef);}return _0x5257a0[_0xca63('0x19')](_0x17f1ef)['end']();};}function respondWithResult(_0xb1a661,_0x440af3){_0x440af3=_0x440af3||0xc8;return function(_0x363194){if(_0x363194){return _0xb1a661[_0xca63('0x19')](_0x440af3)[_0xca63('0x1a')](_0x363194);}};}function respondWithFilteredResult(_0x5223af,_0x532cdc){return function(_0xe92e46){if(_0xe92e46){var _0x21fb1f=typeof _0x532cdc[_0xca63('0x1b')]==='undefined'&&typeof _0x532cdc[_0xca63('0x1c')]===_0xca63('0x1d');var _0x58c4be=_0xe92e46[_0xca63('0x1e')];var _0x545737=_0x21fb1f?0x0:_0x532cdc[_0xca63('0x1b')];var _0x34fe38=_0x21fb1f?_0xe92e46['count']:_0x532cdc[_0xca63('0x1b')]+_0x532cdc[_0xca63('0x1c')];var _0x2f16ac;if(_0x34fe38>=_0x58c4be){_0x34fe38=_0x58c4be;_0x2f16ac=0xc8;}else{_0x2f16ac=0xce;}_0x5223af[_0xca63('0x19')](_0x2f16ac);return _0x5223af[_0xca63('0x1f')](_0xca63('0x20'),_0x545737+'-'+_0x34fe38+'/'+_0x58c4be)['json'](_0xe92e46);}return null;};}function patchUpdates(_0xf6292){return function(_0x1ab0bd){try{jsonpatch['apply'](_0x1ab0bd,_0xf6292,!![]);}catch(_0x4f8221){return BPromise[_0xca63('0x21')](_0x4f8221);}return _0x1ab0bd[_0xca63('0x22')]();};}function saveUpdates(_0x514a84,_0x4505bb){return function(_0x286222){if(_0x286222){return _0x286222[_0xca63('0x23')](_0x514a84)[_0xca63('0x24')](function(_0x2ad2d3){return _0x2ad2d3;});}return null;};}function removeEntity(_0xde0555,_0x1d4a6c){return function(_0x291e29){if(_0x291e29){return _0x291e29[_0xca63('0x25')]()[_0xca63('0x24')](function(){_0xde0555[_0xca63('0x19')](0xcc)[_0xca63('0x26')]();});}};}function handleEntityNotFound(_0x35f3cc,_0x1ee604){return function(_0x5540d3){if(!_0x5540d3){_0x35f3cc['sendStatus'](0x194);}return _0x5540d3;};}function handleError(_0x239e3b,_0x5a1d77){_0x5a1d77=_0x5a1d77||0x1f4;return function(_0x48700e){logger['error'](_0x48700e[_0xca63('0x27')]);if(_0x48700e['name']){delete _0x48700e[_0xca63('0x28')];}_0x239e3b[_0xca63('0x19')](_0x5a1d77)[_0xca63('0x29')](_0x48700e);};}exports['index']=function(_0x4ff881,_0x4a01b2){var _0x25063f={},_0xc3175={},_0x74507b={'count':0x0,'rows':[]};var _0x5a6473=_['map'](db[_0xca63('0x2a')][_0xca63('0x2b')],function(_0x5c5219){return{'name':_0x5c5219[_0xca63('0x2c')],'type':_0x5c5219['type'][_0xca63('0x2d')]};});_0xc3175['model']=_[_0xca63('0x2e')](_0x5a6473,_0xca63('0x28'));_0xc3175[_0xca63('0x2f')]=_[_0xca63('0x30')](_0x4ff881['query']);_0xc3175['filters']=_[_0xca63('0x31')](_0xc3175[_0xca63('0x32')],_0xc3175[_0xca63('0x2f')]);_0x25063f[_0xca63('0x33')]=_['intersection'](_0xc3175[_0xca63('0x32')],qs[_0xca63('0x34')](_0x4ff881['query']['fields']));_0x25063f['attributes']=_0x25063f[_0xca63('0x33')]['length']?_0x25063f[_0xca63('0x33')]:_0xc3175[_0xca63('0x32')];if(!_0x4ff881['query'][_0xca63('0x35')](_0xca63('0x36'))){_0x25063f[_0xca63('0x1c')]=qs[_0xca63('0x1c')](_0x4ff881['query'][_0xca63('0x1c')]);_0x25063f[_0xca63('0x1b')]=qs[_0xca63('0x1b')](_0x4ff881[_0xca63('0x2f')][_0xca63('0x1b')]);}_0x25063f[_0xca63('0x37')]=qs[_0xca63('0x38')](_0x4ff881[_0xca63('0x2f')]['sort']);_0x25063f['where']=qs['filters'](_[_0xca63('0x39')](_0x4ff881[_0xca63('0x2f')],_0xc3175[_0xca63('0x3a')]),_0x5a6473);if(_0x4ff881[_0xca63('0x2f')][_0xca63('0x3b')]){_0x25063f[_0xca63('0x3c')]=_[_0xca63('0x3d')](_0x25063f['where'],{'$or':_[_0xca63('0x2e')](_0x5a6473,function(_0x513b62){if(_0x513b62[_0xca63('0x3e')]!==_0xca63('0x3f')){var _0x3c08a3={};_0x3c08a3[_0x513b62['name']]={'$like':'%'+_0x4ff881[_0xca63('0x2f')][_0xca63('0x3b')]+'%'};return _0x3c08a3;}})});}_0x25063f=_[_0xca63('0x3d')]({},_0x25063f,_0x4ff881['options']);var _0x5edfc0={'where':_0x25063f[_0xca63('0x3c')]};return db[_0xca63('0x2a')][_0xca63('0x1e')](_0x5edfc0)['then'](function(_0x225d26){_0x74507b[_0xca63('0x1e')]=_0x225d26;if(_0x4ff881[_0xca63('0x2f')][_0xca63('0x40')]){_0x25063f[_0xca63('0x41')]=[{'all':!![]}];}return db['SmsApplication'][_0xca63('0x42')](_0x25063f);})[_0xca63('0x24')](function(_0x5ec9a6){_0x74507b['rows']=_0x5ec9a6;return _0x74507b;})[_0xca63('0x24')](respondWithFilteredResult(_0x4a01b2,_0x25063f))['catch'](handleError(_0x4a01b2,null));};exports[_0xca63('0x43')]=function(_0x3ec485,_0x5993d3){var _0x259f92={'raw':!![],'where':{'id':_0x3ec485[_0xca63('0x44')]['id']}},_0x2db5fc={};_0x2db5fc['model']=_['keys'](db['SmsApplication']['rawAttributes']);_0x2db5fc[_0xca63('0x2f')]=_[_0xca63('0x30')](_0x3ec485['query']);_0x2db5fc[_0xca63('0x3a')]=_['intersection'](_0x2db5fc['model'],_0x2db5fc[_0xca63('0x2f')]);_0x259f92[_0xca63('0x33')]=_[_0xca63('0x31')](_0x2db5fc[_0xca63('0x32')],qs[_0xca63('0x34')](_0x3ec485[_0xca63('0x2f')]['fields']));_0x259f92[_0xca63('0x33')]=_0x259f92[_0xca63('0x33')][_0xca63('0x45')]?_0x259f92['attributes']:_0x2db5fc[_0xca63('0x32')];if(_0x3ec485['query'][_0xca63('0x40')]){_0x259f92[_0xca63('0x41')]=[{'all':!![]}];}_0x259f92=_[_0xca63('0x3d')]({},_0x259f92,_0x3ec485[_0xca63('0x46')]);return db[_0xca63('0x2a')][_0xca63('0x47')](_0x259f92)[_0xca63('0x24')](handleEntityNotFound(_0x5993d3,null))[_0xca63('0x24')](respondWithResult(_0x5993d3,null))[_0xca63('0x48')](handleError(_0x5993d3,null));};exports[_0xca63('0x49')]=function(_0x5440ed,_0xba8269){return db[_0xca63('0x2a')][_0xca63('0x49')](_0x5440ed[_0xca63('0x4a')],{})[_0xca63('0x24')](respondWithResult(_0xba8269,0xc9))['catch'](handleError(_0xba8269,null));};exports['update']=function(_0x52130f,_0x4bd971){if(_0x52130f['body']['id']){delete _0x52130f[_0xca63('0x4a')]['id'];}return db['SmsApplication'][_0xca63('0x47')]({'where':{'id':_0x52130f[_0xca63('0x44')]['id']}})[_0xca63('0x24')](handleEntityNotFound(_0x4bd971,null))[_0xca63('0x24')](saveUpdates(_0x52130f[_0xca63('0x4a')],null))[_0xca63('0x24')](respondWithResult(_0x4bd971,null))[_0xca63('0x48')](handleError(_0x4bd971,null));};exports[_0xca63('0x25')]=function(_0x418e20,_0x3d95a8){return db[_0xca63('0x2a')][_0xca63('0x47')]({'where':{'id':_0x418e20['params']['id']}})[_0xca63('0x24')](handleEntityNotFound(_0x3d95a8,null))[_0xca63('0x24')](removeEntity(_0x3d95a8,null))[_0xca63('0x48')](handleError(_0x3d95a8,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index f149662..8412078 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 _0xd999=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./smsApplication.attributes','define','sms_applications','utf8mb4_unicode_ci'];(function(_0x38eb23,_0x196e8b){var _0x48506a=function(_0x36edb0){while(--_0x36edb0){_0x38eb23['push'](_0x38eb23['shift']());}};_0x48506a(++_0x196e8b);}(_0xd999,0x9c));var _0x9d99=function(_0x36a3d1,_0x4a32cd){_0x36a3d1=_0x36a3d1-0x0;var _0x821ef4=_0xd999[_0x36a3d1];return _0x821ef4;};'use strict';var _=require(_0x9d99('0x0'));var util=require('util');var logger=require(_0x9d99('0x1'))(_0x9d99('0x2'));var moment=require(_0x9d99('0x3'));var BPromise=require(_0x9d99('0x4'));var rp=require(_0x9d99('0x5'));var fs=require('fs');var path=require(_0x9d99('0x6'));var rimraf=require(_0x9d99('0x7'));var config=require('../../config/environment');var attributes=require(_0x9d99('0x8'));module['exports']=function(_0x51e1eb,_0x2096dc){return _0x51e1eb[_0x9d99('0x9')]('SmsApplication',attributes,{'tableName':_0x9d99('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x9d99('0xb')});}; \ No newline at end of file +var _0x5b8a=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsApplication.attributes','define','SmsApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x260474,_0x344c30){var _0x54c8a9=function(_0x34aeeb){while(--_0x34aeeb){_0x260474['push'](_0x260474['shift']());}};_0x54c8a9(++_0x344c30);}(_0x5b8a,0x14d));var _0xa5b8=function(_0x153673,_0x163355){_0x153673=_0x153673-0x0;var _0x136ebe=_0x5b8a[_0x153673];return _0x136ebe;};'use strict';var _=require(_0xa5b8('0x0'));var util=require(_0xa5b8('0x1'));var logger=require(_0xa5b8('0x2'))('api');var moment=require(_0xa5b8('0x3'));var BPromise=require(_0xa5b8('0x4'));var rp=require(_0xa5b8('0x5'));var fs=require('fs');var path=require(_0xa5b8('0x6'));var rimraf=require(_0xa5b8('0x7'));var config=require(_0xa5b8('0x8'));var attributes=require(_0xa5b8('0x9'));module['exports']=function(_0xdcdf8,_0x10e9d7){return _0xdcdf8[_0xa5b8('0xa')](_0xa5b8('0xb'),attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa5b8('0xc'),'collate':_0xa5b8('0xd')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index ef60cfd..b626ce7 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 _0x5453=['randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','request','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x1da1ca,_0x58b277){var _0x78944c=function(_0x12981c){while(--_0x12981c){_0x1da1ca['push'](_0x1da1ca['shift']());}};_0x78944c(++_0x58b277);}(_0x5453,0x18b));var _0x3545=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x5453[_0x126558];return _0x1f6d14;};'use strict';var _=require(_0x3545('0x0'));var util=require(_0x3545('0x1'));var moment=require(_0x3545('0x2'));var BPromise=require(_0x3545('0x3'));var rs=require(_0x3545('0x4'));var fs=require('fs');var Redis=require(_0x3545('0x5'));var db=require(_0x3545('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3545('0x7'));var config=require(_0x3545('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3545('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x290aa5,_0x496d6b,_0x5d5808){return new BPromise(function(_0x2974ae,_0x3cf0cc){return client[_0x3545('0xa')](_0x290aa5,_0x5d5808)['then'](function(_0x21dc51){logger[_0x3545('0xb')](_0x3545('0xc'),_0x496d6b,_0x3545('0xd'));logger[_0x3545('0xe')](_0x3545('0xf'),_0x496d6b,_0x3545('0xd'),JSON['stringify'](_0x21dc51));if(_0x21dc51['error']){if(_0x21dc51[_0x3545('0x10')][_0x3545('0x11')]===0x1f4){logger[_0x3545('0x10')](_0x3545('0xc'),_0x496d6b,_0x21dc51['error']['message']);return _0x3cf0cc(_0x21dc51['error'][_0x3545('0x12')]);}logger[_0x3545('0x10')]('SmsApplication,\x20%s,\x20%s',_0x496d6b,_0x21dc51[_0x3545('0x10')]['message']);return _0x2974ae(_0x21dc51['error'][_0x3545('0x12')]);}else{logger[_0x3545('0xb')]('SmsApplication,\x20%s,\x20%s',_0x496d6b,_0x3545('0xd'));_0x2974ae(_0x21dc51[_0x3545('0x13')]['message']);}})[_0x3545('0x14')](function(_0x51f69b){logger[_0x3545('0x10')](_0x3545('0xc'),_0x496d6b,_0x51f69b);_0x3cf0cc(_0x51f69b);});});} \ No newline at end of file +var _0x349e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsApplication,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x349e,0xcb));var _0xe349=function(_0x143674,_0x437ff9){_0x143674=_0x143674-0x0;var _0x18797f=_0x349e[_0x143674];return _0x18797f;};'use strict';var _=require(_0xe349('0x0'));var util=require(_0xe349('0x1'));var moment=require(_0xe349('0x2'));var BPromise=require(_0xe349('0x3'));var rs=require(_0xe349('0x4'));var fs=require('fs');var Redis=require(_0xe349('0x5'));var db=require(_0xe349('0x6'))['db'];var utils=require(_0xe349('0x7'));var logger=require(_0xe349('0x8'))('rpc');var config=require(_0xe349('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe349('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x494605,_0xcb9b49,_0x6efb47){return new BPromise(function(_0x535968,_0x114c1b){return client[_0xe349('0xb')](_0x494605,_0x6efb47)[_0xe349('0xc')](function(_0x7b08d2){logger[_0xe349('0xd')]('SmsApplication,\x20%s,\x20%s',_0xcb9b49,_0xe349('0xe'));logger[_0xe349('0xf')](_0xe349('0x10'),_0xcb9b49,_0xe349('0xe'),JSON[_0xe349('0x11')](_0x7b08d2));if(_0x7b08d2[_0xe349('0x12')]){if(_0x7b08d2[_0xe349('0x12')][_0xe349('0x13')]===0x1f4){logger[_0xe349('0x12')](_0xe349('0x14'),_0xcb9b49,_0x7b08d2[_0xe349('0x12')][_0xe349('0x15')]);return _0x114c1b(_0x7b08d2[_0xe349('0x12')][_0xe349('0x15')]);}logger[_0xe349('0x12')](_0xe349('0x14'),_0xcb9b49,_0x7b08d2[_0xe349('0x12')]['message']);return _0x535968(_0x7b08d2[_0xe349('0x12')]['message']);}else{logger[_0xe349('0xd')](_0xe349('0x14'),_0xcb9b49,_0xe349('0xe'));_0x535968(_0x7b08d2['result']['message']);}})[_0xe349('0x16')](function(_0x3ff17c){logger[_0xe349('0x12')](_0xe349('0x14'),_0xcb9b49,_0x3ff17c);_0x114c1b(_0x3ff17c);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index dee999d..37550cb 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 _0x36ee=['../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','smsinteraction:addtags','addTags','put','tracked','sms','smsinteraction:update','update','delete','smsinteraction:destroy','/:id/tags','removeTags','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x33866f,_0x4fd12c){var _0x54a057=function(_0x1ee35a){while(--_0x1ee35a){_0x33866f['push'](_0x33866f['shift']());}};_0x54a057(++_0x4fd12c);}(_0x36ee,0xe8));var _0xe36e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x36ee[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe36e('0x0'));var timeout=require('connect-timeout');var express=require(_0xe36e('0x1'));var router=express[_0xe36e('0x2')]();var fs_extra=require(_0xe36e('0x3'));var auth=require(_0xe36e('0x4'));var interaction=require(_0xe36e('0x5'));var config=require(_0xe36e('0x6'));var controller=require(_0xe36e('0x7'));router[_0xe36e('0x8')]('/',auth[_0xe36e('0x9')](),controller[_0xe36e('0xa')]);router[_0xe36e('0x8')](_0xe36e('0xb'),auth['isAuthenticated'](),controller[_0xe36e('0xc')]);router['get'](_0xe36e('0xd'),auth[_0xe36e('0x9')](),controller[_0xe36e('0xe')]);router['get'](_0xe36e('0xf'),auth['isAuthenticated'](),controller[_0xe36e('0x10')]);router[_0xe36e('0x8')](_0xe36e('0x11'),auth[_0xe36e('0x9')](),controller[_0xe36e('0x12')]);router[_0xe36e('0x13')]('/',auth[_0xe36e('0x9')](),controller[_0xe36e('0x14')]);router['post'](_0xe36e('0xf'),auth[_0xe36e('0x9')](),controller[_0xe36e('0x15')]);router[_0xe36e('0x13')]('/:id/tags',auth[_0xe36e('0x9')](),interaction['tracked']('sms',_0xe36e('0x16')),controller[_0xe36e('0x17')]);router[_0xe36e('0x18')](_0xe36e('0xd'),auth[_0xe36e('0x9')](),interaction[_0xe36e('0x19')](_0xe36e('0x1a'),_0xe36e('0x1b')),controller[_0xe36e('0x1c')]);router[_0xe36e('0x1d')]('/:id',auth[_0xe36e('0x9')](),interaction[_0xe36e('0x19')]('sms',_0xe36e('0x1e')),controller['destroy']);router[_0xe36e('0x1d')](_0xe36e('0x1f'),auth['isAuthenticated'](),controller[_0xe36e('0x20')]);module[_0xe36e('0x21')]=router; \ No newline at end of file +var _0xda2d=['show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','smsinteraction:addtags','put','/:id','sms','delete','smsinteraction:destroy','destroy','removeTags','exports','util','path','connect-timeout','express','Router','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x38646c,_0x14d480){var _0x211df9=function(_0xd896a8){while(--_0xd896a8){_0x38646c['push'](_0x38646c['shift']());}};_0x211df9(++_0x14d480);}(_0xda2d,0x102));var _0xdda2=function(_0x4c9c9e,_0x25f045){_0x4c9c9e=_0x4c9c9e-0x0;var _0x1ffcb0=_0xda2d[_0x4c9c9e];return _0x1ffcb0;};'use strict';var multer=require('multer');var util=require(_0xdda2('0x0'));var path=require(_0xdda2('0x1'));var timeout=require(_0xdda2('0x2'));var express=require(_0xdda2('0x3'));var router=express[_0xdda2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdda2('0x5'));var controller=require(_0xdda2('0x6'));router[_0xdda2('0x7')]('/',auth[_0xdda2('0x8')](),controller[_0xdda2('0x9')]);router[_0xdda2('0x7')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0xb')]);router[_0xdda2('0x7')]('/:id',auth[_0xdda2('0x8')](),controller[_0xdda2('0xc')]);router['get'](_0xdda2('0xd'),auth[_0xdda2('0x8')](),controller[_0xdda2('0xe')]);router[_0xdda2('0x7')](_0xdda2('0xf'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x10')]);router[_0xdda2('0x11')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xdda2('0xd'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x12')]);router[_0xdda2('0x11')](_0xdda2('0x13'),auth[_0xdda2('0x8')](),interaction[_0xdda2('0x14')]('sms',_0xdda2('0x15')),controller['addTags']);router[_0xdda2('0x16')](_0xdda2('0x17'),auth[_0xdda2('0x8')](),interaction[_0xdda2('0x14')](_0xdda2('0x18'),'smsinteraction:update'),controller['update']);router[_0xdda2('0x19')]('/:id',auth[_0xdda2('0x8')](),interaction[_0xdda2('0x14')](_0xdda2('0x18'),_0xdda2('0x1a')),controller[_0xdda2('0x1b')]);router[_0xdda2('0x19')](_0xdda2('0x13'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x1c')]);module[_0xdda2('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 45acd23..ef26012 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 _0x3561=['out','sequelize','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x5056a4,_0x510d7f){var _0x46d1f5=function(_0x21839a){while(--_0x21839a){_0x5056a4['push'](_0x5056a4['shift']());}};_0x46d1f5(++_0x510d7f);}(_0x3561,0x94));var _0x1356=function(_0x411704,_0xb8dba){_0x411704=_0x411704-0x0;var _0x21c0eb=_0x3561[_0x411704];return _0x21c0eb;};'use strict';var Sequelize=require(_0x1356('0x0'));var moment=require('moment');module[_0x1356('0x1')]={'closed':{'type':Sequelize[_0x1356('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x1356('0x3')]},'disposition':{'type':Sequelize[_0x1356('0x4')]},'secondDisposition':{'type':Sequelize[_0x1356('0x4')]},'thirdDisposition':{'type':Sequelize[_0x1356('0x4')]},'note':{'type':Sequelize[_0x1356('0x4')]},'phone':{'type':Sequelize[_0x1356('0x4')]},'read1stAt':{'type':Sequelize[_0x1356('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x1356('0x5')]('in',_0x1356('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x1356('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x1356('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x1356('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x0309=['STRING','ENUM','BOOLEAN','sequelize','exports','DATE'];(function(_0x5037ab,_0x43209e){var _0x512adb=function(_0x261783){while(--_0x261783){_0x5037ab['push'](_0x5037ab['shift']());}};_0x512adb(++_0x43209e);}(_0x0309,0x165));var _0x9030=function(_0x51cac1,_0x1a1446){_0x51cac1=_0x51cac1-0x0;var _0x215276=_0x0309[_0x51cac1];return _0x215276;};'use strict';var Sequelize=require(_0x9030('0x0'));var moment=require('moment');module[_0x9030('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9030('0x2')]},'disposition':{'type':Sequelize[_0x9030('0x3')]},'secondDisposition':{'type':Sequelize[_0x9030('0x3')]},'thirdDisposition':{'type':Sequelize[_0x9030('0x3')]},'note':{'type':Sequelize[_0x9030('0x3')]},'phone':{'type':Sequelize[_0x9030('0x3')]},'read1stAt':{'type':Sequelize[_0x9030('0x2')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x9030('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x9030('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x9030('0x5')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index ae5f6e5..be6b17a 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 _0xde75=['views','downloadInteraction.ejs','transcript-','createPdfFromHTML','log','eml-format','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./smsInteraction.socket','register','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','end','error','stack','name','send','Users','map','fullname','TagIds','forEach','push','catch','index','SmsInteraction','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','filters','pick','select','field','from','tools_tags','u.id','u.fullname','ui.SmsInteractionId','left_join','u.id\x20=\x20ui.UserId','sms_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','conditions','length','find','unreadMessages','value','having','`\x20>\x200','operator','$substring','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','buildExpression','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','text','some','compact','isEmpty','where','i.SmsAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','read','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','Sequelize','QueryTypes','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','agent','i.SmsAccountId\x20IS\x20NULL','SmsAccountId','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','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','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','rows','show','params','include','options','create','describe','addMessage','SmsMessage','ids','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','omit','spread','findAll','color','emit','smsInteractionTags:save','removeTags','download','unix','join','server','tmp','root','files','transcript-%d-%s.zip','CmContact','Contact','lastName','secret','SmsAccount','Account','Owner','mkdirSync','Sms','N.A.','closedAt','Messages','direction','System','firstName','out','renderFile'];(function(_0x8267aa,_0x496ef0){var _0x2a437f=function(_0x447f72){while(--_0x447f72){_0x8267aa['push'](_0x8267aa['shift']());}};_0x2a437f(++_0x496ef0);}(_0xde75,0x1d3));var _0x5de7=function(_0x16b0dd,_0x307f93){_0x16b0dd=_0x16b0dd-0x0;var _0x16b1b6=_0xde75[_0x16b0dd];return _0x16b1b6;};'use strict';var emlformat=require(_0x5de7('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5de7('0x1'));var BPromise=require(_0x5de7('0x2'));var Mustache=require(_0x5de7('0x3'));var util=require('util');var path=require(_0x5de7('0x4'));var sox=require(_0x5de7('0x5'));var csv=require(_0x5de7('0x6'));var ejs=require(_0x5de7('0x7'));var fs=require('fs');var fs_extra=require(_0x5de7('0x8'));var _=require(_0x5de7('0x9'));var squel=require(_0x5de7('0xa'));var crypto=require(_0x5de7('0xb'));var jsforce=require(_0x5de7('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x5de7('0x6'));var querystring=require(_0x5de7('0xd'));var Papa=require(_0x5de7('0xe'));var Redis=require(_0x5de7('0xf'));var authService=require(_0x5de7('0x10'));var qs=require(_0x5de7('0x11'));var as=require(_0x5de7('0x12'));var pdf=require('../../components/export/pdf');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5de7('0x13'))(_0x5de7('0x14'));var utils=require('../../config/utils');var config=require(_0x5de7('0x15'));var licenseUtil=require(_0x5de7('0x16'));var db=require(_0x5de7('0x17'))['db'];config[_0x5de7('0x18')]=_[_0x5de7('0x19')](config[_0x5de7('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5de7('0x18')]));require(_0x5de7('0x1a'))[_0x5de7('0x1b')](socket);function respondWithStatusCode(_0x425c37,_0x33c4ad){_0x33c4ad=_0x33c4ad||0xcc;return function(_0x27ffe7){if(_0x27ffe7){return _0x425c37[_0x5de7('0x1c')](_0x33c4ad);}return _0x425c37[_0x5de7('0x1d')](_0x33c4ad)['end']();};}function respondWithResult(_0x4a6e85,_0x3629f){_0x3629f=_0x3629f||0xc8;return function(_0x592c37){if(_0x592c37){return _0x4a6e85[_0x5de7('0x1d')](_0x3629f)[_0x5de7('0x1e')](_0x592c37);}};}function respondWithFilteredResult(_0x5e6070,_0x15d2ed){return function(_0x4e78a3){if(_0x4e78a3){var _0x2f9326=typeof _0x15d2ed['offset']===_0x5de7('0x1f')&&typeof _0x15d2ed[_0x5de7('0x20')]==='undefined';var _0x4aec58=_0x4e78a3[_0x5de7('0x21')];var _0x4ca40e=_0x2f9326?0x0:_0x15d2ed[_0x5de7('0x22')];var _0x1943e1=_0x2f9326?_0x4e78a3[_0x5de7('0x21')]:_0x15d2ed[_0x5de7('0x22')]+_0x15d2ed['limit'];var _0x28b3ba;if(_0x1943e1>=_0x4aec58){_0x1943e1=_0x4aec58;_0x28b3ba=0xc8;}else{_0x28b3ba=0xce;}_0x5e6070[_0x5de7('0x1d')](_0x28b3ba);return _0x5e6070[_0x5de7('0x23')](_0x5de7('0x24'),_0x4ca40e+'-'+_0x1943e1+'/'+_0x4aec58)['json'](_0x4e78a3);}return null;};}function patchUpdates(_0xbf6043){return function(_0x1a221c){try{jsonpatch[_0x5de7('0x25')](_0x1a221c,_0xbf6043,!![]);}catch(_0x33b886){return BPromise['reject'](_0x33b886);}return _0x1a221c[_0x5de7('0x26')]();};}function saveUpdates(_0xc70836,_0x3f99c9){return function(_0x308c8b){if(_0x308c8b){return _0x308c8b[_0x5de7('0x27')](_0xc70836)[_0x5de7('0x28')](function(_0x41d7fd){return _0x41d7fd;});}return null;};}function removeEntity(_0x2251b0,_0x465e38){return function(_0x11439b){if(_0x11439b){return _0x11439b[_0x5de7('0x29')]()[_0x5de7('0x28')](function(){_0x2251b0[_0x5de7('0x1d')](0xcc)[_0x5de7('0x2a')]();});}};}function handleEntityNotFound(_0x34d6c6,_0x57f2a6){return function(_0x58ea24){if(!_0x58ea24){_0x34d6c6[_0x5de7('0x1c')](0x194);}return _0x58ea24;};}function handleError(_0x3ef9e2,_0x83cac1){_0x83cac1=_0x83cac1||0x1f4;return function(_0x12f617){logger[_0x5de7('0x2b')](_0x12f617[_0x5de7('0x2c')]);if(_0x12f617[_0x5de7('0x2d')]){delete _0x12f617[_0x5de7('0x2d')];}_0x3ef9e2['status'](_0x83cac1)[_0x5de7('0x2e')](_0x12f617);};}function getInteractionUsers(_0x46484c,_0x4e7be8){return new BPromise(function(_0x423996,_0x5ee0b0){try{if(_0x4e7be8[_0x46484c['id']]){_0x46484c[_0x5de7('0x2f')]=_[_0x5de7('0x30')](_0x4e7be8[_0x46484c['id']],function(_0x481e68){return{'id':_0x481e68['id'],'fullname':_0x481e68[_0x5de7('0x31')]};});}}catch(_0x3df58b){_0x5ee0b0(_0x3df58b);}_0x423996(_0x46484c);});}function getInteractionTags(_0xe108de,_0x310c8a){return new BPromise(function(_0x309e3f,_0x480955){try{if(_0xe108de[_0x5de7('0x32')]){_0xe108de['Tags']=[];_0xe108de['TagIds']['split'](',')[_0x5de7('0x33')](function(_0x2e97a7){_0xe108de['Tags'][_0x5de7('0x34')](_0x310c8a[_0x2e97a7]);});}delete _0xe108de[_0x5de7('0x32')];}catch(_0x3e84c5){_0x480955(_0x3e84c5);}_0x309e3f(_0xe108de);});}function updateSmsInteraction(_0x36754f,_0x2c4897,_0x1f1f92){return new BPromise(function(_0x514c8f,_0xe754cf){return getInteractionUsers(_0x36754f,_0x1f1f92)['then'](function(_0x3482ec){return getInteractionTags(_0x3482ec,_0x2c4897);})[_0x5de7('0x28')](function(_0x3420fc){_0x514c8f(_0x3420fc);})[_0x5de7('0x35')](function(_0x5c2112){_0xe754cf(_0x5c2112);});});}exports[_0x5de7('0x36')]=function(_0x40cc9c,_0x4f055a){var _0x4b8b2a={},_0x6c633={},_0x3693bd={'count':0x0,'rows':[]};var _0x2cacf2=_[_0x5de7('0x30')](db[_0x5de7('0x37')][_0x5de7('0x38')],function(_0x1768af){return{'name':_0x1768af[_0x5de7('0x39')],'type':_0x1768af[_0x5de7('0x3a')][_0x5de7('0x3b')]};});_0x6c633[_0x5de7('0x3c')]=_['map'](_0x2cacf2,_0x5de7('0x2d'));_0x6c633[_0x5de7('0x3d')]=_[_0x5de7('0x3e')](_0x40cc9c[_0x5de7('0x3d')]);_0x6c633['filters']=_[_0x5de7('0x3f')](_0x6c633['model'],_0x6c633[_0x5de7('0x3d')]);_0x4b8b2a[_0x5de7('0x40')]=_[_0x5de7('0x3f')](_0x6c633[_0x5de7('0x3c')],qs[_0x5de7('0x41')](_0x40cc9c['query'][_0x5de7('0x41')]));_0x4b8b2a[_0x5de7('0x40')]=_0x4b8b2a[_0x5de7('0x40')]['length']?_0x4b8b2a[_0x5de7('0x40')]:_0x6c633[_0x5de7('0x3c')];if(!_0x40cc9c[_0x5de7('0x3d')][_0x5de7('0x42')]('nolimit')){_0x4b8b2a[_0x5de7('0x20')]=qs[_0x5de7('0x20')](_0x40cc9c[_0x5de7('0x3d')][_0x5de7('0x20')]);_0x4b8b2a[_0x5de7('0x22')]=qs[_0x5de7('0x22')](_0x40cc9c[_0x5de7('0x3d')][_0x5de7('0x22')]);}_0x4b8b2a[_0x5de7('0x43')]=qs[_0x5de7('0x44')](_0x40cc9c[_0x5de7('0x3d')][_0x5de7('0x44')]);_0x4b8b2a['where']=qs[_0x5de7('0x45')](_[_0x5de7('0x46')](_0x40cc9c[_0x5de7('0x3d')],_0x6c633[_0x5de7('0x45')]),_0x2cacf2);var _0x107d02=[];var _0x4faa93=squel[_0x5de7('0x47')]()[_0x5de7('0x48')]('id')['field'](_0x5de7('0x2d'))[_0x5de7('0x48')]('color')[_0x5de7('0x49')](_0x5de7('0x4a'));var _0x433d4f=squel['select']()[_0x5de7('0x48')](_0x5de7('0x4b'))[_0x5de7('0x48')](_0x5de7('0x4c'))['field'](_0x5de7('0x4d'))[_0x5de7('0x49')]('user_has_sms_interactions','ui')[_0x5de7('0x4e')]('users','u',_0x5de7('0x4f'));var _0x5b1cbf=squel[_0x5de7('0x47')]()[_0x5de7('0x49')](_0x5de7('0x50'),'i')[_0x5de7('0x4e')](_0x5de7('0x51'),'c',_0x5de7('0x52'))[_0x5de7('0x4e')]('users','o','o.id\x20=\x20i.UserId')['left_join'](_0x5de7('0x53'),'a',_0x5de7('0x54'))[_0x5de7('0x4e')](_0x5de7('0x55'),'me',_0x5de7('0x56'))[_0x5de7('0x4e')](_0x5de7('0x57'),'it',_0x5de7('0x58'))[_0x5de7('0x4e')]('tools_tags','t','t.id\x20=\x20it.TagId');var _0x10da7e=squel[_0x5de7('0x59')]();var _0x1174a4=[];var _0x528272=squel[_0x5de7('0x59')]();var _0x4d1adf;if(_0x40cc9c[_0x5de7('0x3d')][_0x5de7('0x5a')]){_0x4d1adf=as[_0x5de7('0x5b')](_0x40cc9c[_0x5de7('0x3d')]['search']);var _0x2a7a54=_0x4d1adf[_0x5de7('0x5c')];for(var _0x3fb85a=0x0;_0x3fb85a<_0x4d1adf[_0x5de7('0x5d')][_0x5de7('0x5e')];_0x3fb85a++){var _0x3271d7=_0x4d1adf[_0x5de7('0x5d')][_0x3fb85a];var _0x83b6c2='i';var _0x388342=_[_0x5de7('0x5f')](_0x2cacf2,[_0x5de7('0x2d'),_0x3271d7[_0x5de7('0x48')]]);if(!_0x388342){switch(_0x3271d7['field']){case _0x5de7('0x60'):if(_0x3271d7[_0x5de7('0x61')]==0x1){_0x5b1cbf['having']('`'+_0x3271d7[_0x5de7('0x48')]+'`\x20=\x200');}else{_0x5b1cbf[_0x5de7('0x62')]('`'+_0x3271d7[_0x5de7('0x48')]+_0x5de7('0x63'));}break;case'Contact':if(_0x3271d7[_0x5de7('0x64')]===_0x5de7('0x65')){if(_0x3271d7[_0x5de7('0x61')]['split']('\x20')[_0x5de7('0x5e')]>0x1){_0x10da7e[_0x2a7a54](_0x5de7('0x66'),qs[_0x5de7('0x67')](_0x3271d7[_0x5de7('0x61')]),null);}else{var _0xf22a7b='%'+_0x3271d7[_0x5de7('0x61')]+'%';_0x10da7e[_0x2a7a54](_0x5de7('0x68'),_0xf22a7b,_0xf22a7b,_0xf22a7b);}}else{_0x388342=_[_0x5de7('0x5f')](_0x2cacf2,[_0x5de7('0x2d'),_0x5de7('0x69')]);_0x3271d7['field']=_0x5de7('0x69');_0x4a2365=as[_0x5de7('0x6a')](_0x83b6c2,_0x388342[_0x5de7('0x3a')],_0x3271d7);_0x10da7e[_0x2a7a54](_0x4a2365['text'],_0x4a2365['value'][_0x5de7('0x6b')],_0x4a2365[_0x5de7('0x61')][_0x5de7('0x2a')]);}break;case'Tag':var _0x246a73=_0x3271d7[_0x5de7('0x61')]['split'](',')[_0x5de7('0x30')](function(_0x79cd){return Number(_0x79cd);});_0x246a73[_0x5de7('0x33')](function(_0x596e39){_0x528272['or'](_0x5de7('0x6c'),'%,'+_0x596e39+',%');});_0x1174a4=_[_0x5de7('0x6d')](_0x1174a4,_0x246a73);break;case _0x5de7('0x6e'):if(_0x3271d7['operator']===_0x5de7('0x65')){_0x10da7e[_0x2a7a54](_0x5de7('0x6f'),'%'+_0x3271d7[_0x5de7('0x61')]+'%',null);}else{_0x388342=_[_0x5de7('0x5f')](_0x2cacf2,[_0x5de7('0x2d'),_0x5de7('0x70')]);_0x3271d7['field']=_0x5de7('0x70');_0x4a2365=as[_0x5de7('0x6a')](_0x83b6c2,_0x388342['type'],_0x3271d7);_0x10da7e[_0x2a7a54](_0x4a2365['text'],_0x4a2365[_0x5de7('0x61')][_0x5de7('0x6b')],_0x4a2365['value'][_0x5de7('0x2a')]);}break;case _0x5de7('0x71'):_0x4a2365=as[_0x5de7('0x6a')]('me',null,_0x3271d7);_0x10da7e[_0x2a7a54](_0x4a2365[_0x5de7('0x72')],_0x4a2365[_0x5de7('0x61')][_0x5de7('0x6b')],_0x4a2365['value'][_0x5de7('0x2a')]);break;}}else{var _0x4a2365=as[_0x5de7('0x6a')](_0x83b6c2,_0x388342[_0x5de7('0x3a')],_0x3271d7);_0x10da7e[_0x2a7a54](_0x4a2365[_0x5de7('0x72')],_0x4a2365[_0x5de7('0x61')][_0x5de7('0x6b')],_0x4a2365['value']['end']);}}}else{var _0x147696=_(_0x40cc9c[_0x5de7('0x3d')])[_0x5de7('0x3e')]()[_0x5de7('0x30')](function(_0x59a626){return _[_0x5de7('0x73')](_0x2cacf2,[_0x5de7('0x2d'),_0x59a626])?_0x59a626:undefined;})[_0x5de7('0x74')]()['value']();if(!_[_0x5de7('0x75')](_0x147696)){_0x147696[_0x5de7('0x33')](function(_0xc9f01a){if(_0xc9f01a==='SmsAccountId'){_0x5b1cbf[_0x5de7('0x76')](_0x5de7('0x77'),[][_0x5de7('0x78')](_0x40cc9c['query'][_0xc9f01a]));}else if(_0xc9f01a===_0x5de7('0x79')){var _0x628852=JSON[_0x5de7('0x7a')](_0x40cc9c[_0x5de7('0x3d')][_0xc9f01a])['$gte'];var _0x2cbd2f=JSON['parse'](_0x40cc9c[_0x5de7('0x3d')][_0xc9f01a])[_0x5de7('0x7b')];_0x5b1cbf[_0x5de7('0x76')](_0x5de7('0x7c'),_0x628852,_0x2cbd2f);}else{if(_0x40cc9c[_0x5de7('0x3d')][_0xc9f01a]==='null'){_0x5b1cbf['where']('i.'+_0xc9f01a+'\x20IS\x20NULL');}else{_0x5b1cbf[_0x5de7('0x76')]('i.'+_0xc9f01a+'\x20=\x20?',_0x40cc9c['query'][_0xc9f01a]);}}});}if(_0x40cc9c['query'][_0x5de7('0x7d')]){if(_0x40cc9c[_0x5de7('0x3d')][_0x5de7('0x7d')]==0x1){_0x5b1cbf[_0x5de7('0x62')]('`unreadMessages`\x20=\x200');}else{_0x5b1cbf['having'](_0x5de7('0x7e'));}}if(_0x40cc9c[_0x5de7('0x3d')]['tag']){_0x1174a4=_[_0x5de7('0x7f')](_0x40cc9c[_0x5de7('0x3d')][_0x5de7('0x80')])?_0x40cc9c[_0x5de7('0x3d')][_0x5de7('0x80')]:new Array(_0x40cc9c[_0x5de7('0x3d')]['tag']);_0x1174a4['forEach'](function(_0x164f33){_0x528272['or'](_0x5de7('0x6c'),'%,'+_0x164f33+',%');});}if(_0x40cc9c[_0x5de7('0x3d')][_0x5de7('0x81')]){var _0x2eada1=_0x40cc9c[_0x5de7('0x3d')][_0x5de7('0x81')][_0x5de7('0x82')]('\x5c','\x5c\x5c')[_0x5de7('0x82')](/'/g,'\x27\x27');if(qs[_0x5de7('0x83')](_0x2eada1)){_0x10da7e['or'](_0x5de7('0x84'),_0x2eada1+'%')['or'](_0x5de7('0x85'),_0x2eada1+'%');}else{_0x10da7e['or'](_0x5de7('0x86'),qs['getFullTextValue'](_0x2eada1))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x2eada1+'%');}}}_0x5b1cbf[_0x5de7('0x76')](_0x10da7e);_0x5b1cbf[_0x5de7('0x87')]('i.id');var _0x420e3a={'type':db[_0x5de7('0x88')][_0x5de7('0x89')][_0x5de7('0x8a')],'raw':!![]};var _0x272535=_0x5b1cbf[_0x5de7('0x8b')]();_0x272535[_0x5de7('0x48')](_0x5de7('0x8c'));_0x272535['field'](_0x5de7('0x8d'),'unreadMessages');if(_0x4b8b2a[_0x5de7('0x43')]){_0x4b8b2a[_0x5de7('0x43')][_0x5de7('0x33')](function(_0x2c2b3a){var _0x5bb81c=_0x2c2b3a[0x0]===_0x5de7('0x8e')?_0x2c2b3a[0x0]:'i.'+_0x2c2b3a[0x0];_0x5b1cbf[_0x5de7('0x43')](_0x5bb81c,_0x2c2b3a[0x1]===_0x5de7('0x8f')?![]:!![]);});}if(!_[_0x5de7('0x75')](_0x1174a4)){_0x5b1cbf['having'](_0x528272);_0x272535[_0x5de7('0x76')]('t.id\x20IN\x20?',_0x1174a4);}BPromise[_0x5de7('0x90')]()[_0x5de7('0x28')](function(){if(!_0x4d1adf){if(_0x40cc9c[_0x5de7('0x3d')]['SmsAccountId'])return;_0x272535[_0x5de7('0x76')](_0x5de7('0x91'));_0x5b1cbf[_0x5de7('0x76')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x40cc9c[_0x5de7('0x92')]['role']!==_0x5de7('0x93'))return;return _0x40cc9c[_0x5de7('0x92')]['getSmsAccounts']({'attributes':['id'],'raw':!![]})['then'](function(_0x41a3e7){if(_[_0x5de7('0x75')](_0x41a3e7)){_0x272535['where'](_0x5de7('0x94'));_0x5b1cbf[_0x5de7('0x76')](_0x5de7('0x94'));}else{_0x272535['where'](_0x5de7('0x77'),_[_0x5de7('0x30')](_0x41a3e7,'id'));_0x5b1cbf[_0x5de7('0x76')](_0x5de7('0x77'),_['map'](_0x41a3e7,'id'));}});})[_0x5de7('0x28')](function(){if(_0x40cc9c[_0x5de7('0x92')]['role']===_0x5de7('0x93')&&!_0x4d1adf&&!_0x40cc9c[_0x5de7('0x3d')][_0x5de7('0x95')])return[];return db[_0x5de7('0x96')][_0x5de7('0x3d')](_0x272535['toString'](),_0x420e3a);})[_0x5de7('0x28')](function(_0x10cf36){_0x3693bd[_0x5de7('0x21')]=_0x10cf36[_0x5de7('0x5e')];if(_0x3693bd[_0x5de7('0x21')]===0x0)return[];return db['sequelize'][_0x5de7('0x3d')](_0x4faa93[_0x5de7('0x97')](),_0x420e3a)[_0x5de7('0x28')](function(_0x3d44cc){_0x107d02=_[_0x5de7('0x98')](_0x3d44cc,'id');_0x420e3a=_[_0x5de7('0x99')](_0x420e3a,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x40cc9c[_0x5de7('0x3d')]['fields']){_0x4b8b2a[_0x5de7('0x40')][_0x5de7('0x33')](function(_0x1df87d){_0x5b1cbf[_0x5de7('0x48')]('i.'+_0x1df87d);});}else{_0x5b1cbf[_0x5de7('0x48')](_0x5de7('0x8d'),_0x5de7('0x60'));_0x5b1cbf[_0x5de7('0x48')](_0x5de7('0x9a'),_0x5de7('0x9b'));_0x5b1cbf['field'](_0x5de7('0x9c'),'Account.mandatoryDisposition');_0x5b1cbf[_0x5de7('0x48')](_0x5de7('0x9d'),_0x5de7('0x8e'));_0x5b1cbf[_0x5de7('0x48')](_0x5de7('0x9e'));_0x5b1cbf['field'](_0x5de7('0x9f'),_0x5de7('0xa0'));_0x5b1cbf['field'](_0x5de7('0xa1'),_0x5de7('0xa2'));_0x5b1cbf[_0x5de7('0x48')](_0x5de7('0xa3'),_0x5de7('0xa4'));_0x5b1cbf[_0x5de7('0x48')](_0x5de7('0xa5'),_0x5de7('0xa6'));_0x5b1cbf[_0x5de7('0x48')](_0x5de7('0xa7'),_0x5de7('0xa8'));_0x5b1cbf['field'](_0x5de7('0xa9'),_0x5de7('0xaa'));_0x5b1cbf[_0x5de7('0x48')](_0x5de7('0xab'),_0x5de7('0xac'));_0x5b1cbf[_0x5de7('0x48')](_0x5de7('0xad'),'Owner.internal');_0x5b1cbf[_0x5de7('0x48')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x5de7('0x32'));}if(_0x4b8b2a[_0x5de7('0x20')])_0x5b1cbf['limit'](_0x4b8b2a['limit']);if(_0x4b8b2a[_0x5de7('0x22')])_0x5b1cbf['offset'](_0x4b8b2a['offset']);return db[_0x5de7('0x96')][_0x5de7('0x3d')](_0x5b1cbf[_0x5de7('0x97')](),_0x420e3a);})['then'](function(_0x3a5234){if(_0x3a5234['length']>0x0)_0x433d4f['where'](_0x5de7('0xae'),_['map'](_0x3a5234,'id'));return db[_0x5de7('0x96')][_0x5de7('0x3d')](_0x433d4f['toString'](),_0x420e3a)['then'](function(_0x2d03ac){var _0x234166=_[_0x5de7('0xaf')](_0x2d03ac,_0x5de7('0xb0'));var _0x19a3d5=[];_0x3a5234[_0x5de7('0x33')](function(_0x519cd2){_0x19a3d5[_0x5de7('0x34')](updateSmsInteraction(_0x519cd2,_0x107d02,_0x234166));});return BPromise['all'](_0x19a3d5);});});})['then'](function(_0x41d75c){_0x3693bd[_0x5de7('0xb1')]=_0x41d75c;return _0x3693bd;})[_0x5de7('0x28')](respondWithFilteredResult(_0x4f055a,_0x4b8b2a))[_0x5de7('0x35')](handleError(_0x4f055a,null));};exports[_0x5de7('0xb2')]=function(_0x11c87c,_0x401c67){var _0x5b0e74={'raw':![],'where':{'id':_0x11c87c[_0x5de7('0xb3')]['id']}},_0x36a008={};_0x36a008['model']=_['keys'](db['SmsInteraction'][_0x5de7('0x38')]);_0x36a008['query']=_['keys'](_0x11c87c[_0x5de7('0x3d')]);_0x36a008['filters']=_[_0x5de7('0x3f')](_0x36a008[_0x5de7('0x3c')],_0x36a008[_0x5de7('0x3d')]);_0x5b0e74[_0x5de7('0x40')]=_[_0x5de7('0x3f')](_0x36a008[_0x5de7('0x3c')],qs[_0x5de7('0x41')](_0x11c87c[_0x5de7('0x3d')][_0x5de7('0x41')]));_0x5b0e74[_0x5de7('0x40')]=_0x5b0e74[_0x5de7('0x40')][_0x5de7('0x5e')]?_0x5b0e74[_0x5de7('0x40')]:_0x36a008[_0x5de7('0x3c')];if(_0x11c87c[_0x5de7('0x3d')]['includeAll']){_0x5b0e74[_0x5de7('0xb4')]=[{'all':!![]}];}_0x5b0e74=_[_0x5de7('0x99')]({},_0x5b0e74,_0x11c87c[_0x5de7('0xb5')]);return db['SmsInteraction'][_0x5de7('0x5f')](_0x5b0e74)[_0x5de7('0x28')](handleEntityNotFound(_0x401c67,null))[_0x5de7('0x28')](respondWithResult(_0x401c67,null))['catch'](handleError(_0x401c67,null));};exports[_0x5de7('0xb6')]=function(_0x174379,_0x38db03){return db[_0x5de7('0x37')][_0x5de7('0xb6')](_0x174379['body'],{})[_0x5de7('0x28')](respondWithResult(_0x38db03,0xc9))[_0x5de7('0x35')](handleError(_0x38db03,null));};exports[_0x5de7('0x27')]=function(_0x2ed3f4,_0x48e6c3){if(_0x2ed3f4[_0x5de7('0x71')]['id']){delete _0x2ed3f4[_0x5de7('0x71')]['id'];}return db[_0x5de7('0x37')][_0x5de7('0x5f')]({'where':{'id':_0x2ed3f4[_0x5de7('0xb3')]['id']}})[_0x5de7('0x28')](handleEntityNotFound(_0x48e6c3,null))['then'](saveUpdates(_0x2ed3f4[_0x5de7('0x71')],null))[_0x5de7('0x28')](respondWithResult(_0x48e6c3,null))['catch'](handleError(_0x48e6c3,null));};exports['destroy']=function(_0xf822e4,_0x10fedb){return db[_0x5de7('0x37')]['find']({'where':{'id':_0xf822e4['params']['id']}})['then'](handleEntityNotFound(_0x10fedb,null))[_0x5de7('0x28')](removeEntity(_0x10fedb,null))[_0x5de7('0x35')](handleError(_0x10fedb,null));};exports[_0x5de7('0xb7')]=function(_0x2c0208,_0x3f3946){return db[_0x5de7('0x37')][_0x5de7('0xb7')]()[_0x5de7('0x28')](respondWithResult(_0x3f3946,null))[_0x5de7('0x35')](handleError(_0x3f3946,null));};exports[_0x5de7('0xb8')]=function(_0x16536a,_0x57ee58,_0x287a8b){return db[_0x5de7('0xb9')]['find']({'where':{'id':_0x16536a[_0x5de7('0xb3')]['id']}})[_0x5de7('0x28')](handleEntityNotFound(_0x57ee58,null))[_0x5de7('0x28')](function(_0x152f16){if(_0x152f16){return _0x152f16[_0x5de7('0xb8')](_0x16536a['body'][_0x5de7('0xba')],_['omit'](_0x16536a[_0x5de7('0x71')],[_0x5de7('0xba'),'id'])||{});}})[_0x5de7('0x28')](respondWithResult(_0x57ee58,null))[_0x5de7('0x35')](handleError(_0x57ee58,null));};exports[_0x5de7('0xbb')]=function(_0x1f45ef,_0x90522,_0x47a127){var _0x17a047={'raw':![],'where':{}};var _0x2d0cd0={};var _0x5b1d93={'count':0x0,'rows':[]};return db['SmsInteraction']['findOne']({'where':{'id':_0x1f45ef[_0x5de7('0xb3')]['id']}})['then'](handleEntityNotFound(_0x90522,null))[_0x5de7('0x28')](function(_0x2291e4){if(_0x2291e4){_0x2d0cd0[_0x5de7('0x3c')]=_[_0x5de7('0x3e')](db[_0x5de7('0xb9')]['rawAttributes']);_0x2d0cd0[_0x5de7('0x3d')]=_[_0x5de7('0x3e')](_0x1f45ef[_0x5de7('0x3d')]);_0x2d0cd0['filters']=_[_0x5de7('0x3f')](_0x2d0cd0[_0x5de7('0x3c')],_0x2d0cd0[_0x5de7('0x3d')]);_0x17a047[_0x5de7('0x40')]=_['intersection'](_0x2d0cd0['model'],qs['fields'](_0x1f45ef[_0x5de7('0x3d')][_0x5de7('0x41')]));_0x17a047[_0x5de7('0x40')]=_0x17a047[_0x5de7('0x40')][_0x5de7('0x5e')]?_0x17a047[_0x5de7('0x40')]:_0x2d0cd0[_0x5de7('0x3c')];if(!_0x1f45ef['query'][_0x5de7('0x42')]('nolimit')){_0x17a047[_0x5de7('0x20')]=qs[_0x5de7('0x20')](_0x1f45ef[_0x5de7('0x3d')][_0x5de7('0x20')]);_0x17a047[_0x5de7('0x22')]=qs[_0x5de7('0x22')](_0x1f45ef[_0x5de7('0x3d')][_0x5de7('0x22')]);}_0x17a047['order']=qs[_0x5de7('0x44')](_0x1f45ef[_0x5de7('0x3d')]['sort']);_0x17a047[_0x5de7('0x76')]=qs[_0x5de7('0x45')](_[_0x5de7('0x46')](_0x1f45ef['query'],_0x2d0cd0[_0x5de7('0x45')]));_0x17a047['where']['SmsInteractionId']=_0x2291e4['id'];if(_0x1f45ef[_0x5de7('0x3d')]['filter']){_0x17a047[_0x5de7('0x76')]=_[_0x5de7('0x99')](_0x17a047[_0x5de7('0x76')],{'$or':_[_0x5de7('0x30')](_0x17a047['attributes'],function(_0x52cfd4){var _0x598209={};_0x598209[_0x52cfd4]={'$like':'%'+_0x1f45ef[_0x5de7('0x3d')][_0x5de7('0x81')]+'%'};return _0x598209;})});}if(_0x1f45ef[_0x5de7('0x3d')][_0x5de7('0xbc')]){var _0x22af5b=_0x1f45ef[_0x5de7('0x3d')][_0x5de7('0xbc')][_0x5de7('0xbd')](',');var _0x78e654={};_0x78e654[_0x22af5b[0x0]]={'$gte':moment(_0x22af5b[0x1])[_0x5de7('0xbe')](_0x5de7('0xbf'))};_0x17a047['where']=_[_0x5de7('0x99')](_0x17a047['where'],_0x78e654);}_0x17a047=_[_0x5de7('0x99')]({},_0x17a047,_0x1f45ef[_0x5de7('0xb5')]);return db[_0x5de7('0xb9')][_0x5de7('0x21')]({'where':_0x17a047[_0x5de7('0x76')]})[_0x5de7('0x28')](function(_0x1a29de){_0x5b1d93[_0x5de7('0x21')]=_0x1a29de;if(_0x1f45ef[_0x5de7('0x3d')]['includeAll']){_0x17a047[_0x5de7('0xb4')]=[{'all':!![]}];}return db[_0x5de7('0xb9')]['findAll'](_0x17a047);})[_0x5de7('0x28')](function(_0x118d84){_0x5b1d93['rows']=_0x118d84;return _0x5b1d93;});}})['then'](respondWithFilteredResult(_0x90522,_0x17a047))[_0x5de7('0x35')](handleError(_0x90522,null));};exports[_0x5de7('0xc0')]=function(_0xc1e3e3,_0x1a35b6,_0x3d73a6){return db['SmsInteraction']['find']({'where':{'id':_0xc1e3e3[_0x5de7('0xb3')]['id']}})['then'](handleEntityNotFound(_0x1a35b6,null))['then'](function(_0x33ab3e){if(_0x33ab3e){return _0x33ab3e[_0x5de7('0xc1')](_0xc1e3e3['body'][_0x5de7('0xba')],_[_0x5de7('0xc2')](_0xc1e3e3[_0x5de7('0x71')],[_0x5de7('0xba'),'id'])||{})[_0x5de7('0xc3')](function(){return db['Tag'][_0x5de7('0xc4')]({'attributes':['id','name',_0x5de7('0xc5')],'where':{'id':_0xc1e3e3['body']['ids']}});})['then'](function(_0xa64d61){socket[_0x5de7('0xc6')](_0x5de7('0xc7'),{'id':Number(_0xc1e3e3['params']['id']),'tags':_0xa64d61||[]});return{'id':Number(_0xc1e3e3[_0x5de7('0xb3')]['id']),'tags':_0xa64d61||[]};});}})['then'](respondWithResult(_0x1a35b6,null))[_0x5de7('0x35')](handleError(_0x1a35b6,null));};exports[_0x5de7('0xc8')]=function(_0xb8de19,_0x28a795,_0x4a8701){return db[_0x5de7('0x37')][_0x5de7('0x5f')]({'where':{'id':_0xb8de19[_0x5de7('0xb3')]['id']}})[_0x5de7('0x28')](handleEntityNotFound(_0x28a795,null))['then'](function(_0xd79d66){if(_0xd79d66){return _0xd79d66[_0x5de7('0xc8')](_0xb8de19[_0x5de7('0x3d')][_0x5de7('0xba')]);}})[_0x5de7('0x28')](respondWithStatusCode(_0x28a795,null))[_0x5de7('0x35')](handleError(_0x28a795,null));};exports[_0x5de7('0xc9')]=function(_0x546c2a,_0x2d9e54){var _0x50e7fd=moment()[_0x5de7('0xca')]()[_0x5de7('0x97')]();var _0x32d334=path[_0x5de7('0xcb')](config['root'],_0x5de7('0xcc'),'files',_0x5de7('0xcd'));var _0x22140c=path[_0x5de7('0xcb')](config[_0x5de7('0xce')],'server',_0x5de7('0xcf'),'attachments');var _0x381803=path[_0x5de7('0xcb')](_0x32d334,_0x50e7fd);var _0xc14c0=util[_0x5de7('0xbe')](_0x5de7('0xd0'),_0x546c2a[_0x5de7('0xb3')]['id'],_0x50e7fd);var _0x2542e7=path['join'](_0x32d334,_0xc14c0);var _0x3fef0b=[];_0x3fef0b[_0x5de7('0x34')]({'model':db[_0x5de7('0x6e')],'as':_0x5de7('0x6e'),'attributes':['id',_0x5de7('0x31')],'raw':!![]});_0x3fef0b[_0x5de7('0x34')]({'model':db[_0x5de7('0xd1')],'as':_0x5de7('0xd2'),'attributes':['id','firstName',_0x5de7('0xd3')],'raw':!![]});var _0x53bd2d=[{'model':db[_0x5de7('0xb9')],'as':'Messages','attributes':['id',_0x5de7('0x71'),_0x5de7('0x79'),'direction',_0x5de7('0xd4'),'read'],'include':_0x3fef0b}];_0x53bd2d[_0x5de7('0x34')]({'model':db[_0x5de7('0xd5')],'as':_0x5de7('0xd6'),'attributes':['id',_0x5de7('0x2d')]});_0x53bd2d[_0x5de7('0x34')]({'model':db['User'],'as':_0x5de7('0xd7'),'attributes':['id',_0x5de7('0x31')]});return db[_0x5de7('0x37')]['find']({'where':{'id':_0x546c2a[_0x5de7('0xb3')]['id']},'include':_0x53bd2d})[_0x5de7('0x28')](handleEntityNotFound(_0x2d9e54,null))[_0x5de7('0x28')](function(_0x40802e){if(_0x40802e){var _0x349b6c=_0x40802e['get']({'plain':!![]});fs[_0x5de7('0xd8')](_0x381803);var _0x5840d4={'channel':_0x5de7('0xd9'),'account':_0x349b6c['Account']['name'],'agent':_0x349b6c['Owner']?_0x349b6c[_0x5de7('0xd7')][_0x5de7('0x31')]:_0x5de7('0xda'),'createdAt':moment(_0x349b6c[_0x5de7('0x79')])[_0x5de7('0xbe')]('YYYY-MM-DD\x20HH:mm:ss')[_0x5de7('0x97')](),'closedAt':_0x349b6c['closed']?moment(_0x349b6c[_0x5de7('0xdb')])[_0x5de7('0xbe')](_0x5de7('0xbf'))[_0x5de7('0x97')]():'','disposition':_0x349b6c['disposition'],'messages':_(_0x349b6c[_0x5de7('0xdc')])[_0x5de7('0x81')]({'secret':![]})[_0x5de7('0x30')](function(_0x5e17e4){return{'date':moment(_0x5e17e4['createdAt'])[_0x5de7('0xbe')]('YYYY-MM-DD\x20HH:mm:ss')[_0x5de7('0x97')](),'sender':_0x5e17e4[_0x5de7('0xdd')]==='out'?_0x5e17e4['User']?_0x5e17e4[_0x5de7('0x6e')][_0x5de7('0x31')]:_0x5de7('0xde'):_0x5e17e4[_0x5de7('0xd2')][_0x5de7('0xdf')]+(_0x5e17e4['Contact'][_0x5de7('0xd3')]?'\x20'+_0x5e17e4['Contact'][_0x5de7('0xd3')]:''),'body':_0x5e17e4[_0x5de7('0x71')],'direction':_0x5e17e4['direction']===_0x5de7('0xe0')?'A':'C','secret':_0x5e17e4['secret'],'read':_0x5e17e4['read']};})[_0x5de7('0x61')]()};return ejs[_0x5de7('0xe1')](path['join'](config[_0x5de7('0xce')],_0x5de7('0xcc'),_0x5de7('0xe2'),_0x5de7('0xe3')),{'interaction':_0x5840d4})[_0x5de7('0x28')](function(_0x51f10e){var _0x363e4b=path[_0x5de7('0xcb')](_0x381803,_0x5de7('0xe4')+_0x349b6c['id']+'-'+_0x50e7fd+'.pdf');var _0x30a61b={'path':_0x363e4b,'channel':_0x5de7('0xd9'),'interactionId':_0x349b6c['id']};return pdf[_0x5de7('0xe5')](_0x51f10e,_0x30a61b);})[_0x5de7('0x28')](function(){return new BPromise(function(_0x376385,_0x18d5e6){zipdir(_0x381803,{'saveTo':_0x2542e7},function(_0x53c405,_0x2d8437){if(_0x53c405)return _0x18d5e6(_0x53c405);return _0x376385(_0x2d8437);});})['then'](function(){return new BPromise(function(_0x268149,_0x34d465){rimraf(_0x381803,function(_0x586ec8){if(_0x586ec8)_0x34d465(_0x586ec8);return _0x268149();});});})[_0x5de7('0x28')](function(){return _0x2d9e54['download'](_0x2542e7,_0xc14c0,function(_0x3ebe0e){if(_0x3ebe0e){console[_0x5de7('0xe6')]('err',_0x3ebe0e);}else{fs['unlinkSync'](_0x2542e7);}});});});}else{return _0x2d9e54[_0x5de7('0x1c')](0xc8);}})['catch'](handleError(_0x2d9e54,null));}; \ No newline at end of file +var _0xf8fe=['downloadInteraction.ejs','transcript-','.pdf','Sms','createPdfFromHTML','download','log','err','unlinkSync','rimraf','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','../../config/license/util','defaults','redis','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','name','send','Users','TagIds','Tags','split','push','catch','index','map','SmsInteraction','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','select','field','color','tools_tags','u.id','u.fullname','from','user_has_sms_interactions','users','u.id\x20=\x20ui.UserId','sms_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','getFullTextValue','find','ContactId','buildExpression','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','UserId','body','text','some','compact','forEach','SmsAccountId','createdAt','parse','$gte','$lte','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','Sequelize','QueryTypes','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','isEmpty','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getSmsAccounts','i.SmsAccountId\x20IN\x20?','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','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','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','SmsInteractionId','all','rows','show','params','options','create','describe','addMessage','ids','omit','getMessages','findOne','SmsMessage','order','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','include','findAll','setTags','emit','unix','root','files','tmp','join','server','attachments','fullname','CmContact','firstName','lastName','direction','secret','SmsAccount','Account','Owner','mkdirSync','N.A.','closed','closedAt','disposition','Messages','out','System'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0xf8fe,0xea));var _0xef8f=function(_0x50422a,_0xc78e7a){_0x50422a=_0x50422a-0x0;var _0x48032c=_0xf8fe[_0x50422a];return _0x48032c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xef8f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xef8f('0x1'));var BPromise=require(_0xef8f('0x2'));var Mustache=require(_0xef8f('0x3'));var util=require('util');var path=require(_0xef8f('0x4'));var sox=require(_0xef8f('0x5'));var csv=require(_0xef8f('0x6'));var ejs=require(_0xef8f('0x7'));var fs=require('fs');var fs_extra=require(_0xef8f('0x8'));var _=require('lodash');var squel=require(_0xef8f('0x9'));var crypto=require('crypto');var jsforce=require(_0xef8f('0xa'));var deskjs=require(_0xef8f('0xb'));var toCsv=require(_0xef8f('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xef8f('0xc'));var authService=require(_0xef8f('0xd'));var qs=require(_0xef8f('0xe'));var as=require(_0xef8f('0xf'));var pdf=require(_0xef8f('0x10'));var hardwareService=require(_0xef8f('0x11'));var logger=require('../../config/logger')(_0xef8f('0x12'));var utils=require(_0xef8f('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xef8f('0x14'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xef8f('0x15')](config[_0xef8f('0x16')],{'host':_0xef8f('0x17'),'port':0x18eb});var socket=require(_0xef8f('0x18'))(new Redis(config[_0xef8f('0x16')]));require('./smsInteraction.socket')['register'](socket);function respondWithStatusCode(_0x6154b0,_0x2ecbdf){_0x2ecbdf=_0x2ecbdf||0xcc;return function(_0xfdf8fd){if(_0xfdf8fd){return _0x6154b0[_0xef8f('0x19')](_0x2ecbdf);}return _0x6154b0[_0xef8f('0x1a')](_0x2ecbdf)[_0xef8f('0x1b')]();};}function respondWithResult(_0x49b331,_0x161d22){_0x161d22=_0x161d22||0xc8;return function(_0x23c3c1){if(_0x23c3c1){return _0x49b331[_0xef8f('0x1a')](_0x161d22)[_0xef8f('0x1c')](_0x23c3c1);}};}function respondWithFilteredResult(_0x38409d,_0x4b43a3){return function(_0x592dab){if(_0x592dab){var _0x2862a9=typeof _0x4b43a3[_0xef8f('0x1d')]===_0xef8f('0x1e')&&typeof _0x4b43a3[_0xef8f('0x1f')]===_0xef8f('0x1e');var _0x47e026=_0x592dab[_0xef8f('0x20')];var _0x31d0b6=_0x2862a9?0x0:_0x4b43a3[_0xef8f('0x1d')];var _0x3d857d=_0x2862a9?_0x592dab['count']:_0x4b43a3[_0xef8f('0x1d')]+_0x4b43a3['limit'];var _0x5906be;if(_0x3d857d>=_0x47e026){_0x3d857d=_0x47e026;_0x5906be=0xc8;}else{_0x5906be=0xce;}_0x38409d[_0xef8f('0x1a')](_0x5906be);return _0x38409d[_0xef8f('0x21')]('Content-Range',_0x31d0b6+'-'+_0x3d857d+'/'+_0x47e026)[_0xef8f('0x1c')](_0x592dab);}return null;};}function patchUpdates(_0x44cb22){return function(_0x23a5c4){try{jsonpatch[_0xef8f('0x22')](_0x23a5c4,_0x44cb22,!![]);}catch(_0x1d4167){return BPromise[_0xef8f('0x23')](_0x1d4167);}return _0x23a5c4[_0xef8f('0x24')]();};}function saveUpdates(_0x2a6025,_0x27caf4){return function(_0x1a80fb){if(_0x1a80fb){return _0x1a80fb[_0xef8f('0x25')](_0x2a6025)[_0xef8f('0x26')](function(_0x3092f0){return _0x3092f0;});}return null;};}function removeEntity(_0x128356,_0xc6a95c){return function(_0x46564b){if(_0x46564b){return _0x46564b[_0xef8f('0x27')]()[_0xef8f('0x26')](function(){_0x128356[_0xef8f('0x1a')](0xcc)[_0xef8f('0x1b')]();});}};}function handleEntityNotFound(_0x5d105d,_0x2aa51b){return function(_0x5175c5){if(!_0x5175c5){_0x5d105d[_0xef8f('0x19')](0x194);}return _0x5175c5;};}function handleError(_0xaeefbe,_0x134551){_0x134551=_0x134551||0x1f4;return function(_0x3dc4fd){logger['error'](_0x3dc4fd['stack']);if(_0x3dc4fd[_0xef8f('0x28')]){delete _0x3dc4fd['name'];}_0xaeefbe[_0xef8f('0x1a')](_0x134551)[_0xef8f('0x29')](_0x3dc4fd);};}function getInteractionUsers(_0x161fd4,_0x4ede77){return new BPromise(function(_0x538cc3,_0x451b20){try{if(_0x4ede77[_0x161fd4['id']]){_0x161fd4[_0xef8f('0x2a')]=_['map'](_0x4ede77[_0x161fd4['id']],function(_0x5afdda){return{'id':_0x5afdda['id'],'fullname':_0x5afdda['fullname']};});}}catch(_0x123ae3){_0x451b20(_0x123ae3);}_0x538cc3(_0x161fd4);});}function getInteractionTags(_0x429b41,_0x2c38d4){return new BPromise(function(_0x1e03bb,_0x28f828){try{if(_0x429b41[_0xef8f('0x2b')]){_0x429b41[_0xef8f('0x2c')]=[];_0x429b41[_0xef8f('0x2b')][_0xef8f('0x2d')](',')['forEach'](function(_0x417e81){_0x429b41[_0xef8f('0x2c')][_0xef8f('0x2e')](_0x2c38d4[_0x417e81]);});}delete _0x429b41[_0xef8f('0x2b')];}catch(_0x17004f){_0x28f828(_0x17004f);}_0x1e03bb(_0x429b41);});}function updateSmsInteraction(_0x5e6bcf,_0x2d807f,_0x47c4b4){return new BPromise(function(_0x2bee4a,_0x1f8ecd){return getInteractionUsers(_0x5e6bcf,_0x47c4b4)['then'](function(_0x4a58d2){return getInteractionTags(_0x4a58d2,_0x2d807f);})['then'](function(_0x30fd8f){_0x2bee4a(_0x30fd8f);})[_0xef8f('0x2f')](function(_0x45c65a){_0x1f8ecd(_0x45c65a);});});}exports[_0xef8f('0x30')]=function(_0x1ad20d,_0x275b48){var _0x32aa10={},_0x3bfd63={},_0x1cca71={'count':0x0,'rows':[]};var _0x1faf78=_[_0xef8f('0x31')](db[_0xef8f('0x32')][_0xef8f('0x33')],function(_0x16294c){return{'name':_0x16294c['fieldName'],'type':_0x16294c[_0xef8f('0x34')][_0xef8f('0x35')]};});_0x3bfd63['model']=_[_0xef8f('0x31')](_0x1faf78,_0xef8f('0x28'));_0x3bfd63[_0xef8f('0x36')]=_[_0xef8f('0x37')](_0x1ad20d[_0xef8f('0x36')]);_0x3bfd63[_0xef8f('0x38')]=_[_0xef8f('0x39')](_0x3bfd63[_0xef8f('0x3a')],_0x3bfd63[_0xef8f('0x36')]);_0x32aa10[_0xef8f('0x3b')]=_['intersection'](_0x3bfd63['model'],qs[_0xef8f('0x3c')](_0x1ad20d[_0xef8f('0x36')][_0xef8f('0x3c')]));_0x32aa10[_0xef8f('0x3b')]=_0x32aa10[_0xef8f('0x3b')][_0xef8f('0x3d')]?_0x32aa10[_0xef8f('0x3b')]:_0x3bfd63[_0xef8f('0x3a')];if(!_0x1ad20d[_0xef8f('0x36')][_0xef8f('0x3e')](_0xef8f('0x3f'))){_0x32aa10[_0xef8f('0x1f')]=qs['limit'](_0x1ad20d[_0xef8f('0x36')]['limit']);_0x32aa10[_0xef8f('0x1d')]=qs[_0xef8f('0x1d')](_0x1ad20d[_0xef8f('0x36')][_0xef8f('0x1d')]);}_0x32aa10['order']=qs[_0xef8f('0x40')](_0x1ad20d[_0xef8f('0x36')][_0xef8f('0x40')]);_0x32aa10[_0xef8f('0x41')]=qs['filters'](_[_0xef8f('0x42')](_0x1ad20d[_0xef8f('0x36')],_0x3bfd63['filters']),_0x1faf78);var _0x2917ab=[];var _0x4a9312=squel[_0xef8f('0x43')]()['field']('id')['field'](_0xef8f('0x28'))[_0xef8f('0x44')](_0xef8f('0x45'))['from'](_0xef8f('0x46'));var _0x128fe4=squel[_0xef8f('0x43')]()['field'](_0xef8f('0x47'))[_0xef8f('0x44')](_0xef8f('0x48'))[_0xef8f('0x44')]('ui.SmsInteractionId')[_0xef8f('0x49')](_0xef8f('0x4a'),'ui')['left_join'](_0xef8f('0x4b'),'u',_0xef8f('0x4c'));var _0x1abfc5=squel[_0xef8f('0x43')]()[_0xef8f('0x49')](_0xef8f('0x4d'),'i')[_0xef8f('0x4e')](_0xef8f('0x4f'),'c',_0xef8f('0x50'))[_0xef8f('0x4e')](_0xef8f('0x4b'),'o','o.id\x20=\x20i.UserId')[_0xef8f('0x4e')]('sms_accounts','a',_0xef8f('0x51'))[_0xef8f('0x4e')](_0xef8f('0x52'),'me',_0xef8f('0x53'))[_0xef8f('0x4e')](_0xef8f('0x54'),'it','it.SmsInteractionId\x20=\x20i.id')[_0xef8f('0x4e')](_0xef8f('0x46'),'t','t.id\x20=\x20it.TagId');var _0x457282=squel[_0xef8f('0x55')]();var _0x2d3a6c=[];var _0x3041ad=squel[_0xef8f('0x55')]();var _0x402538;if(_0x1ad20d[_0xef8f('0x36')][_0xef8f('0x56')]){_0x402538=as[_0xef8f('0x57')](_0x1ad20d[_0xef8f('0x36')][_0xef8f('0x56')]);var _0x51b571=_0x402538[_0xef8f('0x58')];for(var _0x406f1c=0x0;_0x406f1c<_0x402538[_0xef8f('0x59')][_0xef8f('0x3d')];_0x406f1c++){var _0x2f74d8=_0x402538[_0xef8f('0x59')][_0x406f1c];var _0x53d91a='i';var _0x5d5467=_['find'](_0x1faf78,['name',_0x2f74d8['field']]);if(!_0x5d5467){switch(_0x2f74d8[_0xef8f('0x44')]){case _0xef8f('0x5a'):if(_0x2f74d8[_0xef8f('0x5b')]==0x1){_0x1abfc5[_0xef8f('0x5c')]('`'+_0x2f74d8[_0xef8f('0x44')]+_0xef8f('0x5d'));}else{_0x1abfc5[_0xef8f('0x5c')]('`'+_0x2f74d8[_0xef8f('0x44')]+_0xef8f('0x5e'));}break;case _0xef8f('0x5f'):if(_0x2f74d8[_0xef8f('0x60')]===_0xef8f('0x61')){if(_0x2f74d8['value']['split']('\x20')['length']>0x1){_0x457282[_0x51b571]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xef8f('0x62')](_0x2f74d8[_0xef8f('0x5b')]),null);}else{var _0x4a7e5b='%'+_0x2f74d8[_0xef8f('0x5b')]+'%';_0x457282[_0x51b571]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x4a7e5b,_0x4a7e5b,_0x4a7e5b);}}else{_0x5d5467=_[_0xef8f('0x63')](_0x1faf78,[_0xef8f('0x28'),_0xef8f('0x64')]);_0x2f74d8[_0xef8f('0x44')]='ContactId';_0x5bf112=as[_0xef8f('0x65')](_0x53d91a,_0x5d5467['type'],_0x2f74d8);_0x457282[_0x51b571](_0x5bf112['text'],_0x5bf112[_0xef8f('0x5b')][_0xef8f('0x66')],_0x5bf112['value']['end']);}break;case _0xef8f('0x67'):var _0x379424=_0x2f74d8['value'][_0xef8f('0x2d')](',')['map'](function(_0xd42215){return Number(_0xd42215);});_0x379424['forEach'](function(_0x2f94b8){_0x3041ad['or'](_0xef8f('0x68'),'%,'+_0x2f94b8+',%');});_0x2d3a6c=_[_0xef8f('0x69')](_0x2d3a6c,_0x379424);break;case _0xef8f('0x6a'):if(_0x2f74d8[_0xef8f('0x60')]==='$substring'){_0x457282[_0x51b571]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x2f74d8[_0xef8f('0x5b')]+'%',null);}else{_0x5d5467=_['find'](_0x1faf78,['name',_0xef8f('0x6b')]);_0x2f74d8[_0xef8f('0x44')]=_0xef8f('0x6b');_0x5bf112=as[_0xef8f('0x65')](_0x53d91a,_0x5d5467[_0xef8f('0x34')],_0x2f74d8);_0x457282[_0x51b571](_0x5bf112['text'],_0x5bf112[_0xef8f('0x5b')][_0xef8f('0x66')],_0x5bf112[_0xef8f('0x5b')][_0xef8f('0x1b')]);}break;case _0xef8f('0x6c'):_0x5bf112=as[_0xef8f('0x65')]('me',null,_0x2f74d8);_0x457282[_0x51b571](_0x5bf112[_0xef8f('0x6d')],_0x5bf112['value'][_0xef8f('0x66')],_0x5bf112[_0xef8f('0x5b')][_0xef8f('0x1b')]);break;}}else{var _0x5bf112=as[_0xef8f('0x65')](_0x53d91a,_0x5d5467[_0xef8f('0x34')],_0x2f74d8);_0x457282[_0x51b571](_0x5bf112[_0xef8f('0x6d')],_0x5bf112[_0xef8f('0x5b')][_0xef8f('0x66')],_0x5bf112[_0xef8f('0x5b')][_0xef8f('0x1b')]);}}}else{var _0x5878d6=_(_0x1ad20d['query'])[_0xef8f('0x37')]()['map'](function(_0x380887){return _[_0xef8f('0x6e')](_0x1faf78,[_0xef8f('0x28'),_0x380887])?_0x380887:undefined;})[_0xef8f('0x6f')]()[_0xef8f('0x5b')]();if(!_['isEmpty'](_0x5878d6)){_0x5878d6[_0xef8f('0x70')](function(_0x2dc597){if(_0x2dc597===_0xef8f('0x71')){_0x1abfc5['where']('i.SmsAccountId\x20IN\x20?',[]['concat'](_0x1ad20d[_0xef8f('0x36')][_0x2dc597]));}else if(_0x2dc597===_0xef8f('0x72')){var _0x2f2881=JSON[_0xef8f('0x73')](_0x1ad20d[_0xef8f('0x36')][_0x2dc597])[_0xef8f('0x74')];var _0x146d9a=JSON[_0xef8f('0x73')](_0x1ad20d[_0xef8f('0x36')][_0x2dc597])[_0xef8f('0x75')];_0x1abfc5['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x2f2881,_0x146d9a);}else{if(_0x1ad20d[_0xef8f('0x36')][_0x2dc597]==='null'){_0x1abfc5['where']('i.'+_0x2dc597+_0xef8f('0x76'));}else{_0x1abfc5['where']('i.'+_0x2dc597+_0xef8f('0x77'),_0x1ad20d[_0xef8f('0x36')][_0x2dc597]);}}});}if(_0x1ad20d['query'][_0xef8f('0x78')]){if(_0x1ad20d[_0xef8f('0x36')][_0xef8f('0x78')]==0x1){_0x1abfc5[_0xef8f('0x5c')](_0xef8f('0x79'));}else{_0x1abfc5[_0xef8f('0x5c')]('`unreadMessages`\x20>\x200');}}if(_0x1ad20d['query'][_0xef8f('0x7a')]){_0x2d3a6c=_[_0xef8f('0x7b')](_0x1ad20d['query'][_0xef8f('0x7a')])?_0x1ad20d['query']['tag']:new Array(_0x1ad20d[_0xef8f('0x36')][_0xef8f('0x7a')]);_0x2d3a6c[_0xef8f('0x70')](function(_0x3b2d39){_0x3041ad['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3b2d39+',%');});}if(_0x1ad20d[_0xef8f('0x36')][_0xef8f('0x7c')]){var _0x51ac3e=_0x1ad20d[_0xef8f('0x36')]['filter']['replace']('\x5c','\x5c\x5c')[_0xef8f('0x7d')](/'/g,'\x27\x27');if(qs[_0xef8f('0x7e')](_0x51ac3e)){_0x457282['or'](_0xef8f('0x7f'),_0x51ac3e+'%')['or']('i.phone\x20LIKE\x20?',_0x51ac3e+'%');}else{_0x457282['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x51ac3e))['or'](_0xef8f('0x80'),_0x51ac3e+'%');}}}_0x1abfc5[_0xef8f('0x41')](_0x457282);_0x1abfc5['group']('i.id');var _0x3245db={'type':db[_0xef8f('0x81')][_0xef8f('0x82')][_0xef8f('0x83')],'raw':!![]};var _0x4a3035=_0x1abfc5[_0xef8f('0x84')]();_0x4a3035[_0xef8f('0x44')](_0xef8f('0x85'));_0x4a3035[_0xef8f('0x44')](_0xef8f('0x86'),_0xef8f('0x5a'));if(_0x32aa10['order']){_0x32aa10['order'][_0xef8f('0x70')](function(_0x33d586){var _0x47f662=_0x33d586[0x0]===_0xef8f('0x87')?_0x33d586[0x0]:'i.'+_0x33d586[0x0];_0x1abfc5['order'](_0x47f662,_0x33d586[0x1]===_0xef8f('0x88')?![]:!![]);});}if(!_[_0xef8f('0x89')](_0x2d3a6c)){_0x1abfc5[_0xef8f('0x5c')](_0x3041ad);_0x4a3035[_0xef8f('0x41')](_0xef8f('0x8a'),_0x2d3a6c);}BPromise[_0xef8f('0x8b')]()[_0xef8f('0x26')](function(){if(!_0x402538){if(_0x1ad20d[_0xef8f('0x36')]['SmsAccountId'])return;_0x4a3035['where']('i.SmsAccountId\x20IS\x20NOT\x20NULL');_0x1abfc5['where'](_0xef8f('0x8c'));return;}if(_0x1ad20d[_0xef8f('0x8d')][_0xef8f('0x8e')]!==_0xef8f('0x8f'))return;return _0x1ad20d['user'][_0xef8f('0x90')]({'attributes':['id'],'raw':!![]})[_0xef8f('0x26')](function(_0x5963c8){if(_['isEmpty'](_0x5963c8)){_0x4a3035[_0xef8f('0x41')]('i.SmsAccountId\x20IS\x20NULL');_0x1abfc5[_0xef8f('0x41')]('i.SmsAccountId\x20IS\x20NULL');}else{_0x4a3035[_0xef8f('0x41')](_0xef8f('0x91'),_[_0xef8f('0x31')](_0x5963c8,'id'));_0x1abfc5['where'](_0xef8f('0x91'),_[_0xef8f('0x31')](_0x5963c8,'id'));}});})[_0xef8f('0x26')](function(){if(_0x1ad20d[_0xef8f('0x8d')][_0xef8f('0x8e')]===_0xef8f('0x8f')&&!_0x402538&&!_0x1ad20d['query'][_0xef8f('0x71')])return[];return db[_0xef8f('0x92')]['query'](_0x4a3035[_0xef8f('0x93')](),_0x3245db);})[_0xef8f('0x26')](function(_0x50d681){_0x1cca71[_0xef8f('0x20')]=_0x50d681[_0xef8f('0x3d')];if(_0x1cca71[_0xef8f('0x20')]===0x0)return[];return db[_0xef8f('0x92')][_0xef8f('0x36')](_0x4a9312[_0xef8f('0x93')](),_0x3245db)[_0xef8f('0x26')](function(_0xffbbed){_0x2917ab=_[_0xef8f('0x94')](_0xffbbed,'id');_0x3245db=_[_0xef8f('0x95')](_0x3245db,{'model':db[_0xef8f('0x32')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1ad20d['query'][_0xef8f('0x3c')]){_0x32aa10[_0xef8f('0x3b')]['forEach'](function(_0x5da1ed){_0x1abfc5[_0xef8f('0x44')]('i.'+_0x5da1ed);});}else{_0x1abfc5['field'](_0xef8f('0x86'),_0xef8f('0x5a'));_0x1abfc5[_0xef8f('0x44')](_0xef8f('0x96'),_0xef8f('0x97'));_0x1abfc5['field'](_0xef8f('0x98'),_0xef8f('0x99'));_0x1abfc5[_0xef8f('0x44')](_0xef8f('0x9a'),_0xef8f('0x87'));_0x1abfc5[_0xef8f('0x44')](_0xef8f('0x9b'));_0x1abfc5[_0xef8f('0x44')](_0xef8f('0x9c'),_0xef8f('0x9d'));_0x1abfc5[_0xef8f('0x44')]('c.lastName',_0xef8f('0x9e'));_0x1abfc5[_0xef8f('0x44')](_0xef8f('0x9f'),_0xef8f('0xa0'));_0x1abfc5[_0xef8f('0x44')](_0xef8f('0xa1'),'Contact.phone');_0x1abfc5[_0xef8f('0x44')](_0xef8f('0xa2'),_0xef8f('0xa3'));_0x1abfc5[_0xef8f('0x44')](_0xef8f('0xa4'),_0xef8f('0xa5'));_0x1abfc5[_0xef8f('0x44')](_0xef8f('0xa6'),'Owner.fullname');_0x1abfc5['field'](_0xef8f('0xa7'),'Owner.internal');_0x1abfc5[_0xef8f('0x44')](_0xef8f('0xa8'),'TagIds');}if(_0x32aa10['limit'])_0x1abfc5['limit'](_0x32aa10[_0xef8f('0x1f')]);if(_0x32aa10['offset'])_0x1abfc5['offset'](_0x32aa10[_0xef8f('0x1d')]);return db[_0xef8f('0x92')][_0xef8f('0x36')](_0x1abfc5[_0xef8f('0x93')](),_0x3245db);})['then'](function(_0xd694f){if(_0xd694f['length']>0x0)_0x128fe4[_0xef8f('0x41')](_0xef8f('0xa9'),_[_0xef8f('0x31')](_0xd694f,'id'));return db['sequelize'][_0xef8f('0x36')](_0x128fe4[_0xef8f('0x93')](),_0x3245db)['then'](function(_0x21cefb){var _0x426a4e=_['groupBy'](_0x21cefb,_0xef8f('0xaa'));var _0x30adee=[];_0xd694f[_0xef8f('0x70')](function(_0x104030){_0x30adee[_0xef8f('0x2e')](updateSmsInteraction(_0x104030,_0x2917ab,_0x426a4e));});return BPromise[_0xef8f('0xab')](_0x30adee);});});})['then'](function(_0x245dd8){_0x1cca71[_0xef8f('0xac')]=_0x245dd8;return _0x1cca71;})[_0xef8f('0x26')](respondWithFilteredResult(_0x275b48,_0x32aa10))[_0xef8f('0x2f')](handleError(_0x275b48,null));};exports[_0xef8f('0xad')]=function(_0x28b774,_0x1a5d4e){var _0x284fa8={'raw':![],'where':{'id':_0x28b774[_0xef8f('0xae')]['id']}},_0x21be46={};_0x21be46[_0xef8f('0x3a')]=_[_0xef8f('0x37')](db[_0xef8f('0x32')][_0xef8f('0x33')]);_0x21be46[_0xef8f('0x36')]=_[_0xef8f('0x37')](_0x28b774['query']);_0x21be46[_0xef8f('0x38')]=_[_0xef8f('0x39')](_0x21be46[_0xef8f('0x3a')],_0x21be46[_0xef8f('0x36')]);_0x284fa8['attributes']=_[_0xef8f('0x39')](_0x21be46[_0xef8f('0x3a')],qs[_0xef8f('0x3c')](_0x28b774['query'][_0xef8f('0x3c')]));_0x284fa8[_0xef8f('0x3b')]=_0x284fa8[_0xef8f('0x3b')][_0xef8f('0x3d')]?_0x284fa8[_0xef8f('0x3b')]:_0x21be46['model'];if(_0x28b774[_0xef8f('0x36')]['includeAll']){_0x284fa8['include']=[{'all':!![]}];}_0x284fa8=_[_0xef8f('0x95')]({},_0x284fa8,_0x28b774[_0xef8f('0xaf')]);return db[_0xef8f('0x32')][_0xef8f('0x63')](_0x284fa8)[_0xef8f('0x26')](handleEntityNotFound(_0x1a5d4e,null))[_0xef8f('0x26')](respondWithResult(_0x1a5d4e,null))['catch'](handleError(_0x1a5d4e,null));};exports[_0xef8f('0xb0')]=function(_0x441131,_0x150b8b){return db['SmsInteraction'][_0xef8f('0xb0')](_0x441131[_0xef8f('0x6c')],{})[_0xef8f('0x26')](respondWithResult(_0x150b8b,0xc9))[_0xef8f('0x2f')](handleError(_0x150b8b,null));};exports[_0xef8f('0x25')]=function(_0x2f2e54,_0x15faa2){if(_0x2f2e54['body']['id']){delete _0x2f2e54['body']['id'];}return db[_0xef8f('0x32')][_0xef8f('0x63')]({'where':{'id':_0x2f2e54[_0xef8f('0xae')]['id']}})[_0xef8f('0x26')](handleEntityNotFound(_0x15faa2,null))[_0xef8f('0x26')](saveUpdates(_0x2f2e54['body'],null))[_0xef8f('0x26')](respondWithResult(_0x15faa2,null))[_0xef8f('0x2f')](handleError(_0x15faa2,null));};exports[_0xef8f('0x27')]=function(_0x4368b8,_0x253c2b){return db[_0xef8f('0x32')][_0xef8f('0x63')]({'where':{'id':_0x4368b8['params']['id']}})[_0xef8f('0x26')](handleEntityNotFound(_0x253c2b,null))['then'](removeEntity(_0x253c2b,null))[_0xef8f('0x2f')](handleError(_0x253c2b,null));};exports[_0xef8f('0xb1')]=function(_0x3dfcd8,_0x4a621c){return db['SmsInteraction'][_0xef8f('0xb1')]()[_0xef8f('0x26')](respondWithResult(_0x4a621c,null))[_0xef8f('0x2f')](handleError(_0x4a621c,null));};exports[_0xef8f('0xb2')]=function(_0x366a54,_0x3088d1,_0xe01ae4){return db['SmsMessage'][_0xef8f('0x63')]({'where':{'id':_0x366a54[_0xef8f('0xae')]['id']}})['then'](handleEntityNotFound(_0x3088d1,null))['then'](function(_0xbc84f6){if(_0xbc84f6){return _0xbc84f6[_0xef8f('0xb2')](_0x366a54[_0xef8f('0x6c')][_0xef8f('0xb3')],_[_0xef8f('0xb4')](_0x366a54[_0xef8f('0x6c')],['ids','id'])||{});}})[_0xef8f('0x26')](respondWithResult(_0x3088d1,null))['catch'](handleError(_0x3088d1,null));};exports[_0xef8f('0xb5')]=function(_0x5a3f0e,_0x44f183,_0x23652a){var _0x36b874={'raw':![],'where':{}};var _0x52a79f={};var _0x34a83e={'count':0x0,'rows':[]};return db[_0xef8f('0x32')][_0xef8f('0xb6')]({'where':{'id':_0x5a3f0e[_0xef8f('0xae')]['id']}})[_0xef8f('0x26')](handleEntityNotFound(_0x44f183,null))[_0xef8f('0x26')](function(_0x50ee35){if(_0x50ee35){_0x52a79f[_0xef8f('0x3a')]=_[_0xef8f('0x37')](db[_0xef8f('0xb7')]['rawAttributes']);_0x52a79f[_0xef8f('0x36')]=_[_0xef8f('0x37')](_0x5a3f0e[_0xef8f('0x36')]);_0x52a79f[_0xef8f('0x38')]=_[_0xef8f('0x39')](_0x52a79f[_0xef8f('0x3a')],_0x52a79f['query']);_0x36b874['attributes']=_[_0xef8f('0x39')](_0x52a79f[_0xef8f('0x3a')],qs[_0xef8f('0x3c')](_0x5a3f0e[_0xef8f('0x36')]['fields']));_0x36b874[_0xef8f('0x3b')]=_0x36b874[_0xef8f('0x3b')][_0xef8f('0x3d')]?_0x36b874[_0xef8f('0x3b')]:_0x52a79f[_0xef8f('0x3a')];if(!_0x5a3f0e[_0xef8f('0x36')][_0xef8f('0x3e')](_0xef8f('0x3f'))){_0x36b874[_0xef8f('0x1f')]=qs['limit'](_0x5a3f0e[_0xef8f('0x36')][_0xef8f('0x1f')]);_0x36b874[_0xef8f('0x1d')]=qs[_0xef8f('0x1d')](_0x5a3f0e[_0xef8f('0x36')]['offset']);}_0x36b874[_0xef8f('0xb8')]=qs[_0xef8f('0x40')](_0x5a3f0e[_0xef8f('0x36')][_0xef8f('0x40')]);_0x36b874[_0xef8f('0x41')]=qs[_0xef8f('0x38')](_[_0xef8f('0x42')](_0x5a3f0e['query'],_0x52a79f[_0xef8f('0x38')]));_0x36b874['where']['SmsInteractionId']=_0x50ee35['id'];if(_0x5a3f0e['query'][_0xef8f('0x7c')]){_0x36b874[_0xef8f('0x41')]=_[_0xef8f('0x95')](_0x36b874[_0xef8f('0x41')],{'$or':_[_0xef8f('0x31')](_0x36b874[_0xef8f('0x3b')],function(_0x3d08cd){var _0x21b42d={};_0x21b42d[_0x3d08cd]={'$like':'%'+_0x5a3f0e['query'][_0xef8f('0x7c')]+'%'};return _0x21b42d;})});}if(_0x5a3f0e[_0xef8f('0x36')][_0xef8f('0x74')]){var _0x3c8e9d=_0x5a3f0e[_0xef8f('0x36')]['$gte'][_0xef8f('0x2d')](',');var _0x27b184={};_0x27b184[_0x3c8e9d[0x0]]={'$gte':moment(_0x3c8e9d[0x1])[_0xef8f('0xb9')](_0xef8f('0xba'))};_0x36b874[_0xef8f('0x41')]=_[_0xef8f('0x95')](_0x36b874[_0xef8f('0x41')],_0x27b184);}_0x36b874=_['merge']({},_0x36b874,_0x5a3f0e[_0xef8f('0xaf')]);return db[_0xef8f('0xb7')]['count']({'where':_0x36b874['where']})[_0xef8f('0x26')](function(_0x36870c){_0x34a83e[_0xef8f('0x20')]=_0x36870c;if(_0x5a3f0e[_0xef8f('0x36')][_0xef8f('0xbb')]){_0x36b874[_0xef8f('0xbc')]=[{'all':!![]}];}return db[_0xef8f('0xb7')][_0xef8f('0xbd')](_0x36b874);})[_0xef8f('0x26')](function(_0x395515){_0x34a83e['rows']=_0x395515;return _0x34a83e;});}})[_0xef8f('0x26')](respondWithFilteredResult(_0x44f183,_0x36b874))[_0xef8f('0x2f')](handleError(_0x44f183,null));};exports['addTags']=function(_0x1fa98a,_0x1cb411,_0x2bccf2){return db[_0xef8f('0x32')][_0xef8f('0x63')]({'where':{'id':_0x1fa98a[_0xef8f('0xae')]['id']}})[_0xef8f('0x26')](handleEntityNotFound(_0x1cb411,null))[_0xef8f('0x26')](function(_0x237c56){if(_0x237c56){return _0x237c56[_0xef8f('0xbe')](_0x1fa98a[_0xef8f('0x6c')][_0xef8f('0xb3')],_[_0xef8f('0xb4')](_0x1fa98a[_0xef8f('0x6c')],['ids','id'])||{})['spread'](function(){return db[_0xef8f('0x67')][_0xef8f('0xbd')]({'attributes':['id',_0xef8f('0x28'),_0xef8f('0x45')],'where':{'id':_0x1fa98a[_0xef8f('0x6c')]['ids']}});})[_0xef8f('0x26')](function(_0x3e9880){socket[_0xef8f('0xbf')]('smsInteractionTags:save',{'id':Number(_0x1fa98a['params']['id']),'tags':_0x3e9880||[]});return{'id':Number(_0x1fa98a['params']['id']),'tags':_0x3e9880||[]};});}})[_0xef8f('0x26')](respondWithResult(_0x1cb411,null))[_0xef8f('0x2f')](handleError(_0x1cb411,null));};exports['removeTags']=function(_0x4c9e4d,_0x5aa1bb,_0x1725bf){return db['SmsInteraction'][_0xef8f('0x63')]({'where':{'id':_0x4c9e4d[_0xef8f('0xae')]['id']}})[_0xef8f('0x26')](handleEntityNotFound(_0x5aa1bb,null))[_0xef8f('0x26')](function(_0xe9dcca){if(_0xe9dcca){return _0xe9dcca['removeTags'](_0x4c9e4d[_0xef8f('0x36')][_0xef8f('0xb3')]);}})[_0xef8f('0x26')](respondWithStatusCode(_0x5aa1bb,null))[_0xef8f('0x2f')](handleError(_0x5aa1bb,null));};exports['download']=function(_0x3156a4,_0x46f6ae){var _0x47b79e=moment()[_0xef8f('0xc0')]()[_0xef8f('0x93')]();var _0x403018=path['join'](config[_0xef8f('0xc1')],'server',_0xef8f('0xc2'),_0xef8f('0xc3'));var _0x3b880a=path[_0xef8f('0xc4')](config[_0xef8f('0xc1')],_0xef8f('0xc5'),_0xef8f('0xc2'),_0xef8f('0xc6'));var _0x3d1522=path[_0xef8f('0xc4')](_0x403018,_0x47b79e);var _0x19147e=util['format']('transcript-%d-%s.zip',_0x3156a4[_0xef8f('0xae')]['id'],_0x47b79e);var _0x4a944d=path['join'](_0x403018,_0x19147e);var _0x41485=[];_0x41485[_0xef8f('0x2e')]({'model':db[_0xef8f('0x6a')],'as':_0xef8f('0x6a'),'attributes':['id',_0xef8f('0xc7')],'raw':!![]});_0x41485[_0xef8f('0x2e')]({'model':db[_0xef8f('0xc8')],'as':'Contact','attributes':['id',_0xef8f('0xc9'),_0xef8f('0xca')],'raw':!![]});var _0x20161f=[{'model':db[_0xef8f('0xb7')],'as':'Messages','attributes':['id',_0xef8f('0x6c'),'createdAt',_0xef8f('0xcb'),_0xef8f('0xcc'),_0xef8f('0x78')],'include':_0x41485}];_0x20161f['push']({'model':db[_0xef8f('0xcd')],'as':_0xef8f('0xce'),'attributes':['id',_0xef8f('0x28')]});_0x20161f[_0xef8f('0x2e')]({'model':db[_0xef8f('0x6a')],'as':_0xef8f('0xcf'),'attributes':['id',_0xef8f('0xc7')]});return db['SmsInteraction'][_0xef8f('0x63')]({'where':{'id':_0x3156a4[_0xef8f('0xae')]['id']},'include':_0x20161f})['then'](handleEntityNotFound(_0x46f6ae,null))[_0xef8f('0x26')](function(_0x13649c){if(_0x13649c){var _0x407062=_0x13649c['get']({'plain':!![]});fs[_0xef8f('0xd0')](_0x3d1522);var _0x3c759a={'channel':'Sms','account':_0x407062[_0xef8f('0xce')][_0xef8f('0x28')],'agent':_0x407062[_0xef8f('0xcf')]?_0x407062[_0xef8f('0xcf')]['fullname']:_0xef8f('0xd1'),'createdAt':moment(_0x407062[_0xef8f('0x72')])[_0xef8f('0xb9')](_0xef8f('0xba'))[_0xef8f('0x93')](),'closedAt':_0x407062[_0xef8f('0xd2')]?moment(_0x407062[_0xef8f('0xd3')])[_0xef8f('0xb9')](_0xef8f('0xba'))[_0xef8f('0x93')]():'','disposition':_0x407062[_0xef8f('0xd4')],'messages':_(_0x407062[_0xef8f('0xd5')])[_0xef8f('0x7c')]({'secret':![]})[_0xef8f('0x31')](function(_0xff76ea){return{'date':moment(_0xff76ea[_0xef8f('0x72')])[_0xef8f('0xb9')]('YYYY-MM-DD\x20HH:mm:ss')[_0xef8f('0x93')](),'sender':_0xff76ea[_0xef8f('0xcb')]===_0xef8f('0xd6')?_0xff76ea[_0xef8f('0x6a')]?_0xff76ea[_0xef8f('0x6a')][_0xef8f('0xc7')]:_0xef8f('0xd7'):_0xff76ea[_0xef8f('0x5f')][_0xef8f('0xc9')]+(_0xff76ea[_0xef8f('0x5f')][_0xef8f('0xca')]?'\x20'+_0xff76ea[_0xef8f('0x5f')][_0xef8f('0xca')]:''),'body':_0xff76ea[_0xef8f('0x6c')],'direction':_0xff76ea[_0xef8f('0xcb')]===_0xef8f('0xd6')?'A':'C','secret':_0xff76ea[_0xef8f('0xcc')],'read':_0xff76ea[_0xef8f('0x78')]};})['value']()};return ejs['renderFile'](path[_0xef8f('0xc4')](config[_0xef8f('0xc1')],_0xef8f('0xc5'),'views',_0xef8f('0xd8')),{'interaction':_0x3c759a})[_0xef8f('0x26')](function(_0x38421d){var _0x251554=path[_0xef8f('0xc4')](_0x3d1522,_0xef8f('0xd9')+_0x407062['id']+'-'+_0x47b79e+_0xef8f('0xda'));var _0x7ae561={'path':_0x251554,'channel':_0xef8f('0xdb'),'interactionId':_0x407062['id']};return pdf[_0xef8f('0xdc')](_0x38421d,_0x7ae561);})['then'](function(){return new BPromise(function(_0x49fc10,_0x18f082){zipdir(_0x3d1522,{'saveTo':_0x4a944d},function(_0x377631,_0x2d7405){if(_0x377631)return _0x18f082(_0x377631);return _0x49fc10(_0x2d7405);});})[_0xef8f('0x26')](function(){return new BPromise(function(_0x4799e1,_0x5973e4){rimraf(_0x3d1522,function(_0x3c79c1){if(_0x3c79c1)_0x5973e4(_0x3c79c1);return _0x4799e1();});});})[_0xef8f('0x26')](function(){return _0x46f6ae[_0xef8f('0xdd')](_0x4a944d,_0x19147e,function(_0x2e7987){if(_0x2e7987){console[_0xef8f('0xde')](_0xef8f('0xdf'),_0x2e7987);}else{fs[_0xef8f('0xe0')](_0x4a944d);}});});});}else{return _0x46f6ae['sendStatus'](0xc8);}})[_0xef8f('0x2f')](handleError(_0x46f6ae,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index f827cc3..3dcc87e 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 _0x6a95=['save','getUsers','then','map','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners'];(function(_0x3d8291,_0x560e85){var _0x2bad5c=function(_0x16d94d){while(--_0x16d94d){_0x3d8291['push'](_0x3d8291['shift']());}};_0x2bad5c(++_0x560e85);}(_0x6a95,0x1db));var _0x56a9=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0x6a95[_0x2576d7];return _0x16a08c;};'use strict';var EventEmitter=require(_0x56a9('0x0'));var SmsInteraction=require(_0x56a9('0x1'))['db'][_0x56a9('0x2')];var SmsMessage=require(_0x56a9('0x1'))['db'][_0x56a9('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x56a9('0x4')](0x0);var events={'afterCreate':_0x56a9('0x5'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x12cd60){return function(_0x83f534,_0x1b42ac,_0x2eb132){_0x83f534[_0x56a9('0x6')]({'attributes':['id'],'raw':!![]})[_0x56a9('0x7')](function(_0xd8aa7c){_0x83f534['setDataValue']('Users',_0xd8aa7c[_0x56a9('0x8')](function(_0x15f2ff){return{'id':_0x15f2ff['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x83f534['id'],'direction':'in','read':![]},'raw':!![]});})[_0x56a9('0x7')](function(_0x1eddfd){_0x83f534[_0x56a9('0x9')](_0x56a9('0xa'),_0x1eddfd[_0x56a9('0xb')]);SmsInteractionEvents[_0x56a9('0xc')](_0x12cd60+':'+_0x83f534['id'],_0x83f534);SmsInteractionEvents[_0x56a9('0xc')](_0x12cd60,_0x83f534);_0x2eb132(null);})[_0x56a9('0xd')](_0x2eb132(null));};}for(var e in events){if(events[_0x56a9('0xe')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0x56a9('0xf')]=SmsInteractionEvents; \ No newline at end of file +var _0x14a0=['hook','exports','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','update','setDataValue','Users','findAll','length','emit','catch'];(function(_0x205daa,_0x509744){var _0x632832=function(_0x3331b7){while(--_0x3331b7){_0x205daa['push'](_0x205daa['shift']());}};_0x632832(++_0x509744);}(_0x14a0,0x8e));var _0x014a=function(_0x5002f9,_0x36329a){_0x5002f9=_0x5002f9-0x0;var _0x1f8565=_0x14a0[_0x5002f9];return _0x1f8565;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0x014a('0x0'))['db'][_0x014a('0x1')];var SmsMessage=require(_0x014a('0x0'))['db'][_0x014a('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x014a('0x3')](0x0);var events={'afterCreate':_0x014a('0x4'),'afterUpdate':_0x014a('0x5'),'afterDestroy':'remove'};function emitEvent(_0x57a522){return function(_0x1730a5,_0x12e8da,_0x38a22c){_0x1730a5['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x11b8ce){_0x1730a5[_0x014a('0x6')](_0x014a('0x7'),_0x11b8ce['map'](function(_0x5d3d7f){return{'id':_0x5d3d7f['id']};}));return SmsMessage[_0x014a('0x8')]({'where':{'SmsInteractionId':_0x1730a5['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x490ea2){_0x1730a5['setDataValue']('unreadMessages',_0x490ea2[_0x014a('0x9')]);SmsInteractionEvents['emit'](_0x57a522+':'+_0x1730a5['id'],_0x1730a5);SmsInteractionEvents[_0x014a('0xa')](_0x57a522,_0x1730a5);_0x38a22c(null);})[_0x014a('0xb')](_0x38a22c(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0x014a('0xc')](e,emitEvent(event));}}module[_0x014a('0xd')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index c9df9e0..04110df 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 _0xfbda=['moment','request-promise','path','rimraf','../../config/environment','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions','closedAt','YYYY-MM-DD\x20HH:mm:ss','../../config/logger','api'];(function(_0x484ef8,_0x54d577){var _0x14f83e=function(_0x3955c7){while(--_0x3955c7){_0x484ef8['push'](_0x484ef8['shift']());}};_0x14f83e(++_0x54d577);}(_0xfbda,0x8a));var _0xafbd=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xfbda[_0x4b7b62];return _0x2280df;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xafbd('0x0'))(_0xafbd('0x1'));var moment=require(_0xafbd('0x2'));var BPromise=require('bluebird');var rp=require(_0xafbd('0x3'));var fs=require('fs');var path=require(_0xafbd('0x4'));var rimraf=require(_0xafbd('0x5'));var config=require(_0xafbd('0x6'));var attributes=require(_0xafbd('0x7'));module[_0xafbd('0x8')]=function(_0x37af6f,_0x209f85){return _0x37af6f[_0xafbd('0x9')](_0xafbd('0xa'),attributes,{'tableName':_0xafbd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x122ddc,_0x11e8b6,_0x2330ed){if(_0x122ddc['changed']('closed')){_0x122ddc[_0xafbd('0xc')]=moment()['format'](_0xafbd('0xd'));}_0x2330ed(null,_0x122ddc);}}});}; \ No newline at end of file +var _0x9991=['define','sms_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','request-promise','path','rimraf','./smsInteraction.attributes','exports'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x9991,0x18c));var _0x1999=function(_0x3b3a66,_0x3c0b91){_0x3b3a66=_0x3b3a66-0x0;var _0x2cada1=_0x9991[_0x3b3a66];return _0x2cada1;};'use strict';var _=require('lodash');var util=require(_0x1999('0x0'));var logger=require(_0x1999('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1999('0x2'));var fs=require('fs');var path=require(_0x1999('0x3'));var rimraf=require(_0x1999('0x4'));var config=require('../../config/environment');var attributes=require(_0x1999('0x5'));module[_0x1999('0x6')]=function(_0x5a6d54,_0x432f50){return _0x5a6d54[_0x1999('0x7')]('SmsInteraction',attributes,{'tableName':_0x1999('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x81a62f,_0x3cd10b,_0x4106ed){if(_0x81a62f[_0x1999('0x9')]('closed')){_0x81a62f[_0x1999('0xa')]=moment()[_0x1999('0xb')](_0x1999('0xc'));}_0x4106ed(null,_0x81a62f);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 05d1649..6a5554f 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 _0x4988=['client','http','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','request','info','request\x20sent','SmsInteraction,\x20%s,\x20%s,\x20%s','error','code','SmsInteraction,\x20%s,\x20%s','message','result','UpdateSmsInteraction','SmsInteraction','update','options','where','attributes','then','debug','stringify','catch','find','body','ids','omit','spread','AddTags','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x8eebdf,_0x341089){var _0x27e056=function(_0x1c9db9){while(--_0x1c9db9){_0x8eebdf['push'](_0x8eebdf['shift']());}};_0x27e056(++_0x341089);}(_0x4988,0x1ba));var _0x8498=function(_0x3826d3,_0x2788c4){_0x3826d3=_0x3826d3-0x0;var _0x34a2c9=_0x4988[_0x3826d3];return _0x34a2c9;};'use strict';var _=require(_0x8498('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8498('0x1'));var rs=require(_0x8498('0x2'));var fs=require('fs');var Redis=require(_0x8498('0x3'));var db=require(_0x8498('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8498('0x5'))(_0x8498('0x6'));var config=require(_0x8498('0x7'));var jayson=require(_0x8498('0x8'));var client=jayson[_0x8498('0x9')][_0x8498('0xa')]({'port':0x232a});config[_0x8498('0xb')]=_[_0x8498('0xc')](config[_0x8498('0xb')],{'host':_0x8498('0xd'),'port':0x18eb});var socket=require(_0x8498('0xe'))(new Redis(config['redis']));require(_0x8498('0xf'))['register'](socket);function respondWithRpcPromise(_0x3d6ac6,_0x13bc2b,_0x2d3935){return new BPromise(function(_0x103baf,_0x4e47fb){return client[_0x8498('0x10')](_0x3d6ac6,_0x2d3935)['then'](function(_0x47911){logger[_0x8498('0x11')]('SmsInteraction,\x20%s,\x20%s',_0x13bc2b,_0x8498('0x12'));logger['debug'](_0x8498('0x13'),_0x13bc2b,_0x8498('0x12'),JSON['stringify'](_0x47911));if(_0x47911['error']){if(_0x47911[_0x8498('0x14')][_0x8498('0x15')]===0x1f4){logger['error'](_0x8498('0x16'),_0x13bc2b,_0x47911[_0x8498('0x14')][_0x8498('0x17')]);return _0x4e47fb(_0x47911[_0x8498('0x14')][_0x8498('0x17')]);}logger[_0x8498('0x14')]('SmsInteraction,\x20%s,\x20%s',_0x13bc2b,_0x47911[_0x8498('0x14')][_0x8498('0x17')]);return _0x103baf(_0x47911['error'][_0x8498('0x17')]);}else{logger[_0x8498('0x11')](_0x8498('0x16'),_0x13bc2b,'request\x20sent');_0x103baf(_0x47911[_0x8498('0x18')][_0x8498('0x17')]);}})['catch'](function(_0x538ca3){logger[_0x8498('0x14')](_0x8498('0x16'),_0x13bc2b,_0x538ca3);_0x4e47fb(_0x538ca3);});});}exports[_0x8498('0x19')]=function(_0x2c07d8){var _0x48f50a=this;return new Promise(function(_0x8be477,_0x59b49c){return db[_0x8498('0x1a')][_0x8498('0x1b')](_0x2c07d8['body'],{'raw':_0x2c07d8['options']?_0x2c07d8['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c07d8['options']?_0x2c07d8[_0x8498('0x1c')][_0x8498('0x1d')]||null:null,'attributes':_0x2c07d8['options']?_0x2c07d8['options'][_0x8498('0x1e')]||null:null,'limit':_0x2c07d8[_0x8498('0x1c')]?_0x2c07d8['options']['limit']||null:null})[_0x8498('0x1f')](function(_0x53a962){logger[_0x8498('0x11')](_0x8498('0x19'),_0x2c07d8);logger[_0x8498('0x20')](_0x8498('0x19'),_0x2c07d8,JSON[_0x8498('0x21')](_0x53a962));_0x8be477(_0x53a962);})[_0x8498('0x22')](function(_0xe77a41){logger[_0x8498('0x14')](_0x8498('0x19'),_0xe77a41[_0x8498('0x17')],_0x2c07d8);_0x59b49c(_0x48f50a[_0x8498('0x14')](0x1f4,_0xe77a41['message']));});});};exports['AddTagsToSmsInteraction']=function(_0x5dc388){return new Promise(function(_0x538d12,_0xdc5eed){return db[_0x8498('0x1a')][_0x8498('0x23')]({'where':_0x5dc388['options']?_0x5dc388[_0x8498('0x1c')][_0x8498('0x1d')]||null:null})['then'](function(_0x22e0f2){if(_0x22e0f2){return _0x22e0f2['addTags'](_0x5dc388[_0x8498('0x24')][_0x8498('0x25')],_[_0x8498('0x26')](_0x5dc388[_0x8498('0x24')],[_0x8498('0x25'),'id'])||{});}})[_0x8498('0x27')](function(_0x9d997){logger[_0x8498('0x11')](_0x8498('0x28'),_0x5dc388);logger[_0x8498('0x20')](_0x8498('0x28'),_0x5dc388,JSON['stringify'](_0x9d997));_0x538d12(_0x9d997);})[_0x8498('0x22')](function(_0x2c1733){logger['error']('AddTags',_0x2c1733['message'],_0x5dc388);_0xdc5eed(_this[_0x8498('0x14')](0x1f4,_0x2c1733[_0x8498('0x17')]));});});}; \ No newline at end of file +var _0x073e=['AddTagsToSmsInteraction','find','ids','AddTags','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./smsInteraction.socket','register','request','then','info','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsInteraction,\x20%s,\x20%s','message','result','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','where','attributes','limit'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0x073e,0x1e4));var _0xe073=function(_0x402565,_0x431efa){_0x402565=_0x402565-0x0;var _0x2ed987=_0x073e[_0x402565];return _0x2ed987;};'use strict';var _=require('lodash');var util=require(_0xe073('0x0'));var moment=require(_0xe073('0x1'));var BPromise=require('bluebird');var rs=require(_0xe073('0x2'));var fs=require('fs');var Redis=require(_0xe073('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe073('0x4'));var logger=require(_0xe073('0x5'))(_0xe073('0x6'));var config=require('../../config/environment');var jayson=require(_0xe073('0x7'));var client=jayson[_0xe073('0x8')][_0xe073('0x9')]({'port':0x232a});config[_0xe073('0xa')]=_['defaults'](config['redis'],{'host':_0xe073('0xb'),'port':0x18eb});var socket=require(_0xe073('0xc'))(new Redis(config['redis']));require(_0xe073('0xd'))[_0xe073('0xe')](socket);function respondWithRpcPromise(_0x22df12,_0x2feebb,_0x546af3){return new BPromise(function(_0x547d51,_0x355ec8){return client[_0xe073('0xf')](_0x22df12,_0x546af3)[_0xe073('0x10')](function(_0xe98bbe){logger[_0xe073('0x11')]('SmsInteraction,\x20%s,\x20%s',_0x2feebb,_0xe073('0x12'));logger[_0xe073('0x13')](_0xe073('0x14'),_0x2feebb,_0xe073('0x12'),JSON[_0xe073('0x15')](_0xe98bbe));if(_0xe98bbe[_0xe073('0x16')]){if(_0xe98bbe['error'][_0xe073('0x17')]===0x1f4){logger[_0xe073('0x16')](_0xe073('0x18'),_0x2feebb,_0xe98bbe[_0xe073('0x16')][_0xe073('0x19')]);return _0x355ec8(_0xe98bbe[_0xe073('0x16')][_0xe073('0x19')]);}logger[_0xe073('0x16')](_0xe073('0x18'),_0x2feebb,_0xe98bbe[_0xe073('0x16')]['message']);return _0x547d51(_0xe98bbe[_0xe073('0x16')][_0xe073('0x19')]);}else{logger[_0xe073('0x11')](_0xe073('0x18'),_0x2feebb,'request\x20sent');_0x547d51(_0xe98bbe[_0xe073('0x1a')][_0xe073('0x19')]);}})[_0xe073('0x1b')](function(_0x4eaa74){logger[_0xe073('0x16')]('SmsInteraction,\x20%s,\x20%s',_0x2feebb,_0x4eaa74);_0x355ec8(_0x4eaa74);});});}exports[_0xe073('0x1c')]=function(_0x1d0b51){var _0x37426=this;return new Promise(function(_0x184676,_0x9dd91){return db[_0xe073('0x1d')][_0xe073('0x1e')](_0x1d0b51[_0xe073('0x1f')],{'raw':_0x1d0b51[_0xe073('0x20')]?_0x1d0b51[_0xe073('0x20')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d0b51[_0xe073('0x20')]?_0x1d0b51[_0xe073('0x20')][_0xe073('0x21')]||null:null,'attributes':_0x1d0b51[_0xe073('0x20')]?_0x1d0b51[_0xe073('0x20')][_0xe073('0x22')]||null:null,'limit':_0x1d0b51[_0xe073('0x20')]?_0x1d0b51[_0xe073('0x20')][_0xe073('0x23')]||null:null})[_0xe073('0x10')](function(_0x30b589){logger[_0xe073('0x11')](_0xe073('0x1c'),_0x1d0b51);logger['debug']('UpdateSmsInteraction',_0x1d0b51,JSON[_0xe073('0x15')](_0x30b589));_0x184676(_0x30b589);})['catch'](function(_0x43be37){logger[_0xe073('0x16')]('UpdateSmsInteraction',_0x43be37[_0xe073('0x19')],_0x1d0b51);_0x9dd91(_0x37426['error'](0x1f4,_0x43be37['message']));});});};exports[_0xe073('0x24')]=function(_0x33e716){return new Promise(function(_0x200644,_0x5bef8f){return db[_0xe073('0x1d')][_0xe073('0x25')]({'where':_0x33e716[_0xe073('0x20')]?_0x33e716[_0xe073('0x20')][_0xe073('0x21')]||null:null})[_0xe073('0x10')](function(_0x48749a){if(_0x48749a){return _0x48749a['addTags'](_0x33e716[_0xe073('0x1f')][_0xe073('0x26')],_['omit'](_0x33e716[_0xe073('0x1f')],[_0xe073('0x26'),'id'])||{});}})['spread'](function(_0xf76c42){logger['info'](_0xe073('0x27'),_0x33e716);logger['debug']('AddTags',_0x33e716,JSON['stringify'](_0xf76c42));_0x200644(_0xf76c42);})[_0xe073('0x1b')](function(_0x491cfc){logger[_0xe073('0x16')]('AddTags',_0x491cfc[_0xe073('0x19')],_0x33e716);_0x5bef8f(_this['error'](0x1f4,_0x491cfc['message']));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 9597446..61dbef5 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 _0xf04b=['smsInteraction:','./smsInteraction.events','save','remove','update','emit','length'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xf04b,0xd3));var _0xbf04=function(_0x5d56fa,_0xdbc916){_0x5d56fa=_0x5d56fa-0x0;var _0x286a55=_0xf04b[_0x5d56fa];return _0x286a55;};'use strict';var SmsInteractionEvents=require(_0xbf04('0x0'));var events=[_0xbf04('0x1'),_0xbf04('0x2'),_0xbf04('0x3')];function createListener(_0x3795e8,_0x2f2715){return function(_0x4e50f9){_0x2f2715[_0xbf04('0x4')](_0x3795e8,_0x4e50f9);};}function removeListener(_0x285a85,_0x36255d){return function(){SmsInteractionEvents['removeListener'](_0x285a85,_0x36255d);};}exports['register']=function(_0x19cddc){for(var _0x5d7a7e=0x0,_0x460a9a=events[_0xbf04('0x5')];_0x5d7a7e<_0x460a9a;_0x5d7a7e++){var _0x3d9d64=events[_0x5d7a7e];var _0x2c1e9d=createListener(_0xbf04('0x6')+_0x3d9d64,_0x19cddc);SmsInteractionEvents['on'](_0x3d9d64,_0x2c1e9d);}}; \ No newline at end of file +var _0xe353=['removeListener','register','length','smsInteraction:','./smsInteraction.events','save','remove'];(function(_0x223264,_0x149d9e){var _0x10fc45=function(_0x5cd9d9){while(--_0x5cd9d9){_0x223264['push'](_0x223264['shift']());}};_0x10fc45(++_0x149d9e);}(_0xe353,0xdd));var _0x3e35=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0xe353[_0x4d8ed9];return _0x1e2140;};'use strict';var SmsInteractionEvents=require(_0x3e35('0x0'));var events=[_0x3e35('0x1'),_0x3e35('0x2'),'update'];function createListener(_0x205bce,_0x2defc7){return function(_0x40a7b4){_0x2defc7['emit'](_0x205bce,_0x40a7b4);};}function removeListener(_0x512d5a,_0x52f0f6){return function(){SmsInteractionEvents[_0x3e35('0x3')](_0x512d5a,_0x52f0f6);};}exports[_0x3e35('0x4')]=function(_0x4575b6){for(var _0xb9a652=0x0,_0x45b3bd=events[_0x3e35('0x5')];_0xb9a652<_0x45b3bd;_0xb9a652++){var _0x1265d6=events[_0xb9a652];var _0x3ee4e1=createListener(_0x3e35('0x6')+_0x1265d6,_0x4575b6);SmsInteractionEvents['on'](_0x1265d6,_0x3ee4e1);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 65dfb81..d951c22 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 _0x9a86=['isAuthenticated','index','/describe','describe','show','tracked','create','post','/:id/status','status','put','/:id/accept','accept','delete','/:id','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get'];(function(_0xd3b97e,_0x3477fc){var _0x1c91ac=function(_0x35220f){while(--_0x35220f){_0xd3b97e['push'](_0xd3b97e['shift']());}};_0x1c91ac(++_0x3477fc);}(_0x9a86,0x1ed));var _0x69a8=function(_0x3efe87,_0x35ad48){_0x3efe87=_0x3efe87-0x0;var _0x56a4cc=_0x9a86[_0x3efe87];return _0x56a4cc;};'use strict';var multer=require(_0x69a8('0x0'));var util=require(_0x69a8('0x1'));var path=require('path');var timeout=require(_0x69a8('0x2'));var express=require(_0x69a8('0x3'));var router=express[_0x69a8('0x4')]();var fs_extra=require(_0x69a8('0x5'));var auth=require(_0x69a8('0x6'));var interaction=require(_0x69a8('0x7'));var config=require(_0x69a8('0x8'));var controller=require(_0x69a8('0x9'));router[_0x69a8('0xa')]('/',auth[_0x69a8('0xb')](),controller[_0x69a8('0xc')]);router[_0x69a8('0xa')](_0x69a8('0xd'),auth[_0x69a8('0xb')](),controller[_0x69a8('0xe')]);router[_0x69a8('0xa')]('/:id',auth[_0x69a8('0xb')](),controller[_0x69a8('0xf')]);router['post']('/',auth[_0x69a8('0xb')](),interaction[_0x69a8('0x10')]('sms','smsmessage:create'),controller[_0x69a8('0x11')]);router[_0x69a8('0x12')](_0x69a8('0x13'),controller[_0x69a8('0x14')]);router['put']('/:id',auth[_0x69a8('0xb')](),controller['update']);router[_0x69a8('0x15')](_0x69a8('0x16'),auth[_0x69a8('0xb')](),controller[_0x69a8('0x17')]);router[_0x69a8('0x15')]('/:id/reject',auth[_0x69a8('0xb')](),controller['reject']);router[_0x69a8('0x18')](_0x69a8('0x19'),auth['isAuthenticated'](),controller[_0x69a8('0x1a')]);module[_0x69a8('0x1b')]=router; \ No newline at end of file +var _0x4227=['show','sms','smsmessage:create','create','post','/:id/status','put','update','accept','delete','destroy','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x57d41c,_0x44fb49){var _0x210118=function(_0x435299){while(--_0x435299){_0x57d41c['push'](_0x57d41c['shift']());}};_0x210118(++_0x44fb49);}(_0x4227,0x89));var _0x7422=function(_0x33e7ed,_0xf5946e){_0x33e7ed=_0x33e7ed-0x0;var _0x4d59c1=_0x4227[_0x33e7ed];return _0x4d59c1;};'use strict';var multer=require(_0x7422('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x7422('0x1'));var express=require('express');var router=express[_0x7422('0x2')]();var fs_extra=require(_0x7422('0x3'));var auth=require(_0x7422('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x7422('0x5'));var controller=require(_0x7422('0x6'));router[_0x7422('0x7')]('/',auth[_0x7422('0x8')](),controller[_0x7422('0x9')]);router[_0x7422('0x7')](_0x7422('0xa'),auth[_0x7422('0x8')](),controller[_0x7422('0xb')]);router['get'](_0x7422('0xc'),auth[_0x7422('0x8')](),controller[_0x7422('0xd')]);router['post']('/',auth[_0x7422('0x8')](),interaction['tracked'](_0x7422('0xe'),_0x7422('0xf')),controller[_0x7422('0x10')]);router[_0x7422('0x11')](_0x7422('0x12'),controller['status']);router[_0x7422('0x13')](_0x7422('0xc'),auth['isAuthenticated'](),controller[_0x7422('0x14')]);router[_0x7422('0x13')]('/:id/accept',auth[_0x7422('0x8')](),controller[_0x7422('0x15')]);router['put']('/:id/reject',auth[_0x7422('0x8')](),controller['reject']);router[_0x7422('0x16')](_0x7422('0xc'),auth['isAuthenticated'](),controller[_0x7422('0x17')]);module[_0x7422('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 1434fb2..581f949 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 _0x9e06=['exports','TEXT','BOOLEAN','ENUM','out','STRING','sequelize'];(function(_0x31c480,_0x13f64a){var _0x3687ce=function(_0x46fbc0){while(--_0x46fbc0){_0x31c480['push'](_0x31c480['shift']());}};_0x3687ce(++_0x13f64a);}(_0x9e06,0x14f));var _0x69e0=function(_0xff7a4c,_0x2da056){_0xff7a4c=_0xff7a4c-0x0;var _0x59dd72=_0x9e06[_0xff7a4c];return _0x59dd72;};'use strict';var Sequelize=require(_0x69e0('0x0'));module[_0x69e0('0x1')]={'body':{'type':Sequelize[_0x69e0('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x69e0('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x69e0('0x4')]('in',_0x69e0('0x5')),'defaultValue':_0x69e0('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x69e0('0x6')](0xbe)},'phone':{'type':Sequelize[_0x69e0('0x6')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x69e0('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xa7cc=['exports','TEXT','BOOLEAN','ENUM','out','STRING'];(function(_0x2d2258,_0x2ce510){var _0x18e155=function(_0x11949e){while(--_0x11949e){_0x2d2258['push'](_0x2d2258['shift']());}};_0x18e155(++_0x2ce510);}(_0xa7cc,0x1f2));var _0xca7c=function(_0x5dd977,_0xc575f6){_0x5dd977=_0x5dd977-0x0;var _0x2a646e=_0xa7cc[_0x5dd977];return _0x2a646e;};'use strict';var Sequelize=require('sequelize');module[_0xca7c('0x0')]={'body':{'type':Sequelize[_0xca7c('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xca7c('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xca7c('0x3')]('in',_0xca7c('0x4')),'defaultValue':_0xca7c('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0xca7c('0x5')](0xbe)},'phone':{'type':Sequelize[_0xca7c('0x5')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0xca7c('0x5')]},'providerResponse':{'type':Sequelize[_0xca7c('0x1')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 9c4bda4..67a13cc 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 _0xaf9f=['intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','show','params','keys','find','create','body','describe','sms-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','SmsInteractionId','isNil','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','contact','agent','fullname','interface','SIP/%s','channel','event','EventManager','acceptmessage','sms','SmsInteraction','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','QueryTypes','email','internal','rejectmessage','SmsAccount','SmsAccountId','debug','inspect','twilio','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','sent','delivered','Status','plivio','results','groupName','infobip','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','jayson/promise','client','http','then','info','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','request\x20sent','result','catch','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','destroy','stack','name','send','map','SmsMessage','rawAttributes','fieldName','type','key','model','query','filters'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xaf9f,0x16d));var _0xfaf9=function(_0x12d812,_0x496bb7){_0x12d812=_0x12d812-0x0;var _0x3711ab=_0xaf9f[_0x12d812];return _0x3711ab;};'use strict';var emlformat=require(_0xfaf9('0x0'));var rimraf=require(_0xfaf9('0x1'));var zipdir=require(_0xfaf9('0x2'));var jsonpatch=require(_0xfaf9('0x3'));var rp=require(_0xfaf9('0x4'));var moment=require(_0xfaf9('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xfaf9('0x6'));var csv=require(_0xfaf9('0x7'));var ejs=require(_0xfaf9('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfaf9('0x9'));var squel=require(_0xfaf9('0xa'));var crypto=require(_0xfaf9('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xfaf9('0xc'));var toCsv=require(_0xfaf9('0x7'));var querystring=require(_0xfaf9('0xd'));var Papa=require(_0xfaf9('0xe'));var Redis=require('ioredis');var authService=require(_0xfaf9('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xfaf9('0x10'));var hardwareService=require(_0xfaf9('0x11'));var logger=require(_0xfaf9('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xfaf9('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xfaf9('0x14'))['db'];config[_0xfaf9('0x15')]=_[_0xfaf9('0x16')](config[_0xfaf9('0x15')],{'host':_0xfaf9('0x17'),'port':0x18eb});var socket=require(_0xfaf9('0x18'))(new Redis(config['redis']));require(_0xfaf9('0x19'))['register'](socket);var jayson=require(_0xfaf9('0x1a'));var client=jayson[_0xfaf9('0x1b')][_0xfaf9('0x1c')]({'port':0x232c});var client9002=jayson[_0xfaf9('0x1b')][_0xfaf9('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x50635a,_0x4af0aa,_0x1c6379,_0x390ba3){return new BPromise(function(_0x2e52b3,_0x30f000){var _0x37d8ad=_0x390ba3||client;return _0x37d8ad['request'](_0x50635a,_0x1c6379)[_0xfaf9('0x1d')](function(_0x23e8c1){logger[_0xfaf9('0x1e')]('SmsMessage,\x20%s,\x20%s',_0x4af0aa,'request\x20sent');logger['debug'](_0xfaf9('0x1f'),_0x4af0aa,'request\x20sent',JSON[_0xfaf9('0x20')](_0x23e8c1));if(_0x23e8c1[_0xfaf9('0x21')]){if(_0x23e8c1[_0xfaf9('0x21')][_0xfaf9('0x22')]===0x1f4){logger[_0xfaf9('0x21')](_0xfaf9('0x23'),_0x4af0aa,_0x23e8c1[_0xfaf9('0x21')][_0xfaf9('0x24')]);return _0x30f000(_0x23e8c1[_0xfaf9('0x21')]['message']);}logger[_0xfaf9('0x21')](_0xfaf9('0x23'),_0x4af0aa,_0x23e8c1[_0xfaf9('0x21')][_0xfaf9('0x24')]);return _0x2e52b3(_0x23e8c1['error']['message']);}else{logger[_0xfaf9('0x1e')]('SmsMessage,\x20%s,\x20%s',_0x4af0aa,_0xfaf9('0x25'));_0x2e52b3(_0x23e8c1[_0xfaf9('0x26')][_0xfaf9('0x24')]);}})[_0xfaf9('0x27')](function(_0x582144){logger['error'](_0xfaf9('0x23'),_0x4af0aa,_0x582144);_0x30f000(_0x582144);});});}function respondWithStatusCode(_0x36d684,_0x384b8c){_0x384b8c=_0x384b8c||0xcc;return function(_0x1073c8){if(_0x1073c8){return _0x36d684[_0xfaf9('0x28')](_0x384b8c);}return _0x36d684[_0xfaf9('0x29')](_0x384b8c)[_0xfaf9('0x2a')]();};}function respondWithResult(_0x1fa4d9,_0x266f3d){_0x266f3d=_0x266f3d||0xc8;return function(_0x4215cb){if(_0x4215cb){return _0x1fa4d9[_0xfaf9('0x29')](_0x266f3d)['json'](_0x4215cb);}};}function respondWithFilteredResult(_0x405576,_0x435cdc){return function(_0x52532d){if(_0x52532d){var _0x1bb13a=typeof _0x435cdc[_0xfaf9('0x2b')]===_0xfaf9('0x2c')&&typeof _0x435cdc['limit']===_0xfaf9('0x2c');var _0x30f348=_0x52532d[_0xfaf9('0x2d')];var _0x3f9b68=_0x1bb13a?0x0:_0x435cdc[_0xfaf9('0x2b')];var _0x5816dc=_0x1bb13a?_0x52532d['count']:_0x435cdc[_0xfaf9('0x2b')]+_0x435cdc[_0xfaf9('0x2e')];var _0x129d25;if(_0x5816dc>=_0x30f348){_0x5816dc=_0x30f348;_0x129d25=0xc8;}else{_0x129d25=0xce;}_0x405576['status'](_0x129d25);return _0x405576[_0xfaf9('0x2f')](_0xfaf9('0x30'),_0x3f9b68+'-'+_0x5816dc+'/'+_0x30f348)[_0xfaf9('0x31')](_0x52532d);}return null;};}function patchUpdates(_0x1c4b10){return function(_0x5ad9c5){try{jsonpatch[_0xfaf9('0x32')](_0x5ad9c5,_0x1c4b10,!![]);}catch(_0x1f8b6e){return BPromise[_0xfaf9('0x33')](_0x1f8b6e);}return _0x5ad9c5[_0xfaf9('0x34')]();};}function saveUpdates(_0x350c5f,_0x33761c){return function(_0x3e42f1){if(_0x3e42f1){return _0x3e42f1[_0xfaf9('0x35')](_0x350c5f)[_0xfaf9('0x1d')](function(_0xc62548){return _0xc62548;});}return null;};}function removeEntity(_0x259071,_0x2db0c0){return function(_0x1f60f3){if(_0x1f60f3){return _0x1f60f3[_0xfaf9('0x36')]()[_0xfaf9('0x1d')](function(){_0x259071['status'](0xcc)[_0xfaf9('0x2a')]();});}};}function handleEntityNotFound(_0x21d791,_0x5c0be4){return function(_0x2376bf){if(!_0x2376bf){_0x21d791[_0xfaf9('0x28')](0x194);}return _0x2376bf;};}function handleError(_0x123b7d,_0x5d7abe){_0x5d7abe=_0x5d7abe||0x1f4;return function(_0x333ac7){logger[_0xfaf9('0x21')](_0x333ac7[_0xfaf9('0x37')]);if(_0x333ac7[_0xfaf9('0x38')]){delete _0x333ac7[_0xfaf9('0x38')];}_0x123b7d[_0xfaf9('0x29')](_0x5d7abe)[_0xfaf9('0x39')](_0x333ac7);};}exports['index']=function(_0x1cfa3c,_0x4f3aaf){var _0x2a9cd6={},_0x27bb1f={},_0x1ab9f0={'count':0x0,'rows':[]};var _0x36b2f5=_[_0xfaf9('0x3a')](db[_0xfaf9('0x3b')][_0xfaf9('0x3c')],function(_0x3a7081){return{'name':_0x3a7081[_0xfaf9('0x3d')],'type':_0x3a7081[_0xfaf9('0x3e')][_0xfaf9('0x3f')]};});_0x27bb1f[_0xfaf9('0x40')]=_[_0xfaf9('0x3a')](_0x36b2f5,_0xfaf9('0x38'));_0x27bb1f[_0xfaf9('0x41')]=_['keys'](_0x1cfa3c[_0xfaf9('0x41')]);_0x27bb1f[_0xfaf9('0x42')]=_[_0xfaf9('0x43')](_0x27bb1f[_0xfaf9('0x40')],_0x27bb1f[_0xfaf9('0x41')]);_0x2a9cd6[_0xfaf9('0x44')]=_[_0xfaf9('0x43')](_0x27bb1f[_0xfaf9('0x40')],qs[_0xfaf9('0x45')](_0x1cfa3c[_0xfaf9('0x41')]['fields']));_0x2a9cd6['attributes']=_0x2a9cd6['attributes']['length']?_0x2a9cd6[_0xfaf9('0x44')]:_0x27bb1f['model'];if(!_0x1cfa3c[_0xfaf9('0x41')][_0xfaf9('0x46')](_0xfaf9('0x47'))){_0x2a9cd6[_0xfaf9('0x2e')]=qs[_0xfaf9('0x2e')](_0x1cfa3c[_0xfaf9('0x41')]['limit']);_0x2a9cd6['offset']=qs[_0xfaf9('0x2b')](_0x1cfa3c['query'][_0xfaf9('0x2b')]);}_0x2a9cd6[_0xfaf9('0x48')]=qs[_0xfaf9('0x49')](_0x1cfa3c[_0xfaf9('0x41')][_0xfaf9('0x49')]);_0x2a9cd6[_0xfaf9('0x4a')]=qs[_0xfaf9('0x42')](_[_0xfaf9('0x4b')](_0x1cfa3c[_0xfaf9('0x41')],_0x27bb1f[_0xfaf9('0x42')]),_0x36b2f5);if(_0x1cfa3c[_0xfaf9('0x41')][_0xfaf9('0x4c')]){_0x2a9cd6['where']=_[_0xfaf9('0x4d')](_0x2a9cd6[_0xfaf9('0x4a')],{'$or':_['map'](_0x36b2f5,function(_0x5bd9db){if(_0x5bd9db[_0xfaf9('0x3e')]!==_0xfaf9('0x4e')){var _0x5df02c={};_0x5df02c[_0x5bd9db[_0xfaf9('0x38')]]={'$like':'%'+_0x1cfa3c[_0xfaf9('0x41')][_0xfaf9('0x4c')]+'%'};return _0x5df02c;}})});}_0x2a9cd6=_[_0xfaf9('0x4d')]({},_0x2a9cd6,_0x1cfa3c[_0xfaf9('0x4f')]);var _0x2ddf97={'where':_0x2a9cd6[_0xfaf9('0x4a')]};return db[_0xfaf9('0x3b')]['count'](_0x2ddf97)[_0xfaf9('0x1d')](function(_0x1b9e90){_0x1ab9f0['count']=_0x1b9e90;if(_0x1cfa3c[_0xfaf9('0x41')][_0xfaf9('0x50')]){_0x2a9cd6[_0xfaf9('0x51')]=[{'all':!![]}];}return db['SmsMessage']['findAll'](_0x2a9cd6);})[_0xfaf9('0x1d')](function(_0x5dd138){_0x1ab9f0['rows']=_0x5dd138;return _0x1ab9f0;})['then'](respondWithFilteredResult(_0x4f3aaf,_0x2a9cd6))[_0xfaf9('0x27')](handleError(_0x4f3aaf,null));};exports[_0xfaf9('0x52')]=function(_0x12391f,_0xd0f517){var _0x1bef55={'raw':!![],'where':{'id':_0x12391f[_0xfaf9('0x53')]['id']}},_0x5afee1={};_0x5afee1[_0xfaf9('0x40')]=_['keys'](db[_0xfaf9('0x3b')][_0xfaf9('0x3c')]);_0x5afee1[_0xfaf9('0x41')]=_[_0xfaf9('0x54')](_0x12391f[_0xfaf9('0x41')]);_0x5afee1[_0xfaf9('0x42')]=_[_0xfaf9('0x43')](_0x5afee1['model'],_0x5afee1[_0xfaf9('0x41')]);_0x1bef55[_0xfaf9('0x44')]=_['intersection'](_0x5afee1[_0xfaf9('0x40')],qs[_0xfaf9('0x45')](_0x12391f['query'][_0xfaf9('0x45')]));_0x1bef55[_0xfaf9('0x44')]=_0x1bef55[_0xfaf9('0x44')]['length']?_0x1bef55[_0xfaf9('0x44')]:_0x5afee1[_0xfaf9('0x40')];if(_0x12391f[_0xfaf9('0x41')][_0xfaf9('0x50')]){_0x1bef55[_0xfaf9('0x51')]=[{'all':!![]}];}_0x1bef55=_[_0xfaf9('0x4d')]({},_0x1bef55,_0x12391f[_0xfaf9('0x4f')]);return db[_0xfaf9('0x3b')][_0xfaf9('0x55')](_0x1bef55)['then'](handleEntityNotFound(_0xd0f517,null))[_0xfaf9('0x1d')](respondWithResult(_0xd0f517,null))[_0xfaf9('0x27')](handleError(_0xd0f517,null));};exports['create']=function(_0x30e20f,_0xd04aa7){return db['SmsMessage'][_0xfaf9('0x56')](_0x30e20f[_0xfaf9('0x57')],{})['then'](respondWithResult(_0xd04aa7,0xc9))[_0xfaf9('0x27')](handleError(_0xd04aa7,null));};exports[_0xfaf9('0x35')]=function(_0x1e55e2,_0x55c424){if(_0x1e55e2[_0xfaf9('0x57')]['id']){delete _0x1e55e2['body']['id'];}return db[_0xfaf9('0x3b')][_0xfaf9('0x55')]({'where':{'id':_0x1e55e2['params']['id']}})['then'](handleEntityNotFound(_0x55c424,null))[_0xfaf9('0x1d')](saveUpdates(_0x1e55e2['body'],null))[_0xfaf9('0x1d')](respondWithResult(_0x55c424,null))[_0xfaf9('0x27')](handleError(_0x55c424,null));};exports[_0xfaf9('0x36')]=function(_0x4ff7bb,_0x1423b2){return db['SmsMessage']['find']({'where':{'id':_0x4ff7bb['params']['id']}})[_0xfaf9('0x1d')](handleEntityNotFound(_0x1423b2,null))['then'](removeEntity(_0x1423b2,null))[_0xfaf9('0x27')](handleError(_0x1423b2,null));};exports['describe']=function(_0x463af6,_0xf10add){return db[_0xfaf9('0x3b')][_0xfaf9('0x58')]()['then'](respondWithResult(_0xf10add,null))[_0xfaf9('0x27')](handleError(_0xf10add,null));};var interaction_log=require(_0xfaf9('0x12'))(_0xfaf9('0x59'));exports[_0xfaf9('0x5a')]=function(_0x19ebf9,_0x17bbe4,_0x1fb83e){var _0x23d448={'agent':{},'channel':'sms'};if(_0x19ebf9[_0xfaf9('0x57')]['id']){delete _0x19ebf9[_0xfaf9('0x57')]['id'];}_0x19ebf9[_0xfaf9('0x57')][_0xfaf9('0x5b')]=!![];_0x19ebf9['body'][_0xfaf9('0x5c')]=moment()[_0xfaf9('0x5d')](_0xfaf9('0x5e'));_0x19ebf9[_0xfaf9('0x57')][_0xfaf9('0x5f')]=_0x19ebf9[_0xfaf9('0x57')][_0xfaf9('0x5f')]||_0x19ebf9[_0xfaf9('0x60')]['id'];_0x23d448['agent']['id']=_0x19ebf9[_0xfaf9('0x57')]['UserId'];return db[_0xfaf9('0x3b')][_0xfaf9('0x55')]({'where':{'id':_0x19ebf9['params']['id'],'UserId':null}})[_0xfaf9('0x1d')](handleEntityNotFound(_0x17bbe4,null))[_0xfaf9('0x1d')](saveUpdates(_0x19ebf9[_0xfaf9('0x57')],null))[_0xfaf9('0x1d')](function(_0x40a423){if(_0x40a423){_0x23d448[_0xfaf9('0x24')]=_0x40a423[_0xfaf9('0x61')]({'plain':!![]});return db['SmsInteraction'][_0xfaf9('0x55')]({'where':{'id':_0x40a423[_0xfaf9('0x62')]}});}return null;})['then'](handleEntityNotFound(_0x17bbe4,null))[_0xfaf9('0x1d')](function(_0x2e74e7){if(_0x2e74e7){return _0x2e74e7[_0xfaf9('0x35')]({'UserId':_0x19ebf9[_0xfaf9('0x57')][_0xfaf9('0x5f')],'read1stAt':_[_0xfaf9('0x63')](_0x2e74e7[_0xfaf9('0x64')])?moment()[_0xfaf9('0x5d')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xfaf9('0x1d')](function(_0x140e21){if(_0x140e21){_0x23d448[_0xfaf9('0x65')]=_0x140e21[_0xfaf9('0x61')]({'plain':!![]});interaction_log[_0xfaf9('0x1e')](_0xfaf9('0x66'),_0x19ebf9['user']['id'],_0x19ebf9[_0xfaf9('0x60')]['name'],_0x19ebf9[_0xfaf9('0x60')][_0xfaf9('0x67')],_0x23d448[_0xfaf9('0x65')]['id'],_0x19ebf9[_0xfaf9('0x57')]?JSON[_0xfaf9('0x20')](_0x19ebf9[_0xfaf9('0x57')]):_0xfaf9('0x68'));return respondWithRpcPromise(_0xfaf9('0x69'),'acceptMessage',_0x23d448);}return null;})[_0xfaf9('0x1d')](function(_0x43a825){var _0x5724cb=_0xfaf9('0x6a')+_0x43a825['message'][_0xfaf9('0x6b')];return db[_0xfaf9('0x6c')][_0xfaf9('0x41')](_0x5724cb,{'type':db[_0xfaf9('0x6d')]['QueryTypes'][_0xfaf9('0x6e')],'raw':!![]})[_0xfaf9('0x1d')](function(_0x2c98f2){return _0x2c98f2;});})[_0xfaf9('0x1d')](function(_0x1368c4){if(_0x1368c4){_0x23d448['message'][_0xfaf9('0x6f')]=_0x1368c4[0x0];if(!_0x19ebf9[_0xfaf9('0x57')][_0xfaf9('0x5f')])return;return db['User'][_0xfaf9('0x55')]({'where':{'id':_0x19ebf9[_0xfaf9('0x57')][_0xfaf9('0x5f')],'role':_0xfaf9('0x70')},'attributes':['id','name',_0xfaf9('0x71'),'email','internal'],'raw':!![]});}return null;})['then'](function(_0x5d158b){if(!_0x5d158b)return null;_0x23d448['message']['agent']=_0x5d158b;return _0x23d448;})[_0xfaf9('0x1d')](function(_0x564490){if(_0x564490){if(_0x19ebf9[_0xfaf9('0x57')]['manual']){_0x23d448[_0xfaf9('0x24')][_0xfaf9('0x72')]=util[_0xfaf9('0x5d')](_0xfaf9('0x73'),_0x19ebf9[_0xfaf9('0x60')]['name']);_0x23d448[_0xfaf9('0x24')][_0xfaf9('0x74')]=_0x23d448[_0xfaf9('0x74')];_0x23d448['message'][_0xfaf9('0x75')]='accept';return respondWithRpcPromise(_0xfaf9('0x76'),_0xfaf9('0x76'),{'event':_0xfaf9('0x77'),'message':_0x23d448[_0xfaf9('0x24')]},client9002)[_0xfaf9('0x1d')](function(){return _0x23d448;});}return _0x23d448;}return null;})[_0xfaf9('0x1d')](respondWithResult(_0x17bbe4,null))[_0xfaf9('0x27')](handleError(_0x17bbe4,null));};var interaction_log=require(_0xfaf9('0x12'))('sms-interactions');exports['reject']=function(_0x707c03,_0x1af65e,_0x15a053){var _0x5df79={'agent':{},'channel':_0xfaf9('0x78')};if(_0x707c03['body']['id']){delete _0x707c03[_0xfaf9('0x57')]['id'];}_0x707c03[_0xfaf9('0x57')]['UserId']=_0x707c03['body'][_0xfaf9('0x5f')]||_0x707c03[_0xfaf9('0x60')]['id'];_0x5df79[_0xfaf9('0x70')]['id']=_0x707c03[_0xfaf9('0x57')][_0xfaf9('0x5f')];return db[_0xfaf9('0x3b')]['find']({'where':{'id':_0x707c03[_0xfaf9('0x53')]['id'],'UserId':null}})[_0xfaf9('0x1d')](handleEntityNotFound(_0x1af65e,null))['then'](function(_0x2a43f2){if(_0x2a43f2){_0x5df79['message']=_0x2a43f2['get']({'plain':!![]});return db[_0xfaf9('0x79')][_0xfaf9('0x55')]({'where':{'id':_0x2a43f2[_0xfaf9('0x62')]}});}return null;})[_0xfaf9('0x1d')](handleEntityNotFound(_0x1af65e,null))['then'](function(_0x3d5a03){if(_0x3d5a03){_0x5df79[_0xfaf9('0x65')]=_0x3d5a03[_0xfaf9('0x61')]({'plain':!![]});interaction_log[_0xfaf9('0x1e')](_0xfaf9('0x7a'),_0x707c03[_0xfaf9('0x60')]['id'],_0x707c03['user'][_0xfaf9('0x38')],_0x707c03[_0xfaf9('0x60')][_0xfaf9('0x67')],_0x5df79[_0xfaf9('0x65')]['id'],_0x707c03[_0xfaf9('0x57')]?JSON['stringify'](_0x707c03[_0xfaf9('0x57')]):'null');return respondWithRpcPromise(_0xfaf9('0x7b'),'rejectMessage',_0x5df79);}return null;})[_0xfaf9('0x1d')](function(_0x61e686){var _0x12931e=_0xfaf9('0x6a')+_0x61e686['message'][_0xfaf9('0x6b')];return db[_0xfaf9('0x6c')][_0xfaf9('0x41')](_0x12931e,{'type':db[_0xfaf9('0x6d')][_0xfaf9('0x7c')][_0xfaf9('0x6e')],'raw':!![]})[_0xfaf9('0x1d')](function(_0x56ec33){return _0x56ec33;});})[_0xfaf9('0x1d')](function(_0x26fb7e){if(_0x26fb7e){_0x5df79[_0xfaf9('0x24')][_0xfaf9('0x6f')]=_0x26fb7e[0x0];if(!_0x707c03[_0xfaf9('0x57')][_0xfaf9('0x5f')])return;return db['User'][_0xfaf9('0x55')]({'where':{'id':_0x707c03[_0xfaf9('0x57')][_0xfaf9('0x5f')],'role':_0xfaf9('0x70')},'attributes':['id',_0xfaf9('0x38'),_0xfaf9('0x71'),_0xfaf9('0x7d'),_0xfaf9('0x7e')],'raw':!![]});}return null;})['then'](function(_0x446240){if(!_0x446240)return null;_0x5df79[_0xfaf9('0x24')][_0xfaf9('0x70')]=_0x446240;return _0x5df79;})[_0xfaf9('0x1d')](function(_0x236180){if(_0x236180){_0x236180[_0xfaf9('0x24')][_0xfaf9('0x72')]=util[_0xfaf9('0x5d')](_0xfaf9('0x73'),_0x707c03['user'][_0xfaf9('0x38')]);_0x236180[_0xfaf9('0x24')][_0xfaf9('0x74')]=_0x5df79[_0xfaf9('0x74')];_0x236180['message'][_0xfaf9('0x75')]=_0xfaf9('0x33');respondWithRpcPromise(_0xfaf9('0x76'),_0xfaf9('0x76'),{'event':_0xfaf9('0x7f'),'message':_0x236180[_0xfaf9('0x24')]},client9002);return _0x5df79;}return null;})['then'](respondWithResult(_0x1af65e,null))[_0xfaf9('0x27')](handleError(_0x1af65e,null));};exports[_0xfaf9('0x29')]=function(_0x163ace,_0xc4b437,_0x506282){if(_0x163ace[_0xfaf9('0x57')]['id']){delete _0x163ace[_0xfaf9('0x57')]['id'];}var _0x8f99cc;return db[_0xfaf9('0x3b')][_0xfaf9('0x55')]({'where':{'id':_0x163ace[_0xfaf9('0x53')]['id']}})[_0xfaf9('0x1d')](handleEntityNotFound(_0xc4b437,null))[_0xfaf9('0x1d')](function(_0x48e9fc){if(_0x48e9fc){_0x8f99cc=_0x48e9fc;return db[_0xfaf9('0x80')][_0xfaf9('0x55')]({'where':{'id':_0x48e9fc[_0xfaf9('0x81')]}});}})[_0xfaf9('0x1d')](handleEntityNotFound(_0xc4b437,null))[_0xfaf9('0x1d')](function(_0x3f311a){if(_0x3f311a){logger[_0xfaf9('0x82')](_0xfaf9('0x1f'),'status','received\x20delivery\x20report\x20from',_0x3f311a['type'],util[_0xfaf9('0x83')](_0x163ace[_0xfaf9('0x57')],{'showHidden':![],'depth':null}));switch(_0x3f311a[_0xfaf9('0x3e')]){case _0xfaf9('0x84'):if(_0x163ace[_0xfaf9('0x57')]['MessageSid']&&_0x163ace[_0xfaf9('0x57')]['MessageSid']===_0x8f99cc[_0xfaf9('0x85')]){return _0x8f99cc[_0xfaf9('0x35')]({'read':!![]});}else{logger[_0xfaf9('0x21')](_0xfaf9('0x86'),'status','twilio',util[_0xfaf9('0x83')](_0x163ace['body'],{'showHidden':![],'depth':null}));}break;case _0xfaf9('0x87'):if(_0x163ace[_0xfaf9('0x57')][_0xfaf9('0x88')]&&_0x163ace[_0xfaf9('0x57')]['MessageUUID']===_0x8f99cc[_0xfaf9('0x85')]&&_['indexOf']([_0xfaf9('0x89'),_0xfaf9('0x8a')],_0x163ace[_0xfaf9('0x57')][_0xfaf9('0x8b')])>=0x0){return _0x8f99cc[_0xfaf9('0x35')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xfaf9('0x29'),_0xfaf9('0x8c'),util[_0xfaf9('0x83')](_0x163ace[_0xfaf9('0x57')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x5d829d=_0x163ace['body'][_0xfaf9('0x8d')][0x0];if(_0x5d829d[_0xfaf9('0x29')][_0xfaf9('0x8e')]==='DELIVERED'){return _0x8f99cc[_0xfaf9('0x35')]({'read':!![]});}else{logger[_0xfaf9('0x21')](_0xfaf9('0x86'),_0xfaf9('0x29'),_0xfaf9('0x8f'),util[_0xfaf9('0x83')](_0x163ace[_0xfaf9('0x57')],{'showHidden':![],'depth':null}));}break;}return _0x8f99cc;}})[_0xfaf9('0x1d')](respondWithResult(_0xc4b437,null))[_0xfaf9('0x27')](handleError(_0xc4b437,null));}; \ No newline at end of file +var _0x429b=['accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','SELECT','contact','User','email','internal','manual','channel','EventManager','acceptmessage','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','fullname','interface','SIP/%s','event','SmsAccount','debug','SmsMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','twilio','MessageSid','SmsAccount,\x20%s,\x20%s,\x20%s','inspect','plivo','MessageUUID','messageId','indexOf','sent','delivered','Status','plivio','groupName','DELIVERED','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','request','then','SmsMessage,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','stack','name','send','index','map','rawAttributes','fieldName','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','SmsMessage','include','findAll','rows','catch','show','params','create','body','find','destroy','describe','../../config/logger','sms-interactions'];(function(_0x569a2d,_0x721cfb){var _0x5a4623=function(_0x11e343){while(--_0x11e343){_0x569a2d['push'](_0x569a2d['shift']());}};_0x5a4623(++_0x721cfb);}(_0x429b,0x15b));var _0xb429=function(_0x51f96c,_0x15dd22){_0x51f96c=_0x51f96c-0x0;var _0x249930=_0x429b[_0x51f96c];return _0x249930;};'use strict';var emlformat=require(_0xb429('0x0'));var rimraf=require(_0xb429('0x1'));var zipdir=require(_0xb429('0x2'));var jsonpatch=require(_0xb429('0x3'));var rp=require('request-promise');var moment=require(_0xb429('0x4'));var BPromise=require(_0xb429('0x5'));var Mustache=require(_0xb429('0x6'));var util=require('util');var path=require(_0xb429('0x7'));var sox=require('sox');var csv=require(_0xb429('0x8'));var ejs=require(_0xb429('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb429('0xa'));var squel=require(_0xb429('0xb'));var crypto=require('crypto');var jsforce=require(_0xb429('0xc'));var deskjs=require(_0xb429('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb429('0xe'));var Papa=require('papaparse');var Redis=require(_0xb429('0xf'));var authService=require(_0xb429('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xb429('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb429('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb429('0x13'));var db=require(_0xb429('0x14'))['db'];config['redis']=_[_0xb429('0x15')](config[_0xb429('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xb429('0x17'))(new Redis(config[_0xb429('0x16')]));require(_0xb429('0x18'))[_0xb429('0x19')](socket);var jayson=require(_0xb429('0x1a'));var client=jayson[_0xb429('0x1b')][_0xb429('0x1c')]({'port':0x232c});var client9002=jayson[_0xb429('0x1b')][_0xb429('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x24ae05,_0x15f2dc,_0x9cc7d1,_0x1712b5){return new BPromise(function(_0x46854c,_0x5841dd){var _0x500798=_0x1712b5||client;return _0x500798[_0xb429('0x1d')](_0x24ae05,_0x9cc7d1)[_0xb429('0x1e')](function(_0x25409a){logger['info'](_0xb429('0x1f'),_0x15f2dc,_0xb429('0x20'));logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x15f2dc,_0xb429('0x20'),JSON[_0xb429('0x21')](_0x25409a));if(_0x25409a[_0xb429('0x22')]){if(_0x25409a[_0xb429('0x22')]['code']===0x1f4){logger[_0xb429('0x22')](_0xb429('0x1f'),_0x15f2dc,_0x25409a[_0xb429('0x22')][_0xb429('0x23')]);return _0x5841dd(_0x25409a[_0xb429('0x22')][_0xb429('0x23')]);}logger[_0xb429('0x22')](_0xb429('0x1f'),_0x15f2dc,_0x25409a[_0xb429('0x22')]['message']);return _0x46854c(_0x25409a[_0xb429('0x22')]['message']);}else{logger[_0xb429('0x24')](_0xb429('0x1f'),_0x15f2dc,'request\x20sent');_0x46854c(_0x25409a[_0xb429('0x25')]['message']);}})['catch'](function(_0x26b3ea){logger[_0xb429('0x22')](_0xb429('0x1f'),_0x15f2dc,_0x26b3ea);_0x5841dd(_0x26b3ea);});});}function respondWithStatusCode(_0x45937b,_0x4d37f7){_0x4d37f7=_0x4d37f7||0xcc;return function(_0x13f0be){if(_0x13f0be){return _0x45937b[_0xb429('0x26')](_0x4d37f7);}return _0x45937b[_0xb429('0x27')](_0x4d37f7)[_0xb429('0x28')]();};}function respondWithResult(_0x1fee75,_0x16f062){_0x16f062=_0x16f062||0xc8;return function(_0x1ae62e){if(_0x1ae62e){return _0x1fee75[_0xb429('0x27')](_0x16f062)[_0xb429('0x29')](_0x1ae62e);}};}function respondWithFilteredResult(_0x2fd479,_0x531f53){return function(_0x3592f5){if(_0x3592f5){var _0x30cc45=typeof _0x531f53['offset']===_0xb429('0x2a')&&typeof _0x531f53[_0xb429('0x2b')]===_0xb429('0x2a');var _0x1aeff3=_0x3592f5[_0xb429('0x2c')];var _0x109b7e=_0x30cc45?0x0:_0x531f53[_0xb429('0x2d')];var _0x2befa0=_0x30cc45?_0x3592f5[_0xb429('0x2c')]:_0x531f53['offset']+_0x531f53[_0xb429('0x2b')];var _0x37463a;if(_0x2befa0>=_0x1aeff3){_0x2befa0=_0x1aeff3;_0x37463a=0xc8;}else{_0x37463a=0xce;}_0x2fd479[_0xb429('0x27')](_0x37463a);return _0x2fd479[_0xb429('0x2e')]('Content-Range',_0x109b7e+'-'+_0x2befa0+'/'+_0x1aeff3)['json'](_0x3592f5);}return null;};}function patchUpdates(_0x209c84){return function(_0xbc0c25){try{jsonpatch[_0xb429('0x2f')](_0xbc0c25,_0x209c84,!![]);}catch(_0xfc6aea){return BPromise[_0xb429('0x30')](_0xfc6aea);}return _0xbc0c25[_0xb429('0x31')]();};}function saveUpdates(_0x4a5ac0,_0x126b1b){return function(_0x338a07){if(_0x338a07){return _0x338a07[_0xb429('0x32')](_0x4a5ac0)[_0xb429('0x1e')](function(_0x848223){return _0x848223;});}return null;};}function removeEntity(_0x16c191,_0x582da8){return function(_0x2b0bb5){if(_0x2b0bb5){return _0x2b0bb5['destroy']()['then'](function(){_0x16c191[_0xb429('0x27')](0xcc)[_0xb429('0x28')]();});}};}function handleEntityNotFound(_0x17df72,_0xd5b35e){return function(_0x361f58){if(!_0x361f58){_0x17df72[_0xb429('0x26')](0x194);}return _0x361f58;};}function handleError(_0x3401c8,_0x17d737){_0x17d737=_0x17d737||0x1f4;return function(_0x441a82){logger[_0xb429('0x22')](_0x441a82[_0xb429('0x33')]);if(_0x441a82[_0xb429('0x34')]){delete _0x441a82[_0xb429('0x34')];}_0x3401c8[_0xb429('0x27')](_0x17d737)[_0xb429('0x35')](_0x441a82);};}exports[_0xb429('0x36')]=function(_0x363d53,_0x4d930d){var _0x5e3680={},_0x35a63e={},_0x2b3c26={'count':0x0,'rows':[]};var _0x23ceb7=_[_0xb429('0x37')](db['SmsMessage'][_0xb429('0x38')],function(_0x48c649){return{'name':_0x48c649[_0xb429('0x39')],'type':_0x48c649['type']['key']};});_0x35a63e['model']=_[_0xb429('0x37')](_0x23ceb7,'name');_0x35a63e[_0xb429('0x3a')]=_[_0xb429('0x3b')](_0x363d53[_0xb429('0x3a')]);_0x35a63e['filters']=_[_0xb429('0x3c')](_0x35a63e[_0xb429('0x3d')],_0x35a63e[_0xb429('0x3a')]);_0x5e3680[_0xb429('0x3e')]=_[_0xb429('0x3c')](_0x35a63e['model'],qs[_0xb429('0x3f')](_0x363d53[_0xb429('0x3a')][_0xb429('0x3f')]));_0x5e3680[_0xb429('0x3e')]=_0x5e3680['attributes'][_0xb429('0x40')]?_0x5e3680[_0xb429('0x3e')]:_0x35a63e[_0xb429('0x3d')];if(!_0x363d53[_0xb429('0x3a')][_0xb429('0x41')]('nolimit')){_0x5e3680['limit']=qs[_0xb429('0x2b')](_0x363d53[_0xb429('0x3a')][_0xb429('0x2b')]);_0x5e3680[_0xb429('0x2d')]=qs[_0xb429('0x2d')](_0x363d53[_0xb429('0x3a')][_0xb429('0x2d')]);}_0x5e3680[_0xb429('0x42')]=qs['sort'](_0x363d53[_0xb429('0x3a')][_0xb429('0x43')]);_0x5e3680[_0xb429('0x44')]=qs[_0xb429('0x45')](_[_0xb429('0x46')](_0x363d53[_0xb429('0x3a')],_0x35a63e['filters']),_0x23ceb7);if(_0x363d53[_0xb429('0x3a')][_0xb429('0x47')]){_0x5e3680[_0xb429('0x44')]=_[_0xb429('0x48')](_0x5e3680[_0xb429('0x44')],{'$or':_['map'](_0x23ceb7,function(_0x535ac3){if(_0x535ac3[_0xb429('0x49')]!=='VIRTUAL'){var _0x5ee0bd={};_0x5ee0bd[_0x535ac3[_0xb429('0x34')]]={'$like':'%'+_0x363d53[_0xb429('0x3a')][_0xb429('0x47')]+'%'};return _0x5ee0bd;}})});}_0x5e3680=_[_0xb429('0x48')]({},_0x5e3680,_0x363d53['options']);var _0x51dfbe={'where':_0x5e3680[_0xb429('0x44')]};return db[_0xb429('0x4a')][_0xb429('0x2c')](_0x51dfbe)[_0xb429('0x1e')](function(_0x15b48d){_0x2b3c26['count']=_0x15b48d;if(_0x363d53[_0xb429('0x3a')]['includeAll']){_0x5e3680[_0xb429('0x4b')]=[{'all':!![]}];}return db[_0xb429('0x4a')][_0xb429('0x4c')](_0x5e3680);})[_0xb429('0x1e')](function(_0x5ed2ac){_0x2b3c26[_0xb429('0x4d')]=_0x5ed2ac;return _0x2b3c26;})[_0xb429('0x1e')](respondWithFilteredResult(_0x4d930d,_0x5e3680))[_0xb429('0x4e')](handleError(_0x4d930d,null));};exports[_0xb429('0x4f')]=function(_0x3f3a8d,_0x3f36a6){var _0x14880a={'raw':!![],'where':{'id':_0x3f3a8d[_0xb429('0x50')]['id']}},_0x2b2e3e={};_0x2b2e3e[_0xb429('0x3d')]=_[_0xb429('0x3b')](db[_0xb429('0x4a')]['rawAttributes']);_0x2b2e3e['query']=_[_0xb429('0x3b')](_0x3f3a8d[_0xb429('0x3a')]);_0x2b2e3e[_0xb429('0x45')]=_['intersection'](_0x2b2e3e[_0xb429('0x3d')],_0x2b2e3e['query']);_0x14880a[_0xb429('0x3e')]=_[_0xb429('0x3c')](_0x2b2e3e[_0xb429('0x3d')],qs[_0xb429('0x3f')](_0x3f3a8d['query']['fields']));_0x14880a[_0xb429('0x3e')]=_0x14880a[_0xb429('0x3e')]['length']?_0x14880a['attributes']:_0x2b2e3e[_0xb429('0x3d')];if(_0x3f3a8d[_0xb429('0x3a')]['includeAll']){_0x14880a[_0xb429('0x4b')]=[{'all':!![]}];}_0x14880a=_[_0xb429('0x48')]({},_0x14880a,_0x3f3a8d['options']);return db['SmsMessage']['find'](_0x14880a)['then'](handleEntityNotFound(_0x3f36a6,null))[_0xb429('0x1e')](respondWithResult(_0x3f36a6,null))['catch'](handleError(_0x3f36a6,null));};exports[_0xb429('0x51')]=function(_0x2de273,_0x2e125d){return db[_0xb429('0x4a')][_0xb429('0x51')](_0x2de273[_0xb429('0x52')],{})[_0xb429('0x1e')](respondWithResult(_0x2e125d,0xc9))[_0xb429('0x4e')](handleError(_0x2e125d,null));};exports[_0xb429('0x32')]=function(_0x139bd6,_0x2e9138){if(_0x139bd6['body']['id']){delete _0x139bd6[_0xb429('0x52')]['id'];}return db[_0xb429('0x4a')][_0xb429('0x53')]({'where':{'id':_0x139bd6['params']['id']}})['then'](handleEntityNotFound(_0x2e9138,null))[_0xb429('0x1e')](saveUpdates(_0x139bd6['body'],null))[_0xb429('0x1e')](respondWithResult(_0x2e9138,null))[_0xb429('0x4e')](handleError(_0x2e9138,null));};exports[_0xb429('0x54')]=function(_0x5ecc4e,_0x2e3a03){return db[_0xb429('0x4a')][_0xb429('0x53')]({'where':{'id':_0x5ecc4e['params']['id']}})[_0xb429('0x1e')](handleEntityNotFound(_0x2e3a03,null))[_0xb429('0x1e')](removeEntity(_0x2e3a03,null))['catch'](handleError(_0x2e3a03,null));};exports[_0xb429('0x55')]=function(_0x6013e9,_0x1f8b0f){return db[_0xb429('0x4a')][_0xb429('0x55')]()[_0xb429('0x1e')](respondWithResult(_0x1f8b0f,null))[_0xb429('0x4e')](handleError(_0x1f8b0f,null));};var interaction_log=require(_0xb429('0x56'))(_0xb429('0x57'));exports[_0xb429('0x58')]=function(_0xf42044,_0x21013c,_0x5e3a47){var _0x169411={'agent':{},'channel':_0xb429('0x59')};if(_0xf42044['body']['id']){delete _0xf42044[_0xb429('0x52')]['id'];}_0xf42044[_0xb429('0x52')][_0xb429('0x5a')]=!![];_0xf42044['body'][_0xb429('0x5b')]=moment()[_0xb429('0x5c')](_0xb429('0x5d'));_0xf42044[_0xb429('0x52')][_0xb429('0x5e')]=_0xf42044['body']['UserId']||_0xf42044['user']['id'];_0x169411[_0xb429('0x5f')]['id']=_0xf42044[_0xb429('0x52')][_0xb429('0x5e')];return db[_0xb429('0x4a')]['find']({'where':{'id':_0xf42044[_0xb429('0x50')]['id'],'UserId':null}})[_0xb429('0x1e')](handleEntityNotFound(_0x21013c,null))[_0xb429('0x1e')](saveUpdates(_0xf42044[_0xb429('0x52')],null))[_0xb429('0x1e')](function(_0x5d9d1b){if(_0x5d9d1b){_0x169411[_0xb429('0x23')]=_0x5d9d1b[_0xb429('0x60')]({'plain':!![]});return db[_0xb429('0x61')][_0xb429('0x53')]({'where':{'id':_0x5d9d1b[_0xb429('0x62')]}});}return null;})[_0xb429('0x1e')](handleEntityNotFound(_0x21013c,null))[_0xb429('0x1e')](function(_0x1d67e3){if(_0x1d67e3){return _0x1d67e3['update']({'UserId':_0xf42044[_0xb429('0x52')]['UserId'],'read1stAt':_[_0xb429('0x63')](_0x1d67e3[_0xb429('0x64')])?moment()[_0xb429('0x5c')](_0xb429('0x5d')):undefined});}return null;})[_0xb429('0x1e')](function(_0x216341){if(_0x216341){_0x169411['interaction']=_0x216341[_0xb429('0x60')]({'plain':!![]});interaction_log[_0xb429('0x24')](_0xb429('0x65'),_0xf42044[_0xb429('0x66')]['id'],_0xf42044[_0xb429('0x66')][_0xb429('0x34')],_0xf42044[_0xb429('0x66')][_0xb429('0x67')],_0x169411[_0xb429('0x68')]['id'],_0xf42044[_0xb429('0x52')]?JSON[_0xb429('0x21')](_0xf42044['body']):'null');return respondWithRpcPromise(_0xb429('0x69'),_0xb429('0x6a'),_0x169411);}return null;})[_0xb429('0x1e')](function(_0x24cb42){var _0x1d07e4=_0xb429('0x6b')+_0x24cb42['message']['ContactId'];return db[_0xb429('0x6c')]['query'](_0x1d07e4,{'type':db[_0xb429('0x6d')]['QueryTypes'][_0xb429('0x6e')],'raw':!![]})[_0xb429('0x1e')](function(_0x30e6b3){return _0x30e6b3;});})[_0xb429('0x1e')](function(_0x48bf49){if(_0x48bf49){_0x169411[_0xb429('0x23')][_0xb429('0x6f')]=_0x48bf49[0x0];if(!_0xf42044[_0xb429('0x52')][_0xb429('0x5e')])return;return db[_0xb429('0x70')][_0xb429('0x53')]({'where':{'id':_0xf42044['body'][_0xb429('0x5e')],'role':_0xb429('0x5f')},'attributes':['id',_0xb429('0x34'),'fullname',_0xb429('0x71'),_0xb429('0x72')],'raw':!![]});}return null;})[_0xb429('0x1e')](function(_0x5d17d4){if(!_0x5d17d4)return null;_0x169411['message'][_0xb429('0x5f')]=_0x5d17d4;return _0x169411;})['then'](function(_0xe29b74){if(_0xe29b74){if(_0xf42044[_0xb429('0x52')][_0xb429('0x73')]){_0x169411['message']['interface']=util['format']('SIP/%s',_0xf42044[_0xb429('0x66')][_0xb429('0x34')]);_0x169411[_0xb429('0x23')][_0xb429('0x74')]=_0x169411[_0xb429('0x74')];_0x169411['message']['event']=_0xb429('0x58');return respondWithRpcPromise(_0xb429('0x75'),_0xb429('0x75'),{'event':_0xb429('0x76'),'message':_0x169411[_0xb429('0x23')]},client9002)[_0xb429('0x1e')](function(){return _0x169411;});}return _0x169411;}return null;})[_0xb429('0x1e')](respondWithResult(_0x21013c,null))['catch'](handleError(_0x21013c,null));};var interaction_log=require(_0xb429('0x56'))(_0xb429('0x57'));exports[_0xb429('0x30')]=function(_0x1ba699,_0x4a40fd,_0x1324ba){var _0x27d225={'agent':{},'channel':_0xb429('0x59')};if(_0x1ba699[_0xb429('0x52')]['id']){delete _0x1ba699['body']['id'];}_0x1ba699[_0xb429('0x52')][_0xb429('0x5e')]=_0x1ba699[_0xb429('0x52')]['UserId']||_0x1ba699['user']['id'];_0x27d225[_0xb429('0x5f')]['id']=_0x1ba699[_0xb429('0x52')][_0xb429('0x5e')];return db[_0xb429('0x4a')][_0xb429('0x53')]({'where':{'id':_0x1ba699['params']['id'],'UserId':null}})[_0xb429('0x1e')](handleEntityNotFound(_0x4a40fd,null))[_0xb429('0x1e')](function(_0x4fa0f7){if(_0x4fa0f7){_0x27d225[_0xb429('0x23')]=_0x4fa0f7[_0xb429('0x60')]({'plain':!![]});return db[_0xb429('0x61')]['find']({'where':{'id':_0x4fa0f7[_0xb429('0x62')]}});}return null;})[_0xb429('0x1e')](handleEntityNotFound(_0x4a40fd,null))[_0xb429('0x1e')](function(_0x34201c){if(_0x34201c){_0x27d225[_0xb429('0x68')]=_0x34201c[_0xb429('0x60')]({'plain':!![]});interaction_log[_0xb429('0x24')](_0xb429('0x77'),_0x1ba699['user']['id'],_0x1ba699['user'][_0xb429('0x34')],_0x1ba699[_0xb429('0x66')]['role'],_0x27d225[_0xb429('0x68')]['id'],_0x1ba699[_0xb429('0x52')]?JSON[_0xb429('0x21')](_0x1ba699['body']):_0xb429('0x78'));return respondWithRpcPromise(_0xb429('0x79'),_0xb429('0x7a'),_0x27d225);}return null;})[_0xb429('0x1e')](function(_0x138efb){var _0x3bcc4b=_0xb429('0x6b')+_0x138efb[_0xb429('0x23')]['ContactId'];return db[_0xb429('0x6c')][_0xb429('0x3a')](_0x3bcc4b,{'type':db['Sequelize']['QueryTypes'][_0xb429('0x6e')],'raw':!![]})[_0xb429('0x1e')](function(_0x170c61){return _0x170c61;});})['then'](function(_0x139b14){if(_0x139b14){_0x27d225[_0xb429('0x23')][_0xb429('0x6f')]=_0x139b14[0x0];if(!_0x1ba699[_0xb429('0x52')]['UserId'])return;return db[_0xb429('0x70')][_0xb429('0x53')]({'where':{'id':_0x1ba699[_0xb429('0x52')][_0xb429('0x5e')],'role':_0xb429('0x5f')},'attributes':['id',_0xb429('0x34'),_0xb429('0x7b'),_0xb429('0x71'),_0xb429('0x72')],'raw':!![]});}return null;})[_0xb429('0x1e')](function(_0x2b4509){if(!_0x2b4509)return null;_0x27d225['message'][_0xb429('0x5f')]=_0x2b4509;return _0x27d225;})[_0xb429('0x1e')](function(_0x1ef4a4){if(_0x1ef4a4){_0x1ef4a4['message'][_0xb429('0x7c')]=util[_0xb429('0x5c')](_0xb429('0x7d'),_0x1ba699[_0xb429('0x66')]['name']);_0x1ef4a4[_0xb429('0x23')]['channel']=_0x27d225[_0xb429('0x74')];_0x1ef4a4['message'][_0xb429('0x7e')]=_0xb429('0x30');respondWithRpcPromise('EventManager','EventManager',{'event':'rejectmessage','message':_0x1ef4a4['message']},client9002);return _0x27d225;}return null;})['then'](respondWithResult(_0x4a40fd,null))['catch'](handleError(_0x4a40fd,null));};exports['status']=function(_0x105a21,_0x2d487d,_0x1bd3c8){if(_0x105a21[_0xb429('0x52')]['id']){delete _0x105a21[_0xb429('0x52')]['id'];}var _0x2fd8e1;return db['SmsMessage']['find']({'where':{'id':_0x105a21[_0xb429('0x50')]['id']}})[_0xb429('0x1e')](handleEntityNotFound(_0x2d487d,null))['then'](function(_0x34d847){if(_0x34d847){_0x2fd8e1=_0x34d847;return db[_0xb429('0x7f')]['find']({'where':{'id':_0x34d847['SmsAccountId']}});}})[_0xb429('0x1e')](handleEntityNotFound(_0x2d487d,null))[_0xb429('0x1e')](function(_0x37608a){if(_0x37608a){logger[_0xb429('0x80')](_0xb429('0x81'),_0xb429('0x27'),_0xb429('0x82'),_0x37608a[_0xb429('0x49')],util['inspect'](_0x105a21[_0xb429('0x52')],{'showHidden':![],'depth':null}));switch(_0x37608a[_0xb429('0x49')]){case _0xb429('0x83'):if(_0x105a21[_0xb429('0x52')]['MessageSid']&&_0x105a21[_0xb429('0x52')][_0xb429('0x84')]===_0x2fd8e1['messageId']){return _0x2fd8e1[_0xb429('0x32')]({'read':!![]});}else{logger[_0xb429('0x22')](_0xb429('0x85'),_0xb429('0x27'),_0xb429('0x83'),util[_0xb429('0x86')](_0x105a21[_0xb429('0x52')],{'showHidden':![],'depth':null}));}break;case _0xb429('0x87'):if(_0x105a21[_0xb429('0x52')][_0xb429('0x88')]&&_0x105a21[_0xb429('0x52')][_0xb429('0x88')]===_0x2fd8e1[_0xb429('0x89')]&&_[_0xb429('0x8a')]([_0xb429('0x8b'),_0xb429('0x8c')],_0x105a21[_0xb429('0x52')][_0xb429('0x8d')])>=0x0){return _0x2fd8e1[_0xb429('0x32')]({'read':!![]});}else{logger[_0xb429('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xb429('0x27'),_0xb429('0x8e'),util[_0xb429('0x86')](_0x105a21['body'],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x30e9d3=_0x105a21['body']['results'][0x0];if(_0x30e9d3[_0xb429('0x27')][_0xb429('0x8f')]===_0xb429('0x90')){return _0x2fd8e1[_0xb429('0x32')]({'read':!![]});}else{logger[_0xb429('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xb429('0x27'),'infobip',util[_0xb429('0x86')](_0x105a21[_0xb429('0x52')],{'showHidden':![],'depth':null}));}break;}return _0x2fd8e1;}})[_0xb429('0x1e')](respondWithResult(_0x2d487d,null))['catch'](handleError(_0x2d487d,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 4cad878..020936b 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 _0xd39e=['../../mysqldb','save','remove','emit','hasOwnProperty','hook','events'];(function(_0x40cef6,_0x4874de){var _0x3ad583=function(_0x2daeb6){while(--_0x2daeb6){_0x40cef6['push'](_0x40cef6['shift']());}};_0x3ad583(++_0x4874de);}(_0xd39e,0x1b1));var _0xed39=function(_0x5326df,_0x4babd6){_0x5326df=_0x5326df-0x0;var _0x6a86fd=_0xd39e[_0x5326df];return _0x6a86fd;};'use strict';var EventEmitter=require(_0xed39('0x0'));var SmsMessage=require(_0xed39('0x1'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xed39('0x2'),'afterUpdate':'update','afterDestroy':_0xed39('0x3')};function emitEvent(_0x4a9c9a){return function(_0x7c82dd,_0x35b5b,_0x4ee2b6){SmsMessageEvents[_0xed39('0x4')](_0x4a9c9a+':'+_0x7c82dd['id'],_0x7c82dd);SmsMessageEvents[_0xed39('0x4')](_0x4a9c9a,_0x7c82dd);_0x4ee2b6(null);};}for(var e in events){if(events[_0xed39('0x5')](e)){var event=events[e];SmsMessage[_0xed39('0x6')](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file +var _0x97d6=['exports','events','../../mysqldb','SmsMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x203983,_0x34d62e){var _0x212285=function(_0x22147e){while(--_0x22147e){_0x203983['push'](_0x203983['shift']());}};_0x212285(++_0x34d62e);}(_0x97d6,0x12a));var _0x697d=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0x97d6[_0x4bfac3];return _0x15f0f2;};'use strict';var EventEmitter=require(_0x697d('0x0'));var SmsMessage=require(_0x697d('0x1'))['db'][_0x697d('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x697d('0x3')](0x0);var events={'afterCreate':_0x697d('0x4'),'afterUpdate':_0x697d('0x5'),'afterDestroy':_0x697d('0x6')};function emitEvent(_0x3d5532){return function(_0x1baead,_0xda2feb,_0x2fae8b){SmsMessageEvents[_0x697d('0x7')](_0x3d5532+':'+_0x1baead['id'],_0x1baead);SmsMessageEvents[_0x697d('0x7')](_0x3d5532,_0x1baead);_0x2fae8b(null);};}for(var e in events){if(events[_0x697d('0x8')](e)){var event=events[e];SmsMessage[_0x697d('0x9')](e,emitEvent(event));}}module[_0x697d('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 6a62d8a..facfd3b 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 _0x3c0d=['utf8mb4','utf8mb4_unicode_ci','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','exports','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','toLowerCase','direction','out','isNil','UserId','SmsInteraction','SmsInteractionId','then','update','createdAt','error','secret','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','messages','create','phone','/api/sms/messages/','/status?token=','inspect','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','https://api.skebby.it/API/v1.0/REST/','password','smsMethod','sender','login?username=','GET','split','sms','internal_order_id','deliveryReport','read','skebby','catch','SmsMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20username,\x20password','connectel','senderString','POST','https://smsapi.connectel.se/api/v2/send/','requestid','Missing\x20parameters:\x20authToken','xCALLY\x20Motion','format','%s:%s','username','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','queued_count','head','clickSend','plivo','authId','remote','token','https://api.plivo.com/v1/Account/%s/Message/','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','infobip','Missing\x20parameters:\x20base_url','crypto','apiKey','login','timestamp','sort','length','digest','signature=','/external/get/send.php?','keys','id_sms','csc','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','Bearer\x20','refid','status','Token\x20not\x20received'];(function(_0x36379a,_0x48921e){var _0x1c6ced=function(_0x1a2361){while(--_0x1a2361){_0x36379a['push'](_0x36379a['shift']());}};_0x1c6ced(++_0x48921e);}(_0x3c0d,0xf6));var _0xd3c0=function(_0x277c37,_0x4c92ba){_0x277c37=_0x277c37-0x0;var _0x1ac05d=_0x3c0d[_0x277c37];return _0x1ac05d;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xd3c0('0x0'));var moment=require(_0xd3c0('0x1'));var BPromise=require(_0xd3c0('0x2'));var rp=require(_0xd3c0('0x3'));var fs=require('fs');var path=require(_0xd3c0('0x4'));var rimraf=require(_0xd3c0('0x5'));var config=require(_0xd3c0('0x6'));var attributes=require(_0xd3c0('0x7'));module[_0xd3c0('0x8')]=function(_0x4d5cf1,_0x36ce7f){return _0x4d5cf1['define'](_0xd3c0('0x9'),attributes,{'tableName':_0xd3c0('0xa'),'paranoid':![],'indexes':[{'name':_0xd3c0('0xb'),'fields':[_0xd3c0('0xb')]},{'name':_0xd3c0('0xc'),'fields':[_0xd3c0('0xd')],'type':_0xd3c0('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3414ff,_0x1d8905,_0x281945){var _0x51e63b=_0x4d5cf1[_0xd3c0('0xf')];var _0x4152c1=_0x3414ff['get']({'plain':!![]});if(_0x4152c1['direction'][_0xd3c0('0x10')]()==='in'||_0x4152c1[_0xd3c0('0x11')][_0xd3c0('0x10')]()===_0xd3c0('0x12')&&!_0x4152c1['secret']&&!_[_0xd3c0('0x13')](_0x4152c1[_0xd3c0('0x14')])){_0x51e63b[_0xd3c0('0x15')]['findOne']({'where':{'id':_0x4152c1[_0xd3c0('0x16')]}})[_0xd3c0('0x17')](function(_0x1b6250){if(_0x1b6250){_0x1b6250[_0xd3c0('0x18')]({'lastMsgAt':_0x4152c1[_0xd3c0('0x19')],'lastMsgDirection':_0x4152c1[_0xd3c0('0x11')]['toLowerCase']()});}})['catch'](function(_0x36f41c){console[_0xd3c0('0x1a')](_0x36f41c);});}if(_0x4152c1['direction']===_0xd3c0('0x12')&&!_0x4152c1[_0xd3c0('0x1b')]){var _0xa25a3e;_0x51e63b[_0xd3c0('0x1c')][_0xd3c0('0x1d')]({'where':{'id':_0x4152c1[_0xd3c0('0x1e')]},'raw':!![]})[_0xd3c0('0x17')](function(_0x53584a){_0xa25a3e=_0x53584a;if(_0xa25a3e&&_0xa25a3e['type']){switch(_0xa25a3e[_0xd3c0('0x1f')]){case'twilio':var _0x38aad0=require(_0xd3c0('0x20'));if(_0xa25a3e[_0xd3c0('0x21')]&&_0xa25a3e[_0xd3c0('0x22')]&&_0xa25a3e['phone']){var _0x54af55=new _0x38aad0(_0xa25a3e[_0xd3c0('0x21')],_0xa25a3e[_0xd3c0('0x22')]);_0x54af55[_0xd3c0('0x23')][_0xd3c0('0x24')]({'body':_0x4152c1['body'],'to':_0x4152c1[_0xd3c0('0x25')],'from':_0xa25a3e['phone'],'statusCallback':_0xa25a3e['remote']+_0xd3c0('0x26')+_0x4152c1['id']+_0xd3c0('0x27')+_0xa25a3e['token']})[_0xd3c0('0x17')](function(_0x454e45){if(_0x454e45['sid']){return _0x3414ff[_0xd3c0('0x18')]({'messageId':_0x454e45['sid']});}})['catch'](function(_0x23e772){logger[_0xd3c0('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xd3c0('0x20'),util[_0xd3c0('0x28')](_0x23e772,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd3c0('0x29'),_0xd3c0('0x20'),_0xd3c0('0x2a'));}break;case'skebby':var _0x215bb1=_0xd3c0('0x2b');if(_0xa25a3e['username']&&_0xa25a3e[_0xd3c0('0x2c')]){var _0x149b6a={'recipient':[_0x4152c1[_0xd3c0('0x25')]],'message':_0x4152c1[_0xd3c0('0xd')],'message_type':_0xa25a3e[_0xd3c0('0x2d')]};if(_0xa25a3e['smsMethod']&&_0xa25a3e[_0xd3c0('0x2d')]!=='SI'){_0x149b6a[_0xd3c0('0x2e')]=_0xa25a3e['phone'];}var _0x446298={'url':_0x215bb1+_0xd3c0('0x2f')+_0xa25a3e['username']+'&password='+_0xa25a3e[_0xd3c0('0x2c')],'method':_0xd3c0('0x30')};rp(_0x446298)[_0xd3c0('0x17')](function(_0x403b60){var _0xd875f8=_0x403b60[_0xd3c0('0x31')](';');var _0x2794a1={'user_key':_0xd875f8[0x0],'session_key':_0xd875f8[0x1]};_0x446298={'url':_0x215bb1+_0xd3c0('0x32'),'method':'POST','headers':{'user_key':_0x2794a1['user_key'],'Session_key':_0x2794a1['session_key']},'json':!![],'body':_0x149b6a};return rp(_0x446298);})[_0xd3c0('0x17')](function(_0x506c02){if(_0x506c02['total_sent']>=0x1){var _0x44817b={'messageId':_0x506c02[_0xd3c0('0x33')]};if(_0xa25a3e[_0xd3c0('0x2d')]!=='GP'||!_0xa25a3e[_0xd3c0('0x34')]){_0x44817b[_0xd3c0('0x35')]=!![];}return _0x3414ff['update'](_0x44817b);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xd3c0('0x36'),util[_0xd3c0('0x28')](_0x506c02,{'showHidden':![],'depth':null}));}})[_0xd3c0('0x37')](function(_0xcc8302){return logger[_0xd3c0('0x1a')](_0xd3c0('0x38'),_0xd3c0('0x29'),_0xd3c0('0x36'),util['inspect'](_0xcc8302,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xd3c0('0x38'),'afterCreate',_0xd3c0('0x36'),_0xd3c0('0x39'));}break;case _0xd3c0('0x3a'):if(_0xa25a3e[_0xd3c0('0x22')]){var _0x39ed04={'recipient':_0x4152c1[_0xd3c0('0x25')],'message':_0x4152c1['body'],'sender':_0xa25a3e[_0xd3c0('0x3b')]||_0xa25a3e[_0xd3c0('0x25')],'authorization':_0xa25a3e[_0xd3c0('0x22')]};var _0x1d8905={'method':_0xd3c0('0x3c'),'uri':_0xd3c0('0x3d'),'body':_0x39ed04,'json':!![]};rp(_0x1d8905)['then'](function(_0x5ccfd8){var _0x31a8b6={'messageId':_0x5ccfd8[_0xd3c0('0x3e')]};if(!_0xa25a3e[_0xd3c0('0x34')]){_0x31a8b6[_0xd3c0('0x35')]=!![];}return _0x3414ff[_0xd3c0('0x18')](_0x31a8b6);})[_0xd3c0('0x37')](function(_0x39d815){logger[_0xd3c0('0x1a')](_0xd3c0('0x38'),'afterCreate',_0xd3c0('0x3a'),util[_0xd3c0('0x28')](_0x39d815,{'showHidden':![],'depth':null}));});}else{logger[_0xd3c0('0x1a')](_0xd3c0('0x38'),'afterCreate','connectel',_0xd3c0('0x3f'));}break;case'clicksend':if(_0xa25a3e['username']&&_0xa25a3e[_0xd3c0('0x2c')]){var _0x39ed04={'messages':[{'source':_0xd3c0('0x40'),'to':_0x4152c1['phone'],'body':_0x4152c1['body'],'from':_0xa25a3e[_0xd3c0('0x3b')]||_0xa25a3e['phone']}]};var _0xa1f895=util[_0xd3c0('0x41')](_0xd3c0('0x42'),_0xa25a3e[_0xd3c0('0x43')],_0xa25a3e[_0xd3c0('0x2c')]);var _0x1d8905={'method':_0xd3c0('0x3c'),'uri':_0xd3c0('0x44'),'body':_0x39ed04,'headers':{'Authorization':util[_0xd3c0('0x41')](_0xd3c0('0x45'),new Buffer(_0xa1f895)[_0xd3c0('0x46')](_0xd3c0('0x47')))},'json':!![]};rp(_0x1d8905)[_0xd3c0('0x17')](function(_0x5bc21c){if(_0x5bc21c[_0xd3c0('0x48')]>=0xc8&&_0x5bc21c[_0xd3c0('0x48')]<=0xce){if(_0x5bc21c[_0xd3c0('0x49')]&&_0x5bc21c['data'][_0xd3c0('0x4a')]>0x0){var _0x3f4a52=_[_0xd3c0('0x4b')](_0x5bc21c[_0xd3c0('0x49')][_0xd3c0('0x23')]);var _0x5b4777={'messageId':_0x3f4a52['message_id']};if(!_0xa25a3e[_0xd3c0('0x34')]){_0x5b4777[_0xd3c0('0x35')]=!![];}return _0x3414ff['update'](_0x5b4777);}else{logger[_0xd3c0('0x1a')](_0xd3c0('0x38'),_0xd3c0('0x29'),_0xd3c0('0x4c'),util[_0xd3c0('0x28')](_0x5bc21c,{'showHidden':![],'depth':null}));}}else{logger[_0xd3c0('0x1a')](_0xd3c0('0x38'),'afterCreate',_0xd3c0('0x4c'),util['inspect'](_0x5bc21c,{'showHidden':![],'depth':null}));}})[_0xd3c0('0x37')](function(_0x34ee81){logger[_0xd3c0('0x1a')](_0xd3c0('0x38'),'afterCreate','clickSend',util['inspect'](_0x34ee81,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','clickSend',_0xd3c0('0x39'));}break;case _0xd3c0('0x4d'):if(_0xa25a3e[_0xd3c0('0x4e')]&&_0xa25a3e[_0xd3c0('0x22')]){var _0x39ed04={'dst':_0x4152c1[_0xd3c0('0x25')],'text':_0x4152c1[_0xd3c0('0xd')],'src':_0xa25a3e['senderString']||_0xa25a3e[_0xd3c0('0x25')],'url':_0xa25a3e[_0xd3c0('0x4f')]+_0xd3c0('0x26')+_0x4152c1['id']+'/status?token='+_0xa25a3e[_0xd3c0('0x50')]};var _0xa1f895=util[_0xd3c0('0x41')](_0xd3c0('0x42'),_0xa25a3e[_0xd3c0('0x4e')],_0xa25a3e['authToken']);var _0x1d8905={'method':_0xd3c0('0x3c'),'uri':util[_0xd3c0('0x41')](_0xd3c0('0x51'),_0xa25a3e[_0xd3c0('0x4e')]),'body':_0x39ed04,'headers':{'Authorization':util[_0xd3c0('0x41')](_0xd3c0('0x45'),new Buffer(_0xa1f895)[_0xd3c0('0x46')](_0xd3c0('0x47')))},'json':!![]};rp(_0x1d8905)[_0xd3c0('0x17')](function(_0x3c41bb){var _0x2fddb5={'messageId':_0x3c41bb['message_uuid'][0x0]};return _0x3414ff[_0xd3c0('0x18')](_0x2fddb5);})[_0xd3c0('0x37')](function(_0x5a6633){logger['error'](_0xd3c0('0x38'),_0xd3c0('0x29'),_0xd3c0('0x4d'),util['inspect'](_0x5a6633,{'showHidden':![],'depth':null}));});}else{logger[_0xd3c0('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd3c0('0x29'),_0xd3c0('0x4d'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case'infobip':if(_0xa25a3e['username']&&_0xa25a3e[_0xd3c0('0x2c')]){if(_0xa25a3e[_0xd3c0('0x52')]){var _0x191a52={'method':_0xd3c0('0x3c'),'uri':_0xa25a3e[_0xd3c0('0x52')]+_0xd3c0('0x53'),'body':{'username':_0xa25a3e[_0xd3c0('0x43')],'password':_0xa25a3e[_0xd3c0('0x2c')]},'json':!![]};return rp(_0x191a52)[_0xd3c0('0x17')](function(_0x4720b7){var _0x48fdbe={'method':_0xd3c0('0x3c'),'uri':_0xa25a3e[_0xd3c0('0x52')]+_0xd3c0('0x54'),'body':{'messages':[{'from':_0xa25a3e[_0xd3c0('0x25')],'destinations':[{'to':_0x4152c1['phone']}],'text':_0x4152c1[_0xd3c0('0xd')],'notifyUrl':_0xa25a3e[_0xd3c0('0x4f')]+'/api/sms/messages/'+_0x4152c1['id']+'/status?token='+_0xa25a3e['token'],'notifyContentType':_0xd3c0('0x55'),'callbackData':_0xa25a3e[_0xd3c0('0x25')]+';'+_0x4152c1['body']}]},'headers':{'Authorization':'IBSSO\x20'+_0x4720b7[_0xd3c0('0x50')]},'json':!![]};return rp(_0x48fdbe)['then'](function(_0x7b85b6){if(_0x7b85b6['messages']){var _0x3d785b={'messageId':_0x7b85b6[_0xd3c0('0x23')][0x0][_0xd3c0('0xb')]};if(!_0xa25a3e[_0xd3c0('0x34')]){_0x3d785b[_0xd3c0('0x35')]=!![];}return _0x3414ff[_0xd3c0('0x18')](_0x3d785b);}else{return logger[_0xd3c0('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd3c0('0x29'),_0xd3c0('0x56'),util[_0xd3c0('0x28')](_0x7b85b6,{'showHidden':![],'depth':null}));}});})[_0xd3c0('0x37')](function(_0x276eb8){return logger[_0xd3c0('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd3c0('0x29'),_0xd3c0('0x56'),util[_0xd3c0('0x28')](_0x276eb8,{'showHidden':![],'depth':null}));});}else{logger[_0xd3c0('0x1a')](_0xd3c0('0x38'),_0xd3c0('0x29'),_0xd3c0('0x56'),_0xd3c0('0x57'));}}else{logger[_0xd3c0('0x1a')](_0xd3c0('0x38'),_0xd3c0('0x29'),_0xd3c0('0x56'),'Missing\x20parameters:\x20username,\x20password');}break;case'csc':var _0x1d069b=require(_0xd3c0('0x58'));if(_0xa25a3e[_0xd3c0('0x59')]){var _0x33271e={};_0x33271e[_0xd3c0('0x5a')]=_0xa25a3e['username'];_0x33271e[_0xd3c0('0x25')]=_0x4152c1[_0xd3c0('0x25')];_0x33271e[_0xd3c0('0x2e')]=_0xa25a3e[_0xd3c0('0x25')];_0x33271e['text']=_0x4152c1['body'];_0x33271e[_0xd3c0('0x5b')]=+new Date();var _0x125880='';var _0x5d4897='';var _0x318889=Object['keys'](_0x33271e);_0x318889[_0xd3c0('0x5c')]();for(var _0x20840c=0x0;_0x20840c<_0x318889[_0xd3c0('0x5d')];_0x20840c++){if(_0x125880!=''){_0x125880+='&';}_0x125880+=_0x318889[_0x20840c]+'='+encodeURIComponent(_0x33271e[_0x318889[_0x20840c]]);_0x5d4897+=_0x33271e[_0x318889[_0x20840c]];}_0x5d4897+=_0xa25a3e[_0xd3c0('0x59')];_0x5d4897=_0x1d069b['createHash']('md5')[_0xd3c0('0x18')](_0x5d4897)[_0xd3c0('0x5e')]('hex');if(_0x125880!==''){_0x125880+='&';}_0x125880+=_0xd3c0('0x5f')+_0x5d4897;var _0x446298={'method':'GET','uri':_0xa25a3e[_0xd3c0('0x52')]+_0xd3c0('0x60')+_0x125880,'json':!![]};return rp(_0x446298)['then'](function(_0x32bc01){var _0x59c2cc=Object[_0xd3c0('0x61')](_0x32bc01);if(_0x32bc01[_0x59c2cc[0x0]][_0xd3c0('0x1a')]&&parseInt(_0x32bc01[_0x59c2cc[0x0]][_0xd3c0('0x1a')])===0x0){var _0x24cd9e={'messageId':_0x32bc01[_0x59c2cc[0x0]][_0xd3c0('0x62')]};if(!_0xa25a3e[_0xd3c0('0x34')]){_0x24cd9e['read']=!![];}return _0x3414ff[_0xd3c0('0x18')](_0x24cd9e);}else{return logger[_0xd3c0('0x1a')](_0xd3c0('0x38'),_0xd3c0('0x29'),'csc',util[_0xd3c0('0x28')](_0x32bc01[_0xd3c0('0x1a')],{'showHidden':![],'depth':null}));}})[_0xd3c0('0x37')](function(_0x562335){return logger[_0xd3c0('0x1a')](_0xd3c0('0x38'),_0xd3c0('0x29'),_0xd3c0('0x63'),util['inspect'](_0x562335,{'showHidden':![],'depth':null}));});}else{logger[_0xd3c0('0x1a')](_0xd3c0('0x38'),_0xd3c0('0x29'),_0xd3c0('0x63'),_0xd3c0('0x64'));}break;case _0xd3c0('0x65'):if(_0xa25a3e[_0xd3c0('0x59')]){var _0x44fa26={'method':_0xd3c0('0x3c'),'uri':_0xd3c0('0x66'),'headers':{'Authorization':_0xa25a3e[_0xd3c0('0x59')]},'body':{'content':_0x4152c1[_0xd3c0('0xd')],'to':[_0x4152c1[_0xd3c0('0x25')]],'from':_0xa25a3e[_0xd3c0('0x25')],'binary':![],'clientMessageId':_0xd3c0('0x67'),'charset':_0xd3c0('0x68')},'json':!![]};rp(_0x44fa26)[_0xd3c0('0x17')](function(_0x583c33){if(!_0x583c33[_0xd3c0('0x1a')]){var _0x2b8f3a={'messageId':_0x583c33[_0xd3c0('0x23')][0x0][_0xd3c0('0x69')]};if(!_0xa25a3e[_0xd3c0('0x34')]){_0x2b8f3a[_0xd3c0('0x35')]=!![];}return _0x3414ff[_0xd3c0('0x18')](_0x2b8f3a);}else{return logger[_0xd3c0('0x1a')](_0xd3c0('0x38'),_0xd3c0('0x29'),'clickatell',util[_0xd3c0('0x28')](_0x583c33[_0xd3c0('0x1a')],{'showHidden':![],'depth':null}));}})[_0xd3c0('0x37')](function(_0x568bf0){return logger[_0xd3c0('0x1a')](_0xd3c0('0x38'),_0xd3c0('0x29'),_0xd3c0('0x65'),util[_0xd3c0('0x28')](_0x568bf0,{'showHidden':![],'depth':null}));});}else{logger[_0xd3c0('0x1a')](_0xd3c0('0x38'),_0xd3c0('0x29'),_0xd3c0('0x65'),'Missing\x20parameters:\x20apiKey');}break;case _0xd3c0('0x6a'):if(_0xa25a3e[_0xd3c0('0x43')]&&_0xa25a3e['password']){var _0xa1f895=util['format']('%s:%s',_0xa25a3e[_0xd3c0('0x43')],_0xa25a3e[_0xd3c0('0x2c')]);var _0x1d8905={'method':_0xd3c0('0x3c'),'uri':_0xd3c0('0x6b')+_0xa25a3e[_0xd3c0('0x6c')]+_0xd3c0('0x6d'),'body':{'to':[_0x4152c1[_0xd3c0('0x25')]],'text':_0x4152c1[_0xd3c0('0xd')],'from':_0xa25a3e['phone'],'applicationId':_0xa25a3e[_0xd3c0('0x6e')]},'headers':{'Authorization':util[_0xd3c0('0x41')]('Basic\x20%s',new Buffer(_0xa1f895)[_0xd3c0('0x46')](_0xd3c0('0x47')))},'json':!![]};rp(_0x1d8905)[_0xd3c0('0x17')](function(_0x1cc769){if(_0x1cc769['id']){var _0x465bc9={'messageId':_0x1cc769['id']};return _0x3414ff['update'](_0x465bc9);}else{logger[_0xd3c0('0x1a')](_0xd3c0('0x38'),_0xd3c0('0x29'),_0xd3c0('0x6a'),util[_0xd3c0('0x28')](_0x1cc769,{'showHidden':![],'depth':null}));}})[_0xd3c0('0x37')](function(_0x8a41c9){logger[_0xd3c0('0x1a')](_0xd3c0('0x38'),'afterCreate',_0xd3c0('0x6a'),util['inspect'](_0x8a41c9,{'showHidden':![],'depth':null}));});}else{logger[_0xd3c0('0x1a')](_0xd3c0('0x38'),_0xd3c0('0x29'),_0xd3c0('0x6a'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xd3c0('0x6f'):if(_0xa25a3e['apiKey']){var _0x253da0={};var _0x446298={'method':_0xd3c0('0x3c'),'uri':_0xd3c0('0x70'),'headers':{'Authorization':'Bearer\x20'+_0xa25a3e[_0xd3c0('0x59')],'Content-Type':_0xd3c0('0x55')},'body':{'from':_0xa25a3e[_0xd3c0('0x25')],'to':_0x4152c1[_0xd3c0('0x25')],'text':_0x4152c1[_0xd3c0('0xd')]},'json':!![]};return rp(_0x446298)[_0xd3c0('0x17')](function(_0x4cc403){if(_0x4cc403[_0xd3c0('0x71')]==0xca){_0x253da0[_0xd3c0('0x72')]=_0x4cc403;var _0x3b45d1={'method':'POST','uri':_0xd3c0('0x73'),'headers':{'Authorization':_0xd3c0('0x74')+_0xa25a3e[_0xd3c0('0x59')],'Content-Type':_0xd3c0('0x55')},'body':{'refid':_0x253da0[_0xd3c0('0x72')][_0xd3c0('0x75')]},'json':!![]};return rp(_0x3b45d1)[_0xd3c0('0x17')](function(_0x3bb59c){_0x253da0[_0xd3c0('0x76')]=_0x3bb59c;var _0x5eb308={'messageId':_0x253da0[_0xd3c0('0x72')][_0xd3c0('0x75')],'read':!![]};return _0x3414ff[_0xd3c0('0x18')](_0x5eb308);});}else{return logger[_0xd3c0('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd3c0('0x29'),_0xd3c0('0x6f'),util[_0xd3c0('0x28')](_0x4cc403,{'showHidden':![],'depth':null}));}})[_0xd3c0('0x37')](function(_0x26ca48){return logger[_0xd3c0('0x1a')](_0xd3c0('0x38'),_0xd3c0('0x29'),'intelepeer',util['inspect'](_0x26ca48,{'showHidden':![],'depth':null}));});}else{return logger[_0xd3c0('0x1a')](_0xd3c0('0x38'),_0xd3c0('0x29'),'intelepeer',_0xd3c0('0x77'));}break;}}})['finally'](function(){_0x281945();});}else{_0x281945();}}},'charset':_0xd3c0('0x78'),'collate':_0xd3c0('0x79')});}; \ No newline at end of file +var _0xa2ab=['%s:%s','Basic\x20%s','toString','base64','data','clickSend','authId','token','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','plivo','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','infobip','csc','crypto','apiKey','text','timestamp','keys','sort','length','createHash','digest','hex','Missing\x20parameters:\x20apiKey','clickatell','UTF-8','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','define','sms_messages','messageId','fti_sms_messages','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','SmsInteractionId','then','createdAt','catch','error','find','SmsAccountId','type','twilio','accountSid','phone','authToken','messages','create','remote','/api/sms/messages/','/status?token=','sid','update','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','https://api.skebby.it/API/v1.0/REST/','username','password','body','smsMethod','sender','login?username=','&password=','GET','split','sms','POST','user_key','session_key','internal_order_id','deliveryReport','read','SmsMessage,\x20%s,\x20%s,\x20%s','skebby','Missing\x20parameters:\x20username,\x20password','connectel','requestid','Missing\x20parameters:\x20authToken','xCALLY\x20Motion','senderString','format'];(function(_0x22f8ab,_0x15d8ff){var _0x2a70e5=function(_0x5e6895){while(--_0x5e6895){_0x22f8ab['push'](_0x22f8ab['shift']());}};_0x2a70e5(++_0x15d8ff);}(_0xa2ab,0xa7));var _0xba2a=function(_0x4e0359,_0x205155){_0x4e0359=_0x4e0359-0x0;var _0x450f0a=_0xa2ab[_0x4e0359];return _0x450f0a;};'use strict';var _=require(_0xba2a('0x0'));var util=require(_0xba2a('0x1'));var logger=require(_0xba2a('0x2'))('api');var moment=require(_0xba2a('0x3'));var BPromise=require(_0xba2a('0x4'));var rp=require(_0xba2a('0x5'));var fs=require('fs');var path=require(_0xba2a('0x6'));var rimraf=require(_0xba2a('0x7'));var config=require(_0xba2a('0x8'));var attributes=require(_0xba2a('0x9'));module['exports']=function(_0x12f994,_0x42e864){return _0x12f994[_0xba2a('0xa')]('SmsMessage',attributes,{'tableName':_0xba2a('0xb'),'paranoid':![],'indexes':[{'name':_0xba2a('0xc'),'fields':[_0xba2a('0xc')]},{'name':_0xba2a('0xd'),'fields':['body'],'type':_0xba2a('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x43fa56,_0x2f4d3d,_0x3607e2){var _0xde4888=_0x12f994['models'];var _0x463cb9=_0x43fa56[_0xba2a('0xf')]({'plain':!![]});if(_0x463cb9[_0xba2a('0x10')][_0xba2a('0x11')]()==='in'||_0x463cb9['direction'][_0xba2a('0x11')]()===_0xba2a('0x12')&&!_0x463cb9[_0xba2a('0x13')]&&!_[_0xba2a('0x14')](_0x463cb9[_0xba2a('0x15')])){_0xde4888['SmsInteraction'][_0xba2a('0x16')]({'where':{'id':_0x463cb9[_0xba2a('0x17')]}})[_0xba2a('0x18')](function(_0x127c42){if(_0x127c42){_0x127c42['update']({'lastMsgAt':_0x463cb9[_0xba2a('0x19')],'lastMsgDirection':_0x463cb9[_0xba2a('0x10')][_0xba2a('0x11')]()});}})[_0xba2a('0x1a')](function(_0x4b9f63){console[_0xba2a('0x1b')](_0x4b9f63);});}if(_0x463cb9[_0xba2a('0x10')]==='out'&&!_0x463cb9[_0xba2a('0x13')]){var _0x49c57e;_0xde4888['SmsAccount'][_0xba2a('0x1c')]({'where':{'id':_0x463cb9[_0xba2a('0x1d')]},'raw':!![]})[_0xba2a('0x18')](function(_0x20225e){_0x49c57e=_0x20225e;if(_0x49c57e&&_0x49c57e[_0xba2a('0x1e')]){switch(_0x49c57e['type']){case _0xba2a('0x1f'):var _0x44b2d1=require('twilio');if(_0x49c57e[_0xba2a('0x20')]&&_0x49c57e['authToken']&&_0x49c57e[_0xba2a('0x21')]){var _0x2ad68=new _0x44b2d1(_0x49c57e[_0xba2a('0x20')],_0x49c57e[_0xba2a('0x22')]);_0x2ad68[_0xba2a('0x23')][_0xba2a('0x24')]({'body':_0x463cb9['body'],'to':_0x463cb9[_0xba2a('0x21')],'from':_0x49c57e[_0xba2a('0x21')],'statusCallback':_0x49c57e[_0xba2a('0x25')]+_0xba2a('0x26')+_0x463cb9['id']+_0xba2a('0x27')+_0x49c57e['token']})[_0xba2a('0x18')](function(_0x4458cb){if(_0x4458cb[_0xba2a('0x28')]){return _0x43fa56[_0xba2a('0x29')]({'messageId':_0x4458cb[_0xba2a('0x28')]});}})[_0xba2a('0x1a')](function(_0x24ee7d){logger[_0xba2a('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xba2a('0x2a'),_0xba2a('0x1f'),util[_0xba2a('0x2b')](_0x24ee7d,{'showHidden':![],'depth':null}));});}else{logger[_0xba2a('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xba2a('0x2a'),_0xba2a('0x1f'),_0xba2a('0x2c'));}break;case'skebby':var _0x4fca78=_0xba2a('0x2d');if(_0x49c57e[_0xba2a('0x2e')]&&_0x49c57e[_0xba2a('0x2f')]){var _0x3bb5c3={'recipient':[_0x463cb9[_0xba2a('0x21')]],'message':_0x463cb9[_0xba2a('0x30')],'message_type':_0x49c57e[_0xba2a('0x31')]};if(_0x49c57e[_0xba2a('0x31')]&&_0x49c57e[_0xba2a('0x31')]!=='SI'){_0x3bb5c3[_0xba2a('0x32')]=_0x49c57e['phone'];}var _0x15153d={'url':_0x4fca78+_0xba2a('0x33')+_0x49c57e[_0xba2a('0x2e')]+_0xba2a('0x34')+_0x49c57e['password'],'method':_0xba2a('0x35')};rp(_0x15153d)[_0xba2a('0x18')](function(_0x3ec14f){var _0x49597b=_0x3ec14f[_0xba2a('0x36')](';');var _0x274174={'user_key':_0x49597b[0x0],'session_key':_0x49597b[0x1]};_0x15153d={'url':_0x4fca78+_0xba2a('0x37'),'method':_0xba2a('0x38'),'headers':{'user_key':_0x274174[_0xba2a('0x39')],'Session_key':_0x274174[_0xba2a('0x3a')]},'json':!![],'body':_0x3bb5c3};return rp(_0x15153d);})[_0xba2a('0x18')](function(_0x35f5d8){if(_0x35f5d8['total_sent']>=0x1){var _0x18f557={'messageId':_0x35f5d8[_0xba2a('0x3b')]};if(_0x49c57e[_0xba2a('0x31')]!=='GP'||!_0x49c57e[_0xba2a('0x3c')]){_0x18f557[_0xba2a('0x3d')]=!![];}return _0x43fa56['update'](_0x18f557);}else{return logger[_0xba2a('0x1b')](_0xba2a('0x3e'),_0xba2a('0x2a'),_0xba2a('0x3f'),util['inspect'](_0x35f5d8,{'showHidden':![],'depth':null}));}})[_0xba2a('0x1a')](function(_0x58b903){return logger[_0xba2a('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xba2a('0x2a'),_0xba2a('0x3f'),util[_0xba2a('0x2b')](_0x58b903,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xba2a('0x3e'),_0xba2a('0x2a'),_0xba2a('0x3f'),_0xba2a('0x40'));}break;case _0xba2a('0x41'):if(_0x49c57e[_0xba2a('0x22')]){var _0x524c74={'recipient':_0x463cb9['phone'],'message':_0x463cb9[_0xba2a('0x30')],'sender':_0x49c57e['senderString']||_0x49c57e[_0xba2a('0x21')],'authorization':_0x49c57e[_0xba2a('0x22')]};var _0x2f4d3d={'method':'POST','uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x524c74,'json':!![]};rp(_0x2f4d3d)['then'](function(_0x2402ff){var _0x5d69fe={'messageId':_0x2402ff[_0xba2a('0x42')]};if(!_0x49c57e[_0xba2a('0x3c')]){_0x5d69fe['read']=!![];}return _0x43fa56[_0xba2a('0x29')](_0x5d69fe);})[_0xba2a('0x1a')](function(_0x17e3b8){logger['error'](_0xba2a('0x3e'),'afterCreate',_0xba2a('0x41'),util[_0xba2a('0x2b')](_0x17e3b8,{'showHidden':![],'depth':null}));});}else{logger[_0xba2a('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xba2a('0x2a'),_0xba2a('0x41'),_0xba2a('0x43'));}break;case'clicksend':if(_0x49c57e[_0xba2a('0x2e')]&&_0x49c57e[_0xba2a('0x2f')]){var _0x524c74={'messages':[{'source':_0xba2a('0x44'),'to':_0x463cb9[_0xba2a('0x21')],'body':_0x463cb9[_0xba2a('0x30')],'from':_0x49c57e[_0xba2a('0x45')]||_0x49c57e[_0xba2a('0x21')]}]};var _0x39c540=util[_0xba2a('0x46')](_0xba2a('0x47'),_0x49c57e[_0xba2a('0x2e')],_0x49c57e['password']);var _0x2f4d3d={'method':_0xba2a('0x38'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x524c74,'headers':{'Authorization':util[_0xba2a('0x46')](_0xba2a('0x48'),new Buffer(_0x39c540)[_0xba2a('0x49')](_0xba2a('0x4a')))},'json':!![]};rp(_0x2f4d3d)['then'](function(_0x5339f6){if(_0x5339f6['http_code']>=0xc8&&_0x5339f6['http_code']<=0xce){if(_0x5339f6[_0xba2a('0x4b')]&&_0x5339f6[_0xba2a('0x4b')]['queued_count']>0x0){var _0x5f2d2a=_['head'](_0x5339f6[_0xba2a('0x4b')][_0xba2a('0x23')]);var _0x5da4ca={'messageId':_0x5f2d2a['message_id']};if(!_0x49c57e[_0xba2a('0x3c')]){_0x5da4ca[_0xba2a('0x3d')]=!![];}return _0x43fa56['update'](_0x5da4ca);}else{logger[_0xba2a('0x1b')](_0xba2a('0x3e'),_0xba2a('0x2a'),'clickSend',util[_0xba2a('0x2b')](_0x5339f6,{'showHidden':![],'depth':null}));}}else{logger['error'](_0xba2a('0x3e'),'afterCreate',_0xba2a('0x4c'),util[_0xba2a('0x2b')](_0x5339f6,{'showHidden':![],'depth':null}));}})[_0xba2a('0x1a')](function(_0x2f1e90){logger[_0xba2a('0x1b')](_0xba2a('0x3e'),'afterCreate',_0xba2a('0x4c'),util['inspect'](_0x2f1e90,{'showHidden':![],'depth':null}));});}else{logger[_0xba2a('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xba2a('0x2a'),_0xba2a('0x4c'),_0xba2a('0x40'));}break;case'plivo':if(_0x49c57e[_0xba2a('0x4d')]&&_0x49c57e['authToken']){var _0x524c74={'dst':_0x463cb9[_0xba2a('0x21')],'text':_0x463cb9['body'],'src':_0x49c57e['senderString']||_0x49c57e[_0xba2a('0x21')],'url':_0x49c57e[_0xba2a('0x25')]+'/api/sms/messages/'+_0x463cb9['id']+_0xba2a('0x27')+_0x49c57e[_0xba2a('0x4e')]};var _0x39c540=util['format']('%s:%s',_0x49c57e[_0xba2a('0x4d')],_0x49c57e[_0xba2a('0x22')]);var _0x2f4d3d={'method':_0xba2a('0x38'),'uri':util[_0xba2a('0x46')](_0xba2a('0x4f'),_0x49c57e[_0xba2a('0x4d')]),'body':_0x524c74,'headers':{'Authorization':util[_0xba2a('0x46')](_0xba2a('0x48'),new Buffer(_0x39c540)[_0xba2a('0x49')]('base64'))},'json':!![]};rp(_0x2f4d3d)[_0xba2a('0x18')](function(_0x4bec55){var _0x3101fd={'messageId':_0x4bec55[_0xba2a('0x50')][0x0]};return _0x43fa56['update'](_0x3101fd);})[_0xba2a('0x1a')](function(_0x13fab0){logger[_0xba2a('0x1b')](_0xba2a('0x3e'),_0xba2a('0x2a'),_0xba2a('0x51'),util['inspect'](_0x13fab0,{'showHidden':![],'depth':null}));});}else{logger[_0xba2a('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xba2a('0x2a'),_0xba2a('0x51'),_0xba2a('0x52'));}break;case'infobip':if(_0x49c57e[_0xba2a('0x2e')]&&_0x49c57e[_0xba2a('0x2f')]){if(_0x49c57e[_0xba2a('0x53')]){var _0x5d450b={'method':'POST','uri':_0x49c57e[_0xba2a('0x53')]+_0xba2a('0x54'),'body':{'username':_0x49c57e[_0xba2a('0x2e')],'password':_0x49c57e[_0xba2a('0x2f')]},'json':!![]};return rp(_0x5d450b)[_0xba2a('0x18')](function(_0x4b9be9){var _0x4175a6={'method':_0xba2a('0x38'),'uri':_0x49c57e[_0xba2a('0x53')]+_0xba2a('0x55'),'body':{'messages':[{'from':_0x49c57e['phone'],'destinations':[{'to':_0x463cb9[_0xba2a('0x21')]}],'text':_0x463cb9[_0xba2a('0x30')],'notifyUrl':_0x49c57e[_0xba2a('0x25')]+_0xba2a('0x26')+_0x463cb9['id']+'/status?token='+_0x49c57e[_0xba2a('0x4e')],'notifyContentType':_0xba2a('0x56'),'callbackData':_0x49c57e[_0xba2a('0x21')]+';'+_0x463cb9['body']}]},'headers':{'Authorization':_0xba2a('0x57')+_0x4b9be9[_0xba2a('0x4e')]},'json':!![]};return rp(_0x4175a6)[_0xba2a('0x18')](function(_0x51fb7b){if(_0x51fb7b['messages']){var _0x284399={'messageId':_0x51fb7b[_0xba2a('0x23')][0x0]['messageId']};if(!_0x49c57e['deliveryReport']){_0x284399[_0xba2a('0x3d')]=!![];}return _0x43fa56[_0xba2a('0x29')](_0x284399);}else{return logger[_0xba2a('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xba2a('0x2a'),_0xba2a('0x58'),util['inspect'](_0x51fb7b,{'showHidden':![],'depth':null}));}});})[_0xba2a('0x1a')](function(_0x53f601){return logger[_0xba2a('0x1b')](_0xba2a('0x3e'),'afterCreate',_0xba2a('0x58'),util[_0xba2a('0x2b')](_0x53f601,{'showHidden':![],'depth':null}));});}else{logger[_0xba2a('0x1b')](_0xba2a('0x3e'),_0xba2a('0x2a'),_0xba2a('0x58'),'Missing\x20parameters:\x20base_url');}}else{logger[_0xba2a('0x1b')](_0xba2a('0x3e'),_0xba2a('0x2a'),_0xba2a('0x58'),_0xba2a('0x40'));}break;case _0xba2a('0x59'):var _0x5c6d01=require(_0xba2a('0x5a'));if(_0x49c57e[_0xba2a('0x5b')]){var _0xdc2d4c={};_0xdc2d4c['login']=_0x49c57e['username'];_0xdc2d4c[_0xba2a('0x21')]=_0x463cb9[_0xba2a('0x21')];_0xdc2d4c['sender']=_0x49c57e[_0xba2a('0x21')];_0xdc2d4c[_0xba2a('0x5c')]=_0x463cb9['body'];_0xdc2d4c[_0xba2a('0x5d')]=+new Date();var _0x52fa10='';var _0x59ae9a='';var _0x6c6c74=Object[_0xba2a('0x5e')](_0xdc2d4c);_0x6c6c74[_0xba2a('0x5f')]();for(var _0x14d6ab=0x0;_0x14d6ab<_0x6c6c74[_0xba2a('0x60')];_0x14d6ab++){if(_0x52fa10!=''){_0x52fa10+='&';}_0x52fa10+=_0x6c6c74[_0x14d6ab]+'='+encodeURIComponent(_0xdc2d4c[_0x6c6c74[_0x14d6ab]]);_0x59ae9a+=_0xdc2d4c[_0x6c6c74[_0x14d6ab]];}_0x59ae9a+=_0x49c57e[_0xba2a('0x5b')];_0x59ae9a=_0x5c6d01[_0xba2a('0x61')]('md5')['update'](_0x59ae9a)[_0xba2a('0x62')](_0xba2a('0x63'));if(_0x52fa10!==''){_0x52fa10+='&';}_0x52fa10+='signature='+_0x59ae9a;var _0x15153d={'method':'GET','uri':_0x49c57e[_0xba2a('0x53')]+'/external/get/send.php?'+_0x52fa10,'json':!![]};return rp(_0x15153d)[_0xba2a('0x18')](function(_0x1e9a7f){var _0x2c2b21=Object[_0xba2a('0x5e')](_0x1e9a7f);if(_0x1e9a7f[_0x2c2b21[0x0]][_0xba2a('0x1b')]&&parseInt(_0x1e9a7f[_0x2c2b21[0x0]][_0xba2a('0x1b')])===0x0){var _0x3de4c1={'messageId':_0x1e9a7f[_0x2c2b21[0x0]]['id_sms']};if(!_0x49c57e['deliveryReport']){_0x3de4c1[_0xba2a('0x3d')]=!![];}return _0x43fa56[_0xba2a('0x29')](_0x3de4c1);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xba2a('0x2a'),_0xba2a('0x59'),util[_0xba2a('0x2b')](_0x1e9a7f[_0xba2a('0x1b')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x4634cc){return logger[_0xba2a('0x1b')](_0xba2a('0x3e'),_0xba2a('0x2a'),'csc',util['inspect'](_0x4634cc,{'showHidden':![],'depth':null}));});}else{logger[_0xba2a('0x1b')](_0xba2a('0x3e'),_0xba2a('0x2a'),_0xba2a('0x59'),_0xba2a('0x64'));}break;case _0xba2a('0x65'):if(_0x49c57e['apiKey']){var _0x15b7e2={'method':_0xba2a('0x38'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x49c57e[_0xba2a('0x5b')]},'body':{'content':_0x463cb9[_0xba2a('0x30')],'to':[_0x463cb9['phone']],'from':_0x49c57e[_0xba2a('0x21')],'binary':![],'clientMessageId':'uuid','charset':_0xba2a('0x66')},'json':!![]};rp(_0x15b7e2)[_0xba2a('0x18')](function(_0x9b427b){if(!_0x9b427b[_0xba2a('0x1b')]){var _0x63dd2f={'messageId':_0x9b427b[_0xba2a('0x23')][0x0]['apiMessageId']};if(!_0x49c57e[_0xba2a('0x3c')]){_0x63dd2f['read']=!![];}return _0x43fa56[_0xba2a('0x29')](_0x63dd2f);}else{return logger['error'](_0xba2a('0x3e'),_0xba2a('0x2a'),_0xba2a('0x65'),util[_0xba2a('0x2b')](_0x9b427b[_0xba2a('0x1b')],{'showHidden':![],'depth':null}));}})[_0xba2a('0x1a')](function(_0x3b0140){return logger[_0xba2a('0x1b')](_0xba2a('0x3e'),_0xba2a('0x2a'),_0xba2a('0x65'),util[_0xba2a('0x2b')](_0x3b0140,{'showHidden':![],'depth':null}));});}else{logger[_0xba2a('0x1b')](_0xba2a('0x3e'),'afterCreate',_0xba2a('0x65'),_0xba2a('0x64'));}break;case _0xba2a('0x67'):if(_0x49c57e['username']&&_0x49c57e[_0xba2a('0x2f')]){var _0x39c540=util['format']('%s:%s',_0x49c57e['username'],_0x49c57e[_0xba2a('0x2f')]);var _0x2f4d3d={'method':_0xba2a('0x38'),'uri':_0xba2a('0x68')+_0x49c57e[_0xba2a('0x69')]+'/messages','body':{'to':[_0x463cb9[_0xba2a('0x21')]],'text':_0x463cb9[_0xba2a('0x30')],'from':_0x49c57e[_0xba2a('0x21')],'applicationId':_0x49c57e[_0xba2a('0x6a')]},'headers':{'Authorization':util[_0xba2a('0x46')]('Basic\x20%s',new Buffer(_0x39c540)[_0xba2a('0x49')](_0xba2a('0x4a')))},'json':!![]};rp(_0x2f4d3d)[_0xba2a('0x18')](function(_0x1fbcef){if(_0x1fbcef['id']){var _0x50bcfd={'messageId':_0x1fbcef['id']};return _0x43fa56['update'](_0x50bcfd);}else{logger[_0xba2a('0x1b')](_0xba2a('0x3e'),_0xba2a('0x2a'),'bandwidth',util[_0xba2a('0x2b')](_0x1fbcef,{'showHidden':![],'depth':null}));}})[_0xba2a('0x1a')](function(_0x3e7054){logger[_0xba2a('0x1b')](_0xba2a('0x3e'),'afterCreate',_0xba2a('0x67'),util[_0xba2a('0x2b')](_0x3e7054,{'showHidden':![],'depth':null}));});}else{logger[_0xba2a('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xba2a('0x2a'),'bandwidth','Missing\x20parameters:\x20username,\x20password');}break;case _0xba2a('0x6b'):if(_0x49c57e['apiKey']){var _0x836cc2={};var _0x15153d={'method':_0xba2a('0x38'),'uri':_0xba2a('0x6c'),'headers':{'Authorization':_0xba2a('0x6d')+_0x49c57e[_0xba2a('0x5b')],'Content-Type':_0xba2a('0x56')},'body':{'from':_0x49c57e[_0xba2a('0x21')],'to':_0x463cb9['phone'],'text':_0x463cb9[_0xba2a('0x30')]},'json':!![]};return rp(_0x15153d)[_0xba2a('0x18')](function(_0x57ba60){if(_0x57ba60[_0xba2a('0x6e')]==0xca){_0x836cc2[_0xba2a('0x6f')]=_0x57ba60;var _0x32c41b={'method':_0xba2a('0x38'),'uri':_0xba2a('0x70'),'headers':{'Authorization':_0xba2a('0x6d')+_0x49c57e[_0xba2a('0x5b')],'Content-Type':_0xba2a('0x56')},'body':{'refid':_0x836cc2['message'][_0xba2a('0x71')]},'json':!![]};return rp(_0x32c41b)['then'](function(_0x2a7560){_0x836cc2[_0xba2a('0x72')]=_0x2a7560;var _0x5c3ae4={'messageId':_0x836cc2[_0xba2a('0x6f')][_0xba2a('0x71')],'read':!![]};return _0x43fa56[_0xba2a('0x29')](_0x5c3ae4);});}else{return logger[_0xba2a('0x1b')](_0xba2a('0x3e'),_0xba2a('0x2a'),_0xba2a('0x6b'),util[_0xba2a('0x2b')](_0x57ba60,{'showHidden':![],'depth':null}));}})[_0xba2a('0x1a')](function(_0x88ee3e){return logger['error'](_0xba2a('0x3e'),'afterCreate','intelepeer',util[_0xba2a('0x2b')](_0x88ee3e,{'showHidden':![],'depth':null}));});}else{return logger[_0xba2a('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xba2a('0x2a'),_0xba2a('0x6b'),_0xba2a('0x73'));}break;}}})[_0xba2a('0x74')](function(){_0x3607e2();});}else{_0x3607e2();}}},'charset':_0xba2a('0x75'),'collate':_0xba2a('0x76')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index aefff4b..cecfab0 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 _0x93a7=['options','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateSmsMessage','create','body'];(function(_0x268651,_0x5648a9){var _0x4cca7b=function(_0x2c33cd){while(--_0x2c33cd){_0x268651['push'](_0x268651['shift']());}};_0x4cca7b(++_0x5648a9);}(_0x93a7,0xab));var _0x793a=function(_0x50939a,_0x245a75){_0x50939a=_0x50939a-0x0;var _0x3d2086=_0x93a7[_0x50939a];return _0x3d2086;};'use strict';var _=require(_0x793a('0x0'));var util=require(_0x793a('0x1'));var moment=require(_0x793a('0x2'));var BPromise=require('bluebird');var rs=require(_0x793a('0x3'));var fs=require('fs');var Redis=require(_0x793a('0x4'));var db=require(_0x793a('0x5'))['db'];var utils=require(_0x793a('0x6'));var logger=require(_0x793a('0x7'))('rpc');var config=require(_0x793a('0x8'));var jayson=require(_0x793a('0x9'));var client=jayson[_0x793a('0xa')][_0x793a('0xb')]({'port':0x232a});config[_0x793a('0xc')]=_[_0x793a('0xd')](config[_0x793a('0xc')],{'host':_0x793a('0xe'),'port':0x18eb});var socket=require(_0x793a('0xf'))(new Redis(config[_0x793a('0xc')]));require(_0x793a('0x10'))[_0x793a('0x11')](socket);function respondWithRpcPromise(_0x334819,_0xf22f56,_0x5e8bbf){return new BPromise(function(_0x4a32ec,_0x1e295f){return client[_0x793a('0x12')](_0x334819,_0x5e8bbf)[_0x793a('0x13')](function(_0xd72a90){logger[_0x793a('0x14')](_0x793a('0x15'),_0xf22f56,_0x793a('0x16'));logger[_0x793a('0x17')](_0x793a('0x18'),_0xf22f56,_0x793a('0x16'),JSON['stringify'](_0xd72a90));if(_0xd72a90[_0x793a('0x19')]){if(_0xd72a90[_0x793a('0x19')][_0x793a('0x1a')]===0x1f4){logger[_0x793a('0x19')](_0x793a('0x15'),_0xf22f56,_0xd72a90[_0x793a('0x19')][_0x793a('0x1b')]);return _0x1e295f(_0xd72a90['error'][_0x793a('0x1b')]);}logger[_0x793a('0x19')](_0x793a('0x15'),_0xf22f56,_0xd72a90[_0x793a('0x19')][_0x793a('0x1b')]);return _0x4a32ec(_0xd72a90[_0x793a('0x19')][_0x793a('0x1b')]);}else{logger[_0x793a('0x14')](_0x793a('0x15'),_0xf22f56,_0x793a('0x16'));_0x4a32ec(_0xd72a90[_0x793a('0x1c')]['message']);}})[_0x793a('0x1d')](function(_0x3c605a){logger[_0x793a('0x19')](_0x793a('0x15'),_0xf22f56,_0x3c605a);_0x1e295f(_0x3c605a);});});}exports[_0x793a('0x1e')]=function(_0x421ec8){var _0x235c05=this;return new Promise(function(_0x1f1e78,_0x4220cc){return db['SmsMessage'][_0x793a('0x1f')](_0x421ec8[_0x793a('0x20')],{'raw':_0x421ec8[_0x793a('0x21')]?_0x421ec8[_0x793a('0x21')]['raw']===undefined?!![]:![]:!![]})[_0x793a('0x13')](function(_0x476579){logger[_0x793a('0x14')](_0x793a('0x1e'),_0x421ec8);logger['debug'](_0x793a('0x1e'),_0x421ec8,JSON['stringify'](_0x476579));_0x1f1e78(_0x476579);})[_0x793a('0x1d')](function(_0x50861c){logger[_0x793a('0x19')]('CreateSmsMessage',_0x50861c['message'],_0x421ec8);_0x4220cc(_0x235c05[_0x793a('0x19')](0x1f4,_0x50861c[_0x793a('0x1b')]));});});}; \ No newline at end of file +var _0x1cb9=['then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSmsMessage','SmsMessage','create','options','raw','debug','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','request'];(function(_0x56daff,_0xadca9a){var _0x132c82=function(_0x19e0d7){while(--_0x19e0d7){_0x56daff['push'](_0x56daff['shift']());}};_0x132c82(++_0xadca9a);}(_0x1cb9,0x106));var _0x91cb=function(_0x109f9f,_0x123858){_0x109f9f=_0x109f9f-0x0;var _0x1d58e5=_0x1cb9[_0x109f9f];return _0x1d58e5;};'use strict';var _=require(_0x91cb('0x0'));var util=require(_0x91cb('0x1'));var moment=require(_0x91cb('0x2'));var BPromise=require('bluebird');var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x91cb('0x4'))['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))(_0x91cb('0x7'));var config=require(_0x91cb('0x8'));var jayson=require(_0x91cb('0x9'));var client=jayson[_0x91cb('0xa')][_0x91cb('0xb')]({'port':0x232a});config[_0x91cb('0xc')]=_[_0x91cb('0xd')](config['redis'],{'host':_0x91cb('0xe'),'port':0x18eb});var socket=require(_0x91cb('0xf'))(new Redis(config[_0x91cb('0xc')]));require(_0x91cb('0x10'))['register'](socket);function respondWithRpcPromise(_0xb2ec5c,_0x58b345,_0x12e578){return new BPromise(function(_0x29549c,_0x3eef56){return client[_0x91cb('0x11')](_0xb2ec5c,_0x12e578)[_0x91cb('0x12')](function(_0x5280fc){logger[_0x91cb('0x13')](_0x91cb('0x14'),_0x58b345,_0x91cb('0x15'));logger['debug'](_0x91cb('0x16'),_0x58b345,_0x91cb('0x15'),JSON[_0x91cb('0x17')](_0x5280fc));if(_0x5280fc['error']){if(_0x5280fc[_0x91cb('0x18')][_0x91cb('0x19')]===0x1f4){logger['error'](_0x91cb('0x14'),_0x58b345,_0x5280fc[_0x91cb('0x18')]['message']);return _0x3eef56(_0x5280fc['error'][_0x91cb('0x1a')]);}logger[_0x91cb('0x18')](_0x91cb('0x14'),_0x58b345,_0x5280fc[_0x91cb('0x18')]['message']);return _0x29549c(_0x5280fc[_0x91cb('0x18')][_0x91cb('0x1a')]);}else{logger[_0x91cb('0x13')](_0x91cb('0x14'),_0x58b345,'request\x20sent');_0x29549c(_0x5280fc[_0x91cb('0x1b')]['message']);}})[_0x91cb('0x1c')](function(_0x17de56){logger['error']('SmsMessage,\x20%s,\x20%s',_0x58b345,_0x17de56);_0x3eef56(_0x17de56);});});}exports[_0x91cb('0x1d')]=function(_0x5e1a14){var _0x177480=this;return new Promise(function(_0xf49939,_0x3ade85){return db[_0x91cb('0x1e')][_0x91cb('0x1f')](_0x5e1a14['body'],{'raw':_0x5e1a14[_0x91cb('0x20')]?_0x5e1a14[_0x91cb('0x20')][_0x91cb('0x21')]===undefined?!![]:![]:!![]})[_0x91cb('0x12')](function(_0x1260d3){logger[_0x91cb('0x13')]('CreateSmsMessage',_0x5e1a14);logger[_0x91cb('0x22')](_0x91cb('0x1d'),_0x5e1a14,JSON['stringify'](_0x1260d3));_0xf49939(_0x1260d3);})[_0x91cb('0x1c')](function(_0x231f50){logger[_0x91cb('0x18')]('CreateSmsMessage',_0x231f50[_0x91cb('0x1a')],_0x5e1a14);_0x3ade85(_0x177480[_0x91cb('0x18')](0x1f4,_0x231f50['message']));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index d020937..733dfa4 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 _0x2431=['save','remove','update','removeListener','register','length','smsMessage:'];(function(_0x5786d8,_0x225e8e){var _0x4c4fe6=function(_0x2d84ae){while(--_0x2d84ae){_0x5786d8['push'](_0x5786d8['shift']());}};_0x4c4fe6(++_0x225e8e);}(_0x2431,0xee));var _0x1243=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x2431[_0x40a045];return _0x1a687c;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0x1243('0x0'),_0x1243('0x1'),_0x1243('0x2')];function createListener(_0xee7d32,_0x2c4488){return function(_0x2d34da){_0x2c4488['emit'](_0xee7d32,_0x2d34da);};}function removeListener(_0x45e11a,_0x264379){return function(){SmsMessageEvents[_0x1243('0x3')](_0x45e11a,_0x264379);};}exports[_0x1243('0x4')]=function(_0xf6b141){for(var _0x470f03=0x0,_0x5bd54a=events[_0x1243('0x5')];_0x470f03<_0x5bd54a;_0x470f03++){var _0x29599b=events[_0x470f03];var _0x2d0505=createListener(_0x1243('0x6')+_0x29599b,_0xf6b141);SmsMessageEvents['on'](_0x29599b,_0x2d0505);}}; \ No newline at end of file +var _0x3082=['emit','removeListener','register','length','save','remove','update'];(function(_0xd8e459,_0x3c08d1){var _0x50d66d=function(_0x1ce601){while(--_0x1ce601){_0xd8e459['push'](_0xd8e459['shift']());}};_0x50d66d(++_0x3c08d1);}(_0x3082,0x11c));var _0x2308=function(_0x44defc,_0x388fdf){_0x44defc=_0x44defc-0x0;var _0xdb7c42=_0x3082[_0x44defc];return _0xdb7c42;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0x2308('0x0'),_0x2308('0x1'),_0x2308('0x2')];function createListener(_0x20564b,_0x5a6dd7){return function(_0x243b22){_0x5a6dd7[_0x2308('0x3')](_0x20564b,_0x243b22);};}function removeListener(_0x164f1d,_0x27f193){return function(){SmsMessageEvents[_0x2308('0x4')](_0x164f1d,_0x27f193);};}exports[_0x2308('0x5')]=function(_0x55ae86){for(var _0x32eef9=0x0,_0x352435=events[_0x2308('0x6')];_0x32eef9<_0x352435;_0x32eef9++){var _0x408b4c=events[_0x32eef9];var _0x593d24=createListener('smsMessage:'+_0x408b4c,_0x55ae86);SmsMessageEvents['on'](_0x408b4c,_0x593d24);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 51d489c..db5ec83 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 _0xfcc3=['show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./smsQueue.controller','get','isAuthenticated','index','describe','/:id'];(function(_0x124bcb,_0x5b02e0){var _0x4515f3=function(_0x258550){while(--_0x258550){_0x124bcb['push'](_0x124bcb['shift']());}};_0x4515f3(++_0x5b02e0);}(_0xfcc3,0x128));var _0x3fcc=function(_0x48228f,_0x5eaf2b){_0x48228f=_0x48228f-0x0;var _0x2f672a=_0xfcc3[_0x48228f];return _0x2f672a;};'use strict';var multer=require(_0x3fcc('0x0'));var util=require(_0x3fcc('0x1'));var path=require(_0x3fcc('0x2'));var timeout=require(_0x3fcc('0x3'));var express=require(_0x3fcc('0x4'));var router=express[_0x3fcc('0x5')]();var fs_extra=require(_0x3fcc('0x6'));var auth=require(_0x3fcc('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3fcc('0x8'));router[_0x3fcc('0x9')]('/',auth[_0x3fcc('0xa')](),controller[_0x3fcc('0xb')]);router[_0x3fcc('0x9')]('/describe',auth[_0x3fcc('0xa')](),controller[_0x3fcc('0xc')]);router['get'](_0x3fcc('0xd'),auth[_0x3fcc('0xa')](),controller[_0x3fcc('0xe')]);router[_0x3fcc('0x9')](_0x3fcc('0xf'),auth[_0x3fcc('0xa')](),controller[_0x3fcc('0x10')]);router['get'](_0x3fcc('0x11'),auth['isAuthenticated'](),controller[_0x3fcc('0x12')]);router[_0x3fcc('0x9')](_0x3fcc('0x13'),auth[_0x3fcc('0xa')](),controller[_0x3fcc('0x14')]);router[_0x3fcc('0x15')]('/',auth[_0x3fcc('0xa')](),controller[_0x3fcc('0x16')]);router[_0x3fcc('0x15')](_0x3fcc('0x11'),auth[_0x3fcc('0xa')](),controller[_0x3fcc('0x17')]);router[_0x3fcc('0x15')](_0x3fcc('0x13'),auth[_0x3fcc('0xa')](),controller[_0x3fcc('0x18')]);router[_0x3fcc('0x19')](_0x3fcc('0xd'),auth[_0x3fcc('0xa')](),controller[_0x3fcc('0x1a')]);router[_0x3fcc('0x1b')](_0x3fcc('0xd'),auth[_0x3fcc('0xa')](),controller[_0x3fcc('0x1c')]);router[_0x3fcc('0x1b')](_0x3fcc('0x11'),auth['isAuthenticated'](),controller[_0x3fcc('0x1d')]);router[_0x3fcc('0x1b')](_0x3fcc('0x13'),auth[_0x3fcc('0xa')](),controller[_0x3fcc('0x1e')]);module['exports']=router; \ No newline at end of file +var _0x46a4=['isAuthenticated','index','get','/describe','describe','/:id','show','/:id/members','getMembers','getTeams','getAgents','post','/:id/users','addAgents','delete','destroy','removeTeams','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x1cb384,_0x59c92d){var _0x10e25e=function(_0x274ca7){while(--_0x274ca7){_0x1cb384['push'](_0x1cb384['shift']());}};_0x10e25e(++_0x59c92d);}(_0x46a4,0x162));var _0x446a=function(_0x17970b,_0xff614d){_0x17970b=_0x17970b-0x0;var _0x5980b8=_0x46a4[_0x17970b];return _0x5980b8;};'use strict';var multer=require(_0x446a('0x0'));var util=require('util');var path=require(_0x446a('0x1'));var timeout=require(_0x446a('0x2'));var express=require('express');var router=express[_0x446a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x446a('0x4'));var interaction=require(_0x446a('0x5'));var config=require('../../config/environment');var controller=require('./smsQueue.controller');router['get']('/',auth[_0x446a('0x6')](),controller[_0x446a('0x7')]);router[_0x446a('0x8')](_0x446a('0x9'),auth[_0x446a('0x6')](),controller[_0x446a('0xa')]);router[_0x446a('0x8')](_0x446a('0xb'),auth[_0x446a('0x6')](),controller[_0x446a('0xc')]);router['get'](_0x446a('0xd'),auth[_0x446a('0x6')](),controller[_0x446a('0xe')]);router[_0x446a('0x8')]('/:id/teams',auth[_0x446a('0x6')](),controller[_0x446a('0xf')]);router[_0x446a('0x8')]('/:id/users',auth[_0x446a('0x6')](),controller[_0x446a('0x10')]);router[_0x446a('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x446a('0x11')]('/:id/teams',auth[_0x446a('0x6')](),controller['addTeams']);router['post'](_0x446a('0x12'),auth[_0x446a('0x6')](),controller[_0x446a('0x13')]);router['put'](_0x446a('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x446a('0x14')]('/:id',auth[_0x446a('0x6')](),controller[_0x446a('0x15')]);router[_0x446a('0x14')]('/:id/teams',auth[_0x446a('0x6')](),controller[_0x446a('0x16')]);router[_0x446a('0x14')]('/:id/users',auth[_0x446a('0x6')](),controller['removeAgents']);module[_0x446a('0x17')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 85388c6..30a3ecc 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 _0xf991=['sequelize','exports','STRING','name','INTEGER','ENUM','beepall'];(function(_0x3ed4ed,_0x3fd6bd){var _0x20b6da=function(_0x26f4dd){while(--_0x26f4dd){_0x3ed4ed['push'](_0x3ed4ed['shift']());}};_0x20b6da(++_0x3fd6bd);}(_0xf991,0xcb));var _0x1f99=function(_0x2d4a54,_0x1f759f){_0x2d4a54=_0x2d4a54-0x0;var _0x489a0f=_0xf991[_0x2d4a54];return _0x489a0f;};'use strict';var Sequelize=require(_0x1f99('0x0'));module[_0x1f99('0x1')]={'name':{'type':Sequelize[_0x1f99('0x2')],'unique':_0x1f99('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x1f99('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1f99('0x5')]('rrmemory',_0x1f99('0x6'),'roundrobin')}}; \ No newline at end of file +var _0x5bd4=['roundrobin','sequelize','exports','name','STRING','ENUM','rrmemory','beepall'];(function(_0x1acf4f,_0x5aa3e0){var _0x3f8323=function(_0x31fb4b){while(--_0x31fb4b){_0x1acf4f['push'](_0x1acf4f['shift']());}};_0x3f8323(++_0x5aa3e0);}(_0x5bd4,0x129));var _0x45bd=function(_0x30e664,_0x55295e){_0x30e664=_0x30e664-0x0;var _0x12f14b=_0x5bd4[_0x30e664];return _0x12f14b;};'use strict';var Sequelize=require(_0x45bd('0x0'));module[_0x45bd('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x45bd('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x45bd('0x3')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x45bd('0x4')](_0x45bd('0x5'),_0x45bd('0x6'),_0x45bd('0x7'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index f2c409c..45abd7e 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 _0x261b=['zip-dir','fast-json-patch','bluebird','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/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./smsQueue.socket','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','UserProfileResource','stack','send','index','map','SmsQueue','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','name','options','includeAll','include','findAll','rows','catch','show','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','SmsQueues','UserProfileSection','userProfileId','autoAssociation','error','params','describe','getMembers','findOne','rawAttributes','order','SmsQueueId','User','findAndCountAll','UserId','agent','smsPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','Team','nolimit','addTeams','ids','Agents','online','voicePause','sequelize','each','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','union','compact','value','transaction','removeAgents','addAgents','omit','spread','userSmsQueue:save','isArray','userSmsQueue:remove','getAgents','eml-format','rimraf'];(function(_0x2d5382,_0x27eed3){var _0x1c6160=function(_0xb4387b){while(--_0xb4387b){_0x2d5382['push'](_0x2d5382['shift']());}};_0x1c6160(++_0x27eed3);}(_0x261b,0x93));var _0xb261=function(_0x485e61,_0x31c653){_0x485e61=_0x485e61-0x0;var _0x27882f=_0x261b[_0x485e61];return _0x27882f;};'use strict';var emlformat=require(_0xb261('0x0'));var rimraf=require(_0xb261('0x1'));var zipdir=require(_0xb261('0x2'));var jsonpatch=require(_0xb261('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb261('0x4'));var Mustache=require(_0xb261('0x5'));var util=require(_0xb261('0x6'));var path=require(_0xb261('0x7'));var sox=require(_0xb261('0x8'));var csv=require(_0xb261('0x9'));var ejs=require(_0xb261('0xa'));var fs=require('fs');var fs_extra=require(_0xb261('0xb'));var _=require('lodash');var squel=require(_0xb261('0xc'));var crypto=require(_0xb261('0xd'));var jsforce=require(_0xb261('0xe'));var deskjs=require(_0xb261('0xf'));var toCsv=require(_0xb261('0x9'));var querystring=require(_0xb261('0x10'));var Papa=require(_0xb261('0x11'));var Redis=require(_0xb261('0x12'));var authService=require(_0xb261('0x13'));var qs=require(_0xb261('0x14'));var as=require(_0xb261('0x15'));var hardwareService=require(_0xb261('0x16'));var logger=require(_0xb261('0x17'))(_0xb261('0x18'));var utils=require(_0xb261('0x19'));var config=require(_0xb261('0x1a'));var licenseUtil=require(_0xb261('0x1b'));var db=require(_0xb261('0x1c'))['db'];config['redis']=_[_0xb261('0x1d')](config[_0xb261('0x1e')],{'host':_0xb261('0x1f'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xb261('0x20'))['register'](socket);function respondWithStatusCode(_0x30cfa9,_0x3e19c2){_0x3e19c2=_0x3e19c2||0xcc;return function(_0x3ca2ba){if(_0x3ca2ba){return _0x30cfa9[_0xb261('0x21')](_0x3e19c2);}return _0x30cfa9[_0xb261('0x22')](_0x3e19c2)[_0xb261('0x23')]();};}function respondWithResult(_0x3f2982,_0x178171){_0x178171=_0x178171||0xc8;return function(_0x41f1bd){if(_0x41f1bd){return _0x3f2982[_0xb261('0x22')](_0x178171)[_0xb261('0x24')](_0x41f1bd);}};}function respondWithFilteredResult(_0x23f97a,_0x43b85b){return function(_0x268ded){if(_0x268ded){var _0x2c7fb0=typeof _0x43b85b[_0xb261('0x25')]===_0xb261('0x26')&&typeof _0x43b85b['limit']==='undefined';var _0x1d4ad7=_0x268ded[_0xb261('0x27')];var _0x27031c=_0x2c7fb0?0x0:_0x43b85b['offset'];var _0x55187a=_0x2c7fb0?_0x268ded[_0xb261('0x27')]:_0x43b85b[_0xb261('0x25')]+_0x43b85b[_0xb261('0x28')];var _0x126ea9;if(_0x55187a>=_0x1d4ad7){_0x55187a=_0x1d4ad7;_0x126ea9=0xc8;}else{_0x126ea9=0xce;}_0x23f97a[_0xb261('0x22')](_0x126ea9);return _0x23f97a[_0xb261('0x29')](_0xb261('0x2a'),_0x27031c+'-'+_0x55187a+'/'+_0x1d4ad7)[_0xb261('0x24')](_0x268ded);}return null;};}function patchUpdates(_0x2cd3e1){return function(_0x3a0056){try{jsonpatch[_0xb261('0x2b')](_0x3a0056,_0x2cd3e1,!![]);}catch(_0x4b7af7){return BPromise['reject'](_0x4b7af7);}return _0x3a0056[_0xb261('0x2c')]();};}function saveUpdates(_0x4571cd,_0x4f992e){return function(_0x3b6f96){if(_0x3b6f96){return _0x3b6f96[_0xb261('0x2d')](_0x4571cd)[_0xb261('0x2e')](function(_0x4ef7e2){return _0x4ef7e2;});}return null;};}function removeEntity(_0x3f9d6c,_0x3d61d1){return function(_0x4fdf88){if(_0x4fdf88){return _0x4fdf88[_0xb261('0x2f')]()[_0xb261('0x2e')](function(){var _0x3a4c81=_0x4fdf88['get']({'plain':!![]});var _0x3cb91f='SmsQueues';return db[_0xb261('0x30')][_0xb261('0x2f')]({'where':{'type':_0x3cb91f,'resourceId':_0x3a4c81['id']}})[_0xb261('0x2e')](function(){return _0x4fdf88;});})[_0xb261('0x2e')](function(){_0x3f9d6c[_0xb261('0x22')](0xcc)[_0xb261('0x23')]();});}};}function handleEntityNotFound(_0x56a6f6,_0x389738){return function(_0xca6484){if(!_0xca6484){_0x56a6f6['sendStatus'](0x194);}return _0xca6484;};}function handleError(_0x1fa05e,_0x4830a1){_0x4830a1=_0x4830a1||0x1f4;return function(_0x420f6e){logger['error'](_0x420f6e[_0xb261('0x31')]);if(_0x420f6e['name']){delete _0x420f6e['name'];}_0x1fa05e[_0xb261('0x22')](_0x4830a1)[_0xb261('0x32')](_0x420f6e);};}exports[_0xb261('0x33')]=function(_0x21f673,_0x709e82){var _0x461f74={},_0x55538b={},_0x5c5406={'count':0x0,'rows':[]};var _0x6c8c98=_[_0xb261('0x34')](db[_0xb261('0x35')]['rawAttributes'],function(_0x3111ff){return{'name':_0x3111ff['fieldName'],'type':_0x3111ff[_0xb261('0x36')][_0xb261('0x37')]};});_0x55538b[_0xb261('0x38')]=_[_0xb261('0x34')](_0x6c8c98,'name');_0x55538b['query']=_[_0xb261('0x39')](_0x21f673[_0xb261('0x3a')]);_0x55538b[_0xb261('0x3b')]=_[_0xb261('0x3c')](_0x55538b[_0xb261('0x38')],_0x55538b[_0xb261('0x3a')]);_0x461f74[_0xb261('0x3d')]=_['intersection'](_0x55538b[_0xb261('0x38')],qs[_0xb261('0x3e')](_0x21f673[_0xb261('0x3a')]['fields']));_0x461f74['attributes']=_0x461f74[_0xb261('0x3d')][_0xb261('0x3f')]?_0x461f74['attributes']:_0x55538b[_0xb261('0x38')];if(!_0x21f673[_0xb261('0x3a')][_0xb261('0x40')]('nolimit')){_0x461f74[_0xb261('0x28')]=qs[_0xb261('0x28')](_0x21f673['query'][_0xb261('0x28')]);_0x461f74['offset']=qs['offset'](_0x21f673[_0xb261('0x3a')][_0xb261('0x25')]);}_0x461f74['order']=qs[_0xb261('0x41')](_0x21f673[_0xb261('0x3a')][_0xb261('0x41')]);_0x461f74[_0xb261('0x42')]=qs[_0xb261('0x3b')](_[_0xb261('0x43')](_0x21f673['query'],_0x55538b[_0xb261('0x3b')]),_0x6c8c98);if(_0x21f673[_0xb261('0x3a')][_0xb261('0x44')]){_0x461f74[_0xb261('0x42')]=_[_0xb261('0x45')](_0x461f74[_0xb261('0x42')],{'$or':_[_0xb261('0x34')](_0x6c8c98,function(_0x4db0f6){if(_0x4db0f6[_0xb261('0x36')]!=='VIRTUAL'){var _0x159d5f={};_0x159d5f[_0x4db0f6[_0xb261('0x46')]]={'$like':'%'+_0x21f673['query'][_0xb261('0x44')]+'%'};return _0x159d5f;}})});}_0x461f74=_[_0xb261('0x45')]({},_0x461f74,_0x21f673[_0xb261('0x47')]);var _0x36598e={'where':_0x461f74[_0xb261('0x42')]};return db['SmsQueue'][_0xb261('0x27')](_0x36598e)['then'](function(_0x165692){_0x5c5406[_0xb261('0x27')]=_0x165692;if(_0x21f673['query'][_0xb261('0x48')]){_0x461f74[_0xb261('0x49')]=[{'all':!![]}];}return db['SmsQueue'][_0xb261('0x4a')](_0x461f74);})[_0xb261('0x2e')](function(_0xb7a3ab){_0x5c5406[_0xb261('0x4b')]=_0xb7a3ab;return _0x5c5406;})['then'](respondWithFilteredResult(_0x709e82,_0x461f74))[_0xb261('0x4c')](handleError(_0x709e82,null));};exports[_0xb261('0x4d')]=function(_0x4c1dfd,_0x4737c7){var _0xc1f4e1={'raw':!![],'where':{'id':_0x4c1dfd['params']['id']}},_0x3b0b41={};_0x3b0b41[_0xb261('0x38')]=_[_0xb261('0x39')](db['SmsQueue']['rawAttributes']);_0x3b0b41[_0xb261('0x3a')]=_[_0xb261('0x39')](_0x4c1dfd[_0xb261('0x3a')]);_0x3b0b41[_0xb261('0x3b')]=_[_0xb261('0x3c')](_0x3b0b41[_0xb261('0x38')],_0x3b0b41[_0xb261('0x3a')]);_0xc1f4e1[_0xb261('0x3d')]=_[_0xb261('0x3c')](_0x3b0b41[_0xb261('0x38')],qs[_0xb261('0x3e')](_0x4c1dfd[_0xb261('0x3a')][_0xb261('0x3e')]));_0xc1f4e1['attributes']=_0xc1f4e1[_0xb261('0x3d')]['length']?_0xc1f4e1[_0xb261('0x3d')]:_0x3b0b41['model'];if(_0x4c1dfd[_0xb261('0x3a')]['includeAll']){_0xc1f4e1['include']=[{'all':!![]}];}_0xc1f4e1=_[_0xb261('0x45')]({},_0xc1f4e1,_0x4c1dfd[_0xb261('0x47')]);return db[_0xb261('0x35')][_0xb261('0x4e')](_0xc1f4e1)[_0xb261('0x2e')](handleEntityNotFound(_0x4737c7,null))[_0xb261('0x2e')](respondWithResult(_0x4737c7,null))['catch'](handleError(_0x4737c7,null));};exports[_0xb261('0x4f')]=function(_0x4b40a8,_0x287435){return db['SmsQueue'][_0xb261('0x4f')](_0x4b40a8[_0xb261('0x50')],{})['then'](function(_0x58d732){var _0x5a53e2=_0x4b40a8[_0xb261('0x51')][_0xb261('0x52')]({'plain':!![]});if(!_0x5a53e2)throw new Error(_0xb261('0x53'));if(_0x5a53e2['role']===_0xb261('0x51')){var _0x1b3453=_0x58d732[_0xb261('0x52')]({'plain':!![]});var _0x26f811=_0xb261('0x54');return db[_0xb261('0x55')][_0xb261('0x4e')]({'where':{'name':_0x26f811,'userProfileId':_0x5a53e2[_0xb261('0x56')]},'raw':!![]})['then'](function(_0x4f4df8){if(_0x4f4df8&&_0x4f4df8[_0xb261('0x57')]===0x0){return db['UserProfileResource'][_0xb261('0x4f')]({'name':_0x1b3453[_0xb261('0x46')],'resourceId':_0x1b3453['id'],'type':_0x4f4df8[_0xb261('0x46')],'sectionId':_0x4f4df8['id']},{})[_0xb261('0x2e')](function(){return _0x58d732;});}else{return _0x58d732;}})[_0xb261('0x4c')](function(_0x5050c6){logger[_0xb261('0x58')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5050c6);throw _0x5050c6;});}return _0x58d732;})[_0xb261('0x2e')](respondWithResult(_0x287435,0xc9))['catch'](handleError(_0x287435,null));};exports['update']=function(_0xa12284,_0x461af8){if(_0xa12284[_0xb261('0x50')]['id']){delete _0xa12284[_0xb261('0x50')]['id'];}return db[_0xb261('0x35')][_0xb261('0x4e')]({'where':{'id':_0xa12284['params']['id']}})[_0xb261('0x2e')](handleEntityNotFound(_0x461af8,null))[_0xb261('0x2e')](saveUpdates(_0xa12284[_0xb261('0x50')],null))[_0xb261('0x2e')](respondWithResult(_0x461af8,null))[_0xb261('0x4c')](handleError(_0x461af8,null));};exports[_0xb261('0x2f')]=function(_0x1ba85d,_0x1c1ec1){return db[_0xb261('0x35')]['find']({'where':{'id':_0x1ba85d[_0xb261('0x59')]['id']}})[_0xb261('0x2e')](handleEntityNotFound(_0x1c1ec1,null))[_0xb261('0x2e')](removeEntity(_0x1c1ec1,null))[_0xb261('0x4c')](handleError(_0x1c1ec1,null));};exports[_0xb261('0x5a')]=function(_0x37eb7d,_0x25152c){return db[_0xb261('0x35')][_0xb261('0x5a')]()[_0xb261('0x2e')](respondWithResult(_0x25152c,null))['catch'](handleError(_0x25152c,null));};exports[_0xb261('0x5b')]=function(_0x3cff48,_0x38e257,_0x40ec7c){var _0x438196={'raw':!![],'where':{}},_0x2d4c40={},_0x2af2b8;return db['SmsQueue'][_0xb261('0x5c')]({'where':{'id':_0x3cff48[_0xb261('0x59')]['id']}})[_0xb261('0x2e')](handleEntityNotFound(_0x38e257,null))['then'](function(_0x2d6df1){if(_0x2d6df1){_0x2af2b8=_0x2d6df1['get']({'plain':!![]});_0x2d4c40[_0xb261('0x38')]=_[_0xb261('0x39')](db['UserSmsQueue'][_0xb261('0x5d')]);_0x2d4c40[_0xb261('0x3a')]=_['keys'](_0x3cff48[_0xb261('0x3a')]);_0x2d4c40['filters']=_[_0xb261('0x3c')](_0x2d4c40['model'],_0x2d4c40[_0xb261('0x3a')]);_0x438196['attributes']=_[_0xb261('0x3c')](_0x2d4c40[_0xb261('0x38')],qs[_0xb261('0x3e')](_0x3cff48[_0xb261('0x3a')][_0xb261('0x3e')]));_0x438196[_0xb261('0x3d')]=_0x438196['attributes'][_0xb261('0x3f')]?_0x438196[_0xb261('0x3d')]:_0x2d4c40[_0xb261('0x38')];if(!_0x3cff48['query'][_0xb261('0x40')]('nolimit')){_0x438196[_0xb261('0x28')]=qs[_0xb261('0x28')](_0x3cff48[_0xb261('0x3a')][_0xb261('0x28')]);_0x438196[_0xb261('0x25')]=qs[_0xb261('0x25')](_0x3cff48['query'][_0xb261('0x25')]);}_0x438196[_0xb261('0x5e')]=qs[_0xb261('0x41')](_0x3cff48[_0xb261('0x3a')][_0xb261('0x41')]);_0x438196[_0xb261('0x42')]=qs[_0xb261('0x3b')](_['pick'](_0x3cff48['query'],_0x2d4c40[_0xb261('0x3b')]));_0x438196[_0xb261('0x42')][_0xb261('0x5f')]=_0x2d6df1['id'];if(_0x3cff48[_0xb261('0x3a')][_0xb261('0x44')]){_0x438196['where']=_[_0xb261('0x45')](_0x438196[_0xb261('0x42')],{'$or':_[_0xb261('0x34')](_0x438196[_0xb261('0x3d')],function(_0x455fee){var _0x582b20={};_0x582b20[_0x455fee]={'$like':'%'+_0x3cff48['query'][_0xb261('0x44')]+'%'};return _0x582b20;})});}_0x438196=_[_0xb261('0x45')]({},_0x438196,_0x3cff48[_0xb261('0x47')]);return db['UserSmsQueue'][_0xb261('0x4a')](_0x438196);}})[_0xb261('0x2e')](function(_0x47fd00){if(_0x47fd00){return db[_0xb261('0x60')][_0xb261('0x61')]({'where':{'id':_[_0xb261('0x34')](_0x47fd00,_0xb261('0x62')),'role':_0xb261('0x63')},'attributes':['id',_0xb261('0x46'),_0xb261('0x64'),'updatedAt',_0xb261('0x65')]});}})[_0xb261('0x2e')](function(_0x1299ec){if(_0x1299ec){return{'count':_0x1299ec['count'],'rows':_[_0xb261('0x34')](_0x1299ec[_0xb261('0x4b')],function(_0x33753b){return{'membername':_0x33753b[_0xb261('0x46')],'UserId':_0x33753b['id'],'queue_name':_0x2af2b8[_0xb261('0x46')],'SmsQueueId':_0x2af2b8['id'],'interface':util[_0xb261('0x66')](_0xb261('0x67'),_0xb261('0x68'),_0x33753b[_0xb261('0x46')]),'penalty':0x0,'paused':_0x33753b['smsPause'],'createdAt':_0x33753b[_0xb261('0x65')],'updatedAt':_0x33753b[_0xb261('0x69')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xb261('0x2e')](respondWithFilteredResult(_0x38e257,_0x438196))[_0xb261('0x4c')](handleError(_0x38e257,null));};exports[_0xb261('0x6a')]=function(_0x209763,_0x5c99ff,_0x382ebb){var _0x2f5b89={};var _0x1fccaf={};var _0x2b63d6;var _0x284c6d;return db[_0xb261('0x35')]['findOne']({'where':{'id':_0x209763[_0xb261('0x59')]['id']}})[_0xb261('0x2e')](handleEntityNotFound(_0x5c99ff,null))[_0xb261('0x2e')](function(_0x177df8){if(_0x177df8){_0x2b63d6=_0x177df8;_0x1fccaf['model']=_[_0xb261('0x39')](db[_0xb261('0x6b')]['rawAttributes']);_0x1fccaf[_0xb261('0x3a')]=_[_0xb261('0x39')](_0x209763[_0xb261('0x3a')]);_0x1fccaf['filters']=_[_0xb261('0x3c')](_0x1fccaf['model'],_0x1fccaf['query']);_0x2f5b89[_0xb261('0x3d')]=_[_0xb261('0x3c')](_0x1fccaf[_0xb261('0x38')],qs[_0xb261('0x3e')](_0x209763[_0xb261('0x3a')][_0xb261('0x3e')]));_0x2f5b89[_0xb261('0x3d')]=_0x2f5b89[_0xb261('0x3d')][_0xb261('0x3f')]?_0x2f5b89[_0xb261('0x3d')]:_0x1fccaf[_0xb261('0x38')];_0x2f5b89[_0xb261('0x5e')]=qs[_0xb261('0x41')](_0x209763[_0xb261('0x3a')][_0xb261('0x41')]);_0x2f5b89[_0xb261('0x42')]=qs['filters'](_['pick'](_0x209763[_0xb261('0x3a')],_0x1fccaf[_0xb261('0x3b')]));if(_0x209763['query']['filter']){_0x2f5b89['where']=_[_0xb261('0x45')](_0x2f5b89[_0xb261('0x42')],{'$or':_[_0xb261('0x34')](_0x2f5b89[_0xb261('0x3d')],function(_0x488e5f){var _0x2e7896={};_0x2e7896[_0x488e5f]={'$like':'%'+_0x209763[_0xb261('0x3a')][_0xb261('0x44')]+'%'};return _0x2e7896;})});}_0x2f5b89=_['merge']({},_0x2f5b89,_0x209763[_0xb261('0x47')]);return _0x2b63d6['getTeams'](_0x2f5b89);}})[_0xb261('0x2e')](function(_0x2ae742){if(_0x2ae742){_0x284c6d=_0x2ae742[_0xb261('0x3f')];if(!_0x209763['query'][_0xb261('0x40')](_0xb261('0x6c'))){_0x2f5b89['limit']=qs['limit'](_0x209763[_0xb261('0x3a')][_0xb261('0x28')]);_0x2f5b89[_0xb261('0x25')]=qs[_0xb261('0x25')](_0x209763['query']['offset']);}return _0x2b63d6[_0xb261('0x6a')](_0x2f5b89);}})[_0xb261('0x2e')](function(_0x667f03){if(_0x667f03){return _0x667f03?{'count':_0x284c6d,'rows':_0x667f03}:null;}})[_0xb261('0x2e')](respondWithResult(_0x5c99ff,null))['catch'](handleError(_0x5c99ff,null));};exports[_0xb261('0x6d')]=function(_0x3326c1,_0xfd68d8,_0x2ed3ed){var _0x4f2126=_0x3326c1[_0xb261('0x50')][_0xb261('0x6e')];return db[_0xb261('0x6b')][_0xb261('0x4a')]({'where':{'id':_0x4f2126},'attributes':['id'],'include':[{'model':db[_0xb261('0x60')],'as':_0xb261('0x6f'),'attributes':['id',_0xb261('0x46'),_0xb261('0x70'),_0xb261('0x71'),'interface'],'raw':!![]}]})[_0xb261('0x2e')](function(_0x2ec361){if(_0x2ec361){var _0x18f6c8=_['flatMap'](_0x2ec361,function(_0x30664d){var _0x12faea=_0x30664d['get']({'plain':!![]});return _0x12faea[_0xb261('0x6f')];});return db['SmsQueue'][_0xb261('0x4e')]({'where':{'id':_0x3326c1[_0xb261('0x59')]['id']}})['then'](function(_0x74a440){return db[_0xb261('0x72')]['transaction'](function(_0x24d805){return _0x74a440[_0xb261('0x6d')](_0x4f2126,{'transaction':_0x24d805})['then'](function(){return BPromise[_0xb261('0x73')](_0x18f6c8,function(_0x4dfac1){return db['UserSmsQueue'][_0xb261('0x74')]({'where':{'UserId':_0x4dfac1['id'],'SmsQueueId':_0x3326c1[_0xb261('0x59')]['id']},'transaction':_0x24d805});});})[_0xb261('0x2e')](function(){_0x18f6c8[_0xb261('0x75')](function(_0x52b10d){socket[_0xb261('0x76')]('userSmsQueue:save',{'UserId':_0x52b10d['id'],'SmsQueueId':_0x74a440['id']});});});});});}})[_0xb261('0x2e')](respondWithStatusCode(_0xfd68d8,null))['catch'](handleError(_0xfd68d8,null));};exports[_0xb261('0x77')]=function(_0x1e1c67,_0x2e3134,_0x5b2f00){return db[_0xb261('0x6b')][_0xb261('0x4a')]({'where':{'id':_0x1e1c67['query'][_0xb261('0x6e')]},'attributes':['id'],'include':[{'model':db[_0xb261('0x60')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xb261('0x2e')](handleEntityNotFound(_0x2e3134,null))[_0xb261('0x2e')](function(_0x800fcd){var _0x8848dd=_[_0xb261('0x34')](_0x800fcd,'id');var _0x4ca203=[];var _0x1d0c25=[];var _0x44901d=squel[_0xb261('0x78')]();_0x44901d[_0xb261('0x79')](_0xb261('0x7a'))['from'](_0xb261('0x7b'),'tq')[_0xb261('0x7c')](_0xb261('0x7d'),'ut',_0xb261('0x7e'))[_0xb261('0x42')](_0xb261('0x7f'),_0x1e1c67[_0xb261('0x59')]['id']);for(var _0x51e35c=0x0;_0x51e35c<_0x800fcd[_0xb261('0x3f')];_0x51e35c+=0x1){let _0x2ee332=_0x800fcd[_0x51e35c];for(var _0x3593be=0x0;_0x3593be<_0x2ee332[_0xb261('0x6f')]['length'];_0x3593be+=0x1){let _0x50aa52=_0x2ee332[_0xb261('0x6f')][_0x3593be];var _0x4b16de=_0x44901d[_0xb261('0x80')]();_0x4b16de[_0xb261('0x42')](_0xb261('0x81'),_0x50aa52['id']);_0x1d0c25[_0xb261('0x82')](db[_0xb261('0x72')][_0xb261('0x3a')](_0x4b16de[_0xb261('0x83')](),{'type':db[_0xb261('0x72')][_0xb261('0x84')][_0xb261('0x85')]})[_0xb261('0x2e')](function(_0x2fe7e7){if(_0x2fe7e7['length']===0x1){return _0x50aa52['id'];}else{var _0x115593=_[_0xb261('0x86')](_[_0xb261('0x34')](_0x2fe7e7,_0xb261('0x87')),function(_0x2836e1){return _[_0xb261('0x88')](_0x8848dd,_0x2836e1);});if(_0x115593){return _0x50aa52['id'];}}}));}}return BPromise['all'](_0x1d0c25)[_0xb261('0x2e')](function(_0x25b22a){_0x4ca203=_(_0x4ca203)[_0xb261('0x89')](_0x25b22a)[_0xb261('0x8a')]()[_0xb261('0x8b')]();return db['SmsQueue'][_0xb261('0x4e')]({'where':{'id':_0x1e1c67[_0xb261('0x59')]['id']}})[_0xb261('0x2e')](function(_0x525533){return db[_0xb261('0x72')][_0xb261('0x8c')](function(_0x7b2822){return _0x525533[_0xb261('0x77')](_0x1e1c67[_0xb261('0x3a')]['ids'],{'transaction':_0x7b2822})[_0xb261('0x2e')](function(){if(!_['isEmpty'](_0x4ca203)){return _0x525533[_0xb261('0x8d')](_0x4ca203,{'transaction':_0x7b2822});}})[_0xb261('0x2e')](function(){_0x4ca203[_0xb261('0x75')](function(_0x1de07c){socket[_0xb261('0x76')]('userSmsQueue:remove',{'UserId':_0x1de07c,'SmsQueueId':_0x525533['id']});});});});});});})[_0xb261('0x2e')](respondWithStatusCode(_0x2e3134,null))[_0xb261('0x4c')](handleError(_0x2e3134,null));};exports[_0xb261('0x8e')]=function(_0x16bad8,_0x2abcbf,_0x20389c){return db[_0xb261('0x35')][_0xb261('0x4e')]({'where':{'id':_0x16bad8['params']['id']}})[_0xb261('0x2e')](handleEntityNotFound(_0x2abcbf,null))['then'](function(_0x1f2b8b){if(_0x1f2b8b){return _0x1f2b8b['addAgents'](_0x16bad8[_0xb261('0x50')]['ids'],_[_0xb261('0x8f')](_0x16bad8[_0xb261('0x50')],['ids','id'])||{})[_0xb261('0x90')](function(_0x11ea13){for(var _0x2aba9f=0x0;_0x2aba9f<_0x16bad8['body'][_0xb261('0x6e')][_0xb261('0x3f')];_0x2aba9f+=0x1){socket[_0xb261('0x76')](_0xb261('0x91'),{'UserId':Number(_0x16bad8[_0xb261('0x50')]['ids'][_0x2aba9f]),'SmsQueueId':Number(_0x16bad8[_0xb261('0x59')]['id'])});}return _0x11ea13;});}})[_0xb261('0x2e')](respondWithResult(_0x2abcbf,null))[_0xb261('0x4c')](handleError(_0x2abcbf,null));};exports['removeAgents']=function(_0x147d45,_0x562126,_0x4759bc){return db[_0xb261('0x35')][_0xb261('0x4e')]({'where':{'id':_0x147d45['params']['id']}})[_0xb261('0x2e')](handleEntityNotFound(_0x562126,null))['then'](function(_0x2761ec){if(_0x2761ec){return _0x2761ec[_0xb261('0x8d')](_0x147d45[_0xb261('0x3a')][_0xb261('0x6e')])[_0xb261('0x2e')](function(){if(_[_0xb261('0x92')](_0x147d45[_0xb261('0x3a')][_0xb261('0x6e')])){for(var _0x5aa9ed=0x0;_0x5aa9ed<_0x147d45['query'][_0xb261('0x6e')][_0xb261('0x3f')];_0x5aa9ed+=0x1){socket[_0xb261('0x76')](_0xb261('0x93'),{'UserId':Number(_0x147d45[_0xb261('0x3a')][_0xb261('0x6e')][_0x5aa9ed]),'SmsQueueId':Number(_0x147d45[_0xb261('0x59')]['id'])});}}else{socket['emit']('userSmsQueue:remove',{'UserId':Number(_0x147d45[_0xb261('0x3a')][_0xb261('0x6e')]),'SmsQueueId':Number(_0x147d45[_0xb261('0x59')]['id'])});}});}})[_0xb261('0x2e')](respondWithStatusCode(_0x562126,null))[_0xb261('0x4c')](handleError(_0x562126,null));};exports[_0xb261('0x94')]=function(_0x131b6e,_0x6440e2,_0x56956f){var _0xe1962c={};var _0xed5b86={};var _0x1181e5;var _0x7b37d5;return db[_0xb261('0x35')][_0xb261('0x5c')]({'where':{'id':_0x131b6e[_0xb261('0x59')]['id']}})[_0xb261('0x2e')](handleEntityNotFound(_0x6440e2,null))[_0xb261('0x2e')](function(_0x473b7a){if(_0x473b7a){_0x1181e5=_0x473b7a;_0xed5b86[_0xb261('0x38')]=_[_0xb261('0x39')](db[_0xb261('0x60')][_0xb261('0x5d')]);_0xed5b86[_0xb261('0x3a')]=_[_0xb261('0x39')](_0x131b6e[_0xb261('0x3a')]);_0xed5b86[_0xb261('0x3b')]=_[_0xb261('0x3c')](_0xed5b86[_0xb261('0x38')],_0xed5b86['query']);_0xe1962c[_0xb261('0x3d')]=_['intersection'](_0xed5b86[_0xb261('0x38')],qs[_0xb261('0x3e')](_0x131b6e[_0xb261('0x3a')][_0xb261('0x3e')]));_0xe1962c[_0xb261('0x3d')]=_0xe1962c[_0xb261('0x3d')][_0xb261('0x3f')]?_0xe1962c[_0xb261('0x3d')]:_0xed5b86[_0xb261('0x38')];_0xe1962c[_0xb261('0x5e')]=qs[_0xb261('0x41')](_0x131b6e['query'][_0xb261('0x41')]);_0xe1962c[_0xb261('0x42')]=qs[_0xb261('0x3b')](_[_0xb261('0x43')](_0x131b6e['query'],_0xed5b86[_0xb261('0x3b')]));if(_0x131b6e[_0xb261('0x3a')][_0xb261('0x44')]){_0xe1962c[_0xb261('0x42')]=_[_0xb261('0x45')](_0xe1962c[_0xb261('0x42')],{'$or':_['map'](_0xe1962c['attributes'],function(_0x1ebb97){var _0xe5c2b7={};_0xe5c2b7[_0x1ebb97]={'$like':'%'+_0x131b6e[_0xb261('0x3a')]['filter']+'%'};return _0xe5c2b7;})});}_0xe1962c=_[_0xb261('0x45')]({},_0xe1962c,_0x131b6e[_0xb261('0x47')]);return _0x1181e5[_0xb261('0x94')](_0xe1962c);}})[_0xb261('0x2e')](function(_0x3cc929){if(_0x3cc929){_0x7b37d5=_0x3cc929[_0xb261('0x3f')];if(!_0x131b6e['query'][_0xb261('0x40')](_0xb261('0x6c'))){_0xe1962c[_0xb261('0x28')]=qs[_0xb261('0x28')](_0x131b6e[_0xb261('0x3a')][_0xb261('0x28')]);_0xe1962c[_0xb261('0x25')]=qs[_0xb261('0x25')](_0x131b6e[_0xb261('0x3a')][_0xb261('0x25')]);}return _0x1181e5[_0xb261('0x94')](_0xe1962c);}})[_0xb261('0x2e')](function(_0x5c2dae){if(_0x5c2dae){return _0x5c2dae?{'count':_0x7b37d5,'rows':_0x5c2dae}:null;}})[_0xb261('0x2e')](respondWithResult(_0x6440e2,null))['catch'](handleError(_0x6440e2,null));}; \ No newline at end of file +var _0x1a81=['api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','get','destroy','name','send','index','SmsQueue','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','VIRTUAL','merge','includeAll','include','rows','show','params','length','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SmsQueues','UserProfileSection','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','SmsQueueId','findAll','User','findAndCountAll','UserId','updatedAt','SIP','smsPause','createdAt','findOne','Team','getTeams','ids','Agents','flatMap','addTeams','each','UserSmsQueue','findOrCreate','forEach','select','field','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','sequelize','QueryTypes','every','TeamId','all','union','compact','value','transaction','removeTeams','removeAgents','emit','addAgents','omit','spread','userSmsQueue:save','userSmsQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x3b19ea,_0x518b6b){var _0x40ece9=function(_0x3a3386){while(--_0x3a3386){_0x3b19ea['push'](_0x3b19ea['shift']());}};_0x40ece9(++_0x518b6b);}(_0x1a81,0x19b));var _0x11a8=function(_0x2b8898,_0x3e0432){_0x2b8898=_0x2b8898-0x0;var _0x2a6e61=_0x1a81[_0x2b8898];return _0x2a6e61;};'use strict';var emlformat=require(_0x11a8('0x0'));var rimraf=require(_0x11a8('0x1'));var zipdir=require(_0x11a8('0x2'));var jsonpatch=require(_0x11a8('0x3'));var rp=require(_0x11a8('0x4'));var moment=require(_0x11a8('0x5'));var BPromise=require(_0x11a8('0x6'));var Mustache=require(_0x11a8('0x7'));var util=require(_0x11a8('0x8'));var path=require(_0x11a8('0x9'));var sox=require(_0x11a8('0xa'));var csv=require(_0x11a8('0xb'));var ejs=require(_0x11a8('0xc'));var fs=require('fs');var fs_extra=require(_0x11a8('0xd'));var _=require(_0x11a8('0xe'));var squel=require(_0x11a8('0xf'));var crypto=require('crypto');var jsforce=require(_0x11a8('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x11a8('0xb'));var querystring=require(_0x11a8('0x11'));var Papa=require(_0x11a8('0x12'));var Redis=require('ioredis');var authService=require(_0x11a8('0x13'));var qs=require(_0x11a8('0x14'));var as=require(_0x11a8('0x15'));var hardwareService=require(_0x11a8('0x16'));var logger=require(_0x11a8('0x17'))(_0x11a8('0x18'));var utils=require(_0x11a8('0x19'));var config=require(_0x11a8('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x11a8('0x1b'))['db'];config['redis']=_[_0x11a8('0x1c')](config[_0x11a8('0x1d')],{'host':_0x11a8('0x1e'),'port':0x18eb});var socket=require(_0x11a8('0x1f'))(new Redis(config[_0x11a8('0x1d')]));require(_0x11a8('0x20'))[_0x11a8('0x21')](socket);function respondWithStatusCode(_0x9948c7,_0x598cec){_0x598cec=_0x598cec||0xcc;return function(_0x6e9654){if(_0x6e9654){return _0x9948c7[_0x11a8('0x22')](_0x598cec);}return _0x9948c7[_0x11a8('0x23')](_0x598cec)[_0x11a8('0x24')]();};}function respondWithResult(_0x43cb29,_0x78748c){_0x78748c=_0x78748c||0xc8;return function(_0x2b3f1f){if(_0x2b3f1f){return _0x43cb29['status'](_0x78748c)[_0x11a8('0x25')](_0x2b3f1f);}};}function respondWithFilteredResult(_0x1cae52,_0x5ebd86){return function(_0x2b52dd){if(_0x2b52dd){var _0x152743=typeof _0x5ebd86[_0x11a8('0x26')]===_0x11a8('0x27')&&typeof _0x5ebd86[_0x11a8('0x28')]==='undefined';var _0x11a42c=_0x2b52dd[_0x11a8('0x29')];var _0x344d85=_0x152743?0x0:_0x5ebd86[_0x11a8('0x26')];var _0x2f8bcf=_0x152743?_0x2b52dd[_0x11a8('0x29')]:_0x5ebd86[_0x11a8('0x26')]+_0x5ebd86[_0x11a8('0x28')];var _0x342f51;if(_0x2f8bcf>=_0x11a42c){_0x2f8bcf=_0x11a42c;_0x342f51=0xc8;}else{_0x342f51=0xce;}_0x1cae52[_0x11a8('0x23')](_0x342f51);return _0x1cae52['set'](_0x11a8('0x2a'),_0x344d85+'-'+_0x2f8bcf+'/'+_0x11a42c)[_0x11a8('0x25')](_0x2b52dd);}return null;};}function patchUpdates(_0x157bcf){return function(_0x293e07){try{jsonpatch[_0x11a8('0x2b')](_0x293e07,_0x157bcf,!![]);}catch(_0x564725){return BPromise[_0x11a8('0x2c')](_0x564725);}return _0x293e07[_0x11a8('0x2d')]();};}function saveUpdates(_0x223884,_0x32afc6){return function(_0x35aca7){if(_0x35aca7){return _0x35aca7['update'](_0x223884)[_0x11a8('0x2e')](function(_0x2edff2){return _0x2edff2;});}return null;};}function removeEntity(_0x550523,_0x37c5ea){return function(_0x903f33){if(_0x903f33){return _0x903f33['destroy']()[_0x11a8('0x2e')](function(){var _0x56df84=_0x903f33[_0x11a8('0x2f')]({'plain':!![]});var _0x1b8c9c='SmsQueues';return db['UserProfileResource'][_0x11a8('0x30')]({'where':{'type':_0x1b8c9c,'resourceId':_0x56df84['id']}})[_0x11a8('0x2e')](function(){return _0x903f33;});})[_0x11a8('0x2e')](function(){_0x550523['status'](0xcc)[_0x11a8('0x24')]();});}};}function handleEntityNotFound(_0x52923c,_0x557829){return function(_0xae0df8){if(!_0xae0df8){_0x52923c['sendStatus'](0x194);}return _0xae0df8;};}function handleError(_0x26d6b6,_0x223960){_0x223960=_0x223960||0x1f4;return function(_0x300a99){logger['error'](_0x300a99['stack']);if(_0x300a99[_0x11a8('0x31')]){delete _0x300a99[_0x11a8('0x31')];}_0x26d6b6['status'](_0x223960)[_0x11a8('0x32')](_0x300a99);};}exports[_0x11a8('0x33')]=function(_0x48696d,_0x1fc63c){var _0x338dbe={},_0x554dc7={},_0x2ce12a={'count':0x0,'rows':[]};var _0x1e0668=_['map'](db[_0x11a8('0x34')][_0x11a8('0x35')],function(_0x4c9d21){return{'name':_0x4c9d21[_0x11a8('0x36')],'type':_0x4c9d21[_0x11a8('0x37')]['key']};});_0x554dc7[_0x11a8('0x38')]=_['map'](_0x1e0668,_0x11a8('0x31'));_0x554dc7[_0x11a8('0x39')]=_[_0x11a8('0x3a')](_0x48696d['query']);_0x554dc7[_0x11a8('0x3b')]=_['intersection'](_0x554dc7[_0x11a8('0x38')],_0x554dc7[_0x11a8('0x39')]);_0x338dbe[_0x11a8('0x3c')]=_[_0x11a8('0x3d')](_0x554dc7[_0x11a8('0x38')],qs[_0x11a8('0x3e')](_0x48696d['query'][_0x11a8('0x3e')]));_0x338dbe[_0x11a8('0x3c')]=_0x338dbe[_0x11a8('0x3c')]['length']?_0x338dbe[_0x11a8('0x3c')]:_0x554dc7[_0x11a8('0x38')];if(!_0x48696d['query'][_0x11a8('0x3f')](_0x11a8('0x40'))){_0x338dbe['limit']=qs[_0x11a8('0x28')](_0x48696d[_0x11a8('0x39')][_0x11a8('0x28')]);_0x338dbe[_0x11a8('0x26')]=qs[_0x11a8('0x26')](_0x48696d['query'][_0x11a8('0x26')]);}_0x338dbe[_0x11a8('0x41')]=qs[_0x11a8('0x42')](_0x48696d[_0x11a8('0x39')]['sort']);_0x338dbe[_0x11a8('0x43')]=qs[_0x11a8('0x3b')](_[_0x11a8('0x44')](_0x48696d['query'],_0x554dc7['filters']),_0x1e0668);if(_0x48696d[_0x11a8('0x39')][_0x11a8('0x45')]){_0x338dbe[_0x11a8('0x43')]=_['merge'](_0x338dbe[_0x11a8('0x43')],{'$or':_[_0x11a8('0x46')](_0x1e0668,function(_0x2d2f09){if(_0x2d2f09['type']!==_0x11a8('0x47')){var _0x130fc8={};_0x130fc8[_0x2d2f09[_0x11a8('0x31')]]={'$like':'%'+_0x48696d[_0x11a8('0x39')]['filter']+'%'};return _0x130fc8;}})});}_0x338dbe=_[_0x11a8('0x48')]({},_0x338dbe,_0x48696d['options']);var _0x140f41={'where':_0x338dbe[_0x11a8('0x43')]};return db['SmsQueue'][_0x11a8('0x29')](_0x140f41)[_0x11a8('0x2e')](function(_0x2b2d6c){_0x2ce12a['count']=_0x2b2d6c;if(_0x48696d['query'][_0x11a8('0x49')]){_0x338dbe[_0x11a8('0x4a')]=[{'all':!![]}];}return db[_0x11a8('0x34')]['findAll'](_0x338dbe);})['then'](function(_0x1780aa){_0x2ce12a[_0x11a8('0x4b')]=_0x1780aa;return _0x2ce12a;})[_0x11a8('0x2e')](respondWithFilteredResult(_0x1fc63c,_0x338dbe))['catch'](handleError(_0x1fc63c,null));};exports[_0x11a8('0x4c')]=function(_0x2ab44c,_0x624d7b){var _0x58f7a0={'raw':!![],'where':{'id':_0x2ab44c[_0x11a8('0x4d')]['id']}},_0x424555={};_0x424555[_0x11a8('0x38')]=_[_0x11a8('0x3a')](db[_0x11a8('0x34')]['rawAttributes']);_0x424555['query']=_['keys'](_0x2ab44c[_0x11a8('0x39')]);_0x424555[_0x11a8('0x3b')]=_['intersection'](_0x424555[_0x11a8('0x38')],_0x424555[_0x11a8('0x39')]);_0x58f7a0[_0x11a8('0x3c')]=_['intersection'](_0x424555['model'],qs[_0x11a8('0x3e')](_0x2ab44c[_0x11a8('0x39')][_0x11a8('0x3e')]));_0x58f7a0[_0x11a8('0x3c')]=_0x58f7a0[_0x11a8('0x3c')][_0x11a8('0x4e')]?_0x58f7a0[_0x11a8('0x3c')]:_0x424555[_0x11a8('0x38')];if(_0x2ab44c[_0x11a8('0x39')][_0x11a8('0x49')]){_0x58f7a0[_0x11a8('0x4a')]=[{'all':!![]}];}_0x58f7a0=_[_0x11a8('0x48')]({},_0x58f7a0,_0x2ab44c[_0x11a8('0x4f')]);return db['SmsQueue'][_0x11a8('0x50')](_0x58f7a0)['then'](handleEntityNotFound(_0x624d7b,null))['then'](respondWithResult(_0x624d7b,null))[_0x11a8('0x51')](handleError(_0x624d7b,null));};exports['create']=function(_0x3887a0,_0x27ea11){return db[_0x11a8('0x34')][_0x11a8('0x52')](_0x3887a0[_0x11a8('0x53')],{})['then'](function(_0x585826){var _0x4b43b5=_0x3887a0[_0x11a8('0x54')][_0x11a8('0x2f')]({'plain':!![]});if(!_0x4b43b5)throw new Error(_0x11a8('0x55'));if(_0x4b43b5[_0x11a8('0x56')]===_0x11a8('0x54')){var _0x46ce89=_0x585826[_0x11a8('0x2f')]({'plain':!![]});var _0x45d8d7=_0x11a8('0x57');return db[_0x11a8('0x58')][_0x11a8('0x50')]({'where':{'name':_0x45d8d7,'userProfileId':_0x4b43b5['userProfileId']},'raw':!![]})[_0x11a8('0x2e')](function(_0x5d59e9){if(_0x5d59e9&&_0x5d59e9[_0x11a8('0x59')]===0x0){return db[_0x11a8('0x5a')][_0x11a8('0x52')]({'name':_0x46ce89['name'],'resourceId':_0x46ce89['id'],'type':_0x5d59e9[_0x11a8('0x31')],'sectionId':_0x5d59e9['id']},{})['then'](function(){return _0x585826;});}else{return _0x585826;}})['catch'](function(_0x2e4e6c){logger[_0x11a8('0x5b')](_0x11a8('0x5c'),_0x2e4e6c);throw _0x2e4e6c;});}return _0x585826;})[_0x11a8('0x2e')](respondWithResult(_0x27ea11,0xc9))[_0x11a8('0x51')](handleError(_0x27ea11,null));};exports['update']=function(_0x11796a,_0x32a3d7){if(_0x11796a['body']['id']){delete _0x11796a['body']['id'];}return db[_0x11a8('0x34')]['find']({'where':{'id':_0x11796a[_0x11a8('0x4d')]['id']}})[_0x11a8('0x2e')](handleEntityNotFound(_0x32a3d7,null))[_0x11a8('0x2e')](saveUpdates(_0x11796a['body'],null))['then'](respondWithResult(_0x32a3d7,null))[_0x11a8('0x51')](handleError(_0x32a3d7,null));};exports[_0x11a8('0x30')]=function(_0x5b9d2b,_0x27af45){return db[_0x11a8('0x34')][_0x11a8('0x50')]({'where':{'id':_0x5b9d2b['params']['id']}})[_0x11a8('0x2e')](handleEntityNotFound(_0x27af45,null))['then'](removeEntity(_0x27af45,null))['catch'](handleError(_0x27af45,null));};exports[_0x11a8('0x5d')]=function(_0x3ef9f9,_0x123d92){return db[_0x11a8('0x34')]['describe']()[_0x11a8('0x2e')](respondWithResult(_0x123d92,null))['catch'](handleError(_0x123d92,null));};exports[_0x11a8('0x5e')]=function(_0xc354b9,_0x364111,_0x157656){var _0x51a680={'raw':!![],'where':{}},_0x1549a2={},_0x528dad;return db[_0x11a8('0x34')]['findOne']({'where':{'id':_0xc354b9[_0x11a8('0x4d')]['id']}})['then'](handleEntityNotFound(_0x364111,null))[_0x11a8('0x2e')](function(_0x7ead23){if(_0x7ead23){_0x528dad=_0x7ead23['get']({'plain':!![]});_0x1549a2[_0x11a8('0x38')]=_['keys'](db['UserSmsQueue'][_0x11a8('0x35')]);_0x1549a2[_0x11a8('0x39')]=_[_0x11a8('0x3a')](_0xc354b9[_0x11a8('0x39')]);_0x1549a2['filters']=_[_0x11a8('0x3d')](_0x1549a2['model'],_0x1549a2[_0x11a8('0x39')]);_0x51a680[_0x11a8('0x3c')]=_[_0x11a8('0x3d')](_0x1549a2[_0x11a8('0x38')],qs[_0x11a8('0x3e')](_0xc354b9[_0x11a8('0x39')][_0x11a8('0x3e')]));_0x51a680[_0x11a8('0x3c')]=_0x51a680[_0x11a8('0x3c')][_0x11a8('0x4e')]?_0x51a680[_0x11a8('0x3c')]:_0x1549a2[_0x11a8('0x38')];if(!_0xc354b9[_0x11a8('0x39')][_0x11a8('0x3f')](_0x11a8('0x40'))){_0x51a680[_0x11a8('0x28')]=qs[_0x11a8('0x28')](_0xc354b9['query'][_0x11a8('0x28')]);_0x51a680['offset']=qs['offset'](_0xc354b9['query'][_0x11a8('0x26')]);}_0x51a680[_0x11a8('0x41')]=qs['sort'](_0xc354b9[_0x11a8('0x39')]['sort']);_0x51a680[_0x11a8('0x43')]=qs['filters'](_['pick'](_0xc354b9['query'],_0x1549a2[_0x11a8('0x3b')]));_0x51a680[_0x11a8('0x43')][_0x11a8('0x5f')]=_0x7ead23['id'];if(_0xc354b9[_0x11a8('0x39')]['filter']){_0x51a680[_0x11a8('0x43')]=_['merge'](_0x51a680[_0x11a8('0x43')],{'$or':_[_0x11a8('0x46')](_0x51a680['attributes'],function(_0x44cf8e){var _0x42905d={};_0x42905d[_0x44cf8e]={'$like':'%'+_0xc354b9['query'][_0x11a8('0x45')]+'%'};return _0x42905d;})});}_0x51a680=_[_0x11a8('0x48')]({},_0x51a680,_0xc354b9['options']);return db['UserSmsQueue'][_0x11a8('0x60')](_0x51a680);}})[_0x11a8('0x2e')](function(_0x2a47df){if(_0x2a47df){return db[_0x11a8('0x61')][_0x11a8('0x62')]({'where':{'id':_['map'](_0x2a47df,_0x11a8('0x63')),'role':'agent'},'attributes':['id',_0x11a8('0x31'),'smsPause',_0x11a8('0x64'),'createdAt']});}})[_0x11a8('0x2e')](function(_0x26d7c2){if(_0x26d7c2){return{'count':_0x26d7c2[_0x11a8('0x29')],'rows':_[_0x11a8('0x46')](_0x26d7c2[_0x11a8('0x4b')],function(_0x1104bd){return{'membername':_0x1104bd[_0x11a8('0x31')],'UserId':_0x1104bd['id'],'queue_name':_0x528dad[_0x11a8('0x31')],'SmsQueueId':_0x528dad['id'],'interface':util['format']('%s/%s',_0x11a8('0x65'),_0x1104bd[_0x11a8('0x31')]),'penalty':0x0,'paused':_0x1104bd[_0x11a8('0x66')],'createdAt':_0x1104bd[_0x11a8('0x67')],'updatedAt':_0x1104bd[_0x11a8('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x11a8('0x2e')](respondWithFilteredResult(_0x364111,_0x51a680))['catch'](handleError(_0x364111,null));};exports['getTeams']=function(_0x1114d5,_0x3b9a7f,_0x4a9f90){var _0x11554b={};var _0x265c5e={};var _0x583085;var _0x46a121;return db[_0x11a8('0x34')][_0x11a8('0x68')]({'where':{'id':_0x1114d5[_0x11a8('0x4d')]['id']}})[_0x11a8('0x2e')](handleEntityNotFound(_0x3b9a7f,null))[_0x11a8('0x2e')](function(_0x3993b0){if(_0x3993b0){_0x583085=_0x3993b0;_0x265c5e[_0x11a8('0x38')]=_[_0x11a8('0x3a')](db[_0x11a8('0x69')]['rawAttributes']);_0x265c5e[_0x11a8('0x39')]=_[_0x11a8('0x3a')](_0x1114d5[_0x11a8('0x39')]);_0x265c5e[_0x11a8('0x3b')]=_['intersection'](_0x265c5e[_0x11a8('0x38')],_0x265c5e[_0x11a8('0x39')]);_0x11554b[_0x11a8('0x3c')]=_[_0x11a8('0x3d')](_0x265c5e['model'],qs['fields'](_0x1114d5[_0x11a8('0x39')][_0x11a8('0x3e')]));_0x11554b['attributes']=_0x11554b['attributes'][_0x11a8('0x4e')]?_0x11554b[_0x11a8('0x3c')]:_0x265c5e[_0x11a8('0x38')];_0x11554b[_0x11a8('0x41')]=qs[_0x11a8('0x42')](_0x1114d5[_0x11a8('0x39')]['sort']);_0x11554b[_0x11a8('0x43')]=qs[_0x11a8('0x3b')](_['pick'](_0x1114d5['query'],_0x265c5e['filters']));if(_0x1114d5[_0x11a8('0x39')][_0x11a8('0x45')]){_0x11554b[_0x11a8('0x43')]=_['merge'](_0x11554b['where'],{'$or':_[_0x11a8('0x46')](_0x11554b['attributes'],function(_0x5c642c){var _0x8b3661={};_0x8b3661[_0x5c642c]={'$like':'%'+_0x1114d5[_0x11a8('0x39')]['filter']+'%'};return _0x8b3661;})});}_0x11554b=_['merge']({},_0x11554b,_0x1114d5['options']);return _0x583085['getTeams'](_0x11554b);}})['then'](function(_0x1b0285){if(_0x1b0285){_0x46a121=_0x1b0285[_0x11a8('0x4e')];if(!_0x1114d5[_0x11a8('0x39')]['hasOwnProperty'](_0x11a8('0x40'))){_0x11554b[_0x11a8('0x28')]=qs[_0x11a8('0x28')](_0x1114d5[_0x11a8('0x39')][_0x11a8('0x28')]);_0x11554b[_0x11a8('0x26')]=qs[_0x11a8('0x26')](_0x1114d5[_0x11a8('0x39')]['offset']);}return _0x583085[_0x11a8('0x6a')](_0x11554b);}})[_0x11a8('0x2e')](function(_0x390ec4){if(_0x390ec4){return _0x390ec4?{'count':_0x46a121,'rows':_0x390ec4}:null;}})['then'](respondWithResult(_0x3b9a7f,null))['catch'](handleError(_0x3b9a7f,null));};exports['addTeams']=function(_0x30dfec,_0x527594,_0x5493d1){var _0x23c771=_0x30dfec[_0x11a8('0x53')][_0x11a8('0x6b')];return db[_0x11a8('0x69')][_0x11a8('0x60')]({'where':{'id':_0x23c771},'attributes':['id'],'include':[{'model':db['User'],'as':_0x11a8('0x6c'),'attributes':['id',_0x11a8('0x31'),'online','voicePause','interface'],'raw':!![]}]})[_0x11a8('0x2e')](function(_0x41c088){if(_0x41c088){var _0x481059=_[_0x11a8('0x6d')](_0x41c088,function(_0x607edf){var _0x4ccb68=_0x607edf[_0x11a8('0x2f')]({'plain':!![]});return _0x4ccb68[_0x11a8('0x6c')];});return db[_0x11a8('0x34')][_0x11a8('0x50')]({'where':{'id':_0x30dfec[_0x11a8('0x4d')]['id']}})[_0x11a8('0x2e')](function(_0x37c824){return db['sequelize']['transaction'](function(_0x554ae3){return _0x37c824[_0x11a8('0x6e')](_0x23c771,{'transaction':_0x554ae3})[_0x11a8('0x2e')](function(){return BPromise[_0x11a8('0x6f')](_0x481059,function(_0x29ef69){return db[_0x11a8('0x70')][_0x11a8('0x71')]({'where':{'UserId':_0x29ef69['id'],'SmsQueueId':_0x30dfec[_0x11a8('0x4d')]['id']},'transaction':_0x554ae3});});})[_0x11a8('0x2e')](function(){_0x481059[_0x11a8('0x72')](function(_0x23167f){socket['emit']('userSmsQueue:save',{'UserId':_0x23167f['id'],'SmsQueueId':_0x37c824['id']});});});});});}})['then'](respondWithStatusCode(_0x527594,null))[_0x11a8('0x51')](handleError(_0x527594,null));};exports['removeTeams']=function(_0x515d18,_0x5915e2,_0x10851a){return db[_0x11a8('0x69')][_0x11a8('0x60')]({'where':{'id':_0x515d18[_0x11a8('0x39')][_0x11a8('0x6b')]},'attributes':['id'],'include':[{'model':db[_0x11a8('0x61')],'as':_0x11a8('0x6c'),'attributes':['id'],'raw':!![]}]})[_0x11a8('0x2e')](handleEntityNotFound(_0x5915e2,null))[_0x11a8('0x2e')](function(_0x2756b0){var _0x1b2449=_['map'](_0x2756b0,'id');var _0x169026=[];var _0x3dc898=[];var _0x33161f=squel[_0x11a8('0x73')]();_0x33161f[_0x11a8('0x74')](_0x11a8('0x75'))[_0x11a8('0x76')](_0x11a8('0x77'),'tq')[_0x11a8('0x78')](_0x11a8('0x79'),'ut',_0x11a8('0x7a'))[_0x11a8('0x43')](_0x11a8('0x7b'),_0x515d18[_0x11a8('0x4d')]['id']);for(var _0xa4d8a3=0x0;_0xa4d8a3<_0x2756b0[_0x11a8('0x4e')];_0xa4d8a3+=0x1){let _0x151804=_0x2756b0[_0xa4d8a3];for(var _0x327e75=0x0;_0x327e75<_0x151804[_0x11a8('0x6c')][_0x11a8('0x4e')];_0x327e75+=0x1){let _0x300cb7=_0x151804['Agents'][_0x327e75];var _0x24d46f=_0x33161f[_0x11a8('0x7c')]();_0x24d46f[_0x11a8('0x43')](_0x11a8('0x7d'),_0x300cb7['id']);_0x3dc898['push'](db['sequelize']['query'](_0x24d46f[_0x11a8('0x7e')](),{'type':db[_0x11a8('0x7f')][_0x11a8('0x80')]['SELECT']})[_0x11a8('0x2e')](function(_0x5e9d35){if(_0x5e9d35[_0x11a8('0x4e')]===0x1){return _0x300cb7['id'];}else{var _0x58b912=_[_0x11a8('0x81')](_[_0x11a8('0x46')](_0x5e9d35,_0x11a8('0x82')),function(_0x452f73){return _['includes'](_0x1b2449,_0x452f73);});if(_0x58b912){return _0x300cb7['id'];}}}));}}return BPromise[_0x11a8('0x83')](_0x3dc898)[_0x11a8('0x2e')](function(_0xd86baa){_0x169026=_(_0x169026)[_0x11a8('0x84')](_0xd86baa)[_0x11a8('0x85')]()[_0x11a8('0x86')]();return db['SmsQueue']['find']({'where':{'id':_0x515d18[_0x11a8('0x4d')]['id']}})[_0x11a8('0x2e')](function(_0x443a48){return db[_0x11a8('0x7f')][_0x11a8('0x87')](function(_0x4d05df){return _0x443a48[_0x11a8('0x88')](_0x515d18[_0x11a8('0x39')]['ids'],{'transaction':_0x4d05df})[_0x11a8('0x2e')](function(){if(!_['isEmpty'](_0x169026)){return _0x443a48[_0x11a8('0x89')](_0x169026,{'transaction':_0x4d05df});}})[_0x11a8('0x2e')](function(){_0x169026[_0x11a8('0x72')](function(_0x581ced){socket[_0x11a8('0x8a')]('userSmsQueue:remove',{'UserId':_0x581ced,'SmsQueueId':_0x443a48['id']});});});});});});})[_0x11a8('0x2e')](respondWithStatusCode(_0x5915e2,null))[_0x11a8('0x51')](handleError(_0x5915e2,null));};exports[_0x11a8('0x8b')]=function(_0x4ae195,_0x179a00,_0x4fef76){return db[_0x11a8('0x34')][_0x11a8('0x50')]({'where':{'id':_0x4ae195[_0x11a8('0x4d')]['id']}})[_0x11a8('0x2e')](handleEntityNotFound(_0x179a00,null))[_0x11a8('0x2e')](function(_0x3b67f2){if(_0x3b67f2){return _0x3b67f2[_0x11a8('0x8b')](_0x4ae195[_0x11a8('0x53')][_0x11a8('0x6b')],_[_0x11a8('0x8c')](_0x4ae195['body'],[_0x11a8('0x6b'),'id'])||{})[_0x11a8('0x8d')](function(_0x33be37){for(var _0x4b5527=0x0;_0x4b5527<_0x4ae195[_0x11a8('0x53')]['ids'][_0x11a8('0x4e')];_0x4b5527+=0x1){socket[_0x11a8('0x8a')](_0x11a8('0x8e'),{'UserId':Number(_0x4ae195[_0x11a8('0x53')]['ids'][_0x4b5527]),'SmsQueueId':Number(_0x4ae195[_0x11a8('0x4d')]['id'])});}return _0x33be37;});}})[_0x11a8('0x2e')](respondWithResult(_0x179a00,null))['catch'](handleError(_0x179a00,null));};exports[_0x11a8('0x89')]=function(_0x352ffb,_0x3785aa,_0x1179c3){return db['SmsQueue'][_0x11a8('0x50')]({'where':{'id':_0x352ffb['params']['id']}})[_0x11a8('0x2e')](handleEntityNotFound(_0x3785aa,null))[_0x11a8('0x2e')](function(_0x9935ab){if(_0x9935ab){return _0x9935ab['removeAgents'](_0x352ffb[_0x11a8('0x39')][_0x11a8('0x6b')])[_0x11a8('0x2e')](function(){if(_['isArray'](_0x352ffb['query'][_0x11a8('0x6b')])){for(var _0x342deb=0x0;_0x342deb<_0x352ffb[_0x11a8('0x39')][_0x11a8('0x6b')][_0x11a8('0x4e')];_0x342deb+=0x1){socket[_0x11a8('0x8a')]('userSmsQueue:remove',{'UserId':Number(_0x352ffb[_0x11a8('0x39')][_0x11a8('0x6b')][_0x342deb]),'SmsQueueId':Number(_0x352ffb[_0x11a8('0x4d')]['id'])});}}else{socket[_0x11a8('0x8a')](_0x11a8('0x8f'),{'UserId':Number(_0x352ffb[_0x11a8('0x39')][_0x11a8('0x6b')]),'SmsQueueId':Number(_0x352ffb[_0x11a8('0x4d')]['id'])});}});}})['then'](respondWithStatusCode(_0x3785aa,null))[_0x11a8('0x51')](handleError(_0x3785aa,null));};exports['getAgents']=function(_0x3085a8,_0x5817f0,_0x2b0cf5){var _0x48db89={};var _0x1fcdd9={};var _0xf6225b;var _0x4cced7;return db[_0x11a8('0x34')][_0x11a8('0x68')]({'where':{'id':_0x3085a8['params']['id']}})[_0x11a8('0x2e')](handleEntityNotFound(_0x5817f0,null))['then'](function(_0x1b2103){if(_0x1b2103){_0xf6225b=_0x1b2103;_0x1fcdd9['model']=_[_0x11a8('0x3a')](db[_0x11a8('0x61')][_0x11a8('0x35')]);_0x1fcdd9['query']=_[_0x11a8('0x3a')](_0x3085a8['query']);_0x1fcdd9[_0x11a8('0x3b')]=_[_0x11a8('0x3d')](_0x1fcdd9[_0x11a8('0x38')],_0x1fcdd9[_0x11a8('0x39')]);_0x48db89[_0x11a8('0x3c')]=_['intersection'](_0x1fcdd9['model'],qs[_0x11a8('0x3e')](_0x3085a8[_0x11a8('0x39')][_0x11a8('0x3e')]));_0x48db89[_0x11a8('0x3c')]=_0x48db89[_0x11a8('0x3c')]['length']?_0x48db89[_0x11a8('0x3c')]:_0x1fcdd9[_0x11a8('0x38')];_0x48db89['order']=qs[_0x11a8('0x42')](_0x3085a8['query'][_0x11a8('0x42')]);_0x48db89['where']=qs['filters'](_['pick'](_0x3085a8['query'],_0x1fcdd9[_0x11a8('0x3b')]));if(_0x3085a8['query'][_0x11a8('0x45')]){_0x48db89[_0x11a8('0x43')]=_['merge'](_0x48db89[_0x11a8('0x43')],{'$or':_[_0x11a8('0x46')](_0x48db89[_0x11a8('0x3c')],function(_0x2e1244){var _0x29ce6f={};_0x29ce6f[_0x2e1244]={'$like':'%'+_0x3085a8[_0x11a8('0x39')]['filter']+'%'};return _0x29ce6f;})});}_0x48db89=_[_0x11a8('0x48')]({},_0x48db89,_0x3085a8[_0x11a8('0x4f')]);return _0xf6225b[_0x11a8('0x90')](_0x48db89);}})[_0x11a8('0x2e')](function(_0x2c17aa){if(_0x2c17aa){_0x4cced7=_0x2c17aa['length'];if(!_0x3085a8['query'][_0x11a8('0x3f')](_0x11a8('0x40'))){_0x48db89[_0x11a8('0x28')]=qs[_0x11a8('0x28')](_0x3085a8[_0x11a8('0x39')]['limit']);_0x48db89[_0x11a8('0x26')]=qs[_0x11a8('0x26')](_0x3085a8['query'][_0x11a8('0x26')]);}return _0xf6225b[_0x11a8('0x90')](_0x48db89);}})[_0x11a8('0x2e')](function(_0x5966f4){if(_0x5966f4){return _0x5966f4?{'count':_0x4cced7,'rows':_0x5966f4}:null;}})['then'](respondWithResult(_0x5817f0,null))[_0x11a8('0x51')](handleError(_0x5817f0,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 0ccec5d..18abec5 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 _0xb5a7=['events','SmsQueue','save','update','emit','hasOwnProperty','exports'];(function(_0x2d34d6,_0x397ff9){var _0x1d3d12=function(_0x558800){while(--_0x558800){_0x2d34d6['push'](_0x2d34d6['shift']());}};_0x1d3d12(++_0x397ff9);}(_0xb5a7,0x8c));var _0x7b5a=function(_0x8fda2a,_0x560a0a){_0x8fda2a=_0x8fda2a-0x0;var _0x1656ab=_0xb5a7[_0x8fda2a];return _0x1656ab;};'use strict';var EventEmitter=require(_0x7b5a('0x0'));var SmsQueue=require('../../mysqldb')['db'][_0x7b5a('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7b5a('0x2'),'afterUpdate':_0x7b5a('0x3'),'afterDestroy':'remove'};function emitEvent(_0x47b536){return function(_0x2ecd6f,_0x17dd5e,_0x28dc15){SmsQueueEvents[_0x7b5a('0x4')](_0x47b536+':'+_0x2ecd6f['id'],_0x2ecd6f);SmsQueueEvents[_0x7b5a('0x4')](_0x47b536,_0x2ecd6f);_0x28dc15(null);};}for(var e in events){if(events[_0x7b5a('0x5')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0x7b5a('0x6')]=SmsQueueEvents; \ No newline at end of file +var _0x8e2b=['update','remove','emit','hasOwnProperty','hook','events','SmsQueue','setMaxListeners','save'];(function(_0x442ccd,_0x415d61){var _0x1a2c10=function(_0x4ddd45){while(--_0x4ddd45){_0x442ccd['push'](_0x442ccd['shift']());}};_0x1a2c10(++_0x415d61);}(_0x8e2b,0x95));var _0xb8e2=function(_0x478b76,_0x260ac9){_0x478b76=_0x478b76-0x0;var _0x247298=_0x8e2b[_0x478b76];return _0x247298;};'use strict';var EventEmitter=require(_0xb8e2('0x0'));var SmsQueue=require('../../mysqldb')['db'][_0xb8e2('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xb8e2('0x2')](0x0);var events={'afterCreate':_0xb8e2('0x3'),'afterUpdate':_0xb8e2('0x4'),'afterDestroy':_0xb8e2('0x5')};function emitEvent(_0x29d283){return function(_0x497a00,_0x1d7e07,_0x3527bb){SmsQueueEvents[_0xb8e2('0x6')](_0x29d283+':'+_0x497a00['id'],_0x497a00);SmsQueueEvents[_0xb8e2('0x6')](_0x29d283,_0x497a00);_0x3527bb(null);};}for(var e in events){if(events[_0xb8e2('0x7')](e)){var event=events[e];SmsQueue[_0xb8e2('0x8')](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 634e036..a91500b 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 _0xce49=['./smsQueue.attributes','exports','define','SmsQueue','sms_queues','util','api','bluebird','request-promise','path','../../config/environment'];(function(_0x5e9b9c,_0x192a85){var _0x2dc972=function(_0xff41ae){while(--_0xff41ae){_0x5e9b9c['push'](_0x5e9b9c['shift']());}};_0x2dc972(++_0x192a85);}(_0xce49,0xd6));var _0x9ce4=function(_0x7893dd,_0x4f12b6){_0x7893dd=_0x7893dd-0x0;var _0x3f5f89=_0xce49[_0x7893dd];return _0x3f5f89;};'use strict';var _=require('lodash');var util=require(_0x9ce4('0x0'));var logger=require('../../config/logger')(_0x9ce4('0x1'));var moment=require('moment');var BPromise=require(_0x9ce4('0x2'));var rp=require(_0x9ce4('0x3'));var fs=require('fs');var path=require(_0x9ce4('0x4'));var rimraf=require('rimraf');var config=require(_0x9ce4('0x5'));var attributes=require(_0x9ce4('0x6'));module[_0x9ce4('0x7')]=function(_0x197f3f,_0x4090d4){return _0x197f3f[_0x9ce4('0x8')](_0x9ce4('0x9'),attributes,{'tableName':_0x9ce4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa251=['api','moment','bluebird','request-promise','rimraf','./smsQueue.attributes','exports','define','SmsQueue','sms_queues','lodash'];(function(_0xca1091,_0x539dbf){var _0xd3019c=function(_0xd629e0){while(--_0xd629e0){_0xca1091['push'](_0xca1091['shift']());}};_0xd3019c(++_0x539dbf);}(_0xa251,0x11d));var _0x1a25=function(_0x36e57d,_0x509bde){_0x36e57d=_0x36e57d-0x0;var _0x36213f=_0xa251[_0x36e57d];return _0x36213f;};'use strict';var _=require(_0x1a25('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1a25('0x1'));var moment=require(_0x1a25('0x2'));var BPromise=require(_0x1a25('0x3'));var rp=require(_0x1a25('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1a25('0x5'));var config=require('../../config/environment');var attributes=require(_0x1a25('0x6'));module[_0x1a25('0x7')]=function(_0x4d9735,_0x5bce35){return _0x4d9735[_0x1a25('0x8')](_0x1a25('0x9'),attributes,{'tableName':_0x1a25('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.rpc.js b/server/api/smsQueue/smsQueue.rpc.js index 8bf825e..7b77b11 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 _0x2101=['register','request','info','SmsQueue,\x20%s,\x20%s','debug','SmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','result','catch','SmsQueue','options','where','attributes','limit','include','map','model','then','GetSmsQueue','raw','ShowSmsQueue','stringify','lodash','util','moment','../../mysqldb','../../config/logger','rpc','../../config/environment','http','redis','localhost'];(function(_0x19f9b2,_0x59b3a0){var _0x203985=function(_0x58a4b1){while(--_0x58a4b1){_0x19f9b2['push'](_0x19f9b2['shift']());}};_0x203985(++_0x59b3a0);}(_0x2101,0xa5));var _0x1210=function(_0x28b660,_0x8807b7){_0x28b660=_0x28b660-0x0;var _0x2663fc=_0x2101[_0x28b660];return _0x2663fc;};'use strict';var _=require(_0x1210('0x0'));var util=require(_0x1210('0x1'));var moment=require(_0x1210('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1210('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x1210('0x4'))(_0x1210('0x5'));var config=require(_0x1210('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1210('0x7')]({'port':0x232a});config[_0x1210('0x8')]=_['defaults'](config[_0x1210('0x8')],{'host':_0x1210('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1210('0x8')]));require('./smsQueue.socket')[_0x1210('0xa')](socket);function respondWithRpcPromise(_0x1346c9,_0x305c14,_0x41ab17){return new BPromise(function(_0x10975d,_0x553d08){return client[_0x1210('0xb')](_0x1346c9,_0x41ab17)['then'](function(_0x49b0a1){logger[_0x1210('0xc')](_0x1210('0xd'),_0x305c14,'request\x20sent');logger[_0x1210('0xe')](_0x1210('0xf'),_0x305c14,_0x1210('0x10'),JSON['stringify'](_0x49b0a1));if(_0x49b0a1['error']){if(_0x49b0a1['error'][_0x1210('0x11')]===0x1f4){logger['error']('SmsQueue,\x20%s,\x20%s',_0x305c14,_0x49b0a1[_0x1210('0x12')][_0x1210('0x13')]);return _0x553d08(_0x49b0a1[_0x1210('0x12')][_0x1210('0x13')]);}logger[_0x1210('0x12')](_0x1210('0xd'),_0x305c14,_0x49b0a1[_0x1210('0x12')]['message']);return _0x10975d(_0x49b0a1[_0x1210('0x12')][_0x1210('0x13')]);}else{logger[_0x1210('0xc')](_0x1210('0xd'),_0x305c14,'request\x20sent');_0x10975d(_0x49b0a1[_0x1210('0x14')][_0x1210('0x13')]);}})[_0x1210('0x15')](function(_0x304e45){logger[_0x1210('0x12')](_0x1210('0xd'),_0x305c14,_0x304e45);_0x553d08(_0x304e45);});});}exports['GetSmsQueue']=function(_0x52a3a1){var _0x3bed13=this;return new Promise(function(_0x4fe0c9,_0x2425f7){return db[_0x1210('0x16')]['findAll']({'raw':_0x52a3a1[_0x1210('0x17')]?_0x52a3a1['options']['raw']===undefined?!![]:![]:!![],'where':_0x52a3a1[_0x1210('0x17')]?_0x52a3a1[_0x1210('0x17')][_0x1210('0x18')]||null:null,'attributes':_0x52a3a1[_0x1210('0x17')]?_0x52a3a1[_0x1210('0x17')][_0x1210('0x19')]||null:null,'limit':_0x52a3a1['options']?_0x52a3a1[_0x1210('0x17')][_0x1210('0x1a')]||null:null,'include':_0x52a3a1['options']?_0x52a3a1[_0x1210('0x17')][_0x1210('0x1b')]?_[_0x1210('0x1c')](_0x52a3a1[_0x1210('0x17')][_0x1210('0x1b')],function(_0x5b7614){return{'model':db[_0x5b7614[_0x1210('0x1d')]],'as':_0x5b7614['as'],'attributes':_0x5b7614[_0x1210('0x19')],'include':_0x5b7614['include']?_[_0x1210('0x1c')](_0x5b7614[_0x1210('0x1b')],function(_0x50bb59){return{'model':db[_0x50bb59[_0x1210('0x1d')]],'as':_0x50bb59['as'],'attributes':_0x50bb59['attributes'],'include':_0x50bb59['include']?_['map'](_0x50bb59[_0x1210('0x1b')],function(_0x5a5cb7){return{'model':db[_0x5a5cb7['model']],'as':_0x5a5cb7['as'],'attributes':_0x5a5cb7[_0x1210('0x19')]};}):[]};}):[]};}):[]:[]})[_0x1210('0x1e')](function(_0x58ad00){logger[_0x1210('0xc')](_0x1210('0x1f'),_0x52a3a1);logger[_0x1210('0xe')](_0x1210('0x1f'),_0x52a3a1,JSON['stringify'](_0x58ad00));_0x4fe0c9(_0x58ad00);})[_0x1210('0x15')](function(_0x19d282){logger[_0x1210('0x12')](_0x1210('0x1f'),_0x19d282[_0x1210('0x13')],_0x52a3a1);_0x2425f7(_0x3bed13[_0x1210('0x12')](0x1f4,_0x19d282[_0x1210('0x13')]));});});};exports['ShowSmsQueue']=function(_0x3bf095){var _0x14b742=this;return new Promise(function(_0x32083f,_0x22f134){return db[_0x1210('0x16')]['find']({'raw':_0x3bf095[_0x1210('0x17')]?_0x3bf095['options'][_0x1210('0x20')]===undefined?!![]:![]:!![],'where':_0x3bf095[_0x1210('0x17')]?_0x3bf095[_0x1210('0x17')][_0x1210('0x18')]||null:null,'attributes':_0x3bf095[_0x1210('0x17')]?_0x3bf095[_0x1210('0x17')][_0x1210('0x19')]||null:null,'include':_0x3bf095[_0x1210('0x17')]?_0x3bf095['options'][_0x1210('0x1b')]?_[_0x1210('0x1c')](_0x3bf095[_0x1210('0x17')]['include'],function(_0x34158b){return{'model':db[_0x34158b[_0x1210('0x1d')]],'as':_0x34158b['as'],'attributes':_0x34158b[_0x1210('0x19')],'include':_0x34158b['include']?_[_0x1210('0x1c')](_0x34158b['include'],function(_0x3a3d28){return{'model':db[_0x3a3d28[_0x1210('0x1d')]],'as':_0x3a3d28['as'],'attributes':_0x3a3d28[_0x1210('0x19')],'include':_0x3a3d28[_0x1210('0x1b')]?_['map'](_0x3a3d28[_0x1210('0x1b')],function(_0x29b6ce){return{'model':db[_0x29b6ce['model']],'as':_0x29b6ce['as'],'attributes':_0x29b6ce['attributes']};}):[]};}):[]};}):[]:[]})[_0x1210('0x1e')](function(_0x5b4708){logger[_0x1210('0xc')](_0x1210('0x21'),_0x3bf095);logger[_0x1210('0xe')](_0x1210('0x21'),_0x3bf095,JSON[_0x1210('0x22')](_0x5b4708));_0x32083f(_0x5b4708);})[_0x1210('0x15')](function(_0x3d4919){logger[_0x1210('0x12')](_0x1210('0x21'),_0x3d4919[_0x1210('0x13')],_0x3bf095);_0x22f134(_0x14b742[_0x1210('0x12')](0x1f4,_0x3d4919['message']));});});}; \ No newline at end of file +var _0x653c=['SmsQueue','options','raw','where','attributes','limit','include','map','model','GetSmsQueue','ShowSmsQueue','find','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','./smsQueue.socket','register','request','then','SmsQueue,\x20%s,\x20%s','request\x20sent','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch'];(function(_0x3bd43b,_0x49f484){var _0x4f1b39=function(_0x4140a4){while(--_0x4140a4){_0x3bd43b['push'](_0x3bd43b['shift']());}};_0x4f1b39(++_0x49f484);}(_0x653c,0x155));var _0xc653=function(_0x349c54,_0x2f0bbf){_0x349c54=_0x349c54-0x0;var _0xb46647=_0x653c[_0x349c54];return _0xb46647;};'use strict';var _=require(_0xc653('0x0'));var util=require(_0xc653('0x1'));var moment=require(_0xc653('0x2'));var BPromise=require(_0xc653('0x3'));var rs=require(_0xc653('0x4'));var fs=require('fs');var Redis=require(_0xc653('0x5'));var db=require(_0xc653('0x6'))['db'];var utils=require(_0xc653('0x7'));var logger=require(_0xc653('0x8'))('rpc');var config=require(_0xc653('0x9'));var jayson=require(_0xc653('0xa'));var client=jayson['client'][_0xc653('0xb')]({'port':0x232a});config[_0xc653('0xc')]=_[_0xc653('0xd')](config[_0xc653('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc653('0xc')]));require(_0xc653('0xe'))[_0xc653('0xf')](socket);function respondWithRpcPromise(_0x550621,_0x32dddb,_0x42778b){return new BPromise(function(_0x3202bb,_0x54aa7a){return client[_0xc653('0x10')](_0x550621,_0x42778b)[_0xc653('0x11')](function(_0x1b1928){logger['info'](_0xc653('0x12'),_0x32dddb,_0xc653('0x13'));logger['debug'](_0xc653('0x14'),_0x32dddb,_0xc653('0x13'),JSON[_0xc653('0x15')](_0x1b1928));if(_0x1b1928[_0xc653('0x16')]){if(_0x1b1928[_0xc653('0x16')][_0xc653('0x17')]===0x1f4){logger['error'](_0xc653('0x12'),_0x32dddb,_0x1b1928[_0xc653('0x16')]['message']);return _0x54aa7a(_0x1b1928[_0xc653('0x16')][_0xc653('0x18')]);}logger[_0xc653('0x16')](_0xc653('0x12'),_0x32dddb,_0x1b1928[_0xc653('0x16')][_0xc653('0x18')]);return _0x3202bb(_0x1b1928['error']['message']);}else{logger[_0xc653('0x19')](_0xc653('0x12'),_0x32dddb,_0xc653('0x13'));_0x3202bb(_0x1b1928[_0xc653('0x1a')][_0xc653('0x18')]);}})[_0xc653('0x1b')](function(_0x1cc88f){logger[_0xc653('0x16')](_0xc653('0x12'),_0x32dddb,_0x1cc88f);_0x54aa7a(_0x1cc88f);});});}exports['GetSmsQueue']=function(_0x441f97){var _0x18baab=this;return new Promise(function(_0x5f0cd0,_0x8aee03){return db[_0xc653('0x1c')]['findAll']({'raw':_0x441f97[_0xc653('0x1d')]?_0x441f97[_0xc653('0x1d')][_0xc653('0x1e')]===undefined?!![]:![]:!![],'where':_0x441f97[_0xc653('0x1d')]?_0x441f97[_0xc653('0x1d')][_0xc653('0x1f')]||null:null,'attributes':_0x441f97[_0xc653('0x1d')]?_0x441f97[_0xc653('0x1d')][_0xc653('0x20')]||null:null,'limit':_0x441f97[_0xc653('0x1d')]?_0x441f97[_0xc653('0x1d')][_0xc653('0x21')]||null:null,'include':_0x441f97[_0xc653('0x1d')]?_0x441f97[_0xc653('0x1d')][_0xc653('0x22')]?_[_0xc653('0x23')](_0x441f97[_0xc653('0x1d')][_0xc653('0x22')],function(_0x5f2d27){return{'model':db[_0x5f2d27[_0xc653('0x24')]],'as':_0x5f2d27['as'],'attributes':_0x5f2d27[_0xc653('0x20')],'include':_0x5f2d27['include']?_[_0xc653('0x23')](_0x5f2d27[_0xc653('0x22')],function(_0x1432ac){return{'model':db[_0x1432ac[_0xc653('0x24')]],'as':_0x1432ac['as'],'attributes':_0x1432ac['attributes'],'include':_0x1432ac['include']?_[_0xc653('0x23')](_0x1432ac[_0xc653('0x22')],function(_0x4eb0f3){return{'model':db[_0x4eb0f3[_0xc653('0x24')]],'as':_0x4eb0f3['as'],'attributes':_0x4eb0f3[_0xc653('0x20')]};}):[]};}):[]};}):[]:[]})[_0xc653('0x11')](function(_0xed7d1a){logger[_0xc653('0x19')](_0xc653('0x25'),_0x441f97);logger['debug']('GetSmsQueue',_0x441f97,JSON[_0xc653('0x15')](_0xed7d1a));_0x5f0cd0(_0xed7d1a);})[_0xc653('0x1b')](function(_0x3a27e6){logger[_0xc653('0x16')]('GetSmsQueue',_0x3a27e6[_0xc653('0x18')],_0x441f97);_0x8aee03(_0x18baab['error'](0x1f4,_0x3a27e6[_0xc653('0x18')]));});});};exports[_0xc653('0x26')]=function(_0x33db6f){var _0x2482fd=this;return new Promise(function(_0x3483da,_0x2c0b70){return db[_0xc653('0x1c')][_0xc653('0x27')]({'raw':_0x33db6f[_0xc653('0x1d')]?_0x33db6f[_0xc653('0x1d')][_0xc653('0x1e')]===undefined?!![]:![]:!![],'where':_0x33db6f['options']?_0x33db6f[_0xc653('0x1d')][_0xc653('0x1f')]||null:null,'attributes':_0x33db6f['options']?_0x33db6f[_0xc653('0x1d')][_0xc653('0x20')]||null:null,'include':_0x33db6f['options']?_0x33db6f[_0xc653('0x1d')]['include']?_[_0xc653('0x23')](_0x33db6f[_0xc653('0x1d')][_0xc653('0x22')],function(_0x12191f){return{'model':db[_0x12191f[_0xc653('0x24')]],'as':_0x12191f['as'],'attributes':_0x12191f[_0xc653('0x20')],'include':_0x12191f[_0xc653('0x22')]?_[_0xc653('0x23')](_0x12191f[_0xc653('0x22')],function(_0x33b00e){return{'model':db[_0x33b00e['model']],'as':_0x33b00e['as'],'attributes':_0x33b00e['attributes'],'include':_0x33b00e['include']?_['map'](_0x33b00e['include'],function(_0x4ea07f){return{'model':db[_0x4ea07f[_0xc653('0x24')]],'as':_0x4ea07f['as'],'attributes':_0x4ea07f[_0xc653('0x20')]};}):[]};}):[]};}):[]:[]})[_0xc653('0x11')](function(_0x3febf7){logger[_0xc653('0x19')](_0xc653('0x26'),_0x33db6f);logger[_0xc653('0x28')]('ShowSmsQueue',_0x33db6f,JSON[_0xc653('0x15')](_0x3febf7));_0x3483da(_0x3febf7);})[_0xc653('0x1b')](function(_0x4de065){logger[_0xc653('0x16')](_0xc653('0x26'),_0x4de065['message'],_0x33db6f);_0x2c0b70(_0x2482fd[_0xc653('0x16')](0x1f4,_0x4de065[_0xc653('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 84c0ec5..ea9d9c8 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 _0xfbb3=['update','emit','removeListener','register','length','./smsQueue.events','remove'];(function(_0x2e2960,_0x3ca764){var _0x7f702=function(_0x280596){while(--_0x280596){_0x2e2960['push'](_0x2e2960['shift']());}};_0x7f702(++_0x3ca764);}(_0xfbb3,0x140));var _0x3fbb=function(_0x5a7bd3,_0x4e7fb3){_0x5a7bd3=_0x5a7bd3-0x0;var _0x3bb83a=_0xfbb3[_0x5a7bd3];return _0x3bb83a;};'use strict';var SmsQueueEvents=require(_0x3fbb('0x0'));var events=['save',_0x3fbb('0x1'),_0x3fbb('0x2')];function createListener(_0x2c47df,_0x2b1d7c){return function(_0x2cc6c1){_0x2b1d7c[_0x3fbb('0x3')](_0x2c47df,_0x2cc6c1);};}function removeListener(_0x5e89ed,_0x5662a5){return function(){SmsQueueEvents[_0x3fbb('0x4')](_0x5e89ed,_0x5662a5);};}exports[_0x3fbb('0x5')]=function(_0x43a765){for(var _0x175388=0x0,_0x297565=events[_0x3fbb('0x6')];_0x175388<_0x297565;_0x175388++){var _0x1c88ad=events[_0x175388];var _0x9d42a9=createListener('smsQueue:'+_0x1c88ad,_0x43a765);SmsQueueEvents['on'](_0x1c88ad,_0x9d42a9);}}; \ No newline at end of file +var _0x8df6=['./smsQueue.events','save','update','emit','removeListener','register','length','smsQueue:'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x8df6,0x178));var _0x68df=function(_0x35b072,_0x15d3e9){_0x35b072=_0x35b072-0x0;var _0x49f7ac=_0x8df6[_0x35b072];return _0x49f7ac;};'use strict';var SmsQueueEvents=require(_0x68df('0x0'));var events=[_0x68df('0x1'),'remove',_0x68df('0x2')];function createListener(_0x3b41ba,_0x59dff5){return function(_0x5eda8){_0x59dff5[_0x68df('0x3')](_0x3b41ba,_0x5eda8);};}function removeListener(_0x444bd8,_0x5515c0){return function(){SmsQueueEvents[_0x68df('0x4')](_0x444bd8,_0x5515c0);};}exports[_0x68df('0x5')]=function(_0x1575cf){for(var _0x2f8901=0x0,_0x3183cc=events[_0x68df('0x6')];_0x2f8901<_0x3183cc;_0x2f8901++){var _0x99f3d1=events[_0x2f8901];var _0x46ab10=createListener(_0x68df('0x7')+_0x99f3d1,_0x1575cf);SmsQueueEvents['on'](_0x99f3d1,_0x46ab10);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 1f078e3..dc077ac 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 _0xe946=['post','put','delete','/:id','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','show'];(function(_0x41bea7,_0x506bc9){var _0x53a431=function(_0x4e6c33){while(--_0x4e6c33){_0x41bea7['push'](_0x41bea7['shift']());}};_0x53a431(++_0x506bc9);}(_0xe946,0x18d));var _0x6e94=function(_0x1cea7e,_0x4e9be8){_0x1cea7e=_0x1cea7e-0x0;var _0xdb85fa=_0xe946[_0x1cea7e];return _0xdb85fa;};'use strict';var multer=require('multer');var util=require(_0x6e94('0x0'));var path=require(_0x6e94('0x1'));var timeout=require('connect-timeout');var express=require(_0x6e94('0x2'));var router=express[_0x6e94('0x3')]();var fs_extra=require(_0x6e94('0x4'));var auth=require(_0x6e94('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6e94('0x6'));var controller=require('./smsQueueReport.controller');router[_0x6e94('0x7')]('/',auth[_0x6e94('0x8')](),controller['index']);router[_0x6e94('0x7')](_0x6e94('0x9'),auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0x6e94('0x8')](),controller[_0x6e94('0xa')]);router[_0x6e94('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6e94('0xc')]('/:id',auth[_0x6e94('0x8')](),controller['update']);router[_0x6e94('0xd')](_0x6e94('0xe'),auth[_0x6e94('0x8')](),controller[_0x6e94('0xf')]);module[_0x6e94('0x10')]=router; \ No newline at end of file +var _0x2c40=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id','show','create','put','delete'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2c40,0xfd));var _0x02c4=function(_0x22b3c7,_0x59225d){_0x22b3c7=_0x22b3c7-0x0;var _0x51690f=_0x2c40[_0x22b3c7];return _0x51690f;};'use strict';var multer=require('multer');var util=require(_0x02c4('0x0'));var path=require(_0x02c4('0x1'));var timeout=require(_0x02c4('0x2'));var express=require(_0x02c4('0x3'));var router=express[_0x02c4('0x4')]();var fs_extra=require(_0x02c4('0x5'));var auth=require(_0x02c4('0x6'));var interaction=require(_0x02c4('0x7'));var config=require('../../config/environment');var controller=require('./smsQueueReport.controller');router[_0x02c4('0x8')]('/',auth[_0x02c4('0x9')](),controller['index']);router[_0x02c4('0x8')](_0x02c4('0xa'),auth[_0x02c4('0x9')](),controller[_0x02c4('0xb')]);router['get'](_0x02c4('0xc'),auth['isAuthenticated'](),controller[_0x02c4('0xd')]);router['post']('/',auth[_0x02c4('0x9')](),controller[_0x02c4('0xe')]);router[_0x02c4('0xf')](_0x02c4('0xc'),auth[_0x02c4('0x9')](),controller['update']);router[_0x02c4('0x10')]('/:id',auth[_0x02c4('0x9')](),controller['destroy']);module[_0x02c4('0x11')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 59df3a3..abf8662 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 _0xfccd=['STRING','DATE','sequelize','exports'];(function(_0x433853,_0x410c17){var _0x5ea703=function(_0x5c6fa0){while(--_0x5c6fa0){_0x433853['push'](_0x433853['shift']());}};_0x5ea703(++_0x410c17);}(_0xfccd,0x106));var _0xdfcc=function(_0x430469,_0x20e783){_0x430469=_0x430469-0x0;var _0x1ca55e=_0xfccd[_0x430469];return _0x1ca55e;};'use strict';var moment=require('moment');var Sequelize=require(_0xdfcc('0x0'));module[_0xdfcc('0x1')]={'uniqueid':{'type':Sequelize[_0xdfcc('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xdfcc('0x2')]},'joinAt':{'type':Sequelize[_0xdfcc('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xdfcc('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1923=['DATE','sequelize','exports','STRING'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x1923,0x71));var _0x3192=function(_0x33f2f9,_0x257e26){_0x33f2f9=_0x33f2f9-0x0;var _0x478c6e=_0x1923[_0x33f2f9];return _0x478c6e;};'use strict';var moment=require('moment');var Sequelize=require(_0x3192('0x0'));module[_0x3192('0x1')]={'uniqueid':{'type':Sequelize[_0x3192('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x3192('0x2')]},'joinAt':{'type':Sequelize[_0x3192('0x3')]},'leaveAt':{'type':Sequelize[_0x3192('0x3')]},'acceptAt':{'type':Sequelize[_0x3192('0x3')]},'exitAt':{'type':Sequelize[_0x3192('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 5ce0e4b..1374ff5 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 _0x55c1=['includeAll','find','create','update','body','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','then','destroy','error','stack','name','send','index','map','SmsQueueReport','rawAttributes','type','model','keys','intersection','query','attributes','hasOwnProperty','nolimit','sort','where','filters','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','fields','length'];(function(_0x507ac5,_0x33aaee){var _0x12c1bc=function(_0x5c953c){while(--_0x5c953c){_0x507ac5['push'](_0x507ac5['shift']());}};_0x12c1bc(++_0x33aaee);}(_0x55c1,0x9d));var _0x155c=function(_0x462042,_0x524279){_0x462042=_0x462042-0x0;var _0x585608=_0x55c1[_0x462042];return _0x585608;};'use strict';var emlformat=require(_0x155c('0x0'));var rimraf=require(_0x155c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x155c('0x2'));var rp=require(_0x155c('0x3'));var moment=require(_0x155c('0x4'));var BPromise=require(_0x155c('0x5'));var Mustache=require(_0x155c('0x6'));var util=require('util');var path=require('path');var sox=require(_0x155c('0x7'));var csv=require('to-csv');var ejs=require(_0x155c('0x8'));var fs=require('fs');var fs_extra=require(_0x155c('0x9'));var _=require('lodash');var squel=require(_0x155c('0xa'));var crypto=require(_0x155c('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x155c('0xc'));var toCsv=require(_0x155c('0xd'));var querystring=require(_0x155c('0xe'));var Papa=require(_0x155c('0xf'));var Redis=require(_0x155c('0x10'));var authService=require(_0x155c('0x11'));var qs=require(_0x155c('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x155c('0x13'));var logger=require(_0x155c('0x14'))(_0x155c('0x15'));var utils=require(_0x155c('0x16'));var config=require(_0x155c('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x155c('0x18'))['db'];function respondWithStatusCode(_0x5a8a81,_0xc4fb1){_0xc4fb1=_0xc4fb1||0xcc;return function(_0x5512ad){if(_0x5512ad){return _0x5a8a81[_0x155c('0x19')](_0xc4fb1);}return _0x5a8a81[_0x155c('0x1a')](_0xc4fb1)[_0x155c('0x1b')]();};}function respondWithResult(_0x3e18e4,_0x40de2e){_0x40de2e=_0x40de2e||0xc8;return function(_0x522bed){if(_0x522bed){return _0x3e18e4['status'](_0x40de2e)[_0x155c('0x1c')](_0x522bed);}};}function respondWithFilteredResult(_0x5c0c0a,_0x3f278d){return function(_0x463e29){if(_0x463e29){var _0x1869d3=typeof _0x3f278d[_0x155c('0x1d')]===_0x155c('0x1e')&&typeof _0x3f278d[_0x155c('0x1f')]===_0x155c('0x1e');var _0x4651d6=_0x463e29['count'];var _0x5cb92b=_0x1869d3?0x0:_0x3f278d[_0x155c('0x1d')];var _0x5981dd=_0x1869d3?_0x463e29[_0x155c('0x20')]:_0x3f278d[_0x155c('0x1d')]+_0x3f278d['limit'];var _0x19ba8e;if(_0x5981dd>=_0x4651d6){_0x5981dd=_0x4651d6;_0x19ba8e=0xc8;}else{_0x19ba8e=0xce;}_0x5c0c0a[_0x155c('0x1a')](_0x19ba8e);return _0x5c0c0a[_0x155c('0x21')]('Content-Range',_0x5cb92b+'-'+_0x5981dd+'/'+_0x4651d6)[_0x155c('0x1c')](_0x463e29);}return null;};}function patchUpdates(_0x139690){return function(_0x22a67b){try{jsonpatch[_0x155c('0x22')](_0x22a67b,_0x139690,!![]);}catch(_0x235aa8){return BPromise['reject'](_0x235aa8);}return _0x22a67b[_0x155c('0x23')]();};}function saveUpdates(_0x2065f3,_0x2d93c3){return function(_0x1d65d0){if(_0x1d65d0){return _0x1d65d0['update'](_0x2065f3)[_0x155c('0x24')](function(_0x3fd42f){return _0x3fd42f;});}return null;};}function removeEntity(_0x50d03f,_0x19d7a4){return function(_0x3daa2b){if(_0x3daa2b){return _0x3daa2b[_0x155c('0x25')]()[_0x155c('0x24')](function(){_0x50d03f[_0x155c('0x1a')](0xcc)[_0x155c('0x1b')]();});}};}function handleEntityNotFound(_0x512bf9,_0xc79f9c){return function(_0x1d9435){if(!_0x1d9435){_0x512bf9[_0x155c('0x19')](0x194);}return _0x1d9435;};}function handleError(_0x50b3ba,_0x4b35f4){_0x4b35f4=_0x4b35f4||0x1f4;return function(_0x58fc11){logger[_0x155c('0x26')](_0x58fc11[_0x155c('0x27')]);if(_0x58fc11[_0x155c('0x28')]){delete _0x58fc11[_0x155c('0x28')];}_0x50b3ba[_0x155c('0x1a')](_0x4b35f4)[_0x155c('0x29')](_0x58fc11);};}exports[_0x155c('0x2a')]=function(_0x552c3e,_0x3ef5db){var _0x58613f={},_0x44c8b8={},_0x1b1cdf={'count':0x0,'rows':[]};var _0x52d1ac=_[_0x155c('0x2b')](db[_0x155c('0x2c')][_0x155c('0x2d')],function(_0x3373c6){return{'name':_0x3373c6['fieldName'],'type':_0x3373c6[_0x155c('0x2e')]['key']};});_0x44c8b8[_0x155c('0x2f')]=_[_0x155c('0x2b')](_0x52d1ac,_0x155c('0x28'));_0x44c8b8['query']=_[_0x155c('0x30')](_0x552c3e['query']);_0x44c8b8['filters']=_[_0x155c('0x31')](_0x44c8b8[_0x155c('0x2f')],_0x44c8b8[_0x155c('0x32')]);_0x58613f[_0x155c('0x33')]=_[_0x155c('0x31')](_0x44c8b8[_0x155c('0x2f')],qs['fields'](_0x552c3e['query']['fields']));_0x58613f['attributes']=_0x58613f[_0x155c('0x33')]['length']?_0x58613f[_0x155c('0x33')]:_0x44c8b8[_0x155c('0x2f')];if(!_0x552c3e[_0x155c('0x32')][_0x155c('0x34')](_0x155c('0x35'))){_0x58613f[_0x155c('0x1f')]=qs['limit'](_0x552c3e[_0x155c('0x32')]['limit']);_0x58613f[_0x155c('0x1d')]=qs[_0x155c('0x1d')](_0x552c3e[_0x155c('0x32')][_0x155c('0x1d')]);}_0x58613f['order']=qs[_0x155c('0x36')](_0x552c3e[_0x155c('0x32')][_0x155c('0x36')]);_0x58613f[_0x155c('0x37')]=qs[_0x155c('0x38')](_[_0x155c('0x39')](_0x552c3e[_0x155c('0x32')],_0x44c8b8[_0x155c('0x38')]),_0x52d1ac);if(_0x552c3e[_0x155c('0x32')][_0x155c('0x3a')]){_0x58613f[_0x155c('0x37')]=_['merge'](_0x58613f['where'],{'$or':_[_0x155c('0x2b')](_0x52d1ac,function(_0x2394fd){if(_0x2394fd['type']!==_0x155c('0x3b')){var _0x56905e={};_0x56905e[_0x2394fd[_0x155c('0x28')]]={'$like':'%'+_0x552c3e[_0x155c('0x32')][_0x155c('0x3a')]+'%'};return _0x56905e;}})});}_0x58613f=_[_0x155c('0x3c')]({},_0x58613f,_0x552c3e[_0x155c('0x3d')]);var _0x1aa6e7={'where':_0x58613f[_0x155c('0x37')]};return db[_0x155c('0x2c')][_0x155c('0x20')](_0x1aa6e7)[_0x155c('0x24')](function(_0x41d31c){_0x1b1cdf['count']=_0x41d31c;if(_0x552c3e[_0x155c('0x32')]['includeAll']){_0x58613f[_0x155c('0x3e')]=[{'all':!![]}];}return db[_0x155c('0x2c')][_0x155c('0x3f')](_0x58613f);})['then'](function(_0x31d80d){_0x1b1cdf[_0x155c('0x40')]=_0x31d80d;return _0x1b1cdf;})[_0x155c('0x24')](respondWithFilteredResult(_0x3ef5db,_0x58613f))[_0x155c('0x41')](handleError(_0x3ef5db,null));};exports['show']=function(_0x572b16,_0xfbeb){var _0x14d25a={'raw':!![],'where':{'id':_0x572b16['params']['id']}},_0x87d8b2={};_0x87d8b2['model']=_[_0x155c('0x30')](db[_0x155c('0x2c')][_0x155c('0x2d')]);_0x87d8b2[_0x155c('0x32')]=_[_0x155c('0x30')](_0x572b16[_0x155c('0x32')]);_0x87d8b2[_0x155c('0x38')]=_['intersection'](_0x87d8b2[_0x155c('0x2f')],_0x87d8b2['query']);_0x14d25a[_0x155c('0x33')]=_['intersection'](_0x87d8b2['model'],qs[_0x155c('0x42')](_0x572b16[_0x155c('0x32')][_0x155c('0x42')]));_0x14d25a[_0x155c('0x33')]=_0x14d25a[_0x155c('0x33')][_0x155c('0x43')]?_0x14d25a['attributes']:_0x87d8b2['model'];if(_0x572b16[_0x155c('0x32')][_0x155c('0x44')]){_0x14d25a[_0x155c('0x3e')]=[{'all':!![]}];}_0x14d25a=_[_0x155c('0x3c')]({},_0x14d25a,_0x572b16['options']);return db['SmsQueueReport'][_0x155c('0x45')](_0x14d25a)[_0x155c('0x24')](handleEntityNotFound(_0xfbeb,null))[_0x155c('0x24')](respondWithResult(_0xfbeb,null))[_0x155c('0x41')](handleError(_0xfbeb,null));};exports[_0x155c('0x46')]=function(_0x2c3441,_0x4afa1b){return db['SmsQueueReport'][_0x155c('0x46')](_0x2c3441['body'],{})[_0x155c('0x24')](respondWithResult(_0x4afa1b,0xc9))[_0x155c('0x41')](handleError(_0x4afa1b,null));};exports[_0x155c('0x47')]=function(_0x177615,_0x207d71){if(_0x177615[_0x155c('0x48')]['id']){delete _0x177615[_0x155c('0x48')]['id'];}return db['SmsQueueReport']['find']({'where':{'id':_0x177615[_0x155c('0x49')]['id']}})['then'](handleEntityNotFound(_0x207d71,null))[_0x155c('0x24')](saveUpdates(_0x177615[_0x155c('0x48')],null))[_0x155c('0x24')](respondWithResult(_0x207d71,null))[_0x155c('0x41')](handleError(_0x207d71,null));};exports['destroy']=function(_0x59abc1,_0xee89b5){return db[_0x155c('0x2c')][_0x155c('0x45')]({'where':{'id':_0x59abc1[_0x155c('0x49')]['id']}})[_0x155c('0x24')](handleEntityNotFound(_0xee89b5,null))['then'](removeEntity(_0xee89b5,null))[_0x155c('0x41')](handleError(_0xee89b5,null));};exports[_0x155c('0x4a')]=function(_0xa5b1d0,_0x541755){return db[_0x155c('0x2c')][_0x155c('0x4a')]()[_0x155c('0x24')](respondWithResult(_0x541755,null))[_0x155c('0x41')](handleError(_0x541755,null));}; \ No newline at end of file +var _0xe832=['filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','intersection','find','create','body','describe','rimraf','fast-json-patch','request-promise','moment','mustache','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/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','SmsQueueReport','rawAttributes','fieldName','type','query','keys','fields','attributes','length','model','hasOwnProperty','nolimit','sort','where','filters'];(function(_0x48de6d,_0x11b2ca){var _0x1efe33=function(_0x7f644e){while(--_0x7f644e){_0x48de6d['push'](_0x48de6d['shift']());}};_0x1efe33(++_0x11b2ca);}(_0xe832,0xfb));var _0x2e83=function(_0x4ff4b9,_0x4ea6eb){_0x4ff4b9=_0x4ff4b9-0x0;var _0x3d9b18=_0xe832[_0x4ff4b9];return _0x3d9b18;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2e83('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2e83('0x1'));var rp=require(_0x2e83('0x2'));var moment=require(_0x2e83('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x2e83('0x4'));var util=require('util');var path=require(_0x2e83('0x5'));var sox=require(_0x2e83('0x6'));var csv=require(_0x2e83('0x7'));var ejs=require(_0x2e83('0x8'));var fs=require('fs');var fs_extra=require(_0x2e83('0x9'));var _=require(_0x2e83('0xa'));var squel=require(_0x2e83('0xb'));var crypto=require(_0x2e83('0xc'));var jsforce=require(_0x2e83('0xd'));var deskjs=require(_0x2e83('0xe'));var toCsv=require(_0x2e83('0x7'));var querystring=require(_0x2e83('0xf'));var Papa=require('papaparse');var Redis=require(_0x2e83('0x10'));var authService=require(_0x2e83('0x11'));var qs=require(_0x2e83('0x12'));var as=require(_0x2e83('0x13'));var hardwareService=require(_0x2e83('0x14'));var logger=require(_0x2e83('0x15'))(_0x2e83('0x16'));var utils=require(_0x2e83('0x17'));var config=require(_0x2e83('0x18'));var licenseUtil=require(_0x2e83('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5dc5,_0x1ad80c){_0x1ad80c=_0x1ad80c||0xcc;return function(_0x1f7bbf){if(_0x1f7bbf){return _0x1a5dc5[_0x2e83('0x1a')](_0x1ad80c);}return _0x1a5dc5[_0x2e83('0x1b')](_0x1ad80c)[_0x2e83('0x1c')]();};}function respondWithResult(_0x1ab1bf,_0x55fb07){_0x55fb07=_0x55fb07||0xc8;return function(_0x3f0e6f){if(_0x3f0e6f){return _0x1ab1bf[_0x2e83('0x1b')](_0x55fb07)[_0x2e83('0x1d')](_0x3f0e6f);}};}function respondWithFilteredResult(_0x41916c,_0x1d141d){return function(_0x4430bc){if(_0x4430bc){var _0x168d13=typeof _0x1d141d[_0x2e83('0x1e')]===_0x2e83('0x1f')&&typeof _0x1d141d[_0x2e83('0x20')]===_0x2e83('0x1f');var _0xde613c=_0x4430bc['count'];var _0x18c5d7=_0x168d13?0x0:_0x1d141d[_0x2e83('0x1e')];var _0x1ed99a=_0x168d13?_0x4430bc['count']:_0x1d141d[_0x2e83('0x1e')]+_0x1d141d[_0x2e83('0x20')];var _0x15b1a8;if(_0x1ed99a>=_0xde613c){_0x1ed99a=_0xde613c;_0x15b1a8=0xc8;}else{_0x15b1a8=0xce;}_0x41916c[_0x2e83('0x1b')](_0x15b1a8);return _0x41916c[_0x2e83('0x21')](_0x2e83('0x22'),_0x18c5d7+'-'+_0x1ed99a+'/'+_0xde613c)[_0x2e83('0x1d')](_0x4430bc);}return null;};}function patchUpdates(_0x18c49d){return function(_0x1523c8){try{jsonpatch[_0x2e83('0x23')](_0x1523c8,_0x18c49d,!![]);}catch(_0x251f3f){return BPromise[_0x2e83('0x24')](_0x251f3f);}return _0x1523c8[_0x2e83('0x25')]();};}function saveUpdates(_0x40da71,_0x2ad792){return function(_0xc513b9){if(_0xc513b9){return _0xc513b9[_0x2e83('0x26')](_0x40da71)[_0x2e83('0x27')](function(_0xbc9e){return _0xbc9e;});}return null;};}function removeEntity(_0x1c7fb3,_0x233a96){return function(_0x211b7a){if(_0x211b7a){return _0x211b7a[_0x2e83('0x28')]()[_0x2e83('0x27')](function(){_0x1c7fb3[_0x2e83('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c47e0,_0x4e94d4){return function(_0x1a4bd5){if(!_0x1a4bd5){_0x2c47e0['sendStatus'](0x194);}return _0x1a4bd5;};}function handleError(_0x5055da,_0x92b1d7){_0x92b1d7=_0x92b1d7||0x1f4;return function(_0x7c8cf2){logger[_0x2e83('0x29')](_0x7c8cf2['stack']);if(_0x7c8cf2[_0x2e83('0x2a')]){delete _0x7c8cf2['name'];}_0x5055da[_0x2e83('0x1b')](_0x92b1d7)[_0x2e83('0x2b')](_0x7c8cf2);};}exports[_0x2e83('0x2c')]=function(_0x3f146c,_0x5c8036){var _0x1239fb={},_0x454a97={},_0x35fb07={'count':0x0,'rows':[]};var _0x5efad3=_[_0x2e83('0x2d')](db[_0x2e83('0x2e')][_0x2e83('0x2f')],function(_0x561a7a){return{'name':_0x561a7a[_0x2e83('0x30')],'type':_0x561a7a[_0x2e83('0x31')]['key']};});_0x454a97['model']=_[_0x2e83('0x2d')](_0x5efad3,_0x2e83('0x2a'));_0x454a97[_0x2e83('0x32')]=_[_0x2e83('0x33')](_0x3f146c[_0x2e83('0x32')]);_0x454a97['filters']=_['intersection'](_0x454a97['model'],_0x454a97[_0x2e83('0x32')]);_0x1239fb['attributes']=_['intersection'](_0x454a97['model'],qs[_0x2e83('0x34')](_0x3f146c['query'][_0x2e83('0x34')]));_0x1239fb['attributes']=_0x1239fb[_0x2e83('0x35')][_0x2e83('0x36')]?_0x1239fb[_0x2e83('0x35')]:_0x454a97[_0x2e83('0x37')];if(!_0x3f146c[_0x2e83('0x32')][_0x2e83('0x38')](_0x2e83('0x39'))){_0x1239fb[_0x2e83('0x20')]=qs[_0x2e83('0x20')](_0x3f146c[_0x2e83('0x32')][_0x2e83('0x20')]);_0x1239fb[_0x2e83('0x1e')]=qs[_0x2e83('0x1e')](_0x3f146c[_0x2e83('0x32')]['offset']);}_0x1239fb['order']=qs[_0x2e83('0x3a')](_0x3f146c[_0x2e83('0x32')][_0x2e83('0x3a')]);_0x1239fb[_0x2e83('0x3b')]=qs[_0x2e83('0x3c')](_['pick'](_0x3f146c[_0x2e83('0x32')],_0x454a97[_0x2e83('0x3c')]),_0x5efad3);if(_0x3f146c['query'][_0x2e83('0x3d')]){_0x1239fb[_0x2e83('0x3b')]=_[_0x2e83('0x3e')](_0x1239fb[_0x2e83('0x3b')],{'$or':_[_0x2e83('0x2d')](_0x5efad3,function(_0x3c6670){if(_0x3c6670['type']!==_0x2e83('0x3f')){var _0x2658b9={};_0x2658b9[_0x3c6670['name']]={'$like':'%'+_0x3f146c[_0x2e83('0x32')]['filter']+'%'};return _0x2658b9;}})});}_0x1239fb=_[_0x2e83('0x3e')]({},_0x1239fb,_0x3f146c[_0x2e83('0x40')]);var _0x282a7f={'where':_0x1239fb[_0x2e83('0x3b')]};return db['SmsQueueReport']['count'](_0x282a7f)[_0x2e83('0x27')](function(_0x51342b){_0x35fb07[_0x2e83('0x41')]=_0x51342b;if(_0x3f146c[_0x2e83('0x32')][_0x2e83('0x42')]){_0x1239fb[_0x2e83('0x43')]=[{'all':!![]}];}return db[_0x2e83('0x2e')][_0x2e83('0x44')](_0x1239fb);})[_0x2e83('0x27')](function(_0x3f1927){_0x35fb07[_0x2e83('0x45')]=_0x3f1927;return _0x35fb07;})[_0x2e83('0x27')](respondWithFilteredResult(_0x5c8036,_0x1239fb))[_0x2e83('0x46')](handleError(_0x5c8036,null));};exports[_0x2e83('0x47')]=function(_0x5f2b50,_0x1ff065){var _0x135bee={'raw':!![],'where':{'id':_0x5f2b50[_0x2e83('0x48')]['id']}},_0x3e0448={};_0x3e0448['model']=_[_0x2e83('0x33')](db[_0x2e83('0x2e')][_0x2e83('0x2f')]);_0x3e0448['query']=_[_0x2e83('0x33')](_0x5f2b50[_0x2e83('0x32')]);_0x3e0448[_0x2e83('0x3c')]=_['intersection'](_0x3e0448[_0x2e83('0x37')],_0x3e0448[_0x2e83('0x32')]);_0x135bee[_0x2e83('0x35')]=_[_0x2e83('0x49')](_0x3e0448[_0x2e83('0x37')],qs[_0x2e83('0x34')](_0x5f2b50['query'][_0x2e83('0x34')]));_0x135bee['attributes']=_0x135bee['attributes'][_0x2e83('0x36')]?_0x135bee[_0x2e83('0x35')]:_0x3e0448[_0x2e83('0x37')];if(_0x5f2b50[_0x2e83('0x32')][_0x2e83('0x42')]){_0x135bee[_0x2e83('0x43')]=[{'all':!![]}];}_0x135bee=_[_0x2e83('0x3e')]({},_0x135bee,_0x5f2b50['options']);return db[_0x2e83('0x2e')][_0x2e83('0x4a')](_0x135bee)['then'](handleEntityNotFound(_0x1ff065,null))[_0x2e83('0x27')](respondWithResult(_0x1ff065,null))[_0x2e83('0x46')](handleError(_0x1ff065,null));};exports[_0x2e83('0x4b')]=function(_0x35dabb,_0xcd1b21){return db[_0x2e83('0x2e')]['create'](_0x35dabb[_0x2e83('0x4c')],{})[_0x2e83('0x27')](respondWithResult(_0xcd1b21,0xc9))[_0x2e83('0x46')](handleError(_0xcd1b21,null));};exports[_0x2e83('0x26')]=function(_0x499afc,_0x2a469e){if(_0x499afc[_0x2e83('0x4c')]['id']){delete _0x499afc['body']['id'];}return db[_0x2e83('0x2e')][_0x2e83('0x4a')]({'where':{'id':_0x499afc[_0x2e83('0x48')]['id']}})[_0x2e83('0x27')](handleEntityNotFound(_0x2a469e,null))[_0x2e83('0x27')](saveUpdates(_0x499afc[_0x2e83('0x4c')],null))[_0x2e83('0x27')](respondWithResult(_0x2a469e,null))[_0x2e83('0x46')](handleError(_0x2a469e,null));};exports[_0x2e83('0x28')]=function(_0x5783ad,_0x3ed7d6){return db['SmsQueueReport'][_0x2e83('0x4a')]({'where':{'id':_0x5783ad[_0x2e83('0x48')]['id']}})[_0x2e83('0x27')](handleEntityNotFound(_0x3ed7d6,null))['then'](removeEntity(_0x3ed7d6,null))[_0x2e83('0x46')](handleError(_0x3ed7d6,null));};exports['describe']=function(_0x45e13f,_0x37fc4f){return db['SmsQueueReport'][_0x2e83('0x4d')]()[_0x2e83('0x27')](respondWithResult(_0x37fc4f,null))[_0x2e83('0x46')](handleError(_0x37fc4f,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 3223a02..8936190 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(_0x2fa800,_0x131c8e){var _0x10be69=function(_0x2e5b45){while(--_0x2e5b45){_0x2fa800['push'](_0x2fa800['shift']());}};_0x10be69(++_0x131c8e);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'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(_0x5b6fd2,_0x718046){var _0xca2f79=function(_0x47fe3f){while(--_0x47fe3f){_0x5b6fd2['push'](_0x5b6fd2['shift']());}};_0xca2f79(++_0x718046);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xbaf0[_0x6131cd];return _0x47e916;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'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 8c9a907..6878736 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 _0xd7d1=['options','raw','then','CreateSmsQueueReport','stringify','UpdateSmsQueueReport','update','limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','request','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','SmsQueueReport','create','body'];(function(_0x22a9db,_0x4506c5){var _0x35715a=function(_0x4d9998){while(--_0x4d9998){_0x22a9db['push'](_0x22a9db['shift']());}};_0x35715a(++_0x4506c5);}(_0xd7d1,0xf8));var _0x1d7d=function(_0x3caa0a,_0x56ef22){_0x3caa0a=_0x3caa0a-0x0;var _0x249f04=_0xd7d1[_0x3caa0a];return _0x249f04;};'use strict';var _=require(_0x1d7d('0x0'));var util=require('util');var moment=require(_0x1d7d('0x1'));var BPromise=require(_0x1d7d('0x2'));var rs=require(_0x1d7d('0x3'));var fs=require('fs');var Redis=require(_0x1d7d('0x4'));var db=require(_0x1d7d('0x5'))['db'];var utils=require(_0x1d7d('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x1d7d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1d7d('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b6c2e,_0x3b4a38,_0x30a701){return new BPromise(function(_0x9e28bd,_0x30fd10){return client[_0x1d7d('0x9')](_0x3b6c2e,_0x30a701)['then'](function(_0x9b7e8c){logger[_0x1d7d('0xa')](_0x1d7d('0xb'),_0x3b4a38,_0x1d7d('0xc'));logger[_0x1d7d('0xd')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x3b4a38,_0x1d7d('0xc'),JSON['stringify'](_0x9b7e8c));if(_0x9b7e8c['error']){if(_0x9b7e8c[_0x1d7d('0xe')][_0x1d7d('0xf')]===0x1f4){logger[_0x1d7d('0xe')](_0x1d7d('0xb'),_0x3b4a38,_0x9b7e8c[_0x1d7d('0xe')]['message']);return _0x30fd10(_0x9b7e8c[_0x1d7d('0xe')][_0x1d7d('0x10')]);}logger['error'](_0x1d7d('0xb'),_0x3b4a38,_0x9b7e8c[_0x1d7d('0xe')][_0x1d7d('0x10')]);return _0x9e28bd(_0x9b7e8c[_0x1d7d('0xe')][_0x1d7d('0x10')]);}else{logger[_0x1d7d('0xa')](_0x1d7d('0xb'),_0x3b4a38,_0x1d7d('0xc'));_0x9e28bd(_0x9b7e8c[_0x1d7d('0x11')][_0x1d7d('0x10')]);}})[_0x1d7d('0x12')](function(_0xb8e450){logger[_0x1d7d('0xe')]('SmsQueueReport,\x20%s,\x20%s',_0x3b4a38,_0xb8e450);_0x30fd10(_0xb8e450);});});}exports['CreateSmsQueueReport']=function(_0x420d67){var _0x5bad96=this;return new Promise(function(_0x1d2c2c,_0x2f600f){return db[_0x1d7d('0x13')][_0x1d7d('0x14')](_0x420d67[_0x1d7d('0x15')],{'raw':_0x420d67['options']?_0x420d67[_0x1d7d('0x16')][_0x1d7d('0x17')]===undefined?!![]:![]:!![]})[_0x1d7d('0x18')](function(_0x5c61c5){logger[_0x1d7d('0xa')](_0x1d7d('0x19'),_0x420d67);logger['debug'](_0x1d7d('0x19'),_0x420d67,JSON[_0x1d7d('0x1a')](_0x5c61c5));_0x1d2c2c(_0x5c61c5);})[_0x1d7d('0x12')](function(_0x1ff6f0){logger[_0x1d7d('0xe')](_0x1d7d('0x19'),_0x1ff6f0['message'],_0x420d67);_0x2f600f(_0x5bad96[_0x1d7d('0xe')](0x1f4,_0x1ff6f0['message']));});});};exports[_0x1d7d('0x1b')]=function(_0x5643db){var _0x419cfd=this;return new Promise(function(_0x4a835e,_0x32b86b){return db[_0x1d7d('0x13')][_0x1d7d('0x1c')](_0x5643db[_0x1d7d('0x15')],{'raw':_0x5643db[_0x1d7d('0x16')]?_0x5643db[_0x1d7d('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5643db[_0x1d7d('0x16')]?_0x5643db[_0x1d7d('0x16')]['where']||null:null,'attributes':_0x5643db[_0x1d7d('0x16')]?_0x5643db[_0x1d7d('0x16')]['attributes']||null:null,'limit':_0x5643db['options']?_0x5643db[_0x1d7d('0x16')][_0x1d7d('0x1d')]||null:null})[_0x1d7d('0x18')](function(_0x10d24e){logger[_0x1d7d('0xa')](_0x1d7d('0x1b'),_0x5643db);logger['debug'](_0x1d7d('0x1b'),_0x5643db,JSON[_0x1d7d('0x1a')](_0x10d24e));_0x4a835e(_0x10d24e);})[_0x1d7d('0x12')](function(_0x527387){logger[_0x1d7d('0xe')](_0x1d7d('0x1b'),_0x527387[_0x1d7d('0x10')],_0x5643db);_0x32b86b(_0x419cfd[_0x1d7d('0xe')](0x1f4,_0x527387[_0x1d7d('0x10')]));});});}; \ No newline at end of file +var _0x4d2a=['info','SmsQueueReport,\x20%s,\x20%s','SmsQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','SmsQueueReport','create','body','options','raw','CreateSmsQueueReport','debug','UpdateSmsQueueReport','update','where','limit','then','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x49482e,_0x388672){var _0x1ce55c=function(_0xa61a4c){while(--_0xa61a4c){_0x49482e['push'](_0x49482e['shift']());}};_0x1ce55c(++_0x388672);}(_0x4d2a,0x169));var _0xa4d2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4d2a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa4d2('0x0'));var util=require(_0xa4d2('0x1'));var moment=require('moment');var BPromise=require(_0xa4d2('0x2'));var rs=require(_0xa4d2('0x3'));var fs=require('fs');var Redis=require(_0xa4d2('0x4'));var db=require(_0xa4d2('0x5'))['db'];var utils=require(_0xa4d2('0x6'));var logger=require(_0xa4d2('0x7'))(_0xa4d2('0x8'));var config=require(_0xa4d2('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa4d2('0xa')][_0xa4d2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xc73062,_0x2027cc,_0x29bfa9){return new BPromise(function(_0x53ee96,_0x29e8f6){return client[_0xa4d2('0xc')](_0xc73062,_0x29bfa9)['then'](function(_0x3794dd){logger[_0xa4d2('0xd')](_0xa4d2('0xe'),_0x2027cc,'request\x20sent');logger['debug'](_0xa4d2('0xf'),_0x2027cc,_0xa4d2('0x10'),JSON[_0xa4d2('0x11')](_0x3794dd));if(_0x3794dd[_0xa4d2('0x12')]){if(_0x3794dd['error']['code']===0x1f4){logger[_0xa4d2('0x12')]('SmsQueueReport,\x20%s,\x20%s',_0x2027cc,_0x3794dd['error'][_0xa4d2('0x13')]);return _0x29e8f6(_0x3794dd['error'][_0xa4d2('0x13')]);}logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x2027cc,_0x3794dd[_0xa4d2('0x12')]['message']);return _0x53ee96(_0x3794dd[_0xa4d2('0x12')][_0xa4d2('0x13')]);}else{logger[_0xa4d2('0xd')](_0xa4d2('0xe'),_0x2027cc,_0xa4d2('0x10'));_0x53ee96(_0x3794dd[_0xa4d2('0x14')][_0xa4d2('0x13')]);}})[_0xa4d2('0x15')](function(_0x341b6d){logger[_0xa4d2('0x12')]('SmsQueueReport,\x20%s,\x20%s',_0x2027cc,_0x341b6d);_0x29e8f6(_0x341b6d);});});}exports['CreateSmsQueueReport']=function(_0x48d7dc){var _0x3d6b48=this;return new Promise(function(_0x100d03,_0x8c0f44){return db[_0xa4d2('0x16')][_0xa4d2('0x17')](_0x48d7dc[_0xa4d2('0x18')],{'raw':_0x48d7dc['options']?_0x48d7dc[_0xa4d2('0x19')][_0xa4d2('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x3fe59c){logger[_0xa4d2('0xd')](_0xa4d2('0x1b'),_0x48d7dc);logger[_0xa4d2('0x1c')]('CreateSmsQueueReport',_0x48d7dc,JSON[_0xa4d2('0x11')](_0x3fe59c));_0x100d03(_0x3fe59c);})[_0xa4d2('0x15')](function(_0x124bde){logger[_0xa4d2('0x12')](_0xa4d2('0x1b'),_0x124bde['message'],_0x48d7dc);_0x8c0f44(_0x3d6b48[_0xa4d2('0x12')](0x1f4,_0x124bde[_0xa4d2('0x13')]));});});};exports[_0xa4d2('0x1d')]=function(_0x4c3705){var _0x259223=this;return new Promise(function(_0x4c8d97,_0x308c83){return db['SmsQueueReport'][_0xa4d2('0x1e')](_0x4c3705[_0xa4d2('0x18')],{'raw':_0x4c3705['options']?_0x4c3705[_0xa4d2('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4c3705['options']?_0x4c3705[_0xa4d2('0x19')][_0xa4d2('0x1f')]||null:null,'attributes':_0x4c3705[_0xa4d2('0x19')]?_0x4c3705[_0xa4d2('0x19')]['attributes']||null:null,'limit':_0x4c3705[_0xa4d2('0x19')]?_0x4c3705[_0xa4d2('0x19')][_0xa4d2('0x20')]||null:null})[_0xa4d2('0x21')](function(_0x245a93){logger[_0xa4d2('0xd')](_0xa4d2('0x1d'),_0x4c3705);logger['debug'](_0xa4d2('0x1d'),_0x4c3705,JSON['stringify'](_0x245a93));_0x4c8d97(_0x245a93);})[_0xa4d2('0x15')](function(_0x505973){logger['error'](_0xa4d2('0x1d'),_0x505973[_0xa4d2('0x13')],_0x4c3705);_0x308c83(_0x259223[_0xa4d2('0x12')](0x1f4,_0x505973['message']));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index dc82988..1caafcb 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 _0xe181=['/describe','isAuthenticated','describe','show','post','create','put','update','delete','/:id','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsTransferReport.controller','index','get'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xe181,0x68));var _0x1e18=function(_0x1b0c08,_0xd7531f){_0x1b0c08=_0x1b0c08-0x0;var _0x123dbf=_0xe181[_0x1b0c08];return _0x123dbf;};'use strict';var multer=require(_0x1e18('0x0'));var util=require('util');var path=require(_0x1e18('0x1'));var timeout=require(_0x1e18('0x2'));var express=require(_0x1e18('0x3'));var router=express[_0x1e18('0x4')]();var fs_extra=require(_0x1e18('0x5'));var auth=require(_0x1e18('0x6'));var interaction=require(_0x1e18('0x7'));var config=require('../../config/environment');var controller=require(_0x1e18('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x1e18('0x9')]);router[_0x1e18('0xa')](_0x1e18('0xb'),auth[_0x1e18('0xc')](),controller[_0x1e18('0xd')]);router[_0x1e18('0xa')]('/:id',auth[_0x1e18('0xc')](),controller[_0x1e18('0xe')]);router[_0x1e18('0xf')]('/',auth[_0x1e18('0xc')](),controller[_0x1e18('0x10')]);router[_0x1e18('0x11')]('/:id',auth[_0x1e18('0xc')](),controller[_0x1e18('0x12')]);router[_0x1e18('0x13')](_0x1e18('0x14'),auth[_0x1e18('0xc')](),controller[_0x1e18('0x15')]);module[_0x1e18('0x16')]=router; \ No newline at end of file +var _0x5636=['isAuthenticated','index','/describe','describe','/:id','show','create','put','delete','destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../config/environment','./smsTransferReport.controller','get'];(function(_0x523564,_0x388aa3){var _0x243c5a=function(_0x3b11af){while(--_0x3b11af){_0x523564['push'](_0x523564['shift']());}};_0x243c5a(++_0x388aa3);}(_0x5636,0x102));var _0x6563=function(_0x55e369,_0x49d0ac){_0x55e369=_0x55e369-0x0;var _0x544c97=_0x5636[_0x55e369];return _0x544c97;};'use strict';var multer=require(_0x6563('0x0'));var util=require(_0x6563('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6563('0x2')]();var fs_extra=require(_0x6563('0x3'));var auth=require(_0x6563('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6563('0x5'));var controller=require(_0x6563('0x6'));router[_0x6563('0x7')]('/',auth[_0x6563('0x8')](),controller[_0x6563('0x9')]);router[_0x6563('0x7')](_0x6563('0xa'),auth[_0x6563('0x8')](),controller[_0x6563('0xb')]);router[_0x6563('0x7')](_0x6563('0xc'),auth[_0x6563('0x8')](),controller[_0x6563('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6563('0xe')]);router[_0x6563('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x6563('0x10')](_0x6563('0xc'),auth[_0x6563('0x8')](),controller[_0x6563('0x11')]);module[_0x6563('0x12')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 028dbd5..faf48da 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 _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x17017e,_0x509679){var _0xbc7086=function(_0x30679d){while(--_0x30679d){_0x17017e['push'](_0x17017e['shift']());}};_0xbc7086(++_0x509679);}(_0x34e8,0x12c));var _0x834e=function(_0x3b5e45,_0x5cff56){_0x3b5e45=_0x3b5e45-0x0;var _0x43b3f8=_0x34e8[_0x3b5e45];return _0x43b3f8;};'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 _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0xdcb46f,_0x8f628e){var _0x1382d8=function(_0x381441){while(--_0x381441){_0xdcb46f['push'](_0xdcb46f['shift']());}};_0x1382d8(++_0x8f628e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 92032dc..7f5788a 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 _0xa5e5=['mustache','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','destroy','then','error','stack','name','send','index','SmsTransferReport','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','order','where','filter','merge','includeAll','rows','catch','show','rawAttributes','include','options','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x386c3e,_0x44a375){var _0x4b8e13=function(_0x583c8f){while(--_0x583c8f){_0x386c3e['push'](_0x386c3e['shift']());}};_0x4b8e13(++_0x44a375);}(_0xa5e5,0x8f));var _0x5a5e=function(_0x13fd59,_0x2e05b1){_0x13fd59=_0x13fd59-0x0;var _0x2e6ce7=_0xa5e5[_0x13fd59];return _0x2e6ce7;};'use strict';var emlformat=require(_0x5a5e('0x0'));var rimraf=require(_0x5a5e('0x1'));var zipdir=require(_0x5a5e('0x2'));var jsonpatch=require(_0x5a5e('0x3'));var rp=require(_0x5a5e('0x4'));var moment=require(_0x5a5e('0x5'));var BPromise=require(_0x5a5e('0x6'));var Mustache=require(_0x5a5e('0x7'));var util=require('util');var path=require(_0x5a5e('0x8'));var sox=require(_0x5a5e('0x9'));var csv=require('to-csv');var ejs=require(_0x5a5e('0xa'));var fs=require('fs');var fs_extra=require(_0x5a5e('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5a5e('0xc'));var jsforce=require(_0x5a5e('0xd'));var deskjs=require(_0x5a5e('0xe'));var toCsv=require(_0x5a5e('0xf'));var querystring=require(_0x5a5e('0x10'));var Papa=require(_0x5a5e('0x11'));var Redis=require(_0x5a5e('0x12'));var authService=require(_0x5a5e('0x13'));var qs=require(_0x5a5e('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5a5e('0x15'))(_0x5a5e('0x16'));var utils=require(_0x5a5e('0x17'));var config=require(_0x5a5e('0x18'));var licenseUtil=require(_0x5a5e('0x19'));var db=require(_0x5a5e('0x1a'))['db'];function respondWithStatusCode(_0x30e534,_0x21a814){_0x21a814=_0x21a814||0xcc;return function(_0x5a55e5){if(_0x5a55e5){return _0x30e534[_0x5a5e('0x1b')](_0x21a814);}return _0x30e534[_0x5a5e('0x1c')](_0x21a814)[_0x5a5e('0x1d')]();};}function respondWithResult(_0x4663d7,_0xb02b7f){_0xb02b7f=_0xb02b7f||0xc8;return function(_0x1672a3){if(_0x1672a3){return _0x4663d7[_0x5a5e('0x1c')](_0xb02b7f)[_0x5a5e('0x1e')](_0x1672a3);}};}function respondWithFilteredResult(_0xd5bbf4,_0x5c52a9){return function(_0x188062){if(_0x188062){var _0x4a6f1b=typeof _0x5c52a9[_0x5a5e('0x1f')]===_0x5a5e('0x20')&&typeof _0x5c52a9[_0x5a5e('0x21')]===_0x5a5e('0x20');var _0x47b5b2=_0x188062[_0x5a5e('0x22')];var _0x173cc8=_0x4a6f1b?0x0:_0x5c52a9[_0x5a5e('0x1f')];var _0x26505c=_0x4a6f1b?_0x188062[_0x5a5e('0x22')]:_0x5c52a9['offset']+_0x5c52a9['limit'];var _0x1bc554;if(_0x26505c>=_0x47b5b2){_0x26505c=_0x47b5b2;_0x1bc554=0xc8;}else{_0x1bc554=0xce;}_0xd5bbf4[_0x5a5e('0x1c')](_0x1bc554);return _0xd5bbf4[_0x5a5e('0x23')]('Content-Range',_0x173cc8+'-'+_0x26505c+'/'+_0x47b5b2)[_0x5a5e('0x1e')](_0x188062);}return null;};}function patchUpdates(_0x256418){return function(_0x547d43){try{jsonpatch[_0x5a5e('0x24')](_0x547d43,_0x256418,!![]);}catch(_0x30e779){return BPromise[_0x5a5e('0x25')](_0x30e779);}return _0x547d43['save']();};}function saveUpdates(_0x4f7915,_0x122ba2){return function(_0x50309a){if(_0x50309a){return _0x50309a[_0x5a5e('0x26')](_0x4f7915)['then'](function(_0x3385c5){return _0x3385c5;});}return null;};}function removeEntity(_0x232d19,_0x50767a){return function(_0x9f3101){if(_0x9f3101){return _0x9f3101[_0x5a5e('0x27')]()[_0x5a5e('0x28')](function(){_0x232d19[_0x5a5e('0x1c')](0xcc)[_0x5a5e('0x1d')]();});}};}function handleEntityNotFound(_0x581c26,_0x22f28a){return function(_0x4026de){if(!_0x4026de){_0x581c26[_0x5a5e('0x1b')](0x194);}return _0x4026de;};}function handleError(_0x356591,_0x4227f1){_0x4227f1=_0x4227f1||0x1f4;return function(_0x5e8375){logger[_0x5a5e('0x29')](_0x5e8375[_0x5a5e('0x2a')]);if(_0x5e8375['name']){delete _0x5e8375[_0x5a5e('0x2b')];}_0x356591['status'](_0x4227f1)[_0x5a5e('0x2c')](_0x5e8375);};}exports[_0x5a5e('0x2d')]=function(_0x47ff2d,_0x25f4b9){var _0x3f06f6={},_0x3af7d5={},_0x19d800={'count':0x0,'rows':[]};var _0x32826c=_['map'](db[_0x5a5e('0x2e')]['rawAttributes'],function(_0x292f84){return{'name':_0x292f84[_0x5a5e('0x2f')],'type':_0x292f84[_0x5a5e('0x30')][_0x5a5e('0x31')]};});_0x3af7d5[_0x5a5e('0x32')]=_[_0x5a5e('0x33')](_0x32826c,'name');_0x3af7d5[_0x5a5e('0x34')]=_[_0x5a5e('0x35')](_0x47ff2d[_0x5a5e('0x34')]);_0x3af7d5[_0x5a5e('0x36')]=_[_0x5a5e('0x37')](_0x3af7d5['model'],_0x3af7d5[_0x5a5e('0x34')]);_0x3f06f6['attributes']=_[_0x5a5e('0x37')](_0x3af7d5['model'],qs[_0x5a5e('0x38')](_0x47ff2d[_0x5a5e('0x34')]['fields']));_0x3f06f6['attributes']=_0x3f06f6[_0x5a5e('0x39')][_0x5a5e('0x3a')]?_0x3f06f6[_0x5a5e('0x39')]:_0x3af7d5['model'];if(!_0x47ff2d['query']['hasOwnProperty']('nolimit')){_0x3f06f6['limit']=qs[_0x5a5e('0x21')](_0x47ff2d[_0x5a5e('0x34')]['limit']);_0x3f06f6[_0x5a5e('0x1f')]=qs[_0x5a5e('0x1f')](_0x47ff2d[_0x5a5e('0x34')][_0x5a5e('0x1f')]);}_0x3f06f6[_0x5a5e('0x3b')]=qs['sort'](_0x47ff2d['query']['sort']);_0x3f06f6[_0x5a5e('0x3c')]=qs[_0x5a5e('0x36')](_['pick'](_0x47ff2d[_0x5a5e('0x34')],_0x3af7d5[_0x5a5e('0x36')]),_0x32826c);if(_0x47ff2d[_0x5a5e('0x34')][_0x5a5e('0x3d')]){_0x3f06f6['where']=_[_0x5a5e('0x3e')](_0x3f06f6[_0x5a5e('0x3c')],{'$or':_[_0x5a5e('0x33')](_0x32826c,function(_0x3e7ae2){if(_0x3e7ae2[_0x5a5e('0x30')]!=='VIRTUAL'){var _0x404540={};_0x404540[_0x3e7ae2[_0x5a5e('0x2b')]]={'$like':'%'+_0x47ff2d['query'][_0x5a5e('0x3d')]+'%'};return _0x404540;}})});}_0x3f06f6=_[_0x5a5e('0x3e')]({},_0x3f06f6,_0x47ff2d['options']);var _0x40705b={'where':_0x3f06f6['where']};return db[_0x5a5e('0x2e')][_0x5a5e('0x22')](_0x40705b)['then'](function(_0x28b4ec){_0x19d800['count']=_0x28b4ec;if(_0x47ff2d[_0x5a5e('0x34')][_0x5a5e('0x3f')]){_0x3f06f6['include']=[{'all':!![]}];}return db[_0x5a5e('0x2e')]['findAll'](_0x3f06f6);})[_0x5a5e('0x28')](function(_0x19d0c0){_0x19d800[_0x5a5e('0x40')]=_0x19d0c0;return _0x19d800;})[_0x5a5e('0x28')](respondWithFilteredResult(_0x25f4b9,_0x3f06f6))[_0x5a5e('0x41')](handleError(_0x25f4b9,null));};exports[_0x5a5e('0x42')]=function(_0x2721a8,_0x4ed30f){var _0x1df542={'raw':!![],'where':{'id':_0x2721a8['params']['id']}},_0x33a631={};_0x33a631[_0x5a5e('0x32')]=_[_0x5a5e('0x35')](db[_0x5a5e('0x2e')][_0x5a5e('0x43')]);_0x33a631[_0x5a5e('0x34')]=_[_0x5a5e('0x35')](_0x2721a8[_0x5a5e('0x34')]);_0x33a631[_0x5a5e('0x36')]=_[_0x5a5e('0x37')](_0x33a631['model'],_0x33a631[_0x5a5e('0x34')]);_0x1df542[_0x5a5e('0x39')]=_[_0x5a5e('0x37')](_0x33a631['model'],qs[_0x5a5e('0x38')](_0x2721a8[_0x5a5e('0x34')][_0x5a5e('0x38')]));_0x1df542[_0x5a5e('0x39')]=_0x1df542[_0x5a5e('0x39')][_0x5a5e('0x3a')]?_0x1df542[_0x5a5e('0x39')]:_0x33a631[_0x5a5e('0x32')];if(_0x2721a8[_0x5a5e('0x34')][_0x5a5e('0x3f')]){_0x1df542[_0x5a5e('0x44')]=[{'all':!![]}];}_0x1df542=_[_0x5a5e('0x3e')]({},_0x1df542,_0x2721a8[_0x5a5e('0x45')]);return db[_0x5a5e('0x2e')][_0x5a5e('0x46')](_0x1df542)[_0x5a5e('0x28')](handleEntityNotFound(_0x4ed30f,null))[_0x5a5e('0x28')](respondWithResult(_0x4ed30f,null))[_0x5a5e('0x41')](handleError(_0x4ed30f,null));};exports[_0x5a5e('0x47')]=function(_0x375d61,_0x254ed5){return db[_0x5a5e('0x2e')][_0x5a5e('0x47')](_0x375d61[_0x5a5e('0x48')],{})[_0x5a5e('0x28')](respondWithResult(_0x254ed5,0xc9))[_0x5a5e('0x41')](handleError(_0x254ed5,null));};exports[_0x5a5e('0x26')]=function(_0x2cac1e,_0x3396a5){if(_0x2cac1e[_0x5a5e('0x48')]['id']){delete _0x2cac1e[_0x5a5e('0x48')]['id'];}return db[_0x5a5e('0x2e')][_0x5a5e('0x46')]({'where':{'id':_0x2cac1e[_0x5a5e('0x49')]['id']}})[_0x5a5e('0x28')](handleEntityNotFound(_0x3396a5,null))[_0x5a5e('0x28')](saveUpdates(_0x2cac1e[_0x5a5e('0x48')],null))[_0x5a5e('0x28')](respondWithResult(_0x3396a5,null))[_0x5a5e('0x41')](handleError(_0x3396a5,null));};exports[_0x5a5e('0x27')]=function(_0x18f841,_0x3e7e87){return db[_0x5a5e('0x2e')][_0x5a5e('0x46')]({'where':{'id':_0x18f841[_0x5a5e('0x49')]['id']}})[_0x5a5e('0x28')](handleEntityNotFound(_0x3e7e87,null))[_0x5a5e('0x28')](removeEntity(_0x3e7e87,null))['catch'](handleError(_0x3e7e87,null));};exports[_0x5a5e('0x4a')]=function(_0x3213f6,_0x4ff58e){return db['SmsTransferReport'][_0x5a5e('0x4a')]()[_0x5a5e('0x28')](respondWithResult(_0x4ff58e,null))['catch'](handleError(_0x4ff58e,null));}; \ No newline at end of file +var _0x861d=['undefined','limit','count','set','apply','reject','save','update','then','destroy','stack','name','send','index','map','SmsTransferReport','fieldName','type','model','query','keys','filters','attributes','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','options','include','findAll','rows','catch','params','rawAttributes','intersection','fields','length','create','body','find','describe','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x347c45,_0x446b12){var _0x5b3775=function(_0x3685a3){while(--_0x3685a3){_0x347c45['push'](_0x347c45['shift']());}};_0x5b3775(++_0x446b12);}(_0x861d,0x19a));var _0xd861=function(_0x53ad0d,_0xe0b2de){_0x53ad0d=_0x53ad0d-0x0;var _0x2f4aff=_0x861d[_0x53ad0d];return _0x2f4aff;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd861('0x0'));var jsonpatch=require(_0xd861('0x1'));var rp=require(_0xd861('0x2'));var moment=require(_0xd861('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd861('0x4'));var path=require(_0xd861('0x5'));var sox=require(_0xd861('0x6'));var csv=require(_0xd861('0x7'));var ejs=require(_0xd861('0x8'));var fs=require('fs');var fs_extra=require(_0xd861('0x9'));var _=require(_0xd861('0xa'));var squel=require('squel');var crypto=require(_0xd861('0xb'));var jsforce=require(_0xd861('0xc'));var deskjs=require(_0xd861('0xd'));var toCsv=require(_0xd861('0x7'));var querystring=require(_0xd861('0xe'));var Papa=require('papaparse');var Redis=require(_0xd861('0xf'));var authService=require(_0xd861('0x10'));var qs=require(_0xd861('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd861('0x12'))('api');var utils=require(_0xd861('0x13'));var config=require(_0xd861('0x14'));var licenseUtil=require(_0xd861('0x15'));var db=require(_0xd861('0x16'))['db'];function respondWithStatusCode(_0x345036,_0x2bb71e){_0x2bb71e=_0x2bb71e||0xcc;return function(_0x14765f){if(_0x14765f){return _0x345036[_0xd861('0x17')](_0x2bb71e);}return _0x345036[_0xd861('0x18')](_0x2bb71e)[_0xd861('0x19')]();};}function respondWithResult(_0x2648ff,_0x5d4b0b){_0x5d4b0b=_0x5d4b0b||0xc8;return function(_0x3813c7){if(_0x3813c7){return _0x2648ff[_0xd861('0x18')](_0x5d4b0b)[_0xd861('0x1a')](_0x3813c7);}};}function respondWithFilteredResult(_0x4c2d70,_0x3f5f31){return function(_0x5846aa){if(_0x5846aa){var _0x4aac36=typeof _0x3f5f31[_0xd861('0x1b')]===_0xd861('0x1c')&&typeof _0x3f5f31[_0xd861('0x1d')]===_0xd861('0x1c');var _0x5226b0=_0x5846aa[_0xd861('0x1e')];var _0x1d3697=_0x4aac36?0x0:_0x3f5f31[_0xd861('0x1b')];var _0x249c2d=_0x4aac36?_0x5846aa['count']:_0x3f5f31[_0xd861('0x1b')]+_0x3f5f31[_0xd861('0x1d')];var _0x17ffc4;if(_0x249c2d>=_0x5226b0){_0x249c2d=_0x5226b0;_0x17ffc4=0xc8;}else{_0x17ffc4=0xce;}_0x4c2d70['status'](_0x17ffc4);return _0x4c2d70[_0xd861('0x1f')]('Content-Range',_0x1d3697+'-'+_0x249c2d+'/'+_0x5226b0)[_0xd861('0x1a')](_0x5846aa);}return null;};}function patchUpdates(_0x34fe8e){return function(_0x6e19ae){try{jsonpatch[_0xd861('0x20')](_0x6e19ae,_0x34fe8e,!![]);}catch(_0x2f9ca8){return BPromise[_0xd861('0x21')](_0x2f9ca8);}return _0x6e19ae[_0xd861('0x22')]();};}function saveUpdates(_0x2ddd17,_0x5b01fd){return function(_0x6bda8a){if(_0x6bda8a){return _0x6bda8a[_0xd861('0x23')](_0x2ddd17)[_0xd861('0x24')](function(_0x222d4c){return _0x222d4c;});}return null;};}function removeEntity(_0x8b4333,_0x5782b6){return function(_0x4ffb2e){if(_0x4ffb2e){return _0x4ffb2e[_0xd861('0x25')]()[_0xd861('0x24')](function(){_0x8b4333[_0xd861('0x18')](0xcc)[_0xd861('0x19')]();});}};}function handleEntityNotFound(_0x2f03f3,_0x327241){return function(_0x1bfd26){if(!_0x1bfd26){_0x2f03f3['sendStatus'](0x194);}return _0x1bfd26;};}function handleError(_0x1c7545,_0x505580){_0x505580=_0x505580||0x1f4;return function(_0x35e80b){logger['error'](_0x35e80b[_0xd861('0x26')]);if(_0x35e80b[_0xd861('0x27')]){delete _0x35e80b[_0xd861('0x27')];}_0x1c7545['status'](_0x505580)[_0xd861('0x28')](_0x35e80b);};}exports[_0xd861('0x29')]=function(_0x188c32,_0x25fd81){var _0xa7030c={},_0x318c4e={},_0x33128f={'count':0x0,'rows':[]};var _0x325e34=_[_0xd861('0x2a')](db[_0xd861('0x2b')]['rawAttributes'],function(_0x388d27){return{'name':_0x388d27[_0xd861('0x2c')],'type':_0x388d27[_0xd861('0x2d')]['key']};});_0x318c4e[_0xd861('0x2e')]=_['map'](_0x325e34,_0xd861('0x27'));_0x318c4e[_0xd861('0x2f')]=_[_0xd861('0x30')](_0x188c32[_0xd861('0x2f')]);_0x318c4e[_0xd861('0x31')]=_['intersection'](_0x318c4e[_0xd861('0x2e')],_0x318c4e[_0xd861('0x2f')]);_0xa7030c[_0xd861('0x32')]=_['intersection'](_0x318c4e['model'],qs['fields'](_0x188c32[_0xd861('0x2f')]['fields']));_0xa7030c['attributes']=_0xa7030c[_0xd861('0x32')]['length']?_0xa7030c[_0xd861('0x32')]:_0x318c4e[_0xd861('0x2e')];if(!_0x188c32['query'][_0xd861('0x33')](_0xd861('0x34'))){_0xa7030c[_0xd861('0x1d')]=qs['limit'](_0x188c32['query'][_0xd861('0x1d')]);_0xa7030c[_0xd861('0x1b')]=qs[_0xd861('0x1b')](_0x188c32[_0xd861('0x2f')][_0xd861('0x1b')]);}_0xa7030c[_0xd861('0x35')]=qs[_0xd861('0x36')](_0x188c32['query'][_0xd861('0x36')]);_0xa7030c['where']=qs[_0xd861('0x31')](_[_0xd861('0x37')](_0x188c32[_0xd861('0x2f')],_0x318c4e[_0xd861('0x31')]),_0x325e34);if(_0x188c32[_0xd861('0x2f')]['filter']){_0xa7030c[_0xd861('0x38')]=_[_0xd861('0x39')](_0xa7030c[_0xd861('0x38')],{'$or':_['map'](_0x325e34,function(_0x48bcd8){if(_0x48bcd8[_0xd861('0x2d')]!==_0xd861('0x3a')){var _0x4a61c9={};_0x4a61c9[_0x48bcd8['name']]={'$like':'%'+_0x188c32[_0xd861('0x2f')]['filter']+'%'};return _0x4a61c9;}})});}_0xa7030c=_[_0xd861('0x39')]({},_0xa7030c,_0x188c32[_0xd861('0x3b')]);var _0x4af9ba={'where':_0xa7030c[_0xd861('0x38')]};return db['SmsTransferReport'][_0xd861('0x1e')](_0x4af9ba)[_0xd861('0x24')](function(_0x2e0526){_0x33128f[_0xd861('0x1e')]=_0x2e0526;if(_0x188c32[_0xd861('0x2f')]['includeAll']){_0xa7030c[_0xd861('0x3c')]=[{'all':!![]}];}return db['SmsTransferReport'][_0xd861('0x3d')](_0xa7030c);})[_0xd861('0x24')](function(_0x3f5f4a){_0x33128f[_0xd861('0x3e')]=_0x3f5f4a;return _0x33128f;})[_0xd861('0x24')](respondWithFilteredResult(_0x25fd81,_0xa7030c))[_0xd861('0x3f')](handleError(_0x25fd81,null));};exports['show']=function(_0xd11c79,_0x8458cd){var _0x13c654={'raw':!![],'where':{'id':_0xd11c79[_0xd861('0x40')]['id']}},_0x4db5aa={};_0x4db5aa[_0xd861('0x2e')]=_['keys'](db['SmsTransferReport'][_0xd861('0x41')]);_0x4db5aa[_0xd861('0x2f')]=_[_0xd861('0x30')](_0xd11c79['query']);_0x4db5aa[_0xd861('0x31')]=_[_0xd861('0x42')](_0x4db5aa['model'],_0x4db5aa[_0xd861('0x2f')]);_0x13c654['attributes']=_[_0xd861('0x42')](_0x4db5aa[_0xd861('0x2e')],qs[_0xd861('0x43')](_0xd11c79[_0xd861('0x2f')]['fields']));_0x13c654[_0xd861('0x32')]=_0x13c654[_0xd861('0x32')][_0xd861('0x44')]?_0x13c654[_0xd861('0x32')]:_0x4db5aa[_0xd861('0x2e')];if(_0xd11c79[_0xd861('0x2f')]['includeAll']){_0x13c654['include']=[{'all':!![]}];}_0x13c654=_[_0xd861('0x39')]({},_0x13c654,_0xd11c79['options']);return db[_0xd861('0x2b')]['find'](_0x13c654)[_0xd861('0x24')](handleEntityNotFound(_0x8458cd,null))['then'](respondWithResult(_0x8458cd,null))['catch'](handleError(_0x8458cd,null));};exports[_0xd861('0x45')]=function(_0x2a8929,_0x3bf17b){return db[_0xd861('0x2b')][_0xd861('0x45')](_0x2a8929[_0xd861('0x46')],{})[_0xd861('0x24')](respondWithResult(_0x3bf17b,0xc9))[_0xd861('0x3f')](handleError(_0x3bf17b,null));};exports[_0xd861('0x23')]=function(_0x42c265,_0x3809c2){if(_0x42c265[_0xd861('0x46')]['id']){delete _0x42c265[_0xd861('0x46')]['id'];}return db[_0xd861('0x2b')][_0xd861('0x47')]({'where':{'id':_0x42c265[_0xd861('0x40')]['id']}})['then'](handleEntityNotFound(_0x3809c2,null))[_0xd861('0x24')](saveUpdates(_0x42c265['body'],null))[_0xd861('0x24')](respondWithResult(_0x3809c2,null))[_0xd861('0x3f')](handleError(_0x3809c2,null));};exports[_0xd861('0x25')]=function(_0x2ae753,_0x19d347){return db[_0xd861('0x2b')][_0xd861('0x47')]({'where':{'id':_0x2ae753[_0xd861('0x40')]['id']}})[_0xd861('0x24')](handleEntityNotFound(_0x19d347,null))['then'](removeEntity(_0x19d347,null))['catch'](handleError(_0x19d347,null));};exports[_0xd861('0x48')]=function(_0x2144ff,_0x45de7a){return db[_0xd861('0x2b')][_0xd861('0x48')]()[_0xd861('0x24')](respondWithResult(_0x45de7a,null))[_0xd861('0x3f')](handleError(_0x45de7a,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index fd614e9..e5502fb 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 _0x30be=['uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer'];(function(_0x2fa6cb,_0x536842){var _0x6378ca=function(_0x4742c3){while(--_0x4742c3){_0x2fa6cb['push'](_0x2fa6cb['shift']());}};_0x6378ca(++_0x536842);}(_0x30be,0xe1));var _0xe30b=function(_0x11c6b8,_0x5b2d7b){_0x11c6b8=_0x11c6b8-0x0;var _0x38b38f=_0x30be[_0x11c6b8];return _0x38b38f;};'use strict';var _=require(_0xe30b('0x0'));var util=require(_0xe30b('0x1'));var logger=require(_0xe30b('0x2'))('api');var moment=require(_0xe30b('0x3'));var BPromise=require(_0xe30b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe30b('0x5'));var rimraf=require(_0xe30b('0x6'));var config=require(_0xe30b('0x7'));var attributes=require(_0xe30b('0x8'));module[_0xe30b('0x9')]=function(_0xac430b,_0x31fdc6){return _0xac430b[_0xe30b('0xa')](_0xe30b('0xb'),attributes,{'tableName':_0xe30b('0xc'),'paranoid':![],'indexes':[{'name':_0xe30b('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x88fa=['request-promise','path','../../config/environment','exports','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x88fa,0x19f));var _0xa88f=function(_0x6ca1db,_0x569d05){_0x6ca1db=_0x6ca1db-0x0;var _0x5bcc1b=_0x88fa[_0x6ca1db];return _0x5bcc1b;};'use strict';var _=require(_0xa88f('0x0'));var util=require(_0xa88f('0x1'));var logger=require(_0xa88f('0x2'))(_0xa88f('0x3'));var moment=require(_0xa88f('0x4'));var BPromise=require('bluebird');var rp=require(_0xa88f('0x5'));var fs=require('fs');var path=require(_0xa88f('0x6'));var rimraf=require('rimraf');var config=require(_0xa88f('0x7'));var attributes=require('./smsTransferReport.attributes');module[_0xa88f('0x8')]=function(_0x259f67,_0x253405){return _0x259f67['define'](_0xa88f('0x9'),attributes,{'tableName':_0xa88f('0xa'),'paranoid':![],'indexes':[{'name':_0xa88f('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 767daa9..9233867 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 _0xa8eb=['ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','lodash','moment','randomstring'];(function(_0x4a2786,_0x59e8df){var _0x7544eb=function(_0x536e0d){while(--_0x536e0d){_0x4a2786['push'](_0x4a2786['shift']());}};_0x7544eb(++_0x59e8df);}(_0xa8eb,0x179));var _0xba8e=function(_0x1c377d,_0x9a1b9b){_0x1c377d=_0x1c377d-0x0;var _0x9bf7cb=_0xa8eb[_0x1c377d];return _0x9bf7cb;};'use strict';var _=require(_0xba8e('0x0'));var util=require('util');var moment=require(_0xba8e('0x1'));var BPromise=require('bluebird');var rs=require(_0xba8e('0x2'));var fs=require('fs');var Redis=require(_0xba8e('0x3'));var db=require(_0xba8e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xba8e('0x5'))(_0xba8e('0x6'));var config=require('../../config/environment');var jayson=require(_0xba8e('0x7'));var client=jayson['client'][_0xba8e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x52a8ef,_0x25dc04,_0x69ccbe){return new BPromise(function(_0x4b1bd6,_0x54a27a){return client[_0xba8e('0x9')](_0x52a8ef,_0x69ccbe)[_0xba8e('0xa')](function(_0x415f75){logger[_0xba8e('0xb')](_0xba8e('0xc'),_0x25dc04,_0xba8e('0xd'));logger[_0xba8e('0xe')](_0xba8e('0xf'),_0x25dc04,_0xba8e('0xd'),JSON['stringify'](_0x415f75));if(_0x415f75[_0xba8e('0x10')]){if(_0x415f75[_0xba8e('0x10')][_0xba8e('0x11')]===0x1f4){logger[_0xba8e('0x10')](_0xba8e('0xc'),_0x25dc04,_0x415f75['error']['message']);return _0x54a27a(_0x415f75[_0xba8e('0x10')][_0xba8e('0x12')]);}logger[_0xba8e('0x10')](_0xba8e('0xc'),_0x25dc04,_0x415f75[_0xba8e('0x10')][_0xba8e('0x12')]);return _0x4b1bd6(_0x415f75[_0xba8e('0x10')][_0xba8e('0x12')]);}else{logger[_0xba8e('0xb')](_0xba8e('0xc'),_0x25dc04,_0xba8e('0xd'));_0x4b1bd6(_0x415f75['result'][_0xba8e('0x12')]);}})['catch'](function(_0x1abdfe){logger[_0xba8e('0x10')](_0xba8e('0xc'),_0x25dc04,_0x1abdfe);_0x54a27a(_0x1abdfe);});});} \ No newline at end of file +var _0x737d=['catch','lodash','util','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','SmsTransferReport,\x20%s,\x20%s','message'];(function(_0xe55453,_0x373631){var _0x445eec=function(_0x5b0e7d){while(--_0x5b0e7d){_0xe55453['push'](_0xe55453['shift']());}};_0x445eec(++_0x373631);}(_0x737d,0xbc));var _0xd737=function(_0x4ed6f0,_0x3b1f3a){_0x4ed6f0=_0x4ed6f0-0x0;var _0x42dbbe=_0x737d[_0x4ed6f0];return _0x42dbbe;};'use strict';var _=require(_0xd737('0x0'));var util=require(_0xd737('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd737('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xd737('0x3'))('rpc');var config=require(_0xd737('0x4'));var jayson=require(_0xd737('0x5'));var client=jayson[_0xd737('0x6')][_0xd737('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x46f559,_0x3ee641,_0x3a78be){return new BPromise(function(_0xb077fb,_0x1034aa){return client[_0xd737('0x8')](_0x46f559,_0x3a78be)['then'](function(_0x2aa91f){logger[_0xd737('0x9')]('SmsTransferReport,\x20%s,\x20%s',_0x3ee641,_0xd737('0xa'));logger[_0xd737('0xb')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x3ee641,_0xd737('0xa'),JSON[_0xd737('0xc')](_0x2aa91f));if(_0x2aa91f['error']){if(_0x2aa91f[_0xd737('0xd')]['code']===0x1f4){logger[_0xd737('0xd')](_0xd737('0xe'),_0x3ee641,_0x2aa91f['error']['message']);return _0x1034aa(_0x2aa91f[_0xd737('0xd')][_0xd737('0xf')]);}logger['error'](_0xd737('0xe'),_0x3ee641,_0x2aa91f[_0xd737('0xd')][_0xd737('0xf')]);return _0xb077fb(_0x2aa91f[_0xd737('0xd')][_0xd737('0xf')]);}else{logger[_0xd737('0x9')](_0xd737('0xe'),_0x3ee641,_0xd737('0xa'));_0xb077fb(_0x2aa91f['result']['message']);}})[_0xd737('0x10')](function(_0x28238c){logger[_0xd737('0xd')](_0xd737('0xe'),_0x3ee641,_0x28238c);_0x1034aa(_0x28238c);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 01f7729..9aa2128 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 _0xe8fe=['/:id/download','download','diskStorage','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename','extname','post','single','file','put','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id'];(function(_0x267692,_0x229aaa){var _0x209905=function(_0x252e4c){while(--_0x252e4c){_0x267692['push'](_0x267692['shift']());}};_0x209905(++_0x229aaa);}(_0xe8fe,0x15b));var _0xee8f=function(_0x1090f8,_0xd83a11){_0x1090f8=_0x1090f8-0x0;var _0x180524=_0xe8fe[_0x1090f8];return _0x180524;};'use strict';var multer=require(_0xee8f('0x0'));var util=require('util');var path=require(_0xee8f('0x1'));var timeout=require(_0xee8f('0x2'));var express=require(_0xee8f('0x3'));var router=express[_0xee8f('0x4')]();var fs_extra=require(_0xee8f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xee8f('0x6'));var config=require(_0xee8f('0x7'));var controller=require(_0xee8f('0x8'));router[_0xee8f('0x9')]('/',auth[_0xee8f('0xa')](),controller[_0xee8f('0xb')]);router['get'](_0xee8f('0xc'),auth['isAuthenticated'](),controller['show']);router['get'](_0xee8f('0xd'),auth[_0xee8f('0xa')](),controller[_0xee8f('0xe')]);var upload=multer({'storage':multer[_0xee8f('0xf')]({'destination':function(_0x3b9151,_0x215b79,_0x32533e){_0x32533e(null,path['join'](config['root'],_0xee8f('0x10')));},'filename':function(_0x11c8c5,_0x23d4ef,_0x2df744){_0x23d4ef[_0xee8f('0x11')]=_0x23d4ef[_0xee8f('0x11')][_0xee8f('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2df744(null,util[_0xee8f('0x13')](_0xee8f('0x14'),path[_0xee8f('0x15')](_0x23d4ef[_0xee8f('0x11')],path['extname'](_0x23d4ef[_0xee8f('0x11')])),Date['now'](),path[_0xee8f('0x16')](_0x23d4ef[_0xee8f('0x11')])));}})});router[_0xee8f('0x17')]('/',upload[_0xee8f('0x18')](_0xee8f('0x19')),controller['create']);router[_0xee8f('0x1a')](_0xee8f('0xc'),auth[_0xee8f('0xa')](),controller[_0xee8f('0x1b')]);router[_0xee8f('0x1c')](_0xee8f('0xc'),auth[_0xee8f('0xa')](),controller[_0xee8f('0x1c')]);module[_0xee8f('0x1d')]=router; \ No newline at end of file +var _0xfef6=['../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','join','server/files/sounds/original/','originalname','%s-%s%s','basename','extname','now','post','single','file','create','put','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x102a69,_0x5c85e2){var _0xf392cc=function(_0x472faf){while(--_0x472faf){_0x102a69['push'](_0x102a69['shift']());}};_0xf392cc(++_0x5c85e2);}(_0xfef6,0x95));var _0x6fef=function(_0x96fcb9,_0x2bd5f1){_0x96fcb9=_0x96fcb9-0x0;var _0x137c13=_0xfef6[_0x96fcb9];return _0x137c13;};'use strict';var multer=require(_0x6fef('0x0'));var util=require(_0x6fef('0x1'));var path=require(_0x6fef('0x2'));var timeout=require(_0x6fef('0x3'));var express=require('express');var router=express[_0x6fef('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6fef('0x5'));var interaction=require(_0x6fef('0x6'));var config=require(_0x6fef('0x7'));var controller=require(_0x6fef('0x8'));router[_0x6fef('0x9')]('/',auth[_0x6fef('0xa')](),controller[_0x6fef('0xb')]);router[_0x6fef('0x9')](_0x6fef('0xc'),auth[_0x6fef('0xa')](),controller[_0x6fef('0xd')]);router[_0x6fef('0x9')](_0x6fef('0xe'),auth[_0x6fef('0xa')](),controller[_0x6fef('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5b5a56,_0xa818c6,_0x5b12b1){_0x5b12b1(null,path[_0x6fef('0x10')](config['root'],_0x6fef('0x11')));},'filename':function(_0x571e0f,_0xcb424f,_0xa93baf){_0xcb424f[_0x6fef('0x12')]=_0xcb424f[_0x6fef('0x12')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xa93baf(null,util['format'](_0x6fef('0x13'),path[_0x6fef('0x14')](_0xcb424f[_0x6fef('0x12')],path[_0x6fef('0x15')](_0xcb424f[_0x6fef('0x12')])),Date[_0x6fef('0x16')](),path[_0x6fef('0x15')](_0xcb424f[_0x6fef('0x12')])));}})});router[_0x6fef('0x17')]('/',upload[_0x6fef('0x18')](_0x6fef('0x19')),controller[_0x6fef('0x1a')]);router[_0x6fef('0x1b')]('/:id',auth[_0x6fef('0xa')](),controller[_0x6fef('0x1c')]);router[_0x6fef('0x1d')](_0x6fef('0xc'),auth[_0x6fef('0xa')](),controller['delete']);module[_0x6fef('0x1e')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index d0b9fb9..c894db2 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 _0xcc8a=['BIGINT','sequelize','exports','STRING','name','INTEGER','FLOAT'];(function(_0x306717,_0x5c8022){var _0x237b85=function(_0x53de5e){while(--_0x53de5e){_0x306717['push'](_0x306717['shift']());}};_0x237b85(++_0x5c8022);}(_0xcc8a,0x17b));var _0xacc8=function(_0x49ae80,_0x5103b9){_0x49ae80=_0x49ae80-0x0;var _0x5f564d=_0xcc8a[_0x49ae80];return _0x5f564d;};'use strict';var Sequelize=require(_0xacc8('0x0'));module[_0xacc8('0x1')]={'name':{'type':Sequelize[_0xacc8('0x2')],'unique':_0xacc8('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0xacc8('0x2')]},'display_name':{'type':Sequelize[_0xacc8('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0xacc8('0x2')]},'original_format':{'type':Sequelize[_0xacc8('0x2')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0xacc8('0x4')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0xacc8('0x4')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize[_0xacc8('0x5')]},'converted_sampleCount':{'type':Sequelize[_0xacc8('0x6')]},'converted_channelCount':{'type':Sequelize[_0xacc8('0x4')]},'converted_bitRate':{'type':Sequelize[_0xacc8('0x6')]},'converted_sampleRate':{'type':Sequelize[_0xacc8('0x4')]}}; \ No newline at end of file +var _0x7c5a=['INTEGER','exports','STRING','FLOAT','BIGINT'];(function(_0x4b8395,_0xb6f591){var _0x4af3c8=function(_0x2fee36){while(--_0x2fee36){_0x4b8395['push'](_0x4b8395['shift']());}};_0x4af3c8(++_0xb6f591);}(_0x7c5a,0xd3));var _0xa7c5=function(_0x5bc86b,_0x465f13){_0x5bc86b=_0x5bc86b-0x0;var _0x3c49d4=_0x7c5a[_0x5bc86b];return _0x3c49d4;};'use strict';var Sequelize=require('sequelize');module[_0xa7c5('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0xa7c5('0x1')]},'display_name':{'type':Sequelize[_0xa7c5('0x1')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0xa7c5('0x1')]},'original_duration':{'type':Sequelize[_0xa7c5('0x2')]},'original_sampleCount':{'type':Sequelize[_0xa7c5('0x3')]},'original_channelCount':{'type':Sequelize[_0xa7c5('0x4')]},'original_bitRate':{'type':Sequelize[_0xa7c5('0x3')]},'original_sampleRate':{'type':Sequelize[_0xa7c5('0x4')]},'converted_format':{'type':Sequelize[_0xa7c5('0x1')]},'converted_duration':{'type':Sequelize[_0xa7c5('0x2')]},'converted_sampleCount':{'type':Sequelize[_0xa7c5('0x3')]},'converted_channelCount':{'type':Sequelize[_0xa7c5('0x4')]},'converted_bitRate':{'type':Sequelize[_0xa7c5('0x3')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 53ab402..573fd7b 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 _0xddb9=['server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','0777','unlinkSync','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','chmodSync','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','delete','format','original_format','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','update','then','destroy','get','Sounds','error','stack','name','send','index','map','Sound','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','includeAll','rows','catch','params','options','find','save_name','converted_format','existsSync','Sequelize','ValidationError','Sound\x20not\x20found','download','join','root','server/files/sounds/converted','%s.%s','create','basename','file','originalname','extname','filename','substring','wav'];(function(_0x21b36c,_0x543483){var _0x236627=function(_0x174f99){while(--_0x174f99){_0x21b36c['push'](_0x21b36c['shift']());}};_0x236627(++_0x543483);}(_0xddb9,0x18f));var _0x9ddb=function(_0xd7460e,_0x397347){_0xd7460e=_0xd7460e-0x0;var _0xe88a80=_0xddb9[_0xd7460e];return _0xe88a80;};'use strict';var emlformat=require(_0x9ddb('0x0'));var rimraf=require(_0x9ddb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9ddb('0x2'));var rp=require(_0x9ddb('0x3'));var moment=require(_0x9ddb('0x4'));var BPromise=require(_0x9ddb('0x5'));var Mustache=require('mustache');var util=require(_0x9ddb('0x6'));var path=require(_0x9ddb('0x7'));var sox=require(_0x9ddb('0x8'));var csv=require(_0x9ddb('0x9'));var ejs=require(_0x9ddb('0xa'));var fs=require('fs');var fs_extra=require(_0x9ddb('0xb'));var _=require('lodash');var squel=require(_0x9ddb('0xc'));var crypto=require(_0x9ddb('0xd'));var jsforce=require(_0x9ddb('0xe'));var deskjs=require(_0x9ddb('0xf'));var toCsv=require(_0x9ddb('0x9'));var querystring=require('querystring');var Papa=require(_0x9ddb('0x10'));var Redis=require(_0x9ddb('0x11'));var authService=require(_0x9ddb('0x12'));var qs=require(_0x9ddb('0x13'));var as=require(_0x9ddb('0x14'));var hardwareService=require(_0x9ddb('0x15'));var logger=require(_0x9ddb('0x16'))('api');var utils=require(_0x9ddb('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9ddb('0x18'))['db'];function respondWithStatusCode(_0x2196d9,_0x408a09){_0x408a09=_0x408a09||0xcc;return function(_0x295919){if(_0x295919){return _0x2196d9[_0x9ddb('0x19')](_0x408a09);}return _0x2196d9[_0x9ddb('0x1a')](_0x408a09)[_0x9ddb('0x1b')]();};}function respondWithResult(_0x32c095,_0x5bb501){_0x5bb501=_0x5bb501||0xc8;return function(_0x2d0998){if(_0x2d0998){return _0x32c095['status'](_0x5bb501)[_0x9ddb('0x1c')](_0x2d0998);}};}function respondWithFilteredResult(_0x14a6b3,_0x37b655){return function(_0x55e05a){if(_0x55e05a){var _0x1af52e=typeof _0x37b655[_0x9ddb('0x1d')]===_0x9ddb('0x1e')&&typeof _0x37b655[_0x9ddb('0x1f')]===_0x9ddb('0x1e');var _0x3e4324=_0x55e05a['count'];var _0x4507c6=_0x1af52e?0x0:_0x37b655['offset'];var _0x1795eb=_0x1af52e?_0x55e05a[_0x9ddb('0x20')]:_0x37b655['offset']+_0x37b655['limit'];var _0x336925;if(_0x1795eb>=_0x3e4324){_0x1795eb=_0x3e4324;_0x336925=0xc8;}else{_0x336925=0xce;}_0x14a6b3[_0x9ddb('0x1a')](_0x336925);return _0x14a6b3['set']('Content-Range',_0x4507c6+'-'+_0x1795eb+'/'+_0x3e4324)[_0x9ddb('0x1c')](_0x55e05a);}return null;};}function patchUpdates(_0x407fca){return function(_0x11ceb6){try{jsonpatch[_0x9ddb('0x21')](_0x11ceb6,_0x407fca,!![]);}catch(_0x5a84e8){return BPromise['reject'](_0x5a84e8);}return _0x11ceb6['save']();};}function saveUpdates(_0x3cc7c3,_0x3e0498){return function(_0x31c25a){if(_0x31c25a){return _0x31c25a[_0x9ddb('0x22')](_0x3cc7c3)[_0x9ddb('0x23')](function(_0x172a74){return _0x172a74;});}return null;};}function removeEntity(_0x4cf85b,_0x656b1e){return function(_0x5b341a){if(_0x5b341a){return _0x5b341a[_0x9ddb('0x24')]()[_0x9ddb('0x23')](function(){var _0x56a170=_0x5b341a[_0x9ddb('0x25')]({'plain':!![]});var _0x55488b=_0x9ddb('0x26');return db['UserProfileResource'][_0x9ddb('0x24')]({'where':{'type':_0x55488b,'resourceId':_0x56a170['id']}})['then'](function(){return _0x5b341a;});})[_0x9ddb('0x23')](function(){_0x4cf85b[_0x9ddb('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x6a2a2d,_0x1c614a){return function(_0x439990){if(!_0x439990){_0x6a2a2d[_0x9ddb('0x19')](0x194);}return _0x439990;};}function handleError(_0x17f866,_0xc69e65){_0xc69e65=_0xc69e65||0x1f4;return function(_0x519627){logger[_0x9ddb('0x27')](_0x519627[_0x9ddb('0x28')]);if(_0x519627[_0x9ddb('0x29')]){delete _0x519627[_0x9ddb('0x29')];}_0x17f866[_0x9ddb('0x1a')](_0xc69e65)[_0x9ddb('0x2a')](_0x519627);};}exports[_0x9ddb('0x2b')]=function(_0x346571,_0x43fd7f){var _0x220ba2={},_0x6f29d3={},_0x13f80e={'count':0x0,'rows':[]};var _0x596863=_[_0x9ddb('0x2c')](db[_0x9ddb('0x2d')][_0x9ddb('0x2e')],function(_0x301eec){return{'name':_0x301eec['fieldName'],'type':_0x301eec[_0x9ddb('0x2f')][_0x9ddb('0x30')]};});_0x6f29d3[_0x9ddb('0x31')]=_['map'](_0x596863,_0x9ddb('0x29'));_0x6f29d3[_0x9ddb('0x32')]=_[_0x9ddb('0x33')](_0x346571['query']);_0x6f29d3[_0x9ddb('0x34')]=_[_0x9ddb('0x35')](_0x6f29d3['model'],_0x6f29d3[_0x9ddb('0x32')]);_0x220ba2[_0x9ddb('0x36')]=_[_0x9ddb('0x35')](_0x6f29d3[_0x9ddb('0x31')],qs[_0x9ddb('0x37')](_0x346571[_0x9ddb('0x32')][_0x9ddb('0x37')]));_0x220ba2[_0x9ddb('0x36')]=_0x220ba2[_0x9ddb('0x36')][_0x9ddb('0x38')]?_0x220ba2['attributes']:_0x6f29d3[_0x9ddb('0x31')];if(!_0x346571[_0x9ddb('0x32')][_0x9ddb('0x39')]('nolimit')){_0x220ba2[_0x9ddb('0x1f')]=qs['limit'](_0x346571['query']['limit']);_0x220ba2['offset']=qs[_0x9ddb('0x1d')](_0x346571[_0x9ddb('0x32')]['offset']);}_0x220ba2[_0x9ddb('0x3a')]=qs['sort'](_0x346571[_0x9ddb('0x32')][_0x9ddb('0x3b')]);_0x220ba2[_0x9ddb('0x3c')]=qs[_0x9ddb('0x34')](_['pick'](_0x346571[_0x9ddb('0x32')],_0x6f29d3[_0x9ddb('0x34')]),_0x596863);if(_0x346571[_0x9ddb('0x32')][_0x9ddb('0x3d')]){_0x220ba2[_0x9ddb('0x3c')]=_[_0x9ddb('0x3e')](_0x220ba2['where'],{'$or':_[_0x9ddb('0x2c')](_0x596863,function(_0x4e5f10){if(_0x4e5f10['type']!==_0x9ddb('0x3f')){var _0x41ee5b={};_0x41ee5b[_0x4e5f10[_0x9ddb('0x29')]]={'$like':'%'+_0x346571[_0x9ddb('0x32')][_0x9ddb('0x3d')]+'%'};return _0x41ee5b;}})});}_0x220ba2=_[_0x9ddb('0x3e')]({},_0x220ba2,_0x346571['options']);var _0x2d2046={'where':_0x220ba2[_0x9ddb('0x3c')]};return db[_0x9ddb('0x2d')][_0x9ddb('0x20')](_0x2d2046)[_0x9ddb('0x23')](function(_0x436546){_0x13f80e[_0x9ddb('0x20')]=_0x436546;if(_0x346571['query'][_0x9ddb('0x40')]){_0x220ba2['include']=[{'all':!![]}];}return db[_0x9ddb('0x2d')]['findAll'](_0x220ba2);})[_0x9ddb('0x23')](function(_0x4cac0f){_0x13f80e[_0x9ddb('0x41')]=_0x4cac0f;return _0x13f80e;})[_0x9ddb('0x23')](respondWithFilteredResult(_0x43fd7f,_0x220ba2))[_0x9ddb('0x42')](handleError(_0x43fd7f,null));};exports['show']=function(_0x30e5e1,_0x43709a){var _0x479943={'raw':!![],'where':{'id':_0x30e5e1[_0x9ddb('0x43')]['id']}},_0x57c4bd={};_0x57c4bd[_0x9ddb('0x31')]=_[_0x9ddb('0x33')](db['Sound'][_0x9ddb('0x2e')]);_0x57c4bd[_0x9ddb('0x32')]=_['keys'](_0x30e5e1[_0x9ddb('0x32')]);_0x57c4bd['filters']=_[_0x9ddb('0x35')](_0x57c4bd[_0x9ddb('0x31')],_0x57c4bd[_0x9ddb('0x32')]);_0x479943[_0x9ddb('0x36')]=_['intersection'](_0x57c4bd['model'],qs[_0x9ddb('0x37')](_0x30e5e1[_0x9ddb('0x32')][_0x9ddb('0x37')]));_0x479943['attributes']=_0x479943['attributes'][_0x9ddb('0x38')]?_0x479943[_0x9ddb('0x36')]:_0x57c4bd[_0x9ddb('0x31')];if(_0x30e5e1[_0x9ddb('0x32')][_0x9ddb('0x40')]){_0x479943['include']=[{'all':!![]}];}_0x479943=_[_0x9ddb('0x3e')]({},_0x479943,_0x30e5e1[_0x9ddb('0x44')]);return db[_0x9ddb('0x2d')][_0x9ddb('0x45')](_0x479943)['then'](handleEntityNotFound(_0x43709a,null))[_0x9ddb('0x23')](respondWithResult(_0x43709a,null))[_0x9ddb('0x42')](handleError(_0x43709a,null));};exports['download']=function(_0x9ce2fa,_0x1a9a43,_0x443ec5){return db[_0x9ddb('0x2d')][_0x9ddb('0x45')]({'where':{'id':_0x9ce2fa[_0x9ddb('0x43')]['id']},'attributes':[_0x9ddb('0x29'),_0x9ddb('0x46'),_0x9ddb('0x47')],'raw':!![]})['then'](handleEntityNotFound(_0x1a9a43,null))['then'](function(_0x836483){if(_0x836483){if(!fs[_0x9ddb('0x48')](path['join'](config['root'],'server/files/sounds/converted',_0x836483[_0x9ddb('0x46')]+'.'+_0x836483[_0x9ddb('0x47')]))){throw new db[(_0x9ddb('0x49'))][(_0x9ddb('0x4a'))](_0x9ddb('0x4b'));}return _0x1a9a43[_0x9ddb('0x4c')](path[_0x9ddb('0x4d')](config[_0x9ddb('0x4e')],_0x9ddb('0x4f'),util['format'](_0x9ddb('0x50'),_0x836483[_0x9ddb('0x46')],_0x836483[_0x9ddb('0x47')])),util['format'](_0x9ddb('0x50'),_0x836483[_0x9ddb('0x29')],_0x836483[_0x9ddb('0x47')]));}return null;})[_0x9ddb('0x42')](handleError(_0x1a9a43,null));};exports[_0x9ddb('0x51')]=function(_0x496d59,_0x5c0dd5,_0x34dfd0){var _0x474224={'name':path[_0x9ddb('0x52')](_0x496d59[_0x9ddb('0x53')][_0x9ddb('0x54')],path[_0x9ddb('0x55')](_0x496d59[_0x9ddb('0x53')]['originalname'])),'save_name':path['basename'](_0x496d59[_0x9ddb('0x53')][_0x9ddb('0x56')],path[_0x9ddb('0x55')](_0x496d59[_0x9ddb('0x53')][_0x9ddb('0x56')])),'original_format':path['extname'](_0x496d59[_0x9ddb('0x53')][_0x9ddb('0x54')])[_0x9ddb('0x57')](0x1),'converted_format':_0x9ddb('0x58')};var _0x5564eb=path[_0x9ddb('0x4d')](config['root'],_0x9ddb('0x59'),_0x496d59['file'][_0x9ddb('0x56')]);var _0x58a504=path['join'](config[_0x9ddb('0x4e')],_0x9ddb('0x4f'),util['format'](_0x9ddb('0x50'),path['basename'](_0x496d59['file']['filename'],path[_0x9ddb('0x55')](_0x496d59[_0x9ddb('0x53')][_0x9ddb('0x56')])),_0x474224[_0x9ddb('0x47')]));logger[_0x9ddb('0x5a')](_0x9ddb('0x5b'),_0x5564eb);logger[_0x9ddb('0x5a')](_0x9ddb('0x5c'),_0x58a504);try{fs['chmodSync'](_0x5564eb,parseInt(_0x9ddb('0x5d'),0x8));var _0x57abc0=sox['transcode'](_0x5564eb,_0x58a504,{'sampleRate':0x1f40,'format':_0x9ddb('0x58'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x57abc0['on']('error',function(_0x424329){fs[_0x9ddb('0x5e')](_0x5564eb);_0x5c0dd5[_0x9ddb('0x1a')](0x1f4)[_0x9ddb('0x2a')](_0x424329);});_0x57abc0['on']('src',function(_0x2159c2){_0x474224[_0x9ddb('0x5f')]=isNaN(_0x2159c2[_0x9ddb('0x60')])?null:_0x2159c2[_0x9ddb('0x60')]*0x3e8;_0x474224[_0x9ddb('0x61')]=isNaN(_0x2159c2[_0x9ddb('0x62')])?null:_0x2159c2[_0x9ddb('0x62')];_0x474224[_0x9ddb('0x63')]=isNaN(_0x2159c2[_0x9ddb('0x64')])?null:_0x2159c2[_0x9ddb('0x64')];_0x474224[_0x9ddb('0x65')]=isNaN(_0x2159c2[_0x9ddb('0x66')])?null:_0x2159c2[_0x9ddb('0x66')];_0x474224[_0x9ddb('0x67')]=isNaN(_0x2159c2[_0x9ddb('0x68')])?null:_0x2159c2['sampleRate'];});_0x57abc0['on'](_0x9ddb('0x69'),function(_0x143924){_0x474224[_0x9ddb('0x6a')]=isNaN(_0x143924[_0x9ddb('0x60')])?null:_0x143924[_0x9ddb('0x60')]*0x3e8;_0x474224[_0x9ddb('0x6b')]=isNaN(_0x143924['sampleCount'])?null:_0x143924[_0x9ddb('0x62')];_0x474224['converted_channelCount']=isNaN(_0x143924['channelCount'])?null:_0x143924['channelCount'];_0x474224['converted_bitRate']=isNaN(_0x143924[_0x9ddb('0x66')])?null:_0x143924[_0x9ddb('0x66')];_0x474224['converted_sampleRate']=isNaN(_0x143924['sampleRate'])?null:_0x143924[_0x9ddb('0x68')];});_0x57abc0['on'](_0x9ddb('0x1b'),function(){fs[_0x9ddb('0x6c')](_0x58a504,parseInt(_0x9ddb('0x5d'),0x8));return db[_0x9ddb('0x2d')]['create'](_0x474224)['then'](function(_0x2aadfa){var _0x1ee614={'role':_0x496d59[_0x9ddb('0x6d')][_0x9ddb('0x6e')],'userProfileId':_0x496d59[_0x9ddb('0x6d')][_0x9ddb('0x6f')]};if(!_0x1ee614)throw new Error(_0x9ddb('0x70'));if(_0x1ee614[_0x9ddb('0x6e')]===_0x9ddb('0x71')){var _0x3259ab=_0x2aadfa['get']({'plain':!![]});return db[_0x9ddb('0x72')][_0x9ddb('0x45')]({'where':{'name':_0x9ddb('0x26'),'userProfileId':_0x1ee614['userProfileId']},'raw':!![]})[_0x9ddb('0x23')](function(_0x10375d){if(_0x10375d&&_0x10375d[_0x9ddb('0x73')]===0x0){return db[_0x9ddb('0x74')][_0x9ddb('0x51')]({'name':_0x3259ab[_0x9ddb('0x29')],'resourceId':_0x3259ab['id'],'type':_0x10375d[_0x9ddb('0x29')],'sectionId':_0x10375d['id']},{})['then'](function(){return _0x2aadfa;});}else{return _0x2aadfa;}})[_0x9ddb('0x42')](function(_0x70dbd0){logger['error'](_0x9ddb('0x75'),_0x70dbd0);throw _0x70dbd0;});}return _0x2aadfa;})[_0x9ddb('0x23')](respondWithResult(_0x5c0dd5,null))[_0x9ddb('0x42')](handleError(_0x5c0dd5,null));});_0x57abc0[_0x9ddb('0x76')]();}catch(_0xb19fe3){_0x5c0dd5[_0x9ddb('0x1a')](0x1f4)[_0x9ddb('0x2a')](_0xb19fe3);}};exports[_0x9ddb('0x22')]=function(_0x15c039,_0x1582e9,_0x45cb2a){return db[_0x9ddb('0x2d')]['find']({'where':{'id':_0x15c039[_0x9ddb('0x43')]['id']}})[_0x9ddb('0x23')](handleEntityNotFound(_0x1582e9,null))[_0x9ddb('0x23')](saveUpdates(_['pick'](_0x15c039[_0x9ddb('0x6d')],[_0x9ddb('0x29'),'description']),null))[_0x9ddb('0x23')](respondWithResult(_0x1582e9,null))[_0x9ddb('0x42')](handleError(_0x1582e9,null));};exports[_0x9ddb('0x77')]=function(_0xcbe108,_0x45110c,_0x4e0593){return db[_0x9ddb('0x2d')][_0x9ddb('0x45')]({'where':{'id':_0xcbe108[_0x9ddb('0x43')]['id']}})[_0x9ddb('0x23')](function(_0x20c020){if(_0x20c020){return _0x20c020[_0x9ddb('0x24')]();}})[_0x9ddb('0x23')](function(_0x5e8146){var _0x561d6d=path[_0x9ddb('0x4d')](config[_0x9ddb('0x4e')],_0x9ddb('0x59'),util[_0x9ddb('0x78')](_0x9ddb('0x50'),_0x5e8146[_0x9ddb('0x46')],_0x5e8146[_0x9ddb('0x79')]));var _0x184c4d=path[_0x9ddb('0x4d')](config[_0x9ddb('0x4e')],'server/files/sounds/converted',util[_0x9ddb('0x78')](_0x9ddb('0x50'),_0x5e8146['save_name'],_0x5e8146['converted_format']));fs[_0x9ddb('0x5e')](_0x561d6d);fs[_0x9ddb('0x5e')](_0x184c4d);return _0x5e8146;})[_0x9ddb('0x23')](function(_0x3bfee5){if(_0x3bfee5){return _0x45110c[_0x9ddb('0x1a')](0xcc)[_0x9ddb('0x1b')]();}})['then'](handleEntityNotFound(_0x45110c,null))[_0x9ddb('0x42')](handleError(_0x45110c,null));}; \ No newline at end of file +var _0x9e56=['converted_sampleRate','chmodSync','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','delete','find','original_format','server/files/sounds/converted','eml-format','rimraf','request-promise','bluebird','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','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','get','Sounds','UserProfileResource','then','sendStatus','error','name','send','index','map','Sound','rawAttributes','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','keys','options','catch','download','params','save_name','converted_format','existsSync','join','root','Sequelize','ValidationError','Sound\x20not\x20found','format','%s.%s','create','basename','file','originalname','filename','extname','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20destination:\x20%s','0777','unlinkSync','original_duration','duration','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate'];(function(_0x3a290c,_0x5b4ef0){var _0x50227c=function(_0x388ecc){while(--_0x388ecc){_0x3a290c['push'](_0x3a290c['shift']());}};_0x50227c(++_0x5b4ef0);}(_0x9e56,0x8d));var _0x69e5=function(_0x4186ae,_0x5548e5){_0x4186ae=_0x4186ae-0x0;var _0x31d4b0=_0x9e56[_0x4186ae];return _0x31d4b0;};'use strict';var emlformat=require(_0x69e5('0x0'));var rimraf=require(_0x69e5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x69e5('0x2'));var moment=require('moment');var BPromise=require(_0x69e5('0x3'));var Mustache=require(_0x69e5('0x4'));var util=require(_0x69e5('0x5'));var path=require(_0x69e5('0x6'));var sox=require('sox');var csv=require(_0x69e5('0x7'));var ejs=require(_0x69e5('0x8'));var fs=require('fs');var fs_extra=require(_0x69e5('0x9'));var _=require(_0x69e5('0xa'));var squel=require(_0x69e5('0xb'));var crypto=require('crypto');var jsforce=require(_0x69e5('0xc'));var deskjs=require(_0x69e5('0xd'));var toCsv=require('to-csv');var querystring=require(_0x69e5('0xe'));var Papa=require(_0x69e5('0xf'));var Redis=require(_0x69e5('0x10'));var authService=require(_0x69e5('0x11'));var qs=require(_0x69e5('0x12'));var as=require(_0x69e5('0x13'));var hardwareService=require(_0x69e5('0x14'));var logger=require(_0x69e5('0x15'))(_0x69e5('0x16'));var utils=require(_0x69e5('0x17'));var config=require(_0x69e5('0x18'));var licenseUtil=require(_0x69e5('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x39eb8e,_0x4f2938){_0x4f2938=_0x4f2938||0xcc;return function(_0x58df25){if(_0x58df25){return _0x39eb8e['sendStatus'](_0x4f2938);}return _0x39eb8e[_0x69e5('0x1a')](_0x4f2938)[_0x69e5('0x1b')]();};}function respondWithResult(_0x1d7ef0,_0x102972){_0x102972=_0x102972||0xc8;return function(_0x27da87){if(_0x27da87){return _0x1d7ef0['status'](_0x102972)[_0x69e5('0x1c')](_0x27da87);}};}function respondWithFilteredResult(_0x372731,_0x2c29a3){return function(_0x1ca8a5){if(_0x1ca8a5){var _0x14c2e6=typeof _0x2c29a3[_0x69e5('0x1d')]===_0x69e5('0x1e')&&typeof _0x2c29a3[_0x69e5('0x1f')]===_0x69e5('0x1e');var _0x44ada5=_0x1ca8a5['count'];var _0x21cd52=_0x14c2e6?0x0:_0x2c29a3[_0x69e5('0x1d')];var _0x4a9ecb=_0x14c2e6?_0x1ca8a5[_0x69e5('0x20')]:_0x2c29a3[_0x69e5('0x1d')]+_0x2c29a3[_0x69e5('0x1f')];var _0x1acfd8;if(_0x4a9ecb>=_0x44ada5){_0x4a9ecb=_0x44ada5;_0x1acfd8=0xc8;}else{_0x1acfd8=0xce;}_0x372731['status'](_0x1acfd8);return _0x372731[_0x69e5('0x21')](_0x69e5('0x22'),_0x21cd52+'-'+_0x4a9ecb+'/'+_0x44ada5)['json'](_0x1ca8a5);}return null;};}function patchUpdates(_0x58c22d){return function(_0x97b10d){try{jsonpatch[_0x69e5('0x23')](_0x97b10d,_0x58c22d,!![]);}catch(_0x3be981){return BPromise[_0x69e5('0x24')](_0x3be981);}return _0x97b10d['save']();};}function saveUpdates(_0x5466af,_0x3ee6d0){return function(_0x2ff7d8){if(_0x2ff7d8){return _0x2ff7d8[_0x69e5('0x25')](_0x5466af)['then'](function(_0x2441bd){return _0x2441bd;});}return null;};}function removeEntity(_0x581361,_0x5614ff){return function(_0x381795){if(_0x381795){return _0x381795[_0x69e5('0x26')]()['then'](function(){var _0x13b746=_0x381795[_0x69e5('0x27')]({'plain':!![]});var _0x31802e=_0x69e5('0x28');return db[_0x69e5('0x29')]['destroy']({'where':{'type':_0x31802e,'resourceId':_0x13b746['id']}})[_0x69e5('0x2a')](function(){return _0x381795;});})['then'](function(){_0x581361[_0x69e5('0x1a')](0xcc)[_0x69e5('0x1b')]();});}};}function handleEntityNotFound(_0xa720ad,_0x83f558){return function(_0x132e80){if(!_0x132e80){_0xa720ad[_0x69e5('0x2b')](0x194);}return _0x132e80;};}function handleError(_0x2ec431,_0x397912){_0x397912=_0x397912||0x1f4;return function(_0x3f1e87){logger[_0x69e5('0x2c')](_0x3f1e87['stack']);if(_0x3f1e87['name']){delete _0x3f1e87[_0x69e5('0x2d')];}_0x2ec431[_0x69e5('0x1a')](_0x397912)[_0x69e5('0x2e')](_0x3f1e87);};}exports[_0x69e5('0x2f')]=function(_0x55901e,_0x45a47b){var _0x18ac38={},_0x54a273={},_0x4d6697={'count':0x0,'rows':[]};var _0x5b68bd=_[_0x69e5('0x30')](db[_0x69e5('0x31')][_0x69e5('0x32')],function(_0x4cf396){return{'name':_0x4cf396['fieldName'],'type':_0x4cf396[_0x69e5('0x33')][_0x69e5('0x34')]};});_0x54a273[_0x69e5('0x35')]=_['map'](_0x5b68bd,_0x69e5('0x2d'));_0x54a273[_0x69e5('0x36')]=_['keys'](_0x55901e[_0x69e5('0x36')]);_0x54a273['filters']=_[_0x69e5('0x37')](_0x54a273['model'],_0x54a273[_0x69e5('0x36')]);_0x18ac38[_0x69e5('0x38')]=_[_0x69e5('0x37')](_0x54a273[_0x69e5('0x35')],qs[_0x69e5('0x39')](_0x55901e['query'][_0x69e5('0x39')]));_0x18ac38[_0x69e5('0x38')]=_0x18ac38[_0x69e5('0x38')][_0x69e5('0x3a')]?_0x18ac38[_0x69e5('0x38')]:_0x54a273[_0x69e5('0x35')];if(!_0x55901e[_0x69e5('0x36')][_0x69e5('0x3b')]('nolimit')){_0x18ac38['limit']=qs[_0x69e5('0x1f')](_0x55901e['query'][_0x69e5('0x1f')]);_0x18ac38['offset']=qs[_0x69e5('0x1d')](_0x55901e[_0x69e5('0x36')][_0x69e5('0x1d')]);}_0x18ac38[_0x69e5('0x3c')]=qs['sort'](_0x55901e[_0x69e5('0x36')][_0x69e5('0x3d')]);_0x18ac38[_0x69e5('0x3e')]=qs[_0x69e5('0x3f')](_[_0x69e5('0x40')](_0x55901e['query'],_0x54a273['filters']),_0x5b68bd);if(_0x55901e[_0x69e5('0x36')]['filter']){_0x18ac38[_0x69e5('0x3e')]=_[_0x69e5('0x41')](_0x18ac38[_0x69e5('0x3e')],{'$or':_[_0x69e5('0x30')](_0x5b68bd,function(_0x1a3c97){if(_0x1a3c97[_0x69e5('0x33')]!==_0x69e5('0x42')){var _0x427947={};_0x427947[_0x1a3c97[_0x69e5('0x2d')]]={'$like':'%'+_0x55901e[_0x69e5('0x36')][_0x69e5('0x43')]+'%'};return _0x427947;}})});}_0x18ac38=_[_0x69e5('0x41')]({},_0x18ac38,_0x55901e['options']);var _0x132dfa={'where':_0x18ac38[_0x69e5('0x3e')]};return db[_0x69e5('0x31')][_0x69e5('0x20')](_0x132dfa)[_0x69e5('0x2a')](function(_0x1806a9){_0x4d6697[_0x69e5('0x20')]=_0x1806a9;if(_0x55901e[_0x69e5('0x36')][_0x69e5('0x44')]){_0x18ac38[_0x69e5('0x45')]=[{'all':!![]}];}return db['Sound'][_0x69e5('0x46')](_0x18ac38);})['then'](function(_0x145e61){_0x4d6697[_0x69e5('0x47')]=_0x145e61;return _0x4d6697;})['then'](respondWithFilteredResult(_0x45a47b,_0x18ac38))['catch'](handleError(_0x45a47b,null));};exports['show']=function(_0x4a5daa,_0x57a442){var _0x22ea29={'raw':!![],'where':{'id':_0x4a5daa['params']['id']}},_0x21673b={};_0x21673b[_0x69e5('0x35')]=_[_0x69e5('0x48')](db['Sound'][_0x69e5('0x32')]);_0x21673b[_0x69e5('0x36')]=_[_0x69e5('0x48')](_0x4a5daa[_0x69e5('0x36')]);_0x21673b[_0x69e5('0x3f')]=_[_0x69e5('0x37')](_0x21673b[_0x69e5('0x35')],_0x21673b[_0x69e5('0x36')]);_0x22ea29[_0x69e5('0x38')]=_[_0x69e5('0x37')](_0x21673b[_0x69e5('0x35')],qs[_0x69e5('0x39')](_0x4a5daa[_0x69e5('0x36')][_0x69e5('0x39')]));_0x22ea29['attributes']=_0x22ea29['attributes'][_0x69e5('0x3a')]?_0x22ea29['attributes']:_0x21673b['model'];if(_0x4a5daa[_0x69e5('0x36')][_0x69e5('0x44')]){_0x22ea29['include']=[{'all':!![]}];}_0x22ea29=_[_0x69e5('0x41')]({},_0x22ea29,_0x4a5daa[_0x69e5('0x49')]);return db[_0x69e5('0x31')]['find'](_0x22ea29)[_0x69e5('0x2a')](handleEntityNotFound(_0x57a442,null))[_0x69e5('0x2a')](respondWithResult(_0x57a442,null))[_0x69e5('0x4a')](handleError(_0x57a442,null));};exports[_0x69e5('0x4b')]=function(_0x8ac400,_0x12f5ca,_0x5e86f3){return db[_0x69e5('0x31')]['find']({'where':{'id':_0x8ac400[_0x69e5('0x4c')]['id']},'attributes':[_0x69e5('0x2d'),_0x69e5('0x4d'),_0x69e5('0x4e')],'raw':!![]})[_0x69e5('0x2a')](handleEntityNotFound(_0x12f5ca,null))[_0x69e5('0x2a')](function(_0x4f53c2){if(_0x4f53c2){if(!fs[_0x69e5('0x4f')](path[_0x69e5('0x50')](config[_0x69e5('0x51')],'server/files/sounds/converted',_0x4f53c2[_0x69e5('0x4d')]+'.'+_0x4f53c2[_0x69e5('0x4e')]))){throw new db[(_0x69e5('0x52'))][(_0x69e5('0x53'))](_0x69e5('0x54'));}return _0x12f5ca[_0x69e5('0x4b')](path[_0x69e5('0x50')](config[_0x69e5('0x51')],'server/files/sounds/converted',util[_0x69e5('0x55')](_0x69e5('0x56'),_0x4f53c2[_0x69e5('0x4d')],_0x4f53c2[_0x69e5('0x4e')])),util[_0x69e5('0x55')](_0x69e5('0x56'),_0x4f53c2['name'],_0x4f53c2[_0x69e5('0x4e')]));}return null;})['catch'](handleError(_0x12f5ca,null));};exports[_0x69e5('0x57')]=function(_0x1b3c22,_0x10dd05,_0xccf53d){var _0x5dbc5f={'name':path[_0x69e5('0x58')](_0x1b3c22[_0x69e5('0x59')][_0x69e5('0x5a')],path['extname'](_0x1b3c22[_0x69e5('0x59')]['originalname'])),'save_name':path[_0x69e5('0x58')](_0x1b3c22['file'][_0x69e5('0x5b')],path[_0x69e5('0x5c')](_0x1b3c22[_0x69e5('0x59')][_0x69e5('0x5b')])),'original_format':path[_0x69e5('0x5c')](_0x1b3c22['file'][_0x69e5('0x5a')])[_0x69e5('0x5d')](0x1),'converted_format':_0x69e5('0x5e')};var _0x16721d=path[_0x69e5('0x50')](config[_0x69e5('0x51')],_0x69e5('0x5f'),_0x1b3c22[_0x69e5('0x59')]['filename']);var _0x3e696e=path['join'](config['root'],'server/files/sounds/converted',util['format']('%s.%s',path['basename'](_0x1b3c22[_0x69e5('0x59')][_0x69e5('0x5b')],path['extname'](_0x1b3c22[_0x69e5('0x59')][_0x69e5('0x5b')])),_0x5dbc5f['converted_format']));logger['info']('Sound\x20upload\x20filepath:\x20%s',_0x16721d);logger[_0x69e5('0x60')](_0x69e5('0x61'),_0x3e696e);try{fs['chmodSync'](_0x16721d,parseInt(_0x69e5('0x62'),0x8));var _0x482837=sox['transcode'](_0x16721d,_0x3e696e,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x482837['on'](_0x69e5('0x2c'),function(_0x2eaaa4){fs[_0x69e5('0x63')](_0x16721d);_0x10dd05[_0x69e5('0x1a')](0x1f4)['send'](_0x2eaaa4);});_0x482837['on']('src',function(_0x5e8dcf){_0x5dbc5f[_0x69e5('0x64')]=isNaN(_0x5e8dcf[_0x69e5('0x65')])?null:_0x5e8dcf['duration']*0x3e8;_0x5dbc5f['original_sampleCount']=isNaN(_0x5e8dcf[_0x69e5('0x66')])?null:_0x5e8dcf[_0x69e5('0x66')];_0x5dbc5f[_0x69e5('0x67')]=isNaN(_0x5e8dcf[_0x69e5('0x68')])?null:_0x5e8dcf[_0x69e5('0x68')];_0x5dbc5f[_0x69e5('0x69')]=isNaN(_0x5e8dcf[_0x69e5('0x6a')])?null:_0x5e8dcf[_0x69e5('0x6a')];_0x5dbc5f[_0x69e5('0x6b')]=isNaN(_0x5e8dcf[_0x69e5('0x6c')])?null:_0x5e8dcf[_0x69e5('0x6c')];});_0x482837['on']('dest',function(_0x48843a){_0x5dbc5f[_0x69e5('0x6d')]=isNaN(_0x48843a[_0x69e5('0x65')])?null:_0x48843a[_0x69e5('0x65')]*0x3e8;_0x5dbc5f[_0x69e5('0x6e')]=isNaN(_0x48843a[_0x69e5('0x66')])?null:_0x48843a['sampleCount'];_0x5dbc5f[_0x69e5('0x6f')]=isNaN(_0x48843a[_0x69e5('0x68')])?null:_0x48843a[_0x69e5('0x68')];_0x5dbc5f[_0x69e5('0x70')]=isNaN(_0x48843a[_0x69e5('0x6a')])?null:_0x48843a[_0x69e5('0x6a')];_0x5dbc5f[_0x69e5('0x71')]=isNaN(_0x48843a[_0x69e5('0x6c')])?null:_0x48843a['sampleRate'];});_0x482837['on'](_0x69e5('0x1b'),function(){fs[_0x69e5('0x72')](_0x3e696e,parseInt(_0x69e5('0x62'),0x8));return db[_0x69e5('0x31')]['create'](_0x5dbc5f)[_0x69e5('0x2a')](function(_0x5eb6c5){var _0x2834b8={'role':_0x1b3c22[_0x69e5('0x73')][_0x69e5('0x74')],'userProfileId':_0x1b3c22[_0x69e5('0x73')]['userProfileId']};if(!_0x2834b8)throw new Error(_0x69e5('0x75'));if(_0x2834b8[_0x69e5('0x74')]===_0x69e5('0x76')){var _0x1bd89e=_0x5eb6c5[_0x69e5('0x27')]({'plain':!![]});return db[_0x69e5('0x77')]['find']({'where':{'name':_0x69e5('0x28'),'userProfileId':_0x2834b8['userProfileId']},'raw':!![]})[_0x69e5('0x2a')](function(_0x2ae22d){if(_0x2ae22d&&_0x2ae22d[_0x69e5('0x78')]===0x0){return db[_0x69e5('0x29')]['create']({'name':_0x1bd89e['name'],'resourceId':_0x1bd89e['id'],'type':_0x2ae22d[_0x69e5('0x2d')],'sectionId':_0x2ae22d['id']},{})['then'](function(){return _0x5eb6c5;});}else{return _0x5eb6c5;}})[_0x69e5('0x4a')](function(_0x2a9b5f){logger[_0x69e5('0x2c')](_0x69e5('0x79'),_0x2a9b5f);throw _0x2a9b5f;});}return _0x5eb6c5;})['then'](respondWithResult(_0x10dd05,null))['catch'](handleError(_0x10dd05,null));});_0x482837[_0x69e5('0x7a')]();}catch(_0x132716){_0x10dd05[_0x69e5('0x1a')](0x1f4)[_0x69e5('0x2e')](_0x132716);}};exports[_0x69e5('0x25')]=function(_0xe5f2f9,_0x29d573,_0x312066){return db[_0x69e5('0x31')]['find']({'where':{'id':_0xe5f2f9[_0x69e5('0x4c')]['id']}})[_0x69e5('0x2a')](handleEntityNotFound(_0x29d573,null))['then'](saveUpdates(_[_0x69e5('0x40')](_0xe5f2f9[_0x69e5('0x73')],[_0x69e5('0x2d'),'description']),null))[_0x69e5('0x2a')](respondWithResult(_0x29d573,null))[_0x69e5('0x4a')](handleError(_0x29d573,null));};exports[_0x69e5('0x7b')]=function(_0x4d0b81,_0x1b04e9,_0x365ff8){return db['Sound'][_0x69e5('0x7c')]({'where':{'id':_0x4d0b81[_0x69e5('0x4c')]['id']}})[_0x69e5('0x2a')](function(_0x2d59fa){if(_0x2d59fa){return _0x2d59fa[_0x69e5('0x26')]();}})[_0x69e5('0x2a')](function(_0x19e467){var _0x28c81e=path[_0x69e5('0x50')](config[_0x69e5('0x51')],_0x69e5('0x5f'),util[_0x69e5('0x55')](_0x69e5('0x56'),_0x19e467[_0x69e5('0x4d')],_0x19e467[_0x69e5('0x7d')]));var _0x22d6ef=path[_0x69e5('0x50')](config[_0x69e5('0x51')],_0x69e5('0x7e'),util[_0x69e5('0x55')](_0x69e5('0x56'),_0x19e467[_0x69e5('0x4d')],_0x19e467[_0x69e5('0x4e')]));fs['unlinkSync'](_0x28c81e);fs[_0x69e5('0x63')](_0x22d6ef);return _0x19e467;})[_0x69e5('0x2a')](function(_0x37f33e){if(_0x37f33e){return _0x1b04e9[_0x69e5('0x1a')](0xcc)[_0x69e5('0x1b')]();}})['then'](handleEntityNotFound(_0x1b04e9,null))[_0x69e5('0x4a')](handleError(_0x1b04e9,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 81d42a9..02ecac1 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 _0xedb1=['../../config/environment','./sound.attributes','exports','define','tools_sounds','lodash','util','../../config/logger','api','request-promise','path','rimraf'];(function(_0x19c450,_0x5db640){var _0x571399=function(_0x3369dc){while(--_0x3369dc){_0x19c450['push'](_0x19c450['shift']());}};_0x571399(++_0x5db640);}(_0xedb1,0x1b5));var _0x1edb=function(_0x58cab6,_0x4170f7){_0x58cab6=_0x58cab6-0x0;var _0x43743b=_0xedb1[_0x58cab6];return _0x43743b;};'use strict';var _=require(_0x1edb('0x0'));var util=require(_0x1edb('0x1'));var logger=require(_0x1edb('0x2'))(_0x1edb('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1edb('0x4'));var fs=require('fs');var path=require(_0x1edb('0x5'));var rimraf=require(_0x1edb('0x6'));var config=require(_0x1edb('0x7'));var attributes=require(_0x1edb('0x8'));module[_0x1edb('0x9')]=function(_0x1e0f79,_0x1d2097){return _0x1e0f79[_0x1edb('0xa')]('Sound',attributes,{'tableName':_0x1edb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9907=['define','Sound','tools_sounds','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./sound.attributes','exports'];(function(_0x426d30,_0x58c50a){var _0x2149bc=function(_0x4e138f){while(--_0x4e138f){_0x426d30['push'](_0x426d30['shift']());}};_0x2149bc(++_0x58c50a);}(_0x9907,0xb7));var _0x7990=function(_0x28be72,_0x2b83af){_0x28be72=_0x28be72-0x0;var _0x46c5da=_0x9907[_0x28be72];return _0x46c5da;};'use strict';var _=require(_0x7990('0x0'));var util=require(_0x7990('0x1'));var logger=require(_0x7990('0x2'))(_0x7990('0x3'));var moment=require(_0x7990('0x4'));var BPromise=require(_0x7990('0x5'));var rp=require(_0x7990('0x6'));var fs=require('fs');var path=require(_0x7990('0x7'));var rimraf=require(_0x7990('0x8'));var config=require(_0x7990('0x9'));var attributes=require(_0x7990('0xa'));module[_0x7990('0xb')]=function(_0xdeb785,_0x4647a9){return _0xdeb785[_0x7990('0xc')](_0x7990('0xd'),attributes,{'tableName':_0x7990('0xe'),'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 bf405c2..7d269ca 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 _0x2c04=['../../config/logger','jayson/promise','client','http','request','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowSound','find','options','raw','where','attributes','include','map','model','then','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x4b99ed,_0x43c7f7){var _0x45f062=function(_0x59d7a6){while(--_0x59d7a6){_0x4b99ed['push'](_0x4b99ed['shift']());}};_0x45f062(++_0x43c7f7);}(_0x2c04,0x1b9));var _0x42c0=function(_0x2ea548,_0x52b514){_0x2ea548=_0x2ea548-0x0;var _0x1169da=_0x2c04[_0x2ea548];return _0x1169da;};'use strict';var _=require(_0x42c0('0x0'));var util=require(_0x42c0('0x1'));var moment=require(_0x42c0('0x2'));var BPromise=require(_0x42c0('0x3'));var rs=require(_0x42c0('0x4'));var fs=require('fs');var Redis=require(_0x42c0('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x42c0('0x6'));var logger=require(_0x42c0('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x42c0('0x8'));var client=jayson[_0x42c0('0x9')][_0x42c0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x522806,_0x122aed,_0x36ad39){return new BPromise(function(_0x195b85,_0x159a5b){return client[_0x42c0('0xb')](_0x522806,_0x36ad39)['then'](function(_0x2956a4){logger[_0x42c0('0xc')](_0x42c0('0xd'),_0x122aed,_0x42c0('0xe'));logger[_0x42c0('0xf')](_0x42c0('0x10'),_0x122aed,_0x42c0('0xe'),JSON[_0x42c0('0x11')](_0x2956a4));if(_0x2956a4['error']){if(_0x2956a4[_0x42c0('0x12')]['code']===0x1f4){logger[_0x42c0('0x12')]('Sound,\x20%s,\x20%s',_0x122aed,_0x2956a4[_0x42c0('0x12')]['message']);return _0x159a5b(_0x2956a4[_0x42c0('0x12')][_0x42c0('0x13')]);}logger[_0x42c0('0x12')](_0x42c0('0xd'),_0x122aed,_0x2956a4[_0x42c0('0x12')][_0x42c0('0x13')]);return _0x195b85(_0x2956a4[_0x42c0('0x12')][_0x42c0('0x13')]);}else{logger[_0x42c0('0xc')](_0x42c0('0xd'),_0x122aed,_0x42c0('0xe'));_0x195b85(_0x2956a4[_0x42c0('0x14')][_0x42c0('0x13')]);}})[_0x42c0('0x15')](function(_0x5547ff){logger[_0x42c0('0x12')](_0x42c0('0xd'),_0x122aed,_0x5547ff);_0x159a5b(_0x5547ff);});});}exports[_0x42c0('0x16')]=function(_0x54a4fa){var _0x144a48=this;return new Promise(function(_0x4969ab,_0x2841d2){return db['Sound'][_0x42c0('0x17')]({'raw':_0x54a4fa[_0x42c0('0x18')]?_0x54a4fa[_0x42c0('0x18')][_0x42c0('0x19')]===undefined?!![]:![]:!![],'where':_0x54a4fa[_0x42c0('0x18')]?_0x54a4fa['options'][_0x42c0('0x1a')]||null:null,'attributes':_0x54a4fa[_0x42c0('0x18')]?_0x54a4fa[_0x42c0('0x18')][_0x42c0('0x1b')]||null:null,'include':_0x54a4fa[_0x42c0('0x18')]?_0x54a4fa[_0x42c0('0x18')][_0x42c0('0x1c')]?_[_0x42c0('0x1d')](_0x54a4fa[_0x42c0('0x18')][_0x42c0('0x1c')],function(_0x29e2d2){return{'model':db[_0x29e2d2[_0x42c0('0x1e')]],'as':_0x29e2d2['as'],'attributes':_0x29e2d2['attributes'],'include':_0x29e2d2[_0x42c0('0x1c')]?_['map'](_0x29e2d2[_0x42c0('0x1c')],function(_0x320953){return{'model':db[_0x320953[_0x42c0('0x1e')]],'as':_0x320953['as'],'attributes':_0x320953['attributes'],'include':_0x320953['include']?_[_0x42c0('0x1d')](_0x320953['include'],function(_0x490219){return{'model':db[_0x490219['model']],'as':_0x490219['as'],'attributes':_0x490219[_0x42c0('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x42c0('0x1f')](function(_0x580745){logger['info'](_0x42c0('0x16'),_0x54a4fa);logger[_0x42c0('0xf')](_0x42c0('0x16'),_0x54a4fa,JSON['stringify'](_0x580745));_0x4969ab(_0x580745);})['catch'](function(_0x528638){logger['error'](_0x42c0('0x16'),_0x528638[_0x42c0('0x13')],_0x54a4fa);_0x2841d2(_0x144a48[_0x42c0('0x12')](0x1f4,_0x528638[_0x42c0('0x13')]));});});}; \ No newline at end of file +var _0x40bd=['bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Sound,\x20%s,\x20%s','debug','Sound,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','result','catch','ShowSound','Sound','find','options','raw','where','attributes','include','map','model','stringify','lodash','moment'];(function(_0x5b273c,_0x19c727){var _0x114b60=function(_0x130180){while(--_0x130180){_0x5b273c['push'](_0x5b273c['shift']());}};_0x114b60(++_0x19c727);}(_0x40bd,0x106));var _0xd40b=function(_0x55758c,_0x1f0a26){_0x55758c=_0x55758c-0x0;var _0x31cf0c=_0x40bd[_0x55758c];return _0x31cf0c;};'use strict';var _=require(_0xd40b('0x0'));var util=require('util');var moment=require(_0xd40b('0x1'));var BPromise=require(_0xd40b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd40b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd40b('0x4'));var logger=require(_0xd40b('0x5'))(_0xd40b('0x6'));var config=require(_0xd40b('0x7'));var jayson=require(_0xd40b('0x8'));var client=jayson[_0xd40b('0x9')][_0xd40b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5b808a,_0x42cb1c,_0x4e7886){return new BPromise(function(_0x313edf,_0x57c628){return client[_0xd40b('0xb')](_0x5b808a,_0x4e7886)[_0xd40b('0xc')](function(_0x40eefd){logger[_0xd40b('0xd')](_0xd40b('0xe'),_0x42cb1c,'request\x20sent');logger[_0xd40b('0xf')](_0xd40b('0x10'),_0x42cb1c,'request\x20sent',JSON['stringify'](_0x40eefd));if(_0x40eefd[_0xd40b('0x11')]){if(_0x40eefd['error']['code']===0x1f4){logger['error'](_0xd40b('0xe'),_0x42cb1c,_0x40eefd[_0xd40b('0x11')]['message']);return _0x57c628(_0x40eefd[_0xd40b('0x11')]['message']);}logger[_0xd40b('0x11')](_0xd40b('0xe'),_0x42cb1c,_0x40eefd[_0xd40b('0x11')][_0xd40b('0x12')]);return _0x313edf(_0x40eefd[_0xd40b('0x11')][_0xd40b('0x12')]);}else{logger[_0xd40b('0xd')](_0xd40b('0xe'),_0x42cb1c,_0xd40b('0x13'));_0x313edf(_0x40eefd[_0xd40b('0x14')][_0xd40b('0x12')]);}})[_0xd40b('0x15')](function(_0x339393){logger[_0xd40b('0x11')](_0xd40b('0xe'),_0x42cb1c,_0x339393);_0x57c628(_0x339393);});});}exports[_0xd40b('0x16')]=function(_0x4880a1){var _0x195a57=this;return new Promise(function(_0x3b9a6c,_0x22c1a3){return db[_0xd40b('0x17')][_0xd40b('0x18')]({'raw':_0x4880a1[_0xd40b('0x19')]?_0x4880a1[_0xd40b('0x19')][_0xd40b('0x1a')]===undefined?!![]:![]:!![],'where':_0x4880a1[_0xd40b('0x19')]?_0x4880a1[_0xd40b('0x19')][_0xd40b('0x1b')]||null:null,'attributes':_0x4880a1[_0xd40b('0x19')]?_0x4880a1[_0xd40b('0x19')][_0xd40b('0x1c')]||null:null,'include':_0x4880a1[_0xd40b('0x19')]?_0x4880a1[_0xd40b('0x19')][_0xd40b('0x1d')]?_[_0xd40b('0x1e')](_0x4880a1[_0xd40b('0x19')][_0xd40b('0x1d')],function(_0x19e596){return{'model':db[_0x19e596[_0xd40b('0x1f')]],'as':_0x19e596['as'],'attributes':_0x19e596[_0xd40b('0x1c')],'include':_0x19e596[_0xd40b('0x1d')]?_[_0xd40b('0x1e')](_0x19e596[_0xd40b('0x1d')],function(_0x138c27){return{'model':db[_0x138c27['model']],'as':_0x138c27['as'],'attributes':_0x138c27[_0xd40b('0x1c')],'include':_0x138c27[_0xd40b('0x1d')]?_[_0xd40b('0x1e')](_0x138c27[_0xd40b('0x1d')],function(_0x6d6d5b){return{'model':db[_0x6d6d5b['model']],'as':_0x6d6d5b['as'],'attributes':_0x6d6d5b[_0xd40b('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x17dc76){logger['info'](_0xd40b('0x16'),_0x4880a1);logger['debug']('ShowSound',_0x4880a1,JSON[_0xd40b('0x20')](_0x17dc76));_0x3b9a6c(_0x17dc76);})[_0xd40b('0x15')](function(_0x2083cf){logger[_0xd40b('0x11')](_0xd40b('0x16'),_0x2083cf[_0xd40b('0x12')],_0x4880a1);_0x22c1a3(_0x195a57[_0xd40b('0x11')](0x1f4,_0x2083cf[_0xd40b('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index a98c709..1437c81 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(_0x378aca,_0x13e103){var _0x1b7b4b=function(_0xed42d6){while(--_0xed42d6){_0x378aca['push'](_0x378aca['shift']());}};_0x1b7b4b(++_0x13e103);}(_0xda3f,0xec));var _0xfda3=function(_0x58cf51,_0x412930){_0x58cf51=_0x58cf51-0x0;var _0x516ddc=_0xda3f[_0x58cf51];return _0x516ddc;};'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 _0xda3f=['../../config/environment','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','util','path','fs-extra','../../components/interaction/service'];(function(_0xa1b0d4,_0xbeba0){var _0x19f06c=function(_0x172a9a){while(--_0x172a9a){_0xa1b0d4['push'](_0xa1b0d4['shift']());}};_0x19f06c(++_0xbeba0);}(_0xda3f,0xec));var _0xfda3=function(_0x5adbe0,_0x132de1){_0x5adbe0=_0x5adbe0-0x0;var _0x5ad93a=_0xda3f[_0x5adbe0];return _0x5ad93a;};'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 diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index c17d8c3..b2d89da 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 _0x53ab=['exports','STRING','medium','ENUM','out','TEXT'];(function(_0x318410,_0x451962){var _0x2898a3=function(_0x58e572){while(--_0x58e572){_0x318410['push'](_0x318410['shift']());}};_0x2898a3(++_0x451962);}(_0x53ab,0x13e));var _0xb53a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x53ab[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xb53a('0x0')]={'uniqueid':{'type':Sequelize[_0xb53a('0x1')]},'body':{'type':Sequelize['TEXT'](_0xb53a('0x2')),'allowNull':![]},'direction':{'type':Sequelize[_0xb53a('0x3')]('in',_0xb53a('0x4')),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize[_0xb53a('0x1')]},'providerResponse':{'type':Sequelize[_0xb53a('0x5')]}}; \ No newline at end of file +var _0xd4af=['STRING','TEXT','medium','ENUM','out','sequelize','exports'];(function(_0x48a8d4,_0x3f35bd){var _0x277106=function(_0x5b44ab){while(--_0x5b44ab){_0x48a8d4['push'](_0x48a8d4['shift']());}};_0x277106(++_0x3f35bd);}(_0xd4af,0x116));var _0xfd4a=function(_0x4a5eca,_0x5deb23){_0x4a5eca=_0x4a5eca-0x0;var _0x52b01b=_0xd4af[_0x4a5eca];return _0x52b01b;};'use strict';var Sequelize=require(_0xfd4a('0x0'));module[_0xfd4a('0x1')]={'uniqueid':{'type':Sequelize[_0xfd4a('0x2')]},'body':{'type':Sequelize[_0xfd4a('0x3')](_0xfd4a('0x4')),'allowNull':![]},'direction':{'type':Sequelize[_0xfd4a('0x5')]('in',_0xfd4a('0x6')),'defaultValue':_0xfd4a('0x6'),'allowNull':![]},'providerName':{'type':Sequelize[_0xfd4a('0x2')]},'providerResponse':{'type':Sequelize[_0xfd4a('0x3')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 19344c5..6314bcd 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 _0xb36b=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','options','SquareMessage','includeAll','findAll','rows','show','params','keys','include','find','catch','create','body','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','stack','name','index','rawAttributes','fieldName','type','key','map','query','intersection','model'];(function(_0x5831bc,_0x367e2c){var _0x8a0f61=function(_0x2136d5){while(--_0x2136d5){_0x5831bc['push'](_0x5831bc['shift']());}};_0x8a0f61(++_0x367e2c);}(_0xb36b,0xac));var _0xbb36=function(_0x25aaf8,_0x350d25){_0x25aaf8=_0x25aaf8-0x0;var _0x1f1bed=_0xb36b[_0x25aaf8];return _0x1f1bed;};'use strict';var emlformat=require(_0xbb36('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb36('0x1'));var jsonpatch=require(_0xbb36('0x2'));var rp=require(_0xbb36('0x3'));var moment=require(_0xbb36('0x4'));var BPromise=require(_0xbb36('0x5'));var Mustache=require('mustache');var util=require(_0xbb36('0x6'));var path=require(_0xbb36('0x7'));var sox=require(_0xbb36('0x8'));var csv=require(_0xbb36('0x9'));var ejs=require(_0xbb36('0xa'));var fs=require('fs');var fs_extra=require(_0xbb36('0xb'));var _=require(_0xbb36('0xc'));var squel=require(_0xbb36('0xd'));var crypto=require(_0xbb36('0xe'));var jsforce=require(_0xbb36('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbb36('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xbb36('0x11'));var qs=require(_0xbb36('0x12'));var as=require(_0xbb36('0x13'));var hardwareService=require(_0xbb36('0x14'));var logger=require(_0xbb36('0x15'))('api');var utils=require(_0xbb36('0x16'));var config=require(_0xbb36('0x17'));var licenseUtil=require(_0xbb36('0x18'));var db=require(_0xbb36('0x19'))['db'];function respondWithStatusCode(_0x55d7ba,_0x248529){_0x248529=_0x248529||0xcc;return function(_0x119403){if(_0x119403){return _0x55d7ba[_0xbb36('0x1a')](_0x248529);}return _0x55d7ba[_0xbb36('0x1b')](_0x248529)[_0xbb36('0x1c')]();};}function respondWithResult(_0x326c44,_0x3e8ceb){_0x3e8ceb=_0x3e8ceb||0xc8;return function(_0x8811d8){if(_0x8811d8){return _0x326c44[_0xbb36('0x1b')](_0x3e8ceb)[_0xbb36('0x1d')](_0x8811d8);}};}function respondWithFilteredResult(_0x8325a8,_0x4d022e){return function(_0x595c49){if(_0x595c49){var _0x3c5820=typeof _0x4d022e[_0xbb36('0x1e')]===_0xbb36('0x1f')&&typeof _0x4d022e[_0xbb36('0x20')]===_0xbb36('0x1f');var _0x18af40=_0x595c49[_0xbb36('0x21')];var _0x15c49a=_0x3c5820?0x0:_0x4d022e[_0xbb36('0x1e')];var _0x519a97=_0x3c5820?_0x595c49['count']:_0x4d022e[_0xbb36('0x1e')]+_0x4d022e[_0xbb36('0x20')];var _0x156918;if(_0x519a97>=_0x18af40){_0x519a97=_0x18af40;_0x156918=0xc8;}else{_0x156918=0xce;}_0x8325a8[_0xbb36('0x1b')](_0x156918);return _0x8325a8[_0xbb36('0x22')](_0xbb36('0x23'),_0x15c49a+'-'+_0x519a97+'/'+_0x18af40)[_0xbb36('0x1d')](_0x595c49);}return null;};}function patchUpdates(_0x22d35e){return function(_0x19a820){try{jsonpatch['apply'](_0x19a820,_0x22d35e,!![]);}catch(_0x617822){return BPromise[_0xbb36('0x24')](_0x617822);}return _0x19a820['save']();};}function saveUpdates(_0x2c92d2,_0x3b7358){return function(_0x1571f1){if(_0x1571f1){return _0x1571f1[_0xbb36('0x25')](_0x2c92d2)[_0xbb36('0x26')](function(_0x1e688b){return _0x1e688b;});}return null;};}function removeEntity(_0x5033e5,_0x523db7){return function(_0x42fd9c){if(_0x42fd9c){return _0x42fd9c['destroy']()[_0xbb36('0x26')](function(){_0x5033e5[_0xbb36('0x1b')](0xcc)[_0xbb36('0x1c')]();});}};}function handleEntityNotFound(_0xc1239,_0x218c99){return function(_0x537b24){if(!_0x537b24){_0xc1239[_0xbb36('0x1a')](0x194);}return _0x537b24;};}function handleError(_0x34c51e,_0x49b825){_0x49b825=_0x49b825||0x1f4;return function(_0x105e1d){logger['error'](_0x105e1d[_0xbb36('0x27')]);if(_0x105e1d[_0xbb36('0x28')]){delete _0x105e1d['name'];}_0x34c51e[_0xbb36('0x1b')](_0x49b825)['send'](_0x105e1d);};}exports[_0xbb36('0x29')]=function(_0x7c9948,_0x4b5f9c){var _0x4a3b55={},_0x1f6059={},_0x4e417a={'count':0x0,'rows':[]};var _0x24f231=_['map'](db['SquareMessage'][_0xbb36('0x2a')],function(_0x3df68e){return{'name':_0x3df68e[_0xbb36('0x2b')],'type':_0x3df68e[_0xbb36('0x2c')][_0xbb36('0x2d')]};});_0x1f6059['model']=_[_0xbb36('0x2e')](_0x24f231,'name');_0x1f6059[_0xbb36('0x2f')]=_['keys'](_0x7c9948[_0xbb36('0x2f')]);_0x1f6059['filters']=_[_0xbb36('0x30')](_0x1f6059[_0xbb36('0x31')],_0x1f6059[_0xbb36('0x2f')]);_0x4a3b55[_0xbb36('0x32')]=_[_0xbb36('0x30')](_0x1f6059[_0xbb36('0x31')],qs[_0xbb36('0x33')](_0x7c9948['query'][_0xbb36('0x33')]));_0x4a3b55['attributes']=_0x4a3b55[_0xbb36('0x32')][_0xbb36('0x34')]?_0x4a3b55['attributes']:_0x1f6059['model'];if(!_0x7c9948[_0xbb36('0x2f')][_0xbb36('0x35')](_0xbb36('0x36'))){_0x4a3b55[_0xbb36('0x20')]=qs[_0xbb36('0x20')](_0x7c9948['query'][_0xbb36('0x20')]);_0x4a3b55[_0xbb36('0x1e')]=qs[_0xbb36('0x1e')](_0x7c9948[_0xbb36('0x2f')]['offset']);}_0x4a3b55[_0xbb36('0x37')]=qs[_0xbb36('0x38')](_0x7c9948[_0xbb36('0x2f')]['sort']);_0x4a3b55[_0xbb36('0x39')]=qs[_0xbb36('0x3a')](_['pick'](_0x7c9948['query'],_0x1f6059[_0xbb36('0x3a')]),_0x24f231);if(_0x7c9948[_0xbb36('0x2f')]['filter']){_0x4a3b55['where']=_['merge'](_0x4a3b55['where'],{'$or':_[_0xbb36('0x2e')](_0x24f231,function(_0x43c926){if(_0x43c926['type']!=='VIRTUAL'){var _0x23cb6e={};_0x23cb6e[_0x43c926['name']]={'$like':'%'+_0x7c9948[_0xbb36('0x2f')]['filter']+'%'};return _0x23cb6e;}})});}_0x4a3b55=_[_0xbb36('0x3b')]({},_0x4a3b55,_0x7c9948[_0xbb36('0x3c')]);var _0x4f6709={'where':_0x4a3b55[_0xbb36('0x39')]};return db[_0xbb36('0x3d')]['count'](_0x4f6709)[_0xbb36('0x26')](function(_0x20c1d1){_0x4e417a[_0xbb36('0x21')]=_0x20c1d1;if(_0x7c9948['query'][_0xbb36('0x3e')]){_0x4a3b55['include']=[{'all':!![]}];}return db[_0xbb36('0x3d')][_0xbb36('0x3f')](_0x4a3b55);})[_0xbb36('0x26')](function(_0x4b4ea8){_0x4e417a[_0xbb36('0x40')]=_0x4b4ea8;return _0x4e417a;})['then'](respondWithFilteredResult(_0x4b5f9c,_0x4a3b55))['catch'](handleError(_0x4b5f9c,null));};exports[_0xbb36('0x41')]=function(_0x5622c8,_0x4433dc){var _0xbadba5={'raw':!![],'where':{'id':_0x5622c8[_0xbb36('0x42')]['id']}},_0x446b7d={};_0x446b7d['model']=_[_0xbb36('0x43')](db[_0xbb36('0x3d')]['rawAttributes']);_0x446b7d[_0xbb36('0x2f')]=_['keys'](_0x5622c8[_0xbb36('0x2f')]);_0x446b7d[_0xbb36('0x3a')]=_[_0xbb36('0x30')](_0x446b7d[_0xbb36('0x31')],_0x446b7d[_0xbb36('0x2f')]);_0xbadba5[_0xbb36('0x32')]=_[_0xbb36('0x30')](_0x446b7d['model'],qs[_0xbb36('0x33')](_0x5622c8[_0xbb36('0x2f')]['fields']));_0xbadba5[_0xbb36('0x32')]=_0xbadba5[_0xbb36('0x32')][_0xbb36('0x34')]?_0xbadba5[_0xbb36('0x32')]:_0x446b7d[_0xbb36('0x31')];if(_0x5622c8[_0xbb36('0x2f')][_0xbb36('0x3e')]){_0xbadba5[_0xbb36('0x44')]=[{'all':!![]}];}_0xbadba5=_['merge']({},_0xbadba5,_0x5622c8[_0xbb36('0x3c')]);return db[_0xbb36('0x3d')][_0xbb36('0x45')](_0xbadba5)[_0xbb36('0x26')](handleEntityNotFound(_0x4433dc,null))[_0xbb36('0x26')](respondWithResult(_0x4433dc,null))[_0xbb36('0x46')](handleError(_0x4433dc,null));};exports['create']=function(_0x4b5d9f,_0x3d7134){return db[_0xbb36('0x3d')][_0xbb36('0x47')](_0x4b5d9f['body'],{})[_0xbb36('0x26')](respondWithResult(_0x3d7134,0xc9))[_0xbb36('0x46')](handleError(_0x3d7134,null));};exports[_0xbb36('0x25')]=function(_0x422c4e,_0x4e62b3){if(_0x422c4e['body']['id']){delete _0x422c4e[_0xbb36('0x48')]['id'];}return db['SquareMessage']['find']({'where':{'id':_0x422c4e['params']['id']}})[_0xbb36('0x26')](handleEntityNotFound(_0x4e62b3,null))[_0xbb36('0x26')](saveUpdates(_0x422c4e[_0xbb36('0x48')],null))[_0xbb36('0x26')](respondWithResult(_0x4e62b3,null))['catch'](handleError(_0x4e62b3,null));};exports[_0xbb36('0x49')]=function(_0x56c6cf,_0x534ca4){return db['SquareMessage'][_0xbb36('0x45')]({'where':{'id':_0x56c6cf[_0xbb36('0x42')]['id']}})[_0xbb36('0x26')](handleEntityNotFound(_0x534ca4,null))[_0xbb36('0x26')](removeEntity(_0x534ca4,null))[_0xbb36('0x46')](handleError(_0x534ca4,null));}; \ No newline at end of file +var _0x566f=['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','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SquareMessage','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','options','include','findAll','catch','show','params','rawAttributes','includeAll','merge','find','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce'];(function(_0x5bcb82,_0x29f743){var _0x50ed50=function(_0x5e764a){while(--_0x5e764a){_0x5bcb82['push'](_0x5bcb82['shift']());}};_0x50ed50(++_0x29f743);}(_0x566f,0x124));var _0xf566=function(_0x2803af,_0x2bb475){_0x2803af=_0x2803af-0x0;var _0x5cd13a=_0x566f[_0x2803af];return _0x5cd13a;};'use strict';var emlformat=require(_0xf566('0x0'));var rimraf=require(_0xf566('0x1'));var zipdir=require(_0xf566('0x2'));var jsonpatch=require(_0xf566('0x3'));var rp=require(_0xf566('0x4'));var moment=require(_0xf566('0x5'));var BPromise=require(_0xf566('0x6'));var Mustache=require(_0xf566('0x7'));var util=require('util');var path=require(_0xf566('0x8'));var sox=require(_0xf566('0x9'));var csv=require(_0xf566('0xa'));var ejs=require(_0xf566('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf566('0xc'));var squel=require(_0xf566('0xd'));var crypto=require(_0xf566('0xe'));var jsforce=require(_0xf566('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xf566('0xa'));var querystring=require('querystring');var Papa=require(_0xf566('0x10'));var Redis=require(_0xf566('0x11'));var authService=require(_0xf566('0x12'));var qs=require(_0xf566('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf566('0x14'));var logger=require(_0xf566('0x15'))(_0xf566('0x16'));var utils=require(_0xf566('0x17'));var config=require(_0xf566('0x18'));var licenseUtil=require(_0xf566('0x19'));var db=require(_0xf566('0x1a'))['db'];function respondWithStatusCode(_0x3f15a6,_0x5d6937){_0x5d6937=_0x5d6937||0xcc;return function(_0x1c1e09){if(_0x1c1e09){return _0x3f15a6[_0xf566('0x1b')](_0x5d6937);}return _0x3f15a6[_0xf566('0x1c')](_0x5d6937)[_0xf566('0x1d')]();};}function respondWithResult(_0x5acc16,_0x3ed87f){_0x3ed87f=_0x3ed87f||0xc8;return function(_0x591484){if(_0x591484){return _0x5acc16['status'](_0x3ed87f)[_0xf566('0x1e')](_0x591484);}};}function respondWithFilteredResult(_0x300133,_0x515128){return function(_0xc3f761){if(_0xc3f761){var _0x312f10=typeof _0x515128['offset']===_0xf566('0x1f')&&typeof _0x515128['limit']===_0xf566('0x1f');var _0x552275=_0xc3f761[_0xf566('0x20')];var _0xfb589a=_0x312f10?0x0:_0x515128['offset'];var _0x40a94b=_0x312f10?_0xc3f761[_0xf566('0x20')]:_0x515128[_0xf566('0x21')]+_0x515128[_0xf566('0x22')];var _0x53351c;if(_0x40a94b>=_0x552275){_0x40a94b=_0x552275;_0x53351c=0xc8;}else{_0x53351c=0xce;}_0x300133[_0xf566('0x1c')](_0x53351c);return _0x300133[_0xf566('0x23')](_0xf566('0x24'),_0xfb589a+'-'+_0x40a94b+'/'+_0x552275)['json'](_0xc3f761);}return null;};}function patchUpdates(_0x304f41){return function(_0x3fb236){try{jsonpatch[_0xf566('0x25')](_0x3fb236,_0x304f41,!![]);}catch(_0x17fc3b){return BPromise[_0xf566('0x26')](_0x17fc3b);}return _0x3fb236[_0xf566('0x27')]();};}function saveUpdates(_0x2ff105,_0x1cd9d3){return function(_0x2c216f){if(_0x2c216f){return _0x2c216f[_0xf566('0x28')](_0x2ff105)[_0xf566('0x29')](function(_0x4f2a3d){return _0x4f2a3d;});}return null;};}function removeEntity(_0x17e57b,_0x3ae555){return function(_0x54a2c8){if(_0x54a2c8){return _0x54a2c8[_0xf566('0x2a')]()[_0xf566('0x29')](function(){_0x17e57b[_0xf566('0x1c')](0xcc)[_0xf566('0x1d')]();});}};}function handleEntityNotFound(_0x100ad3,_0x11e997){return function(_0x2da964){if(!_0x2da964){_0x100ad3['sendStatus'](0x194);}return _0x2da964;};}function handleError(_0x5a4e95,_0xde2d8c){_0xde2d8c=_0xde2d8c||0x1f4;return function(_0x368fa0){logger[_0xf566('0x2b')](_0x368fa0[_0xf566('0x2c')]);if(_0x368fa0[_0xf566('0x2d')]){delete _0x368fa0[_0xf566('0x2d')];}_0x5a4e95['status'](_0xde2d8c)[_0xf566('0x2e')](_0x368fa0);};}exports[_0xf566('0x2f')]=function(_0x356acf,_0x47b559){var _0x431ebc={},_0xccbd29={},_0x4ee4b5={'count':0x0,'rows':[]};var _0x440308=_[_0xf566('0x30')](db[_0xf566('0x31')]['rawAttributes'],function(_0x44fbcc){return{'name':_0x44fbcc[_0xf566('0x32')],'type':_0x44fbcc[_0xf566('0x33')]['key']};});_0xccbd29[_0xf566('0x34')]=_[_0xf566('0x30')](_0x440308,'name');_0xccbd29['query']=_[_0xf566('0x35')](_0x356acf[_0xf566('0x36')]);_0xccbd29[_0xf566('0x37')]=_[_0xf566('0x38')](_0xccbd29[_0xf566('0x34')],_0xccbd29[_0xf566('0x36')]);_0x431ebc[_0xf566('0x39')]=_[_0xf566('0x38')](_0xccbd29[_0xf566('0x34')],qs[_0xf566('0x3a')](_0x356acf['query'][_0xf566('0x3a')]));_0x431ebc['attributes']=_0x431ebc[_0xf566('0x39')][_0xf566('0x3b')]?_0x431ebc[_0xf566('0x39')]:_0xccbd29[_0xf566('0x34')];if(!_0x356acf[_0xf566('0x36')][_0xf566('0x3c')](_0xf566('0x3d'))){_0x431ebc[_0xf566('0x22')]=qs[_0xf566('0x22')](_0x356acf[_0xf566('0x36')][_0xf566('0x22')]);_0x431ebc[_0xf566('0x21')]=qs[_0xf566('0x21')](_0x356acf[_0xf566('0x36')][_0xf566('0x21')]);}_0x431ebc[_0xf566('0x3e')]=qs[_0xf566('0x3f')](_0x356acf[_0xf566('0x36')][_0xf566('0x3f')]);_0x431ebc[_0xf566('0x40')]=qs[_0xf566('0x37')](_[_0xf566('0x41')](_0x356acf[_0xf566('0x36')],_0xccbd29['filters']),_0x440308);if(_0x356acf[_0xf566('0x36')]['filter']){_0x431ebc['where']=_['merge'](_0x431ebc[_0xf566('0x40')],{'$or':_['map'](_0x440308,function(_0x539967){if(_0x539967[_0xf566('0x33')]!=='VIRTUAL'){var _0x139cd0={};_0x139cd0[_0x539967['name']]={'$like':'%'+_0x356acf[_0xf566('0x36')]['filter']+'%'};return _0x139cd0;}})});}_0x431ebc=_['merge']({},_0x431ebc,_0x356acf[_0xf566('0x42')]);var _0x36c294={'where':_0x431ebc[_0xf566('0x40')]};return db['SquareMessage'][_0xf566('0x20')](_0x36c294)['then'](function(_0x588e25){_0x4ee4b5[_0xf566('0x20')]=_0x588e25;if(_0x356acf[_0xf566('0x36')]['includeAll']){_0x431ebc[_0xf566('0x43')]=[{'all':!![]}];}return db[_0xf566('0x31')][_0xf566('0x44')](_0x431ebc);})[_0xf566('0x29')](function(_0x19fb20){_0x4ee4b5['rows']=_0x19fb20;return _0x4ee4b5;})['then'](respondWithFilteredResult(_0x47b559,_0x431ebc))[_0xf566('0x45')](handleError(_0x47b559,null));};exports[_0xf566('0x46')]=function(_0x3caabe,_0x22de73){var _0x52f18f={'raw':!![],'where':{'id':_0x3caabe[_0xf566('0x47')]['id']}},_0x2c1930={};_0x2c1930[_0xf566('0x34')]=_[_0xf566('0x35')](db[_0xf566('0x31')][_0xf566('0x48')]);_0x2c1930['query']=_[_0xf566('0x35')](_0x3caabe[_0xf566('0x36')]);_0x2c1930['filters']=_['intersection'](_0x2c1930['model'],_0x2c1930[_0xf566('0x36')]);_0x52f18f[_0xf566('0x39')]=_[_0xf566('0x38')](_0x2c1930[_0xf566('0x34')],qs[_0xf566('0x3a')](_0x3caabe[_0xf566('0x36')]['fields']));_0x52f18f[_0xf566('0x39')]=_0x52f18f['attributes'][_0xf566('0x3b')]?_0x52f18f['attributes']:_0x2c1930[_0xf566('0x34')];if(_0x3caabe[_0xf566('0x36')][_0xf566('0x49')]){_0x52f18f['include']=[{'all':!![]}];}_0x52f18f=_[_0xf566('0x4a')]({},_0x52f18f,_0x3caabe[_0xf566('0x42')]);return db['SquareMessage'][_0xf566('0x4b')](_0x52f18f)[_0xf566('0x29')](handleEntityNotFound(_0x22de73,null))[_0xf566('0x29')](respondWithResult(_0x22de73,null))['catch'](handleError(_0x22de73,null));};exports['create']=function(_0x331c51,_0x5ca9ab){return db[_0xf566('0x31')]['create'](_0x331c51[_0xf566('0x4c')],{})[_0xf566('0x29')](respondWithResult(_0x5ca9ab,0xc9))['catch'](handleError(_0x5ca9ab,null));};exports[_0xf566('0x28')]=function(_0x4aa16f,_0x93730e){if(_0x4aa16f[_0xf566('0x4c')]['id']){delete _0x4aa16f[_0xf566('0x4c')]['id'];}return db[_0xf566('0x31')]['find']({'where':{'id':_0x4aa16f[_0xf566('0x47')]['id']}})[_0xf566('0x29')](handleEntityNotFound(_0x93730e,null))[_0xf566('0x29')](saveUpdates(_0x4aa16f[_0xf566('0x4c')],null))['then'](respondWithResult(_0x93730e,null))[_0xf566('0x45')](handleError(_0x93730e,null));};exports[_0xf566('0x2a')]=function(_0x253736,_0x4e4408){return db[_0xf566('0x31')][_0xf566('0x4b')]({'where':{'id':_0x253736[_0xf566('0x47')]['id']}})[_0xf566('0x29')](handleEntityNotFound(_0x4e4408,null))['then'](removeEntity(_0x4e4408,null))[_0xf566('0x45')](handleError(_0x4e4408,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 0448229..ad423d9 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 _0x355c=['request-promise','path','./squareMessage.attributes','exports','define','SquareMessage','square_messages','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x576ec6,_0x14d7c4){var _0x273398=function(_0x2410d0){while(--_0x2410d0){_0x576ec6['push'](_0x576ec6['shift']());}};_0x273398(++_0x14d7c4);}(_0x355c,0x89));var _0xc355=function(_0x4e1409,_0x2eb61d){_0x4e1409=_0x4e1409-0x0;var _0x37b0c1=_0x355c[_0x4e1409];return _0x37b0c1;};'use strict';var _=require(_0xc355('0x0'));var util=require(_0xc355('0x1'));var logger=require(_0xc355('0x2'))(_0xc355('0x3'));var moment=require(_0xc355('0x4'));var BPromise=require(_0xc355('0x5'));var rp=require(_0xc355('0x6'));var fs=require('fs');var path=require(_0xc355('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc355('0x8'));module[_0xc355('0x9')]=function(_0x2c100a,_0x4fb573){return _0x2c100a[_0xc355('0xa')](_0xc355('0xb'),attributes,{'tableName':_0xc355('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf525=['../../config/environment','exports','define','square_messages','lodash','util','api','moment','bluebird'];(function(_0x5a158e,_0x4ad802){var _0x31bfea=function(_0x24758b){while(--_0x24758b){_0x5a158e['push'](_0x5a158e['shift']());}};_0x31bfea(++_0x4ad802);}(_0xf525,0x13f));var _0x5f52=function(_0x24be75,_0x4d0624){_0x24be75=_0x24be75-0x0;var _0xb34832=_0xf525[_0x24be75];return _0xb34832;};'use strict';var _=require(_0x5f52('0x0'));var util=require(_0x5f52('0x1'));var logger=require('../../config/logger')(_0x5f52('0x2'));var moment=require(_0x5f52('0x3'));var BPromise=require(_0x5f52('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5f52('0x5'));var attributes=require('./squareMessage.attributes');module[_0x5f52('0x6')]=function(_0x5d1b24,_0x168bf2){return _0x5d1b24[_0x5f52('0x7')]('SquareMessage',attributes,{'tableName':_0x5f52('0x8'),'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 acece24..1e2591b 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 _0x7503=['CreateSquareMessage','SquareMessage','create','body','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x55b52a,_0x1ff343){var _0x5d9a80=function(_0x3b2812){while(--_0x3b2812){_0x55b52a['push'](_0x55b52a['shift']());}};_0x5d9a80(++_0x1ff343);}(_0x7503,0x13c));var _0x3750=function(_0x139b63,_0x389ca8){_0x139b63=_0x139b63-0x0;var _0x2493f2=_0x7503[_0x139b63];return _0x2493f2;};'use strict';var _=require(_0x3750('0x0'));var util=require('util');var moment=require(_0x3750('0x1'));var BPromise=require('bluebird');var rs=require(_0x3750('0x2'));var fs=require('fs');var Redis=require(_0x3750('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3750('0x4'));var logger=require(_0x3750('0x5'))(_0x3750('0x6'));var config=require('../../config/environment');var jayson=require(_0x3750('0x7'));var client=jayson['client'][_0x3750('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3a2117,_0x4b8d7f,_0x880aad){return new BPromise(function(_0x307070,_0xf31c32){return client['request'](_0x3a2117,_0x880aad)[_0x3750('0x9')](function(_0x4124f3){logger[_0x3750('0xa')](_0x3750('0xb'),_0x4b8d7f,_0x3750('0xc'));logger[_0x3750('0xd')](_0x3750('0xe'),_0x4b8d7f,_0x3750('0xc'),JSON[_0x3750('0xf')](_0x4124f3));if(_0x4124f3[_0x3750('0x10')]){if(_0x4124f3[_0x3750('0x10')][_0x3750('0x11')]===0x1f4){logger[_0x3750('0x10')](_0x3750('0xb'),_0x4b8d7f,_0x4124f3[_0x3750('0x10')][_0x3750('0x12')]);return _0xf31c32(_0x4124f3[_0x3750('0x10')][_0x3750('0x12')]);}logger[_0x3750('0x10')](_0x3750('0xb'),_0x4b8d7f,_0x4124f3['error'][_0x3750('0x12')]);return _0x307070(_0x4124f3[_0x3750('0x10')][_0x3750('0x12')]);}else{logger['info'](_0x3750('0xb'),_0x4b8d7f,'request\x20sent');_0x307070(_0x4124f3['result'][_0x3750('0x12')]);}})[_0x3750('0x13')](function(_0x56752f){logger[_0x3750('0x10')]('SquareMessage,\x20%s,\x20%s',_0x4b8d7f,_0x56752f);_0xf31c32(_0x56752f);});});}exports[_0x3750('0x14')]=function(_0x4ef94a){var _0x2b572d=this;return new Promise(function(_0x1b8f8e,_0x213728){return db[_0x3750('0x15')][_0x3750('0x16')](_0x4ef94a[_0x3750('0x17')],{'raw':_0x4ef94a['options']?_0x4ef94a['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x290348){logger[_0x3750('0xa')](_0x3750('0x14'),_0x4ef94a);logger[_0x3750('0xd')](_0x3750('0x14'),_0x4ef94a,JSON['stringify'](_0x290348));_0x1b8f8e(_0x290348);})[_0x3750('0x13')](function(_0x36994d){logger[_0x3750('0x10')](_0x3750('0x14'),_0x36994d['message'],_0x4ef94a);_0x213728(_0x2b572d[_0x3750('0x10')](0x1f4,_0x36994d[_0x3750('0x12')]));});});}; \ No newline at end of file +var _0xc166=['error','code','message','info','result','catch','SquareMessage','body','options','raw','CreateSquareMessage','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s'];(function(_0x4db4c1,_0x5d6f20){var _0x3e1cf5=function(_0x3db07a){while(--_0x3db07a){_0x4db4c1['push'](_0x4db4c1['shift']());}};_0x3e1cf5(++_0x5d6f20);}(_0xc166,0xc0));var _0x6c16=function(_0x5cb7d4,_0x18ae75){_0x5cb7d4=_0x5cb7d4-0x0;var _0x57d86d=_0xc166[_0x5cb7d4];return _0x57d86d;};'use strict';var _=require(_0x6c16('0x0'));var util=require(_0x6c16('0x1'));var moment=require(_0x6c16('0x2'));var BPromise=require('bluebird');var rs=require(_0x6c16('0x3'));var fs=require('fs');var Redis=require(_0x6c16('0x4'));var db=require(_0x6c16('0x5'))['db'];var utils=require(_0x6c16('0x6'));var logger=require(_0x6c16('0x7'))(_0x6c16('0x8'));var config=require(_0x6c16('0x9'));var jayson=require(_0x6c16('0xa'));var client=jayson['client'][_0x6c16('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xd90fe8,_0x5a310e,_0x2f3663){return new BPromise(function(_0x266668,_0x18a79e){return client[_0x6c16('0xc')](_0xd90fe8,_0x2f3663)[_0x6c16('0xd')](function(_0x9b4072){logger['info'](_0x6c16('0xe'),_0x5a310e,_0x6c16('0xf'));logger[_0x6c16('0x10')](_0x6c16('0x11'),_0x5a310e,_0x6c16('0xf'),JSON['stringify'](_0x9b4072));if(_0x9b4072['error']){if(_0x9b4072[_0x6c16('0x12')][_0x6c16('0x13')]===0x1f4){logger[_0x6c16('0x12')](_0x6c16('0xe'),_0x5a310e,_0x9b4072[_0x6c16('0x12')]['message']);return _0x18a79e(_0x9b4072[_0x6c16('0x12')]['message']);}logger[_0x6c16('0x12')](_0x6c16('0xe'),_0x5a310e,_0x9b4072['error']['message']);return _0x266668(_0x9b4072[_0x6c16('0x12')][_0x6c16('0x14')]);}else{logger[_0x6c16('0x15')](_0x6c16('0xe'),_0x5a310e,_0x6c16('0xf'));_0x266668(_0x9b4072[_0x6c16('0x16')][_0x6c16('0x14')]);}})[_0x6c16('0x17')](function(_0x5f1887){logger[_0x6c16('0x12')]('SquareMessage,\x20%s,\x20%s',_0x5a310e,_0x5f1887);_0x18a79e(_0x5f1887);});});}exports['CreateSquareMessage']=function(_0xd011e4){var _0x2c38e0=this;return new Promise(function(_0x58d38f,_0x4af996){return db[_0x6c16('0x18')]['create'](_0xd011e4[_0x6c16('0x19')],{'raw':_0xd011e4[_0x6c16('0x1a')]?_0xd011e4['options'][_0x6c16('0x1b')]===undefined?!![]:![]:!![]})[_0x6c16('0xd')](function(_0x53a4fe){logger[_0x6c16('0x15')]('CreateSquareMessage',_0xd011e4);logger[_0x6c16('0x10')](_0x6c16('0x1c'),_0xd011e4,JSON[_0x6c16('0x1d')](_0x53a4fe));_0x58d38f(_0x53a4fe);})[_0x6c16('0x17')](function(_0x5d8b6f){logger['error'](_0x6c16('0x1c'),_0x5d8b6f[_0x6c16('0x14')],_0xd011e4);_0x4af996(_0x2c38e0[_0x6c16('0x12')](0x1f4,_0x5d8b6f[_0x6c16('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 5b93303..b8964e3 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 _0x2375=['delete','/:id','destroy','multer','util','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','show','/:id/test','15s','test','post','create','update'];(function(_0x3662b4,_0x503b4d){var _0x50928c=function(_0x15db69){while(--_0x15db69){_0x3662b4['push'](_0x3662b4['shift']());}};_0x50928c(++_0x503b4d);}(_0x2375,0x16b));var _0x5237=function(_0x3ea913,_0x255df2){_0x3ea913=_0x3ea913-0x0;var _0x2b4f28=_0x2375[_0x3ea913];return _0x2b4f28;};'use strict';var multer=require(_0x5237('0x0'));var util=require(_0x5237('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5237('0x2'));var router=express['Router']();var fs_extra=require(_0x5237('0x3'));var auth=require(_0x5237('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x5237('0x5'));var controller=require('./squareOdbc.controller');router[_0x5237('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5237('0x6')]('/:id',auth[_0x5237('0x7')](),controller[_0x5237('0x8')]);router[_0x5237('0x6')](_0x5237('0x9'),auth[_0x5237('0x7')](),timeout(_0x5237('0xa')),controller[_0x5237('0xb')]);router[_0x5237('0xc')]('/',auth['isAuthenticated'](),controller[_0x5237('0xd')]);router['put']('/:id',auth[_0x5237('0x7')](),controller[_0x5237('0xe')]);router[_0x5237('0xf')](_0x5237('0x10'),auth[_0x5237('0x7')](),controller[_0x5237('0x11')]);module['exports']=router; \ No newline at end of file +var _0xa4fd=['get','/:id','show','/:id/test','15s','test','post','create','update','delete','destroy','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./squareOdbc.controller','isAuthenticated'];(function(_0x5235a6,_0x680b76){var _0x1cf37e=function(_0x31c173){while(--_0x31c173){_0x5235a6['push'](_0x5235a6['shift']());}};_0x1cf37e(++_0x680b76);}(_0xa4fd,0x83));var _0xda4f=function(_0x472516,_0x62a7fe){_0x472516=_0x472516-0x0;var _0x35c6e4=_0xa4fd[_0x472516];return _0x35c6e4;};'use strict';var multer=require(_0xda4f('0x0'));var util=require(_0xda4f('0x1'));var path=require(_0xda4f('0x2'));var timeout=require(_0xda4f('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xda4f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xda4f('0x5'));var config=require(_0xda4f('0x6'));var controller=require(_0xda4f('0x7'));router['get']('/',auth[_0xda4f('0x8')](),controller['index']);router[_0xda4f('0x9')](_0xda4f('0xa'),auth[_0xda4f('0x8')](),controller[_0xda4f('0xb')]);router[_0xda4f('0x9')](_0xda4f('0xc'),auth[_0xda4f('0x8')](),timeout(_0xda4f('0xd')),controller[_0xda4f('0xe')]);router[_0xda4f('0xf')]('/',auth['isAuthenticated'](),controller[_0xda4f('0x10')]);router['put'](_0xda4f('0xa'),auth[_0xda4f('0x8')](),controller[_0xda4f('0x11')]);router[_0xda4f('0x12')](_0xda4f('0xa'),auth[_0xda4f('0x8')](),controller[_0xda4f('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 0a62353..1687546 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 _0x23f3=['name','sequelize','exports','STRING'];(function(_0x5a3fb1,_0x243a9b){var _0x172cb9=function(_0x4aa08c){while(--_0x4aa08c){_0x5a3fb1['push'](_0x5a3fb1['shift']());}};_0x172cb9(++_0x243a9b);}(_0x23f3,0x1bd));var _0x323f=function(_0x11a103,_0x44db11){_0x11a103=_0x11a103-0x0;var _0x7defd1=_0x23f3[_0x11a103];return _0x7defd1;};'use strict';var Sequelize=require(_0x323f('0x0'));module[_0x323f('0x1')]={'name':{'type':Sequelize[_0x323f('0x2')],'unique':_0x323f('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0x323f('0x2')]},'description':{'type':Sequelize[_0x323f('0x2')]}}; \ No newline at end of file +var _0x8dd8=['sequelize','exports','name'];(function(_0x29f393,_0x3ef56c){var _0x4b1197=function(_0xfd191){while(--_0xfd191){_0x29f393['push'](_0x29f393['shift']());}};_0x4b1197(++_0x3ef56c);}(_0x8dd8,0x129));var _0x88dd=function(_0x2031da,_0x235e40){_0x2031da=_0x2031da-0x0;var _0x11d817=_0x8dd8[_0x2031da];return _0x11d817;};'use strict';var Sequelize=require(_0x88dd('0x0'));module[_0x88dd('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x88dd('0x2'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 04aacbc..3448768 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 _0x146d=['filters','find','catch','create','body','get','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','test','dsn','odbc','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','apply','save','update','then','ODBC','stack','name','send','index','map','SquareOdbc','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params'];(function(_0x2003ca,_0x327d9b){var _0xeaa6c9=function(_0x707dd5){while(--_0x707dd5){_0x2003ca['push'](_0x2003ca['shift']());}};_0xeaa6c9(++_0x327d9b);}(_0x146d,0x161));var _0xd146=function(_0x185fbf,_0x3d147f){_0x185fbf=_0x185fbf-0x0;var _0x169eef=_0x146d[_0x185fbf];return _0x169eef;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd146('0x0'));var zipdir=require(_0xd146('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd146('0x2'));var moment=require('moment');var BPromise=require(_0xd146('0x3'));var Mustache=require('mustache');var util=require(_0xd146('0x4'));var path=require(_0xd146('0x5'));var sox=require(_0xd146('0x6'));var csv=require(_0xd146('0x7'));var ejs=require(_0xd146('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xd146('0x9'));var jsforce=require(_0xd146('0xa'));var deskjs=require(_0xd146('0xb'));var toCsv=require(_0xd146('0x7'));var querystring=require(_0xd146('0xc'));var Papa=require(_0xd146('0xd'));var Redis=require(_0xd146('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xd146('0xf'));var as=require(_0xd146('0x10'));var hardwareService=require(_0xd146('0x11'));var logger=require(_0xd146('0x12'))(_0xd146('0x13'));var utils=require(_0xd146('0x14'));var config=require(_0xd146('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xd146('0x16'))['db'];function respondWithStatusCode(_0x24b991,_0x4c613b){_0x4c613b=_0x4c613b||0xcc;return function(_0x240ec2){if(_0x240ec2){return _0x24b991[_0xd146('0x17')](_0x4c613b);}return _0x24b991['status'](_0x4c613b)[_0xd146('0x18')]();};}function respondWithResult(_0x212f83,_0x12662b){_0x12662b=_0x12662b||0xc8;return function(_0xf65136){if(_0xf65136){return _0x212f83[_0xd146('0x19')](_0x12662b)[_0xd146('0x1a')](_0xf65136);}};}function respondWithFilteredResult(_0x155ec3,_0x3a7935){return function(_0x559273){if(_0x559273){var _0x761ea=typeof _0x3a7935[_0xd146('0x1b')]==='undefined'&&typeof _0x3a7935[_0xd146('0x1c')]===_0xd146('0x1d');var _0x482754=_0x559273[_0xd146('0x1e')];var _0x3ab30d=_0x761ea?0x0:_0x3a7935[_0xd146('0x1b')];var _0x41d32e=_0x761ea?_0x559273[_0xd146('0x1e')]:_0x3a7935[_0xd146('0x1b')]+_0x3a7935[_0xd146('0x1c')];var _0x11cd15;if(_0x41d32e>=_0x482754){_0x41d32e=_0x482754;_0x11cd15=0xc8;}else{_0x11cd15=0xce;}_0x155ec3[_0xd146('0x19')](_0x11cd15);return _0x155ec3[_0xd146('0x1f')]('Content-Range',_0x3ab30d+'-'+_0x41d32e+'/'+_0x482754)[_0xd146('0x1a')](_0x559273);}return null;};}function patchUpdates(_0x43f402){return function(_0x496c9a){try{jsonpatch[_0xd146('0x20')](_0x496c9a,_0x43f402,!![]);}catch(_0x5023fb){return BPromise['reject'](_0x5023fb);}return _0x496c9a[_0xd146('0x21')]();};}function saveUpdates(_0x4111b3,_0x3fa953){return function(_0x1f4211){if(_0x1f4211){return _0x1f4211[_0xd146('0x22')](_0x4111b3)[_0xd146('0x23')](function(_0x3d51af){return _0x3d51af;});}return null;};}function removeEntity(_0x2d7cc2,_0xdbe122){return function(_0x2bc774){if(_0x2bc774){return _0x2bc774['destroy']()[_0xd146('0x23')](function(){var _0x5aeeff=_0x2bc774['get']({'plain':!![]});var _0x5b57d2=_0xd146('0x24');return db['UserProfileResource']['destroy']({'where':{'type':_0x5b57d2,'resourceId':_0x5aeeff['id']}})[_0xd146('0x23')](function(){return _0x2bc774;});})[_0xd146('0x23')](function(){_0x2d7cc2[_0xd146('0x19')](0xcc)[_0xd146('0x18')]();});}};}function handleEntityNotFound(_0x25fe02,_0x720d96){return function(_0x39d8b0){if(!_0x39d8b0){_0x25fe02['sendStatus'](0x194);}return _0x39d8b0;};}function handleError(_0x348c60,_0xb09b31){_0xb09b31=_0xb09b31||0x1f4;return function(_0x1ee95b){logger['error'](_0x1ee95b[_0xd146('0x25')]);if(_0x1ee95b[_0xd146('0x26')]){delete _0x1ee95b[_0xd146('0x26')];}_0x348c60[_0xd146('0x19')](_0xb09b31)[_0xd146('0x27')](_0x1ee95b);};}exports[_0xd146('0x28')]=function(_0x1c8152,_0x720e6c){var _0x2d14fd={},_0x17fcc7={},_0x5b7ccd={'count':0x0,'rows':[]};var _0x11657f=_[_0xd146('0x29')](db[_0xd146('0x2a')][_0xd146('0x2b')],function(_0xdae14a){return{'name':_0xdae14a[_0xd146('0x2c')],'type':_0xdae14a[_0xd146('0x2d')]['key']};});_0x17fcc7[_0xd146('0x2e')]=_[_0xd146('0x29')](_0x11657f,'name');_0x17fcc7[_0xd146('0x2f')]=_[_0xd146('0x30')](_0x1c8152[_0xd146('0x2f')]);_0x17fcc7['filters']=_[_0xd146('0x31')](_0x17fcc7['model'],_0x17fcc7[_0xd146('0x2f')]);_0x2d14fd[_0xd146('0x32')]=_['intersection'](_0x17fcc7[_0xd146('0x2e')],qs[_0xd146('0x33')](_0x1c8152[_0xd146('0x2f')][_0xd146('0x33')]));_0x2d14fd['attributes']=_0x2d14fd[_0xd146('0x32')][_0xd146('0x34')]?_0x2d14fd[_0xd146('0x32')]:_0x17fcc7['model'];if(!_0x1c8152['query'][_0xd146('0x35')](_0xd146('0x36'))){_0x2d14fd[_0xd146('0x1c')]=qs[_0xd146('0x1c')](_0x1c8152[_0xd146('0x2f')][_0xd146('0x1c')]);_0x2d14fd[_0xd146('0x1b')]=qs[_0xd146('0x1b')](_0x1c8152['query'][_0xd146('0x1b')]);}_0x2d14fd['order']=qs[_0xd146('0x37')](_0x1c8152[_0xd146('0x2f')][_0xd146('0x37')]);_0x2d14fd[_0xd146('0x38')]=qs['filters'](_[_0xd146('0x39')](_0x1c8152['query'],_0x17fcc7['filters']),_0x11657f);if(_0x1c8152['query'][_0xd146('0x3a')]){_0x2d14fd[_0xd146('0x38')]=_[_0xd146('0x3b')](_0x2d14fd[_0xd146('0x38')],{'$or':_['map'](_0x11657f,function(_0x59b63e){if(_0x59b63e[_0xd146('0x2d')]!=='VIRTUAL'){var _0x524d7c={};_0x524d7c[_0x59b63e[_0xd146('0x26')]]={'$like':'%'+_0x1c8152[_0xd146('0x2f')]['filter']+'%'};return _0x524d7c;}})});}_0x2d14fd=_['merge']({},_0x2d14fd,_0x1c8152[_0xd146('0x3c')]);var _0x44d3b2={'where':_0x2d14fd[_0xd146('0x38')]};return db[_0xd146('0x2a')]['count'](_0x44d3b2)[_0xd146('0x23')](function(_0x543005){_0x5b7ccd[_0xd146('0x1e')]=_0x543005;if(_0x1c8152[_0xd146('0x2f')][_0xd146('0x3d')]){_0x2d14fd[_0xd146('0x3e')]=[{'all':!![]}];}return db[_0xd146('0x2a')][_0xd146('0x3f')](_0x2d14fd);})[_0xd146('0x23')](function(_0x4a3888){_0x5b7ccd[_0xd146('0x40')]=_0x4a3888;return _0x5b7ccd;})[_0xd146('0x23')](respondWithFilteredResult(_0x720e6c,_0x2d14fd))['catch'](handleError(_0x720e6c,null));};exports[_0xd146('0x41')]=function(_0x2328cc,_0x5cfdbe){var _0x8995e4={'raw':!![],'where':{'id':_0x2328cc[_0xd146('0x42')]['id']}},_0x43df5b={};_0x43df5b[_0xd146('0x2e')]=_['keys'](db[_0xd146('0x2a')][_0xd146('0x2b')]);_0x43df5b[_0xd146('0x2f')]=_[_0xd146('0x30')](_0x2328cc['query']);_0x43df5b[_0xd146('0x43')]=_[_0xd146('0x31')](_0x43df5b[_0xd146('0x2e')],_0x43df5b[_0xd146('0x2f')]);_0x8995e4[_0xd146('0x32')]=_[_0xd146('0x31')](_0x43df5b[_0xd146('0x2e')],qs['fields'](_0x2328cc[_0xd146('0x2f')][_0xd146('0x33')]));_0x8995e4[_0xd146('0x32')]=_0x8995e4[_0xd146('0x32')][_0xd146('0x34')]?_0x8995e4[_0xd146('0x32')]:_0x43df5b[_0xd146('0x2e')];if(_0x2328cc[_0xd146('0x2f')]['includeAll']){_0x8995e4['include']=[{'all':!![]}];}_0x8995e4=_[_0xd146('0x3b')]({},_0x8995e4,_0x2328cc['options']);return db['SquareOdbc'][_0xd146('0x44')](_0x8995e4)[_0xd146('0x23')](handleEntityNotFound(_0x5cfdbe,null))[_0xd146('0x23')](respondWithResult(_0x5cfdbe,null))[_0xd146('0x45')](handleError(_0x5cfdbe,null));};exports[_0xd146('0x46')]=function(_0x3de400,_0x5cd6e2){return db[_0xd146('0x2a')][_0xd146('0x46')](_0x3de400[_0xd146('0x47')],{})[_0xd146('0x23')](function(_0x52a4d6){var _0x4512a7=_0x3de400['user'][_0xd146('0x48')]({'plain':!![]});if(!_0x4512a7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4512a7[_0xd146('0x49')]==='user'){var _0x32ff59=_0x52a4d6[_0xd146('0x48')]({'plain':!![]});var _0x4d745c='ODBC';return db[_0xd146('0x4a')][_0xd146('0x44')]({'where':{'name':_0x4d745c,'userProfileId':_0x4512a7[_0xd146('0x4b')]},'raw':!![]})[_0xd146('0x23')](function(_0x306fb2){if(_0x306fb2&&_0x306fb2[_0xd146('0x4c')]===0x0){return db[_0xd146('0x4d')][_0xd146('0x46')]({'name':_0x32ff59[_0xd146('0x26')],'resourceId':_0x32ff59['id'],'type':_0x306fb2[_0xd146('0x26')],'sectionId':_0x306fb2['id']},{})[_0xd146('0x23')](function(){return _0x52a4d6;});}else{return _0x52a4d6;}})[_0xd146('0x45')](function(_0x3c32c2){logger[_0xd146('0x4e')](_0xd146('0x4f'),_0x3c32c2);throw _0x3c32c2;});}return _0x52a4d6;})[_0xd146('0x23')](respondWithResult(_0x5cd6e2,0xc9))[_0xd146('0x45')](handleError(_0x5cd6e2,null));};exports[_0xd146('0x22')]=function(_0x58f0e1,_0x34a5a2){if(_0x58f0e1['body']['id']){delete _0x58f0e1[_0xd146('0x47')]['id'];}return db[_0xd146('0x2a')][_0xd146('0x44')]({'where':{'id':_0x58f0e1[_0xd146('0x42')]['id']}})[_0xd146('0x23')](handleEntityNotFound(_0x34a5a2,null))[_0xd146('0x23')](saveUpdates(_0x58f0e1['body'],null))['then'](respondWithResult(_0x34a5a2,null))[_0xd146('0x45')](handleError(_0x34a5a2,null));};exports[_0xd146('0x50')]=function(_0x2f3671,_0x1aed5b){return db['SquareOdbc']['find']({'where':{'id':_0x2f3671[_0xd146('0x42')]['id']}})[_0xd146('0x23')](handleEntityNotFound(_0x1aed5b,null))['then'](removeEntity(_0x1aed5b,null))[_0xd146('0x45')](handleError(_0x1aed5b,null));};exports[_0xd146('0x51')]=function(_0x2ee26f,_0x458e6c,_0x1197d9){var _0x441cac;return db['SquareOdbc'][_0xd146('0x44')]({'where':{'id':_0x2ee26f[_0xd146('0x42')]['id']},'attributes':['id',_0xd146('0x52')]})[_0xd146('0x23')](handleEntityNotFound(_0x458e6c,null))[_0xd146('0x23')](function(_0x5bb496){if(_0x5bb496){var _0xfdd520=require(_0xd146('0x53'))();_0xfdd520['openSync'](_0x5bb496['dsn']);_0xfdd520['closeSync']();return _0x5bb496;}})[_0xd146('0x23')](respondWithResult(_0x458e6c,null))['catch'](handleError(_0x458e6c,null));}; \ No newline at end of file +var _0x818f=['attributes','hasOwnProperty','nolimit','order','sort','where','filters','merge','filter','options','SquareOdbc','includeAll','include','findAll','rows','params','length','find','catch','create','body','user','ODBC','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','dsn','openSync','closeSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','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','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','get','UserProfileResource','stack','name','index','rawAttributes','fieldName','type','model','map','query','keys','intersection','fields'];(function(_0x33b871,_0x5840af){var _0x2c176c=function(_0x4f9bd7){while(--_0x4f9bd7){_0x33b871['push'](_0x33b871['shift']());}};_0x2c176c(++_0x5840af);}(_0x818f,0x1c8));var _0xf818=function(_0x410f60,_0x3f63f6){_0x410f60=_0x410f60-0x0;var _0x4f2ad3=_0x818f[_0x410f60];return _0x4f2ad3;};'use strict';var emlformat=require(_0xf818('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf818('0x1'));var jsonpatch=require(_0xf818('0x2'));var rp=require(_0xf818('0x3'));var moment=require(_0xf818('0x4'));var BPromise=require(_0xf818('0x5'));var Mustache=require(_0xf818('0x6'));var util=require('util');var path=require(_0xf818('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf818('0x8'));var fs=require('fs');var fs_extra=require(_0xf818('0x9'));var _=require(_0xf818('0xa'));var squel=require('squel');var crypto=require(_0xf818('0xb'));var jsforce=require(_0xf818('0xc'));var deskjs=require(_0xf818('0xd'));var toCsv=require(_0xf818('0xe'));var querystring=require(_0xf818('0xf'));var Papa=require(_0xf818('0x10'));var Redis=require(_0xf818('0x11'));var authService=require(_0xf818('0x12'));var qs=require(_0xf818('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf818('0x14'));var logger=require('../../config/logger')(_0xf818('0x15'));var utils=require(_0xf818('0x16'));var config=require(_0xf818('0x17'));var licenseUtil=require(_0xf818('0x18'));var db=require(_0xf818('0x19'))['db'];function respondWithStatusCode(_0x66fbcc,_0x1d0002){_0x1d0002=_0x1d0002||0xcc;return function(_0x193829){if(_0x193829){return _0x66fbcc[_0xf818('0x1a')](_0x1d0002);}return _0x66fbcc[_0xf818('0x1b')](_0x1d0002)[_0xf818('0x1c')]();};}function respondWithResult(_0x329b87,_0x245095){_0x245095=_0x245095||0xc8;return function(_0x38c9ad){if(_0x38c9ad){return _0x329b87[_0xf818('0x1b')](_0x245095)[_0xf818('0x1d')](_0x38c9ad);}};}function respondWithFilteredResult(_0x1ada2c,_0x3cf3d5){return function(_0x274b7f){if(_0x274b7f){var _0xd9c141=typeof _0x3cf3d5[_0xf818('0x1e')]===_0xf818('0x1f')&&typeof _0x3cf3d5[_0xf818('0x20')]===_0xf818('0x1f');var _0x36207e=_0x274b7f[_0xf818('0x21')];var _0x11036b=_0xd9c141?0x0:_0x3cf3d5[_0xf818('0x1e')];var _0x63b21a=_0xd9c141?_0x274b7f[_0xf818('0x21')]:_0x3cf3d5[_0xf818('0x1e')]+_0x3cf3d5[_0xf818('0x20')];var _0x128e7e;if(_0x63b21a>=_0x36207e){_0x63b21a=_0x36207e;_0x128e7e=0xc8;}else{_0x128e7e=0xce;}_0x1ada2c[_0xf818('0x1b')](_0x128e7e);return _0x1ada2c[_0xf818('0x22')]('Content-Range',_0x11036b+'-'+_0x63b21a+'/'+_0x36207e)[_0xf818('0x1d')](_0x274b7f);}return null;};}function patchUpdates(_0x153d3c){return function(_0x45ae15){try{jsonpatch['apply'](_0x45ae15,_0x153d3c,!![]);}catch(_0x520aa3){return BPromise[_0xf818('0x23')](_0x520aa3);}return _0x45ae15[_0xf818('0x24')]();};}function saveUpdates(_0x487b96,_0x4907af){return function(_0x525c49){if(_0x525c49){return _0x525c49[_0xf818('0x25')](_0x487b96)[_0xf818('0x26')](function(_0xa0680e){return _0xa0680e;});}return null;};}function removeEntity(_0xd82e4e,_0x597b97){return function(_0x29fb9f){if(_0x29fb9f){return _0x29fb9f[_0xf818('0x27')]()[_0xf818('0x26')](function(){var _0x1215dd=_0x29fb9f[_0xf818('0x28')]({'plain':!![]});var _0x5d0cd0='ODBC';return db[_0xf818('0x29')][_0xf818('0x27')]({'where':{'type':_0x5d0cd0,'resourceId':_0x1215dd['id']}})[_0xf818('0x26')](function(){return _0x29fb9f;});})[_0xf818('0x26')](function(){_0xd82e4e[_0xf818('0x1b')](0xcc)[_0xf818('0x1c')]();});}};}function handleEntityNotFound(_0x3c2bf5,_0x5ca3de){return function(_0x2eb130){if(!_0x2eb130){_0x3c2bf5[_0xf818('0x1a')](0x194);}return _0x2eb130;};}function handleError(_0x4538d7,_0x598197){_0x598197=_0x598197||0x1f4;return function(_0x4bdb8c){logger['error'](_0x4bdb8c[_0xf818('0x2a')]);if(_0x4bdb8c[_0xf818('0x2b')]){delete _0x4bdb8c[_0xf818('0x2b')];}_0x4538d7[_0xf818('0x1b')](_0x598197)['send'](_0x4bdb8c);};}exports[_0xf818('0x2c')]=function(_0x20194d,_0x308dc1){var _0x1226a0={},_0x5a2a6c={},_0x5c88ed={'count':0x0,'rows':[]};var _0x53e998=_['map'](db['SquareOdbc'][_0xf818('0x2d')],function(_0x3d21c8){return{'name':_0x3d21c8[_0xf818('0x2e')],'type':_0x3d21c8[_0xf818('0x2f')]['key']};});_0x5a2a6c[_0xf818('0x30')]=_[_0xf818('0x31')](_0x53e998,'name');_0x5a2a6c[_0xf818('0x32')]=_[_0xf818('0x33')](_0x20194d[_0xf818('0x32')]);_0x5a2a6c['filters']=_['intersection'](_0x5a2a6c['model'],_0x5a2a6c[_0xf818('0x32')]);_0x1226a0['attributes']=_[_0xf818('0x34')](_0x5a2a6c[_0xf818('0x30')],qs['fields'](_0x20194d['query'][_0xf818('0x35')]));_0x1226a0[_0xf818('0x36')]=_0x1226a0[_0xf818('0x36')]['length']?_0x1226a0['attributes']:_0x5a2a6c[_0xf818('0x30')];if(!_0x20194d[_0xf818('0x32')][_0xf818('0x37')](_0xf818('0x38'))){_0x1226a0[_0xf818('0x20')]=qs[_0xf818('0x20')](_0x20194d[_0xf818('0x32')][_0xf818('0x20')]);_0x1226a0['offset']=qs[_0xf818('0x1e')](_0x20194d[_0xf818('0x32')][_0xf818('0x1e')]);}_0x1226a0[_0xf818('0x39')]=qs[_0xf818('0x3a')](_0x20194d[_0xf818('0x32')][_0xf818('0x3a')]);_0x1226a0[_0xf818('0x3b')]=qs[_0xf818('0x3c')](_['pick'](_0x20194d[_0xf818('0x32')],_0x5a2a6c[_0xf818('0x3c')]),_0x53e998);if(_0x20194d[_0xf818('0x32')]['filter']){_0x1226a0['where']=_[_0xf818('0x3d')](_0x1226a0[_0xf818('0x3b')],{'$or':_[_0xf818('0x31')](_0x53e998,function(_0x3d7897){if(_0x3d7897[_0xf818('0x2f')]!=='VIRTUAL'){var _0x48f671={};_0x48f671[_0x3d7897[_0xf818('0x2b')]]={'$like':'%'+_0x20194d['query'][_0xf818('0x3e')]+'%'};return _0x48f671;}})});}_0x1226a0=_['merge']({},_0x1226a0,_0x20194d[_0xf818('0x3f')]);var _0x2e5b4f={'where':_0x1226a0[_0xf818('0x3b')]};return db[_0xf818('0x40')]['count'](_0x2e5b4f)[_0xf818('0x26')](function(_0x41f5bf){_0x5c88ed[_0xf818('0x21')]=_0x41f5bf;if(_0x20194d[_0xf818('0x32')][_0xf818('0x41')]){_0x1226a0[_0xf818('0x42')]=[{'all':!![]}];}return db['SquareOdbc'][_0xf818('0x43')](_0x1226a0);})[_0xf818('0x26')](function(_0x5931ca){_0x5c88ed[_0xf818('0x44')]=_0x5931ca;return _0x5c88ed;})[_0xf818('0x26')](respondWithFilteredResult(_0x308dc1,_0x1226a0))['catch'](handleError(_0x308dc1,null));};exports['show']=function(_0x1db804,_0x1b8bc5){var _0x480730={'raw':!![],'where':{'id':_0x1db804[_0xf818('0x45')]['id']}},_0x53f99b={};_0x53f99b[_0xf818('0x30')]=_['keys'](db[_0xf818('0x40')]['rawAttributes']);_0x53f99b['query']=_[_0xf818('0x33')](_0x1db804[_0xf818('0x32')]);_0x53f99b[_0xf818('0x3c')]=_['intersection'](_0x53f99b[_0xf818('0x30')],_0x53f99b['query']);_0x480730['attributes']=_[_0xf818('0x34')](_0x53f99b['model'],qs[_0xf818('0x35')](_0x1db804[_0xf818('0x32')][_0xf818('0x35')]));_0x480730[_0xf818('0x36')]=_0x480730['attributes'][_0xf818('0x46')]?_0x480730['attributes']:_0x53f99b['model'];if(_0x1db804[_0xf818('0x32')]['includeAll']){_0x480730[_0xf818('0x42')]=[{'all':!![]}];}_0x480730=_['merge']({},_0x480730,_0x1db804[_0xf818('0x3f')]);return db['SquareOdbc'][_0xf818('0x47')](_0x480730)[_0xf818('0x26')](handleEntityNotFound(_0x1b8bc5,null))[_0xf818('0x26')](respondWithResult(_0x1b8bc5,null))[_0xf818('0x48')](handleError(_0x1b8bc5,null));};exports[_0xf818('0x49')]=function(_0x3390ce,_0x3478c7){return db[_0xf818('0x40')][_0xf818('0x49')](_0x3390ce[_0xf818('0x4a')],{})[_0xf818('0x26')](function(_0x261468){var _0x4de31f=_0x3390ce[_0xf818('0x4b')][_0xf818('0x28')]({'plain':!![]});if(!_0x4de31f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4de31f['role']===_0xf818('0x4b')){var _0x525511=_0x261468[_0xf818('0x28')]({'plain':!![]});var _0x482d10=_0xf818('0x4c');return db['UserProfileSection'][_0xf818('0x47')]({'where':{'name':_0x482d10,'userProfileId':_0x4de31f[_0xf818('0x4d')]},'raw':!![]})[_0xf818('0x26')](function(_0x2c4bb0){if(_0x2c4bb0&&_0x2c4bb0[_0xf818('0x4e')]===0x0){return db[_0xf818('0x29')][_0xf818('0x49')]({'name':_0x525511[_0xf818('0x2b')],'resourceId':_0x525511['id'],'type':_0x2c4bb0['name'],'sectionId':_0x2c4bb0['id']},{})[_0xf818('0x26')](function(){return _0x261468;});}else{return _0x261468;}})[_0xf818('0x48')](function(_0x1f06b2){logger[_0xf818('0x4f')](_0xf818('0x50'),_0x1f06b2);throw _0x1f06b2;});}return _0x261468;})['then'](respondWithResult(_0x3478c7,0xc9))[_0xf818('0x48')](handleError(_0x3478c7,null));};exports['update']=function(_0x288466,_0x3f428e){if(_0x288466['body']['id']){delete _0x288466[_0xf818('0x4a')]['id'];}return db['SquareOdbc'][_0xf818('0x47')]({'where':{'id':_0x288466[_0xf818('0x45')]['id']}})[_0xf818('0x26')](handleEntityNotFound(_0x3f428e,null))[_0xf818('0x26')](saveUpdates(_0x288466[_0xf818('0x4a')],null))[_0xf818('0x26')](respondWithResult(_0x3f428e,null))[_0xf818('0x48')](handleError(_0x3f428e,null));};exports[_0xf818('0x27')]=function(_0x2fe041,_0xce6da0){return db[_0xf818('0x40')][_0xf818('0x47')]({'where':{'id':_0x2fe041[_0xf818('0x45')]['id']}})[_0xf818('0x26')](handleEntityNotFound(_0xce6da0,null))[_0xf818('0x26')](removeEntity(_0xce6da0,null))[_0xf818('0x48')](handleError(_0xce6da0,null));};exports[_0xf818('0x51')]=function(_0x22fb02,_0x55a4a5,_0x5df798){var _0x58ed65;return db['SquareOdbc']['find']({'where':{'id':_0x22fb02[_0xf818('0x45')]['id']},'attributes':['id',_0xf818('0x52')]})[_0xf818('0x26')](handleEntityNotFound(_0x55a4a5,null))['then'](function(_0x27ed16){if(_0x27ed16){var _0x379048=require('odbc')();_0x379048[_0xf818('0x53')](_0x27ed16['dsn']);_0x379048[_0xf818('0x54')]();return _0x27ed16;}})[_0xf818('0x26')](respondWithResult(_0x55a4a5,null))[_0xf818('0x48')](handleError(_0x55a4a5,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index f290e5d..75f72fc 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 _0xa093=['rimraf','../../config/environment','./squareOdbc.attributes','define','square_odbc','lodash','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x41aead,_0x18bdb5){var _0x926d67=function(_0x2d31e8){while(--_0x2d31e8){_0x41aead['push'](_0x41aead['shift']());}};_0x926d67(++_0x18bdb5);}(_0xa093,0xc0));var _0x3a09=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa093[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3a09('0x0'));var util=require('util');var logger=require(_0x3a09('0x1'))('api');var moment=require(_0x3a09('0x2'));var BPromise=require(_0x3a09('0x3'));var rp=require(_0x3a09('0x4'));var fs=require('fs');var path=require(_0x3a09('0x5'));var rimraf=require(_0x3a09('0x6'));var config=require(_0x3a09('0x7'));var attributes=require(_0x3a09('0x8'));module['exports']=function(_0x4c3594,_0x1f2c11){return _0x4c3594[_0x3a09('0x9')]('SquareOdbc',attributes,{'tableName':_0x3a09('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2824=['util','../../config/logger','moment','request-promise','path','../../config/environment','./squareOdbc.attributes','exports','define','SquareOdbc','square_odbc','lodash'];(function(_0x46a3e8,_0x2e1b35){var _0xf1442e=function(_0x37b5d4){while(--_0x37b5d4){_0x46a3e8['push'](_0x46a3e8['shift']());}};_0xf1442e(++_0x2e1b35);}(_0x2824,0x1bb));var _0x4282=function(_0x555709,_0x3620c4){_0x555709=_0x555709-0x0;var _0x582484=_0x2824[_0x555709];return _0x582484;};'use strict';var _=require(_0x4282('0x0'));var util=require(_0x4282('0x1'));var logger=require(_0x4282('0x2'))('api');var moment=require(_0x4282('0x3'));var BPromise=require('bluebird');var rp=require(_0x4282('0x4'));var fs=require('fs');var path=require(_0x4282('0x5'));var rimraf=require('rimraf');var config=require(_0x4282('0x6'));var attributes=require(_0x4282('0x7'));module[_0x4282('0x8')]=function(_0x17cd5e,_0x434193){return _0x17cd5e[_0x4282('0x9')](_0x4282('0xa'),attributes,{'tableName':_0x4282('0xb'),'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 999a4b2..f0ce895 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 _0x60b4=['code','message','result','SquareOdbc','find','options','raw','where','attributes','map','include','model','ShowSquareOdbc','debug','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','http','request','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x50f09d,_0x49934b){var _0x4cd6e8=function(_0xf1f968){while(--_0xf1f968){_0x50f09d['push'](_0x50f09d['shift']());}};_0x4cd6e8(++_0x49934b);}(_0x60b4,0x1a4));var _0x460b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x60b4[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x460b('0x0'));var util=require(_0x460b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x460b('0x2'));var fs=require('fs');var Redis=require(_0x460b('0x3'));var db=require(_0x460b('0x4'))['db'];var utils=require(_0x460b('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x460b('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x460b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x50ef95,_0x2d6702,_0x3b6779){return new BPromise(function(_0x247c42,_0x43fd50){return client[_0x460b('0x8')](_0x50ef95,_0x3b6779)['then'](function(_0x1fff22){logger[_0x460b('0x9')](_0x460b('0xa'),_0x2d6702,_0x460b('0xb'));logger['debug'](_0x460b('0xc'),_0x2d6702,_0x460b('0xb'),JSON[_0x460b('0xd')](_0x1fff22));if(_0x1fff22[_0x460b('0xe')]){if(_0x1fff22[_0x460b('0xe')][_0x460b('0xf')]===0x1f4){logger[_0x460b('0xe')](_0x460b('0xa'),_0x2d6702,_0x1fff22[_0x460b('0xe')]['message']);return _0x43fd50(_0x1fff22[_0x460b('0xe')]['message']);}logger[_0x460b('0xe')](_0x460b('0xa'),_0x2d6702,_0x1fff22[_0x460b('0xe')][_0x460b('0x10')]);return _0x247c42(_0x1fff22['error'][_0x460b('0x10')]);}else{logger[_0x460b('0x9')]('SquareOdbc,\x20%s,\x20%s',_0x2d6702,'request\x20sent');_0x247c42(_0x1fff22[_0x460b('0x11')][_0x460b('0x10')]);}})['catch'](function(_0x2b5e36){logger[_0x460b('0xe')](_0x460b('0xa'),_0x2d6702,_0x2b5e36);_0x43fd50(_0x2b5e36);});});}exports['ShowSquareOdbc']=function(_0x5b5300){var _0x70c082=this;return new Promise(function(_0x21cd66,_0x4199b9){return db[_0x460b('0x12')][_0x460b('0x13')]({'raw':_0x5b5300[_0x460b('0x14')]?_0x5b5300['options'][_0x460b('0x15')]===undefined?!![]:![]:!![],'where':_0x5b5300[_0x460b('0x14')]?_0x5b5300[_0x460b('0x14')][_0x460b('0x16')]||null:null,'attributes':_0x5b5300[_0x460b('0x14')]?_0x5b5300[_0x460b('0x14')][_0x460b('0x17')]||null:null,'include':_0x5b5300[_0x460b('0x14')]?_0x5b5300[_0x460b('0x14')]['include']?_[_0x460b('0x18')](_0x5b5300['options'][_0x460b('0x19')],function(_0x4fa824){return{'model':db[_0x4fa824[_0x460b('0x1a')]],'as':_0x4fa824['as'],'attributes':_0x4fa824['attributes'],'include':_0x4fa824['include']?_['map'](_0x4fa824[_0x460b('0x19')],function(_0x5969e7){return{'model':db[_0x5969e7[_0x460b('0x1a')]],'as':_0x5969e7['as'],'attributes':_0x5969e7[_0x460b('0x17')],'include':_0x5969e7['include']?_[_0x460b('0x18')](_0x5969e7[_0x460b('0x19')],function(_0x48e9e7){return{'model':db[_0x48e9e7[_0x460b('0x1a')]],'as':_0x48e9e7['as'],'attributes':_0x48e9e7[_0x460b('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3d03c4){logger[_0x460b('0x9')](_0x460b('0x1b'),_0x5b5300);logger[_0x460b('0x1c')](_0x460b('0x1b'),_0x5b5300,JSON[_0x460b('0xd')](_0x3d03c4));_0x21cd66(_0x3d03c4);})['catch'](function(_0x2734eb){logger[_0x460b('0xe')](_0x460b('0x1b'),_0x2734eb[_0x460b('0x10')],_0x5b5300);_0x4199b9(_0x70c082['error'](0x1f4,_0x2734eb[_0x460b('0x10')]));});});}; \ No newline at end of file +var _0x2694=['code','SquareOdbc,\x20%s,\x20%s','message','result','ShowSquareOdbc','SquareOdbc','find','options','raw','attributes','map','include','model','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x32eee6,_0x3d93eb){var _0x4dc020=function(_0x448ef9){while(--_0x448ef9){_0x32eee6['push'](_0x32eee6['shift']());}};_0x4dc020(++_0x3d93eb);}(_0x2694,0x1d8));var _0x4269=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x2694[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x4269('0x0'));var rs=require(_0x4269('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4269('0x2'));var logger=require(_0x4269('0x3'))('rpc');var config=require(_0x4269('0x4'));var jayson=require(_0x4269('0x5'));var client=jayson[_0x4269('0x6')][_0x4269('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x324cad,_0x3b9c96,_0x269bf4){return new BPromise(function(_0x363c9e,_0x3ca92c){return client['request'](_0x324cad,_0x269bf4)['then'](function(_0x4e4820){logger[_0x4269('0x8')]('SquareOdbc,\x20%s,\x20%s',_0x3b9c96,'request\x20sent');logger[_0x4269('0x9')](_0x4269('0xa'),_0x3b9c96,_0x4269('0xb'),JSON[_0x4269('0xc')](_0x4e4820));if(_0x4e4820[_0x4269('0xd')]){if(_0x4e4820['error'][_0x4269('0xe')]===0x1f4){logger[_0x4269('0xd')](_0x4269('0xf'),_0x3b9c96,_0x4e4820[_0x4269('0xd')]['message']);return _0x3ca92c(_0x4e4820[_0x4269('0xd')][_0x4269('0x10')]);}logger[_0x4269('0xd')]('SquareOdbc,\x20%s,\x20%s',_0x3b9c96,_0x4e4820['error']['message']);return _0x363c9e(_0x4e4820[_0x4269('0xd')][_0x4269('0x10')]);}else{logger['info'](_0x4269('0xf'),_0x3b9c96,_0x4269('0xb'));_0x363c9e(_0x4e4820[_0x4269('0x11')][_0x4269('0x10')]);}})['catch'](function(_0x4c46d0){logger[_0x4269('0xd')](_0x4269('0xf'),_0x3b9c96,_0x4c46d0);_0x3ca92c(_0x4c46d0);});});}exports[_0x4269('0x12')]=function(_0x20c73d){var _0x1c15a2=this;return new Promise(function(_0x39711e,_0x297127){return db[_0x4269('0x13')][_0x4269('0x14')]({'raw':_0x20c73d[_0x4269('0x15')]?_0x20c73d['options'][_0x4269('0x16')]===undefined?!![]:![]:!![],'where':_0x20c73d[_0x4269('0x15')]?_0x20c73d[_0x4269('0x15')]['where']||null:null,'attributes':_0x20c73d[_0x4269('0x15')]?_0x20c73d[_0x4269('0x15')][_0x4269('0x17')]||null:null,'include':_0x20c73d['options']?_0x20c73d[_0x4269('0x15')]['include']?_[_0x4269('0x18')](_0x20c73d[_0x4269('0x15')][_0x4269('0x19')],function(_0x302ad3){return{'model':db[_0x302ad3[_0x4269('0x1a')]],'as':_0x302ad3['as'],'attributes':_0x302ad3[_0x4269('0x17')],'include':_0x302ad3[_0x4269('0x19')]?_[_0x4269('0x18')](_0x302ad3['include'],function(_0x508703){return{'model':db[_0x508703['model']],'as':_0x508703['as'],'attributes':_0x508703['attributes'],'include':_0x508703['include']?_['map'](_0x508703[_0x4269('0x19')],function(_0xe6f84d){return{'model':db[_0xe6f84d[_0x4269('0x1a')]],'as':_0xe6f84d['as'],'attributes':_0xe6f84d[_0x4269('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x388ba2){logger['info'](_0x4269('0x12'),_0x20c73d);logger[_0x4269('0x9')]('ShowSquareOdbc',_0x20c73d,JSON['stringify'](_0x388ba2));_0x39711e(_0x388ba2);})['catch'](function(_0x47bd0a){logger['error'](_0x4269('0x12'),_0x47bd0a[_0x4269('0x10')],_0x20c73d);_0x297127(_0x1c15a2[_0x4269('0xd')](0x1f4,_0x47bd0a[_0x4269('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 86d0fe2..e783554 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 _0x041d=['./squareProject.controller','isAuthenticated','index','get','/:id','show','/:id/users','getUsers','post','put','update','delete','destroy','removeUsers','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment'];(function(_0x54808c,_0x36e290){var _0xe9459=function(_0x55df21){while(--_0x55df21){_0x54808c['push'](_0x54808c['shift']());}};_0xe9459(++_0x36e290);}(_0x041d,0x185));var _0xd041=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x041d[_0xc4001c];return _0x49f7bc;};'use strict';var multer=require(_0xd041('0x0'));var util=require(_0xd041('0x1'));var path=require(_0xd041('0x2'));var timeout=require(_0xd041('0x3'));var express=require(_0xd041('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd041('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd041('0x6'));var controller=require(_0xd041('0x7'));router['get']('/',auth[_0xd041('0x8')](),controller[_0xd041('0x9')]);router[_0xd041('0xa')](_0xd041('0xb'),auth[_0xd041('0x8')](),controller[_0xd041('0xc')]);router['get'](_0xd041('0xd'),auth[_0xd041('0x8')](),controller[_0xd041('0xe')]);router[_0xd041('0xf')]('/',auth[_0xd041('0x8')](),controller['create']);router[_0xd041('0xf')](_0xd041('0xd'),auth[_0xd041('0x8')](),controller['addUsers']);router[_0xd041('0x10')]('/:id',auth[_0xd041('0x8')](),controller[_0xd041('0x11')]);router[_0xd041('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xd041('0x13')]);router['delete'](_0xd041('0xd'),auth[_0xd041('0x8')](),controller[_0xd041('0x14')]);module[_0xd041('0x15')]=router; \ No newline at end of file +var _0x351d=['multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/users','post','create','addUsers','delete','destroy','exports'];(function(_0xdd9a5f,_0x3ced93){var _0x3464b7=function(_0x35b534){while(--_0x35b534){_0xdd9a5f['push'](_0xdd9a5f['shift']());}};_0x3464b7(++_0x3ced93);}(_0x351d,0x90));var _0xd351=function(_0x2b7ea9,_0xfb2cf4){_0x2b7ea9=_0x2b7ea9-0x0;var _0x1d4f7c=_0x351d[_0x2b7ea9];return _0x1d4f7c;};'use strict';var multer=require(_0xd351('0x0'));var util=require('util');var path=require(_0xd351('0x1'));var timeout=require(_0xd351('0x2'));var express=require(_0xd351('0x3'));var router=express['Router']();var fs_extra=require(_0xd351('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xd351('0x5'));var config=require(_0xd351('0x6'));var controller=require('./squareProject.controller');router[_0xd351('0x7')]('/',auth[_0xd351('0x8')](),controller[_0xd351('0x9')]);router['get'](_0xd351('0xa'),auth[_0xd351('0x8')](),controller['show']);router[_0xd351('0x7')](_0xd351('0xb'),auth['isAuthenticated'](),controller['getUsers']);router[_0xd351('0xc')]('/',auth['isAuthenticated'](),controller[_0xd351('0xd')]);router[_0xd351('0xc')]('/:id/users',auth[_0xd351('0x8')](),controller[_0xd351('0xe')]);router['put'](_0xd351('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xd351('0xf')](_0xd351('0xa'),auth[_0xd351('0x8')](),controller[_0xd351('0x10')]);router['delete'](_0xd351('0xb'),auth[_0xd351('0x8')](),controller['removeUsers']);module[_0xd351('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index f43ad37..59383c8 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 _0xd4bd=['getDataValue','preproduction','toString','utf8','production','DATE','sequelize','STRING','name','BLOB','long'];(function(_0x9818c8,_0x361868){var _0x12743f=function(_0x395e47){while(--_0x395e47){_0x9818c8['push'](_0x9818c8['shift']());}};_0x12743f(++_0x361868);}(_0xd4bd,0x19d));var _0xdd4b=function(_0x29471c,_0x5d446f){_0x29471c=_0x29471c-0x0;var _0xa83112=_0xd4bd[_0x29471c];return _0xa83112;};'use strict';var Sequelize=require(_0xdd4b('0x0'));module['exports']={'name':{'type':Sequelize[_0xdd4b('0x1')],'unique':_0xdd4b('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xdd4b('0x1')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0xdd4b('0x3')](_0xdd4b('0x4')),'get':function(){if(this[_0xdd4b('0x5')](_0xdd4b('0x6'))){return this[_0xdd4b('0x5')]('preproduction')[_0xdd4b('0x7')](_0xdd4b('0x8'));}}},'production':{'type':Sequelize['BLOB'](_0xdd4b('0x4')),'get':function(){if(this['getDataValue'](_0xdd4b('0x9'))){return this['getDataValue'](_0xdd4b('0x9'))[_0xdd4b('0x7')]('utf8');}}},'savedAt':{'type':Sequelize[_0xdd4b('0xa')]},'publishedAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0xd641=['DATE','sequelize','exports','STRING','name','TEXT','BLOB','getDataValue','preproduction','toString','utf8','production'];(function(_0x42e1d6,_0x290d47){var _0x521275=function(_0x2189c1){while(--_0x2189c1){_0x42e1d6['push'](_0x42e1d6['shift']());}};_0x521275(++_0x290d47);}(_0xd641,0xd9));var _0x1d64=function(_0xf0ae5b,_0x11d150){_0xf0ae5b=_0xf0ae5b-0x0;var _0x2a9ea1=_0xd641[_0xf0ae5b];return _0x2a9ea1;};'use strict';var Sequelize=require(_0x1d64('0x0'));module[_0x1d64('0x1')]={'name':{'type':Sequelize[_0x1d64('0x2')],'unique':_0x1d64('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize[_0x1d64('0x4')]},'preproduction':{'type':Sequelize[_0x1d64('0x5')]('long'),'get':function(){if(this[_0x1d64('0x6')](_0x1d64('0x7'))){return this[_0x1d64('0x6')](_0x1d64('0x7'))[_0x1d64('0x8')](_0x1d64('0x9'));}}},'production':{'type':Sequelize[_0x1d64('0x5')]('long'),'get':function(){if(this[_0x1d64('0x6')](_0x1d64('0xa'))){return this[_0x1d64('0x6')]('production')[_0x1d64('0x8')](_0x1d64('0x9'));}}},'savedAt':{'type':Sequelize[_0x1d64('0xb')]},'publishedAt':{'type':Sequelize[_0x1d64('0xb')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 06f6c0f..f04c607 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 _0x6f56=['where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','intersection','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','SquareProjects','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addUsers','omit','ids','removeUsers','isArray','emit','userSquareProject:remove','getUsers','findOne','hasOwnProperty','eml-format','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','./squareProject.socket','register','status','end','json','undefined','offset','count','limit','set','Content-Range','apply','reject','update','then','destroy','UserProfileResource','sendStatus','error','stack','name','send','index','SquareProject','fieldName','type','model','map','query','keys','filters','fields','attributes','length','nolimit','order','sort'];(function(_0x485b5a,_0x2b289b){var _0xd2b34d=function(_0x34dcbd){while(--_0x34dcbd){_0x485b5a['push'](_0x485b5a['shift']());}};_0xd2b34d(++_0x2b289b);}(_0x6f56,0xe8));var _0x66f5=function(_0x5cb8cb,_0x45975f){_0x5cb8cb=_0x5cb8cb-0x0;var _0x3476c9=_0x6f56[_0x5cb8cb];return _0x3476c9;};'use strict';var emlformat=require(_0x66f5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x66f5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x66f5('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x66f5('0x3'));var util=require(_0x66f5('0x4'));var path=require(_0x66f5('0x5'));var sox=require(_0x66f5('0x6'));var csv=require(_0x66f5('0x7'));var ejs=require(_0x66f5('0x8'));var fs=require('fs');var fs_extra=require(_0x66f5('0x9'));var _=require(_0x66f5('0xa'));var squel=require(_0x66f5('0xb'));var crypto=require(_0x66f5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x66f5('0xd'));var toCsv=require(_0x66f5('0x7'));var querystring=require(_0x66f5('0xe'));var Papa=require(_0x66f5('0xf'));var Redis=require(_0x66f5('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x66f5('0x11'));var hardwareService=require(_0x66f5('0x12'));var logger=require(_0x66f5('0x13'))(_0x66f5('0x14'));var utils=require('../../config/utils');var config=require(_0x66f5('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x66f5('0x16'))['db'];config[_0x66f5('0x17')]=_[_0x66f5('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x66f5('0x17')]));require(_0x66f5('0x19'))[_0x66f5('0x1a')](socket);function respondWithStatusCode(_0x37f458,_0x1570d7){_0x1570d7=_0x1570d7||0xcc;return function(_0x2031e4){if(_0x2031e4){return _0x37f458['sendStatus'](_0x1570d7);}return _0x37f458[_0x66f5('0x1b')](_0x1570d7)[_0x66f5('0x1c')]();};}function respondWithResult(_0x4f8326,_0xa82b4d){_0xa82b4d=_0xa82b4d||0xc8;return function(_0xeab5a3){if(_0xeab5a3){return _0x4f8326[_0x66f5('0x1b')](_0xa82b4d)[_0x66f5('0x1d')](_0xeab5a3);}};}function respondWithFilteredResult(_0x229a2c,_0x4074bb){return function(_0x44c1ed){if(_0x44c1ed){var _0x49b340=typeof _0x4074bb['offset']===_0x66f5('0x1e')&&typeof _0x4074bb['limit']===_0x66f5('0x1e');var _0x22acff=_0x44c1ed['count'];var _0x88e907=_0x49b340?0x0:_0x4074bb[_0x66f5('0x1f')];var _0x21f03e=_0x49b340?_0x44c1ed[_0x66f5('0x20')]:_0x4074bb[_0x66f5('0x1f')]+_0x4074bb[_0x66f5('0x21')];var _0x2bc0c6;if(_0x21f03e>=_0x22acff){_0x21f03e=_0x22acff;_0x2bc0c6=0xc8;}else{_0x2bc0c6=0xce;}_0x229a2c[_0x66f5('0x1b')](_0x2bc0c6);return _0x229a2c[_0x66f5('0x22')](_0x66f5('0x23'),_0x88e907+'-'+_0x21f03e+'/'+_0x22acff)[_0x66f5('0x1d')](_0x44c1ed);}return null;};}function patchUpdates(_0x222e2e){return function(_0x48452f){try{jsonpatch[_0x66f5('0x24')](_0x48452f,_0x222e2e,!![]);}catch(_0x5315e0){return BPromise[_0x66f5('0x25')](_0x5315e0);}return _0x48452f['save']();};}function saveUpdates(_0x5324de,_0x31984b){return function(_0x321226){if(_0x321226){return _0x321226[_0x66f5('0x26')](_0x5324de)[_0x66f5('0x27')](function(_0x307573){return _0x307573;});}return null;};}function removeEntity(_0x35e6a3,_0x3415c0){return function(_0x1f721b){if(_0x1f721b){return _0x1f721b[_0x66f5('0x28')]()[_0x66f5('0x27')](function(){var _0x40d7b8=_0x1f721b['get']({'plain':!![]});var _0x6a0219='SquareProjects';return db[_0x66f5('0x29')][_0x66f5('0x28')]({'where':{'type':_0x6a0219,'resourceId':_0x40d7b8['id']}})['then'](function(){return _0x1f721b;});})[_0x66f5('0x27')](function(){_0x35e6a3[_0x66f5('0x1b')](0xcc)[_0x66f5('0x1c')]();});}};}function handleEntityNotFound(_0x1b87e0,_0x344460){return function(_0x48c298){if(!_0x48c298){_0x1b87e0[_0x66f5('0x2a')](0x194);}return _0x48c298;};}function handleError(_0x9c7f31,_0x290ad6){_0x290ad6=_0x290ad6||0x1f4;return function(_0x5f2199){logger[_0x66f5('0x2b')](_0x5f2199[_0x66f5('0x2c')]);if(_0x5f2199[_0x66f5('0x2d')]){delete _0x5f2199[_0x66f5('0x2d')];}_0x9c7f31[_0x66f5('0x1b')](_0x290ad6)[_0x66f5('0x2e')](_0x5f2199);};}exports[_0x66f5('0x2f')]=function(_0x7908ce,_0x449e8f){var _0xd54c13={},_0x188e3b={},_0x1c3d43={'count':0x0,'rows':[]};var _0x20916f=_['map'](db[_0x66f5('0x30')]['rawAttributes'],function(_0x16722c){return{'name':_0x16722c[_0x66f5('0x31')],'type':_0x16722c[_0x66f5('0x32')]['key']};});_0x188e3b[_0x66f5('0x33')]=_[_0x66f5('0x34')](_0x20916f,_0x66f5('0x2d'));_0x188e3b[_0x66f5('0x35')]=_[_0x66f5('0x36')](_0x7908ce[_0x66f5('0x35')]);_0x188e3b[_0x66f5('0x37')]=_['intersection'](_0x188e3b[_0x66f5('0x33')],_0x188e3b[_0x66f5('0x35')]);_0xd54c13['attributes']=_['intersection'](_0x188e3b[_0x66f5('0x33')],qs[_0x66f5('0x38')](_0x7908ce[_0x66f5('0x35')][_0x66f5('0x38')]));_0xd54c13[_0x66f5('0x39')]=_0xd54c13[_0x66f5('0x39')][_0x66f5('0x3a')]?_0xd54c13['attributes']:_0x188e3b[_0x66f5('0x33')];if(!_0x7908ce[_0x66f5('0x35')]['hasOwnProperty'](_0x66f5('0x3b'))){_0xd54c13['limit']=qs[_0x66f5('0x21')](_0x7908ce[_0x66f5('0x35')][_0x66f5('0x21')]);_0xd54c13[_0x66f5('0x1f')]=qs['offset'](_0x7908ce['query'][_0x66f5('0x1f')]);}_0xd54c13[_0x66f5('0x3c')]=qs[_0x66f5('0x3d')](_0x7908ce['query'][_0x66f5('0x3d')]);_0xd54c13[_0x66f5('0x3e')]=qs[_0x66f5('0x37')](_[_0x66f5('0x3f')](_0x7908ce[_0x66f5('0x35')],_0x188e3b[_0x66f5('0x37')]),_0x20916f);if(_0x7908ce['query'][_0x66f5('0x40')]){_0xd54c13[_0x66f5('0x3e')]=_[_0x66f5('0x41')](_0xd54c13[_0x66f5('0x3e')],{'$or':_[_0x66f5('0x34')](_0x20916f,function(_0x11a2bd){if(_0x11a2bd['type']!==_0x66f5('0x42')){var _0xfd3f9f={};_0xfd3f9f[_0x11a2bd[_0x66f5('0x2d')]]={'$like':'%'+_0x7908ce[_0x66f5('0x35')]['filter']+'%'};return _0xfd3f9f;}})});}_0xd54c13=_['merge']({},_0xd54c13,_0x7908ce[_0x66f5('0x43')]);var _0x377edc={'where':_0xd54c13[_0x66f5('0x3e')]};return db[_0x66f5('0x30')][_0x66f5('0x20')](_0x377edc)[_0x66f5('0x27')](function(_0x4f99f9){_0x1c3d43['count']=_0x4f99f9;if(_0x7908ce[_0x66f5('0x35')]['includeAll']){_0xd54c13[_0x66f5('0x44')]=[{'all':!![]}];}return db[_0x66f5('0x30')][_0x66f5('0x45')](_0xd54c13);})[_0x66f5('0x27')](function(_0x51575d){_0x1c3d43[_0x66f5('0x46')]=_0x51575d;return _0x1c3d43;})['then'](respondWithFilteredResult(_0x449e8f,_0xd54c13))[_0x66f5('0x47')](handleError(_0x449e8f,null));};exports[_0x66f5('0x48')]=function(_0x45c0d6,_0x361e2d){var _0x3c9e35={'raw':![],'where':{'id':_0x45c0d6[_0x66f5('0x49')]['id']}},_0x1bc221={};_0x1bc221[_0x66f5('0x33')]=_[_0x66f5('0x36')](db[_0x66f5('0x30')][_0x66f5('0x4a')]);_0x1bc221['query']=_[_0x66f5('0x36')](_0x45c0d6[_0x66f5('0x35')]);_0x1bc221[_0x66f5('0x37')]=_[_0x66f5('0x4b')](_0x1bc221['model'],_0x1bc221[_0x66f5('0x35')]);_0x3c9e35[_0x66f5('0x39')]=_[_0x66f5('0x4b')](_0x1bc221['model'],qs[_0x66f5('0x38')](_0x45c0d6[_0x66f5('0x35')]['fields']));_0x3c9e35[_0x66f5('0x39')]=_0x3c9e35[_0x66f5('0x39')][_0x66f5('0x3a')]?_0x3c9e35[_0x66f5('0x39')]:_0x1bc221[_0x66f5('0x33')];if(_0x45c0d6[_0x66f5('0x35')][_0x66f5('0x4c')]){_0x3c9e35['include']=[{'all':!![]}];}_0x3c9e35=_[_0x66f5('0x41')]({},_0x3c9e35,_0x45c0d6['options']);return db['SquareProject'][_0x66f5('0x4d')](_0x3c9e35)[_0x66f5('0x27')](handleEntityNotFound(_0x361e2d,null))['then'](respondWithResult(_0x361e2d,null))['catch'](handleError(_0x361e2d,null));};exports['create']=function(_0x219b5f,_0x4e2201){return db[_0x66f5('0x30')][_0x66f5('0x4e')](_0x219b5f[_0x66f5('0x4f')],{})[_0x66f5('0x27')](function(_0x39e65c){var _0x2bc14e=_0x219b5f[_0x66f5('0x50')]['get']({'plain':!![]});if(!_0x2bc14e)throw new Error(_0x66f5('0x51'));if(_0x2bc14e[_0x66f5('0x52')]===_0x66f5('0x50')){var _0x205406=_0x39e65c[_0x66f5('0x53')]({'plain':!![]});var _0xb2a6ed=_0x66f5('0x54');return db[_0x66f5('0x55')][_0x66f5('0x4d')]({'where':{'name':_0xb2a6ed,'userProfileId':_0x2bc14e[_0x66f5('0x56')]},'raw':!![]})['then'](function(_0x2af50e){if(_0x2af50e&&_0x2af50e['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x205406[_0x66f5('0x2d')],'resourceId':_0x205406['id'],'type':_0x2af50e[_0x66f5('0x2d')],'sectionId':_0x2af50e['id']},{})['then'](function(){return _0x39e65c;});}else{return _0x39e65c;}})[_0x66f5('0x47')](function(_0x210b81){logger[_0x66f5('0x2b')](_0x66f5('0x57'),_0x210b81);throw _0x210b81;});}return _0x39e65c;})[_0x66f5('0x27')](respondWithResult(_0x4e2201,0xc9))[_0x66f5('0x47')](handleError(_0x4e2201,null));};exports[_0x66f5('0x26')]=function(_0x5c3c82,_0x12b2c0){if(_0x5c3c82['body']['id']){delete _0x5c3c82['body']['id'];}return db[_0x66f5('0x30')][_0x66f5('0x4d')]({'where':{'id':_0x5c3c82[_0x66f5('0x49')]['id']}})[_0x66f5('0x27')](handleEntityNotFound(_0x12b2c0,null))[_0x66f5('0x27')](saveUpdates(_0x5c3c82[_0x66f5('0x4f')],null))[_0x66f5('0x27')](respondWithResult(_0x12b2c0,null))[_0x66f5('0x47')](handleError(_0x12b2c0,null));};exports['destroy']=function(_0x5e0f8d,_0x401a88){return db[_0x66f5('0x30')]['find']({'where':{'id':_0x5e0f8d[_0x66f5('0x49')]['id']}})[_0x66f5('0x27')](handleEntityNotFound(_0x401a88,null))['then'](removeEntity(_0x401a88,null))[_0x66f5('0x47')](handleError(_0x401a88,null));};exports[_0x66f5('0x58')]=function(_0x28e064,_0x4219c9,_0x2cd7a7){return db[_0x66f5('0x30')][_0x66f5('0x4d')]({'where':{'id':_0x28e064[_0x66f5('0x49')]['id']}})[_0x66f5('0x27')](handleEntityNotFound(_0x4219c9,null))[_0x66f5('0x27')](function(_0x163726){if(_0x163726){return _0x163726['addUsers'](_0x28e064[_0x66f5('0x4f')]['ids'],_[_0x66f5('0x59')](_0x28e064[_0x66f5('0x4f')],[_0x66f5('0x5a'),'id'])||{});}})[_0x66f5('0x27')](respondWithResult(_0x4219c9,null))[_0x66f5('0x47')](handleError(_0x4219c9,null));};exports[_0x66f5('0x5b')]=function(_0x3fce83,_0xf99bd4,_0x36425e){return db[_0x66f5('0x30')][_0x66f5('0x4d')]({'where':{'id':_0x3fce83[_0x66f5('0x49')]['id']}})[_0x66f5('0x27')](handleEntityNotFound(_0xf99bd4,null))[_0x66f5('0x27')](function(_0x57aa4f){if(_0x57aa4f){return _0x57aa4f[_0x66f5('0x5b')](_0x3fce83[_0x66f5('0x35')][_0x66f5('0x5a')])['then'](function(){if(_[_0x66f5('0x5c')](_0x3fce83['query']['ids'])){for(var _0x50d3b5=0x0;_0x50d3b5<_0x3fce83[_0x66f5('0x35')]['ids'][_0x66f5('0x3a')];_0x50d3b5+=0x1){socket[_0x66f5('0x5d')](_0x66f5('0x5e'),{'UserId':Number(_0x3fce83[_0x66f5('0x35')][_0x66f5('0x5a')][_0x50d3b5]),'SquareProjectId':Number(_0x3fce83[_0x66f5('0x49')]['id'])});}}else{socket[_0x66f5('0x5d')](_0x66f5('0x5e'),{'UserId':Number(_0x3fce83['query']['ids']),'SquareProjectId':Number(_0x3fce83['params']['id'])});}});}})['then'](respondWithStatusCode(_0xf99bd4,null))['catch'](handleError(_0xf99bd4,null));};exports[_0x66f5('0x5f')]=function(_0x30fd14,_0x1ee262,_0xb601cd){var _0x3bf1ed={};var _0x4576df={};var _0x390846;var _0x1c4ab;return db[_0x66f5('0x30')][_0x66f5('0x60')]({'where':{'id':_0x30fd14[_0x66f5('0x49')]['id']}})['then'](handleEntityNotFound(_0x1ee262,null))[_0x66f5('0x27')](function(_0xde8939){if(_0xde8939){_0x390846=_0xde8939;_0x4576df['model']=_[_0x66f5('0x36')](db['User'][_0x66f5('0x4a')]);_0x4576df[_0x66f5('0x35')]=_[_0x66f5('0x36')](_0x30fd14[_0x66f5('0x35')]);_0x4576df[_0x66f5('0x37')]=_[_0x66f5('0x4b')](_0x4576df[_0x66f5('0x33')],_0x4576df[_0x66f5('0x35')]);_0x3bf1ed[_0x66f5('0x39')]=_[_0x66f5('0x4b')](_0x4576df['model'],qs['fields'](_0x30fd14[_0x66f5('0x35')][_0x66f5('0x38')]));_0x3bf1ed[_0x66f5('0x39')]=_0x3bf1ed['attributes']['length']?_0x3bf1ed['attributes']:_0x4576df[_0x66f5('0x33')];_0x3bf1ed['order']=qs[_0x66f5('0x3d')](_0x30fd14[_0x66f5('0x35')][_0x66f5('0x3d')]);_0x3bf1ed[_0x66f5('0x3e')]=qs[_0x66f5('0x37')](_[_0x66f5('0x3f')](_0x30fd14[_0x66f5('0x35')],_0x4576df[_0x66f5('0x37')]));if(_0x30fd14[_0x66f5('0x35')][_0x66f5('0x40')]){_0x3bf1ed['where']=_[_0x66f5('0x41')](_0x3bf1ed[_0x66f5('0x3e')],{'$or':_[_0x66f5('0x34')](_0x3bf1ed['attributes'],function(_0x1385f9){var _0x5b7d21={};_0x5b7d21[_0x1385f9]={'$like':'%'+_0x30fd14[_0x66f5('0x35')][_0x66f5('0x40')]+'%'};return _0x5b7d21;})});}_0x3bf1ed=_[_0x66f5('0x41')]({},_0x3bf1ed,_0x30fd14['options']);return _0x390846[_0x66f5('0x5f')](_0x3bf1ed);}})[_0x66f5('0x27')](function(_0x82bf7a){if(_0x82bf7a){_0x1c4ab=_0x82bf7a[_0x66f5('0x3a')];if(!_0x30fd14[_0x66f5('0x35')][_0x66f5('0x61')]('nolimit')){_0x3bf1ed['limit']=qs['limit'](_0x30fd14[_0x66f5('0x35')][_0x66f5('0x21')]);_0x3bf1ed[_0x66f5('0x1f')]=qs[_0x66f5('0x1f')](_0x30fd14[_0x66f5('0x35')]['offset']);}return _0x390846[_0x66f5('0x5f')](_0x3bf1ed);}})[_0x66f5('0x27')](function(_0x402ab3){if(_0x402ab3){return _0x402ab3?{'count':_0x1c4ab,'rows':_0x402ab3}:null;}})[_0x66f5('0x27')](respondWithResult(_0x1ee262,null))[_0x66f5('0x47')](handleError(_0x1ee262,null));}; \ No newline at end of file +var _0x0891=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addUsers','ids','removeUsers','isArray','emit','findOne','User','getUsers','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/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','redis','localhost','socket.io-emitter','./squareProject.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','SquareProjects','error','stack','name','send','index','map','SquareProject','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','user'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0x0891,0x70));var _0x1089=function(_0x57b48d,_0x212ab3){_0x57b48d=_0x57b48d-0x0;var _0xa07474=_0x0891[_0x57b48d];return _0xa07474;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1089('0x0'));var jsonpatch=require(_0x1089('0x1'));var rp=require(_0x1089('0x2'));var moment=require('moment');var BPromise=require(_0x1089('0x3'));var Mustache=require(_0x1089('0x4'));var util=require(_0x1089('0x5'));var path=require(_0x1089('0x6'));var sox=require(_0x1089('0x7'));var csv=require(_0x1089('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1089('0x9'));var _=require(_0x1089('0xa'));var squel=require(_0x1089('0xb'));var crypto=require('crypto');var jsforce=require(_0x1089('0xc'));var deskjs=require(_0x1089('0xd'));var toCsv=require(_0x1089('0x8'));var querystring=require('querystring');var Papa=require(_0x1089('0xe'));var Redis=require(_0x1089('0xf'));var authService=require(_0x1089('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x1089('0x11'));var hardwareService=require(_0x1089('0x12'));var logger=require(_0x1089('0x13'))(_0x1089('0x14'));var utils=require('../../config/utils');var config=require(_0x1089('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x1089('0x16')]=_['defaults'](config['redis'],{'host':_0x1089('0x17'),'port':0x18eb});var socket=require(_0x1089('0x18'))(new Redis(config[_0x1089('0x16')]));require(_0x1089('0x19'))[_0x1089('0x1a')](socket);function respondWithStatusCode(_0x278866,_0x2bd069){_0x2bd069=_0x2bd069||0xcc;return function(_0x296d7b){if(_0x296d7b){return _0x278866[_0x1089('0x1b')](_0x2bd069);}return _0x278866[_0x1089('0x1c')](_0x2bd069)[_0x1089('0x1d')]();};}function respondWithResult(_0x124091,_0x211358){_0x211358=_0x211358||0xc8;return function(_0xb653a4){if(_0xb653a4){return _0x124091[_0x1089('0x1c')](_0x211358)[_0x1089('0x1e')](_0xb653a4);}};}function respondWithFilteredResult(_0x4d565d,_0x3312b3){return function(_0x2556e2){if(_0x2556e2){var _0x231c7f=typeof _0x3312b3[_0x1089('0x1f')]===_0x1089('0x20')&&typeof _0x3312b3[_0x1089('0x21')]===_0x1089('0x20');var _0x4d17d7=_0x2556e2['count'];var _0x5a8312=_0x231c7f?0x0:_0x3312b3['offset'];var _0x21bd86=_0x231c7f?_0x2556e2[_0x1089('0x22')]:_0x3312b3[_0x1089('0x1f')]+_0x3312b3[_0x1089('0x21')];var _0x1ece18;if(_0x21bd86>=_0x4d17d7){_0x21bd86=_0x4d17d7;_0x1ece18=0xc8;}else{_0x1ece18=0xce;}_0x4d565d[_0x1089('0x1c')](_0x1ece18);return _0x4d565d[_0x1089('0x23')](_0x1089('0x24'),_0x5a8312+'-'+_0x21bd86+'/'+_0x4d17d7)[_0x1089('0x1e')](_0x2556e2);}return null;};}function patchUpdates(_0x4ab834){return function(_0x78ed73){try{jsonpatch[_0x1089('0x25')](_0x78ed73,_0x4ab834,!![]);}catch(_0x3ea839){return BPromise[_0x1089('0x26')](_0x3ea839);}return _0x78ed73[_0x1089('0x27')]();};}function saveUpdates(_0x49dfcf,_0x1a3496){return function(_0x1fe673){if(_0x1fe673){return _0x1fe673[_0x1089('0x28')](_0x49dfcf)[_0x1089('0x29')](function(_0x5d1097){return _0x5d1097;});}return null;};}function removeEntity(_0x4a554c,_0x2047ce){return function(_0x5b1466){if(_0x5b1466){return _0x5b1466[_0x1089('0x2a')]()[_0x1089('0x29')](function(){var _0x20385f=_0x5b1466[_0x1089('0x2b')]({'plain':!![]});var _0x1a88b8=_0x1089('0x2c');return db['UserProfileResource'][_0x1089('0x2a')]({'where':{'type':_0x1a88b8,'resourceId':_0x20385f['id']}})['then'](function(){return _0x5b1466;});})[_0x1089('0x29')](function(){_0x4a554c[_0x1089('0x1c')](0xcc)[_0x1089('0x1d')]();});}};}function handleEntityNotFound(_0x123ae2,_0x161323){return function(_0x21f708){if(!_0x21f708){_0x123ae2['sendStatus'](0x194);}return _0x21f708;};}function handleError(_0x5739b3,_0x1d7c9b){_0x1d7c9b=_0x1d7c9b||0x1f4;return function(_0x227b9b){logger[_0x1089('0x2d')](_0x227b9b[_0x1089('0x2e')]);if(_0x227b9b[_0x1089('0x2f')]){delete _0x227b9b[_0x1089('0x2f')];}_0x5739b3[_0x1089('0x1c')](_0x1d7c9b)[_0x1089('0x30')](_0x227b9b);};}exports[_0x1089('0x31')]=function(_0x29ed9f,_0x25e189){var _0x5c1218={},_0x4ccc82={},_0xd52ee6={'count':0x0,'rows':[]};var _0x757efc=_[_0x1089('0x32')](db[_0x1089('0x33')][_0x1089('0x34')],function(_0x11cb9a){return{'name':_0x11cb9a[_0x1089('0x35')],'type':_0x11cb9a[_0x1089('0x36')][_0x1089('0x37')]};});_0x4ccc82[_0x1089('0x38')]=_[_0x1089('0x32')](_0x757efc,_0x1089('0x2f'));_0x4ccc82[_0x1089('0x39')]=_[_0x1089('0x3a')](_0x29ed9f[_0x1089('0x39')]);_0x4ccc82[_0x1089('0x3b')]=_[_0x1089('0x3c')](_0x4ccc82[_0x1089('0x38')],_0x4ccc82[_0x1089('0x39')]);_0x5c1218[_0x1089('0x3d')]=_[_0x1089('0x3c')](_0x4ccc82[_0x1089('0x38')],qs['fields'](_0x29ed9f[_0x1089('0x39')][_0x1089('0x3e')]));_0x5c1218[_0x1089('0x3d')]=_0x5c1218['attributes'][_0x1089('0x3f')]?_0x5c1218['attributes']:_0x4ccc82['model'];if(!_0x29ed9f[_0x1089('0x39')][_0x1089('0x40')](_0x1089('0x41'))){_0x5c1218['limit']=qs[_0x1089('0x21')](_0x29ed9f[_0x1089('0x39')]['limit']);_0x5c1218[_0x1089('0x1f')]=qs[_0x1089('0x1f')](_0x29ed9f['query']['offset']);}_0x5c1218[_0x1089('0x42')]=qs[_0x1089('0x43')](_0x29ed9f[_0x1089('0x39')][_0x1089('0x43')]);_0x5c1218[_0x1089('0x44')]=qs[_0x1089('0x3b')](_[_0x1089('0x45')](_0x29ed9f['query'],_0x4ccc82[_0x1089('0x3b')]),_0x757efc);if(_0x29ed9f[_0x1089('0x39')][_0x1089('0x46')]){_0x5c1218['where']=_[_0x1089('0x47')](_0x5c1218[_0x1089('0x44')],{'$or':_[_0x1089('0x32')](_0x757efc,function(_0x540f71){if(_0x540f71[_0x1089('0x36')]!==_0x1089('0x48')){var _0x1d0937={};_0x1d0937[_0x540f71[_0x1089('0x2f')]]={'$like':'%'+_0x29ed9f[_0x1089('0x39')]['filter']+'%'};return _0x1d0937;}})});}_0x5c1218=_[_0x1089('0x47')]({},_0x5c1218,_0x29ed9f[_0x1089('0x49')]);var _0x45f7cf={'where':_0x5c1218[_0x1089('0x44')]};return db[_0x1089('0x33')][_0x1089('0x22')](_0x45f7cf)[_0x1089('0x29')](function(_0x58b25d){_0xd52ee6[_0x1089('0x22')]=_0x58b25d;if(_0x29ed9f['query'][_0x1089('0x4a')]){_0x5c1218[_0x1089('0x4b')]=[{'all':!![]}];}return db[_0x1089('0x33')]['findAll'](_0x5c1218);})[_0x1089('0x29')](function(_0x50931e){_0xd52ee6[_0x1089('0x4c')]=_0x50931e;return _0xd52ee6;})['then'](respondWithFilteredResult(_0x25e189,_0x5c1218))[_0x1089('0x4d')](handleError(_0x25e189,null));};exports[_0x1089('0x4e')]=function(_0x4f4ed9,_0x1fca1e){var _0x345a3c={'raw':![],'where':{'id':_0x4f4ed9[_0x1089('0x4f')]['id']}},_0x56d706={};_0x56d706[_0x1089('0x38')]=_['keys'](db[_0x1089('0x33')][_0x1089('0x34')]);_0x56d706[_0x1089('0x39')]=_['keys'](_0x4f4ed9[_0x1089('0x39')]);_0x56d706[_0x1089('0x3b')]=_['intersection'](_0x56d706['model'],_0x56d706[_0x1089('0x39')]);_0x345a3c[_0x1089('0x3d')]=_[_0x1089('0x3c')](_0x56d706[_0x1089('0x38')],qs[_0x1089('0x3e')](_0x4f4ed9[_0x1089('0x39')][_0x1089('0x3e')]));_0x345a3c[_0x1089('0x3d')]=_0x345a3c['attributes']['length']?_0x345a3c[_0x1089('0x3d')]:_0x56d706['model'];if(_0x4f4ed9[_0x1089('0x39')][_0x1089('0x4a')]){_0x345a3c[_0x1089('0x4b')]=[{'all':!![]}];}_0x345a3c=_['merge']({},_0x345a3c,_0x4f4ed9[_0x1089('0x49')]);return db['SquareProject'][_0x1089('0x50')](_0x345a3c)[_0x1089('0x29')](handleEntityNotFound(_0x1fca1e,null))[_0x1089('0x29')](respondWithResult(_0x1fca1e,null))[_0x1089('0x4d')](handleError(_0x1fca1e,null));};exports[_0x1089('0x51')]=function(_0x559d1a,_0x5ef0ca){return db[_0x1089('0x33')][_0x1089('0x51')](_0x559d1a[_0x1089('0x52')],{})[_0x1089('0x29')](function(_0x23dc1e){var _0x3a6301=_0x559d1a[_0x1089('0x53')]['get']({'plain':!![]});if(!_0x3a6301)throw new Error(_0x1089('0x54'));if(_0x3a6301[_0x1089('0x55')]===_0x1089('0x53')){var _0x10e82a=_0x23dc1e[_0x1089('0x2b')]({'plain':!![]});var _0x322a65=_0x1089('0x2c');return db[_0x1089('0x56')]['find']({'where':{'name':_0x322a65,'userProfileId':_0x3a6301['userProfileId']},'raw':!![]})[_0x1089('0x29')](function(_0x1b0c3b){if(_0x1b0c3b&&_0x1b0c3b[_0x1089('0x57')]===0x0){return db[_0x1089('0x58')][_0x1089('0x51')]({'name':_0x10e82a[_0x1089('0x2f')],'resourceId':_0x10e82a['id'],'type':_0x1b0c3b[_0x1089('0x2f')],'sectionId':_0x1b0c3b['id']},{})[_0x1089('0x29')](function(){return _0x23dc1e;});}else{return _0x23dc1e;}})[_0x1089('0x4d')](function(_0x12ef50){logger[_0x1089('0x2d')](_0x1089('0x59'),_0x12ef50);throw _0x12ef50;});}return _0x23dc1e;})[_0x1089('0x29')](respondWithResult(_0x5ef0ca,0xc9))['catch'](handleError(_0x5ef0ca,null));};exports[_0x1089('0x28')]=function(_0x5be946,_0x55cde0){if(_0x5be946[_0x1089('0x52')]['id']){delete _0x5be946['body']['id'];}return db[_0x1089('0x33')][_0x1089('0x50')]({'where':{'id':_0x5be946['params']['id']}})[_0x1089('0x29')](handleEntityNotFound(_0x55cde0,null))[_0x1089('0x29')](saveUpdates(_0x5be946[_0x1089('0x52')],null))[_0x1089('0x29')](respondWithResult(_0x55cde0,null))[_0x1089('0x4d')](handleError(_0x55cde0,null));};exports['destroy']=function(_0xbab52f,_0x24c8a9){return db[_0x1089('0x33')][_0x1089('0x50')]({'where':{'id':_0xbab52f[_0x1089('0x4f')]['id']}})['then'](handleEntityNotFound(_0x24c8a9,null))[_0x1089('0x29')](removeEntity(_0x24c8a9,null))[_0x1089('0x4d')](handleError(_0x24c8a9,null));};exports[_0x1089('0x5a')]=function(_0xc44ed6,_0x5ec574,_0x1d9136){return db[_0x1089('0x33')][_0x1089('0x50')]({'where':{'id':_0xc44ed6[_0x1089('0x4f')]['id']}})[_0x1089('0x29')](handleEntityNotFound(_0x5ec574,null))[_0x1089('0x29')](function(_0x2e8e21){if(_0x2e8e21){return _0x2e8e21[_0x1089('0x5a')](_0xc44ed6[_0x1089('0x52')]['ids'],_['omit'](_0xc44ed6[_0x1089('0x52')],[_0x1089('0x5b'),'id'])||{});}})['then'](respondWithResult(_0x5ec574,null))[_0x1089('0x4d')](handleError(_0x5ec574,null));};exports[_0x1089('0x5c')]=function(_0x3b49fe,_0x26d238,_0x5000cd){return db['SquareProject']['find']({'where':{'id':_0x3b49fe[_0x1089('0x4f')]['id']}})[_0x1089('0x29')](handleEntityNotFound(_0x26d238,null))[_0x1089('0x29')](function(_0x482770){if(_0x482770){return _0x482770[_0x1089('0x5c')](_0x3b49fe[_0x1089('0x39')]['ids'])[_0x1089('0x29')](function(){if(_[_0x1089('0x5d')](_0x3b49fe[_0x1089('0x39')][_0x1089('0x5b')])){for(var _0x2faad1=0x0;_0x2faad1<_0x3b49fe[_0x1089('0x39')]['ids']['length'];_0x2faad1+=0x1){socket[_0x1089('0x5e')]('userSquareProject:remove',{'UserId':Number(_0x3b49fe[_0x1089('0x39')][_0x1089('0x5b')][_0x2faad1]),'SquareProjectId':Number(_0x3b49fe['params']['id'])});}}else{socket[_0x1089('0x5e')]('userSquareProject:remove',{'UserId':Number(_0x3b49fe['query'][_0x1089('0x5b')]),'SquareProjectId':Number(_0x3b49fe['params']['id'])});}});}})[_0x1089('0x29')](respondWithStatusCode(_0x26d238,null))[_0x1089('0x4d')](handleError(_0x26d238,null));};exports['getUsers']=function(_0x1878a1,_0x123fcd,_0x164bd2){var _0x49e315={};var _0x4c7a83={};var _0x17a1dd;var _0x55fa1a;return db[_0x1089('0x33')][_0x1089('0x5f')]({'where':{'id':_0x1878a1['params']['id']}})['then'](handleEntityNotFound(_0x123fcd,null))[_0x1089('0x29')](function(_0x288617){if(_0x288617){_0x17a1dd=_0x288617;_0x4c7a83[_0x1089('0x38')]=_[_0x1089('0x3a')](db[_0x1089('0x60')]['rawAttributes']);_0x4c7a83[_0x1089('0x39')]=_[_0x1089('0x3a')](_0x1878a1[_0x1089('0x39')]);_0x4c7a83[_0x1089('0x3b')]=_['intersection'](_0x4c7a83[_0x1089('0x38')],_0x4c7a83[_0x1089('0x39')]);_0x49e315[_0x1089('0x3d')]=_['intersection'](_0x4c7a83[_0x1089('0x38')],qs[_0x1089('0x3e')](_0x1878a1[_0x1089('0x39')][_0x1089('0x3e')]));_0x49e315[_0x1089('0x3d')]=_0x49e315[_0x1089('0x3d')][_0x1089('0x3f')]?_0x49e315[_0x1089('0x3d')]:_0x4c7a83[_0x1089('0x38')];_0x49e315[_0x1089('0x42')]=qs[_0x1089('0x43')](_0x1878a1['query'][_0x1089('0x43')]);_0x49e315[_0x1089('0x44')]=qs[_0x1089('0x3b')](_[_0x1089('0x45')](_0x1878a1[_0x1089('0x39')],_0x4c7a83[_0x1089('0x3b')]));if(_0x1878a1['query'][_0x1089('0x46')]){_0x49e315['where']=_[_0x1089('0x47')](_0x49e315['where'],{'$or':_[_0x1089('0x32')](_0x49e315['attributes'],function(_0x5231de){var _0x3f2855={};_0x3f2855[_0x5231de]={'$like':'%'+_0x1878a1['query']['filter']+'%'};return _0x3f2855;})});}_0x49e315=_[_0x1089('0x47')]({},_0x49e315,_0x1878a1[_0x1089('0x49')]);return _0x17a1dd[_0x1089('0x61')](_0x49e315);}})[_0x1089('0x29')](function(_0x5272a7){if(_0x5272a7){_0x55fa1a=_0x5272a7['length'];if(!_0x1878a1[_0x1089('0x39')][_0x1089('0x40')](_0x1089('0x41'))){_0x49e315[_0x1089('0x21')]=qs[_0x1089('0x21')](_0x1878a1[_0x1089('0x39')][_0x1089('0x21')]);_0x49e315['offset']=qs[_0x1089('0x1f')](_0x1878a1[_0x1089('0x39')]['offset']);}return _0x17a1dd[_0x1089('0x61')](_0x49e315);}})['then'](function(_0x5903b7){if(_0x5903b7){return _0x5903b7?{'count':_0x55fa1a,'rows':_0x5903b7}:null;}})[_0x1089('0x29')](respondWithResult(_0x123fcd,null))['catch'](handleError(_0x123fcd,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index caad31d..c001bf8 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 _0xce97=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','save','update','remove'];(function(_0x3c21f2,_0x346ffe){var _0xfcaca9=function(_0x15fbee){while(--_0x15fbee){_0x3c21f2['push'](_0x3c21f2['shift']());}};_0xfcaca9(++_0x346ffe);}(_0xce97,0x70));var _0x7ce9=function(_0x5c2e53,_0x2f26a7){_0x5c2e53=_0x5c2e53-0x0;var _0x3d9efb=_0xce97[_0x5c2e53];return _0x3d9efb;};'use strict';var EventEmitter=require(_0x7ce9('0x0'));var SquareProject=require(_0x7ce9('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7ce9('0x2'),'afterUpdate':_0x7ce9('0x3'),'afterDestroy':_0x7ce9('0x4')};function emitEvent(_0x5c3dfd){return function(_0x343d86,_0x17f073,_0x3d30){SquareProjectEvents[_0x7ce9('0x5')](_0x5c3dfd+':'+_0x343d86['id'],_0x343d86);SquareProjectEvents['emit'](_0x5c3dfd,_0x343d86);_0x3d30(null);};}for(var e in events){if(events[_0x7ce9('0x6')](e)){var event=events[e];SquareProject[_0x7ce9('0x7')](e,emitEvent(event));}}module[_0x7ce9('0x8')]=SquareProjectEvents; \ No newline at end of file +var _0x1cd7=['SquareProject','setMaxListeners','save','remove','emit','hasOwnProperty','hook','events'];(function(_0x340380,_0x4bd2a8){var _0x49ce1c=function(_0x4cb9e2){while(--_0x4cb9e2){_0x340380['push'](_0x340380['shift']());}};_0x49ce1c(++_0x4bd2a8);}(_0x1cd7,0x77));var _0x71cd=function(_0x1b6e03,_0x47421c){_0x1b6e03=_0x1b6e03-0x0;var _0x5b53ff=_0x1cd7[_0x1b6e03];return _0x5b53ff;};'use strict';var EventEmitter=require(_0x71cd('0x0'));var SquareProject=require('../../mysqldb')['db'][_0x71cd('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x71cd('0x2')](0x0);var events={'afterCreate':_0x71cd('0x3'),'afterUpdate':'update','afterDestroy':_0x71cd('0x4')};function emitEvent(_0x5b9631){return function(_0x2112a0,_0x43ad8b,_0x565472){SquareProjectEvents[_0x71cd('0x5')](_0x5b9631+':'+_0x2112a0['id'],_0x2112a0);SquareProjectEvents[_0x71cd('0x5')](_0x5b9631,_0x2112a0);_0x565472(null);};}for(var e in events){if(events[_0x71cd('0x6')](e)){var event=events[e];SquareProject[_0x71cd('0x7')](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index a87b93d..95d1d43 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 _0x062b=['rimraf','../../config/environment','./squareProject.attributes','exports','SquareProject','preproduction','YYYY-MM-DD\x20HH:mm:ss','production','format','../../config/logger','moment'];(function(_0x48db93,_0x42c34b){var _0x2907bd=function(_0x2a4da2){while(--_0x2a4da2){_0x48db93['push'](_0x48db93['shift']());}};_0x2907bd(++_0x42c34b);}(_0x062b,0x13d));var _0xb062=function(_0x32f574,_0x151623){_0x32f574=_0x32f574-0x0;var _0x16662f=_0x062b[_0x32f574];return _0x16662f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb062('0x0'))('api');var moment=require(_0xb062('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb062('0x2'));var config=require(_0xb062('0x3'));var attributes=require(_0xb062('0x4'));module[_0xb062('0x5')]=function(_0x37298e,_0xd772af){return _0x37298e['define'](_0xb062('0x6'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2be452,_0x2afba4,_0xfef870){if(_0x2be452['changed'](_0xb062('0x7'))){_0x2be452['savedAt']=moment()['format'](_0xb062('0x8'));}if(_0x2be452['changed'](_0xb062('0x9'))){_0x2be452['publishedAt']=moment()[_0xb062('0xa')](_0xb062('0x8'));}_0xfef870(null,_0x2be452);}}});}; \ No newline at end of file +var _0x17b0=['changed','production','YYYY-MM-DD\x20HH:mm:ss','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareProject.attributes','define','SquareProject','square_projects','preproduction','savedAt','format'];(function(_0x5f46e7,_0x62f9f8){var _0x567e95=function(_0x5cb693){while(--_0x5cb693){_0x5f46e7['push'](_0x5f46e7['shift']());}};_0x567e95(++_0x62f9f8);}(_0x17b0,0xdb));var _0x017b=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x17b0[_0x6131cd];return _0x47e916;};'use strict';var _=require('lodash');var util=require(_0x017b('0x0'));var logger=require('../../config/logger')(_0x017b('0x1'));var moment=require(_0x017b('0x2'));var BPromise=require(_0x017b('0x3'));var rp=require(_0x017b('0x4'));var fs=require('fs');var path=require(_0x017b('0x5'));var rimraf=require(_0x017b('0x6'));var config=require(_0x017b('0x7'));var attributes=require(_0x017b('0x8'));module['exports']=function(_0x268efe,_0x3cfede){return _0x268efe[_0x017b('0x9')](_0x017b('0xa'),attributes,{'tableName':_0x017b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xb23f36,_0x2f5869,_0x100fdd){if(_0xb23f36['changed'](_0x017b('0xc'))){_0xb23f36[_0x017b('0xd')]=moment()[_0x017b('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0xb23f36[_0x017b('0xf')](_0x017b('0x10'))){_0xb23f36['publishedAt']=moment()[_0x017b('0xe')](_0x017b('0x11'));}_0x100fdd(null,_0xb23f36);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 8308645..76164b3 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 _0xd6d3=['SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','ShowSquareProject','SquareProject','find','options','raw','include','model','attributes','map','lodash','util','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','client','http','localhost','redis','register','request','then','info','SquareProject,\x20%s,\x20%s','request\x20sent'];(function(_0x375800,_0x55e55f){var _0x36d0ea=function(_0x456c7c){while(--_0x456c7c){_0x375800['push'](_0x375800['shift']());}};_0x36d0ea(++_0x55e55f);}(_0xd6d3,0x163));var _0x3d6d=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xd6d3[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x3d6d('0x0'));var util=require(_0x3d6d('0x1'));var moment=require('moment');var BPromise=require(_0x3d6d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3d6d('0x3'));var db=require(_0x3d6d('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3d6d('0x5'));var config=require(_0x3d6d('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3d6d('0x7')][_0x3d6d('0x8')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x3d6d('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3d6d('0xa')]));require('./squareProject.socket')[_0x3d6d('0xb')](socket);function respondWithRpcPromise(_0x18917a,_0x3c2889,_0x43941f){return new BPromise(function(_0x5b3972,_0xb682d8){return client[_0x3d6d('0xc')](_0x18917a,_0x43941f)[_0x3d6d('0xd')](function(_0x29b779){logger[_0x3d6d('0xe')](_0x3d6d('0xf'),_0x3c2889,_0x3d6d('0x10'));logger['debug'](_0x3d6d('0x11'),_0x3c2889,_0x3d6d('0x10'),JSON[_0x3d6d('0x12')](_0x29b779));if(_0x29b779[_0x3d6d('0x13')]){if(_0x29b779[_0x3d6d('0x13')]['code']===0x1f4){logger[_0x3d6d('0x13')](_0x3d6d('0xf'),_0x3c2889,_0x29b779[_0x3d6d('0x13')][_0x3d6d('0x14')]);return _0xb682d8(_0x29b779[_0x3d6d('0x13')][_0x3d6d('0x14')]);}logger[_0x3d6d('0x13')]('SquareProject,\x20%s,\x20%s',_0x3c2889,_0x29b779[_0x3d6d('0x13')]['message']);return _0x5b3972(_0x29b779[_0x3d6d('0x13')][_0x3d6d('0x14')]);}else{logger[_0x3d6d('0xe')](_0x3d6d('0xf'),_0x3c2889,_0x3d6d('0x10'));_0x5b3972(_0x29b779['result'][_0x3d6d('0x14')]);}})[_0x3d6d('0x15')](function(_0x28e319){logger[_0x3d6d('0x13')]('SquareProject,\x20%s,\x20%s',_0x3c2889,_0x28e319);_0xb682d8(_0x28e319);});});}exports[_0x3d6d('0x16')]=function(_0x374e1c){var _0xf0bcb3=this;return new Promise(function(_0x3a3ba6,_0x409d98){return db[_0x3d6d('0x17')][_0x3d6d('0x18')]({'raw':_0x374e1c[_0x3d6d('0x19')]?_0x374e1c[_0x3d6d('0x19')][_0x3d6d('0x1a')]===undefined?!![]:![]:!![],'where':_0x374e1c[_0x3d6d('0x19')]?_0x374e1c[_0x3d6d('0x19')]['where']||null:null,'attributes':_0x374e1c[_0x3d6d('0x19')]?_0x374e1c['options']['attributes']||null:null,'include':_0x374e1c[_0x3d6d('0x19')]?_0x374e1c['options'][_0x3d6d('0x1b')]?_['map'](_0x374e1c[_0x3d6d('0x19')]['include'],function(_0x4bd7b9){return{'model':db[_0x4bd7b9[_0x3d6d('0x1c')]],'as':_0x4bd7b9['as'],'attributes':_0x4bd7b9[_0x3d6d('0x1d')],'include':_0x4bd7b9[_0x3d6d('0x1b')]?_[_0x3d6d('0x1e')](_0x4bd7b9['include'],function(_0x217de4){return{'model':db[_0x217de4[_0x3d6d('0x1c')]],'as':_0x217de4['as'],'attributes':_0x217de4[_0x3d6d('0x1d')],'include':_0x217de4['include']?_[_0x3d6d('0x1e')](_0x217de4[_0x3d6d('0x1b')],function(_0x2777ff){return{'model':db[_0x2777ff[_0x3d6d('0x1c')]],'as':_0x2777ff['as'],'attributes':_0x2777ff[_0x3d6d('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x26aab6){logger[_0x3d6d('0xe')](_0x3d6d('0x16'),_0x374e1c);logger['debug'](_0x3d6d('0x16'),_0x374e1c,JSON['stringify'](_0x26aab6));_0x3a3ba6(_0x26aab6);})[_0x3d6d('0x15')](function(_0x4dc79c){logger[_0x3d6d('0x13')](_0x3d6d('0x16'),_0x4dc79c[_0x3d6d('0x14')],_0x374e1c);_0x409d98(_0xf0bcb3[_0x3d6d('0x13')](0x1f4,_0x4dc79c[_0x3d6d('0x14')]));});});}; \ No newline at end of file +var _0xf161=['register','request','then','info','SquareProject,\x20%s,\x20%s','request\x20sent','SquareProject,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowSquareProject','SquareProject','find','options','raw','attributes','include','model','map','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./squareProject.socket'];(function(_0x325501,_0x5242f6){var _0x2c1626=function(_0x4270b2){while(--_0x4270b2){_0x325501['push'](_0x325501['shift']());}};_0x2c1626(++_0x5242f6);}(_0xf161,0x8b));var _0x1f16=function(_0x5cbf0e,_0x4cd140){_0x5cbf0e=_0x5cbf0e-0x0;var _0x1c76f8=_0xf161[_0x5cbf0e];return _0x1c76f8;};'use strict';var _=require(_0x1f16('0x0'));var util=require(_0x1f16('0x1'));var moment=require(_0x1f16('0x2'));var BPromise=require(_0x1f16('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1f16('0x4'));var db=require(_0x1f16('0x5'))['db'];var utils=require(_0x1f16('0x6'));var logger=require('../../config/logger')(_0x1f16('0x7'));var config=require(_0x1f16('0x8'));var jayson=require(_0x1f16('0x9'));var client=jayson[_0x1f16('0xa')][_0x1f16('0xb')]({'port':0x232a});config[_0x1f16('0xc')]=_[_0x1f16('0xd')](config['redis'],{'host':_0x1f16('0xe'),'port':0x18eb});var socket=require(_0x1f16('0xf'))(new Redis(config[_0x1f16('0xc')]));require(_0x1f16('0x10'))[_0x1f16('0x11')](socket);function respondWithRpcPromise(_0x52399c,_0x2986a3,_0x4486c0){return new BPromise(function(_0x158e38,_0x4dff13){return client[_0x1f16('0x12')](_0x52399c,_0x4486c0)[_0x1f16('0x13')](function(_0x3b1ecc){logger[_0x1f16('0x14')](_0x1f16('0x15'),_0x2986a3,_0x1f16('0x16'));logger['debug'](_0x1f16('0x17'),_0x2986a3,_0x1f16('0x16'),JSON['stringify'](_0x3b1ecc));if(_0x3b1ecc[_0x1f16('0x18')]){if(_0x3b1ecc[_0x1f16('0x18')][_0x1f16('0x19')]===0x1f4){logger[_0x1f16('0x18')](_0x1f16('0x15'),_0x2986a3,_0x3b1ecc[_0x1f16('0x18')]['message']);return _0x4dff13(_0x3b1ecc[_0x1f16('0x18')][_0x1f16('0x1a')]);}logger[_0x1f16('0x18')]('SquareProject,\x20%s,\x20%s',_0x2986a3,_0x3b1ecc['error'][_0x1f16('0x1a')]);return _0x158e38(_0x3b1ecc[_0x1f16('0x18')]['message']);}else{logger[_0x1f16('0x14')]('SquareProject,\x20%s,\x20%s',_0x2986a3,'request\x20sent');_0x158e38(_0x3b1ecc[_0x1f16('0x1b')][_0x1f16('0x1a')]);}})[_0x1f16('0x1c')](function(_0xdfc874){logger[_0x1f16('0x18')](_0x1f16('0x15'),_0x2986a3,_0xdfc874);_0x4dff13(_0xdfc874);});});}exports[_0x1f16('0x1d')]=function(_0x34c2f9){var _0x8ab3a7=this;return new Promise(function(_0x55fa76,_0x32bf41){return db[_0x1f16('0x1e')][_0x1f16('0x1f')]({'raw':_0x34c2f9[_0x1f16('0x20')]?_0x34c2f9[_0x1f16('0x20')][_0x1f16('0x21')]===undefined?!![]:![]:!![],'where':_0x34c2f9[_0x1f16('0x20')]?_0x34c2f9[_0x1f16('0x20')]['where']||null:null,'attributes':_0x34c2f9[_0x1f16('0x20')]?_0x34c2f9[_0x1f16('0x20')][_0x1f16('0x22')]||null:null,'include':_0x34c2f9['options']?_0x34c2f9[_0x1f16('0x20')]['include']?_['map'](_0x34c2f9[_0x1f16('0x20')][_0x1f16('0x23')],function(_0x444293){return{'model':db[_0x444293[_0x1f16('0x24')]],'as':_0x444293['as'],'attributes':_0x444293[_0x1f16('0x22')],'include':_0x444293[_0x1f16('0x23')]?_[_0x1f16('0x25')](_0x444293['include'],function(_0x39cf2c){return{'model':db[_0x39cf2c[_0x1f16('0x24')]],'as':_0x39cf2c['as'],'attributes':_0x39cf2c[_0x1f16('0x22')],'include':_0x39cf2c[_0x1f16('0x23')]?_[_0x1f16('0x25')](_0x39cf2c[_0x1f16('0x23')],function(_0x4b8065){return{'model':db[_0x4b8065['model']],'as':_0x4b8065['as'],'attributes':_0x4b8065[_0x1f16('0x22')]};}):[]};}):[]};}):[]:[]})[_0x1f16('0x13')](function(_0x417251){logger[_0x1f16('0x14')](_0x1f16('0x1d'),_0x34c2f9);logger[_0x1f16('0x26')]('ShowSquareProject',_0x34c2f9,JSON['stringify'](_0x417251));_0x55fa76(_0x417251);})['catch'](function(_0x368576){logger[_0x1f16('0x18')](_0x1f16('0x1d'),_0x368576['message'],_0x34c2f9);_0x32bf41(_0x8ab3a7['error'](0x1f4,_0x368576['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 0c70c9d..d4df47f 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 _0x085f=['register','length','squareProject:','./squareProject.events','remove','update','emit'];(function(_0x5d26cd,_0x5dd655){var _0x20c253=function(_0x2d3d7d){while(--_0x2d3d7d){_0x5d26cd['push'](_0x5d26cd['shift']());}};_0x20c253(++_0x5dd655);}(_0x085f,0x7a));var _0xf085=function(_0x832bbc,_0x1e3e13){_0x832bbc=_0x832bbc-0x0;var _0x5d92f3=_0x085f[_0x832bbc];return _0x5d92f3;};'use strict';var SquareProjectEvents=require(_0xf085('0x0'));var events=['save',_0xf085('0x1'),_0xf085('0x2')];function createListener(_0x48a7c2,_0x212937){return function(_0x239170){_0x212937[_0xf085('0x3')](_0x48a7c2,_0x239170);};}function removeListener(_0x3812f1,_0x4a9a98){return function(){SquareProjectEvents['removeListener'](_0x3812f1,_0x4a9a98);};}exports[_0xf085('0x4')]=function(_0x3e8770){for(var _0x427528=0x0,_0x455480=events[_0xf085('0x5')];_0x427528<_0x455480;_0x427528++){var _0x40130a=events[_0x427528];var _0x31a1db=createListener(_0xf085('0x6')+_0x40130a,_0x3e8770);SquareProjectEvents['on'](_0x40130a,_0x31a1db);}}; \ No newline at end of file +var _0xa291=['removeListener','squareProject:','save','remove','update','emit'];(function(_0x35ad95,_0x161806){var _0x2fb9f0=function(_0x18ee02){while(--_0x18ee02){_0x35ad95['push'](_0x35ad95['shift']());}};_0x2fb9f0(++_0x161806);}(_0xa291,0x122));var _0x1a29=function(_0x16db8b,_0xca7d28){_0x16db8b=_0x16db8b-0x0;var _0x5ba017=_0xa291[_0x16db8b];return _0x5ba017;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0x1a29('0x0'),_0x1a29('0x1'),_0x1a29('0x2')];function createListener(_0x28359d,_0x310488){return function(_0x41dce9){_0x310488[_0x1a29('0x3')](_0x28359d,_0x41dce9);};}function removeListener(_0x1d70ed,_0x59a6cd){return function(){SquareProjectEvents[_0x1a29('0x4')](_0x1d70ed,_0x59a6cd);};}exports['register']=function(_0x3068fb){for(var _0x566011=0x0,_0x59114c=events['length'];_0x566011<_0x59114c;_0x566011++){var _0x27f535=events[_0x566011];var _0x204cdd=createListener(_0x1a29('0x5')+_0x27f535,_0x3068fb);SquareProjectEvents['on'](_0x27f535,_0x204cdd);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 5973b19..c70e6e1 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 _0x7a54=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','index','/:id','isAuthenticated','post','put','update','delete','destroy','exports','multer','util','path','express'];(function(_0x3741d2,_0x223f55){var _0x5b1c7b=function(_0x44311c){while(--_0x44311c){_0x3741d2['push'](_0x3741d2['shift']());}};_0x5b1c7b(++_0x223f55);}(_0x7a54,0x106));var _0x47a5=function(_0x135c13,_0x1a0f80){_0x135c13=_0x135c13-0x0;var _0x31a43f=_0x7a54[_0x135c13];return _0x31a43f;};'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('0x9')]('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0x47a5('0xd')]('/',auth[_0x47a5('0xc')](),controller['create']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);module[_0x47a5('0x12')]=router; \ No newline at end of file +var _0x814b=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','/:id','show','/:id/download','download','post','create','put','delete','destroy','exports'];(function(_0x1bbbea,_0x3528fb){var _0x5493e6=function(_0x255743){while(--_0x255743){_0x1bbbea['push'](_0x1bbbea['shift']());}};_0x5493e6(++_0x3528fb);}(_0x814b,0x1a2));var _0xb814=function(_0x18032f,_0x4f4e45){_0x18032f=_0x18032f-0x0;var _0xb0b2b8=_0x814b[_0x18032f];return _0xb0b2b8;};'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('0x10')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0x12')](_0xb814('0xc'),auth[_0xb814('0xb')](),controller['update']);router[_0xb814('0x13')]('/:id',auth[_0xb814('0xb')](),controller[_0xb814('0x14')]);module[_0xb814('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index e066bc9..4cc5ab4 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 _0xdc97=['savePath','substring','lastIndexOf','sequelize','exports','STRING','VIRTUAL','getDataValue'];(function(_0x350343,_0x256f69){var _0x9afc1c=function(_0x47ab32){while(--_0x47ab32){_0x350343['push'](_0x350343['shift']());}};_0x9afc1c(++_0x256f69);}(_0xdc97,0x13b));var _0x7dc9=function(_0x2e5209,_0x4f1971){_0x2e5209=_0x2e5209-0x0;var _0x1b1560=_0xdc97[_0x2e5209];return _0x1b1560;};'use strict';var Sequelize=require(_0x7dc9('0x0'));module[_0x7dc9('0x1')]={'uniqueid':{'type':Sequelize[_0x7dc9('0x2')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x7dc9('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x7dc9('0x2')]},'priority':{'type':Sequelize[_0x7dc9('0x2')]},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x7dc9('0x2')]},'projectName':{'type':Sequelize[_0x7dc9('0x2')]},'saveName':{'type':Sequelize[_0x7dc9('0x2')]},'filename':{'type':Sequelize[_0x7dc9('0x2')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x7dc9('0x3')],'get':function(){var _0x4f91c7='';var _0x4b3229=this[_0x7dc9('0x4')](_0x7dc9('0x5'));if(_0x4b3229){_0x4f91c7=_0x4b3229[_0x7dc9('0x6')](_0x4b3229[_0x7dc9('0x7')]('.'));}return _0x4f91c7;}}}; \ No newline at end of file +var _0xb458=['sequelize','exports','STRING','VIRTUAL','getDataValue','substring','lastIndexOf'];(function(_0x156e55,_0x17d429){var _0x552ad5=function(_0x2f2a24){while(--_0x2f2a24){_0x156e55['push'](_0x156e55['shift']());}};_0x552ad5(++_0x17d429);}(_0xb458,0x103));var _0x8b45=function(_0x59c7e5,_0x41c52f){_0x59c7e5=_0x59c7e5-0x0;var _0x1a353d=_0xb458[_0x59c7e5];return _0x1a353d;};'use strict';var Sequelize=require(_0x8b45('0x0'));module[_0x8b45('0x1')]={'uniqueid':{'type':Sequelize[_0x8b45('0x2')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x8b45('0x2')]},'extension':{'type':Sequelize[_0x8b45('0x2')]},'priority':{'type':Sequelize[_0x8b45('0x2')]},'accountcode':{'type':Sequelize[_0x8b45('0x2')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0x8b45('0x2')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize[_0x8b45('0x2')]},'format':{'type':Sequelize[_0x8b45('0x3')],'get':function(){var _0x2daa9a='';var _0x3a8ccb=this[_0x8b45('0x4')]('savePath');if(_0x3a8ccb){_0x2daa9a=_0x3a8ccb[_0x8b45('0x5')](_0x3a8ccb[_0x8b45('0x6')]('.'));}return _0x2daa9a;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 6bada1c..82a99a3 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 _0x40ff=['unlinkSync','.cypher','eml-format','rimraf','zip-dir','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','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','map','SquareRecording','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','update','body','download','type','uniqueid','savePath','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','filename','extname','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione'];(function(_0x1e6ffa,_0x1bdbdf){var _0x42ac38=function(_0x2cee45){while(--_0x2cee45){_0x1e6ffa['push'](_0x1e6ffa['shift']());}};_0x42ac38(++_0x1bdbdf);}(_0x40ff,0xc8));var _0xf40f=function(_0xbafd40,_0x84ce0f){_0xbafd40=_0xbafd40-0x0;var _0x41e50c=_0x40ff[_0xbafd40];return _0x41e50c;};'use strict';var emlformat=require(_0xf40f('0x0'));var rimraf=require(_0xf40f('0x1'));var zipdir=require(_0xf40f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf40f('0x3'));var moment=require(_0xf40f('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf40f('0x5'));var path=require('path');var sox=require(_0xf40f('0x6'));var csv=require(_0xf40f('0x7'));var ejs=require(_0xf40f('0x8'));var fs=require('fs');var fs_extra=require(_0xf40f('0x9'));var _=require(_0xf40f('0xa'));var squel=require(_0xf40f('0xb'));var crypto=require(_0xf40f('0xc'));var jsforce=require(_0xf40f('0xd'));var deskjs=require(_0xf40f('0xe'));var toCsv=require(_0xf40f('0x7'));var querystring=require(_0xf40f('0xf'));var Papa=require('papaparse');var Redis=require(_0xf40f('0x10'));var authService=require(_0xf40f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xf40f('0x12'));var hardwareService=require(_0xf40f('0x13'));var logger=require('../../config/logger')(_0xf40f('0x14'));var utils=require(_0xf40f('0x15'));var config=require(_0xf40f('0x16'));var licenseUtil=require(_0xf40f('0x17'));var db=require(_0xf40f('0x18'))['db'];function respondWithStatusCode(_0x46ea3c,_0x39bac7){_0x39bac7=_0x39bac7||0xcc;return function(_0x3ca9bc){if(_0x3ca9bc){return _0x46ea3c[_0xf40f('0x19')](_0x39bac7);}return _0x46ea3c[_0xf40f('0x1a')](_0x39bac7)[_0xf40f('0x1b')]();};}function respondWithResult(_0x1cea01,_0x4f01c6){_0x4f01c6=_0x4f01c6||0xc8;return function(_0x5b5f80){if(_0x5b5f80){return _0x1cea01[_0xf40f('0x1a')](_0x4f01c6)[_0xf40f('0x1c')](_0x5b5f80);}};}function respondWithFilteredResult(_0xd3f7a7,_0x1614e9){return function(_0x3bbbec){if(_0x3bbbec){var _0x240d0e=typeof _0x1614e9[_0xf40f('0x1d')]===_0xf40f('0x1e')&&typeof _0x1614e9[_0xf40f('0x1f')]==='undefined';var _0x2c14e0=_0x3bbbec['count'];var _0x5e443d=_0x240d0e?0x0:_0x1614e9['offset'];var _0x3c2859=_0x240d0e?_0x3bbbec[_0xf40f('0x20')]:_0x1614e9[_0xf40f('0x1d')]+_0x1614e9['limit'];var _0xcc0769;if(_0x3c2859>=_0x2c14e0){_0x3c2859=_0x2c14e0;_0xcc0769=0xc8;}else{_0xcc0769=0xce;}_0xd3f7a7[_0xf40f('0x1a')](_0xcc0769);return _0xd3f7a7[_0xf40f('0x21')](_0xf40f('0x22'),_0x5e443d+'-'+_0x3c2859+'/'+_0x2c14e0)['json'](_0x3bbbec);}return null;};}function patchUpdates(_0x5bcf19){return function(_0x1335f2){try{jsonpatch[_0xf40f('0x23')](_0x1335f2,_0x5bcf19,!![]);}catch(_0x3cf8b3){return BPromise[_0xf40f('0x24')](_0x3cf8b3);}return _0x1335f2[_0xf40f('0x25')]();};}function saveUpdates(_0x3eff25,_0x59b9ce){return function(_0x377f1f){if(_0x377f1f){return _0x377f1f['update'](_0x3eff25)[_0xf40f('0x26')](function(_0x32ed48){return _0x32ed48;});}return null;};}function removeEntity(_0xaf836a,_0x6b86ba){return function(_0x3b909f){if(_0x3b909f){return _0x3b909f[_0xf40f('0x27')]()[_0xf40f('0x26')](function(){_0xaf836a[_0xf40f('0x1a')](0xcc)[_0xf40f('0x1b')]();});}};}function handleEntityNotFound(_0x17f231,_0x4dcc66){return function(_0x145a6b){if(!_0x145a6b){_0x17f231[_0xf40f('0x19')](0x194);}return _0x145a6b;};}function handleError(_0x441afb,_0x43a6f7){_0x43a6f7=_0x43a6f7||0x1f4;return function(_0x2f4f17){logger[_0xf40f('0x28')](_0x2f4f17[_0xf40f('0x29')]);if(_0x2f4f17[_0xf40f('0x2a')]){delete _0x2f4f17['name'];}_0x441afb[_0xf40f('0x1a')](_0x43a6f7)[_0xf40f('0x2b')](_0x2f4f17);};}exports['index']=function(_0x448f88,_0x3d3d64){var _0x439b7d={},_0x1635b9={},_0x4bc19f={'count':0x0,'rows':[]};var _0x362dd=_[_0xf40f('0x2c')](db[_0xf40f('0x2d')][_0xf40f('0x2e')],function(_0x56faa1){return{'name':_0x56faa1[_0xf40f('0x2f')],'type':_0x56faa1['type'][_0xf40f('0x30')]};});_0x1635b9[_0xf40f('0x31')]=_['map'](_0x362dd,_0xf40f('0x2a'));_0x1635b9['query']=_['keys'](_0x448f88[_0xf40f('0x32')]);_0x1635b9['filters']=_[_0xf40f('0x33')](_0x1635b9[_0xf40f('0x31')],_0x1635b9[_0xf40f('0x32')]);_0x439b7d[_0xf40f('0x34')]=_[_0xf40f('0x33')](_0x1635b9[_0xf40f('0x31')],qs[_0xf40f('0x35')](_0x448f88[_0xf40f('0x32')]['fields']));_0x439b7d[_0xf40f('0x34')]=_0x439b7d['attributes'][_0xf40f('0x36')]?_0x439b7d['attributes']:_0x1635b9['model'];if(!_0x448f88[_0xf40f('0x32')][_0xf40f('0x37')]('nolimit')){_0x439b7d['limit']=qs[_0xf40f('0x1f')](_0x448f88[_0xf40f('0x32')][_0xf40f('0x1f')]);_0x439b7d[_0xf40f('0x1d')]=qs[_0xf40f('0x1d')](_0x448f88[_0xf40f('0x32')][_0xf40f('0x1d')]);}_0x439b7d[_0xf40f('0x38')]=qs[_0xf40f('0x39')](_0x448f88[_0xf40f('0x32')][_0xf40f('0x39')]);_0x439b7d[_0xf40f('0x3a')]=qs[_0xf40f('0x3b')](_[_0xf40f('0x3c')](_0x448f88[_0xf40f('0x32')],_0x1635b9['filters']),_0x362dd);if(_0x448f88[_0xf40f('0x32')][_0xf40f('0x3d')]){_0x439b7d[_0xf40f('0x3a')]=_['merge'](_0x439b7d[_0xf40f('0x3a')],{'$or':_[_0xf40f('0x2c')](_0x362dd,function(_0xed7b20){if(_0xed7b20['type']!==_0xf40f('0x3e')){var _0x592507={};_0x592507[_0xed7b20['name']]={'$like':'%'+_0x448f88[_0xf40f('0x32')]['filter']+'%'};return _0x592507;}})});}_0x439b7d=_[_0xf40f('0x3f')]({},_0x439b7d,_0x448f88[_0xf40f('0x40')]);var _0x2eaa75={'where':_0x439b7d[_0xf40f('0x3a')]};return db[_0xf40f('0x2d')][_0xf40f('0x20')](_0x2eaa75)[_0xf40f('0x26')](function(_0x51cc8a){_0x4bc19f[_0xf40f('0x20')]=_0x51cc8a;if(_0x448f88['query'][_0xf40f('0x41')]){_0x439b7d[_0xf40f('0x42')]=[{'all':!![]}];}return db['SquareRecording'][_0xf40f('0x43')](_0x439b7d);})[_0xf40f('0x26')](function(_0x2289ea){_0x4bc19f[_0xf40f('0x44')]=_0x2289ea;return _0x4bc19f;})[_0xf40f('0x26')](respondWithFilteredResult(_0x3d3d64,_0x439b7d))[_0xf40f('0x45')](handleError(_0x3d3d64,null));};exports[_0xf40f('0x46')]=function(_0x12f09d,_0x335b40){var _0x3f1ffe={'raw':!![],'where':{'id':_0x12f09d[_0xf40f('0x47')]['id']}},_0x521e23={};_0x521e23[_0xf40f('0x31')]=_['keys'](db[_0xf40f('0x2d')][_0xf40f('0x2e')]);_0x521e23[_0xf40f('0x32')]=_[_0xf40f('0x48')](_0x12f09d[_0xf40f('0x32')]);_0x521e23[_0xf40f('0x3b')]=_[_0xf40f('0x33')](_0x521e23[_0xf40f('0x31')],_0x521e23[_0xf40f('0x32')]);_0x3f1ffe['attributes']=_[_0xf40f('0x33')](_0x521e23[_0xf40f('0x31')],qs[_0xf40f('0x35')](_0x12f09d[_0xf40f('0x32')][_0xf40f('0x35')]));_0x3f1ffe[_0xf40f('0x34')]=_0x3f1ffe[_0xf40f('0x34')][_0xf40f('0x36')]?_0x3f1ffe[_0xf40f('0x34')]:_0x521e23[_0xf40f('0x31')];if(_0x12f09d[_0xf40f('0x32')][_0xf40f('0x41')]){_0x3f1ffe['include']=[{'all':!![]}];}_0x3f1ffe=_[_0xf40f('0x3f')]({},_0x3f1ffe,_0x12f09d[_0xf40f('0x40')]);return db['SquareRecording'][_0xf40f('0x49')](_0x3f1ffe)[_0xf40f('0x26')](handleEntityNotFound(_0x335b40,null))[_0xf40f('0x26')](respondWithResult(_0x335b40,null))[_0xf40f('0x45')](handleError(_0x335b40,null));};exports[_0xf40f('0x4a')]=function(_0x3161d7,_0x23597e){return db[_0xf40f('0x2d')]['create'](_0x3161d7['body'],{})[_0xf40f('0x26')](respondWithResult(_0x23597e,0xc9))[_0xf40f('0x45')](handleError(_0x23597e,null));};exports[_0xf40f('0x4b')]=function(_0x306b6b,_0x52c3ac){if(_0x306b6b['body']['id']){delete _0x306b6b[_0xf40f('0x4c')]['id'];}return db[_0xf40f('0x2d')]['find']({'where':{'id':_0x306b6b['params']['id']}})[_0xf40f('0x26')](handleEntityNotFound(_0x52c3ac,null))[_0xf40f('0x26')](saveUpdates(_0x306b6b[_0xf40f('0x4c')],null))['then'](respondWithResult(_0x52c3ac,null))[_0xf40f('0x45')](handleError(_0x52c3ac,null));};exports[_0xf40f('0x4d')]=function(_0x219a41,_0x453681,_0xd0fd0c){var _0x199750=require('../../components/encryptor');var _0x1979bd=![];var _0x423a40={};if(_0x219a41[_0xf40f('0x32')][_0xf40f('0x4e')]&&_0x219a41['query'][_0xf40f('0x4e')]===_0xf40f('0x4f')){_0x423a40[_0xf40f('0x4f')]=_0x219a41[_0xf40f('0x47')]['id'];}else{_0x423a40['id']=_0x219a41['params']['id'];}return db[_0xf40f('0x2d')][_0xf40f('0x49')]({'where':_0x423a40,'attributes':['id',_0xf40f('0x50'),'filename'],'raw':!![]})['then'](handleEntityNotFound(_0x453681,null))['then'](function(_0x4c878e){if(_0x4c878e){var _0xf6049a=_0x4c878e['savePath'];var _0x1ef6f4=util['format']('%s.cypher',_0xf6049a);if(fs[_0xf40f('0x51')](_0x1ef6f4)){_0x1979bd=!![];return _0x199750[_0xf40f('0x52')](_0x1ef6f4,_0xf6049a,config[_0xf40f('0x53')][_0xf40f('0x54')])[_0xf40f('0x26')](function(){return _0x4c878e;});}return _0x4c878e;}})[_0xf40f('0x26')](function(_0x5406f2){if(_0x5406f2){var _0x4e90fc=_0x5406f2['savePath'];if(!fs[_0xf40f('0x51')](_0x4e90fc)){throw new db[(_0xf40f('0x55'))][(_0xf40f('0x56'))]('SquareRecording\x20not\x20found');}if(_0x5406f2[_0xf40f('0x57')]){return _0x453681['download'](_0x4e90fc,_0x5406f2[_0xf40f('0x57')]+path[_0xf40f('0x58')](_0x4e90fc),function(){if(_0x1979bd){fs['unlink'](_0x4e90fc);}});}else{return _0x453681[_0xf40f('0x4d')](_0x4e90fc,function(_0x3a394b){if(_0x1979bd){fs[_0xf40f('0x59')](_0x4e90fc);}});}}})[_0xf40f('0x45')](function(_0x548b39){if(_0x548b39[_0xf40f('0x5a')]==='SquareRecording\x20not\x20found'){_0x453681[_0xf40f('0x1a')](0x194)[_0xf40f('0x2b')](_0xf40f('0x5b'));}else{return handleError(_0x453681,null);}});};exports[_0xf40f('0x27')]=function(_0x290a6b,_0x1ae0d1){return db[_0xf40f('0x2d')][_0xf40f('0x49')]({'where':{'id':_0x290a6b[_0xf40f('0x47')]['id']}})[_0xf40f('0x26')](function(_0x1d8453){if(_[_0xf40f('0x5c')](_0x1d8453)){throw new ReferenceError(_0xf40f('0x5d'));}return _0x1d8453;})[_0xf40f('0x26')](function(_0x37be76){var _0x1806ba=_0x37be76[_0xf40f('0x50')];logger[_0xf40f('0x5e')]('cancellazione\x20fisica\x20documento\x20%s',_0x1806ba);if(!_[_0xf40f('0x5c')](_0x37be76['savePath'])&&fs['existsSync'](_0x1806ba)){logger[_0xf40f('0x5e')](_0xf40f('0x5f')+_0x1806ba+_0xf40f('0x60'));fs[_0xf40f('0x61')](_0x1806ba);}_0x1806ba=_0x1806ba+_0xf40f('0x62');if(!_[_0xf40f('0x5c')](_0x37be76[_0xf40f('0x50')])&&fs[_0xf40f('0x51')](_0x1806ba)){logger[_0xf40f('0x5e')]('File:\x20\x22'+_0x1806ba+_0xf40f('0x60'));fs['unlinkSync'](_0x1806ba);}return _0x37be76;})[_0xf40f('0x26')](function(_0x132875){if(!_0x132875)throw new InternalError();return _0x132875['destroy']();})[_0xf40f('0x26')](function(){_0x1ae0d1[_0xf40f('0x1a')](0xcc)[_0xf40f('0x1b')]();})[_0xf40f('0x45')](handleError(_0x1ae0d1,null));}; \ No newline at end of file +var _0x1daa=['apply','reject','save','update','then','destroy','stack','name','send','index','SquareRecording','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','length','includeAll','create','body','find','download','../../components/encryptor','uniqueid','savePath','filename','format','%s.cypher','existsSync','Sequelize','ValidationError','extname','unlink','message','SquareRecording\x20not\x20found','Not\x20found','Entity\x20not\x20found','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range'];(function(_0x4f0114,_0x1702e8){var _0x1ea795=function(_0x52a6f8){while(--_0x52a6f8){_0x4f0114['push'](_0x4f0114['shift']());}};_0x1ea795(++_0x1702e8);}(_0x1daa,0xf4));var _0xa1da=function(_0x42d35d,_0x33e6fc){_0x42d35d=_0x42d35d-0x0;var _0x445dbc=_0x1daa[_0x42d35d];return _0x445dbc;};'use strict';var emlformat=require(_0xa1da('0x0'));var rimraf=require(_0xa1da('0x1'));var zipdir=require(_0xa1da('0x2'));var jsonpatch=require(_0xa1da('0x3'));var rp=require(_0xa1da('0x4'));var moment=require('moment');var BPromise=require(_0xa1da('0x5'));var Mustache=require(_0xa1da('0x6'));var util=require(_0xa1da('0x7'));var path=require(_0xa1da('0x8'));var sox=require(_0xa1da('0x9'));var csv=require('to-csv');var ejs=require(_0xa1da('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa1da('0xb'));var squel=require(_0xa1da('0xc'));var crypto=require('crypto');var jsforce=require(_0xa1da('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa1da('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa1da('0xf'));var as=require(_0xa1da('0x10'));var hardwareService=require(_0xa1da('0x11'));var logger=require('../../config/logger')(_0xa1da('0x12'));var utils=require('../../config/utils');var config=require(_0xa1da('0x13'));var licenseUtil=require(_0xa1da('0x14'));var db=require(_0xa1da('0x15'))['db'];function respondWithStatusCode(_0x1fbe35,_0x4e3a04){_0x4e3a04=_0x4e3a04||0xcc;return function(_0x354087){if(_0x354087){return _0x1fbe35[_0xa1da('0x16')](_0x4e3a04);}return _0x1fbe35[_0xa1da('0x17')](_0x4e3a04)[_0xa1da('0x18')]();};}function respondWithResult(_0x1ed7d8,_0x12c606){_0x12c606=_0x12c606||0xc8;return function(_0x1cd849){if(_0x1cd849){return _0x1ed7d8[_0xa1da('0x17')](_0x12c606)[_0xa1da('0x19')](_0x1cd849);}};}function respondWithFilteredResult(_0x3835c6,_0x2a636e){return function(_0x171266){if(_0x171266){var _0x39ffaf=typeof _0x2a636e[_0xa1da('0x1a')]===_0xa1da('0x1b')&&typeof _0x2a636e['limit']===_0xa1da('0x1b');var _0x50ccc2=_0x171266[_0xa1da('0x1c')];var _0x113753=_0x39ffaf?0x0:_0x2a636e['offset'];var _0x162da9=_0x39ffaf?_0x171266['count']:_0x2a636e[_0xa1da('0x1a')]+_0x2a636e[_0xa1da('0x1d')];var _0x3af49c;if(_0x162da9>=_0x50ccc2){_0x162da9=_0x50ccc2;_0x3af49c=0xc8;}else{_0x3af49c=0xce;}_0x3835c6['status'](_0x3af49c);return _0x3835c6[_0xa1da('0x1e')](_0xa1da('0x1f'),_0x113753+'-'+_0x162da9+'/'+_0x50ccc2)['json'](_0x171266);}return null;};}function patchUpdates(_0x1cbfa){return function(_0x30304c){try{jsonpatch[_0xa1da('0x20')](_0x30304c,_0x1cbfa,!![]);}catch(_0x294465){return BPromise[_0xa1da('0x21')](_0x294465);}return _0x30304c[_0xa1da('0x22')]();};}function saveUpdates(_0x3bde47,_0xc9cfd5){return function(_0x4260da){if(_0x4260da){return _0x4260da[_0xa1da('0x23')](_0x3bde47)[_0xa1da('0x24')](function(_0xda8af7){return _0xda8af7;});}return null;};}function removeEntity(_0xd09af9,_0x15f7f4){return function(_0x5bbf18){if(_0x5bbf18){return _0x5bbf18[_0xa1da('0x25')]()[_0xa1da('0x24')](function(){_0xd09af9['status'](0xcc)[_0xa1da('0x18')]();});}};}function handleEntityNotFound(_0x3ca0c3,_0xee1d5f){return function(_0x575ea8){if(!_0x575ea8){_0x3ca0c3[_0xa1da('0x16')](0x194);}return _0x575ea8;};}function handleError(_0x31146d,_0x5bf594){_0x5bf594=_0x5bf594||0x1f4;return function(_0x2d42ac){logger['error'](_0x2d42ac[_0xa1da('0x26')]);if(_0x2d42ac[_0xa1da('0x27')]){delete _0x2d42ac[_0xa1da('0x27')];}_0x31146d[_0xa1da('0x17')](_0x5bf594)[_0xa1da('0x28')](_0x2d42ac);};}exports[_0xa1da('0x29')]=function(_0x2affdb,_0x214548){var _0x3798b7={},_0x459db2={},_0x48b94c={'count':0x0,'rows':[]};var _0x1f13ec=_['map'](db[_0xa1da('0x2a')][_0xa1da('0x2b')],function(_0x3afc73){return{'name':_0x3afc73['fieldName'],'type':_0x3afc73[_0xa1da('0x2c')][_0xa1da('0x2d')]};});_0x459db2[_0xa1da('0x2e')]=_[_0xa1da('0x2f')](_0x1f13ec,_0xa1da('0x27'));_0x459db2[_0xa1da('0x30')]=_[_0xa1da('0x31')](_0x2affdb[_0xa1da('0x30')]);_0x459db2[_0xa1da('0x32')]=_[_0xa1da('0x33')](_0x459db2[_0xa1da('0x2e')],_0x459db2[_0xa1da('0x30')]);_0x3798b7[_0xa1da('0x34')]=_[_0xa1da('0x33')](_0x459db2[_0xa1da('0x2e')],qs[_0xa1da('0x35')](_0x2affdb[_0xa1da('0x30')][_0xa1da('0x35')]));_0x3798b7[_0xa1da('0x34')]=_0x3798b7[_0xa1da('0x34')]['length']?_0x3798b7[_0xa1da('0x34')]:_0x459db2[_0xa1da('0x2e')];if(!_0x2affdb['query']['hasOwnProperty'](_0xa1da('0x36'))){_0x3798b7[_0xa1da('0x1d')]=qs[_0xa1da('0x1d')](_0x2affdb[_0xa1da('0x30')][_0xa1da('0x1d')]);_0x3798b7[_0xa1da('0x1a')]=qs[_0xa1da('0x1a')](_0x2affdb[_0xa1da('0x30')]['offset']);}_0x3798b7['order']=qs[_0xa1da('0x37')](_0x2affdb[_0xa1da('0x30')][_0xa1da('0x37')]);_0x3798b7[_0xa1da('0x38')]=qs['filters'](_[_0xa1da('0x39')](_0x2affdb['query'],_0x459db2[_0xa1da('0x32')]),_0x1f13ec);if(_0x2affdb[_0xa1da('0x30')][_0xa1da('0x3a')]){_0x3798b7[_0xa1da('0x38')]=_[_0xa1da('0x3b')](_0x3798b7[_0xa1da('0x38')],{'$or':_['map'](_0x1f13ec,function(_0x53b8d2){if(_0x53b8d2['type']!==_0xa1da('0x3c')){var _0x1c2362={};_0x1c2362[_0x53b8d2[_0xa1da('0x27')]]={'$like':'%'+_0x2affdb[_0xa1da('0x30')][_0xa1da('0x3a')]+'%'};return _0x1c2362;}})});}_0x3798b7=_[_0xa1da('0x3b')]({},_0x3798b7,_0x2affdb[_0xa1da('0x3d')]);var _0x566faf={'where':_0x3798b7['where']};return db[_0xa1da('0x2a')][_0xa1da('0x1c')](_0x566faf)[_0xa1da('0x24')](function(_0x67ace){_0x48b94c[_0xa1da('0x1c')]=_0x67ace;if(_0x2affdb[_0xa1da('0x30')]['includeAll']){_0x3798b7[_0xa1da('0x3e')]=[{'all':!![]}];}return db[_0xa1da('0x2a')][_0xa1da('0x3f')](_0x3798b7);})[_0xa1da('0x24')](function(_0x4c3d25){_0x48b94c['rows']=_0x4c3d25;return _0x48b94c;})[_0xa1da('0x24')](respondWithFilteredResult(_0x214548,_0x3798b7))[_0xa1da('0x40')](handleError(_0x214548,null));};exports[_0xa1da('0x41')]=function(_0x10e248,_0x82229a){var _0x2d5bd6={'raw':!![],'where':{'id':_0x10e248[_0xa1da('0x42')]['id']}},_0x1281fb={};_0x1281fb[_0xa1da('0x2e')]=_['keys'](db['SquareRecording']['rawAttributes']);_0x1281fb['query']=_[_0xa1da('0x31')](_0x10e248[_0xa1da('0x30')]);_0x1281fb['filters']=_[_0xa1da('0x33')](_0x1281fb[_0xa1da('0x2e')],_0x1281fb['query']);_0x2d5bd6['attributes']=_['intersection'](_0x1281fb[_0xa1da('0x2e')],qs[_0xa1da('0x35')](_0x10e248[_0xa1da('0x30')][_0xa1da('0x35')]));_0x2d5bd6[_0xa1da('0x34')]=_0x2d5bd6['attributes'][_0xa1da('0x43')]?_0x2d5bd6['attributes']:_0x1281fb[_0xa1da('0x2e')];if(_0x10e248[_0xa1da('0x30')][_0xa1da('0x44')]){_0x2d5bd6[_0xa1da('0x3e')]=[{'all':!![]}];}_0x2d5bd6=_[_0xa1da('0x3b')]({},_0x2d5bd6,_0x10e248[_0xa1da('0x3d')]);return db[_0xa1da('0x2a')]['find'](_0x2d5bd6)['then'](handleEntityNotFound(_0x82229a,null))['then'](respondWithResult(_0x82229a,null))[_0xa1da('0x40')](handleError(_0x82229a,null));};exports[_0xa1da('0x45')]=function(_0x618a9d,_0x162406){return db[_0xa1da('0x2a')]['create'](_0x618a9d[_0xa1da('0x46')],{})['then'](respondWithResult(_0x162406,0xc9))[_0xa1da('0x40')](handleError(_0x162406,null));};exports[_0xa1da('0x23')]=function(_0xed5a47,_0x40b3ab){if(_0xed5a47['body']['id']){delete _0xed5a47['body']['id'];}return db[_0xa1da('0x2a')][_0xa1da('0x47')]({'where':{'id':_0xed5a47[_0xa1da('0x42')]['id']}})[_0xa1da('0x24')](handleEntityNotFound(_0x40b3ab,null))[_0xa1da('0x24')](saveUpdates(_0xed5a47[_0xa1da('0x46')],null))[_0xa1da('0x24')](respondWithResult(_0x40b3ab,null))[_0xa1da('0x40')](handleError(_0x40b3ab,null));};exports[_0xa1da('0x48')]=function(_0x517b3c,_0x773f70,_0xf6b958){var _0x426e98=require(_0xa1da('0x49'));var _0x2a6a8a=![];var _0x1850b1={};if(_0x517b3c[_0xa1da('0x30')]['type']&&_0x517b3c[_0xa1da('0x30')][_0xa1da('0x2c')]===_0xa1da('0x4a')){_0x1850b1[_0xa1da('0x4a')]=_0x517b3c['params']['id'];}else{_0x1850b1['id']=_0x517b3c[_0xa1da('0x42')]['id'];}return db['SquareRecording'][_0xa1da('0x47')]({'where':_0x1850b1,'attributes':['id',_0xa1da('0x4b'),_0xa1da('0x4c')],'raw':!![]})[_0xa1da('0x24')](handleEntityNotFound(_0x773f70,null))[_0xa1da('0x24')](function(_0x1486f0){if(_0x1486f0){var _0x1c6d49=_0x1486f0[_0xa1da('0x4b')];var _0x16ec08=util[_0xa1da('0x4d')](_0xa1da('0x4e'),_0x1c6d49);if(fs[_0xa1da('0x4f')](_0x16ec08)){_0x2a6a8a=!![];return _0x426e98['decryptFile'](_0x16ec08,_0x1c6d49,config['secrets']['recording'])['then'](function(){return _0x1486f0;});}return _0x1486f0;}})['then'](function(_0x5210b2){if(_0x5210b2){var _0xfa0a94=_0x5210b2[_0xa1da('0x4b')];if(!fs[_0xa1da('0x4f')](_0xfa0a94)){throw new db[(_0xa1da('0x50'))][(_0xa1da('0x51'))]('SquareRecording\x20not\x20found');}if(_0x5210b2[_0xa1da('0x4c')]){return _0x773f70[_0xa1da('0x48')](_0xfa0a94,_0x5210b2[_0xa1da('0x4c')]+path[_0xa1da('0x52')](_0xfa0a94),function(){if(_0x2a6a8a){fs[_0xa1da('0x53')](_0xfa0a94);}});}else{return _0x773f70['download'](_0xfa0a94,function(_0x47c588){if(_0x2a6a8a){fs[_0xa1da('0x53')](_0xfa0a94);}});}}})[_0xa1da('0x40')](function(_0x400bf4){if(_0x400bf4[_0xa1da('0x54')]===_0xa1da('0x55')){_0x773f70[_0xa1da('0x17')](0x194)[_0xa1da('0x28')](_0xa1da('0x56'));}else{return handleError(_0x773f70,null);}});};exports[_0xa1da('0x25')]=function(_0x2805ce,_0x14abd6){return db['SquareRecording'][_0xa1da('0x47')]({'where':{'id':_0x2805ce[_0xa1da('0x42')]['id']}})['then'](function(_0x209f41){if(_['isNil'](_0x209f41)){throw new ReferenceError(_0xa1da('0x57'));}return _0x209f41;})['then'](function(_0x150122){var _0x2b956e=_0x150122[_0xa1da('0x4b')];logger[_0xa1da('0x58')]('cancellazione\x20fisica\x20documento\x20%s',_0x2b956e);if(!_['isNil'](_0x150122[_0xa1da('0x4b')])&&fs['existsSync'](_0x2b956e)){logger[_0xa1da('0x58')](_0xa1da('0x59')+_0x2b956e+_0xa1da('0x5a'));fs[_0xa1da('0x5b')](_0x2b956e);}_0x2b956e=_0x2b956e+'.cypher';if(!_['isNil'](_0x150122[_0xa1da('0x4b')])&&fs['existsSync'](_0x2b956e)){logger[_0xa1da('0x58')](_0xa1da('0x59')+_0x2b956e+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xa1da('0x5b')](_0x2b956e);}return _0x150122;})[_0xa1da('0x24')](function(_0x29369a){if(!_0x29369a)throw new InternalError();return _0x29369a[_0xa1da('0x25')]();})[_0xa1da('0x24')](function(){_0x14abd6[_0xa1da('0x17')](0xcc)[_0xa1da('0x18')]();})['catch'](handleError(_0x14abd6,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 938c895..f3f7d0f 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 _0xacc6=['moment','request-promise','path','rimraf','./squareRecording.attributes','SquareRecording','lodash','util','../../config/logger','api'];(function(_0x22dc3f,_0x1dec7b){var _0x5ad774=function(_0x59b4b0){while(--_0x59b4b0){_0x22dc3f['push'](_0x22dc3f['shift']());}};_0x5ad774(++_0x1dec7b);}(_0xacc6,0x150));var _0x6acc=function(_0x3a7634,_0x2db384){_0x3a7634=_0x3a7634-0x0;var _0x23bbe9=_0xacc6[_0x3a7634];return _0x23bbe9;};'use strict';var _=require(_0x6acc('0x0'));var util=require(_0x6acc('0x1'));var logger=require(_0x6acc('0x2'))(_0x6acc('0x3'));var moment=require(_0x6acc('0x4'));var BPromise=require('bluebird');var rp=require(_0x6acc('0x5'));var fs=require('fs');var path=require(_0x6acc('0x6'));var rimraf=require(_0x6acc('0x7'));var config=require('../../config/environment');var attributes=require(_0x6acc('0x8'));module['exports']=function(_0xae1fa2,_0x1b97f1){return _0xae1fa2['define'](_0x6acc('0x9'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1921=['request-promise','path','rimraf','../../config/environment','./squareRecording.attributes','exports','SquareRecording','square_recordings','lodash','../../config/logger','api','moment','bluebird'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x1921,0xf2));var _0x1192=function(_0x1b0eb7,_0x5a9a51){_0x1b0eb7=_0x1b0eb7-0x0;var _0x43626c=_0x1921[_0x1b0eb7];return _0x43626c;};'use strict';var _=require(_0x1192('0x0'));var util=require('util');var logger=require(_0x1192('0x1'))(_0x1192('0x2'));var moment=require(_0x1192('0x3'));var BPromise=require(_0x1192('0x4'));var rp=require(_0x1192('0x5'));var fs=require('fs');var path=require(_0x1192('0x6'));var rimraf=require(_0x1192('0x7'));var config=require(_0x1192('0x8'));var attributes=require(_0x1192('0x9'));module[_0x1192('0xa')]=function(_0x56cb6f,_0x5be2d2){return _0x56cb6f['define'](_0x1192('0xb'),attributes,{'tableName':_0x1192('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index 9307cc5..27b69fa 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 _0xccf3=['request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','CreateSquareRecording','create','body','options','raw','then','stringify','lodash','util','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','SquareRecording,\x20%s,\x20%s'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xccf3,0x147));var _0x3ccf=function(_0x453fbc,_0x21029e){_0x453fbc=_0x453fbc-0x0;var _0x57f6d6=_0xccf3[_0x453fbc];return _0x57f6d6;};'use strict';var _=require(_0x3ccf('0x0'));var util=require(_0x3ccf('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3ccf('0x2'));var db=require(_0x3ccf('0x3'))['db'];var utils=require(_0x3ccf('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x3ccf('0x5'));var client=jayson[_0x3ccf('0x6')][_0x3ccf('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5ae9e5,_0x20ca8a,_0x5596e9){return new BPromise(function(_0x50f49b,_0x56378a){return client['request'](_0x5ae9e5,_0x5596e9)['then'](function(_0x5102e1){logger['info'](_0x3ccf('0x8'),_0x20ca8a,_0x3ccf('0x9'));logger[_0x3ccf('0xa')](_0x3ccf('0xb'),_0x20ca8a,_0x3ccf('0x9'),JSON['stringify'](_0x5102e1));if(_0x5102e1[_0x3ccf('0xc')]){if(_0x5102e1['error'][_0x3ccf('0xd')]===0x1f4){logger[_0x3ccf('0xc')](_0x3ccf('0x8'),_0x20ca8a,_0x5102e1[_0x3ccf('0xc')]['message']);return _0x56378a(_0x5102e1[_0x3ccf('0xc')][_0x3ccf('0xe')]);}logger[_0x3ccf('0xc')]('SquareRecording,\x20%s,\x20%s',_0x20ca8a,_0x5102e1[_0x3ccf('0xc')][_0x3ccf('0xe')]);return _0x50f49b(_0x5102e1[_0x3ccf('0xc')][_0x3ccf('0xe')]);}else{logger[_0x3ccf('0xf')](_0x3ccf('0x8'),_0x20ca8a,_0x3ccf('0x9'));_0x50f49b(_0x5102e1['result'][_0x3ccf('0xe')]);}})[_0x3ccf('0x10')](function(_0x719f2c){logger['error']('SquareRecording,\x20%s,\x20%s',_0x20ca8a,_0x719f2c);_0x56378a(_0x719f2c);});});}exports[_0x3ccf('0x11')]=function(_0x262b67){var _0x8daa70=this;return new Promise(function(_0x2afbbb,_0x5c4835){return db['SquareRecording'][_0x3ccf('0x12')](_0x262b67[_0x3ccf('0x13')],{'raw':_0x262b67[_0x3ccf('0x14')]?_0x262b67[_0x3ccf('0x14')][_0x3ccf('0x15')]===undefined?!![]:![]:!![]})[_0x3ccf('0x16')](function(_0x47d800){logger[_0x3ccf('0xf')](_0x3ccf('0x11'),_0x262b67);logger[_0x3ccf('0xa')](_0x3ccf('0x11'),_0x262b67,JSON[_0x3ccf('0x17')](_0x47d800));_0x2afbbb(_0x47d800);})[_0x3ccf('0x10')](function(_0xe1234b){logger[_0x3ccf('0xc')](_0x3ccf('0x11'),_0xe1234b[_0x3ccf('0xe')],_0x262b67);_0x5c4835(_0x8daa70[_0x3ccf('0xc')](0x1f4,_0xe1234b[_0x3ccf('0xe')]));});});}; \ No newline at end of file +var _0x3e47=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','stringify','error','code','SquareRecording,\x20%s,\x20%s','message','catch','CreateSquareRecording','SquareRecording','create','options','raw','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x108d5f,_0x33f82d){var _0x456ea3=function(_0x228200){while(--_0x228200){_0x108d5f['push'](_0x108d5f['shift']());}};_0x456ea3(++_0x33f82d);}(_0x3e47,0x1d6));var _0x73e4=function(_0x1d7bc0,_0x50a455){_0x1d7bc0=_0x1d7bc0-0x0;var _0x15a179=_0x3e47[_0x1d7bc0];return _0x15a179;};'use strict';var _=require(_0x73e4('0x0'));var util=require(_0x73e4('0x1'));var moment=require(_0x73e4('0x2'));var BPromise=require(_0x73e4('0x3'));var rs=require(_0x73e4('0x4'));var fs=require('fs');var Redis=require(_0x73e4('0x5'));var db=require(_0x73e4('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x73e4('0x7'))(_0x73e4('0x8'));var config=require(_0x73e4('0x9'));var jayson=require(_0x73e4('0xa'));var client=jayson[_0x73e4('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xf289c0,_0x29bcf2,_0x4faf8b){return new BPromise(function(_0x58a499,_0x54ded8){return client[_0x73e4('0xc')](_0xf289c0,_0x4faf8b)[_0x73e4('0xd')](function(_0xf2054){logger[_0x73e4('0xe')]('SquareRecording,\x20%s,\x20%s',_0x29bcf2,_0x73e4('0xf'));logger[_0x73e4('0x10')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x29bcf2,_0x73e4('0xf'),JSON[_0x73e4('0x11')](_0xf2054));if(_0xf2054[_0x73e4('0x12')]){if(_0xf2054['error'][_0x73e4('0x13')]===0x1f4){logger[_0x73e4('0x12')](_0x73e4('0x14'),_0x29bcf2,_0xf2054[_0x73e4('0x12')][_0x73e4('0x15')]);return _0x54ded8(_0xf2054[_0x73e4('0x12')][_0x73e4('0x15')]);}logger[_0x73e4('0x12')](_0x73e4('0x14'),_0x29bcf2,_0xf2054[_0x73e4('0x12')][_0x73e4('0x15')]);return _0x58a499(_0xf2054[_0x73e4('0x12')]['message']);}else{logger['info'](_0x73e4('0x14'),_0x29bcf2,_0x73e4('0xf'));_0x58a499(_0xf2054['result'][_0x73e4('0x15')]);}})[_0x73e4('0x16')](function(_0x253517){logger[_0x73e4('0x12')](_0x73e4('0x14'),_0x29bcf2,_0x253517);_0x54ded8(_0x253517);});});}exports[_0x73e4('0x17')]=function(_0x1868fc){var _0x5f0a97=this;return new Promise(function(_0x4fe2ad,_0x2fa9a9){return db[_0x73e4('0x18')][_0x73e4('0x19')](_0x1868fc['body'],{'raw':_0x1868fc[_0x73e4('0x1a')]?_0x1868fc[_0x73e4('0x1a')][_0x73e4('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x8e3732){logger[_0x73e4('0xe')](_0x73e4('0x17'),_0x1868fc);logger['debug'](_0x73e4('0x17'),_0x1868fc,JSON['stringify'](_0x8e3732));_0x4fe2ad(_0x8e3732);})[_0x73e4('0x16')](function(_0x227a7d){logger[_0x73e4('0x12')](_0x73e4('0x17'),_0x227a7d[_0x73e4('0x15')],_0x1868fc);_0x2fa9a9(_0x5f0a97['error'](0x1f4,_0x227a7d[_0x73e4('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index a87689d..ee42d87 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 _0xbaf0=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0x4b1d19,_0x3f29b7){var _0x2219a5=function(_0x3306d2){while(--_0x3306d2){_0x4b1d19['push'](_0x4b1d19['shift']());}};_0x2219a5(++_0x3f29b7);}(_0xbaf0,0x12a));var _0x0baf=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xbaf0[_0x465028];return _0xb783d4;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0xe')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x10')](_0x0baf('0x11'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0baf('0x14')]=router; \ No newline at end of file +var _0xbaf0=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0xbf5202,_0x5989dc){var _0x1897bb=function(_0x1d8f9c){while(--_0x1d8f9c){_0xbf5202['push'](_0xbf5202['shift']());}};_0x1897bb(++_0x5989dc);}(_0xbaf0,0x12a));var _0x0baf=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xbaf0[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0xe')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x10')](_0x0baf('0x11'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0baf('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 0f4bba1..6fd050a 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 _0x7f1d=['sequelize','STRING','DATE','BOOLEAN'];(function(_0x9b06e8,_0x4aef8e){var _0x3447ba=function(_0x54b2d7){while(--_0x54b2d7){_0x9b06e8['push'](_0x9b06e8['shift']());}};_0x3447ba(++_0x4aef8e);}(_0x7f1d,0xe8));var _0xd7f1=function(_0x5ed54b,_0x3a2827){_0x5ed54b=_0x5ed54b-0x0;var _0x4b58c7=_0x7f1d[_0x5ed54b];return _0x4b58c7;};'use strict';var Sequelize=require(_0xd7f1('0x0'));module['exports']={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0xd7f1('0x1')]},'request':{'type':Sequelize[_0xd7f1('0x1')]},'channel':{'type':Sequelize[_0xd7f1('0x1')]},'language':{'type':Sequelize[_0xd7f1('0x1')]},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xd7f1('0x1')]},'version':{'type':Sequelize[_0xd7f1('0x1')]},'callerid':{'type':Sequelize[_0xd7f1('0x1')]},'calleridname':{'type':Sequelize[_0xd7f1('0x1')]},'callingpres':{'type':Sequelize[_0xd7f1('0x1')]},'callingani2':{'type':Sequelize[_0xd7f1('0x1')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0xd7f1('0x1')]},'dnid':{'type':Sequelize[_0xd7f1('0x1')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xd7f1('0x1')]},'extension':{'type':Sequelize[_0xd7f1('0x1')]},'priority':{'type':Sequelize[_0xd7f1('0x1')]},'enhanced':{'type':Sequelize[_0xd7f1('0x1')]},'accountcode':{'type':Sequelize[_0xd7f1('0x1')]},'threadid':{'type':Sequelize[_0xd7f1('0x1')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xd7f1('0x2')]},'leaveAt':{'type':Sequelize[_0xd7f1('0x2')]},'bot':{'type':Sequelize[_0xd7f1('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xf739=['DATE','sequelize','STRING'];(function(_0x15c329,_0x37ac24){var _0x5c30c2=function(_0x37d9ee){while(--_0x37d9ee){_0x15c329['push'](_0x15c329['shift']());}};_0x5c30c2(++_0x37ac24);}(_0xf739,0xaf));var _0x9f73=function(_0x3c38c7,_0x14dd97){_0x3c38c7=_0x3c38c7-0x0;var _0x4aa4b1=_0xf739[_0x3c38c7];return _0x4aa4b1;};'use strict';var Sequelize=require(_0x9f73('0x0'));module['exports']={'network':{'type':Sequelize[_0x9f73('0x1')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0x9f73('0x1')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x9f73('0x1')]},'type':{'type':Sequelize[_0x9f73('0x1')]},'uniqueid':{'type':Sequelize[_0x9f73('0x1')]},'version':{'type':Sequelize[_0x9f73('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0x9f73('0x1')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x9f73('0x1')]},'rdnis':{'type':Sequelize[_0x9f73('0x1')]},'context':{'type':Sequelize[_0x9f73('0x1')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x9f73('0x1')]},'threadid':{'type':Sequelize[_0x9f73('0x1')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x9f73('0x2')]},'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 f4c1422..07cd366 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 _0x33d2=['undefined','limit','count','Content-Range','save','update','then','destroy','error','stack','name','index','map','SquareReport','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','params','includeAll','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset'];(function(_0x1762b4,_0x33d836){var _0x29beda=function(_0x31c2fa){while(--_0x31c2fa){_0x1762b4['push'](_0x1762b4['shift']());}};_0x29beda(++_0x33d836);}(_0x33d2,0x155));var _0x233d=function(_0xeef94c,_0x1db3f7){_0xeef94c=_0xeef94c-0x0;var _0x447522=_0x33d2[_0xeef94c];return _0x447522;};'use strict';var emlformat=require(_0x233d('0x0'));var rimraf=require(_0x233d('0x1'));var zipdir=require(_0x233d('0x2'));var jsonpatch=require(_0x233d('0x3'));var rp=require('request-promise');var moment=require(_0x233d('0x4'));var BPromise=require(_0x233d('0x5'));var Mustache=require(_0x233d('0x6'));var util=require(_0x233d('0x7'));var path=require(_0x233d('0x8'));var sox=require('sox');var csv=require(_0x233d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x233d('0xa'));var crypto=require(_0x233d('0xb'));var jsforce=require(_0x233d('0xc'));var deskjs=require(_0x233d('0xd'));var toCsv=require(_0x233d('0x9'));var querystring=require(_0x233d('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x233d('0xf'));var qs=require(_0x233d('0x10'));var as=require(_0x233d('0x11'));var hardwareService=require(_0x233d('0x12'));var logger=require(_0x233d('0x13'))('api');var utils=require(_0x233d('0x14'));var config=require(_0x233d('0x15'));var licenseUtil=require(_0x233d('0x16'));var db=require(_0x233d('0x17'))['db'];function respondWithStatusCode(_0x52ea87,_0x3a4f5d){_0x3a4f5d=_0x3a4f5d||0xcc;return function(_0x18691f){if(_0x18691f){return _0x52ea87[_0x233d('0x18')](_0x3a4f5d);}return _0x52ea87['status'](_0x3a4f5d)[_0x233d('0x19')]();};}function respondWithResult(_0x4f0ace,_0x55eeef){_0x55eeef=_0x55eeef||0xc8;return function(_0x211d7a){if(_0x211d7a){return _0x4f0ace[_0x233d('0x1a')](_0x55eeef)[_0x233d('0x1b')](_0x211d7a);}};}function respondWithFilteredResult(_0x377438,_0x1dc50e){return function(_0x5be9c7){if(_0x5be9c7){var _0x3c5eae=typeof _0x1dc50e[_0x233d('0x1c')]===_0x233d('0x1d')&&typeof _0x1dc50e[_0x233d('0x1e')]===_0x233d('0x1d');var _0x35fc4a=_0x5be9c7[_0x233d('0x1f')];var _0x5d5f30=_0x3c5eae?0x0:_0x1dc50e[_0x233d('0x1c')];var _0x9ac97d=_0x3c5eae?_0x5be9c7['count']:_0x1dc50e[_0x233d('0x1c')]+_0x1dc50e[_0x233d('0x1e')];var _0x115e26;if(_0x9ac97d>=_0x35fc4a){_0x9ac97d=_0x35fc4a;_0x115e26=0xc8;}else{_0x115e26=0xce;}_0x377438[_0x233d('0x1a')](_0x115e26);return _0x377438['set'](_0x233d('0x20'),_0x5d5f30+'-'+_0x9ac97d+'/'+_0x35fc4a)['json'](_0x5be9c7);}return null;};}function patchUpdates(_0x2f71a4){return function(_0x242271){try{jsonpatch['apply'](_0x242271,_0x2f71a4,!![]);}catch(_0x172071){return BPromise['reject'](_0x172071);}return _0x242271[_0x233d('0x21')]();};}function saveUpdates(_0xc5984a,_0x3e13b7){return function(_0x16dc6b){if(_0x16dc6b){return _0x16dc6b[_0x233d('0x22')](_0xc5984a)[_0x233d('0x23')](function(_0x52bbf1){return _0x52bbf1;});}return null;};}function removeEntity(_0x3726ff,_0x4c8ea3){return function(_0x15a67b){if(_0x15a67b){return _0x15a67b[_0x233d('0x24')]()[_0x233d('0x23')](function(){_0x3726ff[_0x233d('0x1a')](0xcc)[_0x233d('0x19')]();});}};}function handleEntityNotFound(_0x50e35b,_0xe0ba9d){return function(_0x3d9434){if(!_0x3d9434){_0x50e35b[_0x233d('0x18')](0x194);}return _0x3d9434;};}function handleError(_0x173211,_0xafc8d3){_0xafc8d3=_0xafc8d3||0x1f4;return function(_0x13cedf){logger[_0x233d('0x25')](_0x13cedf[_0x233d('0x26')]);if(_0x13cedf[_0x233d('0x27')]){delete _0x13cedf[_0x233d('0x27')];}_0x173211['status'](_0xafc8d3)['send'](_0x13cedf);};}exports[_0x233d('0x28')]=function(_0x2bba3d,_0x435b59){var _0xea000={},_0x577aac={},_0x42dcdc={'count':0x0,'rows':[]};var _0x395be3=_[_0x233d('0x29')](db[_0x233d('0x2a')][_0x233d('0x2b')],function(_0x3c5776){return{'name':_0x3c5776[_0x233d('0x2c')],'type':_0x3c5776[_0x233d('0x2d')]['key']};});_0x577aac['model']=_[_0x233d('0x29')](_0x395be3,_0x233d('0x27'));_0x577aac[_0x233d('0x2e')]=_[_0x233d('0x2f')](_0x2bba3d[_0x233d('0x2e')]);_0x577aac[_0x233d('0x30')]=_[_0x233d('0x31')](_0x577aac[_0x233d('0x32')],_0x577aac[_0x233d('0x2e')]);_0xea000[_0x233d('0x33')]=_['intersection'](_0x577aac['model'],qs[_0x233d('0x34')](_0x2bba3d[_0x233d('0x2e')][_0x233d('0x34')]));_0xea000[_0x233d('0x33')]=_0xea000[_0x233d('0x33')][_0x233d('0x35')]?_0xea000[_0x233d('0x33')]:_0x577aac[_0x233d('0x32')];if(!_0x2bba3d[_0x233d('0x2e')][_0x233d('0x36')](_0x233d('0x37'))){_0xea000['limit']=qs[_0x233d('0x1e')](_0x2bba3d[_0x233d('0x2e')]['limit']);_0xea000[_0x233d('0x1c')]=qs['offset'](_0x2bba3d[_0x233d('0x2e')][_0x233d('0x1c')]);}_0xea000[_0x233d('0x38')]=qs[_0x233d('0x39')](_0x2bba3d[_0x233d('0x2e')][_0x233d('0x39')]);_0xea000[_0x233d('0x3a')]=qs[_0x233d('0x30')](_[_0x233d('0x3b')](_0x2bba3d[_0x233d('0x2e')],_0x577aac['filters']),_0x395be3);if(_0x2bba3d['query'][_0x233d('0x3c')]){_0xea000[_0x233d('0x3a')]=_[_0x233d('0x3d')](_0xea000[_0x233d('0x3a')],{'$or':_['map'](_0x395be3,function(_0x2d4241){if(_0x2d4241['type']!==_0x233d('0x3e')){var _0x5aa3d9={};_0x5aa3d9[_0x2d4241[_0x233d('0x27')]]={'$like':'%'+_0x2bba3d[_0x233d('0x2e')]['filter']+'%'};return _0x5aa3d9;}})});}_0xea000=_[_0x233d('0x3d')]({},_0xea000,_0x2bba3d[_0x233d('0x3f')]);var _0x251e7d={'where':_0xea000[_0x233d('0x3a')]};return db[_0x233d('0x2a')]['count'](_0x251e7d)['then'](function(_0x5b7499){_0x42dcdc[_0x233d('0x1f')]=_0x5b7499;if(_0x2bba3d['query']['includeAll']){_0xea000[_0x233d('0x40')]=[{'all':!![]}];}return db[_0x233d('0x2a')][_0x233d('0x41')](_0xea000);})[_0x233d('0x23')](function(_0x87791e){_0x42dcdc[_0x233d('0x42')]=_0x87791e;return _0x42dcdc;})[_0x233d('0x23')](respondWithFilteredResult(_0x435b59,_0xea000))['catch'](handleError(_0x435b59,null));};exports['show']=function(_0x260d13,_0x212627){var _0x5dbc24={'raw':!![],'where':{'id':_0x260d13[_0x233d('0x43')]['id']}},_0xee6ea1={};_0xee6ea1[_0x233d('0x32')]=_['keys'](db['SquareReport'][_0x233d('0x2b')]);_0xee6ea1[_0x233d('0x2e')]=_[_0x233d('0x2f')](_0x260d13['query']);_0xee6ea1['filters']=_['intersection'](_0xee6ea1[_0x233d('0x32')],_0xee6ea1['query']);_0x5dbc24[_0x233d('0x33')]=_['intersection'](_0xee6ea1[_0x233d('0x32')],qs[_0x233d('0x34')](_0x260d13[_0x233d('0x2e')][_0x233d('0x34')]));_0x5dbc24['attributes']=_0x5dbc24[_0x233d('0x33')]['length']?_0x5dbc24[_0x233d('0x33')]:_0xee6ea1[_0x233d('0x32')];if(_0x260d13[_0x233d('0x2e')][_0x233d('0x44')]){_0x5dbc24[_0x233d('0x40')]=[{'all':!![]}];}_0x5dbc24=_[_0x233d('0x3d')]({},_0x5dbc24,_0x260d13['options']);return db[_0x233d('0x2a')][_0x233d('0x45')](_0x5dbc24)['then'](handleEntityNotFound(_0x212627,null))[_0x233d('0x23')](respondWithResult(_0x212627,null))[_0x233d('0x46')](handleError(_0x212627,null));};exports['create']=function(_0x575566,_0x397455){return db[_0x233d('0x2a')][_0x233d('0x47')](_0x575566[_0x233d('0x48')],{})['then'](respondWithResult(_0x397455,0xc9))['catch'](handleError(_0x397455,null));};exports[_0x233d('0x22')]=function(_0x5e9ccc,_0x2b524b){if(_0x5e9ccc['body']['id']){delete _0x5e9ccc[_0x233d('0x48')]['id'];}return db[_0x233d('0x2a')][_0x233d('0x45')]({'where':{'id':_0x5e9ccc[_0x233d('0x43')]['id']}})[_0x233d('0x23')](handleEntityNotFound(_0x2b524b,null))['then'](saveUpdates(_0x5e9ccc[_0x233d('0x48')],null))[_0x233d('0x23')](respondWithResult(_0x2b524b,null))[_0x233d('0x46')](handleError(_0x2b524b,null));};exports[_0x233d('0x24')]=function(_0x494254,_0x5caf14){return db[_0x233d('0x2a')]['find']({'where':{'id':_0x494254['params']['id']}})['then'](handleEntityNotFound(_0x5caf14,null))[_0x233d('0x23')](removeEntity(_0x5caf14,null))['catch'](handleError(_0x5caf14,null));};exports['describe']=function(_0x966577,_0x23694b){return db[_0x233d('0x2a')][_0x233d('0x49')]()[_0x233d('0x23')](respondWithResult(_0x23694b,null))[_0x233d('0x46')](handleError(_0x23694b,null));}; \ No newline at end of file +var _0xedc7=['merge','options','includeAll','include','findAll','catch','filters','length','create','update','body','find','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','sendStatus','status','offset','count','limit','set','Content-Range','json','reject','save','then','destroy','end','error','stack','name','send','map','SquareReport','rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter'];(function(_0x3170b8,_0x54c4cc){var _0x3fe513=function(_0x93bf33){while(--_0x93bf33){_0x3170b8['push'](_0x3170b8['shift']());}};_0x3fe513(++_0x54c4cc);}(_0xedc7,0x1c4));var _0x7edc=function(_0x36fc9c,_0x1735d5){_0x36fc9c=_0x36fc9c-0x0;var _0x1fee23=_0xedc7[_0x36fc9c];return _0x1fee23;};'use strict';var emlformat=require(_0x7edc('0x0'));var rimraf=require(_0x7edc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7edc('0x2'));var rp=require(_0x7edc('0x3'));var moment=require(_0x7edc('0x4'));var BPromise=require(_0x7edc('0x5'));var Mustache=require(_0x7edc('0x6'));var util=require(_0x7edc('0x7'));var path=require(_0x7edc('0x8'));var sox=require(_0x7edc('0x9'));var csv=require(_0x7edc('0xa'));var ejs=require(_0x7edc('0xb'));var fs=require('fs');var fs_extra=require(_0x7edc('0xc'));var _=require(_0x7edc('0xd'));var squel=require(_0x7edc('0xe'));var crypto=require(_0x7edc('0xf'));var jsforce=require(_0x7edc('0x10'));var deskjs=require(_0x7edc('0x11'));var toCsv=require(_0x7edc('0xa'));var querystring=require('querystring');var Papa=require(_0x7edc('0x12'));var Redis=require('ioredis');var authService=require(_0x7edc('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7edc('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7edc('0x15'))(_0x7edc('0x16'));var utils=require('../../config/utils');var config=require(_0x7edc('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x259ba2,_0x3f8d64){_0x3f8d64=_0x3f8d64||0xcc;return function(_0xf5820c){if(_0xf5820c){return _0x259ba2[_0x7edc('0x18')](_0x3f8d64);}return _0x259ba2['status'](_0x3f8d64)['end']();};}function respondWithResult(_0x4c2018,_0xc3f671){_0xc3f671=_0xc3f671||0xc8;return function(_0x1c9c10){if(_0x1c9c10){return _0x4c2018[_0x7edc('0x19')](_0xc3f671)['json'](_0x1c9c10);}};}function respondWithFilteredResult(_0x370ce6,_0x7bb05e){return function(_0x4f4bbf){if(_0x4f4bbf){var _0x266f30=typeof _0x7bb05e[_0x7edc('0x1a')]==='undefined'&&typeof _0x7bb05e['limit']==='undefined';var _0x100d84=_0x4f4bbf[_0x7edc('0x1b')];var _0x50a861=_0x266f30?0x0:_0x7bb05e['offset'];var _0x4e81bf=_0x266f30?_0x4f4bbf[_0x7edc('0x1b')]:_0x7bb05e[_0x7edc('0x1a')]+_0x7bb05e[_0x7edc('0x1c')];var _0x4a5226;if(_0x4e81bf>=_0x100d84){_0x4e81bf=_0x100d84;_0x4a5226=0xc8;}else{_0x4a5226=0xce;}_0x370ce6[_0x7edc('0x19')](_0x4a5226);return _0x370ce6[_0x7edc('0x1d')](_0x7edc('0x1e'),_0x50a861+'-'+_0x4e81bf+'/'+_0x100d84)[_0x7edc('0x1f')](_0x4f4bbf);}return null;};}function patchUpdates(_0x32cdc7){return function(_0x291c59){try{jsonpatch['apply'](_0x291c59,_0x32cdc7,!![]);}catch(_0x32e855){return BPromise[_0x7edc('0x20')](_0x32e855);}return _0x291c59[_0x7edc('0x21')]();};}function saveUpdates(_0x4bed76,_0x1e6de5){return function(_0x92888e){if(_0x92888e){return _0x92888e['update'](_0x4bed76)[_0x7edc('0x22')](function(_0x296ae8){return _0x296ae8;});}return null;};}function removeEntity(_0x1e5539,_0x2dd5ad){return function(_0x3ea5f8){if(_0x3ea5f8){return _0x3ea5f8[_0x7edc('0x23')]()[_0x7edc('0x22')](function(){_0x1e5539[_0x7edc('0x19')](0xcc)[_0x7edc('0x24')]();});}};}function handleEntityNotFound(_0x360564,_0x3a7c84){return function(_0x3b4b8d){if(!_0x3b4b8d){_0x360564[_0x7edc('0x18')](0x194);}return _0x3b4b8d;};}function handleError(_0x1b68ce,_0x2b8e3c){_0x2b8e3c=_0x2b8e3c||0x1f4;return function(_0xe62753){logger[_0x7edc('0x25')](_0xe62753[_0x7edc('0x26')]);if(_0xe62753[_0x7edc('0x27')]){delete _0xe62753[_0x7edc('0x27')];}_0x1b68ce[_0x7edc('0x19')](_0x2b8e3c)[_0x7edc('0x28')](_0xe62753);};}exports['index']=function(_0x1d3075,_0x199703){var _0x47f53a={},_0x3e097f={},_0x4df1db={'count':0x0,'rows':[]};var _0x5aa34e=_[_0x7edc('0x29')](db[_0x7edc('0x2a')][_0x7edc('0x2b')],function(_0x184ae0){return{'name':_0x184ae0[_0x7edc('0x2c')],'type':_0x184ae0[_0x7edc('0x2d')]['key']};});_0x3e097f[_0x7edc('0x2e')]=_[_0x7edc('0x29')](_0x5aa34e,_0x7edc('0x27'));_0x3e097f[_0x7edc('0x2f')]=_[_0x7edc('0x30')](_0x1d3075[_0x7edc('0x2f')]);_0x3e097f['filters']=_[_0x7edc('0x31')](_0x3e097f[_0x7edc('0x2e')],_0x3e097f[_0x7edc('0x2f')]);_0x47f53a['attributes']=_[_0x7edc('0x31')](_0x3e097f[_0x7edc('0x2e')],qs['fields'](_0x1d3075['query'][_0x7edc('0x32')]));_0x47f53a[_0x7edc('0x33')]=_0x47f53a['attributes']['length']?_0x47f53a[_0x7edc('0x33')]:_0x3e097f['model'];if(!_0x1d3075[_0x7edc('0x2f')][_0x7edc('0x34')](_0x7edc('0x35'))){_0x47f53a[_0x7edc('0x1c')]=qs[_0x7edc('0x1c')](_0x1d3075['query'][_0x7edc('0x1c')]);_0x47f53a[_0x7edc('0x1a')]=qs['offset'](_0x1d3075[_0x7edc('0x2f')][_0x7edc('0x1a')]);}_0x47f53a[_0x7edc('0x36')]=qs[_0x7edc('0x37')](_0x1d3075[_0x7edc('0x2f')][_0x7edc('0x37')]);_0x47f53a[_0x7edc('0x38')]=qs['filters'](_['pick'](_0x1d3075[_0x7edc('0x2f')],_0x3e097f['filters']),_0x5aa34e);if(_0x1d3075[_0x7edc('0x2f')]['filter']){_0x47f53a['where']=_['merge'](_0x47f53a[_0x7edc('0x38')],{'$or':_['map'](_0x5aa34e,function(_0x3f973e){if(_0x3f973e[_0x7edc('0x2d')]!==_0x7edc('0x39')){var _0xe665a6={};_0xe665a6[_0x3f973e['name']]={'$like':'%'+_0x1d3075[_0x7edc('0x2f')][_0x7edc('0x3a')]+'%'};return _0xe665a6;}})});}_0x47f53a=_[_0x7edc('0x3b')]({},_0x47f53a,_0x1d3075[_0x7edc('0x3c')]);var _0xbbf644={'where':_0x47f53a[_0x7edc('0x38')]};return db[_0x7edc('0x2a')][_0x7edc('0x1b')](_0xbbf644)['then'](function(_0x466573){_0x4df1db[_0x7edc('0x1b')]=_0x466573;if(_0x1d3075[_0x7edc('0x2f')][_0x7edc('0x3d')]){_0x47f53a[_0x7edc('0x3e')]=[{'all':!![]}];}return db[_0x7edc('0x2a')][_0x7edc('0x3f')](_0x47f53a);})['then'](function(_0x486f46){_0x4df1db['rows']=_0x486f46;return _0x4df1db;})[_0x7edc('0x22')](respondWithFilteredResult(_0x199703,_0x47f53a))[_0x7edc('0x40')](handleError(_0x199703,null));};exports['show']=function(_0x2f0371,_0x5f7974){var _0x320495={'raw':!![],'where':{'id':_0x2f0371['params']['id']}},_0x1fadba={};_0x1fadba[_0x7edc('0x2e')]=_['keys'](db[_0x7edc('0x2a')][_0x7edc('0x2b')]);_0x1fadba['query']=_[_0x7edc('0x30')](_0x2f0371[_0x7edc('0x2f')]);_0x1fadba[_0x7edc('0x41')]=_[_0x7edc('0x31')](_0x1fadba[_0x7edc('0x2e')],_0x1fadba[_0x7edc('0x2f')]);_0x320495['attributes']=_[_0x7edc('0x31')](_0x1fadba[_0x7edc('0x2e')],qs[_0x7edc('0x32')](_0x2f0371[_0x7edc('0x2f')][_0x7edc('0x32')]));_0x320495['attributes']=_0x320495[_0x7edc('0x33')][_0x7edc('0x42')]?_0x320495['attributes']:_0x1fadba['model'];if(_0x2f0371[_0x7edc('0x2f')][_0x7edc('0x3d')]){_0x320495['include']=[{'all':!![]}];}_0x320495=_[_0x7edc('0x3b')]({},_0x320495,_0x2f0371['options']);return db[_0x7edc('0x2a')]['find'](_0x320495)[_0x7edc('0x22')](handleEntityNotFound(_0x5f7974,null))[_0x7edc('0x22')](respondWithResult(_0x5f7974,null))['catch'](handleError(_0x5f7974,null));};exports[_0x7edc('0x43')]=function(_0x369260,_0x265ee7){return db[_0x7edc('0x2a')][_0x7edc('0x43')](_0x369260['body'],{})['then'](respondWithResult(_0x265ee7,0xc9))[_0x7edc('0x40')](handleError(_0x265ee7,null));};exports[_0x7edc('0x44')]=function(_0x47c036,_0x1254a4){if(_0x47c036[_0x7edc('0x45')]['id']){delete _0x47c036[_0x7edc('0x45')]['id'];}return db['SquareReport'][_0x7edc('0x46')]({'where':{'id':_0x47c036[_0x7edc('0x47')]['id']}})['then'](handleEntityNotFound(_0x1254a4,null))[_0x7edc('0x22')](saveUpdates(_0x47c036[_0x7edc('0x45')],null))['then'](respondWithResult(_0x1254a4,null))[_0x7edc('0x40')](handleError(_0x1254a4,null));};exports[_0x7edc('0x23')]=function(_0x4decab,_0xf0aadc){return db[_0x7edc('0x2a')][_0x7edc('0x46')]({'where':{'id':_0x4decab[_0x7edc('0x47')]['id']}})[_0x7edc('0x22')](handleEntityNotFound(_0xf0aadc,null))['then'](removeEntity(_0xf0aadc,null))[_0x7edc('0x40')](handleError(_0xf0aadc,null));};exports[_0x7edc('0x48')]=function(_0x1ffb60,_0x437fe1){return db['SquareReport'][_0x7edc('0x48')]()[_0x7edc('0x22')](respondWithResult(_0x437fe1,null))['catch'](handleError(_0x437fe1,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 51ae1cd..e1986b6 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 _0x8e33=['uid_pname','uniqueid','leaveAt','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReport.attributes','exports','define','SquareReport'];(function(_0x4da407,_0x4ec60a){var _0x4ed463=function(_0x476d7c){while(--_0x476d7c){_0x4da407['push'](_0x4da407['shift']());}};_0x4ed463(++_0x4ec60a);}(_0x8e33,0xb7));var _0x38e3=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x8e33[_0x40a045];return _0x1a687c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x38e3('0x0'))(_0x38e3('0x1'));var moment=require(_0x38e3('0x2'));var BPromise=require(_0x38e3('0x3'));var rp=require(_0x38e3('0x4'));var fs=require('fs');var path=require(_0x38e3('0x5'));var rimraf=require(_0x38e3('0x6'));var config=require(_0x38e3('0x7'));var attributes=require(_0x38e3('0x8'));module[_0x38e3('0x9')]=function(_0x434e47,_0x373ca0){return _0x434e47[_0x38e3('0xa')](_0x38e3('0xb'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0x38e3('0xc'),'fields':[_0x38e3('0xd'),'project_name']},{'name':_0x38e3('0xe'),'fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file +var _0xa233=['./squareReport.attributes','exports','define','report_square','uid_pname','uniqueid','project_name','leaveAt','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x981f3,_0x35f164){var _0x4be844=function(_0x30c725){while(--_0x30c725){_0x981f3['push'](_0x981f3['shift']());}};_0x4be844(++_0x35f164);}(_0xa233,0x1c2));var _0x3a23=function(_0x13dad5,_0x2ae29b){_0x13dad5=_0x13dad5-0x0;var _0x2c6755=_0xa233[_0x13dad5];return _0x2c6755;};'use strict';var _=require(_0x3a23('0x0'));var util=require(_0x3a23('0x1'));var logger=require(_0x3a23('0x2'))(_0x3a23('0x3'));var moment=require('moment');var BPromise=require(_0x3a23('0x4'));var rp=require(_0x3a23('0x5'));var fs=require('fs');var path=require(_0x3a23('0x6'));var rimraf=require(_0x3a23('0x7'));var config=require(_0x3a23('0x8'));var attributes=require(_0x3a23('0x9'));module[_0x3a23('0xa')]=function(_0x50dd5e,_0xa4535c){return _0x50dd5e[_0x3a23('0xb')]('SquareReport',attributes,{'tableName':_0x3a23('0xc'),'paranoid':![],'indexes':[{'name':_0x3a23('0xd'),'fields':[_0x3a23('0xe'),_0x3a23('0xf')]},{'name':'leaveAt','fields':[_0x3a23('0x10')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index e4ea272..4696ba0 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 _0x0bed=['catch','CreateSquareReport','create','body','options','raw','UpdateSquareReport','update','where','limit','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x389ca2,_0x29e579){var _0x45de57=function(_0x2f8d83){while(--_0x2f8d83){_0x389ca2['push'](_0x389ca2['shift']());}};_0x45de57(++_0x29e579);}(_0x0bed,0x16a));var _0xd0be=function(_0x3348b6,_0x3d52bb){_0x3348b6=_0x3348b6-0x0;var _0x167547=_0x0bed[_0x3348b6];return _0x167547;};'use strict';var _=require(_0xd0be('0x0'));var util=require('util');var moment=require(_0xd0be('0x1'));var BPromise=require('bluebird');var rs=require(_0xd0be('0x2'));var fs=require('fs');var Redis=require(_0xd0be('0x3'));var db=require(_0xd0be('0x4'))['db'];var utils=require(_0xd0be('0x5'));var logger=require(_0xd0be('0x6'))(_0xd0be('0x7'));var config=require(_0xd0be('0x8'));var jayson=require(_0xd0be('0x9'));var client=jayson[_0xd0be('0xa')][_0xd0be('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x13163d,_0x5deccb,_0x5655a6){return new BPromise(function(_0x5c165a,_0x5cbf3a){return client[_0xd0be('0xc')](_0x13163d,_0x5655a6)[_0xd0be('0xd')](function(_0x478fb5){logger[_0xd0be('0xe')](_0xd0be('0xf'),_0x5deccb,_0xd0be('0x10'));logger[_0xd0be('0x11')]('SquareReport,\x20%s,\x20%s,\x20%s',_0x5deccb,_0xd0be('0x10'),JSON[_0xd0be('0x12')](_0x478fb5));if(_0x478fb5['error']){if(_0x478fb5[_0xd0be('0x13')][_0xd0be('0x14')]===0x1f4){logger[_0xd0be('0x13')]('SquareReport,\x20%s,\x20%s',_0x5deccb,_0x478fb5[_0xd0be('0x13')][_0xd0be('0x15')]);return _0x5cbf3a(_0x478fb5[_0xd0be('0x13')][_0xd0be('0x15')]);}logger['error'](_0xd0be('0xf'),_0x5deccb,_0x478fb5[_0xd0be('0x13')]['message']);return _0x5c165a(_0x478fb5['error'][_0xd0be('0x15')]);}else{logger['info']('SquareReport,\x20%s,\x20%s',_0x5deccb,_0xd0be('0x10'));_0x5c165a(_0x478fb5['result'][_0xd0be('0x15')]);}})[_0xd0be('0x16')](function(_0x517e14){logger[_0xd0be('0x13')]('SquareReport,\x20%s,\x20%s',_0x5deccb,_0x517e14);_0x5cbf3a(_0x517e14);});});}exports[_0xd0be('0x17')]=function(_0x21b630){var _0x14fad1=this;return new Promise(function(_0xd73cb0,_0x5ea1ba){return db['SquareReport'][_0xd0be('0x18')](_0x21b630[_0xd0be('0x19')],{'raw':_0x21b630[_0xd0be('0x1a')]?_0x21b630['options'][_0xd0be('0x1b')]===undefined?!![]:![]:!![]})[_0xd0be('0xd')](function(_0x1ee8af){logger[_0xd0be('0xe')](_0xd0be('0x17'),_0x21b630);logger[_0xd0be('0x11')]('CreateSquareReport',_0x21b630,JSON[_0xd0be('0x12')](_0x1ee8af));_0xd73cb0(_0x1ee8af);})[_0xd0be('0x16')](function(_0xe5a450){logger[_0xd0be('0x13')](_0xd0be('0x17'),_0xe5a450[_0xd0be('0x15')],_0x21b630);_0x5ea1ba(_0x14fad1[_0xd0be('0x13')](0x1f4,_0xe5a450[_0xd0be('0x15')]));});});};exports[_0xd0be('0x1c')]=function(_0x1f5d11){var _0x244ff1=this;return new Promise(function(_0x1433d3,_0x1a82a8){return db['SquareReport'][_0xd0be('0x1d')](_0x1f5d11[_0xd0be('0x19')],{'raw':_0x1f5d11[_0xd0be('0x1a')]?_0x1f5d11['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1f5d11[_0xd0be('0x1a')]?_0x1f5d11[_0xd0be('0x1a')][_0xd0be('0x1e')]||null:null,'attributes':_0x1f5d11[_0xd0be('0x1a')]?_0x1f5d11[_0xd0be('0x1a')]['attributes']||null:null,'limit':_0x1f5d11[_0xd0be('0x1a')]?_0x1f5d11['options'][_0xd0be('0x1f')]||null:null})['then'](function(_0x11cfdf){logger['info']('UpdateSquareReport',_0x1f5d11);logger['debug'](_0xd0be('0x1c'),_0x1f5d11,JSON[_0xd0be('0x12')](_0x11cfdf));_0x1433d3(_0x11cfdf);})['catch'](function(_0x45c1ae){logger[_0xd0be('0x13')](_0xd0be('0x1c'),_0x45c1ae[_0xd0be('0x15')],_0x1f5d11);_0x1a82a8(_0x244ff1['error'](0x1f4,_0x45c1ae[_0xd0be('0x15')]));});});}; \ No newline at end of file +var _0xf66f=['error','code','message','result','CreateSquareReport','SquareReport','create','options','raw','stringify','UpdateSquareReport','update','body','where','attributes','limit','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s'];(function(_0x3b4934,_0x5b02da){var _0x4a56ad=function(_0x2efb29){while(--_0x2efb29){_0x3b4934['push'](_0x3b4934['shift']());}};_0x4a56ad(++_0x5b02da);}(_0xf66f,0x10d));var _0xff66=function(_0x4ccde3,_0x38ca57){_0x4ccde3=_0x4ccde3-0x0;var _0x3348ac=_0xf66f[_0x4ccde3];return _0x3348ac;};'use strict';var _=require(_0xff66('0x0'));var util=require(_0xff66('0x1'));var moment=require('moment');var BPromise=require(_0xff66('0x2'));var rs=require(_0xff66('0x3'));var fs=require('fs');var Redis=require(_0xff66('0x4'));var db=require(_0xff66('0x5'))['db'];var utils=require(_0xff66('0x6'));var logger=require(_0xff66('0x7'))(_0xff66('0x8'));var config=require('../../config/environment');var jayson=require(_0xff66('0x9'));var client=jayson[_0xff66('0xa')][_0xff66('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x22a577,_0x40a5f2,_0x30f39e){return new BPromise(function(_0x55d188,_0x2a54e8){return client[_0xff66('0xc')](_0x22a577,_0x30f39e)[_0xff66('0xd')](function(_0x553d64){logger[_0xff66('0xe')](_0xff66('0xf'),_0x40a5f2,_0xff66('0x10'));logger[_0xff66('0x11')](_0xff66('0x12'),_0x40a5f2,_0xff66('0x10'),JSON['stringify'](_0x553d64));if(_0x553d64[_0xff66('0x13')]){if(_0x553d64[_0xff66('0x13')][_0xff66('0x14')]===0x1f4){logger[_0xff66('0x13')](_0xff66('0xf'),_0x40a5f2,_0x553d64['error'][_0xff66('0x15')]);return _0x2a54e8(_0x553d64['error']['message']);}logger[_0xff66('0x13')](_0xff66('0xf'),_0x40a5f2,_0x553d64['error'][_0xff66('0x15')]);return _0x55d188(_0x553d64[_0xff66('0x13')][_0xff66('0x15')]);}else{logger[_0xff66('0xe')](_0xff66('0xf'),_0x40a5f2,_0xff66('0x10'));_0x55d188(_0x553d64[_0xff66('0x16')]['message']);}})['catch'](function(_0x1ba613){logger['error'](_0xff66('0xf'),_0x40a5f2,_0x1ba613);_0x2a54e8(_0x1ba613);});});}exports[_0xff66('0x17')]=function(_0x527a27){var _0x3eecf8=this;return new Promise(function(_0x228a5d,_0x5c0af2){return db[_0xff66('0x18')][_0xff66('0x19')](_0x527a27['body'],{'raw':_0x527a27[_0xff66('0x1a')]?_0x527a27['options'][_0xff66('0x1b')]===undefined?!![]:![]:!![]})[_0xff66('0xd')](function(_0x60a8b7){logger[_0xff66('0xe')](_0xff66('0x17'),_0x527a27);logger[_0xff66('0x11')](_0xff66('0x17'),_0x527a27,JSON[_0xff66('0x1c')](_0x60a8b7));_0x228a5d(_0x60a8b7);})['catch'](function(_0x553865){logger[_0xff66('0x13')](_0xff66('0x17'),_0x553865[_0xff66('0x15')],_0x527a27);_0x5c0af2(_0x3eecf8[_0xff66('0x13')](0x1f4,_0x553865[_0xff66('0x15')]));});});};exports[_0xff66('0x1d')]=function(_0x305f87){var _0x246ac1=this;return new Promise(function(_0x17743a,_0x1716e8){return db[_0xff66('0x18')][_0xff66('0x1e')](_0x305f87[_0xff66('0x1f')],{'raw':_0x305f87['options']?_0x305f87[_0xff66('0x1a')][_0xff66('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x305f87[_0xff66('0x1a')]?_0x305f87[_0xff66('0x1a')][_0xff66('0x20')]||null:null,'attributes':_0x305f87[_0xff66('0x1a')]?_0x305f87[_0xff66('0x1a')][_0xff66('0x21')]||null:null,'limit':_0x305f87['options']?_0x305f87['options'][_0xff66('0x22')]||null:null})[_0xff66('0xd')](function(_0x5cab24){logger[_0xff66('0xe')](_0xff66('0x1d'),_0x305f87);logger[_0xff66('0x11')](_0xff66('0x1d'),_0x305f87,JSON['stringify'](_0x5cab24));_0x17743a(_0x5cab24);})[_0xff66('0x23')](function(_0x4cdd36){logger[_0xff66('0x13')](_0xff66('0x1d'),_0x4cdd36[_0xff66('0x15')],_0x305f87);_0x1716e8(_0x246ac1[_0xff66('0x13')](0x1f4,_0x4cdd36[_0xff66('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 6f7888e..3df2add 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 _0x3346=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./squareReportDetail.controller','get','index','isAuthenticated','describe','/:id','show','post','put','update','delete'];(function(_0xafca9f,_0x18165b){var _0x172220=function(_0x5b1360){while(--_0x5b1360){_0xafca9f['push'](_0xafca9f['shift']());}};_0x172220(++_0x18165b);}(_0x3346,0x1a6));var _0x6334=function(_0x33b620,_0x2856ed){_0x33b620=_0x33b620-0x0;var _0x5302d2=_0x3346[_0x33b620];return _0x5302d2;};'use strict';var multer=require(_0x6334('0x0'));var util=require(_0x6334('0x1'));var path=require(_0x6334('0x2'));var timeout=require(_0x6334('0x3'));var express=require(_0x6334('0x4'));var router=express[_0x6334('0x5')]();var fs_extra=require(_0x6334('0x6'));var auth=require(_0x6334('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6334('0x8'));router[_0x6334('0x9')]('/',auth['isAuthenticated'](),controller[_0x6334('0xa')]);router['get']('/describe',auth[_0x6334('0xb')](),controller[_0x6334('0xc')]);router[_0x6334('0x9')](_0x6334('0xd'),auth[_0x6334('0xb')](),controller[_0x6334('0xe')]);router[_0x6334('0xf')]('/',auth[_0x6334('0xb')](),controller['create']);router[_0x6334('0x10')](_0x6334('0xd'),auth[_0x6334('0xb')](),controller[_0x6334('0x11')]);router[_0x6334('0x12')](_0x6334('0xd'),auth[_0x6334('0xb')](),controller[_0x6334('0x13')]);module[_0x6334('0x14')]=router; \ No newline at end of file +var _0x4034=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','update','delete','multer','util'];(function(_0x332bc1,_0x2c4611){var _0x14d91d=function(_0x1ef4da){while(--_0x1ef4da){_0x332bc1['push'](_0x332bc1['shift']());}};_0x14d91d(++_0x2c4611);}(_0x4034,0x1f2));var _0x4403=function(_0x12c4cd,_0xdebe29){_0x12c4cd=_0x12c4cd-0x0;var _0x18a029=_0x4034[_0x12c4cd];return _0x18a029;};'use strict';var multer=require(_0x4403('0x0'));var util=require(_0x4403('0x1'));var path=require('path');var timeout=require(_0x4403('0x2'));var express=require(_0x4403('0x3'));var router=express[_0x4403('0x4')]();var fs_extra=require(_0x4403('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4403('0x6'));var config=require(_0x4403('0x7'));var controller=require('./squareReportDetail.controller');router[_0x4403('0x8')]('/',auth[_0x4403('0x9')](),controller[_0x4403('0xa')]);router[_0x4403('0x8')](_0x4403('0xb'),auth[_0x4403('0x9')](),controller[_0x4403('0xc')]);router[_0x4403('0x8')]('/:id',auth[_0x4403('0x9')](),controller[_0x4403('0xd')]);router[_0x4403('0xe')]('/',auth[_0x4403('0x9')](),controller[_0x4403('0xf')]);router[_0x4403('0x10')](_0x4403('0x11'),auth['isAuthenticated'](),controller[_0x4403('0x12')]);router[_0x4403('0x13')]('/:id',auth[_0x4403('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 015d169..7223632 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 _0x7211=['STRING','exports'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x7211,0x123));var _0x1721=function(_0x227f71,_0x4b8a7d){_0x227f71=_0x227f71-0x0;var _0x2aeb82=_0x7211[_0x227f71];return _0x2aeb82;};'use strict';var Sequelize=require('sequelize');module[_0x1721('0x0')]={'uniqueid':{'type':Sequelize[_0x1721('0x1')]},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0x1721('0x1')]},'callerid':{'type':Sequelize[_0x1721('0x1')]}}; \ No newline at end of file +var _0xacf6=['exports','STRING','TEXT','sequelize'];(function(_0x579fa4,_0x1911e0){var _0x514fa2=function(_0x31dd24){while(--_0x31dd24){_0x579fa4['push'](_0x579fa4['shift']());}};_0x514fa2(++_0x1911e0);}(_0xacf6,0x1cb));var _0x6acf=function(_0x558111,_0x33ec88){_0x558111=_0x558111-0x0;var _0x230c53=_0xacf6[_0x558111];return _0x230c53;};'use strict';var Sequelize=require(_0x6acf('0x0'));module[_0x6acf('0x1')]={'uniqueid':{'type':Sequelize[_0x6acf('0x2')]},'node':{'type':Sequelize[_0x6acf('0x2')]},'application':{'type':Sequelize[_0x6acf('0x2')]},'data':{'type':Sequelize[_0x6acf('0x3')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 678497d..7f675af 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 _0x7f6e=['path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','reject','save','then','destroy','end','error','stack','name','send','index','map','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','type','options','SquareDetailsReport','includeAll','include','rows','catch','find','create','body','update','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util'];(function(_0x582a91,_0x17bf51){var _0x1a5a21=function(_0xd5c4e3){while(--_0xd5c4e3){_0x582a91['push'](_0x582a91['shift']());}};_0x1a5a21(++_0x17bf51);}(_0x7f6e,0x1ae));var _0xe7f6=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x7f6e[_0x164eca];return _0x2ce562;};'use strict';var emlformat=require(_0xe7f6('0x0'));var rimraf=require(_0xe7f6('0x1'));var zipdir=require(_0xe7f6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe7f6('0x3'));var moment=require(_0xe7f6('0x4'));var BPromise=require(_0xe7f6('0x5'));var Mustache=require(_0xe7f6('0x6'));var util=require(_0xe7f6('0x7'));var path=require(_0xe7f6('0x8'));var sox=require(_0xe7f6('0x9'));var csv=require(_0xe7f6('0xa'));var ejs=require(_0xe7f6('0xb'));var fs=require('fs');var fs_extra=require(_0xe7f6('0xc'));var _=require('lodash');var squel=require(_0xe7f6('0xd'));var crypto=require(_0xe7f6('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xe7f6('0xf'));var toCsv=require(_0xe7f6('0xa'));var querystring=require(_0xe7f6('0x10'));var Papa=require('papaparse');var Redis=require(_0xe7f6('0x11'));var authService=require(_0xe7f6('0x12'));var qs=require(_0xe7f6('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe7f6('0x14'));var logger=require(_0xe7f6('0x15'))(_0xe7f6('0x16'));var utils=require('../../config/utils');var config=require(_0xe7f6('0x17'));var licenseUtil=require(_0xe7f6('0x18'));var db=require(_0xe7f6('0x19'))['db'];function respondWithStatusCode(_0x455c81,_0x17468b){_0x17468b=_0x17468b||0xcc;return function(_0x2d4156){if(_0x2d4156){return _0x455c81[_0xe7f6('0x1a')](_0x17468b);}return _0x455c81[_0xe7f6('0x1b')](_0x17468b)['end']();};}function respondWithResult(_0x3c0f63,_0x4e7f16){_0x4e7f16=_0x4e7f16||0xc8;return function(_0x50686a){if(_0x50686a){return _0x3c0f63[_0xe7f6('0x1b')](_0x4e7f16)[_0xe7f6('0x1c')](_0x50686a);}};}function respondWithFilteredResult(_0x5248bc,_0x4ec51a){return function(_0x3cce6a){if(_0x3cce6a){var _0x2c41ae=typeof _0x4ec51a[_0xe7f6('0x1d')]===_0xe7f6('0x1e')&&typeof _0x4ec51a[_0xe7f6('0x1f')]===_0xe7f6('0x1e');var _0x2c7e4b=_0x3cce6a[_0xe7f6('0x20')];var _0x51b549=_0x2c41ae?0x0:_0x4ec51a[_0xe7f6('0x1d')];var _0x6076b0=_0x2c41ae?_0x3cce6a['count']:_0x4ec51a[_0xe7f6('0x1d')]+_0x4ec51a['limit'];var _0x18f265;if(_0x6076b0>=_0x2c7e4b){_0x6076b0=_0x2c7e4b;_0x18f265=0xc8;}else{_0x18f265=0xce;}_0x5248bc[_0xe7f6('0x1b')](_0x18f265);return _0x5248bc['set'](_0xe7f6('0x21'),_0x51b549+'-'+_0x6076b0+'/'+_0x2c7e4b)['json'](_0x3cce6a);}return null;};}function patchUpdates(_0x39c78e){return function(_0xf1e046){try{jsonpatch['apply'](_0xf1e046,_0x39c78e,!![]);}catch(_0x3b1283){return BPromise[_0xe7f6('0x22')](_0x3b1283);}return _0xf1e046[_0xe7f6('0x23')]();};}function saveUpdates(_0x2db6ed,_0x2c5bd4){return function(_0x17df6d){if(_0x17df6d){return _0x17df6d['update'](_0x2db6ed)[_0xe7f6('0x24')](function(_0x3581e6){return _0x3581e6;});}return null;};}function removeEntity(_0xe4c04e,_0x236ed4){return function(_0x137874){if(_0x137874){return _0x137874[_0xe7f6('0x25')]()[_0xe7f6('0x24')](function(){_0xe4c04e[_0xe7f6('0x1b')](0xcc)[_0xe7f6('0x26')]();});}};}function handleEntityNotFound(_0x653e10,_0x3e3ff8){return function(_0x48bbae){if(!_0x48bbae){_0x653e10[_0xe7f6('0x1a')](0x194);}return _0x48bbae;};}function handleError(_0x1dfcf9,_0x3f9f21){_0x3f9f21=_0x3f9f21||0x1f4;return function(_0x52e6db){logger[_0xe7f6('0x27')](_0x52e6db[_0xe7f6('0x28')]);if(_0x52e6db[_0xe7f6('0x29')]){delete _0x52e6db[_0xe7f6('0x29')];}_0x1dfcf9['status'](_0x3f9f21)[_0xe7f6('0x2a')](_0x52e6db);};}exports[_0xe7f6('0x2b')]=function(_0x1faa9d,_0x1041b3){var _0xa1ac46={},_0x560758={},_0x1c2718={'count':0x0,'rows':[]};var _0x435bd8=_[_0xe7f6('0x2c')](db['SquareDetailsReport'][_0xe7f6('0x2d')],function(_0x5351a9){return{'name':_0x5351a9['fieldName'],'type':_0x5351a9['type']['key']};});_0x560758[_0xe7f6('0x2e')]=_[_0xe7f6('0x2c')](_0x435bd8,'name');_0x560758[_0xe7f6('0x2f')]=_[_0xe7f6('0x30')](_0x1faa9d['query']);_0x560758[_0xe7f6('0x31')]=_[_0xe7f6('0x32')](_0x560758[_0xe7f6('0x2e')],_0x560758[_0xe7f6('0x2f')]);_0xa1ac46[_0xe7f6('0x33')]=_['intersection'](_0x560758[_0xe7f6('0x2e')],qs['fields'](_0x1faa9d[_0xe7f6('0x2f')][_0xe7f6('0x34')]));_0xa1ac46['attributes']=_0xa1ac46[_0xe7f6('0x33')][_0xe7f6('0x35')]?_0xa1ac46[_0xe7f6('0x33')]:_0x560758['model'];if(!_0x1faa9d['query'][_0xe7f6('0x36')]('nolimit')){_0xa1ac46[_0xe7f6('0x1f')]=qs[_0xe7f6('0x1f')](_0x1faa9d[_0xe7f6('0x2f')]['limit']);_0xa1ac46[_0xe7f6('0x1d')]=qs['offset'](_0x1faa9d[_0xe7f6('0x2f')][_0xe7f6('0x1d')]);}_0xa1ac46[_0xe7f6('0x37')]=qs[_0xe7f6('0x38')](_0x1faa9d[_0xe7f6('0x2f')][_0xe7f6('0x38')]);_0xa1ac46[_0xe7f6('0x39')]=qs[_0xe7f6('0x31')](_['pick'](_0x1faa9d[_0xe7f6('0x2f')],_0x560758[_0xe7f6('0x31')]),_0x435bd8);if(_0x1faa9d[_0xe7f6('0x2f')][_0xe7f6('0x3a')]){_0xa1ac46[_0xe7f6('0x39')]=_[_0xe7f6('0x3b')](_0xa1ac46[_0xe7f6('0x39')],{'$or':_['map'](_0x435bd8,function(_0x3c1e3f){if(_0x3c1e3f[_0xe7f6('0x3c')]!=='VIRTUAL'){var _0x1b39ff={};_0x1b39ff[_0x3c1e3f[_0xe7f6('0x29')]]={'$like':'%'+_0x1faa9d[_0xe7f6('0x2f')][_0xe7f6('0x3a')]+'%'};return _0x1b39ff;}})});}_0xa1ac46=_[_0xe7f6('0x3b')]({},_0xa1ac46,_0x1faa9d[_0xe7f6('0x3d')]);var _0x5b760c={'where':_0xa1ac46[_0xe7f6('0x39')]};return db[_0xe7f6('0x3e')][_0xe7f6('0x20')](_0x5b760c)[_0xe7f6('0x24')](function(_0x224242){_0x1c2718['count']=_0x224242;if(_0x1faa9d['query'][_0xe7f6('0x3f')]){_0xa1ac46[_0xe7f6('0x40')]=[{'all':!![]}];}return db[_0xe7f6('0x3e')]['findAll'](_0xa1ac46);})[_0xe7f6('0x24')](function(_0x1cd0d4){_0x1c2718[_0xe7f6('0x41')]=_0x1cd0d4;return _0x1c2718;})['then'](respondWithFilteredResult(_0x1041b3,_0xa1ac46))[_0xe7f6('0x42')](handleError(_0x1041b3,null));};exports['show']=function(_0x828db6,_0x4f0942){var _0xe0630e={'raw':!![],'where':{'id':_0x828db6['params']['id']}},_0x61f46e={};_0x61f46e[_0xe7f6('0x2e')]=_[_0xe7f6('0x30')](db[_0xe7f6('0x3e')][_0xe7f6('0x2d')]);_0x61f46e[_0xe7f6('0x2f')]=_[_0xe7f6('0x30')](_0x828db6[_0xe7f6('0x2f')]);_0x61f46e[_0xe7f6('0x31')]=_[_0xe7f6('0x32')](_0x61f46e['model'],_0x61f46e[_0xe7f6('0x2f')]);_0xe0630e['attributes']=_['intersection'](_0x61f46e[_0xe7f6('0x2e')],qs[_0xe7f6('0x34')](_0x828db6[_0xe7f6('0x2f')][_0xe7f6('0x34')]));_0xe0630e[_0xe7f6('0x33')]=_0xe0630e[_0xe7f6('0x33')][_0xe7f6('0x35')]?_0xe0630e[_0xe7f6('0x33')]:_0x61f46e[_0xe7f6('0x2e')];if(_0x828db6[_0xe7f6('0x2f')][_0xe7f6('0x3f')]){_0xe0630e[_0xe7f6('0x40')]=[{'all':!![]}];}_0xe0630e=_[_0xe7f6('0x3b')]({},_0xe0630e,_0x828db6[_0xe7f6('0x3d')]);return db[_0xe7f6('0x3e')][_0xe7f6('0x43')](_0xe0630e)[_0xe7f6('0x24')](handleEntityNotFound(_0x4f0942,null))[_0xe7f6('0x24')](respondWithResult(_0x4f0942,null))[_0xe7f6('0x42')](handleError(_0x4f0942,null));};exports[_0xe7f6('0x44')]=function(_0x4f755e,_0x2b865b){return db['SquareDetailsReport'][_0xe7f6('0x44')](_0x4f755e[_0xe7f6('0x45')],{})[_0xe7f6('0x24')](respondWithResult(_0x2b865b,0xc9))[_0xe7f6('0x42')](handleError(_0x2b865b,null));};exports[_0xe7f6('0x46')]=function(_0x3fab68,_0x4405a8){if(_0x3fab68[_0xe7f6('0x45')]['id']){delete _0x3fab68[_0xe7f6('0x45')]['id'];}return db[_0xe7f6('0x3e')][_0xe7f6('0x43')]({'where':{'id':_0x3fab68['params']['id']}})[_0xe7f6('0x24')](handleEntityNotFound(_0x4405a8,null))[_0xe7f6('0x24')](saveUpdates(_0x3fab68[_0xe7f6('0x45')],null))[_0xe7f6('0x24')](respondWithResult(_0x4405a8,null))[_0xe7f6('0x42')](handleError(_0x4405a8,null));};exports['destroy']=function(_0x27b52b,_0x191238){return db['SquareDetailsReport'][_0xe7f6('0x43')]({'where':{'id':_0x27b52b[_0xe7f6('0x47')]['id']}})[_0xe7f6('0x24')](handleEntityNotFound(_0x191238,null))[_0xe7f6('0x24')](removeEntity(_0x191238,null))[_0xe7f6('0x42')](handleError(_0x191238,null));};exports['describe']=function(_0x3a4dc7,_0x1d91d8){return db[_0xe7f6('0x3e')][_0xe7f6('0x48')]()['then'](respondWithResult(_0x1d91d8,null))[_0xe7f6('0x42')](handleError(_0x1d91d8,null));}; \ No newline at end of file +var _0xaf5a=['stack','name','index','map','SquareDetailsReport','rawAttributes','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','end'];(function(_0x4c3971,_0x3bf220){var _0x5997cc=function(_0x3cb6c0){while(--_0x3cb6c0){_0x4c3971['push'](_0x4c3971['shift']());}};_0x5997cc(++_0x3bf220);}(_0xaf5a,0xb4));var _0xaaf5=function(_0x2ac2de,_0x109a1e){_0x2ac2de=_0x2ac2de-0x0;var _0xf453a1=_0xaf5a[_0x2ac2de];return _0xf453a1;};'use strict';var emlformat=require(_0xaaf5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xaaf5('0x1'));var jsonpatch=require(_0xaaf5('0x2'));var rp=require(_0xaaf5('0x3'));var moment=require(_0xaaf5('0x4'));var BPromise=require(_0xaaf5('0x5'));var Mustache=require(_0xaaf5('0x6'));var util=require(_0xaaf5('0x7'));var path=require(_0xaaf5('0x8'));var sox=require('sox');var csv=require(_0xaaf5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xaaf5('0xa'));var _=require('lodash');var squel=require(_0xaaf5('0xb'));var crypto=require(_0xaaf5('0xc'));var jsforce=require(_0xaaf5('0xd'));var deskjs=require(_0xaaf5('0xe'));var toCsv=require(_0xaaf5('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xaaf5('0xf'));var authService=require(_0xaaf5('0x10'));var qs=require(_0xaaf5('0x11'));var as=require(_0xaaf5('0x12'));var hardwareService=require(_0xaaf5('0x13'));var logger=require(_0xaaf5('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xaaf5('0x15'));var licenseUtil=require(_0xaaf5('0x16'));var db=require(_0xaaf5('0x17'))['db'];function respondWithStatusCode(_0x5898e6,_0x4e14ef){_0x4e14ef=_0x4e14ef||0xcc;return function(_0x812fa2){if(_0x812fa2){return _0x5898e6[_0xaaf5('0x18')](_0x4e14ef);}return _0x5898e6['status'](_0x4e14ef)['end']();};}function respondWithResult(_0x250487,_0x4b6756){_0x4b6756=_0x4b6756||0xc8;return function(_0xe38f90){if(_0xe38f90){return _0x250487[_0xaaf5('0x19')](_0x4b6756)['json'](_0xe38f90);}};}function respondWithFilteredResult(_0x36a8b2,_0x593618){return function(_0x1c3ae3){if(_0x1c3ae3){var _0x2a152f=typeof _0x593618['offset']==='undefined'&&typeof _0x593618[_0xaaf5('0x1a')]==='undefined';var _0x5a442b=_0x1c3ae3[_0xaaf5('0x1b')];var _0x1d215a=_0x2a152f?0x0:_0x593618[_0xaaf5('0x1c')];var _0x243fe6=_0x2a152f?_0x1c3ae3['count']:_0x593618['offset']+_0x593618[_0xaaf5('0x1a')];var _0x50c764;if(_0x243fe6>=_0x5a442b){_0x243fe6=_0x5a442b;_0x50c764=0xc8;}else{_0x50c764=0xce;}_0x36a8b2[_0xaaf5('0x19')](_0x50c764);return _0x36a8b2[_0xaaf5('0x1d')](_0xaaf5('0x1e'),_0x1d215a+'-'+_0x243fe6+'/'+_0x5a442b)[_0xaaf5('0x1f')](_0x1c3ae3);}return null;};}function patchUpdates(_0x5b1025){return function(_0x1b7b38){try{jsonpatch[_0xaaf5('0x20')](_0x1b7b38,_0x5b1025,!![]);}catch(_0x467dad){return BPromise[_0xaaf5('0x21')](_0x467dad);}return _0x1b7b38[_0xaaf5('0x22')]();};}function saveUpdates(_0x87466e,_0x253a1c){return function(_0x551eeb){if(_0x551eeb){return _0x551eeb[_0xaaf5('0x23')](_0x87466e)[_0xaaf5('0x24')](function(_0x3b3175){return _0x3b3175;});}return null;};}function removeEntity(_0x5e3561,_0x601914){return function(_0x5b0dc9){if(_0x5b0dc9){return _0x5b0dc9[_0xaaf5('0x25')]()[_0xaaf5('0x24')](function(){_0x5e3561[_0xaaf5('0x19')](0xcc)[_0xaaf5('0x26')]();});}};}function handleEntityNotFound(_0x1faf7f,_0x5e43e1){return function(_0x4a85bb){if(!_0x4a85bb){_0x1faf7f[_0xaaf5('0x18')](0x194);}return _0x4a85bb;};}function handleError(_0x22f8eb,_0xf2c6b3){_0xf2c6b3=_0xf2c6b3||0x1f4;return function(_0x393d84){logger['error'](_0x393d84[_0xaaf5('0x27')]);if(_0x393d84[_0xaaf5('0x28')]){delete _0x393d84[_0xaaf5('0x28')];}_0x22f8eb[_0xaaf5('0x19')](_0xf2c6b3)['send'](_0x393d84);};}exports[_0xaaf5('0x29')]=function(_0x32c696,_0x22a2e6){var _0x266a2c={},_0x117919={},_0xffe92e={'count':0x0,'rows':[]};var _0x44ecb0=_[_0xaaf5('0x2a')](db[_0xaaf5('0x2b')][_0xaaf5('0x2c')],function(_0x5017a9){return{'name':_0x5017a9['fieldName'],'type':_0x5017a9[_0xaaf5('0x2d')]['key']};});_0x117919[_0xaaf5('0x2e')]=_['map'](_0x44ecb0,_0xaaf5('0x28'));_0x117919[_0xaaf5('0x2f')]=_[_0xaaf5('0x30')](_0x32c696[_0xaaf5('0x2f')]);_0x117919[_0xaaf5('0x31')]=_['intersection'](_0x117919[_0xaaf5('0x2e')],_0x117919[_0xaaf5('0x2f')]);_0x266a2c[_0xaaf5('0x32')]=_[_0xaaf5('0x33')](_0x117919[_0xaaf5('0x2e')],qs[_0xaaf5('0x34')](_0x32c696[_0xaaf5('0x2f')]['fields']));_0x266a2c[_0xaaf5('0x32')]=_0x266a2c[_0xaaf5('0x32')][_0xaaf5('0x35')]?_0x266a2c[_0xaaf5('0x32')]:_0x117919[_0xaaf5('0x2e')];if(!_0x32c696[_0xaaf5('0x2f')][_0xaaf5('0x36')]('nolimit')){_0x266a2c['limit']=qs[_0xaaf5('0x1a')](_0x32c696[_0xaaf5('0x2f')][_0xaaf5('0x1a')]);_0x266a2c[_0xaaf5('0x1c')]=qs[_0xaaf5('0x1c')](_0x32c696[_0xaaf5('0x2f')][_0xaaf5('0x1c')]);}_0x266a2c[_0xaaf5('0x37')]=qs[_0xaaf5('0x38')](_0x32c696[_0xaaf5('0x2f')][_0xaaf5('0x38')]);_0x266a2c[_0xaaf5('0x39')]=qs['filters'](_[_0xaaf5('0x3a')](_0x32c696[_0xaaf5('0x2f')],_0x117919[_0xaaf5('0x31')]),_0x44ecb0);if(_0x32c696[_0xaaf5('0x2f')]['filter']){_0x266a2c[_0xaaf5('0x39')]=_[_0xaaf5('0x3b')](_0x266a2c[_0xaaf5('0x39')],{'$or':_[_0xaaf5('0x2a')](_0x44ecb0,function(_0x5c9f5d){if(_0x5c9f5d[_0xaaf5('0x2d')]!=='VIRTUAL'){var _0x10f556={};_0x10f556[_0x5c9f5d['name']]={'$like':'%'+_0x32c696['query'][_0xaaf5('0x3c')]+'%'};return _0x10f556;}})});}_0x266a2c=_[_0xaaf5('0x3b')]({},_0x266a2c,_0x32c696[_0xaaf5('0x3d')]);var _0x49acbe={'where':_0x266a2c[_0xaaf5('0x39')]};return db['SquareDetailsReport'][_0xaaf5('0x1b')](_0x49acbe)['then'](function(_0x167016){_0xffe92e['count']=_0x167016;if(_0x32c696[_0xaaf5('0x2f')][_0xaaf5('0x3e')]){_0x266a2c[_0xaaf5('0x3f')]=[{'all':!![]}];}return db[_0xaaf5('0x2b')][_0xaaf5('0x40')](_0x266a2c);})['then'](function(_0x1791a4){_0xffe92e[_0xaaf5('0x41')]=_0x1791a4;return _0xffe92e;})['then'](respondWithFilteredResult(_0x22a2e6,_0x266a2c))[_0xaaf5('0x42')](handleError(_0x22a2e6,null));};exports[_0xaaf5('0x43')]=function(_0x5aff81,_0x57bae1){var _0x393a28={'raw':!![],'where':{'id':_0x5aff81[_0xaaf5('0x44')]['id']}},_0xe0404f={};_0xe0404f[_0xaaf5('0x2e')]=_[_0xaaf5('0x30')](db['SquareDetailsReport'][_0xaaf5('0x2c')]);_0xe0404f['query']=_['keys'](_0x5aff81[_0xaaf5('0x2f')]);_0xe0404f['filters']=_[_0xaaf5('0x33')](_0xe0404f['model'],_0xe0404f[_0xaaf5('0x2f')]);_0x393a28['attributes']=_[_0xaaf5('0x33')](_0xe0404f['model'],qs[_0xaaf5('0x34')](_0x5aff81[_0xaaf5('0x2f')][_0xaaf5('0x34')]));_0x393a28[_0xaaf5('0x32')]=_0x393a28[_0xaaf5('0x32')][_0xaaf5('0x35')]?_0x393a28['attributes']:_0xe0404f[_0xaaf5('0x2e')];if(_0x5aff81[_0xaaf5('0x2f')][_0xaaf5('0x3e')]){_0x393a28[_0xaaf5('0x3f')]=[{'all':!![]}];}_0x393a28=_[_0xaaf5('0x3b')]({},_0x393a28,_0x5aff81[_0xaaf5('0x3d')]);return db[_0xaaf5('0x2b')][_0xaaf5('0x45')](_0x393a28)[_0xaaf5('0x24')](handleEntityNotFound(_0x57bae1,null))['then'](respondWithResult(_0x57bae1,null))['catch'](handleError(_0x57bae1,null));};exports[_0xaaf5('0x46')]=function(_0xdb555d,_0x1117a3){return db[_0xaaf5('0x2b')][_0xaaf5('0x46')](_0xdb555d[_0xaaf5('0x47')],{})[_0xaaf5('0x24')](respondWithResult(_0x1117a3,0xc9))[_0xaaf5('0x42')](handleError(_0x1117a3,null));};exports[_0xaaf5('0x23')]=function(_0x3289a7,_0xa0351){if(_0x3289a7[_0xaaf5('0x47')]['id']){delete _0x3289a7[_0xaaf5('0x47')]['id'];}return db[_0xaaf5('0x2b')][_0xaaf5('0x45')]({'where':{'id':_0x3289a7[_0xaaf5('0x44')]['id']}})[_0xaaf5('0x24')](handleEntityNotFound(_0xa0351,null))[_0xaaf5('0x24')](saveUpdates(_0x3289a7[_0xaaf5('0x47')],null))[_0xaaf5('0x24')](respondWithResult(_0xa0351,null))[_0xaaf5('0x42')](handleError(_0xa0351,null));};exports[_0xaaf5('0x25')]=function(_0x1d2e53,_0x3bd0fb){return db['SquareDetailsReport'][_0xaaf5('0x45')]({'where':{'id':_0x1d2e53[_0xaaf5('0x44')]['id']}})[_0xaaf5('0x24')](handleEntityNotFound(_0x3bd0fb,null))[_0xaaf5('0x24')](removeEntity(_0x3bd0fb,null))['catch'](handleError(_0x3bd0fb,null));};exports[_0xaaf5('0x48')]=function(_0x18cc8c,_0x138e89){return db['SquareDetailsReport'][_0xaaf5('0x48')]()[_0xaaf5('0x24')](respondWithResult(_0x138e89,null))[_0xaaf5('0x42')](handleError(_0x138e89,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 3eeee3b..937e044 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 _0xcf06=['moment','request-promise','path','rimraf','define','SquareDetailsReport','report_square_details','lodash','util','../../config/logger','api'];(function(_0x56878b,_0x21aa20){var _0x101e9a=function(_0x45965f){while(--_0x45965f){_0x56878b['push'](_0x56878b['shift']());}};_0x101e9a(++_0x21aa20);}(_0xcf06,0xd8));var _0x6cf0=function(_0x33e0d7,_0x5ca955){_0x33e0d7=_0x33e0d7-0x0;var _0x3b1170=_0xcf06[_0x33e0d7];return _0x3b1170;};'use strict';var _=require(_0x6cf0('0x0'));var util=require(_0x6cf0('0x1'));var logger=require(_0x6cf0('0x2'))(_0x6cf0('0x3'));var moment=require(_0x6cf0('0x4'));var BPromise=require('bluebird');var rp=require(_0x6cf0('0x5'));var fs=require('fs');var path=require(_0x6cf0('0x6'));var rimraf=require(_0x6cf0('0x7'));var config=require('../../config/environment');var attributes=require('./squareReportDetail.attributes');module['exports']=function(_0x55d1d7,_0x1aecba){return _0x55d1d7[_0x6cf0('0x8')](_0x6cf0('0x9'),attributes,{'tableName':_0x6cf0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x04f9=['api','bluebird','request-promise','path','rimraf','./squareReportDetail.attributes','exports','define','SquareDetailsReport','report_square_details','lodash','util','../../config/logger'];(function(_0x1813da,_0x35d8f4){var _0x689fae=function(_0x51eadf){while(--_0x51eadf){_0x1813da['push'](_0x1813da['shift']());}};_0x689fae(++_0x35d8f4);}(_0x04f9,0x65));var _0x904f=function(_0x2c2bd7,_0x3105de){_0x2c2bd7=_0x2c2bd7-0x0;var _0x585576=_0x04f9[_0x2c2bd7];return _0x585576;};'use strict';var _=require(_0x904f('0x0'));var util=require(_0x904f('0x1'));var logger=require(_0x904f('0x2'))(_0x904f('0x3'));var moment=require('moment');var BPromise=require(_0x904f('0x4'));var rp=require(_0x904f('0x5'));var fs=require('fs');var path=require(_0x904f('0x6'));var rimraf=require(_0x904f('0x7'));var config=require('../../config/environment');var attributes=require(_0x904f('0x8'));module[_0x904f('0x9')]=function(_0x1d2e6e,_0x4dae56){return _0x1d2e6e[_0x904f('0xa')](_0x904f('0xb'),attributes,{'tableName':_0x904f('0xc'),'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 476d11a..8bfafa3 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 _0x32b6=['request','then','debug','request\x20sent','stringify','error','code','SquareDetailsReport,\x20%s,\x20%s','message','info','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','catch','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x2cf2e9,_0xd58ea1){var _0xd3670d=function(_0x272868){while(--_0x272868){_0x2cf2e9['push'](_0x2cf2e9['shift']());}};_0xd3670d(++_0xd58ea1);}(_0x32b6,0x1d1));var _0x632b=function(_0x136695,_0x360839){_0x136695=_0x136695-0x0;var _0x246080=_0x32b6[_0x136695];return _0x246080;};'use strict';var _=require(_0x632b('0x0'));var util=require(_0x632b('0x1'));var moment=require('moment');var BPromise=require(_0x632b('0x2'));var rs=require(_0x632b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x632b('0x4'));var logger=require(_0x632b('0x5'))(_0x632b('0x6'));var config=require(_0x632b('0x7'));var jayson=require(_0x632b('0x8'));var client=jayson[_0x632b('0x9')][_0x632b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x10458a,_0x3bbf43,_0x43d6c7){return new BPromise(function(_0x5128f5,_0x33d711){return client[_0x632b('0xb')](_0x10458a,_0x43d6c7)[_0x632b('0xc')](function(_0x174201){logger['info']('SquareDetailsReport,\x20%s,\x20%s',_0x3bbf43,'request\x20sent');logger[_0x632b('0xd')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x3bbf43,_0x632b('0xe'),JSON[_0x632b('0xf')](_0x174201));if(_0x174201[_0x632b('0x10')]){if(_0x174201[_0x632b('0x10')][_0x632b('0x11')]===0x1f4){logger[_0x632b('0x10')](_0x632b('0x12'),_0x3bbf43,_0x174201[_0x632b('0x10')][_0x632b('0x13')]);return _0x33d711(_0x174201['error'][_0x632b('0x13')]);}logger[_0x632b('0x10')](_0x632b('0x12'),_0x3bbf43,_0x174201['error'][_0x632b('0x13')]);return _0x5128f5(_0x174201[_0x632b('0x10')][_0x632b('0x13')]);}else{logger[_0x632b('0x14')](_0x632b('0x12'),_0x3bbf43,_0x632b('0xe'));_0x5128f5(_0x174201['result'][_0x632b('0x13')]);}})['catch'](function(_0x4fdef2){logger[_0x632b('0x10')]('SquareDetailsReport,\x20%s,\x20%s',_0x3bbf43,_0x4fdef2);_0x33d711(_0x4fdef2);});});}exports[_0x632b('0x15')]=function(_0x3bb27f){var _0x28c472=this;return new Promise(function(_0x51c894,_0x2f3e88){return db[_0x632b('0x16')][_0x632b('0x17')](_0x3bb27f[_0x632b('0x18')],{'raw':_0x3bb27f['options']?_0x3bb27f[_0x632b('0x19')][_0x632b('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x116f62){logger['info']('CreateSquareDetailsReport',_0x3bb27f);logger[_0x632b('0xd')]('CreateSquareDetailsReport',_0x3bb27f,JSON[_0x632b('0xf')](_0x116f62));_0x51c894(_0x116f62);})[_0x632b('0x1b')](function(_0x2a6833){logger['error'](_0x632b('0x15'),_0x2a6833[_0x632b('0x13')],_0x3bb27f);_0x2f3e88(_0x28c472['error'](0x1f4,_0x2a6833[_0x632b('0x13')]));});});}; \ No newline at end of file +var _0x7382=['message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','body','options','raw','stringify','util','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','SquareDetailsReport,\x20%s,\x20%s','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x2e6d90,_0x4343a3){var _0x30ce93=function(_0x1f7a4e){while(--_0x1f7a4e){_0x2e6d90['push'](_0x2e6d90['shift']());}};_0x30ce93(++_0x4343a3);}(_0x7382,0x111));var _0x2738=function(_0x6c712d,_0x3ea26d){_0x6c712d=_0x6c712d-0x0;var _0x192acc=_0x7382[_0x6c712d];return _0x192acc;};'use strict';var _=require('lodash');var util=require(_0x2738('0x0'));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(_0x2738('0x1'));var logger=require(_0x2738('0x2'))(_0x2738('0x3'));var config=require(_0x2738('0x4'));var jayson=require(_0x2738('0x5'));var client=jayson['client'][_0x2738('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x2bc38a,_0xd74b07,_0x523aef){return new BPromise(function(_0x4235e7,_0x487d14){return client[_0x2738('0x7')](_0x2bc38a,_0x523aef)['then'](function(_0x476864){logger[_0x2738('0x8')](_0x2738('0x9'),_0xd74b07,'request\x20sent');logger[_0x2738('0xa')](_0x2738('0xb'),_0xd74b07,_0x2738('0xc'),JSON['stringify'](_0x476864));if(_0x476864['error']){if(_0x476864[_0x2738('0xd')][_0x2738('0xe')]===0x1f4){logger[_0x2738('0xd')](_0x2738('0x9'),_0xd74b07,_0x476864[_0x2738('0xd')][_0x2738('0xf')]);return _0x487d14(_0x476864[_0x2738('0xd')][_0x2738('0xf')]);}logger[_0x2738('0xd')](_0x2738('0x9'),_0xd74b07,_0x476864[_0x2738('0xd')]['message']);return _0x4235e7(_0x476864[_0x2738('0xd')][_0x2738('0xf')]);}else{logger['info'](_0x2738('0x9'),_0xd74b07,'request\x20sent');_0x4235e7(_0x476864[_0x2738('0x10')]['message']);}})[_0x2738('0x11')](function(_0x568065){logger[_0x2738('0xd')](_0x2738('0x9'),_0xd74b07,_0x568065);_0x487d14(_0x568065);});});}exports[_0x2738('0x12')]=function(_0x3c6810){var _0x1d0aca=this;return new Promise(function(_0x1e0f57,_0x42685a){return db[_0x2738('0x13')]['create'](_0x3c6810[_0x2738('0x14')],{'raw':_0x3c6810['options']?_0x3c6810[_0x2738('0x15')][_0x2738('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x5a1d61){logger[_0x2738('0x8')](_0x2738('0x12'),_0x3c6810);logger[_0x2738('0xa')](_0x2738('0x12'),_0x3c6810,JSON[_0x2738('0x17')](_0x5a1d61));_0x1e0f57(_0x5a1d61);})[_0x2738('0x11')](function(_0x18e1d8){logger[_0x2738('0xd')](_0x2738('0x12'),_0x18e1d8[_0x2738('0xf')],_0x3c6810);_0x42685a(_0x1d0aca[_0x2738('0xd')](0x1f4,_0x18e1d8['message']));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 27e44a3..10f30d5 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 _0x3e55=['../../components/auth/service','get','isAuthenticated','index','/process/:pid/kill','killProcess','exports','express'];(function(_0x4295bc,_0x55b581){var _0x2f0298=function(_0x3015e2){while(--_0x3015e2){_0x4295bc['push'](_0x4295bc['shift']());}};_0x2f0298(++_0x55b581);}(_0x3e55,0x127));var _0x53e5=function(_0x1bc35b,_0x2b9a41){_0x1bc35b=_0x1bc35b-0x0;var _0x2400d7=_0x3e55[_0x1bc35b];return _0x2400d7;};'use strict';var express=require(_0x53e5('0x0'));var router=express['Router']();var auth=require(_0x53e5('0x1'));var controller=require('./system.controller');router[_0x53e5('0x2')]('/',auth[_0x53e5('0x3')](),controller[_0x53e5('0x4')]);router[_0x53e5('0x2')](_0x53e5('0x5'),auth['isAuthenticated'](),controller[_0x53e5('0x6')]);module[_0x53e5('0x7')]=router; \ No newline at end of file +var _0xf510=['express','../../components/auth/service','./system.controller','get','isAuthenticated','index','/process/:pid/kill','killProcess'];(function(_0x5cdb29,_0x1fde56){var _0x448a6f=function(_0x43d70d){while(--_0x43d70d){_0x5cdb29['push'](_0x5cdb29['shift']());}};_0x448a6f(++_0x1fde56);}(_0xf510,0x1b0));var _0x0f51=function(_0x46dc12,_0x55ccc3){_0x46dc12=_0x46dc12-0x0;var _0x4c1b0e=_0xf510[_0x46dc12];return _0x4c1b0e;};'use strict';var express=require(_0x0f51('0x0'));var router=express['Router']();var auth=require(_0x0f51('0x1'));var controller=require(_0x0f51('0x2'));router[_0x0f51('0x3')]('/',auth[_0x0f51('0x4')](),controller[_0x0f51('0x5')]);router[_0x0f51('0x3')](_0x0f51('0x6'),auth[_0x0f51('0x4')](),controller[_0x0f51('0x7')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index f675a99..b768b3d 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 _0x90f0=['<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','index','getAllData','then','json','catch','components/import/cm','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','length','indexOf','format','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','Process\x20with\x20pid\x20%s\x20killed\x20correctly','killProcess','child_process','exec','../../config/logger','util','bluebird','error'];(function(_0xfefea4,_0x1203bb){var _0x37f94d=function(_0x4c9ccb){while(--_0x4c9ccb){_0xfefea4['push'](_0xfefea4['shift']());}};_0x37f94d(++_0x1203bb);}(_0x90f0,0xda));var _0x090f=function(_0x3789c7,_0x3a156d){_0x3789c7=_0x3789c7-0x0;var _0x3b58ca=_0x90f0[_0x3789c7];return _0x3b58ca;};'use strict';var info=require('systeminformation');var exec=require(_0x090f('0x0'))[_0x090f('0x1')];var logger=require(_0x090f('0x2'))('api');var util=require(_0x090f('0x3'));var BPromise=require(_0x090f('0x4'));var _=require('lodash');function handleError(_0x336c23,_0x30fade,_0x49734f){_0x30fade=_0x30fade||0x1f4;return function(_0x3df2c4){logger[_0x090f('0x5')](_0x090f('0x6'),_0x49734f,_0x30fade,util[_0x090f('0x7')](_0x3df2c4,{'showHidden':![],'depth':null}));delete _0x3df2c4[_0x090f('0x8')];_0x336c23[_0x090f('0x9')](_0x30fade)[_0x090f('0xa')](_0x3df2c4);};}exports[_0x090f('0xb')]=function(_0x301335,_0x504855){return info[_0x090f('0xc')]()[_0x090f('0xd')](function(_0x391e5a){return _0x504855[_0x090f('0x9')](0xc8)[_0x090f('0xe')](_0x391e5a);})[_0x090f('0xf')](function(_0x4c837d){return _0x504855['status'](0x1f4)[_0x090f('0xe')](_0x4c837d);});};exports['killProcess']=function(_0x56b87f,_0x21c75a){var _0x149d5c=[_0x090f('0x10')];return new BPromise(function(_0x178091,_0x10bf8b){return exec(util['format'](_0x090f('0x11'),_0x56b87f[_0x090f('0x12')][_0x090f('0x13')]),function(_0x420fb8,_0x3ff5fb,_0x32c57c){if(_0x420fb8){return _0x10bf8b(_0x420fb8);}return _0x178091(_0x3ff5fb);});})['then'](function(_0x1d4234){var _0x406aac=![];var _0xd261eb=_0x1d4234[_0x090f('0x14')](/\n/);for(var _0x402b2c=0x0,_0x4aaad4=_0x149d5c[_0x090f('0x15')];_0x402b2c<_0x4aaad4,_0x406aac===![];_0x402b2c+=0x1){if(_0x1d4234[_0x090f('0x16')](_0x149d5c[_0x402b2c])>=0x0){_0x406aac=!![];}}if(!_0x406aac){throw new Error(util[_0x090f('0x17')](_0x090f('0x18'),_0x56b87f[_0x090f('0x12')]['pid']));}process[_0x090f('0x19')](_0x56b87f['params'][_0x090f('0x13')],'SIGINT');return _0x21c75a[_0x090f('0x9')](0xc8)[_0x090f('0xe')]({'message':util[_0x090f('0x17')](_0x090f('0x1a'),_0x56b87f[_0x090f('0x12')][_0x090f('0x13')])});})[_0x090f('0xf')](handleError(_0x21c75a,null,_0x090f('0x1b')));}; \ No newline at end of file +var _0x4993=['inspect','name','status','send','index','getAllData','then','json','catch','killProcess','components/import/cm','format','params','split','length','indexOf','pid','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','../../config/logger','api','util','bluebird','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s'];(function(_0x5e1450,_0x11d2a0){var _0x19ba92=function(_0x5e547a){while(--_0x5e547a){_0x5e1450['push'](_0x5e1450['shift']());}};_0x19ba92(++_0x11d2a0);}(_0x4993,0x173));var _0x3499=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x4993[_0x24237f];return _0x48298e;};'use strict';var info=require(_0x3499('0x0'));var exec=require('child_process')['exec'];var logger=require(_0x3499('0x1'))(_0x3499('0x2'));var util=require(_0x3499('0x3'));var BPromise=require(_0x3499('0x4'));var _=require('lodash');function handleError(_0x406451,_0x34189b,_0x4486f5){_0x34189b=_0x34189b||0x1f4;return function(_0x17df26){logger[_0x3499('0x5')](_0x3499('0x6'),_0x4486f5,_0x34189b,util[_0x3499('0x7')](_0x17df26,{'showHidden':![],'depth':null}));delete _0x17df26[_0x3499('0x8')];_0x406451[_0x3499('0x9')](_0x34189b)[_0x3499('0xa')](_0x17df26);};}exports[_0x3499('0xb')]=function(_0x1817a7,_0x3c25c6){return info[_0x3499('0xc')]()[_0x3499('0xd')](function(_0x42b85f){return _0x3c25c6['status'](0xc8)[_0x3499('0xe')](_0x42b85f);})[_0x3499('0xf')](function(_0x150306){return _0x3c25c6[_0x3499('0x9')](0x1f4)[_0x3499('0xe')](_0x150306);});};exports[_0x3499('0x10')]=function(_0x343cee,_0x27db00){var _0x5319db=[_0x3499('0x11')];return new BPromise(function(_0x55f8ab,_0x2fa01e){return exec(util[_0x3499('0x12')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x343cee[_0x3499('0x13')]['pid']),function(_0x275865,_0x22f8f9,_0x1b117c){if(_0x275865){return _0x2fa01e(_0x275865);}return _0x55f8ab(_0x22f8f9);});})[_0x3499('0xd')](function(_0x50c708){var _0x5dc287=![];var _0x4276be=_0x50c708[_0x3499('0x14')](/\n/);for(var _0x2d7a39=0x0,_0x36e062=_0x5319db[_0x3499('0x15')];_0x2d7a39<_0x36e062,_0x5dc287===![];_0x2d7a39+=0x1){if(_0x50c708[_0x3499('0x16')](_0x5319db[_0x2d7a39])>=0x0){_0x5dc287=!![];}}if(!_0x5dc287){throw new Error(util[_0x3499('0x12')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x343cee[_0x3499('0x13')][_0x3499('0x17')]));}process[_0x3499('0x18')](_0x343cee[_0x3499('0x13')]['pid'],_0x3499('0x19'));return _0x27db00['status'](0xc8)[_0x3499('0xe')]({'message':util['format'](_0x3499('0x1a'),_0x343cee[_0x3499('0x13')][_0x3499('0x17')])});})[_0x3499('0xf')](handleError(_0x27db00,null,'killProcess'));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 8434290..0921c34 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 _0xa372=['/:id','isAuthenticated','post','create','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','index'];(function(_0x55783b,_0xc8bacf){var _0x152da5=function(_0x2382c3){while(--_0x2382c3){_0x55783b['push'](_0x55783b['shift']());}};_0x152da5(++_0xc8bacf);}(_0xa372,0xe4));var _0x2a37=function(_0x44bcb0,_0x235aa9){_0x44bcb0=_0x44bcb0-0x0;var _0xfaf881=_0xa372[_0x44bcb0];return _0xfaf881;};'use strict';var multer=require(_0x2a37('0x0'));var util=require(_0x2a37('0x1'));var path=require(_0x2a37('0x2'));var timeout=require(_0x2a37('0x3'));var express=require('express');var router=express[_0x2a37('0x4')]();var fs_extra=require(_0x2a37('0x5'));var auth=require(_0x2a37('0x6'));var interaction=require(_0x2a37('0x7'));var config=require(_0x2a37('0x8'));var controller=require(_0x2a37('0x9'));router[_0x2a37('0xa')]('/',auth['isAuthenticated'](),controller[_0x2a37('0xb')]);router[_0x2a37('0xa')](_0x2a37('0xc'),auth[_0x2a37('0xd')](),controller['show']);router[_0x2a37('0xe')]('/',auth[_0x2a37('0xd')](),controller[_0x2a37('0xf')]);router[_0x2a37('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x2a37('0x11')]);router[_0x2a37('0x12')](_0x2a37('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x2a37('0x13')]=router; \ No newline at end of file +var _0xcdd6=['show','post','create','put','update','delete','/:id','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated'];(function(_0x516f5a,_0x8b4919){var _0x278c7b=function(_0xd8c6f6){while(--_0xd8c6f6){_0x516f5a['push'](_0x516f5a['shift']());}};_0x278c7b(++_0x8b4919);}(_0xcdd6,0x1be));var _0x6cdd=function(_0x38e2ee,_0x2abb5a){_0x38e2ee=_0x38e2ee-0x0;var _0x55e573=_0xcdd6[_0x38e2ee];return _0x55e573;};'use strict';var multer=require('multer');var util=require(_0x6cdd('0x0'));var path=require(_0x6cdd('0x1'));var timeout=require(_0x6cdd('0x2'));var express=require(_0x6cdd('0x3'));var router=express['Router']();var fs_extra=require(_0x6cdd('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6cdd('0x5'));var config=require(_0x6cdd('0x6'));var controller=require(_0x6cdd('0x7'));router[_0x6cdd('0x8')]('/',auth[_0x6cdd('0x9')](),controller['index']);router[_0x6cdd('0x8')]('/:id',auth[_0x6cdd('0x9')](),controller[_0x6cdd('0xa')]);router[_0x6cdd('0xb')]('/',auth[_0x6cdd('0x9')](),controller[_0x6cdd('0xc')]);router[_0x6cdd('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x6cdd('0xe')]);router[_0x6cdd('0xf')](_0x6cdd('0x10'),auth[_0x6cdd('0x9')](),controller[_0x6cdd('0x11')]);module[_0x6cdd('0x12')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 3165466..f9c7631 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 _0x3e22=['exports','name','STRING','#0091EA'];(function(_0x389f98,_0x107c8e){var _0x2aa7ee=function(_0x2d40c5){while(--_0x2d40c5){_0x389f98['push'](_0x389f98['shift']());}};_0x2aa7ee(++_0x107c8e);}(_0x3e22,0xa8));var _0x23e2=function(_0x509042,_0x541f21){_0x509042=_0x509042-0x0;var _0x1ac556=_0x3e22[_0x509042];return _0x1ac556;};'use strict';var Sequelize=require('sequelize');module[_0x23e2('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x23e2('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x23e2('0x2')],'defaultValue':_0x23e2('0x3')},'description':{'type':Sequelize[_0x23e2('0x2')]}}; \ No newline at end of file +var _0xf4f4=['STRING','#0091EA','sequelize','exports','name'];(function(_0x103b88,_0x527bc5){var _0x1530c9=function(_0x4169c6){while(--_0x4169c6){_0x103b88['push'](_0x103b88['shift']());}};_0x1530c9(++_0x527bc5);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x325d0c,_0x2e4b02){_0x325d0c=_0x325d0c-0x0;var _0x50f623=_0xf4f4[_0x325d0c];return _0x50f623;};'use strict';var Sequelize=require(_0x4f4f('0x0'));module[_0x4f4f('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x4f4f('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x4f4f('0x3')],'defaultValue':_0x4f4f('0x4')},'description':{'type':Sequelize[_0x4f4f('0x3')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 48306b9..0c8ef43 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 _0x0a12=['name','send','index','map','Tag','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','options','then','includeAll','include','rawAttributes','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','autoAssociation','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','rimraf','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','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','count','offset','limit','set','apply','save','destroy','error','stack'];(function(_0x6e4f7,_0x966b73){var _0x411429=function(_0x3cb416){while(--_0x3cb416){_0x6e4f7['push'](_0x6e4f7['shift']());}};_0x411429(++_0x966b73);}(_0x0a12,0xb8));var _0x20a1=function(_0x1c8c28,_0x3ee093){_0x1c8c28=_0x1c8c28-0x0;var _0x1f59b4=_0x0a12[_0x1c8c28];return _0x1f59b4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x20a1('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x20a1('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x20a1('0x2'));var util=require(_0x20a1('0x3'));var path=require(_0x20a1('0x4'));var sox=require(_0x20a1('0x5'));var csv=require(_0x20a1('0x6'));var ejs=require(_0x20a1('0x7'));var fs=require('fs');var fs_extra=require(_0x20a1('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x20a1('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x20a1('0x6'));var querystring=require(_0x20a1('0xa'));var Papa=require(_0x20a1('0xb'));var Redis=require(_0x20a1('0xc'));var authService=require(_0x20a1('0xd'));var qs=require(_0x20a1('0xe'));var as=require(_0x20a1('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x20a1('0x10'))(_0x20a1('0x11'));var utils=require(_0x20a1('0x12'));var config=require(_0x20a1('0x13'));var licenseUtil=require(_0x20a1('0x14'));var db=require(_0x20a1('0x15'))['db'];function respondWithStatusCode(_0x53a689,_0x77a193){_0x77a193=_0x77a193||0xcc;return function(_0xfe130a){if(_0xfe130a){return _0x53a689[_0x20a1('0x16')](_0x77a193);}return _0x53a689[_0x20a1('0x17')](_0x77a193)[_0x20a1('0x18')]();};}function respondWithResult(_0x32f1f9,_0x3c2c9f){_0x3c2c9f=_0x3c2c9f||0xc8;return function(_0x55feb0){if(_0x55feb0){return _0x32f1f9[_0x20a1('0x17')](_0x3c2c9f)[_0x20a1('0x19')](_0x55feb0);}};}function respondWithFilteredResult(_0xb736e9,_0x401178){return function(_0x1e6ae6){if(_0x1e6ae6){var _0xec799b=typeof _0x401178['offset']==='undefined'&&typeof _0x401178['limit']==='undefined';var _0x5925d4=_0x1e6ae6['count'];var _0x5c00a6=_0xec799b?0x0:_0x401178['offset'];var _0x4a68c5=_0xec799b?_0x1e6ae6[_0x20a1('0x1a')]:_0x401178[_0x20a1('0x1b')]+_0x401178[_0x20a1('0x1c')];var _0xf5d655;if(_0x4a68c5>=_0x5925d4){_0x4a68c5=_0x5925d4;_0xf5d655=0xc8;}else{_0xf5d655=0xce;}_0xb736e9[_0x20a1('0x17')](_0xf5d655);return _0xb736e9[_0x20a1('0x1d')]('Content-Range',_0x5c00a6+'-'+_0x4a68c5+'/'+_0x5925d4)['json'](_0x1e6ae6);}return null;};}function patchUpdates(_0x463968){return function(_0xce4fc4){try{jsonpatch[_0x20a1('0x1e')](_0xce4fc4,_0x463968,!![]);}catch(_0x4f7590){return BPromise['reject'](_0x4f7590);}return _0xce4fc4[_0x20a1('0x1f')]();};}function saveUpdates(_0x2969cd,_0x9089cc){return function(_0x16605d){if(_0x16605d){return _0x16605d['update'](_0x2969cd)['then'](function(_0x4e0100){return _0x4e0100;});}return null;};}function removeEntity(_0x48eb5d,_0x67313c){return function(_0x2f81a8){if(_0x2f81a8){return _0x2f81a8[_0x20a1('0x20')]()['then'](function(){var _0x10a600=_0x2f81a8['get']({'plain':!![]});var _0x11b83c='Tags';return db['UserProfileResource']['destroy']({'where':{'type':_0x11b83c,'resourceId':_0x10a600['id']}})['then'](function(){return _0x2f81a8;});})['then'](function(){_0x48eb5d[_0x20a1('0x17')](0xcc)[_0x20a1('0x18')]();});}};}function handleEntityNotFound(_0x24d1e2,_0xee9dd8){return function(_0x3927b2){if(!_0x3927b2){_0x24d1e2[_0x20a1('0x16')](0x194);}return _0x3927b2;};}function handleError(_0x5a1352,_0x3697f8){_0x3697f8=_0x3697f8||0x1f4;return function(_0x47877f){logger[_0x20a1('0x21')](_0x47877f[_0x20a1('0x22')]);if(_0x47877f['name']){delete _0x47877f[_0x20a1('0x23')];}_0x5a1352['status'](_0x3697f8)[_0x20a1('0x24')](_0x47877f);};}exports[_0x20a1('0x25')]=function(_0x184a3d,_0x1cdc2c){var _0xe8e6d1={},_0x22627a={},_0x13d9ea={'count':0x0,'rows':[]};var _0x2f6dd0=_[_0x20a1('0x26')](db[_0x20a1('0x27')]['rawAttributes'],function(_0x1e6b14){return{'name':_0x1e6b14['fieldName'],'type':_0x1e6b14['type'][_0x20a1('0x28')]};});_0x22627a[_0x20a1('0x29')]=_[_0x20a1('0x26')](_0x2f6dd0,_0x20a1('0x23'));_0x22627a['query']=_[_0x20a1('0x2a')](_0x184a3d[_0x20a1('0x2b')]);_0x22627a[_0x20a1('0x2c')]=_[_0x20a1('0x2d')](_0x22627a['model'],_0x22627a[_0x20a1('0x2b')]);_0xe8e6d1['attributes']=_['intersection'](_0x22627a[_0x20a1('0x29')],qs[_0x20a1('0x2e')](_0x184a3d[_0x20a1('0x2b')][_0x20a1('0x2e')]));_0xe8e6d1['attributes']=_0xe8e6d1[_0x20a1('0x2f')][_0x20a1('0x30')]?_0xe8e6d1['attributes']:_0x22627a[_0x20a1('0x29')];if(!_0x184a3d[_0x20a1('0x2b')][_0x20a1('0x31')]('nolimit')){_0xe8e6d1['limit']=qs[_0x20a1('0x1c')](_0x184a3d[_0x20a1('0x2b')][_0x20a1('0x1c')]);_0xe8e6d1[_0x20a1('0x1b')]=qs[_0x20a1('0x1b')](_0x184a3d[_0x20a1('0x2b')][_0x20a1('0x1b')]);}_0xe8e6d1[_0x20a1('0x32')]=qs['sort'](_0x184a3d[_0x20a1('0x2b')][_0x20a1('0x33')]);_0xe8e6d1[_0x20a1('0x34')]=qs[_0x20a1('0x2c')](_[_0x20a1('0x35')](_0x184a3d['query'],_0x22627a[_0x20a1('0x2c')]),_0x2f6dd0);if(_0x184a3d['query'][_0x20a1('0x36')]){_0xe8e6d1[_0x20a1('0x34')]=_['merge'](_0xe8e6d1[_0x20a1('0x34')],{'$or':_['map'](_0x2f6dd0,function(_0x12a6ed){if(_0x12a6ed['type']!=='VIRTUAL'){var _0xe1b39b={};_0xe1b39b[_0x12a6ed[_0x20a1('0x23')]]={'$like':'%'+_0x184a3d[_0x20a1('0x2b')][_0x20a1('0x36')]+'%'};return _0xe1b39b;}})});}_0xe8e6d1=_['merge']({},_0xe8e6d1,_0x184a3d[_0x20a1('0x37')]);var _0x1d2aab={'where':_0xe8e6d1['where']};return db[_0x20a1('0x27')][_0x20a1('0x1a')](_0x1d2aab)[_0x20a1('0x38')](function(_0x2c2f12){_0x13d9ea[_0x20a1('0x1a')]=_0x2c2f12;if(_0x184a3d['query'][_0x20a1('0x39')]){_0xe8e6d1[_0x20a1('0x3a')]=[{'all':!![]}];}return db[_0x20a1('0x27')]['findAll'](_0xe8e6d1);})[_0x20a1('0x38')](function(_0x40b931){_0x13d9ea['rows']=_0x40b931;return _0x13d9ea;})[_0x20a1('0x38')](respondWithFilteredResult(_0x1cdc2c,_0xe8e6d1))['catch'](handleError(_0x1cdc2c,null));};exports['show']=function(_0x55133c,_0x4cc2d6){var _0x26c023={'raw':!![],'where':{'id':_0x55133c['params']['id']}},_0x29968a={};_0x29968a['model']=_['keys'](db[_0x20a1('0x27')][_0x20a1('0x3b')]);_0x29968a[_0x20a1('0x2b')]=_['keys'](_0x55133c[_0x20a1('0x2b')]);_0x29968a[_0x20a1('0x2c')]=_[_0x20a1('0x2d')](_0x29968a[_0x20a1('0x29')],_0x29968a[_0x20a1('0x2b')]);_0x26c023['attributes']=_['intersection'](_0x29968a['model'],qs[_0x20a1('0x2e')](_0x55133c[_0x20a1('0x2b')]['fields']));_0x26c023[_0x20a1('0x2f')]=_0x26c023[_0x20a1('0x2f')][_0x20a1('0x30')]?_0x26c023['attributes']:_0x29968a[_0x20a1('0x29')];if(_0x55133c['query'][_0x20a1('0x39')]){_0x26c023[_0x20a1('0x3a')]=[{'all':!![]}];}_0x26c023=_['merge']({},_0x26c023,_0x55133c[_0x20a1('0x37')]);return db[_0x20a1('0x27')]['find'](_0x26c023)[_0x20a1('0x38')](handleEntityNotFound(_0x4cc2d6,null))[_0x20a1('0x38')](respondWithResult(_0x4cc2d6,null))['catch'](handleError(_0x4cc2d6,null));};exports[_0x20a1('0x3c')]=function(_0x85cbfd,_0xa74b57){return db['Tag'][_0x20a1('0x3c')](_0x85cbfd[_0x20a1('0x3d')],{})[_0x20a1('0x38')](function(_0x543408){var _0x1d605c=_0x85cbfd['user'][_0x20a1('0x3e')]({'plain':!![]});if(!_0x1d605c)throw new Error(_0x20a1('0x3f'));if(_0x1d605c[_0x20a1('0x40')]===_0x20a1('0x41')){var _0x19bb8d=_0x543408[_0x20a1('0x3e')]({'plain':!![]});var _0x3008ff='Tags';return db[_0x20a1('0x42')][_0x20a1('0x43')]({'where':{'name':_0x3008ff,'userProfileId':_0x1d605c['userProfileId']},'raw':!![]})[_0x20a1('0x38')](function(_0x4abddc){if(_0x4abddc&&_0x4abddc[_0x20a1('0x44')]===0x0){return db[_0x20a1('0x45')]['create']({'name':_0x19bb8d[_0x20a1('0x23')],'resourceId':_0x19bb8d['id'],'type':_0x4abddc[_0x20a1('0x23')],'sectionId':_0x4abddc['id']},{})[_0x20a1('0x38')](function(){return _0x543408;});}else{return _0x543408;}})[_0x20a1('0x46')](function(_0x4003d5){logger[_0x20a1('0x21')](_0x20a1('0x47'),_0x4003d5);throw _0x4003d5;});}return _0x543408;})[_0x20a1('0x38')](respondWithResult(_0xa74b57,0xc9))[_0x20a1('0x46')](handleError(_0xa74b57,null));};exports['update']=function(_0xd4cd57,_0x24c197){if(_0xd4cd57[_0x20a1('0x3d')]['id']){delete _0xd4cd57[_0x20a1('0x3d')]['id'];}return db['Tag'][_0x20a1('0x43')]({'where':{'id':_0xd4cd57[_0x20a1('0x48')]['id']}})['then'](handleEntityNotFound(_0x24c197,null))[_0x20a1('0x38')](saveUpdates(_0xd4cd57['body'],null))[_0x20a1('0x38')](respondWithResult(_0x24c197,null))[_0x20a1('0x46')](handleError(_0x24c197,null));};exports[_0x20a1('0x20')]=function(_0x2cfd78,_0x12c17c){return db[_0x20a1('0x27')][_0x20a1('0x43')]({'where':{'id':_0x2cfd78[_0x20a1('0x48')]['id']}})[_0x20a1('0x38')](handleEntityNotFound(_0x12c17c,null))[_0x20a1('0x38')](removeEntity(_0x12c17c,null))[_0x20a1('0x46')](handleError(_0x12c17c,null));}; \ No newline at end of file +var _0x4ded=['name','index','map','Tag','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','reject','save','update','then','destroy','get','Tags','UserProfileResource','error'];(function(_0x48ce56,_0x213bea){var _0x25e8a1=function(_0x34f473){while(--_0x34f473){_0x48ce56['push'](_0x48ce56['shift']());}};_0x25e8a1(++_0x213bea);}(_0x4ded,0x116));var _0xd4de=function(_0x141c86,_0x3ab8d3){_0x141c86=_0x141c86-0x0;var _0x3a9571=_0x4ded[_0x141c86];return _0x3a9571;};'use strict';var emlformat=require(_0xd4de('0x0'));var rimraf=require(_0xd4de('0x1'));var zipdir=require(_0xd4de('0x2'));var jsonpatch=require(_0xd4de('0x3'));var rp=require(_0xd4de('0x4'));var moment=require(_0xd4de('0x5'));var BPromise=require(_0xd4de('0x6'));var Mustache=require(_0xd4de('0x7'));var util=require(_0xd4de('0x8'));var path=require(_0xd4de('0x9'));var sox=require(_0xd4de('0xa'));var csv=require(_0xd4de('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd4de('0xc'));var _=require(_0xd4de('0xd'));var squel=require(_0xd4de('0xe'));var crypto=require(_0xd4de('0xf'));var jsforce=require(_0xd4de('0x10'));var deskjs=require(_0xd4de('0x11'));var toCsv=require('to-csv');var querystring=require(_0xd4de('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd4de('0x13'));var as=require(_0xd4de('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xd4de('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xd4de('0x16'));var db=require(_0xd4de('0x17'))['db'];function respondWithStatusCode(_0x104dad,_0x2aa09d){_0x2aa09d=_0x2aa09d||0xcc;return function(_0x3ffc72){if(_0x3ffc72){return _0x104dad[_0xd4de('0x18')](_0x2aa09d);}return _0x104dad[_0xd4de('0x19')](_0x2aa09d)[_0xd4de('0x1a')]();};}function respondWithResult(_0x3e3735,_0x37cb9f){_0x37cb9f=_0x37cb9f||0xc8;return function(_0x691ba9){if(_0x691ba9){return _0x3e3735[_0xd4de('0x19')](_0x37cb9f)[_0xd4de('0x1b')](_0x691ba9);}};}function respondWithFilteredResult(_0xbb4f7e,_0x102e5b){return function(_0xa7c18b){if(_0xa7c18b){var _0x325fba=typeof _0x102e5b['offset']==='undefined'&&typeof _0x102e5b[_0xd4de('0x1c')]===_0xd4de('0x1d');var _0x17b377=_0xa7c18b[_0xd4de('0x1e')];var _0x5b1d1c=_0x325fba?0x0:_0x102e5b['offset'];var _0x1e91d5=_0x325fba?_0xa7c18b['count']:_0x102e5b[_0xd4de('0x1f')]+_0x102e5b[_0xd4de('0x1c')];var _0x50b9e3;if(_0x1e91d5>=_0x17b377){_0x1e91d5=_0x17b377;_0x50b9e3=0xc8;}else{_0x50b9e3=0xce;}_0xbb4f7e[_0xd4de('0x19')](_0x50b9e3);return _0xbb4f7e['set'](_0xd4de('0x20'),_0x5b1d1c+'-'+_0x1e91d5+'/'+_0x17b377)[_0xd4de('0x1b')](_0xa7c18b);}return null;};}function patchUpdates(_0x2bad14){return function(_0x8e8712){try{jsonpatch['apply'](_0x8e8712,_0x2bad14,!![]);}catch(_0x318658){return BPromise[_0xd4de('0x21')](_0x318658);}return _0x8e8712[_0xd4de('0x22')]();};}function saveUpdates(_0xdb3fc,_0x1c631a){return function(_0x2d092a){if(_0x2d092a){return _0x2d092a[_0xd4de('0x23')](_0xdb3fc)[_0xd4de('0x24')](function(_0x2f9de6){return _0x2f9de6;});}return null;};}function removeEntity(_0x413f68,_0x534b37){return function(_0xad333f){if(_0xad333f){return _0xad333f[_0xd4de('0x25')]()[_0xd4de('0x24')](function(){var _0x22970c=_0xad333f[_0xd4de('0x26')]({'plain':!![]});var _0x984904=_0xd4de('0x27');return db[_0xd4de('0x28')][_0xd4de('0x25')]({'where':{'type':_0x984904,'resourceId':_0x22970c['id']}})[_0xd4de('0x24')](function(){return _0xad333f;});})[_0xd4de('0x24')](function(){_0x413f68[_0xd4de('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe64e4e,_0x35e2fc){return function(_0x5005b0){if(!_0x5005b0){_0xe64e4e[_0xd4de('0x18')](0x194);}return _0x5005b0;};}function handleError(_0x59b3c5,_0x44b710){_0x44b710=_0x44b710||0x1f4;return function(_0x32e407){logger[_0xd4de('0x29')](_0x32e407['stack']);if(_0x32e407[_0xd4de('0x2a')]){delete _0x32e407[_0xd4de('0x2a')];}_0x59b3c5[_0xd4de('0x19')](_0x44b710)['send'](_0x32e407);};}exports[_0xd4de('0x2b')]=function(_0x1804c7,_0x55f9f9){var _0x5103b5={},_0x5706fe={},_0x3f6491={'count':0x0,'rows':[]};var _0x496795=_[_0xd4de('0x2c')](db[_0xd4de('0x2d')][_0xd4de('0x2e')],function(_0x2e08eb){return{'name':_0x2e08eb['fieldName'],'type':_0x2e08eb[_0xd4de('0x2f')][_0xd4de('0x30')]};});_0x5706fe['model']=_[_0xd4de('0x2c')](_0x496795,_0xd4de('0x2a'));_0x5706fe['query']=_['keys'](_0x1804c7[_0xd4de('0x31')]);_0x5706fe[_0xd4de('0x32')]=_[_0xd4de('0x33')](_0x5706fe[_0xd4de('0x34')],_0x5706fe['query']);_0x5103b5[_0xd4de('0x35')]=_[_0xd4de('0x33')](_0x5706fe['model'],qs[_0xd4de('0x36')](_0x1804c7[_0xd4de('0x31')][_0xd4de('0x36')]));_0x5103b5[_0xd4de('0x35')]=_0x5103b5[_0xd4de('0x35')][_0xd4de('0x37')]?_0x5103b5['attributes']:_0x5706fe['model'];if(!_0x1804c7[_0xd4de('0x31')][_0xd4de('0x38')](_0xd4de('0x39'))){_0x5103b5['limit']=qs[_0xd4de('0x1c')](_0x1804c7[_0xd4de('0x31')]['limit']);_0x5103b5[_0xd4de('0x1f')]=qs[_0xd4de('0x1f')](_0x1804c7[_0xd4de('0x31')][_0xd4de('0x1f')]);}_0x5103b5['order']=qs['sort'](_0x1804c7[_0xd4de('0x31')]['sort']);_0x5103b5[_0xd4de('0x3a')]=qs['filters'](_[_0xd4de('0x3b')](_0x1804c7[_0xd4de('0x31')],_0x5706fe[_0xd4de('0x32')]),_0x496795);if(_0x1804c7[_0xd4de('0x31')]['filter']){_0x5103b5[_0xd4de('0x3a')]=_['merge'](_0x5103b5[_0xd4de('0x3a')],{'$or':_[_0xd4de('0x2c')](_0x496795,function(_0x7f17b9){if(_0x7f17b9[_0xd4de('0x2f')]!==_0xd4de('0x3c')){var _0x13c256={};_0x13c256[_0x7f17b9[_0xd4de('0x2a')]]={'$like':'%'+_0x1804c7['query'][_0xd4de('0x3d')]+'%'};return _0x13c256;}})});}_0x5103b5=_[_0xd4de('0x3e')]({},_0x5103b5,_0x1804c7[_0xd4de('0x3f')]);var _0x2ec1fa={'where':_0x5103b5[_0xd4de('0x3a')]};return db['Tag'][_0xd4de('0x1e')](_0x2ec1fa)[_0xd4de('0x24')](function(_0x2294e2){_0x3f6491['count']=_0x2294e2;if(_0x1804c7[_0xd4de('0x31')][_0xd4de('0x40')]){_0x5103b5[_0xd4de('0x41')]=[{'all':!![]}];}return db['Tag'][_0xd4de('0x42')](_0x5103b5);})[_0xd4de('0x24')](function(_0x419c49){_0x3f6491[_0xd4de('0x43')]=_0x419c49;return _0x3f6491;})[_0xd4de('0x24')](respondWithFilteredResult(_0x55f9f9,_0x5103b5))[_0xd4de('0x44')](handleError(_0x55f9f9,null));};exports[_0xd4de('0x45')]=function(_0x5ecbbd,_0x43b542){var _0x164bde={'raw':!![],'where':{'id':_0x5ecbbd['params']['id']}},_0x58082a={};_0x58082a[_0xd4de('0x34')]=_[_0xd4de('0x46')](db[_0xd4de('0x2d')]['rawAttributes']);_0x58082a['query']=_[_0xd4de('0x46')](_0x5ecbbd[_0xd4de('0x31')]);_0x58082a['filters']=_[_0xd4de('0x33')](_0x58082a[_0xd4de('0x34')],_0x58082a[_0xd4de('0x31')]);_0x164bde[_0xd4de('0x35')]=_['intersection'](_0x58082a[_0xd4de('0x34')],qs[_0xd4de('0x36')](_0x5ecbbd[_0xd4de('0x31')][_0xd4de('0x36')]));_0x164bde[_0xd4de('0x35')]=_0x164bde[_0xd4de('0x35')]['length']?_0x164bde[_0xd4de('0x35')]:_0x58082a[_0xd4de('0x34')];if(_0x5ecbbd[_0xd4de('0x31')][_0xd4de('0x40')]){_0x164bde[_0xd4de('0x41')]=[{'all':!![]}];}_0x164bde=_[_0xd4de('0x3e')]({},_0x164bde,_0x5ecbbd[_0xd4de('0x3f')]);return db[_0xd4de('0x2d')][_0xd4de('0x47')](_0x164bde)[_0xd4de('0x24')](handleEntityNotFound(_0x43b542,null))['then'](respondWithResult(_0x43b542,null))[_0xd4de('0x44')](handleError(_0x43b542,null));};exports[_0xd4de('0x48')]=function(_0x178daf,_0x518bfe){return db[_0xd4de('0x2d')][_0xd4de('0x48')](_0x178daf[_0xd4de('0x49')],{})[_0xd4de('0x24')](function(_0x42e58e){var _0xa24bb7=_0x178daf[_0xd4de('0x4a')][_0xd4de('0x26')]({'plain':!![]});if(!_0xa24bb7)throw new Error(_0xd4de('0x4b'));if(_0xa24bb7[_0xd4de('0x4c')]==='user'){var _0x3e4c7f=_0x42e58e[_0xd4de('0x26')]({'plain':!![]});var _0x215f85=_0xd4de('0x27');return db[_0xd4de('0x4d')]['find']({'where':{'name':_0x215f85,'userProfileId':_0xa24bb7['userProfileId']},'raw':!![]})[_0xd4de('0x24')](function(_0x2deedb){if(_0x2deedb&&_0x2deedb['autoAssociation']===0x0){return db['UserProfileResource'][_0xd4de('0x48')]({'name':_0x3e4c7f[_0xd4de('0x2a')],'resourceId':_0x3e4c7f['id'],'type':_0x2deedb[_0xd4de('0x2a')],'sectionId':_0x2deedb['id']},{})[_0xd4de('0x24')](function(){return _0x42e58e;});}else{return _0x42e58e;}})[_0xd4de('0x44')](function(_0x15c8cd){logger[_0xd4de('0x29')](_0xd4de('0x4e'),_0x15c8cd);throw _0x15c8cd;});}return _0x42e58e;})[_0xd4de('0x24')](respondWithResult(_0x518bfe,0xc9))[_0xd4de('0x44')](handleError(_0x518bfe,null));};exports[_0xd4de('0x23')]=function(_0x2e1780,_0x56c13e){if(_0x2e1780[_0xd4de('0x49')]['id']){delete _0x2e1780[_0xd4de('0x49')]['id'];}return db[_0xd4de('0x2d')][_0xd4de('0x47')]({'where':{'id':_0x2e1780[_0xd4de('0x4f')]['id']}})[_0xd4de('0x24')](handleEntityNotFound(_0x56c13e,null))['then'](saveUpdates(_0x2e1780[_0xd4de('0x49')],null))['then'](respondWithResult(_0x56c13e,null))['catch'](handleError(_0x56c13e,null));};exports[_0xd4de('0x25')]=function(_0xd79781,_0x2d1e45){return db[_0xd4de('0x2d')]['find']({'where':{'id':_0xd79781[_0xd4de('0x4f')]['id']}})[_0xd4de('0x24')](handleEntityNotFound(_0x2d1e45,null))[_0xd4de('0x24')](removeEntity(_0x2d1e45,null))[_0xd4de('0x44')](handleError(_0x2d1e45,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 595a079..e697881 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 _0x302c=['tools_tags','lodash','util','api','moment','bluebird','path','rimraf','exports','define','Tag'];(function(_0x5c6781,_0x51e500){var _0x261cbd=function(_0x1a10a0){while(--_0x1a10a0){_0x5c6781['push'](_0x5c6781['shift']());}};_0x261cbd(++_0x51e500);}(_0x302c,0x140));var _0xc302=function(_0x784fec,_0x3f7922){_0x784fec=_0x784fec-0x0;var _0x33975e=_0x302c[_0x784fec];return _0x33975e;};'use strict';var _=require(_0xc302('0x0'));var util=require(_0xc302('0x1'));var logger=require('../../config/logger')(_0xc302('0x2'));var moment=require(_0xc302('0x3'));var BPromise=require(_0xc302('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc302('0x5'));var rimraf=require(_0xc302('0x6'));var config=require('../../config/environment');var attributes=require('./tag.attributes');module[_0xc302('0x7')]=function(_0xaac829,_0x181a18){return _0xaac829[_0xc302('0x8')](_0xc302('0x9'),attributes,{'tableName':_0xc302('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x91cd=['./tag.attributes','define','Tag','tools_tags','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x59629e,_0x3dbbf9){var _0x320e71=function(_0x18bfea){while(--_0x18bfea){_0x59629e['push'](_0x59629e['shift']());}};_0x320e71(++_0x3dbbf9);}(_0x91cd,0x118));var _0xd91c=function(_0x4cefc3,_0x23f291){_0x4cefc3=_0x4cefc3-0x0;var _0x1cc779=_0x91cd[_0x4cefc3];return _0x1cc779;};'use strict';var _=require(_0xd91c('0x0'));var util=require(_0xd91c('0x1'));var logger=require(_0xd91c('0x2'))(_0xd91c('0x3'));var moment=require(_0xd91c('0x4'));var BPromise=require(_0xd91c('0x5'));var rp=require(_0xd91c('0x6'));var fs=require('fs');var path=require(_0xd91c('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd91c('0x8'));module['exports']=function(_0x95ed1c,_0x1ada2a){return _0x95ed1c[_0xd91c('0x9')](_0xd91c('0xa'),attributes,{'tableName':_0xd91c('0xb'),'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 2d3fb83..2829d0c 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 _0x919e=['client','http','then','info','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','Tag,\x20%s,\x20%s','message','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1ffd7b,_0x53d9dc){var _0x20056b=function(_0x5382af){while(--_0x5382af){_0x1ffd7b['push'](_0x1ffd7b['shift']());}};_0x20056b(++_0x53d9dc);}(_0x919e,0x1d7));var _0xe919=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x919e[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xe919('0x0'));var util=require(_0xe919('0x1'));var moment=require(_0xe919('0x2'));var BPromise=require('bluebird');var rs=require(_0xe919('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe919('0x4'));var logger=require(_0xe919('0x5'))(_0xe919('0x6'));var config=require(_0xe919('0x7'));var jayson=require(_0xe919('0x8'));var client=jayson[_0xe919('0x9')][_0xe919('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x493b47,_0x7c1fa4,_0x2ceb41){return new BPromise(function(_0x57c3fe,_0x44d418){return client['request'](_0x493b47,_0x2ceb41)[_0xe919('0xb')](function(_0x22ea65){logger[_0xe919('0xc')]('Tag,\x20%s,\x20%s',_0x7c1fa4,_0xe919('0xd'));logger[_0xe919('0xe')](_0xe919('0xf'),_0x7c1fa4,'request\x20sent',JSON[_0xe919('0x10')](_0x22ea65));if(_0x22ea65['error']){if(_0x22ea65['error']['code']===0x1f4){logger[_0xe919('0x11')](_0xe919('0x12'),_0x7c1fa4,_0x22ea65[_0xe919('0x11')]['message']);return _0x44d418(_0x22ea65['error'][_0xe919('0x13')]);}logger[_0xe919('0x11')]('Tag,\x20%s,\x20%s',_0x7c1fa4,_0x22ea65[_0xe919('0x11')][_0xe919('0x13')]);return _0x57c3fe(_0x22ea65[_0xe919('0x11')][_0xe919('0x13')]);}else{logger[_0xe919('0xc')](_0xe919('0x12'),_0x7c1fa4,_0xe919('0xd'));_0x57c3fe(_0x22ea65['result'][_0xe919('0x13')]);}})['catch'](function(_0x5ba7ad){logger[_0xe919('0x11')](_0xe919('0x12'),_0x7c1fa4,_0x5ba7ad);_0x44d418(_0x5ba7ad);});});} \ No newline at end of file +var _0x6334=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','stringify','error','Tag,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x235d2,_0x113d58){var _0xea9d56=function(_0x48f48e){while(--_0x48f48e){_0x235d2['push'](_0x235d2['shift']());}};_0xea9d56(++_0x113d58);}(_0x6334,0x119));var _0x4633=function(_0x2e4cbf,_0x8763d3){_0x2e4cbf=_0x2e4cbf-0x0;var _0x52840f=_0x6334[_0x2e4cbf];return _0x52840f;};'use strict';var _=require(_0x4633('0x0'));var util=require(_0x4633('0x1'));var moment=require(_0x4633('0x2'));var BPromise=require(_0x4633('0x3'));var rs=require(_0x4633('0x4'));var fs=require('fs');var Redis=require(_0x4633('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4633('0x6'));var logger=require(_0x4633('0x7'))(_0x4633('0x8'));var config=require(_0x4633('0x9'));var jayson=require(_0x4633('0xa'));var client=jayson[_0x4633('0xb')][_0x4633('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4a8997,_0x5647f1,_0x56891d){return new BPromise(function(_0x21af74,_0x148e72){return client['request'](_0x4a8997,_0x56891d)[_0x4633('0xd')](function(_0x31e794){logger[_0x4633('0xe')]('Tag,\x20%s,\x20%s',_0x5647f1,_0x4633('0xf'));logger[_0x4633('0x10')]('Tag,\x20%s,\x20%s,\x20%s',_0x5647f1,_0x4633('0xf'),JSON[_0x4633('0x11')](_0x31e794));if(_0x31e794[_0x4633('0x12')]){if(_0x31e794[_0x4633('0x12')]['code']===0x1f4){logger[_0x4633('0x12')](_0x4633('0x13'),_0x5647f1,_0x31e794[_0x4633('0x12')]['message']);return _0x148e72(_0x31e794['error']['message']);}logger[_0x4633('0x12')](_0x4633('0x13'),_0x5647f1,_0x31e794['error']['message']);return _0x21af74(_0x31e794[_0x4633('0x12')]['message']);}else{logger[_0x4633('0xe')](_0x4633('0x13'),_0x5647f1,_0x4633('0xf'));_0x21af74(_0x31e794[_0x4633('0x14')]['message']);}})[_0x4633('0x15')](function(_0x15bd98){logger[_0x4633('0x12')]('Tag,\x20%s,\x20%s',_0x5647f1,_0x15bd98);_0x148e72(_0x15bd98);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 323d6f4..63be30c 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(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'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(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'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 b2fbc8b..ba8ae88 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 _0x2032=['name','exports','STRING'];(function(_0x21c835,_0x3ee747){var _0x39bb44=function(_0x2f36be){while(--_0x2f36be){_0x21c835['push'](_0x21c835['shift']());}};_0x39bb44(++_0x3ee747);}(_0x2032,0xd9));var _0x2203=function(_0x10ddd1,_0x1bb94d){_0x10ddd1=_0x10ddd1-0x0;var _0x53b8d5=_0x2032[_0x10ddd1];return _0x53b8d5;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')],'allowNull':![],'unique':_0x2203('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb7e7=['STRING','sequelize'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0xb7e7,0x121));var _0x7b7e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xb7e7[_0xf50820];return _0x2a9b10;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x7b7e('0x1')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 43ad893..0fd5e94 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 _0xd201=['api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','Team','includeAll','include','findAll','catch','show','params','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Teams','find','userProfileId','autoAssociation','getQueues','findOne','channel','Sequelize','Unknown\x20channel','capitalize','toLowerCase','Queue','Queues','addQueues','isValidChannel','ValidationError','add','ids','removeQueues','addAgents','Voice','Chat','Mail','Sms','Fax','Openchannel','Whatsapp','sequelize','transaction','penalty','QueueId','TeamVoiceQueue','findOrCreate','emit','User','UserVoiceQueueRt','upsert','isNil','interface','SIP/%s','voicePause','all','removeAgents','parse','getAgents','rimraf','zip-dir','request-promise','moment','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','../../config/logger'];(function(_0x219d87,_0x1cb6f7){var _0x22823d=function(_0x5357bf){while(--_0x5357bf){_0x219d87['push'](_0x219d87['shift']());}};_0x22823d(++_0x1cb6f7);}(_0xd201,0x17a));var _0x1d20=function(_0x110c54,_0xa3cfcb){_0x110c54=_0x110c54-0x0;var _0x58a348=_0xd201[_0x110c54];return _0x58a348;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1d20('0x0'));var zipdir=require(_0x1d20('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1d20('0x2'));var moment=require(_0x1d20('0x3'));var BPromise=require(_0x1d20('0x4'));var Mustache=require(_0x1d20('0x5'));var util=require(_0x1d20('0x6'));var path=require(_0x1d20('0x7'));var sox=require(_0x1d20('0x8'));var csv=require(_0x1d20('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1d20('0xa'));var _=require(_0x1d20('0xb'));var squel=require(_0x1d20('0xc'));var crypto=require(_0x1d20('0xd'));var jsforce=require(_0x1d20('0xe'));var deskjs=require(_0x1d20('0xf'));var toCsv=require(_0x1d20('0x9'));var querystring=require(_0x1d20('0x10'));var Papa=require(_0x1d20('0x11'));var Redis=require(_0x1d20('0x12'));var authService=require(_0x1d20('0x13'));var qs=require(_0x1d20('0x14'));var as=require(_0x1d20('0x15'));var hardwareService=require(_0x1d20('0x16'));var logger=require(_0x1d20('0x17'))(_0x1d20('0x18'));var utils=require(_0x1d20('0x19'));var config=require(_0x1d20('0x1a'));var licenseUtil=require(_0x1d20('0x1b'));var db=require('../../mysqldb')['db'];config[_0x1d20('0x1c')]=_[_0x1d20('0x1d')](config[_0x1d20('0x1c')],{'host':_0x1d20('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1d20('0x1c')]));require('./team.socket')[_0x1d20('0x1f')](socket);function respondWithStatusCode(_0x294f64,_0x55c10a){_0x55c10a=_0x55c10a||0xcc;return function(_0x126caa){if(_0x126caa){return _0x294f64[_0x1d20('0x20')](_0x55c10a);}return _0x294f64['status'](_0x55c10a)[_0x1d20('0x21')]();};}function respondWithResult(_0x3ad07f,_0x3a4033){_0x3a4033=_0x3a4033||0xc8;return function(_0x206e91){if(_0x206e91){return _0x3ad07f[_0x1d20('0x22')](_0x3a4033)[_0x1d20('0x23')](_0x206e91);}};}function respondWithFilteredResult(_0x4d938a,_0x52805b){return function(_0x4df244){if(_0x4df244){var _0x3d91d4=typeof _0x52805b[_0x1d20('0x24')]===_0x1d20('0x25')&&typeof _0x52805b[_0x1d20('0x26')]===_0x1d20('0x25');var _0x59baf2=_0x4df244[_0x1d20('0x27')];var _0x109d5f=_0x3d91d4?0x0:_0x52805b[_0x1d20('0x24')];var _0x537a30=_0x3d91d4?_0x4df244[_0x1d20('0x27')]:_0x52805b[_0x1d20('0x24')]+_0x52805b[_0x1d20('0x26')];var _0x72758;if(_0x537a30>=_0x59baf2){_0x537a30=_0x59baf2;_0x72758=0xc8;}else{_0x72758=0xce;}_0x4d938a[_0x1d20('0x22')](_0x72758);return _0x4d938a[_0x1d20('0x28')](_0x1d20('0x29'),_0x109d5f+'-'+_0x537a30+'/'+_0x59baf2)[_0x1d20('0x23')](_0x4df244);}return null;};}function patchUpdates(_0xa870){return function(_0x2efc4b){try{jsonpatch[_0x1d20('0x2a')](_0x2efc4b,_0xa870,!![]);}catch(_0x386a64){return BPromise[_0x1d20('0x2b')](_0x386a64);}return _0x2efc4b[_0x1d20('0x2c')]();};}function saveUpdates(_0x24316e,_0xf8074d){return function(_0x518f07){if(_0x518f07){return _0x518f07[_0x1d20('0x2d')](_0x24316e)[_0x1d20('0x2e')](function(_0x413fb2){return _0x413fb2;});}return null;};}function removeEntity(_0x2567e6,_0x1075bd){return function(_0x251629){if(_0x251629){return _0x251629['destroy']()[_0x1d20('0x2e')](function(){var _0x4aa4a8=_0x251629[_0x1d20('0x2f')]({'plain':!![]});var _0x54d3ba='Teams';return db[_0x1d20('0x30')][_0x1d20('0x31')]({'where':{'type':_0x54d3ba,'resourceId':_0x4aa4a8['id']}})[_0x1d20('0x2e')](function(){return _0x251629;});})[_0x1d20('0x2e')](function(){_0x2567e6[_0x1d20('0x22')](0xcc)[_0x1d20('0x21')]();});}};}function handleEntityNotFound(_0x3dcaab,_0x3f5b37){return function(_0x2249e3){if(!_0x2249e3){_0x3dcaab[_0x1d20('0x20')](0x194);}return _0x2249e3;};}function handleError(_0x299bb6,_0x17b42e){_0x17b42e=_0x17b42e||0x1f4;return function(_0x4768f8){logger[_0x1d20('0x32')](_0x4768f8[_0x1d20('0x33')]);if(_0x4768f8[_0x1d20('0x34')]){delete _0x4768f8['name'];}_0x299bb6[_0x1d20('0x22')](_0x17b42e)[_0x1d20('0x35')](_0x4768f8);};}exports[_0x1d20('0x36')]=function(_0x29acdb,_0x305bdc){var _0x57d578={},_0x2a55ec={},_0x5865e8={'count':0x0,'rows':[]};var _0x57cf53=_[_0x1d20('0x37')](db['Team'][_0x1d20('0x38')],function(_0x5560a8){return{'name':_0x5560a8[_0x1d20('0x39')],'type':_0x5560a8[_0x1d20('0x3a')][_0x1d20('0x3b')]};});_0x2a55ec[_0x1d20('0x3c')]=_['map'](_0x57cf53,'name');_0x2a55ec[_0x1d20('0x3d')]=_['keys'](_0x29acdb[_0x1d20('0x3d')]);_0x2a55ec[_0x1d20('0x3e')]=_['intersection'](_0x2a55ec['model'],_0x2a55ec[_0x1d20('0x3d')]);_0x57d578[_0x1d20('0x3f')]=_[_0x1d20('0x40')](_0x2a55ec[_0x1d20('0x3c')],qs[_0x1d20('0x41')](_0x29acdb[_0x1d20('0x3d')][_0x1d20('0x41')]));_0x57d578[_0x1d20('0x3f')]=_0x57d578[_0x1d20('0x3f')][_0x1d20('0x42')]?_0x57d578[_0x1d20('0x3f')]:_0x2a55ec['model'];if(!_0x29acdb[_0x1d20('0x3d')][_0x1d20('0x43')](_0x1d20('0x44'))){_0x57d578[_0x1d20('0x26')]=qs[_0x1d20('0x26')](_0x29acdb[_0x1d20('0x3d')][_0x1d20('0x26')]);_0x57d578['offset']=qs[_0x1d20('0x24')](_0x29acdb[_0x1d20('0x3d')][_0x1d20('0x24')]);}_0x57d578[_0x1d20('0x45')]=qs[_0x1d20('0x46')](_0x29acdb['query'][_0x1d20('0x46')]);_0x57d578[_0x1d20('0x47')]=qs[_0x1d20('0x3e')](_[_0x1d20('0x48')](_0x29acdb['query'],_0x2a55ec[_0x1d20('0x3e')]),_0x57cf53);if(_0x29acdb[_0x1d20('0x3d')]['filter']){_0x57d578['where']=_[_0x1d20('0x49')](_0x57d578[_0x1d20('0x47')],{'$or':_[_0x1d20('0x37')](_0x57cf53,function(_0x2e3f24){if(_0x2e3f24[_0x1d20('0x3a')]!==_0x1d20('0x4a')){var _0x35fbe4={};_0x35fbe4[_0x2e3f24[_0x1d20('0x34')]]={'$like':'%'+_0x29acdb[_0x1d20('0x3d')][_0x1d20('0x4b')]+'%'};return _0x35fbe4;}})});}_0x57d578=_['merge']({},_0x57d578,_0x29acdb[_0x1d20('0x4c')]);var _0x5ab35a={'where':_0x57d578['where']};return db[_0x1d20('0x4d')][_0x1d20('0x27')](_0x5ab35a)[_0x1d20('0x2e')](function(_0x1546e4){_0x5865e8[_0x1d20('0x27')]=_0x1546e4;if(_0x29acdb[_0x1d20('0x3d')][_0x1d20('0x4e')]){_0x57d578[_0x1d20('0x4f')]=[{'all':!![]}];}return db['Team'][_0x1d20('0x50')](_0x57d578);})[_0x1d20('0x2e')](function(_0x479389){_0x5865e8['rows']=_0x479389;return _0x5865e8;})['then'](respondWithFilteredResult(_0x305bdc,_0x57d578))[_0x1d20('0x51')](handleError(_0x305bdc,null));};exports[_0x1d20('0x52')]=function(_0x3df936,_0x44729e){var _0x115fec={'raw':![],'where':{'id':_0x3df936[_0x1d20('0x53')]['id']}},_0xe4b962={};_0xe4b962['model']=_[_0x1d20('0x54')](db[_0x1d20('0x4d')][_0x1d20('0x38')]);_0xe4b962['query']=_['keys'](_0x3df936[_0x1d20('0x3d')]);_0xe4b962[_0x1d20('0x3e')]=_['intersection'](_0xe4b962[_0x1d20('0x3c')],_0xe4b962[_0x1d20('0x3d')]);_0x115fec[_0x1d20('0x3f')]=_[_0x1d20('0x40')](_0xe4b962[_0x1d20('0x3c')],qs[_0x1d20('0x41')](_0x3df936[_0x1d20('0x3d')][_0x1d20('0x41')]));_0x115fec[_0x1d20('0x3f')]=_0x115fec['attributes'][_0x1d20('0x42')]?_0x115fec['attributes']:_0xe4b962[_0x1d20('0x3c')];if(_0x3df936['query'][_0x1d20('0x4e')]){_0x115fec[_0x1d20('0x4f')]=[{'all':!![]}];}_0x115fec=_[_0x1d20('0x49')]({},_0x115fec,_0x3df936[_0x1d20('0x4c')]);return db['Team']['find'](_0x115fec)['then'](handleEntityNotFound(_0x44729e,null))[_0x1d20('0x2e')](respondWithResult(_0x44729e,null))[_0x1d20('0x51')](handleError(_0x44729e,null));};exports[_0x1d20('0x55')]=function(_0x25a7f7,_0x2c4287){return db[_0x1d20('0x4d')]['create'](_0x25a7f7[_0x1d20('0x56')],{})[_0x1d20('0x2e')](function(_0x2b7f28){var _0x47e289=_0x25a7f7[_0x1d20('0x57')]['get']({'plain':!![]});if(!_0x47e289)throw new Error(_0x1d20('0x58'));if(_0x47e289['role']===_0x1d20('0x57')){var _0x3f9353=_0x2b7f28[_0x1d20('0x2f')]({'plain':!![]});var _0x287e7b=_0x1d20('0x59');return db['UserProfileSection'][_0x1d20('0x5a')]({'where':{'name':_0x287e7b,'userProfileId':_0x47e289[_0x1d20('0x5b')]},'raw':!![]})['then'](function(_0x45d542){if(_0x45d542&&_0x45d542[_0x1d20('0x5c')]===0x0){return db[_0x1d20('0x30')][_0x1d20('0x55')]({'name':_0x3f9353['name'],'resourceId':_0x3f9353['id'],'type':_0x45d542[_0x1d20('0x34')],'sectionId':_0x45d542['id']},{})['then'](function(){return _0x2b7f28;});}else{return _0x2b7f28;}})[_0x1d20('0x51')](function(_0xfe04e3){logger[_0x1d20('0x32')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xfe04e3);throw _0xfe04e3;});}return _0x2b7f28;})[_0x1d20('0x2e')](respondWithResult(_0x2c4287,0xc9))[_0x1d20('0x51')](handleError(_0x2c4287,null));};exports[_0x1d20('0x2d')]=function(_0x52a80e,_0x39b5ca){if(_0x52a80e[_0x1d20('0x56')]['id']){delete _0x52a80e[_0x1d20('0x56')]['id'];}return db[_0x1d20('0x4d')][_0x1d20('0x5a')]({'where':{'id':_0x52a80e[_0x1d20('0x53')]['id']}})[_0x1d20('0x2e')](handleEntityNotFound(_0x39b5ca,null))['then'](saveUpdates(_0x52a80e['body'],null))[_0x1d20('0x2e')](respondWithResult(_0x39b5ca,null))['catch'](handleError(_0x39b5ca,null));};exports[_0x1d20('0x31')]=function(_0x375f70,_0x36277b){return db[_0x1d20('0x4d')][_0x1d20('0x5a')]({'where':{'id':_0x375f70['params']['id']}})['then'](handleEntityNotFound(_0x36277b,null))[_0x1d20('0x2e')](removeEntity(_0x36277b,null))[_0x1d20('0x51')](handleError(_0x36277b,null));};exports[_0x1d20('0x5d')]=function(_0x56d813,_0x5fa302,_0xd459bb){return db[_0x1d20('0x4d')][_0x1d20('0x5e')]({'where':{'id':_0x56d813[_0x1d20('0x53')]['id']}})['then'](handleEntityNotFound(_0x5fa302,null))[_0x1d20('0x2e')](function(_0x493d58){if(!_0x56d813[_0x1d20('0x3d')]['channel']||!utils['isValidChannel'](_0x56d813[_0x1d20('0x3d')][_0x1d20('0x5f')])){throw new db[(_0x1d20('0x60'))]['ValidationError'](_0x1d20('0x61'));}var _0x2a19d7={};var _0x4fffbe={};_0x4fffbe[_0x1d20('0x3c')]=_['keys'](db[_[_0x1d20('0x62')](_0x56d813[_0x1d20('0x3d')][_0x1d20('0x5f')][_0x1d20('0x63')]())+_0x1d20('0x64')][_0x1d20('0x38')]);_0x4fffbe[_0x1d20('0x3d')]=_['keys'](_0x56d813[_0x1d20('0x3d')]);_0x4fffbe[_0x1d20('0x3e')]=_[_0x1d20('0x40')](_0x4fffbe[_0x1d20('0x3c')],_0x4fffbe[_0x1d20('0x3d')]);_0x2a19d7['attributes']=_[_0x1d20('0x40')](_0x4fffbe[_0x1d20('0x3c')],qs[_0x1d20('0x41')](_0x56d813[_0x1d20('0x3d')][_0x1d20('0x41')]));_0x2a19d7['attributes']=_0x2a19d7[_0x1d20('0x3f')][_0x1d20('0x42')]?_0x2a19d7[_0x1d20('0x3f')]:_0x4fffbe['model'];_0x2a19d7['limit']=qs[_0x1d20('0x26')](_0x56d813[_0x1d20('0x3d')][_0x1d20('0x26')]);_0x2a19d7[_0x1d20('0x24')]=qs[_0x1d20('0x24')](_0x56d813['query']['offset']);_0x2a19d7['order']=qs['sort'](_0x56d813[_0x1d20('0x3d')][_0x1d20('0x46')]);_0x2a19d7[_0x1d20('0x47')]=qs[_0x1d20('0x3e')](_[_0x1d20('0x48')](_0x56d813[_0x1d20('0x3d')],_0x4fffbe[_0x1d20('0x3e')]));_0x2a19d7=_[_0x1d20('0x49')]({},_0x2a19d7,_0x56d813['options']);return _0x493d58[_0x1d20('0x2f')+_[_0x1d20('0x62')](_0x56d813['query']['channel'][_0x1d20('0x63')]())+_0x1d20('0x65')](_0x2a19d7);})[_0x1d20('0x2e')](respondWithResult(_0x5fa302,null))['catch'](handleError(_0x5fa302,null));};exports[_0x1d20('0x66')]=function(_0x41ac04,_0x5817a1,_0x46e74c){return db[_0x1d20('0x4d')][_0x1d20('0x5e')]({'where':{'id':_0x41ac04[_0x1d20('0x53')]['id']}})[_0x1d20('0x2e')](function(_0x15fac3){if(_0x15fac3){if(!_0x41ac04[_0x1d20('0x56')][_0x1d20('0x5f')]||!utils[_0x1d20('0x67')](_0x41ac04['body'][_0x1d20('0x5f')])){throw new db[(_0x1d20('0x60'))][(_0x1d20('0x68'))]('Unknown\x20channel');}return _0x15fac3[_0x1d20('0x69')+_['capitalize'](_0x41ac04[_0x1d20('0x56')][_0x1d20('0x5f')][_0x1d20('0x63')]())+_0x1d20('0x65')](_0x41ac04['body'][_0x1d20('0x6a')]);}return null;})['then'](handleEntityNotFound(_0x5817a1,null))[_0x1d20('0x2e')](respondWithStatusCode(_0x5817a1,null))[_0x1d20('0x51')](handleError(_0x5817a1,null));};exports[_0x1d20('0x6b')]=function(_0x4709ab,_0x4a4e3f,_0x515de0){return db[_0x1d20('0x4d')][_0x1d20('0x5e')]({'where':{'id':_0x4709ab[_0x1d20('0x53')]['id']}})[_0x1d20('0x2e')](function(_0xfe66c5){if(_0xfe66c5){if(!_0x4709ab[_0x1d20('0x3d')]['channel']||!utils[_0x1d20('0x67')](_0x4709ab[_0x1d20('0x3d')][_0x1d20('0x5f')])){throw new db[(_0x1d20('0x60'))][(_0x1d20('0x68'))](_0x1d20('0x61'));}return _0xfe66c5['remove'+_['capitalize'](_0x4709ab[_0x1d20('0x3d')]['channel']['toLowerCase']())+_0x1d20('0x65')](_0x4709ab['query']['ids']);}return null;})[_0x1d20('0x2e')](handleEntityNotFound(_0x4a4e3f,null))[_0x1d20('0x2e')](respondWithStatusCode(_0x4a4e3f,null))['catch'](handleError(_0x4a4e3f,null));};exports[_0x1d20('0x6c')]=function(_0x41be66,_0x29a9f7){return db['Team'][_0x1d20('0x5a')]({'where':{'id':_0x41be66[_0x1d20('0x53')]['id']}})[_0x1d20('0x2e')](handleEntityNotFound(_0x29a9f7,null))[_0x1d20('0x2e')](function(_0x31d887){if(_0x31d887){var _0x4c1ad9=[_0x1d20('0x6d'),_0x1d20('0x6e'),_0x1d20('0x6f'),_0x1d20('0x70'),_0x1d20('0x71'),_0x1d20('0x72'),_0x1d20('0x73')];return db[_0x1d20('0x74')][_0x1d20('0x75')](function(_0x49ab1f){var _0x5e99a7=_[_0x1d20('0x37')](_0x4c1ad9,function(_0x23ae66){var _0x1443a6={'attributes':['id',_0x1d20('0x34')]};if(_0x23ae66===_0x1d20('0x6d')){_0x1443a6['through']={'attributes':[_0x1d20('0x76')]};}return _0x31d887['get'+_0x23ae66+_0x1d20('0x65')](_0x1443a6)['then'](function(_0x448181){var _0x19d0d6=_[_0x1d20('0x37')](_0x448181,function(_0x5bb677){var _0x5adfc1=_['map'](_0x41be66[_0x1d20('0x56')][_0x1d20('0x6a')],function(_0xacb90b){var _0x52c59f={'where':{'UserId':_0xacb90b,[_0x23ae66+_0x1d20('0x77')]:_0x5bb677['id']},'transaction':_0x49ab1f};if(_0x23ae66===_0x1d20('0x6d')){_0x52c59f[_0x1d20('0x1d')]={'penalty':_0x5bb677[_0x1d20('0x78')]['penalty']};}return db['User'+_0x23ae66+_0x1d20('0x64')][_0x1d20('0x79')](_0x52c59f)[_0x1d20('0x2e')](function(){socket[_0x1d20('0x7a')](_0x1d20('0x57')+_0x23ae66+'Queue:save',{'UserId':_0xacb90b,[_0x23ae66+_0x1d20('0x77')]:_0x5bb677['id']});if(_0x23ae66!==_0x1d20('0x6d'))return;return db[_0x1d20('0x7b')][_0x1d20('0x50')]({'where':{'id':_0x41be66[_0x1d20('0x56')][_0x1d20('0x6a')],'online':0x1},'attributes':['id',_0x1d20('0x34'),'online','voicePause','interface'],'raw':!![]})[_0x1d20('0x2e')](function(_0x944c52){var _0x96484f=_['map'](_0x944c52,function(_0x579766){return db[_0x1d20('0x7c')][_0x1d20('0x7d')]({'membername':_0x579766[_0x1d20('0x34')],'UserId':_0x579766['id'],'queue_name':_0x5bb677[_0x1d20('0x34')],'VoiceQueueId':_0x5bb677['id'],'interface':_[_0x1d20('0x7e')](_0x579766[_0x1d20('0x7f')])?util['format'](_0x1d20('0x80'),_0x579766[_0x1d20('0x34')]):_0x579766['interface'],'paused':_0x579766[_0x1d20('0x81')]||![],'penalty':_0x5bb677['TeamVoiceQueue'][_0x1d20('0x76')]},{'transaction':_0x49ab1f});});return Promise[_0x1d20('0x82')](_0x96484f);});});});return Promise[_0x1d20('0x82')](_0x5adfc1);});return Promise[_0x1d20('0x82')](_0x19d0d6);});});return Promise[_0x1d20('0x82')](_0x5e99a7)[_0x1d20('0x2e')](function(){return _0x31d887[_0x1d20('0x6c')](_0x41be66[_0x1d20('0x56')][_0x1d20('0x6a')],{'transaction':_0x49ab1f})['spread'](function(_0x34ad36){return _0x34ad36;});});});}})[_0x1d20('0x2e')](respondWithResult(_0x29a9f7,null))[_0x1d20('0x51')](handleError(_0x29a9f7,null));};exports[_0x1d20('0x83')]=function(_0x1b0ba4,_0x4d2777){return db[_0x1d20('0x4d')]['find']({'where':{'id':_0x1b0ba4['params']['id']}})[_0x1d20('0x2e')](handleEntityNotFound(_0x4d2777,null))[_0x1d20('0x2e')](function(_0x2f5453){if(_0x2f5453){var _0x1b83ae=[_0x1d20('0x6d'),_0x1d20('0x6e'),_0x1d20('0x6f'),'Sms',_0x1d20('0x71'),_0x1d20('0x72'),_0x1d20('0x73')];return db[_0x1d20('0x74')][_0x1d20('0x75')](function(_0x127e57){var _0x53e00c=_['map'](_0x1b83ae,function(_0x10510a){var _0x41adc2={'attributes':['id',_0x1d20('0x34')]};return _0x2f5453[_0x1d20('0x2f')+_0x10510a+_0x1d20('0x65')](_0x41adc2)[_0x1d20('0x2e')](function(_0x3fe765){var _0x4b9415=_[_0x1d20('0x37')](_0x3fe765,function(_0x529ae5){return _0x529ae5[_0x1d20('0x83')](_0x1b0ba4[_0x1d20('0x3d')][_0x1d20('0x6a')],{'transaction':_0x127e57})[_0x1d20('0x2e')](function(){var _0x5de383=JSON[_0x1d20('0x84')]('['+_0x1b0ba4[_0x1d20('0x3d')][_0x1d20('0x6a')]+']');var _0x5526fe=_[_0x1d20('0x37')](_0x5de383,function(_0x568dc6){socket['emit'](_0x1d20('0x57')+_0x10510a+'Queue:remove',{'UserId':Number(_0x568dc6),[_0x10510a+'QueueId']:_0x529ae5['id']});if(_0x10510a!==_0x1d20('0x6d'))return;return db[_0x1d20('0x7c')][_0x1d20('0x31')]({'where':{'VoiceQueueId':_0x529ae5['id'],'UserId':_0x568dc6},'transaction':_0x127e57});});return Promise[_0x1d20('0x82')](_0x5526fe);});});return Promise[_0x1d20('0x82')](_0x4b9415);});});return Promise[_0x1d20('0x82')](_0x53e00c)[_0x1d20('0x2e')](function(){return _0x2f5453['removeAgents'](_0x1b0ba4[_0x1d20('0x3d')][_0x1d20('0x6a')],{'transaction':_0x127e57});});});}})[_0x1d20('0x2e')](respondWithStatusCode(_0x4d2777,null))[_0x1d20('0x51')](handleError(_0x4d2777,null));};exports[_0x1d20('0x85')]=function(_0x4c9a45,_0x18ec02,_0x549f43){var _0x5f178e={};var _0x5cf789={};var _0x4360db;var _0xd771fc;return db[_0x1d20('0x4d')][_0x1d20('0x5e')]({'where':{'id':_0x4c9a45['params']['id']}})[_0x1d20('0x2e')](handleEntityNotFound(_0x18ec02,null))[_0x1d20('0x2e')](function(_0x5dc800){if(_0x5dc800){_0x4360db=_0x5dc800;_0x5cf789[_0x1d20('0x3c')]=_['keys'](db[_0x1d20('0x7b')][_0x1d20('0x38')]);_0x5cf789[_0x1d20('0x3d')]=_[_0x1d20('0x54')](_0x4c9a45['query']);_0x5cf789[_0x1d20('0x3e')]=_[_0x1d20('0x40')](_0x5cf789['model'],_0x5cf789[_0x1d20('0x3d')]);_0x5f178e[_0x1d20('0x3f')]=_[_0x1d20('0x40')](_0x5cf789[_0x1d20('0x3c')],qs['fields'](_0x4c9a45['query']['fields']));_0x5f178e[_0x1d20('0x3f')]=_0x5f178e[_0x1d20('0x3f')][_0x1d20('0x42')]?_0x5f178e[_0x1d20('0x3f')]:_0x5cf789[_0x1d20('0x3c')];_0x5f178e['order']=qs[_0x1d20('0x46')](_0x4c9a45['query'][_0x1d20('0x46')]);_0x5f178e['where']=qs[_0x1d20('0x3e')](_[_0x1d20('0x48')](_0x4c9a45[_0x1d20('0x3d')],_0x5cf789[_0x1d20('0x3e')]));if(_0x4c9a45[_0x1d20('0x3d')][_0x1d20('0x4b')]){_0x5f178e[_0x1d20('0x47')]=_[_0x1d20('0x49')](_0x5f178e['where'],{'$or':_[_0x1d20('0x37')](_0x5f178e[_0x1d20('0x3f')],function(_0x280cb4){var _0x1726db={};_0x1726db[_0x280cb4]={'$like':'%'+_0x4c9a45[_0x1d20('0x3d')]['filter']+'%'};return _0x1726db;})});}_0x5f178e=_['merge']({},_0x5f178e,_0x4c9a45['options']);return _0x4360db[_0x1d20('0x85')](_0x5f178e);}})[_0x1d20('0x2e')](function(_0x481dc1){if(_0x481dc1){_0xd771fc=_0x481dc1['length'];if(!_0x4c9a45[_0x1d20('0x3d')]['hasOwnProperty']('nolimit')){_0x5f178e['limit']=qs['limit'](_0x4c9a45[_0x1d20('0x3d')]['limit']);_0x5f178e[_0x1d20('0x24')]=qs[_0x1d20('0x24')](_0x4c9a45[_0x1d20('0x3d')][_0x1d20('0x24')]);}return _0x4360db[_0x1d20('0x85')](_0x5f178e);}})[_0x1d20('0x2e')](function(_0x1459b9){if(_0x1459b9){return _0x1459b9?{'count':_0xd771fc,'rows':_0x1459b9}:null;}})[_0x1d20('0x2e')](respondWithResult(_0x18ec02,null))['catch'](handleError(_0x18ec02,null));}; \ No newline at end of file +var _0x5a41=['Sequelize','capitalize','toLowerCase','ValidationError','Unknown\x20channel','add','Queues','ids','isValidChannel','remove','addAgents','Voice','Chat','Mail','Sms','Openchannel','Whatsapp','sequelize','transaction','through','QueueId','TeamVoiceQueue','penalty','User','Queue','emit','Queue:save','findAll','online','voicePause','UserVoiceQueueRt','isNil','interface','format','SIP/%s','all','removeAgents','parse','Queue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','./team.socket','register','sendStatus','status','json','undefined','limit','offset','Content-Range','apply','reject','save','update','destroy','then','get','Teams','end','name','send','index','Team','rawAttributes','type','model','map','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','count','includeAll','include','rows','catch','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getQueues','findOne','channel'];(function(_0x30faec,_0x18940b){var _0x29484f=function(_0x169ae8){while(--_0x169ae8){_0x30faec['push'](_0x30faec['shift']());}};_0x29484f(++_0x18940b);}(_0x5a41,0x1b1));var _0x15a4=function(_0x2493f7,_0x49c670){_0x2493f7=_0x2493f7-0x0;var _0x594ab2=_0x5a41[_0x2493f7];return _0x594ab2;};'use strict';var emlformat=require(_0x15a4('0x0'));var rimraf=require(_0x15a4('0x1'));var zipdir=require(_0x15a4('0x2'));var jsonpatch=require(_0x15a4('0x3'));var rp=require(_0x15a4('0x4'));var moment=require('moment');var BPromise=require(_0x15a4('0x5'));var Mustache=require(_0x15a4('0x6'));var util=require(_0x15a4('0x7'));var path=require(_0x15a4('0x8'));var sox=require(_0x15a4('0x9'));var csv=require('to-csv');var ejs=require(_0x15a4('0xa'));var fs=require('fs');var fs_extra=require(_0x15a4('0xb'));var _=require(_0x15a4('0xc'));var squel=require('squel');var crypto=require(_0x15a4('0xd'));var jsforce=require(_0x15a4('0xe'));var deskjs=require(_0x15a4('0xf'));var toCsv=require(_0x15a4('0x10'));var querystring=require(_0x15a4('0x11'));var Papa=require(_0x15a4('0x12'));var Redis=require(_0x15a4('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x15a4('0x14'));var as=require(_0x15a4('0x15'));var hardwareService=require(_0x15a4('0x16'));var logger=require('../../config/logger')(_0x15a4('0x17'));var utils=require(_0x15a4('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x15a4('0x19'))['db'];config[_0x15a4('0x1a')]=_[_0x15a4('0x1b')](config[_0x15a4('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x15a4('0x1c'))(new Redis(config['redis']));require(_0x15a4('0x1d'))[_0x15a4('0x1e')](socket);function respondWithStatusCode(_0x4708e8,_0x536891){_0x536891=_0x536891||0xcc;return function(_0x37dfea){if(_0x37dfea){return _0x4708e8[_0x15a4('0x1f')](_0x536891);}return _0x4708e8['status'](_0x536891)['end']();};}function respondWithResult(_0x148483,_0x43904b){_0x43904b=_0x43904b||0xc8;return function(_0x428751){if(_0x428751){return _0x148483[_0x15a4('0x20')](_0x43904b)[_0x15a4('0x21')](_0x428751);}};}function respondWithFilteredResult(_0x564996,_0x3f7298){return function(_0x4b1679){if(_0x4b1679){var _0x257a0c=typeof _0x3f7298['offset']===_0x15a4('0x22')&&typeof _0x3f7298[_0x15a4('0x23')]===_0x15a4('0x22');var _0x3733c4=_0x4b1679['count'];var _0x3f6320=_0x257a0c?0x0:_0x3f7298[_0x15a4('0x24')];var _0x4893bd=_0x257a0c?_0x4b1679['count']:_0x3f7298[_0x15a4('0x24')]+_0x3f7298[_0x15a4('0x23')];var _0x19ab38;if(_0x4893bd>=_0x3733c4){_0x4893bd=_0x3733c4;_0x19ab38=0xc8;}else{_0x19ab38=0xce;}_0x564996[_0x15a4('0x20')](_0x19ab38);return _0x564996['set'](_0x15a4('0x25'),_0x3f6320+'-'+_0x4893bd+'/'+_0x3733c4)['json'](_0x4b1679);}return null;};}function patchUpdates(_0x938126){return function(_0x3eaf67){try{jsonpatch[_0x15a4('0x26')](_0x3eaf67,_0x938126,!![]);}catch(_0x18e8af){return BPromise[_0x15a4('0x27')](_0x18e8af);}return _0x3eaf67[_0x15a4('0x28')]();};}function saveUpdates(_0x13e0c4,_0x540927){return function(_0xfe1f15){if(_0xfe1f15){return _0xfe1f15[_0x15a4('0x29')](_0x13e0c4)['then'](function(_0x265ff9){return _0x265ff9;});}return null;};}function removeEntity(_0x289fdb,_0x73f1d4){return function(_0x50bf35){if(_0x50bf35){return _0x50bf35[_0x15a4('0x2a')]()[_0x15a4('0x2b')](function(){var _0x83347a=_0x50bf35[_0x15a4('0x2c')]({'plain':!![]});var _0x12e4c8=_0x15a4('0x2d');return db['UserProfileResource']['destroy']({'where':{'type':_0x12e4c8,'resourceId':_0x83347a['id']}})[_0x15a4('0x2b')](function(){return _0x50bf35;});})[_0x15a4('0x2b')](function(){_0x289fdb[_0x15a4('0x20')](0xcc)[_0x15a4('0x2e')]();});}};}function handleEntityNotFound(_0xc5d2b4,_0x25ce1b){return function(_0x572509){if(!_0x572509){_0xc5d2b4[_0x15a4('0x1f')](0x194);}return _0x572509;};}function handleError(_0x2ddd66,_0x3eba60){_0x3eba60=_0x3eba60||0x1f4;return function(_0x3ec8f2){logger['error'](_0x3ec8f2['stack']);if(_0x3ec8f2[_0x15a4('0x2f')]){delete _0x3ec8f2[_0x15a4('0x2f')];}_0x2ddd66[_0x15a4('0x20')](_0x3eba60)[_0x15a4('0x30')](_0x3ec8f2);};}exports[_0x15a4('0x31')]=function(_0x162bc5,_0x589e6b){var _0x49752a={},_0x2550d3={},_0x136cac={'count':0x0,'rows':[]};var _0x3697ac=_['map'](db[_0x15a4('0x32')][_0x15a4('0x33')],function(_0xd11de4){return{'name':_0xd11de4['fieldName'],'type':_0xd11de4[_0x15a4('0x34')]['key']};});_0x2550d3[_0x15a4('0x35')]=_[_0x15a4('0x36')](_0x3697ac,_0x15a4('0x2f'));_0x2550d3[_0x15a4('0x37')]=_[_0x15a4('0x38')](_0x162bc5[_0x15a4('0x37')]);_0x2550d3['filters']=_[_0x15a4('0x39')](_0x2550d3[_0x15a4('0x35')],_0x2550d3[_0x15a4('0x37')]);_0x49752a['attributes']=_[_0x15a4('0x39')](_0x2550d3['model'],qs[_0x15a4('0x3a')](_0x162bc5[_0x15a4('0x37')][_0x15a4('0x3a')]));_0x49752a[_0x15a4('0x3b')]=_0x49752a[_0x15a4('0x3b')]['length']?_0x49752a[_0x15a4('0x3b')]:_0x2550d3['model'];if(!_0x162bc5['query'][_0x15a4('0x3c')](_0x15a4('0x3d'))){_0x49752a[_0x15a4('0x23')]=qs[_0x15a4('0x23')](_0x162bc5[_0x15a4('0x37')]['limit']);_0x49752a[_0x15a4('0x24')]=qs[_0x15a4('0x24')](_0x162bc5[_0x15a4('0x37')]['offset']);}_0x49752a[_0x15a4('0x3e')]=qs[_0x15a4('0x3f')](_0x162bc5[_0x15a4('0x37')][_0x15a4('0x3f')]);_0x49752a[_0x15a4('0x40')]=qs[_0x15a4('0x41')](_[_0x15a4('0x42')](_0x162bc5[_0x15a4('0x37')],_0x2550d3['filters']),_0x3697ac);if(_0x162bc5[_0x15a4('0x37')][_0x15a4('0x43')]){_0x49752a['where']=_[_0x15a4('0x44')](_0x49752a[_0x15a4('0x40')],{'$or':_[_0x15a4('0x36')](_0x3697ac,function(_0x4d784a){if(_0x4d784a[_0x15a4('0x34')]!=='VIRTUAL'){var _0x575020={};_0x575020[_0x4d784a[_0x15a4('0x2f')]]={'$like':'%'+_0x162bc5[_0x15a4('0x37')]['filter']+'%'};return _0x575020;}})});}_0x49752a=_[_0x15a4('0x44')]({},_0x49752a,_0x162bc5[_0x15a4('0x45')]);var _0x31fb0c={'where':_0x49752a[_0x15a4('0x40')]};return db['Team'][_0x15a4('0x46')](_0x31fb0c)[_0x15a4('0x2b')](function(_0x54b264){_0x136cac['count']=_0x54b264;if(_0x162bc5[_0x15a4('0x37')][_0x15a4('0x47')]){_0x49752a[_0x15a4('0x48')]=[{'all':!![]}];}return db[_0x15a4('0x32')]['findAll'](_0x49752a);})['then'](function(_0x1d524e){_0x136cac[_0x15a4('0x49')]=_0x1d524e;return _0x136cac;})[_0x15a4('0x2b')](respondWithFilteredResult(_0x589e6b,_0x49752a))[_0x15a4('0x4a')](handleError(_0x589e6b,null));};exports[_0x15a4('0x4b')]=function(_0x48421a,_0x40b051){var _0x265c1f={'raw':![],'where':{'id':_0x48421a[_0x15a4('0x4c')]['id']}},_0x4faa3a={};_0x4faa3a['model']=_['keys'](db[_0x15a4('0x32')][_0x15a4('0x33')]);_0x4faa3a[_0x15a4('0x37')]=_['keys'](_0x48421a[_0x15a4('0x37')]);_0x4faa3a[_0x15a4('0x41')]=_[_0x15a4('0x39')](_0x4faa3a[_0x15a4('0x35')],_0x4faa3a['query']);_0x265c1f['attributes']=_[_0x15a4('0x39')](_0x4faa3a['model'],qs['fields'](_0x48421a[_0x15a4('0x37')][_0x15a4('0x3a')]));_0x265c1f[_0x15a4('0x3b')]=_0x265c1f[_0x15a4('0x3b')][_0x15a4('0x4d')]?_0x265c1f[_0x15a4('0x3b')]:_0x4faa3a['model'];if(_0x48421a[_0x15a4('0x37')]['includeAll']){_0x265c1f[_0x15a4('0x48')]=[{'all':!![]}];}_0x265c1f=_[_0x15a4('0x44')]({},_0x265c1f,_0x48421a[_0x15a4('0x45')]);return db[_0x15a4('0x32')][_0x15a4('0x4e')](_0x265c1f)[_0x15a4('0x2b')](handleEntityNotFound(_0x40b051,null))[_0x15a4('0x2b')](respondWithResult(_0x40b051,null))[_0x15a4('0x4a')](handleError(_0x40b051,null));};exports[_0x15a4('0x4f')]=function(_0x8e394e,_0x52ca51){return db[_0x15a4('0x32')][_0x15a4('0x4f')](_0x8e394e[_0x15a4('0x50')],{})[_0x15a4('0x2b')](function(_0x349b4e){var _0x3fb8e7=_0x8e394e[_0x15a4('0x51')][_0x15a4('0x2c')]({'plain':!![]});if(!_0x3fb8e7)throw new Error(_0x15a4('0x52'));if(_0x3fb8e7[_0x15a4('0x53')]===_0x15a4('0x51')){var _0x45aeec=_0x349b4e[_0x15a4('0x2c')]({'plain':!![]});var _0x51ce30='Teams';return db[_0x15a4('0x54')][_0x15a4('0x4e')]({'where':{'name':_0x51ce30,'userProfileId':_0x3fb8e7[_0x15a4('0x55')]},'raw':!![]})[_0x15a4('0x2b')](function(_0x24bc4e){if(_0x24bc4e&&_0x24bc4e['autoAssociation']===0x0){return db[_0x15a4('0x56')]['create']({'name':_0x45aeec['name'],'resourceId':_0x45aeec['id'],'type':_0x24bc4e[_0x15a4('0x2f')],'sectionId':_0x24bc4e['id']},{})[_0x15a4('0x2b')](function(){return _0x349b4e;});}else{return _0x349b4e;}})['catch'](function(_0x3ddfcf){logger['error'](_0x15a4('0x57'),_0x3ddfcf);throw _0x3ddfcf;});}return _0x349b4e;})[_0x15a4('0x2b')](respondWithResult(_0x52ca51,0xc9))[_0x15a4('0x4a')](handleError(_0x52ca51,null));};exports[_0x15a4('0x29')]=function(_0x1cd04a,_0x2030c3){if(_0x1cd04a[_0x15a4('0x50')]['id']){delete _0x1cd04a['body']['id'];}return db[_0x15a4('0x32')][_0x15a4('0x4e')]({'where':{'id':_0x1cd04a['params']['id']}})[_0x15a4('0x2b')](handleEntityNotFound(_0x2030c3,null))[_0x15a4('0x2b')](saveUpdates(_0x1cd04a['body'],null))[_0x15a4('0x2b')](respondWithResult(_0x2030c3,null))[_0x15a4('0x4a')](handleError(_0x2030c3,null));};exports[_0x15a4('0x2a')]=function(_0x54e535,_0xb21650){return db['Team'][_0x15a4('0x4e')]({'where':{'id':_0x54e535[_0x15a4('0x4c')]['id']}})['then'](handleEntityNotFound(_0xb21650,null))['then'](removeEntity(_0xb21650,null))[_0x15a4('0x4a')](handleError(_0xb21650,null));};exports[_0x15a4('0x58')]=function(_0x446cc5,_0x5e14fe,_0x443b43){return db['Team'][_0x15a4('0x59')]({'where':{'id':_0x446cc5[_0x15a4('0x4c')]['id']}})[_0x15a4('0x2b')](handleEntityNotFound(_0x5e14fe,null))['then'](function(_0x2239da){if(!_0x446cc5[_0x15a4('0x37')]['channel']||!utils['isValidChannel'](_0x446cc5[_0x15a4('0x37')][_0x15a4('0x5a')])){throw new db[(_0x15a4('0x5b'))]['ValidationError']('Unknown\x20channel');}var _0x436e49={};var _0x1f7e46={};_0x1f7e46[_0x15a4('0x35')]=_[_0x15a4('0x38')](db[_[_0x15a4('0x5c')](_0x446cc5[_0x15a4('0x37')]['channel'][_0x15a4('0x5d')]())+'Queue']['rawAttributes']);_0x1f7e46['query']=_['keys'](_0x446cc5[_0x15a4('0x37')]);_0x1f7e46[_0x15a4('0x41')]=_['intersection'](_0x1f7e46[_0x15a4('0x35')],_0x1f7e46[_0x15a4('0x37')]);_0x436e49[_0x15a4('0x3b')]=_[_0x15a4('0x39')](_0x1f7e46[_0x15a4('0x35')],qs['fields'](_0x446cc5[_0x15a4('0x37')]['fields']));_0x436e49[_0x15a4('0x3b')]=_0x436e49[_0x15a4('0x3b')][_0x15a4('0x4d')]?_0x436e49[_0x15a4('0x3b')]:_0x1f7e46[_0x15a4('0x35')];_0x436e49[_0x15a4('0x23')]=qs[_0x15a4('0x23')](_0x446cc5[_0x15a4('0x37')]['limit']);_0x436e49['offset']=qs[_0x15a4('0x24')](_0x446cc5['query'][_0x15a4('0x24')]);_0x436e49[_0x15a4('0x3e')]=qs[_0x15a4('0x3f')](_0x446cc5[_0x15a4('0x37')]['sort']);_0x436e49[_0x15a4('0x40')]=qs[_0x15a4('0x41')](_[_0x15a4('0x42')](_0x446cc5[_0x15a4('0x37')],_0x1f7e46['filters']));_0x436e49=_[_0x15a4('0x44')]({},_0x436e49,_0x446cc5[_0x15a4('0x45')]);return _0x2239da[_0x15a4('0x2c')+_[_0x15a4('0x5c')](_0x446cc5[_0x15a4('0x37')][_0x15a4('0x5a')]['toLowerCase']())+'Queues'](_0x436e49);})[_0x15a4('0x2b')](respondWithResult(_0x5e14fe,null))[_0x15a4('0x4a')](handleError(_0x5e14fe,null));};exports['addQueues']=function(_0x4c5306,_0x5fcdb6,_0x4acd1f){return db[_0x15a4('0x32')][_0x15a4('0x59')]({'where':{'id':_0x4c5306[_0x15a4('0x4c')]['id']}})[_0x15a4('0x2b')](function(_0x5f53cf){if(_0x5f53cf){if(!_0x4c5306['body'][_0x15a4('0x5a')]||!utils['isValidChannel'](_0x4c5306[_0x15a4('0x50')][_0x15a4('0x5a')])){throw new db['Sequelize'][(_0x15a4('0x5e'))](_0x15a4('0x5f'));}return _0x5f53cf[_0x15a4('0x60')+_[_0x15a4('0x5c')](_0x4c5306[_0x15a4('0x50')][_0x15a4('0x5a')][_0x15a4('0x5d')]())+_0x15a4('0x61')](_0x4c5306['body'][_0x15a4('0x62')]);}return null;})['then'](handleEntityNotFound(_0x5fcdb6,null))['then'](respondWithStatusCode(_0x5fcdb6,null))['catch'](handleError(_0x5fcdb6,null));};exports['removeQueues']=function(_0x38aad4,_0x44375f,_0x43fc37){return db[_0x15a4('0x32')][_0x15a4('0x59')]({'where':{'id':_0x38aad4['params']['id']}})[_0x15a4('0x2b')](function(_0x556740){if(_0x556740){if(!_0x38aad4[_0x15a4('0x37')]['channel']||!utils[_0x15a4('0x63')](_0x38aad4[_0x15a4('0x37')][_0x15a4('0x5a')])){throw new db['Sequelize'][(_0x15a4('0x5e'))](_0x15a4('0x5f'));}return _0x556740[_0x15a4('0x64')+_[_0x15a4('0x5c')](_0x38aad4[_0x15a4('0x37')][_0x15a4('0x5a')]['toLowerCase']())+'Queues'](_0x38aad4[_0x15a4('0x37')][_0x15a4('0x62')]);}return null;})[_0x15a4('0x2b')](handleEntityNotFound(_0x44375f,null))[_0x15a4('0x2b')](respondWithStatusCode(_0x44375f,null))[_0x15a4('0x4a')](handleError(_0x44375f,null));};exports[_0x15a4('0x65')]=function(_0x1ea986,_0x364b0c){return db['Team'][_0x15a4('0x4e')]({'where':{'id':_0x1ea986[_0x15a4('0x4c')]['id']}})[_0x15a4('0x2b')](handleEntityNotFound(_0x364b0c,null))[_0x15a4('0x2b')](function(_0xe7e05a){if(_0xe7e05a){var _0x4c901d=[_0x15a4('0x66'),_0x15a4('0x67'),_0x15a4('0x68'),_0x15a4('0x69'),'Fax',_0x15a4('0x6a'),_0x15a4('0x6b')];return db[_0x15a4('0x6c')][_0x15a4('0x6d')](function(_0x539d94){var _0x5a6bf0=_['map'](_0x4c901d,function(_0x19812b){var _0x4007af={'attributes':['id',_0x15a4('0x2f')]};if(_0x19812b===_0x15a4('0x66')){_0x4007af[_0x15a4('0x6e')]={'attributes':['penalty']};}return _0xe7e05a['get'+_0x19812b+_0x15a4('0x61')](_0x4007af)[_0x15a4('0x2b')](function(_0x97a8b9){var _0x3d6dd4=_[_0x15a4('0x36')](_0x97a8b9,function(_0x57f06d){var _0x4c7cc5=_['map'](_0x1ea986[_0x15a4('0x50')]['ids'],function(_0x321bdc){var _0x1111a4={'where':{'UserId':_0x321bdc,[_0x19812b+_0x15a4('0x6f')]:_0x57f06d['id']},'transaction':_0x539d94};if(_0x19812b==='Voice'){_0x1111a4['defaults']={'penalty':_0x57f06d[_0x15a4('0x70')][_0x15a4('0x71')]};}return db[_0x15a4('0x72')+_0x19812b+_0x15a4('0x73')]['findOrCreate'](_0x1111a4)[_0x15a4('0x2b')](function(){socket[_0x15a4('0x74')](_0x15a4('0x51')+_0x19812b+_0x15a4('0x75'),{'UserId':_0x321bdc,[_0x19812b+_0x15a4('0x6f')]:_0x57f06d['id']});if(_0x19812b!==_0x15a4('0x66'))return;return db[_0x15a4('0x72')][_0x15a4('0x76')]({'where':{'id':_0x1ea986['body']['ids'],'online':0x1},'attributes':['id',_0x15a4('0x2f'),_0x15a4('0x77'),_0x15a4('0x78'),'interface'],'raw':!![]})['then'](function(_0x302e9c){var _0x527dde=_[_0x15a4('0x36')](_0x302e9c,function(_0x18d877){return db[_0x15a4('0x79')]['upsert']({'membername':_0x18d877[_0x15a4('0x2f')],'UserId':_0x18d877['id'],'queue_name':_0x57f06d[_0x15a4('0x2f')],'VoiceQueueId':_0x57f06d['id'],'interface':_[_0x15a4('0x7a')](_0x18d877[_0x15a4('0x7b')])?util[_0x15a4('0x7c')](_0x15a4('0x7d'),_0x18d877[_0x15a4('0x2f')]):_0x18d877[_0x15a4('0x7b')],'paused':_0x18d877[_0x15a4('0x78')]||![],'penalty':_0x57f06d[_0x15a4('0x70')][_0x15a4('0x71')]},{'transaction':_0x539d94});});return Promise['all'](_0x527dde);});});});return Promise[_0x15a4('0x7e')](_0x4c7cc5);});return Promise[_0x15a4('0x7e')](_0x3d6dd4);});});return Promise[_0x15a4('0x7e')](_0x5a6bf0)[_0x15a4('0x2b')](function(){return _0xe7e05a[_0x15a4('0x65')](_0x1ea986[_0x15a4('0x50')]['ids'],{'transaction':_0x539d94})['spread'](function(_0x994fa0){return _0x994fa0;});});});}})[_0x15a4('0x2b')](respondWithResult(_0x364b0c,null))['catch'](handleError(_0x364b0c,null));};exports[_0x15a4('0x7f')]=function(_0x211ebe,_0x283a04){return db[_0x15a4('0x32')][_0x15a4('0x4e')]({'where':{'id':_0x211ebe[_0x15a4('0x4c')]['id']}})[_0x15a4('0x2b')](handleEntityNotFound(_0x283a04,null))[_0x15a4('0x2b')](function(_0x32029c){if(_0x32029c){var _0x33803e=[_0x15a4('0x66'),_0x15a4('0x67'),'Mail',_0x15a4('0x69'),'Fax',_0x15a4('0x6a'),_0x15a4('0x6b')];return db[_0x15a4('0x6c')][_0x15a4('0x6d')](function(_0x555693){var _0x30c51d=_[_0x15a4('0x36')](_0x33803e,function(_0x1f72ca){var _0x5bff23={'attributes':['id',_0x15a4('0x2f')]};return _0x32029c['get'+_0x1f72ca+_0x15a4('0x61')](_0x5bff23)['then'](function(_0x43ccba){var _0x1c4521=_[_0x15a4('0x36')](_0x43ccba,function(_0x47284b){return _0x47284b[_0x15a4('0x7f')](_0x211ebe[_0x15a4('0x37')][_0x15a4('0x62')],{'transaction':_0x555693})['then'](function(){var _0x5b0c82=JSON[_0x15a4('0x80')]('['+_0x211ebe[_0x15a4('0x37')]['ids']+']');var _0x1c95fa=_[_0x15a4('0x36')](_0x5b0c82,function(_0x55d66a){socket[_0x15a4('0x74')]('user'+_0x1f72ca+_0x15a4('0x81'),{'UserId':Number(_0x55d66a),[_0x1f72ca+_0x15a4('0x6f')]:_0x47284b['id']});if(_0x1f72ca!==_0x15a4('0x66'))return;return db[_0x15a4('0x79')][_0x15a4('0x2a')]({'where':{'VoiceQueueId':_0x47284b['id'],'UserId':_0x55d66a},'transaction':_0x555693});});return Promise['all'](_0x1c95fa);});});return Promise[_0x15a4('0x7e')](_0x1c4521);});});return Promise[_0x15a4('0x7e')](_0x30c51d)[_0x15a4('0x2b')](function(){return _0x32029c[_0x15a4('0x7f')](_0x211ebe['query'][_0x15a4('0x62')],{'transaction':_0x555693});});});}})[_0x15a4('0x2b')](respondWithStatusCode(_0x283a04,null))[_0x15a4('0x4a')](handleError(_0x283a04,null));};exports[_0x15a4('0x82')]=function(_0x478db0,_0x2c88e6,_0x2c61f5){var _0x31f199={};var _0x53a619={};var _0x325780;var _0x45dc47;return db[_0x15a4('0x32')]['findOne']({'where':{'id':_0x478db0[_0x15a4('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2c88e6,null))[_0x15a4('0x2b')](function(_0xff9363){if(_0xff9363){_0x325780=_0xff9363;_0x53a619[_0x15a4('0x35')]=_[_0x15a4('0x38')](db[_0x15a4('0x72')]['rawAttributes']);_0x53a619[_0x15a4('0x37')]=_[_0x15a4('0x38')](_0x478db0[_0x15a4('0x37')]);_0x53a619['filters']=_['intersection'](_0x53a619['model'],_0x53a619['query']);_0x31f199['attributes']=_['intersection'](_0x53a619[_0x15a4('0x35')],qs[_0x15a4('0x3a')](_0x478db0[_0x15a4('0x37')][_0x15a4('0x3a')]));_0x31f199[_0x15a4('0x3b')]=_0x31f199['attributes'][_0x15a4('0x4d')]?_0x31f199[_0x15a4('0x3b')]:_0x53a619[_0x15a4('0x35')];_0x31f199[_0x15a4('0x3e')]=qs[_0x15a4('0x3f')](_0x478db0[_0x15a4('0x37')][_0x15a4('0x3f')]);_0x31f199['where']=qs[_0x15a4('0x41')](_['pick'](_0x478db0[_0x15a4('0x37')],_0x53a619['filters']));if(_0x478db0[_0x15a4('0x37')][_0x15a4('0x43')]){_0x31f199[_0x15a4('0x40')]=_[_0x15a4('0x44')](_0x31f199[_0x15a4('0x40')],{'$or':_[_0x15a4('0x36')](_0x31f199[_0x15a4('0x3b')],function(_0x549766){var _0x287aea={};_0x287aea[_0x549766]={'$like':'%'+_0x478db0[_0x15a4('0x37')]['filter']+'%'};return _0x287aea;})});}_0x31f199=_[_0x15a4('0x44')]({},_0x31f199,_0x478db0[_0x15a4('0x45')]);return _0x325780[_0x15a4('0x82')](_0x31f199);}})[_0x15a4('0x2b')](function(_0x50bf8c){if(_0x50bf8c){_0x45dc47=_0x50bf8c[_0x15a4('0x4d')];if(!_0x478db0['query']['hasOwnProperty']('nolimit')){_0x31f199['limit']=qs['limit'](_0x478db0[_0x15a4('0x37')]['limit']);_0x31f199[_0x15a4('0x24')]=qs[_0x15a4('0x24')](_0x478db0[_0x15a4('0x37')][_0x15a4('0x24')]);}return _0x325780[_0x15a4('0x82')](_0x31f199);}})[_0x15a4('0x2b')](function(_0x58b292){if(_0x58b292){return _0x58b292?{'count':_0x45dc47,'rows':_0x58b292}:null;}})[_0x15a4('0x2b')](respondWithResult(_0x2c88e6,null))[_0x15a4('0x4a')](handleError(_0x2c88e6,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index e7dafab..dd791df 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 _0x0f4d=['exports','Team','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0xd1e8a5,_0xbc9afd){var _0x5b251c=function(_0x4242b7){while(--_0x4242b7){_0xd1e8a5['push'](_0xd1e8a5['shift']());}};_0x5b251c(++_0xbc9afd);}(_0x0f4d,0x131));var _0xd0f4=function(_0x20ca18,_0x13721d){_0x20ca18=_0x20ca18-0x0;var _0x157156=_0x0f4d[_0x20ca18];return _0x157156;};'use strict';var EventEmitter=require('events');var Team=require('../../mysqldb')['db'][_0xd0f4('0x0')];var TeamEvents=new EventEmitter();TeamEvents[_0xd0f4('0x1')](0x0);var events={'afterCreate':_0xd0f4('0x2'),'afterUpdate':_0xd0f4('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3099d3){return function(_0x10469a,_0x59a6bf,_0x2ca74d){TeamEvents['emit'](_0x3099d3+':'+_0x10469a['id'],_0x10469a);TeamEvents[_0xd0f4('0x4')](_0x3099d3,_0x10469a);_0x2ca74d(null);};}for(var e in events){if(events[_0xd0f4('0x5')](e)){var event=events[e];Team[_0xd0f4('0x6')](e,emitEvent(event));}}module[_0xd0f4('0x7')]=TeamEvents; \ No newline at end of file +var _0x700b=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x2a59e0,_0xc12ff){var _0x48813a=function(_0x58f368){while(--_0x58f368){_0x2a59e0['push'](_0x2a59e0['shift']());}};_0x48813a(++_0xc12ff);}(_0x700b,0x170));var _0xb700=function(_0x5635d0,_0x2dc7ab){_0x5635d0=_0x5635d0-0x0;var _0x211bf6=_0x700b[_0x5635d0];return _0x211bf6;};'use strict';var EventEmitter=require(_0xb700('0x0'));var Team=require(_0xb700('0x1'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0xb700('0x2')](0x0);var events={'afterCreate':_0xb700('0x3'),'afterUpdate':_0xb700('0x4'),'afterDestroy':_0xb700('0x5')};function emitEvent(_0x553c69){return function(_0x18cd7b,_0x19cdc8,_0x483950){TeamEvents['emit'](_0x553c69+':'+_0x18cd7b['id'],_0x18cd7b);TeamEvents[_0xb700('0x6')](_0x553c69,_0x18cd7b);_0x483950(null);};}for(var e in events){if(events[_0xb700('0x7')](e)){var event=events[e];Team[_0xb700('0x8')](e,emitEvent(event));}}module[_0xb700('0x9')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 28b905a..a46770f 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 _0x7cb8=['define','teams','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x5235a6,_0x680b76){var _0x1cf37e=function(_0x31c173){while(--_0x31c173){_0x5235a6['push'](_0x5235a6['shift']());}};_0x1cf37e(++_0x680b76);}(_0x7cb8,0x1d0));var _0x87cb=function(_0x16cdb5,_0xd822df){_0x16cdb5=_0x16cdb5-0x0;var _0x4bf967=_0x7cb8[_0x16cdb5];return _0x4bf967;};'use strict';var _=require('lodash');var util=require(_0x87cb('0x0'));var logger=require(_0x87cb('0x1'))(_0x87cb('0x2'));var moment=require(_0x87cb('0x3'));var BPromise=require('bluebird');var rp=require(_0x87cb('0x4'));var fs=require('fs');var path=require(_0x87cb('0x5'));var rimraf=require(_0x87cb('0x6'));var config=require(_0x87cb('0x7'));var attributes=require('./team.attributes');module[_0x87cb('0x8')]=function(_0x5295ec,_0x1f282c){return _0x5295ec[_0x87cb('0x9')]('Team',attributes,{'tableName':_0x87cb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2e5b=['../../config/logger','api','bluebird','rimraf','../../config/environment','exports','define','Team','teams','lodash','util'];(function(_0x3d81f7,_0x2066c8){var _0x3adcba=function(_0x465349){while(--_0x465349){_0x3d81f7['push'](_0x3d81f7['shift']());}};_0x3adcba(++_0x2066c8);}(_0x2e5b,0xc4));var _0xb2e5=function(_0x405f64,_0x39a205){_0x405f64=_0x405f64-0x0;var _0x477980=_0x2e5b[_0x405f64];return _0x477980;};'use strict';var _=require(_0xb2e5('0x0'));var util=require(_0xb2e5('0x1'));var logger=require(_0xb2e5('0x2'))(_0xb2e5('0x3'));var moment=require('moment');var BPromise=require(_0xb2e5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb2e5('0x5'));var config=require(_0xb2e5('0x6'));var attributes=require('./team.attributes');module[_0xb2e5('0x7')]=function(_0x452045,_0x133998){return _0x452045[_0xb2e5('0x8')](_0xb2e5('0x9'),attributes,{'tableName':_0xb2e5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 0708804..692ae21 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 _0xd500=['message','info','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','socket.io-emitter','./team.socket','register','request','then','Team,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x242f49,_0x29b7b7){var _0x278e55=function(_0x4c330a){while(--_0x4c330a){_0x242f49['push'](_0x242f49['shift']());}};_0x278e55(++_0x29b7b7);}(_0xd500,0xa6));var _0x0d50=function(_0x409353,_0xe9f04d){_0x409353=_0x409353-0x0;var _0x4f4b59=_0xd500[_0x409353];return _0x4f4b59;};'use strict';var _=require(_0x0d50('0x0'));var util=require(_0x0d50('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0d50('0x2'));var fs=require('fs');var Redis=require(_0x0d50('0x3'));var db=require(_0x0d50('0x4'))['db'];var utils=require(_0x0d50('0x5'));var logger=require(_0x0d50('0x6'))(_0x0d50('0x7'));var config=require('../../config/environment');var jayson=require(_0x0d50('0x8'));var client=jayson['client'][_0x0d50('0x9')]({'port':0x232a});config[_0x0d50('0xa')]=_[_0x0d50('0xb')](config[_0x0d50('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x0d50('0xc'))(new Redis(config['redis']));require(_0x0d50('0xd'))[_0x0d50('0xe')](socket);function respondWithRpcPromise(_0x513d6a,_0x578eca,_0x4d4a1b){return new BPromise(function(_0x1ad1fb,_0x2fc0bc){return client[_0x0d50('0xf')](_0x513d6a,_0x4d4a1b)[_0x0d50('0x10')](function(_0x291083){logger['info'](_0x0d50('0x11'),_0x578eca,_0x0d50('0x12'));logger[_0x0d50('0x13')]('Team,\x20%s,\x20%s,\x20%s',_0x578eca,_0x0d50('0x12'),JSON[_0x0d50('0x14')](_0x291083));if(_0x291083[_0x0d50('0x15')]){if(_0x291083[_0x0d50('0x15')][_0x0d50('0x16')]===0x1f4){logger[_0x0d50('0x15')](_0x0d50('0x11'),_0x578eca,_0x291083[_0x0d50('0x15')][_0x0d50('0x17')]);return _0x2fc0bc(_0x291083['error'][_0x0d50('0x17')]);}logger[_0x0d50('0x15')](_0x0d50('0x11'),_0x578eca,_0x291083['error']['message']);return _0x1ad1fb(_0x291083[_0x0d50('0x15')][_0x0d50('0x17')]);}else{logger[_0x0d50('0x18')]('Team,\x20%s,\x20%s',_0x578eca,_0x0d50('0x12'));_0x1ad1fb(_0x291083[_0x0d50('0x19')]['message']);}})[_0x0d50('0x1a')](function(_0x1379fd){logger['error']('Team,\x20%s,\x20%s',_0x578eca,_0x1379fd);_0x2fc0bc(_0x1379fd);});});} \ No newline at end of file +var _0x7883=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','redis','localhost','./team.socket','register','then','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','util','moment'];(function(_0x2b9e8a,_0x7b21d4){var _0x520e67=function(_0x22bce8){while(--_0x22bce8){_0x2b9e8a['push'](_0x2b9e8a['shift']());}};_0x520e67(++_0x7b21d4);}(_0x7883,0x143));var _0x3788=function(_0x5bf232,_0x13a66b){_0x5bf232=_0x5bf232-0x0;var _0x10a402=_0x7883[_0x5bf232];return _0x10a402;};'use strict';var _=require('lodash');var util=require(_0x3788('0x0'));var moment=require(_0x3788('0x1'));var BPromise=require(_0x3788('0x2'));var rs=require(_0x3788('0x3'));var fs=require('fs');var Redis=require(_0x3788('0x4'));var db=require(_0x3788('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3788('0x6'))(_0x3788('0x7'));var config=require(_0x3788('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3788('0x9')]({'port':0x232a});config[_0x3788('0xa')]=_['defaults'](config[_0x3788('0xa')],{'host':_0x3788('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3788('0xa')]));require(_0x3788('0xc'))[_0x3788('0xd')](socket);function respondWithRpcPromise(_0x3056d2,_0x4b6f9c,_0x2be7a1){return new BPromise(function(_0xc676d0,_0x5bd02d){return client['request'](_0x3056d2,_0x2be7a1)[_0x3788('0xe')](function(_0x249999){logger['info'](_0x3788('0xf'),_0x4b6f9c,_0x3788('0x10'));logger[_0x3788('0x11')](_0x3788('0x12'),_0x4b6f9c,_0x3788('0x10'),JSON[_0x3788('0x13')](_0x249999));if(_0x249999[_0x3788('0x14')]){if(_0x249999['error']['code']===0x1f4){logger[_0x3788('0x14')]('Team,\x20%s,\x20%s',_0x4b6f9c,_0x249999['error'][_0x3788('0x15')]);return _0x5bd02d(_0x249999[_0x3788('0x14')]['message']);}logger[_0x3788('0x14')](_0x3788('0xf'),_0x4b6f9c,_0x249999[_0x3788('0x14')]['message']);return _0xc676d0(_0x249999[_0x3788('0x14')][_0x3788('0x15')]);}else{logger[_0x3788('0x16')]('Team,\x20%s,\x20%s',_0x4b6f9c,_0x3788('0x10'));_0xc676d0(_0x249999[_0x3788('0x17')][_0x3788('0x15')]);}})[_0x3788('0x18')](function(_0x609445){logger[_0x3788('0x14')](_0x3788('0xf'),_0x4b6f9c,_0x609445);_0x5bd02d(_0x609445);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index a2d1c3d..09ba5e9 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 _0xe3f6=['register','team:','./team.events','save','remove','emit'];(function(_0x49d9af,_0x372210){var _0x59475f=function(_0x1f58be){while(--_0x1f58be){_0x49d9af['push'](_0x49d9af['shift']());}};_0x59475f(++_0x372210);}(_0xe3f6,0x92));var _0x6e3f=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0xe3f6[_0x5f309e];return _0x487b5e;};'use strict';var TeamEvents=require(_0x6e3f('0x0'));var events=[_0x6e3f('0x1'),_0x6e3f('0x2'),'update'];function createListener(_0x2f6230,_0x4eab97){return function(_0x1ead6f){_0x4eab97[_0x6e3f('0x3')](_0x2f6230,_0x1ead6f);};}function removeListener(_0x5d4727,_0x20c31b){return function(){TeamEvents['removeListener'](_0x5d4727,_0x20c31b);};}exports[_0x6e3f('0x4')]=function(_0x5ff9b4){for(var _0xbeed8=0x0,_0x232a4d=events['length'];_0xbeed8<_0x232a4d;_0xbeed8++){var _0x372b50=events[_0xbeed8];var _0x562d58=createListener(_0x6e3f('0x5')+_0x372b50,_0x5ff9b4);TeamEvents['on'](_0x372b50,_0x562d58);}}; \ No newline at end of file +var _0x9d1d=['emit','removeListener','length','team:','./team.events','update'];(function(_0x1201b4,_0x1d4a2b){var _0x1881fe=function(_0x730491){while(--_0x730491){_0x1201b4['push'](_0x1201b4['shift']());}};_0x1881fe(++_0x1d4a2b);}(_0x9d1d,0x118));var _0xd9d1=function(_0x59373e,_0x557f42){_0x59373e=_0x59373e-0x0;var _0x2c90a7=_0x9d1d[_0x59373e];return _0x2c90a7;};'use strict';var TeamEvents=require(_0xd9d1('0x0'));var events=['save','remove',_0xd9d1('0x1')];function createListener(_0x563b79,_0x57e33e){return function(_0x55cd16){_0x57e33e[_0xd9d1('0x2')](_0x563b79,_0x55cd16);};}function removeListener(_0x39c2ad,_0x577d03){return function(){TeamEvents[_0xd9d1('0x3')](_0x39c2ad,_0x577d03);};}exports['register']=function(_0x2450de){for(var _0x1ddd64=0x0,_0x5aa4fe=events[_0xd9d1('0x4')];_0x1ddd64<_0x5aa4fe;_0x1ddd64++){var _0x44f5e9=events[_0x1ddd64];var _0x18dd92=createListener(_0xd9d1('0x5')+_0x44f5e9,_0x2450de);TeamEvents['on'](_0x44f5e9,_0x18dd92);}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index bed4517..a6d0b1b 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x20fcda,_0x55688a){var _0x2b2a4a=function(_0x2ccbbd){while(--_0x2ccbbd){_0x20fcda['push'](_0x20fcda['shift']());}};_0x2b2a4a(++_0x55688a);}(_0xedd9,0xfc));var _0x9edd=function(_0x51baa9,_0x5da872){_0x51baa9=_0x51baa9-0x0;var _0x2434c5=_0xedd9[_0x51baa9];return _0x2434c5;};'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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x2bc936,_0x150c19){var _0x14d7e1=function(_0x31a151){while(--_0x31a151){_0x2bc936['push'](_0x2bc936['shift']());}};_0x14d7e1(++_0x150c19);}(_0xe706,0xa3));var _0x6e70=function(_0x209e12,_0x2ce907){_0x209e12=_0x209e12-0x0;var _0x3f5b89=_0xe706[_0x209e12];return _0x3f5b89;};'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/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 7181379..256ce84 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 _0x8802=['sequelize','INTEGER'];(function(_0xac3328,_0x23745a){var _0x33aec4=function(_0x476d1a){while(--_0x476d1a){_0xac3328['push'](_0xac3328['shift']());}};_0x33aec4(++_0x23745a);}(_0x8802,0x7e));var _0x2880=function(_0x4ec13d,_0x358a8f){_0x4ec13d=_0x4ec13d-0x0;var _0x3c3fa7=_0x8802[_0x4ec13d];return _0x3c3fa7;};'use strict';var Sequelize=require(_0x2880('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x2880('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x5f4e=['sequelize','INTEGER'];(function(_0x4f9baf,_0x17a0a1){var _0x5dd2dd=function(_0xc553ed){while(--_0xc553ed){_0x4f9baf['push'](_0x4f9baf['shift']());}};_0x5dd2dd(++_0x17a0a1);}(_0x5f4e,0x1d8));var _0xe5f4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5f4e[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xe5f4('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xe5f4('0x1')],'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 6efecbd..090579b 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 _0x9ff4=['rimraf','../../config/environment','./teamVoiceQueue.attributes','exports','define','TeamVoiceQueue','api','moment','bluebird','request-promise'];(function(_0x4494fb,_0x527d1c){var _0x59deab=function(_0x53c3fb){while(--_0x53c3fb){_0x4494fb['push'](_0x4494fb['shift']());}};_0x59deab(++_0x527d1c);}(_0x9ff4,0x196));var _0x49ff=function(_0x4424fd,_0x4921fe){_0x4424fd=_0x4424fd-0x0;var _0x13b18b=_0x9ff4[_0x4424fd];return _0x13b18b;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x49ff('0x0'));var moment=require(_0x49ff('0x1'));var BPromise=require(_0x49ff('0x2'));var rp=require(_0x49ff('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x49ff('0x4'));var config=require(_0x49ff('0x5'));var attributes=require(_0x49ff('0x6'));module[_0x49ff('0x7')]=function(_0x153755,_0x22febd){return _0x153755[_0x49ff('0x8')](_0x49ff('0x9'),attributes,{'tableName':'team_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6b61=['define','TeamVoiceQueue','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x539079,_0x5ea525){var _0x497e57=function(_0x77ac3e){while(--_0x77ac3e){_0x539079['push'](_0x539079['shift']());}};_0x497e57(++_0x5ea525);}(_0x6b61,0x16a));var _0x16b6=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0x6b61[_0x3c4737];return _0x2bb926;};'use strict';var _=require(_0x16b6('0x0'));var util=require('util');var logger=require(_0x16b6('0x1'))(_0x16b6('0x2'));var moment=require(_0x16b6('0x3'));var BPromise=require(_0x16b6('0x4'));var rp=require(_0x16b6('0x5'));var fs=require('fs');var path=require(_0x16b6('0x6'));var rimraf=require(_0x16b6('0x7'));var config=require(_0x16b6('0x8'));var attributes=require('./teamVoiceQueue.attributes');module[_0x16b6('0x9')]=function(_0x173c5d,_0x594a8f){return _0x173c5d[_0x16b6('0xa')](_0x16b6('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 94a7528..f6fa20f 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 _0xea1a=['info','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','error','TeamVoiceQueue,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then'];(function(_0x33e402,_0x4933ce){var _0x23f98f=function(_0x2009f0){while(--_0x2009f0){_0x33e402['push'](_0x33e402['shift']());}};_0x23f98f(++_0x4933ce);}(_0xea1a,0x158));var _0xaea1=function(_0x547bbc,_0xbd0069){_0x547bbc=_0x547bbc-0x0;var _0x4d5157=_0xea1a[_0x547bbc];return _0x4d5157;};'use strict';var _=require(_0xaea1('0x0'));var util=require(_0xaea1('0x1'));var moment=require(_0xaea1('0x2'));var BPromise=require(_0xaea1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaea1('0x4'));var db=require(_0xaea1('0x5'))['db'];var utils=require(_0xaea1('0x6'));var logger=require(_0xaea1('0x7'))(_0xaea1('0x8'));var config=require(_0xaea1('0x9'));var jayson=require(_0xaea1('0xa'));var client=jayson[_0xaea1('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x884233,_0x8883ab,_0x3359a9){return new BPromise(function(_0x51ca63,_0x1b5adf){return client['request'](_0x884233,_0x3359a9)[_0xaea1('0xc')](function(_0x4892e0){logger[_0xaea1('0xd')]('TeamVoiceQueue,\x20%s,\x20%s',_0x8883ab,'request\x20sent');logger['debug'](_0xaea1('0xe'),_0x8883ab,'request\x20sent',JSON['stringify'](_0x4892e0));if(_0x4892e0[_0xaea1('0xf')]){if(_0x4892e0[_0xaea1('0xf')]['code']===0x1f4){logger[_0xaea1('0xf')](_0xaea1('0x10'),_0x8883ab,_0x4892e0[_0xaea1('0xf')][_0xaea1('0x11')]);return _0x1b5adf(_0x4892e0[_0xaea1('0xf')][_0xaea1('0x11')]);}logger[_0xaea1('0xf')]('TeamVoiceQueue,\x20%s,\x20%s',_0x8883ab,_0x4892e0[_0xaea1('0xf')][_0xaea1('0x11')]);return _0x51ca63(_0x4892e0[_0xaea1('0xf')][_0xaea1('0x11')]);}else{logger[_0xaea1('0xd')](_0xaea1('0x10'),_0x8883ab,_0xaea1('0x12'));_0x51ca63(_0x4892e0[_0xaea1('0x13')][_0xaea1('0x11')]);}})[_0xaea1('0x14')](function(_0x2920f7){logger[_0xaea1('0xf')](_0xaea1('0x10'),_0x8883ab,_0x2920f7);_0x1b5adf(_0x2920f7);});});} \ No newline at end of file +var _0xf443=['request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s'];(function(_0x2f7f7c,_0x15e1bf){var _0x55f9cc=function(_0x4af87d){while(--_0x4af87d){_0x2f7f7c['push'](_0x2f7f7c['shift']());}};_0x55f9cc(++_0x15e1bf);}(_0xf443,0xda));var _0x3f44=function(_0x521b51,_0x1e5a1e){_0x521b51=_0x521b51-0x0;var _0x5585f5=_0xf443[_0x521b51];return _0x5585f5;};'use strict';var _=require(_0x3f44('0x0'));var util=require(_0x3f44('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3f44('0x2'));var fs=require('fs');var Redis=require(_0x3f44('0x3'));var db=require(_0x3f44('0x4'))['db'];var utils=require(_0x3f44('0x5'));var logger=require(_0x3f44('0x6'))(_0x3f44('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x3f44('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4b4690,_0x38bba1,_0x231eb7){return new BPromise(function(_0x276773,_0x459439){return client[_0x3f44('0x9')](_0x4b4690,_0x231eb7)[_0x3f44('0xa')](function(_0x459610){logger[_0x3f44('0xb')](_0x3f44('0xc'),_0x38bba1,_0x3f44('0xd'));logger[_0x3f44('0xe')](_0x3f44('0xf'),_0x38bba1,_0x3f44('0xd'),JSON[_0x3f44('0x10')](_0x459610));if(_0x459610[_0x3f44('0x11')]){if(_0x459610[_0x3f44('0x11')]['code']===0x1f4){logger[_0x3f44('0x11')](_0x3f44('0xc'),_0x38bba1,_0x459610['error'][_0x3f44('0x12')]);return _0x459439(_0x459610[_0x3f44('0x11')][_0x3f44('0x12')]);}logger[_0x3f44('0x11')](_0x3f44('0xc'),_0x38bba1,_0x459610[_0x3f44('0x11')][_0x3f44('0x12')]);return _0x276773(_0x459610[_0x3f44('0x11')][_0x3f44('0x12')]);}else{logger[_0x3f44('0xb')](_0x3f44('0xc'),_0x38bba1,'request\x20sent');_0x276773(_0x459610[_0x3f44('0x13')][_0x3f44('0x12')]);}})[_0x3f44('0x14')](function(_0x25e145){logger[_0x3f44('0x11')]('TeamVoiceQueue,\x20%s,\x20%s',_0x38bba1,_0x25e145);_0x459439(_0x25e145);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index cfba50c..a46dace 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 _0x19e1=['../../components/auth/service','../../config/environment','./template.controller','isAuthenticated','get','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra'];(function(_0xbc9b18,_0x4b8e42){var _0x432f8a=function(_0x44ab81){while(--_0x44ab81){_0xbc9b18['push'](_0xbc9b18['shift']());}};_0x432f8a(++_0x4b8e42);}(_0x19e1,0x163));var _0x119e=function(_0x2c6810,_0x23c079){_0x2c6810=_0x2c6810-0x0;var _0x213881=_0x19e1[_0x2c6810];return _0x213881;};'use strict';var multer=require(_0x119e('0x0'));var util=require(_0x119e('0x1'));var path=require(_0x119e('0x2'));var timeout=require(_0x119e('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x119e('0x4'));var auth=require(_0x119e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x119e('0x6'));var controller=require(_0x119e('0x7'));router['get']('/',auth[_0x119e('0x8')](),controller['index']);router[_0x119e('0x9')](_0x119e('0xa'),auth[_0x119e('0x8')](),controller[_0x119e('0xb')]);router['post']('/',auth[_0x119e('0x8')](),controller[_0x119e('0xc')]);router[_0x119e('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x119e('0xe')]);router[_0x119e('0xf')](_0x119e('0xa'),auth[_0x119e('0x8')](),controller[_0x119e('0x10')]);module[_0x119e('0x11')]=router; \ No newline at end of file +var _0x4d68=['get','isAuthenticated','index','show','post','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment'];(function(_0x241b41,_0x3c21b0){var _0xe39f82=function(_0x2e534c){while(--_0x2e534c){_0x241b41['push'](_0x241b41['shift']());}};_0xe39f82(++_0x3c21b0);}(_0x4d68,0x1c3));var _0x84d6=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0x4d68[_0x13b8f3];return _0x1a6d06;};'use strict';var multer=require(_0x84d6('0x0'));var util=require(_0x84d6('0x1'));var path=require(_0x84d6('0x2'));var timeout=require(_0x84d6('0x3'));var express=require(_0x84d6('0x4'));var router=express[_0x84d6('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x84d6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x84d6('0x7'));var controller=require('./template.controller');router[_0x84d6('0x8')]('/',auth[_0x84d6('0x9')](),controller[_0x84d6('0xa')]);router['get']('/:id',auth[_0x84d6('0x9')](),controller[_0x84d6('0xb')]);router[_0x84d6('0xc')]('/',auth[_0x84d6('0x9')](),controller['create']);router[_0x84d6('0xd')]('/:id',auth[_0x84d6('0x9')](),controller[_0x84d6('0xe')]);router[_0x84d6('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x84d6('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 35622f1..811c96c 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 _0x32fb=['TEXT','sequelize','exports','STRING'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x32fb,0x75));var _0xb32f=function(_0x1b4182,_0x2ba6c7){_0x1b4182=_0x1b4182-0x0;var _0x36a2ac=_0x32fb[_0x1b4182];return _0x36a2ac;};'use strict';var Sequelize=require(_0xb32f('0x0'));module[_0xb32f('0x1')]={'name':{'type':Sequelize[_0xb32f('0x2')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0xb32f('0x3')]}}; \ No newline at end of file +var _0xe0b3=['sequelize','exports','STRING','TEXT'];(function(_0x126373,_0x5364fb){var _0x2c6b9f=function(_0x386e6a){while(--_0x386e6a){_0x126373['push'](_0x126373['shift']());}};_0x2c6b9f(++_0x5364fb);}(_0xe0b3,0x170));var _0x3e0b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe0b3[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x3e0b('0x0'));module[_0x3e0b('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3e0b('0x2')]},'html':{'type':Sequelize[_0x3e0b('0x3')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 24f1aef..9e4be8c 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 _0x0431=['merge','Template','count','catch','show','params','keys','include','options','find','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','get','Templates','UserProfileResource','end','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter'];(function(_0x34d346,_0x4c6502){var _0x122d76=function(_0x22a5fd){while(--_0x22a5fd){_0x34d346['push'](_0x34d346['shift']());}};_0x122d76(++_0x4c6502);}(_0x0431,0x1ad));var _0x1043=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x0431[_0x5bd426];return _0x23a7eb;};'use strict';var emlformat=require(_0x1043('0x0'));var rimraf=require(_0x1043('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1043('0x2'));var rp=require('request-promise');var moment=require(_0x1043('0x3'));var BPromise=require(_0x1043('0x4'));var Mustache=require('mustache');var util=require(_0x1043('0x5'));var path=require(_0x1043('0x6'));var sox=require(_0x1043('0x7'));var csv=require(_0x1043('0x8'));var ejs=require(_0x1043('0x9'));var fs=require('fs');var fs_extra=require(_0x1043('0xa'));var _=require(_0x1043('0xb'));var squel=require(_0x1043('0xc'));var crypto=require(_0x1043('0xd'));var jsforce=require(_0x1043('0xe'));var deskjs=require(_0x1043('0xf'));var toCsv=require('to-csv');var querystring=require(_0x1043('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1043('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x1043('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1043('0x13'));var utils=require(_0x1043('0x14'));var config=require(_0x1043('0x15'));var licenseUtil=require(_0x1043('0x16'));var db=require(_0x1043('0x17'))['db'];function respondWithStatusCode(_0x9e7600,_0x4b7b93){_0x4b7b93=_0x4b7b93||0xcc;return function(_0x3320e9){if(_0x3320e9){return _0x9e7600['sendStatus'](_0x4b7b93);}return _0x9e7600[_0x1043('0x18')](_0x4b7b93)['end']();};}function respondWithResult(_0x454572,_0x375442){_0x375442=_0x375442||0xc8;return function(_0xdac290){if(_0xdac290){return _0x454572[_0x1043('0x18')](_0x375442)[_0x1043('0x19')](_0xdac290);}};}function respondWithFilteredResult(_0xcf0cf4,_0x584608){return function(_0x1a5a64){if(_0x1a5a64){var _0x32d14d=typeof _0x584608[_0x1043('0x1a')]===_0x1043('0x1b')&&typeof _0x584608['limit']==='undefined';var _0x14a72f=_0x1a5a64['count'];var _0x5440db=_0x32d14d?0x0:_0x584608['offset'];var _0x4eefa2=_0x32d14d?_0x1a5a64['count']:_0x584608[_0x1043('0x1a')]+_0x584608[_0x1043('0x1c')];var _0x1c9b9f;if(_0x4eefa2>=_0x14a72f){_0x4eefa2=_0x14a72f;_0x1c9b9f=0xc8;}else{_0x1c9b9f=0xce;}_0xcf0cf4['status'](_0x1c9b9f);return _0xcf0cf4[_0x1043('0x1d')](_0x1043('0x1e'),_0x5440db+'-'+_0x4eefa2+'/'+_0x14a72f)[_0x1043('0x19')](_0x1a5a64);}return null;};}function patchUpdates(_0x598256){return function(_0x61344b){try{jsonpatch[_0x1043('0x1f')](_0x61344b,_0x598256,!![]);}catch(_0x1de731){return BPromise[_0x1043('0x20')](_0x1de731);}return _0x61344b[_0x1043('0x21')]();};}function saveUpdates(_0x383f60,_0x5b38aa){return function(_0xed759f){if(_0xed759f){return _0xed759f[_0x1043('0x22')](_0x383f60)[_0x1043('0x23')](function(_0x4a6dff){return _0x4a6dff;});}return null;};}function removeEntity(_0x1182eb,_0x273e20){return function(_0x38de8b){if(_0x38de8b){return _0x38de8b['destroy']()[_0x1043('0x23')](function(){var _0x271380=_0x38de8b[_0x1043('0x24')]({'plain':!![]});var _0x2a3419=_0x1043('0x25');return db[_0x1043('0x26')]['destroy']({'where':{'type':_0x2a3419,'resourceId':_0x271380['id']}})[_0x1043('0x23')](function(){return _0x38de8b;});})[_0x1043('0x23')](function(){_0x1182eb[_0x1043('0x18')](0xcc)[_0x1043('0x27')]();});}};}function handleEntityNotFound(_0x2da62d,_0x4f44ed){return function(_0x361e49){if(!_0x361e49){_0x2da62d[_0x1043('0x28')](0x194);}return _0x361e49;};}function handleError(_0x47f513,_0x407cce){_0x407cce=_0x407cce||0x1f4;return function(_0x79809a){logger[_0x1043('0x29')](_0x79809a[_0x1043('0x2a')]);if(_0x79809a['name']){delete _0x79809a[_0x1043('0x2b')];}_0x47f513[_0x1043('0x18')](_0x407cce)[_0x1043('0x2c')](_0x79809a);};}exports[_0x1043('0x2d')]=function(_0x1e1a9c,_0x17d8c6){var _0x39c1cc={},_0x384d6e={},_0x3e9e27={'count':0x0,'rows':[]};var _0x36d9c3=_['map'](db['Template'][_0x1043('0x2e')],function(_0x49b736){return{'name':_0x49b736[_0x1043('0x2f')],'type':_0x49b736[_0x1043('0x30')][_0x1043('0x31')]};});_0x384d6e[_0x1043('0x32')]=_[_0x1043('0x33')](_0x36d9c3,_0x1043('0x2b'));_0x384d6e['query']=_['keys'](_0x1e1a9c[_0x1043('0x34')]);_0x384d6e[_0x1043('0x35')]=_[_0x1043('0x36')](_0x384d6e['model'],_0x384d6e[_0x1043('0x34')]);_0x39c1cc['attributes']=_[_0x1043('0x36')](_0x384d6e[_0x1043('0x32')],qs['fields'](_0x1e1a9c[_0x1043('0x34')][_0x1043('0x37')]));_0x39c1cc[_0x1043('0x38')]=_0x39c1cc[_0x1043('0x38')][_0x1043('0x39')]?_0x39c1cc['attributes']:_0x384d6e['model'];if(!_0x1e1a9c['query'][_0x1043('0x3a')]('nolimit')){_0x39c1cc['limit']=qs['limit'](_0x1e1a9c[_0x1043('0x34')]['limit']);_0x39c1cc[_0x1043('0x1a')]=qs[_0x1043('0x1a')](_0x1e1a9c[_0x1043('0x34')][_0x1043('0x1a')]);}_0x39c1cc[_0x1043('0x3b')]=qs[_0x1043('0x3c')](_0x1e1a9c[_0x1043('0x34')]['sort']);_0x39c1cc[_0x1043('0x3d')]=qs[_0x1043('0x35')](_['pick'](_0x1e1a9c[_0x1043('0x34')],_0x384d6e[_0x1043('0x35')]),_0x36d9c3);if(_0x1e1a9c[_0x1043('0x34')][_0x1043('0x3e')]){_0x39c1cc['where']=_[_0x1043('0x3f')](_0x39c1cc[_0x1043('0x3d')],{'$or':_[_0x1043('0x33')](_0x36d9c3,function(_0x59245e){if(_0x59245e[_0x1043('0x30')]!=='VIRTUAL'){var _0x286650={};_0x286650[_0x59245e[_0x1043('0x2b')]]={'$like':'%'+_0x1e1a9c[_0x1043('0x34')][_0x1043('0x3e')]+'%'};return _0x286650;}})});}_0x39c1cc=_[_0x1043('0x3f')]({},_0x39c1cc,_0x1e1a9c['options']);var _0x18ed90={'where':_0x39c1cc[_0x1043('0x3d')]};return db[_0x1043('0x40')][_0x1043('0x41')](_0x18ed90)[_0x1043('0x23')](function(_0x40d392){_0x3e9e27[_0x1043('0x41')]=_0x40d392;if(_0x1e1a9c[_0x1043('0x34')]['includeAll']){_0x39c1cc['include']=[{'all':!![]}];}return db[_0x1043('0x40')]['findAll'](_0x39c1cc);})[_0x1043('0x23')](function(_0x8df6ce){_0x3e9e27['rows']=_0x8df6ce;return _0x3e9e27;})['then'](respondWithFilteredResult(_0x17d8c6,_0x39c1cc))[_0x1043('0x42')](handleError(_0x17d8c6,null));};exports[_0x1043('0x43')]=function(_0x3397e5,_0x46b256){var _0x52a66e={'raw':!![],'where':{'id':_0x3397e5[_0x1043('0x44')]['id']}},_0x41f211={};_0x41f211[_0x1043('0x32')]=_[_0x1043('0x45')](db[_0x1043('0x40')][_0x1043('0x2e')]);_0x41f211['query']=_[_0x1043('0x45')](_0x3397e5[_0x1043('0x34')]);_0x41f211[_0x1043('0x35')]=_[_0x1043('0x36')](_0x41f211[_0x1043('0x32')],_0x41f211[_0x1043('0x34')]);_0x52a66e[_0x1043('0x38')]=_['intersection'](_0x41f211['model'],qs['fields'](_0x3397e5['query']['fields']));_0x52a66e['attributes']=_0x52a66e[_0x1043('0x38')][_0x1043('0x39')]?_0x52a66e['attributes']:_0x41f211[_0x1043('0x32')];if(_0x3397e5[_0x1043('0x34')]['includeAll']){_0x52a66e[_0x1043('0x46')]=[{'all':!![]}];}_0x52a66e=_[_0x1043('0x3f')]({},_0x52a66e,_0x3397e5[_0x1043('0x47')]);return db[_0x1043('0x40')][_0x1043('0x48')](_0x52a66e)[_0x1043('0x23')](handleEntityNotFound(_0x46b256,null))[_0x1043('0x23')](respondWithResult(_0x46b256,null))[_0x1043('0x42')](handleError(_0x46b256,null));};exports[_0x1043('0x49')]=function(_0x3604d7,_0x3d95fa){return db[_0x1043('0x40')][_0x1043('0x49')](_0x3604d7[_0x1043('0x4a')],{})[_0x1043('0x23')](function(_0x4710be){var _0x162653=_0x3604d7['user'][_0x1043('0x24')]({'plain':!![]});if(!_0x162653)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x162653[_0x1043('0x4b')]===_0x1043('0x4c')){var _0x561703=_0x4710be[_0x1043('0x24')]({'plain':!![]});var _0x5b5239='Templates';return db[_0x1043('0x4d')]['find']({'where':{'name':_0x5b5239,'userProfileId':_0x162653[_0x1043('0x4e')]},'raw':!![]})[_0x1043('0x23')](function(_0x141012){if(_0x141012&&_0x141012[_0x1043('0x4f')]===0x0){return db[_0x1043('0x26')][_0x1043('0x49')]({'name':_0x561703[_0x1043('0x2b')],'resourceId':_0x561703['id'],'type':_0x141012[_0x1043('0x2b')],'sectionId':_0x141012['id']},{})[_0x1043('0x23')](function(){return _0x4710be;});}else{return _0x4710be;}})[_0x1043('0x42')](function(_0x311e91){logger[_0x1043('0x29')](_0x1043('0x50'),_0x311e91);throw _0x311e91;});}return _0x4710be;})[_0x1043('0x23')](respondWithResult(_0x3d95fa,0xc9))[_0x1043('0x42')](handleError(_0x3d95fa,null));};exports[_0x1043('0x22')]=function(_0x623f99,_0x50097f){if(_0x623f99[_0x1043('0x4a')]['id']){delete _0x623f99[_0x1043('0x4a')]['id'];}return db['Template'][_0x1043('0x48')]({'where':{'id':_0x623f99['params']['id']}})[_0x1043('0x23')](handleEntityNotFound(_0x50097f,null))['then'](saveUpdates(_0x623f99['body'],null))[_0x1043('0x23')](respondWithResult(_0x50097f,null))[_0x1043('0x42')](handleError(_0x50097f,null));};exports[_0x1043('0x51')]=function(_0x108e1f,_0x2802f7){return db['Template'][_0x1043('0x48')]({'where':{'id':_0x108e1f['params']['id']}})[_0x1043('0x23')](handleEntityNotFound(_0x2802f7,null))[_0x1043('0x23')](removeEntity(_0x2802f7,null))[_0x1043('0x42')](handleError(_0x2802f7,null));}; \ No newline at end of file +var _0x802a=['find','catch','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','Templates','UserProfileResource','sendStatus','error','name','index','map','Template','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','includeAll','include','findAll','rows','show','params','options'];(function(_0x3a5f10,_0x1904a6){var _0x1fa170=function(_0x1f3321){while(--_0x1f3321){_0x3a5f10['push'](_0x3a5f10['shift']());}};_0x1fa170(++_0x1904a6);}(_0x802a,0xb5));var _0xa802=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0x802a[_0x243b59];return _0x3e1676;};'use strict';var emlformat=require(_0xa802('0x0'));var rimraf=require(_0xa802('0x1'));var zipdir=require(_0xa802('0x2'));var jsonpatch=require(_0xa802('0x3'));var rp=require(_0xa802('0x4'));var moment=require(_0xa802('0x5'));var BPromise=require(_0xa802('0x6'));var Mustache=require('mustache');var util=require(_0xa802('0x7'));var path=require(_0xa802('0x8'));var sox=require(_0xa802('0x9'));var csv=require('to-csv');var ejs=require(_0xa802('0xa'));var fs=require('fs');var fs_extra=require(_0xa802('0xb'));var _=require(_0xa802('0xc'));var squel=require(_0xa802('0xd'));var crypto=require(_0xa802('0xe'));var jsforce=require(_0xa802('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xa802('0x10'));var querystring=require('querystring');var Papa=require(_0xa802('0x11'));var Redis=require(_0xa802('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xa802('0x13'));var as=require(_0xa802('0x14'));var hardwareService=require(_0xa802('0x15'));var logger=require(_0xa802('0x16'))(_0xa802('0x17'));var utils=require(_0xa802('0x18'));var config=require(_0xa802('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa802('0x1a'))['db'];function respondWithStatusCode(_0x2ecb03,_0x16949c){_0x16949c=_0x16949c||0xcc;return function(_0x348ce9){if(_0x348ce9){return _0x2ecb03['sendStatus'](_0x16949c);}return _0x2ecb03['status'](_0x16949c)['end']();};}function respondWithResult(_0x51b1ab,_0x510b2a){_0x510b2a=_0x510b2a||0xc8;return function(_0x3fd9af){if(_0x3fd9af){return _0x51b1ab[_0xa802('0x1b')](_0x510b2a)[_0xa802('0x1c')](_0x3fd9af);}};}function respondWithFilteredResult(_0x15551f,_0x1cfd62){return function(_0x1d02d6){if(_0x1d02d6){var _0x1cc6a2=typeof _0x1cfd62[_0xa802('0x1d')]===_0xa802('0x1e')&&typeof _0x1cfd62[_0xa802('0x1f')]===_0xa802('0x1e');var _0x4de23d=_0x1d02d6[_0xa802('0x20')];var _0x599a4d=_0x1cc6a2?0x0:_0x1cfd62[_0xa802('0x1d')];var _0x26ca9f=_0x1cc6a2?_0x1d02d6['count']:_0x1cfd62[_0xa802('0x1d')]+_0x1cfd62['limit'];var _0x85c116;if(_0x26ca9f>=_0x4de23d){_0x26ca9f=_0x4de23d;_0x85c116=0xc8;}else{_0x85c116=0xce;}_0x15551f[_0xa802('0x1b')](_0x85c116);return _0x15551f[_0xa802('0x21')](_0xa802('0x22'),_0x599a4d+'-'+_0x26ca9f+'/'+_0x4de23d)[_0xa802('0x1c')](_0x1d02d6);}return null;};}function patchUpdates(_0x928d23){return function(_0x5b0688){try{jsonpatch[_0xa802('0x23')](_0x5b0688,_0x928d23,!![]);}catch(_0x1fa2e1){return BPromise[_0xa802('0x24')](_0x1fa2e1);}return _0x5b0688['save']();};}function saveUpdates(_0x27e225,_0x37e2cb){return function(_0x3789fb){if(_0x3789fb){return _0x3789fb[_0xa802('0x25')](_0x27e225)[_0xa802('0x26')](function(_0x4b71f2){return _0x4b71f2;});}return null;};}function removeEntity(_0x30de53,_0x43f786){return function(_0x2f01e9){if(_0x2f01e9){return _0x2f01e9[_0xa802('0x27')]()['then'](function(){var _0x251428=_0x2f01e9[_0xa802('0x28')]({'plain':!![]});var _0x1bb3e2=_0xa802('0x29');return db[_0xa802('0x2a')][_0xa802('0x27')]({'where':{'type':_0x1bb3e2,'resourceId':_0x251428['id']}})['then'](function(){return _0x2f01e9;});})[_0xa802('0x26')](function(){_0x30de53[_0xa802('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a3c6a,_0x2f9631){return function(_0x4dedfc){if(!_0x4dedfc){_0x2a3c6a[_0xa802('0x2b')](0x194);}return _0x4dedfc;};}function handleError(_0x4da9b5,_0x3d2dde){_0x3d2dde=_0x3d2dde||0x1f4;return function(_0x5b648e){logger[_0xa802('0x2c')](_0x5b648e['stack']);if(_0x5b648e[_0xa802('0x2d')]){delete _0x5b648e[_0xa802('0x2d')];}_0x4da9b5[_0xa802('0x1b')](_0x3d2dde)['send'](_0x5b648e);};}exports[_0xa802('0x2e')]=function(_0x556e28,_0xa6e2be){var _0x4dc4c6={},_0x1c0d8c={},_0x27909d={'count':0x0,'rows':[]};var _0x1e4274=_[_0xa802('0x2f')](db[_0xa802('0x30')][_0xa802('0x31')],function(_0x1c1810){return{'name':_0x1c1810['fieldName'],'type':_0x1c1810[_0xa802('0x32')][_0xa802('0x33')]};});_0x1c0d8c[_0xa802('0x34')]=_[_0xa802('0x2f')](_0x1e4274,_0xa802('0x2d'));_0x1c0d8c[_0xa802('0x35')]=_[_0xa802('0x36')](_0x556e28[_0xa802('0x35')]);_0x1c0d8c[_0xa802('0x37')]=_['intersection'](_0x1c0d8c['model'],_0x1c0d8c['query']);_0x4dc4c6[_0xa802('0x38')]=_[_0xa802('0x39')](_0x1c0d8c[_0xa802('0x34')],qs[_0xa802('0x3a')](_0x556e28[_0xa802('0x35')][_0xa802('0x3a')]));_0x4dc4c6['attributes']=_0x4dc4c6['attributes'][_0xa802('0x3b')]?_0x4dc4c6[_0xa802('0x38')]:_0x1c0d8c['model'];if(!_0x556e28[_0xa802('0x35')][_0xa802('0x3c')](_0xa802('0x3d'))){_0x4dc4c6['limit']=qs[_0xa802('0x1f')](_0x556e28[_0xa802('0x35')][_0xa802('0x1f')]);_0x4dc4c6[_0xa802('0x1d')]=qs[_0xa802('0x1d')](_0x556e28[_0xa802('0x35')][_0xa802('0x1d')]);}_0x4dc4c6[_0xa802('0x3e')]=qs[_0xa802('0x3f')](_0x556e28[_0xa802('0x35')][_0xa802('0x3f')]);_0x4dc4c6[_0xa802('0x40')]=qs[_0xa802('0x37')](_[_0xa802('0x41')](_0x556e28['query'],_0x1c0d8c['filters']),_0x1e4274);if(_0x556e28['query']['filter']){_0x4dc4c6[_0xa802('0x40')]=_[_0xa802('0x42')](_0x4dc4c6['where'],{'$or':_[_0xa802('0x2f')](_0x1e4274,function(_0xbca4ad){if(_0xbca4ad[_0xa802('0x32')]!=='VIRTUAL'){var _0x4bd12b={};_0x4bd12b[_0xbca4ad['name']]={'$like':'%'+_0x556e28[_0xa802('0x35')]['filter']+'%'};return _0x4bd12b;}})});}_0x4dc4c6=_[_0xa802('0x42')]({},_0x4dc4c6,_0x556e28['options']);var _0x584398={'where':_0x4dc4c6[_0xa802('0x40')]};return db['Template'][_0xa802('0x20')](_0x584398)[_0xa802('0x26')](function(_0x5710fa){_0x27909d[_0xa802('0x20')]=_0x5710fa;if(_0x556e28[_0xa802('0x35')][_0xa802('0x43')]){_0x4dc4c6[_0xa802('0x44')]=[{'all':!![]}];}return db[_0xa802('0x30')][_0xa802('0x45')](_0x4dc4c6);})[_0xa802('0x26')](function(_0x541262){_0x27909d[_0xa802('0x46')]=_0x541262;return _0x27909d;})[_0xa802('0x26')](respondWithFilteredResult(_0xa6e2be,_0x4dc4c6))['catch'](handleError(_0xa6e2be,null));};exports[_0xa802('0x47')]=function(_0x231c73,_0x2b2662){var _0x2212ee={'raw':!![],'where':{'id':_0x231c73[_0xa802('0x48')]['id']}},_0x2c7681={};_0x2c7681[_0xa802('0x34')]=_['keys'](db[_0xa802('0x30')]['rawAttributes']);_0x2c7681[_0xa802('0x35')]=_[_0xa802('0x36')](_0x231c73['query']);_0x2c7681[_0xa802('0x37')]=_[_0xa802('0x39')](_0x2c7681['model'],_0x2c7681[_0xa802('0x35')]);_0x2212ee[_0xa802('0x38')]=_[_0xa802('0x39')](_0x2c7681['model'],qs[_0xa802('0x3a')](_0x231c73[_0xa802('0x35')][_0xa802('0x3a')]));_0x2212ee[_0xa802('0x38')]=_0x2212ee['attributes'][_0xa802('0x3b')]?_0x2212ee[_0xa802('0x38')]:_0x2c7681[_0xa802('0x34')];if(_0x231c73[_0xa802('0x35')][_0xa802('0x43')]){_0x2212ee[_0xa802('0x44')]=[{'all':!![]}];}_0x2212ee=_[_0xa802('0x42')]({},_0x2212ee,_0x231c73[_0xa802('0x49')]);return db[_0xa802('0x30')][_0xa802('0x4a')](_0x2212ee)[_0xa802('0x26')](handleEntityNotFound(_0x2b2662,null))[_0xa802('0x26')](respondWithResult(_0x2b2662,null))[_0xa802('0x4b')](handleError(_0x2b2662,null));};exports['create']=function(_0x1e86c3,_0x48bd3c){return db[_0xa802('0x30')]['create'](_0x1e86c3[_0xa802('0x4c')],{})[_0xa802('0x26')](function(_0x3dcf0b){var _0x29a0b5=_0x1e86c3[_0xa802('0x4d')]['get']({'plain':!![]});if(!_0x29a0b5)throw new Error(_0xa802('0x4e'));if(_0x29a0b5[_0xa802('0x4f')]===_0xa802('0x4d')){var _0x5ff55b=_0x3dcf0b[_0xa802('0x28')]({'plain':!![]});var _0x4da65e=_0xa802('0x29');return db[_0xa802('0x50')][_0xa802('0x4a')]({'where':{'name':_0x4da65e,'userProfileId':_0x29a0b5[_0xa802('0x51')]},'raw':!![]})[_0xa802('0x26')](function(_0x4a1ed6){if(_0x4a1ed6&&_0x4a1ed6[_0xa802('0x52')]===0x0){return db[_0xa802('0x2a')][_0xa802('0x53')]({'name':_0x5ff55b[_0xa802('0x2d')],'resourceId':_0x5ff55b['id'],'type':_0x4a1ed6[_0xa802('0x2d')],'sectionId':_0x4a1ed6['id']},{})['then'](function(){return _0x3dcf0b;});}else{return _0x3dcf0b;}})[_0xa802('0x4b')](function(_0x1548b1){logger[_0xa802('0x2c')](_0xa802('0x54'),_0x1548b1);throw _0x1548b1;});}return _0x3dcf0b;})[_0xa802('0x26')](respondWithResult(_0x48bd3c,0xc9))[_0xa802('0x4b')](handleError(_0x48bd3c,null));};exports[_0xa802('0x25')]=function(_0x4f5285,_0x3a8940){if(_0x4f5285[_0xa802('0x4c')]['id']){delete _0x4f5285['body']['id'];}return db['Template'][_0xa802('0x4a')]({'where':{'id':_0x4f5285[_0xa802('0x48')]['id']}})[_0xa802('0x26')](handleEntityNotFound(_0x3a8940,null))[_0xa802('0x26')](saveUpdates(_0x4f5285['body'],null))[_0xa802('0x26')](respondWithResult(_0x3a8940,null))[_0xa802('0x4b')](handleError(_0x3a8940,null));};exports[_0xa802('0x27')]=function(_0x3107a7,_0xd9255){return db['Template'][_0xa802('0x4a')]({'where':{'id':_0x3107a7[_0xa802('0x48')]['id']}})['then'](handleEntityNotFound(_0xd9255,null))[_0xa802('0x26')](removeEntity(_0xd9255,null))['catch'](handleError(_0xd9255,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 5083125..d59f08f 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 _0x3d91=['api','moment','bluebird','rimraf','../../config/environment','./template.attributes','exports','Template','tools_templates','lodash','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3d91,0x75));var _0x13d9=function(_0x891c55,_0x233fe8){_0x891c55=_0x891c55-0x0;var _0x260823=_0x3d91[_0x891c55];return _0x260823;};'use strict';var _=require(_0x13d9('0x0'));var util=require(_0x13d9('0x1'));var logger=require(_0x13d9('0x2'))(_0x13d9('0x3'));var moment=require(_0x13d9('0x4'));var BPromise=require(_0x13d9('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x13d9('0x6'));var config=require(_0x13d9('0x7'));var attributes=require(_0x13d9('0x8'));module[_0x13d9('0x9')]=function(_0x123850,_0x3720ad){return _0x123850['define'](_0x13d9('0xa'),attributes,{'tableName':_0x13d9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x63ab=['path','rimraf','../../config/environment','./template.attributes','exports','define','Template','tools_templates','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3ba6e9,_0x168fd5){var _0x134290=function(_0x31bcb7){while(--_0x31bcb7){_0x3ba6e9['push'](_0x3ba6e9['shift']());}};_0x134290(++_0x168fd5);}(_0x63ab,0x107));var _0xb63a=function(_0x4b041e,_0x3114ec){_0x4b041e=_0x4b041e-0x0;var _0x31b818=_0x63ab[_0x4b041e];return _0x31b818;};'use strict';var _=require(_0xb63a('0x0'));var util=require(_0xb63a('0x1'));var logger=require(_0xb63a('0x2'))(_0xb63a('0x3'));var moment=require(_0xb63a('0x4'));var BPromise=require(_0xb63a('0x5'));var rp=require(_0xb63a('0x6'));var fs=require('fs');var path=require(_0xb63a('0x7'));var rimraf=require(_0xb63a('0x8'));var config=require(_0xb63a('0x9'));var attributes=require(_0xb63a('0xa'));module[_0xb63a('0xb')]=function(_0x1d5d0d,_0x495e1e){return _0x1d5d0d[_0xb63a('0xc')](_0xb63a('0xd'),attributes,{'tableName':_0xb63a('0xe'),'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 5dab44f..ad49753 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 _0xf93f=['model','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','stringify','error','code','Template,\x20%s,\x20%s','message','result','catch','GetTemplate','findAll','options','where','attributes','limit','include','map'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xf93f,0x97));var _0xff93=function(_0x257406,_0x38767e){_0x257406=_0x257406-0x0;var _0xa4f033=_0xf93f[_0x257406];return _0xa4f033;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xff93('0x0'));var BPromise=require(_0xff93('0x1'));var rs=require(_0xff93('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xff93('0x3'));var logger=require(_0xff93('0x4'))(_0xff93('0x5'));var config=require(_0xff93('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xff93('0x7')][_0xff93('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x47a369,_0x208a71,_0x5ddf42){return new BPromise(function(_0x403f24,_0x330ff6){return client[_0xff93('0x9')](_0x47a369,_0x5ddf42)[_0xff93('0xa')](function(_0x1bdfdf){logger[_0xff93('0xb')]('Template,\x20%s,\x20%s',_0x208a71,_0xff93('0xc'));logger[_0xff93('0xd')]('Template,\x20%s,\x20%s,\x20%s',_0x208a71,_0xff93('0xc'),JSON[_0xff93('0xe')](_0x1bdfdf));if(_0x1bdfdf['error']){if(_0x1bdfdf[_0xff93('0xf')][_0xff93('0x10')]===0x1f4){logger['error'](_0xff93('0x11'),_0x208a71,_0x1bdfdf[_0xff93('0xf')][_0xff93('0x12')]);return _0x330ff6(_0x1bdfdf[_0xff93('0xf')]['message']);}logger[_0xff93('0xf')](_0xff93('0x11'),_0x208a71,_0x1bdfdf[_0xff93('0xf')][_0xff93('0x12')]);return _0x403f24(_0x1bdfdf['error'][_0xff93('0x12')]);}else{logger[_0xff93('0xb')](_0xff93('0x11'),_0x208a71,_0xff93('0xc'));_0x403f24(_0x1bdfdf[_0xff93('0x13')][_0xff93('0x12')]);}})[_0xff93('0x14')](function(_0x58a8c3){logger[_0xff93('0xf')](_0xff93('0x11'),_0x208a71,_0x58a8c3);_0x330ff6(_0x58a8c3);});});}exports[_0xff93('0x15')]=function(_0x1ea35b){var _0x41a631=this;return new Promise(function(_0x4d36da,_0x4294a6){return db['Template'][_0xff93('0x16')]({'raw':_0x1ea35b[_0xff93('0x17')]?_0x1ea35b['options']['raw']===undefined?!![]:![]:!![],'where':_0x1ea35b[_0xff93('0x17')]?_0x1ea35b[_0xff93('0x17')][_0xff93('0x18')]||null:null,'attributes':_0x1ea35b[_0xff93('0x17')]?_0x1ea35b[_0xff93('0x17')][_0xff93('0x19')]||null:null,'limit':_0x1ea35b[_0xff93('0x17')]?_0x1ea35b[_0xff93('0x17')][_0xff93('0x1a')]||null:null,'include':_0x1ea35b['options']?_0x1ea35b[_0xff93('0x17')][_0xff93('0x1b')]?_['map'](_0x1ea35b[_0xff93('0x17')][_0xff93('0x1b')],function(_0x4adb9b){return{'model':db[_0x4adb9b['model']],'as':_0x4adb9b['as'],'attributes':_0x4adb9b[_0xff93('0x19')],'include':_0x4adb9b[_0xff93('0x1b')]?_[_0xff93('0x1c')](_0x4adb9b[_0xff93('0x1b')],function(_0x599e44){return{'model':db[_0x599e44[_0xff93('0x1d')]],'as':_0x599e44['as'],'attributes':_0x599e44[_0xff93('0x19')],'include':_0x599e44['include']?_[_0xff93('0x1c')](_0x599e44[_0xff93('0x1b')],function(_0x1aea40){return{'model':db[_0x1aea40[_0xff93('0x1d')]],'as':_0x1aea40['as'],'attributes':_0x1aea40['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2e7c6d){logger['info'](_0xff93('0x15'),_0x1ea35b);logger[_0xff93('0xd')](_0xff93('0x15'),_0x1ea35b,JSON[_0xff93('0xe')](_0x2e7c6d));_0x4d36da(_0x2e7c6d);})[_0xff93('0x14')](function(_0x37abeb){logger[_0xff93('0xf')](_0xff93('0x15'),_0x37abeb['message'],_0x1ea35b);_0x4294a6(_0x41a631[_0xff93('0xf')](0x1f4,_0x37abeb[_0xff93('0x12')]));});});}; \ No newline at end of file +var _0x3c4b=['model','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','Template,\x20%s,\x20%s','message','info','GetTemplate','Template','options','raw','where','attributes','limit','include','map'];(function(_0x4cd25c,_0x42b4d6){var _0x387b31=function(_0x24996f){while(--_0x24996f){_0x4cd25c['push'](_0x4cd25c['shift']());}};_0x387b31(++_0x42b4d6);}(_0x3c4b,0xf1));var _0xb3c4=function(_0xbf0465,_0x278278){_0xbf0465=_0xbf0465-0x0;var _0x165995=_0x3c4b[_0xbf0465];return _0x165995;};'use strict';var _=require('lodash');var util=require(_0xb3c4('0x0'));var moment=require(_0xb3c4('0x1'));var BPromise=require(_0xb3c4('0x2'));var rs=require(_0xb3c4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb3c4('0x4'))['db'];var utils=require(_0xb3c4('0x5'));var logger=require(_0xb3c4('0x6'))(_0xb3c4('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xb3c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x227791,_0x32fdd6,_0x3f1093){return new BPromise(function(_0x1e4ca1,_0x217c40){return client[_0xb3c4('0x9')](_0x227791,_0x3f1093)[_0xb3c4('0xa')](function(_0x3cde0d){logger['info']('Template,\x20%s,\x20%s',_0x32fdd6,_0xb3c4('0xb'));logger[_0xb3c4('0xc')](_0xb3c4('0xd'),_0x32fdd6,_0xb3c4('0xb'),JSON[_0xb3c4('0xe')](_0x3cde0d));if(_0x3cde0d[_0xb3c4('0xf')]){if(_0x3cde0d[_0xb3c4('0xf')][_0xb3c4('0x10')]===0x1f4){logger[_0xb3c4('0xf')](_0xb3c4('0x11'),_0x32fdd6,_0x3cde0d[_0xb3c4('0xf')][_0xb3c4('0x12')]);return _0x217c40(_0x3cde0d[_0xb3c4('0xf')][_0xb3c4('0x12')]);}logger[_0xb3c4('0xf')](_0xb3c4('0x11'),_0x32fdd6,_0x3cde0d['error'][_0xb3c4('0x12')]);return _0x1e4ca1(_0x3cde0d['error']['message']);}else{logger[_0xb3c4('0x13')](_0xb3c4('0x11'),_0x32fdd6,_0xb3c4('0xb'));_0x1e4ca1(_0x3cde0d['result'][_0xb3c4('0x12')]);}})['catch'](function(_0x51da38){logger[_0xb3c4('0xf')](_0xb3c4('0x11'),_0x32fdd6,_0x51da38);_0x217c40(_0x51da38);});});}exports[_0xb3c4('0x14')]=function(_0x4e9453){var _0x1517d3=this;return new Promise(function(_0x5ed47c,_0x164035){return db[_0xb3c4('0x15')]['findAll']({'raw':_0x4e9453['options']?_0x4e9453[_0xb3c4('0x16')][_0xb3c4('0x17')]===undefined?!![]:![]:!![],'where':_0x4e9453[_0xb3c4('0x16')]?_0x4e9453[_0xb3c4('0x16')][_0xb3c4('0x18')]||null:null,'attributes':_0x4e9453[_0xb3c4('0x16')]?_0x4e9453[_0xb3c4('0x16')][_0xb3c4('0x19')]||null:null,'limit':_0x4e9453[_0xb3c4('0x16')]?_0x4e9453['options'][_0xb3c4('0x1a')]||null:null,'include':_0x4e9453[_0xb3c4('0x16')]?_0x4e9453[_0xb3c4('0x16')][_0xb3c4('0x1b')]?_[_0xb3c4('0x1c')](_0x4e9453['options'][_0xb3c4('0x1b')],function(_0x5c281b){return{'model':db[_0x5c281b[_0xb3c4('0x1d')]],'as':_0x5c281b['as'],'attributes':_0x5c281b[_0xb3c4('0x19')],'include':_0x5c281b[_0xb3c4('0x1b')]?_['map'](_0x5c281b['include'],function(_0x2488e1){return{'model':db[_0x2488e1[_0xb3c4('0x1d')]],'as':_0x2488e1['as'],'attributes':_0x2488e1['attributes'],'include':_0x2488e1['include']?_['map'](_0x2488e1['include'],function(_0x2a7c14){return{'model':db[_0x2a7c14[_0xb3c4('0x1d')]],'as':_0x2a7c14['as'],'attributes':_0x2a7c14[_0xb3c4('0x19')]};}):[]};}):[]};}):[]:[]})[_0xb3c4('0xa')](function(_0x1e18ef){logger['info']('GetTemplate',_0x4e9453);logger[_0xb3c4('0xc')](_0xb3c4('0x14'),_0x4e9453,JSON[_0xb3c4('0xe')](_0x1e18ef));_0x5ed47c(_0x1e18ef);})['catch'](function(_0xb2c5de){logger[_0xb3c4('0xf')](_0xb3c4('0x14'),_0xb2c5de[_0xb3c4('0x12')],_0x4e9453);_0x164035(_0x1517d3[_0xb3c4('0xf')](0x1f4,_0xb2c5de[_0xb3c4('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 0585967..f5e6a01 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 _0x7a85=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','/:id/actions','getActions','create','post','put','update','delete','exports','multer','path'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x7a85,0x16e));var _0x57a8=function(_0x5bd9e3,_0x5032c7){_0x5bd9e3=_0x5bd9e3-0x0;var _0x3ea89e=_0x7a85[_0x5bd9e3];return _0x3ea89e;};'use strict';var multer=require(_0x57a8('0x0'));var util=require('util');var path=require(_0x57a8('0x1'));var timeout=require('connect-timeout');var express=require(_0x57a8('0x2'));var router=express[_0x57a8('0x3')]();var fs_extra=require(_0x57a8('0x4'));var auth=require(_0x57a8('0x5'));var interaction=require(_0x57a8('0x6'));var config=require(_0x57a8('0x7'));var controller=require('./trigger.controller');router[_0x57a8('0x8')]('/',auth[_0x57a8('0x9')](),controller['index']);router[_0x57a8('0x8')](_0x57a8('0xa'),auth['isAuthenticated'](),controller[_0x57a8('0xb')]);router['get'](_0x57a8('0xc'),auth[_0x57a8('0x9')](),controller[_0x57a8('0xd')]);router['get'](_0x57a8('0xe'),auth[_0x57a8('0x9')](),controller['getAnyConditions']);router[_0x57a8('0x8')](_0x57a8('0xf'),auth['isAuthenticated'](),controller[_0x57a8('0x10')]);router['post']('/',auth[_0x57a8('0x9')](),controller[_0x57a8('0x11')]);router[_0x57a8('0x12')](_0x57a8('0xc'),auth[_0x57a8('0x9')](),controller['addAllCondition']);router[_0x57a8('0x12')]('/:id/any_conditions',auth[_0x57a8('0x9')](),controller['addAnyCondition']);router[_0x57a8('0x12')](_0x57a8('0xf'),auth[_0x57a8('0x9')](),controller['addAction']);router[_0x57a8('0x13')](_0x57a8('0xa'),auth[_0x57a8('0x9')](),controller[_0x57a8('0x14')]);router[_0x57a8('0x15')]('/:id',auth[_0x57a8('0x9')](),controller['destroy']);module[_0x57a8('0x16')]=router; \ No newline at end of file +var _0x6a19=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','/:id','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post','create','addAllCondition','put','update','destroy','exports','path'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6a19,0x144));var _0x96a1=function(_0x3ddb41,_0x23302f){_0x3ddb41=_0x3ddb41-0x0;var _0x2d57b5=_0x6a19[_0x3ddb41];return _0x2d57b5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x96a1('0x0'));var timeout=require(_0x96a1('0x1'));var express=require(_0x96a1('0x2'));var router=express[_0x96a1('0x3')]();var fs_extra=require(_0x96a1('0x4'));var auth=require(_0x96a1('0x5'));var interaction=require(_0x96a1('0x6'));var config=require(_0x96a1('0x7'));var controller=require(_0x96a1('0x8'));router[_0x96a1('0x9')]('/',auth[_0x96a1('0xa')](),controller['index']);router['get'](_0x96a1('0xb'),auth[_0x96a1('0xa')](),controller['show']);router[_0x96a1('0x9')](_0x96a1('0xc'),auth[_0x96a1('0xa')](),controller[_0x96a1('0xd')]);router['get'](_0x96a1('0xe'),auth['isAuthenticated'](),controller[_0x96a1('0xf')]);router['get'](_0x96a1('0x10'),auth['isAuthenticated'](),controller[_0x96a1('0x11')]);router[_0x96a1('0x12')]('/',auth['isAuthenticated'](),controller[_0x96a1('0x13')]);router[_0x96a1('0x12')](_0x96a1('0xc'),auth[_0x96a1('0xa')](),controller[_0x96a1('0x14')]);router[_0x96a1('0x12')](_0x96a1('0xe'),auth[_0x96a1('0xa')](),controller['addAnyCondition']);router[_0x96a1('0x12')](_0x96a1('0x10'),auth['isAuthenticated'](),controller['addAction']);router[_0x96a1('0x15')](_0x96a1('0xb'),auth[_0x96a1('0xa')](),controller[_0x96a1('0x16')]);router['delete'](_0x96a1('0xb'),auth[_0x96a1('0xa')](),controller[_0x96a1('0x17')]);module[_0x96a1('0x18')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 8f4b38c..f0e48a8 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 _0x0f50=['sequelize','exports','STRING','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0f50,0x74));var _0x00f5=function(_0x55938e,_0x50bcd0){_0x55938e=_0x55938e-0x0;var _0x1788a4=_0x0f50[_0x55938e];return _0x1788a4;};'use strict';var Sequelize=require(_0x00f5('0x0'));module[_0x00f5('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x00f5('0x2')]},'description':{'type':Sequelize[_0x00f5('0x2')]},'status':{'type':Sequelize[_0x00f5('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x572a=['STRING','BOOLEAN','sequelize','exports'];(function(_0x5530c5,_0x1d531c){var _0x22ca1e=function(_0x261ad4){while(--_0x261ad4){_0x5530c5['push'](_0x5530c5['shift']());}};_0x22ca1e(++_0x1d531c);}(_0x572a,0x102));var _0xa572=function(_0x3bf572,_0x415d03){_0x3bf572=_0x3bf572-0x0;var _0x3685f2=_0x572a[_0x3bf572];return _0x3685f2;};'use strict';var Sequelize=require(_0xa572('0x0'));module[_0xa572('0x1')]={'name':{'type':Sequelize[_0xa572('0x2')]},'channel':{'type':Sequelize[_0xa572('0x2')]},'description':{'type':Sequelize[_0xa572('0x2')]},'status':{'type':Sequelize[_0xa572('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 232b79a..8aef6d9 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 _0xd38e=['create','body','user','get','role','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','findOne','getAllConditions','getAnyConditions','addAction','Action','getActions','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','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','save','destroy','then','UserProfileResource','name','send','index','map','Trigger','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','includeAll','findAll','rows','catch','include','merge','find'];(function(_0x35462f,_0x2ad8aa){var _0x3775c2=function(_0xedfd3){while(--_0xedfd3){_0x35462f['push'](_0x35462f['shift']());}};_0x3775c2(++_0x2ad8aa);}(_0xd38e,0xcd));var _0xed38=function(_0x228cb8,_0x44b316){_0x228cb8=_0x228cb8-0x0;var _0x339157=_0xd38e[_0x228cb8];return _0x339157;};'use strict';var emlformat=require(_0xed38('0x0'));var rimraf=require(_0xed38('0x1'));var zipdir=require(_0xed38('0x2'));var jsonpatch=require(_0xed38('0x3'));var rp=require(_0xed38('0x4'));var moment=require(_0xed38('0x5'));var BPromise=require(_0xed38('0x6'));var Mustache=require(_0xed38('0x7'));var util=require('util');var path=require(_0xed38('0x8'));var sox=require(_0xed38('0x9'));var csv=require(_0xed38('0xa'));var ejs=require(_0xed38('0xb'));var fs=require('fs');var fs_extra=require(_0xed38('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xed38('0xd'));var jsforce=require(_0xed38('0xe'));var deskjs=require(_0xed38('0xf'));var toCsv=require(_0xed38('0xa'));var querystring=require(_0xed38('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xed38('0x11'));var qs=require(_0xed38('0x12'));var as=require(_0xed38('0x13'));var hardwareService=require(_0xed38('0x14'));var logger=require(_0xed38('0x15'))('api');var utils=require(_0xed38('0x16'));var config=require(_0xed38('0x17'));var licenseUtil=require(_0xed38('0x18'));var db=require(_0xed38('0x19'))['db'];function respondWithStatusCode(_0x1394a4,_0x4d8b20){_0x4d8b20=_0x4d8b20||0xcc;return function(_0x729417){if(_0x729417){return _0x1394a4[_0xed38('0x1a')](_0x4d8b20);}return _0x1394a4[_0xed38('0x1b')](_0x4d8b20)[_0xed38('0x1c')]();};}function respondWithResult(_0x3da285,_0x5107d0){_0x5107d0=_0x5107d0||0xc8;return function(_0x41d286){if(_0x41d286){return _0x3da285[_0xed38('0x1b')](_0x5107d0)[_0xed38('0x1d')](_0x41d286);}};}function respondWithFilteredResult(_0x4dc1db,_0x29a1e0){return function(_0x2beb60){if(_0x2beb60){var _0x56b5bb=typeof _0x29a1e0['offset']===_0xed38('0x1e')&&typeof _0x29a1e0[_0xed38('0x1f')]===_0xed38('0x1e');var _0x27868d=_0x2beb60[_0xed38('0x20')];var _0xadf4b2=_0x56b5bb?0x0:_0x29a1e0[_0xed38('0x21')];var _0x4f6416=_0x56b5bb?_0x2beb60[_0xed38('0x20')]:_0x29a1e0['offset']+_0x29a1e0[_0xed38('0x1f')];var _0x40e90d;if(_0x4f6416>=_0x27868d){_0x4f6416=_0x27868d;_0x40e90d=0xc8;}else{_0x40e90d=0xce;}_0x4dc1db[_0xed38('0x1b')](_0x40e90d);return _0x4dc1db['set'](_0xed38('0x22'),_0xadf4b2+'-'+_0x4f6416+'/'+_0x27868d)[_0xed38('0x1d')](_0x2beb60);}return null;};}function patchUpdates(_0x392ddb){return function(_0xbf53a9){try{jsonpatch[_0xed38('0x23')](_0xbf53a9,_0x392ddb,!![]);}catch(_0x687eb1){return BPromise['reject'](_0x687eb1);}return _0xbf53a9[_0xed38('0x24')]();};}function saveUpdates(_0x2e4ef8,_0x1e5a7e){return function(_0x4ac84d){if(_0x4ac84d){return _0x4ac84d['update'](_0x2e4ef8)['then'](function(_0xe097fa){return _0xe097fa;});}return null;};}function removeEntity(_0x4b1f94,_0x498d26){return function(_0x5bd5e4){if(_0x5bd5e4){return _0x5bd5e4[_0xed38('0x25')]()[_0xed38('0x26')](function(){var _0x287519=_0x5bd5e4['get']({'plain':!![]});var _0x687dfb='Triggers';return db[_0xed38('0x27')][_0xed38('0x25')]({'where':{'type':_0x687dfb,'resourceId':_0x287519['id']}})[_0xed38('0x26')](function(){return _0x5bd5e4;});})[_0xed38('0x26')](function(){_0x4b1f94[_0xed38('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e74a5,_0x45de91){return function(_0x49b8a9){if(!_0x49b8a9){_0x3e74a5['sendStatus'](0x194);}return _0x49b8a9;};}function handleError(_0x12af54,_0x3fdbbf){_0x3fdbbf=_0x3fdbbf||0x1f4;return function(_0x5c14d4){logger['error'](_0x5c14d4['stack']);if(_0x5c14d4['name']){delete _0x5c14d4[_0xed38('0x28')];}_0x12af54[_0xed38('0x1b')](_0x3fdbbf)[_0xed38('0x29')](_0x5c14d4);};}exports[_0xed38('0x2a')]=function(_0x24b52c,_0x21d9b5){var _0x48d4c5={},_0x114a35={},_0x15c944={'count':0x0,'rows':[]};var _0x304825=_[_0xed38('0x2b')](db[_0xed38('0x2c')][_0xed38('0x2d')],function(_0x59a27f){return{'name':_0x59a27f[_0xed38('0x2e')],'type':_0x59a27f[_0xed38('0x2f')]['key']};});_0x114a35[_0xed38('0x30')]=_['map'](_0x304825,_0xed38('0x28'));_0x114a35[_0xed38('0x31')]=_[_0xed38('0x32')](_0x24b52c['query']);_0x114a35[_0xed38('0x33')]=_[_0xed38('0x34')](_0x114a35['model'],_0x114a35['query']);_0x48d4c5['attributes']=_[_0xed38('0x34')](_0x114a35['model'],qs[_0xed38('0x35')](_0x24b52c['query'][_0xed38('0x35')]));_0x48d4c5[_0xed38('0x36')]=_0x48d4c5[_0xed38('0x36')][_0xed38('0x37')]?_0x48d4c5[_0xed38('0x36')]:_0x114a35[_0xed38('0x30')];if(!_0x24b52c['query'][_0xed38('0x38')](_0xed38('0x39'))){_0x48d4c5[_0xed38('0x1f')]=qs[_0xed38('0x1f')](_0x24b52c['query'][_0xed38('0x1f')]);_0x48d4c5[_0xed38('0x21')]=qs[_0xed38('0x21')](_0x24b52c[_0xed38('0x31')]['offset']);}_0x48d4c5[_0xed38('0x3a')]=qs[_0xed38('0x3b')](_0x24b52c[_0xed38('0x31')]['sort']);_0x48d4c5[_0xed38('0x3c')]=qs[_0xed38('0x33')](_[_0xed38('0x3d')](_0x24b52c[_0xed38('0x31')],_0x114a35[_0xed38('0x33')]),_0x304825);if(_0x24b52c[_0xed38('0x31')][_0xed38('0x3e')]){_0x48d4c5[_0xed38('0x3c')]=_['merge'](_0x48d4c5[_0xed38('0x3c')],{'$or':_[_0xed38('0x2b')](_0x304825,function(_0x18eb97){if(_0x18eb97[_0xed38('0x2f')]!=='VIRTUAL'){var _0x2de139={};_0x2de139[_0x18eb97[_0xed38('0x28')]]={'$like':'%'+_0x24b52c[_0xed38('0x31')]['filter']+'%'};return _0x2de139;}})});}_0x48d4c5=_['merge']({},_0x48d4c5,_0x24b52c[_0xed38('0x3f')]);var _0x56ed28={'where':_0x48d4c5['where']};return db['Trigger'][_0xed38('0x20')](_0x56ed28)[_0xed38('0x26')](function(_0x27966b){_0x15c944[_0xed38('0x20')]=_0x27966b;if(_0x24b52c[_0xed38('0x31')][_0xed38('0x40')]){_0x48d4c5['include']=[{'all':!![]}];}return db['Trigger'][_0xed38('0x41')](_0x48d4c5);})['then'](function(_0x1a4241){_0x15c944[_0xed38('0x42')]=_0x1a4241;return _0x15c944;})[_0xed38('0x26')](respondWithFilteredResult(_0x21d9b5,_0x48d4c5))[_0xed38('0x43')](handleError(_0x21d9b5,null));};exports['show']=function(_0x38dd8c,_0x6bd201){var _0xb1e630={'raw':![],'where':{'id':_0x38dd8c['params']['id']}},_0x281ab1={};_0x281ab1[_0xed38('0x30')]=_[_0xed38('0x32')](db[_0xed38('0x2c')][_0xed38('0x2d')]);_0x281ab1[_0xed38('0x31')]=_[_0xed38('0x32')](_0x38dd8c[_0xed38('0x31')]);_0x281ab1['filters']=_['intersection'](_0x281ab1[_0xed38('0x30')],_0x281ab1[_0xed38('0x31')]);_0xb1e630[_0xed38('0x36')]=_['intersection'](_0x281ab1[_0xed38('0x30')],qs[_0xed38('0x35')](_0x38dd8c[_0xed38('0x31')][_0xed38('0x35')]));_0xb1e630[_0xed38('0x36')]=_0xb1e630['attributes']['length']?_0xb1e630['attributes']:_0x281ab1[_0xed38('0x30')];if(_0x38dd8c[_0xed38('0x31')][_0xed38('0x40')]){_0xb1e630[_0xed38('0x44')]=[{'all':!![]}];}_0xb1e630=_[_0xed38('0x45')]({},_0xb1e630,_0x38dd8c['options']);return db['Trigger'][_0xed38('0x46')](_0xb1e630)[_0xed38('0x26')](handleEntityNotFound(_0x6bd201,null))[_0xed38('0x26')](respondWithResult(_0x6bd201,null))[_0xed38('0x43')](handleError(_0x6bd201,null));};exports['create']=function(_0x4e2bc5,_0x192b22){return db[_0xed38('0x2c')][_0xed38('0x47')](_0x4e2bc5[_0xed38('0x48')],{})[_0xed38('0x26')](function(_0x108cd3){var _0x230c6c=_0x4e2bc5[_0xed38('0x49')][_0xed38('0x4a')]({'plain':!![]});if(!_0x230c6c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x230c6c[_0xed38('0x4b')]==='user'){var _0x176c32=_0x108cd3[_0xed38('0x4a')]({'plain':!![]});var _0x4f5e6a='Triggers';return db['UserProfileSection']['find']({'where':{'name':_0x4f5e6a,'userProfileId':_0x230c6c[_0xed38('0x4c')]},'raw':!![]})['then'](function(_0x11475b){if(_0x11475b&&_0x11475b['autoAssociation']===0x0){return db[_0xed38('0x27')][_0xed38('0x47')]({'name':_0x176c32[_0xed38('0x28')],'resourceId':_0x176c32['id'],'type':_0x11475b[_0xed38('0x28')],'sectionId':_0x11475b['id']},{})['then'](function(){return _0x108cd3;});}else{return _0x108cd3;}})[_0xed38('0x43')](function(_0x7b4083){logger[_0xed38('0x4d')](_0xed38('0x4e'),_0x7b4083);throw _0x7b4083;});}return _0x108cd3;})['then'](respondWithResult(_0x192b22,0xc9))[_0xed38('0x43')](handleError(_0x192b22,null));};exports[_0xed38('0x4f')]=function(_0xb94131,_0xf83dff){if(_0xb94131['body']['id']){delete _0xb94131[_0xed38('0x48')]['id'];}return db[_0xed38('0x2c')][_0xed38('0x46')]({'where':{'id':_0xb94131[_0xed38('0x50')]['id']}})['then'](handleEntityNotFound(_0xf83dff,null))[_0xed38('0x26')](saveUpdates(_0xb94131['body'],null))[_0xed38('0x26')](respondWithResult(_0xf83dff,null))[_0xed38('0x43')](handleError(_0xf83dff,null));};exports[_0xed38('0x25')]=function(_0x56ecdc,_0x4475a7){return db[_0xed38('0x2c')][_0xed38('0x46')]({'where':{'id':_0x56ecdc['params']['id']}})[_0xed38('0x26')](handleEntityNotFound(_0x4475a7,null))[_0xed38('0x26')](removeEntity(_0x4475a7,null))[_0xed38('0x43')](handleError(_0x4475a7,null));};exports[_0xed38('0x51')]=function(_0x58152e,_0x3711fa,_0x174d12){if(_0x58152e[_0xed38('0x48')]['id']){delete _0x58152e[_0xed38('0x48')]['id'];}return db[_0xed38('0x2c')][_0xed38('0x46')]({'where':{'id':_0x58152e[_0xed38('0x50')]['id']}})[_0xed38('0x26')](handleEntityNotFound(_0x3711fa,null))[_0xed38('0x26')](function(_0x49c220){if(_0x49c220){_0x58152e[_0xed38('0x48')][_0xed38('0x52')]=_0x49c220['id'];return db[_0xed38('0x53')][_0xed38('0x47')](_0x58152e[_0xed38('0x48')]);}})[_0xed38('0x26')](respondWithResult(_0x3711fa,null))[_0xed38('0x43')](handleError(_0x3711fa,null));};exports[_0xed38('0x54')]=function(_0x38a6fb,_0x365862,_0x37bfd7){if(_0x38a6fb[_0xed38('0x48')]['id']){delete _0x38a6fb[_0xed38('0x48')]['id'];}return db[_0xed38('0x2c')][_0xed38('0x46')]({'where':{'id':_0x38a6fb['params']['id']}})[_0xed38('0x26')](handleEntityNotFound(_0x365862,null))[_0xed38('0x26')](function(_0x2eb406){if(_0x2eb406){_0x38a6fb[_0xed38('0x48')][_0xed38('0x55')]=_0x2eb406['id'];return db[_0xed38('0x53')][_0xed38('0x47')](_0x38a6fb[_0xed38('0x48')]);}})[_0xed38('0x26')](respondWithResult(_0x365862,null))[_0xed38('0x43')](handleError(_0x365862,null));};exports['getAllConditions']=function(_0x4b678f,_0x55494c,_0x74cf75){var _0x144679={};var _0x239877={};var _0x20e540;var _0xe2745b;return db[_0xed38('0x2c')][_0xed38('0x56')]({'where':{'id':_0x4b678f['params']['id']}})['then'](handleEntityNotFound(_0x55494c,null))[_0xed38('0x26')](function(_0x50ea4a){if(_0x50ea4a){_0x20e540=_0x50ea4a;_0x239877[_0xed38('0x30')]=_['keys'](db['Condition']['rawAttributes']);_0x239877['query']=_['keys'](_0x4b678f[_0xed38('0x31')]);_0x239877[_0xed38('0x33')]=_['intersection'](_0x239877[_0xed38('0x30')],_0x239877['query']);_0x144679['attributes']=_[_0xed38('0x34')](_0x239877[_0xed38('0x30')],qs[_0xed38('0x35')](_0x4b678f[_0xed38('0x31')][_0xed38('0x35')]));_0x144679['attributes']=_0x144679[_0xed38('0x36')]['length']?_0x144679[_0xed38('0x36')]:_0x239877[_0xed38('0x30')];_0x144679[_0xed38('0x3a')]=qs['sort'](_0x4b678f[_0xed38('0x31')][_0xed38('0x3b')]);_0x144679[_0xed38('0x3c')]=qs['filters'](_[_0xed38('0x3d')](_0x4b678f['query'],_0x239877[_0xed38('0x33')]));if(_0x4b678f[_0xed38('0x31')][_0xed38('0x3e')]){_0x144679[_0xed38('0x3c')]=_['merge'](_0x144679[_0xed38('0x3c')],{'$or':_[_0xed38('0x2b')](_0x144679['attributes'],function(_0x513753){var _0xaf50f1={};_0xaf50f1[_0x513753]={'$like':'%'+_0x4b678f[_0xed38('0x31')][_0xed38('0x3e')]+'%'};return _0xaf50f1;})});}_0x144679=_[_0xed38('0x45')]({},_0x144679,_0x4b678f[_0xed38('0x3f')]);return _0x20e540['getAllConditions'](_0x144679);}})[_0xed38('0x26')](function(_0x37e1bd){if(_0x37e1bd){_0xe2745b=_0x37e1bd[_0xed38('0x37')];if(!_0x4b678f['query'][_0xed38('0x38')]('nolimit')){_0x144679[_0xed38('0x1f')]=qs[_0xed38('0x1f')](_0x4b678f[_0xed38('0x31')][_0xed38('0x1f')]);_0x144679[_0xed38('0x21')]=qs[_0xed38('0x21')](_0x4b678f[_0xed38('0x31')][_0xed38('0x21')]);}return _0x20e540[_0xed38('0x57')](_0x144679);}})[_0xed38('0x26')](function(_0x297b69){if(_0x297b69){return _0x297b69?{'count':_0xe2745b,'rows':_0x297b69}:null;}})[_0xed38('0x26')](respondWithResult(_0x55494c,null))[_0xed38('0x43')](handleError(_0x55494c,null));};exports[_0xed38('0x58')]=function(_0x57b120,_0x223b43,_0x38f985){var _0x4a3937={};var _0x21a7d3={};var _0x239731;var _0x5b8e5c;return db[_0xed38('0x2c')]['findOne']({'where':{'id':_0x57b120[_0xed38('0x50')]['id']}})[_0xed38('0x26')](handleEntityNotFound(_0x223b43,null))[_0xed38('0x26')](function(_0x32d8f9){if(_0x32d8f9){_0x239731=_0x32d8f9;_0x21a7d3['model']=_['keys'](db[_0xed38('0x53')][_0xed38('0x2d')]);_0x21a7d3['query']=_[_0xed38('0x32')](_0x57b120[_0xed38('0x31')]);_0x21a7d3[_0xed38('0x33')]=_['intersection'](_0x21a7d3[_0xed38('0x30')],_0x21a7d3[_0xed38('0x31')]);_0x4a3937['attributes']=_['intersection'](_0x21a7d3['model'],qs[_0xed38('0x35')](_0x57b120[_0xed38('0x31')][_0xed38('0x35')]));_0x4a3937[_0xed38('0x36')]=_0x4a3937[_0xed38('0x36')]['length']?_0x4a3937[_0xed38('0x36')]:_0x21a7d3[_0xed38('0x30')];_0x4a3937[_0xed38('0x3a')]=qs[_0xed38('0x3b')](_0x57b120[_0xed38('0x31')][_0xed38('0x3b')]);_0x4a3937[_0xed38('0x3c')]=qs[_0xed38('0x33')](_['pick'](_0x57b120[_0xed38('0x31')],_0x21a7d3[_0xed38('0x33')]));if(_0x57b120[_0xed38('0x31')][_0xed38('0x3e')]){_0x4a3937[_0xed38('0x3c')]=_['merge'](_0x4a3937['where'],{'$or':_['map'](_0x4a3937['attributes'],function(_0x579cae){var _0x4d16d6={};_0x4d16d6[_0x579cae]={'$like':'%'+_0x57b120[_0xed38('0x31')]['filter']+'%'};return _0x4d16d6;})});}_0x4a3937=_[_0xed38('0x45')]({},_0x4a3937,_0x57b120[_0xed38('0x3f')]);return _0x239731[_0xed38('0x58')](_0x4a3937);}})[_0xed38('0x26')](function(_0x38b949){if(_0x38b949){_0x5b8e5c=_0x38b949[_0xed38('0x37')];if(!_0x57b120[_0xed38('0x31')][_0xed38('0x38')](_0xed38('0x39'))){_0x4a3937[_0xed38('0x1f')]=qs[_0xed38('0x1f')](_0x57b120[_0xed38('0x31')][_0xed38('0x1f')]);_0x4a3937[_0xed38('0x21')]=qs[_0xed38('0x21')](_0x57b120[_0xed38('0x31')][_0xed38('0x21')]);}return _0x239731[_0xed38('0x58')](_0x4a3937);}})[_0xed38('0x26')](function(_0xc5a696){if(_0xc5a696){return _0xc5a696?{'count':_0x5b8e5c,'rows':_0xc5a696}:null;}})['then'](respondWithResult(_0x223b43,null))[_0xed38('0x43')](handleError(_0x223b43,null));};exports[_0xed38('0x59')]=function(_0x286d9a,_0x28d7d0,_0x22c7cc){if(_0x286d9a['body']['id']){delete _0x286d9a[_0xed38('0x48')]['id'];}return db['Trigger']['find']({'where':{'id':_0x286d9a[_0xed38('0x50')]['id']}})[_0xed38('0x26')](handleEntityNotFound(_0x28d7d0,null))[_0xed38('0x26')](function(_0x609c4a){if(_0x609c4a){_0x286d9a[_0xed38('0x48')]['TriggerId']=_0x609c4a['id'];return db[_0xed38('0x5a')][_0xed38('0x47')](_0x286d9a[_0xed38('0x48')]);}})['then'](respondWithResult(_0x28d7d0,null))[_0xed38('0x43')](handleError(_0x28d7d0,null));};exports[_0xed38('0x5b')]=function(_0x39a832,_0x2201bc,_0x2fc935){var _0x4fbc39={};var _0x4dc9f0={};var _0x4f71e4;var _0x34fdda;return db[_0xed38('0x2c')][_0xed38('0x56')]({'where':{'id':_0x39a832[_0xed38('0x50')]['id']}})[_0xed38('0x26')](handleEntityNotFound(_0x2201bc,null))['then'](function(_0x4ee9fd){if(_0x4ee9fd){_0x4f71e4=_0x4ee9fd;_0x4dc9f0[_0xed38('0x30')]=_[_0xed38('0x32')](db[_0xed38('0x5a')][_0xed38('0x2d')]);_0x4dc9f0[_0xed38('0x31')]=_[_0xed38('0x32')](_0x39a832[_0xed38('0x31')]);_0x4dc9f0[_0xed38('0x33')]=_['intersection'](_0x4dc9f0[_0xed38('0x30')],_0x4dc9f0[_0xed38('0x31')]);_0x4fbc39[_0xed38('0x36')]=_['intersection'](_0x4dc9f0[_0xed38('0x30')],qs[_0xed38('0x35')](_0x39a832[_0xed38('0x31')][_0xed38('0x35')]));_0x4fbc39[_0xed38('0x36')]=_0x4fbc39[_0xed38('0x36')][_0xed38('0x37')]?_0x4fbc39['attributes']:_0x4dc9f0[_0xed38('0x30')];_0x4fbc39['order']=qs[_0xed38('0x3b')](_0x39a832[_0xed38('0x31')][_0xed38('0x3b')]);_0x4fbc39[_0xed38('0x3c')]=qs[_0xed38('0x33')](_[_0xed38('0x3d')](_0x39a832['query'],_0x4dc9f0['filters']));if(_0x39a832['query']['filter']){_0x4fbc39['where']=_[_0xed38('0x45')](_0x4fbc39[_0xed38('0x3c')],{'$or':_['map'](_0x4fbc39['attributes'],function(_0x2ae6d7){var _0x6d78da={};_0x6d78da[_0x2ae6d7]={'$like':'%'+_0x39a832[_0xed38('0x31')][_0xed38('0x3e')]+'%'};return _0x6d78da;})});}_0x4fbc39=_[_0xed38('0x45')]({},_0x4fbc39,_0x39a832['options']);return _0x4f71e4[_0xed38('0x5b')](_0x4fbc39);}})[_0xed38('0x26')](function(_0x554e12){if(_0x554e12){_0x34fdda=_0x554e12[_0xed38('0x37')];if(!_0x39a832[_0xed38('0x31')][_0xed38('0x38')]('nolimit')){_0x4fbc39[_0xed38('0x1f')]=qs[_0xed38('0x1f')](_0x39a832['query'][_0xed38('0x1f')]);_0x4fbc39['offset']=qs[_0xed38('0x21')](_0x39a832[_0xed38('0x31')][_0xed38('0x21')]);}return _0x4f71e4[_0xed38('0x5b')](_0x4fbc39);}})[_0xed38('0x26')](function(_0x3509cd){if(_0x3509cd){return _0x3509cd?{'count':_0x34fdda,'rows':_0x3509cd}:null;}})[_0xed38('0x26')](respondWithResult(_0x2201bc,null))[_0xed38('0x43')](handleError(_0x2201bc,null));}; \ No newline at end of file +var _0x4e55=['then','get','Triggers','UserProfileResource','sendStatus','stack','name','send','map','Trigger','rawAttributes','fieldName','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','pick','filter','getAllConditions','getAnyConditions','findOne','addAction','Action','getActions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy'];(function(_0xb8d455,_0x527bec){var _0x1a945e=function(_0xb1d844){while(--_0xb1d844){_0xb8d455['push'](_0xb8d455['shift']());}};_0x1a945e(++_0x527bec);}(_0x4e55,0x101));var _0x54e5=function(_0x7dc7a8,_0x56a053){_0x7dc7a8=_0x7dc7a8-0x0;var _0x37f727=_0x4e55[_0x7dc7a8];return _0x37f727;};'use strict';var emlformat=require(_0x54e5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x54e5('0x1'));var jsonpatch=require(_0x54e5('0x2'));var rp=require(_0x54e5('0x3'));var moment=require(_0x54e5('0x4'));var BPromise=require(_0x54e5('0x5'));var Mustache=require('mustache');var util=require(_0x54e5('0x6'));var path=require('path');var sox=require(_0x54e5('0x7'));var csv=require('to-csv');var ejs=require(_0x54e5('0x8'));var fs=require('fs');var fs_extra=require(_0x54e5('0x9'));var _=require(_0x54e5('0xa'));var squel=require(_0x54e5('0xb'));var crypto=require(_0x54e5('0xc'));var jsforce=require(_0x54e5('0xd'));var deskjs=require(_0x54e5('0xe'));var toCsv=require(_0x54e5('0xf'));var querystring=require(_0x54e5('0x10'));var Papa=require(_0x54e5('0x11'));var Redis=require(_0x54e5('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x54e5('0x13'));var as=require(_0x54e5('0x14'));var hardwareService=require(_0x54e5('0x15'));var logger=require(_0x54e5('0x16'))(_0x54e5('0x17'));var utils=require(_0x54e5('0x18'));var config=require(_0x54e5('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x54e5('0x1a'))['db'];function respondWithStatusCode(_0x58f249,_0x47d8d9){_0x47d8d9=_0x47d8d9||0xcc;return function(_0xb34ee){if(_0xb34ee){return _0x58f249['sendStatus'](_0x47d8d9);}return _0x58f249['status'](_0x47d8d9)[_0x54e5('0x1b')]();};}function respondWithResult(_0x8f4ee3,_0x34fb11){_0x34fb11=_0x34fb11||0xc8;return function(_0x2bc47e){if(_0x2bc47e){return _0x8f4ee3[_0x54e5('0x1c')](_0x34fb11)[_0x54e5('0x1d')](_0x2bc47e);}};}function respondWithFilteredResult(_0x3a884f,_0x20d55a){return function(_0x31a95b){if(_0x31a95b){var _0x4bdffc=typeof _0x20d55a[_0x54e5('0x1e')]===_0x54e5('0x1f')&&typeof _0x20d55a[_0x54e5('0x20')]===_0x54e5('0x1f');var _0x20c7a1=_0x31a95b['count'];var _0xa821d9=_0x4bdffc?0x0:_0x20d55a['offset'];var _0x5190e7=_0x4bdffc?_0x31a95b[_0x54e5('0x21')]:_0x20d55a['offset']+_0x20d55a[_0x54e5('0x20')];var _0x350c3b;if(_0x5190e7>=_0x20c7a1){_0x5190e7=_0x20c7a1;_0x350c3b=0xc8;}else{_0x350c3b=0xce;}_0x3a884f[_0x54e5('0x1c')](_0x350c3b);return _0x3a884f[_0x54e5('0x22')](_0x54e5('0x23'),_0xa821d9+'-'+_0x5190e7+'/'+_0x20c7a1)['json'](_0x31a95b);}return null;};}function patchUpdates(_0x12434a){return function(_0x15601e){try{jsonpatch[_0x54e5('0x24')](_0x15601e,_0x12434a,!![]);}catch(_0x4a4154){return BPromise['reject'](_0x4a4154);}return _0x15601e[_0x54e5('0x25')]();};}function saveUpdates(_0x4077ef,_0x1be995){return function(_0xcf2015){if(_0xcf2015){return _0xcf2015[_0x54e5('0x26')](_0x4077ef)['then'](function(_0x4792e5){return _0x4792e5;});}return null;};}function removeEntity(_0xa4dfac,_0x1eb5a9){return function(_0x593429){if(_0x593429){return _0x593429[_0x54e5('0x27')]()[_0x54e5('0x28')](function(){var _0x476a69=_0x593429[_0x54e5('0x29')]({'plain':!![]});var _0x2046f7=_0x54e5('0x2a');return db[_0x54e5('0x2b')]['destroy']({'where':{'type':_0x2046f7,'resourceId':_0x476a69['id']}})['then'](function(){return _0x593429;});})[_0x54e5('0x28')](function(){_0xa4dfac[_0x54e5('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x6fa755,_0x316c4d){return function(_0x550596){if(!_0x550596){_0x6fa755[_0x54e5('0x2c')](0x194);}return _0x550596;};}function handleError(_0xc48e85,_0x35c850){_0x35c850=_0x35c850||0x1f4;return function(_0x2245ca){logger['error'](_0x2245ca[_0x54e5('0x2d')]);if(_0x2245ca[_0x54e5('0x2e')]){delete _0x2245ca[_0x54e5('0x2e')];}_0xc48e85[_0x54e5('0x1c')](_0x35c850)[_0x54e5('0x2f')](_0x2245ca);};}exports['index']=function(_0x1a1d6b,_0x3c1470){var _0x8dcab={},_0xc3e518={},_0x20c71c={'count':0x0,'rows':[]};var _0x39627f=_[_0x54e5('0x30')](db[_0x54e5('0x31')][_0x54e5('0x32')],function(_0x440281){return{'name':_0x440281[_0x54e5('0x33')],'type':_0x440281['type'][_0x54e5('0x34')]};});_0xc3e518['model']=_['map'](_0x39627f,_0x54e5('0x2e'));_0xc3e518['query']=_[_0x54e5('0x35')](_0x1a1d6b[_0x54e5('0x36')]);_0xc3e518[_0x54e5('0x37')]=_[_0x54e5('0x38')](_0xc3e518[_0x54e5('0x39')],_0xc3e518[_0x54e5('0x36')]);_0x8dcab[_0x54e5('0x3a')]=_[_0x54e5('0x38')](_0xc3e518[_0x54e5('0x39')],qs[_0x54e5('0x3b')](_0x1a1d6b[_0x54e5('0x36')][_0x54e5('0x3b')]));_0x8dcab[_0x54e5('0x3a')]=_0x8dcab[_0x54e5('0x3a')][_0x54e5('0x3c')]?_0x8dcab[_0x54e5('0x3a')]:_0xc3e518['model'];if(!_0x1a1d6b[_0x54e5('0x36')][_0x54e5('0x3d')](_0x54e5('0x3e'))){_0x8dcab['limit']=qs[_0x54e5('0x20')](_0x1a1d6b['query'][_0x54e5('0x20')]);_0x8dcab[_0x54e5('0x1e')]=qs[_0x54e5('0x1e')](_0x1a1d6b[_0x54e5('0x36')][_0x54e5('0x1e')]);}_0x8dcab[_0x54e5('0x3f')]=qs[_0x54e5('0x40')](_0x1a1d6b['query'][_0x54e5('0x40')]);_0x8dcab[_0x54e5('0x41')]=qs[_0x54e5('0x37')](_['pick'](_0x1a1d6b[_0x54e5('0x36')],_0xc3e518['filters']),_0x39627f);if(_0x1a1d6b[_0x54e5('0x36')]['filter']){_0x8dcab[_0x54e5('0x41')]=_[_0x54e5('0x42')](_0x8dcab[_0x54e5('0x41')],{'$or':_['map'](_0x39627f,function(_0x4c4f78){if(_0x4c4f78[_0x54e5('0x43')]!==_0x54e5('0x44')){var _0xc913e9={};_0xc913e9[_0x4c4f78['name']]={'$like':'%'+_0x1a1d6b[_0x54e5('0x36')]['filter']+'%'};return _0xc913e9;}})});}_0x8dcab=_[_0x54e5('0x42')]({},_0x8dcab,_0x1a1d6b[_0x54e5('0x45')]);var _0x3c200a={'where':_0x8dcab[_0x54e5('0x41')]};return db['Trigger'][_0x54e5('0x21')](_0x3c200a)[_0x54e5('0x28')](function(_0x2f6857){_0x20c71c['count']=_0x2f6857;if(_0x1a1d6b['query'][_0x54e5('0x46')]){_0x8dcab[_0x54e5('0x47')]=[{'all':!![]}];}return db[_0x54e5('0x31')]['findAll'](_0x8dcab);})[_0x54e5('0x28')](function(_0x12e7df){_0x20c71c[_0x54e5('0x48')]=_0x12e7df;return _0x20c71c;})[_0x54e5('0x28')](respondWithFilteredResult(_0x3c1470,_0x8dcab))[_0x54e5('0x49')](handleError(_0x3c1470,null));};exports[_0x54e5('0x4a')]=function(_0x26fc08,_0x4521c7){var _0x3c11f8={'raw':![],'where':{'id':_0x26fc08[_0x54e5('0x4b')]['id']}},_0x546a96={};_0x546a96['model']=_[_0x54e5('0x35')](db[_0x54e5('0x31')]['rawAttributes']);_0x546a96[_0x54e5('0x36')]=_[_0x54e5('0x35')](_0x26fc08[_0x54e5('0x36')]);_0x546a96['filters']=_[_0x54e5('0x38')](_0x546a96[_0x54e5('0x39')],_0x546a96[_0x54e5('0x36')]);_0x3c11f8[_0x54e5('0x3a')]=_[_0x54e5('0x38')](_0x546a96['model'],qs[_0x54e5('0x3b')](_0x26fc08[_0x54e5('0x36')][_0x54e5('0x3b')]));_0x3c11f8[_0x54e5('0x3a')]=_0x3c11f8[_0x54e5('0x3a')][_0x54e5('0x3c')]?_0x3c11f8['attributes']:_0x546a96[_0x54e5('0x39')];if(_0x26fc08[_0x54e5('0x36')][_0x54e5('0x46')]){_0x3c11f8[_0x54e5('0x47')]=[{'all':!![]}];}_0x3c11f8=_['merge']({},_0x3c11f8,_0x26fc08[_0x54e5('0x45')]);return db[_0x54e5('0x31')][_0x54e5('0x4c')](_0x3c11f8)[_0x54e5('0x28')](handleEntityNotFound(_0x4521c7,null))[_0x54e5('0x28')](respondWithResult(_0x4521c7,null))[_0x54e5('0x49')](handleError(_0x4521c7,null));};exports[_0x54e5('0x4d')]=function(_0xc88250,_0x2b8b28){return db[_0x54e5('0x31')][_0x54e5('0x4d')](_0xc88250[_0x54e5('0x4e')],{})['then'](function(_0x55906e){var _0x4c82bb=_0xc88250[_0x54e5('0x4f')]['get']({'plain':!![]});if(!_0x4c82bb)throw new Error(_0x54e5('0x50'));if(_0x4c82bb['role']===_0x54e5('0x4f')){var _0x46d44c=_0x55906e[_0x54e5('0x29')]({'plain':!![]});var _0x28c9ee='Triggers';return db[_0x54e5('0x51')][_0x54e5('0x4c')]({'where':{'name':_0x28c9ee,'userProfileId':_0x4c82bb[_0x54e5('0x52')]},'raw':!![]})[_0x54e5('0x28')](function(_0x2d9c37){if(_0x2d9c37&&_0x2d9c37[_0x54e5('0x53')]===0x0){return db[_0x54e5('0x2b')]['create']({'name':_0x46d44c[_0x54e5('0x2e')],'resourceId':_0x46d44c['id'],'type':_0x2d9c37['name'],'sectionId':_0x2d9c37['id']},{})[_0x54e5('0x28')](function(){return _0x55906e;});}else{return _0x55906e;}})['catch'](function(_0x4ff657){logger[_0x54e5('0x54')](_0x54e5('0x55'),_0x4ff657);throw _0x4ff657;});}return _0x55906e;})[_0x54e5('0x28')](respondWithResult(_0x2b8b28,0xc9))[_0x54e5('0x49')](handleError(_0x2b8b28,null));};exports[_0x54e5('0x26')]=function(_0x139fe2,_0x18af19){if(_0x139fe2[_0x54e5('0x4e')]['id']){delete _0x139fe2[_0x54e5('0x4e')]['id'];}return db[_0x54e5('0x31')][_0x54e5('0x4c')]({'where':{'id':_0x139fe2[_0x54e5('0x4b')]['id']}})[_0x54e5('0x28')](handleEntityNotFound(_0x18af19,null))[_0x54e5('0x28')](saveUpdates(_0x139fe2[_0x54e5('0x4e')],null))[_0x54e5('0x28')](respondWithResult(_0x18af19,null))[_0x54e5('0x49')](handleError(_0x18af19,null));};exports['destroy']=function(_0x8ccfac,_0x24ff6b){return db[_0x54e5('0x31')][_0x54e5('0x4c')]({'where':{'id':_0x8ccfac[_0x54e5('0x4b')]['id']}})[_0x54e5('0x28')](handleEntityNotFound(_0x24ff6b,null))[_0x54e5('0x28')](removeEntity(_0x24ff6b,null))[_0x54e5('0x49')](handleError(_0x24ff6b,null));};exports[_0x54e5('0x56')]=function(_0x55e0a1,_0x11fab3,_0x602a63){if(_0x55e0a1['body']['id']){delete _0x55e0a1['body']['id'];}return db[_0x54e5('0x31')][_0x54e5('0x4c')]({'where':{'id':_0x55e0a1[_0x54e5('0x4b')]['id']}})['then'](handleEntityNotFound(_0x11fab3,null))[_0x54e5('0x28')](function(_0x3f63af){if(_0x3f63af){_0x55e0a1[_0x54e5('0x4e')][_0x54e5('0x57')]=_0x3f63af['id'];return db[_0x54e5('0x58')][_0x54e5('0x4d')](_0x55e0a1[_0x54e5('0x4e')]);}})['then'](respondWithResult(_0x11fab3,null))[_0x54e5('0x49')](handleError(_0x11fab3,null));};exports[_0x54e5('0x59')]=function(_0x1ea365,_0x329fba,_0x52a768){if(_0x1ea365['body']['id']){delete _0x1ea365['body']['id'];}return db[_0x54e5('0x31')][_0x54e5('0x4c')]({'where':{'id':_0x1ea365['params']['id']}})[_0x54e5('0x28')](handleEntityNotFound(_0x329fba,null))['then'](function(_0x9528bd){if(_0x9528bd){_0x1ea365[_0x54e5('0x4e')][_0x54e5('0x5a')]=_0x9528bd['id'];return db[_0x54e5('0x58')]['create'](_0x1ea365['body']);}})[_0x54e5('0x28')](respondWithResult(_0x329fba,null))[_0x54e5('0x49')](handleError(_0x329fba,null));};exports['getAllConditions']=function(_0xba4f69,_0x1bdfe3,_0x3a14c7){var _0x3f570a={};var _0x2fffc1={};var _0x693e4b;var _0x5cb723;return db[_0x54e5('0x31')]['findOne']({'where':{'id':_0xba4f69[_0x54e5('0x4b')]['id']}})[_0x54e5('0x28')](handleEntityNotFound(_0x1bdfe3,null))[_0x54e5('0x28')](function(_0x52dcb1){if(_0x52dcb1){_0x693e4b=_0x52dcb1;_0x2fffc1['model']=_[_0x54e5('0x35')](db[_0x54e5('0x58')][_0x54e5('0x32')]);_0x2fffc1[_0x54e5('0x36')]=_[_0x54e5('0x35')](_0xba4f69[_0x54e5('0x36')]);_0x2fffc1['filters']=_[_0x54e5('0x38')](_0x2fffc1[_0x54e5('0x39')],_0x2fffc1[_0x54e5('0x36')]);_0x3f570a[_0x54e5('0x3a')]=_[_0x54e5('0x38')](_0x2fffc1[_0x54e5('0x39')],qs[_0x54e5('0x3b')](_0xba4f69[_0x54e5('0x36')]['fields']));_0x3f570a[_0x54e5('0x3a')]=_0x3f570a[_0x54e5('0x3a')][_0x54e5('0x3c')]?_0x3f570a[_0x54e5('0x3a')]:_0x2fffc1[_0x54e5('0x39')];_0x3f570a[_0x54e5('0x3f')]=qs['sort'](_0xba4f69['query'][_0x54e5('0x40')]);_0x3f570a[_0x54e5('0x41')]=qs[_0x54e5('0x37')](_[_0x54e5('0x5b')](_0xba4f69['query'],_0x2fffc1['filters']));if(_0xba4f69['query'][_0x54e5('0x5c')]){_0x3f570a[_0x54e5('0x41')]=_[_0x54e5('0x42')](_0x3f570a[_0x54e5('0x41')],{'$or':_[_0x54e5('0x30')](_0x3f570a['attributes'],function(_0x39f779){var _0x2b34fb={};_0x2b34fb[_0x39f779]={'$like':'%'+_0xba4f69[_0x54e5('0x36')][_0x54e5('0x5c')]+'%'};return _0x2b34fb;})});}_0x3f570a=_[_0x54e5('0x42')]({},_0x3f570a,_0xba4f69[_0x54e5('0x45')]);return _0x693e4b[_0x54e5('0x5d')](_0x3f570a);}})[_0x54e5('0x28')](function(_0x4af05e){if(_0x4af05e){_0x5cb723=_0x4af05e[_0x54e5('0x3c')];if(!_0xba4f69['query'][_0x54e5('0x3d')]('nolimit')){_0x3f570a[_0x54e5('0x20')]=qs[_0x54e5('0x20')](_0xba4f69[_0x54e5('0x36')][_0x54e5('0x20')]);_0x3f570a['offset']=qs['offset'](_0xba4f69[_0x54e5('0x36')][_0x54e5('0x1e')]);}return _0x693e4b[_0x54e5('0x5d')](_0x3f570a);}})['then'](function(_0x1f1a22){if(_0x1f1a22){return _0x1f1a22?{'count':_0x5cb723,'rows':_0x1f1a22}:null;}})[_0x54e5('0x28')](respondWithResult(_0x1bdfe3,null))[_0x54e5('0x49')](handleError(_0x1bdfe3,null));};exports[_0x54e5('0x5e')]=function(_0x22db98,_0x4eb226,_0x5c233e){var _0x4511b2={};var _0x2aa1c9={};var _0x5000dd;var _0x4101de;return db[_0x54e5('0x31')][_0x54e5('0x5f')]({'where':{'id':_0x22db98[_0x54e5('0x4b')]['id']}})[_0x54e5('0x28')](handleEntityNotFound(_0x4eb226,null))[_0x54e5('0x28')](function(_0x21d5d2){if(_0x21d5d2){_0x5000dd=_0x21d5d2;_0x2aa1c9['model']=_[_0x54e5('0x35')](db[_0x54e5('0x58')][_0x54e5('0x32')]);_0x2aa1c9[_0x54e5('0x36')]=_['keys'](_0x22db98['query']);_0x2aa1c9['filters']=_[_0x54e5('0x38')](_0x2aa1c9[_0x54e5('0x39')],_0x2aa1c9['query']);_0x4511b2[_0x54e5('0x3a')]=_[_0x54e5('0x38')](_0x2aa1c9[_0x54e5('0x39')],qs[_0x54e5('0x3b')](_0x22db98['query']['fields']));_0x4511b2['attributes']=_0x4511b2[_0x54e5('0x3a')][_0x54e5('0x3c')]?_0x4511b2[_0x54e5('0x3a')]:_0x2aa1c9[_0x54e5('0x39')];_0x4511b2['order']=qs[_0x54e5('0x40')](_0x22db98[_0x54e5('0x36')][_0x54e5('0x40')]);_0x4511b2['where']=qs[_0x54e5('0x37')](_[_0x54e5('0x5b')](_0x22db98[_0x54e5('0x36')],_0x2aa1c9[_0x54e5('0x37')]));if(_0x22db98['query'][_0x54e5('0x5c')]){_0x4511b2[_0x54e5('0x41')]=_[_0x54e5('0x42')](_0x4511b2[_0x54e5('0x41')],{'$or':_['map'](_0x4511b2['attributes'],function(_0x15b374){var _0x134dea={};_0x134dea[_0x15b374]={'$like':'%'+_0x22db98['query'][_0x54e5('0x5c')]+'%'};return _0x134dea;})});}_0x4511b2=_[_0x54e5('0x42')]({},_0x4511b2,_0x22db98[_0x54e5('0x45')]);return _0x5000dd[_0x54e5('0x5e')](_0x4511b2);}})[_0x54e5('0x28')](function(_0x59c9b3){if(_0x59c9b3){_0x4101de=_0x59c9b3[_0x54e5('0x3c')];if(!_0x22db98[_0x54e5('0x36')][_0x54e5('0x3d')](_0x54e5('0x3e'))){_0x4511b2['limit']=qs[_0x54e5('0x20')](_0x22db98[_0x54e5('0x36')][_0x54e5('0x20')]);_0x4511b2[_0x54e5('0x1e')]=qs[_0x54e5('0x1e')](_0x22db98[_0x54e5('0x36')][_0x54e5('0x1e')]);}return _0x5000dd[_0x54e5('0x5e')](_0x4511b2);}})[_0x54e5('0x28')](function(_0x5395e6){if(_0x5395e6){return _0x5395e6?{'count':_0x4101de,'rows':_0x5395e6}:null;}})['then'](respondWithResult(_0x4eb226,null))['catch'](handleError(_0x4eb226,null));};exports[_0x54e5('0x60')]=function(_0x4281c5,_0x5d8647,_0x452448){if(_0x4281c5[_0x54e5('0x4e')]['id']){delete _0x4281c5['body']['id'];}return db[_0x54e5('0x31')]['find']({'where':{'id':_0x4281c5[_0x54e5('0x4b')]['id']}})[_0x54e5('0x28')](handleEntityNotFound(_0x5d8647,null))['then'](function(_0x4613fe){if(_0x4613fe){_0x4281c5[_0x54e5('0x4e')]['TriggerId']=_0x4613fe['id'];return db[_0x54e5('0x61')][_0x54e5('0x4d')](_0x4281c5[_0x54e5('0x4e')]);}})[_0x54e5('0x28')](respondWithResult(_0x5d8647,null))['catch'](handleError(_0x5d8647,null));};exports[_0x54e5('0x62')]=function(_0x17c400,_0x1a0af8,_0x2d7cd1){var _0x46255f={};var _0x1c9700={};var _0x23b2b7;var _0x5c9252;return db['Trigger'][_0x54e5('0x5f')]({'where':{'id':_0x17c400[_0x54e5('0x4b')]['id']}})[_0x54e5('0x28')](handleEntityNotFound(_0x1a0af8,null))[_0x54e5('0x28')](function(_0x37c3ad){if(_0x37c3ad){_0x23b2b7=_0x37c3ad;_0x1c9700[_0x54e5('0x39')]=_[_0x54e5('0x35')](db[_0x54e5('0x61')]['rawAttributes']);_0x1c9700[_0x54e5('0x36')]=_['keys'](_0x17c400['query']);_0x1c9700[_0x54e5('0x37')]=_[_0x54e5('0x38')](_0x1c9700[_0x54e5('0x39')],_0x1c9700[_0x54e5('0x36')]);_0x46255f['attributes']=_[_0x54e5('0x38')](_0x1c9700[_0x54e5('0x39')],qs[_0x54e5('0x3b')](_0x17c400[_0x54e5('0x36')][_0x54e5('0x3b')]));_0x46255f[_0x54e5('0x3a')]=_0x46255f[_0x54e5('0x3a')][_0x54e5('0x3c')]?_0x46255f[_0x54e5('0x3a')]:_0x1c9700[_0x54e5('0x39')];_0x46255f['order']=qs[_0x54e5('0x40')](_0x17c400[_0x54e5('0x36')][_0x54e5('0x40')]);_0x46255f['where']=qs['filters'](_[_0x54e5('0x5b')](_0x17c400[_0x54e5('0x36')],_0x1c9700[_0x54e5('0x37')]));if(_0x17c400[_0x54e5('0x36')][_0x54e5('0x5c')]){_0x46255f[_0x54e5('0x41')]=_[_0x54e5('0x42')](_0x46255f[_0x54e5('0x41')],{'$or':_['map'](_0x46255f['attributes'],function(_0x2e4cc9){var _0x45c813={};_0x45c813[_0x2e4cc9]={'$like':'%'+_0x17c400[_0x54e5('0x36')]['filter']+'%'};return _0x45c813;})});}_0x46255f=_[_0x54e5('0x42')]({},_0x46255f,_0x17c400['options']);return _0x23b2b7[_0x54e5('0x62')](_0x46255f);}})[_0x54e5('0x28')](function(_0x416483){if(_0x416483){_0x5c9252=_0x416483[_0x54e5('0x3c')];if(!_0x17c400[_0x54e5('0x36')][_0x54e5('0x3d')](_0x54e5('0x3e'))){_0x46255f['limit']=qs['limit'](_0x17c400['query'][_0x54e5('0x20')]);_0x46255f['offset']=qs[_0x54e5('0x1e')](_0x17c400[_0x54e5('0x36')][_0x54e5('0x1e')]);}return _0x23b2b7[_0x54e5('0x62')](_0x46255f);}})['then'](function(_0xa2e3bc){if(_0xa2e3bc){return _0xa2e3bc?{'count':_0x5c9252,'rows':_0xa2e3bc}:null;}})[_0x54e5('0x28')](respondWithResult(_0x1a0af8,null))['catch'](handleError(_0x1a0af8,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index f485cc7..9b41521 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 _0xc7e9=['lodash','util','api','moment','bluebird','path','rimraf','exports','define','Trigger','tools_triggers'];(function(_0x5e6f73,_0x3f27d8){var _0x432614=function(_0x56e42d){while(--_0x56e42d){_0x5e6f73['push'](_0x5e6f73['shift']());}};_0x432614(++_0x3f27d8);}(_0xc7e9,0x1ef));var _0x9c7e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc7e9[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x9c7e('0x0'));var util=require(_0x9c7e('0x1'));var logger=require('../../config/logger')(_0x9c7e('0x2'));var moment=require(_0x9c7e('0x3'));var BPromise=require(_0x9c7e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9c7e('0x5'));var rimraf=require(_0x9c7e('0x6'));var config=require('../../config/environment');var attributes=require('./trigger.attributes');module[_0x9c7e('0x7')]=function(_0x4e4ccc,_0x1e5135){return _0x4e4ccc[_0x9c7e('0x8')](_0x9c7e('0x9'),attributes,{'tableName':_0x9c7e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfafd=['bluebird','request-promise','path','rimraf','../../config/environment','./trigger.attributes','exports','define','Trigger','util','../../config/logger','api','moment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xfafd,0xcc));var _0xdfaf=function(_0x2d8ece,_0x5eea23){_0x2d8ece=_0x2d8ece-0x0;var _0x59f90a=_0xfafd[_0x2d8ece];return _0x59f90a;};'use strict';var _=require('lodash');var util=require(_0xdfaf('0x0'));var logger=require(_0xdfaf('0x1'))(_0xdfaf('0x2'));var moment=require(_0xdfaf('0x3'));var BPromise=require(_0xdfaf('0x4'));var rp=require(_0xdfaf('0x5'));var fs=require('fs');var path=require(_0xdfaf('0x6'));var rimraf=require(_0xdfaf('0x7'));var config=require(_0xdfaf('0x8'));var attributes=require(_0xdfaf('0x9'));module[_0xdfaf('0xa')]=function(_0x2ac56f,_0x3b455a){return _0x2ac56f[_0xdfaf('0xb')](_0xdfaf('0xc'),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 1b6a9f3..9d65724 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 _0xef0f=['raw','lodash','util','moment','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Trigger,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','Trigger','findAll','options','where','attributes','limit','include','map','model','GetTrigger','debug','ShowTrigger','find'];(function(_0x56844b,_0x4f0a52){var _0x567d29=function(_0x486d7d){while(--_0x486d7d){_0x56844b['push'](_0x56844b['shift']());}};_0x567d29(++_0x4f0a52);}(_0xef0f,0x85));var _0xfef0=function(_0x1743d0,_0xae0649){_0x1743d0=_0x1743d0-0x0;var _0x58da54=_0xef0f[_0x1743d0];return _0x58da54;};'use strict';var _=require(_0xfef0('0x0'));var util=require(_0xfef0('0x1'));var moment=require(_0xfef0('0x2'));var BPromise=require('bluebird');var rs=require(_0xfef0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xfef0('0x4'))(_0xfef0('0x5'));var config=require(_0xfef0('0x6'));var jayson=require(_0xfef0('0x7'));var client=jayson[_0xfef0('0x8')][_0xfef0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x15fd57,_0x3b965b,_0x308921){return new BPromise(function(_0x12a942,_0x3f3ace){return client['request'](_0x15fd57,_0x308921)[_0xfef0('0xa')](function(_0x2de19c){logger[_0xfef0('0xb')](_0xfef0('0xc'),_0x3b965b,_0xfef0('0xd'));logger['debug']('Trigger,\x20%s,\x20%s,\x20%s',_0x3b965b,_0xfef0('0xd'),JSON[_0xfef0('0xe')](_0x2de19c));if(_0x2de19c[_0xfef0('0xf')]){if(_0x2de19c[_0xfef0('0xf')]['code']===0x1f4){logger['error']('Trigger,\x20%s,\x20%s',_0x3b965b,_0x2de19c[_0xfef0('0xf')][_0xfef0('0x10')]);return _0x3f3ace(_0x2de19c[_0xfef0('0xf')][_0xfef0('0x10')]);}logger[_0xfef0('0xf')]('Trigger,\x20%s,\x20%s',_0x3b965b,_0x2de19c[_0xfef0('0xf')][_0xfef0('0x10')]);return _0x12a942(_0x2de19c['error'][_0xfef0('0x10')]);}else{logger['info'](_0xfef0('0xc'),_0x3b965b,_0xfef0('0xd'));_0x12a942(_0x2de19c[_0xfef0('0x11')][_0xfef0('0x10')]);}})[_0xfef0('0x12')](function(_0x2a9521){logger[_0xfef0('0xf')](_0xfef0('0xc'),_0x3b965b,_0x2a9521);_0x3f3ace(_0x2a9521);});});}exports['GetTrigger']=function(_0x3ebed2){var _0x564a64=this;return new Promise(function(_0x35e21d,_0x586774){return db[_0xfef0('0x13')][_0xfef0('0x14')]({'raw':_0x3ebed2[_0xfef0('0x15')]?_0x3ebed2[_0xfef0('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x3ebed2['options']?_0x3ebed2[_0xfef0('0x15')][_0xfef0('0x16')]||null:null,'attributes':_0x3ebed2[_0xfef0('0x15')]?_0x3ebed2[_0xfef0('0x15')][_0xfef0('0x17')]||null:null,'limit':_0x3ebed2['options']?_0x3ebed2['options'][_0xfef0('0x18')]||null:null,'include':_0x3ebed2[_0xfef0('0x15')]?_0x3ebed2[_0xfef0('0x15')][_0xfef0('0x19')]?_[_0xfef0('0x1a')](_0x3ebed2[_0xfef0('0x15')][_0xfef0('0x19')],function(_0x508f79){return{'model':db[_0x508f79['model']],'as':_0x508f79['as'],'attributes':_0x508f79[_0xfef0('0x17')],'include':_0x508f79[_0xfef0('0x19')]?_[_0xfef0('0x1a')](_0x508f79[_0xfef0('0x19')],function(_0x41e0a9){return{'model':db[_0x41e0a9[_0xfef0('0x1b')]],'as':_0x41e0a9['as'],'attributes':_0x41e0a9[_0xfef0('0x17')],'include':_0x41e0a9[_0xfef0('0x19')]?_[_0xfef0('0x1a')](_0x41e0a9[_0xfef0('0x19')],function(_0x1d73d3){return{'model':db[_0x1d73d3['model']],'as':_0x1d73d3['as'],'attributes':_0x1d73d3['attributes']};}):[]};}):[]};}):[]:[]})[_0xfef0('0xa')](function(_0x822556){logger[_0xfef0('0xb')](_0xfef0('0x1c'),_0x3ebed2);logger[_0xfef0('0x1d')](_0xfef0('0x1c'),_0x3ebed2,JSON['stringify'](_0x822556));_0x35e21d(_0x822556);})[_0xfef0('0x12')](function(_0x549c21){logger[_0xfef0('0xf')]('GetTrigger',_0x549c21[_0xfef0('0x10')],_0x3ebed2);_0x586774(_0x564a64[_0xfef0('0xf')](0x1f4,_0x549c21[_0xfef0('0x10')]));});});};exports[_0xfef0('0x1e')]=function(_0x418371){var _0x29ed74=this;return new Promise(function(_0x3117a4,_0x34e5fb){return db['Trigger'][_0xfef0('0x1f')]({'raw':_0x418371['options']?_0x418371[_0xfef0('0x15')][_0xfef0('0x20')]===undefined?!![]:![]:!![],'where':_0x418371[_0xfef0('0x15')]?_0x418371[_0xfef0('0x15')][_0xfef0('0x16')]||null:null,'attributes':_0x418371[_0xfef0('0x15')]?_0x418371[_0xfef0('0x15')][_0xfef0('0x17')]||null:null,'include':_0x418371[_0xfef0('0x15')]?_0x418371[_0xfef0('0x15')][_0xfef0('0x19')]?_[_0xfef0('0x1a')](_0x418371[_0xfef0('0x15')][_0xfef0('0x19')],function(_0x677697){return{'model':db[_0x677697[_0xfef0('0x1b')]],'as':_0x677697['as'],'attributes':_0x677697[_0xfef0('0x17')],'include':_0x677697['include']?_[_0xfef0('0x1a')](_0x677697[_0xfef0('0x19')],function(_0x36c580){return{'model':db[_0x36c580['model']],'as':_0x36c580['as'],'attributes':_0x36c580[_0xfef0('0x17')],'include':_0x36c580[_0xfef0('0x19')]?_[_0xfef0('0x1a')](_0x36c580['include'],function(_0x35547f){return{'model':db[_0x35547f[_0xfef0('0x1b')]],'as':_0x35547f['as'],'attributes':_0x35547f[_0xfef0('0x17')]};}):[]};}):[]};}):[]:[]})[_0xfef0('0xa')](function(_0x2a630d){logger['info'](_0xfef0('0x1e'),_0x418371);logger[_0xfef0('0x1d')](_0xfef0('0x1e'),_0x418371,JSON[_0xfef0('0xe')](_0x2a630d));_0x3117a4(_0x2a630d);})['catch'](function(_0x3cc9c5){logger[_0xfef0('0xf')](_0xfef0('0x1e'),_0x3cc9c5[_0xfef0('0x10')],_0x418371);_0x34e5fb(_0x29ed74[_0xfef0('0xf')](0x1f4,_0x3cc9c5[_0xfef0('0x10')]));});});}; \ No newline at end of file +var _0xd421=['options','where','limit','include','model','attributes','map','Trigger','raw','then','ShowTrigger','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetTrigger','findAll'];(function(_0xa3ae20,_0x219635){var _0x5bf46b=function(_0x2edf00){while(--_0x2edf00){_0xa3ae20['push'](_0xa3ae20['shift']());}};_0x5bf46b(++_0x219635);}(_0xd421,0x1e0));var _0x1d42=function(_0x43e81d,_0x5181f6){_0x43e81d=_0x43e81d-0x0;var _0x2e3e92=_0xd421[_0x43e81d];return _0x2e3e92;};'use strict';var _=require(_0x1d42('0x0'));var util=require(_0x1d42('0x1'));var moment=require('moment');var BPromise=require(_0x1d42('0x2'));var rs=require(_0x1d42('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1d42('0x4'))['db'];var utils=require(_0x1d42('0x5'));var logger=require(_0x1d42('0x6'))(_0x1d42('0x7'));var config=require(_0x1d42('0x8'));var jayson=require(_0x1d42('0x9'));var client=jayson[_0x1d42('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x86f384,_0x380c93,_0x44ea03){return new BPromise(function(_0x37b422,_0x48520b){return client[_0x1d42('0xb')](_0x86f384,_0x44ea03)['then'](function(_0x456806){logger[_0x1d42('0xc')](_0x1d42('0xd'),_0x380c93,_0x1d42('0xe'));logger[_0x1d42('0xf')](_0x1d42('0x10'),_0x380c93,_0x1d42('0xe'),JSON[_0x1d42('0x11')](_0x456806));if(_0x456806[_0x1d42('0x12')]){if(_0x456806['error'][_0x1d42('0x13')]===0x1f4){logger[_0x1d42('0x12')](_0x1d42('0xd'),_0x380c93,_0x456806['error'][_0x1d42('0x14')]);return _0x48520b(_0x456806[_0x1d42('0x12')][_0x1d42('0x14')]);}logger[_0x1d42('0x12')](_0x1d42('0xd'),_0x380c93,_0x456806[_0x1d42('0x12')][_0x1d42('0x14')]);return _0x37b422(_0x456806[_0x1d42('0x12')]['message']);}else{logger[_0x1d42('0xc')](_0x1d42('0xd'),_0x380c93,'request\x20sent');_0x37b422(_0x456806[_0x1d42('0x15')][_0x1d42('0x14')]);}})['catch'](function(_0x2ac325){logger[_0x1d42('0x12')](_0x1d42('0xd'),_0x380c93,_0x2ac325);_0x48520b(_0x2ac325);});});}exports[_0x1d42('0x16')]=function(_0x52e42f){var _0x327f71=this;return new Promise(function(_0x2b4a26,_0x3536a){return db['Trigger'][_0x1d42('0x17')]({'raw':_0x52e42f[_0x1d42('0x18')]?_0x52e42f[_0x1d42('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x52e42f[_0x1d42('0x18')]?_0x52e42f['options'][_0x1d42('0x19')]||null:null,'attributes':_0x52e42f['options']?_0x52e42f[_0x1d42('0x18')]['attributes']||null:null,'limit':_0x52e42f[_0x1d42('0x18')]?_0x52e42f['options'][_0x1d42('0x1a')]||null:null,'include':_0x52e42f[_0x1d42('0x18')]?_0x52e42f[_0x1d42('0x18')][_0x1d42('0x1b')]?_['map'](_0x52e42f['options'][_0x1d42('0x1b')],function(_0x4cb7e4){return{'model':db[_0x4cb7e4[_0x1d42('0x1c')]],'as':_0x4cb7e4['as'],'attributes':_0x4cb7e4[_0x1d42('0x1d')],'include':_0x4cb7e4[_0x1d42('0x1b')]?_[_0x1d42('0x1e')](_0x4cb7e4[_0x1d42('0x1b')],function(_0x97db2b){return{'model':db[_0x97db2b[_0x1d42('0x1c')]],'as':_0x97db2b['as'],'attributes':_0x97db2b[_0x1d42('0x1d')],'include':_0x97db2b[_0x1d42('0x1b')]?_[_0x1d42('0x1e')](_0x97db2b[_0x1d42('0x1b')],function(_0x403b82){return{'model':db[_0x403b82[_0x1d42('0x1c')]],'as':_0x403b82['as'],'attributes':_0x403b82['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x27e49f){logger[_0x1d42('0xc')](_0x1d42('0x16'),_0x52e42f);logger[_0x1d42('0xf')]('GetTrigger',_0x52e42f,JSON[_0x1d42('0x11')](_0x27e49f));_0x2b4a26(_0x27e49f);})['catch'](function(_0x266917){logger[_0x1d42('0x12')]('GetTrigger',_0x266917['message'],_0x52e42f);_0x3536a(_0x327f71[_0x1d42('0x12')](0x1f4,_0x266917[_0x1d42('0x14')]));});});};exports['ShowTrigger']=function(_0x56445f){var _0x20dc28=this;return new Promise(function(_0x2f0605,_0x20cbaf){return db[_0x1d42('0x1f')]['find']({'raw':_0x56445f[_0x1d42('0x18')]?_0x56445f[_0x1d42('0x18')][_0x1d42('0x20')]===undefined?!![]:![]:!![],'where':_0x56445f['options']?_0x56445f['options'][_0x1d42('0x19')]||null:null,'attributes':_0x56445f[_0x1d42('0x18')]?_0x56445f[_0x1d42('0x18')]['attributes']||null:null,'include':_0x56445f[_0x1d42('0x18')]?_0x56445f['options'][_0x1d42('0x1b')]?_[_0x1d42('0x1e')](_0x56445f['options'][_0x1d42('0x1b')],function(_0x4b9dbd){return{'model':db[_0x4b9dbd[_0x1d42('0x1c')]],'as':_0x4b9dbd['as'],'attributes':_0x4b9dbd['attributes'],'include':_0x4b9dbd['include']?_[_0x1d42('0x1e')](_0x4b9dbd[_0x1d42('0x1b')],function(_0x2bcc81){return{'model':db[_0x2bcc81[_0x1d42('0x1c')]],'as':_0x2bcc81['as'],'attributes':_0x2bcc81[_0x1d42('0x1d')],'include':_0x2bcc81['include']?_[_0x1d42('0x1e')](_0x2bcc81[_0x1d42('0x1b')],function(_0x1db921){return{'model':db[_0x1db921[_0x1d42('0x1c')]],'as':_0x1db921['as'],'attributes':_0x1db921['attributes']};}):[]};}):[]};}):[]:[]})[_0x1d42('0x21')](function(_0x28af6d){logger[_0x1d42('0xc')](_0x1d42('0x22'),_0x56445f);logger[_0x1d42('0xf')]('ShowTrigger',_0x56445f,JSON['stringify'](_0x28af6d));_0x2f0605(_0x28af6d);})[_0x1d42('0x23')](function(_0x5018be){logger['error'](_0x1d42('0x22'),_0x5018be['message'],_0x56445f);_0x20cbaf(_0x20dc28['error'](0x1f4,_0x5018be[_0x1d42('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 3cd08c0..de4c89e 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 _0x0dcf=['/:id/clone','clone','create','/:id','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','post'];(function(_0x360d9a,_0x3dccad){var _0x2d2e68=function(_0x3cbfc1){while(--_0x3cbfc1){_0x360d9a['push'](_0x360d9a['shift']());}};_0x2d2e68(++_0x3dccad);}(_0x0dcf,0xc6));var _0xf0dc=function(_0x2f38de,_0x18671a){_0x2f38de=_0x2f38de-0x0;var _0x32b341=_0x0dcf[_0x2f38de];return _0x32b341;};'use strict';var multer=require(_0xf0dc('0x0'));var util=require(_0xf0dc('0x1'));var path=require(_0xf0dc('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf0dc('0x3')]();var fs_extra=require(_0xf0dc('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf0dc('0x5'));var config=require(_0xf0dc('0x6'));var controller=require('./trunk.controller');router[_0xf0dc('0x7')]('/',auth[_0xf0dc('0x8')](),controller['index']);router[_0xf0dc('0x7')]('/:id',auth[_0xf0dc('0x8')](),controller[_0xf0dc('0x9')]);router[_0xf0dc('0xa')](_0xf0dc('0xb'),auth[_0xf0dc('0x8')](),controller[_0xf0dc('0xc')]);router[_0xf0dc('0xa')]('/',auth['isAuthenticated'](),controller[_0xf0dc('0xd')]);router['put'](_0xf0dc('0xe'),auth['isAuthenticated'](),controller[_0xf0dc('0xf')]);router[_0xf0dc('0x10')](_0xf0dc('0xe'),auth['isAuthenticated'](),controller[_0xf0dc('0x11')]);module[_0xf0dc('0x12')]=router; \ No newline at end of file +var _0x5966=['index','/:id','show','/:id/clone','clone','create','put','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated'];(function(_0x3521e2,_0x5db32c){var _0x222685=function(_0x412e70){while(--_0x412e70){_0x3521e2['push'](_0x3521e2['shift']());}};_0x222685(++_0x5db32c);}(_0x5966,0xfd));var _0x6596=function(_0x2a5b3b,_0x4ebe31){_0x2a5b3b=_0x2a5b3b-0x0;var _0xae665a=_0x5966[_0x2a5b3b];return _0xae665a;};'use strict';var multer=require('multer');var util=require(_0x6596('0x0'));var path=require(_0x6596('0x1'));var timeout=require('connect-timeout');var express=require(_0x6596('0x2'));var router=express[_0x6596('0x3')]();var fs_extra=require(_0x6596('0x4'));var auth=require(_0x6596('0x5'));var interaction=require(_0x6596('0x6'));var config=require(_0x6596('0x7'));var controller=require(_0x6596('0x8'));router[_0x6596('0x9')]('/',auth[_0x6596('0xa')](),controller[_0x6596('0xb')]);router[_0x6596('0x9')](_0x6596('0xc'),auth[_0x6596('0xa')](),controller[_0x6596('0xd')]);router['post'](_0x6596('0xe'),auth[_0x6596('0xa')](),controller[_0x6596('0xf')]);router['post']('/',auth[_0x6596('0xa')](),controller[_0x6596('0x10')]);router[_0x6596('0x11')]('/:id',auth[_0x6596('0xa')](),controller[_0x6596('0x12')]);router[_0x6596('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x6596('0x14')]);module[_0x6596('0x15')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index a0f97d9..ad4ce48 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 _0x4467=['nat','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','INTEGER','refuse','originate','uac','uas','fingerprint','certificate','active','actpass','dynamic','BOOLEAN','sequelize','STRING','name','ENUM','friend','user','peer','from-voip-provider','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport','getDataValue','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','auto','nonat','update','outgoing','yes','force_rport,comedia'];(function(_0x4ee386,_0x1a9032){var _0x42450c=function(_0x51d08c){while(--_0x51d08c){_0x4ee386['push'](_0x4ee386['shift']());}};_0x42450c(++_0x1a9032);}(_0x4467,0x117));var _0x7446=function(_0x5f4efc,_0x517f9e){_0x5f4efc=_0x5f4efc-0x0;var _0x9e8d63=_0x4467[_0x5f4efc];return _0x9e8d63;};'use strict';var Sequelize=require(_0x7446('0x0'));module['exports']={'name':{'type':Sequelize[_0x7446('0x1')],'allowNull':![],'unique':_0x7446('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x7446('0x3')](_0x7446('0x4'),_0x7446('0x5'),_0x7446('0x6')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x7446('0x1')],'allowNull':![],'defaultValue':_0x7446('0x7')},'callingpres':{'type':Sequelize[_0x7446('0x3')]('ALLOWED_NOT_SCREENED',_0x7446('0x8'),_0x7446('0x9'),_0x7446('0xa'),_0x7446('0xb'),_0x7446('0xc'),_0x7446('0xd'),_0x7446('0xe'))},'deny':{'type':Sequelize[_0x7446('0x1')]},'permit':{'type':Sequelize[_0x7446('0x1')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0x7446('0x1')]},'remotesecret':{'type':Sequelize[_0x7446('0x1')]},'transport':{'type':Sequelize[_0x7446('0x1')],'defaultValue':_0x7446('0xf'),'set':function(_0x228d1e){this[_0x7446('0x10')](_0x7446('0x11'),_0x228d1e?_0x228d1e['join'](','):null);},'get':function(){return this[_0x7446('0x12')](_0x7446('0x11'))?this['getDataValue']('transport')['split'](','):null;},'comment':_0x7446('0x13')},'dtmfmode':{'type':Sequelize[_0x7446('0x3')](_0x7446('0x14'),'info','shortinfo','inband',_0x7446('0x15')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x7446('0x3')]('yes','no',_0x7446('0x16'),_0x7446('0x17'),_0x7446('0x18')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x7446('0x19'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x7446('0x1')]},'directmediadeny':{'type':Sequelize[_0x7446('0x1')]},'nat':{'type':Sequelize[_0x7446('0x1')],'defaultValue':_0x7446('0x1a'),'set':function(_0x33202f){this['setDataValue'](_0x7446('0x1b'),_0x33202f?_0x33202f['join'](','):null);},'get':function(){return this[_0x7446('0x12')]('nat')?this[_0x7446('0x12')](_0x7446('0x1b'))[_0x7446('0x1c')](','):null;},'comment':_0x7446('0x1d')},'callgroup':{'type':Sequelize[_0x7446('0x1')]},'namedcallgroup':{'type':Sequelize[_0x7446('0x1')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x7446('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x7446('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x7446('0x1')],'defaultValue':_0x7446('0x1e')},'allow':{'type':Sequelize[_0x7446('0x1')],'allowNull':![],'defaultValue':_0x7446('0x1f'),'set':function(_0x3944c5){this[_0x7446('0x10')](_0x7446('0x20'),_0x3944c5?_0x3944c5[_0x7446('0x21')](';'):_0x7446('0x1f'));},'get':function(){return this['getDataValue']('allow')?this[_0x7446('0x12')](_0x7446('0x20'))[_0x7446('0x1c')](';'):null;},'comment':_0x7446('0x22')},'autoframing':{'type':Sequelize[_0x7446('0x3')](_0x7446('0x19'),'no')},'insecure':{'type':Sequelize[_0x7446('0x1')],'defaultValue':_0x7446('0x23'),'set':function(_0x8c053b){this[_0x7446('0x10')](_0x7446('0x24'),_0x8c053b?_0x8c053b[_0x7446('0x21')](','):null);},'get':function(){return this[_0x7446('0x12')](_0x7446('0x24'))?this['getDataValue'](_0x7446('0x24'))[_0x7446('0x1c')](','):null;},'comment':_0x7446('0x25')},'trustrpid':{'type':Sequelize[_0x7446('0x3')](_0x7446('0x19'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x7446('0x3')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM']('yes','no',_0x7446('0x26'))},'promiscredir':{'type':Sequelize[_0x7446('0x3')]('yes','no')},'useclientcode':{'type':Sequelize['ENUM'](_0x7446('0x19'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0x7446('0x1')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0x7446('0x27')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0x7446('0x3')]('yes','no'),'defaultValue':_0x7446('0x19')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0x7446('0x3')](_0x7446('0x19'),'no')},'allowsubscribe':{'type':Sequelize[_0x7446('0x3')]('yes','no')},'allowtransfer':{'type':Sequelize[_0x7446('0x3')](_0x7446('0x19'),'no')},'ignoresdpversion':{'type':Sequelize[_0x7446('0x3')](_0x7446('0x19'),'no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0x7446('0x1')]},'videosupport':{'type':Sequelize[_0x7446('0x3')]('yes','no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x7446('0x28')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x7446('0x19'),'no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize[_0x7446('0x3')]('accept',_0x7446('0x29'),_0x7446('0x2a'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0x7446('0x28')](0xb)},'session_refresher':{'type':Sequelize[_0x7446('0x3')](_0x7446('0x2b'),_0x7446('0x2c')),'defaultValue':_0x7446('0x2c')},'t38pt_usertpsource':{'type':Sequelize[_0x7446('0x1')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x7446('0x1')]},'fromuser':{'type':Sequelize[_0x7446('0x1')]},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize[_0x7446('0x3')](_0x7446('0x19'),'no'),'defaultValue':_0x7446('0x19')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0x7446('0x1')]},'defaultuser':{'type':Sequelize[_0x7446('0x1')]},'rtptimeout':{'type':Sequelize[_0x7446('0x28')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x7446('0x28')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x7446('0x28')](0xb)},'sendrpid':{'type':Sequelize[_0x7446('0x3')](_0x7446('0x19'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x7446('0x1')]},'callbackextension':{'type':Sequelize[_0x7446('0x1')]},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0x7446('0x28')](0xb)},'qualifyfreq':{'type':Sequelize[_0x7446('0x28')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0x7446('0x1')]},'use_q850_reason':{'type':Sequelize[_0x7446('0x1')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0x7446('0x3')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x7446('0x19'),'no')},'force_avp':{'type':Sequelize[_0x7446('0x3')](_0x7446('0x19'),'no')},'icesupport':{'type':Sequelize[_0x7446('0x3')](_0x7446('0x19'),'no')},'dtlsenable':{'type':Sequelize[_0x7446('0x3')](_0x7446('0x19'),'no')},'dtlsverify':{'type':Sequelize[_0x7446('0x3')]('yes','no',_0x7446('0x2d'),_0x7446('0x2e'))},'dtlsrekey':{'type':Sequelize[_0x7446('0x28')](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0x7446('0x1')]},'dtlscipher':{'type':Sequelize[_0x7446('0x1')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize[_0x7446('0x1')]},'dtlssetup':{'type':Sequelize[_0x7446('0x3')](_0x7446('0x2f'),'passive',_0x7446('0x30')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x7446('0x1')]},'usereqphone':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0x7446('0x1')]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x7446('0x3')](_0x7446('0x19'),'no')},'subscribemwi':{'type':Sequelize[_0x7446('0x3')]('yes','no')},'vmexten':{'type':Sequelize[_0x7446('0x1')]},'mohinterpret':{'type':Sequelize[_0x7446('0x1')]},'mohsuggest':{'type':Sequelize[_0x7446('0x1')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x7446('0x1')]},'host':{'type':Sequelize[_0x7446('0x1')],'defaultValue':_0x7446('0x31')},'canreinvite':{'type':Sequelize[_0x7446('0x3')](_0x7446('0x19'),'no',_0x7446('0x16'),'update','update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0x7446('0x1')]},'otherFields':{'type':Sequelize[_0x7446('0x1')]},'active':{'type':Sequelize[_0x7446('0x32')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x7446('0x1')],'defaultValue':'no'}}; \ No newline at end of file +var _0x51dc=['String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','ENUM','rfc2833','inband','auto','yes','update','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','INTEGER','always','accept','refuse','originate','uac','uas','pai','fingerprint','certificate','active','passive','actpass','dynamic','update,nonat','BOOLEAN','exports','STRING','friend','user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport','join','getDataValue','split'];(function(_0x3826ad,_0x49a30d){var _0x17b900=function(_0x38474f){while(--_0x38474f){_0x3826ad['push'](_0x3826ad['shift']());}};_0x17b900(++_0x49a30d);}(_0x51dc,0xbc));var _0xc51d=function(_0x13cd95,_0x26047b){_0x13cd95=_0x13cd95-0x0;var _0x34c5b4=_0x51dc[_0x13cd95];return _0x34c5b4;};'use strict';var Sequelize=require('sequelize');module[_0xc51d('0x0')]={'name':{'type':Sequelize[_0xc51d('0x1')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0xc51d('0x2'),_0xc51d('0x3'),_0xc51d('0x4')),'allowNull':![],'defaultValue':_0xc51d('0x2')},'context':{'type':Sequelize[_0xc51d('0x1')],'allowNull':![],'defaultValue':_0xc51d('0x5')},'callingpres':{'type':Sequelize['ENUM'](_0xc51d('0x6'),_0xc51d('0x7'),_0xc51d('0x8'),_0xc51d('0x9'),_0xc51d('0xa'),_0xc51d('0xb'),_0xc51d('0xc'),_0xc51d('0xd'))},'deny':{'type':Sequelize[_0xc51d('0x1')]},'permit':{'type':Sequelize[_0xc51d('0x1')]},'secret':{'type':Sequelize[_0xc51d('0x1')]},'md5secret':{'type':Sequelize[_0xc51d('0x1')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize['STRING'],'defaultValue':_0xc51d('0xe'),'set':function(_0x1e09f1){this[_0xc51d('0xf')](_0xc51d('0x10'),_0x1e09f1?_0x1e09f1[_0xc51d('0x11')](','):null);},'get':function(){return this['getDataValue'](_0xc51d('0x10'))?this[_0xc51d('0x12')](_0xc51d('0x10'))[_0xc51d('0x13')](','):null;},'comment':_0xc51d('0x14')},'dtmfmode':{'type':Sequelize[_0xc51d('0x15')](_0xc51d('0x16'),'info','shortinfo',_0xc51d('0x17'),_0xc51d('0x18')),'defaultValue':_0xc51d('0x16')},'directmedia':{'type':Sequelize[_0xc51d('0x15')](_0xc51d('0x19'),'no','nonat',_0xc51d('0x1a'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xc51d('0x15')](_0xc51d('0x19'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xc51d('0x1')]},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0xc51d('0x1')],'defaultValue':_0xc51d('0x1b'),'set':function(_0x561e6){this[_0xc51d('0xf')](_0xc51d('0x1c'),_0x561e6?_0x561e6[_0xc51d('0x11')](','):null);},'get':function(){return this[_0xc51d('0x12')](_0xc51d('0x1c'))?this['getDataValue']('nat')['split'](','):null;},'comment':_0xc51d('0x1d')},'callgroup':{'type':Sequelize[_0xc51d('0x1')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0xc51d('0x1')]},'namedpickupgroup':{'type':Sequelize[_0xc51d('0x1')]},'language':{'type':Sequelize[_0xc51d('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xc51d('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xc51d('0x1')],'defaultValue':'all'},'allow':{'type':Sequelize[_0xc51d('0x1')],'allowNull':![],'defaultValue':_0xc51d('0x1e'),'set':function(_0x1c18fc){this[_0xc51d('0xf')]('allow',_0x1c18fc?_0x1c18fc[_0xc51d('0x11')](';'):_0xc51d('0x1e'));},'get':function(){return this[_0xc51d('0x12')](_0xc51d('0x1f'))?this[_0xc51d('0x12')](_0xc51d('0x1f'))['split'](';'):null;},'comment':_0xc51d('0x20')},'autoframing':{'type':Sequelize[_0xc51d('0x15')](_0xc51d('0x19'),'no')},'insecure':{'type':Sequelize[_0xc51d('0x1')],'defaultValue':_0xc51d('0x21'),'set':function(_0x2946e7){this['setDataValue'](_0xc51d('0x22'),_0x2946e7?_0x2946e7[_0xc51d('0x11')](','):null);},'get':function(){return this[_0xc51d('0x12')](_0xc51d('0x22'))?this[_0xc51d('0x12')]('insecure')[_0xc51d('0x13')](','):null;},'comment':_0xc51d('0x23')},'trustrpid':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0xc51d('0x19'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xc51d('0x15')](_0xc51d('0x19'),'no','never')},'promiscredir':{'type':Sequelize[_0xc51d('0x15')](_0xc51d('0x19'),'no')},'useclientcode':{'type':Sequelize[_0xc51d('0x15')](_0xc51d('0x19'),'no')},'accountcode':{'type':Sequelize[_0xc51d('0x24')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xc51d('0x1')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0xc51d('0x1')]},'callcounter':{'type':Sequelize['ENUM'](_0xc51d('0x19'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0xc51d('0x24')](0xb)},'allowoverlap':{'type':Sequelize[_0xc51d('0x15')]('yes','no')},'allowsubscribe':{'type':Sequelize[_0xc51d('0x15')](_0xc51d('0x19'),'no')},'allowtransfer':{'type':Sequelize['ENUM'](_0xc51d('0x19'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM']('yes','no')},'subscribecontext':{'type':Sequelize[_0xc51d('0x1')]},'template':{'type':Sequelize[_0xc51d('0x1')]},'videosupport':{'type':Sequelize[_0xc51d('0x15')]('yes','no',_0xc51d('0x25')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xc51d('0x24')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xc51d('0x15')](_0xc51d('0x19'),'no')},'mailbox':{'type':Sequelize[_0xc51d('0x1')]},'session_timers':{'type':Sequelize['ENUM'](_0xc51d('0x26'),_0xc51d('0x27'),_0xc51d('0x28'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0xc51d('0x24')](0xb)},'session_refresher':{'type':Sequelize[_0xc51d('0x15')](_0xc51d('0x29'),'uas'),'defaultValue':_0xc51d('0x2a')},'t38pt_usertpsource':{'type':Sequelize[_0xc51d('0x1')]},'regexten':{'type':Sequelize[_0xc51d('0x1')]},'fromdomain':{'type':Sequelize[_0xc51d('0x1')]},'fromuser':{'type':Sequelize[_0xc51d('0x1')]},'port':{'type':Sequelize[_0xc51d('0x24')](0x5)},'qualify':{'type':Sequelize[_0xc51d('0x15')](_0xc51d('0x19'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0xc51d('0x1')]},'defaultuser':{'type':Sequelize[_0xc51d('0x1')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xc51d('0x24')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize['ENUM'](_0xc51d('0x19'),'no',_0xc51d('0x2b')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0xc51d('0x24')](0xb)},'qualifyfreq':{'type':Sequelize[_0xc51d('0x24')](0xb)},'contactpermit':{'type':Sequelize[_0xc51d('0x1')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0xc51d('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0xc51d('0x1')]},'use_q850_reason':{'type':Sequelize[_0xc51d('0x1')]},'maxforwards':{'type':Sequelize[_0xc51d('0x24')](0xb)},'encryption':{'type':Sequelize[_0xc51d('0x15')](_0xc51d('0x19'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xc51d('0x15')]('yes','no')},'force_avp':{'type':Sequelize[_0xc51d('0x15')]('yes','no')},'icesupport':{'type':Sequelize['ENUM']('yes','no')},'dtlsenable':{'type':Sequelize[_0xc51d('0x15')]('yes','no')},'dtlsverify':{'type':Sequelize['ENUM'](_0xc51d('0x19'),'no',_0xc51d('0x2c'),_0xc51d('0x2d'))},'dtlsrekey':{'type':Sequelize[_0xc51d('0x24')](0xb)},'dtlscertfile':{'type':Sequelize[_0xc51d('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0xc51d('0x1')]},'dtlscipher':{'type':Sequelize[_0xc51d('0x1')]},'dtlscafile':{'type':Sequelize[_0xc51d('0x1')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0xc51d('0x15')](_0xc51d('0x2e'),_0xc51d('0x2f'),_0xc51d('0x30')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xc51d('0x1')]},'usereqphone':{'type':Sequelize[_0xc51d('0x15')](_0xc51d('0x19'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0xc51d('0x1')]},'call_limit':{'type':Sequelize[_0xc51d('0x24')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xc51d('0x15')](_0xc51d('0x19'),'no')},'subscribemwi':{'type':Sequelize[_0xc51d('0x15')]('yes','no')},'vmexten':{'type':Sequelize[_0xc51d('0x1')]},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize[_0xc51d('0x1')]},'parkinglot':{'type':Sequelize[_0xc51d('0x1')]},'description':{'type':Sequelize[_0xc51d('0x1')]},'host':{'type':Sequelize['STRING'],'defaultValue':_0xc51d('0x31')},'canreinvite':{'type':Sequelize[_0xc51d('0x15')](_0xc51d('0x19'),'no','nonat',_0xc51d('0x1a'),_0xc51d('0x32')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xc51d('0x1')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xc51d('0x33')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xc51d('0x1')],'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 f84dbf6..27dda00 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 _0x9c44=['key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','clone','find','omit','createdAt','body','updatedAt','create','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','update','params','/etc/asterisk/sip_xcally_registers.conf','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','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','get','Trunks','destroy','stack','name','send','index','Trunk','rawAttributes','fieldName','type'];(function(_0x3ac31a,_0x18f1b9){var _0x4caa11=function(_0x2d2211){while(--_0x2d2211){_0x3ac31a['push'](_0x3ac31a['shift']());}};_0x4caa11(++_0x18f1b9);}(_0x9c44,0x178));var _0x49c4=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x9c44[_0x465a0c];return _0x1e202e;};'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'];var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x16')][_0x49c4('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x5f2fd9,_0x1909fe,_0x280996,_0x21f15a){return new BPromise(function(_0x2decee,_0x12777c){var _0x18211c=_0x21f15a||client;return _0x18211c[_0x49c4('0x18')](_0x5f2fd9,_0x280996)[_0x49c4('0x19')](function(_0x58d177){logger[_0x49c4('0x1a')](_0x49c4('0x1b'),_0x1909fe,_0x49c4('0x1c'));logger[_0x49c4('0x1d')](_0x49c4('0x1e'),_0x1909fe,'request\x20sent',JSON[_0x49c4('0x1f')](_0x58d177));if(_0x58d177[_0x49c4('0x20')]){if(_0x58d177['error']['code']===0x1f4){logger[_0x49c4('0x20')](_0x49c4('0x1b'),_0x1909fe,_0x58d177[_0x49c4('0x20')]['message']);return _0x12777c(_0x58d177[_0x49c4('0x20')]['message']);}logger[_0x49c4('0x20')](_0x49c4('0x1b'),_0x1909fe,_0x58d177[_0x49c4('0x20')][_0x49c4('0x21')]);return _0x2decee(_0x58d177[_0x49c4('0x20')][_0x49c4('0x21')]);}else{logger[_0x49c4('0x1a')](_0x49c4('0x1b'),_0x1909fe,_0x49c4('0x1c'));_0x2decee(_0x58d177['result']['message']);}})['catch'](function(_0x1c99b1){logger['error']('Trunk,\x20%s,\x20%s',_0x1909fe,_0x1c99b1);_0x12777c(_0x1c99b1);});});}function respondWithStatusCode(_0x2263ae,_0x15581b){_0x15581b=_0x15581b||0xcc;return function(_0x26c640){if(_0x26c640){return _0x2263ae[_0x49c4('0x22')](_0x15581b);}return _0x2263ae['status'](_0x15581b)['end']();};}function respondWithResult(_0x180276,_0x9cb797){_0x9cb797=_0x9cb797||0xc8;return function(_0x565423){if(_0x565423){return _0x180276[_0x49c4('0x23')](_0x9cb797)[_0x49c4('0x24')](_0x565423);}};}function respondWithFilteredResult(_0x210159,_0xa7a826){return function(_0x531d92){if(_0x531d92){var _0x543ea2=typeof _0xa7a826[_0x49c4('0x25')]==='undefined'&&typeof _0xa7a826[_0x49c4('0x26')]===_0x49c4('0x27');var _0x3f1708=_0x531d92[_0x49c4('0x28')];var _0x5987ae=_0x543ea2?0x0:_0xa7a826[_0x49c4('0x25')];var _0x2b2793=_0x543ea2?_0x531d92[_0x49c4('0x28')]:_0xa7a826[_0x49c4('0x25')]+_0xa7a826[_0x49c4('0x26')];var _0x29f835;if(_0x2b2793>=_0x3f1708){_0x2b2793=_0x3f1708;_0x29f835=0xc8;}else{_0x29f835=0xce;}_0x210159[_0x49c4('0x23')](_0x29f835);return _0x210159[_0x49c4('0x29')](_0x49c4('0x2a'),_0x5987ae+'-'+_0x2b2793+'/'+_0x3f1708)[_0x49c4('0x24')](_0x531d92);}return null;};}function patchUpdates(_0x46f7ea){return function(_0x4ea6ea){try{jsonpatch['apply'](_0x4ea6ea,_0x46f7ea,!![]);}catch(_0x59eb84){return BPromise[_0x49c4('0x2b')](_0x59eb84);}return _0x4ea6ea[_0x49c4('0x2c')]();};}function saveUpdates(_0x1eb035,_0x27e467){return function(_0x28eb47){if(_0x28eb47){return _0x28eb47['update'](_0x1eb035)[_0x49c4('0x19')](function(_0x116eb4){return _0x116eb4;});}return null;};}function removeEntity(_0x2e7a69,_0x24bba9){return function(_0x58e252){if(_0x58e252){return _0x58e252['destroy']()[_0x49c4('0x19')](function(){var _0x9a1bed=_0x58e252[_0x49c4('0x2d')]({'plain':!![]});var _0x13b3b4=_0x49c4('0x2e');return db['UserProfileResource'][_0x49c4('0x2f')]({'where':{'type':_0x13b3b4,'resourceId':_0x9a1bed['id']}})[_0x49c4('0x19')](function(){return _0x58e252;});})[_0x49c4('0x19')](function(){_0x2e7a69['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x85dce2,_0x1991e9){return function(_0x3bec0a){if(!_0x3bec0a){_0x85dce2[_0x49c4('0x22')](0x194);}return _0x3bec0a;};}function handleError(_0x2b45a1,_0x2cf897){_0x2cf897=_0x2cf897||0x1f4;return function(_0x1d1557){logger[_0x49c4('0x20')](_0x1d1557[_0x49c4('0x30')]);if(_0x1d1557['name']){delete _0x1d1557[_0x49c4('0x31')];}_0x2b45a1['status'](_0x2cf897)[_0x49c4('0x32')](_0x1d1557);};}exports[_0x49c4('0x33')]=function(_0x2625a6,_0x1c2830){var _0x4ed4f8={},_0x335f0c={},_0x31f3ff={'count':0x0,'rows':[]};var _0x1c910a=_['map'](db[_0x49c4('0x34')][_0x49c4('0x35')],function(_0x178987){return{'name':_0x178987[_0x49c4('0x36')],'type':_0x178987[_0x49c4('0x37')][_0x49c4('0x38')]};});_0x335f0c[_0x49c4('0x39')]=_[_0x49c4('0x3a')](_0x1c910a,_0x49c4('0x31'));_0x335f0c[_0x49c4('0x3b')]=_[_0x49c4('0x3c')](_0x2625a6['query']);_0x335f0c[_0x49c4('0x3d')]=_[_0x49c4('0x3e')](_0x335f0c[_0x49c4('0x39')],_0x335f0c[_0x49c4('0x3b')]);_0x4ed4f8[_0x49c4('0x3f')]=_[_0x49c4('0x3e')](_0x335f0c[_0x49c4('0x39')],qs[_0x49c4('0x40')](_0x2625a6[_0x49c4('0x3b')][_0x49c4('0x40')]));_0x4ed4f8[_0x49c4('0x3f')]=_0x4ed4f8[_0x49c4('0x3f')][_0x49c4('0x41')]?_0x4ed4f8['attributes']:_0x335f0c[_0x49c4('0x39')];if(!_0x2625a6['query'][_0x49c4('0x42')](_0x49c4('0x43'))){_0x4ed4f8[_0x49c4('0x26')]=qs[_0x49c4('0x26')](_0x2625a6[_0x49c4('0x3b')][_0x49c4('0x26')]);_0x4ed4f8['offset']=qs['offset'](_0x2625a6[_0x49c4('0x3b')][_0x49c4('0x25')]);}_0x4ed4f8[_0x49c4('0x44')]=qs[_0x49c4('0x45')](_0x2625a6['query'][_0x49c4('0x45')]);_0x4ed4f8[_0x49c4('0x46')]=qs[_0x49c4('0x3d')](_[_0x49c4('0x47')](_0x2625a6[_0x49c4('0x3b')],_0x335f0c[_0x49c4('0x3d')]),_0x1c910a);if(_0x2625a6[_0x49c4('0x3b')][_0x49c4('0x48')]){_0x4ed4f8[_0x49c4('0x46')]=_['merge'](_0x4ed4f8[_0x49c4('0x46')],{'$or':_['map'](_0x1c910a,function(_0x33696e){if(_0x33696e[_0x49c4('0x37')]!==_0x49c4('0x49')){var _0x258abe={};_0x258abe[_0x33696e[_0x49c4('0x31')]]={'$like':'%'+_0x2625a6['query'][_0x49c4('0x48')]+'%'};return _0x258abe;}})});}_0x4ed4f8=_[_0x49c4('0x4a')]({},_0x4ed4f8,_0x2625a6[_0x49c4('0x4b')]);var _0x254d07={'where':_0x4ed4f8[_0x49c4('0x46')]};return db[_0x49c4('0x34')][_0x49c4('0x28')](_0x254d07)['then'](function(_0x3bac1b){_0x31f3ff['count']=_0x3bac1b;if(_0x2625a6[_0x49c4('0x3b')][_0x49c4('0x4c')]){_0x4ed4f8[_0x49c4('0x4d')]=[{'all':!![]}];}return db[_0x49c4('0x34')][_0x49c4('0x4e')](_0x4ed4f8);})[_0x49c4('0x19')](function(_0x2c6be1){_0x31f3ff['rows']=_0x2c6be1;return _0x31f3ff;})[_0x49c4('0x19')](respondWithFilteredResult(_0x1c2830,_0x4ed4f8))[_0x49c4('0x4f')](handleError(_0x1c2830,null));};exports['show']=function(_0x1e1ac4,_0xaece5f){var _0xfbe179={'raw':![],'where':{'id':_0x1e1ac4['params']['id']}},_0x242afc={};_0x242afc['model']=_[_0x49c4('0x3c')](db['Trunk'][_0x49c4('0x35')]);_0x242afc[_0x49c4('0x3b')]=_[_0x49c4('0x3c')](_0x1e1ac4[_0x49c4('0x3b')]);_0x242afc[_0x49c4('0x3d')]=_[_0x49c4('0x3e')](_0x242afc[_0x49c4('0x39')],_0x242afc['query']);_0xfbe179[_0x49c4('0x3f')]=_[_0x49c4('0x3e')](_0x242afc[_0x49c4('0x39')],qs[_0x49c4('0x40')](_0x1e1ac4[_0x49c4('0x3b')][_0x49c4('0x40')]));_0xfbe179[_0x49c4('0x3f')]=_0xfbe179[_0x49c4('0x3f')][_0x49c4('0x41')]?_0xfbe179[_0x49c4('0x3f')]:_0x242afc['model'];if(_0x1e1ac4['query'][_0x49c4('0x4c')]){_0xfbe179[_0x49c4('0x4d')]=[{'all':!![]}];}_0xfbe179=_['merge']({},_0xfbe179,_0x1e1ac4['options']);return db[_0x49c4('0x34')]['find'](_0xfbe179)['then'](handleEntityNotFound(_0xaece5f,null))[_0x49c4('0x19')](respondWithResult(_0xaece5f,null))[_0x49c4('0x4f')](handleError(_0xaece5f,null));};exports[_0x49c4('0x50')]=function(_0x38c480,_0x2884ca){var _0x16949a={'where':{'id':_0x38c480['params']['id']}},_0x35724e={};_0x35724e[_0x49c4('0x39')]=_[_0x49c4('0x3c')](db[_0x49c4('0x34')][_0x49c4('0x35')]);_0x16949a[_0x49c4('0x3f')]=_[_0x49c4('0x3e')](_0x35724e['model'],qs['fields'](_0x38c480[_0x49c4('0x3b')][_0x49c4('0x40')]));_0x16949a[_0x49c4('0x3f')]=_0x16949a[_0x49c4('0x3f')][_0x49c4('0x41')]?_0x16949a[_0x49c4('0x3f')]:_0x35724e[_0x49c4('0x39')];if(_0x38c480['query'][_0x49c4('0x4c')]){_0x16949a[_0x49c4('0x4d')]=[{'all':!![]}];}_0x16949a=_['merge']({},_0x16949a,_0x38c480[_0x49c4('0x4b')]);return db['Trunk'][_0x49c4('0x51')](_0x16949a)[_0x49c4('0x19')](handleEntityNotFound(_0x2884ca,null))[_0x49c4('0x19')](function(_0x2fe89a){if(_0x2fe89a){var _0x845f7e=_0x2fe89a[_0x49c4('0x2d')]({'plain':!![]});_0x845f7e=qs[_0x49c4('0x52')](_0x845f7e,['id',_0x49c4('0x53'),'updatedAt']);_0x38c480[_0x49c4('0x54')]=_[_0x49c4('0x52')](_0x38c480['body'],['id',_0x49c4('0x53'),_0x49c4('0x55')]);return db['Trunk'][_0x49c4('0x56')](_[_0x49c4('0x4a')](_0x845f7e,_0x38c480['body']),{'include':_0x38c480['query']['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0xc43386){var _0x54947d=_0x38c480[_0x49c4('0x57')][_0x49c4('0x2d')]({'plain':!![]});if(!_0x54947d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x54947d[_0x49c4('0x58')]===_0x49c4('0x57')){var _0x5ac9f0=_0xc43386[_0x49c4('0x2d')]({'plain':!![]});var _0x3dcf4c=_0x49c4('0x2e');return db[_0x49c4('0x59')]['find']({'where':{'name':_0x3dcf4c,'userProfileId':_0x54947d[_0x49c4('0x5a')]},'raw':!![]})[_0x49c4('0x19')](function(_0x3cc604){if(_0x3cc604&&_0x3cc604[_0x49c4('0x5b')]===0x0){return db['UserProfileResource'][_0x49c4('0x56')]({'name':_0x5ac9f0['name'],'resourceId':_0x5ac9f0['id'],'type':_0x3cc604['name'],'sectionId':_0x3cc604['id']},{})['then'](function(){return _0xc43386;});}else{return _0xc43386;}})['catch'](function(_0x302251){logger[_0x49c4('0x20')](_0x49c4('0x5c'),_0x302251);throw _0x302251;});}return _0xc43386;});}})[_0x49c4('0x19')](respondWithResult(_0x2884ca,0xc9))['catch'](handleError(_0x2884ca,null));};exports['create']=function(_0x340523,_0x109b81,_0x342326){var _0x295ad0;return db[_0x49c4('0x34')][_0x49c4('0x56')](_0x340523[_0x49c4('0x54')],{'raw':!![]})[_0x49c4('0x19')](function(_0x4d49e0){_0x295ad0=_0x4d49e0;return db[_0x49c4('0x34')]['findAll']({'raw':!![]});})[_0x49c4('0x19')](function(_0x264902){var _0x1a5d4c=fs[_0x49c4('0x5d')](path[_0x49c4('0x5e')](config[_0x49c4('0x5f')],_0x49c4('0x60')),_0x49c4('0x61'));var _0x13d951=fs[_0x49c4('0x5d')](path[_0x49c4('0x5e')](config[_0x49c4('0x5f')],_0x49c4('0x62')),_0x49c4('0x61'));var _0x2d5f63=ejs[_0x49c4('0x63')](_0x1a5d4c,{'trunks':_0x264902||[]});fs[_0x49c4('0x64')](_0x49c4('0x65'),_0x2d5f63);if(_0x295ad0['registry']){var _0x5ec201=ejs[_0x49c4('0x63')](_0x13d951,{'trunks':_0x264902||[]});fs[_0x49c4('0x64')]('/etc/asterisk/sip_xcally_registers.conf',_0x5ec201);}})[_0x49c4('0x19')](function(){return respondWithRpcPromise(_0x49c4('0x66'),_0x49c4('0x56'),{'module':_0x49c4('0x67')});})['then'](function(){var _0x5a14a5=_0x340523['user'][_0x49c4('0x2d')]({'plain':!![]});if(!_0x5a14a5)throw new Error(_0x49c4('0x68'));if(_0x5a14a5[_0x49c4('0x58')]===_0x49c4('0x57')){var _0x118fc4=_0x295ad0[_0x49c4('0x2d')]({'plain':!![]});return db[_0x49c4('0x59')][_0x49c4('0x51')]({'where':{'name':_0x49c4('0x2e'),'userProfileId':_0x5a14a5['userProfileId']},'raw':!![]})[_0x49c4('0x19')](function(_0x10fb84){if(_0x10fb84&&_0x10fb84[_0x49c4('0x5b')]===0x0){return db['UserProfileResource'][_0x49c4('0x56')]({'name':_0x118fc4[_0x49c4('0x31')],'resourceId':_0x118fc4['id'],'type':_0x10fb84[_0x49c4('0x31')],'sectionId':_0x10fb84['id']},{})[_0x49c4('0x19')](function(){return _0x295ad0;});}else{return _0x295ad0;}})[_0x49c4('0x4f')](function(_0x2fd749){logger[_0x49c4('0x20')](_0x49c4('0x5c'),_0x2fd749);throw _0x2fd749;});}return _0x295ad0;})['then'](respondWithResult(_0x109b81,0xc9))[_0x49c4('0x4f')](handleError(_0x109b81,null));};exports[_0x49c4('0x69')]=function(_0x85540f,_0x18e82b,_0x1e948a){var _0x4a204d;return db['Trunk'][_0x49c4('0x51')]({'where':{'id':_0x85540f['params']['id']}})[_0x49c4('0x19')](handleEntityNotFound(_0x18e82b,null))['then'](saveUpdates(_0x85540f[_0x49c4('0x54')],null))[_0x49c4('0x19')](function(_0x3b03dd){if(_0x3b03dd){_0x4a204d=_0x3b03dd;return db[_0x49c4('0x34')]['findAll']({'raw':!![]});}})[_0x49c4('0x19')](function(_0x38d7d3){if(_0x38d7d3){var _0x2ceada=fs[_0x49c4('0x5d')](path[_0x49c4('0x5e')](config[_0x49c4('0x5f')],_0x49c4('0x60')),_0x49c4('0x61'));var _0x46477f=fs[_0x49c4('0x5d')](path['join'](config[_0x49c4('0x5f')],_0x49c4('0x62')),'utf8');var _0x15bee0=ejs['render'](_0x2ceada,{'trunks':_0x38d7d3||[]});fs[_0x49c4('0x64')](_0x49c4('0x65'),_0x15bee0);var _0x1f14a6=ejs[_0x49c4('0x63')](_0x46477f,{'trunks':_0x38d7d3||[]});fs[_0x49c4('0x64')]('/etc/asterisk/sip_xcally_registers.conf',_0x1f14a6);return respondWithRpcPromise(_0x49c4('0x66'),_0x49c4('0x69'),{'module':'chan_sip.so'});}return null;})[_0x49c4('0x19')](function(_0x167e41){if(_0x167e41){return _0x4a204d;}})['then'](respondWithResult(_0x18e82b,null))[_0x49c4('0x4f')](handleError(_0x18e82b,null));};exports[_0x49c4('0x2f')]=function(_0x57b137,_0x37fef1,_0x993d00){var _0x25989a;return db[_0x49c4('0x34')]['find']({'where':{'id':_0x57b137[_0x49c4('0x6a')]['id']}})[_0x49c4('0x19')](handleEntityNotFound(_0x37fef1,null))['then'](removeEntity(_0x37fef1,null))[_0x49c4('0x19')](function(){return db['Trunk']['findAll']({'raw':!![]});})[_0x49c4('0x19')](function(_0x507078){var _0x50fd24=fs[_0x49c4('0x5d')](path[_0x49c4('0x5e')](config['root'],_0x49c4('0x60')),'utf8');var _0x578f4b=fs['readFileSync'](path[_0x49c4('0x5e')](config[_0x49c4('0x5f')],_0x49c4('0x62')),_0x49c4('0x61'));var _0x4a5f0b=ejs['render'](_0x50fd24,{'trunks':_0x507078});var _0x348693=ejs['render'](_0x578f4b,{'trunks':_0x507078});fs[_0x49c4('0x64')]('/etc/asterisk/sip_xcally_trunks.conf',_0x4a5f0b);fs[_0x49c4('0x64')](_0x49c4('0x6b'),_0x348693);return respondWithRpcPromise(_0x49c4('0x66'),_0x49c4('0x2f'),{'module':_0x49c4('0x67')});})[_0x49c4('0x4f')](handleError(_0x37fef1,null));}; \ No newline at end of file +var _0x00bb=['includeAll','findAll','rows','params','find','clone','rawAttributes','include','omit','createdAt','body','updatedAt','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','server/files/templates/trunk.ejs','utf8','root','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','Reload','chan_sip.so','/etc/asterisk/sip_xcally_registers.conf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','jayson/promise','client','http','request','info','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','Trunk,\x20%s,\x20%s','result','catch','sendStatus','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','get','Trunks','UserProfileResource','status','stack','name','index','map','Trunk','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options'];(function(_0x496d26,_0x2991b3){var _0x31e7a6=function(_0x4fb393){while(--_0x4fb393){_0x496d26['push'](_0x496d26['shift']());}};_0x31e7a6(++_0x2991b3);}(_0x00bb,0x1d8));var _0xb00b=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0x00bb[_0x2b5eae];return _0x5f3ac9;};'use strict';var emlformat=require(_0xb00b('0x0'));var rimraf=require(_0xb00b('0x1'));var zipdir=require(_0xb00b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb00b('0x3'));var moment=require('moment');var BPromise=require(_0xb00b('0x4'));var Mustache=require(_0xb00b('0x5'));var util=require('util');var path=require(_0xb00b('0x6'));var sox=require(_0xb00b('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb00b('0x8'));var squel=require(_0xb00b('0x9'));var crypto=require(_0xb00b('0xa'));var jsforce=require(_0xb00b('0xb'));var deskjs=require(_0xb00b('0xc'));var toCsv=require(_0xb00b('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb00b('0xe'));var authService=require(_0xb00b('0xf'));var qs=require(_0xb00b('0x10'));var as=require(_0xb00b('0x11'));var hardwareService=require(_0xb00b('0x12'));var logger=require('../../config/logger')(_0xb00b('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb00b('0x14'))['db'];var jayson=require(_0xb00b('0x15'));var client=jayson[_0xb00b('0x16')][_0xb00b('0x17')]({'port':0x232a});function respondWithRpcPromise(_0xef5d52,_0x1f1c1d,_0x4ada81,_0x218de2){return new BPromise(function(_0xb0d42e,_0x482fe6){var _0x88d95e=_0x218de2||client;return _0x88d95e[_0xb00b('0x18')](_0xef5d52,_0x4ada81)['then'](function(_0x5da36b){logger[_0xb00b('0x19')]('Trunk,\x20%s,\x20%s',_0x1f1c1d,'request\x20sent');logger[_0xb00b('0x1a')](_0xb00b('0x1b'),_0x1f1c1d,_0xb00b('0x1c'),JSON[_0xb00b('0x1d')](_0x5da36b));if(_0x5da36b['error']){if(_0x5da36b[_0xb00b('0x1e')]['code']===0x1f4){logger[_0xb00b('0x1e')]('Trunk,\x20%s,\x20%s',_0x1f1c1d,_0x5da36b[_0xb00b('0x1e')]['message']);return _0x482fe6(_0x5da36b[_0xb00b('0x1e')][_0xb00b('0x1f')]);}logger['error']('Trunk,\x20%s,\x20%s',_0x1f1c1d,_0x5da36b[_0xb00b('0x1e')]['message']);return _0xb0d42e(_0x5da36b[_0xb00b('0x1e')][_0xb00b('0x1f')]);}else{logger[_0xb00b('0x19')](_0xb00b('0x20'),_0x1f1c1d,'request\x20sent');_0xb0d42e(_0x5da36b[_0xb00b('0x21')]['message']);}})[_0xb00b('0x22')](function(_0x121ec7){logger['error'](_0xb00b('0x20'),_0x1f1c1d,_0x121ec7);_0x482fe6(_0x121ec7);});});}function respondWithStatusCode(_0x2896d1,_0x520444){_0x520444=_0x520444||0xcc;return function(_0x3ab3cc){if(_0x3ab3cc){return _0x2896d1[_0xb00b('0x23')](_0x520444);}return _0x2896d1['status'](_0x520444)[_0xb00b('0x24')]();};}function respondWithResult(_0x243fdb,_0x3c9500){_0x3c9500=_0x3c9500||0xc8;return function(_0x8caadf){if(_0x8caadf){return _0x243fdb['status'](_0x3c9500)['json'](_0x8caadf);}};}function respondWithFilteredResult(_0x3785e9,_0x490380){return function(_0x550587){if(_0x550587){var _0x4a635e=typeof _0x490380[_0xb00b('0x25')]===_0xb00b('0x26')&&typeof _0x490380[_0xb00b('0x27')]===_0xb00b('0x26');var _0x1f14fa=_0x550587[_0xb00b('0x28')];var _0x15d3b9=_0x4a635e?0x0:_0x490380['offset'];var _0x22c22d=_0x4a635e?_0x550587['count']:_0x490380[_0xb00b('0x25')]+_0x490380[_0xb00b('0x27')];var _0x5424ca;if(_0x22c22d>=_0x1f14fa){_0x22c22d=_0x1f14fa;_0x5424ca=0xc8;}else{_0x5424ca=0xce;}_0x3785e9['status'](_0x5424ca);return _0x3785e9[_0xb00b('0x29')](_0xb00b('0x2a'),_0x15d3b9+'-'+_0x22c22d+'/'+_0x1f14fa)[_0xb00b('0x2b')](_0x550587);}return null;};}function patchUpdates(_0x183233){return function(_0x303625){try{jsonpatch[_0xb00b('0x2c')](_0x303625,_0x183233,!![]);}catch(_0x2e160a){return BPromise[_0xb00b('0x2d')](_0x2e160a);}return _0x303625[_0xb00b('0x2e')]();};}function saveUpdates(_0x54e247,_0x2b5f41){return function(_0x44918d){if(_0x44918d){return _0x44918d['update'](_0x54e247)[_0xb00b('0x2f')](function(_0x2f3b37){return _0x2f3b37;});}return null;};}function removeEntity(_0x5a5e5a,_0x456241){return function(_0x4d2ee5){if(_0x4d2ee5){return _0x4d2ee5[_0xb00b('0x30')]()[_0xb00b('0x2f')](function(){var _0x322879=_0x4d2ee5[_0xb00b('0x31')]({'plain':!![]});var _0x338864=_0xb00b('0x32');return db[_0xb00b('0x33')]['destroy']({'where':{'type':_0x338864,'resourceId':_0x322879['id']}})['then'](function(){return _0x4d2ee5;});})['then'](function(){_0x5a5e5a[_0xb00b('0x34')](0xcc)[_0xb00b('0x24')]();});}};}function handleEntityNotFound(_0x45dcda,_0x2589cb){return function(_0x5cfa60){if(!_0x5cfa60){_0x45dcda[_0xb00b('0x23')](0x194);}return _0x5cfa60;};}function handleError(_0x266f8e,_0x341f46){_0x341f46=_0x341f46||0x1f4;return function(_0x1c7a9f){logger[_0xb00b('0x1e')](_0x1c7a9f[_0xb00b('0x35')]);if(_0x1c7a9f[_0xb00b('0x36')]){delete _0x1c7a9f[_0xb00b('0x36')];}_0x266f8e['status'](_0x341f46)['send'](_0x1c7a9f);};}exports[_0xb00b('0x37')]=function(_0x56022e,_0x1c8258){var _0x1c5400={},_0x29579b={},_0x45ca74={'count':0x0,'rows':[]};var _0x37c017=_[_0xb00b('0x38')](db[_0xb00b('0x39')]['rawAttributes'],function(_0x35f1ca){return{'name':_0x35f1ca[_0xb00b('0x3a')],'type':_0x35f1ca[_0xb00b('0x3b')][_0xb00b('0x3c')]};});_0x29579b[_0xb00b('0x3d')]=_[_0xb00b('0x38')](_0x37c017,'name');_0x29579b[_0xb00b('0x3e')]=_[_0xb00b('0x3f')](_0x56022e['query']);_0x29579b[_0xb00b('0x40')]=_[_0xb00b('0x41')](_0x29579b[_0xb00b('0x3d')],_0x29579b[_0xb00b('0x3e')]);_0x1c5400[_0xb00b('0x42')]=_['intersection'](_0x29579b[_0xb00b('0x3d')],qs[_0xb00b('0x43')](_0x56022e[_0xb00b('0x3e')][_0xb00b('0x43')]));_0x1c5400['attributes']=_0x1c5400['attributes'][_0xb00b('0x44')]?_0x1c5400[_0xb00b('0x42')]:_0x29579b[_0xb00b('0x3d')];if(!_0x56022e[_0xb00b('0x3e')][_0xb00b('0x45')](_0xb00b('0x46'))){_0x1c5400[_0xb00b('0x27')]=qs['limit'](_0x56022e[_0xb00b('0x3e')][_0xb00b('0x27')]);_0x1c5400[_0xb00b('0x25')]=qs[_0xb00b('0x25')](_0x56022e[_0xb00b('0x3e')][_0xb00b('0x25')]);}_0x1c5400[_0xb00b('0x47')]=qs[_0xb00b('0x48')](_0x56022e[_0xb00b('0x3e')][_0xb00b('0x48')]);_0x1c5400[_0xb00b('0x49')]=qs[_0xb00b('0x40')](_['pick'](_0x56022e[_0xb00b('0x3e')],_0x29579b[_0xb00b('0x40')]),_0x37c017);if(_0x56022e[_0xb00b('0x3e')][_0xb00b('0x4a')]){_0x1c5400[_0xb00b('0x49')]=_[_0xb00b('0x4b')](_0x1c5400[_0xb00b('0x49')],{'$or':_[_0xb00b('0x38')](_0x37c017,function(_0x10ba60){if(_0x10ba60[_0xb00b('0x3b')]!==_0xb00b('0x4c')){var _0x3b3031={};_0x3b3031[_0x10ba60['name']]={'$like':'%'+_0x56022e['query']['filter']+'%'};return _0x3b3031;}})});}_0x1c5400=_[_0xb00b('0x4b')]({},_0x1c5400,_0x56022e[_0xb00b('0x4d')]);var _0x481154={'where':_0x1c5400[_0xb00b('0x49')]};return db[_0xb00b('0x39')][_0xb00b('0x28')](_0x481154)[_0xb00b('0x2f')](function(_0x4b62b3){_0x45ca74['count']=_0x4b62b3;if(_0x56022e[_0xb00b('0x3e')][_0xb00b('0x4e')]){_0x1c5400['include']=[{'all':!![]}];}return db['Trunk'][_0xb00b('0x4f')](_0x1c5400);})[_0xb00b('0x2f')](function(_0x4e0be4){_0x45ca74[_0xb00b('0x50')]=_0x4e0be4;return _0x45ca74;})['then'](respondWithFilteredResult(_0x1c8258,_0x1c5400))['catch'](handleError(_0x1c8258,null));};exports['show']=function(_0x465d90,_0x481515){var _0x1f7b86={'raw':![],'where':{'id':_0x465d90[_0xb00b('0x51')]['id']}},_0x3178aa={};_0x3178aa[_0xb00b('0x3d')]=_[_0xb00b('0x3f')](db[_0xb00b('0x39')]['rawAttributes']);_0x3178aa['query']=_[_0xb00b('0x3f')](_0x465d90[_0xb00b('0x3e')]);_0x3178aa['filters']=_[_0xb00b('0x41')](_0x3178aa[_0xb00b('0x3d')],_0x3178aa['query']);_0x1f7b86[_0xb00b('0x42')]=_[_0xb00b('0x41')](_0x3178aa[_0xb00b('0x3d')],qs['fields'](_0x465d90['query'][_0xb00b('0x43')]));_0x1f7b86[_0xb00b('0x42')]=_0x1f7b86[_0xb00b('0x42')][_0xb00b('0x44')]?_0x1f7b86['attributes']:_0x3178aa[_0xb00b('0x3d')];if(_0x465d90[_0xb00b('0x3e')]['includeAll']){_0x1f7b86['include']=[{'all':!![]}];}_0x1f7b86=_[_0xb00b('0x4b')]({},_0x1f7b86,_0x465d90['options']);return db[_0xb00b('0x39')][_0xb00b('0x52')](_0x1f7b86)[_0xb00b('0x2f')](handleEntityNotFound(_0x481515,null))[_0xb00b('0x2f')](respondWithResult(_0x481515,null))[_0xb00b('0x22')](handleError(_0x481515,null));};exports[_0xb00b('0x53')]=function(_0x5a3b85,_0x5d52a5){var _0x51c9e3={'where':{'id':_0x5a3b85[_0xb00b('0x51')]['id']}},_0x37d4d2={};_0x37d4d2[_0xb00b('0x3d')]=_['keys'](db[_0xb00b('0x39')][_0xb00b('0x54')]);_0x51c9e3[_0xb00b('0x42')]=_['intersection'](_0x37d4d2[_0xb00b('0x3d')],qs[_0xb00b('0x43')](_0x5a3b85[_0xb00b('0x3e')][_0xb00b('0x43')]));_0x51c9e3[_0xb00b('0x42')]=_0x51c9e3[_0xb00b('0x42')][_0xb00b('0x44')]?_0x51c9e3[_0xb00b('0x42')]:_0x37d4d2['model'];if(_0x5a3b85[_0xb00b('0x3e')][_0xb00b('0x4e')]){_0x51c9e3[_0xb00b('0x55')]=[{'all':!![]}];}_0x51c9e3=_['merge']({},_0x51c9e3,_0x5a3b85[_0xb00b('0x4d')]);return db[_0xb00b('0x39')][_0xb00b('0x52')](_0x51c9e3)[_0xb00b('0x2f')](handleEntityNotFound(_0x5d52a5,null))[_0xb00b('0x2f')](function(_0x4bfe0b){if(_0x4bfe0b){var _0xfd4ecc=_0x4bfe0b[_0xb00b('0x31')]({'plain':!![]});_0xfd4ecc=qs[_0xb00b('0x56')](_0xfd4ecc,['id',_0xb00b('0x57'),'updatedAt']);_0x5a3b85[_0xb00b('0x58')]=_[_0xb00b('0x56')](_0x5a3b85[_0xb00b('0x58')],['id',_0xb00b('0x57'),_0xb00b('0x59')]);return db[_0xb00b('0x39')][_0xb00b('0x5a')](_['merge'](_0xfd4ecc,_0x5a3b85[_0xb00b('0x58')]),{'include':_0x5a3b85['query'][_0xb00b('0x4e')]?[{'all':!![]}]:undefined})['then'](function(_0x3b3272){var _0x530d4a=_0x5a3b85[_0xb00b('0x5b')]['get']({'plain':!![]});if(!_0x530d4a)throw new Error(_0xb00b('0x5c'));if(_0x530d4a[_0xb00b('0x5d')]===_0xb00b('0x5b')){var _0x4d1cec=_0x3b3272['get']({'plain':!![]});var _0x4f7a59=_0xb00b('0x32');return db[_0xb00b('0x5e')][_0xb00b('0x52')]({'where':{'name':_0x4f7a59,'userProfileId':_0x530d4a['userProfileId']},'raw':!![]})[_0xb00b('0x2f')](function(_0x37ae88){if(_0x37ae88&&_0x37ae88[_0xb00b('0x5f')]===0x0){return db[_0xb00b('0x33')][_0xb00b('0x5a')]({'name':_0x4d1cec['name'],'resourceId':_0x4d1cec['id'],'type':_0x37ae88[_0xb00b('0x36')],'sectionId':_0x37ae88['id']},{})[_0xb00b('0x2f')](function(){return _0x3b3272;});}else{return _0x3b3272;}})['catch'](function(_0xe1316d){logger[_0xb00b('0x1e')](_0xb00b('0x60'),_0xe1316d);throw _0xe1316d;});}return _0x3b3272;});}})['then'](respondWithResult(_0x5d52a5,0xc9))['catch'](handleError(_0x5d52a5,null));};exports[_0xb00b('0x5a')]=function(_0x188da7,_0x23762e,_0x49f0a2){var _0x5aac5f;return db['Trunk']['create'](_0x188da7[_0xb00b('0x58')],{'raw':!![]})['then'](function(_0x2434a0){_0x5aac5f=_0x2434a0;return db[_0xb00b('0x39')]['findAll']({'raw':!![]});})[_0xb00b('0x2f')](function(_0x1e7f3a){var _0x2d21ec=fs[_0xb00b('0x61')](path[_0xb00b('0x62')](config['root'],_0xb00b('0x63')),_0xb00b('0x64'));var _0x3d4482=fs[_0xb00b('0x61')](path[_0xb00b('0x62')](config[_0xb00b('0x65')],_0xb00b('0x66')),'utf8');var _0x27b3ae=ejs[_0xb00b('0x67')](_0x2d21ec,{'trunks':_0x1e7f3a||[]});fs[_0xb00b('0x68')](_0xb00b('0x69'),_0x27b3ae);if(_0x5aac5f[_0xb00b('0x6a')]){var _0x432b68=ejs[_0xb00b('0x67')](_0x3d4482,{'trunks':_0x1e7f3a||[]});fs[_0xb00b('0x68')]('/etc/asterisk/sip_xcally_registers.conf',_0x432b68);}})[_0xb00b('0x2f')](function(){return respondWithRpcPromise(_0xb00b('0x6b'),_0xb00b('0x5a'),{'module':_0xb00b('0x6c')});})[_0xb00b('0x2f')](function(){var _0xfb2b68=_0x188da7[_0xb00b('0x5b')][_0xb00b('0x31')]({'plain':!![]});if(!_0xfb2b68)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xfb2b68[_0xb00b('0x5d')]===_0xb00b('0x5b')){var _0x7803a0=_0x5aac5f[_0xb00b('0x31')]({'plain':!![]});return db[_0xb00b('0x5e')][_0xb00b('0x52')]({'where':{'name':_0xb00b('0x32'),'userProfileId':_0xfb2b68['userProfileId']},'raw':!![]})[_0xb00b('0x2f')](function(_0x37a4c0){if(_0x37a4c0&&_0x37a4c0[_0xb00b('0x5f')]===0x0){return db[_0xb00b('0x33')][_0xb00b('0x5a')]({'name':_0x7803a0[_0xb00b('0x36')],'resourceId':_0x7803a0['id'],'type':_0x37a4c0['name'],'sectionId':_0x37a4c0['id']},{})[_0xb00b('0x2f')](function(){return _0x5aac5f;});}else{return _0x5aac5f;}})['catch'](function(_0x135cbf){logger['error'](_0xb00b('0x60'),_0x135cbf);throw _0x135cbf;});}return _0x5aac5f;})[_0xb00b('0x2f')](respondWithResult(_0x23762e,0xc9))[_0xb00b('0x22')](handleError(_0x23762e,null));};exports['update']=function(_0x5287cc,_0x9ad1c6,_0x3c4850){var _0x33a483;return db[_0xb00b('0x39')][_0xb00b('0x52')]({'where':{'id':_0x5287cc[_0xb00b('0x51')]['id']}})[_0xb00b('0x2f')](handleEntityNotFound(_0x9ad1c6,null))[_0xb00b('0x2f')](saveUpdates(_0x5287cc[_0xb00b('0x58')],null))[_0xb00b('0x2f')](function(_0x257430){if(_0x257430){_0x33a483=_0x257430;return db[_0xb00b('0x39')][_0xb00b('0x4f')]({'raw':!![]});}})[_0xb00b('0x2f')](function(_0x4eb17d){if(_0x4eb17d){var _0x59503c=fs[_0xb00b('0x61')](path[_0xb00b('0x62')](config['root'],'server/files/templates/trunk.ejs'),_0xb00b('0x64'));var _0x391e98=fs[_0xb00b('0x61')](path['join'](config[_0xb00b('0x65')],_0xb00b('0x66')),_0xb00b('0x64'));var _0x45c9cd=ejs[_0xb00b('0x67')](_0x59503c,{'trunks':_0x4eb17d||[]});fs[_0xb00b('0x68')](_0xb00b('0x69'),_0x45c9cd);var _0x4a9125=ejs[_0xb00b('0x67')](_0x391e98,{'trunks':_0x4eb17d||[]});fs['writeFileSync'](_0xb00b('0x6d'),_0x4a9125);return respondWithRpcPromise(_0xb00b('0x6b'),'update',{'module':_0xb00b('0x6c')});}return null;})[_0xb00b('0x2f')](function(_0xe80a21){if(_0xe80a21){return _0x33a483;}})[_0xb00b('0x2f')](respondWithResult(_0x9ad1c6,null))[_0xb00b('0x22')](handleError(_0x9ad1c6,null));};exports[_0xb00b('0x30')]=function(_0xc41c1f,_0x2423b2,_0x36ba5c){var _0x383d16;return db[_0xb00b('0x39')][_0xb00b('0x52')]({'where':{'id':_0xc41c1f['params']['id']}})[_0xb00b('0x2f')](handleEntityNotFound(_0x2423b2,null))[_0xb00b('0x2f')](removeEntity(_0x2423b2,null))[_0xb00b('0x2f')](function(){return db[_0xb00b('0x39')]['findAll']({'raw':!![]});})[_0xb00b('0x2f')](function(_0x17503d){var _0x32508b=fs[_0xb00b('0x61')](path[_0xb00b('0x62')](config['root'],_0xb00b('0x63')),_0xb00b('0x64'));var _0xa4fe1e=fs[_0xb00b('0x61')](path['join'](config[_0xb00b('0x65')],'server/files/templates/registry.ejs'),_0xb00b('0x64'));var _0x202d5f=ejs[_0xb00b('0x67')](_0x32508b,{'trunks':_0x17503d});var _0x165442=ejs[_0xb00b('0x67')](_0xa4fe1e,{'trunks':_0x17503d});fs[_0xb00b('0x68')](_0xb00b('0x69'),_0x202d5f);fs[_0xb00b('0x68')](_0xb00b('0x6d'),_0x165442);return respondWithRpcPromise(_0xb00b('0x6b'),_0xb00b('0x30'),{'module':'chan_sip.so'});})[_0xb00b('0x22')](handleError(_0x2423b2,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 9ca0372..b09c650 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 _0x8449=['define','tools_trunks','lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./trunk.attributes','exports'];(function(_0x5e58b2,_0x1b7ed4){var _0x4facd0=function(_0x58d136){while(--_0x58d136){_0x5e58b2['push'](_0x5e58b2['shift']());}};_0x4facd0(++_0x1b7ed4);}(_0x8449,0x199));var _0x9844=function(_0x2aa0e7,_0x4e5145){_0x2aa0e7=_0x2aa0e7-0x0;var _0x1472c0=_0x8449[_0x2aa0e7];return _0x1472c0;};'use strict';var _=require(_0x9844('0x0'));var util=require('util');var logger=require(_0x9844('0x1'))('api');var moment=require(_0x9844('0x2'));var BPromise=require(_0x9844('0x3'));var rp=require(_0x9844('0x4'));var fs=require('fs');var path=require(_0x9844('0x5'));var rimraf=require('rimraf');var config=require(_0x9844('0x6'));var attributes=require(_0x9844('0x7'));module[_0x9844('0x8')]=function(_0x5d955,_0x2376a2){return _0x5d955[_0x9844('0x9')]('Trunk',attributes,{'tableName':_0x9844('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6719=['moment','bluebird','request-promise','path','../../config/environment','./trunk.attributes','exports','Trunk','tools_trunks','lodash','util','../../config/logger','api'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x6719,0x141));var _0x9671=function(_0x5b9874,_0x327bd2){_0x5b9874=_0x5b9874-0x0;var _0x3c38ff=_0x6719[_0x5b9874];return _0x3c38ff;};'use strict';var _=require(_0x9671('0x0'));var util=require(_0x9671('0x1'));var logger=require(_0x9671('0x2'))(_0x9671('0x3'));var moment=require(_0x9671('0x4'));var BPromise=require(_0x9671('0x5'));var rp=require(_0x9671('0x6'));var fs=require('fs');var path=require(_0x9671('0x7'));var rimraf=require('rimraf');var config=require(_0x9671('0x8'));var attributes=require(_0x9671('0x9'));module[_0x9671('0xa')]=function(_0xc1fa5f,_0x147d44){return _0xc1fa5f['define'](_0x9671('0xb'),attributes,{'tableName':_0x9671('0xc'),'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 1578190..7a51c24 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 _0x5736=['then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','Trunk','findAll','options','raw','where','limit','include','map','model','catch','GetTrunk','ShowTrunk','attributes','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x5c341a,_0x4bd2bc){var _0x380d68=function(_0x2ff082){while(--_0x2ff082){_0x5c341a['push'](_0x5c341a['shift']());}};_0x380d68(++_0x4bd2bc);}(_0x5736,0x18d));var _0x6573=function(_0x5e2b1e,_0x4a8664){_0x5e2b1e=_0x5e2b1e-0x0;var _0x1aaa32=_0x5736[_0x5e2b1e];return _0x1aaa32;};'use strict';var _=require(_0x6573('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6573('0x1'));var rs=require(_0x6573('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6573('0x3'))['db'];var utils=require(_0x6573('0x4'));var logger=require(_0x6573('0x5'))(_0x6573('0x6'));var config=require(_0x6573('0x7'));var jayson=require(_0x6573('0x8'));var client=jayson[_0x6573('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x95af8,_0x3ff78,_0x33850d){return new BPromise(function(_0x4196ed,_0x17deac){return client[_0x6573('0xa')](_0x95af8,_0x33850d)[_0x6573('0xb')](function(_0x546582){logger[_0x6573('0xc')](_0x6573('0xd'),_0x3ff78,_0x6573('0xe'));logger[_0x6573('0xf')]('Trunk,\x20%s,\x20%s,\x20%s',_0x3ff78,_0x6573('0xe'),JSON[_0x6573('0x10')](_0x546582));if(_0x546582[_0x6573('0x11')]){if(_0x546582[_0x6573('0x11')][_0x6573('0x12')]===0x1f4){logger['error'](_0x6573('0xd'),_0x3ff78,_0x546582['error'][_0x6573('0x13')]);return _0x17deac(_0x546582['error'][_0x6573('0x13')]);}logger['error'](_0x6573('0xd'),_0x3ff78,_0x546582['error'][_0x6573('0x13')]);return _0x4196ed(_0x546582[_0x6573('0x11')][_0x6573('0x13')]);}else{logger[_0x6573('0xc')]('Trunk,\x20%s,\x20%s',_0x3ff78,_0x6573('0xe'));_0x4196ed(_0x546582[_0x6573('0x14')][_0x6573('0x13')]);}})['catch'](function(_0x54fba2){logger[_0x6573('0x11')](_0x6573('0xd'),_0x3ff78,_0x54fba2);_0x17deac(_0x54fba2);});});}exports['GetTrunk']=function(_0x49790c){var _0x231228=this;return new Promise(function(_0x45d65a,_0x1c15d4){return db[_0x6573('0x15')][_0x6573('0x16')]({'raw':_0x49790c['options']?_0x49790c[_0x6573('0x17')][_0x6573('0x18')]===undefined?!![]:![]:!![],'where':_0x49790c[_0x6573('0x17')]?_0x49790c['options'][_0x6573('0x19')]||null:null,'attributes':_0x49790c[_0x6573('0x17')]?_0x49790c[_0x6573('0x17')]['attributes']||null:null,'limit':_0x49790c[_0x6573('0x17')]?_0x49790c['options'][_0x6573('0x1a')]||null:null,'include':_0x49790c['options']?_0x49790c['options'][_0x6573('0x1b')]?_[_0x6573('0x1c')](_0x49790c['options'][_0x6573('0x1b')],function(_0x578018){return{'model':db[_0x578018[_0x6573('0x1d')]],'as':_0x578018['as'],'attributes':_0x578018['attributes'],'include':_0x578018[_0x6573('0x1b')]?_[_0x6573('0x1c')](_0x578018[_0x6573('0x1b')],function(_0x38bdaf){return{'model':db[_0x38bdaf[_0x6573('0x1d')]],'as':_0x38bdaf['as'],'attributes':_0x38bdaf['attributes'],'include':_0x38bdaf[_0x6573('0x1b')]?_[_0x6573('0x1c')](_0x38bdaf[_0x6573('0x1b')],function(_0x17ed27){return{'model':db[_0x17ed27['model']],'as':_0x17ed27['as'],'attributes':_0x17ed27['attributes']};}):[]};}):[]};}):[]:[]})[_0x6573('0xb')](function(_0x129c88){logger[_0x6573('0xc')]('GetTrunk',_0x49790c);logger['debug']('GetTrunk',_0x49790c,JSON['stringify'](_0x129c88));_0x45d65a(_0x129c88);})[_0x6573('0x1e')](function(_0x38a79e){logger['error'](_0x6573('0x1f'),_0x38a79e[_0x6573('0x13')],_0x49790c);_0x1c15d4(_0x231228[_0x6573('0x11')](0x1f4,_0x38a79e[_0x6573('0x13')]));});});};exports[_0x6573('0x20')]=function(_0x6e0133){var _0x1bb3bf=this;return new Promise(function(_0x476827,_0x2c5bd6){return db[_0x6573('0x15')]['find']({'raw':_0x6e0133['options']?_0x6e0133[_0x6573('0x17')][_0x6573('0x18')]===undefined?!![]:![]:!![],'where':_0x6e0133['options']?_0x6e0133['options'][_0x6573('0x19')]||null:null,'attributes':_0x6e0133[_0x6573('0x17')]?_0x6e0133[_0x6573('0x17')][_0x6573('0x21')]||null:null,'include':_0x6e0133[_0x6573('0x17')]?_0x6e0133[_0x6573('0x17')][_0x6573('0x1b')]?_[_0x6573('0x1c')](_0x6e0133['options'][_0x6573('0x1b')],function(_0x368ad4){return{'model':db[_0x368ad4[_0x6573('0x1d')]],'as':_0x368ad4['as'],'attributes':_0x368ad4['attributes'],'include':_0x368ad4['include']?_[_0x6573('0x1c')](_0x368ad4['include'],function(_0x1fd802){return{'model':db[_0x1fd802[_0x6573('0x1d')]],'as':_0x1fd802['as'],'attributes':_0x1fd802[_0x6573('0x21')],'include':_0x1fd802[_0x6573('0x1b')]?_['map'](_0x1fd802['include'],function(_0x2f2db2){return{'model':db[_0x2f2db2['model']],'as':_0x2f2db2['as'],'attributes':_0x2f2db2[_0x6573('0x21')]};}):[]};}):[]};}):[]:[]})[_0x6573('0xb')](function(_0x1547bd){logger['info'](_0x6573('0x20'),_0x6e0133);logger[_0x6573('0xf')](_0x6573('0x20'),_0x6e0133,JSON[_0x6573('0x10')](_0x1547bd));_0x476827(_0x1547bd);})[_0x6573('0x1e')](function(_0x47f0b5){logger[_0x6573('0x11')](_0x6573('0x20'),_0x47f0b5[_0x6573('0x13')],_0x6e0133);_0x2c5bd6(_0x1bb3bf[_0x6573('0x11')](0x1f4,_0x47f0b5[_0x6573('0x13')]));});});}; \ No newline at end of file +var _0x3503=['Trunk','findAll','options','raw','where','limit','include','map','model','attributes','GetTrunk','catch','ShowTrunk','find','util','moment','ioredis','../../config/utils','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','Trunk,\x20%s,\x20%s','message','result'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x3503,0xda));var _0x3350=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x3503[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require('lodash');var util=require(_0x3350('0x0'));var moment=require(_0x3350('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3350('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x3350('0x3'));var logger=require('../../config/logger')(_0x3350('0x4'));var config=require('../../config/environment');var jayson=require(_0x3350('0x5'));var client=jayson[_0x3350('0x6')][_0x3350('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x511d4c,_0x2db877,_0x13e423){return new BPromise(function(_0x595515,_0x1f8741){return client[_0x3350('0x8')](_0x511d4c,_0x13e423)[_0x3350('0x9')](function(_0x1a885d){logger[_0x3350('0xa')]('Trunk,\x20%s,\x20%s',_0x2db877,_0x3350('0xb'));logger[_0x3350('0xc')](_0x3350('0xd'),_0x2db877,_0x3350('0xb'),JSON[_0x3350('0xe')](_0x1a885d));if(_0x1a885d[_0x3350('0xf')]){if(_0x1a885d[_0x3350('0xf')][_0x3350('0x10')]===0x1f4){logger[_0x3350('0xf')](_0x3350('0x11'),_0x2db877,_0x1a885d['error'][_0x3350('0x12')]);return _0x1f8741(_0x1a885d[_0x3350('0xf')]['message']);}logger['error'](_0x3350('0x11'),_0x2db877,_0x1a885d[_0x3350('0xf')][_0x3350('0x12')]);return _0x595515(_0x1a885d[_0x3350('0xf')]['message']);}else{logger['info'](_0x3350('0x11'),_0x2db877,_0x3350('0xb'));_0x595515(_0x1a885d[_0x3350('0x13')][_0x3350('0x12')]);}})['catch'](function(_0x8f4ce3){logger[_0x3350('0xf')]('Trunk,\x20%s,\x20%s',_0x2db877,_0x8f4ce3);_0x1f8741(_0x8f4ce3);});});}exports['GetTrunk']=function(_0x442fdd){var _0x5e6837=this;return new Promise(function(_0xe206c8,_0x39838){return db[_0x3350('0x14')][_0x3350('0x15')]({'raw':_0x442fdd['options']?_0x442fdd[_0x3350('0x16')][_0x3350('0x17')]===undefined?!![]:![]:!![],'where':_0x442fdd[_0x3350('0x16')]?_0x442fdd['options'][_0x3350('0x18')]||null:null,'attributes':_0x442fdd[_0x3350('0x16')]?_0x442fdd['options']['attributes']||null:null,'limit':_0x442fdd[_0x3350('0x16')]?_0x442fdd[_0x3350('0x16')][_0x3350('0x19')]||null:null,'include':_0x442fdd[_0x3350('0x16')]?_0x442fdd['options'][_0x3350('0x1a')]?_[_0x3350('0x1b')](_0x442fdd[_0x3350('0x16')][_0x3350('0x1a')],function(_0x526812){return{'model':db[_0x526812[_0x3350('0x1c')]],'as':_0x526812['as'],'attributes':_0x526812['attributes'],'include':_0x526812[_0x3350('0x1a')]?_['map'](_0x526812['include'],function(_0x522e26){return{'model':db[_0x522e26[_0x3350('0x1c')]],'as':_0x522e26['as'],'attributes':_0x522e26[_0x3350('0x1d')],'include':_0x522e26[_0x3350('0x1a')]?_['map'](_0x522e26[_0x3350('0x1a')],function(_0xde3b4b){return{'model':db[_0xde3b4b[_0x3350('0x1c')]],'as':_0xde3b4b['as'],'attributes':_0xde3b4b[_0x3350('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3350('0x9')](function(_0x433fca){logger[_0x3350('0xa')](_0x3350('0x1e'),_0x442fdd);logger[_0x3350('0xc')](_0x3350('0x1e'),_0x442fdd,JSON[_0x3350('0xe')](_0x433fca));_0xe206c8(_0x433fca);})[_0x3350('0x1f')](function(_0x5d6300){logger['error'](_0x3350('0x1e'),_0x5d6300[_0x3350('0x12')],_0x442fdd);_0x39838(_0x5e6837[_0x3350('0xf')](0x1f4,_0x5d6300['message']));});});};exports[_0x3350('0x20')]=function(_0x345ba6){var _0x5b2d8e=this;return new Promise(function(_0x417ffb,_0xaf96c3){return db[_0x3350('0x14')][_0x3350('0x21')]({'raw':_0x345ba6[_0x3350('0x16')]?_0x345ba6[_0x3350('0x16')][_0x3350('0x17')]===undefined?!![]:![]:!![],'where':_0x345ba6['options']?_0x345ba6['options'][_0x3350('0x18')]||null:null,'attributes':_0x345ba6[_0x3350('0x16')]?_0x345ba6[_0x3350('0x16')]['attributes']||null:null,'include':_0x345ba6[_0x3350('0x16')]?_0x345ba6['options'][_0x3350('0x1a')]?_[_0x3350('0x1b')](_0x345ba6[_0x3350('0x16')][_0x3350('0x1a')],function(_0x2a6367){return{'model':db[_0x2a6367['model']],'as':_0x2a6367['as'],'attributes':_0x2a6367[_0x3350('0x1d')],'include':_0x2a6367[_0x3350('0x1a')]?_[_0x3350('0x1b')](_0x2a6367['include'],function(_0x35aeb4){return{'model':db[_0x35aeb4[_0x3350('0x1c')]],'as':_0x35aeb4['as'],'attributes':_0x35aeb4['attributes'],'include':_0x35aeb4[_0x3350('0x1a')]?_[_0x3350('0x1b')](_0x35aeb4['include'],function(_0xeeb7ed){return{'model':db[_0xeeb7ed[_0x3350('0x1c')]],'as':_0xeeb7ed['as'],'attributes':_0xeeb7ed[_0x3350('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3350('0x9')](function(_0xd9b298){logger[_0x3350('0xa')](_0x3350('0x20'),_0x345ba6);logger[_0x3350('0xc')](_0x3350('0x20'),_0x345ba6,JSON['stringify'](_0xd9b298));_0x417ffb(_0xd9b298);})[_0x3350('0x1f')](function(_0x4ef11e){logger[_0x3350('0xf')](_0x3350('0x20'),_0x4ef11e[_0x3350('0x12')],_0x345ba6);_0xaf96c3(_0x5b2d8e[_0x3350('0xf')](0x1f4,_0x4ef11e[_0x3350('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 9cc4f15..a555e00 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 _0xbf7b=['/:id/pause','pause','unpause','/:id/chat_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','addWhatsappInteractions','addFaxAccounts','/:id/mail_accounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','/:id/square_projects','createApiKey','put','update','changePassword','delete','removeQueues','/:id','destroy','removeChatInteractions','/:id/mail_interactions','removeMailInteractions','/:id/fax_interactions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeSmsAccounts','removeChatWebsites','/:id/whatsapp_accounts','removeWhatsappAccounts','removeSquareProjects','removeApiKey','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./user.controller','get','index','describe','/whoami','isAuthenticated','whoami','/presence','getPresence','show','/:id/avatar','getAvatar','/:id/contacts','/:id/queues','/:id/queues_rt','getVoiceQueuesRt','/: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','/:id/whatsapp/interactions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','getMailAccounts','/:id/openchannel_accounts','/:id/sms_accounts','/:id/chat_websites','getChatWebsites','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','addContacts','create','/create_many','bulkCreate','addQueues','diskStorage','join','root','server/files/images/','format','%s-%s','now','originalname','single','file','addAvatar','/:id/login','login','/:id/logout','logout'];(function(_0x1a58b3,_0x2e191e){var _0xc153b3=function(_0x2fd92e){while(--_0x2fd92e){_0x1a58b3['push'](_0x1a58b3['shift']());}};_0xc153b3(++_0x2e191e);}(_0xbf7b,0x1f1));var _0xbbf7=function(_0x2b8473,_0x3bc93c){_0x2b8473=_0x2b8473-0x0;var _0x302c7c=_0xbf7b[_0x2b8473];return _0x302c7c;};'use strict';var multer=require(_0xbbf7('0x0'));var util=require(_0xbbf7('0x1'));var path=require(_0xbbf7('0x2'));var timeout=require(_0xbbf7('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xbbf7('0x4'));var auth=require(_0xbbf7('0x5'));var interaction=require(_0xbbf7('0x6'));var config=require('../../config/environment');var controller=require(_0xbbf7('0x7'));router[_0xbbf7('0x8')]('/',auth['isAuthenticated'](),controller[_0xbbf7('0x9')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xbbf7('0xa')]);router[_0xbbf7('0x8')](_0xbbf7('0xb'),auth[_0xbbf7('0xc')](),controller[_0xbbf7('0xd')]);router[_0xbbf7('0x8')](_0xbbf7('0xe'),auth[_0xbbf7('0xc')](),controller[_0xbbf7('0xf')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xbbf7('0x10')]);router[_0xbbf7('0x8')](_0xbbf7('0x11'),controller[_0xbbf7('0x12')]);router[_0xbbf7('0x8')]('/:id/open_tabs',auth[_0xbbf7('0xc')](),controller['getOpenTabs']);router['get'](_0xbbf7('0x13'),auth[_0xbbf7('0xc')](),controller['getContacts']);router[_0xbbf7('0x8')](_0xbbf7('0x14'),auth[_0xbbf7('0xc')](),controller['getQueues']);router[_0xbbf7('0x8')](_0xbbf7('0x15'),auth[_0xbbf7('0xc')](),controller[_0xbbf7('0x16')]);router[_0xbbf7('0x8')](_0xbbf7('0x17'),auth['isAuthenticated'](),controller[_0xbbf7('0x18')]);router['get'](_0xbbf7('0x19'),auth[_0xbbf7('0xc')](),controller[_0xbbf7('0x1a')]);router[_0xbbf7('0x8')](_0xbbf7('0x1b'),auth[_0xbbf7('0xc')](),controller[_0xbbf7('0x1c')]);router['get'](_0xbbf7('0x1d'),auth[_0xbbf7('0xc')](),controller['getChatInteractions']);router[_0xbbf7('0x8')](_0xbbf7('0x1e'),auth[_0xbbf7('0xc')](),controller[_0xbbf7('0x1f')]);router[_0xbbf7('0x8')](_0xbbf7('0x20'),auth['isAuthenticated'](),controller[_0xbbf7('0x21')]);router[_0xbbf7('0x8')](_0xbbf7('0x22'),auth[_0xbbf7('0xc')](),controller[_0xbbf7('0x23')]);router[_0xbbf7('0x8')](_0xbbf7('0x24'),auth[_0xbbf7('0xc')](),controller['getFaxInteractions']);router['get'](_0xbbf7('0x25'),auth[_0xbbf7('0xc')](),controller['getWhatsappInteractions']);router['get'](_0xbbf7('0x26'),auth[_0xbbf7('0xc')](),controller[_0xbbf7('0x27')]);router['get'](_0xbbf7('0x28'),auth[_0xbbf7('0xc')](),controller[_0xbbf7('0x29')]);router['get'](_0xbbf7('0x2a'),auth[_0xbbf7('0xc')](),controller['getAgents']);router[_0xbbf7('0x8')](_0xbbf7('0x2b'),auth[_0xbbf7('0xc')](),controller[_0xbbf7('0x2c')]);router[_0xbbf7('0x8')](_0xbbf7('0x2d'),auth[_0xbbf7('0xc')](),controller[_0xbbf7('0x2e')]);router[_0xbbf7('0x8')]('/:id/mail_accounts',auth[_0xbbf7('0xc')](),controller[_0xbbf7('0x2f')]);router[_0xbbf7('0x8')](_0xbbf7('0x30'),auth[_0xbbf7('0xc')](),controller['getOpenchannelAccounts']);router[_0xbbf7('0x8')](_0xbbf7('0x31'),auth['isAuthenticated'](),controller['getSmsAccounts']);router[_0xbbf7('0x8')](_0xbbf7('0x32'),auth[_0xbbf7('0xc')](),controller[_0xbbf7('0x33')]);router[_0xbbf7('0x8')]('/:id/whatsapp_accounts',auth[_0xbbf7('0xc')](),controller['getWhatsappAccounts']);router[_0xbbf7('0x8')]('/:id/square_projects',auth[_0xbbf7('0xc')](),controller[_0xbbf7('0x34')]);router['get'](_0xbbf7('0x35'),auth[_0xbbf7('0xc')](),controller[_0xbbf7('0x36')]);router[_0xbbf7('0x8')](_0xbbf7('0x37'),auth[_0xbbf7('0xc')](),controller[_0xbbf7('0x38')]);router[_0xbbf7('0x39')]('/:id/contacts',auth['isAuthenticated'](),controller[_0xbbf7('0x3a')]);router[_0xbbf7('0x39')]('/',auth[_0xbbf7('0xc')](),controller[_0xbbf7('0x3b')]);router[_0xbbf7('0x39')](_0xbbf7('0x3c'),auth[_0xbbf7('0xc')](),controller[_0xbbf7('0x3d')]);router['post']('/:id/queues',auth[_0xbbf7('0xc')](),controller[_0xbbf7('0x3e')]);var upload=multer({'storage':multer[_0xbbf7('0x3f')]({'destination':function(_0x8ee238,_0x1e040c,_0x4abdd9){_0x4abdd9(null,path[_0xbbf7('0x40')](config[_0xbbf7('0x41')],_0xbbf7('0x42')));},'filename':function(_0x3703bd,_0x5af1ed,_0x28891a){_0x28891a(null,util[_0xbbf7('0x43')](_0xbbf7('0x44'),Date[_0xbbf7('0x45')](),_0x5af1ed[_0xbbf7('0x46')]));}})});router[_0xbbf7('0x39')]('/:id/avatar',upload[_0xbbf7('0x47')](_0xbbf7('0x48')),controller[_0xbbf7('0x49')]);router[_0xbbf7('0x39')](_0xbbf7('0x4a'),auth[_0xbbf7('0xc')](),controller[_0xbbf7('0x4b')]);router[_0xbbf7('0x39')](_0xbbf7('0x4c'),auth[_0xbbf7('0xc')](),controller[_0xbbf7('0x4d')]);router[_0xbbf7('0x39')](_0xbbf7('0x4e'),auth[_0xbbf7('0xc')](),controller[_0xbbf7('0x4f')]);router[_0xbbf7('0x39')]('/:id/unpause',auth[_0xbbf7('0xc')](),controller[_0xbbf7('0x50')]);router['post']('/:id/teams',auth[_0xbbf7('0xc')](),controller['addTeams']);router[_0xbbf7('0x39')](_0xbbf7('0x51'),auth['isAuthenticated'](),controller['addChatInteractions']);router['post']('/:id/mail_interactions',auth[_0xbbf7('0xc')](),controller['addMailInteractions']);router[_0xbbf7('0x39')]('/:id/fax_interactions',auth['isAuthenticated'](),controller[_0xbbf7('0x52')]);router['post'](_0xbbf7('0x53'),auth[_0xbbf7('0xc')](),controller[_0xbbf7('0x54')]);router[_0xbbf7('0x39')]('/:id/openchannel_interactions',auth[_0xbbf7('0xc')](),controller['addOpenchannelInteractions']);router[_0xbbf7('0x39')]('/:id/whatsapp_interactions',auth[_0xbbf7('0xc')](),controller[_0xbbf7('0x55')]);router[_0xbbf7('0x39')]('/:id/fax_accounts',auth[_0xbbf7('0xc')](),controller[_0xbbf7('0x56')]);router[_0xbbf7('0x39')](_0xbbf7('0x57'),auth['isAuthenticated'](),controller['addMailAccounts']);router[_0xbbf7('0x39')](_0xbbf7('0x30'),auth[_0xbbf7('0xc')](),controller[_0xbbf7('0x58')]);router['post']('/:id/sms_accounts',auth[_0xbbf7('0xc')](),controller[_0xbbf7('0x59')]);router['post'](_0xbbf7('0x32'),auth['isAuthenticated'](),controller[_0xbbf7('0x5a')]);router['post']('/:id/whatsapp_accounts',auth[_0xbbf7('0xc')](),controller[_0xbbf7('0x5b')]);router[_0xbbf7('0x39')](_0xbbf7('0x5c'),auth['isAuthenticated'](),controller['addSquareProjects']);router[_0xbbf7('0x39')](_0xbbf7('0x37'),auth[_0xbbf7('0xc')](),controller[_0xbbf7('0x5d')]);router[_0xbbf7('0x5e')]('/:id',auth['isAuthenticated'](),controller[_0xbbf7('0x5f')]);router[_0xbbf7('0x5e')]('/:id/password',auth['isAuthenticated'](),controller[_0xbbf7('0x60')]);router[_0xbbf7('0x61')](_0xbbf7('0x14'),auth[_0xbbf7('0xc')](),controller[_0xbbf7('0x62')]);router[_0xbbf7('0x61')]('/:id/teams',auth[_0xbbf7('0xc')](),controller['removeTeams']);router[_0xbbf7('0x61')](_0xbbf7('0x63'),auth[_0xbbf7('0xc')](),controller[_0xbbf7('0x64')]);router['delete']('/:id/chat_interactions',auth[_0xbbf7('0xc')](),controller[_0xbbf7('0x65')]);router[_0xbbf7('0x61')](_0xbbf7('0x66'),auth[_0xbbf7('0xc')](),controller[_0xbbf7('0x67')]);router[_0xbbf7('0x61')](_0xbbf7('0x68'),auth[_0xbbf7('0xc')](),controller['removeFaxInteractions']);router['delete'](_0xbbf7('0x53'),auth[_0xbbf7('0xc')](),controller['removeSmsInteractions']);router[_0xbbf7('0x61')]('/:id/openchannel_interactions',auth[_0xbbf7('0xc')](),controller['removeOpenchannelInteractions']);router['delete']('/:id/whatsapp_interactions',auth[_0xbbf7('0xc')](),controller[_0xbbf7('0x69')]);router[_0xbbf7('0x61')](_0xbbf7('0x2d'),auth['isAuthenticated'](),controller[_0xbbf7('0x6a')]);router[_0xbbf7('0x61')](_0xbbf7('0x57'),auth[_0xbbf7('0xc')](),controller[_0xbbf7('0x6b')]);router[_0xbbf7('0x61')]('/:id/openchannel_accounts',auth[_0xbbf7('0xc')](),controller['removeOpenchannelAccounts']);router[_0xbbf7('0x61')](_0xbbf7('0x31'),auth[_0xbbf7('0xc')](),controller[_0xbbf7('0x6c')]);router['delete']('/:id/chat_websites',auth[_0xbbf7('0xc')](),controller[_0xbbf7('0x6d')]);router[_0xbbf7('0x61')](_0xbbf7('0x6e'),auth[_0xbbf7('0xc')](),controller[_0xbbf7('0x6f')]);router[_0xbbf7('0x61')]('/:id/square_projects',auth[_0xbbf7('0xc')](),controller[_0xbbf7('0x70')]);router[_0xbbf7('0x61')](_0xbbf7('0x37'),auth[_0xbbf7('0xc')](),controller[_0xbbf7('0x71')]);module[_0xbbf7('0x72')]=router; \ No newline at end of file +var _0xefc4=['exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/whoami','/presence','getPresence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','/:id/contacts','getContacts','getVoiceQueuesRt','/:id/groups','getGroups','getRecordings','/:id/screen_recordings','/:id/chat/interactions','getChatInteractions','getOpenchannelInteractions','getMailInteractions','/:id/sms/interactions','getFaxInteractions','/:id/teams','getTeams','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','/:id/api_key','getApiKey','addContacts','post','create','/create_many','bulkCreate','/:id/queues','addQueues','diskStorage','server/files/images/','format','%s-%s','now','originalname','single','file','addAvatar','/:id/login','/:id/logout','logout','/:id/pause','/:id/unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','addOpenchannelInteractions','/:id/fax_accounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addWhatsappAccounts','addSquareProjects','createApiKey','put','changePassword','delete','destroy','removeMailInteractions','removeSmsInteractions','/:id/openchannel_interactions','removeOpenchannelInteractions','/:id/whatsapp_interactions','removeWhatsappInteractions','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','/:id/chat_websites','removeChatWebsites','removeSquareProjects','removeApiKey'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0xefc4,0xdd));var _0x4efc=function(_0x1e500e,_0x2c9d74){_0x1e500e=_0x1e500e-0x0;var _0x10dc5e=_0xefc4[_0x1e500e];return _0x10dc5e;};'use strict';var multer=require(_0x4efc('0x0'));var util=require(_0x4efc('0x1'));var path=require(_0x4efc('0x2'));var timeout=require('connect-timeout');var express=require(_0x4efc('0x3'));var router=express[_0x4efc('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4efc('0x5'));var interaction=require(_0x4efc('0x6'));var config=require(_0x4efc('0x7'));var controller=require('./user.controller');router[_0x4efc('0x8')]('/',auth[_0x4efc('0x9')](),controller[_0x4efc('0xa')]);router['get'](_0x4efc('0xb'),auth[_0x4efc('0x9')](),controller['describe']);router[_0x4efc('0x8')](_0x4efc('0xc'),auth[_0x4efc('0x9')](),controller['whoami']);router[_0x4efc('0x8')](_0x4efc('0xd'),auth[_0x4efc('0x9')](),controller[_0x4efc('0xe')]);router['get'](_0x4efc('0xf'),auth[_0x4efc('0x9')](),controller[_0x4efc('0x10')]);router[_0x4efc('0x8')](_0x4efc('0x11'),controller[_0x4efc('0x12')]);router[_0x4efc('0x8')](_0x4efc('0x13'),auth['isAuthenticated'](),controller['getOpenTabs']);router[_0x4efc('0x8')](_0x4efc('0x14'),auth[_0x4efc('0x9')](),controller[_0x4efc('0x15')]);router[_0x4efc('0x8')]('/:id/queues',auth[_0x4efc('0x9')](),controller['getQueues']);router[_0x4efc('0x8')]('/:id/queues_rt',auth[_0x4efc('0x9')](),controller[_0x4efc('0x16')]);router[_0x4efc('0x8')](_0x4efc('0x17'),auth[_0x4efc('0x9')](),controller[_0x4efc('0x18')]);router[_0x4efc('0x8')]('/:id/recordings',auth[_0x4efc('0x9')](),controller[_0x4efc('0x19')]);router['get'](_0x4efc('0x1a'),auth[_0x4efc('0x9')](),controller['getScreenRecordings']);router[_0x4efc('0x8')](_0x4efc('0x1b'),auth[_0x4efc('0x9')](),controller[_0x4efc('0x1c')]);router[_0x4efc('0x8')]('/:id/openchannel/interactions',auth[_0x4efc('0x9')](),controller[_0x4efc('0x1d')]);router[_0x4efc('0x8')]('/:id/mail/interactions',auth[_0x4efc('0x9')](),controller[_0x4efc('0x1e')]);router['get'](_0x4efc('0x1f'),auth[_0x4efc('0x9')](),controller['getSmsInteractions']);router[_0x4efc('0x8')]('/:id/fax/interactions',auth['isAuthenticated'](),controller[_0x4efc('0x20')]);router[_0x4efc('0x8')]('/:id/whatsapp/interactions',auth[_0x4efc('0x9')](),controller['getWhatsappInteractions']);router[_0x4efc('0x8')](_0x4efc('0x21'),auth[_0x4efc('0x9')](),controller[_0x4efc('0x22')]);router[_0x4efc('0x8')]('/:id/lists',auth[_0x4efc('0x9')](),controller[_0x4efc('0x23')]);router['get'](_0x4efc('0x24'),auth[_0x4efc('0x9')](),controller[_0x4efc('0x25')]);router[_0x4efc('0x8')](_0x4efc('0x26'),auth[_0x4efc('0x9')](),controller[_0x4efc('0x27')]);router[_0x4efc('0x8')]('/:id/fax_accounts',auth[_0x4efc('0x9')](),controller[_0x4efc('0x28')]);router[_0x4efc('0x8')](_0x4efc('0x29'),auth[_0x4efc('0x9')](),controller[_0x4efc('0x2a')]);router[_0x4efc('0x8')](_0x4efc('0x2b'),auth[_0x4efc('0x9')](),controller[_0x4efc('0x2c')]);router['get'](_0x4efc('0x2d'),auth['isAuthenticated'](),controller[_0x4efc('0x2e')]);router[_0x4efc('0x8')]('/:id/chat_websites',auth[_0x4efc('0x9')](),controller[_0x4efc('0x2f')]);router[_0x4efc('0x8')](_0x4efc('0x30'),auth[_0x4efc('0x9')](),controller[_0x4efc('0x31')]);router['get'](_0x4efc('0x32'),auth[_0x4efc('0x9')](),controller[_0x4efc('0x33')]);router[_0x4efc('0x8')](_0x4efc('0x34'),auth[_0x4efc('0x9')](),controller['getScheduledCalls']);router[_0x4efc('0x8')](_0x4efc('0x35'),auth[_0x4efc('0x9')](),controller[_0x4efc('0x36')]);router['post'](_0x4efc('0x14'),auth[_0x4efc('0x9')](),controller[_0x4efc('0x37')]);router[_0x4efc('0x38')]('/',auth[_0x4efc('0x9')](),controller[_0x4efc('0x39')]);router[_0x4efc('0x38')](_0x4efc('0x3a'),auth[_0x4efc('0x9')](),controller[_0x4efc('0x3b')]);router[_0x4efc('0x38')](_0x4efc('0x3c'),auth['isAuthenticated'](),controller[_0x4efc('0x3d')]);var upload=multer({'storage':multer[_0x4efc('0x3e')]({'destination':function(_0x5b358e,_0x29fab9,_0x45049e){_0x45049e(null,path['join'](config['root'],_0x4efc('0x3f')));},'filename':function(_0x1d0a8a,_0x344cbc,_0x2e4861){_0x2e4861(null,util[_0x4efc('0x40')](_0x4efc('0x41'),Date[_0x4efc('0x42')](),_0x344cbc[_0x4efc('0x43')]));}})});router[_0x4efc('0x38')](_0x4efc('0x11'),upload[_0x4efc('0x44')](_0x4efc('0x45')),controller[_0x4efc('0x46')]);router[_0x4efc('0x38')](_0x4efc('0x47'),auth[_0x4efc('0x9')](),controller['login']);router[_0x4efc('0x38')](_0x4efc('0x48'),auth[_0x4efc('0x9')](),controller[_0x4efc('0x49')]);router[_0x4efc('0x38')](_0x4efc('0x4a'),auth[_0x4efc('0x9')](),controller['pause']);router[_0x4efc('0x38')](_0x4efc('0x4b'),auth[_0x4efc('0x9')](),controller['unpause']);router[_0x4efc('0x38')](_0x4efc('0x21'),auth[_0x4efc('0x9')](),controller[_0x4efc('0x4c')]);router[_0x4efc('0x38')](_0x4efc('0x4d'),auth[_0x4efc('0x9')](),controller[_0x4efc('0x4e')]);router[_0x4efc('0x38')](_0x4efc('0x4f'),auth[_0x4efc('0x9')](),controller[_0x4efc('0x50')]);router['post']('/:id/fax_interactions',auth[_0x4efc('0x9')](),controller[_0x4efc('0x51')]);router[_0x4efc('0x38')](_0x4efc('0x52'),auth[_0x4efc('0x9')](),controller[_0x4efc('0x53')]);router[_0x4efc('0x38')]('/:id/openchannel_interactions',auth[_0x4efc('0x9')](),controller[_0x4efc('0x54')]);router[_0x4efc('0x38')]('/:id/whatsapp_interactions',auth['isAuthenticated'](),controller['addWhatsappInteractions']);router[_0x4efc('0x38')](_0x4efc('0x55'),auth[_0x4efc('0x9')](),controller['addFaxAccounts']);router[_0x4efc('0x38')](_0x4efc('0x29'),auth[_0x4efc('0x9')](),controller[_0x4efc('0x56')]);router['post'](_0x4efc('0x2b'),auth['isAuthenticated'](),controller[_0x4efc('0x57')]);router[_0x4efc('0x38')](_0x4efc('0x2d'),auth[_0x4efc('0x9')](),controller[_0x4efc('0x58')]);router['post']('/:id/chat_websites',auth[_0x4efc('0x9')](),controller['addChatWebsites']);router[_0x4efc('0x38')](_0x4efc('0x30'),auth[_0x4efc('0x9')](),controller[_0x4efc('0x59')]);router['post']('/:id/square_projects',auth[_0x4efc('0x9')](),controller[_0x4efc('0x5a')]);router[_0x4efc('0x38')](_0x4efc('0x35'),auth[_0x4efc('0x9')](),controller[_0x4efc('0x5b')]);router['put'](_0x4efc('0xf'),auth[_0x4efc('0x9')](),controller['update']);router[_0x4efc('0x5c')]('/:id/password',auth[_0x4efc('0x9')](),controller[_0x4efc('0x5d')]);router[_0x4efc('0x5e')](_0x4efc('0x3c'),auth['isAuthenticated'](),controller['removeQueues']);router[_0x4efc('0x5e')](_0x4efc('0x21'),auth['isAuthenticated'](),controller['removeTeams']);router[_0x4efc('0x5e')](_0x4efc('0xf'),auth[_0x4efc('0x9')](),controller[_0x4efc('0x5f')]);router[_0x4efc('0x5e')](_0x4efc('0x4d'),auth[_0x4efc('0x9')](),controller['removeChatInteractions']);router[_0x4efc('0x5e')](_0x4efc('0x4f'),auth['isAuthenticated'](),controller[_0x4efc('0x60')]);router[_0x4efc('0x5e')]('/:id/fax_interactions',auth[_0x4efc('0x9')](),controller['removeFaxInteractions']);router[_0x4efc('0x5e')](_0x4efc('0x52'),auth[_0x4efc('0x9')](),controller[_0x4efc('0x61')]);router['delete'](_0x4efc('0x62'),auth[_0x4efc('0x9')](),controller[_0x4efc('0x63')]);router[_0x4efc('0x5e')](_0x4efc('0x64'),auth[_0x4efc('0x9')](),controller[_0x4efc('0x65')]);router[_0x4efc('0x5e')](_0x4efc('0x55'),auth[_0x4efc('0x9')](),controller['removeFaxAccounts']);router[_0x4efc('0x5e')](_0x4efc('0x29'),auth['isAuthenticated'](),controller[_0x4efc('0x66')]);router[_0x4efc('0x5e')](_0x4efc('0x2b'),auth['isAuthenticated'](),controller[_0x4efc('0x67')]);router[_0x4efc('0x5e')](_0x4efc('0x2d'),auth[_0x4efc('0x9')](),controller[_0x4efc('0x68')]);router['delete'](_0x4efc('0x69'),auth['isAuthenticated'](),controller[_0x4efc('0x6a')]);router[_0x4efc('0x5e')](_0x4efc('0x30'),auth['isAuthenticated'](),controller['removeWhatsappAccounts']);router['delete']('/:id/square_projects',auth[_0x4efc('0x9')](),controller[_0x4efc('0x6b')]);router[_0x4efc('0x5e')](_0x4efc('0x35'),auth[_0x4efc('0x9')](),controller[_0x4efc('0x6c')]);module[_0x4efc('0x6d')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 2a0cef7..4bff393 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 _0xb073=['isArray','encryption','avpf','force_avp','dtlsenable','dtlsverify','dtlscertfile','dtlsprivatekey','icesupport','dtlssetup','/etc/pki/tls/private/motion.key','TEXT','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','blockedAt','UNSIGNED','moment','lodash','exports','STRING','setDataValue','name','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','getDataValue','internal','email','toLowerCase','ENUM','admin','telephone','INTEGER','accountcode','format','\x22%s\x22\x20<%s>','DATE','BOOLEAN','DEFAULT\x20PAUSE','dynamic','friend','user','peer','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','udp','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','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','never','\x22\x22\x20<>','always','accept','refuse','uac','uas','fingerprint','active','passive','actpass','update','update,nonat','showWebBar','get'];(function(_0x5837d1,_0x4661e0){var _0x43b3b7=function(_0x22c638){while(--_0x22c638){_0x5837d1['push'](_0x5837d1['shift']());}};_0x43b3b7(++_0x4661e0);}(_0xb073,0x187));var _0x3b07=function(_0x2f96a1,_0x42cc63){_0x2f96a1=_0x2f96a1-0x0;var _0x330a43=_0xb073[_0x2f96a1];return _0x330a43;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x3b07('0x0'));var util=require('util');var _=require(_0x3b07('0x1'));module[_0x3b07('0x2')]={'name':{'type':Sequelize[_0x3b07('0x3')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x3d1733){this[_0x3b07('0x4')](_0x3b07('0x5'),_0x3d1733);this['setDataValue'](_0x3b07('0x6'),_0x3d1733);},'comment':_0x3b07('0x7')},'fullname':{'type':Sequelize[_0x3b07('0x3')],'allowNull':![],'set':function(_0x2c1ac2){this[_0x3b07('0x4')](_0x3b07('0x8'),_0x2c1ac2);this[_0x3b07('0x4')](_0x3b07('0x9'),util['format']('\x22%s\x22\x20<%s>',_0x2c1ac2,this[_0x3b07('0xa')](_0x3b07('0xb'))));}},'alias':{'type':Sequelize[_0x3b07('0x3')]},'email':{'type':Sequelize[_0x3b07('0x3')],'allowNull':![],'unique':_0x3b07('0xc'),'validate':{'isEmail':!![]},'set':function(_0x1ba4b9){if(_0x1ba4b9){this[_0x3b07('0x4')](_0x3b07('0xc'),_0x1ba4b9[_0x3b07('0xd')]());}}},'role':{'type':Sequelize[_0x3b07('0xe')](_0x3b07('0xf'),'user','agent',_0x3b07('0x10')),'allowNull':![]},'password':{'type':Sequelize[_0x3b07('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x3b07('0x3')],'defaultValue':'local'},'internal':{'type':Sequelize[_0x3b07('0x11')](0xb),'allowNull':![],'unique':'internal','set':function(_0x16c296){this[_0x3b07('0x4')](_0x3b07('0xb'),_0x16c296);this[_0x3b07('0x4')](_0x3b07('0x12'),_0x16c296);this[_0x3b07('0x4')](_0x3b07('0x9'),util[_0x3b07('0x13')](_0x3b07('0x14'),this[_0x3b07('0xa')]('fullname'),_0x16c296));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x3b07('0x3')]},'address':{'type':Sequelize[_0x3b07('0x3')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x3b07('0x3')]},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x3b07('0x15')]},'voicePause':{'type':Sequelize[_0x3b07('0x16')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x3b07('0x16')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x3b07('0x16')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x3b07('0x16')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x3b07('0x16')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x3b07('0x16')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x3b07('0x16')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x3b07('0x3')],'defaultValue':_0x3b07('0x17')},'lastPauseAt':{'type':Sequelize[_0x3b07('0x15')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x3b07('0x11')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x3b07('0x11')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x3b07('0x11')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x3b07('0x16')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x3b07('0x11')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x3b07('0x11')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x3b07('0x11')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x3b07('0x16')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x3b07('0x3')],'allowNull':!![]},'host':{'type':Sequelize[_0x3b07('0x3')],'allowNull':!![],'defaultValue':_0x3b07('0x18')},'ipaddr':{'type':Sequelize[_0x3b07('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x3b07('0x11')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x3b07('0x11')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x3b07('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x3b07('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x3b07('0x11')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x3b07('0xe')](_0x3b07('0x19'),_0x3b07('0x1a'),_0x3b07('0x1b')),'allowNull':!![],'defaultValue':'friend'},'context':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize['ENUM'](_0x3b07('0x1c'),_0x3b07('0x1d'),_0x3b07('0x1e'),_0x3b07('0x1f'),_0x3b07('0x20'),_0x3b07('0x21'),'PROHIB_FAILED_SCREEN','PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x3b07('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0x3b07('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x3b07('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x3b07('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0x3b07('0x3')],'allowNull':!![],'defaultValue':_0x3b07('0x22'),'set':function(_0x2b99ba){this['setDataValue'](_0x3b07('0x23'),_0x2b99ba?_0x2b99ba[_0x3b07('0x24')](','):null);},'get':function(){return this[_0x3b07('0xa')](_0x3b07('0x23'))?this['getDataValue'](_0x3b07('0x23'))[_0x3b07('0x25')](','):null;},'comment':_0x3b07('0x26')},'dtmfmode':{'type':Sequelize[_0x3b07('0xe')](_0x3b07('0x27'),_0x3b07('0x28'),_0x3b07('0x29'),_0x3b07('0x2a'),_0x3b07('0x2b')),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x3b07('0xe')](_0x3b07('0x2c'),'no',_0x3b07('0x2d'),'update','outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x3b07('0xe')](_0x3b07('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x3b07('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x3b07('0x3')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x3b07('0x2e'),'set':function(_0x1c47b7){this[_0x3b07('0x4')]('nat',_0x1c47b7?_0x1c47b7[_0x3b07('0x24')](','):null);},'get':function(){return this['getDataValue'](_0x3b07('0x2f'))?this[_0x3b07('0xa')](_0x3b07('0x2f'))[_0x3b07('0x25')](','):null;},'comment':_0x3b07('0x30')},'callgroup':{'type':Sequelize[_0x3b07('0x3')]},'namedcallgroup':{'type':Sequelize[_0x3b07('0x3')]},'pickupgroup':{'type':Sequelize[_0x3b07('0x3')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x3b07('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x3b07('0x3')]},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3b07('0x31')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x447ec7){this[_0x3b07('0x4')]('allow',_0x447ec7?_0x447ec7[_0x3b07('0x24')](';'):_0x3b07('0x32'));},'get':function(){return this[_0x3b07('0xa')](_0x3b07('0x33'))?this[_0x3b07('0xa')](_0x3b07('0x33'))[_0x3b07('0x25')](';'):null;},'comment':_0x3b07('0x34')},'autoframing':{'type':Sequelize[_0x3b07('0xe')](_0x3b07('0x2c'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize['STRING'],'allowNull':!![],'set':function(_0x528c6e){this[_0x3b07('0x4')](_0x3b07('0x35'),_0x528c6e?_0x528c6e[_0x3b07('0x24')](','):null);},'get':function(){return this['getDataValue'](_0x3b07('0x35'))?this[_0x3b07('0xa')](_0x3b07('0x35'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize['ENUM'](_0x3b07('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x3b07('0xe')](_0x3b07('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x3b07('0xe')](_0x3b07('0x2c'),'no',_0x3b07('0x36')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x3b07('0xe')](_0x3b07('0x2c'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x3b07('0xe')]('yes','no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x3b07('0x11')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x3b07('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x3b07('0x3')],'allowNull':!![],'defaultValue':_0x3b07('0x37')},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x3b07('0xe')](_0x3b07('0x2c'),'no'),'allowNull':!![],'defaultValue':_0x3b07('0x2c')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x3b07('0xe')]('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x3b07('0xe')](_0x3b07('0x2c'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM'](_0x3b07('0x2c'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x3b07('0xe')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x3b07('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x3b07('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x3b07('0xe')](_0x3b07('0x2c'),'no',_0x3b07('0x38')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x3b07('0xe')]('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x3b07('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x3b07('0xe')](_0x3b07('0x39'),_0x3b07('0x3a'),'originate'),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x3b07('0x11')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM'](_0x3b07('0x3b'),'uas'),'allowNull':!![],'defaultValue':_0x3b07('0x3c')},'t38pt_usertpsource':{'type':Sequelize[_0x3b07('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x3b07('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x3b07('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize[_0x3b07('0xe')](_0x3b07('0x2c'),'no'),'allowNull':!![],'defaultValue':_0x3b07('0x2c')},'keepalive':{'type':Sequelize[_0x3b07('0x11')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x3b07('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x3b07('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x3b07('0x11')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x3b07('0x11')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x3b07('0xe')](_0x3b07('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x3b07('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x3b07('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x3b07('0x11')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x3b07('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x3b07('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x3b07('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x3b07('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x3b07('0x11')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x3b07('0xe')](_0x3b07('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x3b07('0xe')](_0x3b07('0x2c'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x3b07('0xe')](_0x3b07('0x2c'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x3b07('0xe')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x3b07('0xe')](_0x3b07('0x2c'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x3b07('0xe')](_0x3b07('0x2c'),'no',_0x3b07('0x3d'),'certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x3b07('0x11')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x3b07('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x3b07('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x3b07('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize['ENUM'](_0x3b07('0x3e'),_0x3b07('0x3f'),_0x3b07('0x40')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x3b07('0xe')](_0x3b07('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x3b07('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x3b07('0xe')](_0x3b07('0x2c'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x3b07('0xe')](_0x3b07('0x2c'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x3b07('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x3b07('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x3b07('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x3b07('0xe')](_0x3b07('0x2c'),'no','nonat',_0x3b07('0x41'),_0x3b07('0x42')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x3b07('0x16')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x3b07('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0x3b07('0x15')]},'passwordResetAt':{'type':Sequelize[_0x3b07('0x15')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize[_0x3b07('0x11')],'defaultValue':0x0,'set':function(_0x5d18ef){this[_0x3b07('0x4')](_0x3b07('0x43'),_0x5d18ef);var _0x4d12e1=this[_0x3b07('0x44')]({'plain':!![]});switch(_0x5d18ef){case 0x0:case 0x1:var _0x2cb01f=_0x4d12e1[_0x3b07('0x23')]?_[_0x3b07('0x45')](_0x4d12e1['transport'])?_0x4d12e1['transport']['join']():_0x4d12e1[_0x3b07('0x23')]:_0x3b07('0x22');if(_0x2cb01f==='wss'){_0x2cb01f=_0x3b07('0x22');}this[_0x3b07('0x4')](_0x3b07('0x23'),_0x2cb01f);this[_0x3b07('0x4')](_0x3b07('0x46'),'no');this[_0x3b07('0x4')](_0x3b07('0x47'),null);this['setDataValue'](_0x3b07('0x48'),null);this[_0x3b07('0x4')]('icesupport',null);this[_0x3b07('0x4')](_0x3b07('0x49'),null);this[_0x3b07('0x4')](_0x3b07('0x4a'),null);this[_0x3b07('0x4')]('dtlssetup',null);this[_0x3b07('0x4')](_0x3b07('0x4b'),null);this['setDataValue'](_0x3b07('0x4c'),null);this[_0x3b07('0x4')]('rtcp_mux','no');break;case 0x2:this['setDataValue'](_0x3b07('0x23'),'wss');this[_0x3b07('0x4')](_0x3b07('0x46'),_0x3b07('0x2c'));this[_0x3b07('0x4')](_0x3b07('0x47'),_0x3b07('0x2c'));this['setDataValue']('force_avp',_0x3b07('0x2c'));this['setDataValue'](_0x3b07('0x4d'),_0x3b07('0x2c'));this[_0x3b07('0x4')]('dtlsenable','yes');this[_0x3b07('0x4')](_0x3b07('0x4a'),'no');this[_0x3b07('0x4')](_0x3b07('0x4e'),'actpass');this[_0x3b07('0x4')](_0x3b07('0x4b'),_0x4d12e1['dtlscertfile']||'/etc/pki/tls/certs/motion.crt');this[_0x3b07('0x4')](_0x3b07('0x4c'),_0x4d12e1['dtlsprivatekey']||_0x3b07('0x4f'));this[_0x3b07('0x4')]('rtcp_mux',_0x3b07('0x2c'));break;default:}}},'permissions':{'type':Sequelize[_0x3b07('0x50')],'set':function(_0x45726a){this[_0x3b07('0x4')](_0x3b07('0x51'),_0x45726a?_0x45726a[_0x3b07('0x24')](','):[]);},'get':function(){return this['getDataValue'](_0x3b07('0x51'))?_[_0x3b07('0x52')](this[_0x3b07('0xa')](_0x3b07('0x51'))['split'](','),function(_0x3e8f0e){return parseInt(_0x3e8f0e,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x3b07('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x3b07('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x3b07('0x3')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x3b07('0x16')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x3b07('0x16')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x3b07('0x16')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x3b07('0xe')](_0x3b07('0x2c'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x3b07('0x16')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x3b07('0x3')]},'phoneBarEnableJaws':{'type':Sequelize[_0x3b07('0x16')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x3b07('0x16')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x3b07('0x53')],'get':function(){return this[_0x3b07('0xa')](_0x3b07('0x54'))?this[_0x3b07('0xa')](_0x3b07('0x54')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x3b07('0x16')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x3b07('0x16')],'defaultValue':![]},'interface':{'type':Sequelize[_0x3b07('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x3b07('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x3b07('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x3b07('0x16')],'defaultValue':![],'set':function(_0x12b572){if(typeof _0x12b572===_0x3b07('0x55')){var _0x59e622=_0x12b572==='1'?!![]:_0x12b572==='0'?![]:_0x12b572===_0x3b07('0x56')?!![]:_0x12b572===_0x3b07('0x57')?![]:![];this[_0x3b07('0x4')]('screenrecording',_0x59e622);}else{this[_0x3b07('0x4')](_0x3b07('0x58'),_0x12b572);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x5db046){this[_0x3b07('0x4')](_0x3b07('0x59'),_0x5db046);if(_0x5db046===!![]){this[_0x3b07('0x4')](_0x3b07('0x5a'),moment());this['setDataValue']('loginAttempts',0x0);}else{this['setDataValue']('blockedAt',null);}}},'blockedAt':{'type':Sequelize[_0x3b07('0x15')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x3b07('0x11')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x3b07('0x16')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x3b07('0x16')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x3b07('0x11')](0x5)[_0x3b07('0x5b')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x3b07('0x16')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x3b07('0x16')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x5f6f=['String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','auto','rfc2833','yes','nonat','outgoing','nat','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','always','accept','refuse','originate','uac','uas','fingerprint','certificate','active','passive','actpass','update','TEXT','wss','encryption','avpf','force_avp','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','icesupport','/etc/pki/tls/certs/motion.crt','rtcp_mux','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','screenrecording','blocked','loginAttempts','UNSIGNED','sequelize','moment','util','lodash','exports','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','STRING','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','email','toLowerCase','ENUM','admin','agent','local','INTEGER','internal','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','friend','user','from-sip','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','transport','join','split'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5f6f,0x1ef));var _0xf5f6=function(_0x3cd2c6,_0x33890a){_0x3cd2c6=_0x3cd2c6-0x0;var _0x407bdb=_0x5f6f[_0x3cd2c6];return _0x407bdb;};'use strict';var Sequelize=require(_0xf5f6('0x0'));var moment=require(_0xf5f6('0x1'));var util=require(_0xf5f6('0x2'));var _=require(_0xf5f6('0x3'));module[_0xf5f6('0x4')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xf5f6('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x438699){this[_0xf5f6('0x6')]('name',_0x438699);this[_0xf5f6('0x6')](_0xf5f6('0x7'),_0x438699);},'comment':_0xf5f6('0x8')},'fullname':{'type':Sequelize[_0xf5f6('0x9')],'allowNull':![],'set':function(_0x508c02){this['setDataValue'](_0xf5f6('0xa'),_0x508c02);this[_0xf5f6('0x6')](_0xf5f6('0xb'),util[_0xf5f6('0xc')](_0xf5f6('0xd'),_0x508c02,this[_0xf5f6('0xe')]('internal')));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xf5f6('0x9')],'allowNull':![],'unique':_0xf5f6('0xf'),'validate':{'isEmail':!![]},'set':function(_0x491c14){if(_0x491c14){this[_0xf5f6('0x6')](_0xf5f6('0xf'),_0x491c14[_0xf5f6('0x10')]());}}},'role':{'type':Sequelize[_0xf5f6('0x11')](_0xf5f6('0x12'),'user',_0xf5f6('0x13'),'telephone'),'allowNull':![]},'password':{'type':Sequelize[_0xf5f6('0x9')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xf5f6('0x9')],'defaultValue':_0xf5f6('0x14')},'internal':{'type':Sequelize[_0xf5f6('0x15')](0xb),'allowNull':![],'unique':'internal','set':function(_0x96661c){this[_0xf5f6('0x6')](_0xf5f6('0x16'),_0x96661c);this[_0xf5f6('0x6')]('accountcode',_0x96661c);this[_0xf5f6('0x6')](_0xf5f6('0xb'),util[_0xf5f6('0xc')](_0xf5f6('0xd'),this['getDataValue']('fullname'),_0x96661c));}},'salt':{'type':Sequelize[_0xf5f6('0x9')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0xf5f6('0x9')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize[_0xf5f6('0x9')]},'userpic':{'type':Sequelize[_0xf5f6('0x9')]},'city':{'type':Sequelize[_0xf5f6('0x9')]},'country':{'type':Sequelize[_0xf5f6('0x9')]},'online':{'type':Sequelize[_0xf5f6('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xf5f6('0x18')]},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xf5f6('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xf5f6('0x17')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xf5f6('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xf5f6('0x17')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xf5f6('0x17')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xf5f6('0x9')],'defaultValue':_0xf5f6('0x19')},'lastPauseAt':{'type':Sequelize[_0xf5f6('0x18')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xf5f6('0x15')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xf5f6('0x15')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xf5f6('0x15')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xf5f6('0x15')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xf5f6('0x15')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xf5f6('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xf5f6('0x15')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xf5f6('0x15')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xf5f6('0x15')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xf5f6('0x17')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xf5f6('0x17')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize[_0xf5f6('0x9')],'allowNull':!![],'defaultValue':_0xf5f6('0x1a')},'ipaddr':{'type':Sequelize[_0xf5f6('0x9')],'allowNull':!![]},'port':{'type':Sequelize[_0xf5f6('0x15')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xf5f6('0x9')],'allowNull':!![]},'regserver':{'type':Sequelize[_0xf5f6('0x9')],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize[_0xf5f6('0x15')](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM'](_0xf5f6('0x1b'),_0xf5f6('0x1c'),'peer'),'allowNull':!![],'defaultValue':_0xf5f6('0x1b')},'context':{'type':Sequelize[_0xf5f6('0x9')],'allowNull':!![],'defaultValue':_0xf5f6('0x1d')},'callingpres':{'type':Sequelize[_0xf5f6('0x11')]('ALLOWED_NOT_SCREENED',_0xf5f6('0x1e'),'ALLOWED_FAILED_SCREEN',_0xf5f6('0x1f'),_0xf5f6('0x20'),_0xf5f6('0x21'),_0xf5f6('0x22'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0xf5f6('0x9')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0xf5f6('0x9')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xf5f6('0x9')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize[_0xf5f6('0x9')],'allowNull':!![],'defaultValue':_0xf5f6('0x23'),'set':function(_0x13a87c){this[_0xf5f6('0x6')](_0xf5f6('0x24'),_0x13a87c?_0x13a87c[_0xf5f6('0x25')](','):null);},'get':function(){return this[_0xf5f6('0xe')]('transport')?this[_0xf5f6('0xe')]('transport')[_0xf5f6('0x26')](','):null;},'comment':_0xf5f6('0x27')},'dtmfmode':{'type':Sequelize['ENUM']('rfc2833',_0xf5f6('0x28'),_0xf5f6('0x29'),_0xf5f6('0x2a'),_0xf5f6('0x2b')),'allowNull':!![],'defaultValue':_0xf5f6('0x2c')},'directmedia':{'type':Sequelize[_0xf5f6('0x11')](_0xf5f6('0x2d'),'no',_0xf5f6('0x2e'),'update',_0xf5f6('0x2f')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xf5f6('0x11')](_0xf5f6('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize[_0xf5f6('0x9')],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0x518121){this[_0xf5f6('0x6')](_0xf5f6('0x30'),_0x518121?_0x518121[_0xf5f6('0x25')](','):null);},'get':function(){return this['getDataValue'](_0xf5f6('0x30'))?this[_0xf5f6('0xe')]('nat')[_0xf5f6('0x26')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0xf5f6('0x9')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xf5f6('0x9')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xf5f6('0x9')]},'disallow':{'type':Sequelize[_0xf5f6('0x9')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf5f6('0x31'),'set':function(_0x34ddd9){this[_0xf5f6('0x6')]('allow',_0x34ddd9?_0x34ddd9[_0xf5f6('0x25')](';'):_0xf5f6('0x31'));},'get':function(){return this[_0xf5f6('0xe')](_0xf5f6('0x32'))?this[_0xf5f6('0xe')](_0xf5f6('0x32'))[_0xf5f6('0x26')](';'):null;},'comment':_0xf5f6('0x33')},'autoframing':{'type':Sequelize[_0xf5f6('0x11')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xf5f6('0x9')],'allowNull':!![],'set':function(_0x392e33){this[_0xf5f6('0x6')](_0xf5f6('0x34'),_0x392e33?_0x392e33[_0xf5f6('0x25')](','):null);},'get':function(){return this[_0xf5f6('0xe')](_0xf5f6('0x34'))?this[_0xf5f6('0xe')](_0xf5f6('0x34'))[_0xf5f6('0x26')](','):null;},'comment':_0xf5f6('0x35')},'trustrpid':{'type':Sequelize['ENUM'](_0xf5f6('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xf5f6('0x11')](_0xf5f6('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0xf5f6('0x2d'),'no',_0xf5f6('0x36')),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM'](_0xf5f6('0x2d'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xf5f6('0x15')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xf5f6('0x9')],'allowNull':!![]},'callerid':{'type':Sequelize[_0xf5f6('0x9')],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0xf5f6('0x9')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xf5f6('0x11')](_0xf5f6('0x2d'),'no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0xf5f6('0x15')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM'](_0xf5f6('0x2d'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0xf5f6('0x2d'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xf5f6('0x11')](_0xf5f6('0x2d'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xf5f6('0x11')](_0xf5f6('0x2d'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xf5f6('0x11')]('yes','no',_0xf5f6('0x37')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xf5f6('0x15')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xf5f6('0x11')]('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xf5f6('0x9')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xf5f6('0x11')](_0xf5f6('0x38'),_0xf5f6('0x39'),_0xf5f6('0x3a')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xf5f6('0x15')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xf5f6('0x11')](_0xf5f6('0x3b'),'uas'),'allowNull':!![],'defaultValue':_0xf5f6('0x3c')},'t38pt_usertpsource':{'type':Sequelize[_0xf5f6('0x9')],'allowNull':!![]},'regexten':{'type':Sequelize[_0xf5f6('0x9')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xf5f6('0x9')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xf5f6('0x9')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xf5f6('0x11')](_0xf5f6('0x2d'),'no'),'allowNull':!![],'defaultValue':_0xf5f6('0x2d')},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xf5f6('0x9')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xf5f6('0x15')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xf5f6('0x15')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xf5f6('0x15')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0xf5f6('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xf5f6('0x9')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xf5f6('0x9')],'allowNull':!![]},'timert1':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xf5f6('0x15')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xf5f6('0x15')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xf5f6('0x9')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xf5f6('0x9')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xf5f6('0x9')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xf5f6('0x9')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xf5f6('0x9')],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xf5f6('0x11')](_0xf5f6('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xf5f6('0x11')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xf5f6('0x11')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xf5f6('0x11')](_0xf5f6('0x2d'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xf5f6('0x11')](_0xf5f6('0x2d'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xf5f6('0x11')](_0xf5f6('0x2d'),'no',_0xf5f6('0x3d'),_0xf5f6('0x3e')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xf5f6('0x15')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xf5f6('0x9')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xf5f6('0x9')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xf5f6('0x9')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xf5f6('0x9')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xf5f6('0x9')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xf5f6('0x11')](_0xf5f6('0x3f'),_0xf5f6('0x40'),_0xf5f6('0x41')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0xf5f6('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xf5f6('0x9')],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xf5f6('0x11')](_0xf5f6('0x2d'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xf5f6('0x11')](_0xf5f6('0x2d'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xf5f6('0x9')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xf5f6('0x9')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xf5f6('0x9')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xf5f6('0x9')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xf5f6('0x11')](_0xf5f6('0x2d'),'no',_0xf5f6('0x2e'),_0xf5f6('0x42'),'update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xf5f6('0x17')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xf5f6('0x9')]},'resetPasswordExpires':{'type':Sequelize[_0xf5f6('0x18')]},'passwordResetAt':{'type':Sequelize[_0xf5f6('0x18')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xf5f6('0x43')]},'showWebBar':{'type':Sequelize[_0xf5f6('0x15')],'defaultValue':0x0,'set':function(_0x9bd1b9){this[_0xf5f6('0x6')]('showWebBar',_0x9bd1b9);var _0x2f6b7d=this['get']({'plain':!![]});switch(_0x9bd1b9){case 0x0:case 0x1:var _0x47e005=_0x2f6b7d[_0xf5f6('0x24')]?_['isArray'](_0x2f6b7d[_0xf5f6('0x24')])?_0x2f6b7d['transport'][_0xf5f6('0x25')]():_0x2f6b7d[_0xf5f6('0x24')]:_0xf5f6('0x23');if(_0x47e005===_0xf5f6('0x44')){_0x47e005=_0xf5f6('0x23');}this['setDataValue'](_0xf5f6('0x24'),_0x47e005);this[_0xf5f6('0x6')](_0xf5f6('0x45'),'no');this[_0xf5f6('0x6')](_0xf5f6('0x46'),null);this[_0xf5f6('0x6')](_0xf5f6('0x47'),null);this[_0xf5f6('0x6')]('icesupport',null);this[_0xf5f6('0x6')](_0xf5f6('0x48'),null);this[_0xf5f6('0x6')](_0xf5f6('0x49'),null);this[_0xf5f6('0x6')](_0xf5f6('0x4a'),null);this[_0xf5f6('0x6')](_0xf5f6('0x4b'),null);this[_0xf5f6('0x6')](_0xf5f6('0x4c'),null);this[_0xf5f6('0x6')]('rtcp_mux','no');break;case 0x2:this[_0xf5f6('0x6')]('transport',_0xf5f6('0x44'));this[_0xf5f6('0x6')]('encryption',_0xf5f6('0x2d'));this['setDataValue'](_0xf5f6('0x46'),_0xf5f6('0x2d'));this['setDataValue'](_0xf5f6('0x47'),_0xf5f6('0x2d'));this[_0xf5f6('0x6')](_0xf5f6('0x4d'),'yes');this[_0xf5f6('0x6')]('dtlsenable','yes');this[_0xf5f6('0x6')](_0xf5f6('0x49'),'no');this[_0xf5f6('0x6')]('dtlssetup',_0xf5f6('0x41'));this[_0xf5f6('0x6')]('dtlscertfile',_0x2f6b7d['dtlscertfile']||_0xf5f6('0x4e'));this[_0xf5f6('0x6')](_0xf5f6('0x4c'),_0x2f6b7d[_0xf5f6('0x4c')]||'/etc/pki/tls/private/motion.key');this['setDataValue'](_0xf5f6('0x4f'),_0xf5f6('0x2d'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x71848e){this[_0xf5f6('0x6')](_0xf5f6('0x50'),_0x71848e?_0x71848e['join'](','):[]);},'get':function(){return this['getDataValue'](_0xf5f6('0x50'))?_[_0xf5f6('0x51')](this[_0xf5f6('0xe')]('permissions')[_0xf5f6('0x26')](','),function(_0x54178d){return parseInt(_0x54178d,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xf5f6('0x9')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0xf5f6('0x9')]},'phoneBarBusyNumber':{'type':Sequelize[_0xf5f6('0x9')]},'phoneBarUnconditional':{'type':Sequelize[_0xf5f6('0x17')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xf5f6('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xf5f6('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xf5f6('0x15')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xf5f6('0x9')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM'](_0xf5f6('0x2d'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xf5f6('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xf5f6('0x9')]},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xf5f6('0x52')],'get':function(){return this[_0xf5f6('0xe')](_0xf5f6('0x53'))?this['getDataValue']('phoneBarEnableScreenRecordingByAgent'):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xf5f6('0x17')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xf5f6('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xf5f6('0x17')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xf5f6('0x17')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xf5f6('0x9')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xf5f6('0x9')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xf5f6('0x17')],'defaultValue':![],'set':function(_0x32b6dc){if(typeof _0x32b6dc===_0xf5f6('0x54')){var _0x565721=_0x32b6dc==='1'?!![]:_0x32b6dc==='0'?![]:_0x32b6dc==='true'?!![]:_0x32b6dc==='false'?![]:![];this[_0xf5f6('0x6')](_0xf5f6('0x55'),_0x565721);}else{this[_0xf5f6('0x6')]('screenrecording',_0x32b6dc);}}},'blocked':{'type':Sequelize[_0xf5f6('0x17')],'defaultValue':![],'set':function(_0x2df866){this['setDataValue'](_0xf5f6('0x56'),_0x2df866);if(_0x2df866===!![]){this[_0xf5f6('0x6')]('blockedAt',moment());this[_0xf5f6('0x6')](_0xf5f6('0x57'),0x0);}else{this[_0xf5f6('0x6')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize[_0xf5f6('0x18')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xf5f6('0x15')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xf5f6('0x17')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xf5f6('0x17')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xf5f6('0x15')](0x5)[_0xf5f6('0x58')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 7ac270b..ed32736 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 _0xb688=['where','pick','hasOwnProperty','List','Tag','Tags','color','tag','nolimit','findOne','Queue','Unknown\x20role','getVoiceQueuesRt','ChatGroup','getGroups','getRecordings','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','OpenchannelInteraction','MailInteraction','getSmsInteractions','getFaxInteractions','FaxInteraction','getWhatsappInteractions','WhatsappInteraction','phone','mobile','LOCAL/%s@from-sip/n','intrf','user:forcelogout','headers','x-forwarded-for','connection','remoteAddress','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','MemberReport','forEach','getChannels','YYYY-MM-DD\x20HH:mm:ss','LOGIN','device','LOGININPAUSE','bulkCreate','concat','isMiddleware','logout','pause','PAUSE','updateAttributes','type','DEFAULT\x20PAUSE','smsPause','whatsapppause','QueuePause','manual','%s%s','Pause','unpause','Team','getTeams','addTeams','getVoiceQueues','setDataValue','Voice','getChatQueues','Mail','getSmsQueues','Sms','getWhatsappQueues','getFaxQueues','Fax','getOpenchannelQueues','Openchannel','flatten','transaction','addAgent','getDataValue','removeTeams','Chat','getMailQueues','Whatsapp','removeAgent','CmList','getLists','getAgents','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','FaxAccount','getFaxAccounts','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$and','$gt','$gte','$lt','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contained','$any','firstName','Contact','dialActive','getApiKey','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','iat','nonce','apiKeyNonce','API\x20key\x20not\x20available','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getPresence','resolve','teams','queues','isEmpty','lower','col','asc','desc','substring','uniqBy','orderBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','idle','unknown','unavailable','ringing','voiceStatus','busy','slice','charAt','toUpperCase','field','ui.','InteractionId','ui.createdAt','user_has_','ui.UserId\x20=\x20?','toString','bluebird','util','path','lodash','squel','jayson/promise','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','socket.io-emitter','redis','./user.socket','register','defaults','localhost','client','http','request','then','info','User,\x20%s,\x20%s','debug','stringify','error','message','request\x20sent','result','catch','status','json','undefined','limit','offset','count','set','destroy','role','Users','Agents','agent','Telephones','filter','ignore','map','value','includes','find','name','UserProfileResource','end','sendStatus','stack','send','index','User','rawAttributes','fieldName','key','password','salt','getOptions','includeAll','include','attributes','push','openTabs','true','length','chat','rows','sms','dataValues','fax','mail','openchannel','whatsapp','all','show','params','model','differenceBy','keys','query','intersection','fields','merge','options','update','body','addContacts','ids','omit','internal','Setting','findById','isNil','min_internal','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)','sequelize','QueryTypes','SELECT','from','voicemail','mailbox','VoiceMail','fullname','email','permissions','101','102','110','105','106','107','108','109','100','111','115','create','Unauthorized','user','admin','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','settingsEnabled','userProfileId','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','checkUserLimits','each','telephone','findAll','some','autoAssociation','compact','changePassword','oldPassword','newPassword','authenticate','Sequelize','ValidationError','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','securePassword','validatePasswordPattern','enforcePasswordHistory','validatePasswordHistory','previousPasswords','passwordHistoryLimit','addQueues','channel','loginInPause','voicePause','interface','isValidChannel','capitalize','toLowerCase','Queues','spread','QueueId','emit','Queue:save','voice','VoiceQueue','get','online','format','SIP/%s','penalty','UserVoiceQueueRt','upsert','removeQueues','Unknown\x20channel','remove','isArray','addAvatar','userpic','file','filename','getAvatar','root','download','existsSync','join','server/files/images/','ChatOpenTabs','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','MailOpenTabs','MAIL','SmsOpenTabs','WhatsappOpenTabs','WHATSAPP','getContacts','CmContact','filters','order','sort'];(function(_0x433c8e,_0x12e70f){var _0x340a3d=function(_0x1507f6){while(--_0x1507f6){_0x433c8e['push'](_0x433c8e['shift']());}};_0x340a3d(++_0x12e70f);}(_0xb688,0xcf));var _0x8b68=function(_0x48e675,_0x270383){_0x48e675=_0x48e675-0x0;var _0x260d65=_0xb688[_0x48e675];return _0x260d65;};'use strict';var moment=require('moment');var BPromise=require(_0x8b68('0x0'));var util=require(_0x8b68('0x1'));var path=require(_0x8b68('0x2'));var fs=require('fs');var _=require(_0x8b68('0x3'));var squel=require(_0x8b68('0x4'));var jayson=require(_0x8b68('0x5'));var Redis=require('ioredis');var authService=require(_0x8b68('0x6'));var qs=require(_0x8b68('0x7'));var logger=require(_0x8b68('0x8'))(_0x8b68('0x9'));var utils=require('../../config/utils');var config=require(_0x8b68('0xa'));var licenseUtil=require('../../config/license/util');var db=require(_0x8b68('0xb'))['db'];var socket=require(_0x8b68('0xc'))(new Redis(config[_0x8b68('0xd')]));require(_0x8b68('0xe'))[_0x8b68('0xf')](socket);config[_0x8b68('0xd')]=_[_0x8b68('0x10')](config[_0x8b68('0xd')],{'host':_0x8b68('0x11'),'port':0x18eb});var client=jayson[_0x8b68('0x12')][_0x8b68('0x13')]({'port':0x232a});var values;function respondWithRpcPromise(_0x317d01,_0x2a852a,_0x502727,_0x2c0f3b){return new BPromise(function(_0x4426d1,_0x5e76c){var _0x2d8472=_0x2c0f3b||client;return _0x2d8472[_0x8b68('0x14')](_0x317d01,_0x502727)[_0x8b68('0x15')](function(_0xaa8725){logger[_0x8b68('0x16')](_0x8b68('0x17'),_0x2a852a,'request\x20sent');logger[_0x8b68('0x18')]('User,\x20%s,\x20%s,\x20%s',_0x2a852a,'request\x20sent',JSON[_0x8b68('0x19')](_0xaa8725));if(_0xaa8725[_0x8b68('0x1a')]){if(_0xaa8725[_0x8b68('0x1a')]['code']===0x1f4){logger['error'](_0x8b68('0x17'),_0x2a852a,_0xaa8725['error'][_0x8b68('0x1b')]);return _0x5e76c(_0xaa8725[_0x8b68('0x1a')][_0x8b68('0x1b')]);}logger[_0x8b68('0x1a')]('User,\x20%s,\x20%s',_0x2a852a,_0xaa8725[_0x8b68('0x1a')][_0x8b68('0x1b')]);return _0x4426d1(_0xaa8725['error'][_0x8b68('0x1b')]);}else{logger[_0x8b68('0x16')](_0x8b68('0x17'),_0x2a852a,_0x8b68('0x1c'));_0x4426d1(_0xaa8725[_0x8b68('0x1d')]['message']);}})[_0x8b68('0x1e')](function(_0x4b4b0f){logger[_0x8b68('0x1a')](_0x8b68('0x17'),_0x2a852a,_0x4b4b0f);_0x5e76c(_0x4b4b0f);});});}function respondWithStatusCode(_0x35d055,_0x1dbc1d){_0x1dbc1d=_0x1dbc1d||0xcc;return function(_0x5603d4){if(_0x5603d4){return _0x35d055['sendStatus'](_0x1dbc1d);}return _0x35d055[_0x8b68('0x1f')](_0x1dbc1d)['end']();};}function respondWithResult(_0x332202,_0x30b6d0){_0x30b6d0=_0x30b6d0||0xc8;return function(_0x13aee5){if(_0x13aee5){return _0x332202[_0x8b68('0x1f')](_0x30b6d0)[_0x8b68('0x20')](_0x13aee5);}};}function respondWithFilteredResult(_0x173524,_0x59bb8a){return function(_0x1a6fe8){if(_0x1a6fe8){var _0x46e827=typeof _0x59bb8a['offset']===_0x8b68('0x21')&&typeof _0x59bb8a[_0x8b68('0x22')]===_0x8b68('0x21');var _0x5590ec=_0x1a6fe8['count'];var _0x4fe8f6=_0x46e827?0x0:_0x59bb8a[_0x8b68('0x23')];var _0x448e43=_0x46e827?_0x1a6fe8[_0x8b68('0x24')]:_0x59bb8a['offset']+_0x59bb8a[_0x8b68('0x22')];var _0x53aaa2;if(_0x448e43>=_0x5590ec){_0x448e43=_0x5590ec;_0x53aaa2=0xc8;}else{_0x53aaa2=0xce;}_0x173524['status'](_0x53aaa2);return _0x173524[_0x8b68('0x25')]('Content-Range',_0x4fe8f6+'-'+_0x448e43+'/'+_0x5590ec)[_0x8b68('0x20')](_0x1a6fe8);}return null;};}function saveUpdates(_0x3ac356){return function(_0x48e2c8){if(_0x48e2c8){return _0x48e2c8['update'](_0x3ac356)[_0x8b68('0x15')](function(_0x1cd230){return _0x1cd230;});}return null;};}function removeEntity(_0x1e7c06){return function(_0xfb4f06){if(_0xfb4f06){return _0xfb4f06[_0x8b68('0x26')]()[_0x8b68('0x15')](function(){var _0x460c37=_0xfb4f06['get']({'plain':!![]});if(_0x460c37[_0x8b68('0x27')]==='admin')return;var _0x1d8693=[{'name':_0x8b68('0x28'),'value':'user','ignore':!![]},{'name':_0x8b68('0x29'),'value':_0x8b68('0x2a'),'ignore':![]},{'name':_0x8b68('0x2b'),'value':'telephone','ignore':![]}];var _0x51f169=_(_0x1d8693)[_0x8b68('0x2c')](_0x8b68('0x2d'))[_0x8b68('0x2e')](_0x8b68('0x2f'))[_0x8b68('0x2f')]();if(_[_0x8b68('0x30')](_0x51f169,_0x460c37[_0x8b68('0x27')])){return;}var _0x3e646e=_[_0x8b68('0x31')](_0x1d8693,[_0x8b68('0x2f'),_0x460c37[_0x8b68('0x27')]])[_0x8b68('0x32')];return db[_0x8b68('0x33')][_0x8b68('0x26')]({'where':{'type':_0x3e646e,'resourceId':_0x460c37['id']}})[_0x8b68('0x15')](function(){return _0xfb4f06;});})[_0x8b68('0x15')](function(){_0x1e7c06[_0x8b68('0x1f')](0xcc)[_0x8b68('0x34')]();});}};}function handleEntityNotFound(_0x120b34){return function(_0x18dfae){if(!_0x18dfae){_0x120b34[_0x8b68('0x35')](0x194);}return _0x18dfae;};}function handleError(_0x43b971,_0x48abb7){_0x48abb7=_0x48abb7||0x1f4;return function(_0x5c158b){logger[_0x8b68('0x1a')](_0x5c158b[_0x8b68('0x36')]);if(_0x5c158b[_0x8b68('0x32')]){delete _0x5c158b[_0x8b68('0x32')];}_0x43b971[_0x8b68('0x1f')](_0x48abb7)[_0x8b68('0x37')](_0x5c158b);};}exports[_0x8b68('0x38')]=function(_0x43feb3,_0x5b628e){var _0x14cda1={},_0x2c94d0={'count':0x0,'rows':[]};var _0x1011b7=_(db[_0x8b68('0x39')][_0x8b68('0x3a')])[_0x8b68('0x2e')](function(_0xff4080){return{'name':_0xff4080[_0x8b68('0x3b')],'type':_0xff4080['type'][_0x8b68('0x3c')]};})[_0x8b68('0x2c')](function(_0x1aa5c2){return!_[_0x8b68('0x30')]([_0x8b68('0x3d'),_0x8b68('0x3e')],_0x1aa5c2[_0x8b68('0x32')]);})['value']();_0x14cda1=qs[_0x8b68('0x3f')](_0x1011b7,_0x43feb3);var _0x2fc3a9={'where':_0x14cda1['where']};return db[_0x8b68('0x39')][_0x8b68('0x24')](_0x2fc3a9)['then'](function(_0x4e627f){_0x2c94d0['count']=_0x4e627f;if(_0x43feb3['query'][_0x8b68('0x40')]){_0x14cda1[_0x8b68('0x41')]=[{'all':!![]}];}if(!_['includes'](_0x14cda1[_0x8b68('0x42')],'id')){_0x14cda1['attributes'][_0x8b68('0x43')]('id');}return db[_0x8b68('0x39')]['findAll'](_0x14cda1);})[_0x8b68('0x15')](function(_0x5ae345){_0x2c94d0['rows']=_0x5ae345;if(_0x43feb3['query'][_0x8b68('0x44')]===_0x8b68('0x45')){var _0x3ba80e=[];for(var _0xa70f60=0x0;_0xa70f60<_0x2c94d0['rows'][_0x8b68('0x46')];_0xa70f60++){_0x3ba80e['push'](get_open_tabs(_0x8b68('0x47'),_0x2c94d0[_0x8b68('0x48')][_0xa70f60]['dataValues']));_0x3ba80e[_0x8b68('0x43')](get_open_tabs(_0x8b68('0x49'),_0x2c94d0[_0x8b68('0x48')][_0xa70f60][_0x8b68('0x4a')]));_0x3ba80e['push'](get_open_tabs(_0x8b68('0x4b'),_0x2c94d0[_0x8b68('0x48')][_0xa70f60][_0x8b68('0x4a')]));_0x3ba80e[_0x8b68('0x43')](get_open_tabs(_0x8b68('0x4c'),_0x2c94d0[_0x8b68('0x48')][_0xa70f60][_0x8b68('0x4a')]));_0x3ba80e[_0x8b68('0x43')](get_open_tabs(_0x8b68('0x4d'),_0x2c94d0[_0x8b68('0x48')][_0xa70f60][_0x8b68('0x4a')]));_0x3ba80e[_0x8b68('0x43')](get_open_tabs(_0x8b68('0x4e'),_0x2c94d0[_0x8b68('0x48')][_0xa70f60][_0x8b68('0x4a')]));}return BPromise[_0x8b68('0x4f')](_0x3ba80e)['then'](function(_0x3b7b06){return _0x2c94d0;});}else{return _0x2c94d0;}})[_0x8b68('0x15')](respondWithFilteredResult(_0x5b628e,_0x14cda1))['catch'](handleError(_0x5b628e,null));};exports[_0x8b68('0x50')]=function(_0x4cd28a,_0x58cf66){var _0x59a4a6={'raw':![],'where':{'id':_0x4cd28a[_0x8b68('0x51')]['id']}},_0x1c8a3e={};_0x1c8a3e[_0x8b68('0x52')]=_[_0x8b68('0x53')](_['keys'](db['User'][_0x8b68('0x3a')]),[_0x8b68('0x3d'),_0x8b68('0x3e')]);_0x1c8a3e['query']=_[_0x8b68('0x54')](_0x4cd28a[_0x8b68('0x55')]);_0x1c8a3e['filters']=_[_0x8b68('0x56')](_0x1c8a3e[_0x8b68('0x52')],_0x1c8a3e['query']);_0x59a4a6[_0x8b68('0x42')]=_[_0x8b68('0x56')](_0x1c8a3e['model'],qs[_0x8b68('0x57')](_0x4cd28a[_0x8b68('0x55')]['fields']));_0x59a4a6['attributes']=_0x59a4a6['attributes'][_0x8b68('0x46')]?_0x59a4a6[_0x8b68('0x42')]:_0x1c8a3e[_0x8b68('0x52')];if(_0x4cd28a[_0x8b68('0x55')]['includeAll']){_0x59a4a6['include']=[{'all':!![]}];}_0x59a4a6=_[_0x8b68('0x58')]({},_0x59a4a6,_0x4cd28a[_0x8b68('0x59')]);if(!_[_0x8b68('0x30')](_0x59a4a6['attributes'],'id')){_0x59a4a6[_0x8b68('0x42')][_0x8b68('0x43')]('id');}return db[_0x8b68('0x39')]['find'](_0x59a4a6)[_0x8b68('0x15')](handleEntityNotFound(_0x58cf66,null))['then'](function(_0x2b1fd8){var _0x3efb0e=[];values=_0x2b1fd8;if(_0x4cd28a['query'][_0x8b68('0x44')]===_0x8b68('0x45')){_0x3efb0e[_0x8b68('0x43')](get_open_tabs(_0x8b68('0x47'),_0x2b1fd8[_0x8b68('0x4a')]));_0x3efb0e['push'](get_open_tabs(_0x8b68('0x49'),_0x2b1fd8[_0x8b68('0x4a')]));_0x3efb0e[_0x8b68('0x43')](get_open_tabs(_0x8b68('0x4d'),_0x2b1fd8[_0x8b68('0x4a')]));_0x3efb0e[_0x8b68('0x43')](get_open_tabs(_0x8b68('0x4e'),_0x2b1fd8[_0x8b68('0x4a')]));_0x3efb0e['push'](get_open_tabs(_0x8b68('0x4b'),_0x2b1fd8[_0x8b68('0x4a')]));_0x3efb0e[_0x8b68('0x43')](get_open_tabs(_0x8b68('0x4c'),_0x2b1fd8[_0x8b68('0x4a')]));return BPromise[_0x8b68('0x4f')](_0x3efb0e);}else{return values;}})[_0x8b68('0x15')](function(_0x37c4cb){return values;})[_0x8b68('0x15')](respondWithResult(_0x58cf66,null))[_0x8b68('0x1e')](handleError(_0x58cf66,null));};exports[_0x8b68('0x5a')]=function(_0x42871e,_0x1019cb){if(_0x42871e[_0x8b68('0x5b')]['id']){delete _0x42871e[_0x8b68('0x5b')]['id'];}delete _0x42871e[_0x8b68('0x5b')][_0x8b68('0x27')];return db[_0x8b68('0x39')][_0x8b68('0x31')]({'where':{'id':_0x42871e[_0x8b68('0x51')]['id']}})['then'](handleEntityNotFound(_0x1019cb,null))[_0x8b68('0x15')](saveUpdates(_0x42871e['body'],null))['then'](respondWithResult(_0x1019cb,null))[_0x8b68('0x1e')](handleError(_0x1019cb,null));};exports['describe']=function(_0x43f826,_0x61dac8){return db[_0x8b68('0x39')]['describe']()[_0x8b68('0x15')](respondWithResult(_0x61dac8,null))[_0x8b68('0x1e')](handleError(_0x61dac8,null));};exports[_0x8b68('0x5c')]=function(_0x1e0095,_0x401c20){return db[_0x8b68('0x39')][_0x8b68('0x31')]({'where':{'id':_0x1e0095['params']['id']}})['then'](handleEntityNotFound(_0x401c20,null))[_0x8b68('0x15')](function(_0x4224f5){if(_0x4224f5){return _0x4224f5[_0x8b68('0x5c')](_0x1e0095[_0x8b68('0x5b')][_0x8b68('0x5d')],_[_0x8b68('0x5e')](_0x1e0095[_0x8b68('0x5b')],[_0x8b68('0x5d'),'id'])||{});}})[_0x8b68('0x15')](respondWithResult(_0x401c20,null))[_0x8b68('0x1e')](handleError(_0x401c20,null));};function validateUser(_0x141f41){return new BPromise(function(_0x2379d4,_0x316652){if(_0x141f41[_0x8b68('0x5f')])return _0x2379d4(_0x141f41);return db[_0x8b68('0x60')][_0x8b68('0x61')](0x1)[_0x8b68('0x15')](function(_0x10e8b7){if(_0x10e8b7['securePassword'])authService['validatePasswordPattern'](_0x141f41[_0x8b68('0x3d')]);db[_0x8b68('0x39')]['max']('internal')['then'](function(_0x39a04e){if(_[_0x8b68('0x62')](_0x39a04e)){_0x141f41[_0x8b68('0x5f')]=_0x10e8b7[_0x8b68('0x63')]||0x1;return;}if(_[_0x8b68('0x62')](_0x10e8b7['min_internal'])||_0x10e8b7[_0x8b68('0x63')]===_0x39a04e){_0x141f41[_0x8b68('0x5f')]=_0x39a04e+0x1;return;}if(_0x10e8b7['min_internal']>_0x39a04e){_0x141f41[_0x8b68('0x5f')]=_0x10e8b7['min_internal'];return;}return db['sequelize']['query'](_0x8b68('0x64'),{'type':db[_0x8b68('0x65')][_0x8b68('0x66')][_0x8b68('0x67')]})[_0x8b68('0x15')](function(_0x1fc24c){if(_0x1fc24c&&_0x1fc24c[_0x8b68('0x46')]){for(var _0x34456d=0x0,_0x427752=_0x1fc24c[_0x8b68('0x46')];_0x34456d<_0x427752&&_['isNil'](_0x141f41[_0x8b68('0x5f')]);_0x34456d++){if(_0x10e8b7[_0x8b68('0x63')]<=_0x1fc24c[_0x34456d][_0x8b68('0x68')]){_0x141f41['internal']=_0x1fc24c[_0x34456d]['from'];}else if(_0x10e8b7[_0x8b68('0x63')]>_0x1fc24c[_0x34456d][_0x8b68('0x68')]&&_0x10e8b7['min_internal']<=_0x1fc24c[_0x34456d]['to']){_0x141f41[_0x8b68('0x5f')]=_0x10e8b7[_0x8b68('0x63')];}}}if(_[_0x8b68('0x62')](_0x141f41[_0x8b68('0x5f')])){_0x141f41['internal']=_0x39a04e+0x1;}return _0x2379d4(_0x141f41);});});})[_0x8b68('0x1e')](function(_0x4925a4){_0x316652(_0x4925a4);});});}function updateUser(_0x51dc80){return new BPromise(function(_0x1cd7e5,_0x51fb5b){try{if(_0x51dc80[_0x8b68('0x69')]){_0x51dc80[_0x8b68('0x6a')]=_0x51dc80['internal'];_0x51dc80[_0x8b68('0x6b')]={'mailbox':_0x51dc80[_0x8b68('0x5f')],'password':_0x51dc80[_0x8b68('0x3d')],'fullname':_0x51dc80[_0x8b68('0x6c')],'email':_0x51dc80[_0x8b68('0x6d')]};}if(_0x51dc80['role']===_0x8b68('0x2a')){if(!_0x51dc80[_0x8b68('0x6e')])_0x51dc80[_0x8b68('0x6e')]=[_0x8b68('0x6f'),_0x8b68('0x70'),'103','113',_0x8b68('0x71'),'104',_0x8b68('0x72'),_0x8b68('0x73'),_0x8b68('0x74'),_0x8b68('0x75'),_0x8b68('0x76'),_0x8b68('0x77'),_0x8b68('0x78'),'114',_0x8b68('0x79')];}_0x1cd7e5(_0x51dc80);}catch(_0x4c0cc4){_0x51fb5b(_0x4c0cc4);}});}exports[_0x8b68('0x7a')]=function(_0x2caa28,_0xc8c3c){if(_0x2caa28['user'][_0x8b68('0x27')]==='agent')throw new Error(_0x8b68('0x7b'));if(_0x2caa28['body'][_0x8b68('0x27')]===_0x8b68('0x7c')&&_0x2caa28[_0x8b68('0x7c')]['role']!==_0x8b68('0x7d')){throw new Error(_0x8b68('0x7e'));}if(_0x2caa28[_0x8b68('0x5b')][_0x8b68('0x27')]===_0x8b68('0x7d')&&_0x2caa28[_0x8b68('0x7c')][_0x8b68('0x27')]!==_0x8b68('0x7d')){throw new Error(_0x8b68('0x7f'));}return licenseUtil['checkUserLimits']([_0x2caa28[_0x8b68('0x5b')]])[_0x8b68('0x15')](function(){return validateUser(_0x2caa28[_0x8b68('0x5b')]);})[_0x8b68('0x15')](function(_0x71095b){return updateUser(_0x71095b)['then'](function(_0x3dfd43){if(_0x3dfd43['role']===_0x8b68('0x7d')){_0x3dfd43[_0x8b68('0x80')]=_0x2caa28['user'][_0x8b68('0x80')];delete _0x3dfd43[_0x8b68('0x81')];}return _0x3dfd43;});})[_0x8b68('0x15')](function(_0x4c9e0f){return db[_0x8b68('0x39')][_0x8b68('0x7a')](_0x4c9e0f,{'include':[{'model':db[_0x8b68('0x6b')],'as':_0x8b68('0x6b')}]});})[_0x8b68('0x15')](function(_0x42464c){if(_0x2caa28['body'][_0x8b68('0x27')]===_0x8b68('0x7c'))return _0x42464c;if(_0x2caa28[_0x8b68('0x7c')]['role']!==_0x8b68('0x7c'))return _0x42464c;return db[_0x8b68('0x82')][_0x8b68('0x31')]({'where':{'name':_0x42464c[_0x8b68('0x27')]===_0x8b68('0x2a')?_0x8b68('0x29'):_0x8b68('0x2b'),'userProfileId':_0x2caa28[_0x8b68('0x7c')][_0x8b68('0x81')]},'raw':!![]})[_0x8b68('0x15')](function(_0x44bb3a){if(!_0x44bb3a||_0x44bb3a['autoAssociation']!=0x0)return _0x42464c;return db['UserProfileResource'][_0x8b68('0x7a')]({'name':_0x42464c[_0x8b68('0x32')],'resourceId':_0x42464c['id'],'type':_0x44bb3a[_0x8b68('0x32')],'sectionId':_0x44bb3a['id']},{})[_0x8b68('0x15')](function(){return _0x42464c;});})[_0x8b68('0x1e')](function(_0x5e6c85){logger[_0x8b68('0x1a')](_0x8b68('0x83'),_0x5e6c85);throw _0x5e6c85;});})[_0x8b68('0x15')](respondWithResult(_0xc8c3c,0xc9))[_0x8b68('0x1e')](handleError(_0xc8c3c,null));};exports['bulkCreate']=function(_0x52aa06,_0x417bc0){var _0x42a69b=_0x52aa06[_0x8b68('0x5b')];var _0x1bf8cd=[];if(_0x52aa06[_0x8b68('0x7c')][_0x8b68('0x27')]===_0x8b68('0x2a'))throw new Error(_0x8b68('0x7b'));if(_['some'](_0x42a69b,[_0x8b68('0x27'),_0x8b68('0x7c')])&&_0x52aa06[_0x8b68('0x7c')][_0x8b68('0x27')]!==_0x8b68('0x7d')){throw new Error(_0x8b68('0x7e'));}if(_['some'](_0x42a69b,[_0x8b68('0x27'),_0x8b68('0x7d')])&&_0x52aa06[_0x8b68('0x7c')]['role']!==_0x8b68('0x7d')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil[_0x8b68('0x84')](_0x42a69b)['then'](function(){return validateUser(_0x42a69b[0x0]);})[_0x8b68('0x15')](function(){for(var _0x382d99=0x1;_0x382d99<_0x42a69b[_0x8b68('0x46')];_0x382d99++){var _0xf5a5fc=_0x42a69b[_0x382d99-0x1][_0x8b68('0x5f')];if(!_0x42a69b[_0x382d99][_0x8b68('0x5f')])_0x42a69b[_0x382d99]['internal']=_0xf5a5fc+0x1;_0x1bf8cd['push'](validateUser(_0x42a69b[_0x382d99]));}return BPromise['all'](_0x1bf8cd);})[_0x8b68('0x15')](function(){_0x1bf8cd=[];for(var _0x216c0e=0x0;_0x216c0e<_0x42a69b[_0x8b68('0x46')];_0x216c0e++){_0x1bf8cd[_0x8b68('0x43')](updateUser(_0x42a69b[_0x216c0e]));}return BPromise[_0x8b68('0x4f')](_0x1bf8cd);})[_0x8b68('0x15')](function(){return BPromise[_0x8b68('0x85')](_0x42a69b,function(_0x3b1644){return db[_0x8b68('0x39')][_0x8b68('0x7a')](_0x3b1644,{'include':[{'model':db[_0x8b68('0x6b')],'as':_0x8b68('0x6b')}]})[_0x8b68('0x15')](function(_0x1c5a71){_0x3b1644['id']=_0x1c5a71['id'];return _0x3b1644;});});})[_0x8b68('0x15')](function(_0x5e76ac){if(_0x52aa06['body']['role']===_0x8b68('0x7c'))return _0x5e76ac;if(_0x52aa06[_0x8b68('0x7c')][_0x8b68('0x27')]!==_0x8b68('0x7c'))return _0x5e76ac;var _0xb43aa0=_['some'](_0x5e76ac,function(_0x620256){return _0x620256['role']===_0x8b68('0x2a')||_0x620256['role']===_0x8b68('0x86');});if(!_0xb43aa0)return _0x5e76ac;return db['UserProfileSection'][_0x8b68('0x87')]({'where':{'name':{'$or':['Agents',_0x8b68('0x2b')]},'userProfileId':_0x52aa06[_0x8b68('0x7c')]['userProfileId']},'raw':!![]})[_0x8b68('0x15')](function(_0x4520af){if(_['isEmpty'](_0x4520af)||!_[_0x8b68('0x88')](_0x4520af,['autoAssociation',0x0]))return _0x5e76ac;_0x1bf8cd=[];var _0x93e030=_(_0x4520af)['map'](function(_0x1141da){if(_0x1141da[_0x8b68('0x89')]===0x1)return;return _0x1141da[_0x8b68('0x32')]===_0x8b68('0x29')?_0x8b68('0x2a'):_0x8b68('0x86');})[_0x8b68('0x8a')]()['value']();for(var _0x19d947=0x0;_0x19d947<_0x5e76ac[_0x8b68('0x46')];_0x19d947++){if(!_[_0x8b68('0x30')](_0x93e030,_0x5e76ac[_0x19d947][_0x8b68('0x27')]))return;var _0x333f4f=_0x5e76ac[_0x19d947][_0x8b68('0x27')]===_0x8b68('0x2a')?_0x8b68('0x29'):_0x8b68('0x2b');_0x1bf8cd[_0x8b68('0x43')](db[_0x8b68('0x33')][_0x8b68('0x7a')]({'name':_0x5e76ac[_0x19d947][_0x8b68('0x32')],'resourceId':_0x5e76ac[_0x19d947]['id'],'type':_0x333f4f,'sectionId':_[_0x8b68('0x31')](_0x4520af,['name',_0x333f4f])['id']},{}));}return BPromise[_0x8b68('0x4f')](_0x1bf8cd);});})[_0x8b68('0x15')](respondWithResult(_0x417bc0,0xc9))[_0x8b68('0x1e')](handleError(_0x417bc0,null));};exports[_0x8b68('0x8b')]=function(_0x475bf7,_0x3bae8f){if(_0x475bf7['body']['id']){delete _0x475bf7[_0x8b68('0x5b')]['id'];}return db[_0x8b68('0x39')][_0x8b68('0x31')]({'where':{'id':_0x475bf7[_0x8b68('0x51')]['id']}})[_0x8b68('0x15')](function(_0x5e2270){if(!_0x5e2270)return null;if(_0x5e2270['id']===_0x475bf7[_0x8b68('0x7c')]['id']){if(!_0x475bf7[_0x8b68('0x5b')][_0x8b68('0x8c')]||!_0x475bf7['body'][_0x8b68('0x8d')]){throw new db['Sequelize']['ValidationError']('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0x5e2270[_0x8b68('0x8e')](_0x475bf7[_0x8b68('0x5b')]['oldPassword'])){throw new db[(_0x8b68('0x8f'))][(_0x8b68('0x90'))](_0x8b68('0x91'));}if(_0x475bf7[_0x8b68('0x5b')][_0x8b68('0x8c')]===_0x475bf7[_0x8b68('0x5b')][_0x8b68('0x8d')]){throw new db[(_0x8b68('0x8f'))][(_0x8b68('0x90'))](_0x8b68('0x92'));}}else if(_0x475bf7['user'][_0x8b68('0x27')]===_0x8b68('0x7d')){if(!_0x475bf7['body'][_0x8b68('0x8d')]){throw new db[(_0x8b68('0x8f'))]['ValidationError']('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0x475bf7[_0x8b68('0x7c')][_0x8b68('0x27')]===_0x8b68('0x7c')){if(!_0x475bf7[_0x8b68('0x5b')][_0x8b68('0x8d')]){throw new db[(_0x8b68('0x8f'))][(_0x8b68('0x90'))](_0x8b68('0x93'));}if(_0x5e2270['role']!==_0x8b68('0x2a')){throw new db['Sequelize']['ValidationError'](_0x8b68('0x7b'));}}else{throw new db[(_0x8b68('0x8f'))]['ValidationError'](_0x8b68('0x7b'));}return _0x5e2270;})['then'](handleEntityNotFound(_0x3bae8f,null))[_0x8b68('0x15')](function(_0x29e328){return db[_0x8b68('0x60')]['findOne']({'attributes':['id',_0x8b68('0x94'),'enforcePasswordHistory','passwordHistoryLimit']})[_0x8b68('0x15')](function(_0xe9810c){if(_0xe9810c[_0x8b68('0x94')])authService[_0x8b68('0x95')](_0x475bf7[_0x8b68('0x5b')][_0x8b68('0x8d')]);if(!_0xe9810c[_0x8b68('0x96')]||!_0x29e328['previousPasswords'])return _0x29e328;authService[_0x8b68('0x97')](_0x475bf7[_0x8b68('0x5b')][_0x8b68('0x8d')],_0x29e328[_0x8b68('0x98')],_0xe9810c[_0x8b68('0x99')]);return _0x29e328;})[_0x8b68('0x15')](saveUpdates({'password':_0x475bf7[_0x8b68('0x5b')]['newPassword'],'passwordResetAt':_0x475bf7[_0x8b68('0x7c')]['id']==_0x475bf7[_0x8b68('0x51')]['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x475bf7['body'][_0x8b68('0x8d')],_0x29e328[_0x8b68('0x98')])},null));})['then'](respondWithResult(_0x3bae8f,null))[_0x8b68('0x1e')](handleError(_0x3bae8f,null));};exports[_0x8b68('0x9a')]=function(_0x101da1,_0x23f7ec){var _0x167588=_0x101da1[_0x8b68('0x5b')][_0x8b68('0x9b')];return db['User'][_0x8b68('0x31')]({'where':{'id':_0x101da1[_0x8b68('0x51')]['id']},'attributes':['id',_0x8b68('0x32'),'role','online',_0x8b68('0x9c'),_0x8b68('0x9d'),_0x8b68('0x9e')]})['then'](handleEntityNotFound(_0x23f7ec,null))['then'](function(_0x5fbaa7){if(_0x5fbaa7){if(!utils[_0x8b68('0x9f')](_0x167588)){throw new db[(_0x8b68('0x8f'))]['ValidationError']('Unknown\x20channel');}return _0x5fbaa7['add'+_[_0x8b68('0xa0')](_0x167588[_0x8b68('0xa1')]())+_0x8b68('0xa2')](_0x101da1[_0x8b68('0x5b')][_0x8b68('0x5d')],{'penalty':_0x101da1['body']['penalty']||0x0})[_0x8b68('0xa3')](function(_0x4d06a9){for(var _0x5a1823=0x0;_0x5a1823<_0x101da1['body'][_0x8b68('0x5d')][_0x8b68('0x46')];_0x5a1823+=0x1){var _0x40171d={'UserId':Number(_0x101da1['params']['id'])};_0x40171d[_[_0x8b68('0xa0')](_0x167588['toLowerCase']())+_0x8b68('0xa4')]=Number(_0x101da1[_0x8b68('0x5b')][_0x8b68('0x5d')][_0x5a1823]);socket[_0x8b68('0xa5')](_0x8b68('0x7c')+_[_0x8b68('0xa0')](_0x167588[_0x8b68('0xa1')]())+_0x8b68('0xa6'),_0x40171d);}return _0x4d06a9;})[_0x8b68('0x15')](function(){if(_0x167588===_0x8b68('0xa7')){return db[_0x8b68('0xa8')][_0x8b68('0x87')]({'where':{'id':_0x101da1[_0x8b68('0x5b')][_0x8b68('0x5d')]||[]},'raw':!![],'attributes':['id',_0x8b68('0x32')]});}})[_0x8b68('0x15')](function(_0xc9eba4){var _0x12d4c0=_0x5fbaa7[_0x8b68('0xa9')]({'plain':!![]});var _0x4af96b=[];if(_0x167588===_0x8b68('0xa7')&&_0x12d4c0['role']===_0x8b68('0x2a')&&_0x12d4c0[_0x8b68('0xaa')]){for(var _0x295773=0x0;_0x295773<_0xc9eba4[_0x8b68('0x46')];_0x295773+=0x1){_0x4af96b[_0x8b68('0x43')]({'membername':_0x12d4c0[_0x8b68('0x32')],'UserId':_0x12d4c0['id'],'queue_name':_0xc9eba4[_0x295773][_0x8b68('0x32')],'VoiceQueueId':_0xc9eba4[_0x295773]['id'],'interface':_[_0x8b68('0x62')](_0x12d4c0[_0x8b68('0x9e')])?util[_0x8b68('0xab')](_0x8b68('0xac'),_0x12d4c0[_0x8b68('0x32')]):_0x12d4c0['interface'],'paused':_0x12d4c0[_0x8b68('0x9d')]||![],'penalty':_0x101da1[_0x8b68('0x5b')][_0x8b68('0xad')]||0x0});}return BPromise[_0x8b68('0x85')](_0x4af96b,function(_0x39e25d){return db[_0x8b68('0xae')][_0x8b68('0xaf')](_0x39e25d);});}return _0x5fbaa7;});}})[_0x8b68('0x15')](respondWithStatusCode(_0x23f7ec,null))[_0x8b68('0x1e')](handleError(_0x23f7ec,null));};exports[_0x8b68('0xb0')]=function(_0x2ba260,_0x499eb1){var _0x1825f1;return db[_0x8b68('0x39')][_0x8b68('0x31')]({'where':{'id':_0x2ba260[_0x8b68('0x51')]['id']},'attributes':['id',_0x8b68('0x32'),'role']})[_0x8b68('0x15')](handleEntityNotFound(_0x499eb1,null))[_0x8b68('0x15')](function(_0x50b1fd){if(_0x50b1fd){_0x1825f1=_0x50b1fd;if(!_0x2ba260[_0x8b68('0x55')][_0x8b68('0x9b')]||!utils['isValidChannel'](_0x2ba260['query'][_0x8b68('0x9b')])){throw new db[(_0x8b68('0x8f'))][(_0x8b68('0x90'))](_0x8b68('0xb1'));}return _0x50b1fd[_0x8b68('0xb2')+_[_0x8b68('0xa0')](_0x2ba260[_0x8b68('0x55')][_0x8b68('0x9b')]['toLowerCase']())+_0x8b68('0xa2')](_0x2ba260[_0x8b68('0x55')][_0x8b68('0x5d')]);}})[_0x8b68('0x15')](function(_0x5124b2){if(_[_0x8b68('0xb3')](_0x2ba260['query'][_0x8b68('0x5d')])){for(var _0x29d8da=0x0;_0x29d8da<_0x2ba260[_0x8b68('0x55')][_0x8b68('0x5d')][_0x8b68('0x46')];_0x29d8da+=0x1){var _0x5b0b9c={'UserId':Number(_0x2ba260['params']['id'])};_0x5b0b9c[_['capitalize'](_0x2ba260['query']['channel']['toLowerCase']())+_0x8b68('0xa4')]=Number(_0x2ba260[_0x8b68('0x55')]['ids'][_0x29d8da]);socket['emit'](_0x8b68('0x7c')+_[_0x8b68('0xa0')](_0x2ba260['query'][_0x8b68('0x9b')][_0x8b68('0xa1')]())+'Queue:remove',_0x5b0b9c);}}else{var _0x5b0b9c={'UserId':Number(_0x2ba260[_0x8b68('0x51')]['id'])};_0x5b0b9c[_[_0x8b68('0xa0')](_0x2ba260[_0x8b68('0x55')][_0x8b68('0x9b')][_0x8b68('0xa1')]())+_0x8b68('0xa4')]=Number(_0x2ba260[_0x8b68('0x55')][_0x8b68('0x5d')]);socket['emit'](_0x8b68('0x7c')+_[_0x8b68('0xa0')](_0x2ba260[_0x8b68('0x55')][_0x8b68('0x9b')][_0x8b68('0xa1')]())+'Queue:remove',_0x5b0b9c);}return _0x5124b2;})[_0x8b68('0x15')](function(){if(_0x2ba260['query'][_0x8b68('0x9b')]==='voice'){return db[_0x8b68('0xae')][_0x8b68('0x26')]({'where':{'UserId':_0x2ba260[_0x8b68('0x51')]['id'],'VoiceQueueId':_0x2ba260['query'][_0x8b68('0x5d')]},'individualHooks':!![]})['then'](function(){return _0x1825f1;});}return _0x1825f1;})[_0x8b68('0x15')](respondWithStatusCode(_0x499eb1,null))[_0x8b68('0x1e')](handleError(_0x499eb1,null));};exports[_0x8b68('0xb4')]=function(_0x3fdfe0,_0x5a25d1){_0x3fdfe0[_0x8b68('0x5b')][_0x8b68('0xb5')]=_0x3fdfe0[_0x8b68('0xb6')][_0x8b68('0xb7')];return db[_0x8b68('0x39')][_0x8b68('0x31')]({'where':{'id':_0x3fdfe0[_0x8b68('0x51')]['id']}})[_0x8b68('0x15')](handleEntityNotFound(_0x5a25d1,null))[_0x8b68('0x15')](saveUpdates(_0x3fdfe0[_0x8b68('0x5b')],null))[_0x8b68('0x15')](respondWithResult(_0x5a25d1,null))[_0x8b68('0x1e')](handleError(_0x5a25d1,null));};exports[_0x8b68('0xb8')]=function(_0xd8dd51,_0x118f5e){var _0x1702f8=path['join'](config[_0x8b68('0xb9')],'server/files/images/logos/default_profile.png');return db[_0x8b68('0x39')][_0x8b68('0x31')]({'where':{'id':_0xd8dd51[_0x8b68('0x51')]['id']},'attributes':['id',_0x8b68('0xb5')],'raw':!![]})[_0x8b68('0x15')](handleEntityNotFound(_0x118f5e,null))[_0x8b68('0x15')](function(_0x4fc2a2){if(_0x4fc2a2){if(_['isNil'](_0x4fc2a2['userpic'])){return _0x118f5e[_0x8b68('0xba')](_0x1702f8);}else{if(!fs[_0x8b68('0xbb')](path[_0x8b68('0xbc')](config[_0x8b68('0xb9')],_0x8b68('0xbd'),_0x4fc2a2[_0x8b68('0xb5')]))){return _0x118f5e[_0x8b68('0xba')](_0x1702f8);}return _0x118f5e[_0x8b68('0xba')](path[_0x8b68('0xbc')](config[_0x8b68('0xb9')],'server/files/images/',_0x4fc2a2['userpic']));}}})[_0x8b68('0x1e')](handleError(_0x118f5e,null));};exports['getOpenTabs']=function(_0xe6bcf1,_0x25f2db){return db[_0x8b68('0x39')][_0x8b68('0x31')]({'where':{'id':_0xe6bcf1[_0x8b68('0x51')]['id']},'attributes':['id']})[_0x8b68('0x15')](handleEntityNotFound(_0x25f2db,null))[_0x8b68('0x15')](function(_0x514ab6){var _0x52dd5b=[];values=_0x514ab6[_0x8b68('0x4a')];_0x52dd5b[_0x8b68('0x43')](get_open_tabs(_0x8b68('0x47'),_0x514ab6[_0x8b68('0x4a')]));_0x52dd5b[_0x8b68('0x43')](get_open_tabs('sms',_0x514ab6[_0x8b68('0x4a')]));_0x52dd5b[_0x8b68('0x43')](get_open_tabs(_0x8b68('0x4d'),_0x514ab6[_0x8b68('0x4a')]));_0x52dd5b[_0x8b68('0x43')](get_open_tabs('whatsapp',_0x514ab6[_0x8b68('0x4a')]));_0x52dd5b[_0x8b68('0x43')](get_open_tabs(_0x8b68('0x4b'),_0x514ab6[_0x8b68('0x4a')]));_0x52dd5b[_0x8b68('0x43')](get_open_tabs('mail',_0x514ab6[_0x8b68('0x4a')]));return BPromise['all'](_0x52dd5b);})[_0x8b68('0x15')](function(_0x726461){var _0x55f08d=[];if(_0x726461){for(var _0x3e8d28=0x0;_0x3e8d28=_0x45f2fe){_0x5a15ee=_0x45f2fe;_0x1451d3=0xc8;}else{_0x1451d3=0xce;}_0x27e058[_0x0ceb('0x1a')](_0x1451d3);return _0x27e058['set'](_0x0ceb('0x1f'),_0x120a47+'-'+_0x5a15ee+'/'+_0x45f2fe)[_0x0ceb('0x1b')](_0x5c41dd);}return null;};}function saveUpdates(_0x3c934b){return function(_0x4427b8){if(_0x4427b8){return _0x4427b8[_0x0ceb('0x20')](_0x3c934b)[_0x0ceb('0xe')](function(_0x58aa8b){return _0x58aa8b;});}return null;};}function removeEntity(_0x30adcb){return function(_0x105011){if(_0x105011){return _0x105011[_0x0ceb('0x21')]()[_0x0ceb('0xe')](function(){var _0x331e98=_0x105011[_0x0ceb('0x22')]({'plain':!![]});if(_0x331e98[_0x0ceb('0x23')]===_0x0ceb('0x24'))return;var _0x34a0b3=[{'name':_0x0ceb('0x25'),'value':'user','ignore':!![]},{'name':_0x0ceb('0x26'),'value':_0x0ceb('0x27'),'ignore':![]},{'name':'Telephones','value':_0x0ceb('0x28'),'ignore':![]}];var _0x19980c=_(_0x34a0b3)[_0x0ceb('0x29')]('ignore')[_0x0ceb('0x2a')](_0x0ceb('0x2b'))[_0x0ceb('0x2b')]();if(_[_0x0ceb('0x2c')](_0x19980c,_0x331e98[_0x0ceb('0x23')])){return;}var _0x11144c=_[_0x0ceb('0x2d')](_0x34a0b3,[_0x0ceb('0x2b'),_0x331e98[_0x0ceb('0x23')]])[_0x0ceb('0x2e')];return db[_0x0ceb('0x2f')][_0x0ceb('0x21')]({'where':{'type':_0x11144c,'resourceId':_0x331e98['id']}})[_0x0ceb('0xe')](function(){return _0x105011;});})['then'](function(){_0x30adcb[_0x0ceb('0x1a')](0xcc)[_0x0ceb('0x19')]();});}};}function handleEntityNotFound(_0x802661){return function(_0x6be70d){if(!_0x6be70d){_0x802661[_0x0ceb('0x18')](0x194);}return _0x6be70d;};}function handleError(_0xa808dc,_0x56182f){_0x56182f=_0x56182f||0x1f4;return function(_0x44806d){logger['error'](_0x44806d['stack']);if(_0x44806d['name']){delete _0x44806d[_0x0ceb('0x2e')];}_0xa808dc['status'](_0x56182f)[_0x0ceb('0x30')](_0x44806d);};}exports[_0x0ceb('0x31')]=function(_0x513dc7,_0x3f730b){var _0x3c821e={},_0x1e3361={'count':0x0,'rows':[]};var _0x54e140=_(db[_0x0ceb('0x32')][_0x0ceb('0x33')])[_0x0ceb('0x2a')](function(_0x8b0683){return{'name':_0x8b0683[_0x0ceb('0x34')],'type':_0x8b0683[_0x0ceb('0x35')][_0x0ceb('0x36')]};})[_0x0ceb('0x29')](function(_0x1348a1){return!_[_0x0ceb('0x2c')]([_0x0ceb('0x37'),_0x0ceb('0x38')],_0x1348a1[_0x0ceb('0x2e')]);})[_0x0ceb('0x2b')]();_0x3c821e=qs[_0x0ceb('0x39')](_0x54e140,_0x513dc7);var _0x174f99={'where':_0x3c821e[_0x0ceb('0x3a')]};return db[_0x0ceb('0x32')][_0x0ceb('0x1e')](_0x174f99)[_0x0ceb('0xe')](function(_0x1db53d){_0x1e3361[_0x0ceb('0x1e')]=_0x1db53d;if(_0x513dc7[_0x0ceb('0x3b')][_0x0ceb('0x3c')]){_0x3c821e[_0x0ceb('0x3d')]=[{'all':!![]}];}if(!_[_0x0ceb('0x2c')](_0x3c821e[_0x0ceb('0x3e')],'id')){_0x3c821e[_0x0ceb('0x3e')]['push']('id');}return db[_0x0ceb('0x32')]['findAll'](_0x3c821e);})['then'](function(_0x3d2607){_0x1e3361[_0x0ceb('0x3f')]=_0x3d2607;if(_0x513dc7[_0x0ceb('0x3b')]['openTabs']==='true'){var _0x13072a=[];for(var _0x2f2f71=0x0;_0x2f2f71<_0x1e3361[_0x0ceb('0x3f')][_0x0ceb('0x40')];_0x2f2f71++){_0x13072a[_0x0ceb('0x41')](get_open_tabs(_0x0ceb('0x42'),_0x1e3361[_0x0ceb('0x3f')][_0x2f2f71][_0x0ceb('0x43')]));_0x13072a[_0x0ceb('0x41')](get_open_tabs('sms',_0x1e3361[_0x0ceb('0x3f')][_0x2f2f71][_0x0ceb('0x43')]));_0x13072a[_0x0ceb('0x41')](get_open_tabs(_0x0ceb('0x44'),_0x1e3361['rows'][_0x2f2f71][_0x0ceb('0x43')]));_0x13072a['push'](get_open_tabs(_0x0ceb('0x45'),_0x1e3361['rows'][_0x2f2f71][_0x0ceb('0x43')]));_0x13072a[_0x0ceb('0x41')](get_open_tabs(_0x0ceb('0x46'),_0x1e3361[_0x0ceb('0x3f')][_0x2f2f71][_0x0ceb('0x43')]));_0x13072a[_0x0ceb('0x41')](get_open_tabs(_0x0ceb('0x47'),_0x1e3361[_0x0ceb('0x3f')][_0x2f2f71]['dataValues']));}return BPromise[_0x0ceb('0x48')](_0x13072a)[_0x0ceb('0xe')](function(_0x47a04b){return _0x1e3361;});}else{return _0x1e3361;}})[_0x0ceb('0xe')](respondWithFilteredResult(_0x3f730b,_0x3c821e))[_0x0ceb('0x17')](handleError(_0x3f730b,null));};exports[_0x0ceb('0x49')]=function(_0x289e12,_0x135514){var _0x5e3332={'raw':![],'where':{'id':_0x289e12[_0x0ceb('0x4a')]['id']}},_0x34daf8={};_0x34daf8[_0x0ceb('0x4b')]=_[_0x0ceb('0x4c')](_[_0x0ceb('0x4d')](db[_0x0ceb('0x32')][_0x0ceb('0x33')]),[_0x0ceb('0x37'),_0x0ceb('0x38')]);_0x34daf8['query']=_[_0x0ceb('0x4d')](_0x289e12[_0x0ceb('0x3b')]);_0x34daf8[_0x0ceb('0x4e')]=_[_0x0ceb('0x4f')](_0x34daf8['model'],_0x34daf8['query']);_0x5e3332[_0x0ceb('0x3e')]=_[_0x0ceb('0x4f')](_0x34daf8[_0x0ceb('0x4b')],qs[_0x0ceb('0x50')](_0x289e12[_0x0ceb('0x3b')]['fields']));_0x5e3332[_0x0ceb('0x3e')]=_0x5e3332[_0x0ceb('0x3e')]['length']?_0x5e3332['attributes']:_0x34daf8['model'];if(_0x289e12[_0x0ceb('0x3b')][_0x0ceb('0x3c')]){_0x5e3332[_0x0ceb('0x3d')]=[{'all':!![]}];}_0x5e3332=_['merge']({},_0x5e3332,_0x289e12[_0x0ceb('0x51')]);if(!_[_0x0ceb('0x2c')](_0x5e3332['attributes'],'id')){_0x5e3332[_0x0ceb('0x3e')][_0x0ceb('0x41')]('id');}return db[_0x0ceb('0x32')]['find'](_0x5e3332)[_0x0ceb('0xe')](handleEntityNotFound(_0x135514,null))['then'](function(_0x19a5d5){var _0x1b1231=[];values=_0x19a5d5;if(_0x289e12[_0x0ceb('0x3b')][_0x0ceb('0x52')]===_0x0ceb('0x53')){_0x1b1231['push'](get_open_tabs(_0x0ceb('0x42'),_0x19a5d5[_0x0ceb('0x43')]));_0x1b1231[_0x0ceb('0x41')](get_open_tabs(_0x0ceb('0x54'),_0x19a5d5[_0x0ceb('0x43')]));_0x1b1231[_0x0ceb('0x41')](get_open_tabs(_0x0ceb('0x46'),_0x19a5d5[_0x0ceb('0x43')]));_0x1b1231[_0x0ceb('0x41')](get_open_tabs(_0x0ceb('0x47'),_0x19a5d5['dataValues']));_0x1b1231[_0x0ceb('0x41')](get_open_tabs(_0x0ceb('0x44'),_0x19a5d5[_0x0ceb('0x43')]));_0x1b1231[_0x0ceb('0x41')](get_open_tabs(_0x0ceb('0x45'),_0x19a5d5[_0x0ceb('0x43')]));return BPromise[_0x0ceb('0x48')](_0x1b1231);}else{return values;}})['then'](function(_0x107a37){return values;})[_0x0ceb('0xe')](respondWithResult(_0x135514,null))[_0x0ceb('0x17')](handleError(_0x135514,null));};exports[_0x0ceb('0x20')]=function(_0x433044,_0xa088dc){if(_0x433044[_0x0ceb('0x55')]['id']){delete _0x433044[_0x0ceb('0x55')]['id'];}delete _0x433044[_0x0ceb('0x55')][_0x0ceb('0x23')];return db[_0x0ceb('0x32')]['find']({'where':{'id':_0x433044[_0x0ceb('0x4a')]['id']}})[_0x0ceb('0xe')](handleEntityNotFound(_0xa088dc,null))[_0x0ceb('0xe')](saveUpdates(_0x433044[_0x0ceb('0x55')],null))[_0x0ceb('0xe')](respondWithResult(_0xa088dc,null))['catch'](handleError(_0xa088dc,null));};exports[_0x0ceb('0x56')]=function(_0x38da0b,_0x4af917){return db[_0x0ceb('0x32')]['describe']()[_0x0ceb('0xe')](respondWithResult(_0x4af917,null))[_0x0ceb('0x17')](handleError(_0x4af917,null));};exports[_0x0ceb('0x57')]=function(_0x12649e,_0x1b2ba9){return db['User'][_0x0ceb('0x2d')]({'where':{'id':_0x12649e[_0x0ceb('0x4a')]['id']}})[_0x0ceb('0xe')](handleEntityNotFound(_0x1b2ba9,null))[_0x0ceb('0xe')](function(_0x4412f0){if(_0x4412f0){return _0x4412f0[_0x0ceb('0x57')](_0x12649e['body'][_0x0ceb('0x58')],_[_0x0ceb('0x59')](_0x12649e[_0x0ceb('0x55')],[_0x0ceb('0x58'),'id'])||{});}})['then'](respondWithResult(_0x1b2ba9,null))['catch'](handleError(_0x1b2ba9,null));};function validateUser(_0x23152c){return new BPromise(function(_0x44f321,_0x286160){if(_0x23152c[_0x0ceb('0x5a')])return _0x44f321(_0x23152c);return db[_0x0ceb('0x5b')][_0x0ceb('0x5c')](0x1)[_0x0ceb('0xe')](function(_0x4b6547){if(_0x4b6547[_0x0ceb('0x5d')])authService[_0x0ceb('0x5e')](_0x23152c[_0x0ceb('0x37')]);db[_0x0ceb('0x32')][_0x0ceb('0x5f')](_0x0ceb('0x5a'))[_0x0ceb('0xe')](function(_0x193d66){if(_[_0x0ceb('0x60')](_0x193d66)){_0x23152c[_0x0ceb('0x5a')]=_0x4b6547[_0x0ceb('0x61')]||0x1;return;}if(_['isNil'](_0x4b6547[_0x0ceb('0x61')])||_0x4b6547[_0x0ceb('0x61')]===_0x193d66){_0x23152c[_0x0ceb('0x5a')]=_0x193d66+0x1;return;}if(_0x4b6547[_0x0ceb('0x61')]>_0x193d66){_0x23152c[_0x0ceb('0x5a')]=_0x4b6547[_0x0ceb('0x61')];return;}return db[_0x0ceb('0x62')]['query'](_0x0ceb('0x63'),{'type':db[_0x0ceb('0x62')][_0x0ceb('0x64')]['SELECT']})[_0x0ceb('0xe')](function(_0x25903d){if(_0x25903d&&_0x25903d[_0x0ceb('0x40')]){for(var _0x126a03=0x0,_0x37444d=_0x25903d[_0x0ceb('0x40')];_0x126a03<_0x37444d&&_[_0x0ceb('0x60')](_0x23152c[_0x0ceb('0x5a')]);_0x126a03++){if(_0x4b6547[_0x0ceb('0x61')]<=_0x25903d[_0x126a03][_0x0ceb('0x65')]){_0x23152c['internal']=_0x25903d[_0x126a03][_0x0ceb('0x65')];}else if(_0x4b6547[_0x0ceb('0x61')]>_0x25903d[_0x126a03][_0x0ceb('0x65')]&&_0x4b6547['min_internal']<=_0x25903d[_0x126a03]['to']){_0x23152c[_0x0ceb('0x5a')]=_0x4b6547[_0x0ceb('0x61')];}}}if(_[_0x0ceb('0x60')](_0x23152c['internal'])){_0x23152c[_0x0ceb('0x5a')]=_0x193d66+0x1;}return _0x44f321(_0x23152c);});});})[_0x0ceb('0x17')](function(_0x2ecd82){_0x286160(_0x2ecd82);});});}function updateUser(_0x21a177){return new BPromise(function(_0x281113,_0x540575){try{if(_0x21a177['voicemail']){_0x21a177['mailbox']=_0x21a177[_0x0ceb('0x5a')];_0x21a177['VoiceMail']={'mailbox':_0x21a177[_0x0ceb('0x5a')],'password':_0x21a177[_0x0ceb('0x37')],'fullname':_0x21a177[_0x0ceb('0x66')],'email':_0x21a177[_0x0ceb('0x67')]};}if(_0x21a177['role']===_0x0ceb('0x27')){if(!_0x21a177[_0x0ceb('0x68')])_0x21a177['permissions']=[_0x0ceb('0x69'),'102',_0x0ceb('0x6a'),_0x0ceb('0x6b'),_0x0ceb('0x6c'),_0x0ceb('0x6d'),'105',_0x0ceb('0x6e'),_0x0ceb('0x6f'),_0x0ceb('0x70'),'109',_0x0ceb('0x71'),'111',_0x0ceb('0x72'),_0x0ceb('0x73')];}_0x281113(_0x21a177);}catch(_0x2ab4c8){_0x540575(_0x2ab4c8);}});}exports[_0x0ceb('0x74')]=function(_0x2e1fff,_0x45a8c4){if(_0x2e1fff['user'][_0x0ceb('0x23')]===_0x0ceb('0x27'))throw new Error(_0x0ceb('0x75'));if(_0x2e1fff[_0x0ceb('0x55')][_0x0ceb('0x23')]===_0x0ceb('0x76')&&_0x2e1fff[_0x0ceb('0x76')][_0x0ceb('0x23')]!=='admin'){throw new Error(_0x0ceb('0x77'));}if(_0x2e1fff[_0x0ceb('0x55')][_0x0ceb('0x23')]==='admin'&&_0x2e1fff[_0x0ceb('0x76')][_0x0ceb('0x23')]!==_0x0ceb('0x24')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil[_0x0ceb('0x78')]([_0x2e1fff['body']])['then'](function(){return validateUser(_0x2e1fff[_0x0ceb('0x55')]);})[_0x0ceb('0xe')](function(_0x47e287){return updateUser(_0x47e287)[_0x0ceb('0xe')](function(_0x86891b){if(_0x86891b['role']===_0x0ceb('0x24')){_0x86891b[_0x0ceb('0x79')]=_0x2e1fff['user']['settingsEnabled'];delete _0x86891b[_0x0ceb('0x7a')];}return _0x86891b;});})[_0x0ceb('0xe')](function(_0x2a8df3){return db[_0x0ceb('0x32')][_0x0ceb('0x74')](_0x2a8df3,{'include':[{'model':db[_0x0ceb('0x7b')],'as':_0x0ceb('0x7b')}]});})[_0x0ceb('0xe')](function(_0x5304ff){if(_0x2e1fff[_0x0ceb('0x55')][_0x0ceb('0x23')]===_0x0ceb('0x76'))return _0x5304ff;if(_0x2e1fff[_0x0ceb('0x76')][_0x0ceb('0x23')]!==_0x0ceb('0x76'))return _0x5304ff;return db[_0x0ceb('0x7c')]['find']({'where':{'name':_0x5304ff[_0x0ceb('0x23')]===_0x0ceb('0x27')?_0x0ceb('0x26'):_0x0ceb('0x7d'),'userProfileId':_0x2e1fff[_0x0ceb('0x76')][_0x0ceb('0x7a')]},'raw':!![]})['then'](function(_0x626830){if(!_0x626830||_0x626830[_0x0ceb('0x7e')]!=0x0)return _0x5304ff;return db[_0x0ceb('0x2f')][_0x0ceb('0x74')]({'name':_0x5304ff[_0x0ceb('0x2e')],'resourceId':_0x5304ff['id'],'type':_0x626830[_0x0ceb('0x2e')],'sectionId':_0x626830['id']},{})['then'](function(){return _0x5304ff;});})[_0x0ceb('0x17')](function(_0x33db99){logger[_0x0ceb('0x13')](_0x0ceb('0x7f'),_0x33db99);throw _0x33db99;});})[_0x0ceb('0xe')](respondWithResult(_0x45a8c4,0xc9))['catch'](handleError(_0x45a8c4,null));};exports[_0x0ceb('0x80')]=function(_0x4e1d8f,_0x414951){var _0x1c56e7=_0x4e1d8f[_0x0ceb('0x55')];var _0x465902=[];if(_0x4e1d8f[_0x0ceb('0x76')][_0x0ceb('0x23')]===_0x0ceb('0x27'))throw new Error(_0x0ceb('0x75'));if(_[_0x0ceb('0x81')](_0x1c56e7,['role',_0x0ceb('0x76')])&&_0x4e1d8f[_0x0ceb('0x76')][_0x0ceb('0x23')]!==_0x0ceb('0x24')){throw new Error(_0x0ceb('0x77'));}if(_['some'](_0x1c56e7,[_0x0ceb('0x23'),_0x0ceb('0x24')])&&_0x4e1d8f['user']['role']!==_0x0ceb('0x24')){throw new Error(_0x0ceb('0x82'));}return licenseUtil[_0x0ceb('0x78')](_0x1c56e7)[_0x0ceb('0xe')](function(){return validateUser(_0x1c56e7[0x0]);})[_0x0ceb('0xe')](function(){for(var _0x46c3fc=0x1;_0x46c3fc<_0x1c56e7[_0x0ceb('0x40')];_0x46c3fc++){var _0x17cf93=_0x1c56e7[_0x46c3fc-0x1][_0x0ceb('0x5a')];if(!_0x1c56e7[_0x46c3fc][_0x0ceb('0x5a')])_0x1c56e7[_0x46c3fc][_0x0ceb('0x5a')]=_0x17cf93+0x1;_0x465902['push'](validateUser(_0x1c56e7[_0x46c3fc]));}return BPromise['all'](_0x465902);})['then'](function(){_0x465902=[];for(var _0x283d93=0x0;_0x283d93<_0x1c56e7[_0x0ceb('0x40')];_0x283d93++){_0x465902[_0x0ceb('0x41')](updateUser(_0x1c56e7[_0x283d93]));}return BPromise[_0x0ceb('0x48')](_0x465902);})['then'](function(){return BPromise[_0x0ceb('0x83')](_0x1c56e7,function(_0x22657e){return db[_0x0ceb('0x32')][_0x0ceb('0x74')](_0x22657e,{'include':[{'model':db[_0x0ceb('0x7b')],'as':_0x0ceb('0x7b')}]})[_0x0ceb('0xe')](function(_0x3dd13d){_0x22657e['id']=_0x3dd13d['id'];return _0x22657e;});});})[_0x0ceb('0xe')](function(_0xbcdf6d){if(_0x4e1d8f[_0x0ceb('0x55')][_0x0ceb('0x23')]===_0x0ceb('0x76'))return _0xbcdf6d;if(_0x4e1d8f[_0x0ceb('0x76')][_0x0ceb('0x23')]!==_0x0ceb('0x76'))return _0xbcdf6d;var _0x3af9de=_[_0x0ceb('0x81')](_0xbcdf6d,function(_0x1235ba){return _0x1235ba['role']===_0x0ceb('0x27')||_0x1235ba['role']===_0x0ceb('0x28');});if(!_0x3af9de)return _0xbcdf6d;return db[_0x0ceb('0x7c')][_0x0ceb('0x84')]({'where':{'name':{'$or':[_0x0ceb('0x26'),'Telephones']},'userProfileId':_0x4e1d8f[_0x0ceb('0x76')][_0x0ceb('0x7a')]},'raw':!![]})[_0x0ceb('0xe')](function(_0x44e70f){if(_['isEmpty'](_0x44e70f)||!_[_0x0ceb('0x81')](_0x44e70f,['autoAssociation',0x0]))return _0xbcdf6d;_0x465902=[];var _0x63a7e5=_(_0x44e70f)['map'](function(_0x162a9b){if(_0x162a9b['autoAssociation']===0x1)return;return _0x162a9b[_0x0ceb('0x2e')]===_0x0ceb('0x26')?'agent':_0x0ceb('0x28');})['compact']()[_0x0ceb('0x2b')]();for(var _0x3282c3=0x0;_0x3282c3<_0xbcdf6d[_0x0ceb('0x40')];_0x3282c3++){if(!_[_0x0ceb('0x2c')](_0x63a7e5,_0xbcdf6d[_0x3282c3][_0x0ceb('0x23')]))return;var _0x32698b=_0xbcdf6d[_0x3282c3][_0x0ceb('0x23')]===_0x0ceb('0x27')?'Agents':_0x0ceb('0x7d');_0x465902['push'](db[_0x0ceb('0x2f')][_0x0ceb('0x74')]({'name':_0xbcdf6d[_0x3282c3]['name'],'resourceId':_0xbcdf6d[_0x3282c3]['id'],'type':_0x32698b,'sectionId':_[_0x0ceb('0x2d')](_0x44e70f,[_0x0ceb('0x2e'),_0x32698b])['id']},{}));}return BPromise[_0x0ceb('0x48')](_0x465902);});})[_0x0ceb('0xe')](respondWithResult(_0x414951,0xc9))[_0x0ceb('0x17')](handleError(_0x414951,null));};exports[_0x0ceb('0x85')]=function(_0x265808,_0x1be06a){if(_0x265808[_0x0ceb('0x55')]['id']){delete _0x265808[_0x0ceb('0x55')]['id'];}return db['User'][_0x0ceb('0x2d')]({'where':{'id':_0x265808[_0x0ceb('0x4a')]['id']}})[_0x0ceb('0xe')](function(_0x396266){if(!_0x396266)return null;if(_0x396266['id']===_0x265808[_0x0ceb('0x76')]['id']){if(!_0x265808['body'][_0x0ceb('0x86')]||!_0x265808[_0x0ceb('0x55')][_0x0ceb('0x87')]){throw new db[(_0x0ceb('0x88'))][(_0x0ceb('0x89'))](_0x0ceb('0x8a'));}if(!_0x396266['authenticate'](_0x265808[_0x0ceb('0x55')][_0x0ceb('0x86')])){throw new db[(_0x0ceb('0x88'))][(_0x0ceb('0x89'))]('Wrong\x20credentials');}if(_0x265808['body'][_0x0ceb('0x86')]===_0x265808[_0x0ceb('0x55')][_0x0ceb('0x87')]){throw new db[(_0x0ceb('0x88'))][(_0x0ceb('0x89'))](_0x0ceb('0x8b'));}}else if(_0x265808[_0x0ceb('0x76')][_0x0ceb('0x23')]==='admin'){if(!_0x265808[_0x0ceb('0x55')][_0x0ceb('0x87')]){throw new db[(_0x0ceb('0x88'))][(_0x0ceb('0x89'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0x265808[_0x0ceb('0x76')][_0x0ceb('0x23')]==='user'){if(!_0x265808[_0x0ceb('0x55')]['newPassword']){throw new db[(_0x0ceb('0x88'))][(_0x0ceb('0x89'))](_0x0ceb('0x8c'));}if(_0x396266[_0x0ceb('0x23')]!==_0x0ceb('0x27')){throw new db[(_0x0ceb('0x88'))]['ValidationError'](_0x0ceb('0x75'));}}else{throw new db[(_0x0ceb('0x88'))]['ValidationError'](_0x0ceb('0x75'));}return _0x396266;})[_0x0ceb('0xe')](handleEntityNotFound(_0x1be06a,null))['then'](function(_0x7b2f1e){return db[_0x0ceb('0x5b')][_0x0ceb('0x8d')]({'attributes':['id',_0x0ceb('0x5d'),_0x0ceb('0x8e'),_0x0ceb('0x8f')]})['then'](function(_0x380e31){if(_0x380e31[_0x0ceb('0x5d')])authService[_0x0ceb('0x5e')](_0x265808[_0x0ceb('0x55')][_0x0ceb('0x87')]);if(!_0x380e31['enforcePasswordHistory']||!_0x7b2f1e[_0x0ceb('0x90')])return _0x7b2f1e;authService['validatePasswordHistory'](_0x265808[_0x0ceb('0x55')]['newPassword'],_0x7b2f1e[_0x0ceb('0x90')],_0x380e31[_0x0ceb('0x8f')]);return _0x7b2f1e;})[_0x0ceb('0xe')](saveUpdates({'password':_0x265808[_0x0ceb('0x55')]['newPassword'],'passwordResetAt':_0x265808[_0x0ceb('0x76')]['id']==_0x265808[_0x0ceb('0x4a')]['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x265808['body'][_0x0ceb('0x87')],_0x7b2f1e[_0x0ceb('0x90')])},null));})[_0x0ceb('0xe')](respondWithResult(_0x1be06a,null))[_0x0ceb('0x17')](handleError(_0x1be06a,null));};exports[_0x0ceb('0x91')]=function(_0x159c5e,_0x1fe92e){var _0x3595e8=_0x159c5e['body'][_0x0ceb('0x92')];return db[_0x0ceb('0x32')][_0x0ceb('0x2d')]({'where':{'id':_0x159c5e[_0x0ceb('0x4a')]['id']},'attributes':['id',_0x0ceb('0x2e'),'role',_0x0ceb('0x93'),_0x0ceb('0x94'),'voicePause',_0x0ceb('0x95')]})[_0x0ceb('0xe')](handleEntityNotFound(_0x1fe92e,null))[_0x0ceb('0xe')](function(_0x3bfc41){if(_0x3bfc41){if(!utils['isValidChannel'](_0x3595e8)){throw new db['Sequelize'][(_0x0ceb('0x89'))](_0x0ceb('0x96'));}return _0x3bfc41[_0x0ceb('0x97')+_['capitalize'](_0x3595e8[_0x0ceb('0x98')]())+_0x0ceb('0x99')](_0x159c5e[_0x0ceb('0x55')]['ids'],{'penalty':_0x159c5e[_0x0ceb('0x55')][_0x0ceb('0x9a')]||0x0})[_0x0ceb('0x9b')](function(_0x321f22){for(var _0x2da64f=0x0;_0x2da64f<_0x159c5e['body'][_0x0ceb('0x58')][_0x0ceb('0x40')];_0x2da64f+=0x1){var _0x7797d8={'UserId':Number(_0x159c5e[_0x0ceb('0x4a')]['id'])};_0x7797d8[_[_0x0ceb('0x9c')](_0x3595e8[_0x0ceb('0x98')]())+_0x0ceb('0x9d')]=Number(_0x159c5e[_0x0ceb('0x55')][_0x0ceb('0x58')][_0x2da64f]);socket[_0x0ceb('0x9e')](_0x0ceb('0x76')+_[_0x0ceb('0x9c')](_0x3595e8[_0x0ceb('0x98')]())+'Queue:save',_0x7797d8);}return _0x321f22;})[_0x0ceb('0xe')](function(){if(_0x3595e8===_0x0ceb('0x9f')){return db['VoiceQueue']['findAll']({'where':{'id':_0x159c5e[_0x0ceb('0x55')][_0x0ceb('0x58')]||[]},'raw':!![],'attributes':['id',_0x0ceb('0x2e')]});}})[_0x0ceb('0xe')](function(_0xf2dab2){var _0x4f1be7=_0x3bfc41[_0x0ceb('0x22')]({'plain':!![]});var _0x24b2d3=[];if(_0x3595e8===_0x0ceb('0x9f')&&_0x4f1be7['role']===_0x0ceb('0x27')&&_0x4f1be7['online']){for(var _0x3163ec=0x0;_0x3163ec<_0xf2dab2[_0x0ceb('0x40')];_0x3163ec+=0x1){_0x24b2d3[_0x0ceb('0x41')]({'membername':_0x4f1be7[_0x0ceb('0x2e')],'UserId':_0x4f1be7['id'],'queue_name':_0xf2dab2[_0x3163ec][_0x0ceb('0x2e')],'VoiceQueueId':_0xf2dab2[_0x3163ec]['id'],'interface':_[_0x0ceb('0x60')](_0x4f1be7[_0x0ceb('0x95')])?util[_0x0ceb('0xa0')]('SIP/%s',_0x4f1be7[_0x0ceb('0x2e')]):_0x4f1be7[_0x0ceb('0x95')],'paused':_0x4f1be7[_0x0ceb('0xa1')]||![],'penalty':_0x159c5e[_0x0ceb('0x55')][_0x0ceb('0x9a')]||0x0});}return BPromise[_0x0ceb('0x83')](_0x24b2d3,function(_0xf06ce8){return db[_0x0ceb('0xa2')][_0x0ceb('0xa3')](_0xf06ce8);});}return _0x3bfc41;});}})['then'](respondWithStatusCode(_0x1fe92e,null))[_0x0ceb('0x17')](handleError(_0x1fe92e,null));};exports[_0x0ceb('0xa4')]=function(_0x41fc52,_0x597f56){var _0x2b9e9b;return db['User'][_0x0ceb('0x2d')]({'where':{'id':_0x41fc52[_0x0ceb('0x4a')]['id']},'attributes':['id','name',_0x0ceb('0x23')]})[_0x0ceb('0xe')](handleEntityNotFound(_0x597f56,null))[_0x0ceb('0xe')](function(_0x10ebcd){if(_0x10ebcd){_0x2b9e9b=_0x10ebcd;if(!_0x41fc52['query'][_0x0ceb('0x92')]||!utils[_0x0ceb('0xa5')](_0x41fc52[_0x0ceb('0x3b')]['channel'])){throw new db[(_0x0ceb('0x88'))][(_0x0ceb('0x89'))](_0x0ceb('0x96'));}return _0x10ebcd[_0x0ceb('0xa6')+_[_0x0ceb('0x9c')](_0x41fc52[_0x0ceb('0x3b')]['channel'][_0x0ceb('0x98')]())+'Queues'](_0x41fc52[_0x0ceb('0x3b')][_0x0ceb('0x58')]);}})[_0x0ceb('0xe')](function(_0x4fb4cb){if(_[_0x0ceb('0xa7')](_0x41fc52[_0x0ceb('0x3b')]['ids'])){for(var _0x453dc9=0x0;_0x453dc9<_0x41fc52['query'][_0x0ceb('0x58')]['length'];_0x453dc9+=0x1){var _0x25f1ec={'UserId':Number(_0x41fc52[_0x0ceb('0x4a')]['id'])};_0x25f1ec[_[_0x0ceb('0x9c')](_0x41fc52[_0x0ceb('0x3b')]['channel'][_0x0ceb('0x98')]())+'QueueId']=Number(_0x41fc52['query'][_0x0ceb('0x58')][_0x453dc9]);socket[_0x0ceb('0x9e')](_0x0ceb('0x76')+_['capitalize'](_0x41fc52[_0x0ceb('0x3b')][_0x0ceb('0x92')][_0x0ceb('0x98')]())+'Queue:remove',_0x25f1ec);}}else{var _0x25f1ec={'UserId':Number(_0x41fc52[_0x0ceb('0x4a')]['id'])};_0x25f1ec[_[_0x0ceb('0x9c')](_0x41fc52[_0x0ceb('0x3b')]['channel'][_0x0ceb('0x98')]())+_0x0ceb('0x9d')]=Number(_0x41fc52[_0x0ceb('0x3b')][_0x0ceb('0x58')]);socket[_0x0ceb('0x9e')](_0x0ceb('0x76')+_['capitalize'](_0x41fc52[_0x0ceb('0x3b')][_0x0ceb('0x92')]['toLowerCase']())+_0x0ceb('0xa8'),_0x25f1ec);}return _0x4fb4cb;})['then'](function(){if(_0x41fc52[_0x0ceb('0x3b')]['channel']==='voice'){return db['UserVoiceQueueRt'][_0x0ceb('0x21')]({'where':{'UserId':_0x41fc52[_0x0ceb('0x4a')]['id'],'VoiceQueueId':_0x41fc52[_0x0ceb('0x3b')][_0x0ceb('0x58')]},'individualHooks':!![]})['then'](function(){return _0x2b9e9b;});}return _0x2b9e9b;})[_0x0ceb('0xe')](respondWithStatusCode(_0x597f56,null))['catch'](handleError(_0x597f56,null));};exports[_0x0ceb('0xa9')]=function(_0x5bdd71,_0x97acca){_0x5bdd71[_0x0ceb('0x55')][_0x0ceb('0xaa')]=_0x5bdd71[_0x0ceb('0xab')][_0x0ceb('0xac')];return db[_0x0ceb('0x32')][_0x0ceb('0x2d')]({'where':{'id':_0x5bdd71['params']['id']}})[_0x0ceb('0xe')](handleEntityNotFound(_0x97acca,null))[_0x0ceb('0xe')](saveUpdates(_0x5bdd71[_0x0ceb('0x55')],null))[_0x0ceb('0xe')](respondWithResult(_0x97acca,null))[_0x0ceb('0x17')](handleError(_0x97acca,null));};exports['getAvatar']=function(_0x2e39c8,_0x1eb0dc){var _0x52955e=path['join'](config[_0x0ceb('0xad')],_0x0ceb('0xae'));return db[_0x0ceb('0x32')][_0x0ceb('0x2d')]({'where':{'id':_0x2e39c8[_0x0ceb('0x4a')]['id']},'attributes':['id',_0x0ceb('0xaa')],'raw':!![]})[_0x0ceb('0xe')](handleEntityNotFound(_0x1eb0dc,null))[_0x0ceb('0xe')](function(_0x59718b){if(_0x59718b){if(_[_0x0ceb('0x60')](_0x59718b[_0x0ceb('0xaa')])){return _0x1eb0dc[_0x0ceb('0xaf')](_0x52955e);}else{if(!fs['existsSync'](path['join'](config[_0x0ceb('0xad')],_0x0ceb('0xb0'),_0x59718b[_0x0ceb('0xaa')]))){return _0x1eb0dc[_0x0ceb('0xaf')](_0x52955e);}return _0x1eb0dc[_0x0ceb('0xaf')](path[_0x0ceb('0xb1')](config[_0x0ceb('0xad')],'server/files/images/',_0x59718b[_0x0ceb('0xaa')]));}}})[_0x0ceb('0x17')](handleError(_0x1eb0dc,null));};exports[_0x0ceb('0xb2')]=function(_0x119d81,_0x1e0622){return db['User'][_0x0ceb('0x2d')]({'where':{'id':_0x119d81[_0x0ceb('0x4a')]['id']},'attributes':['id']})[_0x0ceb('0xe')](handleEntityNotFound(_0x1e0622,null))['then'](function(_0x40df4b){var _0x4001f4=[];values=_0x40df4b['dataValues'];_0x4001f4['push'](get_open_tabs(_0x0ceb('0x42'),_0x40df4b['dataValues']));_0x4001f4[_0x0ceb('0x41')](get_open_tabs(_0x0ceb('0x54'),_0x40df4b[_0x0ceb('0x43')]));_0x4001f4[_0x0ceb('0x41')](get_open_tabs(_0x0ceb('0x46'),_0x40df4b[_0x0ceb('0x43')]));_0x4001f4['push'](get_open_tabs(_0x0ceb('0x47'),_0x40df4b[_0x0ceb('0x43')]));_0x4001f4[_0x0ceb('0x41')](get_open_tabs(_0x0ceb('0x44'),_0x40df4b['dataValues']));_0x4001f4[_0x0ceb('0x41')](get_open_tabs('mail',_0x40df4b[_0x0ceb('0x43')]));return BPromise['all'](_0x4001f4);})[_0x0ceb('0xe')](function(_0x367d43){var _0x258761=[];if(_0x367d43){for(var _0x3d451b=0x0;_0x3d451b=_0x1e4240[_0x074e('0x4f')]){throw new Error(_0x074e('0x50'));}})[_0x074e('0x10')](function(){if(_0x222d80){return db[_0x074e('0x44')][_0x074e('0x51')]({'where':{'membername':_0x222d80[_0x074e('0x29')]},'individualHooks':!![]});}})['then'](function(){if(_0x222d80){return _0x222d80[_0x074e('0x52')]({'raw':!![]});}})['then'](function(_0x4739d6){if(_0x222d80){if(_0x4739d6){var _0x13be88=[];_0x3f4f29=_0x4739d6;if(_0x3f4f29[_0x074e('0x2e')]){for(var _0xd0f73c=0x0;_0xd0f73c<_0x3f4f29[_0x074e('0x2e')];_0xd0f73c++){_0x13be88['push'](db['UserVoiceQueueRt'][_0x074e('0x53')]({'membername':_0x222d80[_0x074e('0x29')],'UserId':_0x222d80['id'],'queue_name':_0x3f4f29[_0xd0f73c][_0x074e('0x29')],'VoiceQueueId':_0x3f4f29[_0xd0f73c]['id'],'interface':_0x17d6ae,'paused':_0x222d80[_0x074e('0x54')]||![],'penalty':_0x3f4f29[_0xd0f73c]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0x074e('0x46')](_0x13be88);}}}})[_0x074e('0x10')](function(){if(_0x222d80){return db[_0x074e('0x2d')][_0x074e('0x1e')]({'where':{'membername':_0x222d80['name'],'exitAt':null}});}})[_0x074e('0x10')](function(_0xef6d00){if(_0x222d80){if(_0xef6d00&&_0xef6d00[_0x074e('0x2e')]){var _0xb08c83=[];_0xef6d00[_0x074e('0x31')](function(_0x2b4aed){_0xb08c83[_0x074e('0x45')](_0x2b4aed[_0x074e('0x2c')]({'exitAt':moment()[_0x074e('0x2f')](_0x074e('0x30'))}));});return BPromise['all'](_0xb08c83);}}})[_0x074e('0x10')](function(_0x61dd04){if(_0x222d80){var _0xafd6fa=[];var _0x9ccee4=[];var _0x59e72b=utils[_0x074e('0x55')]();var _0x33c7c5={'membername':_0x222d80[_0x074e('0x29')],'interface':_0x17d6ae,'enterAt':moment()[_0x074e('0x2f')](_0x074e('0x30')),'role':_0x222d80[_0x074e('0x2a')],'internal':_0x222d80[_0x074e('0x56')]};_0x59e72b[_0x074e('0x31')](function(_0x1d022e){_0xafd6fa[_0x074e('0x45')](_[_0x074e('0x57')]({'channel':_0x1d022e,'type':_0x074e('0x58'),'data1':'callysquare','data2':_0x17d6ae},_0x33c7c5));if(_0x222d80['loginInPause']){_0x9ccee4[_0x074e('0x45')](_['merge']({'channel':_0x1d022e,'type':_0x074e('0x42'),'data1':_0x074e('0x59')},_0x33c7c5));}});return db[_0x074e('0x2d')][_0x074e('0x37')](_0xafd6fa[_0x074e('0x5a')](_0x9ccee4),{'individualHooks':!![]});}})[_0x074e('0x10')](function(){if(_0x222d80){return _0x222d80['update']({'online':!![],'lastLoginAt':moment()[_0x074e('0x2f')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x222d80[_0x074e('0x54')]||![],'mailPause':_0x222d80[_0x074e('0x54')]||![],'chatPause':_0x222d80[_0x074e('0x54')]||![],'faxPause':_0x222d80[_0x074e('0x54')]||![],'smsPause':_0x222d80[_0x074e('0x54')]||![],'openchannelPause':_0x222d80[_0x074e('0x54')]||![],'pauseType':_0x222d80[_0x074e('0x54')]?_0x074e('0x59'):null,'lastPauseAt':moment()['format'](_0x074e('0x30')),'interface':_0x17d6ae});}})['then'](function(_0x1515ee){_0x479aa8(_0x1515ee);})[_0x074e('0x1b')](function(_0x2ae4e8){_0xfe2db3(_0x26e511[_0x074e('0x17')](0x1f4,_0x2ae4e8[_0x074e('0x19')]));});});}; \ No newline at end of file +var _0x9949=['client','redis','socket.io-emitter','./user.socket','register','request','then','info','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','findAll','options','raw','where','attributes','limit','map','include','model','GetUser','User','find','ShowUser','internal','UserVoiceQueueRt','update','MemberReport','PAUSE','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','forEach','name','isNil','interface','SIP/%s','body','type','DEFAULT\x20PAUSE','role','uniqueid','UnpauseUser','findOne','channel','Unknown\x20channel','voice','system','mail','chat','fax','openchannel','set','push','all','LogoutUser','destroy','LoginUser','mobile','loginInPause','count','agent','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','upsert','LOGIN','callysquare','merge','LOGININPAUSE','bulkCreate','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise'];(function(_0x127522,_0x489489){var _0x165b77=function(_0x1bc64a){while(--_0x1bc64a){_0x127522['push'](_0x127522['shift']());}};_0x165b77(++_0x489489);}(_0x9949,0x159));var _0x9994=function(_0x418038,_0x7bc330){_0x418038=_0x418038-0x0;var _0x4292c7=_0x9949[_0x418038];return _0x4292c7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9994('0x0'));var BPromise=require('bluebird');var rs=require(_0x9994('0x1'));var fs=require('fs');var Redis=require(_0x9994('0x2'));var db=require(_0x9994('0x3'))['db'];var utils=require(_0x9994('0x4'));var logger=require('../../config/logger')(_0x9994('0x5'));var config=require('../../config/environment');var jayson=require(_0x9994('0x6'));var client=jayson[_0x9994('0x7')]['http']({'port':0x232a});config[_0x9994('0x8')]=_['defaults'](config[_0x9994('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x9994('0x9'))(new Redis(config[_0x9994('0x8')]));require(_0x9994('0xa'))[_0x9994('0xb')](socket);function respondWithRpcPromise(_0x17f345,_0x182856,_0x524639){return new BPromise(function(_0x526b4e,_0x4bf95f){return client[_0x9994('0xc')](_0x17f345,_0x524639)[_0x9994('0xd')](function(_0x4120d5){logger[_0x9994('0xe')](_0x9994('0xf'),_0x182856,_0x9994('0x10'));logger[_0x9994('0x11')](_0x9994('0x12'),_0x182856,_0x9994('0x10'),JSON[_0x9994('0x13')](_0x4120d5));if(_0x4120d5[_0x9994('0x14')]){if(_0x4120d5['error'][_0x9994('0x15')]===0x1f4){logger[_0x9994('0x14')](_0x9994('0xf'),_0x182856,_0x4120d5['error']['message']);return _0x4bf95f(_0x4120d5[_0x9994('0x14')][_0x9994('0x16')]);}logger[_0x9994('0x14')](_0x9994('0xf'),_0x182856,_0x4120d5[_0x9994('0x14')][_0x9994('0x16')]);return _0x526b4e(_0x4120d5[_0x9994('0x14')][_0x9994('0x16')]);}else{logger['info'](_0x9994('0xf'),_0x182856,_0x9994('0x10'));_0x526b4e(_0x4120d5[_0x9994('0x17')][_0x9994('0x16')]);}})[_0x9994('0x18')](function(_0x594fd0){logger[_0x9994('0x14')]('User,\x20%s,\x20%s',_0x182856,_0x594fd0);_0x4bf95f(_0x594fd0);});});}exports['GetUser']=function(_0x2360e2){var _0x36818e=this;return new Promise(function(_0x40fe86,_0x341a84){return db['User'][_0x9994('0x19')]({'raw':_0x2360e2[_0x9994('0x1a')]?_0x2360e2[_0x9994('0x1a')][_0x9994('0x1b')]===undefined?!![]:![]:!![],'where':_0x2360e2[_0x9994('0x1a')]?_0x2360e2[_0x9994('0x1a')][_0x9994('0x1c')]||null:null,'attributes':_0x2360e2[_0x9994('0x1a')]?_0x2360e2[_0x9994('0x1a')][_0x9994('0x1d')]||null:null,'limit':_0x2360e2[_0x9994('0x1a')]?_0x2360e2[_0x9994('0x1a')][_0x9994('0x1e')]||null:null,'include':_0x2360e2['options']?_0x2360e2[_0x9994('0x1a')]['include']?_[_0x9994('0x1f')](_0x2360e2['options'][_0x9994('0x20')],function(_0xf11651){return{'model':db[_0xf11651[_0x9994('0x21')]],'as':_0xf11651['as'],'attributes':_0xf11651[_0x9994('0x1d')],'include':_0xf11651[_0x9994('0x20')]?_['map'](_0xf11651['include'],function(_0x644449){return{'model':db[_0x644449[_0x9994('0x21')]],'as':_0x644449['as'],'attributes':_0x644449[_0x9994('0x1d')],'include':_0x644449['include']?_[_0x9994('0x1f')](_0x644449['include'],function(_0x36048){return{'model':db[_0x36048['model']],'as':_0x36048['as'],'attributes':_0x36048[_0x9994('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45ead0){logger[_0x9994('0xe')](_0x9994('0x22'),_0x2360e2);logger[_0x9994('0x11')]('GetUser',_0x2360e2,JSON['stringify'](_0x45ead0));_0x40fe86(_0x45ead0);})['catch'](function(_0x39304c){logger[_0x9994('0x14')](_0x9994('0x22'),_0x39304c['message'],_0x2360e2);_0x341a84(_0x36818e[_0x9994('0x14')](0x1f4,_0x39304c[_0x9994('0x16')]));});});};exports['ShowUser']=function(_0x5bb35c){var _0x364a99=this;return new Promise(function(_0x1a60de,_0x57029c){return db[_0x9994('0x23')][_0x9994('0x24')]({'raw':_0x5bb35c[_0x9994('0x1a')]?_0x5bb35c[_0x9994('0x1a')][_0x9994('0x1b')]===undefined?!![]:![]:!![],'where':_0x5bb35c['options']?_0x5bb35c[_0x9994('0x1a')]['where']||null:null,'attributes':_0x5bb35c[_0x9994('0x1a')]?_0x5bb35c['options']['attributes']||null:null,'include':_0x5bb35c[_0x9994('0x1a')]?_0x5bb35c[_0x9994('0x1a')]['include']?_[_0x9994('0x1f')](_0x5bb35c[_0x9994('0x1a')]['include'],function(_0x616d40){return{'model':db[_0x616d40[_0x9994('0x21')]],'as':_0x616d40['as'],'attributes':_0x616d40[_0x9994('0x1d')],'include':_0x616d40[_0x9994('0x20')]?_[_0x9994('0x1f')](_0x616d40['include'],function(_0x2cb71f){return{'model':db[_0x2cb71f[_0x9994('0x21')]],'as':_0x2cb71f['as'],'attributes':_0x2cb71f[_0x9994('0x1d')],'include':_0x2cb71f['include']?_[_0x9994('0x1f')](_0x2cb71f['include'],function(_0x4cfd24){return{'model':db[_0x4cfd24[_0x9994('0x21')]],'as':_0x4cfd24['as'],'attributes':_0x4cfd24['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x20038e){logger[_0x9994('0xe')](_0x9994('0x25'),_0x5bb35c);logger[_0x9994('0x11')](_0x9994('0x25'),_0x5bb35c,JSON[_0x9994('0x13')](_0x20038e));_0x1a60de(_0x20038e);})[_0x9994('0x18')](function(_0x345f7c){logger[_0x9994('0x14')](_0x9994('0x25'),_0x345f7c['message'],_0x5bb35c);_0x57029c(_0x364a99['error'](0x1f4,_0x345f7c['message']));});});};exports['PauseUser']=function(_0x347fa5){var _0x3027a6=this;return new Promise(function(_0x146783,_0x3c2983){var _0x4484d3;return db[_0x9994('0x23')][_0x9994('0x24')]({'where':_0x347fa5['options'][_0x9994('0x1c')]||{},'attributes':['id','name','role',_0x9994('0x26'),'interface']})[_0x9994('0xd')](function(_0x263c16){if(_0x263c16){_0x4484d3=_0x263c16;return db[_0x9994('0x27')][_0x9994('0x28')]({'paused':0x1},{'where':{'UserId':_0x4484d3['id']},'individualHooks':!![]});}})['then'](function(){if(_0x4484d3){return db[_0x9994('0x29')][_0x9994('0x19')]({'where':{'membername':_0x4484d3['name'],'type':_0x9994('0x2a'),'exitAt':null}});}})[_0x9994('0xd')](function(_0x4c0f27){if(_0x4484d3){if(_0x4c0f27&&_0x4c0f27[_0x9994('0x2b')]){var _0x226f0e=moment()[_0x9994('0x2c')](_0x9994('0x2d'));for(var _0x2caf2a=0x0,_0x346362=_0x4c0f27['length'];_0x2caf2a<_0x346362;_0x2caf2a++){_0x4c0f27[_0x2caf2a][_0x9994('0x2e')]({'exitAt':_0x226f0e});}}}})[_0x9994('0xd')](function(){if(_0x4484d3){var _0x4b5179=[];var _0x25c6a8=utils[_0x9994('0x2f')]();_0x25c6a8[_0x9994('0x30')](function(_0x348164){_0x4b5179['push']({'channel':_0x348164,'membername':_0x4484d3[_0x9994('0x31')],'interface':_[_0x9994('0x32')](_0x4484d3[_0x9994('0x33')])?util['format'](_0x9994('0x34'),_0x4484d3[_0x9994('0x31')]):_0x4484d3['interface'],'type':'PAUSE','enterAt':moment()['format'](_0x9994('0x2d')),'data1':_0x347fa5[_0x9994('0x35')][_0x9994('0x36')]||_0x9994('0x37'),'role':_0x4484d3[_0x9994('0x38')],'internal':_0x4484d3['internal'],'uniqueid':_0x347fa5[_0x9994('0x35')][_0x9994('0x39')]||null});});return db['MemberReport']['bulkCreate'](_0x4b5179,{'individualHooks':!![]});}})[_0x9994('0xd')](function(){if(_0x4484d3){return _0x4484d3[_0x9994('0x28')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x347fa5[_0x9994('0x35')][_0x9994('0x36')]||_0x9994('0x37'),'lastPauseAt':moment()[_0x9994('0x2c')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0x9994('0xd')](function(_0x4454f1){_0x146783(_0x4454f1);})['catch'](function(_0xbe5e87){_0x3c2983(_0x3027a6[_0x9994('0x14')](0x1f4,_0xbe5e87[_0x9994('0x16')]));});});};exports[_0x9994('0x3a')]=function(_0x3ade08){var _0x5b2115=this;return new Promise(function(_0x1e5f17,_0x28bd23){var _0x437ea6;return db['User'][_0x9994('0x3b')]({'where':_0x3ade08['options'][_0x9994('0x1c')]||{},'attributes':['id',_0x9994('0x31')]})['then'](function(_0x48ed35){if(_0x48ed35){_0x437ea6=_0x48ed35;if(_0x3ade08['body'][_0x9994('0x3c')]&&!utils['isValidChannel'](_0x3ade08[_0x9994('0x35')][_0x9994('0x3c')])){throw new Error(_0x9994('0x3d'));}switch(_0x3ade08[_0x9994('0x35')][_0x9994('0x3c')]){case _0x9994('0x3e'):return db[_0x9994('0x27')]['update']({'paused':0x0},{'where':{'UserId':_0x437ea6['id']}})[_0x9994('0xd')](function(){return db[_0x9994('0x29')][_0x9994('0x24')]({'where':{'channel':_0x3ade08[_0x9994('0x35')][_0x9994('0x3c')],'membername':_0x437ea6['name'],'type':_0x9994('0x2a'),'exitAt':null}});})[_0x9994('0xd')](function(_0x3cbbe8){if(_0x3cbbe8){return _0x3cbbe8[_0x9994('0x28')]({'exitAt':moment()['format'](_0x9994('0x2d')),'data2':_0x9994('0x3f')},{'individualHooks':!![]});}return null;})['then'](function(){return _0x437ea6['update']({'voicePause':![]});});case _0x9994('0x40'):case _0x9994('0x41'):case _0x9994('0x42'):case'sms':case _0x9994('0x43'):case'whatsapp':return db[_0x9994('0x29')][_0x9994('0x24')]({'where':{'channel':_0x3ade08[_0x9994('0x35')][_0x9994('0x3c')],'membername':_0x437ea6[_0x9994('0x31')],'type':'PAUSE','exitAt':null}})[_0x9994('0xd')](function(_0x2f25cb){return _0x2f25cb['update']({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x9994('0x3f')},{'individualHooks':!![]});})['then'](function(){var _0x30d269={};_[_0x9994('0x44')](_0x30d269,util[_0x9994('0x2c')]('%s%s',_0x3ade08[_0x9994('0x35')][_0x9994('0x3c')],'Pause'),![]);return _0x437ea6[_0x9994('0x28')](_0x30d269);});default:return db[_0x9994('0x27')]['update']({'paused':0x0},{'where':{'UserId':_0x437ea6['id']}})[_0x9994('0xd')](function(){return db['MemberReport'][_0x9994('0x19')]({'where':{'membername':_0x437ea6['name'],'type':_0x9994('0x2a'),'exitAt':null}});})['then'](function(_0x2d3752){var _0x34259b=[];_0x2d3752[_0x9994('0x30')](function(_0x1bde22){_0x34259b[_0x9994('0x45')](_0x1bde22['update']({'exitAt':moment()[_0x9994('0x2c')](_0x9994('0x2d')),'data2':_0x9994('0x3f')}));});return BPromise[_0x9994('0x46')](_0x34259b);})[_0x9994('0xd')](function(){return _0x437ea6[_0x9994('0x28')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0x9994('0xd')](function(_0x48fb21){_0x1e5f17(_0x48fb21);})['catch'](function(_0xd7af93){_0x28bd23(_0x5b2115[_0x9994('0x14')](0x1f4,_0xd7af93[_0x9994('0x16')]));});});};exports[_0x9994('0x47')]=function(_0x56085b){var _0x462f80=this;return new Promise(function(_0x5e7852,_0x51412b){var _0x448457;return db[_0x9994('0x23')][_0x9994('0x3b')]({'where':_0x56085b[_0x9994('0x1a')][_0x9994('0x1c')]||{},'attributes':['id',_0x9994('0x31')]})[_0x9994('0xd')](function(_0x9001df){if(_0x9001df){_0x448457=_0x9001df;return db[_0x9994('0x27')][_0x9994('0x48')]({'where':{'membername':_0x448457['name']},'individualHooks':!![]});}})[_0x9994('0xd')](function(){if(_0x448457){return db[_0x9994('0x29')]['findAll']({'where':{'membername':_0x448457[_0x9994('0x31')],'exitAt':null}});}})[_0x9994('0xd')](function(_0xb82699){if(_0x448457){if(_0xb82699&&_0xb82699['length']){var _0x4c7e1d=[];_0xb82699['forEach'](function(_0x626250){_0x4c7e1d[_0x9994('0x45')](_0x626250[_0x9994('0x28')]({'exitAt':moment()[_0x9994('0x2c')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise['all'](_0x4c7e1d);}}})[_0x9994('0xd')](function(){if(_0x448457){return _0x448457[_0x9994('0x28')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x9994('0xd')](function(_0x3b56c7){_0x5e7852(_0x3b56c7);})[_0x9994('0x18')](function(_0x25d0b1){_0x51412b(_0x462f80['error'](0x1f4,_0x25d0b1['message']));});});};exports[_0x9994('0x49')]=function(_0x4ca169){var _0x59f893=this;return new Promise(function(_0x2371f8,_0x3147f8){var _0x1344ee;var _0x2f5ae1;var _0x51636b;var _0x21ba29;return db['User'][_0x9994('0x3b')]({'where':_0x4ca169[_0x9994('0x1a')][_0x9994('0x1c')]||{},'attributes':['id',_0x9994('0x31'),'role',_0x9994('0x4a'),'phone',_0x9994('0x26'),_0x9994('0x4b'),_0x9994('0x33')]})[_0x9994('0xd')](function(_0x13babd){if(_0x13babd){_0x1344ee=_0x13babd;_0x21ba29=_0x4ca169[_0x9994('0x35')]['interface']?_0x4ca169[_0x9994('0x35')][_0x9994('0x33')]:util[_0x9994('0x2c')](_0x9994('0x34'),_0x1344ee[_0x9994('0x31')]);return db[_0x9994('0x23')][_0x9994('0x4c')]({'where':{'role':_0x9994('0x4d'),'online':!![],'id':{'$ne':_0x1344ee['id']}}});}})[_0x9994('0xd')](function(_0xa6b8ce){if(_0xa6b8ce){_0x51636b=_0xa6b8ce;return require(_0x9994('0x4e'))[_0x9994('0x4f')]();}})['then'](function(_0x19a02d){if(_0x19a02d&&_0x19a02d[_0x9994('0x50')]&&_0x51636b>=_0x19a02d['agents']){throw new Error(_0x9994('0x51'));}})['then'](function(){if(_0x1344ee){return db[_0x9994('0x27')][_0x9994('0x48')]({'where':{'membername':_0x1344ee['name']},'individualHooks':!![]});}})[_0x9994('0xd')](function(){if(_0x1344ee){return _0x1344ee['getVoiceQueues']({'raw':!![]});}})[_0x9994('0xd')](function(_0x364801){if(_0x1344ee){if(_0x364801){var _0x5c43e9=[];_0x2f5ae1=_0x364801;if(_0x2f5ae1[_0x9994('0x2b')]){for(var _0x4ba014=0x0;_0x4ba014<_0x2f5ae1[_0x9994('0x2b')];_0x4ba014++){_0x5c43e9[_0x9994('0x45')](db[_0x9994('0x27')][_0x9994('0x52')]({'membername':_0x1344ee['name'],'UserId':_0x1344ee['id'],'queue_name':_0x2f5ae1[_0x4ba014]['name'],'VoiceQueueId':_0x2f5ae1[_0x4ba014]['id'],'interface':_0x21ba29,'paused':_0x1344ee[_0x9994('0x4b')]||![],'penalty':_0x2f5ae1[_0x4ba014]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0x9994('0x46')](_0x5c43e9);}}}})[_0x9994('0xd')](function(){if(_0x1344ee){return db[_0x9994('0x29')][_0x9994('0x19')]({'where':{'membername':_0x1344ee['name'],'exitAt':null}});}})['then'](function(_0x4d51c2){if(_0x1344ee){if(_0x4d51c2&&_0x4d51c2[_0x9994('0x2b')]){var _0x25d8dc=[];_0x4d51c2[_0x9994('0x30')](function(_0x4b5ce0){_0x25d8dc[_0x9994('0x45')](_0x4b5ce0[_0x9994('0x28')]({'exitAt':moment()[_0x9994('0x2c')](_0x9994('0x2d'))}));});return BPromise[_0x9994('0x46')](_0x25d8dc);}}})['then'](function(_0x3fc68f){if(_0x1344ee){var _0x361a0b=[];var _0x3f5f50=[];var _0x41b388=utils[_0x9994('0x2f')]();var _0xce41cc={'membername':_0x1344ee[_0x9994('0x31')],'interface':_0x21ba29,'enterAt':moment()[_0x9994('0x2c')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x1344ee[_0x9994('0x38')],'internal':_0x1344ee[_0x9994('0x26')]};_0x41b388[_0x9994('0x30')](function(_0x2a133c){_0x361a0b[_0x9994('0x45')](_['merge']({'channel':_0x2a133c,'type':_0x9994('0x53'),'data1':_0x9994('0x54'),'data2':_0x21ba29},_0xce41cc));if(_0x1344ee[_0x9994('0x4b')]){_0x3f5f50[_0x9994('0x45')](_[_0x9994('0x55')]({'channel':_0x2a133c,'type':_0x9994('0x2a'),'data1':_0x9994('0x56')},_0xce41cc));}});return db['MemberReport'][_0x9994('0x57')](_0x361a0b['concat'](_0x3f5f50),{'individualHooks':!![]});}})[_0x9994('0xd')](function(){if(_0x1344ee){return _0x1344ee[_0x9994('0x28')]({'online':!![],'lastLoginAt':moment()[_0x9994('0x2c')](_0x9994('0x2d')),'voicePause':_0x1344ee[_0x9994('0x4b')]||![],'mailPause':_0x1344ee[_0x9994('0x4b')]||![],'chatPause':_0x1344ee[_0x9994('0x4b')]||![],'faxPause':_0x1344ee['loginInPause']||![],'smsPause':_0x1344ee['loginInPause']||![],'openchannelPause':_0x1344ee[_0x9994('0x4b')]||![],'pauseType':_0x1344ee[_0x9994('0x4b')]?_0x9994('0x56'):null,'lastPauseAt':moment()['format'](_0x9994('0x2d')),'interface':_0x21ba29});}})['then'](function(_0x43c51b){_0x2371f8(_0x43c51b);})[_0x9994('0x18')](function(_0x2819c9){_0x3147f8(_0x59f893[_0x9994('0x14')](0x1f4,_0x2819c9[_0x9994('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 6a20283..d7e8314 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 _0xfd3f=['remove','update','removeListener','length','./user.events','save'];(function(_0x2d5742,_0x4b360e){var _0x6b075a=function(_0x274bf0){while(--_0x274bf0){_0x2d5742['push'](_0x2d5742['shift']());}};_0x6b075a(++_0x4b360e);}(_0xfd3f,0x190));var _0xffd3=function(_0x4fa291,_0x56e289){_0x4fa291=_0x4fa291-0x0;var _0x506d9b=_0xfd3f[_0x4fa291];return _0x506d9b;};'use strict';var UserEvents=require(_0xffd3('0x0'));var events=[_0xffd3('0x1'),_0xffd3('0x2'),_0xffd3('0x3')];function createListener(_0x6ed067,_0x3f28a3){return function(_0x410237){_0x3f28a3['emit'](_0x6ed067,_0x410237);};}function removeListener(_0x3687a3,_0x4c0dc2){return function(){UserEvents[_0xffd3('0x4')](_0x3687a3,_0x4c0dc2);};}exports['register']=function(_0xea55a1){for(var _0x242557=0x0,_0x58e982=events[_0xffd3('0x5')];_0x242557<_0x58e982;_0x242557++){var _0x1ac3db=events[_0x242557];var _0x48e8e7=createListener('user:'+_0x1ac3db,_0xea55a1);UserEvents['on'](_0x1ac3db,_0x48e8e7);}}; \ No newline at end of file +var _0x6817=['length','remove','update','emit','removeListener'];(function(_0x26f5f9,_0x30bdda){var _0x522aab=function(_0x5a5f99){while(--_0x5a5f99){_0x26f5f9['push'](_0x26f5f9['shift']());}};_0x522aab(++_0x30bdda);}(_0x6817,0x1e1));var _0x7681=function(_0x5c6c8c,_0x98a04c){_0x5c6c8c=_0x5c6c8c-0x0;var _0x47fd5a=_0x6817[_0x5c6c8c];return _0x47fd5a;};'use strict';var UserEvents=require('./user.events');var events=['save',_0x7681('0x0'),_0x7681('0x1')];function createListener(_0x2552e0,_0x783423){return function(_0x3224dd){_0x783423[_0x7681('0x2')](_0x2552e0,_0x3224dd);};}function removeListener(_0x4edd73,_0x25e5b6){return function(){UserEvents[_0x7681('0x3')](_0x4edd73,_0x25e5b6);};}exports['register']=function(_0x399d69){for(var _0x5078f5=0x0,_0x3832fd=events[_0x7681('0x4')];_0x5078f5<_0x3832fd;_0x5078f5++){var _0x26fa58=events[_0x5078f5];var _0x1e64f2=createListener('user:'+_0x26fa58,_0x399d69);UserEvents['on'](_0x26fa58,_0x1e64f2);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 61873e6..a0a228e 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x35ad5c,_0x58ccf7){var _0x2bd8aa=function(_0x426bdf){while(--_0x426bdf){_0x35ad5c['push'](_0x35ad5c['shift']());}};_0x2bd8aa(++_0x58ccf7);}(_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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x2f8fe0,_0x227a75){var _0x374de9=function(_0x5487c5){while(--_0x5487c5){_0x2f8fe0['push'](_0x2f8fe0['shift']());}};_0x374de9(++_0x227a75);}(_0xe706,0xa3));var _0x6e70=function(_0x21dd50,_0x921f70){_0x21dd50=_0x21dd50-0x0;var _0x1b7d5e=_0xe706[_0x21dd50];return _0x1b7d5e;};'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/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 4e4a1a8..ba91cbf 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 _0xd846=['sequelize','exports','INTEGER'];(function(_0x4e9bb6,_0x361adc){var _0x35e627=function(_0x119089){while(--_0x119089){_0x4e9bb6['push'](_0x4e9bb6['shift']());}};_0x35e627(++_0x361adc);}(_0xd846,0x195));var _0x6d84=function(_0x1f520c,_0x2d18c6){_0x1f520c=_0x1f520c-0x0;var _0x1a535f=_0xd846[_0x1f520c];return _0x1a535f;};'use strict';var Sequelize=require(_0x6d84('0x0'));module[_0x6d84('0x1')]={'penalty':{'type':Sequelize[_0x6d84('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x1260=['exports','sequelize'];(function(_0x1badc2,_0x4a8160){var _0x5b105d=function(_0xeb8bb4){while(--_0xeb8bb4){_0x1badc2['push'](_0x1badc2['shift']());}};_0x5b105d(++_0x4a8160);}(_0x1260,0x15d));var _0x0126=function(_0xe93b52,_0x5a2e18){_0xe93b52=_0xe93b52-0x0;var _0x34d5fa=_0x1260[_0xe93b52];return _0x34d5fa;};'use strict';var Sequelize=require(_0x0126('0x0'));module[_0x0126('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 b669c23..587ce4d 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 _0x039b=['api','bluebird','request-promise','path','rimraf','../../config/environment','./userChatQueue.attributes','define','user_has_chat_queues','util','../../config/logger'];(function(_0x1d21b7,_0x1ce2b3){var _0x23f71b=function(_0x398f66){while(--_0x398f66){_0x1d21b7['push'](_0x1d21b7['shift']());}};_0x23f71b(++_0x1ce2b3);}(_0x039b,0xa3));var _0xb039=function(_0x25d103,_0x4c2127){_0x25d103=_0x25d103-0x0;var _0x29cfee=_0x039b[_0x25d103];return _0x29cfee;};'use strict';var _=require('lodash');var util=require(_0xb039('0x0'));var logger=require(_0xb039('0x1'))(_0xb039('0x2'));var moment=require('moment');var BPromise=require(_0xb039('0x3'));var rp=require(_0xb039('0x4'));var fs=require('fs');var path=require(_0xb039('0x5'));var rimraf=require(_0xb039('0x6'));var config=require(_0xb039('0x7'));var attributes=require(_0xb039('0x8'));module['exports']=function(_0x2fc5a1,_0x47366b){return _0x2fc5a1[_0xb039('0x9')]('UserChatQueue',attributes,{'tableName':_0xb039('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0bd5=['api','moment','request-promise','path','../../config/environment','./userChatQueue.attributes','define','UserChatQueue','user_has_chat_queues','util','../../config/logger'];(function(_0x527824,_0xc824a9){var _0xc8b8ed=function(_0x1b0e19){while(--_0x1b0e19){_0x527824['push'](_0x527824['shift']());}};_0xc8b8ed(++_0xc824a9);}(_0x0bd5,0x111));var _0x50bd=function(_0x17ea7b,_0x345581){_0x17ea7b=_0x17ea7b-0x0;var _0x55d788=_0x0bd5[_0x17ea7b];return _0x55d788;};'use strict';var _=require('lodash');var util=require(_0x50bd('0x0'));var logger=require(_0x50bd('0x1'))(_0x50bd('0x2'));var moment=require(_0x50bd('0x3'));var BPromise=require('bluebird');var rp=require(_0x50bd('0x4'));var fs=require('fs');var path=require(_0x50bd('0x5'));var rimraf=require('rimraf');var config=require(_0x50bd('0x6'));var attributes=require(_0x50bd('0x7'));module['exports']=function(_0x4cd7fa,_0x286d8f){return _0x4cd7fa[_0x50bd('0x8')](_0x50bd('0x9'),attributes,{'tableName':_0x50bd('0xa'),'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 c9f0be6..3f7f4d3 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 _0x352d=['message','request\x20sent','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','info','UserChatQueue,\x20%s,\x20%s','debug','error','code'];(function(_0x1e2321,_0x3ae1c5){var _0x1d346d=function(_0x24f171){while(--_0x24f171){_0x1e2321['push'](_0x1e2321['shift']());}};_0x1d346d(++_0x3ae1c5);}(_0x352d,0x1a8));var _0xd352=function(_0xade730,_0x24a6e4){_0xade730=_0xade730-0x0;var _0x49a684=_0x352d[_0xade730];return _0x49a684;};'use strict';var _=require(_0xd352('0x0'));var util=require(_0xd352('0x1'));var moment=require(_0xd352('0x2'));var BPromise=require(_0xd352('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd352('0x4'));var db=require(_0xd352('0x5'))['db'];var utils=require(_0xd352('0x6'));var logger=require('../../config/logger')(_0xd352('0x7'));var config=require(_0xd352('0x8'));var jayson=require(_0xd352('0x9'));var client=jayson['client'][_0xd352('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x44da2a,_0x21861b,_0x5daae8){return new BPromise(function(_0x15fa25,_0x29fa3d){return client['request'](_0x44da2a,_0x5daae8)['then'](function(_0xa194be){logger[_0xd352('0xb')](_0xd352('0xc'),_0x21861b,'request\x20sent');logger[_0xd352('0xd')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x21861b,'request\x20sent',JSON['stringify'](_0xa194be));if(_0xa194be[_0xd352('0xe')]){if(_0xa194be['error'][_0xd352('0xf')]===0x1f4){logger[_0xd352('0xe')](_0xd352('0xc'),_0x21861b,_0xa194be[_0xd352('0xe')]['message']);return _0x29fa3d(_0xa194be[_0xd352('0xe')][_0xd352('0x10')]);}logger[_0xd352('0xe')]('UserChatQueue,\x20%s,\x20%s',_0x21861b,_0xa194be['error'][_0xd352('0x10')]);return _0x15fa25(_0xa194be[_0xd352('0xe')][_0xd352('0x10')]);}else{logger[_0xd352('0xb')]('UserChatQueue,\x20%s,\x20%s',_0x21861b,_0xd352('0x11'));_0x15fa25(_0xa194be[_0xd352('0x12')][_0xd352('0x10')]);}})[_0xd352('0x13')](function(_0x2e0d56){logger[_0xd352('0xe')](_0xd352('0xc'),_0x21861b,_0x2e0d56);_0x29fa3d(_0x2e0d56);});});} \ No newline at end of file +var _0x6e04=['../../config/logger','rpc','client','http','request','info','UserChatQueue,\x20%s,\x20%s','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x5501ad,_0x593f10){var _0x1951ab=function(_0x265295){while(--_0x265295){_0x5501ad['push'](_0x5501ad['shift']());}};_0x1951ab(++_0x593f10);}(_0x6e04,0xeb));var _0x46e0=function(_0x119280,_0x439c3e){_0x119280=_0x119280-0x0;var _0x481797=_0x6e04[_0x119280];return _0x481797;};'use strict';var _=require(_0x46e0('0x0'));var util=require(_0x46e0('0x1'));var moment=require(_0x46e0('0x2'));var BPromise=require(_0x46e0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x46e0('0x4'));var db=require(_0x46e0('0x5'))['db'];var utils=require(_0x46e0('0x6'));var logger=require(_0x46e0('0x7'))(_0x46e0('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x46e0('0x9')][_0x46e0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x53c9eb,_0x26029f,_0x1031bf){return new BPromise(function(_0x566ebb,_0xf01a52){return client[_0x46e0('0xb')](_0x53c9eb,_0x1031bf)['then'](function(_0x23cc42){logger[_0x46e0('0xc')](_0x46e0('0xd'),_0x26029f,'request\x20sent');logger[_0x46e0('0xe')](_0x46e0('0xf'),_0x26029f,'request\x20sent',JSON[_0x46e0('0x10')](_0x23cc42));if(_0x23cc42[_0x46e0('0x11')]){if(_0x23cc42['error'][_0x46e0('0x12')]===0x1f4){logger[_0x46e0('0x11')]('UserChatQueue,\x20%s,\x20%s',_0x26029f,_0x23cc42[_0x46e0('0x11')][_0x46e0('0x13')]);return _0xf01a52(_0x23cc42['error'][_0x46e0('0x13')]);}logger[_0x46e0('0x11')](_0x46e0('0xd'),_0x26029f,_0x23cc42[_0x46e0('0x11')][_0x46e0('0x13')]);return _0x566ebb(_0x23cc42[_0x46e0('0x11')][_0x46e0('0x13')]);}else{logger['info'](_0x46e0('0xd'),_0x26029f,_0x46e0('0x14'));_0x566ebb(_0x23cc42['result']['message']);}})[_0x46e0('0x15')](function(_0x590f5b){logger[_0x46e0('0x11')](_0x46e0('0xd'),_0x26029f,_0x590f5b);_0xf01a52(_0x590f5b);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 7913fea..dbfd5c3 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x12d311,_0x2fd4f1){var _0x3c7b99=function(_0x3ffec6){while(--_0x3ffec6){_0x12d311['push'](_0x12d311['shift']());}};_0x3c7b99(++_0x2fd4f1);}(_0xe706,0xa3));var _0x6e70=function(_0x1abafe,_0x572047){_0x1abafe=_0x1abafe-0x0;var _0x4fae5a=_0xe706[_0x1abafe];return _0x4fae5a;};'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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x38dc10,_0x251462){var _0x5779bc=function(_0x39932c){while(--_0x39932c){_0x38dc10['push'](_0x38dc10['shift']());}};_0x5779bc(++_0x251462);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x22f8ab,_0x15d8ff){_0x22f8ab=_0x22f8ab-0x0;var _0x2a70e5=_0xcb91[_0x22f8ab];return _0x2a70e5;};'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');module[_0x1cb9('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 3917ef6..10ae25a 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 _0xf74e=['INTEGER','STRING','exports'];(function(_0x1cd86c,_0x50205b){var _0xaee9fc=function(_0x1e243d){while(--_0x1e243d){_0x1cd86c['push'](_0x1cd86c['shift']());}};_0xaee9fc(++_0x50205b);}(_0xf74e,0x1eb));var _0xef74=function(_0x1ec8a2,_0x38e9d1){_0x1ec8a2=_0x1ec8a2-0x0;var _0x37788a=_0xf74e[_0x1ec8a2];return _0x37788a;};'use strict';var Sequelize=require('sequelize');module[_0xef74('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xef74('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xef74('0x2')]}}; \ No newline at end of file +var _0x6700=['INTEGER','STRING','sequelize','exports'];(function(_0x3e56f2,_0x1c3463){var _0x34da06=function(_0x485c30){while(--_0x485c30){_0x3e56f2['push'](_0x3e56f2['shift']());}};_0x34da06(++_0x1c3463);}(_0x6700,0x1ce));var _0x0670=function(_0x58a6de,_0x44b539){_0x58a6de=_0x58a6de-0x0;var _0x307315=_0x6700[_0x58a6de];return _0x307315;};'use strict';var Sequelize=require(_0x0670('0x0'));module[_0x0670('0x1')]={'penalty':{'type':Sequelize[_0x0670('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x0670('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x0670('0x3')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index b5b1a2a..3696b56 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 _0xb122=['UserFaxQueue','user_has_fax_queues','lodash','../../config/logger','api','bluebird','request-promise','../../config/environment','./userFaxQueue.attributes','exports'];(function(_0x485c44,_0x5a142c){var _0x1171b3=function(_0xe38e49){while(--_0xe38e49){_0x485c44['push'](_0x485c44['shift']());}};_0x1171b3(++_0x5a142c);}(_0xb122,0xfc));var _0x2b12=function(_0x1f2a87,_0xe5905d){_0x1f2a87=_0x1f2a87-0x0;var _0x1bea9f=_0xb122[_0x1f2a87];return _0x1bea9f;};'use strict';var _=require(_0x2b12('0x0'));var util=require('util');var logger=require(_0x2b12('0x1'))(_0x2b12('0x2'));var moment=require('moment');var BPromise=require(_0x2b12('0x3'));var rp=require(_0x2b12('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2b12('0x5'));var attributes=require(_0x2b12('0x6'));module[_0x2b12('0x7')]=function(_0x6acb19,_0xa3dfee){return _0x6acb19['define'](_0x2b12('0x8'),attributes,{'tableName':_0x2b12('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x11f4=['bluebird','request-promise','../../config/environment','./userFaxQueue.attributes','UserFaxQueue','user_has_fax_queues','lodash','../../config/logger','api'];(function(_0x2fe7ab,_0x39175b){var _0x5ba743=function(_0x386686){while(--_0x386686){_0x2fe7ab['push'](_0x2fe7ab['shift']());}};_0x5ba743(++_0x39175b);}(_0x11f4,0x192));var _0x411f=function(_0x174bd5,_0xffd194){_0x174bd5=_0x174bd5-0x0;var _0x218719=_0x11f4[_0x174bd5];return _0x218719;};'use strict';var _=require(_0x411f('0x0'));var util=require('util');var logger=require(_0x411f('0x1'))(_0x411f('0x2'));var moment=require('moment');var BPromise=require(_0x411f('0x3'));var rp=require(_0x411f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x411f('0x5'));var attributes=require(_0x411f('0x6'));module['exports']=function(_0x32a140,_0x14ac5f){return _0x32a140['define'](_0x411f('0x7'),attributes,{'tableName':_0x411f('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 2c0778f..337c36f 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 _0x3053=['request\x20sent','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','UserFaxQueue,\x20%s,\x20%s'];(function(_0x4fe57f,_0x280b89){var _0x48df45=function(_0x32fe4f){while(--_0x32fe4f){_0x4fe57f['push'](_0x4fe57f['shift']());}};_0x48df45(++_0x280b89);}(_0x3053,0xae));var _0x3305=function(_0x1ac120,_0x3e7e45){_0x1ac120=_0x1ac120-0x0;var _0x19b703=_0x3053[_0x1ac120];return _0x19b703;};'use strict';var _=require(_0x3305('0x0'));var util=require(_0x3305('0x1'));var moment=require(_0x3305('0x2'));var BPromise=require(_0x3305('0x3'));var rs=require(_0x3305('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3305('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3305('0x6'))(_0x3305('0x7'));var config=require(_0x3305('0x8'));var jayson=require(_0x3305('0x9'));var client=jayson[_0x3305('0xa')][_0x3305('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x487ea4,_0x5baec8,_0x5b3f01){return new BPromise(function(_0x2451a4,_0x3caa61){return client['request'](_0x487ea4,_0x5b3f01)[_0x3305('0xc')](function(_0x43aa62){logger[_0x3305('0xd')](_0x3305('0xe'),_0x5baec8,_0x3305('0xf'));logger['debug'](_0x3305('0x10'),_0x5baec8,_0x3305('0xf'),JSON[_0x3305('0x11')](_0x43aa62));if(_0x43aa62[_0x3305('0x12')]){if(_0x43aa62[_0x3305('0x12')][_0x3305('0x13')]===0x1f4){logger[_0x3305('0x12')](_0x3305('0xe'),_0x5baec8,_0x43aa62[_0x3305('0x12')]['message']);return _0x3caa61(_0x43aa62[_0x3305('0x12')][_0x3305('0x14')]);}logger[_0x3305('0x12')](_0x3305('0xe'),_0x5baec8,_0x43aa62['error'][_0x3305('0x14')]);return _0x2451a4(_0x43aa62['error']['message']);}else{logger[_0x3305('0xd')]('UserFaxQueue,\x20%s,\x20%s',_0x5baec8,_0x3305('0xf'));_0x2451a4(_0x43aa62['result']['message']);}})['catch'](function(_0x59e9ed){logger[_0x3305('0x12')](_0x3305('0xe'),_0x5baec8,_0x59e9ed);_0x3caa61(_0x59e9ed);});});} \ No newline at end of file +var _0x09d8=['code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x29a963,_0x4eed33){var _0x2d07ff=function(_0x266d08){while(--_0x266d08){_0x29a963['push'](_0x29a963['shift']());}};_0x2d07ff(++_0x4eed33);}(_0x09d8,0x8e));var _0x809d=function(_0x23f888,_0x278fdc){_0x23f888=_0x23f888-0x0;var _0x199c0c=_0x09d8[_0x23f888];return _0x199c0c;};'use strict';var _=require(_0x809d('0x0'));var util=require(_0x809d('0x1'));var moment=require(_0x809d('0x2'));var BPromise=require('bluebird');var rs=require(_0x809d('0x3'));var fs=require('fs');var Redis=require(_0x809d('0x4'));var db=require(_0x809d('0x5'))['db'];var utils=require(_0x809d('0x6'));var logger=require(_0x809d('0x7'))(_0x809d('0x8'));var config=require('../../config/environment');var jayson=require(_0x809d('0x9'));var client=jayson[_0x809d('0xa')][_0x809d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x20179e,_0x13900c,_0x154237){return new BPromise(function(_0x457e80,_0x3e09e7){return client[_0x809d('0xc')](_0x20179e,_0x154237)[_0x809d('0xd')](function(_0x591582){logger[_0x809d('0xe')](_0x809d('0xf'),_0x13900c,_0x809d('0x10'));logger['debug']('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x13900c,_0x809d('0x10'),JSON[_0x809d('0x11')](_0x591582));if(_0x591582[_0x809d('0x12')]){if(_0x591582[_0x809d('0x12')][_0x809d('0x13')]===0x1f4){logger[_0x809d('0x12')](_0x809d('0xf'),_0x13900c,_0x591582['error'][_0x809d('0x14')]);return _0x3e09e7(_0x591582['error']['message']);}logger['error'](_0x809d('0xf'),_0x13900c,_0x591582[_0x809d('0x12')][_0x809d('0x14')]);return _0x457e80(_0x591582[_0x809d('0x12')][_0x809d('0x14')]);}else{logger['info'](_0x809d('0xf'),_0x13900c,_0x809d('0x10'));_0x457e80(_0x591582[_0x809d('0x15')]['message']);}})[_0x809d('0x16')](function(_0x337567){logger[_0x809d('0x12')](_0x809d('0xf'),_0x13900c,_0x337567);_0x3e09e7(_0x337567);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 8414506..a8b4d4f 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x35cbf0,_0x431270){var _0x50015a=function(_0x323936){while(--_0x323936){_0x35cbf0['push'](_0x35cbf0['shift']());}};_0x50015a(++_0x431270);}(_0x70e0,0x17b));var _0x070e=function(_0x503611,_0x94f58c){_0x503611=_0x503611-0x0;var _0x12446b=_0x70e0[_0x503611];return _0x12446b;};'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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x55d1dc,_0x436e47){var _0x58623e=function(_0x72e2cc){while(--_0x72e2cc){_0x55d1dc['push'](_0x55d1dc['shift']());}};_0x58623e(++_0x436e47);}(_0xe706,0xa3));var _0x6e70=function(_0x396539,_0x44d8b3){_0x396539=_0x396539-0x0;var _0x35540f=_0xe706[_0x396539];return _0x35540f;};'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/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 1b8b021..b73ce48 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 _0xa03c=['exports','INTEGER','sequelize'];(function(_0x45bc2a,_0x53fcee){var _0x3ee44b=function(_0x4fa3f9){while(--_0x4fa3f9){_0x45bc2a['push'](_0x45bc2a['shift']());}};_0x3ee44b(++_0x53fcee);}(_0xa03c,0x143));var _0xca03=function(_0x1510a6,_0x1a9374){_0x1510a6=_0x1510a6-0x0;var _0x1a3bd6=_0xa03c[_0x1510a6];return _0x1a3bd6;};'use strict';var Sequelize=require(_0xca03('0x0'));module[_0xca03('0x1')]={'penalty':{'type':Sequelize[_0xca03('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x8655=['exports','INTEGER'];(function(_0x1f7120,_0x53456a){var _0x512142=function(_0xae9761){while(--_0xae9761){_0x1f7120['push'](_0x1f7120['shift']());}};_0x512142(++_0x53456a);}(_0x8655,0x102));var _0x5865=function(_0xe2136a,_0x4c2852){_0xe2136a=_0xe2136a-0x0;var _0x58f7b2=_0x8655[_0xe2136a];return _0x58f7b2;};'use strict';var Sequelize=require('sequelize');module[_0x5865('0x0')]={'penalty':{'type':Sequelize[_0x5865('0x1')],'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 c65ae6e..024a0fc 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 _0x6882=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','user_has_mail_queues','lodash','util','../../config/logger'];(function(_0x2b0c9f,_0x5c518f){var _0x538a89=function(_0x5e83e1){while(--_0x5e83e1){_0x2b0c9f['push'](_0x2b0c9f['shift']());}};_0x538a89(++_0x5c518f);}(_0x6882,0x169));var _0x2688=function(_0x57c8be,_0x4721a2){_0x57c8be=_0x57c8be-0x0;var _0x1d04c3=_0x6882[_0x57c8be];return _0x1d04c3;};'use strict';var _=require(_0x2688('0x0'));var util=require(_0x2688('0x1'));var logger=require(_0x2688('0x2'))(_0x2688('0x3'));var moment=require(_0x2688('0x4'));var BPromise=require(_0x2688('0x5'));var rp=require(_0x2688('0x6'));var fs=require('fs');var path=require(_0x2688('0x7'));var rimraf=require(_0x2688('0x8'));var config=require(_0x2688('0x9'));var attributes=require(_0x2688('0xa'));module[_0x2688('0xb')]=function(_0x1f6864,_0x4a1256){return _0x1f6864[_0x2688('0xc')]('UserMailQueue',attributes,{'tableName':_0x2688('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x96ef=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','define','UserMailQueue','user_has_mail_queues'];(function(_0x47b22c,_0x11cd4d){var _0x1da3b3=function(_0x2d3422){while(--_0x2d3422){_0x47b22c['push'](_0x47b22c['shift']());}};_0x1da3b3(++_0x11cd4d);}(_0x96ef,0xb4));var _0xf96e=function(_0xcbfc6d,_0x3e29b9){_0xcbfc6d=_0xcbfc6d-0x0;var _0x3accea=_0x96ef[_0xcbfc6d];return _0x3accea;};'use strict';var _=require(_0xf96e('0x0'));var util=require(_0xf96e('0x1'));var logger=require(_0xf96e('0x2'))(_0xf96e('0x3'));var moment=require(_0xf96e('0x4'));var BPromise=require('bluebird');var rp=require(_0xf96e('0x5'));var fs=require('fs');var path=require(_0xf96e('0x6'));var rimraf=require(_0xf96e('0x7'));var config=require(_0xf96e('0x8'));var attributes=require('./userMailQueue.attributes');module['exports']=function(_0x2a2503,_0x3e6644){return _0x2a2503[_0xf96e('0x9')](_0xf96e('0xa'),attributes,{'tableName':_0xf96e('0xb'),'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 33acf3f..042603a 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 _0x3e74=['rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','error','UserMailQueue,\x20%s,\x20%s','message','info','catch','lodash','moment','bluebird','randomstring','../../config/utils'];(function(_0x6f1491,_0x22db7f){var _0x1d60d5=function(_0x28a289){while(--_0x28a289){_0x6f1491['push'](_0x6f1491['shift']());}};_0x1d60d5(++_0x22db7f);}(_0x3e74,0x175));var _0x43e7=function(_0x2590ea,_0x4b8759){_0x2590ea=_0x2590ea-0x0;var _0x47faa5=_0x3e74[_0x2590ea];return _0x47faa5;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var moment=require(_0x43e7('0x1'));var BPromise=require(_0x43e7('0x2'));var rs=require(_0x43e7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x43e7('0x4'));var logger=require('../../config/logger')(_0x43e7('0x5'));var config=require(_0x43e7('0x6'));var jayson=require(_0x43e7('0x7'));var client=jayson[_0x43e7('0x8')][_0x43e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x503698,_0x45a0d1,_0x3491d6){return new BPromise(function(_0x2ede2d,_0x8528fc){return client[_0x43e7('0xa')](_0x503698,_0x3491d6)['then'](function(_0x212c6c){logger['info']('UserMailQueue,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'));logger[_0x43e7('0xc')]('UserMailQueue,\x20%s,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'),JSON['stringify'](_0x212c6c));if(_0x212c6c[_0x43e7('0xd')]){if(_0x212c6c[_0x43e7('0xd')]['code']===0x1f4){logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')][_0x43e7('0xf')]);return _0x8528fc(_0x212c6c['error']['message']);}logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')]['message']);return _0x2ede2d(_0x212c6c['error'][_0x43e7('0xf')]);}else{logger[_0x43e7('0x10')](_0x43e7('0xe'),_0x45a0d1,_0x43e7('0xb'));_0x2ede2d(_0x212c6c['result']['message']);}})[_0x43e7('0x11')](function(_0x264575){logger[_0x43e7('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x45a0d1,_0x264575);_0x8528fc(_0x264575);});});} \ No newline at end of file +var _0x8ef6=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x14f175,_0x3706fe){var _0x247c00=function(_0x32efa7){while(--_0x32efa7){_0x14f175['push'](_0x14f175['shift']());}};_0x247c00(++_0x3706fe);}(_0x8ef6,0xf2));var _0x68ef=function(_0x2553f0,_0x1edfef){_0x2553f0=_0x2553f0-0x0;var _0x4b535d=_0x8ef6[_0x2553f0];return _0x4b535d;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var moment=require(_0x68ef('0x2'));var BPromise=require(_0x68ef('0x3'));var rs=require(_0x68ef('0x4'));var fs=require('fs');var Redis=require(_0x68ef('0x5'));var db=require(_0x68ef('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x68ef('0x7'))(_0x68ef('0x8'));var config=require(_0x68ef('0x9'));var jayson=require(_0x68ef('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c2ff3,_0x4740e8,_0x2de776){return new BPromise(function(_0x4eb5eb,_0x228967){return client[_0x68ef('0xb')](_0x3c2ff3,_0x2de776)[_0x68ef('0xc')](function(_0x22ae26){logger[_0x68ef('0xd')](_0x68ef('0xe'),_0x4740e8,_0x68ef('0xf'));logger[_0x68ef('0x10')](_0x68ef('0x11'),_0x4740e8,_0x68ef('0xf'),JSON[_0x68ef('0x12')](_0x22ae26));if(_0x22ae26[_0x68ef('0x13')]){if(_0x22ae26['error'][_0x68ef('0x14')]===0x1f4){logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);return _0x228967(_0x22ae26[_0x68ef('0x13')]['message']);}logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')]['message']);return _0x4eb5eb(_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);}else{logger[_0x68ef('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x4740e8,_0x68ef('0xf'));_0x4eb5eb(_0x22ae26[_0x68ef('0x16')][_0x68ef('0x15')]);}})[_0x68ef('0x17')](function(_0x5c4456){logger[_0x68ef('0x13')]('UserMailQueue,\x20%s,\x20%s',_0x4740e8,_0x5c4456);_0x228967(_0x5c4456);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index adcac2c..b909722 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 _0x9558=['express','Router','fs-extra','../../config/environment','./userNotification.controller','post','isAuthenticated','sendUserNotification','exports','multer','util','path','connect-timeout'];(function(_0x54620e,_0x39f392){var _0x4fcf1e=function(_0x38d631){while(--_0x38d631){_0x54620e['push'](_0x54620e['shift']());}};_0x4fcf1e(++_0x39f392);}(_0x9558,0x14e));var _0x8955=function(_0x451959,_0x18c7a5){_0x451959=_0x451959-0x0;var _0x490269=_0x9558[_0x451959];return _0x490269;};'use strict';var multer=require(_0x8955('0x0'));var util=require(_0x8955('0x1'));var path=require(_0x8955('0x2'));var timeout=require(_0x8955('0x3'));var express=require(_0x8955('0x4'));var router=express[_0x8955('0x5')]();var fs_extra=require(_0x8955('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8955('0x7'));var controller=require(_0x8955('0x8'));router[_0x8955('0x9')]('/',auth[_0x8955('0xa')](),controller[_0x8955('0xb')]);module[_0x8955('0xc')]=router; \ No newline at end of file +var _0x2322=['../../components/auth/service','../../components/interaction/service','post','isAuthenticated','sendUserNotification','multer','util','express','fs-extra'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2322,0x8c));var _0x2232=function(_0x2dfca3,_0x4dc267){_0x2dfca3=_0x2dfca3-0x0;var _0x2e15dc=_0x2322[_0x2dfca3];return _0x2e15dc;};'use strict';var multer=require(_0x2232('0x0'));var util=require(_0x2232('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2232('0x2'));var router=express['Router']();var fs_extra=require(_0x2232('0x3'));var auth=require(_0x2232('0x4'));var interaction=require(_0x2232('0x5'));var config=require('../../config/environment');var controller=require('./userNotification.controller');router[_0x2232('0x6')]('/',auth[_0x2232('0x7')](),controller[_0x2232('0x8')]);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 44ba057..5c9d467 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 _0x4662=['sequelize','exports','BOOLEAN'];(function(_0x936054,_0x295ad7){var _0x4cc0d7=function(_0xc34c93){while(--_0xc34c93){_0x936054['push'](_0x936054['shift']());}};_0x4cc0d7(++_0x295ad7);}(_0x4662,0x8a));var _0x2466=function(_0x53d844,_0xe24cc6){_0x53d844=_0x53d844-0x0;var _0x4be6a1=_0x4662[_0x53d844];return _0x4be6a1;};'use strict';var Sequelize=require(_0x2466('0x0'));module[_0x2466('0x1')]={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize[_0x2466('0x2')]}}; \ No newline at end of file +var _0x6a3e=['exports','TEXT','STRING','BOOLEAN'];(function(_0xe3dd39,_0x5b2fc0){var _0x19728b=function(_0x488304){while(--_0x488304){_0xe3dd39['push'](_0xe3dd39['shift']());}};_0x19728b(++_0x5b2fc0);}(_0x6a3e,0x1f4));var _0xe6a3=function(_0x1e6831,_0x4de352){_0x1e6831=_0x1e6831-0x0;var _0xd063b6=_0x6a3e[_0x1e6831];return _0xd063b6;};'use strict';var Sequelize=require('sequelize');module[_0xe6a3('0x0')]={'body':{'type':Sequelize[_0xe6a3('0x1')]},'senderName':{'type':Sequelize[_0xe6a3('0x2')]},'recipientsId':{'type':Sequelize[_0xe6a3('0x1')]},'recipientsDescription':{'type':Sequelize[_0xe6a3('0x2')]},'beep':{'type':Sequelize[_0xe6a3('0x3')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 524cd88..e21b742 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 _0x70c1=['limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','name','sendUserNotification','body','hasOwnProperty','text','TemplateId','Sequelize','view','Missing\x20\x27view\x27\x20parameter','recipients','ValidationError','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','voicequeue','team','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','user','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','join','forEach','recipient','emit','catch','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','startCase','User','replace','queue','Queue','ids','all','flatten','map','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','squel','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./userNotification.socket','register','sendStatus','status','offset'];(function(_0x370ca9,_0x43e86a){var _0x256113=function(_0x161389){while(--_0x161389){_0x370ca9['push'](_0x370ca9['shift']());}};_0x256113(++_0x43e86a);}(_0x70c1,0x169));var _0x170c=function(_0xbbdcff,_0x515640){_0xbbdcff=_0xbbdcff-0x0;var _0x41dbcf=_0x70c1[_0xbbdcff];return _0x41dbcf;};'use strict';var emlformat=require(_0x170c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x170c('0x1'));var jsonpatch=require(_0x170c('0x2'));var rp=require(_0x170c('0x3'));var moment=require(_0x170c('0x4'));var BPromise=require(_0x170c('0x5'));var Mustache=require(_0x170c('0x6'));var util=require(_0x170c('0x7'));var path=require(_0x170c('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x170c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x170c('0xa'));var crypto=require('crypto');var jsforce=require(_0x170c('0xb'));var deskjs=require(_0x170c('0xc'));var toCsv=require(_0x170c('0xd'));var querystring=require('querystring');var Papa=require(_0x170c('0xe'));var Redis=require('ioredis');var authService=require(_0x170c('0xf'));var qs=require(_0x170c('0x10'));var as=require(_0x170c('0x11'));var hardwareService=require(_0x170c('0x12'));var logger=require(_0x170c('0x13'))(_0x170c('0x14'));var utils=require(_0x170c('0x15'));var config=require(_0x170c('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x170c('0x17'))['db'];config[_0x170c('0x18')]=_['defaults'](config[_0x170c('0x18')],{'host':_0x170c('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x170c('0x18')]));require(_0x170c('0x1a'))[_0x170c('0x1b')](socket);function respondWithStatusCode(_0x3b5abf,_0xb0c8fd){_0xb0c8fd=_0xb0c8fd||0xcc;return function(_0x15faf2){if(_0x15faf2){return _0x3b5abf[_0x170c('0x1c')](_0xb0c8fd);}return _0x3b5abf[_0x170c('0x1d')](_0xb0c8fd)['end']();};}function respondWithResult(_0x4a0fb4,_0x5112d4){_0x5112d4=_0x5112d4||0xc8;return function(_0x5e8473){if(_0x5e8473){return _0x4a0fb4[_0x170c('0x1d')](_0x5112d4)['json'](_0x5e8473);}};}function respondWithFilteredResult(_0x5b241b,_0x342f24){return function(_0x5ebd29){if(_0x5ebd29){var _0x383c1c=typeof _0x342f24[_0x170c('0x1e')]==='undefined'&&typeof _0x342f24[_0x170c('0x1f')]===_0x170c('0x20');var _0x1bebe0=_0x5ebd29[_0x170c('0x21')];var _0x1e9543=_0x383c1c?0x0:_0x342f24[_0x170c('0x1e')];var _0x5971cb=_0x383c1c?_0x5ebd29['count']:_0x342f24['offset']+_0x342f24[_0x170c('0x1f')];var _0x12aa1c;if(_0x5971cb>=_0x1bebe0){_0x5971cb=_0x1bebe0;_0x12aa1c=0xc8;}else{_0x12aa1c=0xce;}_0x5b241b[_0x170c('0x1d')](_0x12aa1c);return _0x5b241b[_0x170c('0x22')](_0x170c('0x23'),_0x1e9543+'-'+_0x5971cb+'/'+_0x1bebe0)[_0x170c('0x24')](_0x5ebd29);}return null;};}function patchUpdates(_0x3253e6){return function(_0x5f4646){try{jsonpatch[_0x170c('0x25')](_0x5f4646,_0x3253e6,!![]);}catch(_0x3ea193){return BPromise[_0x170c('0x26')](_0x3ea193);}return _0x5f4646[_0x170c('0x27')]();};}function saveUpdates(_0x327fec,_0x24f358){return function(_0x35b443){if(_0x35b443){return _0x35b443[_0x170c('0x28')](_0x327fec)[_0x170c('0x29')](function(_0x5466cc){return _0x5466cc;});}return null;};}function removeEntity(_0x3069ea,_0x452fa5){return function(_0x14f173){if(_0x14f173){return _0x14f173[_0x170c('0x2a')]()[_0x170c('0x29')](function(){_0x3069ea['status'](0xcc)[_0x170c('0x2b')]();});}};}function handleEntityNotFound(_0x555ad7,_0x43b070){return function(_0x28adbf){if(!_0x28adbf){_0x555ad7['sendStatus'](0x194);}return _0x28adbf;};}function handleError(_0x4957c3,_0x205a60){_0x205a60=_0x205a60||0x1f4;return function(_0x33c3b3){logger[_0x170c('0x2c')](_0x33c3b3[_0x170c('0x2d')]);if(_0x33c3b3[_0x170c('0x2e')]){delete _0x33c3b3[_0x170c('0x2e')];}_0x4957c3[_0x170c('0x1d')](_0x205a60)['send'](_0x33c3b3);};}exports[_0x170c('0x2f')]=function(_0x54bb41,_0x445ee0,_0x5a3079){if(!_0x54bb41[_0x170c('0x30')][_0x170c('0x31')](_0x170c('0x32'))&&!_0x54bb41[_0x170c('0x30')][_0x170c('0x31')](_0x170c('0x33'))){throw new db[(_0x170c('0x34'))]['ValidationError']('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x54bb41[_0x170c('0x30')][_0x170c('0x31')]('TemplateId')&&!_0x54bb41[_0x170c('0x30')][_0x170c('0x31')](_0x170c('0x35'))){throw new db[(_0x170c('0x34'))]['ValidationError'](_0x170c('0x36'));}if(!_0x54bb41[_0x170c('0x30')][_0x170c('0x31')](_0x170c('0x37'))){throw new db[(_0x170c('0x34'))][(_0x170c('0x38'))](_0x170c('0x39'));}else{try{var _0x5d2a65=JSON[_0x170c('0x3a')](_0x54bb41['body']['recipients']);}catch(_0x1893eb){logger[_0x170c('0x2c')](_0x1893eb);throw new db[(_0x170c('0x34'))][(_0x170c('0x38'))](_0x170c('0x3b'));}var _0x4ff111=[_0x170c('0x3c'),_0x170c('0x3d'),_0x170c('0x3e'),_0x170c('0x3f'),'smsqueue',_0x170c('0x40'),'whatsappqueue',_0x170c('0x41'),'user'];if(_[_0x170c('0x42')](_0x5d2a65,function(_0x4c934c){return!_[_0x170c('0x43')](_0x4ff111,_0x4c934c[_0x170c('0x44')][_0x170c('0x45')]());})){throw new db[(_0x170c('0x34'))][(_0x170c('0x38'))](_0x170c('0x46'));}}}var _0x36b4be={};_0x36b4be[_0x170c('0x47')]=_0x54bb41['body'][_0x170c('0x31')]('senderName')?_0x54bb41[_0x170c('0x30')]['senderName']:_0x54bb41[_0x170c('0x48')]['fullname'];_0x36b4be[_0x170c('0x49')]=_[_0x170c('0x4a')](_0x54bb41['body']['recipientsDescription'])?null:_0x54bb41[_0x170c('0x30')][_0x170c('0x49')];_0x36b4be[_0x170c('0x4b')]=_0x54bb41['body'][_0x170c('0x4b')]||![];_0x36b4be[_0x170c('0x4c')]=_0x54bb41[_0x170c('0x48')]['id'];return getContent(_0x54bb41['body'])['then'](function(_0x1d417b){_0x36b4be['body']=_0x1d417b;return getRecipients(_0x5d2a65);})['then'](function(_0x5a41e3){_0x36b4be[_0x170c('0x4d')]=_[_0x170c('0x4e')](_0x5a41e3)[_0x170c('0x4f')](',');return db['sequelize']['transaction'](function(_0x5b0ac6){return db['UserNotification']['create'](_0x36b4be,{'raw':!![],'transaction':_0x5b0ac6})[_0x170c('0x29')](function(_0x34b513){var _0x41d058={'sender':_0x36b4be[_0x170c('0x47')],'description':_0x36b4be[_0x170c('0x49')],'content':_0x36b4be[_0x170c('0x30')],'beep':_0x36b4be[_0x170c('0x4b')]};_0x5a41e3[_0x170c('0x50')](function(_0x3e84e6){_0x41d058[_0x170c('0x51')]=_0x3e84e6;socket[_0x170c('0x52')]('userNotification:send',_0x41d058);});return _0x34b513;});});})[_0x170c('0x29')](respondWithResult(_0x445ee0,0xc9))[_0x170c('0x53')](handleError(_0x445ee0,null));};function getContent(_0x49907e){return new BPromise(function(_0x5d9408,_0x1efbce){if(_0x49907e[_0x170c('0x32')]){_0x5d9408(_0x49907e['text']);return;}return db[_0x170c('0x54')][_0x170c('0x55')]({'attributes':[_0x170c('0x56')],'where':{'id':_0x49907e[_0x170c('0x33')]},'raw':!![]})['then'](function(_0x3697d6){if(!_0x3697d6)throw new db['Sequelize'][(_0x170c('0x38'))](_0x170c('0x57'));var _0x38b51e=Mustache[_0x170c('0x58')](_0x3697d6[_0x170c('0x56')],_0x49907e[_0x170c('0x35')]);_0x5d9408(_0x38b51e);})['catch'](function(_0x8860c9){_0x1efbce(_0x8860c9);});});}function getRecipients(_0x19c9dc){return new BPromise(function(_0x4332ae,_0x1747db){var _0x21f8d9=[];var _0x40800d=[];_0x19c9dc['forEach'](function(_0x4f55b1){var _0xf85b93=_[_0x170c('0x59')](_0x4f55b1['model'][_0x170c('0x45')]());if(_0xf85b93===_0x170c('0x5a')){_0x21f8d9=_['union'](_0x21f8d9,_0x4f55b1['ids']);}else{if(_[_0x170c('0x43')](_0xf85b93,'queue'))_0xf85b93=_0xf85b93[_0x170c('0x5b')](_0x170c('0x5c'),_0x170c('0x5d'));_0x4f55b1[_0x170c('0x5e')][_0x170c('0x50')](function(_0x299c6f){_0x40800d['push'](getAgents(_0xf85b93,_0x299c6f));});}});return BPromise[_0x170c('0x5f')](_0x40800d)['then'](function(_0x3292a9){_0x21f8d9=_['union'](_0x21f8d9,_[_0x170c('0x60')](_0x3292a9));_0x4332ae(_0x21f8d9);})['catch'](function(_0x5e9c82){_0x1747db(_0x5e9c82);});});}function getAgents(_0x52fa65,_0x87b49c){return new BPromise(function(_0x2fe3ce,_0x5e354f){return db[_0x52fa65][_0x170c('0x55')]({'where':{'id':_0x87b49c}})[_0x170c('0x29')](function(_0x17560c){return _0x17560c['getAgents']({'attributes':['id'],'raw':!![]})[_0x170c('0x29')](function(_0x5e01fa){var _0x564153=_[_0x170c('0x61')](_0x5e01fa,'id');_0x2fe3ce(_0x564153);});})[_0x170c('0x53')](function(_0x1a565f){_0x5e354f(_0x1a565f);});});} \ No newline at end of file +var _0x6221=['text','TemplateId','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Sequelize','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','smsqueue','voicequeue','user','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','beep','SenderId','recipientsId','join','transaction','UserNotification','create','recipientsDescription','forEach','recipient','userNotification:send','Template','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','catch','User','union','ids','queue','replace','push','all','flatten','findOne','getAgents','map','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','./userNotification.socket','sendStatus','status','end','json','offset','undefined','count','limit','save','then','destroy','error','stack','name','send','body','hasOwnProperty'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6221,0x1a5));var _0x1622=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x6221[_0x5c351c];return _0x26f3b3;};'use strict';var emlformat=require(_0x1622('0x0'));var rimraf=require(_0x1622('0x1'));var zipdir=require(_0x1622('0x2'));var jsonpatch=require(_0x1622('0x3'));var rp=require('request-promise');var moment=require(_0x1622('0x4'));var BPromise=require(_0x1622('0x5'));var Mustache=require(_0x1622('0x6'));var util=require('util');var path=require(_0x1622('0x7'));var sox=require(_0x1622('0x8'));var csv=require(_0x1622('0x9'));var ejs=require(_0x1622('0xa'));var fs=require('fs');var fs_extra=require(_0x1622('0xb'));var _=require(_0x1622('0xc'));var squel=require(_0x1622('0xd'));var crypto=require(_0x1622('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1622('0x9'));var querystring=require(_0x1622('0xf'));var Papa=require(_0x1622('0x10'));var Redis=require(_0x1622('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x1622('0x12'));var as=require(_0x1622('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1622('0x14'))('api');var utils=require(_0x1622('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1622('0x16'));var db=require(_0x1622('0x17'))['db'];config[_0x1622('0x18')]=_[_0x1622('0x19')](config[_0x1622('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1622('0x18')]));require(_0x1622('0x1a'))['register'](socket);function respondWithStatusCode(_0x863578,_0x7a3630){_0x7a3630=_0x7a3630||0xcc;return function(_0x41e7cc){if(_0x41e7cc){return _0x863578[_0x1622('0x1b')](_0x7a3630);}return _0x863578[_0x1622('0x1c')](_0x7a3630)[_0x1622('0x1d')]();};}function respondWithResult(_0x732ae8,_0x1eac7d){_0x1eac7d=_0x1eac7d||0xc8;return function(_0x13f15f){if(_0x13f15f){return _0x732ae8[_0x1622('0x1c')](_0x1eac7d)[_0x1622('0x1e')](_0x13f15f);}};}function respondWithFilteredResult(_0x26039d,_0x45abe6){return function(_0x32085d){if(_0x32085d){var _0x3aeae5=typeof _0x45abe6[_0x1622('0x1f')]==='undefined'&&typeof _0x45abe6['limit']===_0x1622('0x20');var _0x59492a=_0x32085d['count'];var _0x2f397f=_0x3aeae5?0x0:_0x45abe6[_0x1622('0x1f')];var _0x1a8cb9=_0x3aeae5?_0x32085d[_0x1622('0x21')]:_0x45abe6[_0x1622('0x1f')]+_0x45abe6[_0x1622('0x22')];var _0x19f5f8;if(_0x1a8cb9>=_0x59492a){_0x1a8cb9=_0x59492a;_0x19f5f8=0xc8;}else{_0x19f5f8=0xce;}_0x26039d[_0x1622('0x1c')](_0x19f5f8);return _0x26039d['set']('Content-Range',_0x2f397f+'-'+_0x1a8cb9+'/'+_0x59492a)[_0x1622('0x1e')](_0x32085d);}return null;};}function patchUpdates(_0x526d63){return function(_0x380473){try{jsonpatch['apply'](_0x380473,_0x526d63,!![]);}catch(_0x501936){return BPromise['reject'](_0x501936);}return _0x380473[_0x1622('0x23')]();};}function saveUpdates(_0x2861f8,_0x22defe){return function(_0x27ab1a){if(_0x27ab1a){return _0x27ab1a['update'](_0x2861f8)[_0x1622('0x24')](function(_0x411073){return _0x411073;});}return null;};}function removeEntity(_0x3966e6,_0x17d188){return function(_0x35c95e){if(_0x35c95e){return _0x35c95e[_0x1622('0x25')]()[_0x1622('0x24')](function(){_0x3966e6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x52b7b4,_0x1e92f1){return function(_0x48e47e){if(!_0x48e47e){_0x52b7b4['sendStatus'](0x194);}return _0x48e47e;};}function handleError(_0x4dd580,_0x15b58d){_0x15b58d=_0x15b58d||0x1f4;return function(_0x185e59){logger[_0x1622('0x26')](_0x185e59[_0x1622('0x27')]);if(_0x185e59[_0x1622('0x28')]){delete _0x185e59['name'];}_0x4dd580[_0x1622('0x1c')](_0x15b58d)[_0x1622('0x29')](_0x185e59);};}exports['sendUserNotification']=function(_0x4e2ebf,_0x1760fb,_0x388428){if(!_0x4e2ebf[_0x1622('0x2a')][_0x1622('0x2b')](_0x1622('0x2c'))&&!_0x4e2ebf[_0x1622('0x2a')][_0x1622('0x2b')](_0x1622('0x2d'))){throw new db['Sequelize'][(_0x1622('0x2e'))](_0x1622('0x2f'));}else{if(_0x4e2ebf[_0x1622('0x2a')]['hasOwnProperty']('TemplateId')&&!_0x4e2ebf[_0x1622('0x2a')]['hasOwnProperty'](_0x1622('0x30'))){throw new db[(_0x1622('0x31'))][(_0x1622('0x2e'))](_0x1622('0x32'));}if(!_0x4e2ebf[_0x1622('0x2a')][_0x1622('0x2b')](_0x1622('0x33'))){throw new db[(_0x1622('0x31'))][(_0x1622('0x2e'))](_0x1622('0x34'));}else{try{var _0x30d6b7=JSON['parse'](_0x4e2ebf[_0x1622('0x2a')][_0x1622('0x33')]);}catch(_0x322d45){logger[_0x1622('0x26')](_0x322d45);throw new db[(_0x1622('0x31'))]['ValidationError'](_0x1622('0x35'));}var _0x16c909=[_0x1622('0x36'),_0x1622('0x37'),_0x1622('0x38'),'openchannelqueue',_0x1622('0x39'),_0x1622('0x3a'),'whatsappqueue','team',_0x1622('0x3b')];if(_['some'](_0x30d6b7,function(_0x2fcb43){return!_[_0x1622('0x3c')](_0x16c909,_0x2fcb43[_0x1622('0x3d')][_0x1622('0x3e')]());})){throw new db[(_0x1622('0x31'))][(_0x1622('0x2e'))](_0x1622('0x3f'));}}}var _0x18e53e={};_0x18e53e[_0x1622('0x40')]=_0x4e2ebf[_0x1622('0x2a')][_0x1622('0x2b')]('senderName')?_0x4e2ebf[_0x1622('0x2a')][_0x1622('0x40')]:_0x4e2ebf[_0x1622('0x3b')][_0x1622('0x41')];_0x18e53e['recipientsDescription']=_['isEmpty'](_0x4e2ebf[_0x1622('0x2a')]['recipientsDescription'])?null:_0x4e2ebf['body']['recipientsDescription'];_0x18e53e[_0x1622('0x42')]=_0x4e2ebf[_0x1622('0x2a')]['beep']||![];_0x18e53e[_0x1622('0x43')]=_0x4e2ebf[_0x1622('0x3b')]['id'];return getContent(_0x4e2ebf[_0x1622('0x2a')])[_0x1622('0x24')](function(_0x4cec32){_0x18e53e[_0x1622('0x2a')]=_0x4cec32;return getRecipients(_0x30d6b7);})[_0x1622('0x24')](function(_0x788b01){_0x18e53e[_0x1622('0x44')]=_['sortBy'](_0x788b01)[_0x1622('0x45')](',');return db['sequelize'][_0x1622('0x46')](function(_0x42152a){return db[_0x1622('0x47')][_0x1622('0x48')](_0x18e53e,{'raw':!![],'transaction':_0x42152a})[_0x1622('0x24')](function(_0x40525b){var _0x515407={'sender':_0x18e53e[_0x1622('0x40')],'description':_0x18e53e[_0x1622('0x49')],'content':_0x18e53e['body'],'beep':_0x18e53e[_0x1622('0x42')]};_0x788b01[_0x1622('0x4a')](function(_0x590709){_0x515407[_0x1622('0x4b')]=_0x590709;socket['emit'](_0x1622('0x4c'),_0x515407);});return _0x40525b;});});})[_0x1622('0x24')](respondWithResult(_0x1760fb,0xc9))['catch'](handleError(_0x1760fb,null));};function getContent(_0x4a3ba0){return new BPromise(function(_0x4e09fe,_0x513b42){if(_0x4a3ba0[_0x1622('0x2c')]){_0x4e09fe(_0x4a3ba0[_0x1622('0x2c')]);return;}return db[_0x1622('0x4d')]['findOne']({'attributes':[_0x1622('0x4e')],'where':{'id':_0x4a3ba0[_0x1622('0x2d')]},'raw':!![]})[_0x1622('0x24')](function(_0x1ad235){if(!_0x1ad235)throw new db[(_0x1622('0x31'))]['ValidationError'](_0x1622('0x4f'));var _0x5d6af3=Mustache[_0x1622('0x50')](_0x1ad235[_0x1622('0x4e')],_0x4a3ba0[_0x1622('0x30')]);_0x4e09fe(_0x5d6af3);})[_0x1622('0x51')](function(_0x1bd2be){_0x513b42(_0x1bd2be);});});}function getRecipients(_0x41eae4){return new BPromise(function(_0x363a9e,_0x3f822b){var _0xcdfc8a=[];var _0x1d549c=[];_0x41eae4[_0x1622('0x4a')](function(_0x1e3297){var _0x9bc6cb=_['startCase'](_0x1e3297['model'][_0x1622('0x3e')]());if(_0x9bc6cb===_0x1622('0x52')){_0xcdfc8a=_[_0x1622('0x53')](_0xcdfc8a,_0x1e3297[_0x1622('0x54')]);}else{if(_['includes'](_0x9bc6cb,_0x1622('0x55')))_0x9bc6cb=_0x9bc6cb[_0x1622('0x56')](_0x1622('0x55'),'Queue');_0x1e3297[_0x1622('0x54')][_0x1622('0x4a')](function(_0x32cabb){_0x1d549c[_0x1622('0x57')](getAgents(_0x9bc6cb,_0x32cabb));});}});return BPromise[_0x1622('0x58')](_0x1d549c)['then'](function(_0x2b5299){_0xcdfc8a=_[_0x1622('0x53')](_0xcdfc8a,_[_0x1622('0x59')](_0x2b5299));_0x363a9e(_0xcdfc8a);})[_0x1622('0x51')](function(_0xdb934b){_0x3f822b(_0xdb934b);});});}function getAgents(_0x326942,_0x5992c9){return new BPromise(function(_0x2845f4,_0x1efd17){return db[_0x326942][_0x1622('0x5a')]({'where':{'id':_0x5992c9}})[_0x1622('0x24')](function(_0xae3786){return _0xae3786[_0x1622('0x5b')]({'attributes':['id'],'raw':!![]})[_0x1622('0x24')](function(_0x289aff){var _0x221c43=_[_0x1622('0x5c')](_0x289aff,'id');_0x2845f4(_0x221c43);});})['catch'](function(_0x38cb49){_0x1efd17(_0x38cb49);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 775bbb0..bb6d29a 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 _0x5c46=['hasOwnProperty','hook','exports','events','remove'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x5c46,0x71));var _0x65c4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5c46[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0x65c4('0x0'));var UserNotification=require('../../mysqldb')['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x65c4('0x1')};function emitEvent(_0xecc90a){return function(_0xd88540,_0x1252a2,_0x17502c){UserNotificationEvents['emit'](_0xecc90a+':'+_0xd88540['id'],_0xd88540);UserNotificationEvents['emit'](_0xecc90a,_0xd88540);_0x17502c(null);};}for(var e in events){if(events[_0x65c4('0x2')](e)){var event=events[e];UserNotification[_0x65c4('0x3')](e,emitEvent(event));}}module[_0x65c4('0x4')]=UserNotificationEvents; \ No newline at end of file +var _0xc965=['save','update','remove','emit','hook','exports','events','../../mysqldb','UserNotification','setMaxListeners'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc965,0xba));var _0x5c96=function(_0x1417c6,_0x194309){_0x1417c6=_0x1417c6-0x0;var _0x44db97=_0xc965[_0x1417c6];return _0x44db97;};'use strict';var EventEmitter=require(_0x5c96('0x0'));var UserNotification=require(_0x5c96('0x1'))['db'][_0x5c96('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x5c96('0x3')](0x0);var events={'afterCreate':_0x5c96('0x4'),'afterUpdate':_0x5c96('0x5'),'afterDestroy':_0x5c96('0x6')};function emitEvent(_0x91e5ea){return function(_0x422056,_0x1b5a93,_0x530e5d){UserNotificationEvents[_0x5c96('0x7')](_0x91e5ea+':'+_0x422056['id'],_0x422056);UserNotificationEvents[_0x5c96('0x7')](_0x91e5ea,_0x422056);_0x530e5d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification[_0x5c96('0x8')](e,emitEvent(event));}}module[_0x5c96('0x9')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index ebc1214..854c61f 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 _0xc007=['userNotifications','utf8mb4_unicode_ci','lodash','../../config/logger','bluebird','path','rimraf','../../config/environment','./userNotification.attributes','define','UserNotification'];(function(_0x2c6c27,_0x583885){var _0x4bf010=function(_0x254c61){while(--_0x254c61){_0x2c6c27['push'](_0x2c6c27['shift']());}};_0x4bf010(++_0x583885);}(_0xc007,0x183));var _0x7c00=function(_0x2d0228,_0x4e43bb){_0x2d0228=_0x2d0228-0x0;var _0x1d5cab=_0xc007[_0x2d0228];return _0x1d5cab;};'use strict';var _=require(_0x7c00('0x0'));var util=require('util');var logger=require(_0x7c00('0x1'))('api');var moment=require('moment');var BPromise=require(_0x7c00('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7c00('0x3'));var rimraf=require(_0x7c00('0x4'));var config=require(_0x7c00('0x5'));var attributes=require(_0x7c00('0x6'));module['exports']=function(_0x2d463f,_0xba600d){return _0x2d463f[_0x7c00('0x7')](_0x7c00('0x8'),attributes,{'tableName':_0x7c00('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x7c00('0xa')});}; \ No newline at end of file +var _0x67ac=['path','../../config/environment','./userNotification.attributes','exports','define','UserNotification','userNotifications','utf8mb4_unicode_ci','lodash','util','api','moment','request-promise'];(function(_0x25433a,_0x46ebdc){var _0x3e05ed=function(_0x1584a7){while(--_0x1584a7){_0x25433a['push'](_0x25433a['shift']());}};_0x3e05ed(++_0x46ebdc);}(_0x67ac,0x7d));var _0xc67a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x67ac[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc67a('0x0'));var util=require(_0xc67a('0x1'));var logger=require('../../config/logger')(_0xc67a('0x2'));var moment=require(_0xc67a('0x3'));var BPromise=require('bluebird');var rp=require(_0xc67a('0x4'));var fs=require('fs');var path=require(_0xc67a('0x5'));var rimraf=require('rimraf');var config=require(_0xc67a('0x6'));var attributes=require(_0xc67a('0x7'));module[_0xc67a('0x8')]=function(_0xd9234,_0x3f0e04){return _0xd9234[_0xc67a('0x9')](_0xc67a('0xa'),attributes,{'tableName':_0xc67a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xc67a('0xc')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 6d0053e..ae7de7d 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 _0xc88e=['code','message','info','UserNotification,\x20%s,\x20%s','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./userNotification.socket','register','request','then','request\x20sent','UserNotification,\x20%s,\x20%s,\x20%s','error'];(function(_0xa25919,_0x1c7421){var _0x8c2136=function(_0x101cae){while(--_0x101cae){_0xa25919['push'](_0xa25919['shift']());}};_0x8c2136(++_0x1c7421);}(_0xc88e,0x164));var _0xec88=function(_0x5dba00,_0x26c930){_0x5dba00=_0x5dba00-0x0;var _0x19b031=_0xc88e[_0x5dba00];return _0x19b031;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xec88('0x0'));var BPromise=require('bluebird');var rs=require(_0xec88('0x1'));var fs=require('fs');var Redis=require(_0xec88('0x2'));var db=require(_0xec88('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xec88('0x4'))('rpc');var config=require(_0xec88('0x5'));var jayson=require(_0xec88('0x6'));var client=jayson[_0xec88('0x7')][_0xec88('0x8')]({'port':0x232a});config[_0xec88('0x9')]=_[_0xec88('0xa')](config[_0xec88('0x9')],{'host':_0xec88('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xec88('0x9')]));require(_0xec88('0xc'))[_0xec88('0xd')](socket);function respondWithRpcPromise(_0x1f506f,_0x5851f8,_0x45bad5){return new BPromise(function(_0x3c76d2,_0x2edc21){return client[_0xec88('0xe')](_0x1f506f,_0x45bad5)[_0xec88('0xf')](function(_0x4591f9){logger['info']('UserNotification,\x20%s,\x20%s',_0x5851f8,_0xec88('0x10'));logger['debug'](_0xec88('0x11'),_0x5851f8,_0xec88('0x10'),JSON['stringify'](_0x4591f9));if(_0x4591f9[_0xec88('0x12')]){if(_0x4591f9['error'][_0xec88('0x13')]===0x1f4){logger[_0xec88('0x12')]('UserNotification,\x20%s,\x20%s',_0x5851f8,_0x4591f9[_0xec88('0x12')][_0xec88('0x14')]);return _0x2edc21(_0x4591f9[_0xec88('0x12')][_0xec88('0x14')]);}logger['error']('UserNotification,\x20%s,\x20%s',_0x5851f8,_0x4591f9[_0xec88('0x12')][_0xec88('0x14')]);return _0x3c76d2(_0x4591f9[_0xec88('0x12')][_0xec88('0x14')]);}else{logger[_0xec88('0x15')](_0xec88('0x16'),_0x5851f8,'request\x20sent');_0x3c76d2(_0x4591f9[_0xec88('0x17')][_0xec88('0x14')]);}})[_0xec88('0x18')](function(_0x3aff05){logger[_0xec88('0x12')]('UserNotification,\x20%s,\x20%s',_0x5851f8,_0x3aff05);_0x2edc21(_0x3aff05);});});} \ No newline at end of file +var _0x2a12=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./userNotification.socket','request','then','debug','UserNotification,\x20%s,\x20%s,\x20%s','error','code','UserNotification,\x20%s,\x20%s','message','info','result','catch','lodash','moment','bluebird'];(function(_0x1313cf,_0x301619){var _0x561edd=function(_0x133625){while(--_0x133625){_0x1313cf['push'](_0x1313cf['shift']());}};_0x561edd(++_0x301619);}(_0x2a12,0xba));var _0x22a1=function(_0x4f3e9a,_0x21c8a6){_0x4f3e9a=_0x4f3e9a-0x0;var _0x3c3c74=_0x2a12[_0x4f3e9a];return _0x3c3c74;};'use strict';var _=require(_0x22a1('0x0'));var util=require('util');var moment=require(_0x22a1('0x1'));var BPromise=require(_0x22a1('0x2'));var rs=require(_0x22a1('0x3'));var fs=require('fs');var Redis=require(_0x22a1('0x4'));var db=require(_0x22a1('0x5'))['db'];var utils=require(_0x22a1('0x6'));var logger=require(_0x22a1('0x7'))('rpc');var config=require(_0x22a1('0x8'));var jayson=require(_0x22a1('0x9'));var client=jayson[_0x22a1('0xa')][_0x22a1('0xb')]({'port':0x232a});config[_0x22a1('0xc')]=_[_0x22a1('0xd')](config[_0x22a1('0xc')],{'host':_0x22a1('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x22a1('0xc')]));require(_0x22a1('0xf'))['register'](socket);function respondWithRpcPromise(_0x340c15,_0x1854cc,_0x1cda1e){return new BPromise(function(_0x5c7cb6,_0x3d1696){return client[_0x22a1('0x10')](_0x340c15,_0x1cda1e)[_0x22a1('0x11')](function(_0x30da7c){logger['info']('UserNotification,\x20%s,\x20%s',_0x1854cc,'request\x20sent');logger[_0x22a1('0x12')](_0x22a1('0x13'),_0x1854cc,'request\x20sent',JSON['stringify'](_0x30da7c));if(_0x30da7c[_0x22a1('0x14')]){if(_0x30da7c[_0x22a1('0x14')][_0x22a1('0x15')]===0x1f4){logger[_0x22a1('0x14')](_0x22a1('0x16'),_0x1854cc,_0x30da7c[_0x22a1('0x14')][_0x22a1('0x17')]);return _0x3d1696(_0x30da7c['error'][_0x22a1('0x17')]);}logger[_0x22a1('0x14')](_0x22a1('0x16'),_0x1854cc,_0x30da7c[_0x22a1('0x14')][_0x22a1('0x17')]);return _0x5c7cb6(_0x30da7c[_0x22a1('0x14')][_0x22a1('0x17')]);}else{logger[_0x22a1('0x18')](_0x22a1('0x16'),_0x1854cc,'request\x20sent');_0x5c7cb6(_0x30da7c[_0x22a1('0x19')]['message']);}})[_0x22a1('0x1a')](function(_0x58fc81){logger['error']('UserNotification,\x20%s,\x20%s',_0x1854cc,_0x58fc81);_0x3d1696(_0x58fc81);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 4282b3d..f571f35 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 _0x0a16=['save','remove','update','emit','removeListener','register','length','userNotification:','./userNotification.events'];(function(_0x25efdf,_0x521462){var _0x22c495=function(_0x184469){while(--_0x184469){_0x25efdf['push'](_0x25efdf['shift']());}};_0x22c495(++_0x521462);}(_0x0a16,0x15e));var _0x60a1=function(_0x56789e,_0x3a0d9d){_0x56789e=_0x56789e-0x0;var _0x49a3fd=_0x0a16[_0x56789e];return _0x49a3fd;};'use strict';var UserNotificationEvents=require(_0x60a1('0x0'));var events=[_0x60a1('0x1'),_0x60a1('0x2'),_0x60a1('0x3')];function createListener(_0x464562,_0x1f43f2){return function(_0x1007c9){_0x1f43f2[_0x60a1('0x4')](_0x464562,_0x1007c9);};}function removeListener(_0x16cbbe,_0x55f2bb){return function(){UserNotificationEvents[_0x60a1('0x5')](_0x16cbbe,_0x55f2bb);};}exports[_0x60a1('0x6')]=function(_0x5d7bca){for(var _0x241305=0x0,_0x17f175=events[_0x60a1('0x7')];_0x241305<_0x17f175;_0x241305++){var _0x18f937=events[_0x241305];var _0x21e970=createListener(_0x60a1('0x8')+_0x18f937,_0x5d7bca);UserNotificationEvents['on'](_0x18f937,_0x21e970);}}; \ No newline at end of file +var _0xcf4b=['save','remove','update','emit','removeListener','register','length','./userNotification.events'];(function(_0x5ac47d,_0x285566){var _0x4f8ece=function(_0x2801ad){while(--_0x2801ad){_0x5ac47d['push'](_0x5ac47d['shift']());}};_0x4f8ece(++_0x285566);}(_0xcf4b,0xef));var _0xbcf4=function(_0x310883,_0x18742c){_0x310883=_0x310883-0x0;var _0x3e95dc=_0xcf4b[_0x310883];return _0x3e95dc;};'use strict';var UserNotificationEvents=require(_0xbcf4('0x0'));var events=[_0xbcf4('0x1'),_0xbcf4('0x2'),_0xbcf4('0x3')];function createListener(_0x4fb30a,_0x34d7c3){return function(_0x51a310){_0x34d7c3[_0xbcf4('0x4')](_0x4fb30a,_0x51a310);};}function removeListener(_0x46e95f,_0x52e6f3){return function(){UserNotificationEvents[_0xbcf4('0x5')](_0x46e95f,_0x52e6f3);};}exports[_0xbcf4('0x6')]=function(_0x27bfc3){for(var _0x1aa907=0x0,_0x46a9ec=events[_0xbcf4('0x7')];_0x1aa907<_0x46a9ec;_0x1aa907++){var _0x32f021=events[_0x1aa907];var _0x1081c2=createListener('userNotification:'+_0x32f021,_0x27bfc3);UserNotificationEvents['on'](_0x32f021,_0x1081c2);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 3324c0a..cf90382 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x2914e9,_0x14d484){var _0x2aa212=function(_0x656fa){while(--_0x656fa){_0x2914e9['push'](_0x2914e9['shift']());}};_0x2aa212(++_0x14d484);}(_0x70e0,0x17b));var _0x070e=function(_0x119021,_0x497337){_0x119021=_0x119021-0x0;var _0x2b514a=_0x70e0[_0x119021];return _0x2b514a;};'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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x27fedb,_0x31c693){var _0x58ab78=function(_0x532732){while(--_0x532732){_0x27fedb['push'](_0x27fedb['shift']());}};_0x58ab78(++_0x31c693);}(_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/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index e4aa02e..63a0b8a 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 _0xfac9=['exports','INTEGER','sequelize'];(function(_0x2edb85,_0x31804b){var _0x549966=function(_0x3cdc86){while(--_0x3cdc86){_0x2edb85['push'](_0x2edb85['shift']());}};_0x549966(++_0x31804b);}(_0xfac9,0x149));var _0x9fac=function(_0xe24dda,_0x17eefe){_0xe24dda=_0xe24dda-0x0;var _0xfb451=_0xfac9[_0xe24dda];return _0xfb451;};'use strict';var Sequelize=require(_0x9fac('0x0'));module[_0x9fac('0x1')]={'penalty':{'type':Sequelize[_0x9fac('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa2d7=['INTEGER','sequelize','exports'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0xa2d7,0xbb));var _0x7a2d=function(_0x4ad110,_0x4f9cf7){_0x4ad110=_0x4ad110-0x0;var _0x563d3c=_0xa2d7[_0x4ad110];return _0x563d3c;};'use strict';var Sequelize=require(_0x7a2d('0x0'));module[_0x7a2d('0x1')]={'penalty':{'type':Sequelize[_0x7a2d('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 fa7840f..f125c62 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 _0xe1b1=['bluebird','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','define','util','../../config/logger','api','moment'];(function(_0x2490ad,_0x33836e){var _0x38262d=function(_0x159a42){while(--_0x159a42){_0x2490ad['push'](_0x2490ad['shift']());}};_0x38262d(++_0x33836e);}(_0xe1b1,0x92));var _0x1e1b=function(_0x581033,_0x46d2ec){_0x581033=_0x581033-0x0;var _0x470632=_0xe1b1[_0x581033];return _0x470632;};'use strict';var _=require('lodash');var util=require(_0x1e1b('0x0'));var logger=require(_0x1e1b('0x1'))(_0x1e1b('0x2'));var moment=require(_0x1e1b('0x3'));var BPromise=require(_0x1e1b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1e1b('0x5'));var rimraf=require(_0x1e1b('0x6'));var config=require(_0x1e1b('0x7'));var attributes=require(_0x1e1b('0x8'));module['exports']=function(_0x55ff17,_0x519c1b){return _0x55ff17[_0x1e1b('0x9')]('UserOpenchannelQueue',attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6fa4=['../../config/environment','./userOpenchannelQueue.attributes','define','UserOpenchannelQueue','util','../../config/logger','moment','path'];(function(_0x4201cc,_0x1946e0){var _0x176f40=function(_0x2e5de7){while(--_0x2e5de7){_0x4201cc['push'](_0x4201cc['shift']());}};_0x176f40(++_0x1946e0);}(_0x6fa4,0x154));var _0x46fa=function(_0x2e87f0,_0x434dc9){_0x2e87f0=_0x2e87f0-0x0;var _0x136ccd=_0x6fa4[_0x2e87f0];return _0x136ccd;};'use strict';var _=require('lodash');var util=require(_0x46fa('0x0'));var logger=require(_0x46fa('0x1'))('api');var moment=require(_0x46fa('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x46fa('0x3'));var rimraf=require('rimraf');var config=require(_0x46fa('0x4'));var attributes=require(_0x46fa('0x5'));module['exports']=function(_0x181b3c,_0x2958bc){return _0x181b3c[_0x46fa('0x6')](_0x46fa('0x7'),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 07c4712..73abeab 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 _0xe372=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch'];(function(_0x3fae21,_0x29a263){var _0x32df51=function(_0x1235d9){while(--_0x1235d9){_0x3fae21['push'](_0x3fae21['shift']());}};_0x32df51(++_0x29a263);}(_0xe372,0x1e3));var _0x2e37=function(_0x40aaca,_0x4803f4){_0x40aaca=_0x40aaca-0x0;var _0x1252f7=_0xe372[_0x40aaca];return _0x1252f7;};'use strict';var _=require(_0x2e37('0x0'));var util=require(_0x2e37('0x1'));var moment=require(_0x2e37('0x2'));var BPromise=require(_0x2e37('0x3'));var rs=require(_0x2e37('0x4'));var fs=require('fs');var Redis=require(_0x2e37('0x5'));var db=require(_0x2e37('0x6'))['db'];var utils=require(_0x2e37('0x7'));var logger=require('../../config/logger')(_0x2e37('0x8'));var config=require(_0x2e37('0x9'));var jayson=require(_0x2e37('0xa'));var client=jayson['client'][_0x2e37('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x53e293,_0x48e1d6,_0x5bbe7f){return new BPromise(function(_0x470aec,_0x530a4a){return client[_0x2e37('0xc')](_0x53e293,_0x5bbe7f)[_0x2e37('0xd')](function(_0x454d1b){logger[_0x2e37('0xe')](_0x2e37('0xf'),_0x48e1d6,'request\x20sent');logger[_0x2e37('0x10')](_0x2e37('0x11'),_0x48e1d6,_0x2e37('0x12'),JSON['stringify'](_0x454d1b));if(_0x454d1b['error']){if(_0x454d1b['error']['code']===0x1f4){logger[_0x2e37('0x13')](_0x2e37('0xf'),_0x48e1d6,_0x454d1b[_0x2e37('0x13')][_0x2e37('0x14')]);return _0x530a4a(_0x454d1b[_0x2e37('0x13')][_0x2e37('0x14')]);}logger[_0x2e37('0x13')](_0x2e37('0xf'),_0x48e1d6,_0x454d1b[_0x2e37('0x13')][_0x2e37('0x14')]);return _0x470aec(_0x454d1b['error'][_0x2e37('0x14')]);}else{logger[_0x2e37('0xe')](_0x2e37('0xf'),_0x48e1d6,_0x2e37('0x12'));_0x470aec(_0x454d1b[_0x2e37('0x15')][_0x2e37('0x14')]);}})[_0x2e37('0x16')](function(_0x4a59e8){logger[_0x2e37('0x13')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x48e1d6,_0x4a59e8);_0x530a4a(_0x4a59e8);});});} \ No newline at end of file +var _0x5897=['../../config/logger','../../config/environment','jayson/promise','client','request','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x5c1492,_0x1b213a){var _0x3d7fb4=function(_0x38eaad){while(--_0x38eaad){_0x5c1492['push'](_0x5c1492['shift']());}};_0x3d7fb4(++_0x1b213a);}(_0x5897,0xac));var _0x7589=function(_0x45518f,_0x475a6b){_0x45518f=_0x45518f-0x0;var _0x198175=_0x5897[_0x45518f];return _0x198175;};'use strict';var _=require(_0x7589('0x0'));var util=require(_0x7589('0x1'));var moment=require(_0x7589('0x2'));var BPromise=require(_0x7589('0x3'));var rs=require(_0x7589('0x4'));var fs=require('fs');var Redis=require(_0x7589('0x5'));var db=require(_0x7589('0x6'))['db'];var utils=require(_0x7589('0x7'));var logger=require(_0x7589('0x8'))('rpc');var config=require(_0x7589('0x9'));var jayson=require(_0x7589('0xa'));var client=jayson[_0x7589('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x21cd61,_0x515f36,_0x2c7c06){return new BPromise(function(_0x97771b,_0x121577){return client[_0x7589('0xc')](_0x21cd61,_0x2c7c06)['then'](function(_0x5a649c){logger[_0x7589('0xd')](_0x7589('0xe'),_0x515f36,_0x7589('0xf'));logger[_0x7589('0x10')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x515f36,_0x7589('0xf'),JSON[_0x7589('0x11')](_0x5a649c));if(_0x5a649c[_0x7589('0x12')]){if(_0x5a649c[_0x7589('0x12')]['code']===0x1f4){logger[_0x7589('0x12')](_0x7589('0xe'),_0x515f36,_0x5a649c[_0x7589('0x12')][_0x7589('0x13')]);return _0x121577(_0x5a649c[_0x7589('0x12')][_0x7589('0x13')]);}logger[_0x7589('0x12')](_0x7589('0xe'),_0x515f36,_0x5a649c[_0x7589('0x12')][_0x7589('0x13')]);return _0x97771b(_0x5a649c[_0x7589('0x12')][_0x7589('0x13')]);}else{logger[_0x7589('0xd')](_0x7589('0xe'),_0x515f36,'request\x20sent');_0x97771b(_0x5a649c['result'][_0x7589('0x13')]);}})['catch'](function(_0x7796a2){logger[_0x7589('0x12')](_0x7589('0xe'),_0x515f36,_0x7796a2);_0x121577(_0x7796a2);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 9239255..d7fa05c 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 _0xb471=['Router','../../components/auth/service','../../config/environment','./userProfile.controller','index','get','/describe','isAuthenticated','show','/:id/sections','getSections','/:id/resources','getResources','post','create','clone','addSections','addResources','/:id','update','delete','destroy','removeSections','exports','multer','util','path'];(function(_0x260f28,_0x4e9b30){var _0x3aefcc=function(_0x223b18){while(--_0x223b18){_0x260f28['push'](_0x260f28['shift']());}};_0x3aefcc(++_0x4e9b30);}(_0xb471,0x1ad));var _0x1b47=function(_0x2d60b9,_0x8ffc89){_0x2d60b9=_0x2d60b9-0x0;var _0x2cce26=_0xb471[_0x2d60b9];return _0x2cce26;};'use strict';var multer=require(_0x1b47('0x0'));var util=require(_0x1b47('0x1'));var path=require(_0x1b47('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1b47('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1b47('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1b47('0x5'));var controller=require(_0x1b47('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x1b47('0x7')]);router[_0x1b47('0x8')](_0x1b47('0x9'),auth[_0x1b47('0xa')](),controller['describe']);router[_0x1b47('0x8')]('/:id',auth[_0x1b47('0xa')](),controller[_0x1b47('0xb')]);router[_0x1b47('0x8')](_0x1b47('0xc'),auth[_0x1b47('0xa')](),controller[_0x1b47('0xd')]);router[_0x1b47('0x8')](_0x1b47('0xe'),auth[_0x1b47('0xa')](),controller[_0x1b47('0xf')]);router[_0x1b47('0x10')]('/',auth[_0x1b47('0xa')](),controller[_0x1b47('0x11')]);router[_0x1b47('0x10')]('/:id/clone',auth[_0x1b47('0xa')](),controller[_0x1b47('0x12')]);router['post'](_0x1b47('0xc'),auth[_0x1b47('0xa')](),controller[_0x1b47('0x13')]);router[_0x1b47('0x10')](_0x1b47('0xe'),auth[_0x1b47('0xa')](),controller[_0x1b47('0x14')]);router['put'](_0x1b47('0x15'),auth[_0x1b47('0xa')](),controller[_0x1b47('0x16')]);router[_0x1b47('0x17')](_0x1b47('0x15'),auth[_0x1b47('0xa')](),controller[_0x1b47('0x18')]);router[_0x1b47('0x17')](_0x1b47('0xc'),auth['isAuthenticated'](),controller[_0x1b47('0x19')]);router[_0x1b47('0x17')]('/:id/resources',auth[_0x1b47('0xa')](),controller['removeResources']);module[_0x1b47('0x1a')]=router; \ No newline at end of file +var _0xc510=['../../config/environment','./userProfile.controller','get','/describe','isAuthenticated','/:id','show','getSections','/:id/resources','post','create','/:id/clone','clone','/:id/sections','addSections','addResources','delete','removeSections','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5b2d38,_0x3c461a){var _0x2f7806=function(_0x3433c9){while(--_0x3433c9){_0x5b2d38['push'](_0x5b2d38['shift']());}};_0x2f7806(++_0x3c461a);}(_0xc510,0x1a8));var _0x0c51=function(_0x388255,_0x5eb62f){_0x388255=_0x388255-0x0;var _0x37bab5=_0xc510[_0x388255];return _0x37bab5;};'use strict';var multer=require(_0x0c51('0x0'));var util=require(_0x0c51('0x1'));var path=require('path');var timeout=require(_0x0c51('0x2'));var express=require(_0x0c51('0x3'));var router=express[_0x0c51('0x4')]();var fs_extra=require(_0x0c51('0x5'));var auth=require(_0x0c51('0x6'));var interaction=require(_0x0c51('0x7'));var config=require(_0x0c51('0x8'));var controller=require(_0x0c51('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x0c51('0xa')](_0x0c51('0xb'),auth[_0x0c51('0xc')](),controller['describe']);router['get'](_0x0c51('0xd'),auth[_0x0c51('0xc')](),controller[_0x0c51('0xe')]);router[_0x0c51('0xa')]('/:id/sections',auth[_0x0c51('0xc')](),controller[_0x0c51('0xf')]);router[_0x0c51('0xa')](_0x0c51('0x10'),auth[_0x0c51('0xc')](),controller['getResources']);router[_0x0c51('0x11')]('/',auth[_0x0c51('0xc')](),controller[_0x0c51('0x12')]);router[_0x0c51('0x11')](_0x0c51('0x13'),auth['isAuthenticated'](),controller[_0x0c51('0x14')]);router[_0x0c51('0x11')](_0x0c51('0x15'),auth[_0x0c51('0xc')](),controller[_0x0c51('0x16')]);router[_0x0c51('0x11')](_0x0c51('0x10'),auth[_0x0c51('0xc')](),controller[_0x0c51('0x17')]);router['put'](_0x0c51('0xd'),auth[_0x0c51('0xc')](),controller['update']);router[_0x0c51('0x18')](_0x0c51('0xd'),auth[_0x0c51('0xc')](),controller['destroy']);router[_0x0c51('0x18')](_0x0c51('0x15'),auth[_0x0c51('0xc')](),controller[_0x0c51('0x19')]);router['delete'](_0x0c51('0x10'),auth[_0x0c51('0xc')](),controller['removeResources']);module[_0x0c51('0x1a')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 533cbec..502cb4b 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 _0xbaa2=['sequelize','exports','name','STRING','crudPermissions','join','getDataValue','BOOLEAN'];(function(_0x4883f8,_0x2a9c3e){var _0x5e325a=function(_0x5ba2a0){while(--_0x5ba2a0){_0x4883f8['push'](_0x4883f8['shift']());}};_0x5e325a(++_0x2a9c3e);}(_0xbaa2,0xb0));var _0x2baa=function(_0x13534a,_0x21ac5e){_0x13534a=_0x13534a-0x0;var _0x31b4ce=_0xbaa2[_0x13534a];return _0x31b4ce;};'use strict';var Sequelize=require(_0x2baa('0x0'));module[_0x2baa('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x2baa('0x2')},'crudPermissions':{'type':Sequelize[_0x2baa('0x3')],'set':function(_0x2d5705){this['setDataValue'](_0x2baa('0x4'),_0x2d5705?_0x2d5705[_0x2baa('0x5')](''):[]);},'get':function(){return this['getDataValue'](_0x2baa('0x4'))?this[_0x2baa('0x6')](_0x2baa('0x4'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x2baa('0x3')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x2baa('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x2baa('0x7')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x2baa('0x7')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x2baa('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x2baa('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x2baa('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x2baa('0x7')],'defaultValue':!![]}}; \ No newline at end of file +var _0x9b5d=['setDataValue','join','crudPermissions','split','BOOLEAN','sequelize','exports','STRING','name'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9b5d,0x176));var _0xd9b5=function(_0x26a34e,_0x253942){_0x26a34e=_0x26a34e-0x0;var _0x28db0e=_0x9b5d[_0x26a34e];return _0x28db0e;};'use strict';var Sequelize=require(_0xd9b5('0x0'));module[_0xd9b5('0x1')]={'name':{'type':Sequelize[_0xd9b5('0x2')],'allowNull':![],'unique':_0xd9b5('0x3')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x2799fc){this[_0xd9b5('0x4')]('crudPermissions',_0x2799fc?_0x2799fc[_0xd9b5('0x5')](''):[]);},'get':function(){return this['getDataValue'](_0xd9b5('0x6'))?this['getDataValue'](_0xd9b5('0x6'))[_0xd9b5('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xd9b5('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xd9b5('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xd9b5('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xd9b5('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xd9b5('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xd9b5('0x8')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index ac71fb9..f9a60d1 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 _0xb90a=['apply','reject','save','update','destroy','then','error','stack','name','send','index','map','UserProfile','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','includeAll','rows','catch','show','create','body','clone','params','include','find','get','omit','createdAt','updatedAt','sequelize','transaction','UserProfileSection','findAll','each','autoAssociation','UserProfileResource','sectionId','userProfileId','describe','addSections','Resources','push','removeSections','enabled','includes','isEmpty','subsections','findOne','Dashboard','forEach','resourceId','bulkCreate','removeResources','ids','getResources','section','Missing\x20section\x20parameter','eml-format','rimraf','fast-json-patch','path','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range'];(function(_0x130719,_0x2a7018){var _0x159865=function(_0x3a4d06){while(--_0x3a4d06){_0x130719['push'](_0x130719['shift']());}};_0x159865(++_0x2a7018);}(_0xb90a,0x12a));var _0xab90=function(_0x51854f,_0x576349){_0x51854f=_0x51854f-0x0;var _0xf40778=_0xb90a[_0x51854f];return _0xf40778;};'use strict';var emlformat=require(_0xab90('0x0'));var rimraf=require(_0xab90('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xab90('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xab90('0x3'));var sox=require(_0xab90('0x4'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xab90('0x5'));var _=require(_0xab90('0x6'));var squel=require(_0xab90('0x7'));var crypto=require('crypto');var jsforce=require(_0xab90('0x8'));var deskjs=require(_0xab90('0x9'));var toCsv=require(_0xab90('0xa'));var querystring=require(_0xab90('0xb'));var Papa=require(_0xab90('0xc'));var Redis=require(_0xab90('0xd'));var authService=require(_0xab90('0xe'));var qs=require(_0xab90('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xab90('0x10'));var logger=require(_0xab90('0x11'))(_0xab90('0x12'));var utils=require(_0xab90('0x13'));var config=require(_0xab90('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xab90('0x15'))['db'];config[_0xab90('0x16')]=_[_0xab90('0x17')](config[_0xab90('0x16')],{'host':_0xab90('0x18'),'port':0x18eb});var socket=require(_0xab90('0x19'))(new Redis(config[_0xab90('0x16')]));require(_0xab90('0x1a'))[_0xab90('0x1b')](socket);function respondWithStatusCode(_0x3dc022,_0x9abf7c){_0x9abf7c=_0x9abf7c||0xcc;return function(_0x29f352){if(_0x29f352){return _0x3dc022[_0xab90('0x1c')](_0x9abf7c);}return _0x3dc022['status'](_0x9abf7c)[_0xab90('0x1d')]();};}function respondWithResult(_0x5b68bd,_0x78ce5a){_0x78ce5a=_0x78ce5a||0xc8;return function(_0x138508){if(_0x138508){return _0x5b68bd['status'](_0x78ce5a)[_0xab90('0x1e')](_0x138508);}};}function respondWithFilteredResult(_0x2e0cf0,_0x2eef86){return function(_0x58cc79){if(_0x58cc79){var _0x2ab85c=typeof _0x2eef86[_0xab90('0x1f')]===_0xab90('0x20')&&typeof _0x2eef86[_0xab90('0x21')]==='undefined';var _0x2f6904=_0x58cc79['count'];var _0x30d6b3=_0x2ab85c?0x0:_0x2eef86['offset'];var _0x12b19a=_0x2ab85c?_0x58cc79[_0xab90('0x22')]:_0x2eef86[_0xab90('0x1f')]+_0x2eef86[_0xab90('0x21')];var _0x5d5c1c;if(_0x12b19a>=_0x2f6904){_0x12b19a=_0x2f6904;_0x5d5c1c=0xc8;}else{_0x5d5c1c=0xce;}_0x2e0cf0[_0xab90('0x23')](_0x5d5c1c);return _0x2e0cf0[_0xab90('0x24')](_0xab90('0x25'),_0x30d6b3+'-'+_0x12b19a+'/'+_0x2f6904)[_0xab90('0x1e')](_0x58cc79);}return null;};}function patchUpdates(_0x2195cc){return function(_0x17419e){try{jsonpatch[_0xab90('0x26')](_0x17419e,_0x2195cc,!![]);}catch(_0x210b5e){return BPromise[_0xab90('0x27')](_0x210b5e);}return _0x17419e[_0xab90('0x28')]();};}function saveUpdates(_0x4757ba,_0x23c089){return function(_0x1c680c){if(_0x1c680c){return _0x1c680c[_0xab90('0x29')](_0x4757ba)['then'](function(_0x7e141c){return _0x7e141c;});}return null;};}function removeEntity(_0x39e8a5,_0x167f84){return function(_0x22cf1a){if(_0x22cf1a){return _0x22cf1a[_0xab90('0x2a')]()[_0xab90('0x2b')](function(){_0x39e8a5[_0xab90('0x23')](0xcc)[_0xab90('0x1d')]();});}};}function handleEntityNotFound(_0x1a79d0,_0x52acf0){return function(_0x38b3ae){if(!_0x38b3ae){_0x1a79d0[_0xab90('0x1c')](0x194);}return _0x38b3ae;};}function handleError(_0x4e52d5,_0x3bbfb6){_0x3bbfb6=_0x3bbfb6||0x1f4;return function(_0x16be33){logger[_0xab90('0x2c')](_0x16be33[_0xab90('0x2d')]);if(_0x16be33[_0xab90('0x2e')]){delete _0x16be33[_0xab90('0x2e')];}_0x4e52d5[_0xab90('0x23')](_0x3bbfb6)[_0xab90('0x2f')](_0x16be33);};}exports[_0xab90('0x30')]=function(_0x2eec36,_0x581cc6){var _0x59ed30={},_0x5671c2={},_0x215c4b={'count':0x0,'rows':[]};var _0x5f1359=_[_0xab90('0x31')](db[_0xab90('0x32')][_0xab90('0x33')],function(_0x3116ad){return{'name':_0x3116ad['fieldName'],'type':_0x3116ad[_0xab90('0x34')][_0xab90('0x35')]};});_0x5671c2[_0xab90('0x36')]=_['map'](_0x5f1359,'name');_0x5671c2[_0xab90('0x37')]=_[_0xab90('0x38')](_0x2eec36[_0xab90('0x37')]);_0x5671c2[_0xab90('0x39')]=_[_0xab90('0x3a')](_0x5671c2[_0xab90('0x36')],_0x5671c2[_0xab90('0x37')]);_0x59ed30[_0xab90('0x3b')]=_[_0xab90('0x3a')](_0x5671c2[_0xab90('0x36')],qs[_0xab90('0x3c')](_0x2eec36['query'][_0xab90('0x3c')]));_0x59ed30[_0xab90('0x3b')]=_0x59ed30[_0xab90('0x3b')][_0xab90('0x3d')]?_0x59ed30[_0xab90('0x3b')]:_0x5671c2['model'];if(!_0x2eec36[_0xab90('0x37')][_0xab90('0x3e')](_0xab90('0x3f'))){_0x59ed30['limit']=qs[_0xab90('0x21')](_0x2eec36[_0xab90('0x37')][_0xab90('0x21')]);_0x59ed30[_0xab90('0x1f')]=qs[_0xab90('0x1f')](_0x2eec36[_0xab90('0x37')]['offset']);}_0x59ed30[_0xab90('0x40')]=qs['sort'](_0x2eec36[_0xab90('0x37')][_0xab90('0x41')]);_0x59ed30['where']=qs[_0xab90('0x39')](_['pick'](_0x2eec36[_0xab90('0x37')],_0x5671c2[_0xab90('0x39')]),_0x5f1359);if(_0x2eec36[_0xab90('0x37')][_0xab90('0x42')]){_0x59ed30[_0xab90('0x43')]=_['merge'](_0x59ed30[_0xab90('0x43')],{'$or':_['map'](_0x5f1359,function(_0xb24757){if(_0xb24757[_0xab90('0x34')]!=='VIRTUAL'){var _0x14165e={};_0x14165e[_0xb24757[_0xab90('0x2e')]]={'$like':'%'+_0x2eec36[_0xab90('0x37')]['filter']+'%'};return _0x14165e;}})});}_0x59ed30=_[_0xab90('0x44')]({},_0x59ed30,_0x2eec36[_0xab90('0x45')]);var _0x4e0bc7={'where':_0x59ed30['where']};return db[_0xab90('0x32')][_0xab90('0x22')](_0x4e0bc7)[_0xab90('0x2b')](function(_0x1c3328){_0x215c4b[_0xab90('0x22')]=_0x1c3328;if(_0x2eec36[_0xab90('0x37')][_0xab90('0x46')]){_0x59ed30['include']=[{'all':!![]}];}return db[_0xab90('0x32')]['findAll'](_0x59ed30);})[_0xab90('0x2b')](function(_0x5f0491){_0x215c4b[_0xab90('0x47')]=_0x5f0491;return _0x215c4b;})[_0xab90('0x2b')](respondWithFilteredResult(_0x581cc6,_0x59ed30))[_0xab90('0x48')](handleError(_0x581cc6,null));};exports[_0xab90('0x49')]=function(_0x3fb469,_0x28213d){var _0xda9abf={'raw':![],'where':{'id':_0x3fb469['params']['id']}},_0x71e440={};_0x71e440['model']=_['keys'](db['UserProfile'][_0xab90('0x33')]);_0x71e440['query']=_[_0xab90('0x38')](_0x3fb469[_0xab90('0x37')]);_0x71e440[_0xab90('0x39')]=_[_0xab90('0x3a')](_0x71e440[_0xab90('0x36')],_0x71e440['query']);_0xda9abf[_0xab90('0x3b')]=_['intersection'](_0x71e440[_0xab90('0x36')],qs[_0xab90('0x3c')](_0x3fb469['query'][_0xab90('0x3c')]));_0xda9abf[_0xab90('0x3b')]=_0xda9abf[_0xab90('0x3b')][_0xab90('0x3d')]?_0xda9abf[_0xab90('0x3b')]:_0x71e440[_0xab90('0x36')];if(_0x3fb469['query'][_0xab90('0x46')]){_0xda9abf['include']=[{'all':!![]}];}_0xda9abf=_[_0xab90('0x44')]({},_0xda9abf,_0x3fb469['options']);return db[_0xab90('0x32')]['find'](_0xda9abf)[_0xab90('0x2b')](handleEntityNotFound(_0x28213d,null))['then'](respondWithResult(_0x28213d,null))['catch'](handleError(_0x28213d,null));};exports['create']=function(_0x1bd4bd,_0x1bb19f){return db[_0xab90('0x32')][_0xab90('0x4a')](_0x1bd4bd[_0xab90('0x4b')],{})[_0xab90('0x2b')](respondWithResult(_0x1bb19f,0xc9))[_0xab90('0x48')](handleError(_0x1bb19f,null));};exports[_0xab90('0x4c')]=function(_0xce10c4,_0x4c416d){var _0x2a8860={'where':{'id':_0xce10c4[_0xab90('0x4d')]['id']}},_0x2953dc={};_0x2953dc['model']=_['keys'](db[_0xab90('0x32')][_0xab90('0x33')]);_0x2a8860[_0xab90('0x3b')]=_['intersection'](_0x2953dc[_0xab90('0x36')],qs[_0xab90('0x3c')](_0xce10c4[_0xab90('0x37')][_0xab90('0x3c')]));_0x2a8860[_0xab90('0x3b')]=_0x2a8860[_0xab90('0x3b')][_0xab90('0x3d')]?_0x2a8860['attributes']:_0x2953dc[_0xab90('0x36')];if(_0xce10c4[_0xab90('0x37')][_0xab90('0x46')]){_0x2a8860[_0xab90('0x4e')]=[{'all':!![]}];}_0x2a8860=_[_0xab90('0x44')]({},_0x2a8860,_0xce10c4['options']);return db[_0xab90('0x32')][_0xab90('0x4f')](_0x2a8860)[_0xab90('0x2b')](handleEntityNotFound(_0x4c416d,null))[_0xab90('0x2b')](function(_0x2cc9c0){if(_0x2cc9c0){var _0x1cb7c7=_0x2cc9c0[_0xab90('0x50')]({'plain':!![]});_0x1cb7c7=qs[_0xab90('0x51')](_0x1cb7c7,['id',_0xab90('0x52'),_0xab90('0x53'),'crudPermissions']);_0xce10c4[_0xab90('0x4b')]=_[_0xab90('0x51')](_0xce10c4[_0xab90('0x4b')],['id','createdAt',_0xab90('0x53')]);return db[_0xab90('0x54')][_0xab90('0x55')](function(_0x314624){return db[_0xab90('0x32')][_0xab90('0x4a')](_['merge'](_0x1cb7c7,_0xce10c4[_0xab90('0x4b')]),{'include':_0xce10c4[_0xab90('0x37')][_0xab90('0x46')]?[{'all':!![]}]:undefined,'transaction':_0x314624})[_0xab90('0x2b')](function(_0x3f4b11){var _0x3f4fe0=_0x3f4b11[_0xab90('0x50')]({'plain':!![]});return db[_0xab90('0x56')][_0xab90('0x57')]({'where':{'userProfileId':_0xce10c4[_0xab90('0x4d')]['id']},'raw':!![]})[_0xab90('0x2b')](function(_0x1a5124){if(_0x1a5124){return BPromise[_0xab90('0x58')](_0x1a5124,function(_0x3cd4eb){return new BPromise(function(_0x3fc329,_0x21436e){if(_0x3cd4eb[_0xab90('0x59')]===null||_0x3cd4eb[_0xab90('0x59')]===0x1)_0x3fc329(null);return db[_0xab90('0x5a')][_0xab90('0x57')]({'where':{'sectionId':_0x3cd4eb['id']},'raw':!![]})[_0xab90('0x2b')](function(_0x3e605c){var _0x5840ee=_[_0xab90('0x31')](_0x3e605c,function(_0x4f34d7){return qs[_0xab90('0x51')](_0x4f34d7,['id',_0xab90('0x52'),'updatedAt',_0xab90('0x5b')]);});_0x3fc329(_0x5840ee);})[_0xab90('0x48')](function(_0x3ce4b2){_0x21436e(_0x3ce4b2);});})[_0xab90('0x2b')](function(_0x2390e0){var _0x53c7fb=qs[_0xab90('0x51')](_0x3cd4eb,['id',_0xab90('0x52'),_0xab90('0x53')]);_0x53c7fb[_0xab90('0x5c')]=_0x3f4fe0['id'];if(_0x2390e0)_0x53c7fb['Resources']=_0x2390e0;return _0x53c7fb;})[_0xab90('0x2b')](function(_0x8005c3){return db[_0xab90('0x56')][_0xab90('0x4a')](_0x8005c3,{'include':[{'model':db[_0xab90('0x5a')],'as':'Resources'}],'raw':!![],'transaction':_0x314624});});})[_0xab90('0x2b')](function(){return _0x3f4fe0;});}});});});}})[_0xab90('0x2b')](respondWithResult(_0x4c416d,0xc9))[_0xab90('0x48')](handleError(_0x4c416d,null));};exports['update']=function(_0x5ca541,_0x5b7230){if(_0x5ca541[_0xab90('0x4b')]['id']){delete _0x5ca541[_0xab90('0x4b')]['id'];}return db[_0xab90('0x32')][_0xab90('0x4f')]({'where':{'id':_0x5ca541[_0xab90('0x4d')]['id']}})[_0xab90('0x2b')](handleEntityNotFound(_0x5b7230,null))[_0xab90('0x2b')](saveUpdates(_0x5ca541[_0xab90('0x4b')],null))[_0xab90('0x2b')](respondWithResult(_0x5b7230,null))[_0xab90('0x48')](handleError(_0x5b7230,null));};exports[_0xab90('0x2a')]=function(_0x37dace,_0x4fc9b7){return db[_0xab90('0x32')][_0xab90('0x4f')]({'where':{'id':_0x37dace[_0xab90('0x4d')]['id']}})[_0xab90('0x2b')](handleEntityNotFound(_0x4fc9b7,null))['then'](removeEntity(_0x4fc9b7,null))[_0xab90('0x48')](handleError(_0x4fc9b7,null));};exports['describe']=function(_0x40a7d3,_0x15fda2){return db[_0xab90('0x32')][_0xab90('0x5d')]()[_0xab90('0x2b')](respondWithResult(_0x15fda2,null))[_0xab90('0x48')](handleError(_0x15fda2,null));};exports[_0xab90('0x5e')]=function(_0x3c121d,_0x27fa8){var _0x4e5099=_0x3c121d[_0xab90('0x4b')];return db[_0xab90('0x32')][_0xab90('0x4f')]({'where':{'id':_0x3c121d['params']['id']}})[_0xab90('0x2b')](handleEntityNotFound(_0x27fa8,null))[_0xab90('0x2b')](function(_0x1298cf){if(_0x1298cf){return db['sequelize'][_0xab90('0x55')](function(_0x299c96){return db['UserProfileSection'][_0xab90('0x2a')]({'where':{'userProfileId':_0x3c121d['params']['id'],'sectionId':_[_0xab90('0x31')](_0x4e5099,function(_0x367e18){return _0x367e18[_0xab90('0x5b')];})},'transaction':_0x299c96})[_0xab90('0x2b')](function(){var _0x5b28e6=_['map'](_0x4e5099,function(_0x8b4948){_0x8b4948[_0xab90('0x5c')]=_0x3c121d['params']['id'];return _0x8b4948;});var _0x477321=[];return BPromise[_0xab90('0x58')](_0x5b28e6,function(_0x257554){return db['UserProfileSection'][_0xab90('0x4a')](_0x257554,{'include':[{'model':db[_0xab90('0x5a')],'as':_0xab90('0x5f')}],'raw':!![],'transaction':_0x299c96})['then'](function(_0x576302){_0x477321[_0xab90('0x60')](_0x576302[_0xab90('0x50')]({'plain':!![]}));});})['then'](function(){return _0x477321;});});});}})[_0xab90('0x2b')](function(_0x468e02){return _0x468e02;})[_0xab90('0x2b')](respondWithResult(_0x27fa8,null))[_0xab90('0x48')](handleError(_0x27fa8,null));};exports[_0xab90('0x61')]=function(_0x568777,_0x2a07ab){var _0x50bf5a;return db[_0xab90('0x32')][_0xab90('0x4f')]({'where':{'id':_0x568777['params']['id']},'attributes':['id','name']})[_0xab90('0x2b')](handleEntityNotFound(_0x2a07ab,null))[_0xab90('0x2b')](function(_0x427614){if(_0x427614){_0x50bf5a=_0x427614;return db[_0xab90('0x56')][_0xab90('0x2a')]({'where':{'userProfileId':_0x568777['params']['id'],'sectionId':_0x568777[_0xab90('0x37')]['ids']}});}})['then'](function(){return _0x50bf5a;})[_0xab90('0x2b')](respondWithStatusCode(_0x2a07ab,null))[_0xab90('0x48')](handleError(_0x2a07ab,null));};exports['getSections']=function(_0x97ae25,_0x11cab8){var _0x50bfcc=[];var _0x56027e=[];return db[_0xab90('0x56')][_0xab90('0x57')]({'where':{'userProfileId':_0x97ae25[_0xab90('0x4d')]['id']},'raw':!![]})['then'](function(_0xf48571){_0x50bfcc=_['filter'](_0xf48571,function(_0x286d82){return _0x286d82[_0xab90('0x62')]===0x1||_[_0xab90('0x63')]([0x3eb,0x709],_0x286d82[_0xab90('0x5b')]);});if(!_[_0xab90('0x64')](_0x50bfcc)){return _[_0xab90('0x31')](_0x50bfcc,function(_0x4c154f){return _0x4c154f[_0xab90('0x5b')];});}else{return;}})[_0xab90('0x2b')](function(_0xa630c0){if(_0xa630c0)_0x56027e=_0xa630c0;if(_['includes'](_0x56027e,0x64)){var _0x1b8d15=_[_0xab90('0x4f')](_0x50bfcc,{'sectionId':0x64});return hasDefaultDashboard(_0x1b8d15)[_0xab90('0x2b')](function(_0x22e319){return _[_0xab90('0x31')](_0x50bfcc,function(_0x27e745){if(_0x27e745[_0xab90('0x5b')]===0x64){_0x27e745[_0xab90('0x65')]=_0x22e319;}return _0x27e745;});});}else{return;}})['then'](function(_0x3a31fc){if(_0x3a31fc)_0x50bfcc=_0x3a31fc;if(_['includes'](_0x56027e,0x3eb)){var _0x591acb=_[_0xab90('0x4f')](_0x50bfcc,{'sectionId':0x3eb});return getCustomDashboards(_0x591acb)[_0xab90('0x2b')](function(_0x4ec8ee){return _[_0xab90('0x31')](_0x50bfcc,function(_0x2d51f8){if(_0x591acb[_0xab90('0x62')]){if(_0x2d51f8['sectionId']===0x3eb){_0x2d51f8['subsections']=_0x4ec8ee;}}else{if(_0x2d51f8[_0xab90('0x5b')]===0x64){_0x2d51f8[_0xab90('0x65')]=_0x4ec8ee;}}return _0x2d51f8;});});}else{return;}})[_0xab90('0x2b')](function(_0xea9ac){if(_0xea9ac)_0x50bfcc=_0xea9ac;if(_[_0xab90('0x63')](_0x56027e,0x709)){var _0x2e1fd7=_[_0xab90('0x4f')](_0x50bfcc,{'sectionId':0x709});return getPlugins(_0x2e1fd7)[_0xab90('0x2b')](function(_0x3f2d6a){if(_0x2e1fd7[_0xab90('0x62')]){return _[_0xab90('0x31')](_0x50bfcc,function(_0x13f596){if(_0x13f596[_0xab90('0x5b')]===0x709){_0x13f596[_0xab90('0x65')]=_0x3f2d6a;}return _0x13f596;});}else{var _0x58c765={'sectionId':0x76c,'enabled':0x1,'subsections':_0x3f2d6a};var _0x7db904=_[_0xab90('0x31')](_0x50bfcc);_0x7db904['push'](_0x58c765);return _0x7db904;}});}else{return;}})['then'](function(_0xb68729){if(_0xb68729)_0x50bfcc=_0xb68729;return _[_0xab90('0x42')](_0x50bfcc,[_0xab90('0x62'),0x1]);})[_0xab90('0x2b')](respondWithResult(_0x11cab8,null))[_0xab90('0x48')](handleError(_0x11cab8,null));};function hasDefaultDashboard(_0x59172b){var _0x296e00=[0x65];return new BPromise(function(_0x4e53d7,_0x51e8d7){try{if(_0x59172b[_0xab90('0x59')]){_0x4e53d7(_0x296e00);}else{return db[_0xab90('0x5a')][_0xab90('0x66')]({'where':{'sectionId':_0x59172b['id']},'raw':!![]})[_0xab90('0x2b')](function(_0x48c012){_0x48c012?_0x4e53d7(_0x296e00):_0x4e53d7();});}}catch(_0xe0db61){_0x51e8d7(_0xe0db61);}});}function getCustomDashboards(_0x50a03d){var _0x7ebc2c=[];return new BPromise(function(_0x166f11,_0x4ab9ef){try{if(_0x50a03d[_0xab90('0x59')]){return db[_0xab90('0x67')][_0xab90('0x57')]({'raw':!![]})[_0xab90('0x2b')](function(_0x421f0b){_0x421f0b['forEach'](function(_0x3184c2){_0x7ebc2c[_0xab90('0x60')](_0x3184c2['id']+0x1869f);});_0x166f11(_0x7ebc2c);});}else{return db[_0xab90('0x5a')]['findAll']({'where':{'sectionId':_0x50a03d['id']},'raw':!![]})[_0xab90('0x2b')](function(_0x4aef90){_0x4aef90[_0xab90('0x68')](function(_0x384197){_0x7ebc2c[_0xab90('0x60')](_0x384197[_0xab90('0x69')]+0x1869f);});_0x166f11(_0x7ebc2c);});}}catch(_0x41bf5c){_0x4ab9ef(_0x41bf5c);}});}function getPlugins(_0x333e87){var _0x150f5b=[];return new BPromise(function(_0x4e664c,_0x31a069){try{if(_0x333e87['autoAssociation']){return db['Plugin'][_0xab90('0x57')]({'raw':!![]})[_0xab90('0x2b')](function(_0x450828){_0x450828[_0xab90('0x68')](function(_0xe79335){_0x150f5b[_0xab90('0x60')](_0xe79335['id']+0x15b38);});_0x4e664c(_0x150f5b);});}else{return db[_0xab90('0x5a')][_0xab90('0x57')]({'where':{'sectionId':_0x333e87['id']},'raw':!![]})['then'](function(_0x7f0254){_0x7f0254[_0xab90('0x68')](function(_0x22c06f){_0x150f5b['push'](_0x22c06f[_0xab90('0x69')]+0x15b38);});_0x4e664c(_0x150f5b);});}}catch(_0x41ba31){_0x31a069(_0x41ba31);}});}exports['addResources']=function(_0x3da655,_0x13b781){return db[_0xab90('0x32')][_0xab90('0x4f')]({'where':{'id':_0x3da655['params']['id']}})['then'](handleEntityNotFound(_0x13b781,null))['then'](function(_0x1c9dff){if(_0x1c9dff){return db['sequelize'][_0xab90('0x55')](function(_0x364df5){return db[_0xab90('0x56')][_0xab90('0x57')]({'where':{'userProfileId':_0x3da655[_0xab90('0x4d')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x29b631){if(_0x29b631){return db[_0xab90('0x56')]['destroy']({'where':{'userProfileId':_0x3da655[_0xab90('0x4d')]['id'],'id':_[_0xab90('0x31')](_0x29b631,function(_0x5eeb2d){return _0x5eeb2d['id'];})},'transaction':_0x364df5});}})[_0xab90('0x2b')](function(_0x438e57){var _0x188188=_[_0xab90('0x31')](_0x3da655[_0xab90('0x4b')],function(_0xb3393d){_0xb3393d[_0xab90('0x5c')]=_0x3da655['params']['id'];return _0xb3393d;});return db[_0xab90('0x56')][_0xab90('0x6a')](_0x188188,{'raw':!![],'transaction':_0x364df5});})['then'](function(_0x38e466){var _0x2ccbdb=_[_0xab90('0x42')](_['map'](_0x38e466,function(_0x226c1b){return _0x226c1b[_0xab90('0x50')]({'plain':!![]});}),{'includeAll':![]});if(_0x2ccbdb){return db[_0xab90('0x56')][_0xab90('0x57')]({'where':{'userProfileId':_0x3da655['params']['id'],'sectionId':_['map'](_0x2ccbdb,function(_0x599b95){return _0x599b95[_0xab90('0x5b')];})},'attributes':['id','sectionId'],'raw':!![]})[_0xab90('0x2b')](function(_0x22bd9b){var _0x545476=_[_0xab90('0x31')](_0x3da655['body'],function(_0x175c6c){_0x175c6c[_0xab90('0x5c')]=_0x3da655[_0xab90('0x4d')]['id'];return _0x175c6c;});return db[_0xab90('0x5a')][_0xab90('0x6a')](_0x545476,{'raw':!![],'transaction':_0x364df5});});}})['catch'](handleError(_0x13b781,null));});}})[_0xab90('0x2b')](function(_0x4603fa){var _0x58d33d=_['map'](_0x4603fa,function(_0x8c8a1e){return _0x8c8a1e[_0xab90('0x50')]({'plain':!![]});});})[_0xab90('0x2b')](respondWithResult(_0x13b781,null))[_0xab90('0x48')](handleError(_0x13b781,null));};exports[_0xab90('0x6b')]=function(_0x47ca16,_0x3315f9,_0x572a6d){return db[_0xab90('0x32')][_0xab90('0x4f')]({'where':{'id':_0x47ca16['params']['id']}})[_0xab90('0x2b')](handleEntityNotFound(_0x3315f9,null))[_0xab90('0x2b')](function(_0x26f7ed){if(_0x26f7ed){return _0x26f7ed[_0xab90('0x6b')](_0x47ca16['query'][_0xab90('0x6c')]);}})[_0xab90('0x2b')](respondWithStatusCode(_0x3315f9,null))[_0xab90('0x48')](handleError(_0x3315f9,null));};exports[_0xab90('0x6d')]=function(_0x3ea6aa,_0x5c106c){var _0x1bc5a1={};if(!_0x3ea6aa[_0xab90('0x37')][_0xab90('0x6e')])throw new Error(_0xab90('0x6f'));if(!_0x3ea6aa[_0xab90('0x37')][_0xab90('0x3e')](_0xab90('0x3f'))){_0x1bc5a1['limit']=qs['limit'](_0x3ea6aa[_0xab90('0x37')][_0xab90('0x21')]);_0x1bc5a1['offset']=qs[_0xab90('0x1f')](_0x3ea6aa['query']['offset']);}return db[_0xab90('0x32')]['find']({'where':{'id':_0x3ea6aa[_0xab90('0x4d')]['id']}})[_0xab90('0x2b')](function(_0x5a1cc5){if(!_0x5a1cc5)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x3ea6aa[_0xab90('0x4d')]['id']);return db[_0xab90('0x32')][_0xab90('0x6d')](_0x3ea6aa);})[_0xab90('0x2b')](respondWithFilteredResult(_0x5c106c,_0x1bc5a1))[_0xab90('0x48')](handleError(_0x5c106c,null));}; \ No newline at end of file +var _0xa329=['UserProfileResource','describe','addSections','push','removeSections','ids','getSections','includes','isEmpty','subsections','enabled','Dashboard','forEach','Plugin','resourceId','addResources','bulkCreate','removeResources','getResources','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./userProfile.socket','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','UserProfile','fieldName','type','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','includeAll','include','findAll','rows','catch','params','rawAttributes','fields','length','find','create','body','clone','options','get','omit','updatedAt','createdAt','sequelize','transaction','each','autoAssociation','sectionId','userProfileId','Resources','UserProfileSection'];(function(_0x5b4c44,_0x2e495e){var _0x58485a=function(_0x13299b){while(--_0x13299b){_0x5b4c44['push'](_0x5b4c44['shift']());}};_0x58485a(++_0x2e495e);}(_0xa329,0x162));var _0x9a32=function(_0x130f83,_0x3ea1c5){_0x130f83=_0x130f83-0x0;var _0x397016=_0xa329[_0x130f83];return _0x397016;};'use strict';var emlformat=require(_0x9a32('0x0'));var rimraf=require(_0x9a32('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9a32('0x2'));var rp=require('request-promise');var moment=require(_0x9a32('0x3'));var BPromise=require(_0x9a32('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9a32('0x5'));var sox=require(_0x9a32('0x6'));var csv=require(_0x9a32('0x7'));var ejs=require(_0x9a32('0x8'));var fs=require('fs');var fs_extra=require(_0x9a32('0x9'));var _=require(_0x9a32('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9a32('0xb'));var toCsv=require(_0x9a32('0x7'));var querystring=require('querystring');var Papa=require(_0x9a32('0xc'));var Redis=require(_0x9a32('0xd'));var authService=require(_0x9a32('0xe'));var qs=require(_0x9a32('0xf'));var as=require(_0x9a32('0x10'));var hardwareService=require(_0x9a32('0x11'));var logger=require('../../config/logger')(_0x9a32('0x12'));var utils=require(_0x9a32('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9a32('0x14'))['db'];config[_0x9a32('0x15')]=_['defaults'](config['redis'],{'host':_0x9a32('0x16'),'port':0x18eb});var socket=require(_0x9a32('0x17'))(new Redis(config[_0x9a32('0x15')]));require(_0x9a32('0x18'))['register'](socket);function respondWithStatusCode(_0x224747,_0x37ab43){_0x37ab43=_0x37ab43||0xcc;return function(_0x5d35ed){if(_0x5d35ed){return _0x224747[_0x9a32('0x19')](_0x37ab43);}return _0x224747[_0x9a32('0x1a')](_0x37ab43)[_0x9a32('0x1b')]();};}function respondWithResult(_0x448fd6,_0x20ae14){_0x20ae14=_0x20ae14||0xc8;return function(_0x1dbf9d){if(_0x1dbf9d){return _0x448fd6['status'](_0x20ae14)[_0x9a32('0x1c')](_0x1dbf9d);}};}function respondWithFilteredResult(_0x31bd3e,_0x815a68){return function(_0x4cfd70){if(_0x4cfd70){var _0x3606ab=typeof _0x815a68[_0x9a32('0x1d')]==='undefined'&&typeof _0x815a68['limit']===_0x9a32('0x1e');var _0x56df79=_0x4cfd70[_0x9a32('0x1f')];var _0x42bf59=_0x3606ab?0x0:_0x815a68[_0x9a32('0x1d')];var _0x526e92=_0x3606ab?_0x4cfd70[_0x9a32('0x1f')]:_0x815a68[_0x9a32('0x1d')]+_0x815a68[_0x9a32('0x20')];var _0x4ca971;if(_0x526e92>=_0x56df79){_0x526e92=_0x56df79;_0x4ca971=0xc8;}else{_0x4ca971=0xce;}_0x31bd3e[_0x9a32('0x1a')](_0x4ca971);return _0x31bd3e[_0x9a32('0x21')](_0x9a32('0x22'),_0x42bf59+'-'+_0x526e92+'/'+_0x56df79)[_0x9a32('0x1c')](_0x4cfd70);}return null;};}function patchUpdates(_0x3b3e66){return function(_0x210a32){try{jsonpatch['apply'](_0x210a32,_0x3b3e66,!![]);}catch(_0x4e6e68){return BPromise[_0x9a32('0x23')](_0x4e6e68);}return _0x210a32[_0x9a32('0x24')]();};}function saveUpdates(_0x109144,_0x4d8771){return function(_0x494aca){if(_0x494aca){return _0x494aca[_0x9a32('0x25')](_0x109144)[_0x9a32('0x26')](function(_0x301dac){return _0x301dac;});}return null;};}function removeEntity(_0x51889a,_0x49531d){return function(_0x4b7f6b){if(_0x4b7f6b){return _0x4b7f6b[_0x9a32('0x27')]()['then'](function(){_0x51889a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f5a84,_0x13a5d5){return function(_0x10edcf){if(!_0x10edcf){_0x1f5a84[_0x9a32('0x19')](0x194);}return _0x10edcf;};}function handleError(_0x4168e3,_0x3209a8){_0x3209a8=_0x3209a8||0x1f4;return function(_0x13787b){logger[_0x9a32('0x28')](_0x13787b[_0x9a32('0x29')]);if(_0x13787b[_0x9a32('0x2a')]){delete _0x13787b[_0x9a32('0x2a')];}_0x4168e3['status'](_0x3209a8)[_0x9a32('0x2b')](_0x13787b);};}exports[_0x9a32('0x2c')]=function(_0x5b7a1d,_0x3e9e85){var _0x48674a={},_0x18a7b3={},_0x227dbc={'count':0x0,'rows':[]};var _0x416ba3=_[_0x9a32('0x2d')](db[_0x9a32('0x2e')]['rawAttributes'],function(_0xcabf0f){return{'name':_0xcabf0f[_0x9a32('0x2f')],'type':_0xcabf0f[_0x9a32('0x30')][_0x9a32('0x31')]};});_0x18a7b3[_0x9a32('0x32')]=_[_0x9a32('0x2d')](_0x416ba3,'name');_0x18a7b3[_0x9a32('0x33')]=_[_0x9a32('0x34')](_0x5b7a1d[_0x9a32('0x33')]);_0x18a7b3[_0x9a32('0x35')]=_[_0x9a32('0x36')](_0x18a7b3['model'],_0x18a7b3[_0x9a32('0x33')]);_0x48674a['attributes']=_[_0x9a32('0x36')](_0x18a7b3['model'],qs['fields'](_0x5b7a1d['query']['fields']));_0x48674a[_0x9a32('0x37')]=_0x48674a[_0x9a32('0x37')]['length']?_0x48674a[_0x9a32('0x37')]:_0x18a7b3[_0x9a32('0x32')];if(!_0x5b7a1d[_0x9a32('0x33')][_0x9a32('0x38')](_0x9a32('0x39'))){_0x48674a['limit']=qs[_0x9a32('0x20')](_0x5b7a1d[_0x9a32('0x33')][_0x9a32('0x20')]);_0x48674a[_0x9a32('0x1d')]=qs[_0x9a32('0x1d')](_0x5b7a1d[_0x9a32('0x33')][_0x9a32('0x1d')]);}_0x48674a[_0x9a32('0x3a')]=qs[_0x9a32('0x3b')](_0x5b7a1d['query'][_0x9a32('0x3b')]);_0x48674a['where']=qs[_0x9a32('0x35')](_[_0x9a32('0x3c')](_0x5b7a1d[_0x9a32('0x33')],_0x18a7b3[_0x9a32('0x35')]),_0x416ba3);if(_0x5b7a1d[_0x9a32('0x33')][_0x9a32('0x3d')]){_0x48674a[_0x9a32('0x3e')]=_[_0x9a32('0x3f')](_0x48674a[_0x9a32('0x3e')],{'$or':_[_0x9a32('0x2d')](_0x416ba3,function(_0x1b464b){if(_0x1b464b[_0x9a32('0x30')]!=='VIRTUAL'){var _0xdba972={};_0xdba972[_0x1b464b['name']]={'$like':'%'+_0x5b7a1d[_0x9a32('0x33')][_0x9a32('0x3d')]+'%'};return _0xdba972;}})});}_0x48674a=_['merge']({},_0x48674a,_0x5b7a1d['options']);var _0x58bb76={'where':_0x48674a[_0x9a32('0x3e')]};return db[_0x9a32('0x2e')]['count'](_0x58bb76)[_0x9a32('0x26')](function(_0x551215){_0x227dbc[_0x9a32('0x1f')]=_0x551215;if(_0x5b7a1d[_0x9a32('0x33')][_0x9a32('0x40')]){_0x48674a[_0x9a32('0x41')]=[{'all':!![]}];}return db[_0x9a32('0x2e')][_0x9a32('0x42')](_0x48674a);})[_0x9a32('0x26')](function(_0x50a03d){_0x227dbc[_0x9a32('0x43')]=_0x50a03d;return _0x227dbc;})[_0x9a32('0x26')](respondWithFilteredResult(_0x3e9e85,_0x48674a))[_0x9a32('0x44')](handleError(_0x3e9e85,null));};exports['show']=function(_0x28d7ee,_0x535ac7){var _0x43e16a={'raw':![],'where':{'id':_0x28d7ee[_0x9a32('0x45')]['id']}},_0x3eee4e={};_0x3eee4e['model']=_[_0x9a32('0x34')](db[_0x9a32('0x2e')][_0x9a32('0x46')]);_0x3eee4e[_0x9a32('0x33')]=_[_0x9a32('0x34')](_0x28d7ee[_0x9a32('0x33')]);_0x3eee4e[_0x9a32('0x35')]=_[_0x9a32('0x36')](_0x3eee4e['model'],_0x3eee4e[_0x9a32('0x33')]);_0x43e16a['attributes']=_[_0x9a32('0x36')](_0x3eee4e[_0x9a32('0x32')],qs[_0x9a32('0x47')](_0x28d7ee[_0x9a32('0x33')][_0x9a32('0x47')]));_0x43e16a[_0x9a32('0x37')]=_0x43e16a[_0x9a32('0x37')][_0x9a32('0x48')]?_0x43e16a[_0x9a32('0x37')]:_0x3eee4e[_0x9a32('0x32')];if(_0x28d7ee[_0x9a32('0x33')]['includeAll']){_0x43e16a['include']=[{'all':!![]}];}_0x43e16a=_[_0x9a32('0x3f')]({},_0x43e16a,_0x28d7ee['options']);return db[_0x9a32('0x2e')][_0x9a32('0x49')](_0x43e16a)[_0x9a32('0x26')](handleEntityNotFound(_0x535ac7,null))[_0x9a32('0x26')](respondWithResult(_0x535ac7,null))['catch'](handleError(_0x535ac7,null));};exports[_0x9a32('0x4a')]=function(_0x253ebc,_0x195de1){return db[_0x9a32('0x2e')][_0x9a32('0x4a')](_0x253ebc[_0x9a32('0x4b')],{})[_0x9a32('0x26')](respondWithResult(_0x195de1,0xc9))[_0x9a32('0x44')](handleError(_0x195de1,null));};exports[_0x9a32('0x4c')]=function(_0x5108d6,_0x39808e){var _0x439270={'where':{'id':_0x5108d6[_0x9a32('0x45')]['id']}},_0x44b0e8={};_0x44b0e8[_0x9a32('0x32')]=_[_0x9a32('0x34')](db['UserProfile'][_0x9a32('0x46')]);_0x439270['attributes']=_[_0x9a32('0x36')](_0x44b0e8[_0x9a32('0x32')],qs[_0x9a32('0x47')](_0x5108d6[_0x9a32('0x33')][_0x9a32('0x47')]));_0x439270[_0x9a32('0x37')]=_0x439270[_0x9a32('0x37')][_0x9a32('0x48')]?_0x439270['attributes']:_0x44b0e8[_0x9a32('0x32')];if(_0x5108d6[_0x9a32('0x33')]['includeAll']){_0x439270['include']=[{'all':!![]}];}_0x439270=_[_0x9a32('0x3f')]({},_0x439270,_0x5108d6[_0x9a32('0x4d')]);return db['UserProfile'][_0x9a32('0x49')](_0x439270)[_0x9a32('0x26')](handleEntityNotFound(_0x39808e,null))[_0x9a32('0x26')](function(_0x519398){if(_0x519398){var _0x452290=_0x519398[_0x9a32('0x4e')]({'plain':!![]});_0x452290=qs[_0x9a32('0x4f')](_0x452290,['id','createdAt',_0x9a32('0x50'),'crudPermissions']);_0x5108d6['body']=_[_0x9a32('0x4f')](_0x5108d6[_0x9a32('0x4b')],['id',_0x9a32('0x51'),'updatedAt']);return db[_0x9a32('0x52')][_0x9a32('0x53')](function(_0x16c9c2){return db[_0x9a32('0x2e')][_0x9a32('0x4a')](_[_0x9a32('0x3f')](_0x452290,_0x5108d6[_0x9a32('0x4b')]),{'include':_0x5108d6[_0x9a32('0x33')]['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x16c9c2})['then'](function(_0x5c67c8){var _0x237a22=_0x5c67c8[_0x9a32('0x4e')]({'plain':!![]});return db['UserProfileSection'][_0x9a32('0x42')]({'where':{'userProfileId':_0x5108d6[_0x9a32('0x45')]['id']},'raw':!![]})[_0x9a32('0x26')](function(_0x291ea6){if(_0x291ea6){return BPromise[_0x9a32('0x54')](_0x291ea6,function(_0x6e5b4){return new BPromise(function(_0x31f8b3,_0x3aa8cb){if(_0x6e5b4[_0x9a32('0x55')]===null||_0x6e5b4['autoAssociation']===0x1)_0x31f8b3(null);return db['UserProfileResource'][_0x9a32('0x42')]({'where':{'sectionId':_0x6e5b4['id']},'raw':!![]})[_0x9a32('0x26')](function(_0x5a7dbd){var _0x4ddb3f=_[_0x9a32('0x2d')](_0x5a7dbd,function(_0xc777cc){return qs[_0x9a32('0x4f')](_0xc777cc,['id',_0x9a32('0x51'),_0x9a32('0x50'),_0x9a32('0x56')]);});_0x31f8b3(_0x4ddb3f);})[_0x9a32('0x44')](function(_0x5c37c9){_0x3aa8cb(_0x5c37c9);});})[_0x9a32('0x26')](function(_0xe2ba2e){var _0x3447d9=qs[_0x9a32('0x4f')](_0x6e5b4,['id',_0x9a32('0x51'),_0x9a32('0x50')]);_0x3447d9[_0x9a32('0x57')]=_0x237a22['id'];if(_0xe2ba2e)_0x3447d9[_0x9a32('0x58')]=_0xe2ba2e;return _0x3447d9;})[_0x9a32('0x26')](function(_0x537e8f){return db[_0x9a32('0x59')][_0x9a32('0x4a')](_0x537e8f,{'include':[{'model':db[_0x9a32('0x5a')],'as':_0x9a32('0x58')}],'raw':!![],'transaction':_0x16c9c2});});})[_0x9a32('0x26')](function(){return _0x237a22;});}});});});}})[_0x9a32('0x26')](respondWithResult(_0x39808e,0xc9))[_0x9a32('0x44')](handleError(_0x39808e,null));};exports[_0x9a32('0x25')]=function(_0x5389bf,_0x1d95ab){if(_0x5389bf[_0x9a32('0x4b')]['id']){delete _0x5389bf[_0x9a32('0x4b')]['id'];}return db[_0x9a32('0x2e')]['find']({'where':{'id':_0x5389bf[_0x9a32('0x45')]['id']}})[_0x9a32('0x26')](handleEntityNotFound(_0x1d95ab,null))[_0x9a32('0x26')](saveUpdates(_0x5389bf[_0x9a32('0x4b')],null))[_0x9a32('0x26')](respondWithResult(_0x1d95ab,null))[_0x9a32('0x44')](handleError(_0x1d95ab,null));};exports[_0x9a32('0x27')]=function(_0x5ab47b,_0x18abe9){return db['UserProfile'][_0x9a32('0x49')]({'where':{'id':_0x5ab47b['params']['id']}})[_0x9a32('0x26')](handleEntityNotFound(_0x18abe9,null))[_0x9a32('0x26')](removeEntity(_0x18abe9,null))[_0x9a32('0x44')](handleError(_0x18abe9,null));};exports[_0x9a32('0x5b')]=function(_0x182402,_0x49a671){return db[_0x9a32('0x2e')][_0x9a32('0x5b')]()['then'](respondWithResult(_0x49a671,null))[_0x9a32('0x44')](handleError(_0x49a671,null));};exports[_0x9a32('0x5c')]=function(_0x2c3704,_0x1a9889){var _0x31d81c=_0x2c3704[_0x9a32('0x4b')];return db['UserProfile'][_0x9a32('0x49')]({'where':{'id':_0x2c3704[_0x9a32('0x45')]['id']}})[_0x9a32('0x26')](handleEntityNotFound(_0x1a9889,null))[_0x9a32('0x26')](function(_0x6ad0eb){if(_0x6ad0eb){return db[_0x9a32('0x52')][_0x9a32('0x53')](function(_0x3ed9b4){return db[_0x9a32('0x59')]['destroy']({'where':{'userProfileId':_0x2c3704[_0x9a32('0x45')]['id'],'sectionId':_[_0x9a32('0x2d')](_0x31d81c,function(_0x309a9c){return _0x309a9c[_0x9a32('0x56')];})},'transaction':_0x3ed9b4})[_0x9a32('0x26')](function(){var _0x36d866=_['map'](_0x31d81c,function(_0x4c4a85){_0x4c4a85['userProfileId']=_0x2c3704['params']['id'];return _0x4c4a85;});var _0x35a973=[];return BPromise[_0x9a32('0x54')](_0x36d866,function(_0x1015b5){return db['UserProfileSection'][_0x9a32('0x4a')](_0x1015b5,{'include':[{'model':db[_0x9a32('0x5a')],'as':'Resources'}],'raw':!![],'transaction':_0x3ed9b4})['then'](function(_0x11da52){_0x35a973[_0x9a32('0x5d')](_0x11da52[_0x9a32('0x4e')]({'plain':!![]}));});})[_0x9a32('0x26')](function(){return _0x35a973;});});});}})[_0x9a32('0x26')](function(_0x5c7454){return _0x5c7454;})[_0x9a32('0x26')](respondWithResult(_0x1a9889,null))[_0x9a32('0x44')](handleError(_0x1a9889,null));};exports[_0x9a32('0x5e')]=function(_0xe30624,_0x465c2c){var _0x5cabc9;return db[_0x9a32('0x2e')][_0x9a32('0x49')]({'where':{'id':_0xe30624[_0x9a32('0x45')]['id']},'attributes':['id',_0x9a32('0x2a')]})[_0x9a32('0x26')](handleEntityNotFound(_0x465c2c,null))['then'](function(_0x4af5f2){if(_0x4af5f2){_0x5cabc9=_0x4af5f2;return db[_0x9a32('0x59')]['destroy']({'where':{'userProfileId':_0xe30624[_0x9a32('0x45')]['id'],'sectionId':_0xe30624[_0x9a32('0x33')][_0x9a32('0x5f')]}});}})[_0x9a32('0x26')](function(){return _0x5cabc9;})[_0x9a32('0x26')](respondWithStatusCode(_0x465c2c,null))[_0x9a32('0x44')](handleError(_0x465c2c,null));};exports[_0x9a32('0x60')]=function(_0x1a1a7d,_0x68b2a7){var _0x254c77=[];var _0x3d76f2=[];return db[_0x9a32('0x59')][_0x9a32('0x42')]({'where':{'userProfileId':_0x1a1a7d['params']['id']},'raw':!![]})[_0x9a32('0x26')](function(_0x338a2b){_0x254c77=_[_0x9a32('0x3d')](_0x338a2b,function(_0x3b8947){return _0x3b8947['enabled']===0x1||_[_0x9a32('0x61')]([0x3eb,0x709],_0x3b8947[_0x9a32('0x56')]);});if(!_[_0x9a32('0x62')](_0x254c77)){return _[_0x9a32('0x2d')](_0x254c77,function(_0x9a57c7){return _0x9a57c7[_0x9a32('0x56')];});}else{return;}})[_0x9a32('0x26')](function(_0x3e490c){if(_0x3e490c)_0x3d76f2=_0x3e490c;if(_[_0x9a32('0x61')](_0x3d76f2,0x64)){var _0x3d5e7d=_[_0x9a32('0x49')](_0x254c77,{'sectionId':0x64});return hasDefaultDashboard(_0x3d5e7d)[_0x9a32('0x26')](function(_0x4889b2){return _[_0x9a32('0x2d')](_0x254c77,function(_0x14968c){if(_0x14968c[_0x9a32('0x56')]===0x64){_0x14968c[_0x9a32('0x63')]=_0x4889b2;}return _0x14968c;});});}else{return;}})['then'](function(_0x220a45){if(_0x220a45)_0x254c77=_0x220a45;if(_[_0x9a32('0x61')](_0x3d76f2,0x3eb)){var _0x33a4f6=_[_0x9a32('0x49')](_0x254c77,{'sectionId':0x3eb});return getCustomDashboards(_0x33a4f6)['then'](function(_0x3487d5){return _['map'](_0x254c77,function(_0x3e2675){if(_0x33a4f6[_0x9a32('0x64')]){if(_0x3e2675[_0x9a32('0x56')]===0x3eb){_0x3e2675[_0x9a32('0x63')]=_0x3487d5;}}else{if(_0x3e2675[_0x9a32('0x56')]===0x64){_0x3e2675['subsections']=_0x3487d5;}}return _0x3e2675;});});}else{return;}})[_0x9a32('0x26')](function(_0x1262de){if(_0x1262de)_0x254c77=_0x1262de;if(_[_0x9a32('0x61')](_0x3d76f2,0x709)){var _0x1e5900=_[_0x9a32('0x49')](_0x254c77,{'sectionId':0x709});return getPlugins(_0x1e5900)['then'](function(_0x34730b){if(_0x1e5900[_0x9a32('0x64')]){return _[_0x9a32('0x2d')](_0x254c77,function(_0x1b6dd6){if(_0x1b6dd6['sectionId']===0x709){_0x1b6dd6[_0x9a32('0x63')]=_0x34730b;}return _0x1b6dd6;});}else{var _0x347e99={'sectionId':0x76c,'enabled':0x1,'subsections':_0x34730b};var _0x52c92a=_[_0x9a32('0x2d')](_0x254c77);_0x52c92a[_0x9a32('0x5d')](_0x347e99);return _0x52c92a;}});}else{return;}})[_0x9a32('0x26')](function(_0x286495){if(_0x286495)_0x254c77=_0x286495;return _['filter'](_0x254c77,[_0x9a32('0x64'),0x1]);})[_0x9a32('0x26')](respondWithResult(_0x68b2a7,null))['catch'](handleError(_0x68b2a7,null));};function hasDefaultDashboard(_0x3a5773){var _0x53fb25=[0x65];return new BPromise(function(_0x532329,_0x5a13af){try{if(_0x3a5773['autoAssociation']){_0x532329(_0x53fb25);}else{return db[_0x9a32('0x5a')]['findOne']({'where':{'sectionId':_0x3a5773['id']},'raw':!![]})[_0x9a32('0x26')](function(_0x425e71){_0x425e71?_0x532329(_0x53fb25):_0x532329();});}}catch(_0x429f91){_0x5a13af(_0x429f91);}});}function getCustomDashboards(_0x25a5e8){var _0x14c11d=[];return new BPromise(function(_0x2f2761,_0x2a3450){try{if(_0x25a5e8[_0x9a32('0x55')]){return db[_0x9a32('0x65')][_0x9a32('0x42')]({'raw':!![]})[_0x9a32('0x26')](function(_0x14697b){_0x14697b[_0x9a32('0x66')](function(_0x41d357){_0x14c11d[_0x9a32('0x5d')](_0x41d357['id']+0x1869f);});_0x2f2761(_0x14c11d);});}else{return db[_0x9a32('0x5a')][_0x9a32('0x42')]({'where':{'sectionId':_0x25a5e8['id']},'raw':!![]})[_0x9a32('0x26')](function(_0x39fbf4){_0x39fbf4[_0x9a32('0x66')](function(_0x2ecb0a){_0x14c11d['push'](_0x2ecb0a['resourceId']+0x1869f);});_0x2f2761(_0x14c11d);});}}catch(_0x3387e3){_0x2a3450(_0x3387e3);}});}function getPlugins(_0x2ff970){var _0x203573=[];return new BPromise(function(_0x37d9d5,_0x4fe33d){try{if(_0x2ff970[_0x9a32('0x55')]){return db[_0x9a32('0x67')][_0x9a32('0x42')]({'raw':!![]})['then'](function(_0x565fbb){_0x565fbb[_0x9a32('0x66')](function(_0x3911c6){_0x203573[_0x9a32('0x5d')](_0x3911c6['id']+0x15b38);});_0x37d9d5(_0x203573);});}else{return db[_0x9a32('0x5a')][_0x9a32('0x42')]({'where':{'sectionId':_0x2ff970['id']},'raw':!![]})[_0x9a32('0x26')](function(_0x5a874e){_0x5a874e[_0x9a32('0x66')](function(_0x531f44){_0x203573[_0x9a32('0x5d')](_0x531f44[_0x9a32('0x68')]+0x15b38);});_0x37d9d5(_0x203573);});}}catch(_0x189a83){_0x4fe33d(_0x189a83);}});}exports[_0x9a32('0x69')]=function(_0x2e19df,_0xef60f8){return db[_0x9a32('0x2e')][_0x9a32('0x49')]({'where':{'id':_0x2e19df[_0x9a32('0x45')]['id']}})[_0x9a32('0x26')](handleEntityNotFound(_0xef60f8,null))[_0x9a32('0x26')](function(_0x301df0){if(_0x301df0){return db['sequelize'][_0x9a32('0x53')](function(_0x376f93){return db[_0x9a32('0x59')][_0x9a32('0x42')]({'where':{'userProfileId':_0x2e19df[_0x9a32('0x45')]['id']},'attributes':['id'],'raw':!![]})[_0x9a32('0x26')](function(_0x331444){if(_0x331444){return db[_0x9a32('0x59')][_0x9a32('0x27')]({'where':{'userProfileId':_0x2e19df[_0x9a32('0x45')]['id'],'id':_[_0x9a32('0x2d')](_0x331444,function(_0x177a3a){return _0x177a3a['id'];})},'transaction':_0x376f93});}})[_0x9a32('0x26')](function(_0x327c2a){var _0x4908ef=_['map'](_0x2e19df[_0x9a32('0x4b')],function(_0x56a8e4){_0x56a8e4[_0x9a32('0x57')]=_0x2e19df[_0x9a32('0x45')]['id'];return _0x56a8e4;});return db[_0x9a32('0x59')][_0x9a32('0x6a')](_0x4908ef,{'raw':!![],'transaction':_0x376f93});})[_0x9a32('0x26')](function(_0x48901a){var _0x591d8=_['filter'](_[_0x9a32('0x2d')](_0x48901a,function(_0x35ef0a){return _0x35ef0a['get']({'plain':!![]});}),{'includeAll':![]});if(_0x591d8){return db[_0x9a32('0x59')][_0x9a32('0x42')]({'where':{'userProfileId':_0x2e19df[_0x9a32('0x45')]['id'],'sectionId':_[_0x9a32('0x2d')](_0x591d8,function(_0x523ac7){return _0x523ac7[_0x9a32('0x56')];})},'attributes':['id','sectionId'],'raw':!![]})[_0x9a32('0x26')](function(_0x3e4382){var _0x4a2335=_[_0x9a32('0x2d')](_0x2e19df['body'],function(_0x5e6d6d){_0x5e6d6d['userProfileId']=_0x2e19df[_0x9a32('0x45')]['id'];return _0x5e6d6d;});return db[_0x9a32('0x5a')]['bulkCreate'](_0x4a2335,{'raw':!![],'transaction':_0x376f93});});}})['catch'](handleError(_0xef60f8,null));});}})[_0x9a32('0x26')](function(_0x244d54){var _0x4606e0=_['map'](_0x244d54,function(_0x579d65){return _0x579d65[_0x9a32('0x4e')]({'plain':!![]});});})[_0x9a32('0x26')](respondWithResult(_0xef60f8,null))[_0x9a32('0x44')](handleError(_0xef60f8,null));};exports['removeResources']=function(_0xe68b91,_0xa873bd,_0x13bea0){return db[_0x9a32('0x2e')]['find']({'where':{'id':_0xe68b91[_0x9a32('0x45')]['id']}})['then'](handleEntityNotFound(_0xa873bd,null))['then'](function(_0x19c888){if(_0x19c888){return _0x19c888[_0x9a32('0x6b')](_0xe68b91[_0x9a32('0x33')]['ids']);}})[_0x9a32('0x26')](respondWithStatusCode(_0xa873bd,null))[_0x9a32('0x44')](handleError(_0xa873bd,null));};exports[_0x9a32('0x6c')]=function(_0x67d518,_0x46a76f){var _0x3937ce={};if(!_0x67d518[_0x9a32('0x33')]['section'])throw new Error(_0x9a32('0x6d'));if(!_0x67d518[_0x9a32('0x33')][_0x9a32('0x38')]('nolimit')){_0x3937ce[_0x9a32('0x20')]=qs[_0x9a32('0x20')](_0x67d518[_0x9a32('0x33')][_0x9a32('0x20')]);_0x3937ce[_0x9a32('0x1d')]=qs[_0x9a32('0x1d')](_0x67d518['query']['offset']);}return db[_0x9a32('0x2e')][_0x9a32('0x49')]({'where':{'id':_0x67d518['params']['id']}})[_0x9a32('0x26')](function(_0x21f2eb){if(!_0x21f2eb)throw new Error(_0x9a32('0x6e')+_0x67d518[_0x9a32('0x45')]['id']);return db['UserProfile']['getResources'](_0x67d518);})[_0x9a32('0x26')](respondWithFilteredResult(_0x46a76f,_0x3937ce))[_0x9a32('0x44')](handleError(_0x46a76f,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 3f65d2d..383461c 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 _0x9e2e=['save','emit','hasOwnProperty','exports','events','../../mysqldb','UserProfile'];(function(_0x5a78c1,_0x50e2ff){var _0x564cc4=function(_0x42ae83){while(--_0x42ae83){_0x5a78c1['push'](_0x5a78c1['shift']());}};_0x564cc4(++_0x50e2ff);}(_0x9e2e,0xd6));var _0xe9e2=function(_0x3286e2,_0x5edabd){_0x3286e2=_0x3286e2-0x0;var _0x351546=_0x9e2e[_0x3286e2];return _0x351546;};'use strict';var EventEmitter=require(_0xe9e2('0x0'));var UserProfile=require(_0xe9e2('0x1'))['db'][_0xe9e2('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe9e2('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2d34ef){return function(_0x11a0e5,_0x3bfa90,_0x212d98){UserProfileEvents[_0xe9e2('0x4')](_0x2d34ef+':'+_0x11a0e5['id'],_0x11a0e5);UserProfileEvents[_0xe9e2('0x4')](_0x2d34ef,_0x11a0e5);_0x212d98(null);};}for(var e in events){if(events[_0xe9e2('0x5')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0xe9e2('0x6')]=UserProfileEvents; \ No newline at end of file +var _0xf981=['save','update','remove','emit','hasOwnProperty','events','../../mysqldb','UserProfile','setMaxListeners'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xf981,0xe6));var _0x1f98=function(_0x518687,_0x412e35){_0x518687=_0x518687-0x0;var _0x59adf4=_0xf981[_0x518687];return _0x59adf4;};'use strict';var EventEmitter=require(_0x1f98('0x0'));var UserProfile=require(_0x1f98('0x1'))['db'][_0x1f98('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x1f98('0x3')](0x0);var events={'afterCreate':_0x1f98('0x4'),'afterUpdate':_0x1f98('0x5'),'afterDestroy':_0x1f98('0x6')};function emitEvent(_0xd68165){return function(_0x562a81,_0x14da55,_0x15c6fa){UserProfileEvents[_0x1f98('0x7')](_0xd68165+':'+_0x562a81['id'],_0x562a81);UserProfileEvents[_0x1f98('0x7')](_0xd68165,_0x562a81);_0x15c6fa(null);};}for(var e in events){if(events[_0x1f98('0x8')](e)){var event=events[e];UserProfile['hook'](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 85250fc..4b70c84 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 _0xeaa2=['ZohoAccount','cannedanswers','CannedAnswer','dispositions','customdashboards','Dashboard','pauses','scheduler','sounds','Sound','tags','Tag','Template','triggers','Trigger','Trunk','variables','plugins','Plugin','Reports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','Sequelize','QueryTypes','SELECT','ui.','InteractionId','user_has_','_interactions','where','sequelize','query','toString','OpenTabs','define','UserProfile','user_profiles','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push','UserProfileSection','params','all','ignore','union','find','autoAssociation','rawAttributes','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','sort','pick','merge','key','VIRTUAL','foreignKey','forEach','options','includeAll','include','reportType','default','DefaultReports','custom','CustomReports','count','rows','tag','openTabs','true','chat','dataValues','sms','mail','openchannel','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs','exports','models','filter','field','value','findAll','then','associatedResources','map','model','name','catch','UserProfileResource','AnalyticExtractedReport','type','resourceId','toLowerCase','squareprojects','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projectName','JscriptyProject','contacts','CmContact','CmList','CmCompany','globalcustomfields','chatqueues','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','VoiceContext','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','role','agent','Telephones','User','telephone','VoiceQueues','VoiceQueue','inbound','QueueCampaigns','queue','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','OpenchannelQueue','OpenchannelAccount','smsqueues','SmsQueue','WhatsappQueue','whatsappaccounts','WhatsappAccount','voicequeues','queuecampaigns','users','agents','Users','admin','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts'];(function(_0x112a07,_0x47cdef){var _0x40ee5a=function(_0x481154){while(--_0x481154){_0x112a07['push'](_0x112a07['shift']());}};_0x40ee5a(++_0x47cdef);}(_0xeaa2,0x115));var _0x2eaa=function(_0x303064,_0x12f0c2){_0x303064=_0x303064-0x0;var _0x5a1d3d=_0xeaa2[_0x303064];return _0x5a1d3d;};'use strict';var _=require(_0x2eaa('0x0'));var attributes=require(_0x2eaa('0x1'));var qs=require(_0x2eaa('0x2'));module[_0x2eaa('0x3')]=function(_0x2b024f){var _0x2765de=_0x2b024f[_0x2eaa('0x4')];function _0x46b428(_0x1d2f39,_0x5e6331){return new Promise(function(_0x496f14,_0x5e1e95){if(!_0x5e6331)return _0x496f14(null);var _0x4f4004=_0x5e6331[_0x2eaa('0x5')]?{[_0x5e6331[_0x2eaa('0x5')][_0x2eaa('0x6')]]:_0x5e6331[_0x2eaa('0x5')][_0x2eaa('0x7')]}:undefined;return _0x2765de[_0x1d2f39][_0x2eaa('0x8')]({'where':_0x4f4004,'raw':!![]})[_0x2eaa('0x9')](function(_0xf4ae60){_0x5e6331[_0x2eaa('0xa')]=_[_0x2eaa('0xb')](_0xf4ae60,'id');_0x496f14(_0x5e6331);})['catch'](function(_0x1db493){_0x5e1e95(_0x1db493);});});}function _0x2f144e(_0x5db7be,_0x3bb800){return new Promise(function(_0x4a8010,_0x1a6576){var _0x43ba2a=_0x5db7be[_0x2eaa('0x5')]?{[_0x5db7be['filter'][_0x2eaa('0x6')]]:_0x5db7be[_0x2eaa('0x5')][_0x2eaa('0x7')]}:undefined;return _0x2765de[_0x5db7be[_0x2eaa('0xc')]][_0x2eaa('0x8')]({'where':_0x43ba2a,'raw':!![]})[_0x2eaa('0x9')](function(_0x13faca){_0x3bb800[_0x2eaa('0xa')]=_[_0x2eaa('0xb')](_0x13faca,function(_0x7dc4f2){return _0x7dc4f2[_0x2eaa('0xd')];});_0x4a8010(_0x3bb800);})[_0x2eaa('0xe')](function(_0x8cf07){_0x1a6576(_0x8cf07);});});}function _0x4191a8(_0x595c54,_0x8f67e7,_0x100adc){if(!_0x8f67e7)return resolve(null);return new Promise(function(_0x475b2f,_0x2c081f){return _0x2765de[_0x2eaa('0xf')][_0x2eaa('0x8')]({'where':{'sectionId':_0x8f67e7['id']},'raw':!![]})[_0x2eaa('0x9')](function(_0x58eb77){if(_0x595c54[_0x2eaa('0x6')]&&_0x595c54[_0x2eaa('0x6')]!=='id'){_0x8f67e7['associatedResources']=_[_0x2eaa('0xb')](_0x58eb77,function(_0x5b3a59){return _0x5b3a59[_0x595c54['field']];});}else{if(_0x100adc===_0x2eaa('0x10')){_0x8f67e7[_0x2eaa('0xa')]=_['map'](_0x58eb77,function(_0x3323a8){return{'id':_0x3323a8['resourceId'],'type':_0x3323a8[_0x2eaa('0x11')]};});}else{_0x8f67e7[_0x2eaa('0xa')]=_[_0x2eaa('0xb')](_0x58eb77,function(_0x4df638){return _0x4df638[_0x2eaa('0x12')];});}}_0x475b2f(_0x8f67e7);})[_0x2eaa('0xe')](function(_0x2e2e34){_0x2c081f(_0x2e2e34);});});}function _0x240c38(_0x25f616,_0x3e4cf0){var _0x3d96bd={'parentSections':[]};switch(_0x25f616[_0x2eaa('0x13')]()){case _0x2eaa('0x14'):_0x3d96bd[_0x2eaa('0x15')]=_0x2eaa('0x16');break;case _0x2eaa('0x17'):_0x3d96bd[_0x2eaa('0x15')]=_0x2eaa('0x18');break;case _0x2eaa('0x19'):_0x3d96bd[_0x2eaa('0x15')]=_0x2eaa('0x1a');_0x3d96bd[_0x2eaa('0x1b')]=[{'name':_0x2eaa('0x1c'),'field':_0x2eaa('0xd'),'foreignKey':_0x2eaa('0x1d')}];break;case'projects':_0x3d96bd[_0x2eaa('0x15')]=_0x2eaa('0x1e');break;case _0x2eaa('0x1f'):_0x3d96bd[_0x2eaa('0x15')]=_0x2eaa('0x20');_0x3d96bd[_0x2eaa('0x1b')]=[{'name':'Lists','field':'id','foreignKey':'ListId'}];break;case'lists':_0x3d96bd[_0x2eaa('0x15')]=_0x2eaa('0x21');break;case'companies':_0x3d96bd['childModel']=_0x2eaa('0x22');break;case _0x2eaa('0x23'):_0x3d96bd[_0x2eaa('0x15')]='CmCustomField';break;case _0x2eaa('0x24'):_0x3d96bd['childModel']='ChatQueue';break;case'chatwebsites':_0x3d96bd[_0x2eaa('0x15')]='ChatWebsite';break;case _0x2eaa('0x25'):_0x3d96bd['childModel']=_0x2eaa('0x26');break;case _0x2eaa('0x27'):_0x3d96bd[_0x2eaa('0x15')]=_0x2eaa('0x28');break;case _0x2eaa('0x29'):case _0x2eaa('0x2a'):case _0x2eaa('0x2b'):_0x3d96bd['childModel']=_0x2eaa('0x2c');break;case'contexts':_0x3d96bd['childModel']=_0x2eaa('0x2d');break;case'voicemails':_0x3d96bd[_0x2eaa('0x15')]=_0x2eaa('0x2e');break;case _0x2eaa('0x2f'):_0x3d96bd[_0x2eaa('0x15')]=_0x2eaa('0x30');_0x3d96bd[_0x2eaa('0x1b')]=[{'name':_0x2eaa('0x31'),'field':_0x2eaa('0xd'),'foreignKey':_0x2eaa('0x32'),'model':'User','filter':{'field':_0x2eaa('0x33'),'value':[_0x2eaa('0x34')]}},{'name':_0x2eaa('0x35'),'field':'name','foreignKey':_0x2eaa('0x32'),'model':_0x2eaa('0x36'),'filter':{'field':_0x2eaa('0x33'),'value':[_0x2eaa('0x37')]}},{'name':_0x2eaa('0x38'),'field':_0x2eaa('0xd'),'foreignKey':'queue','model':_0x2eaa('0x39'),'filter':{'field':_0x2eaa('0x11'),'value':[_0x2eaa('0x3a')]}},{'name':_0x2eaa('0x3b'),'field':'name','foreignKey':_0x2eaa('0x3c'),'model':_0x2eaa('0x39'),'filter':{'field':_0x2eaa('0x11'),'value':['outbound']}}];break;case _0x2eaa('0x3d'):_0x3d96bd[_0x2eaa('0x15')]=_0x2eaa('0x3e');break;case _0x2eaa('0x3f'):_0x3d96bd[_0x2eaa('0x15')]=_0x2eaa('0x40');break;case _0x2eaa('0x41'):_0x3d96bd['childModel']=_0x2eaa('0x42');break;case _0x2eaa('0x43'):_0x3d96bd[_0x2eaa('0x15')]=_0x2eaa('0x44');break;case _0x2eaa('0x45'):_0x3d96bd[_0x2eaa('0x15')]=_0x2eaa('0x46');break;case _0x2eaa('0x47'):_0x3d96bd['childModel']=_0x2eaa('0x48');break;case _0x2eaa('0x49'):_0x3d96bd[_0x2eaa('0x15')]=_0x2eaa('0x4a');break;case'openchannelqueues':_0x3d96bd[_0x2eaa('0x15')]=_0x2eaa('0x4b');break;case'openchannelaccounts':_0x3d96bd[_0x2eaa('0x15')]=_0x2eaa('0x4c');break;case _0x2eaa('0x4d'):_0x3d96bd[_0x2eaa('0x15')]=_0x2eaa('0x4e');break;case'smsaccounts':_0x3d96bd[_0x2eaa('0x15')]='SmsAccount';break;case'whatsappqueues':_0x3d96bd['childModel']=_0x2eaa('0x4f');break;case _0x2eaa('0x50'):_0x3d96bd[_0x2eaa('0x15')]=_0x2eaa('0x51');break;case'teams':_0x3d96bd['childModel']='Team';break;case _0x2eaa('0x52'):case _0x2eaa('0x53'):_0x3d96bd['childModel']=_0x2eaa('0x39');if(_0x3e4cf0){_0x3d96bd[_0x2eaa('0x1b')]=[{'name':'VoiceQueues'},{'name':_0x2eaa('0x3b')}];}break;case _0x2eaa('0x54'):case _0x2eaa('0x55'):case'telephones':_0x3d96bd[_0x2eaa('0x15')]=_0x2eaa('0x36');if(_0x3e4cf0){_0x3d96bd[_0x2eaa('0x1b')]=[{'name':_0x2eaa('0x56'),'filter':{'field':'role','value':[_0x2eaa('0x57'),_0x2eaa('0x58')]},'ignore':!![]},{'name':'Agents'},{'name':_0x2eaa('0x35')}];}break;case _0x2eaa('0x59'):_0x3d96bd['childModel']=_0x2eaa('0x5a');break;case _0x2eaa('0x5b'):_0x3d96bd[_0x2eaa('0x15')]=_0x2eaa('0x5c');break;case _0x2eaa('0x5d'):_0x3d96bd['childModel']=_0x2eaa('0x5e');break;case'sugarcrmaccounts':_0x3d96bd[_0x2eaa('0x15')]=_0x2eaa('0x5f');break;case _0x2eaa('0x60'):_0x3d96bd[_0x2eaa('0x15')]=_0x2eaa('0x61');break;case _0x2eaa('0x62'):_0x3d96bd[_0x2eaa('0x15')]=_0x2eaa('0x63');break;case'vtigeraccounts':_0x3d96bd['childModel']=_0x2eaa('0x36');break;case _0x2eaa('0x64'):_0x3d96bd['childModel']=_0x2eaa('0x65');break;case _0x2eaa('0x66'):_0x3d96bd[_0x2eaa('0x15')]='Disposition';break;case _0x2eaa('0x67'):_0x3d96bd[_0x2eaa('0x15')]=_0x2eaa('0x68');break;case'intervals':_0x3d96bd[_0x2eaa('0x15')]='Interval';break;case _0x2eaa('0x69'):_0x3d96bd['childModel']='Pause';break;case _0x2eaa('0x6a'):_0x3d96bd[_0x2eaa('0x15')]='Schedule';break;case _0x2eaa('0x6b'):_0x3d96bd[_0x2eaa('0x15')]=_0x2eaa('0x6c');break;case _0x2eaa('0x6d'):_0x3d96bd[_0x2eaa('0x15')]=_0x2eaa('0x6e');break;case'templates':_0x3d96bd['childModel']=_0x2eaa('0x6f');break;case _0x2eaa('0x70'):_0x3d96bd[_0x2eaa('0x15')]=_0x2eaa('0x71');break;case'trunks':_0x3d96bd[_0x2eaa('0x15')]=_0x2eaa('0x72');break;case _0x2eaa('0x73'):_0x3d96bd[_0x2eaa('0x15')]='Variable';break;case _0x2eaa('0x74'):_0x3d96bd[_0x2eaa('0x15')]=_0x2eaa('0x75');break;case'extractedreports':_0x3d96bd['childModel']=_0x2eaa('0x10');_0x3d96bd[_0x2eaa('0x1b')]=[{'name':_0x2eaa('0x76'),'field':'id','foreignKey':_0x2eaa('0x77')}];break;case _0x2eaa('0x78'):_0x3d96bd['childModel']=_0x2eaa('0x79');break;case _0x2eaa('0x50'):_0x3d96bd[_0x2eaa('0x15')]='WhatsappAccount';break;}return _0x3d96bd;}function _0x9acd7d(_0x3e516a,_0x5a4109){var _0x4ab861=_0x3e516a[_0x2eaa('0x7a')](0x0)[_0x2eaa('0x7b')]()+_0x3e516a['slice'](0x1);var _0x5ca1e9={'type':_0x2765de[_0x2eaa('0x7c')][_0x2eaa('0x7d')][_0x2eaa('0x7e')],'raw':!![]};return new BPromise(function(_0x45ee5f,_0x386b71){var _0x4209b9=squel['select']()[_0x2eaa('0x6')](_0x2eaa('0x7f')+_0x4ab861+_0x2eaa('0x80'),'id')['field']('ui.createdAt')['from'](_0x2eaa('0x81')+_0x3e516a+_0x2eaa('0x82'),'ui')[_0x2eaa('0x83')]('ui.UserId\x20=\x20?',_0x5a4109['id']);return _0x2765de[_0x2eaa('0x84')][_0x2eaa('0x85')](_0x4209b9[_0x2eaa('0x86')](),_0x5ca1e9)[_0x2eaa('0x9')](function(_0x530b70){_0x5a4109[_0x4ab861+_0x2eaa('0x87')]=_0x530b70;_0x45ee5f(_0x530b70);})[_0x2eaa('0xe')](function(_0x1f2f9a){_0x386b71(_0x1f2f9a);});});}return _0x2b024f[_0x2eaa('0x88')](_0x2eaa('0x89'),attributes,{'tableName':_0x2eaa('0x8a'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x281a35){var _0x3bd282={'raw':![],'where':{}};var _0x2142b5={};var _0x5847b5={'count':0x0,'rows':[]};var _0x291a36=_0x281a35['query'][_0x2eaa('0x8b')];var _0x2a1df4=_0x281a35[_0x2eaa('0x85')][_0x2eaa('0x8c')]||![];var _0x335667=_0x240c38(_0x291a36,_0x2a1df4);if(!_0x335667['childModel'])throw new Error(_0x2eaa('0x8d')+_0x291a36+'\x27');var _0x362dec=[{'name':_0x291a36}];if(!_[_0x2eaa('0x8e')](_0x335667[_0x2eaa('0x1b')]))_0x362dec=_0x335667[_0x2eaa('0x1b')];var _0x348fb9=[];for(var _0x578478=0x0;_0x578478<_0x362dec[_0x2eaa('0x8f')];_0x578478++){_0x348fb9[_0x2eaa('0x90')](_0x2765de[_0x2eaa('0x91')]['find']({'where':{'userProfileId':_0x281a35[_0x2eaa('0x92')]['id'],'name':_0x362dec[_0x578478][_0x2eaa('0xd')]},'raw':!![]}));}return Promise[_0x2eaa('0x93')](_0x348fb9)[_0x2eaa('0x9')](function(_0x1d4bcb){var _0x28c255=_[_0x2eaa('0x5')](_0x1d4bcb,function(_0x195744){return _0x195744?_0x195744:undefined;});var _0x331020=_[_0x2eaa('0x5')](_0x362dec,[_0x2eaa('0x94'),!![]]);var _0x114e9f=_[_0x2eaa('0x8e')](_0x28c255)&&_['isEmpty'](_0x331020)?null:_[_0x2eaa('0x95')](_0x331020,_0x28c255);if(!_0x114e9f)return null;var _0x1754d3=[];for(var _0x5a60f9=0x0;_0x5a60f9<_0x114e9f[_0x2eaa('0x8f')];_0x5a60f9++){var _0x2a489b=_[_0x2eaa('0x96')](_0x362dec,function(_0x130e27){return _0x114e9f[_0x5a60f9]?_0x130e27[_0x2eaa('0xd')]===_0x114e9f[_0x5a60f9][_0x2eaa('0xd')]:null;});if(_0x2a489b){if(_0x114e9f[_0x5a60f9][_0x2eaa('0x94')]){_0x1754d3[_0x2eaa('0x90')](_0x46b428(_0x335667[_0x2eaa('0x15')],_0x114e9f[_0x5a60f9]));}else{if(!_0x114e9f[_0x5a60f9][_0x2eaa('0x97')]){_0x1754d3[_0x2eaa('0x90')](_0x4191a8(_0x2a489b,_0x114e9f[_0x5a60f9],_0x335667[_0x2eaa('0x15')]));}else{if(_0x2a489b[_0x2eaa('0xc')]){_0x1754d3[_0x2eaa('0x90')](_0x2f144e(_0x2a489b,_0x114e9f[_0x5a60f9]));}}}}}return Promise['all'](_0x1754d3);})['then'](function(_0x4f4667){var _0xfe8364=_0x4f4667;var _0x1deba1=null;if(_0xfe8364){_0x1deba1=_0xfe8364[_0x2eaa('0x8f')]===0x1?_0xfe8364[0x0]:null;}if(!_0x1deba1&&!_0xfe8364)return _0x5847b5;var _0x4991a9=_0x2765de[_0x335667['childModel']][_0x2eaa('0x98')];_0x2142b5[_0x2eaa('0xc')]=_[_0x2eaa('0x99')](_0x4991a9);_0x2142b5['query']=_['keys'](_0x281a35[_0x2eaa('0x85')]);_0x2142b5[_0x2eaa('0x9a')]=_[_0x2eaa('0x9b')](_0x2142b5[_0x2eaa('0xc')],_0x2142b5[_0x2eaa('0x85')]);_0x3bd282[_0x2eaa('0x9c')]=_[_0x2eaa('0x9b')](_0x2142b5[_0x2eaa('0xc')],qs[_0x2eaa('0x9d')](_0x281a35[_0x2eaa('0x85')][_0x2eaa('0x9d')]));_0x3bd282[_0x2eaa('0x9c')]=_0x3bd282['attributes']['length']?_0x3bd282[_0x2eaa('0x9c')]:_0x2142b5[_0x2eaa('0xc')];if(!_0x281a35[_0x2eaa('0x85')][_0x2eaa('0x9e')](_0x2eaa('0x9f'))){_0x3bd282[_0x2eaa('0xa0')]=qs[_0x2eaa('0xa0')](_0x281a35['query'][_0x2eaa('0xa0')]);_0x3bd282['offset']=qs[_0x2eaa('0xa1')](_0x281a35[_0x2eaa('0x85')][_0x2eaa('0xa1')]);}_0x3bd282['order']=qs['sort'](_0x281a35[_0x2eaa('0x85')][_0x2eaa('0xa2')]);_0x3bd282['where']=qs[_0x2eaa('0x9a')](_[_0x2eaa('0xa3')](_0x281a35[_0x2eaa('0x85')],_0x2142b5[_0x2eaa('0x9a')]));if(_0x281a35[_0x2eaa('0x85')][_0x2eaa('0x5')]){_0x3bd282[_0x2eaa('0x83')]=_[_0x2eaa('0xa4')](_0x3bd282['where'],{'$or':_['map'](_0x4991a9,function(_0x41db2a){if(_0x41db2a['type'][_0x2eaa('0xa5')]!==_0x2eaa('0xa6')){var _0x56b72c={};_0x56b72c[_0x41db2a[_0x2eaa('0x6')]]={'$like':'%'+_0x281a35['query'][_0x2eaa('0x5')]+'%'};return _0x56b72c;}})});}var _0x557ff7=[];if(_0x1deba1){var _0x4d280a=_[_0x2eaa('0x96')](_0x362dec,[_0x2eaa('0xd'),_0x1deba1[_0x2eaa('0xd')]]);if(_0x4d280a[_0x2eaa('0x6')]){var _0x5d2122={};if(_0x335667[_0x2eaa('0x15')]==='AnalyticExtractedReport'){_0x5d2122[_0x4d280a[_0x2eaa('0xa7')]]=_['map'](_0x1deba1[_0x2eaa('0xa')],'id');}else{_0x5d2122[_0x4d280a['foreignKey']]=_0x1deba1[_0x2eaa('0xa')];}_0x557ff7['push'](_0x5d2122);}else{_0x3bd282['where']['id']=_0x1deba1['associatedResources'];}}else{for(var _0x610fad=0x0;_0x610fad<_0xfe8364[_0x2eaa('0x8f')];_0x610fad++){var _0x4d280a=_[_0x2eaa('0x96')](_0x362dec,[_0x2eaa('0xd'),_0xfe8364[_0x610fad][_0x2eaa('0xd')]]);if(_0x4d280a[_0x2eaa('0x6')]){var _0x5d2122={};_0x5d2122[_0x4d280a[_0x2eaa('0xa7')]]=_0xfe8364[_0x610fad][_0x2eaa('0xa')];_0x557ff7[_0x2eaa('0x90')](_0x5d2122);}else{if(!_0x3bd282[_0x2eaa('0x83')]['id'])_0x3bd282['where']['id']=[];_0xfe8364[_0x610fad][_0x2eaa('0xa')][_0x2eaa('0xa8')](function(_0x222013){_0x3bd282['where']['id']['push'](_0x222013);});}}}if(!_[_0x2eaa('0x8e')](_0x557ff7)){_0x3bd282[_0x2eaa('0x83')]=_['merge'](_0x3bd282[_0x2eaa('0x83')],{'$and':{'$or':_0x557ff7}});}_0x3bd282=_[_0x2eaa('0xa4')]({},_0x3bd282,_0x281a35[_0x2eaa('0xa9')]);if(_0x1deba1&&!_0x1deba1[_0x2eaa('0x97')]&&_0x335667[_0x2eaa('0x15')]===_0x2eaa('0x10')){if(_0x281a35[_0x2eaa('0x85')][_0x2eaa('0xaa')]){_0x3bd282[_0x2eaa('0xab')]=[{'all':!![]}];}return _0x2765de[_0x335667[_0x2eaa('0x15')]][_0x2eaa('0x8')](_0x3bd282)[_0x2eaa('0x9')](function(_0x51aad5){var _0x2ef1e2=[];_0x51aad5[_0x2eaa('0xa8')](function(_0x3773bb){var _0x36bcb0;switch(_0x3773bb[_0x2eaa('0xac')]){case _0x2eaa('0xad'):_0x36bcb0=_[_0x2eaa('0x96')](_0x1deba1[_0x2eaa('0xa')],function(_0x399ffc){return _0x399ffc['id']===_0x3773bb['reportId']&&_0x399ffc[_0x2eaa('0x11')]===_0x2eaa('0xae');});break;case _0x2eaa('0xaf'):_0x36bcb0=_[_0x2eaa('0x96')](_0x1deba1['associatedResources'],function(_0x1bc546){return _0x1bc546['id']===_0x3773bb[_0x2eaa('0x77')]&&_0x1bc546['type']===_0x2eaa('0xb0');});break;}if(_0x36bcb0)_0x2ef1e2[_0x2eaa('0x90')](_0x3773bb);});_0x5847b5[_0x2eaa('0xb1')]=_0x2ef1e2['length'];_0x5847b5[_0x2eaa('0xb2')]=_0x2ef1e2;return _0x5847b5;});}else{return _0x2765de[_0x335667[_0x2eaa('0x15')]][_0x2eaa('0xb1')]({'where':_0x3bd282[_0x2eaa('0x83')]})[_0x2eaa('0x9')](function(_0x20c044){_0x5847b5['count']=_0x20c044;if(_0x281a35[_0x2eaa('0x85')][_0x2eaa('0xaa')]){if(_0x335667['childModel']===_0x2eaa('0x20')){_0x3bd282[_0x2eaa('0xab')]=[{'model':_0x2765de[_0x2eaa('0x6e')],'as':'Tags','attributes':['id',_0x2eaa('0xd'),'color'],'required':_0x281a35['query']['tag']?!![]:![]},{'model':_0x2765de[_0x2eaa('0x6e')],'as':'ThroughTags','attributes':['id',_0x2eaa('0xd'),'color'],'through':_0x281a35['query']['tag']?{'attributes':[],'where':{'TagId':_0x281a35[_0x2eaa('0x85')]['tag']||undefined}}:{},'required':_0x281a35[_0x2eaa('0x85')][_0x2eaa('0xb3')]?!![]:![]}];}else{_0x3bd282[_0x2eaa('0xab')]=[{'all':!![]}];}}return _0x2765de[_0x335667[_0x2eaa('0x15')]][_0x2eaa('0x8')](_0x3bd282);})['then'](function(_0x1098fd){_0x5847b5[_0x2eaa('0xb2')]=_0x1098fd;if(_0x291a36===_0x2eaa('0x31')&&_0x281a35[_0x2eaa('0x85')][_0x2eaa('0xb4')]===_0x2eaa('0xb5')){var _0x2fe435=[];for(var _0x1ce5ff=0x0;_0x1ce5ff<_0x5847b5[_0x2eaa('0xb2')][_0x2eaa('0x8f')];_0x1ce5ff++){_0x2fe435['push'](_0x9acd7d(_0x2eaa('0xb6'),_0x5847b5[_0x2eaa('0xb2')][_0x1ce5ff][_0x2eaa('0xb7')]));_0x2fe435['push'](_0x9acd7d(_0x2eaa('0xb8'),_0x5847b5['rows'][_0x1ce5ff][_0x2eaa('0xb7')]));_0x2fe435[_0x2eaa('0x90')](_0x9acd7d('fax',_0x5847b5[_0x2eaa('0xb2')][_0x1ce5ff][_0x2eaa('0xb7')]));_0x2fe435['push'](_0x9acd7d(_0x2eaa('0xb9'),_0x5847b5[_0x2eaa('0xb2')][_0x1ce5ff][_0x2eaa('0xb7')]));_0x2fe435[_0x2eaa('0x90')](_0x9acd7d(_0x2eaa('0xba'),_0x5847b5[_0x2eaa('0xb2')][_0x1ce5ff][_0x2eaa('0xb7')]));_0x2fe435[_0x2eaa('0x90')](_0x9acd7d(_0x2eaa('0xbb'),_0x5847b5['rows'][_0x1ce5ff][_0x2eaa('0xb7')]));}return Promise[_0x2eaa('0x93')](_0x2fe435)['then'](function(){return _0x5847b5;});}return _0x5847b5;});}});}}});}; \ No newline at end of file +var _0x27d6=['Agents','User','role','membername','telephone','queue','VoiceQueue','inbound','type','outbound','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','SmsQueue','smsaccounts','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','VoiceQueues','QueueCampaigns','users','agents','telephones','Users','admin','user','Telephones','zendeskaccounts','ZendeskAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','Pause','scheduler','sounds','Sound','Template','triggers','Trigger','trunks','Variable','plugins','Plugin','extractedreports','AnalyticExtractedReport','Reports','reportId','metrics','AnalyticMetric','charAt','slice','Sequelize','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','from','user_has_','where','ui.UserId\x20=\x20?','sequelize','query','toString','define','user_profiles','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push','all','ignore','union','find','autoAssociation','rawAttributes','keys','filters','intersection','attributes','fields','nolimit','limit','offset','order','sort','key','VIRTUAL','foreignKey','forEach','merge','options','include','default','CustomReports','count','rows','Tag','Tags','color','tag','openTabs','true','chat','dataValues','sms','fax','mail','openchannel','lodash','./userProfile.attributes','models','filter','field','value','findAll','map','catch','model','then','associatedResources','name','UserProfileResource','resourceId','toLowerCase','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projectName','JscriptyProject','contacts','Lists','ListId','CmList','companies','CmCompany','CmCustomField','chatqueues','faxqueues','FaxQueue','faxaccounts','internalroutes','outboundroutes','VoiceExtension','contexts','voicemails','VoiceMail','voicerecordings'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0x27d6,0x14a));var _0x627d=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x27d6[_0x4fde08];return _0x12e725;};'use strict';var _=require(_0x627d('0x0'));var attributes=require(_0x627d('0x1'));var qs=require('../../components/parsers/qs');module['exports']=function(_0xe3eb8d){var _0x53e052=_0xe3eb8d[_0x627d('0x2')];function _0x2e0502(_0x18f700,_0x156ce2){return new Promise(function(_0x3b8d20,_0x3cf0ba){if(!_0x156ce2)return _0x3b8d20(null);var _0x2fbe1f=_0x156ce2['filter']?{[_0x156ce2[_0x627d('0x3')][_0x627d('0x4')]]:_0x156ce2[_0x627d('0x3')][_0x627d('0x5')]}:undefined;return _0x53e052[_0x18f700][_0x627d('0x6')]({'where':_0x2fbe1f,'raw':!![]})['then'](function(_0x86189a){_0x156ce2['associatedResources']=_[_0x627d('0x7')](_0x86189a,'id');_0x3b8d20(_0x156ce2);})[_0x627d('0x8')](function(_0xaeb82c){_0x3cf0ba(_0xaeb82c);});});}function _0x18ec16(_0x576235,_0x41a54b){return new Promise(function(_0x4d910f,_0x2f4b1c){var _0x37fc05=_0x576235[_0x627d('0x3')]?{[_0x576235[_0x627d('0x3')][_0x627d('0x4')]]:_0x576235[_0x627d('0x3')]['value']}:undefined;return _0x53e052[_0x576235[_0x627d('0x9')]][_0x627d('0x6')]({'where':_0x37fc05,'raw':!![]})[_0x627d('0xa')](function(_0x192481){_0x41a54b[_0x627d('0xb')]=_[_0x627d('0x7')](_0x192481,function(_0x90035a){return _0x90035a[_0x627d('0xc')];});_0x4d910f(_0x41a54b);})[_0x627d('0x8')](function(_0x1c6839){_0x2f4b1c(_0x1c6839);});});}function _0x3f6a1d(_0x3f8d48,_0x1dc9cc,_0x930cba){if(!_0x1dc9cc)return resolve(null);return new Promise(function(_0x4b2fc7,_0x18f12a){return _0x53e052[_0x627d('0xd')][_0x627d('0x6')]({'where':{'sectionId':_0x1dc9cc['id']},'raw':!![]})[_0x627d('0xa')](function(_0x34e889){if(_0x3f8d48[_0x627d('0x4')]&&_0x3f8d48[_0x627d('0x4')]!=='id'){_0x1dc9cc[_0x627d('0xb')]=_[_0x627d('0x7')](_0x34e889,function(_0x88303d){return _0x88303d[_0x3f8d48[_0x627d('0x4')]];});}else{if(_0x930cba==='AnalyticExtractedReport'){_0x1dc9cc[_0x627d('0xb')]=_['map'](_0x34e889,function(_0x117a0f){return{'id':_0x117a0f[_0x627d('0xe')],'type':_0x117a0f['type']};});}else{_0x1dc9cc['associatedResources']=_[_0x627d('0x7')](_0x34e889,function(_0x38d45a){return _0x38d45a[_0x627d('0xe')];});}}_0x4b2fc7(_0x1dc9cc);})[_0x627d('0x8')](function(_0x124be4){_0x18f12a(_0x124be4);});});}function _0x318fb7(_0x33cb2f,_0x369524){var _0x1aa4d3={'parentSections':[]};switch(_0x33cb2f[_0x627d('0xf')]()){case'squareprojects':_0x1aa4d3[_0x627d('0x10')]=_0x627d('0x11');break;case _0x627d('0x12'):_0x1aa4d3[_0x627d('0x10')]=_0x627d('0x13');break;case _0x627d('0x14'):_0x1aa4d3[_0x627d('0x10')]=_0x627d('0x15');_0x1aa4d3[_0x627d('0x16')]=[{'name':_0x627d('0x17'),'field':'name','foreignKey':_0x627d('0x18')}];break;case'projects':_0x1aa4d3[_0x627d('0x10')]=_0x627d('0x19');break;case _0x627d('0x1a'):_0x1aa4d3[_0x627d('0x10')]='CmContact';_0x1aa4d3[_0x627d('0x16')]=[{'name':_0x627d('0x1b'),'field':'id','foreignKey':_0x627d('0x1c')}];break;case'lists':_0x1aa4d3[_0x627d('0x10')]=_0x627d('0x1d');break;case _0x627d('0x1e'):_0x1aa4d3[_0x627d('0x10')]=_0x627d('0x1f');break;case'globalcustomfields':_0x1aa4d3[_0x627d('0x10')]=_0x627d('0x20');break;case _0x627d('0x21'):_0x1aa4d3[_0x627d('0x10')]='ChatQueue';break;case'chatwebsites':_0x1aa4d3[_0x627d('0x10')]='ChatWebsite';break;case _0x627d('0x22'):_0x1aa4d3[_0x627d('0x10')]=_0x627d('0x23');break;case _0x627d('0x24'):_0x1aa4d3[_0x627d('0x10')]='FaxAccount';break;case'inboundroutes':case _0x627d('0x25'):case _0x627d('0x26'):_0x1aa4d3[_0x627d('0x10')]=_0x627d('0x27');break;case _0x627d('0x28'):_0x1aa4d3[_0x627d('0x10')]='VoiceContext';break;case _0x627d('0x29'):_0x1aa4d3[_0x627d('0x10')]=_0x627d('0x2a');break;case _0x627d('0x2b'):_0x1aa4d3[_0x627d('0x10')]='VoiceRecording';_0x1aa4d3[_0x627d('0x16')]=[{'name':_0x627d('0x2c'),'field':_0x627d('0xc'),'foreignKey':'membername','model':_0x627d('0x2d'),'filter':{'field':_0x627d('0x2e'),'value':['agent']}},{'name':'Telephones','field':_0x627d('0xc'),'foreignKey':_0x627d('0x2f'),'model':_0x627d('0x2d'),'filter':{'field':'role','value':[_0x627d('0x30')]}},{'name':'VoiceQueues','field':'name','foreignKey':_0x627d('0x31'),'model':_0x627d('0x32'),'filter':{'field':'type','value':[_0x627d('0x33')]}},{'name':'QueueCampaigns','field':'name','foreignKey':_0x627d('0x31'),'model':_0x627d('0x32'),'filter':{'field':_0x627d('0x34'),'value':[_0x627d('0x35')]}}];break;case'musiconholds':_0x1aa4d3[_0x627d('0x10')]=_0x627d('0x36');break;case _0x627d('0x37'):_0x1aa4d3['childModel']=_0x627d('0x38');break;case _0x627d('0x39'):_0x1aa4d3[_0x627d('0x10')]=_0x627d('0x3a');break;case'ivrcampaigns':_0x1aa4d3[_0x627d('0x10')]=_0x627d('0x3b');break;case _0x627d('0x3c'):_0x1aa4d3[_0x627d('0x10')]=_0x627d('0x3d');break;case _0x627d('0x3e'):_0x1aa4d3[_0x627d('0x10')]=_0x627d('0x3f');break;case _0x627d('0x40'):_0x1aa4d3[_0x627d('0x10')]=_0x627d('0x41');break;case _0x627d('0x42'):_0x1aa4d3[_0x627d('0x10')]=_0x627d('0x43');break;case _0x627d('0x44'):_0x1aa4d3['childModel']=_0x627d('0x45');break;case'smsqueues':_0x1aa4d3[_0x627d('0x10')]=_0x627d('0x46');break;case _0x627d('0x47'):_0x1aa4d3[_0x627d('0x10')]='SmsAccount';break;case _0x627d('0x48'):_0x1aa4d3[_0x627d('0x10')]=_0x627d('0x49');break;case _0x627d('0x4a'):_0x1aa4d3['childModel']=_0x627d('0x4b');break;case _0x627d('0x4c'):_0x1aa4d3[_0x627d('0x10')]=_0x627d('0x4d');break;case _0x627d('0x4e'):case _0x627d('0x4f'):_0x1aa4d3[_0x627d('0x10')]=_0x627d('0x32');if(_0x369524){_0x1aa4d3[_0x627d('0x16')]=[{'name':_0x627d('0x50')},{'name':_0x627d('0x51')}];}break;case _0x627d('0x52'):case _0x627d('0x53'):case _0x627d('0x54'):_0x1aa4d3[_0x627d('0x10')]=_0x627d('0x2d');if(_0x369524){_0x1aa4d3['parentSections']=[{'name':_0x627d('0x55'),'filter':{'field':_0x627d('0x2e'),'value':[_0x627d('0x56'),_0x627d('0x57')]},'ignore':!![]},{'name':'Agents'},{'name':_0x627d('0x58')}];}break;case _0x627d('0x59'):_0x1aa4d3[_0x627d('0x10')]=_0x627d('0x5a');break;case'salesforceaccounts':_0x1aa4d3[_0x627d('0x10')]='SalesforceAccount';break;case _0x627d('0x5b'):_0x1aa4d3[_0x627d('0x10')]=_0x627d('0x5c');break;case _0x627d('0x5d'):_0x1aa4d3[_0x627d('0x10')]=_0x627d('0x5e');break;case _0x627d('0x5f'):_0x1aa4d3[_0x627d('0x10')]=_0x627d('0x60');break;case'zohoaccounts':_0x1aa4d3[_0x627d('0x10')]=_0x627d('0x61');break;case _0x627d('0x62'):_0x1aa4d3['childModel']=_0x627d('0x2d');break;case _0x627d('0x63'):_0x1aa4d3['childModel']=_0x627d('0x64');break;case'dispositions':_0x1aa4d3[_0x627d('0x10')]=_0x627d('0x65');break;case _0x627d('0x66'):_0x1aa4d3[_0x627d('0x10')]=_0x627d('0x67');break;case _0x627d('0x68'):_0x1aa4d3[_0x627d('0x10')]=_0x627d('0x69');break;case _0x627d('0x6a'):_0x1aa4d3[_0x627d('0x10')]=_0x627d('0x6b');break;case _0x627d('0x6c'):_0x1aa4d3[_0x627d('0x10')]='Schedule';break;case _0x627d('0x6d'):_0x1aa4d3[_0x627d('0x10')]=_0x627d('0x6e');break;case'tags':_0x1aa4d3['childModel']='Tag';break;case'templates':_0x1aa4d3['childModel']=_0x627d('0x6f');break;case _0x627d('0x70'):_0x1aa4d3['childModel']=_0x627d('0x71');break;case _0x627d('0x72'):_0x1aa4d3[_0x627d('0x10')]='Trunk';break;case'variables':_0x1aa4d3[_0x627d('0x10')]=_0x627d('0x73');break;case _0x627d('0x74'):_0x1aa4d3[_0x627d('0x10')]=_0x627d('0x75');break;case _0x627d('0x76'):_0x1aa4d3[_0x627d('0x10')]=_0x627d('0x77');_0x1aa4d3[_0x627d('0x16')]=[{'name':_0x627d('0x78'),'field':'id','foreignKey':_0x627d('0x79')}];break;case _0x627d('0x7a'):_0x1aa4d3[_0x627d('0x10')]=_0x627d('0x7b');break;case _0x627d('0x4a'):_0x1aa4d3[_0x627d('0x10')]=_0x627d('0x4b');break;}return _0x1aa4d3;}function _0xe1f66f(_0xe6948d,_0x495976){var _0x591913=_0xe6948d[_0x627d('0x7c')](0x0)['toUpperCase']()+_0xe6948d[_0x627d('0x7d')](0x1);var _0x2d212c={'type':_0x53e052[_0x627d('0x7e')][_0x627d('0x7f')][_0x627d('0x80')],'raw':!![]};return new BPromise(function(_0x3d7e0e,_0x2f5cba){var _0x1d7120=squel[_0x627d('0x81')]()[_0x627d('0x4')](_0x627d('0x82')+_0x591913+_0x627d('0x83'),'id')['field'](_0x627d('0x84'))[_0x627d('0x85')](_0x627d('0x86')+_0xe6948d+'_interactions','ui')[_0x627d('0x87')](_0x627d('0x88'),_0x495976['id']);return _0x53e052[_0x627d('0x89')][_0x627d('0x8a')](_0x1d7120[_0x627d('0x8b')](),_0x2d212c)[_0x627d('0xa')](function(_0x31709a){_0x495976[_0x591913+'OpenTabs']=_0x31709a;_0x3d7e0e(_0x31709a);})[_0x627d('0x8')](function(_0x46b6dc){_0x2f5cba(_0x46b6dc);});});}return _0xe3eb8d[_0x627d('0x8c')]('UserProfile',attributes,{'tableName':_0x627d('0x8d'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x2c66f9){var _0x468dd6={'raw':![],'where':{}};var _0x1b6deb={};var _0x3900a1={'count':0x0,'rows':[]};var _0x198967=_0x2c66f9['query'][_0x627d('0x8e')];var _0x165288=_0x2c66f9[_0x627d('0x8a')][_0x627d('0x8f')]||![];var _0x4d495d=_0x318fb7(_0x198967,_0x165288);if(!_0x4d495d[_0x627d('0x10')])throw new Error(_0x627d('0x90')+_0x198967+'\x27');var _0x18b36a=[{'name':_0x198967}];if(!_[_0x627d('0x91')](_0x4d495d[_0x627d('0x16')]))_0x18b36a=_0x4d495d[_0x627d('0x16')];var _0xb6796e=[];for(var _0x3fdc37=0x0;_0x3fdc37<_0x18b36a[_0x627d('0x92')];_0x3fdc37++){_0xb6796e[_0x627d('0x93')](_0x53e052['UserProfileSection']['find']({'where':{'userProfileId':_0x2c66f9['params']['id'],'name':_0x18b36a[_0x3fdc37][_0x627d('0xc')]},'raw':!![]}));}return Promise[_0x627d('0x94')](_0xb6796e)['then'](function(_0x1fda2d){var _0x58d5ff=_[_0x627d('0x3')](_0x1fda2d,function(_0x238f0e){return _0x238f0e?_0x238f0e:undefined;});var _0x28f612=_[_0x627d('0x3')](_0x18b36a,[_0x627d('0x95'),!![]]);var _0x597d96=_[_0x627d('0x91')](_0x58d5ff)&&_[_0x627d('0x91')](_0x28f612)?null:_[_0x627d('0x96')](_0x28f612,_0x58d5ff);if(!_0x597d96)return null;var _0x407797=[];for(var _0x27bf2f=0x0;_0x27bf2f<_0x597d96[_0x627d('0x92')];_0x27bf2f++){var _0x5d3b52=_[_0x627d('0x97')](_0x18b36a,function(_0x28916e){return _0x597d96[_0x27bf2f]?_0x28916e[_0x627d('0xc')]===_0x597d96[_0x27bf2f][_0x627d('0xc')]:null;});if(_0x5d3b52){if(_0x597d96[_0x27bf2f][_0x627d('0x95')]){_0x407797[_0x627d('0x93')](_0x2e0502(_0x4d495d['childModel'],_0x597d96[_0x27bf2f]));}else{if(!_0x597d96[_0x27bf2f][_0x627d('0x98')]){_0x407797[_0x627d('0x93')](_0x3f6a1d(_0x5d3b52,_0x597d96[_0x27bf2f],_0x4d495d[_0x627d('0x10')]));}else{if(_0x5d3b52['model']){_0x407797[_0x627d('0x93')](_0x18ec16(_0x5d3b52,_0x597d96[_0x27bf2f]));}}}}}return Promise['all'](_0x407797);})[_0x627d('0xa')](function(_0xf43efb){var _0x50cca2=_0xf43efb;var _0x4666a8=null;if(_0x50cca2){_0x4666a8=_0x50cca2[_0x627d('0x92')]===0x1?_0x50cca2[0x0]:null;}if(!_0x4666a8&&!_0x50cca2)return _0x3900a1;var _0x14e19d=_0x53e052[_0x4d495d['childModel']][_0x627d('0x99')];_0x1b6deb['model']=_['keys'](_0x14e19d);_0x1b6deb[_0x627d('0x8a')]=_[_0x627d('0x9a')](_0x2c66f9[_0x627d('0x8a')]);_0x1b6deb[_0x627d('0x9b')]=_[_0x627d('0x9c')](_0x1b6deb['model'],_0x1b6deb['query']);_0x468dd6[_0x627d('0x9d')]=_[_0x627d('0x9c')](_0x1b6deb['model'],qs['fields'](_0x2c66f9[_0x627d('0x8a')][_0x627d('0x9e')]));_0x468dd6[_0x627d('0x9d')]=_0x468dd6[_0x627d('0x9d')][_0x627d('0x92')]?_0x468dd6[_0x627d('0x9d')]:_0x1b6deb['model'];if(!_0x2c66f9[_0x627d('0x8a')]['hasOwnProperty'](_0x627d('0x9f'))){_0x468dd6['limit']=qs[_0x627d('0xa0')](_0x2c66f9[_0x627d('0x8a')][_0x627d('0xa0')]);_0x468dd6['offset']=qs['offset'](_0x2c66f9['query'][_0x627d('0xa1')]);}_0x468dd6[_0x627d('0xa2')]=qs[_0x627d('0xa3')](_0x2c66f9['query'][_0x627d('0xa3')]);_0x468dd6[_0x627d('0x87')]=qs[_0x627d('0x9b')](_['pick'](_0x2c66f9[_0x627d('0x8a')],_0x1b6deb[_0x627d('0x9b')]));if(_0x2c66f9[_0x627d('0x8a')][_0x627d('0x3')]){_0x468dd6[_0x627d('0x87')]=_['merge'](_0x468dd6[_0x627d('0x87')],{'$or':_[_0x627d('0x7')](_0x14e19d,function(_0x556bbc){if(_0x556bbc[_0x627d('0x34')][_0x627d('0xa4')]!==_0x627d('0xa5')){var _0x5df7c6={};_0x5df7c6[_0x556bbc[_0x627d('0x4')]]={'$like':'%'+_0x2c66f9[_0x627d('0x8a')][_0x627d('0x3')]+'%'};return _0x5df7c6;}})});}var _0x470d4d=[];if(_0x4666a8){var _0x3c37cc=_['find'](_0x18b36a,[_0x627d('0xc'),_0x4666a8[_0x627d('0xc')]]);if(_0x3c37cc[_0x627d('0x4')]){var _0x35c7c3={};if(_0x4d495d[_0x627d('0x10')]===_0x627d('0x77')){_0x35c7c3[_0x3c37cc[_0x627d('0xa6')]]=_['map'](_0x4666a8['associatedResources'],'id');}else{_0x35c7c3[_0x3c37cc[_0x627d('0xa6')]]=_0x4666a8[_0x627d('0xb')];}_0x470d4d['push'](_0x35c7c3);}else{_0x468dd6[_0x627d('0x87')]['id']=_0x4666a8['associatedResources'];}}else{for(var _0x4913f9=0x0;_0x4913f9<_0x50cca2[_0x627d('0x92')];_0x4913f9++){var _0x3c37cc=_[_0x627d('0x97')](_0x18b36a,[_0x627d('0xc'),_0x50cca2[_0x4913f9][_0x627d('0xc')]]);if(_0x3c37cc[_0x627d('0x4')]){var _0x35c7c3={};_0x35c7c3[_0x3c37cc[_0x627d('0xa6')]]=_0x50cca2[_0x4913f9][_0x627d('0xb')];_0x470d4d[_0x627d('0x93')](_0x35c7c3);}else{if(!_0x468dd6['where']['id'])_0x468dd6['where']['id']=[];_0x50cca2[_0x4913f9][_0x627d('0xb')][_0x627d('0xa7')](function(_0x9682ef){_0x468dd6[_0x627d('0x87')]['id']['push'](_0x9682ef);});}}}if(!_[_0x627d('0x91')](_0x470d4d)){_0x468dd6[_0x627d('0x87')]=_[_0x627d('0xa8')](_0x468dd6[_0x627d('0x87')],{'$and':{'$or':_0x470d4d}});}_0x468dd6=_[_0x627d('0xa8')]({},_0x468dd6,_0x2c66f9[_0x627d('0xa9')]);if(_0x4666a8&&!_0x4666a8[_0x627d('0x98')]&&_0x4d495d[_0x627d('0x10')]===_0x627d('0x77')){if(_0x2c66f9['query']['includeAll']){_0x468dd6[_0x627d('0xaa')]=[{'all':!![]}];}return _0x53e052[_0x4d495d[_0x627d('0x10')]]['findAll'](_0x468dd6)[_0x627d('0xa')](function(_0x3e0e9a){var _0x75c442=[];_0x3e0e9a[_0x627d('0xa7')](function(_0x510f38){var _0x4856d0;switch(_0x510f38['reportType']){case _0x627d('0xab'):_0x4856d0=_[_0x627d('0x97')](_0x4666a8['associatedResources'],function(_0x5c94f2){return _0x5c94f2['id']===_0x510f38[_0x627d('0x79')]&&_0x5c94f2['type']==='DefaultReports';});break;case'custom':_0x4856d0=_[_0x627d('0x97')](_0x4666a8[_0x627d('0xb')],function(_0x1e88ec){return _0x1e88ec['id']===_0x510f38[_0x627d('0x79')]&&_0x1e88ec[_0x627d('0x34')]===_0x627d('0xac');});break;}if(_0x4856d0)_0x75c442[_0x627d('0x93')](_0x510f38);});_0x3900a1[_0x627d('0xad')]=_0x75c442[_0x627d('0x92')];_0x3900a1[_0x627d('0xae')]=_0x75c442;return _0x3900a1;});}else{return _0x53e052[_0x4d495d[_0x627d('0x10')]][_0x627d('0xad')]({'where':_0x468dd6[_0x627d('0x87')]})['then'](function(_0xc8707d){_0x3900a1[_0x627d('0xad')]=_0xc8707d;if(_0x2c66f9['query']['includeAll']){if(_0x4d495d['childModel']==='CmContact'){_0x468dd6[_0x627d('0xaa')]=[{'model':_0x53e052[_0x627d('0xaf')],'as':_0x627d('0xb0'),'attributes':['id',_0x627d('0xc'),_0x627d('0xb1')],'required':_0x2c66f9[_0x627d('0x8a')][_0x627d('0xb2')]?!![]:![]},{'model':_0x53e052[_0x627d('0xaf')],'as':'ThroughTags','attributes':['id',_0x627d('0xc'),_0x627d('0xb1')],'through':_0x2c66f9['query'][_0x627d('0xb2')]?{'attributes':[],'where':{'TagId':_0x2c66f9['query'][_0x627d('0xb2')]||undefined}}:{},'required':_0x2c66f9[_0x627d('0x8a')][_0x627d('0xb2')]?!![]:![]}];}else{_0x468dd6[_0x627d('0xaa')]=[{'all':!![]}];}}return _0x53e052[_0x4d495d['childModel']][_0x627d('0x6')](_0x468dd6);})[_0x627d('0xa')](function(_0x4c2aef){_0x3900a1[_0x627d('0xae')]=_0x4c2aef;if(_0x198967===_0x627d('0x2c')&&_0x2c66f9[_0x627d('0x8a')][_0x627d('0xb3')]===_0x627d('0xb4')){var _0x1df45f=[];for(var _0x4abbf5=0x0;_0x4abbf5<_0x3900a1[_0x627d('0xae')]['length'];_0x4abbf5++){_0x1df45f[_0x627d('0x93')](_0xe1f66f(_0x627d('0xb5'),_0x3900a1[_0x627d('0xae')][_0x4abbf5][_0x627d('0xb6')]));_0x1df45f[_0x627d('0x93')](_0xe1f66f(_0x627d('0xb7'),_0x3900a1[_0x627d('0xae')][_0x4abbf5][_0x627d('0xb6')]));_0x1df45f['push'](_0xe1f66f(_0x627d('0xb8'),_0x3900a1[_0x627d('0xae')][_0x4abbf5][_0x627d('0xb6')]));_0x1df45f['push'](_0xe1f66f(_0x627d('0xb9'),_0x3900a1[_0x627d('0xae')][_0x4abbf5][_0x627d('0xb6')]));_0x1df45f[_0x627d('0x93')](_0xe1f66f(_0x627d('0xba'),_0x3900a1[_0x627d('0xae')][_0x4abbf5][_0x627d('0xb6')]));_0x1df45f[_0x627d('0x93')](_0xe1f66f('whatsapp',_0x3900a1['rows'][_0x4abbf5][_0x627d('0xb6')]));}return Promise['all'](_0x1df45f)[_0x627d('0xa')](function(){return _0x3900a1;});}return _0x3900a1;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 225da0c..eb10ec1 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 _0xb0e5=['bluebird','randomstring','../../config/utils','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./userProfile.socket','register','then','info','request\x20sent','stringify','error','code','UserProfile,\x20%s,\x20%s','message','result','lodash','util','moment'];(function(_0x5b8fd1,_0x2d730c){var _0xb6d424=function(_0x179681){while(--_0x179681){_0x5b8fd1['push'](_0x5b8fd1['shift']());}};_0xb6d424(++_0x2d730c);}(_0xb0e5,0x1ad));var _0x5b0e=function(_0x3a58aa,_0x583fcb){_0x3a58aa=_0x3a58aa-0x0;var _0x4d102b=_0xb0e5[_0x3a58aa];return _0x4d102b;};'use strict';var _=require(_0x5b0e('0x0'));var util=require(_0x5b0e('0x1'));var moment=require(_0x5b0e('0x2'));var BPromise=require(_0x5b0e('0x3'));var rs=require(_0x5b0e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5b0e('0x5'));var logger=require('../../config/logger')(_0x5b0e('0x6'));var config=require('../../config/environment');var jayson=require(_0x5b0e('0x7'));var client=jayson[_0x5b0e('0x8')]['http']({'port':0x232a});config['redis']=_[_0x5b0e('0x9')](config[_0x5b0e('0xa')],{'host':_0x5b0e('0xb'),'port':0x18eb});var socket=require(_0x5b0e('0xc'))(new Redis(config[_0x5b0e('0xa')]));require(_0x5b0e('0xd'))[_0x5b0e('0xe')](socket);function respondWithRpcPromise(_0x49b223,_0x72d6c1,_0x4fcc26){return new BPromise(function(_0x178987,_0x5cc90d){return client['request'](_0x49b223,_0x4fcc26)[_0x5b0e('0xf')](function(_0x7bd16){logger[_0x5b0e('0x10')]('UserProfile,\x20%s,\x20%s',_0x72d6c1,_0x5b0e('0x11'));logger['debug']('UserProfile,\x20%s,\x20%s,\x20%s',_0x72d6c1,_0x5b0e('0x11'),JSON[_0x5b0e('0x12')](_0x7bd16));if(_0x7bd16[_0x5b0e('0x13')]){if(_0x7bd16[_0x5b0e('0x13')][_0x5b0e('0x14')]===0x1f4){logger[_0x5b0e('0x13')](_0x5b0e('0x15'),_0x72d6c1,_0x7bd16[_0x5b0e('0x13')][_0x5b0e('0x16')]);return _0x5cc90d(_0x7bd16[_0x5b0e('0x13')][_0x5b0e('0x16')]);}logger[_0x5b0e('0x13')](_0x5b0e('0x15'),_0x72d6c1,_0x7bd16[_0x5b0e('0x13')][_0x5b0e('0x16')]);return _0x178987(_0x7bd16[_0x5b0e('0x13')][_0x5b0e('0x16')]);}else{logger[_0x5b0e('0x10')](_0x5b0e('0x15'),_0x72d6c1,_0x5b0e('0x11'));_0x178987(_0x7bd16[_0x5b0e('0x17')][_0x5b0e('0x16')]);}})['catch'](function(_0x4e2964){logger[_0x5b0e('0x13')](_0x5b0e('0x15'),_0x72d6c1,_0x4e2964);_0x5cc90d(_0x4e2964);});});} \ No newline at end of file +var _0x6eec=['./userProfile.socket','request','info','UserProfile,\x20%s,\x20%s','debug','UserProfile,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x5679a4,_0x1f420b){var _0x397109=function(_0x567730){while(--_0x567730){_0x5679a4['push'](_0x5679a4['shift']());}};_0x397109(++_0x1f420b);}(_0x6eec,0x1e0));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(_0xc6ee('0x2'));var BPromise=require(_0xc6ee('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc6ee('0x4'));var db=require(_0xc6ee('0x5'))['db'];var utils=require('../../config/utils');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('socket.io-emitter')(new Redis(config[_0xc6ee('0xc')]));require(_0xc6ee('0xe'))['register'](socket);function respondWithRpcPromise(_0x10a743,_0x5f57ec,_0x294274){return new BPromise(function(_0x2e999c,_0x405ce3){return client[_0xc6ee('0xf')](_0x10a743,_0x294274)['then'](function(_0x122a94){logger[_0xc6ee('0x10')](_0xc6ee('0x11'),_0x5f57ec,'request\x20sent');logger[_0xc6ee('0x12')](_0xc6ee('0x13'),_0x5f57ec,_0xc6ee('0x14'),JSON['stringify'](_0x122a94));if(_0x122a94[_0xc6ee('0x15')]){if(_0x122a94[_0xc6ee('0x15')][_0xc6ee('0x16')]===0x1f4){logger['error'](_0xc6ee('0x11'),_0x5f57ec,_0x122a94[_0xc6ee('0x15')][_0xc6ee('0x17')]);return _0x405ce3(_0x122a94['error'][_0xc6ee('0x17')]);}logger[_0xc6ee('0x15')](_0xc6ee('0x11'),_0x5f57ec,_0x122a94[_0xc6ee('0x15')][_0xc6ee('0x17')]);return _0x2e999c(_0x122a94[_0xc6ee('0x15')][_0xc6ee('0x17')]);}else{logger[_0xc6ee('0x10')](_0xc6ee('0x11'),_0x5f57ec,_0xc6ee('0x14'));_0x2e999c(_0x122a94[_0xc6ee('0x18')][_0xc6ee('0x17')]);}})[_0xc6ee('0x19')](function(_0xee8280){logger[_0xc6ee('0x15')](_0xc6ee('0x11'),_0x5f57ec,_0xee8280);_0x405ce3(_0xee8280);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 555e577..70f5587 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 _0xaec9=['userProfile:','./userProfile.events','save','update','emit','removeListener'];(function(_0x202e4c,_0x58bb11){var _0x3fd843=function(_0x306f55){while(--_0x306f55){_0x202e4c['push'](_0x202e4c['shift']());}};_0x3fd843(++_0x58bb11);}(_0xaec9,0x1e1));var _0x9aec=function(_0x1d4449,_0x495153){_0x1d4449=_0x1d4449-0x0;var _0x4dcde3=_0xaec9[_0x1d4449];return _0x4dcde3;};'use strict';var UserProfileEvents=require(_0x9aec('0x0'));var events=[_0x9aec('0x1'),'remove',_0x9aec('0x2')];function createListener(_0x3b98e2,_0x258daf){return function(_0x120422){_0x258daf[_0x9aec('0x3')](_0x3b98e2,_0x120422);};}function removeListener(_0x4b9ef4,_0x531013){return function(){UserProfileEvents[_0x9aec('0x4')](_0x4b9ef4,_0x531013);};}exports['register']=function(_0x440b62){for(var _0x2d338f=0x0,_0x3a9970=events['length'];_0x2d338f<_0x3a9970;_0x2d338f++){var _0x142f63=events[_0x2d338f];var _0x2a6f39=createListener(_0x9aec('0x5')+_0x142f63,_0x440b62);UserProfileEvents['on'](_0x142f63,_0x2a6f39);}}; \ No newline at end of file +var _0x097b=['emit','removeListener','register','length','userProfile:','save','remove','update'];(function(_0xbb8432,_0x3b9a00){var _0x5a1594=function(_0x3c9097){while(--_0x3c9097){_0xbb8432['push'](_0xbb8432['shift']());}};_0x5a1594(++_0x3b9a00);}(_0x097b,0x1cd));var _0xb097=function(_0x5ea416,_0x50ddcb){_0x5ea416=_0x5ea416-0x0;var _0x155582=_0x097b[_0x5ea416];return _0x155582;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0xb097('0x0'),_0xb097('0x1'),_0xb097('0x2')];function createListener(_0x3715a9,_0x3e0d13){return function(_0x465040){_0x3e0d13[_0xb097('0x3')](_0x3715a9,_0x465040);};}function removeListener(_0x420fa0,_0x5daa61){return function(){UserProfileEvents[_0xb097('0x4')](_0x420fa0,_0x5daa61);};}exports[_0xb097('0x5')]=function(_0x2f08d5){for(var _0x2735ee=0x0,_0x104c70=events[_0xb097('0x6')];_0x2735ee<_0x104c70;_0x2735ee++){var _0x1fabf3=events[_0x2735ee];var _0x46cfa0=createListener(_0xb097('0x7')+_0x1fabf3,_0x2f08d5);UserProfileEvents['on'](_0x1fabf3,_0x46cfa0);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index adba5c5..ec3adfc 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 _0xecfe=['show','create','delete','destroy','exports','multer','path','fs-extra','../../components/auth/service','../../components/interaction/service','./userProfileResource.controller','get','isAuthenticated','index','/describe','/:id'];(function(_0x202fef,_0x5022b9){var _0x5b7480=function(_0x915a1d){while(--_0x915a1d){_0x202fef['push'](_0x202fef['shift']());}};_0x5b7480(++_0x5022b9);}(_0xecfe,0x75));var _0xeecf=function(_0x4aa4e6,_0x278c45){_0x4aa4e6=_0x4aa4e6-0x0;var _0x322588=_0xecfe[_0x4aa4e6];return _0x322588;};'use strict';var multer=require(_0xeecf('0x0'));var util=require('util');var path=require(_0xeecf('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xeecf('0x2'));var auth=require(_0xeecf('0x3'));var interaction=require(_0xeecf('0x4'));var config=require('../../config/environment');var controller=require(_0xeecf('0x5'));router[_0xeecf('0x6')]('/',auth[_0xeecf('0x7')](),controller[_0xeecf('0x8')]);router[_0xeecf('0x6')](_0xeecf('0x9'),auth[_0xeecf('0x7')](),controller['describe']);router[_0xeecf('0x6')](_0xeecf('0xa'),auth[_0xeecf('0x7')](),controller[_0xeecf('0xb')]);router['post']('/',auth[_0xeecf('0x7')](),controller[_0xeecf('0xc')]);router['put'](_0xeecf('0xa'),auth[_0xeecf('0x7')](),controller['update']);router[_0xeecf('0xd')]('/:id',auth[_0xeecf('0x7')](),controller[_0xeecf('0xe')]);module[_0xeecf('0xf')]=router; \ No newline at end of file +var _0xebaa=['index','/describe','show','create','put','/:id','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./userProfileResource.controller','get','isAuthenticated'];(function(_0x304081,_0x195e9c){var _0x5ed61a=function(_0x1d1796){while(--_0x1d1796){_0x304081['push'](_0x304081['shift']());}};_0x5ed61a(++_0x195e9c);}(_0xebaa,0x17e));var _0xaeba=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xebaa[_0x27af45];return _0x18df21;};'use strict';var multer=require('multer');var util=require(_0xaeba('0x0'));var path=require('path');var timeout=require(_0xaeba('0x1'));var express=require('express');var router=express[_0xaeba('0x2')]();var fs_extra=require(_0xaeba('0x3'));var auth=require(_0xaeba('0x4'));var interaction=require(_0xaeba('0x5'));var config=require('../../config/environment');var controller=require(_0xaeba('0x6'));router[_0xaeba('0x7')]('/',auth[_0xaeba('0x8')](),controller[_0xaeba('0x9')]);router['get'](_0xaeba('0xa'),auth[_0xaeba('0x8')](),controller['describe']);router[_0xaeba('0x7')]('/:id',auth[_0xaeba('0x8')](),controller[_0xaeba('0xb')]);router['post']('/',auth[_0xaeba('0x8')](),controller[_0xaeba('0xc')]);router[_0xaeba('0xd')]('/:id',auth[_0xaeba('0x8')](),controller['update']);router['delete'](_0xaeba('0xe'),auth['isAuthenticated'](),controller[_0xaeba('0xf')]);module[_0xaeba('0x10')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 3500328..3f5d563 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 _0x19a3=['sequelize','exports','STRING'];(function(_0x3fec05,_0x39c6a3){var _0x3ae591=function(_0x3a3fee){while(--_0x3a3fee){_0x3fec05['push'](_0x3fec05['shift']());}};_0x3ae591(++_0x39c6a3);}(_0x19a3,0x96));var _0x319a=function(_0x180be1,_0x24f158){_0x180be1=_0x180be1-0x0;var _0x323cb8=_0x19a3[_0x180be1];return _0x323cb8;};'use strict';var Sequelize=require(_0x319a('0x0'));module[_0x319a('0x1')]={'name':{'type':Sequelize[_0x319a('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xd75f=['exports','STRING','sequelize'];(function(_0x22ef60,_0x2d04f3){var _0x3ea926=function(_0x10af13){while(--_0x10af13){_0x22ef60['push'](_0x22ef60['shift']());}};_0x3ea926(++_0x2d04f3);}(_0xd75f,0x104));var _0xfd75=function(_0x1897fa,_0x30a44e){_0x1897fa=_0x1897fa-0x0;var _0x59881b=_0xd75f[_0x1897fa];return _0x59881b;};'use strict';var Sequelize=require(_0xfd75('0x0'));module[_0xfd75('0x1')]={'name':{'type':Sequelize[_0xfd75('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0xfd75('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 4019860..62803f8 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 _0x1a37=['index','map','UserProfileResource','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','includeAll','include','findAll','catch','show','options','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1a37,0xb4));var _0x71a3=function(_0xd09668,_0x1435b2){_0xd09668=_0xd09668-0x0;var _0x68726=_0x1a37[_0xd09668];return _0x68726;};'use strict';var emlformat=require(_0x71a3('0x0'));var rimraf=require(_0x71a3('0x1'));var zipdir=require(_0x71a3('0x2'));var jsonpatch=require(_0x71a3('0x3'));var rp=require(_0x71a3('0x4'));var moment=require(_0x71a3('0x5'));var BPromise=require(_0x71a3('0x6'));var Mustache=require(_0x71a3('0x7'));var util=require(_0x71a3('0x8'));var path=require(_0x71a3('0x9'));var sox=require('sox');var csv=require(_0x71a3('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x71a3('0xb'));var _=require(_0x71a3('0xc'));var squel=require(_0x71a3('0xd'));var crypto=require(_0x71a3('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x71a3('0xf'));var Redis=require(_0x71a3('0x10'));var authService=require(_0x71a3('0x11'));var qs=require(_0x71a3('0x12'));var as=require(_0x71a3('0x13'));var hardwareService=require(_0x71a3('0x14'));var logger=require(_0x71a3('0x15'))(_0x71a3('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x71a3('0x17'))['db'];function respondWithStatusCode(_0x3830cb,_0x27e46d){_0x27e46d=_0x27e46d||0xcc;return function(_0x229134){if(_0x229134){return _0x3830cb[_0x71a3('0x18')](_0x27e46d);}return _0x3830cb[_0x71a3('0x19')](_0x27e46d)[_0x71a3('0x1a')]();};}function respondWithResult(_0x3b256c,_0x4dc4ed){_0x4dc4ed=_0x4dc4ed||0xc8;return function(_0x203ee1){if(_0x203ee1){return _0x3b256c[_0x71a3('0x19')](_0x4dc4ed)['json'](_0x203ee1);}};}function respondWithFilteredResult(_0x1743d7,_0x32591a){return function(_0x59021f){if(_0x59021f){var _0x4aa918=typeof _0x32591a[_0x71a3('0x1b')]===_0x71a3('0x1c')&&typeof _0x32591a[_0x71a3('0x1d')]===_0x71a3('0x1c');var _0x1af1bc=_0x59021f[_0x71a3('0x1e')];var _0x5d4dee=_0x4aa918?0x0:_0x32591a[_0x71a3('0x1b')];var _0x27bfb4=_0x4aa918?_0x59021f['count']:_0x32591a['offset']+_0x32591a[_0x71a3('0x1d')];var _0x250db3;if(_0x27bfb4>=_0x1af1bc){_0x27bfb4=_0x1af1bc;_0x250db3=0xc8;}else{_0x250db3=0xce;}_0x1743d7[_0x71a3('0x19')](_0x250db3);return _0x1743d7[_0x71a3('0x1f')](_0x71a3('0x20'),_0x5d4dee+'-'+_0x27bfb4+'/'+_0x1af1bc)['json'](_0x59021f);}return null;};}function patchUpdates(_0x1ab947){return function(_0x4156e1){try{jsonpatch[_0x71a3('0x21')](_0x4156e1,_0x1ab947,!![]);}catch(_0x3ea036){return BPromise[_0x71a3('0x22')](_0x3ea036);}return _0x4156e1['save']();};}function saveUpdates(_0x1af24b,_0x5bbaee){return function(_0x3bf78e){if(_0x3bf78e){return _0x3bf78e[_0x71a3('0x23')](_0x1af24b)[_0x71a3('0x24')](function(_0x21899d){return _0x21899d;});}return null;};}function removeEntity(_0x452bc4,_0x2847b4){return function(_0x5f33c5){if(_0x5f33c5){return _0x5f33c5[_0x71a3('0x25')]()[_0x71a3('0x24')](function(){_0x452bc4[_0x71a3('0x19')](0xcc)[_0x71a3('0x1a')]();});}};}function handleEntityNotFound(_0xb0f3aa,_0x4fd214){return function(_0x107fbd){if(!_0x107fbd){_0xb0f3aa[_0x71a3('0x18')](0x194);}return _0x107fbd;};}function handleError(_0x4c1a3d,_0x412746){_0x412746=_0x412746||0x1f4;return function(_0x515519){logger[_0x71a3('0x26')](_0x515519[_0x71a3('0x27')]);if(_0x515519[_0x71a3('0x28')]){delete _0x515519[_0x71a3('0x28')];}_0x4c1a3d[_0x71a3('0x19')](_0x412746)[_0x71a3('0x29')](_0x515519);};}exports[_0x71a3('0x2a')]=function(_0x242b85,_0x305eb1){var _0x3fc578={},_0x3ea7aa={},_0x228afa={'count':0x0,'rows':[]};var _0x51cde3=_[_0x71a3('0x2b')](db[_0x71a3('0x2c')][_0x71a3('0x2d')],function(_0x23ae85){return{'name':_0x23ae85['fieldName'],'type':_0x23ae85[_0x71a3('0x2e')][_0x71a3('0x2f')]};});_0x3ea7aa[_0x71a3('0x30')]=_[_0x71a3('0x2b')](_0x51cde3,_0x71a3('0x28'));_0x3ea7aa[_0x71a3('0x31')]=_[_0x71a3('0x32')](_0x242b85['query']);_0x3ea7aa[_0x71a3('0x33')]=_[_0x71a3('0x34')](_0x3ea7aa[_0x71a3('0x30')],_0x3ea7aa[_0x71a3('0x31')]);_0x3fc578[_0x71a3('0x35')]=_[_0x71a3('0x34')](_0x3ea7aa[_0x71a3('0x30')],qs[_0x71a3('0x36')](_0x242b85[_0x71a3('0x31')][_0x71a3('0x36')]));_0x3fc578[_0x71a3('0x35')]=_0x3fc578[_0x71a3('0x35')][_0x71a3('0x37')]?_0x3fc578['attributes']:_0x3ea7aa['model'];if(!_0x242b85[_0x71a3('0x31')][_0x71a3('0x38')]('nolimit')){_0x3fc578[_0x71a3('0x1d')]=qs[_0x71a3('0x1d')](_0x242b85['query'][_0x71a3('0x1d')]);_0x3fc578[_0x71a3('0x1b')]=qs[_0x71a3('0x1b')](_0x242b85[_0x71a3('0x31')][_0x71a3('0x1b')]);}_0x3fc578[_0x71a3('0x39')]=qs[_0x71a3('0x3a')](_0x242b85['query'][_0x71a3('0x3a')]);_0x3fc578[_0x71a3('0x3b')]=qs[_0x71a3('0x33')](_['pick'](_0x242b85[_0x71a3('0x31')],_0x3ea7aa[_0x71a3('0x33')]),_0x51cde3);if(_0x242b85[_0x71a3('0x31')][_0x71a3('0x3c')]){_0x3fc578[_0x71a3('0x3b')]=_['merge'](_0x3fc578['where'],{'$or':_[_0x71a3('0x2b')](_0x51cde3,function(_0x2b3197){if(_0x2b3197[_0x71a3('0x2e')]!==_0x71a3('0x3d')){var _0x36ed2e={};_0x36ed2e[_0x2b3197['name']]={'$like':'%'+_0x242b85[_0x71a3('0x31')][_0x71a3('0x3c')]+'%'};return _0x36ed2e;}})});}_0x3fc578=_[_0x71a3('0x3e')]({},_0x3fc578,_0x242b85['options']);var _0x17c467={'where':_0x3fc578['where']};return db[_0x71a3('0x2c')][_0x71a3('0x1e')](_0x17c467)[_0x71a3('0x24')](function(_0x43c6d1){_0x228afa[_0x71a3('0x1e')]=_0x43c6d1;if(_0x242b85[_0x71a3('0x31')][_0x71a3('0x3f')]){_0x3fc578[_0x71a3('0x40')]=[{'all':!![]}];}return db[_0x71a3('0x2c')][_0x71a3('0x41')](_0x3fc578);})['then'](function(_0xa49846){_0x228afa['rows']=_0xa49846;return _0x228afa;})[_0x71a3('0x24')](respondWithFilteredResult(_0x305eb1,_0x3fc578))[_0x71a3('0x42')](handleError(_0x305eb1,null));};exports[_0x71a3('0x43')]=function(_0x18974c,_0x59c7c9){var _0x412bce={'raw':![],'where':{'id':_0x18974c['params']['id']}},_0x4b4fde={};_0x4b4fde[_0x71a3('0x30')]=_[_0x71a3('0x32')](db[_0x71a3('0x2c')][_0x71a3('0x2d')]);_0x4b4fde['query']=_[_0x71a3('0x32')](_0x18974c[_0x71a3('0x31')]);_0x4b4fde[_0x71a3('0x33')]=_[_0x71a3('0x34')](_0x4b4fde[_0x71a3('0x30')],_0x4b4fde[_0x71a3('0x31')]);_0x412bce[_0x71a3('0x35')]=_[_0x71a3('0x34')](_0x4b4fde[_0x71a3('0x30')],qs[_0x71a3('0x36')](_0x18974c[_0x71a3('0x31')][_0x71a3('0x36')]));_0x412bce[_0x71a3('0x35')]=_0x412bce[_0x71a3('0x35')][_0x71a3('0x37')]?_0x412bce[_0x71a3('0x35')]:_0x4b4fde['model'];if(_0x18974c[_0x71a3('0x31')][_0x71a3('0x3f')]){_0x412bce['include']=[{'all':!![]}];}_0x412bce=_[_0x71a3('0x3e')]({},_0x412bce,_0x18974c[_0x71a3('0x44')]);return db[_0x71a3('0x2c')][_0x71a3('0x45')](_0x412bce)[_0x71a3('0x24')](handleEntityNotFound(_0x59c7c9,null))['then'](respondWithResult(_0x59c7c9,null))['catch'](handleError(_0x59c7c9,null));};exports[_0x71a3('0x46')]=function(_0x4305ee,_0x51d20d){return db[_0x71a3('0x2c')][_0x71a3('0x46')](_0x4305ee[_0x71a3('0x47')],{})[_0x71a3('0x24')](respondWithResult(_0x51d20d,0xc9))[_0x71a3('0x42')](handleError(_0x51d20d,null));};exports[_0x71a3('0x23')]=function(_0x501a62,_0x1c9ba6){if(_0x501a62['body']['id']){delete _0x501a62[_0x71a3('0x47')]['id'];}return db[_0x71a3('0x2c')][_0x71a3('0x45')]({'where':{'id':_0x501a62[_0x71a3('0x48')]['id']}})[_0x71a3('0x24')](handleEntityNotFound(_0x1c9ba6,null))['then'](saveUpdates(_0x501a62[_0x71a3('0x47')],null))[_0x71a3('0x24')](respondWithResult(_0x1c9ba6,null))[_0x71a3('0x42')](handleError(_0x1c9ba6,null));};exports['destroy']=function(_0x6c34,_0x4e6423){return db[_0x71a3('0x2c')][_0x71a3('0x45')]({'where':{'id':_0x6c34['params']['id']}})[_0x71a3('0x24')](handleEntityNotFound(_0x4e6423,null))[_0x71a3('0x24')](removeEntity(_0x4e6423,null))[_0x71a3('0x42')](handleError(_0x4e6423,null));};exports[_0x71a3('0x49')]=function(_0x11391d,_0x3952c0){return db[_0x71a3('0x2c')]['describe']()[_0x71a3('0x24')](respondWithResult(_0x3952c0,null))['catch'](handleError(_0x3952c0,null));}; \ No newline at end of file +var _0x0598=['include','rows','catch','show','params','keys','rawAttributes','includeAll','find','create','body','describe','eml-format','rimraf','fast-json-patch','bluebird','mustache','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','sendStatus','status','json','undefined','limit','count','offset','set','apply','update','destroy','then','end','error','stack','name','index','map','UserProfileResource','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options'];(function(_0x266618,_0x18f637){var _0x54dbf5=function(_0x1f7985){while(--_0x1f7985){_0x266618['push'](_0x266618['shift']());}};_0x54dbf5(++_0x18f637);}(_0x0598,0x92));var _0x8059=function(_0xe1e2d4,_0x476451){_0xe1e2d4=_0xe1e2d4-0x0;var _0x1e72af=_0x0598[_0xe1e2d4];return _0x1e72af;};'use strict';var emlformat=require(_0x8059('0x0'));var rimraf=require(_0x8059('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8059('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8059('0x3'));var Mustache=require(_0x8059('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x8059('0x5'));var ejs=require(_0x8059('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8059('0x7'));var crypto=require(_0x8059('0x8'));var jsforce=require(_0x8059('0x9'));var deskjs=require(_0x8059('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8059('0xb'));var Redis=require(_0x8059('0xc'));var authService=require(_0x8059('0xd'));var qs=require(_0x8059('0xe'));var as=require(_0x8059('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8059('0x10'));var utils=require(_0x8059('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1ead10,_0x2d26e2){_0x2d26e2=_0x2d26e2||0xcc;return function(_0x306467){if(_0x306467){return _0x1ead10[_0x8059('0x12')](_0x2d26e2);}return _0x1ead10[_0x8059('0x13')](_0x2d26e2)['end']();};}function respondWithResult(_0x11218f,_0x5480a5){_0x5480a5=_0x5480a5||0xc8;return function(_0x346b23){if(_0x346b23){return _0x11218f['status'](_0x5480a5)[_0x8059('0x14')](_0x346b23);}};}function respondWithFilteredResult(_0x13bf07,_0x4810fd){return function(_0x4d3873){if(_0x4d3873){var _0x516c1f=typeof _0x4810fd['offset']===_0x8059('0x15')&&typeof _0x4810fd[_0x8059('0x16')]===_0x8059('0x15');var _0x246c9d=_0x4d3873[_0x8059('0x17')];var _0x4b6d55=_0x516c1f?0x0:_0x4810fd[_0x8059('0x18')];var _0x2bb670=_0x516c1f?_0x4d3873[_0x8059('0x17')]:_0x4810fd[_0x8059('0x18')]+_0x4810fd['limit'];var _0x5456a9;if(_0x2bb670>=_0x246c9d){_0x2bb670=_0x246c9d;_0x5456a9=0xc8;}else{_0x5456a9=0xce;}_0x13bf07['status'](_0x5456a9);return _0x13bf07[_0x8059('0x19')]('Content-Range',_0x4b6d55+'-'+_0x2bb670+'/'+_0x246c9d)[_0x8059('0x14')](_0x4d3873);}return null;};}function patchUpdates(_0x56d794){return function(_0x466a88){try{jsonpatch[_0x8059('0x1a')](_0x466a88,_0x56d794,!![]);}catch(_0x1e9ac5){return BPromise['reject'](_0x1e9ac5);}return _0x466a88['save']();};}function saveUpdates(_0x21a80f,_0x232f1b){return function(_0x32aeda){if(_0x32aeda){return _0x32aeda[_0x8059('0x1b')](_0x21a80f)['then'](function(_0x3bc226){return _0x3bc226;});}return null;};}function removeEntity(_0x21ac82,_0x3da080){return function(_0x5449d9){if(_0x5449d9){return _0x5449d9[_0x8059('0x1c')]()[_0x8059('0x1d')](function(){_0x21ac82[_0x8059('0x13')](0xcc)[_0x8059('0x1e')]();});}};}function handleEntityNotFound(_0x59d3a6,_0x140f64){return function(_0x2cd179){if(!_0x2cd179){_0x59d3a6[_0x8059('0x12')](0x194);}return _0x2cd179;};}function handleError(_0x3e2d2b,_0x202b30){_0x202b30=_0x202b30||0x1f4;return function(_0x54b88b){logger[_0x8059('0x1f')](_0x54b88b[_0x8059('0x20')]);if(_0x54b88b[_0x8059('0x21')]){delete _0x54b88b['name'];}_0x3e2d2b['status'](_0x202b30)['send'](_0x54b88b);};}exports[_0x8059('0x22')]=function(_0xbebe0e,_0xc32b1f){var _0x1009af={},_0x59abe9={},_0x1eb71b={'count':0x0,'rows':[]};var _0x50b737=_[_0x8059('0x23')](db[_0x8059('0x24')]['rawAttributes'],function(_0x3814f5){return{'name':_0x3814f5[_0x8059('0x25')],'type':_0x3814f5[_0x8059('0x26')][_0x8059('0x27')]};});_0x59abe9[_0x8059('0x28')]=_[_0x8059('0x23')](_0x50b737,_0x8059('0x21'));_0x59abe9[_0x8059('0x29')]=_['keys'](_0xbebe0e[_0x8059('0x29')]);_0x59abe9[_0x8059('0x2a')]=_[_0x8059('0x2b')](_0x59abe9[_0x8059('0x28')],_0x59abe9[_0x8059('0x29')]);_0x1009af['attributes']=_[_0x8059('0x2b')](_0x59abe9[_0x8059('0x28')],qs[_0x8059('0x2c')](_0xbebe0e[_0x8059('0x29')][_0x8059('0x2c')]));_0x1009af[_0x8059('0x2d')]=_0x1009af[_0x8059('0x2d')][_0x8059('0x2e')]?_0x1009af[_0x8059('0x2d')]:_0x59abe9[_0x8059('0x28')];if(!_0xbebe0e['query'][_0x8059('0x2f')]('nolimit')){_0x1009af[_0x8059('0x16')]=qs['limit'](_0xbebe0e['query'][_0x8059('0x16')]);_0x1009af['offset']=qs[_0x8059('0x18')](_0xbebe0e['query'][_0x8059('0x18')]);}_0x1009af['order']=qs[_0x8059('0x30')](_0xbebe0e[_0x8059('0x29')]['sort']);_0x1009af[_0x8059('0x31')]=qs[_0x8059('0x2a')](_[_0x8059('0x32')](_0xbebe0e['query'],_0x59abe9[_0x8059('0x2a')]),_0x50b737);if(_0xbebe0e['query'][_0x8059('0x33')]){_0x1009af['where']=_[_0x8059('0x34')](_0x1009af[_0x8059('0x31')],{'$or':_[_0x8059('0x23')](_0x50b737,function(_0xb3b3c1){if(_0xb3b3c1['type']!==_0x8059('0x35')){var _0x55aaec={};_0x55aaec[_0xb3b3c1['name']]={'$like':'%'+_0xbebe0e[_0x8059('0x29')][_0x8059('0x33')]+'%'};return _0x55aaec;}})});}_0x1009af=_[_0x8059('0x34')]({},_0x1009af,_0xbebe0e[_0x8059('0x36')]);var _0x2f68b0={'where':_0x1009af['where']};return db['UserProfileResource']['count'](_0x2f68b0)['then'](function(_0x373e10){_0x1eb71b[_0x8059('0x17')]=_0x373e10;if(_0xbebe0e[_0x8059('0x29')]['includeAll']){_0x1009af[_0x8059('0x37')]=[{'all':!![]}];}return db[_0x8059('0x24')]['findAll'](_0x1009af);})[_0x8059('0x1d')](function(_0x2980cb){_0x1eb71b[_0x8059('0x38')]=_0x2980cb;return _0x1eb71b;})['then'](respondWithFilteredResult(_0xc32b1f,_0x1009af))[_0x8059('0x39')](handleError(_0xc32b1f,null));};exports[_0x8059('0x3a')]=function(_0x57eb56,_0x338493){var _0x280047={'raw':![],'where':{'id':_0x57eb56[_0x8059('0x3b')]['id']}},_0x3f00de={};_0x3f00de[_0x8059('0x28')]=_[_0x8059('0x3c')](db[_0x8059('0x24')][_0x8059('0x3d')]);_0x3f00de[_0x8059('0x29')]=_[_0x8059('0x3c')](_0x57eb56[_0x8059('0x29')]);_0x3f00de[_0x8059('0x2a')]=_[_0x8059('0x2b')](_0x3f00de[_0x8059('0x28')],_0x3f00de[_0x8059('0x29')]);_0x280047[_0x8059('0x2d')]=_[_0x8059('0x2b')](_0x3f00de[_0x8059('0x28')],qs[_0x8059('0x2c')](_0x57eb56[_0x8059('0x29')][_0x8059('0x2c')]));_0x280047[_0x8059('0x2d')]=_0x280047[_0x8059('0x2d')]['length']?_0x280047[_0x8059('0x2d')]:_0x3f00de['model'];if(_0x57eb56['query'][_0x8059('0x3e')]){_0x280047['include']=[{'all':!![]}];}_0x280047=_[_0x8059('0x34')]({},_0x280047,_0x57eb56['options']);return db[_0x8059('0x24')][_0x8059('0x3f')](_0x280047)[_0x8059('0x1d')](handleEntityNotFound(_0x338493,null))[_0x8059('0x1d')](respondWithResult(_0x338493,null))[_0x8059('0x39')](handleError(_0x338493,null));};exports[_0x8059('0x40')]=function(_0x538ab6,_0x301dca){return db['UserProfileResource'][_0x8059('0x40')](_0x538ab6[_0x8059('0x41')],{})[_0x8059('0x1d')](respondWithResult(_0x301dca,0xc9))['catch'](handleError(_0x301dca,null));};exports[_0x8059('0x1b')]=function(_0x120665,_0x46bec8){if(_0x120665[_0x8059('0x41')]['id']){delete _0x120665['body']['id'];}return db[_0x8059('0x24')][_0x8059('0x3f')]({'where':{'id':_0x120665[_0x8059('0x3b')]['id']}})['then'](handleEntityNotFound(_0x46bec8,null))[_0x8059('0x1d')](saveUpdates(_0x120665['body'],null))['then'](respondWithResult(_0x46bec8,null))[_0x8059('0x39')](handleError(_0x46bec8,null));};exports['destroy']=function(_0x20caa3,_0x54d2d2){return db[_0x8059('0x24')][_0x8059('0x3f')]({'where':{'id':_0x20caa3['params']['id']}})[_0x8059('0x1d')](handleEntityNotFound(_0x54d2d2,null))['then'](removeEntity(_0x54d2d2,null))[_0x8059('0x39')](handleError(_0x54d2d2,null));};exports[_0x8059('0x42')]=function(_0x429cf0,_0x5d5f16){return db[_0x8059('0x24')]['describe']()[_0x8059('0x1d')](respondWithResult(_0x5d5f16,null))[_0x8059('0x39')](handleError(_0x5d5f16,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 14a1900..a676910 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 _0x0b94=['moment','bluebird','request-promise','path','../../config/environment','./userProfileResource.attributes','exports','define','compositeIndex','resourceId','sectionId','lodash','util','../../config/logger','api'];(function(_0x281e8f,_0x4b2d96){var _0x55e602=function(_0x24bfa9){while(--_0x24bfa9){_0x281e8f['push'](_0x281e8f['shift']());}};_0x55e602(++_0x4b2d96);}(_0x0b94,0x74));var _0x40b9=function(_0x56c67c,_0x322166){_0x56c67c=_0x56c67c-0x0;var _0x406838=_0x0b94[_0x56c67c];return _0x406838;};'use strict';var _=require(_0x40b9('0x0'));var util=require(_0x40b9('0x1'));var logger=require(_0x40b9('0x2'))(_0x40b9('0x3'));var moment=require(_0x40b9('0x4'));var BPromise=require(_0x40b9('0x5'));var rp=require(_0x40b9('0x6'));var fs=require('fs');var path=require(_0x40b9('0x7'));var rimraf=require('rimraf');var config=require(_0x40b9('0x8'));var attributes=require(_0x40b9('0x9'));module[_0x40b9('0xa')]=function(_0x3ec8b1,_0x4d7af7){return _0x3ec8b1[_0x40b9('0xb')]('UserProfileResource',attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0x40b9('0xc'),'fields':[_0x40b9('0xd'),_0x40b9('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6418=['lodash','api','moment','bluebird','request-promise','rimraf','../../config/environment','UserProfileResource','user_profile_has_resources','sectionId'];(function(_0x5e66cd,_0x31bac1){var _0x18585e=function(_0x2de5ab){while(--_0x2de5ab){_0x5e66cd['push'](_0x5e66cd['shift']());}};_0x18585e(++_0x31bac1);}(_0x6418,0x1f4));var _0x8641=function(_0x2c9fb5,_0x42600b){_0x2c9fb5=_0x2c9fb5-0x0;var _0x3acadc=_0x6418[_0x2c9fb5];return _0x3acadc;};'use strict';var _=require(_0x8641('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8641('0x1'));var moment=require(_0x8641('0x2'));var BPromise=require(_0x8641('0x3'));var rp=require(_0x8641('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8641('0x5'));var config=require(_0x8641('0x6'));var attributes=require('./userProfileResource.attributes');module['exports']=function(_0x3053b5,_0x51314d){return _0x3053b5['define'](_0x8641('0x7'),attributes,{'tableName':_0x8641('0x8'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':['resourceId',_0x8641('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 4aaa305..2ebcd0b 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 _0xf89c=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash'];(function(_0x533132,_0xf5b6fa){var _0x1a7447=function(_0x44d580){while(--_0x44d580){_0x533132['push'](_0x533132['shift']());}};_0x1a7447(++_0xf5b6fa);}(_0xf89c,0x1e2));var _0xcf89=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf89c[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xcf89('0x0'));var util=require(_0xcf89('0x1'));var moment=require(_0xcf89('0x2'));var BPromise=require(_0xcf89('0x3'));var rs=require(_0xcf89('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcf89('0x5'))['db'];var utils=require(_0xcf89('0x6'));var logger=require(_0xcf89('0x7'))('rpc');var config=require(_0xcf89('0x8'));var jayson=require(_0xcf89('0x9'));var client=jayson[_0xcf89('0xa')][_0xcf89('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5dbdbc,_0x213f24,_0x3d03ff){return new BPromise(function(_0x4aa230,_0x5ddadd){return client[_0xcf89('0xc')](_0x5dbdbc,_0x3d03ff)[_0xcf89('0xd')](function(_0x33a8f4){logger[_0xcf89('0xe')](_0xcf89('0xf'),_0x213f24,_0xcf89('0x10'));logger[_0xcf89('0x11')](_0xcf89('0x12'),_0x213f24,'request\x20sent',JSON['stringify'](_0x33a8f4));if(_0x33a8f4[_0xcf89('0x13')]){if(_0x33a8f4[_0xcf89('0x13')][_0xcf89('0x14')]===0x1f4){logger[_0xcf89('0x13')]('UserProfileResource,\x20%s,\x20%s',_0x213f24,_0x33a8f4['error'][_0xcf89('0x15')]);return _0x5ddadd(_0x33a8f4[_0xcf89('0x13')][_0xcf89('0x15')]);}logger[_0xcf89('0x13')](_0xcf89('0xf'),_0x213f24,_0x33a8f4[_0xcf89('0x13')]['message']);return _0x4aa230(_0x33a8f4['error']['message']);}else{logger[_0xcf89('0xe')](_0xcf89('0xf'),_0x213f24,_0xcf89('0x10'));_0x4aa230(_0x33a8f4[_0xcf89('0x16')][_0xcf89('0x15')]);}})['catch'](function(_0x1d77bd){logger['error'](_0xcf89('0xf'),_0x213f24,_0x1d77bd);_0x5ddadd(_0x1d77bd);});});} \ No newline at end of file +var _0x16fb=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','bluebird'];(function(_0x1dc918,_0x2d61fe){var _0x1aa013=function(_0x3ce4c6){while(--_0x3ce4c6){_0x1dc918['push'](_0x1dc918['shift']());}};_0x1aa013(++_0x2d61fe);}(_0x16fb,0x165));var _0xb16f=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0x16fb[_0x45d3f0];return _0x314b79;};'use strict';var _=require(_0xb16f('0x0'));var util=require(_0xb16f('0x1'));var moment=require('moment');var BPromise=require(_0xb16f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb16f('0x3'));var db=require(_0xb16f('0x4'))['db'];var utils=require(_0xb16f('0x5'));var logger=require(_0xb16f('0x6'))('rpc');var config=require(_0xb16f('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xb16f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x13884e,_0x42bc4a,_0x8325){return new BPromise(function(_0x22b38a,_0x3a54ca){return client[_0xb16f('0x9')](_0x13884e,_0x8325)[_0xb16f('0xa')](function(_0x443940){logger[_0xb16f('0xb')](_0xb16f('0xc'),_0x42bc4a,_0xb16f('0xd'));logger[_0xb16f('0xe')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x42bc4a,_0xb16f('0xd'),JSON[_0xb16f('0xf')](_0x443940));if(_0x443940[_0xb16f('0x10')]){if(_0x443940[_0xb16f('0x10')]['code']===0x1f4){logger['error'](_0xb16f('0xc'),_0x42bc4a,_0x443940[_0xb16f('0x10')][_0xb16f('0x11')]);return _0x3a54ca(_0x443940['error'][_0xb16f('0x11')]);}logger[_0xb16f('0x10')](_0xb16f('0xc'),_0x42bc4a,_0x443940[_0xb16f('0x10')][_0xb16f('0x11')]);return _0x22b38a(_0x443940['error'][_0xb16f('0x11')]);}else{logger['info'](_0xb16f('0xc'),_0x42bc4a,'request\x20sent');_0x22b38a(_0x443940[_0xb16f('0x12')][_0xb16f('0x11')]);}})[_0xb16f('0x13')](function(_0x4f6fb8){logger[_0xb16f('0x10')](_0xb16f('0xc'),_0x42bc4a,_0x4f6fb8);_0x3a54ca(_0x4f6fb8);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index c7fd07f..f2235c7 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 _0x61e1=['destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','index','/describe','show','post','create','/:id','update'];(function(_0x5900f2,_0x211c71){var _0x3befe0=function(_0x2c143f){while(--_0x2c143f){_0x5900f2['push'](_0x5900f2['shift']());}};_0x3befe0(++_0x211c71);}(_0x61e1,0x1e5));var _0x161e=function(_0x4f90a0,_0x5715c4){_0x4f90a0=_0x4f90a0-0x0;var _0x4ab42f=_0x61e1[_0x4f90a0];return _0x4ab42f;};'use strict';var multer=require(_0x161e('0x0'));var util=require(_0x161e('0x1'));var path=require('path');var timeout=require(_0x161e('0x2'));var express=require(_0x161e('0x3'));var router=express[_0x161e('0x4')]();var fs_extra=require(_0x161e('0x5'));var auth=require(_0x161e('0x6'));var interaction=require(_0x161e('0x7'));var config=require(_0x161e('0x8'));var controller=require(_0x161e('0x9'));router[_0x161e('0xa')]('/',auth[_0x161e('0xb')](),controller[_0x161e('0xc')]);router['get'](_0x161e('0xd'),auth[_0x161e('0xb')](),controller['describe']);router[_0x161e('0xa')]('/:id',auth[_0x161e('0xb')](),controller[_0x161e('0xe')]);router[_0x161e('0xf')]('/',auth[_0x161e('0xb')](),controller[_0x161e('0x10')]);router['put'](_0x161e('0x11'),auth[_0x161e('0xb')](),controller[_0x161e('0x12')]);router['delete'](_0x161e('0x11'),auth['isAuthenticated'](),controller[_0x161e('0x13')]);module[_0x161e('0x14')]=router; \ No newline at end of file +var _0xa068=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','/describe','describe','post','create','delete','destroy','exports','multer','util'];(function(_0x172948,_0x4262cc){var _0x4aeaa9=function(_0x5ec4b3){while(--_0x5ec4b3){_0x172948['push'](_0x172948['shift']());}};_0x4aeaa9(++_0x4262cc);}(_0xa068,0xbc));var _0x8a06=function(_0x3a9619,_0x33bbe1){_0x3a9619=_0x3a9619-0x0;var _0x3e750c=_0xa068[_0x3a9619];return _0x3e750c;};'use strict';var multer=require(_0x8a06('0x0'));var util=require(_0x8a06('0x1'));var path=require(_0x8a06('0x2'));var timeout=require('connect-timeout');var express=require(_0x8a06('0x3'));var router=express[_0x8a06('0x4')]();var fs_extra=require(_0x8a06('0x5'));var auth=require(_0x8a06('0x6'));var interaction=require(_0x8a06('0x7'));var config=require(_0x8a06('0x8'));var controller=require(_0x8a06('0x9'));router[_0x8a06('0xa')]('/',auth[_0x8a06('0xb')](),controller['index']);router[_0x8a06('0xa')](_0x8a06('0xc'),auth[_0x8a06('0xb')](),controller[_0x8a06('0xd')]);router[_0x8a06('0xa')]('/:id',auth[_0x8a06('0xb')](),controller['show']);router[_0x8a06('0xe')]('/',auth['isAuthenticated'](),controller[_0x8a06('0xf')]);router['put']('/:id',auth[_0x8a06('0xb')](),controller['update']);router[_0x8a06('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x8a06('0x11')]);module[_0x8a06('0x12')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index a68012c..e711a66 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 _0x065e=['crudPermissions','getDataValue','split','sequelize','INTEGER','BOOLEAN','setDataValue'];(function(_0xd99b71,_0x5460e3){var _0x2a98ea=function(_0x5db616){while(--_0x5db616){_0xd99b71['push'](_0xd99b71['shift']());}};_0x2a98ea(++_0x5460e3);}(_0x065e,0x1a7));var _0xe065=function(_0x882253,_0x744f2c){_0x882253=_0x882253-0x0;var _0x442e1e=_0x065e[_0x882253];return _0x442e1e;};'use strict';var Sequelize=require(_0xe065('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize[_0xe065('0x1')],'allowNull':![]},'enabled':{'type':Sequelize[_0xe065('0x2')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xe065('0x2')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x4964fa){this[_0xe065('0x3')](_0xe065('0x4'),_0x4964fa?_0x4964fa['join'](''):[]);},'get':function(){return this[_0xe065('0x5')](_0xe065('0x4'))?this[_0xe065('0x5')]('crudPermissions')[_0xe065('0x6')](''):[];}}}; \ No newline at end of file +var _0x58a4=['split','sequelize','exports','STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions','join','getDataValue'];(function(_0x477471,_0x7ac0b7){var _0x2ca13d=function(_0x47fb88){while(--_0x47fb88){_0x477471['push'](_0x477471['shift']());}};_0x2ca13d(++_0x7ac0b7);}(_0x58a4,0xbf));var _0x458a=function(_0x4ed37d,_0x1a84c9){_0x4ed37d=_0x4ed37d-0x0;var _0x4fb2c5=_0x58a4[_0x4ed37d];return _0x4fb2c5;};'use strict';var Sequelize=require(_0x458a('0x0'));module[_0x458a('0x1')]={'name':{'type':Sequelize[_0x458a('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0x458a('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x458a('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0x458a('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x458a('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x458a('0x2')],'set':function(_0x362079){this[_0x458a('0x5')](_0x458a('0x6'),_0x362079?_0x362079[_0x458a('0x7')](''):[]);},'get':function(){return this[_0x458a('0x8')]('crudPermissions')?this['getDataValue'](_0x458a('0x6'))[_0x458a('0x9')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 56ea8bd..3909544 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 _0x11b6=['hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','show','keys','includeAll','find','create','body','catch','params','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','end','stack','name','send','index','UserProfileSection','rawAttributes','fieldName','map','query','filters','attributes','intersection','model','fields','length'];(function(_0x20bdf0,_0x204f1b){var _0x3cf650=function(_0x389cea){while(--_0x389cea){_0x20bdf0['push'](_0x20bdf0['shift']());}};_0x3cf650(++_0x204f1b);}(_0x11b6,0xaf));var _0x611b=function(_0x5d1429,_0xe5b09d){_0x5d1429=_0x5d1429-0x0;var _0x5a8f23=_0x11b6[_0x5d1429];return _0x5a8f23;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x611b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x611b('0x1'));var rp=require(_0x611b('0x2'));var moment=require(_0x611b('0x3'));var BPromise=require(_0x611b('0x4'));var Mustache=require(_0x611b('0x5'));var util=require(_0x611b('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x611b('0x7'));var ejs=require(_0x611b('0x8'));var fs=require('fs');var fs_extra=require(_0x611b('0x9'));var _=require(_0x611b('0xa'));var squel=require('squel');var crypto=require(_0x611b('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x611b('0xc'));var toCsv=require('to-csv');var querystring=require(_0x611b('0xd'));var Papa=require(_0x611b('0xe'));var Redis=require(_0x611b('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x611b('0x10'));var logger=require('../../config/logger')(_0x611b('0x11'));var utils=require(_0x611b('0x12'));var config=require(_0x611b('0x13'));var licenseUtil=require(_0x611b('0x14'));var db=require(_0x611b('0x15'))['db'];function respondWithStatusCode(_0x4764a5,_0x31fa37){_0x31fa37=_0x31fa37||0xcc;return function(_0x5401b3){if(_0x5401b3){return _0x4764a5[_0x611b('0x16')](_0x31fa37);}return _0x4764a5['status'](_0x31fa37)['end']();};}function respondWithResult(_0x1a0b76,_0x49011b){_0x49011b=_0x49011b||0xc8;return function(_0x21484c){if(_0x21484c){return _0x1a0b76[_0x611b('0x17')](_0x49011b)['json'](_0x21484c);}};}function respondWithFilteredResult(_0x434ff0,_0x4f0f22){return function(_0x470d2a){if(_0x470d2a){var _0x2b8315=typeof _0x4f0f22[_0x611b('0x18')]===_0x611b('0x19')&&typeof _0x4f0f22[_0x611b('0x1a')]===_0x611b('0x19');var _0x27441b=_0x470d2a[_0x611b('0x1b')];var _0x2474e6=_0x2b8315?0x0:_0x4f0f22[_0x611b('0x18')];var _0x502031=_0x2b8315?_0x470d2a[_0x611b('0x1b')]:_0x4f0f22[_0x611b('0x18')]+_0x4f0f22[_0x611b('0x1a')];var _0x3dd58b;if(_0x502031>=_0x27441b){_0x502031=_0x27441b;_0x3dd58b=0xc8;}else{_0x3dd58b=0xce;}_0x434ff0[_0x611b('0x17')](_0x3dd58b);return _0x434ff0[_0x611b('0x1c')](_0x611b('0x1d'),_0x2474e6+'-'+_0x502031+'/'+_0x27441b)[_0x611b('0x1e')](_0x470d2a);}return null;};}function patchUpdates(_0x8e952e){return function(_0x1a30a8){try{jsonpatch[_0x611b('0x1f')](_0x1a30a8,_0x8e952e,!![]);}catch(_0x5054ac){return BPromise[_0x611b('0x20')](_0x5054ac);}return _0x1a30a8[_0x611b('0x21')]();};}function saveUpdates(_0x1c9d3e,_0x24a999){return function(_0x2009f0){if(_0x2009f0){return _0x2009f0[_0x611b('0x22')](_0x1c9d3e)['then'](function(_0x380859){return _0x380859;});}return null;};}function removeEntity(_0x49af5c,_0x512e38){return function(_0x5a0968){if(_0x5a0968){return _0x5a0968[_0x611b('0x23')]()[_0x611b('0x24')](function(){_0x49af5c[_0x611b('0x17')](0xcc)[_0x611b('0x25')]();});}};}function handleEntityNotFound(_0x3d626d,_0x26bae0){return function(_0x56d05c){if(!_0x56d05c){_0x3d626d[_0x611b('0x16')](0x194);}return _0x56d05c;};}function handleError(_0x32fc45,_0x4fa14c){_0x4fa14c=_0x4fa14c||0x1f4;return function(_0x4aa34f){logger['error'](_0x4aa34f[_0x611b('0x26')]);if(_0x4aa34f[_0x611b('0x27')]){delete _0x4aa34f[_0x611b('0x27')];}_0x32fc45['status'](_0x4fa14c)[_0x611b('0x28')](_0x4aa34f);};}exports[_0x611b('0x29')]=function(_0x3a03a0,_0x1268f0){var _0x98356c={},_0x4e9ec4={},_0x3e6329={'count':0x0,'rows':[]};var _0x4d3121=_['map'](db[_0x611b('0x2a')][_0x611b('0x2b')],function(_0x5dd695){return{'name':_0x5dd695[_0x611b('0x2c')],'type':_0x5dd695['type']['key']};});_0x4e9ec4['model']=_[_0x611b('0x2d')](_0x4d3121,_0x611b('0x27'));_0x4e9ec4[_0x611b('0x2e')]=_['keys'](_0x3a03a0[_0x611b('0x2e')]);_0x4e9ec4[_0x611b('0x2f')]=_['intersection'](_0x4e9ec4['model'],_0x4e9ec4[_0x611b('0x2e')]);_0x98356c[_0x611b('0x30')]=_[_0x611b('0x31')](_0x4e9ec4[_0x611b('0x32')],qs['fields'](_0x3a03a0[_0x611b('0x2e')][_0x611b('0x33')]));_0x98356c[_0x611b('0x30')]=_0x98356c['attributes'][_0x611b('0x34')]?_0x98356c['attributes']:_0x4e9ec4['model'];if(!_0x3a03a0[_0x611b('0x2e')][_0x611b('0x35')](_0x611b('0x36'))){_0x98356c[_0x611b('0x1a')]=qs[_0x611b('0x1a')](_0x3a03a0[_0x611b('0x2e')][_0x611b('0x1a')]);_0x98356c[_0x611b('0x18')]=qs['offset'](_0x3a03a0['query'][_0x611b('0x18')]);}_0x98356c[_0x611b('0x37')]=qs[_0x611b('0x38')](_0x3a03a0[_0x611b('0x2e')][_0x611b('0x38')]);_0x98356c[_0x611b('0x39')]=qs[_0x611b('0x2f')](_[_0x611b('0x3a')](_0x3a03a0[_0x611b('0x2e')],_0x4e9ec4[_0x611b('0x2f')]),_0x4d3121);if(_0x3a03a0[_0x611b('0x2e')][_0x611b('0x3b')]){_0x98356c[_0x611b('0x39')]=_[_0x611b('0x3c')](_0x98356c[_0x611b('0x39')],{'$or':_['map'](_0x4d3121,function(_0x12c209){if(_0x12c209[_0x611b('0x3d')]!==_0x611b('0x3e')){var _0x8f3b9={};_0x8f3b9[_0x12c209[_0x611b('0x27')]]={'$like':'%'+_0x3a03a0[_0x611b('0x2e')]['filter']+'%'};return _0x8f3b9;}})});}_0x98356c=_[_0x611b('0x3c')]({},_0x98356c,_0x3a03a0[_0x611b('0x3f')]);var _0x365977={'where':_0x98356c[_0x611b('0x39')]};return db[_0x611b('0x2a')]['count'](_0x365977)[_0x611b('0x24')](function(_0x4c3031){_0x3e6329['count']=_0x4c3031;if(_0x3a03a0[_0x611b('0x2e')]['includeAll']){_0x98356c[_0x611b('0x40')]=[{'all':!![]}];}return db['UserProfileSection'][_0x611b('0x41')](_0x98356c);})[_0x611b('0x24')](function(_0x18985c){_0x3e6329[_0x611b('0x42')]=_0x18985c;return _0x3e6329;})[_0x611b('0x24')](respondWithFilteredResult(_0x1268f0,_0x98356c))['catch'](handleError(_0x1268f0,null));};exports[_0x611b('0x43')]=function(_0x42cf45,_0x4a0f57){var _0x583176={'raw':![],'where':{'id':_0x42cf45['params']['id']}},_0x158a48={};_0x158a48[_0x611b('0x32')]=_['keys'](db[_0x611b('0x2a')][_0x611b('0x2b')]);_0x158a48[_0x611b('0x2e')]=_[_0x611b('0x44')](_0x42cf45[_0x611b('0x2e')]);_0x158a48[_0x611b('0x2f')]=_['intersection'](_0x158a48[_0x611b('0x32')],_0x158a48[_0x611b('0x2e')]);_0x583176[_0x611b('0x30')]=_[_0x611b('0x31')](_0x158a48['model'],qs[_0x611b('0x33')](_0x42cf45[_0x611b('0x2e')]['fields']));_0x583176['attributes']=_0x583176[_0x611b('0x30')]['length']?_0x583176[_0x611b('0x30')]:_0x158a48[_0x611b('0x32')];if(_0x42cf45[_0x611b('0x2e')][_0x611b('0x45')]){_0x583176['include']=[{'all':!![]}];}_0x583176=_[_0x611b('0x3c')]({},_0x583176,_0x42cf45[_0x611b('0x3f')]);return db[_0x611b('0x2a')][_0x611b('0x46')](_0x583176)[_0x611b('0x24')](handleEntityNotFound(_0x4a0f57,null))[_0x611b('0x24')](respondWithResult(_0x4a0f57,null))['catch'](handleError(_0x4a0f57,null));};exports[_0x611b('0x47')]=function(_0x278a85,_0x1abc15){return db[_0x611b('0x2a')][_0x611b('0x47')](_0x278a85[_0x611b('0x48')],{})[_0x611b('0x24')](respondWithResult(_0x1abc15,0xc9))[_0x611b('0x49')](handleError(_0x1abc15,null));};exports[_0x611b('0x22')]=function(_0x14aeab,_0x5c8331){if(_0x14aeab[_0x611b('0x48')]['id']){delete _0x14aeab[_0x611b('0x48')]['id'];}return db[_0x611b('0x2a')]['find']({'where':{'id':_0x14aeab[_0x611b('0x4a')]['id']}})[_0x611b('0x24')](handleEntityNotFound(_0x5c8331,null))['then'](saveUpdates(_0x14aeab[_0x611b('0x48')],null))[_0x611b('0x24')](respondWithResult(_0x5c8331,null))[_0x611b('0x49')](handleError(_0x5c8331,null));};exports[_0x611b('0x23')]=function(_0x4b20bf,_0x453f66){return db[_0x611b('0x2a')]['find']({'where':{'id':_0x4b20bf[_0x611b('0x4a')]['id']}})[_0x611b('0x24')](handleEntityNotFound(_0x453f66,null))['then'](removeEntity(_0x453f66,null))['catch'](handleError(_0x453f66,null));};exports[_0x611b('0x4b')]=function(_0x3e359b,_0x5beb0c){return db['UserProfileSection'][_0x611b('0x4b')]()[_0x611b('0x24')](respondWithResult(_0x5beb0c,null))[_0x611b('0x49')](handleError(_0x5beb0c,null));}; \ No newline at end of file +var _0xecbe=['path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','undefined','limit','count','offset','Content-Range','reject','save','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','UserProfileSection','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util'];(function(_0x5d77b0,_0x4e24d4){var _0x16915f=function(_0x261883){while(--_0x261883){_0x5d77b0['push'](_0x5d77b0['shift']());}};_0x16915f(++_0x4e24d4);}(_0xecbe,0x90));var _0xeecb=function(_0x4bbc3a,_0x3a6945){_0x4bbc3a=_0x4bbc3a-0x0;var _0x579d56=_0xecbe[_0x4bbc3a];return _0x579d56;};'use strict';var emlformat=require(_0xeecb('0x0'));var rimraf=require(_0xeecb('0x1'));var zipdir=require(_0xeecb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xeecb('0x3'));var moment=require(_0xeecb('0x4'));var BPromise=require(_0xeecb('0x5'));var Mustache=require(_0xeecb('0x6'));var util=require(_0xeecb('0x7'));var path=require(_0xeecb('0x8'));var sox=require(_0xeecb('0x9'));var csv=require(_0xeecb('0xa'));var ejs=require(_0xeecb('0xb'));var fs=require('fs');var fs_extra=require(_0xeecb('0xc'));var _=require(_0xeecb('0xd'));var squel=require(_0xeecb('0xe'));var crypto=require(_0xeecb('0xf'));var jsforce=require(_0xeecb('0x10'));var deskjs=require(_0xeecb('0x11'));var toCsv=require(_0xeecb('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xeecb('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xeecb('0x13'));var as=require(_0xeecb('0x14'));var hardwareService=require(_0xeecb('0x15'));var logger=require('../../config/logger')(_0xeecb('0x16'));var utils=require(_0xeecb('0x17'));var config=require(_0xeecb('0x18'));var licenseUtil=require(_0xeecb('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xec75f4,_0x2ed09a){_0x2ed09a=_0x2ed09a||0xcc;return function(_0x1cea59){if(_0x1cea59){return _0xec75f4['sendStatus'](_0x2ed09a);}return _0xec75f4[_0xeecb('0x1a')](_0x2ed09a)[_0xeecb('0x1b')]();};}function respondWithResult(_0x45368c,_0x339305){_0x339305=_0x339305||0xc8;return function(_0x3f8f22){if(_0x3f8f22){return _0x45368c[_0xeecb('0x1a')](_0x339305)[_0xeecb('0x1c')](_0x3f8f22);}};}function respondWithFilteredResult(_0x56490d,_0x5258ae){return function(_0x34bc9b){if(_0x34bc9b){var _0x52d6aa=typeof _0x5258ae['offset']===_0xeecb('0x1d')&&typeof _0x5258ae[_0xeecb('0x1e')]==='undefined';var _0x2369e5=_0x34bc9b[_0xeecb('0x1f')];var _0x4c2407=_0x52d6aa?0x0:_0x5258ae[_0xeecb('0x20')];var _0x5a5d39=_0x52d6aa?_0x34bc9b[_0xeecb('0x1f')]:_0x5258ae[_0xeecb('0x20')]+_0x5258ae[_0xeecb('0x1e')];var _0x32217f;if(_0x5a5d39>=_0x2369e5){_0x5a5d39=_0x2369e5;_0x32217f=0xc8;}else{_0x32217f=0xce;}_0x56490d[_0xeecb('0x1a')](_0x32217f);return _0x56490d['set'](_0xeecb('0x21'),_0x4c2407+'-'+_0x5a5d39+'/'+_0x2369e5)[_0xeecb('0x1c')](_0x34bc9b);}return null;};}function patchUpdates(_0x122028){return function(_0x5c0ade){try{jsonpatch['apply'](_0x5c0ade,_0x122028,!![]);}catch(_0x5b86d){return BPromise[_0xeecb('0x22')](_0x5b86d);}return _0x5c0ade[_0xeecb('0x23')]();};}function saveUpdates(_0x48bac3,_0x460462){return function(_0x1891d1){if(_0x1891d1){return _0x1891d1[_0xeecb('0x24')](_0x48bac3)[_0xeecb('0x25')](function(_0x2ad1d3){return _0x2ad1d3;});}return null;};}function removeEntity(_0x4c9646,_0x4b8490){return function(_0x21d4f8){if(_0x21d4f8){return _0x21d4f8[_0xeecb('0x26')]()[_0xeecb('0x25')](function(){_0x4c9646[_0xeecb('0x1a')](0xcc)[_0xeecb('0x1b')]();});}};}function handleEntityNotFound(_0x1bbf7e,_0x2d62ea){return function(_0x42f365){if(!_0x42f365){_0x1bbf7e['sendStatus'](0x194);}return _0x42f365;};}function handleError(_0x51319c,_0x337793){_0x337793=_0x337793||0x1f4;return function(_0x5cf6a4){logger[_0xeecb('0x27')](_0x5cf6a4[_0xeecb('0x28')]);if(_0x5cf6a4[_0xeecb('0x29')]){delete _0x5cf6a4['name'];}_0x51319c['status'](_0x337793)['send'](_0x5cf6a4);};}exports[_0xeecb('0x2a')]=function(_0x5ab781,_0x4201d5){var _0x1c7547={},_0x239f45={},_0x47be6f={'count':0x0,'rows':[]};var _0xbfa790=_[_0xeecb('0x2b')](db['UserProfileSection'][_0xeecb('0x2c')],function(_0x5cf1da){return{'name':_0x5cf1da[_0xeecb('0x2d')],'type':_0x5cf1da[_0xeecb('0x2e')][_0xeecb('0x2f')]};});_0x239f45[_0xeecb('0x30')]=_[_0xeecb('0x2b')](_0xbfa790,_0xeecb('0x29'));_0x239f45[_0xeecb('0x31')]=_['keys'](_0x5ab781[_0xeecb('0x31')]);_0x239f45[_0xeecb('0x32')]=_[_0xeecb('0x33')](_0x239f45[_0xeecb('0x30')],_0x239f45[_0xeecb('0x31')]);_0x1c7547[_0xeecb('0x34')]=_[_0xeecb('0x33')](_0x239f45[_0xeecb('0x30')],qs[_0xeecb('0x35')](_0x5ab781[_0xeecb('0x31')]['fields']));_0x1c7547[_0xeecb('0x34')]=_0x1c7547['attributes'][_0xeecb('0x36')]?_0x1c7547[_0xeecb('0x34')]:_0x239f45[_0xeecb('0x30')];if(!_0x5ab781[_0xeecb('0x31')][_0xeecb('0x37')](_0xeecb('0x38'))){_0x1c7547['limit']=qs['limit'](_0x5ab781['query'][_0xeecb('0x1e')]);_0x1c7547[_0xeecb('0x20')]=qs['offset'](_0x5ab781['query'][_0xeecb('0x20')]);}_0x1c7547['order']=qs[_0xeecb('0x39')](_0x5ab781['query'][_0xeecb('0x39')]);_0x1c7547['where']=qs[_0xeecb('0x32')](_[_0xeecb('0x3a')](_0x5ab781['query'],_0x239f45[_0xeecb('0x32')]),_0xbfa790);if(_0x5ab781[_0xeecb('0x31')][_0xeecb('0x3b')]){_0x1c7547[_0xeecb('0x3c')]=_[_0xeecb('0x3d')](_0x1c7547[_0xeecb('0x3c')],{'$or':_[_0xeecb('0x2b')](_0xbfa790,function(_0x8708a0){if(_0x8708a0['type']!==_0xeecb('0x3e')){var _0x24179d={};_0x24179d[_0x8708a0[_0xeecb('0x29')]]={'$like':'%'+_0x5ab781['query'][_0xeecb('0x3b')]+'%'};return _0x24179d;}})});}_0x1c7547=_[_0xeecb('0x3d')]({},_0x1c7547,_0x5ab781[_0xeecb('0x3f')]);var _0x2b9270={'where':_0x1c7547[_0xeecb('0x3c')]};return db[_0xeecb('0x40')][_0xeecb('0x1f')](_0x2b9270)['then'](function(_0x1173ca){_0x47be6f['count']=_0x1173ca;if(_0x5ab781[_0xeecb('0x31')][_0xeecb('0x41')]){_0x1c7547[_0xeecb('0x42')]=[{'all':!![]}];}return db[_0xeecb('0x40')][_0xeecb('0x43')](_0x1c7547);})[_0xeecb('0x25')](function(_0x4dd7c1){_0x47be6f[_0xeecb('0x44')]=_0x4dd7c1;return _0x47be6f;})[_0xeecb('0x25')](respondWithFilteredResult(_0x4201d5,_0x1c7547))[_0xeecb('0x45')](handleError(_0x4201d5,null));};exports[_0xeecb('0x46')]=function(_0x2b18fc,_0x1a68c7){var _0x1f703c={'raw':![],'where':{'id':_0x2b18fc['params']['id']}},_0xa9d8bc={};_0xa9d8bc[_0xeecb('0x30')]=_['keys'](db[_0xeecb('0x40')]['rawAttributes']);_0xa9d8bc[_0xeecb('0x31')]=_['keys'](_0x2b18fc[_0xeecb('0x31')]);_0xa9d8bc[_0xeecb('0x32')]=_[_0xeecb('0x33')](_0xa9d8bc[_0xeecb('0x30')],_0xa9d8bc['query']);_0x1f703c[_0xeecb('0x34')]=_[_0xeecb('0x33')](_0xa9d8bc[_0xeecb('0x30')],qs[_0xeecb('0x35')](_0x2b18fc[_0xeecb('0x31')][_0xeecb('0x35')]));_0x1f703c[_0xeecb('0x34')]=_0x1f703c[_0xeecb('0x34')]['length']?_0x1f703c[_0xeecb('0x34')]:_0xa9d8bc[_0xeecb('0x30')];if(_0x2b18fc[_0xeecb('0x31')]['includeAll']){_0x1f703c[_0xeecb('0x42')]=[{'all':!![]}];}_0x1f703c=_[_0xeecb('0x3d')]({},_0x1f703c,_0x2b18fc[_0xeecb('0x3f')]);return db[_0xeecb('0x40')][_0xeecb('0x47')](_0x1f703c)['then'](handleEntityNotFound(_0x1a68c7,null))['then'](respondWithResult(_0x1a68c7,null))['catch'](handleError(_0x1a68c7,null));};exports[_0xeecb('0x48')]=function(_0x319a75,_0x114e1a){return db['UserProfileSection']['create'](_0x319a75['body'],{})['then'](respondWithResult(_0x114e1a,0xc9))[_0xeecb('0x45')](handleError(_0x114e1a,null));};exports[_0xeecb('0x24')]=function(_0x5c9808,_0x5159db){if(_0x5c9808[_0xeecb('0x49')]['id']){delete _0x5c9808[_0xeecb('0x49')]['id'];}return db[_0xeecb('0x40')][_0xeecb('0x47')]({'where':{'id':_0x5c9808['params']['id']}})['then'](handleEntityNotFound(_0x5159db,null))[_0xeecb('0x25')](saveUpdates(_0x5c9808[_0xeecb('0x49')],null))['then'](respondWithResult(_0x5159db,null))[_0xeecb('0x45')](handleError(_0x5159db,null));};exports[_0xeecb('0x26')]=function(_0x272e6c,_0x5e940f){return db['UserProfileSection'][_0xeecb('0x47')]({'where':{'id':_0x272e6c[_0xeecb('0x4a')]['id']}})[_0xeecb('0x25')](handleEntityNotFound(_0x5e940f,null))['then'](removeEntity(_0x5e940f,null))[_0xeecb('0x45')](handleError(_0x5e940f,null));};exports[_0xeecb('0x4b')]=function(_0x331b97,_0x228f09){return db[_0xeecb('0x40')][_0xeecb('0x4b')]()[_0xeecb('0x25')](respondWithResult(_0x228f09,null))[_0xeecb('0x45')](handleError(_0x228f09,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 24780fd..5bfe501 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 _0x577a=['rimraf','./userProfileSection.attributes','exports','define','user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash','api','moment','bluebird','request-promise','path'];(function(_0x11fe23,_0xaab54d){var _0x3a3051=function(_0x56b836){while(--_0x56b836){_0x11fe23['push'](_0x11fe23['shift']());}};_0x3a3051(++_0xaab54d);}(_0x577a,0x104));var _0xa577=function(_0x2faddb,_0xc18b78){_0x2faddb=_0x2faddb-0x0;var _0x273c05=_0x577a[_0x2faddb];return _0x273c05;};'use strict';var _=require(_0xa577('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa577('0x1'));var moment=require(_0xa577('0x2'));var BPromise=require(_0xa577('0x3'));var rp=require(_0xa577('0x4'));var fs=require('fs');var path=require(_0xa577('0x5'));var rimraf=require(_0xa577('0x6'));var config=require('../../config/environment');var attributes=require(_0xa577('0x7'));module[_0xa577('0x8')]=function(_0x2db0f0,_0x4991ed){return _0x2db0f0[_0xa577('0x9')]('UserProfileSection',attributes,{'tableName':_0xa577('0xa'),'paranoid':![],'indexes':[{'name':_0xa577('0xb'),'fields':[_0xa577('0xc'),_0xa577('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xae58=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash','util','api'];(function(_0x5a4f34,_0x2d690){var _0xc22b97=function(_0x4c86c8){while(--_0x4c86c8){_0x5a4f34['push'](_0x5a4f34['shift']());}};_0xc22b97(++_0x2d690);}(_0xae58,0x1a6));var _0x8ae5=function(_0x5db99b,_0xdee23a){_0x5db99b=_0x5db99b-0x0;var _0x4b2d0e=_0xae58[_0x5db99b];return _0x4b2d0e;};'use strict';var _=require(_0x8ae5('0x0'));var util=require(_0x8ae5('0x1'));var logger=require('../../config/logger')(_0x8ae5('0x2'));var moment=require(_0x8ae5('0x3'));var BPromise=require(_0x8ae5('0x4'));var rp=require(_0x8ae5('0x5'));var fs=require('fs');var path=require(_0x8ae5('0x6'));var rimraf=require(_0x8ae5('0x7'));var config=require(_0x8ae5('0x8'));var attributes=require(_0x8ae5('0x9'));module[_0x8ae5('0xa')]=function(_0xd636b6,_0x163283){return _0xd636b6[_0x8ae5('0xb')](_0x8ae5('0xc'),attributes,{'tableName':_0x8ae5('0xd'),'paranoid':![],'indexes':[{'name':_0x8ae5('0xe'),'fields':[_0x8ae5('0xf'),_0x8ae5('0x10')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index de0f875..b4b5df8 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 _0x5f6b=['message','result','catch','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x220f3f,_0x11c540){var _0x1f170e=function(_0x2c0ec9){while(--_0x2c0ec9){_0x220f3f['push'](_0x220f3f['shift']());}};_0x1f170e(++_0x11c540);}(_0x5f6b,0x81));var _0xb5f6=function(_0x29f465,_0x349975){_0x29f465=_0x29f465-0x0;var _0x79272a=_0x5f6b[_0x29f465];return _0x79272a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb5f6('0x0'));var BPromise=require(_0xb5f6('0x1'));var rs=require(_0xb5f6('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb5f6('0x3'));var logger=require(_0xb5f6('0x4'))('rpc');var config=require(_0xb5f6('0x5'));var jayson=require(_0xb5f6('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x336add,_0xf054d,_0x462d1e){return new BPromise(function(_0x419b52,_0x9b2748){return client['request'](_0x336add,_0x462d1e)[_0xb5f6('0x7')](function(_0x301026){logger[_0xb5f6('0x8')](_0xb5f6('0x9'),_0xf054d,_0xb5f6('0xa'));logger['debug'](_0xb5f6('0xb'),_0xf054d,_0xb5f6('0xa'),JSON[_0xb5f6('0xc')](_0x301026));if(_0x301026['error']){if(_0x301026[_0xb5f6('0xd')][_0xb5f6('0xe')]===0x1f4){logger[_0xb5f6('0xd')](_0xb5f6('0x9'),_0xf054d,_0x301026[_0xb5f6('0xd')][_0xb5f6('0xf')]);return _0x9b2748(_0x301026[_0xb5f6('0xd')][_0xb5f6('0xf')]);}logger[_0xb5f6('0xd')]('UserProfileSection,\x20%s,\x20%s',_0xf054d,_0x301026[_0xb5f6('0xd')][_0xb5f6('0xf')]);return _0x419b52(_0x301026['error'][_0xb5f6('0xf')]);}else{logger[_0xb5f6('0x8')]('UserProfileSection,\x20%s,\x20%s',_0xf054d,'request\x20sent');_0x419b52(_0x301026[_0xb5f6('0x10')][_0xb5f6('0xf')]);}})[_0xb5f6('0x11')](function(_0x2776c2){logger[_0xb5f6('0xd')](_0xb5f6('0x9'),_0xf054d,_0x2776c2);_0x9b2748(_0x2776c2);});});} \ No newline at end of file +var _0x5f7b=['rpc','jayson/promise','client','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x48c5bb,_0x5e68fe){var _0x2f3abf=function(_0x3f6960){while(--_0x3f6960){_0x48c5bb['push'](_0x48c5bb['shift']());}};_0x2f3abf(++_0x5e68fe);}(_0x5f7b,0x19c));var _0xb5f7=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x5f7b[_0x27af45];return _0x18df21;};'use strict';var _=require('lodash');var util=require(_0xb5f7('0x0'));var moment=require(_0xb5f7('0x1'));var BPromise=require(_0xb5f7('0x2'));var rs=require(_0xb5f7('0x3'));var fs=require('fs');var Redis=require(_0xb5f7('0x4'));var db=require(_0xb5f7('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb5f7('0x6'));var config=require('../../config/environment');var jayson=require(_0xb5f7('0x7'));var client=jayson[_0xb5f7('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xba4285,_0x2c39fa,_0x33c402){return new BPromise(function(_0x1008c5,_0x1d52cb){return client[_0xb5f7('0x9')](_0xba4285,_0x33c402)[_0xb5f7('0xa')](function(_0x37f693){logger[_0xb5f7('0xb')](_0xb5f7('0xc'),_0x2c39fa,_0xb5f7('0xd'));logger['debug']('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x2c39fa,_0xb5f7('0xd'),JSON[_0xb5f7('0xe')](_0x37f693));if(_0x37f693['error']){if(_0x37f693[_0xb5f7('0xf')][_0xb5f7('0x10')]===0x1f4){logger[_0xb5f7('0xf')](_0xb5f7('0xc'),_0x2c39fa,_0x37f693['error'][_0xb5f7('0x11')]);return _0x1d52cb(_0x37f693[_0xb5f7('0xf')][_0xb5f7('0x11')]);}logger[_0xb5f7('0xf')](_0xb5f7('0xc'),_0x2c39fa,_0x37f693[_0xb5f7('0xf')][_0xb5f7('0x11')]);return _0x1008c5(_0x37f693[_0xb5f7('0xf')]['message']);}else{logger['info'](_0xb5f7('0xc'),_0x2c39fa,'request\x20sent');_0x1008c5(_0x37f693['result'][_0xb5f7('0x11')]);}})[_0xb5f7('0x12')](function(_0x17f71c){logger[_0xb5f7('0xf')](_0xb5f7('0xc'),_0x2c39fa,_0x17f71c);_0x1d52cb(_0x17f71c);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index d61a675..38f91c2 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x14a828,_0x544491){var _0x1d4621=function(_0x8704e9){while(--_0x8704e9){_0x14a828['push'](_0x14a828['shift']());}};_0x1d4621(++_0x544491);}(_0x70e0,0x17b));var _0x070e=function(_0x571e95,_0x426b7f){_0x571e95=_0x571e95-0x0;var _0x59ce87=_0x70e0[_0x571e95];return _0x59ce87;};'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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x351848,_0x348c3d){var _0x20864b=function(_0x1ecb9a){while(--_0x1ecb9a){_0x351848['push'](_0x351848['shift']());}};_0x20864b(++_0x348c3d);}(_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/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 54d75f8..816de32 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 _0xf88b=['exports','INTEGER','sequelize'];(function(_0x5275c3,_0x10a381){var _0xc47266=function(_0x1789f4){while(--_0x1789f4){_0x5275c3['push'](_0x5275c3['shift']());}};_0xc47266(++_0x10a381);}(_0xf88b,0x1a6));var _0xbf88=function(_0xe68309,_0x3ce8a0){_0xe68309=_0xe68309-0x0;var _0x373dd2=_0xf88b[_0xe68309];return _0x373dd2;};'use strict';var Sequelize=require(_0xbf88('0x0'));module[_0xbf88('0x1')]={'penalty':{'type':Sequelize[_0xbf88('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc164=['exports','INTEGER'];(function(_0x106214,_0x454b8d){var _0x5f5cea=function(_0x247841){while(--_0x247841){_0x106214['push'](_0x106214['shift']());}};_0x5f5cea(++_0x454b8d);}(_0xc164,0x18e));var _0x4c16=function(_0x3ca215,_0x3ba4a1){_0x3ca215=_0x3ca215-0x0;var _0x4b6c32=_0xc164[_0x3ca215];return _0x4b6c32;};'use strict';var Sequelize=require('sequelize');module[_0x4c16('0x0')]={'penalty':{'type':Sequelize[_0x4c16('0x1')],'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 959061b..b381edf 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 _0x1261=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes','define','user_has_sms_queues'];(function(_0x310f99,_0x12c02b){var _0x15b0a4=function(_0x2ca0ce){while(--_0x2ca0ce){_0x310f99['push'](_0x310f99['shift']());}};_0x15b0a4(++_0x12c02b);}(_0x1261,0x144));var _0x1126=function(_0x59d32c,_0x306b7a){_0x59d32c=_0x59d32c-0x0;var _0x26e818=_0x1261[_0x59d32c];return _0x26e818;};'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')]('UserSmsQueue',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf494=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports','define','lodash','util'];(function(_0x55f9f4,_0x5e17bc){var _0x362efb=function(_0x163a62){while(--_0x163a62){_0x55f9f4['push'](_0x55f9f4['shift']());}};_0x362efb(++_0x5e17bc);}(_0xf494,0x1c6));var _0x4f49=function(_0x229426,_0x44d9aa){_0x229426=_0x229426-0x0;var _0x140725=_0xf494[_0x229426];return _0x140725;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var logger=require(_0x4f49('0x2'))('api');var moment=require(_0x4f49('0x3'));var BPromise=require(_0x4f49('0x4'));var rp=require(_0x4f49('0x5'));var fs=require('fs');var path=require(_0x4f49('0x6'));var rimraf=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var attributes=require(_0x4f49('0x9'));module[_0x4f49('0xa')]=function(_0xc5e778,_0x413530){return _0xc5e778[_0x4f49('0xb')]('UserSmsQueue',attributes,{'tableName':'user_has_sms_queues','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 23829be..0ebbf6c 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 _0xfc7d=['ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','bluebird','randomstring'];(function(_0x10edeb,_0x1b93b8){var _0x1c5fea=function(_0x16a1c5){while(--_0x16a1c5){_0x10edeb['push'](_0x10edeb['shift']());}};_0x1c5fea(++_0x1b93b8);}(_0xfc7d,0x19e));var _0xdfc7=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xfc7d[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0xdfc7('0x0'));var util=require(_0xdfc7('0x1'));var moment=require('moment');var BPromise=require(_0xdfc7('0x2'));var rs=require(_0xdfc7('0x3'));var fs=require('fs');var Redis=require(_0xdfc7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xdfc7('0x5'));var logger=require('../../config/logger')(_0xdfc7('0x6'));var config=require(_0xdfc7('0x7'));var jayson=require(_0xdfc7('0x8'));var client=jayson[_0xdfc7('0x9')][_0xdfc7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x38b0a2,_0x3392b6,_0x1af75c){return new BPromise(function(_0x151236,_0x3a71e4){return client[_0xdfc7('0xb')](_0x38b0a2,_0x1af75c)[_0xdfc7('0xc')](function(_0x179f16){logger[_0xdfc7('0xd')](_0xdfc7('0xe'),_0x3392b6,_0xdfc7('0xf'));logger[_0xdfc7('0x10')](_0xdfc7('0x11'),_0x3392b6,_0xdfc7('0xf'),JSON[_0xdfc7('0x12')](_0x179f16));if(_0x179f16[_0xdfc7('0x13')]){if(_0x179f16[_0xdfc7('0x13')]['code']===0x1f4){logger['error'](_0xdfc7('0xe'),_0x3392b6,_0x179f16[_0xdfc7('0x13')]['message']);return _0x3a71e4(_0x179f16['error'][_0xdfc7('0x14')]);}logger['error'](_0xdfc7('0xe'),_0x3392b6,_0x179f16[_0xdfc7('0x13')]['message']);return _0x151236(_0x179f16['error'][_0xdfc7('0x14')]);}else{logger['info'](_0xdfc7('0xe'),_0x3392b6,_0xdfc7('0xf'));_0x151236(_0x179f16['result'][_0xdfc7('0x14')]);}})[_0xdfc7('0x15')](function(_0x330fc9){logger[_0xdfc7('0x13')]('UserSmsQueue,\x20%s,\x20%s',_0x3392b6,_0x330fc9);_0x3a71e4(_0x330fc9);});});} \ No newline at end of file +var _0xe721=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','error','message','catch','lodash'];(function(_0x103730,_0x40a1a6){var _0x4d66a2=function(_0x4aabbe){while(--_0x4aabbe){_0x103730['push'](_0x103730['shift']());}};_0x4d66a2(++_0x40a1a6);}(_0xe721,0x6d));var _0x1e72=function(_0x3dab7b,_0x516920){_0x3dab7b=_0x3dab7b-0x0;var _0x2223a0=_0xe721[_0x3dab7b];return _0x2223a0;};'use strict';var _=require(_0x1e72('0x0'));var util=require(_0x1e72('0x1'));var moment=require(_0x1e72('0x2'));var BPromise=require(_0x1e72('0x3'));var rs=require(_0x1e72('0x4'));var fs=require('fs');var Redis=require(_0x1e72('0x5'));var db=require(_0x1e72('0x6'))['db'];var utils=require(_0x1e72('0x7'));var logger=require(_0x1e72('0x8'))(_0x1e72('0x9'));var config=require(_0x1e72('0xa'));var jayson=require(_0x1e72('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x128fa7,_0x3411f2,_0x2ba44b){return new BPromise(function(_0xa491d3,_0x332ec9){return client[_0x1e72('0xc')](_0x128fa7,_0x2ba44b)[_0x1e72('0xd')](function(_0x14f6eb){logger[_0x1e72('0xe')](_0x1e72('0xf'),_0x3411f2,_0x1e72('0x10'));logger[_0x1e72('0x11')](_0x1e72('0x12'),_0x3411f2,_0x1e72('0x10'),JSON['stringify'](_0x14f6eb));if(_0x14f6eb['error']){if(_0x14f6eb[_0x1e72('0x13')]['code']===0x1f4){logger[_0x1e72('0x13')](_0x1e72('0xf'),_0x3411f2,_0x14f6eb[_0x1e72('0x13')][_0x1e72('0x14')]);return _0x332ec9(_0x14f6eb[_0x1e72('0x13')]['message']);}logger[_0x1e72('0x13')](_0x1e72('0xf'),_0x3411f2,_0x14f6eb['error'][_0x1e72('0x14')]);return _0xa491d3(_0x14f6eb[_0x1e72('0x13')][_0x1e72('0x14')]);}else{logger[_0x1e72('0xe')]('UserSmsQueue,\x20%s,\x20%s',_0x3411f2,_0x1e72('0x10'));_0xa491d3(_0x14f6eb['result']['message']);}})[_0x1e72('0x15')](function(_0x265309){logger[_0x1e72('0x13')](_0x1e72('0xf'),_0x3411f2,_0x265309);_0x332ec9(_0x265309);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index bfda041..e395e55 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0xfe5403,_0x1628b1){var _0x2d1e48=function(_0x71342){while(--_0x71342){_0xfe5403['push'](_0xfe5403['shift']());}};_0x2d1e48(++_0x1628b1);}(_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(_0x52cafe,_0x41d4dc){var _0x54636b=function(_0x137d21){while(--_0x137d21){_0x52cafe['push'](_0x52cafe['shift']());}};_0x54636b(++_0x41d4dc);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'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/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 5df165e..a2ac32f 100644 --- a/server/api/userVoiceQueue/userVoiceQueue.attributes.js +++ b/server/api/userVoiceQueue/userVoiceQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6c41=['exports','INTEGER','sequelize'];(function(_0x182593,_0x2b7efc){var _0x38eeaf=function(_0x1c8e08){while(--_0x1c8e08){_0x182593['push'](_0x182593['shift']());}};_0x38eeaf(++_0x2b7efc);}(_0x6c41,0x98));var _0x16c4=function(_0x40d8d7,_0x30dd5e){_0x40d8d7=_0x40d8d7-0x0;var _0x3454cc=_0x6c41[_0x40d8d7];return _0x3454cc;};'use strict';var Sequelize=require(_0x16c4('0x0'));module[_0x16c4('0x1')]={'penalty':{'type':Sequelize[_0x16c4('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd10b=['exports','sequelize'];(function(_0x5678b5,_0x1c4aa8){var _0x4c09a5=function(_0x2aa89a){while(--_0x2aa89a){_0x5678b5['push'](_0x5678b5['shift']());}};_0x4c09a5(++_0x1c4aa8);}(_0xd10b,0xd7));var _0xbd10=function(_0x1d421c,_0x1fa86f){_0x1d421c=_0x1d421c-0x0;var _0x56e9ab=_0xd10b[_0x1d421c];return _0x56e9ab;};'use strict';var Sequelize=require(_0xbd10('0x0'));module[_0xbd10('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'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 5e45923..d7e32b1 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 _0x98cc=['exports','define','UserVoiceQueue','user_has_voice_queues','../../config/logger','api','request-promise','path'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x98cc,0x84));var _0xc98c=function(_0x5a7cbc,_0x573d85){_0x5a7cbc=_0x5a7cbc-0x0;var _0x44d2cc=_0x98cc[_0x5a7cbc];return _0x44d2cc;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc98c('0x0'))(_0xc98c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc98c('0x2'));var fs=require('fs');var path=require(_0xc98c('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./userVoiceQueue.attributes');module[_0xc98c('0x4')]=function(_0xd7b61c,_0x25ec01){return _0xd7b61c[_0xc98c('0x5')](_0xc98c('0x6'),attributes,{'tableName':_0xc98c('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x88d7=['moment','request-promise','path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','UserVoiceQueue','lodash','util','../../config/logger','api'];(function(_0x5abc1e,_0x8715e7){var _0x3423d1=function(_0x34055b){while(--_0x34055b){_0x5abc1e['push'](_0x5abc1e['shift']());}};_0x3423d1(++_0x8715e7);}(_0x88d7,0xf3));var _0x788d=function(_0x396541,_0x250da2){_0x396541=_0x396541-0x0;var _0x29ba94=_0x88d7[_0x396541];return _0x29ba94;};'use strict';var _=require(_0x788d('0x0'));var util=require(_0x788d('0x1'));var logger=require(_0x788d('0x2'))(_0x788d('0x3'));var moment=require(_0x788d('0x4'));var BPromise=require('bluebird');var rp=require(_0x788d('0x5'));var fs=require('fs');var path=require(_0x788d('0x6'));var rimraf=require(_0x788d('0x7'));var config=require(_0x788d('0x8'));var attributes=require(_0x788d('0x9'));module[_0x788d('0xa')]=function(_0x4c32e5,_0x2baf97){return _0x4c32e5[_0x788d('0xb')](_0x788d('0xc'),attributes,{'tableName':'user_has_voice_queues','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 79d576c..9ce6c37 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 _0x7660=['../../config/logger','rpc','jayson/promise','client','http','request','info','request\x20sent','UserVoiceQueue,\x20%s,\x20%s,\x20%s','error','message','UserVoiceQueue,\x20%s,\x20%s','result','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x10ecc9,_0x3e0f55){var _0x244ac9=function(_0x56bcdf){while(--_0x56bcdf){_0x10ecc9['push'](_0x10ecc9['shift']());}};_0x244ac9(++_0x3e0f55);}(_0x7660,0x105));var _0x0766=function(_0x1927d7,_0x4a9be6){_0x1927d7=_0x1927d7-0x0;var _0x2a73f5=_0x7660[_0x1927d7];return _0x2a73f5;};'use strict';var _=require(_0x0766('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0766('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0766('0x2'));var db=require(_0x0766('0x3'))['db'];var utils=require(_0x0766('0x4'));var logger=require(_0x0766('0x5'))(_0x0766('0x6'));var config=require('../../config/environment');var jayson=require(_0x0766('0x7'));var client=jayson[_0x0766('0x8')][_0x0766('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x395f2b,_0x15c4ed,_0x37634c){return new BPromise(function(_0x13ac31,_0x53dba3){return client[_0x0766('0xa')](_0x395f2b,_0x37634c)['then'](function(_0x38a69b){logger[_0x0766('0xb')]('UserVoiceQueue,\x20%s,\x20%s',_0x15c4ed,_0x0766('0xc'));logger['debug'](_0x0766('0xd'),_0x15c4ed,_0x0766('0xc'),JSON['stringify'](_0x38a69b));if(_0x38a69b[_0x0766('0xe')]){if(_0x38a69b[_0x0766('0xe')]['code']===0x1f4){logger[_0x0766('0xe')]('UserVoiceQueue,\x20%s,\x20%s',_0x15c4ed,_0x38a69b[_0x0766('0xe')]['message']);return _0x53dba3(_0x38a69b[_0x0766('0xe')][_0x0766('0xf')]);}logger[_0x0766('0xe')]('UserVoiceQueue,\x20%s,\x20%s',_0x15c4ed,_0x38a69b['error']['message']);return _0x13ac31(_0x38a69b[_0x0766('0xe')][_0x0766('0xf')]);}else{logger['info'](_0x0766('0x10'),_0x15c4ed,'request\x20sent');_0x13ac31(_0x38a69b[_0x0766('0x11')]['message']);}})[_0x0766('0x12')](function(_0x228a0a){logger[_0x0766('0xe')](_0x0766('0x10'),_0x15c4ed,_0x228a0a);_0x53dba3(_0x228a0a);});});} \ No newline at end of file +var _0x9828=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','util','bluebird'];(function(_0x342982,_0x3521ad){var _0x1cb461=function(_0x2a2e4d){while(--_0x2a2e4d){_0x342982['push'](_0x342982['shift']());}};_0x1cb461(++_0x3521ad);}(_0x9828,0x91));var _0x8982=function(_0x228f85,_0x317516){_0x228f85=_0x228f85-0x0;var _0x391f54=_0x9828[_0x228f85];return _0x391f54;};'use strict';var _=require('lodash');var util=require(_0x8982('0x0'));var moment=require('moment');var BPromise=require(_0x8982('0x1'));var rs=require(_0x8982('0x2'));var fs=require('fs');var Redis=require(_0x8982('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8982('0x4'));var logger=require(_0x8982('0x5'))(_0x8982('0x6'));var config=require(_0x8982('0x7'));var jayson=require(_0x8982('0x8'));var client=jayson[_0x8982('0x9')][_0x8982('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x45d034,_0x1110fa,_0x501e73){return new BPromise(function(_0x19c942,_0x41ac55){return client[_0x8982('0xb')](_0x45d034,_0x501e73)[_0x8982('0xc')](function(_0x4a12dc){logger['info'](_0x8982('0xd'),_0x1110fa,_0x8982('0xe'));logger[_0x8982('0xf')](_0x8982('0x10'),_0x1110fa,_0x8982('0xe'),JSON[_0x8982('0x11')](_0x4a12dc));if(_0x4a12dc['error']){if(_0x4a12dc['error']['code']===0x1f4){logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x1110fa,_0x4a12dc[_0x8982('0x12')]['message']);return _0x41ac55(_0x4a12dc[_0x8982('0x12')][_0x8982('0x13')]);}logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x1110fa,_0x4a12dc[_0x8982('0x12')]['message']);return _0x19c942(_0x4a12dc[_0x8982('0x12')][_0x8982('0x13')]);}else{logger[_0x8982('0x14')](_0x8982('0xd'),_0x1110fa,'request\x20sent');_0x19c942(_0x4a12dc['result'][_0x8982('0x13')]);}})['catch'](function(_0x12d4c7){logger[_0x8982('0x12')](_0x8982('0xd'),_0x1110fa,_0x12d4c7);_0x41ac55(_0x12d4c7);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 508f2a2..b234b5d 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x34bd12,_0x5d62e9){var _0xb50065=function(_0x2ac514){while(--_0x2ac514){_0x34bd12['push'](_0x34bd12['shift']());}};_0xb50065(++_0x5d62e9);}(_0xedd9,0xfc));var _0x9edd=function(_0x1760ad,_0x9729b1){_0x1760ad=_0x1760ad-0x0;var _0x8fc3ec=_0xedd9[_0x1760ad];return _0x8fc3ec;};'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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x37f8d1,_0x1ccecd){var _0xf50b05=function(_0x4b1b6e){while(--_0x4b1b6e){_0x37f8d1['push'](_0x37f8d1['shift']());}};_0xf50b05(++_0x1ccecd);}(_0xedd9,0xfc));var _0x9edd=function(_0x44fb02,_0x16bdbc){_0x44fb02=_0x44fb02-0x0;var _0x4d3aaa=_0xedd9[_0x44fb02];return _0x4d3aaa;};'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 diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index eabff7a..b9cdea8 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 _0x08b6=['Required\x20by\x20Asterisk','STRING','queue_interface','sequelize','INTEGER'];(function(_0x74892f,_0x1e981b){var _0x10ee61=function(_0x3c480a){while(--_0x3c480a){_0x74892f['push'](_0x74892f['shift']());}};_0x10ee61(++_0x1e981b);}(_0x08b6,0x1c0));var _0x608b=function(_0x1fe7db,_0x45658b){_0x1fe7db=_0x1fe7db-0x0;var _0x4c0702=_0x08b6[_0x1fe7db];return _0x4c0702;};'use strict';var Sequelize=require(_0x608b('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x608b('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x608b('0x2')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0x608b('0x2')},'UserId':{'type':Sequelize[_0x608b('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x608b('0x3')],'allowNull':![],'unique':_0x608b('0x4'),'comment':_0x608b('0x2')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0x608b('0x3')],'allowNull':![],'unique':_0x608b('0x4'),'comment':_0x608b('0x2')},'penalty':{'type':Sequelize[_0x608b('0x1')](0xb),'defaultValue':0x0,'comment':_0x608b('0x2')},'paused':{'type':Sequelize[_0x608b('0x1')](0xb),'defaultValue':0x0,'comment':_0x608b('0x2')}}; \ No newline at end of file +var _0xade4=['STRING','INTEGER','queue_interface','sequelize','exports','Required\x20by\x20Asterisk'];(function(_0x4f0c20,_0x35af92){var _0x292ec5=function(_0x4c83bb){while(--_0x4c83bb){_0x4f0c20['push'](_0x4f0c20['shift']());}};_0x292ec5(++_0x35af92);}(_0xade4,0x159));var _0x4ade=function(_0x5971b6,_0x424215){_0x5971b6=_0x5971b6-0x0;var _0x2cb11a=_0xade4[_0x5971b6];return _0x2cb11a;};'use strict';var Sequelize=require(_0x4ade('0x0'));module[_0x4ade('0x1')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0x4ade('0x2')},'membername':{'type':Sequelize[_0x4ade('0x3')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0x4ade('0x4')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'queue_interface','comment':_0x4ade('0x2')},'VoiceQueueId':{'type':Sequelize[_0x4ade('0x4')],'allowNull':![]},'interface':{'type':Sequelize[_0x4ade('0x3')],'allowNull':![],'unique':_0x4ade('0x5'),'comment':_0x4ade('0x2')},'penalty':{'type':Sequelize[_0x4ade('0x4')](0xb),'defaultValue':0x0,'comment':_0x4ade('0x2')},'paused':{'type':Sequelize[_0x4ade('0x4')](0xb),'defaultValue':0x0,'comment':_0x4ade('0x2')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index bade73c..5c0bb79 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 _0x2ded=['hasOwnProperty','hook','exports','events','UserVoiceQueueRt','setMaxListeners','remove','emit'];(function(_0x41486a,_0x38a637){var _0x4bf6d8=function(_0x2a237e){while(--_0x2a237e){_0x41486a['push'](_0x41486a['shift']());}};_0x4bf6d8(++_0x38a637);}(_0x2ded,0x11b));var _0xd2de=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2ded[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xd2de('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db'][_0xd2de('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xd2de('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xd2de('0x3')};function emitEvent(_0x5be16e){return function(_0x2e7559,_0x1fbe36,_0x2702b1){UserVoiceQueueRtEvents[_0xd2de('0x4')](_0x5be16e+':'+_0x2e7559['id'],_0x2e7559);UserVoiceQueueRtEvents[_0xd2de('0x4')](_0x5be16e,_0x2e7559);_0x2702b1(null);};}for(var e in events){if(events[_0xd2de('0x5')](e)){var event=events[e];UserVoiceQueueRt[_0xd2de('0x6')](e,emitEvent(event));}}module[_0xd2de('0x7')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0xd830=['hasOwnProperty','hook','exports','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save','emit'];(function(_0x4a325a,_0x2c154c){var _0x2597a1=function(_0x437af3){while(--_0x437af3){_0x4a325a['push'](_0x4a325a['shift']());}};_0x2597a1(++_0x2c154c);}(_0xd830,0xa5));var _0x0d83=function(_0xc39bda,_0x3faa1b){_0xc39bda=_0xc39bda-0x0;var _0x195261=_0xd830[_0xc39bda];return _0x195261;};'use strict';var EventEmitter=require(_0x0d83('0x0'));var UserVoiceQueueRt=require(_0x0d83('0x1'))['db'][_0x0d83('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x0d83('0x3')](0x0);var events={'afterCreate':_0x0d83('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x49e05c){return function(_0x1d5a14,_0x22bd04,_0x2a7cab){UserVoiceQueueRtEvents[_0x0d83('0x5')](_0x49e05c+':'+_0x1d5a14['id'],_0x1d5a14);UserVoiceQueueRtEvents[_0x0d83('0x5')](_0x49e05c,_0x1d5a14);_0x2a7cab(null);};}for(var e in events){if(events[_0x0d83('0x6')](e)){var event=events[e];UserVoiceQueueRt[_0x0d83('0x7')](e,emitEvent(event));}}module[_0x0d83('0x8')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 7ece5c4..d38aa2f 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 _0x05a6=['lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','UserVoiceQueueRt','user_has_voice_queues_rt'];(function(_0x109f62,_0x2a1093){var _0x2ac0cc=function(_0x2cf0da){while(--_0x2cf0da){_0x109f62['push'](_0x109f62['shift']());}};_0x2ac0cc(++_0x2a1093);}(_0x05a6,0x1b8));var _0x605a=function(_0x313c96,_0x3cee6e){_0x313c96=_0x313c96-0x0;var _0x522f53=_0x05a6[_0x313c96];return _0x522f53;};'use strict';var _=require(_0x605a('0x0'));var util=require(_0x605a('0x1'));var logger=require('../../config/logger')(_0x605a('0x2'));var moment=require(_0x605a('0x3'));var BPromise=require(_0x605a('0x4'));var rp=require(_0x605a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x605a('0x6'));var config=require(_0x605a('0x7'));var attributes=require('./userVoiceQueueRt.attributes');module['exports']=function(_0x55b5a9,_0x192299){return _0x55b5a9['define'](_0x605a('0x8'),attributes,{'tableName':_0x605a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8848=['rimraf','./userVoiceQueueRt.attributes','exports','UserVoiceQueueRt','user_has_voice_queues_rt','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5cb834,_0x1e3619){var _0x418cd5=function(_0x440d79){while(--_0x440d79){_0x5cb834['push'](_0x5cb834['shift']());}};_0x418cd5(++_0x1e3619);}(_0x8848,0x149));var _0x8884=function(_0xd0a847,_0x72562b){_0xd0a847=_0xd0a847-0x0;var _0x2536ec=_0x8848[_0xd0a847];return _0x2536ec;};'use strict';var _=require('lodash');var util=require(_0x8884('0x0'));var logger=require(_0x8884('0x1'))(_0x8884('0x2'));var moment=require(_0x8884('0x3'));var BPromise=require(_0x8884('0x4'));var rp=require(_0x8884('0x5'));var fs=require('fs');var path=require(_0x8884('0x6'));var rimraf=require(_0x8884('0x7'));var config=require('../../config/environment');var attributes=require(_0x8884('0x8'));module[_0x8884('0x9')]=function(_0x124c9a,_0xea6217){return _0x124c9a['define'](_0x8884('0xa'),attributes,{'tableName':_0x8884('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 e34d289..ee2038b 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 _0x277b=['error','code','message','result','UserVoiceQueueRt','options','raw','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','GetVoiceQueueRtPauses','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./userVoiceQueueRt.socket','register','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0x277b,0x12d));var _0xb277=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x277b[_0x11005e];return _0x29338f;};'use strict';var _=require(_0xb277('0x0'));var util=require(_0xb277('0x1'));var moment=require(_0xb277('0x2'));var BPromise=require(_0xb277('0x3'));var rs=require(_0xb277('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb277('0x5'));var logger=require(_0xb277('0x6'))(_0xb277('0x7'));var config=require(_0xb277('0x8'));var jayson=require(_0xb277('0x9'));var client=jayson[_0xb277('0xa')][_0xb277('0xb')]({'port':0x232a});config[_0xb277('0xc')]=_[_0xb277('0xd')](config[_0xb277('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xb277('0xe'))(new Redis(config[_0xb277('0xc')]));require(_0xb277('0xf'))[_0xb277('0x10')](socket);function respondWithRpcPromise(_0x3bfb44,_0x26ef7e,_0x1cc7e7){return new BPromise(function(_0x25efa3,_0x12b14b){return client['request'](_0x3bfb44,_0x1cc7e7)[_0xb277('0x11')](function(_0x359667){logger[_0xb277('0x12')](_0xb277('0x13'),_0x26ef7e,_0xb277('0x14'));logger['debug'](_0xb277('0x15'),_0x26ef7e,_0xb277('0x14'),JSON[_0xb277('0x16')](_0x359667));if(_0x359667[_0xb277('0x17')]){if(_0x359667[_0xb277('0x17')][_0xb277('0x18')]===0x1f4){logger['error'](_0xb277('0x13'),_0x26ef7e,_0x359667[_0xb277('0x17')][_0xb277('0x19')]);return _0x12b14b(_0x359667[_0xb277('0x17')]['message']);}logger[_0xb277('0x17')](_0xb277('0x13'),_0x26ef7e,_0x359667[_0xb277('0x17')][_0xb277('0x19')]);return _0x25efa3(_0x359667[_0xb277('0x17')][_0xb277('0x19')]);}else{logger[_0xb277('0x12')](_0xb277('0x13'),_0x26ef7e,_0xb277('0x14'));_0x25efa3(_0x359667[_0xb277('0x1a')][_0xb277('0x19')]);}})['catch'](function(_0x137470){logger[_0xb277('0x17')](_0xb277('0x13'),_0x26ef7e,_0x137470);_0x12b14b(_0x137470);});});}exports['GetVoiceQueueRtPauses']=function(_0x36698a){var _0x4c28e1=this;return new Promise(function(_0x389265,_0x1f5609){return db[_0xb277('0x1b')]['findAll']({'raw':_0x36698a[_0xb277('0x1c')]?_0x36698a['options'][_0xb277('0x1d')]===undefined?!![]:![]:!![],'where':_0x36698a[_0xb277('0x1c')]?_0x36698a['options']['where']||null:null,'attributes':[[db[_0xb277('0x1e')]['fn']('COUNT',db[_0xb277('0x1e')]['fn']('IF',db[_0xb277('0x1e')][_0xb277('0x1f')](_0xb277('0x20')))),_0xb277('0x21')]]})[_0xb277('0x11')](function(_0x5b5ada){logger['info'](_0xb277('0x22'),_0x36698a);logger['debug'](_0xb277('0x22'),_0x36698a,JSON[_0xb277('0x16')](_0x5b5ada));_0x389265(_0x5b5ada);})[_0xb277('0x23')](function(_0x49c8ec){logger['error'](_0xb277('0x22'),_0x49c8ec['message'],_0x36698a);_0x1f5609(_0x4c28e1['error'](0x1f4,_0x49c8ec[_0xb277('0x19')]));});});}; \ No newline at end of file +var _0x99a3=['options','where','COUNT','sequelize','outboundQueuePauses','stringify','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','./userVoiceQueueRt.socket','request','then','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','error','code','message','info','result','GetVoiceQueueRtPauses','findAll'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x99a3,0x97));var _0x399a=function(_0x332339,_0x3a98e1){_0x332339=_0x332339-0x0;var _0x2d78e9=_0x99a3[_0x332339];return _0x2d78e9;};'use strict';var _=require(_0x399a('0x0'));var util=require(_0x399a('0x1'));var moment=require(_0x399a('0x2'));var BPromise=require(_0x399a('0x3'));var rs=require(_0x399a('0x4'));var fs=require('fs');var Redis=require(_0x399a('0x5'));var db=require(_0x399a('0x6'))['db'];var utils=require(_0x399a('0x7'));var logger=require(_0x399a('0x8'))(_0x399a('0x9'));var config=require(_0x399a('0xa'));var jayson=require(_0x399a('0xb'));var client=jayson[_0x399a('0xc')]['http']({'port':0x232a});config[_0x399a('0xd')]=_[_0x399a('0xe')](config[_0x399a('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x399a('0xd')]));require(_0x399a('0xf'))['register'](socket);function respondWithRpcPromise(_0x5aeb1c,_0x40018b,_0x592939){return new BPromise(function(_0x5e5cb7,_0x207592){return client[_0x399a('0x10')](_0x5aeb1c,_0x592939)[_0x399a('0x11')](function(_0x45092c){logger['info'](_0x399a('0x12'),_0x40018b,_0x399a('0x13'));logger[_0x399a('0x14')](_0x399a('0x15'),_0x40018b,_0x399a('0x13'),JSON['stringify'](_0x45092c));if(_0x45092c[_0x399a('0x16')]){if(_0x45092c[_0x399a('0x16')][_0x399a('0x17')]===0x1f4){logger[_0x399a('0x16')](_0x399a('0x12'),_0x40018b,_0x45092c[_0x399a('0x16')][_0x399a('0x18')]);return _0x207592(_0x45092c[_0x399a('0x16')][_0x399a('0x18')]);}logger[_0x399a('0x16')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x40018b,_0x45092c[_0x399a('0x16')]['message']);return _0x5e5cb7(_0x45092c[_0x399a('0x16')][_0x399a('0x18')]);}else{logger[_0x399a('0x19')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x40018b,_0x399a('0x13'));_0x5e5cb7(_0x45092c[_0x399a('0x1a')]['message']);}})['catch'](function(_0x5af35f){logger['error'](_0x399a('0x12'),_0x40018b,_0x5af35f);_0x207592(_0x5af35f);});});}exports[_0x399a('0x1b')]=function(_0x4afb58){var _0x3de950=this;return new Promise(function(_0xd31b21,_0x2b2c24){return db['UserVoiceQueueRt'][_0x399a('0x1c')]({'raw':_0x4afb58['options']?_0x4afb58[_0x399a('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x4afb58[_0x399a('0x1d')]?_0x4afb58['options'][_0x399a('0x1e')]||null:null,'attributes':[[db['sequelize']['fn'](_0x399a('0x1f'),db[_0x399a('0x20')]['fn']('IF',db[_0x399a('0x20')]['literal']('`paused`\x20=\x201,\x201,\x20null'))),_0x399a('0x21')]]})[_0x399a('0x11')](function(_0x26e020){logger[_0x399a('0x19')](_0x399a('0x1b'),_0x4afb58);logger[_0x399a('0x14')](_0x399a('0x1b'),_0x4afb58,JSON[_0x399a('0x22')](_0x26e020));_0xd31b21(_0x26e020);})[_0x399a('0x23')](function(_0x1da8dd){logger['error'](_0x399a('0x1b'),_0x1da8dd[_0x399a('0x18')],_0x4afb58);_0x2b2c24(_0x3de950['error'](0x1f4,_0x1da8dd['message']));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 43864fa..8c18fe7 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 _0x0619=['./userVoiceQueueRt.events','save','remove','update','emit','removeListener','register','length'];(function(_0x4fe77d,_0xaad1f1){var _0x296a48=function(_0x444659){while(--_0x444659){_0x4fe77d['push'](_0x4fe77d['shift']());}};_0x296a48(++_0xaad1f1);}(_0x0619,0x90));var _0x9061=function(_0x559cfc,_0x269649){_0x559cfc=_0x559cfc-0x0;var _0x219933=_0x0619[_0x559cfc];return _0x219933;};'use strict';var UserVoiceQueueRtEvents=require(_0x9061('0x0'));var events=[_0x9061('0x1'),_0x9061('0x2'),_0x9061('0x3')];function createListener(_0x4f2ab6,_0x3a207b){return function(_0x69e4c){_0x3a207b[_0x9061('0x4')](_0x4f2ab6,_0x69e4c);};}function removeListener(_0x1384a7,_0x1bc8ce){return function(){UserVoiceQueueRtEvents[_0x9061('0x5')](_0x1384a7,_0x1bc8ce);};}exports[_0x9061('0x6')]=function(_0x3a79a8){for(var _0xac2b69=0x0,_0x259fbd=events[_0x9061('0x7')];_0xac2b69<_0x259fbd;_0xac2b69++){var _0x5a950f=events[_0xac2b69];var _0x3ab87c=createListener('userVoiceQueueRt:'+_0x5a950f,_0x3a79a8);UserVoiceQueueRtEvents['on'](_0x5a950f,_0x3ab87c);}}; \ No newline at end of file +var _0x556b=['save','remove','update','emit','removeListener','length','userVoiceQueueRt:','./userVoiceQueueRt.events'];(function(_0x38018a,_0x1fcbd7){var _0x43667a=function(_0x4bdf57){while(--_0x4bdf57){_0x38018a['push'](_0x38018a['shift']());}};_0x43667a(++_0x1fcbd7);}(_0x556b,0x1d7));var _0xb556=function(_0x198ee1,_0x2770e1){_0x198ee1=_0x198ee1-0x0;var _0x6f532=_0x556b[_0x198ee1];return _0x6f532;};'use strict';var UserVoiceQueueRtEvents=require(_0xb556('0x0'));var events=[_0xb556('0x1'),_0xb556('0x2'),_0xb556('0x3')];function createListener(_0x3589ec,_0x5676d8){return function(_0xdc5b69){_0x5676d8[_0xb556('0x4')](_0x3589ec,_0xdc5b69);};}function removeListener(_0x4202e0,_0x30214e){return function(){UserVoiceQueueRtEvents[_0xb556('0x5')](_0x4202e0,_0x30214e);};}exports['register']=function(_0x4ee766){for(var _0x52669f=0x0,_0x18728e=events[_0xb556('0x6')];_0x52669f<_0x18728e;_0x52669f++){var _0x1cc8a1=events[_0x52669f];var _0x33508d=createListener(_0xb556('0x7')+_0x1cc8a1,_0x4ee766);UserVoiceQueueRtEvents['on'](_0x1cc8a1,_0x33508d);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 773cbed..5efd7f0 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x18e58f,_0xe7beb3){var _0x273290=function(_0xc7a3c6){while(--_0xc7a3c6){_0x18e58f['push'](_0x18e58f['shift']());}};_0x273290(++_0xe7beb3);}(_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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x420f45,_0x82ba43){var _0x115f02=function(_0x1f2638){while(--_0x1f2638){_0x420f45['push'](_0x420f45['shift']());}};_0x115f02(++_0x82ba43);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'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/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index d804bbb..bd52ece 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 _0x3353=['exports','sequelize'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x3353,0xbf));var _0x3335=function(_0x592f75,_0x56ab70){_0x592f75=_0x592f75-0x0;var _0x17164d=_0x3353[_0x592f75];return _0x17164d;};'use strict';var Sequelize=require(_0x3335('0x0'));module[_0x3335('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x6189=['exports','INTEGER','sequelize'];(function(_0xe896bf,_0x4f8e5e){var _0x4c7a8a=function(_0x410ff2){while(--_0x410ff2){_0xe896bf['push'](_0xe896bf['shift']());}};_0x4c7a8a(++_0x4f8e5e);}(_0x6189,0x98));var _0x9618=function(_0x563b2f,_0x3c01ee){_0x563b2f=_0x563b2f-0x0;var _0x262218=_0x6189[_0x563b2f];return _0x262218;};'use strict';var Sequelize=require(_0x9618('0x0'));module[_0x9618('0x1')]={'penalty':{'type':Sequelize[_0x9618('0x2')],'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 7823f9a..cf94210 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 _0x7823=['bluebird','request-promise','path','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue','lodash','util','../../config/logger','api'];(function(_0xbc25e1,_0x27007d){var _0xaf0a85=function(_0x52acb3){while(--_0x52acb3){_0xbc25e1['push'](_0xbc25e1['shift']());}};_0xaf0a85(++_0x27007d);}(_0x7823,0x8b));var _0x3782=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x7823[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x3782('0x0'));var util=require(_0x3782('0x1'));var logger=require(_0x3782('0x2'))(_0x3782('0x3'));var moment=require('moment');var BPromise=require(_0x3782('0x4'));var rp=require(_0x3782('0x5'));var fs=require('fs');var path=require(_0x3782('0x6'));var rimraf=require(_0x3782('0x7'));var config=require(_0x3782('0x8'));var attributes=require(_0x3782('0x9'));module[_0x3782('0xa')]=function(_0x24536f,_0x195fbd){return _0x24536f[_0x3782('0xb')](_0x3782('0xc'),attributes,{'tableName':'user_has_whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8f3c=['path','rimraf','exports','define','UserWhatsappQueue','user_has_whatsapp_queues','util','api','moment','bluebird','request-promise'];(function(_0xce7b9c,_0x5cd270){var _0x1d93a1=function(_0x4ba620){while(--_0x4ba620){_0xce7b9c['push'](_0xce7b9c['shift']());}};_0x1d93a1(++_0x5cd270);}(_0x8f3c,0xb6));var _0xc8f3=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x8f3c[_0x4f9b18];return _0x29f20c;};'use strict';var _=require('lodash');var util=require(_0xc8f3('0x0'));var logger=require('../../config/logger')(_0xc8f3('0x1'));var moment=require(_0xc8f3('0x2'));var BPromise=require(_0xc8f3('0x3'));var rp=require(_0xc8f3('0x4'));var fs=require('fs');var path=require(_0xc8f3('0x5'));var rimraf=require(_0xc8f3('0x6'));var config=require('../../config/environment');var attributes=require('./userWhatsappQueue.attributes');module[_0xc8f3('0x7')]=function(_0x38a492,_0x355b17){return _0x38a492[_0xc8f3('0x8')](_0xc8f3('0x9'),attributes,{'tableName':_0xc8f3('0xa'),'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 e118fef..321a8e1 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 _0xc188=['../../config/environment','jayson/promise','http','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','UserWhatsappQueue,\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','rpc'];(function(_0x2e1207,_0x2620c8){var _0x164111=function(_0x7e761b){while(--_0x7e761b){_0x2e1207['push'](_0x2e1207['shift']());}};_0x164111(++_0x2620c8);}(_0xc188,0x186));var _0x8c18=function(_0x104651,_0xc9839d){_0x104651=_0x104651-0x0;var _0x387659=_0xc188[_0x104651];return _0x387659;};'use strict';var _=require(_0x8c18('0x0'));var util=require(_0x8c18('0x1'));var moment=require(_0x8c18('0x2'));var BPromise=require(_0x8c18('0x3'));var rs=require(_0x8c18('0x4'));var fs=require('fs');var Redis=require(_0x8c18('0x5'));var db=require(_0x8c18('0x6'))['db'];var utils=require(_0x8c18('0x7'));var logger=require(_0x8c18('0x8'))(_0x8c18('0x9'));var config=require(_0x8c18('0xa'));var jayson=require(_0x8c18('0xb'));var client=jayson['client'][_0x8c18('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x491366,_0x1ff041,_0x2ac849){return new BPromise(function(_0x415ecf,_0x29dea9){return client[_0x8c18('0xd')](_0x491366,_0x2ac849)[_0x8c18('0xe')](function(_0x36f507){logger[_0x8c18('0xf')](_0x8c18('0x10'),_0x1ff041,'request\x20sent');logger['debug'](_0x8c18('0x11'),_0x1ff041,_0x8c18('0x12'),JSON[_0x8c18('0x13')](_0x36f507));if(_0x36f507[_0x8c18('0x14')]){if(_0x36f507[_0x8c18('0x14')][_0x8c18('0x15')]===0x1f4){logger[_0x8c18('0x14')]('UserWhatsappQueue,\x20%s,\x20%s',_0x1ff041,_0x36f507[_0x8c18('0x14')]['message']);return _0x29dea9(_0x36f507[_0x8c18('0x14')][_0x8c18('0x16')]);}logger[_0x8c18('0x14')](_0x8c18('0x10'),_0x1ff041,_0x36f507[_0x8c18('0x14')]['message']);return _0x415ecf(_0x36f507[_0x8c18('0x14')]['message']);}else{logger['info'](_0x8c18('0x10'),_0x1ff041,_0x8c18('0x12'));_0x415ecf(_0x36f507[_0x8c18('0x17')][_0x8c18('0x16')]);}})[_0x8c18('0x18')](function(_0x204259){logger['error'](_0x8c18('0x10'),_0x1ff041,_0x204259);_0x29dea9(_0x204259);});});} \ No newline at end of file +var _0x6dd7=['error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x4166fe,_0x313c65){var _0x14d5bd=function(_0x5c55d3){while(--_0x5c55d3){_0x4166fe['push'](_0x4166fe['shift']());}};_0x14d5bd(++_0x313c65);}(_0x6dd7,0xe2));var _0x76dd=function(_0xb83ec2,_0x18e73b){_0xb83ec2=_0xb83ec2-0x0;var _0x4d2fbf=_0x6dd7[_0xb83ec2];return _0x4d2fbf;};'use strict';var _=require(_0x76dd('0x0'));var util=require('util');var moment=require(_0x76dd('0x1'));var BPromise=require(_0x76dd('0x2'));var rs=require(_0x76dd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x76dd('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x76dd('0x5'))(_0x76dd('0x6'));var config=require('../../config/environment');var jayson=require(_0x76dd('0x7'));var client=jayson[_0x76dd('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x43df29,_0x4af303,_0x5d867c){return new BPromise(function(_0x378b14,_0x18101d){return client[_0x76dd('0x9')](_0x43df29,_0x5d867c)['then'](function(_0x3c43d){logger['info'](_0x76dd('0xa'),_0x4af303,_0x76dd('0xb'));logger[_0x76dd('0xc')]('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x4af303,_0x76dd('0xb'),JSON[_0x76dd('0xd')](_0x3c43d));if(_0x3c43d[_0x76dd('0xe')]){if(_0x3c43d[_0x76dd('0xe')][_0x76dd('0xf')]===0x1f4){logger[_0x76dd('0xe')](_0x76dd('0xa'),_0x4af303,_0x3c43d[_0x76dd('0xe')]['message']);return _0x18101d(_0x3c43d['error']['message']);}logger[_0x76dd('0xe')](_0x76dd('0xa'),_0x4af303,_0x3c43d[_0x76dd('0xe')]['message']);return _0x378b14(_0x3c43d[_0x76dd('0xe')][_0x76dd('0x10')]);}else{logger[_0x76dd('0x11')](_0x76dd('0xa'),_0x4af303,_0x76dd('0xb'));_0x378b14(_0x3c43d[_0x76dd('0x12')][_0x76dd('0x10')]);}})[_0x76dd('0x13')](function(_0x246381){logger['error']('UserWhatsappQueue,\x20%s,\x20%s',_0x4af303,_0x246381);_0x18101d(_0x246381);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 3d88261..6a82c30 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 _0x0624=['delete','destroy','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','post','create','put','update'];(function(_0x86efff,_0x4983ec){var _0x18ecdf=function(_0x4fd740){while(--_0x4fd740){_0x86efff['push'](_0x86efff['shift']());}};_0x18ecdf(++_0x4983ec);}(_0x0624,0x132));var _0x4062=function(_0x4d15fe,_0x264d18){_0x4d15fe=_0x4d15fe-0x0;var _0x46bb18=_0x0624[_0x4d15fe];return _0x46bb18;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4062('0x0'));var router=express[_0x4062('0x1')]();var fs_extra=require(_0x4062('0x2'));var auth=require(_0x4062('0x3'));var interaction=require(_0x4062('0x4'));var config=require(_0x4062('0x5'));var controller=require('./variable.controller');router['get']('/',auth[_0x4062('0x6')](),controller[_0x4062('0x7')]);router[_0x4062('0x8')](_0x4062('0x9'),auth[_0x4062('0x6')](),controller['show']);router[_0x4062('0xa')]('/',auth['isAuthenticated'](),controller[_0x4062('0xb')]);router[_0x4062('0xc')](_0x4062('0x9'),auth[_0x4062('0x6')](),controller[_0x4062('0xd')]);router[_0x4062('0xe')](_0x4062('0x9'),auth['isAuthenticated'](),controller[_0x4062('0xf')]);module['exports']=router; \ No newline at end of file +var _0xe41f=['path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','index','/:id','isAuthenticated','show','post','create','delete','exports','multer','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe41f,0x13e));var _0xfe41=function(_0x3708a2,_0x1e5f80){_0x3708a2=_0x3708a2-0x0;var _0x2e6f19=_0xe41f[_0x3708a2];return _0x2e6f19;};'use strict';var multer=require(_0xfe41('0x0'));var util=require(_0xfe41('0x1'));var path=require(_0xfe41('0x2'));var timeout=require(_0xfe41('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xfe41('0x4'));var interaction=require(_0xfe41('0x5'));var config=require(_0xfe41('0x6'));var controller=require(_0xfe41('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xfe41('0x8')]);router['get'](_0xfe41('0x9'),auth[_0xfe41('0xa')](),controller[_0xfe41('0xb')]);router[_0xfe41('0xc')]('/',auth[_0xfe41('0xa')](),controller[_0xfe41('0xd')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xfe41('0xe')](_0xfe41('0x9'),auth[_0xfe41('0xa')](),controller['destroy']);module[_0xfe41('0xf')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index ba5f7f3..da22321 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 _0xc665=['exports','STRING'];(function(_0xd0b0ec,_0x1fc627){var _0x155ccc=function(_0x4b79a4){while(--_0x4b79a4){_0xd0b0ec['push'](_0xd0b0ec['shift']());}};_0x155ccc(++_0x1fc627);}(_0xc665,0x1ac));var _0x5c66=function(_0x5142f5,_0x382614){_0x5142f5=_0x5142f5-0x0;var _0x460bf2=_0xc665[_0x5142f5];return _0x460bf2;};'use strict';var Sequelize=require('sequelize');module[_0x5c66('0x0')]={'name':{'type':Sequelize[_0x5c66('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x5c66('0x1')]}}; \ No newline at end of file +var _0xf463=['STRING','exports','name'];(function(_0x8fd988,_0x28ccd9){var _0x23d8e7=function(_0x31ee60){while(--_0x31ee60){_0x8fd988['push'](_0x8fd988['shift']());}};_0x23d8e7(++_0x28ccd9);}(_0xf463,0x94));var _0x3f46=function(_0x46993c,_0x46feaa){_0x46993c=_0x46993c-0x0;var _0x9b8478=_0xf463[_0x46993c];return _0x9b8478;};'use strict';var Sequelize=require('sequelize');module[_0x3f46('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x3f46('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x3f46('0x2')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 3840fd3..336556a 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 _0x2047=['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','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','destroy','Variables','then','end','stack','name','send','map','rawAttributes','fieldName','type','key','model','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','filter','Variable','includeAll','include','findAll','rows','catch','params','options','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','body','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2047,0x13d));var _0x7204=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x2047[_0x5c351c];return _0x26f3b3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7204('0x0'));var jsonpatch=require(_0x7204('0x1'));var rp=require(_0x7204('0x2'));var moment=require(_0x7204('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7204('0x4'));var util=require(_0x7204('0x5'));var path=require('path');var sox=require(_0x7204('0x6'));var csv=require('to-csv');var ejs=require(_0x7204('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7204('0x8'));var squel=require(_0x7204('0x9'));var crypto=require(_0x7204('0xa'));var jsforce=require(_0x7204('0xb'));var deskjs=require(_0x7204('0xc'));var toCsv=require(_0x7204('0xd'));var querystring=require(_0x7204('0xe'));var Papa=require('papaparse');var Redis=require(_0x7204('0xf'));var authService=require(_0x7204('0x10'));var qs=require(_0x7204('0x11'));var as=require(_0x7204('0x12'));var hardwareService=require(_0x7204('0x13'));var logger=require(_0x7204('0x14'))(_0x7204('0x15'));var utils=require(_0x7204('0x16'));var config=require(_0x7204('0x17'));var licenseUtil=require(_0x7204('0x18'));var db=require(_0x7204('0x19'))['db'];function respondWithStatusCode(_0x269419,_0x5556a2){_0x5556a2=_0x5556a2||0xcc;return function(_0x28551c){if(_0x28551c){return _0x269419[_0x7204('0x1a')](_0x5556a2);}return _0x269419[_0x7204('0x1b')](_0x5556a2)['end']();};}function respondWithResult(_0x1e32c9,_0x42037f){_0x42037f=_0x42037f||0xc8;return function(_0x59108e){if(_0x59108e){return _0x1e32c9[_0x7204('0x1b')](_0x42037f)[_0x7204('0x1c')](_0x59108e);}};}function respondWithFilteredResult(_0x5021b4,_0x29b254){return function(_0x955c8b){if(_0x955c8b){var _0x5e7519=typeof _0x29b254[_0x7204('0x1d')]===_0x7204('0x1e')&&typeof _0x29b254['limit']===_0x7204('0x1e');var _0x2ceb27=_0x955c8b[_0x7204('0x1f')];var _0x360884=_0x5e7519?0x0:_0x29b254[_0x7204('0x1d')];var _0xbd7872=_0x5e7519?_0x955c8b[_0x7204('0x1f')]:_0x29b254[_0x7204('0x1d')]+_0x29b254[_0x7204('0x20')];var _0x398c74;if(_0xbd7872>=_0x2ceb27){_0xbd7872=_0x2ceb27;_0x398c74=0xc8;}else{_0x398c74=0xce;}_0x5021b4[_0x7204('0x1b')](_0x398c74);return _0x5021b4[_0x7204('0x21')](_0x7204('0x22'),_0x360884+'-'+_0xbd7872+'/'+_0x2ceb27)['json'](_0x955c8b);}return null;};}function patchUpdates(_0x19ab88){return function(_0x2ceae3){try{jsonpatch[_0x7204('0x23')](_0x2ceae3,_0x19ab88,!![]);}catch(_0x59d8af){return BPromise['reject'](_0x59d8af);}return _0x2ceae3[_0x7204('0x24')]();};}function saveUpdates(_0x55bfcb,_0x216f22){return function(_0x4f3918){if(_0x4f3918){return _0x4f3918[_0x7204('0x25')](_0x55bfcb)['then'](function(_0x27867c){return _0x27867c;});}return null;};}function removeEntity(_0x519017,_0x3cbdd8){return function(_0x2f23e5){if(_0x2f23e5){return _0x2f23e5[_0x7204('0x26')]()['then'](function(){var _0xc7263a=_0x2f23e5['get']({'plain':!![]});var _0x40df3d=_0x7204('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x40df3d,'resourceId':_0xc7263a['id']}})[_0x7204('0x28')](function(){return _0x2f23e5;});})['then'](function(){_0x519017[_0x7204('0x1b')](0xcc)[_0x7204('0x29')]();});}};}function handleEntityNotFound(_0x5310d9,_0x4802df){return function(_0xa6c0b){if(!_0xa6c0b){_0x5310d9[_0x7204('0x1a')](0x194);}return _0xa6c0b;};}function handleError(_0x175fdc,_0x5b8e32){_0x5b8e32=_0x5b8e32||0x1f4;return function(_0x1ab00e){logger['error'](_0x1ab00e[_0x7204('0x2a')]);if(_0x1ab00e[_0x7204('0x2b')]){delete _0x1ab00e[_0x7204('0x2b')];}_0x175fdc[_0x7204('0x1b')](_0x5b8e32)[_0x7204('0x2c')](_0x1ab00e);};}exports['index']=function(_0x40038c,_0x5c7c9a){var _0x4c46de={},_0x3b8043={},_0x4a76f3={'count':0x0,'rows':[]};var _0x26b3aa=_[_0x7204('0x2d')](db['Variable'][_0x7204('0x2e')],function(_0x50b0e7){return{'name':_0x50b0e7[_0x7204('0x2f')],'type':_0x50b0e7[_0x7204('0x30')][_0x7204('0x31')]};});_0x3b8043[_0x7204('0x32')]=_[_0x7204('0x2d')](_0x26b3aa,_0x7204('0x2b'));_0x3b8043['query']=_['keys'](_0x40038c['query']);_0x3b8043['filters']=_[_0x7204('0x33')](_0x3b8043[_0x7204('0x32')],_0x3b8043[_0x7204('0x34')]);_0x4c46de[_0x7204('0x35')]=_[_0x7204('0x33')](_0x3b8043['model'],qs[_0x7204('0x36')](_0x40038c[_0x7204('0x34')]['fields']));_0x4c46de[_0x7204('0x35')]=_0x4c46de['attributes'][_0x7204('0x37')]?_0x4c46de[_0x7204('0x35')]:_0x3b8043['model'];if(!_0x40038c['query'][_0x7204('0x38')](_0x7204('0x39'))){_0x4c46de['limit']=qs[_0x7204('0x20')](_0x40038c[_0x7204('0x34')][_0x7204('0x20')]);_0x4c46de[_0x7204('0x1d')]=qs[_0x7204('0x1d')](_0x40038c[_0x7204('0x34')][_0x7204('0x1d')]);}_0x4c46de[_0x7204('0x3a')]=qs[_0x7204('0x3b')](_0x40038c[_0x7204('0x34')]['sort']);_0x4c46de[_0x7204('0x3c')]=qs[_0x7204('0x3d')](_['pick'](_0x40038c['query'],_0x3b8043[_0x7204('0x3d')]),_0x26b3aa);if(_0x40038c[_0x7204('0x34')]['filter']){_0x4c46de['where']=_[_0x7204('0x3e')](_0x4c46de[_0x7204('0x3c')],{'$or':_['map'](_0x26b3aa,function(_0xb10770){if(_0xb10770[_0x7204('0x30')]!=='VIRTUAL'){var _0x3f1f0c={};_0x3f1f0c[_0xb10770[_0x7204('0x2b')]]={'$like':'%'+_0x40038c[_0x7204('0x34')][_0x7204('0x3f')]+'%'};return _0x3f1f0c;}})});}_0x4c46de=_['merge']({},_0x4c46de,_0x40038c['options']);var _0x2d6cfc={'where':_0x4c46de[_0x7204('0x3c')]};return db[_0x7204('0x40')][_0x7204('0x1f')](_0x2d6cfc)['then'](function(_0x370b8c){_0x4a76f3[_0x7204('0x1f')]=_0x370b8c;if(_0x40038c[_0x7204('0x34')][_0x7204('0x41')]){_0x4c46de[_0x7204('0x42')]=[{'all':!![]}];}return db[_0x7204('0x40')][_0x7204('0x43')](_0x4c46de);})[_0x7204('0x28')](function(_0x4716d){_0x4a76f3[_0x7204('0x44')]=_0x4716d;return _0x4a76f3;})[_0x7204('0x28')](respondWithFilteredResult(_0x5c7c9a,_0x4c46de))[_0x7204('0x45')](handleError(_0x5c7c9a,null));};exports['show']=function(_0x56a853,_0x259dcb){var _0x51e945={'raw':!![],'where':{'id':_0x56a853[_0x7204('0x46')]['id']}},_0x1fa189={};_0x1fa189[_0x7204('0x32')]=_['keys'](db[_0x7204('0x40')]['rawAttributes']);_0x1fa189[_0x7204('0x34')]=_['keys'](_0x56a853['query']);_0x1fa189[_0x7204('0x3d')]=_['intersection'](_0x1fa189['model'],_0x1fa189[_0x7204('0x34')]);_0x51e945['attributes']=_[_0x7204('0x33')](_0x1fa189[_0x7204('0x32')],qs[_0x7204('0x36')](_0x56a853[_0x7204('0x34')][_0x7204('0x36')]));_0x51e945[_0x7204('0x35')]=_0x51e945['attributes'][_0x7204('0x37')]?_0x51e945[_0x7204('0x35')]:_0x1fa189['model'];if(_0x56a853[_0x7204('0x34')][_0x7204('0x41')]){_0x51e945[_0x7204('0x42')]=[{'all':!![]}];}_0x51e945=_[_0x7204('0x3e')]({},_0x51e945,_0x56a853[_0x7204('0x47')]);return db[_0x7204('0x40')][_0x7204('0x48')](_0x51e945)[_0x7204('0x28')](handleEntityNotFound(_0x259dcb,null))[_0x7204('0x28')](respondWithResult(_0x259dcb,null))[_0x7204('0x45')](handleError(_0x259dcb,null));};exports[_0x7204('0x49')]=function(_0x54f518,_0x1b722e){return db[_0x7204('0x40')][_0x7204('0x49')](_0x54f518['body'],{})['then'](function(_0x2dcf38){var _0x3e7664=_0x54f518[_0x7204('0x4a')][_0x7204('0x4b')]({'plain':!![]});if(!_0x3e7664)throw new Error(_0x7204('0x4c'));if(_0x3e7664[_0x7204('0x4d')]===_0x7204('0x4a')){var _0x4517ee=_0x2dcf38[_0x7204('0x4b')]({'plain':!![]});var _0x12def4='Variables';return db[_0x7204('0x4e')][_0x7204('0x48')]({'where':{'name':_0x12def4,'userProfileId':_0x3e7664[_0x7204('0x4f')]},'raw':!![]})[_0x7204('0x28')](function(_0x5bf0e8){if(_0x5bf0e8&&_0x5bf0e8[_0x7204('0x50')]===0x0){return db[_0x7204('0x51')]['create']({'name':_0x4517ee[_0x7204('0x2b')],'resourceId':_0x4517ee['id'],'type':_0x5bf0e8[_0x7204('0x2b')],'sectionId':_0x5bf0e8['id']},{})[_0x7204('0x28')](function(){return _0x2dcf38;});}else{return _0x2dcf38;}})[_0x7204('0x45')](function(_0x104c0d){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x104c0d);throw _0x104c0d;});}return _0x2dcf38;})['then'](respondWithResult(_0x1b722e,0xc9))[_0x7204('0x45')](handleError(_0x1b722e,null));};exports[_0x7204('0x25')]=function(_0x330106,_0x48d2f5){if(_0x330106[_0x7204('0x52')]['id']){delete _0x330106[_0x7204('0x52')]['id'];}return db[_0x7204('0x40')]['find']({'where':{'id':_0x330106['params']['id']}})[_0x7204('0x28')](handleEntityNotFound(_0x48d2f5,null))[_0x7204('0x28')](saveUpdates(_0x330106[_0x7204('0x52')],null))[_0x7204('0x28')](respondWithResult(_0x48d2f5,null))[_0x7204('0x45')](handleError(_0x48d2f5,null));};exports[_0x7204('0x26')]=function(_0x34999d,_0x31f7d0){return db[_0x7204('0x40')][_0x7204('0x48')]({'where':{'id':_0x34999d[_0x7204('0x46')]['id']}})[_0x7204('0x28')](handleEntityNotFound(_0x31f7d0,null))['then'](removeEntity(_0x31f7d0,null))[_0x7204('0x45')](handleError(_0x31f7d0,null));}; \ No newline at end of file +var _0x885d=['end','json','offset','undefined','count','limit','Content-Range','apply','reject','update','destroy','then','Variables','UserProfileResource','error','stack','name','index','map','Variable','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','eml-format','rimraf','request-promise','moment','bluebird','mustache','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x28509b,_0x5831ff){var _0x1e0b6=function(_0x37d8a2){while(--_0x37d8a2){_0x28509b['push'](_0x28509b['shift']());}};_0x1e0b6(++_0x5831ff);}(_0x885d,0x15f));var _0xd885=function(_0x838813,_0x448f0f){_0x838813=_0x838813-0x0;var _0x2bd32d=_0x885d[_0x838813];return _0x2bd32d;};'use strict';var emlformat=require(_0xd885('0x0'));var rimraf=require(_0xd885('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd885('0x2'));var moment=require(_0xd885('0x3'));var BPromise=require(_0xd885('0x4'));var Mustache=require(_0xd885('0x5'));var util=require('util');var path=require('path');var sox=require(_0xd885('0x6'));var csv=require(_0xd885('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd885('0x8'));var crypto=require(_0xd885('0x9'));var jsforce=require(_0xd885('0xa'));var deskjs=require(_0xd885('0xb'));var toCsv=require('to-csv');var querystring=require(_0xd885('0xc'));var Papa=require(_0xd885('0xd'));var Redis=require(_0xd885('0xe'));var authService=require(_0xd885('0xf'));var qs=require(_0xd885('0x10'));var as=require(_0xd885('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd885('0x12'))(_0xd885('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd885('0x14'));var db=require(_0xd885('0x15'))['db'];function respondWithStatusCode(_0x5b44f9,_0x49d8a0){_0x49d8a0=_0x49d8a0||0xcc;return function(_0x14cc09){if(_0x14cc09){return _0x5b44f9[_0xd885('0x16')](_0x49d8a0);}return _0x5b44f9[_0xd885('0x17')](_0x49d8a0)[_0xd885('0x18')]();};}function respondWithResult(_0x55682a,_0x8bc762){_0x8bc762=_0x8bc762||0xc8;return function(_0xeca470){if(_0xeca470){return _0x55682a[_0xd885('0x17')](_0x8bc762)[_0xd885('0x19')](_0xeca470);}};}function respondWithFilteredResult(_0x1206ae,_0x3a162b){return function(_0x55b56e){if(_0x55b56e){var _0x167dbf=typeof _0x3a162b[_0xd885('0x1a')]==='undefined'&&typeof _0x3a162b['limit']===_0xd885('0x1b');var _0x3b041f=_0x55b56e[_0xd885('0x1c')];var _0x54ad59=_0x167dbf?0x0:_0x3a162b[_0xd885('0x1a')];var _0x1e347e=_0x167dbf?_0x55b56e[_0xd885('0x1c')]:_0x3a162b[_0xd885('0x1a')]+_0x3a162b[_0xd885('0x1d')];var _0x14c6fb;if(_0x1e347e>=_0x3b041f){_0x1e347e=_0x3b041f;_0x14c6fb=0xc8;}else{_0x14c6fb=0xce;}_0x1206ae[_0xd885('0x17')](_0x14c6fb);return _0x1206ae['set'](_0xd885('0x1e'),_0x54ad59+'-'+_0x1e347e+'/'+_0x3b041f)[_0xd885('0x19')](_0x55b56e);}return null;};}function patchUpdates(_0x519d89){return function(_0x5ead54){try{jsonpatch[_0xd885('0x1f')](_0x5ead54,_0x519d89,!![]);}catch(_0x2a4f7c){return BPromise[_0xd885('0x20')](_0x2a4f7c);}return _0x5ead54['save']();};}function saveUpdates(_0x38ab70,_0x228d88){return function(_0x2e7228){if(_0x2e7228){return _0x2e7228[_0xd885('0x21')](_0x38ab70)['then'](function(_0x2be64a){return _0x2be64a;});}return null;};}function removeEntity(_0x547d39,_0xda1539){return function(_0x18c430){if(_0x18c430){return _0x18c430[_0xd885('0x22')]()[_0xd885('0x23')](function(){var _0x1d05cc=_0x18c430['get']({'plain':!![]});var _0x10eaee=_0xd885('0x24');return db[_0xd885('0x25')][_0xd885('0x22')]({'where':{'type':_0x10eaee,'resourceId':_0x1d05cc['id']}})[_0xd885('0x23')](function(){return _0x18c430;});})[_0xd885('0x23')](function(){_0x547d39[_0xd885('0x17')](0xcc)[_0xd885('0x18')]();});}};}function handleEntityNotFound(_0x66b5f3,_0x5c8276){return function(_0x285f76){if(!_0x285f76){_0x66b5f3[_0xd885('0x16')](0x194);}return _0x285f76;};}function handleError(_0x5d5ccb,_0x595307){_0x595307=_0x595307||0x1f4;return function(_0x4d5077){logger[_0xd885('0x26')](_0x4d5077[_0xd885('0x27')]);if(_0x4d5077[_0xd885('0x28')]){delete _0x4d5077[_0xd885('0x28')];}_0x5d5ccb['status'](_0x595307)['send'](_0x4d5077);};}exports[_0xd885('0x29')]=function(_0x34d6e2,_0x288386){var _0x4d8c37={},_0x12b456={},_0x286b88={'count':0x0,'rows':[]};var _0x454d65=_[_0xd885('0x2a')](db[_0xd885('0x2b')][_0xd885('0x2c')],function(_0x75ce42){return{'name':_0x75ce42['fieldName'],'type':_0x75ce42[_0xd885('0x2d')]['key']};});_0x12b456[_0xd885('0x2e')]=_[_0xd885('0x2a')](_0x454d65,_0xd885('0x28'));_0x12b456[_0xd885('0x2f')]=_[_0xd885('0x30')](_0x34d6e2[_0xd885('0x2f')]);_0x12b456[_0xd885('0x31')]=_[_0xd885('0x32')](_0x12b456[_0xd885('0x2e')],_0x12b456['query']);_0x4d8c37[_0xd885('0x33')]=_[_0xd885('0x32')](_0x12b456[_0xd885('0x2e')],qs['fields'](_0x34d6e2[_0xd885('0x2f')][_0xd885('0x34')]));_0x4d8c37[_0xd885('0x33')]=_0x4d8c37['attributes']['length']?_0x4d8c37[_0xd885('0x33')]:_0x12b456[_0xd885('0x2e')];if(!_0x34d6e2['query'][_0xd885('0x35')]('nolimit')){_0x4d8c37[_0xd885('0x1d')]=qs[_0xd885('0x1d')](_0x34d6e2[_0xd885('0x2f')][_0xd885('0x1d')]);_0x4d8c37[_0xd885('0x1a')]=qs[_0xd885('0x1a')](_0x34d6e2[_0xd885('0x2f')]['offset']);}_0x4d8c37['order']=qs[_0xd885('0x36')](_0x34d6e2[_0xd885('0x2f')][_0xd885('0x36')]);_0x4d8c37[_0xd885('0x37')]=qs[_0xd885('0x31')](_[_0xd885('0x38')](_0x34d6e2['query'],_0x12b456[_0xd885('0x31')]),_0x454d65);if(_0x34d6e2[_0xd885('0x2f')][_0xd885('0x39')]){_0x4d8c37[_0xd885('0x37')]=_['merge'](_0x4d8c37[_0xd885('0x37')],{'$or':_[_0xd885('0x2a')](_0x454d65,function(_0x346bb9){if(_0x346bb9[_0xd885('0x2d')]!==_0xd885('0x3a')){var _0x132767={};_0x132767[_0x346bb9[_0xd885('0x28')]]={'$like':'%'+_0x34d6e2[_0xd885('0x2f')]['filter']+'%'};return _0x132767;}})});}_0x4d8c37=_[_0xd885('0x3b')]({},_0x4d8c37,_0x34d6e2['options']);var _0x4eca3b={'where':_0x4d8c37[_0xd885('0x37')]};return db['Variable'][_0xd885('0x1c')](_0x4eca3b)[_0xd885('0x23')](function(_0x50f738){_0x286b88['count']=_0x50f738;if(_0x34d6e2[_0xd885('0x2f')][_0xd885('0x3c')]){_0x4d8c37[_0xd885('0x3d')]=[{'all':!![]}];}return db[_0xd885('0x2b')][_0xd885('0x3e')](_0x4d8c37);})['then'](function(_0x4c4790){_0x286b88[_0xd885('0x3f')]=_0x4c4790;return _0x286b88;})[_0xd885('0x23')](respondWithFilteredResult(_0x288386,_0x4d8c37))[_0xd885('0x40')](handleError(_0x288386,null));};exports[_0xd885('0x41')]=function(_0x21396d,_0x2a5269){var _0x206822={'raw':!![],'where':{'id':_0x21396d[_0xd885('0x42')]['id']}},_0x29492c={};_0x29492c[_0xd885('0x2e')]=_['keys'](db[_0xd885('0x2b')]['rawAttributes']);_0x29492c['query']=_[_0xd885('0x30')](_0x21396d[_0xd885('0x2f')]);_0x29492c[_0xd885('0x31')]=_['intersection'](_0x29492c[_0xd885('0x2e')],_0x29492c[_0xd885('0x2f')]);_0x206822['attributes']=_[_0xd885('0x32')](_0x29492c[_0xd885('0x2e')],qs[_0xd885('0x34')](_0x21396d['query'][_0xd885('0x34')]));_0x206822[_0xd885('0x33')]=_0x206822['attributes'][_0xd885('0x43')]?_0x206822['attributes']:_0x29492c[_0xd885('0x2e')];if(_0x21396d[_0xd885('0x2f')][_0xd885('0x3c')]){_0x206822[_0xd885('0x3d')]=[{'all':!![]}];}_0x206822=_[_0xd885('0x3b')]({},_0x206822,_0x21396d['options']);return db[_0xd885('0x2b')][_0xd885('0x44')](_0x206822)[_0xd885('0x23')](handleEntityNotFound(_0x2a5269,null))['then'](respondWithResult(_0x2a5269,null))[_0xd885('0x40')](handleError(_0x2a5269,null));};exports['create']=function(_0x306ace,_0x1dffe9){return db['Variable'][_0xd885('0x45')](_0x306ace[_0xd885('0x46')],{})[_0xd885('0x23')](function(_0x4e7268){var _0x41f34a=_0x306ace[_0xd885('0x47')][_0xd885('0x48')]({'plain':!![]});if(!_0x41f34a)throw new Error(_0xd885('0x49'));if(_0x41f34a['role']===_0xd885('0x47')){var _0x20e834=_0x4e7268[_0xd885('0x48')]({'plain':!![]});var _0x4d5f83='Variables';return db['UserProfileSection'][_0xd885('0x44')]({'where':{'name':_0x4d5f83,'userProfileId':_0x41f34a[_0xd885('0x4a')]},'raw':!![]})[_0xd885('0x23')](function(_0x2918b7){if(_0x2918b7&&_0x2918b7['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x20e834[_0xd885('0x28')],'resourceId':_0x20e834['id'],'type':_0x2918b7[_0xd885('0x28')],'sectionId':_0x2918b7['id']},{})[_0xd885('0x23')](function(){return _0x4e7268;});}else{return _0x4e7268;}})[_0xd885('0x40')](function(_0x42f09a){logger[_0xd885('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x42f09a);throw _0x42f09a;});}return _0x4e7268;})[_0xd885('0x23')](respondWithResult(_0x1dffe9,0xc9))[_0xd885('0x40')](handleError(_0x1dffe9,null));};exports['update']=function(_0x9dc7db,_0x48cb3a){if(_0x9dc7db[_0xd885('0x46')]['id']){delete _0x9dc7db[_0xd885('0x46')]['id'];}return db[_0xd885('0x2b')][_0xd885('0x44')]({'where':{'id':_0x9dc7db[_0xd885('0x42')]['id']}})[_0xd885('0x23')](handleEntityNotFound(_0x48cb3a,null))['then'](saveUpdates(_0x9dc7db['body'],null))[_0xd885('0x23')](respondWithResult(_0x48cb3a,null))[_0xd885('0x40')](handleError(_0x48cb3a,null));};exports[_0xd885('0x22')]=function(_0x1d7351,_0x416fb8){return db[_0xd885('0x2b')][_0xd885('0x44')]({'where':{'id':_0x1d7351[_0xd885('0x42')]['id']}})[_0xd885('0x23')](handleEntityNotFound(_0x416fb8,null))[_0xd885('0x23')](removeEntity(_0x416fb8,null))[_0xd885('0x40')](handleError(_0x416fb8,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 1160cb3..c52c5c5 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 _0x398d=['./variable.attributes','define','Variable','tools_variables','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x398d,0x148));var _0xd398=function(_0x247ca4,_0x1e7ec5){_0x247ca4=_0x247ca4-0x0;var _0x432c92=_0x398d[_0x247ca4];return _0x432c92;};'use strict';var _=require(_0xd398('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd398('0x1'));var moment=require(_0xd398('0x2'));var BPromise=require(_0xd398('0x3'));var rp=require(_0xd398('0x4'));var fs=require('fs');var path=require(_0xd398('0x5'));var rimraf=require(_0xd398('0x6'));var config=require(_0xd398('0x7'));var attributes=require(_0xd398('0x8'));module['exports']=function(_0x1fae43,_0x2f07c1){return _0x1fae43[_0xd398('0x9')](_0xd398('0xa'),attributes,{'tableName':_0xd398('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1ec7=['path','rimraf','./variable.attributes','exports','define','Variable','tools_variables','../../config/logger','api','moment','bluebird'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x1ec7,0x80));var _0x71ec=function(_0x36d328,_0x1e8b76){_0x36d328=_0x36d328-0x0;var _0x57bf7b=_0x1ec7[_0x36d328];return _0x57bf7b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x71ec('0x0'))(_0x71ec('0x1'));var moment=require(_0x71ec('0x2'));var BPromise=require(_0x71ec('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x71ec('0x4'));var rimraf=require(_0x71ec('0x5'));var config=require('../../config/environment');var attributes=require(_0x71ec('0x6'));module[_0x71ec('0x7')]=function(_0x18883d,_0x28c1d1){return _0x18883d[_0x71ec('0x8')](_0x71ec('0x9'),attributes,{'tableName':_0x71ec('0xa'),'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 1e82223..8b8f06f 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 _0x1cb9=['include','map','model','then','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowVariable','Variable','options','attributes'];(function(_0x25981f,_0x392e24){var _0x2aacbf=function(_0x81d4d5){while(--_0x81d4d5){_0x25981f['push'](_0x25981f['shift']());}};_0x2aacbf(++_0x392e24);}(_0x1cb9,0x14e));var _0x91cb=function(_0x16f030,_0x3d1b51){_0x16f030=_0x16f030-0x0;var _0x296452=_0x1cb9[_0x16f030];return _0x296452;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('Variable,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});}exports[_0x91cb('0x16')]=function(_0x1cd34b){var _0xcd1a78=this;return new Promise(function(_0x5cc1c3,_0x3fba4f){return db[_0x91cb('0x17')]['find']({'raw':_0x1cd34b[_0x91cb('0x18')]?_0x1cd34b['options']['raw']===undefined?!![]:![]:!![],'where':_0x1cd34b[_0x91cb('0x18')]?_0x1cd34b[_0x91cb('0x18')]['where']||null:null,'attributes':_0x1cd34b['options']?_0x1cd34b['options'][_0x91cb('0x19')]||null:null,'include':_0x1cd34b[_0x91cb('0x18')]?_0x1cd34b[_0x91cb('0x18')][_0x91cb('0x1a')]?_['map'](_0x1cd34b[_0x91cb('0x18')][_0x91cb('0x1a')],function(_0x1fa837){return{'model':db[_0x1fa837['model']],'as':_0x1fa837['as'],'attributes':_0x1fa837[_0x91cb('0x19')],'include':_0x1fa837[_0x91cb('0x1a')]?_[_0x91cb('0x1b')](_0x1fa837[_0x91cb('0x1a')],function(_0x3ca500){return{'model':db[_0x3ca500[_0x91cb('0x1c')]],'as':_0x3ca500['as'],'attributes':_0x3ca500[_0x91cb('0x19')],'include':_0x3ca500[_0x91cb('0x1a')]?_[_0x91cb('0x1b')](_0x3ca500['include'],function(_0x59bf3a){return{'model':db[_0x59bf3a[_0x91cb('0x1c')]],'as':_0x59bf3a['as'],'attributes':_0x59bf3a['attributes']};}):[]};}):[]};}):[]:[]})[_0x91cb('0x1d')](function(_0x34d372){logger[_0x91cb('0xc')]('ShowVariable',_0x1cd34b);logger[_0x91cb('0xf')]('ShowVariable',_0x1cd34b,JSON[_0x91cb('0x11')](_0x34d372));_0x5cc1c3(_0x34d372);})[_0x91cb('0x15')](function(_0x3b3ee6){logger[_0x91cb('0x12')](_0x91cb('0x16'),_0x3b3ee6['message'],_0x1cd34b);_0x3fba4f(_0xcd1a78[_0x91cb('0x12')](0x1f4,_0x3b3ee6['message']));});});}; \ No newline at end of file +var _0x3e74=['catch','Variable','find','options','raw','where','attributes','include','map','model','then','ShowVariable','stringify','lodash','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','error','Variable,\x20%s,\x20%s','message','info'];(function(_0x39187b,_0x2a6214){var _0x2cf25f=function(_0x183c3e){while(--_0x183c3e){_0x39187b['push'](_0x39187b['shift']());}};_0x2cf25f(++_0x2a6214);}(_0x3e74,0x175));var _0x43e7=function(_0x2a4151,_0x5cdb9b){_0x2a4151=_0x2a4151-0x0;var _0x20fe46=_0x3e74[_0x2a4151];return _0x20fe46;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var moment=require(_0x43e7('0x1'));var BPromise=require(_0x43e7('0x2'));var rs=require(_0x43e7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x43e7('0x4'));var logger=require('../../config/logger')(_0x43e7('0x5'));var config=require(_0x43e7('0x6'));var jayson=require(_0x43e7('0x7'));var client=jayson[_0x43e7('0x8')][_0x43e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x503698,_0x45a0d1,_0x3491d6){return new BPromise(function(_0x2ede2d,_0x8528fc){return client[_0x43e7('0xa')](_0x503698,_0x3491d6)['then'](function(_0x212c6c){logger['info']('Variable,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'));logger[_0x43e7('0xc')]('Variable,\x20%s,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'),JSON['stringify'](_0x212c6c));if(_0x212c6c[_0x43e7('0xd')]){if(_0x212c6c[_0x43e7('0xd')]['code']===0x1f4){logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')][_0x43e7('0xf')]);return _0x8528fc(_0x212c6c['error']['message']);}logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')]['message']);return _0x2ede2d(_0x212c6c['error'][_0x43e7('0xf')]);}else{logger[_0x43e7('0x10')](_0x43e7('0xe'),_0x45a0d1,_0x43e7('0xb'));_0x2ede2d(_0x212c6c['result']['message']);}})[_0x43e7('0x11')](function(_0x264575){logger[_0x43e7('0xd')]('Variable,\x20%s,\x20%s',_0x45a0d1,_0x264575);_0x8528fc(_0x264575);});});}exports['ShowVariable']=function(_0x446986){var _0x1ca758=this;return new Promise(function(_0x9037d3,_0x140657){return db[_0x43e7('0x12')][_0x43e7('0x13')]({'raw':_0x446986[_0x43e7('0x14')]?_0x446986[_0x43e7('0x14')][_0x43e7('0x15')]===undefined?!![]:![]:!![],'where':_0x446986[_0x43e7('0x14')]?_0x446986[_0x43e7('0x14')][_0x43e7('0x16')]||null:null,'attributes':_0x446986['options']?_0x446986[_0x43e7('0x14')][_0x43e7('0x17')]||null:null,'include':_0x446986['options']?_0x446986[_0x43e7('0x14')][_0x43e7('0x18')]?_[_0x43e7('0x19')](_0x446986[_0x43e7('0x14')][_0x43e7('0x18')],function(_0x2f4cb4){return{'model':db[_0x2f4cb4['model']],'as':_0x2f4cb4['as'],'attributes':_0x2f4cb4[_0x43e7('0x17')],'include':_0x2f4cb4['include']?_['map'](_0x2f4cb4[_0x43e7('0x18')],function(_0x43f4ff){return{'model':db[_0x43f4ff['model']],'as':_0x43f4ff['as'],'attributes':_0x43f4ff[_0x43e7('0x17')],'include':_0x43f4ff['include']?_[_0x43e7('0x19')](_0x43f4ff['include'],function(_0x1af208){return{'model':db[_0x1af208[_0x43e7('0x1a')]],'as':_0x1af208['as'],'attributes':_0x1af208[_0x43e7('0x17')]};}):[]};}):[]};}):[]:[]})[_0x43e7('0x1b')](function(_0x51f4d7){logger['info'](_0x43e7('0x1c'),_0x446986);logger['debug'](_0x43e7('0x1c'),_0x446986,JSON[_0x43e7('0x1d')](_0x51f4d7));_0x9037d3(_0x51f4d7);})[_0x43e7('0x11')](function(_0xb1fc63){logger['error'](_0x43e7('0x1c'),_0xb1fc63[_0x43e7('0xf')],_0x446986);_0x140657(_0x1ca758[_0x43e7('0xd')](0x1f4,_0xb1fc63[_0x43e7('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 083adc9..0e673ab 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 _0xae3a=['migrations','express','Router','../../components/auth/service','./version.controller','index','get','/fetch','isAuthenticated','canUpdate','fetch','reset','/pull','pull','/restart','restart','/migrations'];(function(_0x1e91eb,_0x5829a3){var _0x2af75a=function(_0x1815d1){while(--_0x1815d1){_0x1e91eb['push'](_0x1e91eb['shift']());}};_0x2af75a(++_0x5829a3);}(_0xae3a,0x133));var _0xaae3=function(_0x4fdc26,_0x5765b4){_0x4fdc26=_0x4fdc26-0x0;var _0x3df58f=_0xae3a[_0x4fdc26];return _0x3df58f;};'use strict';var express=require(_0xaae3('0x0'));var router=express[_0xaae3('0x1')]();var auth=require(_0xaae3('0x2'));var controller=require(_0xaae3('0x3'));router['get']('/',controller[_0xaae3('0x4')]);router[_0xaae3('0x5')](_0xaae3('0x6'),auth[_0xaae3('0x7')](),auth[_0xaae3('0x8')](),controller[_0xaae3('0x9')]);router[_0xaae3('0x5')]('/reset',auth[_0xaae3('0x7')](),auth[_0xaae3('0x8')](),controller[_0xaae3('0xa')]);router['get'](_0xaae3('0xb'),auth['isAuthenticated'](),auth[_0xaae3('0x8')](),controller[_0xaae3('0xc')]);router[_0xaae3('0x5')](_0xaae3('0xd'),auth[_0xaae3('0x7')](),controller[_0xaae3('0xe')]);router[_0xaae3('0x5')](_0xaae3('0xf'),controller[_0xaae3('0x10')]);module['exports']=router; \ No newline at end of file +var _0xe4cf=['canUpdate','reset','/pull','pull','/restart','restart','/migrations','migrations','exports','Router','../../components/auth/service','./version.controller','get','index','/fetch','isAuthenticated','fetch','/reset'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0xe4cf,0x75));var _0xfe4c=function(_0x514dd9,_0xe88e7e){_0x514dd9=_0x514dd9-0x0;var _0x5649a0=_0xe4cf[_0x514dd9];return _0x5649a0;};'use strict';var express=require('express');var router=express[_0xfe4c('0x0')]();var auth=require(_0xfe4c('0x1'));var controller=require(_0xfe4c('0x2'));router[_0xfe4c('0x3')]('/',controller[_0xfe4c('0x4')]);router[_0xfe4c('0x3')](_0xfe4c('0x5'),auth[_0xfe4c('0x6')](),auth['canUpdate'](),controller[_0xfe4c('0x7')]);router['get'](_0xfe4c('0x8'),auth[_0xfe4c('0x6')](),auth[_0xfe4c('0x9')](),controller[_0xfe4c('0xa')]);router[_0xfe4c('0x3')](_0xfe4c('0xb'),auth['isAuthenticated'](),auth[_0xfe4c('0x9')](),controller[_0xfe4c('0xc')]);router[_0xfe4c('0x3')](_0xfe4c('0xd'),auth[_0xfe4c('0x6')](),controller[_0xfe4c('0xe')]);router[_0xfe4c('0x3')](_0xfe4c('0xf'),controller[_0xfe4c('0x10')]);module[_0xfe4c('0x11')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index ce14eae..487efc4 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 _0x522b=['git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','restart','motion2','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','server','length','replace','push','sort','sequelize','Migration','constructor','map','then','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','compare-versions','child_process','exec','../../mysqldb','../../config/environment','update','root','index','exports','query','latest','fetch','tags','2.0.0','json','status','origin','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','FETCH_HEAD'];(function(_0x21cbaa,_0x5d585b){var _0x19180f=function(_0x70cd7e){while(--_0x70cd7e){_0x21cbaa['push'](_0x21cbaa['shift']());}};_0x19180f(++_0x5d585b);}(_0x522b,0x1d2));var _0xb522=function(_0x14476b,_0xd1a7a4){_0x14476b=_0x14476b-0x0;var _0x24e2e8=_0x522b[_0x14476b];return _0x24e2e8;};'use strict';var Umzug=require(_0xb522('0x0'));var path=require(_0xb522('0x1'));var fs=require('fs');var _=require(_0xb522('0x2'));var pkginfo=require(_0xb522('0x3'))(module,_0xb522('0x4'));var compareVersions=require(_0xb522('0x5'));var exec=require(_0xb522('0x6'))[_0xb522('0x7')];var db=require(_0xb522('0x8'))['db'];var config=require(_0xb522('0x9'));var pm2=require('../../config/pm2');var logger=require('../../config/logger')(_0xb522('0xa'));var git=require('simple-git')(config[_0xb522('0xb')]);exports[_0xb522('0xc')]=function(_0x44d229,_0x3612b9){var _0x106d7e={'current':module[_0xb522('0xd')][_0xb522('0x4')],'phonebar':0x2};if(_0x44d229[_0xb522('0xe')]&&_0x44d229['query'][_0xb522('0xf')]){return git[_0xb522('0x10')]()[_0xb522('0x11')](function(_0x1fa927,_0x2e60b6){_0x106d7e['latest']=(_0x1fa927?module[_0xb522('0xd')][_0xb522('0x4')]:_0x2e60b6[_0xb522('0xf')])||_0xb522('0x12');return _0x3612b9['status'](0xc8)[_0xb522('0x13')](_0x106d7e);});}else{return _0x3612b9[_0xb522('0x14')](0xc8)[_0xb522('0x13')](_0x106d7e);}};exports['fetch']=function(_0x3803da,_0xfa3b99){return git[_0xb522('0x10')]([_0xb522('0x15'),_0xb522('0x16')],function(_0x5e0b10){if(_0x5e0b10){logger[_0xb522('0x17')](_0x5e0b10);return _0xfa3b99[_0xb522('0x14')](0x1f4)[_0xb522('0x13')](_0x5e0b10);}logger[_0xb522('0x18')](_0xb522('0x19'));return _0xfa3b99[_0xb522('0x14')](0xc8)[_0xb522('0x13')]({'output':_0xb522('0x1a')});});};exports[_0xb522('0x1b')]=function(_0x3e15b2,_0x2bf77d){return git[_0xb522('0x1b')](['--hard',_0xb522('0x1c')],function(_0x452a71){if(_0x452a71){logger[_0xb522('0x17')](_0x452a71);return _0x2bf77d[_0xb522('0x14')](0x1f4)[_0xb522('0x13')](_0x452a71);}logger['info'](_0xb522('0x1d'));return _0x2bf77d[_0xb522('0x14')](0xc8)[_0xb522('0x13')]({'output':_0xb522('0x1e')});});};exports[_0xb522('0x1f')]=function(_0x70f66d,_0x3dbf9e){exec('npm\x20install\x20--production',function(_0x21cd74,_0x2d30ec,_0x1bf9a9){logger[_0xb522('0x18')](_0x2d30ec);logger[_0xb522('0x18')](_0x1bf9a9);if(_0x21cd74){logger['error'](_0x21cd74);return _0x3dbf9e[_0xb522('0x14')](0x1f4)[_0xb522('0x13')](_0x21cd74);}return _0x3dbf9e[_0xb522('0x14')](0xc8)[_0xb522('0x13')]({'output':_0x2d30ec});});};exports[_0xb522('0x20')]=function(_0x57ddb6,_0x151558){return pm2[_0xb522('0x20')](_0xb522('0x21'))['then'](function(_0xf4887c){logger[_0xb522('0x18')](_0xb522('0x22'),_0xf4887c);return _0x151558[_0xb522('0x14')](0xc8)[_0xb522('0x13')]({'output':_0xb522('0x23')});})[_0xb522('0x24')](function(_0x32872a){logger['error'](_0x32872a);return _0x151558['status'](0x1f4)[_0xb522('0x13')](_0x32872a);});};exports[_0xb522('0x25')]=function(_0x277862,_0x1e8e95){var _0x3c8c7c=fs[_0xb522('0x26')](path[_0xb522('0x27')](config[_0xb522('0xb')],_0xb522('0x28'),_0xb522('0x25')));var _0x4cd76e=[];for(var _0x142e44=0x0;_0x142e44<_0x3c8c7c[_0xb522('0x29')];_0x142e44++){var _0x4f8049=_0x3c8c7c[_0x142e44][_0xb522('0x2a')]('.js','');if(compareVersions(module[_0xb522('0xd')][_0xb522('0x4')],_0x4f8049)===-0x1){_0x4cd76e[_0xb522('0x2b')](_0x4f8049);}}if(_0x4cd76e['length']){var _0x44e733=_0x4cd76e[_0xb522('0x2c')](compareVersions);var _0x5929ba=new Umzug({'storage':_0xb522('0x2d'),'storageOptions':{'model':db[_0xb522('0x2e')],'modelName':'Migration','columnName':_0xb522('0x4')},'migrations':{'params':[db[_0xb522('0x2d')]['getQueryInterface'](),db[_0xb522('0x2d')][_0xb522('0x2f')],function(){throw new Error('Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.');}],'path':path[_0xb522('0x27')](config[_0xb522('0xb')],'server',_0xb522('0x25')),'pattern':/\.js$/}});_0x5929ba['up']({'migrations':_[_0xb522('0x30')](_0x44e733,function(_0x387615){return _0x387615+'.js';})})[_0xb522('0x31')](function(){return _0x1e8e95['status'](0xc8)['json']({'output':_0xb522('0x32')+module[_0xb522('0xd')]['version']+_0xb522('0x33')+_[_0xb522('0x34')](_0x44e733),'migrations':_['join'](_0x44e733)});})[_0xb522('0x24')](function(_0x3aa14a){if(_0x3aa14a instanceof db[_0xb522('0x2d')][_0xb522('0x35')]){return _0x1e8e95[_0xb522('0x14')](0xc8)[_0xb522('0x13')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x1e8e95[_0xb522('0x14')](0x1f4)['json'](_0x3aa14a);}});}else{return _0x1e8e95[_0xb522('0x14')](0xc8)['json']({'output':_0xb522('0x36')});}}; \ No newline at end of file +var _0x6a78=['server','map','\x20to\x20','last','Database\x20already\x20up-to-date','umzug','path','pkginfo','version','compare-versions','exec','../../mysqldb','../../config/environment','../../config/pm2','update','simple-git','index','exports','query','latest','2.0.0','status','json','fetch','origin','master','error','git\x20fetch','reset','--hard','FETCH_HEAD','info','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','root','length','replace','.js','push','sequelize','Migration','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.'];(function(_0x56c875,_0x56f66c){var _0x291734=function(_0x4a88f2){while(--_0x4a88f2){_0x56c875['push'](_0x56c875['shift']());}};_0x291734(++_0x56f66c);}(_0x6a78,0x171));var _0x86a7=function(_0x3f8560,_0x3fcf93){_0x3f8560=_0x3f8560-0x0;var _0x14135d=_0x6a78[_0x3f8560];return _0x14135d;};'use strict';var Umzug=require(_0x86a7('0x0'));var path=require(_0x86a7('0x1'));var fs=require('fs');var _=require('lodash');var pkginfo=require(_0x86a7('0x2'))(module,_0x86a7('0x3'));var compareVersions=require(_0x86a7('0x4'));var exec=require('child_process')[_0x86a7('0x5')];var db=require(_0x86a7('0x6'))['db'];var config=require(_0x86a7('0x7'));var pm2=require(_0x86a7('0x8'));var logger=require('../../config/logger')(_0x86a7('0x9'));var git=require(_0x86a7('0xa'))(config['root']);exports[_0x86a7('0xb')]=function(_0x545dd0,_0x135c60){var _0x42a740={'current':module[_0x86a7('0xc')][_0x86a7('0x3')],'phonebar':0x2};if(_0x545dd0[_0x86a7('0xd')]&&_0x545dd0['query'][_0x86a7('0xe')]){return git['fetch']()['tags'](function(_0x4ae52a,_0x1bcfb9){_0x42a740['latest']=(_0x4ae52a?module[_0x86a7('0xc')][_0x86a7('0x3')]:_0x1bcfb9[_0x86a7('0xe')])||_0x86a7('0xf');return _0x135c60[_0x86a7('0x10')](0xc8)[_0x86a7('0x11')](_0x42a740);});}else{return _0x135c60[_0x86a7('0x10')](0xc8)[_0x86a7('0x11')](_0x42a740);}};exports[_0x86a7('0x12')]=function(_0x330411,_0xc71c61){return git[_0x86a7('0x12')]([_0x86a7('0x13'),_0x86a7('0x14')],function(_0x4b86a2){if(_0x4b86a2){logger[_0x86a7('0x15')](_0x4b86a2);return _0xc71c61[_0x86a7('0x10')](0x1f4)[_0x86a7('0x11')](_0x4b86a2);}logger['info'](_0x86a7('0x16'));return _0xc71c61['status'](0xc8)['json']({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0x86a7('0x17')]=function(_0x2ceeed,_0x2a2d21){return git[_0x86a7('0x17')]([_0x86a7('0x18'),_0x86a7('0x19')],function(_0x17dbc3){if(_0x17dbc3){logger[_0x86a7('0x15')](_0x17dbc3);return _0x2a2d21[_0x86a7('0x10')](0x1f4)[_0x86a7('0x11')](_0x17dbc3);}logger[_0x86a7('0x1a')](_0x86a7('0x1b'));return _0x2a2d21['status'](0xc8)[_0x86a7('0x11')]({'output':_0x86a7('0x1c')});});};exports[_0x86a7('0x1d')]=function(_0x266eb3,_0x30cafa){exec(_0x86a7('0x1e'),function(_0x5ef343,_0x160e4f,_0x5084b0){logger['info'](_0x160e4f);logger[_0x86a7('0x1a')](_0x5084b0);if(_0x5ef343){logger[_0x86a7('0x15')](_0x5ef343);return _0x30cafa['status'](0x1f4)['json'](_0x5ef343);}return _0x30cafa[_0x86a7('0x10')](0xc8)[_0x86a7('0x11')]({'output':_0x160e4f});});};exports[_0x86a7('0x1f')]=function(_0x49661a,_0xc8f74f){return pm2['restart']('motion2')['then'](function(_0x2aad1b){logger[_0x86a7('0x1a')](_0x86a7('0x20'),_0x2aad1b);return _0xc8f74f[_0x86a7('0x10')](0xc8)[_0x86a7('0x11')]({'output':_0x86a7('0x21')});})[_0x86a7('0x22')](function(_0x2bd174){logger['error'](_0x2bd174);return _0xc8f74f[_0x86a7('0x10')](0x1f4)[_0x86a7('0x11')](_0x2bd174);});};exports[_0x86a7('0x23')]=function(_0x4cb760,_0x485da7){var _0x40d1d1=fs[_0x86a7('0x24')](path[_0x86a7('0x25')](config[_0x86a7('0x26')],'server',_0x86a7('0x23')));var _0x1cd2d6=[];for(var _0x4d3ecc=0x0;_0x4d3ecc<_0x40d1d1[_0x86a7('0x27')];_0x4d3ecc++){var _0x172a14=_0x40d1d1[_0x4d3ecc][_0x86a7('0x28')](_0x86a7('0x29'),'');if(compareVersions(module[_0x86a7('0xc')][_0x86a7('0x3')],_0x172a14)===-0x1){_0x1cd2d6[_0x86a7('0x2a')](_0x172a14);}}if(_0x1cd2d6['length']){var _0x3c2d6b=_0x1cd2d6['sort'](compareVersions);var _0x299411=new Umzug({'storage':_0x86a7('0x2b'),'storageOptions':{'model':db['Migration'],'modelName':_0x86a7('0x2c'),'columnName':_0x86a7('0x3')},'migrations':{'params':[db[_0x86a7('0x2b')]['getQueryInterface'](),db[_0x86a7('0x2b')][_0x86a7('0x2d')],function(){throw new Error(_0x86a7('0x2e'));}],'path':path[_0x86a7('0x25')](config[_0x86a7('0x26')],_0x86a7('0x2f'),'migrations'),'pattern':/\.js$/}});_0x299411['up']({'migrations':_[_0x86a7('0x30')](_0x3c2d6b,function(_0x3c27ba){return _0x3c27ba+'.js';})})['then'](function(){return _0x485da7[_0x86a7('0x10')](0xc8)[_0x86a7('0x11')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0x86a7('0xc')][_0x86a7('0x3')]+_0x86a7('0x31')+_[_0x86a7('0x32')](_0x3c2d6b),'migrations':_[_0x86a7('0x25')](_0x3c2d6b)});})[_0x86a7('0x22')](function(_0x1476cc){if(_0x1476cc instanceof db['sequelize']['UniqueConstraintError']){return _0x485da7['status'](0xc8)[_0x86a7('0x11')]({'output':_0x86a7('0x33')});}else{return _0x485da7[_0x86a7('0x10')](0x1f4)[_0x86a7('0x11')](_0x1476cc);}});}else{return _0x485da7['status'](0xc8)[_0x86a7('0x11')]({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 3d6eb87..3d6b507 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 _0x311a=['/describe','describe','/:id','show','put','update','delete','exports','multer','connect-timeout','fs-extra','../../components/interaction/service','./voiceAgentReport.controller','get','isAuthenticated'];(function(_0x2212d1,_0x483fc8){var _0x15eec5=function(_0x15e6ac){while(--_0x15e6ac){_0x2212d1['push'](_0x2212d1['shift']());}};_0x15eec5(++_0x483fc8);}(_0x311a,0x116));var _0xa311=function(_0x5b95ab,_0x4e9fba){_0x5b95ab=_0x5b95ab-0x0;var _0x28033f=_0x311a[_0x5b95ab];return _0x28033f;};'use strict';var multer=require(_0xa311('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa311('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xa311('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xa311('0x3'));var config=require('../../config/environment');var controller=require(_0xa311('0x4'));router[_0xa311('0x5')]('/',auth[_0xa311('0x6')](),controller['index']);router[_0xa311('0x5')](_0xa311('0x7'),auth[_0xa311('0x6')](),controller[_0xa311('0x8')]);router[_0xa311('0x5')](_0xa311('0x9'),auth['isAuthenticated'](),controller[_0xa311('0xa')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xa311('0xb')]('/:id',auth[_0xa311('0x6')](),controller[_0xa311('0xc')]);router[_0xa311('0xd')]('/:id',auth[_0xa311('0x6')](),controller['destroy']);module[_0xa311('0xe')]=router; \ No newline at end of file +var _0xbf02=['index','/describe','isAuthenticated','describe','/:id','post','create','put','update','delete','destroy','exports','path','express','Router','fs-extra','../../config/environment','./voiceAgentReport.controller','get'];(function(_0x9942be,_0x3a3a57){var _0x302b80=function(_0x315c10){while(--_0x315c10){_0x9942be['push'](_0x9942be['shift']());}};_0x302b80(++_0x3a3a57);}(_0xbf02,0x1e7));var _0x2bf0=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0xbf02[_0x2dadb9];return _0x2f0097;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2bf0('0x0'));var timeout=require('connect-timeout');var express=require(_0x2bf0('0x1'));var router=express[_0x2bf0('0x2')]();var fs_extra=require(_0x2bf0('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2bf0('0x4'));var controller=require(_0x2bf0('0x5'));router[_0x2bf0('0x6')]('/',auth['isAuthenticated'](),controller[_0x2bf0('0x7')]);router[_0x2bf0('0x6')](_0x2bf0('0x8'),auth[_0x2bf0('0x9')](),controller[_0x2bf0('0xa')]);router[_0x2bf0('0x6')](_0x2bf0('0xb'),auth[_0x2bf0('0x9')](),controller['show']);router[_0x2bf0('0xc')]('/',auth[_0x2bf0('0x9')](),controller[_0x2bf0('0xd')]);router[_0x2bf0('0xe')](_0x2bf0('0xb'),auth[_0x2bf0('0x9')](),controller[_0x2bf0('0xf')]);router[_0x2bf0('0x10')]('/:id',auth[_0x2bf0('0x9')](),controller[_0x2bf0('0x11')]);module[_0x2bf0('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index edd440f..3483f36 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 _0x02ce=['INTEGER','BOOLEAN','sequelize','exports','STRING','DATE'];(function(_0x7e3bb8,_0x27c048){var _0x44c887=function(_0x55d7c6){while(--_0x55d7c6){_0x7e3bb8['push'](_0x7e3bb8['shift']());}};_0x44c887(++_0x27c048);}(_0x02ce,0x1ac));var _0xe02c=function(_0x5d005c,_0x4bfadf){_0x5d005c=_0x5d005c-0x0;var _0xbee243=_0x02ce[_0x5d005c];return _0xbee243;};'use strict';var Sequelize=require(_0xe02c('0x0'));module[_0xe02c('0x1')]={'type':{'type':Sequelize[_0xe02c('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xe02c('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xe02c('0x2')]},'interface':{'type':Sequelize[_0xe02c('0x2')]},'membername':{'type':Sequelize[_0xe02c('0x2')]},'agentcalledAt':{'type':Sequelize[_0xe02c('0x3')]},'agentconnectAt':{'type':Sequelize[_0xe02c('0x3')]},'agentcompleteAt':{'type':Sequelize[_0xe02c('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0xe02c('0x3')]},'agentdumpAt':{'type':Sequelize[_0xe02c('0x3')]},'holdtime':{'type':Sequelize[_0xe02c('0x4')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xe02c('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xe02c('0x4')]},'agentacw':{'type':Sequelize[_0xe02c('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xe02c('0x4')]},'reason':{'type':Sequelize[_0xe02c('0x2')]},'lastevent':{'type':Sequelize[_0xe02c('0x2')]},'channel':{'type':Sequelize[_0xe02c('0x2')]},'channelstate':{'type':Sequelize[_0xe02c('0x4')]},'channelstatedesc':{'type':Sequelize[_0xe02c('0x2')]},'connectedlinenum':{'type':Sequelize[_0xe02c('0x2')]},'connectedlinename':{'type':Sequelize[_0xe02c('0x2')]},'language':{'type':Sequelize[_0xe02c('0x2')]},'accountcode':{'type':Sequelize[_0xe02c('0x2')]},'context':{'type':Sequelize[_0xe02c('0x2')]},'exten':{'type':Sequelize[_0xe02c('0x2')]},'priority':{'type':Sequelize[_0xe02c('0x2')]},'destchannel':{'type':Sequelize[_0xe02c('0x2')]},'destchannelstate':{'type':Sequelize[_0xe02c('0x4')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xe02c('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xe02c('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0xe02c('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xe02c('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0xe02c('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xe02c('0x2')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0xe02c('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xe02c('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0xe02c('0x2')]},'transferuniqueid':{'type':Sequelize[_0xe02c('0x2')]},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x0e56=['sequelize','exports','STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED'];(function(_0x4fcae0,_0x5e7e54){var _0x3a5b6f=function(_0x37d905){while(--_0x37d905){_0x4fcae0['push'](_0x4fcae0['shift']());}};_0x3a5b6f(++_0x5e7e54);}(_0x0e56,0xf5));var _0x60e5=function(_0x466e6b,_0x4053fd){_0x466e6b=_0x466e6b-0x0;var _0x118deb=_0x0e56[_0x466e6b];return _0x118deb;};'use strict';var Sequelize=require(_0x60e5('0x0'));module[_0x60e5('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x60e5('0x2')]},'calleridnum':{'type':Sequelize[_0x60e5('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x60e5('0x2')]},'interface':{'type':Sequelize[_0x60e5('0x2')]},'membername':{'type':Sequelize[_0x60e5('0x2')]},'agentcalledAt':{'type':Sequelize[_0x60e5('0x3')]},'agentconnectAt':{'type':Sequelize[_0x60e5('0x3')]},'agentcompleteAt':{'type':Sequelize[_0x60e5('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0x60e5('0x3')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x60e5('0x4')]},'agentcomplete':{'type':Sequelize[_0x60e5('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x60e5('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x60e5('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x60e5('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x60e5('0x4')]},'reason':{'type':Sequelize[_0x60e5('0x2')]},'lastevent':{'type':Sequelize[_0x60e5('0x2')]},'channel':{'type':Sequelize[_0x60e5('0x2')]},'channelstate':{'type':Sequelize[_0x60e5('0x4')]},'channelstatedesc':{'type':Sequelize[_0x60e5('0x2')]},'connectedlinenum':{'type':Sequelize[_0x60e5('0x2')]},'connectedlinename':{'type':Sequelize[_0x60e5('0x2')]},'language':{'type':Sequelize[_0x60e5('0x2')]},'accountcode':{'type':Sequelize[_0x60e5('0x2')]},'context':{'type':Sequelize[_0x60e5('0x2')]},'exten':{'type':Sequelize[_0x60e5('0x2')]},'priority':{'type':Sequelize[_0x60e5('0x2')]},'destchannel':{'type':Sequelize[_0x60e5('0x2')]},'destchannelstate':{'type':Sequelize[_0x60e5('0x4')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x60e5('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x60e5('0x2')]},'destlanguage':{'type':Sequelize[_0x60e5('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x60e5('0x2')]},'destexten':{'type':Sequelize[_0x60e5('0x2')]},'destpriority':{'type':Sequelize[_0x60e5('0x2')]},'destuniqueid':{'type':Sequelize[_0x60e5('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0x60e5('0x2')]},'transfer':{'type':Sequelize[_0x60e5('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x60e5('0x2')],'comment':_0x60e5('0x6')},'transferexten':{'type':Sequelize[_0x60e5('0x2')]},'transferuniqueid':{'type':Sequelize[_0x60e5('0x2')]},'agententerreason':{'type':Sequelize[_0x60e5('0x4')],'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 a4fa6be..50d84b8 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(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'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(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'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 3aadfdc..b42e078 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 _0x0e17=['path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','uniqueid','destuniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3155a6,_0x12d4b2){var _0x1640cd=function(_0x209f42){while(--_0x209f42){_0x3155a6['push'](_0x3155a6['shift']());}};_0x1640cd(++_0x12d4b2);}(_0x0e17,0xd6));var _0x70e1=function(_0x1259fb,_0x2d808e){_0x1259fb=_0x1259fb-0x0;var _0x36d772=_0x0e17[_0x1259fb];return _0x36d772;};'use strict';var _=require(_0x70e1('0x0'));var util=require(_0x70e1('0x1'));var logger=require(_0x70e1('0x2'))(_0x70e1('0x3'));var moment=require(_0x70e1('0x4'));var BPromise=require(_0x70e1('0x5'));var rp=require(_0x70e1('0x6'));var fs=require('fs');var path=require(_0x70e1('0x7'));var rimraf=require(_0x70e1('0x8'));var config=require(_0x70e1('0x9'));var attributes=require(_0x70e1('0xa'));module[_0x70e1('0xb')]=function(_0x4cb0b1,_0xc64213){return _0x4cb0b1[_0x70e1('0xc')](_0x70e1('0xd'),attributes,{'tableName':_0x70e1('0xe'),'paranoid':![],'indexes':[{'fields':[_0x70e1('0xf'),_0x70e1('0x10')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xac95=['define','uniqueid','destuniqueid','lodash','util','../../config/logger','api','request-promise','path','../../config/environment','./voiceAgentReport.attributes'];(function(_0x867b0a,_0x587ccf){var _0x137438=function(_0xbeafa6){while(--_0xbeafa6){_0x867b0a['push'](_0x867b0a['shift']());}};_0x137438(++_0x587ccf);}(_0xac95,0xa8));var _0x5ac9=function(_0x2ad9fc,_0x4aff96){_0x2ad9fc=_0x2ad9fc-0x0;var _0x37ce40=_0xac95[_0x2ad9fc];return _0x37ce40;};'use strict';var _=require(_0x5ac9('0x0'));var util=require(_0x5ac9('0x1'));var logger=require(_0x5ac9('0x2'))(_0x5ac9('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5ac9('0x4'));var fs=require('fs');var path=require(_0x5ac9('0x5'));var rimraf=require('rimraf');var config=require(_0x5ac9('0x6'));var attributes=require(_0x5ac9('0x7'));module['exports']=function(_0x1dc09a,_0x2bb4da){return _0x1dc09a[_0x5ac9('0x8')]('VoiceAgentReport',attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0x5ac9('0x9'),_0x5ac9('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index c239caf..0213c78 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 _0x4859=['where','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','UpdateVoiceAgentReport','update','raw'];(function(_0x190417,_0x54dc0d){var _0x110e9c=function(_0x517b86){while(--_0x517b86){_0x190417['push'](_0x190417['shift']());}};_0x110e9c(++_0x54dc0d);}(_0x4859,0x184));var _0x9485=function(_0x1f924d,_0xbb3d1b){_0x1f924d=_0x1f924d-0x0;var _0x3cf44f=_0x4859[_0x1f924d];return _0x3cf44f;};'use strict';var _=require(_0x9485('0x0'));var util=require('util');var moment=require(_0x9485('0x1'));var BPromise=require(_0x9485('0x2'));var rs=require(_0x9485('0x3'));var fs=require('fs');var Redis=require(_0x9485('0x4'));var db=require(_0x9485('0x5'))['db'];var utils=require(_0x9485('0x6'));var logger=require(_0x9485('0x7'))('rpc');var config=require(_0x9485('0x8'));var jayson=require(_0x9485('0x9'));var client=jayson[_0x9485('0xa')][_0x9485('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x41a9d2,_0x369bf5,_0x27fea9){return new BPromise(function(_0x49380e,_0x31954f){return client['request'](_0x41a9d2,_0x27fea9)[_0x9485('0xc')](function(_0x2dd450){logger['info'](_0x9485('0xd'),_0x369bf5,_0x9485('0xe'));logger[_0x9485('0xf')](_0x9485('0x10'),_0x369bf5,'request\x20sent',JSON[_0x9485('0x11')](_0x2dd450));if(_0x2dd450[_0x9485('0x12')]){if(_0x2dd450[_0x9485('0x12')][_0x9485('0x13')]===0x1f4){logger[_0x9485('0x12')](_0x9485('0xd'),_0x369bf5,_0x2dd450[_0x9485('0x12')][_0x9485('0x14')]);return _0x31954f(_0x2dd450[_0x9485('0x12')][_0x9485('0x14')]);}logger[_0x9485('0x12')](_0x9485('0xd'),_0x369bf5,_0x2dd450['error']['message']);return _0x49380e(_0x2dd450[_0x9485('0x12')][_0x9485('0x14')]);}else{logger[_0x9485('0x15')]('VoiceAgentReport,\x20%s,\x20%s',_0x369bf5,'request\x20sent');_0x49380e(_0x2dd450[_0x9485('0x16')][_0x9485('0x14')]);}})[_0x9485('0x17')](function(_0xc9c9b2){logger[_0x9485('0x12')](_0x9485('0xd'),_0x369bf5,_0xc9c9b2);_0x31954f(_0xc9c9b2);});});}exports[_0x9485('0x18')]=function(_0x58ff97){var _0x4f1cec=this;return new Promise(function(_0x2c9fc1,_0x39ea66){return db[_0x9485('0x19')][_0x9485('0x1a')](_0x58ff97[_0x9485('0x1b')],{'raw':_0x58ff97[_0x9485('0x1c')]?_0x58ff97['options']['raw']===undefined?!![]:![]:!![]})[_0x9485('0xc')](function(_0x59c8ac){logger['info'](_0x9485('0x18'),_0x58ff97);logger[_0x9485('0xf')](_0x9485('0x18'),_0x58ff97,JSON[_0x9485('0x11')](_0x59c8ac));_0x2c9fc1(_0x59c8ac);})[_0x9485('0x17')](function(_0x52bd37){logger['error'](_0x9485('0x18'),_0x52bd37[_0x9485('0x14')],_0x58ff97);_0x39ea66(_0x4f1cec['error'](0x1f4,_0x52bd37[_0x9485('0x14')]));});});};exports[_0x9485('0x1d')]=function(_0x32fc12){var _0x48c049=this;return new Promise(function(_0x380beb,_0x215a1c){return db['VoiceAgentReport'][_0x9485('0x1e')](_0x32fc12[_0x9485('0x1b')],{'raw':_0x32fc12['options']?_0x32fc12[_0x9485('0x1c')][_0x9485('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x32fc12[_0x9485('0x1c')]?_0x32fc12[_0x9485('0x1c')][_0x9485('0x20')]||null:null,'attributes':_0x32fc12[_0x9485('0x1c')]?_0x32fc12[_0x9485('0x1c')][_0x9485('0x21')]||null:null,'limit':_0x32fc12[_0x9485('0x1c')]?_0x32fc12[_0x9485('0x1c')][_0x9485('0x22')]||null:null})[_0x9485('0xc')](function(_0x5e43a6){logger[_0x9485('0x15')](_0x9485('0x1d'),_0x32fc12);logger[_0x9485('0xf')](_0x9485('0x1d'),_0x32fc12,JSON['stringify'](_0x5e43a6));_0x380beb(_0x5e43a6);})[_0x9485('0x17')](function(_0x54af85){logger['error'](_0x9485('0x1d'),_0x54af85['message'],_0x32fc12);_0x215a1c(_0x48c049[_0x9485('0x12')](0x1f4,_0x54af85[_0x9485('0x14')]));});});}; \ No newline at end of file +var _0x23c3=['create','body','options','raw','CreateVoiceAgentReport','VoiceAgentReport','update','limit','UpdateVoiceAgentReport','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x3014c0,_0x506128){var _0x59fbde=function(_0x2bc670){while(--_0x2bc670){_0x3014c0['push'](_0x3014c0['shift']());}};_0x59fbde(++_0x506128);}(_0x23c3,0x1d7));var _0x323c=function(_0x3d9b04,_0x1e851a){_0x3d9b04=_0x3d9b04-0x0;var _0x557936=_0x23c3[_0x3d9b04];return _0x557936;};'use strict';var _=require(_0x323c('0x0'));var util=require(_0x323c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x323c('0x2'));var fs=require('fs');var Redis=require(_0x323c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x323c('0x4'));var logger=require(_0x323c('0x5'))(_0x323c('0x6'));var config=require(_0x323c('0x7'));var jayson=require(_0x323c('0x8'));var client=jayson[_0x323c('0x9')][_0x323c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5200d7,_0xeae997,_0x67dbb5){return new BPromise(function(_0x11042c,_0x5ed229){return client[_0x323c('0xb')](_0x5200d7,_0x67dbb5)[_0x323c('0xc')](function(_0x2ec4a8){logger[_0x323c('0xd')](_0x323c('0xe'),_0xeae997,_0x323c('0xf'));logger[_0x323c('0x10')](_0x323c('0x11'),_0xeae997,'request\x20sent',JSON[_0x323c('0x12')](_0x2ec4a8));if(_0x2ec4a8[_0x323c('0x13')]){if(_0x2ec4a8[_0x323c('0x13')][_0x323c('0x14')]===0x1f4){logger[_0x323c('0x13')]('VoiceAgentReport,\x20%s,\x20%s',_0xeae997,_0x2ec4a8[_0x323c('0x13')][_0x323c('0x15')]);return _0x5ed229(_0x2ec4a8[_0x323c('0x13')][_0x323c('0x15')]);}logger[_0x323c('0x13')](_0x323c('0xe'),_0xeae997,_0x2ec4a8[_0x323c('0x13')][_0x323c('0x15')]);return _0x11042c(_0x2ec4a8[_0x323c('0x13')][_0x323c('0x15')]);}else{logger[_0x323c('0xd')](_0x323c('0xe'),_0xeae997,_0x323c('0xf'));_0x11042c(_0x2ec4a8[_0x323c('0x16')][_0x323c('0x15')]);}})[_0x323c('0x17')](function(_0x3ff475){logger['error'](_0x323c('0xe'),_0xeae997,_0x3ff475);_0x5ed229(_0x3ff475);});});}exports['CreateVoiceAgentReport']=function(_0xa05f6a){var _0x1e589e=this;return new Promise(function(_0x14636e,_0x18e4ab){return db['VoiceAgentReport'][_0x323c('0x18')](_0xa05f6a[_0x323c('0x19')],{'raw':_0xa05f6a['options']?_0xa05f6a[_0x323c('0x1a')][_0x323c('0x1b')]===undefined?!![]:![]:!![]})[_0x323c('0xc')](function(_0x2f3869){logger[_0x323c('0xd')]('CreateVoiceAgentReport',_0xa05f6a);logger['debug']('CreateVoiceAgentReport',_0xa05f6a,JSON['stringify'](_0x2f3869));_0x14636e(_0x2f3869);})[_0x323c('0x17')](function(_0x212ed8){logger[_0x323c('0x13')](_0x323c('0x1c'),_0x212ed8[_0x323c('0x15')],_0xa05f6a);_0x18e4ab(_0x1e589e[_0x323c('0x13')](0x1f4,_0x212ed8[_0x323c('0x15')]));});});};exports['UpdateVoiceAgentReport']=function(_0x4ca3cf){var _0x566089=this;return new Promise(function(_0x29e849,_0x93e56f){return db[_0x323c('0x1d')][_0x323c('0x1e')](_0x4ca3cf[_0x323c('0x19')],{'raw':_0x4ca3cf[_0x323c('0x1a')]?_0x4ca3cf[_0x323c('0x1a')][_0x323c('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4ca3cf['options']?_0x4ca3cf[_0x323c('0x1a')]['where']||null:null,'attributes':_0x4ca3cf['options']?_0x4ca3cf['options']['attributes']||null:null,'limit':_0x4ca3cf[_0x323c('0x1a')]?_0x4ca3cf[_0x323c('0x1a')][_0x323c('0x1f')]||null:null})['then'](function(_0x384bb1){logger[_0x323c('0xd')]('UpdateVoiceAgentReport',_0x4ca3cf);logger['debug']('UpdateVoiceAgentReport',_0x4ca3cf,JSON['stringify'](_0x384bb1));_0x29e849(_0x384bb1);})[_0x323c('0x17')](function(_0x924525){logger['error'](_0x323c('0x20'),_0x924525[_0x323c('0x15')],_0x4ca3cf);_0x93e56f(_0x566089[_0x323c('0x13')](0x1f4,_0x924525[_0x323c('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 13b42ce..a4d9741 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 _0xbd50=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/describe','/:id','show','create','delete','exports','multer','util'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0xbd50,0x196));var _0x0bd5=function(_0x53bf73,_0x1ed39d){_0x53bf73=_0x53bf73-0x0;var _0x5b5e1a=_0xbd50[_0x53bf73];return _0x5b5e1a;};'use strict';var multer=require(_0x0bd5('0x0'));var util=require(_0x0bd5('0x1'));var path=require(_0x0bd5('0x2'));var timeout=require('connect-timeout');var express=require(_0x0bd5('0x3'));var router=express[_0x0bd5('0x4')]();var fs_extra=require(_0x0bd5('0x5'));var auth=require(_0x0bd5('0x6'));var interaction=require(_0x0bd5('0x7'));var config=require('../../config/environment');var controller=require('./voiceCallReport.controller');router['get']('/',auth[_0x0bd5('0x8')](),controller[_0x0bd5('0x9')]);router[_0x0bd5('0xa')](_0x0bd5('0xb'),auth[_0x0bd5('0x8')](),controller['describe']);router['get'](_0x0bd5('0xc'),auth[_0x0bd5('0x8')](),controller[_0x0bd5('0xd')]);router['post']('/',auth[_0x0bd5('0x8')](),controller[_0x0bd5('0xe')]);router['put'](_0x0bd5('0xc'),auth[_0x0bd5('0x8')](),controller['update']);router[_0x0bd5('0xf')](_0x0bd5('0xc'),auth[_0x0bd5('0x8')](),controller['destroy']);module[_0x0bd5('0x10')]=router; \ No newline at end of file +var _0xcb99=['create','put','update','delete','destroy','exports','multer','path','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceCallReport.controller','isAuthenticated','get','/describe','describe','/:id','show'];(function(_0xcf0356,_0x125b73){var _0x2478a8=function(_0x1839c2){while(--_0x1839c2){_0xcf0356['push'](_0xcf0356['shift']());}};_0x2478a8(++_0x125b73);}(_0xcb99,0x8b));var _0x9cb9=function(_0x590a0c,_0xab1f66){_0x590a0c=_0x590a0c-0x0;var _0x32add4=_0xcb99[_0x590a0c];return _0x32add4;};'use strict';var multer=require(_0x9cb9('0x0'));var util=require('util');var path=require(_0x9cb9('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9cb9('0x2')]();var fs_extra=require(_0x9cb9('0x3'));var auth=require(_0x9cb9('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9cb9('0x5'));var controller=require(_0x9cb9('0x6'));router['get']('/',auth[_0x9cb9('0x7')](),controller['index']);router[_0x9cb9('0x8')](_0x9cb9('0x9'),auth[_0x9cb9('0x7')](),controller[_0x9cb9('0xa')]);router[_0x9cb9('0x8')](_0x9cb9('0xb'),auth[_0x9cb9('0x7')](),controller[_0x9cb9('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9cb9('0xd')]);router[_0x9cb9('0xe')](_0x9cb9('0xb'),auth['isAuthenticated'](),controller[_0x9cb9('0xf')]);router[_0x9cb9('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x9cb9('0x11')]);module[_0x9cb9('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 994977c..d921494 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 _0x96cf=['dialer','STRING','TEXT','DATE','INTEGER','sequelize','exports','ENUM','inbound','internal','outbound','inbound-fax','outbound-fax'];(function(_0x1387eb,_0x5475e3){var _0x3265eb=function(_0x182b89){while(--_0x182b89){_0x1387eb['push'](_0x1387eb['shift']());}};_0x3265eb(++_0x5475e3);}(_0x96cf,0x7a));var _0xf96c=function(_0x2abe62,_0x284360){_0x2abe62=_0x2abe62-0x0;var _0x35ba4c=_0x96cf[_0x2abe62];return _0x35ba4c;};'use strict';var Sequelize=require(_0xf96c('0x0'));module[_0xf96c('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xf96c('0x2')](_0xf96c('0x3'),_0xf96c('0x4'),_0xf96c('0x5'),_0xf96c('0x6'),_0xf96c('0x7'),_0xf96c('0x8'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize[_0xf96c('0x9')]},'destination':{'type':Sequelize[_0xf96c('0x9')]},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xf96c('0x9')]},'channel':{'type':Sequelize[_0xf96c('0x9')]},'destinationchannel':{'type':Sequelize[_0xf96c('0x9')]},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xf96c('0xa')]},'starttime':{'type':Sequelize[_0xf96c('0xb')]},'systemanswertime':{'type':Sequelize[_0xf96c('0xb')]},'answertime':{'type':Sequelize[_0xf96c('0xb')]},'endtime':{'type':Sequelize[_0xf96c('0xb')]},'duration':{'type':Sequelize[_0xf96c('0xc')]},'billableseconds':{'type':Sequelize[_0xf96c('0xc')]},'mohtime':{'type':Sequelize[_0xf96c('0xc')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xf96c('0x9')]},'amaflags':{'type':Sequelize[_0xf96c('0x9')]},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0xf96c('0x9')]},'userSecondDisposition':{'type':Sequelize[_0xf96c('0x9')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xf96c('0x9')]},'prefix':{'type':Sequelize[_0xf96c('0x9')]},'routeid':{'type':Sequelize[_0xf96c('0xc')]},'sipcallid':{'type':Sequelize[_0xf96c('0x9')]}}; \ No newline at end of file +var _0xf269=['DATE','INTEGER','exports','STRING','inbound','internal','outbound','outbound-fax'];(function(_0x5bab8e,_0x5a9ed6){var _0x3e14ea=function(_0x3d5948){while(--_0x3d5948){_0x5bab8e['push'](_0x5bab8e['shift']());}};_0x3e14ea(++_0x5a9ed6);}(_0xf269,0xd2));var _0x9f26=function(_0x3e5f6d,_0x5bea50){_0x3e5f6d=_0x3e5f6d-0x0;var _0x16fed2=_0xf269[_0x3e5f6d];return _0x16fed2;};'use strict';var Sequelize=require('sequelize');module[_0x9f26('0x0')]={'uniqueid':{'type':Sequelize[_0x9f26('0x1')]},'type':{'type':Sequelize['ENUM'](_0x9f26('0x2'),_0x9f26('0x3'),_0x9f26('0x4'),'inbound-fax',_0x9f26('0x5'),'dialer')},'tag':{'type':Sequelize[_0x9f26('0x1')]},'accountcode':{'type':Sequelize[_0x9f26('0x1')]},'source':{'type':Sequelize[_0x9f26('0x1')]},'destination':{'type':Sequelize[_0x9f26('0x1')]},'destinationcontext':{'type':Sequelize[_0x9f26('0x1')]},'callerid':{'type':Sequelize[_0x9f26('0x1')]},'channel':{'type':Sequelize[_0x9f26('0x1')]},'destinationchannel':{'type':Sequelize[_0x9f26('0x1')]},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0x9f26('0x6')]},'answertime':{'type':Sequelize[_0x9f26('0x6')]},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0x9f26('0x7')]},'mohtime':{'type':Sequelize[_0x9f26('0x7')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x9f26('0x1')]},'amaflags':{'type':Sequelize[_0x9f26('0x1')]},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize[_0x9f26('0x1')]},'note':{'type':Sequelize[_0x9f26('0x1')]},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize[_0x9f26('0x7')]},'sipcallid':{'type':Sequelize[_0x9f26('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 3b729fb..ff22def 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 _0x2032=['../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','index','map','VoiceCallReport','fieldName','type','key','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','merge','where','options','alias','User','rows','catch','show','params','keys','rawAttributes','includeAll','include','create','body','find','describe','uniqueid','user','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2032,0xd9));var _0x2203=function(_0x432668,_0x42dc82){_0x432668=_0x432668-0x0;var _0x45e99b=_0x2032[_0x432668];return _0x45e99b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2203('0x0'));var zipdir=require(_0x2203('0x1'));var jsonpatch=require(_0x2203('0x2'));var rp=require('request-promise');var moment=require(_0x2203('0x3'));var BPromise=require(_0x2203('0x4'));var Mustache=require('mustache');var util=require(_0x2203('0x5'));var path=require(_0x2203('0x6'));var sox=require(_0x2203('0x7'));var csv=require(_0x2203('0x8'));var ejs=require(_0x2203('0x9'));var fs=require('fs');var fs_extra=require(_0x2203('0xa'));var _=require(_0x2203('0xb'));var squel=require(_0x2203('0xc'));var crypto=require(_0x2203('0xd'));var jsforce=require(_0x2203('0xe'));var deskjs=require(_0x2203('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2203('0x10'));var Redis=require('ioredis');var authService=require(_0x2203('0x11'));var qs=require(_0x2203('0x12'));var as=require(_0x2203('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2203('0x14'))('api');var utils=require(_0x2203('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2203('0x16'));var db=require(_0x2203('0x17'))['db'];function respondWithStatusCode(_0x4b9376,_0x583bc7){_0x583bc7=_0x583bc7||0xcc;return function(_0x585c76){if(_0x585c76){return _0x4b9376['sendStatus'](_0x583bc7);}return _0x4b9376['status'](_0x583bc7)[_0x2203('0x18')]();};}function respondWithResult(_0x538b30,_0x592e47){_0x592e47=_0x592e47||0xc8;return function(_0x21a3af){if(_0x21a3af){return _0x538b30[_0x2203('0x19')](_0x592e47)[_0x2203('0x1a')](_0x21a3af);}};}function respondWithFilteredResult(_0x41af85,_0x226209){return function(_0x3fe0a8){if(_0x3fe0a8){var _0x2c36e6=typeof _0x226209[_0x2203('0x1b')]===_0x2203('0x1c')&&typeof _0x226209[_0x2203('0x1d')]==='undefined';var _0x280eda=_0x3fe0a8[_0x2203('0x1e')];var _0x4893ff=_0x2c36e6?0x0:_0x226209[_0x2203('0x1b')];var _0x8906e1=_0x2c36e6?_0x3fe0a8['count']:_0x226209[_0x2203('0x1b')]+_0x226209['limit'];var _0x2904ba;if(_0x8906e1>=_0x280eda){_0x8906e1=_0x280eda;_0x2904ba=0xc8;}else{_0x2904ba=0xce;}_0x41af85[_0x2203('0x19')](_0x2904ba);return _0x41af85[_0x2203('0x1f')](_0x2203('0x20'),_0x4893ff+'-'+_0x8906e1+'/'+_0x280eda)[_0x2203('0x1a')](_0x3fe0a8);}return null;};}function patchUpdates(_0x449039){return function(_0x538c23){try{jsonpatch[_0x2203('0x21')](_0x538c23,_0x449039,!![]);}catch(_0x50822b){return BPromise['reject'](_0x50822b);}return _0x538c23[_0x2203('0x22')]();};}function saveUpdates(_0x496d82,_0x3b8ef9){return function(_0x5bfe61){if(_0x5bfe61){return _0x5bfe61['update'](_0x496d82)[_0x2203('0x23')](function(_0x5e29cd){return _0x5e29cd;});}return null;};}function removeEntity(_0x5c8da9,_0x226374){return function(_0x2718f5){if(_0x2718f5){return _0x2718f5[_0x2203('0x24')]()[_0x2203('0x23')](function(){_0x5c8da9[_0x2203('0x19')](0xcc)[_0x2203('0x18')]();});}};}function handleEntityNotFound(_0x49c12,_0x250349){return function(_0x576378){if(!_0x576378){_0x49c12[_0x2203('0x25')](0x194);}return _0x576378;};}function handleError(_0x36b958,_0x39a11a){_0x39a11a=_0x39a11a||0x1f4;return function(_0x5f11bf){logger[_0x2203('0x26')](_0x5f11bf[_0x2203('0x27')]);if(_0x5f11bf['name']){delete _0x5f11bf[_0x2203('0x28')];}_0x36b958[_0x2203('0x19')](_0x39a11a)[_0x2203('0x29')](_0x5f11bf);};}exports[_0x2203('0x2a')]=function(_0x28ae02,_0x1df508){var _0x9c53f={},_0x5a95c1={},_0x34b8ba={'count':0x0,'rows':[]};var _0x616ed8=_[_0x2203('0x2b')](db[_0x2203('0x2c')]['rawAttributes'],function(_0x3a8e23){return{'name':_0x3a8e23[_0x2203('0x2d')],'type':_0x3a8e23[_0x2203('0x2e')][_0x2203('0x2f')]};});_0x5a95c1['model']=_[_0x2203('0x2b')](_0x616ed8,_0x2203('0x28'));_0x5a95c1['query']=_['keys'](_0x28ae02[_0x2203('0x30')]);_0x5a95c1['filters']=_['intersection'](_0x5a95c1[_0x2203('0x31')],_0x5a95c1[_0x2203('0x30')]);_0x9c53f[_0x2203('0x32')]=_[_0x2203('0x33')](_0x5a95c1[_0x2203('0x31')],qs['fields'](_0x28ae02[_0x2203('0x30')][_0x2203('0x34')]));_0x9c53f['attributes']=_0x9c53f[_0x2203('0x32')][_0x2203('0x35')]?_0x9c53f[_0x2203('0x32')]:_0x5a95c1[_0x2203('0x31')];if(!_0x28ae02[_0x2203('0x30')][_0x2203('0x36')](_0x2203('0x37'))){_0x9c53f[_0x2203('0x1d')]=qs[_0x2203('0x1d')](_0x28ae02['query'][_0x2203('0x1d')]);_0x9c53f[_0x2203('0x1b')]=qs['offset'](_0x28ae02['query'][_0x2203('0x1b')]);}_0x9c53f['order']=qs[_0x2203('0x38')](_0x28ae02[_0x2203('0x30')][_0x2203('0x38')]);_0x9c53f['where']=qs['filters'](_[_0x2203('0x39')](_0x28ae02['query'],_0x5a95c1[_0x2203('0x3a')]),_0x616ed8);if(_0x28ae02['query'][_0x2203('0x3b')]){_0x9c53f['where']=_[_0x2203('0x3c')](_0x9c53f[_0x2203('0x3d')],{'$or':_[_0x2203('0x2b')](_0x616ed8,function(_0x40a793){if(_0x40a793[_0x2203('0x2e')]!=='VIRTUAL'){var _0x5f1561={};_0x5f1561[_0x40a793['name']]={'$like':'%'+_0x28ae02[_0x2203('0x30')][_0x2203('0x3b')]+'%'};return _0x5f1561;}})});}_0x9c53f=_[_0x2203('0x3c')]({},_0x9c53f,_0x28ae02[_0x2203('0x3e')]);var _0x3283fb={'where':_0x9c53f[_0x2203('0x3d')]};return db[_0x2203('0x2c')]['count'](_0x3283fb)[_0x2203('0x23')](function(_0x1b12c3){_0x34b8ba[_0x2203('0x1e')]=_0x1b12c3;if(_0x28ae02[_0x2203('0x30')]['includeAll']){_0x9c53f['include']=[{'attributes':['id',_0x2203('0x28'),'fullname',_0x2203('0x3f')],'model':db[_0x2203('0x40')],'as':_0x2203('0x40')}];}return db['VoiceCallReport']['findAll'](_0x9c53f);})[_0x2203('0x23')](function(_0x3739f6){_0x34b8ba[_0x2203('0x41')]=_0x3739f6;return _0x34b8ba;})[_0x2203('0x23')](respondWithFilteredResult(_0x1df508,_0x9c53f))[_0x2203('0x42')](handleError(_0x1df508,null));};exports[_0x2203('0x43')]=function(_0x5cd573,_0x15d3b6){var _0x165a3f={'raw':!![],'where':{'id':_0x5cd573[_0x2203('0x44')]['id']}},_0x3a866c={};_0x3a866c[_0x2203('0x31')]=_[_0x2203('0x45')](db[_0x2203('0x2c')][_0x2203('0x46')]);_0x3a866c[_0x2203('0x30')]=_[_0x2203('0x45')](_0x5cd573['query']);_0x3a866c[_0x2203('0x3a')]=_[_0x2203('0x33')](_0x3a866c[_0x2203('0x31')],_0x3a866c[_0x2203('0x30')]);_0x165a3f['attributes']=_['intersection'](_0x3a866c[_0x2203('0x31')],qs['fields'](_0x5cd573[_0x2203('0x30')][_0x2203('0x34')]));_0x165a3f[_0x2203('0x32')]=_0x165a3f[_0x2203('0x32')]['length']?_0x165a3f[_0x2203('0x32')]:_0x3a866c[_0x2203('0x31')];if(_0x5cd573['query'][_0x2203('0x47')]){_0x165a3f[_0x2203('0x48')]=[{'all':!![]}];}_0x165a3f=_[_0x2203('0x3c')]({},_0x165a3f,_0x5cd573[_0x2203('0x3e')]);return db['VoiceCallReport']['find'](_0x165a3f)[_0x2203('0x23')](handleEntityNotFound(_0x15d3b6,null))['then'](respondWithResult(_0x15d3b6,null))['catch'](handleError(_0x15d3b6,null));};exports[_0x2203('0x49')]=function(_0x33b7b5,_0x1a2665){return db['VoiceCallReport']['create'](_0x33b7b5[_0x2203('0x4a')],{})[_0x2203('0x23')](respondWithResult(_0x1a2665,0xc9))[_0x2203('0x42')](handleError(_0x1a2665,null));};exports[_0x2203('0x24')]=function(_0x225b0e,_0x21fd78){return db['VoiceCallReport'][_0x2203('0x4b')]({'where':{'id':_0x225b0e['params']['id']}})[_0x2203('0x23')](handleEntityNotFound(_0x21fd78,null))[_0x2203('0x23')](removeEntity(_0x21fd78,null))[_0x2203('0x42')](handleError(_0x21fd78,null));};exports[_0x2203('0x4c')]=function(_0x58b9bb,_0x506795){return db[_0x2203('0x2c')][_0x2203('0x4c')]()[_0x2203('0x23')](respondWithResult(_0x506795,null))[_0x2203('0x42')](handleError(_0x506795,null));};exports['update']=function(_0x4de47a,_0x49999a){if(_0x4de47a[_0x2203('0x4a')][_0x2203('0x4d')]){delete _0x4de47a['body'][_0x2203('0x4d')];}return db[_0x2203('0x2c')]['find']({'where':{'uniqueid':_0x4de47a[_0x2203('0x44')]['id'],'UserId':{'$or':[null,_0x4de47a[_0x2203('0x4e')]['id']]}}})[_0x2203('0x23')](handleEntityNotFound(_0x49999a,null))[_0x2203('0x23')](saveUpdates(_0x4de47a['body'],null))[_0x2203('0x23')](respondWithResult(_0x49999a,null))['catch'](handleError(_0x49999a,null));}; \ No newline at end of file +var _0x5f66=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','VoiceCallReport','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','VIRTUAL','includeAll','include','fullname','alias','User','rows','catch','show','params','find','create','body','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x5f66[_0x4cf98e];return _0x1623ac;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=typeof _0x59154e['offset']===_0x65f6('0x18')&&typeof _0x59154e[_0x65f6('0x19')]===_0x65f6('0x18');var _0x1c955c=_0x19b9ff[_0x65f6('0x1a')];var _0x1f974c=_0x49a913?0x0:_0x59154e[_0x65f6('0x1b')];var _0x18380e=_0x49a913?_0x19b9ff['count']:_0x59154e['offset']+_0x59154e[_0x65f6('0x19')];var _0x5b4055;if(_0x18380e>=_0x1c955c){_0x18380e=_0x1c955c;_0x5b4055=0xc8;}else{_0x5b4055=0xce;}_0x3440af['status'](_0x5b4055);return _0x3440af['set'](_0x65f6('0x1c'),_0x1f974c+'-'+_0x18380e+'/'+_0x1c955c)[_0x65f6('0x17')](_0x19b9ff);}return null;};}function patchUpdates(_0x5114a4){return function(_0x39e19f){try{jsonpatch[_0x65f6('0x1d')](_0x39e19f,_0x5114a4,!![]);}catch(_0xbee6a4){return BPromise[_0x65f6('0x1e')](_0xbee6a4);}return _0x39e19f[_0x65f6('0x1f')]();};}function saveUpdates(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['update'](_0xc139c2)['then'](function(_0x212247){return _0x212247;});}return null;};}function removeEntity(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(_0x1eeaaa){return _0x1eeaaa[_0x65f6('0x20')]()[_0x65f6('0x21')](function(){_0xd173f4[_0x65f6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d7bb0,_0x59ea32){return function(_0x20a161){if(!_0x20a161){_0x9d7bb0['sendStatus'](0x194);}return _0x20a161;};}function handleError(_0x5cb131,_0x4fde2f){_0x4fde2f=_0x4fde2f||0x1f4;return function(_0x29abdb){logger[_0x65f6('0x22')](_0x29abdb['stack']);if(_0x29abdb[_0x65f6('0x23')]){delete _0x29abdb[_0x65f6('0x23')];}_0x5cb131['status'](_0x4fde2f)[_0x65f6('0x24')](_0x29abdb);};}exports[_0x65f6('0x25')]=function(_0x28d0df,_0x559330){var _0x4ac04b={},_0x488d36={},_0x266cfe={'count':0x0,'rows':[]};var _0x3c032f=_[_0x65f6('0x26')](db[_0x65f6('0x27')][_0x65f6('0x28')],function(_0x14a387){return{'name':_0x14a387[_0x65f6('0x29')],'type':_0x14a387['type']['key']};});_0x488d36[_0x65f6('0x2a')]=_[_0x65f6('0x26')](_0x3c032f,'name');_0x488d36['query']=_[_0x65f6('0x2b')](_0x28d0df[_0x65f6('0x2c')]);_0x488d36[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],_0x488d36[_0x65f6('0x2c')]);_0x4ac04b['attributes']=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x28d0df['query'][_0x65f6('0x2f')]));_0x4ac04b[_0x65f6('0x30')]=_0x4ac04b[_0x65f6('0x30')][_0x65f6('0x31')]?_0x4ac04b[_0x65f6('0x30')]:_0x488d36[_0x65f6('0x2a')];if(!_0x28d0df['query'][_0x65f6('0x32')](_0x65f6('0x33'))){_0x4ac04b['limit']=qs[_0x65f6('0x19')](_0x28d0df['query'][_0x65f6('0x19')]);_0x4ac04b['offset']=qs[_0x65f6('0x1b')](_0x28d0df[_0x65f6('0x2c')]['offset']);}_0x4ac04b[_0x65f6('0x34')]=qs[_0x65f6('0x35')](_0x28d0df[_0x65f6('0x2c')]['sort']);_0x4ac04b['where']=qs[_0x65f6('0x2d')](_['pick'](_0x28d0df[_0x65f6('0x2c')],_0x488d36['filters']),_0x3c032f);if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]){_0x4ac04b['where']=_[_0x65f6('0x37')](_0x4ac04b['where'],{'$or':_['map'](_0x3c032f,function(_0x71b16b){if(_0x71b16b[_0x65f6('0x38')]!==_0x65f6('0x39')){var _0x313be5={};_0x313be5[_0x71b16b[_0x65f6('0x23')]]={'$like':'%'+_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]+'%'};return _0x313be5;}})});}_0x4ac04b=_[_0x65f6('0x37')]({},_0x4ac04b,_0x28d0df['options']);var _0x3aa254={'where':_0x4ac04b['where']};return db[_0x65f6('0x27')][_0x65f6('0x1a')](_0x3aa254)[_0x65f6('0x21')](function(_0x2ea7f7){_0x266cfe['count']=_0x2ea7f7;if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x4ac04b[_0x65f6('0x3b')]=[{'attributes':['id',_0x65f6('0x23'),_0x65f6('0x3c'),_0x65f6('0x3d')],'model':db[_0x65f6('0x3e')],'as':_0x65f6('0x3e')}];}return db[_0x65f6('0x27')]['findAll'](_0x4ac04b);})[_0x65f6('0x21')](function(_0x400ed2){_0x266cfe[_0x65f6('0x3f')]=_0x400ed2;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))[_0x65f6('0x40')](handleError(_0x559330,null));};exports[_0x65f6('0x41')]=function(_0xe0b72d,_0x2e91e8){var _0x461393={'raw':!![],'where':{'id':_0xe0b72d[_0x65f6('0x42')]['id']}},_0x2abbed={};_0x2abbed[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x2abbed[_0x65f6('0x2c')]=_['keys'](_0xe0b72d[_0x65f6('0x2c')]);_0x2abbed[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],_0x2abbed['query']);_0x461393[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],qs['fields'](_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x2f')]));_0x461393[_0x65f6('0x30')]=_0x461393[_0x65f6('0x30')]['length']?_0x461393[_0x65f6('0x30')]:_0x2abbed['model'];if(_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x461393['include']=[{'all':!![]}];}_0x461393=_[_0x65f6('0x37')]({},_0x461393,_0xe0b72d['options']);return db[_0x65f6('0x27')][_0x65f6('0x43')](_0x461393)[_0x65f6('0x21')](handleEntityNotFound(_0x2e91e8,null))[_0x65f6('0x21')](respondWithResult(_0x2e91e8,null))[_0x65f6('0x40')](handleError(_0x2e91e8,null));};exports[_0x65f6('0x44')]=function(_0x4d30c5,_0x51bf6c){return db[_0x65f6('0x27')][_0x65f6('0x44')](_0x4d30c5[_0x65f6('0x45')],{})[_0x65f6('0x21')](respondWithResult(_0x51bf6c,0xc9))[_0x65f6('0x40')](handleError(_0x51bf6c,null));};exports[_0x65f6('0x20')]=function(_0x149c28,_0x41690c){return db[_0x65f6('0x27')]['find']({'where':{'id':_0x149c28[_0x65f6('0x42')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x41690c,null))[_0x65f6('0x21')](removeEntity(_0x41690c,null))['catch'](handleError(_0x41690c,null));};exports[_0x65f6('0x46')]=function(_0x42d453,_0x49ba5a){return db[_0x65f6('0x27')][_0x65f6('0x46')]()['then'](respondWithResult(_0x49ba5a,null))[_0x65f6('0x40')](handleError(_0x49ba5a,null));};exports['update']=function(_0x247be3,_0x3b241f){if(_0x247be3[_0x65f6('0x45')]['uniqueid']){delete _0x247be3[_0x65f6('0x45')][_0x65f6('0x47')];}return db['VoiceCallReport'][_0x65f6('0x43')]({'where':{'uniqueid':_0x247be3[_0x65f6('0x42')]['id'],'UserId':{'$or':[null,_0x247be3['user']['id']]}}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b241f,null))[_0x65f6('0x21')](saveUpdates(_0x247be3[_0x65f6('0x45')],null))[_0x65f6('0x21')](respondWithResult(_0x3b241f,null))[_0x65f6('0x40')](handleError(_0x3b241f,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index a0cd11f..c0efe62 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 _0x7ee3=['VoiceCallReport','report_call','uniqueid','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','define'];(function(_0x14e0d1,_0x15dd5a){var _0x453de6=function(_0x49717b){while(--_0x49717b){_0x14e0d1['push'](_0x14e0d1['shift']());}};_0x453de6(++_0x15dd5a);}(_0x7ee3,0xf3));var _0x37ee=function(_0x3fa1e1,_0x4e39f0){_0x3fa1e1=_0x3fa1e1-0x0;var _0x1cc2ad=_0x7ee3[_0x3fa1e1];return _0x1cc2ad;};'use strict';var _=require('lodash');var util=require(_0x37ee('0x0'));var logger=require(_0x37ee('0x1'))(_0x37ee('0x2'));var moment=require(_0x37ee('0x3'));var BPromise=require(_0x37ee('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x37ee('0x5'));var rimraf=require(_0x37ee('0x6'));var config=require(_0x37ee('0x7'));var attributes=require('./voiceCallReport.attributes');module['exports']=function(_0x51f200,_0x5383d4){return _0x51f200[_0x37ee('0x8')](_0x37ee('0x9'),attributes,{'tableName':_0x37ee('0xa'),'paranoid':![],'indexes':[{'fields':[_0x37ee('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcf74=['./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call','uniqueid','lodash','util','api','bluebird','request-promise','path','rimraf'];(function(_0x4bd385,_0x3a3e0a){var _0x3bbd36=function(_0x1c5be2){while(--_0x1c5be2){_0x4bd385['push'](_0x4bd385['shift']());}};_0x3bbd36(++_0x3a3e0a);}(_0xcf74,0x17f));var _0x4cf7=function(_0x3bf6e0,_0x5333e6){_0x3bf6e0=_0x3bf6e0-0x0;var _0x5a7814=_0xcf74[_0x3bf6e0];return _0x5a7814;};'use strict';var _=require(_0x4cf7('0x0'));var util=require(_0x4cf7('0x1'));var logger=require('../../config/logger')(_0x4cf7('0x2'));var moment=require('moment');var BPromise=require(_0x4cf7('0x3'));var rp=require(_0x4cf7('0x4'));var fs=require('fs');var path=require(_0x4cf7('0x5'));var rimraf=require(_0x4cf7('0x6'));var config=require('../../config/environment');var attributes=require(_0x4cf7('0x7'));module[_0x4cf7('0x8')]=function(_0x3c8edf,_0x40275f){return _0x3c8edf[_0x4cf7('0x9')](_0x4cf7('0xa'),attributes,{'tableName':_0x4cf7('0xb'),'paranoid':![],'indexes':[{'fields':[_0x4cf7('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index b8d0297..b406320 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 _0xa371=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','GetVoiceCallReport','VoiceCallReport','options','raw','attributes','include','map','model','catch','CreateVoiceCallReport','create','body','UpdateVoiceCallReport','update','where','limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa371,0x19b));var _0x1a37=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xa371[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x1a37('0x0'));var util=require('util');var moment=require(_0x1a37('0x1'));var BPromise=require(_0x1a37('0x2'));var rs=require(_0x1a37('0x3'));var fs=require('fs');var Redis=require(_0x1a37('0x4'));var db=require(_0x1a37('0x5'))['db'];var utils=require(_0x1a37('0x6'));var logger=require('../../config/logger')(_0x1a37('0x7'));var config=require(_0x1a37('0x8'));var jayson=require(_0x1a37('0x9'));var client=jayson[_0x1a37('0xa')][_0x1a37('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5e359f,_0x5701c6,_0x434a85){return new BPromise(function(_0x41dd69,_0x391194){return client[_0x1a37('0xc')](_0x5e359f,_0x434a85)[_0x1a37('0xd')](function(_0x5d6d23){logger[_0x1a37('0xe')](_0x1a37('0xf'),_0x5701c6,_0x1a37('0x10'));logger[_0x1a37('0x11')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x5701c6,_0x1a37('0x10'),JSON[_0x1a37('0x12')](_0x5d6d23));if(_0x5d6d23[_0x1a37('0x13')]){if(_0x5d6d23['error']['code']===0x1f4){logger[_0x1a37('0x13')](_0x1a37('0xf'),_0x5701c6,_0x5d6d23[_0x1a37('0x13')]['message']);return _0x391194(_0x5d6d23[_0x1a37('0x13')][_0x1a37('0x14')]);}logger[_0x1a37('0x13')](_0x1a37('0xf'),_0x5701c6,_0x5d6d23[_0x1a37('0x13')]['message']);return _0x41dd69(_0x5d6d23[_0x1a37('0x13')]['message']);}else{logger[_0x1a37('0xe')](_0x1a37('0xf'),_0x5701c6,_0x1a37('0x10'));_0x41dd69(_0x5d6d23[_0x1a37('0x15')][_0x1a37('0x14')]);}})['catch'](function(_0x61422a){logger['error'](_0x1a37('0xf'),_0x5701c6,_0x61422a);_0x391194(_0x61422a);});});}exports[_0x1a37('0x16')]=function(_0x10283c){var _0x3fcb91=this;return new Promise(function(_0x3e3636,_0x54bd42){return db[_0x1a37('0x17')]['findAll']({'raw':_0x10283c[_0x1a37('0x18')]?_0x10283c['options'][_0x1a37('0x19')]===undefined?!![]:![]:!![],'where':_0x10283c[_0x1a37('0x18')]?_0x10283c['options']['where']||null:null,'attributes':_0x10283c[_0x1a37('0x18')]?_0x10283c[_0x1a37('0x18')][_0x1a37('0x1a')]||null:null,'limit':_0x10283c['options']?_0x10283c[_0x1a37('0x18')]['limit']||null:null,'include':_0x10283c[_0x1a37('0x18')]?_0x10283c[_0x1a37('0x18')][_0x1a37('0x1b')]?_[_0x1a37('0x1c')](_0x10283c['options'][_0x1a37('0x1b')],function(_0x368bf1){return{'model':db[_0x368bf1['model']],'as':_0x368bf1['as'],'attributes':_0x368bf1['attributes'],'include':_0x368bf1[_0x1a37('0x1b')]?_[_0x1a37('0x1c')](_0x368bf1[_0x1a37('0x1b')],function(_0x1d1aa7){return{'model':db[_0x1d1aa7[_0x1a37('0x1d')]],'as':_0x1d1aa7['as'],'attributes':_0x1d1aa7[_0x1a37('0x1a')],'include':_0x1d1aa7[_0x1a37('0x1b')]?_['map'](_0x1d1aa7[_0x1a37('0x1b')],function(_0x393e84){return{'model':db[_0x393e84[_0x1a37('0x1d')]],'as':_0x393e84['as'],'attributes':_0x393e84['attributes']};}):[]};}):[]};}):[]:[]})[_0x1a37('0xd')](function(_0x538e06){logger['info']('GetVoiceCallReport',_0x10283c);logger[_0x1a37('0x11')]('GetVoiceCallReport',_0x10283c,JSON[_0x1a37('0x12')](_0x538e06));_0x3e3636(_0x538e06);})[_0x1a37('0x1e')](function(_0x4fc449){logger['error']('GetVoiceCallReport',_0x4fc449[_0x1a37('0x14')],_0x10283c);_0x54bd42(_0x3fcb91[_0x1a37('0x13')](0x1f4,_0x4fc449[_0x1a37('0x14')]));});});};exports[_0x1a37('0x1f')]=function(_0x338d54){var _0x4a80b1=this;return new Promise(function(_0x3a040a,_0x175e2e){return db['VoiceCallReport'][_0x1a37('0x20')](_0x338d54[_0x1a37('0x21')],{'raw':_0x338d54[_0x1a37('0x18')]?_0x338d54[_0x1a37('0x18')][_0x1a37('0x19')]===undefined?!![]:![]:!![]})[_0x1a37('0xd')](function(_0x735153){logger['info'](_0x1a37('0x1f'),_0x338d54);logger[_0x1a37('0x11')]('CreateVoiceCallReport',_0x338d54,JSON['stringify'](_0x735153));_0x3a040a(_0x735153);})[_0x1a37('0x1e')](function(_0x44b7ad){logger[_0x1a37('0x13')]('CreateVoiceCallReport',_0x44b7ad[_0x1a37('0x14')],_0x338d54);_0x175e2e(_0x4a80b1[_0x1a37('0x13')](0x1f4,_0x44b7ad['message']));});});};exports[_0x1a37('0x22')]=function(_0x2e95f6){var _0x1c74da=this;return new Promise(function(_0x5ce356,_0x2e8fa7){return db[_0x1a37('0x17')][_0x1a37('0x23')](_0x2e95f6[_0x1a37('0x21')],{'raw':_0x2e95f6[_0x1a37('0x18')]?_0x2e95f6[_0x1a37('0x18')][_0x1a37('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2e95f6['options']?_0x2e95f6[_0x1a37('0x18')][_0x1a37('0x24')]||null:null,'attributes':_0x2e95f6[_0x1a37('0x18')]?_0x2e95f6[_0x1a37('0x18')]['attributes']||null:null,'limit':_0x2e95f6[_0x1a37('0x18')]?_0x2e95f6[_0x1a37('0x18')][_0x1a37('0x25')]||null:null})['then'](function(_0x302266){logger[_0x1a37('0xe')]('UpdateVoiceCallReport',_0x2e95f6);logger['debug']('UpdateVoiceCallReport',_0x2e95f6,JSON['stringify'](_0x302266));_0x5ce356(_0x302266);})[_0x1a37('0x1e')](function(_0x398c37){logger[_0x1a37('0x13')]('UpdateVoiceCallReport',_0x398c37['message'],_0x2e95f6);_0x2e8fa7(_0x1c74da[_0x1a37('0x13')](0x1f4,_0x398c37['message']));});});}; \ No newline at end of file +var _0x9a25=['catch','GetVoiceCallReport','VoiceCallReport','options','where','limit','include','map','model','attributes','debug','CreateVoiceCallReport','create','update','body','UpdateVoiceCallReport','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','VoiceCallReport,\x20%s,\x20%s','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result'];(function(_0x4cbe62,_0x17a899){var _0x25b0ab=function(_0x588d14){while(--_0x588d14){_0x4cbe62['push'](_0x4cbe62['shift']());}};_0x25b0ab(++_0x17a899);}(_0x9a25,0x82));var _0x59a2=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9a25[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x59a2('0x0'));var util=require(_0x59a2('0x1'));var moment=require(_0x59a2('0x2'));var BPromise=require('bluebird');var rs=require(_0x59a2('0x3'));var fs=require('fs');var Redis=require(_0x59a2('0x4'));var db=require(_0x59a2('0x5'))['db'];var utils=require(_0x59a2('0x6'));var logger=require(_0x59a2('0x7'))(_0x59a2('0x8'));var config=require('../../config/environment');var jayson=require(_0x59a2('0x9'));var client=jayson[_0x59a2('0xa')][_0x59a2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x11f4b6,_0x1c0b78,_0x55c444){return new BPromise(function(_0x4058d1,_0x5d8873){return client['request'](_0x11f4b6,_0x55c444)[_0x59a2('0xc')](function(_0xeede92){logger['info'](_0x59a2('0xd'),_0x1c0b78,'request\x20sent');logger['debug'](_0x59a2('0xe'),_0x1c0b78,'request\x20sent',JSON[_0x59a2('0xf')](_0xeede92));if(_0xeede92[_0x59a2('0x10')]){if(_0xeede92['error'][_0x59a2('0x11')]===0x1f4){logger[_0x59a2('0x10')](_0x59a2('0xd'),_0x1c0b78,_0xeede92['error'][_0x59a2('0x12')]);return _0x5d8873(_0xeede92['error'][_0x59a2('0x12')]);}logger[_0x59a2('0x10')](_0x59a2('0xd'),_0x1c0b78,_0xeede92[_0x59a2('0x10')][_0x59a2('0x12')]);return _0x4058d1(_0xeede92[_0x59a2('0x10')][_0x59a2('0x12')]);}else{logger[_0x59a2('0x13')]('VoiceCallReport,\x20%s,\x20%s',_0x1c0b78,_0x59a2('0x14'));_0x4058d1(_0xeede92[_0x59a2('0x15')][_0x59a2('0x12')]);}})[_0x59a2('0x16')](function(_0x112b2d){logger[_0x59a2('0x10')](_0x59a2('0xd'),_0x1c0b78,_0x112b2d);_0x5d8873(_0x112b2d);});});}exports[_0x59a2('0x17')]=function(_0x4fbb10){var _0x49b95b=this;return new Promise(function(_0x45a221,_0x4bc1d7){return db[_0x59a2('0x18')]['findAll']({'raw':_0x4fbb10['options']?_0x4fbb10[_0x59a2('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x4fbb10['options']?_0x4fbb10[_0x59a2('0x19')][_0x59a2('0x1a')]||null:null,'attributes':_0x4fbb10[_0x59a2('0x19')]?_0x4fbb10['options']['attributes']||null:null,'limit':_0x4fbb10['options']?_0x4fbb10[_0x59a2('0x19')][_0x59a2('0x1b')]||null:null,'include':_0x4fbb10['options']?_0x4fbb10[_0x59a2('0x19')][_0x59a2('0x1c')]?_[_0x59a2('0x1d')](_0x4fbb10[_0x59a2('0x19')][_0x59a2('0x1c')],function(_0x3d8412){return{'model':db[_0x3d8412[_0x59a2('0x1e')]],'as':_0x3d8412['as'],'attributes':_0x3d8412[_0x59a2('0x1f')],'include':_0x3d8412[_0x59a2('0x1c')]?_[_0x59a2('0x1d')](_0x3d8412[_0x59a2('0x1c')],function(_0x4be729){return{'model':db[_0x4be729[_0x59a2('0x1e')]],'as':_0x4be729['as'],'attributes':_0x4be729[_0x59a2('0x1f')],'include':_0x4be729[_0x59a2('0x1c')]?_[_0x59a2('0x1d')](_0x4be729[_0x59a2('0x1c')],function(_0x3b3cb7){return{'model':db[_0x3b3cb7[_0x59a2('0x1e')]],'as':_0x3b3cb7['as'],'attributes':_0x3b3cb7[_0x59a2('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x54276c){logger[_0x59a2('0x13')](_0x59a2('0x17'),_0x4fbb10);logger[_0x59a2('0x20')](_0x59a2('0x17'),_0x4fbb10,JSON[_0x59a2('0xf')](_0x54276c));_0x45a221(_0x54276c);})[_0x59a2('0x16')](function(_0x2b2fd9){logger[_0x59a2('0x10')](_0x59a2('0x17'),_0x2b2fd9[_0x59a2('0x12')],_0x4fbb10);_0x4bc1d7(_0x49b95b['error'](0x1f4,_0x2b2fd9[_0x59a2('0x12')]));});});};exports[_0x59a2('0x21')]=function(_0x598f26){var _0x48e2d0=this;return new Promise(function(_0x15871f,_0x1d20e5){return db[_0x59a2('0x18')][_0x59a2('0x22')](_0x598f26['body'],{'raw':_0x598f26[_0x59a2('0x19')]?_0x598f26['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x22d38b){logger[_0x59a2('0x13')](_0x59a2('0x21'),_0x598f26);logger[_0x59a2('0x20')](_0x59a2('0x21'),_0x598f26,JSON['stringify'](_0x22d38b));_0x15871f(_0x22d38b);})['catch'](function(_0x2b25df){logger[_0x59a2('0x10')](_0x59a2('0x21'),_0x2b25df[_0x59a2('0x12')],_0x598f26);_0x1d20e5(_0x48e2d0[_0x59a2('0x10')](0x1f4,_0x2b25df[_0x59a2('0x12')]));});});};exports['UpdateVoiceCallReport']=function(_0x15c788){var _0x3b387c=this;return new Promise(function(_0x1f74d2,_0x4e59c8){return db[_0x59a2('0x18')][_0x59a2('0x23')](_0x15c788[_0x59a2('0x24')],{'raw':_0x15c788[_0x59a2('0x19')]?_0x15c788[_0x59a2('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x15c788[_0x59a2('0x19')]?_0x15c788[_0x59a2('0x19')]['where']||null:null,'attributes':_0x15c788['options']?_0x15c788[_0x59a2('0x19')][_0x59a2('0x1f')]||null:null,'limit':_0x15c788[_0x59a2('0x19')]?_0x15c788['options'][_0x59a2('0x1b')]||null:null})[_0x59a2('0xc')](function(_0x575d8e){logger[_0x59a2('0x13')](_0x59a2('0x25'),_0x15c788);logger[_0x59a2('0x20')](_0x59a2('0x25'),_0x15c788,JSON[_0x59a2('0xf')](_0x575d8e));_0x1f74d2(_0x575d8e);})[_0x59a2('0x16')](function(_0x3684d5){logger[_0x59a2('0x10')](_0x59a2('0x25'),_0x3684d5[_0x59a2('0x12')],_0x15c788);_0x4e59c8(_0x3b387c[_0x59a2('0x10')](0x1f4,_0x3684d5[_0x59a2('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 02b4c9a..69048fe 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 _0x7ed4=['Router','../../components/auth/service','../../components/interaction/service','index','get','/:id','isAuthenticated','post','create','put','destroy','exports','util','path','connect-timeout','express'];(function(_0x39dd35,_0xdd745a){var _0x22d37e=function(_0x208769){while(--_0x208769){_0x39dd35['push'](_0x39dd35['shift']());}};_0x22d37e(++_0xdd745a);}(_0x7ed4,0xcc));var _0x47ed=function(_0x1806d4,_0x47cc68){_0x1806d4=_0x1806d4-0x0;var _0x392c2c=_0x7ed4[_0x1806d4];return _0x392c2c;};'use strict';var multer=require('multer');var util=require(_0x47ed('0x0'));var path=require(_0x47ed('0x1'));var timeout=require(_0x47ed('0x2'));var express=require(_0x47ed('0x3'));var router=express[_0x47ed('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47ed('0x5'));var interaction=require(_0x47ed('0x6'));var config=require('../../config/environment');var controller=require('./voiceChanSpy.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x47ed('0x7')]);router[_0x47ed('0x8')](_0x47ed('0x9'),auth[_0x47ed('0xa')](),controller['show']);router[_0x47ed('0xb')]('/',auth[_0x47ed('0xa')](),controller[_0x47ed('0xc')]);router[_0x47ed('0xd')](_0x47ed('0x9'),auth[_0x47ed('0xa')](),controller['update']);router['delete'](_0x47ed('0x9'),auth[_0x47ed('0xa')](),controller[_0x47ed('0xe')]);module[_0x47ed('0xf')]=router; \ No newline at end of file +var _0x34df=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','index','/:id','isAuthenticated','post','create','put','update','destroy'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x34df,0xfc));var _0xf34d=function(_0x4c0622,_0x5dacaf){_0x4c0622=_0x4c0622-0x0;var _0x1799d8=_0x34df[_0x4c0622];return _0x1799d8;};'use strict';var multer=require('multer');var util=require(_0xf34d('0x0'));var path=require(_0xf34d('0x1'));var timeout=require(_0xf34d('0x2'));var express=require(_0xf34d('0x3'));var router=express[_0xf34d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf34d('0x5'));var interaction=require(_0xf34d('0x6'));var config=require(_0xf34d('0x7'));var controller=require(_0xf34d('0x8'));router[_0xf34d('0x9')]('/',auth['isAuthenticated'](),controller[_0xf34d('0xa')]);router[_0xf34d('0x9')](_0xf34d('0xb'),auth[_0xf34d('0xc')](),controller['show']);router[_0xf34d('0xd')]('/',auth[_0xf34d('0xc')](),controller[_0xf34d('0xe')]);router[_0xf34d('0xf')](_0xf34d('0xb'),auth[_0xf34d('0xc')](),controller[_0xf34d('0x10')]);router['delete']('/:id',auth[_0xf34d('0xc')](),controller[_0xf34d('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 6e42981..be777a4 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 _0x94b8=['getDataValue','options','split','BOOLEAN','sequelize','exports','STRING','join'];(function(_0x5061a1,_0x27d844){var _0x132aa7=function(_0x3044d4){while(--_0x3044d4){_0x5061a1['push'](_0x5061a1['shift']());}};_0x132aa7(++_0x27d844);}(_0x94b8,0xb4));var _0x894b=function(_0x5dc362,_0x4c656c){_0x5dc362=_0x5dc362-0x0;var _0x19690b=_0x94b8[_0x5dc362];return _0x19690b;};'use strict';var Sequelize=require(_0x894b('0x0'));module[_0x894b('0x1')]={'name':{'type':Sequelize[_0x894b('0x2')]},'prefix':{'type':Sequelize[_0x894b('0x2')],'unique':'name','allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x32d30f){this['setDataValue']('options',_0x32d30f?_0x32d30f[_0x894b('0x3')](''):[]);},'get':function(){return this[_0x894b('0x4')](_0x894b('0x5'))?this[_0x894b('0x4')]('options')[_0x894b('0x6')](''):[];}},'auth':{'type':Sequelize[_0x894b('0x7')],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize[_0x894b('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x894b('0x2')]},'description':{'type':Sequelize[_0x894b('0x2')]}}; \ No newline at end of file +var _0x203a=['setDataValue','options','join','getDataValue','split','BOOLEAN','exports','STRING','name'];(function(_0x129c24,_0x256111){var _0x2214db=function(_0xd8c36d){while(--_0xd8c36d){_0x129c24['push'](_0x129c24['shift']());}};_0x2214db(++_0x256111);}(_0x203a,0x72));var _0xa203=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x203a[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require('sequelize');module[_0xa203('0x0')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0xa203('0x1')],'unique':_0xa203('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0xa203('0x1')],'set':function(_0x15fd26){this[_0xa203('0x3')](_0xa203('0x4'),_0x15fd26?_0x15fd26[_0xa203('0x5')](''):[]);},'get':function(){return this[_0xa203('0x6')]('options')?this['getDataValue'](_0xa203('0x4'))[_0xa203('0x7')](''):[];}},'auth':{'type':Sequelize[_0xa203('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0xa203('0x1')]},'record':{'type':Sequelize[_0xa203('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xa203('0x1')]},'description':{'type':Sequelize[_0xa203('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 3cd75a5..7632b55 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 _0x9755=['papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','destroy','ChanSpies','then','end','error','name','index','map','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','type','VIRTUAL','VoiceChanSpy','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring'];(function(_0x34646f,_0x55a313){var _0x490624=function(_0x327c4f){while(--_0x327c4f){_0x34646f['push'](_0x34646f['shift']());}};_0x490624(++_0x55a313);}(_0x9755,0x1c6));var _0x5975=function(_0x4471ff,_0x4bb7de){_0x4471ff=_0x4471ff-0x0;var _0xe723ca=_0x9755[_0x4471ff];return _0xe723ca;};'use strict';var emlformat=require(_0x5975('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5975('0x1'));var jsonpatch=require(_0x5975('0x2'));var rp=require(_0x5975('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5975('0x4'));var path=require(_0x5975('0x5'));var sox=require(_0x5975('0x6'));var csv=require(_0x5975('0x7'));var ejs=require(_0x5975('0x8'));var fs=require('fs');var fs_extra=require(_0x5975('0x9'));var _=require(_0x5975('0xa'));var squel=require('squel');var crypto=require(_0x5975('0xb'));var jsforce=require(_0x5975('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x5975('0x7'));var querystring=require(_0x5975('0xd'));var Papa=require(_0x5975('0xe'));var Redis=require('ioredis');var authService=require(_0x5975('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5975('0x10'));var logger=require(_0x5975('0x11'))(_0x5975('0x12'));var utils=require('../../config/utils');var config=require(_0x5975('0x13'));var licenseUtil=require(_0x5975('0x14'));var db=require(_0x5975('0x15'))['db'];function respondWithStatusCode(_0x52bdaa,_0x119571){_0x119571=_0x119571||0xcc;return function(_0x2ad3ed){if(_0x2ad3ed){return _0x52bdaa[_0x5975('0x16')](_0x119571);}return _0x52bdaa[_0x5975('0x17')](_0x119571)['end']();};}function respondWithResult(_0x5e355a,_0x331385){_0x331385=_0x331385||0xc8;return function(_0x1543c5){if(_0x1543c5){return _0x5e355a[_0x5975('0x17')](_0x331385)['json'](_0x1543c5);}};}function respondWithFilteredResult(_0x1a3299,_0x4de825){return function(_0x145f39){if(_0x145f39){var _0x58da02=typeof _0x4de825[_0x5975('0x18')]===_0x5975('0x19')&&typeof _0x4de825[_0x5975('0x1a')]===_0x5975('0x19');var _0x25f2a0=_0x145f39[_0x5975('0x1b')];var _0x203829=_0x58da02?0x0:_0x4de825['offset'];var _0x4e6806=_0x58da02?_0x145f39['count']:_0x4de825['offset']+_0x4de825['limit'];var _0x296185;if(_0x4e6806>=_0x25f2a0){_0x4e6806=_0x25f2a0;_0x296185=0xc8;}else{_0x296185=0xce;}_0x1a3299['status'](_0x296185);return _0x1a3299[_0x5975('0x1c')](_0x5975('0x1d'),_0x203829+'-'+_0x4e6806+'/'+_0x25f2a0)[_0x5975('0x1e')](_0x145f39);}return null;};}function patchUpdates(_0x1977bb){return function(_0x5a9df3){try{jsonpatch[_0x5975('0x1f')](_0x5a9df3,_0x1977bb,!![]);}catch(_0x133e32){return BPromise[_0x5975('0x20')](_0x133e32);}return _0x5a9df3['save']();};}function saveUpdates(_0x34b195,_0xc916a8){return function(_0x1689e2){if(_0x1689e2){return _0x1689e2[_0x5975('0x21')](_0x34b195)['then'](function(_0x48d708){return _0x48d708;});}return null;};}function removeEntity(_0x1cef80,_0x2da6c8){return function(_0x504892){if(_0x504892){return _0x504892[_0x5975('0x22')]()['then'](function(){var _0x43e097=_0x504892['get']({'plain':!![]});var _0x5e8b5a=_0x5975('0x23');return db['UserProfileResource'][_0x5975('0x22')]({'where':{'type':_0x5e8b5a,'resourceId':_0x43e097['id']}})[_0x5975('0x24')](function(){return _0x504892;});})['then'](function(){_0x1cef80['status'](0xcc)[_0x5975('0x25')]();});}};}function handleEntityNotFound(_0x1c1551,_0x2932c1){return function(_0x154e1a){if(!_0x154e1a){_0x1c1551[_0x5975('0x16')](0x194);}return _0x154e1a;};}function handleError(_0x23e5d1,_0x161fe2){_0x161fe2=_0x161fe2||0x1f4;return function(_0x24ee17){logger[_0x5975('0x26')](_0x24ee17['stack']);if(_0x24ee17[_0x5975('0x27')]){delete _0x24ee17[_0x5975('0x27')];}_0x23e5d1[_0x5975('0x17')](_0x161fe2)['send'](_0x24ee17);};}exports[_0x5975('0x28')]=function(_0x5778f7,_0x4bfd10){var _0x2df91e={},_0x191376={},_0x3c6476={'count':0x0,'rows':[]};var _0x344e42=_[_0x5975('0x29')](db['VoiceChanSpy'][_0x5975('0x2a')],function(_0x57de92){return{'name':_0x57de92['fieldName'],'type':_0x57de92['type']['key']};});_0x191376[_0x5975('0x2b')]=_[_0x5975('0x29')](_0x344e42,_0x5975('0x27'));_0x191376[_0x5975('0x2c')]=_[_0x5975('0x2d')](_0x5778f7[_0x5975('0x2c')]);_0x191376[_0x5975('0x2e')]=_[_0x5975('0x2f')](_0x191376[_0x5975('0x2b')],_0x191376[_0x5975('0x2c')]);_0x2df91e[_0x5975('0x30')]=_[_0x5975('0x2f')](_0x191376[_0x5975('0x2b')],qs[_0x5975('0x31')](_0x5778f7[_0x5975('0x2c')][_0x5975('0x31')]));_0x2df91e[_0x5975('0x30')]=_0x2df91e[_0x5975('0x30')][_0x5975('0x32')]?_0x2df91e[_0x5975('0x30')]:_0x191376['model'];if(!_0x5778f7[_0x5975('0x2c')][_0x5975('0x33')]('nolimit')){_0x2df91e[_0x5975('0x1a')]=qs[_0x5975('0x1a')](_0x5778f7[_0x5975('0x2c')]['limit']);_0x2df91e[_0x5975('0x18')]=qs[_0x5975('0x18')](_0x5778f7[_0x5975('0x2c')]['offset']);}_0x2df91e[_0x5975('0x34')]=qs[_0x5975('0x35')](_0x5778f7[_0x5975('0x2c')]['sort']);_0x2df91e['where']=qs[_0x5975('0x2e')](_[_0x5975('0x36')](_0x5778f7['query'],_0x191376['filters']),_0x344e42);if(_0x5778f7['query'][_0x5975('0x37')]){_0x2df91e[_0x5975('0x38')]=_[_0x5975('0x39')](_0x2df91e[_0x5975('0x38')],{'$or':_[_0x5975('0x29')](_0x344e42,function(_0x55850b){if(_0x55850b[_0x5975('0x3a')]!==_0x5975('0x3b')){var _0x16c5c0={};_0x16c5c0[_0x55850b[_0x5975('0x27')]]={'$like':'%'+_0x5778f7[_0x5975('0x2c')]['filter']+'%'};return _0x16c5c0;}})});}_0x2df91e=_['merge']({},_0x2df91e,_0x5778f7['options']);var _0xa8d266={'where':_0x2df91e[_0x5975('0x38')]};return db[_0x5975('0x3c')]['count'](_0xa8d266)[_0x5975('0x24')](function(_0x1cff9f){_0x3c6476[_0x5975('0x1b')]=_0x1cff9f;if(_0x5778f7['query'][_0x5975('0x3d')]){_0x2df91e[_0x5975('0x3e')]=[{'all':!![]}];}return db[_0x5975('0x3c')][_0x5975('0x3f')](_0x2df91e);})['then'](function(_0x3cfb3a){_0x3c6476[_0x5975('0x40')]=_0x3cfb3a;return _0x3c6476;})[_0x5975('0x24')](respondWithFilteredResult(_0x4bfd10,_0x2df91e))[_0x5975('0x41')](handleError(_0x4bfd10,null));};exports[_0x5975('0x42')]=function(_0x468097,_0x2c309e){var _0x50485c={'raw':![],'where':{'id':_0x468097[_0x5975('0x43')]['id']}},_0xaa7afe={};_0xaa7afe['model']=_['keys'](db[_0x5975('0x3c')][_0x5975('0x2a')]);_0xaa7afe[_0x5975('0x2c')]=_['keys'](_0x468097[_0x5975('0x2c')]);_0xaa7afe['filters']=_[_0x5975('0x2f')](_0xaa7afe[_0x5975('0x2b')],_0xaa7afe[_0x5975('0x2c')]);_0x50485c[_0x5975('0x30')]=_[_0x5975('0x2f')](_0xaa7afe[_0x5975('0x2b')],qs[_0x5975('0x31')](_0x468097[_0x5975('0x2c')][_0x5975('0x31')]));_0x50485c[_0x5975('0x30')]=_0x50485c[_0x5975('0x30')][_0x5975('0x32')]?_0x50485c[_0x5975('0x30')]:_0xaa7afe['model'];if(_0x468097[_0x5975('0x2c')][_0x5975('0x3d')]){_0x50485c[_0x5975('0x3e')]=[{'all':!![]}];}_0x50485c=_[_0x5975('0x39')]({},_0x50485c,_0x468097[_0x5975('0x44')]);return db['VoiceChanSpy'][_0x5975('0x45')](_0x50485c)[_0x5975('0x24')](handleEntityNotFound(_0x2c309e,null))['then'](respondWithResult(_0x2c309e,null))[_0x5975('0x41')](handleError(_0x2c309e,null));};exports[_0x5975('0x46')]=function(_0x5045b1,_0x4214e8){return db['VoiceChanSpy'][_0x5975('0x46')](_0x5045b1[_0x5975('0x47')],{})[_0x5975('0x24')](function(_0xcb2f4a){var _0x581105=_0x5045b1[_0x5975('0x48')]['get']({'plain':!![]});if(!_0x581105)throw new Error(_0x5975('0x49'));if(_0x581105['role']===_0x5975('0x48')){var _0x135060=_0xcb2f4a['get']({'plain':!![]});var _0x66c009=_0x5975('0x23');return db[_0x5975('0x4a')][_0x5975('0x45')]({'where':{'name':_0x66c009,'userProfileId':_0x581105[_0x5975('0x4b')]},'raw':!![]})['then'](function(_0x131156){if(_0x131156&&_0x131156['autoAssociation']===0x0){return db[_0x5975('0x4c')]['create']({'name':_0x135060[_0x5975('0x27')],'resourceId':_0x135060['id'],'type':_0x131156['name'],'sectionId':_0x131156['id']},{})[_0x5975('0x24')](function(){return _0xcb2f4a;});}else{return _0xcb2f4a;}})[_0x5975('0x41')](function(_0x5972cc){logger[_0x5975('0x26')](_0x5975('0x4d'),_0x5972cc);throw _0x5972cc;});}return _0xcb2f4a;})[_0x5975('0x24')](respondWithResult(_0x4214e8,0xc9))[_0x5975('0x41')](handleError(_0x4214e8,null));};exports[_0x5975('0x21')]=function(_0x59548e,_0x1ab342){if(_0x59548e[_0x5975('0x47')]['id']){delete _0x59548e[_0x5975('0x47')]['id'];}return db[_0x5975('0x3c')][_0x5975('0x45')]({'where':{'id':_0x59548e[_0x5975('0x43')]['id']}})[_0x5975('0x24')](handleEntityNotFound(_0x1ab342,null))[_0x5975('0x24')](saveUpdates(_0x59548e[_0x5975('0x47')],null))['then'](respondWithResult(_0x1ab342,null))[_0x5975('0x41')](handleError(_0x1ab342,null));};exports['destroy']=function(_0x308853,_0x19fe1c){return db[_0x5975('0x3c')][_0x5975('0x45')]({'where':{'id':_0x308853[_0x5975('0x43')]['id']}})['then'](handleEntityNotFound(_0x19fe1c,null))[_0x5975('0x24')](removeEntity(_0x19fe1c,null))[_0x5975('0x41')](handleError(_0x19fe1c,null));}; \ No newline at end of file +var _0x6f7a=['order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','update','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','ChanSpies','destroy','then','sendStatus','error','stack','name','send','index','VoiceChanSpy','rawAttributes','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x2d99ae,_0x383b09){var _0xd941eb=function(_0x3df3b3){while(--_0x3df3b3){_0x2d99ae['push'](_0x2d99ae['shift']());}};_0xd941eb(++_0x383b09);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x2de27c,_0x537dda){_0x2de27c=_0x2de27c-0x0;var _0x3de7c5=_0x6f7a[_0x2de27c];return _0x3de7c5;};'use strict';var emlformat=require(_0xa6f7('0x0'));var rimraf=require(_0xa6f7('0x1'));var zipdir=require(_0xa6f7('0x2'));var jsonpatch=require(_0xa6f7('0x3'));var rp=require('request-promise');var moment=require(_0xa6f7('0x4'));var BPromise=require(_0xa6f7('0x5'));var Mustache=require(_0xa6f7('0x6'));var util=require(_0xa6f7('0x7'));var path=require(_0xa6f7('0x8'));var sox=require(_0xa6f7('0x9'));var csv=require(_0xa6f7('0xa'));var ejs=require(_0xa6f7('0xb'));var fs=require('fs');var fs_extra=require(_0xa6f7('0xc'));var _=require(_0xa6f7('0xd'));var squel=require(_0xa6f7('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa6f7('0xf'));var toCsv=require(_0xa6f7('0xa'));var querystring=require(_0xa6f7('0x10'));var Papa=require(_0xa6f7('0x11'));var Redis=require(_0xa6f7('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa6f7('0x13'));var hardwareService=require(_0xa6f7('0x14'));var logger=require('../../config/logger')(_0xa6f7('0x15'));var utils=require('../../config/utils');var config=require(_0xa6f7('0x16'));var licenseUtil=require(_0xa6f7('0x17'));var db=require(_0xa6f7('0x18'))['db'];function respondWithStatusCode(_0xd5558b,_0x5a3035){_0x5a3035=_0x5a3035||0xcc;return function(_0x3fc7f1){if(_0x3fc7f1){return _0xd5558b['sendStatus'](_0x5a3035);}return _0xd5558b[_0xa6f7('0x19')](_0x5a3035)[_0xa6f7('0x1a')]();};}function respondWithResult(_0x25c123,_0x4d3d59){_0x4d3d59=_0x4d3d59||0xc8;return function(_0x34c02d){if(_0x34c02d){return _0x25c123['status'](_0x4d3d59)[_0xa6f7('0x1b')](_0x34c02d);}};}function respondWithFilteredResult(_0x57308a,_0x17b814){return function(_0x17f9c5){if(_0x17f9c5){var _0x6efd38=typeof _0x17b814['offset']===_0xa6f7('0x1c')&&typeof _0x17b814[_0xa6f7('0x1d')]===_0xa6f7('0x1c');var _0x2401b9=_0x17f9c5['count'];var _0x4a8827=_0x6efd38?0x0:_0x17b814[_0xa6f7('0x1e')];var _0x5298ba=_0x6efd38?_0x17f9c5[_0xa6f7('0x1f')]:_0x17b814[_0xa6f7('0x1e')]+_0x17b814['limit'];var _0x18fc4a;if(_0x5298ba>=_0x2401b9){_0x5298ba=_0x2401b9;_0x18fc4a=0xc8;}else{_0x18fc4a=0xce;}_0x57308a[_0xa6f7('0x19')](_0x18fc4a);return _0x57308a[_0xa6f7('0x20')](_0xa6f7('0x21'),_0x4a8827+'-'+_0x5298ba+'/'+_0x2401b9)[_0xa6f7('0x1b')](_0x17f9c5);}return null;};}function patchUpdates(_0x1aa8dc){return function(_0x4887ad){try{jsonpatch[_0xa6f7('0x22')](_0x4887ad,_0x1aa8dc,!![]);}catch(_0x45d79e){return BPromise['reject'](_0x45d79e);}return _0x4887ad['save']();};}function saveUpdates(_0x5ddc8d,_0x1de6c9){return function(_0x119950){if(_0x119950){return _0x119950['update'](_0x5ddc8d)['then'](function(_0x50e2be){return _0x50e2be;});}return null;};}function removeEntity(_0x2b6a84,_0xc77e8e){return function(_0x28263e){if(_0x28263e){return _0x28263e['destroy']()['then'](function(){var _0x2f4907=_0x28263e['get']({'plain':!![]});var _0x47ef97=_0xa6f7('0x23');return db['UserProfileResource'][_0xa6f7('0x24')]({'where':{'type':_0x47ef97,'resourceId':_0x2f4907['id']}})[_0xa6f7('0x25')](function(){return _0x28263e;});})[_0xa6f7('0x25')](function(){_0x2b6a84[_0xa6f7('0x19')](0xcc)[_0xa6f7('0x1a')]();});}};}function handleEntityNotFound(_0x4b8d2b,_0x51db47){return function(_0x1c419b){if(!_0x1c419b){_0x4b8d2b[_0xa6f7('0x26')](0x194);}return _0x1c419b;};}function handleError(_0x55d45a,_0x267917){_0x267917=_0x267917||0x1f4;return function(_0x27babb){logger[_0xa6f7('0x27')](_0x27babb[_0xa6f7('0x28')]);if(_0x27babb[_0xa6f7('0x29')]){delete _0x27babb[_0xa6f7('0x29')];}_0x55d45a[_0xa6f7('0x19')](_0x267917)[_0xa6f7('0x2a')](_0x27babb);};}exports[_0xa6f7('0x2b')]=function(_0x3dee2e,_0x40b0f8){var _0x278bad={},_0x52f9c1={},_0x442ccf={'count':0x0,'rows':[]};var _0x42dc49=_['map'](db[_0xa6f7('0x2c')][_0xa6f7('0x2d')],function(_0x4d79d8){return{'name':_0x4d79d8['fieldName'],'type':_0x4d79d8[_0xa6f7('0x2e')][_0xa6f7('0x2f')]};});_0x52f9c1[_0xa6f7('0x30')]=_[_0xa6f7('0x31')](_0x42dc49,_0xa6f7('0x29'));_0x52f9c1['query']=_['keys'](_0x3dee2e[_0xa6f7('0x32')]);_0x52f9c1['filters']=_[_0xa6f7('0x33')](_0x52f9c1[_0xa6f7('0x30')],_0x52f9c1[_0xa6f7('0x32')]);_0x278bad[_0xa6f7('0x34')]=_[_0xa6f7('0x33')](_0x52f9c1[_0xa6f7('0x30')],qs['fields'](_0x3dee2e[_0xa6f7('0x32')][_0xa6f7('0x35')]));_0x278bad[_0xa6f7('0x34')]=_0x278bad['attributes'][_0xa6f7('0x36')]?_0x278bad['attributes']:_0x52f9c1[_0xa6f7('0x30')];if(!_0x3dee2e[_0xa6f7('0x32')][_0xa6f7('0x37')]('nolimit')){_0x278bad[_0xa6f7('0x1d')]=qs[_0xa6f7('0x1d')](_0x3dee2e[_0xa6f7('0x32')][_0xa6f7('0x1d')]);_0x278bad[_0xa6f7('0x1e')]=qs[_0xa6f7('0x1e')](_0x3dee2e['query'][_0xa6f7('0x1e')]);}_0x278bad[_0xa6f7('0x38')]=qs[_0xa6f7('0x39')](_0x3dee2e[_0xa6f7('0x32')][_0xa6f7('0x39')]);_0x278bad[_0xa6f7('0x3a')]=qs[_0xa6f7('0x3b')](_[_0xa6f7('0x3c')](_0x3dee2e['query'],_0x52f9c1[_0xa6f7('0x3b')]),_0x42dc49);if(_0x3dee2e[_0xa6f7('0x32')][_0xa6f7('0x3d')]){_0x278bad['where']=_[_0xa6f7('0x3e')](_0x278bad[_0xa6f7('0x3a')],{'$or':_['map'](_0x42dc49,function(_0x39349a){if(_0x39349a[_0xa6f7('0x2e')]!==_0xa6f7('0x3f')){var _0x14d532={};_0x14d532[_0x39349a[_0xa6f7('0x29')]]={'$like':'%'+_0x3dee2e['query'][_0xa6f7('0x3d')]+'%'};return _0x14d532;}})});}_0x278bad=_[_0xa6f7('0x3e')]({},_0x278bad,_0x3dee2e[_0xa6f7('0x40')]);var _0x1b8bf3={'where':_0x278bad[_0xa6f7('0x3a')]};return db[_0xa6f7('0x2c')][_0xa6f7('0x1f')](_0x1b8bf3)[_0xa6f7('0x25')](function(_0x5646b9){_0x442ccf['count']=_0x5646b9;if(_0x3dee2e[_0xa6f7('0x32')][_0xa6f7('0x41')]){_0x278bad[_0xa6f7('0x42')]=[{'all':!![]}];}return db[_0xa6f7('0x2c')][_0xa6f7('0x43')](_0x278bad);})[_0xa6f7('0x25')](function(_0x21fdd7){_0x442ccf[_0xa6f7('0x44')]=_0x21fdd7;return _0x442ccf;})[_0xa6f7('0x25')](respondWithFilteredResult(_0x40b0f8,_0x278bad))[_0xa6f7('0x45')](handleError(_0x40b0f8,null));};exports['show']=function(_0x41917c,_0x30be3b){var _0x4d5846={'raw':![],'where':{'id':_0x41917c[_0xa6f7('0x46')]['id']}},_0x22d500={};_0x22d500[_0xa6f7('0x30')]=_[_0xa6f7('0x47')](db['VoiceChanSpy'][_0xa6f7('0x2d')]);_0x22d500['query']=_['keys'](_0x41917c[_0xa6f7('0x32')]);_0x22d500[_0xa6f7('0x3b')]=_[_0xa6f7('0x33')](_0x22d500[_0xa6f7('0x30')],_0x22d500[_0xa6f7('0x32')]);_0x4d5846[_0xa6f7('0x34')]=_[_0xa6f7('0x33')](_0x22d500['model'],qs[_0xa6f7('0x35')](_0x41917c[_0xa6f7('0x32')]['fields']));_0x4d5846[_0xa6f7('0x34')]=_0x4d5846[_0xa6f7('0x34')][_0xa6f7('0x36')]?_0x4d5846['attributes']:_0x22d500[_0xa6f7('0x30')];if(_0x41917c['query'][_0xa6f7('0x41')]){_0x4d5846[_0xa6f7('0x42')]=[{'all':!![]}];}_0x4d5846=_[_0xa6f7('0x3e')]({},_0x4d5846,_0x41917c['options']);return db['VoiceChanSpy'][_0xa6f7('0x48')](_0x4d5846)['then'](handleEntityNotFound(_0x30be3b,null))[_0xa6f7('0x25')](respondWithResult(_0x30be3b,null))['catch'](handleError(_0x30be3b,null));};exports['create']=function(_0x1e7089,_0x2e3a04){return db[_0xa6f7('0x2c')][_0xa6f7('0x49')](_0x1e7089[_0xa6f7('0x4a')],{})[_0xa6f7('0x25')](function(_0x5d9b6f){var _0x4032fc=_0x1e7089[_0xa6f7('0x4b')]['get']({'plain':!![]});if(!_0x4032fc)throw new Error(_0xa6f7('0x4c'));if(_0x4032fc['role']===_0xa6f7('0x4b')){var _0x59091a=_0x5d9b6f['get']({'plain':!![]});var _0x60eacc=_0xa6f7('0x23');return db[_0xa6f7('0x4d')][_0xa6f7('0x48')]({'where':{'name':_0x60eacc,'userProfileId':_0x4032fc[_0xa6f7('0x4e')]},'raw':!![]})['then'](function(_0x340d3f){if(_0x340d3f&&_0x340d3f[_0xa6f7('0x4f')]===0x0){return db['UserProfileResource'][_0xa6f7('0x49')]({'name':_0x59091a['name'],'resourceId':_0x59091a['id'],'type':_0x340d3f[_0xa6f7('0x29')],'sectionId':_0x340d3f['id']},{})[_0xa6f7('0x25')](function(){return _0x5d9b6f;});}else{return _0x5d9b6f;}})[_0xa6f7('0x45')](function(_0x55369a){logger[_0xa6f7('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x55369a);throw _0x55369a;});}return _0x5d9b6f;})[_0xa6f7('0x25')](respondWithResult(_0x2e3a04,0xc9))[_0xa6f7('0x45')](handleError(_0x2e3a04,null));};exports[_0xa6f7('0x50')]=function(_0x1dcb45,_0xa6bff9){if(_0x1dcb45['body']['id']){delete _0x1dcb45['body']['id'];}return db[_0xa6f7('0x2c')][_0xa6f7('0x48')]({'where':{'id':_0x1dcb45[_0xa6f7('0x46')]['id']}})[_0xa6f7('0x25')](handleEntityNotFound(_0xa6bff9,null))['then'](saveUpdates(_0x1dcb45[_0xa6f7('0x4a')],null))[_0xa6f7('0x25')](respondWithResult(_0xa6bff9,null))[_0xa6f7('0x45')](handleError(_0xa6bff9,null));};exports[_0xa6f7('0x24')]=function(_0x1b33a5,_0x39538e){return db['VoiceChanSpy'][_0xa6f7('0x48')]({'where':{'id':_0x1b33a5[_0xa6f7('0x46')]['id']}})[_0xa6f7('0x25')](handleEntityNotFound(_0x39538e,null))['then'](removeEntity(_0x39538e,null))[_0xa6f7('0x45')](handleError(_0x39538e,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 3624c08..b976f60 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 _0xefda=['models','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','catch','destroy','lodash','util','bluebird','./voiceChanSpy.attributes','context','format','prefix','push','merge','CDR(type)=%s','record','${UNIQUEID}.%s,a','recordingFormat','Authenticate','ChanSpy','SIP/%s,%s','name','options','join','length','concat','internal','User','findAll','agent','then'];(function(_0x478212,_0x2b86d2){var _0x49f310=function(_0x809c7c){while(--_0x809c7c){_0x478212['push'](_0x478212['shift']());}};_0x49f310(++_0x2b86d2);}(_0xefda,0x130));var _0xaefd=function(_0x192937,_0x445940){_0x192937=_0x192937-0x0;var _0x289d0d=_0xefda[_0x192937];return _0x289d0d;};'use strict';var _=require(_0xaefd('0x0'));var util=require(_0xaefd('0x1'));var BPromise=require(_0xaefd('0x2'));var attributes=require(_0xaefd('0x3'));var getUserApplications=function(_0x78e1e0,_0x2fa461,_0x3ddcca){var _0x36bc00=0x1;var _0x438622=[];var _0xaa731c={'context':_0x2fa461[_0xaefd('0x4')]||'from-sip','exten':util[_0xaefd('0x5')]('%s%s',_0x78e1e0[_0xaefd('0x6')],_0x3ddcca),'type':'system','isApp':![],'ChanSpyId':_0x78e1e0['id'],'UserId':_0x2fa461['id']};_0x438622[_0xaefd('0x7')](_[_0xaefd('0x8')]({'app':'Set','appdata':util['format'](_0xaefd('0x9'),'chanspy'),'priority':_0x36bc00++},_0xaa731c));if(_0x78e1e0[_0xaefd('0xa')]){_0x438622[_0xaefd('0x7')](_[_0xaefd('0x8')]({'app':'MixMonitor','appdata':util['format'](_0xaefd('0xb'),_0x78e1e0[_0xaefd('0xc')]),'priority':_0x36bc00++},_0xaa731c));}if(_0x78e1e0['auth']){_0x438622['push'](_[_0xaefd('0x8')]({'app':_0xaefd('0xd'),'appdata':_0x78e1e0['password'],'priority':_0x36bc00++},_0xaa731c));}_0x438622[_0xaefd('0x7')](_[_0xaefd('0x8')]({'app':_0xaefd('0xe'),'appdata':util[_0xaefd('0x5')](_0xaefd('0xf'),_0x2fa461[_0xaefd('0x10')],_0x78e1e0[_0xaefd('0x11')]?_0x78e1e0['options'][_0xaefd('0x12')](''):''),'priority':_0x36bc00++},_0xaa731c));if(_0x78e1e0[_0xaefd('0xa')]){_0x438622[_0xaefd('0x7')](_[_0xaefd('0x8')]({'app':'StopMixMonitor','priority':_0x36bc00++},_0xaa731c));}return _0x438622;};var getChanSpyApplications=function(_0x415fbf,_0x54a50b){var _0x378887=[];for(var _0x307dd=0x0,_0x258153=0x1;_0x307dd<_0x54a50b[_0xaefd('0x13')];_0x307dd++,_0x258153=0x1){_0x378887=_0x378887[_0xaefd('0x14')](getUserApplications(_0x415fbf,_0x54a50b[_0x307dd],_0x54a50b[_0x307dd]['internal']));if(_0x54a50b[_0x307dd][_0xaefd('0x15')]!=_0x54a50b[_0x307dd]['name']){_0x378887=_0x378887[_0xaefd('0x14')](getUserApplications(_0x415fbf,_0x54a50b[_0x307dd],_0x54a50b[_0x307dd][_0xaefd('0x10')]));}}return _0x378887;};var getChanSpyPromise=function(_0x1e3189,_0x31137f){return new BPromise(function(_0x32eb84,_0x52f824){return _0x1e3189[_0xaefd('0x16')][_0xaefd('0x17')]({'attributes':['id',_0xaefd('0x10'),_0xaefd('0x15')],'where':{'role':_0xaefd('0x18'),'chanspy':!![]},'raw':!![]})[_0xaefd('0x19')](function(_0x4d5b06){if(_0x4d5b06){return _0x32eb84(getChanSpyApplications(_0x31137f,_0x4d5b06));}return _0x32eb84([]);})['catch'](function(_0x349d65){_0x52f824(_0x349d65);});});};module['exports']=function(_0x204f35,_0x457efa){var _0x2295fd=_0x204f35[_0xaefd('0x1a')];return _0x204f35['define'](_0xaefd('0x1b'),attributes,{'tableName':_0xaefd('0x1c'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x3a36cf,_0x46672f,_0x48e84c){return getChanSpyPromise(_0x2295fd,_0x3a36cf)[_0xaefd('0x19')](function(_0x31296c){if(_0x31296c&&_0x31296c['length']){return _0x2295fd[_0xaefd('0x1d')][_0xaefd('0x1e')](_0x31296c);}})['then'](function(){_0x48e84c();})[_0xaefd('0x1f')](function(_0x41707c){_0x48e84c(_0x41707c);});},'afterUpdate':function(_0xe58f14,_0x5f125e,_0x25e677){return _0x2295fd[_0xaefd('0x1d')][_0xaefd('0x20')]({'where':{'ChanSpyId':_0xe58f14['id']}})[_0xaefd('0x19')](function(){return getChanSpyPromise(_0x2295fd,_0xe58f14);})[_0xaefd('0x19')](function(_0x2c9631){if(_0x2c9631&&_0x2c9631[_0xaefd('0x13')]){return _0x2295fd[_0xaefd('0x1d')][_0xaefd('0x1e')](_0x2c9631);}})[_0xaefd('0x19')](function(){_0x25e677();})[_0xaefd('0x1f')](function(_0x3f107c){_0x25e677(_0x3f107c);});},'afterDestroy':function(_0x2016a6,_0x38ef98,_0x2159aa){return _0x2295fd[_0xaefd('0x1d')][_0xaefd('0x20')]({'where':{'ChanSpyId':_0x2016a6['id']}})['then'](function(){_0x2159aa();})[_0xaefd('0x1f')](function(_0xd2451d){_0x2159aa(_0xd2451d);});}}});}; \ No newline at end of file +var _0x9433=['length','concat','internal','User','findAll','agent','then','define','voice_chanspy','VoiceExtension','bulkCreate','catch','destroy','lodash','from-sip','format','%s%s','prefix','system','Set','CDR(type)=%s','chanspy','record','push','merge','MixMonitor','${UNIQUEID}.%s,a','auth','password','SIP/%s,%s','name','options','join','StopMixMonitor'];(function(_0xb11639,_0x9c8aa8){var _0x2f87de=function(_0x3a7905){while(--_0x3a7905){_0xb11639['push'](_0xb11639['shift']());}};_0x2f87de(++_0x9c8aa8);}(_0x9433,0x1a5));var _0x3943=function(_0x1b1bd5,_0xf50a3){_0x1b1bd5=_0x1b1bd5-0x0;var _0x12bf17=_0x9433[_0x1b1bd5];return _0x12bf17;};'use strict';var _=require(_0x3943('0x0'));var util=require('util');var BPromise=require('bluebird');var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x5c2a0d,_0x4c3298,_0x3e7d73){var _0x3b8361=0x1;var _0x5d1de4=[];var _0x2748bd={'context':_0x4c3298['context']||_0x3943('0x1'),'exten':util[_0x3943('0x2')](_0x3943('0x3'),_0x5c2a0d[_0x3943('0x4')],_0x3e7d73),'type':_0x3943('0x5'),'isApp':![],'ChanSpyId':_0x5c2a0d['id'],'UserId':_0x4c3298['id']};_0x5d1de4['push'](_['merge']({'app':_0x3943('0x6'),'appdata':util[_0x3943('0x2')](_0x3943('0x7'),_0x3943('0x8')),'priority':_0x3b8361++},_0x2748bd));if(_0x5c2a0d[_0x3943('0x9')]){_0x5d1de4[_0x3943('0xa')](_[_0x3943('0xb')]({'app':_0x3943('0xc'),'appdata':util[_0x3943('0x2')](_0x3943('0xd'),_0x5c2a0d['recordingFormat']),'priority':_0x3b8361++},_0x2748bd));}if(_0x5c2a0d[_0x3943('0xe')]){_0x5d1de4['push'](_[_0x3943('0xb')]({'app':'Authenticate','appdata':_0x5c2a0d[_0x3943('0xf')],'priority':_0x3b8361++},_0x2748bd));}_0x5d1de4[_0x3943('0xa')](_[_0x3943('0xb')]({'app':'ChanSpy','appdata':util[_0x3943('0x2')](_0x3943('0x10'),_0x4c3298[_0x3943('0x11')],_0x5c2a0d[_0x3943('0x12')]?_0x5c2a0d[_0x3943('0x12')][_0x3943('0x13')](''):''),'priority':_0x3b8361++},_0x2748bd));if(_0x5c2a0d[_0x3943('0x9')]){_0x5d1de4['push'](_['merge']({'app':_0x3943('0x14'),'priority':_0x3b8361++},_0x2748bd));}return _0x5d1de4;};var getChanSpyApplications=function(_0x3dde41,_0x382f9f){var _0x2b86cd=[];for(var _0xf3659a=0x0,_0x1c5844=0x1;_0xf3659a<_0x382f9f[_0x3943('0x15')];_0xf3659a++,_0x1c5844=0x1){_0x2b86cd=_0x2b86cd[_0x3943('0x16')](getUserApplications(_0x3dde41,_0x382f9f[_0xf3659a],_0x382f9f[_0xf3659a][_0x3943('0x17')]));if(_0x382f9f[_0xf3659a][_0x3943('0x17')]!=_0x382f9f[_0xf3659a]['name']){_0x2b86cd=_0x2b86cd[_0x3943('0x16')](getUserApplications(_0x3dde41,_0x382f9f[_0xf3659a],_0x382f9f[_0xf3659a][_0x3943('0x11')]));}}return _0x2b86cd;};var getChanSpyPromise=function(_0x2ad867,_0x13738e){return new BPromise(function(_0x2ee301,_0x464763){return _0x2ad867[_0x3943('0x18')][_0x3943('0x19')]({'attributes':['id',_0x3943('0x11'),_0x3943('0x17')],'where':{'role':_0x3943('0x1a'),'chanspy':!![]},'raw':!![]})[_0x3943('0x1b')](function(_0x493521){if(_0x493521){return _0x2ee301(getChanSpyApplications(_0x13738e,_0x493521));}return _0x2ee301([]);})['catch'](function(_0xc13400){_0x464763(_0xc13400);});});};module['exports']=function(_0x5d34b5,_0x40fd1f){var _0x4f2f1d=_0x5d34b5['models'];return _0x5d34b5[_0x3943('0x1c')]('VoiceChanSpy',attributes,{'tableName':_0x3943('0x1d'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0xcdaede,_0x219103,_0x2afd66){return getChanSpyPromise(_0x4f2f1d,_0xcdaede)[_0x3943('0x1b')](function(_0xdd3337){if(_0xdd3337&&_0xdd3337[_0x3943('0x15')]){return _0x4f2f1d[_0x3943('0x1e')][_0x3943('0x1f')](_0xdd3337);}})['then'](function(){_0x2afd66();})[_0x3943('0x20')](function(_0x392745){_0x2afd66(_0x392745);});},'afterUpdate':function(_0x3ed8a7,_0x3074d9,_0x38dea0){return _0x4f2f1d['VoiceExtension']['destroy']({'where':{'ChanSpyId':_0x3ed8a7['id']}})[_0x3943('0x1b')](function(){return getChanSpyPromise(_0x4f2f1d,_0x3ed8a7);})[_0x3943('0x1b')](function(_0x6f1e2b){if(_0x6f1e2b&&_0x6f1e2b[_0x3943('0x15')]){return _0x4f2f1d[_0x3943('0x1e')][_0x3943('0x1f')](_0x6f1e2b);}})[_0x3943('0x1b')](function(){_0x38dea0();})['catch'](function(_0x5d49af){_0x38dea0(_0x5d49af);});},'afterDestroy':function(_0x1dc0d8,_0x4f04bc,_0x2bcafa){return _0x4f2f1d[_0x3943('0x1e')][_0x3943('0x21')]({'where':{'ChanSpyId':_0x1dc0d8['id']}})[_0x3943('0x1b')](function(){_0x2bcafa();})[_0x3943('0x20')](function(_0x2989dc){_0x2bcafa(_0x2989dc);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 5d949d0..b755d5a 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 _0xa902=['message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x46d0c9,_0x526bfa){var _0x174506=function(_0x654bc6){while(--_0x654bc6){_0x46d0c9['push'](_0x46d0c9['shift']());}};_0x174506(++_0x526bfa);}(_0xa902,0x8d));var _0x2a90=function(_0x5474d1,_0x1f2d57){_0x5474d1=_0x5474d1-0x0;var _0x3e18b1=_0xa902[_0x5474d1];return _0x3e18b1;};'use strict';var _=require(_0x2a90('0x0'));var util=require(_0x2a90('0x1'));var moment=require(_0x2a90('0x2'));var BPromise=require(_0x2a90('0x3'));var rs=require(_0x2a90('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2a90('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2a90('0x6'));var config=require(_0x2a90('0x7'));var jayson=require(_0x2a90('0x8'));var client=jayson[_0x2a90('0x9')][_0x2a90('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x25bcfc,_0x58369a,_0x4109e6){return new BPromise(function(_0x570659,_0x5ec2b9){return client[_0x2a90('0xb')](_0x25bcfc,_0x4109e6)[_0x2a90('0xc')](function(_0xe500bc){logger[_0x2a90('0xd')](_0x2a90('0xe'),_0x58369a,'request\x20sent');logger[_0x2a90('0xf')](_0x2a90('0x10'),_0x58369a,_0x2a90('0x11'),JSON[_0x2a90('0x12')](_0xe500bc));if(_0xe500bc['error']){if(_0xe500bc[_0x2a90('0x13')]['code']===0x1f4){logger[_0x2a90('0x13')]('VoiceChanSpy,\x20%s,\x20%s',_0x58369a,_0xe500bc[_0x2a90('0x13')]['message']);return _0x5ec2b9(_0xe500bc[_0x2a90('0x13')][_0x2a90('0x14')]);}logger[_0x2a90('0x13')]('VoiceChanSpy,\x20%s,\x20%s',_0x58369a,_0xe500bc['error']['message']);return _0x570659(_0xe500bc[_0x2a90('0x13')][_0x2a90('0x14')]);}else{logger['info'](_0x2a90('0xe'),_0x58369a,_0x2a90('0x11'));_0x570659(_0xe500bc[_0x2a90('0x15')][_0x2a90('0x14')]);}})[_0x2a90('0x16')](function(_0x37858e){logger[_0x2a90('0x13')](_0x2a90('0xe'),_0x58369a,_0x37858e);_0x5ec2b9(_0x37858e);});});} \ No newline at end of file +var _0x9099=['../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceChanSpy,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x545fe3,_0x3b191f){var _0x480702=function(_0x21c970){while(--_0x21c970){_0x545fe3['push'](_0x545fe3['shift']());}};_0x480702(++_0x3b191f);}(_0x9099,0x1ac));var _0x9909=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0x9099[_0x3635ce];return _0x97ecd0;};'use strict';var _=require(_0x9909('0x0'));var util=require('util');var moment=require(_0x9909('0x1'));var BPromise=require(_0x9909('0x2'));var rs=require(_0x9909('0x3'));var fs=require('fs');var Redis=require(_0x9909('0x4'));var db=require(_0x9909('0x5'))['db'];var utils=require(_0x9909('0x6'));var logger=require(_0x9909('0x7'))(_0x9909('0x8'));var config=require(_0x9909('0x9'));var jayson=require(_0x9909('0xa'));var client=jayson[_0x9909('0xb')][_0x9909('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3b7391,_0x3dc2dd,_0x54011f){return new BPromise(function(_0x6d755a,_0x5dcd39){return client['request'](_0x3b7391,_0x54011f)['then'](function(_0x5023b7){logger[_0x9909('0xd')]('VoiceChanSpy,\x20%s,\x20%s',_0x3dc2dd,_0x9909('0xe'));logger[_0x9909('0xf')](_0x9909('0x10'),_0x3dc2dd,'request\x20sent',JSON[_0x9909('0x11')](_0x5023b7));if(_0x5023b7['error']){if(_0x5023b7[_0x9909('0x12')][_0x9909('0x13')]===0x1f4){logger[_0x9909('0x12')](_0x9909('0x14'),_0x3dc2dd,_0x5023b7[_0x9909('0x12')][_0x9909('0x15')]);return _0x5dcd39(_0x5023b7[_0x9909('0x12')][_0x9909('0x15')]);}logger[_0x9909('0x12')](_0x9909('0x14'),_0x3dc2dd,_0x5023b7[_0x9909('0x12')][_0x9909('0x15')]);return _0x6d755a(_0x5023b7[_0x9909('0x12')]['message']);}else{logger[_0x9909('0xd')]('VoiceChanSpy,\x20%s,\x20%s',_0x3dc2dd,_0x9909('0xe'));_0x6d755a(_0x5023b7['result'][_0x9909('0x15')]);}})[_0x9909('0x16')](function(_0x245f0d){logger['error'](_0x9909('0x14'),_0x3dc2dd,_0x245f0d);_0x5dcd39(_0x245f0d);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index f4366b7..96e145c 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 _0x7196=['destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./voiceContext.controller','get','/:id','show','post','create','isAuthenticated','update'];(function(_0x15b0ec,_0x31bcc0){var _0x2d575b=function(_0x55dc03){while(--_0x55dc03){_0x15b0ec['push'](_0x15b0ec['shift']());}};_0x2d575b(++_0x31bcc0);}(_0x7196,0x71));var _0x6719=function(_0x2a4711,_0x5a9154){_0x2a4711=_0x2a4711-0x0;var _0xa7a0db=_0x7196[_0x2a4711];return _0xa7a0db;};'use strict';var multer=require(_0x6719('0x0'));var util=require('util');var path=require(_0x6719('0x1'));var timeout=require(_0x6719('0x2'));var express=require(_0x6719('0x3'));var router=express[_0x6719('0x4')]();var fs_extra=require(_0x6719('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6719('0x6'));var config=require('../../config/environment');var controller=require(_0x6719('0x7'));router[_0x6719('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6719('0x8')](_0x6719('0x9'),auth['isAuthenticated'](),controller[_0x6719('0xa')]);router[_0x6719('0xb')]('/',auth['isAuthenticated'](),controller[_0x6719('0xc')]);router['put'](_0x6719('0x9'),auth[_0x6719('0xd')](),controller[_0x6719('0xe')]);router['delete'](_0x6719('0x9'),auth[_0x6719('0xd')](),controller[_0x6719('0xf')]);module['exports']=router; \ No newline at end of file +var _0x4c6a=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','post','create','put','update','delete','exports'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x4c6a,0x187));var _0xa4c6=function(_0x595ed3,_0x2af96a){_0x595ed3=_0x595ed3-0x0;var _0x14d5c2=_0x4c6a[_0x595ed3];return _0x14d5c2;};'use strict';var multer=require(_0xa4c6('0x0'));var util=require(_0xa4c6('0x1'));var path=require(_0xa4c6('0x2'));var timeout=require(_0xa4c6('0x3'));var express=require('express');var router=express[_0xa4c6('0x4')]();var fs_extra=require(_0xa4c6('0x5'));var auth=require(_0xa4c6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa4c6('0x7'));var controller=require('./voiceContext.controller');router[_0xa4c6('0x8')]('/',auth[_0xa4c6('0x9')](),controller['index']);router[_0xa4c6('0x8')](_0xa4c6('0xa'),auth[_0xa4c6('0x9')](),controller['show']);router[_0xa4c6('0xb')]('/',auth[_0xa4c6('0x9')](),controller[_0xa4c6('0xc')]);router[_0xa4c6('0xd')](_0xa4c6('0xa'),auth[_0xa4c6('0x9')](),controller[_0xa4c6('0xe')]);router[_0xa4c6('0xf')](_0xa4c6('0xa'),auth[_0xa4c6('0x9')](),controller['destroy']);module[_0xa4c6('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index a897f78..e3b2b3a 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 _0x0e80=['STRING','sequelize','exports','name'];(function(_0xa483e4,_0x24b223){var _0x2bc1b2=function(_0x128044){while(--_0x128044){_0xa483e4['push'](_0xa483e4['shift']());}};_0x2bc1b2(++_0x24b223);}(_0x0e80,0x1ad));var _0x00e8=function(_0x4c6539,_0x2993e6){_0x4c6539=_0x4c6539-0x0;var _0x35d491=_0x0e80[_0x4c6539];return _0x35d491;};'use strict';var Sequelize=require(_0x00e8('0x0'));module[_0x00e8('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x00e8('0x2')},'description':{'type':Sequelize[_0x00e8('0x3')],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0xd3b6=['sequelize','exports','STRING'];(function(_0x113a93,_0x2eb6e9){var _0x112139=function(_0x4b9185){while(--_0x4b9185){_0x113a93['push'](_0x113a93['shift']());}};_0x112139(++_0x2eb6e9);}(_0xd3b6,0x9f));var _0x6d3b=function(_0x30bdd9,_0x2167d5){_0x30bdd9=_0x30bdd9-0x0;var _0x274549=_0xd3b6[_0x30bdd9];return _0x274549;};'use strict';var Sequelize=require(_0x6d3b('0x0'));module[_0x6d3b('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name'},'description':{'type':Sequelize[_0x6d3b('0x2')],'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 7803a61..378a6ce 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 _0x8f1a=['autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','writeFileSync','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceContext,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','undefined','limit','Content-Range','apply','reject','save','update','destroy','get','UserProfileResource','end','stack','name','send','VoiceContext','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','nolimit','sort','where','pick','filter','merge','count','includeAll','include','findAll','show','fields','options','create','body','readFileSync','join','root','server/files/templates/context.ejs','utf8','render','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','role','find','Contexts','userProfileId'];(function(_0x4d63db,_0x90dc10){var _0x2378fd=function(_0x164d91){while(--_0x164d91){_0x4d63db['push'](_0x4d63db['shift']());}};_0x2378fd(++_0x90dc10);}(_0x8f1a,0xd4));var _0xa8f1=function(_0xa8cbd6,_0x167435){_0xa8cbd6=_0xa8cbd6-0x0;var _0x1d2f49=_0x8f1a[_0xa8cbd6];return _0x1d2f49;};'use strict';var emlformat=require(_0xa8f1('0x0'));var rimraf=require(_0xa8f1('0x1'));var zipdir=require(_0xa8f1('0x2'));var jsonpatch=require(_0xa8f1('0x3'));var rp=require('request-promise');var moment=require(_0xa8f1('0x4'));var BPromise=require(_0xa8f1('0x5'));var Mustache=require(_0xa8f1('0x6'));var util=require('util');var path=require(_0xa8f1('0x7'));var sox=require('sox');var csv=require(_0xa8f1('0x8'));var ejs=require(_0xa8f1('0x9'));var fs=require('fs');var fs_extra=require(_0xa8f1('0xa'));var _=require(_0xa8f1('0xb'));var squel=require(_0xa8f1('0xc'));var crypto=require(_0xa8f1('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa8f1('0xe'));var Papa=require('papaparse');var Redis=require(_0xa8f1('0xf'));var authService=require(_0xa8f1('0x10'));var qs=require(_0xa8f1('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa8f1('0x12'));var logger=require(_0xa8f1('0x13'))(_0xa8f1('0x14'));var utils=require(_0xa8f1('0x15'));var config=require(_0xa8f1('0x16'));var licenseUtil=require(_0xa8f1('0x17'));var db=require(_0xa8f1('0x18'))['db'];var jayson=require(_0xa8f1('0x19'));var client=jayson[_0xa8f1('0x1a')][_0xa8f1('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x38227d,_0x3e9f05,_0x58d23a,_0x3051de){return new BPromise(function(_0x17784f,_0x2c58b5){var _0x32e3ca=_0x3051de||client;return _0x32e3ca[_0xa8f1('0x1c')](_0x38227d,_0x58d23a)[_0xa8f1('0x1d')](function(_0x17c925){logger[_0xa8f1('0x1e')]('VoiceContext,\x20%s,\x20%s',_0x3e9f05,_0xa8f1('0x1f'));logger[_0xa8f1('0x20')](_0xa8f1('0x21'),_0x3e9f05,_0xa8f1('0x1f'),JSON[_0xa8f1('0x22')](_0x17c925));if(_0x17c925[_0xa8f1('0x23')]){if(_0x17c925[_0xa8f1('0x23')][_0xa8f1('0x24')]===0x1f4){logger[_0xa8f1('0x23')](_0xa8f1('0x25'),_0x3e9f05,_0x17c925['error'][_0xa8f1('0x26')]);return _0x2c58b5(_0x17c925[_0xa8f1('0x23')][_0xa8f1('0x26')]);}logger[_0xa8f1('0x23')](_0xa8f1('0x25'),_0x3e9f05,_0x17c925[_0xa8f1('0x23')]['message']);return _0x17784f(_0x17c925['error'][_0xa8f1('0x26')]);}else{logger[_0xa8f1('0x1e')]('VoiceContext,\x20%s,\x20%s',_0x3e9f05,_0xa8f1('0x1f'));_0x17784f(_0x17c925[_0xa8f1('0x27')]['message']);}})[_0xa8f1('0x28')](function(_0x1a3a12){logger[_0xa8f1('0x23')](_0xa8f1('0x25'),_0x3e9f05,_0x1a3a12);_0x2c58b5(_0x1a3a12);});});}function respondWithStatusCode(_0x167019,_0x531a3a){_0x531a3a=_0x531a3a||0xcc;return function(_0x2d0596){if(_0x2d0596){return _0x167019[_0xa8f1('0x29')](_0x531a3a);}return _0x167019[_0xa8f1('0x2a')](_0x531a3a)['end']();};}function respondWithResult(_0x3bf9e4,_0x222877){_0x222877=_0x222877||0xc8;return function(_0xfacffc){if(_0xfacffc){return _0x3bf9e4['status'](_0x222877)[_0xa8f1('0x2b')](_0xfacffc);}};}function respondWithFilteredResult(_0x4a63e0,_0x2f1228){return function(_0x126da4){if(_0x126da4){var _0x136b44=typeof _0x2f1228[_0xa8f1('0x2c')]===_0xa8f1('0x2d')&&typeof _0x2f1228[_0xa8f1('0x2e')]===_0xa8f1('0x2d');var _0xae745d=_0x126da4['count'];var _0x298552=_0x136b44?0x0:_0x2f1228[_0xa8f1('0x2c')];var _0x262f86=_0x136b44?_0x126da4['count']:_0x2f1228[_0xa8f1('0x2c')]+_0x2f1228[_0xa8f1('0x2e')];var _0x25fc2b;if(_0x262f86>=_0xae745d){_0x262f86=_0xae745d;_0x25fc2b=0xc8;}else{_0x25fc2b=0xce;}_0x4a63e0['status'](_0x25fc2b);return _0x4a63e0['set'](_0xa8f1('0x2f'),_0x298552+'-'+_0x262f86+'/'+_0xae745d)[_0xa8f1('0x2b')](_0x126da4);}return null;};}function patchUpdates(_0x3f23c5){return function(_0x19d753){try{jsonpatch[_0xa8f1('0x30')](_0x19d753,_0x3f23c5,!![]);}catch(_0x40b966){return BPromise[_0xa8f1('0x31')](_0x40b966);}return _0x19d753[_0xa8f1('0x32')]();};}function saveUpdates(_0xedd200,_0x1bdd92){return function(_0x2952fa){if(_0x2952fa){return _0x2952fa[_0xa8f1('0x33')](_0xedd200)['then'](function(_0x12d7ca){return _0x12d7ca;});}return null;};}function removeEntity(_0x46a558,_0x18e815){return function(_0x499f9f){if(_0x499f9f){return _0x499f9f[_0xa8f1('0x34')]()['then'](function(){var _0x4ccc7c=_0x499f9f[_0xa8f1('0x35')]({'plain':!![]});var _0xb7215f='Contexts';return db[_0xa8f1('0x36')]['destroy']({'where':{'type':_0xb7215f,'resourceId':_0x4ccc7c['id']}})['then'](function(){return _0x499f9f;});})['then'](function(){_0x46a558['status'](0xcc)[_0xa8f1('0x37')]();});}};}function handleEntityNotFound(_0x52a1f1,_0x4699db){return function(_0x54fd2a){if(!_0x54fd2a){_0x52a1f1[_0xa8f1('0x29')](0x194);}return _0x54fd2a;};}function handleError(_0x162ac3,_0x5a287f){_0x5a287f=_0x5a287f||0x1f4;return function(_0x237092){logger['error'](_0x237092[_0xa8f1('0x38')]);if(_0x237092[_0xa8f1('0x39')]){delete _0x237092[_0xa8f1('0x39')];}_0x162ac3[_0xa8f1('0x2a')](_0x5a287f)[_0xa8f1('0x3a')](_0x237092);};}exports['index']=function(_0x354e93,_0x334d50){var _0x3048d2={},_0x41ccac={},_0x1f052b={'count':0x0,'rows':[]};var _0x2fe44d=_['map'](db[_0xa8f1('0x3b')][_0xa8f1('0x3c')],function(_0x13b02e){return{'name':_0x13b02e[_0xa8f1('0x3d')],'type':_0x13b02e[_0xa8f1('0x3e')][_0xa8f1('0x3f')]};});_0x41ccac[_0xa8f1('0x40')]=_[_0xa8f1('0x41')](_0x2fe44d,_0xa8f1('0x39'));_0x41ccac[_0xa8f1('0x42')]=_[_0xa8f1('0x43')](_0x354e93[_0xa8f1('0x42')]);_0x41ccac[_0xa8f1('0x44')]=_[_0xa8f1('0x45')](_0x41ccac['model'],_0x41ccac['query']);_0x3048d2[_0xa8f1('0x46')]=_[_0xa8f1('0x45')](_0x41ccac[_0xa8f1('0x40')],qs['fields'](_0x354e93[_0xa8f1('0x42')]['fields']));_0x3048d2['attributes']=_0x3048d2[_0xa8f1('0x46')]['length']?_0x3048d2[_0xa8f1('0x46')]:_0x41ccac[_0xa8f1('0x40')];if(!_0x354e93['query']['hasOwnProperty'](_0xa8f1('0x47'))){_0x3048d2[_0xa8f1('0x2e')]=qs[_0xa8f1('0x2e')](_0x354e93['query'][_0xa8f1('0x2e')]);_0x3048d2[_0xa8f1('0x2c')]=qs[_0xa8f1('0x2c')](_0x354e93[_0xa8f1('0x42')][_0xa8f1('0x2c')]);}_0x3048d2['order']=qs[_0xa8f1('0x48')](_0x354e93['query'][_0xa8f1('0x48')]);_0x3048d2[_0xa8f1('0x49')]=qs[_0xa8f1('0x44')](_[_0xa8f1('0x4a')](_0x354e93[_0xa8f1('0x42')],_0x41ccac[_0xa8f1('0x44')]),_0x2fe44d);if(_0x354e93['query'][_0xa8f1('0x4b')]){_0x3048d2['where']=_[_0xa8f1('0x4c')](_0x3048d2[_0xa8f1('0x49')],{'$or':_[_0xa8f1('0x41')](_0x2fe44d,function(_0x1c386c){if(_0x1c386c[_0xa8f1('0x3e')]!=='VIRTUAL'){var _0x5ba66b={};_0x5ba66b[_0x1c386c['name']]={'$like':'%'+_0x354e93[_0xa8f1('0x42')]['filter']+'%'};return _0x5ba66b;}})});}_0x3048d2=_[_0xa8f1('0x4c')]({},_0x3048d2,_0x354e93['options']);var _0x540cab={'where':_0x3048d2['where']};return db[_0xa8f1('0x3b')][_0xa8f1('0x4d')](_0x540cab)[_0xa8f1('0x1d')](function(_0x411f3a){_0x1f052b[_0xa8f1('0x4d')]=_0x411f3a;if(_0x354e93[_0xa8f1('0x42')][_0xa8f1('0x4e')]){_0x3048d2[_0xa8f1('0x4f')]=[{'all':!![]}];}return db[_0xa8f1('0x3b')][_0xa8f1('0x50')](_0x3048d2);})[_0xa8f1('0x1d')](function(_0x1b47c9){_0x1f052b['rows']=_0x1b47c9;return _0x1f052b;})[_0xa8f1('0x1d')](respondWithFilteredResult(_0x334d50,_0x3048d2))[_0xa8f1('0x28')](handleError(_0x334d50,null));};exports[_0xa8f1('0x51')]=function(_0x1729b1,_0x117c61){var _0xbf73e9={'raw':![],'where':{'id':_0x1729b1['params']['id']}},_0x372226={};_0x372226['model']=_[_0xa8f1('0x43')](db[_0xa8f1('0x3b')][_0xa8f1('0x3c')]);_0x372226[_0xa8f1('0x42')]=_[_0xa8f1('0x43')](_0x1729b1[_0xa8f1('0x42')]);_0x372226[_0xa8f1('0x44')]=_[_0xa8f1('0x45')](_0x372226[_0xa8f1('0x40')],_0x372226['query']);_0xbf73e9['attributes']=_['intersection'](_0x372226['model'],qs[_0xa8f1('0x52')](_0x1729b1[_0xa8f1('0x42')][_0xa8f1('0x52')]));_0xbf73e9[_0xa8f1('0x46')]=_0xbf73e9[_0xa8f1('0x46')]['length']?_0xbf73e9[_0xa8f1('0x46')]:_0x372226['model'];if(_0x1729b1[_0xa8f1('0x42')][_0xa8f1('0x4e')]){_0xbf73e9[_0xa8f1('0x4f')]=[{'all':!![]}];}_0xbf73e9=_['merge']({},_0xbf73e9,_0x1729b1[_0xa8f1('0x53')]);return db[_0xa8f1('0x3b')]['find'](_0xbf73e9)[_0xa8f1('0x1d')](handleEntityNotFound(_0x117c61,null))[_0xa8f1('0x1d')](respondWithResult(_0x117c61,null))[_0xa8f1('0x28')](handleError(_0x117c61,null));};exports[_0xa8f1('0x54')]=function(_0x47ecfa,_0x3cc074,_0x2b03a1){var _0x402efe;return db[_0xa8f1('0x3b')][_0xa8f1('0x54')](_0x47ecfa[_0xa8f1('0x55')],{'raw':!![]})[_0xa8f1('0x1d')](function(_0x54cb60){_0x402efe=_0x54cb60;return db[_0xa8f1('0x3b')]['findAll']({'raw':!![]});})[_0xa8f1('0x1d')](function(_0x1f3867){var _0x113f01=fs[_0xa8f1('0x56')](path[_0xa8f1('0x57')](config[_0xa8f1('0x58')],_0xa8f1('0x59')),_0xa8f1('0x5a'));var _0xa10c1e=ejs[_0xa8f1('0x5b')](_0x113f01,{'contexts':_0x1f3867||[]});fs['writeFileSync'](_0xa8f1('0x5c'),_0xa10c1e);})[_0xa8f1('0x1d')](function(){return respondWithRpcPromise(_0xa8f1('0x5d'),_0xa8f1('0x54'),{'module':_0xa8f1('0x5e')});})[_0xa8f1('0x1d')](function(){var _0x88b2d3=_0x47ecfa[_0xa8f1('0x5f')][_0xa8f1('0x35')]({'plain':!![]});if(!_0x88b2d3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x88b2d3[_0xa8f1('0x60')]===_0xa8f1('0x5f')){var _0x43c041=_0x402efe[_0xa8f1('0x35')]({'plain':!![]});return db['UserProfileSection'][_0xa8f1('0x61')]({'where':{'name':_0xa8f1('0x62'),'userProfileId':_0x88b2d3[_0xa8f1('0x63')]},'raw':!![]})['then'](function(_0xd160b3){if(_0xd160b3&&_0xd160b3[_0xa8f1('0x64')]===0x0){return db[_0xa8f1('0x36')][_0xa8f1('0x54')]({'name':_0x43c041[_0xa8f1('0x39')],'resourceId':_0x43c041['id'],'type':_0xd160b3['name'],'sectionId':_0xd160b3['id']},{})[_0xa8f1('0x1d')](function(){return _0x402efe;});}else{return _0x402efe;}})[_0xa8f1('0x28')](function(_0x3aaae6){logger[_0xa8f1('0x23')](_0xa8f1('0x65'),_0x3aaae6);throw _0x3aaae6;});}return _0x402efe;})['then'](respondWithResult(_0x3cc074,0xc9))[_0xa8f1('0x28')](handleError(_0x3cc074,null));};exports[_0xa8f1('0x33')]=function(_0x15a51c,_0x36f2ec,_0x390b57){var _0x555d54;return db[_0xa8f1('0x3b')]['find']({'where':{'id':_0x15a51c['params']['id']}})['then'](handleEntityNotFound(_0x36f2ec,null))[_0xa8f1('0x1d')](saveUpdates(_0x15a51c[_0xa8f1('0x55')],null))['then'](function(_0x40c2cf){if(_0x40c2cf){_0x555d54=_0x40c2cf;return db['VoiceContext'][_0xa8f1('0x50')]({'raw':!![]});}})['then'](function(_0x187388){var _0x345af2=fs[_0xa8f1('0x56')](path[_0xa8f1('0x57')](config[_0xa8f1('0x58')],_0xa8f1('0x59')),_0xa8f1('0x5a'));var _0x15b33c=ejs['render'](_0x345af2,{'contexts':_0x187388||[]});fs[_0xa8f1('0x66')](_0xa8f1('0x5c'),_0x15b33c);})[_0xa8f1('0x1d')](function(){return respondWithRpcPromise(_0xa8f1('0x5d'),_0xa8f1('0x33'),{'module':_0xa8f1('0x5e')});})[_0xa8f1('0x1d')](function(){return _0x555d54;})[_0xa8f1('0x1d')](respondWithResult(_0x36f2ec,null))[_0xa8f1('0x28')](handleError(_0x36f2ec,null));};exports[_0xa8f1('0x34')]=function(_0x1e4961,_0x3913a3,_0x4a3b2d){var _0x3db8dd;return db[_0xa8f1('0x3b')][_0xa8f1('0x61')]({'where':{'id':_0x1e4961[_0xa8f1('0x67')]['id']}})[_0xa8f1('0x1d')](handleEntityNotFound(_0x3913a3,null))[_0xa8f1('0x1d')](removeEntity(_0x3913a3,null))[_0xa8f1('0x1d')](function(){return db['VoiceContext'][_0xa8f1('0x50')]({'raw':!![]});})[_0xa8f1('0x1d')](function(_0x35a7b5){var _0x21875d=fs[_0xa8f1('0x56')](path[_0xa8f1('0x57')](config['root'],_0xa8f1('0x59')),_0xa8f1('0x5a'));var _0x278df8=ejs['render'](_0x21875d,{'contexts':_0x35a7b5});fs['writeFileSync'](_0xa8f1('0x5c'),_0x278df8);return respondWithRpcPromise(_0xa8f1('0x5d'),'destroy',{'module':'chan_sip.so'});})[_0xa8f1('0x28')](handleError(_0x3913a3,null));}; \ No newline at end of file +var _0x2ab3=['VIRTUAL','merge','includeAll','include','findAll','rows','catch','params','options','create','body','join','root','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','Contexts','userProfileId','find','readFileSync','server/files/templates/context.ejs','utf8','render','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','get','UserProfileResource','name','send','index','map','VoiceContext','rawAttributes','fieldName','type','key','keys','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2ab3,0x154));var _0x32ab=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x2ab3[_0x2b4411];return _0x8e41ef;};'use strict';var emlformat=require(_0x32ab('0x0'));var rimraf=require(_0x32ab('0x1'));var zipdir=require(_0x32ab('0x2'));var jsonpatch=require(_0x32ab('0x3'));var rp=require(_0x32ab('0x4'));var moment=require('moment');var BPromise=require(_0x32ab('0x5'));var Mustache=require(_0x32ab('0x6'));var util=require(_0x32ab('0x7'));var path=require(_0x32ab('0x8'));var sox=require(_0x32ab('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x32ab('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x32ab('0xb'));var jsforce=require(_0x32ab('0xc'));var deskjs=require(_0x32ab('0xd'));var toCsv=require(_0x32ab('0xe'));var querystring=require(_0x32ab('0xf'));var Papa=require(_0x32ab('0x10'));var Redis=require(_0x32ab('0x11'));var authService=require(_0x32ab('0x12'));var qs=require(_0x32ab('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ab('0x14'));var logger=require(_0x32ab('0x15'))('api');var utils=require(_0x32ab('0x16'));var config=require(_0x32ab('0x17'));var licenseUtil=require(_0x32ab('0x18'));var db=require(_0x32ab('0x19'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0x32ab('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x306039,_0x5d6f59,_0x4011c5,_0x52996d){return new BPromise(function(_0x23becc,_0x53b37f){var _0x3a64bb=_0x52996d||client;return _0x3a64bb[_0x32ab('0x1b')](_0x306039,_0x4011c5)[_0x32ab('0x1c')](function(_0x486d09){logger[_0x32ab('0x1d')](_0x32ab('0x1e'),_0x5d6f59,_0x32ab('0x1f'));logger['debug'](_0x32ab('0x20'),_0x5d6f59,_0x32ab('0x1f'),JSON['stringify'](_0x486d09));if(_0x486d09[_0x32ab('0x21')]){if(_0x486d09[_0x32ab('0x21')][_0x32ab('0x22')]===0x1f4){logger[_0x32ab('0x21')](_0x32ab('0x1e'),_0x5d6f59,_0x486d09[_0x32ab('0x21')]['message']);return _0x53b37f(_0x486d09['error'][_0x32ab('0x23')]);}logger[_0x32ab('0x21')](_0x32ab('0x1e'),_0x5d6f59,_0x486d09['error'][_0x32ab('0x23')]);return _0x23becc(_0x486d09[_0x32ab('0x21')][_0x32ab('0x23')]);}else{logger['info'](_0x32ab('0x1e'),_0x5d6f59,'request\x20sent');_0x23becc(_0x486d09[_0x32ab('0x24')][_0x32ab('0x23')]);}})['catch'](function(_0x11cd20){logger['error'](_0x32ab('0x1e'),_0x5d6f59,_0x11cd20);_0x53b37f(_0x11cd20);});});}function respondWithStatusCode(_0x5cec13,_0x190758){_0x190758=_0x190758||0xcc;return function(_0x148cc4){if(_0x148cc4){return _0x5cec13[_0x32ab('0x25')](_0x190758);}return _0x5cec13[_0x32ab('0x26')](_0x190758)[_0x32ab('0x27')]();};}function respondWithResult(_0x10ec68,_0x5bc47a){_0x5bc47a=_0x5bc47a||0xc8;return function(_0x31f8ed){if(_0x31f8ed){return _0x10ec68[_0x32ab('0x26')](_0x5bc47a)[_0x32ab('0x28')](_0x31f8ed);}};}function respondWithFilteredResult(_0x28568f,_0x4c3eea){return function(_0x33dad7){if(_0x33dad7){var _0x558348=typeof _0x4c3eea[_0x32ab('0x29')]===_0x32ab('0x2a')&&typeof _0x4c3eea[_0x32ab('0x2b')]===_0x32ab('0x2a');var _0x5ac7cf=_0x33dad7[_0x32ab('0x2c')];var _0x2522b7=_0x558348?0x0:_0x4c3eea[_0x32ab('0x29')];var _0x123c48=_0x558348?_0x33dad7[_0x32ab('0x2c')]:_0x4c3eea[_0x32ab('0x29')]+_0x4c3eea[_0x32ab('0x2b')];var _0x53499d;if(_0x123c48>=_0x5ac7cf){_0x123c48=_0x5ac7cf;_0x53499d=0xc8;}else{_0x53499d=0xce;}_0x28568f[_0x32ab('0x26')](_0x53499d);return _0x28568f[_0x32ab('0x2d')](_0x32ab('0x2e'),_0x2522b7+'-'+_0x123c48+'/'+_0x5ac7cf)[_0x32ab('0x28')](_0x33dad7);}return null;};}function patchUpdates(_0x42d084){return function(_0x41d869){try{jsonpatch[_0x32ab('0x2f')](_0x41d869,_0x42d084,!![]);}catch(_0x3be34c){return BPromise['reject'](_0x3be34c);}return _0x41d869[_0x32ab('0x30')]();};}function saveUpdates(_0x54c5f5,_0x4d27e6){return function(_0x1d38e4){if(_0x1d38e4){return _0x1d38e4[_0x32ab('0x31')](_0x54c5f5)[_0x32ab('0x1c')](function(_0x3a6521){return _0x3a6521;});}return null;};}function removeEntity(_0x47034e,_0x422df6){return function(_0x35c9d7){if(_0x35c9d7){return _0x35c9d7[_0x32ab('0x32')]()[_0x32ab('0x1c')](function(){var _0x3e7e57=_0x35c9d7[_0x32ab('0x33')]({'plain':!![]});var _0x418f95='Contexts';return db[_0x32ab('0x34')][_0x32ab('0x32')]({'where':{'type':_0x418f95,'resourceId':_0x3e7e57['id']}})[_0x32ab('0x1c')](function(){return _0x35c9d7;});})[_0x32ab('0x1c')](function(){_0x47034e[_0x32ab('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e3d0b,_0x4d4428){return function(_0x8a0740){if(!_0x8a0740){_0x4e3d0b[_0x32ab('0x25')](0x194);}return _0x8a0740;};}function handleError(_0x565191,_0x17b9ff){_0x17b9ff=_0x17b9ff||0x1f4;return function(_0x367477){logger[_0x32ab('0x21')](_0x367477['stack']);if(_0x367477[_0x32ab('0x35')]){delete _0x367477[_0x32ab('0x35')];}_0x565191[_0x32ab('0x26')](_0x17b9ff)[_0x32ab('0x36')](_0x367477);};}exports[_0x32ab('0x37')]=function(_0x57aa47,_0x1d2b8a){var _0x33ce6c={},_0x23597d={},_0x167730={'count':0x0,'rows':[]};var _0x4b69ea=_[_0x32ab('0x38')](db[_0x32ab('0x39')][_0x32ab('0x3a')],function(_0x1247ad){return{'name':_0x1247ad[_0x32ab('0x3b')],'type':_0x1247ad[_0x32ab('0x3c')][_0x32ab('0x3d')]};});_0x23597d['model']=_[_0x32ab('0x38')](_0x4b69ea,_0x32ab('0x35'));_0x23597d['query']=_[_0x32ab('0x3e')](_0x57aa47['query']);_0x23597d[_0x32ab('0x3f')]=_[_0x32ab('0x40')](_0x23597d[_0x32ab('0x41')],_0x23597d[_0x32ab('0x42')]);_0x33ce6c[_0x32ab('0x43')]=_[_0x32ab('0x40')](_0x23597d['model'],qs[_0x32ab('0x44')](_0x57aa47[_0x32ab('0x42')][_0x32ab('0x44')]));_0x33ce6c[_0x32ab('0x43')]=_0x33ce6c[_0x32ab('0x43')][_0x32ab('0x45')]?_0x33ce6c[_0x32ab('0x43')]:_0x23597d[_0x32ab('0x41')];if(!_0x57aa47[_0x32ab('0x42')][_0x32ab('0x46')](_0x32ab('0x47'))){_0x33ce6c['limit']=qs[_0x32ab('0x2b')](_0x57aa47[_0x32ab('0x42')][_0x32ab('0x2b')]);_0x33ce6c['offset']=qs[_0x32ab('0x29')](_0x57aa47[_0x32ab('0x42')][_0x32ab('0x29')]);}_0x33ce6c['order']=qs[_0x32ab('0x48')](_0x57aa47[_0x32ab('0x42')][_0x32ab('0x48')]);_0x33ce6c[_0x32ab('0x49')]=qs[_0x32ab('0x3f')](_[_0x32ab('0x4a')](_0x57aa47[_0x32ab('0x42')],_0x23597d[_0x32ab('0x3f')]),_0x4b69ea);if(_0x57aa47[_0x32ab('0x42')][_0x32ab('0x4b')]){_0x33ce6c[_0x32ab('0x49')]=_['merge'](_0x33ce6c[_0x32ab('0x49')],{'$or':_[_0x32ab('0x38')](_0x4b69ea,function(_0x48136b){if(_0x48136b[_0x32ab('0x3c')]!==_0x32ab('0x4c')){var _0x15b87b={};_0x15b87b[_0x48136b[_0x32ab('0x35')]]={'$like':'%'+_0x57aa47[_0x32ab('0x42')]['filter']+'%'};return _0x15b87b;}})});}_0x33ce6c=_[_0x32ab('0x4d')]({},_0x33ce6c,_0x57aa47['options']);var _0x403cd2={'where':_0x33ce6c['where']};return db[_0x32ab('0x39')][_0x32ab('0x2c')](_0x403cd2)[_0x32ab('0x1c')](function(_0x2e2951){_0x167730['count']=_0x2e2951;if(_0x57aa47[_0x32ab('0x42')][_0x32ab('0x4e')]){_0x33ce6c[_0x32ab('0x4f')]=[{'all':!![]}];}return db['VoiceContext'][_0x32ab('0x50')](_0x33ce6c);})['then'](function(_0x271c28){_0x167730[_0x32ab('0x51')]=_0x271c28;return _0x167730;})[_0x32ab('0x1c')](respondWithFilteredResult(_0x1d2b8a,_0x33ce6c))[_0x32ab('0x52')](handleError(_0x1d2b8a,null));};exports['show']=function(_0x5249ab,_0x2eb310){var _0x1e46cb={'raw':![],'where':{'id':_0x5249ab[_0x32ab('0x53')]['id']}},_0x51bb63={};_0x51bb63[_0x32ab('0x41')]=_[_0x32ab('0x3e')](db[_0x32ab('0x39')]['rawAttributes']);_0x51bb63[_0x32ab('0x42')]=_['keys'](_0x5249ab['query']);_0x51bb63[_0x32ab('0x3f')]=_[_0x32ab('0x40')](_0x51bb63[_0x32ab('0x41')],_0x51bb63[_0x32ab('0x42')]);_0x1e46cb[_0x32ab('0x43')]=_[_0x32ab('0x40')](_0x51bb63[_0x32ab('0x41')],qs[_0x32ab('0x44')](_0x5249ab['query'][_0x32ab('0x44')]));_0x1e46cb[_0x32ab('0x43')]=_0x1e46cb[_0x32ab('0x43')][_0x32ab('0x45')]?_0x1e46cb[_0x32ab('0x43')]:_0x51bb63[_0x32ab('0x41')];if(_0x5249ab[_0x32ab('0x42')][_0x32ab('0x4e')]){_0x1e46cb[_0x32ab('0x4f')]=[{'all':!![]}];}_0x1e46cb=_[_0x32ab('0x4d')]({},_0x1e46cb,_0x5249ab[_0x32ab('0x54')]);return db[_0x32ab('0x39')]['find'](_0x1e46cb)[_0x32ab('0x1c')](handleEntityNotFound(_0x2eb310,null))[_0x32ab('0x1c')](respondWithResult(_0x2eb310,null))[_0x32ab('0x52')](handleError(_0x2eb310,null));};exports[_0x32ab('0x55')]=function(_0x3cba27,_0x161c24,_0x3fb9b7){var _0x9fb714;return db[_0x32ab('0x39')][_0x32ab('0x55')](_0x3cba27[_0x32ab('0x56')],{'raw':!![]})['then'](function(_0x5387ad){_0x9fb714=_0x5387ad;return db[_0x32ab('0x39')][_0x32ab('0x50')]({'raw':!![]});})[_0x32ab('0x1c')](function(_0x4d168a){var _0x1bd752=fs['readFileSync'](path[_0x32ab('0x57')](config[_0x32ab('0x58')],'server/files/templates/context.ejs'),'utf8');var _0x167858=ejs['render'](_0x1bd752,{'contexts':_0x4d168a||[]});fs[_0x32ab('0x59')](_0x32ab('0x5a'),_0x167858);})['then'](function(){return respondWithRpcPromise(_0x32ab('0x5b'),_0x32ab('0x55'),{'module':_0x32ab('0x5c')});})[_0x32ab('0x1c')](function(){var _0x50082d=_0x3cba27['user'][_0x32ab('0x33')]({'plain':!![]});if(!_0x50082d)throw new Error(_0x32ab('0x5d'));if(_0x50082d[_0x32ab('0x5e')]===_0x32ab('0x5f')){var _0x17a13b=_0x9fb714['get']({'plain':!![]});return db[_0x32ab('0x60')]['find']({'where':{'name':_0x32ab('0x61'),'userProfileId':_0x50082d[_0x32ab('0x62')]},'raw':!![]})['then'](function(_0x3ac5b2){if(_0x3ac5b2&&_0x3ac5b2['autoAssociation']===0x0){return db['UserProfileResource'][_0x32ab('0x55')]({'name':_0x17a13b[_0x32ab('0x35')],'resourceId':_0x17a13b['id'],'type':_0x3ac5b2['name'],'sectionId':_0x3ac5b2['id']},{})[_0x32ab('0x1c')](function(){return _0x9fb714;});}else{return _0x9fb714;}})['catch'](function(_0x57a0cf){logger[_0x32ab('0x21')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x57a0cf);throw _0x57a0cf;});}return _0x9fb714;})['then'](respondWithResult(_0x161c24,0xc9))[_0x32ab('0x52')](handleError(_0x161c24,null));};exports[_0x32ab('0x31')]=function(_0x263b73,_0x337421,_0x1dde8e){var _0x39a000;return db[_0x32ab('0x39')][_0x32ab('0x63')]({'where':{'id':_0x263b73[_0x32ab('0x53')]['id']}})[_0x32ab('0x1c')](handleEntityNotFound(_0x337421,null))['then'](saveUpdates(_0x263b73[_0x32ab('0x56')],null))[_0x32ab('0x1c')](function(_0x203f3d){if(_0x203f3d){_0x39a000=_0x203f3d;return db['VoiceContext'][_0x32ab('0x50')]({'raw':!![]});}})['then'](function(_0x54d86e){var _0xc67379=fs[_0x32ab('0x64')](path[_0x32ab('0x57')](config[_0x32ab('0x58')],_0x32ab('0x65')),_0x32ab('0x66'));var _0x49537c=ejs[_0x32ab('0x67')](_0xc67379,{'contexts':_0x54d86e||[]});fs['writeFileSync'](_0x32ab('0x5a'),_0x49537c);})['then'](function(){return respondWithRpcPromise(_0x32ab('0x5b'),_0x32ab('0x31'),{'module':'chan_sip.so'});})['then'](function(){return _0x39a000;})['then'](respondWithResult(_0x337421,null))[_0x32ab('0x52')](handleError(_0x337421,null));};exports[_0x32ab('0x32')]=function(_0x3758a6,_0x394ec7,_0x98dc71){var _0x20f84f;return db['VoiceContext'][_0x32ab('0x63')]({'where':{'id':_0x3758a6[_0x32ab('0x53')]['id']}})['then'](handleEntityNotFound(_0x394ec7,null))['then'](removeEntity(_0x394ec7,null))[_0x32ab('0x1c')](function(){return db[_0x32ab('0x39')][_0x32ab('0x50')]({'raw':!![]});})[_0x32ab('0x1c')](function(_0x51a540){var _0x19a21c=fs[_0x32ab('0x64')](path['join'](config[_0x32ab('0x58')],_0x32ab('0x65')),_0x32ab('0x66'));var _0x2d585d=ejs[_0x32ab('0x67')](_0x19a21c,{'contexts':_0x51a540});fs['writeFileSync']('/etc/asterisk/extensions_xcally_contexts.conf',_0x2d585d);return respondWithRpcPromise(_0x32ab('0x5b'),_0x32ab('0x32'),{'module':_0x32ab('0x5c')});})[_0x32ab('0x52')](handleError(_0x394ec7,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index ae3f4ef..ef5f0a6 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 _0xfae2=['api','bluebird','path','../../config/environment','define','VoiceContext','voice_contexts','lodash','util','../../config/logger'];(function(_0x5a962d,_0x3c6121){var _0x4b4407=function(_0x4e241d){while(--_0x4e241d){_0x5a962d['push'](_0x5a962d['shift']());}};_0x4b4407(++_0x3c6121);}(_0xfae2,0x16f));var _0x2fae=function(_0x4d2abc,_0x29b228){_0x4d2abc=_0x4d2abc-0x0;var _0x5c4540=_0xfae2[_0x4d2abc];return _0x5c4540;};'use strict';var _=require(_0x2fae('0x0'));var util=require(_0x2fae('0x1'));var logger=require(_0x2fae('0x2'))(_0x2fae('0x3'));var moment=require('moment');var BPromise=require(_0x2fae('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2fae('0x5'));var rimraf=require('rimraf');var config=require(_0x2fae('0x6'));var attributes=require('./voiceContext.attributes');module['exports']=function(_0x2e8d05,_0x4a51ed){return _0x2e8d05[_0x2fae('0x7')](_0x2fae('0x8'),attributes,{'tableName':_0x2fae('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8b06=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','VoiceContext','voice_contexts','lodash','util','../../config/logger','api'];(function(_0x51ae13,_0xc0c625){var _0x59b21e=function(_0x223c31){while(--_0x223c31){_0x51ae13['push'](_0x51ae13['shift']());}};_0x59b21e(++_0xc0c625);}(_0x8b06,0xb2));var _0x68b0=function(_0x538d9d,_0x4d4ea9){_0x538d9d=_0x538d9d-0x0;var _0xa47a8e=_0x8b06[_0x538d9d];return _0xa47a8e;};'use strict';var _=require(_0x68b0('0x0'));var util=require(_0x68b0('0x1'));var logger=require(_0x68b0('0x2'))(_0x68b0('0x3'));var moment=require('moment');var BPromise=require(_0x68b0('0x4'));var rp=require(_0x68b0('0x5'));var fs=require('fs');var path=require(_0x68b0('0x6'));var rimraf=require(_0x68b0('0x7'));var config=require(_0x68b0('0x8'));var attributes=require('./voiceContext.attributes');module[_0x68b0('0x9')]=function(_0x52a789,_0xd0d044){return _0x52a789[_0x68b0('0xa')](_0x68b0('0xb'),attributes,{'tableName':_0x68b0('0xc'),'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 0ad0667..76dfa11 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 _0x6a47=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util'];(function(_0x43eb09,_0x3c08b8){var _0x57dd37=function(_0x2fed57){while(--_0x2fed57){_0x43eb09['push'](_0x43eb09['shift']());}};_0x57dd37(++_0x3c08b8);}(_0x6a47,0x112));var _0x76a4=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x6a47[_0x4e676e];return _0x336a3c;};'use strict';var _=require(_0x76a4('0x0'));var util=require(_0x76a4('0x1'));var moment=require(_0x76a4('0x2'));var BPromise=require(_0x76a4('0x3'));var rs=require(_0x76a4('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x76a4('0x5'))['db'];var utils=require(_0x76a4('0x6'));var logger=require('../../config/logger')(_0x76a4('0x7'));var config=require(_0x76a4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x76a4('0x9')][_0x76a4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x51b5c5,_0x364fe8,_0xb1de4d){return new BPromise(function(_0x53d422,_0x24a5fd){return client[_0x76a4('0xb')](_0x51b5c5,_0xb1de4d)[_0x76a4('0xc')](function(_0x557fa7){logger[_0x76a4('0xd')](_0x76a4('0xe'),_0x364fe8,_0x76a4('0xf'));logger[_0x76a4('0x10')](_0x76a4('0x11'),_0x364fe8,_0x76a4('0xf'),JSON[_0x76a4('0x12')](_0x557fa7));if(_0x557fa7[_0x76a4('0x13')]){if(_0x557fa7[_0x76a4('0x13')]['code']===0x1f4){logger[_0x76a4('0x13')](_0x76a4('0xe'),_0x364fe8,_0x557fa7[_0x76a4('0x13')]['message']);return _0x24a5fd(_0x557fa7[_0x76a4('0x13')][_0x76a4('0x14')]);}logger['error'](_0x76a4('0xe'),_0x364fe8,_0x557fa7[_0x76a4('0x13')]['message']);return _0x53d422(_0x557fa7['error'][_0x76a4('0x14')]);}else{logger[_0x76a4('0xd')]('VoiceContext,\x20%s,\x20%s',_0x364fe8,_0x76a4('0xf'));_0x53d422(_0x557fa7[_0x76a4('0x15')][_0x76a4('0x14')]);}})[_0x76a4('0x16')](function(_0x2c73f0){logger[_0x76a4('0x13')](_0x76a4('0xe'),_0x364fe8,_0x2c73f0);_0x24a5fd(_0x2c73f0);});});} \ No newline at end of file +var _0xaf60=['ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','debug','request\x20sent','error','code','message','info','VoiceContext,\x20%s,\x20%s','lodash','util','moment'];(function(_0x3e7edc,_0x2c8da1){var _0xb8a256=function(_0xe55022){while(--_0xe55022){_0x3e7edc['push'](_0x3e7edc['shift']());}};_0xb8a256(++_0x2c8da1);}(_0xaf60,0x82));var _0x0af6=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xaf60[_0x1b828b];return _0x98da1a;};'use strict';var _=require(_0x0af6('0x0'));var util=require(_0x0af6('0x1'));var moment=require(_0x0af6('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0af6('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0af6('0x4'))(_0x0af6('0x5'));var config=require(_0x0af6('0x6'));var jayson=require(_0x0af6('0x7'));var client=jayson[_0x0af6('0x8')][_0x0af6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2eb218,_0x52c997,_0x376979){return new BPromise(function(_0x28d620,_0x525bcc){return client[_0x0af6('0xa')](_0x2eb218,_0x376979)[_0x0af6('0xb')](function(_0xe9d01a){logger['info']('VoiceContext,\x20%s,\x20%s',_0x52c997,'request\x20sent');logger[_0x0af6('0xc')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x52c997,_0x0af6('0xd'),JSON['stringify'](_0xe9d01a));if(_0xe9d01a['error']){if(_0xe9d01a[_0x0af6('0xe')][_0x0af6('0xf')]===0x1f4){logger[_0x0af6('0xe')]('VoiceContext,\x20%s,\x20%s',_0x52c997,_0xe9d01a[_0x0af6('0xe')][_0x0af6('0x10')]);return _0x525bcc(_0xe9d01a[_0x0af6('0xe')]['message']);}logger[_0x0af6('0xe')]('VoiceContext,\x20%s,\x20%s',_0x52c997,_0xe9d01a[_0x0af6('0xe')]['message']);return _0x28d620(_0xe9d01a[_0x0af6('0xe')][_0x0af6('0x10')]);}else{logger[_0x0af6('0x11')](_0x0af6('0x12'),_0x52c997,'request\x20sent');_0x28d620(_0xe9d01a['result']['message']);}})['catch'](function(_0x4d5936){logger[_0x0af6('0xe')](_0x0af6('0x12'),_0x52c997,_0x4d5936);_0x525bcc(_0x4d5936);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 4b25d4a..40944b0 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 _0x5eca=['update','delete','destroy','multer','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','put'];(function(_0x159a79,_0x28860d){var _0x395f11=function(_0x4c65e2){while(--_0x4c65e2){_0x159a79['push'](_0x159a79['shift']());}};_0x395f11(++_0x28860d);}(_0x5eca,0x157));var _0xa5ec=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x5eca[_0xfae23b];return _0x200640;};'use strict';var multer=require(_0xa5ec('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa5ec('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xa5ec('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xa5ec('0x3'));var config=require(_0xa5ec('0x4'));var controller=require(_0xa5ec('0x5'));router['get']('/',auth[_0xa5ec('0x6')](),controller[_0xa5ec('0x7')]);router[_0xa5ec('0x8')](_0xa5ec('0x9'),auth[_0xa5ec('0x6')](),controller[_0xa5ec('0xa')]);router[_0xa5ec('0x8')](_0xa5ec('0xb'),auth[_0xa5ec('0x6')](),controller[_0xa5ec('0xc')]);router['post']('/',auth[_0xa5ec('0x6')](),controller['create']);router[_0xa5ec('0xd')](_0xa5ec('0xb'),auth[_0xa5ec('0x6')](),controller[_0xa5ec('0xe')]);router[_0xa5ec('0xf')](_0xa5ec('0xb'),auth[_0xa5ec('0x6')](),controller[_0xa5ec('0x10')]);module['exports']=router; \ No newline at end of file +var _0x7707=['create','put','update','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','get','isAuthenticated','index','/describe','/:id','show','post'];(function(_0x44f0bd,_0xc4f311){var _0x5b183f=function(_0x25e811){while(--_0x25e811){_0x44f0bd['push'](_0x44f0bd['shift']());}};_0x5b183f(++_0xc4f311);}(_0x7707,0x158));var _0x7770=function(_0x2ef6b6,_0x3d3e57){_0x2ef6b6=_0x2ef6b6-0x0;var _0x2f24b2=_0x7707[_0x2ef6b6];return _0x2f24b2;};'use strict';var multer=require(_0x7770('0x0'));var util=require(_0x7770('0x1'));var path=require(_0x7770('0x2'));var timeout=require(_0x7770('0x3'));var express=require(_0x7770('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x7770('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceDialReport.controller');router[_0x7770('0x6')]('/',auth[_0x7770('0x7')](),controller[_0x7770('0x8')]);router['get'](_0x7770('0x9'),auth[_0x7770('0x7')](),controller['describe']);router[_0x7770('0x6')](_0x7770('0xa'),auth[_0x7770('0x7')](),controller[_0x7770('0xb')]);router[_0x7770('0xc')]('/',auth['isAuthenticated'](),controller[_0x7770('0xd')]);router[_0x7770('0xe')](_0x7770('0xa'),auth[_0x7770('0x7')](),controller[_0x7770('0xf')]);router['delete'](_0x7770('0xa'),auth[_0x7770('0x7')](),controller[_0x7770('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 9e23d3c..3d99186 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 _0x9c44=['STRING','INTEGER','DATE','called,connect,complete'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x9c44,0x178));var _0x49c4=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x9c44[_0x167cc1];return _0x10bc4b;};'use strict';var Sequelize=require('sequelize');module['exports']={'privilege':{'type':Sequelize[_0x49c4('0x0')]},'channel':{'type':Sequelize[_0x49c4('0x0')]},'channelstate':{'type':Sequelize[_0x49c4('0x1')]},'channelstatedesc':{'type':Sequelize[_0x49c4('0x0')]},'calleridnum':{'type':Sequelize[_0x49c4('0x0')]},'calleridname':{'type':Sequelize[_0x49c4('0x0')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x49c4('0x0')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x49c4('0x0')]},'exten':{'type':Sequelize[_0x49c4('0x0')]},'priority':{'type':Sequelize[_0x49c4('0x1')]},'uniqueid':{'type':Sequelize[_0x49c4('0x0')]},'linkedid':{'type':Sequelize[_0x49c4('0x0')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x49c4('0x1')]},'destchannelstatedesc':{'type':Sequelize[_0x49c4('0x0')]},'destcalleridnum':{'type':Sequelize[_0x49c4('0x0')]},'destcalleridname':{'type':Sequelize[_0x49c4('0x0')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x49c4('0x0')]},'destaccountcode':{'type':Sequelize[_0x49c4('0x0')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x49c4('0x0')]},'destpriority':{'type':Sequelize[_0x49c4('0x1')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize[_0x49c4('0x0')]},'dialstatus':{'type':Sequelize[_0x49c4('0x0')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x49c4('0x2')]},'endtime':{'type':Sequelize[_0x49c4('0x2')]},'lastevent':{'type':Sequelize['STRING'],'comment':_0x49c4('0x3')},'routeId':{'type':Sequelize[_0x49c4('0x1')]},'duration':{'type':Sequelize[_0x49c4('0x1')]},'holdtime':{'type':Sequelize[_0x49c4('0x1')]},'billableseconds':{'type':Sequelize[_0x49c4('0x1')]}}; \ No newline at end of file +var _0x9a19=['sequelize','exports','STRING','INTEGER','DATE','called,connect,complete'];(function(_0x12c7e3,_0x417a84){var _0x348f08=function(_0x3b3052){while(--_0x3b3052){_0x12c7e3['push'](_0x12c7e3['shift']());}};_0x348f08(++_0x417a84);}(_0x9a19,0x114));var _0x99a1=function(_0x3cc9d9,_0x69ed38){_0x3cc9d9=_0x3cc9d9-0x0;var _0x1a425d=_0x9a19[_0x3cc9d9];return _0x1a425d;};'use strict';var Sequelize=require(_0x99a1('0x0'));module[_0x99a1('0x1')]={'privilege':{'type':Sequelize[_0x99a1('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x99a1('0x3')]},'channelstatedesc':{'type':Sequelize[_0x99a1('0x2')]},'calleridnum':{'type':Sequelize[_0x99a1('0x2')]},'calleridname':{'type':Sequelize[_0x99a1('0x2')]},'connectedlinenum':{'type':Sequelize[_0x99a1('0x2')]},'connectedlinename':{'type':Sequelize[_0x99a1('0x2')]},'language':{'type':Sequelize[_0x99a1('0x2')]},'accountcode':{'type':Sequelize[_0x99a1('0x2')]},'context':{'type':Sequelize[_0x99a1('0x2')]},'exten':{'type':Sequelize[_0x99a1('0x2')]},'priority':{'type':Sequelize[_0x99a1('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x99a1('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x99a1('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x99a1('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x99a1('0x2')]},'destlanguage':{'type':Sequelize[_0x99a1('0x2')]},'destaccountcode':{'type':Sequelize[_0x99a1('0x2')]},'destcontext':{'type':Sequelize[_0x99a1('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x99a1('0x3')]},'destuniqueid':{'type':Sequelize[_0x99a1('0x2')]},'destlinkedid':{'type':Sequelize[_0x99a1('0x2')]},'dialstring':{'type':Sequelize[_0x99a1('0x2')]},'dialstatus':{'type':Sequelize[_0x99a1('0x2')]},'starttime':{'type':Sequelize[_0x99a1('0x4')]},'answertime':{'type':Sequelize[_0x99a1('0x4')]},'endtime':{'type':Sequelize[_0x99a1('0x4')]},'lastevent':{'type':Sequelize[_0x99a1('0x2')],'comment':_0x99a1('0x5')},'routeId':{'type':Sequelize[_0x99a1('0x3')]},'duration':{'type':Sequelize[_0x99a1('0x3')]},'holdtime':{'type':Sequelize[_0x99a1('0x3')]},'billableseconds':{'type':Sequelize[_0x99a1('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index a68e52f..8136d02 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 _0xf5cb=['stack','name','send','index','map','VoiceDialReport','rawAttributes','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filters','where','merge','VIRTUAL','filter','options','include','rows','catch','show','params','includeAll','find','create','body','update','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','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/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','destroy','then','sendStatus','error'];(function(_0x2a9912,_0x2d26ab){var _0x487882=function(_0x54e15d){while(--_0x54e15d){_0x2a9912['push'](_0x2a9912['shift']());}};_0x487882(++_0x2d26ab);}(_0xf5cb,0x1a0));var _0xbf5c=function(_0x237217,_0x4a4418){_0x237217=_0x237217-0x0;var _0x31fbd4=_0xf5cb[_0x237217];return _0x31fbd4;};'use strict';var emlformat=require(_0xbf5c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbf5c('0x1'));var jsonpatch=require(_0xbf5c('0x2'));var rp=require('request-promise');var moment=require(_0xbf5c('0x3'));var BPromise=require(_0xbf5c('0x4'));var Mustache=require(_0xbf5c('0x5'));var util=require(_0xbf5c('0x6'));var path=require(_0xbf5c('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbf5c('0x8'));var _=require(_0xbf5c('0x9'));var squel=require(_0xbf5c('0xa'));var crypto=require(_0xbf5c('0xb'));var jsforce=require(_0xbf5c('0xc'));var deskjs=require(_0xbf5c('0xd'));var toCsv=require('to-csv');var querystring=require(_0xbf5c('0xe'));var Papa=require(_0xbf5c('0xf'));var Redis=require(_0xbf5c('0x10'));var authService=require(_0xbf5c('0x11'));var qs=require(_0xbf5c('0x12'));var as=require(_0xbf5c('0x13'));var hardwareService=require(_0xbf5c('0x14'));var logger=require(_0xbf5c('0x15'))('api');var utils=require(_0xbf5c('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xbf5c('0x17'));var db=require(_0xbf5c('0x18'))['db'];function respondWithStatusCode(_0x513e49,_0x39709c){_0x39709c=_0x39709c||0xcc;return function(_0x16081c){if(_0x16081c){return _0x513e49['sendStatus'](_0x39709c);}return _0x513e49[_0xbf5c('0x19')](_0x39709c)[_0xbf5c('0x1a')]();};}function respondWithResult(_0x3230c5,_0x286fe8){_0x286fe8=_0x286fe8||0xc8;return function(_0x1a7389){if(_0x1a7389){return _0x3230c5[_0xbf5c('0x19')](_0x286fe8)[_0xbf5c('0x1b')](_0x1a7389);}};}function respondWithFilteredResult(_0x154dbb,_0xaef521){return function(_0x37c708){if(_0x37c708){var _0x56c0fb=typeof _0xaef521[_0xbf5c('0x1c')]===_0xbf5c('0x1d')&&typeof _0xaef521[_0xbf5c('0x1e')]==='undefined';var _0x2af2f6=_0x37c708['count'];var _0x31af11=_0x56c0fb?0x0:_0xaef521[_0xbf5c('0x1c')];var _0xf8400a=_0x56c0fb?_0x37c708[_0xbf5c('0x1f')]:_0xaef521[_0xbf5c('0x1c')]+_0xaef521['limit'];var _0x435555;if(_0xf8400a>=_0x2af2f6){_0xf8400a=_0x2af2f6;_0x435555=0xc8;}else{_0x435555=0xce;}_0x154dbb[_0xbf5c('0x19')](_0x435555);return _0x154dbb[_0xbf5c('0x20')](_0xbf5c('0x21'),_0x31af11+'-'+_0xf8400a+'/'+_0x2af2f6)[_0xbf5c('0x1b')](_0x37c708);}return null;};}function patchUpdates(_0x202b54){return function(_0x18d858){try{jsonpatch[_0xbf5c('0x22')](_0x18d858,_0x202b54,!![]);}catch(_0xa5196c){return BPromise[_0xbf5c('0x23')](_0xa5196c);}return _0x18d858['save']();};}function saveUpdates(_0x4277cc,_0x22e176){return function(_0x2ae576){if(_0x2ae576){return _0x2ae576['update'](_0x4277cc)['then'](function(_0x54902f){return _0x54902f;});}return null;};}function removeEntity(_0x4fbbbe,_0x5c242e){return function(_0x37ed28){if(_0x37ed28){return _0x37ed28[_0xbf5c('0x24')]()[_0xbf5c('0x25')](function(){_0x4fbbbe[_0xbf5c('0x19')](0xcc)[_0xbf5c('0x1a')]();});}};}function handleEntityNotFound(_0x1488cc,_0x455a3d){return function(_0x11cd81){if(!_0x11cd81){_0x1488cc[_0xbf5c('0x26')](0x194);}return _0x11cd81;};}function handleError(_0x56ceff,_0x4944f3){_0x4944f3=_0x4944f3||0x1f4;return function(_0x38dd71){logger[_0xbf5c('0x27')](_0x38dd71[_0xbf5c('0x28')]);if(_0x38dd71['name']){delete _0x38dd71[_0xbf5c('0x29')];}_0x56ceff[_0xbf5c('0x19')](_0x4944f3)[_0xbf5c('0x2a')](_0x38dd71);};}exports[_0xbf5c('0x2b')]=function(_0x16c905,_0x2b0d3e){var _0x81cb0a={},_0x3735b0={},_0x3e7e25={'count':0x0,'rows':[]};var _0x3ccca2=_[_0xbf5c('0x2c')](db[_0xbf5c('0x2d')][_0xbf5c('0x2e')],function(_0x414c44){return{'name':_0x414c44['fieldName'],'type':_0x414c44[_0xbf5c('0x2f')]['key']};});_0x3735b0[_0xbf5c('0x30')]=_[_0xbf5c('0x2c')](_0x3ccca2,_0xbf5c('0x29'));_0x3735b0[_0xbf5c('0x31')]=_[_0xbf5c('0x32')](_0x16c905[_0xbf5c('0x31')]);_0x3735b0['filters']=_['intersection'](_0x3735b0[_0xbf5c('0x30')],_0x3735b0['query']);_0x81cb0a[_0xbf5c('0x33')]=_[_0xbf5c('0x34')](_0x3735b0[_0xbf5c('0x30')],qs[_0xbf5c('0x35')](_0x16c905[_0xbf5c('0x31')][_0xbf5c('0x35')]));_0x81cb0a[_0xbf5c('0x33')]=_0x81cb0a['attributes'][_0xbf5c('0x36')]?_0x81cb0a[_0xbf5c('0x33')]:_0x3735b0[_0xbf5c('0x30')];if(!_0x16c905['query'][_0xbf5c('0x37')]('nolimit')){_0x81cb0a['limit']=qs['limit'](_0x16c905[_0xbf5c('0x31')][_0xbf5c('0x1e')]);_0x81cb0a['offset']=qs[_0xbf5c('0x1c')](_0x16c905[_0xbf5c('0x31')][_0xbf5c('0x1c')]);}_0x81cb0a[_0xbf5c('0x38')]=qs['sort'](_0x16c905['query'][_0xbf5c('0x39')]);_0x81cb0a['where']=qs['filters'](_[_0xbf5c('0x3a')](_0x16c905[_0xbf5c('0x31')],_0x3735b0[_0xbf5c('0x3b')]),_0x3ccca2);if(_0x16c905['query']['filter']){_0x81cb0a[_0xbf5c('0x3c')]=_[_0xbf5c('0x3d')](_0x81cb0a[_0xbf5c('0x3c')],{'$or':_['map'](_0x3ccca2,function(_0x565a3b){if(_0x565a3b['type']!==_0xbf5c('0x3e')){var _0x225495={};_0x225495[_0x565a3b[_0xbf5c('0x29')]]={'$like':'%'+_0x16c905[_0xbf5c('0x31')][_0xbf5c('0x3f')]+'%'};return _0x225495;}})});}_0x81cb0a=_[_0xbf5c('0x3d')]({},_0x81cb0a,_0x16c905[_0xbf5c('0x40')]);var _0x53976f={'where':_0x81cb0a[_0xbf5c('0x3c')]};return db[_0xbf5c('0x2d')]['count'](_0x53976f)['then'](function(_0x318614){_0x3e7e25['count']=_0x318614;if(_0x16c905[_0xbf5c('0x31')]['includeAll']){_0x81cb0a[_0xbf5c('0x41')]=[{'all':!![]}];}return db[_0xbf5c('0x2d')]['findAll'](_0x81cb0a);})['then'](function(_0x3f334f){_0x3e7e25[_0xbf5c('0x42')]=_0x3f334f;return _0x3e7e25;})['then'](respondWithFilteredResult(_0x2b0d3e,_0x81cb0a))[_0xbf5c('0x43')](handleError(_0x2b0d3e,null));};exports[_0xbf5c('0x44')]=function(_0x15eece,_0x4ba6ae){var _0x2142f2={'raw':!![],'where':{'id':_0x15eece[_0xbf5c('0x45')]['id']}},_0x242fe7={};_0x242fe7[_0xbf5c('0x30')]=_[_0xbf5c('0x32')](db[_0xbf5c('0x2d')]['rawAttributes']);_0x242fe7[_0xbf5c('0x31')]=_[_0xbf5c('0x32')](_0x15eece['query']);_0x242fe7['filters']=_[_0xbf5c('0x34')](_0x242fe7[_0xbf5c('0x30')],_0x242fe7[_0xbf5c('0x31')]);_0x2142f2[_0xbf5c('0x33')]=_[_0xbf5c('0x34')](_0x242fe7[_0xbf5c('0x30')],qs[_0xbf5c('0x35')](_0x15eece[_0xbf5c('0x31')][_0xbf5c('0x35')]));_0x2142f2['attributes']=_0x2142f2[_0xbf5c('0x33')][_0xbf5c('0x36')]?_0x2142f2[_0xbf5c('0x33')]:_0x242fe7[_0xbf5c('0x30')];if(_0x15eece[_0xbf5c('0x31')][_0xbf5c('0x46')]){_0x2142f2[_0xbf5c('0x41')]=[{'all':!![]}];}_0x2142f2=_[_0xbf5c('0x3d')]({},_0x2142f2,_0x15eece[_0xbf5c('0x40')]);return db[_0xbf5c('0x2d')][_0xbf5c('0x47')](_0x2142f2)['then'](handleEntityNotFound(_0x4ba6ae,null))[_0xbf5c('0x25')](respondWithResult(_0x4ba6ae,null))[_0xbf5c('0x43')](handleError(_0x4ba6ae,null));};exports['create']=function(_0x259613,_0x1ff809){return db[_0xbf5c('0x2d')][_0xbf5c('0x48')](_0x259613[_0xbf5c('0x49')],{})[_0xbf5c('0x25')](respondWithResult(_0x1ff809,0xc9))[_0xbf5c('0x43')](handleError(_0x1ff809,null));};exports[_0xbf5c('0x4a')]=function(_0x4269f4,_0x13a9d7){if(_0x4269f4['body']['id']){delete _0x4269f4['body']['id'];}return db['VoiceDialReport'][_0xbf5c('0x47')]({'where':{'id':_0x4269f4[_0xbf5c('0x45')]['id']}})[_0xbf5c('0x25')](handleEntityNotFound(_0x13a9d7,null))[_0xbf5c('0x25')](saveUpdates(_0x4269f4['body'],null))[_0xbf5c('0x25')](respondWithResult(_0x13a9d7,null))[_0xbf5c('0x43')](handleError(_0x13a9d7,null));};exports[_0xbf5c('0x24')]=function(_0x3298e8,_0x49deaa){return db['VoiceDialReport']['find']({'where':{'id':_0x3298e8['params']['id']}})[_0xbf5c('0x25')](handleEntityNotFound(_0x49deaa,null))[_0xbf5c('0x25')](removeEntity(_0x49deaa,null))[_0xbf5c('0x43')](handleError(_0x49deaa,null));};exports[_0xbf5c('0x4b')]=function(_0x1c8c3a,_0x8fdc86){return db[_0xbf5c('0x2d')][_0xbf5c('0x4b')]()[_0xbf5c('0x25')](respondWithResult(_0x8fdc86,null))[_0xbf5c('0x43')](handleError(_0x8fdc86,null));}; \ No newline at end of file +var _0xf804=['end','status','json','offset','undefined','limit','count','set','apply','reject','then','error','stack','name','send','index','map','VoiceDialReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','include','findAll','catch','params','fields','length','includeAll','options','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','lodash','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'];(function(_0x4fa291,_0x56e289){var _0x506d9b=function(_0x24c31f){while(--_0x24c31f){_0x4fa291['push'](_0x4fa291['shift']());}};_0x506d9b(++_0x56e289);}(_0xf804,0x159));var _0x4f80=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xf804[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require(_0x4f80('0x0'));var rimraf=require(_0x4f80('0x1'));var zipdir=require(_0x4f80('0x2'));var jsonpatch=require(_0x4f80('0x3'));var rp=require(_0x4f80('0x4'));var moment=require('moment');var BPromise=require(_0x4f80('0x5'));var Mustache=require(_0x4f80('0x6'));var util=require(_0x4f80('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x4f80('0x8'));var ejs=require(_0x4f80('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4f80('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4f80('0xb'));var deskjs=require(_0x4f80('0xc'));var toCsv=require(_0x4f80('0x8'));var querystring=require(_0x4f80('0xd'));var Papa=require(_0x4f80('0xe'));var Redis=require(_0x4f80('0xf'));var authService=require(_0x4f80('0x10'));var qs=require(_0x4f80('0x11'));var as=require(_0x4f80('0x12'));var hardwareService=require(_0x4f80('0x13'));var logger=require('../../config/logger')(_0x4f80('0x14'));var utils=require(_0x4f80('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x4f80('0x16'));var db=require(_0x4f80('0x17'))['db'];function respondWithStatusCode(_0x2bb28a,_0x52e38a){_0x52e38a=_0x52e38a||0xcc;return function(_0x2f7ab2){if(_0x2f7ab2){return _0x2bb28a[_0x4f80('0x18')](_0x52e38a);}return _0x2bb28a['status'](_0x52e38a)[_0x4f80('0x19')]();};}function respondWithResult(_0x482aef,_0x573631){_0x573631=_0x573631||0xc8;return function(_0x4a0fb4){if(_0x4a0fb4){return _0x482aef[_0x4f80('0x1a')](_0x573631)[_0x4f80('0x1b')](_0x4a0fb4);}};}function respondWithFilteredResult(_0x25fe15,_0x2c6ddf){return function(_0x13c1d4){if(_0x13c1d4){var _0x1459f9=typeof _0x2c6ddf[_0x4f80('0x1c')]===_0x4f80('0x1d')&&typeof _0x2c6ddf[_0x4f80('0x1e')]===_0x4f80('0x1d');var _0x360d74=_0x13c1d4[_0x4f80('0x1f')];var _0x429cda=_0x1459f9?0x0:_0x2c6ddf['offset'];var _0x1d6710=_0x1459f9?_0x13c1d4[_0x4f80('0x1f')]:_0x2c6ddf[_0x4f80('0x1c')]+_0x2c6ddf['limit'];var _0x3c6949;if(_0x1d6710>=_0x360d74){_0x1d6710=_0x360d74;_0x3c6949=0xc8;}else{_0x3c6949=0xce;}_0x25fe15[_0x4f80('0x1a')](_0x3c6949);return _0x25fe15[_0x4f80('0x20')]('Content-Range',_0x429cda+'-'+_0x1d6710+'/'+_0x360d74)[_0x4f80('0x1b')](_0x13c1d4);}return null;};}function patchUpdates(_0x5a0509){return function(_0x536758){try{jsonpatch[_0x4f80('0x21')](_0x536758,_0x5a0509,!![]);}catch(_0xbec5b6){return BPromise[_0x4f80('0x22')](_0xbec5b6);}return _0x536758['save']();};}function saveUpdates(_0x20bc2d,_0x5661a2){return function(_0x4683f4){if(_0x4683f4){return _0x4683f4['update'](_0x20bc2d)[_0x4f80('0x23')](function(_0x2dae6d){return _0x2dae6d;});}return null;};}function removeEntity(_0x42d442,_0x507ba4){return function(_0x3d4521){if(_0x3d4521){return _0x3d4521['destroy']()[_0x4f80('0x23')](function(){_0x42d442['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x127536,_0x28eca7){return function(_0x323544){if(!_0x323544){_0x127536[_0x4f80('0x18')](0x194);}return _0x323544;};}function handleError(_0x5240ca,_0x2aba81){_0x2aba81=_0x2aba81||0x1f4;return function(_0x3ac67d){logger[_0x4f80('0x24')](_0x3ac67d[_0x4f80('0x25')]);if(_0x3ac67d[_0x4f80('0x26')]){delete _0x3ac67d[_0x4f80('0x26')];}_0x5240ca[_0x4f80('0x1a')](_0x2aba81)[_0x4f80('0x27')](_0x3ac67d);};}exports[_0x4f80('0x28')]=function(_0x1d9b74,_0x1010df){var _0xd333c2={},_0x57fdd2={},_0x1f0fb8={'count':0x0,'rows':[]};var _0x4c3355=_[_0x4f80('0x29')](db[_0x4f80('0x2a')][_0x4f80('0x2b')],function(_0x4bb363){return{'name':_0x4bb363[_0x4f80('0x2c')],'type':_0x4bb363[_0x4f80('0x2d')][_0x4f80('0x2e')]};});_0x57fdd2[_0x4f80('0x2f')]=_[_0x4f80('0x29')](_0x4c3355,'name');_0x57fdd2[_0x4f80('0x30')]=_[_0x4f80('0x31')](_0x1d9b74[_0x4f80('0x30')]);_0x57fdd2[_0x4f80('0x32')]=_['intersection'](_0x57fdd2[_0x4f80('0x2f')],_0x57fdd2[_0x4f80('0x30')]);_0xd333c2[_0x4f80('0x33')]=_[_0x4f80('0x34')](_0x57fdd2[_0x4f80('0x2f')],qs['fields'](_0x1d9b74[_0x4f80('0x30')]['fields']));_0xd333c2[_0x4f80('0x33')]=_0xd333c2[_0x4f80('0x33')]['length']?_0xd333c2[_0x4f80('0x33')]:_0x57fdd2[_0x4f80('0x2f')];if(!_0x1d9b74[_0x4f80('0x30')][_0x4f80('0x35')](_0x4f80('0x36'))){_0xd333c2[_0x4f80('0x1e')]=qs['limit'](_0x1d9b74[_0x4f80('0x30')][_0x4f80('0x1e')]);_0xd333c2[_0x4f80('0x1c')]=qs[_0x4f80('0x1c')](_0x1d9b74[_0x4f80('0x30')][_0x4f80('0x1c')]);}_0xd333c2[_0x4f80('0x37')]=qs[_0x4f80('0x38')](_0x1d9b74[_0x4f80('0x30')][_0x4f80('0x38')]);_0xd333c2['where']=qs['filters'](_[_0x4f80('0x39')](_0x1d9b74[_0x4f80('0x30')],_0x57fdd2[_0x4f80('0x32')]),_0x4c3355);if(_0x1d9b74['query'][_0x4f80('0x3a')]){_0xd333c2[_0x4f80('0x3b')]=_['merge'](_0xd333c2['where'],{'$or':_['map'](_0x4c3355,function(_0x5ebb57){if(_0x5ebb57[_0x4f80('0x2d')]!==_0x4f80('0x3c')){var _0x23db59={};_0x23db59[_0x5ebb57[_0x4f80('0x26')]]={'$like':'%'+_0x1d9b74['query'][_0x4f80('0x3a')]+'%'};return _0x23db59;}})});}_0xd333c2=_[_0x4f80('0x3d')]({},_0xd333c2,_0x1d9b74['options']);var _0x25a6d6={'where':_0xd333c2['where']};return db[_0x4f80('0x2a')]['count'](_0x25a6d6)[_0x4f80('0x23')](function(_0x4ecae5){_0x1f0fb8['count']=_0x4ecae5;if(_0x1d9b74[_0x4f80('0x30')]['includeAll']){_0xd333c2[_0x4f80('0x3e')]=[{'all':!![]}];}return db['VoiceDialReport'][_0x4f80('0x3f')](_0xd333c2);})[_0x4f80('0x23')](function(_0x24e05f){_0x1f0fb8['rows']=_0x24e05f;return _0x1f0fb8;})[_0x4f80('0x23')](respondWithFilteredResult(_0x1010df,_0xd333c2))[_0x4f80('0x40')](handleError(_0x1010df,null));};exports['show']=function(_0x156012,_0x1a38af){var _0x36089a={'raw':!![],'where':{'id':_0x156012[_0x4f80('0x41')]['id']}},_0x27dbad={};_0x27dbad[_0x4f80('0x2f')]=_[_0x4f80('0x31')](db[_0x4f80('0x2a')][_0x4f80('0x2b')]);_0x27dbad[_0x4f80('0x30')]=_[_0x4f80('0x31')](_0x156012[_0x4f80('0x30')]);_0x27dbad['filters']=_[_0x4f80('0x34')](_0x27dbad[_0x4f80('0x2f')],_0x27dbad[_0x4f80('0x30')]);_0x36089a['attributes']=_[_0x4f80('0x34')](_0x27dbad['model'],qs[_0x4f80('0x42')](_0x156012[_0x4f80('0x30')][_0x4f80('0x42')]));_0x36089a['attributes']=_0x36089a[_0x4f80('0x33')][_0x4f80('0x43')]?_0x36089a[_0x4f80('0x33')]:_0x27dbad[_0x4f80('0x2f')];if(_0x156012[_0x4f80('0x30')][_0x4f80('0x44')]){_0x36089a[_0x4f80('0x3e')]=[{'all':!![]}];}_0x36089a=_[_0x4f80('0x3d')]({},_0x36089a,_0x156012[_0x4f80('0x45')]);return db[_0x4f80('0x2a')][_0x4f80('0x46')](_0x36089a)[_0x4f80('0x23')](handleEntityNotFound(_0x1a38af,null))[_0x4f80('0x23')](respondWithResult(_0x1a38af,null))[_0x4f80('0x40')](handleError(_0x1a38af,null));};exports[_0x4f80('0x47')]=function(_0x2a1958,_0x49f9db){return db['VoiceDialReport'][_0x4f80('0x47')](_0x2a1958['body'],{})['then'](respondWithResult(_0x49f9db,0xc9))[_0x4f80('0x40')](handleError(_0x49f9db,null));};exports['update']=function(_0x4a51c9,_0x5c8885){if(_0x4a51c9[_0x4f80('0x48')]['id']){delete _0x4a51c9['body']['id'];}return db[_0x4f80('0x2a')][_0x4f80('0x46')]({'where':{'id':_0x4a51c9[_0x4f80('0x41')]['id']}})['then'](handleEntityNotFound(_0x5c8885,null))[_0x4f80('0x23')](saveUpdates(_0x4a51c9[_0x4f80('0x48')],null))['then'](respondWithResult(_0x5c8885,null))[_0x4f80('0x40')](handleError(_0x5c8885,null));};exports[_0x4f80('0x49')]=function(_0x21996b,_0xc9732e){return db[_0x4f80('0x2a')][_0x4f80('0x46')]({'where':{'id':_0x21996b[_0x4f80('0x41')]['id']}})[_0x4f80('0x23')](handleEntityNotFound(_0xc9732e,null))[_0x4f80('0x23')](removeEntity(_0xc9732e,null))[_0x4f80('0x40')](handleError(_0xc9732e,null));};exports['describe']=function(_0x1c807d,_0x1e4f48){return db[_0x4f80('0x2a')]['describe']()['then'](respondWithResult(_0x1e4f48,null))[_0x4f80('0x40')](handleError(_0x1e4f48,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index bb8b4d3..8f1eb45 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 _0x1f16=['lodash','../../config/logger','api','bluebird','rimraf','exports','VoiceDialReport','uniqueid'];(function(_0x400fda,_0xb22ff5){var _0x371574=function(_0x1f629f){while(--_0x1f629f){_0x400fda['push'](_0x400fda['shift']());}};_0x371574(++_0xb22ff5);}(_0x1f16,0x190));var _0x61f1=function(_0xf9c2ad,_0x160fa5){_0xf9c2ad=_0xf9c2ad-0x0;var _0x49cf8b=_0x1f16[_0xf9c2ad];return _0x49cf8b;};'use strict';var _=require(_0x61f1('0x0'));var util=require('util');var logger=require(_0x61f1('0x1'))(_0x61f1('0x2'));var moment=require('moment');var BPromise=require(_0x61f1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x61f1('0x4'));var config=require('../../config/environment');var attributes=require('./voiceDialReport.attributes');module[_0x61f1('0x5')]=function(_0x31ccf6,_0x16b91d){return _0x31ccf6['define'](_0x61f1('0x6'),attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':[_0x61f1('0x7')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x44c5=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceDialReport.attributes','exports','define','VoiceDialReport','report_dial','uniqueid','lodash','util'];(function(_0x34df4a,_0x209d10){var _0x145c69=function(_0xb9bcbd){while(--_0xb9bcbd){_0x34df4a['push'](_0x34df4a['shift']());}};_0x145c69(++_0x209d10);}(_0x44c5,0x76));var _0x544c=function(_0x233716,_0x346676){_0x233716=_0x233716-0x0;var _0x302298=_0x44c5[_0x233716];return _0x302298;};'use strict';var _=require(_0x544c('0x0'));var util=require(_0x544c('0x1'));var logger=require(_0x544c('0x2'))(_0x544c('0x3'));var moment=require('moment');var BPromise=require(_0x544c('0x4'));var rp=require(_0x544c('0x5'));var fs=require('fs');var path=require(_0x544c('0x6'));var rimraf=require(_0x544c('0x7'));var config=require(_0x544c('0x8'));var attributes=require(_0x544c('0x9'));module[_0x544c('0xa')]=function(_0xcfd37a,_0x45d35f){return _0xcfd37a[_0x544c('0xb')](_0x544c('0xc'),attributes,{'tableName':_0x544c('0xd'),'paranoid':![],'indexes':[{'fields':[_0x544c('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 90ce4f2..2cce25f 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 _0xdebd=['raw','UpdateVoiceDialReport','where','attributes','limit','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateVoiceDialReport','VoiceDialReport','body','options'];(function(_0x469290,_0x3a7679){var _0x37c9f5=function(_0x389c4a){while(--_0x389c4a){_0x469290['push'](_0x469290['shift']());}};_0x37c9f5(++_0x3a7679);}(_0xdebd,0x10d));var _0xddeb=function(_0x23af29,_0x55a275){_0x23af29=_0x23af29-0x0;var _0x4aefea=_0xdebd[_0x23af29];return _0x4aefea;};'use strict';var _=require(_0xddeb('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xddeb('0x1'));var rs=require(_0xddeb('0x2'));var fs=require('fs');var Redis=require(_0xddeb('0x3'));var db=require(_0xddeb('0x4'))['db'];var utils=require(_0xddeb('0x5'));var logger=require('../../config/logger')(_0xddeb('0x6'));var config=require(_0xddeb('0x7'));var jayson=require(_0xddeb('0x8'));var client=jayson[_0xddeb('0x9')][_0xddeb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x157811,_0x48fba6,_0x3b205a){return new BPromise(function(_0xef91c2,_0x18e29b){return client[_0xddeb('0xb')](_0x157811,_0x3b205a)[_0xddeb('0xc')](function(_0x5c6f0b){logger[_0xddeb('0xd')](_0xddeb('0xe'),_0x48fba6,_0xddeb('0xf'));logger[_0xddeb('0x10')](_0xddeb('0x11'),_0x48fba6,_0xddeb('0xf'),JSON[_0xddeb('0x12')](_0x5c6f0b));if(_0x5c6f0b[_0xddeb('0x13')]){if(_0x5c6f0b[_0xddeb('0x13')][_0xddeb('0x14')]===0x1f4){logger[_0xddeb('0x13')](_0xddeb('0xe'),_0x48fba6,_0x5c6f0b[_0xddeb('0x13')]['message']);return _0x18e29b(_0x5c6f0b['error'][_0xddeb('0x15')]);}logger['error'](_0xddeb('0xe'),_0x48fba6,_0x5c6f0b[_0xddeb('0x13')][_0xddeb('0x15')]);return _0xef91c2(_0x5c6f0b[_0xddeb('0x13')][_0xddeb('0x15')]);}else{logger[_0xddeb('0xd')](_0xddeb('0xe'),_0x48fba6,_0xddeb('0xf'));_0xef91c2(_0x5c6f0b[_0xddeb('0x16')]['message']);}})[_0xddeb('0x17')](function(_0x107134){logger[_0xddeb('0x13')](_0xddeb('0xe'),_0x48fba6,_0x107134);_0x18e29b(_0x107134);});});}exports[_0xddeb('0x18')]=function(_0x833d7f){var _0x48d09a=this;return new Promise(function(_0x489725,_0x35a3a7){return db[_0xddeb('0x19')]['create'](_0x833d7f[_0xddeb('0x1a')],{'raw':_0x833d7f[_0xddeb('0x1b')]?_0x833d7f[_0xddeb('0x1b')][_0xddeb('0x1c')]===undefined?!![]:![]:!![]})[_0xddeb('0xc')](function(_0x35fbcd){logger[_0xddeb('0xd')]('CreateVoiceDialReport',_0x833d7f);logger['debug']('CreateVoiceDialReport',_0x833d7f,JSON[_0xddeb('0x12')](_0x35fbcd));_0x489725(_0x35fbcd);})[_0xddeb('0x17')](function(_0x176b70){logger[_0xddeb('0x13')](_0xddeb('0x18'),_0x176b70[_0xddeb('0x15')],_0x833d7f);_0x35a3a7(_0x48d09a[_0xddeb('0x13')](0x1f4,_0x176b70[_0xddeb('0x15')]));});});};exports[_0xddeb('0x1d')]=function(_0x1a21f2){var _0x49b162=this;return new Promise(function(_0x1556aa,_0xa31df9){return db[_0xddeb('0x19')]['update'](_0x1a21f2[_0xddeb('0x1a')],{'raw':_0x1a21f2[_0xddeb('0x1b')]?_0x1a21f2[_0xddeb('0x1b')][_0xddeb('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1a21f2['options']?_0x1a21f2['options'][_0xddeb('0x1e')]||null:null,'attributes':_0x1a21f2[_0xddeb('0x1b')]?_0x1a21f2[_0xddeb('0x1b')][_0xddeb('0x1f')]||null:null,'limit':_0x1a21f2[_0xddeb('0x1b')]?_0x1a21f2[_0xddeb('0x1b')][_0xddeb('0x20')]||null:null})[_0xddeb('0xc')](function(_0x3245c6){logger[_0xddeb('0xd')](_0xddeb('0x1d'),_0x1a21f2);logger[_0xddeb('0x10')](_0xddeb('0x1d'),_0x1a21f2,JSON['stringify'](_0x3245c6));_0x1556aa(_0x3245c6);})['catch'](function(_0x21997c){logger['error']('UpdateVoiceDialReport',_0x21997c[_0xddeb('0x15')],_0x1a21f2);_0xa31df9(_0x49b162['error'](0x1f4,_0x21997c['message']));});});}; \ No newline at end of file +var _0x6f91=['request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','UpdateVoiceDialReport','where','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','http'];(function(_0x509267,_0x56b427){var _0x43cf31=function(_0x48c5d3){while(--_0x48c5d3){_0x509267['push'](_0x509267['shift']());}};_0x43cf31(++_0x56b427);}(_0x6f91,0x197));var _0x16f9=function(_0x1417c6,_0x194309){_0x1417c6=_0x1417c6-0x0;var _0x44db97=_0x6f91[_0x1417c6];return _0x44db97;};'use strict';var _=require(_0x16f9('0x0'));var util=require(_0x16f9('0x1'));var moment=require('moment');var BPromise=require(_0x16f9('0x2'));var rs=require(_0x16f9('0x3'));var fs=require('fs');var Redis=require(_0x16f9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x16f9('0x5'));var logger=require('../../config/logger')(_0x16f9('0x6'));var config=require('../../config/environment');var jayson=require(_0x16f9('0x7'));var client=jayson['client'][_0x16f9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1cc91a,_0x118b58,_0x11dc2c){return new BPromise(function(_0x9156c1,_0x34792b){return client[_0x16f9('0x9')](_0x1cc91a,_0x11dc2c)[_0x16f9('0xa')](function(_0x387709){logger[_0x16f9('0xb')](_0x16f9('0xc'),_0x118b58,_0x16f9('0xd'));logger[_0x16f9('0xe')](_0x16f9('0xf'),_0x118b58,_0x16f9('0xd'),JSON[_0x16f9('0x10')](_0x387709));if(_0x387709[_0x16f9('0x11')]){if(_0x387709[_0x16f9('0x11')][_0x16f9('0x12')]===0x1f4){logger[_0x16f9('0x11')](_0x16f9('0xc'),_0x118b58,_0x387709[_0x16f9('0x11')]['message']);return _0x34792b(_0x387709[_0x16f9('0x11')][_0x16f9('0x13')]);}logger[_0x16f9('0x11')](_0x16f9('0xc'),_0x118b58,_0x387709[_0x16f9('0x11')]['message']);return _0x9156c1(_0x387709[_0x16f9('0x11')][_0x16f9('0x13')]);}else{logger['info'](_0x16f9('0xc'),_0x118b58,'request\x20sent');_0x9156c1(_0x387709[_0x16f9('0x14')][_0x16f9('0x13')]);}})[_0x16f9('0x15')](function(_0x462c45){logger[_0x16f9('0x11')](_0x16f9('0xc'),_0x118b58,_0x462c45);_0x34792b(_0x462c45);});});}exports[_0x16f9('0x16')]=function(_0x4615e9){var _0x12b323=this;return new Promise(function(_0x2452d6,_0x277215){return db[_0x16f9('0x17')][_0x16f9('0x18')](_0x4615e9[_0x16f9('0x19')],{'raw':_0x4615e9[_0x16f9('0x1a')]?_0x4615e9[_0x16f9('0x1a')][_0x16f9('0x1b')]===undefined?!![]:![]:!![]})[_0x16f9('0xa')](function(_0x4704b2){logger['info'](_0x16f9('0x16'),_0x4615e9);logger[_0x16f9('0xe')](_0x16f9('0x16'),_0x4615e9,JSON[_0x16f9('0x10')](_0x4704b2));_0x2452d6(_0x4704b2);})['catch'](function(_0x30c35f){logger[_0x16f9('0x11')](_0x16f9('0x16'),_0x30c35f[_0x16f9('0x13')],_0x4615e9);_0x277215(_0x12b323[_0x16f9('0x11')](0x1f4,_0x30c35f[_0x16f9('0x13')]));});});};exports[_0x16f9('0x1c')]=function(_0x638e89){var _0x2becba=this;return new Promise(function(_0x3fa615,_0x2c60ff){return db[_0x16f9('0x17')]['update'](_0x638e89[_0x16f9('0x19')],{'raw':_0x638e89[_0x16f9('0x1a')]?_0x638e89[_0x16f9('0x1a')][_0x16f9('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x638e89[_0x16f9('0x1a')]?_0x638e89['options'][_0x16f9('0x1d')]||null:null,'attributes':_0x638e89['options']?_0x638e89[_0x16f9('0x1a')][_0x16f9('0x1e')]||null:null,'limit':_0x638e89[_0x16f9('0x1a')]?_0x638e89[_0x16f9('0x1a')][_0x16f9('0x1f')]||null:null})['then'](function(_0x4a43d4){logger[_0x16f9('0xb')](_0x16f9('0x1c'),_0x638e89);logger[_0x16f9('0xe')](_0x16f9('0x1c'),_0x638e89,JSON[_0x16f9('0x10')](_0x4a43d4));_0x3fa615(_0x4a43d4);})[_0x16f9('0x15')](function(_0x17437c){logger[_0x16f9('0x11')]('UpdateVoiceDialReport',_0x17437c[_0x16f9('0x13')],_0x638e89);_0x2c60ff(_0x2becba[_0x16f9('0x11')](0x1f4,_0x17437c[_0x16f9('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 879ec70..254f5b5 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 _0x2f44=['../../components/auth/service','../../components/interaction/service','./voiceExtension.controller','get','isAuthenticated','/:id','show','post','/:id/applications','addApplications','put','delete','exports','path','connect-timeout','express'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x2f44,0x12d));var _0x42f4=function(_0x4d7765,_0x2ec4bd){_0x4d7765=_0x4d7765-0x0;var _0x146c1a=_0x2f44[_0x4d7765];return _0x146c1a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x42f4('0x0'));var timeout=require(_0x42f4('0x1'));var express=require(_0x42f4('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x42f4('0x3'));var interaction=require(_0x42f4('0x4'));var config=require('../../config/environment');var controller=require(_0x42f4('0x5'));router[_0x42f4('0x6')]('/',auth[_0x42f4('0x7')](),controller['index']);router[_0x42f4('0x6')](_0x42f4('0x8'),auth['isAuthenticated'](),controller[_0x42f4('0x9')]);router['post']('/',auth[_0x42f4('0x7')](),controller['create']);router[_0x42f4('0xa')](_0x42f4('0xb'),auth[_0x42f4('0x7')](),controller[_0x42f4('0xc')]);router[_0x42f4('0xd')](_0x42f4('0x8'),auth[_0x42f4('0x7')](),controller['update']);router[_0x42f4('0xe')](_0x42f4('0x8'),auth[_0x42f4('0x7')](),controller['destroy']);module[_0x42f4('0xf')]=router; \ No newline at end of file +var _0xb530=['create','/:id/applications','put','update','delete','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','isAuthenticated','get','/:id','show','post'];(function(_0x201920,_0x23a42e){var _0x11ca83=function(_0x14cde0){while(--_0x14cde0){_0x201920['push'](_0x201920['shift']());}};_0x11ca83(++_0x23a42e);}(_0xb530,0x180));var _0x0b53=function(_0x5a687b,_0x167114){_0x5a687b=_0x5a687b-0x0;var _0x455c01=_0xb530[_0x5a687b];return _0x455c01;};'use strict';var multer=require(_0x0b53('0x0'));var util=require(_0x0b53('0x1'));var path=require(_0x0b53('0x2'));var timeout=require('connect-timeout');var express=require(_0x0b53('0x3'));var router=express[_0x0b53('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0b53('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0b53('0x6'));var controller=require('./voiceExtension.controller');router['get']('/',auth[_0x0b53('0x7')](),controller['index']);router[_0x0b53('0x8')](_0x0b53('0x9'),auth[_0x0b53('0x7')](),controller[_0x0b53('0xa')]);router[_0x0b53('0xb')]('/',auth[_0x0b53('0x7')](),controller[_0x0b53('0xc')]);router[_0x0b53('0xb')](_0x0b53('0xd'),auth[_0x0b53('0x7')](),controller['addApplications']);router[_0x0b53('0xe')](_0x0b53('0x9'),auth[_0x0b53('0x7')](),controller[_0x0b53('0xf')]);router[_0x0b53('0x10')](_0x0b53('0x9'),auth[_0x0b53('0x7')](),controller['destroy']);module[_0x0b53('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index c390ba3..f98d796 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 _0x37e0=['sequelize','STRING','compositeIndex','NoOp','outbound','internal','*,*,*,*','BOOLEAN','INTEGER','wav','getDataValue','exten'];(function(_0x7c10a8,_0x1fdc2d){var _0x2c0ef5=function(_0x22a6ae){while(--_0x22a6ae){_0x7c10a8['push'](_0x7c10a8['shift']());}};_0x2c0ef5(++_0x1fdc2d);}(_0x37e0,0x138));var _0x037e=function(_0x1315ab,_0x7a5eb){_0x1315ab=_0x1315ab-0x0;var _0xf75ff5=_0x37e0[_0x1315ab];return _0xf75ff5;};'use strict';var Sequelize=require(_0x037e('0x0'));module['exports']={'context':{'type':Sequelize[_0x037e('0x1')],'allowNull':![],'unique':_0x037e('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x037e('0x1')],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x037e('0x2')},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x037e('0x1')],'allowNull':![],'defaultValue':_0x037e('0x3')},'appdata':{'type':Sequelize[_0x037e('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM']('inbound',_0x037e('0x4'),_0x037e('0x5'),'inbound-fax','outbound-fax','system','any'),'allowNull':![]},'description':{'type':Sequelize[_0x037e('0x1')]},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x037e('0x6')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize[_0x037e('0x7')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize[_0x037e('0x1')],'allowNull':!![]},'record':{'type':Sequelize[_0x037e('0x7')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x037e('0x8')]},'recordingFormat':{'type':Sequelize[_0x037e('0x1')],'defaultValue':_0x037e('0x9')},'answer':{'type':Sequelize[_0x037e('0x7')],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x2f9f0f){return this[_0x037e('0xa')](_0x037e('0xb'));}},'alias':{'type':Sequelize[_0x037e('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0xff40=['getDataValue','exports','STRING','compositeIndex','NoOp','ENUM','inbound','internal','inbound-fax','any','*,*,*,*','INTEGER','BOOLEAN','wav'];(function(_0x564319,_0x55dd3c){var _0x1f5f43=function(_0x2e7abe){while(--_0x2e7abe){_0x564319['push'](_0x564319['shift']());}};_0x1f5f43(++_0x55dd3c);}(_0xff40,0x143));var _0x0ff4=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0xff40[_0x15bc81];return _0x59440e;};'use strict';var Sequelize=require('sequelize');module[_0x0ff4('0x0')]={'context':{'type':Sequelize[_0x0ff4('0x1')],'allowNull':![],'unique':_0x0ff4('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x0ff4('0x1')],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0x0ff4('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x0ff4('0x1')],'allowNull':![],'defaultValue':_0x0ff4('0x3')},'appdata':{'type':Sequelize[_0x0ff4('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x0ff4('0x4')](_0x0ff4('0x5'),'outbound',_0x0ff4('0x6'),_0x0ff4('0x7'),'outbound-fax','system',_0x0ff4('0x8')),'allowNull':![]},'description':{'type':Sequelize[_0x0ff4('0x1')]},'interval':{'type':Sequelize[_0x0ff4('0x1')],'allowNull':![],'defaultValue':_0x0ff4('0x9')},'IntervalId':{'type':Sequelize[_0x0ff4('0xa')]},'isApp':{'type':Sequelize[_0x0ff4('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize[_0x0ff4('0x1')],'allowNull':!![]},'record':{'type':Sequelize[_0x0ff4('0xb')],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize[_0x0ff4('0x1')],'defaultValue':_0x0ff4('0xc')},'answer':{'type':Sequelize[_0x0ff4('0xb')],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x2d4b5d){return this[_0x0ff4('0xd')]('exten');}},'alias':{'type':Sequelize[_0x0ff4('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 3efc6a8..b9a7dd3 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 _0x264e=['fieldName','key','model','query','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','startsWith','body','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OutboundRoutes','InternalRoutes','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','description','recordingFormat','cutdigits','sequelize','isApp','rewriteDial','toLowerCase','true','createRouting','findAndCountAll','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','update','then','destroy','get','InboundRoutes','inbound','outbound','ignore','map','value','includes','type','UserProfileResource','stack','name','VoiceExtension','rawAttributes'];(function(_0xb3159a,_0x155c83){var _0x33469b=function(_0x4fd3b9){while(--_0x4fd3b9){_0xb3159a['push'](_0xb3159a['shift']());}};_0x33469b(++_0x155c83);}(_0x264e,0x17d));var _0xe264=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x264e[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0xe264('0x0'));var rimraf=require(_0xe264('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe264('0x2'));var rp=require(_0xe264('0x3'));var moment=require(_0xe264('0x4'));var BPromise=require(_0xe264('0x5'));var Mustache=require(_0xe264('0x6'));var util=require(_0xe264('0x7'));var path=require(_0xe264('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe264('0x9'));var fs=require('fs');var fs_extra=require(_0xe264('0xa'));var _=require(_0xe264('0xb'));var squel=require('squel');var crypto=require(_0xe264('0xc'));var jsforce=require(_0xe264('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe264('0xe'));var querystring=require(_0xe264('0xf'));var Papa=require(_0xe264('0x10'));var Redis=require(_0xe264('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xe264('0x12'));var as=require(_0xe264('0x13'));var hardwareService=require(_0xe264('0x14'));var logger=require('../../config/logger')(_0xe264('0x15'));var utils=require('../../config/utils');var config=require(_0xe264('0x16'));var licenseUtil=require(_0xe264('0x17'));var db=require(_0xe264('0x18'))['db'];config[_0xe264('0x19')]=_[_0xe264('0x1a')](config[_0xe264('0x19')],{'host':_0xe264('0x1b'),'port':0x18eb});var socket=require(_0xe264('0x1c'))(new Redis(config[_0xe264('0x19')]));require(_0xe264('0x1d'))[_0xe264('0x1e')](socket);function respondWithStatusCode(_0x2d2be4,_0x56f348){_0x56f348=_0x56f348||0xcc;return function(_0x2124c5){if(_0x2124c5){return _0x2d2be4[_0xe264('0x1f')](_0x56f348);}return _0x2d2be4[_0xe264('0x20')](_0x56f348)[_0xe264('0x21')]();};}function respondWithResult(_0x57954d,_0xb67b03){_0xb67b03=_0xb67b03||0xc8;return function(_0x42293b){if(_0x42293b){return _0x57954d[_0xe264('0x20')](_0xb67b03)[_0xe264('0x22')](_0x42293b);}};}function respondWithFilteredResult(_0x2c6e53,_0x17cf5f){return function(_0x49d8fc){if(_0x49d8fc){var _0x579a2e=typeof _0x17cf5f['offset']===_0xe264('0x23')&&typeof _0x17cf5f[_0xe264('0x24')]===_0xe264('0x23');var _0x26edb0=_0x49d8fc[_0xe264('0x25')];var _0x19b622=_0x579a2e?0x0:_0x17cf5f[_0xe264('0x26')];var _0x3baa43=_0x579a2e?_0x49d8fc[_0xe264('0x25')]:_0x17cf5f[_0xe264('0x26')]+_0x17cf5f[_0xe264('0x24')];var _0x19ccc8;if(_0x3baa43>=_0x26edb0){_0x3baa43=_0x26edb0;_0x19ccc8=0xc8;}else{_0x19ccc8=0xce;}_0x2c6e53['status'](_0x19ccc8);return _0x2c6e53[_0xe264('0x27')]('Content-Range',_0x19b622+'-'+_0x3baa43+'/'+_0x26edb0)[_0xe264('0x22')](_0x49d8fc);}return null;};}function patchUpdates(_0xd4e2ed){return function(_0xe4edaf){try{jsonpatch[_0xe264('0x28')](_0xe4edaf,_0xd4e2ed,!![]);}catch(_0x111811){return BPromise[_0xe264('0x29')](_0x111811);}return _0xe4edaf['save']();};}function saveUpdates(_0x2db5c0,_0x14f911){return function(_0x370890){if(_0x370890){return _0x370890[_0xe264('0x2a')](_0x2db5c0)[_0xe264('0x2b')](function(_0x20e77){return _0x20e77;});}return null;};}function removeEntity(_0x1959b4,_0x53dc15){return function(_0x13cfa9){if(_0x13cfa9){return _0x13cfa9[_0xe264('0x2c')]()[_0xe264('0x2b')](function(){var _0x4c0e3a=_0x13cfa9[_0xe264('0x2d')]({'plain':!![]});var _0x5cd2a7=[{'name':_0xe264('0x2e'),'value':_0xe264('0x2f'),'ignore':![]},{'name':'OutboundRoutes','value':_0xe264('0x30'),'ignore':![]},{'name':'InternalRoutes','value':'internal','ignore':![]}];var _0x249dcf=_(_0x5cd2a7)['filter'](_0xe264('0x31'))[_0xe264('0x32')](_0xe264('0x33'))[_0xe264('0x33')]();if(_[_0xe264('0x34')](_0x249dcf,_0x4c0e3a[_0xe264('0x35')])){return;}var _0x63d844=_['find'](_0x5cd2a7,[_0xe264('0x33'),_0x4c0e3a['type']])['name'];return db[_0xe264('0x36')][_0xe264('0x2c')]({'where':{'type':_0x63d844,'resourceId':_0x4c0e3a['id']}})['then'](function(){return _0x13cfa9;});})[_0xe264('0x2b')](function(){_0x1959b4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x567362,_0x5522f9){return function(_0x5aae25){if(!_0x5aae25){_0x567362['sendStatus'](0x194);}return _0x5aae25;};}function handleError(_0x213bfc,_0x3f39da){_0x3f39da=_0x3f39da||0x1f4;return function(_0xbc580a){logger['error'](_0xbc580a[_0xe264('0x37')]);if(_0xbc580a[_0xe264('0x38')]){delete _0xbc580a[_0xe264('0x38')];}_0x213bfc[_0xe264('0x20')](_0x3f39da)['send'](_0xbc580a);};}exports['index']=function(_0x4c8e02,_0x4e2481){var _0x4d6461={},_0x224223={},_0x348e28={'count':0x0,'rows':[]};var _0xa16998=_[_0xe264('0x32')](db[_0xe264('0x39')][_0xe264('0x3a')],function(_0x34899f){return{'name':_0x34899f[_0xe264('0x3b')],'type':_0x34899f[_0xe264('0x35')][_0xe264('0x3c')]};});_0x224223[_0xe264('0x3d')]=_[_0xe264('0x32')](_0xa16998,_0xe264('0x38'));_0x224223[_0xe264('0x3e')]=_['keys'](_0x4c8e02[_0xe264('0x3e')]);_0x224223[_0xe264('0x3f')]=_['intersection'](_0x224223[_0xe264('0x3d')],_0x224223['query']);_0x4d6461['attributes']=_[_0xe264('0x40')](_0x224223[_0xe264('0x3d')],qs[_0xe264('0x41')](_0x4c8e02[_0xe264('0x3e')][_0xe264('0x41')]));_0x4d6461['attributes']=_0x4d6461[_0xe264('0x42')][_0xe264('0x43')]?_0x4d6461[_0xe264('0x42')]:_0x224223['model'];if(!_0x4c8e02[_0xe264('0x3e')]['hasOwnProperty'](_0xe264('0x44'))){_0x4d6461[_0xe264('0x24')]=qs[_0xe264('0x24')](_0x4c8e02[_0xe264('0x3e')]['limit']);_0x4d6461['offset']=qs['offset'](_0x4c8e02['query'][_0xe264('0x26')]);}_0x4d6461['order']=qs[_0xe264('0x45')](_0x4c8e02[_0xe264('0x3e')][_0xe264('0x45')]);_0x4d6461[_0xe264('0x46')]=qs[_0xe264('0x3f')](_[_0xe264('0x47')](_0x4c8e02[_0xe264('0x3e')],_0x224223['filters']),_0xa16998);if(_0x4c8e02['query'][_0xe264('0x48')]){_0x4d6461[_0xe264('0x46')]=_[_0xe264('0x49')](_0x4d6461[_0xe264('0x46')],{'$or':_[_0xe264('0x32')](_0xa16998,function(_0x48605e){if(_0x48605e[_0xe264('0x35')]!==_0xe264('0x4a')){var _0x180880={};_0x180880[_0x48605e[_0xe264('0x38')]]={'$like':'%'+_0x4c8e02[_0xe264('0x3e')][_0xe264('0x48')]+'%'};return _0x180880;}})});}_0x4d6461=_[_0xe264('0x49')]({},_0x4d6461,_0x4c8e02[_0xe264('0x4b')]);var _0x56ae03={'where':_0x4d6461[_0xe264('0x46')]};return db[_0xe264('0x39')][_0xe264('0x25')](_0x56ae03)['then'](function(_0x4bb88b){_0x348e28[_0xe264('0x25')]=_0x4bb88b;if(_0x4c8e02[_0xe264('0x3e')][_0xe264('0x4c')]){_0x4d6461[_0xe264('0x4d')]=[{'all':!![]}];}return db[_0xe264('0x39')][_0xe264('0x4e')](_0x4d6461);})['then'](function(_0x14e84b){_0x348e28[_0xe264('0x4f')]=_0x14e84b;return _0x348e28;})[_0xe264('0x2b')](respondWithFilteredResult(_0x4e2481,_0x4d6461))[_0xe264('0x50')](handleError(_0x4e2481,null));};exports[_0xe264('0x51')]=function(_0x8cb4de,_0x2acdd5){var _0x5d8701={'raw':![],'where':{'id':_0x8cb4de[_0xe264('0x52')]['id']}},_0x55ba67={};_0x55ba67['model']=_['keys'](db[_0xe264('0x39')][_0xe264('0x3a')]);_0x55ba67[_0xe264('0x3e')]=_[_0xe264('0x53')](_0x8cb4de['query']);_0x55ba67[_0xe264('0x3f')]=_[_0xe264('0x40')](_0x55ba67['model'],_0x55ba67[_0xe264('0x3e')]);_0x5d8701[_0xe264('0x42')]=_['intersection'](_0x55ba67[_0xe264('0x3d')],qs[_0xe264('0x41')](_0x8cb4de[_0xe264('0x3e')]['fields']));_0x5d8701[_0xe264('0x42')]=_0x5d8701['attributes']['length']?_0x5d8701[_0xe264('0x42')]:_0x55ba67[_0xe264('0x3d')];if(_0x8cb4de[_0xe264('0x3e')][_0xe264('0x4c')]){_0x5d8701[_0xe264('0x4d')]=[{'all':!![]}];}_0x5d8701=_['merge']({},_0x5d8701,_0x8cb4de['options']);return db[_0xe264('0x39')][_0xe264('0x54')](_0x5d8701)[_0xe264('0x2b')](handleEntityNotFound(_0x2acdd5,null))[_0xe264('0x2b')](respondWithResult(_0x2acdd5,null))[_0xe264('0x50')](handleError(_0x2acdd5,null));};exports[_0xe264('0x2c')]=function(_0x5dfd6b,_0x488bdc){return db[_0xe264('0x39')][_0xe264('0x54')]({'where':{'id':_0x5dfd6b['params']['id']}})[_0xe264('0x2b')](handleEntityNotFound(_0x488bdc,null))['then'](removeEntity(_0x488bdc,null))[_0xe264('0x50')](handleError(_0x488bdc,null));};exports[_0xe264('0x55')]=function(_0x282a4c,_0x21bbde){if(_0x282a4c['body'][_0xe264('0x35')]===_0xe264('0x30')&&!_[_0xe264('0x56')](_0x282a4c[_0xe264('0x57')][_0xe264('0x58')],'_')){_0x282a4c[_0xe264('0x57')]['exten']='_'[_0xe264('0x59')](_0x282a4c[_0xe264('0x57')]['exten']);}return db[_0xe264('0x39')]['create'](_0x282a4c['body'],{'raw':![]})[_0xe264('0x2b')](function(_0x453629){var _0x426c42=_0x282a4c[_0xe264('0x5a')]['get']({'plain':!![]});if(!_0x426c42)throw new Error(_0xe264('0x5b'));if(_0x426c42[_0xe264('0x5c')]===_0xe264('0x5a')){var _0x3a3d24=_0x453629[_0xe264('0x2d')]({'plain':!![]});var _0x4cac3a=[{'name':_0xe264('0x2e'),'value':_0xe264('0x2f')},{'name':_0xe264('0x5d'),'value':'outbound'},{'name':_0xe264('0x5e'),'value':'internal'}];var _0x7b8856=_[_0xe264('0x54')](_0x4cac3a,[_0xe264('0x33'),_0x3a3d24[_0xe264('0x35')]])['name'];return db[_0xe264('0x5f')][_0xe264('0x54')]({'where':{'name':_0x7b8856,'userProfileId':_0x426c42['userProfileId']},'raw':!![]})[_0xe264('0x2b')](function(_0x43f3d9){if(_0x43f3d9&&_0x43f3d9[_0xe264('0x60')]===0x0){return db[_0xe264('0x36')]['create']({'name':_0x3a3d24[_0xe264('0x38')],'resourceId':_0x3a3d24['id'],'type':_0x43f3d9[_0xe264('0x38')],'sectionId':_0x43f3d9['id']},{})[_0xe264('0x2b')](function(){return _0x453629;});}else{return _0x453629;}})[_0xe264('0x50')](function(_0x569174){logger[_0xe264('0x61')](_0xe264('0x62'),_0x569174);throw _0x569174;});}return _0x453629;})[_0xe264('0x2b')](respondWithResult(_0x21bbde,0xc9))[_0xe264('0x50')](handleError(_0x21bbde,null));};exports[_0xe264('0x2a')]=function(_0x4e4ead,_0x16d867){if(_0x4e4ead[_0xe264('0x57')]['id']){delete _0x4e4ead['body']['id'];}return db[_0xe264('0x39')][_0xe264('0x54')]({'where':{'id':_0x4e4ead[_0xe264('0x52')]['id']}})['then'](handleEntityNotFound(_0x16d867,null))[_0xe264('0x2b')](function(_0x2c6439){if(_0x2c6439){return db['VoiceExtension']['update'](_[_0xe264('0x47')](_0x4e4ead['body'],[_0xe264('0x58'),_0xe264('0x63'),_0xe264('0x64'),_0xe264('0x65'),_0xe264('0x66'),'mandatoryDisposition','alias']),{'where':{'context':_0x2c6439[_0xe264('0x63')],'exten':_0x2c6439['exten']},'individualHooks':!![]})['then'](function(_0x1d1647){return _0x1d1647;});}return null;})[_0xe264('0x2b')](respondWithStatusCode(_0x16d867,null))['catch'](handleError(_0x16d867,null));};exports['addApplications']=function(_0x15fc3b,_0x4d1cf1){return db[_0xe264('0x39')]['findOne']({'where':{'id':_0x15fc3b[_0xe264('0x52')]['id']}})['then'](function(_0x4f3898){if(_0x4f3898){return db[_0xe264('0x67')]['transaction'](function(_0x37d4b3){return db['VoiceExtension'][_0xe264('0x2c')]({'where':{'VoiceExtensionId':_0x15fc3b[_0xe264('0x52')]['id']},'transaction':_0x37d4b3})[_0xe264('0x2b')](function(){var _0x7c3a4=_[_0xe264('0x32')](_0x15fc3b[_0xe264('0x57')],function(_0x3e849f){_0x3e849f['VoiceExtensionId']=_0x15fc3b[_0xe264('0x52')]['id'];_0x3e849f[_0xe264('0x68')]=!![];return _0x3e849f;});var _0x547687=_0x15fc3b[_0xe264('0x3e')][_0xe264('0x69')]&&_0x15fc3b[_0xe264('0x3e')][_0xe264('0x69')][_0xe264('0x6a')]()===_0xe264('0x6b')?!![]:![];return _0x4f3898[_0xe264('0x6c')](_0x7c3a4,_0x547687);})[_0xe264('0x2b')](function(_0x5a4a06){return db['VoiceExtension']['bulkCreate'](_0x5a4a06,{'transaction':_0x37d4b3});});})[_0xe264('0x2b')](function(){return db[_0xe264('0x39')][_0xe264('0x6d')]({'where':{'isApp':!![],'VoiceExtensionId':_0x15fc3b[_0xe264('0x52')]['id']},'order':'cast(priority\x20as\x20unsigned)'});});}})[_0xe264('0x2b')](respondWithResult(_0x4d1cf1,null))[_0xe264('0x50')](handleError(_0x4d1cf1,null));}; \ No newline at end of file +var _0xb495=['request-promise','moment','mustache','util','sox','ejs','fs-extra','squel','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','filter','map','value','includes','type','find','name','UserProfileResource','stack','send','VoiceExtension','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','merge','options','includeAll','include','show','params','length','catch','body','exten','concat','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','recordingFormat','cutdigits','mandatoryDisposition','alias','addApplications','sequelize','VoiceExtensionId','isApp','rewriteDial','toLowerCase','true','createRouting','findAndCountAll','cast(priority\x20as\x20unsigned)','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x3f25cf,_0x17d735){var _0xcda29b=function(_0x18c1ce){while(--_0x18c1ce){_0x3f25cf['push'](_0x3f25cf['shift']());}};_0xcda29b(++_0x17d735);}(_0xb495,0xda));var _0x5b49=function(_0x45b91d,_0x587c81){_0x45b91d=_0x45b91d-0x0;var _0x4d4188=_0xb495[_0x45b91d];return _0x4d4188;};'use strict';var emlformat=require(_0x5b49('0x0'));var rimraf=require(_0x5b49('0x1'));var zipdir=require(_0x5b49('0x2'));var jsonpatch=require(_0x5b49('0x3'));var rp=require(_0x5b49('0x4'));var moment=require(_0x5b49('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5b49('0x6'));var util=require(_0x5b49('0x7'));var path=require('path');var sox=require(_0x5b49('0x8'));var csv=require('to-csv');var ejs=require(_0x5b49('0x9'));var fs=require('fs');var fs_extra=require(_0x5b49('0xa'));var _=require('lodash');var squel=require(_0x5b49('0xb'));var crypto=require('crypto');var jsforce=require(_0x5b49('0xc'));var deskjs=require(_0x5b49('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5b49('0xe'));var qs=require(_0x5b49('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5b49('0x10'))(_0x5b49('0x11'));var utils=require('../../config/utils');var config=require(_0x5b49('0x12'));var licenseUtil=require(_0x5b49('0x13'));var db=require('../../mysqldb')['db'];config[_0x5b49('0x14')]=_[_0x5b49('0x15')](config[_0x5b49('0x14')],{'host':_0x5b49('0x16'),'port':0x18eb});var socket=require(_0x5b49('0x17'))(new Redis(config['redis']));require(_0x5b49('0x18'))[_0x5b49('0x19')](socket);function respondWithStatusCode(_0x1c17fc,_0x12c7b3){_0x12c7b3=_0x12c7b3||0xcc;return function(_0x4efcce){if(_0x4efcce){return _0x1c17fc[_0x5b49('0x1a')](_0x12c7b3);}return _0x1c17fc['status'](_0x12c7b3)[_0x5b49('0x1b')]();};}function respondWithResult(_0x35e185,_0x287c71){_0x287c71=_0x287c71||0xc8;return function(_0x13b6d6){if(_0x13b6d6){return _0x35e185[_0x5b49('0x1c')](_0x287c71)[_0x5b49('0x1d')](_0x13b6d6);}};}function respondWithFilteredResult(_0x32c61f,_0x4db1f6){return function(_0x30adda){if(_0x30adda){var _0x19c7e7=typeof _0x4db1f6[_0x5b49('0x1e')]===_0x5b49('0x1f')&&typeof _0x4db1f6[_0x5b49('0x20')]==='undefined';var _0x5b8d83=_0x30adda[_0x5b49('0x21')];var _0x3a5808=_0x19c7e7?0x0:_0x4db1f6[_0x5b49('0x1e')];var _0x1166f9=_0x19c7e7?_0x30adda[_0x5b49('0x21')]:_0x4db1f6[_0x5b49('0x1e')]+_0x4db1f6['limit'];var _0x2fa9c4;if(_0x1166f9>=_0x5b8d83){_0x1166f9=_0x5b8d83;_0x2fa9c4=0xc8;}else{_0x2fa9c4=0xce;}_0x32c61f['status'](_0x2fa9c4);return _0x32c61f[_0x5b49('0x22')](_0x5b49('0x23'),_0x3a5808+'-'+_0x1166f9+'/'+_0x5b8d83)[_0x5b49('0x1d')](_0x30adda);}return null;};}function patchUpdates(_0x2f3503){return function(_0x1e06ec){try{jsonpatch[_0x5b49('0x24')](_0x1e06ec,_0x2f3503,!![]);}catch(_0x327624){return BPromise[_0x5b49('0x25')](_0x327624);}return _0x1e06ec[_0x5b49('0x26')]();};}function saveUpdates(_0x57981f,_0xcc2ba7){return function(_0x2c396a){if(_0x2c396a){return _0x2c396a['update'](_0x57981f)[_0x5b49('0x27')](function(_0x54aee9){return _0x54aee9;});}return null;};}function removeEntity(_0x40ed19,_0x23a590){return function(_0x332ff1){if(_0x332ff1){return _0x332ff1[_0x5b49('0x28')]()[_0x5b49('0x27')](function(){var _0x5c792=_0x332ff1[_0x5b49('0x29')]({'plain':!![]});var _0x1e7bbb=[{'name':_0x5b49('0x2a'),'value':_0x5b49('0x2b'),'ignore':![]},{'name':_0x5b49('0x2c'),'value':_0x5b49('0x2d'),'ignore':![]},{'name':_0x5b49('0x2e'),'value':_0x5b49('0x2f'),'ignore':![]}];var _0x406f3d=_(_0x1e7bbb)[_0x5b49('0x30')]('ignore')[_0x5b49('0x31')](_0x5b49('0x32'))['value']();if(_[_0x5b49('0x33')](_0x406f3d,_0x5c792[_0x5b49('0x34')])){return;}var _0x1d9d2f=_[_0x5b49('0x35')](_0x1e7bbb,[_0x5b49('0x32'),_0x5c792[_0x5b49('0x34')]])[_0x5b49('0x36')];return db[_0x5b49('0x37')][_0x5b49('0x28')]({'where':{'type':_0x1d9d2f,'resourceId':_0x5c792['id']}})[_0x5b49('0x27')](function(){return _0x332ff1;});})[_0x5b49('0x27')](function(){_0x40ed19[_0x5b49('0x1c')](0xcc)[_0x5b49('0x1b')]();});}};}function handleEntityNotFound(_0x4bf4de,_0x2c787c){return function(_0x214aa3){if(!_0x214aa3){_0x4bf4de[_0x5b49('0x1a')](0x194);}return _0x214aa3;};}function handleError(_0x3303e6,_0x1ddbdb){_0x1ddbdb=_0x1ddbdb||0x1f4;return function(_0x445dd9){logger['error'](_0x445dd9[_0x5b49('0x38')]);if(_0x445dd9['name']){delete _0x445dd9['name'];}_0x3303e6['status'](_0x1ddbdb)[_0x5b49('0x39')](_0x445dd9);};}exports['index']=function(_0x3d897c,_0x1e4c6b){var _0x16a799={},_0x1cc8f7={},_0x5cbd71={'count':0x0,'rows':[]};var _0x2144c5=_[_0x5b49('0x31')](db[_0x5b49('0x3a')][_0x5b49('0x3b')],function(_0x3a175c){return{'name':_0x3a175c['fieldName'],'type':_0x3a175c['type'][_0x5b49('0x3c')]};});_0x1cc8f7[_0x5b49('0x3d')]=_[_0x5b49('0x31')](_0x2144c5,'name');_0x1cc8f7[_0x5b49('0x3e')]=_[_0x5b49('0x3f')](_0x3d897c['query']);_0x1cc8f7[_0x5b49('0x40')]=_[_0x5b49('0x41')](_0x1cc8f7[_0x5b49('0x3d')],_0x1cc8f7['query']);_0x16a799[_0x5b49('0x42')]=_['intersection'](_0x1cc8f7[_0x5b49('0x3d')],qs[_0x5b49('0x43')](_0x3d897c[_0x5b49('0x3e')]['fields']));_0x16a799[_0x5b49('0x42')]=_0x16a799[_0x5b49('0x42')]['length']?_0x16a799[_0x5b49('0x42')]:_0x1cc8f7['model'];if(!_0x3d897c[_0x5b49('0x3e')][_0x5b49('0x44')](_0x5b49('0x45'))){_0x16a799[_0x5b49('0x20')]=qs[_0x5b49('0x20')](_0x3d897c[_0x5b49('0x3e')][_0x5b49('0x20')]);_0x16a799[_0x5b49('0x1e')]=qs['offset'](_0x3d897c[_0x5b49('0x3e')][_0x5b49('0x1e')]);}_0x16a799[_0x5b49('0x46')]=qs[_0x5b49('0x47')](_0x3d897c[_0x5b49('0x3e')][_0x5b49('0x47')]);_0x16a799[_0x5b49('0x48')]=qs['filters'](_[_0x5b49('0x49')](_0x3d897c[_0x5b49('0x3e')],_0x1cc8f7[_0x5b49('0x40')]),_0x2144c5);if(_0x3d897c[_0x5b49('0x3e')][_0x5b49('0x30')]){_0x16a799[_0x5b49('0x48')]=_['merge'](_0x16a799[_0x5b49('0x48')],{'$or':_[_0x5b49('0x31')](_0x2144c5,function(_0x583b6f){if(_0x583b6f[_0x5b49('0x34')]!==_0x5b49('0x4a')){var _0x76acb6={};_0x76acb6[_0x583b6f[_0x5b49('0x36')]]={'$like':'%'+_0x3d897c[_0x5b49('0x3e')][_0x5b49('0x30')]+'%'};return _0x76acb6;}})});}_0x16a799=_[_0x5b49('0x4b')]({},_0x16a799,_0x3d897c[_0x5b49('0x4c')]);var _0x1db4cd={'where':_0x16a799[_0x5b49('0x48')]};return db[_0x5b49('0x3a')][_0x5b49('0x21')](_0x1db4cd)[_0x5b49('0x27')](function(_0x5b517f){_0x5cbd71[_0x5b49('0x21')]=_0x5b517f;if(_0x3d897c[_0x5b49('0x3e')][_0x5b49('0x4d')]){_0x16a799[_0x5b49('0x4e')]=[{'all':!![]}];}return db[_0x5b49('0x3a')]['findAll'](_0x16a799);})['then'](function(_0x20027a){_0x5cbd71['rows']=_0x20027a;return _0x5cbd71;})['then'](respondWithFilteredResult(_0x1e4c6b,_0x16a799))['catch'](handleError(_0x1e4c6b,null));};exports[_0x5b49('0x4f')]=function(_0xf680cb,_0x15fa5a){var _0xf53246={'raw':![],'where':{'id':_0xf680cb[_0x5b49('0x50')]['id']}},_0x5e9f0b={};_0x5e9f0b[_0x5b49('0x3d')]=_[_0x5b49('0x3f')](db[_0x5b49('0x3a')][_0x5b49('0x3b')]);_0x5e9f0b[_0x5b49('0x3e')]=_['keys'](_0xf680cb[_0x5b49('0x3e')]);_0x5e9f0b[_0x5b49('0x40')]=_['intersection'](_0x5e9f0b[_0x5b49('0x3d')],_0x5e9f0b[_0x5b49('0x3e')]);_0xf53246[_0x5b49('0x42')]=_[_0x5b49('0x41')](_0x5e9f0b[_0x5b49('0x3d')],qs['fields'](_0xf680cb[_0x5b49('0x3e')][_0x5b49('0x43')]));_0xf53246[_0x5b49('0x42')]=_0xf53246[_0x5b49('0x42')][_0x5b49('0x51')]?_0xf53246['attributes']:_0x5e9f0b['model'];if(_0xf680cb[_0x5b49('0x3e')]['includeAll']){_0xf53246[_0x5b49('0x4e')]=[{'all':!![]}];}_0xf53246=_[_0x5b49('0x4b')]({},_0xf53246,_0xf680cb[_0x5b49('0x4c')]);return db[_0x5b49('0x3a')]['find'](_0xf53246)[_0x5b49('0x27')](handleEntityNotFound(_0x15fa5a,null))[_0x5b49('0x27')](respondWithResult(_0x15fa5a,null))[_0x5b49('0x52')](handleError(_0x15fa5a,null));};exports[_0x5b49('0x28')]=function(_0x4e912d,_0x5914b6){return db[_0x5b49('0x3a')][_0x5b49('0x35')]({'where':{'id':_0x4e912d[_0x5b49('0x50')]['id']}})[_0x5b49('0x27')](handleEntityNotFound(_0x5914b6,null))[_0x5b49('0x27')](removeEntity(_0x5914b6,null))['catch'](handleError(_0x5914b6,null));};exports['create']=function(_0x297d4a,_0x5dd59b){if(_0x297d4a['body'][_0x5b49('0x34')]===_0x5b49('0x2d')&&!_['startsWith'](_0x297d4a[_0x5b49('0x53')][_0x5b49('0x54')],'_')){_0x297d4a['body'][_0x5b49('0x54')]='_'[_0x5b49('0x55')](_0x297d4a[_0x5b49('0x53')]['exten']);}return db[_0x5b49('0x3a')][_0x5b49('0x56')](_0x297d4a[_0x5b49('0x53')],{'raw':![]})[_0x5b49('0x27')](function(_0x5badd3){var _0x4a5cbb=_0x297d4a[_0x5b49('0x57')]['get']({'plain':!![]});if(!_0x4a5cbb)throw new Error(_0x5b49('0x58'));if(_0x4a5cbb[_0x5b49('0x59')]===_0x5b49('0x57')){var _0x2793cc=_0x5badd3['get']({'plain':!![]});var _0x32ca98=[{'name':_0x5b49('0x2a'),'value':_0x5b49('0x2b')},{'name':'OutboundRoutes','value':_0x5b49('0x2d')},{'name':_0x5b49('0x2e'),'value':'internal'}];var _0x48c43a=_['find'](_0x32ca98,[_0x5b49('0x32'),_0x2793cc[_0x5b49('0x34')]])['name'];return db[_0x5b49('0x5a')][_0x5b49('0x35')]({'where':{'name':_0x48c43a,'userProfileId':_0x4a5cbb[_0x5b49('0x5b')]},'raw':!![]})[_0x5b49('0x27')](function(_0x472e69){if(_0x472e69&&_0x472e69['autoAssociation']===0x0){return db[_0x5b49('0x37')][_0x5b49('0x56')]({'name':_0x2793cc['name'],'resourceId':_0x2793cc['id'],'type':_0x472e69[_0x5b49('0x36')],'sectionId':_0x472e69['id']},{})['then'](function(){return _0x5badd3;});}else{return _0x5badd3;}})[_0x5b49('0x52')](function(_0x2d26a9){logger[_0x5b49('0x5c')](_0x5b49('0x5d'),_0x2d26a9);throw _0x2d26a9;});}return _0x5badd3;})[_0x5b49('0x27')](respondWithResult(_0x5dd59b,0xc9))['catch'](handleError(_0x5dd59b,null));};exports[_0x5b49('0x5e')]=function(_0x2b6e5a,_0x5d229e){if(_0x2b6e5a[_0x5b49('0x53')]['id']){delete _0x2b6e5a['body']['id'];}return db[_0x5b49('0x3a')][_0x5b49('0x35')]({'where':{'id':_0x2b6e5a[_0x5b49('0x50')]['id']}})[_0x5b49('0x27')](handleEntityNotFound(_0x5d229e,null))['then'](function(_0x391396){if(_0x391396){return db[_0x5b49('0x3a')][_0x5b49('0x5e')](_['pick'](_0x2b6e5a['body'],[_0x5b49('0x54'),_0x5b49('0x5f'),_0x5b49('0x60'),_0x5b49('0x61'),_0x5b49('0x62'),_0x5b49('0x63'),_0x5b49('0x64')]),{'where':{'context':_0x391396[_0x5b49('0x5f')],'exten':_0x391396[_0x5b49('0x54')]},'individualHooks':!![]})['then'](function(_0x18b1f7){return _0x18b1f7;});}return null;})[_0x5b49('0x27')](respondWithStatusCode(_0x5d229e,null))[_0x5b49('0x52')](handleError(_0x5d229e,null));};exports[_0x5b49('0x65')]=function(_0x209ce0,_0x230cec){return db[_0x5b49('0x3a')]['findOne']({'where':{'id':_0x209ce0[_0x5b49('0x50')]['id']}})[_0x5b49('0x27')](function(_0x58ed48){if(_0x58ed48){return db[_0x5b49('0x66')]['transaction'](function(_0x3a6fb1){return db[_0x5b49('0x3a')]['destroy']({'where':{'VoiceExtensionId':_0x209ce0['params']['id']},'transaction':_0x3a6fb1})[_0x5b49('0x27')](function(){var _0x4b3f90=_['map'](_0x209ce0[_0x5b49('0x53')],function(_0x49011c){_0x49011c[_0x5b49('0x67')]=_0x209ce0['params']['id'];_0x49011c[_0x5b49('0x68')]=!![];return _0x49011c;});var _0x2c71be=_0x209ce0['query'][_0x5b49('0x69')]&&_0x209ce0['query']['rewriteDial'][_0x5b49('0x6a')]()===_0x5b49('0x6b')?!![]:![];return _0x58ed48[_0x5b49('0x6c')](_0x4b3f90,_0x2c71be);})[_0x5b49('0x27')](function(_0x5ad032){return db[_0x5b49('0x3a')]['bulkCreate'](_0x5ad032,{'transaction':_0x3a6fb1});});})['then'](function(){return db['VoiceExtension'][_0x5b49('0x6d')]({'where':{'isApp':!![],'VoiceExtensionId':_0x209ce0['params']['id']},'order':_0x5b49('0x6e')});});}})['then'](respondWithResult(_0x230cec,null))[_0x5b49('0x52')](handleError(_0x230cec,null));}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 48a9eda..5965716 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 _0xc85a=['VoiceExtension','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x51b1af,_0x5ef6f4){var _0x2c4024=function(_0x4f5c2e){while(--_0x4f5c2e){_0x51b1af['push'](_0x51b1af['shift']());}};_0x2c4024(++_0x5ef6f4);}(_0xc85a,0x152));var _0xac85=function(_0x51849e,_0x472d56){_0x51849e=_0x51849e-0x0;var _0x41b935=_0xc85a[_0x51849e];return _0x41b935;};'use strict';var EventEmitter=require(_0xac85('0x0'));var VoiceExtension=require(_0xac85('0x1'))['db'][_0xac85('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xac85('0x3')](0x0);var events={'afterCreate':_0xac85('0x4'),'afterUpdate':_0xac85('0x5'),'afterDestroy':_0xac85('0x6')};function emitEvent(_0x5514e1){return function(_0x44e500,_0x19362a,_0x5d1d60){VoiceExtensionEvents[_0xac85('0x7')](_0x5514e1+':'+_0x44e500['id'],_0x44e500);VoiceExtensionEvents[_0xac85('0x7')](_0x5514e1,_0x44e500);_0x5d1d60(null);};}for(var e in events){if(events[_0xac85('0x8')](e)){var event=events[e];VoiceExtension[_0xac85('0x9')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file +var _0x8c48=['VoiceExtension','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x19afae,_0x525546){var _0x184370=function(_0x4858f7){while(--_0x4858f7){_0x19afae['push'](_0x19afae['shift']());}};_0x184370(++_0x525546);}(_0x8c48,0xa8));var _0x88c4=function(_0x4ceeb0,_0xde2778){_0x4ceeb0=_0x4ceeb0-0x0;var _0x369077=_0x8c48[_0x4ceeb0];return _0x369077;};'use strict';var EventEmitter=require(_0x88c4('0x0'));var VoiceExtension=require(_0x88c4('0x1'))['db'][_0x88c4('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x88c4('0x3')](0x0);var events={'afterCreate':_0x88c4('0x4'),'afterUpdate':_0x88c4('0x5'),'afterDestroy':_0x88c4('0x6')};function emitEvent(_0x205aec){return function(_0x4aaa6e,_0x57e2ed,_0x46c236){VoiceExtensionEvents[_0x88c4('0x7')](_0x205aec+':'+_0x4aaa6e['id'],_0x4aaa6e);VoiceExtensionEvents[_0x88c4('0x7')](_0x205aec,_0x4aaa6e);_0x46c236(null);};}for(var e in events){if(events[_0x88c4('0x8')](e)){var event=events[e];VoiceExtension[_0x88c4('0x9')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 9e8fa25..9b95075 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 _0xdfcb=['U(xcally-mixmonitor-context)','isEmpty','Interval','interval','then','*,*,*,*','intervals','IntervalId','map','filter','toLowerCase','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','queue','includes','app','custom','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','appType','outboundDial','appdata','priority','concat','last','catch','define','VoiceExtension','voice_extensions','Hangup','util','lodash','models','type','Set','CDR(type)=','context','exten','alias','No\x20alias\x20set','inbound','push','CDR(routeid)=','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','CDR(type)=outbound','outbound','NoOp','CDR(routeAlias)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','XCALLY-MOTION-ANSWER=0','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','timeout','options','split','length','name','trunk','param','phone','prefix','SIP','join','indexOf'];(function(_0x11dc39,_0x491115){var _0x457277=function(_0x1d77cd){while(--_0x1d77cd){_0x11dc39['push'](_0x11dc39['shift']());}};_0x457277(++_0x491115);}(_0xdfcb,0xce));var _0xbdfc=function(_0x725a4c,_0x102507){_0x725a4c=_0x725a4c-0x0;var _0x37b2cc=_0xdfcb[_0x725a4c];return _0x37b2cc;};'use strict';var util=require(_0xbdfc('0x0'));var _=require(_0xbdfc('0x1'));var attributes=require('./voiceExtension.attributes');module['exports']=function(_0x158509){var _0x196c83=_0x158509[_0xbdfc('0x2')];function _0x41b3ca(_0x2602d7){var _0x1fc9dc=0x2;var _0x242104=[{'type':_0x2602d7[_0xbdfc('0x3')],'app':_0xbdfc('0x4'),'appdata':_0xbdfc('0x5')+_0x2602d7[_0xbdfc('0x3')],'context':_0x2602d7[_0xbdfc('0x6')],'exten':_0x2602d7[_0xbdfc('0x7')],'priority':_0x1fc9dc++,'VoiceExtensionId':_0x2602d7['id']},{'type':_0x2602d7[_0xbdfc('0x3')],'app':_0x2602d7['alias']?_0xbdfc('0x4'):'NoOp','appdata':_0x2602d7[_0xbdfc('0x8')]?'CDR(routeAlias)='+_0x2602d7[_0xbdfc('0x8')]:_0xbdfc('0x9'),'context':_0x2602d7['context'],'exten':_0x2602d7[_0xbdfc('0x7')],'priority':_0x1fc9dc++,'VoiceExtensionId':_0x2602d7['id']}];if(_0x2602d7[_0xbdfc('0x3')]===_0xbdfc('0xa')){_0x242104[_0xbdfc('0xb')]({'type':_0xbdfc('0xa'),'app':_0xbdfc('0x4'),'appdata':_0xbdfc('0xc')+_0x2602d7['id'],'context':_0x2602d7[_0xbdfc('0x6')],'exten':_0x2602d7[_0xbdfc('0x7')],'priority':_0x1fc9dc++,'VoiceExtensionId':_0x2602d7['id']});}_0x242104[_0xbdfc('0xb')]({'type':_0x2602d7[_0xbdfc('0x3')],'app':_0xbdfc('0x4'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x2602d7[_0xbdfc('0x6')],'exten':_0x2602d7['exten'],'priority':_0x1fc9dc++,'VoiceExtensionId':_0x2602d7['id']},{'type':_0x2602d7[_0xbdfc('0x3')],'app':_0xbdfc('0x4'),'appdata':_0xbdfc('0xd'),'context':_0x2602d7['context'],'exten':_0x2602d7[_0xbdfc('0x7')],'priority':_0x1fc9dc++,'VoiceExtensionId':_0x2602d7['id']},{'type':_0x2602d7[_0xbdfc('0x3')],'app':_0xbdfc('0x4'),'appdata':_0xbdfc('0xe'),'context':_0x2602d7[_0xbdfc('0x6')],'exten':_0x2602d7['exten'],'priority':_0x1fc9dc++,'VoiceExtensionId':_0x2602d7['id']});return _0x242104;}function _0x24d1c5(_0x1d2380){var _0x52526c=0x2;var _0x7681f2=[{'type':'outbound','app':_0xbdfc('0x4'),'appdata':_0xbdfc('0xf'),'context':_0x1d2380['context'],'exten':_0x1d2380[_0xbdfc('0x7')],'priority':_0x52526c++,'VoiceExtensionId':_0x1d2380['id']},{'type':_0xbdfc('0x10'),'app':_0x1d2380[_0xbdfc('0x8')]?_0xbdfc('0x4'):_0xbdfc('0x11'),'appdata':_0x1d2380[_0xbdfc('0x8')]?_0xbdfc('0x12')+_0x1d2380['alias']:_0xbdfc('0x9'),'context':_0x1d2380['context'],'exten':_0x1d2380[_0xbdfc('0x7')],'priority':_0x52526c++,'VoiceExtensionId':_0x1d2380['id']},{'type':'outbound','app':_0xbdfc('0x4'),'appdata':'CDR(destination)='+(_0x1d2380[_0xbdfc('0x13')]?_0xbdfc('0x14')+_0x1d2380[_0xbdfc('0x13')]+'}':_0xbdfc('0x15')),'context':_0x1d2380[_0xbdfc('0x6')],'exten':_0x1d2380[_0xbdfc('0x7')],'priority':_0x52526c++,'VoiceExtensionId':_0x1d2380['id']},{'type':_0xbdfc('0x10'),'app':_0xbdfc('0x4'),'appdata':_0xbdfc('0xc')+_0x1d2380['id'],'context':_0x1d2380[_0xbdfc('0x6')],'exten':_0x1d2380[_0xbdfc('0x7')],'priority':_0x52526c++,'VoiceExtensionId':_0x1d2380['id']},{'type':'outbound','app':_0xbdfc('0x16'),'appdata':_0xbdfc('0x17')+(_0x52526c+0x2)+_0xbdfc('0x18')+(_0x52526c+0x1)+')','context':_0x1d2380['context'],'exten':_0x1d2380[_0xbdfc('0x7')],'priority':_0x52526c++,'VoiceExtensionId':_0x1d2380['id']},{'type':_0xbdfc('0x10'),'app':_0xbdfc('0x4'),'appdata':_0x1d2380['cutdigits']?_0xbdfc('0x19')+_0x1d2380['cutdigits']+'}':_0xbdfc('0x1a'),'context':_0x1d2380[_0xbdfc('0x6')],'exten':_0x1d2380[_0xbdfc('0x7')],'priority':_0x52526c++,'VoiceExtensionId':_0x1d2380['id']},{'type':_0xbdfc('0x10'),'app':_0xbdfc('0x4'),'appdata':_0xbdfc('0x1b'),'context':_0x1d2380[_0xbdfc('0x6')],'exten':_0x1d2380[_0xbdfc('0x7')],'priority':_0x52526c++,'VoiceExtensionId':_0x1d2380['id']},{'type':_0xbdfc('0x10'),'app':_0xbdfc('0x4'),'appdata':_0xbdfc('0xd'),'context':_0x1d2380[_0xbdfc('0x6')],'exten':_0x1d2380[_0xbdfc('0x7')],'priority':_0x52526c++,'VoiceExtensionId':_0x1d2380['id']},{'type':_0xbdfc('0x10'),'app':_0xbdfc('0x4'),'appdata':_0xbdfc('0xe'),'context':_0x1d2380[_0xbdfc('0x6')],'exten':_0x1d2380['exten'],'priority':_0x52526c++,'VoiceExtensionId':_0x1d2380['id']},{'type':_0xbdfc('0x10'),'app':'Set','appdata':_0xbdfc('0x1c')+_0x1d2380['id'],'context':_0x1d2380[_0xbdfc('0x6')],'exten':_0x1d2380[_0xbdfc('0x7')],'priority':_0x52526c++,'VoiceExtensionId':_0x1d2380['id']}];if(_0x1d2380[_0xbdfc('0x1d')](_0xbdfc('0x1e'))&&_0x1d2380['recordingFormat']!==_0xbdfc('0x1f')){_0x7681f2[_0xbdfc('0xb')]({'type':'outbound','app':_0xbdfc('0x4'),'appdata':_0xbdfc('0x20'),'context':_0x1d2380[_0xbdfc('0x6')],'exten':_0x1d2380[_0xbdfc('0x7')],'priority':_0x52526c++,'VoiceExtensionId':_0x1d2380['id']},{'type':_0xbdfc('0x10'),'app':_0xbdfc('0x4'),'appdata':_0xbdfc('0x21')+_0x1d2380['recordingFormat']||'wav','context':_0x1d2380[_0xbdfc('0x6')],'exten':_0x1d2380[_0xbdfc('0x7')],'priority':_0x52526c++,'VoiceExtensionId':_0x1d2380['id']});}return _0x7681f2;}function _0xb6e697(_0x5c7333){var _0x47835a=[{'name':'trunk','param':0x0},{'name':_0xbdfc('0x22'),'param':0x1},{'name':_0xbdfc('0x23'),'param':0x2},{'name':'url','param':0x3}];var _0x274244={};var _0x11fd2d=_0x5c7333[_0xbdfc('0x24')](',');var _0x3ded44=[];for(var _0x23fbfc=0x0;_0x23fbfc<_0x47835a[_0xbdfc('0x25')];_0x23fbfc++){switch(_0x47835a[_0x23fbfc][_0xbdfc('0x26')]){case _0xbdfc('0x27'):_0x274244[_0xbdfc('0x27')]=_0x11fd2d[_0x47835a[_0x23fbfc][_0xbdfc('0x28')]]['split']('/')[0x1];_0x274244[_0xbdfc('0x29')]=_0x11fd2d[_0x47835a[_0x23fbfc]['param']]['split']('/')[0x2];_0x274244[_0xbdfc('0x2a')]=_0x274244[_0xbdfc('0x29')]?_0x274244[_0xbdfc('0x29')][_0xbdfc('0x24')]('$')[0x0]:undefined;_0x274244[_0xbdfc('0x29')]=route[_0xbdfc('0x13')]?(_0x274244[_0xbdfc('0x2a')]||'')+_0xbdfc('0x14')+route['cutdigits']+'}':(_0x274244[_0xbdfc('0x2a')]||'')+_0xbdfc('0x15');_0x3ded44[_0x47835a[_0x23fbfc][_0xbdfc('0x28')]]=[_0xbdfc('0x2b'),_0x274244[_0xbdfc('0x27')],_0x274244[_0xbdfc('0x29')]][_0xbdfc('0x2c')]('/');break;case _0xbdfc('0x23'):_0x274244[_0xbdfc('0x23')]=_0x11fd2d[_0x47835a[_0x23fbfc][_0xbdfc('0x28')]];if(route['recordingFormat']!==_0xbdfc('0x1f')){if(_0x274244[_0xbdfc('0x23')][_0xbdfc('0x2d')](_0xbdfc('0x2e'))<0x0){_0x274244[_0xbdfc('0x23')]+=_0xbdfc('0x2e');}}else{_0x274244[_0xbdfc('0x23')]=_0x274244[_0xbdfc('0x23')]['replace'](_0xbdfc('0x2e'),'');}_0x3ded44[_0x47835a[_0x23fbfc][_0xbdfc('0x28')]]=_0x274244['options'];break;default:_0x3ded44[_0x47835a[_0x23fbfc]['param']]=_0x11fd2d[_0x47835a[_0x23fbfc][_0xbdfc('0x28')]];}}return _0x3ded44['join'](',');}function _0x323c32(_0x484d76,_0x90cd37,_0x1d4b0b,_0x10de2b){return new Promise(function(_0x3bb441,_0x4c708b){var _0x4e1d6c=[];if(_[_0xbdfc('0x2f')](_0x90cd37))return _0x3bb441(_0x4e1d6c);_0x196c83[_0xbdfc('0x30')]['findAll']({'attributes':['id',_0xbdfc('0x31'),'IntervalId'],'raw':!![]})[_0xbdfc('0x32')](function(_0x507b2d){for(var _0x21d567=0x0,_0x39dbd4=0x0;_0x21d567<_0x90cd37[_0xbdfc('0x25')];_0x21d567++,_0x39dbd4=0x0){var _0x258e40=_0x90cd37[_0x21d567];var _0x541015=[];var _0x46f5cf=[];if(_0x258e40[_0xbdfc('0x31')]!==_0xbdfc('0x33')){_0x258e40[_0xbdfc('0x34')]=[_0x258e40[_0xbdfc('0x31')]];}else{_0x258e40[_0xbdfc('0x34')]=_0x258e40[_0xbdfc('0x35')]?_[_0xbdfc('0x36')](_[_0xbdfc('0x37')](_0x507b2d,{'IntervalId':_0x258e40[_0xbdfc('0x35')]}),'interval'):[];}_0x258e40[_0xbdfc('0x6')]=_0x484d76[_0xbdfc('0x6')];_0x258e40[_0xbdfc('0x7')]=_0x484d76[_0xbdfc('0x7')];if(_0x258e40[_0xbdfc('0x3')])_0x258e40['type']=_0x258e40[_0xbdfc('0x3')][_0xbdfc('0x38')]();if(_0x484d76[_0xbdfc('0x3')]===_0xbdfc('0x10')){if(_0x258e40['hasOwnProperty'](_0xbdfc('0x39'))&&_0x258e40[_0xbdfc('0x39')]&&_0x258e40[_0xbdfc('0x39')]!=='--'){_0x541015[_0xbdfc('0xb')]({'type':_0x258e40[_0xbdfc('0x3')]['toLowerCase'](),'app':_0xbdfc('0x4'),'appdata':_0xbdfc('0x3a')+_0x258e40[_0xbdfc('0x39')],'context':_0x484d76[_0xbdfc('0x6')],'exten':_0x484d76[_0xbdfc('0x7')],'priority':_0x258e40[_0xbdfc('0x34')][_0xbdfc('0x25')]+_0x1d4b0b+_0x39dbd4++,'VoiceExtensionId':_0x484d76['id']});}_0x541015[_0xbdfc('0xb')]({'type':_0x258e40['type']['toLowerCase'](),'app':_0xbdfc('0x16'),'appdata':_0xbdfc('0x3b')+(_0x258e40[_0xbdfc('0x3c')]?_0xbdfc('0x3d')+_0x258e40['callerID']+')':_0xbdfc('0x3e')),'context':_0x484d76[_0xbdfc('0x6')],'exten':_0x484d76[_0xbdfc('0x7')],'priority':_0x258e40['intervals'][_0xbdfc('0x25')]+_0x1d4b0b+_0x39dbd4++,'VoiceExtensionId':_0x484d76['id']});}else{if(_0x258e40['hasOwnProperty'](_0xbdfc('0x3f'))){if([_0xbdfc('0x40'),'playback'][_0xbdfc('0x41')](_0x258e40[_0xbdfc('0x42')][_0xbdfc('0x38')]())&&_0x258e40['appType']!==_0xbdfc('0x43')){if(_0x258e40[_0xbdfc('0x3f')]){_0x541015[_0xbdfc('0xb')]({'type':_0x258e40[_0xbdfc('0x3')]['toLowerCase'](),'app':_0xbdfc('0x16'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x484d76[_0xbdfc('0x6')],'exten':_0x484d76[_0xbdfc('0x7')],'priority':_0x258e40[_0xbdfc('0x34')][_0xbdfc('0x25')]+_0x1d4b0b+_0x39dbd4++,'VoiceExtensionId':_0x484d76['id']});_0x541015[_0xbdfc('0xb')]({'type':_0x258e40[_0xbdfc('0x3')][_0xbdfc('0x38')](),'app':_0xbdfc('0x4'),'appdata':_0xbdfc('0x44'),'context':_0x484d76['context'],'exten':_0x484d76[_0xbdfc('0x7')],'priority':_0x258e40['intervals'][_0xbdfc('0x25')]+_0x1d4b0b+_0x39dbd4++,'VoiceExtensionId':_0x484d76['id']});}else{_0x541015['push']({'type':_0x258e40[_0xbdfc('0x3')][_0xbdfc('0x38')](),'app':_0xbdfc('0x16'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x484d76[_0xbdfc('0x6')],'exten':_0x484d76[_0xbdfc('0x7')],'priority':_0x258e40[_0xbdfc('0x34')]['length']+_0x1d4b0b+_0x39dbd4++,'VoiceExtensionId':_0x484d76['id']});_0x541015['push']({'type':_0x258e40['type'][_0xbdfc('0x38')](),'app':_0xbdfc('0x4'),'appdata':_0xbdfc('0x45'),'context':_0x484d76[_0xbdfc('0x6')],'exten':_0x484d76['exten'],'priority':_0x258e40[_0xbdfc('0x34')][_0xbdfc('0x25')]+_0x1d4b0b+_0x39dbd4++,'VoiceExtensionId':_0x484d76['id']});}}}}for(var _0xb739db=0x0;_0xb739db<_0x258e40['intervals'][_0xbdfc('0x25')];_0xb739db++){var _0x195fdc=_0x1d4b0b+_0x258e40[_0xbdfc('0x34')][_0xbdfc('0x25')];var _0x359de8=_0xb739db===_0x258e40[_0xbdfc('0x34')]['length']-0x1?_0x1d4b0b+_0x541015['length']+_0x46f5cf['length']+0x2:_0x1d4b0b+_0xb739db+0x1;_0x541015[_0xbdfc('0x46')](_0xb739db,0x0,{'type':_0x484d76[_0xbdfc('0x3')],'app':_0xbdfc('0x47'),'appdata':_0x258e40['intervals'][_0xb739db]+'?'+_0x484d76[_0xbdfc('0x6')]+_0xbdfc('0x48')+_0x195fdc+':'+_0x484d76[_0xbdfc('0x6')]+_0xbdfc('0x48')+_0x359de8,'exten':_0x484d76[_0xbdfc('0x7')],'context':_0x484d76[_0xbdfc('0x6')],'priority':_0x1d4b0b+_0xb739db,'VoiceExtensionId':_0x484d76['id']});}if(_0x10de2b&&_0x258e40[_0xbdfc('0x49')]===_0xbdfc('0x4a'))_0x258e40[_0xbdfc('0x4b')]=_0xb6e697(_0x258e40[_0xbdfc('0x4b')]);_0x258e40[_0xbdfc('0x4c')]=_0x541015['length']?_['last'](_0x541015)[_0xbdfc('0x4c')]+0x1:_0x1d4b0b;_0x4e1d6c=_[_0xbdfc('0x4d')](_0x4e1d6c,_0x541015,[_0x258e40],_0x46f5cf);_0x1d4b0b=_[_0xbdfc('0x4e')](_0x4e1d6c)[_0xbdfc('0x4c')]+0x1;}return _0x3bb441(_0x4e1d6c);})[_0xbdfc('0x4f')](function(_0x1554e4){_0x4c708b(_0x1554e4);});});}return _0x158509[_0xbdfc('0x50')](_0xbdfc('0x51'),attributes,{'tableName':_0xbdfc('0x52'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x2ded7a,_0x3cf40d){var _0x8f6a24=this;var _0xe638c8=_0x8f6a24[_0xbdfc('0x3')]===_0xbdfc('0x10')?_0x24d1c5(_0x8f6a24):_0x41b3ca(_0x8f6a24);return _0x323c32(_0x8f6a24,_0x2ded7a,_['last'](_0xe638c8)[_0xbdfc('0x4c')]+0x1,_0x3cf40d)['then'](function(_0x313f44){var _0x79d4b0=_[_0xbdfc('0x4d')](_0xe638c8,_0x313f44);_0x79d4b0[_0xbdfc('0xb')]({'type':_0x8f6a24[_0xbdfc('0x3')],'app':_0xbdfc('0x53'),'exten':_0x8f6a24[_0xbdfc('0x7')],'context':_0x8f6a24[_0xbdfc('0x6')],'priority':_[_0xbdfc('0x4e')](_0x79d4b0)[_0xbdfc('0x4c')]+0x1,'VoiceExtensionId':_0x8f6a24['id']});return _0x79d4b0;});}}});}; \ No newline at end of file +var _0xae31=['map','filter','toLowerCase','hasOwnProperty','tag','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','Set(CALLERID(all)=','callerID','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','splice','GotoIfTime','outboundDial','appdata','priority','last','concat','catch','define','VoiceExtension','voice_extensions','util','lodash','./voiceExtension.attributes','models','Set','CDR(type)=','context','type','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','exten','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(destination)=','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','XCALLY-MOTION-PROGRESS=0','outboundrouteid=','none','_XCALLY_MIXMONITOR_FORMAT=','wav','options','url','split','length','name','trunk','param','phone','prefix','recordingFormat','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','findAll','interval','IntervalId','then','*,*,*,*','intervals'];(function(_0x82b73d,_0x17a49b){var _0x250450=function(_0x361a7b){while(--_0x361a7b){_0x82b73d['push'](_0x82b73d['shift']());}};_0x250450(++_0x17a49b);}(_0xae31,0x1c3));var _0x1ae3=function(_0x51c848,_0x31973b){_0x51c848=_0x51c848-0x0;var _0x4d80b0=_0xae31[_0x51c848];return _0x4d80b0;};'use strict';var util=require(_0x1ae3('0x0'));var _=require(_0x1ae3('0x1'));var attributes=require(_0x1ae3('0x2'));module['exports']=function(_0x3eed8b){var _0x4140c6=_0x3eed8b[_0x1ae3('0x3')];function _0x458a92(_0x449555){var _0x15b60b=0x2;var _0x2eb7f9=[{'type':_0x449555['type'],'app':_0x1ae3('0x4'),'appdata':_0x1ae3('0x5')+_0x449555['type'],'context':_0x449555[_0x1ae3('0x6')],'exten':_0x449555['exten'],'priority':_0x15b60b++,'VoiceExtensionId':_0x449555['id']},{'type':_0x449555[_0x1ae3('0x7')],'app':_0x449555[_0x1ae3('0x8')]?_0x1ae3('0x4'):_0x1ae3('0x9'),'appdata':_0x449555[_0x1ae3('0x8')]?_0x1ae3('0xa')+_0x449555['alias']:_0x1ae3('0xb'),'context':_0x449555[_0x1ae3('0x6')],'exten':_0x449555[_0x1ae3('0xc')],'priority':_0x15b60b++,'VoiceExtensionId':_0x449555['id']}];if(_0x449555[_0x1ae3('0x7')]==='inbound'){_0x2eb7f9[_0x1ae3('0xd')]({'type':'inbound','app':'Set','appdata':_0x1ae3('0xe')+_0x449555['id'],'context':_0x449555[_0x1ae3('0x6')],'exten':_0x449555['exten'],'priority':_0x15b60b++,'VoiceExtensionId':_0x449555['id']});}_0x2eb7f9[_0x1ae3('0xd')]({'type':_0x449555[_0x1ae3('0x7')],'app':_0x1ae3('0x4'),'appdata':_0x1ae3('0xf'),'context':_0x449555[_0x1ae3('0x6')],'exten':_0x449555['exten'],'priority':_0x15b60b++,'VoiceExtensionId':_0x449555['id']},{'type':_0x449555[_0x1ae3('0x7')],'app':_0x1ae3('0x4'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x449555['context'],'exten':_0x449555[_0x1ae3('0xc')],'priority':_0x15b60b++,'VoiceExtensionId':_0x449555['id']},{'type':_0x449555[_0x1ae3('0x7')],'app':_0x1ae3('0x4'),'appdata':_0x1ae3('0x10'),'context':_0x449555[_0x1ae3('0x6')],'exten':_0x449555[_0x1ae3('0xc')],'priority':_0x15b60b++,'VoiceExtensionId':_0x449555['id']});return _0x2eb7f9;}function _0x5a963b(_0x2c7eeb){var _0x24892d=0x2;var _0x395018=[{'type':_0x1ae3('0x11'),'app':'Set','appdata':_0x1ae3('0x12'),'context':_0x2c7eeb[_0x1ae3('0x6')],'exten':_0x2c7eeb[_0x1ae3('0xc')],'priority':_0x24892d++,'VoiceExtensionId':_0x2c7eeb['id']},{'type':_0x1ae3('0x11'),'app':_0x2c7eeb[_0x1ae3('0x8')]?_0x1ae3('0x4'):'NoOp','appdata':_0x2c7eeb['alias']?_0x1ae3('0xa')+_0x2c7eeb['alias']:'No\x20alias\x20set','context':_0x2c7eeb[_0x1ae3('0x6')],'exten':_0x2c7eeb[_0x1ae3('0xc')],'priority':_0x24892d++,'VoiceExtensionId':_0x2c7eeb['id']},{'type':'outbound','app':_0x1ae3('0x4'),'appdata':_0x1ae3('0x13')+(_0x2c7eeb[_0x1ae3('0x14')]?'${EXTEN:'+_0x2c7eeb[_0x1ae3('0x14')]+'}':_0x1ae3('0x15')),'context':_0x2c7eeb[_0x1ae3('0x6')],'exten':_0x2c7eeb[_0x1ae3('0xc')],'priority':_0x24892d++,'VoiceExtensionId':_0x2c7eeb['id']},{'type':_0x1ae3('0x11'),'app':_0x1ae3('0x4'),'appdata':_0x1ae3('0xe')+_0x2c7eeb['id'],'context':_0x2c7eeb[_0x1ae3('0x6')],'exten':_0x2c7eeb['exten'],'priority':_0x24892d++,'VoiceExtensionId':_0x2c7eeb['id']},{'type':'outbound','app':_0x1ae3('0x16'),'appdata':_0x1ae3('0x17')+(_0x24892d+0x2)+_0x1ae3('0x18')+(_0x24892d+0x1)+')','context':_0x2c7eeb[_0x1ae3('0x6')],'exten':_0x2c7eeb[_0x1ae3('0xc')],'priority':_0x24892d++,'VoiceExtensionId':_0x2c7eeb['id']},{'type':_0x1ae3('0x11'),'app':_0x1ae3('0x4'),'appdata':_0x2c7eeb[_0x1ae3('0x14')]?_0x1ae3('0x19')+_0x2c7eeb[_0x1ae3('0x14')]+'}':_0x1ae3('0x1a'),'context':_0x2c7eeb['context'],'exten':_0x2c7eeb[_0x1ae3('0xc')],'priority':_0x24892d++,'VoiceExtensionId':_0x2c7eeb['id']},{'type':_0x1ae3('0x11'),'app':_0x1ae3('0x4'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x2c7eeb['context'],'exten':_0x2c7eeb[_0x1ae3('0xc')],'priority':_0x24892d++,'VoiceExtensionId':_0x2c7eeb['id']},{'type':_0x1ae3('0x11'),'app':_0x1ae3('0x4'),'appdata':_0x1ae3('0x1b'),'context':_0x2c7eeb[_0x1ae3('0x6')],'exten':_0x2c7eeb[_0x1ae3('0xc')],'priority':_0x24892d++,'VoiceExtensionId':_0x2c7eeb['id']},{'type':_0x1ae3('0x11'),'app':_0x1ae3('0x4'),'appdata':_0x1ae3('0x10'),'context':_0x2c7eeb[_0x1ae3('0x6')],'exten':_0x2c7eeb[_0x1ae3('0xc')],'priority':_0x24892d++,'VoiceExtensionId':_0x2c7eeb['id']},{'type':'outbound','app':_0x1ae3('0x4'),'appdata':_0x1ae3('0x1c')+_0x2c7eeb['id'],'context':_0x2c7eeb[_0x1ae3('0x6')],'exten':_0x2c7eeb[_0x1ae3('0xc')],'priority':_0x24892d++,'VoiceExtensionId':_0x2c7eeb['id']}];if(_0x2c7eeb['hasOwnProperty']('recordingFormat')&&_0x2c7eeb['recordingFormat']!==_0x1ae3('0x1d')){_0x395018[_0x1ae3('0xd')]({'type':_0x1ae3('0x11'),'app':_0x1ae3('0x4'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x2c7eeb[_0x1ae3('0x6')],'exten':_0x2c7eeb[_0x1ae3('0xc')],'priority':_0x24892d++,'VoiceExtensionId':_0x2c7eeb['id']},{'type':_0x1ae3('0x11'),'app':_0x1ae3('0x4'),'appdata':_0x1ae3('0x1e')+_0x2c7eeb['recordingFormat']||_0x1ae3('0x1f'),'context':_0x2c7eeb[_0x1ae3('0x6')],'exten':_0x2c7eeb[_0x1ae3('0xc')],'priority':_0x24892d++,'VoiceExtensionId':_0x2c7eeb['id']});}return _0x395018;}function _0x42d858(_0x26fe3f){var _0x47c9e5=[{'name':'trunk','param':0x0},{'name':'timeout','param':0x1},{'name':_0x1ae3('0x20'),'param':0x2},{'name':_0x1ae3('0x21'),'param':0x3}];var _0x195bb8={};var _0x5c9f16=_0x26fe3f[_0x1ae3('0x22')](',');var _0x321ea4=[];for(var _0x5235e2=0x0;_0x5235e2<_0x47c9e5[_0x1ae3('0x23')];_0x5235e2++){switch(_0x47c9e5[_0x5235e2][_0x1ae3('0x24')]){case'trunk':_0x195bb8[_0x1ae3('0x25')]=_0x5c9f16[_0x47c9e5[_0x5235e2][_0x1ae3('0x26')]]['split']('/')[0x1];_0x195bb8[_0x1ae3('0x27')]=_0x5c9f16[_0x47c9e5[_0x5235e2][_0x1ae3('0x26')]]['split']('/')[0x2];_0x195bb8[_0x1ae3('0x28')]=_0x195bb8[_0x1ae3('0x27')]?_0x195bb8['phone']['split']('$')[0x0]:undefined;_0x195bb8[_0x1ae3('0x27')]=route[_0x1ae3('0x14')]?(_0x195bb8[_0x1ae3('0x28')]||'')+'${EXTEN:'+route[_0x1ae3('0x14')]+'}':(_0x195bb8[_0x1ae3('0x28')]||'')+'${EXTEN}';_0x321ea4[_0x47c9e5[_0x5235e2]['param']]=['SIP',_0x195bb8['trunk'],_0x195bb8[_0x1ae3('0x27')]]['join']('/');break;case _0x1ae3('0x20'):_0x195bb8['options']=_0x5c9f16[_0x47c9e5[_0x5235e2][_0x1ae3('0x26')]];if(route[_0x1ae3('0x29')]!==_0x1ae3('0x1d')){if(_0x195bb8['options'][_0x1ae3('0x2a')](_0x1ae3('0x2b'))<0x0){_0x195bb8['options']+='U(xcally-mixmonitor-context)';}}else{_0x195bb8['options']=_0x195bb8[_0x1ae3('0x20')][_0x1ae3('0x2c')](_0x1ae3('0x2b'),'');}_0x321ea4[_0x47c9e5[_0x5235e2]['param']]=_0x195bb8[_0x1ae3('0x20')];break;default:_0x321ea4[_0x47c9e5[_0x5235e2][_0x1ae3('0x26')]]=_0x5c9f16[_0x47c9e5[_0x5235e2][_0x1ae3('0x26')]];}}return _0x321ea4['join'](',');}function _0x4a9014(_0x597bb7,_0x53c6a6,_0x3f2063,_0x54456a){return new Promise(function(_0x3eca9c,_0x536797){var _0x38849b=[];if(_[_0x1ae3('0x2d')](_0x53c6a6))return _0x3eca9c(_0x38849b);_0x4140c6[_0x1ae3('0x2e')][_0x1ae3('0x2f')]({'attributes':['id',_0x1ae3('0x30'),_0x1ae3('0x31')],'raw':!![]})[_0x1ae3('0x32')](function(_0x36c05f){for(var _0x2a189e=0x0,_0x38ba49=0x0;_0x2a189e<_0x53c6a6['length'];_0x2a189e++,_0x38ba49=0x0){var _0x2e662f=_0x53c6a6[_0x2a189e];var _0x3badbf=[];var _0x530227=[];if(_0x2e662f['interval']!==_0x1ae3('0x33')){_0x2e662f[_0x1ae3('0x34')]=[_0x2e662f[_0x1ae3('0x30')]];}else{_0x2e662f[_0x1ae3('0x34')]=_0x2e662f[_0x1ae3('0x31')]?_[_0x1ae3('0x35')](_[_0x1ae3('0x36')](_0x36c05f,{'IntervalId':_0x2e662f['IntervalId']}),'interval'):[];}_0x2e662f[_0x1ae3('0x6')]=_0x597bb7['context'];_0x2e662f['exten']=_0x597bb7['exten'];if(_0x2e662f[_0x1ae3('0x7')])_0x2e662f[_0x1ae3('0x7')]=_0x2e662f[_0x1ae3('0x7')][_0x1ae3('0x37')]();if(_0x597bb7[_0x1ae3('0x7')]===_0x1ae3('0x11')){if(_0x2e662f[_0x1ae3('0x38')](_0x1ae3('0x39'))&&_0x2e662f['tag']&&_0x2e662f['tag']!=='--'){_0x3badbf[_0x1ae3('0xd')]({'type':_0x2e662f[_0x1ae3('0x7')][_0x1ae3('0x37')](),'app':_0x1ae3('0x4'),'appdata':'CDR(tag)='+_0x2e662f[_0x1ae3('0x39')],'context':_0x597bb7['context'],'exten':_0x597bb7[_0x1ae3('0xc')],'priority':_0x2e662f['intervals'][_0x1ae3('0x23')]+_0x3f2063+_0x38ba49++,'VoiceExtensionId':_0x597bb7['id']});}_0x3badbf[_0x1ae3('0xd')]({'type':_0x2e662f[_0x1ae3('0x7')][_0x1ae3('0x37')](),'app':_0x1ae3('0x16'),'appdata':_0x1ae3('0x3a')+(_0x2e662f['callerID']?_0x1ae3('0x3b')+_0x2e662f[_0x1ae3('0x3c')]+')':_0x1ae3('0x3d')),'context':_0x597bb7['context'],'exten':_0x597bb7[_0x1ae3('0xc')],'priority':_0x2e662f[_0x1ae3('0x34')][_0x1ae3('0x23')]+_0x3f2063+_0x38ba49++,'VoiceExtensionId':_0x597bb7['id']});}else{if(_0x2e662f[_0x1ae3('0x38')](_0x1ae3('0x3e'))){if([_0x1ae3('0x3f'),_0x1ae3('0x40')][_0x1ae3('0x41')](_0x2e662f[_0x1ae3('0x42')]['toLowerCase']())&&_0x2e662f[_0x1ae3('0x43')]!==_0x1ae3('0x44')){if(_0x2e662f[_0x1ae3('0x3e')]){_0x3badbf[_0x1ae3('0xd')]({'type':_0x2e662f['type'][_0x1ae3('0x37')](),'app':_0x1ae3('0x16'),'appdata':_0x1ae3('0x45'),'context':_0x597bb7[_0x1ae3('0x6')],'exten':_0x597bb7['exten'],'priority':_0x2e662f[_0x1ae3('0x34')]['length']+_0x3f2063+_0x38ba49++,'VoiceExtensionId':_0x597bb7['id']});_0x3badbf[_0x1ae3('0xd')]({'type':_0x2e662f[_0x1ae3('0x7')][_0x1ae3('0x37')](),'app':_0x1ae3('0x4'),'appdata':_0x1ae3('0x46'),'context':_0x597bb7[_0x1ae3('0x6')],'exten':_0x597bb7[_0x1ae3('0xc')],'priority':_0x2e662f['intervals'][_0x1ae3('0x23')]+_0x3f2063+_0x38ba49++,'VoiceExtensionId':_0x597bb7['id']});}else{_0x3badbf[_0x1ae3('0xd')]({'type':_0x2e662f[_0x1ae3('0x7')][_0x1ae3('0x37')](),'app':'ExecIf','appdata':_0x1ae3('0x47'),'context':_0x597bb7['context'],'exten':_0x597bb7[_0x1ae3('0xc')],'priority':_0x2e662f[_0x1ae3('0x34')][_0x1ae3('0x23')]+_0x3f2063+_0x38ba49++,'VoiceExtensionId':_0x597bb7['id']});_0x3badbf['push']({'type':_0x2e662f[_0x1ae3('0x7')][_0x1ae3('0x37')](),'app':_0x1ae3('0x4'),'appdata':_0x1ae3('0x48'),'context':_0x597bb7[_0x1ae3('0x6')],'exten':_0x597bb7['exten'],'priority':_0x2e662f[_0x1ae3('0x34')][_0x1ae3('0x23')]+_0x3f2063+_0x38ba49++,'VoiceExtensionId':_0x597bb7['id']});}}}}for(var _0xcae04=0x0;_0xcae04<_0x2e662f[_0x1ae3('0x34')][_0x1ae3('0x23')];_0xcae04++){var _0x3ed428=_0x3f2063+_0x2e662f[_0x1ae3('0x34')][_0x1ae3('0x23')];var _0x1f46cd=_0xcae04===_0x2e662f[_0x1ae3('0x34')][_0x1ae3('0x23')]-0x1?_0x3f2063+_0x3badbf['length']+_0x530227[_0x1ae3('0x23')]+0x2:_0x3f2063+_0xcae04+0x1;_0x3badbf[_0x1ae3('0x49')](_0xcae04,0x0,{'type':_0x597bb7[_0x1ae3('0x7')],'app':_0x1ae3('0x4a'),'appdata':_0x2e662f[_0x1ae3('0x34')][_0xcae04]+'?'+_0x597bb7[_0x1ae3('0x6')]+',${EXTEN},'+_0x3ed428+':'+_0x597bb7['context']+',${EXTEN},'+_0x1f46cd,'exten':_0x597bb7[_0x1ae3('0xc')],'context':_0x597bb7[_0x1ae3('0x6')],'priority':_0x3f2063+_0xcae04,'VoiceExtensionId':_0x597bb7['id']});}if(_0x54456a&&_0x2e662f['appType']===_0x1ae3('0x4b'))_0x2e662f[_0x1ae3('0x4c')]=_0x42d858(_0x2e662f['appdata']);_0x2e662f[_0x1ae3('0x4d')]=_0x3badbf[_0x1ae3('0x23')]?_[_0x1ae3('0x4e')](_0x3badbf)[_0x1ae3('0x4d')]+0x1:_0x3f2063;_0x38849b=_[_0x1ae3('0x4f')](_0x38849b,_0x3badbf,[_0x2e662f],_0x530227);_0x3f2063=_[_0x1ae3('0x4e')](_0x38849b)[_0x1ae3('0x4d')]+0x1;}return _0x3eca9c(_0x38849b);})[_0x1ae3('0x50')](function(_0x7d5bc2){_0x536797(_0x7d5bc2);});});}return _0x3eed8b[_0x1ae3('0x51')](_0x1ae3('0x52'),attributes,{'tableName':_0x1ae3('0x53'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x574e45,_0x4e5f7d){var _0xfe78cf=this;var _0x2f74e8=_0xfe78cf['type']===_0x1ae3('0x11')?_0x5a963b(_0xfe78cf):_0x458a92(_0xfe78cf);return _0x4a9014(_0xfe78cf,_0x574e45,_[_0x1ae3('0x4e')](_0x2f74e8)[_0x1ae3('0x4d')]+0x1,_0x4e5f7d)[_0x1ae3('0x32')](function(_0x1b60cf){var _0x446c50=_[_0x1ae3('0x4f')](_0x2f74e8,_0x1b60cf);_0x446c50[_0x1ae3('0xd')]({'type':_0xfe78cf[_0x1ae3('0x7')],'app':'Hangup','exten':_0xfe78cf['exten'],'context':_0xfe78cf[_0x1ae3('0x6')],'priority':_[_0x1ae3('0x4e')](_0x446c50)[_0x1ae3('0x4d')]+0x1,'VoiceExtensionId':_0xfe78cf['id']});return _0x446c50;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 736e3b5..924118f 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 _0x1c88=['options','where','attributes','limit','include','map','model','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','VoiceExtension,\x20%s,\x20%s','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetVoiceExtension','raw'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x1c88,0x1a9));var _0x81c8=function(_0xc55c68,_0x292a8b){_0xc55c68=_0xc55c68-0x0;var _0x148523=_0x1c88[_0xc55c68];return _0x148523;};'use strict';var _=require(_0x81c8('0x0'));var util=require('util');var moment=require(_0x81c8('0x1'));var BPromise=require(_0x81c8('0x2'));var rs=require(_0x81c8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x81c8('0x4'));var logger=require(_0x81c8('0x5'))(_0x81c8('0x6'));var config=require(_0x81c8('0x7'));var jayson=require(_0x81c8('0x8'));var client=jayson[_0x81c8('0x9')][_0x81c8('0xa')]({'port':0x232a});config[_0x81c8('0xb')]=_[_0x81c8('0xc')](config[_0x81c8('0xb')],{'host':_0x81c8('0xd'),'port':0x18eb});var socket=require(_0x81c8('0xe'))(new Redis(config[_0x81c8('0xb')]));require('./voiceExtension.socket')[_0x81c8('0xf')](socket);function respondWithRpcPromise(_0x3b326c,_0xed3907,_0x5c7dde){return new BPromise(function(_0x4cc5b3,_0x2495a6){return client[_0x81c8('0x10')](_0x3b326c,_0x5c7dde)[_0x81c8('0x11')](function(_0x47b6f6){logger[_0x81c8('0x12')](_0x81c8('0x13'),_0xed3907,'request\x20sent');logger[_0x81c8('0x14')](_0x81c8('0x15'),_0xed3907,_0x81c8('0x16'),JSON[_0x81c8('0x17')](_0x47b6f6));if(_0x47b6f6['error']){if(_0x47b6f6[_0x81c8('0x18')][_0x81c8('0x19')]===0x1f4){logger[_0x81c8('0x18')]('VoiceExtension,\x20%s,\x20%s',_0xed3907,_0x47b6f6[_0x81c8('0x18')][_0x81c8('0x1a')]);return _0x2495a6(_0x47b6f6[_0x81c8('0x18')]['message']);}logger[_0x81c8('0x18')](_0x81c8('0x13'),_0xed3907,_0x47b6f6[_0x81c8('0x18')][_0x81c8('0x1a')]);return _0x4cc5b3(_0x47b6f6[_0x81c8('0x18')]['message']);}else{logger[_0x81c8('0x12')](_0x81c8('0x13'),_0xed3907,'request\x20sent');_0x4cc5b3(_0x47b6f6[_0x81c8('0x1b')][_0x81c8('0x1a')]);}})[_0x81c8('0x1c')](function(_0x2f8d75){logger[_0x81c8('0x18')](_0x81c8('0x13'),_0xed3907,_0x2f8d75);_0x2495a6(_0x2f8d75);});});}exports[_0x81c8('0x1d')]=function(_0x325e90){var _0x336ebf=this;return new Promise(function(_0x47a6bb,_0x2af7b6){return db['VoiceExtension']['findAll']({'raw':_0x325e90['options']?_0x325e90['options'][_0x81c8('0x1e')]===undefined?!![]:![]:!![],'where':_0x325e90['options']?_0x325e90[_0x81c8('0x1f')][_0x81c8('0x20')]||null:null,'attributes':_0x325e90[_0x81c8('0x1f')]?_0x325e90[_0x81c8('0x1f')][_0x81c8('0x21')]||null:null,'limit':_0x325e90[_0x81c8('0x1f')]?_0x325e90[_0x81c8('0x1f')][_0x81c8('0x22')]||null:null,'include':_0x325e90[_0x81c8('0x1f')]?_0x325e90[_0x81c8('0x1f')][_0x81c8('0x23')]?_[_0x81c8('0x24')](_0x325e90[_0x81c8('0x1f')]['include'],function(_0xb71afc){return{'model':db[_0xb71afc[_0x81c8('0x25')]],'as':_0xb71afc['as'],'attributes':_0xb71afc[_0x81c8('0x21')],'include':_0xb71afc[_0x81c8('0x23')]?_['map'](_0xb71afc[_0x81c8('0x23')],function(_0x4c10e5){return{'model':db[_0x4c10e5[_0x81c8('0x25')]],'as':_0x4c10e5['as'],'attributes':_0x4c10e5[_0x81c8('0x21')],'include':_0x4c10e5[_0x81c8('0x23')]?_[_0x81c8('0x24')](_0x4c10e5[_0x81c8('0x23')],function(_0x3ac0e4){return{'model':db[_0x3ac0e4[_0x81c8('0x25')]],'as':_0x3ac0e4['as'],'attributes':_0x3ac0e4[_0x81c8('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x363724){logger['info'](_0x81c8('0x1d'),_0x325e90);logger[_0x81c8('0x14')](_0x81c8('0x1d'),_0x325e90,JSON[_0x81c8('0x17')](_0x363724));_0x47a6bb(_0x363724);})[_0x81c8('0x1c')](function(_0x1d580f){logger[_0x81c8('0x18')]('GetVoiceExtension',_0x1d580f[_0x81c8('0x1a')],_0x325e90);_0x2af7b6(_0x336ebf['error'](0x1f4,_0x1d580f[_0x81c8('0x1a')]));});});}; \ No newline at end of file +var _0xceae=['debug','stringify','lodash','util','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetVoiceExtension','VoiceExtension','findAll','raw','options','where','limit','map','include','model','attributes'];(function(_0xfd0380,_0x20399b){var _0x54f7fd=function(_0x1edc8d){while(--_0x1edc8d){_0xfd0380['push'](_0xfd0380['shift']());}};_0x54f7fd(++_0x20399b);}(_0xceae,0x122));var _0xecea=function(_0x59ddd3,_0x21440c){_0x59ddd3=_0x59ddd3-0x0;var _0x49fb32=_0xceae[_0x59ddd3];return _0x49fb32;};'use strict';var _=require(_0xecea('0x0'));var util=require(_0xecea('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xecea('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xecea('0x3'))(_0xecea('0x4'));var config=require(_0xecea('0x5'));var jayson=require(_0xecea('0x6'));var client=jayson[_0xecea('0x7')][_0xecea('0x8')]({'port':0x232a});config[_0xecea('0x9')]=_[_0xecea('0xa')](config[_0xecea('0x9')],{'host':_0xecea('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xecea('0x9')]));require('./voiceExtension.socket')[_0xecea('0xc')](socket);function respondWithRpcPromise(_0x2142af,_0x38d7af,_0x1f33d9){return new BPromise(function(_0xd2fce0,_0x309fd3){return client[_0xecea('0xd')](_0x2142af,_0x1f33d9)[_0xecea('0xe')](function(_0xa900f5){logger[_0xecea('0xf')](_0xecea('0x10'),_0x38d7af,'request\x20sent');logger['debug']('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x38d7af,_0xecea('0x11'),JSON['stringify'](_0xa900f5));if(_0xa900f5[_0xecea('0x12')]){if(_0xa900f5[_0xecea('0x12')][_0xecea('0x13')]===0x1f4){logger[_0xecea('0x12')](_0xecea('0x10'),_0x38d7af,_0xa900f5[_0xecea('0x12')]['message']);return _0x309fd3(_0xa900f5[_0xecea('0x12')][_0xecea('0x14')]);}logger[_0xecea('0x12')]('VoiceExtension,\x20%s,\x20%s',_0x38d7af,_0xa900f5[_0xecea('0x12')]['message']);return _0xd2fce0(_0xa900f5[_0xecea('0x12')]['message']);}else{logger[_0xecea('0xf')](_0xecea('0x10'),_0x38d7af,_0xecea('0x11'));_0xd2fce0(_0xa900f5[_0xecea('0x15')][_0xecea('0x14')]);}})[_0xecea('0x16')](function(_0x105e56){logger[_0xecea('0x12')]('VoiceExtension,\x20%s,\x20%s',_0x38d7af,_0x105e56);_0x309fd3(_0x105e56);});});}exports[_0xecea('0x17')]=function(_0xdc86e3){var _0x5ac4ee=this;return new Promise(function(_0x225720,_0x509eaa){return db[_0xecea('0x18')][_0xecea('0x19')]({'raw':_0xdc86e3['options']?_0xdc86e3['options'][_0xecea('0x1a')]===undefined?!![]:![]:!![],'where':_0xdc86e3[_0xecea('0x1b')]?_0xdc86e3['options'][_0xecea('0x1c')]||null:null,'attributes':_0xdc86e3[_0xecea('0x1b')]?_0xdc86e3[_0xecea('0x1b')]['attributes']||null:null,'limit':_0xdc86e3['options']?_0xdc86e3[_0xecea('0x1b')][_0xecea('0x1d')]||null:null,'include':_0xdc86e3[_0xecea('0x1b')]?_0xdc86e3[_0xecea('0x1b')]['include']?_[_0xecea('0x1e')](_0xdc86e3[_0xecea('0x1b')][_0xecea('0x1f')],function(_0x2c089d){return{'model':db[_0x2c089d[_0xecea('0x20')]],'as':_0x2c089d['as'],'attributes':_0x2c089d[_0xecea('0x21')],'include':_0x2c089d[_0xecea('0x1f')]?_[_0xecea('0x1e')](_0x2c089d[_0xecea('0x1f')],function(_0x26c762){return{'model':db[_0x26c762['model']],'as':_0x26c762['as'],'attributes':_0x26c762[_0xecea('0x21')],'include':_0x26c762[_0xecea('0x1f')]?_[_0xecea('0x1e')](_0x26c762['include'],function(_0x14827d){return{'model':db[_0x14827d[_0xecea('0x20')]],'as':_0x14827d['as'],'attributes':_0x14827d['attributes']};}):[]};}):[]};}):[]:[]})[_0xecea('0xe')](function(_0x566d70){logger[_0xecea('0xf')](_0xecea('0x17'),_0xdc86e3);logger[_0xecea('0x22')](_0xecea('0x17'),_0xdc86e3,JSON[_0xecea('0x23')](_0x566d70));_0x225720(_0x566d70);})['catch'](function(_0x161f5a){logger['error'](_0xecea('0x17'),_0x161f5a[_0xecea('0x14')],_0xdc86e3);_0x509eaa(_0x5ac4ee[_0xecea('0x12')](0x1f4,_0x161f5a['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index e2831ce..75c0996 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 _0x53ec=['length','voiceExtension:','./voiceExtension.events','save','remove','update','emit','removeListener'];(function(_0x413c1d,_0x1b4af8){var _0x41fe6c=function(_0x508d28){while(--_0x508d28){_0x413c1d['push'](_0x413c1d['shift']());}};_0x41fe6c(++_0x1b4af8);}(_0x53ec,0x192));var _0xc53e=function(_0x51f812,_0x36212c){_0x51f812=_0x51f812-0x0;var _0x1ad290=_0x53ec[_0x51f812];return _0x1ad290;};'use strict';var VoiceExtensionEvents=require(_0xc53e('0x0'));var events=[_0xc53e('0x1'),_0xc53e('0x2'),_0xc53e('0x3')];function createListener(_0x1b04cc,_0xe45c6d){return function(_0x51c435){_0xe45c6d[_0xc53e('0x4')](_0x1b04cc,_0x51c435);};}function removeListener(_0x4e954a,_0x2b90f6){return function(){VoiceExtensionEvents[_0xc53e('0x5')](_0x4e954a,_0x2b90f6);};}exports['register']=function(_0x2f1414){for(var _0x4f989b=0x0,_0x41a9e8=events[_0xc53e('0x6')];_0x4f989b<_0x41a9e8;_0x4f989b++){var _0x5d3b28=events[_0x4f989b];var _0x1616ac=createListener(_0xc53e('0x7')+_0x5d3b28,_0x2f1414);VoiceExtensionEvents['on'](_0x5d3b28,_0x1616ac);}}; \ No newline at end of file +var _0x1261=['save','remove','update','emit','removeListener','voiceExtension:'];(function(_0x489c5a,_0x1c8abb){var _0x4327ca=function(_0x505284){while(--_0x505284){_0x489c5a['push'](_0x489c5a['shift']());}};_0x4327ca(++_0x1c8abb);}(_0x1261,0x144));var _0x1126=function(_0x4ddfc9,_0x23f05f){_0x4ddfc9=_0x4ddfc9-0x0;var _0x47da83=_0x1261[_0x4ddfc9];return _0x47da83;};'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 diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 11845f0..b0b73fc 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 _0x8ace=['isAuthenticated','index','/:id','/:id/messages','getMessages','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get'];(function(_0x1558ab,_0x39d1de){var _0x53b64a=function(_0x4771ed){while(--_0x4771ed){_0x1558ab['push'](_0x1558ab['shift']());}};_0x53b64a(++_0x39d1de);}(_0x8ace,0x1bc));var _0xe8ac=function(_0x332985,_0x216420){_0x332985=_0x332985-0x0;var _0x1a77c1=_0x8ace[_0x332985];return _0x1a77c1;};'use strict';var multer=require(_0xe8ac('0x0'));var util=require(_0xe8ac('0x1'));var path=require(_0xe8ac('0x2'));var timeout=require(_0xe8ac('0x3'));var express=require(_0xe8ac('0x4'));var router=express[_0xe8ac('0x5')]();var fs_extra=require(_0xe8ac('0x6'));var auth=require(_0xe8ac('0x7'));var interaction=require(_0xe8ac('0x8'));var config=require(_0xe8ac('0x9'));var controller=require(_0xe8ac('0xa'));router[_0xe8ac('0xb')]('/',auth[_0xe8ac('0xc')](),controller[_0xe8ac('0xd')]);router['get'](_0xe8ac('0xe'),auth[_0xe8ac('0xc')](),controller['show']);router['get'](_0xe8ac('0xf'),auth['isAuthenticated'](),controller[_0xe8ac('0x10')]);router[_0xe8ac('0x11')]('/',auth[_0xe8ac('0xc')](),controller[_0xe8ac('0x12')]);router[_0xe8ac('0x13')](_0xe8ac('0xe'),auth['isAuthenticated'](),controller[_0xe8ac('0x14')]);router[_0xe8ac('0x15')](_0xe8ac('0xe'),auth['isAuthenticated'](),controller[_0xe8ac('0x16')]);module[_0xe8ac('0x17')]=router; \ No newline at end of file +var _0xdb28=['destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/messages','getMessages','create','put','update'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0xdb28,0x106));var _0x8db2=function(_0x310981,_0x4946f4){_0x310981=_0x310981-0x0;var _0x8ccd62=_0xdb28[_0x310981];return _0x8ccd62;};'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('./voiceMail.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']('/',auth[_0x8db2('0xa')](),controller[_0x8db2('0xf')]);router[_0x8db2('0x10')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x11')]);router['delete'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x12')]);module[_0x8db2('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index e179737..e536a7d 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 _0x81df=['ENUM','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','\x20-\x20','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','central','yes'];(function(_0x2529d2,_0x1e767e){var _0x420bdc=function(_0x219658){while(--_0x219658){_0x2529d2['push'](_0x2529d2['shift']());}};_0x420bdc(++_0x1e767e);}(_0x81df,0x15e));var _0xf81d=function(_0x2d65f1,_0x230b1d){_0x2d65f1=_0x2d65f1-0x0;var _0x30d646=_0x81df[_0x2d65f1];return _0x30d646;};'use strict';var Sequelize=require(_0xf81d('0x0'));module[_0xf81d('0x1')]={'customer_id':{'type':Sequelize[_0xf81d('0x2')]},'context':{'type':Sequelize[_0xf81d('0x2')],'defaultValue':_0xf81d('0x3'),'unique':_0xf81d('0x4')},'mailbox':{'type':Sequelize[_0xf81d('0x2')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0xf81d('0x2')]},'email':{'type':Sequelize[_0xf81d('0x2')],'validate':{'isEmail':!![]},'set':function(_0x5fae92){this[_0xf81d('0x5')](_0xf81d('0x6'),typeof _0x5fae92===_0xf81d('0x7')&&_0x5fae92[_0xf81d('0x8')]()?_0x5fae92[_0xf81d('0x8')]():null);}},'pager':{'type':Sequelize[_0xf81d('0x2')]},'tz':{'type':Sequelize[_0xf81d('0x2')],'defaultValue':_0xf81d('0x9')},'attach':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0xf81d('0xa'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0xf81d('0xa'),'no'),'defaultValue':_0xf81d('0xa'),'allowNull':![]},'dialout':{'type':Sequelize[_0xf81d('0x2')]},'callback':{'type':Sequelize[_0xf81d('0x2')]},'review':{'type':Sequelize['ENUM'](_0xf81d('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xf81d('0xb')](_0xf81d('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xf81d('0xb')](_0xf81d('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xf81d('0xb')](_0xf81d('0xa'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xf81d('0xc'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xf81d('0xb')](_0xf81d('0xa'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0xf81d('0xa'),'no'),'defaultValue':_0xf81d('0xa'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0xf81d('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0xf81d('0xa'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xf81d('0xb')](_0xf81d('0xa'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0xf81d('0xd')},'emailsubject':{'type':Sequelize[_0xf81d('0x2')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize[_0xf81d('0xe')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xf81d('0xe')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xf81d('0xf')],'get':function(){return this[_0xf81d('0x10')]('fullname')+_0xf81d('0x11')+this[_0xf81d('0x10')](_0xf81d('0x12'));}}}; \ No newline at end of file +var _0x5db6=['ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','email','string','trim','central'];(function(_0x36126f,_0x6cb073){var _0x3ed1ac=function(_0x5bd54c){while(--_0x5bd54c){_0x36126f['push'](_0x36126f['shift']());}};_0x3ed1ac(++_0x6cb073);}(_0x5db6,0x69));var _0x65db=function(_0xec9262,_0x3e62bd){_0xec9262=_0xec9262-0x0;var _0x19aeff=_0x5db6[_0xec9262];return _0x19aeff;};'use strict';var Sequelize=require(_0x65db('0x0'));module[_0x65db('0x1')]={'customer_id':{'type':Sequelize[_0x65db('0x2')]},'context':{'type':Sequelize[_0x65db('0x2')],'defaultValue':_0x65db('0x3'),'unique':_0x65db('0x4')},'mailbox':{'type':Sequelize[_0x65db('0x2')],'defaultValue':'','allowNull':![],'unique':_0x65db('0x4')},'password':{'type':Sequelize[_0x65db('0x2')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x65db('0x2')],'validate':{'isEmail':!![]},'set':function(_0x43bc2d){this['setDataValue'](_0x65db('0x5'),typeof _0x43bc2d===_0x65db('0x6')&&_0x43bc2d[_0x65db('0x7')]()?_0x43bc2d[_0x65db('0x7')]():null);}},'pager':{'type':Sequelize[_0x65db('0x2')]},'tz':{'type':Sequelize[_0x65db('0x2')],'defaultValue':_0x65db('0x8')},'attach':{'type':Sequelize[_0x65db('0x9')]('yes','no'),'defaultValue':_0x65db('0xa'),'allowNull':![]},'saycid':{'type':Sequelize[_0x65db('0x9')]('yes','no'),'defaultValue':_0x65db('0xa'),'allowNull':![]},'dialout':{'type':Sequelize[_0x65db('0x2')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0x65db('0x9')](_0x65db('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x65db('0x9')](_0x65db('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x65db('0x9')](_0x65db('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x65db('0x9')](_0x65db('0xa'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x65db('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x65db('0x9')](_0x65db('0xa'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x65db('0x9')](_0x65db('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x65db('0x9')](_0x65db('0xa'),'no'),'defaultValue':_0x65db('0xa'),'allowNull':![]},'forcename':{'type':Sequelize[_0x65db('0x9')](_0x65db('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x65db('0x9')](_0x65db('0xa'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x65db('0x9')](_0x65db('0xa'),'no'),'defaultValue':_0x65db('0xa'),'allowNull':![]},'stamp':{'type':_0x65db('0xc')},'emailsubject':{'type':Sequelize[_0x65db('0x2')]},'emailbody':{'type':Sequelize[_0x65db('0x2')]},'maxsecs':{'type':Sequelize[_0x65db('0xd')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x65db('0xd')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x65db('0xe')],'get':function(){return this[_0x65db('0xf')](_0x65db('0x10'))+_0x65db('0x11')+this[_0x65db('0xf')](_0x65db('0x12'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index db012d0..1d4a7bb 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 _0x16d2=['sort','pick','filter','where','merge','options','findAll','rows','show','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','Voicemails','UserProfileSection','userProfileId','UserProfileResource','catch','update','destroy','params','getMessages','findOne','VoiceMailMessage','nolimit','findAndCountAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','get','error','stack','name','send','index','map','VoiceMail','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order'];(function(_0x3ab3d3,_0x41028e){var _0x1259d8=function(_0x30f404){while(--_0x30f404){_0x3ab3d3['push'](_0x3ab3d3['shift']());}};_0x1259d8(++_0x41028e);}(_0x16d2,0x123));var _0x216d=function(_0x378068,_0x49640b){_0x378068=_0x378068-0x0;var _0x373cf0=_0x16d2[_0x378068];return _0x373cf0;};'use strict';var emlformat=require(_0x216d('0x0'));var rimraf=require(_0x216d('0x1'));var zipdir=require(_0x216d('0x2'));var jsonpatch=require(_0x216d('0x3'));var rp=require(_0x216d('0x4'));var moment=require(_0x216d('0x5'));var BPromise=require(_0x216d('0x6'));var Mustache=require(_0x216d('0x7'));var util=require(_0x216d('0x8'));var path=require('path');var sox=require(_0x216d('0x9'));var csv=require(_0x216d('0xa'));var ejs=require(_0x216d('0xb'));var fs=require('fs');var fs_extra=require(_0x216d('0xc'));var _=require(_0x216d('0xd'));var squel=require(_0x216d('0xe'));var crypto=require(_0x216d('0xf'));var jsforce=require(_0x216d('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x216d('0xa'));var querystring=require(_0x216d('0x11'));var Papa=require(_0x216d('0x12'));var Redis=require(_0x216d('0x13'));var authService=require(_0x216d('0x14'));var qs=require(_0x216d('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x216d('0x16'));var logger=require('../../config/logger')(_0x216d('0x17'));var utils=require(_0x216d('0x18'));var config=require(_0x216d('0x19'));var licenseUtil=require(_0x216d('0x1a'));var db=require(_0x216d('0x1b'))['db'];function respondWithStatusCode(_0x23ecf9,_0x4c92d9){_0x4c92d9=_0x4c92d9||0xcc;return function(_0xb36a43){if(_0xb36a43){return _0x23ecf9['sendStatus'](_0x4c92d9);}return _0x23ecf9[_0x216d('0x1c')](_0x4c92d9)[_0x216d('0x1d')]();};}function respondWithResult(_0x4dc2a2,_0x165c19){_0x165c19=_0x165c19||0xc8;return function(_0x322e4b){if(_0x322e4b){return _0x4dc2a2['status'](_0x165c19)[_0x216d('0x1e')](_0x322e4b);}};}function respondWithFilteredResult(_0x494e92,_0x448c0d){return function(_0xf571a4){if(_0xf571a4){var _0x4631b0=typeof _0x448c0d[_0x216d('0x1f')]===_0x216d('0x20')&&typeof _0x448c0d[_0x216d('0x21')]===_0x216d('0x20');var _0x1496fe=_0xf571a4[_0x216d('0x22')];var _0x53d464=_0x4631b0?0x0:_0x448c0d[_0x216d('0x1f')];var _0x5124ab=_0x4631b0?_0xf571a4['count']:_0x448c0d[_0x216d('0x1f')]+_0x448c0d[_0x216d('0x21')];var _0x574758;if(_0x5124ab>=_0x1496fe){_0x5124ab=_0x1496fe;_0x574758=0xc8;}else{_0x574758=0xce;}_0x494e92[_0x216d('0x1c')](_0x574758);return _0x494e92[_0x216d('0x23')]('Content-Range',_0x53d464+'-'+_0x5124ab+'/'+_0x1496fe)[_0x216d('0x1e')](_0xf571a4);}return null;};}function patchUpdates(_0x13b8e0){return function(_0x430e81){try{jsonpatch[_0x216d('0x24')](_0x430e81,_0x13b8e0,!![]);}catch(_0x5c3e03){return BPromise[_0x216d('0x25')](_0x5c3e03);}return _0x430e81[_0x216d('0x26')]();};}function saveUpdates(_0x10f299,_0x438981){return function(_0x206782){if(_0x206782){return _0x206782['update'](_0x10f299)[_0x216d('0x27')](function(_0x1bd4db){return _0x1bd4db;});}return null;};}function removeEntity(_0x188494,_0x2880c6){return function(_0x6fa4b3){if(_0x6fa4b3){return _0x6fa4b3['destroy']()[_0x216d('0x27')](function(){var _0xab672=_0x6fa4b3[_0x216d('0x28')]({'plain':!![]});var _0x5998a1='Voicemails';return db['UserProfileResource']['destroy']({'where':{'type':_0x5998a1,'resourceId':_0xab672['id']}})['then'](function(){return _0x6fa4b3;});})[_0x216d('0x27')](function(){_0x188494[_0x216d('0x1c')](0xcc)[_0x216d('0x1d')]();});}};}function handleEntityNotFound(_0x73b509,_0x46d0ef){return function(_0x47fa6d){if(!_0x47fa6d){_0x73b509['sendStatus'](0x194);}return _0x47fa6d;};}function handleError(_0xa7624a,_0x51b2bd){_0x51b2bd=_0x51b2bd||0x1f4;return function(_0x23d1c3){logger[_0x216d('0x29')](_0x23d1c3[_0x216d('0x2a')]);if(_0x23d1c3[_0x216d('0x2b')]){delete _0x23d1c3[_0x216d('0x2b')];}_0xa7624a[_0x216d('0x1c')](_0x51b2bd)[_0x216d('0x2c')](_0x23d1c3);};}exports[_0x216d('0x2d')]=function(_0x169cfa,_0x28f56a){var _0x11be90={},_0x260134={},_0x4537fd={'count':0x0,'rows':[]};var _0x483324=_[_0x216d('0x2e')](db[_0x216d('0x2f')][_0x216d('0x30')],function(_0x510ad9){return{'name':_0x510ad9[_0x216d('0x31')],'type':_0x510ad9[_0x216d('0x32')][_0x216d('0x33')]};});_0x260134[_0x216d('0x34')]=_['map'](_0x483324,_0x216d('0x2b'));_0x260134[_0x216d('0x35')]=_[_0x216d('0x36')](_0x169cfa[_0x216d('0x35')]);_0x260134[_0x216d('0x37')]=_[_0x216d('0x38')](_0x260134[_0x216d('0x34')],_0x260134[_0x216d('0x35')]);_0x11be90[_0x216d('0x39')]=_[_0x216d('0x38')](_0x260134[_0x216d('0x34')],qs['fields'](_0x169cfa[_0x216d('0x35')][_0x216d('0x3a')]));_0x11be90[_0x216d('0x39')]=_0x11be90['attributes'][_0x216d('0x3b')]?_0x11be90[_0x216d('0x39')]:_0x260134['model'];if(!_0x169cfa[_0x216d('0x35')]['hasOwnProperty']('nolimit')){_0x11be90[_0x216d('0x21')]=qs[_0x216d('0x21')](_0x169cfa[_0x216d('0x35')][_0x216d('0x21')]);_0x11be90['offset']=qs['offset'](_0x169cfa['query'][_0x216d('0x1f')]);}_0x11be90[_0x216d('0x3c')]=qs['sort'](_0x169cfa[_0x216d('0x35')][_0x216d('0x3d')]);_0x11be90['where']=qs[_0x216d('0x37')](_[_0x216d('0x3e')](_0x169cfa[_0x216d('0x35')],_0x260134[_0x216d('0x37')]),_0x483324);if(_0x169cfa[_0x216d('0x35')][_0x216d('0x3f')]){_0x11be90[_0x216d('0x40')]=_[_0x216d('0x41')](_0x11be90['where'],{'$or':_['map'](_0x483324,function(_0x281a88){if(_0x281a88[_0x216d('0x32')]!=='VIRTUAL'){var _0xf33f9c={};_0xf33f9c[_0x281a88[_0x216d('0x2b')]]={'$like':'%'+_0x169cfa[_0x216d('0x35')]['filter']+'%'};return _0xf33f9c;}})});}_0x11be90=_[_0x216d('0x41')]({},_0x11be90,_0x169cfa[_0x216d('0x42')]);var _0x13d787={'where':_0x11be90[_0x216d('0x40')]};return db['VoiceMail'][_0x216d('0x22')](_0x13d787)[_0x216d('0x27')](function(_0x5665d7){_0x4537fd[_0x216d('0x22')]=_0x5665d7;if(_0x169cfa[_0x216d('0x35')]['includeAll']){_0x11be90['include']=[{'all':!![]}];}return db[_0x216d('0x2f')][_0x216d('0x43')](_0x11be90);})[_0x216d('0x27')](function(_0x498efe){_0x4537fd[_0x216d('0x44')]=_0x498efe;return _0x4537fd;})['then'](respondWithFilteredResult(_0x28f56a,_0x11be90))['catch'](handleError(_0x28f56a,null));};exports[_0x216d('0x45')]=function(_0x43336e,_0xac81f){var _0x5ddaeb={'raw':!![],'where':{'id':_0x43336e['params']['id']}},_0xaccf45={};_0xaccf45[_0x216d('0x34')]=_[_0x216d('0x36')](db[_0x216d('0x2f')]['rawAttributes']);_0xaccf45[_0x216d('0x35')]=_[_0x216d('0x36')](_0x43336e[_0x216d('0x35')]);_0xaccf45[_0x216d('0x37')]=_['intersection'](_0xaccf45['model'],_0xaccf45['query']);_0x5ddaeb[_0x216d('0x39')]=_[_0x216d('0x38')](_0xaccf45[_0x216d('0x34')],qs[_0x216d('0x3a')](_0x43336e[_0x216d('0x35')][_0x216d('0x3a')]));_0x5ddaeb[_0x216d('0x39')]=_0x5ddaeb[_0x216d('0x39')]['length']?_0x5ddaeb[_0x216d('0x39')]:_0xaccf45[_0x216d('0x34')];if(_0x43336e[_0x216d('0x35')][_0x216d('0x46')]){_0x5ddaeb['include']=[{'all':!![]}];}_0x5ddaeb=_[_0x216d('0x41')]({},_0x5ddaeb,_0x43336e['options']);return db[_0x216d('0x2f')][_0x216d('0x47')](_0x5ddaeb)[_0x216d('0x27')](handleEntityNotFound(_0xac81f,null))['then'](respondWithResult(_0xac81f,null))['catch'](handleError(_0xac81f,null));};exports[_0x216d('0x48')]=function(_0x32d499,_0x3932a3){return db[_0x216d('0x2f')][_0x216d('0x48')](_0x32d499[_0x216d('0x49')],{})['then'](function(_0x4f9274){var _0x26209c=_0x32d499['user'][_0x216d('0x28')]({'plain':!![]});if(!_0x26209c)throw new Error(_0x216d('0x4a'));if(_0x26209c['role']==='user'){var _0x5f37e3=_0x4f9274['get']({'plain':!![]});var _0x1ae9b7=_0x216d('0x4b');return db[_0x216d('0x4c')][_0x216d('0x47')]({'where':{'name':_0x1ae9b7,'userProfileId':_0x26209c[_0x216d('0x4d')]},'raw':!![]})[_0x216d('0x27')](function(_0x29efa8){if(_0x29efa8&&_0x29efa8['autoAssociation']===0x0){return db[_0x216d('0x4e')][_0x216d('0x48')]({'name':_0x5f37e3[_0x216d('0x2b')],'resourceId':_0x5f37e3['id'],'type':_0x29efa8['name'],'sectionId':_0x29efa8['id']},{})[_0x216d('0x27')](function(){return _0x4f9274;});}else{return _0x4f9274;}})[_0x216d('0x4f')](function(_0x2c7c67){logger[_0x216d('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2c7c67);throw _0x2c7c67;});}return _0x4f9274;})[_0x216d('0x27')](respondWithResult(_0x3932a3,0xc9))[_0x216d('0x4f')](handleError(_0x3932a3,null));};exports[_0x216d('0x50')]=function(_0x1a4761,_0x4d7705){if(_0x1a4761[_0x216d('0x49')]['id']){delete _0x1a4761[_0x216d('0x49')]['id'];}return db['VoiceMail'][_0x216d('0x47')]({'where':{'id':_0x1a4761['params']['id']}})[_0x216d('0x27')](handleEntityNotFound(_0x4d7705,null))[_0x216d('0x27')](saveUpdates(_0x1a4761[_0x216d('0x49')],null))[_0x216d('0x27')](respondWithResult(_0x4d7705,null))[_0x216d('0x4f')](handleError(_0x4d7705,null));};exports[_0x216d('0x51')]=function(_0x24297f,_0x2c6cb6){return db[_0x216d('0x2f')]['find']({'where':{'id':_0x24297f[_0x216d('0x52')]['id']}})[_0x216d('0x27')](handleEntityNotFound(_0x2c6cb6,null))['then'](removeEntity(_0x2c6cb6,null))[_0x216d('0x4f')](handleError(_0x2c6cb6,null));};exports[_0x216d('0x53')]=function(_0x59fa28,_0x4edf77,_0x3a0ee7){return db['VoiceMail'][_0x216d('0x54')]({'where':{'id':_0x59fa28[_0x216d('0x52')]['id']}})[_0x216d('0x27')](handleEntityNotFound(_0x4edf77,null))['then'](function(_0x3acd4b){var _0x5112ea;var _0x5d96b3={},_0x462225={};_0x462225[_0x216d('0x34')]=_['keys'](db[_0x216d('0x55')][_0x216d('0x30')]);_0x462225[_0x216d('0x35')]=_[_0x216d('0x36')](_0x59fa28[_0x216d('0x35')]);_0x462225[_0x216d('0x37')]=_['intersection'](_0x462225['model'],_0x462225[_0x216d('0x35')]);_0x5d96b3[_0x216d('0x39')]=_[_0x216d('0x38')](_0x462225[_0x216d('0x34')],qs[_0x216d('0x3a')](_0x59fa28[_0x216d('0x35')][_0x216d('0x3a')]));_0x5d96b3[_0x216d('0x39')]=_0x5d96b3[_0x216d('0x39')][_0x216d('0x3b')]?_0x5d96b3[_0x216d('0x39')]:_0x462225[_0x216d('0x34')];if(!_0x59fa28['query']['hasOwnProperty'](_0x216d('0x56'))){_0x5d96b3[_0x216d('0x21')]=qs['limit'](_0x59fa28[_0x216d('0x35')]['limit']);_0x5d96b3['offset']=qs[_0x216d('0x1f')](_0x59fa28[_0x216d('0x35')][_0x216d('0x1f')]);}_0x5d96b3[_0x216d('0x3c')]=qs[_0x216d('0x3d')](_0x59fa28[_0x216d('0x35')][_0x216d('0x3d')]);_0x5d96b3[_0x216d('0x40')]=qs[_0x216d('0x37')](_[_0x216d('0x3e')](_0x59fa28[_0x216d('0x35')],_0x462225[_0x216d('0x37')]));if(_0x59fa28[_0x216d('0x35')][_0x216d('0x3f')]){_0x5d96b3[_0x216d('0x40')]=_[_0x216d('0x41')](_0x5d96b3[_0x216d('0x40')],{'$or':_[_0x216d('0x2e')](_0x5d96b3[_0x216d('0x39')],function(_0x34540e){var _0xb9302={};_0xb9302[_0x34540e]={'$like':'%'+_0x59fa28[_0x216d('0x35')]['filter']+'%'};return _0xb9302;})});}_0x5d96b3[_0x216d('0x40')]=_['merge'](_0x5d96b3[_0x216d('0x40')],{'mailboxuser':_0x3acd4b['mailbox']});_0x5d96b3=_[_0x216d('0x41')]({},_0x5d96b3,_0x59fa28[_0x216d('0x42')]);return db['VoiceMailMessage'][_0x216d('0x57')](_0x5d96b3)[_0x216d('0x27')](respondWithFilteredResult(_0x4edf77,_0x5d96b3));})[_0x216d('0x4f')](handleError(_0x4edf77,null));}; \ No newline at end of file +var _0xee5b=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','then','destroy','UserProfileResource','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','order','where','pick','merge','VIRTUAL','filter','options','VoiceMail','includeAll','include','rows','catch','show','params','length','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Voicemails','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','getMessages','VoiceMailMessage','nolimit','sort','findAndCountAll','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xee5b,0x1f4));var _0xbee5=function(_0x596225,_0x172f70){_0x596225=_0x596225-0x0;var _0x2f7d0f=_0xee5b[_0x596225];return _0x2f7d0f;};'use strict';var emlformat=require(_0xbee5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbee5('0x1'));var jsonpatch=require(_0xbee5('0x2'));var rp=require('request-promise');var moment=require(_0xbee5('0x3'));var BPromise=require(_0xbee5('0x4'));var Mustache=require(_0xbee5('0x5'));var util=require(_0xbee5('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xbee5('0x7'));var ejs=require(_0xbee5('0x8'));var fs=require('fs');var fs_extra=require(_0xbee5('0x9'));var _=require(_0xbee5('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbee5('0xb'));var Papa=require(_0xbee5('0xc'));var Redis=require(_0xbee5('0xd'));var authService=require(_0xbee5('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xbee5('0xf'));var hardwareService=require(_0xbee5('0x10'));var logger=require(_0xbee5('0x11'))(_0xbee5('0x12'));var utils=require(_0xbee5('0x13'));var config=require(_0xbee5('0x14'));var licenseUtil=require(_0xbee5('0x15'));var db=require(_0xbee5('0x16'))['db'];function respondWithStatusCode(_0xcef158,_0x48f771){_0x48f771=_0x48f771||0xcc;return function(_0x14e032){if(_0x14e032){return _0xcef158['sendStatus'](_0x48f771);}return _0xcef158[_0xbee5('0x17')](_0x48f771)[_0xbee5('0x18')]();};}function respondWithResult(_0x8a268f,_0x593ecb){_0x593ecb=_0x593ecb||0xc8;return function(_0x5092f2){if(_0x5092f2){return _0x8a268f[_0xbee5('0x17')](_0x593ecb)['json'](_0x5092f2);}};}function respondWithFilteredResult(_0x40afcb,_0x5426c9){return function(_0x1a24bd){if(_0x1a24bd){var _0x141878=typeof _0x5426c9[_0xbee5('0x19')]==='undefined'&&typeof _0x5426c9[_0xbee5('0x1a')]===_0xbee5('0x1b');var _0x5a0ae5=_0x1a24bd[_0xbee5('0x1c')];var _0x538460=_0x141878?0x0:_0x5426c9[_0xbee5('0x19')];var _0x3c3f4e=_0x141878?_0x1a24bd[_0xbee5('0x1c')]:_0x5426c9[_0xbee5('0x19')]+_0x5426c9[_0xbee5('0x1a')];var _0xa50ec9;if(_0x3c3f4e>=_0x5a0ae5){_0x3c3f4e=_0x5a0ae5;_0xa50ec9=0xc8;}else{_0xa50ec9=0xce;}_0x40afcb[_0xbee5('0x17')](_0xa50ec9);return _0x40afcb[_0xbee5('0x1d')](_0xbee5('0x1e'),_0x538460+'-'+_0x3c3f4e+'/'+_0x5a0ae5)[_0xbee5('0x1f')](_0x1a24bd);}return null;};}function patchUpdates(_0x35d7d3){return function(_0x40a06){try{jsonpatch[_0xbee5('0x20')](_0x40a06,_0x35d7d3,!![]);}catch(_0x47af8e){return BPromise['reject'](_0x47af8e);}return _0x40a06[_0xbee5('0x21')]();};}function saveUpdates(_0x48bfb5,_0x205491){return function(_0x117cb3){if(_0x117cb3){return _0x117cb3[_0xbee5('0x22')](_0x48bfb5)[_0xbee5('0x23')](function(_0x3f23c5){return _0x3f23c5;});}return null;};}function removeEntity(_0xb665df,_0x359ccf){return function(_0x3cfa8d){if(_0x3cfa8d){return _0x3cfa8d[_0xbee5('0x24')]()['then'](function(){var _0x5b43b3=_0x3cfa8d['get']({'plain':!![]});var _0x519473='Voicemails';return db[_0xbee5('0x25')][_0xbee5('0x24')]({'where':{'type':_0x519473,'resourceId':_0x5b43b3['id']}})[_0xbee5('0x23')](function(){return _0x3cfa8d;});})[_0xbee5('0x23')](function(){_0xb665df[_0xbee5('0x17')](0xcc)[_0xbee5('0x18')]();});}};}function handleEntityNotFound(_0x3c8643,_0x4e9a79){return function(_0x36b50f){if(!_0x36b50f){_0x3c8643[_0xbee5('0x26')](0x194);}return _0x36b50f;};}function handleError(_0x179d14,_0x39da95){_0x39da95=_0x39da95||0x1f4;return function(_0x1a8bcc){logger['error'](_0x1a8bcc[_0xbee5('0x27')]);if(_0x1a8bcc[_0xbee5('0x28')]){delete _0x1a8bcc[_0xbee5('0x28')];}_0x179d14[_0xbee5('0x17')](_0x39da95)[_0xbee5('0x29')](_0x1a8bcc);};}exports[_0xbee5('0x2a')]=function(_0x34b7df,_0x36e8bb){var _0x2ccb91={},_0x59c2e4={},_0x22df5f={'count':0x0,'rows':[]};var _0x5b10a6=_[_0xbee5('0x2b')](db['VoiceMail'][_0xbee5('0x2c')],function(_0x52dad9){return{'name':_0x52dad9[_0xbee5('0x2d')],'type':_0x52dad9['type'][_0xbee5('0x2e')]};});_0x59c2e4[_0xbee5('0x2f')]=_[_0xbee5('0x2b')](_0x5b10a6,_0xbee5('0x28'));_0x59c2e4['query']=_[_0xbee5('0x30')](_0x34b7df[_0xbee5('0x31')]);_0x59c2e4[_0xbee5('0x32')]=_[_0xbee5('0x33')](_0x59c2e4['model'],_0x59c2e4[_0xbee5('0x31')]);_0x2ccb91[_0xbee5('0x34')]=_[_0xbee5('0x33')](_0x59c2e4[_0xbee5('0x2f')],qs['fields'](_0x34b7df[_0xbee5('0x31')][_0xbee5('0x35')]));_0x2ccb91[_0xbee5('0x34')]=_0x2ccb91[_0xbee5('0x34')]['length']?_0x2ccb91[_0xbee5('0x34')]:_0x59c2e4['model'];if(!_0x34b7df[_0xbee5('0x31')]['hasOwnProperty']('nolimit')){_0x2ccb91['limit']=qs[_0xbee5('0x1a')](_0x34b7df[_0xbee5('0x31')][_0xbee5('0x1a')]);_0x2ccb91[_0xbee5('0x19')]=qs[_0xbee5('0x19')](_0x34b7df[_0xbee5('0x31')][_0xbee5('0x19')]);}_0x2ccb91[_0xbee5('0x36')]=qs['sort'](_0x34b7df[_0xbee5('0x31')]['sort']);_0x2ccb91[_0xbee5('0x37')]=qs[_0xbee5('0x32')](_[_0xbee5('0x38')](_0x34b7df[_0xbee5('0x31')],_0x59c2e4['filters']),_0x5b10a6);if(_0x34b7df[_0xbee5('0x31')]['filter']){_0x2ccb91['where']=_[_0xbee5('0x39')](_0x2ccb91[_0xbee5('0x37')],{'$or':_[_0xbee5('0x2b')](_0x5b10a6,function(_0x1974f2){if(_0x1974f2['type']!==_0xbee5('0x3a')){var _0x2819e2={};_0x2819e2[_0x1974f2[_0xbee5('0x28')]]={'$like':'%'+_0x34b7df[_0xbee5('0x31')][_0xbee5('0x3b')]+'%'};return _0x2819e2;}})});}_0x2ccb91=_[_0xbee5('0x39')]({},_0x2ccb91,_0x34b7df[_0xbee5('0x3c')]);var _0x297294={'where':_0x2ccb91[_0xbee5('0x37')]};return db[_0xbee5('0x3d')]['count'](_0x297294)[_0xbee5('0x23')](function(_0x371015){_0x22df5f['count']=_0x371015;if(_0x34b7df[_0xbee5('0x31')][_0xbee5('0x3e')]){_0x2ccb91[_0xbee5('0x3f')]=[{'all':!![]}];}return db[_0xbee5('0x3d')]['findAll'](_0x2ccb91);})['then'](function(_0x4b4641){_0x22df5f[_0xbee5('0x40')]=_0x4b4641;return _0x22df5f;})[_0xbee5('0x23')](respondWithFilteredResult(_0x36e8bb,_0x2ccb91))[_0xbee5('0x41')](handleError(_0x36e8bb,null));};exports[_0xbee5('0x42')]=function(_0x4012fd,_0x3f5441){var _0x41cea0={'raw':!![],'where':{'id':_0x4012fd[_0xbee5('0x43')]['id']}},_0x2c4464={};_0x2c4464['model']=_['keys'](db[_0xbee5('0x3d')]['rawAttributes']);_0x2c4464[_0xbee5('0x31')]=_[_0xbee5('0x30')](_0x4012fd['query']);_0x2c4464[_0xbee5('0x32')]=_[_0xbee5('0x33')](_0x2c4464['model'],_0x2c4464['query']);_0x41cea0[_0xbee5('0x34')]=_[_0xbee5('0x33')](_0x2c4464['model'],qs[_0xbee5('0x35')](_0x4012fd[_0xbee5('0x31')]['fields']));_0x41cea0[_0xbee5('0x34')]=_0x41cea0[_0xbee5('0x34')][_0xbee5('0x44')]?_0x41cea0[_0xbee5('0x34')]:_0x2c4464[_0xbee5('0x2f')];if(_0x4012fd[_0xbee5('0x31')][_0xbee5('0x3e')]){_0x41cea0['include']=[{'all':!![]}];}_0x41cea0=_[_0xbee5('0x39')]({},_0x41cea0,_0x4012fd[_0xbee5('0x3c')]);return db[_0xbee5('0x3d')][_0xbee5('0x45')](_0x41cea0)['then'](handleEntityNotFound(_0x3f5441,null))[_0xbee5('0x23')](respondWithResult(_0x3f5441,null))[_0xbee5('0x41')](handleError(_0x3f5441,null));};exports[_0xbee5('0x46')]=function(_0x4aa21a,_0x44d4b1){return db[_0xbee5('0x3d')]['create'](_0x4aa21a['body'],{})['then'](function(_0x3a27bb){var _0x501167=_0x4aa21a[_0xbee5('0x47')][_0xbee5('0x48')]({'plain':!![]});if(!_0x501167)throw new Error(_0xbee5('0x49'));if(_0x501167[_0xbee5('0x4a')]===_0xbee5('0x47')){var _0x296fc8=_0x3a27bb['get']({'plain':!![]});var _0x24274d=_0xbee5('0x4b');return db[_0xbee5('0x4c')][_0xbee5('0x45')]({'where':{'name':_0x24274d,'userProfileId':_0x501167['userProfileId']},'raw':!![]})[_0xbee5('0x23')](function(_0x594dcf){if(_0x594dcf&&_0x594dcf[_0xbee5('0x4d')]===0x0){return db[_0xbee5('0x25')][_0xbee5('0x46')]({'name':_0x296fc8[_0xbee5('0x28')],'resourceId':_0x296fc8['id'],'type':_0x594dcf[_0xbee5('0x28')],'sectionId':_0x594dcf['id']},{})[_0xbee5('0x23')](function(){return _0x3a27bb;});}else{return _0x3a27bb;}})[_0xbee5('0x41')](function(_0x35f1d1){logger[_0xbee5('0x4e')](_0xbee5('0x4f'),_0x35f1d1);throw _0x35f1d1;});}return _0x3a27bb;})[_0xbee5('0x23')](respondWithResult(_0x44d4b1,0xc9))[_0xbee5('0x41')](handleError(_0x44d4b1,null));};exports[_0xbee5('0x22')]=function(_0x359738,_0x37cf74){if(_0x359738['body']['id']){delete _0x359738[_0xbee5('0x50')]['id'];}return db[_0xbee5('0x3d')][_0xbee5('0x45')]({'where':{'id':_0x359738['params']['id']}})[_0xbee5('0x23')](handleEntityNotFound(_0x37cf74,null))[_0xbee5('0x23')](saveUpdates(_0x359738[_0xbee5('0x50')],null))['then'](respondWithResult(_0x37cf74,null))[_0xbee5('0x41')](handleError(_0x37cf74,null));};exports['destroy']=function(_0x131c45,_0x4ee645){return db[_0xbee5('0x3d')][_0xbee5('0x45')]({'where':{'id':_0x131c45[_0xbee5('0x43')]['id']}})['then'](handleEntityNotFound(_0x4ee645,null))['then'](removeEntity(_0x4ee645,null))['catch'](handleError(_0x4ee645,null));};exports[_0xbee5('0x51')]=function(_0x684cd4,_0xbc3da7,_0x5b1a05){return db[_0xbee5('0x3d')]['findOne']({'where':{'id':_0x684cd4[_0xbee5('0x43')]['id']}})[_0xbee5('0x23')](handleEntityNotFound(_0xbc3da7,null))[_0xbee5('0x23')](function(_0x5cc68d){var _0x154d44;var _0x2c0958={},_0x1c6f52={};_0x1c6f52[_0xbee5('0x2f')]=_[_0xbee5('0x30')](db[_0xbee5('0x52')][_0xbee5('0x2c')]);_0x1c6f52[_0xbee5('0x31')]=_[_0xbee5('0x30')](_0x684cd4[_0xbee5('0x31')]);_0x1c6f52[_0xbee5('0x32')]=_[_0xbee5('0x33')](_0x1c6f52[_0xbee5('0x2f')],_0x1c6f52[_0xbee5('0x31')]);_0x2c0958[_0xbee5('0x34')]=_[_0xbee5('0x33')](_0x1c6f52[_0xbee5('0x2f')],qs['fields'](_0x684cd4[_0xbee5('0x31')]['fields']));_0x2c0958['attributes']=_0x2c0958[_0xbee5('0x34')][_0xbee5('0x44')]?_0x2c0958['attributes']:_0x1c6f52['model'];if(!_0x684cd4[_0xbee5('0x31')]['hasOwnProperty'](_0xbee5('0x53'))){_0x2c0958[_0xbee5('0x1a')]=qs['limit'](_0x684cd4[_0xbee5('0x31')][_0xbee5('0x1a')]);_0x2c0958[_0xbee5('0x19')]=qs[_0xbee5('0x19')](_0x684cd4['query'][_0xbee5('0x19')]);}_0x2c0958['order']=qs[_0xbee5('0x54')](_0x684cd4[_0xbee5('0x31')]['sort']);_0x2c0958[_0xbee5('0x37')]=qs[_0xbee5('0x32')](_['pick'](_0x684cd4[_0xbee5('0x31')],_0x1c6f52[_0xbee5('0x32')]));if(_0x684cd4['query'][_0xbee5('0x3b')]){_0x2c0958['where']=_[_0xbee5('0x39')](_0x2c0958['where'],{'$or':_[_0xbee5('0x2b')](_0x2c0958['attributes'],function(_0x541414){var _0x3120f5={};_0x3120f5[_0x541414]={'$like':'%'+_0x684cd4[_0xbee5('0x31')][_0xbee5('0x3b')]+'%'};return _0x3120f5;})});}_0x2c0958[_0xbee5('0x37')]=_[_0xbee5('0x39')](_0x2c0958[_0xbee5('0x37')],{'mailboxuser':_0x5cc68d['mailbox']});_0x2c0958=_[_0xbee5('0x39')]({},_0x2c0958,_0x684cd4[_0xbee5('0x3c')]);return db[_0xbee5('0x52')][_0xbee5('0x55')](_0x2c0958)[_0xbee5('0x23')](respondWithFilteredResult(_0xbc3da7,_0x2c0958));})[_0xbee5('0x41')](handleError(_0xbc3da7,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 56d2b26..f229f1a 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 _0x0ae4=['context','lodash','util','../../config/logger','moment','bluebird','path','rimraf','./voiceMail.attributes','exports','VoiceMail','mailbox'];(function(_0x686c8d,_0x3942d6){var _0x2684f6=function(_0x20e136){while(--_0x20e136){_0x686c8d['push'](_0x686c8d['shift']());}};_0x2684f6(++_0x3942d6);}(_0x0ae4,0x199));var _0x40ae=function(_0x3525a8,_0x293833){_0x3525a8=_0x3525a8-0x0;var _0x5742b4=_0x0ae4[_0x3525a8];return _0x5742b4;};'use strict';var _=require(_0x40ae('0x0'));var util=require(_0x40ae('0x1'));var logger=require(_0x40ae('0x2'))('api');var moment=require(_0x40ae('0x3'));var BPromise=require(_0x40ae('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x40ae('0x5'));var rimraf=require(_0x40ae('0x6'));var config=require('../../config/environment');var attributes=require(_0x40ae('0x7'));module[_0x40ae('0x8')]=function(_0x21b74b,_0x203132){return _0x21b74b['define'](_0x40ae('0x9'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0x40ae('0xa'),_0x40ae('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x115c=['bluebird','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','context','lodash','util','../../config/logger','api','moment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x115c,0x1db));var _0xc115=function(_0x38b221,_0x4e911b){_0x38b221=_0x38b221-0x0;var _0x37a515=_0x115c[_0x38b221];return _0x37a515;};'use strict';var _=require(_0xc115('0x0'));var util=require(_0xc115('0x1'));var logger=require(_0xc115('0x2'))(_0xc115('0x3'));var moment=require(_0xc115('0x4'));var BPromise=require(_0xc115('0x5'));var rp=require(_0xc115('0x6'));var fs=require('fs');var path=require(_0xc115('0x7'));var rimraf=require(_0xc115('0x8'));var config=require(_0xc115('0x9'));var attributes=require(_0xc115('0xa'));module[_0xc115('0xb')]=function(_0x14a9f8,_0xa2e876){return _0x14a9f8[_0xc115('0xc')](_0xc115('0xd'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':'mailbox_context','fields':['mailbox',_0xc115('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 142050c..2cd1c21 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 _0x14f1=['util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','http','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x5cf1df,_0x465598){var _0x4bbac4=function(_0x3d358c){while(--_0x3d358c){_0x5cf1df['push'](_0x5cf1df['shift']());}};_0x4bbac4(++_0x465598);}(_0x14f1,0xa8));var _0x114f=function(_0x66459d,_0x196ad3){_0x66459d=_0x66459d-0x0;var _0x3c5207=_0x14f1[_0x66459d];return _0x3c5207;};'use strict';var _=require('lodash');var util=require(_0x114f('0x0'));var moment=require('moment');var BPromise=require(_0x114f('0x1'));var rs=require(_0x114f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x114f('0x3'));var logger=require(_0x114f('0x4'))(_0x114f('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x114f('0x6')][_0x114f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1e3695,_0x2b3d53,_0x4c929f){return new BPromise(function(_0xefead5,_0x4dbd87){return client[_0x114f('0x8')](_0x1e3695,_0x4c929f)[_0x114f('0x9')](function(_0x3f0803){logger[_0x114f('0xa')](_0x114f('0xb'),_0x2b3d53,_0x114f('0xc'));logger[_0x114f('0xd')](_0x114f('0xe'),_0x2b3d53,_0x114f('0xc'),JSON[_0x114f('0xf')](_0x3f0803));if(_0x3f0803[_0x114f('0x10')]){if(_0x3f0803[_0x114f('0x10')][_0x114f('0x11')]===0x1f4){logger['error'](_0x114f('0xb'),_0x2b3d53,_0x3f0803[_0x114f('0x10')][_0x114f('0x12')]);return _0x4dbd87(_0x3f0803[_0x114f('0x10')]['message']);}logger[_0x114f('0x10')]('VoiceMail,\x20%s,\x20%s',_0x2b3d53,_0x3f0803[_0x114f('0x10')][_0x114f('0x12')]);return _0xefead5(_0x3f0803[_0x114f('0x10')][_0x114f('0x12')]);}else{logger[_0x114f('0xa')](_0x114f('0xb'),_0x2b3d53,_0x114f('0xc'));_0xefead5(_0x3f0803[_0x114f('0x13')][_0x114f('0x12')]);}})[_0x114f('0x14')](function(_0x3f2370){logger[_0x114f('0x10')]('VoiceMail,\x20%s,\x20%s',_0x2b3d53,_0x3f2370);_0x4dbd87(_0x3f2370);});});} \ No newline at end of file +var _0xbf57=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','request','then','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment'];(function(_0x5673a6,_0x3b0478){var _0x799b09=function(_0x31959b){while(--_0x31959b){_0x5673a6['push'](_0x5673a6['shift']());}};_0x799b09(++_0x3b0478);}(_0xbf57,0x111));var _0x7bf5=function(_0x159633,_0x5a841a){_0x159633=_0x159633-0x0;var _0x41cd1b=_0xbf57[_0x159633];return _0x41cd1b;};'use strict';var _=require(_0x7bf5('0x0'));var util=require(_0x7bf5('0x1'));var moment=require(_0x7bf5('0x2'));var BPromise=require('bluebird');var rs=require(_0x7bf5('0x3'));var fs=require('fs');var Redis=require(_0x7bf5('0x4'));var db=require(_0x7bf5('0x5'))['db'];var utils=require(_0x7bf5('0x6'));var logger=require('../../config/logger')(_0x7bf5('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7bf5('0x8')][_0x7bf5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2b5b38,_0x36794b,_0x148ea6){return new BPromise(function(_0x5b0018,_0x4fc86f){return client[_0x7bf5('0xa')](_0x2b5b38,_0x148ea6)[_0x7bf5('0xb')](function(_0x32b64a){logger['info'](_0x7bf5('0xc'),_0x36794b,_0x7bf5('0xd'));logger[_0x7bf5('0xe')](_0x7bf5('0xf'),_0x36794b,_0x7bf5('0xd'),JSON[_0x7bf5('0x10')](_0x32b64a));if(_0x32b64a[_0x7bf5('0x11')]){if(_0x32b64a[_0x7bf5('0x11')][_0x7bf5('0x12')]===0x1f4){logger[_0x7bf5('0x11')](_0x7bf5('0xc'),_0x36794b,_0x32b64a[_0x7bf5('0x11')][_0x7bf5('0x13')]);return _0x4fc86f(_0x32b64a[_0x7bf5('0x11')][_0x7bf5('0x13')]);}logger[_0x7bf5('0x11')](_0x7bf5('0xc'),_0x36794b,_0x32b64a[_0x7bf5('0x11')][_0x7bf5('0x13')]);return _0x5b0018(_0x32b64a[_0x7bf5('0x11')]['message']);}else{logger[_0x7bf5('0x14')](_0x7bf5('0xc'),_0x36794b,'request\x20sent');_0x5b0018(_0x32b64a[_0x7bf5('0x15')][_0x7bf5('0x13')]);}})[_0x7bf5('0x16')](function(_0x188358){logger[_0x7bf5('0x11')]('VoiceMail,\x20%s,\x20%s',_0x36794b,_0x188358);_0x4fc86f(_0x188358);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 78831cc..0f6a72d 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 _0xee6f=['download','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./voiceMailMessage.controller','get','index','/:id','show','isAuthenticated'];(function(_0x51eb91,_0x4799d5){var _0x1c4fc4=function(_0x1fd807){while(--_0x1fd807){_0x51eb91['push'](_0x51eb91['shift']());}};_0x1c4fc4(++_0x4799d5);}(_0xee6f,0xcf));var _0xfee6=function(_0x4a4563,_0x2771c3){_0x4a4563=_0x4a4563-0x0;var _0x201be1=_0xee6f[_0x4a4563];return _0x201be1;};'use strict';var multer=require(_0xfee6('0x0'));var util=require(_0xfee6('0x1'));var path=require(_0xfee6('0x2'));var timeout=require('connect-timeout');var express=require(_0xfee6('0x3'));var router=express[_0xfee6('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xfee6('0x5'));var interaction=require(_0xfee6('0x6'));var config=require('../../config/environment');var controller=require(_0xfee6('0x7'));router[_0xfee6('0x8')]('/',auth['isAuthenticated'](),controller[_0xfee6('0x9')]);router[_0xfee6('0x8')](_0xfee6('0xa'),auth['isAuthenticated'](),controller[_0xfee6('0xb')]);router[_0xfee6('0x8')]('/:id/download',auth[_0xfee6('0xc')](),controller[_0xfee6('0xd')]);router['post']('/',auth[_0xfee6('0xc')](),controller[_0xfee6('0xe')]);router[_0xfee6('0xf')](_0xfee6('0xa'),auth[_0xfee6('0xc')](),controller[_0xfee6('0x10')]);router[_0xfee6('0x11')](_0xfee6('0xa'),auth[_0xfee6('0xc')](),controller[_0xfee6('0x12')]);module[_0xfee6('0x13')]=router; \ No newline at end of file +var _0x2f05=['../../components/auth/service','./voiceMailMessage.controller','get','isAuthenticated','/:id','show','/:id/download','download','put','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x69dca2,_0xccb159){var _0x86e037=function(_0x1b5048){while(--_0x1b5048){_0x69dca2['push'](_0x69dca2['shift']());}};_0x86e037(++_0xccb159);}(_0x2f05,0xf5));var _0x52f0=function(_0x5aa5e1,_0x2b978c){_0x5aa5e1=_0x5aa5e1-0x0;var _0x376622=_0x2f05[_0x5aa5e1];return _0x376622;};'use strict';var multer=require(_0x52f0('0x0'));var util=require(_0x52f0('0x1'));var path=require(_0x52f0('0x2'));var timeout=require(_0x52f0('0x3'));var express=require(_0x52f0('0x4'));var router=express[_0x52f0('0x5')]();var fs_extra=require(_0x52f0('0x6'));var auth=require(_0x52f0('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x52f0('0x8'));router[_0x52f0('0x9')]('/',auth[_0x52f0('0xa')](),controller['index']);router[_0x52f0('0x9')](_0x52f0('0xb'),auth['isAuthenticated'](),controller[_0x52f0('0xc')]);router[_0x52f0('0x9')](_0x52f0('0xd'),auth['isAuthenticated'](),controller[_0x52f0('0xe')]);router['post']('/',auth[_0x52f0('0xa')](),controller['create']);router[_0x52f0('0xf')](_0x52f0('0xb'),auth[_0x52f0('0xa')](),controller['update']);router[_0x52f0('0x10')](_0x52f0('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x52f0('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 8d6c216..5671fe8 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 _0x71c3=['BLOB','long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','exports','VIRTUAL','INTEGER','STRING'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x71c3,0x1d9));var _0x371c=function(_0x58f517,_0x5c1d4e){_0x58f517=_0x58f517-0x0;var _0x288997=_0x71c3[_0x58f517];return _0x288997;};'use strict';var Sequelize=require('sequelize');module[_0x371c('0x0')]={'name':{'type':Sequelize[_0x371c('0x1')],'get':function(_0x21e18e){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize[_0x371c('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x371c('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0x371c('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0x371c('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0x371c('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x371c('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x371c('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0x371c('0x4')](_0x371c('0x5')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0x371c('0x3')],'defaultValue':''},'stamp':{'type':_0x371c('0x6'),'defaultValue':Sequelize[_0x371c('0x7')](_0x371c('0x8'))}}; \ No newline at end of file +var _0x2659=['VIRTUAL','getDataValue','INTEGER','STRING','BLOB','long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports'];(function(_0x5f04b,_0x5d3ea3){var _0x128edd=function(_0x287e9d){while(--_0x287e9d){_0x5f04b['push'](_0x5f04b['shift']());}};_0x128edd(++_0x5d3ea3);}(_0x2659,0x77));var _0x9265=function(_0x708c47,_0x6eaa1f){_0x708c47=_0x708c47-0x0;var _0x52a470=_0x2659[_0x708c47];return _0x52a470;};'use strict';var Sequelize=require(_0x9265('0x0'));module[_0x9265('0x1')]={'name':{'type':Sequelize[_0x9265('0x2')],'get':function(_0x245896){return this[_0x9265('0x3')]('id');}},'msgnum':{'type':Sequelize[_0x9265('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x9265('0x5')],'defaultValue':''},'context':{'type':Sequelize[_0x9265('0x5')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x9265('0x5')],'defaultValue':''},'callerid':{'type':Sequelize[_0x9265('0x5')],'defaultValue':''},'origtime':{'type':Sequelize[_0x9265('0x5')],'defaultValue':''},'duration':{'type':Sequelize[_0x9265('0x5')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x9265('0x5')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x9265('0x5')],'defaultValue':''},'recording':{'type':Sequelize[_0x9265('0x6')](_0x9265('0x7')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0x9265('0x5')],'defaultValue':''},'stamp':{'type':_0x9265('0x8'),'defaultValue':Sequelize[_0x9265('0x9')](_0x9265('0xa'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index bf91436..57339fa 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 _0x04a2=['show','params','intersection','length','catch','body','find','recording','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','msg_id','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','VoiceMailMessage','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','filters','fields','attributes','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows'];(function(_0x456fb1,_0x859a1d){var _0x4083d6=function(_0xe1d0f2){while(--_0xe1d0f2){_0x456fb1['push'](_0x456fb1['shift']());}};_0x4083d6(++_0x859a1d);}(_0x04a2,0x153));var _0x204a=function(_0x51acd0,_0x3970bb){_0x51acd0=_0x51acd0-0x0;var _0x5a4a8b=_0x04a2[_0x51acd0];return _0x5a4a8b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x204a('0x0'));var zipdir=require(_0x204a('0x1'));var jsonpatch=require(_0x204a('0x2'));var rp=require(_0x204a('0x3'));var moment=require(_0x204a('0x4'));var BPromise=require(_0x204a('0x5'));var Mustache=require('mustache');var util=require(_0x204a('0x6'));var path=require(_0x204a('0x7'));var sox=require(_0x204a('0x8'));var csv=require(_0x204a('0x9'));var ejs=require(_0x204a('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x204a('0xb'));var squel=require(_0x204a('0xc'));var crypto=require(_0x204a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x204a('0xe'));var toCsv=require(_0x204a('0x9'));var querystring=require(_0x204a('0xf'));var Papa=require(_0x204a('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x204a('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x204a('0x12'))('api');var utils=require(_0x204a('0x13'));var config=require(_0x204a('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x204a('0x15'))['db'];function respondWithStatusCode(_0x2b5182,_0x35fdb6){_0x35fdb6=_0x35fdb6||0xcc;return function(_0x26b915){if(_0x26b915){return _0x2b5182[_0x204a('0x16')](_0x35fdb6);}return _0x2b5182[_0x204a('0x17')](_0x35fdb6)[_0x204a('0x18')]();};}function respondWithResult(_0x536c3c,_0x5bcfec){_0x5bcfec=_0x5bcfec||0xc8;return function(_0x392399){if(_0x392399){return _0x536c3c[_0x204a('0x17')](_0x5bcfec)[_0x204a('0x19')](_0x392399);}};}function respondWithFilteredResult(_0x545265,_0x4f29db){return function(_0x1d0829){if(_0x1d0829){var _0x153232=typeof _0x4f29db[_0x204a('0x1a')]===_0x204a('0x1b')&&typeof _0x4f29db['limit']===_0x204a('0x1b');var _0x16f9c6=_0x1d0829[_0x204a('0x1c')];var _0x14f4d6=_0x153232?0x0:_0x4f29db[_0x204a('0x1a')];var _0x48e86f=_0x153232?_0x1d0829[_0x204a('0x1c')]:_0x4f29db[_0x204a('0x1a')]+_0x4f29db[_0x204a('0x1d')];var _0x5b6c90;if(_0x48e86f>=_0x16f9c6){_0x48e86f=_0x16f9c6;_0x5b6c90=0xc8;}else{_0x5b6c90=0xce;}_0x545265[_0x204a('0x17')](_0x5b6c90);return _0x545265['set'](_0x204a('0x1e'),_0x14f4d6+'-'+_0x48e86f+'/'+_0x16f9c6)[_0x204a('0x19')](_0x1d0829);}return null;};}function patchUpdates(_0x752187){return function(_0x408b81){try{jsonpatch[_0x204a('0x1f')](_0x408b81,_0x752187,!![]);}catch(_0x4d3810){return BPromise[_0x204a('0x20')](_0x4d3810);}return _0x408b81[_0x204a('0x21')]();};}function saveUpdates(_0x2eadb4,_0x1ea858){return function(_0x355108){if(_0x355108){return _0x355108[_0x204a('0x22')](_0x2eadb4)[_0x204a('0x23')](function(_0x5070e4){return _0x5070e4;});}return null;};}function removeEntity(_0x434eff,_0x5b0a49){return function(_0xe80f10){if(_0xe80f10){return _0xe80f10[_0x204a('0x24')]()[_0x204a('0x23')](function(){_0x434eff[_0x204a('0x17')](0xcc)[_0x204a('0x18')]();});}};}function handleEntityNotFound(_0x13d7d1,_0xeaa157){return function(_0x2e2522){if(!_0x2e2522){_0x13d7d1[_0x204a('0x16')](0x194);}return _0x2e2522;};}function handleError(_0x66587d,_0x171cae){_0x171cae=_0x171cae||0x1f4;return function(_0x150a3e){logger[_0x204a('0x25')](_0x150a3e['stack']);if(_0x150a3e[_0x204a('0x26')]){delete _0x150a3e[_0x204a('0x26')];}_0x66587d[_0x204a('0x17')](_0x171cae)[_0x204a('0x27')](_0x150a3e);};}exports[_0x204a('0x28')]=function(_0x86eeff,_0x36e56a){var _0x442c46={},_0x3c0c9f={},_0x428d0d={'count':0x0,'rows':[]};var _0x4f495b=_[_0x204a('0x29')](db[_0x204a('0x2a')][_0x204a('0x2b')],function(_0x52c16d){return{'name':_0x52c16d[_0x204a('0x2c')],'type':_0x52c16d[_0x204a('0x2d')][_0x204a('0x2e')]};});_0x3c0c9f[_0x204a('0x2f')]=_[_0x204a('0x30')](_[_0x204a('0x29')](_0x4f495b,_0x204a('0x26')),[_0x204a('0x26')]);_0x3c0c9f[_0x204a('0x31')]=_[_0x204a('0x32')](_0x86eeff['query']);_0x3c0c9f[_0x204a('0x33')]=_['intersection'](_0x3c0c9f[_0x204a('0x2f')],_0x3c0c9f[_0x204a('0x31')]);_0x442c46['attributes']=_['intersection'](_0x3c0c9f[_0x204a('0x2f')],qs[_0x204a('0x34')](_0x86eeff['query']['fields']));_0x442c46[_0x204a('0x35')]=_0x442c46['attributes']['length']?_0x442c46['attributes']:_0x3c0c9f['model'];if(!_0x86eeff[_0x204a('0x31')][_0x204a('0x36')]('nolimit')){_0x442c46['limit']=qs['limit'](_0x86eeff['query'][_0x204a('0x1d')]);_0x442c46[_0x204a('0x1a')]=qs['offset'](_0x86eeff[_0x204a('0x31')][_0x204a('0x1a')]);}_0x442c46[_0x204a('0x37')]=qs[_0x204a('0x38')](_0x86eeff['query'][_0x204a('0x38')]);_0x442c46['where']=qs[_0x204a('0x33')](_[_0x204a('0x39')](_0x86eeff[_0x204a('0x31')],_0x3c0c9f[_0x204a('0x33')]),_0x4f495b);if(_0x86eeff['query'][_0x204a('0x3a')]){_0x442c46[_0x204a('0x3b')]=_[_0x204a('0x3c')](_0x442c46['where'],{'$or':_[_0x204a('0x29')](_0x4f495b,function(_0x52eccf){if(_0x52eccf[_0x204a('0x2d')]!==_0x204a('0x3d')){var _0x140de9={};_0x140de9[_0x52eccf[_0x204a('0x26')]]={'$like':'%'+_0x86eeff['query'][_0x204a('0x3a')]+'%'};return _0x140de9;}})});}_0x442c46=_[_0x204a('0x3c')]({},_0x442c46,_0x86eeff[_0x204a('0x3e')]);var _0x27c180={'where':_0x442c46['where']};return db[_0x204a('0x2a')][_0x204a('0x1c')](_0x27c180)[_0x204a('0x23')](function(_0x176b06){_0x428d0d['count']=_0x176b06;if(_0x86eeff[_0x204a('0x31')][_0x204a('0x3f')]){_0x442c46[_0x204a('0x40')]=[{'all':!![]}];}return db[_0x204a('0x2a')]['findAll'](_0x442c46);})[_0x204a('0x23')](function(_0x4d1bf9){_0x428d0d[_0x204a('0x41')]=_0x4d1bf9;return _0x428d0d;})[_0x204a('0x23')](respondWithFilteredResult(_0x36e56a,_0x442c46))['catch'](handleError(_0x36e56a,null));};exports[_0x204a('0x42')]=function(_0x1e9378,_0x19c98e){var _0x121786={'raw':!![],'where':{'id':_0x1e9378[_0x204a('0x43')]['id']}},_0x233e08={};_0x233e08[_0x204a('0x2f')]=_[_0x204a('0x32')](db[_0x204a('0x2a')][_0x204a('0x2b')]);_0x233e08['query']=_[_0x204a('0x32')](_0x1e9378[_0x204a('0x31')]);_0x233e08[_0x204a('0x33')]=_[_0x204a('0x44')](_0x233e08[_0x204a('0x2f')],_0x233e08[_0x204a('0x31')]);_0x121786[_0x204a('0x35')]=_[_0x204a('0x44')](_0x233e08[_0x204a('0x2f')],qs[_0x204a('0x34')](_0x1e9378[_0x204a('0x31')][_0x204a('0x34')]));_0x121786[_0x204a('0x35')]=_0x121786[_0x204a('0x35')][_0x204a('0x45')]?_0x121786[_0x204a('0x35')]:_0x233e08[_0x204a('0x2f')];if(_0x1e9378['query'][_0x204a('0x3f')]){_0x121786[_0x204a('0x40')]=[{'all':!![]}];}_0x121786=_[_0x204a('0x3c')]({},_0x121786,_0x1e9378['options']);return db[_0x204a('0x2a')]['find'](_0x121786)['then'](handleEntityNotFound(_0x19c98e,null))[_0x204a('0x23')](respondWithResult(_0x19c98e,null))[_0x204a('0x46')](handleError(_0x19c98e,null));};exports['create']=function(_0x4fc72b,_0x3c5be8){return db['VoiceMailMessage']['create'](_0x4fc72b[_0x204a('0x47')],{})[_0x204a('0x23')](respondWithResult(_0x3c5be8,0xc9))[_0x204a('0x46')](handleError(_0x3c5be8,null));};exports[_0x204a('0x22')]=function(_0x420564,_0x5551ab){if(_0x420564[_0x204a('0x47')]['id']){delete _0x420564['body']['id'];}return db[_0x204a('0x2a')][_0x204a('0x48')]({'where':{'id':_0x420564['params']['id']}})[_0x204a('0x23')](handleEntityNotFound(_0x5551ab,null))[_0x204a('0x23')](saveUpdates(_0x420564['body'],null))[_0x204a('0x23')](respondWithResult(_0x5551ab,null))[_0x204a('0x46')](handleError(_0x5551ab,null));};exports[_0x204a('0x24')]=function(_0x42d539,_0x424c59){return db[_0x204a('0x2a')][_0x204a('0x48')]({'where':{'id':_0x42d539[_0x204a('0x43')]['id']}})['then'](handleEntityNotFound(_0x424c59,null))[_0x204a('0x23')](removeEntity(_0x424c59,null))[_0x204a('0x46')](handleError(_0x424c59,null));};exports['download']=function(_0x4e8caf,_0x2935c6,_0xc16274){return db['VoiceMailMessage']['find']({'where':{'id':_0x4e8caf[_0x204a('0x43')]['id']},'attributes':['id',_0x204a('0x49'),'msg_id']})[_0x204a('0x23')](handleEntityNotFound(_0x2935c6,null))['then'](function(_0x1a0156){if(_0x1a0156){if(!_0x1a0156['recording']){throw new db['Sequelize'][(_0x204a('0x4a'))](_0x204a('0x4b'));}var _0x4642cd={'Content-Type':_0x204a('0x4c'),'Content-Disposition':'attachment'};if(_0x1a0156[_0x204a('0x4d')]){_0x4642cd[_0x204a('0x4e')]=_0x204a('0x4f')+_0x1a0156[_0x204a('0x4d')]+_0x204a('0x50');}_0x2935c6['set'](_0x4642cd);return _0x2935c6[_0x204a('0x27')](new Buffer(_0x1a0156[_0x204a('0x49')]));}})[_0x204a('0x46')](handleError(_0x2935c6,null));}; \ No newline at end of file +var _0xbbd9=['params','length','include','find','create','body','download','recording','msg_id','Sequelize','VoiceMailMessage\x20not\x20found','attachment','Content-Disposition','.wav\x22','eml-format','zip-dir','bluebird','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','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','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','VoiceMailMessage','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','map','VIRTUAL','filter','options','includeAll','findAll','catch','show'];(function(_0x36e2a9,_0x363c3e){var _0x108b60=function(_0x45bb72){while(--_0x45bb72){_0x36e2a9['push'](_0x36e2a9['shift']());}};_0x108b60(++_0x363c3e);}(_0xbbd9,0x14e));var _0x9bbd=function(_0x3550d4,_0xa10bca){_0x3550d4=_0x3550d4-0x0;var _0x1c8ba1=_0xbbd9[_0x3550d4];return _0x1c8ba1;};'use strict';var emlformat=require(_0x9bbd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9bbd('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9bbd('0x2'));var Mustache=require(_0x9bbd('0x3'));var util=require(_0x9bbd('0x4'));var path=require(_0x9bbd('0x5'));var sox=require('sox');var csv=require(_0x9bbd('0x6'));var ejs=require(_0x9bbd('0x7'));var fs=require('fs');var fs_extra=require(_0x9bbd('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x9bbd('0x9'));var jsforce=require(_0x9bbd('0xa'));var deskjs=require(_0x9bbd('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x9bbd('0xc'));var authService=require(_0x9bbd('0xd'));var qs=require(_0x9bbd('0xe'));var as=require(_0x9bbd('0xf'));var hardwareService=require(_0x9bbd('0x10'));var logger=require(_0x9bbd('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x9bbd('0x12'));var licenseUtil=require(_0x9bbd('0x13'));var db=require(_0x9bbd('0x14'))['db'];function respondWithStatusCode(_0x51b301,_0xdae390){_0xdae390=_0xdae390||0xcc;return function(_0xb2abfd){if(_0xb2abfd){return _0x51b301[_0x9bbd('0x15')](_0xdae390);}return _0x51b301[_0x9bbd('0x16')](_0xdae390)[_0x9bbd('0x17')]();};}function respondWithResult(_0x2c216a,_0xe67a4d){_0xe67a4d=_0xe67a4d||0xc8;return function(_0x28d6ce){if(_0x28d6ce){return _0x2c216a[_0x9bbd('0x16')](_0xe67a4d)[_0x9bbd('0x18')](_0x28d6ce);}};}function respondWithFilteredResult(_0x562065,_0x30276f){return function(_0x4b9e72){if(_0x4b9e72){var _0x30c296=typeof _0x30276f[_0x9bbd('0x19')]===_0x9bbd('0x1a')&&typeof _0x30276f[_0x9bbd('0x1b')]==='undefined';var _0x4057f6=_0x4b9e72[_0x9bbd('0x1c')];var _0x2b53b3=_0x30c296?0x0:_0x30276f['offset'];var _0x3f6324=_0x30c296?_0x4b9e72[_0x9bbd('0x1c')]:_0x30276f[_0x9bbd('0x19')]+_0x30276f[_0x9bbd('0x1b')];var _0x2e4a54;if(_0x3f6324>=_0x4057f6){_0x3f6324=_0x4057f6;_0x2e4a54=0xc8;}else{_0x2e4a54=0xce;}_0x562065[_0x9bbd('0x16')](_0x2e4a54);return _0x562065[_0x9bbd('0x1d')](_0x9bbd('0x1e'),_0x2b53b3+'-'+_0x3f6324+'/'+_0x4057f6)[_0x9bbd('0x18')](_0x4b9e72);}return null;};}function patchUpdates(_0x4503c6){return function(_0x6fc0f3){try{jsonpatch[_0x9bbd('0x1f')](_0x6fc0f3,_0x4503c6,!![]);}catch(_0x3f0f94){return BPromise[_0x9bbd('0x20')](_0x3f0f94);}return _0x6fc0f3[_0x9bbd('0x21')]();};}function saveUpdates(_0x1a086f,_0x718881){return function(_0x59301a){if(_0x59301a){return _0x59301a[_0x9bbd('0x22')](_0x1a086f)[_0x9bbd('0x23')](function(_0x375874){return _0x375874;});}return null;};}function removeEntity(_0x3264e0,_0x4fbe0a){return function(_0x24e6b2){if(_0x24e6b2){return _0x24e6b2[_0x9bbd('0x24')]()[_0x9bbd('0x23')](function(){_0x3264e0[_0x9bbd('0x16')](0xcc)[_0x9bbd('0x17')]();});}};}function handleEntityNotFound(_0x1ce3a2,_0x55cd27){return function(_0x2b8f7c){if(!_0x2b8f7c){_0x1ce3a2['sendStatus'](0x194);}return _0x2b8f7c;};}function handleError(_0x5e1c3a,_0x150407){_0x150407=_0x150407||0x1f4;return function(_0x312d24){logger[_0x9bbd('0x25')](_0x312d24[_0x9bbd('0x26')]);if(_0x312d24[_0x9bbd('0x27')]){delete _0x312d24[_0x9bbd('0x27')];}_0x5e1c3a[_0x9bbd('0x16')](_0x150407)[_0x9bbd('0x28')](_0x312d24);};}exports['index']=function(_0x44ac35,_0x364fb9){var _0x55c1b8={},_0x327ee3={},_0x4a01fe={'count':0x0,'rows':[]};var _0x1f08a3=_['map'](db[_0x9bbd('0x29')]['rawAttributes'],function(_0x12fef2){return{'name':_0x12fef2[_0x9bbd('0x2a')],'type':_0x12fef2[_0x9bbd('0x2b')][_0x9bbd('0x2c')]};});_0x327ee3['model']=_['differenceBy'](_['map'](_0x1f08a3,_0x9bbd('0x27')),['name']);_0x327ee3['query']=_[_0x9bbd('0x2d')](_0x44ac35[_0x9bbd('0x2e')]);_0x327ee3[_0x9bbd('0x2f')]=_[_0x9bbd('0x30')](_0x327ee3[_0x9bbd('0x31')],_0x327ee3['query']);_0x55c1b8[_0x9bbd('0x32')]=_[_0x9bbd('0x30')](_0x327ee3['model'],qs['fields'](_0x44ac35[_0x9bbd('0x2e')][_0x9bbd('0x33')]));_0x55c1b8[_0x9bbd('0x32')]=_0x55c1b8[_0x9bbd('0x32')]['length']?_0x55c1b8[_0x9bbd('0x32')]:_0x327ee3[_0x9bbd('0x31')];if(!_0x44ac35[_0x9bbd('0x2e')][_0x9bbd('0x34')](_0x9bbd('0x35'))){_0x55c1b8[_0x9bbd('0x1b')]=qs[_0x9bbd('0x1b')](_0x44ac35[_0x9bbd('0x2e')]['limit']);_0x55c1b8[_0x9bbd('0x19')]=qs[_0x9bbd('0x19')](_0x44ac35[_0x9bbd('0x2e')][_0x9bbd('0x19')]);}_0x55c1b8[_0x9bbd('0x36')]=qs['sort'](_0x44ac35['query'][_0x9bbd('0x37')]);_0x55c1b8[_0x9bbd('0x38')]=qs['filters'](_['pick'](_0x44ac35[_0x9bbd('0x2e')],_0x327ee3[_0x9bbd('0x2f')]),_0x1f08a3);if(_0x44ac35['query']['filter']){_0x55c1b8[_0x9bbd('0x38')]=_[_0x9bbd('0x39')](_0x55c1b8[_0x9bbd('0x38')],{'$or':_[_0x9bbd('0x3a')](_0x1f08a3,function(_0x351490){if(_0x351490[_0x9bbd('0x2b')]!==_0x9bbd('0x3b')){var _0x35315c={};_0x35315c[_0x351490[_0x9bbd('0x27')]]={'$like':'%'+_0x44ac35['query'][_0x9bbd('0x3c')]+'%'};return _0x35315c;}})});}_0x55c1b8=_[_0x9bbd('0x39')]({},_0x55c1b8,_0x44ac35[_0x9bbd('0x3d')]);var _0x38c571={'where':_0x55c1b8[_0x9bbd('0x38')]};return db['VoiceMailMessage']['count'](_0x38c571)[_0x9bbd('0x23')](function(_0x404a06){_0x4a01fe['count']=_0x404a06;if(_0x44ac35[_0x9bbd('0x2e')][_0x9bbd('0x3e')]){_0x55c1b8['include']=[{'all':!![]}];}return db['VoiceMailMessage'][_0x9bbd('0x3f')](_0x55c1b8);})[_0x9bbd('0x23')](function(_0xce9b9){_0x4a01fe['rows']=_0xce9b9;return _0x4a01fe;})[_0x9bbd('0x23')](respondWithFilteredResult(_0x364fb9,_0x55c1b8))[_0x9bbd('0x40')](handleError(_0x364fb9,null));};exports[_0x9bbd('0x41')]=function(_0x2c9cdd,_0x30edc2){var _0x35ad44={'raw':!![],'where':{'id':_0x2c9cdd[_0x9bbd('0x42')]['id']}},_0x34a68a={};_0x34a68a['model']=_[_0x9bbd('0x2d')](db[_0x9bbd('0x29')]['rawAttributes']);_0x34a68a[_0x9bbd('0x2e')]=_['keys'](_0x2c9cdd['query']);_0x34a68a[_0x9bbd('0x2f')]=_['intersection'](_0x34a68a[_0x9bbd('0x31')],_0x34a68a[_0x9bbd('0x2e')]);_0x35ad44[_0x9bbd('0x32')]=_['intersection'](_0x34a68a[_0x9bbd('0x31')],qs['fields'](_0x2c9cdd[_0x9bbd('0x2e')][_0x9bbd('0x33')]));_0x35ad44['attributes']=_0x35ad44[_0x9bbd('0x32')][_0x9bbd('0x43')]?_0x35ad44[_0x9bbd('0x32')]:_0x34a68a[_0x9bbd('0x31')];if(_0x2c9cdd[_0x9bbd('0x2e')][_0x9bbd('0x3e')]){_0x35ad44[_0x9bbd('0x44')]=[{'all':!![]}];}_0x35ad44=_[_0x9bbd('0x39')]({},_0x35ad44,_0x2c9cdd['options']);return db['VoiceMailMessage'][_0x9bbd('0x45')](_0x35ad44)[_0x9bbd('0x23')](handleEntityNotFound(_0x30edc2,null))[_0x9bbd('0x23')](respondWithResult(_0x30edc2,null))[_0x9bbd('0x40')](handleError(_0x30edc2,null));};exports['create']=function(_0x331bb7,_0x3abddd){return db[_0x9bbd('0x29')][_0x9bbd('0x46')](_0x331bb7['body'],{})[_0x9bbd('0x23')](respondWithResult(_0x3abddd,0xc9))[_0x9bbd('0x40')](handleError(_0x3abddd,null));};exports[_0x9bbd('0x22')]=function(_0x1d62dd,_0x56200b){if(_0x1d62dd[_0x9bbd('0x47')]['id']){delete _0x1d62dd['body']['id'];}return db[_0x9bbd('0x29')]['find']({'where':{'id':_0x1d62dd['params']['id']}})[_0x9bbd('0x23')](handleEntityNotFound(_0x56200b,null))[_0x9bbd('0x23')](saveUpdates(_0x1d62dd['body'],null))[_0x9bbd('0x23')](respondWithResult(_0x56200b,null))['catch'](handleError(_0x56200b,null));};exports[_0x9bbd('0x24')]=function(_0x293dca,_0x1e9d07){return db[_0x9bbd('0x29')][_0x9bbd('0x45')]({'where':{'id':_0x293dca['params']['id']}})[_0x9bbd('0x23')](handleEntityNotFound(_0x1e9d07,null))[_0x9bbd('0x23')](removeEntity(_0x1e9d07,null))['catch'](handleError(_0x1e9d07,null));};exports[_0x9bbd('0x48')]=function(_0x4708e1,_0x4c9df7,_0x10e8ed){return db[_0x9bbd('0x29')][_0x9bbd('0x45')]({'where':{'id':_0x4708e1[_0x9bbd('0x42')]['id']},'attributes':['id',_0x9bbd('0x49'),_0x9bbd('0x4a')]})['then'](handleEntityNotFound(_0x4c9df7,null))['then'](function(_0x5ce3ec){if(_0x5ce3ec){if(!_0x5ce3ec[_0x9bbd('0x49')]){throw new db[(_0x9bbd('0x4b'))]['ValidationError'](_0x9bbd('0x4c'));}var _0x559f17={'Content-Type':'audio/wav','Content-Disposition':_0x9bbd('0x4d')};if(_0x5ce3ec[_0x9bbd('0x4a')]){_0x559f17[_0x9bbd('0x4e')]='attachment;\x20filename=\x22'+_0x5ce3ec[_0x9bbd('0x4a')]+_0x9bbd('0x4f');}_0x4c9df7['set'](_0x559f17);return _0x4c9df7[_0x9bbd('0x28')](new Buffer(_0x5ce3ec['recording']));}})['catch'](handleError(_0x4c9df7,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 4378b6b..f2ce964 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 _0xc73d=['bluebird','request-promise','path','../../config/environment','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','api'];(function(_0x36c56b,_0x583298){var _0x13c4f1=function(_0x1b074e){while(--_0x1b074e){_0x36c56b['push'](_0x36c56b['shift']());}};_0x13c4f1(++_0x583298);}(_0xc73d,0x1ea));var _0xdc73=function(_0x520255,_0x4aa3e8){_0x520255=_0x520255-0x0;var _0x1020cb=_0xc73d[_0x520255];return _0x1020cb;};'use strict';var _=require(_0xdc73('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xdc73('0x1'));var moment=require('moment');var BPromise=require(_0xdc73('0x2'));var rp=require(_0xdc73('0x3'));var fs=require('fs');var path=require(_0xdc73('0x4'));var rimraf=require('rimraf');var config=require(_0xdc73('0x5'));var attributes=require(_0xdc73('0x6'));module[_0xdc73('0x7')]=function(_0xe06d48,_0x2ce10f){return _0xe06d48[_0xdc73('0x8')](_0xdc73('0x9'),attributes,{'tableName':_0xdc73('0xa'),'paranoid':![],'indexes':[{'name':'dir','fields':[_0xdc73('0xb')]}],'timestamps':![]});}; \ No newline at end of file +var _0xe8cf=['request-promise','../../config/environment','./voiceMailMessage.attributes','define','dir','lodash','util','../../config/logger','moment','bluebird'];(function(_0x27a98e,_0x3391e5){var _0x55c91c=function(_0x579ff9){while(--_0x579ff9){_0x27a98e['push'](_0x27a98e['shift']());}};_0x55c91c(++_0x3391e5);}(_0xe8cf,0x69));var _0xfe8c=function(_0x482816,_0x35e716){_0x482816=_0x482816-0x0;var _0xb89169=_0xe8cf[_0x482816];return _0xb89169;};'use strict';var _=require(_0xfe8c('0x0'));var util=require(_0xfe8c('0x1'));var logger=require(_0xfe8c('0x2'))('api');var moment=require(_0xfe8c('0x3'));var BPromise=require(_0xfe8c('0x4'));var rp=require(_0xfe8c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xfe8c('0x6'));var attributes=require(_0xfe8c('0x7'));module['exports']=function(_0x55e2ac,_0x2589e2){return _0x55e2ac[_0xfe8c('0x8')]('VoiceMailMessage',attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':'dir','fields':[_0xfe8c('0x9')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 0c32a67..7dc5453 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 _0x5b43=['code','message','info','result','lodash','util','moment','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x7e1a94,_0x23e715){var _0x569427=function(_0x1302cd){while(--_0x1302cd){_0x7e1a94['push'](_0x7e1a94['shift']());}};_0x569427(++_0x23e715);}(_0x5b43,0x1d2));var _0x35b4=function(_0x4a632b,_0x42efb8){_0x4a632b=_0x4a632b-0x0;var _0x1f3690=_0x5b43[_0x4a632b];return _0x1f3690;};'use strict';var _=require(_0x35b4('0x0'));var util=require(_0x35b4('0x1'));var moment=require(_0x35b4('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x35b4('0x3'));var db=require(_0x35b4('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x35b4('0x5'));var config=require(_0x35b4('0x6'));var jayson=require(_0x35b4('0x7'));var client=jayson[_0x35b4('0x8')][_0x35b4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2bdeec,_0x495642,_0x3140ed){return new BPromise(function(_0x11ebde,_0x3be9cb){return client[_0x35b4('0xa')](_0x2bdeec,_0x3140ed)[_0x35b4('0xb')](function(_0x31b67d){logger['info'](_0x35b4('0xc'),_0x495642,_0x35b4('0xd'));logger[_0x35b4('0xe')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x495642,_0x35b4('0xd'),JSON[_0x35b4('0xf')](_0x31b67d));if(_0x31b67d['error']){if(_0x31b67d[_0x35b4('0x10')][_0x35b4('0x11')]===0x1f4){logger[_0x35b4('0x10')]('VoiceMailMessage,\x20%s,\x20%s',_0x495642,_0x31b67d[_0x35b4('0x10')][_0x35b4('0x12')]);return _0x3be9cb(_0x31b67d[_0x35b4('0x10')]['message']);}logger[_0x35b4('0x10')](_0x35b4('0xc'),_0x495642,_0x31b67d[_0x35b4('0x10')][_0x35b4('0x12')]);return _0x11ebde(_0x31b67d['error'][_0x35b4('0x12')]);}else{logger[_0x35b4('0x13')]('VoiceMailMessage,\x20%s,\x20%s',_0x495642,'request\x20sent');_0x11ebde(_0x31b67d[_0x35b4('0x14')][_0x35b4('0x12')]);}})['catch'](function(_0x30b578){logger[_0x35b4('0x10')](_0x35b4('0xc'),_0x495642,_0x30b578);_0x3be9cb(_0x30b578);});});} \ No newline at end of file +var _0x0180=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4d25f3,_0x1e0e07){var _0x418619=function(_0x3bda72){while(--_0x3bda72){_0x4d25f3['push'](_0x4d25f3['shift']());}};_0x418619(++_0x1e0e07);}(_0x0180,0x153));var _0x0018=function(_0xff5d1b,_0x26e89a){_0xff5d1b=_0xff5d1b-0x0;var _0x15350c=_0x0180[_0xff5d1b];return _0x15350c;};'use strict';var _=require(_0x0018('0x0'));var util=require(_0x0018('0x1'));var moment=require(_0x0018('0x2'));var BPromise=require(_0x0018('0x3'));var rs=require(_0x0018('0x4'));var fs=require('fs');var Redis=require(_0x0018('0x5'));var db=require(_0x0018('0x6'))['db'];var utils=require(_0x0018('0x7'));var logger=require(_0x0018('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0018('0x9'));var client=jayson[_0x0018('0xa')][_0x0018('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x291757,_0x4f18e2,_0x267c37){return new BPromise(function(_0x45d9bb,_0x1fdf6b){return client[_0x0018('0xc')](_0x291757,_0x267c37)[_0x0018('0xd')](function(_0x3694df){logger[_0x0018('0xe')](_0x0018('0xf'),_0x4f18e2,_0x0018('0x10'));logger['debug'](_0x0018('0x11'),_0x4f18e2,_0x0018('0x10'),JSON[_0x0018('0x12')](_0x3694df));if(_0x3694df[_0x0018('0x13')]){if(_0x3694df['error'][_0x0018('0x14')]===0x1f4){logger[_0x0018('0x13')](_0x0018('0xf'),_0x4f18e2,_0x3694df[_0x0018('0x13')][_0x0018('0x15')]);return _0x1fdf6b(_0x3694df[_0x0018('0x13')][_0x0018('0x15')]);}logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x4f18e2,_0x3694df[_0x0018('0x13')][_0x0018('0x15')]);return _0x45d9bb(_0x3694df[_0x0018('0x13')][_0x0018('0x15')]);}else{logger[_0x0018('0xe')](_0x0018('0xf'),_0x4f18e2,_0x0018('0x10'));_0x45d9bb(_0x3694df[_0x0018('0x16')][_0x0018('0x15')]);}})[_0x0018('0x17')](function(_0x3bad74){logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x4f18e2,_0x3bad74);_0x1fdf6b(_0x3bad74);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index de12d51..215ead0 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 _0x08b8=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','index','/:id','show','/:id/sounds','getSounds','post','create','addSound','put','delete','removeSound','exports','multer','util','path','express'];(function(_0x9ff8c8,_0x40581b){var _0x58861d=function(_0x5b388e){while(--_0x5b388e){_0x9ff8c8['push'](_0x9ff8c8['shift']());}};_0x58861d(++_0x40581b);}(_0x08b8,0xec));var _0x808b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x08b8[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x808b('0x0'));var util=require(_0x808b('0x1'));var path=require(_0x808b('0x2'));var timeout=require('connect-timeout');var express=require(_0x808b('0x3'));var router=express[_0x808b('0x4')]();var fs_extra=require(_0x808b('0x5'));var auth=require(_0x808b('0x6'));var interaction=require(_0x808b('0x7'));var config=require(_0x808b('0x8'));var controller=require(_0x808b('0x9'));router[_0x808b('0xa')]('/',auth[_0x808b('0xb')](),controller[_0x808b('0xc')]);router['get'](_0x808b('0xd'),auth[_0x808b('0xb')](),controller[_0x808b('0xe')]);router['get'](_0x808b('0xf'),auth[_0x808b('0xb')](),controller[_0x808b('0x10')]);router[_0x808b('0x11')]('/',auth[_0x808b('0xb')](),controller[_0x808b('0x12')]);router[_0x808b('0x11')](_0x808b('0xf'),auth['isAuthenticated'](),controller[_0x808b('0x13')]);router[_0x808b('0x14')](_0x808b('0xd'),auth[_0x808b('0xb')](),controller['update']);router['delete']('/:id',auth[_0x808b('0xb')](),controller['destroy']);router[_0x808b('0x15')]('/:id/sounds/:id2',auth['isAuthenticated'](),controller[_0x808b('0x16')]);module[_0x808b('0x17')]=router; \ No newline at end of file +var _0x964e=['../../config/environment','./voiceMusicOnHold.controller','isAuthenticated','index','get','/:id','show','/:id/sounds','getSounds','post','create','addSound','put','delete','destroy','/:id/sounds/:id2','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x964e,0x198));var _0xe964=function(_0x5e0401,_0x17f423){_0x5e0401=_0x5e0401-0x0;var _0x413578=_0x964e[_0x5e0401];return _0x413578;};'use strict';var multer=require(_0xe964('0x0'));var util=require('util');var path=require(_0xe964('0x1'));var timeout=require(_0xe964('0x2'));var express=require(_0xe964('0x3'));var router=express[_0xe964('0x4')]();var fs_extra=require(_0xe964('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe964('0x6'));var controller=require(_0xe964('0x7'));router['get']('/',auth[_0xe964('0x8')](),controller[_0xe964('0x9')]);router[_0xe964('0xa')](_0xe964('0xb'),auth[_0xe964('0x8')](),controller[_0xe964('0xc')]);router['get'](_0xe964('0xd'),auth[_0xe964('0x8')](),controller[_0xe964('0xe')]);router[_0xe964('0xf')]('/',auth[_0xe964('0x8')](),controller[_0xe964('0x10')]);router['post']('/:id/sounds',auth[_0xe964('0x8')](),controller[_0xe964('0x11')]);router[_0xe964('0x12')](_0xe964('0xb'),auth[_0xe964('0x8')](),controller['update']);router[_0xe964('0x13')](_0xe964('0xb'),auth[_0xe964('0x8')](),controller[_0xe964('0x14')]);router[_0xe964('0x13')](_0xe964('0x15'),auth[_0xe964('0x8')](),controller['removeSound']);module[_0xe964('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 6da9fb3..4a3eeaf 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 _0xfe13=['TIMESTAMP','BOOLEAN','sequelize','STRING','files','mp3nb','quietmp3','alpha'];(function(_0x255b94,_0x352b45){var _0xc5806b=function(_0x530e79){while(--_0x530e79){_0x255b94['push'](_0x255b94['shift']());}};_0xc5806b(++_0x352b45);}(_0xfe13,0xea));var _0x3fe1=function(_0x5bc5fe,_0x2afaef){_0x5bc5fe=_0x5bc5fe-0x0;var _0x298ea7=_0xfe13[_0x5bc5fe];return _0x298ea7;};'use strict';var Sequelize=require(_0x3fe1('0x0'));module['exports']={'name':{'type':Sequelize[_0x3fe1('0x1')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize['ENUM']('custom',_0x3fe1('0x2'),_0x3fe1('0x3'),'quietmp3nb',_0x3fe1('0x4'),'mp3'),'allowNull':!![],'defaultValue':_0x3fe1('0x2')},'directory':{'type':Sequelize[_0x3fe1('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0x3fe1('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0x3fe1('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0x3fe1('0x1')],'allowNull':!![],'defaultValue':_0x3fe1('0x5')},'format':{'type':Sequelize[_0x3fe1('0x1')],'allowNull':!![]},'stamp':{'type':_0x3fe1('0x6')},'defaultEntry':{'type':Sequelize[_0x3fe1('0x7')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa746=['ENUM','files','mp3nb','quietmp3','mp3','alpha','TIMESTAMP','BOOLEAN','exports','STRING','name'];(function(_0x468185,_0x4a1bea){var _0x2727fb=function(_0x5e3d05){while(--_0x5e3d05){_0x468185['push'](_0x468185['shift']());}};_0x2727fb(++_0x4a1bea);}(_0xa746,0x1c0));var _0x6a74=function(_0x21788a,_0x4ced1a){_0x21788a=_0x21788a-0x0;var _0x31dc94=_0xa746[_0x21788a];return _0x31dc94;};'use strict';var Sequelize=require('sequelize');module[_0x6a74('0x0')]={'name':{'type':Sequelize[_0x6a74('0x1')],'allowNull':![],'unique':_0x6a74('0x2')},'mode':{'type':Sequelize[_0x6a74('0x3')]('custom',_0x6a74('0x4'),_0x6a74('0x5'),'quietmp3nb',_0x6a74('0x6'),_0x6a74('0x7')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0x6a74('0x1')],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x6a74('0x8')},'format':{'type':Sequelize[_0x6a74('0x1')],'allowNull':!![]},'stamp':{'type':_0x6a74('0x9')},'defaultEntry':{'type':Sequelize[_0x6a74('0xa')],'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 3115098..20aadc9 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 _0x5e62=['catch','params','keys','length','find','update','body','create','transaction','mode','files','root','mkdirSync','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','directory','readdirSync','unlinkSync','join','ValidationError','message','addSound','sequelize','Sound','findOne','save_name','createdAt','server/files/sounds/converted','format','server/files/moh','%s.%s','converted_format','symlinkSync','Sequelize','removeSound','id2','getSounds','hasOwnProperty','nolimit','eml-format','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','apply','reject','save','then','MusicOnHolds','UserProfileResource','destroy','error','stack','name','send','index','map','VoiceMusicOnHold','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows'];(function(_0x5ccc2b,_0x5852ad){var _0x5f4255=function(_0x34eeb6){while(--_0x34eeb6){_0x5ccc2b['push'](_0x5ccc2b['shift']());}};_0x5f4255(++_0x5852ad);}(_0x5e62,0x101));var _0x25e6=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x5e62[_0x50a0c2];return _0x5ebadd;};'use strict';var emlformat=require(_0x25e6('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x25e6('0x1'));var moment=require(_0x25e6('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x25e6('0x3'));var util=require(_0x25e6('0x4'));var path=require(_0x25e6('0x5'));var sox=require(_0x25e6('0x6'));var csv=require(_0x25e6('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x25e6('0x8'));var _=require(_0x25e6('0x9'));var squel=require(_0x25e6('0xa'));var crypto=require(_0x25e6('0xb'));var jsforce=require(_0x25e6('0xc'));var deskjs=require(_0x25e6('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x25e6('0xe'));var Redis=require(_0x25e6('0xf'));var authService=require(_0x25e6('0x10'));var qs=require(_0x25e6('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x25e6('0x12'));var logger=require('../../config/logger')(_0x25e6('0x13'));var utils=require(_0x25e6('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x25e6('0x15'));var db=require(_0x25e6('0x16'))['db'];function respondWithStatusCode(_0x21474d,_0x1546a6){_0x1546a6=_0x1546a6||0xcc;return function(_0x4d684b){if(_0x4d684b){return _0x21474d[_0x25e6('0x17')](_0x1546a6);}return _0x21474d['status'](_0x1546a6)[_0x25e6('0x18')]();};}function respondWithResult(_0x469f21,_0x4edd79){_0x4edd79=_0x4edd79||0xc8;return function(_0x13f757){if(_0x13f757){return _0x469f21[_0x25e6('0x19')](_0x4edd79)[_0x25e6('0x1a')](_0x13f757);}};}function respondWithFilteredResult(_0x1512f3,_0x25094e){return function(_0x8b5bc9){if(_0x8b5bc9){var _0x77eada=typeof _0x25094e['offset']===_0x25e6('0x1b')&&typeof _0x25094e[_0x25e6('0x1c')]==='undefined';var _0xdcc3c6=_0x8b5bc9['count'];var _0x3a0199=_0x77eada?0x0:_0x25094e[_0x25e6('0x1d')];var _0x2c912f=_0x77eada?_0x8b5bc9[_0x25e6('0x1e')]:_0x25094e['offset']+_0x25094e['limit'];var _0x119902;if(_0x2c912f>=_0xdcc3c6){_0x2c912f=_0xdcc3c6;_0x119902=0xc8;}else{_0x119902=0xce;}_0x1512f3[_0x25e6('0x19')](_0x119902);return _0x1512f3[_0x25e6('0x1f')]('Content-Range',_0x3a0199+'-'+_0x2c912f+'/'+_0xdcc3c6)[_0x25e6('0x1a')](_0x8b5bc9);}return null;};}function patchUpdates(_0x4bfe90){return function(_0x52a7ad){try{jsonpatch[_0x25e6('0x20')](_0x52a7ad,_0x4bfe90,!![]);}catch(_0x988b97){return BPromise[_0x25e6('0x21')](_0x988b97);}return _0x52a7ad[_0x25e6('0x22')]();};}function saveUpdates(_0x4f0178,_0x34e913){return function(_0x5eb25f){if(_0x5eb25f){return _0x5eb25f['update'](_0x4f0178)['then'](function(_0x51942e){return _0x51942e;});}return null;};}function removeEntity(_0x46abc2,_0x417476){return function(_0x2b4b51){if(_0x2b4b51){return _0x2b4b51['destroy']()[_0x25e6('0x23')](function(){var _0x2101aa=_0x2b4b51['get']({'plain':!![]});var _0x582a24=_0x25e6('0x24');return db[_0x25e6('0x25')][_0x25e6('0x26')]({'where':{'type':_0x582a24,'resourceId':_0x2101aa['id']}})[_0x25e6('0x23')](function(){return _0x2b4b51;});})[_0x25e6('0x23')](function(){_0x46abc2[_0x25e6('0x19')](0xcc)[_0x25e6('0x18')]();});}};}function handleEntityNotFound(_0x1c06ef,_0x32eced){return function(_0x529cd7){if(!_0x529cd7){_0x1c06ef[_0x25e6('0x17')](0x194);}return _0x529cd7;};}function handleError(_0x135c0a,_0x465481){_0x465481=_0x465481||0x1f4;return function(_0x102460){logger[_0x25e6('0x27')](_0x102460[_0x25e6('0x28')]);if(_0x102460[_0x25e6('0x29')]){delete _0x102460[_0x25e6('0x29')];}_0x135c0a['status'](_0x465481)[_0x25e6('0x2a')](_0x102460);};}exports[_0x25e6('0x2b')]=function(_0x126c2d,_0x3f74cd){var _0x12e0e7={},_0x307b74={},_0xa01727={'count':0x0,'rows':[]};var _0x111699=_[_0x25e6('0x2c')](db[_0x25e6('0x2d')][_0x25e6('0x2e')],function(_0x1df3e1){return{'name':_0x1df3e1[_0x25e6('0x2f')],'type':_0x1df3e1[_0x25e6('0x30')][_0x25e6('0x31')]};});_0x307b74[_0x25e6('0x32')]=_[_0x25e6('0x2c')](_0x111699,_0x25e6('0x29'));_0x307b74[_0x25e6('0x33')]=_['keys'](_0x126c2d['query']);_0x307b74[_0x25e6('0x34')]=_[_0x25e6('0x35')](_0x307b74[_0x25e6('0x32')],_0x307b74['query']);_0x12e0e7[_0x25e6('0x36')]=_[_0x25e6('0x35')](_0x307b74[_0x25e6('0x32')],qs[_0x25e6('0x37')](_0x126c2d[_0x25e6('0x33')]['fields']));_0x12e0e7['attributes']=_0x12e0e7[_0x25e6('0x36')]['length']?_0x12e0e7['attributes']:_0x307b74[_0x25e6('0x32')];if(!_0x126c2d[_0x25e6('0x33')]['hasOwnProperty']('nolimit')){_0x12e0e7['limit']=qs['limit'](_0x126c2d[_0x25e6('0x33')][_0x25e6('0x1c')]);_0x12e0e7[_0x25e6('0x1d')]=qs['offset'](_0x126c2d[_0x25e6('0x33')][_0x25e6('0x1d')]);}_0x12e0e7[_0x25e6('0x38')]=qs[_0x25e6('0x39')](_0x126c2d[_0x25e6('0x33')]['sort']);delete _0x126c2d[_0x25e6('0x33')][_0x25e6('0x39')];_0x12e0e7[_0x25e6('0x3a')]=qs['filters'](_[_0x25e6('0x3b')](_0x126c2d['query'],_0x307b74[_0x25e6('0x34')]),_0x111699);if(_0x126c2d[_0x25e6('0x33')][_0x25e6('0x3c')]){_0x12e0e7[_0x25e6('0x3a')]=_[_0x25e6('0x3d')](_0x12e0e7[_0x25e6('0x3a')],{'$or':_['map'](_0x111699,function(_0x3c4ab8){if(_0x3c4ab8['type']!==_0x25e6('0x3e')){var _0x28f814={};_0x28f814[_0x3c4ab8['name']]={'$like':'%'+_0x126c2d['query'][_0x25e6('0x3c')]+'%'};return _0x28f814;}})});}_0x12e0e7=_[_0x25e6('0x3d')]({},_0x12e0e7,_0x126c2d[_0x25e6('0x3f')]);var _0x57e93c={'where':_0x12e0e7['where']};return db[_0x25e6('0x2d')][_0x25e6('0x1e')](_0x57e93c)['then'](function(_0x3182b0){_0xa01727[_0x25e6('0x1e')]=_0x3182b0;if(_0x126c2d[_0x25e6('0x33')][_0x25e6('0x40')]){_0x12e0e7[_0x25e6('0x41')]=[{'all':!![]}];}return db[_0x25e6('0x2d')]['findAll'](_0x12e0e7);})['then'](function(_0x15062b){_0xa01727[_0x25e6('0x42')]=_0x15062b;return _0xa01727;})[_0x25e6('0x23')](respondWithFilteredResult(_0x3f74cd,_0x12e0e7))[_0x25e6('0x43')](handleError(_0x3f74cd,null));};exports['show']=function(_0x9f5ed5,_0x5b5f06){var _0x173a08={'raw':![],'where':{'id':_0x9f5ed5[_0x25e6('0x44')]['id']}},_0x57eb8a={};_0x57eb8a[_0x25e6('0x32')]=_[_0x25e6('0x45')](db[_0x25e6('0x2d')][_0x25e6('0x2e')]);_0x57eb8a[_0x25e6('0x33')]=_[_0x25e6('0x45')](_0x9f5ed5[_0x25e6('0x33')]);_0x57eb8a[_0x25e6('0x34')]=_[_0x25e6('0x35')](_0x57eb8a['model'],_0x57eb8a[_0x25e6('0x33')]);_0x173a08[_0x25e6('0x36')]=_[_0x25e6('0x35')](_0x57eb8a[_0x25e6('0x32')],qs[_0x25e6('0x37')](_0x9f5ed5[_0x25e6('0x33')][_0x25e6('0x37')]));_0x173a08['attributes']=_0x173a08[_0x25e6('0x36')][_0x25e6('0x46')]?_0x173a08[_0x25e6('0x36')]:_0x57eb8a[_0x25e6('0x32')];if(_0x9f5ed5[_0x25e6('0x33')][_0x25e6('0x40')]){_0x173a08['include']=[{'all':!![]}];}_0x173a08=_[_0x25e6('0x3d')]({},_0x173a08,_0x9f5ed5['options']);return db[_0x25e6('0x2d')][_0x25e6('0x47')](_0x173a08)[_0x25e6('0x23')](handleEntityNotFound(_0x5b5f06,null))['then'](respondWithResult(_0x5b5f06,null))[_0x25e6('0x43')](handleError(_0x5b5f06,null));};exports[_0x25e6('0x48')]=function(_0x50f3be,_0x7f0447){if(_0x50f3be['body']['id']){delete _0x50f3be[_0x25e6('0x49')]['id'];}return db['VoiceMusicOnHold'][_0x25e6('0x47')]({'where':{'id':_0x50f3be[_0x25e6('0x44')]['id']}})[_0x25e6('0x23')](handleEntityNotFound(_0x7f0447,null))[_0x25e6('0x23')](saveUpdates(_0x50f3be[_0x25e6('0x49')],null))[_0x25e6('0x23')](respondWithResult(_0x7f0447,null))['catch'](handleError(_0x7f0447,null));};exports[_0x25e6('0x4a')]=function(_0x29bf63,_0x35e49a,_0x3276d5){return db['sequelize'][_0x25e6('0x4b')](function(_0x1ae461){if(_0x29bf63[_0x25e6('0x49')][_0x25e6('0x4c')]===_0x25e6('0x4d')){_0x29bf63[_0x25e6('0x49')]['directory']=path['join'](config[_0x25e6('0x4e')],'server/files/moh',_0x29bf63[_0x25e6('0x49')][_0x25e6('0x29')]);}return db[_0x25e6('0x2d')]['create'](_0x29bf63[_0x25e6('0x49')],{'transaction':_0x1ae461})[_0x25e6('0x23')](function(_0x39975a){if(_0x29bf63[_0x25e6('0x49')][_0x25e6('0x4c')]===_0x25e6('0x4d')){fs[_0x25e6('0x4f')](_0x39975a['directory'],parseInt('0777',0x8));}var _0xc70cea=_0x29bf63['user'][_0x25e6('0x50')]({'plain':!![]});if(!_0xc70cea)throw new Error(_0x25e6('0x51'));if(_0xc70cea[_0x25e6('0x52')]==='user'){var _0x3d7628=_0x39975a[_0x25e6('0x50')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x25e6('0x24'),'userProfileId':_0xc70cea['userProfileId']},'raw':!![]})[_0x25e6('0x23')](function(_0x3bdf10){if(_0x3bdf10&&_0x3bdf10['autoAssociation']===0x0){return db[_0x25e6('0x25')][_0x25e6('0x4a')]({'name':_0x3d7628['name'],'resourceId':_0x3d7628['id'],'type':_0x3bdf10[_0x25e6('0x29')],'sectionId':_0x3bdf10['id']},{})[_0x25e6('0x23')](function(){return _0x39975a;});}else{return _0x39975a;}})[_0x25e6('0x43')](function(_0x3c1f30){logger[_0x25e6('0x27')](_0x25e6('0x53'),_0x3c1f30);});}return _0x39975a;});})['then'](respondWithResult(_0x35e49a,0xc9))[_0x25e6('0x43')](handleError(_0x35e49a,null));};exports[_0x25e6('0x26')]=function(_0x45f6be,_0x1d2930,_0x92d43f){var _0xc3eeed;return db[_0x25e6('0x2d')][_0x25e6('0x47')]({'where':{'id':_0x45f6be['params']['id']}})[_0x25e6('0x23')](function(_0x11253a){if(_0x11253a){return db['sequelize'][_0x25e6('0x4b')](function(_0x5bf275){return _0x11253a[_0x25e6('0x26')]({'transaction':_0x5bf275,'raw':!![]})[_0x25e6('0x23')](function(_0x4febcb){if(_0x4febcb[_0x25e6('0x54')]){fs[_0x25e6('0x55')](_0x4febcb['directory'])['forEach'](function(_0x504545){fs[_0x25e6('0x56')](path[_0x25e6('0x57')](_0x4febcb[_0x25e6('0x54')],_0x504545));});fs['rmdirSync'](_0x4febcb['directory']);}return _0x4febcb;});})[_0x25e6('0x43')](function(_0x19f757){throw new db['Sequelize'][(_0x25e6('0x58'))](_0x19f757[_0x25e6('0x59')]);});}})['then'](handleEntityNotFound(_0x1d2930,null))[_0x25e6('0x23')](removeEntity(_0x1d2930,null))[_0x25e6('0x43')](handleError(_0x1d2930,null));};exports[_0x25e6('0x5a')]=function(_0x2edd83,_0x4ff9a1,_0x3b8f9f){return db[_0x25e6('0x5b')][_0x25e6('0x4b')](function(_0x5d3646){var _0x5ed836;return db[_0x25e6('0x2d')][_0x25e6('0x47')]({'where':{'id':_0x2edd83[_0x25e6('0x44')]['id']}})[_0x25e6('0x23')](function(_0x376dd9){if(_0x376dd9){_0x5ed836=_0x376dd9;return _0x376dd9[_0x25e6('0x5a')](_0x2edd83['body']['id'],{'transaction':_0x5d3646});}})[_0x25e6('0x23')](function(_0x4ffee0){if(_0x4ffee0){return db[_0x25e6('0x5c')][_0x25e6('0x5d')]({'where':{'id':_0x2edd83[_0x25e6('0x49')]['id']},'attributes':['id',_0x25e6('0x29'),_0x25e6('0x5e'),'converted_format',_0x25e6('0x5f')],'raw':!![]});}})['then'](function(_0x4ffec6){if(_0x4ffec6){var _0x76267f=path[_0x25e6('0x57')](config[_0x25e6('0x4e')],_0x25e6('0x60'),util[_0x25e6('0x61')]('%s.%s',path['basename'](_0x4ffec6[_0x25e6('0x5e')],path['extname'](_0x4ffec6[_0x25e6('0x5e')])),_0x4ffec6['converted_format']));var _0x557d0c=path[_0x25e6('0x57')](config[_0x25e6('0x4e')],_0x25e6('0x62'),_0x5ed836[_0x25e6('0x29')],util[_0x25e6('0x61')](_0x25e6('0x63'),_0x4ffec6[_0x25e6('0x29')],_0x4ffec6[_0x25e6('0x64')]));fs[_0x25e6('0x65')](_0x76267f,_0x557d0c);return _0x4ffec6;}})['catch'](function(_0x5470ab){throw new db[(_0x25e6('0x66'))]['ValidationError'](_0x5470ab[_0x25e6('0x59')]);});})[_0x25e6('0x23')](handleEntityNotFound(_0x4ff9a1,null))[_0x25e6('0x23')](respondWithResult(_0x4ff9a1,0xc9))['catch'](handleError(_0x4ff9a1,null));};exports[_0x25e6('0x67')]=function(_0x48caf8,_0x1caa03,_0x33b002){return db[_0x25e6('0x5b')][_0x25e6('0x4b')](function(_0x37e1ba){var _0x111893;return db[_0x25e6('0x2d')][_0x25e6('0x5d')]({'where':{'id':_0x48caf8[_0x25e6('0x44')]['id']}})['then'](handleEntityNotFound(_0x1caa03,null))[_0x25e6('0x23')](function(_0x5b416d){if(_0x5b416d){_0x111893=_0x5b416d;return _0x5b416d[_0x25e6('0x67')](_0x48caf8[_0x25e6('0x44')][_0x25e6('0x68')]);}})[_0x25e6('0x23')](function(_0x266de8){if(_0x266de8){return db['Sound'][_0x25e6('0x5d')]({'where':{'id':_0x48caf8[_0x25e6('0x44')][_0x25e6('0x68')]},'attributes':['id',_0x25e6('0x29'),_0x25e6('0x5e'),_0x25e6('0x64'),_0x25e6('0x5f')],'raw':!![]});}})[_0x25e6('0x23')](function(_0x1314e4){if(_0x1314e4){fs[_0x25e6('0x56')](path['join'](_0x111893[_0x25e6('0x54')],util[_0x25e6('0x61')](_0x25e6('0x63'),_0x1314e4[_0x25e6('0x29')],_0x1314e4[_0x25e6('0x64')])));return _0x1314e4;}})[_0x25e6('0x43')](function(_0x455f9a){throw new db[(_0x25e6('0x66'))][(_0x25e6('0x58'))](_0x455f9a['message']);});})[_0x25e6('0x23')](handleEntityNotFound(_0x1caa03,null))[_0x25e6('0x23')](respondWithStatusCode(_0x1caa03,0xcc))[_0x25e6('0x43')](handleError(_0x1caa03,null));};exports['getSounds']=function(_0x462f5d,_0x304256,_0x290962){var _0x1e9073={};var _0x2e3801={};var _0x44b7de;var _0x23677c;return db[_0x25e6('0x2d')][_0x25e6('0x5d')]({'where':{'id':_0x462f5d['params']['id']}})[_0x25e6('0x23')](handleEntityNotFound(_0x304256,null))['then'](function(_0x14d304){if(_0x14d304){_0x44b7de=_0x14d304;_0x2e3801[_0x25e6('0x32')]=_['keys'](db[_0x25e6('0x5c')][_0x25e6('0x2e')]);_0x2e3801[_0x25e6('0x33')]=_['keys'](_0x462f5d[_0x25e6('0x33')]);_0x2e3801[_0x25e6('0x34')]=_['intersection'](_0x2e3801[_0x25e6('0x32')],_0x2e3801['query']);_0x1e9073[_0x25e6('0x36')]=_[_0x25e6('0x35')](_0x2e3801[_0x25e6('0x32')],qs[_0x25e6('0x37')](_0x462f5d[_0x25e6('0x33')][_0x25e6('0x37')]));_0x1e9073[_0x25e6('0x36')]=_0x1e9073[_0x25e6('0x36')][_0x25e6('0x46')]?_0x1e9073[_0x25e6('0x36')]:_0x2e3801[_0x25e6('0x32')];_0x1e9073[_0x25e6('0x38')]=qs[_0x25e6('0x39')](_0x462f5d[_0x25e6('0x33')][_0x25e6('0x39')]);_0x1e9073[_0x25e6('0x3a')]=qs[_0x25e6('0x34')](_[_0x25e6('0x3b')](_0x462f5d[_0x25e6('0x33')],_0x2e3801[_0x25e6('0x34')]));if(_0x462f5d[_0x25e6('0x33')][_0x25e6('0x3c')]){_0x1e9073[_0x25e6('0x3a')]=_['merge'](_0x1e9073[_0x25e6('0x3a')],{'$or':_['map'](_0x1e9073[_0x25e6('0x36')],function(_0x17384f){var _0x248c45={};_0x248c45[_0x17384f]={'$like':'%'+_0x462f5d[_0x25e6('0x33')]['filter']+'%'};return _0x248c45;})});}_0x1e9073=_[_0x25e6('0x3d')]({},_0x1e9073,_0x462f5d[_0x25e6('0x3f')]);return _0x44b7de[_0x25e6('0x69')](_0x1e9073);}})[_0x25e6('0x23')](function(_0x32b3b5){if(_0x32b3b5){_0x23677c=_0x32b3b5['length'];if(!_0x462f5d[_0x25e6('0x33')][_0x25e6('0x6a')](_0x25e6('0x6b'))){_0x1e9073[_0x25e6('0x1c')]=qs['limit'](_0x462f5d['query'][_0x25e6('0x1c')]);_0x1e9073[_0x25e6('0x1d')]=qs['offset'](_0x462f5d[_0x25e6('0x33')][_0x25e6('0x1d')]);}return _0x44b7de[_0x25e6('0x69')](_0x1e9073);}})[_0x25e6('0x23')](function(_0x43361b){if(_0x43361b){return _0x43361b?{'count':_0x23677c,'rows':_0x43361b}:null;}})[_0x25e6('0x23')](respondWithResult(_0x304256,null))[_0x25e6('0x43')](handleError(_0x304256,null));}; \ No newline at end of file +var _0x4134=['sort','where','pick','filter','merge','options','VoiceMusicOnHold','includeAll','include','rows','catch','show','rawAttributes','length','find','body','create','sequelize','transaction','mode','files','directory','root','server/files/moh','mkdirSync','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','error','params','readdirSync','forEach','unlinkSync','join','Sequelize','message','addSound','Sound','converted_format','createdAt','format','basename','extname','save_name','%s.%s','ValidationError','findOne','id2','getSounds','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','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','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','then','get','MusicOnHolds','destroy','sendStatus','stack','name','send','index','map','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit'];(function(_0x5bef43,_0x4d434a){var _0x3417e1=function(_0x109681){while(--_0x109681){_0x5bef43['push'](_0x5bef43['shift']());}};_0x3417e1(++_0x4d434a);}(_0x4134,0x179));var _0x4413=function(_0x4cb772,_0x15a22d){_0x4cb772=_0x4cb772-0x0;var _0x53417f=_0x4134[_0x4cb772];return _0x53417f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4413('0x0'));var zipdir=require(_0x4413('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4413('0x2'));var moment=require(_0x4413('0x3'));var BPromise=require(_0x4413('0x4'));var Mustache=require(_0x4413('0x5'));var util=require(_0x4413('0x6'));var path=require(_0x4413('0x7'));var sox=require(_0x4413('0x8'));var csv=require(_0x4413('0x9'));var ejs=require(_0x4413('0xa'));var fs=require('fs');var fs_extra=require(_0x4413('0xb'));var _=require(_0x4413('0xc'));var squel=require('squel');var crypto=require(_0x4413('0xd'));var jsforce=require(_0x4413('0xe'));var deskjs=require(_0x4413('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4413('0x10'));var Redis=require(_0x4413('0x11'));var authService=require(_0x4413('0x12'));var qs=require(_0x4413('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4413('0x14'));var logger=require(_0x4413('0x15'))('api');var utils=require(_0x4413('0x16'));var config=require(_0x4413('0x17'));var licenseUtil=require(_0x4413('0x18'));var db=require(_0x4413('0x19'))['db'];function respondWithStatusCode(_0x52a61c,_0x136db6){_0x136db6=_0x136db6||0xcc;return function(_0x2dbdc3){if(_0x2dbdc3){return _0x52a61c['sendStatus'](_0x136db6);}return _0x52a61c['status'](_0x136db6)[_0x4413('0x1a')]();};}function respondWithResult(_0x63c204,_0x38e30c){_0x38e30c=_0x38e30c||0xc8;return function(_0xe304c5){if(_0xe304c5){return _0x63c204[_0x4413('0x1b')](_0x38e30c)[_0x4413('0x1c')](_0xe304c5);}};}function respondWithFilteredResult(_0x4b2a65,_0x200fa4){return function(_0x5d5733){if(_0x5d5733){var _0x3ad96f=typeof _0x200fa4[_0x4413('0x1d')]===_0x4413('0x1e')&&typeof _0x200fa4['limit']===_0x4413('0x1e');var _0x3159f2=_0x5d5733[_0x4413('0x1f')];var _0x1f51f0=_0x3ad96f?0x0:_0x200fa4[_0x4413('0x1d')];var _0x58c18f=_0x3ad96f?_0x5d5733[_0x4413('0x1f')]:_0x200fa4[_0x4413('0x1d')]+_0x200fa4[_0x4413('0x20')];var _0x21a2ae;if(_0x58c18f>=_0x3159f2){_0x58c18f=_0x3159f2;_0x21a2ae=0xc8;}else{_0x21a2ae=0xce;}_0x4b2a65[_0x4413('0x1b')](_0x21a2ae);return _0x4b2a65[_0x4413('0x21')](_0x4413('0x22'),_0x1f51f0+'-'+_0x58c18f+'/'+_0x3159f2)[_0x4413('0x1c')](_0x5d5733);}return null;};}function patchUpdates(_0x403794){return function(_0x58d836){try{jsonpatch[_0x4413('0x23')](_0x58d836,_0x403794,!![]);}catch(_0x28a7d8){return BPromise[_0x4413('0x24')](_0x28a7d8);}return _0x58d836['save']();};}function saveUpdates(_0x388f54,_0x213f92){return function(_0x3e13ba){if(_0x3e13ba){return _0x3e13ba['update'](_0x388f54)[_0x4413('0x25')](function(_0xaea888){return _0xaea888;});}return null;};}function removeEntity(_0x37b10,_0x1cbb22){return function(_0x3aead2){if(_0x3aead2){return _0x3aead2['destroy']()['then'](function(){var _0x2b7a0a=_0x3aead2[_0x4413('0x26')]({'plain':!![]});var _0x14756b=_0x4413('0x27');return db['UserProfileResource'][_0x4413('0x28')]({'where':{'type':_0x14756b,'resourceId':_0x2b7a0a['id']}})['then'](function(){return _0x3aead2;});})[_0x4413('0x25')](function(){_0x37b10[_0x4413('0x1b')](0xcc)[_0x4413('0x1a')]();});}};}function handleEntityNotFound(_0x2d18a7,_0x1d243a){return function(_0x43e10b){if(!_0x43e10b){_0x2d18a7[_0x4413('0x29')](0x194);}return _0x43e10b;};}function handleError(_0x2a725a,_0x24e9ef){_0x24e9ef=_0x24e9ef||0x1f4;return function(_0x2b5671){logger['error'](_0x2b5671[_0x4413('0x2a')]);if(_0x2b5671[_0x4413('0x2b')]){delete _0x2b5671[_0x4413('0x2b')];}_0x2a725a[_0x4413('0x1b')](_0x24e9ef)[_0x4413('0x2c')](_0x2b5671);};}exports[_0x4413('0x2d')]=function(_0x469f8c,_0x1f2943){var _0x2ca2fa={},_0x112c5a={},_0x278317={'count':0x0,'rows':[]};var _0x4126b8=_[_0x4413('0x2e')](db['VoiceMusicOnHold']['rawAttributes'],function(_0x295e26){return{'name':_0x295e26[_0x4413('0x2f')],'type':_0x295e26[_0x4413('0x30')][_0x4413('0x31')]};});_0x112c5a['model']=_[_0x4413('0x2e')](_0x4126b8,'name');_0x112c5a['query']=_[_0x4413('0x32')](_0x469f8c[_0x4413('0x33')]);_0x112c5a[_0x4413('0x34')]=_[_0x4413('0x35')](_0x112c5a[_0x4413('0x36')],_0x112c5a[_0x4413('0x33')]);_0x2ca2fa[_0x4413('0x37')]=_[_0x4413('0x35')](_0x112c5a[_0x4413('0x36')],qs[_0x4413('0x38')](_0x469f8c[_0x4413('0x33')][_0x4413('0x38')]));_0x2ca2fa[_0x4413('0x37')]=_0x2ca2fa[_0x4413('0x37')]['length']?_0x2ca2fa[_0x4413('0x37')]:_0x112c5a[_0x4413('0x36')];if(!_0x469f8c[_0x4413('0x33')][_0x4413('0x39')](_0x4413('0x3a'))){_0x2ca2fa['limit']=qs[_0x4413('0x20')](_0x469f8c[_0x4413('0x33')]['limit']);_0x2ca2fa[_0x4413('0x1d')]=qs['offset'](_0x469f8c[_0x4413('0x33')][_0x4413('0x1d')]);}_0x2ca2fa['order']=qs[_0x4413('0x3b')](_0x469f8c[_0x4413('0x33')]['sort']);delete _0x469f8c['query'][_0x4413('0x3b')];_0x2ca2fa[_0x4413('0x3c')]=qs[_0x4413('0x34')](_[_0x4413('0x3d')](_0x469f8c[_0x4413('0x33')],_0x112c5a[_0x4413('0x34')]),_0x4126b8);if(_0x469f8c[_0x4413('0x33')][_0x4413('0x3e')]){_0x2ca2fa[_0x4413('0x3c')]=_[_0x4413('0x3f')](_0x2ca2fa[_0x4413('0x3c')],{'$or':_[_0x4413('0x2e')](_0x4126b8,function(_0x4aed8e){if(_0x4aed8e['type']!=='VIRTUAL'){var _0x15e2e7={};_0x15e2e7[_0x4aed8e[_0x4413('0x2b')]]={'$like':'%'+_0x469f8c[_0x4413('0x33')][_0x4413('0x3e')]+'%'};return _0x15e2e7;}})});}_0x2ca2fa=_['merge']({},_0x2ca2fa,_0x469f8c[_0x4413('0x40')]);var _0x26bfa1={'where':_0x2ca2fa[_0x4413('0x3c')]};return db[_0x4413('0x41')][_0x4413('0x1f')](_0x26bfa1)[_0x4413('0x25')](function(_0x1274a0){_0x278317[_0x4413('0x1f')]=_0x1274a0;if(_0x469f8c[_0x4413('0x33')][_0x4413('0x42')]){_0x2ca2fa[_0x4413('0x43')]=[{'all':!![]}];}return db[_0x4413('0x41')]['findAll'](_0x2ca2fa);})[_0x4413('0x25')](function(_0x5e9ed4){_0x278317[_0x4413('0x44')]=_0x5e9ed4;return _0x278317;})[_0x4413('0x25')](respondWithFilteredResult(_0x1f2943,_0x2ca2fa))[_0x4413('0x45')](handleError(_0x1f2943,null));};exports[_0x4413('0x46')]=function(_0x21e7e0,_0x5d0fad){var _0x52691a={'raw':![],'where':{'id':_0x21e7e0['params']['id']}},_0x3613b6={};_0x3613b6[_0x4413('0x36')]=_[_0x4413('0x32')](db[_0x4413('0x41')][_0x4413('0x47')]);_0x3613b6['query']=_[_0x4413('0x32')](_0x21e7e0[_0x4413('0x33')]);_0x3613b6[_0x4413('0x34')]=_[_0x4413('0x35')](_0x3613b6[_0x4413('0x36')],_0x3613b6[_0x4413('0x33')]);_0x52691a[_0x4413('0x37')]=_[_0x4413('0x35')](_0x3613b6[_0x4413('0x36')],qs[_0x4413('0x38')](_0x21e7e0['query']['fields']));_0x52691a[_0x4413('0x37')]=_0x52691a[_0x4413('0x37')][_0x4413('0x48')]?_0x52691a['attributes']:_0x3613b6['model'];if(_0x21e7e0['query'][_0x4413('0x42')]){_0x52691a['include']=[{'all':!![]}];}_0x52691a=_[_0x4413('0x3f')]({},_0x52691a,_0x21e7e0['options']);return db[_0x4413('0x41')][_0x4413('0x49')](_0x52691a)[_0x4413('0x25')](handleEntityNotFound(_0x5d0fad,null))[_0x4413('0x25')](respondWithResult(_0x5d0fad,null))[_0x4413('0x45')](handleError(_0x5d0fad,null));};exports['update']=function(_0x3ee149,_0x573cb5){if(_0x3ee149[_0x4413('0x4a')]['id']){delete _0x3ee149[_0x4413('0x4a')]['id'];}return db[_0x4413('0x41')][_0x4413('0x49')]({'where':{'id':_0x3ee149['params']['id']}})[_0x4413('0x25')](handleEntityNotFound(_0x573cb5,null))['then'](saveUpdates(_0x3ee149[_0x4413('0x4a')],null))[_0x4413('0x25')](respondWithResult(_0x573cb5,null))[_0x4413('0x45')](handleError(_0x573cb5,null));};exports[_0x4413('0x4b')]=function(_0x431213,_0x3badf1,_0x34ce82){return db[_0x4413('0x4c')][_0x4413('0x4d')](function(_0x34922b){if(_0x431213[_0x4413('0x4a')][_0x4413('0x4e')]===_0x4413('0x4f')){_0x431213[_0x4413('0x4a')][_0x4413('0x50')]=path['join'](config[_0x4413('0x51')],_0x4413('0x52'),_0x431213[_0x4413('0x4a')][_0x4413('0x2b')]);}return db['VoiceMusicOnHold'][_0x4413('0x4b')](_0x431213[_0x4413('0x4a')],{'transaction':_0x34922b})['then'](function(_0x480573){if(_0x431213[_0x4413('0x4a')][_0x4413('0x4e')]==='files'){fs[_0x4413('0x53')](_0x480573['directory'],parseInt(_0x4413('0x54'),0x8));}var _0x3d0cc4=_0x431213[_0x4413('0x55')][_0x4413('0x26')]({'plain':!![]});if(!_0x3d0cc4)throw new Error(_0x4413('0x56'));if(_0x3d0cc4['role']===_0x4413('0x55')){var _0x10adb0=_0x480573[_0x4413('0x26')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x4413('0x27'),'userProfileId':_0x3d0cc4[_0x4413('0x57')]},'raw':!![]})['then'](function(_0x1ae0f3){if(_0x1ae0f3&&_0x1ae0f3['autoAssociation']===0x0){return db['UserProfileResource'][_0x4413('0x4b')]({'name':_0x10adb0[_0x4413('0x2b')],'resourceId':_0x10adb0['id'],'type':_0x1ae0f3[_0x4413('0x2b')],'sectionId':_0x1ae0f3['id']},{})[_0x4413('0x25')](function(){return _0x480573;});}else{return _0x480573;}})[_0x4413('0x45')](function(_0x590697){logger[_0x4413('0x58')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x590697);});}return _0x480573;});})['then'](respondWithResult(_0x3badf1,0xc9))[_0x4413('0x45')](handleError(_0x3badf1,null));};exports['destroy']=function(_0x578088,_0x434c02,_0x1111e4){var _0x1aa44f;return db['VoiceMusicOnHold'][_0x4413('0x49')]({'where':{'id':_0x578088[_0x4413('0x59')]['id']}})[_0x4413('0x25')](function(_0x11d31f){if(_0x11d31f){return db[_0x4413('0x4c')][_0x4413('0x4d')](function(_0x35771f){return _0x11d31f[_0x4413('0x28')]({'transaction':_0x35771f,'raw':!![]})[_0x4413('0x25')](function(_0x1cca94){if(_0x1cca94[_0x4413('0x50')]){fs[_0x4413('0x5a')](_0x1cca94[_0x4413('0x50')])[_0x4413('0x5b')](function(_0x25430d){fs[_0x4413('0x5c')](path[_0x4413('0x5d')](_0x1cca94[_0x4413('0x50')],_0x25430d));});fs['rmdirSync'](_0x1cca94[_0x4413('0x50')]);}return _0x1cca94;});})[_0x4413('0x45')](function(_0x583da0){throw new db[(_0x4413('0x5e'))]['ValidationError'](_0x583da0[_0x4413('0x5f')]);});}})[_0x4413('0x25')](handleEntityNotFound(_0x434c02,null))['then'](removeEntity(_0x434c02,null))[_0x4413('0x45')](handleError(_0x434c02,null));};exports[_0x4413('0x60')]=function(_0x171211,_0x4fafc3,_0x4833be){return db[_0x4413('0x4c')][_0x4413('0x4d')](function(_0x49d87b){var _0x38551d;return db['VoiceMusicOnHold'][_0x4413('0x49')]({'where':{'id':_0x171211[_0x4413('0x59')]['id']}})[_0x4413('0x25')](function(_0xce746b){if(_0xce746b){_0x38551d=_0xce746b;return _0xce746b['addSound'](_0x171211[_0x4413('0x4a')]['id'],{'transaction':_0x49d87b});}})['then'](function(_0x3d2930){if(_0x3d2930){return db[_0x4413('0x61')]['findOne']({'where':{'id':_0x171211['body']['id']},'attributes':['id',_0x4413('0x2b'),'save_name',_0x4413('0x62'),_0x4413('0x63')],'raw':!![]});}})[_0x4413('0x25')](function(_0x52ff14){if(_0x52ff14){var _0x3bffc2=path[_0x4413('0x5d')](config[_0x4413('0x51')],'server/files/sounds/converted',util[_0x4413('0x64')]('%s.%s',path[_0x4413('0x65')](_0x52ff14['save_name'],path[_0x4413('0x66')](_0x52ff14[_0x4413('0x67')])),_0x52ff14[_0x4413('0x62')]));var _0x1ff9cd=path[_0x4413('0x5d')](config['root'],_0x4413('0x52'),_0x38551d['name'],util[_0x4413('0x64')](_0x4413('0x68'),_0x52ff14[_0x4413('0x2b')],_0x52ff14[_0x4413('0x62')]));fs['symlinkSync'](_0x3bffc2,_0x1ff9cd);return _0x52ff14;}})[_0x4413('0x45')](function(_0x5c8497){throw new db['Sequelize'][(_0x4413('0x69'))](_0x5c8497[_0x4413('0x5f')]);});})[_0x4413('0x25')](handleEntityNotFound(_0x4fafc3,null))[_0x4413('0x25')](respondWithResult(_0x4fafc3,0xc9))['catch'](handleError(_0x4fafc3,null));};exports['removeSound']=function(_0x2a1bb0,_0x20a213,_0x1b4424){return db[_0x4413('0x4c')]['transaction'](function(_0x215627){var _0x2ba5e7;return db[_0x4413('0x41')][_0x4413('0x6a')]({'where':{'id':_0x2a1bb0[_0x4413('0x59')]['id']}})[_0x4413('0x25')](handleEntityNotFound(_0x20a213,null))[_0x4413('0x25')](function(_0x3a7b93){if(_0x3a7b93){_0x2ba5e7=_0x3a7b93;return _0x3a7b93['removeSound'](_0x2a1bb0[_0x4413('0x59')][_0x4413('0x6b')]);}})[_0x4413('0x25')](function(_0xb35b78){if(_0xb35b78){return db[_0x4413('0x61')][_0x4413('0x6a')]({'where':{'id':_0x2a1bb0[_0x4413('0x59')][_0x4413('0x6b')]},'attributes':['id',_0x4413('0x2b'),'save_name','converted_format',_0x4413('0x63')],'raw':!![]});}})[_0x4413('0x25')](function(_0x2a0f04){if(_0x2a0f04){fs[_0x4413('0x5c')](path[_0x4413('0x5d')](_0x2ba5e7[_0x4413('0x50')],util[_0x4413('0x64')](_0x4413('0x68'),_0x2a0f04[_0x4413('0x2b')],_0x2a0f04['converted_format'])));return _0x2a0f04;}})[_0x4413('0x45')](function(_0x2e161d){throw new db[(_0x4413('0x5e'))][(_0x4413('0x69'))](_0x2e161d[_0x4413('0x5f')]);});})[_0x4413('0x25')](handleEntityNotFound(_0x20a213,null))[_0x4413('0x25')](respondWithStatusCode(_0x20a213,0xcc))[_0x4413('0x45')](handleError(_0x20a213,null));};exports['getSounds']=function(_0x50c709,_0x1eea34,_0x496f92){var _0x4c6f37={};var _0x4da2c1={};var _0x9a2f2;var _0x443070;return db[_0x4413('0x41')]['findOne']({'where':{'id':_0x50c709[_0x4413('0x59')]['id']}})[_0x4413('0x25')](handleEntityNotFound(_0x1eea34,null))[_0x4413('0x25')](function(_0x591ee0){if(_0x591ee0){_0x9a2f2=_0x591ee0;_0x4da2c1[_0x4413('0x36')]=_['keys'](db['Sound'][_0x4413('0x47')]);_0x4da2c1[_0x4413('0x33')]=_['keys'](_0x50c709[_0x4413('0x33')]);_0x4da2c1[_0x4413('0x34')]=_[_0x4413('0x35')](_0x4da2c1[_0x4413('0x36')],_0x4da2c1['query']);_0x4c6f37[_0x4413('0x37')]=_['intersection'](_0x4da2c1[_0x4413('0x36')],qs[_0x4413('0x38')](_0x50c709[_0x4413('0x33')][_0x4413('0x38')]));_0x4c6f37[_0x4413('0x37')]=_0x4c6f37[_0x4413('0x37')][_0x4413('0x48')]?_0x4c6f37[_0x4413('0x37')]:_0x4da2c1[_0x4413('0x36')];_0x4c6f37['order']=qs[_0x4413('0x3b')](_0x50c709['query'][_0x4413('0x3b')]);_0x4c6f37[_0x4413('0x3c')]=qs['filters'](_[_0x4413('0x3d')](_0x50c709[_0x4413('0x33')],_0x4da2c1[_0x4413('0x34')]));if(_0x50c709[_0x4413('0x33')][_0x4413('0x3e')]){_0x4c6f37[_0x4413('0x3c')]=_[_0x4413('0x3f')](_0x4c6f37['where'],{'$or':_[_0x4413('0x2e')](_0x4c6f37['attributes'],function(_0x5ca73c){var _0x19e882={};_0x19e882[_0x5ca73c]={'$like':'%'+_0x50c709[_0x4413('0x33')][_0x4413('0x3e')]+'%'};return _0x19e882;})});}_0x4c6f37=_[_0x4413('0x3f')]({},_0x4c6f37,_0x50c709[_0x4413('0x40')]);return _0x9a2f2['getSounds'](_0x4c6f37);}})[_0x4413('0x25')](function(_0x20f8f4){if(_0x20f8f4){_0x443070=_0x20f8f4[_0x4413('0x48')];if(!_0x50c709[_0x4413('0x33')][_0x4413('0x39')]('nolimit')){_0x4c6f37['limit']=qs[_0x4413('0x20')](_0x50c709[_0x4413('0x33')][_0x4413('0x20')]);_0x4c6f37['offset']=qs[_0x4413('0x1d')](_0x50c709[_0x4413('0x33')]['offset']);}return _0x9a2f2[_0x4413('0x6c')](_0x4c6f37);}})[_0x4413('0x25')](function(_0x5decd0){if(_0x5decd0){return _0x5decd0?{'count':_0x443070,'rows':_0x5decd0}:null;}})[_0x4413('0x25')](respondWithResult(_0x1eea34,null))[_0x4413('0x45')](handleError(_0x1eea34,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index c82b2f9..1092e18 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 _0xc97c=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','exports','define','voice_musiconhold'];(function(_0x149bf0,_0x50654c){var _0x5c3302=function(_0x3a270f){while(--_0x3a270f){_0x149bf0['push'](_0x149bf0['shift']());}};_0x5c3302(++_0x50654c);}(_0xc97c,0x96));var _0xcc97=function(_0x1fdf9e,_0x3da833){_0x1fdf9e=_0x1fdf9e-0x0;var _0x5140ab=_0xc97c[_0x1fdf9e];return _0x5140ab;};'use strict';var _=require('lodash');var util=require(_0xcc97('0x0'));var logger=require(_0xcc97('0x1'))(_0xcc97('0x2'));var moment=require('moment');var BPromise=require(_0xcc97('0x3'));var rp=require(_0xcc97('0x4'));var fs=require('fs');var path=require(_0xcc97('0x5'));var rimraf=require(_0xcc97('0x6'));var config=require('../../config/environment');var attributes=require('./voiceMusicOnHold.attributes');module[_0xcc97('0x7')]=function(_0x1da645,_0x4f9bf3){return _0x1da645[_0xcc97('0x8')]('VoiceMusicOnHold',attributes,{'tableName':_0xcc97('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeca6=['VoiceMusicOnHold','voice_musiconhold','lodash','util','../../config/logger','request-promise','path','rimraf','define'];(function(_0x3df7b8,_0x55db91){var _0x16f05d=function(_0x5501c8){while(--_0x5501c8){_0x3df7b8['push'](_0x3df7b8['shift']());}};_0x16f05d(++_0x55db91);}(_0xeca6,0xf5));var _0x6eca=function(_0x22be82,_0x4c5800){_0x22be82=_0x22be82-0x0;var _0x4a73f1=_0xeca6[_0x22be82];return _0x4a73f1;};'use strict';var _=require(_0x6eca('0x0'));var util=require(_0x6eca('0x1'));var logger=require(_0x6eca('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6eca('0x3'));var fs=require('fs');var path=require(_0x6eca('0x4'));var rimraf=require(_0x6eca('0x5'));var config=require('../../config/environment');var attributes=require('./voiceMusicOnHold.attributes');module['exports']=function(_0x4655fb,_0x18732e){return _0x4655fb[_0x6eca('0x6')](_0x6eca('0x7'),attributes,{'tableName':_0x6eca('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index e874eb4..a799aa8 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 _0xe706=['http','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3f66dd,_0x4f5cb5){var _0x459b7a=function(_0x544442){while(--_0x544442){_0x3f66dd['push'](_0x3f66dd['shift']());}};_0x459b7a(++_0x4f5cb5);}(_0xe706,0xa3));var _0x6e70=function(_0x3a3afe,_0x15da25){_0x3a3afe=_0x3a3afe-0x0;var _0x262dab=_0xe706[_0x3a3afe];return _0x262dab;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});} \ No newline at end of file +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(_0xe442f9,_0x4e7678){var _0x1df6d1=function(_0x560ada){while(--_0x560ada){_0xe442f9['push'](_0xe442f9['shift']());}};_0x1df6d1(++_0x4e7678);}(_0x9c44,0x178));var _0x49c4=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0x9c44[_0x17b6e3];return _0x3906f3;};'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 diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index db21b87..793983e 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 _0x67cb=['isAuthenticated','index','get','/describe','describe','/:id/users','addAgents','put','/:id','delete','removeAgents','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2c3e3a,_0x1777ba){var _0x1b77a1=function(_0x183762){while(--_0x183762){_0x2c3e3a['push'](_0x2c3e3a['shift']());}};_0x1b77a1(++_0x1777ba);}(_0x67cb,0x84));var _0xb67c=function(_0x4b4f24,_0x5654a8){_0x4b4f24=_0x4b4f24-0x0;var _0x1c13d4=_0x67cb[_0x4b4f24];return _0x1c13d4;};'use strict';var multer=require(_0xb67c('0x0'));var util=require(_0xb67c('0x1'));var path=require(_0xb67c('0x2'));var timeout=require(_0xb67c('0x3'));var express=require(_0xb67c('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb67c('0x5'));var interaction=require(_0xb67c('0x6'));var config=require(_0xb67c('0x7'));var controller=require('./voicePrefix.controller');router['get']('/',auth[_0xb67c('0x8')](),controller[_0xb67c('0x9')]);router[_0xb67c('0xa')](_0xb67c('0xb'),auth['isAuthenticated'](),controller[_0xb67c('0xc')]);router[_0xb67c('0xa')]('/:id',auth[_0xb67c('0x8')](),controller['show']);router[_0xb67c('0xa')](_0xb67c('0xd'),auth[_0xb67c('0x8')](),controller['getAgents']);router['post']('/',auth[_0xb67c('0x8')](),controller['create']);router['post'](_0xb67c('0xd'),auth[_0xb67c('0x8')](),controller[_0xb67c('0xe')]);router[_0xb67c('0xf')](_0xb67c('0x10'),auth[_0xb67c('0x8')](),controller['update']);router[_0xb67c('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);router['delete'](_0xb67c('0xd'),auth[_0xb67c('0x8')](),controller[_0xb67c('0x12')]);module[_0xb67c('0x13')]=router; \ No newline at end of file +var _0x2f67=['delete','destroy','removeAgents','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./voicePrefix.controller','get','index','/describe','/:id','show','getAgents','isAuthenticated','create','post','/:id/users','addAgents','put','update'];(function(_0x180c9b,_0x13d173){var _0x3ff116=function(_0x241982){while(--_0x241982){_0x180c9b['push'](_0x180c9b['shift']());}};_0x3ff116(++_0x13d173);}(_0x2f67,0x1cc));var _0x72f6=function(_0x527823,_0x3169b0){_0x527823=_0x527823-0x0;var _0x1bde99=_0x2f67[_0x527823];return _0x1bde99;};'use strict';var multer=require(_0x72f6('0x0'));var util=require('util');var path=require(_0x72f6('0x1'));var timeout=require(_0x72f6('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x72f6('0x3'));var auth=require(_0x72f6('0x4'));var interaction=require(_0x72f6('0x5'));var config=require('../../config/environment');var controller=require(_0x72f6('0x6'));router[_0x72f6('0x7')]('/',auth['isAuthenticated'](),controller[_0x72f6('0x8')]);router['get'](_0x72f6('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x72f6('0x7')](_0x72f6('0xa'),auth['isAuthenticated'](),controller[_0x72f6('0xb')]);router[_0x72f6('0x7')]('/:id/users',auth['isAuthenticated'](),controller[_0x72f6('0xc')]);router['post']('/',auth[_0x72f6('0xd')](),controller[_0x72f6('0xe')]);router[_0x72f6('0xf')](_0x72f6('0x10'),auth['isAuthenticated'](),controller[_0x72f6('0x11')]);router[_0x72f6('0x12')]('/:id',auth[_0x72f6('0xd')](),controller[_0x72f6('0x13')]);router[_0x72f6('0x14')]('/:id',auth[_0x72f6('0xd')](),controller[_0x72f6('0x15')]);router['delete']('/:id/users',auth[_0x72f6('0xd')](),controller[_0x72f6('0x16')]);module[_0x72f6('0x17')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 10a3aee..6c0c09a 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 _0x0a59=['system-','getDataValue','STRING','INTEGER','sequelize','exports','name','VIRTUAL'];(function(_0x2edfae,_0x723cc0){var _0x37d6b9=function(_0x4519ea){while(--_0x4519ea){_0x2edfae['push'](_0x2edfae['shift']());}};_0x37d6b9(++_0x723cc0);}(_0x0a59,0x6c));var _0x90a5=function(_0x55e2d7,_0x327be8){_0x55e2d7=_0x55e2d7-0x0;var _0xdacfd4=_0x0a59[_0x55e2d7];return _0xdacfd4;};'use strict';var Sequelize=require(_0x90a5('0x0'));module[_0x90a5('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x90a5('0x2')},'prefix':{'type':Sequelize[_0x90a5('0x3')],'get':function(_0x21afd0){return _0x90a5('0x4')+this[_0x90a5('0x5')](_0x90a5('0x2'))+'-';}},'description':{'type':Sequelize[_0x90a5('0x6')]},'callerIdAll':{'type':Sequelize[_0x90a5('0x6')]},'VoiceExtensionId':{'type':Sequelize[_0x90a5('0x7')]}}; \ No newline at end of file +var _0xb34c=['system-','getDataValue','STRING','sequelize','exports','name'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb34c,0x1ef));var _0xcb34=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xb34c[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require(_0xcb34('0x0'));module[_0xcb34('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xcb34('0x2')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x3f0a10){return _0xcb34('0x3')+this[_0xcb34('0x4')](_0xcb34('0x2'))+'-';}},'description':{'type':Sequelize[_0xcb34('0x5')]},'callerIdAll':{'type':Sequelize[_0xcb34('0x5')]},'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 232ed8c..9359c3f 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 _0x6f24=['squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','end','json','undefined','offset','count','limit','set','apply','reject','save','update','then','destroy','VoicePrefixes','error','stack','name','send','index','map','VoicePrefix','fieldName','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','rawAttributes','length','find','describe','create','sequelize','transaction','body','get','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','app','system','description','Voice\x20Prefix\x20Extension','priority','appdata','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','prefix','Set','CDR(prefix)=','callerIdAll','push','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','${EXTEN:','charAt','system-','findById','addAgents','ids','omit','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','User','sort','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra'];(function(_0x204228,_0x7e2c08){var _0x2d4343=function(_0x25c373){while(--_0x25c373){_0x204228['push'](_0x204228['shift']());}};_0x2d4343(++_0x7e2c08);}(_0x6f24,0x76));var _0x46f2=function(_0x45ce08,_0x59dcc7){_0x45ce08=_0x45ce08-0x0;var _0x23dff2=_0x6f24[_0x45ce08];return _0x23dff2;};'use strict';var emlformat=require(_0x46f2('0x0'));var rimraf=require(_0x46f2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x46f2('0x2'));var rp=require(_0x46f2('0x3'));var moment=require(_0x46f2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x46f2('0x5'));var util=require('util');var path=require(_0x46f2('0x6'));var sox=require(_0x46f2('0x7'));var csv=require(_0x46f2('0x8'));var ejs=require(_0x46f2('0x9'));var fs=require('fs');var fs_extra=require(_0x46f2('0xa'));var _=require('lodash');var squel=require(_0x46f2('0xb'));var crypto=require(_0x46f2('0xc'));var jsforce=require(_0x46f2('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x46f2('0x8'));var querystring=require(_0x46f2('0xe'));var Papa=require(_0x46f2('0xf'));var Redis=require(_0x46f2('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x46f2('0x11'));var hardwareService=require(_0x46f2('0x12'));var logger=require(_0x46f2('0x13'))(_0x46f2('0x14'));var utils=require('../../config/utils');var config=require(_0x46f2('0x15'));var licenseUtil=require(_0x46f2('0x16'));var db=require(_0x46f2('0x17'))['db'];config[_0x46f2('0x18')]=_['defaults'](config[_0x46f2('0x18')],{'host':_0x46f2('0x19'),'port':0x18eb});var socket=require(_0x46f2('0x1a'))(new Redis(config[_0x46f2('0x18')]));require(_0x46f2('0x1b'))[_0x46f2('0x1c')](socket);function respondWithStatusCode(_0x43544d,_0x3134bd){_0x3134bd=_0x3134bd||0xcc;return function(_0x44acf7){if(_0x44acf7){return _0x43544d[_0x46f2('0x1d')](_0x3134bd);}return _0x43544d[_0x46f2('0x1e')](_0x3134bd)[_0x46f2('0x1f')]();};}function respondWithResult(_0x11ae0e,_0x5c885d){_0x5c885d=_0x5c885d||0xc8;return function(_0x29a312){if(_0x29a312){return _0x11ae0e[_0x46f2('0x1e')](_0x5c885d)[_0x46f2('0x20')](_0x29a312);}};}function respondWithFilteredResult(_0x3361ea,_0x29d51a){return function(_0x2f3f17){if(_0x2f3f17){var _0x32ea6c=typeof _0x29d51a['offset']===_0x46f2('0x21')&&typeof _0x29d51a['limit']===_0x46f2('0x21');var _0x9587e2=_0x2f3f17['count'];var _0x5970a1=_0x32ea6c?0x0:_0x29d51a[_0x46f2('0x22')];var _0x1fac0d=_0x32ea6c?_0x2f3f17[_0x46f2('0x23')]:_0x29d51a[_0x46f2('0x22')]+_0x29d51a[_0x46f2('0x24')];var _0x2c2f24;if(_0x1fac0d>=_0x9587e2){_0x1fac0d=_0x9587e2;_0x2c2f24=0xc8;}else{_0x2c2f24=0xce;}_0x3361ea['status'](_0x2c2f24);return _0x3361ea[_0x46f2('0x25')]('Content-Range',_0x5970a1+'-'+_0x1fac0d+'/'+_0x9587e2)[_0x46f2('0x20')](_0x2f3f17);}return null;};}function patchUpdates(_0x593c6f){return function(_0x2317e7){try{jsonpatch[_0x46f2('0x26')](_0x2317e7,_0x593c6f,!![]);}catch(_0x2790f6){return BPromise[_0x46f2('0x27')](_0x2790f6);}return _0x2317e7[_0x46f2('0x28')]();};}function saveUpdates(_0x8f9939,_0x4d2d7c){return function(_0x3a2667){if(_0x3a2667){return _0x3a2667[_0x46f2('0x29')](_0x8f9939)[_0x46f2('0x2a')](function(_0x111e29){return _0x111e29;});}return null;};}function removeEntity(_0x519d27,_0x3017c9){return function(_0x35335c){if(_0x35335c){return _0x35335c[_0x46f2('0x2b')]()['then'](function(){var _0x3f8cfc=_0x35335c['get']({'plain':!![]});var _0x5807d9=_0x46f2('0x2c');return db['UserProfileResource'][_0x46f2('0x2b')]({'where':{'type':_0x5807d9,'resourceId':_0x3f8cfc['id']}})[_0x46f2('0x2a')](function(){return _0x35335c;});})['then'](function(){_0x519d27['status'](0xcc)[_0x46f2('0x1f')]();});}};}function handleEntityNotFound(_0x1d6f31,_0xcf2258){return function(_0x4b42c2){if(!_0x4b42c2){_0x1d6f31[_0x46f2('0x1d')](0x194);}return _0x4b42c2;};}function handleError(_0x5b542b,_0x2e2910){_0x2e2910=_0x2e2910||0x1f4;return function(_0x58a95b){logger[_0x46f2('0x2d')](_0x58a95b[_0x46f2('0x2e')]);if(_0x58a95b[_0x46f2('0x2f')]){delete _0x58a95b[_0x46f2('0x2f')];}_0x5b542b[_0x46f2('0x1e')](_0x2e2910)[_0x46f2('0x30')](_0x58a95b);};}exports[_0x46f2('0x31')]=function(_0x14fcc7,_0xf1b6ec){var _0x5ef16f={},_0x4ad380={},_0x1971a5={'count':0x0,'rows':[]};var _0x434ba2=_[_0x46f2('0x32')](db[_0x46f2('0x33')]['rawAttributes'],function(_0x441977){return{'name':_0x441977[_0x46f2('0x34')],'type':_0x441977[_0x46f2('0x35')]['key']};});_0x4ad380[_0x46f2('0x36')]=_[_0x46f2('0x32')](_0x434ba2,'name');_0x4ad380[_0x46f2('0x37')]=_[_0x46f2('0x38')](_0x14fcc7[_0x46f2('0x37')]);_0x4ad380[_0x46f2('0x39')]=_['intersection'](_0x4ad380[_0x46f2('0x36')],_0x4ad380[_0x46f2('0x37')]);_0x5ef16f[_0x46f2('0x3a')]=_[_0x46f2('0x3b')](_0x4ad380[_0x46f2('0x36')],qs[_0x46f2('0x3c')](_0x14fcc7['query']['fields']));_0x5ef16f[_0x46f2('0x3a')]=_0x5ef16f['attributes']['length']?_0x5ef16f[_0x46f2('0x3a')]:_0x4ad380[_0x46f2('0x36')];if(!_0x14fcc7['query'][_0x46f2('0x3d')](_0x46f2('0x3e'))){_0x5ef16f['limit']=qs[_0x46f2('0x24')](_0x14fcc7['query'][_0x46f2('0x24')]);_0x5ef16f[_0x46f2('0x22')]=qs[_0x46f2('0x22')](_0x14fcc7[_0x46f2('0x37')][_0x46f2('0x22')]);}_0x5ef16f[_0x46f2('0x3f')]=qs['sort'](_0x14fcc7['query']['sort']);_0x5ef16f[_0x46f2('0x40')]=qs[_0x46f2('0x39')](_[_0x46f2('0x41')](_0x14fcc7[_0x46f2('0x37')],_0x4ad380['filters']),_0x434ba2);if(_0x14fcc7[_0x46f2('0x37')][_0x46f2('0x42')]){_0x5ef16f[_0x46f2('0x40')]=_[_0x46f2('0x43')](_0x5ef16f['where'],{'$or':_['map'](_0x434ba2,function(_0x2b160f){if(_0x2b160f[_0x46f2('0x35')]!==_0x46f2('0x44')){var _0x1589ed={};_0x1589ed[_0x2b160f[_0x46f2('0x2f')]]={'$like':'%'+_0x14fcc7[_0x46f2('0x37')][_0x46f2('0x42')]+'%'};return _0x1589ed;}})});}_0x5ef16f=_[_0x46f2('0x43')]({},_0x5ef16f,_0x14fcc7[_0x46f2('0x45')]);var _0x2b0768={'where':_0x5ef16f[_0x46f2('0x40')]};return db[_0x46f2('0x33')][_0x46f2('0x23')](_0x2b0768)['then'](function(_0x2340fc){_0x1971a5[_0x46f2('0x23')]=_0x2340fc;if(_0x14fcc7[_0x46f2('0x37')]['includeAll']){_0x5ef16f[_0x46f2('0x46')]=[{'all':!![]}];}return db[_0x46f2('0x33')][_0x46f2('0x47')](_0x5ef16f);})[_0x46f2('0x2a')](function(_0x3705ac){_0x1971a5['rows']=_0x3705ac;return _0x1971a5;})['then'](respondWithFilteredResult(_0xf1b6ec,_0x5ef16f))[_0x46f2('0x48')](handleError(_0xf1b6ec,null));};exports[_0x46f2('0x49')]=function(_0x643669,_0x45ec17){var _0x2bc3b8={'raw':![],'where':{'id':_0x643669[_0x46f2('0x4a')]['id']}},_0x1d90f1={};_0x1d90f1[_0x46f2('0x36')]=_[_0x46f2('0x38')](db[_0x46f2('0x33')][_0x46f2('0x4b')]);_0x1d90f1[_0x46f2('0x37')]=_[_0x46f2('0x38')](_0x643669[_0x46f2('0x37')]);_0x1d90f1[_0x46f2('0x39')]=_['intersection'](_0x1d90f1[_0x46f2('0x36')],_0x1d90f1[_0x46f2('0x37')]);_0x2bc3b8[_0x46f2('0x3a')]=_[_0x46f2('0x3b')](_0x1d90f1['model'],qs[_0x46f2('0x3c')](_0x643669['query'][_0x46f2('0x3c')]));_0x2bc3b8[_0x46f2('0x3a')]=_0x2bc3b8[_0x46f2('0x3a')][_0x46f2('0x4c')]?_0x2bc3b8[_0x46f2('0x3a')]:_0x1d90f1[_0x46f2('0x36')];if(_0x643669[_0x46f2('0x37')]['includeAll']){_0x2bc3b8[_0x46f2('0x46')]=[{'all':!![]}];}_0x2bc3b8=_['merge']({},_0x2bc3b8,_0x643669[_0x46f2('0x45')]);return db[_0x46f2('0x33')][_0x46f2('0x4d')](_0x2bc3b8)[_0x46f2('0x2a')](handleEntityNotFound(_0x45ec17,null))['then'](respondWithResult(_0x45ec17,null))['catch'](handleError(_0x45ec17,null));};exports[_0x46f2('0x2b')]=function(_0x5cbe41,_0x515e31){return db[_0x46f2('0x33')][_0x46f2('0x4d')]({'where':{'id':_0x5cbe41[_0x46f2('0x4a')]['id']}})['then'](handleEntityNotFound(_0x515e31,null))[_0x46f2('0x2a')](removeEntity(_0x515e31,null))[_0x46f2('0x48')](handleError(_0x515e31,null));};exports[_0x46f2('0x4e')]=function(_0x14839d,_0x237283){return db[_0x46f2('0x33')][_0x46f2('0x4e')]()[_0x46f2('0x2a')](respondWithResult(_0x237283,null))[_0x46f2('0x48')](handleError(_0x237283,null));};exports[_0x46f2('0x4f')]=function(_0x386f95,_0x1008ea){var _0x5d7542;return db[_0x46f2('0x50')][_0x46f2('0x51')](function(_0x4a813d){return db['VoicePrefix'][_0x46f2('0x4f')](_0x386f95[_0x46f2('0x52')],{'transaction':_0x4a813d})['then'](function(_0xfa6475){_0x5d7542=_0xfa6475[_0x46f2('0x53')]({'plain':!![]});return db[_0x46f2('0x54')][_0x46f2('0x4d')]({'where':{'id':_0x5d7542[_0x46f2('0x55')]},'raw':!![]})['then'](function(_0x46e052){return createVoicePrefixExtensions(_0x5d7542,_0x46e052,_0x4a813d);});});})[_0x46f2('0x2a')](function(){var _0x42141b=_0x386f95[_0x46f2('0x56')][_0x46f2('0x53')]({'plain':!![]});if(!_0x42141b)throw new Error(_0x46f2('0x57'));if(_0x42141b['role']==='user'){var _0x3c8fe7=_0x5d7542;return db[_0x46f2('0x58')]['find']({'where':{'name':_0x46f2('0x2c'),'userProfileId':_0x42141b['userProfileId']},'raw':!![]})[_0x46f2('0x2a')](function(_0x2549de){if(_0x2549de&&_0x2549de[_0x46f2('0x59')]===0x0){return db[_0x46f2('0x5a')][_0x46f2('0x4f')]({'name':_0x3c8fe7[_0x46f2('0x2f')],'resourceId':_0x3c8fe7['id'],'type':_0x2549de['name'],'sectionId':_0x2549de['id']},{})[_0x46f2('0x2a')](function(){return _0x5d7542;});}else{return _0x5d7542;}})['catch'](function(_0x28fb8d){logger[_0x46f2('0x2d')](_0x46f2('0x5b'),_0x28fb8d);throw _0x28fb8d;});}return _0x5d7542;})[_0x46f2('0x2a')](respondWithResult(_0x1008ea,null))[_0x46f2('0x48')](handleError(_0x1008ea,null));};function Extension(_0x46c2b4,_0x46aa80,_0x47f405,_0x57e367){this[_0x46f2('0x5c')]=_0x46f2('0x5d');this['exten']=_0x46c2b4;this[_0x46f2('0x5e')]=_0x47f405;this[_0x46f2('0x35')]=_0x46f2('0x5f');this[_0x46f2('0x60')]=_0x46f2('0x61');this[_0x46f2('0x62')]=_0x46aa80;this[_0x46f2('0x63')]=_0x57e367;}function createVoicePrefixExtensions(_0x55c105,_0x59d752,_0x1f8f56){return new BPromise(function(_0x190b7d,_0x520ab7){var _0x307e06=new Extension(formatPrefixName(_0x55c105['prefix']),0x1,_0x46f2('0x64'),_0x46f2('0x65'));_0x307e06['VoicePrefixId']=_0x55c105['id'];return db[_0x46f2('0x54')][_0x46f2('0x4f')](_0x307e06,{'transaction':_0x1f8f56})[_0x46f2('0x2a')](function(_0x27a3b2){var _0x3562fb=_0x27a3b2[_0x46f2('0x53')]({'plain':!![]});var _0xbb9e5b=_['map'](addVoicePrefixExtensions(_0x55c105,_0x59d752),function(_0x179b71){_0x179b71[_0x46f2('0x55')]=_0x3562fb['id'];_0x179b71[_0x46f2('0x66')]=_0x55c105['id'];return _0x179b71;});return db[_0x46f2('0x54')][_0x46f2('0x67')](_0xbb9e5b,{'transaction':_0x1f8f56})[_0x46f2('0x2a')](function(_0x9ab912){if(!_0x9ab912){return _0x520ab7(_0x46f2('0x68'));}else{return _0x190b7d(_0x9ab912);}})['catch'](function(_0x5d52ab){return _0x520ab7(_0x5d52ab);});});;});};function addVoicePrefixExtensions(_0x3ab15b,_0x3a2129){var _0x577188=[];var _0x11e10b=formatPrefixName(_0x3ab15b[_0x46f2('0x69')]);_0x577188['push'](new Extension(_0x11e10b,0x2,_0x46f2('0x6a'),_0x46f2('0x6b')+_0x3ab15b['name']));if(_0x3ab15b[_0x46f2('0x6c')]){_0x577188[_0x46f2('0x6d')](new Extension(_0x11e10b,0x3,_0x46f2('0x6a'),_0x46f2('0x6e')+_0x3ab15b[_0x46f2('0x6c')]));}else{_0x577188[_0x46f2('0x6d')](new Extension(_0x11e10b,0x3,_0x46f2('0x64'),_0x46f2('0x6f')));}_0x577188[_0x46f2('0x6d')](new Extension(_0x11e10b,0x4,_0x46f2('0x70'),_0x3a2129['context']+','+_0x46f2('0x71')+(0x8+_0x3ab15b[_0x46f2('0x2f')][_0x46f2('0x4c')])+'}'+','+0x1));return _0x577188;}function formatPrefixName(_0x4dd52f){var _0x478cfe='_';for(var _0x340185=0x0;_0x340185<_0x4dd52f['length'];_0x340185++){if(_0x4dd52f[_0x46f2('0x72')](_0x340185)=='-'){_0x478cfe+=_0x4dd52f['charAt'](_0x340185);}else{_0x478cfe+='['+_0x4dd52f[_0x46f2('0x72')](_0x340185)+']';}}_0x478cfe+='.';return _0x478cfe;}exports[_0x46f2('0x29')]=function(_0x94d2bb,_0x52bda1,_0xa1a6f5){var _0x3dcad4=_0x94d2bb[_0x46f2('0x52')];_0x3dcad4['prefix']=_0x46f2('0x73')+_0x3dcad4[_0x46f2('0x2f')]+'-';return db[_0x46f2('0x50')][_0x46f2('0x51')](function(_0x158e69){return db[_0x46f2('0x33')][_0x46f2('0x29')](_0x3dcad4,{'where':{'id':_0x3dcad4['id']},'transaction':_0x158e69})[_0x46f2('0x2a')](function(){return db[_0x46f2('0x54')][_0x46f2('0x2b')]({'where':{'VoicePrefixId':_0x3dcad4['id']},'transaction':_0x158e69})['then'](function(){return db[_0x46f2('0x54')]['find']({'where':{'id':_0x3dcad4[_0x46f2('0x55')]},'raw':!![]})[_0x46f2('0x2a')](function(_0x3640d5){return createVoicePrefixExtensions(_0x3dcad4,_0x3640d5,_0x158e69);});});});})['then'](function(){return db['VoicePrefix'][_0x46f2('0x74')](_0x3dcad4['id']);})['then'](respondWithResult(_0x52bda1,null))['catch'](handleError(_0x52bda1,null));};exports[_0x46f2('0x75')]=function(_0x1a26bd,_0x51c389,_0xb14ca6){return db[_0x46f2('0x33')]['find']({'where':{'id':_0x1a26bd[_0x46f2('0x4a')]['id']}})[_0x46f2('0x2a')](handleEntityNotFound(_0x51c389,null))[_0x46f2('0x2a')](function(_0x476da5){if(_0x476da5){return _0x476da5['addAgents'](_0x1a26bd[_0x46f2('0x52')][_0x46f2('0x76')],_[_0x46f2('0x77')](_0x1a26bd['body'],[_0x46f2('0x76'),'id'])||{})[_0x46f2('0x78')](function(_0x2a7d45){for(var _0x479da9=0x0;_0x479da9<_0x1a26bd[_0x46f2('0x52')][_0x46f2('0x76')][_0x46f2('0x4c')];_0x479da9+=0x1){socket[_0x46f2('0x79')](_0x46f2('0x7a'),{'UserId':Number(_0x1a26bd[_0x46f2('0x52')][_0x46f2('0x76')][_0x479da9]),'VoicePrefixId':Number(_0x1a26bd[_0x46f2('0x4a')]['id'])});}return _0x2a7d45;});}})[_0x46f2('0x2a')](respondWithResult(_0x51c389,null))[_0x46f2('0x48')](handleError(_0x51c389,null));};exports[_0x46f2('0x7b')]=function(_0x3071ce,_0x4ee954,_0x25f2e9){return db[_0x46f2('0x33')][_0x46f2('0x4d')]({'where':{'id':_0x3071ce['params']['id']}})[_0x46f2('0x2a')](handleEntityNotFound(_0x4ee954,null))[_0x46f2('0x2a')](function(_0x1757bc){if(_0x1757bc){return _0x1757bc[_0x46f2('0x7b')](_0x3071ce[_0x46f2('0x37')][_0x46f2('0x76')])['then'](function(){if(_[_0x46f2('0x7c')](_0x3071ce[_0x46f2('0x37')]['ids'])){for(var _0x1accf0=0x0;_0x1accf0<_0x3071ce[_0x46f2('0x37')][_0x46f2('0x76')][_0x46f2('0x4c')];_0x1accf0+=0x1){socket['emit'](_0x46f2('0x7d'),{'UserId':Number(_0x3071ce[_0x46f2('0x37')][_0x46f2('0x76')][_0x1accf0]),'VoicePrefixId':Number(_0x3071ce['params']['id'])});}}else{socket[_0x46f2('0x79')](_0x46f2('0x7d'),{'UserId':Number(_0x3071ce[_0x46f2('0x37')][_0x46f2('0x76')]),'VoicePrefixId':Number(_0x3071ce[_0x46f2('0x4a')]['id'])});}});}})['then'](respondWithStatusCode(_0x4ee954,null))['catch'](handleError(_0x4ee954,null));};exports[_0x46f2('0x7e')]=function(_0x541f5e,_0x290df3,_0x28d30f){var _0x4114de={};var _0x564869={};var _0x575618;var _0x4f453f;return db['VoicePrefix']['findOne']({'where':{'id':_0x541f5e[_0x46f2('0x4a')]['id']}})['then'](handleEntityNotFound(_0x290df3,null))['then'](function(_0x3c2ca4){if(_0x3c2ca4){_0x575618=_0x3c2ca4;_0x564869['model']=_[_0x46f2('0x38')](db[_0x46f2('0x7f')][_0x46f2('0x4b')]);_0x564869[_0x46f2('0x37')]=_['keys'](_0x541f5e[_0x46f2('0x37')]);_0x564869[_0x46f2('0x39')]=_['intersection'](_0x564869['model'],_0x564869[_0x46f2('0x37')]);_0x4114de[_0x46f2('0x3a')]=_[_0x46f2('0x3b')](_0x564869[_0x46f2('0x36')],qs[_0x46f2('0x3c')](_0x541f5e[_0x46f2('0x37')]['fields']));_0x4114de['attributes']=_0x4114de[_0x46f2('0x3a')]['length']?_0x4114de[_0x46f2('0x3a')]:_0x564869[_0x46f2('0x36')];_0x4114de[_0x46f2('0x3f')]=qs[_0x46f2('0x80')](_0x541f5e[_0x46f2('0x37')][_0x46f2('0x80')]);_0x4114de['where']=qs[_0x46f2('0x39')](_[_0x46f2('0x41')](_0x541f5e[_0x46f2('0x37')],_0x564869[_0x46f2('0x39')]));if(_0x541f5e[_0x46f2('0x37')]['filter']){_0x4114de[_0x46f2('0x40')]=_['merge'](_0x4114de[_0x46f2('0x40')],{'$or':_[_0x46f2('0x32')](_0x4114de['attributes'],function(_0x2f17dd){var _0x3463ae={};_0x3463ae[_0x2f17dd]={'$like':'%'+_0x541f5e[_0x46f2('0x37')][_0x46f2('0x42')]+'%'};return _0x3463ae;})});}_0x4114de=_[_0x46f2('0x43')]({},_0x4114de,_0x541f5e['options']);return _0x575618[_0x46f2('0x7e')](_0x4114de);}})['then'](function(_0x1b5aba){if(_0x1b5aba){_0x4f453f=_0x1b5aba[_0x46f2('0x4c')];if(!_0x541f5e[_0x46f2('0x37')][_0x46f2('0x3d')](_0x46f2('0x3e'))){_0x4114de[_0x46f2('0x24')]=qs[_0x46f2('0x24')](_0x541f5e[_0x46f2('0x37')]['limit']);_0x4114de[_0x46f2('0x22')]=qs[_0x46f2('0x22')](_0x541f5e['query']['offset']);}return _0x575618[_0x46f2('0x7e')](_0x4114de);}})[_0x46f2('0x2a')](function(_0x1fc921){if(_0x1fc921){return _0x1fc921?{'count':_0x4f453f,'rows':_0x1fc921}:null;}})[_0x46f2('0x2a')](respondWithResult(_0x290df3,null))[_0x46f2('0x48')](handleError(_0x290df3,null));}; \ No newline at end of file +var _0xa8b1=['userVoicePrefix:save','removeAgents','userVoicePrefix:remove','getAgents','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','status','json','undefined','limit','count','offset','set','apply','reject','save','then','destroy','UserProfileResource','end','sendStatus','error','stack','name','index','VoicePrefix','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','find','describe','sequelize','transaction','create','get','VoiceExtension','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','VoicePrefixes','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','app','system','description','priority','appdata','NoOp','Voice\x20Prefix','VoicePrefixId','VoiceExtensionId','bulkCreate','Extensions\x20creation\x20failed','prefix','push','Set','CDR(prefix)=','callerIdAll','No\x20callerid\x20available','goto','charAt','update','body','findById','addAgents','ids','spread','emit'];(function(_0x519fcc,_0x239a57){var _0x3ac495=function(_0x3398e1){while(--_0x3398e1){_0x519fcc['push'](_0x519fcc['shift']());}};_0x3ac495(++_0x239a57);}(_0xa8b1,0x182));var _0x1a8b=function(_0x527690,_0x2bc802){_0x527690=_0x527690-0x0;var _0x241967=_0xa8b1[_0x527690];return _0x241967;};'use strict';var emlformat=require(_0x1a8b('0x0'));var rimraf=require(_0x1a8b('0x1'));var zipdir=require(_0x1a8b('0x2'));var jsonpatch=require(_0x1a8b('0x3'));var rp=require(_0x1a8b('0x4'));var moment=require(_0x1a8b('0x5'));var BPromise=require(_0x1a8b('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1a8b('0x7'));var sox=require(_0x1a8b('0x8'));var csv=require('to-csv');var ejs=require(_0x1a8b('0x9'));var fs=require('fs');var fs_extra=require(_0x1a8b('0xa'));var _=require(_0x1a8b('0xb'));var squel=require('squel');var crypto=require(_0x1a8b('0xc'));var jsforce=require(_0x1a8b('0xd'));var deskjs=require(_0x1a8b('0xe'));var toCsv=require(_0x1a8b('0xf'));var querystring=require(_0x1a8b('0x10'));var Papa=require(_0x1a8b('0x11'));var Redis=require('ioredis');var authService=require(_0x1a8b('0x12'));var qs=require(_0x1a8b('0x13'));var as=require(_0x1a8b('0x14'));var hardwareService=require(_0x1a8b('0x15'));var logger=require('../../config/logger')(_0x1a8b('0x16'));var utils=require(_0x1a8b('0x17'));var config=require(_0x1a8b('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x1a8b('0x19')]=_[_0x1a8b('0x1a')](config['redis'],{'host':_0x1a8b('0x1b'),'port':0x18eb});var socket=require(_0x1a8b('0x1c'))(new Redis(config[_0x1a8b('0x19')]));require(_0x1a8b('0x1d'))[_0x1a8b('0x1e')](socket);function respondWithStatusCode(_0x436735,_0x54a8d8){_0x54a8d8=_0x54a8d8||0xcc;return function(_0x214b28){if(_0x214b28){return _0x436735['sendStatus'](_0x54a8d8);}return _0x436735[_0x1a8b('0x1f')](_0x54a8d8)['end']();};}function respondWithResult(_0x3ee045,_0x217a50){_0x217a50=_0x217a50||0xc8;return function(_0x1bce93){if(_0x1bce93){return _0x3ee045[_0x1a8b('0x1f')](_0x217a50)[_0x1a8b('0x20')](_0x1bce93);}};}function respondWithFilteredResult(_0x494c79,_0x3e106b){return function(_0x33b51f){if(_0x33b51f){var _0x5eb856=typeof _0x3e106b['offset']===_0x1a8b('0x21')&&typeof _0x3e106b[_0x1a8b('0x22')]==='undefined';var _0x256817=_0x33b51f[_0x1a8b('0x23')];var _0x2ece0b=_0x5eb856?0x0:_0x3e106b[_0x1a8b('0x24')];var _0x3bf949=_0x5eb856?_0x33b51f[_0x1a8b('0x23')]:_0x3e106b['offset']+_0x3e106b[_0x1a8b('0x22')];var _0x5791e3;if(_0x3bf949>=_0x256817){_0x3bf949=_0x256817;_0x5791e3=0xc8;}else{_0x5791e3=0xce;}_0x494c79[_0x1a8b('0x1f')](_0x5791e3);return _0x494c79[_0x1a8b('0x25')]('Content-Range',_0x2ece0b+'-'+_0x3bf949+'/'+_0x256817)[_0x1a8b('0x20')](_0x33b51f);}return null;};}function patchUpdates(_0x1a1ab8){return function(_0x3932d1){try{jsonpatch[_0x1a8b('0x26')](_0x3932d1,_0x1a1ab8,!![]);}catch(_0x4405de){return BPromise[_0x1a8b('0x27')](_0x4405de);}return _0x3932d1[_0x1a8b('0x28')]();};}function saveUpdates(_0x1ebef9,_0x5ef0ef){return function(_0x49c9fc){if(_0x49c9fc){return _0x49c9fc['update'](_0x1ebef9)[_0x1a8b('0x29')](function(_0x46f3ea){return _0x46f3ea;});}return null;};}function removeEntity(_0xd5371f,_0x4c1c39){return function(_0x208e5e){if(_0x208e5e){return _0x208e5e[_0x1a8b('0x2a')]()[_0x1a8b('0x29')](function(){var _0x4e4844=_0x208e5e['get']({'plain':!![]});var _0x2fde28='VoicePrefixes';return db[_0x1a8b('0x2b')][_0x1a8b('0x2a')]({'where':{'type':_0x2fde28,'resourceId':_0x4e4844['id']}})[_0x1a8b('0x29')](function(){return _0x208e5e;});})[_0x1a8b('0x29')](function(){_0xd5371f[_0x1a8b('0x1f')](0xcc)[_0x1a8b('0x2c')]();});}};}function handleEntityNotFound(_0x5e9b5d,_0x199aac){return function(_0x313121){if(!_0x313121){_0x5e9b5d[_0x1a8b('0x2d')](0x194);}return _0x313121;};}function handleError(_0x578703,_0x3c35a3){_0x3c35a3=_0x3c35a3||0x1f4;return function(_0x3ee826){logger[_0x1a8b('0x2e')](_0x3ee826[_0x1a8b('0x2f')]);if(_0x3ee826['name']){delete _0x3ee826[_0x1a8b('0x30')];}_0x578703[_0x1a8b('0x1f')](_0x3c35a3)['send'](_0x3ee826);};}exports[_0x1a8b('0x31')]=function(_0x5cb60f,_0x394c29){var _0x4c9a48={},_0x8fabaa={},_0x200e50={'count':0x0,'rows':[]};var _0x5da92d=_['map'](db[_0x1a8b('0x32')][_0x1a8b('0x33')],function(_0x4ffab7){return{'name':_0x4ffab7[_0x1a8b('0x34')],'type':_0x4ffab7[_0x1a8b('0x35')][_0x1a8b('0x36')]};});_0x8fabaa[_0x1a8b('0x37')]=_[_0x1a8b('0x38')](_0x5da92d,_0x1a8b('0x30'));_0x8fabaa[_0x1a8b('0x39')]=_[_0x1a8b('0x3a')](_0x5cb60f[_0x1a8b('0x39')]);_0x8fabaa[_0x1a8b('0x3b')]=_[_0x1a8b('0x3c')](_0x8fabaa[_0x1a8b('0x37')],_0x8fabaa[_0x1a8b('0x39')]);_0x4c9a48[_0x1a8b('0x3d')]=_[_0x1a8b('0x3c')](_0x8fabaa[_0x1a8b('0x37')],qs[_0x1a8b('0x3e')](_0x5cb60f[_0x1a8b('0x39')]['fields']));_0x4c9a48[_0x1a8b('0x3d')]=_0x4c9a48['attributes'][_0x1a8b('0x3f')]?_0x4c9a48[_0x1a8b('0x3d')]:_0x8fabaa[_0x1a8b('0x37')];if(!_0x5cb60f[_0x1a8b('0x39')][_0x1a8b('0x40')](_0x1a8b('0x41'))){_0x4c9a48[_0x1a8b('0x22')]=qs[_0x1a8b('0x22')](_0x5cb60f[_0x1a8b('0x39')][_0x1a8b('0x22')]);_0x4c9a48[_0x1a8b('0x24')]=qs['offset'](_0x5cb60f[_0x1a8b('0x39')]['offset']);}_0x4c9a48[_0x1a8b('0x42')]=qs[_0x1a8b('0x43')](_0x5cb60f[_0x1a8b('0x39')][_0x1a8b('0x43')]);_0x4c9a48[_0x1a8b('0x44')]=qs[_0x1a8b('0x3b')](_['pick'](_0x5cb60f[_0x1a8b('0x39')],_0x8fabaa[_0x1a8b('0x3b')]),_0x5da92d);if(_0x5cb60f[_0x1a8b('0x39')][_0x1a8b('0x45')]){_0x4c9a48['where']=_['merge'](_0x4c9a48[_0x1a8b('0x44')],{'$or':_[_0x1a8b('0x38')](_0x5da92d,function(_0x47d995){if(_0x47d995[_0x1a8b('0x35')]!==_0x1a8b('0x46')){var _0xcb7e84={};_0xcb7e84[_0x47d995['name']]={'$like':'%'+_0x5cb60f[_0x1a8b('0x39')][_0x1a8b('0x45')]+'%'};return _0xcb7e84;}})});}_0x4c9a48=_[_0x1a8b('0x47')]({},_0x4c9a48,_0x5cb60f[_0x1a8b('0x48')]);var _0x4dfc6a={'where':_0x4c9a48[_0x1a8b('0x44')]};return db[_0x1a8b('0x32')]['count'](_0x4dfc6a)[_0x1a8b('0x29')](function(_0x49da77){_0x200e50[_0x1a8b('0x23')]=_0x49da77;if(_0x5cb60f[_0x1a8b('0x39')][_0x1a8b('0x49')]){_0x4c9a48[_0x1a8b('0x4a')]=[{'all':!![]}];}return db[_0x1a8b('0x32')]['findAll'](_0x4c9a48);})['then'](function(_0x57dd7e){_0x200e50[_0x1a8b('0x4b')]=_0x57dd7e;return _0x200e50;})[_0x1a8b('0x29')](respondWithFilteredResult(_0x394c29,_0x4c9a48))[_0x1a8b('0x4c')](handleError(_0x394c29,null));};exports[_0x1a8b('0x4d')]=function(_0x4a7ea2,_0x2db9a8){var _0x219a11={'raw':![],'where':{'id':_0x4a7ea2[_0x1a8b('0x4e')]['id']}},_0x2b0a5a={};_0x2b0a5a['model']=_[_0x1a8b('0x3a')](db[_0x1a8b('0x32')][_0x1a8b('0x33')]);_0x2b0a5a[_0x1a8b('0x39')]=_[_0x1a8b('0x3a')](_0x4a7ea2[_0x1a8b('0x39')]);_0x2b0a5a[_0x1a8b('0x3b')]=_['intersection'](_0x2b0a5a[_0x1a8b('0x37')],_0x2b0a5a[_0x1a8b('0x39')]);_0x219a11[_0x1a8b('0x3d')]=_['intersection'](_0x2b0a5a['model'],qs[_0x1a8b('0x3e')](_0x4a7ea2[_0x1a8b('0x39')][_0x1a8b('0x3e')]));_0x219a11[_0x1a8b('0x3d')]=_0x219a11[_0x1a8b('0x3d')][_0x1a8b('0x3f')]?_0x219a11[_0x1a8b('0x3d')]:_0x2b0a5a[_0x1a8b('0x37')];if(_0x4a7ea2[_0x1a8b('0x39')]['includeAll']){_0x219a11[_0x1a8b('0x4a')]=[{'all':!![]}];}_0x219a11=_[_0x1a8b('0x47')]({},_0x219a11,_0x4a7ea2['options']);return db[_0x1a8b('0x32')][_0x1a8b('0x4f')](_0x219a11)['then'](handleEntityNotFound(_0x2db9a8,null))[_0x1a8b('0x29')](respondWithResult(_0x2db9a8,null))[_0x1a8b('0x4c')](handleError(_0x2db9a8,null));};exports[_0x1a8b('0x2a')]=function(_0x5727ee,_0x539d13){return db[_0x1a8b('0x32')]['find']({'where':{'id':_0x5727ee['params']['id']}})[_0x1a8b('0x29')](handleEntityNotFound(_0x539d13,null))[_0x1a8b('0x29')](removeEntity(_0x539d13,null))[_0x1a8b('0x4c')](handleError(_0x539d13,null));};exports['describe']=function(_0x1e29e1,_0x121a72){return db['VoicePrefix'][_0x1a8b('0x50')]()[_0x1a8b('0x29')](respondWithResult(_0x121a72,null))[_0x1a8b('0x4c')](handleError(_0x121a72,null));};exports['create']=function(_0x5c25c8,_0x47341e){var _0x537ed6;return db[_0x1a8b('0x51')][_0x1a8b('0x52')](function(_0x10fe56){return db[_0x1a8b('0x32')][_0x1a8b('0x53')](_0x5c25c8['body'],{'transaction':_0x10fe56})[_0x1a8b('0x29')](function(_0x5ef498){_0x537ed6=_0x5ef498[_0x1a8b('0x54')]({'plain':!![]});return db[_0x1a8b('0x55')][_0x1a8b('0x4f')]({'where':{'id':_0x537ed6['VoiceExtensionId']},'raw':!![]})[_0x1a8b('0x29')](function(_0x2ec291){return createVoicePrefixExtensions(_0x537ed6,_0x2ec291,_0x10fe56);});});})['then'](function(){var _0x5a6971=_0x5c25c8[_0x1a8b('0x56')][_0x1a8b('0x54')]({'plain':!![]});if(!_0x5a6971)throw new Error(_0x1a8b('0x57'));if(_0x5a6971[_0x1a8b('0x58')]===_0x1a8b('0x56')){var _0x2611e4=_0x537ed6;return db[_0x1a8b('0x59')][_0x1a8b('0x4f')]({'where':{'name':_0x1a8b('0x5a'),'userProfileId':_0x5a6971['userProfileId']},'raw':!![]})[_0x1a8b('0x29')](function(_0x1f4182){if(_0x1f4182&&_0x1f4182[_0x1a8b('0x5b')]===0x0){return db['UserProfileResource']['create']({'name':_0x2611e4[_0x1a8b('0x30')],'resourceId':_0x2611e4['id'],'type':_0x1f4182['name'],'sectionId':_0x1f4182['id']},{})['then'](function(){return _0x537ed6;});}else{return _0x537ed6;}})['catch'](function(_0x14d295){logger[_0x1a8b('0x2e')](_0x1a8b('0x5c'),_0x14d295);throw _0x14d295;});}return _0x537ed6;})[_0x1a8b('0x29')](respondWithResult(_0x47341e,null))[_0x1a8b('0x4c')](handleError(_0x47341e,null));};function Extension(_0x4b5231,_0x4997ef,_0x3bf7a1,_0x32bb0e){this[_0x1a8b('0x5d')]=_0x1a8b('0x5e');this[_0x1a8b('0x5f')]=_0x4b5231;this[_0x1a8b('0x60')]=_0x3bf7a1;this[_0x1a8b('0x35')]=_0x1a8b('0x61');this[_0x1a8b('0x62')]='Voice\x20Prefix\x20Extension';this[_0x1a8b('0x63')]=_0x4997ef;this[_0x1a8b('0x64')]=_0x32bb0e;}function createVoicePrefixExtensions(_0x3cc992,_0x3d756a,_0x20c39a){return new BPromise(function(_0x2e2a5c,_0x182589){var _0xae8bae=new Extension(formatPrefixName(_0x3cc992['prefix']),0x1,_0x1a8b('0x65'),_0x1a8b('0x66'));_0xae8bae[_0x1a8b('0x67')]=_0x3cc992['id'];return db['VoiceExtension'][_0x1a8b('0x53')](_0xae8bae,{'transaction':_0x20c39a})[_0x1a8b('0x29')](function(_0x3b5934){var _0x1af7f6=_0x3b5934[_0x1a8b('0x54')]({'plain':!![]});var _0x514b30=_[_0x1a8b('0x38')](addVoicePrefixExtensions(_0x3cc992,_0x3d756a),function(_0x57dc2a){_0x57dc2a[_0x1a8b('0x68')]=_0x1af7f6['id'];_0x57dc2a[_0x1a8b('0x67')]=_0x3cc992['id'];return _0x57dc2a;});return db[_0x1a8b('0x55')][_0x1a8b('0x69')](_0x514b30,{'transaction':_0x20c39a})['then'](function(_0x2933fa){if(!_0x2933fa){return _0x182589(_0x1a8b('0x6a'));}else{return _0x2e2a5c(_0x2933fa);}})[_0x1a8b('0x4c')](function(_0x454623){return _0x182589(_0x454623);});});;});};function addVoicePrefixExtensions(_0x297b87,_0x1bde19){var _0x3b29f0=[];var _0x1ada40=formatPrefixName(_0x297b87[_0x1a8b('0x6b')]);_0x3b29f0[_0x1a8b('0x6c')](new Extension(_0x1ada40,0x2,_0x1a8b('0x6d'),_0x1a8b('0x6e')+_0x297b87[_0x1a8b('0x30')]));if(_0x297b87[_0x1a8b('0x6f')]){_0x3b29f0[_0x1a8b('0x6c')](new Extension(_0x1ada40,0x3,_0x1a8b('0x6d'),'PREFIX-CALLERIDALL='+_0x297b87['callerIdAll']));}else{_0x3b29f0[_0x1a8b('0x6c')](new Extension(_0x1ada40,0x3,_0x1a8b('0x65'),_0x1a8b('0x70')));}_0x3b29f0[_0x1a8b('0x6c')](new Extension(_0x1ada40,0x4,_0x1a8b('0x71'),_0x1bde19[_0x1a8b('0x5d')]+','+'${EXTEN:'+(0x8+_0x297b87[_0x1a8b('0x30')][_0x1a8b('0x3f')])+'}'+','+0x1));return _0x3b29f0;}function formatPrefixName(_0x38a4fa){var _0x38161e='_';for(var _0x671a95=0x0;_0x671a95<_0x38a4fa['length'];_0x671a95++){if(_0x38a4fa[_0x1a8b('0x72')](_0x671a95)=='-'){_0x38161e+=_0x38a4fa[_0x1a8b('0x72')](_0x671a95);}else{_0x38161e+='['+_0x38a4fa['charAt'](_0x671a95)+']';}}_0x38161e+='.';return _0x38161e;}exports[_0x1a8b('0x73')]=function(_0x967a0c,_0x4932e0,_0x39d690){var _0x478608=_0x967a0c[_0x1a8b('0x74')];_0x478608[_0x1a8b('0x6b')]='system-'+_0x478608['name']+'-';return db[_0x1a8b('0x51')][_0x1a8b('0x52')](function(_0x33f8fb){return db[_0x1a8b('0x32')][_0x1a8b('0x73')](_0x478608,{'where':{'id':_0x478608['id']},'transaction':_0x33f8fb})[_0x1a8b('0x29')](function(){return db[_0x1a8b('0x55')][_0x1a8b('0x2a')]({'where':{'VoicePrefixId':_0x478608['id']},'transaction':_0x33f8fb})['then'](function(){return db[_0x1a8b('0x55')][_0x1a8b('0x4f')]({'where':{'id':_0x478608[_0x1a8b('0x68')]},'raw':!![]})[_0x1a8b('0x29')](function(_0x3003c2){return createVoicePrefixExtensions(_0x478608,_0x3003c2,_0x33f8fb);});});});})['then'](function(){return db['VoicePrefix'][_0x1a8b('0x75')](_0x478608['id']);})['then'](respondWithResult(_0x4932e0,null))['catch'](handleError(_0x4932e0,null));};exports[_0x1a8b('0x76')]=function(_0x82737d,_0x4c0da0,_0x4f97cd){return db['VoicePrefix']['find']({'where':{'id':_0x82737d[_0x1a8b('0x4e')]['id']}})[_0x1a8b('0x29')](handleEntityNotFound(_0x4c0da0,null))[_0x1a8b('0x29')](function(_0x1e727e){if(_0x1e727e){return _0x1e727e['addAgents'](_0x82737d[_0x1a8b('0x74')][_0x1a8b('0x77')],_['omit'](_0x82737d['body'],[_0x1a8b('0x77'),'id'])||{})[_0x1a8b('0x78')](function(_0x227217){for(var _0xd31ee2=0x0;_0xd31ee2<_0x82737d[_0x1a8b('0x74')][_0x1a8b('0x77')][_0x1a8b('0x3f')];_0xd31ee2+=0x1){socket[_0x1a8b('0x79')](_0x1a8b('0x7a'),{'UserId':Number(_0x82737d[_0x1a8b('0x74')]['ids'][_0xd31ee2]),'VoicePrefixId':Number(_0x82737d[_0x1a8b('0x4e')]['id'])});}return _0x227217;});}})['then'](respondWithResult(_0x4c0da0,null))[_0x1a8b('0x4c')](handleError(_0x4c0da0,null));};exports[_0x1a8b('0x7b')]=function(_0x4af412,_0x33a883,_0x2be3b8){return db['VoicePrefix']['find']({'where':{'id':_0x4af412[_0x1a8b('0x4e')]['id']}})[_0x1a8b('0x29')](handleEntityNotFound(_0x33a883,null))[_0x1a8b('0x29')](function(_0x5b96f9){if(_0x5b96f9){return _0x5b96f9[_0x1a8b('0x7b')](_0x4af412[_0x1a8b('0x39')]['ids'])[_0x1a8b('0x29')](function(){if(_['isArray'](_0x4af412[_0x1a8b('0x39')][_0x1a8b('0x77')])){for(var _0x5db4a5=0x0;_0x5db4a5<_0x4af412['query'][_0x1a8b('0x77')][_0x1a8b('0x3f')];_0x5db4a5+=0x1){socket['emit'](_0x1a8b('0x7c'),{'UserId':Number(_0x4af412[_0x1a8b('0x39')][_0x1a8b('0x77')][_0x5db4a5]),'VoicePrefixId':Number(_0x4af412[_0x1a8b('0x4e')]['id'])});}}else{socket['emit'](_0x1a8b('0x7c'),{'UserId':Number(_0x4af412[_0x1a8b('0x39')][_0x1a8b('0x77')]),'VoicePrefixId':Number(_0x4af412[_0x1a8b('0x4e')]['id'])});}});}})[_0x1a8b('0x29')](respondWithStatusCode(_0x33a883,null))[_0x1a8b('0x4c')](handleError(_0x33a883,null));};exports[_0x1a8b('0x7d')]=function(_0x4bb609,_0xf92eff,_0x58e886){var _0x471c75={};var _0x1e9a1d={};var _0x598458;var _0x20fbd0;return db[_0x1a8b('0x32')][_0x1a8b('0x7e')]({'where':{'id':_0x4bb609[_0x1a8b('0x4e')]['id']}})[_0x1a8b('0x29')](handleEntityNotFound(_0xf92eff,null))[_0x1a8b('0x29')](function(_0x1998d1){if(_0x1998d1){_0x598458=_0x1998d1;_0x1e9a1d[_0x1a8b('0x37')]=_[_0x1a8b('0x3a')](db['User'][_0x1a8b('0x33')]);_0x1e9a1d[_0x1a8b('0x39')]=_[_0x1a8b('0x3a')](_0x4bb609['query']);_0x1e9a1d[_0x1a8b('0x3b')]=_[_0x1a8b('0x3c')](_0x1e9a1d[_0x1a8b('0x37')],_0x1e9a1d[_0x1a8b('0x39')]);_0x471c75[_0x1a8b('0x3d')]=_[_0x1a8b('0x3c')](_0x1e9a1d[_0x1a8b('0x37')],qs['fields'](_0x4bb609[_0x1a8b('0x39')][_0x1a8b('0x3e')]));_0x471c75[_0x1a8b('0x3d')]=_0x471c75[_0x1a8b('0x3d')][_0x1a8b('0x3f')]?_0x471c75[_0x1a8b('0x3d')]:_0x1e9a1d[_0x1a8b('0x37')];_0x471c75[_0x1a8b('0x42')]=qs['sort'](_0x4bb609[_0x1a8b('0x39')][_0x1a8b('0x43')]);_0x471c75[_0x1a8b('0x44')]=qs[_0x1a8b('0x3b')](_['pick'](_0x4bb609['query'],_0x1e9a1d[_0x1a8b('0x3b')]));if(_0x4bb609[_0x1a8b('0x39')][_0x1a8b('0x45')]){_0x471c75[_0x1a8b('0x44')]=_[_0x1a8b('0x47')](_0x471c75[_0x1a8b('0x44')],{'$or':_[_0x1a8b('0x38')](_0x471c75['attributes'],function(_0x41d1e0){var _0x4cc182={};_0x4cc182[_0x41d1e0]={'$like':'%'+_0x4bb609[_0x1a8b('0x39')][_0x1a8b('0x45')]+'%'};return _0x4cc182;})});}_0x471c75=_[_0x1a8b('0x47')]({},_0x471c75,_0x4bb609[_0x1a8b('0x48')]);return _0x598458['getAgents'](_0x471c75);}})[_0x1a8b('0x29')](function(_0x2dad73){if(_0x2dad73){_0x20fbd0=_0x2dad73[_0x1a8b('0x3f')];if(!_0x4bb609[_0x1a8b('0x39')]['hasOwnProperty'](_0x1a8b('0x41'))){_0x471c75[_0x1a8b('0x22')]=qs[_0x1a8b('0x22')](_0x4bb609['query'][_0x1a8b('0x22')]);_0x471c75[_0x1a8b('0x24')]=qs['offset'](_0x4bb609['query'][_0x1a8b('0x24')]);}return _0x598458[_0x1a8b('0x7d')](_0x471c75);}})['then'](function(_0x42af42){if(_0x42af42){return _0x42af42?{'count':_0x20fbd0,'rows':_0x42af42}:null;}})[_0x1a8b('0x29')](respondWithResult(_0xf92eff,null))[_0x1a8b('0x4c')](handleError(_0xf92eff,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index a61c630..ad73523 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 _0x4256=['hasOwnProperty','hook','exports','events','../../mysqldb','VoicePrefix','setMaxListeners','save','update','emit'];(function(_0x4927dc,_0x54b3f6){var _0x45e1c3=function(_0x45f4f7){while(--_0x45f4f7){_0x4927dc['push'](_0x4927dc['shift']());}};_0x45e1c3(++_0x54b3f6);}(_0x4256,0x189));var _0x6425=function(_0x395bfe,_0x4db521){_0x395bfe=_0x395bfe-0x0;var _0x35c81c=_0x4256[_0x395bfe];return _0x35c81c;};'use strict';var EventEmitter=require(_0x6425('0x0'));var VoicePrefix=require(_0x6425('0x1'))['db'][_0x6425('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x6425('0x3')](0x0);var events={'afterCreate':_0x6425('0x4'),'afterUpdate':_0x6425('0x5'),'afterDestroy':'remove'};function emitEvent(_0x52ef49){return function(_0x30b0a0,_0x5c5afe,_0x3fa18b){VoicePrefixEvents[_0x6425('0x6')](_0x52ef49+':'+_0x30b0a0['id'],_0x30b0a0);VoicePrefixEvents['emit'](_0x52ef49,_0x30b0a0);_0x3fa18b(null);};}for(var e in events){if(events[_0x6425('0x7')](e)){var event=events[e];VoicePrefix[_0x6425('0x8')](e,emitEvent(event));}}module[_0x6425('0x9')]=VoicePrefixEvents; \ No newline at end of file +var _0xef87=['hasOwnProperty','hook','exports','events','../../mysqldb','remove','emit'];(function(_0x1fbb13,_0x212bfe){var _0x2f68e8=function(_0x23710d){while(--_0x23710d){_0x1fbb13['push'](_0x1fbb13['shift']());}};_0x2f68e8(++_0x212bfe);}(_0xef87,0x145));var _0x7ef8=function(_0x412eae,_0x540125){_0x412eae=_0x412eae-0x0;var _0x1cc446=_0xef87[_0x412eae];return _0x1cc446;};'use strict';var EventEmitter=require(_0x7ef8('0x0'));var VoicePrefix=require(_0x7ef8('0x1'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x7ef8('0x2')};function emitEvent(_0x39611f){return function(_0x41c898,_0x472197,_0xedb902){VoicePrefixEvents['emit'](_0x39611f+':'+_0x41c898['id'],_0x41c898);VoicePrefixEvents[_0x7ef8('0x3')](_0x39611f,_0x41c898);_0xedb902(null);};}for(var e in events){if(events[_0x7ef8('0x4')](e)){var event=events[e];VoicePrefix[_0x7ef8('0x5')](e,emitEvent(event));}}module[_0x7ef8('0x6')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index fad274e..bd9159c 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 _0x18e0=['../../config/environment','exports','define','VoicePrefix','voice_prefixes','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x26da06,_0x44caa0){var _0x30d5a0=function(_0x4f4cf0){while(--_0x4f4cf0){_0x26da06['push'](_0x26da06['shift']());}};_0x30d5a0(++_0x44caa0);}(_0x18e0,0x7a));var _0x018e=function(_0x45b034,_0x3a57dd){_0x45b034=_0x45b034-0x0;var _0x509cb0=_0x18e0[_0x45b034];return _0x509cb0;};'use strict';var _=require(_0x018e('0x0'));var util=require(_0x018e('0x1'));var logger=require(_0x018e('0x2'))(_0x018e('0x3'));var moment=require(_0x018e('0x4'));var BPromise=require(_0x018e('0x5'));var rp=require(_0x018e('0x6'));var fs=require('fs');var path=require(_0x018e('0x7'));var rimraf=require('rimraf');var config=require(_0x018e('0x8'));var attributes=require('./voicePrefix.attributes');module[_0x018e('0x9')]=function(_0xee80e5,_0x3e2544){return _0xee80e5[_0x018e('0xa')](_0x018e('0xb'),attributes,{'tableName':_0x018e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x21ac=['util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./voicePrefix.attributes','exports','define','VoicePrefix','voice_prefixes','lodash'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x21ac,0x19f));var _0xc21a=function(_0x1e797d,_0x2c6531){_0x1e797d=_0x1e797d-0x0;var _0x4b634c=_0x21ac[_0x1e797d];return _0x4b634c;};'use strict';var _=require(_0xc21a('0x0'));var util=require(_0xc21a('0x1'));var logger=require(_0xc21a('0x2'))(_0xc21a('0x3'));var moment=require(_0xc21a('0x4'));var BPromise=require('bluebird');var rp=require(_0xc21a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc21a('0x6'));var config=require(_0xc21a('0x7'));var attributes=require(_0xc21a('0x8'));module[_0xc21a('0x9')]=function(_0x1ec049,_0x2fa80e){return _0x1ec049[_0xc21a('0xa')](_0xc21a('0xb'),attributes,{'tableName':_0xc21a('0xc'),'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 01a4eaa..8933b61 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 _0x2542=['register','request','then','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket'];(function(_0x4dae90,_0x310097){var _0x211ef6=function(_0x3c59ce){while(--_0x3c59ce){_0x4dae90['push'](_0x4dae90['shift']());}};_0x211ef6(++_0x310097);}(_0x2542,0x169));var _0x2254=function(_0x18d38c,_0xc5c2d3){_0x18d38c=_0x18d38c-0x0;var _0x474ba7=_0x2542[_0x18d38c];return _0x474ba7;};'use strict';var _=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var moment=require(_0x2254('0x2'));var BPromise=require(_0x2254('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2254('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2254('0x5'));var logger=require(_0x2254('0x6'))(_0x2254('0x7'));var config=require(_0x2254('0x8'));var jayson=require(_0x2254('0x9'));var client=jayson['client'][_0x2254('0xa')]({'port':0x232a});config[_0x2254('0xb')]=_[_0x2254('0xc')](config[_0x2254('0xb')],{'host':_0x2254('0xd'),'port':0x18eb});var socket=require(_0x2254('0xe'))(new Redis(config[_0x2254('0xb')]));require(_0x2254('0xf'))[_0x2254('0x10')](socket);function respondWithRpcPromise(_0x1ae415,_0x38fb2b,_0x5b1ab9){return new BPromise(function(_0x336e14,_0x2655ea){return client[_0x2254('0x11')](_0x1ae415,_0x5b1ab9)[_0x2254('0x12')](function(_0x575d58){logger['info'](_0x2254('0x13'),_0x38fb2b,_0x2254('0x14'));logger[_0x2254('0x15')](_0x2254('0x16'),_0x38fb2b,_0x2254('0x14'),JSON[_0x2254('0x17')](_0x575d58));if(_0x575d58['error']){if(_0x575d58[_0x2254('0x18')][_0x2254('0x19')]===0x1f4){logger['error'](_0x2254('0x13'),_0x38fb2b,_0x575d58[_0x2254('0x18')][_0x2254('0x1a')]);return _0x2655ea(_0x575d58[_0x2254('0x18')][_0x2254('0x1a')]);}logger[_0x2254('0x18')]('VoicePrefix,\x20%s,\x20%s',_0x38fb2b,_0x575d58[_0x2254('0x18')]['message']);return _0x336e14(_0x575d58[_0x2254('0x18')][_0x2254('0x1a')]);}else{logger[_0x2254('0x1b')](_0x2254('0x13'),_0x38fb2b,_0x2254('0x14'));_0x336e14(_0x575d58[_0x2254('0x1c')]['message']);}})['catch'](function(_0x5ec98d){logger[_0x2254('0x18')](_0x2254('0x13'),_0x38fb2b,_0x5ec98d);_0x2655ea(_0x5ec98d);});});} \ No newline at end of file +var _0x7da6=['../../config/environment','jayson/promise','client','redis','localhost','register','request','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x406903,_0x152f7b){var _0x5d2e7f=function(_0x2af224){while(--_0x2af224){_0x406903['push'](_0x406903['shift']());}};_0x5d2e7f(++_0x152f7b);}(_0x7da6,0x124));var _0x67da=function(_0x4629ee,_0x5802d8){_0x4629ee=_0x4629ee-0x0;var _0x47fb5b=_0x7da6[_0x4629ee];return _0x47fb5b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x67da('0x0'));var BPromise=require(_0x67da('0x1'));var rs=require(_0x67da('0x2'));var fs=require('fs');var Redis=require(_0x67da('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x67da('0x4'));var logger=require(_0x67da('0x5'))(_0x67da('0x6'));var config=require(_0x67da('0x7'));var jayson=require(_0x67da('0x8'));var client=jayson[_0x67da('0x9')]['http']({'port':0x232a});config[_0x67da('0xa')]=_['defaults'](config['redis'],{'host':_0x67da('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x67da('0xa')]));require('./voicePrefix.socket')[_0x67da('0xc')](socket);function respondWithRpcPromise(_0x391299,_0x3791cb,_0x2b8f3a){return new BPromise(function(_0x7adba5,_0x26198c){return client[_0x67da('0xd')](_0x391299,_0x2b8f3a)['then'](function(_0x5bfa4f){logger[_0x67da('0xe')](_0x67da('0xf'),_0x3791cb,_0x67da('0x10'));logger[_0x67da('0x11')](_0x67da('0x12'),_0x3791cb,'request\x20sent',JSON[_0x67da('0x13')](_0x5bfa4f));if(_0x5bfa4f[_0x67da('0x14')]){if(_0x5bfa4f[_0x67da('0x14')][_0x67da('0x15')]===0x1f4){logger[_0x67da('0x14')]('VoicePrefix,\x20%s,\x20%s',_0x3791cb,_0x5bfa4f[_0x67da('0x14')][_0x67da('0x16')]);return _0x26198c(_0x5bfa4f['error'][_0x67da('0x16')]);}logger[_0x67da('0x14')](_0x67da('0xf'),_0x3791cb,_0x5bfa4f[_0x67da('0x14')][_0x67da('0x16')]);return _0x7adba5(_0x5bfa4f[_0x67da('0x14')][_0x67da('0x16')]);}else{logger[_0x67da('0xe')]('VoicePrefix,\x20%s,\x20%s',_0x3791cb,_0x67da('0x10'));_0x7adba5(_0x5bfa4f['result'][_0x67da('0x16')]);}})['catch'](function(_0x263517){logger[_0x67da('0x14')](_0x67da('0xf'),_0x3791cb,_0x263517);_0x26198c(_0x263517);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 61c1a68..28e90ac 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 _0x6f0d=['update','emit','removeListener','length','save','remove'];(function(_0x5e5658,_0x5ceb37){var _0x501ff8=function(_0x359ef1){while(--_0x359ef1){_0x5e5658['push'](_0x5e5658['shift']());}};_0x501ff8(++_0x5ceb37);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x521ecc,_0x24cb72){_0x521ecc=_0x521ecc-0x0;var _0x4309f5=_0x6f0d[_0x521ecc];return _0x4309f5;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=[_0xd6f0('0x0'),_0xd6f0('0x1'),_0xd6f0('0x2')];function createListener(_0x107a8c,_0x573473){return function(_0x275230){_0x573473[_0xd6f0('0x3')](_0x107a8c,_0x275230);};}function removeListener(_0x2f78fb,_0x25344b){return function(){VoicePrefixEvents[_0xd6f0('0x4')](_0x2f78fb,_0x25344b);};}exports['register']=function(_0x2d2ce6){for(var _0x4a8b0c=0x0,_0xe21ac4=events[_0xd6f0('0x5')];_0x4a8b0c<_0xe21ac4;_0x4a8b0c++){var _0x8b89a9=events[_0x4a8b0c];var _0x1a48a0=createListener('voicePrefix:'+_0x8b89a9,_0x2d2ce6);VoicePrefixEvents['on'](_0x8b89a9,_0x1a48a0);}}; \ No newline at end of file +var _0xc1c4=['save','remove','update','removeListener','register','./voicePrefix.events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc1c4,0x1c7));var _0x4c1c=function(_0x3ddbe8,_0x13d6a1){_0x3ddbe8=_0x3ddbe8-0x0;var _0x531882=_0xc1c4[_0x3ddbe8];return _0x531882;};'use strict';var VoicePrefixEvents=require(_0x4c1c('0x0'));var events=[_0x4c1c('0x1'),_0x4c1c('0x2'),_0x4c1c('0x3')];function createListener(_0xf92045,_0x40fa5e){return function(_0x22dbe8){_0x40fa5e['emit'](_0xf92045,_0x22dbe8);};}function removeListener(_0x5c1e2c,_0xf4ace6){return function(){VoicePrefixEvents[_0x4c1c('0x4')](_0x5c1e2c,_0xf4ace6);};}exports[_0x4c1c('0x5')]=function(_0x5ad905){for(var _0xaa5184=0x0,_0x4f5a4f=events['length'];_0xaa5184<_0x4f5a4f;_0xaa5184++){var _0x20e276=events[_0xaa5184];var _0x3337e4=createListener('voicePrefix:'+_0x20e276,_0x5ad905);VoicePrefixEvents['on'](_0x20e276,_0x3337e4);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 7958257..11441a0 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 _0x371c=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceQueue.controller','get','index','/:id','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','post','/:id/clone','addAgents','addLists','addBlackLists','put','update','delete','removeLists','exports'];(function(_0x4147e6,_0x57174e){var _0x3305ba=function(_0x30199e){while(--_0x30199e){_0x4147e6['push'](_0x4147e6['shift']());}};_0x3305ba(++_0x57174e);}(_0x371c,0x69));var _0xc371=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0x371c[_0x1d24eb];return _0x1dc576;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc371('0x0'));var timeout=require(_0xc371('0x1'));var express=require('express');var router=express[_0xc371('0x2')]();var fs_extra=require(_0xc371('0x3'));var auth=require(_0xc371('0x4'));var interaction=require(_0xc371('0x5'));var config=require('../../config/environment');var controller=require(_0xc371('0x6'));router[_0xc371('0x7')]('/',auth['isAuthenticated'](),controller[_0xc371('0x8')]);router['get'](_0xc371('0x9'),auth[_0xc371('0xa')](),controller[_0xc371('0xb')]);router[_0xc371('0x7')](_0xc371('0xc'),auth['isAuthenticated'](),controller[_0xc371('0xd')]);router[_0xc371('0x7')](_0xc371('0xe'),auth['isAuthenticated'](),controller[_0xc371('0xf')]);router[_0xc371('0x7')]('/:id/hopper_finals',auth[_0xc371('0xa')](),controller[_0xc371('0x10')]);router['get'](_0xc371('0x11'),auth[_0xc371('0xa')](),controller[_0xc371('0x12')]);router['get'](_0xc371('0x13'),auth['isAuthenticated'](),controller['getTeams']);router[_0xc371('0x7')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0xc371('0x7')](_0xc371('0x14'),auth[_0xc371('0xa')](),controller[_0xc371('0x15')]);router['get'](_0xc371('0x16'),auth['isAuthenticated'](),controller['getLists']);router[_0xc371('0x7')](_0xc371('0x17'),auth[_0xc371('0xa')](),controller[_0xc371('0x18')]);router[_0xc371('0x19')]('/',auth[_0xc371('0xa')](),controller['create']);router[_0xc371('0x19')](_0xc371('0x1a'),auth[_0xc371('0xa')](),controller['clone']);router[_0xc371('0x19')](_0xc371('0x13'),auth[_0xc371('0xa')](),controller['addTeams']);router[_0xc371('0x19')]('/:id/users',auth[_0xc371('0xa')](),controller[_0xc371('0x1b')]);router[_0xc371('0x19')]('/:id/lists',auth[_0xc371('0xa')](),controller[_0xc371('0x1c')]);router[_0xc371('0x19')](_0xc371('0x17'),auth[_0xc371('0xa')](),controller[_0xc371('0x1d')]);router[_0xc371('0x1e')](_0xc371('0x9'),auth[_0xc371('0xa')](),controller[_0xc371('0x1f')]);router['delete'](_0xc371('0x9'),auth[_0xc371('0xa')](),controller['destroy']);router[_0xc371('0x20')]('/:id/teams',auth['isAuthenticated'](),controller['removeTeams']);router['delete']('/:id/users',auth[_0xc371('0xa')](),controller['removeAgents']);router[_0xc371('0x20')](_0xc371('0x16'),auth[_0xc371('0xa')](),controller[_0xc371('0x21')]);router[_0xc371('0x20')](_0xc371('0x17'),auth[_0xc371('0xa')](),controller['removeBlackLists']);module[_0xc371('0x22')]=router; \ No newline at end of file +var _0x96da=['/:id/users','getAgents','/:id/members','getMembers','/:id/lists','/:id/blacklists','post','create','/:id/clone','/:id/teams','addTeams','addAgents','addLists','put','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','index','get','/:id','isAuthenticated','show','/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','getHopperBlacks'];(function(_0x1b2779,_0x181d22){var _0x162929=function(_0x2d0083){while(--_0x2d0083){_0x1b2779['push'](_0x1b2779['shift']());}};_0x162929(++_0x181d22);}(_0x96da,0x8e));var _0xa96d=function(_0x37e6cc,_0x213b98){_0x37e6cc=_0x37e6cc-0x0;var _0x50ebd7=_0x96da[_0x37e6cc];return _0x50ebd7;};'use strict';var multer=require(_0xa96d('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa96d('0x1'));var router=express['Router']();var fs_extra=require(_0xa96d('0x2'));var auth=require(_0xa96d('0x3'));var interaction=require(_0xa96d('0x4'));var config=require(_0xa96d('0x5'));var controller=require(_0xa96d('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xa96d('0x7')]);router[_0xa96d('0x8')](_0xa96d('0x9'),auth[_0xa96d('0xa')](),controller[_0xa96d('0xb')]);router['get'](_0xa96d('0xc'),auth[_0xa96d('0xa')](),controller['getHoppers']);router[_0xa96d('0x8')](_0xa96d('0xd'),auth[_0xa96d('0xa')](),controller[_0xa96d('0xe')]);router['get'](_0xa96d('0xf'),auth['isAuthenticated'](),controller[_0xa96d('0x10')]);router[_0xa96d('0x8')]('/:id/hopper_black',auth[_0xa96d('0xa')](),controller[_0xa96d('0x11')]);router['get']('/:id/teams',auth['isAuthenticated'](),controller['getTeams']);router[_0xa96d('0x8')](_0xa96d('0x12'),auth['isAuthenticated'](),controller[_0xa96d('0x13')]);router[_0xa96d('0x8')](_0xa96d('0x14'),auth['isAuthenticated'](),controller[_0xa96d('0x15')]);router['get'](_0xa96d('0x16'),auth[_0xa96d('0xa')](),controller['getLists']);router['get'](_0xa96d('0x17'),auth[_0xa96d('0xa')](),controller['getBlackLists']);router[_0xa96d('0x18')]('/',auth[_0xa96d('0xa')](),controller[_0xa96d('0x19')]);router[_0xa96d('0x18')](_0xa96d('0x1a'),auth[_0xa96d('0xa')](),controller['clone']);router[_0xa96d('0x18')](_0xa96d('0x1b'),auth[_0xa96d('0xa')](),controller[_0xa96d('0x1c')]);router['post'](_0xa96d('0x12'),auth['isAuthenticated'](),controller[_0xa96d('0x1d')]);router[_0xa96d('0x18')]('/:id/lists',auth['isAuthenticated'](),controller[_0xa96d('0x1e')]);router[_0xa96d('0x18')](_0xa96d('0x17'),auth[_0xa96d('0xa')](),controller['addBlackLists']);router[_0xa96d('0x1f')](_0xa96d('0x9'),auth[_0xa96d('0xa')](),controller[_0xa96d('0x20')]);router[_0xa96d('0x21')](_0xa96d('0x9'),auth[_0xa96d('0xa')](),controller[_0xa96d('0x22')]);router['delete'](_0xa96d('0x1b'),auth[_0xa96d('0xa')](),controller[_0xa96d('0x23')]);router[_0xa96d('0x21')]('/:id/users',auth['isAuthenticated'](),controller[_0xa96d('0x24')]);router[_0xa96d('0x21')]('/:id/lists',auth['isAuthenticated'](),controller[_0xa96d('0x25')]);router[_0xa96d('0x21')](_0xa96d('0x17'),auth[_0xa96d('0xa')](),controller[_0xa96d('0x26')]);module[_0xa96d('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 5430ab3..56cb628 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 _0x1794=['#AMD\x20Maximum\x20Word\x20Length','Active/Disactive\x20Recall\x20In\x20Queue','ASC','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','name','ENUM','inbound','outbound','leastrecent','fewestcalls','rrmemory','wrandom','rrordered','ringall','setDataValue','strategy','getDataValue','type','booked','roundrobin','progressive','power','INTEGER','yes','once','TEXT','joinempty','join','split','leavewhenempty','BOOLEAN','wrapuptime','Active/Disactive\x20Campaign','predictive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','agentBusyFactor','dropRate','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#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,*,*,*','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'];(function(_0x4d8a8f,_0x2afd4c){var _0xfc4adc=function(_0xb89886){while(--_0xb89886){_0x4d8a8f['push'](_0x4d8a8f['shift']());}};_0xfc4adc(++_0x2afd4c);}(_0x1794,0x180));var _0x4179=function(_0x327e61,_0x514f46){_0x327e61=_0x327e61-0x0;var _0x1406a6=_0x1794[_0x327e61];return _0x1406a6;};'use strict';var Sequelize=require(_0x4179('0x0'));module['exports']={'name':{'type':Sequelize[_0x4179('0x1')],'allowNull':![],'unique':_0x4179('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x4179('0x3')](_0x4179('0x4'),_0x4179('0x5')),'allowNull':![],'defaultValue':_0x4179('0x4')},'musiconhold':{'type':Sequelize[_0x4179('0x1')],'defaultValue':'default'},'announce':{'type':Sequelize[_0x4179('0x1')],'defaultValue':''},'strategy':{'type':Sequelize[_0x4179('0x3')]('rr','ringall',_0x4179('0x6'),_0x4179('0x7'),'random',_0x4179('0x8'),'linear',_0x4179('0x9'),_0x4179('0xa')),'allowNull':![],'defaultValue':_0x4179('0xb'),'set':function(_0x5d9efb){this[_0x4179('0xc')](_0x4179('0xd'),_0x5d9efb?_0x5d9efb:_0x4179('0x8'));},'get':function(){var _0x5e745a=this[_0x4179('0xe')](_0x4179('0xf'));var _0x1f0860=this['getDataValue']('dialMethod');var _0x5f2680=this[_0x4179('0xe')](_0x4179('0xd'));if(_0x5e745a==='inbound'){return _0x5f2680;}if(_0x1f0860===_0x4179('0x10')&&_0x5f2680===_0x4179('0x8')||_0x1f0860===_0x4179('0x10')&&_0x5f2680===_0x4179('0x11')){return _0x5f2680;}if(_0x1f0860===_0x4179('0x12')||_0x1f0860==='predictive'||_0x1f0860===_0x4179('0x13')){return _0x5f2680;}return null;}},'servicelevel':{'type':Sequelize[_0x4179('0x14')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x4179('0x1')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x4179('0x14')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x4179('0x1')]},'weight':{'type':Sequelize[_0x4179('0x14')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x4179('0x14')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x4179('0x3')]('yes','no'),'defaultValue':_0x4179('0x15')},'autopause':{'type':Sequelize[_0x4179('0x3')](_0x4179('0x15'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0x4179('0x3')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM'](_0x4179('0x15'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x4179('0x14')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0x4179('0x15'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x4179('0x3')](_0x4179('0x15'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x4179('0x3')](_0x4179('0x15'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x4179('0x3')](_0x4179('0x15'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x4179('0x1')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x4179('0x14')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x4179('0x14')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x4179('0x14')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x4179('0x3')]('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x4179('0x3')](_0x4179('0x15'),'no'),'defaultValue':_0x4179('0x15')},'announce_holdtime':{'type':Sequelize[_0x4179('0x3')](_0x4179('0x15'),'no',_0x4179('0x16')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x4179('0x1')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x4179('0x3')](_0x4179('0x15'),'no')},'announce_position_limit':{'type':Sequelize[_0x4179('0x14')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x4179('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x4179('0x1')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x4179('0x1')]},'queue_youarenext':{'type':Sequelize[_0x4179('0x1')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x4179('0x1')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x4179('0x1')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x4179('0x1')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x4179('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x4179('0x1')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x4179('0x1')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x4179('0x1')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x4179('0x1')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0x4179('0x1')]},'queue_periodic_announce':{'type':Sequelize[_0x4179('0x1')]},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize[_0x4179('0x17')],'set':function(_0x12e7b2){this[_0x4179('0xc')]('periodic_announce',_0x12e7b2?_0x12e7b2['join'](','):[]);},'get':function(){return this[_0x4179('0xe')]('periodic_announce')?this[_0x4179('0xe')]('periodic_announce')['split'](','):[];}},'joinempty':{'type':Sequelize[_0x4179('0x1')],'defaultValue':'yes','set':function(_0x1b8d93){this['setDataValue'](_0x4179('0x18'),_0x1b8d93?_0x1b8d93[_0x4179('0x19')](','):undefined);},'get':function(){return this[_0x4179('0xe')]('joinempty')?this[_0x4179('0xe')](_0x4179('0x18'))[_0x4179('0x1a')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x4179('0x1')],'defaultValue':'no','set':function(_0x3fcf0d){this[_0x4179('0xc')](_0x4179('0x1b'),_0x3fcf0d?_0x3fcf0d['join'](','):undefined);},'get':function(){return this[_0x4179('0xe')](_0x4179('0x1b'))?this[_0x4179('0xe')](_0x4179('0x1b'))[_0x4179('0x1a')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x4179('0x3')](_0x4179('0x15'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x4179('0x3')](_0x4179('0x15'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x4179('0x14')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x4179('0x3')](_0x4179('0x15'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4179('0x1')]},'acw':{'type':Sequelize[_0x4179('0x1c')],'defaultValue':0x0,'set':function(_0x569eba){this[_0x4179('0xc')]('acw',_0x569eba);if(_0x569eba){if(this['getDataValue'](_0x4179('0x1d'))<0x2){this[_0x4179('0xc')](_0x4179('0x1d'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x4179('0x14')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x4179('0x1c')],'defaultValue':0x0,'comment':_0x4179('0x1e')},'dialMethod':{'type':Sequelize['ENUM']('preview',_0x4179('0x12'),_0x4179('0x13'),_0x4179('0x1f'),'booked'),'defaultValue':_0x4179('0x12'),'comment':_0x4179('0x20')},'dialLimitChannel':{'type':Sequelize[_0x4179('0x14')](0x4)[_0x4179('0x21')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x4179('0x22')},'dialLimitQueue':{'type':Sequelize[_0x4179('0x14')](0x4)[_0x4179('0x21')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x4179('0x23')},'dialPowerLevel':{'type':Sequelize[_0x4179('0x24')](0x2)[_0x4179('0x21')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0x4179('0x25'),_0x4179('0x26')),'defaultValue':'dropRate','comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x4179('0x24')](0x2)[_0x4179('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x4179('0x27')},'dialPredictiveInterval':{'type':Sequelize[_0x4179('0x14')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x4179('0x28')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x4179('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x4179('0x14')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4179('0x29')},'dialQueueOptions':{'type':Sequelize[_0x4179('0x1')],'defaultValue':_0x4179('0x2a'),'comment':_0x4179('0x2b')},'dialQueueTimeout':{'type':Sequelize[_0x4179('0x14')](0x3)[_0x4179('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0x4179('0x2c')},'dialCongestionMaxRetry':{'type':Sequelize[_0x4179('0x14')](0x3)[_0x4179('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x4179('0x14')](0x5)[_0x4179('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x4179('0x14')](0x3)[_0x4179('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4179('0x2d')},'dialBusyRetryFrequency':{'type':Sequelize[_0x4179('0x14')](0x5)[_0x4179('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4179('0x2e')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x4179('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x4179('0x2f')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x4179('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4179('0x30')},'dialGlobalMaxRetry':{'type':Sequelize[_0x4179('0x14')](0x3)[_0x4179('0x21')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x4179('0x31')},'dialTimezone':{'type':Sequelize[_0x4179('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x4179('0x1')],'defaultValue':_0x4179('0x32')},'dialPrefix':{'type':Sequelize[_0x4179('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x4179('0x3')](_0x4179('0x33'),'never',_0x4179('0x34')),'defaultValue':_0x4179('0x33')},'dialAMDActive':{'type':Sequelize[_0x4179('0x1c')],'defaultValue':0x0,'comment':_0x4179('0x35')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x4179('0x21')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x4179('0x36')},'dialAMDGreeting':{'type':Sequelize[_0x4179('0x14')](0x9)[_0x4179('0x21')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x4179('0x37')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x4179('0x21')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x4179('0x38')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x4179('0x14')](0x9)[_0x4179('0x21')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x4179('0x39')},'dialAMDMinWordLength':{'type':Sequelize[_0x4179('0x14')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x4179('0x14')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x4179('0x14')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x4179('0x3a')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x4179('0x3b')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x4179('0x14')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x4179('0x3c')},'dialRecallMeTimeout':{'type':Sequelize[_0x4179('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x4179('0x3d')},'dialOrderByScheduledAt':{'type':Sequelize[_0x4179('0x3')]('DESC',_0x4179('0x3e')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':_0x4179('0x2c')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x4179('0x14')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x4179('0x14')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x4179('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4179('0x3f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x4179('0x14')](0x5)[_0x4179('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4179('0x40')},'dialDropMaxRetry':{'type':Sequelize[_0x4179('0x14')](0x3)[_0x4179('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4179('0x41')},'dialDropRetryFrequency':{'type':Sequelize[_0x4179('0x14')](0x5)[_0x4179('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4179('0x42')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x4179('0x14')](0x3)[_0x4179('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4179('0x43')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x4179('0x14')](0x5)[_0x4179('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x4179('0x14')](0x3)[_0x4179('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4179('0x44')},'dialMachineRetryFrequency':{'type':Sequelize[_0x4179('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4179('0x45')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x4179('0x14')](0x3)[_0x4179('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4179('0x46')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x4179('0x14')](0x5)[_0x4179('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4179('0x47')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x4179('0x1c')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x4a0317){if(!_0x4a0317)this[_0x4179('0xc')](_0x4179('0x48'),null);this[_0x4179('0xc')](_0x4179('0x49'),_0x4a0317);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x4179('0x14')](0x3)[_0x4179('0x21')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x4179('0x14')](0x3)[_0x4179('0x21')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x4179('0x14')](0x3)[_0x4179('0x21')],'defaultValue':0x4}}; \ No newline at end of file +var _0x8eb5=['NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','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)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','name','ENUM','inbound','outbound','default','ringall','leastrecent','fewestcalls','random','linear','wrandom','strategy','rrmemory','getDataValue','type','dialMethod','booked','roundrobin','progressive','power','INTEGER','yes','all','once','TEXT','setDataValue','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','wrapuptime','Active/Disactive\x20Campaign','preview','predictive','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).','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','never','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'];(function(_0x47761d,_0x3f8494){var _0x3d1c05=function(_0x3571da){while(--_0x3571da){_0x47761d['push'](_0x47761d['shift']());}};_0x3d1c05(++_0x3f8494);}(_0x8eb5,0x19a));var _0x58eb=function(_0x1515fc,_0xe9c556){_0x1515fc=_0x1515fc-0x0;var _0x15f756=_0x8eb5[_0x1515fc];return _0x15f756;};'use strict';var Sequelize=require('sequelize');module[_0x58eb('0x0')]={'name':{'type':Sequelize[_0x58eb('0x1')],'allowNull':![],'unique':_0x58eb('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x58eb('0x3')](_0x58eb('0x4'),_0x58eb('0x5')),'allowNull':![],'defaultValue':_0x58eb('0x4')},'musiconhold':{'type':Sequelize[_0x58eb('0x1')],'defaultValue':_0x58eb('0x6')},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize[_0x58eb('0x3')]('rr',_0x58eb('0x7'),_0x58eb('0x8'),_0x58eb('0x9'),_0x58eb('0xa'),'rrmemory',_0x58eb('0xb'),_0x58eb('0xc'),'rrordered'),'allowNull':![],'defaultValue':'ringall','set':function(_0x3eeaac){this['setDataValue'](_0x58eb('0xd'),_0x3eeaac?_0x3eeaac:_0x58eb('0xe'));},'get':function(){var _0x219975=this[_0x58eb('0xf')](_0x58eb('0x10'));var _0x6d5428=this['getDataValue'](_0x58eb('0x11'));var _0x46a1f4=this[_0x58eb('0xf')](_0x58eb('0xd'));if(_0x219975===_0x58eb('0x4')){return _0x46a1f4;}if(_0x6d5428===_0x58eb('0x12')&&_0x46a1f4===_0x58eb('0xe')||_0x6d5428===_0x58eb('0x12')&&_0x46a1f4===_0x58eb('0x13')){return _0x46a1f4;}if(_0x6d5428===_0x58eb('0x14')||_0x6d5428==='predictive'||_0x6d5428===_0x58eb('0x15')){return _0x46a1f4;}return null;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x58eb('0x1')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x58eb('0x16')](0xb)},'timeout':{'type':Sequelize[_0x58eb('0x16')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x58eb('0x16')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x58eb('0x1')]},'weight':{'type':Sequelize[_0x58eb('0x16')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x58eb('0x16')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x58eb('0x17')},'autopause':{'type':Sequelize[_0x58eb('0x3')](_0x58eb('0x17'),'no',_0x58eb('0x18')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize['ENUM'](_0x58eb('0x17'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x58eb('0x3')](_0x58eb('0x17'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x58eb('0x3')](_0x58eb('0x17'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x58eb('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x58eb('0x3')](_0x58eb('0x17'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x58eb('0x1')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](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[_0x58eb('0x3')](_0x58eb('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x58eb('0x3')](_0x58eb('0x17'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize[_0x58eb('0x3')]('yes','no',_0x58eb('0x19')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x58eb('0x3')](_0x58eb('0x17'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0x58eb('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x58eb('0x1')],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x58eb('0x1')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x58eb('0x1')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x58eb('0x1')],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x58eb('0x1')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x58eb('0x1')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x58eb('0x1')]},'queue_quantity1':{'type':Sequelize[_0x58eb('0x1')]},'queue_quantity2':{'type':Sequelize[_0x58eb('0x1')]},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize[_0x58eb('0x1')]},'periodic_announce':{'type':Sequelize[_0x58eb('0x1a')],'set':function(_0x2522e7){this[_0x58eb('0x1b')](_0x58eb('0x1c'),_0x2522e7?_0x2522e7[_0x58eb('0x1d')](','):[]);},'get':function(){return this[_0x58eb('0xf')]('periodic_announce')?this[_0x58eb('0xf')]('periodic_announce')[_0x58eb('0x1e')](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':_0x58eb('0x17'),'set':function(_0x1d0859){this[_0x58eb('0x1b')](_0x58eb('0x1f'),_0x1d0859?_0x1d0859[_0x58eb('0x1d')](','):undefined);},'get':function(){return this[_0x58eb('0xf')](_0x58eb('0x1f'))?this['getDataValue']('joinempty')['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x58eb('0x1')],'defaultValue':'no','set':function(_0x3d0078){this[_0x58eb('0x1b')](_0x58eb('0x20'),_0x3d0078?_0x3d0078[_0x58eb('0x1d')](','):undefined);},'get':function(){return this[_0x58eb('0xf')](_0x58eb('0x20'))?this[_0x58eb('0xf')](_0x58eb('0x20'))['split'](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0x58eb('0x17'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x58eb('0x3')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x58eb('0x16')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x58eb('0x1')]},'description':{'type':Sequelize[_0x58eb('0x1')]},'acw':{'type':Sequelize[_0x58eb('0x21')],'defaultValue':0x0,'set':function(_0x332696){this['setDataValue']('acw',_0x332696);if(_0x332696){if(this[_0x58eb('0xf')](_0x58eb('0x22'))<0x2){this['setDataValue'](_0x58eb('0x22'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x58eb('0x16')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x58eb('0x21')],'defaultValue':0x0,'comment':_0x58eb('0x23')},'dialMethod':{'type':Sequelize[_0x58eb('0x3')](_0x58eb('0x24'),_0x58eb('0x14'),_0x58eb('0x15'),_0x58eb('0x25'),_0x58eb('0x12')),'defaultValue':_0x58eb('0x14'),'comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0x58eb('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x58eb('0x27')},'dialLimitQueue':{'type':Sequelize[_0x58eb('0x16')](0x4)[_0x58eb('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x58eb('0x28')},'dialPowerLevel':{'type':Sequelize[_0x58eb('0x29')](0x2)[_0x58eb('0x26')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x58eb('0x2a')},'dialPredictiveOptimization':{'type':Sequelize[_0x58eb('0x3')]('agentBusyFactor',_0x58eb('0x2b')),'defaultValue':_0x58eb('0x2b'),'comment':_0x58eb('0x2c')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x58eb('0x29')](0x2)[_0x58eb('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x58eb('0x2d')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)[_0x58eb('0x26')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0x58eb('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x58eb('0x1')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x58eb('0x2e')},'dialQueueOptions':{'type':Sequelize[_0x58eb('0x1')],'defaultValue':'tTxX','comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x58eb('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize[_0x58eb('0x1')],'comment':_0x58eb('0x2f')},'dialCongestionMaxRetry':{'type':Sequelize[_0x58eb('0x16')](0x3)[_0x58eb('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x58eb('0x30')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x58eb('0x16')](0x5)[_0x58eb('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x58eb('0x31')},'dialBusyMaxRetry':{'type':Sequelize[_0x58eb('0x16')](0x3)[_0x58eb('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x58eb('0x32')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x58eb('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x58eb('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x58eb('0x33')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x58eb('0x16')](0x5)[_0x58eb('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x58eb('0x34')},'dialGlobalMaxRetry':{'type':Sequelize[_0x58eb('0x16')](0x3)[_0x58eb('0x26')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x58eb('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x58eb('0x1')],'defaultValue':_0x58eb('0x35')},'dialPrefix':{'type':Sequelize[_0x58eb('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x58eb('0x36'),_0x58eb('0x37'),'onlyIfOpen'),'defaultValue':_0x58eb('0x36')},'dialAMDActive':{'type':Sequelize[_0x58eb('0x21')],'defaultValue':0x0,'comment':_0x58eb('0x38')},'dialAMDInitialSilence':{'type':Sequelize[_0x58eb('0x16')](0x9)[_0x58eb('0x26')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x58eb('0x26')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x58eb('0x39')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x58eb('0x16')](0x9)[_0x58eb('0x26')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x58eb('0x3a')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x58eb('0x16')](0x9)[_0x58eb('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x58eb('0x3b')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x58eb('0x26')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x58eb('0x3c')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x58eb('0x3d')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x58eb('0x16')](0x9)[_0x58eb('0x26')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x58eb('0x3e')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x58eb('0x16')](0x5)[_0x58eb('0x26')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x58eb('0x16')](0x9)[_0x58eb('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x58eb('0x3f')},'dialRecallMeTimeout':{'type':Sequelize[_0x58eb('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x58eb('0x40')},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0x58eb('0x3')](_0x58eb('0x41'),_0x58eb('0x42')),'defaultValue':_0x58eb('0x41')},'dialQueueProject2':{'type':Sequelize[_0x58eb('0x1')],'comment':_0x58eb('0x2f')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x58eb('0x21')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x58eb('0x21')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x58eb('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x58eb('0x43')},'dialCutDigit':{'type':Sequelize[_0x58eb('0x16')](0x3)[_0x58eb('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x58eb('0x44')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x58eb('0x45')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x58eb('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x58eb('0x46')},'dialDropMaxRetry':{'type':Sequelize[_0x58eb('0x16')](0x3)[_0x58eb('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x58eb('0x47')},'dialDropRetryFrequency':{'type':Sequelize[_0x58eb('0x16')](0x5)[_0x58eb('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x58eb('0x48')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x58eb('0x16')](0x3)[_0x58eb('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x58eb('0x16')](0x5)[_0x58eb('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x58eb('0x49')},'dialMachineMaxRetry':{'type':Sequelize[_0x58eb('0x16')](0x3)[_0x58eb('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x58eb('0x4a')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x58eb('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x58eb('0x4b')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x58eb('0x16')](0x3)[_0x58eb('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x58eb('0x16')](0x5)[_0x58eb('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0x58eb('0x16')],'allowNull':!![],'comment':_0x58eb('0x4c')},'mandatoryDisposition':{'type':Sequelize[_0x58eb('0x21')],'defaultValue':![],'comment':_0x58eb('0x4d'),'set':function(_0x221d62){if(!_0x221d62)this[_0x58eb('0x1b')](_0x58eb('0x4e'),null);this['setDataValue'](_0x58eb('0x4f'),_0x221d62);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x58eb('0x26')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x58eb('0x16')](0x3)[_0x58eb('0x26')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x58eb('0x16')](0x3)[_0x58eb('0x26')],'defaultValue':0x4}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index e7025d6..69f2341 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 _0xabce=['voicePause','forEach','emit','removeTeams','ids','select','field','from','team_has_voice_queues','join','ut.TeamId\x20=\x20tq.TeamId','push','sequelize','toString','QueryTypes','SELECT','TeamId','all','union','transaction','removeAgents','userVoiceQueue:remove','addAgents','userVoiceQueue:save','User','online','isEmpty','isArray','getAgents','getMembers','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','spread','dialCheckDuplicateType','always','insert','into','fromQuery','scheduledAt','ContactId','ListId','phone','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','VoiceQueueId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','cm_hopper','phone\x20IS\x20NOT\x20NULL','cm_hopper_additional_phones','CmHopperId','OrderBy','h.id','cm_contact_has_items','h.scheduledat=?','PHONE','removeLists','NOW()','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','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/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./voiceQueue.socket','sendStatus','end','status','offset','undefined','limit','count','set','json','reject','save','then','destroy','get','inbound','outbound','ignore','map','value','includes','type','find','name','error','stack','send','index','rawAttributes','fieldName','key','query','keys','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filters','merge','VIRTUAL','filter','options','VoiceQueue','includeAll','include','findAll','catch','show','params','intersection','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','QueueCampaigns','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','role','VoiceQueues','update','getHoppers','findOne','CmHopper','VoiceQueueId','rows','getHopperHistories','CmHopperHistory','CmHopperFinal','nolimit','getHopperBlacks','CmHopperBlack','Team','getTeams','addTeams','teams','interface','flatMap','Agents','penalty','each','TeamVoiceQueue','upsert','UserVoiceQueue','UserVoiceQueueRt','isNil','format','SIP/%s'];(function(_0x3c0104,_0x1118c2){var _0x59c796=function(_0x4c20a7){while(--_0x4c20a7){_0x3c0104['push'](_0x3c0104['shift']());}};_0x59c796(++_0x1118c2);}(_0xabce,0x103));var _0xeabc=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xabce[_0x5e3b04];return _0x1fc44d;};'use strict';var emlformat=require(_0xeabc('0x0'));var rimraf=require(_0xeabc('0x1'));var zipdir=require(_0xeabc('0x2'));var jsonpatch=require(_0xeabc('0x3'));var rp=require(_0xeabc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeabc('0x5'));var util=require(_0xeabc('0x6'));var path=require(_0xeabc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeabc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeabc('0x9'));var squel=require('squel');var crypto=require(_0xeabc('0xa'));var jsforce=require(_0xeabc('0xb'));var deskjs=require(_0xeabc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeabc('0xd'));var Papa=require(_0xeabc('0xe'));var Redis=require(_0xeabc('0xf'));var authService=require(_0xeabc('0x10'));var qs=require(_0xeabc('0x11'));var as=require(_0xeabc('0x12'));var hardwareService=require(_0xeabc('0x13'));var logger=require(_0xeabc('0x14'))(_0xeabc('0x15'));var utils=require(_0xeabc('0x16'));var config=require(_0xeabc('0x17'));var licenseUtil=require(_0xeabc('0x18'));var db=require(_0xeabc('0x19'))['db'];config[_0xeabc('0x1a')]=_[_0xeabc('0x1b')](config[_0xeabc('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xeabc('0x1c'))(new Redis(config[_0xeabc('0x1a')]));require(_0xeabc('0x1d'))['register'](socket);function respondWithStatusCode(_0x5f4ee8,_0x3170ea){_0x3170ea=_0x3170ea||0xcc;return function(_0x3ae954){if(_0x3ae954){return _0x5f4ee8[_0xeabc('0x1e')](_0x3170ea);}return _0x5f4ee8['status'](_0x3170ea)[_0xeabc('0x1f')]();};}function respondWithResult(_0x638976,_0x49f2d8){_0x49f2d8=_0x49f2d8||0xc8;return function(_0x53fe28){if(_0x53fe28){return _0x638976[_0xeabc('0x20')](_0x49f2d8)['json'](_0x53fe28);}};}function respondWithFilteredResult(_0x3d0e21,_0x1b64b9){return function(_0x58a3c0){if(_0x58a3c0){var _0x16f08b=typeof _0x1b64b9[_0xeabc('0x21')]===_0xeabc('0x22')&&typeof _0x1b64b9[_0xeabc('0x23')]===_0xeabc('0x22');var _0x5d92e5=_0x58a3c0[_0xeabc('0x24')];var _0x4d68ea=_0x16f08b?0x0:_0x1b64b9[_0xeabc('0x21')];var _0x16530c=_0x16f08b?_0x58a3c0['count']:_0x1b64b9[_0xeabc('0x21')]+_0x1b64b9[_0xeabc('0x23')];var _0x254590;if(_0x16530c>=_0x5d92e5){_0x16530c=_0x5d92e5;_0x254590=0xc8;}else{_0x254590=0xce;}_0x3d0e21[_0xeabc('0x20')](_0x254590);return _0x3d0e21[_0xeabc('0x25')]('Content-Range',_0x4d68ea+'-'+_0x16530c+'/'+_0x5d92e5)[_0xeabc('0x26')](_0x58a3c0);}return null;};}function patchUpdates(_0x10c675){return function(_0x91ab00){try{jsonpatch['apply'](_0x91ab00,_0x10c675,!![]);}catch(_0x457f27){return BPromise[_0xeabc('0x27')](_0x457f27);}return _0x91ab00[_0xeabc('0x28')]();};}function saveUpdates(_0x319119,_0x5b8838){return function(_0x109e1d){if(_0x109e1d){return _0x109e1d['update'](_0x319119)[_0xeabc('0x29')](function(_0x4d4e29){return _0x4d4e29;});}return null;};}function removeEntity(_0x811f0d,_0x12acbd){return function(_0x269621){if(_0x269621){return _0x269621[_0xeabc('0x2a')]()[_0xeabc('0x29')](function(){var _0x137293=_0x269621[_0xeabc('0x2b')]({'plain':!![]});var _0x4c2693=[{'name':'VoiceQueues','value':_0xeabc('0x2c'),'ignore':![]},{'name':'QueueCampaigns','value':_0xeabc('0x2d'),'ignore':![]}];var _0x2b342c=_(_0x4c2693)['filter'](_0xeabc('0x2e'))[_0xeabc('0x2f')](_0xeabc('0x30'))[_0xeabc('0x30')]();if(_[_0xeabc('0x31')](_0x2b342c,_0x137293[_0xeabc('0x32')])){return;}var _0x2c62fe=_[_0xeabc('0x33')](_0x4c2693,[_0xeabc('0x30'),_0x137293['type']])[_0xeabc('0x34')];return db['UserProfileResource'][_0xeabc('0x2a')]({'where':{'type':_0x2c62fe,'resourceId':_0x137293['id']}})[_0xeabc('0x29')](function(){return _0x269621;});})[_0xeabc('0x29')](function(){_0x811f0d[_0xeabc('0x20')](0xcc)[_0xeabc('0x1f')]();});}};}function handleEntityNotFound(_0x368b8a,_0x61c0af){return function(_0x545d7f){if(!_0x545d7f){_0x368b8a[_0xeabc('0x1e')](0x194);}return _0x545d7f;};}function handleError(_0x2df9e6,_0x3bc45e){_0x3bc45e=_0x3bc45e||0x1f4;return function(_0x4918e2){logger[_0xeabc('0x35')](_0x4918e2[_0xeabc('0x36')]);if(_0x4918e2[_0xeabc('0x34')]){delete _0x4918e2['name'];}_0x2df9e6[_0xeabc('0x20')](_0x3bc45e)[_0xeabc('0x37')](_0x4918e2);};}exports[_0xeabc('0x38')]=function(_0x521091,_0xf98c7c){var _0x286203={},_0x5d9acf={},_0x50cca2={'count':0x0,'rows':[]};var _0x254568=_[_0xeabc('0x2f')](db['VoiceQueue'][_0xeabc('0x39')],function(_0x81976d){return{'name':_0x81976d[_0xeabc('0x3a')],'type':_0x81976d[_0xeabc('0x32')][_0xeabc('0x3b')]};});_0x5d9acf['model']=_[_0xeabc('0x2f')](_0x254568,'name');_0x5d9acf[_0xeabc('0x3c')]=_[_0xeabc('0x3d')](_0x521091[_0xeabc('0x3c')]);_0x5d9acf['filters']=_['intersection'](_0x5d9acf[_0xeabc('0x3e')],_0x5d9acf['query']);_0x286203[_0xeabc('0x3f')]=_['intersection'](_0x5d9acf['model'],qs['fields'](_0x521091['query'][_0xeabc('0x40')]));_0x286203['attributes']=_0x286203[_0xeabc('0x3f')][_0xeabc('0x41')]?_0x286203['attributes']:_0x5d9acf[_0xeabc('0x3e')];if(!_0x521091['query'][_0xeabc('0x42')]('nolimit')){_0x286203[_0xeabc('0x23')]=qs[_0xeabc('0x23')](_0x521091[_0xeabc('0x3c')]['limit']);_0x286203['offset']=qs['offset'](_0x521091[_0xeabc('0x3c')][_0xeabc('0x21')]);}_0x286203[_0xeabc('0x43')]=qs['sort'](_0x521091['query'][_0xeabc('0x44')]);_0x286203[_0xeabc('0x45')]=qs['filters'](_[_0xeabc('0x46')](_0x521091['query'],_0x5d9acf[_0xeabc('0x47')]),_0x254568);if(_0x521091['query']['filter']){_0x286203['where']=_[_0xeabc('0x48')](_0x286203[_0xeabc('0x45')],{'$or':_[_0xeabc('0x2f')](_0x254568,function(_0x3eeeb5){if(_0x3eeeb5['type']!==_0xeabc('0x49')){var _0x555d26={};_0x555d26[_0x3eeeb5[_0xeabc('0x34')]]={'$like':'%'+_0x521091[_0xeabc('0x3c')][_0xeabc('0x4a')]+'%'};return _0x555d26;}})});}_0x286203=_[_0xeabc('0x48')]({},_0x286203,_0x521091[_0xeabc('0x4b')]);var _0x48b988={'where':_0x286203['where']};return db[_0xeabc('0x4c')]['count'](_0x48b988)[_0xeabc('0x29')](function(_0x2cdf59){_0x50cca2['count']=_0x2cdf59;if(_0x521091[_0xeabc('0x3c')][_0xeabc('0x4d')]){_0x286203[_0xeabc('0x4e')]=[{'all':!![]}];}return db[_0xeabc('0x4c')][_0xeabc('0x4f')](_0x286203);})[_0xeabc('0x29')](function(_0x2003a7){_0x50cca2['rows']=_0x2003a7;return _0x50cca2;})[_0xeabc('0x29')](respondWithFilteredResult(_0xf98c7c,_0x286203))[_0xeabc('0x50')](handleError(_0xf98c7c,null));};exports[_0xeabc('0x51')]=function(_0x1b41c8,_0x271f8c){var _0x3fbc97={'raw':![],'where':{'id':_0x1b41c8[_0xeabc('0x52')]['id']}},_0x2107d5={};_0x2107d5[_0xeabc('0x3e')]=_[_0xeabc('0x3d')](db['VoiceQueue'][_0xeabc('0x39')]);_0x2107d5[_0xeabc('0x3c')]=_[_0xeabc('0x3d')](_0x1b41c8[_0xeabc('0x3c')]);_0x2107d5[_0xeabc('0x47')]=_[_0xeabc('0x53')](_0x2107d5[_0xeabc('0x3e')],_0x2107d5['query']);_0x3fbc97[_0xeabc('0x3f')]=_[_0xeabc('0x53')](_0x2107d5[_0xeabc('0x3e')],qs[_0xeabc('0x40')](_0x1b41c8[_0xeabc('0x3c')]['fields']));_0x3fbc97[_0xeabc('0x3f')]=_0x3fbc97[_0xeabc('0x3f')][_0xeabc('0x41')]?_0x3fbc97[_0xeabc('0x3f')]:_0x2107d5['model'];if(_0x1b41c8[_0xeabc('0x3c')][_0xeabc('0x4d')]){_0x3fbc97['include']=[{'all':!![]}];}_0x3fbc97=_[_0xeabc('0x48')]({},_0x3fbc97,_0x1b41c8['options']);return db[_0xeabc('0x4c')]['find'](_0x3fbc97)[_0xeabc('0x29')](handleEntityNotFound(_0x271f8c,null))[_0xeabc('0x29')](respondWithResult(_0x271f8c,null))[_0xeabc('0x50')](handleError(_0x271f8c,null));};exports[_0xeabc('0x54')]=function(_0x1ee837,_0x15ba95){return db[_0xeabc('0x4c')][_0xeabc('0x54')](_0x1ee837[_0xeabc('0x55')],{})[_0xeabc('0x29')](function(_0x48a13f){var _0x180a14=_0x1ee837[_0xeabc('0x56')][_0xeabc('0x2b')]({'plain':!![]});if(!_0x180a14)throw new Error(_0xeabc('0x57'));if(_0x180a14['role']===_0xeabc('0x56')){var _0x392913=_0x48a13f[_0xeabc('0x2b')]({'plain':!![]});var _0x21f972=[{'name':'VoiceQueues','value':_0xeabc('0x2c')},{'name':_0xeabc('0x58'),'value':_0xeabc('0x2d')}];var _0xa55cce=_[_0xeabc('0x33')](_0x21f972,[_0xeabc('0x30'),_0x392913[_0xeabc('0x32')]])[_0xeabc('0x34')];return db[_0xeabc('0x59')]['find']({'where':{'name':_0xa55cce,'userProfileId':_0x180a14[_0xeabc('0x5a')]},'raw':!![]})['then'](function(_0x5e09fc){if(_0x5e09fc&&_0x5e09fc['autoAssociation']===0x0){return db[_0xeabc('0x5b')][_0xeabc('0x54')]({'name':_0x392913[_0xeabc('0x34')],'resourceId':_0x392913['id'],'type':_0x5e09fc[_0xeabc('0x34')],'sectionId':_0x5e09fc['id']},{})[_0xeabc('0x29')](function(){return _0x48a13f;});}else{return _0x48a13f;}})[_0xeabc('0x50')](function(_0x4a2ad6){logger[_0xeabc('0x35')](_0xeabc('0x5c'),_0x4a2ad6);throw _0x4a2ad6;});}return _0x48a13f;})[_0xeabc('0x29')](respondWithResult(_0x15ba95,0xc9))[_0xeabc('0x50')](handleError(_0x15ba95,null));};exports[_0xeabc('0x5d')]=function(_0x2c7b4e,_0x1750e9){var _0x25c728={'where':{'id':_0x2c7b4e['params']['id']}},_0x5820ca={};_0x5820ca[_0xeabc('0x3e')]=_[_0xeabc('0x3d')](db[_0xeabc('0x4c')]['rawAttributes']);_0x25c728[_0xeabc('0x3f')]=_['intersection'](_0x5820ca['model'],qs[_0xeabc('0x40')](_0x2c7b4e[_0xeabc('0x3c')][_0xeabc('0x40')]));_0x25c728[_0xeabc('0x3f')]=_0x25c728[_0xeabc('0x3f')][_0xeabc('0x41')]?_0x25c728['attributes']:_0x5820ca[_0xeabc('0x3e')];if(_0x2c7b4e[_0xeabc('0x3c')][_0xeabc('0x4d')]){_0x25c728[_0xeabc('0x4e')]=[{'all':!![]}];}_0x25c728=_[_0xeabc('0x48')]({},_0x25c728,_0x2c7b4e[_0xeabc('0x4b')]);return db['VoiceQueue'][_0xeabc('0x33')](_0x25c728)[_0xeabc('0x29')](handleEntityNotFound(_0x1750e9,null))[_0xeabc('0x29')](function(_0x165899){if(_0x165899){var _0x1b61a8=_0x165899[_0xeabc('0x2b')]({'plain':!![]});_0x1b61a8=qs[_0xeabc('0x5e')](_0x1b61a8,['id',_0xeabc('0x5f'),_0xeabc('0x60')]);_0x2c7b4e['body']=_[_0xeabc('0x5e')](_0x2c7b4e['body'],['id',_0xeabc('0x5f'),_0xeabc('0x60')]);return db[_0xeabc('0x4c')][_0xeabc('0x54')](_[_0xeabc('0x48')](_0x1b61a8,_0x2c7b4e[_0xeabc('0x55')]),{'include':_0x2c7b4e[_0xeabc('0x3c')][_0xeabc('0x4d')]?[{'all':!![]}]:undefined})[_0xeabc('0x29')](function(_0x24d0e5){var _0x5702cb=_0x2c7b4e[_0xeabc('0x56')][_0xeabc('0x2b')]({'plain':!![]});if(!_0x5702cb)throw new Error(_0xeabc('0x57'));if(_0x5702cb[_0xeabc('0x61')]==='user'){var _0x12fd48=_0x24d0e5['get']({'plain':!![]});var _0x54e7d6=[{'name':_0xeabc('0x62'),'value':_0xeabc('0x2c')},{'name':_0xeabc('0x58'),'value':_0xeabc('0x2d')}];var _0x4b7730=_['find'](_0x54e7d6,[_0xeabc('0x30'),_0x12fd48['type']])['name'];return db[_0xeabc('0x59')]['find']({'where':{'name':_0x4b7730,'userProfileId':_0x5702cb['userProfileId']},'raw':!![]})[_0xeabc('0x29')](function(_0x1c84b5){if(_0x1c84b5&&_0x1c84b5['autoAssociation']===0x0){return db['UserProfileResource'][_0xeabc('0x54')]({'name':_0x12fd48['name'],'resourceId':_0x12fd48['id'],'type':_0x1c84b5[_0xeabc('0x34')],'sectionId':_0x1c84b5['id']},{})[_0xeabc('0x29')](function(){return _0x24d0e5;});}else{return _0x24d0e5;}})['catch'](function(_0x5d6477){logger[_0xeabc('0x35')](_0xeabc('0x5c'),_0x5d6477);throw _0x5d6477;});}return _0x24d0e5;});}})[_0xeabc('0x29')](respondWithResult(_0x1750e9,0xc9))[_0xeabc('0x50')](handleError(_0x1750e9,null));};exports[_0xeabc('0x63')]=function(_0x511b33,_0x53f578){if(_0x511b33[_0xeabc('0x55')]['id']){delete _0x511b33['body']['id'];}return db[_0xeabc('0x4c')]['find']({'where':{'id':_0x511b33[_0xeabc('0x52')]['id']}})['then'](handleEntityNotFound(_0x53f578,null))[_0xeabc('0x29')](saveUpdates(_0x511b33['body'],null))[_0xeabc('0x29')](respondWithResult(_0x53f578,null))[_0xeabc('0x50')](handleError(_0x53f578,null));};exports[_0xeabc('0x2a')]=function(_0x36cc41,_0x5e121c){return db[_0xeabc('0x4c')]['find']({'where':{'id':_0x36cc41[_0xeabc('0x52')]['id']}})[_0xeabc('0x29')](handleEntityNotFound(_0x5e121c,null))[_0xeabc('0x29')](removeEntity(_0x5e121c,null))[_0xeabc('0x50')](handleError(_0x5e121c,null));};exports[_0xeabc('0x64')]=function(_0x5c1ab2,_0x239350,_0x329d8b){var _0x4b9614={'raw':![],'where':{}};var _0x2509a4={};var _0x5427c8={'count':0x0,'rows':[]};return db[_0xeabc('0x4c')][_0xeabc('0x65')]({'where':{'id':_0x5c1ab2[_0xeabc('0x52')]['id']}})[_0xeabc('0x29')](handleEntityNotFound(_0x239350,null))['then'](function(_0xb9b460){if(_0xb9b460){_0x2509a4[_0xeabc('0x3e')]=_[_0xeabc('0x3d')](db[_0xeabc('0x66')]['rawAttributes']);_0x2509a4['query']=_[_0xeabc('0x3d')](_0x5c1ab2['query']);_0x2509a4['filters']=_[_0xeabc('0x53')](_0x2509a4[_0xeabc('0x3e')],_0x2509a4[_0xeabc('0x3c')]);_0x4b9614['attributes']=_[_0xeabc('0x53')](_0x2509a4[_0xeabc('0x3e')],qs['fields'](_0x5c1ab2[_0xeabc('0x3c')][_0xeabc('0x40')]));_0x4b9614[_0xeabc('0x3f')]=_0x4b9614[_0xeabc('0x3f')][_0xeabc('0x41')]?_0x4b9614['attributes']:_0x2509a4[_0xeabc('0x3e')];if(!_0x5c1ab2['query']['hasOwnProperty']('nolimit')){_0x4b9614[_0xeabc('0x23')]=qs[_0xeabc('0x23')](_0x5c1ab2[_0xeabc('0x3c')][_0xeabc('0x23')]);_0x4b9614[_0xeabc('0x21')]=qs['offset'](_0x5c1ab2[_0xeabc('0x3c')]['offset']);}_0x4b9614[_0xeabc('0x43')]=qs[_0xeabc('0x44')](_0x5c1ab2['query'][_0xeabc('0x44')]);_0x4b9614['where']=qs['filters'](_[_0xeabc('0x46')](_0x5c1ab2[_0xeabc('0x3c')],_0x2509a4[_0xeabc('0x47')]));_0x4b9614[_0xeabc('0x45')][_0xeabc('0x67')]=_0xb9b460['id'];if(_0x5c1ab2['query'][_0xeabc('0x4a')]){_0x4b9614[_0xeabc('0x45')]=_[_0xeabc('0x48')](_0x4b9614[_0xeabc('0x45')],{'$or':_[_0xeabc('0x2f')](_0x4b9614[_0xeabc('0x3f')],function(_0x2d05b4){var _0x419fc6={};_0x419fc6[_0x2d05b4]={'$like':'%'+_0x5c1ab2[_0xeabc('0x3c')][_0xeabc('0x4a')]+'%'};return _0x419fc6;})});}_0x4b9614=_['merge']({},_0x4b9614,_0x5c1ab2[_0xeabc('0x4b')]);return db[_0xeabc('0x66')][_0xeabc('0x24')]({'where':_0x4b9614['where']})['then'](function(_0x1506bd){_0x5427c8[_0xeabc('0x24')]=_0x1506bd;if(_0x5c1ab2[_0xeabc('0x3c')][_0xeabc('0x4d')]){_0x4b9614[_0xeabc('0x4e')]=[{'all':!![]}];}return db['CmHopper'][_0xeabc('0x4f')](_0x4b9614);})['then'](function(_0x5f39ef){_0x5427c8[_0xeabc('0x68')]=_0x5f39ef;return _0x5427c8;});}})[_0xeabc('0x29')](respondWithFilteredResult(_0x239350,_0x4b9614))['catch'](handleError(_0x239350,null));};exports[_0xeabc('0x69')]=function(_0x45c9c7,_0x49a70a,_0x5963f7){var _0xfaef39={'raw':!![],'where':{}};var _0xb04677={};var _0x135a79={'count':0x0,'rows':[]};return db[_0xeabc('0x4c')][_0xeabc('0x65')]({'where':{'id':_0x45c9c7[_0xeabc('0x52')]['id']}})[_0xeabc('0x29')](handleEntityNotFound(_0x49a70a,null))['then'](function(_0xb54c35){if(_0xb54c35){_0xb04677['model']=_[_0xeabc('0x3d')](db[_0xeabc('0x6a')][_0xeabc('0x39')]);_0xb04677[_0xeabc('0x3c')]=_[_0xeabc('0x3d')](_0x45c9c7[_0xeabc('0x3c')]);_0xb04677[_0xeabc('0x47')]=_[_0xeabc('0x53')](_0xb04677[_0xeabc('0x3e')],_0xb04677[_0xeabc('0x3c')]);_0xfaef39[_0xeabc('0x3f')]=_['intersection'](_0xb04677[_0xeabc('0x3e')],qs[_0xeabc('0x40')](_0x45c9c7[_0xeabc('0x3c')][_0xeabc('0x40')]));_0xfaef39['attributes']=_0xfaef39[_0xeabc('0x3f')][_0xeabc('0x41')]?_0xfaef39['attributes']:_0xb04677[_0xeabc('0x3e')];if(!_0x45c9c7[_0xeabc('0x3c')]['hasOwnProperty']('nolimit')){_0xfaef39['limit']=qs['limit'](_0x45c9c7[_0xeabc('0x3c')][_0xeabc('0x23')]);_0xfaef39[_0xeabc('0x21')]=qs[_0xeabc('0x21')](_0x45c9c7[_0xeabc('0x3c')][_0xeabc('0x21')]);}_0xfaef39[_0xeabc('0x43')]=qs[_0xeabc('0x44')](_0x45c9c7[_0xeabc('0x3c')][_0xeabc('0x44')]);_0xfaef39['where']=qs[_0xeabc('0x47')](_[_0xeabc('0x46')](_0x45c9c7['query'],_0xb04677[_0xeabc('0x47')]));_0xfaef39[_0xeabc('0x45')][_0xeabc('0x67')]=_0xb54c35['id'];if(_0x45c9c7['query'][_0xeabc('0x4a')]){_0xfaef39['where']=_[_0xeabc('0x48')](_0xfaef39[_0xeabc('0x45')],{'$or':_[_0xeabc('0x2f')](_0xfaef39[_0xeabc('0x3f')],function(_0x1c52f7){var _0x5e7e00={};_0x5e7e00[_0x1c52f7]={'$like':'%'+_0x45c9c7['query']['filter']+'%'};return _0x5e7e00;})});}_0xfaef39=_['merge']({},_0xfaef39,_0x45c9c7[_0xeabc('0x4b')]);return db[_0xeabc('0x6a')][_0xeabc('0x24')]({'where':_0xfaef39['where']})[_0xeabc('0x29')](function(_0x19536d){_0x135a79[_0xeabc('0x24')]=_0x19536d;if(_0x45c9c7[_0xeabc('0x3c')][_0xeabc('0x4d')]){_0xfaef39[_0xeabc('0x4e')]=[{'all':!![]}];}return db[_0xeabc('0x6a')][_0xeabc('0x4f')](_0xfaef39);})[_0xeabc('0x29')](function(_0x391e67){_0x135a79[_0xeabc('0x68')]=_0x391e67;return _0x135a79;});}})[_0xeabc('0x29')](respondWithFilteredResult(_0x49a70a,_0xfaef39))['catch'](handleError(_0x49a70a,null));};exports['getHopperFinals']=function(_0x3286a2,_0x50a5d5,_0x20c4d7){var _0x18ee16={'raw':!![],'where':{}};var _0x102591={};var _0x56f622={'count':0x0,'rows':[]};return db[_0xeabc('0x4c')][_0xeabc('0x65')]({'where':{'id':_0x3286a2[_0xeabc('0x52')]['id']}})['then'](handleEntityNotFound(_0x50a5d5,null))['then'](function(_0x3557f2){if(_0x3557f2){_0x102591[_0xeabc('0x3e')]=_[_0xeabc('0x3d')](db[_0xeabc('0x6b')][_0xeabc('0x39')]);_0x102591[_0xeabc('0x3c')]=_['keys'](_0x3286a2['query']);_0x102591[_0xeabc('0x47')]=_[_0xeabc('0x53')](_0x102591[_0xeabc('0x3e')],_0x102591[_0xeabc('0x3c')]);_0x18ee16['attributes']=_['intersection'](_0x102591['model'],qs[_0xeabc('0x40')](_0x3286a2['query'][_0xeabc('0x40')]));_0x18ee16['attributes']=_0x18ee16[_0xeabc('0x3f')]['length']?_0x18ee16[_0xeabc('0x3f')]:_0x102591[_0xeabc('0x3e')];if(!_0x3286a2[_0xeabc('0x3c')][_0xeabc('0x42')](_0xeabc('0x6c'))){_0x18ee16['limit']=qs[_0xeabc('0x23')](_0x3286a2[_0xeabc('0x3c')][_0xeabc('0x23')]);_0x18ee16['offset']=qs[_0xeabc('0x21')](_0x3286a2[_0xeabc('0x3c')][_0xeabc('0x21')]);}_0x18ee16[_0xeabc('0x43')]=qs[_0xeabc('0x44')](_0x3286a2['query'][_0xeabc('0x44')]);_0x18ee16[_0xeabc('0x45')]=qs['filters'](_[_0xeabc('0x46')](_0x3286a2[_0xeabc('0x3c')],_0x102591['filters']));_0x18ee16[_0xeabc('0x45')][_0xeabc('0x67')]=_0x3557f2['id'];if(_0x3286a2[_0xeabc('0x3c')][_0xeabc('0x4a')]){_0x18ee16[_0xeabc('0x45')]=_[_0xeabc('0x48')](_0x18ee16[_0xeabc('0x45')],{'$or':_[_0xeabc('0x2f')](_0x18ee16[_0xeabc('0x3f')],function(_0x11a185){var _0x223cd6={};_0x223cd6[_0x11a185]={'$like':'%'+_0x3286a2[_0xeabc('0x3c')][_0xeabc('0x4a')]+'%'};return _0x223cd6;})});}_0x18ee16=_['merge']({},_0x18ee16,_0x3286a2['options']);return db[_0xeabc('0x6b')][_0xeabc('0x24')]({'where':_0x18ee16[_0xeabc('0x45')]})[_0xeabc('0x29')](function(_0x5805c9){_0x56f622[_0xeabc('0x24')]=_0x5805c9;if(_0x3286a2['query']['includeAll']){_0x18ee16['include']=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x18ee16);})['then'](function(_0x72dd0e){_0x56f622[_0xeabc('0x68')]=_0x72dd0e;return _0x56f622;});}})[_0xeabc('0x29')](respondWithFilteredResult(_0x50a5d5,_0x18ee16))[_0xeabc('0x50')](handleError(_0x50a5d5,null));};exports[_0xeabc('0x6d')]=function(_0xe27492,_0x152d99,_0x3eaedf){var _0x44dc85={'raw':!![],'where':{}};var _0x550273={};var _0x3b1f77={'count':0x0,'rows':[]};return db[_0xeabc('0x4c')][_0xeabc('0x65')]({'where':{'id':_0xe27492[_0xeabc('0x52')]['id']}})[_0xeabc('0x29')](handleEntityNotFound(_0x152d99,null))[_0xeabc('0x29')](function(_0x2a29d7){if(_0x2a29d7){_0x550273['model']=_[_0xeabc('0x3d')](db['CmHopperBlack'][_0xeabc('0x39')]);_0x550273[_0xeabc('0x3c')]=_['keys'](_0xe27492[_0xeabc('0x3c')]);_0x550273['filters']=_[_0xeabc('0x53')](_0x550273[_0xeabc('0x3e')],_0x550273[_0xeabc('0x3c')]);_0x44dc85[_0xeabc('0x3f')]=_[_0xeabc('0x53')](_0x550273[_0xeabc('0x3e')],qs[_0xeabc('0x40')](_0xe27492[_0xeabc('0x3c')][_0xeabc('0x40')]));_0x44dc85['attributes']=_0x44dc85['attributes'][_0xeabc('0x41')]?_0x44dc85[_0xeabc('0x3f')]:_0x550273['model'];if(!_0xe27492[_0xeabc('0x3c')]['hasOwnProperty'](_0xeabc('0x6c'))){_0x44dc85[_0xeabc('0x23')]=qs[_0xeabc('0x23')](_0xe27492[_0xeabc('0x3c')][_0xeabc('0x23')]);_0x44dc85[_0xeabc('0x21')]=qs['offset'](_0xe27492[_0xeabc('0x3c')]['offset']);}_0x44dc85[_0xeabc('0x43')]=qs[_0xeabc('0x44')](_0xe27492[_0xeabc('0x3c')][_0xeabc('0x44')]);_0x44dc85['where']=qs[_0xeabc('0x47')](_[_0xeabc('0x46')](_0xe27492[_0xeabc('0x3c')],_0x550273['filters']));_0x44dc85[_0xeabc('0x45')][_0xeabc('0x67')]=_0x2a29d7['id'];if(_0xe27492[_0xeabc('0x3c')]['filter']){_0x44dc85['where']=_['merge'](_0x44dc85['where'],{'$or':_[_0xeabc('0x2f')](_0x44dc85[_0xeabc('0x3f')],function(_0x52e84f){var _0x12f024={};_0x12f024[_0x52e84f]={'$like':'%'+_0xe27492[_0xeabc('0x3c')][_0xeabc('0x4a')]+'%'};return _0x12f024;})});}_0x44dc85=_[_0xeabc('0x48')]({},_0x44dc85,_0xe27492[_0xeabc('0x4b')]);return db[_0xeabc('0x6e')][_0xeabc('0x24')]({'where':_0x44dc85[_0xeabc('0x45')]})[_0xeabc('0x29')](function(_0x4df674){_0x3b1f77[_0xeabc('0x24')]=_0x4df674;if(_0xe27492['query'][_0xeabc('0x4d')]){_0x44dc85[_0xeabc('0x4e')]=[{'all':!![]}];}return db[_0xeabc('0x6e')][_0xeabc('0x4f')](_0x44dc85);})[_0xeabc('0x29')](function(_0x3a43ad){_0x3b1f77[_0xeabc('0x68')]=_0x3a43ad;return _0x3b1f77;});}})['then'](respondWithFilteredResult(_0x152d99,_0x44dc85))[_0xeabc('0x50')](handleError(_0x152d99,null));};exports['getTeams']=function(_0x475160,_0x4d8953,_0x10d66b){var _0x12a042={};var _0x266b53={};var _0x1aee85;var _0x507037;return db['VoiceQueue'][_0xeabc('0x65')]({'where':{'id':_0x475160[_0xeabc('0x52')]['id']}})[_0xeabc('0x29')](handleEntityNotFound(_0x4d8953,null))[_0xeabc('0x29')](function(_0x3339ce){if(_0x3339ce){_0x1aee85=_0x3339ce;_0x266b53['model']=_[_0xeabc('0x3d')](db[_0xeabc('0x6f')][_0xeabc('0x39')]);_0x266b53[_0xeabc('0x3c')]=_[_0xeabc('0x3d')](_0x475160['query']);_0x266b53[_0xeabc('0x47')]=_['intersection'](_0x266b53[_0xeabc('0x3e')],_0x266b53[_0xeabc('0x3c')]);_0x12a042[_0xeabc('0x3f')]=_[_0xeabc('0x53')](_0x266b53[_0xeabc('0x3e')],qs[_0xeabc('0x40')](_0x475160[_0xeabc('0x3c')][_0xeabc('0x40')]));_0x12a042[_0xeabc('0x3f')]=_0x12a042[_0xeabc('0x3f')]['length']?_0x12a042[_0xeabc('0x3f')]:_0x266b53[_0xeabc('0x3e')];_0x12a042[_0xeabc('0x43')]=qs[_0xeabc('0x44')](_0x475160['query'][_0xeabc('0x44')]);_0x12a042['where']=qs['filters'](_[_0xeabc('0x46')](_0x475160[_0xeabc('0x3c')],_0x266b53[_0xeabc('0x47')]));if(_0x475160['query'][_0xeabc('0x4a')]){_0x12a042[_0xeabc('0x45')]=_[_0xeabc('0x48')](_0x12a042[_0xeabc('0x45')],{'$or':_[_0xeabc('0x2f')](_0x12a042['attributes'],function(_0x1dc0fc){var _0x316e15={};_0x316e15[_0x1dc0fc]={'$like':'%'+_0x475160['query']['filter']+'%'};return _0x316e15;})});}_0x12a042=_[_0xeabc('0x48')]({},_0x12a042,_0x475160[_0xeabc('0x4b')]);return _0x1aee85[_0xeabc('0x70')](_0x12a042);}})[_0xeabc('0x29')](function(_0x2a0075){if(_0x2a0075){_0x507037=_0x2a0075[_0xeabc('0x41')];if(!_0x475160[_0xeabc('0x3c')][_0xeabc('0x42')](_0xeabc('0x6c'))){_0x12a042['limit']=qs[_0xeabc('0x23')](_0x475160['query'][_0xeabc('0x23')]);_0x12a042['offset']=qs[_0xeabc('0x21')](_0x475160[_0xeabc('0x3c')][_0xeabc('0x21')]);}return _0x1aee85[_0xeabc('0x70')](_0x12a042);}})[_0xeabc('0x29')](function(_0x227f00){if(_0x227f00){return _0x227f00?{'count':_0x507037,'rows':_0x227f00}:null;}})[_0xeabc('0x29')](respondWithResult(_0x4d8953,null))[_0xeabc('0x50')](handleError(_0x4d8953,null));};exports[_0xeabc('0x71')]=function(_0x31f1bf,_0x5c83e5,_0x5629db){var _0x1ad48f=_0x31f1bf['body'][_0xeabc('0x72')];var _0x283d40=_['map'](_0x1ad48f,'id');return db['Team'][_0xeabc('0x4f')]({'where':{'id':_0x283d40},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xeabc('0x34'),'online','voicePause',_0xeabc('0x73')],'raw':!![]}]})[_0xeabc('0x29')](function(_0x4a2b27){if(_0x4a2b27){var _0x480bbd=_[_0xeabc('0x74')](_0x4a2b27,function(_0x2465f9){var _0x4b6717=_0x2465f9[_0xeabc('0x2b')]({'plain':!![]});_0x4b6717[_0xeabc('0x75')]['forEach'](function(_0x578fdc){_0x578fdc[_0xeabc('0x76')]=_[_0xeabc('0x33')](_0x1ad48f,{'id':_0x4b6717['id']})[_0xeabc('0x76')];});return _0x4b6717['Agents'];});return db[_0xeabc('0x4c')]['find']({'where':{'id':_0x31f1bf[_0xeabc('0x52')]['id']}})[_0xeabc('0x29')](function(_0x2055d8){return db['sequelize']['transaction'](function(_0x6dff2a){return _0x2055d8[_0xeabc('0x71')](_0x283d40,{'transaction':_0x6dff2a})[_0xeabc('0x29')](function(){return BPromise[_0xeabc('0x77')](_0x1ad48f,function(_0x40658b){return db[_0xeabc('0x78')][_0xeabc('0x79')]({'TeamId':_0x40658b['id'],'VoiceQueueId':_0x31f1bf[_0xeabc('0x52')]['id'],'penalty':_0x40658b['penalty']},{'transaction':_0x6dff2a});});})['then'](function(){return BPromise[_0xeabc('0x77')](_0x480bbd,function(_0x55e41e){return db[_0xeabc('0x7a')]['findOrCreate']({'where':{'UserId':_0x55e41e['id'],'VoiceQueueId':_0x31f1bf[_0xeabc('0x52')]['id']},'defaults':{'penalty':_0x55e41e[_0xeabc('0x76')]},'transaction':_0x6dff2a});});})[_0xeabc('0x29')](function(){return BPromise[_0xeabc('0x77')](_[_0xeabc('0x4a')](_0x480bbd,{'online':!![]}),function(_0x75f13b){return db[_0xeabc('0x7b')][_0xeabc('0x79')]({'membername':_0x75f13b['name'],'UserId':_0x75f13b['id'],'queue_name':_0x2055d8[_0xeabc('0x34')],'VoiceQueueId':_0x2055d8['id'],'interface':_[_0xeabc('0x7c')](_0x75f13b[_0xeabc('0x73')])?util[_0xeabc('0x7d')](_0xeabc('0x7e'),_0x75f13b[_0xeabc('0x34')]):_0x75f13b[_0xeabc('0x73')],'paused':_0x75f13b[_0xeabc('0x7f')]||![],'penalty':_0x75f13b[_0xeabc('0x76')]},{'transaction':_0x6dff2a});});})[_0xeabc('0x29')](function(){_0x480bbd[_0xeabc('0x80')](function(_0x1ba153){socket[_0xeabc('0x81')]('userVoiceQueue:save',{'UserId':_0x1ba153['id'],'VoiceQueueId':_0x2055d8['id']});});});});});}})[_0xeabc('0x29')](respondWithStatusCode(_0x5c83e5,null))[_0xeabc('0x50')](handleError(_0x5c83e5,null));};exports[_0xeabc('0x82')]=function(_0x2a0793,_0x198641,_0x34738e){return db[_0xeabc('0x6f')][_0xeabc('0x4f')]({'where':{'id':_0x2a0793[_0xeabc('0x3c')][_0xeabc('0x83')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xeabc('0x75'),'attributes':['id'],'raw':!![]}]})[_0xeabc('0x29')](handleEntityNotFound(_0x198641,null))['then'](function(_0x598105){var _0x5fc21a=_[_0xeabc('0x2f')](_0x598105,'id');var _0x201539=[];var _0x597bd0=[];var _0xba66a2=squel[_0xeabc('0x84')]();_0xba66a2[_0xeabc('0x85')]('tq.TeamId')[_0xeabc('0x86')](_0xeabc('0x87'),'tq')[_0xeabc('0x88')]('user_has_teams','ut',_0xeabc('0x89'))[_0xeabc('0x45')]('VoiceQueueId\x20=\x20?',_0x2a0793[_0xeabc('0x52')]['id']);for(var _0x50371d=0x0;_0x50371d<_0x598105[_0xeabc('0x41')];_0x50371d+=0x1){let _0x39916c=_0x598105[_0x50371d];for(var _0x5cc6d0=0x0;_0x5cc6d0<_0x39916c['Agents']['length'];_0x5cc6d0+=0x1){let _0x122f23=_0x39916c[_0xeabc('0x75')][_0x5cc6d0];var _0x3571c6=_0xba66a2['clone']();_0x3571c6['where']('ut.UserId\x20=\x20?',_0x122f23['id']);_0x597bd0[_0xeabc('0x8a')](db[_0xeabc('0x8b')]['query'](_0x3571c6[_0xeabc('0x8c')](),{'type':db[_0xeabc('0x8b')][_0xeabc('0x8d')][_0xeabc('0x8e')]})[_0xeabc('0x29')](function(_0x1ca3da){if(_0x1ca3da[_0xeabc('0x41')]===0x1){return _0x122f23['id'];}else{var _0x4a5555=_['every'](_['map'](_0x1ca3da,_0xeabc('0x8f')),function(_0x24cf0a){return _[_0xeabc('0x31')](_0x5fc21a,_0x24cf0a);});if(_0x4a5555){return _0x122f23['id'];}}}));}}return BPromise[_0xeabc('0x90')](_0x597bd0)[_0xeabc('0x29')](function(_0x564ebd){_0x201539=_(_0x201539)[_0xeabc('0x91')](_0x564ebd)['compact']()[_0xeabc('0x30')]();return db[_0xeabc('0x4c')][_0xeabc('0x33')]({'where':{'id':_0x2a0793[_0xeabc('0x52')]['id']}})[_0xeabc('0x29')](function(_0x94fb8e){return db[_0xeabc('0x8b')][_0xeabc('0x92')](function(_0x4287e3){return _0x94fb8e[_0xeabc('0x82')](_0x2a0793['query'][_0xeabc('0x83')],{'transaction':_0x4287e3})[_0xeabc('0x29')](function(){if(!_['isEmpty'](_0x201539)){return _0x94fb8e[_0xeabc('0x93')](_0x201539,{'transaction':_0x4287e3})['then'](function(){return db[_0xeabc('0x7b')][_0xeabc('0x2a')]({'where':{'VoiceQueueId':_0x2a0793[_0xeabc('0x52')]['id'],'UserId':_0x201539},'transaction':_0x4287e3});});}})[_0xeabc('0x29')](function(){_0x201539['forEach'](function(_0x40156a){socket[_0xeabc('0x81')](_0xeabc('0x94'),{'UserId':_0x40156a,'VoiceQueueId':_0x94fb8e['id']});});});});});});})[_0xeabc('0x29')](respondWithStatusCode(_0x198641,null))[_0xeabc('0x50')](handleError(_0x198641,null));};exports['addAgents']=function(_0x34fc2b,_0x43fa37,_0x4913cf){var _0x584b2b,_0xb28be5;return db[_0xeabc('0x4c')]['find']({'where':{'id':_0x34fc2b[_0xeabc('0x52')]['id']}})[_0xeabc('0x29')](handleEntityNotFound(_0x43fa37,null))['then'](function(_0x4d9ebd){if(_0x4d9ebd){_0xb28be5=_0x4d9ebd;return _0x4d9ebd[_0xeabc('0x95')](_0x34fc2b['body'][_0xeabc('0x83')],_[_0xeabc('0x5e')](_0x34fc2b[_0xeabc('0x55')],['ids','id'])||{})['spread'](function(_0x245991){for(var _0x3abe64=0x0;_0x3abe64<_0x34fc2b[_0xeabc('0x55')][_0xeabc('0x83')][_0xeabc('0x41')];_0x3abe64+=0x1){socket[_0xeabc('0x81')](_0xeabc('0x96'),{'UserId':Number(_0x34fc2b[_0xeabc('0x55')][_0xeabc('0x83')][_0x3abe64]),'VoiceQueueId':Number(_0x34fc2b['params']['id'])});}return _0x245991;});}})['then'](function(_0x1f0a8e){_0x584b2b=_0x1f0a8e||[];if(_0xb28be5){return db[_0xeabc('0x97')][_0xeabc('0x4f')]({'where':{'id':_0x34fc2b['body'][_0xeabc('0x83')]},'attributes':['id',_0xeabc('0x34'),_0xeabc('0x98'),_0xeabc('0x7f'),_0xeabc('0x73')],'raw':!![]});}})[_0xeabc('0x29')](function(_0x2f5ab8){if(!_[_0xeabc('0x99')](_0x2f5ab8)){var _0x1c77a0=[];for(var _0x10f354=0x0;_0x10f354<_0x2f5ab8[_0xeabc('0x41')];_0x10f354++){if(_0x2f5ab8[_0x10f354][_0xeabc('0x98')]){_0x1c77a0['push'](db[_0xeabc('0x7b')][_0xeabc('0x79')]({'membername':_0x2f5ab8[_0x10f354][_0xeabc('0x34')],'UserId':_0x2f5ab8[_0x10f354]['id'],'queue_name':_0xb28be5['name'],'VoiceQueueId':_0xb28be5['id'],'interface':_[_0xeabc('0x7c')](_0x2f5ab8[_0x10f354][_0xeabc('0x73')])?util['format'](_0xeabc('0x7e'),_0x2f5ab8[_0x10f354]['name']):_0x2f5ab8[_0x10f354][_0xeabc('0x73')],'paused':_0x2f5ab8[_0x10f354][_0xeabc('0x7f')]||![],'penalty':_0x34fc2b[_0xeabc('0x55')][_0xeabc('0x76')]||0x0}));}}return BPromise[_0xeabc('0x90')](_0x1c77a0);}})[_0xeabc('0x29')](function(){return _0x584b2b;})[_0xeabc('0x29')](respondWithResult(_0x43fa37,null))[_0xeabc('0x50')](handleError(_0x43fa37,null));};exports[_0xeabc('0x93')]=function(_0x4946af,_0x17a858,_0x4d3ead){return db['VoiceQueue'][_0xeabc('0x33')]({'where':{'id':_0x4946af[_0xeabc('0x52')]['id']}})[_0xeabc('0x29')](handleEntityNotFound(_0x17a858,null))[_0xeabc('0x29')](function(_0x224a0e){if(_0x224a0e){return _0x224a0e[_0xeabc('0x93')](_0x4946af[_0xeabc('0x3c')][_0xeabc('0x83')])[_0xeabc('0x29')](function(){if(_[_0xeabc('0x9a')](_0x4946af[_0xeabc('0x3c')]['ids'])){for(var _0x57cf40=0x0;_0x57cf40<_0x4946af[_0xeabc('0x3c')][_0xeabc('0x83')]['length'];_0x57cf40+=0x1){socket[_0xeabc('0x81')](_0xeabc('0x94'),{'UserId':Number(_0x4946af['query']['ids'][_0x57cf40]),'VoiceQueueId':Number(_0x4946af[_0xeabc('0x52')]['id'])});}}else{socket['emit']('userVoiceQueue:remove',{'UserId':Number(_0x4946af['query'][_0xeabc('0x83')]),'VoiceQueueId':Number(_0x4946af[_0xeabc('0x52')]['id'])});}});}})['then'](function(_0x58982a){return db[_0xeabc('0x7b')]['destroy']({'where':{'VoiceQueueId':_0x4946af[_0xeabc('0x52')]['id'],'UserId':_0x4946af['query']['ids']}})[_0xeabc('0x29')](function(){return _0x58982a;});})[_0xeabc('0x29')](respondWithStatusCode(_0x17a858,null))[_0xeabc('0x50')](handleError(_0x17a858,null));};exports[_0xeabc('0x9b')]=function(_0x2e23da,_0x1bf9a2,_0x29153b){var _0x114ffc={};var _0x235270={};var _0x23fab7;var _0x29b175;return db[_0xeabc('0x4c')][_0xeabc('0x65')]({'where':{'id':_0x2e23da['params']['id']}})[_0xeabc('0x29')](handleEntityNotFound(_0x1bf9a2,null))['then'](function(_0x42ceb1){if(_0x42ceb1){_0x23fab7=_0x42ceb1;_0x235270['model']=_[_0xeabc('0x3d')](db[_0xeabc('0x97')][_0xeabc('0x39')]);_0x235270['query']=_[_0xeabc('0x3d')](_0x2e23da['query']);_0x235270[_0xeabc('0x47')]=_[_0xeabc('0x53')](_0x235270[_0xeabc('0x3e')],_0x235270[_0xeabc('0x3c')]);_0x114ffc[_0xeabc('0x3f')]=_['intersection'](_0x235270[_0xeabc('0x3e')],qs[_0xeabc('0x40')](_0x2e23da[_0xeabc('0x3c')][_0xeabc('0x40')]));_0x114ffc[_0xeabc('0x3f')]=_0x114ffc[_0xeabc('0x3f')][_0xeabc('0x41')]?_0x114ffc[_0xeabc('0x3f')]:_0x235270[_0xeabc('0x3e')];_0x114ffc['order']=qs['sort'](_0x2e23da[_0xeabc('0x3c')][_0xeabc('0x44')]);_0x114ffc[_0xeabc('0x45')]=qs[_0xeabc('0x47')](_['pick'](_0x2e23da[_0xeabc('0x3c')],_0x235270[_0xeabc('0x47')]));if(_0x2e23da[_0xeabc('0x3c')][_0xeabc('0x4a')]){_0x114ffc['where']=_[_0xeabc('0x48')](_0x114ffc[_0xeabc('0x45')],{'$or':_[_0xeabc('0x2f')](_0x114ffc['attributes'],function(_0x497ee4){var _0x43e541={};_0x43e541[_0x497ee4]={'$like':'%'+_0x2e23da[_0xeabc('0x3c')][_0xeabc('0x4a')]+'%'};return _0x43e541;})});}_0x114ffc=_[_0xeabc('0x48')]({},_0x114ffc,_0x2e23da[_0xeabc('0x4b')]);return _0x23fab7[_0xeabc('0x9b')](_0x114ffc);}})[_0xeabc('0x29')](function(_0x4124c6){if(_0x4124c6){_0x29b175=_0x4124c6['length'];if(!_0x2e23da['query'][_0xeabc('0x42')](_0xeabc('0x6c'))){_0x114ffc[_0xeabc('0x23')]=qs['limit'](_0x2e23da[_0xeabc('0x3c')][_0xeabc('0x23')]);_0x114ffc[_0xeabc('0x21')]=qs[_0xeabc('0x21')](_0x2e23da[_0xeabc('0x3c')]['offset']);}return _0x23fab7[_0xeabc('0x9b')](_0x114ffc);}})[_0xeabc('0x29')](function(_0x207932){if(_0x207932){return _0x207932?{'count':_0x29b175,'rows':_0x207932}:null;}})[_0xeabc('0x29')](respondWithResult(_0x1bf9a2,null))[_0xeabc('0x50')](handleError(_0x1bf9a2,null));};exports[_0xeabc('0x9c')]=function(_0x35ed8a,_0x977d14,_0x141dbb){var _0x318be6={};var _0xf97e59={};var _0x1293ab;var _0x55c261;return db[_0xeabc('0x4c')][_0xeabc('0x65')]({'where':{'id':_0x35ed8a[_0xeabc('0x52')]['id']}})['then'](handleEntityNotFound(_0x977d14,null))[_0xeabc('0x29')](function(_0x26e38b){if(_0x26e38b){_0x1293ab=_0x26e38b;_0xf97e59['model']=_[_0xeabc('0x3d')](db[_0xeabc('0x7b')]['rawAttributes']);_0xf97e59['query']=_[_0xeabc('0x3d')](_0x35ed8a[_0xeabc('0x3c')]);_0xf97e59[_0xeabc('0x47')]=_[_0xeabc('0x53')](_0xf97e59[_0xeabc('0x3e')],_0xf97e59[_0xeabc('0x3c')]);_0x318be6[_0xeabc('0x3f')]=_[_0xeabc('0x53')](_0xf97e59['model'],qs['fields'](_0x35ed8a[_0xeabc('0x3c')][_0xeabc('0x40')]));_0x318be6[_0xeabc('0x3f')]=_0x318be6[_0xeabc('0x3f')]['length']?_0x318be6['attributes']:_0xf97e59[_0xeabc('0x3e')];_0x318be6[_0xeabc('0x43')]=qs[_0xeabc('0x44')](_0x35ed8a[_0xeabc('0x3c')][_0xeabc('0x44')]);_0x318be6[_0xeabc('0x45')]=qs[_0xeabc('0x47')](_['pick'](_0x35ed8a[_0xeabc('0x3c')],_0xf97e59[_0xeabc('0x47')]));if(_0x35ed8a[_0xeabc('0x3c')][_0xeabc('0x4a')]){_0x318be6['where']=_['merge'](_0x318be6[_0xeabc('0x45')],{'$or':_[_0xeabc('0x2f')](_0x318be6[_0xeabc('0x3f')],function(_0xb9df16){var _0x432709={};_0x432709[_0xb9df16]={'$like':'%'+_0x35ed8a[_0xeabc('0x3c')][_0xeabc('0x4a')]+'%'};return _0x432709;})});}_0x318be6=_[_0xeabc('0x48')]({},_0x318be6,_0x35ed8a[_0xeabc('0x4b')]);return _0x1293ab[_0xeabc('0x9c')](_0x318be6);}})[_0xeabc('0x29')](function(_0x2a3a5c){if(_0x2a3a5c){_0x55c261=_0x2a3a5c[_0xeabc('0x41')];if(!_0x35ed8a[_0xeabc('0x3c')][_0xeabc('0x42')](_0xeabc('0x6c'))){_0x318be6[_0xeabc('0x23')]=qs['limit'](_0x35ed8a['query']['limit']);_0x318be6['offset']=qs['offset'](_0x35ed8a[_0xeabc('0x3c')][_0xeabc('0x21')]);}return _0x1293ab['getMembers'](_0x318be6);}})[_0xeabc('0x29')](function(_0xdfb37a){return _0xdfb37a?{'count':_0x55c261,'rows':_0xdfb37a}:null;})[_0xeabc('0x29')](respondWithResult(_0x977d14,null))[_0xeabc('0x50')](handleError(_0x977d14,null));};exports[_0xeabc('0x9d')]=function(_0x366034,_0x5d16cb,_0x52c973){var _0x1f90b6={};var _0x1c0703={};var _0x5ad17f;var _0x3f6255;return db['VoiceQueue'][_0xeabc('0x65')]({'where':{'id':_0x366034['params']['id']}})[_0xeabc('0x29')](handleEntityNotFound(_0x5d16cb,null))[_0xeabc('0x29')](function(_0x31df33){if(_0x31df33){_0x5ad17f=_0x31df33;_0x1c0703[_0xeabc('0x3e')]=_['keys'](db[_0xeabc('0x9e')][_0xeabc('0x39')]);_0x1c0703[_0xeabc('0x3c')]=_[_0xeabc('0x3d')](_0x366034[_0xeabc('0x3c')]);_0x1c0703[_0xeabc('0x47')]=_[_0xeabc('0x53')](_0x1c0703[_0xeabc('0x3e')],_0x1c0703['query']);_0x1f90b6[_0xeabc('0x3f')]=_['intersection'](_0x1c0703[_0xeabc('0x3e')],qs[_0xeabc('0x40')](_0x366034[_0xeabc('0x3c')]['fields']));_0x1f90b6[_0xeabc('0x3f')]=_0x1f90b6['attributes']['length']?_0x1f90b6[_0xeabc('0x3f')]:_0x1c0703['model'];_0x1f90b6[_0xeabc('0x43')]=qs[_0xeabc('0x44')](_0x366034[_0xeabc('0x3c')]['sort']);_0x1f90b6[_0xeabc('0x45')]=qs['filters'](_['pick'](_0x366034[_0xeabc('0x3c')],_0x1c0703[_0xeabc('0x47')]));if(_0x366034['query']['filter']){_0x1f90b6[_0xeabc('0x45')]=_[_0xeabc('0x48')](_0x1f90b6[_0xeabc('0x45')],{'$or':_[_0xeabc('0x2f')](_0x1f90b6[_0xeabc('0x3f')],function(_0x274693){var _0x73de81={};_0x73de81[_0x274693]={'$like':'%'+_0x366034['query'][_0xeabc('0x4a')]+'%'};return _0x73de81;})});}_0x1f90b6=_['merge']({},_0x1f90b6,_0x366034[_0xeabc('0x4b')]);return _0x5ad17f[_0xeabc('0x9d')](_0x1f90b6);}})[_0xeabc('0x29')](function(_0x197261){if(_0x197261){_0x3f6255=_0x197261['length'];if(!_0x366034['query'][_0xeabc('0x42')](_0xeabc('0x6c'))){_0x1f90b6[_0xeabc('0x23')]=qs[_0xeabc('0x23')](_0x366034[_0xeabc('0x3c')][_0xeabc('0x23')]);_0x1f90b6[_0xeabc('0x21')]=qs[_0xeabc('0x21')](_0x366034[_0xeabc('0x3c')]['offset']);}return _0x5ad17f[_0xeabc('0x9d')](_0x1f90b6);}})[_0xeabc('0x29')](function(_0x16d3c1){if(_0x16d3c1){return _0x16d3c1?{'count':_0x3f6255,'rows':_0x16d3c1}:null;}})['then'](respondWithResult(_0x5d16cb,null))[_0xeabc('0x50')](handleError(_0x5d16cb,null));};exports[_0xeabc('0x9f')]=function(_0x5cf0e6,_0x4f8763,_0x534147){var _0x1708ec=moment()[_0xeabc('0x7d')](_0xeabc('0xa0'));var _0x394082,_0xc1fb57;return db[_0xeabc('0x4c')][_0xeabc('0x33')]({'where':{'id':_0x5cf0e6['params']['id']}})[_0xeabc('0x29')](handleEntityNotFound(_0x4f8763,null))['then'](function(_0x3939a5){if(_0x3939a5){_0xc1fb57=_0x3939a5;return _0x3939a5[_0xeabc('0x9f')](_0x5cf0e6[_0xeabc('0x55')][_0xeabc('0x83')],_[_0xeabc('0x5e')](_0x5cf0e6['body'],[_0xeabc('0x83'),'id'])||{});}return null;})[_0xeabc('0xa1')](function(_0x5a92db){var _0xceed5f;_0x394082=_0x5a92db||[];var _0x44ac6f=[];if(_0x5a92db){for(var _0x3b807d=0x0;_0x3b807d<_0x5a92db[_0xeabc('0x41')];_0x3b807d+=0x1){var _0x11128b=_0x5a92db[_0x3b807d][_0xeabc('0x2b')]({'plain':!![]});_0xc1fb57[_0xeabc('0xa2')]=_0x5cf0e6[_0xeabc('0x55')]['dialCheckDuplicateType']?_0x5cf0e6[_0xeabc('0x55')][_0xeabc('0xa2')]:_0xc1fb57[_0xeabc('0xa2')];switch(_0xc1fb57['dialCheckDuplicateType']){case _0xeabc('0xa3'):_0xceed5f=squel[_0xeabc('0xa4')]()[_0xeabc('0xa5')]('cm_hopper')[_0xeabc('0xa6')](['phone',_0xeabc('0xa7'),_0xeabc('0xa8'),_0xeabc('0xa9'),_0xeabc('0x67'),'createdAt',_0xeabc('0x60')],squel[_0xeabc('0x84')]()['field'](_0xeabc('0xaa'),'phone')[_0xeabc('0x85')]('\x27'+_0x1708ec+'\x27',_0xeabc('0xa7'))[_0xeabc('0x85')]('id',_0xeabc('0xa8'))['field'](_0x11128b[_0xeabc('0xab')][_0xeabc('0x8c')](),_0xeabc('0xa9'))[_0xeabc('0x85')](_0x5cf0e6['params']['id']['toString'](),_0xeabc('0x67'))['field']('\x27'+_0x1708ec+'\x27','createdAt')['field']('\x27'+_0x1708ec+'\x27','updatedAt')[_0xeabc('0x86')](_0xeabc('0xac'))['where'](_0xeabc('0xad'))[_0xeabc('0x45')](_0xeabc('0xae'),_0x11128b[_0xeabc('0xab')][_0xeabc('0x8c')]())[_0xeabc('0x45')]('phone\x20IS\x20NOT\x20NULL')[_0xeabc('0x45')](_0xeabc('0xaf'),squel[_0xeabc('0x84')]()[_0xeabc('0x85')](_0xeabc('0xb0'))[_0xeabc('0x86')](_0xeabc('0xb1'))[_0xeabc('0x45')](_0xeabc('0xb2'),_0x5cf0e6[_0xeabc('0x52')]['id'][_0xeabc('0x8c')]()))[_0xeabc('0x45')]('phone\x20NOT\x20IN\x20(?)',squel[_0xeabc('0x84')]()[_0xeabc('0x85')](_0xeabc('0xb3'))[_0xeabc('0x86')]('cm_hopper')[_0xeabc('0x45')](_0xeabc('0xb2'),_0x5cf0e6['params']['id']['toString']())))[_0xeabc('0x8c')]();break;case _0xeabc('0xb4'):_0xceed5f=squel[_0xeabc('0xa4')]()[_0xeabc('0xa5')](_0xeabc('0xb5'))['fromQuery']([_0xeabc('0xaa'),_0xeabc('0xa7'),_0xeabc('0xa8'),_0xeabc('0xa9'),_0xeabc('0x67'),_0xeabc('0x5f'),'updatedAt'],squel[_0xeabc('0x84')]()[_0xeabc('0x85')](_0xeabc('0xaa'),_0xeabc('0xaa'))[_0xeabc('0x85')]('\x27'+_0x1708ec+'\x27',_0xeabc('0xa7'))['field']('id',_0xeabc('0xa8'))[_0xeabc('0x85')](_0x11128b[_0xeabc('0xab')][_0xeabc('0x8c')](),'ListId')[_0xeabc('0x85')](_0x5cf0e6[_0xeabc('0x52')]['id']['toString'](),_0xeabc('0x67'))[_0xeabc('0x85')]('\x27'+_0x1708ec+'\x27',_0xeabc('0x5f'))[_0xeabc('0x85')]('\x27'+_0x1708ec+'\x27',_0xeabc('0x60'))[_0xeabc('0x86')](_0xeabc('0xac'))[_0xeabc('0x45')](_0xeabc('0xad'))[_0xeabc('0x45')](_0xeabc('0xae'),_0x11128b[_0xeabc('0xab')][_0xeabc('0x8c')]())['where']('phone\x20IS\x20NOT\x20NULL')['where'](_0xeabc('0xaf'),squel[_0xeabc('0x84')]()['field'](_0xeabc('0xb3'))[_0xeabc('0x86')](_0xeabc('0xb5'))['where'](_0xeabc('0xb2'),_0x5cf0e6[_0xeabc('0x52')]['id'][_0xeabc('0x8c')]())))[_0xeabc('0x8c')]();break;default:_0xceed5f=squel[_0xeabc('0xa4')]()[_0xeabc('0xa5')](_0xeabc('0xb5'))[_0xeabc('0xa6')](['phone','scheduledAt','ContactId',_0xeabc('0xa9'),_0xeabc('0x67'),'createdAt','updatedAt'],squel[_0xeabc('0x84')]()[_0xeabc('0x85')](_0xeabc('0xaa'),_0xeabc('0xaa'))['field']('\x27'+_0x1708ec+'\x27',_0xeabc('0xa7'))[_0xeabc('0x85')]('id',_0xeabc('0xa8'))[_0xeabc('0x85')](_0x11128b[_0xeabc('0xab')][_0xeabc('0x8c')](),'ListId')[_0xeabc('0x85')](_0x5cf0e6[_0xeabc('0x52')]['id']['toString'](),'VoiceQueueId')[_0xeabc('0x85')]('\x27'+_0x1708ec+'\x27',_0xeabc('0x5f'))['field']('\x27'+_0x1708ec+'\x27',_0xeabc('0x60'))[_0xeabc('0x86')]('cm_contacts')[_0xeabc('0x45')]('deletedAt\x20IS\x20NULL')[_0xeabc('0x45')](_0xeabc('0xae'),_0x11128b[_0xeabc('0xab')]['toString']())[_0xeabc('0x45')](_0xeabc('0xb6')))['toString']();}_0x44ac6f[_0xeabc('0x8a')](db[_0xeabc('0x8b')][_0xeabc('0x3c')](_0xceed5f));}return BPromise[_0xeabc('0x90')](_0x44ac6f);}})['then'](function(){var _0x390d90=[];var _0x414fc3=squel[_0xeabc('0xa4')]()[_0xeabc('0xa5')](_0xeabc('0xb7'))[_0xeabc('0xa6')]([_0xeabc('0xb8'),_0xeabc('0xaa'),_0xeabc('0xb9'),'createdAt',_0xeabc('0x60')],squel[_0xeabc('0x84')]()[_0xeabc('0x85')](_0xeabc('0xba'))[_0xeabc('0x85')]('ci.item')[_0xeabc('0x85')]('ci.OrderBy')[_0xeabc('0x85')]('\x27'+_0x1708ec+'\x27',_0xeabc('0x5f'))[_0xeabc('0x85')]('\x27'+_0x1708ec+'\x27','updatedAt')['from'](_0xeabc('0xbb'),'ci')[_0xeabc('0x88')](_0xeabc('0xb5'),'h','h.ContactId=ci.CmContactId')[_0xeabc('0x45')](_0xeabc('0xbc'),_0x1708ec)[_0xeabc('0x45')]('ci.ItemClass=?',_0xeabc('0xbd')))['toString']();_0x390d90[_0xeabc('0x8a')](db['sequelize'][_0xeabc('0x3c')](_0x414fc3));return BPromise[_0xeabc('0x90')](_0x390d90);})[_0xeabc('0x29')](function(){return _0x394082;})[_0xeabc('0x29')](respondWithResult(_0x4f8763,null))[_0xeabc('0x50')](handleError(_0x4f8763,null));};exports[_0xeabc('0xbe')]=function(_0x1216cf,_0x198c42,_0x21a0df){return db[_0xeabc('0x4c')][_0xeabc('0x33')]({'where':{'id':_0x1216cf['params']['id']}})[_0xeabc('0x29')](handleEntityNotFound(_0x198c42,null))[_0xeabc('0x29')](function(_0x42c8c9){if(_0x42c8c9){return _0x42c8c9[_0xeabc('0xbe')](_0x1216cf[_0xeabc('0x3c')][_0xeabc('0x83')]);}})['then'](function(_0x67df66){if(_0x67df66){return db[_0xeabc('0x66')][_0xeabc('0x2a')]({'where':{'ListId':_0x1216cf[_0xeabc('0x3c')][_0xeabc('0x83')],'VoiceQueueId':_0x1216cf[_0xeabc('0x52')]['id']}})[_0xeabc('0x29')](function(){return _0x67df66;});}})[_0xeabc('0x29')](respondWithStatusCode(_0x198c42,null))[_0xeabc('0x50')](handleError(_0x198c42,null));};exports['getBlackLists']=function(_0xaf0794,_0x47da72,_0x30b6a2){var _0xcc42a7={};var _0x13be21={};var _0x28a4cb;var _0x5ee7bb;return db[_0xeabc('0x4c')][_0xeabc('0x65')]({'where':{'id':_0xaf0794['params']['id']}})[_0xeabc('0x29')](handleEntityNotFound(_0x47da72,null))['then'](function(_0x22c237){if(_0x22c237){_0x28a4cb=_0x22c237;_0x13be21[_0xeabc('0x3e')]=_['keys'](db[_0xeabc('0x9e')]['rawAttributes']);_0x13be21['query']=_['keys'](_0xaf0794[_0xeabc('0x3c')]);_0x13be21[_0xeabc('0x47')]=_[_0xeabc('0x53')](_0x13be21[_0xeabc('0x3e')],_0x13be21[_0xeabc('0x3c')]);_0xcc42a7[_0xeabc('0x3f')]=_[_0xeabc('0x53')](_0x13be21[_0xeabc('0x3e')],qs[_0xeabc('0x40')](_0xaf0794[_0xeabc('0x3c')]['fields']));_0xcc42a7[_0xeabc('0x3f')]=_0xcc42a7['attributes'][_0xeabc('0x41')]?_0xcc42a7[_0xeabc('0x3f')]:_0x13be21[_0xeabc('0x3e')];_0xcc42a7['order']=qs[_0xeabc('0x44')](_0xaf0794['query']['sort']);_0xcc42a7[_0xeabc('0x45')]=qs['filters'](_[_0xeabc('0x46')](_0xaf0794[_0xeabc('0x3c')],_0x13be21['filters']));if(_0xaf0794[_0xeabc('0x3c')]['filter']){_0xcc42a7[_0xeabc('0x45')]=_['merge'](_0xcc42a7[_0xeabc('0x45')],{'$or':_['map'](_0xcc42a7[_0xeabc('0x3f')],function(_0x559792){var _0xb959bf={};_0xb959bf[_0x559792]={'$like':'%'+_0xaf0794[_0xeabc('0x3c')][_0xeabc('0x4a')]+'%'};return _0xb959bf;})});}_0xcc42a7=_[_0xeabc('0x48')]({},_0xcc42a7,_0xaf0794['options']);return _0x28a4cb['getBlackLists'](_0xcc42a7);}})['then'](function(_0x51f91d){if(_0x51f91d){_0x5ee7bb=_0x51f91d[_0xeabc('0x41')];if(!_0xaf0794[_0xeabc('0x3c')][_0xeabc('0x42')]('nolimit')){_0xcc42a7[_0xeabc('0x23')]=qs['limit'](_0xaf0794[_0xeabc('0x3c')][_0xeabc('0x23')]);_0xcc42a7[_0xeabc('0x21')]=qs[_0xeabc('0x21')](_0xaf0794['query']['offset']);}return _0x28a4cb['getBlackLists'](_0xcc42a7);}})[_0xeabc('0x29')](function(_0x457d82){if(_0x457d82){return _0x457d82?{'count':_0x5ee7bb,'rows':_0x457d82}:null;}})[_0xeabc('0x29')](respondWithResult(_0x47da72,null))[_0xeabc('0x50')](handleError(_0x47da72,null));};exports['addBlackLists']=function(_0x3d9f54,_0x440501,_0x11a8af){var _0x268aff,_0x1fbd9b;return db[_0xeabc('0x4c')][_0xeabc('0x33')]({'where':{'id':_0x3d9f54[_0xeabc('0x52')]['id']}})[_0xeabc('0x29')](handleEntityNotFound(_0x440501,null))[_0xeabc('0x29')](function(_0x5643f6){if(_0x5643f6){_0x1fbd9b=_0x5643f6;return _0x5643f6['addBlackLists'](_0x3d9f54['body'][_0xeabc('0x83')],_[_0xeabc('0x5e')](_0x3d9f54[_0xeabc('0x55')],[_0xeabc('0x83'),'id'])||{});}return null;})[_0xeabc('0xa1')](function(_0x18157e){var _0x404839;_0x268aff=_0x18157e||[];var _0x30eb6f=[];if(_0x18157e){for(var _0xba3953=0x0;_0xba3953<_0x18157e[_0xeabc('0x41')];_0xba3953+=0x1){var _0xa1613b=_0x18157e[_0xba3953][_0xeabc('0x2b')]({'plain':!![]});_0x404839=squel[_0xeabc('0xa4')]()['into']('cm_hopper_black')[_0xeabc('0xa6')](['phone',_0xeabc('0xa8'),'ListId',_0xeabc('0x67'),_0xeabc('0x5f'),'updatedAt'],squel['select']()[_0xeabc('0x85')](_0xeabc('0xaa'),_0xeabc('0xaa'))['field']('id',_0xeabc('0xa8'))[_0xeabc('0x85')](_0xa1613b[_0xeabc('0xab')][_0xeabc('0x8c')](),'ListId')[_0xeabc('0x85')](_0x3d9f54[_0xeabc('0x52')]['id'][_0xeabc('0x8c')](),_0xeabc('0x67'))[_0xeabc('0x85')](_0xeabc('0xbf'),_0xeabc('0x5f'))[_0xeabc('0x85')](_0xeabc('0xbf'),_0xeabc('0x60'))[_0xeabc('0x86')](_0xeabc('0xac'))[_0xeabc('0x45')](_0xeabc('0xad'))[_0xeabc('0x45')](_0xeabc('0xae'),_0xa1613b[_0xeabc('0xab')][_0xeabc('0x8c')]())[_0xeabc('0x45')]('phone\x20IS\x20NOT\x20NULL'))[_0xeabc('0x8c')]();_0x30eb6f[_0xeabc('0x8a')](db[_0xeabc('0x8b')][_0xeabc('0x3c')](_0x404839));}return BPromise[_0xeabc('0x90')](_0x30eb6f);}})[_0xeabc('0x29')](function(){return _0x268aff;})[_0xeabc('0x29')](respondWithResult(_0x440501,null))['catch'](handleError(_0x440501,null));};exports[_0xeabc('0xc0')]=function(_0xb22c9f,_0x24bc07,_0x52bc60){return db[_0xeabc('0x4c')][_0xeabc('0x33')]({'where':{'id':_0xb22c9f[_0xeabc('0x52')]['id']}})[_0xeabc('0x29')](handleEntityNotFound(_0x24bc07,null))['then'](function(_0x3a3d98){if(_0x3a3d98){return _0x3a3d98[_0xeabc('0xc0')](_0xb22c9f[_0xeabc('0x3c')][_0xeabc('0x83')]);}})[_0xeabc('0x29')](function(_0x14cf92){if(_0x14cf92){return db[_0xeabc('0x6e')][_0xeabc('0x2a')]({'where':{'ListId':_0xb22c9f[_0xeabc('0x3c')][_0xeabc('0x83')],'VoiceQueueId':_0xb22c9f[_0xeabc('0x52')]['id']}})[_0xeabc('0x29')](function(){return _0x14cf92;});}})[_0xeabc('0x29')](respondWithStatusCode(_0x24bc07,null))[_0xeabc('0x50')](handleError(_0x24bc07,null));}; \ No newline at end of file +var _0xc4aa=['TeamId','all','compact','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','spread','isArray','getAgents','getMembers','getLists','CmList','dialCheckDuplicateType','into','cm_hopper','fromQuery','phone','scheduledAt','ListId','field','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','ContactId','cm_hopper_additional_phones','CmHopperId','OrderBy','h.id','ci.item','cm_contact_has_items','h.ContactId=ci.CmContactId','h.scheduledat=?','ci.ItemClass=?','PHONE','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','end','json','limit','undefined','offset','count','Content-Range','apply','reject','update','then','destroy','get','VoiceQueues','inbound','outbound','filter','ignore','map','includes','type','name','UserProfileResource','error','stack','send','index','VoiceQueue','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','length','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','QueueCampaigns','find','value','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','role','user','params','keys','VoiceQueueId','getHopperHistories','findOne','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','addTeams','teams','online','voicePause','Agents','penalty','transaction','each','TeamVoiceQueue','upsert','findOrCreate','UserVoiceQueueRt','isNil','format','SIP/%s','interface','forEach','emit','userVoiceQueue:save','removeTeams','Team','ids','User','select','tq.TeamId','from','team_has_voice_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every'];(function(_0x25dca6,_0x3fe0c8){var _0x174424=function(_0x16c3e0){while(--_0x16c3e0){_0x25dca6['push'](_0x25dca6['shift']());}};_0x174424(++_0x3fe0c8);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xc4aa[_0x19950b];return _0x3c6b41;};'use strict';var emlformat=require(_0xac4a('0x0'));var rimraf=require(_0xac4a('0x1'));var zipdir=require(_0xac4a('0x2'));var jsonpatch=require(_0xac4a('0x3'));var rp=require(_0xac4a('0x4'));var moment=require(_0xac4a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xac4a('0x6'));var sox=require(_0xac4a('0x7'));var csv=require(_0xac4a('0x8'));var ejs=require(_0xac4a('0x9'));var fs=require('fs');var fs_extra=require(_0xac4a('0xa'));var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x8'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var Redis=require('ioredis');var authService=require(_0xac4a('0x10'));var qs=require(_0xac4a('0x11'));var as=require(_0xac4a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac4a('0x13'))('api');var utils=require(_0xac4a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xac4a('0x15'));var db=require(_0xac4a('0x16'))['db'];config[_0xac4a('0x17')]=_['defaults'](config[_0xac4a('0x17')],{'host':_0xac4a('0x18'),'port':0x18eb});var socket=require(_0xac4a('0x19'))(new Redis(config[_0xac4a('0x17')]));require(_0xac4a('0x1a'))[_0xac4a('0x1b')](socket);function respondWithStatusCode(_0x34bc01,_0x33c287){_0x33c287=_0x33c287||0xcc;return function(_0x190418){if(_0x190418){return _0x34bc01[_0xac4a('0x1c')](_0x33c287);}return _0x34bc01[_0xac4a('0x1d')](_0x33c287)[_0xac4a('0x1e')]();};}function respondWithResult(_0x4a2119,_0x402fff){_0x402fff=_0x402fff||0xc8;return function(_0x34d797){if(_0x34d797){return _0x4a2119[_0xac4a('0x1d')](_0x402fff)[_0xac4a('0x1f')](_0x34d797);}};}function respondWithFilteredResult(_0x3e88e3,_0x387a54){return function(_0x28e304){if(_0x28e304){var _0x44ec59=typeof _0x387a54['offset']==='undefined'&&typeof _0x387a54[_0xac4a('0x20')]===_0xac4a('0x21');var _0x39b691=_0x28e304['count'];var _0x39e83e=_0x44ec59?0x0:_0x387a54[_0xac4a('0x22')];var _0x3752e4=_0x44ec59?_0x28e304[_0xac4a('0x23')]:_0x387a54[_0xac4a('0x22')]+_0x387a54[_0xac4a('0x20')];var _0xe38996;if(_0x3752e4>=_0x39b691){_0x3752e4=_0x39b691;_0xe38996=0xc8;}else{_0xe38996=0xce;}_0x3e88e3[_0xac4a('0x1d')](_0xe38996);return _0x3e88e3['set'](_0xac4a('0x24'),_0x39e83e+'-'+_0x3752e4+'/'+_0x39b691)[_0xac4a('0x1f')](_0x28e304);}return null;};}function patchUpdates(_0x599787){return function(_0x3d7ce0){try{jsonpatch[_0xac4a('0x25')](_0x3d7ce0,_0x599787,!![]);}catch(_0x3eacd3){return BPromise[_0xac4a('0x26')](_0x3eacd3);}return _0x3d7ce0['save']();};}function saveUpdates(_0x1b7998,_0x2503d8){return function(_0x15435c){if(_0x15435c){return _0x15435c[_0xac4a('0x27')](_0x1b7998)[_0xac4a('0x28')](function(_0x2b0dc2){return _0x2b0dc2;});}return null;};}function removeEntity(_0x222507,_0x36054a){return function(_0x3e2c69){if(_0x3e2c69){return _0x3e2c69[_0xac4a('0x29')]()[_0xac4a('0x28')](function(){var _0x215a31=_0x3e2c69[_0xac4a('0x2a')]({'plain':!![]});var _0x472c57=[{'name':_0xac4a('0x2b'),'value':_0xac4a('0x2c'),'ignore':![]},{'name':'QueueCampaigns','value':_0xac4a('0x2d'),'ignore':![]}];var _0x267a22=_(_0x472c57)[_0xac4a('0x2e')](_0xac4a('0x2f'))[_0xac4a('0x30')]('value')['value']();if(_[_0xac4a('0x31')](_0x267a22,_0x215a31[_0xac4a('0x32')])){return;}var _0x1f12d5=_['find'](_0x472c57,['value',_0x215a31[_0xac4a('0x32')]])[_0xac4a('0x33')];return db[_0xac4a('0x34')][_0xac4a('0x29')]({'where':{'type':_0x1f12d5,'resourceId':_0x215a31['id']}})[_0xac4a('0x28')](function(){return _0x3e2c69;});})['then'](function(){_0x222507[_0xac4a('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x30364b,_0x57adcf){return function(_0x17e6de){if(!_0x17e6de){_0x30364b[_0xac4a('0x1c')](0x194);}return _0x17e6de;};}function handleError(_0x31501b,_0x228aa7){_0x228aa7=_0x228aa7||0x1f4;return function(_0x34577f){logger[_0xac4a('0x35')](_0x34577f[_0xac4a('0x36')]);if(_0x34577f[_0xac4a('0x33')]){delete _0x34577f[_0xac4a('0x33')];}_0x31501b[_0xac4a('0x1d')](_0x228aa7)[_0xac4a('0x37')](_0x34577f);};}exports[_0xac4a('0x38')]=function(_0x1a9be2,_0x1a9d4e){var _0x5634e2={},_0x30442d={},_0x1c41fb={'count':0x0,'rows':[]};var _0x5a4e2b=_[_0xac4a('0x30')](db[_0xac4a('0x39')]['rawAttributes'],function(_0x58804b){return{'name':_0x58804b[_0xac4a('0x3a')],'type':_0x58804b[_0xac4a('0x32')][_0xac4a('0x3b')]};});_0x30442d[_0xac4a('0x3c')]=_['map'](_0x5a4e2b,_0xac4a('0x33'));_0x30442d[_0xac4a('0x3d')]=_['keys'](_0x1a9be2[_0xac4a('0x3d')]);_0x30442d[_0xac4a('0x3e')]=_[_0xac4a('0x3f')](_0x30442d['model'],_0x30442d[_0xac4a('0x3d')]);_0x5634e2[_0xac4a('0x40')]=_[_0xac4a('0x3f')](_0x30442d['model'],qs[_0xac4a('0x41')](_0x1a9be2[_0xac4a('0x3d')]['fields']));_0x5634e2['attributes']=_0x5634e2[_0xac4a('0x40')]['length']?_0x5634e2['attributes']:_0x30442d['model'];if(!_0x1a9be2['query'][_0xac4a('0x42')](_0xac4a('0x43'))){_0x5634e2[_0xac4a('0x20')]=qs[_0xac4a('0x20')](_0x1a9be2[_0xac4a('0x3d')][_0xac4a('0x20')]);_0x5634e2[_0xac4a('0x22')]=qs[_0xac4a('0x22')](_0x1a9be2[_0xac4a('0x3d')][_0xac4a('0x22')]);}_0x5634e2[_0xac4a('0x44')]=qs[_0xac4a('0x45')](_0x1a9be2['query']['sort']);_0x5634e2['where']=qs[_0xac4a('0x3e')](_[_0xac4a('0x46')](_0x1a9be2[_0xac4a('0x3d')],_0x30442d[_0xac4a('0x3e')]),_0x5a4e2b);if(_0x1a9be2[_0xac4a('0x3d')][_0xac4a('0x2e')]){_0x5634e2[_0xac4a('0x47')]=_[_0xac4a('0x48')](_0x5634e2[_0xac4a('0x47')],{'$or':_[_0xac4a('0x30')](_0x5a4e2b,function(_0x561cb7){if(_0x561cb7[_0xac4a('0x32')]!==_0xac4a('0x49')){var _0x3d9595={};_0x3d9595[_0x561cb7[_0xac4a('0x33')]]={'$like':'%'+_0x1a9be2[_0xac4a('0x3d')]['filter']+'%'};return _0x3d9595;}})});}_0x5634e2=_[_0xac4a('0x48')]({},_0x5634e2,_0x1a9be2[_0xac4a('0x4a')]);var _0x547ba2={'where':_0x5634e2[_0xac4a('0x47')]};return db['VoiceQueue'][_0xac4a('0x23')](_0x547ba2)[_0xac4a('0x28')](function(_0xe5ee0f){_0x1c41fb[_0xac4a('0x23')]=_0xe5ee0f;if(_0x1a9be2[_0xac4a('0x3d')][_0xac4a('0x4b')]){_0x5634e2[_0xac4a('0x4c')]=[{'all':!![]}];}return db[_0xac4a('0x39')][_0xac4a('0x4d')](_0x5634e2);})[_0xac4a('0x28')](function(_0x4fa9eb){_0x1c41fb[_0xac4a('0x4e')]=_0x4fa9eb;return _0x1c41fb;})['then'](respondWithFilteredResult(_0x1a9d4e,_0x5634e2))[_0xac4a('0x4f')](handleError(_0x1a9d4e,null));};exports[_0xac4a('0x50')]=function(_0xeca4e9,_0x58759a){var _0x1764bf={'raw':![],'where':{'id':_0xeca4e9['params']['id']}},_0x19276e={};_0x19276e[_0xac4a('0x3c')]=_['keys'](db[_0xac4a('0x39')][_0xac4a('0x51')]);_0x19276e[_0xac4a('0x3d')]=_['keys'](_0xeca4e9['query']);_0x19276e[_0xac4a('0x3e')]=_['intersection'](_0x19276e[_0xac4a('0x3c')],_0x19276e['query']);_0x1764bf[_0xac4a('0x40')]=_['intersection'](_0x19276e[_0xac4a('0x3c')],qs[_0xac4a('0x41')](_0xeca4e9[_0xac4a('0x3d')][_0xac4a('0x41')]));_0x1764bf['attributes']=_0x1764bf[_0xac4a('0x40')][_0xac4a('0x52')]?_0x1764bf[_0xac4a('0x40')]:_0x19276e[_0xac4a('0x3c')];if(_0xeca4e9[_0xac4a('0x3d')][_0xac4a('0x4b')]){_0x1764bf[_0xac4a('0x4c')]=[{'all':!![]}];}_0x1764bf=_['merge']({},_0x1764bf,_0xeca4e9[_0xac4a('0x4a')]);return db[_0xac4a('0x39')]['find'](_0x1764bf)[_0xac4a('0x28')](handleEntityNotFound(_0x58759a,null))[_0xac4a('0x28')](respondWithResult(_0x58759a,null))[_0xac4a('0x4f')](handleError(_0x58759a,null));};exports[_0xac4a('0x53')]=function(_0x4bb2fb,_0x3bd846){return db[_0xac4a('0x39')][_0xac4a('0x53')](_0x4bb2fb[_0xac4a('0x54')],{})[_0xac4a('0x28')](function(_0x49fbc3){var _0x179373=_0x4bb2fb['user'][_0xac4a('0x2a')]({'plain':!![]});if(!_0x179373)throw new Error(_0xac4a('0x55'));if(_0x179373['role']==='user'){var _0x437466=_0x49fbc3[_0xac4a('0x2a')]({'plain':!![]});var _0x4d448f=[{'name':_0xac4a('0x2b'),'value':_0xac4a('0x2c')},{'name':_0xac4a('0x56'),'value':_0xac4a('0x2d')}];var _0x48900f=_[_0xac4a('0x57')](_0x4d448f,[_0xac4a('0x58'),_0x437466[_0xac4a('0x32')]])[_0xac4a('0x33')];return db[_0xac4a('0x59')][_0xac4a('0x57')]({'where':{'name':_0x48900f,'userProfileId':_0x179373[_0xac4a('0x5a')]},'raw':!![]})['then'](function(_0x39123d){if(_0x39123d&&_0x39123d[_0xac4a('0x5b')]===0x0){return db[_0xac4a('0x34')][_0xac4a('0x53')]({'name':_0x437466[_0xac4a('0x33')],'resourceId':_0x437466['id'],'type':_0x39123d[_0xac4a('0x33')],'sectionId':_0x39123d['id']},{})[_0xac4a('0x28')](function(){return _0x49fbc3;});}else{return _0x49fbc3;}})[_0xac4a('0x4f')](function(_0x159e43){logger[_0xac4a('0x35')](_0xac4a('0x5c'),_0x159e43);throw _0x159e43;});}return _0x49fbc3;})[_0xac4a('0x28')](respondWithResult(_0x3bd846,0xc9))[_0xac4a('0x4f')](handleError(_0x3bd846,null));};exports[_0xac4a('0x5d')]=function(_0x5222f3,_0x11c753){var _0x492aae={'where':{'id':_0x5222f3['params']['id']}},_0x13a577={};_0x13a577[_0xac4a('0x3c')]=_['keys'](db[_0xac4a('0x39')]['rawAttributes']);_0x492aae[_0xac4a('0x40')]=_['intersection'](_0x13a577['model'],qs[_0xac4a('0x41')](_0x5222f3[_0xac4a('0x3d')][_0xac4a('0x41')]));_0x492aae[_0xac4a('0x40')]=_0x492aae[_0xac4a('0x40')][_0xac4a('0x52')]?_0x492aae['attributes']:_0x13a577[_0xac4a('0x3c')];if(_0x5222f3['query'][_0xac4a('0x4b')]){_0x492aae['include']=[{'all':!![]}];}_0x492aae=_[_0xac4a('0x48')]({},_0x492aae,_0x5222f3[_0xac4a('0x4a')]);return db[_0xac4a('0x39')][_0xac4a('0x57')](_0x492aae)[_0xac4a('0x28')](handleEntityNotFound(_0x11c753,null))[_0xac4a('0x28')](function(_0x3abd57){if(_0x3abd57){var _0xe3e375=_0x3abd57[_0xac4a('0x2a')]({'plain':!![]});_0xe3e375=qs[_0xac4a('0x5e')](_0xe3e375,['id',_0xac4a('0x5f'),_0xac4a('0x60')]);_0x5222f3[_0xac4a('0x54')]=_[_0xac4a('0x5e')](_0x5222f3[_0xac4a('0x54')],['id',_0xac4a('0x5f'),_0xac4a('0x60')]);return db['VoiceQueue'][_0xac4a('0x53')](_[_0xac4a('0x48')](_0xe3e375,_0x5222f3['body']),{'include':_0x5222f3[_0xac4a('0x3d')][_0xac4a('0x4b')]?[{'all':!![]}]:undefined})[_0xac4a('0x28')](function(_0x2b8562){var _0x357cac=_0x5222f3['user']['get']({'plain':!![]});if(!_0x357cac)throw new Error(_0xac4a('0x55'));if(_0x357cac[_0xac4a('0x61')]===_0xac4a('0x62')){var _0x148288=_0x2b8562[_0xac4a('0x2a')]({'plain':!![]});var _0x21ef8b=[{'name':_0xac4a('0x2b'),'value':_0xac4a('0x2c')},{'name':_0xac4a('0x56'),'value':_0xac4a('0x2d')}];var _0x278c09=_['find'](_0x21ef8b,['value',_0x148288[_0xac4a('0x32')]])[_0xac4a('0x33')];return db[_0xac4a('0x59')][_0xac4a('0x57')]({'where':{'name':_0x278c09,'userProfileId':_0x357cac[_0xac4a('0x5a')]},'raw':!![]})[_0xac4a('0x28')](function(_0x1d24bb){if(_0x1d24bb&&_0x1d24bb[_0xac4a('0x5b')]===0x0){return db[_0xac4a('0x34')][_0xac4a('0x53')]({'name':_0x148288[_0xac4a('0x33')],'resourceId':_0x148288['id'],'type':_0x1d24bb[_0xac4a('0x33')],'sectionId':_0x1d24bb['id']},{})['then'](function(){return _0x2b8562;});}else{return _0x2b8562;}})[_0xac4a('0x4f')](function(_0xc74ce8){logger[_0xac4a('0x35')](_0xac4a('0x5c'),_0xc74ce8);throw _0xc74ce8;});}return _0x2b8562;});}})['then'](respondWithResult(_0x11c753,0xc9))[_0xac4a('0x4f')](handleError(_0x11c753,null));};exports['update']=function(_0xab4305,_0x3af39a){if(_0xab4305['body']['id']){delete _0xab4305['body']['id'];}return db[_0xac4a('0x39')][_0xac4a('0x57')]({'where':{'id':_0xab4305[_0xac4a('0x63')]['id']}})['then'](handleEntityNotFound(_0x3af39a,null))[_0xac4a('0x28')](saveUpdates(_0xab4305['body'],null))[_0xac4a('0x28')](respondWithResult(_0x3af39a,null))['catch'](handleError(_0x3af39a,null));};exports['destroy']=function(_0x118c03,_0x56ef2a){return db[_0xac4a('0x39')]['find']({'where':{'id':_0x118c03[_0xac4a('0x63')]['id']}})[_0xac4a('0x28')](handleEntityNotFound(_0x56ef2a,null))['then'](removeEntity(_0x56ef2a,null))[_0xac4a('0x4f')](handleError(_0x56ef2a,null));};exports['getHoppers']=function(_0x36a21d,_0x443a56,_0x522949){var _0x12f1b2={'raw':![],'where':{}};var _0x4b66b4={};var _0x5a9111={'count':0x0,'rows':[]};return db[_0xac4a('0x39')]['findOne']({'where':{'id':_0x36a21d[_0xac4a('0x63')]['id']}})['then'](handleEntityNotFound(_0x443a56,null))['then'](function(_0x1588e2){if(_0x1588e2){_0x4b66b4[_0xac4a('0x3c')]=_[_0xac4a('0x64')](db['CmHopper']['rawAttributes']);_0x4b66b4[_0xac4a('0x3d')]=_[_0xac4a('0x64')](_0x36a21d['query']);_0x4b66b4['filters']=_[_0xac4a('0x3f')](_0x4b66b4[_0xac4a('0x3c')],_0x4b66b4[_0xac4a('0x3d')]);_0x12f1b2[_0xac4a('0x40')]=_[_0xac4a('0x3f')](_0x4b66b4[_0xac4a('0x3c')],qs[_0xac4a('0x41')](_0x36a21d[_0xac4a('0x3d')][_0xac4a('0x41')]));_0x12f1b2['attributes']=_0x12f1b2[_0xac4a('0x40')][_0xac4a('0x52')]?_0x12f1b2[_0xac4a('0x40')]:_0x4b66b4['model'];if(!_0x36a21d[_0xac4a('0x3d')][_0xac4a('0x42')](_0xac4a('0x43'))){_0x12f1b2[_0xac4a('0x20')]=qs[_0xac4a('0x20')](_0x36a21d['query'][_0xac4a('0x20')]);_0x12f1b2[_0xac4a('0x22')]=qs[_0xac4a('0x22')](_0x36a21d[_0xac4a('0x3d')][_0xac4a('0x22')]);}_0x12f1b2[_0xac4a('0x44')]=qs[_0xac4a('0x45')](_0x36a21d['query'][_0xac4a('0x45')]);_0x12f1b2[_0xac4a('0x47')]=qs[_0xac4a('0x3e')](_[_0xac4a('0x46')](_0x36a21d[_0xac4a('0x3d')],_0x4b66b4[_0xac4a('0x3e')]));_0x12f1b2['where'][_0xac4a('0x65')]=_0x1588e2['id'];if(_0x36a21d[_0xac4a('0x3d')][_0xac4a('0x2e')]){_0x12f1b2[_0xac4a('0x47')]=_['merge'](_0x12f1b2[_0xac4a('0x47')],{'$or':_['map'](_0x12f1b2[_0xac4a('0x40')],function(_0x22b718){var _0x53a371={};_0x53a371[_0x22b718]={'$like':'%'+_0x36a21d['query'][_0xac4a('0x2e')]+'%'};return _0x53a371;})});}_0x12f1b2=_[_0xac4a('0x48')]({},_0x12f1b2,_0x36a21d[_0xac4a('0x4a')]);return db['CmHopper'][_0xac4a('0x23')]({'where':_0x12f1b2['where']})[_0xac4a('0x28')](function(_0x36af79){_0x5a9111[_0xac4a('0x23')]=_0x36af79;if(_0x36a21d[_0xac4a('0x3d')][_0xac4a('0x4b')]){_0x12f1b2['include']=[{'all':!![]}];}return db['CmHopper'][_0xac4a('0x4d')](_0x12f1b2);})[_0xac4a('0x28')](function(_0x23d07c){_0x5a9111[_0xac4a('0x4e')]=_0x23d07c;return _0x5a9111;});}})[_0xac4a('0x28')](respondWithFilteredResult(_0x443a56,_0x12f1b2))[_0xac4a('0x4f')](handleError(_0x443a56,null));};exports[_0xac4a('0x66')]=function(_0x186410,_0x49ac09,_0x52b3e6){var _0x446d99={'raw':!![],'where':{}};var _0x31cc9a={};var _0x247eee={'count':0x0,'rows':[]};return db[_0xac4a('0x39')][_0xac4a('0x67')]({'where':{'id':_0x186410[_0xac4a('0x63')]['id']}})[_0xac4a('0x28')](handleEntityNotFound(_0x49ac09,null))[_0xac4a('0x28')](function(_0x540d8e){if(_0x540d8e){_0x31cc9a['model']=_[_0xac4a('0x64')](db[_0xac4a('0x68')][_0xac4a('0x51')]);_0x31cc9a[_0xac4a('0x3d')]=_[_0xac4a('0x64')](_0x186410[_0xac4a('0x3d')]);_0x31cc9a[_0xac4a('0x3e')]=_['intersection'](_0x31cc9a[_0xac4a('0x3c')],_0x31cc9a[_0xac4a('0x3d')]);_0x446d99[_0xac4a('0x40')]=_['intersection'](_0x31cc9a[_0xac4a('0x3c')],qs[_0xac4a('0x41')](_0x186410[_0xac4a('0x3d')][_0xac4a('0x41')]));_0x446d99[_0xac4a('0x40')]=_0x446d99[_0xac4a('0x40')][_0xac4a('0x52')]?_0x446d99[_0xac4a('0x40')]:_0x31cc9a[_0xac4a('0x3c')];if(!_0x186410['query'][_0xac4a('0x42')]('nolimit')){_0x446d99[_0xac4a('0x20')]=qs[_0xac4a('0x20')](_0x186410[_0xac4a('0x3d')][_0xac4a('0x20')]);_0x446d99[_0xac4a('0x22')]=qs[_0xac4a('0x22')](_0x186410[_0xac4a('0x3d')]['offset']);}_0x446d99[_0xac4a('0x44')]=qs[_0xac4a('0x45')](_0x186410[_0xac4a('0x3d')][_0xac4a('0x45')]);_0x446d99[_0xac4a('0x47')]=qs['filters'](_[_0xac4a('0x46')](_0x186410[_0xac4a('0x3d')],_0x31cc9a['filters']));_0x446d99['where'][_0xac4a('0x65')]=_0x540d8e['id'];if(_0x186410[_0xac4a('0x3d')]['filter']){_0x446d99[_0xac4a('0x47')]=_[_0xac4a('0x48')](_0x446d99[_0xac4a('0x47')],{'$or':_[_0xac4a('0x30')](_0x446d99[_0xac4a('0x40')],function(_0x34787c){var _0x599775={};_0x599775[_0x34787c]={'$like':'%'+_0x186410[_0xac4a('0x3d')][_0xac4a('0x2e')]+'%'};return _0x599775;})});}_0x446d99=_[_0xac4a('0x48')]({},_0x446d99,_0x186410['options']);return db[_0xac4a('0x68')][_0xac4a('0x23')]({'where':_0x446d99[_0xac4a('0x47')]})[_0xac4a('0x28')](function(_0x380c90){_0x247eee[_0xac4a('0x23')]=_0x380c90;if(_0x186410['query'][_0xac4a('0x4b')]){_0x446d99[_0xac4a('0x4c')]=[{'all':!![]}];}return db['CmHopperHistory'][_0xac4a('0x4d')](_0x446d99);})['then'](function(_0x37bbfa){_0x247eee[_0xac4a('0x4e')]=_0x37bbfa;return _0x247eee;});}})['then'](respondWithFilteredResult(_0x49ac09,_0x446d99))[_0xac4a('0x4f')](handleError(_0x49ac09,null));};exports['getHopperFinals']=function(_0x22a67e,_0x4e6612,_0x3c601e){var _0x3ebbc0={'raw':!![],'where':{}};var _0x24f464={};var _0xfe8977={'count':0x0,'rows':[]};return db[_0xac4a('0x39')][_0xac4a('0x67')]({'where':{'id':_0x22a67e[_0xac4a('0x63')]['id']}})[_0xac4a('0x28')](handleEntityNotFound(_0x4e6612,null))[_0xac4a('0x28')](function(_0x3323c0){if(_0x3323c0){_0x24f464[_0xac4a('0x3c')]=_[_0xac4a('0x64')](db[_0xac4a('0x69')][_0xac4a('0x51')]);_0x24f464['query']=_[_0xac4a('0x64')](_0x22a67e[_0xac4a('0x3d')]);_0x24f464['filters']=_[_0xac4a('0x3f')](_0x24f464[_0xac4a('0x3c')],_0x24f464[_0xac4a('0x3d')]);_0x3ebbc0[_0xac4a('0x40')]=_[_0xac4a('0x3f')](_0x24f464['model'],qs[_0xac4a('0x41')](_0x22a67e['query'][_0xac4a('0x41')]));_0x3ebbc0[_0xac4a('0x40')]=_0x3ebbc0[_0xac4a('0x40')][_0xac4a('0x52')]?_0x3ebbc0['attributes']:_0x24f464[_0xac4a('0x3c')];if(!_0x22a67e['query'][_0xac4a('0x42')](_0xac4a('0x43'))){_0x3ebbc0[_0xac4a('0x20')]=qs['limit'](_0x22a67e[_0xac4a('0x3d')][_0xac4a('0x20')]);_0x3ebbc0[_0xac4a('0x22')]=qs['offset'](_0x22a67e[_0xac4a('0x3d')][_0xac4a('0x22')]);}_0x3ebbc0[_0xac4a('0x44')]=qs[_0xac4a('0x45')](_0x22a67e[_0xac4a('0x3d')][_0xac4a('0x45')]);_0x3ebbc0[_0xac4a('0x47')]=qs[_0xac4a('0x3e')](_['pick'](_0x22a67e[_0xac4a('0x3d')],_0x24f464['filters']));_0x3ebbc0['where']['VoiceQueueId']=_0x3323c0['id'];if(_0x22a67e['query']['filter']){_0x3ebbc0[_0xac4a('0x47')]=_[_0xac4a('0x48')](_0x3ebbc0[_0xac4a('0x47')],{'$or':_[_0xac4a('0x30')](_0x3ebbc0[_0xac4a('0x40')],function(_0x525d50){var _0x9ea4d1={};_0x9ea4d1[_0x525d50]={'$like':'%'+_0x22a67e[_0xac4a('0x3d')][_0xac4a('0x2e')]+'%'};return _0x9ea4d1;})});}_0x3ebbc0=_[_0xac4a('0x48')]({},_0x3ebbc0,_0x22a67e[_0xac4a('0x4a')]);return db[_0xac4a('0x69')][_0xac4a('0x23')]({'where':_0x3ebbc0[_0xac4a('0x47')]})['then'](function(_0x2cb596){_0xfe8977[_0xac4a('0x23')]=_0x2cb596;if(_0x22a67e[_0xac4a('0x3d')][_0xac4a('0x4b')]){_0x3ebbc0[_0xac4a('0x4c')]=[{'all':!![]}];}return db[_0xac4a('0x69')][_0xac4a('0x4d')](_0x3ebbc0);})['then'](function(_0x5c823e){_0xfe8977[_0xac4a('0x4e')]=_0x5c823e;return _0xfe8977;});}})[_0xac4a('0x28')](respondWithFilteredResult(_0x4e6612,_0x3ebbc0))['catch'](handleError(_0x4e6612,null));};exports[_0xac4a('0x6a')]=function(_0x366f5a,_0x503880,_0x5bd013){var _0x2fe103={'raw':!![],'where':{}};var _0x741c2d={};var _0x12ce0f={'count':0x0,'rows':[]};return db[_0xac4a('0x39')][_0xac4a('0x67')]({'where':{'id':_0x366f5a['params']['id']}})[_0xac4a('0x28')](handleEntityNotFound(_0x503880,null))['then'](function(_0x4f2d85){if(_0x4f2d85){_0x741c2d['model']=_[_0xac4a('0x64')](db[_0xac4a('0x6b')][_0xac4a('0x51')]);_0x741c2d[_0xac4a('0x3d')]=_[_0xac4a('0x64')](_0x366f5a[_0xac4a('0x3d')]);_0x741c2d[_0xac4a('0x3e')]=_[_0xac4a('0x3f')](_0x741c2d['model'],_0x741c2d['query']);_0x2fe103['attributes']=_[_0xac4a('0x3f')](_0x741c2d[_0xac4a('0x3c')],qs[_0xac4a('0x41')](_0x366f5a[_0xac4a('0x3d')][_0xac4a('0x41')]));_0x2fe103[_0xac4a('0x40')]=_0x2fe103[_0xac4a('0x40')][_0xac4a('0x52')]?_0x2fe103[_0xac4a('0x40')]:_0x741c2d[_0xac4a('0x3c')];if(!_0x366f5a[_0xac4a('0x3d')][_0xac4a('0x42')](_0xac4a('0x43'))){_0x2fe103[_0xac4a('0x20')]=qs[_0xac4a('0x20')](_0x366f5a[_0xac4a('0x3d')][_0xac4a('0x20')]);_0x2fe103[_0xac4a('0x22')]=qs[_0xac4a('0x22')](_0x366f5a[_0xac4a('0x3d')][_0xac4a('0x22')]);}_0x2fe103[_0xac4a('0x44')]=qs[_0xac4a('0x45')](_0x366f5a['query'][_0xac4a('0x45')]);_0x2fe103[_0xac4a('0x47')]=qs[_0xac4a('0x3e')](_[_0xac4a('0x46')](_0x366f5a[_0xac4a('0x3d')],_0x741c2d[_0xac4a('0x3e')]));_0x2fe103[_0xac4a('0x47')][_0xac4a('0x65')]=_0x4f2d85['id'];if(_0x366f5a['query']['filter']){_0x2fe103[_0xac4a('0x47')]=_[_0xac4a('0x48')](_0x2fe103[_0xac4a('0x47')],{'$or':_['map'](_0x2fe103['attributes'],function(_0x5de198){var _0x2b6773={};_0x2b6773[_0x5de198]={'$like':'%'+_0x366f5a['query'][_0xac4a('0x2e')]+'%'};return _0x2b6773;})});}_0x2fe103=_[_0xac4a('0x48')]({},_0x2fe103,_0x366f5a['options']);return db[_0xac4a('0x6b')]['count']({'where':_0x2fe103[_0xac4a('0x47')]})[_0xac4a('0x28')](function(_0x413f5f){_0x12ce0f[_0xac4a('0x23')]=_0x413f5f;if(_0x366f5a[_0xac4a('0x3d')][_0xac4a('0x4b')]){_0x2fe103['include']=[{'all':!![]}];}return db[_0xac4a('0x6b')][_0xac4a('0x4d')](_0x2fe103);})[_0xac4a('0x28')](function(_0x516499){_0x12ce0f[_0xac4a('0x4e')]=_0x516499;return _0x12ce0f;});}})[_0xac4a('0x28')](respondWithFilteredResult(_0x503880,_0x2fe103))[_0xac4a('0x4f')](handleError(_0x503880,null));};exports[_0xac4a('0x6c')]=function(_0x5bb911,_0x1de85b,_0x403f5a){var _0x3eae2f={};var _0x59d982={};var _0x407ae3;var _0x221ff5;return db['VoiceQueue']['findOne']({'where':{'id':_0x5bb911[_0xac4a('0x63')]['id']}})[_0xac4a('0x28')](handleEntityNotFound(_0x1de85b,null))[_0xac4a('0x28')](function(_0x25c2ab){if(_0x25c2ab){_0x407ae3=_0x25c2ab;_0x59d982[_0xac4a('0x3c')]=_[_0xac4a('0x64')](db['Team'][_0xac4a('0x51')]);_0x59d982['query']=_[_0xac4a('0x64')](_0x5bb911['query']);_0x59d982[_0xac4a('0x3e')]=_[_0xac4a('0x3f')](_0x59d982[_0xac4a('0x3c')],_0x59d982[_0xac4a('0x3d')]);_0x3eae2f['attributes']=_[_0xac4a('0x3f')](_0x59d982[_0xac4a('0x3c')],qs[_0xac4a('0x41')](_0x5bb911[_0xac4a('0x3d')][_0xac4a('0x41')]));_0x3eae2f['attributes']=_0x3eae2f[_0xac4a('0x40')][_0xac4a('0x52')]?_0x3eae2f[_0xac4a('0x40')]:_0x59d982[_0xac4a('0x3c')];_0x3eae2f[_0xac4a('0x44')]=qs['sort'](_0x5bb911[_0xac4a('0x3d')][_0xac4a('0x45')]);_0x3eae2f[_0xac4a('0x47')]=qs[_0xac4a('0x3e')](_[_0xac4a('0x46')](_0x5bb911['query'],_0x59d982['filters']));if(_0x5bb911['query']['filter']){_0x3eae2f[_0xac4a('0x47')]=_[_0xac4a('0x48')](_0x3eae2f[_0xac4a('0x47')],{'$or':_[_0xac4a('0x30')](_0x3eae2f[_0xac4a('0x40')],function(_0x51a445){var _0x293d49={};_0x293d49[_0x51a445]={'$like':'%'+_0x5bb911[_0xac4a('0x3d')]['filter']+'%'};return _0x293d49;})});}_0x3eae2f=_[_0xac4a('0x48')]({},_0x3eae2f,_0x5bb911[_0xac4a('0x4a')]);return _0x407ae3[_0xac4a('0x6c')](_0x3eae2f);}})['then'](function(_0x249af8){if(_0x249af8){_0x221ff5=_0x249af8[_0xac4a('0x52')];if(!_0x5bb911[_0xac4a('0x3d')][_0xac4a('0x42')](_0xac4a('0x43'))){_0x3eae2f[_0xac4a('0x20')]=qs[_0xac4a('0x20')](_0x5bb911[_0xac4a('0x3d')][_0xac4a('0x20')]);_0x3eae2f['offset']=qs[_0xac4a('0x22')](_0x5bb911[_0xac4a('0x3d')]['offset']);}return _0x407ae3[_0xac4a('0x6c')](_0x3eae2f);}})['then'](function(_0x138992){if(_0x138992){return _0x138992?{'count':_0x221ff5,'rows':_0x138992}:null;}})[_0xac4a('0x28')](respondWithResult(_0x1de85b,null))['catch'](handleError(_0x1de85b,null));};exports[_0xac4a('0x6d')]=function(_0x7f3aae,_0x164513,_0x2a35c3){var _0xbdc939=_0x7f3aae[_0xac4a('0x54')][_0xac4a('0x6e')];var _0x26eec2=_['map'](_0xbdc939,'id');return db['Team'][_0xac4a('0x4d')]({'where':{'id':_0x26eec2},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xac4a('0x33'),_0xac4a('0x6f'),_0xac4a('0x70'),'interface'],'raw':!![]}]})[_0xac4a('0x28')](function(_0x2bb935){if(_0x2bb935){var _0x5a2abf=_['flatMap'](_0x2bb935,function(_0x2e63f9){var _0x306eec=_0x2e63f9[_0xac4a('0x2a')]({'plain':!![]});_0x306eec[_0xac4a('0x71')]['forEach'](function(_0x421c27){_0x421c27[_0xac4a('0x72')]=_[_0xac4a('0x57')](_0xbdc939,{'id':_0x306eec['id']})['penalty'];});return _0x306eec[_0xac4a('0x71')];});return db[_0xac4a('0x39')][_0xac4a('0x57')]({'where':{'id':_0x7f3aae[_0xac4a('0x63')]['id']}})[_0xac4a('0x28')](function(_0x5882b4){return db['sequelize'][_0xac4a('0x73')](function(_0x3e1be8){return _0x5882b4[_0xac4a('0x6d')](_0x26eec2,{'transaction':_0x3e1be8})[_0xac4a('0x28')](function(){return BPromise[_0xac4a('0x74')](_0xbdc939,function(_0xcef6af){return db[_0xac4a('0x75')][_0xac4a('0x76')]({'TeamId':_0xcef6af['id'],'VoiceQueueId':_0x7f3aae[_0xac4a('0x63')]['id'],'penalty':_0xcef6af[_0xac4a('0x72')]},{'transaction':_0x3e1be8});});})[_0xac4a('0x28')](function(){return BPromise[_0xac4a('0x74')](_0x5a2abf,function(_0x2244c1){return db['UserVoiceQueue'][_0xac4a('0x77')]({'where':{'UserId':_0x2244c1['id'],'VoiceQueueId':_0x7f3aae['params']['id']},'defaults':{'penalty':_0x2244c1['penalty']},'transaction':_0x3e1be8});});})[_0xac4a('0x28')](function(){return BPromise[_0xac4a('0x74')](_[_0xac4a('0x2e')](_0x5a2abf,{'online':!![]}),function(_0x2de398){return db[_0xac4a('0x78')][_0xac4a('0x76')]({'membername':_0x2de398[_0xac4a('0x33')],'UserId':_0x2de398['id'],'queue_name':_0x5882b4[_0xac4a('0x33')],'VoiceQueueId':_0x5882b4['id'],'interface':_[_0xac4a('0x79')](_0x2de398['interface'])?util[_0xac4a('0x7a')](_0xac4a('0x7b'),_0x2de398[_0xac4a('0x33')]):_0x2de398[_0xac4a('0x7c')],'paused':_0x2de398['voicePause']||![],'penalty':_0x2de398['penalty']},{'transaction':_0x3e1be8});});})[_0xac4a('0x28')](function(){_0x5a2abf[_0xac4a('0x7d')](function(_0x20da5e){socket[_0xac4a('0x7e')](_0xac4a('0x7f'),{'UserId':_0x20da5e['id'],'VoiceQueueId':_0x5882b4['id']});});});});});}})[_0xac4a('0x28')](respondWithStatusCode(_0x164513,null))[_0xac4a('0x4f')](handleError(_0x164513,null));};exports[_0xac4a('0x80')]=function(_0x1cde3d,_0x4a5858,_0xb07a2f){return db[_0xac4a('0x81')][_0xac4a('0x4d')]({'where':{'id':_0x1cde3d[_0xac4a('0x3d')][_0xac4a('0x82')]},'attributes':['id'],'include':[{'model':db[_0xac4a('0x83')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x4a5858,null))['then'](function(_0x1e235a){var _0x321072=_['map'](_0x1e235a,'id');var _0x582367=[];var _0x23ea5e=[];var _0x4ab3ca=squel[_0xac4a('0x84')]();_0x4ab3ca['field'](_0xac4a('0x85'))[_0xac4a('0x86')](_0xac4a('0x87'),'tq')['join'](_0xac4a('0x88'),'ut',_0xac4a('0x89'))['where'](_0xac4a('0x8a'),_0x1cde3d[_0xac4a('0x63')]['id']);for(var _0x5888d8=0x0;_0x5888d8<_0x1e235a['length'];_0x5888d8+=0x1){let _0x4514a5=_0x1e235a[_0x5888d8];for(var _0x45f6a3=0x0;_0x45f6a3<_0x4514a5[_0xac4a('0x71')][_0xac4a('0x52')];_0x45f6a3+=0x1){let _0x367254=_0x4514a5[_0xac4a('0x71')][_0x45f6a3];var _0x3b8242=_0x4ab3ca[_0xac4a('0x5d')]();_0x3b8242[_0xac4a('0x47')](_0xac4a('0x8b'),_0x367254['id']);_0x23ea5e[_0xac4a('0x8c')](db[_0xac4a('0x8d')][_0xac4a('0x3d')](_0x3b8242[_0xac4a('0x8e')](),{'type':db[_0xac4a('0x8d')][_0xac4a('0x8f')][_0xac4a('0x90')]})['then'](function(_0x1de63a){if(_0x1de63a['length']===0x1){return _0x367254['id'];}else{var _0x18b6ed=_[_0xac4a('0x91')](_[_0xac4a('0x30')](_0x1de63a,_0xac4a('0x92')),function(_0x23c577){return _[_0xac4a('0x31')](_0x321072,_0x23c577);});if(_0x18b6ed){return _0x367254['id'];}}}));}}return BPromise[_0xac4a('0x93')](_0x23ea5e)['then'](function(_0x368eae){_0x582367=_(_0x582367)['union'](_0x368eae)[_0xac4a('0x94')]()[_0xac4a('0x58')]();return db[_0xac4a('0x39')][_0xac4a('0x57')]({'where':{'id':_0x1cde3d[_0xac4a('0x63')]['id']}})[_0xac4a('0x28')](function(_0x1b62ba){return db[_0xac4a('0x8d')]['transaction'](function(_0xd2c48d){return _0x1b62ba[_0xac4a('0x80')](_0x1cde3d[_0xac4a('0x3d')][_0xac4a('0x82')],{'transaction':_0xd2c48d})['then'](function(){if(!_[_0xac4a('0x95')](_0x582367)){return _0x1b62ba[_0xac4a('0x96')](_0x582367,{'transaction':_0xd2c48d})[_0xac4a('0x28')](function(){return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x1cde3d[_0xac4a('0x63')]['id'],'UserId':_0x582367},'transaction':_0xd2c48d});});}})['then'](function(){_0x582367[_0xac4a('0x7d')](function(_0x5e61f1){socket['emit'](_0xac4a('0x97'),{'UserId':_0x5e61f1,'VoiceQueueId':_0x1b62ba['id']});});});});});});})[_0xac4a('0x28')](respondWithStatusCode(_0x4a5858,null))[_0xac4a('0x4f')](handleError(_0x4a5858,null));};exports['addAgents']=function(_0x2dd6b8,_0x2cf291,_0x551de3){var _0x3a649e,_0x2f7005;return db['VoiceQueue'][_0xac4a('0x57')]({'where':{'id':_0x2dd6b8[_0xac4a('0x63')]['id']}})[_0xac4a('0x28')](handleEntityNotFound(_0x2cf291,null))[_0xac4a('0x28')](function(_0x3e9b9a){if(_0x3e9b9a){_0x2f7005=_0x3e9b9a;return _0x3e9b9a[_0xac4a('0x98')](_0x2dd6b8[_0xac4a('0x54')][_0xac4a('0x82')],_['omit'](_0x2dd6b8[_0xac4a('0x54')],['ids','id'])||{})[_0xac4a('0x99')](function(_0x40ed20){for(var _0x208d85=0x0;_0x208d85<_0x2dd6b8[_0xac4a('0x54')][_0xac4a('0x82')][_0xac4a('0x52')];_0x208d85+=0x1){socket['emit'](_0xac4a('0x7f'),{'UserId':Number(_0x2dd6b8[_0xac4a('0x54')][_0xac4a('0x82')][_0x208d85]),'VoiceQueueId':Number(_0x2dd6b8[_0xac4a('0x63')]['id'])});}return _0x40ed20;});}})[_0xac4a('0x28')](function(_0x5105b4){_0x3a649e=_0x5105b4||[];if(_0x2f7005){return db[_0xac4a('0x83')][_0xac4a('0x4d')]({'where':{'id':_0x2dd6b8['body'][_0xac4a('0x82')]},'attributes':['id','name',_0xac4a('0x6f'),_0xac4a('0x70'),_0xac4a('0x7c')],'raw':!![]});}})[_0xac4a('0x28')](function(_0x4f1ae3){if(!_['isEmpty'](_0x4f1ae3)){var _0x3da1e6=[];for(var _0x2b823b=0x0;_0x2b823b<_0x4f1ae3[_0xac4a('0x52')];_0x2b823b++){if(_0x4f1ae3[_0x2b823b][_0xac4a('0x6f')]){_0x3da1e6[_0xac4a('0x8c')](db[_0xac4a('0x78')]['upsert']({'membername':_0x4f1ae3[_0x2b823b][_0xac4a('0x33')],'UserId':_0x4f1ae3[_0x2b823b]['id'],'queue_name':_0x2f7005[_0xac4a('0x33')],'VoiceQueueId':_0x2f7005['id'],'interface':_[_0xac4a('0x79')](_0x4f1ae3[_0x2b823b]['interface'])?util[_0xac4a('0x7a')](_0xac4a('0x7b'),_0x4f1ae3[_0x2b823b][_0xac4a('0x33')]):_0x4f1ae3[_0x2b823b]['interface'],'paused':_0x4f1ae3[_0x2b823b]['voicePause']||![],'penalty':_0x2dd6b8[_0xac4a('0x54')][_0xac4a('0x72')]||0x0}));}}return BPromise[_0xac4a('0x93')](_0x3da1e6);}})[_0xac4a('0x28')](function(){return _0x3a649e;})[_0xac4a('0x28')](respondWithResult(_0x2cf291,null))[_0xac4a('0x4f')](handleError(_0x2cf291,null));};exports[_0xac4a('0x96')]=function(_0x2936e7,_0x394698,_0x49671e){return db['VoiceQueue'][_0xac4a('0x57')]({'where':{'id':_0x2936e7[_0xac4a('0x63')]['id']}})[_0xac4a('0x28')](handleEntityNotFound(_0x394698,null))['then'](function(_0x1210c3){if(_0x1210c3){return _0x1210c3[_0xac4a('0x96')](_0x2936e7[_0xac4a('0x3d')]['ids'])['then'](function(){if(_[_0xac4a('0x9a')](_0x2936e7['query'][_0xac4a('0x82')])){for(var _0x10da11=0x0;_0x10da11<_0x2936e7['query'][_0xac4a('0x82')][_0xac4a('0x52')];_0x10da11+=0x1){socket['emit'](_0xac4a('0x97'),{'UserId':Number(_0x2936e7[_0xac4a('0x3d')][_0xac4a('0x82')][_0x10da11]),'VoiceQueueId':Number(_0x2936e7[_0xac4a('0x63')]['id'])});}}else{socket[_0xac4a('0x7e')](_0xac4a('0x97'),{'UserId':Number(_0x2936e7[_0xac4a('0x3d')][_0xac4a('0x82')]),'VoiceQueueId':Number(_0x2936e7[_0xac4a('0x63')]['id'])});}});}})['then'](function(_0x3c6316){return db[_0xac4a('0x78')]['destroy']({'where':{'VoiceQueueId':_0x2936e7['params']['id'],'UserId':_0x2936e7['query'][_0xac4a('0x82')]}})[_0xac4a('0x28')](function(){return _0x3c6316;});})[_0xac4a('0x28')](respondWithStatusCode(_0x394698,null))[_0xac4a('0x4f')](handleError(_0x394698,null));};exports[_0xac4a('0x9b')]=function(_0x4363d8,_0x38a78c,_0x371e81){var _0x53831f={};var _0x54fa8a={};var _0x4f2745;var _0x1aea57;return db['VoiceQueue']['findOne']({'where':{'id':_0x4363d8[_0xac4a('0x63')]['id']}})['then'](handleEntityNotFound(_0x38a78c,null))['then'](function(_0x5b5a41){if(_0x5b5a41){_0x4f2745=_0x5b5a41;_0x54fa8a[_0xac4a('0x3c')]=_[_0xac4a('0x64')](db[_0xac4a('0x83')][_0xac4a('0x51')]);_0x54fa8a[_0xac4a('0x3d')]=_[_0xac4a('0x64')](_0x4363d8[_0xac4a('0x3d')]);_0x54fa8a[_0xac4a('0x3e')]=_[_0xac4a('0x3f')](_0x54fa8a[_0xac4a('0x3c')],_0x54fa8a[_0xac4a('0x3d')]);_0x53831f[_0xac4a('0x40')]=_[_0xac4a('0x3f')](_0x54fa8a['model'],qs[_0xac4a('0x41')](_0x4363d8['query'][_0xac4a('0x41')]));_0x53831f[_0xac4a('0x40')]=_0x53831f[_0xac4a('0x40')][_0xac4a('0x52')]?_0x53831f[_0xac4a('0x40')]:_0x54fa8a[_0xac4a('0x3c')];_0x53831f['order']=qs[_0xac4a('0x45')](_0x4363d8[_0xac4a('0x3d')][_0xac4a('0x45')]);_0x53831f['where']=qs[_0xac4a('0x3e')](_['pick'](_0x4363d8[_0xac4a('0x3d')],_0x54fa8a[_0xac4a('0x3e')]));if(_0x4363d8[_0xac4a('0x3d')]['filter']){_0x53831f[_0xac4a('0x47')]=_[_0xac4a('0x48')](_0x53831f['where'],{'$or':_[_0xac4a('0x30')](_0x53831f[_0xac4a('0x40')],function(_0x4e5411){var _0x445e8d={};_0x445e8d[_0x4e5411]={'$like':'%'+_0x4363d8['query'][_0xac4a('0x2e')]+'%'};return _0x445e8d;})});}_0x53831f=_[_0xac4a('0x48')]({},_0x53831f,_0x4363d8['options']);return _0x4f2745['getAgents'](_0x53831f);}})['then'](function(_0x4bb02d){if(_0x4bb02d){_0x1aea57=_0x4bb02d[_0xac4a('0x52')];if(!_0x4363d8['query'][_0xac4a('0x42')](_0xac4a('0x43'))){_0x53831f[_0xac4a('0x20')]=qs['limit'](_0x4363d8[_0xac4a('0x3d')][_0xac4a('0x20')]);_0x53831f[_0xac4a('0x22')]=qs['offset'](_0x4363d8[_0xac4a('0x3d')]['offset']);}return _0x4f2745[_0xac4a('0x9b')](_0x53831f);}})[_0xac4a('0x28')](function(_0x542774){if(_0x542774){return _0x542774?{'count':_0x1aea57,'rows':_0x542774}:null;}})[_0xac4a('0x28')](respondWithResult(_0x38a78c,null))[_0xac4a('0x4f')](handleError(_0x38a78c,null));};exports[_0xac4a('0x9c')]=function(_0x2de603,_0x4f6540,_0x405b6f){var _0x291f03={};var _0x204a85={};var _0x3c279f;var _0x5f55e7;return db[_0xac4a('0x39')][_0xac4a('0x67')]({'where':{'id':_0x2de603['params']['id']}})['then'](handleEntityNotFound(_0x4f6540,null))['then'](function(_0x12dca1){if(_0x12dca1){_0x3c279f=_0x12dca1;_0x204a85[_0xac4a('0x3c')]=_['keys'](db[_0xac4a('0x78')][_0xac4a('0x51')]);_0x204a85[_0xac4a('0x3d')]=_[_0xac4a('0x64')](_0x2de603['query']);_0x204a85[_0xac4a('0x3e')]=_['intersection'](_0x204a85[_0xac4a('0x3c')],_0x204a85[_0xac4a('0x3d')]);_0x291f03['attributes']=_[_0xac4a('0x3f')](_0x204a85['model'],qs['fields'](_0x2de603['query'][_0xac4a('0x41')]));_0x291f03[_0xac4a('0x40')]=_0x291f03['attributes'][_0xac4a('0x52')]?_0x291f03[_0xac4a('0x40')]:_0x204a85[_0xac4a('0x3c')];_0x291f03[_0xac4a('0x44')]=qs[_0xac4a('0x45')](_0x2de603[_0xac4a('0x3d')][_0xac4a('0x45')]);_0x291f03[_0xac4a('0x47')]=qs[_0xac4a('0x3e')](_[_0xac4a('0x46')](_0x2de603[_0xac4a('0x3d')],_0x204a85[_0xac4a('0x3e')]));if(_0x2de603['query']['filter']){_0x291f03[_0xac4a('0x47')]=_[_0xac4a('0x48')](_0x291f03[_0xac4a('0x47')],{'$or':_[_0xac4a('0x30')](_0x291f03[_0xac4a('0x40')],function(_0x56b876){var _0x74964b={};_0x74964b[_0x56b876]={'$like':'%'+_0x2de603['query']['filter']+'%'};return _0x74964b;})});}_0x291f03=_['merge']({},_0x291f03,_0x2de603['options']);return _0x3c279f[_0xac4a('0x9c')](_0x291f03);}})[_0xac4a('0x28')](function(_0x58570d){if(_0x58570d){_0x5f55e7=_0x58570d[_0xac4a('0x52')];if(!_0x2de603['query'][_0xac4a('0x42')](_0xac4a('0x43'))){_0x291f03[_0xac4a('0x20')]=qs['limit'](_0x2de603[_0xac4a('0x3d')][_0xac4a('0x20')]);_0x291f03['offset']=qs[_0xac4a('0x22')](_0x2de603[_0xac4a('0x3d')]['offset']);}return _0x3c279f[_0xac4a('0x9c')](_0x291f03);}})[_0xac4a('0x28')](function(_0x22a80e){return _0x22a80e?{'count':_0x5f55e7,'rows':_0x22a80e}:null;})[_0xac4a('0x28')](respondWithResult(_0x4f6540,null))[_0xac4a('0x4f')](handleError(_0x4f6540,null));};exports[_0xac4a('0x9d')]=function(_0x5b69c3,_0x2b5d32,_0x3618ec){var _0x335761={};var _0x21a22f={};var _0x557a77;var _0xab8aa;return db['VoiceQueue'][_0xac4a('0x67')]({'where':{'id':_0x5b69c3[_0xac4a('0x63')]['id']}})[_0xac4a('0x28')](handleEntityNotFound(_0x2b5d32,null))[_0xac4a('0x28')](function(_0x2df560){if(_0x2df560){_0x557a77=_0x2df560;_0x21a22f[_0xac4a('0x3c')]=_[_0xac4a('0x64')](db[_0xac4a('0x9e')]['rawAttributes']);_0x21a22f['query']=_[_0xac4a('0x64')](_0x5b69c3[_0xac4a('0x3d')]);_0x21a22f[_0xac4a('0x3e')]=_[_0xac4a('0x3f')](_0x21a22f['model'],_0x21a22f[_0xac4a('0x3d')]);_0x335761[_0xac4a('0x40')]=_[_0xac4a('0x3f')](_0x21a22f[_0xac4a('0x3c')],qs[_0xac4a('0x41')](_0x5b69c3[_0xac4a('0x3d')][_0xac4a('0x41')]));_0x335761[_0xac4a('0x40')]=_0x335761[_0xac4a('0x40')]['length']?_0x335761[_0xac4a('0x40')]:_0x21a22f['model'];_0x335761[_0xac4a('0x44')]=qs[_0xac4a('0x45')](_0x5b69c3[_0xac4a('0x3d')][_0xac4a('0x45')]);_0x335761[_0xac4a('0x47')]=qs[_0xac4a('0x3e')](_[_0xac4a('0x46')](_0x5b69c3['query'],_0x21a22f[_0xac4a('0x3e')]));if(_0x5b69c3[_0xac4a('0x3d')]['filter']){_0x335761[_0xac4a('0x47')]=_[_0xac4a('0x48')](_0x335761[_0xac4a('0x47')],{'$or':_[_0xac4a('0x30')](_0x335761[_0xac4a('0x40')],function(_0x4830bb){var _0x267ca9={};_0x267ca9[_0x4830bb]={'$like':'%'+_0x5b69c3[_0xac4a('0x3d')][_0xac4a('0x2e')]+'%'};return _0x267ca9;})});}_0x335761=_[_0xac4a('0x48')]({},_0x335761,_0x5b69c3['options']);return _0x557a77['getLists'](_0x335761);}})[_0xac4a('0x28')](function(_0x4d1488){if(_0x4d1488){_0xab8aa=_0x4d1488[_0xac4a('0x52')];if(!_0x5b69c3[_0xac4a('0x3d')][_0xac4a('0x42')](_0xac4a('0x43'))){_0x335761[_0xac4a('0x20')]=qs[_0xac4a('0x20')](_0x5b69c3[_0xac4a('0x3d')][_0xac4a('0x20')]);_0x335761[_0xac4a('0x22')]=qs[_0xac4a('0x22')](_0x5b69c3[_0xac4a('0x3d')]['offset']);}return _0x557a77['getLists'](_0x335761);}})[_0xac4a('0x28')](function(_0x3b5704){if(_0x3b5704){return _0x3b5704?{'count':_0xab8aa,'rows':_0x3b5704}:null;}})[_0xac4a('0x28')](respondWithResult(_0x2b5d32,null))['catch'](handleError(_0x2b5d32,null));};exports['addLists']=function(_0x1430aa,_0x6ee160,_0x5a93b1){var _0xec92e4=moment()[_0xac4a('0x7a')]('YYYY-MM-DD\x20HH:mm:ss');var _0x384a38,_0x1f9b0d;return db['VoiceQueue'][_0xac4a('0x57')]({'where':{'id':_0x1430aa['params']['id']}})[_0xac4a('0x28')](handleEntityNotFound(_0x6ee160,null))[_0xac4a('0x28')](function(_0x35c58e){if(_0x35c58e){_0x1f9b0d=_0x35c58e;return _0x35c58e['addLists'](_0x1430aa[_0xac4a('0x54')][_0xac4a('0x82')],_['omit'](_0x1430aa['body'],[_0xac4a('0x82'),'id'])||{});}return null;})[_0xac4a('0x99')](function(_0x146d91){var _0x4e224f;_0x384a38=_0x146d91||[];var _0x1eb063=[];if(_0x146d91){for(var _0x396d3f=0x0;_0x396d3f<_0x146d91[_0xac4a('0x52')];_0x396d3f+=0x1){var _0x33d1ec=_0x146d91[_0x396d3f][_0xac4a('0x2a')]({'plain':!![]});_0x1f9b0d[_0xac4a('0x9f')]=_0x1430aa[_0xac4a('0x54')][_0xac4a('0x9f')]?_0x1430aa[_0xac4a('0x54')][_0xac4a('0x9f')]:_0x1f9b0d[_0xac4a('0x9f')];switch(_0x1f9b0d['dialCheckDuplicateType']){case'always':_0x4e224f=squel['insert']()[_0xac4a('0xa0')](_0xac4a('0xa1'))[_0xac4a('0xa2')]([_0xac4a('0xa3'),_0xac4a('0xa4'),'ContactId',_0xac4a('0xa5'),'VoiceQueueId',_0xac4a('0x5f'),_0xac4a('0x60')],squel['select']()[_0xac4a('0xa6')]('phone',_0xac4a('0xa3'))[_0xac4a('0xa6')]('\x27'+_0xec92e4+'\x27',_0xac4a('0xa4'))[_0xac4a('0xa6')]('id','ContactId')[_0xac4a('0xa6')](_0x33d1ec[_0xac4a('0xa7')]['toString'](),_0xac4a('0xa5'))['field'](_0x1430aa[_0xac4a('0x63')]['id'][_0xac4a('0x8e')](),_0xac4a('0x65'))['field']('\x27'+_0xec92e4+'\x27',_0xac4a('0x5f'))[_0xac4a('0xa6')]('\x27'+_0xec92e4+'\x27',_0xac4a('0x60'))['from'](_0xac4a('0xa8'))['where'](_0xac4a('0xa9'))[_0xac4a('0x47')](_0xac4a('0xaa'),_0x33d1ec[_0xac4a('0xa7')][_0xac4a('0x8e')]())[_0xac4a('0x47')](_0xac4a('0xab'))[_0xac4a('0x47')]('phone\x20NOT\x20IN\x20(?)',squel[_0xac4a('0x84')]()[_0xac4a('0xa6')](_0xac4a('0xac'))['from'](_0xac4a('0xad'))['where'](_0xac4a('0x8a'),_0x1430aa[_0xac4a('0x63')]['id'][_0xac4a('0x8e')]()))[_0xac4a('0x47')](_0xac4a('0xae'),squel[_0xac4a('0x84')]()['field'](_0xac4a('0xaf'))[_0xac4a('0x86')](_0xac4a('0xa1'))[_0xac4a('0x47')](_0xac4a('0x8a'),_0x1430aa['params']['id'][_0xac4a('0x8e')]())))['toString']();break;case _0xac4a('0xb0'):_0x4e224f=squel[_0xac4a('0xb1')]()['into'](_0xac4a('0xa1'))['fromQuery']([_0xac4a('0xa3'),'scheduledAt',_0xac4a('0xb2'),_0xac4a('0xa5'),_0xac4a('0x65'),_0xac4a('0x5f'),_0xac4a('0x60')],squel[_0xac4a('0x84')]()['field'](_0xac4a('0xa3'),'phone')[_0xac4a('0xa6')]('\x27'+_0xec92e4+'\x27',_0xac4a('0xa4'))[_0xac4a('0xa6')]('id',_0xac4a('0xb2'))[_0xac4a('0xa6')](_0x33d1ec[_0xac4a('0xa7')][_0xac4a('0x8e')](),_0xac4a('0xa5'))[_0xac4a('0xa6')](_0x1430aa[_0xac4a('0x63')]['id'][_0xac4a('0x8e')](),_0xac4a('0x65'))[_0xac4a('0xa6')]('\x27'+_0xec92e4+'\x27',_0xac4a('0x5f'))[_0xac4a('0xa6')]('\x27'+_0xec92e4+'\x27',_0xac4a('0x60'))['from'](_0xac4a('0xa8'))[_0xac4a('0x47')]('deletedAt\x20IS\x20NULL')[_0xac4a('0x47')]('ListId\x20=\x20?',_0x33d1ec[_0xac4a('0xa7')][_0xac4a('0x8e')]())[_0xac4a('0x47')](_0xac4a('0xab'))[_0xac4a('0x47')](_0xac4a('0xae'),squel['select']()['field'](_0xac4a('0xaf'))['from'](_0xac4a('0xa1'))[_0xac4a('0x47')](_0xac4a('0x8a'),_0x1430aa[_0xac4a('0x63')]['id'][_0xac4a('0x8e')]())))[_0xac4a('0x8e')]();break;default:_0x4e224f=squel[_0xac4a('0xb1')]()['into'](_0xac4a('0xa1'))['fromQuery']([_0xac4a('0xa3'),'scheduledAt','ContactId',_0xac4a('0xa5'),_0xac4a('0x65'),_0xac4a('0x5f'),_0xac4a('0x60')],squel['select']()[_0xac4a('0xa6')](_0xac4a('0xa3'),'phone')[_0xac4a('0xa6')]('\x27'+_0xec92e4+'\x27',_0xac4a('0xa4'))[_0xac4a('0xa6')]('id',_0xac4a('0xb2'))[_0xac4a('0xa6')](_0x33d1ec[_0xac4a('0xa7')]['toString'](),'ListId')[_0xac4a('0xa6')](_0x1430aa['params']['id'][_0xac4a('0x8e')](),'VoiceQueueId')[_0xac4a('0xa6')]('\x27'+_0xec92e4+'\x27',_0xac4a('0x5f'))['field']('\x27'+_0xec92e4+'\x27',_0xac4a('0x60'))['from']('cm_contacts')[_0xac4a('0x47')](_0xac4a('0xa9'))[_0xac4a('0x47')](_0xac4a('0xaa'),_0x33d1ec[_0xac4a('0xa7')]['toString']())[_0xac4a('0x47')]('phone\x20IS\x20NOT\x20NULL'))[_0xac4a('0x8e')]();}_0x1eb063[_0xac4a('0x8c')](db[_0xac4a('0x8d')][_0xac4a('0x3d')](_0x4e224f));}return BPromise[_0xac4a('0x93')](_0x1eb063);}})[_0xac4a('0x28')](function(){var _0x2c9733=[];var _0x385268=squel['insert']()[_0xac4a('0xa0')](_0xac4a('0xb3'))[_0xac4a('0xa2')]([_0xac4a('0xb4'),_0xac4a('0xa3'),_0xac4a('0xb5'),_0xac4a('0x5f'),_0xac4a('0x60')],squel[_0xac4a('0x84')]()[_0xac4a('0xa6')](_0xac4a('0xb6'))[_0xac4a('0xa6')](_0xac4a('0xb7'))[_0xac4a('0xa6')]('ci.OrderBy')[_0xac4a('0xa6')]('\x27'+_0xec92e4+'\x27',_0xac4a('0x5f'))[_0xac4a('0xa6')]('\x27'+_0xec92e4+'\x27',_0xac4a('0x60'))['from'](_0xac4a('0xb8'),'ci')['join'](_0xac4a('0xa1'),'h',_0xac4a('0xb9'))[_0xac4a('0x47')](_0xac4a('0xba'),_0xec92e4)[_0xac4a('0x47')](_0xac4a('0xbb'),_0xac4a('0xbc')))[_0xac4a('0x8e')]();_0x2c9733['push'](db['sequelize']['query'](_0x385268));return BPromise[_0xac4a('0x93')](_0x2c9733);})['then'](function(){return _0x384a38;})[_0xac4a('0x28')](respondWithResult(_0x6ee160,null))['catch'](handleError(_0x6ee160,null));};exports[_0xac4a('0xbd')]=function(_0x5d10c0,_0x16c1f7,_0x41eb35){return db[_0xac4a('0x39')]['find']({'where':{'id':_0x5d10c0[_0xac4a('0x63')]['id']}})[_0xac4a('0x28')](handleEntityNotFound(_0x16c1f7,null))['then'](function(_0x2eb774){if(_0x2eb774){return _0x2eb774[_0xac4a('0xbd')](_0x5d10c0['query']['ids']);}})[_0xac4a('0x28')](function(_0x45d632){if(_0x45d632){return db['CmHopper'][_0xac4a('0x29')]({'where':{'ListId':_0x5d10c0[_0xac4a('0x3d')][_0xac4a('0x82')],'VoiceQueueId':_0x5d10c0[_0xac4a('0x63')]['id']}})[_0xac4a('0x28')](function(){return _0x45d632;});}})[_0xac4a('0x28')](respondWithStatusCode(_0x16c1f7,null))[_0xac4a('0x4f')](handleError(_0x16c1f7,null));};exports['getBlackLists']=function(_0x2c6aa1,_0x4980b2,_0x32c494){var _0x455f5e={};var _0x41f616={};var _0x843c53;var _0x393409;return db[_0xac4a('0x39')][_0xac4a('0x67')]({'where':{'id':_0x2c6aa1['params']['id']}})[_0xac4a('0x28')](handleEntityNotFound(_0x4980b2,null))[_0xac4a('0x28')](function(_0x56fb08){if(_0x56fb08){_0x843c53=_0x56fb08;_0x41f616[_0xac4a('0x3c')]=_[_0xac4a('0x64')](db[_0xac4a('0x9e')][_0xac4a('0x51')]);_0x41f616[_0xac4a('0x3d')]=_[_0xac4a('0x64')](_0x2c6aa1[_0xac4a('0x3d')]);_0x41f616['filters']=_[_0xac4a('0x3f')](_0x41f616['model'],_0x41f616[_0xac4a('0x3d')]);_0x455f5e[_0xac4a('0x40')]=_[_0xac4a('0x3f')](_0x41f616['model'],qs[_0xac4a('0x41')](_0x2c6aa1['query'][_0xac4a('0x41')]));_0x455f5e[_0xac4a('0x40')]=_0x455f5e[_0xac4a('0x40')][_0xac4a('0x52')]?_0x455f5e[_0xac4a('0x40')]:_0x41f616[_0xac4a('0x3c')];_0x455f5e[_0xac4a('0x44')]=qs[_0xac4a('0x45')](_0x2c6aa1[_0xac4a('0x3d')][_0xac4a('0x45')]);_0x455f5e[_0xac4a('0x47')]=qs[_0xac4a('0x3e')](_[_0xac4a('0x46')](_0x2c6aa1['query'],_0x41f616[_0xac4a('0x3e')]));if(_0x2c6aa1[_0xac4a('0x3d')][_0xac4a('0x2e')]){_0x455f5e[_0xac4a('0x47')]=_['merge'](_0x455f5e[_0xac4a('0x47')],{'$or':_['map'](_0x455f5e[_0xac4a('0x40')],function(_0x1d4bf7){var _0x2aa6a6={};_0x2aa6a6[_0x1d4bf7]={'$like':'%'+_0x2c6aa1[_0xac4a('0x3d')][_0xac4a('0x2e')]+'%'};return _0x2aa6a6;})});}_0x455f5e=_[_0xac4a('0x48')]({},_0x455f5e,_0x2c6aa1[_0xac4a('0x4a')]);return _0x843c53[_0xac4a('0xbe')](_0x455f5e);}})['then'](function(_0x105ae5){if(_0x105ae5){_0x393409=_0x105ae5[_0xac4a('0x52')];if(!_0x2c6aa1['query']['hasOwnProperty']('nolimit')){_0x455f5e[_0xac4a('0x20')]=qs['limit'](_0x2c6aa1[_0xac4a('0x3d')]['limit']);_0x455f5e[_0xac4a('0x22')]=qs[_0xac4a('0x22')](_0x2c6aa1[_0xac4a('0x3d')][_0xac4a('0x22')]);}return _0x843c53[_0xac4a('0xbe')](_0x455f5e);}})[_0xac4a('0x28')](function(_0x292110){if(_0x292110){return _0x292110?{'count':_0x393409,'rows':_0x292110}:null;}})[_0xac4a('0x28')](respondWithResult(_0x4980b2,null))[_0xac4a('0x4f')](handleError(_0x4980b2,null));};exports[_0xac4a('0xbf')]=function(_0x1bc461,_0x31715f,_0x1089b8){var _0x50b16f,_0x274785;return db[_0xac4a('0x39')][_0xac4a('0x57')]({'where':{'id':_0x1bc461[_0xac4a('0x63')]['id']}})[_0xac4a('0x28')](handleEntityNotFound(_0x31715f,null))[_0xac4a('0x28')](function(_0x36c631){if(_0x36c631){_0x274785=_0x36c631;return _0x36c631['addBlackLists'](_0x1bc461[_0xac4a('0x54')][_0xac4a('0x82')],_[_0xac4a('0x5e')](_0x1bc461[_0xac4a('0x54')],['ids','id'])||{});}return null;})[_0xac4a('0x99')](function(_0x372f21){var _0x534094;_0x50b16f=_0x372f21||[];var _0x30df12=[];if(_0x372f21){for(var _0x573356=0x0;_0x573356<_0x372f21[_0xac4a('0x52')];_0x573356+=0x1){var _0xe2473d=_0x372f21[_0x573356][_0xac4a('0x2a')]({'plain':!![]});_0x534094=squel['insert']()[_0xac4a('0xa0')](_0xac4a('0xc0'))[_0xac4a('0xa2')]([_0xac4a('0xa3'),_0xac4a('0xb2'),'ListId',_0xac4a('0x65'),_0xac4a('0x5f'),'updatedAt'],squel[_0xac4a('0x84')]()[_0xac4a('0xa6')](_0xac4a('0xa3'),_0xac4a('0xa3'))['field']('id',_0xac4a('0xb2'))[_0xac4a('0xa6')](_0xe2473d['CmListId']['toString'](),_0xac4a('0xa5'))[_0xac4a('0xa6')](_0x1bc461[_0xac4a('0x63')]['id'][_0xac4a('0x8e')](),_0xac4a('0x65'))['field'](_0xac4a('0xc1'),'createdAt')[_0xac4a('0xa6')](_0xac4a('0xc1'),_0xac4a('0x60'))[_0xac4a('0x86')](_0xac4a('0xa8'))[_0xac4a('0x47')]('deletedAt\x20IS\x20NULL')['where'](_0xac4a('0xaa'),_0xe2473d['CmListId'][_0xac4a('0x8e')]())[_0xac4a('0x47')](_0xac4a('0xab')))[_0xac4a('0x8e')]();_0x30df12['push'](db[_0xac4a('0x8d')][_0xac4a('0x3d')](_0x534094));}return BPromise['all'](_0x30df12);}})[_0xac4a('0x28')](function(){return _0x50b16f;})[_0xac4a('0x28')](respondWithResult(_0x31715f,null))[_0xac4a('0x4f')](handleError(_0x31715f,null));};exports[_0xac4a('0xc2')]=function(_0x2895ae,_0x408f28,_0x55a475){return db[_0xac4a('0x39')][_0xac4a('0x57')]({'where':{'id':_0x2895ae[_0xac4a('0x63')]['id']}})[_0xac4a('0x28')](handleEntityNotFound(_0x408f28,null))['then'](function(_0x659e61){if(_0x659e61){return _0x659e61[_0xac4a('0xc2')](_0x2895ae[_0xac4a('0x3d')][_0xac4a('0x82')]);}})[_0xac4a('0x28')](function(_0x79f24){if(_0x79f24){return db[_0xac4a('0x6b')][_0xac4a('0x29')]({'where':{'ListId':_0x2895ae[_0xac4a('0x3d')][_0xac4a('0x82')],'VoiceQueueId':_0x2895ae[_0xac4a('0x63')]['id']}})[_0xac4a('0x28')](function(){return _0x79f24;});}})[_0xac4a('0x28')](respondWithStatusCode(_0x408f28,null))['catch'](handleError(_0x408f28,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index ba55fce..919053c 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 _0xf999=['emit','hasOwnProperty','exports','events','setMaxListeners','save','update','remove'];(function(_0x15623d,_0x182c94){var _0x52eaa1=function(_0x3c218c){while(--_0x3c218c){_0x15623d['push'](_0x15623d['shift']());}};_0x52eaa1(++_0x182c94);}(_0xf999,0xc3));var _0x9f99=function(_0x5a5ae6,_0x430cde){_0x5a5ae6=_0x5a5ae6-0x0;var _0x28067a=_0xf999[_0x5a5ae6];return _0x28067a;};'use strict';var EventEmitter=require(_0x9f99('0x0'));var VoiceQueue=require('../../mysqldb')['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x9f99('0x1')](0x0);var events={'afterCreate':_0x9f99('0x2'),'afterUpdate':_0x9f99('0x3'),'afterDestroy':_0x9f99('0x4')};function emitEvent(_0x29a57d){return function(_0x13a29e,_0x536aa7,_0x25d209){VoiceQueueEvents[_0x9f99('0x5')](_0x29a57d+':'+_0x13a29e['id'],_0x13a29e);VoiceQueueEvents[_0x9f99('0x5')](_0x29a57d,_0x13a29e);_0x25d209(null);};}for(var e in events){if(events[_0x9f99('0x6')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0x9f99('0x7')]=VoiceQueueEvents; \ No newline at end of file +var _0xeed0=['hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueue','save','update','remove','emit'];(function(_0x35efd7,_0x5a97e6){var _0x3d9b5d=function(_0x45fa98){while(--_0x45fa98){_0x35efd7['push'](_0x35efd7['shift']());}};_0x3d9b5d(++_0x5a97e6);}(_0xeed0,0x157));var _0x0eed=function(_0x4e2f6f,_0x4a1e74){_0x4e2f6f=_0x4e2f6f-0x0;var _0x32e5a0=_0xeed0[_0x4e2f6f];return _0x32e5a0;};'use strict';var EventEmitter=require(_0x0eed('0x0'));var VoiceQueue=require(_0x0eed('0x1'))['db'][_0x0eed('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0eed('0x3'),'afterUpdate':_0x0eed('0x4'),'afterDestroy':_0x0eed('0x5')};function emitEvent(_0x41c37f){return function(_0x35e0d1,_0x19c93d,_0x245547){VoiceQueueEvents['emit'](_0x41c37f+':'+_0x35e0d1['id'],_0x35e0d1);VoiceQueueEvents[_0x0eed('0x6')](_0x41c37f,_0x35e0d1);_0x245547(null);};}for(var e in events){if(events[_0x0eed('0x7')](e)){var event=events[e];VoiceQueue[_0x0eed('0x8')](e,emitEvent(event));}}module[_0x0eed('0x9')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 52dbd90..b8bfc7e 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 _0x34e8=['voice_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports','VoiceQueue'];(function(_0x1ea3e9,_0x582d8b){var _0x4c3d8e=function(_0x3fa580){while(--_0x3fa580){_0x1ea3e9['push'](_0x1ea3e9['shift']());}};_0x4c3d8e(++_0x582d8b);}(_0x34e8,0x12c));var _0x834e=function(_0x56390e,_0x3f1ccd){_0x56390e=_0x56390e-0x0;var _0xa00c12=_0x34e8[_0x56390e];return _0xa00c12;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x70e0=['voice_queues','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./voiceQueue.attributes'];(function(_0x29d4ed,_0x264f8e){var _0x21a4a6=function(_0x244b77){while(--_0x244b77){_0x29d4ed['push'](_0x29d4ed['shift']());}};_0x21a4a6(++_0x264f8e);}(_0x70e0,0x17b));var _0x070e=function(_0x24e16b,_0x5696d7){_0x24e16b=_0x24e16b-0x0;var _0x587ad7=_0x70e0[_0x24e16b];return _0x587ad7;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('VoiceQueue',attributes,{'tableName':_0x070e('0x8'),'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 87e8348..4efdda5 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 _0x867b=['map','model','stringify','ShowVoiceQueue','lodash','util','bluebird','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','attributes','limit','include'];(function(_0x2c6ea3,_0x5c2967){var _0x48cc4c=function(_0x32700f){while(--_0x32700f){_0x2c6ea3['push'](_0x2c6ea3['shift']());}};_0x48cc4c(++_0x5c2967);}(_0x867b,0x76));var _0xb867=function(_0x31eacc,_0x54a934){_0x31eacc=_0x31eacc-0x0;var _0x1316bb=_0x867b[_0x31eacc];return _0x1316bb;};'use strict';var _=require(_0xb867('0x0'));var util=require(_0xb867('0x1'));var moment=require('moment');var BPromise=require(_0xb867('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb867('0x3'))(_0xb867('0x4'));var config=require(_0xb867('0x5'));var jayson=require(_0xb867('0x6'));var client=jayson[_0xb867('0x7')]['http']({'port':0x232a});config[_0xb867('0x8')]=_[_0xb867('0x9')](config[_0xb867('0x8')],{'host':_0xb867('0xa'),'port':0x18eb});var socket=require(_0xb867('0xb'))(new Redis(config[_0xb867('0x8')]));require(_0xb867('0xc'))[_0xb867('0xd')](socket);function respondWithRpcPromise(_0x2d3c9a,_0x4ab3f1,_0x289202){return new BPromise(function(_0x3951e8,_0x301e8d){return client[_0xb867('0xe')](_0x2d3c9a,_0x289202)[_0xb867('0xf')](function(_0x5e43e1){logger[_0xb867('0x10')](_0xb867('0x11'),_0x4ab3f1,'request\x20sent');logger[_0xb867('0x12')](_0xb867('0x13'),_0x4ab3f1,'request\x20sent',JSON['stringify'](_0x5e43e1));if(_0x5e43e1[_0xb867('0x14')]){if(_0x5e43e1[_0xb867('0x14')][_0xb867('0x15')]===0x1f4){logger[_0xb867('0x14')](_0xb867('0x11'),_0x4ab3f1,_0x5e43e1['error'][_0xb867('0x16')]);return _0x301e8d(_0x5e43e1['error']['message']);}logger[_0xb867('0x14')](_0xb867('0x11'),_0x4ab3f1,_0x5e43e1[_0xb867('0x14')][_0xb867('0x16')]);return _0x3951e8(_0x5e43e1[_0xb867('0x14')][_0xb867('0x16')]);}else{logger[_0xb867('0x10')](_0xb867('0x11'),_0x4ab3f1,_0xb867('0x17'));_0x3951e8(_0x5e43e1['result'][_0xb867('0x16')]);}})[_0xb867('0x18')](function(_0x4b4563){logger[_0xb867('0x14')](_0xb867('0x11'),_0x4ab3f1,_0x4b4563);_0x301e8d(_0x4b4563);});});}exports[_0xb867('0x19')]=function(_0x5c2dea){var _0x42745f=this;return new Promise(function(_0x218199,_0x49ba4f){return db[_0xb867('0x1a')][_0xb867('0x1b')]({'raw':_0x5c2dea[_0xb867('0x1c')]?_0x5c2dea[_0xb867('0x1c')][_0xb867('0x1d')]===undefined?!![]:![]:!![],'where':_0x5c2dea[_0xb867('0x1c')]?_0x5c2dea['options'][_0xb867('0x1e')]||null:null,'attributes':_0x5c2dea[_0xb867('0x1c')]?_0x5c2dea[_0xb867('0x1c')][_0xb867('0x1f')]||null:null,'limit':_0x5c2dea['options']?_0x5c2dea[_0xb867('0x1c')][_0xb867('0x20')]||null:null,'include':_0x5c2dea[_0xb867('0x1c')]?_0x5c2dea[_0xb867('0x1c')][_0xb867('0x21')]?_[_0xb867('0x22')](_0x5c2dea[_0xb867('0x1c')][_0xb867('0x21')],function(_0x4997d3){return{'model':db[_0x4997d3[_0xb867('0x23')]],'as':_0x4997d3['as'],'attributes':_0x4997d3['attributes'],'include':_0x4997d3['include']?_[_0xb867('0x22')](_0x4997d3[_0xb867('0x21')],function(_0x1a94cb){return{'model':db[_0x1a94cb[_0xb867('0x23')]],'as':_0x1a94cb['as'],'attributes':_0x1a94cb[_0xb867('0x1f')],'include':_0x1a94cb[_0xb867('0x21')]?_[_0xb867('0x22')](_0x1a94cb[_0xb867('0x21')],function(_0x20066c){return{'model':db[_0x20066c[_0xb867('0x23')]],'as':_0x20066c['as'],'attributes':_0x20066c[_0xb867('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1563ca){logger[_0xb867('0x10')](_0xb867('0x19'),_0x5c2dea);logger[_0xb867('0x12')](_0xb867('0x19'),_0x5c2dea,JSON[_0xb867('0x24')](_0x1563ca));_0x218199(_0x1563ca);})[_0xb867('0x18')](function(_0x4585c6){logger[_0xb867('0x14')](_0xb867('0x19'),_0x4585c6[_0xb867('0x16')],_0x5c2dea);_0x49ba4f(_0x42745f[_0xb867('0x14')](0x1f4,_0x4585c6[_0xb867('0x16')]));});});};exports['ShowVoiceQueue']=function(_0x1766ca){var _0x5c794a=this;return new Promise(function(_0x158737,_0x54a2f7){return db[_0xb867('0x1a')]['find']({'raw':_0x1766ca[_0xb867('0x1c')]?_0x1766ca[_0xb867('0x1c')][_0xb867('0x1d')]===undefined?!![]:![]:!![],'where':_0x1766ca[_0xb867('0x1c')]?_0x1766ca[_0xb867('0x1c')][_0xb867('0x1e')]||null:null,'attributes':_0x1766ca[_0xb867('0x1c')]?_0x1766ca[_0xb867('0x1c')][_0xb867('0x1f')]||null:null,'include':_0x1766ca[_0xb867('0x1c')]?_0x1766ca[_0xb867('0x1c')][_0xb867('0x21')]?_[_0xb867('0x22')](_0x1766ca[_0xb867('0x1c')]['include'],function(_0x1cb542){return{'model':db[_0x1cb542[_0xb867('0x23')]],'as':_0x1cb542['as'],'attributes':_0x1cb542[_0xb867('0x1f')],'include':_0x1cb542['include']?_['map'](_0x1cb542['include'],function(_0x27f279){return{'model':db[_0x27f279[_0xb867('0x23')]],'as':_0x27f279['as'],'attributes':_0x27f279[_0xb867('0x1f')],'include':_0x27f279[_0xb867('0x21')]?_[_0xb867('0x22')](_0x27f279[_0xb867('0x21')],function(_0xc63b51){return{'model':db[_0xc63b51[_0xb867('0x23')]],'as':_0xc63b51['as'],'attributes':_0xc63b51[_0xb867('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xb867('0xf')](function(_0x58af54){logger[_0xb867('0x10')](_0xb867('0x25'),_0x1766ca);logger['debug'](_0xb867('0x25'),_0x1766ca,JSON[_0xb867('0x24')](_0x58af54));_0x158737(_0x58af54);})['catch'](function(_0x516ee9){logger[_0xb867('0x14')](_0xb867('0x25'),_0x516ee9['message'],_0x1766ca);_0x54a2f7(_0x5c794a[_0xb867('0x14')](0x1f4,_0x516ee9[_0xb867('0x16')]));});});}; \ No newline at end of file +var _0x695d=['where','include','map','model','attributes','debug','stringify','ShowVoiceQueue','find','util','bluebird','ioredis','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./voiceQueue.socket','register','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','VoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x695d,0xe7));var _0xd695=function(_0x25656f,_0x4cf8be){_0x25656f=_0x25656f-0x0;var _0x6e703f=_0x695d[_0x25656f];return _0x6e703f;};'use strict';var _=require('lodash');var util=require(_0xd695('0x0'));var moment=require('moment');var BPromise=require(_0xd695('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd695('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd695('0x3'));var config=require(_0xd695('0x4'));var jayson=require(_0xd695('0x5'));var client=jayson[_0xd695('0x6')][_0xd695('0x7')]({'port':0x232a});config[_0xd695('0x8')]=_[_0xd695('0x9')](config[_0xd695('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xd695('0xa'))(new Redis(config['redis']));require(_0xd695('0xb'))[_0xd695('0xc')](socket);function respondWithRpcPromise(_0x2a3789,_0x1006f6,_0x568bff){return new BPromise(function(_0x5044e5,_0x701350){return client['request'](_0x2a3789,_0x568bff)[_0xd695('0xd')](function(_0x16494e){logger[_0xd695('0xe')](_0xd695('0xf'),_0x1006f6,_0xd695('0x10'));logger['debug'](_0xd695('0x11'),_0x1006f6,'request\x20sent',JSON['stringify'](_0x16494e));if(_0x16494e[_0xd695('0x12')]){if(_0x16494e[_0xd695('0x12')][_0xd695('0x13')]===0x1f4){logger['error'](_0xd695('0xf'),_0x1006f6,_0x16494e[_0xd695('0x12')][_0xd695('0x14')]);return _0x701350(_0x16494e['error'][_0xd695('0x14')]);}logger[_0xd695('0x12')]('VoiceQueue,\x20%s,\x20%s',_0x1006f6,_0x16494e[_0xd695('0x12')][_0xd695('0x14')]);return _0x5044e5(_0x16494e[_0xd695('0x12')]['message']);}else{logger[_0xd695('0xe')](_0xd695('0xf'),_0x1006f6,_0xd695('0x10'));_0x5044e5(_0x16494e[_0xd695('0x15')]['message']);}})[_0xd695('0x16')](function(_0x30d28a){logger[_0xd695('0x12')](_0xd695('0xf'),_0x1006f6,_0x30d28a);_0x701350(_0x30d28a);});});}exports[_0xd695('0x17')]=function(_0x1d55f5){var _0x4ef9ff=this;return new Promise(function(_0x2edd58,_0x50c21d){return db[_0xd695('0x18')][_0xd695('0x19')]({'raw':_0x1d55f5[_0xd695('0x1a')]?_0x1d55f5[_0xd695('0x1a')][_0xd695('0x1b')]===undefined?!![]:![]:!![],'where':_0x1d55f5[_0xd695('0x1a')]?_0x1d55f5[_0xd695('0x1a')][_0xd695('0x1c')]||null:null,'attributes':_0x1d55f5[_0xd695('0x1a')]?_0x1d55f5[_0xd695('0x1a')]['attributes']||null:null,'limit':_0x1d55f5[_0xd695('0x1a')]?_0x1d55f5[_0xd695('0x1a')]['limit']||null:null,'include':_0x1d55f5['options']?_0x1d55f5['options'][_0xd695('0x1d')]?_[_0xd695('0x1e')](_0x1d55f5[_0xd695('0x1a')][_0xd695('0x1d')],function(_0x42996c){return{'model':db[_0x42996c[_0xd695('0x1f')]],'as':_0x42996c['as'],'attributes':_0x42996c[_0xd695('0x20')],'include':_0x42996c['include']?_[_0xd695('0x1e')](_0x42996c[_0xd695('0x1d')],function(_0x2d457b){return{'model':db[_0x2d457b[_0xd695('0x1f')]],'as':_0x2d457b['as'],'attributes':_0x2d457b[_0xd695('0x20')],'include':_0x2d457b['include']?_['map'](_0x2d457b[_0xd695('0x1d')],function(_0x1143a6){return{'model':db[_0x1143a6[_0xd695('0x1f')]],'as':_0x1143a6['as'],'attributes':_0x1143a6['attributes']};}):[]};}):[]};}):[]:[]})[_0xd695('0xd')](function(_0x3f0feb){logger[_0xd695('0xe')]('GetVoiceQueue',_0x1d55f5);logger[_0xd695('0x21')]('GetVoiceQueue',_0x1d55f5,JSON[_0xd695('0x22')](_0x3f0feb));_0x2edd58(_0x3f0feb);})[_0xd695('0x16')](function(_0x5868e7){logger['error'](_0xd695('0x17'),_0x5868e7[_0xd695('0x14')],_0x1d55f5);_0x50c21d(_0x4ef9ff[_0xd695('0x12')](0x1f4,_0x5868e7[_0xd695('0x14')]));});});};exports[_0xd695('0x23')]=function(_0x23fac4){var _0x4f01cb=this;return new Promise(function(_0x1bed43,_0xaaa763){return db[_0xd695('0x18')][_0xd695('0x24')]({'raw':_0x23fac4[_0xd695('0x1a')]?_0x23fac4['options'][_0xd695('0x1b')]===undefined?!![]:![]:!![],'where':_0x23fac4[_0xd695('0x1a')]?_0x23fac4[_0xd695('0x1a')][_0xd695('0x1c')]||null:null,'attributes':_0x23fac4[_0xd695('0x1a')]?_0x23fac4[_0xd695('0x1a')][_0xd695('0x20')]||null:null,'include':_0x23fac4[_0xd695('0x1a')]?_0x23fac4['options'][_0xd695('0x1d')]?_['map'](_0x23fac4['options'][_0xd695('0x1d')],function(_0x24be9b){return{'model':db[_0x24be9b[_0xd695('0x1f')]],'as':_0x24be9b['as'],'attributes':_0x24be9b['attributes'],'include':_0x24be9b[_0xd695('0x1d')]?_[_0xd695('0x1e')](_0x24be9b[_0xd695('0x1d')],function(_0xd3d105){return{'model':db[_0xd3d105['model']],'as':_0xd3d105['as'],'attributes':_0xd3d105[_0xd695('0x20')],'include':_0xd3d105[_0xd695('0x1d')]?_[_0xd695('0x1e')](_0xd3d105[_0xd695('0x1d')],function(_0x3b3cf5){return{'model':db[_0x3b3cf5['model']],'as':_0x3b3cf5['as'],'attributes':_0x3b3cf5[_0xd695('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x12a1f4){logger[_0xd695('0xe')](_0xd695('0x23'),_0x23fac4);logger[_0xd695('0x21')](_0xd695('0x23'),_0x23fac4,JSON['stringify'](_0x12a1f4));_0x1bed43(_0x12a1f4);})['catch'](function(_0x5ac5f7){logger[_0xd695('0x12')]('ShowVoiceQueue',_0x5ac5f7[_0xd695('0x14')],_0x23fac4);_0xaaa763(_0x4f01cb[_0xd695('0x12')](0x1f4,_0x5ac5f7[_0xd695('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index e6b2fe5..d73e378 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 _0xed82=['update','emit','removeListener','register','length','voiceQueue:','./voiceQueue.events','save'];(function(_0x10b182,_0x4bbdd2){var _0x30a865=function(_0x45c856){while(--_0x45c856){_0x10b182['push'](_0x10b182['shift']());}};_0x30a865(++_0x4bbdd2);}(_0xed82,0x1a6));var _0x2ed8=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xed82[_0x4b369d];return _0x571a98;};'use strict';var VoiceQueueEvents=require(_0x2ed8('0x0'));var events=[_0x2ed8('0x1'),'remove',_0x2ed8('0x2')];function createListener(_0xc19548,_0x59ea81){return function(_0x8b4b1f){_0x59ea81[_0x2ed8('0x3')](_0xc19548,_0x8b4b1f);};}function removeListener(_0x7e44e2,_0x6153c6){return function(){VoiceQueueEvents[_0x2ed8('0x4')](_0x7e44e2,_0x6153c6);};}exports[_0x2ed8('0x5')]=function(_0x15c8cb){for(var _0x17dfbc=0x0,_0x42fb31=events[_0x2ed8('0x6')];_0x17dfbc<_0x42fb31;_0x17dfbc++){var _0x1fcb8e=events[_0x17dfbc];var _0x2dbd5b=createListener(_0x2ed8('0x7')+_0x1fcb8e,_0x15c8cb);VoiceQueueEvents['on'](_0x1fcb8e,_0x2dbd5b);}}; \ No newline at end of file +var _0xd871=['remove','update','removeListener','length','./voiceQueue.events','save'];(function(_0x24086a,_0x3be9db){var _0x51351f=function(_0x32c59b){while(--_0x32c59b){_0x24086a['push'](_0x24086a['shift']());}};_0x51351f(++_0x3be9db);}(_0xd871,0x8e));var _0x1d87=function(_0x1ad69b,_0x42272e){_0x1ad69b=_0x1ad69b-0x0;var _0x5ee47f=_0xd871[_0x1ad69b];return _0x5ee47f;};'use strict';var VoiceQueueEvents=require(_0x1d87('0x0'));var events=[_0x1d87('0x1'),_0x1d87('0x2'),_0x1d87('0x3')];function createListener(_0x3ad596,_0x41af38){return function(_0xef1845){_0x41af38['emit'](_0x3ad596,_0xef1845);};}function removeListener(_0x2a1a66,_0xe881c5){return function(){VoiceQueueEvents[_0x1d87('0x4')](_0x2a1a66,_0xe881c5);};}exports['register']=function(_0x1d8bff){for(var _0x57d7c3=0x0,_0x1fdcf1=events[_0x1d87('0x5')];_0x57d7c3<_0x1fdcf1;_0x57d7c3++){var _0xf291d8=events[_0x57d7c3];var _0x4860a0=createListener('voiceQueue:'+_0xf291d8,_0x1d8bff);VoiceQueueEvents['on'](_0xf291d8,_0x4860a0);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index ba6851c..772f333 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 _0xa65a=['describe','/index','getVoiceQueuesReport','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0xa65a,0xe3));var _0xaa65=function(_0x45f7b0,_0x50c334){_0x45f7b0=_0x45f7b0-0x0;var _0x58289f=_0xa65a[_0x45f7b0];return _0x58289f;};'use strict';var multer=require(_0xaa65('0x0'));var util=require(_0xaa65('0x1'));var path=require(_0xaa65('0x2'));var timeout=require(_0xaa65('0x3'));var express=require(_0xaa65('0x4'));var router=express[_0xaa65('0x5')]();var fs_extra=require(_0xaa65('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xaa65('0x7'));var config=require(_0xaa65('0x8'));var controller=require(_0xaa65('0x9'));router[_0xaa65('0xa')]('/',auth[_0xaa65('0xb')](),controller[_0xaa65('0xc')]);router[_0xaa65('0xa')]('/describe',auth[_0xaa65('0xb')](),controller[_0xaa65('0xd')]);router[_0xaa65('0xa')](_0xaa65('0xe'),auth[_0xaa65('0xb')](),controller[_0xaa65('0xf')]);router[_0xaa65('0xa')](_0xaa65('0x10'),auth[_0xaa65('0xb')](),controller[_0xaa65('0x11')]);router[_0xaa65('0x12')]('/',auth[_0xaa65('0xb')](),controller[_0xaa65('0x13')]);router[_0xaa65('0x14')](_0xaa65('0x10'),auth[_0xaa65('0xb')](),controller[_0xaa65('0x15')]);router[_0xaa65('0x16')](_0xaa65('0x10'),auth[_0xaa65('0xb')](),controller[_0xaa65('0x17')]);module['exports']=router; \ No newline at end of file +var _0x869f=['post','create','/:id','update','delete','destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/index','getVoiceQueuesReport'];(function(_0x49f126,_0x21c6dc){var _0x20d0a3=function(_0x2d6e99){while(--_0x2d6e99){_0x49f126['push'](_0x49f126['shift']());}};_0x20d0a3(++_0x21c6dc);}(_0x869f,0xcf));var _0xf869=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x869f[_0x17d9e3];return _0x14192d;};'use strict';var multer=require(_0xf869('0x0'));var util=require(_0xf869('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf869('0x2')]();var fs_extra=require(_0xf869('0x3'));var auth=require(_0xf869('0x4'));var interaction=require(_0xf869('0x5'));var config=require('../../config/environment');var controller=require('./voiceQueueReport.controller');router[_0xf869('0x6')]('/',auth[_0xf869('0x7')](),controller[_0xf869('0x8')]);router[_0xf869('0x6')](_0xf869('0x9'),auth[_0xf869('0x7')](),controller[_0xf869('0xa')]);router[_0xf869('0x6')](_0xf869('0xb'),auth[_0xf869('0x7')](),controller[_0xf869('0xc')]);router['get']('/:id',auth[_0xf869('0x7')](),controller['show']);router[_0xf869('0xd')]('/',auth[_0xf869('0x7')](),controller[_0xf869('0xe')]);router['put'](_0xf869('0xf'),auth['isAuthenticated'](),controller[_0xf869('0x10')]);router[_0xf869('0x11')](_0xf869('0xf'),auth[_0xf869('0x7')](),controller[_0xf869('0x12')]);module[_0xf869('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 0e13b25..dd71a27 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 _0x2dd7=['BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','setDataValue','queuecallerleaveAt','holdtime','INTEGER'];(function(_0x5097b,_0x337d8a){var _0x5306c7=function(_0x35ed1f){while(--_0x35ed1f){_0x5097b['push'](_0x5097b['shift']());}};_0x5306c7(++_0x337d8a);}(_0x2dd7,0x120));var _0x72dd=function(_0x4b73a2,_0x40b5fe){_0x4b73a2=_0x4b73a2-0x0;var _0x383c66=_0x2dd7[_0x4b73a2];return _0x383c66;};'use strict';var Sequelize=require(_0x72dd('0x0'));var moment=require(_0x72dd('0x1'));module['exports']={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x72dd('0x2')]},'calleridnum':{'type':Sequelize[_0x72dd('0x2')]},'calleridname':{'type':Sequelize[_0x72dd('0x2')]},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize[_0x72dd('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0x72dd('0x3')],'set':function(_0x155c05){var _0x5691ff=moment(_0x155c05);var _0x41dec8=moment(this[_0x72dd('0x4')](_0x72dd('0x5')))[_0x72dd('0x6')](_0x72dd('0x7'));var _0xfec918=_0x5691ff['diff'](_0x41dec8,'seconds');this[_0x72dd('0x8')](_0x72dd('0x9'),_0x155c05);this[_0x72dd('0x8')](_0x72dd('0xa'),_0xfec918||null);}},'position':{'type':Sequelize[_0x72dd('0xb')]},'count':{'type':Sequelize[_0x72dd('0xb')]},'queuecallerabandon':{'type':Sequelize[_0x72dd('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x72dd('0x3')]},'queuecallercomplete':{'type':Sequelize[_0x72dd('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x72dd('0x3')]},'queuecallerexit':{'type':Sequelize[_0x72dd('0xc')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x72dd('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0x72dd('0x2')],'comment':_0x72dd('0xd')},'originalposition':{'type':Sequelize[_0x72dd('0xb')]},'channel':{'type':Sequelize[_0x72dd('0x2')]},'connectedlinenum':{'type':Sequelize[_0x72dd('0x2')]},'connectedlinename':{'type':Sequelize[_0x72dd('0x2')]},'accountcode':{'type':Sequelize[_0x72dd('0x2')]},'context':{'type':Sequelize[_0x72dd('0x2')]},'exten':{'type':Sequelize[_0x72dd('0x2')]},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x72dd('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x72dd('0x2')]},'transfer':{'type':Sequelize[_0x72dd('0xc')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x72dd('0x2')],'comment':_0x72dd('0xe')},'transferexten':{'type':Sequelize[_0x72dd('0x2')]},'transferuniqueid':{'type':Sequelize[_0x72dd('0x2')]},'disposition':{'type':Sequelize[_0x72dd('0x2')]},'secondDisposition':{'type':Sequelize[_0x72dd('0x2')]},'thirdDisposition':{'type':Sequelize[_0x72dd('0x2')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x6f1e=['queuecallerleaveAt','setDataValue','holdtime','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','STRING','DATE','getDataValue','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','seconds'];(function(_0x431db6,_0x39e17b){var _0x34674e=function(_0x5d146f){while(--_0x5d146f){_0x431db6['push'](_0x431db6['shift']());}};_0x34674e(++_0x39e17b);}(_0x6f1e,0x84));var _0xe6f1=function(_0x4456a2,_0x376ff2){_0x4456a2=_0x4456a2-0x0;var _0xf36b56=_0x6f1e[_0x4456a2];return _0xf36b56;};'use strict';var Sequelize=require(_0xe6f1('0x0'));var moment=require(_0xe6f1('0x1'));module['exports']={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xe6f1('0x2')]},'calleridnum':{'type':Sequelize[_0xe6f1('0x2')]},'calleridname':{'type':Sequelize[_0xe6f1('0x2')]},'queue':{'type':Sequelize[_0xe6f1('0x2')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0xe6f1('0x3')],'set':function(_0x1eb510){var _0x473dfc=moment(_0x1eb510);var _0x4d4475=moment(this[_0xe6f1('0x4')](_0xe6f1('0x5')))['format'](_0xe6f1('0x6'));var _0x1292c0=_0x473dfc['diff'](_0x4d4475,_0xe6f1('0x7'));this['setDataValue'](_0xe6f1('0x8'),_0x1eb510);this[_0xe6f1('0x9')](_0xe6f1('0xa'),_0x1292c0||null);}},'position':{'type':Sequelize[_0xe6f1('0xb')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xe6f1('0x3')]},'queuecallercomplete':{'type':Sequelize[_0xe6f1('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xe6f1('0x3')]},'queuecallerexit':{'type':Sequelize[_0xe6f1('0xc')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xe6f1('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0xe6f1('0x2')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0xe6f1('0xb')]},'channel':{'type':Sequelize[_0xe6f1('0x2')]},'connectedlinenum':{'type':Sequelize[_0xe6f1('0x2')]},'connectedlinename':{'type':Sequelize[_0xe6f1('0x2')]},'accountcode':{'type':Sequelize[_0xe6f1('0x2')]},'context':{'type':Sequelize[_0xe6f1('0x2')]},'exten':{'type':Sequelize[_0xe6f1('0x2')]},'priority':{'type':Sequelize[_0xe6f1('0x2')]},'holdtime':{'type':Sequelize[_0xe6f1('0xb')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xe6f1('0xc')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xe6f1('0x2')],'comment':_0xe6f1('0xd')},'transferexten':{'type':Sequelize[_0xe6f1('0x2')]},'transferuniqueid':{'type':Sequelize[_0xe6f1('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xe6f1('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0xe6f1('0xb')],'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 fa63a57..5e78f9a 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 _0x9486=['findAll','catch','show','params','length','find','create','body','describe','rows','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','name','send','index','VoiceQueueReport','rawAttributes','fieldName','type','map','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include'];(function(_0x254b13,_0x38c4a3){var _0x1de3cc=function(_0x27de8b){while(--_0x27de8b){_0x254b13['push'](_0x254b13['shift']());}};_0x1de3cc(++_0x38c4a3);}(_0x9486,0xfa));var _0x6948=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x9486[_0x2d7f0e];return _0x110b07;};'use strict';var emlformat=require(_0x6948('0x0'));var rimraf=require(_0x6948('0x1'));var zipdir=require(_0x6948('0x2'));var jsonpatch=require(_0x6948('0x3'));var rp=require(_0x6948('0x4'));var moment=require(_0x6948('0x5'));var BPromise=require(_0x6948('0x6'));var Mustache=require(_0x6948('0x7'));var util=require(_0x6948('0x8'));var path=require(_0x6948('0x9'));var sox=require(_0x6948('0xa'));var csv=require(_0x6948('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6948('0xc'));var _=require(_0x6948('0xd'));var squel=require(_0x6948('0xe'));var crypto=require(_0x6948('0xf'));var jsforce=require(_0x6948('0x10'));var deskjs=require(_0x6948('0x11'));var toCsv=require('to-csv');var querystring=require(_0x6948('0x12'));var Papa=require(_0x6948('0x13'));var Redis=require(_0x6948('0x14'));var authService=require(_0x6948('0x15'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6948('0x16'))(_0x6948('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6948('0x18'))['db'];config[_0x6948('0x19')]=_['defaults'](config['redis'],{'host':_0x6948('0x1a'),'port':0x18eb});var socket=require(_0x6948('0x1b'))(new Redis(config[_0x6948('0x19')]));require(_0x6948('0x1c'))[_0x6948('0x1d')](socket);function respondWithStatusCode(_0x11b055,_0x5d3e64){_0x5d3e64=_0x5d3e64||0xcc;return function(_0x54958d){if(_0x54958d){return _0x11b055[_0x6948('0x1e')](_0x5d3e64);}return _0x11b055[_0x6948('0x1f')](_0x5d3e64)[_0x6948('0x20')]();};}function respondWithResult(_0x26089b,_0x5cd943){_0x5cd943=_0x5cd943||0xc8;return function(_0x35f317){if(_0x35f317){return _0x26089b['status'](_0x5cd943)[_0x6948('0x21')](_0x35f317);}};}function respondWithFilteredResult(_0x5b736d,_0x14bd5e){return function(_0x4a743c){if(_0x4a743c){var _0x94c170=typeof _0x14bd5e[_0x6948('0x22')]==='undefined'&&typeof _0x14bd5e[_0x6948('0x23')]===_0x6948('0x24');var _0x269a23=_0x4a743c['count'];var _0x98c6c1=_0x94c170?0x0:_0x14bd5e[_0x6948('0x22')];var _0x3f9ec8=_0x94c170?_0x4a743c[_0x6948('0x25')]:_0x14bd5e[_0x6948('0x22')]+_0x14bd5e[_0x6948('0x23')];var _0x2c21f0;if(_0x3f9ec8>=_0x269a23){_0x3f9ec8=_0x269a23;_0x2c21f0=0xc8;}else{_0x2c21f0=0xce;}_0x5b736d[_0x6948('0x1f')](_0x2c21f0);return _0x5b736d[_0x6948('0x26')]('Content-Range',_0x98c6c1+'-'+_0x3f9ec8+'/'+_0x269a23)[_0x6948('0x21')](_0x4a743c);}return null;};}function patchUpdates(_0x415027){return function(_0x402463){try{jsonpatch[_0x6948('0x27')](_0x402463,_0x415027,!![]);}catch(_0x2478ca){return BPromise[_0x6948('0x28')](_0x2478ca);}return _0x402463[_0x6948('0x29')]();};}function saveUpdates(_0x5aa7f8,_0x564c65){return function(_0x4d0173){if(_0x4d0173){return _0x4d0173[_0x6948('0x2a')](_0x5aa7f8)['then'](function(_0x39b724){return _0x39b724;});}return null;};}function removeEntity(_0x1f5b6d,_0x23d9e9){return function(_0x1f51b5){if(_0x1f51b5){return _0x1f51b5['destroy']()[_0x6948('0x2b')](function(){_0x1f5b6d[_0x6948('0x1f')](0xcc)[_0x6948('0x20')]();});}};}function handleEntityNotFound(_0x98d7da,_0x534e7e){return function(_0x180501){if(!_0x180501){_0x98d7da[_0x6948('0x1e')](0x194);}return _0x180501;};}function handleError(_0x6235cc,_0x102fbb){_0x102fbb=_0x102fbb||0x1f4;return function(_0x715327){logger['error'](_0x715327['stack']);if(_0x715327[_0x6948('0x2c')]){delete _0x715327['name'];}_0x6235cc[_0x6948('0x1f')](_0x102fbb)[_0x6948('0x2d')](_0x715327);};}exports[_0x6948('0x2e')]=function(_0x2e8b75,_0x2e2266){var _0x4f4ef5={},_0x523c04={},_0x5249c1={'count':0x0,'rows':[]};var _0x29cf11=_['map'](db[_0x6948('0x2f')][_0x6948('0x30')],function(_0x168e50){return{'name':_0x168e50[_0x6948('0x31')],'type':_0x168e50[_0x6948('0x32')]['key']};});_0x523c04['model']=_[_0x6948('0x33')](_0x29cf11,_0x6948('0x2c'));_0x523c04[_0x6948('0x34')]=_[_0x6948('0x35')](_0x2e8b75[_0x6948('0x34')]);_0x523c04[_0x6948('0x36')]=_[_0x6948('0x37')](_0x523c04[_0x6948('0x38')],_0x523c04['query']);_0x4f4ef5[_0x6948('0x39')]=_[_0x6948('0x37')](_0x523c04[_0x6948('0x38')],qs[_0x6948('0x3a')](_0x2e8b75[_0x6948('0x34')]['fields']));_0x4f4ef5[_0x6948('0x39')]=_0x4f4ef5[_0x6948('0x39')]['length']?_0x4f4ef5[_0x6948('0x39')]:_0x523c04[_0x6948('0x38')];if(!_0x2e8b75[_0x6948('0x34')][_0x6948('0x3b')](_0x6948('0x3c'))){_0x4f4ef5['limit']=qs['limit'](_0x2e8b75['query'][_0x6948('0x23')]);_0x4f4ef5[_0x6948('0x22')]=qs[_0x6948('0x22')](_0x2e8b75['query'][_0x6948('0x22')]);}_0x4f4ef5[_0x6948('0x3d')]=qs[_0x6948('0x3e')](_0x2e8b75['query']['sort']);_0x4f4ef5['where']=qs['filters'](_['pick'](_0x2e8b75['query'],_0x523c04[_0x6948('0x36')]),_0x29cf11);if(_0x2e8b75[_0x6948('0x34')][_0x6948('0x3f')]){_0x4f4ef5[_0x6948('0x40')]=_[_0x6948('0x41')](_0x4f4ef5[_0x6948('0x40')],{'$or':_[_0x6948('0x33')](_0x29cf11,function(_0x268bc4){if(_0x268bc4[_0x6948('0x32')]!==_0x6948('0x42')){var _0x4fda07={};_0x4fda07[_0x268bc4[_0x6948('0x2c')]]={'$like':'%'+_0x2e8b75[_0x6948('0x34')][_0x6948('0x3f')]+'%'};return _0x4fda07;}})});}_0x4f4ef5=_[_0x6948('0x41')]({},_0x4f4ef5,_0x2e8b75[_0x6948('0x43')]);var _0x52122f={'where':_0x4f4ef5[_0x6948('0x40')]};return db['VoiceQueueReport'][_0x6948('0x25')](_0x52122f)['then'](function(_0x11d6f9){_0x5249c1[_0x6948('0x25')]=_0x11d6f9;if(_0x2e8b75[_0x6948('0x34')][_0x6948('0x44')]){_0x4f4ef5[_0x6948('0x45')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x6948('0x46')](_0x4f4ef5);})[_0x6948('0x2b')](function(_0x5ceca2){_0x5249c1['rows']=_0x5ceca2;return _0x5249c1;})[_0x6948('0x2b')](respondWithFilteredResult(_0x2e2266,_0x4f4ef5))[_0x6948('0x47')](handleError(_0x2e2266,null));};exports[_0x6948('0x48')]=function(_0x868742,_0x14f95b){var _0xdc64c5={'raw':![],'where':{'id':_0x868742[_0x6948('0x49')]['id']}},_0x2f76ba={};_0x2f76ba['model']=_['keys'](db[_0x6948('0x2f')][_0x6948('0x30')]);_0x2f76ba[_0x6948('0x34')]=_[_0x6948('0x35')](_0x868742['query']);_0x2f76ba[_0x6948('0x36')]=_[_0x6948('0x37')](_0x2f76ba[_0x6948('0x38')],_0x2f76ba[_0x6948('0x34')]);_0xdc64c5[_0x6948('0x39')]=_[_0x6948('0x37')](_0x2f76ba[_0x6948('0x38')],qs[_0x6948('0x3a')](_0x868742[_0x6948('0x34')]['fields']));_0xdc64c5['attributes']=_0xdc64c5[_0x6948('0x39')][_0x6948('0x4a')]?_0xdc64c5[_0x6948('0x39')]:_0x2f76ba[_0x6948('0x38')];if(_0x868742[_0x6948('0x34')]['includeAll']){_0xdc64c5[_0x6948('0x45')]=[{'all':!![]}];}_0xdc64c5=_[_0x6948('0x41')]({},_0xdc64c5,_0x868742[_0x6948('0x43')]);return db[_0x6948('0x2f')][_0x6948('0x4b')](_0xdc64c5)[_0x6948('0x2b')](handleEntityNotFound(_0x14f95b,null))['then'](respondWithResult(_0x14f95b,null))[_0x6948('0x47')](handleError(_0x14f95b,null));};exports[_0x6948('0x4c')]=function(_0x50198b,_0x425b56){return db[_0x6948('0x2f')][_0x6948('0x4c')](_0x50198b[_0x6948('0x4d')],{})[_0x6948('0x2b')](respondWithResult(_0x425b56,0xc9))[_0x6948('0x47')](handleError(_0x425b56,null));};exports['update']=function(_0x52efbc,_0x2b667b){if(_0x52efbc[_0x6948('0x4d')]['id']){delete _0x52efbc[_0x6948('0x4d')]['id'];}return db[_0x6948('0x2f')][_0x6948('0x4b')]({'where':{'id':_0x52efbc['params']['id']}})['then'](handleEntityNotFound(_0x2b667b,null))[_0x6948('0x2b')](saveUpdates(_0x52efbc[_0x6948('0x4d')],null))[_0x6948('0x2b')](respondWithResult(_0x2b667b,null))['catch'](handleError(_0x2b667b,null));};exports['destroy']=function(_0x29adc2,_0xef2660){return db['VoiceQueueReport'][_0x6948('0x4b')]({'where':{'id':_0x29adc2['params']['id']}})[_0x6948('0x2b')](handleEntityNotFound(_0xef2660,null))[_0x6948('0x2b')](removeEntity(_0xef2660,null))[_0x6948('0x47')](handleError(_0xef2660,null));};exports['describe']=function(_0x3f26d4,_0x12712b){return db[_0x6948('0x2f')][_0x6948('0x4e')]()['then'](respondWithResult(_0x12712b,null))[_0x6948('0x47')](handleError(_0x12712b,null));};exports['getVoiceQueuesReport']=function(_0x27fa52,_0x46167e){var _0x10a31c={},_0x5d2112={},_0x4a8854={'count':0x0,'rows':[]};_0x5d2112['model']=_[_0x6948('0x35')](db[_0x6948('0x2f')][_0x6948('0x30')]);_0x5d2112[_0x6948('0x34')]=_[_0x6948('0x35')](_0x27fa52['query']);_0x5d2112[_0x6948('0x36')]=_['intersection'](_0x5d2112[_0x6948('0x38')],_0x5d2112['query']);_0x10a31c['attributes']=_[_0x6948('0x37')](_0x5d2112[_0x6948('0x38')],qs[_0x6948('0x3a')](_0x27fa52[_0x6948('0x34')][_0x6948('0x3a')]));_0x10a31c[_0x6948('0x39')]=_0x10a31c['attributes']['length']?_0x10a31c['attributes']:_0x5d2112[_0x6948('0x38')];if(!_0x27fa52[_0x6948('0x34')]['hasOwnProperty'](_0x6948('0x3c'))){_0x10a31c['limit']=qs[_0x6948('0x23')](_0x27fa52[_0x6948('0x34')]['limit']);_0x10a31c[_0x6948('0x22')]=qs[_0x6948('0x22')](_0x27fa52['query'][_0x6948('0x22')]);}_0x10a31c[_0x6948('0x3d')]=qs[_0x6948('0x3e')](_0x27fa52[_0x6948('0x34')][_0x6948('0x3e')]);_0x10a31c['where']=qs['filters'](_['pick'](_0x27fa52['query'],_0x5d2112[_0x6948('0x36')]));if(_0x27fa52['query']['filter']){_0x10a31c[_0x6948('0x40')]=_['merge'](_0x10a31c['where'],{'$or':_[_0x6948('0x33')](_0x10a31c[_0x6948('0x39')],function(_0xcc0070){var _0x2a6525={};_0x2a6525[_0xcc0070]={'$like':'%'+_0x27fa52['query']['filter']+'%'};return _0x2a6525;})});}_0x10a31c=_[_0x6948('0x41')]({},_0x10a31c,_0x27fa52[_0x6948('0x43')]);var _0x490328={'where':_0x10a31c[_0x6948('0x40')]};return db[_0x6948('0x2f')][_0x6948('0x25')](_0x490328)[_0x6948('0x2b')](function(_0x1bb211){_0x4a8854[_0x6948('0x25')]=_0x1bb211;if(_0x27fa52['query'][_0x6948('0x44')]){_0x10a31c['include']=[{'all':!![]}];}return db[_0x6948('0x2f')][_0x6948('0x46')](_0x10a31c);})['then'](function(_0x515112){_0x4a8854[_0x6948('0x4f')]=_0x515112;return _0x4a8854;})['then'](respondWithFilteredResult(_0x46167e,_0x10a31c,'getVoiceQueuesReport'))[_0x6948('0x47')](handleError(_0x46167e,null,'getVoiceQueuesReport'));}; \ No newline at end of file +var _0xec4c=['end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','VoiceQueueReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','create','body','find','describe','getVoiceQueuesReport','hasOwnProperty','pick','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','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','./voiceQueueReport.socket','sendStatus','status'];(function(_0x58cb77,_0x422878){var _0x5b81d4=function(_0x2a6d99){while(--_0x2a6d99){_0x58cb77['push'](_0x58cb77['shift']());}};_0x5b81d4(++_0x422878);}(_0xec4c,0x1e9));var _0xcec4=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xec4c[_0xf71120];return _0xbe2fd3;};'use strict';var emlformat=require(_0xcec4('0x0'));var rimraf=require(_0xcec4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcec4('0x2'));var rp=require('request-promise');var moment=require(_0xcec4('0x3'));var BPromise=require(_0xcec4('0x4'));var Mustache=require(_0xcec4('0x5'));var util=require(_0xcec4('0x6'));var path=require('path');var sox=require(_0xcec4('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcec4('0x8'));var _=require(_0xcec4('0x9'));var squel=require(_0xcec4('0xa'));var crypto=require(_0xcec4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xcec4('0xc'));var toCsv=require(_0xcec4('0xd'));var querystring=require(_0xcec4('0xe'));var Papa=require(_0xcec4('0xf'));var Redis=require(_0xcec4('0x10'));var authService=require(_0xcec4('0x11'));var qs=require(_0xcec4('0x12'));var as=require(_0xcec4('0x13'));var hardwareService=require(_0xcec4('0x14'));var logger=require(_0xcec4('0x15'))('api');var utils=require(_0xcec4('0x16'));var config=require(_0xcec4('0x17'));var licenseUtil=require(_0xcec4('0x18'));var db=require(_0xcec4('0x19'))['db'];config[_0xcec4('0x1a')]=_[_0xcec4('0x1b')](config[_0xcec4('0x1a')],{'host':_0xcec4('0x1c'),'port':0x18eb});var socket=require(_0xcec4('0x1d'))(new Redis(config[_0xcec4('0x1a')]));require(_0xcec4('0x1e'))['register'](socket);function respondWithStatusCode(_0x13eb1e,_0x56be0d){_0x56be0d=_0x56be0d||0xcc;return function(_0x3ed806){if(_0x3ed806){return _0x13eb1e[_0xcec4('0x1f')](_0x56be0d);}return _0x13eb1e[_0xcec4('0x20')](_0x56be0d)[_0xcec4('0x21')]();};}function respondWithResult(_0x4ba3b4,_0x5d07c6){_0x5d07c6=_0x5d07c6||0xc8;return function(_0x4f4a22){if(_0x4f4a22){return _0x4ba3b4[_0xcec4('0x20')](_0x5d07c6)[_0xcec4('0x22')](_0x4f4a22);}};}function respondWithFilteredResult(_0x3d73f7,_0x57b55c){return function(_0x36a3ec){if(_0x36a3ec){var _0x225196=typeof _0x57b55c[_0xcec4('0x23')]===_0xcec4('0x24')&&typeof _0x57b55c[_0xcec4('0x25')]==='undefined';var _0x43c2db=_0x36a3ec[_0xcec4('0x26')];var _0x1dca94=_0x225196?0x0:_0x57b55c[_0xcec4('0x23')];var _0x441eed=_0x225196?_0x36a3ec[_0xcec4('0x26')]:_0x57b55c[_0xcec4('0x23')]+_0x57b55c[_0xcec4('0x25')];var _0x28b2f7;if(_0x441eed>=_0x43c2db){_0x441eed=_0x43c2db;_0x28b2f7=0xc8;}else{_0x28b2f7=0xce;}_0x3d73f7[_0xcec4('0x20')](_0x28b2f7);return _0x3d73f7[_0xcec4('0x27')](_0xcec4('0x28'),_0x1dca94+'-'+_0x441eed+'/'+_0x43c2db)['json'](_0x36a3ec);}return null;};}function patchUpdates(_0x145bf8){return function(_0xafe775){try{jsonpatch[_0xcec4('0x29')](_0xafe775,_0x145bf8,!![]);}catch(_0x52a46b){return BPromise[_0xcec4('0x2a')](_0x52a46b);}return _0xafe775[_0xcec4('0x2b')]();};}function saveUpdates(_0x1d81c5,_0x155c7c){return function(_0x5329b8){if(_0x5329b8){return _0x5329b8[_0xcec4('0x2c')](_0x1d81c5)['then'](function(_0x1a9a1b){return _0x1a9a1b;});}return null;};}function removeEntity(_0xb566d4,_0x121684){return function(_0x5b212e){if(_0x5b212e){return _0x5b212e[_0xcec4('0x2d')]()[_0xcec4('0x2e')](function(){_0xb566d4[_0xcec4('0x20')](0xcc)[_0xcec4('0x21')]();});}};}function handleEntityNotFound(_0x300f69,_0x23fc74){return function(_0x2806fa){if(!_0x2806fa){_0x300f69[_0xcec4('0x1f')](0x194);}return _0x2806fa;};}function handleError(_0x46c726,_0x5094f1){_0x5094f1=_0x5094f1||0x1f4;return function(_0x4ec6e5){logger[_0xcec4('0x2f')](_0x4ec6e5[_0xcec4('0x30')]);if(_0x4ec6e5[_0xcec4('0x31')]){delete _0x4ec6e5[_0xcec4('0x31')];}_0x46c726[_0xcec4('0x20')](_0x5094f1)[_0xcec4('0x32')](_0x4ec6e5);};}exports[_0xcec4('0x33')]=function(_0x343d97,_0x5211c4){var _0x490510={},_0x5da8d6={},_0x105678={'count':0x0,'rows':[]};var _0x274089=_[_0xcec4('0x34')](db[_0xcec4('0x35')]['rawAttributes'],function(_0x5e832a){return{'name':_0x5e832a[_0xcec4('0x36')],'type':_0x5e832a[_0xcec4('0x37')][_0xcec4('0x38')]};});_0x5da8d6[_0xcec4('0x39')]=_[_0xcec4('0x34')](_0x274089,_0xcec4('0x31'));_0x5da8d6[_0xcec4('0x3a')]=_[_0xcec4('0x3b')](_0x343d97[_0xcec4('0x3a')]);_0x5da8d6[_0xcec4('0x3c')]=_[_0xcec4('0x3d')](_0x5da8d6[_0xcec4('0x39')],_0x5da8d6[_0xcec4('0x3a')]);_0x490510[_0xcec4('0x3e')]=_[_0xcec4('0x3d')](_0x5da8d6[_0xcec4('0x39')],qs[_0xcec4('0x3f')](_0x343d97['query']['fields']));_0x490510['attributes']=_0x490510[_0xcec4('0x3e')][_0xcec4('0x40')]?_0x490510[_0xcec4('0x3e')]:_0x5da8d6['model'];if(!_0x343d97['query']['hasOwnProperty'](_0xcec4('0x41'))){_0x490510[_0xcec4('0x25')]=qs['limit'](_0x343d97[_0xcec4('0x3a')][_0xcec4('0x25')]);_0x490510[_0xcec4('0x23')]=qs[_0xcec4('0x23')](_0x343d97['query'][_0xcec4('0x23')]);}_0x490510[_0xcec4('0x42')]=qs[_0xcec4('0x43')](_0x343d97[_0xcec4('0x3a')][_0xcec4('0x43')]);_0x490510[_0xcec4('0x44')]=qs['filters'](_['pick'](_0x343d97[_0xcec4('0x3a')],_0x5da8d6[_0xcec4('0x3c')]),_0x274089);if(_0x343d97[_0xcec4('0x3a')][_0xcec4('0x45')]){_0x490510[_0xcec4('0x44')]=_[_0xcec4('0x46')](_0x490510[_0xcec4('0x44')],{'$or':_[_0xcec4('0x34')](_0x274089,function(_0x21f692){if(_0x21f692['type']!=='VIRTUAL'){var _0x421095={};_0x421095[_0x21f692['name']]={'$like':'%'+_0x343d97[_0xcec4('0x3a')]['filter']+'%'};return _0x421095;}})});}_0x490510=_[_0xcec4('0x46')]({},_0x490510,_0x343d97[_0xcec4('0x47')]);var _0x2973ce={'where':_0x490510[_0xcec4('0x44')]};return db['VoiceQueueReport'][_0xcec4('0x26')](_0x2973ce)['then'](function(_0x33febb){_0x105678[_0xcec4('0x26')]=_0x33febb;if(_0x343d97[_0xcec4('0x3a')][_0xcec4('0x48')]){_0x490510['include']=[{'all':!![]}];}return db['VoiceQueueReport'][_0xcec4('0x49')](_0x490510);})[_0xcec4('0x2e')](function(_0x2d7b40){_0x105678[_0xcec4('0x4a')]=_0x2d7b40;return _0x105678;})['then'](respondWithFilteredResult(_0x5211c4,_0x490510))[_0xcec4('0x4b')](handleError(_0x5211c4,null));};exports[_0xcec4('0x4c')]=function(_0x34a1f2,_0x5106ff){var _0x489827={'raw':![],'where':{'id':_0x34a1f2[_0xcec4('0x4d')]['id']}},_0x20a56b={};_0x20a56b[_0xcec4('0x39')]=_['keys'](db[_0xcec4('0x35')][_0xcec4('0x4e')]);_0x20a56b['query']=_[_0xcec4('0x3b')](_0x34a1f2[_0xcec4('0x3a')]);_0x20a56b[_0xcec4('0x3c')]=_[_0xcec4('0x3d')](_0x20a56b['model'],_0x20a56b['query']);_0x489827[_0xcec4('0x3e')]=_[_0xcec4('0x3d')](_0x20a56b[_0xcec4('0x39')],qs[_0xcec4('0x3f')](_0x34a1f2[_0xcec4('0x3a')]['fields']));_0x489827[_0xcec4('0x3e')]=_0x489827[_0xcec4('0x3e')][_0xcec4('0x40')]?_0x489827[_0xcec4('0x3e')]:_0x20a56b[_0xcec4('0x39')];if(_0x34a1f2[_0xcec4('0x3a')][_0xcec4('0x48')]){_0x489827[_0xcec4('0x4f')]=[{'all':!![]}];}_0x489827=_[_0xcec4('0x46')]({},_0x489827,_0x34a1f2[_0xcec4('0x47')]);return db[_0xcec4('0x35')]['find'](_0x489827)['then'](handleEntityNotFound(_0x5106ff,null))[_0xcec4('0x2e')](respondWithResult(_0x5106ff,null))[_0xcec4('0x4b')](handleError(_0x5106ff,null));};exports[_0xcec4('0x50')]=function(_0x8ff7,_0x52b9c4){return db['VoiceQueueReport']['create'](_0x8ff7[_0xcec4('0x51')],{})[_0xcec4('0x2e')](respondWithResult(_0x52b9c4,0xc9))['catch'](handleError(_0x52b9c4,null));};exports['update']=function(_0x478b7a,_0x4c746e){if(_0x478b7a[_0xcec4('0x51')]['id']){delete _0x478b7a['body']['id'];}return db[_0xcec4('0x35')][_0xcec4('0x52')]({'where':{'id':_0x478b7a['params']['id']}})[_0xcec4('0x2e')](handleEntityNotFound(_0x4c746e,null))[_0xcec4('0x2e')](saveUpdates(_0x478b7a[_0xcec4('0x51')],null))['then'](respondWithResult(_0x4c746e,null))['catch'](handleError(_0x4c746e,null));};exports[_0xcec4('0x2d')]=function(_0xcf31d4,_0x543779){return db[_0xcec4('0x35')][_0xcec4('0x52')]({'where':{'id':_0xcf31d4[_0xcec4('0x4d')]['id']}})[_0xcec4('0x2e')](handleEntityNotFound(_0x543779,null))[_0xcec4('0x2e')](removeEntity(_0x543779,null))[_0xcec4('0x4b')](handleError(_0x543779,null));};exports[_0xcec4('0x53')]=function(_0x9e2eb1,_0x440212){return db['VoiceQueueReport']['describe']()[_0xcec4('0x2e')](respondWithResult(_0x440212,null))['catch'](handleError(_0x440212,null));};exports[_0xcec4('0x54')]=function(_0x578881,_0x28c32b){var _0x152739={},_0x15cf7d={},_0x49f80b={'count':0x0,'rows':[]};_0x15cf7d[_0xcec4('0x39')]=_[_0xcec4('0x3b')](db[_0xcec4('0x35')][_0xcec4('0x4e')]);_0x15cf7d[_0xcec4('0x3a')]=_[_0xcec4('0x3b')](_0x578881['query']);_0x15cf7d[_0xcec4('0x3c')]=_['intersection'](_0x15cf7d[_0xcec4('0x39')],_0x15cf7d[_0xcec4('0x3a')]);_0x152739['attributes']=_['intersection'](_0x15cf7d['model'],qs[_0xcec4('0x3f')](_0x578881[_0xcec4('0x3a')][_0xcec4('0x3f')]));_0x152739[_0xcec4('0x3e')]=_0x152739[_0xcec4('0x3e')][_0xcec4('0x40')]?_0x152739['attributes']:_0x15cf7d[_0xcec4('0x39')];if(!_0x578881[_0xcec4('0x3a')][_0xcec4('0x55')](_0xcec4('0x41'))){_0x152739[_0xcec4('0x25')]=qs['limit'](_0x578881[_0xcec4('0x3a')][_0xcec4('0x25')]);_0x152739[_0xcec4('0x23')]=qs[_0xcec4('0x23')](_0x578881[_0xcec4('0x3a')]['offset']);}_0x152739[_0xcec4('0x42')]=qs[_0xcec4('0x43')](_0x578881[_0xcec4('0x3a')][_0xcec4('0x43')]);_0x152739[_0xcec4('0x44')]=qs[_0xcec4('0x3c')](_[_0xcec4('0x56')](_0x578881[_0xcec4('0x3a')],_0x15cf7d[_0xcec4('0x3c')]));if(_0x578881[_0xcec4('0x3a')]['filter']){_0x152739[_0xcec4('0x44')]=_['merge'](_0x152739['where'],{'$or':_[_0xcec4('0x34')](_0x152739['attributes'],function(_0x272a9d){var _0x29915c={};_0x29915c[_0x272a9d]={'$like':'%'+_0x578881['query'][_0xcec4('0x45')]+'%'};return _0x29915c;})});}_0x152739=_['merge']({},_0x152739,_0x578881[_0xcec4('0x47')]);var _0x27abc6={'where':_0x152739[_0xcec4('0x44')]};return db['VoiceQueueReport'][_0xcec4('0x26')](_0x27abc6)[_0xcec4('0x2e')](function(_0x3a6e1f){_0x49f80b[_0xcec4('0x26')]=_0x3a6e1f;if(_0x578881[_0xcec4('0x3a')]['includeAll']){_0x152739[_0xcec4('0x4f')]=[{'all':!![]}];}return db[_0xcec4('0x35')][_0xcec4('0x49')](_0x152739);})[_0xcec4('0x2e')](function(_0xa12b26){_0x49f80b[_0xcec4('0x4a')]=_0xa12b26;return _0x49f80b;})[_0xcec4('0x2e')](respondWithFilteredResult(_0x28c32b,_0x152739,_0xcec4('0x54')))[_0xcec4('0x4b')](handleError(_0x28c32b,null,'getVoiceQueuesReport'));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index f835951..02f2653 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 _0x371a=['update','emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x1e762b,_0x222f1a){var _0x113404=function(_0x39bc03){while(--_0x39bc03){_0x1e762b['push'](_0x1e762b['shift']());}};_0x113404(++_0x222f1a);}(_0x371a,0x1f4));var _0xa371=function(_0x3f75bb,_0x2f9cb9){_0x3f75bb=_0x3f75bb-0x0;var _0x3bbcdf=_0x371a[_0x3f75bb];return _0x3bbcdf;};'use strict';var EventEmitter=require(_0xa371('0x0'));var VoiceQueueReport=require(_0xa371('0x1'))['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xa371('0x2')](0x0);var events={'afterCreate':_0xa371('0x3'),'afterUpdate':_0xa371('0x4'),'afterDestroy':'remove'};function emitEvent(_0x56d9b8){return function(_0x5051cc,_0x46d354,_0x2b168a){VoiceQueueReportEvents[_0xa371('0x5')](_0x56d9b8+':'+_0x5051cc['id'],_0x5051cc);VoiceQueueReportEvents[_0xa371('0x5')](_0x56d9b8,_0x5051cc);_0x2b168a(null);};}for(var e in events){if(events[_0xa371('0x6')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0xa371('0x7')]=VoiceQueueReportEvents; \ No newline at end of file +var _0xe693=['setMaxListeners','update','remove','emit','exports','events','../../mysqldb'];(function(_0x2620a8,_0x2f6508){var _0x4de42b=function(_0x1a332c){while(--_0x1a332c){_0x2620a8['push'](_0x2620a8['shift']());}};_0x4de42b(++_0x2f6508);}(_0xe693,0x8a));var _0x3e69=function(_0x148c09,_0x4fd39f){_0x148c09=_0x148c09-0x0;var _0x18e613=_0xe693[_0x148c09];return _0x18e613;};'use strict';var EventEmitter=require(_0x3e69('0x0'));var VoiceQueueReport=require(_0x3e69('0x1'))['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x3e69('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3e69('0x3'),'afterDestroy':_0x3e69('0x4')};function emitEvent(_0x25c577){return function(_0x3c9dc2,_0x33c443,_0x4c562b){VoiceQueueReportEvents[_0x3e69('0x5')](_0x25c577+':'+_0x3c9dc2['id'],_0x3c9dc2);VoiceQueueReportEvents['emit'](_0x25c577,_0x3c9dc2);_0x4c562b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0x3e69('0x6')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 7d517cd..60cd860 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 _0x96a5=['rimraf','../../config/environment','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4bba2a,_0x118cd5){var _0x1feeb0=function(_0x57026b){while(--_0x57026b){_0x4bba2a['push'](_0x4bba2a['shift']());}};_0x1feeb0(++_0x118cd5);}(_0x96a5,0x17f));var _0x596a=function(_0x3642e7,_0x16358e){_0x3642e7=_0x3642e7-0x0;var _0x31e3dd=_0x96a5[_0x3642e7];return _0x31e3dd;};'use strict';var _=require(_0x596a('0x0'));var util=require(_0x596a('0x1'));var logger=require(_0x596a('0x2'))(_0x596a('0x3'));var moment=require(_0x596a('0x4'));var BPromise=require(_0x596a('0x5'));var rp=require(_0x596a('0x6'));var fs=require('fs');var path=require(_0x596a('0x7'));var rimraf=require(_0x596a('0x8'));var config=require(_0x596a('0x9'));var attributes=require(_0x596a('0xa'));module[_0x596a('0xb')]=function(_0x3d7f33,_0x276f2d){return _0x3d7f33[_0x596a('0xc')](_0x596a('0xd'),attributes,{'tableName':_0x596a('0xe'),'paranoid':![],'indexes':[{'fields':[_0x596a('0xf')]},{'fields':[_0x596a('0x10')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5ee6=['../../config/logger','api','bluebird','path','rimraf','../../config/environment','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','uniqueid','calleridnum','lodash','util'];(function(_0x41027a,_0x4cca71){var _0x50e220=function(_0xf24dcc){while(--_0xf24dcc){_0x41027a['push'](_0x41027a['shift']());}};_0x50e220(++_0x4cca71);}(_0x5ee6,0x15c));var _0x65ee=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x5ee6[_0x1d1779];return _0x2377e9;};'use strict';var _=require(_0x65ee('0x0'));var util=require(_0x65ee('0x1'));var logger=require(_0x65ee('0x2'))(_0x65ee('0x3'));var moment=require('moment');var BPromise=require(_0x65ee('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x65ee('0x5'));var rimraf=require(_0x65ee('0x6'));var config=require(_0x65ee('0x7'));var attributes=require(_0x65ee('0x8'));module[_0x65ee('0x9')]=function(_0x4061b6,_0x4449ec){return _0x4061b6[_0x65ee('0xa')](_0x65ee('0xb'),attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':[_0x65ee('0xc')]},{'fields':[_0x65ee('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index f035860..67b8561 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 _0xf37a=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','register','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','options','raw','where','attributes','limit','map','include','model','then','CreateVoiceQueueReport','UpdateVoiceQueueReport','update','body','lodash','util','moment'];(function(_0x4e97b9,_0x42e9fb){var _0x5df7b8=function(_0xaaac2c){while(--_0xaaac2c){_0x4e97b9['push'](_0x4e97b9['shift']());}};_0x5df7b8(++_0x42e9fb);}(_0xf37a,0x16e));var _0xaf37=function(_0x306822,_0x553dea){_0x306822=_0x306822-0x0;var _0x22914a=_0xf37a[_0x306822];return _0x22914a;};'use strict';var _=require(_0xaf37('0x0'));var util=require(_0xaf37('0x1'));var moment=require(_0xaf37('0x2'));var BPromise=require('bluebird');var rs=require(_0xaf37('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaf37('0x4'))['db'];var utils=require(_0xaf37('0x5'));var logger=require(_0xaf37('0x6'))(_0xaf37('0x7'));var config=require(_0xaf37('0x8'));var jayson=require(_0xaf37('0x9'));var client=jayson[_0xaf37('0xa')]['http']({'port':0x232a});config[_0xaf37('0xb')]=_[_0xaf37('0xc')](config[_0xaf37('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xaf37('0xd'))(new Redis(config[_0xaf37('0xb')]));require('./voiceQueueReport.socket')[_0xaf37('0xe')](socket);function respondWithRpcPromise(_0x16954f,_0x1be845,_0x24913b){return new BPromise(function(_0x4b4fa1,_0x240811){return client['request'](_0x16954f,_0x24913b)['then'](function(_0x1ee56a){logger[_0xaf37('0xf')](_0xaf37('0x10'),_0x1be845,_0xaf37('0x11'));logger[_0xaf37('0x12')](_0xaf37('0x13'),_0x1be845,_0xaf37('0x11'),JSON[_0xaf37('0x14')](_0x1ee56a));if(_0x1ee56a['error']){if(_0x1ee56a[_0xaf37('0x15')][_0xaf37('0x16')]===0x1f4){logger['error'](_0xaf37('0x10'),_0x1be845,_0x1ee56a[_0xaf37('0x15')][_0xaf37('0x17')]);return _0x240811(_0x1ee56a['error'][_0xaf37('0x17')]);}logger[_0xaf37('0x15')](_0xaf37('0x10'),_0x1be845,_0x1ee56a['error'][_0xaf37('0x17')]);return _0x4b4fa1(_0x1ee56a['error'][_0xaf37('0x17')]);}else{logger[_0xaf37('0xf')](_0xaf37('0x10'),_0x1be845,'request\x20sent');_0x4b4fa1(_0x1ee56a[_0xaf37('0x18')][_0xaf37('0x17')]);}})[_0xaf37('0x19')](function(_0x363c26){logger[_0xaf37('0x15')](_0xaf37('0x10'),_0x1be845,_0x363c26);_0x240811(_0x363c26);});});}exports[_0xaf37('0x1a')]=function(_0x301750){var _0x364107=this;return new Promise(function(_0x5e71f6,_0x38a6e3){return db[_0xaf37('0x1b')]['findAll']({'raw':_0x301750[_0xaf37('0x1c')]?_0x301750['options'][_0xaf37('0x1d')]===undefined?!![]:![]:!![],'where':_0x301750['options']?_0x301750[_0xaf37('0x1c')][_0xaf37('0x1e')]||null:null,'attributes':_0x301750[_0xaf37('0x1c')]?_0x301750[_0xaf37('0x1c')][_0xaf37('0x1f')]||null:null,'limit':_0x301750['options']?_0x301750['options'][_0xaf37('0x20')]||null:null,'include':_0x301750['options']?_0x301750['options']['include']?_[_0xaf37('0x21')](_0x301750[_0xaf37('0x1c')]['include'],function(_0xde594b){return{'model':db[_0xde594b['model']],'as':_0xde594b['as'],'attributes':_0xde594b[_0xaf37('0x1f')],'include':_0xde594b[_0xaf37('0x22')]?_[_0xaf37('0x21')](_0xde594b['include'],function(_0x57eda4){return{'model':db[_0x57eda4[_0xaf37('0x23')]],'as':_0x57eda4['as'],'attributes':_0x57eda4['attributes'],'include':_0x57eda4[_0xaf37('0x22')]?_[_0xaf37('0x21')](_0x57eda4['include'],function(_0x2b896a){return{'model':db[_0x2b896a[_0xaf37('0x23')]],'as':_0x2b896a['as'],'attributes':_0x2b896a[_0xaf37('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xaf37('0x24')](function(_0x222bcc){logger['info']('GetVoiceQueueReport',_0x301750);logger['debug'](_0xaf37('0x1a'),_0x301750,JSON['stringify'](_0x222bcc));_0x5e71f6(_0x222bcc);})[_0xaf37('0x19')](function(_0x4c6b5a){logger[_0xaf37('0x15')]('GetVoiceQueueReport',_0x4c6b5a['message'],_0x301750);_0x38a6e3(_0x364107['error'](0x1f4,_0x4c6b5a['message']));});});};exports[_0xaf37('0x25')]=function(_0x2d1078){var _0x5a5a7f=this;return new Promise(function(_0x11d591,_0x182be5){return db['VoiceQueueReport']['create'](_0x2d1078['body'],{'raw':_0x2d1078['options']?_0x2d1078[_0xaf37('0x1c')][_0xaf37('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x5a2a4a){logger['info'](_0xaf37('0x25'),_0x2d1078);logger[_0xaf37('0x12')]('CreateVoiceQueueReport',_0x2d1078,JSON['stringify'](_0x5a2a4a));_0x11d591(_0x5a2a4a);})[_0xaf37('0x19')](function(_0x4c7736){logger['error']('CreateVoiceQueueReport',_0x4c7736[_0xaf37('0x17')],_0x2d1078);_0x182be5(_0x5a5a7f[_0xaf37('0x15')](0x1f4,_0x4c7736[_0xaf37('0x17')]));});});};exports[_0xaf37('0x26')]=function(_0x101136){var _0x18e1f4=this;return new Promise(function(_0x2f986f,_0x1dc921){return db['VoiceQueueReport'][_0xaf37('0x27')](_0x101136[_0xaf37('0x28')],{'raw':_0x101136[_0xaf37('0x1c')]?_0x101136['options'][_0xaf37('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x101136[_0xaf37('0x1c')]?_0x101136['options']['where']||null:null,'attributes':_0x101136['options']?_0x101136['options'][_0xaf37('0x1f')]||null:null,'limit':_0x101136[_0xaf37('0x1c')]?_0x101136[_0xaf37('0x1c')][_0xaf37('0x20')]||null:null})[_0xaf37('0x24')](function(_0x506506){logger[_0xaf37('0xf')](_0xaf37('0x26'),_0x101136);logger[_0xaf37('0x12')](_0xaf37('0x26'),_0x101136,JSON[_0xaf37('0x14')](_0x506506));_0x2f986f(_0x506506);})[_0xaf37('0x19')](function(_0x1b1c9d){logger[_0xaf37('0x15')]('UpdateVoiceQueueReport',_0x1b1c9d['message'],_0x101136);_0x1dc921(_0x18e1f4[_0xaf37('0x15')](0x1f4,_0x1b1c9d[_0xaf37('0x17')]));});});}; \ No newline at end of file +var _0xfcd0=['request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetVoiceQueueReport','VoiceQueueReport','options','where','attributes','limit','map','model','include','CreateVoiceQueueReport','create','body','raw','UpdateVoiceQueueReport','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s'];(function(_0x18974e,_0x2740a2){var _0x24cd23=function(_0x1e8707){while(--_0x1e8707){_0x18974e['push'](_0x18974e['shift']());}};_0x24cd23(++_0x2740a2);}(_0xfcd0,0x94));var _0x0fcd=function(_0x1235ad,_0x605b5c){_0x1235ad=_0x1235ad-0x0;var _0x726439=_0xfcd0[_0x1235ad];return _0x726439;};'use strict';var _=require('lodash');var util=require(_0x0fcd('0x0'));var moment=require(_0x0fcd('0x1'));var BPromise=require(_0x0fcd('0x2'));var rs=require(_0x0fcd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0fcd('0x4'))['db'];var utils=require(_0x0fcd('0x5'));var logger=require('../../config/logger')(_0x0fcd('0x6'));var config=require(_0x0fcd('0x7'));var jayson=require(_0x0fcd('0x8'));var client=jayson['client'][_0x0fcd('0x9')]({'port':0x232a});config[_0x0fcd('0xa')]=_[_0x0fcd('0xb')](config[_0x0fcd('0xa')],{'host':_0x0fcd('0xc'),'port':0x18eb});var socket=require(_0x0fcd('0xd'))(new Redis(config[_0x0fcd('0xa')]));require(_0x0fcd('0xe'))[_0x0fcd('0xf')](socket);function respondWithRpcPromise(_0x323d69,_0x1a16e3,_0x5c2def){return new BPromise(function(_0x357357,_0x4a913e){return client[_0x0fcd('0x10')](_0x323d69,_0x5c2def)[_0x0fcd('0x11')](function(_0x50f59c){logger[_0x0fcd('0x12')](_0x0fcd('0x13'),_0x1a16e3,_0x0fcd('0x14'));logger[_0x0fcd('0x15')](_0x0fcd('0x16'),_0x1a16e3,_0x0fcd('0x14'),JSON[_0x0fcd('0x17')](_0x50f59c));if(_0x50f59c[_0x0fcd('0x18')]){if(_0x50f59c[_0x0fcd('0x18')][_0x0fcd('0x19')]===0x1f4){logger[_0x0fcd('0x18')](_0x0fcd('0x13'),_0x1a16e3,_0x50f59c[_0x0fcd('0x18')][_0x0fcd('0x1a')]);return _0x4a913e(_0x50f59c[_0x0fcd('0x18')][_0x0fcd('0x1a')]);}logger[_0x0fcd('0x18')](_0x0fcd('0x13'),_0x1a16e3,_0x50f59c[_0x0fcd('0x18')][_0x0fcd('0x1a')]);return _0x357357(_0x50f59c[_0x0fcd('0x18')][_0x0fcd('0x1a')]);}else{logger['info'](_0x0fcd('0x13'),_0x1a16e3,'request\x20sent');_0x357357(_0x50f59c['result'][_0x0fcd('0x1a')]);}})[_0x0fcd('0x1b')](function(_0x58d9ff){logger[_0x0fcd('0x18')](_0x0fcd('0x13'),_0x1a16e3,_0x58d9ff);_0x4a913e(_0x58d9ff);});});}exports[_0x0fcd('0x1c')]=function(_0x3a5ede){var _0x26c82a=this;return new Promise(function(_0x550859,_0x1a8262){return db[_0x0fcd('0x1d')]['findAll']({'raw':_0x3a5ede[_0x0fcd('0x1e')]?_0x3a5ede[_0x0fcd('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x3a5ede[_0x0fcd('0x1e')]?_0x3a5ede[_0x0fcd('0x1e')][_0x0fcd('0x1f')]||null:null,'attributes':_0x3a5ede['options']?_0x3a5ede['options'][_0x0fcd('0x20')]||null:null,'limit':_0x3a5ede['options']?_0x3a5ede[_0x0fcd('0x1e')][_0x0fcd('0x21')]||null:null,'include':_0x3a5ede[_0x0fcd('0x1e')]?_0x3a5ede['options']['include']?_[_0x0fcd('0x22')](_0x3a5ede[_0x0fcd('0x1e')]['include'],function(_0x347f1c){return{'model':db[_0x347f1c[_0x0fcd('0x23')]],'as':_0x347f1c['as'],'attributes':_0x347f1c[_0x0fcd('0x20')],'include':_0x347f1c['include']?_[_0x0fcd('0x22')](_0x347f1c[_0x0fcd('0x24')],function(_0x1f3f28){return{'model':db[_0x1f3f28[_0x0fcd('0x23')]],'as':_0x1f3f28['as'],'attributes':_0x1f3f28[_0x0fcd('0x20')],'include':_0x1f3f28['include']?_[_0x0fcd('0x22')](_0x1f3f28[_0x0fcd('0x24')],function(_0x225c3c){return{'model':db[_0x225c3c[_0x0fcd('0x23')]],'as':_0x225c3c['as'],'attributes':_0x225c3c[_0x0fcd('0x20')]};}):[]};}):[]};}):[]:[]})[_0x0fcd('0x11')](function(_0x4e2b05){logger[_0x0fcd('0x12')]('GetVoiceQueueReport',_0x3a5ede);logger[_0x0fcd('0x15')]('GetVoiceQueueReport',_0x3a5ede,JSON[_0x0fcd('0x17')](_0x4e2b05));_0x550859(_0x4e2b05);})[_0x0fcd('0x1b')](function(_0x2a9aa4){logger['error'](_0x0fcd('0x1c'),_0x2a9aa4[_0x0fcd('0x1a')],_0x3a5ede);_0x1a8262(_0x26c82a[_0x0fcd('0x18')](0x1f4,_0x2a9aa4['message']));});});};exports[_0x0fcd('0x25')]=function(_0x20f66c){var _0x15522c=this;return new Promise(function(_0x375ec5,_0x6f220f){return db[_0x0fcd('0x1d')][_0x0fcd('0x26')](_0x20f66c[_0x0fcd('0x27')],{'raw':_0x20f66c[_0x0fcd('0x1e')]?_0x20f66c[_0x0fcd('0x1e')]['raw']===undefined?!![]:![]:!![]})[_0x0fcd('0x11')](function(_0x298682){logger['info'](_0x0fcd('0x25'),_0x20f66c);logger['debug'](_0x0fcd('0x25'),_0x20f66c,JSON['stringify'](_0x298682));_0x375ec5(_0x298682);})[_0x0fcd('0x1b')](function(_0x38dc40){logger['error'](_0x0fcd('0x25'),_0x38dc40['message'],_0x20f66c);_0x6f220f(_0x15522c['error'](0x1f4,_0x38dc40[_0x0fcd('0x1a')]));});});};exports['UpdateVoiceQueueReport']=function(_0x54d3f1){var _0x2d6e0c=this;return new Promise(function(_0x30159d,_0x1666ef){return db[_0x0fcd('0x1d')]['update'](_0x54d3f1[_0x0fcd('0x27')],{'raw':_0x54d3f1[_0x0fcd('0x1e')]?_0x54d3f1[_0x0fcd('0x1e')][_0x0fcd('0x28')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x54d3f1[_0x0fcd('0x1e')]?_0x54d3f1[_0x0fcd('0x1e')][_0x0fcd('0x1f')]||null:null,'attributes':_0x54d3f1[_0x0fcd('0x1e')]?_0x54d3f1[_0x0fcd('0x1e')][_0x0fcd('0x20')]||null:null,'limit':_0x54d3f1[_0x0fcd('0x1e')]?_0x54d3f1['options']['limit']||null:null})[_0x0fcd('0x11')](function(_0x562b09){logger['info']('UpdateVoiceQueueReport',_0x54d3f1);logger[_0x0fcd('0x15')](_0x0fcd('0x29'),_0x54d3f1,JSON[_0x0fcd('0x17')](_0x562b09));_0x30159d(_0x562b09);})[_0x0fcd('0x1b')](function(_0x5a8041){logger[_0x0fcd('0x18')](_0x0fcd('0x29'),_0x5a8041['message'],_0x54d3f1);_0x1666ef(_0x2d6e0c[_0x0fcd('0x18')](0x1f4,_0x5a8041['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 7622248..0e3d72d 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 _0x3204=['remove','update','emit','register','length','voiceQueueReport:','./voiceQueueReport.events','save'];(function(_0x5213d3,_0x457833){var _0x3eb033=function(_0x32b684){while(--_0x32b684){_0x5213d3['push'](_0x5213d3['shift']());}};_0x3eb033(++_0x457833);}(_0x3204,0x12e));var _0x4320=function(_0x5c2a2b,_0x13630c){_0x5c2a2b=_0x5c2a2b-0x0;var _0xf029c=_0x3204[_0x5c2a2b];return _0xf029c;};'use strict';var VoiceQueueReportEvents=require(_0x4320('0x0'));var events=[_0x4320('0x1'),_0x4320('0x2'),_0x4320('0x3')];function createListener(_0xd35512,_0x127479){return function(_0x345d92){_0x127479[_0x4320('0x4')](_0xd35512,_0x345d92);};}function removeListener(_0x71f580,_0x5c51e0){return function(){VoiceQueueReportEvents['removeListener'](_0x71f580,_0x5c51e0);};}exports[_0x4320('0x5')]=function(_0x7ce01d){for(var _0xbda169=0x0,_0xc55c94=events[_0x4320('0x6')];_0xbda169<_0xc55c94;_0xbda169++){var _0x36ea0f=events[_0xbda169];var _0xe2dbaf=createListener(_0x4320('0x7')+_0x36ea0f,_0x7ce01d);VoiceQueueReportEvents['on'](_0x36ea0f,_0xe2dbaf);}}; \ No newline at end of file +var _0xae1c=['removeListener','register','length','emit'];(function(_0x5ddeb8,_0x2c4cc4){var _0x412015=function(_0x58d289){while(--_0x58d289){_0x5ddeb8['push'](_0x5ddeb8['shift']());}};_0x412015(++_0x2c4cc4);}(_0xae1c,0xff));var _0xcae1=function(_0x1be4ac,_0x2b5536){_0x1be4ac=_0x1be4ac-0x0;var _0xa42e9b=_0xae1c[_0x1be4ac];return _0xa42e9b;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=['save','remove','update'];function createListener(_0x1ab262,_0x19e218){return function(_0x3e2e25){_0x19e218[_0xcae1('0x0')](_0x1ab262,_0x3e2e25);};}function removeListener(_0x1d37db,_0x2b6b57){return function(){VoiceQueueReportEvents[_0xcae1('0x1')](_0x1d37db,_0x2b6b57);};}exports[_0xcae1('0x2')]=function(_0x3513e5){for(var _0x40fcec=0x0,_0x3c35c7=events[_0xcae1('0x3')];_0x40fcec<_0x3c35c7;_0x40fcec++){var _0x7a27b8=events[_0x40fcec];var _0x50d451=createListener('voiceQueueReport:'+_0x7a27b8,_0x3513e5);VoiceQueueReportEvents['on'](_0x7a27b8,_0x50d451);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 035f1db..cd250df 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 _0x73b6=['show','post','create','update','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id'];(function(_0x179bf4,_0x2c4097){var _0x4331cc=function(_0x18a946){while(--_0x18a946){_0x179bf4['push'](_0x179bf4['shift']());}};_0x4331cc(++_0x2c4097);}(_0x73b6,0xe6));var _0x673b=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x73b6[_0x433a86];return _0x23000c;};'use strict';var multer=require('multer');var util=require(_0x673b('0x0'));var path=require(_0x673b('0x1'));var timeout=require(_0x673b('0x2'));var express=require(_0x673b('0x3'));var router=express[_0x673b('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x673b('0x5'));var config=require(_0x673b('0x6'));var controller=require('./voiceQueuesLog.controller');router[_0x673b('0x7')]('/',auth[_0x673b('0x8')](),controller['index']);router[_0x673b('0x7')](_0x673b('0x9'),auth[_0x673b('0x8')](),controller[_0x673b('0xa')]);router[_0x673b('0xb')]('/',auth['isAuthenticated'](),controller[_0x673b('0xc')]);router['put']('/:id',auth[_0x673b('0x8')](),controller[_0x673b('0xd')]);router['delete'](_0x673b('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x673b('0xe')]=router; \ No newline at end of file +var _0x4d53=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','isAuthenticated','index','get','show','post','create','put','/:id','update','delete','destroy','exports','util'];(function(_0x2f7172,_0x3b36a0){var _0x31eaaa=function(_0x2b8fd9){while(--_0x2b8fd9){_0x2f7172['push'](_0x2f7172['shift']());}};_0x31eaaa(++_0x3b36a0);}(_0x4d53,0x1e3));var _0x34d5=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x4d53[_0x5783f4];return _0x28e380;};'use strict';var multer=require('multer');var util=require(_0x34d5('0x0'));var path=require(_0x34d5('0x1'));var timeout=require(_0x34d5('0x2'));var express=require(_0x34d5('0x3'));var router=express[_0x34d5('0x4')]();var fs_extra=require(_0x34d5('0x5'));var auth=require(_0x34d5('0x6'));var interaction=require(_0x34d5('0x7'));var config=require(_0x34d5('0x8'));var controller=require(_0x34d5('0x9'));router['get']('/',auth[_0x34d5('0xa')](),controller[_0x34d5('0xb')]);router[_0x34d5('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x34d5('0xd')]);router[_0x34d5('0xe')]('/',auth[_0x34d5('0xa')](),controller[_0x34d5('0xf')]);router[_0x34d5('0x10')](_0x34d5('0x11'),auth['isAuthenticated'](),controller[_0x34d5('0x12')]);router[_0x34d5('0x13')](_0x34d5('0x11'),auth[_0x34d5('0xa')](),controller[_0x34d5('0x14')]);module[_0x34d5('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 14f2ce1..fda725e 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 _0x8bcc=['STRING','DATE','moment','exports'];(function(_0x1a6acb,_0xa7099e){var _0x279242=function(_0x1aca76){while(--_0x1aca76){_0x1a6acb['push'](_0x1a6acb['shift']());}};_0x279242(++_0xa7099e);}(_0x8bcc,0x82));var _0xc8bc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8bcc[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xc8bc('0x0'));module[_0xc8bc('0x1')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0xc8bc('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xc8bc('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xc8bc('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xc8bc('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xc8bc('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xc8bc('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xc8bc('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xc8bc('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xc8bc('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xc8bc('0x3')],'allowNull':![],'defaultValue':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}}; \ No newline at end of file +var _0x869c=['moment','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x869c,0x1bb));var _0xc869=function(_0x525b2f,_0x54ef4e){_0x525b2f=_0x525b2f-0x0;var _0x234cec=_0x869c[_0x525b2f];return _0x234cec;};'use strict';var Sequelize=require(_0xc869('0x0'));var moment=require(_0xc869('0x1'));module['exports']={'time':{'type':Sequelize[_0xc869('0x2')]},'callid':{'type':Sequelize[_0xc869('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xc869('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xc869('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xc869('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xc869('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xc869('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xc869('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xc869('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xc869('0x3')],'allowNull':![],'defaultValue':moment()[_0xc869('0x4')](_0xc869('0x5'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 0dd7b7c..60cdd07 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 _0x3256=['filter','include','findAll','rows','catch','show','params','includeAll','merge','options','find','create','body','eml-format','rimraf','zip-dir','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','update','then','destroy','error','stack','name','send','index','VoiceQueuesLog','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x112cb1,_0x466498){var _0x48a632=function(_0x21dcc8){while(--_0x21dcc8){_0x112cb1['push'](_0x112cb1['shift']());}};_0x48a632(++_0x466498);}(_0x3256,0x166));var _0x6325=function(_0x222309,_0xdf2424){_0x222309=_0x222309-0x0;var _0x63f445=_0x3256[_0x222309];return _0x63f445;};'use strict';var emlformat=require(_0x6325('0x0'));var rimraf=require(_0x6325('0x1'));var zipdir=require(_0x6325('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6325('0x3'));var BPromise=require(_0x6325('0x4'));var Mustache=require(_0x6325('0x5'));var util=require('util');var path=require('path');var sox=require(_0x6325('0x6'));var csv=require(_0x6325('0x7'));var ejs=require(_0x6325('0x8'));var fs=require('fs');var fs_extra=require(_0x6325('0x9'));var _=require(_0x6325('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6325('0xb'));var deskjs=require(_0x6325('0xc'));var toCsv=require(_0x6325('0x7'));var querystring=require(_0x6325('0xd'));var Papa=require('papaparse');var Redis=require(_0x6325('0xe'));var authService=require(_0x6325('0xf'));var qs=require(_0x6325('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6325('0x11'));var logger=require(_0x6325('0x12'))(_0x6325('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4f4763,_0x3bd49d){_0x3bd49d=_0x3bd49d||0xcc;return function(_0x40f9ec){if(_0x40f9ec){return _0x4f4763[_0x6325('0x14')](_0x3bd49d);}return _0x4f4763[_0x6325('0x15')](_0x3bd49d)[_0x6325('0x16')]();};}function respondWithResult(_0x1e7583,_0x4fda99){_0x4fda99=_0x4fda99||0xc8;return function(_0x429596){if(_0x429596){return _0x1e7583['status'](_0x4fda99)[_0x6325('0x17')](_0x429596);}};}function respondWithFilteredResult(_0x2062e4,_0x2314ee){return function(_0x5a2bdd){if(_0x5a2bdd){var _0xbfa0dd=typeof _0x2314ee[_0x6325('0x18')]===_0x6325('0x19')&&typeof _0x2314ee['limit']===_0x6325('0x19');var _0x15a7ad=_0x5a2bdd[_0x6325('0x1a')];var _0x445f39=_0xbfa0dd?0x0:_0x2314ee[_0x6325('0x18')];var _0x3cfd74=_0xbfa0dd?_0x5a2bdd[_0x6325('0x1a')]:_0x2314ee['offset']+_0x2314ee[_0x6325('0x1b')];var _0x5dec1d;if(_0x3cfd74>=_0x15a7ad){_0x3cfd74=_0x15a7ad;_0x5dec1d=0xc8;}else{_0x5dec1d=0xce;}_0x2062e4[_0x6325('0x15')](_0x5dec1d);return _0x2062e4['set'](_0x6325('0x1c'),_0x445f39+'-'+_0x3cfd74+'/'+_0x15a7ad)[_0x6325('0x17')](_0x5a2bdd);}return null;};}function patchUpdates(_0x1c03c2){return function(_0x3c5898){try{jsonpatch[_0x6325('0x1d')](_0x3c5898,_0x1c03c2,!![]);}catch(_0x572478){return BPromise['reject'](_0x572478);}return _0x3c5898['save']();};}function saveUpdates(_0x17c47c,_0x1a0b3a){return function(_0x1c5b2a){if(_0x1c5b2a){return _0x1c5b2a[_0x6325('0x1e')](_0x17c47c)[_0x6325('0x1f')](function(_0x315ab8){return _0x315ab8;});}return null;};}function removeEntity(_0x46697a,_0x13efa8){return function(_0x38c8b5){if(_0x38c8b5){return _0x38c8b5[_0x6325('0x20')]()[_0x6325('0x1f')](function(){_0x46697a['status'](0xcc)[_0x6325('0x16')]();});}};}function handleEntityNotFound(_0x2a3e26,_0x3ec106){return function(_0x47c1bc){if(!_0x47c1bc){_0x2a3e26[_0x6325('0x14')](0x194);}return _0x47c1bc;};}function handleError(_0x96cfb8,_0x1512e1){_0x1512e1=_0x1512e1||0x1f4;return function(_0x2aa974){logger[_0x6325('0x21')](_0x2aa974[_0x6325('0x22')]);if(_0x2aa974[_0x6325('0x23')]){delete _0x2aa974['name'];}_0x96cfb8[_0x6325('0x15')](_0x1512e1)[_0x6325('0x24')](_0x2aa974);};}exports[_0x6325('0x25')]=function(_0x48f0fe,_0x2335da){var _0x36c180={},_0x458115={},_0x4186a={'count':0x0,'rows':[]};var _0x5b3423=_['map'](db[_0x6325('0x26')][_0x6325('0x27')],function(_0x471ecf){return{'name':_0x471ecf[_0x6325('0x28')],'type':_0x471ecf[_0x6325('0x29')][_0x6325('0x2a')]};});_0x458115[_0x6325('0x2b')]=_['map'](_0x5b3423,'name');_0x458115['query']=_[_0x6325('0x2c')](_0x48f0fe[_0x6325('0x2d')]);_0x458115[_0x6325('0x2e')]=_['intersection'](_0x458115[_0x6325('0x2b')],_0x458115[_0x6325('0x2d')]);_0x36c180[_0x6325('0x2f')]=_[_0x6325('0x30')](_0x458115[_0x6325('0x2b')],qs['fields'](_0x48f0fe['query'][_0x6325('0x31')]));_0x36c180[_0x6325('0x2f')]=_0x36c180[_0x6325('0x2f')][_0x6325('0x32')]?_0x36c180[_0x6325('0x2f')]:_0x458115[_0x6325('0x2b')];if(!_0x48f0fe[_0x6325('0x2d')][_0x6325('0x33')](_0x6325('0x34'))){_0x36c180[_0x6325('0x1b')]=qs[_0x6325('0x1b')](_0x48f0fe['query'][_0x6325('0x1b')]);_0x36c180[_0x6325('0x18')]=qs[_0x6325('0x18')](_0x48f0fe[_0x6325('0x2d')][_0x6325('0x18')]);}_0x36c180[_0x6325('0x35')]=qs[_0x6325('0x36')](_0x48f0fe['query'][_0x6325('0x36')]);_0x36c180[_0x6325('0x37')]=qs[_0x6325('0x2e')](_['pick'](_0x48f0fe[_0x6325('0x2d')],_0x458115[_0x6325('0x2e')]),_0x5b3423);if(_0x48f0fe[_0x6325('0x2d')][_0x6325('0x38')]){_0x36c180[_0x6325('0x37')]=_['merge'](_0x36c180[_0x6325('0x37')],{'$or':_['map'](_0x5b3423,function(_0x28a5fc){if(_0x28a5fc[_0x6325('0x29')]!=='VIRTUAL'){var _0x2cc45f={};_0x2cc45f[_0x28a5fc[_0x6325('0x23')]]={'$like':'%'+_0x48f0fe[_0x6325('0x2d')][_0x6325('0x38')]+'%'};return _0x2cc45f;}})});}_0x36c180=_['merge']({},_0x36c180,_0x48f0fe['options']);var _0x128c92={'where':_0x36c180[_0x6325('0x37')]};return db[_0x6325('0x26')][_0x6325('0x1a')](_0x128c92)[_0x6325('0x1f')](function(_0x484c40){_0x4186a[_0x6325('0x1a')]=_0x484c40;if(_0x48f0fe[_0x6325('0x2d')]['includeAll']){_0x36c180[_0x6325('0x39')]=[{'all':!![]}];}return db[_0x6325('0x26')][_0x6325('0x3a')](_0x36c180);})[_0x6325('0x1f')](function(_0x4fc48f){_0x4186a[_0x6325('0x3b')]=_0x4fc48f;return _0x4186a;})['then'](respondWithFilteredResult(_0x2335da,_0x36c180))[_0x6325('0x3c')](handleError(_0x2335da,null));};exports[_0x6325('0x3d')]=function(_0x519466,_0x4fb230){var _0x5d9039={'raw':!![],'where':{'id':_0x519466[_0x6325('0x3e')]['id']}},_0x23b9d1={};_0x23b9d1[_0x6325('0x2b')]=_[_0x6325('0x2c')](db[_0x6325('0x26')][_0x6325('0x27')]);_0x23b9d1[_0x6325('0x2d')]=_[_0x6325('0x2c')](_0x519466['query']);_0x23b9d1[_0x6325('0x2e')]=_[_0x6325('0x30')](_0x23b9d1[_0x6325('0x2b')],_0x23b9d1[_0x6325('0x2d')]);_0x5d9039['attributes']=_['intersection'](_0x23b9d1[_0x6325('0x2b')],qs[_0x6325('0x31')](_0x519466[_0x6325('0x2d')][_0x6325('0x31')]));_0x5d9039['attributes']=_0x5d9039['attributes'][_0x6325('0x32')]?_0x5d9039[_0x6325('0x2f')]:_0x23b9d1[_0x6325('0x2b')];if(_0x519466[_0x6325('0x2d')][_0x6325('0x3f')]){_0x5d9039['include']=[{'all':!![]}];}_0x5d9039=_[_0x6325('0x40')]({},_0x5d9039,_0x519466[_0x6325('0x41')]);return db[_0x6325('0x26')][_0x6325('0x42')](_0x5d9039)[_0x6325('0x1f')](handleEntityNotFound(_0x4fb230,null))[_0x6325('0x1f')](respondWithResult(_0x4fb230,null))[_0x6325('0x3c')](handleError(_0x4fb230,null));};exports[_0x6325('0x43')]=function(_0xbf9fda,_0x2308e4){return db[_0x6325('0x26')][_0x6325('0x43')](_0xbf9fda[_0x6325('0x44')],{})[_0x6325('0x1f')](respondWithResult(_0x2308e4,0xc9))[_0x6325('0x3c')](handleError(_0x2308e4,null));};exports['update']=function(_0x48792f,_0x415cac){if(_0x48792f['body']['id']){delete _0x48792f[_0x6325('0x44')]['id'];}return db[_0x6325('0x26')]['find']({'where':{'id':_0x48792f[_0x6325('0x3e')]['id']}})[_0x6325('0x1f')](handleEntityNotFound(_0x415cac,null))[_0x6325('0x1f')](saveUpdates(_0x48792f[_0x6325('0x44')],null))['then'](respondWithResult(_0x415cac,null))['catch'](handleError(_0x415cac,null));};exports[_0x6325('0x20')]=function(_0x12f8f2,_0x269ae0){return db[_0x6325('0x26')][_0x6325('0x42')]({'where':{'id':_0x12f8f2['params']['id']}})[_0x6325('0x1f')](handleEntityNotFound(_0x269ae0,null))[_0x6325('0x1f')](removeEntity(_0x269ae0,null))[_0x6325('0x3c')](handleError(_0x269ae0,null));}; \ No newline at end of file +var _0xdb3b=['create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','stack','name','send','map','VoiceQueuesLog','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdb3b,0xe4));var _0xbdb3=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xdb3b[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xbdb3('0x0'));var rimraf=require(_0xbdb3('0x1'));var zipdir=require(_0xbdb3('0x2'));var jsonpatch=require(_0xbdb3('0x3'));var rp=require(_0xbdb3('0x4'));var moment=require('moment');var BPromise=require(_0xbdb3('0x5'));var Mustache=require(_0xbdb3('0x6'));var util=require('util');var path=require(_0xbdb3('0x7'));var sox=require(_0xbdb3('0x8'));var csv=require(_0xbdb3('0x9'));var ejs=require(_0xbdb3('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbdb3('0xb'));var squel=require(_0xbdb3('0xc'));var crypto=require(_0xbdb3('0xd'));var jsforce=require(_0xbdb3('0xe'));var deskjs=require(_0xbdb3('0xf'));var toCsv=require(_0xbdb3('0x9'));var querystring=require(_0xbdb3('0x10'));var Papa=require('papaparse');var Redis=require(_0xbdb3('0x11'));var authService=require(_0xbdb3('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xbdb3('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xbdb3('0x14'));var utils=require(_0xbdb3('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xbdb3('0x16'));var db=require(_0xbdb3('0x17'))['db'];function respondWithStatusCode(_0x430f04,_0x4ad637){_0x4ad637=_0x4ad637||0xcc;return function(_0x2c9ed1){if(_0x2c9ed1){return _0x430f04[_0xbdb3('0x18')](_0x4ad637);}return _0x430f04[_0xbdb3('0x19')](_0x4ad637)[_0xbdb3('0x1a')]();};}function respondWithResult(_0x569d66,_0x27e85f){_0x27e85f=_0x27e85f||0xc8;return function(_0x2a1233){if(_0x2a1233){return _0x569d66[_0xbdb3('0x19')](_0x27e85f)['json'](_0x2a1233);}};}function respondWithFilteredResult(_0x248c39,_0x11cabc){return function(_0xee80ae){if(_0xee80ae){var _0x583606=typeof _0x11cabc[_0xbdb3('0x1b')]===_0xbdb3('0x1c')&&typeof _0x11cabc[_0xbdb3('0x1d')]==='undefined';var _0x2919b2=_0xee80ae['count'];var _0x1bdaed=_0x583606?0x0:_0x11cabc[_0xbdb3('0x1b')];var _0x1df770=_0x583606?_0xee80ae[_0xbdb3('0x1e')]:_0x11cabc[_0xbdb3('0x1b')]+_0x11cabc[_0xbdb3('0x1d')];var _0x28502b;if(_0x1df770>=_0x2919b2){_0x1df770=_0x2919b2;_0x28502b=0xc8;}else{_0x28502b=0xce;}_0x248c39[_0xbdb3('0x19')](_0x28502b);return _0x248c39[_0xbdb3('0x1f')](_0xbdb3('0x20'),_0x1bdaed+'-'+_0x1df770+'/'+_0x2919b2)[_0xbdb3('0x21')](_0xee80ae);}return null;};}function patchUpdates(_0x31a9a9){return function(_0x2adee7){try{jsonpatch[_0xbdb3('0x22')](_0x2adee7,_0x31a9a9,!![]);}catch(_0x2210ac){return BPromise[_0xbdb3('0x23')](_0x2210ac);}return _0x2adee7['save']();};}function saveUpdates(_0x22ac2a,_0x481bd5){return function(_0x47480e){if(_0x47480e){return _0x47480e[_0xbdb3('0x24')](_0x22ac2a)[_0xbdb3('0x25')](function(_0x41c533){return _0x41c533;});}return null;};}function removeEntity(_0x4b09e4,_0x4b116c){return function(_0x1d8537){if(_0x1d8537){return _0x1d8537['destroy']()[_0xbdb3('0x25')](function(){_0x4b09e4[_0xbdb3('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b7b60,_0x5e2827){return function(_0x4c4ca2){if(!_0x4c4ca2){_0x2b7b60['sendStatus'](0x194);}return _0x4c4ca2;};}function handleError(_0x5c7ad8,_0x59841b){_0x59841b=_0x59841b||0x1f4;return function(_0x11c70c){logger['error'](_0x11c70c[_0xbdb3('0x26')]);if(_0x11c70c[_0xbdb3('0x27')]){delete _0x11c70c[_0xbdb3('0x27')];}_0x5c7ad8[_0xbdb3('0x19')](_0x59841b)[_0xbdb3('0x28')](_0x11c70c);};}exports['index']=function(_0x478882,_0x3ab60c){var _0xda12a5={},_0x53897e={},_0x12c1ec={'count':0x0,'rows':[]};var _0x40b66e=_[_0xbdb3('0x29')](db[_0xbdb3('0x2a')][_0xbdb3('0x2b')],function(_0x5f3272){return{'name':_0x5f3272[_0xbdb3('0x2c')],'type':_0x5f3272[_0xbdb3('0x2d')][_0xbdb3('0x2e')]};});_0x53897e[_0xbdb3('0x2f')]=_[_0xbdb3('0x29')](_0x40b66e,_0xbdb3('0x27'));_0x53897e[_0xbdb3('0x30')]=_[_0xbdb3('0x31')](_0x478882[_0xbdb3('0x30')]);_0x53897e[_0xbdb3('0x32')]=_[_0xbdb3('0x33')](_0x53897e['model'],_0x53897e[_0xbdb3('0x30')]);_0xda12a5['attributes']=_[_0xbdb3('0x33')](_0x53897e[_0xbdb3('0x2f')],qs[_0xbdb3('0x34')](_0x478882['query'][_0xbdb3('0x34')]));_0xda12a5[_0xbdb3('0x35')]=_0xda12a5[_0xbdb3('0x35')][_0xbdb3('0x36')]?_0xda12a5[_0xbdb3('0x35')]:_0x53897e[_0xbdb3('0x2f')];if(!_0x478882[_0xbdb3('0x30')][_0xbdb3('0x37')](_0xbdb3('0x38'))){_0xda12a5[_0xbdb3('0x1d')]=qs[_0xbdb3('0x1d')](_0x478882[_0xbdb3('0x30')][_0xbdb3('0x1d')]);_0xda12a5[_0xbdb3('0x1b')]=qs[_0xbdb3('0x1b')](_0x478882[_0xbdb3('0x30')][_0xbdb3('0x1b')]);}_0xda12a5['order']=qs[_0xbdb3('0x39')](_0x478882[_0xbdb3('0x30')]['sort']);_0xda12a5[_0xbdb3('0x3a')]=qs[_0xbdb3('0x32')](_[_0xbdb3('0x3b')](_0x478882[_0xbdb3('0x30')],_0x53897e[_0xbdb3('0x32')]),_0x40b66e);if(_0x478882[_0xbdb3('0x30')][_0xbdb3('0x3c')]){_0xda12a5[_0xbdb3('0x3a')]=_[_0xbdb3('0x3d')](_0xda12a5[_0xbdb3('0x3a')],{'$or':_[_0xbdb3('0x29')](_0x40b66e,function(_0x1e6ae3){if(_0x1e6ae3[_0xbdb3('0x2d')]!==_0xbdb3('0x3e')){var _0x18a671={};_0x18a671[_0x1e6ae3[_0xbdb3('0x27')]]={'$like':'%'+_0x478882[_0xbdb3('0x30')]['filter']+'%'};return _0x18a671;}})});}_0xda12a5=_[_0xbdb3('0x3d')]({},_0xda12a5,_0x478882[_0xbdb3('0x3f')]);var _0x19fd58={'where':_0xda12a5[_0xbdb3('0x3a')]};return db[_0xbdb3('0x2a')]['count'](_0x19fd58)['then'](function(_0x39ab68){_0x12c1ec[_0xbdb3('0x1e')]=_0x39ab68;if(_0x478882[_0xbdb3('0x30')][_0xbdb3('0x40')]){_0xda12a5[_0xbdb3('0x41')]=[{'all':!![]}];}return db[_0xbdb3('0x2a')][_0xbdb3('0x42')](_0xda12a5);})['then'](function(_0x5e34ab){_0x12c1ec[_0xbdb3('0x43')]=_0x5e34ab;return _0x12c1ec;})[_0xbdb3('0x25')](respondWithFilteredResult(_0x3ab60c,_0xda12a5))[_0xbdb3('0x44')](handleError(_0x3ab60c,null));};exports[_0xbdb3('0x45')]=function(_0x392884,_0x24cf93){var _0x1ed3e0={'raw':!![],'where':{'id':_0x392884[_0xbdb3('0x46')]['id']}},_0x5538fb={};_0x5538fb['model']=_['keys'](db[_0xbdb3('0x2a')][_0xbdb3('0x2b')]);_0x5538fb[_0xbdb3('0x30')]=_[_0xbdb3('0x31')](_0x392884[_0xbdb3('0x30')]);_0x5538fb[_0xbdb3('0x32')]=_[_0xbdb3('0x33')](_0x5538fb[_0xbdb3('0x2f')],_0x5538fb[_0xbdb3('0x30')]);_0x1ed3e0[_0xbdb3('0x35')]=_[_0xbdb3('0x33')](_0x5538fb['model'],qs[_0xbdb3('0x34')](_0x392884['query'][_0xbdb3('0x34')]));_0x1ed3e0[_0xbdb3('0x35')]=_0x1ed3e0[_0xbdb3('0x35')][_0xbdb3('0x36')]?_0x1ed3e0[_0xbdb3('0x35')]:_0x5538fb[_0xbdb3('0x2f')];if(_0x392884[_0xbdb3('0x30')][_0xbdb3('0x40')]){_0x1ed3e0[_0xbdb3('0x41')]=[{'all':!![]}];}_0x1ed3e0=_[_0xbdb3('0x3d')]({},_0x1ed3e0,_0x392884[_0xbdb3('0x3f')]);return db[_0xbdb3('0x2a')][_0xbdb3('0x47')](_0x1ed3e0)[_0xbdb3('0x25')](handleEntityNotFound(_0x24cf93,null))[_0xbdb3('0x25')](respondWithResult(_0x24cf93,null))[_0xbdb3('0x44')](handleError(_0x24cf93,null));};exports['create']=function(_0x151863,_0xbae9e6){return db[_0xbdb3('0x2a')][_0xbdb3('0x48')](_0x151863[_0xbdb3('0x49')],{})[_0xbdb3('0x25')](respondWithResult(_0xbae9e6,0xc9))[_0xbdb3('0x44')](handleError(_0xbae9e6,null));};exports['update']=function(_0x3a3c9e,_0x3c38b6){if(_0x3a3c9e[_0xbdb3('0x49')]['id']){delete _0x3a3c9e[_0xbdb3('0x49')]['id'];}return db['VoiceQueuesLog'][_0xbdb3('0x47')]({'where':{'id':_0x3a3c9e['params']['id']}})[_0xbdb3('0x25')](handleEntityNotFound(_0x3c38b6,null))[_0xbdb3('0x25')](saveUpdates(_0x3a3c9e[_0xbdb3('0x49')],null))[_0xbdb3('0x25')](respondWithResult(_0x3c38b6,null))['catch'](handleError(_0x3c38b6,null));};exports[_0xbdb3('0x4a')]=function(_0x38d897,_0x2eaa02){return db[_0xbdb3('0x2a')][_0xbdb3('0x47')]({'where':{'id':_0x38d897[_0xbdb3('0x46')]['id']}})[_0xbdb3('0x25')](handleEntityNotFound(_0x2eaa02,null))[_0xbdb3('0x25')](removeEntity(_0x2eaa02,null))[_0xbdb3('0x44')](handleError(_0x2eaa02,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index e399bb1..96d7d6a 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 _0xf2dd=['lodash','util','moment','bluebird','path','../../config/environment','exports','define','voice_queues_log','event_dtm','event','dtm'];(function(_0x38d36d,_0x95a320){var _0x39dbbd=function(_0x59dfa9){while(--_0x59dfa9){_0x38d36d['push'](_0x38d36d['shift']());}};_0x39dbbd(++_0x95a320);}(_0xf2dd,0x84));var _0xdf2d=function(_0x277721,_0x46971e){_0x277721=_0x277721-0x0;var _0x286051=_0xf2dd[_0x277721];return _0x286051;};'use strict';var _=require(_0xdf2d('0x0'));var util=require(_0xdf2d('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xdf2d('0x2'));var BPromise=require(_0xdf2d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdf2d('0x4'));var rimraf=require('rimraf');var config=require(_0xdf2d('0x5'));var attributes=require('./voiceQueuesLog.attributes');module[_0xdf2d('0x6')]=function(_0x523d8f,_0x1289f1){return _0x523d8f[_0xdf2d('0x7')]('VoiceQueuesLog',attributes,{'tableName':_0xdf2d('0x8'),'paranoid':![],'indexes':[{'name':_0xdf2d('0x9'),'fields':[_0xdf2d('0xa'),_0xdf2d('0xb')]}],'timestamps':![]});}; \ No newline at end of file +var _0x5d25=['exports','define','VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm','util','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x1a1781,_0x27a9cf){var _0x4514bf=function(_0x35e31e){while(--_0x35e31e){_0x1a1781['push'](_0x1a1781['shift']());}};_0x4514bf(++_0x27a9cf);}(_0x5d25,0x103));var _0x55d2=function(_0x4ba52d,_0x43b96a){_0x4ba52d=_0x4ba52d-0x0;var _0x228cd7=_0x5d25[_0x4ba52d];return _0x228cd7;};'use strict';var _=require('lodash');var util=require(_0x55d2('0x0'));var logger=require('../../config/logger')(_0x55d2('0x1'));var moment=require(_0x55d2('0x2'));var BPromise=require(_0x55d2('0x3'));var rp=require(_0x55d2('0x4'));var fs=require('fs');var path=require(_0x55d2('0x5'));var rimraf=require('rimraf');var config=require(_0x55d2('0x6'));var attributes=require('./voiceQueuesLog.attributes');module[_0x55d2('0x7')]=function(_0x2729ae,_0x11569f){return _0x2729ae[_0x55d2('0x8')](_0x55d2('0x9'),attributes,{'tableName':_0x55d2('0xa'),'paranoid':![],'indexes':[{'name':_0x55d2('0xb'),'fields':[_0x55d2('0xc'),_0x55d2('0xd')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 806bb06..031885e 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 _0x74a7=['lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','request','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch'];(function(_0x5a5f47,_0x42ea38){var _0xb679af=function(_0x136ff4){while(--_0x136ff4){_0x5a5f47['push'](_0x5a5f47['shift']());}};_0xb679af(++_0x42ea38);}(_0x74a7,0x130));var _0x774a=function(_0x513fdd,_0x37da83){_0x513fdd=_0x513fdd-0x0;var _0x105247=_0x74a7[_0x513fdd];return _0x105247;};'use strict';var _=require(_0x774a('0x0'));var util=require('util');var moment=require(_0x774a('0x1'));var BPromise=require(_0x774a('0x2'));var rs=require(_0x774a('0x3'));var fs=require('fs');var Redis=require(_0x774a('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x774a('0x5'))(_0x774a('0x6'));var config=require(_0x774a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x774a('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x154a28,_0xe260ca,_0x1c9b5c){return new BPromise(function(_0x450104,_0x18c106){return client[_0x774a('0x9')](_0x154a28,_0x1c9b5c)['then'](function(_0x1e5d95){logger['info'](_0x774a('0xa'),_0xe260ca,_0x774a('0xb'));logger[_0x774a('0xc')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0xe260ca,_0x774a('0xb'),JSON[_0x774a('0xd')](_0x1e5d95));if(_0x1e5d95[_0x774a('0xe')]){if(_0x1e5d95[_0x774a('0xe')]['code']===0x1f4){logger[_0x774a('0xe')](_0x774a('0xa'),_0xe260ca,_0x1e5d95['error']['message']);return _0x18c106(_0x1e5d95['error']['message']);}logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0xe260ca,_0x1e5d95[_0x774a('0xe')][_0x774a('0xf')]);return _0x450104(_0x1e5d95[_0x774a('0xe')][_0x774a('0xf')]);}else{logger[_0x774a('0x10')](_0x774a('0xa'),_0xe260ca,'request\x20sent');_0x450104(_0x1e5d95[_0x774a('0x11')][_0x774a('0xf')]);}})[_0x774a('0x12')](function(_0x20d910){logger[_0x774a('0xe')]('VoiceQueuesLog,\x20%s,\x20%s',_0xe260ca,_0x20d910);_0x18c106(_0x20d910);});});} \ No newline at end of file +var _0x537f=['../../config/environment','client','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x25f049,_0x280313){var _0x1fc2cb=function(_0x38f354){while(--_0x38f354){_0x25f049['push'](_0x25f049['shift']());}};_0x1fc2cb(++_0x280313);}(_0x537f,0x1c4));var _0xf537=function(_0x5528b5,_0x1cb5f0){_0x5528b5=_0x5528b5-0x0;var _0x4b6302=_0x537f[_0x5528b5];return _0x4b6302;};'use strict';var _=require(_0xf537('0x0'));var util=require(_0xf537('0x1'));var moment=require(_0xf537('0x2'));var BPromise=require(_0xf537('0x3'));var rs=require(_0xf537('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf537('0x5'))['db'];var utils=require(_0xf537('0x6'));var logger=require(_0xf537('0x7'))('rpc');var config=require(_0xf537('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf537('0x9')][_0xf537('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x14cd3d,_0x386803,_0x38c2ef){return new BPromise(function(_0x5788c0,_0x5b788a){return client[_0xf537('0xb')](_0x14cd3d,_0x38c2ef)[_0xf537('0xc')](function(_0x338cd4){logger[_0xf537('0xd')](_0xf537('0xe'),_0x386803,_0xf537('0xf'));logger[_0xf537('0x10')](_0xf537('0x11'),_0x386803,_0xf537('0xf'),JSON[_0xf537('0x12')](_0x338cd4));if(_0x338cd4[_0xf537('0x13')]){if(_0x338cd4[_0xf537('0x13')][_0xf537('0x14')]===0x1f4){logger['error'](_0xf537('0xe'),_0x386803,_0x338cd4[_0xf537('0x13')]['message']);return _0x5b788a(_0x338cd4[_0xf537('0x13')]['message']);}logger[_0xf537('0x13')](_0xf537('0xe'),_0x386803,_0x338cd4[_0xf537('0x13')][_0xf537('0x15')]);return _0x5788c0(_0x338cd4[_0xf537('0x13')]['message']);}else{logger[_0xf537('0xd')]('VoiceQueuesLog,\x20%s,\x20%s',_0x386803,_0xf537('0xf'));_0x5788c0(_0x338cd4[_0xf537('0x16')][_0xf537('0x15')]);}})['catch'](function(_0x276f94){logger['error'](_0xf537('0xe'),_0x386803,_0x276f94);_0x5b788a(_0x276f94);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 9bbffe3..bd063ac 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 _0xfdcc=['/:id/transcribe','runTranscribe','put','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceRecording.controller','isAuthenticated','get','/describe','describe','/:id','show','/:id/download','download','/:id/downloads','downloads','downloadTranscribe','create','post'];(function(_0xe3bb84,_0xb36db4){var _0x3936de=function(_0x524f09){while(--_0x524f09){_0xe3bb84['push'](_0xe3bb84['shift']());}};_0x3936de(++_0xb36db4);}(_0xfdcc,0xde));var _0xcfdc=function(_0x2e41e2,_0x4e7250){_0x2e41e2=_0x2e41e2-0x0;var _0x2844d6=_0xfdcc[_0x2e41e2];return _0x2844d6;};'use strict';var multer=require(_0xcfdc('0x0'));var util=require(_0xcfdc('0x1'));var path=require('path');var timeout=require(_0xcfdc('0x2'));var express=require(_0xcfdc('0x3'));var router=express['Router']();var fs_extra=require(_0xcfdc('0x4'));var auth=require(_0xcfdc('0x5'));var interaction=require(_0xcfdc('0x6'));var config=require('../../config/environment');var controller=require(_0xcfdc('0x7'));router['get']('/',auth[_0xcfdc('0x8')](),controller['index']);router[_0xcfdc('0x9')](_0xcfdc('0xa'),auth['isAuthenticated'](),controller[_0xcfdc('0xb')]);router['get'](_0xcfdc('0xc'),auth['isAuthenticated'](),controller[_0xcfdc('0xd')]);router[_0xcfdc('0x9')](_0xcfdc('0xe'),auth[_0xcfdc('0x8')](),controller[_0xcfdc('0xf')]);router[_0xcfdc('0x9')](_0xcfdc('0x10'),controller[_0xcfdc('0x11')]);router[_0xcfdc('0x9')]('/:id/transcribe',auth[_0xcfdc('0x8')](),controller[_0xcfdc('0x12')]);router['post']('/',auth['isAuthenticated'](),controller[_0xcfdc('0x13')]);router[_0xcfdc('0x14')](_0xcfdc('0x15'),auth[_0xcfdc('0x8')](),controller[_0xcfdc('0x16')]);router[_0xcfdc('0x17')](_0xcfdc('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xcfdc('0x18')](_0xcfdc('0xc'),auth[_0xcfdc('0x8')](),controller[_0xcfdc('0x19')]);module[_0xcfdc('0x1a')]=router; \ No newline at end of file +var _0x6e62=['show','/:id/download','download','/:id/transcribe','downloadTranscribe','create','post','runTranscribe','put','delete','/:id','exports','util','connect-timeout','express','Router','fs-extra','../../config/environment','isAuthenticated','index','get','/describe'];(function(_0x421daa,_0x3b8de4){var _0x283a04=function(_0x51b713){while(--_0x51b713){_0x421daa['push'](_0x421daa['shift']());}};_0x283a04(++_0x3b8de4);}(_0x6e62,0xe8));var _0x26e6=function(_0x2bcb76,_0x1f21a3){_0x2bcb76=_0x2bcb76-0x0;var _0xe3f5bc=_0x6e62[_0x2bcb76];return _0xe3f5bc;};'use strict';var multer=require('multer');var util=require(_0x26e6('0x0'));var path=require('path');var timeout=require(_0x26e6('0x1'));var express=require(_0x26e6('0x2'));var router=express[_0x26e6('0x3')]();var fs_extra=require(_0x26e6('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x26e6('0x5'));var controller=require('./voiceRecording.controller');router['get']('/',auth[_0x26e6('0x6')](),controller[_0x26e6('0x7')]);router[_0x26e6('0x8')](_0x26e6('0x9'),auth[_0x26e6('0x6')](),controller['describe']);router[_0x26e6('0x8')]('/:id',auth[_0x26e6('0x6')](),controller[_0x26e6('0xa')]);router[_0x26e6('0x8')](_0x26e6('0xb'),auth[_0x26e6('0x6')](),controller[_0x26e6('0xc')]);router['get']('/:id/downloads',controller['downloads']);router[_0x26e6('0x8')](_0x26e6('0xd'),auth[_0x26e6('0x6')](),controller[_0x26e6('0xe')]);router['post']('/',auth[_0x26e6('0x6')](),controller[_0x26e6('0xf')]);router[_0x26e6('0x10')]('/:id/transcribe',auth['isAuthenticated'](),controller[_0x26e6('0x11')]);router[_0x26e6('0x12')]('/:id',auth[_0x26e6('0x6')](),controller['update']);router[_0x26e6('0x13')](_0x26e6('0x14'),auth[_0x26e6('0x6')](),controller['destroy']);module[_0x26e6('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 8bfb340..d151970 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(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'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(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'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 7431c06..a46ad8e 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 _0x876b=['body','params','describe','download','../../components/encryptor','uniqueid','value','existsSync','decryptFile','secrets','recording','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','downloads','sequelize','MD5','token','$and','push','%s.cypher','Sequelize','isNil','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','File:\x20\x22','unlinkSync','end','listBuckets','createBucket','startTranscriptionJob','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','runTranscribe','Setting','findOne','transcribe','Transcribe\x20not\x20configured','sentiment','sentimentRegion','language','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','transcribeAccountId','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','transcribeRegion','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','runSentiment','updateAttributes','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','aws-sdk','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','apply','reject','then','destroy','error','stack','name','send','index','map','VoiceRecording','type','key','model','differenceBy','format','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','find','create','update'];(function(_0x1ee99d,_0x25aba5){var _0x2cee6b=function(_0x44ac00){while(--_0x44ac00){_0x1ee99d['push'](_0x1ee99d['shift']());}};_0x2cee6b(++_0x25aba5);}(_0x876b,0x185));var _0xb876=function(_0x23cfd4,_0x3b80ad){_0x23cfd4=_0x23cfd4-0x0;var _0x37aae8=_0x876b[_0x23cfd4];return _0x37aae8;};'use strict';var emlformat=require(_0xb876('0x0'));var rimraf=require(_0xb876('0x1'));var zipdir=require(_0xb876('0x2'));var jsonpatch=require(_0xb876('0x3'));var rp=require('request-promise');var moment=require(_0xb876('0x4'));var BPromise=require(_0xb876('0x5'));var Mustache=require(_0xb876('0x6'));var util=require(_0xb876('0x7'));var path=require('path');var sox=require(_0xb876('0x8'));var csv=require(_0xb876('0x9'));var ejs=require(_0xb876('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb876('0xb'));var squel=require(_0xb876('0xc'));var crypto=require('crypto');var jsforce=require(_0xb876('0xd'));var deskjs=require(_0xb876('0xe'));var toCsv=require(_0xb876('0x9'));var querystring=require(_0xb876('0xf'));var Papa=require('papaparse');var AWS=require(_0xb876('0x10'));var uuidv4=require('uuid/v4');var Redis=require(_0xb876('0x11'));var authService=require(_0xb876('0x12'));var qs=require(_0xb876('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb876('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xb876('0x15'));var licenseUtil=require(_0xb876('0x16'));var db=require(_0xb876('0x17'))['db'];function respondWithStatusCode(_0x3056a0,_0x41bc05){_0x41bc05=_0x41bc05||0xcc;return function(_0x44a484){if(_0x44a484){return _0x3056a0[_0xb876('0x18')](_0x41bc05);}return _0x3056a0['status'](_0x41bc05)['end']();};}function respondWithResult(_0x4bd211,_0x4b8dfd){_0x4b8dfd=_0x4b8dfd||0xc8;return function(_0x3a7ee8){if(_0x3a7ee8){return _0x4bd211[_0xb876('0x19')](_0x4b8dfd)[_0xb876('0x1a')](_0x3a7ee8);}};}function respondWithFilteredResult(_0x3b0548,_0xbdc5b){return function(_0x2f7fab){if(_0x2f7fab){var _0xe5d68b=typeof _0xbdc5b['offset']===_0xb876('0x1b')&&typeof _0xbdc5b['limit']===_0xb876('0x1b');var _0x560b6b=_0x2f7fab[_0xb876('0x1c')];var _0x272b87=_0xe5d68b?0x0:_0xbdc5b[_0xb876('0x1d')];var _0x25af7c=_0xe5d68b?_0x2f7fab[_0xb876('0x1c')]:_0xbdc5b[_0xb876('0x1d')]+_0xbdc5b[_0xb876('0x1e')];var _0x545792;if(_0x25af7c>=_0x560b6b){_0x25af7c=_0x560b6b;_0x545792=0xc8;}else{_0x545792=0xce;}_0x3b0548[_0xb876('0x19')](_0x545792);return _0x3b0548[_0xb876('0x1f')]('Content-Range',_0x272b87+'-'+_0x25af7c+'/'+_0x560b6b)[_0xb876('0x1a')](_0x2f7fab);}return null;};}function patchUpdates(_0x5292b0){return function(_0x24ccb2){try{jsonpatch[_0xb876('0x20')](_0x24ccb2,_0x5292b0,!![]);}catch(_0x5a3a37){return BPromise[_0xb876('0x21')](_0x5a3a37);}return _0x24ccb2['save']();};}function saveUpdates(_0x424a86,_0x45afd5){return function(_0x49b5e5){if(_0x49b5e5){return _0x49b5e5['update'](_0x424a86)[_0xb876('0x22')](function(_0x2ec4b1){return _0x2ec4b1;});}return null;};}function removeEntity(_0xab7131,_0x4d97cb){return function(_0x5f1236){if(_0x5f1236){return _0x5f1236[_0xb876('0x23')]()[_0xb876('0x22')](function(){_0xab7131['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x966b57,_0x2bbe6f){return function(_0xdf1bcb){if(!_0xdf1bcb){_0x966b57['sendStatus'](0x194);}return _0xdf1bcb;};}function handleError(_0x3c5065,_0x266fc6){_0x266fc6=_0x266fc6||0x1f4;return function(_0xc4f15b){logger[_0xb876('0x24')](_0xc4f15b[_0xb876('0x25')]);if(_0xc4f15b['name']){delete _0xc4f15b[_0xb876('0x26')];}_0x3c5065[_0xb876('0x19')](_0x266fc6)[_0xb876('0x27')](_0xc4f15b);};}exports[_0xb876('0x28')]=function(_0x1d885b,_0x506853){var _0x40b111={},_0x543b68={},_0x5a1f5c={'count':0x0,'rows':[]};var _0x4af8e7=_[_0xb876('0x29')](db[_0xb876('0x2a')]['rawAttributes'],function(_0x32fe0d){return{'name':_0x32fe0d['fieldName'],'type':_0x32fe0d[_0xb876('0x2b')][_0xb876('0x2c')]};});_0x543b68[_0xb876('0x2d')]=_[_0xb876('0x2e')](_[_0xb876('0x29')](_0x4af8e7,_0xb876('0x26')),[_0xb876('0x2f')]);_0x543b68[_0xb876('0x30')]=_[_0xb876('0x31')](_0x1d885b['query']);_0x543b68[_0xb876('0x32')]=_[_0xb876('0x33')](_0x543b68[_0xb876('0x2d')],_0x543b68[_0xb876('0x30')]);_0x40b111['attributes']=_['intersection'](_0x543b68[_0xb876('0x2d')],qs[_0xb876('0x34')](_0x1d885b[_0xb876('0x30')][_0xb876('0x34')]));_0x40b111[_0xb876('0x35')]=_0x40b111[_0xb876('0x35')][_0xb876('0x36')]?_0x40b111[_0xb876('0x35')]:_0x543b68['model'];if(!_0x1d885b['query'][_0xb876('0x37')](_0xb876('0x38'))){_0x40b111[_0xb876('0x1e')]=qs[_0xb876('0x1e')](_0x1d885b[_0xb876('0x30')][_0xb876('0x1e')]);_0x40b111[_0xb876('0x1d')]=qs[_0xb876('0x1d')](_0x1d885b['query'][_0xb876('0x1d')]);}_0x40b111[_0xb876('0x39')]=qs[_0xb876('0x3a')](_0x1d885b[_0xb876('0x30')][_0xb876('0x3a')]);_0x40b111[_0xb876('0x3b')]=qs[_0xb876('0x32')](_[_0xb876('0x3c')](_0x1d885b['query'],_0x543b68[_0xb876('0x32')]),_0x4af8e7);if(_0x1d885b['query'][_0xb876('0x3d')]){_0x40b111['where']=_[_0xb876('0x3e')](_0x40b111['where'],{'$or':_[_0xb876('0x29')](_0x4af8e7,function(_0x2452d6){if(_0x2452d6[_0xb876('0x2b')]!==_0xb876('0x3f')){var _0x3cd88a={};_0x3cd88a[_0x2452d6['name']]={'$like':'%'+_0x1d885b['query'][_0xb876('0x3d')]+'%'};return _0x3cd88a;}})});}_0x40b111=_[_0xb876('0x3e')]({},_0x40b111,_0x1d885b[_0xb876('0x40')]);var _0x1ce110={'where':_0x40b111[_0xb876('0x3b')]};return db[_0xb876('0x2a')][_0xb876('0x1c')](_0x1ce110)[_0xb876('0x22')](function(_0x34d4fe){_0x5a1f5c[_0xb876('0x1c')]=_0x34d4fe;if(_0x1d885b[_0xb876('0x30')][_0xb876('0x41')]){_0x40b111[_0xb876('0x42')]=[{'all':!![]}];}return db[_0xb876('0x2a')][_0xb876('0x43')](_0x40b111);})[_0xb876('0x22')](function(_0x556699){_0x5a1f5c[_0xb876('0x44')]=_0x556699;return _0x5a1f5c;})[_0xb876('0x22')](respondWithFilteredResult(_0x506853,_0x40b111))[_0xb876('0x45')](handleError(_0x506853,null));};exports['show']=function(_0x3b6073,_0x37771f){var _0x429fbc={'raw':![],'where':{'id':_0x3b6073['params']['id']}},_0x3125f6={};_0x3125f6[_0xb876('0x2d')]=_[_0xb876('0x31')](db[_0xb876('0x2a')]['rawAttributes']);_0x3125f6[_0xb876('0x30')]=_[_0xb876('0x31')](_0x3b6073[_0xb876('0x30')]);_0x3125f6['filters']=_['intersection'](_0x3125f6['model'],_0x3125f6[_0xb876('0x30')]);_0x429fbc['attributes']=_[_0xb876('0x33')](_0x3125f6[_0xb876('0x2d')],qs[_0xb876('0x34')](_0x3b6073[_0xb876('0x30')][_0xb876('0x34')]));_0x429fbc[_0xb876('0x35')]=_0x429fbc['attributes'][_0xb876('0x36')]?_0x429fbc['attributes']:_0x3125f6[_0xb876('0x2d')];if(_0x3b6073['query'][_0xb876('0x41')]){_0x429fbc[_0xb876('0x42')]=[{'all':!![]}];}_0x429fbc=_[_0xb876('0x3e')]({},_0x429fbc,_0x3b6073['options']);return db[_0xb876('0x2a')][_0xb876('0x46')](_0x429fbc)[_0xb876('0x22')](handleEntityNotFound(_0x37771f,null))[_0xb876('0x22')](respondWithResult(_0x37771f,null))[_0xb876('0x45')](handleError(_0x37771f,null));};exports[_0xb876('0x47')]=function(_0x2e5756,_0x3ecebe){return db[_0xb876('0x2a')][_0xb876('0x47')](_0x2e5756['body'],{})['then'](respondWithResult(_0x3ecebe,0xc9))['catch'](handleError(_0x3ecebe,null));};exports[_0xb876('0x48')]=function(_0x184df8,_0x1e7329){if(_0x184df8[_0xb876('0x49')]['id']){delete _0x184df8[_0xb876('0x49')]['id'];}return db[_0xb876('0x2a')][_0xb876('0x46')]({'where':{'id':_0x184df8[_0xb876('0x4a')]['id']}})[_0xb876('0x22')](handleEntityNotFound(_0x1e7329,null))[_0xb876('0x22')](saveUpdates(_0x184df8['body'],null))[_0xb876('0x22')](respondWithResult(_0x1e7329,null))[_0xb876('0x45')](handleError(_0x1e7329,null));};exports['describe']=function(_0x3aff77,_0x593c7c){return db[_0xb876('0x2a')][_0xb876('0x4b')]()['then'](respondWithResult(_0x593c7c,null))[_0xb876('0x45')](handleError(_0x593c7c,null));};exports[_0xb876('0x4c')]=function(_0x6e9dfb,_0x10d148,_0x343d4c){var _0x3744af=require(_0xb876('0x4d'));var _0x2cb446=![];var _0x2873cd={};if(_0x6e9dfb['query']['type']&&_0x6e9dfb['query']['type']==='uniqueid'){_0x2873cd[_0xb876('0x4e')]=_0x6e9dfb[_0xb876('0x4a')]['id'];}else{_0x2873cd['id']=_0x6e9dfb['params']['id'];}return db[_0xb876('0x2a')][_0xb876('0x46')]({'where':_0x2873cd,'attributes':['id',_0xb876('0x4f')],'raw':!![]})[_0xb876('0x22')](handleEntityNotFound(_0x10d148,null))[_0xb876('0x22')](function(_0x4ecf19){if(_0x4ecf19){var _0x366b3d=_0x4ecf19[_0xb876('0x4f')];var _0x115b57=util[_0xb876('0x2f')]('%s.cypher',_0x366b3d);if(fs[_0xb876('0x50')](_0x115b57)){_0x2cb446=!![];return _0x3744af[_0xb876('0x51')](_0x115b57,_0x366b3d,config[_0xb876('0x52')][_0xb876('0x53')])['then'](function(){return _0x4ecf19;});}return _0x4ecf19;}})[_0xb876('0x22')](function(_0x5e333f){if(_0x5e333f){var _0x5c2e21=_0x5e333f[_0xb876('0x4f')];if(!fs[_0xb876('0x50')](_0x5c2e21)){throw new db['Sequelize'][(_0xb876('0x54'))](_0xb876('0x55'));}if(_0x5e333f['filename']){return _0x10d148[_0xb876('0x4c')](_0x5c2e21,_0x5e333f[_0xb876('0x56')]+path[_0xb876('0x57')](_0x5c2e21),function(){if(_0x2cb446){fs[_0xb876('0x58')](_0x5c2e21);}});}else{return _0x10d148[_0xb876('0x4c')](_0x5c2e21,function(_0x168315){if(_0x2cb446){fs[_0xb876('0x58')](_0x5c2e21);}});}}})[_0xb876('0x45')](function(_0x5ac800){if(_0x5ac800[_0xb876('0x59')]==='VoiceRecording\x20not\x20found'){_0x10d148['status'](0x194)[_0xb876('0x27')](_0xb876('0x5a'));}else{return handleError(_0x10d148,null);}});};exports[_0xb876('0x5b')]=function(_0x41d673,_0xc26161,_0x340511){var _0x35b153=require('../../components/encryptor');var _0x28ed9a=![];var _0x44d181={'$and':[db[_0xb876('0x5c')]['where'](db[_0xb876('0x5c')]['fn'](_0xb876('0x5d'),db['sequelize']['col'](_0xb876('0x4e'))),_0x41d673[_0xb876('0x30')][_0xb876('0x5e')])]};if(_0x41d673[_0xb876('0x30')][_0xb876('0x2b')]&&_0x41d673[_0xb876('0x30')]['type']===_0xb876('0x4e')){_0x44d181['$and']['push']({'uniqueid':_0x41d673[_0xb876('0x4a')]['id']});}else{_0x44d181[_0xb876('0x5f')][_0xb876('0x60')]({'id':_0x41d673[_0xb876('0x4a')]['id']});}return db[_0xb876('0x2a')][_0xb876('0x46')]({'where':_0x44d181,'attributes':['id',_0xb876('0x4f')],'raw':!![]})[_0xb876('0x22')](handleEntityNotFound(_0xc26161,null))['then'](function(_0x5cd94d){if(_0x5cd94d){var _0x377d44=util[_0xb876('0x2f')](_0xb876('0x61'),_0x5cd94d[_0xb876('0x4f')]);if(fs[_0xb876('0x50')](_0x377d44)){_0x28ed9a=!![];return _0x35b153[_0xb876('0x51')](_0x377d44,_0x5cd94d[_0xb876('0x4f')],config[_0xb876('0x52')][_0xb876('0x53')])[_0xb876('0x22')](function(){return _0x5cd94d;});}return _0x5cd94d;}})['then'](function(_0x12332a){if(_0x12332a){if(!fs[_0xb876('0x50')](_0x12332a['value'])){throw new db[(_0xb876('0x62'))][(_0xb876('0x54'))](_0xb876('0x55'));}if(_0x12332a['filename']){return _0xc26161[_0xb876('0x4c')](_0x12332a[_0xb876('0x4f')],_0x12332a['filename']+path[_0xb876('0x57')](_0x12332a['value']),function(){if(_0x28ed9a){fs[_0xb876('0x58')](_0x12332a[_0xb876('0x4f')]);}});}else{return _0xc26161[_0xb876('0x4c')](_0x12332a[_0xb876('0x4f')],function(_0x312e55){if(_0x28ed9a){fs[_0xb876('0x58')](_0x12332a['value']);}});}}})['catch'](handleError(_0xc26161,null));};exports[_0xb876('0x23')]=function(_0x5eb4c6,_0x577ad5){return db[_0xb876('0x2a')]['find']({'where':{'id':_0x5eb4c6[_0xb876('0x4a')]['id']}})[_0xb876('0x22')](function(_0x49a43d){if(_[_0xb876('0x63')](_0x49a43d)){throw new ReferenceError('Entity\x20not\x20found');}return _0x49a43d;})['then'](function(_0x38ab74){var _0x412aee=_0x38ab74[_0xb876('0x4f')];logger[_0xb876('0x64')](_0xb876('0x65'),_0x412aee);if(!_[_0xb876('0x63')](_0x38ab74[_0xb876('0x4f')])&&fs[_0xb876('0x50')](_0x412aee)){logger[_0xb876('0x64')]('File:\x20\x22'+_0x412aee+_0xb876('0x66'));fs['unlinkSync'](_0x412aee);}_0x412aee=_0x412aee+_0xb876('0x67');if(!_[_0xb876('0x63')](_0x38ab74[_0xb876('0x4f')])&&fs[_0xb876('0x50')](_0x412aee)){logger[_0xb876('0x64')](_0xb876('0x68')+_0x412aee+_0xb876('0x66'));fs[_0xb876('0x69')](_0x412aee);}return _0x38ab74;})[_0xb876('0x22')](function(_0x3a0171){if(!_0x3a0171)throw new InternalError();return _0x3a0171[_0xb876('0x23')]();})[_0xb876('0x22')](function(){_0x577ad5['status'](0xcc)[_0xb876('0x6a')]();})[_0xb876('0x45')](handleError(_0x577ad5,null));};function getBucketslist(_0x23737e,_0x3c460a,_0x4d028f){return new Promise(function(_0xbb76a0,_0x23db39){var _0x105390=new AWS['S3']({'accessKeyId':_0x3c460a,'secretAccessKey':_0x23737e,'region':_0x4d028f});_0x105390[_0xb876('0x6b')]({},function(_0x29f7d1,_0x3437a9){if(_0x29f7d1){return _0x23db39(_0x29f7d1);}else{return _0xbb76a0(_0x3437a9);}});});}function createBucket(_0x28b41c,_0x17769a,_0x943864,_0x354f6f){return new Promise(function(_0x2cc3d8,_0x49102c){var _0x4baec3=new AWS['S3']({'accessKeyId':_0x17769a,'secretAccessKey':_0x28b41c,'region':_0x943864});_0x4baec3[_0xb876('0x6c')]({'Bucket':_0x354f6f},function(_0x27658f,_0x159801){if(_0x27658f){return _0x49102c(_0x27658f);}else{return _0x2cc3d8(_0x159801);}});});}function uploadFile(_0x27702f,_0x64d59d,_0x49bd03,_0x544437,_0x4b6dc2,_0x3d6bcd){return new Promise(function(_0x50e7c2,_0xb22923){var _0x153e1a=new AWS['S3']({'accessKeyId':_0x64d59d,'secretAccessKey':_0x27702f,'region':_0x49bd03});_0x153e1a['upload']({'Bucket':_0x544437,'Key':_0x4b6dc2,'Body':_0x3d6bcd},function(_0x29b008,_0x3cc685){if(_0x29b008){return _0xb22923(_0x29b008);}else{return _0x50e7c2(_0x3cc685);}});});}function startTranscribe(_0x145240,_0x1f7849,_0x38ffb3,_0x1d3e17,_0x5a3b72,_0x5d4a56){return new Promise(function(_0x77743,_0x1f6f4c){var _0x452b2c=new AWS['TranscribeService']({'accessKeyId':_0x1f7849,'secretAccessKey':_0x145240,'region':_0x38ffb3});_0x452b2c[_0xb876('0x6d')]({'TranscriptionJobName':_0x1d3e17,'LanguageCode':_0x5a3b72,'Media':{'MediaFileUri':_0x5d4a56}},function(_0x538871,_0xd2d8c9){if(_0x538871){return _0x1f6f4c(_0x538871);}else{return _0x77743(_0xd2d8c9);}});});}function transcribe(_0x4691fd,_0x4cf207,_0x14ccd3,_0x2d1bb5,_0x2a44f5,_0x2eb9a1,_0x242772){return new Promise(function(_0x238dd0,_0x521cc3){var _0xcd4aad={};logger['info'](util[_0xb876('0x2f')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x4691fd,_0x2a44f5));return uploadFile(_0x4cf207,_0x14ccd3,_0x2d1bb5,_0x2a44f5,path[_0xb876('0x6e')](_0x2eb9a1),fs[_0xb876('0x6f')](_0x2eb9a1))[_0xb876('0x22')](function(_0x18c201){logger[_0xb876('0x64')](util['format'](_0xb876('0x70'),_0x4691fd,_0x2a44f5,_0x18c201[_0xb876('0x71')]));_0xcd4aad[_0xb876('0x72')]=_0x18c201[_0xb876('0x73')];_0xcd4aad['location']=_0x18c201[_0xb876('0x71')];logger[_0xb876('0x64')](util[_0xb876('0x2f')](_0xb876('0x74'),_0x4691fd));return startTranscribe(_0x4cf207,_0x14ccd3,_0x2d1bb5,uuidv4(),_0x242772,_0x18c201[_0xb876('0x71')]);})[_0xb876('0x22')](function(_0x1e0aec){logger['info'](util[_0xb876('0x2f')]('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x4691fd,_0x1e0aec[_0xb876('0x75')][_0xb876('0x76')]));_0xcd4aad[_0xb876('0x77')]=_0x1e0aec[_0xb876('0x75')][_0xb876('0x76')];_0xcd4aad[_0xb876('0x78')]=_0x1e0aec[_0xb876('0x75')][_0xb876('0x79')];return _0x238dd0(_0xcd4aad);})[_0xb876('0x45')](function(_0x12b568){return _0x521cc3(_0x12b568);});});}exports[_0xb876('0x7a')]=function(_0x148cf7,_0x46f20b,_0x451b1b){var _0x2f4786;var _0x2cf725;var _0x435bf3;var _0x139599=require('../../components/encryptor');return db[_0xb876('0x2a')]['findOne']({'where':{'id':_0x148cf7[_0xb876('0x4a')]['id']}})[_0xb876('0x22')](function(_0x373951){if(_0x373951){var _0x140f84=util[_0xb876('0x2f')](_0xb876('0x61'),_0x373951[_0xb876('0x4f')]);if(fs['existsSync'](_0x140f84)){cypher=!![];return _0x139599[_0xb876('0x51')](_0x140f84,_0x373951[_0xb876('0x4f')],config[_0xb876('0x52')][_0xb876('0x53')])['then'](function(){return _0x373951;});}return _0x373951;}})[_0xb876('0x22')](function(_0x4df5de){if(!_0x4df5de){throw new db['Sequelize'][(_0xb876('0x54'))]('Voice\x20Recording\x20not\x20found');}_0x2cf725=_0x4df5de;return db[_0xb876('0x7b')][_0xb876('0x7c')]({'where':{'id':0x1}});})[_0xb876('0x22')](handleEntityNotFound(_0x46f20b,null))[_0xb876('0x22')](function(_0x54be7e){if(_0x54be7e){_0x2f4786=_0x54be7e;if(!_0x2f4786[_0xb876('0x7d')]||!_0x2f4786['transcribeAccountId']||!_0x2f4786['transcribeRegion']||!_0x2f4786['language']||!_0x2f4786[_0xb876('0x72')]){throw new db[(_0xb876('0x62'))][(_0xb876('0x54'))](_0xb876('0x7e'));}if(_0x148cf7[_0xb876('0x49')]['runSentiment']&&(!_0x2f4786[_0xb876('0x7f')]||!_0x2f4786['sentimentAccountId']||!_0x2f4786[_0xb876('0x80')]||!_0x2f4786[_0xb876('0x81')]||!_0x2f4786[_0xb876('0x72')])){throw new db[(_0xb876('0x62'))][(_0xb876('0x54'))](_0xb876('0x82'));}return db[_0xb876('0x83')][_0xb876('0x7c')]({'where':{'id':_0x2f4786[_0xb876('0x84')]}});}})[_0xb876('0x22')](function(_0x719756){if(!_0x719756){throw new db['Sequelize'][(_0xb876('0x54'))](_0xb876('0x85'));}if(!_0x719756[_0xb876('0x86')]||!_0x719756[_0xb876('0x87')]){throw new db[(_0xb876('0x62'))][(_0xb876('0x54'))](_0xb876('0x88'));}_0x435bf3=_0x719756;return getBucketslist(_0x435bf3[_0xb876('0x86')],_0x435bf3[_0xb876('0x87')],_0x2f4786['transcribeRegion']);})[_0xb876('0x22')](function(_0x41a45b){if(_0x41a45b&&_0x41a45b['Buckets']){var _0x430e56=_[_0xb876('0x46')](_0x41a45b[_0xb876('0x89')],function(_0x9efebc){return _0x9efebc[_0xb876('0x8a')]===_0x2f4786[_0xb876('0x72')];});if(!_0x430e56){logger[_0xb876('0x64')](util[_0xb876('0x2f')](_0xb876('0x8b'),_0x148cf7[_0xb876('0x4a')]['id'],_0x2f4786[_0xb876('0x72')]));return createBucket(_0x435bf3[_0xb876('0x86')],_0x435bf3[_0xb876('0x87')],_0x2f4786[_0xb876('0x8c')],_0x2f4786[_0xb876('0x72')]);}logger['info'](util['format'](_0xb876('0x8d'),_0x148cf7['params']['id'],_0x2f4786['bucket']));return;}})['then'](function(_0x134198){if(_0x2cf725[_0xb876('0x78')]===_0xb876('0x8e')){return transcribe(_0x148cf7[_0xb876('0x4a')]['id'],_0x435bf3[_0xb876('0x86')],_0x435bf3[_0xb876('0x87')],_0x2f4786['transcribeRegion'],_0x2f4786[_0xb876('0x72')],_0x2cf725['value'],_0x2f4786['language']);}else{logger['info'](util[_0xb876('0x2f')](_0xb876('0x8f'),_0x148cf7[_0xb876('0x4a')]['id']));return{'transcribeStatus':_0xb876('0x90')};}})[_0xb876('0x22')](function(_0x328790){if(_0x328790){_0x328790[_0xb876('0x91')]=_0x148cf7[_0xb876('0x49')][_0xb876('0x92')];return _0x2cf725[_0xb876('0x93')](_0x328790);}})[_0xb876('0x22')](respondWithResult(_0x46f20b,null))[_0xb876('0x45')](handleError(_0x46f20b,null));};function writeFile(_0xbb72df,_0x21b8fb){return new Promise(function(_0x482b29,_0x511618){fs['writeFile'](_0x21b8fb,_0xbb72df,function(_0x3f0e06,_0x50148e){if(_0x3f0e06){return _0x511618(_0x3f0e06);}else{return _0x482b29(_0x50148e);}});});}exports[_0xb876('0x94')]=function(_0x436bd9,_0x36528d,_0x1e416a){return db['VoiceRecording']['findOne']({'where':{'id':_0x436bd9['params']['id']}})[_0xb876('0x22')](handleEntityNotFound(_0x36528d))[_0xb876('0x22')](function(_0x1c84c4){if(_0x1c84c4&&_0x1c84c4[_0xb876('0x95')]){var _0x1540a4=_0x1c84c4[_0xb876('0x95')];var _0x49b9b5=config[_0xb876('0x96')]+_0xb876('0x97')+_0x1c84c4['id']+_0xb876('0x98');if(fs[_0xb876('0x50')](_0x49b9b5)){return _0x49b9b5;}return writeFile(_0x1540a4,_0x49b9b5)['then'](function(){return _0x49b9b5;});}else{throw new db[(_0xb876('0x62'))]['ValidationError'](_0xb876('0x99'));}})[_0xb876('0x22')](function(_0x436dbf){return _0x36528d[_0xb876('0x4c')](_0x436dbf);})[_0xb876('0x45')](handleError(_0x36528d));}; \ No newline at end of file +var _0x74b8=['Transcript\x20not\x20available','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','aws-sdk','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','save','update','then','destroy','error','stack','name','send','index','map','VoiceRecording','rawAttributes','fieldName','type','key','model','format','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','filter','options','includeAll','include','findAll','params','find','catch','create','body','describe','download','uniqueid','value','%s.cypher','decryptFile','secrets','existsSync','Sequelize','VoiceRecording\x20not\x20found','filename','extname','unlink','Not\x20found','../../components/encryptor','sequelize','col','token','push','$and','ValidationError','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','isNil','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJobName','transcribeName','TranscriptionJob','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','recording','Voice\x20Recording\x20not\x20found','Setting','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','data1','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','runSentiment','writeFile','downloadTranscribe','fileText','/server/files/transcribes/transcribe_','.txt'];(function(_0x589f85,_0x49c39c){var _0x4b37d8=function(_0x148eb3){while(--_0x148eb3){_0x589f85['push'](_0x589f85['shift']());}};_0x4b37d8(++_0x49c39c);}(_0x74b8,0x1cc));var _0x874b=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x74b8[_0x5783f4];return _0x28e380;};'use strict';var emlformat=require(_0x874b('0x0'));var rimraf=require(_0x874b('0x1'));var zipdir=require(_0x874b('0x2'));var jsonpatch=require(_0x874b('0x3'));var rp=require(_0x874b('0x4'));var moment=require(_0x874b('0x5'));var BPromise=require(_0x874b('0x6'));var Mustache=require(_0x874b('0x7'));var util=require(_0x874b('0x8'));var path=require(_0x874b('0x9'));var sox=require(_0x874b('0xa'));var csv=require(_0x874b('0xb'));var ejs=require(_0x874b('0xc'));var fs=require('fs');var fs_extra=require(_0x874b('0xd'));var _=require('lodash');var squel=require(_0x874b('0xe'));var crypto=require(_0x874b('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x874b('0x10'));var toCsv=require(_0x874b('0xb'));var querystring=require(_0x874b('0x11'));var Papa=require(_0x874b('0x12'));var AWS=require(_0x874b('0x13'));var uuidv4=require('uuid/v4');var Redis=require(_0x874b('0x14'));var authService=require(_0x874b('0x15'));var qs=require(_0x874b('0x16'));var as=require(_0x874b('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x874b('0x18'))(_0x874b('0x19'));var utils=require(_0x874b('0x1a'));var config=require(_0x874b('0x1b'));var licenseUtil=require(_0x874b('0x1c'));var db=require(_0x874b('0x1d'))['db'];function respondWithStatusCode(_0x5dc76f,_0x1a38f7){_0x1a38f7=_0x1a38f7||0xcc;return function(_0x49ddfc){if(_0x49ddfc){return _0x5dc76f[_0x874b('0x1e')](_0x1a38f7);}return _0x5dc76f[_0x874b('0x1f')](_0x1a38f7)[_0x874b('0x20')]();};}function respondWithResult(_0x59b0a6,_0x4c557a){_0x4c557a=_0x4c557a||0xc8;return function(_0x1f2160){if(_0x1f2160){return _0x59b0a6['status'](_0x4c557a)[_0x874b('0x21')](_0x1f2160);}};}function respondWithFilteredResult(_0x109a51,_0x23cb8c){return function(_0x4d4dba){if(_0x4d4dba){var _0x2c3e37=typeof _0x23cb8c[_0x874b('0x22')]===_0x874b('0x23')&&typeof _0x23cb8c[_0x874b('0x24')]===_0x874b('0x23');var _0x507261=_0x4d4dba[_0x874b('0x25')];var _0x88c457=_0x2c3e37?0x0:_0x23cb8c[_0x874b('0x22')];var _0x493da4=_0x2c3e37?_0x4d4dba['count']:_0x23cb8c[_0x874b('0x22')]+_0x23cb8c['limit'];var _0x54da35;if(_0x493da4>=_0x507261){_0x493da4=_0x507261;_0x54da35=0xc8;}else{_0x54da35=0xce;}_0x109a51[_0x874b('0x1f')](_0x54da35);return _0x109a51[_0x874b('0x26')](_0x874b('0x27'),_0x88c457+'-'+_0x493da4+'/'+_0x507261)[_0x874b('0x21')](_0x4d4dba);}return null;};}function patchUpdates(_0x28b74f){return function(_0x5c0160){try{jsonpatch['apply'](_0x5c0160,_0x28b74f,!![]);}catch(_0x5b1357){return BPromise['reject'](_0x5b1357);}return _0x5c0160[_0x874b('0x28')]();};}function saveUpdates(_0x1948c9,_0x2a7dc7){return function(_0x21545e){if(_0x21545e){return _0x21545e[_0x874b('0x29')](_0x1948c9)[_0x874b('0x2a')](function(_0x5db921){return _0x5db921;});}return null;};}function removeEntity(_0x555523,_0x1cb5ff){return function(_0x5c7ce0){if(_0x5c7ce0){return _0x5c7ce0[_0x874b('0x2b')]()['then'](function(){_0x555523['status'](0xcc)[_0x874b('0x20')]();});}};}function handleEntityNotFound(_0x48627b,_0x40a48c){return function(_0x4efb3e){if(!_0x4efb3e){_0x48627b[_0x874b('0x1e')](0x194);}return _0x4efb3e;};}function handleError(_0x320772,_0x317792){_0x317792=_0x317792||0x1f4;return function(_0x71fec4){logger[_0x874b('0x2c')](_0x71fec4[_0x874b('0x2d')]);if(_0x71fec4['name']){delete _0x71fec4[_0x874b('0x2e')];}_0x320772['status'](_0x317792)[_0x874b('0x2f')](_0x71fec4);};}exports[_0x874b('0x30')]=function(_0x349b64,_0x51c142){var _0x1d33aa={},_0x331111={},_0x19b9c3={'count':0x0,'rows':[]};var _0x2fdb58=_[_0x874b('0x31')](db[_0x874b('0x32')][_0x874b('0x33')],function(_0x9a894d){return{'name':_0x9a894d[_0x874b('0x34')],'type':_0x9a894d[_0x874b('0x35')][_0x874b('0x36')]};});_0x331111[_0x874b('0x37')]=_['differenceBy'](_[_0x874b('0x31')](_0x2fdb58,'name'),[_0x874b('0x38')]);_0x331111[_0x874b('0x39')]=_[_0x874b('0x3a')](_0x349b64[_0x874b('0x39')]);_0x331111[_0x874b('0x3b')]=_[_0x874b('0x3c')](_0x331111['model'],_0x331111[_0x874b('0x39')]);_0x1d33aa[_0x874b('0x3d')]=_['intersection'](_0x331111[_0x874b('0x37')],qs['fields'](_0x349b64[_0x874b('0x39')][_0x874b('0x3e')]));_0x1d33aa['attributes']=_0x1d33aa[_0x874b('0x3d')][_0x874b('0x3f')]?_0x1d33aa[_0x874b('0x3d')]:_0x331111[_0x874b('0x37')];if(!_0x349b64[_0x874b('0x39')]['hasOwnProperty'](_0x874b('0x40'))){_0x1d33aa['limit']=qs[_0x874b('0x24')](_0x349b64[_0x874b('0x39')][_0x874b('0x24')]);_0x1d33aa[_0x874b('0x22')]=qs[_0x874b('0x22')](_0x349b64[_0x874b('0x39')][_0x874b('0x22')]);}_0x1d33aa['order']=qs[_0x874b('0x41')](_0x349b64[_0x874b('0x39')][_0x874b('0x41')]);_0x1d33aa[_0x874b('0x42')]=qs[_0x874b('0x3b')](_[_0x874b('0x43')](_0x349b64[_0x874b('0x39')],_0x331111['filters']),_0x2fdb58);if(_0x349b64['query']['filter']){_0x1d33aa[_0x874b('0x42')]=_[_0x874b('0x44')](_0x1d33aa[_0x874b('0x42')],{'$or':_['map'](_0x2fdb58,function(_0x4cb8b7){if(_0x4cb8b7[_0x874b('0x35')]!=='VIRTUAL'){var _0x16acc0={};_0x16acc0[_0x4cb8b7['name']]={'$like':'%'+_0x349b64[_0x874b('0x39')][_0x874b('0x45')]+'%'};return _0x16acc0;}})});}_0x1d33aa=_['merge']({},_0x1d33aa,_0x349b64[_0x874b('0x46')]);var _0x3dd35b={'where':_0x1d33aa['where']};return db[_0x874b('0x32')][_0x874b('0x25')](_0x3dd35b)['then'](function(_0x1a7d55){_0x19b9c3[_0x874b('0x25')]=_0x1a7d55;if(_0x349b64['query'][_0x874b('0x47')]){_0x1d33aa[_0x874b('0x48')]=[{'all':!![]}];}return db[_0x874b('0x32')][_0x874b('0x49')](_0x1d33aa);})[_0x874b('0x2a')](function(_0x42b69c){_0x19b9c3['rows']=_0x42b69c;return _0x19b9c3;})[_0x874b('0x2a')](respondWithFilteredResult(_0x51c142,_0x1d33aa))['catch'](handleError(_0x51c142,null));};exports['show']=function(_0x4a7765,_0x10ab73){var _0x238c5d={'raw':![],'where':{'id':_0x4a7765[_0x874b('0x4a')]['id']}},_0x4c80f9={};_0x4c80f9[_0x874b('0x37')]=_[_0x874b('0x3a')](db[_0x874b('0x32')][_0x874b('0x33')]);_0x4c80f9[_0x874b('0x39')]=_[_0x874b('0x3a')](_0x4a7765[_0x874b('0x39')]);_0x4c80f9[_0x874b('0x3b')]=_[_0x874b('0x3c')](_0x4c80f9[_0x874b('0x37')],_0x4c80f9['query']);_0x238c5d[_0x874b('0x3d')]=_[_0x874b('0x3c')](_0x4c80f9[_0x874b('0x37')],qs[_0x874b('0x3e')](_0x4a7765['query'][_0x874b('0x3e')]));_0x238c5d[_0x874b('0x3d')]=_0x238c5d[_0x874b('0x3d')][_0x874b('0x3f')]?_0x238c5d[_0x874b('0x3d')]:_0x4c80f9[_0x874b('0x37')];if(_0x4a7765[_0x874b('0x39')]['includeAll']){_0x238c5d[_0x874b('0x48')]=[{'all':!![]}];}_0x238c5d=_[_0x874b('0x44')]({},_0x238c5d,_0x4a7765[_0x874b('0x46')]);return db[_0x874b('0x32')][_0x874b('0x4b')](_0x238c5d)[_0x874b('0x2a')](handleEntityNotFound(_0x10ab73,null))[_0x874b('0x2a')](respondWithResult(_0x10ab73,null))[_0x874b('0x4c')](handleError(_0x10ab73,null));};exports[_0x874b('0x4d')]=function(_0x5c8d8c,_0x2079ca){return db[_0x874b('0x32')][_0x874b('0x4d')](_0x5c8d8c[_0x874b('0x4e')],{})[_0x874b('0x2a')](respondWithResult(_0x2079ca,0xc9))[_0x874b('0x4c')](handleError(_0x2079ca,null));};exports[_0x874b('0x29')]=function(_0x178f23,_0x1a07ea){if(_0x178f23['body']['id']){delete _0x178f23[_0x874b('0x4e')]['id'];}return db['VoiceRecording']['find']({'where':{'id':_0x178f23[_0x874b('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1a07ea,null))[_0x874b('0x2a')](saveUpdates(_0x178f23[_0x874b('0x4e')],null))['then'](respondWithResult(_0x1a07ea,null))[_0x874b('0x4c')](handleError(_0x1a07ea,null));};exports[_0x874b('0x4f')]=function(_0x590261,_0x354204){return db[_0x874b('0x32')][_0x874b('0x4f')]()[_0x874b('0x2a')](respondWithResult(_0x354204,null))[_0x874b('0x4c')](handleError(_0x354204,null));};exports[_0x874b('0x50')]=function(_0x35530f,_0x28fa54,_0x4dc0df){var _0x3f7800=require('../../components/encryptor');var _0x346511=![];var _0x63979a={};if(_0x35530f[_0x874b('0x39')][_0x874b('0x35')]&&_0x35530f[_0x874b('0x39')][_0x874b('0x35')]==='uniqueid'){_0x63979a[_0x874b('0x51')]=_0x35530f[_0x874b('0x4a')]['id'];}else{_0x63979a['id']=_0x35530f[_0x874b('0x4a')]['id'];}return db['VoiceRecording'][_0x874b('0x4b')]({'where':_0x63979a,'attributes':['id',_0x874b('0x52')],'raw':!![]})[_0x874b('0x2a')](handleEntityNotFound(_0x28fa54,null))['then'](function(_0x7bdb89){if(_0x7bdb89){var _0x23040f=_0x7bdb89[_0x874b('0x52')];var _0x1fc7f4=util[_0x874b('0x38')](_0x874b('0x53'),_0x23040f);if(fs['existsSync'](_0x1fc7f4)){_0x346511=!![];return _0x3f7800[_0x874b('0x54')](_0x1fc7f4,_0x23040f,config[_0x874b('0x55')]['recording'])[_0x874b('0x2a')](function(){return _0x7bdb89;});}return _0x7bdb89;}})['then'](function(_0x5a98ff){if(_0x5a98ff){var _0x4aa6a6=_0x5a98ff[_0x874b('0x52')];if(!fs[_0x874b('0x56')](_0x4aa6a6)){throw new db[(_0x874b('0x57'))]['ValidationError'](_0x874b('0x58'));}if(_0x5a98ff[_0x874b('0x59')]){return _0x28fa54[_0x874b('0x50')](_0x4aa6a6,_0x5a98ff[_0x874b('0x59')]+path[_0x874b('0x5a')](_0x4aa6a6),function(){if(_0x346511){fs[_0x874b('0x5b')](_0x4aa6a6);}});}else{return _0x28fa54[_0x874b('0x50')](_0x4aa6a6,function(_0x3f1b4b){if(_0x346511){fs[_0x874b('0x5b')](_0x4aa6a6);}});}}})['catch'](function(_0x5e2b85){if(_0x5e2b85['message']===_0x874b('0x58')){_0x28fa54[_0x874b('0x1f')](0x194)[_0x874b('0x2f')](_0x874b('0x5c'));}else{return handleError(_0x28fa54,null);}});};exports['downloads']=function(_0x16e3e1,_0x165a5b,_0x4ca561){var _0x95fdc5=require(_0x874b('0x5d'));var _0x5eda74=![];var _0x5383df={'$and':[db[_0x874b('0x5e')][_0x874b('0x42')](db[_0x874b('0x5e')]['fn']('MD5',db[_0x874b('0x5e')][_0x874b('0x5f')](_0x874b('0x51'))),_0x16e3e1[_0x874b('0x39')][_0x874b('0x60')])]};if(_0x16e3e1[_0x874b('0x39')]['type']&&_0x16e3e1['query'][_0x874b('0x35')]===_0x874b('0x51')){_0x5383df['$and'][_0x874b('0x61')]({'uniqueid':_0x16e3e1[_0x874b('0x4a')]['id']});}else{_0x5383df[_0x874b('0x62')][_0x874b('0x61')]({'id':_0x16e3e1[_0x874b('0x4a')]['id']});}return db[_0x874b('0x32')][_0x874b('0x4b')]({'where':_0x5383df,'attributes':['id',_0x874b('0x52')],'raw':!![]})['then'](handleEntityNotFound(_0x165a5b,null))[_0x874b('0x2a')](function(_0x2bf841){if(_0x2bf841){var _0x1e1a8b=util[_0x874b('0x38')](_0x874b('0x53'),_0x2bf841['value']);if(fs['existsSync'](_0x1e1a8b)){_0x5eda74=!![];return _0x95fdc5[_0x874b('0x54')](_0x1e1a8b,_0x2bf841[_0x874b('0x52')],config[_0x874b('0x55')]['recording'])[_0x874b('0x2a')](function(){return _0x2bf841;});}return _0x2bf841;}})[_0x874b('0x2a')](function(_0x1d921f){if(_0x1d921f){if(!fs[_0x874b('0x56')](_0x1d921f[_0x874b('0x52')])){throw new db['Sequelize'][(_0x874b('0x63'))](_0x874b('0x58'));}if(_0x1d921f['filename']){return _0x165a5b[_0x874b('0x50')](_0x1d921f[_0x874b('0x52')],_0x1d921f[_0x874b('0x59')]+path[_0x874b('0x5a')](_0x1d921f[_0x874b('0x52')]),function(){if(_0x5eda74){fs[_0x874b('0x5b')](_0x1d921f[_0x874b('0x52')]);}});}else{return _0x165a5b[_0x874b('0x50')](_0x1d921f[_0x874b('0x52')],function(_0x4d8fbe){if(_0x5eda74){fs['unlink'](_0x1d921f[_0x874b('0x52')]);}});}}})['catch'](handleError(_0x165a5b,null));};exports[_0x874b('0x2b')]=function(_0x59e7e9,_0xfb39b6){return db[_0x874b('0x32')][_0x874b('0x4b')]({'where':{'id':_0x59e7e9[_0x874b('0x4a')]['id']}})[_0x874b('0x2a')](function(_0x2515ff){if(_['isNil'](_0x2515ff)){throw new ReferenceError(_0x874b('0x64'));}return _0x2515ff;})[_0x874b('0x2a')](function(_0x416ff2){var _0x1d1deb=_0x416ff2['value'];logger['info'](_0x874b('0x65'),_0x1d1deb);if(!_['isNil'](_0x416ff2[_0x874b('0x52')])&&fs[_0x874b('0x56')](_0x1d1deb)){logger[_0x874b('0x66')](_0x874b('0x67')+_0x1d1deb+_0x874b('0x68'));fs[_0x874b('0x69')](_0x1d1deb);}_0x1d1deb=_0x1d1deb+_0x874b('0x6a');if(!_[_0x874b('0x6b')](_0x416ff2[_0x874b('0x52')])&&fs['existsSync'](_0x1d1deb)){logger[_0x874b('0x66')](_0x874b('0x67')+_0x1d1deb+_0x874b('0x68'));fs[_0x874b('0x69')](_0x1d1deb);}return _0x416ff2;})[_0x874b('0x2a')](function(_0x44fd66){if(!_0x44fd66)throw new InternalError();return _0x44fd66[_0x874b('0x2b')]();})['then'](function(){_0xfb39b6['status'](0xcc)[_0x874b('0x20')]();})[_0x874b('0x4c')](handleError(_0xfb39b6,null));};function getBucketslist(_0x2b6f83,_0xe06a19,_0x83e1b4){return new Promise(function(_0x1dc289,_0xb6c76a){var _0x4364be=new AWS['S3']({'accessKeyId':_0xe06a19,'secretAccessKey':_0x2b6f83,'region':_0x83e1b4});_0x4364be['listBuckets']({},function(_0x5f5d14,_0x475305){if(_0x5f5d14){return _0xb6c76a(_0x5f5d14);}else{return _0x1dc289(_0x475305);}});});}function createBucket(_0x34084e,_0x130bb2,_0x25c890,_0x42ae0f){return new Promise(function(_0x4f8464,_0x1e9011){var _0x306215=new AWS['S3']({'accessKeyId':_0x130bb2,'secretAccessKey':_0x34084e,'region':_0x25c890});_0x306215['createBucket']({'Bucket':_0x42ae0f},function(_0x3edd77,_0x4e9063){if(_0x3edd77){return _0x1e9011(_0x3edd77);}else{return _0x4f8464(_0x4e9063);}});});}function uploadFile(_0x2b7d89,_0x4c0a28,_0x3f947e,_0x46495b,_0x3dcffc,_0x48b3ba){return new Promise(function(_0x423372,_0x1cbaa4){var _0x4cf241=new AWS['S3']({'accessKeyId':_0x4c0a28,'secretAccessKey':_0x2b7d89,'region':_0x3f947e});_0x4cf241['upload']({'Bucket':_0x46495b,'Key':_0x3dcffc,'Body':_0x48b3ba},function(_0x1150c7,_0x55beb3){if(_0x1150c7){return _0x1cbaa4(_0x1150c7);}else{return _0x423372(_0x55beb3);}});});}function startTranscribe(_0x11dc03,_0x2fb430,_0x4ff078,_0x32f3d8,_0xd9e3ae,_0x22c517){return new Promise(function(_0x49b047,_0x5002df){var _0x278fcc=new AWS['TranscribeService']({'accessKeyId':_0x2fb430,'secretAccessKey':_0x11dc03,'region':_0x4ff078});_0x278fcc['startTranscriptionJob']({'TranscriptionJobName':_0x32f3d8,'LanguageCode':_0xd9e3ae,'Media':{'MediaFileUri':_0x22c517}},function(_0x11ade2,_0x5a8f8c){if(_0x11ade2){return _0x5002df(_0x11ade2);}else{return _0x49b047(_0x5a8f8c);}});});}function transcribe(_0x511db9,_0x165c3a,_0x140df7,_0x58edd6,_0x53a4f2,_0x4809f1,_0x4d2bb4){return new Promise(function(_0x1245d7,_0x1176f2){var _0x48c75f={};logger[_0x874b('0x66')](util[_0x874b('0x38')](_0x874b('0x6c'),_0x511db9,_0x53a4f2));return uploadFile(_0x165c3a,_0x140df7,_0x58edd6,_0x53a4f2,path['basename'](_0x4809f1),fs[_0x874b('0x6d')](_0x4809f1))['then'](function(_0x41a0be){logger['info'](util[_0x874b('0x38')](_0x874b('0x6e'),_0x511db9,_0x53a4f2,_0x41a0be[_0x874b('0x6f')]));_0x48c75f[_0x874b('0x70')]=_0x41a0be[_0x874b('0x71')];_0x48c75f[_0x874b('0x72')]=_0x41a0be['Location'];logger[_0x874b('0x66')](util[_0x874b('0x38')](_0x874b('0x73'),_0x511db9));return startTranscribe(_0x165c3a,_0x140df7,_0x58edd6,uuidv4(),_0x4d2bb4,_0x41a0be[_0x874b('0x6f')]);})[_0x874b('0x2a')](function(_0x4f8e40){logger[_0x874b('0x66')](util[_0x874b('0x38')](_0x874b('0x74'),_0x511db9,_0x4f8e40['TranscriptionJob'][_0x874b('0x75')]));_0x48c75f[_0x874b('0x76')]=_0x4f8e40[_0x874b('0x77')][_0x874b('0x75')];_0x48c75f[_0x874b('0x78')]=_0x4f8e40[_0x874b('0x77')][_0x874b('0x79')];return _0x1245d7(_0x48c75f);})[_0x874b('0x4c')](function(_0x53f563){return _0x1176f2(_0x53f563);});});}exports[_0x874b('0x7a')]=function(_0x417e21,_0x5238c7,_0x36608c){var _0xcb14e2;var _0x266706;var _0x44a0b8;var _0x39d33a=require(_0x874b('0x5d'));return db[_0x874b('0x32')][_0x874b('0x7b')]({'where':{'id':_0x417e21[_0x874b('0x4a')]['id']}})['then'](function(_0x466c3c){if(_0x466c3c){var _0x2e2ce9=util[_0x874b('0x38')](_0x874b('0x53'),_0x466c3c[_0x874b('0x52')]);if(fs[_0x874b('0x56')](_0x2e2ce9)){cypher=!![];return _0x39d33a[_0x874b('0x54')](_0x2e2ce9,_0x466c3c[_0x874b('0x52')],config[_0x874b('0x55')][_0x874b('0x7c')])[_0x874b('0x2a')](function(){return _0x466c3c;});}return _0x466c3c;}})[_0x874b('0x2a')](function(_0x340f94){if(!_0x340f94){throw new db['Sequelize'][(_0x874b('0x63'))](_0x874b('0x7d'));}_0x266706=_0x340f94;return db[_0x874b('0x7e')][_0x874b('0x7b')]({'where':{'id':0x1}});})[_0x874b('0x2a')](handleEntityNotFound(_0x5238c7,null))['then'](function(_0x57f06e){if(_0x57f06e){_0xcb14e2=_0x57f06e;if(!_0xcb14e2['transcribe']||!_0xcb14e2[_0x874b('0x7f')]||!_0xcb14e2[_0x874b('0x80')]||!_0xcb14e2[_0x874b('0x81')]||!_0xcb14e2[_0x874b('0x70')]){throw new db[(_0x874b('0x57'))][(_0x874b('0x63'))](_0x874b('0x82'));}if(_0x417e21[_0x874b('0x4e')]['runSentiment']&&(!_0xcb14e2[_0x874b('0x83')]||!_0xcb14e2[_0x874b('0x84')]||!_0xcb14e2[_0x874b('0x85')]||!_0xcb14e2[_0x874b('0x81')]||!_0xcb14e2[_0x874b('0x70')])){throw new db['Sequelize']['ValidationError'](_0x874b('0x86'));}return db[_0x874b('0x87')][_0x874b('0x7b')]({'where':{'id':_0xcb14e2['transcribeAccountId']}});}})[_0x874b('0x2a')](function(_0x22ee3d){if(!_0x22ee3d){throw new db[(_0x874b('0x57'))][(_0x874b('0x63'))](_0x874b('0x88'));}if(!_0x22ee3d['data1']||!_0x22ee3d[_0x874b('0x89')]){throw new db[(_0x874b('0x57'))][(_0x874b('0x63'))](_0x874b('0x8a'));}_0x44a0b8=_0x22ee3d;return getBucketslist(_0x44a0b8['data1'],_0x44a0b8[_0x874b('0x89')],_0xcb14e2['transcribeRegion']);})[_0x874b('0x2a')](function(_0x2954a4){if(_0x2954a4&&_0x2954a4['Buckets']){var _0x347573=_[_0x874b('0x4b')](_0x2954a4[_0x874b('0x8b')],function(_0x5d6460){return _0x5d6460[_0x874b('0x8c')]===_0xcb14e2['bucket'];});if(!_0x347573){logger[_0x874b('0x66')](util[_0x874b('0x38')](_0x874b('0x8d'),_0x417e21[_0x874b('0x4a')]['id'],_0xcb14e2[_0x874b('0x70')]));return createBucket(_0x44a0b8[_0x874b('0x8e')],_0x44a0b8[_0x874b('0x89')],_0xcb14e2[_0x874b('0x80')],_0xcb14e2[_0x874b('0x70')]);}logger[_0x874b('0x66')](util[_0x874b('0x38')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x417e21['params']['id'],_0xcb14e2[_0x874b('0x70')]));return;}})[_0x874b('0x2a')](function(_0x4a9a47){if(_0x266706[_0x874b('0x78')]===_0x874b('0x8f')){return transcribe(_0x417e21['params']['id'],_0x44a0b8[_0x874b('0x8e')],_0x44a0b8[_0x874b('0x89')],_0xcb14e2[_0x874b('0x80')],_0xcb14e2[_0x874b('0x70')],_0x266706[_0x874b('0x52')],_0xcb14e2[_0x874b('0x81')]);}else{logger[_0x874b('0x66')](util[_0x874b('0x38')](_0x874b('0x90'),_0x417e21[_0x874b('0x4a')]['id']));return{'transcribeStatus':_0x874b('0x91')};}})['then'](function(_0x393cfe){if(_0x393cfe){_0x393cfe['tempSentiment']=_0x417e21[_0x874b('0x4e')][_0x874b('0x92')];return _0x266706['updateAttributes'](_0x393cfe);}})[_0x874b('0x2a')](respondWithResult(_0x5238c7,null))[_0x874b('0x4c')](handleError(_0x5238c7,null));};function writeFile(_0x5a3f32,_0x450bb4){return new Promise(function(_0x1ca4d5,_0x268f4c){fs[_0x874b('0x93')](_0x450bb4,_0x5a3f32,function(_0x6243a7,_0x44e973){if(_0x6243a7){return _0x268f4c(_0x6243a7);}else{return _0x1ca4d5(_0x44e973);}});});}exports[_0x874b('0x94')]=function(_0x42217f,_0x347e47,_0x12e7bf){return db[_0x874b('0x32')]['findOne']({'where':{'id':_0x42217f[_0x874b('0x4a')]['id']}})[_0x874b('0x2a')](handleEntityNotFound(_0x347e47))[_0x874b('0x2a')](function(_0x31da41){if(_0x31da41&&_0x31da41[_0x874b('0x95')]){var _0x2ea86f=_0x31da41['fileText'];var _0x2f8748=config['root']+_0x874b('0x96')+_0x31da41['id']+_0x874b('0x97');if(fs[_0x874b('0x56')](_0x2f8748)){return _0x2f8748;}return writeFile(_0x2ea86f,_0x2f8748)[_0x874b('0x2a')](function(){return _0x2f8748;});}else{throw new db[(_0x874b('0x57'))]['ValidationError'](_0x874b('0x98'));}})[_0x874b('0x2a')](function(_0x1744a2){return _0x347e47[_0x874b('0x50')](_0x1744a2);})['catch'](handleError(_0x347e47));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 4541cd7..5155191 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 _0x093f=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','VoiceRecording','voice_recordings','uniqueid'];(function(_0xdfdaf8,_0x16165f){var _0xfa0dc5=function(_0x1dd786){while(--_0x1dd786){_0xdfdaf8['push'](_0xdfdaf8['shift']());}};_0xfa0dc5(++_0x16165f);}(_0x093f,0xd2));var _0xf093=function(_0x19e5fe,_0x25a33a){_0x19e5fe=_0x19e5fe-0x0;var _0x33d1a3=_0x093f[_0x19e5fe];return _0x33d1a3;};'use strict';var _=require(_0xf093('0x0'));var util=require(_0xf093('0x1'));var logger=require(_0xf093('0x2'))(_0xf093('0x3'));var moment=require(_0xf093('0x4'));var BPromise=require(_0xf093('0x5'));var rp=require(_0xf093('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf093('0x7'));var config=require(_0xf093('0x8'));var attributes=require('./voiceRecording.attributes');module[_0xf093('0x9')]=function(_0x265810,_0x10dc05){return _0x265810[_0xf093('0xa')](_0xf093('0xb'),attributes,{'tableName':_0xf093('0xc'),'paranoid':![],'indexes':[{'name':_0xf093('0xd'),'fields':[_0xf093('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe9e9=['lodash','util','../../config/logger','api','bluebird','path','exports','define','VoiceRecording','voice_recordings','uniqueid'];(function(_0x538e67,_0x4f3006){var _0x1bcdce=function(_0x158b41){while(--_0x158b41){_0x538e67['push'](_0x538e67['shift']());}};_0x1bcdce(++_0x4f3006);}(_0xe9e9,0x1b8));var _0x9e9e=function(_0x4ff4e2,_0x1a398d){_0x4ff4e2=_0x4ff4e2-0x0;var _0x1f7212=_0xe9e9[_0x4ff4e2];return _0x1f7212;};'use strict';var _=require(_0x9e9e('0x0'));var util=require(_0x9e9e('0x1'));var logger=require(_0x9e9e('0x2'))(_0x9e9e('0x3'));var moment=require('moment');var BPromise=require(_0x9e9e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9e9e('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./voiceRecording.attributes');module[_0x9e9e('0x6')]=function(_0x91e933,_0x3ee8a3){return _0x91e933[_0x9e9e('0x7')](_0x9e9e('0x8'),attributes,{'tableName':_0x9e9e('0x9'),'paranoid':![],'indexes':[{'name':_0x9e9e('0xa'),'fields':[_0x9e9e('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 1532383..22bbea4 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 _0x4975=['catch','VoiceRecording','update','body','options','raw','where','limit','then','UpdateVoiceRecording','CreateVoiceRecording','create','value','format','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x81fe53,_0x5b8f05){var _0x56f7a7=function(_0x1e7846){while(--_0x1e7846){_0x81fe53['push'](_0x81fe53['shift']());}};_0x56f7a7(++_0x5b8f05);}(_0x4975,0x86));var _0x5497=function(_0x2e11a8,_0x4d8d31){_0x2e11a8=_0x2e11a8-0x0;var _0x523116=_0x4975[_0x2e11a8];return _0x523116;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('VoiceRecording,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});}exports['UpdateVoiceRecording']=function(_0x3f4d20){var _0x1bf442=this;return new Promise(function(_0x3a47fd,_0x5d9e24){return db[_0x5497('0x17')][_0x5497('0x18')](_0x3f4d20[_0x5497('0x19')],{'raw':_0x3f4d20[_0x5497('0x1a')]?_0x3f4d20[_0x5497('0x1a')][_0x5497('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f4d20[_0x5497('0x1a')]?_0x3f4d20[_0x5497('0x1a')][_0x5497('0x1c')]||null:null,'attributes':_0x3f4d20[_0x5497('0x1a')]?_0x3f4d20[_0x5497('0x1a')]['attributes']||null:null,'limit':_0x3f4d20[_0x5497('0x1a')]?_0x3f4d20['options'][_0x5497('0x1d')]||null:null})[_0x5497('0x1e')](function(_0x44265c){logger[_0x5497('0xd')](_0x5497('0x1f'),_0x3f4d20);logger[_0x5497('0x10')]('UpdateVoiceRecording',_0x3f4d20,JSON['stringify'](_0x44265c));_0x3a47fd(_0x44265c);})[_0x5497('0x16')](function(_0x34b97f){logger[_0x5497('0x13')](_0x5497('0x1f'),_0x34b97f['message'],_0x3f4d20);_0x5d9e24(_0x1bf442[_0x5497('0x13')](0x1f4,_0x34b97f['message']));});});};exports[_0x5497('0x20')]=function(_0x16a2b4){var _0x429d36=this;return new Promise(function(_0x34a1a5,_0x163a30){var _0x31cd01=require('../../components/encryptor');var _0x4af5f4;return db['Setting']['findOne']({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})[_0x5497('0x1e')](function(_0x48d146){_0x4af5f4=_0x48d146;return db['VoiceRecording'][_0x5497('0x21')](_0x16a2b4[_0x5497('0x19')]);})[_0x5497('0x1e')](function(_0x4c442a){if(_0x4af5f4['callRecordingEncryption']&&fs['existsSync'](_0x4c442a[_0x5497('0x22')])){var _0x471e0b=util[_0x5497('0x23')]('%s.cypher',_0x4c442a['value']);return _0x31cd01['encryptFile'](_0x4c442a[_0x5497('0x22')],_0x471e0b,config['secrets'][_0x5497('0x24')])[_0x5497('0x1e')](function(){fs[_0x5497('0x25')](_0x4c442a['value']);logger[_0x5497('0xd')](_0x5497('0x26'));return _0x4c442a;});}return _0x4c442a;})['then'](function(_0xce7cb2){logger[_0x5497('0xd')](_0x5497('0x20'),_0x16a2b4);logger['debug'](_0x5497('0x20'),_0x16a2b4,JSON[_0x5497('0x12')](_0xce7cb2));_0x34a1a5(_0xce7cb2);})[_0x5497('0x16')](function(_0x362b96){logger[_0x5497('0x13')]('CreateVoiceRecording',_0x362b96[_0x5497('0x14')],_0x16a2b4);_0x163a30(_0x429d36[_0x5497('0x13')](0x1f4,_0x362b96['message']));});});}; \ No newline at end of file +var _0x4137=['attributes','catch','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','then','VoiceRecording','existsSync','value','format','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceRecording,\x20%s,\x20%s','message','UpdateVoiceRecording','update','body','options','where'];(function(_0x1c461e,_0x1b98ff){var _0x1dce4f=function(_0x5cbdf0){while(--_0x5cbdf0){_0x1c461e['push'](_0x1c461e['shift']());}};_0x1dce4f(++_0x1b98ff);}(_0x4137,0xf8));var _0x7413=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x4137[_0x413feb];return _0x40ee88;};'use strict';var _=require(_0x7413('0x0'));var util=require(_0x7413('0x1'));var moment=require(_0x7413('0x2'));var BPromise=require(_0x7413('0x3'));var rs=require(_0x7413('0x4'));var fs=require('fs');var Redis=require(_0x7413('0x5'));var db=require(_0x7413('0x6'))['db'];var utils=require(_0x7413('0x7'));var logger=require(_0x7413('0x8'))(_0x7413('0x9'));var config=require(_0x7413('0xa'));var jayson=require(_0x7413('0xb'));var client=jayson['client'][_0x7413('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x188d89,_0x5b39ac,_0x15af0d){return new BPromise(function(_0x5f4cd0,_0x3236ec){return client[_0x7413('0xd')](_0x188d89,_0x15af0d)['then'](function(_0x422bf5){logger[_0x7413('0xe')]('VoiceRecording,\x20%s,\x20%s',_0x5b39ac,_0x7413('0xf'));logger[_0x7413('0x10')](_0x7413('0x11'),_0x5b39ac,_0x7413('0xf'),JSON[_0x7413('0x12')](_0x422bf5));if(_0x422bf5['error']){if(_0x422bf5[_0x7413('0x13')][_0x7413('0x14')]===0x1f4){logger['error'](_0x7413('0x15'),_0x5b39ac,_0x422bf5[_0x7413('0x13')][_0x7413('0x16')]);return _0x3236ec(_0x422bf5['error']['message']);}logger['error'](_0x7413('0x15'),_0x5b39ac,_0x422bf5[_0x7413('0x13')]['message']);return _0x5f4cd0(_0x422bf5[_0x7413('0x13')][_0x7413('0x16')]);}else{logger['info'](_0x7413('0x15'),_0x5b39ac,'request\x20sent');_0x5f4cd0(_0x422bf5['result'][_0x7413('0x16')]);}})['catch'](function(_0x195c72){logger['error'](_0x7413('0x15'),_0x5b39ac,_0x195c72);_0x3236ec(_0x195c72);});});}exports[_0x7413('0x17')]=function(_0x19157f){var _0x12a01e=this;return new Promise(function(_0x2a3417,_0x26dafe){return db['VoiceRecording'][_0x7413('0x18')](_0x19157f[_0x7413('0x19')],{'raw':_0x19157f[_0x7413('0x1a')]?_0x19157f[_0x7413('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19157f[_0x7413('0x1a')]?_0x19157f[_0x7413('0x1a')][_0x7413('0x1b')]||null:null,'attributes':_0x19157f[_0x7413('0x1a')]?_0x19157f[_0x7413('0x1a')][_0x7413('0x1c')]||null:null,'limit':_0x19157f[_0x7413('0x1a')]?_0x19157f[_0x7413('0x1a')]['limit']||null:null})['then'](function(_0x138508){logger['info'](_0x7413('0x17'),_0x19157f);logger[_0x7413('0x10')](_0x7413('0x17'),_0x19157f,JSON[_0x7413('0x12')](_0x138508));_0x2a3417(_0x138508);})[_0x7413('0x1d')](function(_0x346ce8){logger[_0x7413('0x13')](_0x7413('0x17'),_0x346ce8[_0x7413('0x16')],_0x19157f);_0x26dafe(_0x12a01e['error'](0x1f4,_0x346ce8['message']));});});};exports[_0x7413('0x1e')]=function(_0x48c2dc){var _0x46c895=this;return new Promise(function(_0x71cbb4,_0x463b21){var _0x4c2e90=require(_0x7413('0x1f'));var _0x896552;return db[_0x7413('0x20')][_0x7413('0x21')]({'attributes':['id',_0x7413('0x22')],'where':{'id':0x1},'raw':!![]})[_0x7413('0x23')](function(_0x5eb4d9){_0x896552=_0x5eb4d9;return db[_0x7413('0x24')]['create'](_0x48c2dc[_0x7413('0x19')]);})[_0x7413('0x23')](function(_0xae2969){if(_0x896552[_0x7413('0x22')]&&fs[_0x7413('0x25')](_0xae2969[_0x7413('0x26')])){var _0x5bb3ea=util[_0x7413('0x27')](_0x7413('0x28'),_0xae2969[_0x7413('0x26')]);return _0x4c2e90[_0x7413('0x29')](_0xae2969[_0x7413('0x26')],_0x5bb3ea,config[_0x7413('0x2a')][_0x7413('0x2b')])['then'](function(){fs[_0x7413('0x2c')](_0xae2969[_0x7413('0x26')]);logger[_0x7413('0xe')](_0x7413('0x2d'));return _0xae2969;});}return _0xae2969;})[_0x7413('0x23')](function(_0x51d676){logger[_0x7413('0xe')]('CreateVoiceRecording',_0x48c2dc);logger[_0x7413('0x10')](_0x7413('0x1e'),_0x48c2dc,JSON[_0x7413('0x12')](_0x51d676));_0x71cbb4(_0x51d676);})['catch'](function(_0xe6b096){logger['error'](_0x7413('0x1e'),_0xe6b096[_0x7413('0x16')],_0x48c2dc);_0x463b21(_0x46c895['error'](0x1f4,_0xe6b096['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 9aca0ea..16c42aa 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 _0x6219=['../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','/describe','describe','create','/:id','update','delete','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x5f3575,_0x443623){var _0x45730f=function(_0x5d66ec){while(--_0x5d66ec){_0x5f3575['push'](_0x5f3575['shift']());}};_0x45730f(++_0x443623);}(_0x6219,0xb7));var _0x9621=function(_0x120123,_0x4eff59){_0x120123=_0x120123-0x0;var _0x3bec4c=_0x6219[_0x120123];return _0x3bec4c;};'use strict';var multer=require(_0x9621('0x0'));var util=require(_0x9621('0x1'));var path=require(_0x9621('0x2'));var timeout=require(_0x9621('0x3'));var express=require(_0x9621('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9621('0x5'));var interaction=require(_0x9621('0x6'));var config=require(_0x9621('0x7'));var controller=require(_0x9621('0x8'));router[_0x9621('0x9')]('/',auth[_0x9621('0xa')](),controller[_0x9621('0xb')]);router[_0x9621('0x9')](_0x9621('0xc'),auth['isAuthenticated'](),controller[_0x9621('0xd')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x9621('0xe')]);router['put'](_0x9621('0xf'),auth[_0x9621('0xa')](),controller[_0x9621('0x10')]);router[_0x9621('0x11')]('/:id',auth[_0x9621('0xa')](),controller['destroy']);module[_0x9621('0x12')]=router; \ No newline at end of file +var _0x3fde=['path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','/describe','describe','show','post','put','update','delete','destroy','exports','multer','util'];(function(_0x2c0d31,_0x4ae036){var _0x5e92b3=function(_0x3d5577){while(--_0x3d5577){_0x2c0d31['push'](_0x2c0d31['shift']());}};_0x5e92b3(++_0x4ae036);}(_0x3fde,0x1e1));var _0xe3fd=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3fde[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xe3fd('0x0'));var util=require(_0xe3fd('0x1'));var path=require(_0xe3fd('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe3fd('0x3')]();var fs_extra=require(_0xe3fd('0x4'));var auth=require(_0xe3fd('0x5'));var interaction=require(_0xe3fd('0x6'));var config=require(_0xe3fd('0x7'));var controller=require(_0xe3fd('0x8'));router[_0xe3fd('0x9')]('/',auth[_0xe3fd('0xa')](),controller[_0xe3fd('0xb')]);router[_0xe3fd('0x9')](_0xe3fd('0xc'),auth[_0xe3fd('0xa')](),controller[_0xe3fd('0xd')]);router[_0xe3fd('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe3fd('0xe')]);router[_0xe3fd('0xf')]('/',auth[_0xe3fd('0xa')](),controller['create']);router[_0xe3fd('0x10')]('/:id',auth[_0xe3fd('0xa')](),controller[_0xe3fd('0x11')]);router[_0xe3fd('0x12')]('/:id',auth[_0xe3fd('0xa')](),controller[_0xe3fd('0x13')]);module[_0xe3fd('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index dcd2bd2..dd53d25 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 _0x481f=['sequelize','moment','exports','blind','attended','STRING','ENUM','Yes'];(function(_0x3fba9f,_0x3b7b9b){var _0x192cf1=function(_0x557290){while(--_0x557290){_0x3fba9f['push'](_0x3fba9f['shift']());}};_0x192cf1(++_0x3b7b9b);}(_0x481f,0x1a0));var _0xf481=function(_0x204720,_0x5da77a){_0x204720=_0x204720-0x0;var _0x4bd59d=_0x481f[_0x204720];return _0x4bd59d;};'use strict';var Sequelize=require(_0xf481('0x0'));var moment=require(_0xf481('0x1'));module[_0xf481('0x2')]={'type':{'type':Sequelize['ENUM'](_0xf481('0x3'),_0xf481('0x4'))},'result':{'type':Sequelize[_0xf481('0x5')]},'transfererchannel':{'type':Sequelize[_0xf481('0x5')]},'transferercalleridnum':{'type':Sequelize[_0xf481('0x5')]},'transferercalleridname':{'type':Sequelize[_0xf481('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0xf481('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0xf481('0x5')]},'transfereraccountcode':{'type':Sequelize[_0xf481('0x5')]},'transferercontext':{'type':Sequelize[_0xf481('0x5')]},'transfererexten':{'type':Sequelize[_0xf481('0x5')]},'transfererlinkedid':{'type':Sequelize[_0xf481('0x5')]},'transfereechannel':{'type':Sequelize[_0xf481('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0xf481('0x5')]},'transfereecalleridname':{'type':Sequelize[_0xf481('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xf481('0x5')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0xf481('0x5')]},'transfereecontext':{'type':Sequelize[_0xf481('0x5')]},'transfereeexten':{'type':Sequelize[_0xf481('0x5')]},'transfereelinkedid':{'type':Sequelize[_0xf481('0x5')]},'isexternal':{'type':Sequelize[_0xf481('0x6')](_0xf481('0x7'),'No')},'context':{'type':Sequelize[_0xf481('0x5')]},'extension':{'type':Sequelize[_0xf481('0x5')]}}; \ No newline at end of file +var _0x595e=['moment','exports','ENUM','blind','STRING','Yes','sequelize'];(function(_0x54c913,_0x3b9057){var _0x4fd1aa=function(_0x40f435){while(--_0x40f435){_0x54c913['push'](_0x54c913['shift']());}};_0x4fd1aa(++_0x3b9057);}(_0x595e,0x1db));var _0xe595=function(_0x224d7b,_0x229565){_0x224d7b=_0x224d7b-0x0;var _0x281487=_0x595e[_0x224d7b];return _0x281487;};'use strict';var Sequelize=require(_0xe595('0x0'));var moment=require(_0xe595('0x1'));module[_0xe595('0x2')]={'type':{'type':Sequelize[_0xe595('0x3')](_0xe595('0x4'),'attended')},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0xe595('0x5')]},'transferercalleridnum':{'type':Sequelize[_0xe595('0x5')]},'transferercalleridname':{'type':Sequelize[_0xe595('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0xe595('0x5')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0xe595('0x5')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0xe595('0x5')]},'transfererlinkedid':{'type':Sequelize[_0xe595('0x5')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0xe595('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xe595('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0xe595('0x5')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0xe595('0x5')]},'transfereeexten':{'type':Sequelize[_0xe595('0x5')]},'transfereelinkedid':{'type':Sequelize[_0xe595('0x5')]},'isexternal':{'type':Sequelize[_0xe595('0x3')](_0xe595('0x6'),'No')},'context':{'type':Sequelize[_0xe595('0x5')]},'extension':{'type':Sequelize[_0xe595('0x5')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 44e09f6..420244d 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 _0x4b59=['filters','pick','filter','merge','VIRTUAL','options','VoiceTransferReport','then','includeAll','include','findAll','rows','catch','show','length','create','body','find','params','describe','rimraf','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','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','type','key','map','query','keys','intersection','model','fields','attributes','hasOwnProperty','order','sort','where'];(function(_0x5af59e,_0x3771c1){var _0x4240df=function(_0x2267fd){while(--_0x2267fd){_0x5af59e['push'](_0x5af59e['shift']());}};_0x4240df(++_0x3771c1);}(_0x4b59,0x160));var _0x94b5=function(_0x5465e6,_0x2a8809){_0x5465e6=_0x5465e6-0x0;var _0x10044e=_0x4b59[_0x5465e6];return _0x10044e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x94b5('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x94b5('0x1'));var rp=require(_0x94b5('0x2'));var moment=require(_0x94b5('0x3'));var BPromise=require(_0x94b5('0x4'));var Mustache=require(_0x94b5('0x5'));var util=require(_0x94b5('0x6'));var path=require(_0x94b5('0x7'));var sox=require(_0x94b5('0x8'));var csv=require('to-csv');var ejs=require(_0x94b5('0x9'));var fs=require('fs');var fs_extra=require(_0x94b5('0xa'));var _=require(_0x94b5('0xb'));var squel=require(_0x94b5('0xc'));var crypto=require(_0x94b5('0xd'));var jsforce=require(_0x94b5('0xe'));var deskjs=require(_0x94b5('0xf'));var toCsv=require(_0x94b5('0x10'));var querystring=require(_0x94b5('0x11'));var Papa=require(_0x94b5('0x12'));var Redis=require('ioredis');var authService=require(_0x94b5('0x13'));var qs=require(_0x94b5('0x14'));var as=require(_0x94b5('0x15'));var hardwareService=require(_0x94b5('0x16'));var logger=require(_0x94b5('0x17'))('api');var utils=require(_0x94b5('0x18'));var config=require(_0x94b5('0x19'));var licenseUtil=require(_0x94b5('0x1a'));var db=require(_0x94b5('0x1b'))['db'];function respondWithStatusCode(_0x27e4f8,_0x430fd4){_0x430fd4=_0x430fd4||0xcc;return function(_0x30f464){if(_0x30f464){return _0x27e4f8['sendStatus'](_0x430fd4);}return _0x27e4f8[_0x94b5('0x1c')](_0x430fd4)[_0x94b5('0x1d')]();};}function respondWithResult(_0x78ac8a,_0x16000b){_0x16000b=_0x16000b||0xc8;return function(_0xc9b39f){if(_0xc9b39f){return _0x78ac8a[_0x94b5('0x1c')](_0x16000b)[_0x94b5('0x1e')](_0xc9b39f);}};}function respondWithFilteredResult(_0x7849f7,_0x275f13){return function(_0x2b36f5){if(_0x2b36f5){var _0x173bc4=typeof _0x275f13[_0x94b5('0x1f')]===_0x94b5('0x20')&&typeof _0x275f13['limit']===_0x94b5('0x20');var _0x1403a6=_0x2b36f5[_0x94b5('0x21')];var _0x1716ac=_0x173bc4?0x0:_0x275f13['offset'];var _0x397580=_0x173bc4?_0x2b36f5[_0x94b5('0x21')]:_0x275f13[_0x94b5('0x1f')]+_0x275f13[_0x94b5('0x22')];var _0x599c1b;if(_0x397580>=_0x1403a6){_0x397580=_0x1403a6;_0x599c1b=0xc8;}else{_0x599c1b=0xce;}_0x7849f7['status'](_0x599c1b);return _0x7849f7[_0x94b5('0x23')](_0x94b5('0x24'),_0x1716ac+'-'+_0x397580+'/'+_0x1403a6)[_0x94b5('0x1e')](_0x2b36f5);}return null;};}function patchUpdates(_0x580206){return function(_0x2b52d8){try{jsonpatch[_0x94b5('0x25')](_0x2b52d8,_0x580206,!![]);}catch(_0x27e4a0){return BPromise[_0x94b5('0x26')](_0x27e4a0);}return _0x2b52d8[_0x94b5('0x27')]();};}function saveUpdates(_0x141a4b,_0x1eb8ab){return function(_0x2a80e6){if(_0x2a80e6){return _0x2a80e6[_0x94b5('0x28')](_0x141a4b)['then'](function(_0xe341e4){return _0xe341e4;});}return null;};}function removeEntity(_0x3e5660,_0x2ca4a3){return function(_0x37406a){if(_0x37406a){return _0x37406a[_0x94b5('0x29')]()['then'](function(){_0x3e5660['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xdd0768,_0x4a4fda){return function(_0x437bc2){if(!_0x437bc2){_0xdd0768[_0x94b5('0x2a')](0x194);}return _0x437bc2;};}function handleError(_0x39e0be,_0x34cb9d){_0x34cb9d=_0x34cb9d||0x1f4;return function(_0x3645f1){logger[_0x94b5('0x2b')](_0x3645f1[_0x94b5('0x2c')]);if(_0x3645f1[_0x94b5('0x2d')]){delete _0x3645f1[_0x94b5('0x2d')];}_0x39e0be[_0x94b5('0x1c')](_0x34cb9d)[_0x94b5('0x2e')](_0x3645f1);};}exports[_0x94b5('0x2f')]=function(_0x1fe5ee,_0x238138){var _0x2bf755={},_0x4c425b={},_0x5668e1={'count':0x0,'rows':[]};var _0x1209ad=_['map'](db['VoiceTransferReport'][_0x94b5('0x30')],function(_0x198d32){return{'name':_0x198d32[_0x94b5('0x31')],'type':_0x198d32[_0x94b5('0x32')][_0x94b5('0x33')]};});_0x4c425b['model']=_[_0x94b5('0x34')](_0x1209ad,_0x94b5('0x2d'));_0x4c425b[_0x94b5('0x35')]=_[_0x94b5('0x36')](_0x1fe5ee[_0x94b5('0x35')]);_0x4c425b['filters']=_[_0x94b5('0x37')](_0x4c425b[_0x94b5('0x38')],_0x4c425b['query']);_0x2bf755['attributes']=_['intersection'](_0x4c425b['model'],qs['fields'](_0x1fe5ee[_0x94b5('0x35')][_0x94b5('0x39')]));_0x2bf755[_0x94b5('0x3a')]=_0x2bf755['attributes']['length']?_0x2bf755['attributes']:_0x4c425b[_0x94b5('0x38')];if(!_0x1fe5ee[_0x94b5('0x35')][_0x94b5('0x3b')]('nolimit')){_0x2bf755[_0x94b5('0x22')]=qs['limit'](_0x1fe5ee[_0x94b5('0x35')][_0x94b5('0x22')]);_0x2bf755[_0x94b5('0x1f')]=qs['offset'](_0x1fe5ee[_0x94b5('0x35')]['offset']);}_0x2bf755[_0x94b5('0x3c')]=qs[_0x94b5('0x3d')](_0x1fe5ee[_0x94b5('0x35')][_0x94b5('0x3d')]);_0x2bf755[_0x94b5('0x3e')]=qs[_0x94b5('0x3f')](_[_0x94b5('0x40')](_0x1fe5ee[_0x94b5('0x35')],_0x4c425b[_0x94b5('0x3f')]),_0x1209ad);if(_0x1fe5ee[_0x94b5('0x35')][_0x94b5('0x41')]){_0x2bf755['where']=_[_0x94b5('0x42')](_0x2bf755[_0x94b5('0x3e')],{'$or':_['map'](_0x1209ad,function(_0x5d4879){if(_0x5d4879['type']!==_0x94b5('0x43')){var _0x3b4247={};_0x3b4247[_0x5d4879[_0x94b5('0x2d')]]={'$like':'%'+_0x1fe5ee[_0x94b5('0x35')][_0x94b5('0x41')]+'%'};return _0x3b4247;}})});}_0x2bf755=_[_0x94b5('0x42')]({},_0x2bf755,_0x1fe5ee[_0x94b5('0x44')]);var _0x2e6353={'where':_0x2bf755[_0x94b5('0x3e')]};return db[_0x94b5('0x45')][_0x94b5('0x21')](_0x2e6353)[_0x94b5('0x46')](function(_0x2f37b7){_0x5668e1[_0x94b5('0x21')]=_0x2f37b7;if(_0x1fe5ee[_0x94b5('0x35')][_0x94b5('0x47')]){_0x2bf755[_0x94b5('0x48')]=[{'all':!![]}];}return db[_0x94b5('0x45')][_0x94b5('0x49')](_0x2bf755);})[_0x94b5('0x46')](function(_0x2ba3e1){_0x5668e1[_0x94b5('0x4a')]=_0x2ba3e1;return _0x5668e1;})[_0x94b5('0x46')](respondWithFilteredResult(_0x238138,_0x2bf755))[_0x94b5('0x4b')](handleError(_0x238138,null));};exports[_0x94b5('0x4c')]=function(_0x573a99,_0x2c38a7){var _0x2d7b66={'raw':!![],'where':{'id':_0x573a99['params']['id']}},_0x1e0e7c={};_0x1e0e7c[_0x94b5('0x38')]=_['keys'](db[_0x94b5('0x45')][_0x94b5('0x30')]);_0x1e0e7c[_0x94b5('0x35')]=_[_0x94b5('0x36')](_0x573a99['query']);_0x1e0e7c[_0x94b5('0x3f')]=_[_0x94b5('0x37')](_0x1e0e7c[_0x94b5('0x38')],_0x1e0e7c[_0x94b5('0x35')]);_0x2d7b66[_0x94b5('0x3a')]=_[_0x94b5('0x37')](_0x1e0e7c[_0x94b5('0x38')],qs['fields'](_0x573a99['query'][_0x94b5('0x39')]));_0x2d7b66[_0x94b5('0x3a')]=_0x2d7b66['attributes'][_0x94b5('0x4d')]?_0x2d7b66[_0x94b5('0x3a')]:_0x1e0e7c[_0x94b5('0x38')];if(_0x573a99[_0x94b5('0x35')][_0x94b5('0x47')]){_0x2d7b66[_0x94b5('0x48')]=[{'all':!![]}];}_0x2d7b66=_[_0x94b5('0x42')]({},_0x2d7b66,_0x573a99[_0x94b5('0x44')]);return db[_0x94b5('0x45')]['find'](_0x2d7b66)[_0x94b5('0x46')](handleEntityNotFound(_0x2c38a7,null))['then'](respondWithResult(_0x2c38a7,null))[_0x94b5('0x4b')](handleError(_0x2c38a7,null));};exports[_0x94b5('0x4e')]=function(_0x118778,_0x492764){return db['VoiceTransferReport'][_0x94b5('0x4e')](_0x118778[_0x94b5('0x4f')],{})['then'](respondWithResult(_0x492764,0xc9))[_0x94b5('0x4b')](handleError(_0x492764,null));};exports[_0x94b5('0x28')]=function(_0x29bd4a,_0x379c48){if(_0x29bd4a[_0x94b5('0x4f')]['id']){delete _0x29bd4a['body']['id'];}return db['VoiceTransferReport'][_0x94b5('0x50')]({'where':{'id':_0x29bd4a[_0x94b5('0x51')]['id']}})[_0x94b5('0x46')](handleEntityNotFound(_0x379c48,null))['then'](saveUpdates(_0x29bd4a['body'],null))['then'](respondWithResult(_0x379c48,null))['catch'](handleError(_0x379c48,null));};exports['destroy']=function(_0x29d35a,_0x412a38){return db[_0x94b5('0x45')][_0x94b5('0x50')]({'where':{'id':_0x29d35a['params']['id']}})[_0x94b5('0x46')](handleEntityNotFound(_0x412a38,null))[_0x94b5('0x46')](removeEntity(_0x412a38,null))['catch'](handleError(_0x412a38,null));};exports[_0x94b5('0x52')]=function(_0xc7116b,_0x77a1b2){return db[_0x94b5('0x45')][_0x94b5('0x52')]()['then'](respondWithResult(_0x77a1b2,null))['catch'](handleError(_0x77a1b2,null));}; \ No newline at end of file +var _0xcd38=['set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','name','send','index','VoiceTransferReport','rawAttributes','key','model','map','query','keys','intersection','attributes','fields','order','sort','pick','filter','where','type','options','include','findAll','rows','catch','show','length','includeAll','create','body','find','params','describe','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit'];(function(_0x41c99a,_0x12414d){var _0x303bf9=function(_0x219646){while(--_0x219646){_0x41c99a['push'](_0x41c99a['shift']());}};_0x303bf9(++_0x12414d);}(_0xcd38,0x6e));var _0x8cd3=function(_0x418034,_0x502ddf){_0x418034=_0x418034-0x0;var _0x2cbca1=_0xcd38[_0x418034];return _0x2cbca1;};'use strict';var emlformat=require(_0x8cd3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8cd3('0x1'));var jsonpatch=require(_0x8cd3('0x2'));var rp=require('request-promise');var moment=require(_0x8cd3('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x8cd3('0x4'));var util=require(_0x8cd3('0x5'));var path=require(_0x8cd3('0x6'));var sox=require(_0x8cd3('0x7'));var csv=require(_0x8cd3('0x8'));var ejs=require(_0x8cd3('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8cd3('0xa'));var crypto=require(_0x8cd3('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x8cd3('0xc'));var toCsv=require(_0x8cd3('0x8'));var querystring=require(_0x8cd3('0xd'));var Papa=require(_0x8cd3('0xe'));var Redis=require(_0x8cd3('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8cd3('0x10'));var logger=require('../../config/logger')(_0x8cd3('0x11'));var utils=require('../../config/utils');var config=require(_0x8cd3('0x12'));var licenseUtil=require(_0x8cd3('0x13'));var db=require(_0x8cd3('0x14'))['db'];function respondWithStatusCode(_0x2a0d8b,_0x2a42cd){_0x2a42cd=_0x2a42cd||0xcc;return function(_0x4cdf96){if(_0x4cdf96){return _0x2a0d8b['sendStatus'](_0x2a42cd);}return _0x2a0d8b[_0x8cd3('0x15')](_0x2a42cd)[_0x8cd3('0x16')]();};}function respondWithResult(_0x166d72,_0x33c2bd){_0x33c2bd=_0x33c2bd||0xc8;return function(_0x1ef1e6){if(_0x1ef1e6){return _0x166d72[_0x8cd3('0x15')](_0x33c2bd)[_0x8cd3('0x17')](_0x1ef1e6);}};}function respondWithFilteredResult(_0x5849cc,_0x536ef4){return function(_0x33ce47){if(_0x33ce47){var _0x4a3069=typeof _0x536ef4[_0x8cd3('0x18')]===_0x8cd3('0x19')&&typeof _0x536ef4['limit']===_0x8cd3('0x19');var _0x442b18=_0x33ce47[_0x8cd3('0x1a')];var _0x1ed6a1=_0x4a3069?0x0:_0x536ef4[_0x8cd3('0x18')];var _0x506b6f=_0x4a3069?_0x33ce47[_0x8cd3('0x1a')]:_0x536ef4[_0x8cd3('0x18')]+_0x536ef4[_0x8cd3('0x1b')];var _0x38b498;if(_0x506b6f>=_0x442b18){_0x506b6f=_0x442b18;_0x38b498=0xc8;}else{_0x38b498=0xce;}_0x5849cc[_0x8cd3('0x15')](_0x38b498);return _0x5849cc[_0x8cd3('0x1c')](_0x8cd3('0x1d'),_0x1ed6a1+'-'+_0x506b6f+'/'+_0x442b18)[_0x8cd3('0x17')](_0x33ce47);}return null;};}function patchUpdates(_0x401241){return function(_0x1bd0c4){try{jsonpatch[_0x8cd3('0x1e')](_0x1bd0c4,_0x401241,!![]);}catch(_0x3624cf){return BPromise[_0x8cd3('0x1f')](_0x3624cf);}return _0x1bd0c4[_0x8cd3('0x20')]();};}function saveUpdates(_0x2af0e0,_0x1d3838){return function(_0x51a488){if(_0x51a488){return _0x51a488[_0x8cd3('0x21')](_0x2af0e0)['then'](function(_0x20713e){return _0x20713e;});}return null;};}function removeEntity(_0x12779b,_0xcd888b){return function(_0x3357d3){if(_0x3357d3){return _0x3357d3[_0x8cd3('0x22')]()[_0x8cd3('0x23')](function(){_0x12779b[_0x8cd3('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x108ac4,_0x4ccd5a){return function(_0x4e8e3a){if(!_0x4e8e3a){_0x108ac4[_0x8cd3('0x24')](0x194);}return _0x4e8e3a;};}function handleError(_0x4bb52e,_0x4513bf){_0x4513bf=_0x4513bf||0x1f4;return function(_0x2ccc42){logger['error'](_0x2ccc42['stack']);if(_0x2ccc42[_0x8cd3('0x25')]){delete _0x2ccc42[_0x8cd3('0x25')];}_0x4bb52e[_0x8cd3('0x15')](_0x4513bf)[_0x8cd3('0x26')](_0x2ccc42);};}exports[_0x8cd3('0x27')]=function(_0xdbd6a9,_0x1201ae){var _0x463f67={},_0x4476ca={},_0xc8e349={'count':0x0,'rows':[]};var _0xa0abdd=_['map'](db[_0x8cd3('0x28')][_0x8cd3('0x29')],function(_0x5a92f4){return{'name':_0x5a92f4['fieldName'],'type':_0x5a92f4['type'][_0x8cd3('0x2a')]};});_0x4476ca[_0x8cd3('0x2b')]=_[_0x8cd3('0x2c')](_0xa0abdd,_0x8cd3('0x25'));_0x4476ca[_0x8cd3('0x2d')]=_[_0x8cd3('0x2e')](_0xdbd6a9[_0x8cd3('0x2d')]);_0x4476ca['filters']=_[_0x8cd3('0x2f')](_0x4476ca['model'],_0x4476ca['query']);_0x463f67[_0x8cd3('0x30')]=_['intersection'](_0x4476ca['model'],qs['fields'](_0xdbd6a9['query'][_0x8cd3('0x31')]));_0x463f67[_0x8cd3('0x30')]=_0x463f67[_0x8cd3('0x30')]['length']?_0x463f67[_0x8cd3('0x30')]:_0x4476ca[_0x8cd3('0x2b')];if(!_0xdbd6a9[_0x8cd3('0x2d')]['hasOwnProperty']('nolimit')){_0x463f67[_0x8cd3('0x1b')]=qs[_0x8cd3('0x1b')](_0xdbd6a9[_0x8cd3('0x2d')]['limit']);_0x463f67[_0x8cd3('0x18')]=qs['offset'](_0xdbd6a9['query'][_0x8cd3('0x18')]);}_0x463f67[_0x8cd3('0x32')]=qs[_0x8cd3('0x33')](_0xdbd6a9[_0x8cd3('0x2d')][_0x8cd3('0x33')]);_0x463f67['where']=qs['filters'](_[_0x8cd3('0x34')](_0xdbd6a9[_0x8cd3('0x2d')],_0x4476ca['filters']),_0xa0abdd);if(_0xdbd6a9[_0x8cd3('0x2d')][_0x8cd3('0x35')]){_0x463f67[_0x8cd3('0x36')]=_['merge'](_0x463f67[_0x8cd3('0x36')],{'$or':_['map'](_0xa0abdd,function(_0x25784f){if(_0x25784f[_0x8cd3('0x37')]!=='VIRTUAL'){var _0x4c77a2={};_0x4c77a2[_0x25784f[_0x8cd3('0x25')]]={'$like':'%'+_0xdbd6a9[_0x8cd3('0x2d')][_0x8cd3('0x35')]+'%'};return _0x4c77a2;}})});}_0x463f67=_['merge']({},_0x463f67,_0xdbd6a9[_0x8cd3('0x38')]);var _0x3c5740={'where':_0x463f67[_0x8cd3('0x36')]};return db[_0x8cd3('0x28')][_0x8cd3('0x1a')](_0x3c5740)['then'](function(_0x1fd443){_0xc8e349[_0x8cd3('0x1a')]=_0x1fd443;if(_0xdbd6a9[_0x8cd3('0x2d')]['includeAll']){_0x463f67[_0x8cd3('0x39')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0x8cd3('0x3a')](_0x463f67);})[_0x8cd3('0x23')](function(_0x4e3b5f){_0xc8e349[_0x8cd3('0x3b')]=_0x4e3b5f;return _0xc8e349;})[_0x8cd3('0x23')](respondWithFilteredResult(_0x1201ae,_0x463f67))[_0x8cd3('0x3c')](handleError(_0x1201ae,null));};exports[_0x8cd3('0x3d')]=function(_0x3e3161,_0x4f9ae5){var _0xa4c9db={'raw':!![],'where':{'id':_0x3e3161['params']['id']}},_0x57987d={};_0x57987d[_0x8cd3('0x2b')]=_[_0x8cd3('0x2e')](db[_0x8cd3('0x28')][_0x8cd3('0x29')]);_0x57987d['query']=_[_0x8cd3('0x2e')](_0x3e3161[_0x8cd3('0x2d')]);_0x57987d['filters']=_[_0x8cd3('0x2f')](_0x57987d['model'],_0x57987d['query']);_0xa4c9db[_0x8cd3('0x30')]=_[_0x8cd3('0x2f')](_0x57987d[_0x8cd3('0x2b')],qs[_0x8cd3('0x31')](_0x3e3161['query'][_0x8cd3('0x31')]));_0xa4c9db[_0x8cd3('0x30')]=_0xa4c9db[_0x8cd3('0x30')][_0x8cd3('0x3e')]?_0xa4c9db[_0x8cd3('0x30')]:_0x57987d['model'];if(_0x3e3161[_0x8cd3('0x2d')][_0x8cd3('0x3f')]){_0xa4c9db[_0x8cd3('0x39')]=[{'all':!![]}];}_0xa4c9db=_['merge']({},_0xa4c9db,_0x3e3161[_0x8cd3('0x38')]);return db[_0x8cd3('0x28')]['find'](_0xa4c9db)['then'](handleEntityNotFound(_0x4f9ae5,null))['then'](respondWithResult(_0x4f9ae5,null))[_0x8cd3('0x3c')](handleError(_0x4f9ae5,null));};exports[_0x8cd3('0x40')]=function(_0x78498c,_0x5367cf){return db[_0x8cd3('0x28')][_0x8cd3('0x40')](_0x78498c['body'],{})['then'](respondWithResult(_0x5367cf,0xc9))[_0x8cd3('0x3c')](handleError(_0x5367cf,null));};exports[_0x8cd3('0x21')]=function(_0x22c9a7,_0xdd5953){if(_0x22c9a7[_0x8cd3('0x41')]['id']){delete _0x22c9a7['body']['id'];}return db[_0x8cd3('0x28')][_0x8cd3('0x42')]({'where':{'id':_0x22c9a7[_0x8cd3('0x43')]['id']}})['then'](handleEntityNotFound(_0xdd5953,null))[_0x8cd3('0x23')](saveUpdates(_0x22c9a7[_0x8cd3('0x41')],null))[_0x8cd3('0x23')](respondWithResult(_0xdd5953,null))[_0x8cd3('0x3c')](handleError(_0xdd5953,null));};exports[_0x8cd3('0x22')]=function(_0x5207a1,_0x10e543){return db[_0x8cd3('0x28')][_0x8cd3('0x42')]({'where':{'id':_0x5207a1['params']['id']}})['then'](handleEntityNotFound(_0x10e543,null))[_0x8cd3('0x23')](removeEntity(_0x10e543,null))[_0x8cd3('0x3c')](handleError(_0x10e543,null));};exports[_0x8cd3('0x44')]=function(_0x5743ad,_0xc49ddc){return db[_0x8cd3('0x28')]['describe']()[_0x8cd3('0x23')](respondWithResult(_0xc49ddc,null))[_0x8cd3('0x3c')](handleError(_0xc49ddc,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 1838dfd..7b7b6a4 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 _0x2e0c=['./voiceTransferReport.attributes','exports','define','VoiceTransferReport','report_call_transfer','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x2e0c,0x14f));var _0xc2e0=function(_0x18aadc,_0x3029bc){_0x18aadc=_0x18aadc-0x0;var _0x51ed4c=_0x2e0c[_0x18aadc];return _0x51ed4c;};'use strict';var _=require(_0xc2e0('0x0'));var util=require(_0xc2e0('0x1'));var logger=require(_0xc2e0('0x2'))(_0xc2e0('0x3'));var moment=require(_0xc2e0('0x4'));var BPromise=require(_0xc2e0('0x5'));var rp=require(_0xc2e0('0x6'));var fs=require('fs');var path=require(_0xc2e0('0x7'));var rimraf=require(_0xc2e0('0x8'));var config=require(_0xc2e0('0x9'));var attributes=require(_0xc2e0('0xa'));module[_0xc2e0('0xb')]=function(_0x2d6741,_0x2a3086){return _0x2d6741[_0xc2e0('0xc')](_0xc2e0('0xd'),attributes,{'tableName':_0xc2e0('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfbd2=['../../config/environment','./voiceTransferReport.attributes','exports','report_call_transfer','util','api','bluebird','request-promise','path','rimraf'];(function(_0x4e11d5,_0x1ce514){var _0x5e4e4c=function(_0xbee63d){while(--_0xbee63d){_0x4e11d5['push'](_0x4e11d5['shift']());}};_0x5e4e4c(++_0x1ce514);}(_0xfbd2,0x108));var _0x2fbd=function(_0x2570e1,_0x5f4918){_0x2570e1=_0x2570e1-0x0;var _0x5dbde8=_0xfbd2[_0x2570e1];return _0x5dbde8;};'use strict';var _=require('lodash');var util=require(_0x2fbd('0x0'));var logger=require('../../config/logger')(_0x2fbd('0x1'));var moment=require('moment');var BPromise=require(_0x2fbd('0x2'));var rp=require(_0x2fbd('0x3'));var fs=require('fs');var path=require(_0x2fbd('0x4'));var rimraf=require(_0x2fbd('0x5'));var config=require(_0x2fbd('0x6'));var attributes=require(_0x2fbd('0x7'));module[_0x2fbd('0x8')]=function(_0x5759dc,_0x4af571){return _0x5759dc['define']('VoiceTransferReport',attributes,{'tableName':_0x2fbd('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 b3c7312..05f055e 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 _0x9270=['jayson/promise','client','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateVoiceTransferReport','VoiceTransferReport','options','raw','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc'];(function(_0x2ab3d9,_0x50e716){var _0x210a54=function(_0x24c479){while(--_0x24c479){_0x2ab3d9['push'](_0x2ab3d9['shift']());}};_0x210a54(++_0x50e716);}(_0x9270,0xc8));var _0x0927=function(_0x264545,_0x214037){_0x264545=_0x264545-0x0;var _0x114d10=_0x9270[_0x264545];return _0x114d10;};'use strict';var _=require(_0x0927('0x0'));var util=require(_0x0927('0x1'));var moment=require(_0x0927('0x2'));var BPromise=require(_0x0927('0x3'));var rs=require(_0x0927('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0927('0x5'));var logger=require(_0x0927('0x6'))(_0x0927('0x7'));var config=require('../../config/environment');var jayson=require(_0x0927('0x8'));var client=jayson[_0x0927('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3f2d2e,_0x3f9ccb,_0x4c4ca8){return new BPromise(function(_0x2e8fdf,_0x2fe4bc){return client['request'](_0x3f2d2e,_0x4c4ca8)[_0x0927('0xa')](function(_0x24b7a1){logger[_0x0927('0xb')](_0x0927('0xc'),_0x3f9ccb,_0x0927('0xd'));logger[_0x0927('0xe')](_0x0927('0xf'),_0x3f9ccb,_0x0927('0xd'),JSON[_0x0927('0x10')](_0x24b7a1));if(_0x24b7a1['error']){if(_0x24b7a1[_0x0927('0x11')][_0x0927('0x12')]===0x1f4){logger[_0x0927('0x11')](_0x0927('0xc'),_0x3f9ccb,_0x24b7a1[_0x0927('0x11')][_0x0927('0x13')]);return _0x2fe4bc(_0x24b7a1['error']['message']);}logger['error'](_0x0927('0xc'),_0x3f9ccb,_0x24b7a1[_0x0927('0x11')][_0x0927('0x13')]);return _0x2e8fdf(_0x24b7a1['error']['message']);}else{logger[_0x0927('0xb')](_0x0927('0xc'),_0x3f9ccb,_0x0927('0xd'));_0x2e8fdf(_0x24b7a1[_0x0927('0x14')][_0x0927('0x13')]);}})['catch'](function(_0x15adb8){logger['error'](_0x0927('0xc'),_0x3f9ccb,_0x15adb8);_0x2fe4bc(_0x15adb8);});});}exports[_0x0927('0x15')]=function(_0x519532){var _0x155ca0=this;return new Promise(function(_0x23a4bf,_0x352665){return db[_0x0927('0x16')]['create'](_0x519532['body'],{'raw':_0x519532[_0x0927('0x17')]?_0x519532[_0x0927('0x17')][_0x0927('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x5f15f7){logger[_0x0927('0xb')](_0x0927('0x15'),_0x519532);logger[_0x0927('0xe')](_0x0927('0x15'),_0x519532,JSON[_0x0927('0x10')](_0x5f15f7));_0x23a4bf(_0x5f15f7);})[_0x0927('0x19')](function(_0x4b617a){logger[_0x0927('0x11')](_0x0927('0x15'),_0x4b617a[_0x0927('0x13')],_0x519532);_0x352665(_0x155ca0[_0x0927('0x11')](0x1f4,_0x4b617a[_0x0927('0x13')]));});});}; \ No newline at end of file +var _0x5f46=['CreateVoiceTransferReport','VoiceTransferReport','create','options','raw','debug','lodash','moment','bluebird','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x378891,_0x4e3e16){var _0xfbfda2=function(_0x3b7681){while(--_0x3b7681){_0x378891['push'](_0x378891['shift']());}};_0xfbfda2(++_0x4e3e16);}(_0x5f46,0xc3));var _0x65f4=function(_0x1f967f,_0x39b214){_0x1f967f=_0x1f967f-0x0;var _0xcb9cc3=_0x5f46[_0x1f967f];return _0xcb9cc3;};'use strict';var _=require(_0x65f4('0x0'));var util=require('util');var moment=require(_0x65f4('0x1'));var BPromise=require(_0x65f4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x65f4('0x3'));var logger=require(_0x65f4('0x4'))('rpc');var config=require(_0x65f4('0x5'));var jayson=require(_0x65f4('0x6'));var client=jayson[_0x65f4('0x7')][_0x65f4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x198969,_0x16ce19,_0x115003){return new BPromise(function(_0x3fd5f1,_0x237aaf){return client[_0x65f4('0x9')](_0x198969,_0x115003)[_0x65f4('0xa')](function(_0x2e6056){logger[_0x65f4('0xb')](_0x65f4('0xc'),_0x16ce19,_0x65f4('0xd'));logger['debug'](_0x65f4('0xe'),_0x16ce19,_0x65f4('0xd'),JSON[_0x65f4('0xf')](_0x2e6056));if(_0x2e6056[_0x65f4('0x10')]){if(_0x2e6056[_0x65f4('0x10')][_0x65f4('0x11')]===0x1f4){logger[_0x65f4('0x10')](_0x65f4('0xc'),_0x16ce19,_0x2e6056['error'][_0x65f4('0x12')]);return _0x237aaf(_0x2e6056[_0x65f4('0x10')][_0x65f4('0x12')]);}logger[_0x65f4('0x10')](_0x65f4('0xc'),_0x16ce19,_0x2e6056[_0x65f4('0x10')][_0x65f4('0x12')]);return _0x3fd5f1(_0x2e6056[_0x65f4('0x10')][_0x65f4('0x12')]);}else{logger[_0x65f4('0xb')](_0x65f4('0xc'),_0x16ce19,_0x65f4('0xd'));_0x3fd5f1(_0x2e6056[_0x65f4('0x13')][_0x65f4('0x12')]);}})[_0x65f4('0x14')](function(_0x1a3f28){logger['error'](_0x65f4('0xc'),_0x16ce19,_0x1a3f28);_0x237aaf(_0x1a3f28);});});}exports[_0x65f4('0x15')]=function(_0x11bc3f){var _0x4424f2=this;return new Promise(function(_0x389d0b,_0x26f85b){return db[_0x65f4('0x16')][_0x65f4('0x17')](_0x11bc3f['body'],{'raw':_0x11bc3f['options']?_0x11bc3f[_0x65f4('0x18')][_0x65f4('0x19')]===undefined?!![]:![]:!![]})[_0x65f4('0xa')](function(_0xe8b95b){logger[_0x65f4('0xb')](_0x65f4('0x15'),_0x11bc3f);logger[_0x65f4('0x1a')]('CreateVoiceTransferReport',_0x11bc3f,JSON['stringify'](_0xe8b95b));_0x389d0b(_0xe8b95b);})[_0x65f4('0x14')](function(_0x3d4f8d){logger['error'](_0x65f4('0x15'),_0x3d4f8d[_0x65f4('0x12')],_0x11bc3f);_0x26f85b(_0x4424f2[_0x65f4('0x10')](0x1f4,_0x3d4f8d[_0x65f4('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 951592e..967a941 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 _0x7002=['/hangup','canUpdate','hangup','/answer','answer','/hold','/unhold','unhold','/calls','calls','/transfer','transfer','exports','express','Router','../../components/auth/service','./webbar.controller','post','/originate','isAuthenticated','originate'];(function(_0x6fd744,_0x2e98ba){var _0x38eeda=function(_0x372864){while(--_0x372864){_0x6fd744['push'](_0x6fd744['shift']());}};_0x38eeda(++_0x2e98ba);}(_0x7002,0x1c6));var _0x2700=function(_0x5eef05,_0x1be989){_0x5eef05=_0x5eef05-0x0;var _0x56d4b8=_0x7002[_0x5eef05];return _0x56d4b8;};'use strict';var express=require(_0x2700('0x0'));var router=express[_0x2700('0x1')]();var auth=require(_0x2700('0x2'));var controller=require(_0x2700('0x3'));router[_0x2700('0x4')](_0x2700('0x5'),auth[_0x2700('0x6')](),auth['canUpdate'](),controller[_0x2700('0x7')]);router[_0x2700('0x4')](_0x2700('0x8'),auth[_0x2700('0x6')](),auth[_0x2700('0x9')](),controller[_0x2700('0xa')]);router['post'](_0x2700('0xb'),auth[_0x2700('0x6')](),auth[_0x2700('0x9')](),controller[_0x2700('0xc')]);router[_0x2700('0x4')](_0x2700('0xd'),auth[_0x2700('0x6')](),auth[_0x2700('0x9')](),controller['hold']);router[_0x2700('0x4')](_0x2700('0xe'),auth[_0x2700('0x6')](),auth[_0x2700('0x9')](),controller[_0x2700('0xf')]);router['post'](_0x2700('0x10'),auth[_0x2700('0x6')](),auth['canUpdate'](),controller[_0x2700('0x11')]);router[_0x2700('0x4')](_0x2700('0x12'),auth[_0x2700('0x6')](),auth[_0x2700('0x9')](),controller[_0x2700('0x13')]);module[_0x2700('0x14')]=router; \ No newline at end of file +var _0x6097=['/hangup','hangup','/answer','answer','/hold','/unhold','unhold','/calls','/transfer','transfer','exports','express','../../components/auth/service','post','/originate','isAuthenticated','canUpdate'];(function(_0x5c3194,_0x2ebfec){var _0x402748=function(_0x52a8b4){while(--_0x52a8b4){_0x5c3194['push'](_0x5c3194['shift']());}};_0x402748(++_0x2ebfec);}(_0x6097,0x14e));var _0x7609=function(_0x1c1fba,_0xd5872d){_0x1c1fba=_0x1c1fba-0x0;var _0x37e346=_0x6097[_0x1c1fba];return _0x37e346;};'use strict';var express=require(_0x7609('0x0'));var router=express['Router']();var auth=require(_0x7609('0x1'));var controller=require('./webbar.controller');router[_0x7609('0x2')](_0x7609('0x3'),auth[_0x7609('0x4')](),auth[_0x7609('0x5')](),controller['originate']);router[_0x7609('0x2')](_0x7609('0x6'),auth[_0x7609('0x4')](),auth[_0x7609('0x5')](),controller[_0x7609('0x7')]);router[_0x7609('0x2')](_0x7609('0x8'),auth[_0x7609('0x4')](),auth[_0x7609('0x5')](),controller[_0x7609('0x9')]);router[_0x7609('0x2')](_0x7609('0xa'),auth[_0x7609('0x4')](),auth[_0x7609('0x5')](),controller['hold']);router[_0x7609('0x2')](_0x7609('0xb'),auth[_0x7609('0x4')](),auth['canUpdate'](),controller[_0x7609('0xc')]);router['post'](_0x7609('0xd'),auth[_0x7609('0x4')](),auth[_0x7609('0x5')](),controller['calls']);router[_0x7609('0x2')](_0x7609('0xe'),auth[_0x7609('0x4')](),auth[_0x7609('0x5')](),controller[_0x7609('0xf')]);module[_0x7609('0x10')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index d6cf92d..04d1464 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 _0x4876=['send','NotFound','request','then','message','result','catch','User','agent','VoiceChannels','all','rows','sessionId','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','json','body','callNumber','callerId','callbackUrl','entityFound:','user:%s','webbar:originate','originate\x20executed!','hangup','hangup\x20fired:','userId','format','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','answer\x20executed!','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','filter','conference','conference\x20fired:','webbar:conference','transfer','transferNumber','webbar:transfer','transfer\x20executed!','../../mysqldb','bluebird','client','http','../../config/logger','webbarapi','redis','defaults','localhost','socket.io-emitter','validate','number','userId\x20is\x20required','string','callNumber\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','error','stack','name','status'];(function(_0x1e4cb1,_0x316ad2){var _0x34e30f=function(_0x27642a){while(--_0x27642a){_0x1e4cb1['push'](_0x1e4cb1['shift']());}};_0x34e30f(++_0x316ad2);}(_0x4876,0x84));var _0x6487=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4876[_0x3dd15e];return _0x231fd0;};'use strict';var path=require('path');var fs=require('fs');var _=require('lodash');var db=require(_0x6487('0x0'))['db'];var config=require('../../config/environment');var util=require('util');var BPromise=require(_0x6487('0x1'));var jayson=require('jayson/promise');var amiClient=jayson[_0x6487('0x2')][_0x6487('0x3')]({'port':0x232a});var logger=require(_0x6487('0x4'))(_0x6487('0x5'));var Redis=require('ioredis');config[_0x6487('0x6')]=_[_0x6487('0x7')](config['redis'],{'host':_0x6487('0x8'),'port':0x18eb});var io=require(_0x6487('0x9'))(new Redis(config[_0x6487('0x6')]));var Schema=require(_0x6487('0xa'));var originateValidation=new Schema({'userId':{'type':_0x6487('0xb'),'required':[!![],_0x6487('0xc')]},'callNumber':{'type':_0x6487('0xd'),'required':[!![],_0x6487('0xe')]},'callerId':{'type':_0x6487('0xd')},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':_0x6487('0xb'),'required':[!![],_0x6487('0xc')]},'sessionId':{'type':_0x6487('0xd'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x6487('0xb'),'required':[!![],_0x6487('0xc')]},'sessionId':{'type':_0x6487('0xd'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x6487('0xb'),'required':[!![],_0x6487('0xc')]},'sessionId':{'type':'string','required':[!![],_0x6487('0xf')]},'transferNumber':{'type':_0x6487('0xd'),'required':[!![],_0x6487('0x10')]}});var holdValidation=new Schema({'userId':{'type':_0x6487('0xb'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x6487('0xd'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x6487('0xb'),'required':[!![],_0x6487('0xc')]},'sessionId':{'type':_0x6487('0xd'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':_0x6487('0xb'),'required':[!![],'userId\x20is\x20required']}});function emit(_0x2fdfc3,_0x583f04,_0x1bd934){logger[_0x6487('0x11')](_0x2fdfc3,_0x583f04,JSON[_0x6487('0x12')](_0x1bd934));io['to'](_0x2fdfc3)[_0x6487('0x13')](_0x583f04,_0x1bd934);}function handleError(_0x18c6cf){return function(_0x59514e){console['log']('handleError:',_0x59514e,_0x59514e instanceof RangeError);logger[_0x6487('0x14')](_0x59514e[_0x6487('0x15')]);if(_0x59514e instanceof RangeError){if(_0x59514e[_0x6487('0x16')]){delete _0x59514e[_0x6487('0x16')];}_0x18c6cf[_0x6487('0x17')](0x194)[_0x6487('0x18')](_0x59514e);}else{if(_0x59514e[_0x6487('0x16')]){delete _0x59514e[_0x6487('0x16')];}_0x18c6cf[_0x6487('0x17')](0x1f4)[_0x6487('0x18')](_0x59514e);}};}function checkError(){return function(_0xee261d){if(!_0xee261d){throw new RangeError(_0x6487('0x19'));}return _0xee261d;};}function respondWithRpcPromise(_0x3efa5e,_0x8cdc62){return new BPromise(function(_0x21b8e8,_0x21050d){var _0x3affe7=amiClient;return _0x3affe7[_0x6487('0x1a')](_0x3efa5e,_0x8cdc62)[_0x6487('0x1b')](function(_0x4d06b2){if(_0x4d06b2['error']){if(_0x4d06b2[_0x6487('0x14')]['code']===0x1f4){return _0x21050d(_0x4d06b2['error'][_0x6487('0x1c')]);}return _0x21b8e8(_0x4d06b2[_0x6487('0x14')]['message']);}else{_0x21b8e8(_0x4d06b2[_0x6487('0x1d')]);}})[_0x6487('0x1e')](function(_0x2f4190){_0x21050d(_0x2f4190);});});}function getAgent(_0x3afdc6){return db[_0x6487('0x1f')]['findOne']({'where':{'id':_0x3afdc6,'role':_0x6487('0x20')}})['then'](checkError());}function getAgentCheckSession(_0x335bd8,_0x5a29f9){return new BPromise(function(_0x5a9ef0,_0x412056){var _0x31ede3=respondWithRpcPromise(_0x6487('0x21'));var _0x4c424a=getAgent(_0x335bd8);Promise[_0x6487('0x22')]([_0x31ede3,_0x4c424a])[_0x6487('0x1b')](function(_0x33085b){var _0x63ddc7=_0x33085b[0x0];var _0x35b089=_0x33085b[0x1];var _0x8b42e5=_['filter'](_0x63ddc7[_0x6487('0x23')],function(_0x270e6e){return _0x270e6e['UserId']==_0x35b089['id']&&_0x270e6e[_0x6487('0x24')]==_0x5a29f9;});if(_0x8b42e5[_0x6487('0x25')]==0x1){_0x5a9ef0(_0x35b089);}else{_0x412056(new RangeError(_0x6487('0x26')+_0x5a29f9+_0x6487('0x27')));}});});}exports[_0x6487('0x28')]=function(_0x809bb8,_0x21aff9){logger['info'](_0x6487('0x29'),_0x809bb8['body']);var _0x2d320c=originateValidation['validate'](_0x809bb8['body']);if(_0x2d320c['length']>0x0){return _0x21aff9['status'](0x190)[_0x6487('0x2a')](_0x2d320c);}var _0x36c78e=_0x809bb8[_0x6487('0x2b')]['userId'];var _0x1c9393=_0x809bb8['body'][_0x6487('0x2c')];var _0x3685ff=_0x809bb8[_0x6487('0x2b')][_0x6487('0x2d')];var _0x1bbe0b=_0x809bb8['body'][_0x6487('0x2e')];return getAgent(_0x36c78e)['then'](function(_0x32dbf5){logger[_0x6487('0x11')](_0x6487('0x2f'),_0x32dbf5[_0x6487('0x16')]);emit(util['format'](_0x6487('0x30'),_0x32dbf5[_0x6487('0x16')]),_0x6487('0x31'),{'callNumber':_0x1c9393,'callerId':_0x3685ff,'callbackUrl':_0x1bbe0b});return _0x21aff9['status'](0xc8)['json']({'error':![],'message':_0x6487('0x32')});})['catch'](handleError(_0x21aff9));};exports[_0x6487('0x33')]=function(_0x175a9c,_0xff0c42){logger['info'](_0x6487('0x34'),_0x175a9c[_0x6487('0x2b')]);var _0xd9235c=hangupValidation[_0x6487('0xa')](_0x175a9c[_0x6487('0x2b')]);if(_0xd9235c[_0x6487('0x25')]>0x0){return _0xff0c42[_0x6487('0x17')](0x190)['json'](_0xd9235c);}var _0xa2a8dc=_0x175a9c[_0x6487('0x2b')][_0x6487('0x35')];var _0x5f4720=_0x175a9c[_0x6487('0x2b')]['sessionId'];return getAgent(_0xa2a8dc)[_0x6487('0x1b')](function(_0x499b8a){logger[_0x6487('0x11')]('entityFound:',_0x499b8a[_0x6487('0x16')]);emit(util[_0x6487('0x36')](_0x6487('0x30'),_0x499b8a[_0x6487('0x16')]),_0x6487('0x37'),{'sessionId':_0x5f4720});return _0xff0c42[_0x6487('0x17')](0xc8)[_0x6487('0x2a')]({'error':![],'message':_0x6487('0x38')});})['catch'](handleError(_0xff0c42));};exports[_0x6487('0x39')]=function(_0x33feca,_0x746f40){logger[_0x6487('0x11')](_0x6487('0x3a'),_0x33feca[_0x6487('0x2b')]);var _0x594b42=answerValidation[_0x6487('0xa')](_0x33feca[_0x6487('0x2b')]);if(_0x594b42['length']>0x0){return _0x746f40[_0x6487('0x17')](0x190)[_0x6487('0x2a')](_0x594b42);}var _0x26f2da=_0x33feca[_0x6487('0x2b')][_0x6487('0x35')];var _0x1168c9=_0x33feca[_0x6487('0x2b')][_0x6487('0x24')];return getAgent(_0x26f2da)[_0x6487('0x1b')](function(_0x5a3f2b){logger[_0x6487('0x11')](_0x6487('0x2f'),_0x5a3f2b[_0x6487('0x16')]);emit(util['format']('user:%s',_0x5a3f2b[_0x6487('0x16')]),_0x6487('0x3b'),{'sessionId':_0x1168c9});return _0x746f40[_0x6487('0x17')](0xc8)[_0x6487('0x2a')]({'error':![],'message':_0x6487('0x3c')});})[_0x6487('0x1e')](handleError(_0x746f40));};exports['hold']=function(_0xc43296,_0x480fb5){logger[_0x6487('0x11')](_0x6487('0x3d'),_0xc43296[_0x6487('0x2b')]);var _0x223fe0=holdValidation[_0x6487('0xa')](_0xc43296[_0x6487('0x2b')]);if(_0x223fe0[_0x6487('0x25')]>0x0){return _0x480fb5[_0x6487('0x17')](0x190)[_0x6487('0x2a')](_0x223fe0);}var _0x1e8ae7=_0xc43296[_0x6487('0x2b')][_0x6487('0x35')];var _0x552ed6=_0xc43296[_0x6487('0x2b')]['sessionId'];return getAgent(_0x1e8ae7)[_0x6487('0x1b')](function(_0x2c4272){logger[_0x6487('0x11')](_0x6487('0x2f'),_0x2c4272[_0x6487('0x16')]);emit(util[_0x6487('0x36')](_0x6487('0x30'),_0x2c4272[_0x6487('0x16')]),_0x6487('0x3e'),{'sessionId':_0x552ed6});return _0x480fb5[_0x6487('0x17')](0xc8)[_0x6487('0x2a')]({'error':![],'message':_0x6487('0x3f')});})[_0x6487('0x1e')](handleError(_0x480fb5));};exports[_0x6487('0x40')]=function(_0x2a7715,_0x2dde3c){logger[_0x6487('0x11')](_0x6487('0x41'),_0x2a7715[_0x6487('0x2b')]);var _0x56aa08=unholdValidation[_0x6487('0xa')](_0x2a7715[_0x6487('0x2b')]);if(_0x56aa08['length']>0x0){return _0x2dde3c[_0x6487('0x17')](0x190)[_0x6487('0x2a')](_0x56aa08);}var _0x128700=_0x2a7715[_0x6487('0x2b')]['userId'];var _0x3506fc=_0x2a7715[_0x6487('0x2b')][_0x6487('0x24')];return getAgent(_0x128700)[_0x6487('0x1b')](function(_0x2deb3c){logger[_0x6487('0x11')](_0x6487('0x2f'),_0x2deb3c['name']);emit(util[_0x6487('0x36')](_0x6487('0x30'),_0x2deb3c[_0x6487('0x16')]),_0x6487('0x42'),{'sessionId':_0x3506fc});return _0x2dde3c[_0x6487('0x17')](0xc8)[_0x6487('0x2a')]({'error':![],'message':_0x6487('0x43')});})[_0x6487('0x1e')](handleError(_0x2dde3c));};exports[_0x6487('0x44')]=function(_0xe0858c,_0x301400){logger['info'](_0x6487('0x45'),_0x301400['body']);var _0xe1f349=callsValidation[_0x6487('0xa')](_0xe0858c[_0x6487('0x2b')]);if(_0xe1f349[_0x6487('0x25')]>0x0){return _0x301400[_0x6487('0x17')](0x190)[_0x6487('0x2a')](_0xe1f349);}var _0x2fb140=_0xe0858c[_0x6487('0x2b')]['userId'];var _0x4d7a8a=respondWithRpcPromise(_0x6487('0x21'));var _0x1c0ab6=getAgent(_0x2fb140);return Promise['all']([_0x4d7a8a,_0x1c0ab6])[_0x6487('0x1b')](function(_0x3fd845){var _0x382ce1=_0x3fd845[0x0];var _0x7b0612=_0x3fd845[0x1];var _0x1c7a3f=_[_0x6487('0x46')](_0x382ce1[_0x6487('0x23')],function(_0x5296dd){return _0x5296dd['UserId']==_0x7b0612['id'];});return _0x301400['status'](0xc8)['json']({'count':_0x1c7a3f['length'],'rows':_0x1c7a3f});})[_0x6487('0x1e')](handleError(_0x301400));};exports[_0x6487('0x47')]=function(_0xfed030,_0xec93d9){logger[_0x6487('0x11')](_0x6487('0x48'),_0xfed030[_0x6487('0x2b')]);var _0x27e7a5=conferenceValidation['validate'](_0xfed030['body']);if(_0x27e7a5[_0x6487('0x25')]>0x0){return _0xec93d9[_0x6487('0x17')](0x190)[_0x6487('0x2a')](_0x27e7a5);}var _0x1585ae=_0xfed030[_0x6487('0x2b')][_0x6487('0x35')];return getAgent(_0x1585ae)[_0x6487('0x1b')](function(_0xce3a79){logger['info'](_0x6487('0x2f'),_0xce3a79[_0x6487('0x16')]);emit(util[_0x6487('0x36')](_0x6487('0x30'),_0xce3a79[_0x6487('0x16')]),_0x6487('0x49'));return _0xec93d9[_0x6487('0x17')](0xc8)[_0x6487('0x2a')]({'error':![],'message':'conference\x20executed!'});})['catch'](handleError(_0xec93d9));};exports[_0x6487('0x4a')]=function(_0x3d4a23,_0x3ea745){logger[_0x6487('0x11')]('transfer\x20fired:',_0x3d4a23['body']);var _0xe432f4=transferValidation[_0x6487('0xa')](_0x3d4a23[_0x6487('0x2b')]);if(_0xe432f4[_0x6487('0x25')]>0x0){return _0x3ea745[_0x6487('0x17')](0x190)[_0x6487('0x2a')](_0xe432f4);}var _0x3a7a85=_0x3d4a23[_0x6487('0x2b')][_0x6487('0x35')];var _0x1eeecb=_0x3d4a23['body'][_0x6487('0x24')];var _0x283454=_0x3d4a23[_0x6487('0x2b')][_0x6487('0x4b')];return getAgent(_0x3a7a85)[_0x6487('0x1b')](function(_0x1d3eae){logger[_0x6487('0x11')](_0x6487('0x2f'),_0x1d3eae['name']);emit(util[_0x6487('0x36')]('user:%s',_0x1d3eae[_0x6487('0x16')]),_0x6487('0x4c'),{'sessionId':_0x1eeecb,'transferNumber':_0x283454});return _0x3ea745[_0x6487('0x17')](0xc8)[_0x6487('0x2a')]({'error':![],'message':_0x6487('0x4d')});})['catch'](handleError(_0x3ea745));}; \ No newline at end of file +var _0x91a7=['sessionId','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','json','userId','callNumber','callerId','entityFound:','format','user:%s','webbar:originate','originate\x20executed!','hangup','info','answer','webbar:answer','answer\x20executed!','webbar:hold','hold\x20executed!','unhold\x20fired:','webbar:unhold','calls','calls\x20fired:','rows','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','lodash','../../mysqldb','../../config/environment','bluebird','client','webbarapi','ioredis','defaults','localhost','socket.io-emitter','validate','number','userId\x20is\x20required','string','callNumber\x20is\x20required','transferNumber\x20is\x20required','stringify','error','name','status','send','NotFound','request','then','code','message','result','catch','User','agent','VoiceChannels','all','filter'];(function(_0x171c57,_0x59c93b){var _0x5dafe3=function(_0x48f6dd){while(--_0x48f6dd){_0x171c57['push'](_0x171c57['shift']());}};_0x5dafe3(++_0x59c93b);}(_0x91a7,0xe7));var _0x791a=function(_0x2a3bdb,_0x4bc122){_0x2a3bdb=_0x2a3bdb-0x0;var _0x14ce12=_0x91a7[_0x2a3bdb];return _0x14ce12;};'use strict';var path=require('path');var fs=require('fs');var _=require(_0x791a('0x0'));var db=require(_0x791a('0x1'))['db'];var config=require(_0x791a('0x2'));var util=require('util');var BPromise=require(_0x791a('0x3'));var jayson=require('jayson/promise');var amiClient=jayson[_0x791a('0x4')]['http']({'port':0x232a});var logger=require('../../config/logger')(_0x791a('0x5'));var Redis=require(_0x791a('0x6'));config['redis']=_[_0x791a('0x7')](config['redis'],{'host':_0x791a('0x8'),'port':0x18eb});var io=require(_0x791a('0x9'))(new Redis(config['redis']));var Schema=require(_0x791a('0xa'));var originateValidation=new Schema({'userId':{'type':_0x791a('0xb'),'required':[!![],_0x791a('0xc')]},'callNumber':{'type':_0x791a('0xd'),'required':[!![],_0x791a('0xe')]},'callerId':{'type':'string'},'callbackUrl':{'type':_0x791a('0xd')}});var hangupValidation=new Schema({'userId':{'type':_0x791a('0xb'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x791a('0xd'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x791a('0xb'),'required':[!![],_0x791a('0xc')]},'sessionId':{'type':_0x791a('0xd'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x791a('0xb'),'required':[!![],_0x791a('0xc')]},'sessionId':{'type':'string','required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0x791a('0xd'),'required':[!![],_0x791a('0xf')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0x791a('0xc')]},'sessionId':{'type':_0x791a('0xd'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],_0x791a('0xc')]},'sessionId':{'type':_0x791a('0xd'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x791a('0xb'),'required':[!![],_0x791a('0xc')]}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],_0x791a('0xc')]}});function emit(_0x575d11,_0x43dea6,_0x355155){logger['info'](_0x575d11,_0x43dea6,JSON[_0x791a('0x10')](_0x355155));io['to'](_0x575d11)['emit'](_0x43dea6,_0x355155);}function handleError(_0x35fe48){return function(_0x52941d){console['log']('handleError:',_0x52941d,_0x52941d instanceof RangeError);logger[_0x791a('0x11')](_0x52941d['stack']);if(_0x52941d instanceof RangeError){if(_0x52941d['name']){delete _0x52941d[_0x791a('0x12')];}_0x35fe48[_0x791a('0x13')](0x194)[_0x791a('0x14')](_0x52941d);}else{if(_0x52941d[_0x791a('0x12')]){delete _0x52941d['name'];}_0x35fe48[_0x791a('0x13')](0x1f4)[_0x791a('0x14')](_0x52941d);}};}function checkError(){return function(_0x234514){if(!_0x234514){throw new RangeError(_0x791a('0x15'));}return _0x234514;};}function respondWithRpcPromise(_0x530e32,_0x448085){return new BPromise(function(_0x2054c6,_0x25bae5){var _0x9e17b5=amiClient;return _0x9e17b5[_0x791a('0x16')](_0x530e32,_0x448085)[_0x791a('0x17')](function(_0x2241a0){if(_0x2241a0[_0x791a('0x11')]){if(_0x2241a0[_0x791a('0x11')][_0x791a('0x18')]===0x1f4){return _0x25bae5(_0x2241a0[_0x791a('0x11')]['message']);}return _0x2054c6(_0x2241a0[_0x791a('0x11')][_0x791a('0x19')]);}else{_0x2054c6(_0x2241a0[_0x791a('0x1a')]);}})[_0x791a('0x1b')](function(_0x4d748a){_0x25bae5(_0x4d748a);});});}function getAgent(_0x456480){return db[_0x791a('0x1c')]['findOne']({'where':{'id':_0x456480,'role':_0x791a('0x1d')}})[_0x791a('0x17')](checkError());}function getAgentCheckSession(_0x16dbaf,_0x4c1626){return new BPromise(function(_0x29194d,_0x2b3327){var _0x2b0784=respondWithRpcPromise(_0x791a('0x1e'));var _0x4f423=getAgent(_0x16dbaf);Promise[_0x791a('0x1f')]([_0x2b0784,_0x4f423])[_0x791a('0x17')](function(_0x889534){var _0x58bbc0=_0x889534[0x0];var _0xbc3436=_0x889534[0x1];var _0x9e9332=_[_0x791a('0x20')](_0x58bbc0['rows'],function(_0x1cdda9){return _0x1cdda9['UserId']==_0xbc3436['id']&&_0x1cdda9[_0x791a('0x21')]==_0x4c1626;});if(_0x9e9332[_0x791a('0x22')]==0x1){_0x29194d(_0xbc3436);}else{_0x2b3327(new RangeError(_0x791a('0x23')+_0x4c1626+_0x791a('0x24')));}});});}exports[_0x791a('0x25')]=function(_0x32c7b2,_0x15ff6e){logger['info'](_0x791a('0x26'),_0x32c7b2[_0x791a('0x27')]);var _0x3fa066=originateValidation[_0x791a('0xa')](_0x32c7b2[_0x791a('0x27')]);if(_0x3fa066['length']>0x0){return _0x15ff6e[_0x791a('0x13')](0x190)[_0x791a('0x28')](_0x3fa066);}var _0x423a1e=_0x32c7b2[_0x791a('0x27')][_0x791a('0x29')];var _0x4ef825=_0x32c7b2[_0x791a('0x27')][_0x791a('0x2a')];var _0x33f998=_0x32c7b2[_0x791a('0x27')][_0x791a('0x2b')];var _0x52104d=_0x32c7b2[_0x791a('0x27')]['callbackUrl'];return getAgent(_0x423a1e)[_0x791a('0x17')](function(_0x4cd047){logger['info'](_0x791a('0x2c'),_0x4cd047[_0x791a('0x12')]);emit(util[_0x791a('0x2d')](_0x791a('0x2e'),_0x4cd047[_0x791a('0x12')]),_0x791a('0x2f'),{'callNumber':_0x4ef825,'callerId':_0x33f998,'callbackUrl':_0x52104d});return _0x15ff6e[_0x791a('0x13')](0xc8)['json']({'error':![],'message':_0x791a('0x30')});})['catch'](handleError(_0x15ff6e));};exports[_0x791a('0x31')]=function(_0x496005,_0x25e8cc){logger[_0x791a('0x32')]('hangup\x20fired:',_0x496005[_0x791a('0x27')]);var _0x22fb89=hangupValidation['validate'](_0x496005[_0x791a('0x27')]);if(_0x22fb89[_0x791a('0x22')]>0x0){return _0x25e8cc[_0x791a('0x13')](0x190)[_0x791a('0x28')](_0x22fb89);}var _0x29d267=_0x496005[_0x791a('0x27')][_0x791a('0x29')];var _0xf223d8=_0x496005[_0x791a('0x27')][_0x791a('0x21')];return getAgent(_0x29d267)['then'](function(_0x15f066){logger[_0x791a('0x32')](_0x791a('0x2c'),_0x15f066['name']);emit(util[_0x791a('0x2d')]('user:%s',_0x15f066['name']),'webbar:hangup',{'sessionId':_0xf223d8});return _0x25e8cc[_0x791a('0x13')](0xc8)[_0x791a('0x28')]({'error':![],'message':'hangup\x20executed!'});})[_0x791a('0x1b')](handleError(_0x25e8cc));};exports[_0x791a('0x33')]=function(_0x7987fa,_0x288cc5){logger['info']('answer\x20fired:',_0x7987fa['body']);var _0x2f0395=answerValidation[_0x791a('0xa')](_0x7987fa['body']);if(_0x2f0395[_0x791a('0x22')]>0x0){return _0x288cc5[_0x791a('0x13')](0x190)[_0x791a('0x28')](_0x2f0395);}var _0x954164=_0x7987fa['body'][_0x791a('0x29')];var _0x5911db=_0x7987fa[_0x791a('0x27')][_0x791a('0x21')];return getAgent(_0x954164)[_0x791a('0x17')](function(_0xfa245e){logger[_0x791a('0x32')]('entityFound:',_0xfa245e[_0x791a('0x12')]);emit(util[_0x791a('0x2d')](_0x791a('0x2e'),_0xfa245e[_0x791a('0x12')]),_0x791a('0x34'),{'sessionId':_0x5911db});return _0x288cc5['status'](0xc8)[_0x791a('0x28')]({'error':![],'message':_0x791a('0x35')});})['catch'](handleError(_0x288cc5));};exports['hold']=function(_0x1eb5b1,_0x338e70){logger[_0x791a('0x32')]('hold\x20fired:',_0x1eb5b1['body']);var _0x37ca2e=holdValidation[_0x791a('0xa')](_0x1eb5b1['body']);if(_0x37ca2e[_0x791a('0x22')]>0x0){return _0x338e70[_0x791a('0x13')](0x190)[_0x791a('0x28')](_0x37ca2e);}var _0x549980=_0x1eb5b1['body'][_0x791a('0x29')];var _0x17acda=_0x1eb5b1[_0x791a('0x27')][_0x791a('0x21')];return getAgent(_0x549980)['then'](function(_0x2d7c7d){logger[_0x791a('0x32')](_0x791a('0x2c'),_0x2d7c7d[_0x791a('0x12')]);emit(util['format'](_0x791a('0x2e'),_0x2d7c7d[_0x791a('0x12')]),_0x791a('0x36'),{'sessionId':_0x17acda});return _0x338e70[_0x791a('0x13')](0xc8)[_0x791a('0x28')]({'error':![],'message':_0x791a('0x37')});})[_0x791a('0x1b')](handleError(_0x338e70));};exports['unhold']=function(_0xdcb1b,_0x1fd826){logger['info'](_0x791a('0x38'),_0xdcb1b[_0x791a('0x27')]);var _0x5dff77=unholdValidation[_0x791a('0xa')](_0xdcb1b[_0x791a('0x27')]);if(_0x5dff77[_0x791a('0x22')]>0x0){return _0x1fd826[_0x791a('0x13')](0x190)[_0x791a('0x28')](_0x5dff77);}var _0x4d82eb=_0xdcb1b['body']['userId'];var _0x305033=_0xdcb1b['body']['sessionId'];return getAgent(_0x4d82eb)[_0x791a('0x17')](function(_0x548a4b){logger[_0x791a('0x32')](_0x791a('0x2c'),_0x548a4b['name']);emit(util['format'](_0x791a('0x2e'),_0x548a4b['name']),_0x791a('0x39'),{'sessionId':_0x305033});return _0x1fd826[_0x791a('0x13')](0xc8)[_0x791a('0x28')]({'error':![],'message':'unhold\x20executed!'});})[_0x791a('0x1b')](handleError(_0x1fd826));};exports[_0x791a('0x3a')]=function(_0x5159dd,_0x2a2b95){logger[_0x791a('0x32')](_0x791a('0x3b'),_0x2a2b95[_0x791a('0x27')]);var _0x450ad8=callsValidation[_0x791a('0xa')](_0x5159dd['body']);if(_0x450ad8['length']>0x0){return _0x2a2b95[_0x791a('0x13')](0x190)['json'](_0x450ad8);}var _0x45541b=_0x5159dd[_0x791a('0x27')][_0x791a('0x29')];var _0xf11dea=respondWithRpcPromise(_0x791a('0x1e'));var _0x2bd2cc=getAgent(_0x45541b);return Promise[_0x791a('0x1f')]([_0xf11dea,_0x2bd2cc])['then'](function(_0x1ac6e1){var _0x4691d9=_0x1ac6e1[0x0];var _0xc34c5b=_0x1ac6e1[0x1];var _0x1a4376=_[_0x791a('0x20')](_0x4691d9[_0x791a('0x3c')],function(_0x182b3a){return _0x182b3a['UserId']==_0xc34c5b['id'];});return _0x2a2b95[_0x791a('0x13')](0xc8)['json']({'count':_0x1a4376['length'],'rows':_0x1a4376});})[_0x791a('0x1b')](handleError(_0x2a2b95));};exports[_0x791a('0x3d')]=function(_0x216b69,_0x2e3432){logger[_0x791a('0x32')](_0x791a('0x3e'),_0x216b69[_0x791a('0x27')]);var _0x623ce0=conferenceValidation[_0x791a('0xa')](_0x216b69[_0x791a('0x27')]);if(_0x623ce0[_0x791a('0x22')]>0x0){return _0x2e3432[_0x791a('0x13')](0x190)[_0x791a('0x28')](_0x623ce0);}var _0x35ea8c=_0x216b69[_0x791a('0x27')][_0x791a('0x29')];return getAgent(_0x35ea8c)[_0x791a('0x17')](function(_0x156d32){logger[_0x791a('0x32')](_0x791a('0x2c'),_0x156d32['name']);emit(util[_0x791a('0x2d')](_0x791a('0x2e'),_0x156d32[_0x791a('0x12')]),_0x791a('0x3f'));return _0x2e3432[_0x791a('0x13')](0xc8)['json']({'error':![],'message':_0x791a('0x40')});})[_0x791a('0x1b')](handleError(_0x2e3432));};exports[_0x791a('0x41')]=function(_0x120122,_0x5468c4){logger[_0x791a('0x32')]('transfer\x20fired:',_0x120122['body']);var _0x482fa6=transferValidation['validate'](_0x120122[_0x791a('0x27')]);if(_0x482fa6[_0x791a('0x22')]>0x0){return _0x5468c4[_0x791a('0x13')](0x190)[_0x791a('0x28')](_0x482fa6);}var _0x1bf9a3=_0x120122[_0x791a('0x27')][_0x791a('0x29')];var _0x5dca78=_0x120122['body'][_0x791a('0x21')];var _0x185620=_0x120122['body']['transferNumber'];return getAgent(_0x1bf9a3)[_0x791a('0x17')](function(_0x2f9753){logger['info'](_0x791a('0x2c'),_0x2f9753[_0x791a('0x12')]);emit(util[_0x791a('0x2d')](_0x791a('0x2e'),_0x2f9753['name']),'webbar:transfer',{'sessionId':_0x5dca78,'transferNumber':_0x185620});return _0x5468c4[_0x791a('0x13')](0xc8)[_0x791a('0x28')]({'error':![],'message':'transfer\x20executed!'});})[_0x791a('0x1b')](handleError(_0x5468c4));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 635c4dc..a632e3a 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 _0xf4f4=['../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/users','getAgents','/:id/applications','getApplications','create','post','addDisposition','addAnswer','addAgents','addApplications','/:id/notify','notify','/:id/send','send','put','/:id','update','delete','destroy','removeAnswers','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x1ab6c7,_0x2e0073){var _0x57d998=function(_0x1552b4){while(--_0x1552b4){_0x1ab6c7['push'](_0x1ab6c7['shift']());}};_0x57d998(++_0x2e0073);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x5ab7c6,_0x26c956){_0x5ab7c6=_0x5ab7c6-0x0;var _0xf45077=_0xf4f4[_0x5ab7c6];return _0xf45077;};'use strict';var multer=require(_0x4f4f('0x0'));var util=require(_0x4f4f('0x1'));var path=require('path');var timeout=require(_0x4f4f('0x2'));var express=require(_0x4f4f('0x3'));var router=express[_0x4f4f('0x4')]();var fs_extra=require(_0x4f4f('0x5'));var auth=require(_0x4f4f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4f4f('0x7'));var controller=require('./whatsappAccount.controller');router[_0x4f4f('0x8')]('/',auth[_0x4f4f('0x9')](),controller[_0x4f4f('0xa')]);router[_0x4f4f('0x8')](_0x4f4f('0xb'),auth[_0x4f4f('0x9')](),controller[_0x4f4f('0xc')]);router[_0x4f4f('0x8')]('/:id',auth[_0x4f4f('0x9')](),controller[_0x4f4f('0xd')]);router[_0x4f4f('0x8')](_0x4f4f('0xe'),auth[_0x4f4f('0x9')](),controller[_0x4f4f('0xf')]);router[_0x4f4f('0x8')](_0x4f4f('0x10'),auth['isAuthenticated'](),controller['getAnswers']);router[_0x4f4f('0x8')](_0x4f4f('0x11'),auth[_0x4f4f('0x9')](),controller[_0x4f4f('0x12')]);router[_0x4f4f('0x8')](_0x4f4f('0x13'),auth['isAuthenticated'](),controller[_0x4f4f('0x14')]);router['post']('/',auth[_0x4f4f('0x9')](),controller[_0x4f4f('0x15')]);router[_0x4f4f('0x16')](_0x4f4f('0xe'),auth['isAuthenticated'](),controller[_0x4f4f('0x17')]);router['post']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x4f4f('0x18')]);router[_0x4f4f('0x16')](_0x4f4f('0x11'),auth[_0x4f4f('0x9')](),controller[_0x4f4f('0x19')]);router[_0x4f4f('0x16')](_0x4f4f('0x13'),auth[_0x4f4f('0x9')](),controller[_0x4f4f('0x1a')]);router[_0x4f4f('0x16')](_0x4f4f('0x1b'),controller[_0x4f4f('0x1c')]);router['post'](_0x4f4f('0x1d'),auth[_0x4f4f('0x9')](),controller[_0x4f4f('0x1e')]);router[_0x4f4f('0x1f')](_0x4f4f('0x20'),auth[_0x4f4f('0x9')](),controller[_0x4f4f('0x21')]);router[_0x4f4f('0x22')](_0x4f4f('0x20'),auth[_0x4f4f('0x9')](),controller[_0x4f4f('0x23')]);router[_0x4f4f('0x22')](_0x4f4f('0xe'),auth[_0x4f4f('0x9')](),controller['removeDispositions']);router['delete']('/:id/canned_answers',auth[_0x4f4f('0x9')](),controller[_0x4f4f('0x24')]);router['delete'](_0x4f4f('0x11'),auth[_0x4f4f('0x9')](),controller[_0x4f4f('0x25')]);module[_0x4f4f('0x26')]=router; \ No newline at end of file +var _0x1967=['addAnswer','addAgents','/:id/notify','notify','update','destroy','removeDispositions','delete','removeAnswers','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','post','create'];(function(_0x4a846c,_0x400cc1){var _0x4c1de9=function(_0x2583a2){while(--_0x2583a2){_0x4a846c['push'](_0x4a846c['shift']());}};_0x4c1de9(++_0x400cc1);}(_0x1967,0x173));var _0x7196=function(_0x1d45ab,_0x30098d){_0x1d45ab=_0x1d45ab-0x0;var _0x489932=_0x1967[_0x1d45ab];return _0x489932;};'use strict';var multer=require('multer');var util=require(_0x7196('0x0'));var path=require(_0x7196('0x1'));var timeout=require(_0x7196('0x2'));var express=require(_0x7196('0x3'));var router=express[_0x7196('0x4')]();var fs_extra=require(_0x7196('0x5'));var auth=require(_0x7196('0x6'));var interaction=require(_0x7196('0x7'));var config=require(_0x7196('0x8'));var controller=require(_0x7196('0x9'));router['get']('/',auth[_0x7196('0xa')](),controller[_0x7196('0xb')]);router[_0x7196('0xc')](_0x7196('0xd'),auth[_0x7196('0xa')](),controller[_0x7196('0xe')]);router['get'](_0x7196('0xf'),auth[_0x7196('0xa')](),controller[_0x7196('0x10')]);router[_0x7196('0xc')](_0x7196('0x11'),auth['isAuthenticated'](),controller['getDispositions']);router[_0x7196('0xc')](_0x7196('0x12'),auth[_0x7196('0xa')](),controller[_0x7196('0x13')]);router[_0x7196('0xc')](_0x7196('0x14'),auth[_0x7196('0xa')](),controller[_0x7196('0x15')]);router[_0x7196('0xc')](_0x7196('0x16'),auth[_0x7196('0xa')](),controller['getApplications']);router[_0x7196('0x17')]('/',auth[_0x7196('0xa')](),controller[_0x7196('0x18')]);router[_0x7196('0x17')]('/:id/dispositions',auth[_0x7196('0xa')](),controller['addDisposition']);router[_0x7196('0x17')](_0x7196('0x12'),auth[_0x7196('0xa')](),controller[_0x7196('0x19')]);router[_0x7196('0x17')](_0x7196('0x14'),auth[_0x7196('0xa')](),controller[_0x7196('0x1a')]);router[_0x7196('0x17')](_0x7196('0x16'),auth[_0x7196('0xa')](),controller['addApplications']);router['post'](_0x7196('0x1b'),controller[_0x7196('0x1c')]);router[_0x7196('0x17')]('/:id/send',auth[_0x7196('0xa')](),controller['send']);router['put'](_0x7196('0xf'),auth[_0x7196('0xa')](),controller[_0x7196('0x1d')]);router['delete']('/:id',auth[_0x7196('0xa')](),controller[_0x7196('0x1e')]);router['delete'](_0x7196('0x11'),auth[_0x7196('0xa')](),controller[_0x7196('0x1f')]);router[_0x7196('0x20')](_0x7196('0x12'),auth['isAuthenticated'](),controller[_0x7196('0x21')]);router['delete'](_0x7196('0x14'),auth[_0x7196('0xa')](),controller[_0x7196('0x22')]);module[_0x7196('0x23')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 26e84a1..2d8ff49 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 _0xb401=['sequelize','randomstring','exports','STRING','name','twilio','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId'];(function(_0x5bf031,_0xb5a232){var _0x11d780=function(_0xe7afc2){while(--_0xe7afc2){_0x5bf031['push'](_0x5bf031['shift']());}};_0x11d780(++_0xb5a232);}(_0xb401,0x174));var _0x1b40=function(_0x1c389c,_0x20d10b){_0x1c389c=_0x1c389c-0x0;var _0x3621d2=_0xb401[_0x1c389c];return _0x3621d2;};'use strict';var Sequelize=require(_0x1b40('0x0'));var rs=require(_0x1b40('0x1'));module[_0x1b40('0x2')]={'name':{'type':Sequelize[_0x1b40('0x3')],'unique':_0x1b40('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x1b40('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x1b40('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x1b40('0x3')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x1b40('0x3')]},'type':{'type':Sequelize['ENUM'](_0x1b40('0x5'))},'accountSid':{'type':Sequelize[_0x1b40('0x3')]},'authToken':{'type':Sequelize[_0x1b40('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x1b40('0x6');}},'notificationSound':{'type':Sequelize[_0x1b40('0x7')],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x1b40('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x1b40('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1b40('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x1b40('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x1b40('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x1b40('0x7')],'defaultValue':![],'comment':_0x1b40('0x9'),'set':function(_0x4bfe23){if(!_0x4bfe23){this[_0x1b40('0xa')](_0x1b40('0xb'),null);}this[_0x1b40('0xa')]('mandatoryDisposition',_0x4bfe23);}},'description':{'type':Sequelize[_0x1b40('0x3')]}}; \ No newline at end of file +var _0x405a=['BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','sequelize','randomstring','STRING','name','generate','ENUM','twilio'];(function(_0x527228,_0x2bf9d1){var _0x18fc82=function(_0x301e4f){while(--_0x301e4f){_0x527228['push'](_0x527228['shift']());}};_0x18fc82(++_0x2bf9d1);}(_0x405a,0x1b5));var _0xa405=function(_0x459b74,_0x5773bd){_0x459b74=_0x459b74-0x0;var _0x46cb16=_0x405a[_0x459b74];return _0x46cb16;};'use strict';var Sequelize=require(_0xa405('0x0'));var rs=require(_0xa405('0x1'));module['exports']={'name':{'type':Sequelize[_0xa405('0x2')],'unique':_0xa405('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0xa405('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0xa405('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0xa405('0x2')],'defaultValue':function(){return rs[_0xa405('0x4')]();}},'phone':{'type':Sequelize[_0xa405('0x2')]},'type':{'type':Sequelize[_0xa405('0x5')](_0xa405('0x6'))},'accountSid':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0xa405('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xa405('0x7')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xa405('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xa405('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa405('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa405('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa405('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xa405('0x9')},'mandatoryDisposition':{'type':Sequelize[_0xa405('0x7')],'defaultValue':![],'comment':_0xa405('0xa'),'set':function(_0x110707){if(!_0x110707){this[_0xa405('0xb')]('mandatoryDispositionPauseId',null);}this['setDataValue']('mandatoryDisposition',_0x110707);}},'description':{'type':Sequelize[_0xa405('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 520cf0e..b1fe1d7 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 _0x71a0=['query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','offset','sort','filters','filter','where','merge','includeAll','findAll','rows','catch','show','params','Pause','length','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','describe','addDisposition','WhatsappAccountId','getDispositions','findOne','Disposition','order','pick','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addAgents','omit','spread','emit','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','WhatsappApplication','bulkCreate','priority','getApplications','whatsapp','account','applications','orderBy','Applications','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','mobile','twilio','from','From','replace','messageId','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','CmList','Contacts','defaults','contact','WhatsappInteraction','created','autoclose','push','close','unmanaged','*,*,*,*','WhatsappMessage','ContactId','AttachmentId','interaction','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','Content-Type','text/xml','\x0a','to\x20is\x20mandatory','List','DESC','ListId','out','Messages','dataValues','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./whatsappAccount.socket','register','jayson/promise','client','http','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','WhatsappAccount,\x20%s,\x20%s','info','result','sendStatus','end','status','json','undefined','limit','count','set','apply','save','update','then','get','WhatsappAccounts','UserProfileResource','destroy','stack','name','send','index','mandatoryDispositionPause','WhatsappAccount','rawAttributes','fieldName','type','model','map'];(function(_0x5e42a7,_0x3eba35){var _0x36d21b=function(_0x567f0a){while(--_0x567f0a){_0x5e42a7['push'](_0x5e42a7['shift']());}};_0x36d21b(++_0x3eba35);}(_0x71a0,0x74));var _0x071a=function(_0x3afd6a,_0x184a89){_0x3afd6a=_0x3afd6a-0x0;var _0x25ee28=_0x71a0[_0x3afd6a];return _0x25ee28;};'use strict';var emlformat=require(_0x071a('0x0'));var rimraf=require(_0x071a('0x1'));var zipdir=require(_0x071a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x071a('0x3'));var moment=require(_0x071a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x071a('0x5'));var util=require(_0x071a('0x6'));var path=require(_0x071a('0x7'));var sox=require(_0x071a('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x071a('0x9'));var _=require(_0x071a('0xa'));var squel=require(_0x071a('0xb'));var crypto=require(_0x071a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x071a('0xd'));var toCsv=require(_0x071a('0xe'));var querystring=require(_0x071a('0xf'));var Papa=require(_0x071a('0x10'));var Redis=require(_0x071a('0x11'));var authService=require(_0x071a('0x12'));var qs=require(_0x071a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x071a('0x14'));var logger=require(_0x071a('0x15'))('api');var utils=require(_0x071a('0x16'));var config=require(_0x071a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x071a('0x18'))['db'];config['redis']=_['defaults'](config[_0x071a('0x19')],{'host':_0x071a('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x071a('0x19')]));require(_0x071a('0x1b'))[_0x071a('0x1c')](socket);var jayson=require(_0x071a('0x1d'));var client=jayson[_0x071a('0x1e')][_0x071a('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x1e0cec,_0x9ecb2b,_0x1ca15a,_0x2c16b0){return new BPromise(function(_0x29ccfd,_0x546138){var _0x21bad3=_0x2c16b0||client;return _0x21bad3['request'](_0x1e0cec,_0x1ca15a)['then'](function(_0x2ff830){logger['info']('WhatsappAccount,\x20%s,\x20%s',_0x9ecb2b,_0x071a('0x20'));logger[_0x071a('0x21')](_0x071a('0x22'),_0x9ecb2b,'request\x20sent',JSON[_0x071a('0x23')](_0x2ff830));if(_0x2ff830['error']){if(_0x2ff830[_0x071a('0x24')]['code']===0x1f4){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x9ecb2b,_0x2ff830['error'][_0x071a('0x25')]);return _0x546138(_0x2ff830[_0x071a('0x24')][_0x071a('0x25')]);}logger[_0x071a('0x24')](_0x071a('0x26'),_0x9ecb2b,_0x2ff830[_0x071a('0x24')][_0x071a('0x25')]);return _0x29ccfd(_0x2ff830['error'][_0x071a('0x25')]);}else{logger[_0x071a('0x27')](_0x071a('0x26'),_0x9ecb2b,'request\x20sent');_0x29ccfd(_0x2ff830[_0x071a('0x28')][_0x071a('0x25')]);}})['catch'](function(_0x1fc100){logger['error'](_0x071a('0x26'),_0x9ecb2b,_0x1fc100);_0x546138(_0x1fc100);});});}function respondWithStatusCode(_0x5bfacd,_0x987234){_0x987234=_0x987234||0xcc;return function(_0x1b0a77){if(_0x1b0a77){return _0x5bfacd[_0x071a('0x29')](_0x987234);}return _0x5bfacd['status'](_0x987234)[_0x071a('0x2a')]();};}function respondWithResult(_0xa34c8c,_0x385785){_0x385785=_0x385785||0xc8;return function(_0x15d411){if(_0x15d411){return _0xa34c8c[_0x071a('0x2b')](_0x385785)[_0x071a('0x2c')](_0x15d411);}};}function respondWithFilteredResult(_0x4137a6,_0x297b69){return function(_0x112cd5){if(_0x112cd5){var _0x41492d=typeof _0x297b69['offset']===_0x071a('0x2d')&&typeof _0x297b69[_0x071a('0x2e')]===_0x071a('0x2d');var _0x15e841=_0x112cd5[_0x071a('0x2f')];var _0x2b725d=_0x41492d?0x0:_0x297b69['offset'];var _0x48e1c8=_0x41492d?_0x112cd5['count']:_0x297b69['offset']+_0x297b69[_0x071a('0x2e')];var _0xbc6445;if(_0x48e1c8>=_0x15e841){_0x48e1c8=_0x15e841;_0xbc6445=0xc8;}else{_0xbc6445=0xce;}_0x4137a6[_0x071a('0x2b')](_0xbc6445);return _0x4137a6[_0x071a('0x30')]('Content-Range',_0x2b725d+'-'+_0x48e1c8+'/'+_0x15e841)[_0x071a('0x2c')](_0x112cd5);}return null;};}function patchUpdates(_0x775fb4){return function(_0x534d98){try{jsonpatch[_0x071a('0x31')](_0x534d98,_0x775fb4,!![]);}catch(_0x2efadb){return BPromise['reject'](_0x2efadb);}return _0x534d98[_0x071a('0x32')]();};}function saveUpdates(_0x35fecd,_0x58086a){return function(_0x5641e0){if(_0x5641e0){return _0x5641e0[_0x071a('0x33')](_0x35fecd)[_0x071a('0x34')](function(_0xed5c2c){return _0xed5c2c;});}return null;};}function removeEntity(_0xa5bd91,_0x2a9164){return function(_0xce3dc9){if(_0xce3dc9){return _0xce3dc9['destroy']()['then'](function(){var _0x2b135f=_0xce3dc9[_0x071a('0x35')]({'plain':!![]});var _0x4f56c0=_0x071a('0x36');return db[_0x071a('0x37')][_0x071a('0x38')]({'where':{'type':_0x4f56c0,'resourceId':_0x2b135f['id']}})[_0x071a('0x34')](function(){return _0xce3dc9;});})[_0x071a('0x34')](function(){_0xa5bd91['status'](0xcc)[_0x071a('0x2a')]();});}};}function handleEntityNotFound(_0x4fd639,_0x50f050){return function(_0x4f6ade){if(!_0x4f6ade){_0x4fd639[_0x071a('0x29')](0x194);}return _0x4f6ade;};}function handleError(_0xdb5e57,_0x1e2e98){_0x1e2e98=_0x1e2e98||0x1f4;return function(_0x4f22b3){logger['error'](_0x4f22b3[_0x071a('0x39')]);if(_0x4f22b3['name']){delete _0x4f22b3[_0x071a('0x3a')];}_0xdb5e57[_0x071a('0x2b')](_0x1e2e98)[_0x071a('0x3b')](_0x4f22b3);};}exports[_0x071a('0x3c')]=function(_0x4ff453,_0x36d37d){var _0x175cd8={'include':[{'model':db['Pause'],'as':_0x071a('0x3d')}]},_0x401c74={},_0xade50f={'count':0x0,'rows':[]};var _0x384b8e=_['map'](db[_0x071a('0x3e')][_0x071a('0x3f')],function(_0x5c8a4f){return{'name':_0x5c8a4f[_0x071a('0x40')],'type':_0x5c8a4f[_0x071a('0x41')]['key']};});_0x401c74[_0x071a('0x42')]=_[_0x071a('0x43')](_0x384b8e,'name');_0x401c74[_0x071a('0x44')]=_[_0x071a('0x45')](_0x4ff453[_0x071a('0x44')]);_0x401c74['filters']=_[_0x071a('0x46')](_0x401c74['model'],_0x401c74['query']);_0x175cd8[_0x071a('0x47')]=_['intersection'](_0x401c74[_0x071a('0x42')],qs['fields'](_0x4ff453['query'][_0x071a('0x48')]));_0x175cd8[_0x071a('0x47')]=_0x175cd8[_0x071a('0x47')]['length']?_0x175cd8[_0x071a('0x47')]:_0x401c74[_0x071a('0x42')];if(!_0x4ff453[_0x071a('0x44')][_0x071a('0x49')](_0x071a('0x4a'))){_0x175cd8[_0x071a('0x2e')]=qs['limit'](_0x4ff453[_0x071a('0x44')]['limit']);_0x175cd8[_0x071a('0x4b')]=qs[_0x071a('0x4b')](_0x4ff453['query'][_0x071a('0x4b')]);}_0x175cd8['order']=qs[_0x071a('0x4c')](_0x4ff453[_0x071a('0x44')][_0x071a('0x4c')]);_0x175cd8['where']=qs[_0x071a('0x4d')](_['pick'](_0x4ff453[_0x071a('0x44')],_0x401c74['filters']),_0x384b8e);if(_0x4ff453[_0x071a('0x44')][_0x071a('0x4e')]){_0x175cd8[_0x071a('0x4f')]=_[_0x071a('0x50')](_0x175cd8[_0x071a('0x4f')],{'$or':_[_0x071a('0x43')](_0x384b8e,function(_0x106614){if(_0x106614[_0x071a('0x41')]!=='VIRTUAL'){var _0x12115d={};_0x12115d[_0x106614[_0x071a('0x3a')]]={'$like':'%'+_0x4ff453[_0x071a('0x44')][_0x071a('0x4e')]+'%'};return _0x12115d;}})});}_0x175cd8=_[_0x071a('0x50')]({},_0x175cd8,_0x4ff453['options']);var _0x456350={'where':_0x175cd8[_0x071a('0x4f')]};return db[_0x071a('0x3e')]['count'](_0x456350)['then'](function(_0x289a60){_0xade50f['count']=_0x289a60;if(_0x4ff453[_0x071a('0x44')][_0x071a('0x51')]){_0x175cd8['include']=[{'all':!![]}];}return db[_0x071a('0x3e')][_0x071a('0x52')](_0x175cd8);})[_0x071a('0x34')](function(_0x5510fc){_0xade50f[_0x071a('0x53')]=_0x5510fc;return _0xade50f;})[_0x071a('0x34')](respondWithFilteredResult(_0x36d37d,_0x175cd8))[_0x071a('0x54')](handleError(_0x36d37d,null));};exports[_0x071a('0x55')]=function(_0x41cdc5,_0x2968c5){var _0x45dd9a={'raw':![],'where':{'id':_0x41cdc5[_0x071a('0x56')]['id']},'include':[{'model':db[_0x071a('0x57')],'as':'mandatoryDispositionPause'}]},_0x583aca={};_0x583aca[_0x071a('0x42')]=_[_0x071a('0x45')](db[_0x071a('0x3e')][_0x071a('0x3f')]);_0x583aca['query']=_[_0x071a('0x45')](_0x41cdc5[_0x071a('0x44')]);_0x583aca[_0x071a('0x4d')]=_[_0x071a('0x46')](_0x583aca[_0x071a('0x42')],_0x583aca[_0x071a('0x44')]);_0x45dd9a[_0x071a('0x47')]=_[_0x071a('0x46')](_0x583aca['model'],qs[_0x071a('0x48')](_0x41cdc5[_0x071a('0x44')][_0x071a('0x48')]));_0x45dd9a[_0x071a('0x47')]=_0x45dd9a['attributes'][_0x071a('0x58')]?_0x45dd9a[_0x071a('0x47')]:_0x583aca['model'];if(_0x41cdc5[_0x071a('0x44')]['includeAll']){_0x45dd9a[_0x071a('0x59')]=[{'all':!![]}];}_0x45dd9a=_[_0x071a('0x50')]({},_0x45dd9a,_0x41cdc5[_0x071a('0x5a')]);return db['WhatsappAccount'][_0x071a('0x5b')](_0x45dd9a)[_0x071a('0x34')](handleEntityNotFound(_0x2968c5,null))[_0x071a('0x34')](respondWithResult(_0x2968c5,null))['catch'](handleError(_0x2968c5,null));};exports[_0x071a('0x5c')]=function(_0xaad712,_0x496deb){return db[_0x071a('0x3e')][_0x071a('0x5c')](_0xaad712[_0x071a('0x5d')],{})[_0x071a('0x34')](function(_0x5a2900){var _0x288eb1=_0xaad712[_0x071a('0x5e')][_0x071a('0x35')]({'plain':!![]});if(!_0x288eb1)throw new Error(_0x071a('0x5f'));if(_0x288eb1['role']===_0x071a('0x5e')){var _0x2f357e=_0x5a2900['get']({'plain':!![]});var _0x126f33=_0x071a('0x36');return db[_0x071a('0x60')]['find']({'where':{'name':_0x126f33,'userProfileId':_0x288eb1[_0x071a('0x61')]},'raw':!![]})[_0x071a('0x34')](function(_0x55a6c4){if(_0x55a6c4&&_0x55a6c4[_0x071a('0x62')]===0x0){return db[_0x071a('0x37')][_0x071a('0x5c')]({'name':_0x2f357e['name'],'resourceId':_0x2f357e['id'],'type':_0x55a6c4['name'],'sectionId':_0x55a6c4['id']},{})[_0x071a('0x34')](function(){return _0x5a2900;});}else{return _0x5a2900;}})['catch'](function(_0x10cf4f){logger[_0x071a('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x10cf4f);throw _0x10cf4f;});}return _0x5a2900;})[_0x071a('0x34')](respondWithResult(_0x496deb,0xc9))[_0x071a('0x54')](handleError(_0x496deb,null));};exports[_0x071a('0x33')]=function(_0x46180d,_0x439ed7){if(_0x46180d['body']['id']){delete _0x46180d[_0x071a('0x5d')]['id'];}return db[_0x071a('0x3e')][_0x071a('0x5b')]({'where':{'id':_0x46180d['params']['id']},'include':[{'model':db[_0x071a('0x57')],'as':_0x071a('0x3d')}]})[_0x071a('0x34')](handleEntityNotFound(_0x439ed7,null))[_0x071a('0x34')](saveUpdates(_0x46180d[_0x071a('0x5d')],null))[_0x071a('0x34')](respondWithResult(_0x439ed7,null))[_0x071a('0x54')](handleError(_0x439ed7,null));};exports[_0x071a('0x38')]=function(_0x271ceb,_0x5bc2a7){return db[_0x071a('0x3e')][_0x071a('0x5b')]({'where':{'id':_0x271ceb['params']['id']}})[_0x071a('0x34')](handleEntityNotFound(_0x5bc2a7,null))['then'](removeEntity(_0x5bc2a7,null))['catch'](handleError(_0x5bc2a7,null));};exports[_0x071a('0x63')]=function(_0x2d134d,_0x5ed21e){return db[_0x071a('0x3e')][_0x071a('0x63')]()[_0x071a('0x34')](respondWithResult(_0x5ed21e,null))['catch'](handleError(_0x5ed21e,null));};exports[_0x071a('0x64')]=function(_0x32e3af,_0x39c2d0,_0x318f8d){if(_0x32e3af['body']['id']){delete _0x32e3af[_0x071a('0x5d')]['id'];}return db[_0x071a('0x3e')][_0x071a('0x5b')]({'where':{'id':_0x32e3af[_0x071a('0x56')]['id']}})[_0x071a('0x34')](handleEntityNotFound(_0x39c2d0,null))['then'](function(_0x3a60c7){if(_0x3a60c7){_0x32e3af['body'][_0x071a('0x65')]=_0x3a60c7['id'];return db['Disposition'][_0x071a('0x5c')](_0x32e3af[_0x071a('0x5d')]);}})[_0x071a('0x34')](respondWithResult(_0x39c2d0,null))[_0x071a('0x54')](handleError(_0x39c2d0,null));};exports[_0x071a('0x66')]=function(_0x313a26,_0x11628e,_0x33ddac){var _0x32e127={'raw':![],'where':{}};var _0x252450={};var _0x2e6520={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0x071a('0x67')]({'where':{'id':_0x313a26[_0x071a('0x56')]['id']}})[_0x071a('0x34')](handleEntityNotFound(_0x11628e,null))['then'](function(_0x50cae5){if(_0x50cae5){_0x252450[_0x071a('0x42')]=_[_0x071a('0x45')](db[_0x071a('0x68')][_0x071a('0x3f')]);_0x252450[_0x071a('0x44')]=_[_0x071a('0x45')](_0x313a26[_0x071a('0x44')]);_0x252450[_0x071a('0x4d')]=_['intersection'](_0x252450['model'],_0x252450[_0x071a('0x44')]);_0x32e127[_0x071a('0x47')]=_[_0x071a('0x46')](_0x252450[_0x071a('0x42')],qs[_0x071a('0x48')](_0x313a26[_0x071a('0x44')][_0x071a('0x48')]));_0x32e127[_0x071a('0x47')]=_0x32e127[_0x071a('0x47')][_0x071a('0x58')]?_0x32e127['attributes']:_0x252450[_0x071a('0x42')];if(!_0x313a26[_0x071a('0x44')]['hasOwnProperty'](_0x071a('0x4a'))){_0x32e127[_0x071a('0x2e')]=qs['limit'](_0x313a26['query'][_0x071a('0x2e')]);_0x32e127['offset']=qs[_0x071a('0x4b')](_0x313a26[_0x071a('0x44')][_0x071a('0x4b')]);}_0x32e127[_0x071a('0x69')]=qs[_0x071a('0x4c')](_0x313a26[_0x071a('0x44')]['sort']);_0x32e127['where']=qs[_0x071a('0x4d')](_[_0x071a('0x6a')](_0x313a26['query'],_0x252450[_0x071a('0x4d')]));_0x32e127[_0x071a('0x4f')][_0x071a('0x65')]=_0x50cae5['id'];if(_0x313a26[_0x071a('0x44')][_0x071a('0x4e')]){_0x32e127[_0x071a('0x4f')]=_[_0x071a('0x50')](_0x32e127[_0x071a('0x4f')],{'$or':_[_0x071a('0x43')](_0x32e127[_0x071a('0x47')],function(_0x173f74){var _0x12d9e1={};_0x12d9e1[_0x173f74]={'$like':'%'+_0x313a26['query'][_0x071a('0x4e')]+'%'};return _0x12d9e1;})});}_0x32e127=_['merge']({},_0x32e127,_0x313a26[_0x071a('0x5a')]);return db[_0x071a('0x68')]['count']({'where':_0x32e127[_0x071a('0x4f')]})['then'](function(_0x3a9f0d){_0x2e6520[_0x071a('0x2f')]=_0x3a9f0d;if(_0x313a26['query'][_0x071a('0x51')]){_0x32e127[_0x071a('0x59')]=[{'all':!![]}];}return db[_0x071a('0x68')][_0x071a('0x52')](_0x32e127);})[_0x071a('0x34')](function(_0x2ae786){_0x2e6520['rows']=_0x2ae786;return _0x2e6520;});}})[_0x071a('0x34')](respondWithFilteredResult(_0x11628e,_0x32e127))[_0x071a('0x54')](handleError(_0x11628e,null));};exports[_0x071a('0x6b')]=function(_0x52b842,_0x3a9478,_0x545e83){return db['WhatsappAccount'][_0x071a('0x5b')]({'where':{'id':_0x52b842[_0x071a('0x56')]['id']}})['then'](handleEntityNotFound(_0x3a9478,null))[_0x071a('0x34')](function(_0x30c9a7){if(_0x30c9a7){return _0x30c9a7['removeDispositions'](_0x52b842[_0x071a('0x44')][_0x071a('0x6c')]);}})[_0x071a('0x34')](respondWithStatusCode(_0x3a9478,null))[_0x071a('0x54')](handleError(_0x3a9478,null));};exports[_0x071a('0x6d')]=function(_0x506425,_0x4387b0,_0x1d61d3){if(_0x506425[_0x071a('0x5d')]['id']){delete _0x506425[_0x071a('0x5d')]['id'];}return db[_0x071a('0x3e')]['find']({'where':{'id':_0x506425[_0x071a('0x56')]['id']}})['then'](handleEntityNotFound(_0x4387b0,null))['then'](function(_0x315db7){if(_0x315db7){_0x506425[_0x071a('0x5d')]['WhatsappAccountId']=_0x315db7['id'];return db[_0x071a('0x6e')][_0x071a('0x5c')](_0x506425[_0x071a('0x5d')]);}})[_0x071a('0x34')](respondWithResult(_0x4387b0,null))['catch'](handleError(_0x4387b0,null));};exports['getAnswers']=function(_0x3dd9e9,_0x1acf2c,_0x298fc8){var _0x473be1={'raw':![],'where':{}};var _0x5ce939={};var _0x188c70={'count':0x0,'rows':[]};return db[_0x071a('0x3e')][_0x071a('0x67')]({'where':{'id':_0x3dd9e9[_0x071a('0x56')]['id']}})[_0x071a('0x34')](handleEntityNotFound(_0x1acf2c,null))[_0x071a('0x34')](function(_0x4de295){if(_0x4de295){_0x5ce939[_0x071a('0x42')]=_[_0x071a('0x45')](db[_0x071a('0x6e')][_0x071a('0x3f')]);_0x5ce939[_0x071a('0x44')]=_[_0x071a('0x45')](_0x3dd9e9[_0x071a('0x44')]);_0x5ce939[_0x071a('0x4d')]=_[_0x071a('0x46')](_0x5ce939[_0x071a('0x42')],_0x5ce939[_0x071a('0x44')]);_0x473be1[_0x071a('0x47')]=_[_0x071a('0x46')](_0x5ce939[_0x071a('0x42')],qs[_0x071a('0x48')](_0x3dd9e9[_0x071a('0x44')][_0x071a('0x48')]));_0x473be1[_0x071a('0x47')]=_0x473be1['attributes']['length']?_0x473be1[_0x071a('0x47')]:_0x5ce939['model'];if(!_0x3dd9e9[_0x071a('0x44')][_0x071a('0x49')](_0x071a('0x4a'))){_0x473be1[_0x071a('0x2e')]=qs[_0x071a('0x2e')](_0x3dd9e9[_0x071a('0x44')][_0x071a('0x2e')]);_0x473be1[_0x071a('0x4b')]=qs[_0x071a('0x4b')](_0x3dd9e9[_0x071a('0x44')][_0x071a('0x4b')]);}_0x473be1[_0x071a('0x69')]=qs[_0x071a('0x4c')](_0x3dd9e9[_0x071a('0x44')][_0x071a('0x4c')]);_0x473be1[_0x071a('0x4f')]=qs['filters'](_[_0x071a('0x6a')](_0x3dd9e9[_0x071a('0x44')],_0x5ce939[_0x071a('0x4d')]));_0x473be1['where'][_0x071a('0x65')]=_0x4de295['id'];if(_0x3dd9e9[_0x071a('0x44')][_0x071a('0x4e')]){_0x473be1['where']=_[_0x071a('0x50')](_0x473be1[_0x071a('0x4f')],{'$or':_[_0x071a('0x43')](_0x473be1[_0x071a('0x47')],function(_0xd5d55f){var _0x5d3711={};_0x5d3711[_0xd5d55f]={'$like':'%'+_0x3dd9e9[_0x071a('0x44')][_0x071a('0x4e')]+'%'};return _0x5d3711;})});}_0x473be1=_[_0x071a('0x50')]({},_0x473be1,_0x3dd9e9[_0x071a('0x5a')]);return db[_0x071a('0x6e')][_0x071a('0x2f')]({'where':_0x473be1['where']})[_0x071a('0x34')](function(_0x1c39c7){_0x188c70[_0x071a('0x2f')]=_0x1c39c7;if(_0x3dd9e9[_0x071a('0x44')][_0x071a('0x51')]){_0x473be1['include']=[{'all':!![]}];}return db[_0x071a('0x6e')][_0x071a('0x52')](_0x473be1);})['then'](function(_0x76e17a){_0x188c70[_0x071a('0x53')]=_0x76e17a;return _0x188c70;});}})['then'](respondWithFilteredResult(_0x1acf2c,_0x473be1))[_0x071a('0x54')](handleError(_0x1acf2c,null));};exports[_0x071a('0x6f')]=function(_0x410a49,_0x42ad04,_0x2c4b69){return db[_0x071a('0x3e')]['find']({'where':{'id':_0x410a49[_0x071a('0x56')]['id']}})[_0x071a('0x34')](handleEntityNotFound(_0x42ad04,null))[_0x071a('0x34')](function(_0x121b4a){if(_0x121b4a){return _0x121b4a['removeAnswers'](_0x410a49[_0x071a('0x44')][_0x071a('0x6c')]);}})[_0x071a('0x34')](respondWithStatusCode(_0x42ad04,null))[_0x071a('0x54')](handleError(_0x42ad04,null));};exports[_0x071a('0x70')]=function(_0x2d3619,_0x307b40,_0x878738){return db[_0x071a('0x3e')][_0x071a('0x5b')]({'where':{'id':_0x2d3619['params']['id']}})[_0x071a('0x34')](handleEntityNotFound(_0x307b40,null))['then'](function(_0x1a91ac){if(_0x1a91ac){return _0x1a91ac[_0x071a('0x70')](_0x2d3619[_0x071a('0x5d')][_0x071a('0x6c')],_[_0x071a('0x71')](_0x2d3619[_0x071a('0x5d')],[_0x071a('0x6c'),'id'])||{})[_0x071a('0x72')](function(_0x49b364){for(var _0x417147=0x0;_0x417147<_0x2d3619['body'][_0x071a('0x6c')][_0x071a('0x58')];_0x417147+=0x1){socket[_0x071a('0x73')]('userWhatsappAccount:save',{'UserId':Number(_0x2d3619[_0x071a('0x5d')]['ids'][_0x417147]),'WhatsappAccountId':Number(_0x2d3619[_0x071a('0x56')]['id'])});}return _0x49b364;});}})[_0x071a('0x34')](respondWithResult(_0x307b40,null))['catch'](handleError(_0x307b40,null));};exports['removeAgents']=function(_0x56b24e,_0x31cda7,_0x43f1a3){return db['WhatsappAccount'][_0x071a('0x5b')]({'where':{'id':_0x56b24e['params']['id']}})[_0x071a('0x34')](handleEntityNotFound(_0x31cda7,null))['then'](function(_0x4e7184){if(_0x4e7184){return _0x4e7184[_0x071a('0x74')](_0x56b24e[_0x071a('0x44')][_0x071a('0x6c')])[_0x071a('0x34')](function(){if(_[_0x071a('0x75')](_0x56b24e[_0x071a('0x44')][_0x071a('0x6c')])){for(var _0x5eb26a=0x0;_0x5eb26a<_0x56b24e[_0x071a('0x44')][_0x071a('0x6c')][_0x071a('0x58')];_0x5eb26a+=0x1){socket[_0x071a('0x73')](_0x071a('0x76'),{'UserId':Number(_0x56b24e[_0x071a('0x44')][_0x071a('0x6c')][_0x5eb26a]),'WhatsappAccountId':Number(_0x56b24e[_0x071a('0x56')]['id'])});}}else{socket[_0x071a('0x73')]('userWhatsappAccount:remove',{'UserId':Number(_0x56b24e[_0x071a('0x44')][_0x071a('0x6c')]),'WhatsappAccountId':Number(_0x56b24e[_0x071a('0x56')]['id'])});}});}})['then'](respondWithStatusCode(_0x31cda7,null))[_0x071a('0x54')](handleError(_0x31cda7,null));};exports[_0x071a('0x77')]=function(_0x23edef,_0x37e3b1,_0x422fae){var _0x3be529={};var _0x867d87={};var _0x1f5abb;var _0x22ff10;return db['WhatsappAccount'][_0x071a('0x67')]({'where':{'id':_0x23edef[_0x071a('0x56')]['id']}})[_0x071a('0x34')](handleEntityNotFound(_0x37e3b1,null))[_0x071a('0x34')](function(_0x4edc02){if(_0x4edc02){_0x1f5abb=_0x4edc02;_0x867d87[_0x071a('0x42')]=_[_0x071a('0x45')](db[_0x071a('0x78')][_0x071a('0x3f')]);_0x867d87[_0x071a('0x44')]=_['keys'](_0x23edef['query']);_0x867d87[_0x071a('0x4d')]=_['intersection'](_0x867d87['model'],_0x867d87[_0x071a('0x44')]);_0x3be529[_0x071a('0x47')]=_[_0x071a('0x46')](_0x867d87[_0x071a('0x42')],qs[_0x071a('0x48')](_0x23edef[_0x071a('0x44')]['fields']));_0x3be529[_0x071a('0x47')]=_0x3be529[_0x071a('0x47')][_0x071a('0x58')]?_0x3be529[_0x071a('0x47')]:_0x867d87['model'];_0x3be529['order']=qs[_0x071a('0x4c')](_0x23edef[_0x071a('0x44')][_0x071a('0x4c')]);_0x3be529['where']=qs[_0x071a('0x4d')](_[_0x071a('0x6a')](_0x23edef['query'],_0x867d87[_0x071a('0x4d')]));if(_0x23edef[_0x071a('0x44')][_0x071a('0x4e')]){_0x3be529[_0x071a('0x4f')]=_[_0x071a('0x50')](_0x3be529[_0x071a('0x4f')],{'$or':_['map'](_0x3be529[_0x071a('0x47')],function(_0xfcca1b){var _0x2bfaad={};_0x2bfaad[_0xfcca1b]={'$like':'%'+_0x23edef[_0x071a('0x44')][_0x071a('0x4e')]+'%'};return _0x2bfaad;})});}_0x3be529=_[_0x071a('0x50')]({},_0x3be529,_0x23edef[_0x071a('0x5a')]);return _0x1f5abb[_0x071a('0x77')](_0x3be529);}})[_0x071a('0x34')](function(_0x1b6dc8){if(_0x1b6dc8){_0x22ff10=_0x1b6dc8[_0x071a('0x58')];if(!_0x23edef['query'][_0x071a('0x49')](_0x071a('0x4a'))){_0x3be529[_0x071a('0x2e')]=qs[_0x071a('0x2e')](_0x23edef[_0x071a('0x44')][_0x071a('0x2e')]);_0x3be529[_0x071a('0x4b')]=qs[_0x071a('0x4b')](_0x23edef[_0x071a('0x44')]['offset']);}return _0x1f5abb['getAgents'](_0x3be529);}})[_0x071a('0x34')](function(_0x28f295){if(_0x28f295){return _0x28f295?{'count':_0x22ff10,'rows':_0x28f295}:null;}})[_0x071a('0x34')](respondWithResult(_0x37e3b1,null))[_0x071a('0x54')](handleError(_0x37e3b1,null));};exports[_0x071a('0x79')]=function(_0x275ee7,_0x29cc30,_0x45ce87){return db[_0x071a('0x3e')][_0x071a('0x67')]({'where':{'id':_0x275ee7[_0x071a('0x56')]['id']}})[_0x071a('0x34')](handleEntityNotFound(_0x29cc30,null))[_0x071a('0x34')](function(_0x3481fe){if(_0x3481fe){return db[_0x071a('0x7a')]['transaction'](function(_0x420e44){return db[_0x071a('0x7b')][_0x071a('0x38')]({'where':{'WhatsappAccountId':_0x275ee7[_0x071a('0x56')]['id']},'transaction':_0x420e44})[_0x071a('0x34')](function(_0x4549f7){var _0x47ab74=_[_0x071a('0x43')](_0x275ee7[_0x071a('0x5d')],function(_0x50f3f9){_0x50f3f9[_0x071a('0x65')]=_0x275ee7[_0x071a('0x56')]['id'];return _0x50f3f9;});return db[_0x071a('0x7b')][_0x071a('0x7c')](_0x47ab74,{'transaction':_0x420e44});});})[_0x071a('0x34')](function(){return db['WhatsappApplication']['findAndCountAll']({'where':{'WhatsappAccountId':_0x275ee7[_0x071a('0x56')]['id']},'order':_0x071a('0x7d')});});}})[_0x071a('0x34')](respondWithResult(_0x29cc30,null))[_0x071a('0x54')](handleError(_0x29cc30,null));};exports['getApplications']=function(_0x196517,_0x5190d2,_0x241153){var _0x5b6931={};var _0x4964c9={};var _0x49821e;var _0x79c33a;return db[_0x071a('0x3e')]['findOne']({'where':{'id':_0x196517[_0x071a('0x56')]['id']}})['then'](handleEntityNotFound(_0x5190d2,null))[_0x071a('0x34')](function(_0x20c60f){if(_0x20c60f){_0x49821e=_0x20c60f;_0x4964c9['model']=_[_0x071a('0x45')](db['WhatsappApplication']['rawAttributes']);_0x4964c9['query']=_[_0x071a('0x45')](_0x196517[_0x071a('0x44')]);_0x4964c9[_0x071a('0x4d')]=_['intersection'](_0x4964c9[_0x071a('0x42')],_0x4964c9[_0x071a('0x44')]);_0x5b6931[_0x071a('0x47')]=_[_0x071a('0x46')](_0x4964c9[_0x071a('0x42')],qs[_0x071a('0x48')](_0x196517[_0x071a('0x44')][_0x071a('0x48')]));_0x5b6931['attributes']=_0x5b6931[_0x071a('0x47')][_0x071a('0x58')]?_0x5b6931[_0x071a('0x47')]:_0x4964c9[_0x071a('0x42')];_0x5b6931['order']=qs[_0x071a('0x4c')](_0x196517['query'][_0x071a('0x4c')]);_0x5b6931[_0x071a('0x4f')]=qs[_0x071a('0x4d')](_[_0x071a('0x6a')](_0x196517['query'],_0x4964c9[_0x071a('0x4d')]));if(_0x196517[_0x071a('0x44')]['filter']){_0x5b6931['where']=_['merge'](_0x5b6931['where'],{'$or':_['map'](_0x5b6931[_0x071a('0x47')],function(_0x122528){var _0x4b9172={};_0x4b9172[_0x122528]={'$like':'%'+_0x196517['query']['filter']+'%'};return _0x4b9172;})});}_0x5b6931=_['merge']({},_0x5b6931,_0x196517[_0x071a('0x5a')]);return _0x49821e[_0x071a('0x7e')](_0x5b6931);}})['then'](function(_0x250087){if(_0x250087){_0x79c33a=_0x250087[_0x071a('0x58')];if(!_0x196517['query'][_0x071a('0x49')](_0x071a('0x4a'))){_0x5b6931[_0x071a('0x2e')]=qs[_0x071a('0x2e')](_0x196517['query'][_0x071a('0x2e')]);_0x5b6931[_0x071a('0x4b')]=qs['offset'](_0x196517['query'][_0x071a('0x4b')]);}return _0x49821e[_0x071a('0x7e')](_0x5b6931);}})[_0x071a('0x34')](function(_0x555f32){if(_0x555f32){return _0x555f32?{'count':_0x79c33a,'rows':_0x555f32}:null;}})[_0x071a('0x34')](respondWithResult(_0x5190d2,null))['catch'](handleError(_0x5190d2,null));};exports['notify']=function(_0x3a66b7,_0x269220,_0xfed515){var _0x2f8949={'channel':_0x071a('0x7f')};var _0x5b2ba7=[];var _0x449e47=[];var _0x50be0c={};return db[_0x071a('0x3e')][_0x071a('0x5b')]({'where':{'id':_0x3a66b7[_0x071a('0x56')]['id']},'include':[{'model':db[_0x071a('0x7b')],'as':'Applications'}]})['then'](handleEntityNotFound(_0x269220,null))[_0x071a('0x34')](function(_0x2b28f1){_0x2f8949[_0x071a('0x80')]=_0x2b28f1;_0x2f8949[_0x071a('0x81')]=_[_0x071a('0x82')](_0x2b28f1[_0x071a('0x83')],['priority'],[_0x071a('0x84')]);if(_0x2f8949[_0x071a('0x80')]['Applications']){delete _0x2f8949[_0x071a('0x80')]['Applications'];}return db[_0x071a('0x85')][_0x071a('0x63')]();})['then'](function(_0x47e2b5){if(!_0x47e2b5){throw new db[(_0x071a('0x86'))][(_0x071a('0x87'))](_0x071a('0x88'));}_0x5b2ba7=_[_0x071a('0x89')](_[_0x071a('0x45')](_0x47e2b5),[_0x071a('0x8a'),'updatedAt']);_0x449e47=_[_0x071a('0x89')](_[_0x071a('0x45')](_0x47e2b5),['createdAt',_0x071a('0x8b'),'CompanyId','ListId']);_0x2f8949['body']={'mapKey':_0x071a('0x8c')};if(_0x2f8949[_0x071a('0x80')][_0x071a('0x41')]&&_0x2f8949['account'][_0x071a('0x41')]===_0x071a('0x8d')){_0x2f8949[_0x071a('0x5d')][_0x071a('0x8e')]=_0x3a66b7[_0x071a('0x5d')][_0x071a('0x8f')][_0x071a('0x90')]('whatsapp:','');_0x2f8949['body']['body']=_0x3a66b7[_0x071a('0x5d')]['Body'];_0x2f8949[_0x071a('0x5d')][_0x071a('0x91')]=_0x3a66b7[_0x071a('0x5d')]['MessageSid'];}if(_0x2f8949['body']['id']){delete _0x2f8949[_0x071a('0x5d')]['id'];}if(_[_0x071a('0x92')](_0x2f8949[_0x071a('0x5d')]['from'])){throw new db[(_0x071a('0x86'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0x071a('0x92')](_0x2f8949[_0x071a('0x5d')][_0x071a('0x5d')])||_0x2f8949[_0x071a('0x5d')]['body']===''){throw new db['Sequelize'][(_0x071a('0x87'))](_0x071a('0x93'));}if(_[_0x071a('0x92')](_0x2f8949[_0x071a('0x5d')][_0x071a('0x94')])){throw new db[(_0x071a('0x86'))][(_0x071a('0x87'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x449e47);}if(!_[_0x071a('0x95')](_0x449e47,_0x2f8949[_0x071a('0x5d')][_0x071a('0x94')])){throw new db['Sequelize'][(_0x071a('0x87'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x449e47);}_0x50be0c[_0x2f8949[_0x071a('0x5d')][_0x071a('0x94')]]=_0x2f8949[_0x071a('0x5d')][_0x071a('0x8e')];return db[_0x071a('0x96')][_0x071a('0x5b')]({'where':{'id':_0x2f8949[_0x071a('0x80')]['ListId']},'include':[{'model':db[_0x071a('0x85')],'as':'Contacts','where':_0x50be0c,'limit':0x1,'order':[['updatedAt','DESC']]}]});})[_0x071a('0x34')](handleEntityNotFound(_0x269220,null))['then'](function(_0x4659c8){if(_0x4659c8){_0x2f8949['list']=_[_0x071a('0x71')](_0x4659c8,[_0x071a('0x97')]);if(_0x4659c8['Contacts'][_0x071a('0x58')]){return _0x4659c8[_0x071a('0x97')][0x0];}var _0x5d6ab1=_[_0x071a('0x98')](_0x2f8949[_0x071a('0x5d')],{'firstName':_0x2f8949[_0x071a('0x5d')][_0x071a('0x8e')],'ListId':_0x4659c8['id']});_0x5d6ab1[_0x2f8949[_0x071a('0x5d')][_0x071a('0x94')]]=_0x2f8949['body'][_0x071a('0x8e')];return db['CmContact'][_0x071a('0x5c')](_0x5d6ab1,{'fields':_0x5b2ba7,'raw':!![]});}})['then'](handleEntityNotFound(_0x269220,null))[_0x071a('0x34')](function(_0x200ec1){if(_0x200ec1){_0x2f8949[_0x071a('0x99')]=_0x200ec1;var _0x3eaf59={'ContactId':_0x200ec1['id'],'phone':_0x2f8949['body']['from'],'WhatsappAccountId':_0x3a66b7[_0x071a('0x56')]['id']};var _0x24687d={'ContactId':_0x200ec1['id'],'WhatsappAccountId':_0x3a66b7[_0x071a('0x56')]['id'],'closed':![]};return db['WhatsappInteraction'][_0x071a('0x5b')]({'where':_0x24687d})[_0x071a('0x34')](function(_0x1011d2){if(_0x1011d2){return[_0x1011d2,![]];}return db[_0x071a('0x9a')]['create'](_0x3eaf59)['then'](function(_0x268391){return[_0x268391,!![]];});});}})['spread'](function(_0x1e76a5,_0x4d7166){_0x2f8949['interaction']=_0x1e76a5[_0x071a('0x35')]({'plain':!![]});_0x2f8949['interaction'][_0x071a('0x9b')]=![];if(_0x4d7166){if(_0x2f8949[_0x071a('0x80')][_0x071a('0x9c')]){_0x2f8949[_0x071a('0x81')][_0x071a('0x9d')]({'id':0x0,'priority':_0x2f8949[_0x071a('0x81')][_0x071a('0x58')]+0x1,'app':_0x071a('0x9e'),'appdata':_0x071a('0x9f'),'interval':_0x071a('0xa0')});}_0x2f8949['interaction'][_0x071a('0x9b')]=!![];}return db[_0x071a('0xa1')]['create']({'phone':_0x2f8949[_0x071a('0x5d')][_0x071a('0x8e')],'messageId':_0x2f8949[_0x071a('0x5d')]['messageId'],'body':_0x2f8949[_0x071a('0x5d')]['body'],'WhatsappAccountId':_0x3a66b7[_0x071a('0x56')]['id'],'WhatsappInteractionId':_0x1e76a5['id'],'direction':'in','ContactId':_0x1e76a5[_0x071a('0xa2')],'AttachmentId':_0x2f8949[_0x071a('0x5d')][_0x071a('0xa3')]});})[_0x071a('0x34')](function(_0x108aab){_0x2f8949[_0x071a('0x25')]=_0x108aab;if(_0x2f8949[_0x071a('0xa4')][_0x071a('0xa5')]){return db['User'][_0x071a('0x5b')]({'attributes':['id',_0x071a('0x3a')],'where':{'id':_0x2f8949[_0x071a('0xa4')]['UserId']}})[_0x071a('0x34')](function(_0x42453d){if(_0x42453d){_0x2f8949['applications'][_0x071a('0xa6')]({'id':0x0,'priority':0x0,'app':_0x071a('0xa7'),'appdata':_0x42453d['name']+','+(_0x2f8949[_0x071a('0x80')][_0x071a('0xa8')]||0xa),'interval':_0x071a('0xa0')});}return respondWithRpcPromise(_0x071a('0xa9'),_0x071a('0xaa'),_0x2f8949);});}return respondWithRpcPromise(_0x071a('0xa9'),_0x071a('0xaa'),_0x2f8949);})[_0x071a('0x34')](function(_0x395653){if(_0x395653){var _0xf2eae8=0xc8;var _0x294e3a=_0x071a('0xab');logger[_0x071a('0x27')](_0x071a('0x22'),_0x294e3a,_0xf2eae8,'entity\x20found');logger[_0x071a('0x21')](_0x071a('0xac'),_0x294e3a,_0xf2eae8,_0x071a('0xad'),JSON['stringify'](_0x395653));if(_0x2f8949[_0x071a('0x80')][_0x071a('0x41')]==='twilio'){return _0x269220[_0x071a('0x2b')](_0xf2eae8)[_0x071a('0x30')](_0x071a('0xae'),_0x071a('0xaf'))[_0x071a('0x3b')](_0x071a('0xb0'));}else{return _0x269220[_0x071a('0x2b')](_0xf2eae8)[_0x071a('0x2c')](_0x395653);}}})[_0x071a('0x54')](handleError(_0x269220,null));};exports[_0x071a('0x3b')]=function(_0x167644,_0x21442e,_0x2ce9d7){var _0x43ff44,_0x6ef985,_0x41fafc;if(_[_0x071a('0x92')](_0x167644[_0x071a('0x5d')][_0x071a('0x5d')])||_0x167644['body'][_0x071a('0x5d')]===''){throw new db['Sequelize'][(_0x071a('0x87'))](_0x071a('0x93'));}if(_[_0x071a('0x92')](_0x167644[_0x071a('0x5d')]['to'])){throw new db['Sequelize'][(_0x071a('0x87'))](_0x071a('0xb1'));}_0x43ff44=_0x167644[_0x071a('0x5d')]['to'];return db[_0x071a('0x3e')][_0x071a('0x5b')]({'where':{'id':_0x167644[_0x071a('0x56')]['id']},'include':[{'model':db['CmList'],'as':_0x071a('0xb2'),'include':[{'model':db[_0x071a('0x85')],'as':_0x071a('0x97'),'where':{'mobile':_0x43ff44},'limit':0x1,'order':[[_0x071a('0x8b'),_0x071a('0xb3')]]}]}]})['then'](handleEntityNotFound(_0x21442e,null))[_0x071a('0x34')](function(_0x5039ac){if(_0x5039ac&&_0x5039ac[_0x071a('0xb2')]){_0x6ef985=_0x5039ac[_0x071a('0x35')]({'plain':!![]});if(_0x6ef985['List']&&_0x6ef985[_0x071a('0xb2')][_0x071a('0x97')][_0x071a('0x58')]){return _0x6ef985['List'][_0x071a('0x97')][0x0];}return db[_0x071a('0x85')][_0x071a('0x5c')](_[_0x071a('0x98')](_0x167644[_0x071a('0x5d')],{'firstName':_0x43ff44,'mobile':_0x43ff44,'phone':_0x43ff44,'ListId':_0x6ef985[_0x071a('0xb4')]}));}})[_0x071a('0x34')](handleEntityNotFound(_0x21442e,null))[_0x071a('0x34')](function(_0x34e8ad){if(_0x34e8ad){_0x41fafc=_0x34e8ad;return db[_0x071a('0x9a')]['find']({'where':{'ContactId':_0x41fafc['id'],'closed':![],'WhatsappAccountId':_0x6ef985['id']}})[_0x071a('0x34')](function(_0x5eced3){if(_0x5eced3){return[_0x5eced3,![]];}return db['WhatsappInteraction']['create']({'UserId':_0x167644[_0x071a('0x5e')]['id'],'ContactId':_0x41fafc['id'],'WhatsappAccountId':_0x6ef985['id'],'phone':_0x43ff44,'firstMsgDirection':_0x071a('0xb5'),'Messages':[_['merge'](_0x167644[_0x071a('0x5d')],{'read':![],'body':_0x167644['body']['body'],'phone':_0x43ff44,'WhatsappAccountId':_0x6ef985['id'],'UserId':_0x167644['user']['id'],'ContactId':_0x41fafc['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':'Messages'}]})[_0x071a('0x34')](function(_0x10cf07){return[_0x10cf07,!![]];});});}})['spread'](function(_0x4c9ee1,_0x11fa91){if(_0x11fa91){return _0x4c9ee1;}return db[_0x071a('0xa1')][_0x071a('0x5c')](_[_0x071a('0x50')](_0x167644[_0x071a('0x5d')],{'read':![],'body':_0x167644[_0x071a('0x5d')][_0x071a('0x5d')],'phone':_0x43ff44,'WhatsappAccountId':_0x6ef985['id'],'WhatsappInteractionId':_0x4c9ee1['id'],'UserId':_0x167644['user']['id'],'ContactId':_0x41fafc['id']}))['then'](function(_0x9c263c){_0x4c9ee1['dataValues'][_0x071a('0xb6')]=[];_0x4c9ee1['dataValues']['Messages']['push'](_0x9c263c[_0x071a('0xb7')]);return _0x4c9ee1;});})[_0x071a('0x34')](respondWithResult(_0x21442e,null))[_0x071a('0x54')](handleError(_0x21442e,null));}; \ No newline at end of file +var _0xb8c4=['send','index','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','type','query','keys','filters','intersection','model','attributes','fields','length','order','sort','where','pick','VIRTUAL','merge','options','include','findAll','rows','show','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','Pause','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','hasOwnProperty','removeDispositions','addAnswer','CannedAnswer','nolimit','filter','removeAnswers','addAgents','ids','omit','spread','emit','removeAgents','userWhatsappAccount:remove','getAgents','findOne','User','addApplications','transaction','WhatsappApplication','findAndCountAll','getApplications','notify','whatsapp','Applications','account','applications','orderBy','priority','asc','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','twilio','From','replace','whatsapp:','Body','messageId','MessageSid','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','ListId','Contacts','DESC','defaults','from','contact','WhatsappInteraction','interaction','created','autoclose','push','unmanaged','*,*,*,*','WhatsappMessage','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','set','Content-Type','text/xml','\x0a','CmList','List','out','Messages','dataValues','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','http','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','destroy','get','WhatsappAccounts','UserProfileResource','name'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb8c4,0x7f));var _0x4b8c=function(_0x33e613,_0x2e55f0){_0x33e613=_0x33e613-0x0;var _0x421c4b=_0xb8c4[_0x33e613];return _0x421c4b;};'use strict';var emlformat=require(_0x4b8c('0x0'));var rimraf=require(_0x4b8c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4b8c('0x2'));var rp=require(_0x4b8c('0x3'));var moment=require('moment');var BPromise=require(_0x4b8c('0x4'));var Mustache=require(_0x4b8c('0x5'));var util=require(_0x4b8c('0x6'));var path=require(_0x4b8c('0x7'));var sox=require(_0x4b8c('0x8'));var csv=require(_0x4b8c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4b8c('0xa'));var squel=require(_0x4b8c('0xb'));var crypto=require(_0x4b8c('0xc'));var jsforce=require(_0x4b8c('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4b8c('0xe'));var Papa=require('papaparse');var Redis=require(_0x4b8c('0xf'));var authService=require(_0x4b8c('0x10'));var qs=require(_0x4b8c('0x11'));var as=require(_0x4b8c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4b8c('0x13'))(_0x4b8c('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4b8c('0x15'));var db=require(_0x4b8c('0x16'))['db'];config[_0x4b8c('0x17')]=_['defaults'](config[_0x4b8c('0x17')],{'host':_0x4b8c('0x18'),'port':0x18eb});var socket=require(_0x4b8c('0x19'))(new Redis(config[_0x4b8c('0x17')]));require(_0x4b8c('0x1a'))[_0x4b8c('0x1b')](socket);var jayson=require(_0x4b8c('0x1c'));var client=jayson[_0x4b8c('0x1d')][_0x4b8c('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x176e75,_0x42dcbd,_0x3c721f,_0x460c43){return new BPromise(function(_0x363d6e,_0x9b61a2){var _0x2f567f=_0x460c43||client;return _0x2f567f['request'](_0x176e75,_0x3c721f)[_0x4b8c('0x1f')](function(_0x2dea47){logger[_0x4b8c('0x20')](_0x4b8c('0x21'),_0x42dcbd,_0x4b8c('0x22'));logger['debug'](_0x4b8c('0x23'),_0x42dcbd,'request\x20sent',JSON[_0x4b8c('0x24')](_0x2dea47));if(_0x2dea47[_0x4b8c('0x25')]){if(_0x2dea47[_0x4b8c('0x25')]['code']===0x1f4){logger[_0x4b8c('0x25')]('WhatsappAccount,\x20%s,\x20%s',_0x42dcbd,_0x2dea47[_0x4b8c('0x25')][_0x4b8c('0x26')]);return _0x9b61a2(_0x2dea47[_0x4b8c('0x25')][_0x4b8c('0x26')]);}logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x42dcbd,_0x2dea47[_0x4b8c('0x25')][_0x4b8c('0x26')]);return _0x363d6e(_0x2dea47['error'][_0x4b8c('0x26')]);}else{logger[_0x4b8c('0x20')](_0x4b8c('0x21'),_0x42dcbd,_0x4b8c('0x22'));_0x363d6e(_0x2dea47[_0x4b8c('0x27')][_0x4b8c('0x26')]);}})[_0x4b8c('0x28')](function(_0x5ae3b2){logger[_0x4b8c('0x25')](_0x4b8c('0x21'),_0x42dcbd,_0x5ae3b2);_0x9b61a2(_0x5ae3b2);});});}function respondWithStatusCode(_0x590cfe,_0x2ad484){_0x2ad484=_0x2ad484||0xcc;return function(_0x2146c8){if(_0x2146c8){return _0x590cfe[_0x4b8c('0x29')](_0x2ad484);}return _0x590cfe[_0x4b8c('0x2a')](_0x2ad484)[_0x4b8c('0x2b')]();};}function respondWithResult(_0x2f8e30,_0x99e475){_0x99e475=_0x99e475||0xc8;return function(_0x40be97){if(_0x40be97){return _0x2f8e30[_0x4b8c('0x2a')](_0x99e475)[_0x4b8c('0x2c')](_0x40be97);}};}function respondWithFilteredResult(_0x2552f0,_0x334629){return function(_0x41894f){if(_0x41894f){var _0x3684b0=typeof _0x334629[_0x4b8c('0x2d')]===_0x4b8c('0x2e')&&typeof _0x334629[_0x4b8c('0x2f')]===_0x4b8c('0x2e');var _0x527e8a=_0x41894f['count'];var _0x6d6286=_0x3684b0?0x0:_0x334629[_0x4b8c('0x2d')];var _0x5a7924=_0x3684b0?_0x41894f[_0x4b8c('0x30')]:_0x334629[_0x4b8c('0x2d')]+_0x334629[_0x4b8c('0x2f')];var _0x503694;if(_0x5a7924>=_0x527e8a){_0x5a7924=_0x527e8a;_0x503694=0xc8;}else{_0x503694=0xce;}_0x2552f0['status'](_0x503694);return _0x2552f0['set']('Content-Range',_0x6d6286+'-'+_0x5a7924+'/'+_0x527e8a)[_0x4b8c('0x2c')](_0x41894f);}return null;};}function patchUpdates(_0x4631e0){return function(_0x1bff7e){try{jsonpatch[_0x4b8c('0x31')](_0x1bff7e,_0x4631e0,!![]);}catch(_0x4d3ca9){return BPromise[_0x4b8c('0x32')](_0x4d3ca9);}return _0x1bff7e[_0x4b8c('0x33')]();};}function saveUpdates(_0x491b18,_0x378a76){return function(_0x13e8fb){if(_0x13e8fb){return _0x13e8fb[_0x4b8c('0x34')](_0x491b18)[_0x4b8c('0x1f')](function(_0x5e4a06){return _0x5e4a06;});}return null;};}function removeEntity(_0x9d4c4b,_0xc9dcfa){return function(_0xc6e09b){if(_0xc6e09b){return _0xc6e09b[_0x4b8c('0x35')]()[_0x4b8c('0x1f')](function(){var _0x426ab7=_0xc6e09b[_0x4b8c('0x36')]({'plain':!![]});var _0x1181e0=_0x4b8c('0x37');return db[_0x4b8c('0x38')]['destroy']({'where':{'type':_0x1181e0,'resourceId':_0x426ab7['id']}})[_0x4b8c('0x1f')](function(){return _0xc6e09b;});})['then'](function(){_0x9d4c4b[_0x4b8c('0x2a')](0xcc)[_0x4b8c('0x2b')]();});}};}function handleEntityNotFound(_0x5246d0,_0x41a421){return function(_0x5c31a7){if(!_0x5c31a7){_0x5246d0[_0x4b8c('0x29')](0x194);}return _0x5c31a7;};}function handleError(_0x4cc5ff,_0xba38db){_0xba38db=_0xba38db||0x1f4;return function(_0x426fef){logger['error'](_0x426fef['stack']);if(_0x426fef[_0x4b8c('0x39')]){delete _0x426fef[_0x4b8c('0x39')];}_0x4cc5ff[_0x4b8c('0x2a')](_0xba38db)[_0x4b8c('0x3a')](_0x426fef);};}exports[_0x4b8c('0x3b')]=function(_0x1bb47e,_0x422024){var _0x2f8aa8={'include':[{'model':db['Pause'],'as':_0x4b8c('0x3c')}]},_0x2bbfae={},_0x28d055={'count':0x0,'rows':[]};var _0x14d88f=_[_0x4b8c('0x3d')](db[_0x4b8c('0x3e')][_0x4b8c('0x3f')],function(_0x402a65){return{'name':_0x402a65['fieldName'],'type':_0x402a65[_0x4b8c('0x40')]['key']};});_0x2bbfae['model']=_[_0x4b8c('0x3d')](_0x14d88f,_0x4b8c('0x39'));_0x2bbfae[_0x4b8c('0x41')]=_[_0x4b8c('0x42')](_0x1bb47e[_0x4b8c('0x41')]);_0x2bbfae[_0x4b8c('0x43')]=_[_0x4b8c('0x44')](_0x2bbfae[_0x4b8c('0x45')],_0x2bbfae[_0x4b8c('0x41')]);_0x2f8aa8[_0x4b8c('0x46')]=_[_0x4b8c('0x44')](_0x2bbfae[_0x4b8c('0x45')],qs[_0x4b8c('0x47')](_0x1bb47e['query'][_0x4b8c('0x47')]));_0x2f8aa8[_0x4b8c('0x46')]=_0x2f8aa8[_0x4b8c('0x46')][_0x4b8c('0x48')]?_0x2f8aa8['attributes']:_0x2bbfae[_0x4b8c('0x45')];if(!_0x1bb47e[_0x4b8c('0x41')]['hasOwnProperty']('nolimit')){_0x2f8aa8['limit']=qs['limit'](_0x1bb47e[_0x4b8c('0x41')][_0x4b8c('0x2f')]);_0x2f8aa8[_0x4b8c('0x2d')]=qs[_0x4b8c('0x2d')](_0x1bb47e[_0x4b8c('0x41')][_0x4b8c('0x2d')]);}_0x2f8aa8[_0x4b8c('0x49')]=qs['sort'](_0x1bb47e[_0x4b8c('0x41')][_0x4b8c('0x4a')]);_0x2f8aa8[_0x4b8c('0x4b')]=qs[_0x4b8c('0x43')](_[_0x4b8c('0x4c')](_0x1bb47e[_0x4b8c('0x41')],_0x2bbfae[_0x4b8c('0x43')]),_0x14d88f);if(_0x1bb47e['query']['filter']){_0x2f8aa8[_0x4b8c('0x4b')]=_['merge'](_0x2f8aa8['where'],{'$or':_['map'](_0x14d88f,function(_0x3fbb3c){if(_0x3fbb3c['type']!==_0x4b8c('0x4d')){var _0xd20c19={};_0xd20c19[_0x3fbb3c[_0x4b8c('0x39')]]={'$like':'%'+_0x1bb47e[_0x4b8c('0x41')]['filter']+'%'};return _0xd20c19;}})});}_0x2f8aa8=_[_0x4b8c('0x4e')]({},_0x2f8aa8,_0x1bb47e[_0x4b8c('0x4f')]);var _0x3f6eb6={'where':_0x2f8aa8[_0x4b8c('0x4b')]};return db[_0x4b8c('0x3e')][_0x4b8c('0x30')](_0x3f6eb6)[_0x4b8c('0x1f')](function(_0x4dfda3){_0x28d055[_0x4b8c('0x30')]=_0x4dfda3;if(_0x1bb47e['query']['includeAll']){_0x2f8aa8[_0x4b8c('0x50')]=[{'all':!![]}];}return db[_0x4b8c('0x3e')][_0x4b8c('0x51')](_0x2f8aa8);})[_0x4b8c('0x1f')](function(_0x20a5fb){_0x28d055[_0x4b8c('0x52')]=_0x20a5fb;return _0x28d055;})[_0x4b8c('0x1f')](respondWithFilteredResult(_0x422024,_0x2f8aa8))['catch'](handleError(_0x422024,null));};exports[_0x4b8c('0x53')]=function(_0x165f6f,_0x5f32ba){var _0x5dbe9d={'raw':![],'where':{'id':_0x165f6f['params']['id']},'include':[{'model':db['Pause'],'as':_0x4b8c('0x3c')}]},_0x5ae6fb={};_0x5ae6fb[_0x4b8c('0x45')]=_['keys'](db[_0x4b8c('0x3e')]['rawAttributes']);_0x5ae6fb[_0x4b8c('0x41')]=_['keys'](_0x165f6f[_0x4b8c('0x41')]);_0x5ae6fb[_0x4b8c('0x43')]=_[_0x4b8c('0x44')](_0x5ae6fb[_0x4b8c('0x45')],_0x5ae6fb['query']);_0x5dbe9d['attributes']=_[_0x4b8c('0x44')](_0x5ae6fb[_0x4b8c('0x45')],qs[_0x4b8c('0x47')](_0x165f6f[_0x4b8c('0x41')]['fields']));_0x5dbe9d[_0x4b8c('0x46')]=_0x5dbe9d[_0x4b8c('0x46')][_0x4b8c('0x48')]?_0x5dbe9d[_0x4b8c('0x46')]:_0x5ae6fb['model'];if(_0x165f6f['query'][_0x4b8c('0x54')]){_0x5dbe9d[_0x4b8c('0x50')]=[{'all':!![]}];}_0x5dbe9d=_['merge']({},_0x5dbe9d,_0x165f6f[_0x4b8c('0x4f')]);return db[_0x4b8c('0x3e')][_0x4b8c('0x55')](_0x5dbe9d)[_0x4b8c('0x1f')](handleEntityNotFound(_0x5f32ba,null))['then'](respondWithResult(_0x5f32ba,null))[_0x4b8c('0x28')](handleError(_0x5f32ba,null));};exports[_0x4b8c('0x56')]=function(_0x29c09a,_0x1cf257){return db[_0x4b8c('0x3e')][_0x4b8c('0x56')](_0x29c09a[_0x4b8c('0x57')],{})[_0x4b8c('0x1f')](function(_0x518dda){var _0xe27ed3=_0x29c09a[_0x4b8c('0x58')]['get']({'plain':!![]});if(!_0xe27ed3)throw new Error(_0x4b8c('0x59'));if(_0xe27ed3[_0x4b8c('0x5a')]===_0x4b8c('0x58')){var _0x540d4f=_0x518dda[_0x4b8c('0x36')]({'plain':!![]});var _0x3b56ee='WhatsappAccounts';return db[_0x4b8c('0x5b')]['find']({'where':{'name':_0x3b56ee,'userProfileId':_0xe27ed3['userProfileId']},'raw':!![]})[_0x4b8c('0x1f')](function(_0xeb8ed4){if(_0xeb8ed4&&_0xeb8ed4[_0x4b8c('0x5c')]===0x0){return db[_0x4b8c('0x38')][_0x4b8c('0x56')]({'name':_0x540d4f[_0x4b8c('0x39')],'resourceId':_0x540d4f['id'],'type':_0xeb8ed4['name'],'sectionId':_0xeb8ed4['id']},{})[_0x4b8c('0x1f')](function(){return _0x518dda;});}else{return _0x518dda;}})[_0x4b8c('0x28')](function(_0x368f16){logger[_0x4b8c('0x25')](_0x4b8c('0x5d'),_0x368f16);throw _0x368f16;});}return _0x518dda;})[_0x4b8c('0x1f')](respondWithResult(_0x1cf257,0xc9))[_0x4b8c('0x28')](handleError(_0x1cf257,null));};exports[_0x4b8c('0x34')]=function(_0x2b6fc4,_0x520767){if(_0x2b6fc4[_0x4b8c('0x57')]['id']){delete _0x2b6fc4['body']['id'];}return db[_0x4b8c('0x3e')][_0x4b8c('0x55')]({'where':{'id':_0x2b6fc4[_0x4b8c('0x5e')]['id']},'include':[{'model':db[_0x4b8c('0x5f')],'as':'mandatoryDispositionPause'}]})[_0x4b8c('0x1f')](handleEntityNotFound(_0x520767,null))['then'](saveUpdates(_0x2b6fc4[_0x4b8c('0x57')],null))[_0x4b8c('0x1f')](respondWithResult(_0x520767,null))[_0x4b8c('0x28')](handleError(_0x520767,null));};exports['destroy']=function(_0x4bb296,_0x45c26d){return db[_0x4b8c('0x3e')][_0x4b8c('0x55')]({'where':{'id':_0x4bb296['params']['id']}})[_0x4b8c('0x1f')](handleEntityNotFound(_0x45c26d,null))[_0x4b8c('0x1f')](removeEntity(_0x45c26d,null))[_0x4b8c('0x28')](handleError(_0x45c26d,null));};exports[_0x4b8c('0x60')]=function(_0x1936b6,_0x22471c){return db[_0x4b8c('0x3e')][_0x4b8c('0x60')]()[_0x4b8c('0x1f')](respondWithResult(_0x22471c,null))['catch'](handleError(_0x22471c,null));};exports[_0x4b8c('0x61')]=function(_0x2f3547,_0x217789,_0x5139d5){if(_0x2f3547['body']['id']){delete _0x2f3547[_0x4b8c('0x57')]['id'];}return db[_0x4b8c('0x3e')][_0x4b8c('0x55')]({'where':{'id':_0x2f3547[_0x4b8c('0x5e')]['id']}})[_0x4b8c('0x1f')](handleEntityNotFound(_0x217789,null))[_0x4b8c('0x1f')](function(_0x185627){if(_0x185627){_0x2f3547[_0x4b8c('0x57')][_0x4b8c('0x62')]=_0x185627['id'];return db[_0x4b8c('0x63')][_0x4b8c('0x56')](_0x2f3547[_0x4b8c('0x57')]);}})[_0x4b8c('0x1f')](respondWithResult(_0x217789,null))['catch'](handleError(_0x217789,null));};exports[_0x4b8c('0x64')]=function(_0x53cb29,_0x1ea5f3,_0x141e81){var _0x20d693={'raw':![],'where':{}};var _0x5daba5={};var _0x40dce2={'count':0x0,'rows':[]};return db[_0x4b8c('0x3e')]['findOne']({'where':{'id':_0x53cb29['params']['id']}})[_0x4b8c('0x1f')](handleEntityNotFound(_0x1ea5f3,null))['then'](function(_0x311fb1){if(_0x311fb1){_0x5daba5[_0x4b8c('0x45')]=_[_0x4b8c('0x42')](db[_0x4b8c('0x63')][_0x4b8c('0x3f')]);_0x5daba5[_0x4b8c('0x41')]=_[_0x4b8c('0x42')](_0x53cb29[_0x4b8c('0x41')]);_0x5daba5[_0x4b8c('0x43')]=_['intersection'](_0x5daba5[_0x4b8c('0x45')],_0x5daba5[_0x4b8c('0x41')]);_0x20d693['attributes']=_['intersection'](_0x5daba5['model'],qs[_0x4b8c('0x47')](_0x53cb29[_0x4b8c('0x41')]['fields']));_0x20d693[_0x4b8c('0x46')]=_0x20d693[_0x4b8c('0x46')][_0x4b8c('0x48')]?_0x20d693[_0x4b8c('0x46')]:_0x5daba5[_0x4b8c('0x45')];if(!_0x53cb29[_0x4b8c('0x41')][_0x4b8c('0x65')]('nolimit')){_0x20d693[_0x4b8c('0x2f')]=qs[_0x4b8c('0x2f')](_0x53cb29['query']['limit']);_0x20d693[_0x4b8c('0x2d')]=qs[_0x4b8c('0x2d')](_0x53cb29[_0x4b8c('0x41')][_0x4b8c('0x2d')]);}_0x20d693['order']=qs[_0x4b8c('0x4a')](_0x53cb29[_0x4b8c('0x41')][_0x4b8c('0x4a')]);_0x20d693['where']=qs[_0x4b8c('0x43')](_[_0x4b8c('0x4c')](_0x53cb29[_0x4b8c('0x41')],_0x5daba5['filters']));_0x20d693['where']['WhatsappAccountId']=_0x311fb1['id'];if(_0x53cb29[_0x4b8c('0x41')]['filter']){_0x20d693[_0x4b8c('0x4b')]=_[_0x4b8c('0x4e')](_0x20d693['where'],{'$or':_[_0x4b8c('0x3d')](_0x20d693['attributes'],function(_0xfee341){var _0x3c248b={};_0x3c248b[_0xfee341]={'$like':'%'+_0x53cb29[_0x4b8c('0x41')]['filter']+'%'};return _0x3c248b;})});}_0x20d693=_[_0x4b8c('0x4e')]({},_0x20d693,_0x53cb29['options']);return db['Disposition'][_0x4b8c('0x30')]({'where':_0x20d693[_0x4b8c('0x4b')]})[_0x4b8c('0x1f')](function(_0x2d2b34){_0x40dce2[_0x4b8c('0x30')]=_0x2d2b34;if(_0x53cb29['query'][_0x4b8c('0x54')]){_0x20d693[_0x4b8c('0x50')]=[{'all':!![]}];}return db['Disposition'][_0x4b8c('0x51')](_0x20d693);})[_0x4b8c('0x1f')](function(_0x2fb68){_0x40dce2[_0x4b8c('0x52')]=_0x2fb68;return _0x40dce2;});}})[_0x4b8c('0x1f')](respondWithFilteredResult(_0x1ea5f3,_0x20d693))[_0x4b8c('0x28')](handleError(_0x1ea5f3,null));};exports['removeDispositions']=function(_0x5b6229,_0x1e0195,_0x420516){return db[_0x4b8c('0x3e')]['find']({'where':{'id':_0x5b6229['params']['id']}})[_0x4b8c('0x1f')](handleEntityNotFound(_0x1e0195,null))['then'](function(_0x2cd2a2){if(_0x2cd2a2){return _0x2cd2a2[_0x4b8c('0x66')](_0x5b6229[_0x4b8c('0x41')]['ids']);}})[_0x4b8c('0x1f')](respondWithStatusCode(_0x1e0195,null))[_0x4b8c('0x28')](handleError(_0x1e0195,null));};exports[_0x4b8c('0x67')]=function(_0x5c2547,_0x24b577,_0x24eeb6){if(_0x5c2547[_0x4b8c('0x57')]['id']){delete _0x5c2547[_0x4b8c('0x57')]['id'];}return db[_0x4b8c('0x3e')]['find']({'where':{'id':_0x5c2547[_0x4b8c('0x5e')]['id']}})[_0x4b8c('0x1f')](handleEntityNotFound(_0x24b577,null))[_0x4b8c('0x1f')](function(_0x5663ae){if(_0x5663ae){_0x5c2547[_0x4b8c('0x57')][_0x4b8c('0x62')]=_0x5663ae['id'];return db[_0x4b8c('0x68')]['create'](_0x5c2547[_0x4b8c('0x57')]);}})[_0x4b8c('0x1f')](respondWithResult(_0x24b577,null))[_0x4b8c('0x28')](handleError(_0x24b577,null));};exports['getAnswers']=function(_0xdbe81c,_0x1f56fa,_0x1cdc91){var _0xc2a7c5={'raw':![],'where':{}};var _0x337b4b={};var _0x417d21={'count':0x0,'rows':[]};return db[_0x4b8c('0x3e')]['findOne']({'where':{'id':_0xdbe81c[_0x4b8c('0x5e')]['id']}})[_0x4b8c('0x1f')](handleEntityNotFound(_0x1f56fa,null))[_0x4b8c('0x1f')](function(_0xc0a05d){if(_0xc0a05d){_0x337b4b[_0x4b8c('0x45')]=_[_0x4b8c('0x42')](db['CannedAnswer'][_0x4b8c('0x3f')]);_0x337b4b[_0x4b8c('0x41')]=_[_0x4b8c('0x42')](_0xdbe81c[_0x4b8c('0x41')]);_0x337b4b[_0x4b8c('0x43')]=_[_0x4b8c('0x44')](_0x337b4b['model'],_0x337b4b['query']);_0xc2a7c5[_0x4b8c('0x46')]=_['intersection'](_0x337b4b[_0x4b8c('0x45')],qs[_0x4b8c('0x47')](_0xdbe81c[_0x4b8c('0x41')][_0x4b8c('0x47')]));_0xc2a7c5[_0x4b8c('0x46')]=_0xc2a7c5[_0x4b8c('0x46')][_0x4b8c('0x48')]?_0xc2a7c5[_0x4b8c('0x46')]:_0x337b4b['model'];if(!_0xdbe81c[_0x4b8c('0x41')][_0x4b8c('0x65')](_0x4b8c('0x69'))){_0xc2a7c5[_0x4b8c('0x2f')]=qs['limit'](_0xdbe81c[_0x4b8c('0x41')][_0x4b8c('0x2f')]);_0xc2a7c5[_0x4b8c('0x2d')]=qs[_0x4b8c('0x2d')](_0xdbe81c[_0x4b8c('0x41')][_0x4b8c('0x2d')]);}_0xc2a7c5['order']=qs[_0x4b8c('0x4a')](_0xdbe81c[_0x4b8c('0x41')][_0x4b8c('0x4a')]);_0xc2a7c5[_0x4b8c('0x4b')]=qs[_0x4b8c('0x43')](_[_0x4b8c('0x4c')](_0xdbe81c['query'],_0x337b4b['filters']));_0xc2a7c5[_0x4b8c('0x4b')][_0x4b8c('0x62')]=_0xc0a05d['id'];if(_0xdbe81c[_0x4b8c('0x41')]['filter']){_0xc2a7c5[_0x4b8c('0x4b')]=_[_0x4b8c('0x4e')](_0xc2a7c5[_0x4b8c('0x4b')],{'$or':_['map'](_0xc2a7c5['attributes'],function(_0x228162){var _0x3b5b20={};_0x3b5b20[_0x228162]={'$like':'%'+_0xdbe81c[_0x4b8c('0x41')][_0x4b8c('0x6a')]+'%'};return _0x3b5b20;})});}_0xc2a7c5=_[_0x4b8c('0x4e')]({},_0xc2a7c5,_0xdbe81c[_0x4b8c('0x4f')]);return db[_0x4b8c('0x68')][_0x4b8c('0x30')]({'where':_0xc2a7c5['where']})['then'](function(_0x223976){_0x417d21['count']=_0x223976;if(_0xdbe81c[_0x4b8c('0x41')][_0x4b8c('0x54')]){_0xc2a7c5[_0x4b8c('0x50')]=[{'all':!![]}];}return db[_0x4b8c('0x68')][_0x4b8c('0x51')](_0xc2a7c5);})[_0x4b8c('0x1f')](function(_0x75f7e1){_0x417d21[_0x4b8c('0x52')]=_0x75f7e1;return _0x417d21;});}})[_0x4b8c('0x1f')](respondWithFilteredResult(_0x1f56fa,_0xc2a7c5))[_0x4b8c('0x28')](handleError(_0x1f56fa,null));};exports[_0x4b8c('0x6b')]=function(_0x43b87b,_0x22bacd,_0x3d7f55){return db[_0x4b8c('0x3e')][_0x4b8c('0x55')]({'where':{'id':_0x43b87b[_0x4b8c('0x5e')]['id']}})[_0x4b8c('0x1f')](handleEntityNotFound(_0x22bacd,null))['then'](function(_0x5bef63){if(_0x5bef63){return _0x5bef63['removeAnswers'](_0x43b87b[_0x4b8c('0x41')]['ids']);}})[_0x4b8c('0x1f')](respondWithStatusCode(_0x22bacd,null))[_0x4b8c('0x28')](handleError(_0x22bacd,null));};exports['addAgents']=function(_0x11897e,_0xa0536c,_0x25d3a2){return db['WhatsappAccount']['find']({'where':{'id':_0x11897e[_0x4b8c('0x5e')]['id']}})[_0x4b8c('0x1f')](handleEntityNotFound(_0xa0536c,null))[_0x4b8c('0x1f')](function(_0x315b6d){if(_0x315b6d){return _0x315b6d[_0x4b8c('0x6c')](_0x11897e[_0x4b8c('0x57')][_0x4b8c('0x6d')],_[_0x4b8c('0x6e')](_0x11897e['body'],[_0x4b8c('0x6d'),'id'])||{})[_0x4b8c('0x6f')](function(_0x127f9d){for(var _0x54915c=0x0;_0x54915c<_0x11897e[_0x4b8c('0x57')][_0x4b8c('0x6d')][_0x4b8c('0x48')];_0x54915c+=0x1){socket[_0x4b8c('0x70')]('userWhatsappAccount:save',{'UserId':Number(_0x11897e[_0x4b8c('0x57')]['ids'][_0x54915c]),'WhatsappAccountId':Number(_0x11897e['params']['id'])});}return _0x127f9d;});}})[_0x4b8c('0x1f')](respondWithResult(_0xa0536c,null))[_0x4b8c('0x28')](handleError(_0xa0536c,null));};exports[_0x4b8c('0x71')]=function(_0x5d74bb,_0x5dd520,_0x2c92cd){return db[_0x4b8c('0x3e')][_0x4b8c('0x55')]({'where':{'id':_0x5d74bb[_0x4b8c('0x5e')]['id']}})[_0x4b8c('0x1f')](handleEntityNotFound(_0x5dd520,null))[_0x4b8c('0x1f')](function(_0x371604){if(_0x371604){return _0x371604[_0x4b8c('0x71')](_0x5d74bb[_0x4b8c('0x41')][_0x4b8c('0x6d')])[_0x4b8c('0x1f')](function(){if(_['isArray'](_0x5d74bb[_0x4b8c('0x41')][_0x4b8c('0x6d')])){for(var _0x41eb37=0x0;_0x41eb37<_0x5d74bb[_0x4b8c('0x41')]['ids']['length'];_0x41eb37+=0x1){socket['emit'](_0x4b8c('0x72'),{'UserId':Number(_0x5d74bb['query'][_0x4b8c('0x6d')][_0x41eb37]),'WhatsappAccountId':Number(_0x5d74bb[_0x4b8c('0x5e')]['id'])});}}else{socket[_0x4b8c('0x70')](_0x4b8c('0x72'),{'UserId':Number(_0x5d74bb[_0x4b8c('0x41')][_0x4b8c('0x6d')]),'WhatsappAccountId':Number(_0x5d74bb[_0x4b8c('0x5e')]['id'])});}});}})[_0x4b8c('0x1f')](respondWithStatusCode(_0x5dd520,null))['catch'](handleError(_0x5dd520,null));};exports[_0x4b8c('0x73')]=function(_0x3eed73,_0x3c5304,_0x1bfa72){var _0x2b3c3b={};var _0x577074={};var _0x5d0ee0;var _0x2895dc;return db['WhatsappAccount'][_0x4b8c('0x74')]({'where':{'id':_0x3eed73[_0x4b8c('0x5e')]['id']}})[_0x4b8c('0x1f')](handleEntityNotFound(_0x3c5304,null))[_0x4b8c('0x1f')](function(_0x3b1a3c){if(_0x3b1a3c){_0x5d0ee0=_0x3b1a3c;_0x577074[_0x4b8c('0x45')]=_[_0x4b8c('0x42')](db[_0x4b8c('0x75')][_0x4b8c('0x3f')]);_0x577074['query']=_[_0x4b8c('0x42')](_0x3eed73[_0x4b8c('0x41')]);_0x577074['filters']=_[_0x4b8c('0x44')](_0x577074['model'],_0x577074[_0x4b8c('0x41')]);_0x2b3c3b[_0x4b8c('0x46')]=_[_0x4b8c('0x44')](_0x577074[_0x4b8c('0x45')],qs[_0x4b8c('0x47')](_0x3eed73['query'][_0x4b8c('0x47')]));_0x2b3c3b[_0x4b8c('0x46')]=_0x2b3c3b[_0x4b8c('0x46')][_0x4b8c('0x48')]?_0x2b3c3b[_0x4b8c('0x46')]:_0x577074[_0x4b8c('0x45')];_0x2b3c3b['order']=qs['sort'](_0x3eed73[_0x4b8c('0x41')][_0x4b8c('0x4a')]);_0x2b3c3b[_0x4b8c('0x4b')]=qs[_0x4b8c('0x43')](_[_0x4b8c('0x4c')](_0x3eed73[_0x4b8c('0x41')],_0x577074[_0x4b8c('0x43')]));if(_0x3eed73[_0x4b8c('0x41')][_0x4b8c('0x6a')]){_0x2b3c3b[_0x4b8c('0x4b')]=_[_0x4b8c('0x4e')](_0x2b3c3b[_0x4b8c('0x4b')],{'$or':_[_0x4b8c('0x3d')](_0x2b3c3b[_0x4b8c('0x46')],function(_0x31d1fb){var _0x331822={};_0x331822[_0x31d1fb]={'$like':'%'+_0x3eed73[_0x4b8c('0x41')]['filter']+'%'};return _0x331822;})});}_0x2b3c3b=_[_0x4b8c('0x4e')]({},_0x2b3c3b,_0x3eed73['options']);return _0x5d0ee0[_0x4b8c('0x73')](_0x2b3c3b);}})[_0x4b8c('0x1f')](function(_0x48257a){if(_0x48257a){_0x2895dc=_0x48257a['length'];if(!_0x3eed73[_0x4b8c('0x41')][_0x4b8c('0x65')]('nolimit')){_0x2b3c3b['limit']=qs[_0x4b8c('0x2f')](_0x3eed73[_0x4b8c('0x41')][_0x4b8c('0x2f')]);_0x2b3c3b[_0x4b8c('0x2d')]=qs[_0x4b8c('0x2d')](_0x3eed73[_0x4b8c('0x41')][_0x4b8c('0x2d')]);}return _0x5d0ee0['getAgents'](_0x2b3c3b);}})[_0x4b8c('0x1f')](function(_0x2204e1){if(_0x2204e1){return _0x2204e1?{'count':_0x2895dc,'rows':_0x2204e1}:null;}})[_0x4b8c('0x1f')](respondWithResult(_0x3c5304,null))[_0x4b8c('0x28')](handleError(_0x3c5304,null));};exports[_0x4b8c('0x76')]=function(_0x4028db,_0x5ceb42,_0x33dae4){return db['WhatsappAccount'][_0x4b8c('0x74')]({'where':{'id':_0x4028db[_0x4b8c('0x5e')]['id']}})['then'](handleEntityNotFound(_0x5ceb42,null))['then'](function(_0x12eb95){if(_0x12eb95){return db['sequelize'][_0x4b8c('0x77')](function(_0x144ddc){return db['WhatsappApplication']['destroy']({'where':{'WhatsappAccountId':_0x4028db[_0x4b8c('0x5e')]['id']},'transaction':_0x144ddc})['then'](function(_0x297392){var _0x51b5d5=_[_0x4b8c('0x3d')](_0x4028db[_0x4b8c('0x57')],function(_0x2160fc){_0x2160fc['WhatsappAccountId']=_0x4028db[_0x4b8c('0x5e')]['id'];return _0x2160fc;});return db[_0x4b8c('0x78')]['bulkCreate'](_0x51b5d5,{'transaction':_0x144ddc});});})[_0x4b8c('0x1f')](function(){return db[_0x4b8c('0x78')][_0x4b8c('0x79')]({'where':{'WhatsappAccountId':_0x4028db['params']['id']},'order':'priority'});});}})['then'](respondWithResult(_0x5ceb42,null))[_0x4b8c('0x28')](handleError(_0x5ceb42,null));};exports[_0x4b8c('0x7a')]=function(_0x279df1,_0x35165b,_0xd10dfa){var _0x1097f5={};var _0x5c8088={};var _0x885a1c;var _0x292c0c;return db[_0x4b8c('0x3e')][_0x4b8c('0x74')]({'where':{'id':_0x279df1[_0x4b8c('0x5e')]['id']}})[_0x4b8c('0x1f')](handleEntityNotFound(_0x35165b,null))[_0x4b8c('0x1f')](function(_0x51fda3){if(_0x51fda3){_0x885a1c=_0x51fda3;_0x5c8088['model']=_['keys'](db[_0x4b8c('0x78')][_0x4b8c('0x3f')]);_0x5c8088[_0x4b8c('0x41')]=_[_0x4b8c('0x42')](_0x279df1[_0x4b8c('0x41')]);_0x5c8088['filters']=_[_0x4b8c('0x44')](_0x5c8088[_0x4b8c('0x45')],_0x5c8088[_0x4b8c('0x41')]);_0x1097f5[_0x4b8c('0x46')]=_[_0x4b8c('0x44')](_0x5c8088[_0x4b8c('0x45')],qs['fields'](_0x279df1['query']['fields']));_0x1097f5[_0x4b8c('0x46')]=_0x1097f5[_0x4b8c('0x46')][_0x4b8c('0x48')]?_0x1097f5[_0x4b8c('0x46')]:_0x5c8088[_0x4b8c('0x45')];_0x1097f5[_0x4b8c('0x49')]=qs[_0x4b8c('0x4a')](_0x279df1['query'][_0x4b8c('0x4a')]);_0x1097f5[_0x4b8c('0x4b')]=qs[_0x4b8c('0x43')](_[_0x4b8c('0x4c')](_0x279df1[_0x4b8c('0x41')],_0x5c8088['filters']));if(_0x279df1[_0x4b8c('0x41')][_0x4b8c('0x6a')]){_0x1097f5['where']=_[_0x4b8c('0x4e')](_0x1097f5[_0x4b8c('0x4b')],{'$or':_[_0x4b8c('0x3d')](_0x1097f5[_0x4b8c('0x46')],function(_0x23ded0){var _0x1281fe={};_0x1281fe[_0x23ded0]={'$like':'%'+_0x279df1[_0x4b8c('0x41')]['filter']+'%'};return _0x1281fe;})});}_0x1097f5=_[_0x4b8c('0x4e')]({},_0x1097f5,_0x279df1[_0x4b8c('0x4f')]);return _0x885a1c[_0x4b8c('0x7a')](_0x1097f5);}})[_0x4b8c('0x1f')](function(_0x103731){if(_0x103731){_0x292c0c=_0x103731['length'];if(!_0x279df1['query'][_0x4b8c('0x65')]('nolimit')){_0x1097f5[_0x4b8c('0x2f')]=qs[_0x4b8c('0x2f')](_0x279df1[_0x4b8c('0x41')][_0x4b8c('0x2f')]);_0x1097f5[_0x4b8c('0x2d')]=qs[_0x4b8c('0x2d')](_0x279df1[_0x4b8c('0x41')]['offset']);}return _0x885a1c[_0x4b8c('0x7a')](_0x1097f5);}})['then'](function(_0x5c3819){if(_0x5c3819){return _0x5c3819?{'count':_0x292c0c,'rows':_0x5c3819}:null;}})[_0x4b8c('0x1f')](respondWithResult(_0x35165b,null))[_0x4b8c('0x28')](handleError(_0x35165b,null));};exports[_0x4b8c('0x7b')]=function(_0x46bafe,_0x1ca2e4,_0x71f0c){var _0x4c0cdc={'channel':_0x4b8c('0x7c')};var _0x278bf2=[];var _0x362713=[];var _0x2d1f2d={};return db['WhatsappAccount'][_0x4b8c('0x55')]({'where':{'id':_0x46bafe[_0x4b8c('0x5e')]['id']},'include':[{'model':db[_0x4b8c('0x78')],'as':_0x4b8c('0x7d')}]})[_0x4b8c('0x1f')](handleEntityNotFound(_0x1ca2e4,null))[_0x4b8c('0x1f')](function(_0x393369){_0x4c0cdc[_0x4b8c('0x7e')]=_0x393369;_0x4c0cdc[_0x4b8c('0x7f')]=_[_0x4b8c('0x80')](_0x393369[_0x4b8c('0x7d')],[_0x4b8c('0x81')],[_0x4b8c('0x82')]);if(_0x4c0cdc['account'][_0x4b8c('0x7d')]){delete _0x4c0cdc[_0x4b8c('0x7e')][_0x4b8c('0x7d')];}return db[_0x4b8c('0x83')][_0x4b8c('0x60')]();})[_0x4b8c('0x1f')](function(_0x20e6b0){if(!_0x20e6b0){throw new db[(_0x4b8c('0x84'))][(_0x4b8c('0x85'))]('no\x20available\x20attributes');}_0x278bf2=_[_0x4b8c('0x86')](_[_0x4b8c('0x42')](_0x20e6b0),[_0x4b8c('0x87'),'updatedAt']);_0x362713=_['difference'](_[_0x4b8c('0x42')](_0x20e6b0),[_0x4b8c('0x87'),_0x4b8c('0x88'),_0x4b8c('0x89'),'ListId']);_0x4c0cdc[_0x4b8c('0x57')]={'mapKey':'mobile'};if(_0x4c0cdc[_0x4b8c('0x7e')]['type']&&_0x4c0cdc[_0x4b8c('0x7e')]['type']===_0x4b8c('0x8a')){_0x4c0cdc[_0x4b8c('0x57')]['from']=_0x46bafe[_0x4b8c('0x57')][_0x4b8c('0x8b')][_0x4b8c('0x8c')](_0x4b8c('0x8d'),'');_0x4c0cdc[_0x4b8c('0x57')][_0x4b8c('0x57')]=_0x46bafe[_0x4b8c('0x57')][_0x4b8c('0x8e')];_0x4c0cdc[_0x4b8c('0x57')][_0x4b8c('0x8f')]=_0x46bafe[_0x4b8c('0x57')][_0x4b8c('0x90')];}if(_0x4c0cdc[_0x4b8c('0x57')]['id']){delete _0x4c0cdc[_0x4b8c('0x57')]['id'];}if(_[_0x4b8c('0x91')](_0x4c0cdc['body']['from'])){throw new db[(_0x4b8c('0x84'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0x4b8c('0x91')](_0x4c0cdc[_0x4b8c('0x57')][_0x4b8c('0x57')])||_0x4c0cdc['body'][_0x4b8c('0x57')]===''){throw new db['Sequelize'][(_0x4b8c('0x85'))](_0x4b8c('0x92'));}if(_['isNil'](_0x4c0cdc['body'][_0x4b8c('0x93')])){throw new db[(_0x4b8c('0x84'))][(_0x4b8c('0x85'))](_0x4b8c('0x94')+_0x362713);}if(!_[_0x4b8c('0x95')](_0x362713,_0x4c0cdc[_0x4b8c('0x57')][_0x4b8c('0x93')])){throw new db[(_0x4b8c('0x84'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x362713);}_0x2d1f2d[_0x4c0cdc[_0x4b8c('0x57')][_0x4b8c('0x93')]]=_0x4c0cdc[_0x4b8c('0x57')]['from'];return db['CmList'][_0x4b8c('0x55')]({'where':{'id':_0x4c0cdc['account'][_0x4b8c('0x96')]},'include':[{'model':db[_0x4b8c('0x83')],'as':_0x4b8c('0x97'),'where':_0x2d1f2d,'limit':0x1,'order':[[_0x4b8c('0x88'),_0x4b8c('0x98')]]}]});})['then'](handleEntityNotFound(_0x1ca2e4,null))[_0x4b8c('0x1f')](function(_0x4c2d1e){if(_0x4c2d1e){_0x4c0cdc['list']=_[_0x4b8c('0x6e')](_0x4c2d1e,['Contacts']);if(_0x4c2d1e[_0x4b8c('0x97')]['length']){return _0x4c2d1e[_0x4b8c('0x97')][0x0];}var _0x3e8962=_[_0x4b8c('0x99')](_0x4c0cdc[_0x4b8c('0x57')],{'firstName':_0x4c0cdc[_0x4b8c('0x57')][_0x4b8c('0x9a')],'ListId':_0x4c2d1e['id']});_0x3e8962[_0x4c0cdc[_0x4b8c('0x57')][_0x4b8c('0x93')]]=_0x4c0cdc[_0x4b8c('0x57')][_0x4b8c('0x9a')];return db['CmContact'][_0x4b8c('0x56')](_0x3e8962,{'fields':_0x278bf2,'raw':!![]});}})[_0x4b8c('0x1f')](handleEntityNotFound(_0x1ca2e4,null))[_0x4b8c('0x1f')](function(_0x108d9f){if(_0x108d9f){_0x4c0cdc[_0x4b8c('0x9b')]=_0x108d9f;var _0x2f1b69={'ContactId':_0x108d9f['id'],'phone':_0x4c0cdc[_0x4b8c('0x57')][_0x4b8c('0x9a')],'WhatsappAccountId':_0x46bafe[_0x4b8c('0x5e')]['id']};var _0x1fa337={'ContactId':_0x108d9f['id'],'WhatsappAccountId':_0x46bafe[_0x4b8c('0x5e')]['id'],'closed':![]};return db[_0x4b8c('0x9c')][_0x4b8c('0x55')]({'where':_0x1fa337})[_0x4b8c('0x1f')](function(_0x2ade5b){if(_0x2ade5b){return[_0x2ade5b,![]];}return db[_0x4b8c('0x9c')]['create'](_0x2f1b69)[_0x4b8c('0x1f')](function(_0x538b92){return[_0x538b92,!![]];});});}})[_0x4b8c('0x6f')](function(_0x50395a,_0x2b653a){_0x4c0cdc['interaction']=_0x50395a['get']({'plain':!![]});_0x4c0cdc[_0x4b8c('0x9d')][_0x4b8c('0x9e')]=![];if(_0x2b653a){if(_0x4c0cdc[_0x4b8c('0x7e')][_0x4b8c('0x9f')]){_0x4c0cdc[_0x4b8c('0x7f')][_0x4b8c('0xa0')]({'id':0x0,'priority':_0x4c0cdc[_0x4b8c('0x7f')][_0x4b8c('0x48')]+0x1,'app':'close','appdata':_0x4b8c('0xa1'),'interval':_0x4b8c('0xa2')});}_0x4c0cdc[_0x4b8c('0x9d')][_0x4b8c('0x9e')]=!![];}return db[_0x4b8c('0xa3')][_0x4b8c('0x56')]({'phone':_0x4c0cdc[_0x4b8c('0x57')][_0x4b8c('0x9a')],'messageId':_0x4c0cdc[_0x4b8c('0x57')][_0x4b8c('0x8f')],'body':_0x4c0cdc[_0x4b8c('0x57')][_0x4b8c('0x57')],'WhatsappAccountId':_0x46bafe[_0x4b8c('0x5e')]['id'],'WhatsappInteractionId':_0x50395a['id'],'direction':'in','ContactId':_0x50395a[_0x4b8c('0xa4')],'AttachmentId':_0x4c0cdc['body'][_0x4b8c('0xa5')]});})[_0x4b8c('0x1f')](function(_0x3a1c8b){_0x4c0cdc[_0x4b8c('0x26')]=_0x3a1c8b;if(_0x4c0cdc[_0x4b8c('0x9d')][_0x4b8c('0xa6')]){return db[_0x4b8c('0x75')]['find']({'attributes':['id',_0x4b8c('0x39')],'where':{'id':_0x4c0cdc[_0x4b8c('0x9d')][_0x4b8c('0xa6')]}})['then'](function(_0x2ce06e){if(_0x2ce06e){_0x4c0cdc[_0x4b8c('0x7f')][_0x4b8c('0xa7')]({'id':0x0,'priority':0x0,'app':_0x4b8c('0xa8'),'appdata':_0x2ce06e['name']+','+(_0x4c0cdc[_0x4b8c('0x7e')][_0x4b8c('0xa9')]||0xa),'interval':_0x4b8c('0xa2')});}return respondWithRpcPromise(_0x4b8c('0xaa'),_0x4b8c('0xab'),_0x4c0cdc);});}return respondWithRpcPromise(_0x4b8c('0xaa'),_0x4b8c('0xab'),_0x4c0cdc);})['then'](function(_0xf7e075){if(_0xf7e075){var _0x90567a=0xc8;var _0x4d6e84=_0x4b8c('0xac');logger[_0x4b8c('0x20')](_0x4b8c('0x23'),_0x4d6e84,_0x90567a,'entity\x20found');logger[_0x4b8c('0xad')](_0x4b8c('0xae'),_0x4d6e84,_0x90567a,_0x4b8c('0xaf'),JSON[_0x4b8c('0x24')](_0xf7e075));if(_0x4c0cdc[_0x4b8c('0x7e')][_0x4b8c('0x40')]===_0x4b8c('0x8a')){return _0x1ca2e4[_0x4b8c('0x2a')](_0x90567a)[_0x4b8c('0xb0')](_0x4b8c('0xb1'),_0x4b8c('0xb2'))[_0x4b8c('0x3a')](_0x4b8c('0xb3'));}else{return _0x1ca2e4[_0x4b8c('0x2a')](_0x90567a)[_0x4b8c('0x2c')](_0xf7e075);}}})[_0x4b8c('0x28')](handleError(_0x1ca2e4,null));};exports[_0x4b8c('0x3a')]=function(_0x577cfc,_0x2b3cf7,_0x45cf93){var _0x39b4a0,_0x2c8b6c,_0x453862;if(_['isNil'](_0x577cfc[_0x4b8c('0x57')][_0x4b8c('0x57')])||_0x577cfc[_0x4b8c('0x57')]['body']===''){throw new db['Sequelize'][(_0x4b8c('0x85'))](_0x4b8c('0x92'));}if(_['isNil'](_0x577cfc[_0x4b8c('0x57')]['to'])){throw new db[(_0x4b8c('0x84'))][(_0x4b8c('0x85'))]('to\x20is\x20mandatory');}_0x39b4a0=_0x577cfc[_0x4b8c('0x57')]['to'];return db[_0x4b8c('0x3e')]['find']({'where':{'id':_0x577cfc[_0x4b8c('0x5e')]['id']},'include':[{'model':db[_0x4b8c('0xb4')],'as':_0x4b8c('0xb5'),'include':[{'model':db[_0x4b8c('0x83')],'as':'Contacts','where':{'mobile':_0x39b4a0},'limit':0x1,'order':[[_0x4b8c('0x88'),_0x4b8c('0x98')]]}]}]})[_0x4b8c('0x1f')](handleEntityNotFound(_0x2b3cf7,null))['then'](function(_0x5893a7){if(_0x5893a7&&_0x5893a7[_0x4b8c('0xb5')]){_0x2c8b6c=_0x5893a7[_0x4b8c('0x36')]({'plain':!![]});if(_0x2c8b6c[_0x4b8c('0xb5')]&&_0x2c8b6c[_0x4b8c('0xb5')][_0x4b8c('0x97')]['length']){return _0x2c8b6c[_0x4b8c('0xb5')]['Contacts'][0x0];}return db[_0x4b8c('0x83')][_0x4b8c('0x56')](_[_0x4b8c('0x99')](_0x577cfc[_0x4b8c('0x57')],{'firstName':_0x39b4a0,'mobile':_0x39b4a0,'phone':_0x39b4a0,'ListId':_0x2c8b6c['ListId']}));}})[_0x4b8c('0x1f')](handleEntityNotFound(_0x2b3cf7,null))['then'](function(_0x566928){if(_0x566928){_0x453862=_0x566928;return db[_0x4b8c('0x9c')][_0x4b8c('0x55')]({'where':{'ContactId':_0x453862['id'],'closed':![],'WhatsappAccountId':_0x2c8b6c['id']}})['then'](function(_0x342fa2){if(_0x342fa2){return[_0x342fa2,![]];}return db[_0x4b8c('0x9c')]['create']({'UserId':_0x577cfc[_0x4b8c('0x58')]['id'],'ContactId':_0x453862['id'],'WhatsappAccountId':_0x2c8b6c['id'],'phone':_0x39b4a0,'firstMsgDirection':_0x4b8c('0xb6'),'Messages':[_['merge'](_0x577cfc[_0x4b8c('0x57')],{'read':![],'body':_0x577cfc[_0x4b8c('0x57')]['body'],'phone':_0x39b4a0,'WhatsappAccountId':_0x2c8b6c['id'],'UserId':_0x577cfc[_0x4b8c('0x58')]['id'],'ContactId':_0x453862['id']})]},{'include':[{'model':db[_0x4b8c('0xa3')],'as':_0x4b8c('0xb7')}]})[_0x4b8c('0x1f')](function(_0x47b99f){return[_0x47b99f,!![]];});});}})[_0x4b8c('0x6f')](function(_0x2027ed,_0x124e57){if(_0x124e57){return _0x2027ed;}return db['WhatsappMessage']['create'](_[_0x4b8c('0x4e')](_0x577cfc[_0x4b8c('0x57')],{'read':![],'body':_0x577cfc[_0x4b8c('0x57')][_0x4b8c('0x57')],'phone':_0x39b4a0,'WhatsappAccountId':_0x2c8b6c['id'],'WhatsappInteractionId':_0x2027ed['id'],'UserId':_0x577cfc[_0x4b8c('0x58')]['id'],'ContactId':_0x453862['id']}))[_0x4b8c('0x1f')](function(_0x16ef60){_0x2027ed[_0x4b8c('0xb8')]['Messages']=[];_0x2027ed[_0x4b8c('0xb8')]['Messages'][_0x4b8c('0xa0')](_0x16ef60['dataValues']);return _0x2027ed;});})[_0x4b8c('0x1f')](respondWithResult(_0x2b3cf7,null))[_0x4b8c('0x28')](handleError(_0x2b3cf7,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index de27e65..ed525ca 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 _0x89d9=['events','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x89d9,0x188));var _0x989d=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x89d9[_0x122ef9];return _0x42fba0;};'use strict';var EventEmitter=require(_0x989d('0x0'));var WhatsappAccount=require('../../mysqldb')['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x989d('0x1')](0x0);var events={'afterCreate':_0x989d('0x2'),'afterUpdate':_0x989d('0x3'),'afterDestroy':_0x989d('0x4')};function emitEvent(_0x250920){return function(_0x73e1fd,_0x3a2720,_0x28f5ff){WhatsappAccountEvents[_0x989d('0x5')](_0x250920+':'+_0x73e1fd['id'],_0x73e1fd);WhatsappAccountEvents['emit'](_0x250920,_0x73e1fd);_0x28f5ff(null);};}for(var e in events){if(events[_0x989d('0x6')](e)){var event=events[e];WhatsappAccount[_0x989d('0x7')](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents; \ No newline at end of file +var _0x4100=['setMaxListeners','update','emit','hasOwnProperty','events','../../mysqldb'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0x4100,0x64));var _0x0410=function(_0xb4bc7d,_0xdfaaa3){_0xb4bc7d=_0xb4bc7d-0x0;var _0x47102f=_0x4100[_0xb4bc7d];return _0x47102f;};'use strict';var EventEmitter=require(_0x0410('0x0'));var WhatsappAccount=require(_0x0410('0x1'))['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x0410('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0410('0x3'),'afterDestroy':'remove'};function emitEvent(_0xc3a5a9){return function(_0x4bce9b,_0x400eeb,_0x317509){WhatsappAccountEvents[_0x0410('0x4')](_0xc3a5a9+':'+_0x4bce9b['id'],_0x4bce9b);WhatsappAccountEvents['emit'](_0xc3a5a9,_0x4bce9b);_0x317509(null);};}for(var e in events){if(events[_0x0410('0x5')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 3b7d69c..2a4ed3b 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 _0x6da6=['exports','define','WhatsappAccount','whatsapp_accounts','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappAccount.attributes'];(function(_0x18c89b,_0x10b2c4){var _0x46c8bb=function(_0x28d7ca){while(--_0x28d7ca){_0x18c89b['push'](_0x18c89b['shift']());}};_0x46c8bb(++_0x10b2c4);}(_0x6da6,0x1a4));var _0x66da=function(_0x1e574e,_0x15c156){_0x1e574e=_0x1e574e-0x0;var _0x523b60=_0x6da6[_0x1e574e];return _0x523b60;};'use strict';var _=require(_0x66da('0x0'));var util=require(_0x66da('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x66da('0x2'));var BPromise=require(_0x66da('0x3'));var rp=require(_0x66da('0x4'));var fs=require('fs');var path=require(_0x66da('0x5'));var rimraf=require(_0x66da('0x6'));var config=require(_0x66da('0x7'));var attributes=require(_0x66da('0x8'));module[_0x66da('0x9')]=function(_0x276cb2,_0x455146){return _0x276cb2[_0x66da('0xa')](_0x66da('0xb'),attributes,{'tableName':_0x66da('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x00fe=['moment','bluebird','path','rimraf','../../config/environment','./whatsappAccount.attributes','exports','define','WhatsappAccount','whatsapp_accounts','util','../../config/logger','api'];(function(_0x519fad,_0xf67331){var _0x285ab9=function(_0x56d23b){while(--_0x56d23b){_0x519fad['push'](_0x519fad['shift']());}};_0x285ab9(++_0xf67331);}(_0x00fe,0x10e));var _0xe00f=function(_0x47a349,_0x4699d9){_0x47a349=_0x47a349-0x0;var _0x18ab75=_0x00fe[_0x47a349];return _0x18ab75;};'use strict';var _=require('lodash');var util=require(_0xe00f('0x0'));var logger=require(_0xe00f('0x1'))(_0xe00f('0x2'));var moment=require(_0xe00f('0x3'));var BPromise=require(_0xe00f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe00f('0x5'));var rimraf=require(_0xe00f('0x6'));var config=require(_0xe00f('0x7'));var attributes=require(_0xe00f('0x8'));module[_0xe00f('0x9')]=function(_0x41488b,_0x3361e8){return _0x41488b[_0xe00f('0xa')](_0xe00f('0xb'),attributes,{'tableName':_0xe00f('0xc'),'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 28198dc..98afc7c 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 _0xdf5d=['register','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','ShowWhatsappAccount','find','options','where','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket'];(function(_0x445101,_0x2414bf){var _0x3c3d04=function(_0x249067){while(--_0x249067){_0x445101['push'](_0x445101['shift']());}};_0x3c3d04(++_0x2414bf);}(_0xdf5d,0x126));var _0xddf5=function(_0x2e2d30,_0x3ee772){_0x2e2d30=_0x2e2d30-0x0;var _0x34ebbf=_0xdf5d[_0x2e2d30];return _0x34ebbf;};'use strict';var _=require(_0xddf5('0x0'));var util=require(_0xddf5('0x1'));var moment=require(_0xddf5('0x2'));var BPromise=require(_0xddf5('0x3'));var rs=require(_0xddf5('0x4'));var fs=require('fs');var Redis=require(_0xddf5('0x5'));var db=require(_0xddf5('0x6'))['db'];var utils=require(_0xddf5('0x7'));var logger=require('../../config/logger')(_0xddf5('0x8'));var config=require(_0xddf5('0x9'));var jayson=require(_0xddf5('0xa'));var client=jayson[_0xddf5('0xb')][_0xddf5('0xc')]({'port':0x232a});config[_0xddf5('0xd')]=_[_0xddf5('0xe')](config[_0xddf5('0xd')],{'host':_0xddf5('0xf'),'port':0x18eb});var socket=require(_0xddf5('0x10'))(new Redis(config[_0xddf5('0xd')]));require(_0xddf5('0x11'))[_0xddf5('0x12')](socket);function respondWithRpcPromise(_0x3e50f2,_0x10191b,_0x3e675b){return new BPromise(function(_0x5a4f45,_0x161973){return client[_0xddf5('0x13')](_0x3e50f2,_0x3e675b)[_0xddf5('0x14')](function(_0x10245f){logger[_0xddf5('0x15')](_0xddf5('0x16'),_0x10191b,_0xddf5('0x17'));logger[_0xddf5('0x18')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x10191b,'request\x20sent',JSON[_0xddf5('0x19')](_0x10245f));if(_0x10245f[_0xddf5('0x1a')]){if(_0x10245f[_0xddf5('0x1a')][_0xddf5('0x1b')]===0x1f4){logger[_0xddf5('0x1a')](_0xddf5('0x16'),_0x10191b,_0x10245f[_0xddf5('0x1a')][_0xddf5('0x1c')]);return _0x161973(_0x10245f['error'][_0xddf5('0x1c')]);}logger[_0xddf5('0x1a')](_0xddf5('0x16'),_0x10191b,_0x10245f[_0xddf5('0x1a')][_0xddf5('0x1c')]);return _0x5a4f45(_0x10245f['error'][_0xddf5('0x1c')]);}else{logger['info'](_0xddf5('0x16'),_0x10191b,'request\x20sent');_0x5a4f45(_0x10245f[_0xddf5('0x1d')][_0xddf5('0x1c')]);}})[_0xddf5('0x1e')](function(_0x1cd984){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x10191b,_0x1cd984);_0x161973(_0x1cd984);});});}exports[_0xddf5('0x1f')]=function(_0x5bc606){var _0x175a5c=this;return new Promise(function(_0x1abfb2,_0x5e5537){return db['WhatsappAccount'][_0xddf5('0x20')]({'raw':_0x5bc606[_0xddf5('0x21')]?_0x5bc606[_0xddf5('0x21')]['raw']===undefined?!![]:![]:!![],'where':_0x5bc606[_0xddf5('0x21')]?_0x5bc606[_0xddf5('0x21')][_0xddf5('0x22')]||null:null,'attributes':_0x5bc606[_0xddf5('0x21')]?_0x5bc606['options'][_0xddf5('0x23')]||null:null,'include':_0x5bc606[_0xddf5('0x21')]?_0x5bc606['options'][_0xddf5('0x24')]?_[_0xddf5('0x25')](_0x5bc606[_0xddf5('0x21')][_0xddf5('0x24')],function(_0x49c381){return{'model':db[_0x49c381[_0xddf5('0x26')]],'as':_0x49c381['as'],'attributes':_0x49c381[_0xddf5('0x23')],'include':_0x49c381[_0xddf5('0x24')]?_[_0xddf5('0x25')](_0x49c381[_0xddf5('0x24')],function(_0x4caa12){return{'model':db[_0x4caa12[_0xddf5('0x26')]],'as':_0x4caa12['as'],'attributes':_0x4caa12[_0xddf5('0x23')],'include':_0x4caa12['include']?_['map'](_0x4caa12[_0xddf5('0x24')],function(_0x45a53f){return{'model':db[_0x45a53f[_0xddf5('0x26')]],'as':_0x45a53f['as'],'attributes':_0x45a53f[_0xddf5('0x23')]};}):[]};}):[]};}):[]:[]})[_0xddf5('0x14')](function(_0x1a476d){logger['info'](_0xddf5('0x1f'),_0x5bc606);logger[_0xddf5('0x18')]('ShowWhatsappAccount',_0x5bc606,JSON[_0xddf5('0x19')](_0x1a476d));_0x1abfb2(_0x1a476d);})[_0xddf5('0x1e')](function(_0x281307){logger['error']('ShowWhatsappAccount',_0x281307['message'],_0x5bc606);_0x5e5537(_0x175a5c[_0xddf5('0x1a')](0x1f4,_0x281307[_0xddf5('0x1c')]));});});}; \ No newline at end of file +var _0x9fd3=['socket.io-emitter','./whatsappAccount.socket','register','request','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','WhatsappAccount','options','raw','where','attributes','include','map','model','then','ShowWhatsappAccount','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost'];(function(_0x37ef6e,_0x53e586){var _0x5df448=function(_0x558824){while(--_0x558824){_0x37ef6e['push'](_0x37ef6e['shift']());}};_0x5df448(++_0x53e586);}(_0x9fd3,0x8e));var _0x39fd=function(_0x50af94,_0x2af691){_0x50af94=_0x50af94-0x0;var _0x2c54a0=_0x9fd3[_0x50af94];return _0x2c54a0;};'use strict';var _=require(_0x39fd('0x0'));var util=require(_0x39fd('0x1'));var moment=require(_0x39fd('0x2'));var BPromise=require(_0x39fd('0x3'));var rs=require(_0x39fd('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x39fd('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x39fd('0x6'))(_0x39fd('0x7'));var config=require(_0x39fd('0x8'));var jayson=require(_0x39fd('0x9'));var client=jayson[_0x39fd('0xa')][_0x39fd('0xb')]({'port':0x232a});config[_0x39fd('0xc')]=_['defaults'](config['redis'],{'host':_0x39fd('0xd'),'port':0x18eb});var socket=require(_0x39fd('0xe'))(new Redis(config[_0x39fd('0xc')]));require(_0x39fd('0xf'))[_0x39fd('0x10')](socket);function respondWithRpcPromise(_0x545ef8,_0x327b0f,_0x5559b8){return new BPromise(function(_0x525f43,_0x5543f9){return client[_0x39fd('0x11')](_0x545ef8,_0x5559b8)['then'](function(_0x52ba89){logger['info'](_0x39fd('0x12'),_0x327b0f,_0x39fd('0x13'));logger[_0x39fd('0x14')](_0x39fd('0x15'),_0x327b0f,_0x39fd('0x13'),JSON[_0x39fd('0x16')](_0x52ba89));if(_0x52ba89[_0x39fd('0x17')]){if(_0x52ba89[_0x39fd('0x17')][_0x39fd('0x18')]===0x1f4){logger[_0x39fd('0x17')]('WhatsappAccount,\x20%s,\x20%s',_0x327b0f,_0x52ba89[_0x39fd('0x17')][_0x39fd('0x19')]);return _0x5543f9(_0x52ba89[_0x39fd('0x17')]['message']);}logger[_0x39fd('0x17')](_0x39fd('0x12'),_0x327b0f,_0x52ba89['error']['message']);return _0x525f43(_0x52ba89[_0x39fd('0x17')]['message']);}else{logger[_0x39fd('0x1a')](_0x39fd('0x12'),_0x327b0f,_0x39fd('0x13'));_0x525f43(_0x52ba89[_0x39fd('0x1b')][_0x39fd('0x19')]);}})[_0x39fd('0x1c')](function(_0x2cf82f){logger[_0x39fd('0x17')](_0x39fd('0x12'),_0x327b0f,_0x2cf82f);_0x5543f9(_0x2cf82f);});});}exports['ShowWhatsappAccount']=function(_0x37fc13){var _0xd69fdb=this;return new Promise(function(_0x2ce7da,_0x295fac){return db[_0x39fd('0x1d')]['find']({'raw':_0x37fc13[_0x39fd('0x1e')]?_0x37fc13[_0x39fd('0x1e')][_0x39fd('0x1f')]===undefined?!![]:![]:!![],'where':_0x37fc13[_0x39fd('0x1e')]?_0x37fc13['options'][_0x39fd('0x20')]||null:null,'attributes':_0x37fc13['options']?_0x37fc13[_0x39fd('0x1e')][_0x39fd('0x21')]||null:null,'include':_0x37fc13[_0x39fd('0x1e')]?_0x37fc13['options'][_0x39fd('0x22')]?_[_0x39fd('0x23')](_0x37fc13[_0x39fd('0x1e')][_0x39fd('0x22')],function(_0x31281c){return{'model':db[_0x31281c[_0x39fd('0x24')]],'as':_0x31281c['as'],'attributes':_0x31281c[_0x39fd('0x21')],'include':_0x31281c[_0x39fd('0x22')]?_['map'](_0x31281c[_0x39fd('0x22')],function(_0x2b4142){return{'model':db[_0x2b4142[_0x39fd('0x24')]],'as':_0x2b4142['as'],'attributes':_0x2b4142[_0x39fd('0x21')],'include':_0x2b4142['include']?_['map'](_0x2b4142['include'],function(_0xb6bacb){return{'model':db[_0xb6bacb[_0x39fd('0x24')]],'as':_0xb6bacb['as'],'attributes':_0xb6bacb[_0x39fd('0x21')]};}):[]};}):[]};}):[]:[]})[_0x39fd('0x25')](function(_0x237adc){logger[_0x39fd('0x1a')](_0x39fd('0x26'),_0x37fc13);logger[_0x39fd('0x14')]('ShowWhatsappAccount',_0x37fc13,JSON[_0x39fd('0x16')](_0x237adc));_0x2ce7da(_0x237adc);})[_0x39fd('0x1c')](function(_0x529852){logger[_0x39fd('0x17')](_0x39fd('0x26'),_0x529852[_0x39fd('0x19')],_0x37fc13);_0x295fac(_0xd69fdb[_0x39fd('0x17')](0x1f4,_0x529852[_0x39fd('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 2172cdc..58c0909 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 _0x4a58=['./whatsappAccount.events','save','remove','length','whatsappAccount:'];(function(_0x203d86,_0x4fbf88){var _0x3082bf=function(_0x25892f){while(--_0x25892f){_0x203d86['push'](_0x203d86['shift']());}};_0x3082bf(++_0x4fbf88);}(_0x4a58,0x168));var _0x84a5=function(_0x428d55,_0x4e5e47){_0x428d55=_0x428d55-0x0;var _0x4ba5fc=_0x4a58[_0x428d55];return _0x4ba5fc;};'use strict';var WhatsappAccountEvents=require(_0x84a5('0x0'));var events=[_0x84a5('0x1'),_0x84a5('0x2'),'update'];function createListener(_0x387365,_0x54203d){return function(_0x10f01c){_0x54203d['emit'](_0x387365,_0x10f01c);};}function removeListener(_0x42f03e,_0x292c5f){return function(){WhatsappAccountEvents['removeListener'](_0x42f03e,_0x292c5f);};}exports['register']=function(_0x587ac3){for(var _0x3f8d4b=0x0,_0x118ac4=events[_0x84a5('0x3')];_0x3f8d4b<_0x118ac4;_0x3f8d4b++){var _0x391506=events[_0x3f8d4b];var _0x46c7fe=createListener(_0x84a5('0x4')+_0x391506,_0x587ac3);WhatsappAccountEvents['on'](_0x391506,_0x46c7fe);}}; \ No newline at end of file +var _0x4175=['length','whatsappAccount:','./whatsappAccount.events','remove','update','emit','removeListener','register'];(function(_0x593571,_0x2dd4be){var _0xa390cf=function(_0x44acd6){while(--_0x44acd6){_0x593571['push'](_0x593571['shift']());}};_0xa390cf(++_0x2dd4be);}(_0x4175,0x12a));var _0x5417=function(_0x44752e,_0x411c63){_0x44752e=_0x44752e-0x0;var _0x2d66da=_0x4175[_0x44752e];return _0x2d66da;};'use strict';var WhatsappAccountEvents=require(_0x5417('0x0'));var events=['save',_0x5417('0x1'),_0x5417('0x2')];function createListener(_0x1fdf8d,_0x21a7f5){return function(_0x52fbbc){_0x21a7f5[_0x5417('0x3')](_0x1fdf8d,_0x52fbbc);};}function removeListener(_0x158417,_0x4f552d){return function(){WhatsappAccountEvents[_0x5417('0x4')](_0x158417,_0x4f552d);};}exports[_0x5417('0x5')]=function(_0x2826e5){for(var _0x362aa9=0x0,_0x2ad7f8=events[_0x5417('0x6')];_0x362aa9<_0x2ad7f8;_0x362aa9++){var _0x54e20f=events[_0x362aa9];var _0x3ad9cc=createListener(_0x5417('0x7')+_0x54e20f,_0x2826e5);WhatsappAccountEvents['on'](_0x54e20f,_0x3ad9cc);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index f330463..2501b7d 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 _0x3d64=['post','isAuthenticated','put','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','/:id','show'];(function(_0x2423f5,_0x467b43){var _0xa6366a=function(_0x4ee90b){while(--_0x4ee90b){_0x2423f5['push'](_0x2423f5['shift']());}};_0xa6366a(++_0x467b43);}(_0x3d64,0x1a8));var _0x43d6=function(_0x435d0c,_0x36e154){_0x435d0c=_0x435d0c-0x0;var _0x9839e4=_0x3d64[_0x435d0c];return _0x9839e4;};'use strict';var multer=require(_0x43d6('0x0'));var util=require(_0x43d6('0x1'));var path=require('path');var timeout=require(_0x43d6('0x2'));var express=require(_0x43d6('0x3'));var router=express[_0x43d6('0x4')]();var fs_extra=require(_0x43d6('0x5'));var auth=require(_0x43d6('0x6'));var interaction=require(_0x43d6('0x7'));var config=require(_0x43d6('0x8'));var controller=require(_0x43d6('0x9'));router[_0x43d6('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x43d6('0xa')](_0x43d6('0xb'),auth['isAuthenticated'](),controller[_0x43d6('0xc')]);router[_0x43d6('0xd')]('/',auth[_0x43d6('0xe')](),controller['create']);router[_0x43d6('0xf')](_0x43d6('0xb'),auth[_0x43d6('0xe')](),controller[_0x43d6('0x10')]);router[_0x43d6('0x11')](_0x43d6('0xb'),auth[_0x43d6('0xe')](),controller['destroy']);module[_0x43d6('0x12')]=router; \ No newline at end of file +var _0x8b83=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer'];(function(_0x2b87ab,_0x49a248){var _0x54f917=function(_0x514c82){while(--_0x514c82){_0x2b87ab['push'](_0x2b87ab['shift']());}};_0x54f917(++_0x49a248);}(_0x8b83,0x175));var _0x38b8=function(_0x2f20a6,_0x50278a){_0x2f20a6=_0x2f20a6-0x0;var _0x3f855a=_0x8b83[_0x2f20a6];return _0x3f855a;};'use strict';var multer=require(_0x38b8('0x0'));var util=require(_0x38b8('0x1'));var path=require(_0x38b8('0x2'));var timeout=require(_0x38b8('0x3'));var express=require(_0x38b8('0x4'));var router=express[_0x38b8('0x5')]();var fs_extra=require(_0x38b8('0x6'));var auth=require(_0x38b8('0x7'));var interaction=require(_0x38b8('0x8'));var config=require(_0x38b8('0x9'));var controller=require(_0x38b8('0xa'));router[_0x38b8('0xb')]('/',auth[_0x38b8('0xc')](),controller['index']);router[_0x38b8('0xb')](_0x38b8('0xd'),auth[_0x38b8('0xc')](),controller[_0x38b8('0xe')]);router[_0x38b8('0xf')]('/',auth[_0x38b8('0xc')](),controller[_0x38b8('0x10')]);router[_0x38b8('0x11')]('/:id',auth[_0x38b8('0xc')](),controller[_0x38b8('0x12')]);router[_0x38b8('0x13')](_0x38b8('0xd'),auth[_0x38b8('0xc')](),controller[_0x38b8('0x14')]);module[_0x38b8('0x15')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index eba2317..60a4b3b 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 _0xecf9=['exports','INTEGER','noop','STRING','*,*,*,*','sequelize'];(function(_0x2d59fb,_0x54517e){var _0x22b53d=function(_0x298568){while(--_0x298568){_0x2d59fb['push'](_0x2d59fb['shift']());}};_0x22b53d(++_0x54517e);}(_0xecf9,0x173));var _0x9ecf=function(_0x1072c3,_0x119dbf){_0x1072c3=_0x1072c3-0x0;var _0x56f5aa=_0xecf9[_0x1072c3];return _0x56f5aa;};'use strict';var Sequelize=require(_0x9ecf('0x0'));module[_0x9ecf('0x1')]={'priority':{'type':Sequelize[_0x9ecf('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9ecf('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x9ecf('0x4')]},'interval':{'type':Sequelize[_0x9ecf('0x4')],'defaultValue':_0x9ecf('0x5')}}; \ No newline at end of file +var _0xe9e8=['STRING','noop','TEXT','*,*,*,*','sequelize','exports'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0xe9e8,0x13c));var _0x8e9e=function(_0x1b31ce,_0x634777){_0x1b31ce=_0x1b31ce-0x0;var _0x31972c=_0xe9e8[_0x1b31ce];return _0x31972c;};'use strict';var Sequelize=require(_0x8e9e('0x0'));module[_0x8e9e('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x8e9e('0x2')],'allowNull':![],'defaultValue':_0x8e9e('0x3')},'appdata':{'type':Sequelize[_0x8e9e('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x8e9e('0x5')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index fa327d4..43c654f 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 _0x56b9=['intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','include','catch','show','params','includeAll','options','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','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/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','WhatsappApplication','rawAttributes','fieldName','type','key','model','query','keys','filters'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x56b9,0x196));var _0x956b=function(_0x10e107,_0x46144f){_0x10e107=_0x10e107-0x0;var _0x2722eb=_0x56b9[_0x10e107];return _0x2722eb;};'use strict';var emlformat=require(_0x956b('0x0'));var rimraf=require(_0x956b('0x1'));var zipdir=require(_0x956b('0x2'));var jsonpatch=require(_0x956b('0x3'));var rp=require(_0x956b('0x4'));var moment=require(_0x956b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x956b('0x6'));var util=require('util');var path=require(_0x956b('0x7'));var sox=require(_0x956b('0x8'));var csv=require(_0x956b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x956b('0xa'));var _=require(_0x956b('0xb'));var squel=require(_0x956b('0xc'));var crypto=require(_0x956b('0xd'));var jsforce=require(_0x956b('0xe'));var deskjs=require(_0x956b('0xf'));var toCsv=require(_0x956b('0x9'));var querystring=require(_0x956b('0x10'));var Papa=require('papaparse');var Redis=require(_0x956b('0x11'));var authService=require(_0x956b('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x956b('0x13'));var hardwareService=require(_0x956b('0x14'));var logger=require(_0x956b('0x15'))(_0x956b('0x16'));var utils=require(_0x956b('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x956b('0x18'));var db=require(_0x956b('0x19'))['db'];function respondWithStatusCode(_0x2bc65c,_0x2fcd69){_0x2fcd69=_0x2fcd69||0xcc;return function(_0x3683bc){if(_0x3683bc){return _0x2bc65c[_0x956b('0x1a')](_0x2fcd69);}return _0x2bc65c[_0x956b('0x1b')](_0x2fcd69)[_0x956b('0x1c')]();};}function respondWithResult(_0x4338ce,_0x2346bd){_0x2346bd=_0x2346bd||0xc8;return function(_0x389c3b){if(_0x389c3b){return _0x4338ce['status'](_0x2346bd)[_0x956b('0x1d')](_0x389c3b);}};}function respondWithFilteredResult(_0x32a806,_0xe68d03){return function(_0x4e4029){if(_0x4e4029){var _0x96ea9d=typeof _0xe68d03[_0x956b('0x1e')]===_0x956b('0x1f')&&typeof _0xe68d03[_0x956b('0x20')]===_0x956b('0x1f');var _0x2bece3=_0x4e4029[_0x956b('0x21')];var _0x57dff2=_0x96ea9d?0x0:_0xe68d03[_0x956b('0x1e')];var _0xc4cdb3=_0x96ea9d?_0x4e4029[_0x956b('0x21')]:_0xe68d03['offset']+_0xe68d03[_0x956b('0x20')];var _0x45211c;if(_0xc4cdb3>=_0x2bece3){_0xc4cdb3=_0x2bece3;_0x45211c=0xc8;}else{_0x45211c=0xce;}_0x32a806['status'](_0x45211c);return _0x32a806['set'](_0x956b('0x22'),_0x57dff2+'-'+_0xc4cdb3+'/'+_0x2bece3)[_0x956b('0x1d')](_0x4e4029);}return null;};}function patchUpdates(_0x21fee6){return function(_0x53cb2d){try{jsonpatch[_0x956b('0x23')](_0x53cb2d,_0x21fee6,!![]);}catch(_0x2a4cb5){return BPromise[_0x956b('0x24')](_0x2a4cb5);}return _0x53cb2d[_0x956b('0x25')]();};}function saveUpdates(_0x33edf1,_0x840935){return function(_0x4ad9bb){if(_0x4ad9bb){return _0x4ad9bb[_0x956b('0x26')](_0x33edf1)[_0x956b('0x27')](function(_0x1f9ff6){return _0x1f9ff6;});}return null;};}function removeEntity(_0x3605cd,_0x2b315d){return function(_0x1ecd0a){if(_0x1ecd0a){return _0x1ecd0a[_0x956b('0x28')]()[_0x956b('0x27')](function(){_0x3605cd[_0x956b('0x1b')](0xcc)[_0x956b('0x1c')]();});}};}function handleEntityNotFound(_0x32f727,_0x512a68){return function(_0x502875){if(!_0x502875){_0x32f727[_0x956b('0x1a')](0x194);}return _0x502875;};}function handleError(_0x2606bf,_0x3af7fd){_0x3af7fd=_0x3af7fd||0x1f4;return function(_0x21ab02){logger[_0x956b('0x29')](_0x21ab02[_0x956b('0x2a')]);if(_0x21ab02[_0x956b('0x2b')]){delete _0x21ab02['name'];}_0x2606bf[_0x956b('0x1b')](_0x3af7fd)[_0x956b('0x2c')](_0x21ab02);};}exports[_0x956b('0x2d')]=function(_0x3d33ad,_0x3d17a0){var _0x33fb5e={},_0x1f692e={},_0x9c0e2e={'count':0x0,'rows':[]};var _0x15c32e=_[_0x956b('0x2e')](db[_0x956b('0x2f')][_0x956b('0x30')],function(_0x1c5f3d){return{'name':_0x1c5f3d[_0x956b('0x31')],'type':_0x1c5f3d[_0x956b('0x32')][_0x956b('0x33')]};});_0x1f692e[_0x956b('0x34')]=_[_0x956b('0x2e')](_0x15c32e,_0x956b('0x2b'));_0x1f692e[_0x956b('0x35')]=_[_0x956b('0x36')](_0x3d33ad['query']);_0x1f692e[_0x956b('0x37')]=_[_0x956b('0x38')](_0x1f692e[_0x956b('0x34')],_0x1f692e[_0x956b('0x35')]);_0x33fb5e[_0x956b('0x39')]=_[_0x956b('0x38')](_0x1f692e[_0x956b('0x34')],qs[_0x956b('0x3a')](_0x3d33ad['query']['fields']));_0x33fb5e[_0x956b('0x39')]=_0x33fb5e[_0x956b('0x39')][_0x956b('0x3b')]?_0x33fb5e[_0x956b('0x39')]:_0x1f692e[_0x956b('0x34')];if(!_0x3d33ad[_0x956b('0x35')][_0x956b('0x3c')]('nolimit')){_0x33fb5e[_0x956b('0x20')]=qs['limit'](_0x3d33ad['query'][_0x956b('0x20')]);_0x33fb5e[_0x956b('0x1e')]=qs[_0x956b('0x1e')](_0x3d33ad[_0x956b('0x35')][_0x956b('0x1e')]);}_0x33fb5e[_0x956b('0x3d')]=qs[_0x956b('0x3e')](_0x3d33ad['query'][_0x956b('0x3e')]);_0x33fb5e[_0x956b('0x3f')]=qs['filters'](_[_0x956b('0x40')](_0x3d33ad[_0x956b('0x35')],_0x1f692e['filters']),_0x15c32e);if(_0x3d33ad[_0x956b('0x35')]['filter']){_0x33fb5e[_0x956b('0x3f')]=_[_0x956b('0x41')](_0x33fb5e[_0x956b('0x3f')],{'$or':_[_0x956b('0x2e')](_0x15c32e,function(_0x5c8326){if(_0x5c8326['type']!==_0x956b('0x42')){var _0x328c5e={};_0x328c5e[_0x5c8326[_0x956b('0x2b')]]={'$like':'%'+_0x3d33ad[_0x956b('0x35')][_0x956b('0x43')]+'%'};return _0x328c5e;}})});}_0x33fb5e=_[_0x956b('0x41')]({},_0x33fb5e,_0x3d33ad['options']);var _0x3548cf={'where':_0x33fb5e[_0x956b('0x3f')]};return db['WhatsappApplication'][_0x956b('0x21')](_0x3548cf)['then'](function(_0x5b84f9){_0x9c0e2e[_0x956b('0x21')]=_0x5b84f9;if(_0x3d33ad[_0x956b('0x35')]['includeAll']){_0x33fb5e[_0x956b('0x44')]=[{'all':!![]}];}return db[_0x956b('0x2f')]['findAll'](_0x33fb5e);})[_0x956b('0x27')](function(_0x591823){_0x9c0e2e['rows']=_0x591823;return _0x9c0e2e;})[_0x956b('0x27')](respondWithFilteredResult(_0x3d17a0,_0x33fb5e))[_0x956b('0x45')](handleError(_0x3d17a0,null));};exports[_0x956b('0x46')]=function(_0x55f7dd,_0x41657f){var _0x1b8197={'raw':!![],'where':{'id':_0x55f7dd[_0x956b('0x47')]['id']}},_0x3b3fe6={};_0x3b3fe6[_0x956b('0x34')]=_[_0x956b('0x36')](db[_0x956b('0x2f')][_0x956b('0x30')]);_0x3b3fe6[_0x956b('0x35')]=_[_0x956b('0x36')](_0x55f7dd[_0x956b('0x35')]);_0x3b3fe6['filters']=_[_0x956b('0x38')](_0x3b3fe6[_0x956b('0x34')],_0x3b3fe6[_0x956b('0x35')]);_0x1b8197['attributes']=_[_0x956b('0x38')](_0x3b3fe6[_0x956b('0x34')],qs['fields'](_0x55f7dd['query']['fields']));_0x1b8197[_0x956b('0x39')]=_0x1b8197[_0x956b('0x39')][_0x956b('0x3b')]?_0x1b8197[_0x956b('0x39')]:_0x3b3fe6[_0x956b('0x34')];if(_0x55f7dd[_0x956b('0x35')][_0x956b('0x48')]){_0x1b8197[_0x956b('0x44')]=[{'all':!![]}];}_0x1b8197=_[_0x956b('0x41')]({},_0x1b8197,_0x55f7dd[_0x956b('0x49')]);return db['WhatsappApplication']['find'](_0x1b8197)['then'](handleEntityNotFound(_0x41657f,null))['then'](respondWithResult(_0x41657f,null))['catch'](handleError(_0x41657f,null));};exports[_0x956b('0x4a')]=function(_0x280efc,_0x32621b){return db[_0x956b('0x2f')][_0x956b('0x4a')](_0x280efc['body'],{})[_0x956b('0x27')](respondWithResult(_0x32621b,0xc9))[_0x956b('0x45')](handleError(_0x32621b,null));};exports[_0x956b('0x26')]=function(_0x4f1cfd,_0x49f331){if(_0x4f1cfd[_0x956b('0x4b')]['id']){delete _0x4f1cfd[_0x956b('0x4b')]['id'];}return db['WhatsappApplication'][_0x956b('0x4c')]({'where':{'id':_0x4f1cfd[_0x956b('0x47')]['id']}})[_0x956b('0x27')](handleEntityNotFound(_0x49f331,null))['then'](saveUpdates(_0x4f1cfd[_0x956b('0x4b')],null))['then'](respondWithResult(_0x49f331,null))[_0x956b('0x45')](handleError(_0x49f331,null));};exports[_0x956b('0x28')]=function(_0x343f7e,_0x1a35fd){return db[_0x956b('0x2f')][_0x956b('0x4c')]({'where':{'id':_0x343f7e[_0x956b('0x47')]['id']}})[_0x956b('0x27')](handleEntityNotFound(_0x1a35fd,null))[_0x956b('0x27')](removeEntity(_0x1a35fd,null))[_0x956b('0x45')](handleError(_0x1a35fd,null));}; \ No newline at end of file +var _0x04d5=['show','params','intersection','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','querystring','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','update','then','error','stack','name','send','index','map','WhatsappApplication','rawAttributes','fieldName','model','keys','query','attributes','fields','length','nolimit','order','sort','filters','filter','merge','VIRTUAL','options','includeAll','include','rows','catch'];(function(_0x27e7de,_0x34f1fe){var _0x62b85b=function(_0x532a97){while(--_0x532a97){_0x27e7de['push'](_0x27e7de['shift']());}};_0x62b85b(++_0x34f1fe);}(_0x04d5,0xe1));var _0x504d=function(_0x3a24ab,_0x3ad9ef){_0x3a24ab=_0x3a24ab-0x0;var _0x510347=_0x04d5[_0x3a24ab];return _0x510347;};'use strict';var emlformat=require(_0x504d('0x0'));var rimraf=require(_0x504d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x504d('0x2'));var rp=require(_0x504d('0x3'));var moment=require(_0x504d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x504d('0x5'));var util=require(_0x504d('0x6'));var path=require(_0x504d('0x7'));var sox=require(_0x504d('0x8'));var csv=require(_0x504d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x504d('0xa'));var _=require(_0x504d('0xb'));var squel=require(_0x504d('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x504d('0xd'));var toCsv=require(_0x504d('0x9'));var querystring=require(_0x504d('0xe'));var Papa=require('papaparse');var Redis=require(_0x504d('0xf'));var authService=require(_0x504d('0x10'));var qs=require(_0x504d('0x11'));var as=require(_0x504d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x504d('0x13'))(_0x504d('0x14'));var utils=require(_0x504d('0x15'));var config=require(_0x504d('0x16'));var licenseUtil=require(_0x504d('0x17'));var db=require(_0x504d('0x18'))['db'];function respondWithStatusCode(_0x379c78,_0x5ecb12){_0x5ecb12=_0x5ecb12||0xcc;return function(_0x580ff6){if(_0x580ff6){return _0x379c78[_0x504d('0x19')](_0x5ecb12);}return _0x379c78[_0x504d('0x1a')](_0x5ecb12)[_0x504d('0x1b')]();};}function respondWithResult(_0x2c68a9,_0x68dd14){_0x68dd14=_0x68dd14||0xc8;return function(_0x3954ac){if(_0x3954ac){return _0x2c68a9['status'](_0x68dd14)[_0x504d('0x1c')](_0x3954ac);}};}function respondWithFilteredResult(_0x4d95be,_0x34af23){return function(_0x2fe9ed){if(_0x2fe9ed){var _0x529f96=typeof _0x34af23[_0x504d('0x1d')]===_0x504d('0x1e')&&typeof _0x34af23[_0x504d('0x1f')]===_0x504d('0x1e');var _0x2a7b5b=_0x2fe9ed['count'];var _0x150cc7=_0x529f96?0x0:_0x34af23['offset'];var _0x2bfc57=_0x529f96?_0x2fe9ed[_0x504d('0x20')]:_0x34af23[_0x504d('0x1d')]+_0x34af23['limit'];var _0x11c073;if(_0x2bfc57>=_0x2a7b5b){_0x2bfc57=_0x2a7b5b;_0x11c073=0xc8;}else{_0x11c073=0xce;}_0x4d95be[_0x504d('0x1a')](_0x11c073);return _0x4d95be[_0x504d('0x21')](_0x504d('0x22'),_0x150cc7+'-'+_0x2bfc57+'/'+_0x2a7b5b)[_0x504d('0x1c')](_0x2fe9ed);}return null;};}function patchUpdates(_0x5c5374){return function(_0x483e28){try{jsonpatch[_0x504d('0x23')](_0x483e28,_0x5c5374,!![]);}catch(_0x4d4852){return BPromise[_0x504d('0x24')](_0x4d4852);}return _0x483e28[_0x504d('0x25')]();};}function saveUpdates(_0x54dec1,_0x1b8cac){return function(_0x59f2d0){if(_0x59f2d0){return _0x59f2d0[_0x504d('0x26')](_0x54dec1)[_0x504d('0x27')](function(_0xbef6c1){return _0xbef6c1;});}return null;};}function removeEntity(_0x4a1849,_0x18fece){return function(_0x4d29ca){if(_0x4d29ca){return _0x4d29ca['destroy']()[_0x504d('0x27')](function(){_0x4a1849[_0x504d('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5bbef7,_0x12c710){return function(_0x251284){if(!_0x251284){_0x5bbef7['sendStatus'](0x194);}return _0x251284;};}function handleError(_0xfe1ee1,_0x304fae){_0x304fae=_0x304fae||0x1f4;return function(_0xdce2f9){logger[_0x504d('0x28')](_0xdce2f9[_0x504d('0x29')]);if(_0xdce2f9['name']){delete _0xdce2f9[_0x504d('0x2a')];}_0xfe1ee1[_0x504d('0x1a')](_0x304fae)[_0x504d('0x2b')](_0xdce2f9);};}exports[_0x504d('0x2c')]=function(_0x4a43c7,_0x52450b){var _0x36fe32={},_0x544296={},_0xa4751b={'count':0x0,'rows':[]};var _0x490d43=_[_0x504d('0x2d')](db[_0x504d('0x2e')][_0x504d('0x2f')],function(_0x4fef5b){return{'name':_0x4fef5b[_0x504d('0x30')],'type':_0x4fef5b['type']['key']};});_0x544296[_0x504d('0x31')]=_[_0x504d('0x2d')](_0x490d43,_0x504d('0x2a'));_0x544296['query']=_[_0x504d('0x32')](_0x4a43c7[_0x504d('0x33')]);_0x544296['filters']=_['intersection'](_0x544296[_0x504d('0x31')],_0x544296[_0x504d('0x33')]);_0x36fe32[_0x504d('0x34')]=_['intersection'](_0x544296[_0x504d('0x31')],qs[_0x504d('0x35')](_0x4a43c7[_0x504d('0x33')][_0x504d('0x35')]));_0x36fe32[_0x504d('0x34')]=_0x36fe32[_0x504d('0x34')][_0x504d('0x36')]?_0x36fe32[_0x504d('0x34')]:_0x544296[_0x504d('0x31')];if(!_0x4a43c7['query']['hasOwnProperty'](_0x504d('0x37'))){_0x36fe32['limit']=qs[_0x504d('0x1f')](_0x4a43c7[_0x504d('0x33')][_0x504d('0x1f')]);_0x36fe32[_0x504d('0x1d')]=qs[_0x504d('0x1d')](_0x4a43c7[_0x504d('0x33')][_0x504d('0x1d')]);}_0x36fe32[_0x504d('0x38')]=qs[_0x504d('0x39')](_0x4a43c7[_0x504d('0x33')][_0x504d('0x39')]);_0x36fe32['where']=qs[_0x504d('0x3a')](_['pick'](_0x4a43c7['query'],_0x544296['filters']),_0x490d43);if(_0x4a43c7[_0x504d('0x33')][_0x504d('0x3b')]){_0x36fe32['where']=_[_0x504d('0x3c')](_0x36fe32['where'],{'$or':_[_0x504d('0x2d')](_0x490d43,function(_0x37c3e9){if(_0x37c3e9['type']!==_0x504d('0x3d')){var _0xd03728={};_0xd03728[_0x37c3e9[_0x504d('0x2a')]]={'$like':'%'+_0x4a43c7['query']['filter']+'%'};return _0xd03728;}})});}_0x36fe32=_[_0x504d('0x3c')]({},_0x36fe32,_0x4a43c7[_0x504d('0x3e')]);var _0xf93e99={'where':_0x36fe32['where']};return db[_0x504d('0x2e')][_0x504d('0x20')](_0xf93e99)[_0x504d('0x27')](function(_0x4da414){_0xa4751b[_0x504d('0x20')]=_0x4da414;if(_0x4a43c7['query'][_0x504d('0x3f')]){_0x36fe32[_0x504d('0x40')]=[{'all':!![]}];}return db[_0x504d('0x2e')]['findAll'](_0x36fe32);})[_0x504d('0x27')](function(_0x6d4cc2){_0xa4751b[_0x504d('0x41')]=_0x6d4cc2;return _0xa4751b;})[_0x504d('0x27')](respondWithFilteredResult(_0x52450b,_0x36fe32))[_0x504d('0x42')](handleError(_0x52450b,null));};exports[_0x504d('0x43')]=function(_0x9784bd,_0x255c71){var _0x27fa4e={'raw':!![],'where':{'id':_0x9784bd[_0x504d('0x44')]['id']}},_0x5164ee={};_0x5164ee[_0x504d('0x31')]=_['keys'](db['WhatsappApplication'][_0x504d('0x2f')]);_0x5164ee[_0x504d('0x33')]=_['keys'](_0x9784bd['query']);_0x5164ee['filters']=_[_0x504d('0x45')](_0x5164ee[_0x504d('0x31')],_0x5164ee['query']);_0x27fa4e['attributes']=_['intersection'](_0x5164ee[_0x504d('0x31')],qs['fields'](_0x9784bd[_0x504d('0x33')][_0x504d('0x35')]));_0x27fa4e[_0x504d('0x34')]=_0x27fa4e[_0x504d('0x34')]['length']?_0x27fa4e[_0x504d('0x34')]:_0x5164ee['model'];if(_0x9784bd[_0x504d('0x33')][_0x504d('0x3f')]){_0x27fa4e[_0x504d('0x40')]=[{'all':!![]}];}_0x27fa4e=_['merge']({},_0x27fa4e,_0x9784bd[_0x504d('0x3e')]);return db[_0x504d('0x2e')][_0x504d('0x46')](_0x27fa4e)[_0x504d('0x27')](handleEntityNotFound(_0x255c71,null))[_0x504d('0x27')](respondWithResult(_0x255c71,null))[_0x504d('0x42')](handleError(_0x255c71,null));};exports[_0x504d('0x47')]=function(_0x2d80e1,_0x189a8d){return db[_0x504d('0x2e')][_0x504d('0x47')](_0x2d80e1[_0x504d('0x48')],{})[_0x504d('0x27')](respondWithResult(_0x189a8d,0xc9))[_0x504d('0x42')](handleError(_0x189a8d,null));};exports['update']=function(_0x43ae6f,_0x1b6f67){if(_0x43ae6f[_0x504d('0x48')]['id']){delete _0x43ae6f['body']['id'];}return db[_0x504d('0x2e')][_0x504d('0x46')]({'where':{'id':_0x43ae6f['params']['id']}})['then'](handleEntityNotFound(_0x1b6f67,null))[_0x504d('0x27')](saveUpdates(_0x43ae6f[_0x504d('0x48')],null))[_0x504d('0x27')](respondWithResult(_0x1b6f67,null))[_0x504d('0x42')](handleError(_0x1b6f67,null));};exports['destroy']=function(_0x3558b2,_0x5749c1){return db['WhatsappApplication']['find']({'where':{'id':_0x3558b2[_0x504d('0x44')]['id']}})[_0x504d('0x27')](handleEntityNotFound(_0x5749c1,null))[_0x504d('0x27')](removeEntity(_0x5749c1,null))[_0x504d('0x42')](handleError(_0x5749c1,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index ab44be7..fb600d6 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 _0xb2b5=['utf8mb4_unicode_ci','moment','bluebird','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define','utf8mb4'];(function(_0xe78202,_0x200dd0){var _0xd44ff5=function(_0x33936b){while(--_0x33936b){_0xe78202['push'](_0xe78202['shift']());}};_0xd44ff5(++_0x200dd0);}(_0xb2b5,0xa3));var _0x5b2b=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xb2b5[_0x1928c9];return _0x51b5fb;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x5b2b('0x0'));var BPromise=require(_0x5b2b('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5b2b('0x2'));var config=require(_0x5b2b('0x3'));var attributes=require(_0x5b2b('0x4'));module[_0x5b2b('0x5')]=function(_0x49d9f6,_0x30c3e2){return _0x49d9f6[_0x5b2b('0x6')]('WhatsappApplication',attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5b2b('0x7'),'collate':_0x5b2b('0x8')});}; \ No newline at end of file +var _0xcabc=['api','moment','bluebird','path','rimraf','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4_unicode_ci','util','../../config/logger'];(function(_0xa306f3,_0x74649){var _0x4edf89=function(_0x720180){while(--_0x720180){_0xa306f3['push'](_0xa306f3['shift']());}};_0x4edf89(++_0x74649);}(_0xcabc,0x16a));var _0xccab=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcabc[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0xccab('0x0'));var logger=require(_0xccab('0x1'))(_0xccab('0x2'));var moment=require(_0xccab('0x3'));var BPromise=require(_0xccab('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xccab('0x5'));var rimraf=require(_0xccab('0x6'));var config=require('../../config/environment');var attributes=require(_0xccab('0x7'));module[_0xccab('0x8')]=function(_0x271a61,_0x492d75){return _0x271a61[_0xccab('0x9')](_0xccab('0xa'),attributes,{'tableName':_0xccab('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xccab('0xc')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index b8cf872..0a2f93e 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 _0xa8a8=['stringify','error','code','WhatsappApplication,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug'];(function(_0x3adeb3,_0x4fdd75){var _0x5ea99e=function(_0x1a7c3f){while(--_0x1a7c3f){_0x3adeb3['push'](_0x3adeb3['shift']());}};_0x5ea99e(++_0x4fdd75);}(_0xa8a8,0xec));var _0x8a8a=function(_0x2eb772,_0x52f1b5){_0x2eb772=_0x2eb772-0x0;var _0x4478d0=_0xa8a8[_0x2eb772];return _0x4478d0;};'use strict';var _=require(_0x8a8a('0x0'));var util=require(_0x8a8a('0x1'));var moment=require(_0x8a8a('0x2'));var BPromise=require(_0x8a8a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8a8a('0x4'));var db=require(_0x8a8a('0x5'))['db'];var utils=require(_0x8a8a('0x6'));var logger=require(_0x8a8a('0x7'))(_0x8a8a('0x8'));var config=require(_0x8a8a('0x9'));var jayson=require(_0x8a8a('0xa'));var client=jayson[_0x8a8a('0xb')][_0x8a8a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x315fe9,_0x1d7121,_0x8e7aa0){return new BPromise(function(_0x4225b9,_0xecaa6f){return client[_0x8a8a('0xd')](_0x315fe9,_0x8e7aa0)['then'](function(_0x576ef9){logger[_0x8a8a('0xe')]('WhatsappApplication,\x20%s,\x20%s',_0x1d7121,_0x8a8a('0xf'));logger[_0x8a8a('0x10')]('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x1d7121,_0x8a8a('0xf'),JSON[_0x8a8a('0x11')](_0x576ef9));if(_0x576ef9[_0x8a8a('0x12')]){if(_0x576ef9['error'][_0x8a8a('0x13')]===0x1f4){logger[_0x8a8a('0x12')](_0x8a8a('0x14'),_0x1d7121,_0x576ef9[_0x8a8a('0x12')]['message']);return _0xecaa6f(_0x576ef9[_0x8a8a('0x12')]['message']);}logger[_0x8a8a('0x12')](_0x8a8a('0x14'),_0x1d7121,_0x576ef9[_0x8a8a('0x12')][_0x8a8a('0x15')]);return _0x4225b9(_0x576ef9[_0x8a8a('0x12')][_0x8a8a('0x15')]);}else{logger[_0x8a8a('0xe')]('WhatsappApplication,\x20%s,\x20%s',_0x1d7121,_0x8a8a('0xf'));_0x4225b9(_0x576ef9['result'][_0x8a8a('0x15')]);}})[_0x8a8a('0x16')](function(_0x46a4f4){logger[_0x8a8a('0x12')](_0x8a8a('0x14'),_0x1d7121,_0x46a4f4);_0xecaa6f(_0x46a4f4);});});} \ No newline at end of file +var _0x5c12=['../../config/environment','client','http','request','then','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','error','message','info','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x32f6b9,_0x2d4aa9){var _0x267d52=function(_0x10f74f){while(--_0x10f74f){_0x32f6b9['push'](_0x32f6b9['shift']());}};_0x267d52(++_0x2d4aa9);}(_0x5c12,0x188));var _0x25c1=function(_0x5bd1a9,_0x313714){_0x5bd1a9=_0x5bd1a9-0x0;var _0x2ba345=_0x5c12[_0x5bd1a9];return _0x2ba345;};'use strict';var _=require('lodash');var util=require(_0x25c1('0x0'));var moment=require(_0x25c1('0x1'));var BPromise=require('bluebird');var rs=require(_0x25c1('0x2'));var fs=require('fs');var Redis=require(_0x25c1('0x3'));var db=require(_0x25c1('0x4'))['db'];var utils=require(_0x25c1('0x5'));var logger=require(_0x25c1('0x6'))(_0x25c1('0x7'));var config=require(_0x25c1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x25c1('0x9')][_0x25c1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x382922,_0x4ab674,_0x5c69b1){return new BPromise(function(_0x24981c,_0x3b69ba){return client[_0x25c1('0xb')](_0x382922,_0x5c69b1)[_0x25c1('0xc')](function(_0xf8363f){logger['info'](_0x25c1('0xd'),_0x4ab674,_0x25c1('0xe'));logger[_0x25c1('0xf')](_0x25c1('0x10'),_0x4ab674,_0x25c1('0xe'),JSON['stringify'](_0xf8363f));if(_0xf8363f[_0x25c1('0x11')]){if(_0xf8363f[_0x25c1('0x11')]['code']===0x1f4){logger[_0x25c1('0x11')](_0x25c1('0xd'),_0x4ab674,_0xf8363f[_0x25c1('0x11')][_0x25c1('0x12')]);return _0x3b69ba(_0xf8363f['error']['message']);}logger['error']('WhatsappApplication,\x20%s,\x20%s',_0x4ab674,_0xf8363f[_0x25c1('0x11')][_0x25c1('0x12')]);return _0x24981c(_0xf8363f[_0x25c1('0x11')][_0x25c1('0x12')]);}else{logger[_0x25c1('0x13')]('WhatsappApplication,\x20%s,\x20%s',_0x4ab674,_0x25c1('0xe'));_0x24981c(_0xf8363f['result']['message']);}})['catch'](function(_0x284712){logger[_0x25c1('0x11')]('WhatsappApplication,\x20%s,\x20%s',_0x4ab674,_0x284712);_0x3b69ba(_0x284712);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 0808f55..5e8b778 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 _0xa23f=['/:id/messages','/:id/tags','tracked','whatsapp','addTags','put','whatsappinteraction:update','update','delete','whatsappinteraction:destroy','destroy','removeTags','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','getMessages','/:id/download','download','post'];(function(_0x26b883,_0x49cb1e){var _0x505980=function(_0x55534f){while(--_0x55534f){_0x26b883['push'](_0x26b883['shift']());}};_0x505980(++_0x49cb1e);}(_0xa23f,0x7c));var _0xfa23=function(_0x23f2f0,_0x58e5b2){_0x23f2f0=_0x23f2f0-0x0;var _0x49cca3=_0xa23f[_0x23f2f0];return _0x49cca3;};'use strict';var multer=require(_0xfa23('0x0'));var util=require(_0xfa23('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xfa23('0x2'));var router=express[_0xfa23('0x3')]();var fs_extra=require(_0xfa23('0x4'));var auth=require(_0xfa23('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xfa23('0x6'));var controller=require('./whatsappInteraction.controller');router[_0xfa23('0x7')]('/',auth[_0xfa23('0x8')](),controller[_0xfa23('0x9')]);router[_0xfa23('0x7')]('/describe',auth[_0xfa23('0x8')](),controller['describe']);router[_0xfa23('0x7')](_0xfa23('0xa'),auth[_0xfa23('0x8')](),controller[_0xfa23('0xb')]);router[_0xfa23('0x7')]('/:id/messages',auth['isAuthenticated'](),controller[_0xfa23('0xc')]);router['get'](_0xfa23('0xd'),auth['isAuthenticated'](),controller[_0xfa23('0xe')]);router[_0xfa23('0xf')]('/',auth[_0xfa23('0x8')](),controller['create']);router[_0xfa23('0xf')](_0xfa23('0x10'),auth[_0xfa23('0x8')](),controller['addMessage']);router['post'](_0xfa23('0x11'),auth[_0xfa23('0x8')](),interaction[_0xfa23('0x12')](_0xfa23('0x13'),'whatsappinteraction:addtags'),controller[_0xfa23('0x14')]);router[_0xfa23('0x15')](_0xfa23('0xa'),auth[_0xfa23('0x8')](),interaction['tracked'](_0xfa23('0x13'),_0xfa23('0x16')),controller[_0xfa23('0x17')]);router[_0xfa23('0x18')](_0xfa23('0xa'),auth['isAuthenticated'](),interaction['tracked']('whatsapp',_0xfa23('0x19')),controller[_0xfa23('0x1a')]);router['delete'](_0xfa23('0x11'),auth[_0xfa23('0x8')](),controller[_0xfa23('0x1b')]);module['exports']=router; \ No newline at end of file +var _0xef17=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappInteraction.controller','isAuthenticated','get','describe','show','/:id/messages','getMessages','download','post','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','/:id','delete','removeTags','multer','util'];(function(_0x5311e8,_0x57c5bb){var _0x582ad8=function(_0x1909af){while(--_0x1909af){_0x5311e8['push'](_0x5311e8['shift']());}};_0x582ad8(++_0x57c5bb);}(_0xef17,0x136));var _0x7ef1=function(_0xf565e,_0x4f1665){_0xf565e=_0xf565e-0x0;var _0x3f54f7=_0xef17[_0xf565e];return _0x3f54f7;};'use strict';var multer=require(_0x7ef1('0x0'));var util=require(_0x7ef1('0x1'));var path=require(_0x7ef1('0x2'));var timeout=require(_0x7ef1('0x3'));var express=require(_0x7ef1('0x4'));var router=express[_0x7ef1('0x5')]();var fs_extra=require(_0x7ef1('0x6'));var auth=require(_0x7ef1('0x7'));var interaction=require(_0x7ef1('0x8'));var config=require('../../config/environment');var controller=require(_0x7ef1('0x9'));router['get']('/',auth[_0x7ef1('0xa')](),controller['index']);router[_0x7ef1('0xb')]('/describe',auth['isAuthenticated'](),controller[_0x7ef1('0xc')]);router[_0x7ef1('0xb')]('/:id',auth[_0x7ef1('0xa')](),controller[_0x7ef1('0xd')]);router[_0x7ef1('0xb')](_0x7ef1('0xe'),auth[_0x7ef1('0xa')](),controller[_0x7ef1('0xf')]);router[_0x7ef1('0xb')]('/:id/download',auth['isAuthenticated'](),controller[_0x7ef1('0x10')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x7ef1('0x11')]('/:id/messages',auth[_0x7ef1('0xa')](),controller[_0x7ef1('0x12')]);router[_0x7ef1('0x11')](_0x7ef1('0x13'),auth[_0x7ef1('0xa')](),interaction[_0x7ef1('0x14')](_0x7ef1('0x15'),_0x7ef1('0x16')),controller['addTags']);router['put'](_0x7ef1('0x17'),auth['isAuthenticated'](),interaction[_0x7ef1('0x14')](_0x7ef1('0x15'),'whatsappinteraction:update'),controller['update']);router['delete'](_0x7ef1('0x17'),auth['isAuthenticated'](),interaction[_0x7ef1('0x14')]('whatsapp','whatsappinteraction:destroy'),controller['destroy']);router[_0x7ef1('0x18')]('/:id/tags',auth[_0x7ef1('0xa')](),controller[_0x7ef1('0x19')]);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 d228b79..2aeb2b4 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 _0xd206=['moment','BOOLEAN','DATE','STRING','out','sequelize'];(function(_0x2dbce7,_0x57cb8d){var _0x3a3ed0=function(_0x28c8c6){while(--_0x28c8c6){_0x2dbce7['push'](_0x2dbce7['shift']());}};_0x3a3ed0(++_0x57cb8d);}(_0xd206,0x107));var _0x6d20=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0xd206[_0x565ed7];return _0x183ad7;};'use strict';var Sequelize=require(_0x6d20('0x0'));var moment=require(_0x6d20('0x1'));module['exports']={'closed':{'type':Sequelize[_0x6d20('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x6d20('0x3')]},'disposition':{'type':Sequelize[_0x6d20('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x6d20('0x4')]},'note':{'type':Sequelize[_0x6d20('0x4')]},'phone':{'type':Sequelize[_0x6d20('0x4')]},'read1stAt':{'type':Sequelize[_0x6d20('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x6d20('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x6d20('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x6d20('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x6bac=['DATE','STRING','out','ENUM','sequelize','exports','BOOLEAN'];(function(_0x472881,_0xad80cc){var _0x408be0=function(_0x4cda7e){while(--_0x4cda7e){_0x472881['push'](_0x472881['shift']());}};_0x408be0(++_0xad80cc);}(_0x6bac,0xa5));var _0xc6ba=function(_0xf11a63,_0x252c94){_0xf11a63=_0xf11a63-0x0;var _0x450cc5=_0x6bac[_0xf11a63];return _0x450cc5;};'use strict';var Sequelize=require(_0xc6ba('0x0'));var moment=require('moment');module[_0xc6ba('0x1')]={'closed':{'type':Sequelize[_0xc6ba('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xc6ba('0x3')]},'disposition':{'type':Sequelize[_0xc6ba('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xc6ba('0x4')]},'read1stAt':{'type':Sequelize[_0xc6ba('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xc6ba('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xc6ba('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xc6ba('0x6')]('in',_0xc6ba('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xc6ba('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 4c89014..36d5681 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 _0xd634=['order','contactName','DESC','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','role','agent','getWhatsappAccounts','user','sequelize','toString','keyBy','merge','WhatsappInteraction','a.key','a.mandatoryDisposition','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','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','all','show','params','includeAll','include','options','create','body','update','describe','addMessage','ids','omit','getMessages','findOne','hasOwnProperty','format','WhatsappMessage','rows','setTags','spread','findAll','emit','removeTags','download','unix','join','root','server','tmp','files','attachments','lastName','Attachment','Messages','direction','secret','WhatsappAccount','Account','Owner','mkdirSync','Whatsapp','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','disposition','basename','existsSync','createReadStream','createWriteStream','System','firstName','out','views','downloadInteraction.ejs','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','end','status','json','offset','limit','count','set','Content-Range','reject','destroy','error','name','send','map','fullname','TagIds','Tags','split','forEach','push','then','catch','index','rawAttributes','fieldName','type','model','keys','filters','query','attributes','intersection','fields','length','nolimit','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','cm_contacts','o.id\x20=\x20i.UserId','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','expr','parseSearch','sqlOperator','conditions','find','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','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','buildExpression','text','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','some','compact','isEmpty','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages'];(function(_0x5eb31d,_0x5f17f8){var _0x7ead52=function(_0x5148eb){while(--_0x5148eb){_0x5eb31d['push'](_0x5eb31d['shift']());}};_0x7ead52(++_0x5f17f8);}(_0xd634,0x151));var _0x4d63=function(_0x10f68e,_0xf198ea){_0x10f68e=_0x10f68e-0x0;var _0x4c8372=_0xd634[_0x10f68e];return _0x4c8372;};'use strict';var emlformat=require(_0x4d63('0x0'));var rimraf=require(_0x4d63('0x1'));var zipdir=require(_0x4d63('0x2'));var jsonpatch=require(_0x4d63('0x3'));var rp=require(_0x4d63('0x4'));var moment=require(_0x4d63('0x5'));var BPromise=require(_0x4d63('0x6'));var Mustache=require(_0x4d63('0x7'));var util=require(_0x4d63('0x8'));var path=require(_0x4d63('0x9'));var sox=require('sox');var csv=require(_0x4d63('0xa'));var ejs=require(_0x4d63('0xb'));var fs=require('fs');var fs_extra=require(_0x4d63('0xc'));var _=require(_0x4d63('0xd'));var squel=require(_0x4d63('0xe'));var crypto=require(_0x4d63('0xf'));var jsforce=require(_0x4d63('0x10'));var deskjs=require(_0x4d63('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4d63('0x12'));var Redis=require('ioredis');var authService=require(_0x4d63('0x13'));var qs=require(_0x4d63('0x14'));var as=require(_0x4d63('0x15'));var pdf=require(_0x4d63('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4d63('0x17'))('api');var utils=require(_0x4d63('0x18'));var config=require(_0x4d63('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x4d63('0x1a'))['db'];config[_0x4d63('0x1b')]=_[_0x4d63('0x1c')](config[_0x4d63('0x1b')],{'host':_0x4d63('0x1d'),'port':0x18eb});var socket=require(_0x4d63('0x1e'))(new Redis(config[_0x4d63('0x1b')]));require(_0x4d63('0x1f'))[_0x4d63('0x20')](socket);function respondWithStatusCode(_0x8798f4,_0xe4e28f){_0xe4e28f=_0xe4e28f||0xcc;return function(_0x2454cc){if(_0x2454cc){return _0x8798f4[_0x4d63('0x21')](_0xe4e28f);}return _0x8798f4['status'](_0xe4e28f)[_0x4d63('0x22')]();};}function respondWithResult(_0x3ab719,_0x6c70){_0x6c70=_0x6c70||0xc8;return function(_0x3ed512){if(_0x3ed512){return _0x3ab719[_0x4d63('0x23')](_0x6c70)[_0x4d63('0x24')](_0x3ed512);}};}function respondWithFilteredResult(_0x71bd5d,_0x20f810){return function(_0x413050){if(_0x413050){var _0x603dc3=typeof _0x20f810[_0x4d63('0x25')]==='undefined'&&typeof _0x20f810[_0x4d63('0x26')]==='undefined';var _0x4eb889=_0x413050[_0x4d63('0x27')];var _0x56e31d=_0x603dc3?0x0:_0x20f810[_0x4d63('0x25')];var _0x230af4=_0x603dc3?_0x413050[_0x4d63('0x27')]:_0x20f810[_0x4d63('0x25')]+_0x20f810['limit'];var _0x40a7a8;if(_0x230af4>=_0x4eb889){_0x230af4=_0x4eb889;_0x40a7a8=0xc8;}else{_0x40a7a8=0xce;}_0x71bd5d[_0x4d63('0x23')](_0x40a7a8);return _0x71bd5d[_0x4d63('0x28')](_0x4d63('0x29'),_0x56e31d+'-'+_0x230af4+'/'+_0x4eb889)[_0x4d63('0x24')](_0x413050);}return null;};}function patchUpdates(_0x45382e){return function(_0x3e0309){try{jsonpatch['apply'](_0x3e0309,_0x45382e,!![]);}catch(_0x16b914){return BPromise[_0x4d63('0x2a')](_0x16b914);}return _0x3e0309['save']();};}function saveUpdates(_0x1fd6e3,_0x1b2414){return function(_0x671dcf){if(_0x671dcf){return _0x671dcf['update'](_0x1fd6e3)['then'](function(_0x3171df){return _0x3171df;});}return null;};}function removeEntity(_0xd0cf52,_0x5f3aef){return function(_0x246148){if(_0x246148){return _0x246148[_0x4d63('0x2b')]()['then'](function(){_0xd0cf52[_0x4d63('0x23')](0xcc)[_0x4d63('0x22')]();});}};}function handleEntityNotFound(_0x8065f2,_0x40e76b){return function(_0x43daaf){if(!_0x43daaf){_0x8065f2[_0x4d63('0x21')](0x194);}return _0x43daaf;};}function handleError(_0x422b46,_0x26e66f){_0x26e66f=_0x26e66f||0x1f4;return function(_0x27d639){logger[_0x4d63('0x2c')](_0x27d639['stack']);if(_0x27d639[_0x4d63('0x2d')]){delete _0x27d639[_0x4d63('0x2d')];}_0x422b46[_0x4d63('0x23')](_0x26e66f)[_0x4d63('0x2e')](_0x27d639);};}function getInteractionUsers(_0x357af3,_0x3593b5){return new BPromise(function(_0x4ee7a5,_0x2b0711){try{if(_0x3593b5[_0x357af3['id']]){_0x357af3['Users']=_[_0x4d63('0x2f')](_0x3593b5[_0x357af3['id']],function(_0x2b6836){return{'id':_0x2b6836['id'],'fullname':_0x2b6836[_0x4d63('0x30')]};});}}catch(_0x5091b5){_0x2b0711(_0x5091b5);}_0x4ee7a5(_0x357af3);});}function getInteractionTags(_0x450097,_0x59a405){return new BPromise(function(_0x205f75,_0x1178a7){try{if(_0x450097[_0x4d63('0x31')]){_0x450097[_0x4d63('0x32')]=[];_0x450097['TagIds'][_0x4d63('0x33')](',')[_0x4d63('0x34')](function(_0x3480ce){_0x450097['Tags'][_0x4d63('0x35')](_0x59a405[_0x3480ce]);});}delete _0x450097['TagIds'];}catch(_0x53b6e1){_0x1178a7(_0x53b6e1);}_0x205f75(_0x450097);});}function updateWhatsappInteraction(_0x10fa6b,_0xe4ae35,_0x4f2f1e){return new BPromise(function(_0x372230,_0x117c44){return getInteractionUsers(_0x10fa6b,_0x4f2f1e)[_0x4d63('0x36')](function(_0x346b1b){return getInteractionTags(_0x346b1b,_0xe4ae35);})[_0x4d63('0x36')](function(_0x4ada4e){_0x372230(_0x4ada4e);})[_0x4d63('0x37')](function(_0x4292e9){_0x117c44(_0x4292e9);});});}exports[_0x4d63('0x38')]=function(_0x553f56,_0x2dba14){var _0x2a73bd={},_0x5a56bd={},_0x2495e5={'count':0x0,'rows':[]};var _0x197a3d=_[_0x4d63('0x2f')](db['WhatsappInteraction'][_0x4d63('0x39')],function(_0x2b01be){return{'name':_0x2b01be[_0x4d63('0x3a')],'type':_0x2b01be[_0x4d63('0x3b')]['key']};});_0x5a56bd[_0x4d63('0x3c')]=_[_0x4d63('0x2f')](_0x197a3d,'name');_0x5a56bd['query']=_[_0x4d63('0x3d')](_0x553f56['query']);_0x5a56bd[_0x4d63('0x3e')]=_['intersection'](_0x5a56bd['model'],_0x5a56bd[_0x4d63('0x3f')]);_0x2a73bd[_0x4d63('0x40')]=_[_0x4d63('0x41')](_0x5a56bd[_0x4d63('0x3c')],qs[_0x4d63('0x42')](_0x553f56[_0x4d63('0x3f')][_0x4d63('0x42')]));_0x2a73bd['attributes']=_0x2a73bd[_0x4d63('0x40')][_0x4d63('0x43')]?_0x2a73bd[_0x4d63('0x40')]:_0x5a56bd['model'];if(!_0x553f56['query']['hasOwnProperty'](_0x4d63('0x44'))){_0x2a73bd[_0x4d63('0x26')]=qs[_0x4d63('0x26')](_0x553f56[_0x4d63('0x3f')]['limit']);_0x2a73bd[_0x4d63('0x25')]=qs[_0x4d63('0x25')](_0x553f56[_0x4d63('0x3f')][_0x4d63('0x25')]);}_0x2a73bd['order']=qs[_0x4d63('0x45')](_0x553f56[_0x4d63('0x3f')][_0x4d63('0x45')]);_0x2a73bd[_0x4d63('0x46')]=qs['filters'](_[_0x4d63('0x47')](_0x553f56[_0x4d63('0x3f')],_0x5a56bd[_0x4d63('0x3e')]),_0x197a3d);var _0x9126c=[];var _0x4f474a=squel[_0x4d63('0x48')]()[_0x4d63('0x49')]('id')[_0x4d63('0x49')](_0x4d63('0x2d'))[_0x4d63('0x49')](_0x4d63('0x4a'))[_0x4d63('0x4b')](_0x4d63('0x4c'));var _0x21cc0b=squel[_0x4d63('0x48')]()[_0x4d63('0x49')](_0x4d63('0x4d'))[_0x4d63('0x49')](_0x4d63('0x4e'))['field'](_0x4d63('0x4f'))[_0x4d63('0x4b')](_0x4d63('0x50'),'ui')[_0x4d63('0x51')](_0x4d63('0x52'),'u',_0x4d63('0x53'));var _0x35f860=squel[_0x4d63('0x48')]()[_0x4d63('0x4b')](_0x4d63('0x54'),'i')[_0x4d63('0x51')](_0x4d63('0x55'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x4d63('0x51')](_0x4d63('0x52'),'o',_0x4d63('0x56'))[_0x4d63('0x51')](_0x4d63('0x57'),'a',_0x4d63('0x58'))[_0x4d63('0x51')](_0x4d63('0x59'),'me',_0x4d63('0x5a'))[_0x4d63('0x51')](_0x4d63('0x5b'),'it',_0x4d63('0x5c'))[_0x4d63('0x51')]('tools_tags','t','t.id\x20=\x20it.TagId');var _0x1a44d6=squel[_0x4d63('0x5d')]();var _0x3e476b=[];var _0x3f82d3=squel[_0x4d63('0x5d')]();var _0x133d00;if(_0x553f56[_0x4d63('0x3f')]['search']){_0x133d00=as[_0x4d63('0x5e')](_0x553f56[_0x4d63('0x3f')]['search']);var _0x355024=_0x133d00[_0x4d63('0x5f')];for(var _0x18061e=0x0;_0x18061e<_0x133d00[_0x4d63('0x60')][_0x4d63('0x43')];_0x18061e++){var _0xdaa4f5=_0x133d00['conditions'][_0x18061e];var _0x14bbcc='i';var _0x267956=_[_0x4d63('0x61')](_0x197a3d,['name',_0xdaa4f5[_0x4d63('0x49')]]);if(!_0x267956){switch(_0xdaa4f5['field']){case'unreadMessages':if(_0xdaa4f5[_0x4d63('0x62')]==0x1){_0x35f860[_0x4d63('0x63')]('`'+_0xdaa4f5[_0x4d63('0x49')]+_0x4d63('0x64'));}else{_0x35f860[_0x4d63('0x63')]('`'+_0xdaa4f5[_0x4d63('0x49')]+_0x4d63('0x65'));}break;case _0x4d63('0x66'):if(_0xdaa4f5[_0x4d63('0x67')]===_0x4d63('0x68')){if(_0xdaa4f5[_0x4d63('0x62')][_0x4d63('0x33')]('\x20')[_0x4d63('0x43')]>0x1){_0x1a44d6[_0x355024](_0x4d63('0x69'),qs[_0x4d63('0x6a')](_0xdaa4f5[_0x4d63('0x62')]),null);}else{var _0x172d55='%'+_0xdaa4f5[_0x4d63('0x62')]+'%';_0x1a44d6[_0x355024](_0x4d63('0x6b'),_0x172d55,_0x172d55,_0x172d55);}}else{_0x267956=_[_0x4d63('0x61')](_0x197a3d,['name',_0x4d63('0x6c')]);_0xdaa4f5[_0x4d63('0x49')]=_0x4d63('0x6c');_0x4a5c97=as[_0x4d63('0x6d')](_0x14bbcc,_0x267956[_0x4d63('0x3b')],_0xdaa4f5);_0x1a44d6[_0x355024](_0x4a5c97[_0x4d63('0x6e')],_0x4a5c97['value']['start'],_0x4a5c97['value'][_0x4d63('0x22')]);}break;case'Tag':var _0x52cd1c=_0xdaa4f5[_0x4d63('0x62')][_0x4d63('0x33')](',')[_0x4d63('0x2f')](function(_0x5067dc){return Number(_0x5067dc);});_0x52cd1c[_0x4d63('0x34')](function(_0x2455b5){_0x3f82d3['or'](_0x4d63('0x6f'),'%,'+_0x2455b5+',%');});_0x3e476b=_[_0x4d63('0x70')](_0x3e476b,_0x52cd1c);break;case _0x4d63('0x71'):if(_0xdaa4f5['operator']===_0x4d63('0x68')){_0x1a44d6[_0x355024](_0x4d63('0x72'),'%'+_0xdaa4f5[_0x4d63('0x62')]+'%',null);}else{_0x267956=_[_0x4d63('0x61')](_0x197a3d,[_0x4d63('0x2d'),'UserId']);_0xdaa4f5['field']=_0x4d63('0x73');_0x4a5c97=as[_0x4d63('0x6d')](_0x14bbcc,_0x267956[_0x4d63('0x3b')],_0xdaa4f5);_0x1a44d6[_0x355024](_0x4a5c97[_0x4d63('0x6e')],_0x4a5c97[_0x4d63('0x62')][_0x4d63('0x74')],_0x4a5c97['value']['end']);}break;case'body':_0x4a5c97=as[_0x4d63('0x6d')]('me',null,_0xdaa4f5);_0x1a44d6[_0x355024](_0x4a5c97[_0x4d63('0x6e')],_0x4a5c97[_0x4d63('0x62')]['start'],_0x4a5c97[_0x4d63('0x62')][_0x4d63('0x22')]);break;}}else{var _0x4a5c97=as[_0x4d63('0x6d')](_0x14bbcc,_0x267956['type'],_0xdaa4f5);_0x1a44d6[_0x355024](_0x4a5c97['text'],_0x4a5c97[_0x4d63('0x62')][_0x4d63('0x74')],_0x4a5c97[_0x4d63('0x62')]['end']);}}}else{var _0x42b369=_(_0x553f56[_0x4d63('0x3f')])['keys']()[_0x4d63('0x2f')](function(_0x5bd128){return _[_0x4d63('0x75')](_0x197a3d,['name',_0x5bd128])?_0x5bd128:undefined;})[_0x4d63('0x76')]()[_0x4d63('0x62')]();if(!_[_0x4d63('0x77')](_0x42b369)){_0x42b369[_0x4d63('0x34')](function(_0x18ac06){if(_0x18ac06===_0x4d63('0x78')){_0x35f860[_0x4d63('0x46')](_0x4d63('0x79'),[][_0x4d63('0x7a')](_0x553f56[_0x4d63('0x3f')][_0x18ac06]));}else if(_0x18ac06===_0x4d63('0x7b')){var _0x1f0e65=JSON[_0x4d63('0x7c')](_0x553f56[_0x4d63('0x3f')][_0x18ac06])[_0x4d63('0x7d')];var _0x395186=JSON[_0x4d63('0x7c')](_0x553f56[_0x4d63('0x3f')][_0x18ac06])[_0x4d63('0x7e')];_0x35f860[_0x4d63('0x46')](_0x4d63('0x7f'),_0x1f0e65,_0x395186);}else{if(_0x553f56['query'][_0x18ac06]===_0x4d63('0x80')){_0x35f860[_0x4d63('0x46')]('i.'+_0x18ac06+'\x20IS\x20NULL');}else{_0x35f860['where']('i.'+_0x18ac06+_0x4d63('0x81'),_0x553f56[_0x4d63('0x3f')][_0x18ac06]);}}});}if(_0x553f56[_0x4d63('0x3f')]['read']){if(_0x553f56[_0x4d63('0x3f')][_0x4d63('0x82')]==0x1){_0x35f860[_0x4d63('0x63')](_0x4d63('0x83'));}else{_0x35f860[_0x4d63('0x63')](_0x4d63('0x84'));}}if(_0x553f56[_0x4d63('0x3f')][_0x4d63('0x85')]){_0x3e476b=_[_0x4d63('0x86')](_0x553f56[_0x4d63('0x3f')][_0x4d63('0x85')])?_0x553f56['query']['tag']:new Array(_0x553f56[_0x4d63('0x3f')]['tag']);_0x3e476b[_0x4d63('0x34')](function(_0x5c9f5a){_0x3f82d3['or'](_0x4d63('0x6f'),'%,'+_0x5c9f5a+',%');});}if(_0x553f56[_0x4d63('0x3f')][_0x4d63('0x87')]){var _0x288a77=_0x553f56['query']['filter'][_0x4d63('0x88')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x4d63('0x89')](_0x288a77)){_0x1a44d6['or'](_0x4d63('0x8a'),_0x288a77+'%')['or'](_0x4d63('0x8b'),_0x288a77+'%');}else{_0x1a44d6['or'](_0x4d63('0x8c'),qs[_0x4d63('0x6a')](_0x288a77))['or'](_0x4d63('0x8d'),_0x288a77+'%');}}}_0x35f860['where'](_0x1a44d6);_0x35f860[_0x4d63('0x8e')](_0x4d63('0x8f'));var _0x392e29={'type':db['Sequelize'][_0x4d63('0x90')][_0x4d63('0x91')],'raw':!![]};var _0x3a26e9=_0x35f860[_0x4d63('0x92')]();_0x3a26e9[_0x4d63('0x49')]('i.id');_0x3a26e9['field'](_0x4d63('0x93'),_0x4d63('0x94'));if(_0x2a73bd[_0x4d63('0x95')]){_0x2a73bd[_0x4d63('0x95')]['forEach'](function(_0x3e311d){var _0x30a139=_0x3e311d[0x0]===_0x4d63('0x96')?_0x3e311d[0x0]:'i.'+_0x3e311d[0x0];_0x35f860[_0x4d63('0x95')](_0x30a139,_0x3e311d[0x1]===_0x4d63('0x97')?![]:!![]);});}if(!_[_0x4d63('0x77')](_0x3e476b)){_0x35f860[_0x4d63('0x63')](_0x3f82d3);_0x3a26e9[_0x4d63('0x46')](_0x4d63('0x98'),_0x3e476b);}BPromise[_0x4d63('0x99')]()[_0x4d63('0x36')](function(){if(!_0x133d00){if(_0x553f56['query']['WhatsappAccountId'])return;_0x3a26e9[_0x4d63('0x46')](_0x4d63('0x9a'));_0x35f860[_0x4d63('0x46')](_0x4d63('0x9a'));return;}if(_0x553f56['user'][_0x4d63('0x9b')]!==_0x4d63('0x9c'))return;return _0x553f56['user'][_0x4d63('0x9d')]({'attributes':['id'],'raw':!![]})[_0x4d63('0x36')](function(_0xc5842f){if(_[_0x4d63('0x77')](_0xc5842f)){_0x3a26e9['where']('i.WhatsappAccountId\x20IS\x20NULL');_0x35f860[_0x4d63('0x46')]('i.WhatsappAccountId\x20IS\x20NULL');}else{_0x3a26e9[_0x4d63('0x46')](_0x4d63('0x79'),_[_0x4d63('0x2f')](_0xc5842f,'id'));_0x35f860[_0x4d63('0x46')](_0x4d63('0x79'),_[_0x4d63('0x2f')](_0xc5842f,'id'));}});})['then'](function(){if(_0x553f56[_0x4d63('0x9e')]['role']===_0x4d63('0x9c')&&!_0x133d00&&!_0x553f56['query'][_0x4d63('0x78')])return[];return db[_0x4d63('0x9f')][_0x4d63('0x3f')](_0x3a26e9[_0x4d63('0xa0')](),_0x392e29);})[_0x4d63('0x36')](function(_0x4dd07e){_0x2495e5[_0x4d63('0x27')]=_0x4dd07e[_0x4d63('0x43')];if(_0x2495e5[_0x4d63('0x27')]===0x0)return[];return db[_0x4d63('0x9f')][_0x4d63('0x3f')](_0x4f474a[_0x4d63('0xa0')](),_0x392e29)['then'](function(_0x4c741c){_0x9126c=_[_0x4d63('0xa1')](_0x4c741c,'id');_0x392e29=_[_0x4d63('0xa2')](_0x392e29,{'model':db[_0x4d63('0xa3')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x553f56[_0x4d63('0x3f')][_0x4d63('0x42')]){_0x2a73bd[_0x4d63('0x40')][_0x4d63('0x34')](function(_0x409145){_0x35f860['field']('i.'+_0x409145);});}else{_0x35f860[_0x4d63('0x49')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x4d63('0x94'));_0x35f860[_0x4d63('0x49')](_0x4d63('0xa4'),'Account.key');_0x35f860[_0x4d63('0x49')](_0x4d63('0xa5'),'Account.mandatoryDisposition');_0x35f860[_0x4d63('0x49')](_0x4d63('0xa6'),_0x4d63('0x96'));_0x35f860[_0x4d63('0x49')](_0x4d63('0xa7'));_0x35f860['field']('c.firstName',_0x4d63('0xa8'));_0x35f860[_0x4d63('0x49')]('c.lastName',_0x4d63('0xa9'));_0x35f860[_0x4d63('0x49')](_0x4d63('0xaa'),_0x4d63('0xab'));_0x35f860[_0x4d63('0x49')](_0x4d63('0xac'),_0x4d63('0xad'));_0x35f860[_0x4d63('0x49')]('c.mobile','Contact.mobile');_0x35f860[_0x4d63('0x49')](_0x4d63('0xae'),_0x4d63('0xaf'));_0x35f860[_0x4d63('0x49')](_0x4d63('0xb0'),_0x4d63('0xb1'));_0x35f860[_0x4d63('0x49')](_0x4d63('0xb2'),_0x4d63('0xb3'));_0x35f860[_0x4d63('0x49')](_0x4d63('0xb4'),_0x4d63('0x31'));}if(_0x2a73bd['limit'])_0x35f860[_0x4d63('0x26')](_0x2a73bd[_0x4d63('0x26')]);if(_0x2a73bd[_0x4d63('0x25')])_0x35f860['offset'](_0x2a73bd[_0x4d63('0x25')]);return db[_0x4d63('0x9f')]['query'](_0x35f860[_0x4d63('0xa0')](),_0x392e29);})[_0x4d63('0x36')](function(_0x342615){if(_0x342615[_0x4d63('0x43')]>0x0)_0x21cc0b[_0x4d63('0x46')](_0x4d63('0xb5'),_[_0x4d63('0x2f')](_0x342615,'id'));return db[_0x4d63('0x9f')][_0x4d63('0x3f')](_0x21cc0b['toString'](),_0x392e29)['then'](function(_0x17cf9b){var _0xf16c44=_[_0x4d63('0xb6')](_0x17cf9b,_0x4d63('0xb7'));var _0x422503=[];_0x342615['forEach'](function(_0x4c6d58){_0x422503[_0x4d63('0x35')](updateWhatsappInteraction(_0x4c6d58,_0x9126c,_0xf16c44));});return BPromise[_0x4d63('0xb8')](_0x422503);});});})[_0x4d63('0x36')](function(_0x3886d7){_0x2495e5['rows']=_0x3886d7;return _0x2495e5;})[_0x4d63('0x36')](respondWithFilteredResult(_0x2dba14,_0x2a73bd))[_0x4d63('0x37')](handleError(_0x2dba14,null));};exports[_0x4d63('0xb9')]=function(_0xcd7b80,_0x263b96){var _0x817b7b={'raw':![],'where':{'id':_0xcd7b80[_0x4d63('0xba')]['id']}},_0x83b6f8={};_0x83b6f8[_0x4d63('0x3c')]=_[_0x4d63('0x3d')](db['WhatsappInteraction'][_0x4d63('0x39')]);_0x83b6f8['query']=_[_0x4d63('0x3d')](_0xcd7b80['query']);_0x83b6f8[_0x4d63('0x3e')]=_[_0x4d63('0x41')](_0x83b6f8[_0x4d63('0x3c')],_0x83b6f8[_0x4d63('0x3f')]);_0x817b7b[_0x4d63('0x40')]=_[_0x4d63('0x41')](_0x83b6f8['model'],qs['fields'](_0xcd7b80[_0x4d63('0x3f')][_0x4d63('0x42')]));_0x817b7b[_0x4d63('0x40')]=_0x817b7b[_0x4d63('0x40')][_0x4d63('0x43')]?_0x817b7b[_0x4d63('0x40')]:_0x83b6f8['model'];if(_0xcd7b80[_0x4d63('0x3f')][_0x4d63('0xbb')]){_0x817b7b[_0x4d63('0xbc')]=[{'all':!![]}];}_0x817b7b=_[_0x4d63('0xa2')]({},_0x817b7b,_0xcd7b80[_0x4d63('0xbd')]);return db[_0x4d63('0xa3')]['find'](_0x817b7b)[_0x4d63('0x36')](handleEntityNotFound(_0x263b96,null))[_0x4d63('0x36')](respondWithResult(_0x263b96,null))[_0x4d63('0x37')](handleError(_0x263b96,null));};exports[_0x4d63('0xbe')]=function(_0x5bda54,_0x13ede7){return db[_0x4d63('0xa3')][_0x4d63('0xbe')](_0x5bda54[_0x4d63('0xbf')],{})[_0x4d63('0x36')](respondWithResult(_0x13ede7,0xc9))[_0x4d63('0x37')](handleError(_0x13ede7,null));};exports[_0x4d63('0xc0')]=function(_0x4c58af,_0xc9adb8){if(_0x4c58af[_0x4d63('0xbf')]['id']){delete _0x4c58af['body']['id'];}return db[_0x4d63('0xa3')][_0x4d63('0x61')]({'where':{'id':_0x4c58af[_0x4d63('0xba')]['id']}})[_0x4d63('0x36')](handleEntityNotFound(_0xc9adb8,null))[_0x4d63('0x36')](saveUpdates(_0x4c58af['body'],null))['then'](respondWithResult(_0xc9adb8,null))['catch'](handleError(_0xc9adb8,null));};exports[_0x4d63('0x2b')]=function(_0x2636ee,_0x82700){return db[_0x4d63('0xa3')][_0x4d63('0x61')]({'where':{'id':_0x2636ee[_0x4d63('0xba')]['id']}})['then'](handleEntityNotFound(_0x82700,null))['then'](removeEntity(_0x82700,null))[_0x4d63('0x37')](handleError(_0x82700,null));};exports[_0x4d63('0xc1')]=function(_0x310504,_0x416cdf){return db[_0x4d63('0xa3')][_0x4d63('0xc1')]()[_0x4d63('0x36')](respondWithResult(_0x416cdf,null))[_0x4d63('0x37')](handleError(_0x416cdf,null));};exports[_0x4d63('0xc2')]=function(_0x455c41,_0x203b1c,_0x4d2d4e){return db['WhatsappMessage'][_0x4d63('0x61')]({'where':{'id':_0x455c41['params']['id']}})[_0x4d63('0x36')](handleEntityNotFound(_0x203b1c,null))[_0x4d63('0x36')](function(_0x264912){if(_0x264912){return _0x264912['addMessage'](_0x455c41[_0x4d63('0xbf')][_0x4d63('0xc3')],_[_0x4d63('0xc4')](_0x455c41[_0x4d63('0xbf')],[_0x4d63('0xc3'),'id'])||{});}})['then'](respondWithResult(_0x203b1c,null))[_0x4d63('0x37')](handleError(_0x203b1c,null));};exports[_0x4d63('0xc5')]=function(_0x354180,_0x253f25,_0x58161a){var _0x3c340e={'raw':![],'where':{}};var _0x421e17={};var _0x2fb0d4={'count':0x0,'rows':[]};return db[_0x4d63('0xa3')][_0x4d63('0xc6')]({'where':{'id':_0x354180[_0x4d63('0xba')]['id']}})['then'](handleEntityNotFound(_0x253f25,null))[_0x4d63('0x36')](function(_0x484add){if(_0x484add){_0x421e17[_0x4d63('0x3c')]=_[_0x4d63('0x3d')](db['WhatsappMessage'][_0x4d63('0x39')]);_0x421e17[_0x4d63('0x3f')]=_[_0x4d63('0x3d')](_0x354180[_0x4d63('0x3f')]);_0x421e17[_0x4d63('0x3e')]=_[_0x4d63('0x41')](_0x421e17[_0x4d63('0x3c')],_0x421e17[_0x4d63('0x3f')]);_0x3c340e['attributes']=_['intersection'](_0x421e17[_0x4d63('0x3c')],qs['fields'](_0x354180[_0x4d63('0x3f')][_0x4d63('0x42')]));_0x3c340e[_0x4d63('0x40')]=_0x3c340e['attributes']['length']?_0x3c340e[_0x4d63('0x40')]:_0x421e17[_0x4d63('0x3c')];if(!_0x354180['query'][_0x4d63('0xc7')](_0x4d63('0x44'))){_0x3c340e[_0x4d63('0x26')]=qs[_0x4d63('0x26')](_0x354180[_0x4d63('0x3f')][_0x4d63('0x26')]);_0x3c340e[_0x4d63('0x25')]=qs[_0x4d63('0x25')](_0x354180[_0x4d63('0x3f')][_0x4d63('0x25')]);}_0x3c340e['order']=qs['sort'](_0x354180[_0x4d63('0x3f')]['sort']);_0x3c340e['where']=qs['filters'](_[_0x4d63('0x47')](_0x354180[_0x4d63('0x3f')],_0x421e17[_0x4d63('0x3e')]));_0x3c340e[_0x4d63('0x46')][_0x4d63('0xb7')]=_0x484add['id'];if(_0x354180['query'][_0x4d63('0x87')]){_0x3c340e[_0x4d63('0x46')]=_[_0x4d63('0xa2')](_0x3c340e[_0x4d63('0x46')],{'$or':_[_0x4d63('0x2f')](_0x3c340e['attributes'],function(_0x4deef1){var _0x5de9d7={};_0x5de9d7[_0x4deef1]={'$like':'%'+_0x354180[_0x4d63('0x3f')]['filter']+'%'};return _0x5de9d7;})});}if(_0x354180[_0x4d63('0x3f')][_0x4d63('0x7d')]){var _0x26f07f=_0x354180[_0x4d63('0x3f')][_0x4d63('0x7d')][_0x4d63('0x33')](',');var _0x1fa96b={};_0x1fa96b[_0x26f07f[0x0]]={'$gte':moment(_0x26f07f[0x1])[_0x4d63('0xc8')]('YYYY-MM-DD\x20HH:mm:ss')};_0x3c340e['where']=_[_0x4d63('0xa2')](_0x3c340e['where'],_0x1fa96b);}_0x3c340e=_[_0x4d63('0xa2')]({},_0x3c340e,_0x354180[_0x4d63('0xbd')]);return db['WhatsappMessage'][_0x4d63('0x27')]({'where':_0x3c340e[_0x4d63('0x46')]})[_0x4d63('0x36')](function(_0x5b35f1){_0x2fb0d4[_0x4d63('0x27')]=_0x5b35f1;if(_0x354180['query'][_0x4d63('0xbb')]){_0x3c340e[_0x4d63('0xbc')]=[{'all':!![]}];}return db[_0x4d63('0xc9')]['findAll'](_0x3c340e);})['then'](function(_0x19c3ce){_0x2fb0d4[_0x4d63('0xca')]=_0x19c3ce;return _0x2fb0d4;});}})['then'](respondWithFilteredResult(_0x253f25,_0x3c340e))[_0x4d63('0x37')](handleError(_0x253f25,null));};exports['addTags']=function(_0x477250,_0x1899e0,_0x4844d3){return db[_0x4d63('0xa3')][_0x4d63('0x61')]({'where':{'id':_0x477250[_0x4d63('0xba')]['id']}})[_0x4d63('0x36')](handleEntityNotFound(_0x1899e0,null))[_0x4d63('0x36')](function(_0x1fa958){if(_0x1fa958){return _0x1fa958[_0x4d63('0xcb')](_0x477250[_0x4d63('0xbf')]['ids'],_[_0x4d63('0xc4')](_0x477250[_0x4d63('0xbf')],[_0x4d63('0xc3'),'id'])||{})[_0x4d63('0xcc')](function(){return db['Tag'][_0x4d63('0xcd')]({'attributes':['id',_0x4d63('0x2d'),_0x4d63('0x4a')],'where':{'id':_0x477250[_0x4d63('0xbf')]['ids']}});})[_0x4d63('0x36')](function(_0x3fabbd){socket[_0x4d63('0xce')]('whatsappInteractionTags:save',{'id':Number(_0x477250['params']['id']),'tags':_0x3fabbd||[]});return{'id':Number(_0x477250[_0x4d63('0xba')]['id']),'tags':_0x3fabbd||[]};});}})[_0x4d63('0x36')](respondWithResult(_0x1899e0,null))['catch'](handleError(_0x1899e0,null));};exports[_0x4d63('0xcf')]=function(_0x48084d,_0x2a67c5,_0x1b698d){return db[_0x4d63('0xa3')][_0x4d63('0x61')]({'where':{'id':_0x48084d[_0x4d63('0xba')]['id']}})['then'](handleEntityNotFound(_0x2a67c5,null))[_0x4d63('0x36')](function(_0x10e610){if(_0x10e610){return _0x10e610[_0x4d63('0xcf')](_0x48084d[_0x4d63('0x3f')]['ids']);}})['then'](respondWithStatusCode(_0x2a67c5,null))['catch'](handleError(_0x2a67c5,null));};exports[_0x4d63('0xd0')]=function(_0x300118,_0x76a31f){var _0x44166f=moment()[_0x4d63('0xd1')]()[_0x4d63('0xa0')]();var _0x3348b9=path[_0x4d63('0xd2')](config[_0x4d63('0xd3')],_0x4d63('0xd4'),'files',_0x4d63('0xd5'));var _0xe23689=path['join'](config[_0x4d63('0xd3')],_0x4d63('0xd4'),_0x4d63('0xd6'),_0x4d63('0xd7'));var _0xa55eae=path[_0x4d63('0xd2')](_0x3348b9,_0x44166f);var _0x20f5fa=util[_0x4d63('0xc8')]('transcript-%d-%s.zip',_0x300118[_0x4d63('0xba')]['id'],_0x44166f);var _0x599a0b=path[_0x4d63('0xd2')](_0x3348b9,_0x20f5fa);var _0x24b404=[];_0x24b404[_0x4d63('0x35')]({'model':db[_0x4d63('0x71')],'as':_0x4d63('0x71'),'attributes':['id',_0x4d63('0x30')],'raw':!![]});_0x24b404[_0x4d63('0x35')]({'model':db['CmContact'],'as':'Contact','attributes':['id','firstName',_0x4d63('0xd8')],'raw':!![]});if(_0x300118[_0x4d63('0x3f')][_0x4d63('0xd7')]){_0x24b404[_0x4d63('0x35')]({'model':db[_0x4d63('0xd9')],'as':_0x4d63('0xd9'),'raw':!![]});}var _0x39d41c=[{'model':db[_0x4d63('0xc9')],'as':_0x4d63('0xda'),'attributes':['id',_0x4d63('0xbf'),_0x4d63('0x7b'),_0x4d63('0xdb'),_0x4d63('0xdc'),'read'],'include':_0x24b404}];_0x39d41c[_0x4d63('0x35')]({'model':db[_0x4d63('0xdd')],'as':_0x4d63('0xde'),'attributes':['id',_0x4d63('0x2d')]});_0x39d41c[_0x4d63('0x35')]({'model':db[_0x4d63('0x71')],'as':_0x4d63('0xdf'),'attributes':['id',_0x4d63('0x30')]});return db[_0x4d63('0xa3')][_0x4d63('0x61')]({'where':{'id':_0x300118['params']['id']},'include':_0x39d41c})[_0x4d63('0x36')](handleEntityNotFound(_0x76a31f,null))['then'](function(_0x453f1f){if(_0x453f1f){var _0x5acc75=_0x453f1f['get']({'plain':!![]});fs[_0x4d63('0xe0')](_0xa55eae);var _0xe0a942={'channel':_0x4d63('0xe1'),'account':_0x5acc75[_0x4d63('0xde')]['name'],'agent':_0x5acc75[_0x4d63('0xdf')]?_0x5acc75['Owner'][_0x4d63('0x30')]:_0x4d63('0xe2'),'createdAt':moment(_0x5acc75[_0x4d63('0x7b')])['format'](_0x4d63('0xe3'))[_0x4d63('0xa0')](),'closedAt':_0x5acc75[_0x4d63('0xe4')]?moment(_0x5acc75['closedAt'])[_0x4d63('0xc8')](_0x4d63('0xe3'))['toString']():'','disposition':_0x5acc75[_0x4d63('0xe5')],'messages':_(_0x5acc75[_0x4d63('0xda')])['filter']({'secret':![]})[_0x4d63('0x2f')](function(_0x4bbb75){if(_0x4bbb75[_0x4d63('0xd9')]){var _0x31c5f1=path[_0x4d63('0xd2')](_0xe23689,_0x4bbb75[_0x4d63('0xd9')][_0x4d63('0xe6')]);if(fs[_0x4d63('0xe7')](_0x31c5f1)){fs[_0x4d63('0xe8')](_0x31c5f1)['pipe'](fs[_0x4d63('0xe9')](path[_0x4d63('0xd2')](_0xa55eae,_0x4bbb75[_0x4d63('0xd9')][_0x4d63('0xe6')])));}}return{'date':moment(_0x4bbb75[_0x4d63('0x7b')])[_0x4d63('0xc8')](_0x4d63('0xe3'))[_0x4d63('0xa0')](),'sender':_0x4bbb75[_0x4d63('0xdb')]==='out'?_0x4bbb75[_0x4d63('0x71')]?_0x4bbb75['User']['fullname']:_0x4d63('0xea'):_0x4bbb75[_0x4d63('0x66')][_0x4d63('0xeb')]+(_0x4bbb75[_0x4d63('0x66')][_0x4d63('0xd8')]?'\x20'+_0x4bbb75[_0x4d63('0x66')]['lastName']:''),'body':_0x4bbb75[_0x4d63('0xd9')]?_0x4bbb75['Attachment']['basename']:_0x4bbb75[_0x4d63('0xbf')],'direction':_0x4bbb75[_0x4d63('0xdb')]===_0x4d63('0xec')?'A':'C','secret':_0x4bbb75[_0x4d63('0xdc')],'read':_0x4bbb75[_0x4d63('0x82')],'attachment':_0x4bbb75[_0x4d63('0xd9')]};})[_0x4d63('0x62')]()};return ejs['renderFile'](path[_0x4d63('0xd2')](config[_0x4d63('0xd3')],_0x4d63('0xd4'),_0x4d63('0xed'),_0x4d63('0xee')),{'interaction':_0xe0a942})[_0x4d63('0x36')](function(_0x2892b1){var _0x24761f=path[_0x4d63('0xd2')](_0xa55eae,'transcript-'+_0x5acc75['id']+'-'+_0x44166f+'.pdf');var _0x40cb76={'path':_0x24761f,'channel':_0x4d63('0xe1'),'interactionId':_0x5acc75['id']};return pdf[_0x4d63('0xef')](_0x2892b1,_0x40cb76);})[_0x4d63('0x36')](function(){return new BPromise(function(_0x3cdb12,_0x2f891c){zipdir(_0xa55eae,{'saveTo':_0x599a0b},function(_0x31e28d,_0x52d3d3){if(_0x31e28d)return _0x2f891c(_0x31e28d);return _0x3cdb12(_0x52d3d3);});})['then'](function(){return new BPromise(function(_0x227fca,_0x2f043b){rimraf(_0xa55eae,function(_0x8b4197){if(_0x8b4197)_0x2f043b(_0x8b4197);return _0x227fca();});});})[_0x4d63('0x36')](function(){return _0x76a31f['download'](_0x599a0b,_0x20f5fa,function(_0x41ff9e){if(_0x41ff9e){console[_0x4d63('0xf0')](_0x4d63('0xf1'),_0x41ff9e);}else{fs[_0x4d63('0xf2')](_0x599a0b);}});});});}else{return _0x76a31f[_0x4d63('0x21')](0xc8);}})['catch'](handleError(_0x76a31f,null));}; \ No newline at end of file +var _0xeec3=['to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/environment','defaults','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','end','json','offset','undefined','count','status','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','Users','map','fullname','TagIds','Tags','split','forEach','push','index','fieldName','type','key','keys','intersection','model','query','attributes','fields','hasOwnProperty','nolimit','limit','sort','where','filters','pick','select','field','from','u.id','u.fullname','user_has_whatsapp_interactions','left_join','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','whatsapp_messages','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','tools_tags','expr','search','parseSearch','sqlOperator','length','conditions','find','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','operator','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','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','UserId','body','isEmpty','WhatsappAccountId','concat','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','role','user','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','i.WhatsappAccountId\x20IN\x20?','sequelize','toString','keyBy','merge','WhatsappInteraction','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','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','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','all','rows','catch','params','includeAll','create','describe','addMessage','ids','getMessages','findOne','rawAttributes','WhatsappMessage','include','findAll','addTags','setTags','omit','spread','color','whatsappInteractionTags:save','removeTags','unix','join','server','tmp','files','attachments','format','firstName','lastName','Messages','createdAt','direction','secret','Account','Owner','get','mkdirSync','Whatsapp','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','disposition','Attachment','basename','existsSync','createReadStream','pipe','Contact','renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','download','eml-format','rimraf','mustache','util','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js'];(function(_0x5323d9,_0x2901fd){var _0x2d338c=function(_0x12aee1){while(--_0x12aee1){_0x5323d9['push'](_0x5323d9['shift']());}};_0x2d338c(++_0x2901fd);}(_0xeec3,0x1c3));var _0x3eec=function(_0x1436d0,_0x30599f){_0x1436d0=_0x1436d0-0x0;var _0xb3c5f1=_0xeec3[_0x1436d0];return _0xb3c5f1;};'use strict';var emlformat=require(_0x3eec('0x0'));var rimraf=require(_0x3eec('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3eec('0x2'));var util=require(_0x3eec('0x3'));var path=require('path');var sox=require(_0x3eec('0x4'));var csv=require('to-csv');var ejs=require(_0x3eec('0x5'));var fs=require('fs');var fs_extra=require(_0x3eec('0x6'));var _=require('lodash');var squel=require(_0x3eec('0x7'));var crypto=require(_0x3eec('0x8'));var jsforce=require(_0x3eec('0x9'));var deskjs=require(_0x3eec('0xa'));var toCsv=require(_0x3eec('0xb'));var querystring=require(_0x3eec('0xc'));var Papa=require(_0x3eec('0xd'));var Redis=require(_0x3eec('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x3eec('0xf'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x3eec('0x10'));var hardwareService=require(_0x3eec('0x11'));var logger=require(_0x3eec('0x12'))(_0x3eec('0x13'));var utils=require('../../config/utils');var config=require(_0x3eec('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x3eec('0x15')](config[_0x3eec('0x16')],{'host':_0x3eec('0x17'),'port':0x18eb});var socket=require(_0x3eec('0x18'))(new Redis(config['redis']));require(_0x3eec('0x19'))['register'](socket);function respondWithStatusCode(_0x4972ee,_0x523a2d){_0x523a2d=_0x523a2d||0xcc;return function(_0x121197){if(_0x121197){return _0x4972ee['sendStatus'](_0x523a2d);}return _0x4972ee['status'](_0x523a2d)[_0x3eec('0x1a')]();};}function respondWithResult(_0x335c87,_0x7698b){_0x7698b=_0x7698b||0xc8;return function(_0x48b170){if(_0x48b170){return _0x335c87['status'](_0x7698b)[_0x3eec('0x1b')](_0x48b170);}};}function respondWithFilteredResult(_0x4623ab,_0x500109){return function(_0x1c1251){if(_0x1c1251){var _0x497d60=typeof _0x500109[_0x3eec('0x1c')]===_0x3eec('0x1d')&&typeof _0x500109['limit']===_0x3eec('0x1d');var _0x5c9593=_0x1c1251[_0x3eec('0x1e')];var _0x576cc8=_0x497d60?0x0:_0x500109[_0x3eec('0x1c')];var _0x2dd282=_0x497d60?_0x1c1251['count']:_0x500109[_0x3eec('0x1c')]+_0x500109['limit'];var _0x50bdd1;if(_0x2dd282>=_0x5c9593){_0x2dd282=_0x5c9593;_0x50bdd1=0xc8;}else{_0x50bdd1=0xce;}_0x4623ab[_0x3eec('0x1f')](_0x50bdd1);return _0x4623ab[_0x3eec('0x20')]('Content-Range',_0x576cc8+'-'+_0x2dd282+'/'+_0x5c9593)[_0x3eec('0x1b')](_0x1c1251);}return null;};}function patchUpdates(_0x5e279f){return function(_0x37e5af){try{jsonpatch[_0x3eec('0x21')](_0x37e5af,_0x5e279f,!![]);}catch(_0x18e9ac){return BPromise[_0x3eec('0x22')](_0x18e9ac);}return _0x37e5af[_0x3eec('0x23')]();};}function saveUpdates(_0x203b3f,_0x34fbe4){return function(_0x1023a0){if(_0x1023a0){return _0x1023a0[_0x3eec('0x24')](_0x203b3f)[_0x3eec('0x25')](function(_0x10b1fb){return _0x10b1fb;});}return null;};}function removeEntity(_0xba4ac6,_0x1d998e){return function(_0x5d816b){if(_0x5d816b){return _0x5d816b[_0x3eec('0x26')]()['then'](function(){_0xba4ac6[_0x3eec('0x1f')](0xcc)[_0x3eec('0x1a')]();});}};}function handleEntityNotFound(_0x279404,_0x1821d6){return function(_0x31adcd){if(!_0x31adcd){_0x279404[_0x3eec('0x27')](0x194);}return _0x31adcd;};}function handleError(_0x2c0208,_0x17c896){_0x17c896=_0x17c896||0x1f4;return function(_0x9de845){logger[_0x3eec('0x28')](_0x9de845[_0x3eec('0x29')]);if(_0x9de845[_0x3eec('0x2a')]){delete _0x9de845[_0x3eec('0x2a')];}_0x2c0208[_0x3eec('0x1f')](_0x17c896)[_0x3eec('0x2b')](_0x9de845);};}function getInteractionUsers(_0x305313,_0x4ba0e7){return new BPromise(function(_0x3ad6e0,_0x358156){try{if(_0x4ba0e7[_0x305313['id']]){_0x305313[_0x3eec('0x2c')]=_[_0x3eec('0x2d')](_0x4ba0e7[_0x305313['id']],function(_0x25eded){return{'id':_0x25eded['id'],'fullname':_0x25eded[_0x3eec('0x2e')]};});}}catch(_0x5a69b4){_0x358156(_0x5a69b4);}_0x3ad6e0(_0x305313);});}function getInteractionTags(_0x57b6fb,_0x2069e6){return new BPromise(function(_0x44f526,_0x3c55ec){try{if(_0x57b6fb[_0x3eec('0x2f')]){_0x57b6fb[_0x3eec('0x30')]=[];_0x57b6fb[_0x3eec('0x2f')][_0x3eec('0x31')](',')[_0x3eec('0x32')](function(_0x5db8a7){_0x57b6fb[_0x3eec('0x30')][_0x3eec('0x33')](_0x2069e6[_0x5db8a7]);});}delete _0x57b6fb[_0x3eec('0x2f')];}catch(_0x4c62bd){_0x3c55ec(_0x4c62bd);}_0x44f526(_0x57b6fb);});}function updateWhatsappInteraction(_0x57106d,_0x3690ec,_0x448975){return new BPromise(function(_0x5e4efe,_0x586f3d){return getInteractionUsers(_0x57106d,_0x448975)[_0x3eec('0x25')](function(_0x53b3fc){return getInteractionTags(_0x53b3fc,_0x3690ec);})[_0x3eec('0x25')](function(_0x33aa81){_0x5e4efe(_0x33aa81);})['catch'](function(_0x1cf03a){_0x586f3d(_0x1cf03a);});});}exports[_0x3eec('0x34')]=function(_0x49ccad,_0x4cd84c){var _0x81f4fa={},_0x374661={},_0x38dfdc={'count':0x0,'rows':[]};var _0x4f5c6e=_[_0x3eec('0x2d')](db['WhatsappInteraction']['rawAttributes'],function(_0x47e4c4){return{'name':_0x47e4c4[_0x3eec('0x35')],'type':_0x47e4c4[_0x3eec('0x36')][_0x3eec('0x37')]};});_0x374661['model']=_[_0x3eec('0x2d')](_0x4f5c6e,_0x3eec('0x2a'));_0x374661['query']=_[_0x3eec('0x38')](_0x49ccad['query']);_0x374661['filters']=_[_0x3eec('0x39')](_0x374661[_0x3eec('0x3a')],_0x374661[_0x3eec('0x3b')]);_0x81f4fa[_0x3eec('0x3c')]=_['intersection'](_0x374661[_0x3eec('0x3a')],qs[_0x3eec('0x3d')](_0x49ccad[_0x3eec('0x3b')][_0x3eec('0x3d')]));_0x81f4fa[_0x3eec('0x3c')]=_0x81f4fa['attributes']['length']?_0x81f4fa[_0x3eec('0x3c')]:_0x374661[_0x3eec('0x3a')];if(!_0x49ccad[_0x3eec('0x3b')][_0x3eec('0x3e')](_0x3eec('0x3f'))){_0x81f4fa[_0x3eec('0x40')]=qs['limit'](_0x49ccad[_0x3eec('0x3b')][_0x3eec('0x40')]);_0x81f4fa[_0x3eec('0x1c')]=qs[_0x3eec('0x1c')](_0x49ccad[_0x3eec('0x3b')][_0x3eec('0x1c')]);}_0x81f4fa['order']=qs[_0x3eec('0x41')](_0x49ccad[_0x3eec('0x3b')][_0x3eec('0x41')]);_0x81f4fa[_0x3eec('0x42')]=qs[_0x3eec('0x43')](_[_0x3eec('0x44')](_0x49ccad[_0x3eec('0x3b')],_0x374661[_0x3eec('0x43')]),_0x4f5c6e);var _0x4648ca=[];var _0x15ace1=squel[_0x3eec('0x45')]()[_0x3eec('0x46')]('id')[_0x3eec('0x46')](_0x3eec('0x2a'))[_0x3eec('0x46')]('color')[_0x3eec('0x47')]('tools_tags');var _0x1138b8=squel['select']()[_0x3eec('0x46')](_0x3eec('0x48'))['field'](_0x3eec('0x49'))[_0x3eec('0x46')]('ui.WhatsappInteractionId')[_0x3eec('0x47')](_0x3eec('0x4a'),'ui')[_0x3eec('0x4b')](_0x3eec('0x4c'),'u',_0x3eec('0x4d'));var _0x12aa81=squel['select']()['from'](_0x3eec('0x4e'),'i')[_0x3eec('0x4b')](_0x3eec('0x4f'),'c',_0x3eec('0x50'))[_0x3eec('0x4b')]('users','o',_0x3eec('0x51'))[_0x3eec('0x4b')]('whatsapp_accounts','a','a.id\x20=\x20i.WhatsappAccountId')[_0x3eec('0x4b')](_0x3eec('0x52'),'me','me.WhatsappInteractionId\x20=\x20i.id')[_0x3eec('0x4b')](_0x3eec('0x53'),'it',_0x3eec('0x54'))['left_join'](_0x3eec('0x55'),'t','t.id\x20=\x20it.TagId');var _0x470c95=squel[_0x3eec('0x56')]();var _0xbdbe4a=[];var _0x17e6c9=squel['expr']();var _0x326a69;if(_0x49ccad[_0x3eec('0x3b')][_0x3eec('0x57')]){_0x326a69=as[_0x3eec('0x58')](_0x49ccad[_0x3eec('0x3b')][_0x3eec('0x57')]);var _0x5cbdba=_0x326a69[_0x3eec('0x59')];for(var _0x422d82=0x0;_0x422d82<_0x326a69['conditions'][_0x3eec('0x5a')];_0x422d82++){var _0xe123e9=_0x326a69[_0x3eec('0x5b')][_0x422d82];var _0x1b0a3a='i';var _0x52e064=_[_0x3eec('0x5c')](_0x4f5c6e,[_0x3eec('0x2a'),_0xe123e9[_0x3eec('0x46')]]);if(!_0x52e064){switch(_0xe123e9[_0x3eec('0x46')]){case _0x3eec('0x5d'):if(_0xe123e9[_0x3eec('0x5e')]==0x1){_0x12aa81['having']('`'+_0xe123e9[_0x3eec('0x46')]+_0x3eec('0x5f'));}else{_0x12aa81[_0x3eec('0x60')]('`'+_0xe123e9['field']+_0x3eec('0x61'));}break;case'Contact':if(_0xe123e9[_0x3eec('0x62')]==='$substring'){if(_0xe123e9[_0x3eec('0x5e')]['split']('\x20')[_0x3eec('0x5a')]>0x1){_0x470c95[_0x5cbdba](_0x3eec('0x63'),qs[_0x3eec('0x64')](_0xe123e9[_0x3eec('0x5e')]),null);}else{var _0x53d4f0='%'+_0xe123e9[_0x3eec('0x5e')]+'%';_0x470c95[_0x5cbdba](_0x3eec('0x65'),_0x53d4f0,_0x53d4f0,_0x53d4f0);}}else{_0x52e064=_[_0x3eec('0x5c')](_0x4f5c6e,[_0x3eec('0x2a'),_0x3eec('0x66')]);_0xe123e9[_0x3eec('0x46')]='ContactId';_0x538637=as[_0x3eec('0x67')](_0x1b0a3a,_0x52e064[_0x3eec('0x36')],_0xe123e9);_0x470c95[_0x5cbdba](_0x538637[_0x3eec('0x68')],_0x538637[_0x3eec('0x5e')][_0x3eec('0x69')],_0x538637[_0x3eec('0x5e')][_0x3eec('0x1a')]);}break;case _0x3eec('0x6a'):var _0xa35cde=_0xe123e9[_0x3eec('0x5e')][_0x3eec('0x31')](',')[_0x3eec('0x2d')](function(_0x4c30a7){return Number(_0x4c30a7);});_0xa35cde[_0x3eec('0x32')](function(_0x34ba92){_0x17e6c9['or'](_0x3eec('0x6b'),'%,'+_0x34ba92+',%');});_0xbdbe4a=_[_0x3eec('0x6c')](_0xbdbe4a,_0xa35cde);break;case _0x3eec('0x6d'):if(_0xe123e9[_0x3eec('0x62')]===_0x3eec('0x6e')){_0x470c95[_0x5cbdba]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0xe123e9['value']+'%',null);}else{_0x52e064=_[_0x3eec('0x5c')](_0x4f5c6e,[_0x3eec('0x2a'),'UserId']);_0xe123e9['field']=_0x3eec('0x6f');_0x538637=as[_0x3eec('0x67')](_0x1b0a3a,_0x52e064[_0x3eec('0x36')],_0xe123e9);_0x470c95[_0x5cbdba](_0x538637['text'],_0x538637[_0x3eec('0x5e')][_0x3eec('0x69')],_0x538637[_0x3eec('0x5e')]['end']);}break;case _0x3eec('0x70'):_0x538637=as['buildExpression']('me',null,_0xe123e9);_0x470c95[_0x5cbdba](_0x538637[_0x3eec('0x68')],_0x538637[_0x3eec('0x5e')][_0x3eec('0x69')],_0x538637[_0x3eec('0x5e')][_0x3eec('0x1a')]);break;}}else{var _0x538637=as['buildExpression'](_0x1b0a3a,_0x52e064[_0x3eec('0x36')],_0xe123e9);_0x470c95[_0x5cbdba](_0x538637['text'],_0x538637[_0x3eec('0x5e')][_0x3eec('0x69')],_0x538637['value'][_0x3eec('0x1a')]);}}}else{var _0x20b530=_(_0x49ccad[_0x3eec('0x3b')])[_0x3eec('0x38')]()[_0x3eec('0x2d')](function(_0x18437f){return _['some'](_0x4f5c6e,[_0x3eec('0x2a'),_0x18437f])?_0x18437f:undefined;})['compact']()[_0x3eec('0x5e')]();if(!_[_0x3eec('0x71')](_0x20b530)){_0x20b530[_0x3eec('0x32')](function(_0x1a5fad){if(_0x1a5fad===_0x3eec('0x72')){_0x12aa81[_0x3eec('0x42')]('i.WhatsappAccountId\x20IN\x20?',[][_0x3eec('0x73')](_0x49ccad[_0x3eec('0x3b')][_0x1a5fad]));}else if(_0x1a5fad==='createdAt'){var _0x263dc2=JSON[_0x3eec('0x74')](_0x49ccad['query'][_0x1a5fad])[_0x3eec('0x75')];var _0x50c1ec=JSON[_0x3eec('0x74')](_0x49ccad[_0x3eec('0x3b')][_0x1a5fad])['$lte'];_0x12aa81[_0x3eec('0x42')](_0x3eec('0x76'),_0x263dc2,_0x50c1ec);}else{if(_0x49ccad[_0x3eec('0x3b')][_0x1a5fad]==='null'){_0x12aa81[_0x3eec('0x42')]('i.'+_0x1a5fad+_0x3eec('0x77'));}else{_0x12aa81[_0x3eec('0x42')]('i.'+_0x1a5fad+_0x3eec('0x78'),_0x49ccad[_0x3eec('0x3b')][_0x1a5fad]);}}});}if(_0x49ccad[_0x3eec('0x3b')][_0x3eec('0x79')]){if(_0x49ccad[_0x3eec('0x3b')][_0x3eec('0x79')]==0x1){_0x12aa81[_0x3eec('0x60')](_0x3eec('0x7a'));}else{_0x12aa81[_0x3eec('0x60')](_0x3eec('0x7b'));}}if(_0x49ccad['query'][_0x3eec('0x7c')]){_0xbdbe4a=_[_0x3eec('0x7d')](_0x49ccad[_0x3eec('0x3b')][_0x3eec('0x7c')])?_0x49ccad['query'][_0x3eec('0x7c')]:new Array(_0x49ccad[_0x3eec('0x3b')]['tag']);_0xbdbe4a[_0x3eec('0x32')](function(_0x42a16f){_0x17e6c9['or'](_0x3eec('0x6b'),'%,'+_0x42a16f+',%');});}if(_0x49ccad[_0x3eec('0x3b')][_0x3eec('0x7e')]){var _0x45db97=_0x49ccad[_0x3eec('0x3b')][_0x3eec('0x7e')][_0x3eec('0x7f')]('\x5c','\x5c\x5c')[_0x3eec('0x7f')](/'/g,'\x27\x27');if(qs[_0x3eec('0x80')](_0x45db97)){_0x470c95['or'](_0x3eec('0x81'),_0x45db97+'%')['or'](_0x3eec('0x82'),_0x45db97+'%');}else{_0x470c95['or'](_0x3eec('0x83'),qs[_0x3eec('0x64')](_0x45db97))['or'](_0x3eec('0x84'),_0x45db97+'%');}}}_0x12aa81[_0x3eec('0x42')](_0x470c95);_0x12aa81['group'](_0x3eec('0x85'));var _0xe25f76={'type':db['Sequelize']['QueryTypes'][_0x3eec('0x86')],'raw':!![]};var _0x5867f7=_0x12aa81[_0x3eec('0x87')]();_0x5867f7[_0x3eec('0x46')](_0x3eec('0x85'));_0x5867f7[_0x3eec('0x46')](_0x3eec('0x88'),_0x3eec('0x5d'));if(_0x81f4fa[_0x3eec('0x89')]){_0x81f4fa[_0x3eec('0x89')][_0x3eec('0x32')](function(_0x40250b){var _0x4dd901=_0x40250b[0x0]===_0x3eec('0x8a')?_0x40250b[0x0]:'i.'+_0x40250b[0x0];_0x12aa81['order'](_0x4dd901,_0x40250b[0x1]===_0x3eec('0x8b')?![]:!![]);});}if(!_['isEmpty'](_0xbdbe4a)){_0x12aa81['having'](_0x17e6c9);_0x5867f7[_0x3eec('0x42')](_0x3eec('0x8c'),_0xbdbe4a);}BPromise[_0x3eec('0x8d')]()['then'](function(){if(!_0x326a69){if(_0x49ccad[_0x3eec('0x3b')][_0x3eec('0x72')])return;_0x5867f7[_0x3eec('0x42')]('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');_0x12aa81[_0x3eec('0x42')](_0x3eec('0x8e'));return;}if(_0x49ccad['user'][_0x3eec('0x8f')]!=='agent')return;return _0x49ccad[_0x3eec('0x90')][_0x3eec('0x91')]({'attributes':['id'],'raw':!![]})[_0x3eec('0x25')](function(_0x14a521){if(_[_0x3eec('0x71')](_0x14a521)){_0x5867f7[_0x3eec('0x42')]('i.WhatsappAccountId\x20IS\x20NULL');_0x12aa81[_0x3eec('0x42')](_0x3eec('0x92'));}else{_0x5867f7[_0x3eec('0x42')](_0x3eec('0x93'),_[_0x3eec('0x2d')](_0x14a521,'id'));_0x12aa81['where'](_0x3eec('0x93'),_[_0x3eec('0x2d')](_0x14a521,'id'));}});})[_0x3eec('0x25')](function(){if(_0x49ccad[_0x3eec('0x90')][_0x3eec('0x8f')]==='agent'&&!_0x326a69&&!_0x49ccad[_0x3eec('0x3b')]['WhatsappAccountId'])return[];return db[_0x3eec('0x94')][_0x3eec('0x3b')](_0x5867f7[_0x3eec('0x95')](),_0xe25f76);})[_0x3eec('0x25')](function(_0x2ad985){_0x38dfdc['count']=_0x2ad985[_0x3eec('0x5a')];if(_0x38dfdc[_0x3eec('0x1e')]===0x0)return[];return db[_0x3eec('0x94')][_0x3eec('0x3b')](_0x15ace1[_0x3eec('0x95')](),_0xe25f76)[_0x3eec('0x25')](function(_0x46f49d){_0x4648ca=_[_0x3eec('0x96')](_0x46f49d,'id');_0xe25f76=_[_0x3eec('0x97')](_0xe25f76,{'model':db[_0x3eec('0x98')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x49ccad['query'][_0x3eec('0x3d')]){_0x81f4fa['attributes'][_0x3eec('0x32')](function(_0x503415){_0x12aa81[_0x3eec('0x46')]('i.'+_0x503415);});}else{_0x12aa81[_0x3eec('0x46')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x12aa81[_0x3eec('0x46')](_0x3eec('0x99'),_0x3eec('0x9a'));_0x12aa81[_0x3eec('0x46')](_0x3eec('0x9b'),_0x3eec('0x9c'));_0x12aa81[_0x3eec('0x46')](_0x3eec('0x9d'),'contactName');_0x12aa81[_0x3eec('0x46')](_0x3eec('0x9e'));_0x12aa81[_0x3eec('0x46')](_0x3eec('0x9f'),'Contact.firstName');_0x12aa81[_0x3eec('0x46')](_0x3eec('0xa0'),_0x3eec('0xa1'));_0x12aa81[_0x3eec('0x46')](_0x3eec('0xa2'),'Contact.email');_0x12aa81[_0x3eec('0x46')](_0x3eec('0xa3'),_0x3eec('0xa4'));_0x12aa81['field']('c.mobile','Contact.mobile');_0x12aa81[_0x3eec('0x46')](_0x3eec('0xa5'),_0x3eec('0xa6'));_0x12aa81['field'](_0x3eec('0xa7'),'Owner.fullname');_0x12aa81['field'](_0x3eec('0xa8'),_0x3eec('0xa9'));_0x12aa81['field'](_0x3eec('0xaa'),_0x3eec('0x2f'));}if(_0x81f4fa[_0x3eec('0x40')])_0x12aa81[_0x3eec('0x40')](_0x81f4fa[_0x3eec('0x40')]);if(_0x81f4fa[_0x3eec('0x1c')])_0x12aa81[_0x3eec('0x1c')](_0x81f4fa[_0x3eec('0x1c')]);return db[_0x3eec('0x94')][_0x3eec('0x3b')](_0x12aa81['toString'](),_0xe25f76);})[_0x3eec('0x25')](function(_0x1f375c){if(_0x1f375c[_0x3eec('0x5a')]>0x0)_0x1138b8[_0x3eec('0x42')](_0x3eec('0xab'),_[_0x3eec('0x2d')](_0x1f375c,'id'));return db[_0x3eec('0x94')][_0x3eec('0x3b')](_0x1138b8[_0x3eec('0x95')](),_0xe25f76)[_0x3eec('0x25')](function(_0x5eb1a2){var _0x32bace=_[_0x3eec('0xac')](_0x5eb1a2,_0x3eec('0xad'));var _0x60f195=[];_0x1f375c[_0x3eec('0x32')](function(_0x5d143c){_0x60f195[_0x3eec('0x33')](updateWhatsappInteraction(_0x5d143c,_0x4648ca,_0x32bace));});return BPromise[_0x3eec('0xae')](_0x60f195);});});})['then'](function(_0x5b1cc5){_0x38dfdc[_0x3eec('0xaf')]=_0x5b1cc5;return _0x38dfdc;})[_0x3eec('0x25')](respondWithFilteredResult(_0x4cd84c,_0x81f4fa))[_0x3eec('0xb0')](handleError(_0x4cd84c,null));};exports['show']=function(_0x1c7634,_0x4e8af6){var _0x1cbfe2={'raw':![],'where':{'id':_0x1c7634[_0x3eec('0xb1')]['id']}},_0x21a972={};_0x21a972[_0x3eec('0x3a')]=_['keys'](db[_0x3eec('0x98')]['rawAttributes']);_0x21a972['query']=_[_0x3eec('0x38')](_0x1c7634[_0x3eec('0x3b')]);_0x21a972['filters']=_[_0x3eec('0x39')](_0x21a972['model'],_0x21a972[_0x3eec('0x3b')]);_0x1cbfe2[_0x3eec('0x3c')]=_[_0x3eec('0x39')](_0x21a972[_0x3eec('0x3a')],qs['fields'](_0x1c7634[_0x3eec('0x3b')][_0x3eec('0x3d')]));_0x1cbfe2[_0x3eec('0x3c')]=_0x1cbfe2[_0x3eec('0x3c')]['length']?_0x1cbfe2[_0x3eec('0x3c')]:_0x21a972[_0x3eec('0x3a')];if(_0x1c7634[_0x3eec('0x3b')][_0x3eec('0xb2')]){_0x1cbfe2['include']=[{'all':!![]}];}_0x1cbfe2=_['merge']({},_0x1cbfe2,_0x1c7634['options']);return db[_0x3eec('0x98')][_0x3eec('0x5c')](_0x1cbfe2)[_0x3eec('0x25')](handleEntityNotFound(_0x4e8af6,null))[_0x3eec('0x25')](respondWithResult(_0x4e8af6,null))[_0x3eec('0xb0')](handleError(_0x4e8af6,null));};exports[_0x3eec('0xb3')]=function(_0x1aa360,_0x378506){return db['WhatsappInteraction']['create'](_0x1aa360[_0x3eec('0x70')],{})[_0x3eec('0x25')](respondWithResult(_0x378506,0xc9))['catch'](handleError(_0x378506,null));};exports[_0x3eec('0x24')]=function(_0x9a79a0,_0x137b6a){if(_0x9a79a0[_0x3eec('0x70')]['id']){delete _0x9a79a0[_0x3eec('0x70')]['id'];}return db['WhatsappInteraction'][_0x3eec('0x5c')]({'where':{'id':_0x9a79a0[_0x3eec('0xb1')]['id']}})['then'](handleEntityNotFound(_0x137b6a,null))[_0x3eec('0x25')](saveUpdates(_0x9a79a0[_0x3eec('0x70')],null))[_0x3eec('0x25')](respondWithResult(_0x137b6a,null))[_0x3eec('0xb0')](handleError(_0x137b6a,null));};exports[_0x3eec('0x26')]=function(_0x48ecf6,_0x1088d8){return db[_0x3eec('0x98')][_0x3eec('0x5c')]({'where':{'id':_0x48ecf6[_0x3eec('0xb1')]['id']}})[_0x3eec('0x25')](handleEntityNotFound(_0x1088d8,null))[_0x3eec('0x25')](removeEntity(_0x1088d8,null))[_0x3eec('0xb0')](handleError(_0x1088d8,null));};exports[_0x3eec('0xb4')]=function(_0x6902ed,_0x44f788){return db['WhatsappInteraction']['describe']()[_0x3eec('0x25')](respondWithResult(_0x44f788,null))[_0x3eec('0xb0')](handleError(_0x44f788,null));};exports['addMessage']=function(_0x45efbd,_0x2bc3a2,_0x120b3c){return db['WhatsappMessage'][_0x3eec('0x5c')]({'where':{'id':_0x45efbd[_0x3eec('0xb1')]['id']}})[_0x3eec('0x25')](handleEntityNotFound(_0x2bc3a2,null))[_0x3eec('0x25')](function(_0x26839d){if(_0x26839d){return _0x26839d[_0x3eec('0xb5')](_0x45efbd['body'][_0x3eec('0xb6')],_['omit'](_0x45efbd[_0x3eec('0x70')],['ids','id'])||{});}})[_0x3eec('0x25')](respondWithResult(_0x2bc3a2,null))[_0x3eec('0xb0')](handleError(_0x2bc3a2,null));};exports[_0x3eec('0xb7')]=function(_0x555feb,_0x4562bc,_0x281855){var _0x21790b={'raw':![],'where':{}};var _0x447d2d={};var _0x1929cb={'count':0x0,'rows':[]};return db['WhatsappInteraction'][_0x3eec('0xb8')]({'where':{'id':_0x555feb[_0x3eec('0xb1')]['id']}})[_0x3eec('0x25')](handleEntityNotFound(_0x4562bc,null))[_0x3eec('0x25')](function(_0x3b30a0){if(_0x3b30a0){_0x447d2d[_0x3eec('0x3a')]=_[_0x3eec('0x38')](db['WhatsappMessage'][_0x3eec('0xb9')]);_0x447d2d[_0x3eec('0x3b')]=_[_0x3eec('0x38')](_0x555feb[_0x3eec('0x3b')]);_0x447d2d[_0x3eec('0x43')]=_[_0x3eec('0x39')](_0x447d2d[_0x3eec('0x3a')],_0x447d2d[_0x3eec('0x3b')]);_0x21790b['attributes']=_[_0x3eec('0x39')](_0x447d2d[_0x3eec('0x3a')],qs[_0x3eec('0x3d')](_0x555feb[_0x3eec('0x3b')]['fields']));_0x21790b[_0x3eec('0x3c')]=_0x21790b[_0x3eec('0x3c')][_0x3eec('0x5a')]?_0x21790b[_0x3eec('0x3c')]:_0x447d2d[_0x3eec('0x3a')];if(!_0x555feb[_0x3eec('0x3b')][_0x3eec('0x3e')](_0x3eec('0x3f'))){_0x21790b[_0x3eec('0x40')]=qs[_0x3eec('0x40')](_0x555feb[_0x3eec('0x3b')]['limit']);_0x21790b[_0x3eec('0x1c')]=qs[_0x3eec('0x1c')](_0x555feb[_0x3eec('0x3b')][_0x3eec('0x1c')]);}_0x21790b[_0x3eec('0x89')]=qs['sort'](_0x555feb['query'][_0x3eec('0x41')]);_0x21790b[_0x3eec('0x42')]=qs['filters'](_[_0x3eec('0x44')](_0x555feb[_0x3eec('0x3b')],_0x447d2d[_0x3eec('0x43')]));_0x21790b[_0x3eec('0x42')][_0x3eec('0xad')]=_0x3b30a0['id'];if(_0x555feb['query']['filter']){_0x21790b['where']=_[_0x3eec('0x97')](_0x21790b[_0x3eec('0x42')],{'$or':_[_0x3eec('0x2d')](_0x21790b[_0x3eec('0x3c')],function(_0x4a9957){var _0x20307e={};_0x20307e[_0x4a9957]={'$like':'%'+_0x555feb[_0x3eec('0x3b')]['filter']+'%'};return _0x20307e;})});}if(_0x555feb['query'][_0x3eec('0x75')]){var _0x3c4840=_0x555feb[_0x3eec('0x3b')][_0x3eec('0x75')][_0x3eec('0x31')](',');var _0x11a781={};_0x11a781[_0x3c4840[0x0]]={'$gte':moment(_0x3c4840[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x21790b[_0x3eec('0x42')]=_['merge'](_0x21790b[_0x3eec('0x42')],_0x11a781);}_0x21790b=_[_0x3eec('0x97')]({},_0x21790b,_0x555feb['options']);return db[_0x3eec('0xba')][_0x3eec('0x1e')]({'where':_0x21790b[_0x3eec('0x42')]})[_0x3eec('0x25')](function(_0x439576){_0x1929cb[_0x3eec('0x1e')]=_0x439576;if(_0x555feb['query'][_0x3eec('0xb2')]){_0x21790b[_0x3eec('0xbb')]=[{'all':!![]}];}return db[_0x3eec('0xba')][_0x3eec('0xbc')](_0x21790b);})[_0x3eec('0x25')](function(_0xadb427){_0x1929cb[_0x3eec('0xaf')]=_0xadb427;return _0x1929cb;});}})[_0x3eec('0x25')](respondWithFilteredResult(_0x4562bc,_0x21790b))['catch'](handleError(_0x4562bc,null));};exports[_0x3eec('0xbd')]=function(_0x3a9c8d,_0x134e61,_0x3ff9da){return db[_0x3eec('0x98')][_0x3eec('0x5c')]({'where':{'id':_0x3a9c8d[_0x3eec('0xb1')]['id']}})[_0x3eec('0x25')](handleEntityNotFound(_0x134e61,null))[_0x3eec('0x25')](function(_0x491047){if(_0x491047){return _0x491047[_0x3eec('0xbe')](_0x3a9c8d[_0x3eec('0x70')][_0x3eec('0xb6')],_[_0x3eec('0xbf')](_0x3a9c8d[_0x3eec('0x70')],[_0x3eec('0xb6'),'id'])||{})[_0x3eec('0xc0')](function(){return db['Tag'][_0x3eec('0xbc')]({'attributes':['id',_0x3eec('0x2a'),_0x3eec('0xc1')],'where':{'id':_0x3a9c8d[_0x3eec('0x70')][_0x3eec('0xb6')]}});})[_0x3eec('0x25')](function(_0x3d62b3){socket['emit'](_0x3eec('0xc2'),{'id':Number(_0x3a9c8d[_0x3eec('0xb1')]['id']),'tags':_0x3d62b3||[]});return{'id':Number(_0x3a9c8d[_0x3eec('0xb1')]['id']),'tags':_0x3d62b3||[]};});}})[_0x3eec('0x25')](respondWithResult(_0x134e61,null))[_0x3eec('0xb0')](handleError(_0x134e61,null));};exports[_0x3eec('0xc3')]=function(_0x34b78a,_0x283c16,_0x486a95){return db[_0x3eec('0x98')][_0x3eec('0x5c')]({'where':{'id':_0x34b78a[_0x3eec('0xb1')]['id']}})[_0x3eec('0x25')](handleEntityNotFound(_0x283c16,null))['then'](function(_0x93fc44){if(_0x93fc44){return _0x93fc44[_0x3eec('0xc3')](_0x34b78a[_0x3eec('0x3b')][_0x3eec('0xb6')]);}})[_0x3eec('0x25')](respondWithStatusCode(_0x283c16,null))['catch'](handleError(_0x283c16,null));};exports['download']=function(_0xc9cd5b,_0xda1fd2){var _0x50bd46=moment()[_0x3eec('0xc4')]()[_0x3eec('0x95')]();var _0x4413c5=path[_0x3eec('0xc5')](config['root'],_0x3eec('0xc6'),'files',_0x3eec('0xc7'));var _0x196280=path[_0x3eec('0xc5')](config['root'],_0x3eec('0xc6'),_0x3eec('0xc8'),_0x3eec('0xc9'));var _0x3ad32f=path[_0x3eec('0xc5')](_0x4413c5,_0x50bd46);var _0x4c2374=util[_0x3eec('0xca')]('transcript-%d-%s.zip',_0xc9cd5b['params']['id'],_0x50bd46);var _0x15feb8=path['join'](_0x4413c5,_0x4c2374);var _0x5f00f3=[];_0x5f00f3[_0x3eec('0x33')]({'model':db[_0x3eec('0x6d')],'as':_0x3eec('0x6d'),'attributes':['id',_0x3eec('0x2e')],'raw':!![]});_0x5f00f3[_0x3eec('0x33')]({'model':db['CmContact'],'as':'Contact','attributes':['id',_0x3eec('0xcb'),_0x3eec('0xcc')],'raw':!![]});if(_0xc9cd5b['query'][_0x3eec('0xc9')]){_0x5f00f3[_0x3eec('0x33')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x30670a=[{'model':db[_0x3eec('0xba')],'as':_0x3eec('0xcd'),'attributes':['id',_0x3eec('0x70'),_0x3eec('0xce'),_0x3eec('0xcf'),_0x3eec('0xd0'),'read'],'include':_0x5f00f3}];_0x30670a['push']({'model':db['WhatsappAccount'],'as':_0x3eec('0xd1'),'attributes':['id',_0x3eec('0x2a')]});_0x30670a[_0x3eec('0x33')]({'model':db[_0x3eec('0x6d')],'as':_0x3eec('0xd2'),'attributes':['id',_0x3eec('0x2e')]});return db[_0x3eec('0x98')][_0x3eec('0x5c')]({'where':{'id':_0xc9cd5b[_0x3eec('0xb1')]['id']},'include':_0x30670a})[_0x3eec('0x25')](handleEntityNotFound(_0xda1fd2,null))[_0x3eec('0x25')](function(_0x34eeec){if(_0x34eeec){var _0x884fe4=_0x34eeec[_0x3eec('0xd3')]({'plain':!![]});fs[_0x3eec('0xd4')](_0x3ad32f);var _0x4af298={'channel':_0x3eec('0xd5'),'account':_0x884fe4[_0x3eec('0xd1')][_0x3eec('0x2a')],'agent':_0x884fe4[_0x3eec('0xd2')]?_0x884fe4[_0x3eec('0xd2')][_0x3eec('0x2e')]:_0x3eec('0xd6'),'createdAt':moment(_0x884fe4[_0x3eec('0xce')])['format'](_0x3eec('0xd7'))[_0x3eec('0x95')](),'closedAt':_0x884fe4[_0x3eec('0xd8')]?moment(_0x884fe4[_0x3eec('0xd9')])[_0x3eec('0xca')](_0x3eec('0xd7'))['toString']():'','disposition':_0x884fe4[_0x3eec('0xda')],'messages':_(_0x884fe4['Messages'])['filter']({'secret':![]})[_0x3eec('0x2d')](function(_0x4ac639){if(_0x4ac639[_0x3eec('0xdb')]){var _0x48671d=path[_0x3eec('0xc5')](_0x196280,_0x4ac639['Attachment'][_0x3eec('0xdc')]);if(fs[_0x3eec('0xdd')](_0x48671d)){fs[_0x3eec('0xde')](_0x48671d)[_0x3eec('0xdf')](fs['createWriteStream'](path[_0x3eec('0xc5')](_0x3ad32f,_0x4ac639[_0x3eec('0xdb')][_0x3eec('0xdc')])));}}return{'date':moment(_0x4ac639[_0x3eec('0xce')])['format'](_0x3eec('0xd7'))[_0x3eec('0x95')](),'sender':_0x4ac639['direction']==='out'?_0x4ac639[_0x3eec('0x6d')]?_0x4ac639['User'][_0x3eec('0x2e')]:'System':_0x4ac639[_0x3eec('0xe0')][_0x3eec('0xcb')]+(_0x4ac639['Contact'][_0x3eec('0xcc')]?'\x20'+_0x4ac639[_0x3eec('0xe0')]['lastName']:''),'body':_0x4ac639['Attachment']?_0x4ac639[_0x3eec('0xdb')][_0x3eec('0xdc')]:_0x4ac639[_0x3eec('0x70')],'direction':_0x4ac639[_0x3eec('0xcf')]==='out'?'A':'C','secret':_0x4ac639[_0x3eec('0xd0')],'read':_0x4ac639[_0x3eec('0x79')],'attachment':_0x4ac639[_0x3eec('0xdb')]};})['value']()};return ejs[_0x3eec('0xe1')](path['join'](config['root'],_0x3eec('0xc6'),_0x3eec('0xe2'),_0x3eec('0xe3')),{'interaction':_0x4af298})['then'](function(_0x3ed537){var _0x2071bb=path['join'](_0x3ad32f,'transcript-'+_0x884fe4['id']+'-'+_0x50bd46+_0x3eec('0xe4'));var _0x5ef789={'path':_0x2071bb,'channel':_0x3eec('0xd5'),'interactionId':_0x884fe4['id']};return pdf[_0x3eec('0xe5')](_0x3ed537,_0x5ef789);})['then'](function(){return new BPromise(function(_0x43d08a,_0x3363d1){zipdir(_0x3ad32f,{'saveTo':_0x15feb8},function(_0x5ad385,_0x1a5b4b){if(_0x5ad385)return _0x3363d1(_0x5ad385);return _0x43d08a(_0x1a5b4b);});})[_0x3eec('0x25')](function(){return new BPromise(function(_0x1e1c42,_0x480275){rimraf(_0x3ad32f,function(_0x533d3a){if(_0x533d3a)_0x480275(_0x533d3a);return _0x1e1c42();});});})['then'](function(){return _0xda1fd2[_0x3eec('0xe6')](_0x15feb8,_0x4c2374,function(_0x3ef066){if(_0x3ef066){console['log']('err',_0x3ef066);}else{fs['unlinkSync'](_0x15feb8);}});});});}else{return _0xda1fd2[_0x3eec('0x27')](0xc8);}})[_0x3eec('0xb0')](handleError(_0xda1fd2,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index e53abe1..1e45e96 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 _0x5a8c=['getUsers','then','setDataValue','Users','map','findAll','length','emit','hook','exports','events','../../mysqldb','WhatsappMessage','setMaxListeners','save','remove'];(function(_0x46880f,_0x5dca8d){var _0x48eec7=function(_0x40c903){while(--_0x40c903){_0x46880f['push'](_0x46880f['shift']());}};_0x48eec7(++_0x5dca8d);}(_0x5a8c,0x1da));var _0xc5a8=function(_0x3af68e,_0x384315){_0x3af68e=_0x3af68e-0x0;var _0x3e6d5b=_0x5a8c[_0x3af68e];return _0x3e6d5b;};'use strict';var EventEmitter=require(_0xc5a8('0x0'));var WhatsappInteraction=require(_0xc5a8('0x1'))['db']['WhatsappInteraction'];var WhatsappMessage=require(_0xc5a8('0x1'))['db'][_0xc5a8('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xc5a8('0x3')](0x0);var events={'afterCreate':_0xc5a8('0x4'),'afterUpdate':'update','afterDestroy':_0xc5a8('0x5')};function emitEvent(_0x4310e4){return function(_0x5855dc,_0x16474d,_0x3c8f1e){_0x5855dc[_0xc5a8('0x6')]({'attributes':['id'],'raw':!![]})[_0xc5a8('0x7')](function(_0x1be8e7){_0x5855dc[_0xc5a8('0x8')](_0xc5a8('0x9'),_0x1be8e7[_0xc5a8('0xa')](function(_0x36e265){return{'id':_0x36e265['id']};}));return WhatsappMessage[_0xc5a8('0xb')]({'where':{'WhatsappInteractionId':_0x5855dc['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc5a8('0x7')](function(_0x4e0029){_0x5855dc[_0xc5a8('0x8')]('unreadMessages',_0x4e0029[_0xc5a8('0xc')]);WhatsappInteractionEvents[_0xc5a8('0xd')](_0x4310e4+':'+_0x5855dc['id'],_0x5855dc);WhatsappInteractionEvents[_0xc5a8('0xd')](_0x4310e4,_0x5855dc);_0x3c8f1e(null);})['catch'](_0x3c8f1e(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction[_0xc5a8('0xe')](e,emitEvent(event));}}module[_0xc5a8('0xf')]=WhatsappInteractionEvents; \ No newline at end of file +var _0x12c9=['then','setDataValue','map','length','emit','catch','hasOwnProperty','hook','exports','events','WhatsappInteraction','WhatsappMessage','save','update','remove'];(function(_0x2f4d94,_0x1255ba){var _0x4ce2b5=function(_0x1c5bdc){while(--_0x1c5bdc){_0x2f4d94['push'](_0x2f4d94['shift']());}};_0x4ce2b5(++_0x1255ba);}(_0x12c9,0x9f));var _0x912c=function(_0x15ce35,_0x1e521c){_0x15ce35=_0x15ce35-0x0;var _0x281e99=_0x12c9[_0x15ce35];return _0x281e99;};'use strict';var EventEmitter=require(_0x912c('0x0'));var WhatsappInteraction=require('../../mysqldb')['db'][_0x912c('0x1')];var WhatsappMessage=require('../../mysqldb')['db'][_0x912c('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x912c('0x3'),'afterUpdate':_0x912c('0x4'),'afterDestroy':_0x912c('0x5')};function emitEvent(_0x2a35f5){return function(_0x2afc58,_0x10e658,_0x572179){_0x2afc58['getUsers']({'attributes':['id'],'raw':!![]})[_0x912c('0x6')](function(_0xf08f88){_0x2afc58[_0x912c('0x7')]('Users',_0xf08f88[_0x912c('0x8')](function(_0x5a6c03){return{'id':_0x5a6c03['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x2afc58['id'],'direction':'in','read':![]},'raw':!![]});})[_0x912c('0x6')](function(_0x484f33){_0x2afc58['setDataValue']('unreadMessages',_0x484f33[_0x912c('0x9')]);WhatsappInteractionEvents['emit'](_0x2a35f5+':'+_0x2afc58['id'],_0x2afc58);WhatsappInteractionEvents[_0x912c('0xa')](_0x2a35f5,_0x2afc58);_0x572179(null);})[_0x912c('0xb')](_0x572179(null));};}for(var e in events){if(events[_0x912c('0xc')](e)){var event=events[e];WhatsappInteraction[_0x912c('0xd')](e,emitEvent(event));}}module[_0x912c('0xe')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index abf3cc1..3b3b1fb 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 _0xc0ac=['api','moment','bluebird','rimraf','./whatsappInteraction.attributes','define','WhatsappInteraction','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger'];(function(_0x209e93,_0x345fa3){var _0x3da805=function(_0x380291){while(--_0x380291){_0x209e93['push'](_0x209e93['shift']());}};_0x3da805(++_0x345fa3);}(_0xc0ac,0x65));var _0xcc0a=function(_0x5d8171,_0xb8d202){_0x5d8171=_0x5d8171-0x0;var _0x3d8b9a=_0xc0ac[_0x5d8171];return _0x3d8b9a;};'use strict';var _=require(_0xcc0a('0x0'));var util=require(_0xcc0a('0x1'));var logger=require(_0xcc0a('0x2'))(_0xcc0a('0x3'));var moment=require(_0xcc0a('0x4'));var BPromise=require(_0xcc0a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xcc0a('0x6'));var config=require('../../config/environment');var attributes=require(_0xcc0a('0x7'));module['exports']=function(_0x237b66,_0x2859d1){return _0x237b66[_0xcc0a('0x8')](_0xcc0a('0x9'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xbc7653,_0x5195c2,_0x520486){if(_0xbc7653['changed'](_0xcc0a('0xa'))){_0xbc7653['closedAt']=moment()[_0xcc0a('0xb')](_0xcc0a('0xc'));}_0x520486(null,_0xbc7653);}}});}; \ No newline at end of file +var _0x9629=['../../config/environment','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x589dcf,_0x4b9c21){var _0x3abf77=function(_0x441110){while(--_0x441110){_0x589dcf['push'](_0x589dcf['shift']());}};_0x3abf77(++_0x4b9c21);}(_0x9629,0xf9));var _0x9962=function(_0x8ee579,_0x5053f9){_0x8ee579=_0x8ee579-0x0;var _0x19a7be=_0x9629[_0x8ee579];return _0x19a7be;};'use strict';var _=require(_0x9962('0x0'));var util=require(_0x9962('0x1'));var logger=require(_0x9962('0x2'))(_0x9962('0x3'));var moment=require('moment');var BPromise=require(_0x9962('0x4'));var rp=require(_0x9962('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9962('0x6'));var config=require(_0x9962('0x7'));var attributes=require(_0x9962('0x8'));module[_0x9962('0x9')]=function(_0x447f77,_0x433d24){return _0x447f77[_0x9962('0xa')](_0x9962('0xb'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x11cb01,_0x56cc10,_0x43d56d){if(_0x11cb01[_0x9962('0xc')](_0x9962('0xd'))){_0x11cb01['closedAt']=moment()[_0x9962('0xe')](_0x9962('0xf'));}_0x43d56d(null,_0x11cb01);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 799ed01..8554270 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 _0xeb44=['where','attributes','limit','AddTagsToWhatsappInteraction','find','ids','omit','AddTags','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','request','then','info','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappInteraction,\x20%s,\x20%s','message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options'];(function(_0x2b92d8,_0x1cec6f){var _0x3a0f3c=function(_0x1ec466){while(--_0x1ec466){_0x2b92d8['push'](_0x2b92d8['shift']());}};_0x3a0f3c(++_0x1cec6f);}(_0xeb44,0x138));var _0x4eb4=function(_0x3f50a9,_0x5e0587){_0x3f50a9=_0x3f50a9-0x0;var _0x2ae3a8=_0xeb44[_0x3f50a9];return _0x2ae3a8;};'use strict';var _=require(_0x4eb4('0x0'));var util=require('util');var moment=require(_0x4eb4('0x1'));var BPromise=require(_0x4eb4('0x2'));var rs=require(_0x4eb4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4eb4('0x4'))['db'];var utils=require(_0x4eb4('0x5'));var logger=require(_0x4eb4('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x4eb4('0x7')]=_[_0x4eb4('0x8')](config[_0x4eb4('0x7')],{'host':_0x4eb4('0x9'),'port':0x18eb});var socket=require(_0x4eb4('0xa'))(new Redis(config['redis']));require(_0x4eb4('0xb'))['register'](socket);function respondWithRpcPromise(_0x169429,_0x5e4efb,_0x225e51){return new BPromise(function(_0x44eb6c,_0x2a6fde){return client[_0x4eb4('0xc')](_0x169429,_0x225e51)[_0x4eb4('0xd')](function(_0x49f72b){logger[_0x4eb4('0xe')]('WhatsappInteraction,\x20%s,\x20%s',_0x5e4efb,_0x4eb4('0xf'));logger[_0x4eb4('0x10')](_0x4eb4('0x11'),_0x5e4efb,_0x4eb4('0xf'),JSON[_0x4eb4('0x12')](_0x49f72b));if(_0x49f72b['error']){if(_0x49f72b[_0x4eb4('0x13')][_0x4eb4('0x14')]===0x1f4){logger[_0x4eb4('0x13')](_0x4eb4('0x15'),_0x5e4efb,_0x49f72b[_0x4eb4('0x13')]['message']);return _0x2a6fde(_0x49f72b[_0x4eb4('0x13')]['message']);}logger[_0x4eb4('0x13')](_0x4eb4('0x15'),_0x5e4efb,_0x49f72b[_0x4eb4('0x13')]['message']);return _0x44eb6c(_0x49f72b[_0x4eb4('0x13')][_0x4eb4('0x16')]);}else{logger['info'](_0x4eb4('0x15'),_0x5e4efb,'request\x20sent');_0x44eb6c(_0x49f72b[_0x4eb4('0x17')][_0x4eb4('0x16')]);}})[_0x4eb4('0x18')](function(_0x5bd73f){logger[_0x4eb4('0x13')](_0x4eb4('0x15'),_0x5e4efb,_0x5bd73f);_0x2a6fde(_0x5bd73f);});});}exports[_0x4eb4('0x19')]=function(_0x25bcf9){var _0x623478=this;return new Promise(function(_0x52df84,_0x53d7d1){return db[_0x4eb4('0x1a')][_0x4eb4('0x1b')](_0x25bcf9[_0x4eb4('0x1c')],{'raw':_0x25bcf9[_0x4eb4('0x1d')]?_0x25bcf9[_0x4eb4('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x25bcf9[_0x4eb4('0x1d')]?_0x25bcf9[_0x4eb4('0x1d')][_0x4eb4('0x1e')]||null:null,'attributes':_0x25bcf9['options']?_0x25bcf9[_0x4eb4('0x1d')][_0x4eb4('0x1f')]||null:null,'limit':_0x25bcf9[_0x4eb4('0x1d')]?_0x25bcf9['options'][_0x4eb4('0x20')]||null:null})[_0x4eb4('0xd')](function(_0x58e09a){logger[_0x4eb4('0xe')](_0x4eb4('0x19'),_0x25bcf9);logger[_0x4eb4('0x10')]('UpdateWhatsappInteraction',_0x25bcf9,JSON[_0x4eb4('0x12')](_0x58e09a));_0x52df84(_0x58e09a);})[_0x4eb4('0x18')](function(_0x2fb9c6){logger[_0x4eb4('0x13')](_0x4eb4('0x19'),_0x2fb9c6['message'],_0x25bcf9);_0x53d7d1(_0x623478[_0x4eb4('0x13')](0x1f4,_0x2fb9c6['message']));});});};exports[_0x4eb4('0x21')]=function(_0x3b58ff){return new Promise(function(_0x4c633d,_0x34dc12){return db[_0x4eb4('0x1a')][_0x4eb4('0x22')]({'where':_0x3b58ff[_0x4eb4('0x1d')]?_0x3b58ff['options'][_0x4eb4('0x1e')]||null:null})[_0x4eb4('0xd')](function(_0x3d7add){if(_0x3d7add){return _0x3d7add['addTags'](_0x3b58ff[_0x4eb4('0x1c')][_0x4eb4('0x23')],_[_0x4eb4('0x24')](_0x3b58ff[_0x4eb4('0x1c')],[_0x4eb4('0x23'),'id'])||{});}})['spread'](function(_0x3c9549){logger[_0x4eb4('0xe')](_0x4eb4('0x25'),_0x3b58ff);logger[_0x4eb4('0x10')](_0x4eb4('0x25'),_0x3b58ff,JSON[_0x4eb4('0x12')](_0x3c9549));_0x4c633d(_0x3c9549);})[_0x4eb4('0x18')](function(_0x4a6907){logger[_0x4eb4('0x13')](_0x4eb4('0x25'),_0x4a6907['message'],_0x3b58ff);_0x34dc12(_this[_0x4eb4('0x13')](0x1f4,_0x4a6907[_0x4eb4('0x16')]));});});}; \ No newline at end of file +var _0x941e=['../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','register','request','then','debug','request\x20sent','stringify','error','code','WhatsappInteraction,\x20%s,\x20%s','message','info','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','attributes','limit','where','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','../../mysqldb','../../config/utils'];(function(_0x5585dc,_0x22067){var _0x471a44=function(_0x2924f8){while(--_0x2924f8){_0x5585dc['push'](_0x5585dc['shift']());}};_0x471a44(++_0x22067);}(_0x941e,0x19c));var _0xe941=function(_0x5e9a60,_0x4e5e28){_0x5e9a60=_0x5e9a60-0x0;var _0x4e1fbc=_0x941e[_0x5e9a60];return _0x4e1fbc;};'use strict';var _=require(_0xe941('0x0'));var util=require(_0xe941('0x1'));var moment=require(_0xe941('0x2'));var BPromise=require(_0xe941('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe941('0x4'))['db'];var utils=require(_0xe941('0x5'));var logger=require(_0xe941('0x6'))(_0xe941('0x7'));var config=require(_0xe941('0x8'));var jayson=require(_0xe941('0x9'));var client=jayson['client'][_0xe941('0xa')]({'port':0x232a});config[_0xe941('0xb')]=_['defaults'](config[_0xe941('0xb')],{'host':_0xe941('0xc'),'port':0x18eb});var socket=require(_0xe941('0xd'))(new Redis(config[_0xe941('0xb')]));require('./whatsappInteraction.socket')[_0xe941('0xe')](socket);function respondWithRpcPromise(_0x5d17c5,_0x2e7b19,_0x11bb5b){return new BPromise(function(_0x51b0cb,_0x46f69b){return client[_0xe941('0xf')](_0x5d17c5,_0x11bb5b)[_0xe941('0x10')](function(_0x84e499){logger['info']('WhatsappInteraction,\x20%s,\x20%s',_0x2e7b19,'request\x20sent');logger[_0xe941('0x11')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x2e7b19,_0xe941('0x12'),JSON[_0xe941('0x13')](_0x84e499));if(_0x84e499[_0xe941('0x14')]){if(_0x84e499[_0xe941('0x14')][_0xe941('0x15')]===0x1f4){logger[_0xe941('0x14')](_0xe941('0x16'),_0x2e7b19,_0x84e499[_0xe941('0x14')][_0xe941('0x17')]);return _0x46f69b(_0x84e499[_0xe941('0x14')]['message']);}logger[_0xe941('0x14')]('WhatsappInteraction,\x20%s,\x20%s',_0x2e7b19,_0x84e499[_0xe941('0x14')][_0xe941('0x17')]);return _0x51b0cb(_0x84e499['error']['message']);}else{logger[_0xe941('0x18')]('WhatsappInteraction,\x20%s,\x20%s',_0x2e7b19,_0xe941('0x12'));_0x51b0cb(_0x84e499['result'][_0xe941('0x17')]);}})[_0xe941('0x19')](function(_0x36c72d){logger[_0xe941('0x14')]('WhatsappInteraction,\x20%s,\x20%s',_0x2e7b19,_0x36c72d);_0x46f69b(_0x36c72d);});});}exports[_0xe941('0x1a')]=function(_0x26852b){var _0x1d82b7=this;return new Promise(function(_0x27a30b,_0x2c0d20){return db[_0xe941('0x1b')][_0xe941('0x1c')](_0x26852b[_0xe941('0x1d')],{'raw':_0x26852b[_0xe941('0x1e')]?_0x26852b[_0xe941('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x26852b[_0xe941('0x1e')]?_0x26852b[_0xe941('0x1e')]['where']||null:null,'attributes':_0x26852b[_0xe941('0x1e')]?_0x26852b[_0xe941('0x1e')][_0xe941('0x1f')]||null:null,'limit':_0x26852b[_0xe941('0x1e')]?_0x26852b[_0xe941('0x1e')][_0xe941('0x20')]||null:null})['then'](function(_0x147d52){logger[_0xe941('0x18')]('UpdateWhatsappInteraction',_0x26852b);logger[_0xe941('0x11')](_0xe941('0x1a'),_0x26852b,JSON[_0xe941('0x13')](_0x147d52));_0x27a30b(_0x147d52);})[_0xe941('0x19')](function(_0x22f3d7){logger['error'](_0xe941('0x1a'),_0x22f3d7[_0xe941('0x17')],_0x26852b);_0x2c0d20(_0x1d82b7['error'](0x1f4,_0x22f3d7[_0xe941('0x17')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0x3a1448){return new Promise(function(_0x2d38f8,_0x4a5cc9){return db['WhatsappInteraction']['find']({'where':_0x3a1448[_0xe941('0x1e')]?_0x3a1448[_0xe941('0x1e')][_0xe941('0x21')]||null:null})['then'](function(_0x4dda64){if(_0x4dda64){return _0x4dda64[_0xe941('0x22')](_0x3a1448[_0xe941('0x1d')]['ids'],_['omit'](_0x3a1448[_0xe941('0x1d')],[_0xe941('0x23'),'id'])||{});}})[_0xe941('0x24')](function(_0x529c6b){logger['info'](_0xe941('0x25'),_0x3a1448);logger['debug']('AddTags',_0x3a1448,JSON['stringify'](_0x529c6b));_0x2d38f8(_0x529c6b);})[_0xe941('0x19')](function(_0x4f50eb){logger['error']('AddTags',_0x4f50eb['message'],_0x3a1448);_0x4a5cc9(_this['error'](0x1f4,_0x4f50eb['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 1bf7846..0f970c5 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 _0x037b=['whatsappInteraction:','./whatsappInteraction.events','save','removeListener','length'];(function(_0x2c91d3,_0x3bba19){var _0x4fd43e=function(_0x1f0224){while(--_0x1f0224){_0x2c91d3['push'](_0x2c91d3['shift']());}};_0x4fd43e(++_0x3bba19);}(_0x037b,0x1d2));var _0xb037=function(_0x256892,_0x23f3ce){_0x256892=_0x256892-0x0;var _0x3fb713=_0x037b[_0x256892];return _0x3fb713;};'use strict';var WhatsappInteractionEvents=require(_0xb037('0x0'));var events=[_0xb037('0x1'),'remove','update'];function createListener(_0x4bd38e,_0x1369a5){return function(_0x1fa06d){_0x1369a5['emit'](_0x4bd38e,_0x1fa06d);};}function removeListener(_0x4ff938,_0x2d7e7a){return function(){WhatsappInteractionEvents[_0xb037('0x2')](_0x4ff938,_0x2d7e7a);};}exports['register']=function(_0x263355){for(var _0xdc7627=0x0,_0x3fcfee=events[_0xb037('0x3')];_0xdc7627<_0x3fcfee;_0xdc7627++){var _0x4e17fc=events[_0xdc7627];var _0x1bfa35=createListener(_0xb037('0x4')+_0x4e17fc,_0x263355);WhatsappInteractionEvents['on'](_0x4e17fc,_0x1bfa35);}}; \ No newline at end of file +var _0xec56=['removeListener','register','length','whatsappInteraction:','./whatsappInteraction.events','save','remove','update','emit'];(function(_0x36ecd4,_0x3675c4){var _0x433a6b=function(_0x3fd352){while(--_0x3fd352){_0x36ecd4['push'](_0x36ecd4['shift']());}};_0x433a6b(++_0x3675c4);}(_0xec56,0x1e1));var _0x6ec5=function(_0x5202e3,_0x4d7225){_0x5202e3=_0x5202e3-0x0;var _0x49e5f0=_0xec56[_0x5202e3];return _0x49e5f0;};'use strict';var WhatsappInteractionEvents=require(_0x6ec5('0x0'));var events=[_0x6ec5('0x1'),_0x6ec5('0x2'),_0x6ec5('0x3')];function createListener(_0x1fbc2e,_0x34fe73){return function(_0x1789e1){_0x34fe73[_0x6ec5('0x4')](_0x1fbc2e,_0x1789e1);};}function removeListener(_0xa81e2f,_0x544b8e){return function(){WhatsappInteractionEvents[_0x6ec5('0x5')](_0xa81e2f,_0x544b8e);};}exports[_0x6ec5('0x6')]=function(_0x3d7e22){for(var _0x48944a=0x0,_0x21da38=events[_0x6ec5('0x7')];_0x48944a<_0x21da38;_0x48944a++){var _0x246ce4=events[_0x48944a];var _0x2a5cf8=createListener(_0x6ec5('0x8')+_0x246ce4,_0x3d7e22);WhatsappInteractionEvents['on'](_0x246ce4,_0x2a5cf8);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index a650fde..964d58a 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 _0x47f2=['update','accept','/:id/reject','reject','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappMessage.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','tracked','whatsapp','create','/:id/status','status','put'];(function(_0x3794a0,_0x1a9cfc){var _0x5bdaba=function(_0x14a764){while(--_0x14a764){_0x3794a0['push'](_0x3794a0['shift']());}};_0x5bdaba(++_0x1a9cfc);}(_0x47f2,0x199));var _0x247f=function(_0x5c6eeb,_0x368787){_0x5c6eeb=_0x5c6eeb-0x0;var _0x33b59e=_0x47f2[_0x5c6eeb];return _0x33b59e;};'use strict';var multer=require(_0x247f('0x0'));var util=require('util');var path=require(_0x247f('0x1'));var timeout=require(_0x247f('0x2'));var express=require(_0x247f('0x3'));var router=express[_0x247f('0x4')]();var fs_extra=require(_0x247f('0x5'));var auth=require(_0x247f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x247f('0x7'));var controller=require(_0x247f('0x8'));router[_0x247f('0x9')]('/',auth['isAuthenticated'](),controller[_0x247f('0xa')]);router[_0x247f('0x9')](_0x247f('0xb'),auth[_0x247f('0xc')](),controller[_0x247f('0xd')]);router[_0x247f('0x9')](_0x247f('0xe'),auth[_0x247f('0xc')](),controller[_0x247f('0xf')]);router[_0x247f('0x10')]('/',auth[_0x247f('0xc')](),interaction[_0x247f('0x11')](_0x247f('0x12'),'whatsappmessage:create'),controller[_0x247f('0x13')]);router['post'](_0x247f('0x14'),controller[_0x247f('0x15')]);router[_0x247f('0x16')](_0x247f('0xe'),auth[_0x247f('0xc')](),controller[_0x247f('0x17')]);router[_0x247f('0x16')]('/:id/accept',auth['isAuthenticated'](),controller[_0x247f('0x18')]);router['put'](_0x247f('0x19'),auth[_0x247f('0xc')](),controller[_0x247f('0x1a')]);router['delete'](_0x247f('0xe'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x406f=['get','index','/describe','isAuthenticated','describe','/:id','show','tracked','whatsapp','whatsappmessage:create','create','status','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappMessage.controller'];(function(_0x3b378f,_0x3af427){var _0x2213d0=function(_0x43c733){while(--_0x43c733){_0x3b378f['push'](_0x3b378f['shift']());}};_0x2213d0(++_0x3af427);}(_0x406f,0x6f));var _0xf406=function(_0x172747,_0x1732bd){_0x172747=_0x172747-0x0;var _0x509692=_0x406f[_0x172747];return _0x509692;};'use strict';var multer=require(_0xf406('0x0'));var util=require(_0xf406('0x1'));var path=require('path');var timeout=require(_0xf406('0x2'));var express=require(_0xf406('0x3'));var router=express[_0xf406('0x4')]();var fs_extra=require(_0xf406('0x5'));var auth=require(_0xf406('0x6'));var interaction=require(_0xf406('0x7'));var config=require('../../config/environment');var controller=require(_0xf406('0x8'));router[_0xf406('0x9')]('/',auth['isAuthenticated'](),controller[_0xf406('0xa')]);router[_0xf406('0x9')](_0xf406('0xb'),auth[_0xf406('0xc')](),controller[_0xf406('0xd')]);router['get'](_0xf406('0xe'),auth[_0xf406('0xc')](),controller[_0xf406('0xf')]);router['post']('/',auth[_0xf406('0xc')](),interaction[_0xf406('0x10')](_0xf406('0x11'),_0xf406('0x12')),controller[_0xf406('0x13')]);router['post']('/:id/status',controller[_0xf406('0x14')]);router[_0xf406('0x15')](_0xf406('0xe'),auth[_0xf406('0xc')](),controller[_0xf406('0x16')]);router[_0xf406('0x15')](_0xf406('0x17'),auth[_0xf406('0xc')](),controller[_0xf406('0x18')]);router['put'](_0xf406('0x19'),auth[_0xf406('0xc')](),controller[_0xf406('0x1a')]);router[_0xf406('0x1b')]('/:id',auth[_0xf406('0xc')](),controller[_0xf406('0x1c')]);module[_0xf406('0x1d')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index eaef919..059ba0e 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 _0x19d0=['DATE','sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x461676,_0x533a5b){var _0x420b09=function(_0x3fe367){while(--_0x3fe367){_0x461676['push'](_0x461676['shift']());}};_0x420b09(++_0x533a5b);}(_0x19d0,0xd9));var _0x019d=function(_0x2ff948,_0x1c8ee3){_0x2ff948=_0x2ff948-0x0;var _0x5b0d71=_0x19d0[_0x2ff948];return _0x5b0d71;};'use strict';var Sequelize=require(_0x019d('0x0'));module[_0x019d('0x1')]={'body':{'type':Sequelize[_0x019d('0x2')](_0x019d('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x019d('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x019d('0x5')]('in','out'),'defaultValue':_0x019d('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x019d('0x7')](0xbe)},'phone':{'type':Sequelize[_0x019d('0x7')]},'readAt':{'type':Sequelize[_0x019d('0x8')]},'secret':{'type':Sequelize[_0x019d('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x019d('0x7')]},'providerResponse':{'type':Sequelize[_0x019d('0x2')]}}; \ No newline at end of file +var _0x82a7=['ENUM','out','STRING','DATE','exports','TEXT','medium','BOOLEAN'];(function(_0x426323,_0x2ce530){var _0xa347f6=function(_0x267c9f){while(--_0x267c9f){_0x426323['push'](_0x426323['shift']());}};_0xa347f6(++_0x2ce530);}(_0x82a7,0x1c4));var _0x782a=function(_0x23c844,_0x43105f){_0x23c844=_0x23c844-0x0;var _0x50f318=_0x82a7[_0x23c844];return _0x50f318;};'use strict';var Sequelize=require('sequelize');module[_0x782a('0x0')]={'body':{'type':Sequelize[_0x782a('0x1')](_0x782a('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x782a('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x782a('0x4')]('in',_0x782a('0x5')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x782a('0x6')](0xbe)},'phone':{'type':Sequelize[_0x782a('0x6')]},'readAt':{'type':Sequelize[_0x782a('0x7')]},'secret':{'type':Sequelize[_0x782a('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x782a('0x6')]},'providerResponse':{'type':Sequelize[_0x782a('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index c8d06e8..c2fa65b 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 _0xee6d=['Sequelize','QueryTypes','SELECT','fullname','email','internal','channel','event','reject','WhatsappInteraction','RejectMessage','contact','User','interface','SIP/%s','rejectmessage','WhatsappAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','read','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','client','http','request','then','WhatsappMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','status','stack','name','index','map','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','WhatsappMessage','include','findAll','rows','params','keys','includeAll','create','body','find','describe','accept','whatsapp','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteractionId','read1stAt','format','role','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize'];(function(_0x25238d,_0x5494d6){var _0x4582e1=function(_0x177c81){while(--_0x177c81){_0x25238d['push'](_0x25238d['shift']());}};_0x4582e1(++_0x5494d6);}(_0xee6d,0xa1));var _0xdee6=function(_0x209fcd,_0x2638e7){_0x209fcd=_0x209fcd-0x0;var _0x48da20=_0xee6d[_0x209fcd];return _0x48da20;};'use strict';var emlformat=require(_0xdee6('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xdee6('0x1'));var rp=require(_0xdee6('0x2'));var moment=require('moment');var BPromise=require(_0xdee6('0x3'));var Mustache=require(_0xdee6('0x4'));var util=require(_0xdee6('0x5'));var path=require('path');var sox=require(_0xdee6('0x6'));var csv=require(_0xdee6('0x7'));var ejs=require(_0xdee6('0x8'));var fs=require('fs');var fs_extra=require(_0xdee6('0x9'));var _=require(_0xdee6('0xa'));var squel=require(_0xdee6('0xb'));var crypto=require(_0xdee6('0xc'));var jsforce=require(_0xdee6('0xd'));var deskjs=require(_0xdee6('0xe'));var toCsv=require(_0xdee6('0x7'));var querystring=require(_0xdee6('0xf'));var Papa=require(_0xdee6('0x10'));var Redis=require(_0xdee6('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xdee6('0x12'));var as=require(_0xdee6('0x13'));var hardwareService=require(_0xdee6('0x14'));var logger=require(_0xdee6('0x15'))(_0xdee6('0x16'));var utils=require(_0xdee6('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xdee6('0x18'));var db=require(_0xdee6('0x19'))['db'];config['redis']=_[_0xdee6('0x1a')](config[_0xdee6('0x1b')],{'host':_0xdee6('0x1c'),'port':0x18eb});var socket=require(_0xdee6('0x1d'))(new Redis(config['redis']));require(_0xdee6('0x1e'))[_0xdee6('0x1f')](socket);var jayson=require(_0xdee6('0x20'));var client=jayson[_0xdee6('0x21')][_0xdee6('0x22')]({'port':0x232c});var client9002=jayson[_0xdee6('0x21')][_0xdee6('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x11a4d0,_0x322856,_0x451144,_0x1aac99){return new BPromise(function(_0x32a0dd,_0x5b2032){var _0x2598ce=_0x1aac99||client;return _0x2598ce[_0xdee6('0x23')](_0x11a4d0,_0x451144)[_0xdee6('0x24')](function(_0x3cf58a){logger['info'](_0xdee6('0x25'),_0x322856,'request\x20sent');logger[_0xdee6('0x26')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x322856,_0xdee6('0x27'),JSON[_0xdee6('0x28')](_0x3cf58a));if(_0x3cf58a[_0xdee6('0x29')]){if(_0x3cf58a[_0xdee6('0x29')][_0xdee6('0x2a')]===0x1f4){logger[_0xdee6('0x29')](_0xdee6('0x25'),_0x322856,_0x3cf58a[_0xdee6('0x29')][_0xdee6('0x2b')]);return _0x5b2032(_0x3cf58a[_0xdee6('0x29')][_0xdee6('0x2b')]);}logger[_0xdee6('0x29')]('WhatsappMessage,\x20%s,\x20%s',_0x322856,_0x3cf58a[_0xdee6('0x29')]['message']);return _0x32a0dd(_0x3cf58a[_0xdee6('0x29')]['message']);}else{logger[_0xdee6('0x2c')](_0xdee6('0x25'),_0x322856,_0xdee6('0x27'));_0x32a0dd(_0x3cf58a[_0xdee6('0x2d')]['message']);}})[_0xdee6('0x2e')](function(_0x22c525){logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x322856,_0x22c525);_0x5b2032(_0x22c525);});});}function respondWithStatusCode(_0x288f7c,_0xa8d15a){_0xa8d15a=_0xa8d15a||0xcc;return function(_0x1278ae){if(_0x1278ae){return _0x288f7c[_0xdee6('0x2f')](_0xa8d15a);}return _0x288f7c['status'](_0xa8d15a)['end']();};}function respondWithResult(_0x118287,_0x396ed6){_0x396ed6=_0x396ed6||0xc8;return function(_0x3f9b0c){if(_0x3f9b0c){return _0x118287['status'](_0x396ed6)[_0xdee6('0x30')](_0x3f9b0c);}};}function respondWithFilteredResult(_0x1042d1,_0x55bfa7){return function(_0x1f955d){if(_0x1f955d){var _0x28f537=typeof _0x55bfa7[_0xdee6('0x31')]===_0xdee6('0x32')&&typeof _0x55bfa7[_0xdee6('0x33')]===_0xdee6('0x32');var _0x21083d=_0x1f955d[_0xdee6('0x34')];var _0x789c1e=_0x28f537?0x0:_0x55bfa7[_0xdee6('0x31')];var _0x3e17b6=_0x28f537?_0x1f955d['count']:_0x55bfa7[_0xdee6('0x31')]+_0x55bfa7[_0xdee6('0x33')];var _0x36121e;if(_0x3e17b6>=_0x21083d){_0x3e17b6=_0x21083d;_0x36121e=0xc8;}else{_0x36121e=0xce;}_0x1042d1['status'](_0x36121e);return _0x1042d1[_0xdee6('0x35')](_0xdee6('0x36'),_0x789c1e+'-'+_0x3e17b6+'/'+_0x21083d)['json'](_0x1f955d);}return null;};}function patchUpdates(_0x297780){return function(_0x3c41b8){try{jsonpatch[_0xdee6('0x37')](_0x3c41b8,_0x297780,!![]);}catch(_0x3d6b90){return BPromise['reject'](_0x3d6b90);}return _0x3c41b8[_0xdee6('0x38')]();};}function saveUpdates(_0x3369e0,_0x127304){return function(_0x458946){if(_0x458946){return _0x458946[_0xdee6('0x39')](_0x3369e0)[_0xdee6('0x24')](function(_0x2cfff2){return _0x2cfff2;});}return null;};}function removeEntity(_0x1a4be9,_0x65c9c7){return function(_0x28f4e1){if(_0x28f4e1){return _0x28f4e1[_0xdee6('0x3a')]()[_0xdee6('0x24')](function(){_0x1a4be9[_0xdee6('0x3b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40a6c6,_0x2d9dee){return function(_0x30b3c6){if(!_0x30b3c6){_0x40a6c6[_0xdee6('0x2f')](0x194);}return _0x30b3c6;};}function handleError(_0x52144d,_0x5a930b){_0x5a930b=_0x5a930b||0x1f4;return function(_0x5096d9){logger[_0xdee6('0x29')](_0x5096d9[_0xdee6('0x3c')]);if(_0x5096d9[_0xdee6('0x3d')]){delete _0x5096d9[_0xdee6('0x3d')];}_0x52144d[_0xdee6('0x3b')](_0x5a930b)['send'](_0x5096d9);};}exports[_0xdee6('0x3e')]=function(_0x21d46c,_0x1f3a18){var _0x3796c0={},_0x5de3f0={},_0x4f08e7={'count':0x0,'rows':[]};var _0x33cf72=_[_0xdee6('0x3f')](db['WhatsappMessage']['rawAttributes'],function(_0x17b1aa){return{'name':_0x17b1aa[_0xdee6('0x40')],'type':_0x17b1aa[_0xdee6('0x41')][_0xdee6('0x42')]};});_0x5de3f0[_0xdee6('0x43')]=_[_0xdee6('0x3f')](_0x33cf72,_0xdee6('0x3d'));_0x5de3f0[_0xdee6('0x44')]=_['keys'](_0x21d46c['query']);_0x5de3f0[_0xdee6('0x45')]=_[_0xdee6('0x46')](_0x5de3f0[_0xdee6('0x43')],_0x5de3f0[_0xdee6('0x44')]);_0x3796c0[_0xdee6('0x47')]=_[_0xdee6('0x46')](_0x5de3f0['model'],qs[_0xdee6('0x48')](_0x21d46c[_0xdee6('0x44')]['fields']));_0x3796c0[_0xdee6('0x47')]=_0x3796c0[_0xdee6('0x47')][_0xdee6('0x49')]?_0x3796c0[_0xdee6('0x47')]:_0x5de3f0[_0xdee6('0x43')];if(!_0x21d46c[_0xdee6('0x44')][_0xdee6('0x4a')](_0xdee6('0x4b'))){_0x3796c0[_0xdee6('0x33')]=qs['limit'](_0x21d46c[_0xdee6('0x44')][_0xdee6('0x33')]);_0x3796c0['offset']=qs['offset'](_0x21d46c[_0xdee6('0x44')][_0xdee6('0x31')]);}_0x3796c0[_0xdee6('0x4c')]=qs['sort'](_0x21d46c[_0xdee6('0x44')][_0xdee6('0x4d')]);_0x3796c0[_0xdee6('0x4e')]=qs['filters'](_['pick'](_0x21d46c[_0xdee6('0x44')],_0x5de3f0[_0xdee6('0x45')]),_0x33cf72);if(_0x21d46c['query']['filter']){_0x3796c0['where']=_[_0xdee6('0x4f')](_0x3796c0[_0xdee6('0x4e')],{'$or':_[_0xdee6('0x3f')](_0x33cf72,function(_0x6a9220){if(_0x6a9220['type']!==_0xdee6('0x50')){var _0x5701f9={};_0x5701f9[_0x6a9220[_0xdee6('0x3d')]]={'$like':'%'+_0x21d46c[_0xdee6('0x44')][_0xdee6('0x51')]+'%'};return _0x5701f9;}})});}_0x3796c0=_[_0xdee6('0x4f')]({},_0x3796c0,_0x21d46c[_0xdee6('0x52')]);var _0x48444b={'where':_0x3796c0[_0xdee6('0x4e')]};return db[_0xdee6('0x53')][_0xdee6('0x34')](_0x48444b)['then'](function(_0x70fd0f){_0x4f08e7[_0xdee6('0x34')]=_0x70fd0f;if(_0x21d46c[_0xdee6('0x44')]['includeAll']){_0x3796c0[_0xdee6('0x54')]=[{'all':!![]}];}return db[_0xdee6('0x53')][_0xdee6('0x55')](_0x3796c0);})[_0xdee6('0x24')](function(_0x44798c){_0x4f08e7[_0xdee6('0x56')]=_0x44798c;return _0x4f08e7;})['then'](respondWithFilteredResult(_0x1f3a18,_0x3796c0))['catch'](handleError(_0x1f3a18,null));};exports['show']=function(_0x1c3251,_0x4ae671){var _0x29ab1f={'raw':!![],'where':{'id':_0x1c3251[_0xdee6('0x57')]['id']}},_0x1c39c8={};_0x1c39c8['model']=_['keys'](db[_0xdee6('0x53')]['rawAttributes']);_0x1c39c8['query']=_[_0xdee6('0x58')](_0x1c3251['query']);_0x1c39c8[_0xdee6('0x45')]=_[_0xdee6('0x46')](_0x1c39c8['model'],_0x1c39c8[_0xdee6('0x44')]);_0x29ab1f[_0xdee6('0x47')]=_[_0xdee6('0x46')](_0x1c39c8['model'],qs[_0xdee6('0x48')](_0x1c3251[_0xdee6('0x44')][_0xdee6('0x48')]));_0x29ab1f['attributes']=_0x29ab1f[_0xdee6('0x47')][_0xdee6('0x49')]?_0x29ab1f['attributes']:_0x1c39c8[_0xdee6('0x43')];if(_0x1c3251['query'][_0xdee6('0x59')]){_0x29ab1f[_0xdee6('0x54')]=[{'all':!![]}];}_0x29ab1f=_[_0xdee6('0x4f')]({},_0x29ab1f,_0x1c3251[_0xdee6('0x52')]);return db[_0xdee6('0x53')]['find'](_0x29ab1f)[_0xdee6('0x24')](handleEntityNotFound(_0x4ae671,null))[_0xdee6('0x24')](respondWithResult(_0x4ae671,null))[_0xdee6('0x2e')](handleError(_0x4ae671,null));};exports[_0xdee6('0x5a')]=function(_0x4cd489,_0x4e455a){return db[_0xdee6('0x53')][_0xdee6('0x5a')](_0x4cd489[_0xdee6('0x5b')],{})['then'](respondWithResult(_0x4e455a,0xc9))[_0xdee6('0x2e')](handleError(_0x4e455a,null));};exports[_0xdee6('0x39')]=function(_0xf56a96,_0x4c834e){if(_0xf56a96[_0xdee6('0x5b')]['id']){delete _0xf56a96['body']['id'];}return db[_0xdee6('0x53')]['find']({'where':{'id':_0xf56a96['params']['id']}})['then'](handleEntityNotFound(_0x4c834e,null))[_0xdee6('0x24')](saveUpdates(_0xf56a96[_0xdee6('0x5b')],null))['then'](respondWithResult(_0x4c834e,null))[_0xdee6('0x2e')](handleError(_0x4c834e,null));};exports['destroy']=function(_0x508ace,_0x360e15){return db[_0xdee6('0x53')][_0xdee6('0x5c')]({'where':{'id':_0x508ace[_0xdee6('0x57')]['id']}})[_0xdee6('0x24')](handleEntityNotFound(_0x360e15,null))['then'](removeEntity(_0x360e15,null))['catch'](handleError(_0x360e15,null));};exports[_0xdee6('0x5d')]=function(_0x249e77,_0x170aa1){return db[_0xdee6('0x53')]['describe']()[_0xdee6('0x24')](respondWithResult(_0x170aa1,null))[_0xdee6('0x2e')](handleError(_0x170aa1,null));};var interaction_log=require('../../config/logger')('whatsapp-interactions');exports[_0xdee6('0x5e')]=function(_0x12ca98,_0x18ed74,_0x39ed06){var _0x9f0964={'agent':{},'channel':_0xdee6('0x5f')};if(_0x12ca98[_0xdee6('0x5b')]['id']){delete _0x12ca98[_0xdee6('0x5b')]['id'];}_0x12ca98[_0xdee6('0x5b')]['read']=!![];_0x12ca98[_0xdee6('0x5b')][_0xdee6('0x60')]=moment()['format'](_0xdee6('0x61'));_0x12ca98[_0xdee6('0x5b')][_0xdee6('0x62')]=_0x12ca98['body'][_0xdee6('0x62')]||_0x12ca98[_0xdee6('0x63')]['id'];_0x9f0964[_0xdee6('0x64')]['id']=_0x12ca98['body'][_0xdee6('0x62')];return db[_0xdee6('0x53')][_0xdee6('0x5c')]({'where':{'id':_0x12ca98[_0xdee6('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x18ed74,null))[_0xdee6('0x24')](saveUpdates(_0x12ca98['body'],null))[_0xdee6('0x24')](function(_0x4a6bc5){if(_0x4a6bc5){_0x9f0964[_0xdee6('0x2b')]=_0x4a6bc5[_0xdee6('0x65')]({'plain':!![]});return db['WhatsappInteraction']['find']({'where':{'id':_0x4a6bc5[_0xdee6('0x66')]}});}return null;})[_0xdee6('0x24')](handleEntityNotFound(_0x18ed74,null))[_0xdee6('0x24')](function(_0x58c2b6){if(_0x58c2b6){return _0x58c2b6[_0xdee6('0x39')]({'UserId':_0x12ca98['body'][_0xdee6('0x62')],'read1stAt':_['isNil'](_0x58c2b6[_0xdee6('0x67')])?moment()[_0xdee6('0x68')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xdee6('0x24')](function(_0x1f1b52){if(_0x1f1b52){_0x9f0964['interaction']=_0x1f1b52[_0xdee6('0x65')]({'plain':!![]});interaction_log['info']('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x12ca98['user']['id'],_0x12ca98[_0xdee6('0x63')][_0xdee6('0x3d')],_0x12ca98['user'][_0xdee6('0x69')],_0x9f0964[_0xdee6('0x6a')]['id'],_0x12ca98[_0xdee6('0x5b')]?JSON[_0xdee6('0x28')](_0x12ca98['body']):_0xdee6('0x6b'));return respondWithRpcPromise(_0xdee6('0x6c'),_0xdee6('0x6d'),_0x9f0964);}return null;})[_0xdee6('0x24')](function(_0x531ca2){var _0x44262c=_0xdee6('0x6e')+_0x531ca2['message'][_0xdee6('0x6f')];return db[_0xdee6('0x70')][_0xdee6('0x44')](_0x44262c,{'type':db[_0xdee6('0x71')][_0xdee6('0x72')][_0xdee6('0x73')],'raw':!![]})[_0xdee6('0x24')](function(_0x3cc240){return _0x3cc240;});})[_0xdee6('0x24')](function(_0x476803){if(_0x476803){_0x9f0964[_0xdee6('0x2b')]['contact']=_0x476803[0x0];if(!_0x12ca98[_0xdee6('0x5b')][_0xdee6('0x62')])return;return db['User'][_0xdee6('0x5c')]({'where':{'id':_0x12ca98['body'][_0xdee6('0x62')],'role':_0xdee6('0x64')},'attributes':['id',_0xdee6('0x3d'),_0xdee6('0x74'),_0xdee6('0x75'),_0xdee6('0x76')],'raw':!![]});}return null;})[_0xdee6('0x24')](function(_0x40cb27){if(!_0x40cb27)return null;_0x9f0964[_0xdee6('0x2b')][_0xdee6('0x64')]=_0x40cb27;return _0x9f0964;})[_0xdee6('0x24')](function(_0x942e89){if(_0x942e89){if(_0x12ca98[_0xdee6('0x5b')]['manual']){_0x9f0964['message']['interface']=util[_0xdee6('0x68')]('SIP/%s',_0x12ca98[_0xdee6('0x63')][_0xdee6('0x3d')]);_0x9f0964[_0xdee6('0x2b')]['channel']=_0x9f0964[_0xdee6('0x77')];_0x9f0964['message'][_0xdee6('0x78')]=_0xdee6('0x5e');return respondWithRpcPromise('EventManager','EventManager',{'event':'acceptmessage','message':_0x9f0964[_0xdee6('0x2b')]},client9002)[_0xdee6('0x24')](function(){return _0x9f0964;});}return _0x9f0964;}return null;})['then'](respondWithResult(_0x18ed74,null))[_0xdee6('0x2e')](handleError(_0x18ed74,null));};var interaction_log=require(_0xdee6('0x15'))('whatsapp-interactions');exports[_0xdee6('0x79')]=function(_0x5c886d,_0x24edd4,_0x3578ce){var _0x2f630d={'agent':{},'channel':_0xdee6('0x5f')};if(_0x5c886d[_0xdee6('0x5b')]['id']){delete _0x5c886d[_0xdee6('0x5b')]['id'];}_0x5c886d[_0xdee6('0x5b')][_0xdee6('0x62')]=_0x5c886d[_0xdee6('0x5b')][_0xdee6('0x62')]||_0x5c886d[_0xdee6('0x63')]['id'];_0x2f630d['agent']['id']=_0x5c886d['body']['UserId'];return db[_0xdee6('0x53')][_0xdee6('0x5c')]({'where':{'id':_0x5c886d[_0xdee6('0x57')]['id'],'UserId':null}})[_0xdee6('0x24')](handleEntityNotFound(_0x24edd4,null))[_0xdee6('0x24')](function(_0xd0754c){if(_0xd0754c){_0x2f630d[_0xdee6('0x2b')]=_0xd0754c[_0xdee6('0x65')]({'plain':!![]});return db[_0xdee6('0x7a')]['find']({'where':{'id':_0xd0754c[_0xdee6('0x66')]}});}return null;})[_0xdee6('0x24')](handleEntityNotFound(_0x24edd4,null))[_0xdee6('0x24')](function(_0x5e2add){if(_0x5e2add){_0x2f630d[_0xdee6('0x6a')]=_0x5e2add['get']({'plain':!![]});interaction_log[_0xdee6('0x2c')]('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5c886d[_0xdee6('0x63')]['id'],_0x5c886d[_0xdee6('0x63')][_0xdee6('0x3d')],_0x5c886d[_0xdee6('0x63')][_0xdee6('0x69')],_0x2f630d[_0xdee6('0x6a')]['id'],_0x5c886d['body']?JSON['stringify'](_0x5c886d['body']):_0xdee6('0x6b'));return respondWithRpcPromise(_0xdee6('0x7b'),'rejectMessage',_0x2f630d);}return null;})[_0xdee6('0x24')](function(_0x5aab06){var _0xe6fed=_0xdee6('0x6e')+_0x5aab06[_0xdee6('0x2b')][_0xdee6('0x6f')];return db[_0xdee6('0x70')][_0xdee6('0x44')](_0xe6fed,{'type':db['Sequelize'][_0xdee6('0x72')][_0xdee6('0x73')],'raw':!![]})[_0xdee6('0x24')](function(_0x260382){return _0x260382;});})[_0xdee6('0x24')](function(_0x547072){if(_0x547072){_0x2f630d[_0xdee6('0x2b')][_0xdee6('0x7c')]=_0x547072[0x0];if(!_0x5c886d['body'][_0xdee6('0x62')])return;return db[_0xdee6('0x7d')][_0xdee6('0x5c')]({'where':{'id':_0x5c886d[_0xdee6('0x5b')][_0xdee6('0x62')],'role':'agent'},'attributes':['id',_0xdee6('0x3d'),_0xdee6('0x74'),_0xdee6('0x75'),_0xdee6('0x76')],'raw':!![]});}return null;})[_0xdee6('0x24')](function(_0x467662){if(!_0x467662)return null;_0x2f630d[_0xdee6('0x2b')][_0xdee6('0x64')]=_0x467662;return _0x2f630d;})[_0xdee6('0x24')](function(_0xcd3958){if(_0xcd3958){_0xcd3958['message'][_0xdee6('0x7e')]=util[_0xdee6('0x68')](_0xdee6('0x7f'),_0x5c886d[_0xdee6('0x63')][_0xdee6('0x3d')]);_0xcd3958[_0xdee6('0x2b')][_0xdee6('0x77')]=_0x2f630d[_0xdee6('0x77')];_0xcd3958[_0xdee6('0x2b')][_0xdee6('0x78')]=_0xdee6('0x79');respondWithRpcPromise('EventManager','EventManager',{'event':_0xdee6('0x80'),'message':_0xcd3958['message']},client9002);return _0x2f630d;}return null;})[_0xdee6('0x24')](respondWithResult(_0x24edd4,null))[_0xdee6('0x2e')](handleError(_0x24edd4,null));};exports[_0xdee6('0x3b')]=function(_0x18af63,_0x3d00fa,_0x505fc6){if(_0x18af63[_0xdee6('0x5b')]['id']){delete _0x18af63[_0xdee6('0x5b')]['id'];}var _0x22829f;return db[_0xdee6('0x53')][_0xdee6('0x5c')]({'where':{'id':_0x18af63['params']['id']}})[_0xdee6('0x24')](handleEntityNotFound(_0x3d00fa,null))['then'](function(_0x168702){if(_0x168702){_0x22829f=_0x168702;return db['WhatsappAccount'][_0xdee6('0x5c')]({'where':{'id':_0x168702[_0xdee6('0x81')]}});}})[_0xdee6('0x24')](handleEntityNotFound(_0x3d00fa,null))[_0xdee6('0x24')](function(_0x42b3d8){if(_0x42b3d8){logger[_0xdee6('0x26')]('WhatsppMessage,\x20%s,\x20%s,\x20%s','status',_0xdee6('0x82'),_0x42b3d8['type'],util[_0xdee6('0x83')](_0x18af63[_0xdee6('0x5b')],{'showHidden':![],'depth':null}));switch(_0x42b3d8[_0xdee6('0x41')]){case _0xdee6('0x84'):if(_0x18af63[_0xdee6('0x5b')][_0xdee6('0x85')]&&_0x18af63['body'][_0xdee6('0x85')]===_0x22829f[_0xdee6('0x86')]&&_0x18af63[_0xdee6('0x5b')]['MessageStatus']&&_0x18af63[_0xdee6('0x5b')][_0xdee6('0x87')]===_0xdee6('0x88')){return _0x22829f[_0xdee6('0x39')]({'read':!![]});}else{logger[_0xdee6('0x29')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0xdee6('0x3b'),'twilio',util[_0xdee6('0x83')](_0x18af63[_0xdee6('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0x22829f;}})['then'](respondWithResult(_0x3d00fa,null))[_0xdee6('0x2e')](handleError(_0x3d00fa,null));}; \ No newline at end of file +var _0x95eb=['fullname','email','internal','manual','interface','SIP/%s','event','acceptmessage','reject','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','channel','EventManager','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','client','then','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','status','end','json','offset','limit','count','set','Content-Range','save','update','destroy','name','send','index','map','WhatsappMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','include','rows','show','params','length','includeAll','create','body','find','describe','../../config/logger','whatsapp-interactions','accept','whatsapp','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','interaction','get','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','acceptMessage','ContactId','sequelize','QueryTypes','SELECT','contact','User'];(function(_0x5de73d,_0x3d3ccb){var _0x3ebc90=function(_0x1922d9){while(--_0x1922d9){_0x5de73d['push'](_0x5de73d['shift']());}};_0x3ebc90(++_0x3d3ccb);}(_0x95eb,0x1cc));var _0xb95e=function(_0x42b2c3,_0x47e06d){_0x42b2c3=_0x42b2c3-0x0;var _0x3f8d93=_0x95eb[_0x42b2c3];return _0x3f8d93;};'use strict';var emlformat=require(_0xb95e('0x0'));var rimraf=require(_0xb95e('0x1'));var zipdir=require(_0xb95e('0x2'));var jsonpatch=require(_0xb95e('0x3'));var rp=require(_0xb95e('0x4'));var moment=require('moment');var BPromise=require(_0xb95e('0x5'));var Mustache=require(_0xb95e('0x6'));var util=require(_0xb95e('0x7'));var path=require(_0xb95e('0x8'));var sox=require(_0xb95e('0x9'));var csv=require(_0xb95e('0xa'));var ejs=require(_0xb95e('0xb'));var fs=require('fs');var fs_extra=require(_0xb95e('0xc'));var _=require(_0xb95e('0xd'));var squel=require(_0xb95e('0xe'));var crypto=require(_0xb95e('0xf'));var jsforce=require(_0xb95e('0x10'));var deskjs=require(_0xb95e('0x11'));var toCsv=require('to-csv');var querystring=require(_0xb95e('0x12'));var Papa=require('papaparse');var Redis=require(_0xb95e('0x13'));var authService=require(_0xb95e('0x14'));var qs=require(_0xb95e('0x15'));var as=require(_0xb95e('0x16'));var hardwareService=require(_0xb95e('0x17'));var logger=require('../../config/logger')(_0xb95e('0x18'));var utils=require(_0xb95e('0x19'));var config=require(_0xb95e('0x1a'));var licenseUtil=require(_0xb95e('0x1b'));var db=require(_0xb95e('0x1c'))['db'];config[_0xb95e('0x1d')]=_[_0xb95e('0x1e')](config[_0xb95e('0x1d')],{'host':_0xb95e('0x1f'),'port':0x18eb});var socket=require(_0xb95e('0x20'))(new Redis(config['redis']));require(_0xb95e('0x21'))[_0xb95e('0x22')](socket);var jayson=require(_0xb95e('0x23'));var client=jayson[_0xb95e('0x24')]['http']({'port':0x232c});var client9002=jayson[_0xb95e('0x24')]['http']({'port':0x232a});function respondWithRpcPromise(_0x35844a,_0x1b8530,_0x368327,_0x5e086d){return new BPromise(function(_0x58ed69,_0x19dc8d){var _0x6e505a=_0x5e086d||client;return _0x6e505a['request'](_0x35844a,_0x368327)[_0xb95e('0x25')](function(_0x15b124){logger['info'](_0xb95e('0x26'),_0x1b8530,_0xb95e('0x27'));logger[_0xb95e('0x28')](_0xb95e('0x29'),_0x1b8530,_0xb95e('0x27'),JSON['stringify'](_0x15b124));if(_0x15b124[_0xb95e('0x2a')]){if(_0x15b124[_0xb95e('0x2a')]['code']===0x1f4){logger[_0xb95e('0x2a')]('WhatsappMessage,\x20%s,\x20%s',_0x1b8530,_0x15b124[_0xb95e('0x2a')][_0xb95e('0x2b')]);return _0x19dc8d(_0x15b124[_0xb95e('0x2a')]['message']);}logger[_0xb95e('0x2a')](_0xb95e('0x26'),_0x1b8530,_0x15b124[_0xb95e('0x2a')][_0xb95e('0x2b')]);return _0x58ed69(_0x15b124[_0xb95e('0x2a')][_0xb95e('0x2b')]);}else{logger[_0xb95e('0x2c')]('WhatsappMessage,\x20%s,\x20%s',_0x1b8530,_0xb95e('0x27'));_0x58ed69(_0x15b124[_0xb95e('0x2d')][_0xb95e('0x2b')]);}})[_0xb95e('0x2e')](function(_0x3d490a){logger[_0xb95e('0x2a')](_0xb95e('0x26'),_0x1b8530,_0x3d490a);_0x19dc8d(_0x3d490a);});});}function respondWithStatusCode(_0x33d57c,_0x2b9c2b){_0x2b9c2b=_0x2b9c2b||0xcc;return function(_0x2d067f){if(_0x2d067f){return _0x33d57c['sendStatus'](_0x2b9c2b);}return _0x33d57c[_0xb95e('0x2f')](_0x2b9c2b)[_0xb95e('0x30')]();};}function respondWithResult(_0x3259ae,_0x3bd6ca){_0x3bd6ca=_0x3bd6ca||0xc8;return function(_0x456332){if(_0x456332){return _0x3259ae[_0xb95e('0x2f')](_0x3bd6ca)[_0xb95e('0x31')](_0x456332);}};}function respondWithFilteredResult(_0x76e601,_0x36c118){return function(_0x371d82){if(_0x371d82){var _0x570b9c=typeof _0x36c118[_0xb95e('0x32')]==='undefined'&&typeof _0x36c118[_0xb95e('0x33')]==='undefined';var _0x399141=_0x371d82[_0xb95e('0x34')];var _0x5d8757=_0x570b9c?0x0:_0x36c118[_0xb95e('0x32')];var _0x121e88=_0x570b9c?_0x371d82[_0xb95e('0x34')]:_0x36c118['offset']+_0x36c118[_0xb95e('0x33')];var _0x33a9ec;if(_0x121e88>=_0x399141){_0x121e88=_0x399141;_0x33a9ec=0xc8;}else{_0x33a9ec=0xce;}_0x76e601[_0xb95e('0x2f')](_0x33a9ec);return _0x76e601[_0xb95e('0x35')](_0xb95e('0x36'),_0x5d8757+'-'+_0x121e88+'/'+_0x399141)['json'](_0x371d82);}return null;};}function patchUpdates(_0x2df34b){return function(_0x50651d){try{jsonpatch['apply'](_0x50651d,_0x2df34b,!![]);}catch(_0x514279){return BPromise['reject'](_0x514279);}return _0x50651d[_0xb95e('0x37')]();};}function saveUpdates(_0x27f061,_0x5f18aa){return function(_0x4576cf){if(_0x4576cf){return _0x4576cf[_0xb95e('0x38')](_0x27f061)[_0xb95e('0x25')](function(_0x1328dd){return _0x1328dd;});}return null;};}function removeEntity(_0x28b1d7,_0x10e920){return function(_0x458839){if(_0x458839){return _0x458839[_0xb95e('0x39')]()[_0xb95e('0x25')](function(){_0x28b1d7[_0xb95e('0x2f')](0xcc)[_0xb95e('0x30')]();});}};}function handleEntityNotFound(_0x2e8863,_0x2bf983){return function(_0x3acb09){if(!_0x3acb09){_0x2e8863['sendStatus'](0x194);}return _0x3acb09;};}function handleError(_0x116855,_0x227fc5){_0x227fc5=_0x227fc5||0x1f4;return function(_0x56619f){logger['error'](_0x56619f['stack']);if(_0x56619f[_0xb95e('0x3a')]){delete _0x56619f[_0xb95e('0x3a')];}_0x116855[_0xb95e('0x2f')](_0x227fc5)[_0xb95e('0x3b')](_0x56619f);};}exports[_0xb95e('0x3c')]=function(_0x1cf7f6,_0x11caa2){var _0x58b9a1={},_0x117b95={},_0x2745a3={'count':0x0,'rows':[]};var _0x6e3b40=_[_0xb95e('0x3d')](db[_0xb95e('0x3e')][_0xb95e('0x3f')],function(_0x40efa2){return{'name':_0x40efa2[_0xb95e('0x40')],'type':_0x40efa2[_0xb95e('0x41')][_0xb95e('0x42')]};});_0x117b95[_0xb95e('0x43')]=_[_0xb95e('0x3d')](_0x6e3b40,_0xb95e('0x3a'));_0x117b95[_0xb95e('0x44')]=_[_0xb95e('0x45')](_0x1cf7f6[_0xb95e('0x44')]);_0x117b95[_0xb95e('0x46')]=_[_0xb95e('0x47')](_0x117b95[_0xb95e('0x43')],_0x117b95[_0xb95e('0x44')]);_0x58b9a1[_0xb95e('0x48')]=_[_0xb95e('0x47')](_0x117b95[_0xb95e('0x43')],qs['fields'](_0x1cf7f6[_0xb95e('0x44')][_0xb95e('0x49')]));_0x58b9a1[_0xb95e('0x48')]=_0x58b9a1[_0xb95e('0x48')]['length']?_0x58b9a1[_0xb95e('0x48')]:_0x117b95[_0xb95e('0x43')];if(!_0x1cf7f6[_0xb95e('0x44')][_0xb95e('0x4a')](_0xb95e('0x4b'))){_0x58b9a1[_0xb95e('0x33')]=qs[_0xb95e('0x33')](_0x1cf7f6[_0xb95e('0x44')][_0xb95e('0x33')]);_0x58b9a1[_0xb95e('0x32')]=qs[_0xb95e('0x32')](_0x1cf7f6[_0xb95e('0x44')]['offset']);}_0x58b9a1[_0xb95e('0x4c')]=qs[_0xb95e('0x4d')](_0x1cf7f6['query'][_0xb95e('0x4d')]);_0x58b9a1['where']=qs[_0xb95e('0x46')](_['pick'](_0x1cf7f6[_0xb95e('0x44')],_0x117b95[_0xb95e('0x46')]),_0x6e3b40);if(_0x1cf7f6[_0xb95e('0x44')][_0xb95e('0x4e')]){_0x58b9a1[_0xb95e('0x4f')]=_[_0xb95e('0x50')](_0x58b9a1[_0xb95e('0x4f')],{'$or':_[_0xb95e('0x3d')](_0x6e3b40,function(_0x3e49cf){if(_0x3e49cf[_0xb95e('0x41')]!==_0xb95e('0x51')){var _0x56e079={};_0x56e079[_0x3e49cf['name']]={'$like':'%'+_0x1cf7f6[_0xb95e('0x44')]['filter']+'%'};return _0x56e079;}})});}_0x58b9a1=_['merge']({},_0x58b9a1,_0x1cf7f6[_0xb95e('0x52')]);var _0x12d577={'where':_0x58b9a1[_0xb95e('0x4f')]};return db[_0xb95e('0x3e')]['count'](_0x12d577)[_0xb95e('0x25')](function(_0x33fecb){_0x2745a3[_0xb95e('0x34')]=_0x33fecb;if(_0x1cf7f6[_0xb95e('0x44')]['includeAll']){_0x58b9a1[_0xb95e('0x53')]=[{'all':!![]}];}return db[_0xb95e('0x3e')]['findAll'](_0x58b9a1);})[_0xb95e('0x25')](function(_0x31b897){_0x2745a3[_0xb95e('0x54')]=_0x31b897;return _0x2745a3;})[_0xb95e('0x25')](respondWithFilteredResult(_0x11caa2,_0x58b9a1))[_0xb95e('0x2e')](handleError(_0x11caa2,null));};exports[_0xb95e('0x55')]=function(_0x4216fc,_0x4ee0e8){var _0xe5f8e1={'raw':!![],'where':{'id':_0x4216fc[_0xb95e('0x56')]['id']}},_0x47e6f7={};_0x47e6f7['model']=_[_0xb95e('0x45')](db[_0xb95e('0x3e')][_0xb95e('0x3f')]);_0x47e6f7[_0xb95e('0x44')]=_[_0xb95e('0x45')](_0x4216fc['query']);_0x47e6f7[_0xb95e('0x46')]=_[_0xb95e('0x47')](_0x47e6f7['model'],_0x47e6f7[_0xb95e('0x44')]);_0xe5f8e1['attributes']=_['intersection'](_0x47e6f7[_0xb95e('0x43')],qs[_0xb95e('0x49')](_0x4216fc[_0xb95e('0x44')][_0xb95e('0x49')]));_0xe5f8e1[_0xb95e('0x48')]=_0xe5f8e1['attributes'][_0xb95e('0x57')]?_0xe5f8e1[_0xb95e('0x48')]:_0x47e6f7[_0xb95e('0x43')];if(_0x4216fc[_0xb95e('0x44')][_0xb95e('0x58')]){_0xe5f8e1[_0xb95e('0x53')]=[{'all':!![]}];}_0xe5f8e1=_[_0xb95e('0x50')]({},_0xe5f8e1,_0x4216fc[_0xb95e('0x52')]);return db['WhatsappMessage']['find'](_0xe5f8e1)[_0xb95e('0x25')](handleEntityNotFound(_0x4ee0e8,null))[_0xb95e('0x25')](respondWithResult(_0x4ee0e8,null))[_0xb95e('0x2e')](handleError(_0x4ee0e8,null));};exports[_0xb95e('0x59')]=function(_0x4d0293,_0x270734){return db[_0xb95e('0x3e')][_0xb95e('0x59')](_0x4d0293['body'],{})[_0xb95e('0x25')](respondWithResult(_0x270734,0xc9))['catch'](handleError(_0x270734,null));};exports[_0xb95e('0x38')]=function(_0xce5d29,_0x2ea37c){if(_0xce5d29[_0xb95e('0x5a')]['id']){delete _0xce5d29[_0xb95e('0x5a')]['id'];}return db[_0xb95e('0x3e')][_0xb95e('0x5b')]({'where':{'id':_0xce5d29[_0xb95e('0x56')]['id']}})[_0xb95e('0x25')](handleEntityNotFound(_0x2ea37c,null))[_0xb95e('0x25')](saveUpdates(_0xce5d29[_0xb95e('0x5a')],null))[_0xb95e('0x25')](respondWithResult(_0x2ea37c,null))[_0xb95e('0x2e')](handleError(_0x2ea37c,null));};exports[_0xb95e('0x39')]=function(_0x36d05b,_0x278a5){return db['WhatsappMessage'][_0xb95e('0x5b')]({'where':{'id':_0x36d05b[_0xb95e('0x56')]['id']}})[_0xb95e('0x25')](handleEntityNotFound(_0x278a5,null))[_0xb95e('0x25')](removeEntity(_0x278a5,null))['catch'](handleError(_0x278a5,null));};exports[_0xb95e('0x5c')]=function(_0x3b99d4,_0x1303ca){return db[_0xb95e('0x3e')][_0xb95e('0x5c')]()[_0xb95e('0x25')](respondWithResult(_0x1303ca,null))[_0xb95e('0x2e')](handleError(_0x1303ca,null));};var interaction_log=require(_0xb95e('0x5d'))(_0xb95e('0x5e'));exports[_0xb95e('0x5f')]=function(_0x217336,_0x5710ca,_0x356a7f){var _0x76b528={'agent':{},'channel':_0xb95e('0x60')};if(_0x217336[_0xb95e('0x5a')]['id']){delete _0x217336[_0xb95e('0x5a')]['id'];}_0x217336[_0xb95e('0x5a')][_0xb95e('0x61')]=!![];_0x217336[_0xb95e('0x5a')]['readAt']=moment()[_0xb95e('0x62')](_0xb95e('0x63'));_0x217336['body'][_0xb95e('0x64')]=_0x217336[_0xb95e('0x5a')][_0xb95e('0x64')]||_0x217336[_0xb95e('0x65')]['id'];_0x76b528[_0xb95e('0x66')]['id']=_0x217336[_0xb95e('0x5a')]['UserId'];return db[_0xb95e('0x3e')]['find']({'where':{'id':_0x217336[_0xb95e('0x56')]['id'],'UserId':null}})[_0xb95e('0x25')](handleEntityNotFound(_0x5710ca,null))[_0xb95e('0x25')](saveUpdates(_0x217336[_0xb95e('0x5a')],null))['then'](function(_0x189c30){if(_0x189c30){_0x76b528[_0xb95e('0x2b')]=_0x189c30['get']({'plain':!![]});return db[_0xb95e('0x67')][_0xb95e('0x5b')]({'where':{'id':_0x189c30[_0xb95e('0x68')]}});}return null;})[_0xb95e('0x25')](handleEntityNotFound(_0x5710ca,null))[_0xb95e('0x25')](function(_0x12d220){if(_0x12d220){return _0x12d220[_0xb95e('0x38')]({'UserId':_0x217336[_0xb95e('0x5a')][_0xb95e('0x64')],'read1stAt':_[_0xb95e('0x69')](_0x12d220[_0xb95e('0x6a')])?moment()[_0xb95e('0x62')](_0xb95e('0x63')):undefined});}return null;})['then'](function(_0x262208){if(_0x262208){_0x76b528[_0xb95e('0x6b')]=_0x262208[_0xb95e('0x6c')]({'plain':!![]});interaction_log[_0xb95e('0x2c')](_0xb95e('0x6d'),_0x217336[_0xb95e('0x65')]['id'],_0x217336[_0xb95e('0x65')][_0xb95e('0x3a')],_0x217336['user'][_0xb95e('0x6e')],_0x76b528[_0xb95e('0x6b')]['id'],_0x217336[_0xb95e('0x5a')]?JSON[_0xb95e('0x6f')](_0x217336[_0xb95e('0x5a')]):_0xb95e('0x70'));return respondWithRpcPromise('AcceptMessage',_0xb95e('0x71'),_0x76b528);}return null;})[_0xb95e('0x25')](function(_0x34e892){var _0x5101b9='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x34e892[_0xb95e('0x2b')][_0xb95e('0x72')];return db[_0xb95e('0x73')][_0xb95e('0x44')](_0x5101b9,{'type':db['Sequelize'][_0xb95e('0x74')][_0xb95e('0x75')],'raw':!![]})[_0xb95e('0x25')](function(_0x182330){return _0x182330;});})[_0xb95e('0x25')](function(_0x29e07f){if(_0x29e07f){_0x76b528[_0xb95e('0x2b')][_0xb95e('0x76')]=_0x29e07f[0x0];if(!_0x217336[_0xb95e('0x5a')][_0xb95e('0x64')])return;return db[_0xb95e('0x77')][_0xb95e('0x5b')]({'where':{'id':_0x217336[_0xb95e('0x5a')][_0xb95e('0x64')],'role':_0xb95e('0x66')},'attributes':['id',_0xb95e('0x3a'),_0xb95e('0x78'),_0xb95e('0x79'),_0xb95e('0x7a')],'raw':!![]});}return null;})['then'](function(_0x1ed892){if(!_0x1ed892)return null;_0x76b528[_0xb95e('0x2b')]['agent']=_0x1ed892;return _0x76b528;})[_0xb95e('0x25')](function(_0x508716){if(_0x508716){if(_0x217336[_0xb95e('0x5a')][_0xb95e('0x7b')]){_0x76b528[_0xb95e('0x2b')][_0xb95e('0x7c')]=util['format'](_0xb95e('0x7d'),_0x217336['user'][_0xb95e('0x3a')]);_0x76b528[_0xb95e('0x2b')]['channel']=_0x76b528['channel'];_0x76b528[_0xb95e('0x2b')][_0xb95e('0x7e')]='accept';return respondWithRpcPromise('EventManager','EventManager',{'event':_0xb95e('0x7f'),'message':_0x76b528[_0xb95e('0x2b')]},client9002)['then'](function(){return _0x76b528;});}return _0x76b528;}return null;})[_0xb95e('0x25')](respondWithResult(_0x5710ca,null))[_0xb95e('0x2e')](handleError(_0x5710ca,null));};var interaction_log=require(_0xb95e('0x5d'))(_0xb95e('0x5e'));exports[_0xb95e('0x80')]=function(_0x3e8de6,_0x37ae02,_0x168a15){var _0x1da6f6={'agent':{},'channel':_0xb95e('0x60')};if(_0x3e8de6[_0xb95e('0x5a')]['id']){delete _0x3e8de6['body']['id'];}_0x3e8de6[_0xb95e('0x5a')][_0xb95e('0x64')]=_0x3e8de6[_0xb95e('0x5a')][_0xb95e('0x64')]||_0x3e8de6['user']['id'];_0x1da6f6[_0xb95e('0x66')]['id']=_0x3e8de6['body'][_0xb95e('0x64')];return db['WhatsappMessage'][_0xb95e('0x5b')]({'where':{'id':_0x3e8de6[_0xb95e('0x56')]['id'],'UserId':null}})[_0xb95e('0x25')](handleEntityNotFound(_0x37ae02,null))[_0xb95e('0x25')](function(_0x252ffa){if(_0x252ffa){_0x1da6f6[_0xb95e('0x2b')]=_0x252ffa['get']({'plain':!![]});return db[_0xb95e('0x67')][_0xb95e('0x5b')]({'where':{'id':_0x252ffa[_0xb95e('0x68')]}});}return null;})[_0xb95e('0x25')](handleEntityNotFound(_0x37ae02,null))[_0xb95e('0x25')](function(_0xfbd72e){if(_0xfbd72e){_0x1da6f6[_0xb95e('0x6b')]=_0xfbd72e['get']({'plain':!![]});interaction_log[_0xb95e('0x2c')](_0xb95e('0x81'),_0x3e8de6[_0xb95e('0x65')]['id'],_0x3e8de6[_0xb95e('0x65')][_0xb95e('0x3a')],_0x3e8de6['user'][_0xb95e('0x6e')],_0x1da6f6[_0xb95e('0x6b')]['id'],_0x3e8de6[_0xb95e('0x5a')]?JSON[_0xb95e('0x6f')](_0x3e8de6[_0xb95e('0x5a')]):_0xb95e('0x70'));return respondWithRpcPromise(_0xb95e('0x82'),'rejectMessage',_0x1da6f6);}return null;})['then'](function(_0x30968c){var _0x5f4ed9=_0xb95e('0x83')+_0x30968c[_0xb95e('0x2b')][_0xb95e('0x72')];return db['sequelize'][_0xb95e('0x44')](_0x5f4ed9,{'type':db[_0xb95e('0x84')]['QueryTypes']['SELECT'],'raw':!![]})[_0xb95e('0x25')](function(_0x31c134){return _0x31c134;});})[_0xb95e('0x25')](function(_0x5bba55){if(_0x5bba55){_0x1da6f6['message']['contact']=_0x5bba55[0x0];if(!_0x3e8de6['body'][_0xb95e('0x64')])return;return db['User'][_0xb95e('0x5b')]({'where':{'id':_0x3e8de6[_0xb95e('0x5a')][_0xb95e('0x64')],'role':'agent'},'attributes':['id',_0xb95e('0x3a'),_0xb95e('0x78'),_0xb95e('0x79'),_0xb95e('0x7a')],'raw':!![]});}return null;})[_0xb95e('0x25')](function(_0x2b7ae1){if(!_0x2b7ae1)return null;_0x1da6f6[_0xb95e('0x2b')][_0xb95e('0x66')]=_0x2b7ae1;return _0x1da6f6;})['then'](function(_0x4772f0){if(_0x4772f0){_0x4772f0['message'][_0xb95e('0x7c')]=util['format']('SIP/%s',_0x3e8de6[_0xb95e('0x65')]['name']);_0x4772f0[_0xb95e('0x2b')][_0xb95e('0x85')]=_0x1da6f6[_0xb95e('0x85')];_0x4772f0['message'][_0xb95e('0x7e')]='reject';respondWithRpcPromise(_0xb95e('0x86'),_0xb95e('0x86'),{'event':_0xb95e('0x87'),'message':_0x4772f0[_0xb95e('0x2b')]},client9002);return _0x1da6f6;}return null;})['then'](respondWithResult(_0x37ae02,null))['catch'](handleError(_0x37ae02,null));};exports[_0xb95e('0x2f')]=function(_0x1ac0dc,_0x2800fa,_0x4e2f25){if(_0x1ac0dc[_0xb95e('0x5a')]['id']){delete _0x1ac0dc['body']['id'];}var _0x17db1e;return db[_0xb95e('0x3e')][_0xb95e('0x5b')]({'where':{'id':_0x1ac0dc['params']['id']}})['then'](handleEntityNotFound(_0x2800fa,null))[_0xb95e('0x25')](function(_0x21d317){if(_0x21d317){_0x17db1e=_0x21d317;return db[_0xb95e('0x88')][_0xb95e('0x5b')]({'where':{'id':_0x21d317[_0xb95e('0x89')]}});}})[_0xb95e('0x25')](handleEntityNotFound(_0x2800fa,null))['then'](function(_0x5edd6f){if(_0x5edd6f){logger[_0xb95e('0x28')](_0xb95e('0x8a'),_0xb95e('0x2f'),_0xb95e('0x8b'),_0x5edd6f[_0xb95e('0x41')],util[_0xb95e('0x8c')](_0x1ac0dc['body'],{'showHidden':![],'depth':null}));switch(_0x5edd6f[_0xb95e('0x41')]){case'twilio':if(_0x1ac0dc[_0xb95e('0x5a')][_0xb95e('0x8d')]&&_0x1ac0dc['body']['MessageSid']===_0x17db1e[_0xb95e('0x8e')]&&_0x1ac0dc[_0xb95e('0x5a')][_0xb95e('0x8f')]&&_0x1ac0dc[_0xb95e('0x5a')][_0xb95e('0x8f')]===_0xb95e('0x61')){return _0x17db1e[_0xb95e('0x38')]({'read':!![]});}else{logger[_0xb95e('0x2a')](_0xb95e('0x90'),'status','twilio',util[_0xb95e('0x8c')](_0x1ac0dc[_0xb95e('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0x17db1e;}})[_0xb95e('0x25')](respondWithResult(_0x2800fa,null))['catch'](handleError(_0x2800fa,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index a1b68d1..6ac4de7 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 _0xb248=['setMaxListeners','save','update','emit','hasOwnProperty','hook','events','WhatsappMessage'];(function(_0x4c2144,_0xe4c0b7){var _0x42d4ba=function(_0x1278ff){while(--_0x1278ff){_0x4c2144['push'](_0x4c2144['shift']());}};_0x42d4ba(++_0xe4c0b7);}(_0xb248,0xc6));var _0x8b24=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xb248[_0x3bf83f];return _0x22c4a9;};'use strict';var EventEmitter=require(_0x8b24('0x0'));var WhatsappMessage=require('../../mysqldb')['db'][_0x8b24('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x8b24('0x2')](0x0);var events={'afterCreate':_0x8b24('0x3'),'afterUpdate':_0x8b24('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1ea760){return function(_0x4438f7,_0x5d4103,_0x253441){WhatsappMessageEvents[_0x8b24('0x5')](_0x1ea760+':'+_0x4438f7['id'],_0x4438f7);WhatsappMessageEvents['emit'](_0x1ea760,_0x4438f7);_0x253441(null);};}for(var e in events){if(events[_0x8b24('0x6')](e)){var event=events[e];WhatsappMessage[_0x8b24('0x7')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file +var _0xa7fa=['events','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x4d07cc,_0x587613){var _0x42de3b=function(_0x201f78){while(--_0x201f78){_0x4d07cc['push'](_0x4d07cc['shift']());}};_0x42de3b(++_0x587613);}(_0xa7fa,0xfc));var _0xaa7f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa7fa[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0xaa7f('0x0'));var WhatsappMessage=require('../../mysqldb')['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xaa7f('0x1')](0x0);var events={'afterCreate':_0xaa7f('0x2'),'afterUpdate':_0xaa7f('0x3'),'afterDestroy':_0xaa7f('0x4')};function emitEvent(_0x5b7455){return function(_0x39fd71,_0x310190,_0xc238d5){WhatsappMessageEvents[_0xaa7f('0x5')](_0x5b7455+':'+_0x39fd71['id'],_0x39fd71);WhatsappMessageEvents['emit'](_0x5b7455,_0x39fd71);_0xc238d5(null);};}for(var e in events){if(events[_0xaa7f('0x6')](e)){var event=events[e];WhatsappMessage['hook'](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 b591b98..76ea891 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 _0x944e=['request-promise','path','exports','define','WhatsappMessage','fti_whatsapp_messages','body','models','get','direction','toLowerCase','out','secret','UserId','WhatsappInteraction','findOne','then','update','createdAt','catch','WhatsappAccount','find','WhatsappAccountId','type','twilio','authToken','phone','accountSid','messages','create','whatsapp:','remote','/api/whatsapp/messages/','token','sid','error','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1f0c9e,_0x5e0ed0){var _0x5d41d7=function(_0x3d2d66){while(--_0x3d2d66){_0x1f0c9e['push'](_0x1f0c9e['shift']());}};_0x5d41d7(++_0x5e0ed0);}(_0x944e,0xba));var _0xe944=function(_0x3502c6,_0x52a513){_0x3502c6=_0x3502c6-0x0;var _0x3fa967=_0x944e[_0x3502c6];return _0x3fa967;};'use strict';var _=require(_0xe944('0x0'));var util=require(_0xe944('0x1'));var logger=require(_0xe944('0x2'))(_0xe944('0x3'));var moment=require(_0xe944('0x4'));var BPromise=require(_0xe944('0x5'));var rp=require(_0xe944('0x6'));var fs=require('fs');var path=require(_0xe944('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./whatsappMessage.attributes');module[_0xe944('0x8')]=function(_0xf96687,_0x4bceaf){return _0xf96687[_0xe944('0x9')](_0xe944('0xa'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':'messageId','fields':['messageId']},{'name':_0xe944('0xb'),'fields':[_0xe944('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2cc658,_0x1b8497,_0x1e2fee){var _0x3f9226=_0xf96687[_0xe944('0xd')];var _0x20c896=_0x2cc658[_0xe944('0xe')]({'plain':!![]});if(_0x20c896[_0xe944('0xf')]['toLowerCase']()==='in'||_0x20c896[_0xe944('0xf')][_0xe944('0x10')]()===_0xe944('0x11')&&!_0x20c896[_0xe944('0x12')]&&!_['isNil'](_0x20c896[_0xe944('0x13')])){_0x3f9226[_0xe944('0x14')][_0xe944('0x15')]({'where':{'id':_0x20c896['WhatsappInteractionId']}})[_0xe944('0x16')](function(_0x297e71){if(_0x297e71){_0x297e71[_0xe944('0x17')]({'lastMsgAt':_0x20c896[_0xe944('0x18')],'lastMsgDirection':_0x20c896[_0xe944('0xf')][_0xe944('0x10')]()});}})[_0xe944('0x19')](function(_0x116e4c){console['error'](_0x116e4c);});}if(_0x20c896[_0xe944('0xf')]===_0xe944('0x11')&&!_0x20c896[_0xe944('0x12')]){var _0x4acef3;_0x3f9226[_0xe944('0x1a')][_0xe944('0x1b')]({'where':{'id':_0x20c896[_0xe944('0x1c')]},'raw':!![]})['then'](function(_0x2ffc57){_0x4acef3=_0x2ffc57;if(_0x4acef3&&_0x4acef3[_0xe944('0x1d')]){switch(_0x4acef3[_0xe944('0x1d')]){case _0xe944('0x1e'):var _0x2000ef=require(_0xe944('0x1e'));if(_0x4acef3['accountSid']&&_0x4acef3[_0xe944('0x1f')]&&_0x4acef3[_0xe944('0x20')]){var _0x564da9=new _0x2000ef(_0x4acef3[_0xe944('0x21')],_0x4acef3[_0xe944('0x1f')]);_0x564da9[_0xe944('0x22')][_0xe944('0x23')]({'body':_0x20c896[_0xe944('0xc')],'to':_0xe944('0x24')+_0x20c896[_0xe944('0x20')],'from':_0xe944('0x24')+_0x4acef3['phone'],'statusCallback':_0x4acef3[_0xe944('0x25')]+_0xe944('0x26')+_0x20c896['id']+'/status?token='+_0x4acef3[_0xe944('0x27')]})[_0xe944('0x16')](function(_0x1ab4b6){if(_0x1ab4b6[_0xe944('0x28')]){return _0x2cc658[_0xe944('0x17')]({'messageId':_0x1ab4b6['sid']});}})[_0xe944('0x19')](function(_0x20c2ae){logger[_0xe944('0x29')](_0xe944('0x2a'),_0xe944('0x2b'),_0xe944('0x1e'),util['inspect'](_0x20c2ae,{'showHidden':![],'depth':null}));});}else{logger[_0xe944('0x29')](_0xe944('0x2a'),_0xe944('0x2b'),'twilio',_0xe944('0x2c'));}break;}}})[_0xe944('0x2d')](function(){_0x1e2fee();});}else{_0x1e2fee();}}},'charset':_0xe944('0x2e'),'collate':_0xe944('0x2f')});}; \ No newline at end of file +var _0x4163=['UserId','findOne','WhatsappInteractionId','then','update','createdAt','error','find','WhatsappAccountId','type','twilio','accountSid','authToken','phone','messages','create','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','sid','catch','inspect','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappMessage.attributes','define','WhatsappMessage','whatsapp_messages','fti_whatsapp_messages','body','models','get','direction','toLowerCase','out','secret','isNil'];(function(_0x25e599,_0x247066){var _0x3fa964=function(_0x628a2e){while(--_0x628a2e){_0x25e599['push'](_0x25e599['shift']());}};_0x3fa964(++_0x247066);}(_0x4163,0xee));var _0x3416=function(_0x4f6ba7,_0x62acd1){_0x4f6ba7=_0x4f6ba7-0x0;var _0x141916=_0x4163[_0x4f6ba7];return _0x141916;};'use strict';var _=require(_0x3416('0x0'));var util=require(_0x3416('0x1'));var logger=require(_0x3416('0x2'))(_0x3416('0x3'));var moment=require('moment');var BPromise=require(_0x3416('0x4'));var rp=require(_0x3416('0x5'));var fs=require('fs');var path=require(_0x3416('0x6'));var rimraf=require(_0x3416('0x7'));var config=require(_0x3416('0x8'));var attributes=require(_0x3416('0x9'));module['exports']=function(_0x1bfae6,_0xeb42f4){return _0x1bfae6[_0x3416('0xa')](_0x3416('0xb'),attributes,{'tableName':_0x3416('0xc'),'paranoid':![],'indexes':[{'name':'messageId','fields':['messageId']},{'name':_0x3416('0xd'),'fields':[_0x3416('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x126290,_0xc74a4,_0x2cf29e){var _0x4ef587=_0x1bfae6[_0x3416('0xf')];var _0x6777b1=_0x126290[_0x3416('0x10')]({'plain':!![]});if(_0x6777b1[_0x3416('0x11')][_0x3416('0x12')]()==='in'||_0x6777b1[_0x3416('0x11')]['toLowerCase']()===_0x3416('0x13')&&!_0x6777b1[_0x3416('0x14')]&&!_[_0x3416('0x15')](_0x6777b1[_0x3416('0x16')])){_0x4ef587['WhatsappInteraction'][_0x3416('0x17')]({'where':{'id':_0x6777b1[_0x3416('0x18')]}})[_0x3416('0x19')](function(_0x5e15b5){if(_0x5e15b5){_0x5e15b5[_0x3416('0x1a')]({'lastMsgAt':_0x6777b1[_0x3416('0x1b')],'lastMsgDirection':_0x6777b1[_0x3416('0x11')][_0x3416('0x12')]()});}})['catch'](function(_0x3d8c21){console[_0x3416('0x1c')](_0x3d8c21);});}if(_0x6777b1[_0x3416('0x11')]===_0x3416('0x13')&&!_0x6777b1[_0x3416('0x14')]){var _0x2f946f;_0x4ef587['WhatsappAccount'][_0x3416('0x1d')]({'where':{'id':_0x6777b1[_0x3416('0x1e')]},'raw':!![]})[_0x3416('0x19')](function(_0x516f29){_0x2f946f=_0x516f29;if(_0x2f946f&&_0x2f946f['type']){switch(_0x2f946f[_0x3416('0x1f')]){case _0x3416('0x20'):var _0x44f2d1=require('twilio');if(_0x2f946f[_0x3416('0x21')]&&_0x2f946f[_0x3416('0x22')]&&_0x2f946f[_0x3416('0x23')]){var _0x3b0e23=new _0x44f2d1(_0x2f946f['accountSid'],_0x2f946f[_0x3416('0x22')]);_0x3b0e23[_0x3416('0x24')][_0x3416('0x25')]({'body':_0x6777b1[_0x3416('0xe')],'to':'whatsapp:'+_0x6777b1[_0x3416('0x23')],'from':_0x3416('0x26')+_0x2f946f['phone'],'statusCallback':_0x2f946f[_0x3416('0x27')]+_0x3416('0x28')+_0x6777b1['id']+_0x3416('0x29')+_0x2f946f[_0x3416('0x2a')]})[_0x3416('0x19')](function(_0xef962c){if(_0xef962c[_0x3416('0x2b')]){return _0x126290[_0x3416('0x1a')]({'messageId':_0xef962c['sid']});}})[_0x3416('0x2c')](function(_0x36353a){logger[_0x3416('0x1c')]('WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x3416('0x20'),util[_0x3416('0x2d')](_0x36353a,{'showHidden':![],'depth':null}));});}else{logger[_0x3416('0x1c')](_0x3416('0x2e'),_0x3416('0x2f'),_0x3416('0x20'),_0x3416('0x30'));}break;}}})[_0x3416('0x31')](function(){_0x2cf29e();});}else{_0x2cf29e();}}},'charset':_0x3416('0x32'),'collate':_0x3416('0x33')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index f724af1..337ba28 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 _0xaf59=['../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','info','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','WhatsappMessage,\x20%s,\x20%s','result','catch','CreateWhatsappMessage','WhatsappMessage','create','options','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0xaf59,0x15a));var _0x9af5=function(_0x5976f8,_0x1265b7){_0x5976f8=_0x5976f8-0x0;var _0x179715=_0xaf59[_0x5976f8];return _0x179715;};'use strict';var _=require(_0x9af5('0x0'));var util=require(_0x9af5('0x1'));var moment=require(_0x9af5('0x2'));var BPromise=require(_0x9af5('0x3'));var rs=require(_0x9af5('0x4'));var fs=require('fs');var Redis=require(_0x9af5('0x5'));var db=require(_0x9af5('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9af5('0x7'))(_0x9af5('0x8'));var config=require('../../config/environment');var jayson=require(_0x9af5('0x9'));var client=jayson[_0x9af5('0xa')][_0x9af5('0xb')]({'port':0x232a});config[_0x9af5('0xc')]=_[_0x9af5('0xd')](config[_0x9af5('0xc')],{'host':_0x9af5('0xe'),'port':0x18eb});var socket=require(_0x9af5('0xf'))(new Redis(config[_0x9af5('0xc')]));require('./whatsappMessage.socket')[_0x9af5('0x10')](socket);function respondWithRpcPromise(_0x43d46e,_0x353556,_0x4c0851){return new BPromise(function(_0x2a603a,_0x58a20f){return client[_0x9af5('0x11')](_0x43d46e,_0x4c0851)['then'](function(_0x125017){logger[_0x9af5('0x12')]('WhatsappMessage,\x20%s,\x20%s',_0x353556,_0x9af5('0x13'));logger[_0x9af5('0x14')](_0x9af5('0x15'),_0x353556,'request\x20sent',JSON[_0x9af5('0x16')](_0x125017));if(_0x125017[_0x9af5('0x17')]){if(_0x125017[_0x9af5('0x17')]['code']===0x1f4){logger[_0x9af5('0x17')]('WhatsappMessage,\x20%s,\x20%s',_0x353556,_0x125017['error'][_0x9af5('0x18')]);return _0x58a20f(_0x125017[_0x9af5('0x17')][_0x9af5('0x18')]);}logger[_0x9af5('0x17')](_0x9af5('0x19'),_0x353556,_0x125017[_0x9af5('0x17')][_0x9af5('0x18')]);return _0x2a603a(_0x125017[_0x9af5('0x17')][_0x9af5('0x18')]);}else{logger[_0x9af5('0x12')](_0x9af5('0x19'),_0x353556,_0x9af5('0x13'));_0x2a603a(_0x125017[_0x9af5('0x1a')][_0x9af5('0x18')]);}})[_0x9af5('0x1b')](function(_0x4bbaa6){logger['error'](_0x9af5('0x19'),_0x353556,_0x4bbaa6);_0x58a20f(_0x4bbaa6);});});}exports[_0x9af5('0x1c')]=function(_0x27b031){var _0x5b3055=this;return new Promise(function(_0x1e79c7,_0x27d719){return db[_0x9af5('0x1d')][_0x9af5('0x1e')](_0x27b031['body'],{'raw':_0x27b031['options']?_0x27b031[_0x9af5('0x1f')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x158503){logger['info'](_0x9af5('0x1c'),_0x27b031);logger[_0x9af5('0x14')](_0x9af5('0x1c'),_0x27b031,JSON[_0x9af5('0x16')](_0x158503));_0x1e79c7(_0x158503);})[_0x9af5('0x1b')](function(_0x3b939b){logger[_0x9af5('0x17')](_0x9af5('0x1c'),_0x3b939b[_0x9af5('0x18')],_0x27b031);_0x27d719(_0x5b3055[_0x9af5('0x17')](0x1f4,_0x3b939b['message']));});});}; \ No newline at end of file +var _0x66d8=['info','result','WhatsappMessage','create','options','then','CreateWhatsappMessage','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','request','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3ab7b6,_0x89006){var _0x335e89=function(_0x11a2b5){while(--_0x11a2b5){_0x3ab7b6['push'](_0x3ab7b6['shift']());}};_0x335e89(++_0x89006);}(_0x66d8,0x9e));var _0x866d=function(_0x1cb0b4,_0x1fd48d){_0x1cb0b4=_0x1cb0b4-0x0;var _0x525b60=_0x66d8[_0x1cb0b4];return _0x525b60;};'use strict';var _=require(_0x866d('0x0'));var util=require(_0x866d('0x1'));var moment=require(_0x866d('0x2'));var BPromise=require(_0x866d('0x3'));var rs=require(_0x866d('0x4'));var fs=require('fs');var Redis=require(_0x866d('0x5'));var db=require(_0x866d('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x866d('0x7')]=_[_0x866d('0x8')](config[_0x866d('0x7')],{'host':_0x866d('0x9'),'port':0x18eb});var socket=require(_0x866d('0xa'))(new Redis(config[_0x866d('0x7')]));require(_0x866d('0xb'))[_0x866d('0xc')](socket);function respondWithRpcPromise(_0x42f556,_0x3efadb,_0x3bb602){return new BPromise(function(_0x45697e,_0x56e630){return client[_0x866d('0xd')](_0x42f556,_0x3bb602)['then'](function(_0x4c98a0){logger['info'](_0x866d('0xe'),_0x3efadb,_0x866d('0xf'));logger[_0x866d('0x10')](_0x866d('0x11'),_0x3efadb,_0x866d('0xf'),JSON[_0x866d('0x12')](_0x4c98a0));if(_0x4c98a0[_0x866d('0x13')]){if(_0x4c98a0[_0x866d('0x13')][_0x866d('0x14')]===0x1f4){logger[_0x866d('0x13')](_0x866d('0xe'),_0x3efadb,_0x4c98a0[_0x866d('0x13')][_0x866d('0x15')]);return _0x56e630(_0x4c98a0[_0x866d('0x13')][_0x866d('0x15')]);}logger[_0x866d('0x13')]('WhatsappMessage,\x20%s,\x20%s',_0x3efadb,_0x4c98a0[_0x866d('0x13')][_0x866d('0x15')]);return _0x45697e(_0x4c98a0[_0x866d('0x13')]['message']);}else{logger[_0x866d('0x16')](_0x866d('0xe'),_0x3efadb,_0x866d('0xf'));_0x45697e(_0x4c98a0[_0x866d('0x17')][_0x866d('0x15')]);}})['catch'](function(_0x2ad3ce){logger[_0x866d('0x13')](_0x866d('0xe'),_0x3efadb,_0x2ad3ce);_0x56e630(_0x2ad3ce);});});}exports['CreateWhatsappMessage']=function(_0xb0bef4){var _0x4f37e4=this;return new Promise(function(_0x1d1e4e,_0x589337){return db[_0x866d('0x18')][_0x866d('0x19')](_0xb0bef4['body'],{'raw':_0xb0bef4[_0x866d('0x1a')]?_0xb0bef4[_0x866d('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x866d('0x1b')](function(_0x33eaa9){logger['info'](_0x866d('0x1c'),_0xb0bef4);logger['debug'](_0x866d('0x1c'),_0xb0bef4,JSON[_0x866d('0x12')](_0x33eaa9));_0x1d1e4e(_0x33eaa9);})[_0x866d('0x1d')](function(_0x289b8c){logger[_0x866d('0x13')]('CreateWhatsappMessage',_0x289b8c[_0x866d('0x15')],_0xb0bef4);_0x589337(_0x4f37e4['error'](0x1f4,_0x289b8c['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 24b3bd3..c2039ea 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 _0xfe0b=['./whatsappMessage.events','save','remove','update','whatsappMessage:'];(function(_0x1bff67,_0x357008){var _0x9eb25e=function(_0x443089){while(--_0x443089){_0x1bff67['push'](_0x1bff67['shift']());}};_0x9eb25e(++_0x357008);}(_0xfe0b,0x136));var _0xbfe0=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xfe0b[_0x17d9e3];return _0x14192d;};'use strict';var WhatsappMessageEvents=require(_0xbfe0('0x0'));var events=[_0xbfe0('0x1'),_0xbfe0('0x2'),_0xbfe0('0x3')];function createListener(_0x4c959f,_0x9cb704){return function(_0x856275){_0x9cb704['emit'](_0x4c959f,_0x856275);};}function removeListener(_0x14433a,_0x33ddec){return function(){WhatsappMessageEvents['removeListener'](_0x14433a,_0x33ddec);};}exports['register']=function(_0x2a027d){for(var _0x3bc41f=0x0,_0x55dd5b=events['length'];_0x3bc41f<_0x55dd5b;_0x3bc41f++){var _0x3a92e4=events[_0x3bc41f];var _0x5d9280=createListener(_0xbfe0('0x4')+_0x3a92e4,_0x2a027d);WhatsappMessageEvents['on'](_0x3a92e4,_0x5d9280);}}; \ No newline at end of file +var _0x6b79=['whatsappMessage:','./whatsappMessage.events','save','remove','update','removeListener','register','length'];(function(_0x192add,_0x4490e4){var _0x1b9d9d=function(_0x55084d){while(--_0x55084d){_0x192add['push'](_0x192add['shift']());}};_0x1b9d9d(++_0x4490e4);}(_0x6b79,0xb9));var _0x96b7=function(_0x16794b,_0x310842){_0x16794b=_0x16794b-0x0;var _0x58cb19=_0x6b79[_0x16794b];return _0x58cb19;};'use strict';var WhatsappMessageEvents=require(_0x96b7('0x0'));var events=[_0x96b7('0x1'),_0x96b7('0x2'),_0x96b7('0x3')];function createListener(_0x421a98,_0xc422b2){return function(_0x49132f){_0xc422b2['emit'](_0x421a98,_0x49132f);};}function removeListener(_0x5136ff,_0x4e4cc6){return function(){WhatsappMessageEvents[_0x96b7('0x4')](_0x5136ff,_0x4e4cc6);};}exports[_0x96b7('0x5')]=function(_0x4dc28f){for(var _0x4c4235=0x0,_0x34b3ba=events[_0x96b7('0x6')];_0x4c4235<_0x34b3ba;_0x4c4235++){var _0x16a835=events[_0x4c4235];var _0x37f5a3=createListener(_0x96b7('0x7')+_0x16a835,_0x4dc28f);WhatsappMessageEvents['on'](_0x16a835,_0x37f5a3);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 0796e93..5b5c5b9 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 _0x9faf=['create','addAgents','put','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index','show','/:id/members','getMembers','/:id/teams','/:id/users','post'];(function(_0x95c12a,_0x10612f){var _0x246c9b=function(_0x2c9983){while(--_0x2c9983){_0x95c12a['push'](_0x95c12a['shift']());}};_0x246c9b(++_0x10612f);}(_0x9faf,0x10d));var _0xf9fa=function(_0x590921,_0x5452f8){_0x590921=_0x590921-0x0;var _0x236b9c=_0x9faf[_0x590921];return _0x236b9c;};'use strict';var multer=require('multer');var util=require(_0xf9fa('0x0'));var path=require(_0xf9fa('0x1'));var timeout=require(_0xf9fa('0x2'));var express=require(_0xf9fa('0x3'));var router=express[_0xf9fa('0x4')]();var fs_extra=require(_0xf9fa('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf9fa('0x6'));var controller=require(_0xf9fa('0x7'));router[_0xf9fa('0x8')]('/',auth[_0xf9fa('0x9')](),controller[_0xf9fa('0xa')]);router[_0xf9fa('0x8')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0xf9fa('0x9')](),controller[_0xf9fa('0xb')]);router[_0xf9fa('0x8')](_0xf9fa('0xc'),auth[_0xf9fa('0x9')](),controller[_0xf9fa('0xd')]);router[_0xf9fa('0x8')](_0xf9fa('0xe'),auth[_0xf9fa('0x9')](),controller['getTeams']);router[_0xf9fa('0x8')](_0xf9fa('0xf'),auth[_0xf9fa('0x9')](),controller['getAgents']);router[_0xf9fa('0x10')]('/',auth[_0xf9fa('0x9')](),controller[_0xf9fa('0x11')]);router['post']('/:id/teams',auth[_0xf9fa('0x9')](),controller['addTeams']);router[_0xf9fa('0x10')](_0xf9fa('0xf'),auth[_0xf9fa('0x9')](),controller[_0xf9fa('0x12')]);router[_0xf9fa('0x13')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0xf9fa('0x9')](),controller['destroy']);router[_0xf9fa('0x14')](_0xf9fa('0xe'),auth[_0xf9fa('0x9')](),controller['removeTeams']);router['delete']('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0xf9fa('0x15')]=router; \ No newline at end of file +var _0x6f9a=['isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','put','update','delete','destroy','removeTeams','exports','util','path','connect-timeout','express','Router','../../components/auth/service','./whatsappQueue.controller','get','index'];(function(_0x472a76,_0x4182d1){var _0x4f92e1=function(_0x577d6f){while(--_0x577d6f){_0x472a76['push'](_0x472a76['shift']());}};_0x4f92e1(++_0x4182d1);}(_0x6f9a,0x147));var _0xa6f9=function(_0x418274,_0x31d1fb){_0x418274=_0x418274-0x0;var _0x372217=_0x6f9a[_0x418274];return _0x372217;};'use strict';var multer=require('multer');var util=require(_0xa6f9('0x0'));var path=require(_0xa6f9('0x1'));var timeout=require(_0xa6f9('0x2'));var express=require(_0xa6f9('0x3'));var router=express[_0xa6f9('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa6f9('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa6f9('0x6'));router[_0xa6f9('0x7')]('/',auth['isAuthenticated'](),controller[_0xa6f9('0x8')]);router[_0xa6f9('0x7')]('/describe',auth[_0xa6f9('0x9')](),controller[_0xa6f9('0xa')]);router[_0xa6f9('0x7')](_0xa6f9('0xb'),auth[_0xa6f9('0x9')](),controller[_0xa6f9('0xc')]);router[_0xa6f9('0x7')](_0xa6f9('0xd'),auth[_0xa6f9('0x9')](),controller[_0xa6f9('0xe')]);router[_0xa6f9('0x7')](_0xa6f9('0xf'),auth[_0xa6f9('0x9')](),controller[_0xa6f9('0x10')]);router[_0xa6f9('0x7')](_0xa6f9('0x11'),auth[_0xa6f9('0x9')](),controller[_0xa6f9('0x12')]);router[_0xa6f9('0x13')]('/',auth[_0xa6f9('0x9')](),controller[_0xa6f9('0x14')]);router[_0xa6f9('0x13')](_0xa6f9('0xf'),auth['isAuthenticated'](),controller[_0xa6f9('0x15')]);router[_0xa6f9('0x13')](_0xa6f9('0x11'),auth[_0xa6f9('0x9')](),controller['addAgents']);router[_0xa6f9('0x16')](_0xa6f9('0xb'),auth[_0xa6f9('0x9')](),controller[_0xa6f9('0x17')]);router[_0xa6f9('0x18')](_0xa6f9('0xb'),auth[_0xa6f9('0x9')](),controller[_0xa6f9('0x19')]);router['delete'](_0xa6f9('0xf'),auth[_0xa6f9('0x9')](),controller[_0xa6f9('0x1a')]);router['delete'](_0xa6f9('0x11'),auth['isAuthenticated'](),controller['removeAgents']);module[_0xa6f9('0x1b')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index d957e4d..d337928 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 _0x833b=['name','ENUM','beepall','roundrobin','STRING','exports'];(function(_0x245594,_0x3b9773){var _0x5c7073=function(_0x152ab3){while(--_0x152ab3){_0x245594['push'](_0x245594['shift']());}};_0x5c7073(++_0x3b9773);}(_0x833b,0x131));var _0xb833=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x833b[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require('sequelize');module[_0xb833('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xb833('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb833('0x2')]('rrmemory',_0xb833('0x3'),_0xb833('0x4'))},'description':{'type':Sequelize[_0xb833('0x5')]}}; \ No newline at end of file +var _0x0f9f=['name','ENUM','rrmemory','beepall','roundrobin','exports','STRING'];(function(_0x12b1e8,_0x33faa9){var _0xd662f=function(_0x1258b3){while(--_0x1258b3){_0x12b1e8['push'](_0x12b1e8['shift']());}};_0xd662f(++_0x33faa9);}(_0x0f9f,0x1cc));var _0xf0f9=function(_0x2f3f3a,_0x574a87){_0x2f3f3a=_0x2f3f3a-0x0;var _0x4c0485=_0x0f9f[_0x2f3f3a];return _0x4c0485;};'use strict';var Sequelize=require('sequelize');module[_0xf0f9('0x0')]={'name':{'type':Sequelize[_0xf0f9('0x1')],'unique':_0xf0f9('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xf0f9('0x3')](_0xf0f9('0x4'),_0xf0f9('0x5'),_0xf0f9('0x6'))},'description':{'type':Sequelize[_0xf0f9('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index b7aaa5f..b98e60c 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 _0x9d5f=['api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','WhatsappQueues','UserProfileResource','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','WhatsappQueue','includeAll','findAll','rows','params','length','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','catch','describe','getMembers','UserWhatsappQueue','WhatsappQueueId','findAndCountAll','UserId','agent','whatsappPause','updatedAt','format','%s/%s','SIP','getTeams','findOne','Team','addTeams','User','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','emit','userWhatsappQueue:save','removeTeams','ids','select','from','team_has_whatsapp_queues','join','user_has_teams','WhatsappQueueId\x20=\x20?','clone','push','toString','SELECT','every','all','union','compact','value','isEmpty','forEach','userWhatsappQueue:remove','addAgents','omit','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x245d61,_0xba5581){var _0x400372=function(_0x462739){while(--_0x462739){_0x245d61['push'](_0x245d61['shift']());}};_0x400372(++_0xba5581);}(_0x9d5f,0x7c));var _0xf9d5=function(_0x5e40be,_0x512411){_0x5e40be=_0x5e40be-0x0;var _0xbcdeb1=_0x9d5f[_0x5e40be];return _0xbcdeb1;};'use strict';var emlformat=require(_0xf9d5('0x0'));var rimraf=require(_0xf9d5('0x1'));var zipdir=require(_0xf9d5('0x2'));var jsonpatch=require(_0xf9d5('0x3'));var rp=require(_0xf9d5('0x4'));var moment=require('moment');var BPromise=require(_0xf9d5('0x5'));var Mustache=require('mustache');var util=require(_0xf9d5('0x6'));var path=require(_0xf9d5('0x7'));var sox=require('sox');var csv=require(_0xf9d5('0x8'));var ejs=require(_0xf9d5('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf9d5('0xa'));var squel=require(_0xf9d5('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf9d5('0xc'));var toCsv=require('to-csv');var querystring=require(_0xf9d5('0xd'));var Papa=require(_0xf9d5('0xe'));var Redis=require(_0xf9d5('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf9d5('0x10'));var as=require(_0xf9d5('0x11'));var hardwareService=require(_0xf9d5('0x12'));var logger=require(_0xf9d5('0x13'))(_0xf9d5('0x14'));var utils=require(_0xf9d5('0x15'));var config=require(_0xf9d5('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xf9d5('0x17'))['db'];config[_0xf9d5('0x18')]=_[_0xf9d5('0x19')](config[_0xf9d5('0x18')],{'host':_0xf9d5('0x1a'),'port':0x18eb});var socket=require(_0xf9d5('0x1b'))(new Redis(config[_0xf9d5('0x18')]));require(_0xf9d5('0x1c'))[_0xf9d5('0x1d')](socket);function respondWithStatusCode(_0x53d88a,_0x5794e0){_0x5794e0=_0x5794e0||0xcc;return function(_0x524c07){if(_0x524c07){return _0x53d88a['sendStatus'](_0x5794e0);}return _0x53d88a[_0xf9d5('0x1e')](_0x5794e0)['end']();};}function respondWithResult(_0x13c25f,_0x5956b1){_0x5956b1=_0x5956b1||0xc8;return function(_0x125bb0){if(_0x125bb0){return _0x13c25f[_0xf9d5('0x1e')](_0x5956b1)[_0xf9d5('0x1f')](_0x125bb0);}};}function respondWithFilteredResult(_0x3f840b,_0x28dea1){return function(_0x2256df){if(_0x2256df){var _0x336b22=typeof _0x28dea1[_0xf9d5('0x20')]===_0xf9d5('0x21')&&typeof _0x28dea1[_0xf9d5('0x22')]===_0xf9d5('0x21');var _0xe25618=_0x2256df[_0xf9d5('0x23')];var _0x3f724c=_0x336b22?0x0:_0x28dea1['offset'];var _0x1652b6=_0x336b22?_0x2256df[_0xf9d5('0x23')]:_0x28dea1[_0xf9d5('0x20')]+_0x28dea1[_0xf9d5('0x22')];var _0x24f73a;if(_0x1652b6>=_0xe25618){_0x1652b6=_0xe25618;_0x24f73a=0xc8;}else{_0x24f73a=0xce;}_0x3f840b['status'](_0x24f73a);return _0x3f840b[_0xf9d5('0x24')](_0xf9d5('0x25'),_0x3f724c+'-'+_0x1652b6+'/'+_0xe25618)['json'](_0x2256df);}return null;};}function patchUpdates(_0x807e57){return function(_0x46ff60){try{jsonpatch[_0xf9d5('0x26')](_0x46ff60,_0x807e57,!![]);}catch(_0xfe3db5){return BPromise[_0xf9d5('0x27')](_0xfe3db5);}return _0x46ff60[_0xf9d5('0x28')]();};}function saveUpdates(_0x129932,_0x90e68c){return function(_0x3a135f){if(_0x3a135f){return _0x3a135f[_0xf9d5('0x29')](_0x129932)[_0xf9d5('0x2a')](function(_0x21f836){return _0x21f836;});}return null;};}function removeEntity(_0x40c34e,_0x399fc8){return function(_0xdcc44e){if(_0xdcc44e){return _0xdcc44e[_0xf9d5('0x2b')]()[_0xf9d5('0x2a')](function(){var _0x13dc31=_0xdcc44e[_0xf9d5('0x2c')]({'plain':!![]});var _0x4d0fea=_0xf9d5('0x2d');return db[_0xf9d5('0x2e')][_0xf9d5('0x2b')]({'where':{'type':_0x4d0fea,'resourceId':_0x13dc31['id']}})[_0xf9d5('0x2a')](function(){return _0xdcc44e;});})[_0xf9d5('0x2a')](function(){_0x40c34e[_0xf9d5('0x1e')](0xcc)[_0xf9d5('0x2f')]();});}};}function handleEntityNotFound(_0x2db3eb,_0x37ff65){return function(_0x219b00){if(!_0x219b00){_0x2db3eb['sendStatus'](0x194);}return _0x219b00;};}function handleError(_0x37b51e,_0x45b861){_0x45b861=_0x45b861||0x1f4;return function(_0x2cab45){logger[_0xf9d5('0x30')](_0x2cab45[_0xf9d5('0x31')]);if(_0x2cab45['name']){delete _0x2cab45[_0xf9d5('0x32')];}_0x37b51e[_0xf9d5('0x1e')](_0x45b861)[_0xf9d5('0x33')](_0x2cab45);};}exports[_0xf9d5('0x34')]=function(_0x10bf36,_0x369995){var _0x5006c9={},_0x5f1ae9={},_0x41acb5={'count':0x0,'rows':[]};var _0xf13c3=_[_0xf9d5('0x35')](db['WhatsappQueue'][_0xf9d5('0x36')],function(_0x3e0f6d){return{'name':_0x3e0f6d[_0xf9d5('0x37')],'type':_0x3e0f6d[_0xf9d5('0x38')][_0xf9d5('0x39')]};});_0x5f1ae9[_0xf9d5('0x3a')]=_[_0xf9d5('0x35')](_0xf13c3,_0xf9d5('0x32'));_0x5f1ae9['query']=_[_0xf9d5('0x3b')](_0x10bf36[_0xf9d5('0x3c')]);_0x5f1ae9[_0xf9d5('0x3d')]=_[_0xf9d5('0x3e')](_0x5f1ae9[_0xf9d5('0x3a')],_0x5f1ae9['query']);_0x5006c9[_0xf9d5('0x3f')]=_[_0xf9d5('0x3e')](_0x5f1ae9['model'],qs[_0xf9d5('0x40')](_0x10bf36[_0xf9d5('0x3c')]['fields']));_0x5006c9[_0xf9d5('0x3f')]=_0x5006c9['attributes']['length']?_0x5006c9[_0xf9d5('0x3f')]:_0x5f1ae9[_0xf9d5('0x3a')];if(!_0x10bf36[_0xf9d5('0x3c')][_0xf9d5('0x41')](_0xf9d5('0x42'))){_0x5006c9['limit']=qs[_0xf9d5('0x22')](_0x10bf36[_0xf9d5('0x3c')][_0xf9d5('0x22')]);_0x5006c9[_0xf9d5('0x20')]=qs[_0xf9d5('0x20')](_0x10bf36['query'][_0xf9d5('0x20')]);}_0x5006c9[_0xf9d5('0x43')]=qs[_0xf9d5('0x44')](_0x10bf36[_0xf9d5('0x3c')][_0xf9d5('0x44')]);_0x5006c9[_0xf9d5('0x45')]=qs[_0xf9d5('0x3d')](_[_0xf9d5('0x46')](_0x10bf36[_0xf9d5('0x3c')],_0x5f1ae9['filters']),_0xf13c3);if(_0x10bf36[_0xf9d5('0x3c')][_0xf9d5('0x47')]){_0x5006c9['where']=_[_0xf9d5('0x48')](_0x5006c9[_0xf9d5('0x45')],{'$or':_[_0xf9d5('0x35')](_0xf13c3,function(_0x2a3022){if(_0x2a3022[_0xf9d5('0x38')]!==_0xf9d5('0x49')){var _0x18d84c={};_0x18d84c[_0x2a3022[_0xf9d5('0x32')]]={'$like':'%'+_0x10bf36[_0xf9d5('0x3c')][_0xf9d5('0x47')]+'%'};return _0x18d84c;}})});}_0x5006c9=_[_0xf9d5('0x48')]({},_0x5006c9,_0x10bf36[_0xf9d5('0x4a')]);var _0x19a572={'where':_0x5006c9[_0xf9d5('0x45')]};return db[_0xf9d5('0x4b')][_0xf9d5('0x23')](_0x19a572)['then'](function(_0x17ac13){_0x41acb5[_0xf9d5('0x23')]=_0x17ac13;if(_0x10bf36[_0xf9d5('0x3c')][_0xf9d5('0x4c')]){_0x5006c9['include']=[{'all':!![]}];}return db[_0xf9d5('0x4b')][_0xf9d5('0x4d')](_0x5006c9);})['then'](function(_0x465ee2){_0x41acb5[_0xf9d5('0x4e')]=_0x465ee2;return _0x41acb5;})[_0xf9d5('0x2a')](respondWithFilteredResult(_0x369995,_0x5006c9))['catch'](handleError(_0x369995,null));};exports['show']=function(_0x5c4598,_0x16d106){var _0x26be38={'raw':!![],'where':{'id':_0x5c4598[_0xf9d5('0x4f')]['id']}},_0x34f66b={};_0x34f66b[_0xf9d5('0x3a')]=_[_0xf9d5('0x3b')](db[_0xf9d5('0x4b')]['rawAttributes']);_0x34f66b[_0xf9d5('0x3c')]=_[_0xf9d5('0x3b')](_0x5c4598[_0xf9d5('0x3c')]);_0x34f66b['filters']=_['intersection'](_0x34f66b[_0xf9d5('0x3a')],_0x34f66b[_0xf9d5('0x3c')]);_0x26be38[_0xf9d5('0x3f')]=_['intersection'](_0x34f66b[_0xf9d5('0x3a')],qs['fields'](_0x5c4598[_0xf9d5('0x3c')][_0xf9d5('0x40')]));_0x26be38['attributes']=_0x26be38[_0xf9d5('0x3f')][_0xf9d5('0x50')]?_0x26be38[_0xf9d5('0x3f')]:_0x34f66b[_0xf9d5('0x3a')];if(_0x5c4598['query'][_0xf9d5('0x4c')]){_0x26be38[_0xf9d5('0x51')]=[{'all':!![]}];}_0x26be38=_[_0xf9d5('0x48')]({},_0x26be38,_0x5c4598[_0xf9d5('0x4a')]);return db['WhatsappQueue'][_0xf9d5('0x52')](_0x26be38)['then'](handleEntityNotFound(_0x16d106,null))['then'](respondWithResult(_0x16d106,null))['catch'](handleError(_0x16d106,null));};exports[_0xf9d5('0x53')]=function(_0x5817be,_0x19e956){return db[_0xf9d5('0x4b')]['create'](_0x5817be[_0xf9d5('0x54')],{})['then'](function(_0x3544bc){var _0x1cc2f6=_0x5817be['user'][_0xf9d5('0x2c')]({'plain':!![]});if(!_0x1cc2f6)throw new Error(_0xf9d5('0x55'));if(_0x1cc2f6[_0xf9d5('0x56')]===_0xf9d5('0x57')){var _0x569e98=_0x3544bc[_0xf9d5('0x2c')]({'plain':!![]});var _0x240de2='WhatsappQueues';return db[_0xf9d5('0x58')][_0xf9d5('0x52')]({'where':{'name':_0x240de2,'userProfileId':_0x1cc2f6['userProfileId']},'raw':!![]})['then'](function(_0x18e4b6){if(_0x18e4b6&&_0x18e4b6[_0xf9d5('0x59')]===0x0){return db['UserProfileResource'][_0xf9d5('0x53')]({'name':_0x569e98[_0xf9d5('0x32')],'resourceId':_0x569e98['id'],'type':_0x18e4b6[_0xf9d5('0x32')],'sectionId':_0x18e4b6['id']},{})[_0xf9d5('0x2a')](function(){return _0x3544bc;});}else{return _0x3544bc;}})[_0xf9d5('0x5a')](function(_0x483a80){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x483a80);throw _0x483a80;});}return _0x3544bc;})['then'](respondWithResult(_0x19e956,0xc9))['catch'](handleError(_0x19e956,null));};exports[_0xf9d5('0x29')]=function(_0x4a7e4d,_0x4ac180){if(_0x4a7e4d[_0xf9d5('0x54')]['id']){delete _0x4a7e4d[_0xf9d5('0x54')]['id'];}return db[_0xf9d5('0x4b')]['find']({'where':{'id':_0x4a7e4d[_0xf9d5('0x4f')]['id']}})[_0xf9d5('0x2a')](handleEntityNotFound(_0x4ac180,null))[_0xf9d5('0x2a')](saveUpdates(_0x4a7e4d[_0xf9d5('0x54')],null))[_0xf9d5('0x2a')](respondWithResult(_0x4ac180,null))[_0xf9d5('0x5a')](handleError(_0x4ac180,null));};exports[_0xf9d5('0x2b')]=function(_0x356b99,_0x1d4b2d){return db[_0xf9d5('0x4b')][_0xf9d5('0x52')]({'where':{'id':_0x356b99[_0xf9d5('0x4f')]['id']}})[_0xf9d5('0x2a')](handleEntityNotFound(_0x1d4b2d,null))['then'](removeEntity(_0x1d4b2d,null))[_0xf9d5('0x5a')](handleError(_0x1d4b2d,null));};exports['describe']=function(_0x4de297,_0x280a6d){return db[_0xf9d5('0x4b')][_0xf9d5('0x5b')]()[_0xf9d5('0x2a')](respondWithResult(_0x280a6d,null))[_0xf9d5('0x5a')](handleError(_0x280a6d,null));};exports[_0xf9d5('0x5c')]=function(_0x289763,_0x244fb1,_0x4d8112){var _0x519919={'raw':!![],'where':{}},_0x59558b={},_0x24f7b6;return db['WhatsappQueue']['findOne']({'where':{'id':_0x289763[_0xf9d5('0x4f')]['id']}})[_0xf9d5('0x2a')](handleEntityNotFound(_0x244fb1,null))[_0xf9d5('0x2a')](function(_0x3178f6){if(_0x3178f6){_0x24f7b6=_0x3178f6[_0xf9d5('0x2c')]({'plain':!![]});_0x59558b[_0xf9d5('0x3a')]=_[_0xf9d5('0x3b')](db[_0xf9d5('0x5d')]['rawAttributes']);_0x59558b[_0xf9d5('0x3c')]=_['keys'](_0x289763['query']);_0x59558b['filters']=_[_0xf9d5('0x3e')](_0x59558b[_0xf9d5('0x3a')],_0x59558b['query']);_0x519919[_0xf9d5('0x3f')]=_[_0xf9d5('0x3e')](_0x59558b[_0xf9d5('0x3a')],qs[_0xf9d5('0x40')](_0x289763[_0xf9d5('0x3c')]['fields']));_0x519919[_0xf9d5('0x3f')]=_0x519919[_0xf9d5('0x3f')][_0xf9d5('0x50')]?_0x519919[_0xf9d5('0x3f')]:_0x59558b[_0xf9d5('0x3a')];if(!_0x289763[_0xf9d5('0x3c')][_0xf9d5('0x41')]('nolimit')){_0x519919['limit']=qs[_0xf9d5('0x22')](_0x289763[_0xf9d5('0x3c')][_0xf9d5('0x22')]);_0x519919[_0xf9d5('0x20')]=qs[_0xf9d5('0x20')](_0x289763[_0xf9d5('0x3c')][_0xf9d5('0x20')]);}_0x519919[_0xf9d5('0x43')]=qs['sort'](_0x289763[_0xf9d5('0x3c')][_0xf9d5('0x44')]);_0x519919[_0xf9d5('0x45')]=qs['filters'](_['pick'](_0x289763[_0xf9d5('0x3c')],_0x59558b[_0xf9d5('0x3d')]));_0x519919['where'][_0xf9d5('0x5e')]=_0x3178f6['id'];if(_0x289763[_0xf9d5('0x3c')][_0xf9d5('0x47')]){_0x519919[_0xf9d5('0x45')]=_[_0xf9d5('0x48')](_0x519919[_0xf9d5('0x45')],{'$or':_[_0xf9d5('0x35')](_0x519919['attributes'],function(_0x41690b){var _0x2ae3ba={};_0x2ae3ba[_0x41690b]={'$like':'%'+_0x289763[_0xf9d5('0x3c')][_0xf9d5('0x47')]+'%'};return _0x2ae3ba;})});}_0x519919=_[_0xf9d5('0x48')]({},_0x519919,_0x289763['options']);return db[_0xf9d5('0x5d')][_0xf9d5('0x4d')](_0x519919);}})['then'](function(_0x1d8175){if(_0x1d8175){return db['User'][_0xf9d5('0x5f')]({'where':{'id':_[_0xf9d5('0x35')](_0x1d8175,_0xf9d5('0x60')),'role':_0xf9d5('0x61')},'attributes':['id',_0xf9d5('0x32'),_0xf9d5('0x62'),_0xf9d5('0x63'),'createdAt']});}})[_0xf9d5('0x2a')](function(_0x169a41){if(_0x169a41){return{'count':_0x169a41[_0xf9d5('0x23')],'rows':_[_0xf9d5('0x35')](_0x169a41[_0xf9d5('0x4e')],function(_0x45b139){return{'membername':_0x45b139[_0xf9d5('0x32')],'UserId':_0x45b139['id'],'queue_name':_0x24f7b6[_0xf9d5('0x32')],'WhatsappQueueId':_0x24f7b6['id'],'interface':util[_0xf9d5('0x64')](_0xf9d5('0x65'),_0xf9d5('0x66'),_0x45b139[_0xf9d5('0x32')]),'penalty':0x0,'paused':_0x45b139[_0xf9d5('0x62')],'createdAt':_0x45b139['createdAt'],'updatedAt':_0x45b139[_0xf9d5('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf9d5('0x2a')](respondWithFilteredResult(_0x244fb1,_0x519919))[_0xf9d5('0x5a')](handleError(_0x244fb1,null));};exports[_0xf9d5('0x67')]=function(_0x1727e3,_0x277a5d,_0x20b282){var _0x43add5={};var _0x1b9285={};var _0x2d4b51;var _0x4024c7;return db[_0xf9d5('0x4b')][_0xf9d5('0x68')]({'where':{'id':_0x1727e3[_0xf9d5('0x4f')]['id']}})['then'](handleEntityNotFound(_0x277a5d,null))[_0xf9d5('0x2a')](function(_0x15b281){if(_0x15b281){_0x2d4b51=_0x15b281;_0x1b9285[_0xf9d5('0x3a')]=_['keys'](db[_0xf9d5('0x69')][_0xf9d5('0x36')]);_0x1b9285[_0xf9d5('0x3c')]=_[_0xf9d5('0x3b')](_0x1727e3['query']);_0x1b9285[_0xf9d5('0x3d')]=_[_0xf9d5('0x3e')](_0x1b9285[_0xf9d5('0x3a')],_0x1b9285[_0xf9d5('0x3c')]);_0x43add5[_0xf9d5('0x3f')]=_[_0xf9d5('0x3e')](_0x1b9285[_0xf9d5('0x3a')],qs[_0xf9d5('0x40')](_0x1727e3[_0xf9d5('0x3c')][_0xf9d5('0x40')]));_0x43add5['attributes']=_0x43add5[_0xf9d5('0x3f')][_0xf9d5('0x50')]?_0x43add5['attributes']:_0x1b9285[_0xf9d5('0x3a')];_0x43add5[_0xf9d5('0x43')]=qs['sort'](_0x1727e3['query'][_0xf9d5('0x44')]);_0x43add5[_0xf9d5('0x45')]=qs['filters'](_[_0xf9d5('0x46')](_0x1727e3['query'],_0x1b9285[_0xf9d5('0x3d')]));if(_0x1727e3[_0xf9d5('0x3c')][_0xf9d5('0x47')]){_0x43add5[_0xf9d5('0x45')]=_[_0xf9d5('0x48')](_0x43add5['where'],{'$or':_[_0xf9d5('0x35')](_0x43add5[_0xf9d5('0x3f')],function(_0x191c80){var _0x224a90={};_0x224a90[_0x191c80]={'$like':'%'+_0x1727e3['query'][_0xf9d5('0x47')]+'%'};return _0x224a90;})});}_0x43add5=_['merge']({},_0x43add5,_0x1727e3[_0xf9d5('0x4a')]);return _0x2d4b51[_0xf9d5('0x67')](_0x43add5);}})[_0xf9d5('0x2a')](function(_0xfc2d53){if(_0xfc2d53){_0x4024c7=_0xfc2d53[_0xf9d5('0x50')];if(!_0x1727e3[_0xf9d5('0x3c')][_0xf9d5('0x41')]('nolimit')){_0x43add5[_0xf9d5('0x22')]=qs[_0xf9d5('0x22')](_0x1727e3['query'][_0xf9d5('0x22')]);_0x43add5['offset']=qs['offset'](_0x1727e3[_0xf9d5('0x3c')]['offset']);}return _0x2d4b51[_0xf9d5('0x67')](_0x43add5);}})[_0xf9d5('0x2a')](function(_0x5215c9){if(_0x5215c9){return _0x5215c9?{'count':_0x4024c7,'rows':_0x5215c9}:null;}})[_0xf9d5('0x2a')](respondWithResult(_0x277a5d,null))[_0xf9d5('0x5a')](handleError(_0x277a5d,null));};exports[_0xf9d5('0x6a')]=function(_0x1d549f,_0x5b3389,_0x5e4b07){var _0x496f7d=_0x1d549f[_0xf9d5('0x54')]['ids'];return db[_0xf9d5('0x69')][_0xf9d5('0x4d')]({'where':{'id':_0x496f7d},'attributes':['id'],'include':[{'model':db[_0xf9d5('0x6b')],'as':_0xf9d5('0x6c'),'attributes':['id',_0xf9d5('0x32'),_0xf9d5('0x6d'),_0xf9d5('0x6e'),_0xf9d5('0x6f')],'raw':!![]}]})[_0xf9d5('0x2a')](function(_0xfb3518){if(_0xfb3518){var _0x1fc90f=_[_0xf9d5('0x70')](_0xfb3518,function(_0xe6fddc){var _0x381162=_0xe6fddc[_0xf9d5('0x2c')]({'plain':!![]});return _0x381162[_0xf9d5('0x6c')];});return db[_0xf9d5('0x4b')][_0xf9d5('0x52')]({'where':{'id':_0x1d549f['params']['id']}})[_0xf9d5('0x2a')](function(_0x539b48){return db[_0xf9d5('0x71')][_0xf9d5('0x72')](function(_0x3fa062){return _0x539b48['addTeams'](_0x496f7d,{'transaction':_0x3fa062})[_0xf9d5('0x2a')](function(){return BPromise[_0xf9d5('0x73')](_0x1fc90f,function(_0x4f4ef7){return db[_0xf9d5('0x5d')][_0xf9d5('0x74')]({'where':{'UserId':_0x4f4ef7['id'],'WhatsappQueueId':_0x1d549f['params']['id']},'transaction':_0x3fa062});});})[_0xf9d5('0x2a')](function(){_0x1fc90f['forEach'](function(_0x2184ee){socket[_0xf9d5('0x75')](_0xf9d5('0x76'),{'UserId':_0x2184ee['id'],'WhatsappQueueId':_0x539b48['id']});});});});});}})['then'](respondWithStatusCode(_0x5b3389,null))[_0xf9d5('0x5a')](handleError(_0x5b3389,null));};exports[_0xf9d5('0x77')]=function(_0x5bb558,_0x2d88ba,_0x4bb500){return db[_0xf9d5('0x69')][_0xf9d5('0x4d')]({'where':{'id':_0x5bb558[_0xf9d5('0x3c')][_0xf9d5('0x78')]},'attributes':['id'],'include':[{'model':db[_0xf9d5('0x6b')],'as':_0xf9d5('0x6c'),'attributes':['id'],'raw':!![]}]})[_0xf9d5('0x2a')](handleEntityNotFound(_0x2d88ba,null))[_0xf9d5('0x2a')](function(_0x11f0aa){var _0x33d504=_[_0xf9d5('0x35')](_0x11f0aa,'id');var _0x5d0bef=[];var _0x4c6ba9=[];var _0x5359da=squel[_0xf9d5('0x79')]();_0x5359da['field']('tq.TeamId')[_0xf9d5('0x7a')](_0xf9d5('0x7b'),'tq')[_0xf9d5('0x7c')](_0xf9d5('0x7d'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xf9d5('0x45')](_0xf9d5('0x7e'),_0x5bb558['params']['id']);for(var _0x4513d8=0x0;_0x4513d8<_0x11f0aa[_0xf9d5('0x50')];_0x4513d8+=0x1){let _0x5694f5=_0x11f0aa[_0x4513d8];for(var _0x25a573=0x0;_0x25a573<_0x5694f5[_0xf9d5('0x6c')][_0xf9d5('0x50')];_0x25a573+=0x1){let _0x2f4357=_0x5694f5[_0xf9d5('0x6c')][_0x25a573];var _0x3d19f1=_0x5359da[_0xf9d5('0x7f')]();_0x3d19f1[_0xf9d5('0x45')]('ut.UserId\x20=\x20?',_0x2f4357['id']);_0x4c6ba9[_0xf9d5('0x80')](db[_0xf9d5('0x71')][_0xf9d5('0x3c')](_0x3d19f1[_0xf9d5('0x81')](),{'type':db['sequelize']['QueryTypes'][_0xf9d5('0x82')]})[_0xf9d5('0x2a')](function(_0x1f9510){if(_0x1f9510[_0xf9d5('0x50')]===0x1){return _0x2f4357['id'];}else{var _0x238b9a=_[_0xf9d5('0x83')](_[_0xf9d5('0x35')](_0x1f9510,'TeamId'),function(_0x4dc366){return _['includes'](_0x33d504,_0x4dc366);});if(_0x238b9a){return _0x2f4357['id'];}}}));}}return BPromise[_0xf9d5('0x84')](_0x4c6ba9)[_0xf9d5('0x2a')](function(_0x45df43){_0x5d0bef=_(_0x5d0bef)[_0xf9d5('0x85')](_0x45df43)[_0xf9d5('0x86')]()[_0xf9d5('0x87')]();return db[_0xf9d5('0x4b')][_0xf9d5('0x52')]({'where':{'id':_0x5bb558[_0xf9d5('0x4f')]['id']}})[_0xf9d5('0x2a')](function(_0x32beeb){return db[_0xf9d5('0x71')]['transaction'](function(_0x5b679d){return _0x32beeb['removeTeams'](_0x5bb558[_0xf9d5('0x3c')][_0xf9d5('0x78')],{'transaction':_0x5b679d})[_0xf9d5('0x2a')](function(){if(!_[_0xf9d5('0x88')](_0x5d0bef)){return _0x32beeb['removeAgents'](_0x5d0bef,{'transaction':_0x5b679d});}})[_0xf9d5('0x2a')](function(){_0x5d0bef[_0xf9d5('0x89')](function(_0x9000bd){socket['emit'](_0xf9d5('0x8a'),{'UserId':_0x9000bd,'WhatsappQueueId':_0x32beeb['id']});});});});});});})['then'](respondWithStatusCode(_0x2d88ba,null))[_0xf9d5('0x5a')](handleError(_0x2d88ba,null));};exports[_0xf9d5('0x8b')]=function(_0x2996c0,_0xe0909b,_0x51ff71){return db['WhatsappQueue'][_0xf9d5('0x52')]({'where':{'id':_0x2996c0[_0xf9d5('0x4f')]['id']}})[_0xf9d5('0x2a')](handleEntityNotFound(_0xe0909b,null))['then'](function(_0x1ece12){if(_0x1ece12){return _0x1ece12[_0xf9d5('0x8b')](_0x2996c0[_0xf9d5('0x54')][_0xf9d5('0x78')],_[_0xf9d5('0x8c')](_0x2996c0[_0xf9d5('0x54')],[_0xf9d5('0x78'),'id'])||{})['spread'](function(_0x492e0e){for(var _0x41b1cb=0x0;_0x41b1cb<_0x2996c0[_0xf9d5('0x54')][_0xf9d5('0x78')]['length'];_0x41b1cb+=0x1){socket[_0xf9d5('0x75')](_0xf9d5('0x76'),{'UserId':Number(_0x2996c0[_0xf9d5('0x54')][_0xf9d5('0x78')][_0x41b1cb]),'WhatsappQueueId':Number(_0x2996c0['params']['id'])});}return _0x492e0e;});}})[_0xf9d5('0x2a')](respondWithResult(_0xe0909b,null))[_0xf9d5('0x5a')](handleError(_0xe0909b,null));};exports[_0xf9d5('0x8d')]=function(_0x2296f7,_0x4ce415,_0x2c859b){return db[_0xf9d5('0x4b')][_0xf9d5('0x52')]({'where':{'id':_0x2296f7[_0xf9d5('0x4f')]['id']}})[_0xf9d5('0x2a')](handleEntityNotFound(_0x4ce415,null))[_0xf9d5('0x2a')](function(_0x546674){if(_0x546674){return _0x546674[_0xf9d5('0x8d')](_0x2296f7[_0xf9d5('0x3c')][_0xf9d5('0x78')])[_0xf9d5('0x2a')](function(){if(_[_0xf9d5('0x8e')](_0x2296f7[_0xf9d5('0x3c')]['ids'])){for(var _0x314822=0x0;_0x314822<_0x2296f7[_0xf9d5('0x3c')]['ids'][_0xf9d5('0x50')];_0x314822+=0x1){socket[_0xf9d5('0x75')](_0xf9d5('0x8a'),{'UserId':Number(_0x2296f7['query']['ids'][_0x314822]),'WhatsappQueueId':Number(_0x2296f7['params']['id'])});}}else{socket['emit'](_0xf9d5('0x8a'),{'UserId':Number(_0x2296f7[_0xf9d5('0x3c')][_0xf9d5('0x78')]),'WhatsappQueueId':Number(_0x2296f7['params']['id'])});}});}})['then'](respondWithStatusCode(_0x4ce415,null))[_0xf9d5('0x5a')](handleError(_0x4ce415,null));};exports[_0xf9d5('0x8f')]=function(_0x80a785,_0x47493c,_0x2e693e){var _0x19046a={};var _0x4f4421={};var _0x3b9caf;var _0x445c53;return db[_0xf9d5('0x4b')][_0xf9d5('0x68')]({'where':{'id':_0x80a785[_0xf9d5('0x4f')]['id']}})[_0xf9d5('0x2a')](handleEntityNotFound(_0x47493c,null))['then'](function(_0x363f42){if(_0x363f42){_0x3b9caf=_0x363f42;_0x4f4421[_0xf9d5('0x3a')]=_['keys'](db[_0xf9d5('0x6b')][_0xf9d5('0x36')]);_0x4f4421[_0xf9d5('0x3c')]=_[_0xf9d5('0x3b')](_0x80a785['query']);_0x4f4421['filters']=_['intersection'](_0x4f4421[_0xf9d5('0x3a')],_0x4f4421[_0xf9d5('0x3c')]);_0x19046a[_0xf9d5('0x3f')]=_['intersection'](_0x4f4421['model'],qs[_0xf9d5('0x40')](_0x80a785[_0xf9d5('0x3c')][_0xf9d5('0x40')]));_0x19046a[_0xf9d5('0x3f')]=_0x19046a[_0xf9d5('0x3f')][_0xf9d5('0x50')]?_0x19046a['attributes']:_0x4f4421[_0xf9d5('0x3a')];_0x19046a[_0xf9d5('0x43')]=qs[_0xf9d5('0x44')](_0x80a785[_0xf9d5('0x3c')][_0xf9d5('0x44')]);_0x19046a[_0xf9d5('0x45')]=qs[_0xf9d5('0x3d')](_[_0xf9d5('0x46')](_0x80a785[_0xf9d5('0x3c')],_0x4f4421[_0xf9d5('0x3d')]));if(_0x80a785['query'][_0xf9d5('0x47')]){_0x19046a[_0xf9d5('0x45')]=_[_0xf9d5('0x48')](_0x19046a[_0xf9d5('0x45')],{'$or':_[_0xf9d5('0x35')](_0x19046a[_0xf9d5('0x3f')],function(_0x1edda6){var _0x14318f={};_0x14318f[_0x1edda6]={'$like':'%'+_0x80a785['query'][_0xf9d5('0x47')]+'%'};return _0x14318f;})});}_0x19046a=_[_0xf9d5('0x48')]({},_0x19046a,_0x80a785[_0xf9d5('0x4a')]);return _0x3b9caf[_0xf9d5('0x8f')](_0x19046a);}})['then'](function(_0xc9bbf0){if(_0xc9bbf0){_0x445c53=_0xc9bbf0[_0xf9d5('0x50')];if(!_0x80a785['query']['hasOwnProperty'](_0xf9d5('0x42'))){_0x19046a[_0xf9d5('0x22')]=qs['limit'](_0x80a785[_0xf9d5('0x3c')][_0xf9d5('0x22')]);_0x19046a[_0xf9d5('0x20')]=qs[_0xf9d5('0x20')](_0x80a785[_0xf9d5('0x3c')][_0xf9d5('0x20')]);}return _0x3b9caf[_0xf9d5('0x8f')](_0x19046a);}})['then'](function(_0x2b1bab){if(_0x2b1bab){return _0x2b1bab?{'count':_0x445c53,'rows':_0x2b1bab}:null;}})[_0xf9d5('0x2a')](respondWithResult(_0x47493c,null))['catch'](handleError(_0x47493c,null));}; \ No newline at end of file +var _0xfb6a=['each','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','select','field','tq.TeamId','from','join','user_has_teams','WhatsappQueueId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','union','compact','value','removeAgents','userWhatsappQueue:remove','omit','isArray','getAgents','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','redis','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy','end','error','stack','name','send','index','map','WhatsappQueue','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','rows','catch','show','params','include','find','create','user','role','WhatsappQueues','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','getMembers','findOne','UserWhatsappQueue','WhatsappQueueId','findAll','findAndCountAll','agent','updatedAt','format','%s/%s','SIP','whatsappPause','createdAt','Team','getTeams','ids','User','online','voicePause','flatMap','Agents','sequelize','transaction','addTeams'];(function(_0x46d0c9,_0x526bfa){var _0x174506=function(_0x654bc6){while(--_0x654bc6){_0x46d0c9['push'](_0x46d0c9['shift']());}};_0x174506(++_0x526bfa);}(_0xfb6a,0x134));var _0xafb6=function(_0x6b6340,_0x6302c4){_0x6b6340=_0x6b6340-0x0;var _0x3609bf=_0xfb6a[_0x6b6340];return _0x3609bf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xafb6('0x0'));var zipdir=require(_0xafb6('0x1'));var jsonpatch=require(_0xafb6('0x2'));var rp=require('request-promise');var moment=require(_0xafb6('0x3'));var BPromise=require(_0xafb6('0x4'));var Mustache=require(_0xafb6('0x5'));var util=require(_0xafb6('0x6'));var path=require(_0xafb6('0x7'));var sox=require(_0xafb6('0x8'));var csv=require(_0xafb6('0x9'));var ejs=require(_0xafb6('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xafb6('0xb'));var squel=require('squel');var crypto=require(_0xafb6('0xc'));var jsforce=require(_0xafb6('0xd'));var deskjs=require(_0xafb6('0xe'));var toCsv=require(_0xafb6('0x9'));var querystring=require(_0xafb6('0xf'));var Papa=require(_0xafb6('0x10'));var Redis=require(_0xafb6('0x11'));var authService=require(_0xafb6('0x12'));var qs=require(_0xafb6('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xafb6('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xafb6('0x15')]=_['defaults'](config[_0xafb6('0x15')],{'host':_0xafb6('0x16'),'port':0x18eb});var socket=require(_0xafb6('0x17'))(new Redis(config['redis']));require(_0xafb6('0x18'))[_0xafb6('0x19')](socket);function respondWithStatusCode(_0x453e4e,_0x4bad81){_0x4bad81=_0x4bad81||0xcc;return function(_0x9339db){if(_0x9339db){return _0x453e4e[_0xafb6('0x1a')](_0x4bad81);}return _0x453e4e['status'](_0x4bad81)['end']();};}function respondWithResult(_0x13ca03,_0x593473){_0x593473=_0x593473||0xc8;return function(_0x551579){if(_0x551579){return _0x13ca03[_0xafb6('0x1b')](_0x593473)[_0xafb6('0x1c')](_0x551579);}};}function respondWithFilteredResult(_0x4d55ff,_0x143853){return function(_0x60a0b6){if(_0x60a0b6){var _0x1933d7=typeof _0x143853[_0xafb6('0x1d')]==='undefined'&&typeof _0x143853[_0xafb6('0x1e')]===_0xafb6('0x1f');var _0x3b0b3e=_0x60a0b6[_0xafb6('0x20')];var _0x3faae6=_0x1933d7?0x0:_0x143853['offset'];var _0x3d2b02=_0x1933d7?_0x60a0b6['count']:_0x143853[_0xafb6('0x1d')]+_0x143853[_0xafb6('0x1e')];var _0xa1e9da;if(_0x3d2b02>=_0x3b0b3e){_0x3d2b02=_0x3b0b3e;_0xa1e9da=0xc8;}else{_0xa1e9da=0xce;}_0x4d55ff['status'](_0xa1e9da);return _0x4d55ff[_0xafb6('0x21')](_0xafb6('0x22'),_0x3faae6+'-'+_0x3d2b02+'/'+_0x3b0b3e)[_0xafb6('0x1c')](_0x60a0b6);}return null;};}function patchUpdates(_0x201c97){return function(_0x92916e){try{jsonpatch[_0xafb6('0x23')](_0x92916e,_0x201c97,!![]);}catch(_0x34ce3a){return BPromise[_0xafb6('0x24')](_0x34ce3a);}return _0x92916e[_0xafb6('0x25')]();};}function saveUpdates(_0x8b22ff,_0x4f7ae9){return function(_0x16b0cd){if(_0x16b0cd){return _0x16b0cd[_0xafb6('0x26')](_0x8b22ff)[_0xafb6('0x27')](function(_0x47992d){return _0x47992d;});}return null;};}function removeEntity(_0x3b5564,_0x4b3000){return function(_0x4a6b17){if(_0x4a6b17){return _0x4a6b17['destroy']()['then'](function(){var _0x1acc90=_0x4a6b17[_0xafb6('0x28')]({'plain':!![]});var _0x2c02ff='WhatsappQueues';return db[_0xafb6('0x29')][_0xafb6('0x2a')]({'where':{'type':_0x2c02ff,'resourceId':_0x1acc90['id']}})[_0xafb6('0x27')](function(){return _0x4a6b17;});})['then'](function(){_0x3b5564[_0xafb6('0x1b')](0xcc)[_0xafb6('0x2b')]();});}};}function handleEntityNotFound(_0x4b9758,_0x357e32){return function(_0x41d041){if(!_0x41d041){_0x4b9758[_0xafb6('0x1a')](0x194);}return _0x41d041;};}function handleError(_0x293b60,_0xf68aa2){_0xf68aa2=_0xf68aa2||0x1f4;return function(_0x57b465){logger[_0xafb6('0x2c')](_0x57b465[_0xafb6('0x2d')]);if(_0x57b465[_0xafb6('0x2e')]){delete _0x57b465[_0xafb6('0x2e')];}_0x293b60[_0xafb6('0x1b')](_0xf68aa2)[_0xafb6('0x2f')](_0x57b465);};}exports[_0xafb6('0x30')]=function(_0x16913a,_0x4a82fd){var _0x16610b={},_0x406eb3={},_0xb9058e={'count':0x0,'rows':[]};var _0x460b3a=_[_0xafb6('0x31')](db[_0xafb6('0x32')][_0xafb6('0x33')],function(_0xfb0482){return{'name':_0xfb0482[_0xafb6('0x34')],'type':_0xfb0482[_0xafb6('0x35')][_0xafb6('0x36')]};});_0x406eb3[_0xafb6('0x37')]=_[_0xafb6('0x31')](_0x460b3a,_0xafb6('0x2e'));_0x406eb3['query']=_[_0xafb6('0x38')](_0x16913a[_0xafb6('0x39')]);_0x406eb3[_0xafb6('0x3a')]=_[_0xafb6('0x3b')](_0x406eb3[_0xafb6('0x37')],_0x406eb3['query']);_0x16610b[_0xafb6('0x3c')]=_['intersection'](_0x406eb3['model'],qs[_0xafb6('0x3d')](_0x16913a['query'][_0xafb6('0x3d')]));_0x16610b[_0xafb6('0x3c')]=_0x16610b[_0xafb6('0x3c')][_0xafb6('0x3e')]?_0x16610b[_0xafb6('0x3c')]:_0x406eb3[_0xafb6('0x37')];if(!_0x16913a[_0xafb6('0x39')][_0xafb6('0x3f')](_0xafb6('0x40'))){_0x16610b[_0xafb6('0x1e')]=qs[_0xafb6('0x1e')](_0x16913a[_0xafb6('0x39')][_0xafb6('0x1e')]);_0x16610b['offset']=qs[_0xafb6('0x1d')](_0x16913a[_0xafb6('0x39')]['offset']);}_0x16610b[_0xafb6('0x41')]=qs[_0xafb6('0x42')](_0x16913a[_0xafb6('0x39')][_0xafb6('0x42')]);_0x16610b[_0xafb6('0x43')]=qs['filters'](_[_0xafb6('0x44')](_0x16913a[_0xafb6('0x39')],_0x406eb3[_0xafb6('0x3a')]),_0x460b3a);if(_0x16913a[_0xafb6('0x39')][_0xafb6('0x45')]){_0x16610b[_0xafb6('0x43')]=_[_0xafb6('0x46')](_0x16610b[_0xafb6('0x43')],{'$or':_[_0xafb6('0x31')](_0x460b3a,function(_0x45853f){if(_0x45853f[_0xafb6('0x35')]!=='VIRTUAL'){var _0x90030e={};_0x90030e[_0x45853f[_0xafb6('0x2e')]]={'$like':'%'+_0x16913a[_0xafb6('0x39')][_0xafb6('0x45')]+'%'};return _0x90030e;}})});}_0x16610b=_[_0xafb6('0x46')]({},_0x16610b,_0x16913a[_0xafb6('0x47')]);var _0x51085b={'where':_0x16610b['where']};return db[_0xafb6('0x32')][_0xafb6('0x20')](_0x51085b)['then'](function(_0x1a55f6){_0xb9058e['count']=_0x1a55f6;if(_0x16913a['query'][_0xafb6('0x48')]){_0x16610b['include']=[{'all':!![]}];}return db['WhatsappQueue']['findAll'](_0x16610b);})['then'](function(_0x3052ac){_0xb9058e[_0xafb6('0x49')]=_0x3052ac;return _0xb9058e;})[_0xafb6('0x27')](respondWithFilteredResult(_0x4a82fd,_0x16610b))[_0xafb6('0x4a')](handleError(_0x4a82fd,null));};exports[_0xafb6('0x4b')]=function(_0x59a6ec,_0x264a52){var _0x241982={'raw':!![],'where':{'id':_0x59a6ec[_0xafb6('0x4c')]['id']}},_0xa77b63={};_0xa77b63[_0xafb6('0x37')]=_[_0xafb6('0x38')](db[_0xafb6('0x32')]['rawAttributes']);_0xa77b63['query']=_['keys'](_0x59a6ec[_0xafb6('0x39')]);_0xa77b63[_0xafb6('0x3a')]=_['intersection'](_0xa77b63[_0xafb6('0x37')],_0xa77b63[_0xafb6('0x39')]);_0x241982[_0xafb6('0x3c')]=_[_0xafb6('0x3b')](_0xa77b63[_0xafb6('0x37')],qs[_0xafb6('0x3d')](_0x59a6ec[_0xafb6('0x39')][_0xafb6('0x3d')]));_0x241982[_0xafb6('0x3c')]=_0x241982[_0xafb6('0x3c')]['length']?_0x241982[_0xafb6('0x3c')]:_0xa77b63[_0xafb6('0x37')];if(_0x59a6ec[_0xafb6('0x39')]['includeAll']){_0x241982[_0xafb6('0x4d')]=[{'all':!![]}];}_0x241982=_[_0xafb6('0x46')]({},_0x241982,_0x59a6ec[_0xafb6('0x47')]);return db[_0xafb6('0x32')][_0xafb6('0x4e')](_0x241982)[_0xafb6('0x27')](handleEntityNotFound(_0x264a52,null))[_0xafb6('0x27')](respondWithResult(_0x264a52,null))[_0xafb6('0x4a')](handleError(_0x264a52,null));};exports[_0xafb6('0x4f')]=function(_0x34a4e8,_0x479613){return db[_0xafb6('0x32')]['create'](_0x34a4e8['body'],{})[_0xafb6('0x27')](function(_0x2e19b1){var _0xb8b0f5=_0x34a4e8[_0xafb6('0x50')]['get']({'plain':!![]});if(!_0xb8b0f5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xb8b0f5[_0xafb6('0x51')]===_0xafb6('0x50')){var _0x1d5260=_0x2e19b1[_0xafb6('0x28')]({'plain':!![]});var _0x48c855=_0xafb6('0x52');return db[_0xafb6('0x53')][_0xafb6('0x4e')]({'where':{'name':_0x48c855,'userProfileId':_0xb8b0f5[_0xafb6('0x54')]},'raw':!![]})[_0xafb6('0x27')](function(_0x1cb903){if(_0x1cb903&&_0x1cb903[_0xafb6('0x55')]===0x0){return db['UserProfileResource'][_0xafb6('0x4f')]({'name':_0x1d5260[_0xafb6('0x2e')],'resourceId':_0x1d5260['id'],'type':_0x1cb903[_0xafb6('0x2e')],'sectionId':_0x1cb903['id']},{})[_0xafb6('0x27')](function(){return _0x2e19b1;});}else{return _0x2e19b1;}})[_0xafb6('0x4a')](function(_0x42a2ac){logger[_0xafb6('0x2c')](_0xafb6('0x56'),_0x42a2ac);throw _0x42a2ac;});}return _0x2e19b1;})[_0xafb6('0x27')](respondWithResult(_0x479613,0xc9))[_0xafb6('0x4a')](handleError(_0x479613,null));};exports[_0xafb6('0x26')]=function(_0x4c6795,_0x302791){if(_0x4c6795['body']['id']){delete _0x4c6795[_0xafb6('0x57')]['id'];}return db[_0xafb6('0x32')][_0xafb6('0x4e')]({'where':{'id':_0x4c6795[_0xafb6('0x4c')]['id']}})['then'](handleEntityNotFound(_0x302791,null))[_0xafb6('0x27')](saveUpdates(_0x4c6795[_0xafb6('0x57')],null))[_0xafb6('0x27')](respondWithResult(_0x302791,null))['catch'](handleError(_0x302791,null));};exports[_0xafb6('0x2a')]=function(_0x22e48a,_0x2316d9){return db['WhatsappQueue']['find']({'where':{'id':_0x22e48a[_0xafb6('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2316d9,null))[_0xafb6('0x27')](removeEntity(_0x2316d9,null))[_0xafb6('0x4a')](handleError(_0x2316d9,null));};exports['describe']=function(_0x12711b,_0x678e1){return db[_0xafb6('0x32')]['describe']()['then'](respondWithResult(_0x678e1,null))[_0xafb6('0x4a')](handleError(_0x678e1,null));};exports[_0xafb6('0x58')]=function(_0x49649f,_0xefe5db,_0x42ba1){var _0x4e3ef8={'raw':!![],'where':{}},_0x8b06ab={},_0x486b50;return db[_0xafb6('0x32')][_0xafb6('0x59')]({'where':{'id':_0x49649f['params']['id']}})[_0xafb6('0x27')](handleEntityNotFound(_0xefe5db,null))[_0xafb6('0x27')](function(_0x37721a){if(_0x37721a){_0x486b50=_0x37721a['get']({'plain':!![]});_0x8b06ab[_0xafb6('0x37')]=_['keys'](db[_0xafb6('0x5a')]['rawAttributes']);_0x8b06ab['query']=_[_0xafb6('0x38')](_0x49649f['query']);_0x8b06ab[_0xafb6('0x3a')]=_[_0xafb6('0x3b')](_0x8b06ab[_0xafb6('0x37')],_0x8b06ab[_0xafb6('0x39')]);_0x4e3ef8[_0xafb6('0x3c')]=_[_0xafb6('0x3b')](_0x8b06ab[_0xafb6('0x37')],qs[_0xafb6('0x3d')](_0x49649f[_0xafb6('0x39')][_0xafb6('0x3d')]));_0x4e3ef8[_0xafb6('0x3c')]=_0x4e3ef8[_0xafb6('0x3c')][_0xafb6('0x3e')]?_0x4e3ef8[_0xafb6('0x3c')]:_0x8b06ab[_0xafb6('0x37')];if(!_0x49649f['query'][_0xafb6('0x3f')](_0xafb6('0x40'))){_0x4e3ef8[_0xafb6('0x1e')]=qs[_0xafb6('0x1e')](_0x49649f[_0xafb6('0x39')][_0xafb6('0x1e')]);_0x4e3ef8[_0xafb6('0x1d')]=qs[_0xafb6('0x1d')](_0x49649f['query'][_0xafb6('0x1d')]);}_0x4e3ef8[_0xafb6('0x41')]=qs[_0xafb6('0x42')](_0x49649f[_0xafb6('0x39')][_0xafb6('0x42')]);_0x4e3ef8[_0xafb6('0x43')]=qs[_0xafb6('0x3a')](_[_0xafb6('0x44')](_0x49649f['query'],_0x8b06ab[_0xafb6('0x3a')]));_0x4e3ef8[_0xafb6('0x43')][_0xafb6('0x5b')]=_0x37721a['id'];if(_0x49649f['query'][_0xafb6('0x45')]){_0x4e3ef8[_0xafb6('0x43')]=_[_0xafb6('0x46')](_0x4e3ef8[_0xafb6('0x43')],{'$or':_[_0xafb6('0x31')](_0x4e3ef8[_0xafb6('0x3c')],function(_0x3eb09c){var _0x3e0500={};_0x3e0500[_0x3eb09c]={'$like':'%'+_0x49649f[_0xafb6('0x39')][_0xafb6('0x45')]+'%'};return _0x3e0500;})});}_0x4e3ef8=_['merge']({},_0x4e3ef8,_0x49649f['options']);return db[_0xafb6('0x5a')][_0xafb6('0x5c')](_0x4e3ef8);}})[_0xafb6('0x27')](function(_0x4dfccf){if(_0x4dfccf){return db['User'][_0xafb6('0x5d')]({'where':{'id':_[_0xafb6('0x31')](_0x4dfccf,'UserId'),'role':_0xafb6('0x5e')},'attributes':['id','name','whatsappPause',_0xafb6('0x5f'),'createdAt']});}})[_0xafb6('0x27')](function(_0x1f631a){if(_0x1f631a){return{'count':_0x1f631a[_0xafb6('0x20')],'rows':_['map'](_0x1f631a['rows'],function(_0x537397){return{'membername':_0x537397[_0xafb6('0x2e')],'UserId':_0x537397['id'],'queue_name':_0x486b50[_0xafb6('0x2e')],'WhatsappQueueId':_0x486b50['id'],'interface':util[_0xafb6('0x60')](_0xafb6('0x61'),_0xafb6('0x62'),_0x537397[_0xafb6('0x2e')]),'penalty':0x0,'paused':_0x537397[_0xafb6('0x63')],'createdAt':_0x537397[_0xafb6('0x64')],'updatedAt':_0x537397['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xafb6('0x27')](respondWithFilteredResult(_0xefe5db,_0x4e3ef8))['catch'](handleError(_0xefe5db,null));};exports['getTeams']=function(_0x23ddd9,_0x364bf2,_0x48ee20){var _0x4363c8={};var _0x78efa0={};var _0x1712dd;var _0x5d5248;return db[_0xafb6('0x32')]['findOne']({'where':{'id':_0x23ddd9[_0xafb6('0x4c')]['id']}})[_0xafb6('0x27')](handleEntityNotFound(_0x364bf2,null))[_0xafb6('0x27')](function(_0x3e3969){if(_0x3e3969){_0x1712dd=_0x3e3969;_0x78efa0[_0xafb6('0x37')]=_['keys'](db[_0xafb6('0x65')][_0xafb6('0x33')]);_0x78efa0[_0xafb6('0x39')]=_[_0xafb6('0x38')](_0x23ddd9['query']);_0x78efa0['filters']=_['intersection'](_0x78efa0[_0xafb6('0x37')],_0x78efa0[_0xafb6('0x39')]);_0x4363c8[_0xafb6('0x3c')]=_[_0xafb6('0x3b')](_0x78efa0[_0xafb6('0x37')],qs[_0xafb6('0x3d')](_0x23ddd9[_0xafb6('0x39')][_0xafb6('0x3d')]));_0x4363c8[_0xafb6('0x3c')]=_0x4363c8[_0xafb6('0x3c')][_0xafb6('0x3e')]?_0x4363c8['attributes']:_0x78efa0[_0xafb6('0x37')];_0x4363c8[_0xafb6('0x41')]=qs['sort'](_0x23ddd9[_0xafb6('0x39')]['sort']);_0x4363c8[_0xafb6('0x43')]=qs[_0xafb6('0x3a')](_[_0xafb6('0x44')](_0x23ddd9[_0xafb6('0x39')],_0x78efa0[_0xafb6('0x3a')]));if(_0x23ddd9[_0xafb6('0x39')][_0xafb6('0x45')]){_0x4363c8[_0xafb6('0x43')]=_['merge'](_0x4363c8[_0xafb6('0x43')],{'$or':_[_0xafb6('0x31')](_0x4363c8['attributes'],function(_0x10c5a5){var _0xd69013={};_0xd69013[_0x10c5a5]={'$like':'%'+_0x23ddd9[_0xafb6('0x39')][_0xafb6('0x45')]+'%'};return _0xd69013;})});}_0x4363c8=_[_0xafb6('0x46')]({},_0x4363c8,_0x23ddd9[_0xafb6('0x47')]);return _0x1712dd['getTeams'](_0x4363c8);}})[_0xafb6('0x27')](function(_0xc94ae2){if(_0xc94ae2){_0x5d5248=_0xc94ae2['length'];if(!_0x23ddd9[_0xafb6('0x39')]['hasOwnProperty'](_0xafb6('0x40'))){_0x4363c8[_0xafb6('0x1e')]=qs['limit'](_0x23ddd9['query'][_0xafb6('0x1e')]);_0x4363c8['offset']=qs[_0xafb6('0x1d')](_0x23ddd9[_0xafb6('0x39')][_0xafb6('0x1d')]);}return _0x1712dd[_0xafb6('0x66')](_0x4363c8);}})[_0xafb6('0x27')](function(_0x434fe0){if(_0x434fe0){return _0x434fe0?{'count':_0x5d5248,'rows':_0x434fe0}:null;}})[_0xafb6('0x27')](respondWithResult(_0x364bf2,null))[_0xafb6('0x4a')](handleError(_0x364bf2,null));};exports['addTeams']=function(_0x29ad62,_0x26c17d,_0x10becf){var _0x1b68be=_0x29ad62[_0xafb6('0x57')][_0xafb6('0x67')];return db[_0xafb6('0x65')][_0xafb6('0x5c')]({'where':{'id':_0x1b68be},'attributes':['id'],'include':[{'model':db[_0xafb6('0x68')],'as':'Agents','attributes':['id',_0xafb6('0x2e'),_0xafb6('0x69'),_0xafb6('0x6a'),'interface'],'raw':!![]}]})['then'](function(_0x5ecff9){if(_0x5ecff9){var _0x1d14a8=_[_0xafb6('0x6b')](_0x5ecff9,function(_0x1184ff){var _0x9de5f8=_0x1184ff[_0xafb6('0x28')]({'plain':!![]});return _0x9de5f8[_0xafb6('0x6c')];});return db[_0xafb6('0x32')][_0xafb6('0x4e')]({'where':{'id':_0x29ad62[_0xafb6('0x4c')]['id']}})[_0xafb6('0x27')](function(_0x54c280){return db[_0xafb6('0x6d')][_0xafb6('0x6e')](function(_0x5c5a18){return _0x54c280[_0xafb6('0x6f')](_0x1b68be,{'transaction':_0x5c5a18})[_0xafb6('0x27')](function(){return BPromise[_0xafb6('0x70')](_0x1d14a8,function(_0x6fd089){return db[_0xafb6('0x5a')][_0xafb6('0x71')]({'where':{'UserId':_0x6fd089['id'],'WhatsappQueueId':_0x29ad62[_0xafb6('0x4c')]['id']},'transaction':_0x5c5a18});});})['then'](function(){_0x1d14a8[_0xafb6('0x72')](function(_0x3ddf90){socket[_0xafb6('0x73')](_0xafb6('0x74'),{'UserId':_0x3ddf90['id'],'WhatsappQueueId':_0x54c280['id']});});});});});}})[_0xafb6('0x27')](respondWithStatusCode(_0x26c17d,null))[_0xafb6('0x4a')](handleError(_0x26c17d,null));};exports[_0xafb6('0x75')]=function(_0x26af9a,_0x2faa46,_0x58c8af){return db[_0xafb6('0x65')][_0xafb6('0x5c')]({'where':{'id':_0x26af9a[_0xafb6('0x39')]['ids']},'attributes':['id'],'include':[{'model':db[_0xafb6('0x68')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2faa46,null))[_0xafb6('0x27')](function(_0x2e9bfb){var _0x17c5ff=_['map'](_0x2e9bfb,'id');var _0x2eaf85=[];var _0x2ab4e4=[];var _0x3e0e84=squel[_0xafb6('0x76')]();_0x3e0e84[_0xafb6('0x77')](_0xafb6('0x78'))[_0xafb6('0x79')]('team_has_whatsapp_queues','tq')[_0xafb6('0x7a')](_0xafb6('0x7b'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0xafb6('0x7c'),_0x26af9a[_0xafb6('0x4c')]['id']);for(var _0x568ebe=0x0;_0x568ebe<_0x2e9bfb[_0xafb6('0x3e')];_0x568ebe+=0x1){let _0x136102=_0x2e9bfb[_0x568ebe];for(var _0x401fbc=0x0;_0x401fbc<_0x136102['Agents'][_0xafb6('0x3e')];_0x401fbc+=0x1){let _0x18e2fb=_0x136102[_0xafb6('0x6c')][_0x401fbc];var _0x3420b3=_0x3e0e84['clone']();_0x3420b3[_0xafb6('0x43')]('ut.UserId\x20=\x20?',_0x18e2fb['id']);_0x2ab4e4[_0xafb6('0x7d')](db[_0xafb6('0x6d')][_0xafb6('0x39')](_0x3420b3[_0xafb6('0x7e')](),{'type':db[_0xafb6('0x6d')][_0xafb6('0x7f')][_0xafb6('0x80')]})[_0xafb6('0x27')](function(_0xda15a5){if(_0xda15a5[_0xafb6('0x3e')]===0x1){return _0x18e2fb['id'];}else{var _0x4d843b=_[_0xafb6('0x81')](_['map'](_0xda15a5,_0xafb6('0x82')),function(_0x5571b3){return _[_0xafb6('0x83')](_0x17c5ff,_0x5571b3);});if(_0x4d843b){return _0x18e2fb['id'];}}}));}}return BPromise['all'](_0x2ab4e4)['then'](function(_0x3b830b){_0x2eaf85=_(_0x2eaf85)[_0xafb6('0x84')](_0x3b830b)[_0xafb6('0x85')]()[_0xafb6('0x86')]();return db[_0xafb6('0x32')][_0xafb6('0x4e')]({'where':{'id':_0x26af9a['params']['id']}})['then'](function(_0x256c2f){return db[_0xafb6('0x6d')][_0xafb6('0x6e')](function(_0x2cd12f){return _0x256c2f[_0xafb6('0x75')](_0x26af9a[_0xafb6('0x39')]['ids'],{'transaction':_0x2cd12f})[_0xafb6('0x27')](function(){if(!_['isEmpty'](_0x2eaf85)){return _0x256c2f[_0xafb6('0x87')](_0x2eaf85,{'transaction':_0x2cd12f});}})[_0xafb6('0x27')](function(){_0x2eaf85[_0xafb6('0x72')](function(_0x3e8669){socket[_0xafb6('0x73')](_0xafb6('0x88'),{'UserId':_0x3e8669,'WhatsappQueueId':_0x256c2f['id']});});});});});});})[_0xafb6('0x27')](respondWithStatusCode(_0x2faa46,null))[_0xafb6('0x4a')](handleError(_0x2faa46,null));};exports['addAgents']=function(_0x60c973,_0x364e04,_0x2690d0){return db[_0xafb6('0x32')]['find']({'where':{'id':_0x60c973[_0xafb6('0x4c')]['id']}})[_0xafb6('0x27')](handleEntityNotFound(_0x364e04,null))['then'](function(_0x2cb477){if(_0x2cb477){return _0x2cb477['addAgents'](_0x60c973[_0xafb6('0x57')][_0xafb6('0x67')],_[_0xafb6('0x89')](_0x60c973[_0xafb6('0x57')],[_0xafb6('0x67'),'id'])||{})['spread'](function(_0x6e4ed7){for(var _0x4e5b28=0x0;_0x4e5b28<_0x60c973[_0xafb6('0x57')][_0xafb6('0x67')][_0xafb6('0x3e')];_0x4e5b28+=0x1){socket[_0xafb6('0x73')]('userWhatsappQueue:save',{'UserId':Number(_0x60c973[_0xafb6('0x57')]['ids'][_0x4e5b28]),'WhatsappQueueId':Number(_0x60c973['params']['id'])});}return _0x6e4ed7;});}})[_0xafb6('0x27')](respondWithResult(_0x364e04,null))['catch'](handleError(_0x364e04,null));};exports['removeAgents']=function(_0x3e3037,_0x48c467,_0x5751f1){return db[_0xafb6('0x32')][_0xafb6('0x4e')]({'where':{'id':_0x3e3037['params']['id']}})[_0xafb6('0x27')](handleEntityNotFound(_0x48c467,null))[_0xafb6('0x27')](function(_0x23740c){if(_0x23740c){return _0x23740c['removeAgents'](_0x3e3037[_0xafb6('0x39')][_0xafb6('0x67')])[_0xafb6('0x27')](function(){if(_[_0xafb6('0x8a')](_0x3e3037[_0xafb6('0x39')]['ids'])){for(var _0x4cda36=0x0;_0x4cda36<_0x3e3037[_0xafb6('0x39')][_0xafb6('0x67')]['length'];_0x4cda36+=0x1){socket[_0xafb6('0x73')](_0xafb6('0x88'),{'UserId':Number(_0x3e3037['query'][_0xafb6('0x67')][_0x4cda36]),'WhatsappQueueId':Number(_0x3e3037[_0xafb6('0x4c')]['id'])});}}else{socket[_0xafb6('0x73')](_0xafb6('0x88'),{'UserId':Number(_0x3e3037[_0xafb6('0x39')][_0xafb6('0x67')]),'WhatsappQueueId':Number(_0x3e3037[_0xafb6('0x4c')]['id'])});}});}})[_0xafb6('0x27')](respondWithStatusCode(_0x48c467,null))['catch'](handleError(_0x48c467,null));};exports[_0xafb6('0x8b')]=function(_0x2b987e,_0x2da090,_0x43cdf7){var _0x2a5d91={};var _0x5900e9={};var _0x56090b;var _0x460291;return db[_0xafb6('0x32')][_0xafb6('0x59')]({'where':{'id':_0x2b987e[_0xafb6('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2da090,null))[_0xafb6('0x27')](function(_0x262f60){if(_0x262f60){_0x56090b=_0x262f60;_0x5900e9[_0xafb6('0x37')]=_['keys'](db[_0xafb6('0x68')][_0xafb6('0x33')]);_0x5900e9[_0xafb6('0x39')]=_[_0xafb6('0x38')](_0x2b987e[_0xafb6('0x39')]);_0x5900e9[_0xafb6('0x3a')]=_[_0xafb6('0x3b')](_0x5900e9[_0xafb6('0x37')],_0x5900e9[_0xafb6('0x39')]);_0x2a5d91[_0xafb6('0x3c')]=_[_0xafb6('0x3b')](_0x5900e9['model'],qs['fields'](_0x2b987e['query'][_0xafb6('0x3d')]));_0x2a5d91[_0xafb6('0x3c')]=_0x2a5d91['attributes'][_0xafb6('0x3e')]?_0x2a5d91[_0xafb6('0x3c')]:_0x5900e9[_0xafb6('0x37')];_0x2a5d91['order']=qs[_0xafb6('0x42')](_0x2b987e[_0xafb6('0x39')]['sort']);_0x2a5d91[_0xafb6('0x43')]=qs[_0xafb6('0x3a')](_['pick'](_0x2b987e[_0xafb6('0x39')],_0x5900e9[_0xafb6('0x3a')]));if(_0x2b987e[_0xafb6('0x39')]['filter']){_0x2a5d91[_0xafb6('0x43')]=_[_0xafb6('0x46')](_0x2a5d91['where'],{'$or':_[_0xafb6('0x31')](_0x2a5d91[_0xafb6('0x3c')],function(_0x17328b){var _0x2fa2ed={};_0x2fa2ed[_0x17328b]={'$like':'%'+_0x2b987e[_0xafb6('0x39')]['filter']+'%'};return _0x2fa2ed;})});}_0x2a5d91=_[_0xafb6('0x46')]({},_0x2a5d91,_0x2b987e[_0xafb6('0x47')]);return _0x56090b[_0xafb6('0x8b')](_0x2a5d91);}})[_0xafb6('0x27')](function(_0x33a393){if(_0x33a393){_0x460291=_0x33a393[_0xafb6('0x3e')];if(!_0x2b987e[_0xafb6('0x39')]['hasOwnProperty'](_0xafb6('0x40'))){_0x2a5d91[_0xafb6('0x1e')]=qs[_0xafb6('0x1e')](_0x2b987e['query']['limit']);_0x2a5d91[_0xafb6('0x1d')]=qs[_0xafb6('0x1d')](_0x2b987e[_0xafb6('0x39')][_0xafb6('0x1d')]);}return _0x56090b[_0xafb6('0x8b')](_0x2a5d91);}})[_0xafb6('0x27')](function(_0x580db5){if(_0x580db5){return _0x580db5?{'count':_0x460291,'rows':_0x580db5}:null;}})['then'](respondWithResult(_0x2da090,null))['catch'](handleError(_0x2da090,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 0e45e7d..fbf72cc 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 _0xa7fa=['save','update','remove','emit','hook','events','../../mysqldb','WhatsappQueue','setMaxListeners'];(function(_0x4e6c6b,_0x50c1f2){var _0x12d8d9=function(_0x68d410){while(--_0x68d410){_0x4e6c6b['push'](_0x4e6c6b['shift']());}};_0x12d8d9(++_0x50c1f2);}(_0xa7fa,0x188));var _0xaa7f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa7fa[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0xaa7f('0x0'));var WhatsappQueue=require(_0xaa7f('0x1'))['db'][_0xaa7f('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xaa7f('0x3')](0x0);var events={'afterCreate':_0xaa7f('0x4'),'afterUpdate':_0xaa7f('0x5'),'afterDestroy':_0xaa7f('0x6')};function emitEvent(_0x3138b2){return function(_0x5c6ed9,_0x3d95da,_0x4dd47f){WhatsappQueueEvents[_0xaa7f('0x7')](_0x3138b2+':'+_0x5c6ed9['id'],_0x5c6ed9);WhatsappQueueEvents[_0xaa7f('0x7')](_0x3138b2,_0x5c6ed9);_0x4dd47f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0xaa7f('0x8')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents; \ No newline at end of file +var _0xab4c=['emit','exports','events','WhatsappQueue','setMaxListeners','update','remove'];(function(_0x139c0c,_0x564bd8){var _0x2037f9=function(_0x4d2f36){while(--_0x4d2f36){_0x139c0c['push'](_0x139c0c['shift']());}};_0x2037f9(++_0x564bd8);}(_0xab4c,0x1f3));var _0xcab4=function(_0x38ef9b,_0x27e000){_0x38ef9b=_0x38ef9b-0x0;var _0x4c097d=_0xab4c[_0x38ef9b];return _0x4c097d;};'use strict';var EventEmitter=require(_0xcab4('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0xcab4('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xcab4('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xcab4('0x3'),'afterDestroy':_0xcab4('0x4')};function emitEvent(_0x50f62e){return function(_0x10c9a5,_0x5bfa74,_0xc8171d){WhatsappQueueEvents[_0xcab4('0x5')](_0x50f62e+':'+_0x10c9a5['id'],_0x10c9a5);WhatsappQueueEvents[_0xcab4('0x5')](_0x50f62e,_0x10c9a5);_0xc8171d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0xcab4('0x6')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 8a82395..c266490 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 _0x0fd6=['../../config/logger','moment','bluebird','path','./whatsappQueue.attributes','exports','WhatsappQueue','whatsapp_queues','lodash'];(function(_0x1667df,_0x266940){var _0x341abf=function(_0x123c3f){while(--_0x123c3f){_0x1667df['push'](_0x1667df['shift']());}};_0x341abf(++_0x266940);}(_0x0fd6,0x1b8));var _0x60fd=function(_0xec84d8,_0x31f774){_0xec84d8=_0xec84d8-0x0;var _0x281e56=_0x0fd6[_0xec84d8];return _0x281e56;};'use strict';var _=require(_0x60fd('0x0'));var util=require('util');var logger=require(_0x60fd('0x1'))('api');var moment=require(_0x60fd('0x2'));var BPromise=require(_0x60fd('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x60fd('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x60fd('0x5'));module[_0x60fd('0x6')]=function(_0x3dc4bb,_0x274a96){return _0x3dc4bb['define'](_0x60fd('0x7'),attributes,{'tableName':_0x60fd('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x57ab=['exports','define','WhatsappQueue','whatsapp_queues','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueue.attributes'];(function(_0x343b8e,_0x8f53b5){var _0x125365=function(_0x65127b){while(--_0x65127b){_0x343b8e['push'](_0x343b8e['shift']());}};_0x125365(++_0x8f53b5);}(_0x57ab,0x86));var _0xb57a=function(_0x14e65e,_0x461afd){_0x14e65e=_0x14e65e-0x0;var _0x4774a1=_0x57ab[_0x14e65e];return _0x4774a1;};'use strict';var _=require(_0xb57a('0x0'));var util=require(_0xb57a('0x1'));var logger=require(_0xb57a('0x2'))('api');var moment=require('moment');var BPromise=require(_0xb57a('0x3'));var rp=require(_0xb57a('0x4'));var fs=require('fs');var path=require(_0xb57a('0x5'));var rimraf=require(_0xb57a('0x6'));var config=require(_0xb57a('0x7'));var attributes=require(_0xb57a('0x8'));module[_0xb57a('0x9')]=function(_0x28b835,_0x2951ee){return _0x28b835[_0xb57a('0xa')](_0xb57a('0xb'),attributes,{'tableName':_0xb57a('0xc'),'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 f8df04a..63193d6 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 _0x6800=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./whatsappQueue.socket','register','WhatsappQueue,\x20%s,\x20%s','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','findAll','options','raw','where','attributes','map','include','model','then','GetWhatsappQueue','catch','find','ShowWhatsappQueue','moment','bluebird','randomstring','ioredis'];(function(_0x44da11,_0x1e73cc){var _0x4fc812=function(_0x1db72b){while(--_0x1db72b){_0x44da11['push'](_0x44da11['shift']());}};_0x4fc812(++_0x1e73cc);}(_0x6800,0x1ea));var _0x0680=function(_0x47341f,_0x1ed16b){_0x47341f=_0x47341f-0x0;var _0x49698f=_0x6800[_0x47341f];return _0x49698f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0680('0x0'));var BPromise=require(_0x0680('0x1'));var rs=require(_0x0680('0x2'));var fs=require('fs');var Redis=require(_0x0680('0x3'));var db=require(_0x0680('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0680('0x5'))(_0x0680('0x6'));var config=require(_0x0680('0x7'));var jayson=require(_0x0680('0x8'));var client=jayson[_0x0680('0x9')][_0x0680('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x0680('0xb')],{'host':_0x0680('0xc'),'port':0x18eb});var socket=require(_0x0680('0xd'))(new Redis(config[_0x0680('0xb')]));require(_0x0680('0xe'))[_0x0680('0xf')](socket);function respondWithRpcPromise(_0x4991c4,_0x79e251,_0xa764c5){return new BPromise(function(_0x52ac97,_0x2f830c){return client['request'](_0x4991c4,_0xa764c5)['then'](function(_0x31bab0){logger['info'](_0x0680('0x10'),_0x79e251,'request\x20sent');logger[_0x0680('0x11')](_0x0680('0x12'),_0x79e251,_0x0680('0x13'),JSON[_0x0680('0x14')](_0x31bab0));if(_0x31bab0[_0x0680('0x15')]){if(_0x31bab0['error']['code']===0x1f4){logger[_0x0680('0x15')]('WhatsappQueue,\x20%s,\x20%s',_0x79e251,_0x31bab0[_0x0680('0x15')][_0x0680('0x16')]);return _0x2f830c(_0x31bab0[_0x0680('0x15')][_0x0680('0x16')]);}logger[_0x0680('0x15')](_0x0680('0x10'),_0x79e251,_0x31bab0[_0x0680('0x15')][_0x0680('0x16')]);return _0x52ac97(_0x31bab0[_0x0680('0x15')]['message']);}else{logger[_0x0680('0x17')](_0x0680('0x10'),_0x79e251,_0x0680('0x13'));_0x52ac97(_0x31bab0[_0x0680('0x18')][_0x0680('0x16')]);}})['catch'](function(_0x199199){logger[_0x0680('0x15')](_0x0680('0x10'),_0x79e251,_0x199199);_0x2f830c(_0x199199);});});}exports['GetWhatsappQueue']=function(_0x336cee){var _0x29007a=this;return new Promise(function(_0x15a26f,_0x1538d8){return db['WhatsappQueue'][_0x0680('0x19')]({'raw':_0x336cee[_0x0680('0x1a')]?_0x336cee[_0x0680('0x1a')][_0x0680('0x1b')]===undefined?!![]:![]:!![],'where':_0x336cee[_0x0680('0x1a')]?_0x336cee[_0x0680('0x1a')][_0x0680('0x1c')]||null:null,'attributes':_0x336cee[_0x0680('0x1a')]?_0x336cee['options'][_0x0680('0x1d')]||null:null,'limit':_0x336cee[_0x0680('0x1a')]?_0x336cee[_0x0680('0x1a')]['limit']||null:null,'include':_0x336cee[_0x0680('0x1a')]?_0x336cee['options']['include']?_[_0x0680('0x1e')](_0x336cee['options'][_0x0680('0x1f')],function(_0x98cde9){return{'model':db[_0x98cde9[_0x0680('0x20')]],'as':_0x98cde9['as'],'attributes':_0x98cde9[_0x0680('0x1d')],'include':_0x98cde9['include']?_[_0x0680('0x1e')](_0x98cde9[_0x0680('0x1f')],function(_0x405cf2){return{'model':db[_0x405cf2[_0x0680('0x20')]],'as':_0x405cf2['as'],'attributes':_0x405cf2[_0x0680('0x1d')],'include':_0x405cf2['include']?_[_0x0680('0x1e')](_0x405cf2[_0x0680('0x1f')],function(_0x298221){return{'model':db[_0x298221[_0x0680('0x20')]],'as':_0x298221['as'],'attributes':_0x298221[_0x0680('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0680('0x21')](function(_0x4212d){logger[_0x0680('0x17')](_0x0680('0x22'),_0x336cee);logger[_0x0680('0x11')](_0x0680('0x22'),_0x336cee,JSON[_0x0680('0x14')](_0x4212d));_0x15a26f(_0x4212d);})[_0x0680('0x23')](function(_0x4146b3){logger[_0x0680('0x15')](_0x0680('0x22'),_0x4146b3[_0x0680('0x16')],_0x336cee);_0x1538d8(_0x29007a['error'](0x1f4,_0x4146b3[_0x0680('0x16')]));});});};exports['ShowWhatsappQueue']=function(_0x46504f){var _0x51d197=this;return new Promise(function(_0x305e55,_0x3586db){return db['WhatsappQueue'][_0x0680('0x24')]({'raw':_0x46504f[_0x0680('0x1a')]?_0x46504f[_0x0680('0x1a')][_0x0680('0x1b')]===undefined?!![]:![]:!![],'where':_0x46504f[_0x0680('0x1a')]?_0x46504f['options'][_0x0680('0x1c')]||null:null,'attributes':_0x46504f[_0x0680('0x1a')]?_0x46504f[_0x0680('0x1a')][_0x0680('0x1d')]||null:null,'include':_0x46504f['options']?_0x46504f['options'][_0x0680('0x1f')]?_[_0x0680('0x1e')](_0x46504f['options']['include'],function(_0x24d777){return{'model':db[_0x24d777[_0x0680('0x20')]],'as':_0x24d777['as'],'attributes':_0x24d777['attributes'],'include':_0x24d777[_0x0680('0x1f')]?_['map'](_0x24d777['include'],function(_0x277954){return{'model':db[_0x277954['model']],'as':_0x277954['as'],'attributes':_0x277954[_0x0680('0x1d')],'include':_0x277954[_0x0680('0x1f')]?_[_0x0680('0x1e')](_0x277954[_0x0680('0x1f')],function(_0x580e4d){return{'model':db[_0x580e4d[_0x0680('0x20')]],'as':_0x580e4d['as'],'attributes':_0x580e4d[_0x0680('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0680('0x21')](function(_0x36b6ae){logger['info'](_0x0680('0x25'),_0x46504f);logger[_0x0680('0x11')](_0x0680('0x25'),_0x46504f,JSON['stringify'](_0x36b6ae));_0x305e55(_0x36b6ae);})[_0x0680('0x23')](function(_0x57c9f8){logger[_0x0680('0x15')](_0x0680('0x25'),_0x57c9f8[_0x0680('0x16')],_0x46504f);_0x3586db(_0x51d197['error'](0x1f4,_0x57c9f8[_0x0680('0x16')]));});});}; \ No newline at end of file +var _0x2d5d=['include','model','attributes','map','GetWhatsappQueue','ShowWhatsappQueue','find','util','ioredis','../../config/utils','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','options','raw','where','limit'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0x2d5d,0x117));var _0xd2d5=function(_0x40b09e,_0x2c6784){_0x40b09e=_0x40b09e-0x0;var _0x4bb459=_0x2d5d[_0x40b09e];return _0x4bb459;};'use strict';var _=require('lodash');var util=require(_0xd2d5('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd2d5('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0xd2d5('0x2'));var logger=require('../../config/logger')('rpc');var config=require(_0xd2d5('0x3'));var jayson=require(_0xd2d5('0x4'));var client=jayson[_0xd2d5('0x5')]['http']({'port':0x232a});config[_0xd2d5('0x6')]=_[_0xd2d5('0x7')](config[_0xd2d5('0x6')],{'host':_0xd2d5('0x8'),'port':0x18eb});var socket=require(_0xd2d5('0x9'))(new Redis(config[_0xd2d5('0x6')]));require(_0xd2d5('0xa'))[_0xd2d5('0xb')](socket);function respondWithRpcPromise(_0x4615d6,_0x5bcc4b,_0x5f5b4a){return new BPromise(function(_0xfb76ef,_0x47ea52){return client['request'](_0x4615d6,_0x5f5b4a)[_0xd2d5('0xc')](function(_0x5d0a2b){logger[_0xd2d5('0xd')](_0xd2d5('0xe'),_0x5bcc4b,_0xd2d5('0xf'));logger[_0xd2d5('0x10')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x5bcc4b,_0xd2d5('0xf'),JSON[_0xd2d5('0x11')](_0x5d0a2b));if(_0x5d0a2b[_0xd2d5('0x12')]){if(_0x5d0a2b[_0xd2d5('0x12')][_0xd2d5('0x13')]===0x1f4){logger[_0xd2d5('0x12')]('WhatsappQueue,\x20%s,\x20%s',_0x5bcc4b,_0x5d0a2b[_0xd2d5('0x12')][_0xd2d5('0x14')]);return _0x47ea52(_0x5d0a2b['error'][_0xd2d5('0x14')]);}logger[_0xd2d5('0x12')](_0xd2d5('0xe'),_0x5bcc4b,_0x5d0a2b[_0xd2d5('0x12')][_0xd2d5('0x14')]);return _0xfb76ef(_0x5d0a2b[_0xd2d5('0x12')]['message']);}else{logger[_0xd2d5('0xd')](_0xd2d5('0xe'),_0x5bcc4b,_0xd2d5('0xf'));_0xfb76ef(_0x5d0a2b[_0xd2d5('0x15')][_0xd2d5('0x14')]);}})[_0xd2d5('0x16')](function(_0x12878b){logger[_0xd2d5('0x12')]('WhatsappQueue,\x20%s,\x20%s',_0x5bcc4b,_0x12878b);_0x47ea52(_0x12878b);});});}exports['GetWhatsappQueue']=function(_0x41e4a1){var _0x2e95bc=this;return new Promise(function(_0x50d9f4,_0x115f93){return db['WhatsappQueue']['findAll']({'raw':_0x41e4a1[_0xd2d5('0x17')]?_0x41e4a1[_0xd2d5('0x17')][_0xd2d5('0x18')]===undefined?!![]:![]:!![],'where':_0x41e4a1[_0xd2d5('0x17')]?_0x41e4a1[_0xd2d5('0x17')][_0xd2d5('0x19')]||null:null,'attributes':_0x41e4a1['options']?_0x41e4a1[_0xd2d5('0x17')]['attributes']||null:null,'limit':_0x41e4a1[_0xd2d5('0x17')]?_0x41e4a1['options'][_0xd2d5('0x1a')]||null:null,'include':_0x41e4a1['options']?_0x41e4a1[_0xd2d5('0x17')]['include']?_['map'](_0x41e4a1[_0xd2d5('0x17')][_0xd2d5('0x1b')],function(_0x2cdd40){return{'model':db[_0x2cdd40[_0xd2d5('0x1c')]],'as':_0x2cdd40['as'],'attributes':_0x2cdd40[_0xd2d5('0x1d')],'include':_0x2cdd40['include']?_[_0xd2d5('0x1e')](_0x2cdd40['include'],function(_0x13b872){return{'model':db[_0x13b872['model']],'as':_0x13b872['as'],'attributes':_0x13b872[_0xd2d5('0x1d')],'include':_0x13b872[_0xd2d5('0x1b')]?_[_0xd2d5('0x1e')](_0x13b872['include'],function(_0x10d71e){return{'model':db[_0x10d71e[_0xd2d5('0x1c')]],'as':_0x10d71e['as'],'attributes':_0x10d71e[_0xd2d5('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xd2d5('0xc')](function(_0x18794a){logger[_0xd2d5('0xd')](_0xd2d5('0x1f'),_0x41e4a1);logger[_0xd2d5('0x10')]('GetWhatsappQueue',_0x41e4a1,JSON[_0xd2d5('0x11')](_0x18794a));_0x50d9f4(_0x18794a);})[_0xd2d5('0x16')](function(_0x1147b3){logger['error'](_0xd2d5('0x1f'),_0x1147b3[_0xd2d5('0x14')],_0x41e4a1);_0x115f93(_0x2e95bc[_0xd2d5('0x12')](0x1f4,_0x1147b3['message']));});});};exports[_0xd2d5('0x20')]=function(_0x39fd0f){var _0x4144c4=this;return new Promise(function(_0x28694c,_0x170ee2){return db['WhatsappQueue'][_0xd2d5('0x21')]({'raw':_0x39fd0f[_0xd2d5('0x17')]?_0x39fd0f[_0xd2d5('0x17')][_0xd2d5('0x18')]===undefined?!![]:![]:!![],'where':_0x39fd0f[_0xd2d5('0x17')]?_0x39fd0f['options']['where']||null:null,'attributes':_0x39fd0f['options']?_0x39fd0f[_0xd2d5('0x17')][_0xd2d5('0x1d')]||null:null,'include':_0x39fd0f[_0xd2d5('0x17')]?_0x39fd0f['options'][_0xd2d5('0x1b')]?_['map'](_0x39fd0f[_0xd2d5('0x17')]['include'],function(_0x4e692e){return{'model':db[_0x4e692e[_0xd2d5('0x1c')]],'as':_0x4e692e['as'],'attributes':_0x4e692e['attributes'],'include':_0x4e692e['include']?_[_0xd2d5('0x1e')](_0x4e692e['include'],function(_0x17b15c){return{'model':db[_0x17b15c[_0xd2d5('0x1c')]],'as':_0x17b15c['as'],'attributes':_0x17b15c['attributes'],'include':_0x17b15c[_0xd2d5('0x1b')]?_[_0xd2d5('0x1e')](_0x17b15c[_0xd2d5('0x1b')],function(_0x4d6946){return{'model':db[_0x4d6946[_0xd2d5('0x1c')]],'as':_0x4d6946['as'],'attributes':_0x4d6946[_0xd2d5('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xd2d5('0xc')](function(_0x1554e2){logger[_0xd2d5('0xd')](_0xd2d5('0x20'),_0x39fd0f);logger[_0xd2d5('0x10')](_0xd2d5('0x20'),_0x39fd0f,JSON[_0xd2d5('0x11')](_0x1554e2));_0x28694c(_0x1554e2);})[_0xd2d5('0x16')](function(_0x2a039e){logger[_0xd2d5('0x12')](_0xd2d5('0x20'),_0x2a039e['message'],_0x39fd0f);_0x170ee2(_0x4144c4['error'](0x1f4,_0x2a039e[_0xd2d5('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 0506ba3..e9b99b6 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 _0x0cbd=['save','remove','update','emit','register','length','whatsappQueue:','./whatsappQueue.events'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0cbd,0x1e7));var _0xd0cb=function(_0x47e9cb,_0x41e8b8){_0x47e9cb=_0x47e9cb-0x0;var _0x20b27e=_0x0cbd[_0x47e9cb];return _0x20b27e;};'use strict';var WhatsappQueueEvents=require(_0xd0cb('0x0'));var events=[_0xd0cb('0x1'),_0xd0cb('0x2'),_0xd0cb('0x3')];function createListener(_0x4f5417,_0x119eaa){return function(_0x49bcdf){_0x119eaa[_0xd0cb('0x4')](_0x4f5417,_0x49bcdf);};}function removeListener(_0x5d5c16,_0x1af25d){return function(){WhatsappQueueEvents['removeListener'](_0x5d5c16,_0x1af25d);};}exports[_0xd0cb('0x5')]=function(_0x4d1cb3){for(var _0x5940d5=0x0,_0x27e76a=events[_0xd0cb('0x6')];_0x5940d5<_0x27e76a;_0x5940d5++){var _0xe3860d=events[_0x5940d5];var _0x462886=createListener(_0xd0cb('0x7')+_0xe3860d,_0x4d1cb3);WhatsappQueueEvents['on'](_0xe3860d,_0x462886);}}; \ No newline at end of file +var _0xa83a=['save','update','emit','removeListener','register','length','./whatsappQueue.events'];(function(_0x23e9af,_0x29c52c){var _0x2c4f8b=function(_0x1beca1){while(--_0x1beca1){_0x23e9af['push'](_0x23e9af['shift']());}};_0x2c4f8b(++_0x29c52c);}(_0xa83a,0x8b));var _0xaa83=function(_0x55cfb0,_0x14d24f){_0x55cfb0=_0x55cfb0-0x0;var _0x3e529b=_0xa83a[_0x55cfb0];return _0x3e529b;};'use strict';var WhatsappQueueEvents=require(_0xaa83('0x0'));var events=[_0xaa83('0x1'),'remove',_0xaa83('0x2')];function createListener(_0x417409,_0x349848){return function(_0x119341){_0x349848[_0xaa83('0x3')](_0x417409,_0x119341);};}function removeListener(_0x42c920,_0x5075de){return function(){WhatsappQueueEvents[_0xaa83('0x4')](_0x42c920,_0x5075de);};}exports[_0xaa83('0x5')]=function(_0x2a04fa){for(var _0x3541e7=0x0,_0x282070=events[_0xaa83('0x6')];_0x3541e7<_0x282070;_0x3541e7++){var _0x4fda54=events[_0x3541e7];var _0x30c398=createListener('whatsappQueue:'+_0x4fda54,_0x2a04fa);WhatsappQueueEvents['on'](_0x4fda54,_0x30c398);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index a9b15ad..850452f 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 _0x1009=['put','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','isAuthenticated','get','/describe','describe','/:id','show','post','create'];(function(_0x373ba3,_0x265ccc){var _0x151f21=function(_0x35f419){while(--_0x35f419){_0x373ba3['push'](_0x373ba3['shift']());}};_0x151f21(++_0x265ccc);}(_0x1009,0xb4));var _0x9100=function(_0x5cec82,_0xa5bba5){_0x5cec82=_0x5cec82-0x0;var _0x51779d=_0x1009[_0x5cec82];return _0x51779d;};'use strict';var multer=require(_0x9100('0x0'));var util=require(_0x9100('0x1'));var path=require(_0x9100('0x2'));var timeout=require(_0x9100('0x3'));var express=require(_0x9100('0x4'));var router=express['Router']();var fs_extra=require(_0x9100('0x5'));var auth=require(_0x9100('0x6'));var interaction=require(_0x9100('0x7'));var config=require(_0x9100('0x8'));var controller=require(_0x9100('0x9'));router['get']('/',auth[_0x9100('0xa')](),controller['index']);router[_0x9100('0xb')](_0x9100('0xc'),auth[_0x9100('0xa')](),controller[_0x9100('0xd')]);router['get'](_0x9100('0xe'),auth['isAuthenticated'](),controller[_0x9100('0xf')]);router[_0x9100('0x10')]('/',auth[_0x9100('0xa')](),controller[_0x9100('0x11')]);router[_0x9100('0x12')](_0x9100('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x9100('0x13')](_0x9100('0xe'),auth[_0x9100('0xa')](),controller[_0x9100('0x14')]);module[_0x9100('0x15')]=router; \ No newline at end of file +var _0x016d=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','destroy'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x016d,0xe7));var _0xd016=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x016d[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0xd016('0x0'));var util=require(_0xd016('0x1'));var path=require(_0xd016('0x2'));var timeout=require(_0xd016('0x3'));var express=require(_0xd016('0x4'));var router=express['Router']();var fs_extra=require(_0xd016('0x5'));var auth=require(_0xd016('0x6'));var interaction=require(_0xd016('0x7'));var config=require(_0xd016('0x8'));var controller=require(_0xd016('0x9'));router[_0xd016('0xa')]('/',auth[_0xd016('0xb')](),controller[_0xd016('0xc')]);router['get'](_0xd016('0xd'),auth[_0xd016('0xb')](),controller[_0xd016('0xe')]);router[_0xd016('0xa')](_0xd016('0xf'),auth['isAuthenticated'](),controller[_0xd016('0x10')]);router[_0xd016('0x11')]('/',auth[_0xd016('0xb')](),controller[_0xd016('0x12')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xd016('0x13')]);router[_0xd016('0x14')](_0xd016('0xf'),auth[_0xd016('0xb')](),controller[_0xd016('0x15')]);module[_0xd016('0x16')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index ce51147..329d488 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 _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x4a898f,_0x215b00){var _0x415d7f=function(_0x45b145){while(--_0x45b145){_0x4a898f['push'](_0x4a898f['shift']());}};_0x415d7f(++_0x215b00);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file +var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x69fb88,_0x1bdce5){var _0x40e428=function(_0x4f88ae){while(--_0x4f88ae){_0x69fb88['push'](_0x69fb88['shift']());}};_0x40e428(++_0x1bdce5);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index 498d4d5..e53cba1 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 _0xb58b=['save','update','destroy','then','error','stack','name','send','index','map','WhatsappQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','include','findAll','rows','catch','find','create','body','params','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','count','limit','set','Content-Range','apply','reject'];(function(_0x5259a9,_0x59547a){var _0x334dc3=function(_0x192d7b){while(--_0x192d7b){_0x5259a9['push'](_0x5259a9['shift']());}};_0x334dc3(++_0x59547a);}(_0xb58b,0x1f1));var _0xbb58=function(_0x594dc0,_0x4b79e4){_0x594dc0=_0x594dc0-0x0;var _0x2ae09f=_0xb58b[_0x594dc0];return _0x2ae09f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbb58('0x0'));var zipdir=require(_0xbb58('0x1'));var jsonpatch=require(_0xbb58('0x2'));var rp=require('request-promise');var moment=require(_0xbb58('0x3'));var BPromise=require(_0xbb58('0x4'));var Mustache=require('mustache');var util=require(_0xbb58('0x5'));var path=require('path');var sox=require(_0xbb58('0x6'));var csv=require(_0xbb58('0x7'));var ejs=require(_0xbb58('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbb58('0x9'));var squel=require(_0xbb58('0xa'));var crypto=require(_0xbb58('0xb'));var jsforce=require(_0xbb58('0xc'));var deskjs=require(_0xbb58('0xd'));var toCsv=require(_0xbb58('0x7'));var querystring=require(_0xbb58('0xe'));var Papa=require(_0xbb58('0xf'));var Redis=require(_0xbb58('0x10'));var authService=require(_0xbb58('0x11'));var qs=require(_0xbb58('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb58('0x13'));var logger=require('../../config/logger')(_0xbb58('0x14'));var utils=require(_0xbb58('0x15'));var config=require(_0xbb58('0x16'));var licenseUtil=require(_0xbb58('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe88799,_0x18810f){_0x18810f=_0x18810f||0xcc;return function(_0x4cda21){if(_0x4cda21){return _0xe88799[_0xbb58('0x18')](_0x18810f);}return _0xe88799[_0xbb58('0x19')](_0x18810f)[_0xbb58('0x1a')]();};}function respondWithResult(_0x3b9406,_0x19ceda){_0x19ceda=_0x19ceda||0xc8;return function(_0x58245f){if(_0x58245f){return _0x3b9406[_0xbb58('0x19')](_0x19ceda)[_0xbb58('0x1b')](_0x58245f);}};}function respondWithFilteredResult(_0x5f4751,_0x4ba30e){return function(_0x33c20f){if(_0x33c20f){var _0x445b1f=typeof _0x4ba30e[_0xbb58('0x1c')]==='undefined'&&typeof _0x4ba30e['limit']==='undefined';var _0x55156e=_0x33c20f[_0xbb58('0x1d')];var _0x3134ea=_0x445b1f?0x0:_0x4ba30e['offset'];var _0xbee66=_0x445b1f?_0x33c20f['count']:_0x4ba30e[_0xbb58('0x1c')]+_0x4ba30e[_0xbb58('0x1e')];var _0x3c33d9;if(_0xbee66>=_0x55156e){_0xbee66=_0x55156e;_0x3c33d9=0xc8;}else{_0x3c33d9=0xce;}_0x5f4751[_0xbb58('0x19')](_0x3c33d9);return _0x5f4751[_0xbb58('0x1f')](_0xbb58('0x20'),_0x3134ea+'-'+_0xbee66+'/'+_0x55156e)[_0xbb58('0x1b')](_0x33c20f);}return null;};}function patchUpdates(_0x497fd0){return function(_0x84f34){try{jsonpatch[_0xbb58('0x21')](_0x84f34,_0x497fd0,!![]);}catch(_0x3e64fe){return BPromise[_0xbb58('0x22')](_0x3e64fe);}return _0x84f34[_0xbb58('0x23')]();};}function saveUpdates(_0x5d4a91,_0x49453a){return function(_0x350be7){if(_0x350be7){return _0x350be7[_0xbb58('0x24')](_0x5d4a91)['then'](function(_0x27806d){return _0x27806d;});}return null;};}function removeEntity(_0x53b693,_0x21964d){return function(_0x287822){if(_0x287822){return _0x287822[_0xbb58('0x25')]()[_0xbb58('0x26')](function(){_0x53b693[_0xbb58('0x19')](0xcc)[_0xbb58('0x1a')]();});}};}function handleEntityNotFound(_0x2d556a,_0x15e4c5){return function(_0x4e0303){if(!_0x4e0303){_0x2d556a[_0xbb58('0x18')](0x194);}return _0x4e0303;};}function handleError(_0x3bd550,_0x1be0ae){_0x1be0ae=_0x1be0ae||0x1f4;return function(_0x129094){logger[_0xbb58('0x27')](_0x129094[_0xbb58('0x28')]);if(_0x129094[_0xbb58('0x29')]){delete _0x129094[_0xbb58('0x29')];}_0x3bd550[_0xbb58('0x19')](_0x1be0ae)[_0xbb58('0x2a')](_0x129094);};}exports[_0xbb58('0x2b')]=function(_0x28b3a3,_0x2a0481){var _0x4157c4={},_0x3559b6={},_0x573cca={'count':0x0,'rows':[]};var _0x2b0f73=_[_0xbb58('0x2c')](db[_0xbb58('0x2d')][_0xbb58('0x2e')],function(_0x3304b9){return{'name':_0x3304b9[_0xbb58('0x2f')],'type':_0x3304b9[_0xbb58('0x30')][_0xbb58('0x31')]};});_0x3559b6[_0xbb58('0x32')]=_['map'](_0x2b0f73,_0xbb58('0x29'));_0x3559b6[_0xbb58('0x33')]=_[_0xbb58('0x34')](_0x28b3a3[_0xbb58('0x33')]);_0x3559b6[_0xbb58('0x35')]=_[_0xbb58('0x36')](_0x3559b6[_0xbb58('0x32')],_0x3559b6[_0xbb58('0x33')]);_0x4157c4[_0xbb58('0x37')]=_[_0xbb58('0x36')](_0x3559b6[_0xbb58('0x32')],qs[_0xbb58('0x38')](_0x28b3a3[_0xbb58('0x33')]['fields']));_0x4157c4['attributes']=_0x4157c4['attributes'][_0xbb58('0x39')]?_0x4157c4[_0xbb58('0x37')]:_0x3559b6[_0xbb58('0x32')];if(!_0x28b3a3[_0xbb58('0x33')][_0xbb58('0x3a')](_0xbb58('0x3b'))){_0x4157c4[_0xbb58('0x1e')]=qs[_0xbb58('0x1e')](_0x28b3a3['query'][_0xbb58('0x1e')]);_0x4157c4[_0xbb58('0x1c')]=qs['offset'](_0x28b3a3[_0xbb58('0x33')]['offset']);}_0x4157c4[_0xbb58('0x3c')]=qs['sort'](_0x28b3a3[_0xbb58('0x33')][_0xbb58('0x3d')]);_0x4157c4['where']=qs[_0xbb58('0x35')](_[_0xbb58('0x3e')](_0x28b3a3[_0xbb58('0x33')],_0x3559b6[_0xbb58('0x35')]),_0x2b0f73);if(_0x28b3a3[_0xbb58('0x33')][_0xbb58('0x3f')]){_0x4157c4[_0xbb58('0x40')]=_[_0xbb58('0x41')](_0x4157c4['where'],{'$or':_[_0xbb58('0x2c')](_0x2b0f73,function(_0x31aa4b){if(_0x31aa4b[_0xbb58('0x30')]!=='VIRTUAL'){var _0x4dbd5e={};_0x4dbd5e[_0x31aa4b[_0xbb58('0x29')]]={'$like':'%'+_0x28b3a3['query'][_0xbb58('0x3f')]+'%'};return _0x4dbd5e;}})});}_0x4157c4=_[_0xbb58('0x41')]({},_0x4157c4,_0x28b3a3[_0xbb58('0x42')]);var _0x560911={'where':_0x4157c4['where']};return db[_0xbb58('0x2d')][_0xbb58('0x1d')](_0x560911)[_0xbb58('0x26')](function(_0x24d82d){_0x573cca[_0xbb58('0x1d')]=_0x24d82d;if(_0x28b3a3[_0xbb58('0x33')]['includeAll']){_0x4157c4[_0xbb58('0x43')]=[{'all':!![]}];}return db[_0xbb58('0x2d')][_0xbb58('0x44')](_0x4157c4);})[_0xbb58('0x26')](function(_0x1185b3){_0x573cca[_0xbb58('0x45')]=_0x1185b3;return _0x573cca;})['then'](respondWithFilteredResult(_0x2a0481,_0x4157c4))[_0xbb58('0x46')](handleError(_0x2a0481,null));};exports['show']=function(_0x22f1c3,_0x285ad4){var _0x29fb1c={'raw':!![],'where':{'id':_0x22f1c3['params']['id']}},_0x45817f={};_0x45817f[_0xbb58('0x32')]=_[_0xbb58('0x34')](db[_0xbb58('0x2d')][_0xbb58('0x2e')]);_0x45817f['query']=_[_0xbb58('0x34')](_0x22f1c3['query']);_0x45817f[_0xbb58('0x35')]=_[_0xbb58('0x36')](_0x45817f[_0xbb58('0x32')],_0x45817f[_0xbb58('0x33')]);_0x29fb1c[_0xbb58('0x37')]=_[_0xbb58('0x36')](_0x45817f[_0xbb58('0x32')],qs[_0xbb58('0x38')](_0x22f1c3[_0xbb58('0x33')][_0xbb58('0x38')]));_0x29fb1c[_0xbb58('0x37')]=_0x29fb1c[_0xbb58('0x37')][_0xbb58('0x39')]?_0x29fb1c['attributes']:_0x45817f[_0xbb58('0x32')];if(_0x22f1c3['query']['includeAll']){_0x29fb1c[_0xbb58('0x43')]=[{'all':!![]}];}_0x29fb1c=_[_0xbb58('0x41')]({},_0x29fb1c,_0x22f1c3[_0xbb58('0x42')]);return db[_0xbb58('0x2d')][_0xbb58('0x47')](_0x29fb1c)[_0xbb58('0x26')](handleEntityNotFound(_0x285ad4,null))[_0xbb58('0x26')](respondWithResult(_0x285ad4,null))[_0xbb58('0x46')](handleError(_0x285ad4,null));};exports[_0xbb58('0x48')]=function(_0x39995e,_0x440fb3){return db['WhatsappQueueReport'][_0xbb58('0x48')](_0x39995e[_0xbb58('0x49')],{})['then'](respondWithResult(_0x440fb3,0xc9))[_0xbb58('0x46')](handleError(_0x440fb3,null));};exports[_0xbb58('0x24')]=function(_0xf94897,_0xdb0ff7){if(_0xf94897['body']['id']){delete _0xf94897[_0xbb58('0x49')]['id'];}return db['WhatsappQueueReport'][_0xbb58('0x47')]({'where':{'id':_0xf94897[_0xbb58('0x4a')]['id']}})[_0xbb58('0x26')](handleEntityNotFound(_0xdb0ff7,null))['then'](saveUpdates(_0xf94897[_0xbb58('0x49')],null))[_0xbb58('0x26')](respondWithResult(_0xdb0ff7,null))['catch'](handleError(_0xdb0ff7,null));};exports[_0xbb58('0x25')]=function(_0x4ca201,_0x28301d){return db[_0xbb58('0x2d')][_0xbb58('0x47')]({'where':{'id':_0x4ca201[_0xbb58('0x4a')]['id']}})[_0xbb58('0x26')](handleEntityNotFound(_0x28301d,null))[_0xbb58('0x26')](removeEntity(_0x28301d,null))[_0xbb58('0x46')](handleError(_0x28301d,null));};exports['describe']=function(_0x449088,_0x1fd892){return db['WhatsappQueueReport'][_0xbb58('0x4b')]()[_0xbb58('0x26')](respondWithResult(_0x1fd892,null))['catch'](handleError(_0x1fd892,null));}; \ No newline at end of file +var _0x0972=['nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','create','body','describe','catch','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','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','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','update','then','destroy','stack','name','send','index','WhatsappQueueReport','rawAttributes','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x2d8280,_0xa9ccd1){var _0x95a565=function(_0x4455a5){while(--_0x4455a5){_0x2d8280['push'](_0x2d8280['shift']());}};_0x95a565(++_0xa9ccd1);}(_0x0972,0x64));var _0x2097=function(_0xe600ba,_0x5dbfab){_0xe600ba=_0xe600ba-0x0;var _0x8a9f17=_0x0972[_0xe600ba];return _0x8a9f17;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2097('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2097('0x1'));var rp=require('request-promise');var moment=require(_0x2097('0x2'));var BPromise=require(_0x2097('0x3'));var Mustache=require('mustache');var util=require(_0x2097('0x4'));var path=require(_0x2097('0x5'));var sox=require(_0x2097('0x6'));var csv=require(_0x2097('0x7'));var ejs=require(_0x2097('0x8'));var fs=require('fs');var fs_extra=require(_0x2097('0x9'));var _=require(_0x2097('0xa'));var squel=require('squel');var crypto=require(_0x2097('0xb'));var jsforce=require(_0x2097('0xc'));var deskjs=require(_0x2097('0xd'));var toCsv=require(_0x2097('0x7'));var querystring=require(_0x2097('0xe'));var Papa=require('papaparse');var Redis=require(_0x2097('0xf'));var authService=require(_0x2097('0x10'));var qs=require(_0x2097('0x11'));var as=require(_0x2097('0x12'));var hardwareService=require(_0x2097('0x13'));var logger=require(_0x2097('0x14'))(_0x2097('0x15'));var utils=require(_0x2097('0x16'));var config=require(_0x2097('0x17'));var licenseUtil=require(_0x2097('0x18'));var db=require(_0x2097('0x19'))['db'];function respondWithStatusCode(_0x3b2f94,_0x170005){_0x170005=_0x170005||0xcc;return function(_0x16871b){if(_0x16871b){return _0x3b2f94[_0x2097('0x1a')](_0x170005);}return _0x3b2f94[_0x2097('0x1b')](_0x170005)[_0x2097('0x1c')]();};}function respondWithResult(_0x1c9ef9,_0x2c3e41){_0x2c3e41=_0x2c3e41||0xc8;return function(_0x354387){if(_0x354387){return _0x1c9ef9['status'](_0x2c3e41)[_0x2097('0x1d')](_0x354387);}};}function respondWithFilteredResult(_0x35c062,_0x4d31bc){return function(_0x4eec05){if(_0x4eec05){var _0x4fc8c5=typeof _0x4d31bc[_0x2097('0x1e')]==='undefined'&&typeof _0x4d31bc[_0x2097('0x1f')]===_0x2097('0x20');var _0x43fec9=_0x4eec05[_0x2097('0x21')];var _0x44c584=_0x4fc8c5?0x0:_0x4d31bc['offset'];var _0x324652=_0x4fc8c5?_0x4eec05[_0x2097('0x21')]:_0x4d31bc[_0x2097('0x1e')]+_0x4d31bc[_0x2097('0x1f')];var _0x1d3804;if(_0x324652>=_0x43fec9){_0x324652=_0x43fec9;_0x1d3804=0xc8;}else{_0x1d3804=0xce;}_0x35c062[_0x2097('0x1b')](_0x1d3804);return _0x35c062[_0x2097('0x22')](_0x2097('0x23'),_0x44c584+'-'+_0x324652+'/'+_0x43fec9)['json'](_0x4eec05);}return null;};}function patchUpdates(_0x4d957e){return function(_0xf65dc6){try{jsonpatch['apply'](_0xf65dc6,_0x4d957e,!![]);}catch(_0x227c00){return BPromise[_0x2097('0x24')](_0x227c00);}return _0xf65dc6['save']();};}function saveUpdates(_0x442db7,_0x5b0582){return function(_0x2e17c8){if(_0x2e17c8){return _0x2e17c8[_0x2097('0x25')](_0x442db7)[_0x2097('0x26')](function(_0x20b93a){return _0x20b93a;});}return null;};}function removeEntity(_0x36b15e,_0x35047b){return function(_0x56390a){if(_0x56390a){return _0x56390a[_0x2097('0x27')]()['then'](function(){_0x36b15e[_0x2097('0x1b')](0xcc)[_0x2097('0x1c')]();});}};}function handleEntityNotFound(_0x345875,_0x9f59bc){return function(_0x499988){if(!_0x499988){_0x345875[_0x2097('0x1a')](0x194);}return _0x499988;};}function handleError(_0x80c5ee,_0x56af3b){_0x56af3b=_0x56af3b||0x1f4;return function(_0x1229fc){logger['error'](_0x1229fc[_0x2097('0x28')]);if(_0x1229fc['name']){delete _0x1229fc[_0x2097('0x29')];}_0x80c5ee[_0x2097('0x1b')](_0x56af3b)[_0x2097('0x2a')](_0x1229fc);};}exports[_0x2097('0x2b')]=function(_0x410afa,_0x36228c){var _0x450e0b={},_0x4b443d={},_0x11242f={'count':0x0,'rows':[]};var _0x14d964=_['map'](db[_0x2097('0x2c')][_0x2097('0x2d')],function(_0x59fb84){return{'name':_0x59fb84['fieldName'],'type':_0x59fb84[_0x2097('0x2e')][_0x2097('0x2f')]};});_0x4b443d[_0x2097('0x30')]=_[_0x2097('0x31')](_0x14d964,_0x2097('0x29'));_0x4b443d[_0x2097('0x32')]=_['keys'](_0x410afa[_0x2097('0x32')]);_0x4b443d['filters']=_[_0x2097('0x33')](_0x4b443d[_0x2097('0x30')],_0x4b443d[_0x2097('0x32')]);_0x450e0b[_0x2097('0x34')]=_[_0x2097('0x33')](_0x4b443d[_0x2097('0x30')],qs[_0x2097('0x35')](_0x410afa[_0x2097('0x32')][_0x2097('0x35')]));_0x450e0b['attributes']=_0x450e0b[_0x2097('0x34')][_0x2097('0x36')]?_0x450e0b[_0x2097('0x34')]:_0x4b443d['model'];if(!_0x410afa[_0x2097('0x32')][_0x2097('0x37')](_0x2097('0x38'))){_0x450e0b[_0x2097('0x1f')]=qs['limit'](_0x410afa['query']['limit']);_0x450e0b[_0x2097('0x1e')]=qs[_0x2097('0x1e')](_0x410afa[_0x2097('0x32')][_0x2097('0x1e')]);}_0x450e0b[_0x2097('0x39')]=qs[_0x2097('0x3a')](_0x410afa['query'][_0x2097('0x3a')]);_0x450e0b[_0x2097('0x3b')]=qs[_0x2097('0x3c')](_[_0x2097('0x3d')](_0x410afa[_0x2097('0x32')],_0x4b443d[_0x2097('0x3c')]),_0x14d964);if(_0x410afa['query'][_0x2097('0x3e')]){_0x450e0b[_0x2097('0x3b')]=_[_0x2097('0x3f')](_0x450e0b['where'],{'$or':_['map'](_0x14d964,function(_0x57649e){if(_0x57649e[_0x2097('0x2e')]!==_0x2097('0x40')){var _0x85b01e={};_0x85b01e[_0x57649e[_0x2097('0x29')]]={'$like':'%'+_0x410afa[_0x2097('0x32')][_0x2097('0x3e')]+'%'};return _0x85b01e;}})});}_0x450e0b=_[_0x2097('0x3f')]({},_0x450e0b,_0x410afa[_0x2097('0x41')]);var _0x3bfb5c={'where':_0x450e0b[_0x2097('0x3b')]};return db[_0x2097('0x2c')]['count'](_0x3bfb5c)[_0x2097('0x26')](function(_0x2f5378){_0x11242f[_0x2097('0x21')]=_0x2f5378;if(_0x410afa['query'][_0x2097('0x42')]){_0x450e0b[_0x2097('0x43')]=[{'all':!![]}];}return db[_0x2097('0x2c')][_0x2097('0x44')](_0x450e0b);})[_0x2097('0x26')](function(_0xd4d89e){_0x11242f[_0x2097('0x45')]=_0xd4d89e;return _0x11242f;})[_0x2097('0x26')](respondWithFilteredResult(_0x36228c,_0x450e0b))['catch'](handleError(_0x36228c,null));};exports[_0x2097('0x46')]=function(_0x283adc,_0x186ca5){var _0x3288ae={'raw':!![],'where':{'id':_0x283adc[_0x2097('0x47')]['id']}},_0x12e0e2={};_0x12e0e2[_0x2097('0x30')]=_[_0x2097('0x48')](db['WhatsappQueueReport'][_0x2097('0x2d')]);_0x12e0e2['query']=_[_0x2097('0x48')](_0x283adc[_0x2097('0x32')]);_0x12e0e2[_0x2097('0x3c')]=_[_0x2097('0x33')](_0x12e0e2[_0x2097('0x30')],_0x12e0e2['query']);_0x3288ae[_0x2097('0x34')]=_[_0x2097('0x33')](_0x12e0e2[_0x2097('0x30')],qs[_0x2097('0x35')](_0x283adc[_0x2097('0x32')]['fields']));_0x3288ae[_0x2097('0x34')]=_0x3288ae[_0x2097('0x34')][_0x2097('0x36')]?_0x3288ae[_0x2097('0x34')]:_0x12e0e2[_0x2097('0x30')];if(_0x283adc[_0x2097('0x32')][_0x2097('0x42')]){_0x3288ae[_0x2097('0x43')]=[{'all':!![]}];}_0x3288ae=_['merge']({},_0x3288ae,_0x283adc[_0x2097('0x41')]);return db[_0x2097('0x2c')][_0x2097('0x49')](_0x3288ae)[_0x2097('0x26')](handleEntityNotFound(_0x186ca5,null))['then'](respondWithResult(_0x186ca5,null))['catch'](handleError(_0x186ca5,null));};exports['create']=function(_0xdf0b6e,_0x396979){return db['WhatsappQueueReport'][_0x2097('0x4a')](_0xdf0b6e[_0x2097('0x4b')],{})['then'](respondWithResult(_0x396979,0xc9))['catch'](handleError(_0x396979,null));};exports[_0x2097('0x25')]=function(_0x21829d,_0x1b4de6){if(_0x21829d['body']['id']){delete _0x21829d[_0x2097('0x4b')]['id'];}return db[_0x2097('0x2c')]['find']({'where':{'id':_0x21829d[_0x2097('0x47')]['id']}})[_0x2097('0x26')](handleEntityNotFound(_0x1b4de6,null))[_0x2097('0x26')](saveUpdates(_0x21829d[_0x2097('0x4b')],null))[_0x2097('0x26')](respondWithResult(_0x1b4de6,null))['catch'](handleError(_0x1b4de6,null));};exports['destroy']=function(_0x140b41,_0x39f9cb){return db[_0x2097('0x2c')]['find']({'where':{'id':_0x140b41['params']['id']}})[_0x2097('0x26')](handleEntityNotFound(_0x39f9cb,null))[_0x2097('0x26')](removeEntity(_0x39f9cb,null))['catch'](handleError(_0x39f9cb,null));};exports[_0x2097('0x4c')]=function(_0x33583e,_0x12bdbd){return db[_0x2097('0x2c')][_0x2097('0x4c')]()['then'](respondWithResult(_0x12bdbd,null))[_0x2097('0x4d')](handleError(_0x12bdbd,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 605d2bc..3233836 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 _0xd3dc=['lodash','util','../../config/logger','bluebird','path','exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid'];(function(_0x25ca44,_0x111633){var _0x4897c1=function(_0xf344b9){while(--_0xf344b9){_0x25ca44['push'](_0x25ca44['shift']());}};_0x4897c1(++_0x111633);}(_0xd3dc,0xdc));var _0xcd3d=function(_0x7e5bc0,_0x52dacc){_0x7e5bc0=_0x7e5bc0-0x0;var _0x440f5d=_0xd3dc[_0x7e5bc0];return _0x440f5d;};'use strict';var _=require(_0xcd3d('0x0'));var util=require(_0xcd3d('0x1'));var logger=require(_0xcd3d('0x2'))('api');var moment=require('moment');var BPromise=require(_0xcd3d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcd3d('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./whatsappQueueReport.attributes');module[_0xcd3d('0x5')]=function(_0x2f9da8,_0x5ae894){return _0x2f9da8[_0xcd3d('0x6')](_0xcd3d('0x7'),attributes,{'tableName':_0xcd3d('0x8'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xcd3d('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4c4f=['api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','WhatsappQueueReport','uniqueid','lodash','../../config/logger'];(function(_0x417dd2,_0x328f5b){var _0x191bd0=function(_0x4b20ac){while(--_0x4b20ac){_0x417dd2['push'](_0x417dd2['shift']());}};_0x191bd0(++_0x328f5b);}(_0x4c4f,0x9a));var _0xf4c4=function(_0x1eb753,_0x2799d0){_0x1eb753=_0x1eb753-0x0;var _0x208fc7=_0x4c4f[_0x1eb753];return _0x208fc7;};'use strict';var _=require(_0xf4c4('0x0'));var util=require('util');var logger=require(_0xf4c4('0x1'))(_0xf4c4('0x2'));var moment=require(_0xf4c4('0x3'));var BPromise=require(_0xf4c4('0x4'));var rp=require(_0xf4c4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf4c4('0x6'));var config=require(_0xf4c4('0x7'));var attributes=require('./whatsappQueueReport.attributes');module[_0xf4c4('0x8')]=function(_0x1ff5a1,_0x5a3982){return _0x1ff5a1[_0xf4c4('0x9')](_0xf4c4('0xa'),attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':_0xf4c4('0xb'),'fields':[_0xf4c4('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 416ced4..79c8bbb 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 _0xce11=['http','request','then','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','WhatsappQueueReport','create','body','options','raw','info','CreateWhatsappQueueReport','catch','UpdateWhatsappQueueReport','update','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x3335ba,_0x4c53d3){var _0x1abd6d=function(_0x1b6c9a){while(--_0x1b6c9a){_0x3335ba['push'](_0x3335ba['shift']());}};_0x1abd6d(++_0x4c53d3);}(_0xce11,0x79));var _0x1ce1=function(_0x7a495a,_0x7aee71){_0x7a495a=_0x7a495a-0x0;var _0x2c18d9=_0xce11[_0x7a495a];return _0x2c18d9;};'use strict';var _=require(_0x1ce1('0x0'));var util=require(_0x1ce1('0x1'));var moment=require(_0x1ce1('0x2'));var BPromise=require(_0x1ce1('0x3'));var rs=require(_0x1ce1('0x4'));var fs=require('fs');var Redis=require(_0x1ce1('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x1ce1('0x6'));var logger=require(_0x1ce1('0x7'))('rpc');var config=require(_0x1ce1('0x8'));var jayson=require(_0x1ce1('0x9'));var client=jayson[_0x1ce1('0xa')][_0x1ce1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x38d538,_0x32b3c2,_0x1ba96a){return new BPromise(function(_0x3b2769,_0x1155d4){return client[_0x1ce1('0xc')](_0x38d538,_0x1ba96a)[_0x1ce1('0xd')](function(_0x45dcca){logger['info'](_0x1ce1('0xe'),_0x32b3c2,_0x1ce1('0xf'));logger[_0x1ce1('0x10')](_0x1ce1('0x11'),_0x32b3c2,_0x1ce1('0xf'),JSON[_0x1ce1('0x12')](_0x45dcca));if(_0x45dcca['error']){if(_0x45dcca['error']['code']===0x1f4){logger[_0x1ce1('0x13')](_0x1ce1('0xe'),_0x32b3c2,_0x45dcca['error'][_0x1ce1('0x14')]);return _0x1155d4(_0x45dcca[_0x1ce1('0x13')][_0x1ce1('0x14')]);}logger['error'](_0x1ce1('0xe'),_0x32b3c2,_0x45dcca['error'][_0x1ce1('0x14')]);return _0x3b2769(_0x45dcca['error'][_0x1ce1('0x14')]);}else{logger['info'](_0x1ce1('0xe'),_0x32b3c2,_0x1ce1('0xf'));_0x3b2769(_0x45dcca[_0x1ce1('0x15')]['message']);}})['catch'](function(_0x2307cb){logger[_0x1ce1('0x13')](_0x1ce1('0xe'),_0x32b3c2,_0x2307cb);_0x1155d4(_0x2307cb);});});}exports['CreateWhatsappQueueReport']=function(_0x1e89ba){var _0x5b135a=this;return new Promise(function(_0x3ba2b9,_0x5c8673){return db[_0x1ce1('0x16')][_0x1ce1('0x17')](_0x1e89ba[_0x1ce1('0x18')],{'raw':_0x1e89ba[_0x1ce1('0x19')]?_0x1e89ba[_0x1ce1('0x19')][_0x1ce1('0x1a')]===undefined?!![]:![]:!![]})[_0x1ce1('0xd')](function(_0x4a6c75){logger[_0x1ce1('0x1b')](_0x1ce1('0x1c'),_0x1e89ba);logger[_0x1ce1('0x10')](_0x1ce1('0x1c'),_0x1e89ba,JSON[_0x1ce1('0x12')](_0x4a6c75));_0x3ba2b9(_0x4a6c75);})[_0x1ce1('0x1d')](function(_0x48d70b){logger[_0x1ce1('0x13')](_0x1ce1('0x1c'),_0x48d70b[_0x1ce1('0x14')],_0x1e89ba);_0x5c8673(_0x5b135a[_0x1ce1('0x13')](0x1f4,_0x48d70b[_0x1ce1('0x14')]));});});};exports[_0x1ce1('0x1e')]=function(_0x5aafc4){var _0x24300b=this;return new Promise(function(_0x5443bd,_0x1db72c){return db[_0x1ce1('0x16')][_0x1ce1('0x1f')](_0x5aafc4[_0x1ce1('0x18')],{'raw':_0x5aafc4['options']?_0x5aafc4[_0x1ce1('0x19')][_0x1ce1('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5aafc4[_0x1ce1('0x19')]?_0x5aafc4[_0x1ce1('0x19')]['where']||null:null,'attributes':_0x5aafc4['options']?_0x5aafc4[_0x1ce1('0x19')][_0x1ce1('0x20')]||null:null,'limit':_0x5aafc4['options']?_0x5aafc4[_0x1ce1('0x19')]['limit']||null:null})[_0x1ce1('0xd')](function(_0x2dc460){logger['info'](_0x1ce1('0x1e'),_0x5aafc4);logger[_0x1ce1('0x10')](_0x1ce1('0x1e'),_0x5aafc4,JSON['stringify'](_0x2dc460));_0x5443bd(_0x2dc460);})[_0x1ce1('0x1d')](function(_0x408fe1){logger['error'](_0x1ce1('0x1e'),_0x408fe1[_0x1ce1('0x14')],_0x5aafc4);_0x1db72c(_0x24300b[_0x1ce1('0x13')](0x1f4,_0x408fe1[_0x1ce1('0x14')]));});});}; \ No newline at end of file +var _0x8beb=['rpc','../../config/environment','jayson/promise','http','request','then','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','raw','UpdateWhatsappQueueReport','update','where','attributes','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x30fcde,_0xddfaee){var _0x16f588=function(_0x10ff7b){while(--_0x10ff7b){_0x30fcde['push'](_0x30fcde['shift']());}};_0x16f588(++_0xddfaee);}(_0x8beb,0xed));var _0xb8be=function(_0x150219,_0x4f13b1){_0x150219=_0x150219-0x0;var _0x50ea0e=_0x8beb[_0x150219];return _0x50ea0e;};'use strict';var _=require(_0xb8be('0x0'));var util=require(_0xb8be('0x1'));var moment=require(_0xb8be('0x2'));var BPromise=require('bluebird');var rs=require(_0xb8be('0x3'));var fs=require('fs');var Redis=require(_0xb8be('0x4'));var db=require(_0xb8be('0x5'))['db'];var utils=require(_0xb8be('0x6'));var logger=require(_0xb8be('0x7'))(_0xb8be('0x8'));var config=require(_0xb8be('0x9'));var jayson=require(_0xb8be('0xa'));var client=jayson['client'][_0xb8be('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x549734,_0xbf9101,_0x4dcad8){return new BPromise(function(_0x5c0ab4,_0x5afa8f){return client[_0xb8be('0xc')](_0x549734,_0x4dcad8)[_0xb8be('0xd')](function(_0xcfd930){logger['info'](_0xb8be('0xe'),_0xbf9101,_0xb8be('0xf'));logger[_0xb8be('0x10')](_0xb8be('0x11'),_0xbf9101,_0xb8be('0xf'),JSON[_0xb8be('0x12')](_0xcfd930));if(_0xcfd930[_0xb8be('0x13')]){if(_0xcfd930[_0xb8be('0x13')]['code']===0x1f4){logger[_0xb8be('0x13')](_0xb8be('0xe'),_0xbf9101,_0xcfd930['error']['message']);return _0x5afa8f(_0xcfd930[_0xb8be('0x13')][_0xb8be('0x14')]);}logger[_0xb8be('0x13')](_0xb8be('0xe'),_0xbf9101,_0xcfd930[_0xb8be('0x13')][_0xb8be('0x14')]);return _0x5c0ab4(_0xcfd930[_0xb8be('0x13')]['message']);}else{logger[_0xb8be('0x15')](_0xb8be('0xe'),_0xbf9101,_0xb8be('0xf'));_0x5c0ab4(_0xcfd930[_0xb8be('0x16')][_0xb8be('0x14')]);}})[_0xb8be('0x17')](function(_0x407dba){logger[_0xb8be('0x13')](_0xb8be('0xe'),_0xbf9101,_0x407dba);_0x5afa8f(_0x407dba);});});}exports[_0xb8be('0x18')]=function(_0x1e1b2b){var _0x3d30c5=this;return new Promise(function(_0x569acb,_0x39aae5){return db[_0xb8be('0x19')][_0xb8be('0x1a')](_0x1e1b2b[_0xb8be('0x1b')],{'raw':_0x1e1b2b[_0xb8be('0x1c')]?_0x1e1b2b['options'][_0xb8be('0x1d')]===undefined?!![]:![]:!![]})[_0xb8be('0xd')](function(_0x52b85a){logger[_0xb8be('0x15')]('CreateWhatsappQueueReport',_0x1e1b2b);logger[_0xb8be('0x10')]('CreateWhatsappQueueReport',_0x1e1b2b,JSON[_0xb8be('0x12')](_0x52b85a));_0x569acb(_0x52b85a);})[_0xb8be('0x17')](function(_0x5807e7){logger[_0xb8be('0x13')]('CreateWhatsappQueueReport',_0x5807e7[_0xb8be('0x14')],_0x1e1b2b);_0x39aae5(_0x3d30c5['error'](0x1f4,_0x5807e7[_0xb8be('0x14')]));});});};exports[_0xb8be('0x1e')]=function(_0x1b5cd9){var _0x43a112=this;return new Promise(function(_0x35f277,_0x232ccf){return db[_0xb8be('0x19')][_0xb8be('0x1f')](_0x1b5cd9[_0xb8be('0x1b')],{'raw':_0x1b5cd9[_0xb8be('0x1c')]?_0x1b5cd9['options'][_0xb8be('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b5cd9[_0xb8be('0x1c')]?_0x1b5cd9[_0xb8be('0x1c')][_0xb8be('0x20')]||null:null,'attributes':_0x1b5cd9[_0xb8be('0x1c')]?_0x1b5cd9[_0xb8be('0x1c')][_0xb8be('0x21')]||null:null,'limit':_0x1b5cd9[_0xb8be('0x1c')]?_0x1b5cd9[_0xb8be('0x1c')][_0xb8be('0x22')]||null:null})[_0xb8be('0xd')](function(_0x43fc4e){logger[_0xb8be('0x15')](_0xb8be('0x1e'),_0x1b5cd9);logger[_0xb8be('0x10')](_0xb8be('0x1e'),_0x1b5cd9,JSON[_0xb8be('0x12')](_0x43fc4e));_0x35f277(_0x43fc4e);})[_0xb8be('0x17')](function(_0x361f7c){logger['error'](_0xb8be('0x1e'),_0x361f7c[_0xb8be('0x14')],_0x1b5cd9);_0x232ccf(_0x43a112[_0xb8be('0x13')](0x1f4,_0x361f7c[_0xb8be('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 9660446..931d9cd 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 _0xd0f0=['../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1b4b23,_0x5dd6d6){var _0x2a325b=function(_0x175462){while(--_0x175462){_0x1b4b23['push'](_0x1b4b23['shift']());}};_0x2a325b(++_0x5dd6d6);}(_0xd0f0,0x67));var _0x0d0f=function(_0x2b6b89,_0x172ec0){_0x2b6b89=_0x2b6b89-0x0;var _0x5aa6af=_0xd0f0[_0x2b6b89];return _0x5aa6af;};'use strict';var multer=require('multer');var util=require(_0x0d0f('0x0'));var path=require(_0x0d0f('0x1'));var timeout=require('connect-timeout');var express=require(_0x0d0f('0x2'));var router=express[_0x0d0f('0x3')]();var fs_extra=require(_0x0d0f('0x4'));var auth=require(_0x0d0f('0x5'));var interaction=require(_0x0d0f('0x6'));var config=require(_0x0d0f('0x7'));var controller=require(_0x0d0f('0x8'));router[_0x0d0f('0x9')]('/',auth[_0x0d0f('0xa')](),controller[_0x0d0f('0xb')]);router[_0x0d0f('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x0d0f('0xc')]);router[_0x0d0f('0x9')](_0x0d0f('0xd'),auth[_0x0d0f('0xa')](),controller[_0x0d0f('0xe')]);router[_0x0d0f('0xf')]('/',auth[_0x0d0f('0xa')](),controller[_0x0d0f('0x10')]);router[_0x0d0f('0x11')](_0x0d0f('0xd'),auth[_0x0d0f('0xa')](),controller[_0x0d0f('0x12')]);router[_0x0d0f('0x13')](_0x0d0f('0xd'),auth[_0x0d0f('0xa')](),controller[_0x0d0f('0x14')]);module[_0x0d0f('0x15')]=router; \ No newline at end of file +var _0x5706=['fs-extra','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','describe','/:id','show','put','delete','destroy','exports','util','path','connect-timeout'];(function(_0x1170a8,_0x35c392){var _0x2e11e9=function(_0xbc0d2b){while(--_0xbc0d2b){_0x1170a8['push'](_0x1170a8['shift']());}};_0x2e11e9(++_0x35c392);}(_0x5706,0x156));var _0x6570=function(_0x5dce91,_0x395507){_0x5dce91=_0x5dce91-0x0;var _0x1c7a12=_0x5706[_0x5dce91];return _0x1c7a12;};'use strict';var multer=require('multer');var util=require(_0x6570('0x0'));var path=require(_0x6570('0x1'));var timeout=require(_0x6570('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6570('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6570('0x4'));var controller=require(_0x6570('0x5'));router[_0x6570('0x6')]('/',auth[_0x6570('0x7')](),controller['index']);router['get']('/describe',auth[_0x6570('0x7')](),controller[_0x6570('0x8')]);router['get'](_0x6570('0x9'),auth['isAuthenticated'](),controller[_0x6570('0xa')]);router['post']('/',auth[_0x6570('0x7')](),controller['create']);router[_0x6570('0xb')]('/:id',auth[_0x6570('0x7')](),controller['update']);router[_0x6570('0xc')](_0x6570('0x9'),auth[_0x6570('0x7')](),controller[_0x6570('0xd')]);module[_0x6570('0xe')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 2690c76..747a13c 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 _0x4e2e=['exports','STRING','ENUM','account','agent','queue'];(function(_0x472082,_0xb51e80){var _0x537121=function(_0x4f4d22){while(--_0x4f4d22){_0x472082['push'](_0x472082['shift']());}};_0x537121(++_0xb51e80);}(_0x4e2e,0x1f2));var _0xe4e2=function(_0x470e72,_0x2b2375){_0x470e72=_0x470e72-0x0;var _0x3eae8f=_0x4e2e[_0x470e72];return _0x3eae8f;};'use strict';var Sequelize=require('sequelize');module[_0xe4e2('0x0')]={'uniqueid':{'type':Sequelize[_0xe4e2('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xe4e2('0x2')](_0xe4e2('0x3'),_0xe4e2('0x4'),_0xe4e2('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x4c4d=['DATE','sequelize','agent'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4c4d,0x1a2));var _0xd4c4=function(_0x1207a1,_0x2a0d46){_0x1207a1=_0x1207a1-0x0;var _0x3eeb53=_0x4c4d[_0x1207a1];return _0x3eeb53;};'use strict';var Sequelize=require(_0xd4c4('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM']('account',_0xd4c4('0x1'),'queue'),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xd4c4('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 4e83d67..098d91b 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 _0x156c=['apply','reject','update','then','error','stack','name','send','index','map','WhatsappTransferReport','type','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','show','rawAttributes','length','includeAll','options','find','create','body','params','describe','zip-dir','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/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x55c187,_0x2909fd){var _0x2ec7cf=function(_0x5bce7c){while(--_0x5bce7c){_0x55c187['push'](_0x55c187['shift']());}};_0x2ec7cf(++_0x2909fd);}(_0x156c,0x14d));var _0xc156=function(_0x3de7e0,_0x28cbff){_0x3de7e0=_0x3de7e0-0x0;var _0x11d0b3=_0x156c[_0x3de7e0];return _0x11d0b3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc156('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc156('0x1'));var BPromise=require('bluebird');var Mustache=require(_0xc156('0x2'));var util=require(_0xc156('0x3'));var path=require(_0xc156('0x4'));var sox=require(_0xc156('0x5'));var csv=require(_0xc156('0x6'));var ejs=require(_0xc156('0x7'));var fs=require('fs');var fs_extra=require(_0xc156('0x8'));var _=require(_0xc156('0x9'));var squel=require('squel');var crypto=require(_0xc156('0xa'));var jsforce=require(_0xc156('0xb'));var deskjs=require(_0xc156('0xc'));var toCsv=require(_0xc156('0x6'));var querystring=require(_0xc156('0xd'));var Papa=require(_0xc156('0xe'));var Redis=require(_0xc156('0xf'));var authService=require(_0xc156('0x10'));var qs=require(_0xc156('0x11'));var as=require(_0xc156('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc156('0x13'))('api');var utils=require(_0xc156('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xc156('0x15'));var db=require(_0xc156('0x16'))['db'];function respondWithStatusCode(_0x264520,_0x28980b){_0x28980b=_0x28980b||0xcc;return function(_0x4289d6){if(_0x4289d6){return _0x264520[_0xc156('0x17')](_0x28980b);}return _0x264520[_0xc156('0x18')](_0x28980b)[_0xc156('0x19')]();};}function respondWithResult(_0x1cf9b9,_0x2e0d61){_0x2e0d61=_0x2e0d61||0xc8;return function(_0xd90903){if(_0xd90903){return _0x1cf9b9[_0xc156('0x18')](_0x2e0d61)[_0xc156('0x1a')](_0xd90903);}};}function respondWithFilteredResult(_0x52e4dc,_0x513f55){return function(_0xe3eaaa){if(_0xe3eaaa){var _0x41acf6=typeof _0x513f55[_0xc156('0x1b')]===_0xc156('0x1c')&&typeof _0x513f55[_0xc156('0x1d')]===_0xc156('0x1c');var _0x6cc6af=_0xe3eaaa['count'];var _0x389857=_0x41acf6?0x0:_0x513f55[_0xc156('0x1b')];var _0x35d20b=_0x41acf6?_0xe3eaaa[_0xc156('0x1e')]:_0x513f55[_0xc156('0x1b')]+_0x513f55['limit'];var _0x4b27ff;if(_0x35d20b>=_0x6cc6af){_0x35d20b=_0x6cc6af;_0x4b27ff=0xc8;}else{_0x4b27ff=0xce;}_0x52e4dc[_0xc156('0x18')](_0x4b27ff);return _0x52e4dc[_0xc156('0x1f')]('Content-Range',_0x389857+'-'+_0x35d20b+'/'+_0x6cc6af)[_0xc156('0x1a')](_0xe3eaaa);}return null;};}function patchUpdates(_0xf982d0){return function(_0x58d228){try{jsonpatch[_0xc156('0x20')](_0x58d228,_0xf982d0,!![]);}catch(_0x487662){return BPromise[_0xc156('0x21')](_0x487662);}return _0x58d228['save']();};}function saveUpdates(_0x43cb4b,_0x5b3d0d){return function(_0x50f431){if(_0x50f431){return _0x50f431[_0xc156('0x22')](_0x43cb4b)[_0xc156('0x23')](function(_0x2d2e62){return _0x2d2e62;});}return null;};}function removeEntity(_0x41856e,_0x16a183){return function(_0x53b1a4){if(_0x53b1a4){return _0x53b1a4['destroy']()[_0xc156('0x23')](function(){_0x41856e[_0xc156('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4dfae0,_0x52822b){return function(_0xf03b56){if(!_0xf03b56){_0x4dfae0[_0xc156('0x17')](0x194);}return _0xf03b56;};}function handleError(_0x57ec4e,_0x84070f){_0x84070f=_0x84070f||0x1f4;return function(_0x1f0226){logger[_0xc156('0x24')](_0x1f0226[_0xc156('0x25')]);if(_0x1f0226[_0xc156('0x26')]){delete _0x1f0226[_0xc156('0x26')];}_0x57ec4e[_0xc156('0x18')](_0x84070f)[_0xc156('0x27')](_0x1f0226);};}exports[_0xc156('0x28')]=function(_0x262607,_0x4bcf14){var _0x5b5a80={},_0xe2065c={},_0x601f6b={'count':0x0,'rows':[]};var _0xc3d793=_[_0xc156('0x29')](db[_0xc156('0x2a')]['rawAttributes'],function(_0x483232){return{'name':_0x483232['fieldName'],'type':_0x483232[_0xc156('0x2b')]['key']};});_0xe2065c[_0xc156('0x2c')]=_[_0xc156('0x29')](_0xc3d793,_0xc156('0x26'));_0xe2065c[_0xc156('0x2d')]=_[_0xc156('0x2e')](_0x262607[_0xc156('0x2d')]);_0xe2065c[_0xc156('0x2f')]=_[_0xc156('0x30')](_0xe2065c[_0xc156('0x2c')],_0xe2065c[_0xc156('0x2d')]);_0x5b5a80[_0xc156('0x31')]=_['intersection'](_0xe2065c[_0xc156('0x2c')],qs[_0xc156('0x32')](_0x262607[_0xc156('0x2d')][_0xc156('0x32')]));_0x5b5a80['attributes']=_0x5b5a80[_0xc156('0x31')]['length']?_0x5b5a80[_0xc156('0x31')]:_0xe2065c['model'];if(!_0x262607[_0xc156('0x2d')]['hasOwnProperty'](_0xc156('0x33'))){_0x5b5a80[_0xc156('0x1d')]=qs[_0xc156('0x1d')](_0x262607['query']['limit']);_0x5b5a80[_0xc156('0x1b')]=qs['offset'](_0x262607[_0xc156('0x2d')][_0xc156('0x1b')]);}_0x5b5a80[_0xc156('0x34')]=qs[_0xc156('0x35')](_0x262607[_0xc156('0x2d')][_0xc156('0x35')]);_0x5b5a80[_0xc156('0x36')]=qs[_0xc156('0x2f')](_[_0xc156('0x37')](_0x262607[_0xc156('0x2d')],_0xe2065c[_0xc156('0x2f')]),_0xc3d793);if(_0x262607['query'][_0xc156('0x38')]){_0x5b5a80[_0xc156('0x36')]=_[_0xc156('0x39')](_0x5b5a80[_0xc156('0x36')],{'$or':_[_0xc156('0x29')](_0xc3d793,function(_0x54e75a){if(_0x54e75a[_0xc156('0x2b')]!==_0xc156('0x3a')){var _0x59436f={};_0x59436f[_0x54e75a['name']]={'$like':'%'+_0x262607[_0xc156('0x2d')][_0xc156('0x38')]+'%'};return _0x59436f;}})});}_0x5b5a80=_[_0xc156('0x39')]({},_0x5b5a80,_0x262607['options']);var _0x8df3b1={'where':_0x5b5a80['where']};return db[_0xc156('0x2a')][_0xc156('0x1e')](_0x8df3b1)[_0xc156('0x23')](function(_0x397c17){_0x601f6b[_0xc156('0x1e')]=_0x397c17;if(_0x262607[_0xc156('0x2d')]['includeAll']){_0x5b5a80[_0xc156('0x3b')]=[{'all':!![]}];}return db['WhatsappTransferReport'][_0xc156('0x3c')](_0x5b5a80);})[_0xc156('0x23')](function(_0x435ecc){_0x601f6b[_0xc156('0x3d')]=_0x435ecc;return _0x601f6b;})[_0xc156('0x23')](respondWithFilteredResult(_0x4bcf14,_0x5b5a80))[_0xc156('0x3e')](handleError(_0x4bcf14,null));};exports[_0xc156('0x3f')]=function(_0x1651c6,_0x1a6875){var _0x322f0b={'raw':!![],'where':{'id':_0x1651c6['params']['id']}},_0x22d121={};_0x22d121[_0xc156('0x2c')]=_[_0xc156('0x2e')](db[_0xc156('0x2a')][_0xc156('0x40')]);_0x22d121[_0xc156('0x2d')]=_[_0xc156('0x2e')](_0x1651c6[_0xc156('0x2d')]);_0x22d121[_0xc156('0x2f')]=_[_0xc156('0x30')](_0x22d121[_0xc156('0x2c')],_0x22d121[_0xc156('0x2d')]);_0x322f0b[_0xc156('0x31')]=_[_0xc156('0x30')](_0x22d121['model'],qs[_0xc156('0x32')](_0x1651c6['query'][_0xc156('0x32')]));_0x322f0b[_0xc156('0x31')]=_0x322f0b[_0xc156('0x31')][_0xc156('0x41')]?_0x322f0b[_0xc156('0x31')]:_0x22d121[_0xc156('0x2c')];if(_0x1651c6[_0xc156('0x2d')][_0xc156('0x42')]){_0x322f0b[_0xc156('0x3b')]=[{'all':!![]}];}_0x322f0b=_[_0xc156('0x39')]({},_0x322f0b,_0x1651c6[_0xc156('0x43')]);return db[_0xc156('0x2a')][_0xc156('0x44')](_0x322f0b)[_0xc156('0x23')](handleEntityNotFound(_0x1a6875,null))['then'](respondWithResult(_0x1a6875,null))['catch'](handleError(_0x1a6875,null));};exports['create']=function(_0x5ba7b0,_0x2e3d68){return db[_0xc156('0x2a')][_0xc156('0x45')](_0x5ba7b0[_0xc156('0x46')],{})[_0xc156('0x23')](respondWithResult(_0x2e3d68,0xc9))[_0xc156('0x3e')](handleError(_0x2e3d68,null));};exports[_0xc156('0x22')]=function(_0x56ecdf,_0x2fd775){if(_0x56ecdf['body']['id']){delete _0x56ecdf[_0xc156('0x46')]['id'];}return db[_0xc156('0x2a')][_0xc156('0x44')]({'where':{'id':_0x56ecdf[_0xc156('0x47')]['id']}})['then'](handleEntityNotFound(_0x2fd775,null))['then'](saveUpdates(_0x56ecdf['body'],null))[_0xc156('0x23')](respondWithResult(_0x2fd775,null))['catch'](handleError(_0x2fd775,null));};exports['destroy']=function(_0xddb467,_0x5e80fa){return db[_0xc156('0x2a')]['find']({'where':{'id':_0xddb467['params']['id']}})[_0xc156('0x23')](handleEntityNotFound(_0x5e80fa,null))[_0xc156('0x23')](removeEntity(_0x5e80fa,null))[_0xc156('0x3e')](handleError(_0x5e80fa,null));};exports[_0xc156('0x48')]=function(_0x34f459,_0x20f514){return db[_0xc156('0x2a')]['describe']()[_0xc156('0x23')](respondWithResult(_0x20f514,null))['catch'](handleError(_0x20f514,null));}; \ No newline at end of file +var _0x7b5d=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','limit','undefined','count','offset','set','apply','reject','save','update','then','error','stack','name','send','index','map','WhatsappTransferReport','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','catch','show','includeAll','create','body','find','params','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse'];(function(_0x130305,_0x166db4){var _0x184957=function(_0x1483fc){while(--_0x1483fc){_0x130305['push'](_0x130305['shift']());}};_0x184957(++_0x166db4);}(_0x7b5d,0x1bd));var _0xd7b5=function(_0xa5f80b,_0x5b3231){_0xa5f80b=_0xa5f80b-0x0;var _0x1c1e82=_0x7b5d[_0xa5f80b];return _0x1c1e82;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd7b5('0x0'));var zipdir=require(_0xd7b5('0x1'));var jsonpatch=require(_0xd7b5('0x2'));var rp=require(_0xd7b5('0x3'));var moment=require(_0xd7b5('0x4'));var BPromise=require(_0xd7b5('0x5'));var Mustache=require(_0xd7b5('0x6'));var util=require(_0xd7b5('0x7'));var path=require('path');var sox=require(_0xd7b5('0x8'));var csv=require(_0xd7b5('0x9'));var ejs=require(_0xd7b5('0xa'));var fs=require('fs');var fs_extra=require(_0xd7b5('0xb'));var _=require(_0xd7b5('0xc'));var squel=require('squel');var crypto=require(_0xd7b5('0xd'));var jsforce=require(_0xd7b5('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xd7b5('0x9'));var querystring=require(_0xd7b5('0xf'));var Papa=require(_0xd7b5('0x10'));var Redis=require(_0xd7b5('0x11'));var authService=require(_0xd7b5('0x12'));var qs=require(_0xd7b5('0x13'));var as=require(_0xd7b5('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd7b5('0x15'))(_0xd7b5('0x16'));var utils=require('../../config/utils');var config=require(_0xd7b5('0x17'));var licenseUtil=require(_0xd7b5('0x18'));var db=require(_0xd7b5('0x19'))['db'];function respondWithStatusCode(_0xbe0e,_0x5602d0){_0x5602d0=_0x5602d0||0xcc;return function(_0x2e09f7){if(_0x2e09f7){return _0xbe0e[_0xd7b5('0x1a')](_0x5602d0);}return _0xbe0e['status'](_0x5602d0)[_0xd7b5('0x1b')]();};}function respondWithResult(_0x20a53f,_0x41b149){_0x41b149=_0x41b149||0xc8;return function(_0x27bad9){if(_0x27bad9){return _0x20a53f[_0xd7b5('0x1c')](_0x41b149)[_0xd7b5('0x1d')](_0x27bad9);}};}function respondWithFilteredResult(_0x270391,_0x402a15){return function(_0xf04d9c){if(_0xf04d9c){var _0x328dab=typeof _0x402a15['offset']==='undefined'&&typeof _0x402a15[_0xd7b5('0x1e')]===_0xd7b5('0x1f');var _0x518957=_0xf04d9c[_0xd7b5('0x20')];var _0x518947=_0x328dab?0x0:_0x402a15[_0xd7b5('0x21')];var _0x232655=_0x328dab?_0xf04d9c[_0xd7b5('0x20')]:_0x402a15[_0xd7b5('0x21')]+_0x402a15[_0xd7b5('0x1e')];var _0x4c8c70;if(_0x232655>=_0x518957){_0x232655=_0x518957;_0x4c8c70=0xc8;}else{_0x4c8c70=0xce;}_0x270391[_0xd7b5('0x1c')](_0x4c8c70);return _0x270391[_0xd7b5('0x22')]('Content-Range',_0x518947+'-'+_0x232655+'/'+_0x518957)['json'](_0xf04d9c);}return null;};}function patchUpdates(_0x25e9d6){return function(_0x4aa197){try{jsonpatch[_0xd7b5('0x23')](_0x4aa197,_0x25e9d6,!![]);}catch(_0x2d4019){return BPromise[_0xd7b5('0x24')](_0x2d4019);}return _0x4aa197[_0xd7b5('0x25')]();};}function saveUpdates(_0x5ab569,_0x271b4d){return function(_0x468d80){if(_0x468d80){return _0x468d80[_0xd7b5('0x26')](_0x5ab569)['then'](function(_0x4585fa){return _0x4585fa;});}return null;};}function removeEntity(_0x65584f,_0x122da4){return function(_0x36b9f0){if(_0x36b9f0){return _0x36b9f0['destroy']()[_0xd7b5('0x27')](function(){_0x65584f[_0xd7b5('0x1c')](0xcc)[_0xd7b5('0x1b')]();});}};}function handleEntityNotFound(_0x14a26b,_0x30d4be){return function(_0x188c9c){if(!_0x188c9c){_0x14a26b['sendStatus'](0x194);}return _0x188c9c;};}function handleError(_0x470535,_0x43d438){_0x43d438=_0x43d438||0x1f4;return function(_0xf3bd46){logger[_0xd7b5('0x28')](_0xf3bd46[_0xd7b5('0x29')]);if(_0xf3bd46[_0xd7b5('0x2a')]){delete _0xf3bd46[_0xd7b5('0x2a')];}_0x470535['status'](_0x43d438)[_0xd7b5('0x2b')](_0xf3bd46);};}exports[_0xd7b5('0x2c')]=function(_0x2bff40,_0xc23a64){var _0xc2451c={},_0x3110f8={},_0xc1e218={'count':0x0,'rows':[]};var _0x4e9188=_[_0xd7b5('0x2d')](db[_0xd7b5('0x2e')][_0xd7b5('0x2f')],function(_0x16dc75){return{'name':_0x16dc75['fieldName'],'type':_0x16dc75['type'][_0xd7b5('0x30')]};});_0x3110f8[_0xd7b5('0x31')]=_[_0xd7b5('0x2d')](_0x4e9188,_0xd7b5('0x2a'));_0x3110f8[_0xd7b5('0x32')]=_[_0xd7b5('0x33')](_0x2bff40[_0xd7b5('0x32')]);_0x3110f8[_0xd7b5('0x34')]=_['intersection'](_0x3110f8[_0xd7b5('0x31')],_0x3110f8['query']);_0xc2451c['attributes']=_[_0xd7b5('0x35')](_0x3110f8[_0xd7b5('0x31')],qs[_0xd7b5('0x36')](_0x2bff40['query'][_0xd7b5('0x36')]));_0xc2451c[_0xd7b5('0x37')]=_0xc2451c[_0xd7b5('0x37')][_0xd7b5('0x38')]?_0xc2451c['attributes']:_0x3110f8[_0xd7b5('0x31')];if(!_0x2bff40[_0xd7b5('0x32')]['hasOwnProperty'](_0xd7b5('0x39'))){_0xc2451c[_0xd7b5('0x1e')]=qs[_0xd7b5('0x1e')](_0x2bff40[_0xd7b5('0x32')][_0xd7b5('0x1e')]);_0xc2451c[_0xd7b5('0x21')]=qs['offset'](_0x2bff40[_0xd7b5('0x32')][_0xd7b5('0x21')]);}_0xc2451c[_0xd7b5('0x3a')]=qs[_0xd7b5('0x3b')](_0x2bff40['query'][_0xd7b5('0x3b')]);_0xc2451c[_0xd7b5('0x3c')]=qs[_0xd7b5('0x34')](_[_0xd7b5('0x3d')](_0x2bff40[_0xd7b5('0x32')],_0x3110f8[_0xd7b5('0x34')]),_0x4e9188);if(_0x2bff40[_0xd7b5('0x32')][_0xd7b5('0x3e')]){_0xc2451c[_0xd7b5('0x3c')]=_[_0xd7b5('0x3f')](_0xc2451c[_0xd7b5('0x3c')],{'$or':_[_0xd7b5('0x2d')](_0x4e9188,function(_0x439533){if(_0x439533['type']!==_0xd7b5('0x40')){var _0x3baa2b={};_0x3baa2b[_0x439533[_0xd7b5('0x2a')]]={'$like':'%'+_0x2bff40['query']['filter']+'%'};return _0x3baa2b;}})});}_0xc2451c=_[_0xd7b5('0x3f')]({},_0xc2451c,_0x2bff40[_0xd7b5('0x41')]);var _0x5720e5={'where':_0xc2451c[_0xd7b5('0x3c')]};return db['WhatsappTransferReport'][_0xd7b5('0x20')](_0x5720e5)[_0xd7b5('0x27')](function(_0x2b9866){_0xc1e218[_0xd7b5('0x20')]=_0x2b9866;if(_0x2bff40[_0xd7b5('0x32')]['includeAll']){_0xc2451c[_0xd7b5('0x42')]=[{'all':!![]}];}return db[_0xd7b5('0x2e')]['findAll'](_0xc2451c);})[_0xd7b5('0x27')](function(_0x967f60){_0xc1e218[_0xd7b5('0x43')]=_0x967f60;return _0xc1e218;})[_0xd7b5('0x27')](respondWithFilteredResult(_0xc23a64,_0xc2451c))[_0xd7b5('0x44')](handleError(_0xc23a64,null));};exports[_0xd7b5('0x45')]=function(_0x33389c,_0x3626fb){var _0x5b1103={'raw':!![],'where':{'id':_0x33389c['params']['id']}},_0x3b8516={};_0x3b8516['model']=_[_0xd7b5('0x33')](db['WhatsappTransferReport'][_0xd7b5('0x2f')]);_0x3b8516[_0xd7b5('0x32')]=_[_0xd7b5('0x33')](_0x33389c['query']);_0x3b8516['filters']=_[_0xd7b5('0x35')](_0x3b8516['model'],_0x3b8516['query']);_0x5b1103[_0xd7b5('0x37')]=_[_0xd7b5('0x35')](_0x3b8516[_0xd7b5('0x31')],qs['fields'](_0x33389c[_0xd7b5('0x32')][_0xd7b5('0x36')]));_0x5b1103['attributes']=_0x5b1103[_0xd7b5('0x37')][_0xd7b5('0x38')]?_0x5b1103[_0xd7b5('0x37')]:_0x3b8516['model'];if(_0x33389c[_0xd7b5('0x32')][_0xd7b5('0x46')]){_0x5b1103[_0xd7b5('0x42')]=[{'all':!![]}];}_0x5b1103=_['merge']({},_0x5b1103,_0x33389c['options']);return db[_0xd7b5('0x2e')]['find'](_0x5b1103)[_0xd7b5('0x27')](handleEntityNotFound(_0x3626fb,null))[_0xd7b5('0x27')](respondWithResult(_0x3626fb,null))[_0xd7b5('0x44')](handleError(_0x3626fb,null));};exports['create']=function(_0x447d23,_0x5418e5){return db['WhatsappTransferReport'][_0xd7b5('0x47')](_0x447d23[_0xd7b5('0x48')],{})[_0xd7b5('0x27')](respondWithResult(_0x5418e5,0xc9))['catch'](handleError(_0x5418e5,null));};exports['update']=function(_0x27d0b1,_0x337c0a){if(_0x27d0b1[_0xd7b5('0x48')]['id']){delete _0x27d0b1[_0xd7b5('0x48')]['id'];}return db[_0xd7b5('0x2e')][_0xd7b5('0x49')]({'where':{'id':_0x27d0b1[_0xd7b5('0x4a')]['id']}})[_0xd7b5('0x27')](handleEntityNotFound(_0x337c0a,null))[_0xd7b5('0x27')](saveUpdates(_0x27d0b1[_0xd7b5('0x48')],null))[_0xd7b5('0x27')](respondWithResult(_0x337c0a,null))[_0xd7b5('0x44')](handleError(_0x337c0a,null));};exports[_0xd7b5('0x4b')]=function(_0x6ea6de,_0xc9fc3e){return db['WhatsappTransferReport'][_0xd7b5('0x49')]({'where':{'id':_0x6ea6de[_0xd7b5('0x4a')]['id']}})[_0xd7b5('0x27')](handleEntityNotFound(_0xc9fc3e,null))[_0xd7b5('0x27')](removeEntity(_0xc9fc3e,null))[_0xd7b5('0x44')](handleError(_0xc9fc3e,null));};exports[_0xd7b5('0x4c')]=function(_0x238f4f,_0x561560){return db['WhatsappTransferReport'][_0xd7b5('0x4c')]()[_0xd7b5('0x27')](respondWithResult(_0x561560,null))[_0xd7b5('0x44')](handleError(_0x561560,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 6470cfe..f989e2c 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 _0x4ce0=['exports','define','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','./whatsappTransferReport.attributes'];(function(_0x4d171c,_0x1163b8){var _0x104420=function(_0x454c19){while(--_0x454c19){_0x4d171c['push'](_0x4d171c['shift']());}};_0x104420(++_0x1163b8);}(_0x4ce0,0x184));var _0x04ce=function(_0x5386fb,_0x4b2e14){_0x5386fb=_0x5386fb-0x0;var _0xea7d70=_0x4ce0[_0x5386fb];return _0xea7d70;};'use strict';var _=require(_0x04ce('0x0'));var util=require(_0x04ce('0x1'));var logger=require(_0x04ce('0x2'))(_0x04ce('0x3'));var moment=require('moment');var BPromise=require(_0x04ce('0x4'));var rp=require(_0x04ce('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x04ce('0x6'));var config=require('../../config/environment');var attributes=require(_0x04ce('0x7'));module[_0x04ce('0x8')]=function(_0x5b9551,_0x1d90b0){return _0x5b9551[_0x04ce('0x9')]('WhatsappTransferReport',attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x04ce('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8773=['request-promise','path','rimraf','../../config/environment','./whatsappTransferReport.attributes','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','api','moment','bluebird'];(function(_0x5a2c3e,_0x46ae00){var _0x5f440f=function(_0x1c6174){while(--_0x1c6174){_0x5a2c3e['push'](_0x5a2c3e['shift']());}};_0x5f440f(++_0x46ae00);}(_0x8773,0x11c));var _0x3877=function(_0x11d500,_0x4dbf96){_0x11d500=_0x11d500-0x0;var _0x44c27b=_0x8773[_0x11d500];return _0x44c27b;};'use strict';var _=require(_0x3877('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3877('0x1'));var moment=require(_0x3877('0x2'));var BPromise=require(_0x3877('0x3'));var rp=require(_0x3877('0x4'));var fs=require('fs');var path=require(_0x3877('0x5'));var rimraf=require(_0x3877('0x6'));var config=require(_0x3877('0x7'));var attributes=require(_0x3877('0x8'));module['exports']=function(_0x3c9275,_0x2f512a){return _0x3c9275['define'](_0x3877('0x9'),attributes,{'tableName':_0x3877('0xa'),'paranoid':![],'indexes':[{'name':_0x3877('0xb'),'fields':[_0x3877('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 0c783a1..bc08fda 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 _0xf7fe=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x2cce78,_0xdf16b7){var _0x439e9f=function(_0xe26bb8){while(--_0xe26bb8){_0x2cce78['push'](_0x2cce78['shift']());}};_0x439e9f(++_0xdf16b7);}(_0xf7fe,0x159));var _0xef7f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf7fe[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xef7f('0x0'));var util=require('util');var moment=require(_0xef7f('0x1'));var BPromise=require(_0xef7f('0x2'));var rs=require(_0xef7f('0x3'));var fs=require('fs');var Redis=require(_0xef7f('0x4'));var db=require(_0xef7f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xef7f('0x6'))(_0xef7f('0x7'));var config=require(_0xef7f('0x8'));var jayson=require(_0xef7f('0x9'));var client=jayson[_0xef7f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x482590,_0x1d696b,_0x40c3a2){return new BPromise(function(_0x39b89c,_0x5d4c16){return client[_0xef7f('0xb')](_0x482590,_0x40c3a2)['then'](function(_0x349913){logger[_0xef7f('0xc')](_0xef7f('0xd'),_0x1d696b,_0xef7f('0xe'));logger[_0xef7f('0xf')](_0xef7f('0x10'),_0x1d696b,_0xef7f('0xe'),JSON[_0xef7f('0x11')](_0x349913));if(_0x349913[_0xef7f('0x12')]){if(_0x349913[_0xef7f('0x12')][_0xef7f('0x13')]===0x1f4){logger[_0xef7f('0x12')](_0xef7f('0xd'),_0x1d696b,_0x349913[_0xef7f('0x12')][_0xef7f('0x14')]);return _0x5d4c16(_0x349913['error'][_0xef7f('0x14')]);}logger['error'](_0xef7f('0xd'),_0x1d696b,_0x349913['error'][_0xef7f('0x14')]);return _0x39b89c(_0x349913[_0xef7f('0x12')][_0xef7f('0x14')]);}else{logger['info']('WhatsappTransferReport,\x20%s,\x20%s',_0x1d696b,'request\x20sent');_0x39b89c(_0x349913[_0xef7f('0x15')][_0xef7f('0x14')]);}})[_0xef7f('0x16')](function(_0x49620c){logger['error']('WhatsappTransferReport,\x20%s,\x20%s',_0x1d696b,_0x49620c);_0x5d4c16(_0x49620c);});});} \ No newline at end of file +var _0xabb2=['rpc','../../config/environment','client','http','then','info','WhatsappTransferReport,\x20%s,\x20%s','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1ae515,_0x1a8d1c){var _0x1b525f=function(_0x118f1a){while(--_0x118f1a){_0x1ae515['push'](_0x1ae515['shift']());}};_0x1b525f(++_0x1a8d1c);}(_0xabb2,0xa8));var _0x2abb=function(_0x37cc52,_0x459a9b){_0x37cc52=_0x37cc52-0x0;var _0x2b4a90=_0xabb2[_0x37cc52];return _0x2b4a90;};'use strict';var _=require(_0x2abb('0x0'));var util=require(_0x2abb('0x1'));var moment=require(_0x2abb('0x2'));var BPromise=require(_0x2abb('0x3'));var rs=require(_0x2abb('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2abb('0x5'))['db'];var utils=require(_0x2abb('0x6'));var logger=require(_0x2abb('0x7'))(_0x2abb('0x8'));var config=require(_0x2abb('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x2abb('0xa')][_0x2abb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x36bc2c,_0x4c21fd,_0x4d75e6){return new BPromise(function(_0x2519ec,_0x2edf7a){return client['request'](_0x36bc2c,_0x4d75e6)[_0x2abb('0xc')](function(_0x545c6c){logger[_0x2abb('0xd')](_0x2abb('0xe'),_0x4c21fd,'request\x20sent');logger[_0x2abb('0xf')](_0x2abb('0x10'),_0x4c21fd,_0x2abb('0x11'),JSON['stringify'](_0x545c6c));if(_0x545c6c[_0x2abb('0x12')]){if(_0x545c6c['error'][_0x2abb('0x13')]===0x1f4){logger[_0x2abb('0x12')](_0x2abb('0xe'),_0x4c21fd,_0x545c6c[_0x2abb('0x12')][_0x2abb('0x14')]);return _0x2edf7a(_0x545c6c[_0x2abb('0x12')][_0x2abb('0x14')]);}logger[_0x2abb('0x12')](_0x2abb('0xe'),_0x4c21fd,_0x545c6c[_0x2abb('0x12')][_0x2abb('0x14')]);return _0x2519ec(_0x545c6c['error'][_0x2abb('0x14')]);}else{logger[_0x2abb('0xd')]('WhatsappTransferReport,\x20%s,\x20%s',_0x4c21fd,'request\x20sent');_0x2519ec(_0x545c6c['result']['message']);}})[_0x2abb('0x15')](function(_0x5755c4){logger[_0x2abb('0x12')]('WhatsappTransferReport,\x20%s,\x20%s',_0x4c21fd,_0x5755c4);_0x2edf7a(_0x5755c4);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 283216d..25814df 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc945=['./config/seedDB','default','./config/license','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','./mysqldb','./rpc','./config/environment','./config/logger','sync','then','listen','info','start','Online\x20apps:','filter','online','join','Offline\x20apps:','map','status','name','None','seedDB'];(function(_0x2b7ce2,_0x434541){var _0x2080a7=function(_0x13d3e4){while(--_0x13d3e4){_0x2b7ce2['push'](_0x2b7ce2['shift']());}};_0x2080a7(++_0x434541);}(_0xc945,0xd7));var _0x5c94=function(_0x25a5f8,_0x1e9109){_0x25a5f8=_0x25a5f8-0x0;var _0x52881a=_0xc945[_0x25a5f8];return _0x52881a;};'use strict';var _=require('lodash');var mysqldb=require(_0x5c94('0x0'));var rpc=require(_0x5c94('0x1'));var config=require(_0x5c94('0x2'));var logger=require(_0x5c94('0x3'))('app');var pm2=require('./config/pm2');var pm2Config=require('./config/pm2/config');var schedule=require('./config/schedule');var chat=require('./config/schedule/chat');var whatsapp=require('./config/schedule/whatsapp');var transcribe=require('./config/schedule/transcribe');function main(){return mysqldb['db']['sequelize'][_0x5c94('0x4')]()[_0x5c94('0x5')](function(){return rpc[_0x5c94('0x6')]();})['then'](function(_0x1a7401){logger[_0x5c94('0x7')](_0x1a7401);return chat[_0x5c94('0x8')]();})[_0x5c94('0x5')](function(){return whatsapp[_0x5c94('0x8')]();})[_0x5c94('0x5')](function(){return schedule[_0x5c94('0x8')]();})[_0x5c94('0x5')](function(){return transcribe[_0x5c94('0x8')]();})[_0x5c94('0x5')](function(_0x26b0d7){logger[_0x5c94('0x7')](_0x26b0d7);return pm2['start'](pm2Config);})[_0x5c94('0x5')](function(_0x1586dc){logger[_0x5c94('0x7')](_0x5c94('0x9'),_['map'](_[_0x5c94('0xa')](_0x1586dc,{'status':_0x5c94('0xb')}),'name')[_0x5c94('0xc')]());logger[_0x5c94('0x7')](_0x5c94('0xd'),_[_0x5c94('0xe')](_[_0x5c94('0xa')](_0x1586dc,function(_0x581008){return _0x581008[_0x5c94('0xf')]!==_0x5c94('0xb');}),_0x5c94('0x10'))[_0x5c94('0xc')]()||_0x5c94('0x11'));config[_0x5c94('0x12')]&&require(_0x5c94('0x13'))[_0x5c94('0x14')]();require(_0x5c94('0x15'))[_0x5c94('0x14')]();})[_0x5c94('0x16')](function(_0xe66e60){logger[_0x5c94('0x17')](_0x5c94('0x18'),_0xe66e60);process[_0x5c94('0x19')](0x1);});}main(); \ No newline at end of file +var _0x6ca2=['online','name','Offline\x20apps:','status','join','None','seedDB','./config/seedDB','default','./config/license','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./config/environment','app','./config/pm2','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','sync','then','listen','info','start','map','filter'];(function(_0xc81f41,_0x15fb9a){var _0x187d3d=function(_0x21d9f8){while(--_0x21d9f8){_0xc81f41['push'](_0xc81f41['shift']());}};_0x187d3d(++_0x15fb9a);}(_0x6ca2,0x1c0));var _0x26ca=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6ca2[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x26ca('0x0'));var mysqldb=require(_0x26ca('0x1'));var rpc=require('./rpc');var config=require(_0x26ca('0x2'));var logger=require('./config/logger')(_0x26ca('0x3'));var pm2=require(_0x26ca('0x4'));var pm2Config=require('./config/pm2/config');var schedule=require(_0x26ca('0x5'));var chat=require(_0x26ca('0x6'));var whatsapp=require(_0x26ca('0x7'));var transcribe=require(_0x26ca('0x8'));function main(){return mysqldb['db'][_0x26ca('0x9')][_0x26ca('0xa')]()[_0x26ca('0xb')](function(){return rpc[_0x26ca('0xc')]();})[_0x26ca('0xb')](function(_0x8a802e){logger[_0x26ca('0xd')](_0x8a802e);return chat['start']();})[_0x26ca('0xb')](function(){return whatsapp[_0x26ca('0xe')]();})[_0x26ca('0xb')](function(){return schedule[_0x26ca('0xe')]();})[_0x26ca('0xb')](function(){return transcribe[_0x26ca('0xe')]();})[_0x26ca('0xb')](function(_0x3ad98d){logger[_0x26ca('0xd')](_0x3ad98d);return pm2[_0x26ca('0xe')](pm2Config);})[_0x26ca('0xb')](function(_0xb8c676){logger['info']('Online\x20apps:',_[_0x26ca('0xf')](_[_0x26ca('0x10')](_0xb8c676,{'status':_0x26ca('0x11')}),_0x26ca('0x12'))['join']());logger[_0x26ca('0xd')](_0x26ca('0x13'),_[_0x26ca('0xf')](_['filter'](_0xb8c676,function(_0x18471f){return _0x18471f[_0x26ca('0x14')]!==_0x26ca('0x11');}),_0x26ca('0x12'))[_0x26ca('0x15')]()||_0x26ca('0x16'));config[_0x26ca('0x17')]&&require(_0x26ca('0x18'))[_0x26ca('0x19')]();require(_0x26ca('0x1a'))[_0x26ca('0x19')]();})[_0x26ca('0x1b')](function(_0x351f11){logger[_0x26ca('0x1c')](_0x26ca('0x1d'),_0x351f11);process[_0x26ca('0x1e')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 1c0f514..85c0bd4 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 _0x8668=['floor','now','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','../encryptor','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','bluebird','util','moment','secrets','session','role','fullname','name','internal','userpic','permissions','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','isAuthenticated','user','ChatInteraction','disposition','then','closed','status','unmanaged','json','Unmanaged.','Forbidden.','catch','use','headers','authorization','startsWith','Basic','find','pass','Wrong\x20credentials.','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','Setting','findOne','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','add','blockDuration','minutes','User\x20not\x20found.','User\x20object\x20not\x20found.','getLicense','update','Forbidden','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','send','isNil','generateApiKey','apiKeyIat','regenerateApiKey','validatePasswordPattern','test','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~!@#$%^&-_=+[{]}.','validatePasswordHistory','split','toLowerCase','format','Sequelize','updatePasswordsHistory','decryptString','length','join','sign','secret','promisify','randomBytes','toString','hex'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x8668,0x7f));var _0x8866=function(_0x15df00,_0x25f5bd){_0x15df00=_0x15df00-0x0;var _0x7db24b=_0x8668[_0x15df00];return _0x7db24b;};'use strict';var db=require(_0x8866('0x0'))['db'];var config=require(_0x8866('0x1'));var hardwareConf=require(_0x8866('0x2'));var licenseUtil=require('../../config/license/util');var encryptor=require(_0x8866('0x3'));var _=require(_0x8866('0x4'));var jwt=require(_0x8866('0x5'));var expressJwt=require(_0x8866('0x6'));var compose=require(_0x8866('0x7'));var basicAuth=require(_0x8866('0x8'));var crypto=require(_0x8866('0x9'));var BPromise=require(_0x8866('0xa'));var util=require(_0x8866('0xb'));var moment=require(_0x8866('0xc'));var validateJwt=expressJwt({'secret':config[_0x8866('0xd')][_0x8866('0xe')]});var userAttributes=['id',_0x8866('0xf'),_0x8866('0x10'),_0x8866('0x11'),_0x8866('0x12'),'email',_0x8866('0x13'),_0x8866('0x14'),_0x8866('0x15'),_0x8866('0x16'),_0x8866('0x17'),_0x8866('0x18'),_0x8866('0x19'),_0x8866('0x1a'),'openchannelPause',_0x8866('0x1b'),_0x8866('0x1c'),_0x8866('0x1d'),_0x8866('0x1e'),_0x8866('0x1f'),'allowmessenger',_0x8866('0x20'),_0x8866('0x21'),_0x8866('0x22'),'phoneBarAutoAnswerDelay',_0x8866('0x23'),_0x8866('0x24'),_0x8866('0x25'),_0x8866('0x26'),_0x8866('0x27'),'phoneBarPrefixRequired',_0x8866('0x28'),_0x8866('0x29'),_0x8866('0x2a'),_0x8866('0x2b'),'userProfileId',_0x8866('0x2c'),_0x8866('0x2d'),_0x8866('0x2e'),_0x8866('0x2f'),_0x8866('0x30'),'downloadAttachments'];exports['isChatInteractionAuthorized']=function(){return this[_0x8866('0x31')](!![])['use'](function(_0x162cf1,_0x36885e,_0xf6bbd6){if(_0x162cf1[_0x8866('0x32')]){_0xf6bbd6();}else{return db[_0x8866('0x33')]['findOne']({'where':{'id':_0x162cf1['params']['id']},'attributes':['id','closed',_0x8866('0x34')],'raw':!![]})[_0x8866('0x35')](function(_0x166365){if(_0x166365&&_0x166365[_0x8866('0x36')]){return _0x36885e[_0x8866('0x37')](_0x166365[_0x8866('0x34')]===_0x8866('0x38')?0x195:0x193)[_0x8866('0x39')]({'message':_0x166365[_0x8866('0x34')]===_0x8866('0x38')?_0x8866('0x3a'):_0x8866('0x3b')});}else{_0xf6bbd6();}})[_0x8866('0x3c')](function(_0x34fca4){_0xf6bbd6(_0x34fca4);});}});};exports[_0x8866('0x31')]=function isAuthenticated(_0x24c2bb){return compose()[_0x8866('0x3d')](function(_0x453c3d,_0x4e23bd,_0x1a03a1){var _0x3c3371;if(_0x453c3d[_0x8866('0x3e')][_0x8866('0x3f')]){if(_[_0x8866('0x40')](_0x453c3d[_0x8866('0x3e')][_0x8866('0x3f')],_0x8866('0x41'))){var _0x132634=basicAuth(_0x453c3d);db['User'][_0x8866('0x42')]({'where':{'name':_0x132634[_0x8866('0x11')]}})[_0x8866('0x35')](function(_0x5bc9ba){if(!_0x5bc9ba||!_0x5bc9ba['authenticate'](_0x132634[_0x8866('0x43')])){return _0x4e23bd[_0x8866('0x37')](0x191)[_0x8866('0x39')]({'message':_0x8866('0x44')});}_0x453c3d[_0x8866('0x32')]={'id':_0x5bc9ba['id']};_0x1a03a1();})[_0x8866('0x3c')](function(_0x11ae74){_0x1a03a1(_0x11ae74);});}else if(_[_0x8866('0x40')](_0x453c3d[_0x8866('0x3e')][_0x8866('0x3f')],_0x8866('0x45'))){validateJwt(_0x453c3d,_0x4e23bd,_0x1a03a1);}else{if(_0x24c2bb){_0x1a03a1();}else{return _0x4e23bd[_0x8866('0x37')](0x193)[_0x8866('0x39')]({'message':_0x8866('0x46')});}}}else if(_0x453c3d[_0x8866('0x47')][_0x8866('0x48')]){try{var _0x2f4221={'audience':hardwareConf[_0x8866('0x49')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x453c3d[_0x8866('0x47')][_0x8866('0x48')],_0x2f4221)[_0x8866('0x35')](function(_0x5e7bf3){return db['User'][_0x8866('0x42')]({'where':{'id':_0x5e7bf3[_0x8866('0x4a')]}})[_0x8866('0x35')](function(_0xcef619){_0x3c3371=_0xcef619;return db[_0x8866('0x4b')][_0x8866('0x4c')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]});})[_0x8866('0x35')](function(_0x49004b){if(!_0x3c3371||!_['isEqual'](_0x3c3371[_0x8866('0x4d')],_0x5e7bf3[_0x8866('0x4e')])){return _0x4e23bd[_0x8866('0x37')](0x191)[_0x8866('0x39')]({'message':_0x8866('0x4f')});}if(_0x3c3371[_0x8866('0x50')]){return _0x4e23bd[_0x8866('0x37')](0x191)[_0x8866('0x39')]({'message':_0x8866('0x51')});}if(_0x3c3371[_0x8866('0x52')]){if(_0x49004b['blockDuration']>0x0){if(moment(_0x3c3371['blockedAt'])[_0x8866('0x53')](_0x49004b[_0x8866('0x54')],_0x8866('0x55'))>moment()){return _0x4e23bd[_0x8866('0x37')](0x191)[_0x8866('0x39')]({'message':_0x8866('0x51')});}}else{return _0x4e23bd['status'](0x191)[_0x8866('0x39')]({'message':'Invalid\x20API\x20access\x20key'});}}_0x453c3d[_0x8866('0x32')]={'id':_0x3c3371['id']};_0x1a03a1();});})[_0x8866('0x3c')](function(){return _0x4e23bd[_0x8866('0x37')](0x191)['json']({'message':_0x8866('0x51')});});}catch(_0x273a57){_0x1a03a1(_0x273a57);}}else if(_0x24c2bb){_0x1a03a1();}else{return _0x4e23bd[_0x8866('0x37')](0x193)[_0x8866('0x39')]({'message':_0x8866('0x46')});}})[_0x8866('0x3d')](function(_0x30c547,_0x18454c,_0x5bfa1d){if(_0x30c547[_0x8866('0x32')]){db['User']['find']({'where':{'id':_0x30c547['user']['id']},'attributes':userAttributes})[_0x8866('0x35')](function(_0x3f42b4){if(!_0x3f42b4){return _0x18454c[_0x8866('0x37')](0x194)[_0x8866('0x39')]({'message':_0x8866('0x56')});}_0x30c547[_0x8866('0x32')]=_0x3f42b4;_0x5bfa1d();})['catch'](function(_0x224042){_0x5bfa1d(_0x224042);});}else if(_0x24c2bb){_0x5bfa1d();}else{return _0x18454c['status'](0x194)[_0x8866('0x39')]({'message':_0x8866('0x57')});}});};exports['canUpdate']=function canUpdate(){return compose()[_0x8866('0x3d')](function(_0x150f48,_0xde217b,_0x20db3f){return licenseUtil[_0x8866('0x58')]()[_0x8866('0x35')](function(_0x215ac3){if(_0x215ac3[_0x8866('0x59')]){_0x20db3f();}else{return _0xde217b[_0x8866('0x37')](0x193)['json']({'message':_0x8866('0x5a')});}})[_0x8866('0x3c')](function(_0x30a4bd){_0x20db3f(_0x30a4bd);});});};exports['isMiddleware']=function(_0x35a52d,_0x44d1ae,_0x202d30){_0x35a52d[_0x8866('0x5b')]=!![];return _0x202d30();};exports[_0x8866('0x5c')]=function signToken(_0x588c05){return signJwt(_0x588c05);};exports[_0x8866('0x5d')]=function(_0x2b93a7,_0x3348f1){if(!_0x2b93a7[_0x8866('0x32')]){return _0x3348f1[_0x8866('0x37')](0x194)[_0x8866('0x39')]({'message':_0x8866('0x5e')});}var _0x421f96={'payload':{'id':_0x2b93a7[_0x8866('0x32')]['id'],'role':_0x2b93a7[_0x8866('0x32')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x421f96)[_0x8866('0x35')](function(_0x385112){_0x3348f1[_0x8866('0x5f')](_0x8866('0x60'),_0x385112);_0x3348f1['redirect']('/dashboards/general');})[_0x8866('0x3c')](function(_0x5d3f1b){return _0x3348f1['status'](0x1f4)[_0x8866('0x61')](_0x5d3f1b);});};exports['retrieveApiKey']=function(_0x4d3c3){if(_[_0x8866('0x62')](_0x4d3c3['apiKeyNonce'])||_[_0x8866('0x62')](_0x4d3c3['apiKeyIat'])){return null;}else{return createJwt(_0x4d3c3);}};exports[_0x8866('0x63')]=function(_0x28a363){_0x28a363[_0x8866('0x4d')]=generateNonce();_0x28a363[_0x8866('0x64')]=generateIssuedAt();return createJwt(_0x28a363);};exports[_0x8866('0x65')]=function(_0x4b47ee,_0x4594cc){var _0xf61bf6=_0x4b47ee[_0x8866('0x47')][_0x8866('0x48')];if(_0xf61bf6){var _0xdde251={'nonce':_0x4594cc[_0x8866('0x4d')],'iat':_0x4594cc[_0x8866('0x64')],'audience':hardwareConf[_0x8866('0x49')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0xf61bf6,_0xdde251)['then'](function(){return generateApiKey(_0x4594cc);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports[_0x8866('0x66')]=function(_0x57cbf0){var _0x2fa28d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x2fa28d[_0x8866('0x67')](_0x57cbf0))throw new db['Sequelize'][(_0x8866('0x68'))](_0x8866('0x69'));return;};exports[_0x8866('0x6a')]=function(_0x53cedb,_0x4d6b9b,_0x40665f){var _0x4f364e=encryptor['decryptString'](_0x4d6b9b)[_0x8866('0x6b')](',');for(var _0x49079b=0x0;_0x49079b<_0x40665f;_0x49079b++){if(!_0x4f364e[_0x49079b])break;if(_0x53cedb[_0x8866('0x6c')]()===_0x4f364e[_0x49079b][_0x8866('0x6c')]()){var _0xa1130a=util[_0x8866('0x6d')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x40665f);if(_0x40665f===0x1){_0xa1130a='The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.';}throw new db[(_0x8866('0x6e'))][(_0x8866('0x68'))](_0xa1130a);}}return;};exports[_0x8866('0x6f')]=function(_0x5746a5,_0x518b20){var _0x407245=_0x518b20?encryptor[_0x8866('0x70')](_0x518b20)[_0x8866('0x6b')](','):[];if(_0x407245[_0x8866('0x71')]===0x5){_0x407245['splice'](-0x1,0x1);}_0x407245['unshift'](_0x5746a5);return encryptor['encryptString'](_0x407245[_0x8866('0x72')](','));};function signJwt(_0x58ab8a){var _0x308780=BPromise['promisify'](jwt[_0x8866('0x73')],{'context':jwt});var _0x4b55dc=_0x58ab8a[_0x8866('0x74')]||config[_0x8866('0xd')][_0x8866('0xe')];return new BPromise(function(_0x22755c,_0x2ab954){_0x308780(_0x58ab8a['payload'],_0x4b55dc,_0x58ab8a['options'])[_0x8866('0x35')](function(_0x2a9b8a){_0x22755c(_0x2a9b8a);})[_0x8866('0x3c')](function(_0x141c03){_0x2ab954(_0x141c03);});});}function verifyJwt(_0x244c4d,_0x1fbf5d,_0x3a7ea6){var _0x14ad5f=BPromise[_0x8866('0x75')](jwt['verify'],{'context':jwt});var _0x1745a7=_0x3a7ea6||config[_0x8866('0xd')][_0x8866('0xe')];return new BPromise(function(_0xef7a01,_0x3ac233){_0x14ad5f(_0x244c4d,_0x1745a7,_0x1fbf5d)[_0x8866('0x35')](function(_0x51d50c){_0xef7a01(_0x51d50c);})[_0x8866('0x3c')](function(_0xe63c){_0x3ac233(_0xe63c);});});}function generateNonce(){return crypto[_0x8866('0x76')](0x10)[_0x8866('0x77')](_0x8866('0x78'));}function generateIssuedAt(){return Math[_0x8866('0x79')](Date[_0x8866('0x7a')]()/0x3e8)[_0x8866('0x77')]();}function createJwt(_0x34a7b5){var _0x58852e={'payload':{'iat':_0x34a7b5[_0x8866('0x64')],'nonce':_0x34a7b5[_0x8866('0x4d')]},'options':{'algorithm':_0x8866('0x7b'),'subject':_0x34a7b5['id'][_0x8866('0x77')](),'issuer':hardwareConf[_0x8866('0x49')](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x58852e)['then'](function(_0x1134af){return{'iat':_0x34a7b5[_0x8866('0x64')],'nonce':_0x34a7b5[_0x8866('0x4d')],'token':_0x1134af};});} \ No newline at end of file +var _0xfe1f=['isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','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.','decryptString','splice','unshift','join','promisify','sign','secret','secrets','session','verify','toString','hex','floor','now','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','lodash','jsonwebtoken','express-jwt','basic-auth','util','role','fullname','name','email','userpic','permissions','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','pauseType','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','interface','userProfileId','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','isChatInteractionAuthorized','isAuthenticated','use','user','findOne','params','disposition','unmanaged','json','Unmanaged.','Forbidden.','catch','headers','authorization','startsWith','Basic','find','then','authenticate','status','Wrong\x20credentials.','Bearer','query','getUuid','apikey','User','sub','Setting','blockDuration','isEqual','apiKeyNonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blockedAt','add','minutes','Unknown\x20authorization\x20format','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','Forbidden'];(function(_0x3e913e,_0x5478a0){var _0x3a6bcf=function(_0x41e61f){while(--_0x41e61f){_0x3e913e['push'](_0x3e913e['shift']());}};_0x3a6bcf(++_0x5478a0);}(_0xfe1f,0x11f));var _0xffe1=function(_0x7a112,_0x2eb4a0){_0x7a112=_0x7a112-0x0;var _0x136dc5=_0xfe1f[_0x7a112];return _0x136dc5;};'use strict';var db=require(_0xffe1('0x0'))['db'];var config=require(_0xffe1('0x1'));var hardwareConf=require(_0xffe1('0x2'));var licenseUtil=require(_0xffe1('0x3'));var encryptor=require(_0xffe1('0x4'));var _=require(_0xffe1('0x5'));var jwt=require(_0xffe1('0x6'));var expressJwt=require(_0xffe1('0x7'));var compose=require('composable-middleware');var basicAuth=require(_0xffe1('0x8'));var crypto=require('crypto');var BPromise=require('bluebird');var util=require(_0xffe1('0x9'));var moment=require('moment');var validateJwt=expressJwt({'secret':config['secrets']['session']});var userAttributes=['id',_0xffe1('0xa'),_0xffe1('0xb'),_0xffe1('0xc'),'internal',_0xffe1('0xd'),_0xffe1('0xe'),_0xffe1('0xf'),_0xffe1('0x10'),_0xffe1('0x11'),_0xffe1('0x12'),_0xffe1('0x13'),_0xffe1('0x14'),_0xffe1('0x15'),'openchannelPause',_0xffe1('0x16'),'showWebBar',_0xffe1('0x17'),_0xffe1('0x18'),_0xffe1('0x19'),_0xffe1('0x1a'),_0xffe1('0x1b'),_0xffe1('0x1c'),_0xffe1('0x1d'),_0xffe1('0x1e'),_0xffe1('0x1f'),'phoneBarEnableRecording',_0xffe1('0x20'),_0xffe1('0x21'),'phoneBarExpires',_0xffe1('0x22'),_0xffe1('0x23'),_0xffe1('0x24'),'hotdesk',_0xffe1('0x25'),_0xffe1('0x26'),'privacyEnabled',_0xffe1('0x27'),_0xffe1('0x28'),_0xffe1('0x29'),_0xffe1('0x2a'),_0xffe1('0x2b')];exports[_0xffe1('0x2c')]=function(){return this[_0xffe1('0x2d')](!![])[_0xffe1('0x2e')](function(_0x20e5c0,_0x2b2433,_0x56b40a){if(_0x20e5c0[_0xffe1('0x2f')]){_0x56b40a();}else{return db['ChatInteraction'][_0xffe1('0x30')]({'where':{'id':_0x20e5c0[_0xffe1('0x31')]['id']},'attributes':['id','closed',_0xffe1('0x32')],'raw':!![]})['then'](function(_0x366001){if(_0x366001&&_0x366001['closed']){return _0x2b2433['status'](_0x366001[_0xffe1('0x32')]===_0xffe1('0x33')?0x195:0x193)[_0xffe1('0x34')]({'message':_0x366001[_0xffe1('0x32')]==='unmanaged'?_0xffe1('0x35'):_0xffe1('0x36')});}else{_0x56b40a();}})[_0xffe1('0x37')](function(_0x47b49b){_0x56b40a(_0x47b49b);});}});};exports[_0xffe1('0x2d')]=function isAuthenticated(_0x4f9529){return compose()['use'](function(_0x41c3ff,_0x4d1de9,_0x242866){var _0xa3b6f5;if(_0x41c3ff[_0xffe1('0x38')][_0xffe1('0x39')]){if(_[_0xffe1('0x3a')](_0x41c3ff[_0xffe1('0x38')][_0xffe1('0x39')],_0xffe1('0x3b'))){var _0x1fb836=basicAuth(_0x41c3ff);db['User'][_0xffe1('0x3c')]({'where':{'name':_0x1fb836[_0xffe1('0xc')]}})[_0xffe1('0x3d')](function(_0x20013b){if(!_0x20013b||!_0x20013b[_0xffe1('0x3e')](_0x1fb836['pass'])){return _0x4d1de9[_0xffe1('0x3f')](0x191)['json']({'message':_0xffe1('0x40')});}_0x41c3ff[_0xffe1('0x2f')]={'id':_0x20013b['id']};_0x242866();})[_0xffe1('0x37')](function(_0x2452df){_0x242866(_0x2452df);});}else if(_[_0xffe1('0x3a')](_0x41c3ff[_0xffe1('0x38')][_0xffe1('0x39')],_0xffe1('0x41'))){validateJwt(_0x41c3ff,_0x4d1de9,_0x242866);}else{if(_0x4f9529){_0x242866();}else{return _0x4d1de9[_0xffe1('0x3f')](0x193)[_0xffe1('0x34')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x41c3ff[_0xffe1('0x42')]['apikey']){try{var _0x25579c={'audience':hardwareConf[_0xffe1('0x43')](),'issuer':hardwareConf[_0xffe1('0x43')]()};verifyJwt(_0x41c3ff[_0xffe1('0x42')][_0xffe1('0x44')],_0x25579c)[_0xffe1('0x3d')](function(_0x518084){return db[_0xffe1('0x45')][_0xffe1('0x3c')]({'where':{'id':_0x518084[_0xffe1('0x46')]}})[_0xffe1('0x3d')](function(_0x261da5){_0xa3b6f5=_0x261da5;return db[_0xffe1('0x47')][_0xffe1('0x30')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xffe1('0x48')],'raw':!![]});})[_0xffe1('0x3d')](function(_0x58a2fe){if(!_0xa3b6f5||!_[_0xffe1('0x49')](_0xa3b6f5[_0xffe1('0x4a')],_0x518084['nonce'])){return _0x4d1de9[_0xffe1('0x3f')](0x191)['json']({'message':_0xffe1('0x4b')});}if(_0xa3b6f5[_0xffe1('0x4c')]){return _0x4d1de9[_0xffe1('0x3f')](0x191)[_0xffe1('0x34')]({'message':_0xffe1('0x4d')});}if(_0xa3b6f5['blocked']){if(_0x58a2fe[_0xffe1('0x48')]>0x0){if(moment(_0xa3b6f5[_0xffe1('0x4e')])[_0xffe1('0x4f')](_0x58a2fe[_0xffe1('0x48')],_0xffe1('0x50'))>moment()){return _0x4d1de9['status'](0x191)[_0xffe1('0x34')]({'message':_0xffe1('0x4d')});}}else{return _0x4d1de9[_0xffe1('0x3f')](0x191)[_0xffe1('0x34')]({'message':_0xffe1('0x4d')});}}_0x41c3ff['user']={'id':_0xa3b6f5['id']};_0x242866();});})[_0xffe1('0x37')](function(){return _0x4d1de9['status'](0x191)[_0xffe1('0x34')]({'message':_0xffe1('0x4d')});});}catch(_0x261074){_0x242866(_0x261074);}}else if(_0x4f9529){_0x242866();}else{return _0x4d1de9['status'](0x193)[_0xffe1('0x34')]({'message':_0xffe1('0x51')});}})[_0xffe1('0x2e')](function(_0xc9ca00,_0x5bf37d,_0xf2bb5e){if(_0xc9ca00[_0xffe1('0x2f')]){db[_0xffe1('0x45')][_0xffe1('0x3c')]({'where':{'id':_0xc9ca00[_0xffe1('0x2f')]['id']},'attributes':userAttributes})['then'](function(_0x494246){if(!_0x494246){return _0x5bf37d[_0xffe1('0x3f')](0x194)[_0xffe1('0x34')]({'message':_0xffe1('0x52')});}_0xc9ca00['user']=_0x494246;_0xf2bb5e();})[_0xffe1('0x37')](function(_0x1cebc5){_0xf2bb5e(_0x1cebc5);});}else if(_0x4f9529){_0xf2bb5e();}else{return _0x5bf37d[_0xffe1('0x3f')](0x194)[_0xffe1('0x34')]({'message':_0xffe1('0x53')});}});};exports[_0xffe1('0x54')]=function canUpdate(){return compose()[_0xffe1('0x2e')](function(_0x35892c,_0x5968bd,_0x41e1b8){return licenseUtil[_0xffe1('0x55')]()[_0xffe1('0x3d')](function(_0x3c7d34){if(_0x3c7d34[_0xffe1('0x56')]){_0x41e1b8();}else{return _0x5968bd['status'](0x193)[_0xffe1('0x34')]({'message':_0xffe1('0x57')});}})[_0xffe1('0x37')](function(_0x1828ca){_0x41e1b8(_0x1828ca);});});};exports[_0xffe1('0x58')]=function(_0x1c72b5,_0x3c3bac,_0x22beda){_0x1c72b5[_0xffe1('0x58')]=!![];return _0x22beda();};exports[_0xffe1('0x59')]=function signToken(_0x3e9ebc){return signJwt(_0x3e9ebc);};exports[_0xffe1('0x5a')]=function(_0x33c414,_0x12e0a5){if(!_0x33c414['user']){return _0x12e0a5[_0xffe1('0x3f')](0x194)[_0xffe1('0x34')]({'message':_0xffe1('0x5b')});}var _0x36168e={'payload':{'id':_0x33c414[_0xffe1('0x2f')]['id'],'role':_0x33c414[_0xffe1('0x2f')][_0xffe1('0xa')]},'options':{'expiresIn':0x15180}};return signJwt(_0x36168e)[_0xffe1('0x3d')](function(_0x2ae320){_0x12e0a5[_0xffe1('0x5c')](_0xffe1('0x5d'),_0x2ae320);_0x12e0a5[_0xffe1('0x5e')](_0xffe1('0x5f'));})['catch'](function(_0x599ba5){return _0x12e0a5['status'](0x1f4)[_0xffe1('0x60')](_0x599ba5);});};exports[_0xffe1('0x61')]=function(_0x4fa070){if(_[_0xffe1('0x62')](_0x4fa070[_0xffe1('0x4a')])||_[_0xffe1('0x62')](_0x4fa070[_0xffe1('0x63')])){return null;}else{return createJwt(_0x4fa070);}};exports[_0xffe1('0x64')]=function(_0x58539c){_0x58539c['apiKeyNonce']=generateNonce();_0x58539c[_0xffe1('0x63')]=generateIssuedAt();return createJwt(_0x58539c);};exports['regenerateApiKey']=function(_0x319bca,_0x1f2d2f){var _0x468375=_0x319bca[_0xffe1('0x42')][_0xffe1('0x44')];if(_0x468375){var _0x178732={'nonce':_0x1f2d2f[_0xffe1('0x4a')],'iat':_0x1f2d2f[_0xffe1('0x63')],'audience':hardwareConf[_0xffe1('0x43')](),'issuer':hardwareConf[_0xffe1('0x43')]()};return verifyJwt(_0x468375,_0x178732)[_0xffe1('0x3d')](function(){return generateApiKey(_0x1f2d2f);});}else{throw{'message':_0xffe1('0x65')};}};exports[_0xffe1('0x66')]=function(_0x223987){var _0x5698f3=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x5698f3[_0xffe1('0x67')](_0x223987))throw new db[(_0xffe1('0x68'))][(_0xffe1('0x69'))]('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['validatePasswordHistory']=function(_0x42f7cd,_0x5877e4,_0x240967){var _0x5d9f58=encryptor['decryptString'](_0x5877e4)[_0xffe1('0x6a')](',');for(var _0x44f20e=0x0;_0x44f20e<_0x240967;_0x44f20e++){if(!_0x5d9f58[_0x44f20e])break;if(_0x42f7cd[_0xffe1('0x6b')]()===_0x5d9f58[_0x44f20e][_0xffe1('0x6b')]()){var _0x51b4ab=util[_0xffe1('0x6c')](_0xffe1('0x6d'),_0x240967);if(_0x240967===0x1){_0x51b4ab=_0xffe1('0x6e');}throw new db[(_0xffe1('0x68'))][(_0xffe1('0x69'))](_0x51b4ab);}}return;};exports['updatePasswordsHistory']=function(_0x46306f,_0xb213af){var _0x33390c=_0xb213af?encryptor[_0xffe1('0x6f')](_0xb213af)[_0xffe1('0x6a')](','):[];if(_0x33390c['length']===0x5){_0x33390c[_0xffe1('0x70')](-0x1,0x1);}_0x33390c[_0xffe1('0x71')](_0x46306f);return encryptor['encryptString'](_0x33390c[_0xffe1('0x72')](','));};function signJwt(_0x2ba1e2){var _0x9b27fe=BPromise[_0xffe1('0x73')](jwt[_0xffe1('0x74')],{'context':jwt});var _0xec73f0=_0x2ba1e2[_0xffe1('0x75')]||config[_0xffe1('0x76')][_0xffe1('0x77')];return new BPromise(function(_0x23e590,_0x6e609d){_0x9b27fe(_0x2ba1e2['payload'],_0xec73f0,_0x2ba1e2['options'])[_0xffe1('0x3d')](function(_0x3f22a3){_0x23e590(_0x3f22a3);})[_0xffe1('0x37')](function(_0x13e635){_0x6e609d(_0x13e635);});});}function verifyJwt(_0x706584,_0x5a076b,_0x25cae6){var _0xb57d25=BPromise['promisify'](jwt[_0xffe1('0x78')],{'context':jwt});var _0xedfc40=_0x25cae6||config['secrets'][_0xffe1('0x77')];return new BPromise(function(_0x497ce1,_0x23e21b){_0xb57d25(_0x706584,_0xedfc40,_0x5a076b)[_0xffe1('0x3d')](function(_0x106fab){_0x497ce1(_0x106fab);})[_0xffe1('0x37')](function(_0x245bb2){_0x23e21b(_0x245bb2);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0xffe1('0x79')](_0xffe1('0x7a'));}function generateIssuedAt(){return Math[_0xffe1('0x7b')](Date[_0xffe1('0x7c')]()/0x3e8)[_0xffe1('0x79')]();}function createJwt(_0x3f3c54){var _0x1c2b46={'payload':{'iat':_0x3f3c54[_0xffe1('0x63')],'nonce':_0x3f3c54[_0xffe1('0x4a')]},'options':{'algorithm':'HS512','subject':_0x3f3c54['id'][_0xffe1('0x79')](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf[_0xffe1('0x43')]()}};return signJwt(_0x1c2b46)['then'](function(_0x3a2bd7){return{'iat':_0x3f3c54['apiKeyIat'],'nonce':_0x3f3c54[_0xffe1('0x4a')],'token':_0x3a2bd7};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index cdfd2e7..980e94f 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 _0xc482=['base64','decryptString','crypto','bluebird','lodash','app','secrets','encrypt','algorithm','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','getCiphers','filter','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','data','update','end','final','binary','write','close','unlink','decryptFile','createDecipher','encryptString','secret','utf8'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc482,0x1c4));var _0x2c48=function(_0x378eeb,_0x5951cd){_0x378eeb=_0x378eeb-0x0;var _0x405fc7=_0xc482[_0x378eeb];return _0x405fc7;};'use strict';var crypto=require(_0x2c48('0x0'));var fs=require('fs');var BPromise=require(_0x2c48('0x1'));var _=require(_0x2c48('0x2'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0x2c48('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x2c48('0x4')]['session'],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':'aes192'};if(config[_0x2c48('0x5')]&&config[_0x2c48('0x5')]['algorithm']){var isSupported=isAlgorithmSupported(config['encrypt'][_0x2c48('0x6')]);if(isSupported){fileOptions[_0x2c48('0x6')]=config[_0x2c48('0x5')][_0x2c48('0x6')];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger['error'](config[_0x2c48('0x5')][_0x2c48('0x6')],_0x2c48('0x7'),supportedAlgorithms);}}function isASupportedCipher(_0x446470){return AES_SUPPORTED_RX['test'](_0x446470);}function getSupportedCiphers(){return crypto[_0x2c48('0x8')]()[_0x2c48('0x9')](isASupportedCipher);}function isAlgorithmSupported(_0xe67946){return getSupportedCiphers()['indexOf'](_0xe67946)>-0x1;}function combineOptions(_0x6e8aa4){var _0x3f2b9e={};for(var _0x44b1dd in fileOptions){if(fileOptions[_0x2c48('0xa')](_0x44b1dd)){_0x3f2b9e[_0x44b1dd]=fileOptions[_0x44b1dd];}}if(_0x6e8aa4){for(var _0x32ad5a in _0x6e8aa4){if(_0x6e8aa4[_0x2c48('0xa')](_0x32ad5a)){_0x3f2b9e[_0x32ad5a]=_0x6e8aa4[_0x32ad5a];}}}return _0x3f2b9e;}exports[_0x2c48('0xb')]=function(_0x5699ac,_0xdc9e54,_0x2f4131,_0x2a1a1f){return new BPromise(function(_0x4aa5e5,_0x2c1ff7){_0x2a1a1f=combineOptions(_0x2a1a1f);var _0x147619=new Buffer(_0x2f4131);var _0x15e324=fs[_0x2c48('0xc')](_0x5699ac);var _0xc28eef=fs[_0x2c48('0xd')](_0xdc9e54);var _0x5a4344=crypto[_0x2c48('0xe')](_0x2a1a1f[_0x2c48('0x6')],_0x147619);_0x15e324['on'](_0x2c48('0xf'),function(_0x4e13df){var _0xb48396=new Buffer(_0x5a4344[_0x2c48('0x10')](_0x4e13df),'binary');_0xc28eef['write'](_0xb48396);});_0x15e324['on'](_0x2c48('0x11'),function(){try{var _0x3c192f=new Buffer(_0x5a4344[_0x2c48('0x12')](_0x2c48('0x13')),_0x2c48('0x13'));_0xc28eef[_0x2c48('0x14')](_0x3c192f);_0xc28eef[_0x2c48('0x11')]();_0xc28eef['on'](_0x2c48('0x15'),function(){return _0x4aa5e5(_0xdc9e54);});}catch(_0x30940e){fs[_0x2c48('0x16')](_0xdc9e54);return _0x2c1ff7(_0x30940e);}});});};exports[_0x2c48('0x17')]=function(_0x322e8a,_0x2873fa,_0x39c4de,_0x405d01){return new BPromise(function(_0x10bf7c,_0x156432){_0x405d01=combineOptions(_0x405d01);var _0x38d4ed=new Buffer(_0x39c4de);var _0x450ba3=fs['createReadStream'](_0x322e8a);var _0xcfefbc=fs['createWriteStream'](_0x2873fa);var _0x38e6af=crypto[_0x2c48('0x18')](_0x405d01[_0x2c48('0x6')],_0x38d4ed);_0x450ba3['on'](_0x2c48('0xf'),function(_0x3b342c){var _0x30d8ec=new Buffer(_0x38e6af[_0x2c48('0x10')](_0x3b342c),_0x2c48('0x13'));_0xcfefbc['write'](_0x30d8ec);});_0x450ba3['on']('end',function(){try{var _0x34fa9c=new Buffer(_0x38e6af[_0x2c48('0x12')](_0x2c48('0x13')),_0x2c48('0x13'));_0xcfefbc['write'](_0x34fa9c);_0xcfefbc[_0x2c48('0x11')]();_0xcfefbc['on'](_0x2c48('0x15'),function(){return _0x10bf7c(_0x2873fa);});}catch(_0x5d20ad){fs['unlink'](_0x2873fa);return _0x156432(_0x5d20ad);}});});};exports[_0x2c48('0x19')]=function(_0x3834b0,_0x2ec671,_0x57df58){var _0x4deb7a=_0x57df58||stringOptions[_0x2c48('0x6')];var _0x292698=_0x2ec671||stringOptions[_0x2c48('0x1a')];var _0xa70f=crypto['createCipher'](_0x4deb7a,_0x292698);var _0x378441=_0xa70f[_0x2c48('0x10')](_0x3834b0,_0x2c48('0x1b'),_0x2c48('0x1c'));_0x378441+=_0xa70f[_0x2c48('0x12')](_0x2c48('0x1c'));return _0x378441;};exports[_0x2c48('0x1d')]=function(_0x1cb09c,_0x55351d,_0x2e931f){var _0x2bfde5=_0x2e931f||stringOptions[_0x2c48('0x6')];var _0x26eedd=_0x55351d||stringOptions[_0x2c48('0x1a')];var _0x4465a4=crypto[_0x2c48('0x18')](_0x2bfde5,_0x26eedd);var _0x232dff=_0x4465a4[_0x2c48('0x10')](_0x1cb09c,'base64',_0x2c48('0x1b'));_0x232dff+=_0x4465a4[_0x2c48('0x12')](_0x2c48('0x1b'));return _0x232dff;}; \ No newline at end of file +var _0xb2f6=['aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','getCiphers','filter','indexOf','hasOwnProperty','createWriteStream','createCipher','update','binary','write','end','unlink','createReadStream','createDecipher','data','final','secret','base64','utf8','bluebird','lodash','../../config/logger','app','secrets','session','aes-256-ctr'];(function(_0x11b739,_0x261e1b){var _0x384b18=function(_0x54be27){while(--_0x54be27){_0x11b739['push'](_0x11b739['shift']());}};_0x384b18(++_0x261e1b);}(_0xb2f6,0x16d));var _0x6b2f=function(_0x1ee515,_0x25b307){_0x1ee515=_0x1ee515-0x0;var _0x8c2028=_0xb2f6[_0x1ee515];return _0x8c2028;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0x6b2f('0x0'));var _=require(_0x6b2f('0x1'));var config=require('../../config/environment');var logger=require(_0x6b2f('0x2'))(_0x6b2f('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x6b2f('0x4')][_0x6b2f('0x5')],'algorithm':_0x6b2f('0x6')};const fileOptions={'algorithm':_0x6b2f('0x7')};if(config[_0x6b2f('0x8')]&&config['encrypt'][_0x6b2f('0x9')]){var isSupported=isAlgorithmSupported(config[_0x6b2f('0x8')][_0x6b2f('0x9')]);if(isSupported){fileOptions[_0x6b2f('0x9')]=config[_0x6b2f('0x8')]['algorithm'];}else{var supportedAlgorithms=getSupportedCiphers()[_0x6b2f('0xa')](',\x20');logger[_0x6b2f('0xb')](config[_0x6b2f('0x8')]['algorithm'],_0x6b2f('0xc'),supportedAlgorithms);}}function isASupportedCipher(_0x583918){return AES_SUPPORTED_RX['test'](_0x583918);}function getSupportedCiphers(){return crypto[_0x6b2f('0xd')]()[_0x6b2f('0xe')](isASupportedCipher);}function isAlgorithmSupported(_0x125737){return getSupportedCiphers()[_0x6b2f('0xf')](_0x125737)>-0x1;}function combineOptions(_0x45de17){var _0xc6d12={};for(var _0x15617a in fileOptions){if(fileOptions[_0x6b2f('0x10')](_0x15617a)){_0xc6d12[_0x15617a]=fileOptions[_0x15617a];}}if(_0x45de17){for(var _0x2f9619 in _0x45de17){if(_0x45de17['hasOwnProperty'](_0x2f9619)){_0xc6d12[_0x2f9619]=_0x45de17[_0x2f9619];}}}return _0xc6d12;}exports['encryptFile']=function(_0x28fedf,_0x1c3040,_0x37b0f1,_0x401a47){return new BPromise(function(_0x4e6b20,_0x2773c7){_0x401a47=combineOptions(_0x401a47);var _0x4d4d72=new Buffer(_0x37b0f1);var _0x5d5148=fs['createReadStream'](_0x28fedf);var _0x293b5b=fs[_0x6b2f('0x11')](_0x1c3040);var _0x3668be=crypto[_0x6b2f('0x12')](_0x401a47[_0x6b2f('0x9')],_0x4d4d72);_0x5d5148['on']('data',function(_0x50b04e){var _0x10555a=new Buffer(_0x3668be[_0x6b2f('0x13')](_0x50b04e),_0x6b2f('0x14'));_0x293b5b[_0x6b2f('0x15')](_0x10555a);});_0x5d5148['on'](_0x6b2f('0x16'),function(){try{var _0x2a8880=new Buffer(_0x3668be['final']('binary'),_0x6b2f('0x14'));_0x293b5b[_0x6b2f('0x15')](_0x2a8880);_0x293b5b[_0x6b2f('0x16')]();_0x293b5b['on']('close',function(){return _0x4e6b20(_0x1c3040);});}catch(_0x3615bf){fs[_0x6b2f('0x17')](_0x1c3040);return _0x2773c7(_0x3615bf);}});});};exports['decryptFile']=function(_0x2b253d,_0x42c152,_0x274045,_0x11f347){return new BPromise(function(_0xe4b2f5,_0x5a44ad){_0x11f347=combineOptions(_0x11f347);var _0x17b0fc=new Buffer(_0x274045);var _0x29233c=fs[_0x6b2f('0x18')](_0x2b253d);var _0x1a7b3c=fs[_0x6b2f('0x11')](_0x42c152);var _0xc67f11=crypto[_0x6b2f('0x19')](_0x11f347[_0x6b2f('0x9')],_0x17b0fc);_0x29233c['on'](_0x6b2f('0x1a'),function(_0x396455){var _0x51dc6e=new Buffer(_0xc67f11[_0x6b2f('0x13')](_0x396455),'binary');_0x1a7b3c[_0x6b2f('0x15')](_0x51dc6e);});_0x29233c['on'](_0x6b2f('0x16'),function(){try{var _0x52d3a3=new Buffer(_0xc67f11[_0x6b2f('0x1b')](_0x6b2f('0x14')),_0x6b2f('0x14'));_0x1a7b3c['write'](_0x52d3a3);_0x1a7b3c[_0x6b2f('0x16')]();_0x1a7b3c['on']('close',function(){return _0xe4b2f5(_0x42c152);});}catch(_0x413a0c){fs[_0x6b2f('0x17')](_0x42c152);return _0x5a44ad(_0x413a0c);}});});};exports['encryptString']=function(_0xe2f924,_0x5c6318,_0x1aa48e){var _0x1f7d63=_0x1aa48e||stringOptions['algorithm'];var _0x3ad5a3=_0x5c6318||stringOptions[_0x6b2f('0x1c')];var _0x18097f=crypto[_0x6b2f('0x12')](_0x1f7d63,_0x3ad5a3);var _0x2c1733=_0x18097f['update'](_0xe2f924,'utf8',_0x6b2f('0x1d'));_0x2c1733+=_0x18097f['final'](_0x6b2f('0x1d'));return _0x2c1733;};exports['decryptString']=function(_0x370a05,_0x2e7930,_0x2e5696){var _0x55fb85=_0x2e5696||stringOptions[_0x6b2f('0x9')];var _0x2fdef5=_0x2e7930||stringOptions[_0x6b2f('0x1c')];var _0xa07947=crypto[_0x6b2f('0x19')](_0x55fb85,_0x2fdef5);var _0x55f9a4=_0xa07947[_0x6b2f('0x13')](_0x370a05,_0x6b2f('0x1d'),_0x6b2f('0x1e'));_0x55f9a4+=_0xa07947[_0x6b2f('0x1b')](_0x6b2f('0x1e'));return _0x55f9a4;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 25e37fa..426050f 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 _0x55e0=['util','path','lodash','to-csv','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','find','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','length','split','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','.csv','existsSync','mkdirSync','join','each','%s%d.%s','csv','%s.%s','writeFileSync','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','inspect'];(function(_0x5e1e25,_0xdc1421){var _0x548e5f=function(_0x576360){while(--_0x576360){_0x5e1e25['push'](_0x5e1e25['shift']());}};_0x548e5f(++_0xdc1421);}(_0x55e0,0xdc));var _0x055e=function(_0x5573e5,_0x294cdc){_0x5573e5=_0x5573e5-0x0;var _0xa91b77=_0x55e0[_0x5573e5];return _0xa91b77;};'use strict';var util=require(_0x055e('0x0'));var path=require(_0x055e('0x1'));var _=require(_0x055e('0x2'));var csv=require(_0x055e('0x3'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require('zip-dir');var rimraf=require(_0x055e('0x4'));var db=require(_0x055e('0x5'))['db'];var dbH=require(_0x055e('0x5'))[_0x055e('0x6')];var logger=require(_0x055e('0x7'))(_0x055e('0x8'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x055e('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x4a442e,_0x8e7824){var _0x3c4cf={'status':_0x4a442e};var _0x376618={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x8e7824){_0x3c4cf[_0x055e('0xa')]=_0x8e7824;}return db[_0x055e('0xb')]['update'](_0x3c4cf,_0x376618);}function main(){var _0x40779c=0x1388;var _0xd67814;logger[_0x055e('0xc')](util[_0x055e('0xd')](_0x055e('0xe'),EXTRACTED_REPORT_ID,'CSV'));return db['Setting'][_0x055e('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x055e('0x10')]})[_0x055e('0x11')](function(_0x72d424){if(_0x72d424){_0xd67814=_0x72d424;_0x40779c=_0xd67814[_0x055e('0x10')]||0x1388;}})[_0x055e('0x11')](function(){return dbH[_0x055e('0x12')][_0x055e('0x13')](util['format'](_0x055e('0x14'),QUERY),{'type':dbH[_0x055e('0x12')][_0x055e('0x15')][_0x055e('0x16')]});})[_0x055e('0x11')](function(_0x56af18){if(!_0x56af18[0x0][_0x055e('0x17')]){return analyticExtractedReport(_0x055e('0x18'));}var _0x111cdb=[];var _0x599533=0x0;var _0x3f2d0e=!![];if(_0x56af18&&_0x56af18[_0x055e('0x19')]){var _0xb4e6ca=_0x56af18[0x0][_0x055e('0x17')]%(_0x599533+_0x40779c);if(_0xd67814[_0x055e('0x1a')]){for(;_0x3f2d0e;_0x599533+=_0x40779c,_0xb4e6ca=_0x56af18[0x0]['num']%(_0x599533+_0x40779c)){if(_0xb4e6ca==0x0||_0xb4e6ca==_0x56af18[0x0][_0x055e('0x17')]){_0x3f2d0e=![];}_0x111cdb[_0x055e('0x1b')](dbH[_0x055e('0x12')][_0x055e('0x13')](util['format'](_0x055e('0x1c'),QUERY,_0x40779c,_0x599533),{'type':dbH[_0x055e('0x12')]['QueryTypes'][_0x055e('0x16')]}));}}else{_0x111cdb[_0x055e('0x1b')](dbH[_0x055e('0x12')][_0x055e('0x13')](QUERY,{'type':dbH[_0x055e('0x12')][_0x055e('0x15')]['SELECT']}));}}var _0x31c355=path[_0x055e('0x1d')](PATH);var _0x211594=path['basename'](PATH,_0x055e('0x1e'));var _0x2da6b=_0xd67814[_0x055e('0x1a')]&&_0x111cdb[_0x055e('0x19')]>0x1;var _0x51df23=[];if(!fs[_0x055e('0x1f')](path['join'](_0x31c355,_0x211594))&&_0x2da6b){fs[_0x055e('0x20')](path[_0x055e('0x21')](_0x31c355,_0x211594));}return BPromise[_0x055e('0x22')](_0x111cdb,function(_0x1a76c6){_0x51df23[_0x055e('0x1b')](_0x1a76c6);})[_0x055e('0x11')](function(){for(var _0x58caf9=0x0;_0x58caf9<_0x51df23[_0x055e('0x19')];_0x58caf9+=0x1){var _0x1f90a9;var _0x2a82f8=_0x51df23[_0x58caf9];if(_0x2da6b){_0x1f90a9=path['join'](_0x31c355,_0x211594,util[_0x055e('0xd')](_0x055e('0x23'),_0x211594,_0x58caf9,_0x055e('0x24')));}else{_0x1f90a9=path[_0x055e('0x21')](_0x31c355,util['format'](_0x055e('0x25'),_0x211594,'csv'));}fs[_0x055e('0x26')](_0x1f90a9,csv(_0x2a82f8));}})[_0x055e('0x11')](function(){if(_0x2da6b){zipdir(path[_0x055e('0x21')](_0x31c355,_0x211594),{'saveTo':path[_0x055e('0x21')](_0x31c355,util[_0x055e('0xd')]('%s.%s',_0x211594,_0x055e('0x27')))},function(_0x453e5e,_0x293062){});rimraf(path[_0x055e('0x21')](_0x31c355,_0x211594),function(){});}})[_0x055e('0x11')](function(){logger[_0x055e('0xc')](util[_0x055e('0xd')](_0x055e('0x28'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0x055e('0x29'),_0x2da6b?util[_0x055e('0xd')]('%s.%s',_0x211594,_0x2da6b?_0x055e('0x27'):_0x055e('0x24')):null);});})[_0x055e('0x2a')](function(_0x20717b){logger[_0x055e('0xc')](util[_0x055e('0xd')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'CSV'),util[_0x055e('0x2b')](_0x20717b,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})['finally'](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0x6599=['path','lodash','to-csv','bluebird','zip-dir','../../mysqldb','dbH','analytics','argv','savename','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','length','push','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','existsSync','join','mkdirSync','each','%s%d.%s','%s.%s','writeFileSync','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','exit'];(function(_0x335450,_0x56e309){var _0x3ae2fc=function(_0x4adde1){while(--_0x4adde1){_0x335450['push'](_0x335450['shift']());}};_0x3ae2fc(++_0x56e309);}(_0x6599,0xb0));var _0x9659=function(_0x42ebba,_0x4cbf87){_0x42ebba=_0x42ebba-0x0;var _0x3fd2af=_0x6599[_0x42ebba];return _0x3fd2af;};'use strict';var util=require('util');var path=require(_0x9659('0x0'));var _=require(_0x9659('0x1'));var csv=require(_0x9659('0x2'));var fs=require('fs');var BPromise=require(_0x9659('0x3'));var zipdir=require(_0x9659('0x4'));var rimraf=require('rimraf');var db=require(_0x9659('0x5'))['db'];var dbH=require('../../mysqldb')[_0x9659('0x6')];var logger=require('../../config/logger')(_0x9659('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x9659('0x8')][0x2]);var QUERY=process[_0x9659('0x8')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x4e4402,_0xabdd12){var _0x14cb81={'status':_0x4e4402};var _0x4d0a52={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xabdd12){_0x14cb81[_0x9659('0x9')]=_0xabdd12;}return db['AnalyticExtractedReport'][_0x9659('0xa')](_0x14cb81,_0x4d0a52);}function main(){var _0x194d48=0x1388;var _0x58552a;logger[_0x9659('0xb')](util[_0x9659('0xc')](_0x9659('0xd'),EXTRACTED_REPORT_ID,'CSV'));return db[_0x9659('0xe')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x9659('0xf'),_0x9659('0x10')]})[_0x9659('0x11')](function(_0x567463){if(_0x567463){_0x58552a=_0x567463;_0x194d48=_0x58552a[_0x9659('0x10')]||0x1388;}})[_0x9659('0x11')](function(){return dbH[_0x9659('0x12')][_0x9659('0x13')](util[_0x9659('0xc')](_0x9659('0x14'),QUERY),{'type':dbH[_0x9659('0x12')][_0x9659('0x15')][_0x9659('0x16')]});})[_0x9659('0x11')](function(_0x323c10){if(!_0x323c10[0x0][_0x9659('0x17')]){return analyticExtractedReport(_0x9659('0x18'));}var _0x23098d=[];var _0x575f53=0x0;var _0x281df8=!![];if(_0x323c10&&_0x323c10[_0x9659('0x19')]){var _0x85933d=_0x323c10[0x0][_0x9659('0x17')]%(_0x575f53+_0x194d48);if(_0x58552a[_0x9659('0xf')]){for(;_0x281df8;_0x575f53+=_0x194d48,_0x85933d=_0x323c10[0x0][_0x9659('0x17')]%(_0x575f53+_0x194d48)){if(_0x85933d==0x0||_0x85933d==_0x323c10[0x0][_0x9659('0x17')]){_0x281df8=![];}_0x23098d[_0x9659('0x1a')](dbH[_0x9659('0x12')]['query'](util[_0x9659('0xc')](_0x9659('0x1b'),QUERY,_0x194d48,_0x575f53),{'type':dbH[_0x9659('0x12')]['QueryTypes'][_0x9659('0x16')]}));}}else{_0x23098d['push'](dbH[_0x9659('0x12')][_0x9659('0x13')](QUERY,{'type':dbH[_0x9659('0x12')][_0x9659('0x15')][_0x9659('0x16')]}));}}var _0x231f78=path['dirname'](PATH);var _0x31a3c9=path[_0x9659('0x1c')](PATH,'.csv');var _0x3eb261=_0x58552a[_0x9659('0xf')]&&_0x23098d[_0x9659('0x19')]>0x1;var _0x54a727=[];if(!fs[_0x9659('0x1d')](path[_0x9659('0x1e')](_0x231f78,_0x31a3c9))&&_0x3eb261){fs[_0x9659('0x1f')](path[_0x9659('0x1e')](_0x231f78,_0x31a3c9));}return BPromise[_0x9659('0x20')](_0x23098d,function(_0x581c68){_0x54a727[_0x9659('0x1a')](_0x581c68);})[_0x9659('0x11')](function(){for(var _0x1e2fba=0x0;_0x1e2fba<_0x54a727[_0x9659('0x19')];_0x1e2fba+=0x1){var _0x5d8d0f;var _0x2c48bf=_0x54a727[_0x1e2fba];if(_0x3eb261){_0x5d8d0f=path[_0x9659('0x1e')](_0x231f78,_0x31a3c9,util[_0x9659('0xc')](_0x9659('0x21'),_0x31a3c9,_0x1e2fba,'csv'));}else{_0x5d8d0f=path[_0x9659('0x1e')](_0x231f78,util['format'](_0x9659('0x22'),_0x31a3c9,'csv'));}fs[_0x9659('0x23')](_0x5d8d0f,csv(_0x2c48bf));}})['then'](function(){if(_0x3eb261){zipdir(path['join'](_0x231f78,_0x31a3c9),{'saveTo':path[_0x9659('0x1e')](_0x231f78,util[_0x9659('0xc')]('%s.%s',_0x31a3c9,_0x9659('0x24')))},function(_0x4d1b05,_0x87a153){});rimraf(path[_0x9659('0x1e')](_0x231f78,_0x31a3c9),function(){});}})[_0x9659('0x11')](function(){logger[_0x9659('0xb')](util[_0x9659('0xc')](_0x9659('0x25'),EXTRACTED_REPORT_ID,_0x9659('0x26')));return analyticExtractedReport('Completed',_0x3eb261?util[_0x9659('0xc')](_0x9659('0x22'),_0x31a3c9,_0x3eb261?_0x9659('0x24'):'csv'):null);});})[_0x9659('0x27')](function(_0x1eac07){logger['info'](util[_0x9659('0xc')](_0x9659('0x28'),EXTRACTED_REPORT_ID,'CSV'),util[_0x9659('0x29')](_0x1eac07,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x9659('0x2a'));})['finally'](function(){process[_0x9659('0x2b')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 82dae7b..5debf03 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 _0x0a31=['num','Empty','dirname','basename','.pdf','join','%s.%s','pdf','Setting','find','split','splitSizePdf','then','sequelize','query','QueryTypes','SELECT','existsSync','mkdirSync','all','flatten','%s%d.%s','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','zip','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','info','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','center','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','finish','end','createPdfFromHTML','createPdfKitDocument','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','jsdom','JSDOM','window','../../mysqldb','dbH','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','tableHeader','map','pick','toString','value','fill','body','concat','chunk','keys','push','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','length','header','margin','landscape','\x20/\x20','footer','Arial','black','right'];(function(_0xd76a79,_0x3579b2){var _0x16fd04=function(_0x26ef0b){while(--_0x26ef0b){_0xd76a79['push'](_0xd76a79['shift']());}};_0x16fd04(++_0x3579b2);}(_0x0a31,0x85));var _0x10a3=function(_0x2f29d2,_0x563d71){_0x2f29d2=_0x2f29d2-0x0;var _0xcbe4d4=_0x0a31[_0x2f29d2];return _0xcbe4d4;};'use strict';var _=require('lodash');var fs=require('fs');var util=require('util');var path=require(_0x10a3('0x0'));var moment=require(_0x10a3('0x1'));var htmlToPdfmake=require(_0x10a3('0x2'));var PdfPrinter=require(_0x10a3('0x3'));var zipdir=require(_0x10a3('0x4'));var rimraf=require('rimraf');var JSDOM=require(_0x10a3('0x5'))[_0x10a3('0x6')];var window=new JSDOM('')[_0x10a3('0x7')];var db=require(_0x10a3('0x8'))['db'];var dbH=require(_0x10a3('0x8'))[_0x10a3('0x9')];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x10a3('0xa')][0x2]);var QUERY=process[_0x10a3('0xa')][0x3];var PATH=process[_0x10a3('0xa')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0x10a3('0xb');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x514e00,_0x294ae3){var _0x3e1f1d={'status':_0x514e00};var _0xe10d50={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x294ae3){_0x3e1f1d[_0x10a3('0xc')]=_0x294ae3;}return db[_0x10a3('0xd')][_0x10a3('0xe')](_0x3e1f1d,_0xe10d50);}function getHeaders(_0x55d2a7){return _['map'](_0x55d2a7,function(_0x39dc6c){return{'text':_0x39dc6c,'style':_0x10a3('0xf')};});}function getRows(_0x479c96,_0xd5c253){return _[_0x10a3('0x10')](_0xd5c253,function(_0x2b4107){return _(_0x2b4107)[_0x10a3('0x11')](_0x479c96)['map'](function(_0x5a6610){return _0x5a6610?_[_0x10a3('0x12')](_0x5a6610):'';})[_0x10a3('0x13')]();});}function createTable(_0x5a8680,_0x4bf60d){var _0x2378e9={'widths':_[_0x10a3('0x14')](Array(_0x5a8680['length']),0x91),'heights':function(_0x316203){return _0x316203===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x1248f1=getHeaders(_0x5a8680);_0x2378e9[_0x10a3('0x15')]['push'](_0x1248f1);var _0x546efb=getRows(_0x5a8680,_0x4bf60d);_0x2378e9[_0x10a3('0x15')]=_0x2378e9[_0x10a3('0x15')][_0x10a3('0x16')](_0x546efb);return _0x2378e9;}function createTables(_0x5ddd3a){var _0x50fd50=[];var _0x29d0ea=_[_0x10a3('0x17')](Object[_0x10a3('0x18')](_0x5ddd3a[0x0]),0x5);_0x29d0ea['forEach'](function(_0x1d08cc){_0x50fd50[_0x10a3('0x19')](createTable(_0x1d08cc,_0x5ddd3a));});return _0x50fd50;}function getPDFDocDefinition(_0xd8d0a5){var _0xbbd6fa=util[_0x10a3('0x1a')](_0x10a3('0x1b'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT['startDate'])[_0x10a3('0x1a')](FORMAT),moment(EXTRACTED_REPORT['endDate'])[_0x10a3('0x1a')](FORMAT));var _0x158d2b=[];for(var _0x4b785d=0x0;_0x4b785d<_0xd8d0a5[_0x10a3('0x1c')];_0x4b785d++){var _0x27763d=[];if(_0x4b785d===0x0){_0x27763d[_0x10a3('0x19')]({'text':_0xbbd6fa,'style':_0x10a3('0x1d')});}var _0x5e75b5={'table':_0xd8d0a5[_0x4b785d]};if(_0x4b785d>0x0){_0x5e75b5['pageBreak']='before';_0x5e75b5[_0x10a3('0x1e')]=[0x0,0x46,0x0,0x0];}_0x27763d[_0x10a3('0x19')](_0x5e75b5);_0x158d2b['push'](_0x27763d);}return{'pageSize':'A4','pageOrientation':_0x10a3('0x1f'),'content':_0x158d2b,'footer':function(_0xb298c2,_0x33fe5d){return{'text':_0xb298c2[_0x10a3('0x12')]()+_0x10a3('0x20')+_0x33fe5d,'style':_0x10a3('0x21')};},'defaultStyle':{'font':_0x10a3('0x22')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x10a3('0x23')},'footer':{'alignment':_0x10a3('0x24'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x39c151){var _0x643243=0x1388;var _0x5747f9;if(!_0x39c151[0x0][_0x10a3('0x25')]){return analyticExtractedReport(_0x10a3('0x26'));}var _0x1b5a68=[];var _0x36a73e=0x0;var _0x4949e5=!![];var _0x12ef5d=path[_0x10a3('0x27')](PATH);var _0x3d611c=path[_0x10a3('0x28')](PATH,_0x10a3('0x29'));var _0x3b8049=path[_0x10a3('0x2a')](_0x12ef5d,util[_0x10a3('0x1a')](_0x10a3('0x2b'),_0x3d611c,_0x10a3('0x2c')));var _0x1d8399=![];return db[_0x10a3('0x2d')][_0x10a3('0x2e')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x10a3('0x2f'),_0x10a3('0x30')]})[_0x10a3('0x31')](function(_0x237ac3){if(_0x237ac3){_0x5747f9=_0x237ac3;_0x643243=_0x5747f9[_0x10a3('0x30')]||0x3e8;}})[_0x10a3('0x31')](function(){if(_0x39c151&&_0x39c151[_0x10a3('0x1c')]){var _0x33e405=_0x39c151[0x0][_0x10a3('0x25')]%(_0x36a73e+_0x643243);if(_0x5747f9[_0x10a3('0x2f')]){for(;_0x4949e5;_0x36a73e+=_0x643243,_0x33e405=_0x39c151[0x0][_0x10a3('0x25')]%(_0x36a73e+_0x643243)){if(_0x33e405==0x0||_0x33e405==_0x39c151[0x0]['num']){_0x4949e5=![];}_0x1b5a68[_0x10a3('0x19')](dbH[_0x10a3('0x32')][_0x10a3('0x33')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x643243,_0x36a73e),{'type':dbH[_0x10a3('0x32')][_0x10a3('0x34')][_0x10a3('0x35')]}));}}else{_0x1b5a68['push'](dbH[_0x10a3('0x32')]['query'](QUERY,{'type':dbH[_0x10a3('0x32')][_0x10a3('0x34')][_0x10a3('0x35')]}));}}_0x1d8399=_0x5747f9[_0x10a3('0x2f')]&&_0x1b5a68[_0x10a3('0x1c')]>0x1;if(!fs[_0x10a3('0x36')](path[_0x10a3('0x2a')](_0x12ef5d,_0x3d611c))&&_0x1d8399){fs[_0x10a3('0x37')](path[_0x10a3('0x2a')](_0x12ef5d,_0x3d611c));}return Promise[_0x10a3('0x38')](_0x1b5a68);})[_0x10a3('0x31')](function(_0x43d40b){return createTables(_[_0x10a3('0x39')](_0x43d40b));})[_0x10a3('0x31')](function(_0x5de5e6){var _0x1714a6=getPDFDocDefinition(_0x5de5e6);var _0x572d1c=getPDFPrinter();var _0x483810=_0x572d1c['createPdfKitDocument'](_0x1714a6);if(_0x1d8399)_0x3b8049=path[_0x10a3('0x2a')](_0x12ef5d,_0x3d611c,util['format'](_0x10a3('0x3a'),_0x3d611c,index,_0x10a3('0x2c')));return writePDFDocument(_0x483810,_0x3b8049);})[_0x10a3('0x31')](function(){if(!_0x1d8399)return;zipdir(path[_0x10a3('0x2a')](_0x12ef5d,_0x3d611c),{'saveTo':path[_0x10a3('0x2a')](_0x12ef5d,util['format']('%s.%s',_0x3d611c,'zip'))},function(_0x115700){if(_0x115700)throw _0x115700;return;});})[_0x10a3('0x31')](function(){if(!_0x1d8399)return;rimraf(path[_0x10a3('0x2a')](_0x12ef5d,_0x3d611c),function(){});})['then'](function(){logger['info'](util[_0x10a3('0x1a')](_0x10a3('0x3b'),EXTRACTED_REPORT_ID,_0x10a3('0x3c')));return analyticExtractedReport(_0x10a3('0x3d'),_0x1d8399?util[_0x10a3('0x1a')](_0x10a3('0x2b'),_0x3d611c,_0x1d8399?_0x10a3('0x3e'):'pdf'):null);});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util['format'](_0x10a3('0x3f'),EXTRACTED_REPORT_ID,_0x10a3('0x40')));return db[_0x10a3('0xd')][_0x10a3('0x41')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x10a3('0x31')](function(_0x2b62a5){EXTRACTED_REPORT=_0x2b62a5;return dbH[_0x10a3('0x32')][_0x10a3('0x33')](util['format'](_0x10a3('0x42'),QUERY),{'type':dbH['sequelize'][_0x10a3('0x34')][_0x10a3('0x35')]});})[_0x10a3('0x31')](extractReport)[_0x10a3('0x43')](function(_0x33e35b){logger[_0x10a3('0x44')](util['format'](_0x10a3('0x45'),EXTRACTED_REPORT_ID,_0x10a3('0x40')),util[_0x10a3('0x46')](_0x33e35b,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x10a3('0x47')](function(){process[_0x10a3('0x48')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x5d83e8=new PdfPrinter({'Arial':{'normal':__dirname+_0x10a3('0x49'),'bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+_0x10a3('0x4a'),'bolditalics':__dirname+_0x10a3('0x4b')}});return _0x5d83e8;}function getPDFDocDefinitionFromHTML(_0x17b58b,_0xecb422){var _0x260f34=util[_0x10a3('0x1a')](_0x10a3('0x4c'),_0xecb422[_0x10a3('0x4d')],_0xecb422[_0x10a3('0x4e')]);var _0x25c305=moment()[_0x10a3('0x1a')]('YYYY-MM-DD')[_0x10a3('0x12')]();var _0x46080e=htmlToPdfmake(_0x17b58b,{'window':window,'tableAutoSize':!![]});return{'content':[_0x46080e],'defaultStyle':{'font':_0x10a3('0x22')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x10a3('0x4f'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':'Interaction\x20Transcript','style':'header'}];},'footer':function(_0x1ab4f5,_0x329c14){return[{'text':util[_0x10a3('0x1a')](_0x10a3('0x50'),_0x260f34,_0x1ab4f5,_0x329c14,_0x25c305),'style':_0x10a3('0x21')}];}};}function writePDFDocument(_0xa21873,_0x326793){return new Promise(function(_0x5e4eed,_0x4b3b76){var _0x199ca5=_0xa21873['pipe'](fs['createWriteStream'](_0x326793));_0x199ca5['on'](_0x10a3('0x51'),function(){_0x5e4eed(_0x10a3('0x51'));});_0x199ca5['on']('error',function(_0x412ff8){_0x4b3b76(_0x412ff8);});_0xa21873[_0x10a3('0x52')]();});}exports[_0x10a3('0x53')]=function(_0x81c21a,_0x2bf109){var _0x398bba=getPDFPrinter();var _0x19cae3=getPDFDocDefinitionFromHTML(_0x81c21a,_0x2bf109);var _0x215f40=_0x398bba[_0x10a3('0x54')](_0x19cae3);return writePDFDocument(_0x215f40,_0x2bf109[_0x10a3('0x0')])[_0x10a3('0x43')](function(_0x329a5b){throw _0x329a5b;});}; \ No newline at end of file +var _0x2558=['query','SELECT','flatten','createPdfKitDocument','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','zip','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','AnalyticExtractedReport','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold-italic.ttf','interactionId','YYYY-MM-DD','center','header','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','finish','error','end','createPdfFromHTML','util','path','moment','pdfmake/src/printer','jsdom','JSDOM','window','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','update','map','tableHeader','pick','toString','value','fill','auto','body','push','concat','chunk','keys','format','name','startDate','pageBreak','before','margin','landscape','\x20/\x20','footer','Arial','right','Empty','dirname','.pdf','join','%s.%s','pdf','split','splitSizePdf','then','length','num','sequelize','QueryTypes'];(function(_0x5b5f17,_0x14e37d){var _0x4f6e40=function(_0x345be9){while(--_0x345be9){_0x5b5f17['push'](_0x5b5f17['shift']());}};_0x4f6e40(++_0x14e37d);}(_0x2558,0x1a8));var _0x8255=function(_0x2539e6,_0x595d36){_0x2539e6=_0x2539e6-0x0;var _0xe83570=_0x2558[_0x2539e6];return _0xe83570;};'use strict';var _=require('lodash');var fs=require('fs');var util=require(_0x8255('0x0'));var path=require(_0x8255('0x1'));var moment=require(_0x8255('0x2'));var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require(_0x8255('0x3'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var JSDOM=require(_0x8255('0x4'))[_0x8255('0x5')];var window=new JSDOM('')[_0x8255('0x6')];var db=require(_0x8255('0x7'))['db'];var dbH=require(_0x8255('0x7'))[_0x8255('0x8')];var logger=require(_0x8255('0x9'))(_0x8255('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0x8255('0xb')][0x2]);var QUERY=process[_0x8255('0xb')][0x3];var PATH=process[_0x8255('0xb')][0x4];var NAME=process[_0x8255('0xb')][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x268786,_0xf92ab3){var _0x2cf1f8={'status':_0x268786};var _0x16391d={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xf92ab3){_0x2cf1f8[_0x8255('0xc')]=_0xf92ab3;}return db['AnalyticExtractedReport'][_0x8255('0xd')](_0x2cf1f8,_0x16391d);}function getHeaders(_0x4d1136){return _[_0x8255('0xe')](_0x4d1136,function(_0x45106d){return{'text':_0x45106d,'style':_0x8255('0xf')};});}function getRows(_0x3084a5,_0x1d5732){return _['map'](_0x1d5732,function(_0x4e64ab){return _(_0x4e64ab)[_0x8255('0x10')](_0x3084a5)[_0x8255('0xe')](function(_0x4ff330){return _0x4ff330?_[_0x8255('0x11')](_0x4ff330):'';})[_0x8255('0x12')]();});}function createTable(_0x567160,_0x4af151){var _0x5a7437={'widths':_[_0x8255('0x13')](Array(_0x567160['length']),0x91),'heights':function(_0x31328e){return _0x31328e===0x0?_0x8255('0x14'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x4ff48a=getHeaders(_0x567160);_0x5a7437[_0x8255('0x15')][_0x8255('0x16')](_0x4ff48a);var _0x112adf=getRows(_0x567160,_0x4af151);_0x5a7437[_0x8255('0x15')]=_0x5a7437[_0x8255('0x15')][_0x8255('0x17')](_0x112adf);return _0x5a7437;}function createTables(_0x4bba11){var _0x19b9be=[];var _0x544df0=_[_0x8255('0x18')](Object[_0x8255('0x19')](_0x4bba11[0x0]),0x5);_0x544df0['forEach'](function(_0x1c4f38){_0x19b9be[_0x8255('0x16')](createTable(_0x1c4f38,_0x4bba11));});return _0x19b9be;}function getPDFDocDefinition(_0x190276){var _0x572379=util[_0x8255('0x1a')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT[_0x8255('0x1b')],moment(EXTRACTED_REPORT[_0x8255('0x1c')])[_0x8255('0x1a')](FORMAT),moment(EXTRACTED_REPORT['endDate'])[_0x8255('0x1a')](FORMAT));var _0x3cc461=[];for(var _0x1cf431=0x0;_0x1cf431<_0x190276['length'];_0x1cf431++){var _0x3ba6e6=[];if(_0x1cf431===0x0){_0x3ba6e6[_0x8255('0x16')]({'text':_0x572379,'style':'header'});}var _0x3cc29c={'table':_0x190276[_0x1cf431]};if(_0x1cf431>0x0){_0x3cc29c[_0x8255('0x1d')]=_0x8255('0x1e');_0x3cc29c[_0x8255('0x1f')]=[0x0,0x46,0x0,0x0];}_0x3ba6e6['push'](_0x3cc29c);_0x3cc461[_0x8255('0x16')](_0x3ba6e6);}return{'pageSize':'A4','pageOrientation':_0x8255('0x20'),'content':_0x3cc461,'footer':function(_0x235a71,_0x40ecc6){return{'text':_0x235a71[_0x8255('0x11')]()+_0x8255('0x21')+_0x40ecc6,'style':_0x8255('0x22')};},'defaultStyle':{'font':_0x8255('0x23')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':_0x8255('0x24'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0xe55d5b){var _0x1b1b23=0x1388;var _0x25389e;if(!_0xe55d5b[0x0]['num']){return analyticExtractedReport(_0x8255('0x25'));}var _0x2494c8=[];var _0x3c17d6=0x0;var _0x36cb0d=!![];var _0x46020b=path[_0x8255('0x26')](PATH);var _0x3e7ab5=path['basename'](PATH,_0x8255('0x27'));var _0x1910a2=path[_0x8255('0x28')](_0x46020b,util['format'](_0x8255('0x29'),_0x3e7ab5,_0x8255('0x2a')));var _0x1666d5=![];return db['Setting']['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x8255('0x2b'),_0x8255('0x2c')]})[_0x8255('0x2d')](function(_0x1fdb2b){if(_0x1fdb2b){_0x25389e=_0x1fdb2b;_0x1b1b23=_0x25389e[_0x8255('0x2c')]||0x3e8;}})[_0x8255('0x2d')](function(){if(_0xe55d5b&&_0xe55d5b[_0x8255('0x2e')]){var _0x269034=_0xe55d5b[0x0][_0x8255('0x2f')]%(_0x3c17d6+_0x1b1b23);if(_0x25389e[_0x8255('0x2b')]){for(;_0x36cb0d;_0x3c17d6+=_0x1b1b23,_0x269034=_0xe55d5b[0x0][_0x8255('0x2f')]%(_0x3c17d6+_0x1b1b23)){if(_0x269034==0x0||_0x269034==_0xe55d5b[0x0][_0x8255('0x2f')]){_0x36cb0d=![];}_0x2494c8['push'](dbH['sequelize']['query'](util[_0x8255('0x1a')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x1b1b23,_0x3c17d6),{'type':dbH[_0x8255('0x30')][_0x8255('0x31')]['SELECT']}));}}else{_0x2494c8['push'](dbH[_0x8255('0x30')][_0x8255('0x32')](QUERY,{'type':dbH[_0x8255('0x30')][_0x8255('0x31')][_0x8255('0x33')]}));}}_0x1666d5=_0x25389e['split']&&_0x2494c8['length']>0x1;if(!fs['existsSync'](path[_0x8255('0x28')](_0x46020b,_0x3e7ab5))&&_0x1666d5){fs['mkdirSync'](path[_0x8255('0x28')](_0x46020b,_0x3e7ab5));}return Promise['all'](_0x2494c8);})['then'](function(_0x11b773){return createTables(_[_0x8255('0x34')](_0x11b773));})['then'](function(_0x487880){var _0x2a90a3=getPDFDocDefinition(_0x487880);var _0xc3a467=getPDFPrinter();var _0x20631c=_0xc3a467[_0x8255('0x35')](_0x2a90a3);if(_0x1666d5)_0x1910a2=path[_0x8255('0x28')](_0x46020b,_0x3e7ab5,util[_0x8255('0x1a')]('%s%d.%s',_0x3e7ab5,index,_0x8255('0x2a')));return writePDFDocument(_0x20631c,_0x1910a2);})[_0x8255('0x2d')](function(){if(!_0x1666d5)return;zipdir(path['join'](_0x46020b,_0x3e7ab5),{'saveTo':path[_0x8255('0x28')](_0x46020b,util['format'](_0x8255('0x29'),_0x3e7ab5,'zip'))},function(_0x4296ac){if(_0x4296ac)throw _0x4296ac;return;});})['then'](function(){if(!_0x1666d5)return;rimraf(path[_0x8255('0x28')](_0x46020b,_0x3e7ab5),function(){});})[_0x8255('0x2d')](function(){logger['info'](util[_0x8255('0x1a')](_0x8255('0x36'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0x8255('0x37'),_0x1666d5?util[_0x8255('0x1a')]('%s.%s',_0x3e7ab5,_0x1666d5?_0x8255('0x38'):_0x8255('0x2a')):null);});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x8255('0x39')](util[_0x8255('0x1a')](_0x8255('0x3a'),EXTRACTED_REPORT_ID,_0x8255('0x3b')));return db[_0x8255('0x3c')][_0x8255('0x3d')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x8255('0x2d')](function(_0x412e39){EXTRACTED_REPORT=_0x412e39;return dbH['sequelize'][_0x8255('0x32')](util[_0x8255('0x1a')](_0x8255('0x3e'),QUERY),{'type':dbH['sequelize'][_0x8255('0x31')][_0x8255('0x33')]});})[_0x8255('0x2d')](extractReport)[_0x8255('0x3f')](function(_0x1ca0fd){logger[_0x8255('0x39')](util['format'](_0x8255('0x40'),EXTRACTED_REPORT_ID,_0x8255('0x3b')),util['inspect'](_0x1ca0fd,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x8255('0x41'));})[_0x8255('0x42')](function(){process[_0x8255('0x43')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x45d7b8=new PdfPrinter({'Arial':{'normal':__dirname+_0x8255('0x44'),'bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+_0x8255('0x45')}});return _0x45d7b8;}function getPDFDocDefinitionFromHTML(_0x260e83,_0x45084f){var _0x593a3a=util[_0x8255('0x1a')]('%s\x20#%d',_0x45084f['channel'],_0x45084f[_0x8255('0x46')]);var _0xb9ff8b=moment()[_0x8255('0x1a')](_0x8255('0x47'))[_0x8255('0x11')]();var _0x4b4ab1=htmlToPdfmake(_0x260e83,{'window':window,'tableAutoSize':!![]});return{'content':[_0x4b4ab1],'defaultStyle':{'font':_0x8255('0x23')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x8255('0x48'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x8255('0x48'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x8255('0x48')}},'header':function(){return[{'text':'Interaction\x20Transcript','style':_0x8255('0x49')}];},'footer':function(_0x2cd150,_0x1c51b6){return[{'text':util['format'](_0x8255('0x4a'),_0x593a3a,_0x2cd150,_0x1c51b6,_0xb9ff8b),'style':_0x8255('0x22')}];}};}function writePDFDocument(_0x3a04d6,_0x2ea1f4){return new Promise(function(_0x4dcfc3,_0x26d432){var _0x3ebf52=_0x3a04d6['pipe'](fs['createWriteStream'](_0x2ea1f4));_0x3ebf52['on'](_0x8255('0x4b'),function(){_0x4dcfc3(_0x8255('0x4b'));});_0x3ebf52['on'](_0x8255('0x4c'),function(_0x801c78){_0x26d432(_0x801c78);});_0x3a04d6[_0x8255('0x4d')]();});}exports[_0x8255('0x4e')]=function(_0x29c9d8,_0x29658f){var _0x517e08=getPDFPrinter();var _0x519bb0=getPDFDocDefinitionFromHTML(_0x29c9d8,_0x29658f);var _0x27f238=_0x517e08[_0x8255('0x35')](_0x519bb0);return writePDFDocument(_0x27f238,_0x29658f[_0x8255('0x1')])[_0x8255('0x3f')](function(_0x20ee4f){throw _0x20ee4f;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 92a528b..f7ef77d 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 _0x226f=['%s%d.%s','xlsx','binary','%s.%s','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','XLSX','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','path','json2xls','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','update','info','format','Setting','find','split','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','Empty','num','push','QueryTypes','dirname','existsSync','join','mkdirSync','each','length'];(function(_0x31e0ae,_0x4ae9b1){var _0x38dba1=function(_0x3422a5){while(--_0x3422a5){_0x31e0ae['push'](_0x31e0ae['shift']());}};_0x38dba1(++_0x4ae9b1);}(_0x226f,0x6a));var _0xf226=function(_0x552787,_0x222c5c){_0x552787=_0x552787-0x0;var _0x25954f=_0x226f[_0x552787];return _0x25954f;};'use strict';var util=require(_0xf226('0x0'));var path=require(_0xf226('0x1'));var _=require('lodash');var fs=require('fs');var json2xls=require(_0xf226('0x2'));var BPromise=require('bluebird');var zipdir=require(_0xf226('0x3'));var rimraf=require(_0xf226('0x4'));var db=require('../../mysqldb')['db'];var dbH=require(_0xf226('0x5'))[_0xf226('0x6')];var logger=require(_0xf226('0x7'))(_0xf226('0x8'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xf226('0x9')][0x3];var PATH=process[_0xf226('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x36dc00,_0xc74ff2){var _0x36cb25={'status':_0x36dc00};var _0x175913={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xc74ff2){_0x36cb25['savename']=_0xc74ff2;}return db['AnalyticExtractedReport'][_0xf226('0xa')](_0x36cb25,_0x175913);}function main(){var _0x452a1c=0x1388;var _0x4951a9;logger[_0xf226('0xb')](util[_0xf226('0xc')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'XLSX'));return db[_0xf226('0xd')][_0xf226('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xf226('0xf'),'splitSizeXlsx']})['then'](function(_0x5604b7){if(_0x5604b7){_0x4951a9=_0x5604b7;_0x452a1c=_0x4951a9[_0xf226('0x10')]||0x1388;}})[_0xf226('0x11')](function(){return dbH[_0xf226('0x12')][_0xf226('0x13')](util[_0xf226('0xc')](_0xf226('0x14'),QUERY),{'type':dbH['sequelize']['QueryTypes'][_0xf226('0x15')]});})['then'](function(_0x42f19d){if(!_0x42f19d[0x0]['num']){return analyticExtractedReport(_0xf226('0x16'));}var _0x4eb106=[];var _0x5924fa=0x0;var _0x4db672=!![];if(_0x4951a9[_0xf226('0xf')]){if(_0x42f19d&&_0x42f19d['length']){var _0x213902=_0x42f19d[0x0][_0xf226('0x17')]%(_0x5924fa+_0x452a1c);for(;_0x4db672;_0x5924fa+=_0x452a1c,_0x213902=_0x42f19d[0x0][_0xf226('0x17')]%(_0x5924fa+_0x452a1c)){if(_0x213902==0x0||_0x213902==_0x42f19d[0x0]['num']){_0x4db672=![];}_0x4eb106[_0xf226('0x18')](dbH[_0xf226('0x12')]['query'](util[_0xf226('0xc')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x452a1c,_0x5924fa),{'type':dbH[_0xf226('0x12')][_0xf226('0x19')][_0xf226('0x15')]}));}}}else{_0x4eb106['push'](dbH[_0xf226('0x12')][_0xf226('0x13')](QUERY,{'type':dbH[_0xf226('0x12')][_0xf226('0x19')][_0xf226('0x15')]}));}var _0x22232f=path[_0xf226('0x1a')](PATH);var _0x3dbc66=path['basename'](PATH,'.xlsx');var _0x141f33=_0x4951a9[_0xf226('0xf')]&&_0x4eb106['length']>0x1;var _0x2bf162=[];if(!fs[_0xf226('0x1b')](path[_0xf226('0x1c')](_0x22232f,_0x3dbc66))&&_0x141f33){fs[_0xf226('0x1d')](path[_0xf226('0x1c')](_0x22232f,_0x3dbc66));}return BPromise[_0xf226('0x1e')](_0x4eb106,function(_0x24d259){_0x2bf162[_0xf226('0x18')](_0x24d259);})[_0xf226('0x11')](function(){for(var _0x56c00b=0x0;_0x56c00b<_0x2bf162[_0xf226('0x1f')];_0x56c00b+=0x1){var _0x3e8a76;var _0x1689f8=_0x2bf162[_0x56c00b];if(_0x141f33){_0x3e8a76=path['join'](_0x22232f,_0x3dbc66,util[_0xf226('0xc')](_0xf226('0x20'),_0x3dbc66,_0x56c00b,_0xf226('0x21')));}else{_0x3e8a76=path[_0xf226('0x1c')](_0x22232f,util[_0xf226('0xc')]('%s.%s',_0x3dbc66,_0xf226('0x21')));}fs['writeFileSync'](_0x3e8a76,json2xls(_0x1689f8),_0xf226('0x22'));}})['then'](function(){if(_0x141f33){zipdir(path[_0xf226('0x1c')](_0x22232f,_0x3dbc66),{'saveTo':path[_0xf226('0x1c')](_0x22232f,util[_0xf226('0xc')](_0xf226('0x23'),_0x3dbc66,_0xf226('0x24')))},function(_0x1fe78c,_0x3372df){});rimraf(path[_0xf226('0x1c')](_0x22232f,_0x3dbc66),function(){});}})['then'](function(){logger['info'](util['format'](_0xf226('0x25'),EXTRACTED_REPORT_ID,_0xf226('0x26')));return analyticExtractedReport(_0xf226('0x27'),_0x141f33?util[_0xf226('0xc')](_0xf226('0x23'),_0x3dbc66,_0x141f33?'zip':'xlsx'):null);});})[_0xf226('0x28')](function(_0x4bf213){logger[_0xf226('0xb')](util[_0xf226('0xc')](_0xf226('0x29'),EXTRACTED_REPORT_ID,_0xf226('0x26')),util[_0xf226('0x2a')](_0x4bf213,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xf226('0x2b'));})[_0xf226('0x2c')](function(){process[_0xf226('0x2d')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xd4fe=['json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','SELECT','Empty','length','num','push','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','existsSync','join','mkdirSync','each','%s%d.%s','xlsx','%s.%s','binary','zip','info','XLSX','Completed','catch','inspect','Failed','finally','exit','util','path'];(function(_0x3a093a,_0x1e2d1c){var _0x4ae223=function(_0x10aed4){while(--_0x10aed4){_0x3a093a['push'](_0x3a093a['shift']());}};_0x4ae223(++_0x1e2d1c);}(_0xd4fe,0xe9));var _0xed4f=function(_0x608aa8,_0x28c5b1){_0x608aa8=_0x608aa8-0x0;var _0x3d18cb=_0xd4fe[_0x608aa8];return _0x3d18cb;};'use strict';var util=require(_0xed4f('0x0'));var path=require(_0xed4f('0x1'));var _=require('lodash');var fs=require('fs');var json2xls=require(_0xed4f('0x2'));var BPromise=require(_0xed4f('0x3'));var zipdir=require(_0xed4f('0x4'));var rimraf=require(_0xed4f('0x5'));var db=require(_0xed4f('0x6'))['db'];var dbH=require(_0xed4f('0x6'))[_0xed4f('0x7')];var logger=require(_0xed4f('0x8'))(_0xed4f('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0xed4f('0xa')][0x2]);var QUERY=process[_0xed4f('0xa')][0x3];var PATH=process[_0xed4f('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x534ef8,_0x18d0d0){var _0x3aa895={'status':_0x534ef8};var _0x425a12={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x18d0d0){_0x3aa895[_0xed4f('0xb')]=_0x18d0d0;}return db[_0xed4f('0xc')]['update'](_0x3aa895,_0x425a12);}function main(){var _0x336073=0x1388;var _0x4c4cda;logger['info'](util[_0xed4f('0xd')](_0xed4f('0xe'),EXTRACTED_REPORT_ID,'XLSX'));return db[_0xed4f('0xf')][_0xed4f('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xed4f('0x11'),'splitSizeXlsx']})[_0xed4f('0x12')](function(_0x22cf81){if(_0x22cf81){_0x4c4cda=_0x22cf81;_0x336073=_0x4c4cda['splitSizeXlsx']||0x1388;}})[_0xed4f('0x12')](function(){return dbH['sequelize'][_0xed4f('0x13')](util['format'](_0xed4f('0x14'),QUERY),{'type':dbH[_0xed4f('0x15')][_0xed4f('0x16')][_0xed4f('0x17')]});})[_0xed4f('0x12')](function(_0x2144f3){if(!_0x2144f3[0x0]['num']){return analyticExtractedReport(_0xed4f('0x18'));}var _0x48910a=[];var _0x28355c=0x0;var _0x371695=!![];if(_0x4c4cda[_0xed4f('0x11')]){if(_0x2144f3&&_0x2144f3[_0xed4f('0x19')]){var _0x326a3d=_0x2144f3[0x0][_0xed4f('0x1a')]%(_0x28355c+_0x336073);for(;_0x371695;_0x28355c+=_0x336073,_0x326a3d=_0x2144f3[0x0]['num']%(_0x28355c+_0x336073)){if(_0x326a3d==0x0||_0x326a3d==_0x2144f3[0x0][_0xed4f('0x1a')]){_0x371695=![];}_0x48910a[_0xed4f('0x1b')](dbH[_0xed4f('0x15')][_0xed4f('0x13')](util[_0xed4f('0xd')](_0xed4f('0x1c'),QUERY,_0x336073,_0x28355c),{'type':dbH[_0xed4f('0x15')][_0xed4f('0x16')][_0xed4f('0x17')]}));}}}else{_0x48910a[_0xed4f('0x1b')](dbH['sequelize']['query'](QUERY,{'type':dbH['sequelize'][_0xed4f('0x16')][_0xed4f('0x17')]}));}var _0x4a25b0=path['dirname'](PATH);var _0x17edbb=path[_0xed4f('0x1d')](PATH,'.xlsx');var _0x8703aa=_0x4c4cda[_0xed4f('0x11')]&&_0x48910a[_0xed4f('0x19')]>0x1;var _0xc84ef6=[];if(!fs[_0xed4f('0x1e')](path[_0xed4f('0x1f')](_0x4a25b0,_0x17edbb))&&_0x8703aa){fs[_0xed4f('0x20')](path['join'](_0x4a25b0,_0x17edbb));}return BPromise[_0xed4f('0x21')](_0x48910a,function(_0x5a6cb6){_0xc84ef6[_0xed4f('0x1b')](_0x5a6cb6);})['then'](function(){for(var _0x133ca7=0x0;_0x133ca7<_0xc84ef6[_0xed4f('0x19')];_0x133ca7+=0x1){var _0x5b7d34;var _0x18a247=_0xc84ef6[_0x133ca7];if(_0x8703aa){_0x5b7d34=path[_0xed4f('0x1f')](_0x4a25b0,_0x17edbb,util[_0xed4f('0xd')](_0xed4f('0x22'),_0x17edbb,_0x133ca7,_0xed4f('0x23')));}else{_0x5b7d34=path[_0xed4f('0x1f')](_0x4a25b0,util[_0xed4f('0xd')](_0xed4f('0x24'),_0x17edbb,_0xed4f('0x23')));}fs['writeFileSync'](_0x5b7d34,json2xls(_0x18a247),_0xed4f('0x25'));}})[_0xed4f('0x12')](function(){if(_0x8703aa){zipdir(path[_0xed4f('0x1f')](_0x4a25b0,_0x17edbb),{'saveTo':path[_0xed4f('0x1f')](_0x4a25b0,util[_0xed4f('0xd')](_0xed4f('0x24'),_0x17edbb,_0xed4f('0x26')))},function(_0x512bda,_0x3f987f){});rimraf(path['join'](_0x4a25b0,_0x17edbb),function(){});}})[_0xed4f('0x12')](function(){logger[_0xed4f('0x27')](util[_0xed4f('0xd')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xed4f('0x28')));return analyticExtractedReport(_0xed4f('0x29'),_0x8703aa?util['format'](_0xed4f('0x24'),_0x17edbb,_0x8703aa?_0xed4f('0x26'):_0xed4f('0x23')):null);});})[_0xed4f('0x2a')](function(_0x42e898){logger['info'](util[_0xed4f('0xd')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xed4f('0x28')),util[_0xed4f('0x2b')](_0x42e898,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xed4f('0x2c'));})[_0xed4f('0x2d')](function(){process[_0xed4f('0x2e')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index e2dda70..e5d51fb 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 _0x6ae2=['IntervalId','then','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','priority','extensions','find','type','Set','format','CDR(type)=%s','context','CDR(routeid)=','VoiceExtensionId','outbound','extension','push','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','length','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','last','concat','bulkCreate','sortBy','catch','rewrite','lodash','util','models','intervals','VoiceExtension','findAll'];(function(_0x2fae3c,_0x5ecd56){var _0x5ad6a5=function(_0x9abc70){while(--_0x9abc70){_0x2fae3c['push'](_0x2fae3c['shift']());}};_0x5ad6a5(++_0x5ecd56);}(_0x6ae2,0x158));var _0x26ae=function(_0x16ad4c,_0x7a1daa){_0x16ad4c=_0x16ad4c-0x0;var _0x2eec11=_0x6ae2[_0x16ad4c];return _0x2eec11;};'use strict';var _=require(_0x26ae('0x0'));var util=require(_0x26ae('0x1'));function rewrite(_0x5125ff,_0x279104){var _0xea480f=this;return _0x5125ff[_0x26ae('0x2')]['Interval']['findAll']({'raw':!![]})['then'](function(_0x4def1f){_0xea480f[_0x26ae('0x3')]=_0x4def1f;return _0x5125ff['models'][_0x26ae('0x4')][_0x26ae('0x5')]({'where':{'IntervalId':_0x279104[_0x26ae('0x6')]},'raw':!![]});})[_0x26ae('0x7')](function(_0x5a27fc){return _0x5125ff[_0x26ae('0x2')]['VoiceExtension']['findAll']({'where':{'exten':{'$in':_[_0x26ae('0x8')](_[_0x26ae('0x9')](_0x5a27fc,_0x26ae('0xa')))}},'order':[{'raw':_0x26ae('0xb')}],'raw':!![]});})[_0x26ae('0x7')](function(_0x40d088){var _0x31de31=_[_0x26ae('0xc')](_0x40d088,{'priority':'1'});var _0x5cb723=_['filter'](_0x40d088,{'isApp':0x1});var _0x686118=_[_0x26ae('0xd')](_0x5cb723,_0x26ae('0xa'));var _0x59b4ad=[_0x26ae('0xe'),_0x26ae('0xf')];var _0x356838=[];var _0x41bd59=[];for(var _0x3337ad in _0x686118){if(_0x686118['hasOwnProperty'](_0x3337ad)){_0xea480f[_0x26ae('0x10')]=0x2;_0xea480f[_0x26ae('0x11')]=[];_0xea480f['extension']=_[_0x26ae('0x12')](_0x31de31,{'exten':_0x686118[_0x3337ad][0x0][_0x26ae('0xa')]});_0xea480f[_0x26ae('0x11')]['push']({'type':_0x686118[_0x3337ad][0x0][_0x26ae('0x13')],'app':_0x26ae('0x14'),'appdata':util[_0x26ae('0x15')](_0x26ae('0x16'),_0x686118[_0x3337ad][0x0][_0x26ae('0x13')]),'context':_0x686118[_0x3337ad][0x0][_0x26ae('0x17')],'exten':_0x686118[_0x3337ad][0x0][_0x26ae('0xa')],'priority':_0xea480f['priority']++,'VoiceExtensionId':_0x686118[_0x3337ad][0x0]['VoiceExtensionId']});if(_0x686118[_0x3337ad][0x0]['type']==='inbound'){_0xea480f['extensions']['push']({'type':_0x686118[_0x3337ad][0x0][_0x26ae('0x13')],'app':_0x26ae('0x14'),'appdata':_0x26ae('0x18')+_0x686118[_0x3337ad][0x0][_0x26ae('0x19')],'context':_0x686118[_0x3337ad][0x0]['context'],'exten':_0x686118[_0x3337ad][0x0][_0x26ae('0xa')],'priority':_0xea480f[_0x26ae('0x10')]++,'VoiceExtensionId':_0x686118[_0x3337ad][0x0][_0x26ae('0x19')]});}else if(_0x686118[_0x3337ad][0x0][_0x26ae('0x13')]===_0x26ae('0x1a')){if(_0xea480f[_0x26ae('0x1b')]){_0xea480f['extensions'][_0x26ae('0x1c')]({'type':_0x686118[_0x3337ad][0x0]['type'],'app':_0x26ae('0x14'),'appdata':'CDR(destination)='+(_0xea480f[_0x26ae('0x1b')][_0x26ae('0x1d')]?_0x26ae('0x1e')+_0xea480f['extension'][_0x26ae('0x1d')]+'}':_0x26ae('0x1f')),'context':_0x686118[_0x3337ad][0x0][_0x26ae('0x17')],'exten':_0x686118[_0x3337ad][0x0]['exten'],'priority':_0xea480f[_0x26ae('0x10')]++,'VoiceExtensionId':_0x686118[_0x3337ad][0x0][_0x26ae('0x19')]});}_0xea480f['extensions'][_0x26ae('0x1c')]({'type':_0x686118[_0x3337ad][0x0]['type'],'app':_0x26ae('0x14'),'appdata':_0x26ae('0x18')+_0x686118[_0x3337ad][0x0][_0x26ae('0x19')],'context':_0x686118[_0x3337ad][0x0]['context'],'exten':_0x686118[_0x3337ad][0x0][_0x26ae('0xa')],'priority':_0xea480f['priority']++,'VoiceExtensionId':_0x686118[_0x3337ad][0x0][_0x26ae('0x19')]});var _0x5f0b27=_0xea480f[_0x26ae('0x10')]++;_0xea480f[_0x26ae('0x11')]['push']({'type':_0x686118[_0x3337ad][0x0][_0x26ae('0x13')],'app':_0x26ae('0x20'),'appdata':_0x26ae('0x21')+(_0x5f0b27+0x2)+_0x26ae('0x22')+(_0x5f0b27+0x1)+')','context':_0x686118[_0x3337ad][0x0]['context'],'exten':_0x686118[_0x3337ad][0x0][_0x26ae('0xa')],'priority':_0x5f0b27,'VoiceExtensionId':_0x686118[_0x3337ad][0x0][_0x26ae('0x19')]});if(_0xea480f[_0x26ae('0x1b')]){_0xea480f['extensions'][_0x26ae('0x1c')]({'type':_0x686118[_0x3337ad][0x0][_0x26ae('0x13')],'app':_0x26ae('0x14'),'appdata':_0xea480f[_0x26ae('0x1b')]['cutdigits']?'CDR(prefix)=${EXTEN:0:'+_0xea480f[_0x26ae('0x1b')]['cutdigits']+'}':_0x26ae('0x23'),'context':_0x686118[_0x3337ad][0x0][_0x26ae('0x17')],'exten':_0x686118[_0x3337ad][0x0][_0x26ae('0xa')],'priority':_0xea480f[_0x26ae('0x10')]++,'VoiceExtensionId':_0x686118[_0x3337ad][0x0][_0x26ae('0x19')]});}_0xea480f[_0x26ae('0x11')][_0x26ae('0x1c')]({'type':_0x686118[_0x3337ad][0x0]['type'],'app':_0x26ae('0x14'),'appdata':_0x26ae('0x24')+_0x686118[_0x3337ad][0x0][_0x26ae('0x19')],'context':_0x686118[_0x3337ad][0x0][_0x26ae('0x17')],'exten':_0x686118[_0x3337ad][0x0][_0x26ae('0xa')],'priority':_0xea480f[_0x26ae('0x10')]++,'VoiceExtensionId':_0x686118[_0x3337ad][0x0][_0x26ae('0x19')]});if(_0xea480f[_0x26ae('0x1b')]&&_0xea480f[_0x26ae('0x1b')][_0x26ae('0x25')](_0x26ae('0x26'))&&_0xea480f['extension']['recordingFormat']!==_0x26ae('0x27')){_0xea480f[_0x26ae('0x11')][_0x26ae('0x1c')]({'type':_0x686118[_0x3337ad][0x0]['type'],'app':_0x26ae('0x14'),'appdata':_0x26ae('0x28'),'context':_0x686118[_0x3337ad][0x0]['context'],'exten':_0x686118[_0x3337ad][0x0][_0x26ae('0xa')],'priority':_0xea480f[_0x26ae('0x10')]++,'VoiceExtensionId':_0x686118[_0x3337ad][0x0]['VoiceExtensionId']});_0xea480f['extensions'][_0x26ae('0x1c')]({'type':_0x686118[_0x3337ad][0x0][_0x26ae('0x13')],'app':_0x26ae('0x14'),'appdata':_0x26ae('0x29')+_0xea480f[_0x26ae('0x1b')][_0x26ae('0x26')]||'wav','context':_0x686118[_0x3337ad][0x0][_0x26ae('0x17')],'exten':_0x686118[_0x3337ad][0x0][_0x26ae('0xa')],'priority':_0xea480f[_0x26ae('0x10')]++,'VoiceExtensionId':_0x686118[_0x3337ad][0x0]['VoiceExtensionId']});}}_0xea480f[_0x26ae('0x11')][_0x26ae('0x1c')]({'type':_0x686118[_0x3337ad][0x0][_0x26ae('0x13')],'app':'Set','appdata':_0x26ae('0x2a'),'context':_0x686118[_0x3337ad][0x0][_0x26ae('0x17')],'exten':_0x686118[_0x3337ad][0x0][_0x26ae('0xa')],'priority':_0xea480f[_0x26ae('0x10')]++,'VoiceExtensionId':_0x686118[_0x3337ad][0x0][_0x26ae('0x19')]});_0xea480f[_0x26ae('0x11')][_0x26ae('0x1c')]({'type':_0x686118[_0x3337ad][0x0]['type'],'app':'Set','appdata':_0x26ae('0x2b'),'context':_0x686118[_0x3337ad][0x0][_0x26ae('0x17')],'exten':_0x686118[_0x3337ad][0x0][_0x26ae('0xa')],'priority':_0xea480f[_0x26ae('0x10')]++,'VoiceExtensionId':_0x686118[_0x3337ad][0x0]['VoiceExtensionId']});_0xea480f[_0x26ae('0x11')][_0x26ae('0x1c')]({'type':_0x686118[_0x3337ad][0x0]['type'],'app':'Set','appdata':'MONITOR_OPTIONS=ab','context':_0x686118[_0x3337ad][0x0]['context'],'exten':_0x686118[_0x3337ad][0x0][_0x26ae('0xa')],'priority':_0xea480f['priority']++,'VoiceExtensionId':_0x686118[_0x3337ad][0x0][_0x26ae('0x19')]});for(var _0x80b0b0=0x0,_0x529557=0x0;_0x80b0b0<_0x686118[_0x3337ad][_0x26ae('0x2c')];_0x80b0b0+=0x1,_0x529557=0x0){var _0x5a76ca=_0x686118[_0x3337ad][_0x80b0b0];if(_0x5a76ca[_0x26ae('0x13')]){_0x5a76ca[_0x26ae('0x13')]=_0x5a76ca[_0x26ae('0x13')][_0x26ae('0x2d')]();}var _0x34cd2f=[];var _0x2045bd=[];delete _0x5a76ca['id'];delete _0x5a76ca[_0x26ae('0x2e')];delete _0x5a76ca[_0x26ae('0x2f')];var _0x37ab9c=_0x5a76ca[_0x26ae('0x30')]!==_0x26ae('0x31')?[_0x5a76ca['interval']]:_0x5a76ca[_0x26ae('0x6')]?_[_0x26ae('0x9')](_['filter'](_0xea480f['intervals'],{'IntervalId':_0x5a76ca[_0x26ae('0x6')]}),'interval'):[];if(_0x5a76ca['hasOwnProperty'](_0x26ae('0x32'))){if(_0x5a76ca[_0x26ae('0x32')]&&_0x5a76ca['tag']!=='--'){_0x34cd2f[_0x26ae('0x1c')]({'type':_0x5a76ca[_0x26ae('0x13')],'app':_0x26ae('0x14'),'appdata':_0x26ae('0x33')+_0x5a76ca[_0x26ae('0x32')],'context':_0x5a76ca[_0x26ae('0x17')],'exten':_0x5a76ca[_0x26ae('0xa')],'priority':_0x37ab9c[_0x26ae('0x2c')]+_0xea480f['priority']+_0x529557++,'VoiceExtensionId':_0x5a76ca[_0x26ae('0x19')]});}}if(_0x5a76ca['type']===_0x26ae('0x1a')&&_0x5a76ca['hasOwnProperty'](_0x26ae('0x34'))){if(_0x5a76ca[_0x26ae('0x34')]){_0x34cd2f[_0x26ae('0x1c')]({'type':_0x5a76ca[_0x26ae('0x13')],'app':_0x26ae('0x20'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x5a76ca[_0x26ae('0x34')]+')','context':_0x5a76ca[_0x26ae('0x17')],'exten':_0x5a76ca[_0x26ae('0xa')],'priority':_0x37ab9c[_0x26ae('0x2c')]+_0xea480f[_0x26ae('0x10')]+_0x529557++,'VoiceExtensionId':_0x5a76ca[_0x26ae('0x19')]});}else{_0x34cd2f['push']({'type':_0x5a76ca['type'],'app':'ExecIf','appdata':_0x26ae('0x35'),'context':_0x5a76ca[_0x26ae('0x17')],'exten':_0x5a76ca[_0x26ae('0xa')],'priority':_0x37ab9c['length']+_0xea480f[_0x26ae('0x10')]+_0x529557++,'VoiceExtensionId':_0x5a76ca['VoiceExtensionId']});}}if(_0x5a76ca['hasOwnProperty'](_0x26ae('0x36'))){if(_0x59b4ad[_0x26ae('0x37')](_0x5a76ca['app'][_0x26ae('0x2d')]())>=0x0&&_0x5a76ca[_0x26ae('0x38')]!==_0x26ae('0x39')){if(_0x5a76ca[_0x26ae('0x36')]){_0x34cd2f[_0x26ae('0x1c')]({'type':_0x5a76ca['type'],'app':_0x26ae('0x20'),'appdata':_0x26ae('0x3a'),'context':_0x5a76ca[_0x26ae('0x17')],'exten':_0x5a76ca[_0x26ae('0xa')],'priority':_0x37ab9c['length']+_0xea480f[_0x26ae('0x10')]+_0x529557++,'VoiceExtensionId':_0x5a76ca['VoiceExtensionId']});_0x34cd2f[_0x26ae('0x1c')]({'type':_0x5a76ca[_0x26ae('0x13')],'app':_0x26ae('0x14'),'appdata':_0x26ae('0x3b'),'context':_0x5a76ca[_0x26ae('0x17')],'exten':_0x5a76ca[_0x26ae('0xa')],'priority':_0x37ab9c[_0x26ae('0x2c')]+_0xea480f['priority']+_0x529557++,'VoiceExtensionId':_0x5a76ca['VoiceExtensionId']});}else{_0x34cd2f[_0x26ae('0x1c')]({'type':_0x5a76ca[_0x26ae('0x13')],'app':_0x26ae('0x20'),'appdata':_0x26ae('0x3c'),'context':_0x5a76ca[_0x26ae('0x17')],'exten':_0x5a76ca[_0x26ae('0xa')],'priority':_0x37ab9c[_0x26ae('0x2c')]+_0xea480f[_0x26ae('0x10')]+_0x529557++,'VoiceExtensionId':_0x5a76ca[_0x26ae('0x19')]});_0x34cd2f[_0x26ae('0x1c')]({'type':_0x5a76ca[_0x26ae('0x13')],'app':_0x26ae('0x14'),'appdata':_0x26ae('0x3d'),'context':_0x5a76ca[_0x26ae('0x17')],'exten':_0x5a76ca[_0x26ae('0xa')],'priority':_0x37ab9c['length']+_0xea480f[_0x26ae('0x10')]+_0x529557++,'VoiceExtensionId':_0x5a76ca[_0x26ae('0x19')]});}}}for(var _0x21ae13=0x0;_0x21ae13<_0x37ab9c[_0x26ae('0x2c')];_0x21ae13+=0x1){var _0x21d21c=_0xea480f[_0x26ae('0x10')]+_0x37ab9c[_0x26ae('0x2c')];var _0x22c43b=_0x21ae13===_0x37ab9c['length']-0x1?_0xea480f[_0x26ae('0x10')]+_0x34cd2f[_0x26ae('0x2c')]+_0x2045bd[_0x26ae('0x2c')]+0x2:_0xea480f['priority']+_0x21ae13+0x1;_0x34cd2f['splice'](_0x21ae13,0x0,{'type':_0x5a76ca['type'],'app':_0x26ae('0x3e'),'appdata':_0x37ab9c[_0x21ae13]+'?'+_0x5a76ca[_0x26ae('0x17')]+_0x26ae('0x3f')+_0x21d21c+':'+_0x5a76ca[_0x26ae('0x17')]+_0x26ae('0x3f')+_0x22c43b,'exten':_0x5a76ca[_0x26ae('0xa')],'context':_0x5a76ca[_0x26ae('0x17')],'priority':_0xea480f[_0x26ae('0x10')]+_0x21ae13,'VoiceExtensionId':_0x686118[_0x3337ad][0x0]['VoiceExtensionId']});}_0x5a76ca['priority']=_0x34cd2f[_0x26ae('0x2c')]?_[_0x26ae('0x40')](_0x34cd2f)[_0x26ae('0x10')]+0x1:_0xea480f[_0x26ae('0x10')];_0xea480f[_0x26ae('0x10')]=(_0x2045bd[_0x26ae('0x2c')]?_[_0x26ae('0x40')](_0x2045bd)[_0x26ae('0x10')]:_0x5a76ca['priority'])+0x1;_0xea480f['extensions']=_[_0x26ae('0x41')](_0xea480f[_0x26ae('0x11')],_0x34cd2f,[_0x5a76ca],_0x2045bd);}_0xea480f['extensions'][_0x26ae('0x1c')]({'type':_0x686118[_0x3337ad][0x0]['type'],'app':'Hangup','exten':_0x686118[_0x3337ad][0x0][_0x26ae('0xa')],'context':_0x686118[_0x3337ad][0x0][_0x26ae('0x17')],'priority':_0xea480f[_0x26ae('0x10')],'VoiceExtensionId':_0x686118[_0x3337ad][0x0][_0x26ae('0x19')]});_0x356838[_0x26ae('0x1c')](_0x686118[_0x3337ad][0x0]['VoiceExtensionId']);_0x41bd59=_[_0x26ae('0x41')](_0x41bd59,_0xea480f[_0x26ae('0x11')]);}}return _0x5125ff['transaction'](function(_0x20ff14){return _0x5125ff['models'][_0x26ae('0x4')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0x356838}},'transaction':_0x20ff14})['then'](function(_0x3e741a){return _0x5125ff[_0x26ae('0x2')]['VoiceExtension'][_0x26ae('0x42')](_[_0x26ae('0x43')](_0x41bd59,_0x26ae('0x10')),{'transaction':_0x20ff14});});});})[_0x26ae('0x44')](function(_0x905d29){console['error'](_0x905d29);});}exports[_0x26ae('0x45')]=rewrite; \ No newline at end of file +var _0xefdf=['exten','queue','playback','hasOwnProperty','priority','extensions','find','push','type','Set','CDR(type)=%s','context','VoiceExtensionId','inbound','CDR(routeid)=','outbound','extension','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','toLowerCase','createdAt','interval','IntervalId','map','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','length','answer','indexOf','app','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','Hangup','concat','transaction','destroy','bulkCreate','catch','error','lodash','models','Interval','findAll','then','intervals','VoiceExtension','uniq','filter','groupBy'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xefdf,0x14a));var _0xfefd=function(_0x524b2a,_0x13e281){_0x524b2a=_0x524b2a-0x0;var _0x176cc5=_0xefdf[_0x524b2a];return _0x176cc5;};'use strict';var _=require(_0xfefd('0x0'));var util=require('util');function rewrite(_0x14023f,_0x131cfd){var _0x5298d0=this;return _0x14023f[_0xfefd('0x1')][_0xfefd('0x2')][_0xfefd('0x3')]({'raw':!![]})[_0xfefd('0x4')](function(_0x3b5836){_0x5298d0[_0xfefd('0x5')]=_0x3b5836;return _0x14023f['models'][_0xfefd('0x6')][_0xfefd('0x3')]({'where':{'IntervalId':_0x131cfd['IntervalId']},'raw':!![]});})[_0xfefd('0x4')](function(_0x2392f2){return _0x14023f[_0xfefd('0x1')]['VoiceExtension'][_0xfefd('0x3')]({'where':{'exten':{'$in':_[_0xfefd('0x7')](_['map'](_0x2392f2,'exten'))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})['then'](function(_0x42902d){var _0x37d4cc=_[_0xfefd('0x8')](_0x42902d,{'priority':'1'});var _0x3d4b60=_[_0xfefd('0x8')](_0x42902d,{'isApp':0x1});var _0x36faf6=_[_0xfefd('0x9')](_0x3d4b60,_0xfefd('0xa'));var _0x212bfc=[_0xfefd('0xb'),_0xfefd('0xc')];var _0x1357dc=[];var _0x1b55fe=[];for(var _0x4d6204 in _0x36faf6){if(_0x36faf6[_0xfefd('0xd')](_0x4d6204)){_0x5298d0[_0xfefd('0xe')]=0x2;_0x5298d0[_0xfefd('0xf')]=[];_0x5298d0['extension']=_[_0xfefd('0x10')](_0x37d4cc,{'exten':_0x36faf6[_0x4d6204][0x0][_0xfefd('0xa')]});_0x5298d0[_0xfefd('0xf')][_0xfefd('0x11')]({'type':_0x36faf6[_0x4d6204][0x0][_0xfefd('0x12')],'app':_0xfefd('0x13'),'appdata':util['format'](_0xfefd('0x14'),_0x36faf6[_0x4d6204][0x0][_0xfefd('0x12')]),'context':_0x36faf6[_0x4d6204][0x0][_0xfefd('0x15')],'exten':_0x36faf6[_0x4d6204][0x0][_0xfefd('0xa')],'priority':_0x5298d0['priority']++,'VoiceExtensionId':_0x36faf6[_0x4d6204][0x0][_0xfefd('0x16')]});if(_0x36faf6[_0x4d6204][0x0][_0xfefd('0x12')]===_0xfefd('0x17')){_0x5298d0[_0xfefd('0xf')][_0xfefd('0x11')]({'type':_0x36faf6[_0x4d6204][0x0][_0xfefd('0x12')],'app':_0xfefd('0x13'),'appdata':_0xfefd('0x18')+_0x36faf6[_0x4d6204][0x0][_0xfefd('0x16')],'context':_0x36faf6[_0x4d6204][0x0][_0xfefd('0x15')],'exten':_0x36faf6[_0x4d6204][0x0][_0xfefd('0xa')],'priority':_0x5298d0['priority']++,'VoiceExtensionId':_0x36faf6[_0x4d6204][0x0]['VoiceExtensionId']});}else if(_0x36faf6[_0x4d6204][0x0][_0xfefd('0x12')]===_0xfefd('0x19')){if(_0x5298d0[_0xfefd('0x1a')]){_0x5298d0[_0xfefd('0xf')]['push']({'type':_0x36faf6[_0x4d6204][0x0][_0xfefd('0x12')],'app':_0xfefd('0x13'),'appdata':_0xfefd('0x1b')+(_0x5298d0['extension'][_0xfefd('0x1c')]?_0xfefd('0x1d')+_0x5298d0[_0xfefd('0x1a')][_0xfefd('0x1c')]+'}':_0xfefd('0x1e')),'context':_0x36faf6[_0x4d6204][0x0][_0xfefd('0x15')],'exten':_0x36faf6[_0x4d6204][0x0][_0xfefd('0xa')],'priority':_0x5298d0[_0xfefd('0xe')]++,'VoiceExtensionId':_0x36faf6[_0x4d6204][0x0]['VoiceExtensionId']});}_0x5298d0[_0xfefd('0xf')]['push']({'type':_0x36faf6[_0x4d6204][0x0][_0xfefd('0x12')],'app':_0xfefd('0x13'),'appdata':'CDR(routeid)='+_0x36faf6[_0x4d6204][0x0][_0xfefd('0x16')],'context':_0x36faf6[_0x4d6204][0x0][_0xfefd('0x15')],'exten':_0x36faf6[_0x4d6204][0x0][_0xfefd('0xa')],'priority':_0x5298d0[_0xfefd('0xe')]++,'VoiceExtensionId':_0x36faf6[_0x4d6204][0x0][_0xfefd('0x16')]});var _0x38a0e9=_0x5298d0[_0xfefd('0xe')]++;_0x5298d0[_0xfefd('0xf')][_0xfefd('0x11')]({'type':_0x36faf6[_0x4d6204][0x0]['type'],'app':_0xfefd('0x1f'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x38a0e9+0x2)+'):Goto('+(_0x38a0e9+0x1)+')','context':_0x36faf6[_0x4d6204][0x0]['context'],'exten':_0x36faf6[_0x4d6204][0x0][_0xfefd('0xa')],'priority':_0x38a0e9,'VoiceExtensionId':_0x36faf6[_0x4d6204][0x0][_0xfefd('0x16')]});if(_0x5298d0[_0xfefd('0x1a')]){_0x5298d0['extensions']['push']({'type':_0x36faf6[_0x4d6204][0x0][_0xfefd('0x12')],'app':'Set','appdata':_0x5298d0['extension'][_0xfefd('0x1c')]?'CDR(prefix)=${EXTEN:0:'+_0x5298d0[_0xfefd('0x1a')][_0xfefd('0x1c')]+'}':_0xfefd('0x20'),'context':_0x36faf6[_0x4d6204][0x0][_0xfefd('0x15')],'exten':_0x36faf6[_0x4d6204][0x0][_0xfefd('0xa')],'priority':_0x5298d0['priority']++,'VoiceExtensionId':_0x36faf6[_0x4d6204][0x0]['VoiceExtensionId']});}_0x5298d0[_0xfefd('0xf')][_0xfefd('0x11')]({'type':_0x36faf6[_0x4d6204][0x0][_0xfefd('0x12')],'app':_0xfefd('0x13'),'appdata':_0xfefd('0x21')+_0x36faf6[_0x4d6204][0x0][_0xfefd('0x16')],'context':_0x36faf6[_0x4d6204][0x0][_0xfefd('0x15')],'exten':_0x36faf6[_0x4d6204][0x0][_0xfefd('0xa')],'priority':_0x5298d0[_0xfefd('0xe')]++,'VoiceExtensionId':_0x36faf6[_0x4d6204][0x0][_0xfefd('0x16')]});if(_0x5298d0['extension']&&_0x5298d0['extension']['hasOwnProperty']('recordingFormat')&&_0x5298d0[_0xfefd('0x1a')][_0xfefd('0x22')]!==_0xfefd('0x23')){_0x5298d0[_0xfefd('0xf')]['push']({'type':_0x36faf6[_0x4d6204][0x0][_0xfefd('0x12')],'app':_0xfefd('0x13'),'appdata':_0xfefd('0x24'),'context':_0x36faf6[_0x4d6204][0x0]['context'],'exten':_0x36faf6[_0x4d6204][0x0]['exten'],'priority':_0x5298d0[_0xfefd('0xe')]++,'VoiceExtensionId':_0x36faf6[_0x4d6204][0x0][_0xfefd('0x16')]});_0x5298d0['extensions']['push']({'type':_0x36faf6[_0x4d6204][0x0][_0xfefd('0x12')],'app':_0xfefd('0x13'),'appdata':_0xfefd('0x25')+_0x5298d0['extension'][_0xfefd('0x22')]||_0xfefd('0x26'),'context':_0x36faf6[_0x4d6204][0x0][_0xfefd('0x15')],'exten':_0x36faf6[_0x4d6204][0x0][_0xfefd('0xa')],'priority':_0x5298d0[_0xfefd('0xe')]++,'VoiceExtensionId':_0x36faf6[_0x4d6204][0x0][_0xfefd('0x16')]});}}_0x5298d0[_0xfefd('0xf')][_0xfefd('0x11')]({'type':_0x36faf6[_0x4d6204][0x0]['type'],'app':_0xfefd('0x13'),'appdata':_0xfefd('0x27'),'context':_0x36faf6[_0x4d6204][0x0][_0xfefd('0x15')],'exten':_0x36faf6[_0x4d6204][0x0][_0xfefd('0xa')],'priority':_0x5298d0[_0xfefd('0xe')]++,'VoiceExtensionId':_0x36faf6[_0x4d6204][0x0][_0xfefd('0x16')]});_0x5298d0[_0xfefd('0xf')][_0xfefd('0x11')]({'type':_0x36faf6[_0x4d6204][0x0]['type'],'app':_0xfefd('0x13'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x36faf6[_0x4d6204][0x0]['context'],'exten':_0x36faf6[_0x4d6204][0x0][_0xfefd('0xa')],'priority':_0x5298d0[_0xfefd('0xe')]++,'VoiceExtensionId':_0x36faf6[_0x4d6204][0x0][_0xfefd('0x16')]});_0x5298d0[_0xfefd('0xf')][_0xfefd('0x11')]({'type':_0x36faf6[_0x4d6204][0x0]['type'],'app':_0xfefd('0x13'),'appdata':'MONITOR_OPTIONS=ab','context':_0x36faf6[_0x4d6204][0x0][_0xfefd('0x15')],'exten':_0x36faf6[_0x4d6204][0x0][_0xfefd('0xa')],'priority':_0x5298d0[_0xfefd('0xe')]++,'VoiceExtensionId':_0x36faf6[_0x4d6204][0x0]['VoiceExtensionId']});for(var _0x3eb636=0x0,_0x530bfa=0x0;_0x3eb636<_0x36faf6[_0x4d6204]['length'];_0x3eb636+=0x1,_0x530bfa=0x0){var _0x5bb1cc=_0x36faf6[_0x4d6204][_0x3eb636];if(_0x5bb1cc[_0xfefd('0x12')]){_0x5bb1cc[_0xfefd('0x12')]=_0x5bb1cc['type'][_0xfefd('0x28')]();}var _0x4fb0b8=[];var _0x41067d=[];delete _0x5bb1cc['id'];delete _0x5bb1cc[_0xfefd('0x29')];delete _0x5bb1cc['updatedAt'];var _0x162808=_0x5bb1cc['interval']!=='*,*,*,*'?[_0x5bb1cc[_0xfefd('0x2a')]]:_0x5bb1cc[_0xfefd('0x2b')]?_[_0xfefd('0x2c')](_[_0xfefd('0x8')](_0x5298d0[_0xfefd('0x5')],{'IntervalId':_0x5bb1cc[_0xfefd('0x2b')]}),_0xfefd('0x2a')):[];if(_0x5bb1cc[_0xfefd('0xd')]('tag')){if(_0x5bb1cc[_0xfefd('0x2d')]&&_0x5bb1cc['tag']!=='--'){_0x4fb0b8['push']({'type':_0x5bb1cc['type'],'app':'Set','appdata':_0xfefd('0x2e')+_0x5bb1cc[_0xfefd('0x2d')],'context':_0x5bb1cc[_0xfefd('0x15')],'exten':_0x5bb1cc['exten'],'priority':_0x162808['length']+_0x5298d0[_0xfefd('0xe')]+_0x530bfa++,'VoiceExtensionId':_0x5bb1cc['VoiceExtensionId']});}}if(_0x5bb1cc['type']==='outbound'&&_0x5bb1cc[_0xfefd('0xd')](_0xfefd('0x2f'))){if(_0x5bb1cc[_0xfefd('0x2f')]){_0x4fb0b8[_0xfefd('0x11')]({'type':_0x5bb1cc['type'],'app':_0xfefd('0x1f'),'appdata':_0xfefd('0x30')+_0x5bb1cc[_0xfefd('0x2f')]+')','context':_0x5bb1cc[_0xfefd('0x15')],'exten':_0x5bb1cc[_0xfefd('0xa')],'priority':_0x162808[_0xfefd('0x31')]+_0x5298d0[_0xfefd('0xe')]+_0x530bfa++,'VoiceExtensionId':_0x5bb1cc[_0xfefd('0x16')]});}else{_0x4fb0b8['push']({'type':_0x5bb1cc['type'],'app':_0xfefd('0x1f'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x5bb1cc[_0xfefd('0x15')],'exten':_0x5bb1cc[_0xfefd('0xa')],'priority':_0x162808[_0xfefd('0x31')]+_0x5298d0['priority']+_0x530bfa++,'VoiceExtensionId':_0x5bb1cc[_0xfefd('0x16')]});}}if(_0x5bb1cc[_0xfefd('0xd')](_0xfefd('0x32'))){if(_0x212bfc[_0xfefd('0x33')](_0x5bb1cc[_0xfefd('0x34')][_0xfefd('0x28')]())>=0x0&&_0x5bb1cc[_0xfefd('0x35')]!=='custom'){if(_0x5bb1cc[_0xfefd('0x32')]){_0x4fb0b8[_0xfefd('0x11')]({'type':_0x5bb1cc['type'],'app':_0xfefd('0x1f'),'appdata':_0xfefd('0x36'),'context':_0x5bb1cc['context'],'exten':_0x5bb1cc[_0xfefd('0xa')],'priority':_0x162808[_0xfefd('0x31')]+_0x5298d0[_0xfefd('0xe')]+_0x530bfa++,'VoiceExtensionId':_0x5bb1cc[_0xfefd('0x16')]});_0x4fb0b8[_0xfefd('0x11')]({'type':_0x5bb1cc[_0xfefd('0x12')],'app':_0xfefd('0x13'),'appdata':_0xfefd('0x37'),'context':_0x5bb1cc['context'],'exten':_0x5bb1cc[_0xfefd('0xa')],'priority':_0x162808[_0xfefd('0x31')]+_0x5298d0[_0xfefd('0xe')]+_0x530bfa++,'VoiceExtensionId':_0x5bb1cc[_0xfefd('0x16')]});}else{_0x4fb0b8['push']({'type':_0x5bb1cc[_0xfefd('0x12')],'app':'ExecIf','appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x5bb1cc[_0xfefd('0x15')],'exten':_0x5bb1cc[_0xfefd('0xa')],'priority':_0x162808[_0xfefd('0x31')]+_0x5298d0[_0xfefd('0xe')]+_0x530bfa++,'VoiceExtensionId':_0x5bb1cc[_0xfefd('0x16')]});_0x4fb0b8[_0xfefd('0x11')]({'type':_0x5bb1cc[_0xfefd('0x12')],'app':'Set','appdata':_0xfefd('0x38'),'context':_0x5bb1cc[_0xfefd('0x15')],'exten':_0x5bb1cc['exten'],'priority':_0x162808[_0xfefd('0x31')]+_0x5298d0[_0xfefd('0xe')]+_0x530bfa++,'VoiceExtensionId':_0x5bb1cc[_0xfefd('0x16')]});}}}for(var _0x3be5f7=0x0;_0x3be5f7<_0x162808['length'];_0x3be5f7+=0x1){var _0x4e4a72=_0x5298d0[_0xfefd('0xe')]+_0x162808[_0xfefd('0x31')];var _0x71c200=_0x3be5f7===_0x162808[_0xfefd('0x31')]-0x1?_0x5298d0[_0xfefd('0xe')]+_0x4fb0b8['length']+_0x41067d[_0xfefd('0x31')]+0x2:_0x5298d0[_0xfefd('0xe')]+_0x3be5f7+0x1;_0x4fb0b8[_0xfefd('0x39')](_0x3be5f7,0x0,{'type':_0x5bb1cc[_0xfefd('0x12')],'app':_0xfefd('0x3a'),'appdata':_0x162808[_0x3be5f7]+'?'+_0x5bb1cc['context']+_0xfefd('0x3b')+_0x4e4a72+':'+_0x5bb1cc[_0xfefd('0x15')]+',${EXTEN},'+_0x71c200,'exten':_0x5bb1cc['exten'],'context':_0x5bb1cc[_0xfefd('0x15')],'priority':_0x5298d0[_0xfefd('0xe')]+_0x3be5f7,'VoiceExtensionId':_0x36faf6[_0x4d6204][0x0][_0xfefd('0x16')]});}_0x5bb1cc['priority']=_0x4fb0b8['length']?_[_0xfefd('0x3c')](_0x4fb0b8)['priority']+0x1:_0x5298d0[_0xfefd('0xe')];_0x5298d0[_0xfefd('0xe')]=(_0x41067d[_0xfefd('0x31')]?_['last'](_0x41067d)['priority']:_0x5bb1cc[_0xfefd('0xe')])+0x1;_0x5298d0[_0xfefd('0xf')]=_['concat'](_0x5298d0[_0xfefd('0xf')],_0x4fb0b8,[_0x5bb1cc],_0x41067d);}_0x5298d0[_0xfefd('0xf')][_0xfefd('0x11')]({'type':_0x36faf6[_0x4d6204][0x0][_0xfefd('0x12')],'app':_0xfefd('0x3d'),'exten':_0x36faf6[_0x4d6204][0x0][_0xfefd('0xa')],'context':_0x36faf6[_0x4d6204][0x0][_0xfefd('0x15')],'priority':_0x5298d0[_0xfefd('0xe')],'VoiceExtensionId':_0x36faf6[_0x4d6204][0x0][_0xfefd('0x16')]});_0x1357dc[_0xfefd('0x11')](_0x36faf6[_0x4d6204][0x0][_0xfefd('0x16')]);_0x1b55fe=_[_0xfefd('0x3e')](_0x1b55fe,_0x5298d0['extensions']);}}return _0x14023f[_0xfefd('0x3f')](function(_0xc9a0d7){return _0x14023f['models']['VoiceExtension'][_0xfefd('0x40')]({'where':{'VoiceExtensionId':{'$in':_0x1357dc}},'transaction':_0xc9a0d7})[_0xfefd('0x4')](function(_0x16e3d1){return _0x14023f[_0xfefd('0x1')][_0xfefd('0x6')][_0xfefd('0x41')](_['sortBy'](_0x1b55fe,'priority'),{'transaction':_0xc9a0d7});});});})[_0xfefd('0x42')](function(_0x5e224b){console[_0xfefd('0x43')](_0x5e224b);});}exports['rewrite']=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 39ceb26..aeda9a5 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 _0x9c01=['finally','emit','contact:csv_','resume','resolve','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','split','createReadStream','parse','pause','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','register','argv','undefined','Missing\x20filepath\x20parameter!','null','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','contact','index','test','isNil','error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','duplicate','create','then','pick','catch','message','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','createdAt','select','NOW()','field','toString','updatedAt','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','where','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','id\x20IN\x20?','str','cm_hopper_final','cm_hopper_black','findAll','outbound','dialCheckDuplicateType','CmList','Lists','get','always','push','sequelize','query','onlyIfOpen','VoiceQueueId','all','BlackLists','Campaign','CampaignId','cmContact,\x20%s,\x20%s','Error\x20processing\x20rows\x20block:','stringify'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x9c01,0x7d));var _0x19c0=function(_0x3c1d33,_0xff95d3){_0x3c1d33=_0x3c1d33-0x0;var _0x422756=_0x9c01[_0x3c1d33];return _0x422756;};'use strict';var BPromise=require(_0x19c0('0x0'));var util=require(_0x19c0('0x1'));var _=require(_0x19c0('0x2'));var fs=require('fs');var squel=require(_0x19c0('0x3'));var Papa=require(_0x19c0('0x4'));var Redis=require(_0x19c0('0x5'));var db=require(_0x19c0('0x6'))['db'];var config=require(_0x19c0('0x7'));var logger=require(_0x19c0('0x8'))(_0x19c0('0x9'));config[_0x19c0('0xa')]=_[_0x19c0('0xb')](config[_0x19c0('0xa')],{'host':_0x19c0('0xc'),'port':0x18eb});var socket=require(_0x19c0('0xd'))(new Redis(config[_0x19c0('0xa')]));require('../../../api/cmContact/cmContact.socket')[_0x19c0('0xe')](socket);try{if(!process[_0x19c0('0xf')][0x2]||process[_0x19c0('0xf')][0x2]===_0x19c0('0x10')||process[_0x19c0('0xf')][0x2]==='null'){throw new Error(_0x19c0('0x11'));}var FILEPATH=process[_0x19c0('0xf')][0x2];if(!process[_0x19c0('0xf')][0x3]||process[_0x19c0('0xf')][0x3]===_0x19c0('0x10')||process[_0x19c0('0xf')][0x3]===_0x19c0('0x12')||!process[_0x19c0('0xf')][0x4]||process[_0x19c0('0xf')][0x4]==='undefined'||process[_0x19c0('0xf')][0x4]==='null'){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_['zipObject'](process['argv'][0x3]['split'](','),process[_0x19c0('0xf')][0x4]['split'](','));if(!process[_0x19c0('0xf')][0x5]||process[_0x19c0('0xf')][0x5]==='undefined'||process[_0x19c0('0xf')][0x5]===_0x19c0('0x12')){throw new Error(_0x19c0('0x13'));}var LISTID=process['argv'][0x5];var COMPANYID=process[_0x19c0('0xf')][0x6]&&process[_0x19c0('0xf')][0x6]!==_0x19c0('0x10')&&process[_0x19c0('0xf')][0x6]!==_0x19c0('0x12')?process[_0x19c0('0xf')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0x19c0('0xf')][0x7]!==_0x19c0('0x10')&&process[_0x19c0('0xf')][0x7]!=='null'?process[_0x19c0('0xf')][0x7]:null;if(!process[_0x19c0('0xf')][0x8]||process[_0x19c0('0xf')][0x8]===_0x19c0('0x10')||process[_0x19c0('0xf')][0x8]===_0x19c0('0x12')){throw new Error(_0x19c0('0x14'));}var SOCKET_TIMESTAMP=process[_0x19c0('0xf')][0x8];}catch(_0x5e2bfa){logger['error'](_0x5e2bfa);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(_0x1b0e3,_0xccbe63,_0x25eca9,_0x206166){var _0x10f9a0={'message':_0xccbe63};_0x10f9a0[_0x1b0e3]=!![];if(_0x25eca9){_0x10f9a0[_0x19c0('0x15')]=_0x25eca9;}if(_0x206166){_0x10f9a0[_0x19c0('0x16')]=_0x206166;}return _0x10f9a0;}function isEmail(_0x5624e5){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))*$/[_0x19c0('0x17')](_0x5624e5);}function checkRow(_0x1cb3dc,_0x187bbb,_0x12364d){return new BPromise(function(_0x5c6541,_0x12e855){if(_[_0x19c0('0x18')](_0x1cb3dc)){return _0x12e855(handleCheckRowError(_0x19c0('0x19'),_0x19c0('0x1a'),null,_0x12364d));}if(_0x1cb3dc['errors']&&_0x1cb3dc[_0x19c0('0x1b')][_0x19c0('0x1c')]){var _0x20f68c=_[_0x19c0('0x1d')](_0x1cb3dc[_0x19c0('0x1b')],'message')[_0x19c0('0x1e')](';');return _0x12e855(handleCheckRowError(_0x19c0('0x19'),_0x20f68c,null,_0x12364d));}var _0x435c77={};for(var _0x566a6d in FIELDS){if(FIELDS[_0x19c0('0x1f')](_0x566a6d)&&FIELDS[_0x566a6d]){_0x435c77[_0x566a6d]=_0x1cb3dc[_0x19c0('0x20')][0x0][FIELDS[_0x566a6d]]||_0x1cb3dc[_0x19c0('0x20')][0x0]['\ufeff'+FIELDS[_0x566a6d]];}}if(!_0x435c77[_0x19c0('0x21')]){return _0x12e855(handleCheckRowError(_0x19c0('0x19'),_0x19c0('0x22'),null,_0x12364d));}if(!_0x435c77['phone']){return _0x12e855(handleCheckRowError(_0x19c0('0x19'),_0x19c0('0x23'),null,_0x12364d));}if(_0x435c77[_0x19c0('0x24')]){var _0x2f7680=moment(_0x435c77['birthDate'],_0x19c0('0x25'));if(!_0x2f7680[_0x19c0('0x26')]()){return _0x12e855(handleCheckRowError(_0x19c0('0x19'),_0x19c0('0x27'),null,_0x12364d));}}if(_0x435c77['email']){if(!isEmail(_0x435c77[_0x19c0('0x28')])){return _0x12e855(handleCheckRowError(_0x19c0('0x19'),_0x19c0('0x29'),null,_0x12364d));}}_0x435c77[_0x19c0('0x2a')]=LISTID;_0x435c77[_0x19c0('0x2b')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x19c0('0x1c')]&&_0x187bbb){var _0x528799={};for(var _0x274e47=0x0,_0x3769e7=DUPLICATES['length'];_0x274e47<_0x3769e7;_0x274e47+=0x1){_0x528799[DUPLICATES[_0x274e47]]=_0x435c77[DUPLICATES[_0x274e47]];}var _0x5ba54e=_[_0x19c0('0x2c')](_0x187bbb,_0x528799);if(_0x5ba54e){return _0x12e855(handleCheckRowError(_0x19c0('0x2d'),'Duplicate\x20Contact',_0x5ba54e,_0x12364d));}}return db['CmContact'][_0x19c0('0x2e')](_0x435c77,{'raw':!![],'hooks':![],'fields':_['keys'](_0x435c77)})[_0x19c0('0x2f')](function(_0x1127d0){if(DUPLICATES&&DUPLICATES['length']&&_0x187bbb){_0x187bbb['push'](_[_0x19c0('0x30')](_0x435c77,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x1127d0['id'];return _0x5c6541();})[_0x19c0('0x31')](function(_0x2f7e79){return _0x12e855(handleCheckRowError('error','Error\x20while\x20creating\x20contact:\x20'+(_0x2f7e79[_0x19c0('0x32')]||JSON['stringify'](_0x2f7e79)),null,_0x12364d));});});}function checkHopper(){function _0x141281(){return function(_0x3461d1){logger['error']('cmContact','checkHopper',util['inspect'](_0x3461d1,{'showHidden':![],'depth':null}));};}var _0x46b3bf=function(_0x2784ff,_0x4e617d){var _0x16907f=squel[_0x19c0('0x33')]()[_0x19c0('0x34')](_0x19c0('0x35'))[_0x19c0('0x36')]([_0x19c0('0x37'),_0x19c0('0x38'),_0x19c0('0x39'),_0x19c0('0x2a'),_0x4e617d,_0x19c0('0x3a'),'updatedAt'],squel[_0x19c0('0x3b')]()['field'](_0x19c0('0x37'),_0x19c0('0x37'))['field'](_0x19c0('0x3c'),_0x19c0('0x38'))['field']('id',_0x19c0('0x39'))[_0x19c0('0x3d')](LISTID['toString'](),_0x19c0('0x2a'))['field'](_0x2784ff['id'][_0x19c0('0x3e')](),_0x4e617d)[_0x19c0('0x3d')]('NOW()','createdAt')[_0x19c0('0x3d')](_0x19c0('0x3c'),_0x19c0('0x3f'))[_0x19c0('0x40')](_0x19c0('0x41'))['where'](_0x19c0('0x42'))['where'](_0x19c0('0x43'),LISTID[_0x19c0('0x3e')]())[_0x19c0('0x44')](_0x19c0('0x45'))[_0x19c0('0x44')](_0x19c0('0x46'),squel[_0x19c0('0x3b')]()['field'](_0x19c0('0x37'))[_0x19c0('0x40')](_0x19c0('0x35'))[_0x19c0('0x44')](_0x4e617d+_0x19c0('0x47'),_0x2784ff['id']['toString']())))[_0x19c0('0x3e')]();return _0x16907f;};var _0x1a68f9=function(_0x4a4fe2,_0x3f3c56){var _0x59a576=squel['insert']()[_0x19c0('0x34')](_0x19c0('0x35'))[_0x19c0('0x36')]([_0x19c0('0x37'),_0x19c0('0x38'),_0x19c0('0x39'),_0x19c0('0x2a'),_0x3f3c56,_0x19c0('0x3a'),'updatedAt'],squel[_0x19c0('0x3b')]()['field'](_0x19c0('0x37'),_0x19c0('0x37'))[_0x19c0('0x3d')](_0x19c0('0x3c'),_0x19c0('0x38'))[_0x19c0('0x3d')]('id',_0x19c0('0x39'))[_0x19c0('0x3d')](LISTID[_0x19c0('0x3e')](),_0x19c0('0x2a'))[_0x19c0('0x3d')](_0x4a4fe2['id']['toString'](),_0x3f3c56)['field'](_0x19c0('0x3c'),'createdAt')['field']('NOW()',_0x19c0('0x3f'))[_0x19c0('0x40')](_0x19c0('0x41'))[_0x19c0('0x44')](_0x19c0('0x42'))[_0x19c0('0x44')](_0x19c0('0x43'),LISTID[_0x19c0('0x3e')]())[_0x19c0('0x44')](_0x19c0('0x48'),squel[_0x19c0('0x49')](hopperContacts))[_0x19c0('0x44')]('phone\x20IS\x20NOT\x20NULL')[_0x19c0('0x44')](_0x19c0('0x46'),squel[_0x19c0('0x3b')]()[_0x19c0('0x3d')]('calleridnum')[_0x19c0('0x40')](_0x19c0('0x4a'))[_0x19c0('0x44')](_0x3f3c56+_0x19c0('0x47'),_0x4a4fe2['id']['toString']()))[_0x19c0('0x44')]('phone\x20NOT\x20IN\x20(?)',squel['select']()['field'](_0x19c0('0x37'))[_0x19c0('0x40')](_0x19c0('0x35'))[_0x19c0('0x44')](_0x3f3c56+_0x19c0('0x47'),_0x4a4fe2['id'][_0x19c0('0x3e')]())))[_0x19c0('0x3e')]();return _0x59a576;};function _0x5c9e6e(_0x5e8640,_0x1ce2b6){var _0x437a5b=squel[_0x19c0('0x33')]()[_0x19c0('0x34')](_0x19c0('0x35'))[_0x19c0('0x36')]([_0x19c0('0x37'),_0x19c0('0x38'),_0x19c0('0x39'),_0x19c0('0x2a'),_0x1ce2b6,'createdAt',_0x19c0('0x3f')],squel[_0x19c0('0x3b')]()[_0x19c0('0x3d')](_0x19c0('0x37'),'phone')[_0x19c0('0x3d')]('NOW()',_0x19c0('0x38'))[_0x19c0('0x3d')]('id',_0x19c0('0x39'))['field'](LISTID[_0x19c0('0x3e')](),_0x19c0('0x2a'))[_0x19c0('0x3d')](_0x5e8640['id'][_0x19c0('0x3e')](),_0x1ce2b6)[_0x19c0('0x3d')](_0x19c0('0x3c'),_0x19c0('0x3a'))['field'](_0x19c0('0x3c'),_0x19c0('0x3f'))[_0x19c0('0x40')](_0x19c0('0x41'))[_0x19c0('0x44')](_0x19c0('0x42'))['where']('ListId\x20=\x20?',LISTID[_0x19c0('0x3e')]())[_0x19c0('0x44')]('id\x20IN\x20?',squel[_0x19c0('0x49')](hopperContacts))[_0x19c0('0x44')]('phone\x20IS\x20NOT\x20NULL'))[_0x19c0('0x3e')]();return _0x437a5b;}function _0x1a6de7(_0x499abb,_0x596561){var _0x1a2841=squel['insert']()[_0x19c0('0x34')](_0x19c0('0x4b'))['fromQuery']([_0x19c0('0x37'),_0x19c0('0x39'),_0x19c0('0x2a'),_0x596561,'createdAt','updatedAt'],squel[_0x19c0('0x3b')]()[_0x19c0('0x3d')]('phone',_0x19c0('0x37'))[_0x19c0('0x3d')]('id',_0x19c0('0x39'))[_0x19c0('0x3d')](LISTID[_0x19c0('0x3e')](),_0x19c0('0x2a'))['field'](_0x499abb['id'][_0x19c0('0x3e')](),_0x596561)[_0x19c0('0x3d')](_0x19c0('0x3c'),_0x19c0('0x3a'))[_0x19c0('0x3d')](_0x19c0('0x3c'),_0x19c0('0x3f'))['from'](_0x19c0('0x41'))[_0x19c0('0x44')]('deletedAt\x20IS\x20NULL')[_0x19c0('0x44')](_0x19c0('0x43'),LISTID['toString']())[_0x19c0('0x44')](_0x19c0('0x48'),squel['str'](hopperContacts))[_0x19c0('0x44')](_0x19c0('0x45')))[_0x19c0('0x3e')]();return _0x1a2841;}return db['VoiceQueue'][_0x19c0('0x4c')]({'where':{'type':_0x19c0('0x4d')},'attributes':['id',_0x19c0('0x4e')],'include':[{'model':db[_0x19c0('0x4f')],'as':_0x19c0('0x50'),'where':{'id':LISTID}}]})[_0x19c0('0x2f')](function(_0x27046c){var _0x54feca=[];if(_0x27046c){var _0xefe737;for(var _0x4af5aa=0x0,_0x29a799;_0x4af5aa<_0x27046c[_0x19c0('0x1c')];_0x4af5aa+=0x1){_0x29a799=_0x27046c[_0x4af5aa][_0x19c0('0x51')]({'plain':!![]});switch(_0x29a799['dialCheckDuplicateType']){case _0x19c0('0x52'):_0x54feca[_0x19c0('0x53')](db[_0x19c0('0x54')][_0x19c0('0x55')](_0x1a68f9(_0x29a799,'VoiceQueueId'))[_0x19c0('0x2f')](function(){})['catch'](_0x141281()));break;case _0x19c0('0x56'):_0x54feca[_0x19c0('0x53')](db[_0x19c0('0x54')][_0x19c0('0x55')](_0x46b3bf(_0x29a799,'VoiceQueueId'))[_0x19c0('0x2f')](function(){})['catch'](_0x141281()));break;default:_0x54feca[_0x19c0('0x53')](db[_0x19c0('0x54')][_0x19c0('0x55')](_0x5c9e6e(_0x29a799,_0x19c0('0x57')))[_0x19c0('0x2f')](function(){})[_0x19c0('0x31')](_0x141281()));}}}return _0x54feca;})[_0x19c0('0x58')]()[_0x19c0('0x2f')](function(){return db['VoiceQueue'][_0x19c0('0x4c')]({'where':{'type':_0x19c0('0x4d')},'attributes':['id'],'include':[{'model':db[_0x19c0('0x4f')],'as':_0x19c0('0x59'),'where':{'id':LISTID}}]})[_0x19c0('0x2f')](function(_0x29fcbb){var _0x1ab98c=[];if(_0x29fcbb){var _0x1b63e4;for(var _0x2cbf20=0x0,_0x2d3543;_0x2cbf20<_0x29fcbb[_0x19c0('0x1c')];_0x2cbf20+=0x1){_0x2d3543=_0x29fcbb[_0x2cbf20][_0x19c0('0x51')]({'plain':!![]});_0x1ab98c['push'](db[_0x19c0('0x54')][_0x19c0('0x55')](_0x1a6de7(_0x2d3543,_0x19c0('0x57')))[_0x19c0('0x2f')](function(){})['catch'](_0x141281()));}}return _0x1ab98c;})[_0x19c0('0x58')]();})[_0x19c0('0x2f')](function(){return db[_0x19c0('0x5a')][_0x19c0('0x4c')]({'attributes':['id',_0x19c0('0x4e')],'include':[{'model':db['CmList'],'as':_0x19c0('0x50'),'where':{'id':LISTID}}]})[_0x19c0('0x2f')](function(_0x437adf){var _0x22d22e=[];if(_0x437adf){for(var _0x476d01=0x0,_0x4c8acd;_0x476d01<_0x437adf[_0x19c0('0x1c')];_0x476d01+=0x1){_0x4c8acd=_0x437adf[_0x476d01][_0x19c0('0x51')]({'plain':!![]});switch(_0x4c8acd['dialCheckDuplicateType']){case _0x19c0('0x52'):_0x22d22e['push'](db[_0x19c0('0x54')]['query'](_0x1a68f9(_0x4c8acd,_0x19c0('0x5b')))[_0x19c0('0x2f')](function(){})[_0x19c0('0x31')](_0x141281()));break;case _0x19c0('0x56'):_0x22d22e[_0x19c0('0x53')](db[_0x19c0('0x54')][_0x19c0('0x55')](_0x46b3bf(_0x4c8acd,_0x19c0('0x5b')))[_0x19c0('0x2f')](function(){})[_0x19c0('0x31')](_0x141281()));break;default:_0x22d22e[_0x19c0('0x53')](db['sequelize'][_0x19c0('0x55')](_0x5c9e6e(_0x4c8acd,_0x19c0('0x5b')))[_0x19c0('0x2f')](function(){})[_0x19c0('0x31')](_0x141281()));}}}return _0x22d22e;})[_0x19c0('0x58')]();})[_0x19c0('0x2f')](function(){return db[_0x19c0('0x5a')][_0x19c0('0x4c')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x19c0('0x59'),'where':{'id':LISTID}}]})[_0x19c0('0x2f')](function(_0x22c5e3){var _0x3527bd=[];if(_0x22c5e3){for(var _0x331583=0x0,_0x57fba4;_0x331583<_0x22c5e3['length'];_0x331583+=0x1){_0x57fba4=_0x22c5e3[_0x331583][_0x19c0('0x51')]({'plain':!![]});_0x3527bd[_0x19c0('0x53')](db[_0x19c0('0x54')][_0x19c0('0x55')](_0x1a6de7(_0x57fba4,_0x19c0('0x5b')))['then'](function(){})['catch'](_0x141281()));}}return _0x3527bd;})[_0x19c0('0x58')]();})[_0x19c0('0x31')](function(_0x4d9dd7){logger['error'](_0x19c0('0x5c'),'generalCheckHopper',_0x4d9dd7[_0x19c0('0x32')]);});}var processPromises=function(_0x5b5fac){return BPromise['all'](promises)['then'](function(_0x5732a8){})[_0x19c0('0x31')](function(_0x2eb2e9){logger[_0x19c0('0x19')](_0x19c0('0x5d'),JSON[_0x19c0('0x5e')](_0x2eb2e9));})[_0x19c0('0x5f')](function(){socket[_0x19c0('0x60')](_0x19c0('0x61')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x5b5fac){return _0x5b5fac[_0x19c0('0x62')]();}});};var endCsv=function(){return BPromise[_0x19c0('0x63')]()[_0x19c0('0x2f')](function(){if(hopperContacts){return checkHopper();}})[_0x19c0('0x2f')](function(){socket[_0x19c0('0x60')](_0x19c0('0x61')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x43b0a2){logger[_0x19c0('0x19')]('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0x19c0('0x5e')](_0x43b0a2));}finally{process[_0x19c0('0x64')](0x0);}});};process['on'](_0x19c0('0x65'),function(){logger[_0x19c0('0x66')](_0x19c0('0x67'));endCsv();});function main(){return BPromise['resolve']()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x19c0('0x68')](',');return db['CmContact'][_0x19c0('0x4c')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x4ef7d8){var _0xca12fc=fs[_0x19c0('0x69')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x19c0('0x6a')](_0xca12fc,{'header':!![],'skipEmptyLines':!![],'step':function(_0xc9878f,_0x2d78b0){total+=0x1;var _0x1ef2f9=total;promises[_0x19c0('0x53')](checkRow(_0xc9878f,_0x4ef7d8,_0x1ef2f9)[_0x19c0('0x2f')](function(){success+=0x1;})[_0x19c0('0x31')](function(_0x50d35d){if(_0x50d35d[_0x19c0('0x19')]){errors+=0x1;delete _0x50d35d[_0x19c0('0x19')];}else if(_0x50d35d[_0x19c0('0x2d')]){duplicates+=0x1;delete _0x50d35d[_0x19c0('0x2d')];}rows[_0x19c0('0x53')](_0x50d35d);}));if(total%0xc8===0x0){_0x2d78b0[_0x19c0('0x6b')]();return processPromises(_0x2d78b0);}},'complete':function(){return processPromises()[_0x19c0('0x2f')](function(){logger['info']('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x33f59f,_0x38b1aa){logger[_0x19c0('0x66')](_0x19c0('0x6c'),JSON[_0x19c0('0x5e')](_0x33f59f));endCsv();}});})[_0x19c0('0x31')](function(_0x27c026){logger[_0x19c0('0x19')](_0x19c0('0x6d'),JSON['stringify'](_0x27c026));});}main(); \ No newline at end of file +var _0x181f=['stringify','cmContact','inspect','insert','into','cm_hopper','fromQuery','phone','ContactId','createdAt','updatedAt','select','field','NOW()','scheduledAt','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','cm_hopper_final','VoiceQueue','findAll','outbound','Lists','get','dialCheckDuplicateType','always','push','query','VoiceQueueId','onlyIfOpen','sequelize','all','CmList','BlackLists','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','resume','resolve','contact:csv_','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','CmContact','createReadStream','parse','pause','CSV\x20parse\x20error','util','squel','papaparse','ioredis','../../../mysqldb','../../../config/logger','api','redis','defaults','socket.io-emitter','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','hasOwnProperty','firstName','birthDate','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','duplicate','create','keys','then','pick','catch','Error\x20while\x20creating\x20contact:\x20'];(function(_0x3edf4a,_0x3159e1){var _0x4242a9=function(_0x10c355){while(--_0x10c355){_0x3edf4a['push'](_0x3edf4a['shift']());}};_0x4242a9(++_0x3159e1);}(_0x181f,0xaa));var _0xf181=function(_0x5efc86,_0x4df618){_0x5efc86=_0x5efc86-0x0;var _0x552b66=_0x181f[_0x5efc86];return _0x552b66;};'use strict';var BPromise=require('bluebird');var util=require(_0xf181('0x0'));var _=require('lodash');var fs=require('fs');var squel=require(_0xf181('0x1'));var Papa=require(_0xf181('0x2'));var Redis=require(_0xf181('0x3'));var db=require(_0xf181('0x4'))['db'];var config=require('../../../config/environment');var logger=require(_0xf181('0x5'))(_0xf181('0x6'));config[_0xf181('0x7')]=_[_0xf181('0x8')](config[_0xf181('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0xf181('0x9'))(new Redis(config['redis']));require('../../../api/cmContact/cmContact.socket')['register'](socket);try{if(!process[_0xf181('0xa')][0x2]||process[_0xf181('0xa')][0x2]===_0xf181('0xb')||process['argv'][0x2]===_0xf181('0xc')){throw new Error(_0xf181('0xd'));}var FILEPATH=process[_0xf181('0xa')][0x2];if(!process[_0xf181('0xa')][0x3]||process[_0xf181('0xa')][0x3]==='undefined'||process[_0xf181('0xa')][0x3]===_0xf181('0xc')||!process[_0xf181('0xa')][0x4]||process[_0xf181('0xa')][0x4]==='undefined'||process[_0xf181('0xa')][0x4]==='null'){throw new Error(_0xf181('0xe'));}var FIELDS=_[_0xf181('0xf')](process[_0xf181('0xa')][0x3][_0xf181('0x10')](','),process[_0xf181('0xa')][0x4][_0xf181('0x10')](','));if(!process[_0xf181('0xa')][0x5]||process[_0xf181('0xa')][0x5]===_0xf181('0xb')||process[_0xf181('0xa')][0x5]===_0xf181('0xc')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0xf181('0xa')][0x5];var COMPANYID=process[_0xf181('0xa')][0x6]&&process[_0xf181('0xa')][0x6]!==_0xf181('0xb')&&process[_0xf181('0xa')][0x6]!==_0xf181('0xc')?process['argv'][0x6]:null;var DUPLICATES=process[_0xf181('0xa')][0x7]&&process['argv'][0x7]!=='undefined'&&process[_0xf181('0xa')][0x7]!==_0xf181('0xc')?process[_0xf181('0xa')][0x7]:null;if(!process[_0xf181('0xa')][0x8]||process[_0xf181('0xa')][0x8]===_0xf181('0xb')||process['argv'][0x8]===_0xf181('0xc')){throw new Error(_0xf181('0x11'));}var SOCKET_TIMESTAMP=process[_0xf181('0xa')][0x8];}catch(_0x1db1e1){logger[_0xf181('0x12')](_0x1db1e1);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(_0xab5188,_0x2bc542,_0x577069,_0xbdefed){var _0x508ed6={'message':_0x2bc542};_0x508ed6[_0xab5188]=!![];if(_0x577069){_0x508ed6[_0xf181('0x13')]=_0x577069;}if(_0xbdefed){_0x508ed6[_0xf181('0x14')]=_0xbdefed;}return _0x508ed6;}function isEmail(_0x1026e0){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))*$/[_0xf181('0x15')](_0x1026e0);}function checkRow(_0x26e21c,_0x47de81,_0x2a3817){return new BPromise(function(_0x40254e,_0x370d84){if(_['isNil'](_0x26e21c)){return _0x370d84(handleCheckRowError(_0xf181('0x12'),_0xf181('0x16'),null,_0x2a3817));}if(_0x26e21c[_0xf181('0x17')]&&_0x26e21c['errors'][_0xf181('0x18')]){var _0x4116a9=_[_0xf181('0x19')](_0x26e21c['errors'],_0xf181('0x1a'))[_0xf181('0x1b')](';');return _0x370d84(handleCheckRowError('error',_0x4116a9,null,_0x2a3817));}var _0x345efe={};for(var _0x59e733 in FIELDS){if(FIELDS[_0xf181('0x1c')](_0x59e733)&&FIELDS[_0x59e733]){_0x345efe[_0x59e733]=_0x26e21c['data'][0x0][FIELDS[_0x59e733]]||_0x26e21c['data'][0x0]['\ufeff'+FIELDS[_0x59e733]];}}if(!_0x345efe[_0xf181('0x1d')]){return _0x370d84(handleCheckRowError(_0xf181('0x12'),'firstName\x20not\x20specified!',null,_0x2a3817));}if(!_0x345efe['phone']){return _0x370d84(handleCheckRowError(_0xf181('0x12'),'phone\x20not\x20specified!',null,_0x2a3817));}if(_0x345efe[_0xf181('0x1e')]){var _0xdca837=moment(_0x345efe[_0xf181('0x1e')],'YYYY-MM-DD');if(!_0xdca837[_0xf181('0x1f')]()){return _0x370d84(handleCheckRowError(_0xf181('0x12'),_0xf181('0x20'),null,_0x2a3817));}}if(_0x345efe[_0xf181('0x21')]){if(!isEmail(_0x345efe[_0xf181('0x21')])){return _0x370d84(handleCheckRowError(_0xf181('0x12'),_0xf181('0x22'),null,_0x2a3817));}}_0x345efe[_0xf181('0x23')]=LISTID;_0x345efe[_0xf181('0x24')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x47de81){var _0x3dd60e={};for(var _0x2cc612=0x0,_0x5c6ba7=DUPLICATES[_0xf181('0x18')];_0x2cc612<_0x5c6ba7;_0x2cc612+=0x1){_0x3dd60e[DUPLICATES[_0x2cc612]]=_0x345efe[DUPLICATES[_0x2cc612]];}var _0x5eeb05=_['find'](_0x47de81,_0x3dd60e);if(_0x5eeb05){return _0x370d84(handleCheckRowError(_0xf181('0x25'),'Duplicate\x20Contact',_0x5eeb05,_0x2a3817));}}return db['CmContact'][_0xf181('0x26')](_0x345efe,{'raw':!![],'hooks':![],'fields':_[_0xf181('0x27')](_0x345efe)})[_0xf181('0x28')](function(_0x166b76){if(DUPLICATES&&DUPLICATES[_0xf181('0x18')]&&_0x47de81){_0x47de81['push'](_[_0xf181('0x29')](_0x345efe,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x166b76['id'];return _0x40254e();})[_0xf181('0x2a')](function(_0x46c542){return _0x370d84(handleCheckRowError('error',_0xf181('0x2b')+(_0x46c542[_0xf181('0x1a')]||JSON[_0xf181('0x2c')](_0x46c542)),null,_0x2a3817));});});}function checkHopper(){function _0x18da7e(){return function(_0x17427b){logger[_0xf181('0x12')](_0xf181('0x2d'),'checkHopper',util[_0xf181('0x2e')](_0x17427b,{'showHidden':![],'depth':null}));};}var _0x541fa6=function(_0x37df3b,_0x240ca5){var _0x23cb34=squel[_0xf181('0x2f')]()[_0xf181('0x30')](_0xf181('0x31'))[_0xf181('0x32')]([_0xf181('0x33'),'scheduledAt',_0xf181('0x34'),_0xf181('0x23'),_0x240ca5,_0xf181('0x35'),_0xf181('0x36')],squel[_0xf181('0x37')]()[_0xf181('0x38')](_0xf181('0x33'),_0xf181('0x33'))[_0xf181('0x38')](_0xf181('0x39'),_0xf181('0x3a'))[_0xf181('0x38')]('id',_0xf181('0x34'))[_0xf181('0x38')](LISTID[_0xf181('0x3b')](),'ListId')[_0xf181('0x38')](_0x37df3b['id']['toString'](),_0x240ca5)[_0xf181('0x38')]('NOW()',_0xf181('0x35'))[_0xf181('0x38')](_0xf181('0x39'),_0xf181('0x36'))['from'](_0xf181('0x3c'))[_0xf181('0x3d')](_0xf181('0x3e'))[_0xf181('0x3d')](_0xf181('0x3f'),LISTID['toString']())['where'](_0xf181('0x40'))[_0xf181('0x3d')](_0xf181('0x41'),squel[_0xf181('0x37')]()[_0xf181('0x38')](_0xf181('0x33'))[_0xf181('0x42')]('cm_hopper')[_0xf181('0x3d')](_0x240ca5+_0xf181('0x43'),_0x37df3b['id'][_0xf181('0x3b')]())))[_0xf181('0x3b')]();return _0x23cb34;};var _0x54449a=function(_0x1ee4cc,_0x2e5dfb){var _0x3f4dab=squel['insert']()[_0xf181('0x30')]('cm_hopper')[_0xf181('0x32')]([_0xf181('0x33'),_0xf181('0x3a'),'ContactId',_0xf181('0x23'),_0x2e5dfb,_0xf181('0x35'),_0xf181('0x36')],squel[_0xf181('0x37')]()[_0xf181('0x38')]('phone',_0xf181('0x33'))['field'](_0xf181('0x39'),_0xf181('0x3a'))[_0xf181('0x38')]('id',_0xf181('0x34'))[_0xf181('0x38')](LISTID[_0xf181('0x3b')](),_0xf181('0x23'))[_0xf181('0x38')](_0x1ee4cc['id']['toString'](),_0x2e5dfb)['field']('NOW()',_0xf181('0x35'))[_0xf181('0x38')](_0xf181('0x39'),_0xf181('0x36'))[_0xf181('0x42')](_0xf181('0x3c'))[_0xf181('0x3d')](_0xf181('0x3e'))[_0xf181('0x3d')](_0xf181('0x3f'),LISTID[_0xf181('0x3b')]())[_0xf181('0x3d')](_0xf181('0x44'),squel[_0xf181('0x45')](hopperContacts))[_0xf181('0x3d')](_0xf181('0x40'))[_0xf181('0x3d')](_0xf181('0x41'),squel[_0xf181('0x37')]()[_0xf181('0x38')]('calleridnum')[_0xf181('0x42')](_0xf181('0x46'))['where'](_0x2e5dfb+_0xf181('0x43'),_0x1ee4cc['id']['toString']()))[_0xf181('0x3d')](_0xf181('0x41'),squel[_0xf181('0x37')]()[_0xf181('0x38')](_0xf181('0x33'))[_0xf181('0x42')](_0xf181('0x31'))[_0xf181('0x3d')](_0x2e5dfb+_0xf181('0x43'),_0x1ee4cc['id']['toString']())))[_0xf181('0x3b')]();return _0x3f4dab;};function _0x3023cf(_0x78703d,_0x2cd7aa){var _0x33b4ed=squel[_0xf181('0x2f')]()[_0xf181('0x30')](_0xf181('0x31'))[_0xf181('0x32')]([_0xf181('0x33'),'scheduledAt',_0xf181('0x34'),_0xf181('0x23'),_0x2cd7aa,_0xf181('0x35'),_0xf181('0x36')],squel[_0xf181('0x37')]()[_0xf181('0x38')](_0xf181('0x33'),'phone')[_0xf181('0x38')]('NOW()',_0xf181('0x3a'))['field']('id',_0xf181('0x34'))[_0xf181('0x38')](LISTID[_0xf181('0x3b')](),'ListId')[_0xf181('0x38')](_0x78703d['id'][_0xf181('0x3b')](),_0x2cd7aa)[_0xf181('0x38')](_0xf181('0x39'),_0xf181('0x35'))['field'](_0xf181('0x39'),_0xf181('0x36'))['from'](_0xf181('0x3c'))[_0xf181('0x3d')](_0xf181('0x3e'))[_0xf181('0x3d')](_0xf181('0x3f'),LISTID[_0xf181('0x3b')]())[_0xf181('0x3d')](_0xf181('0x44'),squel[_0xf181('0x45')](hopperContacts))[_0xf181('0x3d')](_0xf181('0x40')))['toString']();return _0x33b4ed;}function _0x18647c(_0x2be873,_0x16f274){var _0x2e26b7=squel[_0xf181('0x2f')]()[_0xf181('0x30')]('cm_hopper_black')[_0xf181('0x32')]([_0xf181('0x33'),_0xf181('0x34'),_0xf181('0x23'),_0x16f274,'createdAt',_0xf181('0x36')],squel[_0xf181('0x37')]()[_0xf181('0x38')](_0xf181('0x33'),_0xf181('0x33'))['field']('id','ContactId')[_0xf181('0x38')](LISTID['toString'](),_0xf181('0x23'))['field'](_0x2be873['id'][_0xf181('0x3b')](),_0x16f274)[_0xf181('0x38')](_0xf181('0x39'),_0xf181('0x35'))[_0xf181('0x38')](_0xf181('0x39'),_0xf181('0x36'))[_0xf181('0x42')](_0xf181('0x3c'))[_0xf181('0x3d')](_0xf181('0x3e'))['where'](_0xf181('0x3f'),LISTID['toString']())[_0xf181('0x3d')](_0xf181('0x44'),squel[_0xf181('0x45')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))[_0xf181('0x3b')]();return _0x2e26b7;}return db[_0xf181('0x47')][_0xf181('0x48')]({'where':{'type':_0xf181('0x49')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db['CmList'],'as':_0xf181('0x4a'),'where':{'id':LISTID}}]})['then'](function(_0x512b8e){var _0x17c7e4=[];if(_0x512b8e){var _0xce1cab;for(var _0xca0f17=0x0,_0x45d22b;_0xca0f17<_0x512b8e[_0xf181('0x18')];_0xca0f17+=0x1){_0x45d22b=_0x512b8e[_0xca0f17][_0xf181('0x4b')]({'plain':!![]});switch(_0x45d22b[_0xf181('0x4c')]){case _0xf181('0x4d'):_0x17c7e4[_0xf181('0x4e')](db['sequelize'][_0xf181('0x4f')](_0x54449a(_0x45d22b,_0xf181('0x50')))[_0xf181('0x28')](function(){})[_0xf181('0x2a')](_0x18da7e()));break;case _0xf181('0x51'):_0x17c7e4[_0xf181('0x4e')](db[_0xf181('0x52')]['query'](_0x541fa6(_0x45d22b,'VoiceQueueId'))[_0xf181('0x28')](function(){})['catch'](_0x18da7e()));break;default:_0x17c7e4[_0xf181('0x4e')](db[_0xf181('0x52')]['query'](_0x3023cf(_0x45d22b,_0xf181('0x50')))[_0xf181('0x28')](function(){})['catch'](_0x18da7e()));}}}return _0x17c7e4;})[_0xf181('0x53')]()['then'](function(){return db[_0xf181('0x47')][_0xf181('0x48')]({'where':{'type':_0xf181('0x49')},'attributes':['id'],'include':[{'model':db[_0xf181('0x54')],'as':_0xf181('0x55'),'where':{'id':LISTID}}]})[_0xf181('0x28')](function(_0x56b6ad){var _0x3fb5cd=[];if(_0x56b6ad){var _0x20bf60;for(var _0x5f282d=0x0,_0x120fa9;_0x5f282d<_0x56b6ad[_0xf181('0x18')];_0x5f282d+=0x1){_0x120fa9=_0x56b6ad[_0x5f282d][_0xf181('0x4b')]({'plain':!![]});_0x3fb5cd[_0xf181('0x4e')](db[_0xf181('0x52')]['query'](_0x18647c(_0x120fa9,_0xf181('0x50')))[_0xf181('0x28')](function(){})[_0xf181('0x2a')](_0x18da7e()));}}return _0x3fb5cd;})[_0xf181('0x53')]();})['then'](function(){return db[_0xf181('0x56')][_0xf181('0x48')]({'attributes':['id',_0xf181('0x4c')],'include':[{'model':db[_0xf181('0x54')],'as':_0xf181('0x4a'),'where':{'id':LISTID}}]})[_0xf181('0x28')](function(_0x1a7ddb){var _0x492508=[];if(_0x1a7ddb){for(var _0x20914e=0x0,_0xd1e130;_0x20914e<_0x1a7ddb[_0xf181('0x18')];_0x20914e+=0x1){_0xd1e130=_0x1a7ddb[_0x20914e][_0xf181('0x4b')]({'plain':!![]});switch(_0xd1e130['dialCheckDuplicateType']){case'always':_0x492508['push'](db[_0xf181('0x52')][_0xf181('0x4f')](_0x54449a(_0xd1e130,_0xf181('0x57')))[_0xf181('0x28')](function(){})[_0xf181('0x2a')](_0x18da7e()));break;case _0xf181('0x51'):_0x492508['push'](db['sequelize']['query'](_0x541fa6(_0xd1e130,'CampaignId'))[_0xf181('0x28')](function(){})[_0xf181('0x2a')](_0x18da7e()));break;default:_0x492508[_0xf181('0x4e')](db[_0xf181('0x52')]['query'](_0x3023cf(_0xd1e130,'CampaignId'))[_0xf181('0x28')](function(){})['catch'](_0x18da7e()));}}}return _0x492508;})['all']();})['then'](function(){return db[_0xf181('0x56')][_0xf181('0x48')]({'attributes':['id'],'include':[{'model':db[_0xf181('0x54')],'as':_0xf181('0x55'),'where':{'id':LISTID}}]})[_0xf181('0x28')](function(_0x51200a){var _0x4d2dbb=[];if(_0x51200a){for(var _0x3e7343=0x0,_0x4a08d9;_0x3e7343<_0x51200a[_0xf181('0x18')];_0x3e7343+=0x1){_0x4a08d9=_0x51200a[_0x3e7343][_0xf181('0x4b')]({'plain':!![]});_0x4d2dbb[_0xf181('0x4e')](db[_0xf181('0x52')]['query'](_0x18647c(_0x4a08d9,_0xf181('0x57')))[_0xf181('0x28')](function(){})[_0xf181('0x2a')](_0x18da7e()));}}return _0x4d2dbb;})[_0xf181('0x53')]();})[_0xf181('0x2a')](function(_0x4c80cc){logger[_0xf181('0x12')](_0xf181('0x58'),_0xf181('0x59'),_0x4c80cc['message']);});}var processPromises=function(_0x3df44d){return BPromise[_0xf181('0x53')](promises)[_0xf181('0x28')](function(_0x38a2b8){})[_0xf181('0x2a')](function(_0xac10ad){logger['error'](_0xf181('0x5a'),JSON[_0xf181('0x2c')](_0xac10ad));})[_0xf181('0x5b')](function(){socket[_0xf181('0x5c')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x3df44d){return _0x3df44d[_0xf181('0x5d')]();}});};var endCsv=function(){return BPromise[_0xf181('0x5e')]()['then'](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0xf181('0x5c')](_0xf181('0x5f')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xf181('0x60')](FILEPATH);}catch(_0x59dc16){logger[_0xf181('0x12')](_0xf181('0x61'),JSON[_0xf181('0x2c')](_0x59dc16));}finally{process[_0xf181('0x62')](0x0);}});};process['on'](_0xf181('0x63'),function(){logger[_0xf181('0x64')](_0xf181('0x65'));endCsv();});function main(){return BPromise[_0xf181('0x5e')]()[_0xf181('0x28')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xf181('0x10')](',');return db[_0xf181('0x66')][_0xf181('0x48')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xf181('0x28')](function(_0x2f4ff1){var _0x1c7f2c=fs[_0xf181('0x67')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xf181('0x68')](_0x1c7f2c,{'header':!![],'skipEmptyLines':!![],'step':function(_0x18d91b,_0x1f47ce){total+=0x1;var _0x3bc8b4=total;promises[_0xf181('0x4e')](checkRow(_0x18d91b,_0x2f4ff1,_0x3bc8b4)['then'](function(){success+=0x1;})[_0xf181('0x2a')](function(_0x2b9828){if(_0x2b9828['error']){errors+=0x1;delete _0x2b9828[_0xf181('0x12')];}else if(_0x2b9828[_0xf181('0x25')]){duplicates+=0x1;delete _0x2b9828[_0xf181('0x25')];}rows[_0xf181('0x4e')](_0x2b9828);}));if(total%0xc8===0x0){_0x1f47ce[_0xf181('0x69')]();return processPromises(_0x1f47ce);}},'complete':function(){return processPromises()['then'](function(){logger['info']('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x47e2e1,_0x215d71){logger['info'](_0xf181('0x6a'),JSON[_0xf181('0x2c')](_0x47e2e1));endCsv();}});})['catch'](function(_0x43bbbc){logger[_0xf181('0x12')]('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0xf181('0x2c')](_0x43bbbc));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index ff9716d..8007bae 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 _0xafc4=['cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22onlyIfOpen\x22','\x22always\x22','toString','insert','into','cm_hopper_black','from','cm_contacts.createdAt\x20=\x20?','\x20=\x20?','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','OrderBy','createdAt','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','CompanyId',')\x20NOT\x20IN\x20?','ListId\x20=\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','error','exit','errors','code','sequelize','spread','catch','message','main','stringify','start','binding','clone','socket_timestamp','root','body','ContactItemType','name','header','parse','data','rows','find','hasOwnProperty','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','includes','agent\x20not\x20exists','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','isNil','itemTypeId','trim','description','SystemRow','appendFileSync','emit','contact:import:','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','contactId','contactTypeId','orderBy','voice_queues','VoiceQueueId','campaigns_has_cm_lists','CampaignId','campaigns_has_cm_blacklists','campaigns','each','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','existsSync','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','ListId\x20is\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','papaparse','bluebird','moment','squel','ioredis','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','field','phone','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','CmContact','findAll','AdditionalPhones','then','push','all','split','length','filter','CmContactHasItem','update','updated','inserted','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.UserId','cm_hopper','fromQuery','scheduledat','ContactId','ListId','updatedAt','priority','UserId','recallme','select','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?'];(function(_0x465481,_0x463786){var _0x104975=function(_0x58143e){while(--_0x58143e){_0x465481['push'](_0x465481['shift']());}};_0x104975(++_0x463786);}(_0xafc4,0x69));var _0x4afc=function(_0x464a56,_0x47cd58){_0x464a56=_0x464a56-0x0;var _0x3190a4=_0xafc4[_0x464a56];return _0x3190a4;};'use strict';var fs=require('fs');var path=require(_0x4afc('0x0'));var _=require('lodash');var Papa=require(_0x4afc('0x1'));var util=require('util');var BPromise=require(_0x4afc('0x2'));var moment=require(_0x4afc('0x3'));var squel=require(_0x4afc('0x4'));var Redis=require(_0x4afc('0x5'));var db=require('../../../mysqldb')['db'];var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x4afc('0x6'));config[_0x4afc('0x7')]=_[_0x4afc('0x8')](config[_0x4afc('0x7')],{'host':_0x4afc('0x9'),'port':0x18eb});var socket=require(_0x4afc('0xa'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x4afc('0xb')](_0x4afc('0xc'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x134aad){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))*$/[_0x4afc('0xd')](_0x134aad);}function selectNotIn(_0x1b8981,_0x458fde,_0x5542ec,_0x5c523b,_0x7f127f){return squel['select']()[_0x4afc('0xe')](_0x4afc('0xf'))['from'](_0x5c523b)[_0x4afc('0x10')](_0x458fde,null,_0x458fde+_0x4afc('0x11')+_0x5c523b+'.'+_0x5542ec)[_0x4afc('0x12')](_0x5c523b+'.'+_0x5542ec+_0x4afc('0x13')+_0x1b8981+'.'+_0x5542ec)[_0x4afc('0x12')](_0x458fde+_0x4afc('0x14')+_0x7f127f[_0x4afc('0x10')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x23b03e,_0x5effb4){promisesAdditionalPhones=[];return db[_0x4afc('0x15')][_0x4afc('0x16')]({'raw':!![],'attributes':['id',_0x4afc('0x17')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x4afc('0x18')](function(_0x5f2dc9){if(_0x5f2dc9!==null){var _0x4e32e8=[];for(var _0x2452ae=0x0;_0x2452ae<_0x5f2dc9['length'];_0x2452ae++){var _0x23ae30=_0x5f2dc9[_0x2452ae];_0x4e32e8[_0x4afc('0x19')](insertAdditionalPhones(_0x23ae30));}}Promise[_0x4afc('0x1a')](_0x4e32e8)[_0x4afc('0x18')](function(){_0x23b03e({'val':0x1});});});});}function insertAdditionalPhones(_0x3a306f){return new Promise(function(_0x3ebdc8,_0x22f809){var _0x3ad418=_0x3a306f[_0x4afc('0x17')];var _0x135349=_0x3ad418[_0x4afc('0x1b')](';');var _0x543f0c=[];orderBy=0x0;for(var _0x1a8f49=0x0;_0x1a8f49<_0x135349[_0x4afc('0x1c')];_0x1a8f49++){_0x543f0c[_0x4afc('0x19')](splitAdditionalPhone(_0x3a306f['id'],_0x135349[_0x1a8f49]));}Promise[_0x4afc('0x1a')](_0x543f0c)['then'](function(){_0x3ebdc8({'val':_0x135349[_0x4afc('0x1c')]});});});}function splitAdditionalPhone(_0x30eda3,_0x2de6e9){return new Promise(function(_0x280587,_0x1559b8){var _0x3add4c=_0x2de6e9[_0x4afc('0x1b')](':');var _0x573a75=_0x3add4c[0x0];var _0x5403e4=_0x3add4c[0x1];if(_0x5403e4!==''){var _0x3ecf2d=_0x5403e4['split']('|');var _0x37debf=[];for(var _0x4e9a48=0x0;_0x4e9a48<_0x3ecf2d[_0x4afc('0x1c')];_0x4e9a48++){if(_0x3ecf2d[_0x4e9a48]!==''){var _0x2a0314=_[_0x4afc('0x1d')](promisesAdditionalPhones,{'contactId':_0x30eda3,'phone':_0x3ecf2d[_0x4e9a48]});if(_0x2a0314[_0x4afc('0x1c')]==0x0){orderBy++;promisesAdditionalPhones[_0x4afc('0x19')]({'contactId':_0x30eda3,'contactTypeId':_0x573a75,'phone':_0x3ecf2d[_0x4e9a48],'orderBy':orderBy});}}}_0x280587({'ok':0x1});}else _0x280587({'res':0x0});});}function createAdditionalPhone(_0x28a86c,_0x40a0db,_0x383a71,_0x2bb837){var _0x100220='';var _0x4e8273='';var _0x359c07=_0x383a71[_0x4afc('0x1b')]('§');_0x100220=_0x359c07[0x0];if(_0x359c07['length']==0x2)_0x4e8273=_0x359c07[0x1];return new Promise(function(_0xc3952e,_0x244f6c){return db[_0x4afc('0x1e')]['findOne']({'where':{'CmContactId':_0x28a86c,'item':_0x100220}})['then'](function(_0x54433f){if(_0x54433f){return db[_0x4afc('0x1e')][_0x4afc('0x1f')]({'ItemTypeId':_0x40a0db,'description':_0x4e8273,'OrderBy':_0x2bb837},{'where':{'CmContactId':_0x28a86c,'item':_0x100220}})['then'](function(_0xd26d2f){_0xc3952e({'res':_0x4afc('0x20')});});}else{return db['CmContactHasItem']['create']({'CmContactId':_0x28a86c,'item':_0x100220,'description':_0x4e8273,'ItemTypeId':_0x40a0db,'OrderBy':_0x2bb837,'ItemClass':'PHONE'})[_0x4afc('0x18')](function(_0x34434a){_0xc3952e({'res':_0x4afc('0x21')});});}});});}function insertCmHopper(_0x46357b,_0xc1d91,_0x28cd3e,_0x566389,_0x290391){var _0x3d1693=[_0x4afc('0x22'),_0x4afc('0x23'),_0x4afc('0x24'),_0x4afc('0x25'),_0xc1d91+'.'+_0x566389,_0x4afc('0x26'),_0x4afc('0x27'),'cm_contacts.priority',_0x4afc('0x28'),'\x22'+_0x290391+'\x22'];return squel['insert']()['into'](_0x4afc('0x29'))[_0x4afc('0x2a')]([_0x4afc('0xf'),_0x4afc('0x2b'),_0x4afc('0x2c'),_0x4afc('0x2d'),_0x566389,'createdAt',_0x4afc('0x2e'),_0x4afc('0x2f'),_0x4afc('0x30'),_0x4afc('0x31')],squel[_0x4afc('0x32')]()[_0x4afc('0x33')](_0x3d1693)['from'](_0xc1d91)[_0x4afc('0x10')](_0x4afc('0x34'),null,_0x4afc('0x35')+_0xc1d91+_0x4afc('0x36'))['join'](_0x28cd3e,null,_0x28cd3e+'.id\x20=\x20'+_0xc1d91+'.'+_0x566389)[_0x4afc('0x12')](_0xc1d91+_0x4afc('0x37'),_0x46357b)[_0x4afc('0x12')]('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0x4afc('0x38'),selectNotIn(_0xc1d91,_0x28cd3e,_0x566389,'cm_hopper',['\x22always\x22',_0x4afc('0x39')]))[_0x4afc('0x12')](_0x4afc('0x38'),selectNotIn(_0xc1d91,_0x28cd3e,_0x566389,_0x4afc('0x29'),[_0x4afc('0x3a')])))[_0x4afc('0x3b')]();}function insertCmHopperBlack(_0x453e12,_0x29c0df,_0x3ccc5a,_0x38f762){var _0x26e59f=[_0x4afc('0x22'),_0x4afc('0x24'),_0x4afc('0x25'),_0x29c0df+'.'+_0x38f762,_0x4afc('0x26'),'cm_contacts.updatedAt'];return squel[_0x4afc('0x3c')]()[_0x4afc('0x3d')](_0x4afc('0x3e'))[_0x4afc('0x2a')]([_0x4afc('0xf'),_0x4afc('0x2c'),_0x4afc('0x2d'),_0x38f762,'createdAt','updatedAt'],squel['select']()[_0x4afc('0x33')](_0x26e59f)[_0x4afc('0x3f')](_0x29c0df)['join'](_0x4afc('0x34'),null,_0x4afc('0x35')+_0x29c0df+_0x4afc('0x36'))[_0x4afc('0x10')](_0x3ccc5a,null,_0x3ccc5a+'.id\x20=\x20'+_0x29c0df+'.'+_0x38f762)[_0x4afc('0x12')](_0x29c0df+_0x4afc('0x37'),_0x453e12)[_0x4afc('0x12')](_0x4afc('0x40'),NOW)[_0x4afc('0x12')](_0x4afc('0x38'),squel['select']()[_0x4afc('0xe')]('phone')[_0x4afc('0x3f')](_0x4afc('0x3e'))[_0x4afc('0x12')]('ListId\x20=\x20?',_0x453e12)['where'](_0x38f762+_0x4afc('0x41'),_0x29c0df+'.'+_0x38f762)))[_0x4afc('0x3b')]();}function insertCmHopperAdditionalPhones(_0x2cf64e){var _0x12e97d=[_0x4afc('0x42'),_0x4afc('0x43'),_0x4afc('0x44'),_0x4afc('0x45'),'cm_contact_has_items.updatedAt'];return squel[_0x4afc('0x3c')]()[_0x4afc('0x3d')]('cm_hopper_additional_phones')[_0x4afc('0x2a')](['CmHopperId',_0x4afc('0xf'),_0x4afc('0x46'),_0x4afc('0x47'),'updatedAt'],squel[_0x4afc('0x32')]()[_0x4afc('0x33')](_0x12e97d)[_0x4afc('0x3f')](_0x4afc('0x29'))[_0x4afc('0x10')](_0x4afc('0x34'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')['join']('cm_contact_has_items',null,_0x4afc('0x48'))[_0x4afc('0x12')](_0x4afc('0x49'),_0x2cf64e)[_0x4afc('0x12')](_0x4afc('0x40'),NOW))[_0x4afc('0x3b')]();}function insertCmContact(_0x22e8b0,_0x41d690,_0x25347e,_0x464f94){var _0x48dbe3=_[_0x4afc('0x4a')](_['keys'](_0x464f94),['ListId',_0x4afc('0x4b'),'createdAt',_0x4afc('0x2e')]);return squel[_0x4afc('0x3c')]()[_0x4afc('0x3d')](_0x4afc('0x34'))['fromQuery'](_0x48dbe3,squel[_0x4afc('0x32')]()['fields'](_0x48dbe3)[_0x4afc('0x3f')](_0x41d690)[_0x4afc('0x12')]('('+_0x25347e[_0x4afc('0x10')](',')+_0x4afc('0x4c'),squel[_0x4afc('0x32')]()[_0x4afc('0x33')](_0x25347e)[_0x4afc('0x3f')](_0x4afc('0x34'))[_0x4afc('0x12')](_0x4afc('0x4d'),_0x22e8b0)[_0x4afc('0x12')](_0x4afc('0x4e')))['where'](_0x4afc('0x4f'),squel[_0x4afc('0x32')]()[_0x4afc('0xe')](_0x4afc('0x50'),_0x4afc('0x51'))[_0x4afc('0x3f')](_0x41d690)[_0x4afc('0x52')](_0x25347e[_0x4afc('0x10')](','))))[_0x4afc('0x3b')]();}function handleStop(){logger[_0x4afc('0x53')](_0x4afc('0x54'));stopped=!![];}function handleUncaughtException(_0x2aa927){logger[_0x4afc('0x55')](_0x2aa927['message']);process[_0x4afc('0x56')](0x1);}function handleError(_0x549ee4,_0x41ddf1){stats[_0x4afc('0x57')][_0x4afc('0x19')]({'name':_0x41ddf1[_0x4afc('0x58')],'message':_0x41ddf1['message'],'row':_0x549ee4});}function handleQuery(_0x486c23){logger[_0x4afc('0x53')](_0x486c23);return db[_0x4afc('0x59')]['query'](_0x486c23)[_0x4afc('0x5a')](function(_0x3af52c){results[_0x4afc('0x19')](_0x3af52c);})[_0x4afc('0x5b')](function(_0x329550){logger[_0x4afc('0x55')](_0x329550[_0x4afc('0x5c')]);});}function main(_0x13891d,_0x24e1d3,_0x3369a8,_0x4295a5){logger[_0x4afc('0x53')](_0x4afc('0x5d'),_0x13891d,JSON[_0x4afc('0x5e')](_0x24e1d3));process['send'](_0x4afc('0x5f'));var _0x59fb43=_0x24e1d3[_0x4afc('0x60')];var _0x19cb0b=_[_0x4afc('0x61')](_0x59fb43);var _0x41bd77=_0x24e1d3[_0x4afc('0x62')];var _0x4985c6=path[_0x4afc('0x10')](config[_0x4afc('0x63')],'server/files/tmp',_0x41bd77+'.csv');logger[_0x4afc('0x53')](_0x4afc('0x64'),_0x24e1d3);db[_0x4afc('0x65')][_0x4afc('0x16')]({'raw':!![],'attributes':['id',_0x4afc('0x66')]})[_0x4afc('0x18')](function(_0x37cfa6){for(var _0x3c81df=0x0;_0x3c81df<_0x37cfa6[_0x4afc('0x1c')];_0x3c81df++){if(_0x37cfa6[_0x3c81df][_0x4afc('0x66')]in _0x59fb43){contactItemTypes['push'](_0x37cfa6[_0x3c81df]);delete _0x19cb0b[_0x37cfa6[_0x3c81df]['name']];hasAdditionalPhones=!![];}for(var _0x458533 in _0x59fb43){if(_0x37cfa6[_0x3c81df][_0x4afc('0x66')]+'_description'===_0x458533){phoneDescriptions[_0x4afc('0x19')]({'itemTypeId':_0x37cfa6[_0x3c81df]['id'],'description':_0x458533});delete _0x19cb0b[_0x458533];}}}if(hasAdditionalPhones)_0x19cb0b[_0x4afc('0x17')]='';var _0x5be1a7=_['keys'](_0x19cb0b)[_0x4afc('0x10')]();logger[_0x4afc('0x53')](_0x4afc('0x67'),_0x5be1a7);fs['writeFileSync'](_0x4985c6,_0x5be1a7+'\x0a');Papa[_0x4afc('0x68')](fs['createReadStream'](_0x13891d),{'header':!![],'skipEmptyLines':!![],'step':function(_0x5a2be2,_0x10e5c6){try{for(var _0x37b5aa=0x0,_0x53f9ca=[];_0x37b5aa<_0x5a2be2[_0x4afc('0x69')][_0x4afc('0x1c')];_0x37b5aa++){stats[_0x4afc('0x6a')]+=0x1;if(_0x5a2be2[_0x4afc('0x57')][_0x37b5aa]){handleError(_0x5a2be2[_0x4afc('0x69')][_0x37b5aa],_0x5a2be2[_0x4afc('0x57')][_0x37b5aa]);}else{var _0x4a616e=[];var _0x25969c=[];var _0x1e8f64={};for(var _0x14e13e in _0x59fb43){let _0x4a014d=contactItemTypes['find'](_0x4a8d2c=>_0x4a8d2c[_0x4afc('0x66')]===_0x14e13e);let _0x135931=contactItemTypes[_0x4afc('0x6b')](_0x559a29=>_0x559a29[_0x4afc('0x66')]+'_description'===_0x14e13e);if(_['isNil'](_0x4a014d)&&_['isNil'](_0x135931)){if(_0x59fb43[_0x4afc('0x6c')](_0x14e13e)){if(_0x5a2be2[_0x4afc('0x69')][_0x37b5aa][_0x59fb43[_0x14e13e]]){var _0x1354f1=_['trim'](_0x5a2be2[_0x4afc('0x69')][_0x37b5aa][_0x59fb43[_0x14e13e]][_0x4afc('0x6d')](/"/g,'\x27'));switch(_0x14e13e){case _0x4afc('0x2b'):var _0x5e3e9b=moment(_0x1354f1,_0x4afc('0xc'),!![]);if(_0x5e3e9b[_0x4afc('0x6e')]()){_0x53f9ca[_0x4afc('0x19')]('\x22'+_0x1354f1+'\x22');}else{_0x4a616e[_0x4afc('0x19')](_0x4afc('0x6f'));}break;case'priority':var _0x549e31=parseInt(_0x1354f1);_0x1354f1=_[_0x4afc('0x70')](_0x549e31)||_0x549e31<0x0||_0x549e31>0x4?_0x4295a5?0x3:0x2:_0x549e31;_0x53f9ca[_0x4afc('0x19')]('\x22'+_0x1354f1+'\x22');break;case _0x4afc('0x30'):var _0x5dd264=parseInt(_0x1354f1);if(_[_0x4afc('0x71')](_0x5dd264)&&_[_0x4afc('0x72')](_0x3369a8,_0x5dd264)){_0x53f9ca[_0x4afc('0x19')]('\x22'+_0x5dd264+'\x22');}else{_0x4a616e[_0x4afc('0x19')](_0x4afc('0x73'));}break;case'email':if(isEmail(_0x1354f1)){_0x53f9ca[_0x4afc('0x19')]('\x22'+_0x1354f1+'\x22');}else{_0x4a616e[_0x4afc('0x19')]('email\x20wrong\x20format');}break;case _0x4afc('0x74'):var _0x3539ff=moment(_0x1354f1,_0x4afc('0x75'),!![]);if(_0x3539ff['isValid']()){_0x53f9ca[_0x4afc('0x19')]('\x22'+_0x1354f1+'\x22');}else{_0x4a616e[_0x4afc('0x19')](_0x4afc('0x76'));}break;default:_0x53f9ca[_0x4afc('0x19')]('\x22'+_0x1354f1+'\x22');}}else{switch(_0x14e13e){case _0x4afc('0x77'):case _0x4afc('0xf'):_0x4a616e[_0x4afc('0x19')](_0x14e13e+_0x4afc('0x78'));break;default:_0x53f9ca['push']('\x22\x22');}}}}else{var _0x457b2c='';if(!_['isNil'](_0x4a014d)){if(!_0x1e8f64['hasOwnProperty'](_0x4a014d['id'])){if(!_[_0x4afc('0x79')](_0x5a2be2[_0x4afc('0x69')][_0x37b5aa][_0x59fb43[_0x14e13e]])){var _0x1354f1=_['trim'](_0x5a2be2['data'][_0x37b5aa][_0x59fb43[_0x14e13e]][_0x4afc('0x6d')](/"/g,'\x27'));var _0x222e68=phoneDescriptions[_0x4afc('0x6b')](_0xb34abf=>_0xb34abf[_0x4afc('0x7a')]===_0x4a014d['id']);if(!_[_0x4afc('0x79')](_0x222e68)){var _0x4701ca=_[_0x4afc('0x7b')](_0x5a2be2[_0x4afc('0x69')][_0x37b5aa][_0x59fb43[_0x222e68[_0x4afc('0x7c')]]][_0x4afc('0x6d')](/"/g,'\x27'));if(!_[_0x4afc('0x79')](_0x4701ca))_0x1354f1=_0x1354f1+'§'+_0x4701ca;}if(_0x457b2c=='')_0x457b2c=_0x1354f1;else _0x457b2c+='|'+_0x1354f1;}_0x25969c[_0x4afc('0x19')](_0x4a014d['id']+':'+_0x457b2c);_0x1e8f64[_0x4a014d['id']]=0x1;}}}}if(hasAdditionalPhones){_0x53f9ca[_0x4afc('0x19')]('\x22'+_0x25969c[_0x4afc('0x10')](';')+'\x22');}if(_0x4a616e[_0x4afc('0x1c')]){handleError(_0x5a2be2['data'][_0x37b5aa],{'code':_0x4afc('0x7d'),'message':_0x4a616e[_0x4afc('0x10')]()});}else{fs[_0x4afc('0x7e')](_0x4985c6,_0x53f9ca[_0x4afc('0x10')]()+'\x0a');}_0x53f9ca=[];}if(!(stats[_0x4afc('0x6a')]%0xc8)){socket[_0x4afc('0x7f')](_0x4afc('0x80')+_0x41bd77,stats);stats[_0x4afc('0x57')]=[];}}if(stopped){logger[_0x4afc('0x53')]('Abort\x20parser');_0x10e5c6[_0x4afc('0x81')]();}}catch(_0x370b10){handleError(_0x5a2be2[_0x4afc('0x69')][_0x37b5aa],{'code':_0x4afc('0x82'),'message':_0x370b10['message']});logger[_0x4afc('0x55')](_0x4afc('0x83'),_0x370b10[_0x4afc('0x5c')]);}},'complete':function(){try{var _0x4956b2=[];var _0x46fe52=_0x4afc('0x34');if(_0x24e1d3[_0x4afc('0x84')]&&_0x24e1d3[_0x4afc('0x84')][_0x4afc('0x1c')]){_0x46fe52=_0x4afc('0x85')+_0x41bd77;_0x4956b2['push'](_0x4afc('0x86')+_0x46fe52+_0x4afc('0x87'));}var _0x561a88=util[_0x4afc('0xb')](_0x4afc('0x88'),_0x4985c6,_0x46fe52,_0x5be1a7,_0x24e1d3[_0x4afc('0x2d')],_0x24e1d3['CompanyId']||null,NOW,NOW);if(_[_0x4afc('0x79')](_0x59fb43[_0x4afc('0x2b')])){_0x561a88+=_0x4afc('0x89');}_0x4956b2[_0x4afc('0x19')](_0x561a88);if(_0x24e1d3['duplicates']&&_0x24e1d3[_0x4afc('0x84')][_0x4afc('0x1c')]){_0x4956b2['push'](insertCmContact(_0x24e1d3[_0x4afc('0x2d')],_0x46fe52,_0x24e1d3[_0x4afc('0x84')],_0x59fb43));_0x4956b2[_0x4afc('0x19')]('DROP\x20TABLE\x20'+_0x46fe52+';');}BPromise['each'](_0x4956b2,handleQuery)[_0x4afc('0x18')](function(_0x41116b){BPromise[_0x4afc('0x1a')]([handleAdditionalPhones()])[_0x4afc('0x18')](function(){_0x4956b2=[];for(var _0x109526=0x0;_0x109526_0x244846[_0x8eff('0x64')]===_0x34b2e5);let _0xcc85ff=contactItemTypes['find'](_0x593a18=>_0x593a18[_0x8eff('0x64')]+'_description'===_0x34b2e5);if(_['isNil'](_0x62ec49)&&_['isNil'](_0xcc85ff)){if(_0x3bfeac[_0x8eff('0x6c')](_0x34b2e5)){if(_0x31d711[_0x8eff('0x68')][_0x56c996][_0x3bfeac[_0x34b2e5]]){var _0x2a15ba=_[_0x8eff('0x6d')](_0x31d711[_0x8eff('0x68')][_0x56c996][_0x3bfeac[_0x34b2e5]][_0x8eff('0x6e')](/"/g,'\x27'));switch(_0x34b2e5){case _0x8eff('0x6f'):var _0x2bb23a=moment(_0x2a15ba,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x2bb23a[_0x8eff('0x70')]()){_0xc70ecc['push']('\x22'+_0x2a15ba+'\x22');}else{_0x58c9e6[_0x8eff('0x1a')](_0x8eff('0x71'));}break;case _0x8eff('0x2e'):var _0x225703=parseInt(_0x2a15ba);_0x2a15ba=_[_0x8eff('0x72')](_0x225703)||_0x225703<0x0||_0x225703>0x4?_0xa6355e?0x3:0x2:_0x225703;_0xc70ecc[_0x8eff('0x1a')]('\x22'+_0x2a15ba+'\x22');break;case'UserId':var _0x3db0d8=parseInt(_0x2a15ba);if(_['isNumber'](_0x3db0d8)&&_[_0x8eff('0x73')](_0x3d82b6,_0x3db0d8)){_0xc70ecc[_0x8eff('0x1a')]('\x22'+_0x3db0d8+'\x22');}else{_0x58c9e6[_0x8eff('0x1a')](_0x8eff('0x74'));}break;case _0x8eff('0x75'):if(isEmail(_0x2a15ba)){_0xc70ecc[_0x8eff('0x1a')]('\x22'+_0x2a15ba+'\x22');}else{_0x58c9e6[_0x8eff('0x1a')](_0x8eff('0x76'));}break;case _0x8eff('0x77'):var _0x592ae5=moment(_0x2a15ba,_0x8eff('0x78'),!![]);if(_0x592ae5[_0x8eff('0x70')]()){_0xc70ecc[_0x8eff('0x1a')]('\x22'+_0x2a15ba+'\x22');}else{_0x58c9e6[_0x8eff('0x1a')](_0x8eff('0x79'));}break;default:_0xc70ecc[_0x8eff('0x1a')]('\x22'+_0x2a15ba+'\x22');}}else{switch(_0x34b2e5){case _0x8eff('0x7a'):case _0x8eff('0x2c'):_0x58c9e6[_0x8eff('0x1a')](_0x34b2e5+_0x8eff('0x7b'));break;default:_0xc70ecc['push']('\x22\x22');}}}}else{var _0x503527='';if(!_['isNil'](_0x62ec49)){if(!_0x3d34c0['hasOwnProperty'](_0x62ec49['id'])){if(!_[_0x8eff('0x7c')](_0x31d711[_0x8eff('0x68')][_0x56c996][_0x3bfeac[_0x34b2e5]])){var _0x2a15ba=_[_0x8eff('0x6d')](_0x31d711[_0x8eff('0x68')][_0x56c996][_0x3bfeac[_0x34b2e5]][_0x8eff('0x6e')](/"/g,'\x27'));var _0x2e9b26=phoneDescriptions['find'](_0x15473b=>_0x15473b[_0x8eff('0x7d')]===_0x62ec49['id']);if(!_[_0x8eff('0x7c')](_0x2e9b26)){var _0x36248c=_['trim'](_0x31d711[_0x8eff('0x68')][_0x56c996][_0x3bfeac[_0x2e9b26[_0x8eff('0x7e')]]]['replace'](/"/g,'\x27'));if(!_[_0x8eff('0x7c')](_0x36248c))_0x2a15ba=_0x2a15ba+'§'+_0x36248c;}if(_0x503527=='')_0x503527=_0x2a15ba;else _0x503527+='|'+_0x2a15ba;}_0x479a4b[_0x8eff('0x1a')](_0x62ec49['id']+':'+_0x503527);_0x3d34c0[_0x62ec49['id']]=0x1;}}}}if(hasAdditionalPhones){_0xc70ecc[_0x8eff('0x1a')]('\x22'+_0x479a4b['join'](';')+'\x22');}if(_0x58c9e6['length']){handleError(_0x31d711['data'][_0x56c996],{'code':_0x8eff('0x7f'),'message':_0x58c9e6[_0x8eff('0x11')]()});}else{fs[_0x8eff('0x80')](_0x4064bd,_0xc70ecc[_0x8eff('0x11')]()+'\x0a');}_0xc70ecc=[];}if(!(stats[_0x8eff('0x69')]%0xc8)){socket[_0x8eff('0x81')](_0x8eff('0x82')+_0x11f1f9,stats);stats[_0x8eff('0x6a')]=[];}}if(stopped){logger[_0x8eff('0x59')](_0x8eff('0x83'));_0x1bff1[_0x8eff('0x84')]();}}catch(_0x5c8a83){handleError(_0x31d711[_0x8eff('0x68')][_0x56c996],{'code':'SystemError','message':_0x5c8a83[_0x8eff('0x56')]});logger[_0x8eff('0x55')]('step',_0x5c8a83[_0x8eff('0x56')]);}},'complete':function(){try{var _0x536b6f=[];var _0x35cb3b=_0x8eff('0x31');if(_0xfecdd8[_0x8eff('0x85')]&&_0xfecdd8[_0x8eff('0x85')][_0x8eff('0x19')]){_0x35cb3b='cm_contacts_'+_0x11f1f9;_0x536b6f[_0x8eff('0x1a')](_0x8eff('0x86')+_0x35cb3b+_0x8eff('0x87'));}var _0x19768b=util[_0x8eff('0xc')](_0x8eff('0x88'),_0x4064bd,_0x35cb3b,_0x545dd8,_0xfecdd8[_0x8eff('0x3e')],_0xfecdd8[_0x8eff('0x4e')]||null,NOW,NOW);if(_[_0x8eff('0x7c')](_0x3bfeac[_0x8eff('0x6f')])){_0x19768b+=_0x8eff('0x89');}_0x536b6f['push'](_0x19768b);if(_0xfecdd8[_0x8eff('0x85')]&&_0xfecdd8[_0x8eff('0x85')][_0x8eff('0x19')]){_0x536b6f[_0x8eff('0x1a')](insertCmContact(_0xfecdd8[_0x8eff('0x3e')],_0x35cb3b,_0xfecdd8['duplicates'],_0x3bfeac));_0x536b6f[_0x8eff('0x1a')](_0x8eff('0x8a')+_0x35cb3b+';');}BPromise['each'](_0x536b6f,handleQuery)['then'](function(_0x1e7522){BPromise[_0x8eff('0x1b')]([handleAdditionalPhones()])[_0x8eff('0x18')](function(){_0x536b6f=[];for(var _0xe31924=0x0;_0xe31924\x20\x20');}var _0x52f6e0=path[_0x8eff('0x11')](config[_0x8eff('0x60')],_0x8eff('0x61'),process[_0x8eff('0x99')][0x2]);if(!fs[_0x8eff('0x9a')](_0x52f6e0)){throw new Error(_0x8eff('0x9b'));}var _0x354676={};try{_0x354676=JSON[_0x8eff('0x67')](process[_0x8eff('0x99')][0x3]);if(!_0x354676[_0x8eff('0x5e')]){throw new Error(_0x8eff('0x9c'));}if(!_0x354676[_0x8eff('0x5e')]['phone']){throw new Error(_0x8eff('0x9d'));}if(!_0x354676[_0x8eff('0x5e')][_0x8eff('0x7a')]){throw new Error(_0x8eff('0x9e'));}var _0x134946=0x0;if(_0x354676['binding'][_0x8eff('0x9f')]){_0x134946=0x1;}if(!_0x354676[_0x8eff('0x3e')]){throw new Error(_0x8eff('0xa0'));}}catch(_0x1278f2){throw new Error('body\x20id\x20mandatory');}var _0x5db7b8=[];try{_0x5db7b8=_[_0x8eff('0xa1')](JSON[_0x8eff('0x67')](process[_0x8eff('0x99')][0x4]),'id');}catch(_0x32d427){logger['info'](_0x8eff('0xa2'));}main(_0x52f6e0,_0x354676,_0x5db7b8,_0x134946);}validate();process['on'](_0x8eff('0xa3'),handleStop);process['on'](_0x8eff('0xa4'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/import/cm/csvUpdates.js b/server/components/import/cm/csvUpdates.js index 70e139c..1e039ac 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 _0x56c8=['select\x20*\x20from\x20','spread','length','isNil','AdditionalPhones','push','all','then','catch','error','message','split','filter','CmContactHasItem','findOne','updated','create','PHONE','inserted','update','CmHopper','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.priority','insert','into','cm_hopper','fromQuery','ContactId','ListId','createdAt','updatedAt','priority','recallme','fields','.CmListId','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.createdAt','cm_contacts.updatedAt','cm_hopper_black','cm_contacts.ListId\x20=\x20','cm_contacts.createdAt\x20=\x20?','field','\x20=\x20?','toString','cm_hopper.id','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','cm_contacts','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','CompanyId',')\x20NOT\x20IN\x20?','ListId\x20=\x20?','id\x20IN\x20?','min_id','info','exit','code','main','stringify','send','start','binding','clone','root','server/files/tmp','.csv','body','ContactItemType','findAll','name','_description','header','writeFileSync','parse','createReadStream','rows','errors','data','find','trim','replace','scheduledat','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','includes','email\x20wrong\x20format','dateOfBirth','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','hasOwnProperty','itemTypeId','description','SystemRow','emit','contact:import:','Abort\x20parser','SystemError','step','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','CIS\x20len',',\x20scheduledAt\x20=\x20NOW()','each','contact','contactId','contactTypeId','orderBy','DROP\x20TABLE\x20','finish','unlink','complete','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','path','lodash','papaparse','util','moment','squel','ioredis','../../../mysqldb','../../../config/environment','import','redis','defaults','localhost','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','format','select','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','sequelize','query'];(function(_0xd2f4ac,_0x5aa8e5){var _0x9757b2=function(_0x442ced){while(--_0x442ced){_0xd2f4ac['push'](_0xd2f4ac['shift']());}};_0x9757b2(++_0x5aa8e5);}(_0x56c8,0x12f));var _0x856c=function(_0x20669b,_0x1468ea){_0x20669b=_0x20669b-0x0;var _0x37d52f=_0x56c8[_0x20669b];return _0x37d52f;};'use strict';var fs=require('fs');var path=require(_0x856c('0x0'));var _=require(_0x856c('0x1'));var Papa=require(_0x856c('0x2'));var util=require(_0x856c('0x3'));var BPromise=require('bluebird');var moment=require(_0x856c('0x4'));var squel=require(_0x856c('0x5'));var Redis=require(_0x856c('0x6'));var db=require(_0x856c('0x7'))['db'];var config=require(_0x856c('0x8'));var logger=require('../../../config/logger')(_0x856c('0x9'));config[_0x856c('0xa')]=_[_0x856c('0xb')](config[_0x856c('0xa')],{'host':_0x856c('0xc'),'port':0x18eb});var socket=require(_0x856c('0xd'))(new Redis(config['redis']));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()['format'](_0x856c('0xe'));var tempTableName=_0x856c('0xf')+moment()[_0x856c('0x10')]('YYYYMMDDHHmmss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x4b8bbc){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))*$/['test'](_0x4b8bbc);}function selectNotIn(_0x619489,_0x36e8ef,_0x3bf8f1,_0x5082f3,_0x134cc9){return squel[_0x856c('0x11')]()['field'](_0x856c('0x12'))[_0x856c('0x13')](_0x5082f3)[_0x856c('0x14')](_0x36e8ef,null,_0x36e8ef+_0x856c('0x15')+_0x5082f3+'.'+_0x3bf8f1)[_0x856c('0x16')](_0x5082f3+'.'+_0x3bf8f1+_0x856c('0x17')+_0x619489+'.'+_0x3bf8f1)[_0x856c('0x16')](_0x36e8ef+_0x856c('0x18')+_0x134cc9['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x45213f,_0x5307b7){promisesAdditionalPhones=[];promisesContact=[];return db[_0x856c('0x19')][_0x856c('0x1a')](_0x856c('0x1b')+tempTableName)[_0x856c('0x1c')](function(_0x6856e5){if(_0x6856e5!==null){var _0x13f1ae=[];for(var _0x26aba6=0x0;_0x26aba6<_0x6856e5[_0x856c('0x1d')];_0x26aba6++){var _0x250996=_0x6856e5[_0x26aba6];if(!_[_0x856c('0x1e')](_0x250996[_0x856c('0x12')])){if(!_[_0x856c('0x1e')](_0x250996[_0x856c('0x1f')]))_0x13f1ae[_0x856c('0x20')](insertAdditionalPhones(_0x250996));promisesContact[_0x856c('0x20')]({'contact':_0x250996});}}}Promise[_0x856c('0x21')](_0x13f1ae)[_0x856c('0x22')](function(){_0x45213f({'val':0x1});});})[_0x856c('0x23')](function(_0x248330){logger[_0x856c('0x24')](_0x248330[_0x856c('0x25')]);});});}function insertAdditionalPhones(_0x1dd835){return new Promise(function(_0x4c42e0,_0x51ce3a){var _0x9b678d=_0x1dd835[_0x856c('0x1f')];if(_[_0x856c('0x1e')](_0x9b678d))_0x51ce3a({'val':0x0});else{var _0x55b2d1=_0x9b678d[_0x856c('0x26')](';');var _0x4be642=[];orderBy=0x0;for(var _0x202357=0x0;_0x202357<_0x55b2d1[_0x856c('0x1d')];_0x202357++){_0x4be642[_0x856c('0x20')](splitAdditionalPhone(_0x1dd835['id'],_0x55b2d1[_0x202357]));}Promise['all'](_0x4be642)[_0x856c('0x22')](function(){_0x4c42e0({'val':_0x55b2d1[_0x856c('0x1d')]});});}});}function splitAdditionalPhone(_0x3984a7,_0x106e38){return new Promise(function(_0x901a0c,_0x3b2f35){var _0x571953=_0x106e38[_0x856c('0x26')](':');var _0x16678d=_0x571953[0x0];var _0x4150ec=_0x571953[0x1];if(_0x4150ec!==''){var _0x47e45c=_0x4150ec[_0x856c('0x26')]('|');var _0x56caca=[];for(var _0x1544d4=0x0;_0x1544d4<_0x47e45c['length'];_0x1544d4++){if(_0x47e45c[_0x1544d4]!==''){var _0x3d38d4=_[_0x856c('0x27')](promisesAdditionalPhones,{'contactId':_0x3984a7,'phone':_0x47e45c[_0x1544d4]});if(_0x3d38d4['length']==0x0){orderBy++;promisesAdditionalPhones[_0x856c('0x20')]({'contactId':_0x3984a7,'contactTypeId':_0x16678d,'phone':_0x47e45c[_0x1544d4],'orderBy':orderBy});}}}_0x901a0c({'ok':0x1});}else _0x901a0c({'res':0x0});});}function createAdditionalPhone(_0x514d6c,_0x1a0a48,_0x384f5f,_0x21db5d){var _0x4f3d41='';var _0x34429e='';var _0x3548ab=_0x384f5f[_0x856c('0x26')]('§');_0x4f3d41=_0x3548ab[0x0];if(_0x3548ab['length']==0x2)_0x34429e=_0x3548ab[0x1];return new Promise(function(_0x4b45c6,_0x3eaced){return db[_0x856c('0x28')][_0x856c('0x29')]({'where':{'CmContactId':_0x514d6c,'item':_0x4f3d41}})[_0x856c('0x22')](function(_0x39ab90){if(_0x39ab90){return db[_0x856c('0x28')]['update']({'ItemTypeId':_0x1a0a48,'description':_0x34429e,'OrderBy':_0x21db5d},{'where':{'CmContactId':_0x514d6c,'item':_0x4f3d41}})[_0x856c('0x22')](function(_0x866950){_0x4b45c6({'res':_0x856c('0x2a')});});}else{return db[_0x856c('0x28')][_0x856c('0x2b')]({'CmContactId':_0x514d6c,'item':_0x4f3d41,'ItemTypeId':_0x1a0a48,'description':_0x34429e,'OrderBy':_0x21db5d,'ItemClass':_0x856c('0x2c')})['then'](function(_0x11299d){_0x4b45c6({'res':_0x856c('0x2d')});});}});});}function updateContact(_0x3df0c6){return new Promise(function(_0x56a441,_0x184415){var _0x32daae=_0x3df0c6['id'];delete _0x3df0c6['id'];return db['CmContact'][_0x856c('0x2e')](_0x3df0c6,{'where':{'id':_0x32daae}})[_0x856c('0x22')](function(_0x661f89){updatedRows+=0x1;return db[_0x856c('0x2f')][_0x856c('0x2e')]({'phone':_0x3df0c6['phone']},{'where':{'ContactId':_0x32daae}})[_0x856c('0x22')](function(_0x943463){_0x56a441({'ret':'OK'});});});});}function insertCmHopper(_0x264cd8,_0x26cd75,_0x19acd5,_0x3292b8,_0x106cb3){var _0x1b81ba=[_0x856c('0x30'),_0x856c('0x31'),_0x856c('0x32'),_0x856c('0x33'),_0x26cd75+'.'+_0x3292b8,'cm_contacts.createdAt','cm_contacts.updatedAt',_0x856c('0x34'),'cm_contacts.UserId','\x22'+_0x106cb3+'\x22'];return squel[_0x856c('0x35')]()[_0x856c('0x36')](_0x856c('0x37'))[_0x856c('0x38')]([_0x856c('0x12'),'scheduledat',_0x856c('0x39'),_0x856c('0x3a'),_0x3292b8,_0x856c('0x3b'),_0x856c('0x3c'),_0x856c('0x3d'),'UserId',_0x856c('0x3e')],squel[_0x856c('0x11')]()[_0x856c('0x3f')](_0x1b81ba)[_0x856c('0x13')](_0x26cd75)[_0x856c('0x14')]('cm_contacts',null,'cm_contacts.ListId\x20=\x20'+_0x26cd75+_0x856c('0x40'))[_0x856c('0x14')](_0x19acd5,null,_0x19acd5+_0x856c('0x15')+_0x26cd75+'.'+_0x3292b8)['where'](_0x26cd75+_0x856c('0x41'),_0x264cd8)[_0x856c('0x16')]('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0x856c('0x42'),selectNotIn(_0x26cd75,_0x19acd5,_0x3292b8,_0x856c('0x37'),[_0x856c('0x43'),_0x856c('0x44')]))[_0x856c('0x16')](_0x856c('0x42'),selectNotIn(_0x26cd75,_0x19acd5,_0x3292b8,_0x856c('0x37'),['\x22always\x22'])))['toString']();}function insertCmHopperBlack(_0x353d3f,_0x487fb6,_0x10c6d6,_0x29234d){var _0x2821ae=[_0x856c('0x30'),'cm_contacts.id',_0x856c('0x33'),_0x487fb6+'.'+_0x29234d,_0x856c('0x45'),_0x856c('0x46')];return squel[_0x856c('0x35')]()[_0x856c('0x36')](_0x856c('0x47'))[_0x856c('0x38')]([_0x856c('0x12'),'ContactId',_0x856c('0x3a'),_0x29234d,_0x856c('0x3b'),_0x856c('0x3c')],squel['select']()[_0x856c('0x3f')](_0x2821ae)[_0x856c('0x13')](_0x487fb6)[_0x856c('0x14')]('cm_contacts',null,_0x856c('0x48')+_0x487fb6+_0x856c('0x40'))['join'](_0x10c6d6,null,_0x10c6d6+_0x856c('0x15')+_0x487fb6+'.'+_0x29234d)[_0x856c('0x16')](_0x487fb6+_0x856c('0x41'),_0x353d3f)[_0x856c('0x16')](_0x856c('0x49'),NOW)[_0x856c('0x16')](_0x856c('0x42'),squel[_0x856c('0x11')]()[_0x856c('0x4a')](_0x856c('0x12'))[_0x856c('0x13')](_0x856c('0x47'))[_0x856c('0x16')]('ListId\x20=\x20?',_0x353d3f)[_0x856c('0x16')](_0x29234d+_0x856c('0x4b'),_0x487fb6+'.'+_0x29234d)))[_0x856c('0x4c')]();}function insertCmHopperAdditionalPhones(_0x9e9f27){var _0x23d403=[_0x856c('0x4d'),'cm_contact_has_items.item',_0x856c('0x4e'),_0x856c('0x4f'),_0x856c('0x50')];return squel[_0x856c('0x35')]()['into'](_0x856c('0x51'))['fromQuery']([_0x856c('0x52'),_0x856c('0x12'),'OrderBy','createdAt',_0x856c('0x3c')],squel['select']()['fields'](_0x23d403)[_0x856c('0x13')](_0x856c('0x37'))[_0x856c('0x14')](_0x856c('0x53'),null,_0x856c('0x54'))[_0x856c('0x14')](_0x856c('0x55'),null,_0x856c('0x56'))[_0x856c('0x16')](_0x856c('0x57'),_0x9e9f27)['where'](_0x856c('0x49'),NOW))[_0x856c('0x4c')]();}function insertCmContact(_0x4b1955,_0x24b805,_0x4f3fc9,_0xfef2ae){var _0x4bea93=_[_0x856c('0x58')](_[_0x856c('0x59')](_0xfef2ae),[_0x856c('0x3a'),_0x856c('0x5a'),_0x856c('0x3b'),_0x856c('0x3c')]);return squel['insert']()[_0x856c('0x36')](_0x856c('0x53'))[_0x856c('0x38')](_0x4bea93,squel[_0x856c('0x11')]()[_0x856c('0x3f')](_0x4bea93)[_0x856c('0x13')](_0x24b805)[_0x856c('0x16')]('('+_0x4f3fc9[_0x856c('0x14')](',')+_0x856c('0x5b'),squel[_0x856c('0x11')]()[_0x856c('0x3f')](_0x4f3fc9)[_0x856c('0x13')](_0x856c('0x53'))['where'](_0x856c('0x5c'),_0x4b1955))['where'](_0x856c('0x5d'),squel[_0x856c('0x11')]()[_0x856c('0x4a')]('MIN(id)',_0x856c('0x5e'))['from'](_0x24b805)['group'](_0x4f3fc9['join'](','))))[_0x856c('0x4c')]();}function handleStop(){logger[_0x856c('0x5f')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0xcbec5b){logger[_0x856c('0x24')](_0xcbec5b[_0x856c('0x25')]);process[_0x856c('0x60')](0x1);}function handleError(_0x1e3978,_0x2ae5cb){stats['errors'][_0x856c('0x20')]({'name':_0x2ae5cb[_0x856c('0x61')],'message':_0x2ae5cb[_0x856c('0x25')],'row':_0x1e3978});}function handleQuery(_0x42ebe9){logger[_0x856c('0x5f')](_0x42ebe9);return db[_0x856c('0x19')][_0x856c('0x1a')](_0x42ebe9)['spread'](function(_0x38f8b1){results['push'](_0x38f8b1);})[_0x856c('0x23')](function(_0x5dda99){logger[_0x856c('0x24')](_0x5dda99[_0x856c('0x25')]);});}function main(_0x5a96da,_0x3b8e15,_0x33b699,_0x2fc1e1){logger[_0x856c('0x5f')](_0x856c('0x62'),_0x5a96da,JSON[_0x856c('0x63')](_0x3b8e15));process[_0x856c('0x64')](_0x856c('0x65'));var _0x5bfec7=_0x3b8e15[_0x856c('0x66')];var _0x45d26f=_[_0x856c('0x67')](_0x5bfec7);var _0x187b13=_0x3b8e15['socket_timestamp'];var _0x2b73ac=path['join'](config[_0x856c('0x68')],_0x856c('0x69'),_0x187b13+_0x856c('0x6a'));logger['info'](_0x856c('0x6b'),_0x3b8e15);db[_0x856c('0x6c')][_0x856c('0x6d')]({'raw':!![],'attributes':['id',_0x856c('0x6e')]})[_0x856c('0x22')](function(_0x30bf83){for(var _0x1698da=0x0;_0x1698da<_0x30bf83[_0x856c('0x1d')];_0x1698da++){if(_0x30bf83[_0x1698da][_0x856c('0x6e')]in _0x5bfec7){contactItemTypes[_0x856c('0x20')](_0x30bf83[_0x1698da]);delete _0x45d26f[_0x30bf83[_0x1698da][_0x856c('0x6e')]];hasAdditionalPhones=!![];}for(var _0x3c4136 in _0x5bfec7){if(_0x30bf83[_0x1698da]['name']+_0x856c('0x6f')===_0x3c4136){phoneDescriptions[_0x856c('0x20')]({'itemTypeId':_0x30bf83[_0x1698da]['id'],'description':_0x3c4136});delete _0x45d26f[_0x3c4136];}}}if(hasAdditionalPhones)_0x45d26f[_0x856c('0x1f')]='';var _0x219a6a=_[_0x856c('0x59')](_0x45d26f)[_0x856c('0x14')]();logger['info'](_0x856c('0x70'),_0x219a6a);fs[_0x856c('0x71')](_0x2b73ac,_0x219a6a+'\x0a');Papa[_0x856c('0x72')](fs[_0x856c('0x73')](_0x5a96da),{'header':!![],'skipEmptyLines':!![],'step':function(_0x40eacb,_0x1b5231){try{for(var _0x3dbbf3=0x0,_0x55646e=[];_0x3dbbf3<_0x40eacb['data'][_0x856c('0x1d')];_0x3dbbf3++){stats[_0x856c('0x74')]+=0x1;if(_0x40eacb[_0x856c('0x75')][_0x3dbbf3]){handleError(_0x40eacb[_0x856c('0x76')][_0x3dbbf3],_0x40eacb[_0x856c('0x75')][_0x3dbbf3]);}else{var _0x4104c0=[];var _0x4c4ca8=[];var _0x57dd5d={};for(var _0xafcbcf in _0x5bfec7){let _0x2dfe54=contactItemTypes['find'](_0x1cee76=>_0x1cee76[_0x856c('0x6e')]===_0xafcbcf);let _0xa2443b=contactItemTypes[_0x856c('0x77')](_0x5e170f=>_0x5e170f[_0x856c('0x6e')]+_0x856c('0x6f')===_0xafcbcf);if(_[_0x856c('0x1e')](_0x2dfe54)&&_[_0x856c('0x1e')](_0xa2443b)){if(_0x5bfec7['hasOwnProperty'](_0xafcbcf)){if(_0x40eacb[_0x856c('0x76')][_0x3dbbf3][_0x5bfec7[_0xafcbcf]]){var _0x476c55=_[_0x856c('0x78')](_0x40eacb[_0x856c('0x76')][_0x3dbbf3][_0x5bfec7[_0xafcbcf]][_0x856c('0x79')](/"/g,'\x27'));switch(_0xafcbcf){case _0x856c('0x7a'):var _0x1f4ff8=moment(_0x476c55,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x1f4ff8[_0x856c('0x7b')]()){_0x55646e['push']('\x22'+_0x476c55+'\x22');}else{_0x4104c0['push'](_0x856c('0x7c'));}break;case _0x856c('0x3d'):var _0x4db91e=parseInt(_0x476c55);_0x476c55=_[_0x856c('0x7d')](_0x4db91e)||_0x4db91e<0x0||_0x4db91e>0x4?_0x2fc1e1?0x3:0x2:_0x4db91e;_0x55646e[_0x856c('0x20')]('\x22'+_0x476c55+'\x22');break;case'UserId':var _0x435225=parseInt(_0x476c55);if(_[_0x856c('0x7e')](_0x435225)&&_[_0x856c('0x7f')](_0x33b699,_0x435225)){_0x55646e[_0x856c('0x20')]('\x22'+_0x435225+'\x22');}else{_0x4104c0[_0x856c('0x20')]('agent\x20not\x20exists');}break;case'email':if(isEmail(_0x476c55)){_0x55646e[_0x856c('0x20')]('\x22'+_0x476c55+'\x22');}else{_0x4104c0['push'](_0x856c('0x80'));}break;case _0x856c('0x81'):var _0x1cdba2=moment(_0x476c55,'YYYY-MM-DD',!![]);if(_0x1cdba2[_0x856c('0x7b')]()){_0x55646e[_0x856c('0x20')]('\x22'+_0x476c55+'\x22');}else{_0x4104c0[_0x856c('0x20')](_0x856c('0x82'));}break;default:_0x55646e[_0x856c('0x20')]('\x22'+_0x476c55+'\x22');}}else{switch(_0xafcbcf){case _0x856c('0x83'):case _0x856c('0x12'):_0x4104c0['push'](_0xafcbcf+_0x856c('0x84'));break;default:_0x55646e[_0x856c('0x20')]('\x22\x22');}}}}else{var _0xd62bd0='';if(!_[_0x856c('0x1e')](_0x2dfe54)){if(!_0x57dd5d[_0x856c('0x85')](_0x2dfe54['id'])){for(var _0x4fb451=0x0;_0x4fb451<_0x5bfec7[_0xafcbcf][_0x856c('0x1d')];_0x4fb451++){var _0x476c55=_[_0x856c('0x78')](_0x40eacb[_0x856c('0x76')][_0x3dbbf3][_0x5bfec7[_0xafcbcf][_0x4fb451]][_0x856c('0x79')](/"/g,'\x27'));var _0x4ef88c=phoneDescriptions[_0x856c('0x77')](_0x11f8aa=>_0x11f8aa[_0x856c('0x86')]===_0x2dfe54['id']);if(!_[_0x856c('0x1e')](_0x4ef88c)){var _0x1695ef=_[_0x856c('0x78')](_0x40eacb[_0x856c('0x76')][_0x3dbbf3][_0x5bfec7[_0x4ef88c[_0x856c('0x87')]][0x0]][_0x856c('0x79')](/"/g,'\x27'));if(!_['isNil'](_0x1695ef))_0x476c55=_0x476c55+'§'+_0x1695ef;}if(_0xd62bd0=='')_0xd62bd0=_0x476c55;else _0xd62bd0+='|'+_0x476c55;}_0x4c4ca8[_0x856c('0x20')](_0x2dfe54['id']+':'+_0xd62bd0);_0x57dd5d[_0x2dfe54['id']]=0x1;}}}}if(hasAdditionalPhones){_0x55646e[_0x856c('0x20')]('\x22'+_0x4c4ca8['join'](';')+'\x22');}if(_0x4104c0[_0x856c('0x1d')]){handleError(_0x40eacb[_0x856c('0x76')][_0x3dbbf3],{'code':_0x856c('0x88'),'message':_0x4104c0[_0x856c('0x14')]()});}else{fs['appendFileSync'](_0x2b73ac,_0x55646e['join']()+'\x0a');}_0x55646e=[];}if(!(stats[_0x856c('0x74')]%0xc8)){socket[_0x856c('0x89')](_0x856c('0x8a')+_0x187b13,stats);stats[_0x856c('0x75')]=[];}}if(stopped){logger[_0x856c('0x5f')](_0x856c('0x8b'));_0x1b5231['abort']();}}catch(_0x437113){handleError(_0x40eacb[_0x856c('0x76')][_0x3dbbf3],{'code':_0x856c('0x8c'),'message':_0x437113[_0x856c('0x25')]});logger[_0x856c('0x24')](_0x856c('0x8d'),_0x437113[_0x856c('0x25')]);}},'complete':function(){try{var _0x1cd814=[];var _0x3fea4b=tempTableName;_0x1cd814[_0x856c('0x20')](_0x856c('0x8e')+_0x3fea4b+_0x856c('0x8f'));logger[_0x856c('0x5f')](_0x856c('0x90'),contactItemTypes['length']);var _0x53a577=util[_0x856c('0x10')]('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',_0x2b73ac,_0x3fea4b,_0x219a6a,_0x3b8e15['ListId'],_0x3b8e15[_0x856c('0x5a')]||null,NOW,NOW);if(_[_0x856c('0x1e')](_0x5bfec7[_0x856c('0x7a')])){_0x53a577+=_0x856c('0x91');}_0x1cd814[_0x856c('0x20')](_0x53a577);BPromise[_0x856c('0x92')](_0x1cd814,handleQuery)[_0x856c('0x22')](function(_0x143694){BPromise[_0x856c('0x21')]([handleAdditionalPhones()])[_0x856c('0x22')](function(){_0x1cd814=[];for(var _0x52a64a=0x0;_0x52a64a\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','bluebird','squel','../../../mysqldb','../../../config/environment','import','defaults','localhost','socket.io-emitter','YYYYMMDDHHmmss','select','field','from','join','where','.dialCheckDuplicateType\x20IN\x20(','sequelize','query','isNil','push','all','then','catch','error','message','AdditionalPhones','split','length','CmContactHasItem','update','updated','create','PHONE','CmContact','CmHopper','phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.UserId','cm_hopper','scheduledat','ContactId','ListId','updatedAt','priority','UserId','fields','cm_contacts','.CmListId','.id\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22onlyIfOpen\x22','toString','insert','into','cm_hopper_black','ListId\x20=\x20?','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','fromQuery','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','CompanyId','createdAt',')\x20NOT\x20IN\x20?','id\x20IN\x20?','min_id','Received\x20SIGINT','exit','errors','code','info','spread','main','stringify','send','start','binding','clone','socket_timestamp','root','server/files/tmp','body','ContactItemType','findAll','name','_description','parse','createReadStream','rows','find','hasOwnProperty','data','trim','YYYY-MM-DD\x20HH:mm:ss','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','includes','agent\x20not\x20exists','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','replace'];(function(_0x308213,_0x224541){var _0x2e1619=function(_0x972b51){while(--_0x972b51){_0x308213['push'](_0x308213['shift']());}};_0x2e1619(++_0x224541);}(_0xbac6,0x1ec));var _0x6bac=function(_0x257b06,_0x577874){_0x257b06=_0x257b06-0x0;var _0x295292=_0xbac6[_0x257b06];return _0x295292;};'use strict';var fs=require('fs');var path=require(_0x6bac('0x0'));var _=require(_0x6bac('0x1'));var Papa=require(_0x6bac('0x2'));var util=require('util');var BPromise=require(_0x6bac('0x3'));var moment=require('moment');var squel=require(_0x6bac('0x4'));var Redis=require('ioredis');var db=require(_0x6bac('0x5'))['db'];var config=require(_0x6bac('0x6'));var logger=require('../../../config/logger')(_0x6bac('0x7'));config['redis']=_[_0x6bac('0x8')](config['redis'],{'host':_0x6bac('0x9'),'port':0x18eb});var socket=require(_0x6bac('0xa'))(new Redis(config['redis']));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()['format']('YYYY-MM-DD\x20HH:mm:ss');var tempTableName='cm_contacts_temp_'+moment()['format'](_0x6bac('0xb'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x40941b){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))*$/['test'](_0x40941b);}function selectNotIn(_0x4b795f,_0x52b736,_0x44e3ec,_0x443152,_0x15264f){return squel[_0x6bac('0xc')]()[_0x6bac('0xd')]('phone')[_0x6bac('0xe')](_0x443152)[_0x6bac('0xf')](_0x52b736,null,_0x52b736+'.id\x20=\x20'+_0x443152+'.'+_0x44e3ec)[_0x6bac('0x10')](_0x443152+'.'+_0x44e3ec+'\x20=\x20'+_0x4b795f+'.'+_0x44e3ec)['where'](_0x52b736+_0x6bac('0x11')+_0x15264f[_0x6bac('0xf')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x25eb23,_0x5ec99c){promisesAdditionalPhones=[];promisesContact=[];return db[_0x6bac('0x12')][_0x6bac('0x13')]('select\x20*\x20from\x20'+tempTableName)['spread'](function(_0xe86b80){if(_0xe86b80!==null){var _0x2ac79d=[];for(var _0x428b5c=0x0;_0x428b5c<_0xe86b80['length'];_0x428b5c++){var _0x52d806=_0xe86b80[_0x428b5c];if(!_[_0x6bac('0x14')](_0x52d806['phone'])){if(!_['isNil'](_0x52d806['AdditionalPhones']))_0x2ac79d[_0x6bac('0x15')](insertAdditionalPhones(_0x52d806));promisesContact[_0x6bac('0x15')]({'contact':_0x52d806});}}}Promise[_0x6bac('0x16')](_0x2ac79d)[_0x6bac('0x17')](function(){_0x25eb23({'val':0x1});});})[_0x6bac('0x18')](function(_0x3787f6){logger[_0x6bac('0x19')](_0x3787f6[_0x6bac('0x1a')]);});});}function insertAdditionalPhones(_0x1d371b){return new Promise(function(_0x21f7a3,_0x3a6ff9){var _0x3f34e0=_0x1d371b[_0x6bac('0x1b')];if(_[_0x6bac('0x14')](_0x3f34e0))_0x3a6ff9({'val':0x0});else{var _0x343064=_0x3f34e0[_0x6bac('0x1c')](';');var _0x4155bc=[];orderBy=0x0;for(var _0x2f5bf2=0x0;_0x2f5bf2<_0x343064[_0x6bac('0x1d')];_0x2f5bf2++){_0x4155bc[_0x6bac('0x15')](splitAdditionalPhone(_0x1d371b['id'],_0x343064[_0x2f5bf2]));}Promise[_0x6bac('0x16')](_0x4155bc)[_0x6bac('0x17')](function(){_0x21f7a3({'val':_0x343064['length']});});}});}function splitAdditionalPhone(_0x1c0e35,_0x4edfa1){return new Promise(function(_0x3991b9,_0x383d08){var _0x135b21=_0x4edfa1[_0x6bac('0x1c')](':');var _0x149383=_0x135b21[0x0];var _0x3e29ec=_0x135b21[0x1];if(_0x3e29ec!==''){var _0x318699=_0x3e29ec['split']('|');var _0x4bf18b=[];for(var _0x253555=0x0;_0x253555<_0x318699[_0x6bac('0x1d')];_0x253555++){if(_0x318699[_0x253555]!==''){var _0x4c849b=_['filter'](promisesAdditionalPhones,{'contactId':_0x1c0e35,'phone':_0x318699[_0x253555]});if(_0x4c849b[_0x6bac('0x1d')]==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x1c0e35,'contactTypeId':_0x149383,'phone':_0x318699[_0x253555],'orderBy':orderBy});}}}_0x3991b9({'ok':0x1});}else _0x3991b9({'res':0x0});});}function createAdditionalPhone(_0x32694c,_0x453076,_0x305f5e,_0x1e9a1e){var _0x4377d0='';var _0x395d4b='';var _0xecc608=_0x305f5e[_0x6bac('0x1c')]('§');_0x4377d0=_0xecc608[0x0];if(_0xecc608['length']==0x2)_0x395d4b=_0xecc608[0x1];return new Promise(function(_0x20c477,_0x207a61){return db['CmContactHasItem']['findOne']({'where':{'CmContactId':_0x32694c,'item':_0x4377d0}})['then'](function(_0x4a8e91){if(_0x4a8e91){return db[_0x6bac('0x1e')][_0x6bac('0x1f')]({'ItemTypeId':_0x453076,'description':_0x395d4b,'OrderBy':_0x1e9a1e},{'where':{'CmContactId':_0x32694c,'item':_0x4377d0}})[_0x6bac('0x17')](function(_0x545604){_0x20c477({'res':_0x6bac('0x20')});});}else{return db[_0x6bac('0x1e')][_0x6bac('0x21')]({'CmContactId':_0x32694c,'item':_0x4377d0,'ItemTypeId':_0x453076,'description':_0x395d4b,'OrderBy':_0x1e9a1e,'ItemClass':_0x6bac('0x22')})['then'](function(_0x3b0607){_0x20c477({'res':'inserted'});});}});});}function updateContact(_0x1c6884){return new Promise(function(_0xb71a03,_0x4a8398){var _0x26f239=_0x1c6884['id'];delete _0x1c6884['id'];return db[_0x6bac('0x23')][_0x6bac('0x1f')](_0x1c6884,{'where':{'id':_0x26f239}})[_0x6bac('0x17')](function(_0x1f5a32){updatedRows+=0x1;return db[_0x6bac('0x24')][_0x6bac('0x1f')]({'phone':_0x1c6884[_0x6bac('0x25')]},{'where':{'ContactId':_0x26f239}})[_0x6bac('0x17')](function(_0x4bc77a){_0xb71a03({'ret':'OK'});});});});}function insertCmHopper(_0x4d4e25,_0x4eb1f0,_0x54f4c7,_0xb9a91a,_0x35a050){var _0x1849d2=['cm_contacts.phone',_0x6bac('0x26'),_0x6bac('0x27'),_0x6bac('0x28'),_0x4eb1f0+'.'+_0xb9a91a,_0x6bac('0x29'),_0x6bac('0x2a'),'cm_contacts.priority',_0x6bac('0x2b'),'\x22'+_0x35a050+'\x22'];return squel['insert']()['into'](_0x6bac('0x2c'))['fromQuery']([_0x6bac('0x25'),_0x6bac('0x2d'),_0x6bac('0x2e'),_0x6bac('0x2f'),_0xb9a91a,'createdAt',_0x6bac('0x30'),_0x6bac('0x31'),_0x6bac('0x32'),'recallme'],squel[_0x6bac('0xc')]()[_0x6bac('0x33')](_0x1849d2)['from'](_0x4eb1f0)[_0x6bac('0xf')](_0x6bac('0x34'),null,'cm_contacts.ListId\x20=\x20'+_0x4eb1f0+_0x6bac('0x35'))[_0x6bac('0xf')](_0x54f4c7,null,_0x54f4c7+_0x6bac('0x36')+_0x4eb1f0+'.'+_0xb9a91a)[_0x6bac('0x10')](_0x4eb1f0+_0x6bac('0x37'),_0x4d4e25)['where'](_0x6bac('0x38'),NOW)['where'](_0x6bac('0x39'),selectNotIn(_0x4eb1f0,_0x54f4c7,_0xb9a91a,_0x6bac('0x2c'),['\x22always\x22',_0x6bac('0x3a')]))[_0x6bac('0x10')](_0x6bac('0x39'),selectNotIn(_0x4eb1f0,_0x54f4c7,_0xb9a91a,_0x6bac('0x2c'),['\x22always\x22'])))[_0x6bac('0x3b')]();}function insertCmHopperBlack(_0x4b1961,_0x4bffc4,_0x468352,_0xd90e1d){var _0x25c78a=['cm_contacts.phone',_0x6bac('0x27'),_0x6bac('0x28'),_0x4bffc4+'.'+_0xd90e1d,'cm_contacts.createdAt',_0x6bac('0x2a')];return squel[_0x6bac('0x3c')]()[_0x6bac('0x3d')](_0x6bac('0x3e'))['fromQuery']([_0x6bac('0x25'),_0x6bac('0x2e'),_0x6bac('0x2f'),_0xd90e1d,'createdAt',_0x6bac('0x30')],squel['select']()[_0x6bac('0x33')](_0x25c78a)[_0x6bac('0xe')](_0x4bffc4)[_0x6bac('0xf')](_0x6bac('0x34'),null,'cm_contacts.ListId\x20=\x20'+_0x4bffc4+_0x6bac('0x35'))[_0x6bac('0xf')](_0x468352,null,_0x468352+_0x6bac('0x36')+_0x4bffc4+'.'+_0xd90e1d)[_0x6bac('0x10')](_0x4bffc4+_0x6bac('0x37'),_0x4b1961)[_0x6bac('0x10')](_0x6bac('0x38'),NOW)[_0x6bac('0x10')](_0x6bac('0x39'),squel[_0x6bac('0xc')]()[_0x6bac('0xd')](_0x6bac('0x25'))['from']('cm_hopper_black')['where'](_0x6bac('0x3f'),_0x4b1961)[_0x6bac('0x10')](_0xd90e1d+'\x20=\x20?',_0x4bffc4+'.'+_0xd90e1d)))['toString']();}function insertCmHopperAdditionalPhones(_0x3c30c0){var _0x151b28=[_0x6bac('0x40'),_0x6bac('0x41'),_0x6bac('0x42'),_0x6bac('0x43'),_0x6bac('0x44')];return squel[_0x6bac('0x3c')]()[_0x6bac('0x3d')](_0x6bac('0x45'))[_0x6bac('0x46')]([_0x6bac('0x47'),_0x6bac('0x25'),_0x6bac('0x48'),'createdAt','updatedAt'],squel['select']()[_0x6bac('0x33')](_0x151b28)['from']('cm_hopper')[_0x6bac('0xf')]('cm_contacts',null,_0x6bac('0x49'))[_0x6bac('0xf')](_0x6bac('0x4a'),null,_0x6bac('0x4b'))[_0x6bac('0x10')](_0x6bac('0x4c'),_0x3c30c0)[_0x6bac('0x10')](_0x6bac('0x38'),NOW))[_0x6bac('0x3b')]();}function insertCmContact(_0x1f8381,_0xb01509,_0x5875bf,_0x23919d){var _0x3afe05=_[_0x6bac('0x4d')](_[_0x6bac('0x4e')](_0x23919d),[_0x6bac('0x2f'),_0x6bac('0x4f'),_0x6bac('0x50'),_0x6bac('0x30')]);return squel['insert']()[_0x6bac('0x3d')](_0x6bac('0x34'))[_0x6bac('0x46')](_0x3afe05,squel[_0x6bac('0xc')]()[_0x6bac('0x33')](_0x3afe05)['from'](_0xb01509)[_0x6bac('0x10')]('('+_0x5875bf[_0x6bac('0xf')](',')+_0x6bac('0x51'),squel[_0x6bac('0xc')]()[_0x6bac('0x33')](_0x5875bf)[_0x6bac('0xe')](_0x6bac('0x34'))[_0x6bac('0x10')](_0x6bac('0x3f'),_0x1f8381))[_0x6bac('0x10')](_0x6bac('0x52'),squel['select']()[_0x6bac('0xd')]('MIN(id)',_0x6bac('0x53'))[_0x6bac('0xe')](_0xb01509)['group'](_0x5875bf[_0x6bac('0xf')](','))))[_0x6bac('0x3b')]();}function handleStop(){logger['info'](_0x6bac('0x54'));stopped=!![];}function handleUncaughtException(_0x129a33){logger['error'](_0x129a33[_0x6bac('0x1a')]);process[_0x6bac('0x55')](0x1);}function handleError(_0x70a3fc,_0x506fbd){stats[_0x6bac('0x56')][_0x6bac('0x15')]({'name':_0x506fbd[_0x6bac('0x57')],'message':_0x506fbd[_0x6bac('0x1a')],'row':_0x70a3fc});}function handleQuery(_0x4e0b44){logger[_0x6bac('0x58')](_0x4e0b44);return db[_0x6bac('0x12')][_0x6bac('0x13')](_0x4e0b44)[_0x6bac('0x59')](function(_0x4499c1){results['push'](_0x4499c1);})['catch'](function(_0x35797b){logger['error'](_0x35797b[_0x6bac('0x1a')]);});}function main(_0x599a22,_0x333371,_0x5152db,_0x4befa2){logger[_0x6bac('0x58')](_0x6bac('0x5a'),_0x599a22,JSON[_0x6bac('0x5b')](_0x333371));process[_0x6bac('0x5c')](_0x6bac('0x5d'));var _0x5b024b=_0x333371[_0x6bac('0x5e')];var _0x584436=_[_0x6bac('0x5f')](_0x5b024b);var _0x1b2789=_0x333371[_0x6bac('0x60')];var _0x15a7fe=path[_0x6bac('0xf')](config[_0x6bac('0x61')],_0x6bac('0x62'),_0x1b2789+'.csv');logger[_0x6bac('0x58')](_0x6bac('0x63'),_0x333371);db[_0x6bac('0x64')][_0x6bac('0x65')]({'raw':!![],'attributes':['id',_0x6bac('0x66')]})[_0x6bac('0x17')](function(_0x335b3a){for(var _0x1c8b8a=0x0;_0x1c8b8a<_0x335b3a[_0x6bac('0x1d')];_0x1c8b8a++){if(_0x335b3a[_0x1c8b8a][_0x6bac('0x66')]in _0x5b024b){contactItemTypes[_0x6bac('0x15')](_0x335b3a[_0x1c8b8a]);delete _0x584436[_0x335b3a[_0x1c8b8a]['name']];hasAdditionalPhones=!![];}for(var _0x2e6fc2 in _0x5b024b){if(_0x335b3a[_0x1c8b8a][_0x6bac('0x66')]+_0x6bac('0x67')===_0x2e6fc2){phoneDescriptions[_0x6bac('0x15')]({'itemTypeId':_0x335b3a[_0x1c8b8a]['id'],'description':_0x2e6fc2});delete _0x584436[_0x2e6fc2];}}}if(hasAdditionalPhones)_0x584436[_0x6bac('0x1b')]='';var _0x4e380e=_[_0x6bac('0x4e')](_0x584436)['join']();logger[_0x6bac('0x58')]('header',_0x4e380e);fs['writeFileSync'](_0x15a7fe,_0x4e380e+'\x0a');Papa[_0x6bac('0x68')](fs[_0x6bac('0x69')](_0x599a22),{'header':!![],'skipEmptyLines':!![],'step':function(_0x16cd23,_0x4c99a5){try{for(var _0x597507=0x0,_0x3ebcdb=[];_0x597507<_0x16cd23['data'][_0x6bac('0x1d')];_0x597507++){stats[_0x6bac('0x6a')]+=0x1;if(_0x16cd23[_0x6bac('0x56')][_0x597507]){handleError(_0x16cd23['data'][_0x597507],_0x16cd23[_0x6bac('0x56')][_0x597507]);}else{var _0x3df8c5=[];var _0x4ba3db=[];var _0x2faf29={};for(var _0x18205a in _0x5b024b){let _0x15cac1=contactItemTypes[_0x6bac('0x6b')](_0x310987=>_0x310987['name']===_0x18205a);let _0x1d3de4=contactItemTypes[_0x6bac('0x6b')](_0x582692=>_0x582692[_0x6bac('0x66')]+'_description'===_0x18205a);if(_[_0x6bac('0x14')](_0x15cac1)&&_[_0x6bac('0x14')](_0x1d3de4)){if(_0x5b024b[_0x6bac('0x6c')](_0x18205a)){if(_0x16cd23[_0x6bac('0x6d')][_0x597507][_0x5b024b[_0x18205a]]){var _0x16b703=_[_0x6bac('0x6e')](_0x16cd23[_0x6bac('0x6d')][_0x597507][_0x5b024b[_0x18205a]]['replace'](/"/g,'\x27'));switch(_0x18205a){case'scheduledat':var _0x148432=moment(_0x16b703,_0x6bac('0x6f'),!![]);if(_0x148432[_0x6bac('0x70')]()){_0x3ebcdb[_0x6bac('0x15')]('\x22'+_0x16b703+'\x22');}else{_0x3df8c5[_0x6bac('0x15')](_0x6bac('0x71'));}break;case _0x6bac('0x31'):var _0x1ffe76=parseInt(_0x16b703);_0x16b703=_[_0x6bac('0x72')](_0x1ffe76)||_0x1ffe76<0x0||_0x1ffe76>0x4?_0x4befa2?0x3:0x2:_0x1ffe76;_0x3ebcdb[_0x6bac('0x15')]('\x22'+_0x16b703+'\x22');break;case _0x6bac('0x32'):var _0x1a5852=parseInt(_0x16b703);if(_[_0x6bac('0x73')](_0x1a5852)&&_[_0x6bac('0x74')](_0x5152db,_0x1a5852)){_0x3ebcdb[_0x6bac('0x15')]('\x22'+_0x1a5852+'\x22');}else{_0x3df8c5[_0x6bac('0x15')](_0x6bac('0x75'));}break;case'email':if(isEmail(_0x16b703)){_0x3ebcdb[_0x6bac('0x15')]('\x22'+_0x16b703+'\x22');}else{_0x3df8c5[_0x6bac('0x15')]('email\x20wrong\x20format');}break;case _0x6bac('0x76'):var _0x295f32=moment(_0x16b703,_0x6bac('0x77'),!![]);if(_0x295f32['isValid']()){_0x3ebcdb[_0x6bac('0x15')]('\x22'+_0x16b703+'\x22');}else{_0x3df8c5['push'](_0x6bac('0x78'));}break;default:_0x3ebcdb[_0x6bac('0x15')]('\x22'+_0x16b703+'\x22');}}else{switch(_0x18205a){case _0x6bac('0x79'):case _0x6bac('0x25'):_0x3df8c5['push'](_0x18205a+_0x6bac('0x7a'));break;default:_0x3ebcdb['push']('\x22\x22');}}}}else{var _0x4ecb5c='';if(!_[_0x6bac('0x14')](_0x15cac1)){if(!_0x2faf29['hasOwnProperty'](_0x15cac1['id'])){for(var _0x26ac8c=0x0;_0x26ac8c<_0x5b024b[_0x18205a][_0x6bac('0x1d')];_0x26ac8c++){var _0x16b703=_[_0x6bac('0x6e')](_0x16cd23[_0x6bac('0x6d')][_0x597507][_0x5b024b[_0x18205a][_0x26ac8c]][_0x6bac('0x7b')](/"/g,'\x27'));var _0x1e183c=phoneDescriptions[_0x6bac('0x6b')](_0x4733ed=>_0x4733ed['itemTypeId']===_0x15cac1['id']);if(!_[_0x6bac('0x14')](_0x1e183c)){var _0x38b2e0=_[_0x6bac('0x6e')](_0x16cd23[_0x6bac('0x6d')][_0x597507][_0x5b024b[_0x1e183c[_0x6bac('0x7c')]][0x0]][_0x6bac('0x7b')](/"/g,'\x27'));if(!_['isNil'](_0x38b2e0))_0x16b703=_0x16b703+'§'+_0x38b2e0;}if(_0x4ecb5c=='')_0x4ecb5c=_0x16b703;else _0x4ecb5c+='|'+_0x16b703;}_0x4ba3db[_0x6bac('0x15')](_0x15cac1['id']+':'+_0x4ecb5c);_0x2faf29[_0x15cac1['id']]=0x1;}}}}if(hasAdditionalPhones){_0x3ebcdb[_0x6bac('0x15')]('\x22'+_0x4ba3db[_0x6bac('0xf')](';')+'\x22');}if(_0x3df8c5['length']){handleError(_0x16cd23[_0x6bac('0x6d')][_0x597507],{'code':'SystemRow','message':_0x3df8c5[_0x6bac('0xf')]()});}else{fs[_0x6bac('0x7d')](_0x15a7fe,_0x3ebcdb[_0x6bac('0xf')]()+'\x0a');}_0x3ebcdb=[];}if(!(stats['rows']%0xc8)){socket[_0x6bac('0x7e')](_0x6bac('0x7f')+_0x1b2789,stats);stats[_0x6bac('0x56')]=[];}}if(stopped){logger[_0x6bac('0x58')](_0x6bac('0x80'));_0x4c99a5[_0x6bac('0x81')]();}}catch(_0x51dbaf){handleError(_0x16cd23[_0x6bac('0x6d')][_0x597507],{'code':_0x6bac('0x82'),'message':_0x51dbaf['message']});logger['error'](_0x6bac('0x83'),_0x51dbaf[_0x6bac('0x1a')]);}},'complete':function(){try{var _0x5728d4=[];var _0x3ceec2=tempTableName;_0x5728d4[_0x6bac('0x15')](_0x6bac('0x84')+_0x3ceec2+_0x6bac('0x85'));logger[_0x6bac('0x58')](_0x6bac('0x86'),contactItemTypes[_0x6bac('0x1d')]);var _0x533a7b=util[_0x6bac('0x87')](_0x6bac('0x88'),_0x15a7fe,_0x3ceec2,_0x4e380e,_0x333371[_0x6bac('0x2f')],_0x333371[_0x6bac('0x4f')]||null,NOW,NOW);if(_[_0x6bac('0x14')](_0x5b024b[_0x6bac('0x2d')])){_0x533a7b+=_0x6bac('0x89');}_0x5728d4[_0x6bac('0x15')](_0x533a7b);BPromise['each'](_0x5728d4,handleQuery)['then'](function(_0x4b40e1){BPromise[_0x6bac('0x16')]([handleAdditionalPhones()])['then'](function(){_0x5728d4=[];for(var _0x5c8e31=0x0;_0x5c8e31=_0x5eb1ed){return _0x58efd3[_0x3913('0x15')](0x193)[_0x3913('0x16')]({'message':util[_0x3913('0x8')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x24af23)});}_0x50e6f3();})['catch'](function(_0x595c66){_0x50e6f3(_0x595c66);});});}function isUserLimit(){return isLimit('users',0x1,db[_0x3913('0x17')],{'where':{'$or':[{'role':'admin'},{'role':'user'}]}});}exports[_0x3913('0x18')]=isUserLimit; \ No newline at end of file +var _0x0fa0=['update','base64','utf8','parse','hasOwnProperty','use','License','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','users','User','crypto','util','composable-middleware','../../mysqldb','../../config/environment','license','split','createDecipher','aes-256-ctr','format'];(function(_0xb2f928,_0x10c4f7){var _0x841a66=function(_0x4efbf2){while(--_0x4efbf2){_0xb2f928['push'](_0xb2f928['shift']());}};_0x841a66(++_0x10c4f7);}(_0x0fa0,0x1b8));var _0x00fa=function(_0x20e817,_0x192185){_0x20e817=_0x20e817-0x0;var _0x1e17a5=_0x0fa0[_0x20e817];return _0x1e17a5;};'use strict';var crypto=require(_0x00fa('0x0'));var util=require(_0x00fa('0x1'));var compose=require(_0x00fa('0x2'));var db=require(_0x00fa('0x3'))['db'];var config=require(_0x00fa('0x4'));function getValueFromLicense(_0x36143c,_0x2c9b20){if(_0x36143c&&_0x2c9b20){if(_0x2c9b20['data1']&&_0x2c9b20[_0x00fa('0x5')]){var _0x1cd9f8=_0x2c9b20['data1'];var _0x519441=_0x2c9b20['license'];var _0x419623=_0x1cd9f8['split']('-')[0x4];var _0x2425dd=_0x1cd9f8[_0x00fa('0x6')]('-')[0x0];var _0x100d9a=crypto[_0x00fa('0x7')](_0x00fa('0x8'),util[_0x00fa('0x9')]('%s:%s:%s',_0x419623,_0x1cd9f8,_0x2425dd));var _0x855ef2=_0x100d9a[_0x00fa('0xa')](_0x519441,_0x00fa('0xb'),_0x00fa('0xc'));_0x855ef2+=_0x100d9a['final'](_0x00fa('0xc'));var _0x300e74=JSON[_0x00fa('0xd')](_0x855ef2);return _0x300e74[_0x00fa('0xe')](_0x36143c)?_0x300e74[_0x36143c]:null;}}return null;}function isLimit(_0x849f49,_0x57dbb5,_0x43b3c2,_0x578a04){var _0xee1826=_0x57dbb5;return compose()[_0x00fa('0xf')](function(_0x1f0ba7,_0x25e76e,_0x49434b){return db[_0x00fa('0x10')][_0x00fa('0x11')]({'where':{'id':0x1},'raw':!![]})[_0x00fa('0x12')](function(_0x3fc842){var _0xc66bce=getValueFromLicense(_0x849f49,_0x3fc842);return _0xc66bce?_0xc66bce:_0xee1826;})['then'](function(_0x2df97f){_0xee1826=_0x2df97f;return _0x43b3c2[_0x00fa('0x13')](_0x578a04);})['then'](function(_0x2b78bc){if(_0x2b78bc>=_0xee1826){return _0x25e76e[_0x00fa('0x14')](0x193)[_0x00fa('0x15')]({'message':util[_0x00fa('0x9')](_0x00fa('0x16'),_0x849f49)});}_0x49434b();})['catch'](function(_0x32ffaf){_0x49434b(_0x32ffaf);});});}function isUserLimit(){return isLimit(_0x00fa('0x17'),0x1,db[_0x00fa('0x18')],{'where':{'$or':[{'role':'admin'},{'role':'user'}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index dd550a7..06d4595 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 _0x8519=['$eq','value','includes','$lte','add','days','format','YYYY-MM-DD','text','CAST(','field','castTo','\x20OR\x20','$in','IN\x20?','NOT\x20IN\x20?','=\x20?','<>\x20?','$startsWith','$endsWith','LIKE\x20?','>\x20?','$gte','$between','BETWEEN\x20?\x20AND\x20?','$notIn','start','$substring','pop','utcOffset','hours','lodash','parseSearch','sqlOperator','startsWith','[$or]','and','[$and]','replace','length','split','slice','forEach','shift','filter','map','conditions','push','buildExpression','DATE','operator'];(function(_0x3b56c0,_0xe100d8){var _0x377efe=function(_0x181589){while(--_0x181589){_0x3b56c0['push'](_0x3b56c0['shift']());}};_0x377efe(++_0xe100d8);}(_0x8519,0x11e));var _0x9851=function(_0x1aa12b,_0x3321d5){_0x1aa12b=_0x1aa12b-0x0;var _0x45e3ca=_0x8519[_0x1aa12b];return _0x45e3ca;};'use strict';var _=require(_0x9851('0x0'));var moment=require('moment');exports[_0x9851('0x1')]=function(_0x28a52d){var _0x150454={'conditions':[]};_0x150454[_0x9851('0x2')]=_[_0x9851('0x3')](_0x28a52d,_0x9851('0x4'))?'or':_0x9851('0x5');var _0x29d1d9=_0x28a52d['replace'](_0x9851('0x6'),'')[_0x9851('0x7')](_0x9851('0x4'),'')['split']('||');for(var _0x495e8b=0x0;_0x495e8b<_0x29d1d9[_0x9851('0x8')];_0x495e8b++){var _0x43cc1c=_0x29d1d9[_0x495e8b][_0x9851('0x9')](':=');var _0x185df8=_0x43cc1c[0x0];var _0x2f2a02=_0x43cc1c[_0x9851('0xa')](0x1);_0x2f2a02[_0x9851('0xb')](function(_0x12380f){var _0x569604=_0x12380f[_0x9851('0x9')]('[')[_0x9851('0xc')]();var _0x4f6b61=_0x12380f['match'](/\[(.*?)\]/g);_0x4f6b61[_0x9851('0xb')](function(_0xc18544){var _0x366834=_0xc18544['split']('[')[_0x9851('0xd')](function(_0x262e7f){return _0x262e7f['indexOf'](']')>-0x1;})[_0x9851('0xe')](function(_0x392107){return _0x392107[_0x9851('0x9')](']')[0x0];})[0x0];_0x150454[_0x9851('0xf')][_0x9851('0x10')]({'field':_0x185df8,'operator':_0x569604,'value':_0x366834});});});}return _0x150454;};exports[_0x9851('0x11')]=function(_0x269a73,_0x35e67e,_0x499117){var _0x2f774f={};if(_0x35e67e===_0x9851('0x12')){if(_0x499117[_0x9851('0x13')]===_0x9851('0x14')){_0x499117[_0x9851('0x13')]='$between';_0x499117[_0x9851('0x15')]+=','+_0x499117[_0x9851('0x15')];}else if(_[_0x9851('0x16')](['$gt',_0x9851('0x17')],_0x499117[_0x9851('0x13')])){_0x499117[_0x9851('0x15')]=moment(_0x499117['value'])[_0x9851('0x18')](0x1,_0x9851('0x19'))[_0x9851('0x1a')](_0x9851('0x1b'));}}if(_0x499117['castTo']){_0x35e67e=_0x499117['castTo'];_0x2f774f[_0x9851('0x1c')]=_0x9851('0x1d')+_0x269a73+'.'+_0x499117[_0x9851('0x1e')]+'\x20AS\x20'+_0x499117[_0x9851('0x1f')]+')\x20'+parseOperator(_0x499117[_0x9851('0x13')]);}else{_0x2f774f[_0x9851('0x1c')]=_0x269a73+'.'+_0x499117[_0x9851('0x1e')]+'\x20'+parseOperator(_0x499117[_0x9851('0x13')]);}if(_[_0x9851('0x16')](['$ne','$notIn'],_0x499117[_0x9851('0x13')]))_0x2f774f['text']='('+_0x2f774f[_0x9851('0x1c')]+_0x9851('0x20')+_0x269a73+'.'+_0x499117['field']+'\x20IS\x20NULL)';_0x2f774f[_0x9851('0x15')]=parseValue(_0x35e67e,_0x499117[_0x9851('0x13')],_0x499117['value']);return _0x2f774f;};function parseOperator(_0x34065a){var _0x13e354;switch(_0x34065a){case _0x9851('0x21'):_0x13e354=_0x9851('0x22');break;case'$notIn':_0x13e354=_0x9851('0x23');break;case'$eq':_0x13e354=_0x9851('0x24');break;case'$ne':_0x13e354=_0x9851('0x25');break;case'$substring':case _0x9851('0x26'):case _0x9851('0x27'):_0x13e354=_0x9851('0x28');break;case'$lt':_0x13e354='<\x20?';break;case'$gt':_0x13e354=_0x9851('0x29');break;case'$lte':_0x13e354='<=\x20?';break;case _0x9851('0x2a'):_0x13e354='>=\x20?';break;case _0x9851('0x2b'):_0x13e354=_0x9851('0x2c');break;}return _0x13e354;}function parseValue(_0xd58a88,_0x573e9b,_0xb2232b){var _0x588949={'start':undefined,'end':undefined};switch(_0x573e9b){case _0x9851('0x21'):case _0x9851('0x2d'):_0x588949[_0x9851('0x2e')]=_0xb2232b[_0x9851('0x9')](',');break;case _0x9851('0x2f'):_0x588949[_0x9851('0x2e')]='%'+_0xb2232b+'%';break;case _0x9851('0x26'):_0x588949['start']=_0xb2232b+'%';break;case _0x9851('0x27'):_0x588949['start']='%'+_0xb2232b;break;case _0x9851('0x2b'):var _0x40a487=_0xb2232b[_0x9851('0x9')](',');var _0xb2232b=_0x40a487['shift']();var _0x26fe67=_0x40a487[_0x9851('0x30')]();if(_0xd58a88==='DATE'){_0xb2232b=moment(_0xb2232b)[_0x9851('0x31')](0x0,!![])[_0x9851('0x1a')]();_0x26fe67=moment(_0x26fe67)[_0x9851('0x31')](0x0,!![])[_0x9851('0x18')](0x17,_0x9851('0x32'))[_0x9851('0x18')](0x3b,'minutes')[_0x9851('0x18')](0x3b,'seconds')['format']();}_0x588949={'start':_0xb2232b,'end':_0x26fe67};break;default:_0x588949[_0x9851('0x2e')]=_0xb2232b;break;}return _0x588949;} \ No newline at end of file +var _0xf219=['DATE','operator','$eq','$between','value','includes','$gt','$lte','add','days','format','YYYY-MM-DD','text','field','$ne','\x20OR\x20','\x20IS\x20NULL)','$in','$notIn','NOT\x20IN\x20?','=\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','>\x20?','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','pop','utcOffset','minutes','moment','[$or]','and','[$and]','replace','split','forEach','shift','indexOf','conditions','buildExpression'];(function(_0x443c48,_0xd9c01f){var _0x12e2fe=function(_0x543b80){while(--_0x543b80){_0x443c48['push'](_0x443c48['shift']());}};_0x12e2fe(++_0xd9c01f);}(_0xf219,0x1ef));var _0x9f21=function(_0x58df23,_0x3e9eb9){_0x58df23=_0x58df23-0x0;var _0x2fcd18=_0xf219[_0x58df23];return _0x2fcd18;};'use strict';var _=require('lodash');var moment=require(_0x9f21('0x0'));exports['parseSearch']=function(_0x5afa20){var _0x5ce5eb={'conditions':[]};_0x5ce5eb['sqlOperator']=_['startsWith'](_0x5afa20,_0x9f21('0x1'))?'or':_0x9f21('0x2');var _0xc85b40=_0x5afa20['replace'](_0x9f21('0x3'),'')[_0x9f21('0x4')](_0x9f21('0x1'),'')[_0x9f21('0x5')]('||');for(var _0x3c3e98=0x0;_0x3c3e98<_0xc85b40['length'];_0x3c3e98++){var _0x46234b=_0xc85b40[_0x3c3e98]['split'](':=');var _0x577bdf=_0x46234b[0x0];var _0xe025b3=_0x46234b['slice'](0x1);_0xe025b3[_0x9f21('0x6')](function(_0x18c7d9){var _0x4ae8e0=_0x18c7d9['split']('[')[_0x9f21('0x7')]();var _0x4d7f37=_0x18c7d9['match'](/\[(.*?)\]/g);_0x4d7f37[_0x9f21('0x6')](function(_0x22a0e3){var _0x95fc48=_0x22a0e3[_0x9f21('0x5')]('[')['filter'](function(_0x2f86aa){return _0x2f86aa[_0x9f21('0x8')](']')>-0x1;})['map'](function(_0x411588){return _0x411588[_0x9f21('0x5')](']')[0x0];})[0x0];_0x5ce5eb[_0x9f21('0x9')]['push']({'field':_0x577bdf,'operator':_0x4ae8e0,'value':_0x95fc48});});});}return _0x5ce5eb;};exports[_0x9f21('0xa')]=function(_0x4641e0,_0x43b5be,_0x57b147){var _0x2ae9b1={};if(_0x43b5be===_0x9f21('0xb')){if(_0x57b147[_0x9f21('0xc')]===_0x9f21('0xd')){_0x57b147[_0x9f21('0xc')]=_0x9f21('0xe');_0x57b147[_0x9f21('0xf')]+=','+_0x57b147[_0x9f21('0xf')];}else if(_[_0x9f21('0x10')]([_0x9f21('0x11'),_0x9f21('0x12')],_0x57b147[_0x9f21('0xc')])){_0x57b147[_0x9f21('0xf')]=moment(_0x57b147[_0x9f21('0xf')])[_0x9f21('0x13')](0x1,_0x9f21('0x14'))[_0x9f21('0x15')](_0x9f21('0x16'));}}if(_0x57b147['castTo']){_0x43b5be=_0x57b147['castTo'];_0x2ae9b1['text']='CAST('+_0x4641e0+'.'+_0x57b147['field']+'\x20AS\x20'+_0x57b147['castTo']+')\x20'+parseOperator(_0x57b147['operator']);}else{_0x2ae9b1[_0x9f21('0x17')]=_0x4641e0+'.'+_0x57b147[_0x9f21('0x18')]+'\x20'+parseOperator(_0x57b147[_0x9f21('0xc')]);}if(_[_0x9f21('0x10')]([_0x9f21('0x19'),'$notIn'],_0x57b147[_0x9f21('0xc')]))_0x2ae9b1[_0x9f21('0x17')]='('+_0x2ae9b1[_0x9f21('0x17')]+_0x9f21('0x1a')+_0x4641e0+'.'+_0x57b147[_0x9f21('0x18')]+_0x9f21('0x1b');_0x2ae9b1[_0x9f21('0xf')]=parseValue(_0x43b5be,_0x57b147[_0x9f21('0xc')],_0x57b147[_0x9f21('0xf')]);return _0x2ae9b1;};function parseOperator(_0x279578){var _0x44fbbb;switch(_0x279578){case _0x9f21('0x1c'):_0x44fbbb='IN\x20?';break;case _0x9f21('0x1d'):_0x44fbbb=_0x9f21('0x1e');break;case'$eq':_0x44fbbb=_0x9f21('0x1f');break;case _0x9f21('0x19'):_0x44fbbb='<>\x20?';break;case _0x9f21('0x20'):case _0x9f21('0x21'):case _0x9f21('0x22'):_0x44fbbb=_0x9f21('0x23');break;case _0x9f21('0x24'):_0x44fbbb='<\x20?';break;case _0x9f21('0x11'):_0x44fbbb=_0x9f21('0x25');break;case _0x9f21('0x12'):_0x44fbbb=_0x9f21('0x26');break;case _0x9f21('0x27'):_0x44fbbb=_0x9f21('0x28');break;case _0x9f21('0xe'):_0x44fbbb=_0x9f21('0x29');break;}return _0x44fbbb;}function parseValue(_0x1a6d53,_0x3ef840,_0x14dd93){var _0x255f7b={'start':undefined,'end':undefined};switch(_0x3ef840){case _0x9f21('0x1c'):case _0x9f21('0x1d'):_0x255f7b[_0x9f21('0x2a')]=_0x14dd93[_0x9f21('0x5')](',');break;case _0x9f21('0x20'):_0x255f7b[_0x9f21('0x2a')]='%'+_0x14dd93+'%';break;case _0x9f21('0x21'):_0x255f7b[_0x9f21('0x2a')]=_0x14dd93+'%';break;case _0x9f21('0x22'):_0x255f7b[_0x9f21('0x2a')]='%'+_0x14dd93;break;case _0x9f21('0xe'):var _0x3cb53b=_0x14dd93[_0x9f21('0x5')](',');var _0x14dd93=_0x3cb53b[_0x9f21('0x7')]();var _0x37e2b0=_0x3cb53b[_0x9f21('0x2b')]();if(_0x1a6d53===_0x9f21('0xb')){_0x14dd93=moment(_0x14dd93)[_0x9f21('0x2c')](0x0,!![])[_0x9f21('0x15')]();_0x37e2b0=moment(_0x37e2b0)['utcOffset'](0x0,!![])['add'](0x17,'hours')[_0x9f21('0x13')](0x3b,_0x9f21('0x2d'))['add'](0x3b,'seconds')[_0x9f21('0x15')]();}_0x255f7b={'start':_0x14dd93,'end':_0x37e2b0};break;default:_0x255f7b[_0x9f21('0x2a')]=_0x14dd93;break;}return _0x255f7b;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 382c444..05d5027 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 _0xf094=['$id','model','name','attributes','intersection','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','lower','options','moment','parse','keys','includes','fields','split','filters','isEmpty','forOwn','find','DATE','$gte','YYYY-MM-DD','utc','$lte','format','subtract','uniqueid','isArray','offset','map','indexOf','priority','cast','col','unsigned','omit','isObject','isString','length','unset','hasOwnProperty','isNumeric','match','getFullTextValue','forEach','replace','push','join','getOptions','query'];(function(_0x5dad4b,_0x5be60a){var _0x5a682b=function(_0x3ea19c){while(--_0x3ea19c){_0x5dad4b['push'](_0x5dad4b['shift']());}};_0x5a682b(++_0x5be60a);}(_0xf094,0x1e1));var _0x4f09=function(_0x44268d,_0xad8443){_0x44268d=_0x44268d-0x0;var _0x4be92d=_0xf094[_0x44268d];return _0x4be92d;};'use strict';var _=require('lodash');var sequelize=require('sequelize');var moment=require(_0x4f09('0x0'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0xe631b5){var _0x17bede=['ne'];try{var _0x5dc44a=JSON[_0x4f09('0x1')](_0xe631b5);var _0x186974=Object[_0x4f09('0x2')](_0x5dc44a)[0x0];return _0x17bede[_0x4f09('0x3')](_0x186974);}catch(_0x4712ae){return![];}}function getOperatorValue(_0x2b033c){var _0x3de3da=JSON[_0x4f09('0x1')](_0x2b033c);var _0x2b24f2=Object[_0x4f09('0x2')](_0x3de3da)[0x0];var _0xc80c3a=_0x3de3da[_0x2b24f2];return{['$'+_0x2b24f2]:_0xc80c3a};}exports[_0x4f09('0x4')]=function(_0x282219){var _0x36064c=null;if(_0x282219){_0x36064c=_0x282219[_0x4f09('0x5')](',');}return _0x36064c;};exports[_0x4f09('0x6')]=function(_0x8bd71a,_0x203681){var _0x4d0324={};if(!_[_0x4f09('0x7')](_0x8bd71a)){_[_0x4f09('0x8')](_0x8bd71a,function(_0xb00cb0,_0x961280){try{if(_0x203681){var _0x1a883b=_[_0x4f09('0x9')](_0x203681,{'name':_0x961280})||{};if(hasSequelizeOperator(_0xb00cb0)){_0x4d0324[_0x961280]=getOperatorValue(_0xb00cb0);}else if(_0x1a883b['type']===_0x4f09('0xa')&&_['isPlainObject'](_0xb00cb0)){var _0x3d8362=JSON[_0x4f09('0x1')](_0xb00cb0);var _0x17c5aa={'$gte':moment(moment(_0x3d8362[_0x4f09('0xb')])['format'](_0x4f09('0xc')))[_0x4f09('0xd')]()['format'](),'$lte':moment(moment(_0x3d8362[_0x4f09('0xe')])[_0x4f09('0xf')]('YYYY-MM-DD'))[_0x4f09('0xd')]()[_0x4f09('0x10')](0x1,'s')['format']()};_0x4d0324[_0x961280]=_0x17c5aa;}else if(_0x1a883b['name']===_0x4f09('0x11')){_0x4d0324[_0x961280]=_0xb00cb0;}else{_0x4d0324[_0x961280]=_[_0x4f09('0x12')](_0xb00cb0)?_0xb00cb0:JSON[_0x4f09('0x1')](_0xb00cb0);}}else{_0x4d0324[_0x961280]=_['isArray'](_0xb00cb0)?_0xb00cb0:JSON['parse'](_0xb00cb0);}}catch(_0x3925bd){_0x4d0324[_0x961280]=_0xb00cb0[_0x4f09('0x5')](',');}});}return _0x4d0324;};exports['limit']=function(_0x48a11f){_0x48a11f=parseInt(_0x48a11f,0xa);if(!_0x48a11f||_0x48a11f<0x0){_0x48a11f=LIMIT_VALUE;}return _0x48a11f;};exports[_0x4f09('0x13')]=function(_0x23525e){_0x23525e=parseInt(_0x23525e,0xa);if(!_0x23525e||_0x23525e<0x0){_0x23525e=0x0;}return _0x23525e;};exports['sort']=function(_0x351b84){var _0x534fea,_0x579611=null;if(_0x351b84){_0x534fea=_0x351b84[_0x4f09('0x5')](',');_0x579611=_[_0x4f09('0x14')](_0x534fea,function(_0x599fed){if(_0x599fed[_0x4f09('0x15')]('-')===0x0){return[_0x599fed===_0x4f09('0x16')?sequelize[_0x4f09('0x17')](sequelize[_0x4f09('0x18')]('priority'),'unsigned'):_0x599fed['substr'](0x1),'DESC'];}else{return[_0x599fed==='priority'?sequelize[_0x4f09('0x17')](sequelize[_0x4f09('0x18')](_0x4f09('0x16')),_0x4f09('0x19')):_0x599fed,'ASC'];}});}return _0x579611;};exports[_0x4f09('0x1a')]=function(_0x305b13,_0x13a8e5){if(_[_0x4f09('0x7')](_0x305b13)){return _0x305b13;}if(_['isArray'](_0x305b13)){for(var _0x182df3=0x0;_0x182df3<_0x305b13['length'];_0x182df3+=0x1){_0x305b13[_0x182df3]=this[_0x4f09('0x1a')](_0x305b13[_0x182df3],_0x13a8e5);}return _0x305b13;}if(!_[_0x4f09('0x1b')](_0x305b13)){return _0x305b13;}if(_[_0x4f09('0x1c')](_0x13a8e5)){_0x13a8e5=[_0x13a8e5];}if(!_[_0x4f09('0x12')](_0x13a8e5)){return _0x305b13;}for(var _0x4295fb=0x0;_0x4295fb<_0x13a8e5[_0x4f09('0x1d')];_0x4295fb+=0x1){_[_0x4f09('0x1e')](_0x305b13,_0x13a8e5[_0x4295fb]);}for(var _0xf33e08 in _0x305b13){if(_0x305b13[_0x4f09('0x1f')](_0xf33e08)){_0x305b13[_0xf33e08]=this[_0x4f09('0x1a')](_0x305b13[_0xf33e08],_0x13a8e5);}}return _0x305b13;};exports[_0x4f09('0x20')]=function(_0x2b74e7){return _0x2b74e7[_0x4f09('0x21')](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports['isEmail']=function(_0x511548){return _0x511548['match'](/^\S+@\S+$/)?!![]:![];};exports[_0x4f09('0x22')]=function(_0x492026){var _0x524fa7=[];_0x492026['split'](/[ ,]+/)[_0x4f09('0x23')](function(_0x239e90){_0x239e90=_0x239e90[_0x4f09('0x24')](/([^:]")"+/g,'$1');_0x239e90='+'+_0x239e90+'*';if(_0x239e90[_0x4f09('0x3')]('@'))_0x239e90='\x22'+_0x239e90+'\x22';_0x524fa7[_0x4f09('0x25')](_0x239e90);});return _0x524fa7[_0x4f09('0x26')]('\x20');};exports[_0x4f09('0x27')]=function(_0x5abae1,_0x5dca34,_0x4313cc){var _0x3d74a4={},_0x73bbe={};if(_0x5dca34[_0x4f09('0x28')][_0x4f09('0x29')]){_0x5dca34[_0x4f09('0x28')]['id']=_0x5dca34[_0x4f09('0x28')][_0x4f09('0x29')];delete _0x5dca34['query'][_0x4f09('0x29')];}_0x3d74a4[_0x4f09('0x2a')]=_[_0x4f09('0x14')](_0x5abae1,_0x4f09('0x2b'));_0x3d74a4[_0x4f09('0x28')]=_[_0x4f09('0x2')](_0x5dca34[_0x4f09('0x28')]);_0x3d74a4['filters']=_['intersection'](_0x3d74a4[_0x4f09('0x2a')],_0x3d74a4[_0x4f09('0x28')]);_0x73bbe[_0x4f09('0x2c')]=_[_0x4f09('0x2d')](_0x3d74a4['model'],this['fields'](_0x5dca34['query'][_0x4f09('0x4')]));_0x73bbe[_0x4f09('0x2c')]=_0x73bbe[_0x4f09('0x2c')]['length']?_0x73bbe[_0x4f09('0x2c')]:_0x3d74a4[_0x4f09('0x2a')];if(!_0x5dca34[_0x4f09('0x28')][_0x4f09('0x1f')](_0x4f09('0x2e'))){_0x73bbe[_0x4f09('0x2f')]=this[_0x4f09('0x2f')](_0x5dca34[_0x4f09('0x28')]['limit']);_0x73bbe[_0x4f09('0x13')]=this['offset'](_0x5dca34[_0x4f09('0x28')][_0x4f09('0x13')]);}_0x73bbe[_0x4f09('0x30')]=this[_0x4f09('0x31')](_0x5dca34[_0x4f09('0x28')][_0x4f09('0x31')]);_0x73bbe[_0x4f09('0x32')]=this[_0x4f09('0x6')](_[_0x4f09('0x33')](_0x5dca34['query'],_0x3d74a4['filters']),_0x5abae1);if(_0x5dca34[_0x4f09('0x28')][_0x4f09('0x34')]){_0x73bbe[_0x4f09('0x32')]=_[_0x4f09('0x35')](_0x73bbe['where'],{'$or':_['map'](_0x5abae1,function(_0x375e2c){if(_0x375e2c[_0x4f09('0x36')]!==_0x4f09('0x37')){if(_0x4313cc){return sequelize['where'](sequelize['fn'](_0x4f09('0x38'),sequelize['col'](_0x375e2c['name'])),{'$like':sequelize['fn'](_0x4f09('0x38'),'%'+_0x5dca34['query'][_0x4f09('0x34')]+'%')});}else{var _0x444ec0={};_0x444ec0[_0x375e2c[_0x4f09('0x2b')]]={'$like':'%'+_0x5dca34[_0x4f09('0x28')][_0x4f09('0x34')]+'%'};return _0x444ec0;}}})});}_0x73bbe=_[_0x4f09('0x35')]({},_0x73bbe,_0x5dca34[_0x4f09('0x39')]);return _0x73bbe;}; \ No newline at end of file +var _0x659e=['isObject','length','unset','hasOwnProperty','isNumeric','isEmail','match','getFullTextValue','forEach','includes','push','join','getOptions','$id','query','model','filters','intersection','attributes','nolimit','limit','offset','order','pick','filter','where','merge','type','lower','options','lodash','sequelize','moment','parse','keys','fields','split','isEmpty','forOwn','find','DATE','isPlainObject','$gte','format','$lte','YYYY-MM-DD','utc','subtract','name','isArray','sort','map','indexOf','unsigned','DESC','cast','col','priority','ASC','omit'];(function(_0x35da42,_0x5c2610){var _0x370035=function(_0x546db5){while(--_0x546db5){_0x35da42['push'](_0x35da42['shift']());}};_0x370035(++_0x5c2610);}(_0x659e,0x14a));var _0xe659=function(_0x4ae73a,_0x36a555){_0x4ae73a=_0x4ae73a-0x0;var _0x3f4a0b=_0x659e[_0x4ae73a];return _0x3f4a0b;};'use strict';var _=require(_0xe659('0x0'));var sequelize=require(_0xe659('0x1'));var moment=require(_0xe659('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x5ad92e){var _0x28f3ae=['ne'];try{var _0x42cbb6=JSON[_0xe659('0x3')](_0x5ad92e);var _0x47c959=Object[_0xe659('0x4')](_0x42cbb6)[0x0];return _0x28f3ae['includes'](_0x47c959);}catch(_0x83d5f4){return![];}}function getOperatorValue(_0x3aea6e){var _0x80e2e3=JSON['parse'](_0x3aea6e);var _0x27319c=Object[_0xe659('0x4')](_0x80e2e3)[0x0];var _0x23589d=_0x80e2e3[_0x27319c];return{['$'+_0x27319c]:_0x23589d};}exports[_0xe659('0x5')]=function(_0x570964){var _0x5f0c94=null;if(_0x570964){_0x5f0c94=_0x570964[_0xe659('0x6')](',');}return _0x5f0c94;};exports['filters']=function(_0x529d48,_0x184ecd){var _0x157438={};if(!_[_0xe659('0x7')](_0x529d48)){_[_0xe659('0x8')](_0x529d48,function(_0x2a6dba,_0x51f0f9){try{if(_0x184ecd){var _0x233c13=_[_0xe659('0x9')](_0x184ecd,{'name':_0x51f0f9})||{};if(hasSequelizeOperator(_0x2a6dba)){_0x157438[_0x51f0f9]=getOperatorValue(_0x2a6dba);}else if(_0x233c13['type']===_0xe659('0xa')&&_[_0xe659('0xb')](_0x2a6dba)){var _0x4aa903=JSON[_0xe659('0x3')](_0x2a6dba);var _0x3720f6={'$gte':moment(moment(_0x4aa903[_0xe659('0xc')])[_0xe659('0xd')]('YYYY-MM-DD'))['utc']()['format'](),'$lte':moment(moment(_0x4aa903[_0xe659('0xe')])[_0xe659('0xd')](_0xe659('0xf')))[_0xe659('0x10')]()[_0xe659('0x11')](0x1,'s')[_0xe659('0xd')]()};_0x157438[_0x51f0f9]=_0x3720f6;}else if(_0x233c13[_0xe659('0x12')]==='uniqueid'){_0x157438[_0x51f0f9]=_0x2a6dba;}else{_0x157438[_0x51f0f9]=_['isArray'](_0x2a6dba)?_0x2a6dba:JSON[_0xe659('0x3')](_0x2a6dba);}}else{_0x157438[_0x51f0f9]=_[_0xe659('0x13')](_0x2a6dba)?_0x2a6dba:JSON['parse'](_0x2a6dba);}}catch(_0x2cae73){_0x157438[_0x51f0f9]=_0x2a6dba[_0xe659('0x6')](',');}});}return _0x157438;};exports['limit']=function(_0x3fb357){_0x3fb357=parseInt(_0x3fb357,0xa);if(!_0x3fb357||_0x3fb357<0x0){_0x3fb357=LIMIT_VALUE;}return _0x3fb357;};exports['offset']=function(_0x2095f4){_0x2095f4=parseInt(_0x2095f4,0xa);if(!_0x2095f4||_0x2095f4<0x0){_0x2095f4=0x0;}return _0x2095f4;};exports[_0xe659('0x14')]=function(_0x4f32bb){var _0x394c5d,_0xc1f999=null;if(_0x4f32bb){_0x394c5d=_0x4f32bb[_0xe659('0x6')](',');_0xc1f999=_[_0xe659('0x15')](_0x394c5d,function(_0x420850){if(_0x420850[_0xe659('0x16')]('-')===0x0){return[_0x420850==='priority'?sequelize['cast'](sequelize['col']('priority'),_0xe659('0x17')):_0x420850['substr'](0x1),_0xe659('0x18')];}else{return[_0x420850==='priority'?sequelize[_0xe659('0x19')](sequelize[_0xe659('0x1a')](_0xe659('0x1b')),'unsigned'):_0x420850,_0xe659('0x1c')];}});}return _0xc1f999;};exports['omit']=function(_0xb1c03a,_0x236eaa){if(_[_0xe659('0x7')](_0xb1c03a)){return _0xb1c03a;}if(_[_0xe659('0x13')](_0xb1c03a)){for(var _0x1ec191=0x0;_0x1ec191<_0xb1c03a['length'];_0x1ec191+=0x1){_0xb1c03a[_0x1ec191]=this[_0xe659('0x1d')](_0xb1c03a[_0x1ec191],_0x236eaa);}return _0xb1c03a;}if(!_[_0xe659('0x1e')](_0xb1c03a)){return _0xb1c03a;}if(_['isString'](_0x236eaa)){_0x236eaa=[_0x236eaa];}if(!_['isArray'](_0x236eaa)){return _0xb1c03a;}for(var _0x209a62=0x0;_0x209a62<_0x236eaa[_0xe659('0x1f')];_0x209a62+=0x1){_[_0xe659('0x20')](_0xb1c03a,_0x236eaa[_0x209a62]);}for(var _0x21b60e in _0xb1c03a){if(_0xb1c03a[_0xe659('0x21')](_0x21b60e)){_0xb1c03a[_0x21b60e]=this[_0xe659('0x1d')](_0xb1c03a[_0x21b60e],_0x236eaa);}}return _0xb1c03a;};exports[_0xe659('0x22')]=function(_0x31edbb){return _0x31edbb['match'](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports[_0xe659('0x23')]=function(_0x3c5365){return _0x3c5365[_0xe659('0x24')](/^\S+@\S+$/)?!![]:![];};exports[_0xe659('0x25')]=function(_0x4ce4fa){var _0x489b5b=[];_0x4ce4fa[_0xe659('0x6')](/[ ,]+/)[_0xe659('0x26')](function(_0x2be990){_0x2be990=_0x2be990['replace'](/([^:]")"+/g,'$1');_0x2be990='+'+_0x2be990+'*';if(_0x2be990[_0xe659('0x27')]('@'))_0x2be990='\x22'+_0x2be990+'\x22';_0x489b5b[_0xe659('0x28')](_0x2be990);});return _0x489b5b[_0xe659('0x29')]('\x20');};exports[_0xe659('0x2a')]=function(_0x169acb,_0x1a2010,_0x31db7a){var _0x5ca556={},_0x10ccb4={};if(_0x1a2010['query'][_0xe659('0x2b')]){_0x1a2010[_0xe659('0x2c')]['id']=_0x1a2010[_0xe659('0x2c')]['$id'];delete _0x1a2010[_0xe659('0x2c')][_0xe659('0x2b')];}_0x5ca556[_0xe659('0x2d')]=_[_0xe659('0x15')](_0x169acb,_0xe659('0x12'));_0x5ca556[_0xe659('0x2c')]=_[_0xe659('0x4')](_0x1a2010[_0xe659('0x2c')]);_0x5ca556[_0xe659('0x2e')]=_[_0xe659('0x2f')](_0x5ca556['model'],_0x5ca556[_0xe659('0x2c')]);_0x10ccb4[_0xe659('0x30')]=_[_0xe659('0x2f')](_0x5ca556['model'],this[_0xe659('0x5')](_0x1a2010[_0xe659('0x2c')]['fields']));_0x10ccb4[_0xe659('0x30')]=_0x10ccb4[_0xe659('0x30')]['length']?_0x10ccb4[_0xe659('0x30')]:_0x5ca556[_0xe659('0x2d')];if(!_0x1a2010[_0xe659('0x2c')]['hasOwnProperty'](_0xe659('0x31'))){_0x10ccb4[_0xe659('0x32')]=this[_0xe659('0x32')](_0x1a2010[_0xe659('0x2c')][_0xe659('0x32')]);_0x10ccb4[_0xe659('0x33')]=this[_0xe659('0x33')](_0x1a2010[_0xe659('0x2c')][_0xe659('0x33')]);}_0x10ccb4[_0xe659('0x34')]=this['sort'](_0x1a2010[_0xe659('0x2c')][_0xe659('0x14')]);_0x10ccb4['where']=this[_0xe659('0x2e')](_[_0xe659('0x35')](_0x1a2010[_0xe659('0x2c')],_0x5ca556[_0xe659('0x2e')]),_0x169acb);if(_0x1a2010[_0xe659('0x2c')][_0xe659('0x36')]){_0x10ccb4[_0xe659('0x37')]=_[_0xe659('0x38')](_0x10ccb4[_0xe659('0x37')],{'$or':_['map'](_0x169acb,function(_0x1cee3c){if(_0x1cee3c[_0xe659('0x39')]!=='VIRTUAL'){if(_0x31db7a){return sequelize[_0xe659('0x37')](sequelize['fn'](_0xe659('0x3a'),sequelize[_0xe659('0x1a')](_0x1cee3c[_0xe659('0x12')])),{'$like':sequelize['fn'](_0xe659('0x3a'),'%'+_0x1a2010[_0xe659('0x2c')][_0xe659('0x36')]+'%')});}else{var _0xa1217f={};_0xa1217f[_0x1cee3c[_0xe659('0x12')]]={'$like':'%'+_0x1a2010['query'][_0xe659('0x36')]+'%'};return _0xa1217f;}}})});}_0x10ccb4=_['merge']({},_0x10ccb4,_0x1a2010[_0xe659('0x3b')]);return _0x10ccb4;}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 6ff2dd9..7fcb665 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc778=['use','urlencoded','50mb','json','express','serve-favicon','body-parser','method-override','errorhandler','path','passport','cors','moment','./environment','../mysqldb','default','get','env','production','set','join','root','public','development','test','appPath','toISOString','split','static','views','/server/views','html','view\x20engine'];(function(_0x88ae93,_0x317aa0){var _0x3ae96f=function(_0x35a2c3){while(--_0x35a2c3){_0x88ae93['push'](_0x88ae93['shift']());}};_0x3ae96f(++_0x317aa0);}(_0xc778,0xca));var _0x8c77=function(_0x39e94f,_0xa66d12){_0x39e94f=_0x39e94f-0x0;var _0x59591c=_0xc778[_0x39e94f];return _0x59591c;};'use strict';var express=require(_0x8c77('0x0'));var favicon=require(_0x8c77('0x1'));var bodyParser=require(_0x8c77('0x2'));var methodOverride=require(_0x8c77('0x3'));var cookieParser=require('cookie-parser');var errorHandler=require(_0x8c77('0x4'));var path=require(_0x8c77('0x5'));var passport=require(_0x8c77('0x6'));var cors=require(_0x8c77('0x7'));var moment=require(_0x8c77('0x8'));var config=require(_0x8c77('0x9'));var db=require(_0x8c77('0xa'))['db'];exports[_0x8c77('0xb')]=function(_0x216eea){var _0x418396=_0x216eea[_0x8c77('0xc')](_0x8c77('0xd'));if(_0x418396===_0x8c77('0xe')){_0x216eea[_0x8c77('0xf')]('appPath',path[_0x8c77('0x10')](config[_0x8c77('0x11')],_0x8c77('0x12')));}if(_0x418396===_0x8c77('0x13')||_0x418396===_0x8c77('0x14')){_0x216eea[_0x8c77('0xf')](_0x8c77('0x15'),path[_0x8c77('0x10')](config[_0x8c77('0x11')],'client'));_0x216eea['use'](errorHandler());}_0x216eea[_0x8c77('0xf')]('json\x20replacer',function(_0x46bfe4,_0x501910){if(this[_0x46bfe4]instanceof Date){_0x501910=this[_0x46bfe4][_0x8c77('0x16')]()[_0x8c77('0x17')]('.')[0x0]+'Z';}return _0x501910;});_0x216eea['use'](express[_0x8c77('0x18')](_0x216eea[_0x8c77('0xc')](_0x8c77('0x15'))));_0x216eea[_0x8c77('0xf')](_0x8c77('0x19'),config[_0x8c77('0x11')]+_0x8c77('0x1a'));_0x216eea['engine'](_0x8c77('0x1b'),require('ejs')['renderFile']);_0x216eea['set'](_0x8c77('0x1c'),_0x8c77('0x1b'));_0x216eea[_0x8c77('0x1d')](bodyParser[_0x8c77('0x1e')]({'limit':_0x8c77('0x1f'),'extended':!![]}));_0x216eea['use'](bodyParser[_0x8c77('0x20')]({'limit':'50mb'}));_0x216eea[_0x8c77('0x1d')](cors());_0x216eea['use'](methodOverride());_0x216eea[_0x8c77('0x1d')](cookieParser());_0x216eea['use'](passport['initialize']());}; \ No newline at end of file +var _0x4a9b=['engine','html','urlencoded','json','initialize','express','serve-favicon','body-parser','method-override','cookie-parser','errorhandler','passport','cors','moment','default','env','production','set','appPath','join','development','root','client','use','get','/server/views'];(function(_0x5bf21b,_0x1ec193){var _0x31ffa3=function(_0x4053dd){while(--_0x4053dd){_0x5bf21b['push'](_0x5bf21b['shift']());}};_0x31ffa3(++_0x1ec193);}(_0x4a9b,0x6d));var _0xb4a9=function(_0x5b7784,_0x341318){_0x5b7784=_0x5b7784-0x0;var _0x58272c=_0x4a9b[_0x5b7784];return _0x58272c;};'use strict';var express=require(_0xb4a9('0x0'));var favicon=require(_0xb4a9('0x1'));var bodyParser=require(_0xb4a9('0x2'));var methodOverride=require(_0xb4a9('0x3'));var cookieParser=require(_0xb4a9('0x4'));var errorHandler=require(_0xb4a9('0x5'));var path=require('path');var passport=require(_0xb4a9('0x6'));var cors=require(_0xb4a9('0x7'));var moment=require(_0xb4a9('0x8'));var config=require('./environment');var db=require('../mysqldb')['db'];exports[_0xb4a9('0x9')]=function(_0x9df543){var _0x4d1aa3=_0x9df543['get'](_0xb4a9('0xa'));if(_0x4d1aa3===_0xb4a9('0xb')){_0x9df543[_0xb4a9('0xc')](_0xb4a9('0xd'),path[_0xb4a9('0xe')](config['root'],'public'));}if(_0x4d1aa3===_0xb4a9('0xf')||_0x4d1aa3==='test'){_0x9df543[_0xb4a9('0xc')](_0xb4a9('0xd'),path['join'](config[_0xb4a9('0x10')],_0xb4a9('0x11')));_0x9df543[_0xb4a9('0x12')](errorHandler());}_0x9df543[_0xb4a9('0xc')]('json\x20replacer',function(_0x4d0ed5,_0x1a1f29){if(this[_0x4d0ed5]instanceof Date){_0x1a1f29=this[_0x4d0ed5]['toISOString']()['split']('.')[0x0]+'Z';}return _0x1a1f29;});_0x9df543['use'](express['static'](_0x9df543[_0xb4a9('0x13')]('appPath')));_0x9df543['set']('views',config[_0xb4a9('0x10')]+_0xb4a9('0x14'));_0x9df543[_0xb4a9('0x15')]('html',require('ejs')['renderFile']);_0x9df543['set']('view\x20engine',_0xb4a9('0x16'));_0x9df543[_0xb4a9('0x12')](bodyParser[_0xb4a9('0x17')]({'limit':'50mb','extended':!![]}));_0x9df543[_0xb4a9('0x12')](bodyParser[_0xb4a9('0x18')]({'limit':'50mb'}));_0x9df543[_0xb4a9('0x12')](cors());_0x9df543['use'](methodOverride());_0x9df543[_0xb4a9('0x12')](cookieParser());_0x9df543[_0xb4a9('0x12')](passport[_0xb4a9('0x19')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 96d20d7..e9b4510 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 _0xfbb4=['replace','ipAddress','substring','bimedia-machine-uuid','execSync','../environment','networkInterfaces','orderBy','keys','family','IPv4','concat','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','map','model','createHash','md5','digest','hex','getUuid','platform','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','utf8'];(function(_0x54fdd8,_0x2e81ae){var _0x4f6f8a=function(_0x2a970c){while(--_0x2a970c){_0x54fdd8['push'](_0x54fdd8['shift']());}};_0x4f6f8a(++_0x2e81ae);}(_0xfbb4,0x177));var _0x4fbb=function(_0x246f03,_0x4da389){_0x246f03=_0x246f03-0x0;var _0x2e49eb=_0xfbb4[_0x246f03];return _0x2e49eb;};'use strict';var _=require('lodash');var os=require('os');var crypto=require('crypto');var machine=require(_0x4fbb('0x0'));var exec=require('child_process')[_0x4fbb('0x1')];var config=require(_0x4fbb('0x2'));function getInterfaces(){var _0x1fb987=[];var _0xe160b8=os[_0x4fbb('0x3')]();var _0x412669=_[_0x4fbb('0x4')](_[_0x4fbb('0x5')](_0xe160b8));for(var _0xdde726=0x0;_0xdde726<_0x412669['length'];_0xdde726++){var _0x33a946=_0xe160b8[_0x412669[_0xdde726]]['filter'](function(_0x595203){return _0x595203[_0x4fbb('0x6')]===_0x4fbb('0x7')&&_0x595203['internal']===![];});_0x1fb987=_0x1fb987[_0x4fbb('0x8')](_0x33a946);}return _0x1fb987;}function getFirstInterface(){var _0x2269de=_['head'](getInterfaces());return{'macAddress':_0x2269de&&_0x2269de[_0x4fbb('0x9')]?_0x2269de['mac']:_0x4fbb('0xa'),'ipAddress':_0x2269de&&_0x2269de[_0x4fbb('0xb')]?_0x2269de[_0x4fbb('0xb')]:_0x4fbb('0xc')};}exports[_0x4fbb('0xd')]=getFirstInterface;function getCPUhash(){var _0x5a59d1=_[_0x4fbb('0x4')](os[_0x4fbb('0xe')]()[_0x4fbb('0xf')](function(_0x4b8a79){return _0x4b8a79[_0x4fbb('0x10')];}))['join'](':');return crypto[_0x4fbb('0x11')](_0x4fbb('0x12'))['update'](_0x5a59d1)[_0x4fbb('0x13')](_0x4fbb('0x14'));}exports[_0x4fbb('0x15')]=function(){var _0x1496fd=os[_0x4fbb('0x16')]();var _0x57414a=/[0-9a-f-]{36}/;if(config[_0x4fbb('0x17')]&&_0x57414a[_0x4fbb('0x18')](config[_0x4fbb('0x17')])){return config[_0x4fbb('0x17')];}else if(_0x1496fd===_0x4fbb('0x19')){return exec(_0x4fbb('0x1a'),{'encoding':_0x4fbb('0x1b')})[_0x4fbb('0x1c')]('\x0d\x0a','');}else{var _0x27dc9c=getFirstInterface();var _0xd6748=getCPUhash();var _0x1af3a9=_0xd6748+'|'+os['hostname']()+'|'+_0x27dc9c['macAddress']+'|'+_0x27dc9c[_0x4fbb('0x1d')];var _0x27f708=crypto['createHash'](_0x4fbb('0x12'))['update'](_0x1af3a9)[_0x4fbb('0x13')](_0x4fbb('0x14'));return _0x27f708['substring'](0x0,0x8)+'-'+_0x27f708[_0x4fbb('0x1e')](0x8,0xc)+'-'+_0x27f708[_0x4fbb('0x1e')](0xc,0x10)+'-'+_0x27f708[_0x4fbb('0x1e')](0x10,0x14)+'-'+_0x27f708['substring'](0x14);}}; \ No newline at end of file +var _0x53d9=['licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','ipAddress','substring','lodash','crypto','bimedia-machine-uuid','../environment','networkInterfaces','orderBy','keys','length','filter','IPv4','internal','concat','head','mac','00:00:00:00:00:00','address','getFirstInterface','cpus','map','join','createHash','md5','update','digest','hex','getUuid','platform'];(function(_0x2177be,_0x589139){var _0x13744e=function(_0x2ea154){while(--_0x2ea154){_0x2177be['push'](_0x2177be['shift']());}};_0x13744e(++_0x589139);}(_0x53d9,0x1c6));var _0x953d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x53d9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x953d('0x0'));var os=require('os');var crypto=require(_0x953d('0x1'));var machine=require(_0x953d('0x2'));var exec=require('child_process')['execSync'];var config=require(_0x953d('0x3'));function getInterfaces(){var _0x41791a=[];var _0x24dc3e=os[_0x953d('0x4')]();var _0x28e23e=_[_0x953d('0x5')](_[_0x953d('0x6')](_0x24dc3e));for(var _0x2a11de=0x0;_0x2a11de<_0x28e23e[_0x953d('0x7')];_0x2a11de++){var _0x1f2213=_0x24dc3e[_0x28e23e[_0x2a11de]][_0x953d('0x8')](function(_0x35361b){return _0x35361b['family']===_0x953d('0x9')&&_0x35361b[_0x953d('0xa')]===![];});_0x41791a=_0x41791a[_0x953d('0xb')](_0x1f2213);}return _0x41791a;}function getFirstInterface(){var _0x5782ac=_[_0x953d('0xc')](getInterfaces());return{'macAddress':_0x5782ac&&_0x5782ac[_0x953d('0xd')]?_0x5782ac['mac']:_0x953d('0xe'),'ipAddress':_0x5782ac&&_0x5782ac[_0x953d('0xf')]?_0x5782ac[_0x953d('0xf')]:'127.0.0.1'};}exports[_0x953d('0x10')]=getFirstInterface;function getCPUhash(){var _0x2e6aed=_[_0x953d('0x5')](os[_0x953d('0x11')]()[_0x953d('0x12')](function(_0x5e5750){return _0x5e5750['model'];}))[_0x953d('0x13')](':');return crypto[_0x953d('0x14')](_0x953d('0x15'))[_0x953d('0x16')](_0x2e6aed)[_0x953d('0x17')](_0x953d('0x18'));}exports[_0x953d('0x19')]=function(){var _0x296f46=os[_0x953d('0x1a')]();var _0x21ef19=/[0-9a-f-]{36}/;if(config[_0x953d('0x1b')]&&_0x21ef19[_0x953d('0x1c')](config[_0x953d('0x1b')])){return config[_0x953d('0x1b')];}else if(_0x296f46===_0x953d('0x1d')){return exec(_0x953d('0x1e'),{'encoding':_0x953d('0x1f')})[_0x953d('0x20')]('\x0d\x0a','');}else{var _0x376eb5=getFirstInterface();var _0x6dc778=getCPUhash();var _0x3739b9=_0x6dc778+'|'+os[_0x953d('0x21')]()+'|'+_0x376eb5[_0x953d('0x22')]+'|'+_0x376eb5[_0x953d('0x23')];var _0x2d21a3=crypto[_0x953d('0x14')](_0x953d('0x15'))[_0x953d('0x16')](_0x3739b9)['digest']('hex');return _0x2d21a3['substring'](0x0,0x8)+'-'+_0x2d21a3[_0x953d('0x24')](0x8,0xc)+'-'+_0x2d21a3[_0x953d('0x24')](0xc,0x10)+'-'+_0x2d21a3[_0x953d('0x24')](0x10,0x14)+'-'+_0x2d21a3['substring'](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 0689d2f..a638d8c 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 _0x29fd=['catch','get','data1','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','data2','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','DEMO\x20START\x20AT\x20%s','error','message','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','moment','request-promise','bluebird','pkginfo','version','../../mysqldb','../../components/encryptor','../logger','license','format','%s/api/servers/%s/check?version=%s','exports','then'];(function(_0x50fef5,_0x19f643){var _0x579925=function(_0x3684fb){while(--_0x3684fb){_0x50fef5['push'](_0x50fef5['shift']());}};_0x579925(++_0x19f643);}(_0x29fd,0x9e));var _0xd29f=function(_0x512fdb,_0x3151d8){_0x512fdb=_0x512fdb-0x0;var _0x326b5f=_0x29fd[_0x512fdb];return _0x326b5f;};'use strict';var util=require(_0xd29f('0x0'));var moment=require(_0xd29f('0x1'));var rp=require(_0xd29f('0x2'));var BPromise=require(_0xd29f('0x3'));var pkginfo=require(_0xd29f('0x4'))(module,_0xd29f('0x5'));var db=require(_0xd29f('0x6'))['db'];var encryptor=require(_0xd29f('0x7'));var hardware=require('./hardware');var logger=require(_0xd29f('0x8'))(_0xd29f('0x9'));var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x22e0ae){return new BPromise(function(_0x167233,_0x488f94){var _0x5edbdd=util[_0xd29f('0xa')](_0xd29f('0xb'),HOST,_0x22e0ae,module['exports'][_0xd29f('0x5')]);if(oldToken){_0x5edbdd=util[_0xd29f('0xa')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x22e0ae,module[_0xd29f('0xc')][_0xd29f('0x5')],oldToken);}var _0x369df1={'uri':_0x5edbdd,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x369df1)[_0xd29f('0xd')](function(_0x181afd){_0x167233(_0x181afd);})[_0xd29f('0xe')](function(_0x59d674){_0x488f94(_0x59d674);});});}function manageLicense(_0xc6c6dc,_0x1eebe8){var _0xd85c92=_0x1eebe8[_0xd29f('0xf')]({'plain':!![]});if(!isOldTokenSent&&_0xd85c92[_0xd29f('0x10')]!==_0xc6c6dc&&!_0xd85c92['data2']){oldToken=_0xd85c92[_0xd29f('0x10')];}httpRequest(_0xc6c6dc)[_0xd29f('0xd')](function(_0x1cf2b4){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x1cf2b4[_0xd29f('0x11')]){isOldTokenSent=![];if(!_0xd85c92[_0xd29f('0x9')]&&_0xd85c92[_0xd29f('0x9')]!=_0x1cf2b4[_0xd29f('0x9')]||_0xd85c92[_0xd29f('0x9')]&&_0xd85c92['data2']){logger[_0xd29f('0x12')](_0xd29f('0x13'));}if(_0xd85c92[_0xd29f('0x9')]&&!_0xd85c92['data2']&&_0xd85c92[_0xd29f('0x9')]!=_0x1cf2b4['license']){logger[_0xd29f('0x12')](_0xd29f('0x14'));}if(_0xd85c92[_0xd29f('0x9')]&&!_0xd85c92[_0xd29f('0x15')]&&_0xd85c92[_0xd29f('0x9')]==_0x1cf2b4[_0xd29f('0x9')]){return _0x1eebe8;}return _0x1eebe8[_0xd29f('0x16')]({'data1':_0xc6c6dc,'data2':null,'license':_0x1cf2b4[_0xd29f('0x9')]});}else{if(_0x1cf2b4[_0xd29f('0x9')]||_0xd85c92[_0xd29f('0x9')]){if(!_0xd85c92['data2']){if(_0xd85c92[_0xd29f('0x10')]==_0xc6c6dc){GRAY_PERIOD_REASON=_0xd29f('0x17');logger[_0xd29f('0x12')](_0xd29f('0x18'));}else{GRAY_PERIOD_REASON=_0xd29f('0x19');logger['info'](_0xd29f('0x1a'),_0xd85c92[_0xd29f('0x10')],_0xc6c6dc);}logger['info'](_0xd29f('0x1b'),GRAY_PERIOD_REASON[_0xd29f('0x1c')](),moment()[_0xd29f('0xa')](_0xd29f('0x1d')));return _0x1eebe8[_0xd29f('0x16')]({'data2':encryptor[_0xd29f('0x1e')](moment()['format']('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0xd29f('0x1f')](encryptor[_0xd29f('0x20')](_0xd85c92['data2']),'days')>DAYS){logger['info'](_0xd29f('0x21'),moment()[_0xd29f('0xa')](_0xd29f('0x1d')));isOldTokenSent=![];return _0x1eebe8[_0xd29f('0x16')]({'data1':_0xc6c6dc,'data2':null,'license':null});}}}else{if(_0xd85c92[_0xd29f('0x10')]!=_0xc6c6dc){logger[_0xd29f('0x12')](_0xd29f('0x1a'),_0xd85c92[_0xd29f('0x10')],_0xc6c6dc);return _0x1eebe8['update']({'data1':_0xc6c6dc,'data2':null,'license':null});}}}return _0x1eebe8;})['then'](function(_0x24ce40){_0x1eebe8=_0x24ce40;})['catch'](function(_0x451ae7){logger[_0xd29f('0x22')](_0x451ae7[_0xd29f('0x23')]);})[_0xd29f('0x24')](function(){setTimeout(function(){manageLicense(hardware[_0xd29f('0x25')](),_0x1eebe8);},TIME);});}function defaultLicense(){var _0x2a00de=hardware[_0xd29f('0x25')]();if(_0x2a00de){return db[_0xd29f('0x26')][_0xd29f('0x27')]({'where':{'id':0x1},'defaults':{'data1':_0x2a00de}})[_0xd29f('0x28')](function(_0x46fc44,_0x511d07){logger[_0xd29f('0x12')](_0xd29f('0x29'),_0x2a00de);manageLicense(_0x2a00de,_0x46fc44);})[_0xd29f('0xe')](function(_0x5e8e71){logger['error'](_0x5e8e71[_0xd29f('0x23')]);});}}exports[_0xd29f('0x2a')]=defaultLicense; \ No newline at end of file +var _0x4c44=['SERVICE\x20LICENSE\x20STARTED\x20%s','error','default','util','moment','request-promise','bluebird','pkginfo','version','../../mysqldb','./hardware','../logger','license','https://www.xcallymotion.com','%s/api/servers/%s/check?version=%s','format','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','get','data1','data2','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','encryptString','YYYY-MM-DD\x20HH:mm','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','message','getUuid','License','findOrCreate','spread'];(function(_0x48da53,_0x59398d){var _0x3f75ac=function(_0x1632d8){while(--_0x1632d8){_0x48da53['push'](_0x48da53['shift']());}};_0x3f75ac(++_0x59398d);}(_0x4c44,0x130));var _0x44c4=function(_0x38b255,_0x3fd343){_0x38b255=_0x38b255-0x0;var _0x26f9bb=_0x4c44[_0x38b255];return _0x26f9bb;};'use strict';var util=require(_0x44c4('0x0'));var moment=require(_0x44c4('0x1'));var rp=require(_0x44c4('0x2'));var BPromise=require(_0x44c4('0x3'));var pkginfo=require(_0x44c4('0x4'))(module,_0x44c4('0x5'));var db=require(_0x44c4('0x6'))['db'];var encryptor=require('../../components/encryptor');var hardware=require(_0x44c4('0x7'));var logger=require(_0x44c4('0x8'))(_0x44c4('0x9'));var HOST=_0x44c4('0xa');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x1bfbe3){return new BPromise(function(_0x238d32,_0x271c42){var _0x1ca840=util['format'](_0x44c4('0xb'),HOST,_0x1bfbe3,module['exports'][_0x44c4('0x5')]);if(oldToken){_0x1ca840=util[_0x44c4('0xc')](_0x44c4('0xd'),HOST,_0x1bfbe3,module['exports'][_0x44c4('0x5')],oldToken);}var _0x3029bb={'uri':_0x1ca840,'method':_0x44c4('0xe'),'timeout':0xea60,'json':!![]};return rp(_0x3029bb)[_0x44c4('0xf')](function(_0x1ac14c){_0x238d32(_0x1ac14c);})[_0x44c4('0x10')](function(_0x10f70f){_0x271c42(_0x10f70f);});});}function manageLicense(_0x27a351,_0x10881a){var _0x13a941=_0x10881a[_0x44c4('0x11')]({'plain':!![]});if(!isOldTokenSent&&_0x13a941[_0x44c4('0x12')]!==_0x27a351&&!_0x13a941[_0x44c4('0x13')]){oldToken=_0x13a941[_0x44c4('0x12')];}httpRequest(_0x27a351)['then'](function(_0x31ae0e){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x31ae0e[_0x44c4('0x14')]){isOldTokenSent=![];if(!_0x13a941['license']&&_0x13a941[_0x44c4('0x9')]!=_0x31ae0e[_0x44c4('0x9')]||_0x13a941[_0x44c4('0x9')]&&_0x13a941[_0x44c4('0x13')]){logger[_0x44c4('0x15')](_0x44c4('0x16'));}if(_0x13a941['license']&&!_0x13a941['data2']&&_0x13a941[_0x44c4('0x9')]!=_0x31ae0e[_0x44c4('0x9')]){logger[_0x44c4('0x15')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x13a941['license']&&!_0x13a941['data2']&&_0x13a941['license']==_0x31ae0e[_0x44c4('0x9')]){return _0x10881a;}return _0x10881a[_0x44c4('0x17')]({'data1':_0x27a351,'data2':null,'license':_0x31ae0e['license']});}else{if(_0x31ae0e[_0x44c4('0x9')]||_0x13a941[_0x44c4('0x9')]){if(!_0x13a941['data2']){if(_0x13a941[_0x44c4('0x12')]==_0x27a351){GRAY_PERIOD_REASON=_0x44c4('0x18');logger[_0x44c4('0x15')](_0x44c4('0x19'));}else{GRAY_PERIOD_REASON='Changed';logger[_0x44c4('0x15')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x13a941[_0x44c4('0x12')],_0x27a351);}logger['info'](_0x44c4('0x1a'),GRAY_PERIOD_REASON[_0x44c4('0x1b')](),moment()[_0x44c4('0xc')]('YYYY-MM-DD\x20HH:mm'));return _0x10881a[_0x44c4('0x17')]({'data2':encryptor[_0x44c4('0x1c')](moment()[_0x44c4('0xc')](_0x44c4('0x1d')))});}else{if(moment()[_0x44c4('0x1e')](encryptor[_0x44c4('0x1f')](_0x13a941[_0x44c4('0x13')]),_0x44c4('0x20'))>DAYS){logger[_0x44c4('0x15')](_0x44c4('0x21'),moment()[_0x44c4('0xc')](_0x44c4('0x1d')));isOldTokenSent=![];return _0x10881a[_0x44c4('0x17')]({'data1':_0x27a351,'data2':null,'license':null});}}}else{if(_0x13a941[_0x44c4('0x12')]!=_0x27a351){logger['info'](_0x44c4('0x22'),_0x13a941[_0x44c4('0x12')],_0x27a351);return _0x10881a[_0x44c4('0x17')]({'data1':_0x27a351,'data2':null,'license':null});}}}return _0x10881a;})['then'](function(_0x501c0a){_0x10881a=_0x501c0a;})[_0x44c4('0x10')](function(_0x1d6c7b){logger['error'](_0x1d6c7b[_0x44c4('0x23')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x10881a);},TIME);});}function defaultLicense(){var _0xb3bff0=hardware[_0x44c4('0x24')]();if(_0xb3bff0){return db[_0x44c4('0x25')][_0x44c4('0x26')]({'where':{'id':0x1},'defaults':{'data1':_0xb3bff0}})[_0x44c4('0x27')](function(_0x551c7d,_0x43aab5){logger[_0x44c4('0x15')](_0x44c4('0x28'),_0xb3bff0);manageLicense(_0xb3bff0,_0x551c7d);})['catch'](function(_0x2a73fd){logger[_0x44c4('0x29')](_0x2a73fd[_0x44c4('0x23')]);});}}exports[_0x44c4('0x2a')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 38fcbc3..da08b47 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 _0x0ae9=['getUuid','defaults','then','catch','data1','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','%s:%s:%s','parse','demo','uuid','gray','add','days','grayReason','changed','disabled','message','User','findAll','role','sequelize','COUNT','col','admin','user','telephone','users','forEach','count','pick','countBy','License\x20limit\x20reached\x20for\x20users','exports','util','lodash','moment','bluebird','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','Breaking\x20license'];(function(_0x58c662,_0x213a8a){var _0x261a7f=function(_0x57feb5){while(--_0x57feb5){_0x58c662['push'](_0x58c662['shift']());}};_0x261a7f(++_0x213a8a);}(_0x0ae9,0x82));var _0x90ae=function(_0x399245,_0x469f74){_0x399245=_0x399245-0x0;var _0xdbff2c=_0x0ae9[_0x399245];return _0xdbff2c;};'use strict';var util=require(_0x90ae('0x0'));var _=require(_0x90ae('0x1'));var moment=require(_0x90ae('0x2'));var BPromise=require(_0x90ae('0x3'));var hardware=require('./hardware');var encryptor=require('../../components/encryptor');var db=require(_0x90ae('0x4'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x90ae('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x90ae('0x6'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x90ae('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x90ae('0x7'),'machineUuid':hardware[_0x90ae('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x3ad40b){return new BPromise(function(_0x3cec0e,_0x123f0f){return db['License']['find'](_[_0x90ae('0x9')](_0x3ad40b,{'raw':!![],'where':{'id':0x1}}))[_0x90ae('0xa')](function(_0x414676){return checkLicense(_0x414676,null);})['then'](function(_0x1da052){_0x3cec0e(_0x1da052);return;})[_0x90ae('0xb')](function(_0x347bf9){_0x123f0f(_0x347bf9);});});}function checkLicense(_0x3c488f,_0x151529){if(!_0x3c488f){demoLicense['uuid']=_0x3c488f[_0x90ae('0xc')];return demoLicense;}try{var _0x11a57b=_0x151529||_0x3c488f['license'];if(_[_0x90ae('0xd')](_0x11a57b)){throw new Error(_0x90ae('0xe'));}var _0x38e921=_0x3c488f['data1'];var _0x4c5c2c=_0x3c488f[_0x90ae('0xf')];var _0x220bc3=_0x38e921[_0x90ae('0x10')]('-')[0x4];var _0x56ef06=_0x38e921[_0x90ae('0x10')]('-')[0x0];var _0xfafd=encryptor[_0x90ae('0x11')](_0x11a57b,util[_0x90ae('0x12')](_0x90ae('0x13'),_0x220bc3,_0x38e921,_0x56ef06));var _0x3458a3=JSON[_0x90ae('0x14')](_0xfafd);_0x3458a3[_0x90ae('0x15')]=![];_0x3458a3[_0x90ae('0x16')]=_0x38e921;_0x3458a3['machineUuid']=hardware['getUuid']();if(_0x4c5c2c){var _0x415988=encryptor[_0x90ae('0x11')](_0x4c5c2c);_0x3458a3[_0x90ae('0x17')]=_0x415988;_0x3458a3['deadline']=moment(_0x415988)[_0x90ae('0x18')](0x7,_0x90ae('0x19'))[_0x90ae('0x12')]();_0x3458a3[_0x90ae('0x1a')]=_0x3458a3['uuid']!=_0x3458a3['machineUuid']?_0x90ae('0x1b'):_0x90ae('0x1c');}return _0x3458a3;}catch(_0x4c691a){breakingLicense['uuid']=_0x3c488f[_0x90ae('0xc')];breakingLicense[_0x90ae('0x1d')]=_0x4c691a[_0x90ae('0x1d')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x22e517,_0x25f190){getLicense()[_0x90ae('0xa')](function(_0x56de9a){return db[_0x90ae('0x1e')][_0x90ae('0x1f')]({'attributes':[_0x90ae('0x20'),[db[_0x90ae('0x21')]['fn'](_0x90ae('0x22'),db[_0x90ae('0x21')][_0x90ae('0x23')]('role')),'count']],'group':_0x90ae('0x20'),'where':{'role':{'$or':[_0x90ae('0x24'),_0x90ae('0x25'),_0x90ae('0x26')]}},'raw':!![]})[_0x90ae('0xa')](function(_0x1a7676){var _0x29a34a={'user':_0x56de9a[_0x90ae('0x27')]||0x0,'telephone':_0x56de9a['telephones']||0x0};_0x1a7676[_0x90ae('0x28')](function(_0x5ae73c){var _0x5409b2=_0x5ae73c[_0x90ae('0x20')]===_0x90ae('0x24')?_0x90ae('0x25'):_0x5ae73c['role'];_0x29a34a[_0x5409b2]-=_0x5ae73c[_0x90ae('0x29')];if(_0x29a34a[_0x5409b2]<0x0)_0x29a34a[_0x5409b2]=0x0;});_0x22e517(_0x29a34a);return;});})[_0x90ae('0xb')](function(_0x19c3b0){_0x25f190(_0x19c3b0);});});}function checkUserLimits(_0x21032a){return new BPromise(function(_0x5b2224,_0x36c84c){getLimits()['then'](function(_0x316932){var _0xfedadd=_[_0x90ae('0x2a')](_[_0x90ae('0x2b')](_0x21032a,_0x90ae('0x20')),[_0x90ae('0x24'),_0x90ae('0x25'),'telephone']);var _0x239ee7=(_0xfedadd[_0x90ae('0x24')]||0x0)+(_0xfedadd[_0x90ae('0x25')]||0x0);var _0x508bc5=_0xfedadd[_0x90ae('0x26')]||0x0;if(_0x239ee7>_0x316932['user'])return _0x36c84c(_0x90ae('0x2c'));if(_0x508bc5>_0x316932[_0x90ae('0x26')])return _0x36c84c('License\x20limit\x20reached\x20for\x20telephones');return _0x5b2224();})[_0x90ae('0xb')](function(_0xab08d0){_0x36c84c(_0xab08d0);});});}module[_0x90ae('0x2d')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x20b8=['uuid','license','License\x20key\x20value\x20not\x20found','data1','split','decryptString','format','%s:%s:%s','machineUuid','gray','deadline','add','days','grayReason','disabled','message','sequelize','col','role','user','telephone','users','forEach','admin','pick','countBy','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','Breaking\x20license','getUuid','License','find','then','catch'];(function(_0x26ccee,_0x4c5e74){var _0x3f7e9e=function(_0x32bb40){while(--_0x32bb40){_0x26ccee['push'](_0x26ccee['shift']());}};_0x3f7e9e(++_0x4c5e74);}(_0x20b8,0x118));var _0x820b=function(_0x2883fd,_0x359cea){_0x2883fd=_0x2883fd-0x0;var _0x2cd6c3=_0x20b8[_0x2883fd];return _0x2cd6c3;};'use strict';var util=require(_0x820b('0x0'));var _=require(_0x820b('0x1'));var moment=require('moment');var BPromise=require(_0x820b('0x2'));var hardware=require(_0x820b('0x3'));var encryptor=require(_0x820b('0x4'));var db=require(_0x820b('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x820b('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x820b('0x7'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x820b('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x820b('0x8'),'machineUuid':hardware[_0x820b('0x9')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x43e2db){return new BPromise(function(_0x1cface,_0xf3acf){return db[_0x820b('0xa')][_0x820b('0xb')](_['defaults'](_0x43e2db,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x1b5c4d){return checkLicense(_0x1b5c4d,null);})[_0x820b('0xc')](function(_0x3b2cda){_0x1cface(_0x3b2cda);return;})[_0x820b('0xd')](function(_0x329da9){_0xf3acf(_0x329da9);});});}function checkLicense(_0x113ba1,_0x3e8ea5){if(!_0x113ba1){demoLicense[_0x820b('0xe')]=_0x113ba1['data1'];return demoLicense;}try{var _0x2d37a6=_0x3e8ea5||_0x113ba1[_0x820b('0xf')];if(_['isEmpty'](_0x2d37a6)){throw new Error(_0x820b('0x10'));}var _0x2844af=_0x113ba1[_0x820b('0x11')];var _0x84e6d7=_0x113ba1['data2'];var _0x2a2533=_0x2844af[_0x820b('0x12')]('-')[0x4];var _0x4e65da=_0x2844af['split']('-')[0x0];var _0x2d9a7e=encryptor[_0x820b('0x13')](_0x2d37a6,util[_0x820b('0x14')](_0x820b('0x15'),_0x2a2533,_0x2844af,_0x4e65da));var _0x58b86c=JSON['parse'](_0x2d9a7e);_0x58b86c['demo']=![];_0x58b86c[_0x820b('0xe')]=_0x2844af;_0x58b86c[_0x820b('0x16')]=hardware[_0x820b('0x9')]();if(_0x84e6d7){var _0x38e1de=encryptor[_0x820b('0x13')](_0x84e6d7);_0x58b86c[_0x820b('0x17')]=_0x38e1de;_0x58b86c[_0x820b('0x18')]=moment(_0x38e1de)[_0x820b('0x19')](0x7,_0x820b('0x1a'))[_0x820b('0x14')]();_0x58b86c[_0x820b('0x1b')]=_0x58b86c[_0x820b('0xe')]!=_0x58b86c[_0x820b('0x16')]?'changed':_0x820b('0x1c');}return _0x58b86c;}catch(_0x507ac7){breakingLicense[_0x820b('0xe')]=_0x113ba1[_0x820b('0x11')];breakingLicense[_0x820b('0x1d')]=_0x507ac7[_0x820b('0x1d')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x2bf675,_0xe1b6d6){getLicense()['then'](function(_0x35f7c5){return db['User']['findAll']({'attributes':['role',[db[_0x820b('0x1e')]['fn']('COUNT',db['sequelize'][_0x820b('0x1f')](_0x820b('0x20'))),'count']],'group':_0x820b('0x20'),'where':{'role':{'$or':['admin',_0x820b('0x21'),_0x820b('0x22')]}},'raw':!![]})[_0x820b('0xc')](function(_0x39f08d){var _0x5ae9a6={'user':_0x35f7c5[_0x820b('0x23')]||0x0,'telephone':_0x35f7c5['telephones']||0x0};_0x39f08d[_0x820b('0x24')](function(_0x536b4b){var _0x17c98e=_0x536b4b['role']===_0x820b('0x25')?'user':_0x536b4b['role'];_0x5ae9a6[_0x17c98e]-=_0x536b4b['count'];if(_0x5ae9a6[_0x17c98e]<0x0)_0x5ae9a6[_0x17c98e]=0x0;});_0x2bf675(_0x5ae9a6);return;});})[_0x820b('0xd')](function(_0x424431){_0xe1b6d6(_0x424431);});});}function checkUserLimits(_0x4e00c2){return new BPromise(function(_0x5900b6,_0x43688a){getLimits()[_0x820b('0xc')](function(_0x47fc9e){var _0x37a9ec=_[_0x820b('0x26')](_[_0x820b('0x27')](_0x4e00c2,'role'),[_0x820b('0x25'),'user',_0x820b('0x22')]);var _0x1d3f0f=(_0x37a9ec[_0x820b('0x25')]||0x0)+(_0x37a9ec[_0x820b('0x21')]||0x0);var _0x93083d=_0x37a9ec['telephone']||0x0;if(_0x1d3f0f>_0x47fc9e[_0x820b('0x21')])return _0x43688a('License\x20limit\x20reached\x20for\x20users');if(_0x93083d>_0x47fc9e[_0x820b('0x22')])return _0x43688a(_0x820b('0x28'));return _0x5900b6();})[_0x820b('0xd')](function(_0x315726){_0x43688a(_0x315726);});});}module[_0x820b('0x29')]={'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 47f6a1c..ec9e443 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 _0x3266=['secret','exports','http://localhost:9000','myappanuglar-secret','app-id'];(function(_0x5d2a6b,_0x1ecd68){var _0x5ceb12=function(_0x4ebdcd){while(--_0x4ebdcd){_0x5d2a6b['push'](_0x5d2a6b['shift']());}};_0x5ceb12(++_0x1ecd68);}(_0x3266,0x6a));var _0x6326=function(_0xef8146,_0x459c34){_0xef8146=_0xef8146-0x0;var _0x5a6cb0=_0x3266[_0xef8146];return _0x5a6cb0;};'use strict';module[_0x6326('0x0')]={'DOMAIN':_0x6326('0x1'),'SESSION_SECRET':_0x6326('0x2'),'GOOGLE_ID':_0x6326('0x3'),'GOOGLE_SECRET':_0x6326('0x4'),'DEBUG':''}; \ No newline at end of file +var _0x4991=['secret','exports','myappanuglar-secret'];(function(_0x3cbd13,_0x1edf57){var _0x51f997=function(_0x325e33){while(--_0x325e33){_0x3cbd13['push'](_0x3cbd13['shift']());}};_0x51f997(++_0x1edf57);}(_0x4991,0xf7));var _0x1499=function(_0x44aee6,_0x4a42c8){_0x44aee6=_0x44aee6-0x0;var _0x36c4ec=_0x4991[_0x44aee6];return _0x36c4ec;};'use strict';module[_0x1499('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0x1499('0x1'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':_0x1499('0x2'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index b4995ca..367a863 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5884=['message','{{{','replace','}}}','format','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','exports','Logger','transports','File','%s-%s','error','info','Console','env','debugLevel','moment','winston','INFO','join','log'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5884,0x9c));var _0x4588=function(_0x2a6896,_0x3283f8){_0x2a6896=_0x2a6896-0x0;var _0x594415=_0x5884[_0x2a6896];return _0x594415;};'use strict';var moment=require(_0x4588('0x0'));var winston=require(_0x4588('0x1'));var util=require('util');var path=require('path');var debugLevel=_0x4588('0x2');function filename(_0x4d2f4e,_0x4d4e67){return path[_0x4588('0x3')]('/var',_0x4588('0x4'),'xcally',util['format']('%s-%s.log',_0x4d2f4e,_0x4d4e67));}function formatter(_0x59f1e6,_0x4229c6){_0x4229c6[_0x4588('0x5')]=_0x4229c6[_0x4588('0x5')]['replace'](/@@{/g,_0x4588('0x6'))[_0x4588('0x7')](/}@@/g,_0x4588('0x8'))['replace'](/@{/g,'{{')[_0x4588('0x7')](/}@/g,'}}');return util[_0x4588('0x9')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0x4588('0x9')](_0x4588('0xa')),_0x4229c6[_0x4588('0xb')][_0x4588('0xc')](),_0x59f1e6,_0x4229c6['message']);}module[_0x4588('0xd')]=function(_0x1cc6f9){return new winston[(_0x4588('0xe'))]({'transports':[new winston[(_0x4588('0xf'))][(_0x4588('0x10'))]({'name':util['format'](_0x4588('0x11'),_0x1cc6f9,_0x4588('0x12')),'filename':filename(_0x1cc6f9,_0x4588('0x12')),'level':_0x4588('0x12'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3970a9){return formatter(_0x1cc6f9,_0x3970a9);}}),new winston[(_0x4588('0xf'))][(_0x4588('0x10'))]({'name':util[_0x4588('0x9')](_0x4588('0x11'),_0x1cc6f9,'info'),'filename':filename(_0x1cc6f9,_0x4588('0x13')),'level':'info','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3f9bb0){return formatter(_0x1cc6f9,_0x3f9bb0);}}),new winston[(_0x4588('0xf'))][(_0x4588('0x14'))]({'level':process[_0x4588('0x15')][_0x4588('0x16')]||debugLevel,'json':![],'formatter':function(_0x18cde5){return formatter(_0x1cc6f9,_0x18cde5);}})]});}; \ No newline at end of file +var _0x436b=['info','Console','env','debugLevel','winston','util','path','INFO','/var','log','xcally','message','{{{','}}}','replace','format','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','Logger','transports','File','%s-%s','error'];(function(_0x3e690a,_0x31aa0f){var _0x435ca0=function(_0x2d202d){while(--_0x2d202d){_0x3e690a['push'](_0x3e690a['shift']());}};_0x435ca0(++_0x31aa0f);}(_0x436b,0x9a));var _0xb436=function(_0x11627d,_0x1f993e){_0x11627d=_0x11627d-0x0;var _0x54c4f4=_0x436b[_0x11627d];return _0x54c4f4;};'use strict';var moment=require('moment');var winston=require(_0xb436('0x0'));var util=require(_0xb436('0x1'));var path=require(_0xb436('0x2'));var debugLevel=_0xb436('0x3');function filename(_0x479325,_0x1f3fbc){return path['join'](_0xb436('0x4'),_0xb436('0x5'),_0xb436('0x6'),util['format']('%s-%s.log',_0x479325,_0x1f3fbc));}function formatter(_0x59ea13,_0x3b3acf){_0x3b3acf[_0xb436('0x7')]=_0x3b3acf[_0xb436('0x7')]['replace'](/@@{/g,_0xb436('0x8'))['replace'](/}@@/g,_0xb436('0x9'))[_0xb436('0xa')](/@{/g,'{{')[_0xb436('0xa')](/}@/g,'}}');return util[_0xb436('0xb')](_0xb436('0xc'),moment()['format'](_0xb436('0xd')),_0x3b3acf[_0xb436('0xe')][_0xb436('0xf')](),_0x59ea13,_0x3b3acf[_0xb436('0x7')]);}module['exports']=function(_0x4891fa){return new winston[(_0xb436('0x10'))]({'transports':[new winston[(_0xb436('0x11'))][(_0xb436('0x12'))]({'name':util['format'](_0xb436('0x13'),_0x4891fa,_0xb436('0x14')),'filename':filename(_0x4891fa,_0xb436('0x14')),'level':_0xb436('0x14'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x5d0654){return formatter(_0x4891fa,_0x5d0654);}}),new winston[(_0xb436('0x11'))][(_0xb436('0x12'))]({'name':util['format'](_0xb436('0x13'),_0x4891fa,_0xb436('0x15')),'filename':filename(_0x4891fa,_0xb436('0x15')),'level':_0xb436('0x15'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x2f3b9c){return formatter(_0x4891fa,_0x2f3b9c);}}),new winston[(_0xb436('0x11'))][(_0xb436('0x16'))]({'level':process[_0xb436('0x17')][_0xb436('0x18')]||debugLevel,'json':![],'formatter':function(_0xf1e754){return formatter(_0x4891fa,_0xf1e754);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index d270ac2..598dd78 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 _0x1c1d=['path','express','../../services/express/index.js','ami','../../services/ami/index.js','agi','join','../../services/email/index.js','routing','xdr','../../services/xdr/index.js'];(function(_0x5f3b27,_0x19c552){var _0x1e0bf0=function(_0x2bc5bc){while(--_0x2bc5bc){_0x5f3b27['push'](_0x5f3b27['shift']());}};_0x1e0bf0(++_0x19c552);}(_0x1c1d,0x129));var _0xd1c1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1c1d[_0x3dd15e];return _0x231fd0;};'use strict';var path=require(_0xd1c1('0x0'));var os=require('os');var config={'apps':[{'name':_0xd1c1('0x1'),'script':path['join'](__dirname,_0xd1c1('0x2'))},{'name':_0xd1c1('0x3'),'script':path['join'](__dirname,_0xd1c1('0x4'))},{'name':_0xd1c1('0x5'),'script':path[_0xd1c1('0x6')](__dirname,'../../services/agi/index.js')},{'name':'email','script':path['join'](__dirname,_0xd1c1('0x7'))},{'name':_0xd1c1('0x8'),'script':path[_0xd1c1('0x6')](__dirname,'../../services/routing/index.js')},{'name':_0xd1c1('0x9'),'script':path[_0xd1c1('0x6')](__dirname,_0xd1c1('0xa'))}]};module['exports']=config; \ No newline at end of file +var _0xd6d9=['path','express','join','ami','../../services/ami/index.js','agi','../../services/agi/index.js','email','../../services/email/index.js','routing','../../services/xdr/index.js','exports'];(function(_0xbaf9bf,_0x5d96b2){var _0x2987ea=function(_0x23dd10){while(--_0x23dd10){_0xbaf9bf['push'](_0xbaf9bf['shift']());}};_0x2987ea(++_0x5d96b2);}(_0xd6d9,0x108));var _0x9d6d=function(_0x302840,_0x17eaba){_0x302840=_0x302840-0x0;var _0xe794eb=_0xd6d9[_0x302840];return _0xe794eb;};'use strict';var path=require(_0x9d6d('0x0'));var os=require('os');var config={'apps':[{'name':_0x9d6d('0x1'),'script':path[_0x9d6d('0x2')](__dirname,'../../services/express/index.js')},{'name':_0x9d6d('0x3'),'script':path['join'](__dirname,_0x9d6d('0x4'))},{'name':_0x9d6d('0x5'),'script':path['join'](__dirname,_0x9d6d('0x6'))},{'name':_0x9d6d('0x7'),'script':path[_0x9d6d('0x2')](__dirname,_0x9d6d('0x8'))},{'name':_0x9d6d('0x9'),'script':path[_0x9d6d('0x2')](__dirname,'../../services/routing/index.js')},{'name':'xdr','script':path['join'](__dirname,_0x9d6d('0xa'))}]};module[_0x9d6d('0xb')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 2762885..11baee7 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 _0xbf7e=['connect','connected','start','then','disconnect','stop','restart','list','describe','delete','dump','saved','pm2','./config'];(function(_0x44268d,_0xad8443){var _0x4be92d=function(_0x8a57ff){while(--_0x8a57ff){_0x44268d['push'](_0x44268d['shift']());}};_0x4be92d(++_0xad8443);}(_0xbf7e,0x194));var _0xebf7=function(_0x2dfa1b,_0x4a9bdf){_0x2dfa1b=_0x2dfa1b-0x0;var _0x462ab9=_0xbf7e[_0x2dfa1b];return _0x462ab9;};'use strict';var pm2=require(_0xebf7('0x0'));var BPromise=require('bluebird');var config=require(_0xebf7('0x1'));function connect(){return new BPromise(function(_0x1633fa,_0x24dded){return pm2[_0xebf7('0x2')](function(_0x17696a){if(_0x17696a){return _0x24dded(_0x17696a);}return _0x1633fa(_0xebf7('0x3'));});});};exports[_0xebf7('0x4')]=function(_0x326bca){return connect()[_0xebf7('0x5')](function(){return new BPromise(function(_0x445bd9,_0x148729){return pm2[_0xebf7('0x4')](_0x326bca,function(_0x20c3af,_0x363da2){if(_0x20c3af){return _0x148729(_0x20c3af);}pm2[_0xebf7('0x6')]();return _0x445bd9(_0x363da2);});});});};exports[_0xebf7('0x7')]=function(_0x56c149){return connect()['then'](function(){return new BPromise(function(_0x1d1ebb,_0x13fc54){return pm2['stop'](_0x56c149,function(_0x266722,_0x40c516){if(_0x266722){return _0x13fc54(_0x266722);}pm2[_0xebf7('0x6')]();return _0x1d1ebb(_0x40c516);});});});};exports[_0xebf7('0x8')]=function(_0x5cb17b){return connect()[_0xebf7('0x5')](function(){return new BPromise(function(_0x4b4ba5,_0x6ad6fa){return pm2[_0xebf7('0x8')](_0x5cb17b,function(_0x16029e,_0x219216){if(_0x16029e){return _0x6ad6fa(_0x16029e);}pm2[_0xebf7('0x6')]();return _0x4b4ba5(_0x219216);});});});};exports[_0xebf7('0x9')]=function(){return connect()[_0xebf7('0x5')](function(){return new BPromise(function(_0x92e653,_0x2f464f){return pm2['list'](function(_0x476dbe,_0x3a96bf){if(_0x476dbe){return _0x2f464f(_0x476dbe);}pm2[_0xebf7('0x6')]();return _0x92e653(_0x3a96bf);});});});};exports[_0xebf7('0xa')]=function(_0x5510d2){return connect()[_0xebf7('0x5')](function(){return new BPromise(function(_0x176fae,_0x4164dd){return pm2[_0xebf7('0xa')](_0x5510d2,function(_0x419633,_0x1b4404){if(_0x419633){return _0x4164dd(_0x419633);}pm2[_0xebf7('0x6')]();return _0x176fae(_0x1b4404);});});});};exports[_0xebf7('0xb')]=function(_0xc96bc6){return connect()['then'](function(){return new BPromise(function(_0x39d2a6,_0x1c0095){return pm2['delete'](_0xc96bc6,function(_0x211d55,_0x3134d5){if(_0x211d55){return _0x1c0095(_0x211d55);}pm2[_0xebf7('0x6')]();return _0x39d2a6(_0x3134d5);});});});};exports[_0xebf7('0xc')]=function(){return connect()[_0xebf7('0x5')](function(){return new BPromise(function(_0x450568,_0x2e5034){return pm2[_0xebf7('0xc')](function(_0x3c691c){if(_0x3c691c){return _0x2e5034(_0x3c691c);}return _0x450568(_0xebf7('0xd'));});});});}; \ No newline at end of file +var _0x97d4=['stop','restart','list','delete','dump','saved','pm2','bluebird','./config','connect','start','then','disconnect'];(function(_0x43aee5,_0x11268b){var _0x76d1d0=function(_0x3faee6){while(--_0x3faee6){_0x43aee5['push'](_0x43aee5['shift']());}};_0x76d1d0(++_0x11268b);}(_0x97d4,0xfd));var _0x497d=function(_0x536ed3,_0x481b22){_0x536ed3=_0x536ed3-0x0;var _0x1a3f43=_0x97d4[_0x536ed3];return _0x1a3f43;};'use strict';var pm2=require(_0x497d('0x0'));var BPromise=require(_0x497d('0x1'));var config=require(_0x497d('0x2'));function connect(){return new BPromise(function(_0x29e500,_0x4bc7e8){return pm2[_0x497d('0x3')](function(_0x30e5d8){if(_0x30e5d8){return _0x4bc7e8(_0x30e5d8);}return _0x29e500('connected');});});};exports[_0x497d('0x4')]=function(_0x3cc62b){return connect()[_0x497d('0x5')](function(){return new BPromise(function(_0x2a817a,_0x47707e){return pm2['start'](_0x3cc62b,function(_0x4b1198,_0x105a87){if(_0x4b1198){return _0x47707e(_0x4b1198);}pm2[_0x497d('0x6')]();return _0x2a817a(_0x105a87);});});});};exports[_0x497d('0x7')]=function(_0x57543c){return connect()[_0x497d('0x5')](function(){return new BPromise(function(_0x24455f,_0x56b754){return pm2[_0x497d('0x7')](_0x57543c,function(_0x4f0fc4,_0x1ca63a){if(_0x4f0fc4){return _0x56b754(_0x4f0fc4);}pm2[_0x497d('0x6')]();return _0x24455f(_0x1ca63a);});});});};exports['restart']=function(_0xbfcc16){return connect()[_0x497d('0x5')](function(){return new BPromise(function(_0x55b95f,_0x545e03){return pm2[_0x497d('0x8')](_0xbfcc16,function(_0x3f9ddf,_0x10a272){if(_0x3f9ddf){return _0x545e03(_0x3f9ddf);}pm2[_0x497d('0x6')]();return _0x55b95f(_0x10a272);});});});};exports[_0x497d('0x9')]=function(){return connect()[_0x497d('0x5')](function(){return new BPromise(function(_0x5c8400,_0x534abf){return pm2['list'](function(_0x3de19b,_0x3f07be){if(_0x3de19b){return _0x534abf(_0x3de19b);}pm2[_0x497d('0x6')]();return _0x5c8400(_0x3f07be);});});});};exports['describe']=function(_0x2aa391){return connect()[_0x497d('0x5')](function(){return new BPromise(function(_0x2b0ace,_0x5b148e){return pm2['describe'](_0x2aa391,function(_0x401d44,_0x1c3c6a){if(_0x401d44){return _0x5b148e(_0x401d44);}pm2[_0x497d('0x6')]();return _0x2b0ace(_0x1c3c6a);});});});};exports[_0x497d('0xa')]=function(_0xca4b50){return connect()[_0x497d('0x5')](function(){return new BPromise(function(_0x58554a,_0x54ab92){return pm2[_0x497d('0xa')](_0xca4b50,function(_0x3ba5a6,_0x1a896a){if(_0x3ba5a6){return _0x54ab92(_0x3ba5a6);}pm2['disconnect']();return _0x58554a(_0x1a896a);});});});};exports[_0x497d('0xb')]=function(){return connect()[_0x497d('0x5')](function(){return new BPromise(function(_0x5731dc,_0x37a895){return pm2[_0x497d('0xb')](function(_0x5f0dea){if(_0x5f0dea){return _0x37a895(_0x5f0dea);}return _0x5731dc(_0x497d('0xc'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 58935d8..f5ccbba 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 _0xe705=['timeout','format','YYYY-MM-DD\x20HH:mm:ss','length','emit','chatInteraction:update','catch','[CHAT]\x20Error\x20closing\x20interactions','lodash','moment','ioredis','util','../../config/environment','../logger','redis','defaults','localhost','Setting','find','then','chatTimeout','ChatInteraction','lastMsgAt','minutes','map','info','[CHAT]\x20Interactions\x20to\x20close:','join'];(function(_0xc2c148,_0x14ded){var _0x5849ff=function(_0x1504b3){while(--_0x1504b3){_0xc2c148['push'](_0xc2c148['shift']());}};_0x5849ff(++_0x14ded);}(_0xe705,0xcc));var _0x5e70=function(_0x3e91a9,_0x53c466){_0x3e91a9=_0x3e91a9-0x0;var _0x25c9ad=_0xe705[_0x3e91a9];return _0x25c9ad;};'use strict';var _=require(_0x5e70('0x0'));var moment=require(_0x5e70('0x1'));var Redis=require(_0x5e70('0x2'));var util=require(_0x5e70('0x3'));var config=require(_0x5e70('0x4'));var db=require('../../mysqldb')['db'];var logger=require(_0x5e70('0x5'))('schedule');config[_0x5e70('0x6')]=_[_0x5e70('0x7')](config['redis'],{'host':_0x5e70('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x5e70('0x6')]));function closeInteractions(){var _0x665fa6=0x0;var _0x33e126=[];return db[_0x5e70('0x9')][_0x5e70('0xa')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0x5e70('0xb')](function(_0x13d7e7){_0x665fa6=_0x13d7e7[_0x5e70('0xc')];if(_0x665fa6){return db[_0x5e70('0xd')]['findAll']({'raw':!![],'attributes':['id',_0x5e70('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x13d7e7[_0x5e70('0xc')],_0x5e70('0xf'))}}});}else{return[];}})[_0x5e70('0xb')](function(_0x25c8f7){if(_0x25c8f7&&_0x25c8f7['length']){_0x33e126=_[_0x5e70('0x10')](_0x25c8f7||[],'id');logger[_0x5e70('0x11')](_0x5e70('0x12'),_0x33e126[_0x5e70('0x13')]());return db[_0x5e70('0xd')]['update']({'closeReason':'system','disposition':_0x5e70('0x14'),'closed':!![],'closedAt':moment()[_0x5e70('0x15')](_0x5e70('0x16'))},{'where':{'id':_0x33e126}});}})[_0x5e70('0xb')](function(){if(_0x33e126&&_0x33e126['length']){logger['info']('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x33e126[_0x5e70('0x13')]());for(var _0x38b4e5=0x0;_0x38b4e5<_0x33e126[_0x5e70('0x17')];_0x38b4e5++){io[_0x5e70('0x18')](_0x5e70('0x19'),{'id':_0x33e126[_0x38b4e5],'closed':!![]});}}})[_0x5e70('0x1a')](function(_0x519076){logger['error'](_0x5e70('0x1b'),_0x519076?util['inspect'](_0x519076,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x7a94=['join','update','system','format','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','length','emit','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','socket.io-emitter','Setting','chatTimeout','then','ChatInteraction','findAll','lastMsgAt','minutes','map','info','[CHAT]\x20Interactions\x20to\x20close:'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x7a94,0x84));var _0x47a9=function(_0x1047b6,_0x37f160){_0x1047b6=_0x1047b6-0x0;var _0xb1672=_0x7a94[_0x1047b6];return _0xb1672;};'use strict';var _=require('lodash');var moment=require('moment');var Redis=require('ioredis');var util=require('util');var config=require(_0x47a9('0x0'));var db=require(_0x47a9('0x1'))['db'];var logger=require(_0x47a9('0x2'))(_0x47a9('0x3'));config[_0x47a9('0x4')]=_[_0x47a9('0x5')](config['redis'],{'host':_0x47a9('0x6'),'port':0x18eb});var io=require(_0x47a9('0x7'))(new Redis(config[_0x47a9('0x4')]));function closeInteractions(){var _0x1555ed=0x0;var _0x4de120=[];return db[_0x47a9('0x8')]['find']({'raw':!![],'attributes':['id',_0x47a9('0x9')],'where':{'id':0x1}})[_0x47a9('0xa')](function(_0x1d87e2){_0x1555ed=_0x1d87e2[_0x47a9('0x9')];if(_0x1555ed){return db[_0x47a9('0xb')][_0x47a9('0xc')]({'raw':!![],'attributes':['id',_0x47a9('0xd')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x1d87e2[_0x47a9('0x9')],_0x47a9('0xe'))}}});}else{return[];}})[_0x47a9('0xa')](function(_0x533d5f){if(_0x533d5f&&_0x533d5f['length']){_0x4de120=_[_0x47a9('0xf')](_0x533d5f||[],'id');logger[_0x47a9('0x10')](_0x47a9('0x11'),_0x4de120[_0x47a9('0x12')]());return db[_0x47a9('0xb')][_0x47a9('0x13')]({'closeReason':_0x47a9('0x14'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0x47a9('0x15')](_0x47a9('0x16'))},{'where':{'id':_0x4de120}});}})[_0x47a9('0xa')](function(){if(_0x4de120&&_0x4de120['length']){logger[_0x47a9('0x10')](_0x47a9('0x17'),_0x4de120[_0x47a9('0x12')]());for(var _0x5ad8ad=0x0;_0x5ad8ad<_0x4de120[_0x47a9('0x18')];_0x5ad8ad++){io[_0x47a9('0x19')](_0x47a9('0x1a'),{'id':_0x4de120[_0x5ad8ad],'closed':!![]});}}})[_0x47a9('0x1b')](function(_0x25e67f){logger[_0x47a9('0x1c')](_0x47a9('0x1d'),_0x25e67f?util['inspect'](_0x25e67f,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index 597090c..dcbd3bf 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 _0x6ec3=['length','stop','delete\x20cron','toRun','index','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','add\x20cron','exists','stop\x20cron','endAt','update','update\x20cron','deleteJob','run','start','util','path','lodash','moment','jayson/promise','../logger','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','http','Try\x20to\x20send\x20a\x20mail\x20to','MailAccount','Smtp','service','host','secure','authentication','auth','pass','format','\x22%s\x22\x20<%s>','name','email','user','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','../../files/reports','savename','%s.%s','basename','zip','join','existsSync','Sent','attachments','message','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','status','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','info','empty\x20file,\x20email\x20not\x20sent','then','error','stringify','email\x20sent','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','output','DefaultReportId','CustomReportId','runReport','no\x20report\x20id','Schedule','findAll','MailServerOut','jobs','map','toString','keyBy','difference','intersection'];(function(_0x220720,_0x10d6b4){var _0x20f9a7=function(_0xfd086c){while(--_0xfd086c){_0x220720['push'](_0x220720['shift']());}};_0x20f9a7(++_0x10d6b4);}(_0x6ec3,0x1d2));var _0x36ec=function(_0x34c765,_0x20a51b){_0x34c765=_0x34c765-0x0;var _0x39901a=_0x6ec3[_0x34c765];return _0x39901a;};'use strict';var fs=require('fs');var util=require(_0x36ec('0x0'));var path=require(_0x36ec('0x1'));var _=require(_0x36ec('0x2'));var moment=require(_0x36ec('0x3'));var CronJobManager=require('cron-job-manager');var jayson=require(_0x36ec('0x4'));var BPromise=require('bluebird');var logger=require(_0x36ec('0x5'))('schedule');var db=require(_0x36ec('0x6'))['db'];var analyticCustomReportController=require(_0x36ec('0x7'));var analyticDefaultReportController=require(_0x36ec('0x8'));var client=jayson['client'][_0x36ec('0x9')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x4f7318,_0x431e29){return function(){logger['info'](_0x36ec('0xa'),_0x4f7318['email']);var _0xeb548f=!![];var _0x8214a3={'tls':{'rejectUnauthorized':![]}};if(_0x4f7318[_0x36ec('0xb')][_0x36ec('0xc')][_0x36ec('0xd')]){_0x8214a3[_0x36ec('0xd')]=_0x4f7318[_0x36ec('0xb')][_0x36ec('0xc')][_0x36ec('0xd')];}else{_0x8214a3['host']=_0x4f7318[_0x36ec('0xb')][_0x36ec('0xc')][_0x36ec('0xe')];_0x8214a3['port']=_0x4f7318['MailAccount'][_0x36ec('0xc')]['port'];_0x8214a3[_0x36ec('0xf')]=_0x4f7318[_0x36ec('0xb')][_0x36ec('0xc')][_0x36ec('0xf')];}if(_0x4f7318[_0x36ec('0xb')][_0x36ec('0xc')][_0x36ec('0x10')]){_0x8214a3[_0x36ec('0x11')]={'user':_0x4f7318[_0x36ec('0xb')][_0x36ec('0xc')]['user'],'pass':_0x4f7318[_0x36ec('0xb')]['Smtp'][_0x36ec('0x12')]};}var _0x44cd82={'account':_0x8214a3,'message':{'from':util[_0x36ec('0x13')](_0x36ec('0x14'),_0x4f7318[_0x36ec('0xb')][_0x36ec('0x15')],_0x4f7318[_0x36ec('0xb')][_0x36ec('0x16')]||_0x4f7318['MailAccount']['Smtp'][_0x36ec('0x17')]),'to':_0x4f7318['email'],'cc':_0x4f7318['cc'],'bcc':_0x4f7318['bcc'],'subject':util[_0x36ec('0x13')](_0x36ec('0x18'),_0x431e29['name'],_0x4f7318[_0x36ec('0x19')],_0x4f7318[_0x36ec('0x1a')])}};var _0x3f53c1=path['join'](__dirname,_0x36ec('0x1b'));var _0x468f42=_0x431e29[_0x36ec('0x1c')];var _0x11cdb6=util['format'](_0x36ec('0x1d'),path[_0x36ec('0x1e')](_0x431e29[_0x36ec('0x1c')],path['extname'](_0x431e29[_0x36ec('0x1c')])),_0x36ec('0x1f'));var _0x219885=path[_0x36ec('0x20')](_0x3f53c1,_0x468f42);var _0x4ec0e7=path['join'](_0x3f53c1,_0x11cdb6);if(fs[_0x36ec('0x21')](_0x219885)){_0x431e29['status']=_0x36ec('0x22');_0x44cd82['message'][_0x36ec('0x23')]=[{'filename':_0x468f42,'path':_0x219885}];_0x44cd82[_0x36ec('0x24')][_0x36ec('0x25')]=util[_0x36ec('0x13')](_0x36ec('0x26'),JSON['stringify'](_0x431e29,null,0x2));}else if(fs['existsSync'](_0x4ec0e7)){_0x431e29[_0x36ec('0x27')]=_0x36ec('0x22');_0x44cd82[_0x36ec('0x24')][_0x36ec('0x23')]=[{'filename':_0x11cdb6,'path':_0x4ec0e7}];}else{_0x44cd82[_0x36ec('0x24')][_0x36ec('0x25')]=_0x36ec('0x28');if(!_0x4f7318['sendIfEmpty']){_0xeb548f=![];logger[_0x36ec('0x29')](_0x36ec('0x2a'));}}if(_0xeb548f){return client['request']('SendMail',_0x44cd82)[_0x36ec('0x2b')](function(_0xeb4c3c){if(_0xeb4c3c[_0x36ec('0x2c')]){return logger[_0x36ec('0x2c')]('error\x20mail',JSON[_0x36ec('0x2d')](_0xeb4c3c));}return logger[_0x36ec('0x29')](_0x36ec('0x2e'));})[_0x36ec('0x2f')](function(_0x55a351){return logger['error']('error\x20mail',JSON[_0x36ec('0x2d')](_0x55a351));});}};}function handleError(){return function(_0x5ecc12){return logger[_0x36ec('0x2c')](JSON[_0x36ec('0x2d')](_0x5ecc12));};}function handleResult(_0x5db0b7){return function(_0x406ce6){logger[_0x36ec('0x29')](_0x36ec('0x30'),JSON['stringify'](_0x406ce6));if(_0x5db0b7[_0x36ec('0xb')]&&_0x5db0b7[_0x36ec('0xb')][_0x36ec('0xc')]&&!_['isNil'](_0x5db0b7[_0x36ec('0x16')])){setTimeout(handleSendEmail(_0x5db0b7,_0x406ce6),0x3c*0x3e8);}};}function handleJob(_0x5710b5){return function(){try{if(_[_0x36ec('0x31')](_0x5710b5[_0x36ec('0x19')])){return logger[_0x36ec('0x29')](_0x36ec('0x32'));}if(_[_0x36ec('0x31')](_0x5710b5[_0x36ec('0x1a')])){return logger[_0x36ec('0x29')](_0x36ec('0x33'));}var _0x10a1d4={'startDate':moment()[_0x36ec('0x34')](_0x5710b5[_0x36ec('0x19')],_0x5710b5[_0x36ec('0x1a')])[_0x36ec('0x13')](_0x36ec('0x35')),'endDate':moment()[_0x36ec('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),'type':'scheduled','output':_0x5710b5[_0x36ec('0x36')],'name':_0x5710b5['name']};if(!_[_0x36ec('0x31')](_0x5710b5[_0x36ec('0x37')])){logger[_0x36ec('0x29')]('exec\x20defaul\x20report\x20id:%s',_0x5710b5['DefaultReportId']);return analyticDefaultReportController['runReport']({'id':_0x5710b5[_0x36ec('0x37')]},_0x10a1d4)[_0x36ec('0x2b')](handleResult(_0x5710b5))[_0x36ec('0x2f')](handleError());}if(!_[_0x36ec('0x31')](_0x5710b5[_0x36ec('0x38')])){logger[_0x36ec('0x29')]('exec\x20custom\x20report\x20id:%s',_0x5710b5['CustomReportId']);return analyticCustomReportController[_0x36ec('0x39')]({'id':_0x5710b5[_0x36ec('0x38')]},_0x10a1d4)[_0x36ec('0x2b')](handleResult(_0x5710b5))[_0x36ec('0x2f')](handleError());}}catch(_0x4b156d){logger[_0x36ec('0x2c')](JSON['stringify'](_0x4b156d));}return logger[_0x36ec('0x29')](_0x36ec('0x3a'));};}function getJobs(_0x4cb9fb){var _0x317886={};if(_0x4cb9fb){_0x317886['id']=_0x4cb9fb;}return db[_0x36ec('0x3b')][_0x36ec('0x3c')]({'where':_0x317886,'include':[{'model':db['MailAccount'],'attributes':['id',_0x36ec('0x15'),'email'],'include':[{'model':db[_0x36ec('0x3d')],'as':_0x36ec('0xc')}]}]})['then'](function(_0x3ad34e){var _0x1cfd6f=_['keys'](manager[_0x36ec('0x3e')]);var _0x2827f8=_[_0x36ec('0x3f')](_0x3ad34e,function(_0x14d10c){return _0x14d10c['id'][_0x36ec('0x40')]();});var _0x40ba1f=_[_0x36ec('0x41')](_0x3ad34e,function(_0x538fd9){return _0x538fd9['id'][_0x36ec('0x40')]();});var _0x32db7b=_0x4cb9fb?_0x2827f8:_[_0x36ec('0x42')](_0x2827f8,_0x1cfd6f);var _0x4e40c5=_[_0x36ec('0x43')](_0x2827f8,_0x1cfd6f);var _0xaee3dd=_[_0x36ec('0x42')](_0x1cfd6f,_0x2827f8);var _0x1a0b56;var _0x41d562;for(_0x1a0b56=0x0;_0x1a0b56<_0xaee3dd[_0x36ec('0x44')]&&!_0x4cb9fb;_0x1a0b56+=0x1){_0x41d562=_0xaee3dd[_0x1a0b56][_0x36ec('0x40')]();if(manager['exists'](_0x41d562)){manager[_0x36ec('0x45')](_0x41d562);manager['deleteJob'](_0x41d562);logger[_0x36ec('0x29')](_0x36ec('0x46'),_0x41d562);}}logger['info'](_0x36ec('0x47'),JSON[_0x36ec('0x2d')](_0x32db7b));for(_0x1a0b56=0x0;_0x1a0b56<_0x32db7b[_0x36ec('0x44')];_0x1a0b56+=0x1){_0x41d562=_0x32db7b[_0x1a0b56][_0x36ec('0x40')]();logger['info'](_0x36ec('0x48'),_0x41d562);if(_0x4cb9fb){logger[_0x36ec('0x29')](_0x36ec('0x49'),_0x4cb9fb);logger[_0x36ec('0x29')](JSON[_0x36ec('0x2d')](_0x40ba1f[_0x41d562]));BPromise[_0x36ec('0x4a')]()[_0x36ec('0x2b')](handleJob(_0x40ba1f[_0x41d562]));logger[_0x36ec('0x29')](_0x36ec('0x4b'),_0x40ba1f[_0x41d562][_0x36ec('0x15')],_0x40ba1f[_0x41d562][_0x36ec('0x4c')]);}else if(_0x40ba1f[_0x41d562][_0x36ec('0x4c')]&&_0x40ba1f[_0x41d562][_0x36ec('0x4d')]&&moment()[_0x36ec('0x4e')](_0x40ba1f[_0x41d562][_0x36ec('0x4f')],_0x40ba1f[_0x41d562]['endAt'])){manager['add'](_0x41d562,_0x40ba1f[_0x41d562][_0x36ec('0x4c')],handleJob(_0x40ba1f[_0x41d562]));manager['start'](_0x41d562);logger[_0x36ec('0x29')](_0x36ec('0x50'),_0x40ba1f[_0x41d562][_0x36ec('0x15')],_0x40ba1f[_0x41d562]['cron']);}else if(manager[_0x36ec('0x51')](_0x41d562)){manager[_0x36ec('0x45')](_0x41d562);manager['deleteJob'](_0x41d562);logger['info'](_0x36ec('0x52'),_0x40ba1f[_0x41d562][_0x36ec('0x15')],_0x40ba1f[_0x41d562][_0x36ec('0x4c')]);}}for(_0x1a0b56=0x0,_0x41d562;_0x1a0b56<_0x4e40c5['length']&&!_0x4cb9fb;_0x1a0b56+=0x1){_0x41d562=_0x4e40c5[_0x1a0b56][_0x36ec('0x40')]();if(manager[_0x36ec('0x51')](_0x41d562)){if(_0x40ba1f[_0x41d562][_0x36ec('0x4c')]&&_0x40ba1f[_0x41d562][_0x36ec('0x4d')]&&moment()[_0x36ec('0x4e')](_0x40ba1f[_0x41d562][_0x36ec('0x4f')],_0x40ba1f[_0x41d562][_0x36ec('0x53')])){manager[_0x36ec('0x54')](_0x41d562,_0x40ba1f[_0x41d562]['cron'],handleJob(_0x40ba1f[_0x41d562]));logger[_0x36ec('0x29')](_0x36ec('0x55'),_0x40ba1f[_0x41d562][_0x36ec('0x15')],_0x40ba1f[_0x41d562][_0x36ec('0x4c')]);}else{manager['stop'](_0x41d562);manager[_0x36ec('0x56')](_0x41d562);logger[_0x36ec('0x29')](_0x36ec('0x52'),_0x40ba1f[_0x41d562][_0x36ec('0x15')],_0x40ba1f[_0x41d562]['cron']);}}}})[_0x36ec('0x2f')](function(_0x3c0635){logger['error'](JSON[_0x36ec('0x2d')](_0x3c0635));});}exports[_0x36ec('0x57')]=function(_0x3344d5){return getJobs(_0x3344d5);};exports[_0x36ec('0x58')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x0023=['YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','CustomReportId','runReport','no\x20report\x20id','Schedule','MailServerOut','keys','jobs','toString','keyBy','difference','length','stop','my\x20id','resolve','run\x20job','cron','active','startAt','endAt','add','start','add\x20cron','deleteJob','stop\x20cron','exists','isBetween','update','update\x20cron','run','path','lodash','moment','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','MailAccount','Smtp','service','host','port','secure','auth','user','pass','format','\x22%s\x22\x20<%s>','email','bcc','name','subtractNumber','subtractUnit','join','../../files/reports','%s.%s','basename','savename','extname','zip','existsSync','status','Sent','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','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','request','SendMail','then','error','error\x20mail','email\x20sent','catch','data','isNil','subtractUnit\x20null\x20or\x20undefined','subtract'];(function(_0x494d1f,_0x3f72ff){var _0x457b6e=function(_0x38cb16){while(--_0x38cb16){_0x494d1f['push'](_0x494d1f['shift']());}};_0x457b6e(++_0x3f72ff);}(_0x0023,0x136));var _0x3002=function(_0x1e17f4,_0xc0f0a3){_0x1e17f4=_0x1e17f4-0x0;var _0x12a87e=_0x0023[_0x1e17f4];return _0x12a87e;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0x3002('0x0'));var _=require(_0x3002('0x1'));var moment=require(_0x3002('0x2'));var CronJobManager=require(_0x3002('0x3'));var jayson=require(_0x3002('0x4'));var BPromise=require(_0x3002('0x5'));var logger=require(_0x3002('0x6'))(_0x3002('0x7'));var db=require(_0x3002('0x8'))['db'];var analyticCustomReportController=require(_0x3002('0x9'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0x3002('0xa')][_0x3002('0xb')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x54ece9,_0x4d354a){return function(){logger[_0x3002('0xc')](_0x3002('0xd'),_0x54ece9['email']);var _0x5b90d7=!![];var _0x283480={'tls':{'rejectUnauthorized':![]}};if(_0x54ece9[_0x3002('0xe')][_0x3002('0xf')][_0x3002('0x10')]){_0x283480[_0x3002('0x10')]=_0x54ece9[_0x3002('0xe')][_0x3002('0xf')][_0x3002('0x10')];}else{_0x283480[_0x3002('0x11')]=_0x54ece9[_0x3002('0xe')]['Smtp']['host'];_0x283480[_0x3002('0x12')]=_0x54ece9[_0x3002('0xe')]['Smtp']['port'];_0x283480[_0x3002('0x13')]=_0x54ece9[_0x3002('0xe')][_0x3002('0xf')][_0x3002('0x13')];}if(_0x54ece9[_0x3002('0xe')][_0x3002('0xf')]['authentication']){_0x283480[_0x3002('0x14')]={'user':_0x54ece9['MailAccount'][_0x3002('0xf')][_0x3002('0x15')],'pass':_0x54ece9[_0x3002('0xe')][_0x3002('0xf')][_0x3002('0x16')]};}var _0x2094f5={'account':_0x283480,'message':{'from':util[_0x3002('0x17')](_0x3002('0x18'),_0x54ece9['MailAccount']['name'],_0x54ece9['MailAccount'][_0x3002('0x19')]||_0x54ece9[_0x3002('0xe')]['Smtp']['user']),'to':_0x54ece9[_0x3002('0x19')],'cc':_0x54ece9['cc'],'bcc':_0x54ece9[_0x3002('0x1a')],'subject':util[_0x3002('0x17')]('Report\x20%s\x20last\x20%s\x20%s',_0x4d354a[_0x3002('0x1b')],_0x54ece9[_0x3002('0x1c')],_0x54ece9[_0x3002('0x1d')])}};var _0x1c4dfd=path[_0x3002('0x1e')](__dirname,_0x3002('0x1f'));var _0x14bf3b=_0x4d354a['savename'];var _0x459983=util[_0x3002('0x17')](_0x3002('0x20'),path[_0x3002('0x21')](_0x4d354a[_0x3002('0x22')],path[_0x3002('0x23')](_0x4d354a['savename'])),_0x3002('0x24'));var _0x199344=path[_0x3002('0x1e')](_0x1c4dfd,_0x14bf3b);var _0x419106=path[_0x3002('0x1e')](_0x1c4dfd,_0x459983);if(fs[_0x3002('0x25')](_0x199344)){_0x4d354a[_0x3002('0x26')]=_0x3002('0x27');_0x2094f5[_0x3002('0x28')][_0x3002('0x29')]=[{'filename':_0x14bf3b,'path':_0x199344}];_0x2094f5[_0x3002('0x28')][_0x3002('0x2a')]=util['format'](_0x3002('0x2b'),JSON[_0x3002('0x2c')](_0x4d354a,null,0x2));}else if(fs[_0x3002('0x25')](_0x419106)){_0x4d354a[_0x3002('0x26')]=_0x3002('0x27');_0x2094f5[_0x3002('0x28')]['attachments']=[{'filename':_0x459983,'path':_0x419106}];}else{_0x2094f5[_0x3002('0x28')][_0x3002('0x2a')]=_0x3002('0x2d');if(!_0x54ece9[_0x3002('0x2e')]){_0x5b90d7=![];logger['info']('empty\x20file,\x20email\x20not\x20sent');}}if(_0x5b90d7){return client[_0x3002('0x2f')](_0x3002('0x30'),_0x2094f5)[_0x3002('0x31')](function(_0x41e8b3){if(_0x41e8b3[_0x3002('0x32')]){return logger[_0x3002('0x32')](_0x3002('0x33'),JSON[_0x3002('0x2c')](_0x41e8b3));}return logger[_0x3002('0xc')](_0x3002('0x34'));})[_0x3002('0x35')](function(_0x54ea78){return logger[_0x3002('0x32')](_0x3002('0x33'),JSON['stringify'](_0x54ea78));});}};}function handleError(){return function(_0x3f417e){return logger[_0x3002('0x32')](JSON[_0x3002('0x2c')](_0x3f417e));};}function handleResult(_0x2be50c){return function(_0x39d29f){logger[_0x3002('0xc')](_0x3002('0x36'),JSON[_0x3002('0x2c')](_0x39d29f));if(_0x2be50c[_0x3002('0xe')]&&_0x2be50c['MailAccount']['Smtp']&&!_[_0x3002('0x37')](_0x2be50c[_0x3002('0x19')])){setTimeout(handleSendEmail(_0x2be50c,_0x39d29f),0x3c*0x3e8);}};}function handleJob(_0x46fe8a){return function(){try{if(_[_0x3002('0x37')](_0x46fe8a[_0x3002('0x1c')])){return logger[_0x3002('0xc')]('subtractNumber\x20null\x20or\x20undefined');}if(_[_0x3002('0x37')](_0x46fe8a[_0x3002('0x1d')])){return logger['info'](_0x3002('0x38'));}var _0x4f37dd={'startDate':moment()[_0x3002('0x39')](_0x46fe8a[_0x3002('0x1c')],_0x46fe8a[_0x3002('0x1d')])['format'](_0x3002('0x3a')),'endDate':moment()[_0x3002('0x17')]('YYYY-MM-DD\x20HH:mm:ss'),'type':_0x3002('0x3b'),'output':_0x46fe8a[_0x3002('0x3c')],'name':_0x46fe8a['name']};if(!_[_0x3002('0x37')](_0x46fe8a[_0x3002('0x3d')])){logger[_0x3002('0xc')](_0x3002('0x3e'),_0x46fe8a[_0x3002('0x3d')]);return analyticDefaultReportController['runReport']({'id':_0x46fe8a['DefaultReportId']},_0x4f37dd)[_0x3002('0x31')](handleResult(_0x46fe8a))[_0x3002('0x35')](handleError());}if(!_['isNil'](_0x46fe8a['CustomReportId'])){logger[_0x3002('0xc')]('exec\x20custom\x20report\x20id:%s',_0x46fe8a[_0x3002('0x3f')]);return analyticCustomReportController[_0x3002('0x40')]({'id':_0x46fe8a[_0x3002('0x3f')]},_0x4f37dd)[_0x3002('0x31')](handleResult(_0x46fe8a))['catch'](handleError());}}catch(_0x2f4c12){logger[_0x3002('0x32')](JSON[_0x3002('0x2c')](_0x2f4c12));}return logger[_0x3002('0xc')](_0x3002('0x41'));};}function getJobs(_0x529afb){var _0x3b0bab={};if(_0x529afb){_0x3b0bab['id']=_0x529afb;}return db[_0x3002('0x42')]['findAll']({'where':_0x3b0bab,'include':[{'model':db[_0x3002('0xe')],'attributes':['id','name','email'],'include':[{'model':db[_0x3002('0x43')],'as':_0x3002('0xf')}]}]})[_0x3002('0x31')](function(_0x5b07df){var _0x596824=_[_0x3002('0x44')](manager[_0x3002('0x45')]);var _0x1f937f=_['map'](_0x5b07df,function(_0x4083f6){return _0x4083f6['id'][_0x3002('0x46')]();});var _0x4a4c0b=_[_0x3002('0x47')](_0x5b07df,function(_0x539053){return _0x539053['id']['toString']();});var _0xe96534=_0x529afb?_0x1f937f:_[_0x3002('0x48')](_0x1f937f,_0x596824);var _0x5ce798=_['intersection'](_0x1f937f,_0x596824);var _0x2e7c75=_['difference'](_0x596824,_0x1f937f);var _0xc6dec;var _0x158bc8;for(_0xc6dec=0x0;_0xc6dec<_0x2e7c75[_0x3002('0x49')]&&!_0x529afb;_0xc6dec+=0x1){_0x158bc8=_0x2e7c75[_0xc6dec][_0x3002('0x46')]();if(manager['exists'](_0x158bc8)){manager[_0x3002('0x4a')](_0x158bc8);manager['deleteJob'](_0x158bc8);logger[_0x3002('0xc')]('delete\x20cron',_0x158bc8);}}logger[_0x3002('0xc')]('toRun',JSON[_0x3002('0x2c')](_0xe96534));for(_0xc6dec=0x0;_0xc6dec<_0xe96534[_0x3002('0x49')];_0xc6dec+=0x1){_0x158bc8=_0xe96534[_0xc6dec][_0x3002('0x46')]();logger['info']('index',_0x158bc8);if(_0x529afb){logger['info'](_0x3002('0x4b'),_0x529afb);logger[_0x3002('0xc')](JSON[_0x3002('0x2c')](_0x4a4c0b[_0x158bc8]));BPromise[_0x3002('0x4c')]()[_0x3002('0x31')](handleJob(_0x4a4c0b[_0x158bc8]));logger[_0x3002('0xc')](_0x3002('0x4d'),_0x4a4c0b[_0x158bc8][_0x3002('0x1b')],_0x4a4c0b[_0x158bc8][_0x3002('0x4e')]);}else if(_0x4a4c0b[_0x158bc8][_0x3002('0x4e')]&&_0x4a4c0b[_0x158bc8][_0x3002('0x4f')]&&moment()['isBetween'](_0x4a4c0b[_0x158bc8][_0x3002('0x50')],_0x4a4c0b[_0x158bc8][_0x3002('0x51')])){manager[_0x3002('0x52')](_0x158bc8,_0x4a4c0b[_0x158bc8][_0x3002('0x4e')],handleJob(_0x4a4c0b[_0x158bc8]));manager[_0x3002('0x53')](_0x158bc8);logger['info'](_0x3002('0x54'),_0x4a4c0b[_0x158bc8][_0x3002('0x1b')],_0x4a4c0b[_0x158bc8]['cron']);}else if(manager['exists'](_0x158bc8)){manager['stop'](_0x158bc8);manager[_0x3002('0x55')](_0x158bc8);logger[_0x3002('0xc')](_0x3002('0x56'),_0x4a4c0b[_0x158bc8][_0x3002('0x1b')],_0x4a4c0b[_0x158bc8]['cron']);}}for(_0xc6dec=0x0,_0x158bc8;_0xc6dec<_0x5ce798['length']&&!_0x529afb;_0xc6dec+=0x1){_0x158bc8=_0x5ce798[_0xc6dec]['toString']();if(manager[_0x3002('0x57')](_0x158bc8)){if(_0x4a4c0b[_0x158bc8]['cron']&&_0x4a4c0b[_0x158bc8][_0x3002('0x4f')]&&moment()[_0x3002('0x58')](_0x4a4c0b[_0x158bc8][_0x3002('0x50')],_0x4a4c0b[_0x158bc8][_0x3002('0x51')])){manager[_0x3002('0x59')](_0x158bc8,_0x4a4c0b[_0x158bc8][_0x3002('0x4e')],handleJob(_0x4a4c0b[_0x158bc8]));logger[_0x3002('0xc')](_0x3002('0x5a'),_0x4a4c0b[_0x158bc8]['name'],_0x4a4c0b[_0x158bc8][_0x3002('0x4e')]);}else{manager[_0x3002('0x4a')](_0x158bc8);manager[_0x3002('0x55')](_0x158bc8);logger[_0x3002('0xc')](_0x3002('0x56'),_0x4a4c0b[_0x158bc8][_0x3002('0x1b')],_0x4a4c0b[_0x158bc8]['cron']);}}}})['catch'](function(_0x3e056e){logger[_0x3002('0x32')](JSON[_0x3002('0x2c')](_0x3e056e));});}exports[_0x3002('0x5b')]=function(_0x1f501c){return getJobs(_0x1f501c);};exports[_0x3002('0x53')]=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 370ec53..5e1ed71 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 _0x570f=['length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','sentiment','sentimentAccountId','sentimentRegion','language','bucket','ValidationError','Sentiment\x20Analysis\x20not\x20configured','findOne','Cloud\x20Provider\x20not\x20configured','SentimentScore','Positive','Neutral','FAILED','FailureReason','resolve','Sentiment\x20Analysis\x20not\x20requested','Transcript\x20not\x20available','Cloud\x20Provider\x20not\x20available','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','Negative','Mixed','COMPLETED','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','IN_PROGRESS','Setting','Settings\x20not\x20available','Transcribe\x20not\x20configured','CloudProvider','transcribeAccountId','forEach','push','start','lodash','aws-sdk','request-promise','../../mysqldb','../../config/logger','transcribe','TranscribeService','Comprehend','detectSentiment','substring','info','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','then','format','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts'];(function(_0x5b06fb,_0x1190f4){var _0x53a53a=function(_0x52adb4){while(--_0x52adb4){_0x5b06fb['push'](_0x5b06fb['shift']());}};_0x53a53a(++_0x1190f4);}(_0x570f,0x152));var _0xf570=function(_0x34664d,_0x5a9943){_0x34664d=_0x34664d-0x0;var _0x2865cf=_0x570f[_0x34664d];return _0x2865cf;};var _=require(_0xf570('0x0'));var AWS=require(_0xf570('0x1'));var rp=require(_0xf570('0x2'));var util=require('util');var BPromise=require('bluebird');var db=require(_0xf570('0x3'))['db'];var logger=require(_0xf570('0x4'))(_0xf570('0x5'));function getTranscriptionJob(_0x22c270,_0x140bb4,_0x1cb206,_0x5b8c89){return new Promise(function(_0x5ce063,_0x2ec4ba){var _0x47c534=new AWS[(_0xf570('0x6'))]({'accessKeyId':_0x140bb4,'secretAccessKey':_0x22c270,'region':_0x1cb206});_0x47c534['getTranscriptionJob']({'TranscriptionJobName':_0x5b8c89},function(_0x2575c0,_0x5ce08f){if(_0x2575c0){return _0x2ec4ba(_0x2575c0);}else{return _0x5ce063(_0x5ce08f);}});});}function sentiment(_0x350a32,_0x49b42f,_0x19bee1,_0x375e35,_0x30f641){return new Promise(function(_0x1f0ff5,_0x42a0e0){var _0x4ad522=new AWS[(_0xf570('0x7'))]({'accessKeyId':_0x49b42f,'secretAccessKey':_0x350a32,'region':_0x19bee1});_0x4ad522[_0xf570('0x8')]({'Text':_0x375e35,'LanguageCode':_0x30f641[_0xf570('0x9')](0x0,0x2)},function(_0x52d724,_0x12dc76){if(_0x52d724){return _0x42a0e0(_0x52d724);}else{return _0x1f0ff5(_0x12dc76);}});});}function checkTranscribeJob(_0x3c689c,_0x40559e,_0x51cb42){var _0x32e0b0;return new BPromise(function(_0xe2d1a4,_0x29cc8f){logger[_0xf570('0xa')](util['format'](_0xf570('0xb'),_0x3c689c['id'],_0x3c689c[_0xf570('0xc')]));return getTranscriptionJob(_0x51cb42[_0xf570('0xd')],_0x51cb42[_0xf570('0xe')],_0x40559e[_0xf570('0xf')],_0x3c689c[_0xf570('0xc')])[_0xf570('0x10')](function(_0x1065a9){logger[_0xf570('0xa')](util[_0xf570('0x11')](_0xf570('0x12'),_0x3c689c['id'],_0x3c689c['transcribeName'],_0x1065a9[_0xf570('0x13')][_0xf570('0x14')]));if(!_0x3c689c[_0xf570('0x15')]){switch(_0x1065a9[_0xf570('0x13')][_0xf570('0x14')]){case'COMPLETED':var _0x34d96a={'transcribeStatus':_0x1065a9[_0xf570('0x13')][_0xf570('0x14')],'fileUri':_0x1065a9['TranscriptionJob'][_0xf570('0x16')][_0xf570('0x17')]};logger[_0xf570('0xa')](util[_0xf570('0x11')]('[RECORDING:%d]\x20Get\x20transcript',_0x3c689c['id']));return rp({'uri':_0x1065a9[_0xf570('0x13')][_0xf570('0x16')][_0xf570('0x17')],'json':!![]})[_0xf570('0x10')](function(_0x2488bd){logger['info'](util[_0xf570('0x11')](_0xf570('0x18'),_0x3c689c['id']));if(_0x2488bd&&_0x2488bd[_0xf570('0x19')]&&_0x2488bd[_0xf570('0x19')]['transcripts']&&_0x2488bd[_0xf570('0x19')][_0xf570('0x1a')][_0xf570('0x1b')]){_0x34d96a[_0xf570('0x15')]='';for(var _0x45cb29=0x0;_0x45cb29<_0x2488bd[_0xf570('0x19')]['transcripts'][_0xf570('0x1b')];_0x45cb29++){_0x34d96a[_0xf570('0x15')]+=_0x2488bd[_0xf570('0x19')][_0xf570('0x1a')][_0x45cb29][_0xf570('0x1c')]+'';}}return _0x3c689c[_0xf570('0x1d')](_0x34d96a);})[_0xf570('0x10')](function(){logger[_0xf570('0xa')](util[_0xf570('0x11')](_0xf570('0x1e'),_0x3c689c['id']));if(!_0x3c689c[_0xf570('0x1f')]){throw new db[(_0xf570('0x20'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x40559e[_0xf570('0x21')]||!_0x40559e[_0xf570('0x22')]||!_0x40559e[_0xf570('0x23')]||!_0x40559e[_0xf570('0x24')]||!_0x40559e[_0xf570('0x25')]){throw new db[(_0xf570('0x20'))][(_0xf570('0x26'))](_0xf570('0x27'));}if(!_0x34d96a[_0xf570('0x15')]){throw new Error('Transcript\x20not\x20available');}if(_0x40559e[_0xf570('0x22')]===_0x51cb42['id']){return _0x51cb42;}else{return db['CloudProvider'][_0xf570('0x28')]({'where':{'id':_settings[_0xf570('0x22')]}});}})[_0xf570('0x10')](function(_0x596428){if(!_0x596428){throw new db[(_0xf570('0x20'))][(_0xf570('0x26'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x596428[_0xf570('0xd')]||!_0x596428['data2']){throw new db[(_0xf570('0x20'))][(_0xf570('0x26'))](_0xf570('0x29'));}_0x32e0b0=_0x596428;logger[_0xf570('0xa')](util['format']('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x3c689c['id']));return sentiment(_0x32e0b0[_0xf570('0xd')],_0x32e0b0[_0xf570('0xe')],_0x40559e[_0xf570('0x23')],_0x34d96a[_0xf570('0x15')],_0x40559e[_0xf570('0x24')]);})['then'](function(_0x1db4fa){logger['info'](util['format']('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x3c689c['id']));return _0x3c689c[_0xf570('0x1d')]({'sentiment':_0x1db4fa['Sentiment'],'sPositive':_0x1db4fa[_0xf570('0x2a')][_0xf570('0x2b')],'sNegative':_0x1db4fa['SentimentScore']['Negative'],'sMixed':_0x1db4fa[_0xf570('0x2a')]['Mixed'],'sNeutral':_0x1db4fa['SentimentScore'][_0xf570('0x2c')]});})['then'](function(){logger['info'](util['format'](_0xf570('0x1e'),_0x3c689c['id']));_0xe2d1a4();});case _0xf570('0x2d'):return _0x3c689c[_0xf570('0x1d')]({'transcribeStatus':_0xf570('0x2d'),'failureReason':_0x1065a9[_0xf570('0x13')][_0xf570('0x2e')]})[_0xf570('0x10')](function(){logger[_0xf570('0xa')](util[_0xf570('0x11')](_0xf570('0x1e'),_0x3c689c['id']));_0xe2d1a4();});default:logger[_0xf570('0xa')](util[_0xf570('0x11')]('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x3c689c['id']));break;}}else{return BPromise[_0xf570('0x2f')]()[_0xf570('0x10')](function(){if(!_0x3c689c[_0xf570('0x1f')]){throw new db['Sequelize'][(_0xf570('0x26'))](_0xf570('0x30'));}if(!_0x40559e[_0xf570('0x21')]||!_0x40559e[_0xf570('0x22')]||!_0x40559e[_0xf570('0x23')]||!_0x40559e[_0xf570('0x24')]||!_0x40559e[_0xf570('0x25')]){throw new db[(_0xf570('0x20'))][(_0xf570('0x26'))](_0xf570('0x27'));}if(!_0x3c689c[_0xf570('0x15')]){throw new Error(_0xf570('0x31'));}if(_0x40559e[_0xf570('0x22')]===_0x51cb42['id']){return _0x51cb42;}else{return db['CloudProvider'][_0xf570('0x28')]({'where':{'id':_settings[_0xf570('0x22')]}});}})['then'](function(_0x851844){if(!_0x851844){throw new db[(_0xf570('0x20'))][(_0xf570('0x26'))](_0xf570('0x32'));}if(!_0x851844[_0xf570('0xd')]||!_0x851844[_0xf570('0xe')]){throw new db[(_0xf570('0x20'))]['ValidationError'](_0xf570('0x29'));}_0x32e0b0=_0x851844;logger[_0xf570('0xa')](util[_0xf570('0x11')](_0xf570('0x33'),_0x3c689c['id']));return sentiment(_0x32e0b0[_0xf570('0xd')],_0x32e0b0[_0xf570('0xe')],_0x40559e['sentimentRegion'],_0x3c689c['fileText'],_0x40559e[_0xf570('0x24')]);})[_0xf570('0x10')](function(_0x32408a){logger[_0xf570('0xa')](util['format'](_0xf570('0x34'),_0x3c689c['id']));return _0x3c689c[_0xf570('0x1d')]({'sentiment':_0x32408a[_0xf570('0x35')],'sPositive':_0x32408a['SentimentScore'][_0xf570('0x2b')],'sNegative':_0x32408a['SentimentScore'][_0xf570('0x36')],'sMixed':_0x32408a[_0xf570('0x2a')][_0xf570('0x37')],'sNeutral':_0x32408a[_0xf570('0x2a')][_0xf570('0x2c')],'transcribeStatus':_0xf570('0x38')});})[_0xf570('0x10')](function(){logger[_0xf570('0xa')](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x3c689c['id']));_0xe2d1a4();});}})[_0xf570('0x39')](function(_0x562afd){if(_0x562afd){if(!_0x562afd[_0xf570('0x3a')]||_0x562afd[_0xf570('0x3a')]!==_0xf570('0x3b')){logger[_0xf570('0x3c')](util[_0xf570('0x11')](_0xf570('0x3d'),_0x3c689c['id']),util[_0xf570('0x3e')](_0x562afd,{'showHidden':![],'depth':null}));}}_0xe2d1a4();});});}function checkTranscribe(){var _0x278cd4;var _0x2cb5e3;var _0x4ec02c;return db[_0xf570('0x3f')]['findAll']({'where':{'transcribeStatus':_0xf570('0x40')}})[_0xf570('0x10')](function(_0x3bff45){if(!_0x3bff45||!_0x3bff45['length']){throw new db['Sequelize'][(_0xf570('0x26'))]('No\x20transcribe\x20job\x20to\x20check');}_0x278cd4=_0x3bff45;return db[_0xf570('0x41')]['findOne']({'where':{'id':0x1}});})['then'](function(_0x2d33af){if(!_0x2d33af){throw new db[(_0xf570('0x20'))][(_0xf570('0x26'))](_0xf570('0x42'));}_0x2cb5e3=_0x2d33af;if(!_0x2cb5e3[_0xf570('0x5')]||!_0x2cb5e3['transcribeAccountId']||!_0x2cb5e3[_0xf570('0xf')]||!_0x2cb5e3[_0xf570('0x24')]||!_0x2cb5e3['bucket']){throw new db[(_0xf570('0x20'))]['ValidationError'](_0xf570('0x43'));}return db[_0xf570('0x44')][_0xf570('0x28')]({'where':{'id':_0x2cb5e3[_0xf570('0x45')]}});})[_0xf570('0x10')](function(_0x563e3f){if(!_0x563e3f){throw new db['Sequelize'][(_0xf570('0x26'))](_0xf570('0x32'));}if(!_0x563e3f[_0xf570('0xd')]||!_0x563e3f[_0xf570('0xe')]){throw new db['Sequelize'][(_0xf570('0x26'))]('Cloud\x20Provider\x20not\x20configured');}_0x4ec02c=_0x563e3f;var _0x2831da=[];_0x278cd4[_0xf570('0x46')](function(_0x2bc615){_0x2831da[_0xf570('0x47')](checkTranscribeJob(_0x2bc615,_0x2cb5e3,_0x4ec02c));});return BPromise['all'](_0x2831da);})[_0xf570('0x39')](function(_0x4cfb59){if(_0x4cfb59){if(!_0x4cfb59['name']||_0x4cfb59[_0xf570('0x3a')]!=='SequelizeValidationError'){logger['error'](util[_0xf570('0x3e')](_0x4cfb59,{'showHidden':![],'depth':null}));}}});}exports[_0xf570('0x48')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x317b=['catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','forEach','push','all','start','lodash','aws-sdk','util','bluebird','../../config/logger','transcribe','TranscribeService','Comprehend','detectSentiment','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','data1','data2','transcribeRegion','info','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','transcribeName','TranscriptionJobStatus','fileText','COMPLETED','TranscriptionJob','TranscriptFileUri','format','[RECORDING:%d]\x20Get\x20transcript','Transcript','then','[RECORDING:%d]\x20Transcript\x20downloaded','results','length','transcripts','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','Sequelize','ValidationError','sentimentAccountId','sentimentRegion','language','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','Positive','SentimentScore','Negative','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','tempSentiment','Sentiment\x20Analysis\x20not\x20requested','sentiment','bucket','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x317b,0x1c7));var _0xb317=function(_0x9f9889,_0x344d14){_0x9f9889=_0x9f9889-0x0;var _0x4dc954=_0x317b[_0x9f9889];return _0x4dc954;};var _=require(_0xb317('0x0'));var AWS=require(_0xb317('0x1'));var rp=require('request-promise');var util=require(_0xb317('0x2'));var BPromise=require(_0xb317('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0xb317('0x4'))(_0xb317('0x5'));function getTranscriptionJob(_0x423e4e,_0x211f10,_0x2d7cfc,_0x6261e6){return new Promise(function(_0x2904b8,_0x33ed9c){var _0x2161fc=new AWS[(_0xb317('0x6'))]({'accessKeyId':_0x211f10,'secretAccessKey':_0x423e4e,'region':_0x2d7cfc});_0x2161fc['getTranscriptionJob']({'TranscriptionJobName':_0x6261e6},function(_0x31c7d5,_0x6a96e9){if(_0x31c7d5){return _0x33ed9c(_0x31c7d5);}else{return _0x2904b8(_0x6a96e9);}});});}function sentiment(_0x560c44,_0x37a07b,_0x3ce77d,_0x45e4a0,_0xd2deea){return new Promise(function(_0xbffffb,_0x354a87){var _0x48f311=new AWS[(_0xb317('0x7'))]({'accessKeyId':_0x37a07b,'secretAccessKey':_0x560c44,'region':_0x3ce77d});_0x48f311[_0xb317('0x8')]({'Text':_0x45e4a0,'LanguageCode':_0xd2deea['substring'](0x0,0x2)},function(_0x1000d9,_0x494541){if(_0x1000d9){return _0x354a87(_0x1000d9);}else{return _0xbffffb(_0x494541);}});});}function checkTranscribeJob(_0x2369e6,_0x1f9624,_0x458584){var _0x15f3f5;return new BPromise(function(_0x4d99d8,_0xf88e1c){logger['info'](util['format'](_0xb317('0x9'),_0x2369e6['id'],_0x2369e6['transcribeName']));return getTranscriptionJob(_0x458584[_0xb317('0xa')],_0x458584[_0xb317('0xb')],_0x1f9624[_0xb317('0xc')],_0x2369e6['transcribeName'])['then'](function(_0x5f1f1d){logger[_0xb317('0xd')](util['format'](_0xb317('0xe'),_0x2369e6['id'],_0x2369e6[_0xb317('0xf')],_0x5f1f1d['TranscriptionJob'][_0xb317('0x10')]));if(!_0x2369e6[_0xb317('0x11')]){switch(_0x5f1f1d['TranscriptionJob']['TranscriptionJobStatus']){case _0xb317('0x12'):var _0x3083d8={'transcribeStatus':_0x5f1f1d[_0xb317('0x13')][_0xb317('0x10')],'fileUri':_0x5f1f1d[_0xb317('0x13')]['Transcript'][_0xb317('0x14')]};logger[_0xb317('0xd')](util[_0xb317('0x15')](_0xb317('0x16'),_0x2369e6['id']));return rp({'uri':_0x5f1f1d[_0xb317('0x13')][_0xb317('0x17')][_0xb317('0x14')],'json':!![]})[_0xb317('0x18')](function(_0x1fb834){logger[_0xb317('0xd')](util[_0xb317('0x15')](_0xb317('0x19'),_0x2369e6['id']));if(_0x1fb834&&_0x1fb834[_0xb317('0x1a')]&&_0x1fb834[_0xb317('0x1a')]['transcripts']&&_0x1fb834[_0xb317('0x1a')]['transcripts'][_0xb317('0x1b')]){_0x3083d8[_0xb317('0x11')]='';for(var _0x3009fb=0x0;_0x3009fb<_0x1fb834[_0xb317('0x1a')][_0xb317('0x1c')][_0xb317('0x1b')];_0x3009fb++){_0x3083d8[_0xb317('0x11')]+=_0x1fb834[_0xb317('0x1a')]['transcripts'][_0x3009fb][_0xb317('0x1d')]+'';}}return _0x2369e6[_0xb317('0x1e')](_0x3083d8);})[_0xb317('0x18')](function(){logger[_0xb317('0xd')](util[_0xb317('0x15')](_0xb317('0x1f'),_0x2369e6['id']));if(!_0x2369e6['tempSentiment']){throw new db[(_0xb317('0x20'))][(_0xb317('0x21'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x1f9624['sentiment']||!_0x1f9624[_0xb317('0x22')]||!_0x1f9624[_0xb317('0x23')]||!_0x1f9624[_0xb317('0x24')]||!_0x1f9624['bucket']){throw new db[(_0xb317('0x20'))][(_0xb317('0x21'))](_0xb317('0x25'));}if(!_0x3083d8[_0xb317('0x11')]){throw new Error(_0xb317('0x26'));}if(_0x1f9624['sentimentAccountId']===_0x458584['id']){return _0x458584;}else{return db[_0xb317('0x27')]['findOne']({'where':{'id':_settings[_0xb317('0x22')]}});}})['then'](function(_0x5e1123){if(!_0x5e1123){throw new db[(_0xb317('0x20'))][(_0xb317('0x21'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x5e1123[_0xb317('0xa')]||!_0x5e1123[_0xb317('0xb')]){throw new db[(_0xb317('0x20'))]['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x15f3f5=_0x5e1123;logger[_0xb317('0xd')](util['format']('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x2369e6['id']));return sentiment(_0x15f3f5['data1'],_0x15f3f5[_0xb317('0xb')],_0x1f9624[_0xb317('0x23')],_0x3083d8[_0xb317('0x11')],_0x1f9624[_0xb317('0x24')]);})['then'](function(_0x297072){logger[_0xb317('0xd')](util[_0xb317('0x15')](_0xb317('0x28'),_0x2369e6['id']));return _0x2369e6['update']({'sentiment':_0x297072[_0xb317('0x29')],'sPositive':_0x297072['SentimentScore'][_0xb317('0x2a')],'sNegative':_0x297072[_0xb317('0x2b')][_0xb317('0x2c')],'sMixed':_0x297072[_0xb317('0x2b')]['Mixed'],'sNeutral':_0x297072[_0xb317('0x2b')][_0xb317('0x2d')]});})[_0xb317('0x18')](function(){logger['info'](util[_0xb317('0x15')](_0xb317('0x1f'),_0x2369e6['id']));_0x4d99d8();});case _0xb317('0x2e'):return _0x2369e6[_0xb317('0x1e')]({'transcribeStatus':'FAILED','failureReason':_0x5f1f1d[_0xb317('0x13')][_0xb317('0x2f')]})[_0xb317('0x18')](function(){logger[_0xb317('0xd')](util[_0xb317('0x15')](_0xb317('0x1f'),_0x2369e6['id']));_0x4d99d8();});default:logger[_0xb317('0xd')](util['format'](_0xb317('0x30'),_0x2369e6['id']));break;}}else{return BPromise['resolve']()[_0xb317('0x18')](function(){if(!_0x2369e6[_0xb317('0x31')]){throw new db[(_0xb317('0x20'))]['ValidationError'](_0xb317('0x32'));}if(!_0x1f9624[_0xb317('0x33')]||!_0x1f9624[_0xb317('0x22')]||!_0x1f9624[_0xb317('0x23')]||!_0x1f9624['language']||!_0x1f9624[_0xb317('0x34')]){throw new db['Sequelize'][(_0xb317('0x21'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x2369e6[_0xb317('0x11')]){throw new Error('Transcript\x20not\x20available');}if(_0x1f9624[_0xb317('0x22')]===_0x458584['id']){return _0x458584;}else{return db['CloudProvider'][_0xb317('0x35')]({'where':{'id':_settings[_0xb317('0x22')]}});}})[_0xb317('0x18')](function(_0x5642b3){if(!_0x5642b3){throw new db['Sequelize'][(_0xb317('0x21'))](_0xb317('0x36'));}if(!_0x5642b3['data1']||!_0x5642b3[_0xb317('0xb')]){throw new db[(_0xb317('0x20'))][(_0xb317('0x21'))](_0xb317('0x37'));}_0x15f3f5=_0x5642b3;logger[_0xb317('0xd')](util['format']('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x2369e6['id']));return sentiment(_0x15f3f5[_0xb317('0xa')],_0x15f3f5['data2'],_0x1f9624[_0xb317('0x23')],_0x2369e6[_0xb317('0x11')],_0x1f9624[_0xb317('0x24')]);})[_0xb317('0x18')](function(_0xda2983){logger[_0xb317('0xd')](util[_0xb317('0x15')](_0xb317('0x28'),_0x2369e6['id']));return _0x2369e6[_0xb317('0x1e')]({'sentiment':_0xda2983[_0xb317('0x29')],'sPositive':_0xda2983[_0xb317('0x2b')][_0xb317('0x2a')],'sNegative':_0xda2983[_0xb317('0x2b')]['Negative'],'sMixed':_0xda2983[_0xb317('0x2b')]['Mixed'],'sNeutral':_0xda2983[_0xb317('0x2b')][_0xb317('0x2d')],'transcribeStatus':_0xb317('0x12')});})['then'](function(){logger['info'](util[_0xb317('0x15')](_0xb317('0x1f'),_0x2369e6['id']));_0x4d99d8();});}})[_0xb317('0x38')](function(_0x132964){if(_0x132964){if(!_0x132964[_0xb317('0x39')]||_0x132964['name']!==_0xb317('0x3a')){logger[_0xb317('0x3b')](util[_0xb317('0x15')](_0xb317('0x3c'),_0x2369e6['id']),util['inspect'](_0x132964,{'showHidden':![],'depth':null}));}}_0x4d99d8();});});}function checkTranscribe(){var _0xe343ba;var _0x271de0;var _0x1918b9;return db[_0xb317('0x3d')][_0xb317('0x3e')]({'where':{'transcribeStatus':_0xb317('0x3f')}})['then'](function(_0x3beb94){if(!_0x3beb94||!_0x3beb94[_0xb317('0x1b')]){throw new db[(_0xb317('0x20'))][(_0xb317('0x21'))](_0xb317('0x40'));}_0xe343ba=_0x3beb94;return db[_0xb317('0x41')][_0xb317('0x35')]({'where':{'id':0x1}});})['then'](function(_0x11428f){if(!_0x11428f){throw new db[(_0xb317('0x20'))][(_0xb317('0x21'))](_0xb317('0x42'));}_0x271de0=_0x11428f;if(!_0x271de0[_0xb317('0x5')]||!_0x271de0[_0xb317('0x43')]||!_0x271de0['transcribeRegion']||!_0x271de0['language']||!_0x271de0[_0xb317('0x34')]){throw new db['Sequelize'][(_0xb317('0x21'))](_0xb317('0x44'));}return db[_0xb317('0x27')][_0xb317('0x35')]({'where':{'id':_0x271de0['transcribeAccountId']}});})[_0xb317('0x18')](function(_0x49f860){if(!_0x49f860){throw new db['Sequelize']['ValidationError'](_0xb317('0x36'));}if(!_0x49f860['data1']||!_0x49f860['data2']){throw new db[(_0xb317('0x20'))][(_0xb317('0x21'))](_0xb317('0x37'));}_0x1918b9=_0x49f860;var _0x232ff0=[];_0xe343ba[_0xb317('0x45')](function(_0x2534f7){_0x232ff0[_0xb317('0x46')](checkTranscribeJob(_0x2534f7,_0x271de0,_0x1918b9));});return BPromise[_0xb317('0x47')](_0x232ff0);})[_0xb317('0x38')](function(_0x1a7bc7){if(_0x1a7bc7){if(!_0x1a7bc7[_0xb317('0x39')]||_0x1a7bc7[_0xb317('0x39')]!==_0xb317('0x3a')){logger[_0xb317('0x3b')](util['inspect'](_0x1a7bc7,{'showHidden':![],'depth':null}));}}});}exports[_0xb317('0x48')]=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 a97bbd3..4f8d3a1 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 _0xf625=['error','inspect','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','subtract','hours','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','then','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','join','emit','whatsappInteraction:update','catch'];(function(_0xcfe8cc,_0xb83aeb){var _0x55ac53=function(_0x4067d4){while(--_0x4067d4){_0xcfe8cc['push'](_0xcfe8cc['shift']());}};_0x55ac53(++_0xb83aeb);}(_0xf625,0xac));var _0x5f62=function(_0x5b87ce,_0x20b7f6){_0x5b87ce=_0x5b87ce-0x0;var _0x597aa7=_0xf625[_0x5b87ce];return _0x597aa7;};'use strict';var _=require(_0x5f62('0x0'));var moment=require(_0x5f62('0x1'));var Redis=require(_0x5f62('0x2'));var util=require(_0x5f62('0x3'));var config=require(_0x5f62('0x4'));var db=require(_0x5f62('0x5'))['db'];var logger=require(_0x5f62('0x6'))(_0x5f62('0x7'));config[_0x5f62('0x8')]=_[_0x5f62('0x9')](config[_0x5f62('0x8')],{'host':_0x5f62('0xa'),'port':0x18eb});var io=require(_0x5f62('0xb'))(new Redis(config[_0x5f62('0x8')]));function closeInteractions(){var _0x3e0932=[];return db[_0x5f62('0xc')][_0x5f62('0xd')]({'raw':!![],'attributes':['id',_0x5f62('0xe')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x5f62('0xf')](0x18,_0x5f62('0x10'))}}})['then'](function(_0x13a231){if(_0x13a231&&_0x13a231[_0x5f62('0x11')]){_0x3e0932=_[_0x5f62('0x12')](_0x13a231||[],'id');logger[_0x5f62('0x13')](_0x5f62('0x14'),_0x3e0932['join']());return db['WhatsappInteraction'][_0x5f62('0x15')]({'closeReason':_0x5f62('0x16'),'disposition':_0x5f62('0x17'),'closed':!![],'closedAt':moment()[_0x5f62('0x18')](_0x5f62('0x19'))},{'where':{'id':_0x3e0932}});}})[_0x5f62('0x1a')](function(){if(_0x3e0932&&_0x3e0932[_0x5f62('0x11')]){logger[_0x5f62('0x13')](_0x5f62('0x1b'),_0x3e0932[_0x5f62('0x1c')]());for(var _0x2557d4=0x0;_0x2557d4<_0x3e0932[_0x5f62('0x11')];_0x2557d4++){io[_0x5f62('0x1d')](_0x5f62('0x1e'),{'id':_0x3e0932[_0x2557d4],'closed':!![]});}}})[_0x5f62('0x1f')](function(_0x3915d3){logger[_0x5f62('0x20')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x3915d3?util[_0x5f62('0x21')](_0x3915d3,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x7d5d=['start','moment','ioredis','../../mysqldb','../logger','schedule','defaults','redis','localhost','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','hours','then','length','map','info','join','update','system','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x7d5d,0x1dd));var _0xd7d5=function(_0x21cff4,_0x1df6b3){_0x21cff4=_0x21cff4-0x0;var _0x3163fc=_0x7d5d[_0x21cff4];return _0x3163fc;};'use strict';var _=require('lodash');var moment=require(_0xd7d5('0x0'));var Redis=require(_0xd7d5('0x1'));var util=require('util');var config=require('../../config/environment');var db=require(_0xd7d5('0x2'))['db'];var logger=require(_0xd7d5('0x3'))(_0xd7d5('0x4'));config['redis']=_[_0xd7d5('0x5')](config[_0xd7d5('0x6')],{'host':_0xd7d5('0x7'),'port':0x18eb});var io=require(_0xd7d5('0x8'))(new Redis(config[_0xd7d5('0x6')]));function closeInteractions(){var _0x559f36=[];return db[_0xd7d5('0x9')][_0xd7d5('0xa')]({'raw':!![],'attributes':['id',_0xd7d5('0xb')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,_0xd7d5('0xc'))}}})[_0xd7d5('0xd')](function(_0x4c3b64){if(_0x4c3b64&&_0x4c3b64[_0xd7d5('0xe')]){_0x559f36=_[_0xd7d5('0xf')](_0x4c3b64||[],'id');logger[_0xd7d5('0x10')]('[WHATSAPP]\x20Interactions\x20to\x20close:',_0x559f36[_0xd7d5('0x11')]());return db[_0xd7d5('0x9')][_0xd7d5('0x12')]({'closeReason':_0xd7d5('0x13'),'disposition':'timeout','closed':!![],'closedAt':moment()['format'](_0xd7d5('0x14'))},{'where':{'id':_0x559f36}});}})[_0xd7d5('0xd')](function(){if(_0x559f36&&_0x559f36[_0xd7d5('0xe')]){logger[_0xd7d5('0x10')](_0xd7d5('0x15'),_0x559f36[_0xd7d5('0x11')]());for(var _0x54e2f1=0x0;_0x54e2f1<_0x559f36[_0xd7d5('0xe')];_0x54e2f1++){io[_0xd7d5('0x16')](_0xd7d5('0x17'),{'id':_0x559f36[_0x54e2f1],'closed':!![]});}}})[_0xd7d5('0x18')](function(_0x237c1f){logger['error'](_0xd7d5('0x19'),_0x237c1f?util[_0xd7d5('0x1a')](_0x237c1f,{'showHidden':![],'depth':null}):'');});}exports[_0xd7d5('0x1b')]=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 1c02769..560214c 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x49cf=['then','bulkCreate','log','contacts1','CmHopper','finished\x20populating','hopper1','contacts2','hopper2','catch','util','../mysqldb','push','Biondo','innocenzo.biondo','@xcally.com','now','Innocenzo','CmContact','destroy'];(function(_0x24c39b,_0x2fc9f9){var _0xb808a3=function(_0x2ffb7e){while(--_0x2ffb7e){_0x24c39b['push'](_0x24c39b['shift']());}};_0xb808a3(++_0x2fc9f9);}(_0x49cf,0x122));var _0xf49c=function(_0x2e3efc,_0x2b26c2){_0x2e3efc=_0x2e3efc-0x0;var _0x275be1=_0x49cf[_0x2e3efc];return _0x275be1;};'use strict';var util=require(_0xf49c('0x0'));var db=require(_0xf49c('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xf49c('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0xf49c('0x3')+i,'phone':0xf879fb460+i,'email':_0xf49c('0x4')+i+_0xf49c('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0xf49c('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xf49c('0x6')](),'updatedAt':Date[_0xf49c('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0xf49c('0x7')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0xf49c('0x4')+i+_0xf49c('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0xf49c('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xf49c('0x6')](),'updatedAt':Date[_0xf49c('0x6')]()});}db[_0xf49c('0x8')][_0xf49c('0x9')]({'where':{}})[_0xf49c('0xa')](function(){return db[_0xf49c('0x8')][_0xf49c('0xb')](contacts);})['then'](function(){console[_0xf49c('0xc')]('finished\x20populating',_0xf49c('0xd'));return db[_0xf49c('0xe')][_0xf49c('0x9')]({'where':{}});})[_0xf49c('0xa')](function(){return db['CmHopper'][_0xf49c('0xb')](hopper);})[_0xf49c('0xa')](function(){console[_0xf49c('0xc')](_0xf49c('0xf'),_0xf49c('0x10'));return db[_0xf49c('0x8')]['bulkCreate'](contacts2);})[_0xf49c('0xa')](function(){console[_0xf49c('0xc')](_0xf49c('0xf'),_0xf49c('0x11'));return db[_0xf49c('0xe')][_0xf49c('0xb')](hopper2);})[_0xf49c('0xa')](function(){console['log']('finished\x20populating',_0xf49c('0x12'));})[_0xf49c('0x13')](function(_0x45eb6b){console['log'](_0x45eb6b);}); \ No newline at end of file +var _0x157e=['Biondo','innocenzo.biondo','@xcally.com','now','CmContact','destroy','then','finished\x20populating','contacts1','CmHopper','log','bulkCreate','contacts2','hopper2','push','Innocenzo'];(function(_0x12cf7b,_0x4a6592){var _0x46da25=function(_0x1e0a46){while(--_0x1e0a46){_0x12cf7b['push'](_0x12cf7b['shift']());}};_0x46da25(++_0x4a6592);}(_0x157e,0xfe));var _0xe157=function(_0x5af528,_0x58e09b){_0x5af528=_0x5af528-0x0;var _0x5ad4be=_0x157e[_0x5af528];return _0x5ad4be;};'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[_0xe157('0x0')]({'id':i,'firstName':_0xe157('0x1')+i,'lastName':_0xe157('0x2')+i,'phone':0xf879fb460+i,'email':_0xe157('0x3')+i+_0xe157('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xe157('0x0')]({'id':i,'active':![],'scheduledat':Date[_0xe157('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xe157('0x5')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':'Innocenzo'+i,'lastName':_0xe157('0x2')+i,'phone':0xf879fb460+i,'email':_0xe157('0x3')+i+_0xe157('0x4')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xe157('0x0')]({'id':i,'active':![],'scheduledat':Date[_0xe157('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xe157('0x5')](),'updatedAt':Date[_0xe157('0x5')]()});}db[_0xe157('0x6')][_0xe157('0x7')]({'where':{}})[_0xe157('0x8')](function(){return db[_0xe157('0x6')]['bulkCreate'](contacts);})['then'](function(){console['log'](_0xe157('0x9'),_0xe157('0xa'));return db[_0xe157('0xb')][_0xe157('0x7')]({'where':{}});})[_0xe157('0x8')](function(){return db[_0xe157('0xb')]['bulkCreate'](hopper);})['then'](function(){console[_0xe157('0xc')](_0xe157('0x9'),'hopper1');return db['CmContact'][_0xe157('0xd')](contacts2);})['then'](function(){console[_0xe157('0xc')](_0xe157('0x9'),_0xe157('0xe'));return db[_0xe157('0xb')][_0xe157('0xd')](hopper2);})[_0xe157('0x8')](function(){console[_0xe157('0xc')]('finished\x20populating',_0xe157('0xf'));})['catch'](function(_0x2d8498){console[_0xe157('0xc')](_0x2d8498);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index c7dc2af..66c66d6 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x90c7=['ulaw','yes','/etc/pki/tls/certs/motion.crt','\x22%s\x22\x20<%s>','bulkCreate','then','util','../mysqldb','push','format','agent','%s%s','%s%s@xcally.com','password','friend','wss','all'];(function(_0x12a1bd,_0x4f785f){var _0x2dfb25=function(_0x2a6f90){while(--_0x2a6f90){_0x12a1bd['push'](_0x12a1bd['shift']());}};_0x2dfb25(++_0x4f785f);}(_0x90c7,0x1c0));var _0x790c=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x90c7[_0x33032e];return _0x13316b;};'use strict';var util=require(_0x790c('0x0'));var db=require(_0x790c('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x790c('0x2')]({'name':util[_0x790c('0x3')]('%s%s',_0x790c('0x4'),i),'fullname':util[_0x790c('0x3')](_0x790c('0x5'),_0x790c('0x4'),i),'email':util[_0x790c('0x3')](_0x790c('0x6'),_0x790c('0x4'),i),'role':_0x790c('0x4'),'password':_0x790c('0x7'),'internal':0xfa0+i,'type':_0x790c('0x8'),'transport':['udp','ws',_0x790c('0x9')],'disallow':[_0x790c('0xa')],'allow':[_0x790c('0xb')],'defaultuser':util[_0x790c('0x3')](_0x790c('0x5'),_0x790c('0x4'),i),'encryption':'yes','avpf':_0x790c('0xc'),'force_avp':_0x790c('0xc'),'icesupport':_0x790c('0xc'),'dtlsenable':_0x790c('0xc'),'dtlsverify':'no','dtlscertfile':_0x790c('0xd'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':'actpass','callerid':util['format'](_0x790c('0xe'),util[_0x790c('0x3')]('%s%s',_0x790c('0x4'),i),0xfa0+i)});}db['User'][_0x790c('0xf')](users)[_0x790c('0x10')](function(){console['log']('add\x20user');})['catch'](function(_0x21107e){console['log'](_0x21107e);}); \ No newline at end of file +var _0xa8f1=['udp','all','ulaw','%s%s','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','then','add\x20user','log','util','../mysqldb','push','format','%s%s@xcally.com','agent','password','friend'];(function(_0x1eb3b0,_0x84bc40){var _0xbecd61=function(_0x442e68){while(--_0x442e68){_0x1eb3b0['push'](_0x1eb3b0['shift']());}};_0xbecd61(++_0x84bc40);}(_0xa8f1,0x1b1));var _0x1a8f=function(_0x46a437,_0xcc9d4f){_0x46a437=_0x46a437-0x0;var _0x570cdf=_0xa8f1[_0x46a437];return _0x570cdf;};'use strict';var util=require(_0x1a8f('0x0'));var db=require(_0x1a8f('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x1a8f('0x2')]({'name':util['format']('%s%s','agent',i),'fullname':util['format']('%s%s','agent',i),'email':util[_0x1a8f('0x3')](_0x1a8f('0x4'),_0x1a8f('0x5'),i),'role':_0x1a8f('0x5'),'password':_0x1a8f('0x6'),'internal':0xfa0+i,'type':_0x1a8f('0x7'),'transport':[_0x1a8f('0x8'),'ws','wss'],'disallow':[_0x1a8f('0x9')],'allow':[_0x1a8f('0xa')],'defaultuser':util[_0x1a8f('0x3')](_0x1a8f('0xb'),_0x1a8f('0x5'),i),'encryption':_0x1a8f('0xc'),'avpf':_0x1a8f('0xc'),'force_avp':'yes','icesupport':_0x1a8f('0xc'),'dtlsenable':_0x1a8f('0xc'),'dtlsverify':'no','dtlscertfile':_0x1a8f('0xd'),'dtlsprivatekey':_0x1a8f('0xe'),'dtlssetup':_0x1a8f('0xf'),'callerid':util[_0x1a8f('0x3')](_0x1a8f('0x10'),util['format'](_0x1a8f('0xb'),'agent',i),0xfa0+i)});}db[_0x1a8f('0x11')]['bulkCreate'](users)[_0x1a8f('0x12')](function(){console['log'](_0x1a8f('0x13'));})['catch'](function(_0xeabc94){console[_0x1a8f('0x14')](_0xeabc94);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index c188004..441067a 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3f35=['getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getWhatsappQueues','all','length','voice','chat','fax','sms','mail','openchannel','whatsapp','trunk:%s','campaign:%s:%s','emit','user_has_chat_interactions:remove','leave','removeMailInteractions','user_has_mail_interactions:remove','FaxInteractions','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','WhatsappInteractions','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','connection','address','request','remoteAddress','SocketIO\x20','nsp','DISCONNECTED','lodash','util','bluebird','../mysqldb','./environment','name','Agents','agent','telephone','type','UserProfileSection','findOne','then','VoiceQueues','ChatQueues','MailQueues','findAll','Trunks','UserProfileResource','resourceId','map','User','role','Campaign','ivr','format','%s:queue:%s','user:%s','handshake','query','find','ChatInteractions','MailInteraction','MailInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','voice:inbound','include','ChatQueue','push','FaxQueue','MailQueue','OpenchannelQueue','Trunk','voice:outbound','userProfileId','SmsQueues','SmsQueue','WhatsappQueues','WhatsappQueue','Telephones','IvrCampaigns'];(function(_0x25655c,_0x4817b3){var _0x4907b1=function(_0x27e7b4){while(--_0x27e7b4){_0x25655c['push'](_0x25655c['shift']());}};_0x4907b1(++_0x4817b3);}(_0x3f35,0x1ae));var _0x53f3=function(_0x2bc3f4,_0x470b26){_0x2bc3f4=_0x2bc3f4-0x0;var _0x14ac53=_0x3f35[_0x2bc3f4];return _0x14ac53;};'use strict';var _=require(_0x53f3('0x0'));var util=require(_0x53f3('0x1'));var BPromise=require(_0x53f3('0x2'));var db=require(_0x53f3('0x3'))['db'];var config=require(_0x53f3('0x4'));var queryQueues={'attributes':['id',_0x53f3('0x5')],'include':[{'as':_0x53f3('0x6'),'model':db['User'],'attributes':['id',_0x53f3('0x5'),'role'],'raw':!![],'where':{'role':_0x53f3('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0x53f3('0x8')}};var queryTrunks={'raw':!![],'attributes':['id',_0x53f3('0x5')]};var queryAgents={'raw':!![],'attributes':['id',_0x53f3('0x5')],'where':{'role':_0x53f3('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0x53f3('0x9')],'where':{'type':'ivr'}};function getAssociatedResources(_0x4f4671,_0x4f4d45,_0x10a75b){return db[_0x53f3('0xa')][_0x53f3('0xb')]({'where':{'name':_0x4f4671,'userProfileId':_0x4f4d45},'raw':!![]})[_0x53f3('0xc')](function(_0x5ed51a){if(_0x5ed51a){if(_0x5ed51a['autoAssociation']){switch(_0x4f4671){case _0x53f3('0xd'):case _0x53f3('0xe'):case'FaxQueues':case'SmsQueues':case _0x53f3('0xf'):case'OpenchannelQueues':case'WhatsappQueues':return db[_0x10a75b][_0x53f3('0x10')](queryQueues);case'Telephones':return db[_0x10a75b]['findAll'](queryTelephones);case _0x53f3('0x11'):return db[_0x10a75b][_0x53f3('0x10')](queryTrunks);case'IvrCampaigns':return db[_0x10a75b]['findAll'](queryCampaigns);}}else{return db[_0x53f3('0x12')]['findAll']({'attributes':[_0x53f3('0x13')],'where':{'sectionId':_0x5ed51a['id']},'raw':!![]})[_0x53f3('0xc')](function(_0x27db9a){if(_0x27db9a){var _0x2319cd={'where':{'id':_[_0x53f3('0x14')](_0x27db9a,_0x53f3('0x13'))},'raw':!![]};switch(_0x10a75b){case _0x53f3('0x15'):_0x2319cd['where'][_0x53f3('0x16')]=_0x53f3('0x8');break;case _0x53f3('0x17'):_0x2319cd['where']['type']=_0x53f3('0x18');break;}return db[_0x10a75b]['findAll'](_0x2319cd);}else{return[];}});}}else{return[];}})[_0x53f3('0xc')](function(_0x276e0c){return _0x276e0c;});}function joinOrLeaveQueues(_0x58c850,_0x317d06,_0x40b26c,_0x5a4ebe){_0x58c850[_0x317d06](util[_0x53f3('0x19')](_0x53f3('0x1a'),_0x40b26c,_0x5a4ebe[_0x53f3('0x5')]));if(_0x5a4ebe[_0x53f3('0x6')]){for(var _0x36e191=0x0;_0x36e191<_0x5a4ebe[_0x53f3('0x6')]['length'];_0x36e191+=0x1){_0x58c850[_0x317d06](util[_0x53f3('0x19')](_0x53f3('0x1b'),_0x5a4ebe[_0x53f3('0x6')][_0x36e191][_0x53f3('0x5')]));}}}function joinOrLeave(_0x3dd4cb,_0x5055ce,_0x1ab104){var _0x41be9b;if(_0x3dd4cb[_0x53f3('0x1c')][_0x53f3('0x1d')]['id']){db[_0x53f3('0x15')][_0x53f3('0x1e')]({'attributes':['id','name',_0x53f3('0x16'),'userProfileId'],'where':{'id':_0x3dd4cb['handshake'][_0x53f3('0x1d')]['id']},'include':[{'model':db['ChatInteraction'],'as':_0x53f3('0x1f'),'attributes':['id'],'raw':!![]},{'model':db[_0x53f3('0x20')],'as':_0x53f3('0x21'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x53f3('0x22')],'as':_0x53f3('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x53f3('0x24')],'as':_0x53f3('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x53f3('0x26')],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})[_0x53f3('0xc')](function(_0x1ccd36){if(_0x1ccd36){_0x41be9b=_0x1ccd36;_0x3dd4cb[_0x5055ce](util[_0x53f3('0x19')](_0x53f3('0x1b'),_0x1ccd36['name']));var _0xdaa8f0=[];switch(_0x1ccd36[_0x53f3('0x16')]){case'admin':_0x3dd4cb[_0x5055ce](_0x53f3('0x27'));_0x3dd4cb[_0x5055ce]('voice:outbound');if(queryQueues['hasOwnProperty'](_0x53f3('0x28'))){delete queryQueues[_0x53f3('0x28')];}_0xdaa8f0['push'](db['VoiceQueue'][_0x53f3('0x10')](queryQueues));_0xdaa8f0['push'](db[_0x53f3('0x29')][_0x53f3('0x10')](queryQueues));_0xdaa8f0[_0x53f3('0x2a')](db[_0x53f3('0x2b')][_0x53f3('0x10')](queryQueues));_0xdaa8f0[_0x53f3('0x2a')](db['SmsQueue']['findAll'](queryQueues));_0xdaa8f0['push'](db[_0x53f3('0x2c')][_0x53f3('0x10')](queryQueues));_0xdaa8f0[_0x53f3('0x2a')](db[_0x53f3('0x2d')]['findAll'](queryQueues));_0xdaa8f0[_0x53f3('0x2a')](db['WhatsappQueue'][_0x53f3('0x10')](queryQueues));_0xdaa8f0[_0x53f3('0x2a')](db[_0x53f3('0x15')][_0x53f3('0x10')](queryTelephones));_0xdaa8f0['push'](db[_0x53f3('0x2e')]['findAll'](queryTrunks));_0xdaa8f0[_0x53f3('0x2a')](db['Campaign']['findAll'](queryCampaigns));_0xdaa8f0['push'](db[_0x53f3('0x15')][_0x53f3('0x10')](queryAgents));break;case'user':_0x3dd4cb[_0x5055ce]('voice:inbound');_0x3dd4cb[_0x5055ce](_0x53f3('0x2f'));_0xdaa8f0['push'](getAssociatedResources(_0x53f3('0xd'),_0x1ccd36['userProfileId'],'VoiceQueue'));_0xdaa8f0[_0x53f3('0x2a')](getAssociatedResources('ChatQueues',_0x1ccd36[_0x53f3('0x30')],_0x53f3('0x29')));_0xdaa8f0[_0x53f3('0x2a')](getAssociatedResources('FaxQueues',_0x1ccd36[_0x53f3('0x30')],_0x53f3('0x2b')));_0xdaa8f0['push'](getAssociatedResources(_0x53f3('0x31'),_0x1ccd36['userProfileId'],_0x53f3('0x32')));_0xdaa8f0[_0x53f3('0x2a')](getAssociatedResources(_0x53f3('0xf'),_0x1ccd36[_0x53f3('0x30')],_0x53f3('0x2c')));_0xdaa8f0['push'](getAssociatedResources('OpenchannelQueues',_0x1ccd36[_0x53f3('0x30')],'OpenchannelQueue'));_0xdaa8f0[_0x53f3('0x2a')](getAssociatedResources(_0x53f3('0x33'),_0x1ccd36['userProfileId'],_0x53f3('0x34')));_0xdaa8f0[_0x53f3('0x2a')](getAssociatedResources(_0x53f3('0x35'),_0x1ccd36[_0x53f3('0x30')],_0x53f3('0x15')));_0xdaa8f0[_0x53f3('0x2a')](getAssociatedResources(_0x53f3('0x11'),_0x1ccd36['userProfileId'],_0x53f3('0x2e')));_0xdaa8f0[_0x53f3('0x2a')](getAssociatedResources(_0x53f3('0x36'),_0x1ccd36[_0x53f3('0x30')],_0x53f3('0x17')));_0xdaa8f0['push'](db[_0x53f3('0x15')][_0x53f3('0x10')](queryAgents));break;case _0x53f3('0x7'):_0x3dd4cb[_0x5055ce]('voice:inbound');_0x3dd4cb[_0x5055ce]('voice:outbound');_0xdaa8f0[_0x53f3('0x2a')](_0x1ccd36[_0x53f3('0x37')]({'attributes':['id','name']}));_0xdaa8f0['push'](_0x1ccd36[_0x53f3('0x38')]({'attributes':['id','name']}));_0xdaa8f0[_0x53f3('0x2a')](_0x1ccd36[_0x53f3('0x39')]({'attributes':['id',_0x53f3('0x5')]}));_0xdaa8f0[_0x53f3('0x2a')](_0x1ccd36[_0x53f3('0x3a')]({'attributes':['id',_0x53f3('0x5')]}));_0xdaa8f0[_0x53f3('0x2a')](_0x1ccd36[_0x53f3('0x3b')]({'attributes':['id',_0x53f3('0x5')]}));_0xdaa8f0[_0x53f3('0x2a')](_0x1ccd36['getOpenchannelQueues']({'attributes':['id',_0x53f3('0x5')]}));_0xdaa8f0[_0x53f3('0x2a')](_0x1ccd36[_0x53f3('0x3c')]({'attributes':['id',_0x53f3('0x5')]}));break;}return BPromise[_0x53f3('0x3d')](_0xdaa8f0);}})[_0x53f3('0xc')](function(_0x5e12aa){if(_0x5e12aa&&_0x5e12aa['length']){for(var _0x5cff13=0x0;_0x5cff13<_0x5e12aa['length'];_0x5cff13+=0x1){for(var _0xce0421=0x0;_0xce0421<_0x5e12aa[_0x5cff13][_0x53f3('0x3e')];_0xce0421+=0x1){switch(_0x5cff13){case 0x0:joinOrLeaveQueues(_0x3dd4cb,_0x5055ce,_0x53f3('0x3f'),_0x5e12aa[_0x5cff13][_0xce0421]);break;case 0x1:joinOrLeaveQueues(_0x3dd4cb,_0x5055ce,_0x53f3('0x40'),_0x5e12aa[_0x5cff13][_0xce0421]);break;case 0x2:joinOrLeaveQueues(_0x3dd4cb,_0x5055ce,_0x53f3('0x41'),_0x5e12aa[_0x5cff13][_0xce0421]);break;case 0x3:joinOrLeaveQueues(_0x3dd4cb,_0x5055ce,_0x53f3('0x42'),_0x5e12aa[_0x5cff13][_0xce0421]);break;case 0x4:joinOrLeaveQueues(_0x3dd4cb,_0x5055ce,_0x53f3('0x43'),_0x5e12aa[_0x5cff13][_0xce0421]);break;case 0x5:joinOrLeaveQueues(_0x3dd4cb,_0x5055ce,_0x53f3('0x44'),_0x5e12aa[_0x5cff13][_0xce0421]);break;case 0x6:joinOrLeaveQueues(_0x3dd4cb,_0x5055ce,_0x53f3('0x45'),_0x5e12aa[_0x5cff13][_0xce0421]);break;case 0x7:if(_0x41be9b[_0x53f3('0x16')]!==_0x53f3('0x7'))_0x3dd4cb[_0x5055ce](util['format']('telephone:%s',_0x5e12aa[_0x5cff13][_0xce0421][_0x53f3('0x5')]));break;case 0x8:if(_0x41be9b[_0x53f3('0x16')]!==_0x53f3('0x7'))_0x3dd4cb[_0x5055ce](util[_0x53f3('0x19')](_0x53f3('0x46'),_0x5e12aa[_0x5cff13][_0xce0421][_0x53f3('0x5')]));break;case 0x9:if(_0x41be9b[_0x53f3('0x16')]!==_0x53f3('0x7'))_0x3dd4cb[_0x5055ce](util[_0x53f3('0x19')](_0x53f3('0x47'),_0x5e12aa[_0x5cff13][_0xce0421][_0x53f3('0x9')],_0x5e12aa[_0x5cff13][_0xce0421][_0x53f3('0x5')]));break;case 0xa:_0x3dd4cb[_0x5055ce](util['format'](_0x53f3('0x1b'),_0x5e12aa[_0x5cff13][_0xce0421][_0x53f3('0x5')]));break;}}}}})[_0x53f3('0xc')](function(){if(_0x5055ce==='leave'){var _0xfc6fa2=_[_0x53f3('0x14')](_0x41be9b[_0x53f3('0x1f')],'id');return _0x41be9b['removeChatInteractions'](_0xfc6fa2)[_0x53f3('0xc')](function(){for(var _0x15f728=0x0;_0x15f728<_0xfc6fa2[_0x53f3('0x3e')];_0x15f728+=0x1){_0x1ab104[_0x53f3('0x48')](_0x53f3('0x49'),{'ChatInteractionId':Number(_0xfc6fa2[_0x15f728]),'UserId':Number(_0x41be9b['id'])});}});}})['then'](function(){if(_0x5055ce===_0x53f3('0x4a')){var _0x492a17=_[_0x53f3('0x14')](_0x41be9b[_0x53f3('0x21')],'id');return _0x41be9b[_0x53f3('0x4b')](_0x492a17)[_0x53f3('0xc')](function(){for(var _0x28427d=0x0;_0x28427d<_0x492a17['length'];_0x28427d+=0x1){_0x1ab104[_0x53f3('0x48')](_0x53f3('0x4c'),{'MailInteractionId':Number(_0x492a17[_0x28427d]),'UserId':Number(_0x41be9b['id'])});}});}})['then'](function(){if(_0x5055ce===_0x53f3('0x4a')){var _0x4112bd=_['map'](_0x41be9b[_0x53f3('0x4d')],'id');return _0x41be9b[_0x53f3('0x4e')](_0x4112bd)[_0x53f3('0xc')](function(){for(var _0x1ff394=0x0;_0x1ff394<_0x4112bd[_0x53f3('0x3e')];_0x1ff394+=0x1){_0x1ab104[_0x53f3('0x48')](_0x53f3('0x4f'),{'FaxInteractionId':Number(_0x4112bd[_0x1ff394]),'UserId':Number(_0x41be9b['id'])});}});}})[_0x53f3('0xc')](function(){if(_0x5055ce==='leave'){var _0x7f773e=_[_0x53f3('0x14')](_0x41be9b[_0x53f3('0x23')],'id');return _0x41be9b[_0x53f3('0x50')](_0x7f773e)[_0x53f3('0xc')](function(){for(var _0x187e56=0x0;_0x187e56<_0x7f773e[_0x53f3('0x3e')];_0x187e56+=0x1){_0x1ab104[_0x53f3('0x48')](_0x53f3('0x51'),{'SmsInteractionId':Number(_0x7f773e[_0x187e56]),'UserId':Number(_0x41be9b['id'])});}});}})[_0x53f3('0xc')](function(){if(_0x5055ce===_0x53f3('0x4a')){var _0xe691f3=_[_0x53f3('0x14')](_0x41be9b[_0x53f3('0x25')],'id');return _0x41be9b[_0x53f3('0x52')](_0xe691f3)[_0x53f3('0xc')](function(){for(var _0x23c362=0x0;_0x23c362<_0xe691f3[_0x53f3('0x3e')];_0x23c362+=0x1){_0x1ab104['emit'](_0x53f3('0x53'),{'OpenchannelInteractionId':Number(_0xe691f3[_0x23c362]),'UserId':Number(_0x41be9b['id'])});}});}})[_0x53f3('0xc')](function(){if(_0x5055ce===_0x53f3('0x4a')){var _0x406dba=_[_0x53f3('0x14')](_0x41be9b[_0x53f3('0x54')],'id');return _0x41be9b[_0x53f3('0x55')](_0x406dba)['then'](function(){for(var _0x22d7f6=0x0;_0x22d7f6<_0x406dba[_0x53f3('0x3e')];_0x22d7f6+=0x1){_0x1ab104['emit'](_0x53f3('0x56'),{'WhatsappInteractionId':Number(_0x406dba[_0x22d7f6]),'UserId':Number(_0x41be9b['id'])});}});}})[_0x53f3('0x57')](function(_0x14909d){_0x3dd4cb[_0x53f3('0x58')](_0x14909d);});}}function onDisconnect(_0x3feb9,_0x26a3f0){joinOrLeave(_0x3feb9,_0x53f3('0x4a'),_0x26a3f0);}function onConnect(_0x532648){joinOrLeave(_0x532648,_0x53f3('0x59'));}exports['default']=function(_0x1802cd){_0x1802cd['on'](_0x53f3('0x5a'),function(_0x32de53){_0x32de53['setMaxListeners'](0x0);_0x32de53[_0x53f3('0x5b')]=_0x32de53[_0x53f3('0x5c')]['connection'][_0x53f3('0x5d')]+':'+_0x32de53[_0x53f3('0x5c')][_0x53f3('0x5a')]['remotePort'];_0x32de53['connectedAt']=new Date();_0x32de53[_0x53f3('0x58')]=function(_0x2e0b07){console[_0x53f3('0x58')](_0x53f3('0x5e')+_0x32de53[_0x53f3('0x5f')][_0x53f3('0x5')]+'['+_0x32de53[_0x53f3('0x5b')]+']',_0x2e0b07);};_0x32de53['on']('disconnect',function(){onDisconnect(_0x32de53,_0x1802cd);_0x32de53['log'](_0x53f3('0x60'));});onConnect(_0x32de53);_0x32de53[_0x53f3('0x58')]('CONNECTED');});}; \ No newline at end of file +var _0x9bdb=['CONNECTED','lodash','util','bluebird','../mysqldb','name','Agents','User','role','agent','telephone','type','ivr','UserProfileSection','findOne','then','VoiceQueues','ChatQueues','FaxQueues','OpenchannelQueues','WhatsappQueues','Telephones','findAll','Trunks','IvrCampaigns','UserProfileResource','resourceId','where','Campaign','format','%s:queue:%s','length','user:%s','find','userProfileId','handshake','query','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','WhatsappInteractions','admin','voice:outbound','hasOwnProperty','include','VoiceQueue','push','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','voice:inbound','SmsQueues','MailQueues','getVoiceQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','chat','fax','sms','mail','openchannel','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','removeChatInteractions','emit','user_has_chat_interactions:remove','map','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','leave','OpenchannelInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','connection','setMaxListeners','request','remoteAddress','remotePort','connectedAt','SocketIO\x20','nsp','address','DISCONNECTED'];(function(_0x2e1475,_0x5a60bb){var _0x55e9dc=function(_0x306aae){while(--_0x306aae){_0x2e1475['push'](_0x2e1475['shift']());}};_0x55e9dc(++_0x5a60bb);}(_0x9bdb,0x13c));var _0xb9bd=function(_0x2050ba,_0x51c315){_0x2050ba=_0x2050ba-0x0;var _0x555255=_0x9bdb[_0x2050ba];return _0x555255;};'use strict';var _=require(_0xb9bd('0x0'));var util=require(_0xb9bd('0x1'));var BPromise=require(_0xb9bd('0x2'));var db=require(_0xb9bd('0x3'))['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0xb9bd('0x4')],'include':[{'as':_0xb9bd('0x5'),'model':db[_0xb9bd('0x6')],'attributes':['id',_0xb9bd('0x4'),_0xb9bd('0x7')],'raw':!![],'where':{'role':_0xb9bd('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xb9bd('0x4')],'where':{'role':_0xb9bd('0x9')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0xb9bd('0x4')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0xb9bd('0xa')],'where':{'type':_0xb9bd('0xb')}};function getAssociatedResources(_0x4d82ae,_0x80df7f,_0x215174){return db[_0xb9bd('0xc')][_0xb9bd('0xd')]({'where':{'name':_0x4d82ae,'userProfileId':_0x80df7f},'raw':!![]})[_0xb9bd('0xe')](function(_0x4dc933){if(_0x4dc933){if(_0x4dc933['autoAssociation']){switch(_0x4d82ae){case _0xb9bd('0xf'):case _0xb9bd('0x10'):case _0xb9bd('0x11'):case'SmsQueues':case'MailQueues':case _0xb9bd('0x12'):case _0xb9bd('0x13'):return db[_0x215174]['findAll'](queryQueues);case _0xb9bd('0x14'):return db[_0x215174][_0xb9bd('0x15')](queryTelephones);case _0xb9bd('0x16'):return db[_0x215174]['findAll'](queryTrunks);case _0xb9bd('0x17'):return db[_0x215174][_0xb9bd('0x15')](queryCampaigns);}}else{return db[_0xb9bd('0x18')]['findAll']({'attributes':['resourceId'],'where':{'sectionId':_0x4dc933['id']},'raw':!![]})[_0xb9bd('0xe')](function(_0x590f87){if(_0x590f87){var _0x2bdeaf={'where':{'id':_['map'](_0x590f87,_0xb9bd('0x19'))},'raw':!![]};switch(_0x215174){case _0xb9bd('0x6'):_0x2bdeaf[_0xb9bd('0x1a')][_0xb9bd('0x7')]=_0xb9bd('0x9');break;case _0xb9bd('0x1b'):_0x2bdeaf[_0xb9bd('0x1a')][_0xb9bd('0xa')]=_0xb9bd('0xb');break;}return db[_0x215174][_0xb9bd('0x15')](_0x2bdeaf);}else{return[];}});}}else{return[];}})[_0xb9bd('0xe')](function(_0x499ba7){return _0x499ba7;});}function joinOrLeaveQueues(_0x48e7a5,_0x1b1103,_0x2be079,_0x3abcf9){_0x48e7a5[_0x1b1103](util[_0xb9bd('0x1c')](_0xb9bd('0x1d'),_0x2be079,_0x3abcf9['name']));if(_0x3abcf9[_0xb9bd('0x5')]){for(var _0x3657b5=0x0;_0x3657b5<_0x3abcf9[_0xb9bd('0x5')][_0xb9bd('0x1e')];_0x3657b5+=0x1){_0x48e7a5[_0x1b1103](util[_0xb9bd('0x1c')](_0xb9bd('0x1f'),_0x3abcf9[_0xb9bd('0x5')][_0x3657b5][_0xb9bd('0x4')]));}}}function joinOrLeave(_0x89d5fb,_0x4d2307,_0x2c8e16){var _0x5668f3;if(_0x89d5fb['handshake']['query']['id']){db['User'][_0xb9bd('0x20')]({'attributes':['id',_0xb9bd('0x4'),'role',_0xb9bd('0x21')],'where':{'id':_0x89d5fb[_0xb9bd('0x22')][_0xb9bd('0x23')]['id']},'include':[{'model':db[_0xb9bd('0x24')],'as':_0xb9bd('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0xb9bd('0x26')],'as':_0xb9bd('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0xb9bd('0x28')],'as':_0xb9bd('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0xb9bd('0x2a')],'as':_0xb9bd('0x2b'),'attributes':['id'],'raw':!![]},{'model':db[_0xb9bd('0x2c')],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0xb9bd('0x2d'),'attributes':['id'],'raw':!![]}]})[_0xb9bd('0xe')](function(_0x2eba92){if(_0x2eba92){_0x5668f3=_0x2eba92;_0x89d5fb[_0x4d2307](util[_0xb9bd('0x1c')](_0xb9bd('0x1f'),_0x2eba92[_0xb9bd('0x4')]));var _0x29cde6=[];switch(_0x2eba92[_0xb9bd('0x7')]){case _0xb9bd('0x2e'):_0x89d5fb[_0x4d2307]('voice:inbound');_0x89d5fb[_0x4d2307](_0xb9bd('0x2f'));if(queryQueues[_0xb9bd('0x30')](_0xb9bd('0x31'))){delete queryQueues[_0xb9bd('0x31')];}_0x29cde6['push'](db[_0xb9bd('0x32')]['findAll'](queryQueues));_0x29cde6[_0xb9bd('0x33')](db[_0xb9bd('0x34')][_0xb9bd('0x15')](queryQueues));_0x29cde6[_0xb9bd('0x33')](db[_0xb9bd('0x35')][_0xb9bd('0x15')](queryQueues));_0x29cde6[_0xb9bd('0x33')](db[_0xb9bd('0x36')][_0xb9bd('0x15')](queryQueues));_0x29cde6[_0xb9bd('0x33')](db[_0xb9bd('0x37')][_0xb9bd('0x15')](queryQueues));_0x29cde6[_0xb9bd('0x33')](db[_0xb9bd('0x38')]['findAll'](queryQueues));_0x29cde6['push'](db[_0xb9bd('0x39')]['findAll'](queryQueues));_0x29cde6['push'](db[_0xb9bd('0x6')][_0xb9bd('0x15')](queryTelephones));_0x29cde6[_0xb9bd('0x33')](db[_0xb9bd('0x3a')][_0xb9bd('0x15')](queryTrunks));_0x29cde6[_0xb9bd('0x33')](db[_0xb9bd('0x1b')][_0xb9bd('0x15')](queryCampaigns));_0x29cde6[_0xb9bd('0x33')](db[_0xb9bd('0x6')][_0xb9bd('0x15')](queryAgents));break;case'user':_0x89d5fb[_0x4d2307](_0xb9bd('0x3b'));_0x89d5fb[_0x4d2307](_0xb9bd('0x2f'));_0x29cde6[_0xb9bd('0x33')](getAssociatedResources(_0xb9bd('0xf'),_0x2eba92['userProfileId'],'VoiceQueue'));_0x29cde6[_0xb9bd('0x33')](getAssociatedResources(_0xb9bd('0x10'),_0x2eba92[_0xb9bd('0x21')],'ChatQueue'));_0x29cde6[_0xb9bd('0x33')](getAssociatedResources('FaxQueues',_0x2eba92[_0xb9bd('0x21')],_0xb9bd('0x35')));_0x29cde6[_0xb9bd('0x33')](getAssociatedResources(_0xb9bd('0x3c'),_0x2eba92[_0xb9bd('0x21')],_0xb9bd('0x36')));_0x29cde6['push'](getAssociatedResources(_0xb9bd('0x3d'),_0x2eba92[_0xb9bd('0x21')],_0xb9bd('0x37')));_0x29cde6[_0xb9bd('0x33')](getAssociatedResources(_0xb9bd('0x12'),_0x2eba92[_0xb9bd('0x21')],_0xb9bd('0x38')));_0x29cde6[_0xb9bd('0x33')](getAssociatedResources('WhatsappQueues',_0x2eba92[_0xb9bd('0x21')],_0xb9bd('0x39')));_0x29cde6[_0xb9bd('0x33')](getAssociatedResources('Telephones',_0x2eba92[_0xb9bd('0x21')],'User'));_0x29cde6[_0xb9bd('0x33')](getAssociatedResources(_0xb9bd('0x16'),_0x2eba92[_0xb9bd('0x21')],_0xb9bd('0x3a')));_0x29cde6['push'](getAssociatedResources(_0xb9bd('0x17'),_0x2eba92[_0xb9bd('0x21')],_0xb9bd('0x1b')));_0x29cde6[_0xb9bd('0x33')](db['User'][_0xb9bd('0x15')](queryAgents));break;case'agent':_0x89d5fb[_0x4d2307](_0xb9bd('0x3b'));_0x89d5fb[_0x4d2307](_0xb9bd('0x2f'));_0x29cde6[_0xb9bd('0x33')](_0x2eba92[_0xb9bd('0x3e')]({'attributes':['id','name']}));_0x29cde6[_0xb9bd('0x33')](_0x2eba92['getChatQueues']({'attributes':['id','name']}));_0x29cde6[_0xb9bd('0x33')](_0x2eba92['getFaxQueues']({'attributes':['id',_0xb9bd('0x4')]}));_0x29cde6['push'](_0x2eba92[_0xb9bd('0x3f')]({'attributes':['id',_0xb9bd('0x4')]}));_0x29cde6['push'](_0x2eba92[_0xb9bd('0x40')]({'attributes':['id',_0xb9bd('0x4')]}));_0x29cde6[_0xb9bd('0x33')](_0x2eba92[_0xb9bd('0x41')]({'attributes':['id','name']}));_0x29cde6[_0xb9bd('0x33')](_0x2eba92[_0xb9bd('0x42')]({'attributes':['id',_0xb9bd('0x4')]}));break;}return BPromise[_0xb9bd('0x43')](_0x29cde6);}})[_0xb9bd('0xe')](function(_0x171dc5){if(_0x171dc5&&_0x171dc5['length']){for(var _0x65d0e4=0x0;_0x65d0e4<_0x171dc5[_0xb9bd('0x1e')];_0x65d0e4+=0x1){for(var _0x1b883e=0x0;_0x1b883e<_0x171dc5[_0x65d0e4][_0xb9bd('0x1e')];_0x1b883e+=0x1){switch(_0x65d0e4){case 0x0:joinOrLeaveQueues(_0x89d5fb,_0x4d2307,'voice',_0x171dc5[_0x65d0e4][_0x1b883e]);break;case 0x1:joinOrLeaveQueues(_0x89d5fb,_0x4d2307,_0xb9bd('0x44'),_0x171dc5[_0x65d0e4][_0x1b883e]);break;case 0x2:joinOrLeaveQueues(_0x89d5fb,_0x4d2307,_0xb9bd('0x45'),_0x171dc5[_0x65d0e4][_0x1b883e]);break;case 0x3:joinOrLeaveQueues(_0x89d5fb,_0x4d2307,_0xb9bd('0x46'),_0x171dc5[_0x65d0e4][_0x1b883e]);break;case 0x4:joinOrLeaveQueues(_0x89d5fb,_0x4d2307,_0xb9bd('0x47'),_0x171dc5[_0x65d0e4][_0x1b883e]);break;case 0x5:joinOrLeaveQueues(_0x89d5fb,_0x4d2307,_0xb9bd('0x48'),_0x171dc5[_0x65d0e4][_0x1b883e]);break;case 0x6:joinOrLeaveQueues(_0x89d5fb,_0x4d2307,_0xb9bd('0x49'),_0x171dc5[_0x65d0e4][_0x1b883e]);break;case 0x7:if(_0x5668f3[_0xb9bd('0x7')]!==_0xb9bd('0x8'))_0x89d5fb[_0x4d2307](util[_0xb9bd('0x1c')](_0xb9bd('0x4a'),_0x171dc5[_0x65d0e4][_0x1b883e][_0xb9bd('0x4')]));break;case 0x8:if(_0x5668f3[_0xb9bd('0x7')]!==_0xb9bd('0x8'))_0x89d5fb[_0x4d2307](util['format'](_0xb9bd('0x4b'),_0x171dc5[_0x65d0e4][_0x1b883e]['name']));break;case 0x9:if(_0x5668f3[_0xb9bd('0x7')]!=='agent')_0x89d5fb[_0x4d2307](util[_0xb9bd('0x1c')](_0xb9bd('0x4c'),_0x171dc5[_0x65d0e4][_0x1b883e][_0xb9bd('0xa')],_0x171dc5[_0x65d0e4][_0x1b883e]['name']));break;case 0xa:_0x89d5fb[_0x4d2307](util[_0xb9bd('0x1c')]('user:%s',_0x171dc5[_0x65d0e4][_0x1b883e][_0xb9bd('0x4')]));break;}}}}})[_0xb9bd('0xe')](function(){if(_0x4d2307==='leave'){var _0x49797f=_['map'](_0x5668f3[_0xb9bd('0x25')],'id');return _0x5668f3[_0xb9bd('0x4d')](_0x49797f)[_0xb9bd('0xe')](function(){for(var _0x26c2b2=0x0;_0x26c2b2<_0x49797f['length'];_0x26c2b2+=0x1){_0x2c8e16[_0xb9bd('0x4e')](_0xb9bd('0x4f'),{'ChatInteractionId':Number(_0x49797f[_0x26c2b2]),'UserId':Number(_0x5668f3['id'])});}});}})[_0xb9bd('0xe')](function(){if(_0x4d2307==='leave'){var _0x179508=_[_0xb9bd('0x50')](_0x5668f3['MailInteractions'],'id');return _0x5668f3[_0xb9bd('0x51')](_0x179508)[_0xb9bd('0xe')](function(){for(var _0x583a34=0x0;_0x583a34<_0x179508['length'];_0x583a34+=0x1){_0x2c8e16['emit'](_0xb9bd('0x52'),{'MailInteractionId':Number(_0x179508[_0x583a34]),'UserId':Number(_0x5668f3['id'])});}});}})[_0xb9bd('0xe')](function(){if(_0x4d2307==='leave'){var _0x2ed406=_[_0xb9bd('0x50')](_0x5668f3[_0xb9bd('0x29')],'id');return _0x5668f3[_0xb9bd('0x53')](_0x2ed406)[_0xb9bd('0xe')](function(){for(var _0x557f3d=0x0;_0x557f3d<_0x2ed406['length'];_0x557f3d+=0x1){_0x2c8e16[_0xb9bd('0x4e')](_0xb9bd('0x54'),{'FaxInteractionId':Number(_0x2ed406[_0x557f3d]),'UserId':Number(_0x5668f3['id'])});}});}})[_0xb9bd('0xe')](function(){if(_0x4d2307===_0xb9bd('0x55')){var _0x550533=_['map'](_0x5668f3[_0xb9bd('0x2b')],'id');return _0x5668f3['removeSmsInteractions'](_0x550533)[_0xb9bd('0xe')](function(){for(var _0x1282a3=0x0;_0x1282a3<_0x550533['length'];_0x1282a3+=0x1){_0x2c8e16['emit']('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x550533[_0x1282a3]),'UserId':Number(_0x5668f3['id'])});}});}})[_0xb9bd('0xe')](function(){if(_0x4d2307===_0xb9bd('0x55')){var _0x5925ac=_['map'](_0x5668f3[_0xb9bd('0x56')],'id');return _0x5668f3[_0xb9bd('0x57')](_0x5925ac)[_0xb9bd('0xe')](function(){for(var _0x1dd45b=0x0;_0x1dd45b<_0x5925ac[_0xb9bd('0x1e')];_0x1dd45b+=0x1){_0x2c8e16['emit']('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x5925ac[_0x1dd45b]),'UserId':Number(_0x5668f3['id'])});}});}})[_0xb9bd('0xe')](function(){if(_0x4d2307==='leave'){var _0x20526e=_[_0xb9bd('0x50')](_0x5668f3[_0xb9bd('0x2d')],'id');return _0x5668f3[_0xb9bd('0x58')](_0x20526e)['then'](function(){for(var _0x12f8f2=0x0;_0x12f8f2<_0x20526e[_0xb9bd('0x1e')];_0x12f8f2+=0x1){_0x2c8e16['emit'](_0xb9bd('0x59'),{'WhatsappInteractionId':Number(_0x20526e[_0x12f8f2]),'UserId':Number(_0x5668f3['id'])});}});}})[_0xb9bd('0x5a')](function(_0x195c7e){_0x89d5fb[_0xb9bd('0x5b')](_0x195c7e);});}}function onDisconnect(_0xbf82d6,_0x4e66d5){joinOrLeave(_0xbf82d6,'leave',_0x4e66d5);}function onConnect(_0x248b8b){joinOrLeave(_0x248b8b,_0xb9bd('0x5c'));}exports[_0xb9bd('0x5d')]=function(_0x39689f){_0x39689f['on'](_0xb9bd('0x5e'),function(_0x4a0898){_0x4a0898[_0xb9bd('0x5f')](0x0);_0x4a0898['address']=_0x4a0898[_0xb9bd('0x60')]['connection'][_0xb9bd('0x61')]+':'+_0x4a0898[_0xb9bd('0x60')][_0xb9bd('0x5e')][_0xb9bd('0x62')];_0x4a0898[_0xb9bd('0x63')]=new Date();_0x4a0898[_0xb9bd('0x5b')]=function(_0x4878f6){console[_0xb9bd('0x5b')](_0xb9bd('0x64')+_0x4a0898[_0xb9bd('0x65')][_0xb9bd('0x4')]+'['+_0x4a0898[_0xb9bd('0x66')]+']',_0x4878f6);};_0x4a0898['on']('disconnect',function(){onDisconnect(_0x4a0898,_0x39689f);_0x4a0898[_0xb9bd('0x5b')](_0xb9bd('0x67'));});onConnect(_0x4a0898);_0x4a0898[_0xb9bd('0x5b')](_0xb9bd('0x68'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 90aa01d..6cf73e4 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 _0x72b6=['fullname','email','internal','then','interface','format','SIP/%s','agent','incomingmessage','outgoingmessage','opened','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','closed','ContactId','default','length','model','hook','callback','toLowerCase','condition','util','../../mysqldb','jayson/promise','lodash','client','http','ChatInteraction','afterCreate','newinteraction','Chat','afterUpdate','ChatMessage','newmessage','SmsInteraction','Sms','SmsMessage','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','closedinteraction','FaxMessage','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','request','EventManager','Trigger,\x20%s','error','code','catch','get','channel','event','sequelize','query','Sequelize','QueryTypes','SELECT','contact','UserId','find','name'];(function(_0x2224d6,_0xfdeaa){var _0x7b7275=function(_0x4fc42a){while(--_0x4fc42a){_0x2224d6['push'](_0x2224d6['shift']());}};_0x7b7275(++_0xfdeaa);}(_0x72b6,0x121));var _0x672b=function(_0x59b54f,_0x28dac7){_0x59b54f=_0x59b54f-0x0;var _0x8c0029=_0x72b6[_0x59b54f];return _0x8c0029;};'use strict';var util=require(_0x672b('0x0'));var db=require(_0x672b('0x1'))['db'];var jayson=require(_0x672b('0x2'));var logger=require('../logger')('triggers');var _=require(_0x672b('0x3'));var client=jayson[_0x672b('0x4')][_0x672b('0x5')]({'port':0x232a});var triggers=[{'channel':'Chat','model':_0x672b('0x6'),'event':_0x672b('0x7'),'condition':_0x672b('0x8'),'callback':afterCreate},{'channel':_0x672b('0x9'),'model':_0x672b('0x6'),'event':_0x672b('0xa'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x672b('0x9'),'model':_0x672b('0xb'),'event':_0x672b('0x7'),'condition':_0x672b('0xc'),'callback':afterCreateMessage},{'channel':'Sms','model':_0x672b('0xd'),'event':_0x672b('0x7'),'condition':_0x672b('0x8'),'callback':afterCreate},{'channel':_0x672b('0xe'),'model':_0x672b('0xd'),'event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':_0x672b('0xe'),'model':_0x672b('0xf'),'event':_0x672b('0x7'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x672b('0x10'),'model':_0x672b('0x11'),'event':_0x672b('0x7'),'condition':_0x672b('0x8'),'callback':afterCreate},{'channel':'Whatsapp','model':_0x672b('0x11'),'event':_0x672b('0xa'),'condition':'closedinteraction','callback':afterUpdate},{'channel':'Whatsapp','model':_0x672b('0x12'),'event':_0x672b('0x7'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x672b('0x13'),'model':_0x672b('0x14'),'event':_0x672b('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':'Fax','model':_0x672b('0x14'),'event':'afterUpdate','condition':_0x672b('0x15'),'callback':afterUpdate},{'channel':'Fax','model':_0x672b('0x16'),'event':_0x672b('0x7'),'condition':_0x672b('0xc'),'callback':afterCreateMessage},{'channel':_0x672b('0x17'),'model':_0x672b('0x18'),'event':_0x672b('0x7'),'condition':_0x672b('0x8'),'callback':afterCreate},{'channel':_0x672b('0x17'),'model':_0x672b('0x18'),'event':_0x672b('0xa'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x672b('0x17'),'model':_0x672b('0x19'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0x672b('0x1a'),'model':_0x672b('0x1b'),'event':_0x672b('0x7'),'condition':_0x672b('0x8'),'callback':afterCreate},{'channel':_0x672b('0x1a'),'model':_0x672b('0x1b'),'event':_0x672b('0xa'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x672b('0x1a'),'model':'OpenchannelMessage','event':_0x672b('0x7'),'condition':_0x672b('0xc'),'callback':afterCreateMessage}];function request(_0x373c56){return client[_0x672b('0x1c')](_0x672b('0x1d'),_0x373c56)['then'](function(_0x1a4569){logger['info'](_0x672b('0x1e'),_0x672b('0x1d'),_0x1a4569);if(_0x1a4569['error']){if(_0x1a4569[_0x672b('0x1f')][_0x672b('0x20')]===0x1f4){logger[_0x672b('0x1f')](_0x672b('0x1e'),_0x672b('0x1d'),_0x1a4569[_0x672b('0x1f')]);}}})[_0x672b('0x21')](function(_0x407b7c){logger['error'](_0x672b('0x1e'),_0x672b('0x1d'),_0x407b7c);});}function afterCreateMessage(_0x268ec7,_0x2471a3){return function(_0x58cb11,_0x56533a){_0x58cb11=_0x58cb11[_0x672b('0x22')]({'plain':!![]});_0x58cb11[_0x672b('0x23')]=_0x268ec7;_0x58cb11[_0x672b('0x24')]=_0x58cb11['direction'];var _0x48deba='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x58cb11['ContactId'];return db[_0x672b('0x25')][_0x672b('0x26')](_0x48deba,{'type':db[_0x672b('0x27')][_0x672b('0x28')][_0x672b('0x29')],'raw':!![]})['then'](function(_0x5a9d89){return _0x5a9d89;})['then'](function(_0x38c4d7){if(_0x38c4d7){_0x58cb11[_0x672b('0x2a')]=_0x38c4d7[0x0];}if(_0x58cb11[_0x672b('0x2b')]){return db['User'][_0x672b('0x2c')]({'where':{'id':_0x58cb11[_0x672b('0x2b')]},'attributes':['id',_0x672b('0x2d'),_0x672b('0x2e'),_0x672b('0x2f'),_0x672b('0x30')],'raw':!![]})[_0x672b('0x31')](function(_0x57ad5e){_0x58cb11[_0x672b('0x32')]=util[_0x672b('0x33')](_0x672b('0x34'),_0x57ad5e[_0x672b('0x2d')]);_0x58cb11[_0x672b('0x23')]=_0x268ec7;_0x58cb11[_0x672b('0x35')]=_0x57ad5e;return request({'event':_0x672b('0x36'),'message':_0x58cb11});})[_0x672b('0x21')](function(_0x554fef){console[_0x672b('0x1f')](_0x554fef);});}else{return request({'event':_0x672b('0x37'),'message':_0x58cb11});}});};}function afterCreate(_0x116551,_0x30c97d){return function(_0x4152a6,_0x11af31){_0x4152a6=_0x4152a6[_0x672b('0x22')]({'plain':!![]});_0x4152a6['channel']=_0x116551;_0x4152a6[_0x672b('0x24')]=_0x672b('0x38');var _0x237dac=_0x672b('0x39')+_0x4152a6['ContactId'];return db['sequelize'][_0x672b('0x26')](_0x237dac,{'type':db[_0x672b('0x27')]['QueryTypes'][_0x672b('0x29')],'raw':!![]})[_0x672b('0x31')](function(_0x13f4b0){return _0x13f4b0;})[_0x672b('0x31')](function(_0x5a31bb){if(_0x5a31bb){_0x4152a6[_0x672b('0x2a')]=_0x5a31bb[0x0];}return request({'event':_0x30c97d,'message':_0x4152a6});});};}function afterUpdate(_0x199f21,_0xa662e5){return function(_0x295141,_0x35792b){if(_0x295141['changed'](_0x672b('0x3a'))&&_0x295141[_0x672b('0x3a')]){_0x295141=_0x295141[_0x672b('0x22')]({'plain':!![]});_0x295141['channel']=_0x199f21;_0x295141['event']=_0x672b('0x3a');var _0x19ce1a=_0x672b('0x39')+_0x295141[_0x672b('0x3b')];return db[_0x672b('0x25')][_0x672b('0x26')](_0x19ce1a,{'type':db['Sequelize']['QueryTypes'][_0x672b('0x29')],'raw':!![]})['then'](function(_0x2c2889){return _0x2c2889;})[_0x672b('0x31')](function(_0x5bd537){if(_0x5bd537){_0x295141[_0x672b('0x2a')]=_0x5bd537[0x0];}if(_0x295141[_0x672b('0x2b')]){return db['User'][_0x672b('0x2c')]({'where':{'id':_0x295141[_0x672b('0x2b')]},'attributes':['id',_0x672b('0x2d'),_0x672b('0x2e'),_0x672b('0x2f'),_0x672b('0x30')],'raw':!![]})[_0x672b('0x31')](function(_0x1c5c49){_0x295141[_0x672b('0x32')]=util[_0x672b('0x33')](_0x672b('0x34'),_0x1c5c49['name']);_0x295141[_0x672b('0x35')]=_0x1c5c49;return request({'event':_0xa662e5,'message':_0x295141});})[_0x672b('0x21')](function(_0x478234){console[_0x672b('0x1f')](_0x478234);});}else{return request({'event':_0xa662e5,'message':_0x295141});}});}};}exports[_0x672b('0x3c')]=function(){for(var _0x3e095b=0x0;_0x3e095b=_0x22f9a3['agents']){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x9cf01e(_0x1fb424);})[_0x9af9('0x14')](function(_0x19bb66){_0x1539f4(_0x19bb66);});});}; \ No newline at end of file +var _0x2ebe=['clearBlockUser','blockedAt','updateAttributes','getLicense','agent','count','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','bluebird','../mysqldb','./license/util','voice','chat','fax','sms','whatsapp','openchannel','toLowerCase','includes'];(function(_0x38c6ff,_0x335b7b){var _0x25cd90=function(_0x7a02e1){while(--_0x7a02e1){_0x38c6ff['push'](_0x38c6ff['shift']());}};_0x25cd90(++_0x335b7b);}(_0x2ebe,0x1ae));var _0xe2eb=function(_0x1a6dc9,_0x3687e3){_0x1a6dc9=_0x1a6dc9-0x0;var _0x1d94a1=_0x2ebe[_0x1a6dc9];return _0x1d94a1;};'use strict';var _=require('lodash');var BPromise=require(_0xe2eb('0x0'));var db=require(_0xe2eb('0x1'))['db'];var util=require(_0xe2eb('0x2'));var channels=[_0xe2eb('0x3'),'mail',_0xe2eb('0x4'),_0xe2eb('0x5'),_0xe2eb('0x6'),_0xe2eb('0x7'),_0xe2eb('0x8')];exports['getChannels']=function(){return channels;};exports['isValidChannel']=function(_0x5f9f10){_0x5f9f10=_0x5f9f10[_0xe2eb('0x9')]();return _[_0xe2eb('0xa')](channels,_0x5f9f10);};exports[_0xe2eb('0xb')]=function(_0x28ebe9,_0x2a36a0,_0x258782,_0x5ca559){var _0x2159d9={'loginAttempts':_0x2a36a0,'blocked':_0x258782};if(!_['isUndefined'](_0x5ca559)){_0x2159d9[_0xe2eb('0xc')]=_0x5ca559;}return _0x28ebe9[_0xe2eb('0xd')](_0x2159d9);};exports[_0xe2eb('0xe')]=function(_0x5d6df8){return new BPromise(function(_0x4bed98,_0x346914){var _0x451daf=0x0;if(_0x5d6df8['role']!==_0xe2eb('0xf')){_0x4bed98(_0x5d6df8);}db['User'][_0xe2eb('0x10')]({'where':{'role':_0xe2eb('0xf'),'online':!![],'id':{'$ne':_0x5d6df8['id']}}})[_0xe2eb('0x11')](function(_0x1ff6ca){_0x451daf=_0x1ff6ca;return util[_0xe2eb('0xe')]();})[_0xe2eb('0x11')](function(_0x4ccaf1){if(_0x4ccaf1&&_0x4ccaf1[_0xe2eb('0x12')]&&_0x451daf>=_0x4ccaf1[_0xe2eb('0x12')]){throw Error(_0xe2eb('0x13'));}_0x4bed98(_0x5d6df8);})[_0xe2eb('0x14')](function(_0x57ea13){_0x346914(_0x57ea13);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index eb8c614..7325b3a 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1b3c=['status','render','json','send','exports','404'];(function(_0x423097,_0x8a09f4){var _0x3a73f1=function(_0x9314f0){while(--_0x9314f0){_0x423097['push'](_0x423097['shift']());}};_0x3a73f1(++_0x8a09f4);}(_0x1b3c,0x1ea));var _0xc1b3=function(_0x2b62aa,_0x537d34){_0x2b62aa=_0x2b62aa-0x0;var _0x46172e=_0x1b3c[_0x2b62aa];return _0x46172e;};'use strict';module[_0xc1b3('0x0')][0x194]=function pageNotFound(_0x408203,_0x57ad89){var _0xf15e9f=_0xc1b3('0x1');var _0x1667bc=0x194;var _0x2fb2d3={'status':_0x1667bc};_0x57ad89[_0xc1b3('0x2')](_0x2fb2d3[_0xc1b3('0x2')]);_0x57ad89[_0xc1b3('0x3')](_0xf15e9f,{},function(_0x62b563,_0x28d377){if(_0x62b563){return _0x57ad89[_0xc1b3('0x2')](_0x2fb2d3[_0xc1b3('0x2')])[_0xc1b3('0x4')](_0x2fb2d3);}_0x57ad89[_0xc1b3('0x5')](_0x28d377);});}; \ No newline at end of file +var _0x8daa=['json','send','exports','status','render'];(function(_0x21cdc2,_0x56a721){var _0x538a6d=function(_0x3a73bb){while(--_0x3a73bb){_0x21cdc2['push'](_0x21cdc2['shift']());}};_0x538a6d(++_0x56a721);}(_0x8daa,0x179));var _0xa8da=function(_0xcfd89f,_0x106e8f){_0xcfd89f=_0xcfd89f-0x0;var _0x59acd4=_0x8daa[_0xcfd89f];return _0x59acd4;};'use strict';module[_0xa8da('0x0')][0x194]=function pageNotFound(_0x184559,_0x2bae0d){var _0x19f221='404';var _0x321d9f=0x194;var _0x4e192b={'status':_0x321d9f};_0x2bae0d[_0xa8da('0x1')](_0x4e192b[_0xa8da('0x1')]);_0x2bae0d[_0xa8da('0x2')](_0x19f221,{},function(_0x451591,_0x3279f1){if(_0x451591){return _0x2bae0d['status'](_0x4e192b[_0xa8da('0x1')])[_0xa8da('0x3')](_0x4e192b);}_0x2bae0d[_0xa8da('0x4')](_0x3279f1);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index ecff73e..248b2d8 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x749a=['OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','user_has_openchannel_interactions','team_has_openchannel_queues','ProactiveActions','Agent','Queue','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','ChatMessage','team_has_chat_queues','CompanyId','Phones','CmContactId','cm_contact_has_tags','CmHopperAdditionalPhone','AdditionalPhones','CmHopperId','OwnerId','CampaignId','All','OneAll','AutomationAllId','Condition','Any','OneAny','AutomationAnyId','AutomationId','ParentId','ChatApplications','FaxApplications','SmsApplications','CustomReportId','Mohs','whatsapp_interaction_has_tags','ItemType','ItemTypeId','Hopper','AllConditions','AllCondition','TriggerAllId','AnyConditions','TriggerAnyId','Actions','TriggerId','Fields','DefaultReportId','MetricId','SalesforceConfiguration','Configurations','Subjects','SubjectId','Descriptions','DescriptionId','AccountId','Subject','Description','Field','FieldId','Variable','VariableId','DeskConfiguration','int_desk_configuration_has_tags','ZohoAccount','ZohoField','int_freshdesk_configuration_has_tags','VtigerAccount','ServicenowAccount','Dynamics365Configuration','Dynamics365Field','SessionId','JscriptyProject','ProjectId','VoiceQueues','team_has_whatsapp_queues','TrunkBackupId','SquareProjectId','Lists','campaigns_has_cm_lists','campaigns_has_cm_blacklists','ChatOfflineMessageId','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToQueue','FromChatWebsiteId','ToChatQueueId','ToChatWebsiteId','ToAccount','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','SmsTransferReport','FromSmsAccountId','ToSmsAccountId','HopperHistory','Queues','UserProfileSections','UserProfileSection','Resources','WhatsappAccountId','WhatsappMessage','WhatsappInteractionId','FromWhatsappAccountId','WhatsappQueueId','exports','path','../config/environment','sequelize','lodash','jstz','determine','defaultsDeep','motion2','xC@LL1234','mysql','name','utf8_general_ci','sequelizeHistory','xcall','127.0.0.1','utf8mb4','utf8','database','password','options','username','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','UserChatQueue','../api/userChatQueue/userChatQueue.model','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','../api/mailServerIn/mailServerIn.model','MailServerOut','MailAccount','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','DashboardItem','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','../api/smsMessage/smsMessage.model','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','../api/chatApplication/chatApplication.model','../api/chatInteraction/chatInteraction.model','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','CmCompany','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','CannedAnswer','../api/disposition/disposition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','Sound','../api/sound/sound.model','Tag','ContactItemType','CmContactHasItem','../api/cmContactHasItem/cmContactHasItem.model','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Trigger','../api/trigger/trigger.model','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','../api/intDynamics365Configuration/intDynamics365Configuration.model','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','SquareReport','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','../api/team/team.model','Campaign','Migration','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','CmList','../api/cmList/cmList.model','../api/voicePrefix/voicePrefix.model','UserProfile','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','WhatsappInteraction','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','Realtime','../api/realtime/realtime.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','User','hasOne','VoiceMail','UserId','hasMany','Recordings','VoiceExtension','Extensions','cascade','HopperFinals','OpenchannelInteractions','ChatInteraction','ChatInteractions','FaxInteractions','UserNotifications','SenderId','belongsTo','userProfileId','belongsToMany','Groups','chat_group_has_users','Contacts','cm_user_has_contacts','Team','user_has_teams','MailInteractions','user_has_mail_interactions','user_has_fax_interactions','SmsInteractions','user_has_sms_interactions','WhatsappInteractions','user_has_whatsapp_interactions','MailQueues','UserMailQueue','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueues','WhatsappQueues','cm_user_has_lists','VoicePrefix','VoicePrefixes','user_has_voice_prefixes','ChatWebsites','user_has_chat_websites','MailAccounts','user_has_mail_accounts','user_has_openchannel_accounts','SmsAccounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects','user_has_square_projects','Applications','Sounds','Hoppers','VoiceQueueId','CmHopperFinal','HopperHistories','HopperBlacks','JscriptySessions','TrunkId','TrunkBackup','IntervalId','mandatoryDispositionPause','voice_queues_has_cm_lists','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','VoiceCallReport','uniqueid','VoiceAgentReport','AgentReports','Contact','ContactId','MailServerIn','MailAccountId','Imap','Smtp','Disposition','Dispositions','Interactions','List','ListId','Template','TemplateId','mandatoryDispositionPauseId','Agents','MailInteractionId','Owner','mail_interaction_has_tags','ThroughTags','Attachments','Interaction','Account','ChatWebsiteId','restrict','TagId','Answers','FaxAccountId','Exntensions','FaxMessage','user_has_fax_accounts','FaxInteractionId','fax_interaction_has_tags','Tags','Users','AttachmentId','team_has_fax_queues','FaxQueueReport','SmsAccountId','SmsMessage','SmsQueue','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues'];(function(_0x3684b4,_0x3d15f5){var _0x117abd=function(_0x5c8814){while(--_0x5c8814){_0x3684b4['push'](_0x3684b4['shift']());}};_0x117abd(++_0x3d15f5);}(_0x749a,0x73));var _0xa749=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x749a[_0x20a584];return _0x4b41a8;};'use strict';var path=require(_0xa749('0x0'));var config=require(_0xa749('0x1'));var Sequelize=require(_0xa749('0x2'));var _=require(_0xa749('0x3'));var jstz=require(_0xa749('0x4'));var timezone=jstz[_0xa749('0x5')]();config[_0xa749('0x2')]=_[_0xa749('0x6')](config['sequelize'],{'database':_0xa749('0x7'),'username':'xcall','password':_0xa749('0x8'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0xa749('0x9'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0xa749('0xa')](),'define':{'charset':'utf8','collate':_0xa749('0xb')}}});config['sequelizeHistory']=_[_0xa749('0x6')](config[_0xa749('0xc')],{'database':_0xa749('0x7'),'username':_0xa749('0xd'),'password':_0xa749('0x8'),'options':{'host':_0xa749('0xe'),'port':0xcea,'dialect':_0xa749('0x9'),'dialectOptions':{'charset':_0xa749('0xf')},'logging':![],'timezone':timezone[_0xa749('0xa')](),'define':{'charset':_0xa749('0x10'),'collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xa749('0x2')][_0xa749('0x11')],config[_0xa749('0x2')]['username'],config[_0xa749('0x2')][_0xa749('0x12')],config[_0xa749('0x2')][_0xa749('0x13')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xa749('0xc')][_0xa749('0x11')],config[_0xa749('0xc')][_0xa749('0x14')],config['sequelizeHistory']['password'],config['sequelizeHistory']['options'])};db['User']=db[_0xa749('0x2')][_0xa749('0x15')]('../api/user/user.model');db[_0xa749('0x16')]=db['sequelize'][_0xa749('0x15')](_0xa749('0x17'));db[_0xa749('0x18')]=db[_0xa749('0x2')][_0xa749('0x15')]('../api/voiceContext/voiceContext.model');db['VoiceExtension']=db[_0xa749('0x2')][_0xa749('0x15')]('../api/voiceExtension/voiceExtension.model');db[_0xa749('0x19')]=db[_0xa749('0x2')]['import'](_0xa749('0x1a'));db[_0xa749('0x1b')]=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0x1c'));db[_0xa749('0x1d')]=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0x1e'));db[_0xa749('0x1f')]=db[_0xa749('0x2')]['import']('../api/screenRecording/screenRecording.model');db['VoiceMail']=db[_0xa749('0x2')]['import']('../api/voiceMail/voiceMail.model');db[_0xa749('0x20')]=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0x21'));db['VoiceCallReport']=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0x22'));db[_0xa749('0x23')]=db[_0xa749('0x2')]['import']('../api/voiceDialReport/voiceDialReport.model');db['VoiceAgentReport']=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0x24'));db[_0xa749('0x25')]=db['sequelize']['import'](_0xa749('0x26'));db['MemberReport']=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0x27'));db[_0xa749('0x28')]=db[_0xa749('0x2')]['import'](_0xa749('0x29'));db[_0xa749('0x2a')]=db['sequelize'][_0xa749('0x15')](_0xa749('0x2b'));db[_0xa749('0x2c')]=db['sequelize'][_0xa749('0x15')](_0xa749('0x2d'));db[_0xa749('0x2e')]=db[_0xa749('0x2')]['import']('../api/userVoiceQueue/userVoiceQueue.model');db[_0xa749('0x2f')]=db['sequelize'][_0xa749('0x15')](_0xa749('0x30'));db['UserMailQueue']=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0x31'));db[_0xa749('0x32')]=db['sequelize']['import'](_0xa749('0x33'));db[_0xa749('0x34')]=db['sequelize'][_0xa749('0x15')](_0xa749('0x35'));db[_0xa749('0x36')]=db[_0xa749('0x2')]['import'](_0xa749('0x37'));db[_0xa749('0x38')]=db['sequelize'][_0xa749('0x15')](_0xa749('0x39'));db['MailServerIn']=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0x3a'));db[_0xa749('0x3b')]=db[_0xa749('0x2')][_0xa749('0x15')]('../api/mailServerOut/mailServerOut.model');db[_0xa749('0x3c')]=db[_0xa749('0x2')][_0xa749('0x15')]('../api/mailAccount/mailAccount.model');db[_0xa749('0x3d')]=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0x3e'));db[_0xa749('0x3f')]=db['sequelize'][_0xa749('0x15')]('../api/mailSubstatus/mailSubstatus.model');db[_0xa749('0x40')]=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0x41'));db[_0xa749('0x42')]=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0x43'));db[_0xa749('0x44')]=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0x45'));db[_0xa749('0x46')]=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0x47'));db[_0xa749('0x48')]=db[_0xa749('0x2')][_0xa749('0x15')]('../api/dashboard/dashboard.model');db[_0xa749('0x49')]=db[_0xa749('0x2')][_0xa749('0x15')]('../api/dashboardItem/dashboardItem.model');db[_0xa749('0x4a')]=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0x4b'));db[_0xa749('0x4c')]=db['sequelize'][_0xa749('0x15')](_0xa749('0x4d'));db[_0xa749('0x4e')]=db['sequelize']['import'](_0xa749('0x4f'));db['FaxMessage']=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0x50'));db[_0xa749('0x51')]=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0x52'));db['FaxQueueReport']=db[_0xa749('0x2')]['import'](_0xa749('0x53'));db[_0xa749('0x54')]=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0x55'));db[_0xa749('0x56')]=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0x57'));db[_0xa749('0x58')]=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0x59'));db['SmsMessage']=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0x5a'));db['SmsQueue']=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0x5b'));db[_0xa749('0x5c')]=db['sequelize'][_0xa749('0x15')](_0xa749('0x5d'));db[_0xa749('0x5e')]=db[_0xa749('0x2')][_0xa749('0x15')]('../api/openchannelApplication/openchannelApplication.model');db[_0xa749('0x5f')]=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0x60'));db[_0xa749('0x61')]=db[_0xa749('0x2')][_0xa749('0x15')]('../api/openchannelMessage/openchannelMessage.model');db[_0xa749('0x62')]=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0x63'));db[_0xa749('0x64')]=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0x65'));db[_0xa749('0x66')]=db['sequelize'][_0xa749('0x15')]('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0xa749('0x67')]=db['sequelize']['import'](_0xa749('0x68'));db['ChatInteraction']=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0x69'));db['ChatMessage']=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0x6a'));db[_0xa749('0x6b')]=db[_0xa749('0x2')]['import'](_0xa749('0x6c'));db[_0xa749('0x6d')]=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0x6e'));db[_0xa749('0x6f')]=db[_0xa749('0x2')]['import'](_0xa749('0x70'));db[_0xa749('0x71')]=db['sequelize'][_0xa749('0x15')]('../api/chatProactiveAction/chatProactiveAction.model');db[_0xa749('0x72')]=db['sequelize'][_0xa749('0x15')]('../api/cmCompany/cmCompany.model');db[_0xa749('0x73')]=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0x74'));db[_0xa749('0x75')]=db[_0xa749('0x2')]['import'](_0xa749('0x76'));db[_0xa749('0x77')]=db['sequelize'][_0xa749('0x15')](_0xa749('0x78'));db['CmHopperFinal']=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0x79'));db[_0xa749('0x7a')]=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0x7b'));db[_0xa749('0x7c')]=db[_0xa749('0x2')][_0xa749('0x15')]('../api/reportAgentPreview/reportAgentPreview.model');db[_0xa749('0x7d')]=db['sequelize'][_0xa749('0x15')](_0xa749('0x7e'));db[_0xa749('0x7f')]=db['sequelize'][_0xa749('0x15')](_0xa749('0x80'));db[_0xa749('0x81')]=db[_0xa749('0x2')]['import']('../api/automation/automation.model');db[_0xa749('0x82')]=db[_0xa749('0x2')]['import']('../api/cannedAnswer/cannedAnswer.model');db['Disposition']=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0x83'));db['Condition']=db['sequelize'][_0xa749('0x15')]('../api/condition/condition.model');db[_0xa749('0x84')]=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0x85'));db[_0xa749('0x86')]=db['sequelize'][_0xa749('0x15')](_0xa749('0x87'));db[_0xa749('0x88')]=db['sequelize'][_0xa749('0x15')](_0xa749('0x89'));db[_0xa749('0x8a')]=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0x8b'));db[_0xa749('0x8c')]=db[_0xa749('0x2')][_0xa749('0x15')]('../api/schedule/schedule.model');db[_0xa749('0x8d')]=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0x8e'));db[_0xa749('0x8f')]=db['sequelize'][_0xa749('0x15')]('../api/tag/tag.model');db[_0xa749('0x90')]=db[_0xa749('0x2')][_0xa749('0x15')]('../api/contactItemType/contactItemType.model');db[_0xa749('0x91')]=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0x92'));db['CmHopperAdditionalPhone']=db['sequelize'][_0xa749('0x15')](_0xa749('0x93'));db['Template']=db[_0xa749('0x2')][_0xa749('0x15')]('../api/template/template.model');db[_0xa749('0x94')]=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0x95'));db['Variable']=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0x96'));db[_0xa749('0x97')]=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0x98'));db[_0xa749('0x99')]=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0x9a'));db[_0xa749('0x9b')]=db['sequelize'][_0xa749('0x15')](_0xa749('0x9c'));db[_0xa749('0x9d')]=db[_0xa749('0x2')]['import']('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0xa749('0x9e')]=db[_0xa749('0x2')]['import'](_0xa749('0x9f'));db[_0xa749('0xa0')]=db[_0xa749('0x2')]['import'](_0xa749('0xa1'));db[_0xa749('0xa2')]=db['sequelize'][_0xa749('0x15')]('../api/analyticFieldReport/analyticFieldReport.model');db[_0xa749('0xa3')]=db['sequelize']['import'](_0xa749('0xa4'));db[_0xa749('0xa5')]=db[_0xa749('0x2')]['import'](_0xa749('0xa6'));db['SalesforceConfiguration']=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0xa7'));db[_0xa749('0xa8')]=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0xa9'));db[_0xa749('0xaa')]=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0xab'));db[_0xa749('0xac')]=db['sequelize']['import'](_0xa749('0xad'));db[_0xa749('0xae')]=db['sequelize'][_0xa749('0x15')](_0xa749('0xaf'));db[_0xa749('0xb0')]=db[_0xa749('0x2')][_0xa749('0x15')]('../api/intDeskAccount/intDeskAccount.model');db['DeskConfiguration']=db[_0xa749('0x2')]['import'](_0xa749('0xb1'));db[_0xa749('0xb2')]=db[_0xa749('0x2')][_0xa749('0x15')]('../api/intDeskField/intDeskField.model');db['ZohoAccount']=db['sequelize'][_0xa749('0x15')](_0xa749('0xb3'));db[_0xa749('0xb4')]=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0xb5'));db['ZohoField']=db['sequelize'][_0xa749('0x15')]('../api/intZohoField/intZohoField.model');db[_0xa749('0xb6')]=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0xb7'));db[_0xa749('0xb8')]=db[_0xa749('0x2')][_0xa749('0x15')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0xa749('0xb9')]=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0xba'));db[_0xa749('0xbb')]=db['sequelize']['import'](_0xa749('0xbc'));db[_0xa749('0xbd')]=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0xbe'));db[_0xa749('0xbf')]=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0xc0'));db['VtigerAccount']=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0xc1'));db[_0xa749('0xc2')]=db[_0xa749('0x2')]['import']('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0xa749('0xc3')]=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0xc4'));db['ServicenowAccount']=db[_0xa749('0x2')][_0xa749('0x15')]('../api/intServicenowAccount/intServicenowAccount.model');db[_0xa749('0xc5')]=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0xc6'));db[_0xa749('0xc7')]=db[_0xa749('0x2')]['import'](_0xa749('0xc8'));db[_0xa749('0xc9')]=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0xca'));db['Dynamics365Configuration']=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0xcb'));db['Dynamics365Field']=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0xcc'));db[_0xa749('0xcd')]=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0xce'));db[_0xa749('0xcf')]=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0xd0'));db[_0xa749('0xd1')]=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0xd2'));db[_0xa749('0x97')]=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0x98'));db[_0xa749('0xd3')]=db[_0xa749('0x2')][_0xa749('0x15')]('../api/network/network.model');db[_0xa749('0xd4')]=db['sequelize'][_0xa749('0x15')](_0xa749('0xd5'));db[_0xa749('0xd6')]=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0xd7'));db[_0xa749('0xd8')]=db['sequelize'][_0xa749('0x15')](_0xa749('0xd9'));db[_0xa749('0xda')]=db[_0xa749('0x2')]['import'](_0xa749('0xdb'));db[_0xa749('0xdc')]=db[_0xa749('0x2')]['import'](_0xa749('0xdd'));db[_0xa749('0xde')]=db[_0xa749('0x2')][_0xa749('0x15')]('../api/smsQueueReport/smsQueueReport.model');db[_0xa749('0xdf')]=db['sequelize'][_0xa749('0x15')]('../api/squareReport/squareReport.model');db[_0xa749('0xe0')]=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0xe1'));db['JscriptyProject']=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0xe2'));db[_0xa749('0xe3')]=db['sequelize'][_0xa749('0x15')]('../api/setting/setting.model');db[_0xa749('0xe4')]=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0xe5'));db[_0xa749('0xe6')]=db['sequelize'][_0xa749('0x15')]('../api/squareProject/squareProject.model');db[_0xa749('0xe7')]=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0xe8'));db[_0xa749('0xe9')]=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0xea'));db['Team']=db[_0xa749('0x2')]['import'](_0xa749('0xeb'));db['License']=db[_0xa749('0x2')][_0xa749('0x15')]('../api/license/license.model');db[_0xa749('0xec')]=db['sequelize']['import']('../api/campaign/campaign.model');db[_0xa749('0xed')]=db[_0xa749('0x2')]['import']('../api/migration/migration.model');db[_0xa749('0xee')]=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0xef'));db[_0xa749('0xf0')]=db['sequelize'][_0xa749('0x15')](_0xa749('0xf1'));db[_0xa749('0xf2')]=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0xf3'));db[_0xa749('0xf4')]=db['sequelize'][_0xa749('0x15')]('../api/chatTransferReport/chatTransferReport.model');db[_0xa749('0xf5')]=db[_0xa749('0x2')]['import'](_0xa749('0xf6'));db[_0xa749('0xf7')]=db['sequelize']['import']('../api/openchannelTransferReport/openchannelTransferReport.model');db['SmsTransferReport']=db[_0xa749('0x2')]['import']('../api/smsTransferReport/smsTransferReport.model');db[_0xa749('0xf8')]=db['sequelize']['import'](_0xa749('0xf9'));db['VoicePrefix']=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0xfa'));db[_0xa749('0xfb')]=db[_0xa749('0x2')][_0xa749('0x15')]('../api/userProfile/userProfile.model');db['UserProfileSection']=db[_0xa749('0x2')][_0xa749('0x15')]('../api/userProfileSection/userProfileSection.model');db[_0xa749('0xfc')]=db['sequelize']['import'](_0xa749('0xfd'));db[_0xa749('0xfe')]=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0xff'));db[_0xa749('0x100')]=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0x101'));db[_0xa749('0x102')]=db[_0xa749('0x2')][_0xa749('0x15')]('../api/whatsappApplication/whatsappApplication.model');db[_0xa749('0x103')]=db['sequelize'][_0xa749('0x15')]('../api/whatsappInteraction/whatsappInteraction.model');db['WhatsappMessage']=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0x104'));db[_0xa749('0x105')]=db['sequelize'][_0xa749('0x15')](_0xa749('0x106'));db[_0xa749('0x107')]=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0x108'));db[_0xa749('0x109')]=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0x10a'));db[_0xa749('0x10b')]=db[_0xa749('0x2')][_0xa749('0x15')]('../api/cloudProvider/cloudProvider.model');db[_0xa749('0x10c')]=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0x10d'));db[_0xa749('0x10e')]=db[_0xa749('0x2')][_0xa749('0x15')](_0xa749('0x10f'));db[_0xa749('0x110')][_0xa749('0x111')](db[_0xa749('0x112')],{'as':_0xa749('0x112'),'onDelete':'cascade','foreignKey':_0xa749('0x113')});db[_0xa749('0x110')][_0xa749('0x114')](db[_0xa749('0x1d')],{'as':_0xa749('0x115'),'foreignKey':_0xa749('0x113')});db[_0xa749('0x110')][_0xa749('0x114')](db[_0xa749('0x2c')],{'as':'VoiceQueuesRt','foreignKey':_0xa749('0x113')});db[_0xa749('0x110')][_0xa749('0x114')](db[_0xa749('0x116')],{'as':_0xa749('0x117'),'onDelete':_0xa749('0x118'),'hooks':!![]});db[_0xa749('0x110')][_0xa749('0x114')](db['CmHopperFinal'],{'as':_0xa749('0x119'),'foreignKey':_0xa749('0x113')});db[_0xa749('0x110')][_0xa749('0x114')](db[_0xa749('0x7a')],{'as':'HopperHistory','foreignKey':'UserId'});db[_0xa749('0x110')][_0xa749('0x114')](db[_0xa749('0x7c')],{'as':_0xa749('0x7c'),'foreignKey':_0xa749('0x113')});db[_0xa749('0x110')]['hasMany'](db[_0xa749('0x5f')],{'as':_0xa749('0x11a'),'foreignKey':'UserId'});db[_0xa749('0x110')][_0xa749('0x114')](db[_0xa749('0x11b')],{'as':_0xa749('0x11c'),'foreignKey':'UserId'});db[_0xa749('0x110')][_0xa749('0x114')](db[_0xa749('0x58')],{'as':'SmsInteractions','foreignKey':_0xa749('0x113')});db[_0xa749('0x110')][_0xa749('0x114')](db[_0xa749('0x4e')],{'as':_0xa749('0x11d'),'foreignKey':'UserId'});db[_0xa749('0x110')]['hasMany'](db[_0xa749('0x40')],{'as':'MailInteractions','foreignKey':_0xa749('0x113')});db[_0xa749('0x110')][_0xa749('0x114')](db[_0xa749('0x103')],{'as':'WhatsappInteractions','foreignKey':_0xa749('0x113')});db['User'][_0xa749('0x114')](db[_0xa749('0xfe')],{'as':_0xa749('0x11e'),'foreignKey':_0xa749('0x11f')});db[_0xa749('0x110')][_0xa749('0x120')](db[_0xa749('0xfb')],{'as':_0xa749('0xfb'),'foreignKey':_0xa749('0x121')});db[_0xa749('0x110')][_0xa749('0x122')](db[_0xa749('0x6f')],{'as':_0xa749('0x123'),'through':_0xa749('0x124')});db[_0xa749('0x110')]['belongsToMany'](db['CmContact'],{'as':_0xa749('0x125'),'through':_0xa749('0x126')});db['User']['belongsToMany'](db['CmList'],{'as':'Lists','through':'cm_user_has_lists'});db[_0xa749('0x110')][_0xa749('0x122')](db[_0xa749('0x127')],{'through':_0xa749('0x128')});db[_0xa749('0x110')][_0xa749('0x122')](db[_0xa749('0x40')],{'as':_0xa749('0x129'),'through':_0xa749('0x12a')});db[_0xa749('0x110')][_0xa749('0x122')](db['ChatInteraction'],{'as':_0xa749('0x11c'),'through':'user_has_chat_interactions'});db[_0xa749('0x110')]['belongsToMany'](db[_0xa749('0x4e')],{'as':_0xa749('0x11d'),'through':_0xa749('0x12b')});db[_0xa749('0x110')][_0xa749('0x122')](db[_0xa749('0x58')],{'as':_0xa749('0x12c'),'through':_0xa749('0x12d')});db[_0xa749('0x110')][_0xa749('0x122')](db[_0xa749('0x5f')],{'as':_0xa749('0x11a'),'through':'user_has_openchannel_interactions'});db[_0xa749('0x110')][_0xa749('0x122')](db[_0xa749('0x103')],{'as':_0xa749('0x12e'),'through':_0xa749('0x12f')});db[_0xa749('0x110')][_0xa749('0x122')](db[_0xa749('0x1b')],{'as':'VoiceQueues','through':_0xa749('0x2e'),'required':![]});db['User'][_0xa749('0x122')](db[_0xa749('0x3d')],{'as':_0xa749('0x130'),'through':_0xa749('0x131'),'required':![]});db[_0xa749('0x110')]['belongsToMany'](db[_0xa749('0x6d')],{'as':_0xa749('0x132'),'through':_0xa749('0x2f'),'required':![],'hooks':!![]});db[_0xa749('0x110')][_0xa749('0x122')](db['FaxQueue'],{'as':_0xa749('0x133'),'through':_0xa749('0x32'),'required':![]});db[_0xa749('0x110')]['belongsToMany'](db['SmsQueue'],{'as':_0xa749('0x134'),'through':_0xa749('0x34'),'required':![]});db[_0xa749('0x110')][_0xa749('0x122')](db[_0xa749('0x62')],{'as':_0xa749('0x135'),'through':_0xa749('0x36'),'required':![]});db[_0xa749('0x110')][_0xa749('0x122')](db['WhatsappQueue'],{'as':_0xa749('0x136'),'through':_0xa749('0x38'),'required':![]});db[_0xa749('0x110')]['belongsToMany'](db[_0xa749('0xf8')],{'through':_0xa749('0x137')});db[_0xa749('0x110')][_0xa749('0x122')](db[_0xa749('0x138')],{'as':_0xa749('0x139'),'through':_0xa749('0x13a'),'required':![]});db[_0xa749('0x110')]['belongsToMany'](db['ChatWebsite'],{'as':_0xa749('0x13b'),'through':_0xa749('0x13c')});db['User'][_0xa749('0x122')](db[_0xa749('0x4a')],{'as':'FaxAccounts','through':'user_has_fax_accounts'});db[_0xa749('0x110')]['belongsToMany'](db[_0xa749('0x3c')],{'as':_0xa749('0x13d'),'through':_0xa749('0x13e')});db['User']['belongsToMany'](db[_0xa749('0x5c')],{'as':'OpenchannelAccounts','through':_0xa749('0x13f')});db[_0xa749('0x110')][_0xa749('0x122')](db['SmsAccount'],{'as':_0xa749('0x140'),'through':'user_has_sms_accounts'});db[_0xa749('0x110')][_0xa749('0x122')](db[_0xa749('0x100')],{'as':_0xa749('0x141'),'through':_0xa749('0x142')});db[_0xa749('0x110')][_0xa749('0x122')](db[_0xa749('0xe6')],{'as':_0xa749('0x143'),'through':_0xa749('0x144')});db[_0xa749('0x16')][_0xa749('0x114')](db[_0xa749('0x116')],{'as':'SpiedAgents','onDelete':_0xa749('0x118'),'foreignKey':'ChanSpyId'});db['VoiceContext'][_0xa749('0x114')](db['VoiceExtension'],{'onDelete':_0xa749('0x118')});db['VoiceExtension']['hasMany'](db['VoiceExtension'],{'as':_0xa749('0x145'),'onDelete':_0xa749('0x118')});db[_0xa749('0x19')]['belongsToMany'](db[_0xa749('0x8d')],{'as':_0xa749('0x146'),'through':'moh_has_sounds'});db[_0xa749('0x1b')]['hasMany'](db[_0xa749('0x2c')],{'as':'Members','foreignKey':'VoiceQueueId'});db[_0xa749('0x1b')][_0xa749('0x114')](db[_0xa749('0x75')],{'as':_0xa749('0x147'),'foreignKey':_0xa749('0x148')});db['VoiceQueue'][_0xa749('0x114')](db[_0xa749('0x149')],{'as':'HopperFinals','foreignKey':'VoiceQueueId'});db[_0xa749('0x1b')][_0xa749('0x114')](db[_0xa749('0x7a')],{'as':_0xa749('0x14a'),'foreignKey':_0xa749('0x148')});db[_0xa749('0x1b')][_0xa749('0x114')](db[_0xa749('0x7c')],{'as':'ReportAgentPreview','foreignKey':'VoiceQueueId'});db[_0xa749('0x1b')]['hasMany'](db[_0xa749('0x77')],{'as':_0xa749('0x14b'),'foreignKey':_0xa749('0x148')});db[_0xa749('0x1b')][_0xa749('0x114')](db[_0xa749('0xdc')],{'as':_0xa749('0x14c'),'foreignKey':_0xa749('0x148')});db[_0xa749('0x1b')][_0xa749('0x120')](db[_0xa749('0x28')],{'as':'Trunk','foreignKey':_0xa749('0x14d')});db[_0xa749('0x1b')][_0xa749('0x120')](db['Trunk'],{'as':_0xa749('0x14e'),'foreignKey':'TrunkBackupId'});db[_0xa749('0x1b')][_0xa749('0x120')](db[_0xa749('0x84')],{'as':_0xa749('0x84'),'foreignKey':_0xa749('0x14f')});db[_0xa749('0x1b')][_0xa749('0x120')](db['Pause'],{'as':_0xa749('0x150'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xa749('0x1b')][_0xa749('0x122')](db[_0xa749('0xf8')],{'as':'Lists','through':_0xa749('0x151')});db[_0xa749('0x1b')][_0xa749('0x122')](db[_0xa749('0x110')],{'as':'Agents','through':'UserVoiceQueue'});db[_0xa749('0x1b')][_0xa749('0x122')](db[_0xa749('0x127')],{'as':_0xa749('0x152'),'through':_0xa749('0x10e')});db[_0xa749('0x1b')]['belongsToMany'](db[_0xa749('0xf8')],{'as':_0xa749('0x153'),'through':_0xa749('0x154')});db['VoiceRecording']['belongsTo'](db[_0xa749('0x110')],{'as':'User','foreignKey':'UserId'});db[_0xa749('0x1f')][_0xa749('0x120')](db[_0xa749('0x110')],{'as':_0xa749('0x110'),'foreignKey':'UserId'});db[_0xa749('0x112')][_0xa749('0x114')](db[_0xa749('0x20')],{'as':_0xa749('0x155'),'onDelete':'cascade','foreignKey':_0xa749('0x156'),'sourceKey':'mailbox'});db['VoiceMailMessage'][_0xa749('0x120')](db[_0xa749('0x112')],{'foreignKey':_0xa749('0x156'),'targetKey':_0xa749('0x157')});db[_0xa749('0x158')][_0xa749('0x114')](db[_0xa749('0x25')],{'as':'QueueCalls','foreignKey':_0xa749('0x159'),'constraints':![]});db['VoiceCallReport'][_0xa749('0x114')](db[_0xa749('0x15a')],{'as':_0xa749('0x15b'),'foreignKey':_0xa749('0x159'),'constraints':![]});db['VoiceCallReport']['belongsTo'](db[_0xa749('0x110')],{'as':'User','foreignKey':'UserId'});db[_0xa749('0x158')][_0xa749('0x120')](db['CmContact'],{'as':_0xa749('0x15c'),'foreignKey':_0xa749('0x15d')});db[_0xa749('0x15e')]['belongsTo'](db[_0xa749('0x3c')],{'as':_0xa749('0x3c'),'foreignKey':'MailAccountId'});db[_0xa749('0x3b')]['belongsTo'](db[_0xa749('0x3c')],{'as':_0xa749('0x3c'),'foreignKey':_0xa749('0x15f')});db['MailAccount'][_0xa749('0x111')](db[_0xa749('0x15e')],{'as':_0xa749('0x160'),'onDelete':_0xa749('0x118')});db[_0xa749('0x3c')][_0xa749('0x111')](db['MailServerOut'],{'as':_0xa749('0x161'),'onDelete':_0xa749('0x118')});db[_0xa749('0x3c')][_0xa749('0x114')](db[_0xa749('0x162')],{'as':_0xa749('0x163'),'foreignKey':_0xa749('0x15f'),'onDelete':'cascade'});db[_0xa749('0x3c')]['hasMany'](db['CannedAnswer'],{'as':'Answers','foreignKey':_0xa749('0x15f')});db[_0xa749('0x3c')][_0xa749('0x114')](db[_0xa749('0x42')],{'as':'Messages','foreignKey':_0xa749('0x15f')});db[_0xa749('0x3c')][_0xa749('0x114')](db['MailInteraction'],{'as':_0xa749('0x164')});db[_0xa749('0x3c')][_0xa749('0x114')](db[_0xa749('0x44')],{'as':'Applications'});db[_0xa749('0x3c')][_0xa749('0x120')](db[_0xa749('0xf8')],{'as':_0xa749('0x165'),'foreignKey':_0xa749('0x166')});db[_0xa749('0x3c')]['belongsTo'](db[_0xa749('0x167')],{'as':'Template','foreignKey':_0xa749('0x168')});db['MailAccount']['belongsTo'](db['Pause'],{'as':_0xa749('0x150'),'foreignKey':_0xa749('0x169')});db['MailAccount'][_0xa749('0x122')](db[_0xa749('0x110')],{'as':_0xa749('0x16a'),'through':_0xa749('0x13e')});db[_0xa749('0x3d')][_0xa749('0x122')](db['User'],{'as':'Agents','through':_0xa749('0x131')});db[_0xa749('0x3d')][_0xa749('0x122')](db['Team'],{'through':'team_has_mail_queues','as':_0xa749('0x152')});db[_0xa749('0x40')][_0xa749('0x114')](db[_0xa749('0x42')],{'as':_0xa749('0x155'),'onDelete':_0xa749('0x118'),'foreignKey':_0xa749('0x16b')});db[_0xa749('0x40')][_0xa749('0x120')](db[_0xa749('0x3c')],{'as':'Account','foreignKey':'MailAccountId'});db[_0xa749('0x40')][_0xa749('0x120')](db[_0xa749('0x73')],{'as':_0xa749('0x15c'),'foreignKey':_0xa749('0x15d')});db['MailInteraction'][_0xa749('0x120')](db[_0xa749('0x110')],{'as':_0xa749('0x16c'),'foreignKey':_0xa749('0x113')});db[_0xa749('0x40')][_0xa749('0x122')](db['Tag'],{'through':_0xa749('0x16d'),'as':'Tags'});db['MailInteraction'][_0xa749('0x122')](db[_0xa749('0x8f')],{'through':_0xa749('0x16d'),'as':_0xa749('0x16e')});db[_0xa749('0x40')][_0xa749('0x122')](db[_0xa749('0x110')],{'as':'Users','through':_0xa749('0x12a'),'foreignKey':_0xa749('0x16b')});db[_0xa749('0x42')][_0xa749('0x114')](db[_0xa749('0xee')],{'as':_0xa749('0x16f'),'onDelete':_0xa749('0x118')});db[_0xa749('0x42')][_0xa749('0x120')](db[_0xa749('0x110')],{'as':_0xa749('0x110')});db['MailMessage'][_0xa749('0x120')](db[_0xa749('0x73')],{'onDelete':_0xa749('0x118'),'as':'Contact'});db[_0xa749('0x42')]['belongsTo'](db[_0xa749('0x40')],{'as':_0xa749('0x170'),'foreignKey':_0xa749('0x16b')});db['MailMessage'][_0xa749('0x120')](db['MailAccount'],{'as':_0xa749('0x171'),'foreignKey':_0xa749('0x15f')});db[_0xa749('0x42')][_0xa749('0x120')](db['ChatWebsite'],{'as':_0xa749('0x64'),'foreignKey':_0xa749('0x172')});db[_0xa749('0x42')][_0xa749('0x120')](db[_0xa749('0x6b')],{'as':_0xa749('0x6b'),'foreignKey':'ChatOfflineMessageId'});db['MailApplication'][_0xa749('0x120')](db[_0xa749('0x110')],{'onDelete':_0xa749('0x173')});db[_0xa749('0x44')][_0xa749('0x120')](db[_0xa749('0x3d')],{'onDelete':_0xa749('0x173')});db[_0xa749('0x44')][_0xa749('0x120')](db[_0xa749('0x3c')],{'onDelete':_0xa749('0x173')});db[_0xa749('0x44')][_0xa749('0x120')](db['Interval'],{'onDelete':_0xa749('0x173'),'foreignKey':_0xa749('0x14f')});db[_0xa749('0x44')]['belongsTo'](db['Tag'],{'onDelete':_0xa749('0x173'),'foreignKey':_0xa749('0x174')});db[_0xa749('0x46')]['belongsTo'](db[_0xa749('0x3c')],{});db['MailQueueReport']['belongsTo'](db[_0xa749('0xf8')],{'as':_0xa749('0x165'),'foreignKey':'ListId'});db[_0xa749('0x46')]['belongsTo'](db[_0xa749('0x73')],{'as':'Contact','foreignKey':_0xa749('0x15d')});db[_0xa749('0x46')][_0xa749('0x120')](db[_0xa749('0x40')],{});db['MailQueueReport'][_0xa749('0x120')](db[_0xa749('0x42')],{});db['MailQueueReport'][_0xa749('0x120')](db[_0xa749('0x110')],{});db[_0xa749('0x46')][_0xa749('0x120')](db[_0xa749('0x3d')],{});db[_0xa749('0x48')]['hasMany'](db[_0xa749('0x49')],{'as':'Items','onDelete':_0xa749('0x118')});db[_0xa749('0x4a')]['hasMany'](db[_0xa749('0x162')],{'as':_0xa749('0x163'),'foreignKey':'FaxAccountId','onDelete':_0xa749('0x118')});db[_0xa749('0x4a')][_0xa749('0x114')](db[_0xa749('0x82')],{'as':_0xa749('0x175'),'foreignKey':_0xa749('0x176')});db[_0xa749('0x4a')][_0xa749('0x114')](db[_0xa749('0x4e')],{'as':'Interactions'});db[_0xa749('0x4a')][_0xa749('0x114')](db[_0xa749('0x4c')],{'as':'Applications'});db[_0xa749('0x4a')][_0xa749('0x114')](db[_0xa749('0x116')],{'as':_0xa749('0x177'),'onDelete':_0xa749('0x118')});db[_0xa749('0x4a')][_0xa749('0x114')](db[_0xa749('0x178')],{'as':_0xa749('0x155')});db[_0xa749('0x4a')]['belongsTo'](db[_0xa749('0x28')],{'as':_0xa749('0x28')});db[_0xa749('0x4a')][_0xa749('0x120')](db[_0xa749('0xf8')],{'as':'List','foreignKey':_0xa749('0x166')});db[_0xa749('0x4a')][_0xa749('0x120')](db[_0xa749('0x86')],{'as':_0xa749('0x150'),'foreignKey':_0xa749('0x169')});db[_0xa749('0x4a')][_0xa749('0x122')](db[_0xa749('0x110')],{'as':_0xa749('0x16a'),'through':_0xa749('0x179')});db[_0xa749('0x4c')][_0xa749('0x120')](db['User'],{'onDelete':_0xa749('0x173')});db[_0xa749('0x4c')][_0xa749('0x120')](db[_0xa749('0x51')],{'onDelete':_0xa749('0x173')});db['FaxApplication'][_0xa749('0x120')](db[_0xa749('0x4a')],{'onDelete':_0xa749('0x173')});db[_0xa749('0x4c')]['belongsTo'](db['Tag'],{'onDelete':_0xa749('0x173'),'foreignKey':_0xa749('0x174')});db[_0xa749('0x4e')][_0xa749('0x114')](db[_0xa749('0x178')],{'as':_0xa749('0x155'),'onDelete':_0xa749('0x118'),'foreignKey':_0xa749('0x17a')});db[_0xa749('0x4e')][_0xa749('0x120')](db[_0xa749('0x4a')],{'as':'Account','foreignKey':_0xa749('0x176')});db[_0xa749('0x4e')][_0xa749('0x120')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db[_0xa749('0x4e')]['belongsTo'](db[_0xa749('0x110')],{'as':'Owner','foreignKey':'UserId'});db[_0xa749('0x4e')][_0xa749('0x122')](db[_0xa749('0x8f')],{'through':_0xa749('0x17b'),'as':_0xa749('0x17c')});db[_0xa749('0x4e')]['belongsToMany'](db[_0xa749('0x8f')],{'through':_0xa749('0x17b'),'as':_0xa749('0x16e')});db[_0xa749('0x4e')][_0xa749('0x122')](db[_0xa749('0x110')],{'as':_0xa749('0x17d'),'through':_0xa749('0x12b'),'foreignKey':_0xa749('0x17a')});db['FaxMessage'][_0xa749('0x120')](db[_0xa749('0x110')],{'onDelete':_0xa749('0x118'),'as':_0xa749('0x110')});db[_0xa749('0x178')]['belongsTo'](db[_0xa749('0x4e')],{'as':_0xa749('0x170'),'foreignKey':_0xa749('0x17a')});db['FaxMessage'][_0xa749('0x120')](db[_0xa749('0x73')],{'onDelete':_0xa749('0x118'),'as':_0xa749('0x15c')});db[_0xa749('0x178')][_0xa749('0x120')](db[_0xa749('0xee')],{'as':'Attachment','foreignKey':_0xa749('0x17e')});db[_0xa749('0x178')]['belongsTo'](db[_0xa749('0x4a')],{'as':_0xa749('0x171'),'foreignKey':_0xa749('0x176')});db[_0xa749('0x51')][_0xa749('0x122')](db['User'],{'as':_0xa749('0x16a'),'through':_0xa749('0x32')});db[_0xa749('0x51')]['belongsToMany'](db[_0xa749('0x127')],{'through':_0xa749('0x17f'),'as':_0xa749('0x152')});db['FaxQueueReport'][_0xa749('0x120')](db['FaxAccount'],{});db[_0xa749('0x180')][_0xa749('0x120')](db[_0xa749('0xf8')],{'as':_0xa749('0x165'),'foreignKey':_0xa749('0x166')});db[_0xa749('0x180')][_0xa749('0x120')](db[_0xa749('0x73')],{'as':_0xa749('0x15c'),'foreignKey':'ContactId'});db[_0xa749('0x180')][_0xa749('0x120')](db[_0xa749('0x4e')],{});db[_0xa749('0x180')][_0xa749('0x120')](db[_0xa749('0x178')],{});db['FaxQueueReport']['belongsTo'](db['User'],{});db['FaxQueueReport'][_0xa749('0x120')](db[_0xa749('0x51')],{});db['SmsAccount'][_0xa749('0x114')](db[_0xa749('0x162')],{'as':'Dispositions','foreignKey':_0xa749('0x181'),'onDelete':'cascade'});db[_0xa749('0x54')]['hasMany'](db[_0xa749('0x82')],{'as':_0xa749('0x175'),'foreignKey':_0xa749('0x181')});db[_0xa749('0x54')][_0xa749('0x114')](db[_0xa749('0x182')],{'as':_0xa749('0x155'),'foreignKey':_0xa749('0x181')});db[_0xa749('0x54')][_0xa749('0x114')](db[_0xa749('0x58')],{'as':_0xa749('0x164')});db[_0xa749('0x54')][_0xa749('0x114')](db[_0xa749('0x56')],{'as':_0xa749('0x145')});db[_0xa749('0x54')]['belongsTo'](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0xa749('0x54')][_0xa749('0x120')](db[_0xa749('0x86')],{'as':_0xa749('0x150'),'foreignKey':_0xa749('0x169')});db[_0xa749('0x54')][_0xa749('0x122')](db[_0xa749('0x110')],{'as':_0xa749('0x16a'),'through':'user_has_sms_accounts'});db[_0xa749('0x56')][_0xa749('0x120')](db[_0xa749('0x110')],{'onDelete':_0xa749('0x173')});db[_0xa749('0x56')][_0xa749('0x120')](db[_0xa749('0x183')],{'onDelete':_0xa749('0x173')});db[_0xa749('0x56')][_0xa749('0x120')](db[_0xa749('0x54')],{'onDelete':_0xa749('0x173')});db[_0xa749('0x56')][_0xa749('0x120')](db[_0xa749('0x84')],{'onDelete':_0xa749('0x173'),'foreignKey':_0xa749('0x14f')});db[_0xa749('0x56')][_0xa749('0x120')](db[_0xa749('0x8f')],{'onDelete':_0xa749('0x173'),'foreignKey':_0xa749('0x174')});db['SmsInteraction'][_0xa749('0x114')](db[_0xa749('0x182')],{'as':_0xa749('0x155'),'onDelete':_0xa749('0x118'),'foreignKey':_0xa749('0x184')});db[_0xa749('0x58')][_0xa749('0x120')](db[_0xa749('0x54')],{'as':_0xa749('0x171'),'foreignKey':_0xa749('0x181')});db[_0xa749('0x58')][_0xa749('0x120')](db[_0xa749('0x73')],{'as':_0xa749('0x15c'),'foreignKey':_0xa749('0x15d')});db['SmsInteraction'][_0xa749('0x120')](db[_0xa749('0x110')],{'as':_0xa749('0x16c'),'foreignKey':_0xa749('0x113')});db['SmsInteraction'][_0xa749('0x122')](db[_0xa749('0x8f')],{'through':'sms_interaction_has_tags','as':_0xa749('0x17c')});db[_0xa749('0x58')][_0xa749('0x122')](db[_0xa749('0x8f')],{'through':_0xa749('0x185'),'as':_0xa749('0x16e')});db[_0xa749('0x58')][_0xa749('0x122')](db[_0xa749('0x110')],{'as':_0xa749('0x17d'),'through':_0xa749('0x12d'),'foreignKey':'SmsInteractionId'});db[_0xa749('0x182')][_0xa749('0x120')](db[_0xa749('0x110')],{'as':_0xa749('0x110')});db[_0xa749('0x182')][_0xa749('0x120')](db[_0xa749('0x73')],{'onDelete':'cascade','as':'Contact'});db[_0xa749('0x182')]['belongsTo'](db[_0xa749('0x58')],{'onDelete':_0xa749('0x118'),'as':_0xa749('0x170'),'foreignKey':_0xa749('0x184')});db[_0xa749('0x182')][_0xa749('0x120')](db['SmsAccount'],{'as':'Account','foreignKey':_0xa749('0x181')});db['SmsQueue'][_0xa749('0x122')](db[_0xa749('0x110')],{'as':_0xa749('0x16a'),'through':_0xa749('0x34'),'foreignKey':_0xa749('0x186')});db[_0xa749('0x183')][_0xa749('0x122')](db['Team'],{'through':_0xa749('0x187'),'as':'Teams'});db[_0xa749('0x5c')][_0xa749('0x114')](db[_0xa749('0x162')],{'as':_0xa749('0x163'),'foreignKey':_0xa749('0x188'),'onDelete':_0xa749('0x118')});db[_0xa749('0x5c')][_0xa749('0x114')](db[_0xa749('0x82')],{'as':'Answers','foreignKey':_0xa749('0x188')});db[_0xa749('0x5c')][_0xa749('0x114')](db[_0xa749('0x5f')],{'as':'Interactions','foreignKey':_0xa749('0x188')});db[_0xa749('0x5c')][_0xa749('0x114')](db[_0xa749('0x61')],{'as':_0xa749('0x155'),'foreignKey':_0xa749('0x188')});db[_0xa749('0x5c')][_0xa749('0x114')](db[_0xa749('0x5e')],{'as':_0xa749('0x145'),'foreignKey':_0xa749('0x188')});db['OpenchannelAccount'][_0xa749('0x120')](db[_0xa749('0xf8')],{'as':_0xa749('0x165'),'foreignKey':_0xa749('0x166')});db[_0xa749('0x5c')][_0xa749('0x120')](db[_0xa749('0x86')],{'as':_0xa749('0x150'),'foreignKey':_0xa749('0x169')});db[_0xa749('0x5c')][_0xa749('0x122')](db['User'],{'as':_0xa749('0x16a'),'through':_0xa749('0x13f')});db[_0xa749('0x5e')][_0xa749('0x120')](db['User'],{'onDelete':'restrict'});db[_0xa749('0x5e')][_0xa749('0x120')](db[_0xa749('0x62')],{'onDelete':_0xa749('0x173'),'foreignKey':_0xa749('0x189')});db[_0xa749('0x5e')]['belongsTo'](db[_0xa749('0x5c')],{'onDelete':_0xa749('0x173'),'foreignKey':_0xa749('0x188')});db[_0xa749('0x5e')][_0xa749('0x120')](db['Interval'],{'onDelete':'restrict','foreignKey':_0xa749('0x14f')});db[_0xa749('0x5e')][_0xa749('0x120')](db[_0xa749('0x8f')],{'onDelete':_0xa749('0x173'),'foreignKey':_0xa749('0x174')});db[_0xa749('0x5f')][_0xa749('0x114')](db[_0xa749('0x61')],{'as':'Messages','onDelete':_0xa749('0x118'),'foreignKey':_0xa749('0x18a')});db[_0xa749('0x5f')][_0xa749('0x120')](db[_0xa749('0x5c')],{'as':_0xa749('0x171'),'foreignKey':_0xa749('0x188')});db[_0xa749('0x5f')][_0xa749('0x120')](db[_0xa749('0x73')],{'as':'Contact','foreignKey':_0xa749('0x15d')});db[_0xa749('0x5f')][_0xa749('0x120')](db[_0xa749('0x110')],{'as':_0xa749('0x16c'),'foreignKey':'UserId'});db[_0xa749('0x5f')][_0xa749('0x122')](db[_0xa749('0x8f')],{'through':_0xa749('0x18b'),'as':_0xa749('0x17c')});db[_0xa749('0x5f')][_0xa749('0x122')](db[_0xa749('0x8f')],{'through':'openchannel_interaction_has_tags','as':_0xa749('0x16e')});db['OpenchannelInteraction'][_0xa749('0x122')](db[_0xa749('0x110')],{'as':_0xa749('0x17d'),'through':_0xa749('0x18c'),'foreignKey':_0xa749('0x18a')});db['OpenchannelMessage'][_0xa749('0x120')](db['User'],{'onDelete':_0xa749('0x118'),'as':_0xa749('0x110')});db[_0xa749('0x61')][_0xa749('0x120')](db[_0xa749('0x73')],{'onDelete':'cascade','as':_0xa749('0x15c')});db[_0xa749('0x61')][_0xa749('0x120')](db[_0xa749('0x5f')],{'onDelete':'cascade','as':_0xa749('0x170'),'foreignKey':_0xa749('0x18a')});db[_0xa749('0x61')][_0xa749('0x120')](db[_0xa749('0xee')],{'as':_0xa749('0xee'),'foreignKey':'AttachmentId'});db[_0xa749('0x61')]['belongsTo'](db['OpenchannelAccount'],{'as':_0xa749('0x171'),'foreignKey':_0xa749('0x188')});db[_0xa749('0x62')][_0xa749('0x122')](db[_0xa749('0x110')],{'as':_0xa749('0x16a'),'through':_0xa749('0x36'),'foreignKey':_0xa749('0x189')});db[_0xa749('0x62')]['belongsToMany'](db['Team'],{'through':_0xa749('0x18d'),'as':_0xa749('0x152')});db[_0xa749('0x64')]['hasMany'](db[_0xa749('0x162')],{'as':_0xa749('0x163'),'foreignKey':_0xa749('0x172'),'onDelete':'cascade'});db[_0xa749('0x64')][_0xa749('0x114')](db[_0xa749('0x82')],{'as':_0xa749('0x175'),'foreignKey':_0xa749('0x172')});db[_0xa749('0x64')][_0xa749('0x114')](db[_0xa749('0x71')],{'as':_0xa749('0x18e')});db[_0xa749('0x64')][_0xa749('0x114')](db[_0xa749('0x11b')],{'as':_0xa749('0x164')});db['ChatWebsite'][_0xa749('0x114')](db[_0xa749('0x67')],{'as':_0xa749('0x145')});db[_0xa749('0x64')][_0xa749('0x114')](db['ChatMessage'],{'as':_0xa749('0x155')});db[_0xa749('0x64')][_0xa749('0x120')](db[_0xa749('0xf8')],{'as':_0xa749('0x165'),'foreignKey':'ListId'});db[_0xa749('0x64')][_0xa749('0x120')](db['Interval'],{'as':_0xa749('0x84'),'foreignKey':_0xa749('0x14f')});db[_0xa749('0x64')][_0xa749('0x120')](db[_0xa749('0x3c')],{'as':_0xa749('0x3c'),'foreignKey':'MailAccountId'});db['ChatWebsite'][_0xa749('0x120')](db[_0xa749('0x86')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0xa749('0x64')][_0xa749('0x122')](db[_0xa749('0x110')],{'as':_0xa749('0x16a'),'through':'user_has_chat_websites'});db[_0xa749('0x66')][_0xa749('0x120')](db[_0xa749('0x5c')],{});db[_0xa749('0x66')][_0xa749('0x120')](db[_0xa749('0xf8')],{'as':'List','foreignKey':'ListId'});db[_0xa749('0x66')][_0xa749('0x120')](db[_0xa749('0x73')],{'as':_0xa749('0x15c'),'foreignKey':_0xa749('0x15d')});db[_0xa749('0x66')]['belongsTo'](db[_0xa749('0x5f')],{});db[_0xa749('0x66')][_0xa749('0x120')](db[_0xa749('0x61')],{});db[_0xa749('0x66')][_0xa749('0x120')](db[_0xa749('0x110')],{});db[_0xa749('0x66')][_0xa749('0x120')](db[_0xa749('0x62')],{});db[_0xa749('0x67')][_0xa749('0x120')](db[_0xa749('0x110')],{'as':_0xa749('0x18f'),'foreignKey':_0xa749('0x113'),'onDelete':'restrict'});db[_0xa749('0x67')]['belongsTo'](db[_0xa749('0x6d')],{'as':_0xa749('0x190'),'foreignKey':'ChatQueueId','onDelete':_0xa749('0x173')});db['ChatApplication'][_0xa749('0x120')](db['ChatWebsite'],{'as':_0xa749('0x191'),'foreignKey':_0xa749('0x172'),'onDelete':_0xa749('0x173')});db[_0xa749('0x67')][_0xa749('0x120')](db[_0xa749('0x8f')],{'onDelete':_0xa749('0x173'),'foreignKey':_0xa749('0x174')});db[_0xa749('0x11b')]['hasMany'](db['ChatMessage'],{'as':_0xa749('0x155'),'onDelete':_0xa749('0x118'),'foreignKey':_0xa749('0x192')});db[_0xa749('0x11b')][_0xa749('0x120')](db[_0xa749('0x64')],{'as':_0xa749('0x171'),'foreignKey':_0xa749('0x172')});db[_0xa749('0x11b')][_0xa749('0x120')](db[_0xa749('0x73')],{'as':_0xa749('0x15c'),'foreignKey':_0xa749('0x15d')});db[_0xa749('0x11b')][_0xa749('0x120')](db[_0xa749('0x110')],{'as':_0xa749('0x16c'),'foreignKey':'UserId'});db[_0xa749('0x11b')][_0xa749('0x122')](db[_0xa749('0x8f')],{'through':_0xa749('0x193'),'as':_0xa749('0x17c')});db['ChatInteraction'][_0xa749('0x122')](db[_0xa749('0x8f')],{'through':'chat_interaction_has_tags','as':_0xa749('0x16e')});db[_0xa749('0x11b')]['belongsToMany'](db[_0xa749('0x110')],{'as':_0xa749('0x17d'),'through':_0xa749('0x194'),'foreignKey':_0xa749('0x192')});db[_0xa749('0x195')][_0xa749('0x120')](db[_0xa749('0x110')],{'onDelete':'cascade','as':_0xa749('0x110')});db['ChatMessage'][_0xa749('0x120')](db[_0xa749('0x73')],{'onDelete':_0xa749('0x118'),'as':_0xa749('0x15c'),'foreignKey':_0xa749('0x15d')});db['ChatMessage'][_0xa749('0x120')](db[_0xa749('0x11b')],{'onDelete':_0xa749('0x118'),'as':_0xa749('0x170'),'foreignKey':_0xa749('0x192')});db[_0xa749('0x195')][_0xa749('0x120')](db[_0xa749('0xee')],{'as':_0xa749('0xee'),'foreignKey':_0xa749('0x17e')});db[_0xa749('0x195')]['belongsTo'](db['ChatWebsite'],{'as':_0xa749('0x171'),'foreignKey':_0xa749('0x172')});db['ChatOfflineMessage'][_0xa749('0x114')](db[_0xa749('0xee')],{'as':_0xa749('0x16f'),'foreignKey':'ChatOfflineMessageId','onDelete':'cascade','hooks':!![]});db[_0xa749('0x6b')]['belongsTo'](db[_0xa749('0x73')],{'onDelete':_0xa749('0x118'),'as':_0xa749('0x15c'),'foreignKey':_0xa749('0x15d')});db['ChatOfflineMessage'][_0xa749('0x120')](db[_0xa749('0x64')],{'as':_0xa749('0x171'),'foreignKey':_0xa749('0x172')});db['ChatQueue'][_0xa749('0x122')](db['User'],{'as':_0xa749('0x16a'),'through':_0xa749('0x2f'),'hooks':!![]});db['ChatQueue'][_0xa749('0x122')](db[_0xa749('0x127')],{'through':_0xa749('0x196'),'as':_0xa749('0x152')});db[_0xa749('0x6f')][_0xa749('0x114')](db[_0xa749('0xd6')],{'as':_0xa749('0x155'),'foreignKey':'ChatGroupId','onDelete':'cascade'});db[_0xa749('0x6f')][_0xa749('0x122')](db[_0xa749('0x110')],{'as':'Members','through':_0xa749('0x124')});db[_0xa749('0x71')][_0xa749('0x120')](db[_0xa749('0x64')],{'as':_0xa749('0x191'),'foreignKey':_0xa749('0x172')});db[_0xa749('0x72')][_0xa749('0x114')](db[_0xa749('0x73')],{'as':'Contacts','foreignKey':_0xa749('0x197')});db[_0xa749('0x73')][_0xa749('0x114')](db[_0xa749('0x91')],{'as':_0xa749('0x198'),'foreignKey':_0xa749('0x199')});db[_0xa749('0x73')]['hasMany'](db[_0xa749('0x75')],{'as':_0xa749('0x147'),'foreignKey':_0xa749('0x15d')});db['CmContact'][_0xa749('0x114')](db[_0xa749('0x149')],{'as':_0xa749('0x119'),'foreignKey':_0xa749('0x15d')});db[_0xa749('0x73')][_0xa749('0x114')](db[_0xa749('0x7a')],{'as':_0xa749('0x14a'),'foreignKey':_0xa749('0x15d')});db[_0xa749('0x73')]['hasMany'](db[_0xa749('0x7c')],{'as':_0xa749('0x7c'),'foreignKey':_0xa749('0x15d')});db[_0xa749('0x73')][_0xa749('0x114')](db[_0xa749('0xdc')],{'as':_0xa749('0x14c'),'foreignKey':_0xa749('0x15d')});db[_0xa749('0x73')]['hasMany'](db[_0xa749('0x5f')],{'as':_0xa749('0x11a'),'foreignKey':_0xa749('0x15d'),'onDelete':_0xa749('0x173')});db[_0xa749('0x73')][_0xa749('0x114')](db['ChatInteraction'],{'as':_0xa749('0x11c'),'foreignKey':_0xa749('0x15d'),'onDelete':_0xa749('0x173')});db[_0xa749('0x73')][_0xa749('0x114')](db['SmsInteraction'],{'as':_0xa749('0x12c'),'foreignKey':_0xa749('0x15d'),'onDelete':_0xa749('0x173')});db[_0xa749('0x73')][_0xa749('0x114')](db[_0xa749('0x4e')],{'as':_0xa749('0x11d'),'foreignKey':_0xa749('0x15d'),'onDelete':_0xa749('0x173')});db['CmContact'][_0xa749('0x114')](db['MailInteraction'],{'as':'MailInteractions','foreignKey':_0xa749('0x15d'),'onDelete':'restrict'});db[_0xa749('0x73')]['belongsTo'](db[_0xa749('0x72')],{'as':'Company','foreignKey':_0xa749('0x197')});db[_0xa749('0x73')]['belongsTo'](db[_0xa749('0xf8')],{'as':'List','foreignKey':'ListId','onDelete':'cascade'});db['CmContact'][_0xa749('0x122')](db[_0xa749('0x110')],{'as':_0xa749('0x17d'),'through':_0xa749('0x126')});db[_0xa749('0x73')][_0xa749('0x122')](db[_0xa749('0x8f')],{'as':_0xa749('0x17c'),'through':_0xa749('0x19a')});db['CmContact'][_0xa749('0x122')](db['Tag'],{'through':_0xa749('0x19a'),'as':_0xa749('0x16e')});db[_0xa749('0x75')][_0xa749('0x114')](db[_0xa749('0x19b')],{'as':_0xa749('0x19c'),'foreignKey':_0xa749('0x19d')});db[_0xa749('0x75')]['belongsTo'](db['CmContact'],{'as':_0xa749('0x15c'),'foreignKey':_0xa749('0x15d'),'onDelete':_0xa749('0x118')});db[_0xa749('0x75')][_0xa749('0x120')](db[_0xa749('0xf8')],{'as':_0xa749('0x165'),'foreignKey':_0xa749('0x166'),'onDelete':_0xa749('0x118')});db[_0xa749('0x75')][_0xa749('0x120')](db[_0xa749('0x110')],{'as':_0xa749('0x18f'),'foreignKey':_0xa749('0x113')});db[_0xa749('0x75')][_0xa749('0x120')](db[_0xa749('0x1b')],{'as':_0xa749('0x190'),'foreignKey':_0xa749('0x148'),'onDelete':'cascade'});db[_0xa749('0x75')]['belongsTo'](db['Campaign'],{'as':'Campaign','foreignKey':'CampaignId','onDelete':_0xa749('0x118')});db[_0xa749('0x75')][_0xa749('0x120')](db[_0xa749('0x110')],{'as':_0xa749('0x16c'),'foreignKey':_0xa749('0x19e')});db[_0xa749('0x77')][_0xa749('0x120')](db['CmContact'],{'as':_0xa749('0x15c'),'foreignKey':'ContactId','onDelete':_0xa749('0x118')});db[_0xa749('0x77')]['belongsTo'](db[_0xa749('0xf8')],{'as':'List','foreignKey':_0xa749('0x166'),'onDelete':_0xa749('0x118')});db['CmHopperBlack']['belongsTo'](db[_0xa749('0x1b')],{'as':_0xa749('0x190'),'foreignKey':_0xa749('0x148'),'onDelete':_0xa749('0x118')});db[_0xa749('0x77')]['belongsTo'](db[_0xa749('0xec')],{'as':'Campaign','foreignKey':_0xa749('0x19f'),'onDelete':_0xa749('0x118')});db['Automation'][_0xa749('0x114')](db['Condition'],{'as':{'plural':_0xa749('0x1a0'),'singular':_0xa749('0x1a1')},'foreignKey':_0xa749('0x1a2'),'onDelete':_0xa749('0x118'),'hooks':!![]});db[_0xa749('0x81')][_0xa749('0x114')](db[_0xa749('0x1a3')],{'as':{'plural':_0xa749('0x1a4'),'singular':_0xa749('0x1a5')},'foreignKey':_0xa749('0x1a6'),'onDelete':'cascade','hooks':!![]});db[_0xa749('0x81')][_0xa749('0x114')](db[_0xa749('0x7f')],{'as':'Actions','foreignKey':_0xa749('0x1a7'),'onDelete':'cascade','hooks':!![]});db['Disposition'][_0xa749('0x114')](db[_0xa749('0x162')],{'as':_0xa749('0x163'),'foreignKey':_0xa749('0x1a8'),'onDelete':_0xa749('0x118')});db[_0xa749('0x84')][_0xa749('0x114')](db[_0xa749('0x84')],{'as':'Intervals','foreignKey':'IntervalId','onDelete':_0xa749('0x118'),'hooks':!![],'required':![]});db[_0xa749('0x84')][_0xa749('0x114')](db['VoiceExtension'],{'as':_0xa749('0x117'),'foreignKey':_0xa749('0x14f'),'onDelete':_0xa749('0x173')});db[_0xa749('0x84')][_0xa749('0x114')](db[_0xa749('0x44')],{'as':'MailApplications','foreignKey':_0xa749('0x14f')});db['Interval']['hasMany'](db[_0xa749('0x67')],{'as':_0xa749('0x1a9'),'foreignKey':'IntervalId'});db[_0xa749('0x84')][_0xa749('0x114')](db[_0xa749('0x4c')],{'as':_0xa749('0x1aa'),'foreignKey':'IntervalId'});db[_0xa749('0x84')][_0xa749('0x114')](db[_0xa749('0x56')],{'as':_0xa749('0x1ab'),'foreignKey':'IntervalId'});db[_0xa749('0x8c')][_0xa749('0x120')](db[_0xa749('0x3c')],{});db[_0xa749('0x8c')][_0xa749('0x120')](db[_0xa749('0x9d')],{'foreignKey':'DefaultReportId'});db[_0xa749('0x8c')][_0xa749('0x120')](db[_0xa749('0x9b')],{'foreignKey':_0xa749('0x1ac')});db[_0xa749('0x8d')][_0xa749('0x122')](db[_0xa749('0x19')],{'as':_0xa749('0x1ad'),'through':'moh_has_sounds','onDelete':_0xa749('0x173')});db['Tag'][_0xa749('0x122')](db[_0xa749('0x73')],{'through':'cm_contact_has_tags'});db[_0xa749('0x8f')]['belongsToMany'](db[_0xa749('0x11b')],{'through':_0xa749('0x193')});db[_0xa749('0x8f')][_0xa749('0x122')](db['MailInteraction'],{'through':_0xa749('0x16d')});db['Tag']['belongsToMany'](db[_0xa749('0x58')],{'through':_0xa749('0x185')});db[_0xa749('0x8f')][_0xa749('0x122')](db['FaxInteraction'],{'through':_0xa749('0x17b')});db[_0xa749('0x8f')]['belongsToMany'](db[_0xa749('0x5f')],{'through':_0xa749('0x18b')});db['Tag'][_0xa749('0x122')](db['WhatsappInteraction'],{'through':_0xa749('0x1ae')});db[_0xa749('0x91')]['belongsTo'](db[_0xa749('0x90')],{'as':_0xa749('0x1af'),'foreignKey':_0xa749('0x1b0')});db[_0xa749('0x19b')][_0xa749('0x120')](db[_0xa749('0x75')],{'as':_0xa749('0x1b1'),'foreignKey':_0xa749('0x19d')});db['Trigger'][_0xa749('0x114')](db[_0xa749('0x1a3')],{'as':{'plural':_0xa749('0x1b2'),'singular':_0xa749('0x1b3')},'foreignKey':_0xa749('0x1b4'),'onDelete':_0xa749('0x118'),'hooks':!![]});db['Trigger'][_0xa749('0x114')](db['Condition'],{'as':{'plural':_0xa749('0x1b5'),'singular':'AnyCondition'},'foreignKey':_0xa749('0x1b6'),'onDelete':'cascade','hooks':!![]});db['Trigger'][_0xa749('0x114')](db[_0xa749('0x7f')],{'as':_0xa749('0x1b7'),'foreignKey':_0xa749('0x1b8'),'onDelete':_0xa749('0x118'),'hooks':!![]});db[_0xa749('0x9b')]['hasMany'](db['AnalyticFieldReport'],{'as':'Fields','onDelete':_0xa749('0x118'),'foreignKey':_0xa749('0x1ac'),'hooks':!![]});db['AnalyticDefaultReport'][_0xa749('0x114')](db['AnalyticFieldReport'],{'as':_0xa749('0x1b9'),'onDelete':_0xa749('0x118'),'foreignKey':_0xa749('0x1ba')});db[_0xa749('0xa0')][_0xa749('0x114')](db['AnalyticFieldReport'],{'as':_0xa749('0x1b9'),'onDelete':'cascade','foreignKey':_0xa749('0x1bb')});db['AnalyticFieldReport'][_0xa749('0x120')](db[_0xa749('0xa0')],{'foreignKey':'MetricId'});db[_0xa749('0xa5')][_0xa749('0x114')](db[_0xa749('0x1bc')],{'as':_0xa749('0x1bd'),'onDelete':_0xa749('0x118'),'foreignKey':'AccountId'});db[_0xa749('0x1bc')][_0xa749('0x114')](db[_0xa749('0xa8')],{'as':_0xa749('0x1be'),'onDelete':_0xa749('0x118'),'foreignKey':_0xa749('0x1bf')});db[_0xa749('0x1bc')]['hasMany'](db[_0xa749('0xa8')],{'as':_0xa749('0x1c0'),'onDelete':_0xa749('0x118'),'foreignKey':_0xa749('0x1c1')});db[_0xa749('0x1bc')][_0xa749('0x114')](db[_0xa749('0xa8')],{'as':_0xa749('0x1b9'),'onDelete':_0xa749('0x118'),'foreignKey':'FieldId'});db[_0xa749('0x1bc')][_0xa749('0x120')](db[_0xa749('0xa5')],{'as':_0xa749('0x171'),'foreignKey':_0xa749('0x1c2')});db['SalesforceField'][_0xa749('0x114')](db[_0xa749('0xa8')],{'as':_0xa749('0x1c3'),'foreignKey':_0xa749('0x1bf')});db['SalesforceField'][_0xa749('0x114')](db[_0xa749('0xa8')],{'as':_0xa749('0x1c4'),'foreignKey':_0xa749('0x1c1')});db['SalesforceField'][_0xa749('0x114')](db[_0xa749('0xa8')],{'as':_0xa749('0x1c5'),'foreignKey':_0xa749('0x1c6')});db[_0xa749('0xa8')]['belongsTo'](db[_0xa749('0x1c7')],{'as':_0xa749('0x1c7'),'foreignKey':_0xa749('0x1c8')});db[_0xa749('0xaa')][_0xa749('0x114')](db[_0xa749('0xac')],{'as':_0xa749('0x1bd'),'onDelete':'cascade','foreignKey':_0xa749('0x1c2')});db[_0xa749('0xac')][_0xa749('0x114')](db[_0xa749('0xae')],{'as':_0xa749('0x1be'),'onDelete':_0xa749('0x118'),'foreignKey':'SubjectId'});db[_0xa749('0xac')][_0xa749('0x114')](db[_0xa749('0xae')],{'as':_0xa749('0x1c0'),'onDelete':_0xa749('0x118'),'foreignKey':_0xa749('0x1c1')});db['SugarcrmConfiguration'][_0xa749('0x114')](db[_0xa749('0xae')],{'as':_0xa749('0x1b9'),'onDelete':_0xa749('0x118'),'foreignKey':_0xa749('0x1c6')});db[_0xa749('0xac')][_0xa749('0x120')](db['SugarcrmAccount'],{'as':_0xa749('0x171'),'foreignKey':'AccountId'});db[_0xa749('0xae')]['hasMany'](db[_0xa749('0xae')],{'as':_0xa749('0x1c3'),'foreignKey':_0xa749('0x1bf')});db['SugarcrmField'][_0xa749('0x114')](db['SugarcrmField'],{'as':_0xa749('0x1c4'),'foreignKey':'DescriptionId'});db[_0xa749('0xae')]['hasMany'](db[_0xa749('0xae')],{'as':_0xa749('0x1c5'),'foreignKey':_0xa749('0x1c6')});db[_0xa749('0xae')][_0xa749('0x120')](db[_0xa749('0x1c7')],{'as':'Variable','foreignKey':_0xa749('0x1c8')});db[_0xa749('0xb0')][_0xa749('0x114')](db[_0xa749('0x1c9')],{'as':'Configurations','onDelete':_0xa749('0x118'),'foreignKey':_0xa749('0x1c2')});db[_0xa749('0x1c9')][_0xa749('0x114')](db['DeskField'],{'as':'Subjects','onDelete':'cascade','foreignKey':_0xa749('0x1bf')});db[_0xa749('0x1c9')]['hasMany'](db[_0xa749('0xb2')],{'as':_0xa749('0x1c0'),'onDelete':_0xa749('0x118'),'foreignKey':'DescriptionId'});db[_0xa749('0x1c9')][_0xa749('0x114')](db[_0xa749('0xb2')],{'as':_0xa749('0x1b9'),'onDelete':'cascade','foreignKey':_0xa749('0x1c6')});db[_0xa749('0x1c9')]['belongsTo'](db[_0xa749('0xb0')],{'as':_0xa749('0x171'),'foreignKey':_0xa749('0x1c2')});db['DeskConfiguration'][_0xa749('0x122')](db['Tag'],{'through':_0xa749('0x1ca')});db[_0xa749('0xb2')][_0xa749('0x114')](db['DeskField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0xa749('0xb2')][_0xa749('0x114')](db[_0xa749('0xb2')],{'as':'Description','foreignKey':_0xa749('0x1c1')});db[_0xa749('0xb2')][_0xa749('0x114')](db[_0xa749('0xb2')],{'as':_0xa749('0x1c5'),'foreignKey':_0xa749('0x1c6')});db[_0xa749('0xb2')][_0xa749('0x120')](db[_0xa749('0x1c7')],{'as':_0xa749('0x1c7'),'foreignKey':_0xa749('0x1c8')});db[_0xa749('0x1cb')]['hasMany'](db['ZohoConfiguration'],{'as':_0xa749('0x1bd'),'onDelete':_0xa749('0x118'),'foreignKey':'AccountId'});db[_0xa749('0xb4')][_0xa749('0x114')](db[_0xa749('0x1cc')],{'as':_0xa749('0x1be'),'onDelete':_0xa749('0x118'),'foreignKey':'SubjectId'});db[_0xa749('0xb4')]['hasMany'](db['ZohoField'],{'as':_0xa749('0x1c0'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0xa749('0xb4')][_0xa749('0x114')](db[_0xa749('0x1cc')],{'as':'Fields','onDelete':_0xa749('0x118'),'foreignKey':_0xa749('0x1c6')});db['ZohoConfiguration'][_0xa749('0x120')](db[_0xa749('0x1cb')],{'as':'Account','foreignKey':_0xa749('0x1c2')});db[_0xa749('0x1cc')][_0xa749('0x114')](db[_0xa749('0x1cc')],{'as':_0xa749('0x1c3'),'foreignKey':_0xa749('0x1bf')});db['ZohoField'][_0xa749('0x114')](db[_0xa749('0x1cc')],{'as':_0xa749('0x1c4'),'foreignKey':_0xa749('0x1c1')});db[_0xa749('0x1cc')]['hasMany'](db[_0xa749('0x1cc')],{'as':_0xa749('0x1c5'),'foreignKey':_0xa749('0x1c6')});db['ZohoField'][_0xa749('0x120')](db[_0xa749('0x1c7')],{'as':_0xa749('0x1c7'),'foreignKey':'VariableId'});db['ZendeskAccount'][_0xa749('0x114')](db[_0xa749('0xb8')],{'as':_0xa749('0x1bd'),'onDelete':'cascade','foreignKey':'AccountId'});db['ZendeskConfiguration'][_0xa749('0x114')](db[_0xa749('0xb9')],{'as':_0xa749('0x1be'),'foreignKey':_0xa749('0x1bf')});db['ZendeskConfiguration'][_0xa749('0x114')](db[_0xa749('0xb9')],{'as':'Descriptions','foreignKey':'DescriptionId'});db[_0xa749('0xb8')]['hasMany'](db[_0xa749('0xb9')],{'as':_0xa749('0x1b9'),'foreignKey':'FieldId'});db['ZendeskConfiguration']['belongsTo'](db[_0xa749('0xb6')],{'as':_0xa749('0x171'),'foreignKey':_0xa749('0x1c2')});db['ZendeskConfiguration'][_0xa749('0x122')](db[_0xa749('0x8f')],{'through':'int_zendesk_configuration_has_tags'});db['ZendeskField'][_0xa749('0x114')](db[_0xa749('0xb9')],{'as':_0xa749('0x1c3'),'foreignKey':_0xa749('0x1bf')});db['ZendeskField'][_0xa749('0x114')](db['ZendeskField'],{'as':_0xa749('0x1c4'),'foreignKey':_0xa749('0x1c1')});db['ZendeskField']['hasMany'](db[_0xa749('0xb9')],{'as':'Field','foreignKey':_0xa749('0x1c6')});db[_0xa749('0xb9')][_0xa749('0x120')](db[_0xa749('0x1c7')],{'as':_0xa749('0x1c7'),'foreignKey':'VariableId'});db[_0xa749('0xbb')][_0xa749('0x114')](db[_0xa749('0xbd')],{'as':_0xa749('0x1bd'),'onDelete':_0xa749('0x118'),'foreignKey':_0xa749('0x1c2')});db[_0xa749('0xbd')][_0xa749('0x114')](db[_0xa749('0xbf')],{'as':_0xa749('0x1be'),'onDelete':_0xa749('0x118'),'foreignKey':'SubjectId'});db[_0xa749('0xbd')][_0xa749('0x114')](db['FreshdeskField'],{'as':'Descriptions','onDelete':_0xa749('0x118'),'foreignKey':_0xa749('0x1c1')});db[_0xa749('0xbd')][_0xa749('0x114')](db['FreshdeskField'],{'as':_0xa749('0x1b9'),'onDelete':_0xa749('0x118'),'foreignKey':_0xa749('0x1c6')});db[_0xa749('0xbd')]['belongsTo'](db[_0xa749('0xbb')],{'as':_0xa749('0x171'),'foreignKey':_0xa749('0x1c2')});db[_0xa749('0xbd')]['belongsToMany'](db[_0xa749('0x8f')],{'through':_0xa749('0x1cd')});db[_0xa749('0xbf')][_0xa749('0x114')](db[_0xa749('0xbf')],{'as':_0xa749('0x1c3'),'foreignKey':'SubjectId'});db[_0xa749('0xbf')]['hasMany'](db[_0xa749('0xbf')],{'as':'Description','foreignKey':'DescriptionId'});db[_0xa749('0xbf')][_0xa749('0x114')](db[_0xa749('0xbf')],{'as':_0xa749('0x1c5'),'foreignKey':_0xa749('0x1c6')});db[_0xa749('0xbf')]['belongsTo'](db[_0xa749('0x1c7')],{'as':_0xa749('0x1c7'),'foreignKey':'VariableId'});db[_0xa749('0x1ce')][_0xa749('0x114')](db[_0xa749('0xc2')],{'as':_0xa749('0x1bd'),'onDelete':_0xa749('0x118'),'foreignKey':'AccountId'});db[_0xa749('0xc2')][_0xa749('0x114')](db[_0xa749('0xc3')],{'as':'Subjects','foreignKey':_0xa749('0x1bf')});db[_0xa749('0xc2')][_0xa749('0x114')](db[_0xa749('0xc3')],{'as':_0xa749('0x1c0'),'foreignKey':_0xa749('0x1c1')});db[_0xa749('0xc2')][_0xa749('0x114')](db[_0xa749('0xc3')],{'as':_0xa749('0x1b9'),'foreignKey':_0xa749('0x1c6')});db[_0xa749('0xc2')]['belongsTo'](db[_0xa749('0x1ce')],{'as':'Account','foreignKey':'AccountId'});db[_0xa749('0xc3')][_0xa749('0x114')](db[_0xa749('0xc3')],{'as':_0xa749('0x1c3'),'foreignKey':_0xa749('0x1bf')});db['VtigerField']['hasMany'](db[_0xa749('0xc3')],{'as':_0xa749('0x1c4'),'foreignKey':'DescriptionId'});db[_0xa749('0xc3')]['hasMany'](db[_0xa749('0xc3')],{'as':_0xa749('0x1c5'),'foreignKey':_0xa749('0x1c6')});db[_0xa749('0xc3')]['belongsTo'](db[_0xa749('0x1c7')],{'as':'Variable','foreignKey':_0xa749('0x1c8')});db[_0xa749('0x1cf')][_0xa749('0x114')](db['ServicenowConfiguration'],{'as':'Configurations','onDelete':_0xa749('0x118'),'foreignKey':'AccountId'});db[_0xa749('0xc5')][_0xa749('0x114')](db[_0xa749('0xc7')],{'as':_0xa749('0x1be'),'foreignKey':'SubjectId'});db[_0xa749('0xc5')][_0xa749('0x114')](db['ServicenowField'],{'as':_0xa749('0x1c0'),'foreignKey':'DescriptionId'});db[_0xa749('0xc5')][_0xa749('0x114')](db[_0xa749('0xc7')],{'as':'Fields','foreignKey':_0xa749('0x1c6')});db[_0xa749('0xc5')][_0xa749('0x120')](db[_0xa749('0x1cf')],{'as':'Account','foreignKey':_0xa749('0x1c2')});db[_0xa749('0xc7')]['hasMany'](db['ServicenowField'],{'as':'Subject','foreignKey':_0xa749('0x1bf')});db['ServicenowField'][_0xa749('0x114')](db['ServicenowField'],{'as':_0xa749('0x1c4'),'foreignKey':_0xa749('0x1c1')});db[_0xa749('0xc7')][_0xa749('0x114')](db[_0xa749('0xc7')],{'as':_0xa749('0x1c5'),'foreignKey':'FieldId'});db[_0xa749('0xc7')][_0xa749('0x120')](db['Variable'],{'as':_0xa749('0x1c7'),'foreignKey':'VariableId'});db['Dynamics365Account'][_0xa749('0x114')](db[_0xa749('0x1d0')],{'as':_0xa749('0x1bd'),'onDelete':_0xa749('0x118'),'foreignKey':_0xa749('0x1c2')});db[_0xa749('0x1d0')][_0xa749('0x114')](db['Dynamics365Field'],{'as':_0xa749('0x1be'),'onDelete':_0xa749('0x118'),'foreignKey':_0xa749('0x1bf')});db['Dynamics365Configuration']['hasMany'](db[_0xa749('0x1d1')],{'as':'Descriptions','onDelete':_0xa749('0x118'),'foreignKey':_0xa749('0x1c1')});db['Dynamics365Configuration']['hasMany'](db[_0xa749('0x1d1')],{'as':_0xa749('0x1b9'),'onDelete':_0xa749('0x118'),'foreignKey':'FieldId'});db[_0xa749('0x1d0')][_0xa749('0x120')](db['Dynamics365Account'],{'as':'Account','foreignKey':_0xa749('0x1c2')});db['Dynamics365Field'][_0xa749('0x114')](db[_0xa749('0x1d1')],{'as':_0xa749('0x1c3'),'foreignKey':'SubjectId'});db[_0xa749('0x1d1')][_0xa749('0x114')](db[_0xa749('0x1d1')],{'as':_0xa749('0x1c4'),'foreignKey':_0xa749('0x1c1')});db[_0xa749('0x1d1')][_0xa749('0x114')](db['Dynamics365Field'],{'as':_0xa749('0x1c5'),'foreignKey':'FieldId'});db['Dynamics365Field'][_0xa749('0x120')](db[_0xa749('0x1c7')],{'as':_0xa749('0x1c7'),'foreignKey':_0xa749('0x1c8')});db[_0xa749('0xcd')][_0xa749('0x114')](db['FreshsalesConfiguration'],{'as':_0xa749('0x1bd'),'onDelete':_0xa749('0x118'),'foreignKey':'AccountId'});db[_0xa749('0xcf')]['hasMany'](db[_0xa749('0xd1')],{'as':_0xa749('0x1be'),'foreignKey':_0xa749('0x1bf')});db['FreshsalesConfiguration'][_0xa749('0x114')](db[_0xa749('0xd1')],{'as':_0xa749('0x1c0'),'foreignKey':'DescriptionId'});db[_0xa749('0xcf')]['hasMany'](db[_0xa749('0xd1')],{'as':_0xa749('0x1b9'),'foreignKey':_0xa749('0x1c6')});db[_0xa749('0xcf')]['belongsTo'](db[_0xa749('0xcd')],{'as':_0xa749('0x171'),'foreignKey':_0xa749('0x1c2')});db['FreshsalesField'][_0xa749('0x114')](db[_0xa749('0xd1')],{'as':_0xa749('0x1c3'),'foreignKey':'SubjectId'});db[_0xa749('0xd1')][_0xa749('0x114')](db[_0xa749('0xd1')],{'as':'Description','foreignKey':_0xa749('0x1c1')});db[_0xa749('0xd1')][_0xa749('0x114')](db[_0xa749('0xd1')],{'as':'Field','foreignKey':_0xa749('0x1c6')});db['FreshsalesField']['belongsTo'](db[_0xa749('0x1c7')],{'as':_0xa749('0x1c7'),'foreignKey':_0xa749('0x1c8')});db[_0xa749('0xd4')][_0xa749('0x120')](db[_0xa749('0x64')],{});db[_0xa749('0xd4')][_0xa749('0x120')](db[_0xa749('0xf8')],{'as':_0xa749('0x165'),'foreignKey':_0xa749('0x166')});db['ChatQueueReport'][_0xa749('0x120')](db['CmContact'],{'as':_0xa749('0x15c'),'foreignKey':'ContactId'});db[_0xa749('0xd4')][_0xa749('0x120')](db[_0xa749('0x11b')],{});db[_0xa749('0xd4')][_0xa749('0x120')](db[_0xa749('0x195')],{});db['ChatQueueReport'][_0xa749('0x120')](db[_0xa749('0x110')],{});db[_0xa749('0xd4')][_0xa749('0x120')](db[_0xa749('0x6d')],{});db[_0xa749('0xd6')][_0xa749('0x120')](db[_0xa749('0x110')],{'onDelete':_0xa749('0x118'),'foreignKey':'FromId'});db['ChatInternalMessage'][_0xa749('0x120')](db[_0xa749('0x110')],{'onDelete':_0xa749('0x118'),'foreignKey':'ToId'});db[_0xa749('0xdc')][_0xa749('0x114')](db[_0xa749('0xda')],{'foreignKey':_0xa749('0x1d2'),'onDelete':_0xa749('0x118')});db['JscriptySessionReport']['hasMany'](db[_0xa749('0xd8')],{'foreignKey':_0xa749('0x1d2'),'onDelete':_0xa749('0x118')});db['SmsQueueReport'][_0xa749('0x120')](db[_0xa749('0x54')],{});db[_0xa749('0xde')]['belongsTo'](db[_0xa749('0xf8')],{'as':_0xa749('0x165'),'foreignKey':_0xa749('0x166')});db[_0xa749('0xde')][_0xa749('0x120')](db['CmContact'],{'as':'Contact','foreignKey':_0xa749('0x15d')});db['SmsQueueReport'][_0xa749('0x120')](db[_0xa749('0x58')],{});db[_0xa749('0xde')][_0xa749('0x120')](db[_0xa749('0x182')],{});db[_0xa749('0xde')][_0xa749('0x120')](db['User'],{});db[_0xa749('0xde')][_0xa749('0x120')](db[_0xa749('0x183')],{});db[_0xa749('0x1d3')]['hasMany'](db['JscriptySessionReport'],{'foreignKey':_0xa749('0x1d4')});db[_0xa749('0x1d3')][_0xa749('0x114')](db[_0xa749('0xda')],{'foreignKey':_0xa749('0x1d4')});db[_0xa749('0x1d3')]['hasMany'](db[_0xa749('0xd8')],{'foreignKey':_0xa749('0x1d4')});db[_0xa749('0xe6')][_0xa749('0x122')](db[_0xa749('0x110')],{'as':_0xa749('0x17d'),'through':_0xa749('0x144')});db['Team']['belongsToMany'](db[_0xa749('0x110')],{'as':_0xa749('0x16a'),'through':'user_has_teams'});db['Team']['belongsToMany'](db['VoiceQueue'],{'through':'TeamVoiceQueue','as':_0xa749('0x1d5')});db[_0xa749('0x127')][_0xa749('0x122')](db[_0xa749('0x3d')],{'through':'team_has_mail_queues','as':_0xa749('0x130')});db[_0xa749('0x127')][_0xa749('0x122')](db[_0xa749('0x6d')],{'through':'team_has_chat_queues','as':'ChatQueues'});db[_0xa749('0x127')][_0xa749('0x122')](db['FaxQueue'],{'through':_0xa749('0x17f'),'as':'FaxQueues'});db['Team'][_0xa749('0x122')](db[_0xa749('0x183')],{'through':'team_has_sms_queues','as':'SmsQueues'});db['Team'][_0xa749('0x122')](db[_0xa749('0x62')],{'through':'team_has_openchannel_queues','as':'OpenchannelQueues'});db[_0xa749('0x127')][_0xa749('0x122')](db[_0xa749('0x109')],{'through':_0xa749('0x1d6'),'as':_0xa749('0x136')});db['Campaign'][_0xa749('0x114')](db[_0xa749('0x75')],{'as':_0xa749('0x147'),'foreignKey':'CampaignId'});db[_0xa749('0xec')]['hasMany'](db[_0xa749('0x149')],{'as':_0xa749('0x119'),'foreignKey':_0xa749('0x19f')});db['Campaign'][_0xa749('0x114')](db[_0xa749('0x7a')],{'as':_0xa749('0x14a'),'foreignKey':_0xa749('0x19f')});db['Campaign']['hasMany'](db['CmHopperBlack'],{'as':_0xa749('0x14b'),'foreignKey':_0xa749('0x19f')});db['Campaign']['belongsTo'](db[_0xa749('0x28')],{'as':_0xa749('0x28'),'foreignKey':_0xa749('0x14d')});db[_0xa749('0xec')][_0xa749('0x120')](db[_0xa749('0x28')],{'as':_0xa749('0x14e'),'foreignKey':_0xa749('0x1d7')});db[_0xa749('0xec')][_0xa749('0x120')](db[_0xa749('0x84')],{'as':'Interval','foreignKey':_0xa749('0x14f')});db[_0xa749('0xec')]['belongsTo'](db[_0xa749('0xe6')],{'as':'SquareProject','foreignKey':_0xa749('0x1d8')});db['Campaign'][_0xa749('0x122')](db['CmList'],{'as':_0xa749('0x1d9'),'through':_0xa749('0x1da')});db[_0xa749('0xec')][_0xa749('0x122')](db['CmList'],{'as':_0xa749('0x153'),'through':_0xa749('0x1db')});db[_0xa749('0xee')]['belongsTo'](db[_0xa749('0x6b')],{'as':_0xa749('0x6b'),'foreignKey':_0xa749('0x1dc')});db[_0xa749('0xf2')][_0xa749('0x120')](db[_0xa749('0x42')],{});db[_0xa749('0xf2')][_0xa749('0x120')](db['MailInteraction'],{});db['MailTransferReport']['belongsTo'](db['MailAccount'],{'foreignKey':'FromMailAccountId','as':_0xa749('0x1dd')});db[_0xa749('0xf2')]['belongsTo'](db[_0xa749('0x110')],{'foreignKey':_0xa749('0x1de'),'as':_0xa749('0x1df')});db[_0xa749('0xf2')][_0xa749('0x120')](db[_0xa749('0x110')],{'foreignKey':_0xa749('0x1e0'),'as':_0xa749('0x1e1')});db[_0xa749('0xf2')]['belongsTo'](db[_0xa749('0x3d')],{'foreignKey':_0xa749('0x1e2'),'as':_0xa749('0x1e3')});db[_0xa749('0xf2')][_0xa749('0x120')](db['MailAccount'],{'foreignKey':'ToMailAccountId','as':'ToAccount'});db[_0xa749('0xf4')][_0xa749('0x120')](db[_0xa749('0x195')],{});db[_0xa749('0xf4')][_0xa749('0x120')](db['ChatInteraction'],{});db['ChatTransferReport'][_0xa749('0x120')](db[_0xa749('0x64')],{'foreignKey':_0xa749('0x1e4'),'as':_0xa749('0x1dd')});db[_0xa749('0xf4')][_0xa749('0x120')](db['User'],{'foreignKey':'FromUserId','as':_0xa749('0x1df')});db[_0xa749('0xf4')][_0xa749('0x120')](db['User'],{'foreignKey':_0xa749('0x1e0'),'as':_0xa749('0x1e1')});db[_0xa749('0xf4')][_0xa749('0x120')](db[_0xa749('0x6d')],{'foreignKey':_0xa749('0x1e5'),'as':_0xa749('0x1e3')});db['ChatTransferReport'][_0xa749('0x120')](db[_0xa749('0x64')],{'foreignKey':_0xa749('0x1e6'),'as':_0xa749('0x1e7')});db[_0xa749('0xf5')][_0xa749('0x120')](db['FaxMessage'],{});db[_0xa749('0xf5')]['belongsTo'](db[_0xa749('0x4e')],{});db[_0xa749('0xf5')]['belongsTo'](db[_0xa749('0x4a')],{'foreignKey':_0xa749('0x1e8'),'as':_0xa749('0x1dd')});db['FaxTransferReport'][_0xa749('0x120')](db[_0xa749('0x110')],{'foreignKey':_0xa749('0x1de'),'as':'FromAgent'});db[_0xa749('0xf5')][_0xa749('0x120')](db[_0xa749('0x110')],{'foreignKey':_0xa749('0x1e0'),'as':_0xa749('0x1e1')});db[_0xa749('0xf5')][_0xa749('0x120')](db[_0xa749('0x51')],{'foreignKey':_0xa749('0x1e9'),'as':_0xa749('0x1e3')});db['FaxTransferReport']['belongsTo'](db[_0xa749('0x4a')],{'foreignKey':_0xa749('0x1ea'),'as':_0xa749('0x1e7')});db[_0xa749('0xf7')][_0xa749('0x120')](db['OpenchannelMessage'],{});db[_0xa749('0xf7')][_0xa749('0x120')](db[_0xa749('0x5f')],{});db[_0xa749('0xf7')][_0xa749('0x120')](db[_0xa749('0x5c')],{'foreignKey':'FromOpenchannelAccountId','as':_0xa749('0x1dd')});db['OpenchannelTransferReport'][_0xa749('0x120')](db['User'],{'foreignKey':_0xa749('0x1de'),'as':_0xa749('0x1df')});db[_0xa749('0xf7')][_0xa749('0x120')](db[_0xa749('0x110')],{'foreignKey':_0xa749('0x1e0'),'as':_0xa749('0x1e1')});db[_0xa749('0xf7')][_0xa749('0x120')](db['OpenchannelQueue'],{'foreignKey':_0xa749('0x1eb'),'as':_0xa749('0x1e3')});db['OpenchannelTransferReport'][_0xa749('0x120')](db[_0xa749('0x5c')],{'foreignKey':_0xa749('0x1ec'),'as':_0xa749('0x1e7')});db['SmsTransferReport']['belongsTo'](db[_0xa749('0x182')],{});db[_0xa749('0x1ed')][_0xa749('0x120')](db[_0xa749('0x58')],{});db[_0xa749('0x1ed')][_0xa749('0x120')](db[_0xa749('0x54')],{'foreignKey':_0xa749('0x1ee'),'as':'FromAccount'});db[_0xa749('0x1ed')]['belongsTo'](db['User'],{'foreignKey':_0xa749('0x1de'),'as':'FromAgent'});db[_0xa749('0x1ed')][_0xa749('0x120')](db[_0xa749('0x110')],{'foreignKey':_0xa749('0x1e0'),'as':_0xa749('0x1e1')});db[_0xa749('0x1ed')][_0xa749('0x120')](db[_0xa749('0x183')],{'foreignKey':'ToSmsQueueId','as':_0xa749('0x1e3')});db[_0xa749('0x1ed')][_0xa749('0x120')](db[_0xa749('0x54')],{'foreignKey':_0xa749('0x1ef'),'as':_0xa749('0x1e7')});db[_0xa749('0xf8')][_0xa749('0x114')](db[_0xa749('0x162')],{'as':_0xa749('0x163'),'foreignKey':_0xa749('0x166'),'onDelete':_0xa749('0x118')});db[_0xa749('0xf8')][_0xa749('0x114')](db[_0xa749('0x7d')],{'as':'CustomFields','foreignKey':_0xa749('0x166')});db[_0xa749('0xf8')][_0xa749('0x114')](db[_0xa749('0x73')],{'as':_0xa749('0x125'),'onDelete':_0xa749('0x118'),'foreignKey':'ListId'});db['CmList'][_0xa749('0x114')](db[_0xa749('0x149')],{'as':_0xa749('0x119'),'foreignKey':'ListId'});db[_0xa749('0xf8')][_0xa749('0x114')](db[_0xa749('0x7a')],{'as':_0xa749('0x1f0'),'foreignKey':_0xa749('0x166')});db[_0xa749('0xf8')][_0xa749('0x114')](db['ReportAgentPreview'],{'as':_0xa749('0x7c'),'foreignKey':_0xa749('0x166')});db[_0xa749('0xf8')][_0xa749('0x122')](db[_0xa749('0x1b')],{'as':_0xa749('0x1f1'),'through':_0xa749('0x151')});db[_0xa749('0xf8')][_0xa749('0x122')](db[_0xa749('0x110')],{'as':_0xa749('0x16a'),'through':'cm_user_has_lists'});db[_0xa749('0x138')][_0xa749('0x114')](db[_0xa749('0x116')],{'as':'Extensions','onDelete':'cascade'});db[_0xa749('0x138')][_0xa749('0x122')](db[_0xa749('0x110')],{'as':_0xa749('0x16a'),'through':'user_has_voice_prefixes'});db[_0xa749('0xfb')][_0xa749('0x114')](db[_0xa749('0x110')],{'as':_0xa749('0x17d'),'foreignKey':_0xa749('0x121')});db[_0xa749('0xfb')][_0xa749('0x114')](db['UserProfileSection'],{'as':_0xa749('0x1f2'),'foreignKey':'userProfileId','onDelete':_0xa749('0x118')});db[_0xa749('0x1f3')][_0xa749('0x114')](db[_0xa749('0xfc')],{'as':_0xa749('0x1f4'),'foreignKey':'sectionId','onDelete':_0xa749('0x118')});db[_0xa749('0x100')]['hasMany'](db[_0xa749('0x162')],{'as':_0xa749('0x163'),'foreignKey':'WhatsappAccountId','onDelete':_0xa749('0x118')});db[_0xa749('0x100')]['hasMany'](db['CannedAnswer'],{'as':_0xa749('0x175'),'foreignKey':_0xa749('0x1f5')});db[_0xa749('0x100')][_0xa749('0x114')](db['WhatsappMessage'],{'as':_0xa749('0x155'),'foreignKey':_0xa749('0x1f5')});db[_0xa749('0x100')][_0xa749('0x114')](db[_0xa749('0x103')],{'as':_0xa749('0x164')});db[_0xa749('0x100')][_0xa749('0x114')](db[_0xa749('0x102')],{'as':_0xa749('0x145')});db['WhatsappAccount'][_0xa749('0x120')](db[_0xa749('0xf8')],{'as':_0xa749('0x165'),'foreignKey':_0xa749('0x166')});db[_0xa749('0x100')][_0xa749('0x120')](db[_0xa749('0x86')],{'as':_0xa749('0x150'),'foreignKey':_0xa749('0x169')});db['WhatsappAccount']['belongsToMany'](db[_0xa749('0x110')],{'as':'Agents','through':_0xa749('0x142')});db[_0xa749('0x102')]['belongsTo'](db[_0xa749('0x110')],{'onDelete':_0xa749('0x173')});db['WhatsappApplication'][_0xa749('0x120')](db[_0xa749('0x109')],{'onDelete':_0xa749('0x173')});db[_0xa749('0x102')][_0xa749('0x120')](db[_0xa749('0x100')],{'onDelete':_0xa749('0x173')});db['WhatsappApplication'][_0xa749('0x120')](db[_0xa749('0x84')],{'onDelete':'restrict','foreignKey':_0xa749('0x14f')});db[_0xa749('0x102')][_0xa749('0x120')](db[_0xa749('0x8f')],{'onDelete':_0xa749('0x173'),'foreignKey':_0xa749('0x174')});db[_0xa749('0x103')][_0xa749('0x114')](db[_0xa749('0x1f6')],{'as':_0xa749('0x155'),'onDelete':_0xa749('0x118'),'foreignKey':_0xa749('0x1f7')});db[_0xa749('0x103')][_0xa749('0x120')](db['WhatsappAccount'],{'as':_0xa749('0x171'),'foreignKey':_0xa749('0x1f5')});db['WhatsappInteraction'][_0xa749('0x120')](db[_0xa749('0x73')],{'as':'Contact','foreignKey':_0xa749('0x15d')});db[_0xa749('0x103')]['belongsTo'](db[_0xa749('0x110')],{'as':_0xa749('0x16c'),'foreignKey':_0xa749('0x113')});db['WhatsappInteraction'][_0xa749('0x122')](db[_0xa749('0x8f')],{'through':_0xa749('0x1ae'),'as':_0xa749('0x17c')});db[_0xa749('0x103')][_0xa749('0x122')](db[_0xa749('0x8f')],{'through':_0xa749('0x1ae'),'as':_0xa749('0x16e')});db[_0xa749('0x103')][_0xa749('0x122')](db[_0xa749('0x110')],{'as':_0xa749('0x17d'),'through':_0xa749('0x12f'),'foreignKey':_0xa749('0x1f7')});db[_0xa749('0x1f6')][_0xa749('0x120')](db[_0xa749('0x110')],{'as':'User'});db[_0xa749('0x1f6')][_0xa749('0x120')](db['CmContact'],{'onDelete':'cascade','as':_0xa749('0x15c')});db[_0xa749('0x1f6')][_0xa749('0x120')](db[_0xa749('0x103')],{'onDelete':_0xa749('0x118'),'as':_0xa749('0x170'),'foreignKey':_0xa749('0x1f7')});db[_0xa749('0x1f6')][_0xa749('0x120')](db['WhatsappAccount'],{'as':_0xa749('0x171'),'foreignKey':'WhatsappAccountId'});db[_0xa749('0x105')][_0xa749('0x120')](db[_0xa749('0x100')],{});db[_0xa749('0x105')][_0xa749('0x120')](db[_0xa749('0xf8')],{'as':_0xa749('0x165'),'foreignKey':_0xa749('0x166')});db['WhatsappQueueReport'][_0xa749('0x120')](db[_0xa749('0x73')],{'as':_0xa749('0x15c'),'foreignKey':'ContactId'});db['WhatsappQueueReport'][_0xa749('0x120')](db[_0xa749('0x103')],{});db[_0xa749('0x105')]['belongsTo'](db[_0xa749('0x109')],{});db[_0xa749('0x105')]['belongsTo'](db['WhatsappMessage'],{});db[_0xa749('0x105')][_0xa749('0x120')](db[_0xa749('0x110')],{});db['WhatsappTransferReport'][_0xa749('0x120')](db['WhatsappMessage'],{});db[_0xa749('0x107')][_0xa749('0x120')](db[_0xa749('0x103')],{});db[_0xa749('0x107')][_0xa749('0x120')](db[_0xa749('0x100')],{'foreignKey':_0xa749('0x1f8'),'as':'FromAccount'});db[_0xa749('0x107')][_0xa749('0x120')](db[_0xa749('0x100')],{'foreignKey':'ToWhatsappAccountId','as':_0xa749('0x1e7')});db[_0xa749('0x107')][_0xa749('0x120')](db[_0xa749('0x109')],{'foreignKey':'ToQueueId','as':_0xa749('0x1e3')});db[_0xa749('0x107')][_0xa749('0x120')](db[_0xa749('0x110')],{'foreignKey':_0xa749('0x1de'),'as':_0xa749('0x1df')});db[_0xa749('0x107')]['belongsTo'](db[_0xa749('0x110')],{'foreignKey':_0xa749('0x1e0'),'as':_0xa749('0x1e1')});db['WhatsappQueue']['belongsToMany'](db[_0xa749('0x110')],{'as':'Agents','through':'UserWhatsappQueue','foreignKey':_0xa749('0x1f9')});db['WhatsappQueue'][_0xa749('0x122')](db[_0xa749('0x127')],{'through':_0xa749('0x1d6'),'as':'Teams'});module[_0xa749('0x1fa')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xea0f=['ProactiveActions','Agent','Queue','ChatQueueId','chat_interaction_has_tags','team_has_chat_queues','ChatInternalMessage','ChatGroupId','CmCompany','Contacts','CmContactId','Hoppers','HopperHistories','Company','cm_contact_has_tags','CmHopperId','OwnerId','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','Action','AutomationId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','AnalyticCustomReport','CustomReportId','Sound','Mohs','whatsapp_interaction_has_tags','ItemTypeId','Hopper','AllCondition','TriggerAllId','AnyConditions','AnyCondition','Actions','TriggerId','AnalyticFieldReport','DefaultReportId','Fields','MetricId','SalesforceConfiguration','Configurations','Subjects','Descriptions','DescriptionId','AccountId','Description','Field','FieldId','SugarcrmField','Subject','SubjectId','VariableId','int_desk_configuration_has_tags','int_zendesk_configuration_has_tags','FreshdeskConfiguration','FreshdeskField','int_freshdesk_configuration_has_tags','VtigerField','ServicenowAccount','Dynamics365Configuration','FromId','ToId','SessionId','SmsQueueReport','ProjectId','team_has_mail_queues','MailQueues','team_has_whatsapp_queues','WhatsappQueues','CampaignId','SquareProjectId','Lists','campaigns_has_cm_lists','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromUserId','FromAgent','ToAgent','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','FromAccount','ToUserId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','SmsTransferReport','FromSmsAccountId','ToSmsQueueId','CmCustomField','CustomFields','Queues','userProfileId','UserProfileSections','Resources','sectionId','WhatsappAccountId','user_has_whatsapp_interactions','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','exports','path','../config/environment','sequelize','determine','defaultsDeep','xcall','xC@LL1234','127.0.0.1','mysql','name','utf8_general_ci','sequelizeHistory','motion2','utf8','database','username','options','password','User','import','../api/user/user.model','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','VoiceCallReport','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','../api/userVoiceQueueRt/userVoiceQueueRt.model','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','../api/mailQueue/mailQueue.model','MailSubstatus','MailInteraction','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','MailQueueReport','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','../api/faxAccount/faxAccount.model','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','../api/faxQueue/faxQueue.model','../api/faxQueueReport/faxQueueReport.model','SmsAccount','SmsApplication','SmsInteraction','../api/smsInteraction/smsInteraction.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','../api/action/action.model','Automation','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','CmContactHasItem','../api/cmContactHasItem/cmContactHasItem.model','CmHopperAdditionalPhone','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','AnalyticMetric','../api/analyticMetric/analyticMetric.model','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','../api/intVtigerField/intVtigerField.model','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','../api/smsQueueReport/smsQueueReport.model','../api/squareReport/squareReport.model','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','Team','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','Plugin','../api/plugin/plugin.model','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','FaxTransferReport','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','../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','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','CloudProvider','Realtime','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','hasOne','cascade','UserId','Recordings','hasMany','VoiceQueuesRt','Extensions','HopperFinals','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteractions','WhatsappInteraction','WhatsappInteractions','UserNotifications','SenderId','belongsTo','UserProfile','belongsToMany','CmContact','cm_user_has_contacts','cm_user_has_lists','user_has_teams','MailInteractions','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','VoiceQueue','VoiceQueues','UserVoiceQueue','MailQueue','ChatQueues','UserChatQueue','FaxQueue','FaxQueues','SmsQueue','SmsQueues','OpenchannelQueues','UserOpenchannelQueue','VoicePrefixes','user_has_voice_prefixes','ChatWebsites','user_has_chat_websites','FaxAccount','FaxAccounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProject','SquareProjects','user_has_square_projects','VoiceChanSpy','SpiedAgents','ChanSpyId','Sounds','UserVoiceQueueRt','Members','VoiceQueueId','CmHopper','HopperBlacks','JscriptySessions','Trunk','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','Pause','mandatoryDispositionPause','mandatoryDispositionPauseId','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','ScreenRecording','Messages','mailboxuser','mailbox','uniqueid','AgentReports','Contact','ContactId','MailAccountId','MailServerOut','Smtp','Disposition','CannedAnswer','Answers','Applications','List','TemplateId','MailInteractionId','Account','Owner','mail_interaction_has_tags','Tags','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessageId','restrict','TagId','ListId','Items','Dispositions','FaxAccountId','Interactions','Exntensions','FaxMessage','user_has_fax_accounts','FaxApplication','fax_interaction_has_tags','ThroughTags','Users','FaxInteractionId','AttachmentId','team_has_fax_queues','FaxQueueReport','SmsAccountId','SmsMessage','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelApplication','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues'];(function(_0x5b11c3,_0x126c21){var _0x586d00=function(_0x4e87b8){while(--_0x4e87b8){_0x5b11c3['push'](_0x5b11c3['shift']());}};_0x586d00(++_0x126c21);}(_0xea0f,0x73));var _0xfea0=function(_0x3bac1a,_0x2eb517){_0x3bac1a=_0x3bac1a-0x0;var _0x275ac1=_0xea0f[_0x3bac1a];return _0x275ac1;};'use strict';var path=require(_0xfea0('0x0'));var config=require(_0xfea0('0x1'));var Sequelize=require(_0xfea0('0x2'));var _=require('lodash');var jstz=require('jstz');var timezone=jstz[_0xfea0('0x3')]();config[_0xfea0('0x2')]=_[_0xfea0('0x4')](config['sequelize'],{'database':'motion2','username':_0xfea0('0x5'),'password':_0xfea0('0x6'),'options':{'host':_0xfea0('0x7'),'port':0xcea,'dialect':_0xfea0('0x8'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0xfea0('0x9')](),'define':{'charset':'utf8','collate':_0xfea0('0xa')}}});config[_0xfea0('0xb')]=_[_0xfea0('0x4')](config[_0xfea0('0xb')],{'database':_0xfea0('0xc'),'username':_0xfea0('0x5'),'password':_0xfea0('0x6'),'options':{'host':_0xfea0('0x7'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0xfea0('0x9')](),'define':{'charset':_0xfea0('0xd'),'collate':_0xfea0('0xa')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize'][_0xfea0('0xe')],config[_0xfea0('0x2')][_0xfea0('0xf')],config[_0xfea0('0x2')]['password'],config[_0xfea0('0x2')][_0xfea0('0x10')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xfea0('0xb')][_0xfea0('0xe')],config[_0xfea0('0xb')]['username'],config['sequelizeHistory'][_0xfea0('0x11')],config[_0xfea0('0xb')][_0xfea0('0x10')])};db[_0xfea0('0x12')]=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0x14'));db['VoiceChanSpy']=db['sequelize'][_0xfea0('0x13')](_0xfea0('0x15'));db[_0xfea0('0x16')]=db[_0xfea0('0x2')]['import'](_0xfea0('0x17'));db[_0xfea0('0x18')]=db[_0xfea0('0x2')][_0xfea0('0x13')]('../api/voiceExtension/voiceExtension.model');db[_0xfea0('0x19')]=db['sequelize']['import'](_0xfea0('0x1a'));db['VoiceQueue']=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0x1b'));db[_0xfea0('0x1c')]=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0x1d'));db['ScreenRecording']=db['sequelize'][_0xfea0('0x13')](_0xfea0('0x1e'));db[_0xfea0('0x1f')]=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0x20'));db[_0xfea0('0x21')]=db[_0xfea0('0x2')][_0xfea0('0x13')]('../api/voiceMailMessage/voiceMailMessage.model');db[_0xfea0('0x22')]=db[_0xfea0('0x2')][_0xfea0('0x13')]('../api/voiceCallReport/voiceCallReport.model');db[_0xfea0('0x23')]=db[_0xfea0('0x2')]['import'](_0xfea0('0x24'));db[_0xfea0('0x25')]=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0x26'));db[_0xfea0('0x27')]=db['sequelize'][_0xfea0('0x13')](_0xfea0('0x28'));db['MemberReport']=db['sequelize'][_0xfea0('0x13')]('../api/memberReport/memberReport.model');db['Trunk']=db[_0xfea0('0x2')]['import'](_0xfea0('0x29'));db[_0xfea0('0x2a')]=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0x2b'));db['UserVoiceQueueRt']=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0x2c'));db['UserVoiceQueue']=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0x2d'));db['UserChatQueue']=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0x2e'));db[_0xfea0('0x2f')]=db[_0xfea0('0x2')][_0xfea0('0x13')]('../api/userMailQueue/userMailQueue.model');db['UserFaxQueue']=db[_0xfea0('0x2')]['import'](_0xfea0('0x30'));db[_0xfea0('0x31')]=db['sequelize']['import'](_0xfea0('0x32'));db['UserOpenchannelQueue']=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0x33'));db[_0xfea0('0x34')]=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0x35'));db[_0xfea0('0x36')]=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0x37'));db['MailServerOut']=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0x38'));db[_0xfea0('0x39')]=db['sequelize']['import'](_0xfea0('0x3a'));db['MailQueue']=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0x3b'));db[_0xfea0('0x3c')]=db[_0xfea0('0x2')][_0xfea0('0x13')]('../api/mailSubstatus/mailSubstatus.model');db[_0xfea0('0x3d')]=db[_0xfea0('0x2')]['import']('../api/mailInteraction/mailInteraction.model');db[_0xfea0('0x3e')]=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0x3f'));db[_0xfea0('0x40')]=db[_0xfea0('0x2')][_0xfea0('0x13')]('../api/mailApplication/mailApplication.model');db[_0xfea0('0x41')]=db[_0xfea0('0x2')]['import']('../api/mailQueueReport/mailQueueReport.model');db[_0xfea0('0x42')]=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0x43'));db[_0xfea0('0x44')]=db['sequelize'][_0xfea0('0x13')](_0xfea0('0x45'));db['FaxAccount']=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0x46'));db['FaxApplication']=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0x47'));db[_0xfea0('0x48')]=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0x49'));db['FaxMessage']=db[_0xfea0('0x2')]['import']('../api/faxMessage/faxMessage.model');db['FaxQueue']=db['sequelize'][_0xfea0('0x13')](_0xfea0('0x4a'));db['FaxQueueReport']=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0x4b'));db[_0xfea0('0x4c')]=db[_0xfea0('0x2')][_0xfea0('0x13')]('../api/smsAccount/smsAccount.model');db[_0xfea0('0x4d')]=db[_0xfea0('0x2')]['import']('../api/smsApplication/smsApplication.model');db[_0xfea0('0x4e')]=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0x4f'));db['SmsMessage']=db[_0xfea0('0x2')][_0xfea0('0x13')]('../api/smsMessage/smsMessage.model');db['SmsQueue']=db[_0xfea0('0x2')][_0xfea0('0x13')]('../api/smsQueue/smsQueue.model');db[_0xfea0('0x50')]=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0x51'));db['OpenchannelApplication']=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0x52'));db[_0xfea0('0x53')]=db[_0xfea0('0x2')]['import']('../api/openchannelInteraction/openchannelInteraction.model');db[_0xfea0('0x54')]=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0x55'));db[_0xfea0('0x56')]=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0x57'));db[_0xfea0('0x58')]=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0x59'));db[_0xfea0('0x5a')]=db['sequelize'][_0xfea0('0x13')](_0xfea0('0x5b'));db[_0xfea0('0x5c')]=db['sequelize']['import'](_0xfea0('0x5d'));db[_0xfea0('0x5e')]=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0x5f'));db[_0xfea0('0x60')]=db[_0xfea0('0x2')]['import'](_0xfea0('0x61'));db[_0xfea0('0x62')]=db['sequelize'][_0xfea0('0x13')](_0xfea0('0x63'));db[_0xfea0('0x64')]=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0x65'));db[_0xfea0('0x66')]=db[_0xfea0('0x2')]['import']('../api/chatGroup/chatGroup.model');db[_0xfea0('0x67')]=db[_0xfea0('0x2')]['import'](_0xfea0('0x68'));db['CmCompany']=db[_0xfea0('0x2')]['import'](_0xfea0('0x69'));db['CmContact']=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0x6a'));db['CmHopper']=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0x6b'));db[_0xfea0('0x6c')]=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0x6d'));db[_0xfea0('0x6e')]=db['sequelize']['import'](_0xfea0('0x6f'));db[_0xfea0('0x70')]=db[_0xfea0('0x2')][_0xfea0('0x13')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0xfea0('0x71')]=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0x72'));db['CmCustomField']=db[_0xfea0('0x2')][_0xfea0('0x13')]('../api/cmCustomField/cmCustomField.model');db['Action']=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0x73'));db[_0xfea0('0x74')]=db['sequelize'][_0xfea0('0x13')](_0xfea0('0x75'));db['CannedAnswer']=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0x76'));db['Disposition']=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0x77'));db[_0xfea0('0x78')]=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0x79'));db[_0xfea0('0x7a')]=db[_0xfea0('0x2')]['import']('../api/interval/interval.model');db['Pause']=db['sequelize'][_0xfea0('0x13')](_0xfea0('0x7b'));db[_0xfea0('0x7c')]=db['sequelize'][_0xfea0('0x13')](_0xfea0('0x7d'));db[_0xfea0('0x7e')]=db[_0xfea0('0x2')]['import'](_0xfea0('0x7f'));db[_0xfea0('0x80')]=db['sequelize'][_0xfea0('0x13')]('../api/schedule/schedule.model');db['Sound']=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0x81'));db[_0xfea0('0x82')]=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0x83'));db[_0xfea0('0x84')]=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0x85'));db[_0xfea0('0x86')]=db['sequelize'][_0xfea0('0x13')](_0xfea0('0x87'));db[_0xfea0('0x88')]=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0x89'));db[_0xfea0('0x8a')]=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0x8b'));db[_0xfea0('0x8c')]=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0x8d'));db[_0xfea0('0x8e')]=db[_0xfea0('0x2')][_0xfea0('0x13')]('../api/variable/variable.model');db[_0xfea0('0x8f')]=db[_0xfea0('0x2')]['import'](_0xfea0('0x90'));db[_0xfea0('0x91')]=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0x92'));db['AnalyticCustomReport']=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0x93'));db[_0xfea0('0x94')]=db[_0xfea0('0x2')]['import'](_0xfea0('0x95'));db[_0xfea0('0x96')]=db['sequelize'][_0xfea0('0x13')]('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0xfea0('0x97')]=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0x98'));db['AnalyticFieldReport']=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0x99'));db[_0xfea0('0x9a')]=db[_0xfea0('0x2')][_0xfea0('0x13')]('../api/analyticTreeReport/analyticTreeReport.model');db[_0xfea0('0x9b')]=db[_0xfea0('0x2')]['import'](_0xfea0('0x9c'));db['SalesforceConfiguration']=db['sequelize'][_0xfea0('0x13')](_0xfea0('0x9d'));db[_0xfea0('0x9e')]=db[_0xfea0('0x2')][_0xfea0('0x13')]('../api/intSalesforceField/intSalesforceField.model');db[_0xfea0('0x9f')]=db[_0xfea0('0x2')][_0xfea0('0x13')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0xfea0('0xa0')]=db['sequelize'][_0xfea0('0x13')](_0xfea0('0xa1'));db['SugarcrmField']=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0xa2'));db[_0xfea0('0xa3')]=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0xa4'));db[_0xfea0('0xa5')]=db[_0xfea0('0x2')]['import'](_0xfea0('0xa6'));db[_0xfea0('0xa7')]=db[_0xfea0('0x2')]['import'](_0xfea0('0xa8'));db[_0xfea0('0xa9')]=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0xaa'));db[_0xfea0('0xab')]=db[_0xfea0('0x2')]['import'](_0xfea0('0xac'));db[_0xfea0('0xad')]=db[_0xfea0('0x2')]['import']('../api/intZohoField/intZohoField.model');db[_0xfea0('0xae')]=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0xaf'));db[_0xfea0('0xb0')]=db[_0xfea0('0x2')]['import'](_0xfea0('0xb1'));db[_0xfea0('0xb2')]=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0xb3'));db[_0xfea0('0xb4')]=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0xb5'));db['FreshdeskConfiguration']=db['sequelize'][_0xfea0('0x13')](_0xfea0('0xb6'));db['FreshdeskField']=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0xb7'));db[_0xfea0('0xb8')]=db[_0xfea0('0x2')][_0xfea0('0x13')]('../api/intVtigerAccount/intVtigerAccount.model');db[_0xfea0('0xb9')]=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0xba'));db['VtigerField']=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0xbb'));db['ServicenowAccount']=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0xbc'));db[_0xfea0('0xbd')]=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0xbe'));db[_0xfea0('0xbf')]=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0xc0'));db[_0xfea0('0xc1')]=db['sequelize'][_0xfea0('0x13')](_0xfea0('0xc2'));db['Dynamics365Configuration']=db[_0xfea0('0x2')]['import'](_0xfea0('0xc3'));db[_0xfea0('0xc4')]=db['sequelize'][_0xfea0('0x13')](_0xfea0('0xc5'));db[_0xfea0('0xc6')]=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0xc7'));db[_0xfea0('0xc8')]=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0xc9'));db[_0xfea0('0xca')]=db['sequelize'][_0xfea0('0x13')]('../api/intFreshsalesField/intFreshsalesField.model');db[_0xfea0('0x8f')]=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0x90'));db[_0xfea0('0xcb')]=db['sequelize'][_0xfea0('0x13')](_0xfea0('0xcc'));db[_0xfea0('0xcd')]=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0xce'));db['ChatInternalMessage']=db[_0xfea0('0x2')]['import'](_0xfea0('0xcf'));db[_0xfea0('0xd0')]=db[_0xfea0('0x2')]['import'](_0xfea0('0xd1'));db[_0xfea0('0xd2')]=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0xd3'));db[_0xfea0('0xd4')]=db['sequelize']['import'](_0xfea0('0xd5'));db['SmsQueueReport']=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0xd6'));db['SquareReport']=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0xd7'));db['SquareDetailsReport']=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0xd8'));db[_0xfea0('0xd9')]=db[_0xfea0('0x2')]['import'](_0xfea0('0xda'));db[_0xfea0('0xdb')]=db['sequelize']['import'](_0xfea0('0xdc'));db[_0xfea0('0xdd')]=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0xde'));db['SquareProject']=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0xdf'));db[_0xfea0('0xe0')]=db['sequelize'][_0xfea0('0x13')](_0xfea0('0xe1'));db['SquareMessage']=db[_0xfea0('0x2')][_0xfea0('0x13')]('../api/squareMessage/squareMessage.model');db[_0xfea0('0xe2')]=db[_0xfea0('0x2')]['import']('../api/team/team.model');db[_0xfea0('0xe3')]=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0xe4'));db[_0xfea0('0xe5')]=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0xe6'));db[_0xfea0('0xe7')]=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0xe8'));db[_0xfea0('0xe9')]=db[_0xfea0('0x2')][_0xfea0('0x13')]('../api/attachment/attachment.model');db[_0xfea0('0xea')]=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0xeb'));db['MailTransferReport']=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0xec'));db[_0xfea0('0xed')]=db[_0xfea0('0x2')][_0xfea0('0x13')]('../api/chatTransferReport/chatTransferReport.model');db[_0xfea0('0xee')]=db[_0xfea0('0x2')][_0xfea0('0x13')]('../api/faxTransferReport/faxTransferReport.model');db[_0xfea0('0xef')]=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0xf0'));db['SmsTransferReport']=db[_0xfea0('0x2')]['import'](_0xfea0('0xf1'));db[_0xfea0('0xf2')]=db[_0xfea0('0x2')]['import'](_0xfea0('0xf3'));db[_0xfea0('0xf4')]=db[_0xfea0('0x2')]['import'](_0xfea0('0xf5'));db['UserProfile']=db['sequelize'][_0xfea0('0x13')](_0xfea0('0xf6'));db[_0xfea0('0xf7')]=db['sequelize'][_0xfea0('0x13')](_0xfea0('0xf8'));db[_0xfea0('0xf9')]=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0xfa'));db[_0xfea0('0xfb')]=db['sequelize'][_0xfea0('0x13')]('../api/userNotification/userNotification.model');db[_0xfea0('0xfc')]=db[_0xfea0('0x2')]['import'](_0xfea0('0xfd'));db[_0xfea0('0xfe')]=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0xff'));db['WhatsappInteraction']=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0x100'));db[_0xfea0('0x101')]=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0x102'));db[_0xfea0('0x103')]=db[_0xfea0('0x2')]['import'](_0xfea0('0x104'));db[_0xfea0('0x105')]=db['sequelize']['import'](_0xfea0('0x106'));db[_0xfea0('0x107')]=db['sequelize'][_0xfea0('0x13')]('../api/whatsappQueue/whatsappQueue.model');db[_0xfea0('0x108')]=db[_0xfea0('0x2')][_0xfea0('0x13')]('../api/cloudProvider/cloudProvider.model');db[_0xfea0('0x109')]=db['sequelize'][_0xfea0('0x13')]('../api/realtime/realtime.model');db[_0xfea0('0x10a')]=db[_0xfea0('0x2')][_0xfea0('0x13')](_0xfea0('0x10b'));db['User'][_0xfea0('0x10c')](db['VoiceMail'],{'as':_0xfea0('0x1f'),'onDelete':_0xfea0('0x10d'),'foreignKey':_0xfea0('0x10e')});db[_0xfea0('0x12')]['hasMany'](db[_0xfea0('0x1c')],{'as':_0xfea0('0x10f'),'foreignKey':_0xfea0('0x10e')});db[_0xfea0('0x12')][_0xfea0('0x110')](db['UserVoiceQueueRt'],{'as':_0xfea0('0x111'),'foreignKey':_0xfea0('0x10e')});db[_0xfea0('0x12')][_0xfea0('0x110')](db[_0xfea0('0x18')],{'as':_0xfea0('0x112'),'onDelete':_0xfea0('0x10d'),'hooks':!![]});db[_0xfea0('0x12')]['hasMany'](db[_0xfea0('0x6e')],{'as':_0xfea0('0x113'),'foreignKey':_0xfea0('0x10e')});db[_0xfea0('0x12')]['hasMany'](db[_0xfea0('0x70')],{'as':_0xfea0('0x114'),'foreignKey':_0xfea0('0x10e')});db[_0xfea0('0x12')][_0xfea0('0x110')](db[_0xfea0('0x71')],{'as':_0xfea0('0x71'),'foreignKey':'UserId'});db[_0xfea0('0x12')][_0xfea0('0x110')](db['OpenchannelInteraction'],{'as':_0xfea0('0x115'),'foreignKey':'UserId'});db[_0xfea0('0x12')][_0xfea0('0x110')](db[_0xfea0('0x5e')],{'as':_0xfea0('0x116'),'foreignKey':_0xfea0('0x10e')});db[_0xfea0('0x12')][_0xfea0('0x110')](db[_0xfea0('0x4e')],{'as':_0xfea0('0x117'),'foreignKey':_0xfea0('0x10e')});db['User']['hasMany'](db[_0xfea0('0x48')],{'as':_0xfea0('0x118'),'foreignKey':_0xfea0('0x10e')});db[_0xfea0('0x12')][_0xfea0('0x110')](db[_0xfea0('0x3d')],{'as':'MailInteractions','foreignKey':_0xfea0('0x10e')});db['User'][_0xfea0('0x110')](db[_0xfea0('0x119')],{'as':_0xfea0('0x11a'),'foreignKey':_0xfea0('0x10e')});db['User']['hasMany'](db[_0xfea0('0xfb')],{'as':_0xfea0('0x11b'),'foreignKey':_0xfea0('0x11c')});db['User'][_0xfea0('0x11d')](db[_0xfea0('0x11e')],{'as':_0xfea0('0x11e'),'foreignKey':'userProfileId'});db['User']['belongsToMany'](db['ChatGroup'],{'as':'Groups','through':'chat_group_has_users'});db[_0xfea0('0x12')][_0xfea0('0x11f')](db[_0xfea0('0x120')],{'as':'Contacts','through':_0xfea0('0x121')});db['User'][_0xfea0('0x11f')](db['CmList'],{'as':'Lists','through':_0xfea0('0x122')});db['User']['belongsToMany'](db[_0xfea0('0xe2')],{'through':_0xfea0('0x123')});db['User'][_0xfea0('0x11f')](db[_0xfea0('0x3d')],{'as':_0xfea0('0x124'),'through':_0xfea0('0x125')});db[_0xfea0('0x12')]['belongsToMany'](db[_0xfea0('0x5e')],{'as':_0xfea0('0x116'),'through':_0xfea0('0x126')});db[_0xfea0('0x12')][_0xfea0('0x11f')](db['FaxInteraction'],{'as':_0xfea0('0x118'),'through':_0xfea0('0x127')});db['User'][_0xfea0('0x11f')](db[_0xfea0('0x4e')],{'as':_0xfea0('0x117'),'through':_0xfea0('0x128')});db['User'][_0xfea0('0x11f')](db[_0xfea0('0x53')],{'as':_0xfea0('0x115'),'through':_0xfea0('0x129')});db[_0xfea0('0x12')][_0xfea0('0x11f')](db[_0xfea0('0x119')],{'as':'WhatsappInteractions','through':'user_has_whatsapp_interactions'});db['User']['belongsToMany'](db[_0xfea0('0x12a')],{'as':_0xfea0('0x12b'),'through':_0xfea0('0x12c'),'required':![]});db[_0xfea0('0x12')][_0xfea0('0x11f')](db[_0xfea0('0x12d')],{'as':'MailQueues','through':_0xfea0('0x2f'),'required':![]});db[_0xfea0('0x12')][_0xfea0('0x11f')](db[_0xfea0('0x64')],{'as':_0xfea0('0x12e'),'through':_0xfea0('0x12f'),'required':![],'hooks':!![]});db['User'][_0xfea0('0x11f')](db[_0xfea0('0x130')],{'as':_0xfea0('0x131'),'through':'UserFaxQueue','required':![]});db[_0xfea0('0x12')][_0xfea0('0x11f')](db[_0xfea0('0x132')],{'as':_0xfea0('0x133'),'through':'UserSmsQueue','required':![]});db[_0xfea0('0x12')][_0xfea0('0x11f')](db[_0xfea0('0x56')],{'as':_0xfea0('0x134'),'through':_0xfea0('0x135'),'required':![]});db[_0xfea0('0x12')][_0xfea0('0x11f')](db[_0xfea0('0x107')],{'as':'WhatsappQueues','through':_0xfea0('0x34'),'required':![]});db[_0xfea0('0x12')][_0xfea0('0x11f')](db[_0xfea0('0xf2')],{'through':_0xfea0('0x122')});db[_0xfea0('0x12')][_0xfea0('0x11f')](db['VoicePrefix'],{'as':_0xfea0('0x136'),'through':_0xfea0('0x137'),'required':![]});db['User'][_0xfea0('0x11f')](db[_0xfea0('0x58')],{'as':_0xfea0('0x138'),'through':_0xfea0('0x139')});db[_0xfea0('0x12')][_0xfea0('0x11f')](db[_0xfea0('0x13a')],{'as':_0xfea0('0x13b'),'through':'user_has_fax_accounts'});db['User']['belongsToMany'](db[_0xfea0('0x39')],{'as':_0xfea0('0x13c'),'through':_0xfea0('0x13d')});db['User'][_0xfea0('0x11f')](db[_0xfea0('0x50')],{'as':_0xfea0('0x13e'),'through':_0xfea0('0x13f')});db[_0xfea0('0x12')][_0xfea0('0x11f')](db['SmsAccount'],{'as':_0xfea0('0x140'),'through':_0xfea0('0x141')});db[_0xfea0('0x12')][_0xfea0('0x11f')](db[_0xfea0('0xfc')],{'as':_0xfea0('0x142'),'through':_0xfea0('0x143')});db[_0xfea0('0x12')][_0xfea0('0x11f')](db[_0xfea0('0x144')],{'as':_0xfea0('0x145'),'through':_0xfea0('0x146')});db[_0xfea0('0x147')][_0xfea0('0x110')](db['VoiceExtension'],{'as':_0xfea0('0x148'),'onDelete':_0xfea0('0x10d'),'foreignKey':_0xfea0('0x149')});db[_0xfea0('0x16')][_0xfea0('0x110')](db[_0xfea0('0x18')],{'onDelete':_0xfea0('0x10d')});db['VoiceExtension'][_0xfea0('0x110')](db[_0xfea0('0x18')],{'as':'Applications','onDelete':_0xfea0('0x10d')});db[_0xfea0('0x19')][_0xfea0('0x11f')](db['Sound'],{'as':_0xfea0('0x14a'),'through':'moh_has_sounds'});db['VoiceQueue'][_0xfea0('0x110')](db[_0xfea0('0x14b')],{'as':_0xfea0('0x14c'),'foreignKey':_0xfea0('0x14d')});db[_0xfea0('0x12a')][_0xfea0('0x110')](db[_0xfea0('0x14e')],{'as':'Hoppers','foreignKey':_0xfea0('0x14d')});db['VoiceQueue'][_0xfea0('0x110')](db[_0xfea0('0x6e')],{'as':'HopperFinals','foreignKey':_0xfea0('0x14d')});db[_0xfea0('0x12a')][_0xfea0('0x110')](db[_0xfea0('0x70')],{'as':'HopperHistories','foreignKey':_0xfea0('0x14d')});db[_0xfea0('0x12a')][_0xfea0('0x110')](db['ReportAgentPreview'],{'as':_0xfea0('0x71'),'foreignKey':_0xfea0('0x14d')});db[_0xfea0('0x12a')][_0xfea0('0x110')](db['CmHopperBlack'],{'as':_0xfea0('0x14f'),'foreignKey':'VoiceQueueId'});db[_0xfea0('0x12a')][_0xfea0('0x110')](db[_0xfea0('0xd4')],{'as':_0xfea0('0x150'),'foreignKey':_0xfea0('0x14d')});db[_0xfea0('0x12a')][_0xfea0('0x11d')](db['Trunk'],{'as':_0xfea0('0x151'),'foreignKey':_0xfea0('0x152')});db['VoiceQueue'][_0xfea0('0x11d')](db[_0xfea0('0x151')],{'as':_0xfea0('0x153'),'foreignKey':_0xfea0('0x154')});db[_0xfea0('0x12a')][_0xfea0('0x11d')](db[_0xfea0('0x7a')],{'as':_0xfea0('0x7a'),'foreignKey':_0xfea0('0x155')});db[_0xfea0('0x12a')]['belongsTo'](db[_0xfea0('0x156')],{'as':_0xfea0('0x157'),'foreignKey':_0xfea0('0x158')});db[_0xfea0('0x12a')][_0xfea0('0x11f')](db[_0xfea0('0xf2')],{'as':'Lists','through':'voice_queues_has_cm_lists'});db[_0xfea0('0x12a')][_0xfea0('0x11f')](db[_0xfea0('0x12')],{'as':_0xfea0('0x159'),'through':'UserVoiceQueue'});db[_0xfea0('0x12a')]['belongsToMany'](db[_0xfea0('0xe2')],{'as':_0xfea0('0x15a'),'through':'TeamVoiceQueue'});db[_0xfea0('0x12a')]['belongsToMany'](db[_0xfea0('0xf2')],{'as':_0xfea0('0x15b'),'through':_0xfea0('0x15c')});db[_0xfea0('0x1c')][_0xfea0('0x11d')](db['User'],{'as':_0xfea0('0x12'),'foreignKey':_0xfea0('0x10e')});db[_0xfea0('0x15d')][_0xfea0('0x11d')](db['User'],{'as':'User','foreignKey':_0xfea0('0x10e')});db[_0xfea0('0x1f')][_0xfea0('0x110')](db['VoiceMailMessage'],{'as':_0xfea0('0x15e'),'onDelete':_0xfea0('0x10d'),'foreignKey':_0xfea0('0x15f'),'sourceKey':_0xfea0('0x160')});db['VoiceMailMessage'][_0xfea0('0x11d')](db[_0xfea0('0x1f')],{'foreignKey':_0xfea0('0x15f'),'targetKey':_0xfea0('0x160')});db['VoiceCallReport']['hasMany'](db['VoiceQueueReport'],{'as':'QueueCalls','foreignKey':_0xfea0('0x161'),'constraints':![]});db[_0xfea0('0x22')]['hasMany'](db[_0xfea0('0x25')],{'as':_0xfea0('0x162'),'foreignKey':_0xfea0('0x161'),'constraints':![]});db[_0xfea0('0x22')][_0xfea0('0x11d')](db['User'],{'as':'User','foreignKey':_0xfea0('0x10e')});db[_0xfea0('0x22')][_0xfea0('0x11d')](db[_0xfea0('0x120')],{'as':_0xfea0('0x163'),'foreignKey':_0xfea0('0x164')});db[_0xfea0('0x36')][_0xfea0('0x11d')](db[_0xfea0('0x39')],{'as':_0xfea0('0x39'),'foreignKey':_0xfea0('0x165')});db[_0xfea0('0x166')]['belongsTo'](db[_0xfea0('0x39')],{'as':_0xfea0('0x39'),'foreignKey':'MailAccountId'});db[_0xfea0('0x39')][_0xfea0('0x10c')](db[_0xfea0('0x36')],{'as':'Imap','onDelete':_0xfea0('0x10d')});db[_0xfea0('0x39')][_0xfea0('0x10c')](db[_0xfea0('0x166')],{'as':_0xfea0('0x167'),'onDelete':_0xfea0('0x10d')});db[_0xfea0('0x39')][_0xfea0('0x110')](db[_0xfea0('0x168')],{'as':'Dispositions','foreignKey':'MailAccountId','onDelete':_0xfea0('0x10d')});db['MailAccount']['hasMany'](db[_0xfea0('0x169')],{'as':_0xfea0('0x16a'),'foreignKey':'MailAccountId'});db[_0xfea0('0x39')]['hasMany'](db[_0xfea0('0x3e')],{'as':'Messages','foreignKey':_0xfea0('0x165')});db[_0xfea0('0x39')][_0xfea0('0x110')](db['MailInteraction'],{'as':'Interactions'});db[_0xfea0('0x39')][_0xfea0('0x110')](db[_0xfea0('0x40')],{'as':_0xfea0('0x16b')});db['MailAccount']['belongsTo'](db[_0xfea0('0xf2')],{'as':_0xfea0('0x16c'),'foreignKey':'ListId'});db[_0xfea0('0x39')]['belongsTo'](db[_0xfea0('0x8a')],{'as':_0xfea0('0x8a'),'foreignKey':_0xfea0('0x16d')});db[_0xfea0('0x39')][_0xfea0('0x11d')](db[_0xfea0('0x156')],{'as':_0xfea0('0x157'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xfea0('0x39')][_0xfea0('0x11f')](db['User'],{'as':_0xfea0('0x159'),'through':_0xfea0('0x13d')});db[_0xfea0('0x12d')][_0xfea0('0x11f')](db['User'],{'as':_0xfea0('0x159'),'through':_0xfea0('0x2f')});db[_0xfea0('0x12d')][_0xfea0('0x11f')](db[_0xfea0('0xe2')],{'through':'team_has_mail_queues','as':_0xfea0('0x15a')});db[_0xfea0('0x3d')]['hasMany'](db[_0xfea0('0x3e')],{'as':'Messages','onDelete':_0xfea0('0x10d'),'foreignKey':_0xfea0('0x16e')});db[_0xfea0('0x3d')]['belongsTo'](db['MailAccount'],{'as':_0xfea0('0x16f'),'foreignKey':_0xfea0('0x165')});db[_0xfea0('0x3d')]['belongsTo'](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db[_0xfea0('0x3d')][_0xfea0('0x11d')](db[_0xfea0('0x12')],{'as':_0xfea0('0x170'),'foreignKey':_0xfea0('0x10e')});db[_0xfea0('0x3d')]['belongsToMany'](db[_0xfea0('0x82')],{'through':_0xfea0('0x171'),'as':_0xfea0('0x172')});db['MailInteraction']['belongsToMany'](db['Tag'],{'through':'mail_interaction_has_tags','as':'ThroughTags'});db[_0xfea0('0x3d')][_0xfea0('0x11f')](db[_0xfea0('0x12')],{'as':'Users','through':_0xfea0('0x125'),'foreignKey':_0xfea0('0x16e')});db[_0xfea0('0x3e')]['hasMany'](db['Attachment'],{'as':_0xfea0('0x173'),'onDelete':_0xfea0('0x10d')});db[_0xfea0('0x3e')][_0xfea0('0x11d')](db['User'],{'as':_0xfea0('0x12')});db[_0xfea0('0x3e')][_0xfea0('0x11d')](db[_0xfea0('0x120')],{'onDelete':_0xfea0('0x10d'),'as':_0xfea0('0x163')});db['MailMessage']['belongsTo'](db[_0xfea0('0x3d')],{'as':_0xfea0('0x174'),'foreignKey':_0xfea0('0x16e')});db[_0xfea0('0x3e')][_0xfea0('0x11d')](db['MailAccount'],{'as':_0xfea0('0x16f'),'foreignKey':_0xfea0('0x165')});db[_0xfea0('0x3e')][_0xfea0('0x11d')](db['ChatWebsite'],{'as':_0xfea0('0x58'),'foreignKey':_0xfea0('0x175')});db[_0xfea0('0x3e')][_0xfea0('0x11d')](db[_0xfea0('0x62')],{'as':'ChatOfflineMessage','foreignKey':_0xfea0('0x176')});db[_0xfea0('0x40')]['belongsTo'](db[_0xfea0('0x12')],{'onDelete':'restrict'});db['MailApplication'][_0xfea0('0x11d')](db['MailQueue'],{'onDelete':_0xfea0('0x177')});db[_0xfea0('0x40')]['belongsTo'](db['MailAccount'],{'onDelete':_0xfea0('0x177')});db[_0xfea0('0x40')][_0xfea0('0x11d')](db[_0xfea0('0x7a')],{'onDelete':_0xfea0('0x177'),'foreignKey':_0xfea0('0x155')});db['MailApplication'][_0xfea0('0x11d')](db[_0xfea0('0x82')],{'onDelete':_0xfea0('0x177'),'foreignKey':_0xfea0('0x178')});db['MailQueueReport'][_0xfea0('0x11d')](db[_0xfea0('0x39')],{});db[_0xfea0('0x41')][_0xfea0('0x11d')](db['CmList'],{'as':'List','foreignKey':_0xfea0('0x179')});db[_0xfea0('0x41')][_0xfea0('0x11d')](db[_0xfea0('0x120')],{'as':_0xfea0('0x163'),'foreignKey':_0xfea0('0x164')});db['MailQueueReport'][_0xfea0('0x11d')](db[_0xfea0('0x3d')],{});db['MailQueueReport'][_0xfea0('0x11d')](db[_0xfea0('0x3e')],{});db[_0xfea0('0x41')][_0xfea0('0x11d')](db[_0xfea0('0x12')],{});db[_0xfea0('0x41')][_0xfea0('0x11d')](db[_0xfea0('0x12d')],{});db[_0xfea0('0x42')][_0xfea0('0x110')](db['DashboardItem'],{'as':_0xfea0('0x17a'),'onDelete':_0xfea0('0x10d')});db[_0xfea0('0x13a')]['hasMany'](db[_0xfea0('0x168')],{'as':_0xfea0('0x17b'),'foreignKey':_0xfea0('0x17c'),'onDelete':_0xfea0('0x10d')});db[_0xfea0('0x13a')][_0xfea0('0x110')](db[_0xfea0('0x169')],{'as':_0xfea0('0x16a'),'foreignKey':_0xfea0('0x17c')});db[_0xfea0('0x13a')]['hasMany'](db[_0xfea0('0x48')],{'as':_0xfea0('0x17d')});db['FaxAccount'][_0xfea0('0x110')](db['FaxApplication'],{'as':'Applications'});db[_0xfea0('0x13a')][_0xfea0('0x110')](db['VoiceExtension'],{'as':_0xfea0('0x17e'),'onDelete':'cascade'});db['FaxAccount'][_0xfea0('0x110')](db[_0xfea0('0x17f')],{'as':_0xfea0('0x15e')});db[_0xfea0('0x13a')][_0xfea0('0x11d')](db['Trunk'],{'as':_0xfea0('0x151')});db[_0xfea0('0x13a')][_0xfea0('0x11d')](db['CmList'],{'as':_0xfea0('0x16c'),'foreignKey':_0xfea0('0x179')});db['FaxAccount'][_0xfea0('0x11d')](db['Pause'],{'as':_0xfea0('0x157'),'foreignKey':'mandatoryDispositionPauseId'});db['FaxAccount'][_0xfea0('0x11f')](db[_0xfea0('0x12')],{'as':_0xfea0('0x159'),'through':_0xfea0('0x180')});db['FaxApplication'][_0xfea0('0x11d')](db[_0xfea0('0x12')],{'onDelete':'restrict'});db[_0xfea0('0x181')]['belongsTo'](db[_0xfea0('0x130')],{'onDelete':_0xfea0('0x177')});db[_0xfea0('0x181')][_0xfea0('0x11d')](db[_0xfea0('0x13a')],{'onDelete':'restrict'});db[_0xfea0('0x181')]['belongsTo'](db[_0xfea0('0x82')],{'onDelete':_0xfea0('0x177'),'foreignKey':_0xfea0('0x178')});db[_0xfea0('0x48')][_0xfea0('0x110')](db['FaxMessage'],{'as':_0xfea0('0x15e'),'onDelete':'cascade','foreignKey':'FaxInteractionId'});db[_0xfea0('0x48')][_0xfea0('0x11d')](db[_0xfea0('0x13a')],{'as':_0xfea0('0x16f'),'foreignKey':_0xfea0('0x17c')});db[_0xfea0('0x48')][_0xfea0('0x11d')](db[_0xfea0('0x120')],{'as':'Contact','foreignKey':'ContactId'});db[_0xfea0('0x48')]['belongsTo'](db[_0xfea0('0x12')],{'as':_0xfea0('0x170'),'foreignKey':'UserId'});db[_0xfea0('0x48')][_0xfea0('0x11f')](db[_0xfea0('0x82')],{'through':'fax_interaction_has_tags','as':_0xfea0('0x172')});db[_0xfea0('0x48')][_0xfea0('0x11f')](db[_0xfea0('0x82')],{'through':_0xfea0('0x182'),'as':_0xfea0('0x183')});db['FaxInteraction'][_0xfea0('0x11f')](db[_0xfea0('0x12')],{'as':_0xfea0('0x184'),'through':_0xfea0('0x127'),'foreignKey':_0xfea0('0x185')});db[_0xfea0('0x17f')]['belongsTo'](db[_0xfea0('0x12')],{'onDelete':_0xfea0('0x10d'),'as':_0xfea0('0x12')});db[_0xfea0('0x17f')]['belongsTo'](db[_0xfea0('0x48')],{'as':_0xfea0('0x174'),'foreignKey':_0xfea0('0x185')});db['FaxMessage'][_0xfea0('0x11d')](db[_0xfea0('0x120')],{'onDelete':_0xfea0('0x10d'),'as':_0xfea0('0x163')});db[_0xfea0('0x17f')][_0xfea0('0x11d')](db[_0xfea0('0xe9')],{'as':_0xfea0('0xe9'),'foreignKey':_0xfea0('0x186')});db[_0xfea0('0x17f')][_0xfea0('0x11d')](db[_0xfea0('0x13a')],{'as':_0xfea0('0x16f'),'foreignKey':'FaxAccountId'});db['FaxQueue'][_0xfea0('0x11f')](db[_0xfea0('0x12')],{'as':_0xfea0('0x159'),'through':'UserFaxQueue'});db[_0xfea0('0x130')][_0xfea0('0x11f')](db[_0xfea0('0xe2')],{'through':_0xfea0('0x187'),'as':_0xfea0('0x15a')});db[_0xfea0('0x188')][_0xfea0('0x11d')](db['FaxAccount'],{});db['FaxQueueReport'][_0xfea0('0x11d')](db[_0xfea0('0xf2')],{'as':'List','foreignKey':_0xfea0('0x179')});db['FaxQueueReport'][_0xfea0('0x11d')](db['CmContact'],{'as':'Contact','foreignKey':_0xfea0('0x164')});db[_0xfea0('0x188')]['belongsTo'](db['FaxInteraction'],{});db[_0xfea0('0x188')][_0xfea0('0x11d')](db['FaxMessage'],{});db[_0xfea0('0x188')][_0xfea0('0x11d')](db['User'],{});db[_0xfea0('0x188')]['belongsTo'](db[_0xfea0('0x130')],{});db[_0xfea0('0x4c')][_0xfea0('0x110')](db['Disposition'],{'as':'Dispositions','foreignKey':_0xfea0('0x189'),'onDelete':_0xfea0('0x10d')});db[_0xfea0('0x4c')][_0xfea0('0x110')](db[_0xfea0('0x169')],{'as':_0xfea0('0x16a'),'foreignKey':_0xfea0('0x189')});db[_0xfea0('0x4c')][_0xfea0('0x110')](db['SmsMessage'],{'as':_0xfea0('0x15e'),'foreignKey':'SmsAccountId'});db[_0xfea0('0x4c')][_0xfea0('0x110')](db[_0xfea0('0x4e')],{'as':'Interactions'});db['SmsAccount']['hasMany'](db[_0xfea0('0x4d')],{'as':_0xfea0('0x16b')});db['SmsAccount'][_0xfea0('0x11d')](db['CmList'],{'as':_0xfea0('0x16c'),'foreignKey':_0xfea0('0x179')});db['SmsAccount'][_0xfea0('0x11d')](db[_0xfea0('0x156')],{'as':'mandatoryDispositionPause','foreignKey':_0xfea0('0x158')});db[_0xfea0('0x4c')][_0xfea0('0x11f')](db[_0xfea0('0x12')],{'as':'Agents','through':'user_has_sms_accounts'});db[_0xfea0('0x4d')][_0xfea0('0x11d')](db[_0xfea0('0x12')],{'onDelete':_0xfea0('0x177')});db[_0xfea0('0x4d')]['belongsTo'](db[_0xfea0('0x132')],{'onDelete':_0xfea0('0x177')});db[_0xfea0('0x4d')]['belongsTo'](db[_0xfea0('0x4c')],{'onDelete':_0xfea0('0x177')});db[_0xfea0('0x4d')][_0xfea0('0x11d')](db[_0xfea0('0x7a')],{'onDelete':_0xfea0('0x177'),'foreignKey':_0xfea0('0x155')});db['SmsApplication'][_0xfea0('0x11d')](db['Tag'],{'onDelete':_0xfea0('0x177'),'foreignKey':_0xfea0('0x178')});db[_0xfea0('0x4e')][_0xfea0('0x110')](db[_0xfea0('0x18a')],{'as':'Messages','onDelete':_0xfea0('0x10d'),'foreignKey':_0xfea0('0x18b')});db['SmsInteraction'][_0xfea0('0x11d')](db[_0xfea0('0x4c')],{'as':_0xfea0('0x16f'),'foreignKey':_0xfea0('0x189')});db[_0xfea0('0x4e')][_0xfea0('0x11d')](db[_0xfea0('0x120')],{'as':_0xfea0('0x163'),'foreignKey':_0xfea0('0x164')});db[_0xfea0('0x4e')][_0xfea0('0x11d')](db[_0xfea0('0x12')],{'as':_0xfea0('0x170'),'foreignKey':'UserId'});db[_0xfea0('0x4e')][_0xfea0('0x11f')](db[_0xfea0('0x82')],{'through':_0xfea0('0x18c'),'as':_0xfea0('0x172')});db[_0xfea0('0x4e')][_0xfea0('0x11f')](db[_0xfea0('0x82')],{'through':'sms_interaction_has_tags','as':_0xfea0('0x183')});db['SmsInteraction'][_0xfea0('0x11f')](db[_0xfea0('0x12')],{'as':_0xfea0('0x184'),'through':_0xfea0('0x128'),'foreignKey':'SmsInteractionId'});db[_0xfea0('0x18a')][_0xfea0('0x11d')](db[_0xfea0('0x12')],{'as':_0xfea0('0x12')});db[_0xfea0('0x18a')][_0xfea0('0x11d')](db[_0xfea0('0x120')],{'onDelete':_0xfea0('0x10d'),'as':_0xfea0('0x163')});db['SmsMessage'][_0xfea0('0x11d')](db[_0xfea0('0x4e')],{'onDelete':_0xfea0('0x10d'),'as':_0xfea0('0x174'),'foreignKey':_0xfea0('0x18b')});db['SmsMessage'][_0xfea0('0x11d')](db[_0xfea0('0x4c')],{'as':'Account','foreignKey':_0xfea0('0x189')});db[_0xfea0('0x132')][_0xfea0('0x11f')](db['User'],{'as':_0xfea0('0x159'),'through':_0xfea0('0x31'),'foreignKey':_0xfea0('0x18d')});db[_0xfea0('0x132')][_0xfea0('0x11f')](db[_0xfea0('0xe2')],{'through':_0xfea0('0x18e'),'as':_0xfea0('0x15a')});db[_0xfea0('0x50')][_0xfea0('0x110')](db['Disposition'],{'as':_0xfea0('0x17b'),'foreignKey':_0xfea0('0x18f'),'onDelete':'cascade'});db[_0xfea0('0x50')][_0xfea0('0x110')](db[_0xfea0('0x169')],{'as':_0xfea0('0x16a'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0xfea0('0x110')](db[_0xfea0('0x53')],{'as':_0xfea0('0x17d'),'foreignKey':_0xfea0('0x18f')});db[_0xfea0('0x50')][_0xfea0('0x110')](db[_0xfea0('0x54')],{'as':_0xfea0('0x15e'),'foreignKey':_0xfea0('0x18f')});db['OpenchannelAccount'][_0xfea0('0x110')](db[_0xfea0('0x190')],{'as':_0xfea0('0x16b'),'foreignKey':_0xfea0('0x18f')});db['OpenchannelAccount'][_0xfea0('0x11d')](db[_0xfea0('0xf2')],{'as':'List','foreignKey':_0xfea0('0x179')});db[_0xfea0('0x50')][_0xfea0('0x11d')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0xfea0('0x158')});db[_0xfea0('0x50')][_0xfea0('0x11f')](db[_0xfea0('0x12')],{'as':_0xfea0('0x159'),'through':_0xfea0('0x13f')});db[_0xfea0('0x190')]['belongsTo'](db[_0xfea0('0x12')],{'onDelete':_0xfea0('0x177')});db[_0xfea0('0x190')][_0xfea0('0x11d')](db[_0xfea0('0x56')],{'onDelete':_0xfea0('0x177'),'foreignKey':_0xfea0('0x191')});db[_0xfea0('0x190')][_0xfea0('0x11d')](db[_0xfea0('0x50')],{'onDelete':'restrict','foreignKey':_0xfea0('0x18f')});db[_0xfea0('0x190')]['belongsTo'](db['Interval'],{'onDelete':_0xfea0('0x177'),'foreignKey':'IntervalId'});db[_0xfea0('0x190')]['belongsTo'](db[_0xfea0('0x82')],{'onDelete':_0xfea0('0x177'),'foreignKey':'TagId'});db[_0xfea0('0x53')]['hasMany'](db[_0xfea0('0x54')],{'as':_0xfea0('0x15e'),'onDelete':'cascade','foreignKey':_0xfea0('0x192')});db['OpenchannelInteraction'][_0xfea0('0x11d')](db[_0xfea0('0x50')],{'as':_0xfea0('0x16f'),'foreignKey':_0xfea0('0x18f')});db['OpenchannelInteraction'][_0xfea0('0x11d')](db['CmContact'],{'as':_0xfea0('0x163'),'foreignKey':'ContactId'});db[_0xfea0('0x53')][_0xfea0('0x11d')](db[_0xfea0('0x12')],{'as':'Owner','foreignKey':_0xfea0('0x10e')});db[_0xfea0('0x53')][_0xfea0('0x11f')](db['Tag'],{'through':_0xfea0('0x193'),'as':_0xfea0('0x172')});db[_0xfea0('0x53')][_0xfea0('0x11f')](db[_0xfea0('0x82')],{'through':_0xfea0('0x193'),'as':_0xfea0('0x183')});db[_0xfea0('0x53')][_0xfea0('0x11f')](db[_0xfea0('0x12')],{'as':_0xfea0('0x184'),'through':_0xfea0('0x129'),'foreignKey':_0xfea0('0x192')});db[_0xfea0('0x54')][_0xfea0('0x11d')](db[_0xfea0('0x12')],{'onDelete':_0xfea0('0x10d'),'as':_0xfea0('0x12')});db[_0xfea0('0x54')]['belongsTo'](db['CmContact'],{'onDelete':_0xfea0('0x10d'),'as':_0xfea0('0x163')});db[_0xfea0('0x54')]['belongsTo'](db['OpenchannelInteraction'],{'onDelete':_0xfea0('0x10d'),'as':'Interaction','foreignKey':_0xfea0('0x192')});db[_0xfea0('0x54')][_0xfea0('0x11d')](db['Attachment'],{'as':_0xfea0('0xe9'),'foreignKey':_0xfea0('0x186')});db['OpenchannelMessage']['belongsTo'](db[_0xfea0('0x50')],{'as':_0xfea0('0x16f'),'foreignKey':_0xfea0('0x18f')});db['OpenchannelQueue'][_0xfea0('0x11f')](db[_0xfea0('0x12')],{'as':_0xfea0('0x159'),'through':_0xfea0('0x135'),'foreignKey':_0xfea0('0x191')});db[_0xfea0('0x56')][_0xfea0('0x11f')](db['Team'],{'through':_0xfea0('0x194'),'as':_0xfea0('0x15a')});db[_0xfea0('0x58')][_0xfea0('0x110')](db['Disposition'],{'as':_0xfea0('0x17b'),'foreignKey':_0xfea0('0x175'),'onDelete':_0xfea0('0x10d')});db['ChatWebsite'][_0xfea0('0x110')](db['CannedAnswer'],{'as':'Answers','foreignKey':'ChatWebsiteId'});db[_0xfea0('0x58')][_0xfea0('0x110')](db[_0xfea0('0x67')],{'as':_0xfea0('0x195')});db['ChatWebsite'][_0xfea0('0x110')](db[_0xfea0('0x5e')],{'as':_0xfea0('0x17d')});db[_0xfea0('0x58')]['hasMany'](db[_0xfea0('0x5c')],{'as':_0xfea0('0x16b')});db['ChatWebsite'][_0xfea0('0x110')](db[_0xfea0('0x60')],{'as':'Messages'});db['ChatWebsite']['belongsTo'](db['CmList'],{'as':_0xfea0('0x16c'),'foreignKey':_0xfea0('0x179')});db['ChatWebsite'][_0xfea0('0x11d')](db[_0xfea0('0x7a')],{'as':_0xfea0('0x7a'),'foreignKey':_0xfea0('0x155')});db[_0xfea0('0x58')][_0xfea0('0x11d')](db[_0xfea0('0x39')],{'as':'MailAccount','foreignKey':_0xfea0('0x165')});db[_0xfea0('0x58')][_0xfea0('0x11d')](db[_0xfea0('0x156')],{'as':_0xfea0('0x157'),'foreignKey':_0xfea0('0x158')});db[_0xfea0('0x58')]['belongsToMany'](db[_0xfea0('0x12')],{'as':_0xfea0('0x159'),'through':'user_has_chat_websites'});db['OpenchannelQueueReport'][_0xfea0('0x11d')](db[_0xfea0('0x50')],{});db[_0xfea0('0x5a')]['belongsTo'](db[_0xfea0('0xf2')],{'as':_0xfea0('0x16c'),'foreignKey':_0xfea0('0x179')});db[_0xfea0('0x5a')][_0xfea0('0x11d')](db[_0xfea0('0x120')],{'as':'Contact','foreignKey':_0xfea0('0x164')});db[_0xfea0('0x5a')]['belongsTo'](db['OpenchannelInteraction'],{});db['OpenchannelQueueReport'][_0xfea0('0x11d')](db[_0xfea0('0x54')],{});db['OpenchannelQueueReport']['belongsTo'](db['User'],{});db[_0xfea0('0x5a')][_0xfea0('0x11d')](db[_0xfea0('0x56')],{});db['ChatApplication'][_0xfea0('0x11d')](db[_0xfea0('0x12')],{'as':_0xfea0('0x196'),'foreignKey':_0xfea0('0x10e'),'onDelete':_0xfea0('0x177')});db[_0xfea0('0x5c')][_0xfea0('0x11d')](db['ChatQueue'],{'as':_0xfea0('0x197'),'foreignKey':_0xfea0('0x198'),'onDelete':_0xfea0('0x177')});db['ChatApplication'][_0xfea0('0x11d')](db[_0xfea0('0x58')],{'as':'Website','foreignKey':_0xfea0('0x175'),'onDelete':_0xfea0('0x177')});db[_0xfea0('0x5c')][_0xfea0('0x11d')](db[_0xfea0('0x82')],{'onDelete':_0xfea0('0x177'),'foreignKey':'TagId'});db[_0xfea0('0x5e')][_0xfea0('0x110')](db[_0xfea0('0x60')],{'as':'Messages','onDelete':_0xfea0('0x10d'),'foreignKey':'ChatInteractionId'});db['ChatInteraction'][_0xfea0('0x11d')](db['ChatWebsite'],{'as':_0xfea0('0x16f'),'foreignKey':_0xfea0('0x175')});db[_0xfea0('0x5e')][_0xfea0('0x11d')](db[_0xfea0('0x120')],{'as':_0xfea0('0x163'),'foreignKey':_0xfea0('0x164')});db[_0xfea0('0x5e')][_0xfea0('0x11d')](db[_0xfea0('0x12')],{'as':'Owner','foreignKey':_0xfea0('0x10e')});db[_0xfea0('0x5e')][_0xfea0('0x11f')](db[_0xfea0('0x82')],{'through':_0xfea0('0x199'),'as':'Tags'});db['ChatInteraction'][_0xfea0('0x11f')](db[_0xfea0('0x82')],{'through':_0xfea0('0x199'),'as':_0xfea0('0x183')});db[_0xfea0('0x5e')][_0xfea0('0x11f')](db[_0xfea0('0x12')],{'as':'Users','through':_0xfea0('0x126'),'foreignKey':'ChatInteractionId'});db[_0xfea0('0x60')][_0xfea0('0x11d')](db[_0xfea0('0x12')],{'onDelete':'cascade','as':_0xfea0('0x12')});db[_0xfea0('0x60')][_0xfea0('0x11d')](db[_0xfea0('0x120')],{'onDelete':_0xfea0('0x10d'),'as':'Contact','foreignKey':_0xfea0('0x164')});db[_0xfea0('0x60')][_0xfea0('0x11d')](db['ChatInteraction'],{'onDelete':_0xfea0('0x10d'),'as':_0xfea0('0x174'),'foreignKey':'ChatInteractionId'});db[_0xfea0('0x60')][_0xfea0('0x11d')](db[_0xfea0('0xe9')],{'as':_0xfea0('0xe9'),'foreignKey':_0xfea0('0x186')});db[_0xfea0('0x60')][_0xfea0('0x11d')](db[_0xfea0('0x58')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0xfea0('0x62')][_0xfea0('0x110')](db[_0xfea0('0xe9')],{'as':'Attachments','foreignKey':'ChatOfflineMessageId','onDelete':_0xfea0('0x10d'),'hooks':!![]});db[_0xfea0('0x62')][_0xfea0('0x11d')](db['CmContact'],{'onDelete':_0xfea0('0x10d'),'as':'Contact','foreignKey':_0xfea0('0x164')});db['ChatOfflineMessage'][_0xfea0('0x11d')](db['ChatWebsite'],{'as':_0xfea0('0x16f'),'foreignKey':_0xfea0('0x175')});db['ChatQueue'][_0xfea0('0x11f')](db[_0xfea0('0x12')],{'as':_0xfea0('0x159'),'through':_0xfea0('0x12f'),'hooks':!![]});db['ChatQueue'][_0xfea0('0x11f')](db['Team'],{'through':_0xfea0('0x19a'),'as':'Teams'});db[_0xfea0('0x66')][_0xfea0('0x110')](db[_0xfea0('0x19b')],{'as':_0xfea0('0x15e'),'foreignKey':_0xfea0('0x19c'),'onDelete':_0xfea0('0x10d')});db[_0xfea0('0x66')][_0xfea0('0x11f')](db[_0xfea0('0x12')],{'as':_0xfea0('0x14c'),'through':'chat_group_has_users'});db[_0xfea0('0x67')][_0xfea0('0x11d')](db[_0xfea0('0x58')],{'as':'Website','foreignKey':_0xfea0('0x175')});db[_0xfea0('0x19d')][_0xfea0('0x110')](db[_0xfea0('0x120')],{'as':_0xfea0('0x19e'),'foreignKey':'CompanyId'});db[_0xfea0('0x120')]['hasMany'](db[_0xfea0('0x86')],{'as':'Phones','foreignKey':_0xfea0('0x19f')});db['CmContact']['hasMany'](db[_0xfea0('0x14e')],{'as':_0xfea0('0x1a0'),'foreignKey':_0xfea0('0x164')});db['CmContact'][_0xfea0('0x110')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0xfea0('0x164')});db[_0xfea0('0x120')][_0xfea0('0x110')](db[_0xfea0('0x70')],{'as':_0xfea0('0x1a1'),'foreignKey':_0xfea0('0x164')});db[_0xfea0('0x120')][_0xfea0('0x110')](db[_0xfea0('0x71')],{'as':_0xfea0('0x71'),'foreignKey':_0xfea0('0x164')});db[_0xfea0('0x120')][_0xfea0('0x110')](db[_0xfea0('0xd4')],{'as':_0xfea0('0x150'),'foreignKey':'ContactId'});db[_0xfea0('0x120')][_0xfea0('0x110')](db[_0xfea0('0x53')],{'as':_0xfea0('0x115'),'foreignKey':'ContactId','onDelete':_0xfea0('0x177')});db['CmContact'][_0xfea0('0x110')](db[_0xfea0('0x5e')],{'as':_0xfea0('0x116'),'foreignKey':_0xfea0('0x164'),'onDelete':'restrict'});db[_0xfea0('0x120')][_0xfea0('0x110')](db[_0xfea0('0x4e')],{'as':'SmsInteractions','foreignKey':_0xfea0('0x164'),'onDelete':'restrict'});db[_0xfea0('0x120')][_0xfea0('0x110')](db[_0xfea0('0x48')],{'as':'FaxInteractions','foreignKey':_0xfea0('0x164'),'onDelete':'restrict'});db[_0xfea0('0x120')][_0xfea0('0x110')](db[_0xfea0('0x3d')],{'as':_0xfea0('0x124'),'foreignKey':_0xfea0('0x164'),'onDelete':_0xfea0('0x177')});db[_0xfea0('0x120')][_0xfea0('0x11d')](db['CmCompany'],{'as':_0xfea0('0x1a2'),'foreignKey':'CompanyId'});db[_0xfea0('0x120')][_0xfea0('0x11d')](db[_0xfea0('0xf2')],{'as':_0xfea0('0x16c'),'foreignKey':_0xfea0('0x179'),'onDelete':_0xfea0('0x10d')});db[_0xfea0('0x120')]['belongsToMany'](db[_0xfea0('0x12')],{'as':_0xfea0('0x184'),'through':'cm_user_has_contacts'});db[_0xfea0('0x120')][_0xfea0('0x11f')](db[_0xfea0('0x82')],{'as':_0xfea0('0x172'),'through':_0xfea0('0x1a3')});db[_0xfea0('0x120')][_0xfea0('0x11f')](db[_0xfea0('0x82')],{'through':'cm_contact_has_tags','as':'ThroughTags'});db[_0xfea0('0x14e')]['hasMany'](db[_0xfea0('0x88')],{'as':'AdditionalPhones','foreignKey':_0xfea0('0x1a4')});db['CmHopper'][_0xfea0('0x11d')](db['CmContact'],{'as':_0xfea0('0x163'),'foreignKey':_0xfea0('0x164'),'onDelete':'cascade'});db[_0xfea0('0x14e')]['belongsTo'](db[_0xfea0('0xf2')],{'as':_0xfea0('0x16c'),'foreignKey':_0xfea0('0x179'),'onDelete':_0xfea0('0x10d')});db['CmHopper'][_0xfea0('0x11d')](db[_0xfea0('0x12')],{'as':_0xfea0('0x196'),'foreignKey':_0xfea0('0x10e')});db['CmHopper'][_0xfea0('0x11d')](db[_0xfea0('0x12a')],{'as':'Queue','foreignKey':_0xfea0('0x14d'),'onDelete':_0xfea0('0x10d')});db[_0xfea0('0x14e')][_0xfea0('0x11d')](db[_0xfea0('0xe5')],{'as':_0xfea0('0xe5'),'foreignKey':'CampaignId','onDelete':_0xfea0('0x10d')});db[_0xfea0('0x14e')][_0xfea0('0x11d')](db[_0xfea0('0x12')],{'as':_0xfea0('0x170'),'foreignKey':_0xfea0('0x1a5')});db[_0xfea0('0x6c')][_0xfea0('0x11d')](db[_0xfea0('0x120')],{'as':_0xfea0('0x163'),'foreignKey':_0xfea0('0x164'),'onDelete':'cascade'});db[_0xfea0('0x6c')][_0xfea0('0x11d')](db['CmList'],{'as':_0xfea0('0x16c'),'foreignKey':_0xfea0('0x179'),'onDelete':_0xfea0('0x10d')});db[_0xfea0('0x6c')][_0xfea0('0x11d')](db[_0xfea0('0x12a')],{'as':_0xfea0('0x197'),'foreignKey':_0xfea0('0x14d'),'onDelete':_0xfea0('0x10d')});db['CmHopperBlack']['belongsTo'](db[_0xfea0('0xe5')],{'as':'Campaign','foreignKey':'CampaignId','onDelete':_0xfea0('0x10d')});db[_0xfea0('0x74')][_0xfea0('0x110')](db[_0xfea0('0x78')],{'as':{'plural':'All','singular':_0xfea0('0x1a6')},'foreignKey':_0xfea0('0x1a7'),'onDelete':_0xfea0('0x10d'),'hooks':!![]});db[_0xfea0('0x74')][_0xfea0('0x110')](db[_0xfea0('0x78')],{'as':{'plural':_0xfea0('0x1a8'),'singular':_0xfea0('0x1a9')},'foreignKey':_0xfea0('0x1aa'),'onDelete':'cascade','hooks':!![]});db[_0xfea0('0x74')][_0xfea0('0x110')](db[_0xfea0('0x1ab')],{'as':'Actions','foreignKey':_0xfea0('0x1ac'),'onDelete':'cascade','hooks':!![]});db[_0xfea0('0x168')][_0xfea0('0x110')](db[_0xfea0('0x168')],{'as':_0xfea0('0x17b'),'foreignKey':'ParentId','onDelete':'cascade'});db[_0xfea0('0x7a')]['hasMany'](db[_0xfea0('0x7a')],{'as':_0xfea0('0x1ad'),'foreignKey':_0xfea0('0x155'),'onDelete':_0xfea0('0x10d'),'hooks':!![],'required':![]});db[_0xfea0('0x7a')][_0xfea0('0x110')](db[_0xfea0('0x18')],{'as':_0xfea0('0x112'),'foreignKey':_0xfea0('0x155'),'onDelete':_0xfea0('0x177')});db[_0xfea0('0x7a')]['hasMany'](db[_0xfea0('0x40')],{'as':_0xfea0('0x1ae'),'foreignKey':_0xfea0('0x155')});db[_0xfea0('0x7a')][_0xfea0('0x110')](db[_0xfea0('0x5c')],{'as':_0xfea0('0x1af'),'foreignKey':'IntervalId'});db[_0xfea0('0x7a')][_0xfea0('0x110')](db[_0xfea0('0x181')],{'as':_0xfea0('0x1b0'),'foreignKey':_0xfea0('0x155')});db[_0xfea0('0x7a')][_0xfea0('0x110')](db[_0xfea0('0x4d')],{'as':_0xfea0('0x1b1'),'foreignKey':_0xfea0('0x155')});db[_0xfea0('0x80')]['belongsTo'](db['MailAccount'],{});db[_0xfea0('0x80')][_0xfea0('0x11d')](db[_0xfea0('0x94')],{'foreignKey':'DefaultReportId'});db[_0xfea0('0x80')][_0xfea0('0x11d')](db[_0xfea0('0x1b2')],{'foreignKey':_0xfea0('0x1b3')});db[_0xfea0('0x1b4')][_0xfea0('0x11f')](db[_0xfea0('0x19')],{'as':_0xfea0('0x1b5'),'through':'moh_has_sounds','onDelete':_0xfea0('0x177')});db[_0xfea0('0x82')]['belongsToMany'](db[_0xfea0('0x120')],{'through':'cm_contact_has_tags'});db[_0xfea0('0x82')][_0xfea0('0x11f')](db[_0xfea0('0x5e')],{'through':'chat_interaction_has_tags'});db['Tag']['belongsToMany'](db['MailInteraction'],{'through':_0xfea0('0x171')});db[_0xfea0('0x82')][_0xfea0('0x11f')](db[_0xfea0('0x4e')],{'through':_0xfea0('0x18c')});db['Tag']['belongsToMany'](db[_0xfea0('0x48')],{'through':'fax_interaction_has_tags'});db[_0xfea0('0x82')][_0xfea0('0x11f')](db[_0xfea0('0x53')],{'through':_0xfea0('0x193')});db[_0xfea0('0x82')]['belongsToMany'](db[_0xfea0('0x119')],{'through':_0xfea0('0x1b6')});db[_0xfea0('0x86')][_0xfea0('0x11d')](db['ContactItemType'],{'as':'ItemType','foreignKey':_0xfea0('0x1b7')});db[_0xfea0('0x88')][_0xfea0('0x11d')](db[_0xfea0('0x14e')],{'as':_0xfea0('0x1b8'),'foreignKey':_0xfea0('0x1a4')});db[_0xfea0('0x8c')]['hasMany'](db[_0xfea0('0x78')],{'as':{'plural':'AllConditions','singular':_0xfea0('0x1b9')},'foreignKey':_0xfea0('0x1ba'),'onDelete':_0xfea0('0x10d'),'hooks':!![]});db[_0xfea0('0x8c')]['hasMany'](db[_0xfea0('0x78')],{'as':{'plural':_0xfea0('0x1bb'),'singular':_0xfea0('0x1bc')},'foreignKey':'TriggerAnyId','onDelete':_0xfea0('0x10d'),'hooks':!![]});db[_0xfea0('0x8c')][_0xfea0('0x110')](db[_0xfea0('0x1ab')],{'as':_0xfea0('0x1bd'),'foreignKey':_0xfea0('0x1be'),'onDelete':_0xfea0('0x10d'),'hooks':!![]});db[_0xfea0('0x1b2')][_0xfea0('0x110')](db['AnalyticFieldReport'],{'as':'Fields','onDelete':_0xfea0('0x10d'),'foreignKey':'CustomReportId','hooks':!![]});db[_0xfea0('0x94')]['hasMany'](db[_0xfea0('0x1bf')],{'as':'Fields','onDelete':_0xfea0('0x10d'),'foreignKey':_0xfea0('0x1c0')});db['AnalyticMetric'][_0xfea0('0x110')](db['AnalyticFieldReport'],{'as':_0xfea0('0x1c1'),'onDelete':'cascade','foreignKey':'MetricId'});db[_0xfea0('0x1bf')][_0xfea0('0x11d')](db[_0xfea0('0x97')],{'foreignKey':_0xfea0('0x1c2')});db[_0xfea0('0x9b')]['hasMany'](db[_0xfea0('0x1c3')],{'as':_0xfea0('0x1c4'),'onDelete':_0xfea0('0x10d'),'foreignKey':'AccountId'});db['SalesforceConfiguration'][_0xfea0('0x110')](db[_0xfea0('0x9e')],{'as':_0xfea0('0x1c5'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0xfea0('0x1c3')][_0xfea0('0x110')](db[_0xfea0('0x9e')],{'as':_0xfea0('0x1c6'),'onDelete':_0xfea0('0x10d'),'foreignKey':_0xfea0('0x1c7')});db[_0xfea0('0x1c3')]['hasMany'](db['SalesforceField'],{'as':'Fields','onDelete':_0xfea0('0x10d'),'foreignKey':'FieldId'});db[_0xfea0('0x1c3')]['belongsTo'](db[_0xfea0('0x9b')],{'as':_0xfea0('0x16f'),'foreignKey':_0xfea0('0x1c8')});db[_0xfea0('0x9e')]['hasMany'](db[_0xfea0('0x9e')],{'as':'Subject','foreignKey':'SubjectId'});db['SalesforceField'][_0xfea0('0x110')](db[_0xfea0('0x9e')],{'as':_0xfea0('0x1c9'),'foreignKey':_0xfea0('0x1c7')});db[_0xfea0('0x9e')][_0xfea0('0x110')](db[_0xfea0('0x9e')],{'as':_0xfea0('0x1ca'),'foreignKey':_0xfea0('0x1cb')});db['SalesforceField'][_0xfea0('0x11d')](db[_0xfea0('0x8e')],{'as':'Variable','foreignKey':'VariableId'});db[_0xfea0('0x9f')][_0xfea0('0x110')](db[_0xfea0('0xa0')],{'as':_0xfea0('0x1c4'),'onDelete':'cascade','foreignKey':_0xfea0('0x1c8')});db[_0xfea0('0xa0')][_0xfea0('0x110')](db[_0xfea0('0x1cc')],{'as':_0xfea0('0x1c5'),'onDelete':_0xfea0('0x10d'),'foreignKey':'SubjectId'});db[_0xfea0('0xa0')][_0xfea0('0x110')](db[_0xfea0('0x1cc')],{'as':_0xfea0('0x1c6'),'onDelete':_0xfea0('0x10d'),'foreignKey':_0xfea0('0x1c7')});db[_0xfea0('0xa0')][_0xfea0('0x110')](db[_0xfea0('0x1cc')],{'as':'Fields','onDelete':_0xfea0('0x10d'),'foreignKey':_0xfea0('0x1cb')});db[_0xfea0('0xa0')][_0xfea0('0x11d')](db[_0xfea0('0x9f')],{'as':_0xfea0('0x16f'),'foreignKey':_0xfea0('0x1c8')});db[_0xfea0('0x1cc')][_0xfea0('0x110')](db[_0xfea0('0x1cc')],{'as':_0xfea0('0x1cd'),'foreignKey':_0xfea0('0x1ce')});db[_0xfea0('0x1cc')]['hasMany'](db[_0xfea0('0x1cc')],{'as':'Description','foreignKey':'DescriptionId'});db[_0xfea0('0x1cc')]['hasMany'](db[_0xfea0('0x1cc')],{'as':'Field','foreignKey':_0xfea0('0x1cb')});db[_0xfea0('0x1cc')][_0xfea0('0x11d')](db[_0xfea0('0x8e')],{'as':_0xfea0('0x8e'),'foreignKey':_0xfea0('0x1cf')});db[_0xfea0('0xa3')]['hasMany'](db[_0xfea0('0xa5')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0xfea0('0x1c8')});db['DeskConfiguration']['hasMany'](db[_0xfea0('0xa7')],{'as':_0xfea0('0x1c5'),'onDelete':'cascade','foreignKey':_0xfea0('0x1ce')});db[_0xfea0('0xa5')][_0xfea0('0x110')](db[_0xfea0('0xa7')],{'as':_0xfea0('0x1c6'),'onDelete':_0xfea0('0x10d'),'foreignKey':_0xfea0('0x1c7')});db[_0xfea0('0xa5')][_0xfea0('0x110')](db[_0xfea0('0xa7')],{'as':'Fields','onDelete':'cascade','foreignKey':'FieldId'});db[_0xfea0('0xa5')][_0xfea0('0x11d')](db[_0xfea0('0xa3')],{'as':_0xfea0('0x16f'),'foreignKey':_0xfea0('0x1c8')});db[_0xfea0('0xa5')][_0xfea0('0x11f')](db['Tag'],{'through':_0xfea0('0x1d0')});db['DeskField'][_0xfea0('0x110')](db[_0xfea0('0xa7')],{'as':_0xfea0('0x1cd'),'foreignKey':_0xfea0('0x1ce')});db['DeskField'][_0xfea0('0x110')](db[_0xfea0('0xa7')],{'as':'Description','foreignKey':_0xfea0('0x1c7')});db['DeskField'][_0xfea0('0x110')](db[_0xfea0('0xa7')],{'as':_0xfea0('0x1ca'),'foreignKey':_0xfea0('0x1cb')});db[_0xfea0('0xa7')][_0xfea0('0x11d')](db[_0xfea0('0x8e')],{'as':_0xfea0('0x8e'),'foreignKey':'VariableId'});db[_0xfea0('0xa9')][_0xfea0('0x110')](db[_0xfea0('0xab')],{'as':_0xfea0('0x1c4'),'onDelete':'cascade','foreignKey':_0xfea0('0x1c8')});db[_0xfea0('0xab')][_0xfea0('0x110')](db['ZohoField'],{'as':_0xfea0('0x1c5'),'onDelete':'cascade','foreignKey':_0xfea0('0x1ce')});db[_0xfea0('0xab')]['hasMany'](db[_0xfea0('0xad')],{'as':_0xfea0('0x1c6'),'onDelete':_0xfea0('0x10d'),'foreignKey':_0xfea0('0x1c7')});db[_0xfea0('0xab')]['hasMany'](db['ZohoField'],{'as':_0xfea0('0x1c1'),'onDelete':_0xfea0('0x10d'),'foreignKey':'FieldId'});db[_0xfea0('0xab')][_0xfea0('0x11d')](db['ZohoAccount'],{'as':_0xfea0('0x16f'),'foreignKey':'AccountId'});db[_0xfea0('0xad')][_0xfea0('0x110')](db['ZohoField'],{'as':_0xfea0('0x1cd'),'foreignKey':_0xfea0('0x1ce')});db[_0xfea0('0xad')]['hasMany'](db[_0xfea0('0xad')],{'as':_0xfea0('0x1c9'),'foreignKey':_0xfea0('0x1c7')});db[_0xfea0('0xad')][_0xfea0('0x110')](db[_0xfea0('0xad')],{'as':'Field','foreignKey':_0xfea0('0x1cb')});db['ZohoField'][_0xfea0('0x11d')](db[_0xfea0('0x8e')],{'as':'Variable','foreignKey':_0xfea0('0x1cf')});db[_0xfea0('0xae')]['hasMany'](db[_0xfea0('0xb0')],{'as':_0xfea0('0x1c4'),'onDelete':_0xfea0('0x10d'),'foreignKey':_0xfea0('0x1c8')});db['ZendeskConfiguration']['hasMany'](db[_0xfea0('0xb2')],{'as':_0xfea0('0x1c5'),'foreignKey':'SubjectId'});db[_0xfea0('0xb0')][_0xfea0('0x110')](db[_0xfea0('0xb2')],{'as':_0xfea0('0x1c6'),'foreignKey':_0xfea0('0x1c7')});db[_0xfea0('0xb0')][_0xfea0('0x110')](db[_0xfea0('0xb2')],{'as':_0xfea0('0x1c1'),'foreignKey':_0xfea0('0x1cb')});db[_0xfea0('0xb0')][_0xfea0('0x11d')](db['ZendeskAccount'],{'as':_0xfea0('0x16f'),'foreignKey':_0xfea0('0x1c8')});db[_0xfea0('0xb0')][_0xfea0('0x11f')](db[_0xfea0('0x82')],{'through':_0xfea0('0x1d1')});db[_0xfea0('0xb2')][_0xfea0('0x110')](db['ZendeskField'],{'as':_0xfea0('0x1cd'),'foreignKey':_0xfea0('0x1ce')});db[_0xfea0('0xb2')][_0xfea0('0x110')](db[_0xfea0('0xb2')],{'as':_0xfea0('0x1c9'),'foreignKey':_0xfea0('0x1c7')});db['ZendeskField'][_0xfea0('0x110')](db[_0xfea0('0xb2')],{'as':_0xfea0('0x1ca'),'foreignKey':_0xfea0('0x1cb')});db['ZendeskField'][_0xfea0('0x11d')](db['Variable'],{'as':_0xfea0('0x8e'),'foreignKey':_0xfea0('0x1cf')});db['FreshdeskAccount'][_0xfea0('0x110')](db[_0xfea0('0x1d2')],{'as':_0xfea0('0x1c4'),'onDelete':'cascade','foreignKey':_0xfea0('0x1c8')});db[_0xfea0('0x1d2')][_0xfea0('0x110')](db[_0xfea0('0x1d3')],{'as':_0xfea0('0x1c5'),'onDelete':_0xfea0('0x10d'),'foreignKey':_0xfea0('0x1ce')});db[_0xfea0('0x1d2')][_0xfea0('0x110')](db[_0xfea0('0x1d3')],{'as':_0xfea0('0x1c6'),'onDelete':'cascade','foreignKey':_0xfea0('0x1c7')});db[_0xfea0('0x1d2')][_0xfea0('0x110')](db['FreshdeskField'],{'as':_0xfea0('0x1c1'),'onDelete':'cascade','foreignKey':_0xfea0('0x1cb')});db[_0xfea0('0x1d2')][_0xfea0('0x11d')](db[_0xfea0('0xb4')],{'as':'Account','foreignKey':_0xfea0('0x1c8')});db[_0xfea0('0x1d2')][_0xfea0('0x11f')](db['Tag'],{'through':_0xfea0('0x1d4')});db[_0xfea0('0x1d3')]['hasMany'](db['FreshdeskField'],{'as':_0xfea0('0x1cd'),'foreignKey':_0xfea0('0x1ce')});db['FreshdeskField'][_0xfea0('0x110')](db['FreshdeskField'],{'as':_0xfea0('0x1c9'),'foreignKey':_0xfea0('0x1c7')});db['FreshdeskField'][_0xfea0('0x110')](db['FreshdeskField'],{'as':'Field','foreignKey':_0xfea0('0x1cb')});db[_0xfea0('0x1d3')][_0xfea0('0x11d')](db[_0xfea0('0x8e')],{'as':'Variable','foreignKey':_0xfea0('0x1cf')});db[_0xfea0('0xb8')]['hasMany'](db['VtigerConfiguration'],{'as':_0xfea0('0x1c4'),'onDelete':_0xfea0('0x10d'),'foreignKey':'AccountId'});db[_0xfea0('0xb9')][_0xfea0('0x110')](db[_0xfea0('0x1d5')],{'as':'Subjects','foreignKey':'SubjectId'});db[_0xfea0('0xb9')][_0xfea0('0x110')](db[_0xfea0('0x1d5')],{'as':_0xfea0('0x1c6'),'foreignKey':_0xfea0('0x1c7')});db[_0xfea0('0xb9')][_0xfea0('0x110')](db[_0xfea0('0x1d5')],{'as':_0xfea0('0x1c1'),'foreignKey':'FieldId'});db[_0xfea0('0xb9')][_0xfea0('0x11d')](db[_0xfea0('0xb8')],{'as':'Account','foreignKey':_0xfea0('0x1c8')});db['VtigerField']['hasMany'](db['VtigerField'],{'as':_0xfea0('0x1cd'),'foreignKey':_0xfea0('0x1ce')});db[_0xfea0('0x1d5')]['hasMany'](db['VtigerField'],{'as':_0xfea0('0x1c9'),'foreignKey':_0xfea0('0x1c7')});db[_0xfea0('0x1d5')]['hasMany'](db['VtigerField'],{'as':_0xfea0('0x1ca'),'foreignKey':_0xfea0('0x1cb')});db[_0xfea0('0x1d5')]['belongsTo'](db[_0xfea0('0x8e')],{'as':_0xfea0('0x8e'),'foreignKey':_0xfea0('0x1cf')});db['ServicenowAccount'][_0xfea0('0x110')](db[_0xfea0('0xbd')],{'as':_0xfea0('0x1c4'),'onDelete':_0xfea0('0x10d'),'foreignKey':_0xfea0('0x1c8')});db[_0xfea0('0xbd')][_0xfea0('0x110')](db[_0xfea0('0xbf')],{'as':_0xfea0('0x1c5'),'foreignKey':_0xfea0('0x1ce')});db[_0xfea0('0xbd')][_0xfea0('0x110')](db[_0xfea0('0xbf')],{'as':_0xfea0('0x1c6'),'foreignKey':_0xfea0('0x1c7')});db[_0xfea0('0xbd')][_0xfea0('0x110')](db[_0xfea0('0xbf')],{'as':_0xfea0('0x1c1'),'foreignKey':_0xfea0('0x1cb')});db[_0xfea0('0xbd')][_0xfea0('0x11d')](db[_0xfea0('0x1d6')],{'as':_0xfea0('0x16f'),'foreignKey':'AccountId'});db['ServicenowField'][_0xfea0('0x110')](db['ServicenowField'],{'as':_0xfea0('0x1cd'),'foreignKey':_0xfea0('0x1ce')});db[_0xfea0('0xbf')][_0xfea0('0x110')](db['ServicenowField'],{'as':_0xfea0('0x1c9'),'foreignKey':'DescriptionId'});db['ServicenowField'][_0xfea0('0x110')](db[_0xfea0('0xbf')],{'as':'Field','foreignKey':_0xfea0('0x1cb')});db[_0xfea0('0xbf')][_0xfea0('0x11d')](db[_0xfea0('0x8e')],{'as':_0xfea0('0x8e'),'foreignKey':_0xfea0('0x1cf')});db[_0xfea0('0xc1')][_0xfea0('0x110')](db[_0xfea0('0x1d7')],{'as':_0xfea0('0x1c4'),'onDelete':'cascade','foreignKey':_0xfea0('0x1c8')});db[_0xfea0('0x1d7')][_0xfea0('0x110')](db[_0xfea0('0xc4')],{'as':'Subjects','onDelete':_0xfea0('0x10d'),'foreignKey':_0xfea0('0x1ce')});db['Dynamics365Configuration'][_0xfea0('0x110')](db[_0xfea0('0xc4')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0xfea0('0x1c7')});db[_0xfea0('0x1d7')][_0xfea0('0x110')](db[_0xfea0('0xc4')],{'as':_0xfea0('0x1c1'),'onDelete':_0xfea0('0x10d'),'foreignKey':_0xfea0('0x1cb')});db['Dynamics365Configuration'][_0xfea0('0x11d')](db[_0xfea0('0xc1')],{'as':'Account','foreignKey':_0xfea0('0x1c8')});db[_0xfea0('0xc4')]['hasMany'](db['Dynamics365Field'],{'as':_0xfea0('0x1cd'),'foreignKey':_0xfea0('0x1ce')});db[_0xfea0('0xc4')]['hasMany'](db[_0xfea0('0xc4')],{'as':_0xfea0('0x1c9'),'foreignKey':_0xfea0('0x1c7')});db[_0xfea0('0xc4')][_0xfea0('0x110')](db[_0xfea0('0xc4')],{'as':'Field','foreignKey':_0xfea0('0x1cb')});db[_0xfea0('0xc4')][_0xfea0('0x11d')](db[_0xfea0('0x8e')],{'as':_0xfea0('0x8e'),'foreignKey':'VariableId'});db['FreshsalesAccount'][_0xfea0('0x110')](db[_0xfea0('0xc8')],{'as':'Configurations','onDelete':_0xfea0('0x10d'),'foreignKey':'AccountId'});db[_0xfea0('0xc8')][_0xfea0('0x110')](db[_0xfea0('0xca')],{'as':'Subjects','foreignKey':'SubjectId'});db[_0xfea0('0xc8')][_0xfea0('0x110')](db[_0xfea0('0xca')],{'as':_0xfea0('0x1c6'),'foreignKey':_0xfea0('0x1c7')});db[_0xfea0('0xc8')][_0xfea0('0x110')](db[_0xfea0('0xca')],{'as':_0xfea0('0x1c1'),'foreignKey':_0xfea0('0x1cb')});db[_0xfea0('0xc8')]['belongsTo'](db[_0xfea0('0xc6')],{'as':_0xfea0('0x16f'),'foreignKey':_0xfea0('0x1c8')});db[_0xfea0('0xca')][_0xfea0('0x110')](db[_0xfea0('0xca')],{'as':'Subject','foreignKey':_0xfea0('0x1ce')});db['FreshsalesField'][_0xfea0('0x110')](db['FreshsalesField'],{'as':_0xfea0('0x1c9'),'foreignKey':_0xfea0('0x1c7')});db['FreshsalesField'][_0xfea0('0x110')](db['FreshsalesField'],{'as':'Field','foreignKey':_0xfea0('0x1cb')});db['FreshsalesField']['belongsTo'](db['Variable'],{'as':_0xfea0('0x8e'),'foreignKey':'VariableId'});db['ChatQueueReport'][_0xfea0('0x11d')](db['ChatWebsite'],{});db[_0xfea0('0xcd')][_0xfea0('0x11d')](db[_0xfea0('0xf2')],{'as':_0xfea0('0x16c'),'foreignKey':_0xfea0('0x179')});db[_0xfea0('0xcd')]['belongsTo'](db[_0xfea0('0x120')],{'as':_0xfea0('0x163'),'foreignKey':_0xfea0('0x164')});db[_0xfea0('0xcd')][_0xfea0('0x11d')](db[_0xfea0('0x5e')],{});db[_0xfea0('0xcd')]['belongsTo'](db[_0xfea0('0x60')],{});db['ChatQueueReport'][_0xfea0('0x11d')](db[_0xfea0('0x12')],{});db[_0xfea0('0xcd')][_0xfea0('0x11d')](db[_0xfea0('0x64')],{});db[_0xfea0('0x19b')]['belongsTo'](db[_0xfea0('0x12')],{'onDelete':_0xfea0('0x10d'),'foreignKey':_0xfea0('0x1d8')});db[_0xfea0('0x19b')][_0xfea0('0x11d')](db['User'],{'onDelete':_0xfea0('0x10d'),'foreignKey':_0xfea0('0x1d9')});db[_0xfea0('0xd4')][_0xfea0('0x110')](db[_0xfea0('0xd2')],{'foreignKey':_0xfea0('0x1da'),'onDelete':_0xfea0('0x10d')});db['JscriptySessionReport'][_0xfea0('0x110')](db[_0xfea0('0xd0')],{'foreignKey':_0xfea0('0x1da'),'onDelete':_0xfea0('0x10d')});db['SmsQueueReport']['belongsTo'](db[_0xfea0('0x4c')],{});db[_0xfea0('0x1db')][_0xfea0('0x11d')](db[_0xfea0('0xf2')],{'as':_0xfea0('0x16c'),'foreignKey':_0xfea0('0x179')});db[_0xfea0('0x1db')][_0xfea0('0x11d')](db[_0xfea0('0x120')],{'as':_0xfea0('0x163'),'foreignKey':'ContactId'});db[_0xfea0('0x1db')]['belongsTo'](db[_0xfea0('0x4e')],{});db[_0xfea0('0x1db')][_0xfea0('0x11d')](db[_0xfea0('0x18a')],{});db[_0xfea0('0x1db')][_0xfea0('0x11d')](db[_0xfea0('0x12')],{});db[_0xfea0('0x1db')]['belongsTo'](db['SmsQueue'],{});db['JscriptyProject'][_0xfea0('0x110')](db[_0xfea0('0xd4')],{'foreignKey':_0xfea0('0x1dc')});db['JscriptyProject'][_0xfea0('0x110')](db[_0xfea0('0xd2')],{'foreignKey':_0xfea0('0x1dc')});db[_0xfea0('0xd9')]['hasMany'](db[_0xfea0('0xd0')],{'foreignKey':_0xfea0('0x1dc')});db['SquareProject'][_0xfea0('0x11f')](db[_0xfea0('0x12')],{'as':'Users','through':_0xfea0('0x146')});db[_0xfea0('0xe2')][_0xfea0('0x11f')](db[_0xfea0('0x12')],{'as':_0xfea0('0x159'),'through':_0xfea0('0x123')});db['Team'][_0xfea0('0x11f')](db[_0xfea0('0x12a')],{'through':'TeamVoiceQueue','as':'VoiceQueues'});db[_0xfea0('0xe2')][_0xfea0('0x11f')](db[_0xfea0('0x12d')],{'through':_0xfea0('0x1dd'),'as':_0xfea0('0x1de')});db[_0xfea0('0xe2')][_0xfea0('0x11f')](db[_0xfea0('0x64')],{'through':_0xfea0('0x19a'),'as':_0xfea0('0x12e')});db[_0xfea0('0xe2')][_0xfea0('0x11f')](db[_0xfea0('0x130')],{'through':_0xfea0('0x187'),'as':_0xfea0('0x131')});db[_0xfea0('0xe2')][_0xfea0('0x11f')](db[_0xfea0('0x132')],{'through':_0xfea0('0x18e'),'as':'SmsQueues'});db['Team'][_0xfea0('0x11f')](db[_0xfea0('0x56')],{'through':_0xfea0('0x194'),'as':_0xfea0('0x134')});db[_0xfea0('0xe2')]['belongsToMany'](db[_0xfea0('0x107')],{'through':_0xfea0('0x1df'),'as':_0xfea0('0x1e0')});db['Campaign'][_0xfea0('0x110')](db[_0xfea0('0x14e')],{'as':_0xfea0('0x1a0'),'foreignKey':'CampaignId'});db[_0xfea0('0xe5')][_0xfea0('0x110')](db['CmHopperFinal'],{'as':_0xfea0('0x113'),'foreignKey':_0xfea0('0x1e1')});db[_0xfea0('0xe5')]['hasMany'](db[_0xfea0('0x70')],{'as':_0xfea0('0x1a1'),'foreignKey':_0xfea0('0x1e1')});db[_0xfea0('0xe5')]['hasMany'](db[_0xfea0('0x6c')],{'as':_0xfea0('0x14f'),'foreignKey':_0xfea0('0x1e1')});db[_0xfea0('0xe5')][_0xfea0('0x11d')](db['Trunk'],{'as':_0xfea0('0x151'),'foreignKey':_0xfea0('0x152')});db['Campaign'][_0xfea0('0x11d')](db[_0xfea0('0x151')],{'as':_0xfea0('0x153'),'foreignKey':_0xfea0('0x154')});db[_0xfea0('0xe5')][_0xfea0('0x11d')](db[_0xfea0('0x7a')],{'as':_0xfea0('0x7a'),'foreignKey':'IntervalId'});db[_0xfea0('0xe5')][_0xfea0('0x11d')](db[_0xfea0('0x144')],{'as':_0xfea0('0x144'),'foreignKey':_0xfea0('0x1e2')});db['Campaign'][_0xfea0('0x11f')](db['CmList'],{'as':_0xfea0('0x1e3'),'through':_0xfea0('0x1e4')});db[_0xfea0('0xe5')][_0xfea0('0x11f')](db[_0xfea0('0xf2')],{'as':_0xfea0('0x15b'),'through':_0xfea0('0x1e5')});db['Attachment'][_0xfea0('0x11d')](db['ChatOfflineMessage'],{'as':_0xfea0('0x62'),'foreignKey':'ChatOfflineMessageId'});db['MailTransferReport'][_0xfea0('0x11d')](db[_0xfea0('0x3e')],{});db[_0xfea0('0x1e6')][_0xfea0('0x11d')](db[_0xfea0('0x3d')],{});db[_0xfea0('0x1e6')][_0xfea0('0x11d')](db['MailAccount'],{'foreignKey':_0xfea0('0x1e7'),'as':'FromAccount'});db['MailTransferReport'][_0xfea0('0x11d')](db[_0xfea0('0x12')],{'foreignKey':_0xfea0('0x1e8'),'as':_0xfea0('0x1e9')});db[_0xfea0('0x1e6')][_0xfea0('0x11d')](db['User'],{'foreignKey':'ToUserId','as':_0xfea0('0x1ea')});db[_0xfea0('0x1e6')][_0xfea0('0x11d')](db['MailQueue'],{'foreignKey':'ToMailQueueId','as':_0xfea0('0x1eb')});db[_0xfea0('0x1e6')][_0xfea0('0x11d')](db[_0xfea0('0x39')],{'foreignKey':_0xfea0('0x1ec'),'as':_0xfea0('0x1ed')});db[_0xfea0('0xed')][_0xfea0('0x11d')](db[_0xfea0('0x60')],{});db[_0xfea0('0xed')][_0xfea0('0x11d')](db['ChatInteraction'],{});db['ChatTransferReport'][_0xfea0('0x11d')](db[_0xfea0('0x58')],{'foreignKey':_0xfea0('0x1ee'),'as':_0xfea0('0x1ef')});db[_0xfea0('0xed')][_0xfea0('0x11d')](db[_0xfea0('0x12')],{'foreignKey':_0xfea0('0x1e8'),'as':_0xfea0('0x1e9')});db[_0xfea0('0xed')][_0xfea0('0x11d')](db[_0xfea0('0x12')],{'foreignKey':_0xfea0('0x1f0'),'as':'ToAgent'});db[_0xfea0('0xed')][_0xfea0('0x11d')](db[_0xfea0('0x64')],{'foreignKey':_0xfea0('0x1f1'),'as':'ToQueue'});db[_0xfea0('0xed')][_0xfea0('0x11d')](db['ChatWebsite'],{'foreignKey':_0xfea0('0x1f2'),'as':'ToAccount'});db['FaxTransferReport'][_0xfea0('0x11d')](db[_0xfea0('0x17f')],{});db[_0xfea0('0xee')]['belongsTo'](db['FaxInteraction'],{});db[_0xfea0('0xee')][_0xfea0('0x11d')](db[_0xfea0('0x13a')],{'foreignKey':_0xfea0('0x1f3'),'as':'FromAccount'});db[_0xfea0('0xee')][_0xfea0('0x11d')](db['User'],{'foreignKey':_0xfea0('0x1e8'),'as':_0xfea0('0x1e9')});db[_0xfea0('0xee')][_0xfea0('0x11d')](db[_0xfea0('0x12')],{'foreignKey':_0xfea0('0x1f0'),'as':_0xfea0('0x1ea')});db['FaxTransferReport'][_0xfea0('0x11d')](db[_0xfea0('0x130')],{'foreignKey':_0xfea0('0x1f4'),'as':'ToQueue'});db[_0xfea0('0xee')][_0xfea0('0x11d')](db[_0xfea0('0x13a')],{'foreignKey':_0xfea0('0x1f5'),'as':_0xfea0('0x1ed')});db[_0xfea0('0xef')]['belongsTo'](db[_0xfea0('0x54')],{});db['OpenchannelTransferReport'][_0xfea0('0x11d')](db[_0xfea0('0x53')],{});db[_0xfea0('0xef')]['belongsTo'](db[_0xfea0('0x50')],{'foreignKey':'FromOpenchannelAccountId','as':'FromAccount'});db[_0xfea0('0xef')][_0xfea0('0x11d')](db[_0xfea0('0x12')],{'foreignKey':_0xfea0('0x1e8'),'as':_0xfea0('0x1e9')});db[_0xfea0('0xef')][_0xfea0('0x11d')](db[_0xfea0('0x12')],{'foreignKey':_0xfea0('0x1f0'),'as':'ToAgent'});db[_0xfea0('0xef')]['belongsTo'](db[_0xfea0('0x56')],{'foreignKey':_0xfea0('0x1f6'),'as':_0xfea0('0x1eb')});db[_0xfea0('0xef')][_0xfea0('0x11d')](db[_0xfea0('0x50')],{'foreignKey':_0xfea0('0x1f7'),'as':_0xfea0('0x1ed')});db['SmsTransferReport'][_0xfea0('0x11d')](db[_0xfea0('0x18a')],{});db[_0xfea0('0x1f8')][_0xfea0('0x11d')](db[_0xfea0('0x4e')],{});db[_0xfea0('0x1f8')]['belongsTo'](db['SmsAccount'],{'foreignKey':_0xfea0('0x1f9'),'as':_0xfea0('0x1ef')});db[_0xfea0('0x1f8')][_0xfea0('0x11d')](db['User'],{'foreignKey':'FromUserId','as':_0xfea0('0x1e9')});db[_0xfea0('0x1f8')]['belongsTo'](db[_0xfea0('0x12')],{'foreignKey':_0xfea0('0x1f0'),'as':'ToAgent'});db[_0xfea0('0x1f8')][_0xfea0('0x11d')](db[_0xfea0('0x132')],{'foreignKey':_0xfea0('0x1fa'),'as':'ToQueue'});db[_0xfea0('0x1f8')][_0xfea0('0x11d')](db['SmsAccount'],{'foreignKey':'ToSmsAccountId','as':'ToAccount'});db['CmList'][_0xfea0('0x110')](db[_0xfea0('0x168')],{'as':_0xfea0('0x17b'),'foreignKey':_0xfea0('0x179'),'onDelete':_0xfea0('0x10d')});db['CmList'][_0xfea0('0x110')](db[_0xfea0('0x1fb')],{'as':_0xfea0('0x1fc'),'foreignKey':_0xfea0('0x179')});db[_0xfea0('0xf2')][_0xfea0('0x110')](db[_0xfea0('0x120')],{'as':_0xfea0('0x19e'),'onDelete':'cascade','foreignKey':_0xfea0('0x179')});db[_0xfea0('0xf2')]['hasMany'](db[_0xfea0('0x6e')],{'as':'HopperFinals','foreignKey':_0xfea0('0x179')});db[_0xfea0('0xf2')][_0xfea0('0x110')](db[_0xfea0('0x70')],{'as':'HopperHistory','foreignKey':_0xfea0('0x179')});db[_0xfea0('0xf2')][_0xfea0('0x110')](db[_0xfea0('0x71')],{'as':'ReportAgentPreview','foreignKey':_0xfea0('0x179')});db[_0xfea0('0xf2')][_0xfea0('0x11f')](db[_0xfea0('0x12a')],{'as':_0xfea0('0x1fd'),'through':'voice_queues_has_cm_lists'});db[_0xfea0('0xf2')]['belongsToMany'](db[_0xfea0('0x12')],{'as':_0xfea0('0x159'),'through':_0xfea0('0x122')});db[_0xfea0('0xf4')][_0xfea0('0x110')](db[_0xfea0('0x18')],{'as':_0xfea0('0x112'),'onDelete':_0xfea0('0x10d')});db['VoicePrefix']['belongsToMany'](db['User'],{'as':_0xfea0('0x159'),'through':'user_has_voice_prefixes'});db[_0xfea0('0x11e')]['hasMany'](db[_0xfea0('0x12')],{'as':_0xfea0('0x184'),'foreignKey':_0xfea0('0x1fe')});db['UserProfile']['hasMany'](db[_0xfea0('0xf7')],{'as':_0xfea0('0x1ff'),'foreignKey':_0xfea0('0x1fe'),'onDelete':_0xfea0('0x10d')});db[_0xfea0('0xf7')][_0xfea0('0x110')](db[_0xfea0('0xf9')],{'as':_0xfea0('0x200'),'foreignKey':_0xfea0('0x201'),'onDelete':_0xfea0('0x10d')});db[_0xfea0('0xfc')]['hasMany'](db[_0xfea0('0x168')],{'as':_0xfea0('0x17b'),'foreignKey':_0xfea0('0x202'),'onDelete':_0xfea0('0x10d')});db[_0xfea0('0xfc')][_0xfea0('0x110')](db[_0xfea0('0x169')],{'as':_0xfea0('0x16a'),'foreignKey':_0xfea0('0x202')});db[_0xfea0('0xfc')][_0xfea0('0x110')](db[_0xfea0('0x101')],{'as':'Messages','foreignKey':'WhatsappAccountId'});db[_0xfea0('0xfc')][_0xfea0('0x110')](db['WhatsappInteraction'],{'as':_0xfea0('0x17d')});db[_0xfea0('0xfc')][_0xfea0('0x110')](db[_0xfea0('0xfe')],{'as':_0xfea0('0x16b')});db[_0xfea0('0xfc')]['belongsTo'](db[_0xfea0('0xf2')],{'as':_0xfea0('0x16c'),'foreignKey':_0xfea0('0x179')});db[_0xfea0('0xfc')]['belongsTo'](db[_0xfea0('0x156')],{'as':_0xfea0('0x157'),'foreignKey':_0xfea0('0x158')});db[_0xfea0('0xfc')]['belongsToMany'](db[_0xfea0('0x12')],{'as':_0xfea0('0x159'),'through':_0xfea0('0x143')});db['WhatsappApplication'][_0xfea0('0x11d')](db['User'],{'onDelete':_0xfea0('0x177')});db['WhatsappApplication'][_0xfea0('0x11d')](db[_0xfea0('0x107')],{'onDelete':_0xfea0('0x177')});db['WhatsappApplication'][_0xfea0('0x11d')](db[_0xfea0('0xfc')],{'onDelete':'restrict'});db[_0xfea0('0xfe')][_0xfea0('0x11d')](db[_0xfea0('0x7a')],{'onDelete':'restrict','foreignKey':_0xfea0('0x155')});db['WhatsappApplication']['belongsTo'](db[_0xfea0('0x82')],{'onDelete':_0xfea0('0x177'),'foreignKey':_0xfea0('0x178')});db[_0xfea0('0x119')][_0xfea0('0x110')](db[_0xfea0('0x101')],{'as':_0xfea0('0x15e'),'onDelete':_0xfea0('0x10d'),'foreignKey':'WhatsappInteractionId'});db[_0xfea0('0x119')][_0xfea0('0x11d')](db[_0xfea0('0xfc')],{'as':_0xfea0('0x16f'),'foreignKey':'WhatsappAccountId'});db['WhatsappInteraction'][_0xfea0('0x11d')](db[_0xfea0('0x120')],{'as':_0xfea0('0x163'),'foreignKey':'ContactId'});db['WhatsappInteraction']['belongsTo'](db[_0xfea0('0x12')],{'as':'Owner','foreignKey':_0xfea0('0x10e')});db[_0xfea0('0x119')][_0xfea0('0x11f')](db[_0xfea0('0x82')],{'through':'whatsapp_interaction_has_tags','as':'Tags'});db[_0xfea0('0x119')][_0xfea0('0x11f')](db[_0xfea0('0x82')],{'through':'whatsapp_interaction_has_tags','as':_0xfea0('0x183')});db['WhatsappInteraction']['belongsToMany'](db[_0xfea0('0x12')],{'as':_0xfea0('0x184'),'through':_0xfea0('0x203'),'foreignKey':'WhatsappInteractionId'});db[_0xfea0('0x101')][_0xfea0('0x11d')](db[_0xfea0('0x12')],{'as':'User'});db[_0xfea0('0x101')]['belongsTo'](db[_0xfea0('0x120')],{'onDelete':_0xfea0('0x10d'),'as':_0xfea0('0x163')});db['WhatsappMessage'][_0xfea0('0x11d')](db[_0xfea0('0x119')],{'onDelete':'cascade','as':'Interaction','foreignKey':'WhatsappInteractionId'});db[_0xfea0('0x101')]['belongsTo'](db['WhatsappAccount'],{'as':_0xfea0('0x16f'),'foreignKey':_0xfea0('0x202')});db[_0xfea0('0x103')][_0xfea0('0x11d')](db['WhatsappAccount'],{});db['WhatsappQueueReport'][_0xfea0('0x11d')](db['CmList'],{'as':_0xfea0('0x16c'),'foreignKey':_0xfea0('0x179')});db[_0xfea0('0x103')][_0xfea0('0x11d')](db[_0xfea0('0x120')],{'as':_0xfea0('0x163'),'foreignKey':'ContactId'});db[_0xfea0('0x103')][_0xfea0('0x11d')](db['WhatsappInteraction'],{});db[_0xfea0('0x103')][_0xfea0('0x11d')](db['WhatsappQueue'],{});db[_0xfea0('0x103')][_0xfea0('0x11d')](db[_0xfea0('0x101')],{});db[_0xfea0('0x103')][_0xfea0('0x11d')](db[_0xfea0('0x12')],{});db[_0xfea0('0x105')][_0xfea0('0x11d')](db[_0xfea0('0x101')],{});db[_0xfea0('0x105')][_0xfea0('0x11d')](db[_0xfea0('0x119')],{});db['WhatsappTransferReport'][_0xfea0('0x11d')](db[_0xfea0('0xfc')],{'foreignKey':'FromWhatsappAccountId','as':'FromAccount'});db[_0xfea0('0x105')][_0xfea0('0x11d')](db[_0xfea0('0xfc')],{'foreignKey':_0xfea0('0x204'),'as':_0xfea0('0x1ed')});db['WhatsappTransferReport'][_0xfea0('0x11d')](db[_0xfea0('0x107')],{'foreignKey':_0xfea0('0x205'),'as':_0xfea0('0x1eb')});db[_0xfea0('0x105')]['belongsTo'](db[_0xfea0('0x12')],{'foreignKey':_0xfea0('0x1e8'),'as':_0xfea0('0x1e9')});db['WhatsappTransferReport'][_0xfea0('0x11d')](db['User'],{'foreignKey':_0xfea0('0x1f0'),'as':_0xfea0('0x1ea')});db[_0xfea0('0x107')][_0xfea0('0x11f')](db[_0xfea0('0x12')],{'as':_0xfea0('0x159'),'through':_0xfea0('0x34'),'foreignKey':_0xfea0('0x206')});db[_0xfea0('0x107')][_0xfea0('0x11f')](db[_0xfea0('0xe2')],{'through':_0xfea0('0x1df'),'as':_0xfea0('0x15a')});module[_0xfea0('0x207')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index b4d029c..2ab9068 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2332=['./config/logger','api','auth','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','headers','x-forwarded-for','connection','remoteAddress','url','responseTime','user','name','role','%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)','format','method','statusCode','other','agent_name','test','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceMusicOnHold','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','./api/voiceCallReport','/api/voice/dials/reports','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','/api/mail/applications','/api/mail/reports/queue','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','/api/fax/queues','/api/fax/reports/queue','./api/faxQueueReport','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','/api/openchannel/applications','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','./api/openchannelQueue','./api/chatWebsite','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','/api/actions','./api/action','/api/automations','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','./api/interval','/api/pauses','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','./api/tag','/api/contact_item_types','./api/contactItemType','/api/cm_contact_has_items','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','/api/analytics/metrics','./api/analyticMetric','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','/api/integrations/desk/accounts','./api/intDeskAccount','./api/intDeskConfiguration','/api/integrations/desk/fields','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','/api/integrations/servicenow/fields','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','./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/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/square/reports','./api/squareReportDetail','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','/api/square/recordings','./api/squareRecording','/api/square/messages','/api/teams','/api/license','./api/campaign','/api/migrations','/api/attachments','./api/attachment','/api/plugins','./api/mailTransferReport','/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/userProfileResource','/api/userNotifications','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','/api/whatsapp/messages','./api/whatsappMessage','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','/api/cloudProviders','./api/cloudProvider','./api/realtime','/api/auth/google','./api/authGoogle','/api/jira','/api/rpc','./api/rpc','/api/version','./api/version','./api/system','/api/pm2','/apidoc','join','root','/www','static','/demo','/snippet','3.0.0','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','/index.html','username','password','apiKey','lastName','street','phone','mobile','fax','email','clientId','clientSecret','securityToken','code','accessKey','tenantId','accessToken','accessTokenSecret','authToken','consumerKey','consumerSecret','calleridnum','vidaooApiKey','privateKey','accesskeyid','accountSid','localstationid','dsn','secret','isArray','length','isPlainObject','isString','replace','@@{','}@@','includes','lodash','path','express','express-winston','./errors'];(function(_0x37c8ea,_0x4836d2){var _0x541409=function(_0x32f68f){while(--_0x32f68f){_0x37c8ea['push'](_0x37c8ea['shift']());}};_0x541409(++_0x4836d2);}(_0x2332,0x13e));var _0x2233=function(_0x5238a8,_0x23597f){_0x5238a8=_0x5238a8-0x0;var _0x296b76=_0x2332[_0x5238a8];return _0x296b76;};'use strict';var _=require(_0x2233('0x0'));var path=require(_0x2233('0x1'));var express=require(_0x2233('0x2'));var ewinston=require(_0x2233('0x3'));var util=require('util');var errors=require(_0x2233('0x4'));var config=require('./config/environment');var logger=require(_0x2233('0x5'))(_0x2233('0x6'));var authLogger=require(_0x2233('0x5'))(_0x2233('0x7'));exports['default']=function(_0x4479d0){_0x4479d0[_0x2233('0x8')](ewinston[_0x2233('0x9')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x519331,_0x1d5a76){var _0x895d83=_0x2233('0xa');if(!_[_0x2233('0xb')](_0x519331[_0x2233('0xc')])){_0x895d83+='\x20body=%s';var _0x13325e=_0x519331[_0x2233('0xc')];maskSensitiveData(_0x13325e);}return util['format'](_0x895d83,_0x519331['method'],_0x519331[_0x2233('0xd')][_0x2233('0xe')]?_0x519331[_0x2233('0xd')][_0x2233('0xe')]:_0x519331[_0x2233('0xf')][_0x2233('0x10')]||_0x519331['ip'],_0x519331[_0x2233('0x11')],_0x1d5a76['statusCode'],_0x1d5a76[_0x2233('0x12')],_0x519331[_0x2233('0x13')]?_0x519331[_0x2233('0x13')]['id']:null,_0x519331[_0x2233('0x13')]?_0x519331['user'][_0x2233('0x14')]:null,_0x519331[_0x2233('0x13')]?_0x519331[_0x2233('0x13')][_0x2233('0x15')]:null,_0x13325e?util['inspect'](_0x13325e,![],null):'');}}));_0x4479d0['use'](ewinston[_0x2233('0x9')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x46641a,_0x37ac7f){var _0x5de81e=_0x2233('0x16');if(_0x46641a['body']&&_0x46641a[_0x2233('0xc')][_0x2233('0x17')]&&_0x46641a[_0x2233('0xc')][_0x2233('0x18')]){_0x5de81e=_0x2233('0x19');}return util[_0x2233('0x1a')](_0x5de81e,_0x46641a[_0x2233('0x1b')],_0x46641a[_0x2233('0xd')][_0x2233('0xe')]?_0x46641a[_0x2233('0xd')][_0x2233('0xe')]:_0x46641a[_0x2233('0xf')][_0x2233('0x10')]||_0x46641a['ip'],_0x46641a[_0x2233('0x11')],_0x37ac7f[_0x2233('0x1c')],_0x37ac7f[_0x2233('0x12')],_0x46641a[_0x2233('0x13')]?_0x46641a[_0x2233('0x13')]['id']:null,_0x46641a[_0x2233('0x13')]?_0x46641a[_0x2233('0x13')][_0x2233('0x14')]:null,_0x46641a[_0x2233('0x13')]?_0x46641a['user'][_0x2233('0x15')]:null,_0x46641a['body']&&_0x46641a[_0x2233('0xc')][_0x2233('0x17')]?_0x46641a['body'][_0x2233('0x17')]:_0x2233('0x1d'),_0x46641a[_0x2233('0xc')]&&_0x46641a['body']['agent_id']?_0x46641a[_0x2233('0xc')][_0x2233('0x18')]:'',_0x46641a[_0x2233('0xc')]&&_0x46641a[_0x2233('0xc')][_0x2233('0x1e')]?_0x46641a[_0x2233('0xc')][_0x2233('0x1e')]:'');},'ignoreRoute':function(_0x448adc){var _0xd3cc54=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0xd3cc54[_0x2233('0x1f')](_0x448adc[_0x2233('0x11')]);}}));_0x4479d0[_0x2233('0x8')]('/api/users',require(_0x2233('0x20')));_0x4479d0[_0x2233('0x8')](_0x2233('0x21'),require(_0x2233('0x22')));_0x4479d0[_0x2233('0x8')](_0x2233('0x23'),require(_0x2233('0x24')));_0x4479d0[_0x2233('0x8')](_0x2233('0x25'),require('./api/voiceExtension'));_0x4479d0['use']('/api/voice/mohs',require(_0x2233('0x26')));_0x4479d0[_0x2233('0x8')]('/api/voice/queues',require('./api/voiceQueue'));_0x4479d0['use'](_0x2233('0x27'),require(_0x2233('0x28')));_0x4479d0[_0x2233('0x8')](_0x2233('0x29'),require(_0x2233('0x2a')));_0x4479d0[_0x2233('0x8')](_0x2233('0x2b'),require(_0x2233('0x2c')));_0x4479d0[_0x2233('0x8')]('/api/voice/mails/messages',require('./api/voiceMailMessage'));_0x4479d0[_0x2233('0x8')]('/api/voice/calls/reports',require(_0x2233('0x2d')));_0x4479d0['use'](_0x2233('0x2e'),require('./api/voiceDialReport'));_0x4479d0[_0x2233('0x8')](_0x2233('0x2f'),require(_0x2233('0x30')));_0x4479d0[_0x2233('0x8')](_0x2233('0x31'),require(_0x2233('0x32')));_0x4479d0[_0x2233('0x8')](_0x2233('0x33'),require(_0x2233('0x34')));_0x4479d0['use']('/api/trunks',require(_0x2233('0x35')));_0x4479d0[_0x2233('0x8')](_0x2233('0x36'),require(_0x2233('0x37')));_0x4479d0['use'](_0x2233('0x38'),require(_0x2233('0x39')));_0x4479d0[_0x2233('0x8')](_0x2233('0x3a'),require(_0x2233('0x3b')));_0x4479d0[_0x2233('0x8')](_0x2233('0x3c'),require(_0x2233('0x3d')));_0x4479d0['use'](_0x2233('0x3e'),require(_0x2233('0x3f')));_0x4479d0[_0x2233('0x8')](_0x2233('0x40'),require('./api/mailInteraction'));_0x4479d0[_0x2233('0x8')]('/api/mail/messages',require('./api/mailMessage'));_0x4479d0[_0x2233('0x8')](_0x2233('0x41'),require('./api/mailApplication'));_0x4479d0[_0x2233('0x8')](_0x2233('0x42'),require('./api/mailQueueReport'));_0x4479d0[_0x2233('0x8')]('/api/dashboards',require(_0x2233('0x43')));_0x4479d0[_0x2233('0x8')](_0x2233('0x44'),require(_0x2233('0x45')));_0x4479d0[_0x2233('0x8')](_0x2233('0x46'),require(_0x2233('0x47')));_0x4479d0['use']('/api/fax/applications',require(_0x2233('0x48')));_0x4479d0[_0x2233('0x8')](_0x2233('0x49'),require(_0x2233('0x4a')));_0x4479d0[_0x2233('0x8')](_0x2233('0x4b'),require('./api/faxMessage'));_0x4479d0[_0x2233('0x8')](_0x2233('0x4c'),require('./api/faxQueue'));_0x4479d0[_0x2233('0x8')](_0x2233('0x4d'),require(_0x2233('0x4e')));_0x4479d0['use']('/api/sms/accounts',require(_0x2233('0x4f')));_0x4479d0['use'](_0x2233('0x50'),require(_0x2233('0x51')));_0x4479d0[_0x2233('0x8')](_0x2233('0x52'),require(_0x2233('0x53')));_0x4479d0[_0x2233('0x8')](_0x2233('0x54'),require(_0x2233('0x55')));_0x4479d0['use'](_0x2233('0x56'),require(_0x2233('0x57')));_0x4479d0[_0x2233('0x8')](_0x2233('0x58'),require('./api/openchannelAccount'));_0x4479d0[_0x2233('0x8')](_0x2233('0x59'),require('./api/openchannelApplication'));_0x4479d0[_0x2233('0x8')](_0x2233('0x5a'),require(_0x2233('0x5b')));_0x4479d0[_0x2233('0x8')](_0x2233('0x5c'),require(_0x2233('0x5d')));_0x4479d0[_0x2233('0x8')]('/api/openchannel/queues',require(_0x2233('0x5e')));_0x4479d0[_0x2233('0x8')]('/api/chat/websites',require(_0x2233('0x5f')));_0x4479d0[_0x2233('0x8')]('/api/openchannel/reports/queue',require(_0x2233('0x60')));_0x4479d0['use'](_0x2233('0x61'),require(_0x2233('0x62')));_0x4479d0[_0x2233('0x8')](_0x2233('0x63'),require(_0x2233('0x64')));_0x4479d0['use'](_0x2233('0x65'),require(_0x2233('0x66')));_0x4479d0[_0x2233('0x8')](_0x2233('0x67'),require(_0x2233('0x68')));_0x4479d0[_0x2233('0x8')](_0x2233('0x69'),require(_0x2233('0x6a')));_0x4479d0[_0x2233('0x8')](_0x2233('0x6b'),require(_0x2233('0x6c')));_0x4479d0[_0x2233('0x8')]('/api/chat/proactive_actions',require(_0x2233('0x6d')));_0x4479d0[_0x2233('0x8')](_0x2233('0x6e'),require(_0x2233('0x6f')));_0x4479d0[_0x2233('0x8')](_0x2233('0x70'),require('./api/cmContact'));_0x4479d0[_0x2233('0x8')](_0x2233('0x71'),require(_0x2233('0x72')));_0x4479d0[_0x2233('0x8')](_0x2233('0x73'),require(_0x2233('0x74')));_0x4479d0[_0x2233('0x8')]('/api/cm/hopper_final',require('./api/cmHopperFinal'));_0x4479d0[_0x2233('0x8')](_0x2233('0x75'),require(_0x2233('0x76')));_0x4479d0[_0x2233('0x8')](_0x2233('0x77'),require('./api/cmCustomField'));_0x4479d0[_0x2233('0x8')](_0x2233('0x78'),require(_0x2233('0x79')));_0x4479d0[_0x2233('0x8')](_0x2233('0x7a'),require('./api/automation'));_0x4479d0[_0x2233('0x8')](_0x2233('0x7b'),require(_0x2233('0x7c')));_0x4479d0[_0x2233('0x8')](_0x2233('0x7d'),require(_0x2233('0x7e')));_0x4479d0[_0x2233('0x8')](_0x2233('0x7f'),require(_0x2233('0x80')));_0x4479d0[_0x2233('0x8')]('/api/intervals',require(_0x2233('0x81')));_0x4479d0[_0x2233('0x8')](_0x2233('0x82'),require('./api/pause'));_0x4479d0[_0x2233('0x8')](_0x2233('0x83'),require(_0x2233('0x84')));_0x4479d0[_0x2233('0x8')](_0x2233('0x85'),require(_0x2233('0x86')));_0x4479d0[_0x2233('0x8')](_0x2233('0x87'),require(_0x2233('0x88')));_0x4479d0[_0x2233('0x8')](_0x2233('0x89'),require(_0x2233('0x8a')));_0x4479d0['use']('/api/tags',require(_0x2233('0x8b')));_0x4479d0[_0x2233('0x8')](_0x2233('0x8c'),require(_0x2233('0x8d')));_0x4479d0[_0x2233('0x8')](_0x2233('0x8e'),require('./api/cmContactHasItem'));_0x4479d0['use'](_0x2233('0x8f'),require(_0x2233('0x90')));_0x4479d0['use'](_0x2233('0x91'),require(_0x2233('0x92')));_0x4479d0[_0x2233('0x8')](_0x2233('0x93'),require(_0x2233('0x94')));_0x4479d0[_0x2233('0x8')](_0x2233('0x95'),require(_0x2233('0x96')));_0x4479d0[_0x2233('0x8')](_0x2233('0x97'),require(_0x2233('0x98')));_0x4479d0[_0x2233('0x8')](_0x2233('0x99'),require('./api/integrationReport'));_0x4479d0['use'](_0x2233('0x9a'),require(_0x2233('0x9b')));_0x4479d0[_0x2233('0x8')](_0x2233('0x9c'),require(_0x2233('0x9d')));_0x4479d0[_0x2233('0x8')](_0x2233('0x9e'),require('./api/analyticExtractedReport'));_0x4479d0[_0x2233('0x8')](_0x2233('0x9f'),require(_0x2233('0xa0')));_0x4479d0[_0x2233('0x8')]('/api/analytics/field_reports',require(_0x2233('0xa1')));_0x4479d0[_0x2233('0x8')](_0x2233('0xa2'),require(_0x2233('0xa3')));_0x4479d0[_0x2233('0x8')](_0x2233('0xa4'),require(_0x2233('0xa5')));_0x4479d0[_0x2233('0x8')]('/api/integrations/salesforce/configurations',require('./api/intSalesforceConfiguration'));_0x4479d0[_0x2233('0x8')]('/api/integrations/salesforce/fields',require(_0x2233('0xa6')));_0x4479d0[_0x2233('0x8')](_0x2233('0xa7'),require(_0x2233('0xa8')));_0x4479d0[_0x2233('0x8')](_0x2233('0xa9'),require(_0x2233('0xaa')));_0x4479d0[_0x2233('0x8')](_0x2233('0xab'),require('./api/intSugarcrmField'));_0x4479d0[_0x2233('0x8')](_0x2233('0xac'),require(_0x2233('0xad')));_0x4479d0[_0x2233('0x8')]('/api/integrations/desk/configurations',require(_0x2233('0xae')));_0x4479d0[_0x2233('0x8')](_0x2233('0xaf'),require('./api/intDeskField'));_0x4479d0[_0x2233('0x8')]('/api/integrations/zoho/accounts',require('./api/intZohoAccount'));_0x4479d0[_0x2233('0x8')](_0x2233('0xb0'),require(_0x2233('0xb1')));_0x4479d0[_0x2233('0x8')](_0x2233('0xb2'),require(_0x2233('0xb3')));_0x4479d0['use']('/api/integrations/zendesk/accounts',require('./api/intZendeskAccount'));_0x4479d0['use']('/api/integrations/zendesk/configurations',require(_0x2233('0xb4')));_0x4479d0[_0x2233('0x8')](_0x2233('0xb5'),require('./api/intZendeskField'));_0x4479d0[_0x2233('0x8')](_0x2233('0xb6'),require('./api/intFreshdeskAccount'));_0x4479d0[_0x2233('0x8')](_0x2233('0xb7'),require(_0x2233('0xb8')));_0x4479d0[_0x2233('0x8')](_0x2233('0xb9'),require(_0x2233('0xba')));_0x4479d0[_0x2233('0x8')]('/api/integrations/vtiger/accounts',require(_0x2233('0xbb')));_0x4479d0[_0x2233('0x8')](_0x2233('0xbc'),require(_0x2233('0xbd')));_0x4479d0['use']('/api/integrations/vtiger/fields',require('./api/intVtigerField'));_0x4479d0[_0x2233('0x8')](_0x2233('0xbe'),require(_0x2233('0xbf')));_0x4479d0[_0x2233('0x8')](_0x2233('0xc0'),require('./api/intServicenowConfiguration'));_0x4479d0[_0x2233('0x8')](_0x2233('0xc1'),require('./api/intServicenowField'));_0x4479d0['use'](_0x2233('0xc2'),require(_0x2233('0xc3')));_0x4479d0[_0x2233('0x8')]('/api/integrations/dynamics365/configurations',require(_0x2233('0xc4')));_0x4479d0['use'](_0x2233('0xc5'),require(_0x2233('0xc6')));_0x4479d0['use'](_0x2233('0xc7'),require(_0x2233('0xc8')));_0x4479d0[_0x2233('0x8')](_0x2233('0xc9'),require(_0x2233('0xca')));_0x4479d0[_0x2233('0x8')]('/api/integrations/freshsales/fields',require(_0x2233('0xcb')));_0x4479d0[_0x2233('0x8')](_0x2233('0xcc'),require(_0x2233('0xcd')));_0x4479d0[_0x2233('0x8')](_0x2233('0xce'),require(_0x2233('0xcf')));_0x4479d0['use']('/api/chat/internal/messages',require(_0x2233('0xd0')));_0x4479d0[_0x2233('0x8')](_0x2233('0xd1'),require(_0x2233('0xd2')));_0x4479d0[_0x2233('0x8')](_0x2233('0xd3'),require(_0x2233('0xd4')));_0x4479d0['use'](_0x2233('0xd5'),require(_0x2233('0xd6')));_0x4479d0[_0x2233('0x8')]('/api/sms/reports/queue',require('./api/smsQueueReport'));_0x4479d0['use'](_0x2233('0xd7'),require('./api/squareReport'));_0x4479d0['use']('/api/square/details/reports',require(_0x2233('0xd8')));_0x4479d0[_0x2233('0x8')]('/api/jscripty/projects',require(_0x2233('0xd9')));_0x4479d0[_0x2233('0x8')](_0x2233('0xda'),require(_0x2233('0xdb')));_0x4479d0[_0x2233('0x8')](_0x2233('0xdc'),require(_0x2233('0xdd')));_0x4479d0[_0x2233('0x8')](_0x2233('0xde'),require('./api/squareProject'));_0x4479d0['use'](_0x2233('0xdf'),require(_0x2233('0xe0')));_0x4479d0['use'](_0x2233('0xe1'),require('./api/squareMessage'));_0x4479d0[_0x2233('0x8')](_0x2233('0xe2'),require('./api/team'));_0x4479d0[_0x2233('0x8')](_0x2233('0xe3'),require('./api/license'));_0x4479d0[_0x2233('0x8')]('/api/campaigns',require(_0x2233('0xe4')));_0x4479d0[_0x2233('0x8')](_0x2233('0xe5'),require('./api/migration'));_0x4479d0['use'](_0x2233('0xe6'),require(_0x2233('0xe7')));_0x4479d0['use'](_0x2233('0xe8'),require('./api/plugin'));_0x4479d0[_0x2233('0x8')]('/api/mail/reports/transfer',require(_0x2233('0xe9')));_0x4479d0[_0x2233('0x8')]('/api/chat/reports/transfer',require('./api/chatTransferReport'));_0x4479d0[_0x2233('0x8')](_0x2233('0xea'),require(_0x2233('0xeb')));_0x4479d0[_0x2233('0x8')](_0x2233('0xec'),require(_0x2233('0xed')));_0x4479d0['use']('/api/sms/reports/transfer',require(_0x2233('0xee')));_0x4479d0[_0x2233('0x8')](_0x2233('0xef'),require(_0x2233('0xf0')));_0x4479d0[_0x2233('0x8')]('/api/voice/prefixes',require(_0x2233('0xf1')));_0x4479d0[_0x2233('0x8')](_0x2233('0xf2'),require(_0x2233('0xf3')));_0x4479d0[_0x2233('0x8')](_0x2233('0xf4'),require(_0x2233('0xf5')));_0x4479d0[_0x2233('0x8')](_0x2233('0xf6'),require(_0x2233('0xf7')));_0x4479d0[_0x2233('0x8')](_0x2233('0xf8'),require('./api/userNotification'));_0x4479d0[_0x2233('0x8')](_0x2233('0xf9'),require(_0x2233('0xfa')));_0x4479d0[_0x2233('0x8')](_0x2233('0xfb'),require(_0x2233('0xfc')));_0x4479d0[_0x2233('0x8')](_0x2233('0xfd'),require('./api/whatsappInteraction'));_0x4479d0['use'](_0x2233('0xfe'),require(_0x2233('0xff')));_0x4479d0[_0x2233('0x8')]('/api/whatsapp/reports/queue',require(_0x2233('0x100')));_0x4479d0[_0x2233('0x8')](_0x2233('0x101'),require(_0x2233('0x102')));_0x4479d0['use'](_0x2233('0x103'),require('./api/whatsappQueue'));_0x4479d0[_0x2233('0x8')](_0x2233('0x104'),require(_0x2233('0x105')));_0x4479d0[_0x2233('0x8')]('/api/realtime',require(_0x2233('0x106')));_0x4479d0[_0x2233('0x8')]('/api/auth/local',require('./api/authLocal'));_0x4479d0[_0x2233('0x8')](_0x2233('0x107'),require(_0x2233('0x108')));_0x4479d0[_0x2233('0x8')](_0x2233('0x109'),require('./api/jira'));_0x4479d0[_0x2233('0x8')](_0x2233('0x10a'),require(_0x2233('0x10b')));_0x4479d0[_0x2233('0x8')](_0x2233('0x10c'),require(_0x2233('0x10d')));_0x4479d0[_0x2233('0x8')]('/api/system',require(_0x2233('0x10e')));_0x4479d0[_0x2233('0x8')](_0x2233('0x10f'),require('./api/pm2'));_0x4479d0['use']('/api/webbar',require('./api/webbar'));_0x4479d0[_0x2233('0x8')](_0x2233('0x110'),express['static'](path[_0x2233('0x111')](config[_0x2233('0x112')],_0x2233('0x110'))));_0x4479d0['use'](_0x2233('0x113'),express[_0x2233('0x114')](path[_0x2233('0x111')](config[_0x2233('0x112')],_0x2233('0x113'))));_0x4479d0['use'](_0x2233('0x115'),express[_0x2233('0x114')](path[_0x2233('0x111')](config['root'],_0x2233('0x115'))));_0x4479d0[_0x2233('0x8')](_0x2233('0x116'),express[_0x2233('0x114')](path['join'](config[_0x2233('0x112')],'snippet',_0x2233('0x117'))));_0x4479d0[_0x2233('0x8')]('/plugins',express[_0x2233('0x114')](path[_0x2233('0x111')](config[_0x2233('0x112')],'/server/files/plugins')));_0x4479d0[_0x2233('0x118')](_0x2233('0x119'))[_0x2233('0x11a')](errors[0x194]);_0x4479d0[_0x2233('0x118')]('/*')[_0x2233('0x11a')](function(_0x592911,_0x47d8b7){_0x47d8b7[_0x2233('0x11b')](path[_0x2233('0x11c')](_0x4479d0[_0x2233('0x11a')](_0x2233('0x11d'))+_0x2233('0x11e')));});};var sensitiveFields=[_0x2233('0x11f'),_0x2233('0x120'),'newPassword',_0x2233('0x121'),'firstName',_0x2233('0x122'),_0x2233('0x123'),_0x2233('0x124'),_0x2233('0x125'),_0x2233('0x126'),_0x2233('0x127'),_0x2233('0x128'),_0x2233('0x129'),_0x2233('0x12a'),_0x2233('0x12b'),_0x2233('0x12c'),_0x2233('0x12d'),'token','channelSecret',_0x2233('0x12e'),_0x2233('0x12f'),_0x2233('0x130'),_0x2233('0x131'),_0x2233('0x132'),'membername','calleridname',_0x2233('0x133'),'exten',_0x2233('0x134'),'clientEmail',_0x2233('0x135'),_0x2233('0x136'),'secretaccesskey','key','user','pass',_0x2233('0x137'),_0x2233('0x138'),_0x2233('0x139'),_0x2233('0x13a'),'registry','oldPassword'];function maskSensitiveData(_0x23d830){var _0x2bbc16=/(?!^)[\s\S](?!$)/g;if(!_['isPlainObject'](_0x23d830))return;for(var _0x451597 in _0x23d830){if(_[_0x2233('0x13b')](_0x23d830[_0x451597])){for(var _0x3c0917=0x0;_0x3c0917<_0x23d830[_0x451597][_0x2233('0x13c')];_0x3c0917++){maskSensitiveData(_0x23d830[_0x451597][_0x3c0917]);}}else if(_[_0x2233('0x13d')](_0x23d830[_0x451597])){maskSensitiveData(_0x23d830[_0x451597]);}else if(_[_0x2233('0x13e')](_0x23d830[_0x451597])){_0x23d830[_0x451597]=_0x23d830[_0x451597][_0x2233('0x13f')](/{{{/g,_0x2233('0x140'))[_0x2233('0x13f')](/}}}/g,_0x2233('0x141'))[_0x2233('0x13f')](/{{/g,'@{')[_0x2233('0x13f')](/}}/g,'}@');if(_[_0x2233('0x142')](sensitiveFields,_0x451597)){_0x23d830[_0x451597]=_0x23d830[_0x451597]['replace'](_0x2bbc16,'*');}}}} \ No newline at end of file +var _0x676c=['format','other','agent_name','test','./api/user','/api/voice/chanspy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceQueue','/api/voice/recordings','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/accounts','./api/mailAccount','/api/mail/queues','/api/mail/substatuses','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','/api/fax/applications','./api/faxApplication','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/interactions','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/cannedAnswer','/api/conditions','./api/condition','./api/pause','./api/cdr','/api/voiceQueuesLog','/api/schedules','./api/schedule','./api/sound','/api/tags','./api/tag','/api/contact_item_types','./api/contactItemType','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','./api/intZohoAccount','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','./api/intVtigerField','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','./api/squareOdbc','/api/square/projects','/api/square/recordings','/api/square/messages','./api/squareMessage','./api/team','/api/license','/api/campaigns','./api/campaign','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/chat/reports/transfer','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','/api/voice/prefixes','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','./api/whatsappApplication','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','/api/auth/local','/api/auth/google','./api/authGoogle','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','./api/pm2','./api/webbar','static','join','root','/apidoc','/www','/demo','snippet','3.0.0','/plugins','/server/files/plugins','/:url(api|auth|components|app|bower_components|assets)/*','get','route','resolve','/index.html','username','newPassword','apiKey','firstName','lastName','phone','mobile','fax','email','clientId','clientSecret','securityToken','code','accessKey','tenantId','token','channelSecret','accessToken','authToken','consumerKey','consumerSecret','calleridname','calleridnum','exten','clientEmail','privateKey','accesskeyid','secretaccesskey','key','pass','accountSid','localstationid','dsn','secret','registry','oldPassword','isPlainObject','length','isString','replace','@@{','}@@','includes','lodash','path','express','express-winston','./config/environment','./config/logger','api','auth','default','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','method','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','responseTime','user','name','role','%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)'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x676c,0x130));var _0xc676=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x676c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc676('0x0'));var path=require(_0xc676('0x1'));var express=require(_0xc676('0x2'));var ewinston=require(_0xc676('0x3'));var util=require('util');var errors=require('./errors');var config=require(_0xc676('0x4'));var logger=require(_0xc676('0x5'))(_0xc676('0x6'));var authLogger=require(_0xc676('0x5'))(_0xc676('0x7'));exports[_0xc676('0x8')]=function(_0x209afc){_0x209afc[_0xc676('0x9')](ewinston[_0xc676('0xa')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x14874b,_0x319898){var _0x35ded0=_0xc676('0xb');if(!_[_0xc676('0xc')](_0x14874b['body'])){_0x35ded0+='\x20body=%s';var _0x5df150=_0x14874b[_0xc676('0xd')];maskSensitiveData(_0x5df150);}return util['format'](_0x35ded0,_0x14874b[_0xc676('0xe')],_0x14874b[_0xc676('0xf')][_0xc676('0x10')]?_0x14874b[_0xc676('0xf')][_0xc676('0x10')]:_0x14874b[_0xc676('0x11')][_0xc676('0x12')]||_0x14874b['ip'],_0x14874b[_0xc676('0x13')],_0x319898[_0xc676('0x14')],_0x319898[_0xc676('0x15')],_0x14874b[_0xc676('0x16')]?_0x14874b[_0xc676('0x16')]['id']:null,_0x14874b['user']?_0x14874b[_0xc676('0x16')][_0xc676('0x17')]:null,_0x14874b[_0xc676('0x16')]?_0x14874b['user'][_0xc676('0x18')]:null,_0x5df150?util['inspect'](_0x5df150,![],null):'');}}));_0x209afc[_0xc676('0x9')](ewinston[_0xc676('0xa')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x37df28,_0x2fe8be){var _0x219290=_0xc676('0x19');if(_0x37df28[_0xc676('0xd')]&&_0x37df28['body'][_0xc676('0x1a')]&&_0x37df28['body'][_0xc676('0x1b')]){_0x219290=_0xc676('0x1c');}return util[_0xc676('0x1d')](_0x219290,_0x37df28['method'],_0x37df28[_0xc676('0xf')][_0xc676('0x10')]?_0x37df28['headers'][_0xc676('0x10')]:_0x37df28[_0xc676('0x11')][_0xc676('0x12')]||_0x37df28['ip'],_0x37df28['url'],_0x2fe8be['statusCode'],_0x2fe8be['responseTime'],_0x37df28[_0xc676('0x16')]?_0x37df28[_0xc676('0x16')]['id']:null,_0x37df28[_0xc676('0x16')]?_0x37df28[_0xc676('0x16')][_0xc676('0x17')]:null,_0x37df28[_0xc676('0x16')]?_0x37df28[_0xc676('0x16')][_0xc676('0x18')]:null,_0x37df28[_0xc676('0xd')]&&_0x37df28[_0xc676('0xd')][_0xc676('0x1a')]?_0x37df28[_0xc676('0xd')][_0xc676('0x1a')]:_0xc676('0x1e'),_0x37df28['body']&&_0x37df28[_0xc676('0xd')][_0xc676('0x1b')]?_0x37df28[_0xc676('0xd')]['agent_id']:'',_0x37df28['body']&&_0x37df28[_0xc676('0xd')]['agent_name']?_0x37df28['body'][_0xc676('0x1f')]:'');},'ignoreRoute':function(_0x38c39d){var _0x338a7d=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x338a7d[_0xc676('0x20')](_0x38c39d[_0xc676('0x13')]);}}));_0x209afc[_0xc676('0x9')]('/api/users',require(_0xc676('0x21')));_0x209afc[_0xc676('0x9')](_0xc676('0x22'),require('./api/voiceChanSpy'));_0x209afc[_0xc676('0x9')](_0xc676('0x23'),require(_0xc676('0x24')));_0x209afc[_0xc676('0x9')](_0xc676('0x25'),require('./api/voiceExtension'));_0x209afc[_0xc676('0x9')]('/api/voice/mohs',require('./api/voiceMusicOnHold'));_0x209afc[_0xc676('0x9')]('/api/voice/queues',require(_0xc676('0x26')));_0x209afc[_0xc676('0x9')](_0xc676('0x27'),require('./api/voiceRecording'));_0x209afc['use'](_0xc676('0x28'),require(_0xc676('0x29')));_0x209afc['use'](_0xc676('0x2a'),require(_0xc676('0x2b')));_0x209afc[_0xc676('0x9')](_0xc676('0x2c'),require(_0xc676('0x2d')));_0x209afc[_0xc676('0x9')](_0xc676('0x2e'),require(_0xc676('0x2f')));_0x209afc[_0xc676('0x9')]('/api/voice/dials/reports',require(_0xc676('0x30')));_0x209afc['use'](_0xc676('0x31'),require(_0xc676('0x32')));_0x209afc[_0xc676('0x9')](_0xc676('0x33'),require(_0xc676('0x34')));_0x209afc[_0xc676('0x9')](_0xc676('0x35'),require(_0xc676('0x36')));_0x209afc['use']('/api/trunks',require(_0xc676('0x37')));_0x209afc['use'](_0xc676('0x38'),require(_0xc676('0x39')));_0x209afc[_0xc676('0x9')]('/api/mail/out_servers',require('./api/mailServerOut'));_0x209afc[_0xc676('0x9')](_0xc676('0x3a'),require(_0xc676('0x3b')));_0x209afc[_0xc676('0x9')](_0xc676('0x3c'),require('./api/mailQueue'));_0x209afc[_0xc676('0x9')](_0xc676('0x3d'),require('./api/mailSubstatus'));_0x209afc['use'](_0xc676('0x3e'),require(_0xc676('0x3f')));_0x209afc[_0xc676('0x9')](_0xc676('0x40'),require(_0xc676('0x41')));_0x209afc[_0xc676('0x9')](_0xc676('0x42'),require(_0xc676('0x43')));_0x209afc['use'](_0xc676('0x44'),require(_0xc676('0x45')));_0x209afc[_0xc676('0x9')](_0xc676('0x46'),require('./api/dashboard'));_0x209afc[_0xc676('0x9')](_0xc676('0x47'),require(_0xc676('0x48')));_0x209afc['use'](_0xc676('0x49'),require('./api/faxAccount'));_0x209afc[_0xc676('0x9')](_0xc676('0x4a'),require(_0xc676('0x4b')));_0x209afc['use']('/api/fax/interactions',require(_0xc676('0x4c')));_0x209afc[_0xc676('0x9')](_0xc676('0x4d'),require(_0xc676('0x4e')));_0x209afc[_0xc676('0x9')](_0xc676('0x4f'),require(_0xc676('0x50')));_0x209afc[_0xc676('0x9')]('/api/fax/reports/queue',require(_0xc676('0x51')));_0x209afc[_0xc676('0x9')](_0xc676('0x52'),require(_0xc676('0x53')));_0x209afc['use'](_0xc676('0x54'),require(_0xc676('0x55')));_0x209afc[_0xc676('0x9')](_0xc676('0x56'),require(_0xc676('0x57')));_0x209afc[_0xc676('0x9')](_0xc676('0x58'),require(_0xc676('0x59')));_0x209afc[_0xc676('0x9')]('/api/sms/queues',require(_0xc676('0x5a')));_0x209afc[_0xc676('0x9')](_0xc676('0x5b'),require(_0xc676('0x5c')));_0x209afc['use']('/api/openchannel/applications',require(_0xc676('0x5d')));_0x209afc[_0xc676('0x9')](_0xc676('0x5e'),require(_0xc676('0x5f')));_0x209afc[_0xc676('0x9')]('/api/openchannel/messages',require('./api/openchannelMessage'));_0x209afc['use'](_0xc676('0x60'),require(_0xc676('0x61')));_0x209afc['use'](_0xc676('0x62'),require(_0xc676('0x63')));_0x209afc[_0xc676('0x9')](_0xc676('0x64'),require(_0xc676('0x65')));_0x209afc['use']('/api/chat/applications',require('./api/chatApplication'));_0x209afc[_0xc676('0x9')](_0xc676('0x66'),require('./api/chatInteraction'));_0x209afc[_0xc676('0x9')](_0xc676('0x67'),require(_0xc676('0x68')));_0x209afc['use'](_0xc676('0x69'),require('./api/chatOfflineMessage'));_0x209afc[_0xc676('0x9')]('/api/chat/queues',require(_0xc676('0x6a')));_0x209afc['use'](_0xc676('0x6b'),require(_0xc676('0x6c')));_0x209afc[_0xc676('0x9')](_0xc676('0x6d'),require(_0xc676('0x6e')));_0x209afc[_0xc676('0x9')](_0xc676('0x6f'),require(_0xc676('0x70')));_0x209afc[_0xc676('0x9')](_0xc676('0x71'),require(_0xc676('0x72')));_0x209afc[_0xc676('0x9')](_0xc676('0x73'),require(_0xc676('0x74')));_0x209afc['use']('/api/cm/hopper_black',require('./api/cmHopperBlack'));_0x209afc[_0xc676('0x9')](_0xc676('0x75'),require(_0xc676('0x76')));_0x209afc['use'](_0xc676('0x77'),require(_0xc676('0x78')));_0x209afc[_0xc676('0x9')](_0xc676('0x79'),require(_0xc676('0x7a')));_0x209afc['use'](_0xc676('0x7b'),require(_0xc676('0x7c')));_0x209afc[_0xc676('0x9')](_0xc676('0x7d'),require('./api/automation'));_0x209afc[_0xc676('0x9')]('/api/canned_answers',require(_0xc676('0x7e')));_0x209afc['use']('/api/dispositions',require('./api/disposition'));_0x209afc['use'](_0xc676('0x7f'),require(_0xc676('0x80')));_0x209afc['use']('/api/intervals',require('./api/interval'));_0x209afc[_0xc676('0x9')]('/api/pauses',require(_0xc676('0x81')));_0x209afc[_0xc676('0x9')]('/api/cdr',require(_0xc676('0x82')));_0x209afc[_0xc676('0x9')](_0xc676('0x83'),require('./api/voiceQueuesLog'));_0x209afc[_0xc676('0x9')](_0xc676('0x84'),require(_0xc676('0x85')));_0x209afc[_0xc676('0x9')]('/api/sounds',require(_0xc676('0x86')));_0x209afc[_0xc676('0x9')](_0xc676('0x87'),require(_0xc676('0x88')));_0x209afc[_0xc676('0x9')](_0xc676('0x89'),require(_0xc676('0x8a')));_0x209afc[_0xc676('0x9')](_0xc676('0x8b'),require(_0xc676('0x8c')));_0x209afc[_0xc676('0x9')](_0xc676('0x8d'),require('./api/cmHopperAdditionalPhone'));_0x209afc[_0xc676('0x9')]('/api/templates',require(_0xc676('0x8e')));_0x209afc[_0xc676('0x9')](_0xc676('0x8f'),require(_0xc676('0x90')));_0x209afc[_0xc676('0x9')](_0xc676('0x91'),require(_0xc676('0x92')));_0x209afc['use'](_0xc676('0x93'),require('./api/integration'));_0x209afc['use'](_0xc676('0x94'),require(_0xc676('0x95')));_0x209afc['use'](_0xc676('0x96'),require(_0xc676('0x97')));_0x209afc[_0xc676('0x9')](_0xc676('0x98'),require('./api/analyticDefaultReport'));_0x209afc[_0xc676('0x9')](_0xc676('0x99'),require(_0xc676('0x9a')));_0x209afc[_0xc676('0x9')]('/api/analytics/metrics',require('./api/analyticMetric'));_0x209afc[_0xc676('0x9')](_0xc676('0x9b'),require(_0xc676('0x9c')));_0x209afc[_0xc676('0x9')](_0xc676('0x9d'),require('./api/analyticTreeReport'));_0x209afc[_0xc676('0x9')]('/api/integrations/salesforce/accounts',require('./api/intSalesforceAccount'));_0x209afc[_0xc676('0x9')](_0xc676('0x9e'),require(_0xc676('0x9f')));_0x209afc[_0xc676('0x9')](_0xc676('0xa0'),require(_0xc676('0xa1')));_0x209afc[_0xc676('0x9')](_0xc676('0xa2'),require('./api/intSugarcrmAccount'));_0x209afc[_0xc676('0x9')](_0xc676('0xa3'),require(_0xc676('0xa4')));_0x209afc[_0xc676('0x9')](_0xc676('0xa5'),require(_0xc676('0xa6')));_0x209afc[_0xc676('0x9')](_0xc676('0xa7'),require('./api/intDeskAccount'));_0x209afc['use']('/api/integrations/desk/configurations',require(_0xc676('0xa8')));_0x209afc[_0xc676('0x9')](_0xc676('0xa9'),require(_0xc676('0xaa')));_0x209afc[_0xc676('0x9')]('/api/integrations/zoho/accounts',require(_0xc676('0xab')));_0x209afc[_0xc676('0x9')]('/api/integrations/zoho/configurations',require(_0xc676('0xac')));_0x209afc[_0xc676('0x9')](_0xc676('0xad'),require(_0xc676('0xae')));_0x209afc[_0xc676('0x9')]('/api/integrations/zendesk/accounts',require(_0xc676('0xaf')));_0x209afc[_0xc676('0x9')](_0xc676('0xb0'),require(_0xc676('0xb1')));_0x209afc[_0xc676('0x9')]('/api/integrations/zendesk/fields',require(_0xc676('0xb2')));_0x209afc[_0xc676('0x9')](_0xc676('0xb3'),require(_0xc676('0xb4')));_0x209afc['use'](_0xc676('0xb5'),require(_0xc676('0xb6')));_0x209afc[_0xc676('0x9')](_0xc676('0xb7'),require(_0xc676('0xb8')));_0x209afc[_0xc676('0x9')](_0xc676('0xb9'),require('./api/intVtigerAccount'));_0x209afc[_0xc676('0x9')](_0xc676('0xba'),require(_0xc676('0xbb')));_0x209afc[_0xc676('0x9')]('/api/integrations/vtiger/fields',require(_0xc676('0xbc')));_0x209afc[_0xc676('0x9')]('/api/integrations/servicenow/accounts',require('./api/intServicenowAccount'));_0x209afc[_0xc676('0x9')]('/api/integrations/servicenow/configurations',require('./api/intServicenowConfiguration'));_0x209afc[_0xc676('0x9')](_0xc676('0xbd'),require(_0xc676('0xbe')));_0x209afc[_0xc676('0x9')](_0xc676('0xbf'),require(_0xc676('0xc0')));_0x209afc[_0xc676('0x9')](_0xc676('0xc1'),require(_0xc676('0xc2')));_0x209afc[_0xc676('0x9')]('/api/integrations/dynamics365/fields',require(_0xc676('0xc3')));_0x209afc[_0xc676('0x9')](_0xc676('0xc4'),require(_0xc676('0xc5')));_0x209afc[_0xc676('0x9')](_0xc676('0xc6'),require(_0xc676('0xc7')));_0x209afc[_0xc676('0x9')](_0xc676('0xc8'),require(_0xc676('0xc9')));_0x209afc[_0xc676('0x9')]('/api/networks',require(_0xc676('0xca')));_0x209afc[_0xc676('0x9')](_0xc676('0xcb'),require(_0xc676('0xcc')));_0x209afc['use'](_0xc676('0xcd'),require(_0xc676('0xce')));_0x209afc['use']('/api/jscripty/answers/reports',require(_0xc676('0xcf')));_0x209afc['use'](_0xc676('0xd0'),require(_0xc676('0xd1')));_0x209afc['use'](_0xc676('0xd2'),require(_0xc676('0xd3')));_0x209afc[_0xc676('0x9')](_0xc676('0xd4'),require(_0xc676('0xd5')));_0x209afc[_0xc676('0x9')]('/api/square/reports',require(_0xc676('0xd6')));_0x209afc[_0xc676('0x9')](_0xc676('0xd7'),require(_0xc676('0xd8')));_0x209afc['use'](_0xc676('0xd9'),require(_0xc676('0xda')));_0x209afc[_0xc676('0x9')](_0xc676('0xdb'),require(_0xc676('0xdc')));_0x209afc['use']('/api/square/odbc',require(_0xc676('0xdd')));_0x209afc[_0xc676('0x9')](_0xc676('0xde'),require('./api/squareProject'));_0x209afc[_0xc676('0x9')](_0xc676('0xdf'),require('./api/squareRecording'));_0x209afc[_0xc676('0x9')](_0xc676('0xe0'),require(_0xc676('0xe1')));_0x209afc[_0xc676('0x9')]('/api/teams',require(_0xc676('0xe2')));_0x209afc[_0xc676('0x9')](_0xc676('0xe3'),require('./api/license'));_0x209afc[_0xc676('0x9')](_0xc676('0xe4'),require(_0xc676('0xe5')));_0x209afc[_0xc676('0x9')]('/api/migrations',require(_0xc676('0xe6')));_0x209afc[_0xc676('0x9')](_0xc676('0xe7'),require(_0xc676('0xe8')));_0x209afc['use'](_0xc676('0xe9'),require(_0xc676('0xea')));_0x209afc['use']('/api/mail/reports/transfer',require('./api/mailTransferReport'));_0x209afc[_0xc676('0x9')](_0xc676('0xeb'),require('./api/chatTransferReport'));_0x209afc['use'](_0xc676('0xec'),require(_0xc676('0xed')));_0x209afc['use'](_0xc676('0xee'),require(_0xc676('0xef')));_0x209afc[_0xc676('0x9')](_0xc676('0xf0'),require('./api/smsTransferReport'));_0x209afc[_0xc676('0x9')]('/api/cm/lists',require('./api/cmList'));_0x209afc['use'](_0xc676('0xf1'),require('./api/voicePrefix'));_0x209afc[_0xc676('0x9')](_0xc676('0xf2'),require(_0xc676('0xf3')));_0x209afc[_0xc676('0x9')](_0xc676('0xf4'),require(_0xc676('0xf5')));_0x209afc['use'](_0xc676('0xf6'),require(_0xc676('0xf7')));_0x209afc[_0xc676('0x9')](_0xc676('0xf8'),require(_0xc676('0xf9')));_0x209afc[_0xc676('0x9')](_0xc676('0xfa'),require(_0xc676('0xfb')));_0x209afc[_0xc676('0x9')]('/api/whatsapp/applications',require(_0xc676('0xfc')));_0x209afc[_0xc676('0x9')]('/api/whatsapp/interactions',require('./api/whatsappInteraction'));_0x209afc[_0xc676('0x9')](_0xc676('0xfd'),require(_0xc676('0xfe')));_0x209afc['use'](_0xc676('0xff'),require('./api/whatsappQueueReport'));_0x209afc[_0xc676('0x9')]('/api/whatsapp/reports/transfer',require(_0xc676('0x100')));_0x209afc[_0xc676('0x9')](_0xc676('0x101'),require(_0xc676('0x102')));_0x209afc[_0xc676('0x9')](_0xc676('0x103'),require(_0xc676('0x104')));_0x209afc[_0xc676('0x9')](_0xc676('0x105'),require('./api/realtime'));_0x209afc[_0xc676('0x9')](_0xc676('0x106'),require('./api/authLocal'));_0x209afc['use'](_0xc676('0x107'),require(_0xc676('0x108')));_0x209afc[_0xc676('0x9')](_0xc676('0x109'),require(_0xc676('0x10a')));_0x209afc['use'](_0xc676('0x10b'),require(_0xc676('0x10c')));_0x209afc[_0xc676('0x9')](_0xc676('0x10d'),require(_0xc676('0x10e')));_0x209afc[_0xc676('0x9')](_0xc676('0x10f'),require(_0xc676('0x110')));_0x209afc[_0xc676('0x9')]('/api/pm2',require(_0xc676('0x111')));_0x209afc[_0xc676('0x9')]('/api/webbar',require(_0xc676('0x112')));_0x209afc[_0xc676('0x9')]('/apidoc',express[_0xc676('0x113')](path[_0xc676('0x114')](config[_0xc676('0x115')],_0xc676('0x116'))));_0x209afc[_0xc676('0x9')](_0xc676('0x117'),express[_0xc676('0x113')](path[_0xc676('0x114')](config['root'],'/www')));_0x209afc[_0xc676('0x9')](_0xc676('0x118'),express[_0xc676('0x113')](path[_0xc676('0x114')](config['root'],_0xc676('0x118'))));_0x209afc[_0xc676('0x9')]('/snippet',express[_0xc676('0x113')](path[_0xc676('0x114')](config[_0xc676('0x115')],_0xc676('0x119'),_0xc676('0x11a'))));_0x209afc[_0xc676('0x9')](_0xc676('0x11b'),express[_0xc676('0x113')](path[_0xc676('0x114')](config['root'],_0xc676('0x11c'))));_0x209afc['route'](_0xc676('0x11d'))[_0xc676('0x11e')](errors[0x194]);_0x209afc[_0xc676('0x11f')]('/*')[_0xc676('0x11e')](function(_0xaf9b61,_0x753ee2){_0x753ee2['sendFile'](path[_0xc676('0x120')](_0x209afc[_0xc676('0x11e')]('appPath')+_0xc676('0x121')));});};var sensitiveFields=[_0xc676('0x122'),'password',_0xc676('0x123'),_0xc676('0x124'),_0xc676('0x125'),_0xc676('0x126'),'street',_0xc676('0x127'),_0xc676('0x128'),_0xc676('0x129'),_0xc676('0x12a'),_0xc676('0x12b'),_0xc676('0x12c'),_0xc676('0x12d'),_0xc676('0x12e'),_0xc676('0x12f'),_0xc676('0x130'),_0xc676('0x131'),_0xc676('0x132'),_0xc676('0x133'),'accessTokenSecret',_0xc676('0x134'),_0xc676('0x135'),_0xc676('0x136'),'membername',_0xc676('0x137'),_0xc676('0x138'),_0xc676('0x139'),'vidaooApiKey',_0xc676('0x13a'),_0xc676('0x13b'),_0xc676('0x13c'),_0xc676('0x13d'),_0xc676('0x13e'),_0xc676('0x16'),_0xc676('0x13f'),_0xc676('0x140'),_0xc676('0x141'),_0xc676('0x142'),_0xc676('0x143'),_0xc676('0x144'),_0xc676('0x145')];function maskSensitiveData(_0x30e6e2){var _0x38c2bc=/(?!^)[\s\S](?!$)/g;if(!_[_0xc676('0x146')](_0x30e6e2))return;for(var _0x443c98 in _0x30e6e2){if(_['isArray'](_0x30e6e2[_0x443c98])){for(var _0x27c0e5=0x0;_0x27c0e5<_0x30e6e2[_0x443c98][_0xc676('0x147')];_0x27c0e5++){maskSensitiveData(_0x30e6e2[_0x443c98][_0x27c0e5]);}}else if(_[_0xc676('0x146')](_0x30e6e2[_0x443c98])){maskSensitiveData(_0x30e6e2[_0x443c98]);}else if(_[_0xc676('0x148')](_0x30e6e2[_0x443c98])){_0x30e6e2[_0x443c98]=_0x30e6e2[_0x443c98][_0xc676('0x149')](/{{{/g,_0xc676('0x14a'))[_0xc676('0x149')](/}}}/g,_0xc676('0x14b'))[_0xc676('0x149')](/{{/g,'@{')['replace'](/}}/g,'}@');if(_[_0xc676('0x14c')](sensitiveFields,_0x443c98)){_0x30e6e2[_0x443c98]=_0x30e6e2[_0x443c98]['replace'](_0x38c2bc,'*');}}}} \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 7e519eb..8a89799 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6607=['../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','server','http','rpc','port','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','RPC\x20listening\x20on\x20','bluebird','lodash','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.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/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/attachment/attachment.rpc'];(function(_0x50a03f,_0x4b30de){var _0x199e40=function(_0x51e169){while(--_0x51e169){_0x50a03f['push'](_0x50a03f['shift']());}};_0x199e40(++_0x4b30de);}(_0x6607,0x1cf));var _0x7660=function(_0x50d199,_0x41a47f){_0x50d199=_0x50d199-0x0;var _0x13cab2=_0x6607[_0x50d199];return _0x13cab2;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x7660('0x0'));var _=require(_0x7660('0x1'));var config=require(_0x7660('0x2'));exports[_0x7660('0x3')]=function(){return new BPromise(function(_0x3bf899,_0x311cb7){var _0x45cc6e={};_0x45cc6e=_[_0x7660('0x4')](_0x45cc6e,require(_0x7660('0x5')));_0x45cc6e=_[_0x7660('0x4')](_0x45cc6e,require('../api/voiceExtension/voiceExtension.rpc'));_0x45cc6e=_[_0x7660('0x4')](_0x45cc6e,require(_0x7660('0x6')));_0x45cc6e=_['merge'](_0x45cc6e,require(_0x7660('0x7')));_0x45cc6e=_[_0x7660('0x4')](_0x45cc6e,require(_0x7660('0x8')));_0x45cc6e=_['merge'](_0x45cc6e,require(_0x7660('0x9')));_0x45cc6e=_[_0x7660('0x4')](_0x45cc6e,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x45cc6e=_[_0x7660('0x4')](_0x45cc6e,require(_0x7660('0xa')));_0x45cc6e=_[_0x7660('0x4')](_0x45cc6e,require(_0x7660('0xb')));_0x45cc6e=_['merge'](_0x45cc6e,require(_0x7660('0xc')));_0x45cc6e=_[_0x7660('0x4')](_0x45cc6e,require(_0x7660('0xd')));_0x45cc6e=_[_0x7660('0x4')](_0x45cc6e,require(_0x7660('0xe')));_0x45cc6e=_[_0x7660('0x4')](_0x45cc6e,require(_0x7660('0xf')));_0x45cc6e=_['merge'](_0x45cc6e,require(_0x7660('0x10')));_0x45cc6e=_[_0x7660('0x4')](_0x45cc6e,require(_0x7660('0x11')));_0x45cc6e=_[_0x7660('0x4')](_0x45cc6e,require(_0x7660('0x12')));_0x45cc6e=_['merge'](_0x45cc6e,require(_0x7660('0x13')));_0x45cc6e=_['merge'](_0x45cc6e,require(_0x7660('0x14')));_0x45cc6e=_[_0x7660('0x4')](_0x45cc6e,require(_0x7660('0x15')));_0x45cc6e=_[_0x7660('0x4')](_0x45cc6e,require(_0x7660('0x16')));_0x45cc6e=_[_0x7660('0x4')](_0x45cc6e,require(_0x7660('0x17')));_0x45cc6e=_[_0x7660('0x4')](_0x45cc6e,require('../api/faxInteraction/faxInteraction.rpc'));_0x45cc6e=_[_0x7660('0x4')](_0x45cc6e,require(_0x7660('0x18')));_0x45cc6e=_['merge'](_0x45cc6e,require(_0x7660('0x19')));_0x45cc6e=_['merge'](_0x45cc6e,require(_0x7660('0x1a')));_0x45cc6e=_['merge'](_0x45cc6e,require(_0x7660('0x1b')));_0x45cc6e=_[_0x7660('0x4')](_0x45cc6e,require(_0x7660('0x1c')));_0x45cc6e=_['merge'](_0x45cc6e,require('../api/smsMessage/smsMessage.rpc'));_0x45cc6e=_[_0x7660('0x4')](_0x45cc6e,require(_0x7660('0x1d')));_0x45cc6e=_[_0x7660('0x4')](_0x45cc6e,require(_0x7660('0x1e')));_0x45cc6e=_[_0x7660('0x4')](_0x45cc6e,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x45cc6e=_['merge'](_0x45cc6e,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x45cc6e=_[_0x7660('0x4')](_0x45cc6e,require(_0x7660('0x1f')));_0x45cc6e=_[_0x7660('0x4')](_0x45cc6e,require(_0x7660('0x20')));_0x45cc6e=_[_0x7660('0x4')](_0x45cc6e,require(_0x7660('0x21')));_0x45cc6e=_['merge'](_0x45cc6e,require(_0x7660('0x22')));_0x45cc6e=_['merge'](_0x45cc6e,require('../api/chatQueue/chatQueue.rpc'));_0x45cc6e=_[_0x7660('0x4')](_0x45cc6e,require(_0x7660('0x23')));_0x45cc6e=_[_0x7660('0x4')](_0x45cc6e,require(_0x7660('0x24')));_0x45cc6e=_[_0x7660('0x4')](_0x45cc6e,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x45cc6e=_[_0x7660('0x4')](_0x45cc6e,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x45cc6e=_['merge'](_0x45cc6e,require(_0x7660('0x25')));_0x45cc6e=_[_0x7660('0x4')](_0x45cc6e,require(_0x7660('0x26')));_0x45cc6e=_[_0x7660('0x4')](_0x45cc6e,require(_0x7660('0x27')));_0x45cc6e=_[_0x7660('0x4')](_0x45cc6e,require(_0x7660('0x28')));_0x45cc6e=_['merge'](_0x45cc6e,require(_0x7660('0x29')));_0x45cc6e=_[_0x7660('0x4')](_0x45cc6e,require(_0x7660('0x2a')));_0x45cc6e=_[_0x7660('0x4')](_0x45cc6e,require(_0x7660('0x2b')));_0x45cc6e=_[_0x7660('0x4')](_0x45cc6e,require(_0x7660('0x2c')));_0x45cc6e=_['merge'](_0x45cc6e,require('../api/variable/variable.rpc'));_0x45cc6e=_[_0x7660('0x4')](_0x45cc6e,require(_0x7660('0x2d')));_0x45cc6e=_['merge'](_0x45cc6e,require(_0x7660('0x2e')));_0x45cc6e=_[_0x7660('0x4')](_0x45cc6e,require(_0x7660('0x2f')));_0x45cc6e=_[_0x7660('0x4')](_0x45cc6e,require(_0x7660('0x30')));_0x45cc6e=_[_0x7660('0x4')](_0x45cc6e,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x45cc6e=_['merge'](_0x45cc6e,require(_0x7660('0x31')));_0x45cc6e=_[_0x7660('0x4')](_0x45cc6e,require(_0x7660('0x32')));_0x45cc6e=_[_0x7660('0x4')](_0x45cc6e,require(_0x7660('0x33')));_0x45cc6e=_[_0x7660('0x4')](_0x45cc6e,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x45cc6e=_[_0x7660('0x4')](_0x45cc6e,require(_0x7660('0x34')));_0x45cc6e=_[_0x7660('0x4')](_0x45cc6e,require(_0x7660('0x35')));_0x45cc6e=_['merge'](_0x45cc6e,require(_0x7660('0x36')));_0x45cc6e=_[_0x7660('0x4')](_0x45cc6e,require(_0x7660('0x37')));_0x45cc6e=_[_0x7660('0x4')](_0x45cc6e,require(_0x7660('0x38')));_0x45cc6e=_['merge'](_0x45cc6e,require(_0x7660('0x39')));_0x45cc6e=_[_0x7660('0x4')](_0x45cc6e,require(_0x7660('0x3a')));_0x45cc6e=_[_0x7660('0x4')](_0x45cc6e,require(_0x7660('0x3b')));_0x45cc6e=_[_0x7660('0x4')](_0x45cc6e,require(_0x7660('0x3c')));_0x45cc6e=_[_0x7660('0x4')](_0x45cc6e,require('../api/squareMessage/squareMessage.rpc'));_0x45cc6e=_[_0x7660('0x4')](_0x45cc6e,require('../api/campaign/campaign.rpc'));_0x45cc6e=_[_0x7660('0x4')](_0x45cc6e,require(_0x7660('0x3d')));_0x45cc6e=_[_0x7660('0x4')](_0x45cc6e,require('../api/plugin/plugin.rpc'));_0x45cc6e=_[_0x7660('0x4')](_0x45cc6e,require(_0x7660('0x3e')));_0x45cc6e=_['merge'](_0x45cc6e,require(_0x7660('0x3f')));_0x45cc6e=_[_0x7660('0x4')](_0x45cc6e,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x45cc6e=_[_0x7660('0x4')](_0x45cc6e,require(_0x7660('0x40')));_0x45cc6e=_[_0x7660('0x4')](_0x45cc6e,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x528467=jayson[_0x7660('0x41')](_0x45cc6e)[_0x7660('0x42')]();var _0x7e899d=config[_0x7660('0x43')]['port']||config[_0x7660('0x44')]+0x1;var _0x3162de=config[_0x7660('0x43')]['ip']||_0x7660('0x45');_0x528467['on'](_0x7660('0x46'),function(_0x47f7e4){return _0x311cb7(_0x47f7e4);});_0x528467['listen'](_0x7e899d,_0x3162de,function(){console[_0x7660('0x47')](_0x7660('0x48'),_0x3162de,_0x7e899d);require(_0x7660('0x49'))['default']();return _0x3bf899(_0x7660('0x4a')+_0x3162de+':'+_0x7e899d);});});}; \ No newline at end of file +var _0xe670=['../api/intDeskAccount/intDeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.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/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/trunk/trunk.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.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','../api/pause/pause.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc'];(function(_0x401089,_0x469a19){var _0x128e7c=function(_0x286ffa){while(--_0x286ffa){_0x401089['push'](_0x401089['shift']());}};_0x128e7c(++_0x469a19);}(_0xe670,0xe5));var _0x0e67=function(_0x406e46,_0x5799cb){_0x406e46=_0x406e46-0x0;var _0x4a3742=_0xe670[_0x406e46];return _0x4a3742;};'use strict';var jayson=require(_0x0e67('0x0'));var BPromise=require('bluebird');var _=require(_0x0e67('0x1'));var config=require(_0x0e67('0x2'));exports[_0x0e67('0x3')]=function(){return new BPromise(function(_0x31142a,_0x5c3492){var _0x46c8fb={};_0x46c8fb=_['merge'](_0x46c8fb,require('../api/user/user.rpc'));_0x46c8fb=_[_0x0e67('0x4')](_0x46c8fb,require(_0x0e67('0x5')));_0x46c8fb=_[_0x0e67('0x4')](_0x46c8fb,require(_0x0e67('0x6')));_0x46c8fb=_[_0x0e67('0x4')](_0x46c8fb,require(_0x0e67('0x7')));_0x46c8fb=_[_0x0e67('0x4')](_0x46c8fb,require(_0x0e67('0x8')));_0x46c8fb=_['merge'](_0x46c8fb,require(_0x0e67('0x9')));_0x46c8fb=_[_0x0e67('0x4')](_0x46c8fb,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x46c8fb=_[_0x0e67('0x4')](_0x46c8fb,require(_0x0e67('0xa')));_0x46c8fb=_['merge'](_0x46c8fb,require('../api/memberReport/memberReport.rpc'));_0x46c8fb=_[_0x0e67('0x4')](_0x46c8fb,require(_0x0e67('0xb')));_0x46c8fb=_[_0x0e67('0x4')](_0x46c8fb,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x46c8fb=_[_0x0e67('0x4')](_0x46c8fb,require(_0x0e67('0xc')));_0x46c8fb=_['merge'](_0x46c8fb,require(_0x0e67('0xd')));_0x46c8fb=_[_0x0e67('0x4')](_0x46c8fb,require(_0x0e67('0xe')));_0x46c8fb=_['merge'](_0x46c8fb,require('../api/mailQueue/mailQueue.rpc'));_0x46c8fb=_['merge'](_0x46c8fb,require(_0x0e67('0xf')));_0x46c8fb=_[_0x0e67('0x4')](_0x46c8fb,require(_0x0e67('0x10')));_0x46c8fb=_[_0x0e67('0x4')](_0x46c8fb,require(_0x0e67('0x11')));_0x46c8fb=_[_0x0e67('0x4')](_0x46c8fb,require(_0x0e67('0x12')));_0x46c8fb=_['merge'](_0x46c8fb,require(_0x0e67('0x13')));_0x46c8fb=_[_0x0e67('0x4')](_0x46c8fb,require(_0x0e67('0x14')));_0x46c8fb=_['merge'](_0x46c8fb,require(_0x0e67('0x15')));_0x46c8fb=_[_0x0e67('0x4')](_0x46c8fb,require(_0x0e67('0x16')));_0x46c8fb=_[_0x0e67('0x4')](_0x46c8fb,require('../api/faxQueue/faxQueue.rpc'));_0x46c8fb=_['merge'](_0x46c8fb,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x46c8fb=_[_0x0e67('0x4')](_0x46c8fb,require(_0x0e67('0x17')));_0x46c8fb=_['merge'](_0x46c8fb,require(_0x0e67('0x18')));_0x46c8fb=_[_0x0e67('0x4')](_0x46c8fb,require(_0x0e67('0x19')));_0x46c8fb=_[_0x0e67('0x4')](_0x46c8fb,require('../api/smsQueue/smsQueue.rpc'));_0x46c8fb=_[_0x0e67('0x4')](_0x46c8fb,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x46c8fb=_['merge'](_0x46c8fb,require(_0x0e67('0x1a')));_0x46c8fb=_[_0x0e67('0x4')](_0x46c8fb,require(_0x0e67('0x1b')));_0x46c8fb=_[_0x0e67('0x4')](_0x46c8fb,require(_0x0e67('0x1c')));_0x46c8fb=_['merge'](_0x46c8fb,require(_0x0e67('0x1d')));_0x46c8fb=_[_0x0e67('0x4')](_0x46c8fb,require('../api/chatInteraction/chatInteraction.rpc'));_0x46c8fb=_[_0x0e67('0x4')](_0x46c8fb,require('../api/chatMessage/chatMessage.rpc'));_0x46c8fb=_[_0x0e67('0x4')](_0x46c8fb,require(_0x0e67('0x1e')));_0x46c8fb=_[_0x0e67('0x4')](_0x46c8fb,require(_0x0e67('0x1f')));_0x46c8fb=_[_0x0e67('0x4')](_0x46c8fb,require(_0x0e67('0x20')));_0x46c8fb=_[_0x0e67('0x4')](_0x46c8fb,require(_0x0e67('0x21')));_0x46c8fb=_[_0x0e67('0x4')](_0x46c8fb,require(_0x0e67('0x22')));_0x46c8fb=_['merge'](_0x46c8fb,require(_0x0e67('0x23')));_0x46c8fb=_[_0x0e67('0x4')](_0x46c8fb,require(_0x0e67('0x24')));_0x46c8fb=_[_0x0e67('0x4')](_0x46c8fb,require(_0x0e67('0x25')));_0x46c8fb=_['merge'](_0x46c8fb,require(_0x0e67('0x26')));_0x46c8fb=_['merge'](_0x46c8fb,require('../api/sound/sound.rpc'));_0x46c8fb=_[_0x0e67('0x4')](_0x46c8fb,require(_0x0e67('0x27')));_0x46c8fb=_[_0x0e67('0x4')](_0x46c8fb,require('../api/template/template.rpc'));_0x46c8fb=_[_0x0e67('0x4')](_0x46c8fb,require('../api/trigger/trigger.rpc'));_0x46c8fb=_[_0x0e67('0x4')](_0x46c8fb,require(_0x0e67('0x28')));_0x46c8fb=_[_0x0e67('0x4')](_0x46c8fb,require(_0x0e67('0x29')));_0x46c8fb=_[_0x0e67('0x4')](_0x46c8fb,require(_0x0e67('0x2a')));_0x46c8fb=_['merge'](_0x46c8fb,require(_0x0e67('0x2b')));_0x46c8fb=_[_0x0e67('0x4')](_0x46c8fb,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x46c8fb=_[_0x0e67('0x4')](_0x46c8fb,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x46c8fb=_[_0x0e67('0x4')](_0x46c8fb,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x46c8fb=_[_0x0e67('0x4')](_0x46c8fb,require(_0x0e67('0x2c')));_0x46c8fb=_[_0x0e67('0x4')](_0x46c8fb,require(_0x0e67('0x2d')));_0x46c8fb=_[_0x0e67('0x4')](_0x46c8fb,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x46c8fb=_[_0x0e67('0x4')](_0x46c8fb,require(_0x0e67('0x2e')));_0x46c8fb=_[_0x0e67('0x4')](_0x46c8fb,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x46c8fb=_['merge'](_0x46c8fb,require(_0x0e67('0x2f')));_0x46c8fb=_[_0x0e67('0x4')](_0x46c8fb,require(_0x0e67('0x30')));_0x46c8fb=_[_0x0e67('0x4')](_0x46c8fb,require(_0x0e67('0x31')));_0x46c8fb=_[_0x0e67('0x4')](_0x46c8fb,require('../api/setting/setting.rpc'));_0x46c8fb=_[_0x0e67('0x4')](_0x46c8fb,require(_0x0e67('0x32')));_0x46c8fb=_[_0x0e67('0x4')](_0x46c8fb,require('../api/squareProject/squareProject.rpc'));_0x46c8fb=_[_0x0e67('0x4')](_0x46c8fb,require(_0x0e67('0x33')));_0x46c8fb=_[_0x0e67('0x4')](_0x46c8fb,require(_0x0e67('0x34')));_0x46c8fb=_[_0x0e67('0x4')](_0x46c8fb,require(_0x0e67('0x35')));_0x46c8fb=_[_0x0e67('0x4')](_0x46c8fb,require(_0x0e67('0x36')));_0x46c8fb=_[_0x0e67('0x4')](_0x46c8fb,require(_0x0e67('0x37')));_0x46c8fb=_[_0x0e67('0x4')](_0x46c8fb,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x46c8fb=_[_0x0e67('0x4')](_0x46c8fb,require(_0x0e67('0x38')));_0x46c8fb=_[_0x0e67('0x4')](_0x46c8fb,require(_0x0e67('0x39')));_0x46c8fb=_['merge'](_0x46c8fb,require(_0x0e67('0x3a')));_0x46c8fb=_[_0x0e67('0x4')](_0x46c8fb,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x23273f=jayson[_0x0e67('0x3b')](_0x46c8fb)[_0x0e67('0x3c')]();var _0x1067a3=config[_0x0e67('0x3d')][_0x0e67('0x3e')]||config['port']+0x1;var _0x26a517=config[_0x0e67('0x3d')]['ip']||'localhost';_0x23273f['on'](_0x0e67('0x3f'),function(_0x1ff52c){return _0x5c3492(_0x1ff52c);});_0x23273f[_0x0e67('0x3')](_0x1067a3,_0x26a517,function(){console['log'](_0x0e67('0x40'),_0x26a517,_0x1067a3);require(_0x0e67('0x41'))[_0x0e67('0x42')]();return _0x31142a(_0x0e67('0x43')+_0x26a517+':'+_0x1067a3);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 3b23667..79ec9c5 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 _0x37c2=['label','util','lodash','events','EventEmitter','./reply','call','setEncoding','utf8','setTimeout','headers','emit','ready','line','toLowerCase','hangup','520\x20End\x20of\x20proper','no\x20code','substring','replace','result=','indexOf','substr','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','function','write','inherits','prototype','sendRequest','sync','ANSWER','beep','format','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','HANGUP','setVariable','isBoolean','isNumber','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','BEEP','streamFile','agi','AGI','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x37c2,0x129));var _0x237c=function(_0x23ca21,_0x44a5ad){_0x23ca21=_0x23ca21-0x0;var _0x1b90d5=_0x37c2[_0x23ca21];return _0x1b90d5;};'use strict';var util=require(_0x237c('0x0'));var _=require(_0x237c('0x1'));var EventEmitter=require(_0x237c('0x2'))[_0x237c('0x3')];var AGIReply=require(_0x237c('0x4'));var AGIError=require('./error');function AGIChannel(_0x74194d){var _0x48ef4e=this,_0x291377=new AGIReply(),_0x2d0b65=![],_0x5bfcbb={};EventEmitter[_0x237c('0x5')](_0x48ef4e);_0x74194d[_0x237c('0x6')](_0x237c('0x7'));_0x74194d[_0x237c('0x8')](0x8*0x3c*0x3c*0x3e8);_0x291377[_0x237c('0x6')](_0x237c('0x7'));_0x291377['on'](_0x237c('0x9'),function(_0x185c58){for(var _0x43c084 in _0x185c58){_0x48ef4e[_0x43c084]=_0x185c58[_0x43c084];}_0x48ef4e[_0x237c('0xa')](_0x237c('0xb'));});_0x291377['on'](_0x237c('0xc'),function(_0x9ba44c){if(_0x9ba44c[_0x237c('0xd')]()==_0x237c('0xe')){_0x48ef4e['emit'](_0x237c('0xe'));return;}if(_0x9ba44c['substring'](0x0,0xb)=='520-Invalid'){_0x2d0b65=!![];}if(_0x2d0b65){_0x5bfcbb['rx']+=_0x9ba44c+'\x0a';if(_0x9ba44c['search'](_0x237c('0xf'))!=-0x1){_0x2d0b65=![];}}else{_0x5bfcbb['rx']=_0x9ba44c;}if(_0x2d0b65){return;}if(typeof _0x5bfcbb['cb']=='function'){var _0x157607=_0x5bfcbb['rx']['substring'](0x0,0x3),_0x2702c7=null,_0x29268f=null;_0x157607=parseInt(_0x157607);if(isNaN(_0x157607)){_0x5bfcbb['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x237c('0x10')});return;}if(_0x157607!=0xc8){_0x5bfcbb['cb'](null,{'code':_0x157607,'result':-0x1,'extra':'KO'});return;}_0x2702c7=_0x5bfcbb['rx'][_0x237c('0x11')](0x4)[_0x237c('0x12')](_0x237c('0x13'),'');if(_0x2702c7[_0x237c('0x14')]('\x20')!=-0x1){_0x2702c7=_0x2702c7[_0x237c('0x15')](0x0,_0x2702c7['indexOf']('\x20'));}if(_[_0x237c('0x16')](_0x2702c7,'-1')){_0x2702c7=parseInt(_0x2702c7);}_0x29268f=_0x5bfcbb['rx'][_0x237c('0x17')]('\x20');if(_0x29268f[_0x237c('0x18')]==0x3){_0x29268f=_0x29268f[0x2]['substring'](0x1,_0x29268f[0x2]['length']-0x1);}else if(_0x29268f['length']>0x3){var _0x46aa6c=/\((.+)\)/;var _0x145916=_0x5bfcbb['rx'][_0x237c('0x19')](_0x46aa6c);if(_0x145916){_0x29268f=_0x145916[0x1];}else{_0x29268f=null;}}else{_0x29268f=null;}_0x5bfcbb['cb'](null,{'code':_0x157607,'result':_0x2702c7,'extra':_0x29268f});}});_0x74194d['on'](_0x237c('0x1a'),function(_0x4c40d0){_0x48ef4e[_0x237c('0xa')](_0x237c('0x1a'),new AGIError(_0x237c('0x1b'),_0x4c40d0['code']));});_0x74194d['on'](_0x237c('0x1c'),function(){_0x48ef4e[_0x237c('0xa')](_0x237c('0x1c'),new AGIError(_0x237c('0x1d')));});_0x74194d['on'](_0x237c('0x1e'),function(){_0x48ef4e[_0x237c('0xa')]('timeout',new AGIError(_0x237c('0x1f')));_0x74194d[_0x237c('0x20')]();});_0x74194d[_0x237c('0x21')](_0x291377);this[_0x237c('0x22')]=function(_0x2090d6,_0x3478c7){var _0x2090d6=_0x2090d6||'',_0x3478c7=typeof _0x3478c7==_0x237c('0x23')?_0x3478c7:new Function();_0x5bfcbb={'tx':_0x2090d6,'rx':'','cb':_0x3478c7};_0x74194d[_0x237c('0x24')](_0x2090d6+'\x0a');},this[_0x237c('0x1c')]=function(){_0x74194d[_0x237c('0x20')]();};}util[_0x237c('0x25')](AGIChannel,EventEmitter);AGIChannel[_0x237c('0x26')][_0x237c('0x27')]=function(_0x46fd43){return this[_0x237c('0x22')][_0x237c('0x28')](this,_0x46fd43);};AGIChannel[_0x237c('0x26')]['answer']=function(){return this[_0x237c('0x27')](_0x237c('0x29'));};AGIChannel[_0x237c('0x26')]['getData']=function(_0x420f20,_0x3d8ea3,_0x2fdf99){_0x420f20=_0x420f20===undefined?_0x237c('0x2a'):_0x420f20;_0x3d8ea3=_0x3d8ea3===undefined?'5':_0x3d8ea3;_0x2fdf99=_0x2fdf99===undefined?'1':_0x2fdf99;return this[_0x237c('0x27')](util[_0x237c('0x2b')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x420f20,_0x3d8ea3*0x3e8,_0x2fdf99));};AGIChannel[_0x237c('0x26')][_0x237c('0x2c')]=function(_0x49edaf){_0x49edaf=_0x49edaf||_0x237c('0x2d');return this[_0x237c('0x27')](util[_0x237c('0x2b')](_0x237c('0x2e'),_0x49edaf));};AGIChannel['prototype'][_0x237c('0x2f')]=function(_0x1eb684,_0xbabec){if(_['isArray'](_0xbabec)){return this[_0x237c('0x27')](util[_0x237c('0x2b')](_0x237c('0x30'),_0x1eb684,_0xbabec[_0x237c('0x31')](',')));}return this[_0x237c('0x27')](util[_0x237c('0x2b')](_0x237c('0x30'),_0x1eb684,_0xbabec));};AGIChannel[_0x237c('0x26')][_0x237c('0x32')]=function(_0x29517e){return this[_0x237c('0x27')](util[_0x237c('0x2b')](_0x237c('0x33'),_0x29517e));};AGIChannel[_0x237c('0x26')][_0x237c('0x34')]=function(_0x401718){return this['sendRequest'](util[_0x237c('0x2b')](_0x237c('0x35'),_0x401718));};AGIChannel[_0x237c('0x26')][_0x237c('0x36')]=function(_0x1f7821){return this['sendRequest'](util[_0x237c('0x2b')]('SET\x20PRIORITY\x20%s',_0x1f7821));};AGIChannel[_0x237c('0x26')][_0x237c('0xe')]=function(){return this[_0x237c('0x27')](_0x237c('0x37'));};AGIChannel['prototype'][_0x237c('0x38')]=function(_0xc3b9d8,_0x51287b){var _0x1c018f=_[_0x237c('0x39')](_0x51287b)||_[_0x237c('0x3a')](_0x51287b)?_0x51287b[_0x237c('0x3b')]():_0x51287b;return this[_0x237c('0x27')](util[_0x237c('0x2b')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0xc3b9d8,_0x1c018f?_0x1c018f[_0x237c('0x3b')]()[_0x237c('0x12')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x237c('0x26')][_0x237c('0x3c')]=function(_0x5597db,_0x1b135d){return this[_0x237c('0x27')](util[_0x237c('0x2b')](_0x237c('0x3d'),_0x5597db,_0x1b135d));};AGIChannel[_0x237c('0x26')][_0x237c('0x3e')]=function(_0x1eee1d,_0x2f1c69){return this['sendRequest'](util[_0x237c('0x2b')](_0x237c('0x3f'),_0x1eee1d,_0x2f1c69));};AGIChannel[_0x237c('0x26')][_0x237c('0x40')]=function(_0x2f1420,_0x56c123){return this[_0x237c('0x27')](util['format'](_0x237c('0x41'),_0x2f1420,_0x56c123));};AGIChannel[_0x237c('0x26')]['continueAt']=function(_0x4d0d87,_0x46725f,_0x3bfd8a){_0x46725f=_0x46725f||this['extension'];_0x3bfd8a=_0x3bfd8a||0x1;this[_0x237c('0x32')](_0x4d0d87);this['setExtension'](_0x46725f);this[_0x237c('0x36')](_0x3bfd8a);return this[_0x237c('0x2c')](util['format']('GOTO\x20%s\x20%s\x20%s',_0x4d0d87,_0x46725f,_0x3bfd8a));};AGIChannel[_0x237c('0x26')][_0x237c('0x42')]=function(_0x2cbc31){return this[_0x237c('0x27')](util[_0x237c('0x2b')](_0x237c('0x43'),_0x2cbc31));};AGIChannel[_0x237c('0x26')]['recordFile']=function(_0x1c2239,_0x4c63fa,_0x5adb9b,_0x35a05e,_0x1a7a4a,_0x15005c){_0x4c63fa=_0x4c63fa||'wav';_0x5adb9b=_0x5adb9b||'';_0x35a05e=_0x35a05e===undefined?-0x1:_0x35a05e==='-1'?-0x1:_0x35a05e*0x3e8;_0x1a7a4a=_0x1a7a4a===undefined?'':'s='+_0x1a7a4a;_0x15005c=_0x15005c?_0x237c('0x44'):'';return this[_0x237c('0x27')](util['format']('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x1c2239,_0x4c63fa,_0x5adb9b,_0x35a05e,_0x15005c,_0x1a7a4a));};AGIChannel[_0x237c('0x26')][_0x237c('0x45')]=function(_0x19af94,_0x1b88a0){_0x1b88a0=_0x1b88a0||'';return this['sendRequest'](util[_0x237c('0x2b')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x19af94,_0x1b88a0));};AGIChannel[_0x237c('0x26')][_0x237c('0x46')]=function(_0x51a273){return this['exec'](_0x237c('0x47'),_0x51a273);};AGIChannel[_0x237c('0x26')]['wait']=function(_0x536d5b){return this['exec']('WAIT',_0x536d5b);};AGIChannel[_0x237c('0x26')][_0x237c('0x1a')]=function(_0x57c469,_0x5e2dd6){this[_0x237c('0x2c')](util[_0x237c('0x2b')](_0x237c('0x48'),_0x57c469['id'],_0x57c469[_0x237c('0x49')],_0x5e2dd6));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel; \ No newline at end of file +var _0xf156=['answer','ANSWER','beep','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','exec','isArray','format','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','setVariable','isBoolean','isNumber','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','extension','getVariable','GET\x20VARIABLE\x20\x22%s\x22','wav','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','agi','AGI','wait','WAIT','label','lodash','events','./reply','call','setTimeout','setEncoding','headers','emit','toLowerCase','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','indexOf','substr','startsWith','split','length','error','E_AGI_SOCKET_ERROR','code','close','timeout','pipe','command','destroy','prototype','sendRequest','sync'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0xf156,0x137));var _0x6f15=function(_0x1c0a18,_0x120359){_0x1c0a18=_0x1c0a18-0x0;var _0x8a8124=_0xf156[_0x1c0a18];return _0x8a8124;};'use strict';var util=require('util');var _=require(_0x6f15('0x0'));var EventEmitter=require(_0x6f15('0x1'))['EventEmitter'];var AGIReply=require(_0x6f15('0x2'));var AGIError=require('./error');function AGIChannel(_0x1a6bee){var _0x4161e1=this,_0x15bc29=new AGIReply(),_0x247772=![],_0x3d8f24={};EventEmitter[_0x6f15('0x3')](_0x4161e1);_0x1a6bee['setEncoding']('utf8');_0x1a6bee[_0x6f15('0x4')](0x8*0x3c*0x3c*0x3e8);_0x15bc29[_0x6f15('0x5')]('utf8');_0x15bc29['on'](_0x6f15('0x6'),function(_0x30a0a5){for(var _0xa067df in _0x30a0a5){_0x4161e1[_0xa067df]=_0x30a0a5[_0xa067df];}_0x4161e1[_0x6f15('0x7')]('ready');});_0x15bc29['on']('line',function(_0x352bf2){if(_0x352bf2[_0x6f15('0x8')]()==_0x6f15('0x9')){_0x4161e1[_0x6f15('0x7')](_0x6f15('0x9'));return;}if(_0x352bf2[_0x6f15('0xa')](0x0,0xb)==_0x6f15('0xb')){_0x247772=!![];}if(_0x247772){_0x3d8f24['rx']+=_0x352bf2+'\x0a';if(_0x352bf2[_0x6f15('0xc')](_0x6f15('0xd'))!=-0x1){_0x247772=![];}}else{_0x3d8f24['rx']=_0x352bf2;}if(_0x247772){return;}if(typeof _0x3d8f24['cb']==_0x6f15('0xe')){var _0x544473=_0x3d8f24['rx'][_0x6f15('0xa')](0x0,0x3),_0x814004=null,_0x59ef14=null;_0x544473=parseInt(_0x544473);if(isNaN(_0x544473)){_0x3d8f24['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x6f15('0xf')});return;}if(_0x544473!=0xc8){_0x3d8f24['cb'](null,{'code':_0x544473,'result':-0x1,'extra':'KO'});return;}_0x814004=_0x3d8f24['rx'][_0x6f15('0xa')](0x4)[_0x6f15('0x10')](_0x6f15('0x11'),'');if(_0x814004[_0x6f15('0x12')]('\x20')!=-0x1){_0x814004=_0x814004[_0x6f15('0x13')](0x0,_0x814004[_0x6f15('0x12')]('\x20'));}if(_[_0x6f15('0x14')](_0x814004,'-1')){_0x814004=parseInt(_0x814004);}_0x59ef14=_0x3d8f24['rx'][_0x6f15('0x15')]('\x20');if(_0x59ef14['length']==0x3){_0x59ef14=_0x59ef14[0x2][_0x6f15('0xa')](0x1,_0x59ef14[0x2]['length']-0x1);}else if(_0x59ef14[_0x6f15('0x16')]>0x3){var _0x5e1620=/\((.+)\)/;var _0x48e7f3=_0x3d8f24['rx']['match'](_0x5e1620);if(_0x48e7f3){_0x59ef14=_0x48e7f3[0x1];}else{_0x59ef14=null;}}else{_0x59ef14=null;}_0x3d8f24['cb'](null,{'code':_0x544473,'result':_0x814004,'extra':_0x59ef14});}});_0x1a6bee['on'](_0x6f15('0x17'),function(_0x588a27){_0x4161e1[_0x6f15('0x7')]('error',new AGIError(_0x6f15('0x18'),_0x588a27[_0x6f15('0x19')]));});_0x1a6bee['on'](_0x6f15('0x1a'),function(){_0x4161e1[_0x6f15('0x7')]('close',new AGIError('E_AGI_SOCKET_CLOSE'));});_0x1a6bee['on'](_0x6f15('0x1b'),function(){_0x4161e1[_0x6f15('0x7')](_0x6f15('0x1b'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x1a6bee['destroy']();});_0x1a6bee[_0x6f15('0x1c')](_0x15bc29);this[_0x6f15('0x1d')]=function(_0x4d5759,_0x15e861){var _0x4d5759=_0x4d5759||'',_0x15e861=typeof _0x15e861==_0x6f15('0xe')?_0x15e861:new Function();_0x3d8f24={'tx':_0x4d5759,'rx':'','cb':_0x15e861};_0x1a6bee['write'](_0x4d5759+'\x0a');},this['close']=function(){_0x1a6bee[_0x6f15('0x1e')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0x6f15('0x1f')][_0x6f15('0x20')]=function(_0xbd0bff){return this[_0x6f15('0x1d')][_0x6f15('0x21')](this,_0xbd0bff);};AGIChannel['prototype'][_0x6f15('0x22')]=function(){return this[_0x6f15('0x20')](_0x6f15('0x23'));};AGIChannel[_0x6f15('0x1f')]['getData']=function(_0x213087,_0x1a9f57,_0x2329f1){_0x213087=_0x213087===undefined?_0x6f15('0x24'):_0x213087;_0x1a9f57=_0x1a9f57===undefined?'5':_0x1a9f57;_0x2329f1=_0x2329f1===undefined?'1':_0x2329f1;return this['sendRequest'](util['format'](_0x6f15('0x25'),_0x213087,_0x1a9f57*0x3e8,_0x2329f1));};AGIChannel[_0x6f15('0x1f')][_0x6f15('0x26')]=function(_0x4c9cfd){_0x4c9cfd=_0x4c9cfd||'NO\x20MESSAGE';return this[_0x6f15('0x20')](util['format']('VERBOSE\x20\x22%s\x22',_0x4c9cfd));};AGIChannel[_0x6f15('0x1f')][_0x6f15('0x27')]=function(_0x586da9,_0x6e0db8){if(_[_0x6f15('0x28')](_0x6e0db8)){return this['sendRequest'](util[_0x6f15('0x29')](_0x6f15('0x2a'),_0x586da9,_0x6e0db8['join'](',')));}return this[_0x6f15('0x20')](util['format'](_0x6f15('0x2a'),_0x586da9,_0x6e0db8));};AGIChannel[_0x6f15('0x1f')][_0x6f15('0x2b')]=function(_0x49daa2){return this[_0x6f15('0x20')](util[_0x6f15('0x29')](_0x6f15('0x2c'),_0x49daa2));};AGIChannel[_0x6f15('0x1f')][_0x6f15('0x2d')]=function(_0x221384){return this[_0x6f15('0x20')](util[_0x6f15('0x29')](_0x6f15('0x2e'),_0x221384));};AGIChannel[_0x6f15('0x1f')][_0x6f15('0x2f')]=function(_0xffc6ea){return this[_0x6f15('0x20')](util[_0x6f15('0x29')](_0x6f15('0x30'),_0xffc6ea));};AGIChannel[_0x6f15('0x1f')][_0x6f15('0x9')]=function(){return this[_0x6f15('0x20')]('HANGUP');};AGIChannel['prototype'][_0x6f15('0x31')]=function(_0x5e5413,_0x522ecc){var _0x4b1665=_[_0x6f15('0x32')](_0x522ecc)||_[_0x6f15('0x33')](_0x522ecc)?_0x522ecc[_0x6f15('0x34')]():_0x522ecc;return this[_0x6f15('0x20')](util[_0x6f15('0x29')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x5e5413,_0x4b1665?_0x4b1665[_0x6f15('0x34')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x6f15('0x1f')][_0x6f15('0x35')]=function(_0x1561d6,_0x2dbcd4){return this[_0x6f15('0x20')](util['format'](_0x6f15('0x36'),_0x1561d6,_0x2dbcd4));};AGIChannel[_0x6f15('0x1f')][_0x6f15('0x37')]=function(_0x58bb90,_0x5ea823){return this['sendRequest'](util['format']('SAY\x20DIGITS\x20%s\x20%s',_0x58bb90,_0x5ea823));};AGIChannel[_0x6f15('0x1f')][_0x6f15('0x38')]=function(_0x37d7ff,_0x2d0dd1){return this[_0x6f15('0x20')](util[_0x6f15('0x29')](_0x6f15('0x39'),_0x37d7ff,_0x2d0dd1));};AGIChannel['prototype']['continueAt']=function(_0x50d12b,_0x589114,_0x42b297){_0x589114=_0x589114||this[_0x6f15('0x3a')];_0x42b297=_0x42b297||0x1;this[_0x6f15('0x2b')](_0x50d12b);this[_0x6f15('0x2d')](_0x589114);this[_0x6f15('0x2f')](_0x42b297);return this['noop'](util[_0x6f15('0x29')]('GOTO\x20%s\x20%s\x20%s',_0x50d12b,_0x589114,_0x42b297));};AGIChannel[_0x6f15('0x1f')][_0x6f15('0x3b')]=function(_0x3e3c3a){return this[_0x6f15('0x20')](util[_0x6f15('0x29')](_0x6f15('0x3c'),_0x3e3c3a));};AGIChannel[_0x6f15('0x1f')]['recordFile']=function(_0x142796,_0x3c2556,_0x2f746f,_0x1c1c4e,_0x5795d1,_0xd960b5){_0x3c2556=_0x3c2556||_0x6f15('0x3d');_0x2f746f=_0x2f746f||'';_0x1c1c4e=_0x1c1c4e===undefined?-0x1:_0x1c1c4e==='-1'?-0x1:_0x1c1c4e*0x3e8;_0x5795d1=_0x5795d1===undefined?'':'s='+_0x5795d1;_0xd960b5=_0xd960b5?'BEEP':'';return this[_0x6f15('0x20')](util[_0x6f15('0x29')](_0x6f15('0x3e'),_0x142796,_0x3c2556,_0x2f746f,_0x1c1c4e,_0xd960b5,_0x5795d1));};AGIChannel[_0x6f15('0x1f')][_0x6f15('0x3f')]=function(_0x180877,_0x42cad1){_0x42cad1=_0x42cad1||'';return this[_0x6f15('0x20')](util[_0x6f15('0x29')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x180877,_0x42cad1));};AGIChannel[_0x6f15('0x1f')][_0x6f15('0x40')]=function(_0x18b82f){return this['exec'](_0x6f15('0x41'),_0x18b82f);};AGIChannel[_0x6f15('0x1f')][_0x6f15('0x42')]=function(_0x203944){return this[_0x6f15('0x27')](_0x6f15('0x43'),_0x203944);};AGIChannel[_0x6f15('0x1f')][_0x6f15('0x17')]=function(_0x4c6b23,_0x3daed5){this[_0x6f15('0x26')](util[_0x6f15('0x29')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x4c6b23['id'],_0x4c6b23[_0x6f15('0x44')],_0x3daed5));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 91298a4..8c3b0a4 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 _0x6761=['push','format','apply','message','name','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED'];(function(_0x430290,_0x5901b0){var _0x48d17a=function(_0x4fbdf5){while(--_0x4fbdf5){_0x430290['push'](_0x430290['shift']());}};_0x48d17a(++_0x5901b0);}(_0x6761,0x84));var _0x1676=function(_0x4f1c6c,_0x4e026a){_0x4f1c6c=_0x4f1c6c-0x0;var _0x224fed=_0x6761[_0x4f1c6c];return _0x224fed;};'use strict';var util=require(_0x1676('0x0'));var error={'E_AGI_UNDEFINED':_0x1676('0x1'),'E_AGI_ARGUMENT_PORT':_0x1676('0x2'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0x1676('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0x1676('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0x1676('0x5'),'E_AGI_SOCKET_ERROR':_0x1676('0x6'),'E_AGI_SOCKET_CLOSE':_0x1676('0x7'),'E_AGI_SOCKET_TIMEOUT':_0x1676('0x8'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x1676('0x9'),'E_AGI_IVR_ENTRY':_0x1676('0xa')};function AGIError(_0x60427e){var _0x60427e=_0x60427e||null,_0x884068=_0x884068||[],_0x502267=0x1,_0x224203='';if(!error[_0x60427e]){_0x60427e=_0x1676('0xb');}_0x884068['push'](error[_0x60427e]);while(arguments[_0x502267]){_0x884068[_0x1676('0xc')](arguments[_0x502267]);_0x502267++;}_0x224203=util[_0x1676('0xd')][_0x1676('0xe')](util,_0x884068);this[_0x1676('0xf')]=_0x224203;this[_0x1676('0x10')]=_0x60427e;}module[_0x1676('0x11')]=AGIError; \ No newline at end of file +var _0x7b33=['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\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_UNDEFINED','apply','message','name','util'];(function(_0x474e8e,_0x2c406e){var _0x373747=function(_0x42f2a2){while(--_0x42f2a2){_0x474e8e['push'](_0x474e8e['shift']());}};_0x373747(++_0x2c406e);}(_0x7b33,0x8f));var _0x37b3=function(_0xefea0f,_0x5c0d97){_0xefea0f=_0xefea0f-0x0;var _0xfee0b5=_0x7b33[_0xefea0f];return _0xfee0b5;};'use strict';var util=require(_0x37b3('0x0'));var error={'E_AGI_UNDEFINED':_0x37b3('0x1'),'E_AGI_ARGUMENT_PORT':_0x37b3('0x2'),'E_AGI_SERVER_ERROR':_0x37b3('0x3'),'E_AGI_SERVER_CLOSE':_0x37b3('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0x37b3('0x5'),'E_AGI_SERVER_VOICE_DISABLED':_0x37b3('0x6'),'E_AGI_SOCKET_ERROR':_0x37b3('0x7'),'E_AGI_SOCKET_CLOSE':_0x37b3('0x8'),'E_AGI_SOCKET_TIMEOUT':_0x37b3('0x9'),'E_AGI_COMMAND_EMPTY':_0x37b3('0xa'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x37b3('0xb'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x4a7195){var _0x4a7195=_0x4a7195||null,_0x361c1f=_0x361c1f||[],_0x535b8d=0x1,_0x3e5212='';if(!error[_0x4a7195]){_0x4a7195=_0x37b3('0xc');}_0x361c1f['push'](error[_0x4a7195]);while(arguments[_0x535b8d]){_0x361c1f['push'](arguments[_0x535b8d]);_0x535b8d++;}_0x3e5212=util['format'][_0x37b3('0xd')](util,_0x361c1f);this[_0x37b3('0xe')]=_0x3e5212;this[_0x37b3('0xf')]=_0x4a7195;}module['exports']=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 003884c..b84e2af 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 _0xa2a1=['vswitch','default','target','agicommand','menu','invalid','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','../../../config/logger','agi','getdigits','getsecretdigits','vertices','edges','numberOfEdges','prototype','addVertex','addEdge','size','traverseBFS','info','no\x20vertex\x20found','length','no\x20edge/s\x20available','condition','split'];(function(_0x14e24b,_0x148d37){var _0x34e280=function(_0xaff9cf){while(--_0xaff9cf){_0x14e24b['push'](_0x14e24b['shift']());}};_0x34e280(++_0x148d37);}(_0xa2a1,0x191));var _0x1a2a=function(_0x168678,_0x5daeb3){_0x168678=_0x168678-0x0;var _0x35fe16=_0xa2a1[_0x168678];return _0x35fe16;};'use strict';var _=require(_0x1a2a('0x0'));var logger=require(_0x1a2a('0x1'))(_0x1a2a('0x2'));var verticesWithRetry=['menu',_0x1a2a('0x3'),_0x1a2a('0x4')];var Graph=function(){this[_0x1a2a('0x5')]={};this[_0x1a2a('0x6')]={};this[_0x1a2a('0x7')]=0x0;};Graph[_0x1a2a('0x8')][_0x1a2a('0x9')]=function(_0x15a366){this[_0x1a2a('0x5')][_0x15a366['id']]=_0x15a366;this[_0x1a2a('0x6')][_0x15a366['id']]=[];};Graph[_0x1a2a('0x8')][_0x1a2a('0xa')]=function(_0xf4b9c1,_0xfb0b42,_0x297f5e){this[_0x1a2a('0x6')][_0xf4b9c1]['push']({'target':_0xfb0b42,'condition':_0x297f5e});this[_0x1a2a('0x7')]+=0x1;};Graph[_0x1a2a('0x8')][_0x1a2a('0xb')]=function(){return _[_0x1a2a('0xb')](this[_0x1a2a('0x5')]);};Graph[_0x1a2a('0x8')]['relations']=function(){return this[_0x1a2a('0x7')];};Graph[_0x1a2a('0x8')]['getVertex']=function(_0x52cf27){return this['vertices'][_0x52cf27];};Graph[_0x1a2a('0x8')][_0x1a2a('0xc')]=function(_0x531660,_0x3c05b4){if(!this[_0x1a2a('0x5')][_0x531660]){return logger[_0x1a2a('0xd')](_0x1a2a('0xe'));}var _0x2ddc9e=_0x3c05b4(this['vertices'][_0x531660]);if(!_0x2ddc9e){return logger[_0x1a2a('0xd')]('stop\x20traverse');}if(this[_0x1a2a('0x6')][_0x531660][_0x1a2a('0xf')]===0x0){return logger[_0x1a2a('0xd')](_0x1a2a('0x10'));}for(var _0x341134=0x0,_0x370f64=[],_0x431f30=![];_0x341134\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','hangup','sync','production','start','stringify','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','traverseBFS','clear','vertex','agicommand','context','extension','priority','response','code','result','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','isUndefined','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','getLicense','voice','[LICENSE]\x20CHANNELS:\x20%s','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','connection','xml2json','lodash','syncho','util','moment','../../config/logger','agi','./rpc','./graph','./vertices','defaults','127.0.0.1','nextTick','error','stack','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','calleridname','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','toJson','mxGraphModel','root','retry','maxRetry','addVertex','omit','mxCell','hasOwnProperty'];(function(_0x31a6d4,_0x1e4034){var _0x2ddfcf=function(_0x55c8d7){while(--_0x55c8d7){_0x31a6d4['push'](_0x31a6d4['shift']());}};_0x2ddfcf(++_0x1e4034);}(_0x3c91,0xe6));var _0x13c9=function(_0xc2c1c6,_0x40e6ca){_0xc2c1c6=_0xc2c1c6-0x0;var _0xef8905=_0x3c91[_0xc2c1c6];return _0xef8905;};'use strict';var parser=require(_0x13c9('0x0'));var _=require(_0x13c9('0x1'));var syncho=require(_0x13c9('0x2'));var util=require(_0x13c9('0x3'));var moment=require(_0x13c9('0x4'));var config=require('../../config/environment');var logger=require(_0x13c9('0x5'))(_0x13c9('0x6'));var utilLicense=require('../../config/license/util');var rpc=require(_0x13c9('0x7'));var mailRpc=require('./mailRpc');var Graph=require(_0x13c9('0x8'));var Vertices=require(_0x13c9('0x9'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x13c9('0x6')]=_[_0x13c9('0xa')](config[_0x13c9('0x6')],{'ip':_0x13c9('0xb'),'port':0x11dd});function connectionHandler(_0x537e16){process[_0x13c9('0xc')](function(){syncho(function(){try{setChannelVariables(_0x537e16);agiHandler(_0x537e16);}catch(_0x4379c2){logger[_0x13c9('0xd')](_0x4379c2[_0x13c9('0xe')]);}});});}function listeningHandler(){console[_0x13c9('0xf')](_0x13c9('0x10'),config[_0x13c9('0x6')][_0x13c9('0x11')]);logger[_0x13c9('0x12')](util[_0x13c9('0x13')](_0x13c9('0x14'),config[_0x13c9('0x6')]['ip'],config[_0x13c9('0x6')][_0x13c9('0x11')]));}function errorHandler(_0x16c847){if(_0x16c847&&_0x16c847[_0x13c9('0x15')]&&_0x16c847[_0x13c9('0x16')]){logger['error'](util[_0x13c9('0x13')](_0x13c9('0x17'),_0x16c847['name'],_0x16c847[_0x13c9('0x16')]));}else{logger[_0x13c9('0xd')](util[_0x13c9('0x13')](_0x13c9('0x18'),_0x16c847[_0x13c9('0xe')]));}}function closeHandler(){logger[_0x13c9('0x12')](util[_0x13c9('0x13')](_0x13c9('0x19'),this[_0x13c9('0x1a')],this[_0x13c9('0x1b')],this[_0x13c9('0x1c')],this[_0x13c9('0x1d')],this[_0x13c9('0x1e')]));try{createSquareReport(this);}catch(_0x2dab38){logger[_0x13c9('0xd')](_0x2dab38[_0x13c9('0xe')]);}}function timeoutHandler(){logger[_0x13c9('0x12')](util[_0x13c9('0x13')](_0x13c9('0x1f'),this[_0x13c9('0x1a')],this[_0x13c9('0x1b')],this[_0x13c9('0x1c')],this[_0x13c9('0x1d')],this[_0x13c9('0x1e')]));}function hangupHandler(){logger[_0x13c9('0x12')](util[_0x13c9('0x13')](_0x13c9('0x20'),this[_0x13c9('0x1a')],this[_0x13c9('0x1b')],this[_0x13c9('0x1c')],this[_0x13c9('0x1d')],this[_0x13c9('0x1e')]));this[_0x13c9('0x21')]=!![];}function getRoot(_0x2511ff){return parser[_0x13c9('0x22')](_0x2511ff,{'object':!![]})[_0x13c9('0x23')][_0x13c9('0x24')];}function addVertex(_0x5826f9,_0x5b7077,_0x2d6b53){_0x5b7077['agicommand']=_0x2d6b53;if(_0x5b7077['hasOwnProperty'](_0x13c9('0x25'))){_0x5b7077[_0x13c9('0x26')]=parseInt(_0x5b7077['retry'],0xa);}_0x5826f9[_0x13c9('0x27')](_[_0x13c9('0x28')](_0x5b7077,_0x13c9('0x29')));}function initGraph(_0x20ec8d,_0x335a23){var _0x23a184=new Graph();for(var _0x5a3924 in _0x20ec8d){if(_0x20ec8d[_0x13c9('0x2a')](_0x5a3924)){if(_['isArray'](_0x20ec8d[_0x5a3924])){for(var _0x2da6d3=0x0;_0x2da6d3<_0x20ec8d[_0x5a3924][_0x13c9('0x2b')];_0x2da6d3+=0x1){addVertex(_0x23a184,_0x20ec8d[_0x5a3924][_0x2da6d3],_0x5a3924);}}else{addVertex(_0x23a184,_0x20ec8d[_0x5a3924],_0x5a3924);}}}for(var _0x47fed8=0x0;_0x47fed8<_0x335a23[_0x13c9('0x2b')];_0x47fed8+=0x1){if(_0x335a23[_0x47fed8][_0x13c9('0x2c')]&&_0x335a23[_0x47fed8]['target']){_0x23a184[_0x13c9('0x2d')](_0x335a23[_0x47fed8]['source'],_0x335a23[_0x47fed8][_0x13c9('0x2e')],_0x335a23[_0x47fed8][_0x13c9('0x2f')]);}}return _0x23a184;}function getSquareProject(_0x43e371,_0x2e68f1){rpc['getSquareProject'](_0x43e371)['then'](function(_0x2c9bd0){_0x2e68f1(null,_0x2c9bd0);})[_0x13c9('0x30')](function(_0x298cfe){_0x2e68f1(null,_0x298cfe);});}function createSquareReport(_0x5b09cd,_0x3027cd){rpc[_0x13c9('0x31')](_0x5b09cd)[_0x13c9('0x32')](function(_0x1cb3f4){if(_0x3027cd){_0x3027cd(null,_0x1cb3f4);}})[_0x13c9('0x30')](function(_0x3e3953){if(_0x3027cd){_0x3027cd(null,_0x3e3953);}});}function setChannelVariables(_0x406b8f){for(var _0x44b313 in _0x406b8f){if(_0x406b8f[_0x13c9('0x2a')](_0x44b313)){if(_0x44b313[_0x13c9('0x33')]('agi_')===0x0){_0x406b8f[_0x44b313[_0x13c9('0x34')](0x4)]=_0x406b8f[_0x44b313];delete _0x406b8f[_0x44b313];}}}}function getLogFromObject(_0x392e4e){return util['inspect'](_0x392e4e,{'showHidden':![],'depth':null});}function agiHandler(_0x35139c){var _0xee72a2,_0x4f8456,_0x1d9d88,_0x435f53,_0x1c8121;logger[_0x13c9('0x35')]('variables',JSON['stringify'](_0x35139c,null,0x2));logger['info'](util['format'](_0x13c9('0x36'),_0x35139c[_0x13c9('0x1a')],_0x35139c[_0x13c9('0x1b')],_0x35139c[_0x13c9('0x1c')],_0x35139c[_0x13c9('0x1d')],_0x35139c[_0x13c9('0x1e')]));_0x35139c['on'](_0x13c9('0xd'),errorHandler);_0x35139c['on'](_0x13c9('0x37'),closeHandler);_0x35139c['on']('timeout',timeoutHandler);_0x35139c['evtHangup']=![];_0x35139c['on'](_0x13c9('0x38'),hangupHandler);var _0x2d830a=getSquareProject[_0x13c9('0x39')](null,_0x35139c['arg_1']);if(_0x2d830a){if(_0x2d830a[_0x13c9('0x3a')]){_0xee72a2=getRoot(_0x2d830a['production']);if(_0xee72a2&&_0xee72a2[_0x13c9('0x3b')]){logger[_0x13c9('0x35')](_0x13c9('0x24'),JSON[_0x13c9('0x3c')](_0xee72a2,null,0x2));_0x35139c['joinAt']=moment()[_0x13c9('0x13')](_0x13c9('0x3d'));_0x4f8456=initGraph(_[_0x13c9('0x28')](_0xee72a2,_0x13c9('0x29')),_0xee72a2[_0x13c9('0x29')]);_0x1d9d88=new Vertices(_0x35139c,rpc,mailRpc);logger[_0x13c9('0x12')](util[_0x13c9('0x13')](_0x13c9('0x3e'),_0x35139c[_0x13c9('0x1a')],_0x35139c[_0x13c9('0x1b')],_0x35139c[_0x13c9('0x1c')],_0x35139c[_0x13c9('0x1d')],_0x35139c[_0x13c9('0x1e')]));_0x4f8456[_0x13c9('0x3f')](_0xee72a2[_0x13c9('0x3b')]['id'],function(_0x520d22){try{_0x520d22=_0x1d9d88[_0x13c9('0x40')](_0x520d22);logger[_0x13c9('0x35')](_0x13c9('0x41'),JSON['stringify'](_0x520d22,null,0x2));if(_0x520d22[_0x13c9('0x42')]==='gotoc'){logger[_0x13c9('0x12')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x35139c[_0x13c9('0x43')]=_0x520d22['context']||_0x35139c[_0x13c9('0x43')];_0x35139c[_0x13c9('0x44')]=_0x520d22[_0x13c9('0x44')];_0x35139c[_0x13c9('0x45')]=_0x520d22[_0x13c9('0x45')]?_0x520d22['priority']-0x1:0x1;return null;}else if(_0x520d22&&_0x1d9d88[_0x520d22[_0x13c9('0x42')]]){_0x1c8121=_0x1d9d88[_0x520d22[_0x13c9('0x42')]](_0x520d22);logger[_0x13c9('0x12')](_0x13c9('0x46'),JSON[_0x13c9('0x3c')](_0x1c8121,null,0x2));if(_0x1c8121&&_0x1c8121[_0x13c9('0x47')]===AGI_CODE_SUCCESS&&_0x1c8121[_0x13c9('0x48')]!==AGI_RESULT_ERROR&&!_0x35139c[_0x13c9('0x21')]){logger[_0x13c9('0x35')](_0x13c9('0x46'),getLogFromObject(_0x1c8121));return _['isUndefined'](_0x1c8121[_0x13c9('0x48')])?null:_0x1c8121[_0x13c9('0x48')][_0x13c9('0x49')]();}else{logger[_0x13c9('0xd')](_0x13c9('0x46'),getLogFromObject(_0x1c8121));return null;}}else{logger['error'](_0x13c9('0x4a'));return null;}}catch(_0x104a17){logger['error'](_0x104a17[_0x13c9('0xe')]);return null;}});if(_0xee72a2[_0x13c9('0x4b')]){logger['info'](util[_0x13c9('0x13')](_0x13c9('0x4c'),_0x35139c[_0x13c9('0x1a')],_0x35139c[_0x13c9('0x1b')],_0x35139c['callerid'],_0x35139c['dnid'],_0x35139c[_0x13c9('0x1e')]));_0x4f8456['traverseBFS'](_0xee72a2[_0x13c9('0x4b')]['id'],function(_0x1236ca){try{_0x1236ca=_0x1d9d88[_0x13c9('0x40')](_0x1236ca);logger['debug'](_0x13c9('0x41'),JSON[_0x13c9('0x3c')](_0x1236ca,null,0x2));if(_0x1236ca&&_0x1d9d88[_0x1236ca['agicommand']]){_0x1c8121=_0x1d9d88[_0x1236ca[_0x13c9('0x42')]](_0x1236ca);if(_0x1c8121){logger['debug']('response',getLogFromObject(_0x1c8121));return _[_0x13c9('0x4d')](_0x1c8121[_0x13c9('0x48')])?null:_0x1c8121[_0x13c9('0x48')][_0x13c9('0x49')]();}else{logger[_0x13c9('0xd')]('response',getLogFromObject(_0x1c8121));return null;}}else{logger[_0x13c9('0xd')](_0x13c9('0x4a'));return null;}}catch(_0x411cc2){logger['error'](_0x411cc2[_0x13c9('0xe')]);return null;}});}logger[_0x13c9('0x12')](util[_0x13c9('0x13')](_0x13c9('0x4e'),_0x35139c[_0x13c9('0x1a')],_0x35139c[_0x13c9('0x1b')],_0x35139c[_0x13c9('0x1c')],_0x35139c['dnid'],_0x35139c[_0x13c9('0x1e')]));logger[_0x13c9('0x12')](util[_0x13c9('0x13')](_0x13c9('0x4f'),_0x35139c[_0x13c9('0x43')],_0x35139c[_0x13c9('0x44')],parseInt(_0x35139c['priority'],0xa)+0x1));_0x35139c[_0x13c9('0x50')](_0x35139c[_0x13c9('0x43')],_0x35139c['extension'],parseInt(_0x35139c[_0x13c9('0x45')],0xa)+0x1);_0x35139c['close']();}}else{logger[_0x13c9('0xd')](util['format'](_0x13c9('0x51'),_0x35139c[_0x13c9('0x1a')]));_0x35139c['continueAt'](_0x35139c[_0x13c9('0x43')],_0x35139c[_0x13c9('0x44')],parseInt(_0x35139c[_0x13c9('0x45')],0xa)+0x1);_0x35139c[_0x13c9('0x37')]();}}else{logger[_0x13c9('0xd')](util['format'](_0x13c9('0x52'),_0x35139c[_0x13c9('0x1a')]));_0x35139c['continueAt'](_0x35139c[_0x13c9('0x43')],_0x35139c['extension'],parseInt(_0x35139c[_0x13c9('0x45')],0xa)+0x1);_0x35139c['close']();}}function main(){var _0x55fe48;return utilLicense[_0x13c9('0x53')]()[_0x13c9('0x32')](function(_0x69faf){if(_0x69faf){if(_0x69faf[_0x13c9('0x54')]){if(_0x69faf['callysquare']&&_0x69faf['callysquare']>0x0){logger['info'](util[_0x13c9('0x13')](_0x13c9('0x55'),_0x69faf['callysquare']));_0x55fe48=_0x69faf[_0x13c9('0x56')];}else{logger[_0x13c9('0x12')](_0x13c9('0x57'));}}else{logger['info'](_0x13c9('0x58'));_0x55fe48=-0x1;}}})['catch'](function(_0x1a25a0){logger['error'](_0x13c9('0x59'),_0x1a25a0[_0x13c9('0xe')]);})[_0x13c9('0x4b')](function(){var _0x58f660=require('./server')(config[_0x13c9('0x6')][_0x13c9('0x11')],config[_0x13c9('0x6')]['ip'],_0x55fe48);_0x58f660['on'](_0x13c9('0xd'),errorHandler);_0x58f660['on']('listening',listeningHandler);_0x58f660['on'](_0x13c9('0x5a'),connectionHandler);_0x58f660['on'](_0x13c9('0x37'),closeHandler);});}main(); \ No newline at end of file +var _0xfde1=['continueAt','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','./server','port','listening','connection','xml2json','syncho','moment','../../config/environment','../../config/logger','./rpc','./mailRpc','./graph','agi','defaults','nextTick','error','stack','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[%s]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','callerid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','toJson','root','hasOwnProperty','retry','maxRetry','addVertex','omit','isArray','source','addEdge','target','value','catch','createSquareReport','then','indexOf','agi_','substring','debug','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','production','joinAt','YYYY-MM-DD\x20HH:mm:ss','traverseBFS','start','clear','agicommand','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','code','response','isUndefined','result','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[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'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfde1,0xb8));var _0x1fde=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xfde1[_0x20a584];return _0x4b41a8;};'use strict';var parser=require(_0x1fde('0x0'));var _=require('lodash');var syncho=require(_0x1fde('0x1'));var util=require('util');var moment=require(_0x1fde('0x2'));var config=require(_0x1fde('0x3'));var logger=require(_0x1fde('0x4'))('agi');var utilLicense=require('../../config/license/util');var rpc=require(_0x1fde('0x5'));var mailRpc=require(_0x1fde('0x6'));var Graph=require(_0x1fde('0x7'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x1fde('0x8')]=_[_0x1fde('0x9')](config[_0x1fde('0x8')],{'ip':'127.0.0.1','port':0x11dd});function connectionHandler(_0x58fed3){process[_0x1fde('0xa')](function(){syncho(function(){try{setChannelVariables(_0x58fed3);agiHandler(_0x58fed3);}catch(_0x2bcfc9){logger[_0x1fde('0xb')](_0x2bcfc9[_0x1fde('0xc')]);}});});}function listeningHandler(){console['log'](_0x1fde('0xd'),config[_0x1fde('0x8')]['port']);logger[_0x1fde('0xe')](util[_0x1fde('0xf')](_0x1fde('0x10'),config['agi']['ip'],config[_0x1fde('0x8')]['port']));}function errorHandler(_0x7acea3){if(_0x7acea3&&_0x7acea3[_0x1fde('0x11')]&&_0x7acea3[_0x1fde('0x12')]){logger[_0x1fde('0xb')](util[_0x1fde('0xf')](_0x1fde('0x13'),_0x7acea3[_0x1fde('0x11')],_0x7acea3[_0x1fde('0x12')]));}else{logger[_0x1fde('0xb')](util['format']('[ERROR]\x20%s',_0x7acea3[_0x1fde('0xc')]));}}function closeHandler(){logger[_0x1fde('0xe')](util[_0x1fde('0xf')](_0x1fde('0x14'),this['arg_1'],this[_0x1fde('0x15')],this['callerid'],this[_0x1fde('0x16')],this[_0x1fde('0x17')]));try{createSquareReport(this);}catch(_0x3f96fe){logger['error'](_0x3f96fe[_0x1fde('0xc')]);}}function timeoutHandler(){logger[_0x1fde('0xe')](util[_0x1fde('0xf')](_0x1fde('0x18'),this[_0x1fde('0x19')],this[_0x1fde('0x15')],this[_0x1fde('0x1a')],this[_0x1fde('0x16')],this[_0x1fde('0x17')]));}function hangupHandler(){logger[_0x1fde('0xe')](util[_0x1fde('0xf')](_0x1fde('0x1b'),this['arg_1'],this[_0x1fde('0x15')],this[_0x1fde('0x1a')],this['dnid'],this[_0x1fde('0x17')]));this[_0x1fde('0x1c')]=!![];}function getRoot(_0x298be2){return parser[_0x1fde('0x1d')](_0x298be2,{'object':!![]})['mxGraphModel'][_0x1fde('0x1e')];}function addVertex(_0x43cb61,_0x12d328,_0x409ade){_0x12d328['agicommand']=_0x409ade;if(_0x12d328[_0x1fde('0x1f')](_0x1fde('0x20'))){_0x12d328[_0x1fde('0x21')]=parseInt(_0x12d328[_0x1fde('0x20')],0xa);}_0x43cb61[_0x1fde('0x22')](_[_0x1fde('0x23')](_0x12d328,'mxCell'));}function initGraph(_0x3baf0b,_0x12debf){var _0x180211=new Graph();for(var _0x14641e in _0x3baf0b){if(_0x3baf0b[_0x1fde('0x1f')](_0x14641e)){if(_[_0x1fde('0x24')](_0x3baf0b[_0x14641e])){for(var _0x1749e7=0x0;_0x1749e7<_0x3baf0b[_0x14641e]['length'];_0x1749e7+=0x1){addVertex(_0x180211,_0x3baf0b[_0x14641e][_0x1749e7],_0x14641e);}}else{addVertex(_0x180211,_0x3baf0b[_0x14641e],_0x14641e);}}}for(var _0x3e4295=0x0;_0x3e4295<_0x12debf['length'];_0x3e4295+=0x1){if(_0x12debf[_0x3e4295][_0x1fde('0x25')]&&_0x12debf[_0x3e4295]['target']){_0x180211[_0x1fde('0x26')](_0x12debf[_0x3e4295]['source'],_0x12debf[_0x3e4295][_0x1fde('0x27')],_0x12debf[_0x3e4295][_0x1fde('0x28')]);}}return _0x180211;}function getSquareProject(_0xf4b655,_0x318ec2){rpc['getSquareProject'](_0xf4b655)['then'](function(_0x666102){_0x318ec2(null,_0x666102);})[_0x1fde('0x29')](function(_0x25f89f){_0x318ec2(null,_0x25f89f);});}function createSquareReport(_0x5ea0f1,_0x1f31ac){rpc[_0x1fde('0x2a')](_0x5ea0f1)[_0x1fde('0x2b')](function(_0x5dd9d0){if(_0x1f31ac){_0x1f31ac(null,_0x5dd9d0);}})[_0x1fde('0x29')](function(_0x49160c){if(_0x1f31ac){_0x1f31ac(null,_0x49160c);}});}function setChannelVariables(_0x229780){for(var _0x509b87 in _0x229780){if(_0x229780['hasOwnProperty'](_0x509b87)){if(_0x509b87[_0x1fde('0x2c')](_0x1fde('0x2d'))===0x0){_0x229780[_0x509b87[_0x1fde('0x2e')](0x4)]=_0x229780[_0x509b87];delete _0x229780[_0x509b87];}}}}function getLogFromObject(_0xfbfe1b){return util['inspect'](_0xfbfe1b,{'showHidden':![],'depth':null});}function agiHandler(_0x22bbcc){var _0x6613,_0x5c28fc,_0x2651cb,_0x15b00f,_0x20d197;logger[_0x1fde('0x2f')]('variables',JSON[_0x1fde('0x30')](_0x22bbcc,null,0x2));logger['info'](util['format'](_0x1fde('0x31'),_0x22bbcc['arg_1'],_0x22bbcc[_0x1fde('0x15')],_0x22bbcc['callerid'],_0x22bbcc[_0x1fde('0x16')],_0x22bbcc[_0x1fde('0x17')]));_0x22bbcc['on'](_0x1fde('0xb'),errorHandler);_0x22bbcc['on'](_0x1fde('0x32'),closeHandler);_0x22bbcc['on'](_0x1fde('0x33'),timeoutHandler);_0x22bbcc[_0x1fde('0x1c')]=![];_0x22bbcc['on']('hangup',hangupHandler);var _0x3caa56=getSquareProject['sync'](null,_0x22bbcc[_0x1fde('0x19')]);if(_0x3caa56){if(_0x3caa56[_0x1fde('0x34')]){_0x6613=getRoot(_0x3caa56[_0x1fde('0x34')]);if(_0x6613&&_0x6613['start']){logger[_0x1fde('0x2f')](_0x1fde('0x1e'),JSON['stringify'](_0x6613,null,0x2));_0x22bbcc[_0x1fde('0x35')]=moment()[_0x1fde('0xf')](_0x1fde('0x36'));_0x5c28fc=initGraph(_['omit'](_0x6613,'mxCell'),_0x6613['mxCell']);_0x2651cb=new Vertices(_0x22bbcc,rpc,mailRpc);logger[_0x1fde('0xe')](util[_0x1fde('0xf')]('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x22bbcc[_0x1fde('0x19')],_0x22bbcc['calleridname'],_0x22bbcc[_0x1fde('0x1a')],_0x22bbcc['dnid'],_0x22bbcc[_0x1fde('0x17')]));_0x5c28fc[_0x1fde('0x37')](_0x6613[_0x1fde('0x38')]['id'],function(_0x3355f0){try{_0x3355f0=_0x2651cb[_0x1fde('0x39')](_0x3355f0);logger[_0x1fde('0x2f')]('vertex',JSON[_0x1fde('0x30')](_0x3355f0,null,0x2));if(_0x3355f0[_0x1fde('0x3a')]===_0x1fde('0x3b')){logger[_0x1fde('0xe')](_0x1fde('0x3c'));_0x22bbcc[_0x1fde('0x3d')]=_0x3355f0[_0x1fde('0x3d')]||_0x22bbcc[_0x1fde('0x3d')];_0x22bbcc[_0x1fde('0x3e')]=_0x3355f0['extension'];_0x22bbcc[_0x1fde('0x3f')]=_0x3355f0[_0x1fde('0x3f')]?_0x3355f0[_0x1fde('0x3f')]-0x1:0x1;return null;}else if(_0x3355f0&&_0x2651cb[_0x3355f0[_0x1fde('0x3a')]]){_0x20d197=_0x2651cb[_0x3355f0[_0x1fde('0x3a')]](_0x3355f0);logger['info']('response',JSON[_0x1fde('0x30')](_0x20d197,null,0x2));if(_0x20d197&&_0x20d197[_0x1fde('0x40')]===AGI_CODE_SUCCESS&&_0x20d197['result']!==AGI_RESULT_ERROR&&!_0x22bbcc['evtHangup']){logger[_0x1fde('0x2f')](_0x1fde('0x41'),getLogFromObject(_0x20d197));return _[_0x1fde('0x42')](_0x20d197[_0x1fde('0x43')])?null:_0x20d197[_0x1fde('0x43')][_0x1fde('0x44')]();}else{logger[_0x1fde('0xb')](_0x1fde('0x41'),getLogFromObject(_0x20d197));return null;}}else{logger[_0x1fde('0xb')](_0x1fde('0x45'));return null;}}catch(_0x2f8aed){logger[_0x1fde('0xb')](_0x2f8aed[_0x1fde('0xc')]);return null;}});if(_0x6613[_0x1fde('0x46')]){logger['info'](util[_0x1fde('0xf')](_0x1fde('0x47'),_0x22bbcc[_0x1fde('0x19')],_0x22bbcc[_0x1fde('0x15')],_0x22bbcc['callerid'],_0x22bbcc['dnid'],_0x22bbcc[_0x1fde('0x17')]));_0x5c28fc['traverseBFS'](_0x6613['finally']['id'],function(_0x35fe70){try{_0x35fe70=_0x2651cb[_0x1fde('0x39')](_0x35fe70);logger['debug']('vertex',JSON[_0x1fde('0x30')](_0x35fe70,null,0x2));if(_0x35fe70&&_0x2651cb[_0x35fe70[_0x1fde('0x3a')]]){_0x20d197=_0x2651cb[_0x35fe70[_0x1fde('0x3a')]](_0x35fe70);if(_0x20d197){logger[_0x1fde('0x2f')](_0x1fde('0x41'),getLogFromObject(_0x20d197));return _[_0x1fde('0x42')](_0x20d197['result'])?null:_0x20d197[_0x1fde('0x43')][_0x1fde('0x44')]();}else{logger[_0x1fde('0xb')](_0x1fde('0x41'),getLogFromObject(_0x20d197));return null;}}else{logger[_0x1fde('0xb')](_0x1fde('0x45'));return null;}}catch(_0x3403c4){logger[_0x1fde('0xb')](_0x3403c4[_0x1fde('0xc')]);return null;}});}logger[_0x1fde('0xe')](util[_0x1fde('0xf')](_0x1fde('0x48'),_0x22bbcc[_0x1fde('0x19')],_0x22bbcc[_0x1fde('0x15')],_0x22bbcc[_0x1fde('0x1a')],_0x22bbcc[_0x1fde('0x16')],_0x22bbcc[_0x1fde('0x17')]));logger[_0x1fde('0xe')](util['format'](_0x1fde('0x49'),_0x22bbcc[_0x1fde('0x3d')],_0x22bbcc[_0x1fde('0x3e')],parseInt(_0x22bbcc[_0x1fde('0x3f')],0xa)+0x1));_0x22bbcc[_0x1fde('0x4a')](_0x22bbcc[_0x1fde('0x3d')],_0x22bbcc[_0x1fde('0x3e')],parseInt(_0x22bbcc[_0x1fde('0x3f')],0xa)+0x1);_0x22bbcc['close']();}}else{logger['error'](util['format'](_0x1fde('0x4b'),_0x22bbcc[_0x1fde('0x19')]));_0x22bbcc['continueAt'](_0x22bbcc[_0x1fde('0x3d')],_0x22bbcc[_0x1fde('0x3e')],parseInt(_0x22bbcc[_0x1fde('0x3f')],0xa)+0x1);_0x22bbcc['close']();}}else{logger[_0x1fde('0xb')](util['format'](_0x1fde('0x4c'),_0x22bbcc['arg_1']));_0x22bbcc[_0x1fde('0x4a')](_0x22bbcc[_0x1fde('0x3d')],_0x22bbcc['extension'],parseInt(_0x22bbcc[_0x1fde('0x3f')],0xa)+0x1);_0x22bbcc[_0x1fde('0x32')]();}}function main(){var _0x37a3db;return utilLicense[_0x1fde('0x4d')]()['then'](function(_0x43058c){if(_0x43058c){if(_0x43058c[_0x1fde('0x4e')]){if(_0x43058c[_0x1fde('0x4f')]&&_0x43058c[_0x1fde('0x4f')]>0x0){logger['info'](util[_0x1fde('0xf')]('[LICENSE]\x20CHANNELS:\x20%s',_0x43058c[_0x1fde('0x4f')]));_0x37a3db=_0x43058c['callysquare'];}else{logger['info'](_0x1fde('0x50'));}}else{logger[_0x1fde('0xe')](_0x1fde('0x51'));_0x37a3db=-0x1;}}})[_0x1fde('0x29')](function(_0x3e1d34){logger['error']('[LICENSE]',_0x3e1d34[_0x1fde('0xc')]);})[_0x1fde('0x46')](function(){var _0x4796f9=require(_0x1fde('0x52'))(config[_0x1fde('0x8')][_0x1fde('0x53')],config[_0x1fde('0x8')]['ip'],_0x37a3db);_0x4796f9['on'](_0x1fde('0xb'),errorHandler);_0x4796f9['on'](_0x1fde('0x54'),listeningHandler);_0x4796f9['on'](_0x1fde('0x55'),connectionHandler);_0x4796f9['on'](_0x1fde('0x32'),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 a215892..18e4d1a 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 _0x3206=['error','result','catch','sendMailMessage','SendMail','jayson/promise','client','http','request','then'];(function(_0x119be1,_0x214849){var _0x3b9571=function(_0x103832){while(--_0x103832){_0x119be1['push'](_0x119be1['shift']());}};_0x3b9571(++_0x214849);}(_0x3206,0x14f));var _0x6320=function(_0x4f1789,_0x37fda7){_0x4f1789=_0x4f1789-0x0;var _0x5bb8fe=_0x3206[_0x4f1789];return _0x5bb8fe;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x6320('0x0'));var client=jayson[_0x6320('0x1')][_0x6320('0x2')]({'port':0x232b});function request(_0x5e8ffa,_0x58fc84){return new BPromise(function(_0xe56ec4,_0x1540ea){return client[_0x6320('0x3')](_0x5e8ffa,_0x58fc84)[_0x6320('0x4')](function(_0x10667f){if(_0x10667f['error']){return _0x1540ea(_0x10667f[_0x6320('0x5')]['message']);}else{return _0xe56ec4(_0x10667f[_0x6320('0x6')]);}})[_0x6320('0x7')](function(_0x358014){return _0x1540ea(_0x358014);});});}exports[_0x6320('0x8')]=function(_0x16bdd8,_0x24036e){return request(_0x6320('0x9'),{'account':_0x16bdd8,'message':_0x24036e});}; \ No newline at end of file +var _0x10f8=['message','result','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','then','error'];(function(_0x5d5aa0,_0x3fedd9){var _0x5b0b1d=function(_0x3ca563){while(--_0x3ca563){_0x5d5aa0['push'](_0x5d5aa0['shift']());}};_0x5b0b1d(++_0x3fedd9);}(_0x10f8,0x16f));var _0x810f=function(_0x8935ce,_0x3621c3){_0x8935ce=_0x8935ce-0x0;var _0x1a422f=_0x10f8[_0x8935ce];return _0x1a422f;};'use strict';var BPromise=require(_0x810f('0x0'));var jayson=require(_0x810f('0x1'));var client=jayson[_0x810f('0x2')][_0x810f('0x3')]({'port':0x232b});function request(_0x18946d,_0x37910b){return new BPromise(function(_0x15d483,_0x1af3a9){return client[_0x810f('0x4')](_0x18946d,_0x37910b)[_0x810f('0x5')](function(_0x528aee){if(_0x528aee[_0x810f('0x6')]){return _0x1af3a9(_0x528aee['error'][_0x810f('0x7')]);}else{return _0x15d483(_0x528aee[_0x810f('0x8')]);}})['catch'](function(_0x3cc417){return _0x1af3a9(_0x3cc417);});});}exports[_0x810f('0x9')]=function(_0x3d674a,_0x596823){return request(_0x810f('0xa'),{'account':_0x3d674a,'message':_0x596823});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index cc0dfc5..c61e854 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 _0xb770=['slice','trim','headers','line','length','exports','stream','Transform','call','_localBuffer','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','indexOf','substring'];(function(_0x7ee046,_0x248eb5){var _0x512015=function(_0x523480){while(--_0x523480){_0x7ee046['push'](_0x7ee046['shift']());}};_0x512015(++_0x248eb5);}(_0xb770,0x1e2));var _0x0b77=function(_0x5980e4,_0x44ec9c){_0x5980e4=_0x5980e4-0x0;var _0x429716=_0xb770[_0x5980e4];return _0x429716;};'use strict';var util=require('util');var Transform=require(_0x0b77('0x0'))[_0x0b77('0x1')];function AGIReply(_0x15d5c1){Transform[_0x0b77('0x2')](this,_0x15d5c1);this[_0x0b77('0x3')]='';this[_0x0b77('0x4')]=![];}util[_0x0b77('0x5')](AGIReply,Transform);AGIReply[_0x0b77('0x6')][_0x0b77('0x7')]=function(_0x8076e9,_0x46703e,_0xd3465c){var _0x104ab1='\x0a',_0x55e9b6=['\x0a\x0a',_0x0b77('0x8')],_0x176698=-0x1,_0x5bed15=-0x1,_0x1b802a='',_0x32ff80=0x0,_0x548d06='',_0x39f25e='';this['_localBuffer']+=_0x8076e9['toString']();_0x548d06=this[_0x0b77('0x3')];if(!this[_0x0b77('0x4')]){_0x32ff80=0x0;while(_0x55e9b6[_0x32ff80]){while((_0x5bed15=_0x548d06[_0x0b77('0x9')](_0x55e9b6[_0x32ff80]))!=-0x1){_0x1b802a=_0x55e9b6[_0x32ff80];_0x39f25e=_0x548d06[_0x0b77('0xa')](0x0,_0x5bed15);_0x548d06=_0x548d06['substring'](_0x5bed15+_0x1b802a['length']);var _0x563c56=_0x39f25e['split'](_0x104ab1),_0x4e96bc=0x0,_0x2d2fe2={},_0x420085='',_0x42e088='',_0xfae9a6=-0x1;while(_0x563c56[_0x4e96bc]){_0xfae9a6=_0x563c56[_0x4e96bc][_0x0b77('0x9')](':');if(_0xfae9a6!=-0x1){_0x420085=_0x563c56[_0x4e96bc][_0x0b77('0xb')](0x0,_0xfae9a6)[_0x0b77('0xc')]();_0x42e088=_0x563c56[_0x4e96bc][_0x0b77('0xb')](_0xfae9a6+0x1)['trim']();if(_0x420085['length']>0x0){_0x2d2fe2[_0x420085]=_0x42e088;}}else{}_0x4e96bc++;}this['emit'](_0x0b77('0xd'),_0x2d2fe2);this['_inBody']=!![];}_0x32ff80++;}this[_0x0b77('0x3')]=_0x548d06;}else{while((_0x176698=_0x548d06[_0x0b77('0x9')](_0x104ab1))!=-0x1){_0x39f25e=_0x548d06[_0x0b77('0xa')](0x0,_0x176698);this['emit'](_0x0b77('0xe'),_0x39f25e);_0x548d06=_0x548d06[_0x0b77('0xa')](_0x176698+_0x104ab1[_0x0b77('0xf')]);}this[_0x0b77('0x3')]=_0x548d06;}_0xd3465c();};module[_0x0b77('0x10')]=AGIReply; \ No newline at end of file +var _0x32e5=['indexOf','substring','length','trim','slice','headers','emit','line','exports','util','stream','Transform','call','_localBuffer','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','toString'];(function(_0x1cfee9,_0x2f5b9e){var _0x5b3339=function(_0x36240c){while(--_0x36240c){_0x1cfee9['push'](_0x1cfee9['shift']());}};_0x5b3339(++_0x2f5b9e);}(_0x32e5,0x149));var _0x532e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x32e5[_0x6c993a];return _0x27f547;};'use strict';var util=require(_0x532e('0x0'));var Transform=require(_0x532e('0x1'))[_0x532e('0x2')];function AGIReply(_0x571aab){Transform[_0x532e('0x3')](this,_0x571aab);this[_0x532e('0x4')]='';this[_0x532e('0x5')]=![];}util[_0x532e('0x6')](AGIReply,Transform);AGIReply[_0x532e('0x7')][_0x532e('0x8')]=function(_0x347fa2,_0x57af08,_0xedaa3f){var _0x493936='\x0a',_0x4e3a5c=['\x0a\x0a',_0x532e('0x9')],_0x43cb4d=-0x1,_0x182b56=-0x1,_0x485312='',_0x55778e=0x0,_0x4081ea='',_0x325d45='';this[_0x532e('0x4')]+=_0x347fa2[_0x532e('0xa')]();_0x4081ea=this[_0x532e('0x4')];if(!this[_0x532e('0x5')]){_0x55778e=0x0;while(_0x4e3a5c[_0x55778e]){while((_0x182b56=_0x4081ea[_0x532e('0xb')](_0x4e3a5c[_0x55778e]))!=-0x1){_0x485312=_0x4e3a5c[_0x55778e];_0x325d45=_0x4081ea['substring'](0x0,_0x182b56);_0x4081ea=_0x4081ea[_0x532e('0xc')](_0x182b56+_0x485312[_0x532e('0xd')]);var _0x279351=_0x325d45['split'](_0x493936),_0x10bd5a=0x0,_0x454e39={},_0x203cec='',_0xf2f995='',_0x5be43b=-0x1;while(_0x279351[_0x10bd5a]){_0x5be43b=_0x279351[_0x10bd5a][_0x532e('0xb')](':');if(_0x5be43b!=-0x1){_0x203cec=_0x279351[_0x10bd5a]['slice'](0x0,_0x5be43b)[_0x532e('0xe')]();_0xf2f995=_0x279351[_0x10bd5a][_0x532e('0xf')](_0x5be43b+0x1)[_0x532e('0xe')]();if(_0x203cec[_0x532e('0xd')]>0x0){_0x454e39[_0x203cec]=_0xf2f995;}}else{}_0x10bd5a++;}this['emit'](_0x532e('0x10'),_0x454e39);this[_0x532e('0x5')]=!![];}_0x55778e++;}this[_0x532e('0x4')]=_0x4081ea;}else{while((_0x43cb4d=_0x4081ea[_0x532e('0xb')](_0x493936))!=-0x1){_0x325d45=_0x4081ea[_0x532e('0xc')](0x0,_0x43cb4d);this[_0x532e('0x11')](_0x532e('0x12'),_0x325d45);_0x4081ea=_0x4081ea[_0x532e('0xc')](_0x43cb4d+_0x493936[_0x532e('0xd')]);}this['_localBuffer']=_0x4081ea;}_0xedaa3f();};module[_0x532e('0x13')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 5905b65..cb8fb78 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 _0x6751=['getTrunkById','getSoundById','ShowSound','ShowInterval','Interval','Intervals','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createCmContact','ShowCmHopper','phone','then','CreateCmContact','getPauseById','ShowPause','LoginUser','agentPause','PauseUser','agentUnpause','agentLogout','LogoutUser','bluebird','moment','lodash','client','http','error','result','catch','getSquareProject','ShowSquareProject','production','ShowMailAccount','Smtp','name','getVoiceQueueById','ShowVoiceQueue','getVariableById','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0x6751,0x15d));var _0x1675=function(_0x2ddd52,_0x4e3b17){_0x2ddd52=_0x2ddd52-0x0;var _0x4bb4ec=_0x6751[_0x2ddd52];return _0x4bb4ec;};'use strict';var BPromise=require(_0x1675('0x0'));var moment=require(_0x1675('0x1'));var _=require(_0x1675('0x2'));var util=require('util');var jayson=require('jayson/promise');var client=jayson[_0x1675('0x3')][_0x1675('0x4')]({'port':0x2329});function request(_0x576c27,_0x55e917){return new BPromise(function(_0x425bcd,_0xd901f4){return client['request'](_0x576c27,_0x55e917)['then'](function(_0x3e8605){if(_0x3e8605[_0x1675('0x5')]){return _0xd901f4(_0x3e8605[_0x1675('0x5')]['message']);}else{return _0x425bcd(_0x3e8605[_0x1675('0x6')]);}})[_0x1675('0x7')](function(_0x1a1d91){return _0xd901f4(_0x1a1d91);});});}exports[_0x1675('0x8')]=function(_0x120ef0){return request(_0x1675('0x9'),{'options':{'raw':![],'where':{'name':_0x120ef0},'attributes':[_0x1675('0xa')]}});};exports['getMailAccountById']=function(_0x244ee2){return request(_0x1675('0xb'),{'options':{'raw':![],'where':{'id':_0x244ee2},'include':[{'model':'MailServerOut','as':_0x1675('0xc')}],'attributes':['id','name','email']}});};exports['getSquareProjectById']=function(_0x34d185){return request(_0x1675('0x9'),{'options':{'where':{'id':_0x34d185},'attributes':[_0x1675('0xd')]}});};exports[_0x1675('0xe')]=function(_0x4e2a64){return request(_0x1675('0xf'),{'options':{'where':{'id':_0x4e2a64},'attributes':[_0x1675('0xd')]}});};exports[_0x1675('0x10')]=function(_0x76bf6e){return request('ShowVariable',{'options':{'where':{'id':_0x76bf6e},'attributes':[_0x1675('0xd')]}});};exports[_0x1675('0x11')]=function(_0x5af1b4){return request(_0x1675('0x12'),{'options':{'where':{'id':_0x5af1b4},'attributes':[_0x1675('0x13')]}});};exports[_0x1675('0x14')]=function(_0x1359e6){return request(_0x1675('0x15'),{'options':{'where':{'id':_0x1359e6},'attributes':[_0x1675('0xd')]}});};exports[_0x1675('0x16')]=function(_0x437f33){return request('ShowTrunk',{'options':{'where':{'id':_0x437f33},'attributes':['name']}});};exports[_0x1675('0x17')]=function(_0x32c63c){return request(_0x1675('0x18'),{'options':{'where':{'id':_0x32c63c},'attributes':['save_name']}});};exports['getIntervalById']=function(_0x45a92d){return request(_0x1675('0x19'),{'options':{'raw':![],'where':{'id':_0x45a92d},'include':[{'model':_0x1675('0x1a'),'as':_0x1675('0x1b')}]}});};exports['getSmsAccountById']=function(_0x531909){return request(_0x1675('0x1c'),{'options':{'where':{'id':_0x531909},'attributes':['id',_0x1675('0xd')]}});};exports[_0x1675('0x1d')]=function(_0x4d17cd){return request(_0x1675('0x1e'),{'body':_0x4d17cd});};exports[_0x1675('0x1f')]=function(_0x3617ed){return request('CreateSquareDetailsReport',{'body':_0x3617ed});};exports[_0x1675('0x20')]=function(_0xcc8455){return request(_0x1675('0x21'),{'body':_[_0x1675('0x22')](_0xcc8455,{'project_name':_0xcc8455[_0x1675('0x23')],'prev_project_name':_0xcc8455[_0x1675('0x24')]||'','is_subproject':_0xcc8455[_0x1675('0x24')]?!![]:![],'leaveAt':moment()['format'](_0x1675('0x25'))})});};exports[_0x1675('0x26')]=function(_0x2beddd){return request(_0x1675('0x27'),{'body':_0x2beddd});};exports['createSquareMessage']=function(_0x34d395){return request('CreateSquareMessage',{'body':_0x34d395});};exports[_0x1675('0x28')]=function(_0x49a475){return request(_0x1675('0x29'),{'options':{'raw':![],'where':{'phone':_0x49a475[_0x1675('0x2a')],'ListId':_0x49a475['ListId']}}})[_0x1675('0x2b')](function(_0x18d8aa){if(_0x18d8aa){return _0x18d8aa;}return request(_0x1675('0x2c'),{'body':_0x49a475});});};exports[_0x1675('0x2d')]=function(_0xec2a0e){return request(_0x1675('0x2e'),{'options':{'where':{'id':_0xec2a0e},'attributes':['name']}});};exports['agentLogin']=function(_0x4bee4d,_0x5531f7){return request(_0x1675('0x2f'),{'body':{'interface':_0x5531f7},'options':{'where':_0x4bee4d}});};exports[_0x1675('0x30')]=function(_0xff3ea0,_0x38632a,_0x3e6c87){return request(_0x1675('0x31'),{'body':{'type':_0x38632a,'uniqueid':_0x3e6c87},'options':{'where':_0xff3ea0}});};exports[_0x1675('0x32')]=function(_0x40a227){return request('UnpauseUser',{'body':{},'options':{'where':_0x40a227}});};exports[_0x1675('0x33')]=function(_0x1c11af){return request(_0x1675('0x34'),{'body':{},'options':{'where':_0x1c11af}});}; \ No newline at end of file +var _0x552a=['dsn','getUserById','ShowUser','getTrunkById','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Interval','getSmsAccountById','ShowSmsAccount','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','CreateSquareRecording','createSquareMessage','createCmContact','ShowCmHopper','phone','ListId','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','bluebird','moment','lodash','util','jayson/promise','http','request','then','error','result','getSquareProject','ShowSquareProject','production','getMailAccountById','ShowMailAccount','Smtp','name','email','getSquareProjectById','getVoiceQueueById'];(function(_0x41aaa7,_0x3d81a7){var _0x3c31ca=function(_0x5d2a48){while(--_0x5d2a48){_0x41aaa7['push'](_0x41aaa7['shift']());}};_0x3c31ca(++_0x3d81a7);}(_0x552a,0x17b));var _0xa552=function(_0x169636,_0x1e432d){_0x169636=_0x169636-0x0;var _0x5f3fad=_0x552a[_0x169636];return _0x5f3fad;};'use strict';var BPromise=require(_0xa552('0x0'));var moment=require(_0xa552('0x1'));var _=require(_0xa552('0x2'));var util=require(_0xa552('0x3'));var jayson=require(_0xa552('0x4'));var client=jayson['client'][_0xa552('0x5')]({'port':0x2329});function request(_0x513c5e,_0x39c38f){return new BPromise(function(_0x4efb59,_0x3ea7f1){return client[_0xa552('0x6')](_0x513c5e,_0x39c38f)[_0xa552('0x7')](function(_0x1fbaa8){if(_0x1fbaa8[_0xa552('0x8')]){return _0x3ea7f1(_0x1fbaa8[_0xa552('0x8')]['message']);}else{return _0x4efb59(_0x1fbaa8[_0xa552('0x9')]);}})['catch'](function(_0x106112){return _0x3ea7f1(_0x106112);});});}exports[_0xa552('0xa')]=function(_0x5aca16){return request(_0xa552('0xb'),{'options':{'raw':![],'where':{'name':_0x5aca16},'attributes':[_0xa552('0xc')]}});};exports[_0xa552('0xd')]=function(_0x3f4b0e){return request(_0xa552('0xe'),{'options':{'raw':![],'where':{'id':_0x3f4b0e},'include':[{'model':'MailServerOut','as':_0xa552('0xf')}],'attributes':['id',_0xa552('0x10'),_0xa552('0x11')]}});};exports[_0xa552('0x12')]=function(_0x16cb4e){return request(_0xa552('0xb'),{'options':{'where':{'id':_0x16cb4e},'attributes':[_0xa552('0x10')]}});};exports[_0xa552('0x13')]=function(_0x3cecd5){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x3cecd5},'attributes':[_0xa552('0x10')]}});};exports['getVariableById']=function(_0x4fb94f){return request('ShowVariable',{'options':{'where':{'id':_0x4fb94f},'attributes':['name']}});};exports['getSquareOdbcById']=function(_0x1cc31f){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x1cc31f},'attributes':[_0xa552('0x14')]}});};exports[_0xa552('0x15')]=function(_0x3e1a96){return request(_0xa552('0x16'),{'options':{'where':{'id':_0x3e1a96},'attributes':[_0xa552('0x10')]}});};exports[_0xa552('0x17')]=function(_0x306545){return request('ShowTrunk',{'options':{'where':{'id':_0x306545},'attributes':[_0xa552('0x10')]}});};exports[_0xa552('0x18')]=function(_0x3812db){return request(_0xa552('0x19'),{'options':{'where':{'id':_0x3812db},'attributes':[_0xa552('0x1a')]}});};exports[_0xa552('0x1b')]=function(_0x3fa49d){return request(_0xa552('0x1c'),{'options':{'raw':![],'where':{'id':_0x3fa49d},'include':[{'model':_0xa552('0x1d'),'as':'Intervals'}]}});};exports[_0xa552('0x1e')]=function(_0x45d4b0){return request(_0xa552('0x1f'),{'options':{'where':{'id':_0x45d4b0},'attributes':['id',_0xa552('0x10')]}});};exports['createSmsMessage']=function(_0x4855fb){return request(_0xa552('0x20'),{'body':_0x4855fb});};exports[_0xa552('0x21')]=function(_0x386490){return request(_0xa552('0x22'),{'body':_0x386490});};exports[_0xa552('0x23')]=function(_0x2d9821){return request(_0xa552('0x24'),{'body':_[_0xa552('0x25')](_0x2d9821,{'project_name':_0x2d9821['arg_1'],'prev_project_name':_0x2d9821[_0xa552('0x26')]||'','is_subproject':_0x2d9821[_0xa552('0x26')]?!![]:![],'leaveAt':moment()[_0xa552('0x27')](_0xa552('0x28'))})});};exports['createSquareRecording']=function(_0x398111){return request(_0xa552('0x29'),{'body':_0x398111});};exports[_0xa552('0x2a')]=function(_0xf2b53a){return request('CreateSquareMessage',{'body':_0xf2b53a});};exports[_0xa552('0x2b')]=function(_0x32be6d){return request(_0xa552('0x2c'),{'options':{'raw':![],'where':{'phone':_0x32be6d[_0xa552('0x2d')],'ListId':_0x32be6d[_0xa552('0x2e')]}}})['then'](function(_0x119aa7){if(_0x119aa7){return _0x119aa7;}return request(_0xa552('0x2f'),{'body':_0x32be6d});});};exports[_0xa552('0x30')]=function(_0x572346){return request(_0xa552('0x31'),{'options':{'where':{'id':_0x572346},'attributes':[_0xa552('0x10')]}});};exports[_0xa552('0x32')]=function(_0x396475,_0x1f224b){return request(_0xa552('0x33'),{'body':{'interface':_0x1f224b},'options':{'where':_0x396475}});};exports[_0xa552('0x34')]=function(_0x17cdca,_0x5ba83c,_0x3e294a){return request(_0xa552('0x35'),{'body':{'type':_0x5ba83c,'uniqueid':_0x3e294a},'options':{'where':_0x17cdca}});};exports[_0xa552('0x36')]=function(_0xb5e633){return request(_0xa552('0x37'),{'body':{},'options':{'where':_0xb5e633}});};exports[_0xa552('0x38')]=function(_0x24f4d0){return request('LogoutUser',{'body':{},'options':{'where':_0x24f4d0}});}; \ 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 87d21df..16e6ce0 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 _0xb934=['./lex','exports','./polly'];(function(_0x32ab32,_0x440a44){var _0x527816=function(_0x559392){while(--_0x559392){_0x32ab32['push'](_0x32ab32['shift']());}};_0x527816(++_0x440a44);}(_0xb934,0x92));var _0x4b93=function(_0x5141dc,_0x5f271a){_0x5141dc=_0x5141dc-0x0;var _0x396104=_0xb934[_0x5141dc];return _0x396104;};var polly=require(_0x4b93('0x0'));var lex=require(_0x4b93('0x1'));module[_0x4b93('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0xc677=['./lex','exports'];(function(_0x5bf420,_0x2d068d){var _0x1c5255=function(_0x4964a2){while(--_0x4964a2){_0x5bf420['push'](_0x5bf420['shift']());}};_0x1c5255(++_0x2d068d);}(_0xc677,0x16c));var _0x7c67=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xc677[_0x122ef9];return _0x42fba0;};var polly=require('./polly');var lex=require(_0x7c67('0x0'));module[_0x7c67('0x1')]={'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 7fb3462..4e3e19a 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 _0x6324=['./lib/api','exports'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x6324,0x142));var _0x4632=function(_0x3b5587,_0x22a6f4){_0x3b5587=_0x3b5587-0x0;var _0x3fbb62=_0x6324[_0x3b5587];return _0x3fbb62;};'use strict';var lex=require(_0x4632('0x0'));module[_0x4632('0x1')]=function(_0xb0927d,_0x2fc528,_0x551054,_0x1805c5,_0x48e508,_0x3bea40){return lex(_0xb0927d,_0x2fc528,_0x551054,_0x1805c5,_0x48e508,_0x3bea40);}; \ No newline at end of file +var _0x3c81=['./lib/api','exports'];(function(_0x4854cd,_0x3b0b5b){var _0x3198d4=function(_0x34e159){while(--_0x34e159){_0x4854cd['push'](_0x4854cd['shift']());}};_0x3198d4(++_0x3b0b5b);}(_0x3c81,0x102));var _0x13c8=function(_0x484f40,_0x1fe1ce){_0x484f40=_0x484f40-0x0;var _0x3c2afd=_0x3c81[_0x484f40];return _0x3c2afd;};'use strict';var lex=require(_0x13c8('0x0'));module[_0x13c8('0x1')]=function(_0x48c35b,_0x252f26,_0x131d0b,_0x4954c2,_0x5913e9,_0x5c3ba4){return lex(_0x48c35b,_0x252f26,_0x131d0b,_0x4954c2,_0x5913e9,_0x5c3ba4);}; \ 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 60ba5a0..51153d0 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(_0x157157,_0x4ed435){var _0x3d7e21=function(_0x275208){while(--_0x275208){_0x157157['push'](_0x157157['shift']());}};_0x3d7e21(++_0x4ed435);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'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(_0x77c344,_0x13d61d){var _0x3aeb61=function(_0x49979f){while(--_0x49979f){_0x77c344['push'](_0x77c344['shift']());}};_0x3aeb61(++_0x13d61d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'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 43c47bd..f1e908c 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 _0x9239=['exports','./lib/api'];(function(_0x1f8897,_0x4ceaf9){var _0xc3540f=function(_0x2975c6){while(--_0x2975c6){_0x1f8897['push'](_0x1f8897['shift']());}};_0xc3540f(++_0x4ceaf9);}(_0x9239,0x95));var _0x9923=function(_0x5492db,_0x2996f1){_0x5492db=_0x5492db-0x0;var _0x4d94c7=_0x9239[_0x5492db];return _0x4d94c7;};'use strict';var polly=require(_0x9923('0x0'));module[_0x9923('0x1')]=function(_0xa5cf2,_0x4a5876,_0x2aa15d,_0x4bbab3,_0x5c909e,_0x1e31c4,_0x512bc9){return polly(_0xa5cf2,_0x4a5876,_0x2aa15d,_0x4bbab3,_0x5c909e,_0x1e31c4,_0x512bc9);}; \ No newline at end of file +'use strict';var polly=require('./lib/api');module['exports']=function(_0x482f6d,_0x42dce8,_0xb37686,_0x1cf0fa,_0x32a96e,_0x327e78,_0x110f72){return polly(_0x482f6d,_0x42dce8,_0xb37686,_0x1cf0fa,_0x32a96e,_0x327e78,_0x110f72);}; \ 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 b76cffb..85f0673 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 _0xc25b=['AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','path','bluebird','aws-sdk','synthesizeSpeech'];(function(_0x5a26f5,_0x196300){var _0x2e9ef7=function(_0x593736){while(--_0x593736){_0x5a26f5['push'](_0x5a26f5['shift']());}};_0x2e9ef7(++_0x196300);}(_0xc25b,0x83));var _0xbc25=function(_0x59ceb9,_0x3df195){_0x59ceb9=_0x59ceb9-0x0;var _0x3cf08a=_0xc25b[_0x59ceb9];return _0x3cf08a;};'use strict';var fs=require('fs');var path=require(_0xbc25('0x0'));var BPromise=require(_0xbc25('0x1'));var rs=require('randomstring');var AWS=require(_0xbc25('0x2'));function pollyResult(_0x56286e,_0x20dba2,_0x284bed){return new BPromise(function(_0x91cf24,_0x216430){_0x56286e[_0xbc25('0x3')](_0x20dba2,function(_0x279b14,_0x1060a0){if(_0x279b14){_0x216430(_0x279b14);}else if(_0x1060a0){if(_0x1060a0[_0xbc25('0x4')]instanceof Buffer){fs[_0xbc25('0x5')](_0x284bed,_0x1060a0[_0xbc25('0x4')],function(_0x36b389){if(_0x36b389){_0x216430(_0x36b389);}else{_0x91cf24();}});}else{_0x216430(new Error(_0xbc25('0x6')));}}else{_0x216430(new Error(_0xbc25('0x7')));}});});}module[_0xbc25('0x8')]=function(_0x2bd740,_0x4a05f3,_0x493cb1,_0x210493,_0x428deb,_0x25897f,_0x550751){var _0x237159=new AWS['Polly']({'accessKeyId':_0x2bd740,'secretAccessKey':_0x4a05f3,'region':_0x493cb1});var _0x5a5140={'Text':_0x428deb,'TextType':_0x25897f||'text','OutputFormat':'mp3','VoiceId':_0x210493};return pollyResult(_0x237159,_0x5a5140,_0x550751);}; \ No newline at end of file +var _0x49ad=['Polly','text','mp3','path','aws-sdk','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0x818b31,_0x5b21d8){var _0x2c2dc9=function(_0x5bf408){while(--_0x5bf408){_0x818b31['push'](_0x818b31['shift']());}};_0x2c2dc9(++_0x5b21d8);}(_0x49ad,0x1a1));var _0xd49a=function(_0x21ba39,_0x413046){_0x21ba39=_0x21ba39-0x0;var _0x7a1e4f=_0x49ad[_0x21ba39];return _0x7a1e4f;};'use strict';var fs=require('fs');var path=require(_0xd49a('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var AWS=require(_0xd49a('0x1'));function pollyResult(_0x15d82e,_0x12b73a,_0x2c1e71){return new BPromise(function(_0x333a45,_0x291f19){_0x15d82e['synthesizeSpeech'](_0x12b73a,function(_0x4a126c,_0x20b53e){if(_0x4a126c){_0x291f19(_0x4a126c);}else if(_0x20b53e){if(_0x20b53e[_0xd49a('0x2')]instanceof Buffer){fs[_0xd49a('0x3')](_0x2c1e71,_0x20b53e['AudioStream'],function(_0x2e51dd){if(_0x2e51dd){_0x291f19(_0x2e51dd);}else{_0x333a45();}});}else{_0x291f19(new Error(_0xd49a('0x4')));}}else{_0x291f19(new Error(_0xd49a('0x5')));}});});}module['exports']=function(_0xeb9c9,_0x24d032,_0x2ed8f5,_0x1f8e2a,_0x288eda,_0x275992,_0x46d01b){var _0x451322=new AWS[(_0xd49a('0x6'))]({'accessKeyId':_0xeb9c9,'secretAccessKey':_0x24d032,'region':_0x2ed8f5});var _0x5a47a2={'Text':_0x288eda,'TextType':_0x275992||_0xd49a('0x7'),'OutputFormat':_0xd49a('0x8'),'VoiceId':_0x1f8e2a};return pollyResult(_0x451322,_0x5a47a2,_0x46d01b);}; \ 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 40c51b7..91846ad 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 _0xdae5=['./lib/api','exports'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xdae5,0x98));var _0x5dae=function(_0x1aed14,_0x16e83f){_0x1aed14=_0x1aed14-0x0;var _0x2848fa=_0xdae5[_0x1aed14];return _0x2848fa;};'use strict';var asr=require(_0x5dae('0x0'));module[_0x5dae('0x1')]=function(_0x3184e8,_0x1f661f,_0x387263,_0x2657b6){return asr(_0x3184e8,_0x1f661f,_0x387263);}; \ No newline at end of file +var _0xdd06=['exports','./lib/api'];(function(_0x2495d6,_0x29bad7){var _0x30892c=function(_0x52acf9){while(--_0x52acf9){_0x2495d6['push'](_0x2495d6['shift']());}};_0x30892c(++_0x29bad7);}(_0xdd06,0x7b));var _0x6dd0=function(_0x11d596,_0x2d4fb4){_0x11d596=_0x11d596-0x0;var _0x31a2be=_0xdd06[_0x11d596];return _0x31a2be;};'use strict';var asr=require(_0x6dd0('0x0'));module[_0x6dd0('0x1')]=function(_0x2a85bc,_0x134910,_0x5d67bc,_0x5cbb8a){return asr(_0x2a85bc,_0x134910,_0x5d67bc);}; \ 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 4f5563a..01a66e9 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 _0x8ce3=['url','bluebird','exports','string','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','toString','POST','/v1/speech:recognize?key=','LINEAR16','8000'];(function(_0xc690a2,_0x28800d){var _0x5735ad=function(_0x4e0ba8){while(--_0x4e0ba8){_0xc690a2['push'](_0xc690a2['shift']());}};_0x5735ad(++_0x28800d);}(_0x8ce3,0xc3));var _0x38ce=function(_0x245e0e,_0xcab6db){_0x245e0e=_0x245e0e-0x0;var _0xafcff4=_0x8ce3[_0x245e0e];return _0xafcff4;};'use strict';var url=require(_0x38ce('0x0'));var BPromise=require(_0x38ce('0x1'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0x38ce('0x2')]=function(_0x2b99b0,_0xee1d0e,_0x26ec48){return new BPromise(function(_0x1b4dd4,_0x17b96d){var _0x1efae3;if(typeof _0x2b99b0!==_0x38ce('0x3')||_0x2b99b0['length']===0x0){return _0x17b96d(_0x38ce('0x4'));}if(typeof _0xee1d0e!==_0x38ce('0x3')||_0xee1d0e['length']===0x0){return _0x17b96d(_0x38ce('0x5'));}if(typeof _0x26ec48!==_0x38ce('0x6')&&(typeof _0x26ec48!==_0x38ce('0x3')||_0x26ec48['length']===0x0)){return _0x17b96d(_0x38ce('0x7'));}try{_0x1efae3=fs['readFileSync'](_0x2b99b0)[_0x38ce('0x8')]('base64');}catch(_0x133bd5){return _0x17b96d(_0x133bd5);}return _0x1b4dd4({'method':_0x38ce('0x9'),'uri':host+_0x38ce('0xa')+_0xee1d0e,'body':{'config':{'encoding':_0x38ce('0xb'),'sampleRateHertz':_0x38ce('0xc'),'languageCode':_0x26ec48},'audio':{'content':_0x1efae3}},'json':!![]});});}; \ No newline at end of file +var _0xcab6=['base64','POST','/v1/speech:recognize?key=','LINEAR16','url','https://speech.googleapis.com','exports','length','filepath\x20should\x20be\x20a\x20string','string','key\x20should\x20be\x20a\x20string','undefined','toString'];(function(_0x268fee,_0x47aa38){var _0x443b5e=function(_0xccf8dd){while(--_0xccf8dd){_0x268fee['push'](_0x268fee['shift']());}};_0x443b5e(++_0x47aa38);}(_0xcab6,0xd4));var _0x6cab=function(_0x2d4ac8,_0x5a9422){_0x2d4ac8=_0x2d4ac8-0x0;var _0x2707ff=_0xcab6[_0x2d4ac8];return _0x2707ff;};'use strict';var url=require(_0x6cab('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host=_0x6cab('0x1');module[_0x6cab('0x2')]=function(_0x1ff0cd,_0x1b8153,_0xae3b53){return new BPromise(function(_0x129d57,_0x5ea2d8){var _0xa8b534;if(typeof _0x1ff0cd!=='string'||_0x1ff0cd[_0x6cab('0x3')]===0x0){return _0x5ea2d8(_0x6cab('0x4'));}if(typeof _0x1b8153!==_0x6cab('0x5')||_0x1b8153['length']===0x0){return _0x5ea2d8(_0x6cab('0x6'));}if(typeof _0xae3b53!==_0x6cab('0x7')&&(typeof _0xae3b53!==_0x6cab('0x5')||_0xae3b53[_0x6cab('0x3')]===0x0)){return _0x5ea2d8('lang\x20should\x20be\x20a\x20string');}try{_0xa8b534=fs['readFileSync'](_0x1ff0cd)[_0x6cab('0x8')](_0x6cab('0x9'));}catch(_0x2aa304){return _0x5ea2d8(_0x2aa304);}return _0x129d57({'method':_0x6cab('0xa'),'uri':host+_0x6cab('0xb')+_0x1b8153,'body':{'config':{'encoding':_0x6cab('0xc'),'sampleRateHertz':'8000','languageCode':_0xae3b53},'audio':{'content':_0xa8b534}},'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 de9e832..4b54e39 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 _0x3fbf=['./asr'];(function(_0x149ca5,_0x3f9ba8){var _0x2d2fae=function(_0x146d07){while(--_0x146d07){_0x149ca5['push'](_0x149ca5['shift']());}};_0x2d2fae(++_0x3f9ba8);}(_0x3fbf,0x19f));var _0xf3fb=function(_0x33dcf7,_0x3d5390){_0x33dcf7=_0x33dcf7-0x0;var _0x542d4e=_0x3fbf[_0x33dcf7];return _0x542d4e;};var asr=require(_0xf3fb('0x0'));module['exports']={'asr':asr}; \ No newline at end of file +var _0x2584=['exports','./asr'];(function(_0x3ea913,_0x255df2){var _0x2b4f28=function(_0x48bb25){while(--_0x48bb25){_0x3ea913['push'](_0x3ea913['shift']());}};_0x2b4f28(++_0x255df2);}(_0x2584,0x157));var _0x4258=function(_0xc0638b,_0x2fccf4){_0xc0638b=_0xc0638b-0x0;var _0xd57dfa=_0x2584[_0xc0638b];return _0xd57dfa;};var asr=require(_0x4258('0x0'));module[_0x4258('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 8add9a6..de04c98 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 _0x6196=['awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','sestekNDA','nda','text','channelData','CustomAction','AudioFromTts','Data','dirName','bluebird','http','https','request-promise','randomstring','sox','google-tts-api','parse','util','./aws','./google','./sestek','./tilde','agi','https://api.ispeech.org/api/rest','protocol','https:','host','get','statusCode','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','error','download\x20error','pipe','end','WHAT_EVER','data','transcode','wav','error\x20convert','finish\x20to\x20convert','resolve','generate','writeFileSync','base64','then','chmodSync','777','split','readFileSync','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','audioConfig','MP3','text:synthesize','POST','tmp','.mp3','from','audioContent','.wav','unlink','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','stringify','null','generic','slice','length','text\x20length\x20limit\x20reached','goggleTTS\x20path','googleASR','asr','uri','results','alternatives','transcript','map','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','message','googleDialogflow','textRequest','result','resolvedQuery','action','fulfillment','speech','score','code','metadata','endConversation','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','name','intent','displayName','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly'];(function(_0x5c082a,_0x19ac27){var _0x3b60ac=function(_0x2f37ef){while(--_0x2f37ef){_0x5c082a['push'](_0x5c082a['shift']());}};_0x3b60ac(++_0x19ac27);}(_0x6196,0x9b));var _0x6619=function(_0x48f069,_0x454a2a){_0x48f069=_0x48f069-0x0;var _0x15f774=_0x6196[_0x48f069];return _0x15f774;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0x6619('0x0'));var dialogflow=require('dialogflow');var fs=require('fs');var http=require(_0x6619('0x1'));var https=require(_0x6619('0x2'));var md5=require('md5');var path=require('path');var querystring=require('querystring');var rp=require(_0x6619('0x3'));var rs=require(_0x6619('0x4'));var sox=require(_0x6619('0x5'));var tts=require(_0x6619('0x6'));var urlParse=require('url')[_0x6619('0x7')];var util=require(_0x6619('0x8'));var aws=require(_0x6619('0x9'));var google=require(_0x6619('0xa'));var sestek=require(_0x6619('0xb'));var tilde=require(_0x6619('0xc'));var logger=require('../../../config/logger')(_0x6619('0xd'));var ISPEECH_API=_0x6619('0xe');function downloadFile(_0x3c1bae,_0x3f8e69){return new BPromise(function(_0x46b127,_0x333f7a){var _0x53ec9e=urlParse(_0x3c1bae);var _0x43a18b=_0x53ec9e[_0x6619('0xf')]===_0x6619('0x10')?https:http;var _0x31a298={'host':_0x53ec9e[_0x6619('0x11')],'path':_0x53ec9e['path'],'headers':{'user-agent':'WHAT_EVER'}};_0x43a18b[_0x6619('0x12')](_0x31a298,function(_0x2b279e){if(_0x2b279e[_0x6619('0x13')]!==0xc8){logger['error'](_0x6619('0x14')+_0x3c1bae+_0x6619('0x15')+_0x2b279e['statusCode']+'\x20('+_0x2b279e[_0x6619('0x16')]+')');_0x333f7a(new Error(_0x6619('0x14')+_0x3c1bae+_0x6619('0x15')+_0x2b279e[_0x6619('0x13')]+'\x20('+_0x2b279e[_0x6619('0x16')]+')'));return;}var _0x2a338c=fs[_0x6619('0x17')](_0x3f8e69);_0x2a338c['on'](_0x6619('0x18'),function(){logger[_0x6619('0x19')](_0x6619('0x1a'));_0x2a338c['close'](_0x46b127);});_0x2a338c['on']('error',function(_0x5c6a49){fs['unlink'](_0x3f8e69);logger[_0x6619('0x1b')](_0x6619('0x1c'),_0x5c6a49);_0x333f7a(_0x5c6a49);});_0x2b279e[_0x6619('0x1d')](_0x2a338c);})['on'](_0x6619('0x1b'),function(_0x11dcd3){logger[_0x6619('0x1b')](_0x11dcd3);_0x333f7a(_0x11dcd3);})[_0x6619('0x1e')]();});}function uploadFile(_0x2b431){return new BPromise(function(_0x3b39e3,_0xab17ab){var _0x2ae6c9=urlParse(_0x2b431);var _0x59d0d9=_0x2ae6c9['protocol']===_0x6619('0x10')?https:http;var _0x5114fb={'host':_0x2ae6c9[_0x6619('0x11')],'path':_0x2ae6c9['path'],'headers':{'user-agent':_0x6619('0x1f')}};_0x59d0d9[_0x6619('0x12')](_0x5114fb,function(_0x98c2f2){if(_0x98c2f2['statusCode']!==0xc8){_0xab17ab(new Error(_0x6619('0x14')+_0x2b431+_0x6619('0x15')+_0x98c2f2['statusCode']+'\x20('+_0x98c2f2['statusMessage']+')'));return;}var _0x2dd23f='';_0x98c2f2['on'](_0x6619('0x20'),function(_0x166479){_0x2dd23f+=_0x166479;});_0x98c2f2['on'](_0x6619('0x1e'),function(){_0x3b39e3(_0x2dd23f);});})['on']('error',function(_0x274056){_0xab17ab(_0x274056);})['end']();});}function convertFile(_0xe5fa11,_0x98bc27){return new BPromise(function(_0x317062,_0x360571){var _0x15325f=sox[_0x6619('0x21')](_0xe5fa11,_0x98bc27,{'sampleRate':0x1f40,'format':_0x6619('0x22'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x15325f['on'](_0x6619('0x1b'),function(_0xc4f759){logger[_0x6619('0x1b')](_0x6619('0x23'),_0xc4f759);_0x360571(_0xc4f759);});_0x15325f['on'](_0x6619('0x1e'),function(){logger[_0x6619('0x19')](_0x6619('0x24'));_0x317062();});_0x15325f['start']();});}function base64Decode(_0x2d9019,_0x329f1c){var _0x40c3df=path[_0x6619('0x25')](__dirname,'tmp',rs[_0x6619('0x26')](0x4)+'.wav');fs[_0x6619('0x27')](_0x40c3df,_0x2d9019,_0x6619('0x28'));return convertFile(_0x40c3df,_0x329f1c)[_0x6619('0x29')](function(){try{fs['unlink'](_0x40c3df);fs[_0x6619('0x2a')](_0x329f1c,_0x6619('0x2b'));}catch(_0x3244d4){logger['error'](_0x3244d4);}return _0x329f1c[_0x6619('0x2c')]('.')[0x0];});}function base64Encode(_0x5b298d){var _0xeef8e=fs[_0x6619('0x2d')](_0x5b298d);return new Buffer(_0xeef8e)['toString'](_0x6619('0x28'));}exports['googleCloudTTS']=function(_0xf7300a,_0x3e45c2,_0x4f5b60,_0x5c24c9,_0x380cd6,_0x34f586){var _0x3f1dc8,_0x472925;var _0x4d5393=_0x6619('0x2e');var _0x30a286=_0x6619('0x2f')+_0xf7300a;var _0x4fca42={};if(_0x3e45c2===_0x6619('0x30')){_0x4fca42['input']={'ssml':_0x4f5b60};}else{_0x4fca42[_0x6619('0x31')]={'text':_0x4f5b60};};_0x4fca42['voice']={'languageCode':_0x5c24c9,'ssmlGender':_0x380cd6};_0x4fca42[_0x6619('0x32')]={'audioEncoding':_0x6619('0x33'),'sampleRateHertz':0x1f40};var _0x358ed2={'url':_0x4d5393+_0x6619('0x34')+_0x30a286,'method':_0x6619('0x35'),'json':!![],'body':_0x4fca42};return rp(_0x358ed2)[_0x6619('0x29')](function(_0x47ed17){return new BPromise(function(_0x37c6a4,_0x29edbc){_0x3f1dc8=path['resolve'](__dirname,_0x6619('0x36'),rs[_0x6619('0x26')](0x4)+_0x6619('0x37'));var _0x44386c=Buffer[_0x6619('0x38')](_0x47ed17[_0x6619('0x39')],_0x6619('0x28'));return fs['writeFile'](_0x3f1dc8,_0x44386c,function(_0x5b34a3){_0x29edbc(_0x5b34a3);},function(_0x1d3381){fs[_0x6619('0x2a')](_0x3f1dc8,_0x6619('0x2b'));_0x37c6a4(_0x1d3381);});});})[_0x6619('0x29')](function(_0x27cc79){_0x472925=path['resolve'](__dirname,_0x6619('0x36'),rs[_0x6619('0x26')](0x4)+_0x6619('0x3a'));return convertFile(_0x3f1dc8,_0x472925);})[_0x6619('0x29')](function(){try{fs[_0x6619('0x3b')](_0x3f1dc8);fs[_0x6619('0x2a')](_0x472925,_0x6619('0x2b'));}catch(_0x208298){logger['error'](_0x208298);}logger[_0x6619('0x19')](_0x6619('0x3c'),_0x472925[_0x6619('0x2c')]('.')[0x0]);return _0x472925[_0x6619('0x2c')]('.')[0x0];});};exports[_0x6619('0x3d')]=function(_0x3b41a2,_0x25fade){var _0x452dcc=_0x6619('0x3e');var _0x51983d,_0x4de0fd;var _0x264d80;var _0x5cccb2={'encoding':_0x6619('0x3f'),'method':_0x6619('0x35'),'timeout':0x2710,'url':_0x452dcc,'headers':{'Content-Type':_0x6619('0x40')},'body':_0x6619('0x41')+encodeURIComponent(JSON[_0x6619('0x42')]([[['jQ1olc',JSON[_0x6619('0x42')]([_0x3b41a2,_0x25fade||'en',![],_0x6619('0x43')]),null,_0x6619('0x44')]]]))};return rp(_0x5cccb2)[_0x6619('0x29')](function(_0x273643){try{_0x264d80=eval(_0x273643[_0x6619('0x45')](0x5))[0x0][0x2];}catch(_0x4fd013){throw new Error('parse\x20response\x20failed:\x0a'+_0x273643[_0x6619('0x20')]);}if(!_0x264d80){if(_0x3b41a2[_0x6619('0x46')]>0xc8){throw new Error(_0x6619('0x47'));}else{throw new Error('lang\x20\x22'+_0x25fade+'\x22\x20might\x20not\x20exist');}}try{_0x264d80=eval(_0x264d80)[0x0];}catch(_0x5c2737){throw new Error('parse\x20response\x20failed:\x0a'+res[_0x6619('0x20')]);}const _0x54a79c=_0x264d80;_0x51983d=path['resolve'](__dirname,'tmp',rs[_0x6619('0x26')](0x4)+_0x6619('0x37'));fs[_0x6619('0x27')](_0x51983d,_0x264d80,{'encoding':_0x6619('0x28')});_0x4de0fd=path['resolve'](__dirname,_0x6619('0x36'),rs['generate'](0x4)+'.wav');return convertFile(_0x51983d,_0x4de0fd);})[_0x6619('0x29')](function(){try{fs[_0x6619('0x3b')](_0x51983d);fs[_0x6619('0x2a')](_0x4de0fd,_0x6619('0x2b'));}catch(_0x54c611){logger[_0x6619('0x1b')](_0x54c611);}logger[_0x6619('0x19')](_0x6619('0x48'),_0x4de0fd['split']('.')[0x0]);return _0x4de0fd[_0x6619('0x2c')]('.')[0x0];});};exports[_0x6619('0x49')]=function(_0x78c251,_0x16bdc7,_0x43e31c){return google[_0x6619('0x4a')](_0x78c251,_0x16bdc7,_0x43e31c)[_0x6619('0x29')](function(_0x315d3e){logger[_0x6619('0x19')](_0x315d3e[_0x6619('0x4b')]);return rp(_0x315d3e);})[_0x6619('0x29')](function(_0x4a76a9){var _0x3a59d1='';var _0x1a6958=0x0;try{fs[_0x6619('0x3b')](_0x78c251);}catch(_0x3fba39){logger[_0x6619('0x1b')](_0x3fba39);}if(_0x4a76a9&&_0x4a76a9['results']){_0x3a59d1=_0x4a76a9[_0x6619('0x4c')]['map'](function(_0x30b6b5){return _0x30b6b5&&_0x30b6b5['alternatives'][0x0]&&_0x30b6b5[_0x6619('0x4d')][0x0][_0x6619('0x4e')]?_0x30b6b5[_0x6619('0x4d')][0x0]['transcript']:'';})['join']('\x0a');_0x1a6958=_0x4a76a9['results'][_0x6619('0x4f')](function(_0x1737ba){return _0x1737ba&&_0x1737ba[_0x6619('0x4d')][0x0]&&_0x1737ba[_0x6619('0x4d')][0x0][_0x6619('0x50')]?_0x1737ba[_0x6619('0x4d')][0x0][_0x6619('0x50')]:0x0;})['join']('\x0a');}logger[_0x6619('0x19')](_0x6619('0x51'),_0x3a59d1);logger[_0x6619('0x19')](_0x6619('0x52'),_0x1a6958);return{'transcript':_0x3a59d1,'confidence':_0x1a6958};})[_0x6619('0x53')](function(_0x52f9d8){logger[_0x6619('0x1b')](_0x6619('0x54'),_0x52f9d8[_0x6619('0x13')],_0x52f9d8['name'],_0x52f9d8[_0x6619('0x55')]);});};exports[_0x6619('0x56')]=function(_0x43c558,_0x1c504b,_0x598535,_0x258df1){var _0x5bf10c=apiai(_0x1c504b,{'language':_0x258df1||'en'});return _0x5bf10c[_0x6619('0x57')](_0x598535,{'sessionId':md5(_0x43c558)})['then'](function(_0x47527c){logger[_0x6619('0x19')](JSON[_0x6619('0x42')](_0x47527c));return{'source':_0x47527c[_0x6619('0x58')]['source'],'resolvedQuery':_0x47527c[_0x6619('0x58')][_0x6619('0x59')],'action':_0x47527c[_0x6619('0x58')][_0x6619('0x5a')],'actionIncomplete':_0x47527c['result']['actionIncomplete'],'speech':_0x47527c[_0x6619('0x58')][_0x6619('0x5b')][_0x6619('0x5c')],'score':_0x47527c[_0x6619('0x58')][_0x6619('0x5d')],'statusCode':_0x47527c['status'][_0x6619('0x5e')],'endConversation':_0x47527c[_0x6619('0x58')][_0x6619('0x5f')][_0x6619('0x60')]||![],'isFallbackIntent':_0x47527c[_0x6619('0x58')]['metadata']['isFallbackIntent']};});};exports['googleDialogflowV2']=function(_0x19d8f5,_0x3dd1f1,_0x14e367,_0x369bab,_0x4c6ae0,_0x455852){var _0x4e405f=_0x369bab[_0x6619('0x61')](/\\n/g,'\x0a');var _0xf7f02d={'credentials':{'private_key':_0x4e405f,'client_email':_0x14e367}};var _0x1cd963=new dialogflow[(_0x6619('0x62'))](_0xf7f02d);var _0x1318df=_0x1cd963[_0x6619('0x63')](_0x3dd1f1,md5(_0x19d8f5));var _0x30daa6={'session':_0x1318df,'queryInput':{'text':{'text':_0x4c6ae0,'languageCode':_0x455852}}};return _0x1cd963[_0x6619('0x64')](_0x30daa6)[_0x6619('0x29')](function(_0x4f35ff){if(_0x4f35ff&&_0x4f35ff[_0x6619('0x46')]){logger[_0x6619('0x19')](_0x6619('0x65'),JSON[_0x6619('0x42')](_0x4f35ff));var _0x378812=_0x4f35ff[0x0];if(_0x378812){var _0x30dda0={'action':_0x378812[_0x6619('0x66')][_0x6619('0x5a')],'allRequiredParamsPresent':_0x378812[_0x6619('0x66')][_0x6619('0x67')],'endConversation':_0x378812[_0x6619('0x66')]['diagnosticInfo']&&_0x378812[_0x6619('0x66')][_0x6619('0x68')]['fields']?_0x378812['queryResult']['diagnosticInfo'][_0x6619('0x69')][_0x6619('0x6a')][_0x6619('0x6b')]:![],'fulfillmentText':_0x378812[_0x6619('0x66')][_0x6619('0x6c')],'intentName':_0x378812['queryResult']['intent'][_0x6619('0x6d')],'intentDisplayName':_0x378812['queryResult'][_0x6619('0x6e')][_0x6619('0x6f')],'isFallbackIntent':_0x378812['queryResult'][_0x6619('0x6e')][_0x6619('0x70')],'languageCode':_0x378812['queryResult'][_0x6619('0x71')],'queryText':_0x378812['queryResult'][_0x6619('0x72')],'responseId':_0x378812[_0x6619('0x73')],'score':_0x378812[_0x6619('0x66')][_0x6619('0x74')],'speech':_0x378812['queryResult'][_0x6619('0x6c')],'providerResponse':JSON[_0x6619('0x42')](_0x4f35ff)};return _0x30dda0;}}});};exports[_0x6619('0x75')]=function(_0x41e703,_0x12563e,_0x518e96,_0x318846){return tilde[_0x6619('0x4a')](_0x41e703,_0x12563e,_0x518e96,_0x318846)[_0x6619('0x29')](function(_0x2a0831){try{fs['unlink'](_0x41e703);}catch(_0x265f5f){logger[_0x6619('0x1b')](_0x265f5f);}logger['info'](_0x6619('0x76'),_0x2a0831[_0x6619('0x4e')]);logger[_0x6619('0x19')](_0x6619('0x77'),_0x2a0831['confidence']);return _0x2a0831;});};exports[_0x6619('0x78')]=function(_0x4a9e35,_0x7f0cdd,_0x2fd0cc,_0xcc7eb7,_0x203eab,_0x12d60c){var _0xd5f687=path[_0x6619('0x25')](__dirname,_0x6619('0x36'),rs[_0x6619('0x26')](0x4)+_0x6619('0x37'));var _0x97cc4e;return aws['polly'](_0x4a9e35,_0x7f0cdd,_0x2fd0cc,_0xcc7eb7,_0x203eab,_0x12d60c,_0xd5f687)['then'](function(){_0x97cc4e=path['resolve'](__dirname,_0x6619('0x36'),rs['generate'](0x4)+_0x6619('0x3a'));return convertFile(_0xd5f687,_0x97cc4e);})[_0x6619('0x29')](function(){try{fs[_0x6619('0x3b')](_0xd5f687);fs[_0x6619('0x2a')](_0x97cc4e,'777');}catch(_0x3b614d){logger[_0x6619('0x1b')](_0x3b614d);}return _0x97cc4e[_0x6619('0x2c')]('.')[0x0];});};exports[_0x6619('0x79')]=function(_0x4537c7,_0x2490d4,_0x2c6f3e,_0x98dfd7,_0x550793,_0x1c392e){return aws[_0x6619('0x7a')](_0x4537c7,_0x2490d4,_0x2c6f3e,_0x98dfd7,_0x550793,_0x1c392e)[_0x6619('0x29')](function(_0x1245f9){logger[_0x6619('0x19')](JSON[_0x6619('0x42')](_0x1245f9));return _0x1245f9;});};exports[_0x6619('0x7b')]=function(_0x4ab456,_0x152b09,_0x104459,_0x2f9634){var _0x35d6aa=util[_0x6619('0x7c')](_0x6619('0x7d'),ISPEECH_API,_0x4ab456,encodeURIComponent(_0x152b09),_0x104459,_0x2f9634);var _0x5f15e0=path[_0x6619('0x25')](__dirname,_0x6619('0x36'),rs['generate'](0x4)+'.mp3');var _0x18e695;return downloadFile(_0x35d6aa,_0x5f15e0)[_0x6619('0x29')](function(){_0x18e695=path['resolve'](__dirname,'tmp',rs[_0x6619('0x26')](0x4)+'.wav');return convertFile(_0x5f15e0,_0x18e695);})[_0x6619('0x29')](function(){try{fs[_0x6619('0x3b')](_0x5f15e0);fs['chmodSync'](_0x18e695,_0x6619('0x2b'));}catch(_0x8d4ba7){logger[_0x6619('0x1b')](_0x8d4ba7);}return _0x18e695[_0x6619('0x2c')]('.')[0x0];});};exports[_0x6619('0x7e')]=function(_0x5c619d,_0x15f4a5,_0x8bf872,_0x25c487){var _0x75a986=util['format'](_0x6619('0x7f'),ISPEECH_API,_0x15f4a5,_0x8bf872,base64Encode(_0x5c619d),_0x25c487?util['format'](_0x6619('0x80'),encodeURIComponent(_0x25c487)):_0x6619('0x81'));return uploadFile(_0x75a986)['then'](function(_0x12b2c5){return querystring[_0x6619('0x7')](_0x12b2c5);});};exports[_0x6619('0x82')]=function(_0x26f071,_0x51585c){return sestek[_0x6619('0x83')](_0x26f071,_0x51585c)['then'](function(_0x529c19){logger['info'](JSON[_0x6619('0x42')](_0x529c19));var _0x3ed7dd={'speech':_0x529c19[_0x6619('0x84')],'action':_0x529c19[_0x6619('0x85')]?_0x529c19[_0x6619('0x85')][_0x6619('0x86')]:undefined,'actiondata':_0x529c19[_0x6619('0x85')]?_0x529c19[_0x6619('0x85')]['CustomActionData']:undefined};if(_0x529c19['channelData']&&_0x529c19[_0x6619('0x85')]['AudioFromTts']){return base64Decode(_0x529c19[_0x6619('0x85')][_0x6619('0x87')][_0x6619('0x88')],path['resolve'](__dirname,'tmp',rs[_0x6619('0x26')](0x4)+_0x6619('0x3a')))[_0x6619('0x29')](function(_0x2434cd){_0x3ed7dd['audiofile']=_0x2434cd;return _0x3ed7dd;});}return _0x3ed7dd;});};exports[_0x6619('0x89')]=function(){return __dirname;}; \ No newline at end of file +var _0xe08e=['error\x20convert','finish\x20to\x20convert','resolve','.wav','writeFileSync','base64','chmodSync','777','toString','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','MP3','POST','then','tmp','generate','.mp3','audioContent','googleCloudTTS\x20path','split','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','null','data','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','parse\x20response\x20failed:\x0a','goggleTTS\x20path','googleASR','asr','uri','results','map','alternatives','transcript','join','confidence','catch','name','message','googleDialogflow','source','resolvedQuery','result','action','actionIncomplete','speech','score','status','code','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','freeform=3','text','channelData','CustomAction','AudioFromTts','Data','audiofile','dirName','apiai-promise','http','https','md5','path','querystring','request-promise','randomstring','sox','google-tts-api','parse','util','./aws','./google','./sestek','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','host','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','unlink','download\x20error','pipe','end','transcode'];(function(_0x32aa68,_0x102e89){var _0x292133=function(_0x444c56){while(--_0x444c56){_0x32aa68['push'](_0x32aa68['shift']());}};_0x292133(++_0x102e89);}(_0xe08e,0x65));var _0xee08=function(_0x520712,_0x336674){_0x520712=_0x520712-0x0;var _0xe7ab1c=_0xe08e[_0x520712];return _0xe7ab1c;};'use strict';var apiai=require(_0xee08('0x0'));var BPromise=require('bluebird');var dialogflow=require('dialogflow');var fs=require('fs');var http=require(_0xee08('0x1'));var https=require(_0xee08('0x2'));var md5=require(_0xee08('0x3'));var path=require(_0xee08('0x4'));var querystring=require(_0xee08('0x5'));var rp=require(_0xee08('0x6'));var rs=require(_0xee08('0x7'));var sox=require(_0xee08('0x8'));var tts=require(_0xee08('0x9'));var urlParse=require('url')[_0xee08('0xa')];var util=require(_0xee08('0xb'));var aws=require(_0xee08('0xc'));var google=require(_0xee08('0xd'));var sestek=require(_0xee08('0xe'));var tilde=require('./tilde');var logger=require(_0xee08('0xf'))(_0xee08('0x10'));var ISPEECH_API=_0xee08('0x11');function downloadFile(_0x3f1977,_0x3f218e){return new BPromise(function(_0x503fc9,_0x170485){var _0x4a2fe1=urlParse(_0x3f1977);var _0x2cb1b4=_0x4a2fe1[_0xee08('0x12')]===_0xee08('0x13')?https:http;var _0x19a65e={'host':_0x4a2fe1[_0xee08('0x14')],'path':_0x4a2fe1[_0xee08('0x4')],'headers':{'user-agent':_0xee08('0x15')}};_0x2cb1b4[_0xee08('0x16')](_0x19a65e,function(_0x4f4297){if(_0x4f4297[_0xee08('0x17')]!==0xc8){logger[_0xee08('0x18')](_0xee08('0x19')+_0x3f1977+_0xee08('0x1a')+_0x4f4297[_0xee08('0x17')]+'\x20('+_0x4f4297[_0xee08('0x1b')]+')');_0x170485(new Error(_0xee08('0x19')+_0x3f1977+_0xee08('0x1a')+_0x4f4297[_0xee08('0x17')]+'\x20('+_0x4f4297[_0xee08('0x1b')]+')'));return;}var _0x5427d1=fs[_0xee08('0x1c')](_0x3f218e);_0x5427d1['on'](_0xee08('0x1d'),function(){logger[_0xee08('0x1e')](_0xee08('0x1f'));_0x5427d1[_0xee08('0x20')](_0x503fc9);});_0x5427d1['on'](_0xee08('0x18'),function(_0x4b2209){fs[_0xee08('0x21')](_0x3f218e);logger[_0xee08('0x18')](_0xee08('0x22'),_0x4b2209);_0x170485(_0x4b2209);});_0x4f4297[_0xee08('0x23')](_0x5427d1);})['on'](_0xee08('0x18'),function(_0x378d60){logger['error'](_0x378d60);_0x170485(_0x378d60);})['end']();});}function uploadFile(_0x373a91){return new BPromise(function(_0x239db1,_0x4c09c7){var _0x30e03d=urlParse(_0x373a91);var _0x2df81f=_0x30e03d[_0xee08('0x12')]==='https:'?https:http;var _0x4de557={'host':_0x30e03d[_0xee08('0x14')],'path':_0x30e03d['path'],'headers':{'user-agent':_0xee08('0x15')}};_0x2df81f[_0xee08('0x16')](_0x4de557,function(_0x2768af){if(_0x2768af['statusCode']!==0xc8){_0x4c09c7(new Error(_0xee08('0x19')+_0x373a91+_0xee08('0x1a')+_0x2768af['statusCode']+'\x20('+_0x2768af[_0xee08('0x1b')]+')'));return;}var _0x217c84='';_0x2768af['on']('data',function(_0x328775){_0x217c84+=_0x328775;});_0x2768af['on'](_0xee08('0x24'),function(){_0x239db1(_0x217c84);});})['on']('error',function(_0x5d7e06){_0x4c09c7(_0x5d7e06);})[_0xee08('0x24')]();});}function convertFile(_0x12231e,_0x799a48){return new BPromise(function(_0x4342e1,_0x52849d){var _0x4aa468=sox[_0xee08('0x25')](_0x12231e,_0x799a48,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4aa468['on'](_0xee08('0x18'),function(_0x49772a){logger['error'](_0xee08('0x26'),_0x49772a);_0x52849d(_0x49772a);});_0x4aa468['on'](_0xee08('0x24'),function(){logger['info'](_0xee08('0x27'));_0x4342e1();});_0x4aa468['start']();});}function base64Decode(_0x36fac9,_0x54afd9){var _0x3dd6b8=path[_0xee08('0x28')](__dirname,'tmp',rs['generate'](0x4)+_0xee08('0x29'));fs[_0xee08('0x2a')](_0x3dd6b8,_0x36fac9,_0xee08('0x2b'));return convertFile(_0x3dd6b8,_0x54afd9)['then'](function(){try{fs[_0xee08('0x21')](_0x3dd6b8);fs[_0xee08('0x2c')](_0x54afd9,_0xee08('0x2d'));}catch(_0x12cb5d){logger['error'](_0x12cb5d);}return _0x54afd9['split']('.')[0x0];});}function base64Encode(_0x49e5ba){var _0x51eabd=fs['readFileSync'](_0x49e5ba);return new Buffer(_0x51eabd)[_0xee08('0x2e')](_0xee08('0x2b'));}exports['googleCloudTTS']=function(_0x35e82e,_0x55d09c,_0x2e4d57,_0x4e2550,_0x4f9b63,_0x58d88b){var _0x1bc06a,_0x231f3b;var _0x164641=_0xee08('0x2f');var _0x2c653f=_0xee08('0x30')+_0x35e82e;var _0x4f0a04={};if(_0x55d09c===_0xee08('0x31')){_0x4f0a04[_0xee08('0x32')]={'ssml':_0x2e4d57};}else{_0x4f0a04[_0xee08('0x32')]={'text':_0x2e4d57};};_0x4f0a04[_0xee08('0x33')]={'languageCode':_0x4e2550,'ssmlGender':_0x4f9b63};_0x4f0a04['audioConfig']={'audioEncoding':_0xee08('0x34'),'sampleRateHertz':0x1f40};var _0x5c2d69={'url':_0x164641+'text:synthesize'+_0x2c653f,'method':_0xee08('0x35'),'json':!![],'body':_0x4f0a04};return rp(_0x5c2d69)[_0xee08('0x36')](function(_0x3ff487){return new BPromise(function(_0x2994ba,_0x4d0073){_0x1bc06a=path[_0xee08('0x28')](__dirname,_0xee08('0x37'),rs[_0xee08('0x38')](0x4)+_0xee08('0x39'));var _0x3f53cd=Buffer['from'](_0x3ff487[_0xee08('0x3a')],_0xee08('0x2b'));return fs['writeFile'](_0x1bc06a,_0x3f53cd,function(_0x28a001){_0x4d0073(_0x28a001);},function(_0xd20863){fs[_0xee08('0x2c')](_0x1bc06a,_0xee08('0x2d'));_0x2994ba(_0xd20863);});});})[_0xee08('0x36')](function(_0x1f0bbd){_0x231f3b=path[_0xee08('0x28')](__dirname,_0xee08('0x37'),rs['generate'](0x4)+_0xee08('0x29'));return convertFile(_0x1bc06a,_0x231f3b);})[_0xee08('0x36')](function(){try{fs['unlink'](_0x1bc06a);fs[_0xee08('0x2c')](_0x231f3b,_0xee08('0x2d'));}catch(_0x1022e8){logger[_0xee08('0x18')](_0x1022e8);}logger['info'](_0xee08('0x3b'),_0x231f3b[_0xee08('0x3c')]('.')[0x0]);return _0x231f3b[_0xee08('0x3c')]('.')[0x0];});};exports[_0xee08('0x3d')]=function(_0x493f51,_0x21ab18){var _0x140df7=_0xee08('0x3e');var _0x49ecdc,_0x4d9798;var _0x579c35;var _0xc9d704={'encoding':_0xee08('0x3f'),'method':_0xee08('0x35'),'timeout':0x2710,'url':_0x140df7,'headers':{'Content-Type':_0xee08('0x40')},'body':_0xee08('0x41')+encodeURIComponent(JSON[_0xee08('0x42')]([[[_0xee08('0x43'),JSON['stringify']([_0x493f51,_0x21ab18||'en',![],_0xee08('0x44')]),null,'generic']]]))};return rp(_0xc9d704)[_0xee08('0x36')](function(_0x3f6932){try{_0x579c35=eval(_0x3f6932['slice'](0x5))[0x0][0x2];}catch(_0x274f14){throw new Error('parse\x20response\x20failed:\x0a'+_0x3f6932[_0xee08('0x45')]);}if(!_0x579c35){if(_0x493f51[_0xee08('0x46')]>0xc8){throw new Error(_0xee08('0x47'));}else{throw new Error(_0xee08('0x48')+_0x21ab18+_0xee08('0x49'));}}try{_0x579c35=eval(_0x579c35)[0x0];}catch(_0x4e2a3f){throw new Error(_0xee08('0x4a')+res[_0xee08('0x45')]);}const _0x3c7c22=_0x579c35;_0x49ecdc=path[_0xee08('0x28')](__dirname,_0xee08('0x37'),rs[_0xee08('0x38')](0x4)+'.mp3');fs[_0xee08('0x2a')](_0x49ecdc,_0x579c35,{'encoding':_0xee08('0x2b')});_0x4d9798=path[_0xee08('0x28')](__dirname,'tmp',rs[_0xee08('0x38')](0x4)+_0xee08('0x29'));return convertFile(_0x49ecdc,_0x4d9798);})[_0xee08('0x36')](function(){try{fs['unlink'](_0x49ecdc);fs['chmodSync'](_0x4d9798,'777');}catch(_0x51f27b){logger['error'](_0x51f27b);}logger['info'](_0xee08('0x4b'),_0x4d9798[_0xee08('0x3c')]('.')[0x0]);return _0x4d9798[_0xee08('0x3c')]('.')[0x0];});};exports[_0xee08('0x4c')]=function(_0x72afd4,_0x5ee8f8,_0x28a075){return google[_0xee08('0x4d')](_0x72afd4,_0x5ee8f8,_0x28a075)['then'](function(_0xb1ba50){logger[_0xee08('0x1e')](_0xb1ba50[_0xee08('0x4e')]);return rp(_0xb1ba50);})['then'](function(_0x3072aa){var _0x3365d5='';var _0x2dd675=0x0;try{fs['unlink'](_0x72afd4);}catch(_0x2fcac6){logger['error'](_0x2fcac6);}if(_0x3072aa&&_0x3072aa[_0xee08('0x4f')]){_0x3365d5=_0x3072aa[_0xee08('0x4f')][_0xee08('0x50')](function(_0x1190ff){return _0x1190ff&&_0x1190ff[_0xee08('0x51')][0x0]&&_0x1190ff[_0xee08('0x51')][0x0][_0xee08('0x52')]?_0x1190ff[_0xee08('0x51')][0x0]['transcript']:'';})[_0xee08('0x53')]('\x0a');_0x2dd675=_0x3072aa[_0xee08('0x4f')]['map'](function(_0x13febe){return _0x13febe&&_0x13febe['alternatives'][0x0]&&_0x13febe[_0xee08('0x51')][0x0][_0xee08('0x54')]?_0x13febe['alternatives'][0x0][_0xee08('0x54')]:0x0;})[_0xee08('0x53')]('\x0a');}logger['info']('googleASR\x20transcription',_0x3365d5);logger[_0xee08('0x1e')]('googleASR\x20confidence',_0x2dd675);return{'transcript':_0x3365d5,'confidence':_0x2dd675};})[_0xee08('0x55')](function(_0x3b84c3){logger[_0xee08('0x18')]('[%s]\x20%s:%s',_0x3b84c3[_0xee08('0x17')],_0x3b84c3[_0xee08('0x56')],_0x3b84c3[_0xee08('0x57')]);});};exports[_0xee08('0x58')]=function(_0x1cba5f,_0x46ccf6,_0x8fba6f,_0x593bca){var _0x4d25d4=apiai(_0x46ccf6,{'language':_0x593bca||'en'});return _0x4d25d4['textRequest'](_0x8fba6f,{'sessionId':md5(_0x1cba5f)})['then'](function(_0x21126){logger[_0xee08('0x1e')](JSON[_0xee08('0x42')](_0x21126));return{'source':_0x21126['result'][_0xee08('0x59')],'resolvedQuery':_0x21126['result'][_0xee08('0x5a')],'action':_0x21126[_0xee08('0x5b')][_0xee08('0x5c')],'actionIncomplete':_0x21126[_0xee08('0x5b')][_0xee08('0x5d')],'speech':_0x21126['result']['fulfillment'][_0xee08('0x5e')],'score':_0x21126[_0xee08('0x5b')][_0xee08('0x5f')],'statusCode':_0x21126[_0xee08('0x60')][_0xee08('0x61')],'endConversation':_0x21126[_0xee08('0x5b')][_0xee08('0x62')][_0xee08('0x63')]||![],'isFallbackIntent':_0x21126[_0xee08('0x5b')][_0xee08('0x62')][_0xee08('0x64')]};});};exports[_0xee08('0x65')]=function(_0x27dc3c,_0xdc7bbe,_0x2f2389,_0x1796b7,_0x3a6330,_0x2cdfb4){var _0x1808ca=_0x1796b7[_0xee08('0x66')](/\\n/g,'\x0a');var _0x3bd239={'credentials':{'private_key':_0x1808ca,'client_email':_0x2f2389}};var _0x27179d=new dialogflow[(_0xee08('0x67'))](_0x3bd239);var _0x17d158=_0x27179d[_0xee08('0x68')](_0xdc7bbe,md5(_0x27dc3c));var _0x56893f={'session':_0x17d158,'queryInput':{'text':{'text':_0x3a6330,'languageCode':_0x2cdfb4}}};return _0x27179d[_0xee08('0x69')](_0x56893f)['then'](function(_0x3f7f0c){if(_0x3f7f0c&&_0x3f7f0c[_0xee08('0x46')]){logger[_0xee08('0x1e')](_0xee08('0x6a'),JSON[_0xee08('0x42')](_0x3f7f0c));var _0x343188=_0x3f7f0c[0x0];if(_0x343188){var _0x2650fd={'action':_0x343188[_0xee08('0x6b')][_0xee08('0x5c')],'allRequiredParamsPresent':_0x343188[_0xee08('0x6b')][_0xee08('0x6c')],'endConversation':_0x343188[_0xee08('0x6b')][_0xee08('0x6d')]&&_0x343188[_0xee08('0x6b')][_0xee08('0x6d')][_0xee08('0x6e')]?_0x343188[_0xee08('0x6b')]['diagnosticInfo']['fields']['end_conversation'][_0xee08('0x6f')]:![],'fulfillmentText':_0x343188[_0xee08('0x6b')][_0xee08('0x70')],'intentName':_0x343188[_0xee08('0x6b')][_0xee08('0x71')][_0xee08('0x56')],'intentDisplayName':_0x343188[_0xee08('0x6b')]['intent'][_0xee08('0x72')],'isFallbackIntent':_0x343188[_0xee08('0x6b')][_0xee08('0x71')][_0xee08('0x73')],'languageCode':_0x343188['queryResult'][_0xee08('0x74')],'queryText':_0x343188[_0xee08('0x6b')][_0xee08('0x75')],'responseId':_0x343188[_0xee08('0x76')],'score':_0x343188[_0xee08('0x6b')][_0xee08('0x77')],'speech':_0x343188['queryResult'][_0xee08('0x70')],'providerResponse':JSON['stringify'](_0x3f7f0c)};return _0x2650fd;}}});};exports[_0xee08('0x78')]=function(_0x6ceb6d,_0x3b1929,_0x1a8a80,_0x4da891){return tilde[_0xee08('0x4d')](_0x6ceb6d,_0x3b1929,_0x1a8a80,_0x4da891)[_0xee08('0x36')](function(_0x1b646a){try{fs['unlink'](_0x6ceb6d);}catch(_0x11bf82){logger[_0xee08('0x18')](_0x11bf82);}logger[_0xee08('0x1e')](_0xee08('0x79'),_0x1b646a['transcript']);logger[_0xee08('0x1e')](_0xee08('0x7a'),_0x1b646a[_0xee08('0x54')]);return _0x1b646a;});};exports[_0xee08('0x7b')]=function(_0x2f0bf6,_0x50db2a,_0x3f99f4,_0x19f3d6,_0x35f221,_0x527851){var _0x21a4ab=path[_0xee08('0x28')](__dirname,_0xee08('0x37'),rs[_0xee08('0x38')](0x4)+'.mp3');var _0x656d02;return aws[_0xee08('0x7c')](_0x2f0bf6,_0x50db2a,_0x3f99f4,_0x19f3d6,_0x35f221,_0x527851,_0x21a4ab)[_0xee08('0x36')](function(){_0x656d02=path[_0xee08('0x28')](__dirname,'tmp',rs[_0xee08('0x38')](0x4)+_0xee08('0x29'));return convertFile(_0x21a4ab,_0x656d02);})[_0xee08('0x36')](function(){try{fs['unlink'](_0x21a4ab);fs[_0xee08('0x2c')](_0x656d02,_0xee08('0x2d'));}catch(_0x3b2280){logger[_0xee08('0x18')](_0x3b2280);}return _0x656d02[_0xee08('0x3c')]('.')[0x0];});};exports['awsLex']=function(_0x9a4730,_0x3b09c9,_0x464ad3,_0x424ccb,_0x1a2469,_0x3ca25f){return aws[_0xee08('0x7d')](_0x9a4730,_0x3b09c9,_0x464ad3,_0x424ccb,_0x1a2469,_0x3ca25f)['then'](function(_0x529561){logger['info'](JSON[_0xee08('0x42')](_0x529561));return _0x529561;});};exports[_0xee08('0x7e')]=function(_0x2d231e,_0x19041a,_0x14af71,_0x233436){var _0xcd337f=util[_0xee08('0x7f')](_0xee08('0x80'),ISPEECH_API,_0x2d231e,encodeURIComponent(_0x19041a),_0x14af71,_0x233436);var _0x5f41e3=path[_0xee08('0x28')](__dirname,'tmp',rs['generate'](0x4)+_0xee08('0x39'));var _0x2cad17;return downloadFile(_0xcd337f,_0x5f41e3)['then'](function(){_0x2cad17=path[_0xee08('0x28')](__dirname,'tmp',rs[_0xee08('0x38')](0x4)+_0xee08('0x29'));return convertFile(_0x5f41e3,_0x2cad17);})[_0xee08('0x36')](function(){try{fs[_0xee08('0x21')](_0x5f41e3);fs['chmodSync'](_0x2cad17,_0xee08('0x2d'));}catch(_0x2adbc4){logger[_0xee08('0x18')](_0x2adbc4);}return _0x2cad17['split']('.')[0x0];});};exports[_0xee08('0x81')]=function(_0x25f350,_0x219ec2,_0x20a6e3,_0x492fbc){var _0x41cf45=util[_0xee08('0x7f')](_0xee08('0x82'),ISPEECH_API,_0x219ec2,_0x20a6e3,base64Encode(_0x25f350),_0x492fbc?util[_0xee08('0x7f')]('model=%s',encodeURIComponent(_0x492fbc)):_0xee08('0x83'));return uploadFile(_0x41cf45)[_0xee08('0x36')](function(_0x766363){return querystring[_0xee08('0xa')](_0x766363);});};exports['sestekNDA']=function(_0x5afaf9,_0x5d93f8){return sestek['nda'](_0x5afaf9,_0x5d93f8)[_0xee08('0x36')](function(_0x560d84){logger[_0xee08('0x1e')](JSON[_0xee08('0x42')](_0x560d84));var _0x208d5c={'speech':_0x560d84[_0xee08('0x84')],'action':_0x560d84[_0xee08('0x85')]?_0x560d84[_0xee08('0x85')][_0xee08('0x86')]:undefined,'actiondata':_0x560d84['channelData']?_0x560d84['channelData']['CustomActionData']:undefined};if(_0x560d84[_0xee08('0x85')]&&_0x560d84[_0xee08('0x85')][_0xee08('0x87')]){return base64Decode(_0x560d84['channelData'][_0xee08('0x87')][_0xee08('0x88')],path[_0xee08('0x28')](__dirname,'tmp',rs[_0xee08('0x38')](0x4)+_0xee08('0x29')))['then'](function(_0x29832c){_0x208d5c[_0xee08('0x89')]=_0x29832c;return _0x208d5c;});}return _0x208d5c;});};exports[_0xee08('0x8a')]=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 a33dae8..f17f707 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 _0x885f=['exports','./nda'];(function(_0x3cd451,_0x26e81a){var _0x571ce6=function(_0x27af9e){while(--_0x27af9e){_0x3cd451['push'](_0x3cd451['shift']());}};_0x571ce6(++_0x26e81a);}(_0x885f,0x16d));var _0xf885=function(_0x471273,_0x1587f1){_0x471273=_0x471273-0x0;var _0x56c63e=_0x885f[_0x471273];return _0x56c63e;};var nda=require(_0xf885('0x0'));module[_0xf885('0x1')]={'nda':nda}; \ No newline at end of file +var _0x19d1=['./nda','exports'];(function(_0x5ec4dc,_0x3b65de){var _0x5cda40=function(_0x1e02bd){while(--_0x1e02bd){_0x5ec4dc['push'](_0x5ec4dc['shift']());}};_0x5cda40(++_0x3b65de);}(_0x19d1,0x164));var _0x119d=function(_0x219995,_0x474954){_0x219995=_0x219995-0x0;var _0x1da800=_0x19d1[_0x219995];return _0x1da800;};var nda=require(_0x119d('0x0'));module[_0x119d('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 3a0511d..939a665 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 _0x324f=['../../../../../config/logger','POST','ndauth_url','/token','username','password','then','resolve','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','message','Nda','uniqueid','callerid','dnid','extension','text','Bearer\x20','access_token','project','body','channelData','ProjectName','audio/wav','CustomAction','custom_action_data','info','stringify','request-promise','url'];(function(_0x2136a6,_0x35af63){var _0x55b948=function(_0x288a75){while(--_0x288a75){_0x2136a6['push'](_0x2136a6['shift']());}};_0x55b948(++_0x35af63);}(_0x324f,0x94));var _0xf324=function(_0x47a46f,_0x563b75){_0x47a46f=_0x47a46f-0x0;var _0x4a6be1=_0x324f[_0x47a46f];return _0x4a6be1;};'use strict';var rp=require(_0xf324('0x0'));var url=require(_0xf324('0x1'));var logger=require(_0xf324('0x2'))('agi');module['exports']=function(_0x1f9dd7,_0x48f6ef){var _0x2f11f0={'method':_0xf324('0x3'),'uri':url['resolve'](_0x48f6ef[_0xf324('0x4')],_0xf324('0x5')),'form':{'grant_type':'password','username':_0x48f6ef[_0xf324('0x6')],'password':_0x48f6ef[_0xf324('0x7')]},'json':!![]};return rp(_0x2f11f0)[_0xf324('0x8')](function(_0x2290b7){var _0x408b34={'method':_0xf324('0x3'),'uri':url[_0xf324('0x9')](_0x48f6ef[_0xf324('0xa')],_0xf324('0xb')),'body':{'type':_0x48f6ef['ndaactivity_type']||_0xf324('0xc'),'channelId':_0xf324('0xd'),'conversation':{'id':_0x1f9dd7[_0xf324('0xe')]},'from':{'id':_0x1f9dd7[_0xf324('0xf')],'name':_0x1f9dd7['calleridname']},'recipient':{'id':_0x1f9dd7[_0xf324('0x10')],'name':_0x1f9dd7[_0xf324('0x11')]},'text':_0x48f6ef[_0xf324('0x12')],'channelData':{}},'headers':{'Authorization':_0xf324('0x13')+_0x2290b7[_0xf324('0x14')]},'json':!![]};if(_0x48f6ef[_0xf324('0x15')]){_0x408b34[_0xf324('0x16')][_0xf324('0x17')][_0xf324('0x18')]=_0x48f6ef[_0xf324('0x15')];}if(_0x48f6ef['ndagenerate_audio']=='1'){_0x408b34['body']['channelData']['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xf324('0x19')};}if(_0x48f6ef['custom_action']){_0x408b34[_0xf324('0x16')]['channelData'][_0xf324('0x1a')]=_0x48f6ef['custom_action'];if(_0x48f6ef[_0xf324('0x1b')]){_0x408b34[_0xf324('0x16')][_0xf324('0x17')]['CustomActionData']=_0x48f6ef[_0xf324('0x1b')];}}logger[_0xf324('0x1c')](JSON[_0xf324('0x1d')](_0x408b34));return rp(_0x408b34);});}; \ No newline at end of file +var _0x3a25=['agi','exports','POST','resolve','ndauth_url','/token','password','username','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','callerid','calleridname','text','Bearer\x20','channelData','ProjectName','project','AudioOutputSettings','audio/wav','custom_action','body','CustomAction','custom_action_data','info','stringify','request-promise','url','../../../../../config/logger'];(function(_0x4710b0,_0x2b0c81){var _0x41372e=function(_0x563611){while(--_0x563611){_0x4710b0['push'](_0x4710b0['shift']());}};_0x41372e(++_0x2b0c81);}(_0x3a25,0x15d));var _0x53a2=function(_0x5f4220,_0x29cdb6){_0x5f4220=_0x5f4220-0x0;var _0x27f154=_0x3a25[_0x5f4220];return _0x27f154;};'use strict';var rp=require(_0x53a2('0x0'));var url=require(_0x53a2('0x1'));var logger=require(_0x53a2('0x2'))(_0x53a2('0x3'));module[_0x53a2('0x4')]=function(_0x8efef2,_0x119389){var _0x1f138b={'method':_0x53a2('0x5'),'uri':url[_0x53a2('0x6')](_0x119389[_0x53a2('0x7')],_0x53a2('0x8')),'form':{'grant_type':_0x53a2('0x9'),'username':_0x119389[_0x53a2('0xa')],'password':_0x119389[_0x53a2('0x9')]},'json':!![]};return rp(_0x1f138b)['then'](function(_0x3ee956){var _0x5dc70e={'method':_0x53a2('0x5'),'uri':url[_0x53a2('0x6')](_0x119389[_0x53a2('0xb')],_0x53a2('0xc')),'body':{'type':_0x119389[_0x53a2('0xd')]||_0x53a2('0xe'),'channelId':_0x53a2('0xf'),'conversation':{'id':_0x8efef2[_0x53a2('0x10')]},'from':{'id':_0x8efef2[_0x53a2('0x11')],'name':_0x8efef2[_0x53a2('0x12')]},'recipient':{'id':_0x8efef2['dnid'],'name':_0x8efef2['extension']},'text':_0x119389[_0x53a2('0x13')],'channelData':{}},'headers':{'Authorization':_0x53a2('0x14')+_0x3ee956['access_token']},'json':!![]};if(_0x119389['project']){_0x5dc70e['body'][_0x53a2('0x15')][_0x53a2('0x16')]=_0x119389[_0x53a2('0x17')];}if(_0x119389['ndagenerate_audio']=='1'){_0x5dc70e['body']['channelData'][_0x53a2('0x18')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x53a2('0x19')};}if(_0x119389[_0x53a2('0x1a')]){_0x5dc70e[_0x53a2('0x1b')]['channelData'][_0x53a2('0x1c')]=_0x119389[_0x53a2('0x1a')];if(_0x119389[_0x53a2('0x1d')]){_0x5dc70e[_0x53a2('0x1b')][_0x53a2('0x15')]['CustomActionData']=_0x119389['custom_action_data'];}}logger[_0x53a2('0x1e')](JSON[_0x53a2('0x1f')](_0x5dc70e));return rp(_0x5dc70e);});}; \ 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 640cc55..374edc3 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 _0x0801=['./lib/api','exports'];(function(_0x166742,_0x55520c){var _0xb7814a=function(_0x18feaf){while(--_0x18feaf){_0x166742['push'](_0x166742['shift']());}};_0xb7814a(++_0x55520c);}(_0x0801,0x1c2));var _0x1080=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x0801[_0x422905];return _0x33dc6c;};'use strict';var asr=require(_0x1080('0x0'));module[_0x1080('0x1')]=function(_0x12f26c,_0x4c6a5e,_0x895365,_0x4b2f4a){return asr(_0x12f26c,_0x4c6a5e,_0x895365,_0x4b2f4a);}; \ No newline at end of file +var _0xee86=['exports'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0xee86,0xb9));var _0x6ee8=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0xee86[_0x4b2436];return _0x4f5ab2;};'use strict';var asr=require('./lib/api');module[_0x6ee8('0x0')]=function(_0x2834bf,_0x55e90d,_0x22cb7c,_0x393c47){return asr(_0x2834bf,_0x55e90d,_0x22cb7c,_0x393c47);}; \ 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 060cfc0..4706320 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 _0x7478=['Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','open','bluebird','moment','crypto','agi','exports','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','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','close','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','result','final','info','Tilde\x20ASR\x20hypoteses','stringify','hypotheses','likelihood','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.'];(function(_0x14bf3b,_0x47031a){var _0x4fb45b=function(_0x5dc661){while(--_0x5dc661){_0x14bf3b['push'](_0x14bf3b['shift']());}};_0x4fb45b(++_0x47031a);}(_0x7478,0x16c));var _0x8747=function(_0x1b855f,_0x27682c){_0x1b855f=_0x1b855f-0x0;var _0x305146=_0x7478[_0x1b855f];return _0x305146;};'use strict';var BPromise=require(_0x8747('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x8747('0x1'));var crypto=require(_0x8747('0x2'));var logger=require('../../../../../../config/logger')(_0x8747('0x3'));module[_0x8747('0x4')]=function(_0x5c655a,_0x3ce916,_0x331882,_0xac6e18){return new BPromise(function(_0x2bf3f1,_0x1ecf42){logger['info']('Tilde\x20URI',_0xac6e18||_0x8747('0x5'));var _0x5d798d=new WebSocket(_0xac6e18||_0x8747('0x5'),{'perMessageDeflate':![]});var _0x16eb7b='';var _0x1c0e51='0';var _0x454fe='1';var _0x524921=_0x8747('0x6');function _0x4c1b67(_0x333259){var _0x55e19a=crypto[_0x8747('0x7')](_0x8747('0x8'));_0x55e19a['update'](_0x333259);return _0x55e19a[_0x8747('0x9')](_0x8747('0xa'));}function _0x236edf(){try{logger['info'](_0x8747('0xb'));var _0x1e441b=moment()[_0x8747('0xc')]();var _0x4cf16e=_0x4c1b67(_0x1e441b+_0x3ce916+_0x331882);_0x5d798d[_0x8747('0xd')](JSON['stringify']({'appID':_0x3ce916,'timestamp':_0x1e441b,'appKey':_0x4cf16e}));var _0x2693fa=fs['createReadStream'](_0x5c655a);_0x2693fa['on']('data',function(_0x368ea7){_0x5d798d[_0x8747('0xd')](_0x368ea7);});_0x2693fa['on'](_0x8747('0xe'),function(){_0x5d798d[_0x8747('0xd')](_0x8747('0xf'));});}catch(_0x9c47fd){logger[_0x8747('0x10')](_0x8747('0x11'),JSON['stringify'](_0x9c47fd));_0x5d798d[_0x8747('0x12')]();}}function _0x561ab0(_0x135a37){try{if(_0x135a37){var _0x46e3b3=JSON[_0x8747('0x13')](_0x135a37);switch(_0x46e3b3['status']){case 0x0:if(_0x46e3b3[_0x8747('0x14')]){if(_0x46e3b3[_0x8747('0x14')][_0x8747('0x15')]){logger[_0x8747('0x16')](_0x8747('0x17'),JSON[_0x8747('0x18')](_0x46e3b3['result'][_0x8747('0x19')]));_0x16eb7b=_0x46e3b3['result'][_0x8747('0x19')][0x0]['transcript'];_0x1c0e51=_0x46e3b3[_0x8747('0x14')][_0x8747('0x19')][0x0][_0x8747('0x1a')];_0x454fe='0';_0x524921=_0x8747('0x1b');_0x5d798d[_0x8747('0x12')]();}}break;case 0x1:logger['info'](_0x8747('0x6'));_0x454fe='1';_0x524921='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0x8747('0x16')](_0x8747('0x1c'));_0x454fe='2';_0x524921=_0x8747('0x1c');break;case 0x9:logger[_0x8747('0x16')](_0x8747('0x1d'));_0x454fe='9';_0x524921=_0x8747('0x1d');break;case 0xa:logger[_0x8747('0x16')](_0x8747('0x1e'));_0x454fe='10';_0x524921=_0x8747('0x1e');break;case 0xb:logger[_0x8747('0x16')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x454fe='11';_0x524921=_0x8747('0x1f');}}}catch(_0x8485ac){logger[_0x8747('0x10')]('Tilde\x20ASR\x20parse\x20error',JSON[_0x8747('0x18')](_0x8485ac));_0x5d798d[_0x8747('0x12')]();}}function _0xa0c976(){logger['info'](_0x8747('0x20'));_0x2bf3f1({'transcript':_0x16eb7b,'confidence':_0x1c0e51,'status':_0x454fe,'status_message':_0x524921});}function _0x5c468b(_0x29a94a){logger[_0x8747('0x10')](_0x8747('0x21'));if(!_[_0x8747('0x22')](_0x29a94a)){logger[_0x8747('0x10')](_['isObject'](_0x29a94a)?JSON[_0x8747('0x18')](_0x29a94a):_0x29a94a);}}_0x5d798d['on'](_0x8747('0x23'),_0x236edf);_0x5d798d['on']('message',_0x561ab0);_0x5d798d['on'](_0x8747('0xe'),_0xa0c976);_0x5d798d['on'](_0x8747('0x10'),_0x5c468b);});}; \ No newline at end of file +var _0xc0c5=['Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','error','isObject','bluebird','agi','exports','info','Tilde\x20URI','createHash','sha1','update','hex','Open\x20Tilde\x20ASR\x20socket','unix','createReadStream','data','send','close','terminate','status','result','final','Tilde\x20ASR\x20hypoteses','stringify','hypotheses','transcript','likelihood','Success.','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0xc0c5,0x191));var _0x5c0c=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xc0c5[_0x5ddb1c];return _0x354adc;};'use strict';var BPromise=require(_0x5c0c('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require('crypto');var logger=require('../../../../../../config/logger')(_0x5c0c('0x1'));module[_0x5c0c('0x2')]=function(_0x2d7e8e,_0x405e16,_0x381ac7,_0x39ae2e){return new BPromise(function(_0x104299,_0x185e55){logger[_0x5c0c('0x3')](_0x5c0c('0x4'),_0x39ae2e||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x47be9d=new WebSocket(_0x39ae2e||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x4d40c5='';var _0x3093e8='0';var _0x1c2e66='1';var _0x291d9c='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x4f60b9(_0x2b0895){var _0x3e0855=crypto[_0x5c0c('0x5')](_0x5c0c('0x6'));_0x3e0855[_0x5c0c('0x7')](_0x2b0895);return _0x3e0855['digest'](_0x5c0c('0x8'));}function _0x22872f(){try{logger[_0x5c0c('0x3')](_0x5c0c('0x9'));var _0x23fb06=moment()[_0x5c0c('0xa')]();var _0x51ee90=_0x4f60b9(_0x23fb06+_0x405e16+_0x381ac7);_0x47be9d['send'](JSON['stringify']({'appID':_0x405e16,'timestamp':_0x23fb06,'appKey':_0x51ee90}));var _0xdf8818=fs[_0x5c0c('0xb')](_0x2d7e8e);_0xdf8818['on'](_0x5c0c('0xc'),function(_0x5ebfc9){_0x47be9d[_0x5c0c('0xd')](_0x5ebfc9);});_0xdf8818['on'](_0x5c0c('0xe'),function(){_0x47be9d['send']('EOS');});}catch(_0x1e47ec){logger['error']('Tilde\x20ASR\x20send\x20error',JSON['stringify'](_0x1e47ec));_0x47be9d[_0x5c0c('0xf')]();}}function _0x48516e(_0x4caae4){try{if(_0x4caae4){var _0x130a76=JSON['parse'](_0x4caae4);switch(_0x130a76[_0x5c0c('0x10')]){case 0x0:if(_0x130a76[_0x5c0c('0x11')]){if(_0x130a76[_0x5c0c('0x11')][_0x5c0c('0x12')]){logger[_0x5c0c('0x3')](_0x5c0c('0x13'),JSON[_0x5c0c('0x14')](_0x130a76[_0x5c0c('0x11')][_0x5c0c('0x15')]));_0x4d40c5=_0x130a76[_0x5c0c('0x11')]['hypotheses'][0x0][_0x5c0c('0x16')];_0x3093e8=_0x130a76[_0x5c0c('0x11')]['hypotheses'][0x0][_0x5c0c('0x17')];_0x1c2e66='0';_0x291d9c=_0x5c0c('0x18');_0x47be9d[_0x5c0c('0xf')]();}}break;case 0x1:logger[_0x5c0c('0x3')](_0x5c0c('0x19'));_0x1c2e66='1';_0x291d9c=_0x5c0c('0x19');break;case 0x2:logger[_0x5c0c('0x3')](_0x5c0c('0x1a'));_0x1c2e66='2';_0x291d9c=_0x5c0c('0x1a');break;case 0x9:logger['info'](_0x5c0c('0x1b'));_0x1c2e66='9';_0x291d9c=_0x5c0c('0x1b');break;case 0xa:logger[_0x5c0c('0x3')](_0x5c0c('0x1c'));_0x1c2e66='10';_0x291d9c='Authentication\x20failed.';break;case 0xb:logger[_0x5c0c('0x3')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x1c2e66='11';_0x291d9c=_0x5c0c('0x1d');}}}catch(_0x5e26f8){logger['error'](_0x5c0c('0x1e'),JSON['stringify'](_0x5e26f8));_0x47be9d[_0x5c0c('0xf')]();}}function _0xa7eb2(){logger[_0x5c0c('0x3')]('Close\x20Tilde\x20ASR\x20socket');_0x104299({'transcript':_0x4d40c5,'confidence':_0x3093e8,'status':_0x1c2e66,'status_message':_0x291d9c});}function _0x168da4(_0xc56b38){logger[_0x5c0c('0x1f')]('Error\x20Tilde\x20ASR\x20socket');if(!_['isNil'](_0xc56b38)){logger[_0x5c0c('0x1f')](_[_0x5c0c('0x20')](_0xc56b38)?JSON[_0x5c0c('0x14')](_0xc56b38):_0xc56b38);}}_0x47be9d['on']('open',_0x22872f);_0x47be9d['on']('message',_0x48516e);_0x47be9d['on'](_0x5c0c('0xe'),_0xa7eb2);_0x47be9d['on']('error',_0x168da4);});}; \ 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 4e434d3..5c38aa1 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 _0x5ad1=['./asr'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x5ad1,0x9e));var _0x15ad=function(_0x17b8ea,_0x24d8ad){_0x17b8ea=_0x17b8ea-0x0;var _0x5c60ec=_0x5ad1[_0x17b8ea];return _0x5c60ec;};var asr=require(_0x15ad('0x0'));module['exports']={'asr':asr}; \ No newline at end of file +var _0xd6e9=['exports','./asr'];(function(_0x2d19d5,_0x2e3619){var _0xa1e9cc=function(_0x4115ba){while(--_0x4115ba){_0x2d19d5['push'](_0x2d19d5['shift']());}};_0xa1e9cc(++_0x2e3619);}(_0xd6e9,0x171));var _0x9d6e=function(_0x1dfa09,_0x461d60){_0x1dfa09=_0x1dfa09-0x0;var _0x474930=_0xd6e9[_0x1dfa09];return _0x474930;};var asr=require(_0x9d6e('0x0'));module[_0x9d6e('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 8d74b61..dc42c8f 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 _0x4e1b=['call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening','getConnections','E_AGI_SERVER_VOICE_DISABLED','destroy','ready','E_AGI_SERVER_ERROR','code','close','E_AGI_SERVER_CLOSE','nextTick','inherits','util','net','events','./error','./channel','127.0.0.1'];(function(_0x1f4034,_0x18b0dc){var _0x2f6ddb=function(_0x116bac){while(--_0x116bac){_0x1f4034['push'](_0x1f4034['shift']());}};_0x2f6ddb(++_0x18b0dc);}(_0x4e1b,0x10e));var _0xb4e1=function(_0x4bedce,_0x265ebf){_0x4bedce=_0x4bedce-0x0;var _0x4fd2fb=_0x4e1b[_0x4bedce];return _0x4fd2fb;};'use strict';var util=require(_0xb4e1('0x0'));var net=require(_0xb4e1('0x1'));var EventEmitter=require(_0xb4e1('0x2'))['EventEmitter'];var AGIError=require(_0xb4e1('0x3'));var AGIChannel=require(_0xb4e1('0x4'));var AGIServer=function(_0x46089a,_0x465e94,_0x30a381){var _0x2efdce=this,_0x46089a=_0x46089a||0x11dd,_0x465e94=_0x465e94||_0xb4e1('0x5'),_0x423bfb=null,_0x5781b8=0x0;EventEmitter[_0xb4e1('0x6')](_0x2efdce);function _0xa3c693(){if(!_0x46089a){_0x2efdce[_0xb4e1('0x7')](_0xb4e1('0x8'),new AGIError(_0xb4e1('0x9')));return![];}_0x423bfb=net[_0xb4e1('0xa')]();_0x423bfb[_0xb4e1('0xb')](_0x46089a,_0x465e94);_0x423bfb['on'](_0xb4e1('0xc'),function(){_0x2efdce[_0xb4e1('0x7')](_0xb4e1('0xc'));});_0x423bfb['on']('connection',function(_0x43680d){_0x423bfb[_0xb4e1('0xd')](function(_0x380ac3,_0xf3410){if(_0x380ac3){_0x2efdce[_0xb4e1('0x7')](_0xb4e1('0x8'),new AGIError('E_AGI_SERVER_ERROR',_0x380ac3));}else if(_0x30a381&&_0x30a381<0x0){_0x2efdce[_0xb4e1('0x7')](_0xb4e1('0x8'),new AGIError(_0xb4e1('0xe')));_0x43680d[_0xb4e1('0xf')]();}else if(_0x30a381&&_0x30a381>0x0&&_0x30a381<_0xf3410){_0x5781b8+=0x1;_0x2efdce['emit'](_0xb4e1('0x8'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x5781b8));_0x43680d[_0xb4e1('0xf')]();}else{var _0x4fceed=new AGIChannel(_0x43680d);_0x4fceed['on'](_0xb4e1('0x10'),function(){_0x2efdce[_0xb4e1('0x7')]('connection',_0x4fceed);});}});});_0x423bfb['on'](_0xb4e1('0x8'),function(_0x351825){_0x2efdce[_0xb4e1('0x7')](_0xb4e1('0x8'),new AGIError(_0xb4e1('0x11'),_0x351825[_0xb4e1('0x12')]));});_0x423bfb['on']('close',function(){_0x2efdce[_0xb4e1('0x7')](_0xb4e1('0x13'),new AGIError(_0xb4e1('0x14')));});}process[_0xb4e1('0x15')](function(){_0xa3c693();});};util[_0xb4e1('0x16')](AGIServer,EventEmitter);module['exports']=function(_0xa5ac76,_0x1b41ec,_0x1169db){return new AGIServer(_0xa5ac76,_0x1b41ec,_0x1169db);}; \ No newline at end of file +var _0xb7db=['call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','code','close','E_AGI_SERVER_CLOSE','nextTick','util','./error','./channel','127.0.0.1'];(function(_0x38e35c,_0x2a44a6){var _0x4829c7=function(_0x5a963d){while(--_0x5a963d){_0x38e35c['push'](_0x38e35c['shift']());}};_0x4829c7(++_0x2a44a6);}(_0xb7db,0x18b));var _0xbb7d=function(_0x2e5e92,_0x400657){_0x2e5e92=_0x2e5e92-0x0;var _0x38490d=_0xb7db[_0x2e5e92];return _0x38490d;};'use strict';var util=require(_0xbb7d('0x0'));var net=require('net');var EventEmitter=require('events')['EventEmitter'];var AGIError=require(_0xbb7d('0x1'));var AGIChannel=require(_0xbb7d('0x2'));var AGIServer=function(_0x4a35c6,_0x251952,_0x1b7d53){var _0x591a81=this,_0x4a35c6=_0x4a35c6||0x11dd,_0x251952=_0x251952||_0xbb7d('0x3'),_0x40fb64=null,_0x3a6fc3=0x0;EventEmitter[_0xbb7d('0x4')](_0x591a81);function _0x17a558(){if(!_0x4a35c6){_0x591a81[_0xbb7d('0x5')](_0xbb7d('0x6'),new AGIError(_0xbb7d('0x7')));return![];}_0x40fb64=net[_0xbb7d('0x8')]();_0x40fb64[_0xbb7d('0x9')](_0x4a35c6,_0x251952);_0x40fb64['on'](_0xbb7d('0xa'),function(){_0x591a81[_0xbb7d('0x5')](_0xbb7d('0xa'));});_0x40fb64['on'](_0xbb7d('0xb'),function(_0x1df9a4){_0x40fb64['getConnections'](function(_0xb14fd,_0x1f9005){if(_0xb14fd){_0x591a81[_0xbb7d('0x5')]('error',new AGIError(_0xbb7d('0xc'),_0xb14fd));}else if(_0x1b7d53&&_0x1b7d53<0x0){_0x591a81[_0xbb7d('0x5')](_0xbb7d('0x6'),new AGIError(_0xbb7d('0xd')));_0x1df9a4[_0xbb7d('0xe')]();}else if(_0x1b7d53&&_0x1b7d53>0x0&&_0x1b7d53<_0x1f9005){_0x3a6fc3+=0x1;_0x591a81[_0xbb7d('0x5')](_0xbb7d('0x6'),new AGIError(_0xbb7d('0xf'),_0x3a6fc3));_0x1df9a4[_0xbb7d('0xe')]();}else{var _0x27be58=new AGIChannel(_0x1df9a4);_0x27be58['on'](_0xbb7d('0x10'),function(){_0x591a81[_0xbb7d('0x5')](_0xbb7d('0xb'),_0x27be58);});}});});_0x40fb64['on']('error',function(_0x3464a8){_0x591a81['emit'](_0xbb7d('0x6'),new AGIError(_0xbb7d('0xc'),_0x3464a8[_0xbb7d('0x11')]));});_0x40fb64['on'](_0xbb7d('0x12'),function(){_0x591a81['emit'](_0xbb7d('0x12'),new AGIError(_0xbb7d('0x13')));});}process[_0xbb7d('0x14')](function(){_0x17a558();});};util['inherits'](AGIServer,EventEmitter);module['exports']=function(_0x2ad36a,_0x20cc7e,_0x81637f){return new AGIServer(_0x2ad36a,_0x20cc7e,_0x81637f);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index da7c4df..a3848cc 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 _0xd0bf=['toUpperCase','speech','out','Dialogflow\x20Result\x20%s','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','client_email','no\x20private_key\x20configured','dialogflowV2_language','no\x20anguage\x20configured','providerResponse','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','no\x20ndauth\x20url\x20configured','username','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','Sestek\x20NDA\x20%s\x20file\x20created','audiofile','streamFile','unlink','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','opts','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','getSound','no\x20file\x20audio\x20found','variable_id','getData','maxdigit','test','mindigit','no\x20variable\x20found','hiddendigitsnum','generate','first','substr','getsecretdigits','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','.wav','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','wav','beep','NOBEEP','recordFile','google\x20%s\x20file\x20created','GoogleASR\x20Result\x20%s','tildeasr','tilde\x20%s\x20file\x20created','TildeASR\x20Result\x20%s','gotoc','continueAt','extension','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20intervals\x20found','IFTIME\x20%s\x20%s','extra','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','%s/recordings/%s','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','intKey','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','no\x20find\x20by\x20configured','findBy','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','logout','FIND\x20AGENT\x20%s\x20BY\x20%s','success','failure','math','operation','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','response','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','Enter\x20in\x20QUEUE\x20(%s)\x20block','no\x20queue\x20selected','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','macro','gosub','position','QUEUE','record','recordingFormat','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','variable\x20%s\x20set','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','digits','saynumber','sayNumber','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','\x22%s\x22\x20<%s>','bcc','subject','service','host','port','secure','authentication','auth','user','template_id','debug','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','getSmsAccount','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','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','no\x20subproject\x20selected','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','shellCommand','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','path','util','lodash','shelljs','odbc','randomstring','moment','mustache','../../config/logger','../../config/environment','rawHeaders','rawBody','menu','getdigits','channel','rpc','mailRpc','getVariable','getVariableById','name','catch','prototype','getVoiceQueue','getVoiceQueueById','then','getSquareProject','getSquareProjectById','getUserById','getTrunk','getTrunkById','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervalById','IntervalId','map','Intervals','interval','format','%s/sounds/converted/%s','getQueryOdbc','open','ODBC\x20connection\x20successfully','query','info','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','error','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','createSquareRecording','callerid','context','priority','dnid','createSquareMessage','createCmContact','isNil','callback_','isEmpty','lastName','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','%s/%s@from-sip/n','LOCAL','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','ssmlGender','MALE','audioEncoding','MP3','googleTTS','restAPI','url','method','timeout','number','includes','POST','PUT','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','body','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','private_key','sestekNDA','ispeechTTS','ispeech_tts_language','en-US','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','Amy','awsLex','aws_bot_name','googleASR','google_asr_language','appid','appsecret','clear','clone','hasOwnProperty','isString','replaceAllVariables','recursiveNodeIndex','isArray','length','saveRestApiResult','isPlainObject','%s.%s','setVariable','split','replaceAll','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','retry','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','agi','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','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','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','getSquareOdbc','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','no\x20variable\x20selected\x20for\x20the\x20result','forEach','dial','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','getUser','no\x20user\x20found','DIAL','SIP/%s','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s'];(function(_0x4a463a,_0x508ec9){var _0x441834=function(_0x4fcbf6){while(--_0x4fcbf6){_0x4a463a['push'](_0x4a463a['shift']());}};_0x441834(++_0x508ec9);}(_0xd0bf,0xd5));var _0xfd0b=function(_0xd732cd,_0x300d18){_0xd732cd=_0xd732cd-0x0;var _0x5eadc6=_0xd0bf[_0xd732cd];return _0x5eadc6;};'use strict';var fs=require('fs');var path=require(_0xfd0b('0x0'));var util=require(_0xfd0b('0x1'));var _=require(_0xfd0b('0x2'));var sh=require(_0xfd0b('0x3'));var odbc=require(_0xfd0b('0x4'))();var rs=require(_0xfd0b('0x5'));var moment=require(_0xfd0b('0x6'));var Mustache=require(_0xfd0b('0x7'));var rp=require('request-promise');var logger=require(_0xfd0b('0x8'))('agi');var config=require(_0xfd0b('0x9'));var scripts=require('./scripts');var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0xfd0b('0xa'),_0xfd0b('0xb')];var verticesWithRetry=[_0xfd0b('0xc'),_0xfd0b('0xd'),'getsecretdigits'];var AGIVertices=function(_0x5cf53c,_0x4f0387,_0x497004){this[_0xfd0b('0xe')]=_0x5cf53c;this[_0xfd0b('0xf')]=_0x4f0387;this[_0xfd0b('0x10')]=_0x497004;};AGIVertices['prototype'][_0xfd0b('0x11')]=function(_0xe5d906,_0x32cc95){this[_0xfd0b('0xf')][_0xfd0b('0x12')](_0xe5d906)['then'](function(_0x26c89d){_0x32cc95(null,_0x26c89d?_0x26c89d[_0xfd0b('0x13')]:![]);})[_0xfd0b('0x14')](function(_0x5b2477){_0x32cc95(_0x5b2477);});};AGIVertices[_0xfd0b('0x15')][_0xfd0b('0x16')]=function(_0x1de62d,_0x384134){this[_0xfd0b('0xf')][_0xfd0b('0x17')](_0x1de62d)[_0xfd0b('0x18')](function(_0xf4fbc9){_0x384134(null,_0xf4fbc9?_0xf4fbc9[_0xfd0b('0x13')]:![]);})['catch'](function(_0x1cc100){_0x384134(_0x1cc100);});};AGIVertices[_0xfd0b('0x15')][_0xfd0b('0x19')]=function(_0x490706,_0x272d98){this[_0xfd0b('0xf')][_0xfd0b('0x1a')](_0x490706)[_0xfd0b('0x18')](function(_0x3c632c){_0x272d98(null,_0x3c632c?_0x3c632c[_0xfd0b('0x13')]:![]);})[_0xfd0b('0x14')](function(_0x4206ca){_0x272d98(_0x4206ca);});};AGIVertices['prototype']['getSquareOdbc']=function(_0x52e960,_0x2aecd9){this[_0xfd0b('0xf')]['getSquareOdbcById'](_0x52e960)[_0xfd0b('0x18')](function(_0x47c6a5){_0x2aecd9(null,_0x47c6a5?_0x47c6a5['dsn']:![]);})[_0xfd0b('0x14')](function(_0x1732bc){_0x2aecd9(_0x1732bc);});};AGIVertices[_0xfd0b('0x15')]['getUser']=function(_0x4acf53,_0x3dbcb6){this[_0xfd0b('0xf')][_0xfd0b('0x1b')](_0x4acf53)['then'](function(_0x56f5e0){_0x3dbcb6(null,_0x56f5e0?_0x56f5e0[_0xfd0b('0x13')]:![]);})[_0xfd0b('0x14')](function(_0x22fe80){_0x3dbcb6(_0x22fe80);});};AGIVertices[_0xfd0b('0x15')][_0xfd0b('0x1c')]=function(_0x292a63,_0x21d6d3){this['rpc'][_0xfd0b('0x1d')](_0x292a63)[_0xfd0b('0x18')](function(_0xa4b0be){_0x21d6d3(null,_0xa4b0be?_0xa4b0be['name']:![]);})[_0xfd0b('0x14')](function(_0x3adcd5){_0x21d6d3(_0x3adcd5);});};AGIVertices[_0xfd0b('0x15')]['getSound']=function(_0x46b441,_0x4039f5){var _0x2ff377=this;this['rpc'][_0xfd0b('0x1e')](_0x46b441)[_0xfd0b('0x18')](function(_0x583ce0){_0x4039f5(null,_0x583ce0?_0x2ff377[_0xfd0b('0x1f')](_0x583ce0[_0xfd0b('0x20')]):![]);})[_0xfd0b('0x14')](function(_0x5c3a5c){_0x4039f5(_0x5c3a5c);});};AGIVertices[_0xfd0b('0x15')][_0xfd0b('0x21')]=function(_0x2cfa02,_0x493200){this['rpc'][_0xfd0b('0x22')](_0x2cfa02)[_0xfd0b('0x18')](function(_0x2ce3d0){_0x493200(null,_0x2ce3d0?_0x2ce3d0:![]);})[_0xfd0b('0x14')](function(_0x5d40a3){_0x493200(_0x5d40a3);});};AGIVertices[_0xfd0b('0x15')][_0xfd0b('0x23')]=function(_0x516e07,_0x14e437,_0x54dc5c){this[_0xfd0b('0x10')]['sendMailMessage'](_0x516e07,_0x14e437)[_0xfd0b('0x18')](function(){_0x54dc5c(null);})['catch'](function(_0x4a79a4){_0x54dc5c(_0x4a79a4);});};AGIVertices['prototype']['getIntervals']=function(_0x4cc625,_0x443660){this[_0xfd0b('0xf')][_0xfd0b('0x24')](_0x4cc625)[_0xfd0b('0x18')](function(_0x205947){if(_0x205947){if(_0x205947[_0xfd0b('0x25')]){_0x443660(null,[_0x205947['interval']]);}else{_0x443660(null,_[_0xfd0b('0x26')](_0x205947[_0xfd0b('0x27')],_0xfd0b('0x28')));}}else{_0x443660(null,![]);}})[_0xfd0b('0x14')](function(_0x12d987){_0x443660(_0x12d987);});};AGIVertices[_0xfd0b('0x15')][_0xfd0b('0x1f')]=function(_0x1aadb4){return util[_0xfd0b('0x29')](_0xfd0b('0x2a'),FILES_PATH,_0x1aadb4);};AGIVertices['prototype'][_0xfd0b('0x2b')]=function(_0x288ae9,_0x784d11,_0x3c4706){odbc[_0xfd0b('0x2c')](_0x288ae9,function(_0x56f24c){if(_0x56f24c){logger['error']('Error\x20getting\x20ODBC\x20connection\x20%s',_0x56f24c);_0x3c4706(_0x56f24c);}else{logger['info'](_0xfd0b('0x2d'));odbc[_0xfd0b('0x2e')](_0x784d11,function(_0x4dade2,_0xf10464){if(_0x4dade2){logger[_0xfd0b('0x2f')](_0xfd0b('0x30'),_0x784d11);_0x3c4706(_0x4dade2);}else{logger['info'](_0xfd0b('0x31'),_0x784d11);odbc[_0xfd0b('0x32')](function(_0x52999b){if(_0x52999b){logger[_0xfd0b('0x33')]('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x52999b);}_0x3c4706(null,_0xf10464);});}});}});};AGIVertices['prototype']['getSmsAccount']=function(_0xaca22c,_0x65952){this['rpc'][_0xfd0b('0x34')](_0xaca22c)[_0xfd0b('0x18')](function(_0x5df14b){_0x65952(null,_0x5df14b?_0x5df14b:![]);})['catch'](function(_0x4f5465){_0x65952(_0x4f5465);});};AGIVertices[_0xfd0b('0x15')]['createSmsMessage']=function(_0x9e1abd,_0x1dab1d){this[_0xfd0b('0xf')][_0xfd0b('0x35')](_0x9e1abd)[_0xfd0b('0x18')](function(_0xd86939){_0x1dab1d(null,_0xd86939);})[_0xfd0b('0x14')](function(_0x2142fd){_0x1dab1d(_0x2142fd);});};AGIVertices[_0xfd0b('0x15')]['createSquareDetailsReport']=function(_0xf6a89d,_0x52539c,_0x4271c0){this[_0xfd0b('0xf')][_0xfd0b('0x36')]({'uniqueid':this['channel'][_0xfd0b('0x37')],'node':_0xf6a89d[_0xfd0b('0x38')],'application':_0xf6a89d[_0xfd0b('0x39')],'data':_0x52539c||null,'project_name':this[_0xfd0b('0xe')][_0xfd0b('0x3a')],'callerid':this[_0xfd0b('0xe')]['callerid']})['then'](function(_0x18fc4a){if(_0x4271c0){_0x4271c0(null,_0x18fc4a);}})[_0xfd0b('0x14')](function(_0x4d2b14){if(_0x4271c0){_0x4271c0(_0x4d2b14);}});};AGIVertices[_0xfd0b('0x15')][_0xfd0b('0x3b')]=function(_0x324993,_0x1992d8,_0x1537d1,_0x4c557c){this['rpc'][_0xfd0b('0x3b')]({'uniqueid':this[_0xfd0b('0xe')][_0xfd0b('0x37')],'callerid':this[_0xfd0b('0xe')][_0xfd0b('0x3c')],'calleridname':this[_0xfd0b('0xe')]['calleridname'],'context':this[_0xfd0b('0xe')][_0xfd0b('0x3d')],'extension':this[_0xfd0b('0xe')]['extension'],'priority':this[_0xfd0b('0xe')][_0xfd0b('0x3e')],'accountcode':this[_0xfd0b('0xe')]['accountcode'],'dnid':this[_0xfd0b('0xe')][_0xfd0b('0x3f')],'projectName':this[_0xfd0b('0xe')]['arg_1'],'saveName':_0x1992d8,'filename':_0x324993['file']||_0x1992d8,'savePath':_0x1537d1})[_0xfd0b('0x18')](function(_0x54ec28){_0x4c557c(null,_0x54ec28);})[_0xfd0b('0x14')](function(_0x4a39c2){_0x4c557c(_0x4a39c2);});};AGIVertices[_0xfd0b('0x15')][_0xfd0b('0x40')]=function(_0x424ec9,_0x4957b8,_0x244404,_0x136959,_0x3aaab2){this[_0xfd0b('0xf')][_0xfd0b('0x40')]({'uniqueid':this['channel']['uniqueid'],'body':_0x424ec9,'direction':_0x4957b8,'providerName':_0x244404,'providerResponse':_0x136959})[_0xfd0b('0x18')](function(_0x3e9e16){if(_0x3aaab2){_0x3aaab2(null,_0x3e9e16);}})[_0xfd0b('0x14')](function(_0x58c337){if(_0x3aaab2){_0x3aaab2(_0x58c337);}});};AGIVertices[_0xfd0b('0x15')]['createCmContact']=function(_0x4ca6ac,_0x28297a){this['rpc'][_0xfd0b('0x41')]({'firstName':_['isEmpty'](_0x4ca6ac[_0xfd0b('0x13')])||_[_0xfd0b('0x42')](_0x4ca6ac['name'])?_0xfd0b('0x43')+Math['random']():_0x4ca6ac['name'],'lastName':_[_0xfd0b('0x44')](_0x4ca6ac[_0xfd0b('0x45')])||_[_0xfd0b('0x42')](_0x4ca6ac[_0xfd0b('0x45')])?null:_0x4ca6ac[_0xfd0b('0x45')],'phone':_0x4ca6ac[_0xfd0b('0x46')],'ListId':_0x4ca6ac[_0xfd0b('0x47')],'scheduledat':_0x4ca6ac[_0xfd0b('0x48')],'callbackUniqueid':this['channel'][_0xfd0b('0x37')],'tags':_0xfd0b('0x49'),'description':_0xfd0b('0x4a')+_0x4ca6ac[_0xfd0b('0x48')][_0xfd0b('0x4b')](),'priority':_0x4ca6ac[_0xfd0b('0x4c')]})['then'](function(_0x267c35){_0x28297a(null,_0x267c35);})[_0xfd0b('0x14')](function(_0x5e2434){_0x28297a(_0x5e2434);});};AGIVertices[_0xfd0b('0x15')][_0xfd0b('0x4d')]=function(_0x25b406,_0x2960d6){this[_0xfd0b('0xf')][_0xfd0b('0x4e')](_0x25b406)[_0xfd0b('0x18')](function(_0x4b5268){_0x2960d6(null,_0x4b5268?_0x4b5268[_0xfd0b('0x13')]:![]);})['catch'](function(_0x1480c5){_0x2960d6(_0x1480c5);});};AGIVertices[_0xfd0b('0x15')][_0xfd0b('0x4f')]=function(_0x1a27bb,_0x2632d7,_0x2560f7){var _0x205d82={'role':_0xfd0b('0x50')};_0x205d82[_0x1a27bb]=this[_0xfd0b('0xe')][_0xfd0b('0x3c')];this[_0xfd0b('0xf')][_0xfd0b('0x4f')](_0x205d82,_0x2632d7,this[_0xfd0b('0xe')]['uniqueid'])['then'](function(_0x9d6f17){_0x2560f7(null,_[_0xfd0b('0x42')](_0x9d6f17)?![]:!![]);})[_0xfd0b('0x14')](function(_0x21eabc){logger['error'](_0x21eabc);_0x2560f7(null,![]);});};AGIVertices[_0xfd0b('0x15')][_0xfd0b('0x51')]=function(_0x265809,_0x2d4e2e){var _0x39d8e1={'role':'agent'};_0x39d8e1[_0x265809]=this[_0xfd0b('0xe')][_0xfd0b('0x3c')];this[_0xfd0b('0xf')][_0xfd0b('0x51')](_0x39d8e1)[_0xfd0b('0x18')](function(_0x829d2f){_0x2d4e2e(null,_[_0xfd0b('0x42')](_0x829d2f)?![]:!![]);})[_0xfd0b('0x14')](function(_0x1aae22){logger[_0xfd0b('0x33')](_0x1aae22);_0x2d4e2e(null,![]);});};AGIVertices[_0xfd0b('0x15')][_0xfd0b('0x52')]=function(_0x2484fd,_0x12275e){var _0x27efbe={'role':'agent'};_0x27efbe[_0x2484fd]=this['channel'][_0xfd0b('0x3c')];this[_0xfd0b('0xf')]['agentLogout'](_0x27efbe)['then'](function(_0x5b2a42){_0x12275e(null,_[_0xfd0b('0x42')](_0x5b2a42)?![]:!![]);})['catch'](function(_0x107a29){logger[_0xfd0b('0x33')](_0x107a29);_0x12275e(null,![]);});};AGIVertices['prototype'][_0xfd0b('0x53')]=function(_0x2484f3,_0x20fe74){var _0x51c314={'role':'agent'};_0x51c314[_0x2484f3]=this[_0xfd0b('0xe')][_0xfd0b('0x3c')];var _0x13d1ae=_0x2484f3!='internal'?util['format'](_0xfd0b('0x54'),_0xfd0b('0x55'),this[_0xfd0b('0xe')][_0xfd0b('0x3c')]):undefined;this['rpc'][_0xfd0b('0x53')](_0x51c314,_0x13d1ae)[_0xfd0b('0x18')](function(_0x4f303a){_0x20fe74(null,_[_0xfd0b('0x42')](_0x4f303a)?![]:!![]);})[_0xfd0b('0x14')](function(_0x360dbf){logger[_0xfd0b('0x33')](_0x360dbf);_0x20fe74(null,![]);});};AGIVertices['prototype']['shellCommand']=function(_0x41fc8b,_0x41791f){sh[_0xfd0b('0x56')](_[_0xfd0b('0x57')](_0x41fc8b),function(_0x39fd8f,_0x2506c6){var _0x357710=_0x2506c6[_0xfd0b('0x58')](/(\r\n|\n|\r)/gm,'');_0x41791f(null,_0x357710);});};AGIVertices[_0xfd0b('0x15')][_0xfd0b('0x59')]=function(_0x3cf535,_0xdcb5fc){scripts['googleCloudTTS'](_0x3cf535[_0xfd0b('0x5a')],_0x3cf535[_0xfd0b('0x5b')]||'text',_0x3cf535[_0xfd0b('0x5c')],_0x3cf535[_0xfd0b('0x5d')]||'en-US',_0x3cf535[_0xfd0b('0x5e')]||_0xfd0b('0x5f'),_0x3cf535[_0xfd0b('0x60')]||_0xfd0b('0x61'))[_0xfd0b('0x18')](function(_0x4a4c7a){_0xdcb5fc(null,_0x4a4c7a);})[_0xfd0b('0x14')](function(_0xb48a6b){_0xdcb5fc(_0xb48a6b);});};AGIVertices['prototype'][_0xfd0b('0x62')]=function(_0x449a1a,_0xe9560c){scripts['googleTTS'](_0x449a1a[_0xfd0b('0x5c')],_0x449a1a['google_tts_language']||'en',0x1)['then'](function(_0x425f55){_0xe9560c(null,_0x425f55);})['catch'](function(_0x3c706b){_0xe9560c(_0x3c706b);});};AGIVertices[_0xfd0b('0x15')][_0xfd0b('0x63')]=function(_0xf29a46,_0x2b07ab){var _0x4b08e1={'uri':_0xf29a46[_0xfd0b('0x64')],'method':_0xf29a46[_0xfd0b('0x65')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0xf29a46[_0xfd0b('0x66')])===_0xfd0b('0x67')&&parseInt(_0xf29a46[_0xfd0b('0x66')])>=0x1?parseInt(_0xf29a46[_0xfd0b('0x66')])*0x3e8:0x5*0x3e8};if(_[_0xfd0b('0x68')]([_0xfd0b('0x69'),_0xfd0b('0x6a')],_0x4b08e1[_0xfd0b('0x65')]['toUpperCase']())){try{_0x4b08e1['body']=_0xf29a46[_0xfd0b('0xb')]?JSON[_0xfd0b('0x6b')](_0xf29a46['rawBody']):{};}catch(_0x35b1b2){logger[_0xfd0b('0x33')](_0xfd0b('0x6c'),_0x35b1b2);}}try{_0x4b08e1[_0xfd0b('0x6d')]=_0xf29a46[_0xfd0b('0xa')]?JSON['parse'](_0xf29a46[_0xfd0b('0xa')]):{};}catch(_0x25cd40){logger[_0xfd0b('0x33')](_0xfd0b('0x6e'),_0x25cd40);}if(_0xf29a46['computedVariables']){try{var _0x552b39=require(_0xf29a46[_0xfd0b('0x6f')])[_0xfd0b('0x70')](this,_0x4b08e1);_0x4b08e1[_0xfd0b('0x71')]=Mustache['render'](_0xf29a46[_0xfd0b('0x64')],_0x552b39,{},['$$','$$']);if(_0x4b08e1[_0xfd0b('0x6d')]){_0x4b08e1['headers']=JSON['parse'](Mustache[_0xfd0b('0x72')](JSON['stringify'](_0x4b08e1[_0xfd0b('0x6d')]),_0x552b39,{},['$$','$$']));}if(_0x4b08e1[_0xfd0b('0x73')]){_0x4b08e1['body']=JSON[_0xfd0b('0x6b')](Mustache[_0xfd0b('0x72')](JSON[_0xfd0b('0x74')](_0x4b08e1[_0xfd0b('0x73')]),_0x552b39,{},['$$','$$']));}}catch(_0x23b158){logger['error'](_0xfd0b('0x75'),_0x23b158);}}rp(_0x4b08e1)[_0xfd0b('0x18')](function(_0x2df0ae){var _0x5f342c={'statusCode':_0x2df0ae[_0xfd0b('0x76')]||0xc8,'statusMessage':_0x2df0ae[_0xfd0b('0x77')]||'OK','headers':_0x2df0ae[_0xfd0b('0x6d')]||{},'body':_0x2df0ae[_0xfd0b('0x73')]||{}};_0x2b07ab(null,_0x5f342c);})[_0xfd0b('0x14')](function(_0x3274c2){var _0x3de620={'statusCode':_0x3274c2['statusCode']||0x1f4,'statusMessage':_0x3274c2[_0xfd0b('0x78')]||_0xfd0b('0x79'),'headers':_0x3274c2[_0xfd0b('0x7a')][_0xfd0b('0x6d')]||{},'body':_0x3274c2[_0xfd0b('0x7a')][_0xfd0b('0x73')]||{}};_0x2b07ab(null,_0x3de620);});};AGIVertices[_0xfd0b('0x15')][_0xfd0b('0x7b')]=function(_0x198f6a,_0x4be20){scripts[_0xfd0b('0x7b')](this['channel'][_0xfd0b('0x37')],_0x198f6a[_0xfd0b('0x7c')],_0x198f6a[_0xfd0b('0x5c')],_0x198f6a[_0xfd0b('0x7d')]||'en')[_0xfd0b('0x18')](function(_0xd85b8){_0x4be20(null,_0xd85b8);})[_0xfd0b('0x14')](function(_0x30daaf){_0x4be20(_0x30daaf);});};AGIVertices[_0xfd0b('0x15')][_0xfd0b('0x7e')]=function(_0xd4bc23,_0x11555d){scripts[_0xfd0b('0x7e')](this['channel'][_0xfd0b('0x37')],_0xd4bc23[_0xfd0b('0x7f')],_0xd4bc23['client_email'],_0xd4bc23[_0xfd0b('0x80')],_0xd4bc23[_0xfd0b('0x5c')],_0xd4bc23['dialogflowV2_language']||'en')[_0xfd0b('0x18')](function(_0x15655a){_0x11555d(null,_0x15655a);})['catch'](function(_0xaee63){_0x11555d(_0xaee63);});};AGIVertices['prototype'][_0xfd0b('0x81')]=function(_0xddb98b,_0x386a42){scripts[_0xfd0b('0x81')](this[_0xfd0b('0xe')],_0xddb98b)['then'](function(_0x5004be){_0x386a42(null,_0x5004be);})[_0xfd0b('0x14')](function(_0x3a2b60){_0x386a42(_0x3a2b60);});};AGIVertices[_0xfd0b('0x15')][_0xfd0b('0x82')]=function(_0x3fe7b1,_0x4af18c){scripts[_0xfd0b('0x82')](_0x3fe7b1[_0xfd0b('0x7c')],_0x3fe7b1['text'],_0x3fe7b1[_0xfd0b('0x83')]||_0xfd0b('0x84'),_0x3fe7b1[_0xfd0b('0x85')])[_0xfd0b('0x18')](function(_0x3d4a0d){_0x4af18c(null,_0x3d4a0d);})[_0xfd0b('0x14')](function(_0x918840){_0x4af18c(_0x918840);});};AGIVertices[_0xfd0b('0x15')][_0xfd0b('0x86')]=function(_0x1834af,_0x332898,_0x4a6a49){scripts['ispeechASR'](_0x332898,_0x1834af[_0xfd0b('0x7c')],_0x1834af[_0xfd0b('0x87')]||_0xfd0b('0x84'),this[_0xfd0b('0x88')](_0x1834af[_0xfd0b('0x89')])?_0x1834af[_0xfd0b('0x89')]:undefined)[_0xfd0b('0x18')](function(_0x37e4f6){_0x4a6a49(null,_0x37e4f6);})[_0xfd0b('0x14')](function(_0xa4f4b3){_0x4a6a49(_0xa4f4b3);});};AGIVertices[_0xfd0b('0x15')][_0xfd0b('0x8a')]=function(_0x3cb12e,_0x381207){scripts[_0xfd0b('0x8a')](_0x3cb12e[_0xfd0b('0x8b')],_0x3cb12e[_0xfd0b('0x8c')],_0x3cb12e[_0xfd0b('0x8d')],_0x3cb12e['aws_polly_voice']||_0xfd0b('0x8e'),_0x3cb12e[_0xfd0b('0x5c')],_0x3cb12e['aws_text_type']||_0xfd0b('0x5c'))[_0xfd0b('0x18')](function(_0x567501){_0x381207(null,_0x567501);})[_0xfd0b('0x14')](function(_0xfed67d){_0x381207(_0xfed67d);});};AGIVertices['prototype']['awsLex']=function(_0x426912,_0x34b40d){scripts[_0xfd0b('0x8f')](this[_0xfd0b('0xe')][_0xfd0b('0x37')],_0x426912[_0xfd0b('0x8b')],_0x426912[_0xfd0b('0x8c')],_0x426912['aws_lex_region'],_0x426912['text'],_0x426912[_0xfd0b('0x90')])['then'](function(_0x130708){_0x34b40d(null,_0x130708);})[_0xfd0b('0x14')](function(_0xb75962){_0x34b40d(_0xb75962);});};AGIVertices[_0xfd0b('0x15')][_0xfd0b('0x91')]=function(_0x4402de,_0x4f5f33,_0x799774){scripts[_0xfd0b('0x91')](_0x4f5f33,_0x4402de['key'],_0x4402de[_0xfd0b('0x92')]||_0xfd0b('0x84'))['then'](function(_0x471900){_0x799774(null,_0x471900);})[_0xfd0b('0x14')](function(_0x49ac4f){_0x799774(_0x49ac4f);});};AGIVertices[_0xfd0b('0x15')]['tildeASR']=function(_0x5d8282,_0x47a512,_0x236f5a){scripts['tildeASR'](_0x47a512,_0x5d8282[_0xfd0b('0x93')],_0x5d8282[_0xfd0b('0x94')],_0x5d8282[_0xfd0b('0x71')])['then'](function(_0xa599d1){_0x236f5a(null,_0xa599d1);})['catch'](function(_0x18c832){_0x236f5a(_0x18c832);});};AGIVertices[_0xfd0b('0x15')][_0xfd0b('0x95')]=function(_0x532639){var _0x5eb809=_[_0xfd0b('0x68')](verticesWithRetry,_0x532639[_0xfd0b('0x39')])?_0x532639:_[_0xfd0b('0x96')](_0x532639);for(var _0x3eee49 in _0x5eb809){if(_0x5eb809[_0xfd0b('0x97')](_0x3eee49)){if(_0x5eb809[_0x3eee49]&&_[_0xfd0b('0x98')](_0x5eb809[_0x3eee49])){if(_[_0xfd0b('0x68')](recursiveMapAttributes,_0x3eee49)){_0x5eb809[_0x3eee49]=this['replaceObjectAllVariables'](_0x5eb809[_0x3eee49]);}else{_0x5eb809[_0x3eee49]=this[_0xfd0b('0x99')](_0x5eb809[_0x3eee49]);}}}}return _0x5eb809;};AGIVertices[_0xfd0b('0x15')][_0xfd0b('0x9a')]=function(_0x240cdf){for(var _0x5a0dc1 in _0x240cdf){if(_0x240cdf['hasOwnProperty'](_0x5a0dc1)){if(_['isPlainObject'](_0x240cdf[_0x5a0dc1])){this[_0xfd0b('0x9a')](_0x240cdf[_0x5a0dc1]);}else if(_[_0xfd0b('0x9b')](_0x240cdf[_0x5a0dc1])){for(var _0x4f353d=0x0;_0x4f353d<_0x240cdf[_0x5a0dc1][_0xfd0b('0x9c')];_0x4f353d++){this[_0xfd0b('0x9a')](_0x240cdf[_0x5a0dc1][_0x4f353d]);}}else if(_[_0xfd0b('0x98')](_0x240cdf[_0x5a0dc1])){_0x240cdf[_0x5a0dc1]=this[_0xfd0b('0x99')](_0x240cdf[_0x5a0dc1]);}}}};AGIVertices['prototype'][_0xfd0b('0x9d')]=function(_0x3203cf,_0x1f3ced){for(var _0x55b9c6 in _0x3203cf){if(_0x3203cf['hasOwnProperty'](_0x55b9c6)){if(_[_0xfd0b('0x9e')](_0x3203cf[_0x55b9c6])){if(!_['isEmpty'](_0x3203cf[_0x55b9c6])){this[_0xfd0b('0x9d')](_0x3203cf[_0x55b9c6],util[_0xfd0b('0x29')](_0xfd0b('0x9f'),_0x1f3ced,_0x55b9c6));}}else if(_[_0xfd0b('0x9b')](_0x3203cf[_0x55b9c6])){for(var _0x121ca0=0x0;_0x121ca0<_0x3203cf[_0x55b9c6][_0xfd0b('0x9c')];_0x121ca0++){this[_0xfd0b('0x9d')](_0x3203cf[_0x55b9c6][_0x121ca0],util[_0xfd0b('0x29')]('%s.%s',_0x1f3ced,_0x55b9c6+'['+_0x121ca0+']'));}}else{if(!_['isNil'](_0x3203cf[_0x55b9c6])){this[_0xfd0b('0xe')][_0xfd0b('0xa0')](util[_0xfd0b('0x29')]('%s.%s',_0x1f3ced,_0x55b9c6),_0x3203cf[_0x55b9c6]);}}}}};AGIVertices['prototype']['replaceObjectAllVariables']=function(_0x97b7e3){try{var _0x46bef5=JSON[_0xfd0b('0x6b')](_0x97b7e3);this['recursiveNodeIndex'](_0x46bef5);return JSON[_0xfd0b('0x74')](_0x46bef5);}catch(_0x5d8e7d){return this[_0xfd0b('0x99')](_0x97b7e3);}};AGIVertices[_0xfd0b('0x15')][_0xfd0b('0x99')]=function(_0x2bc171){var _0xd17777=_0x2bc171['split']('{');for(var _0x17388c=0x1;_0x17388c<_0xd17777['length'];_0x17388c+=0x1){var _0x4f7c8c=_0xd17777[_0x17388c][_0xfd0b('0xa1')]('}');if(_0x4f7c8c[_0xfd0b('0x9c')]>0x1){_0x2bc171=_0x2bc171[_0xfd0b('0xa2')]('{'+_0x4f7c8c[0x0]+'}',this[_0xfd0b('0xe')][_0xfd0b('0x11')](_0x4f7c8c[0x0])['extra']||_0x4f7c8c[0x0]);}}if(_0xd17777[_0xfd0b('0x9c')]===0x1){return _0x2bc171['toString']();}return this[_0xfd0b('0x99')](_0x2bc171);};AGIVertices[_0xfd0b('0x15')][_0xfd0b('0xa3')]=function(_0x4d34ea,_0x42c5d9){var _0x8279bf=this['channel'][_0xfd0b('0x11')](_0x4d34ea);if(_0x8279bf[_0xfd0b('0xa4')]===-0x1){return _0x8279bf;}logger[_0xfd0b('0x2f')](util['format'](_0xfd0b('0xa5'),_0x42c5d9,_0x8279bf['extra']));return this['channel'][_0xfd0b('0xa0')](_0x42c5d9,_0x8279bf['extra']);};AGIVertices[_0xfd0b('0x15')]['isConfigured']=function(_0x20394c){return _0x20394c&&_0x20394c!=='0'&&_0x20394c!=='-1'&&_0x20394c!=='';};AGIVertices['prototype'][_0xfd0b('0xa6')]=function(_0x4ff5d9){this['createSquareDetailsReport'][_0xfd0b('0x70')](this,_0x4ff5d9,'-');_0x4ff5d9[_0xfd0b('0xa7')]=_0x4ff5d9[_0xfd0b('0xa6')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xfd0b('0x15')]['mrcpsynth']=function(_0x2bbf3b){logger[_0xfd0b('0x2f')](util['format'](_0xfd0b('0xa8'),_0x2bbf3b['label']));if(!this[_0xfd0b('0x88')](_0x2bbf3b[_0xfd0b('0x5c')])){return this[_0xfd0b('0xe')][_0xfd0b('0xa9')](_0xfd0b('0xaa'));}var _0x1ddd34='\x22'+_0x2bbf3b['text']+'\x22';if(this['isConfigured'](_0x2bbf3b[_0xfd0b('0x7a')])){_0x1ddd34+=','+_0x2bbf3b[_0xfd0b('0x7a')];}var _0x54eaaf=this[_0xfd0b('0xe')]['exec'](_0xfd0b('0xab'),_0x1ddd34);if(_0x54eaaf[_0xfd0b('0xa4')]===-0x1){return _0x54eaaf;}return this[_0xfd0b('0xe')]['noop'](util[_0xfd0b('0x29')](_0xfd0b('0xac'),_0x1ddd34));};AGIVertices[_0xfd0b('0x15')][_0xfd0b('0xad')]=function(_0x53214e){logger[_0xfd0b('0x2f')](util['format']('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x53214e[_0xfd0b('0x38')]));if(!this[_0xfd0b('0x88')](_0x53214e[_0xfd0b('0xae')])){return this[_0xfd0b('0xe')][_0xfd0b('0xa9')](_0xfd0b('0xaf'));}var _0x4f3583=_0x53214e[_0xfd0b('0xae')];if(this[_0xfd0b('0x88')](_0x53214e[_0xfd0b('0x7a')])){_0x4f3583+=','+_0x53214e[_0xfd0b('0x7a')];}var _0xf60be5=this[_0xfd0b('0xe')][_0xfd0b('0x56')](_0xfd0b('0xb0'),_0x4f3583);if(_0xf60be5[_0xfd0b('0xa4')]===-0x1){return _0xf60be5;}var _0xb52e6=this[_0xfd0b('0xa3')](_0xfd0b('0xb1'),_0xfd0b('0xb2'));if(_0xb52e6['result']===-0x1){return _0xb52e6;}var _0x34d4c1=this[_0xfd0b('0xa3')](_0xfd0b('0xb3'),_0xfd0b('0xb4'));if(_0x34d4c1['result']===-0x1){return _0x34d4c1;}var _0x211e01=this[_0xfd0b('0xa3')]('RECOG_INSTANCE()',_0xfd0b('0xb5'));if(_0x211e01['result']===-0x1){return _0x211e01;}return this['channel']['noop'](util['format'](_0xfd0b('0xb6'),_0x4f3583));};AGIVertices[_0xfd0b('0x15')][_0xfd0b('0xb7')]=function(_0xacf971){logger[_0xfd0b('0x2f')](util[_0xfd0b('0x29')](_0xfd0b('0xb8'),_0xacf971[_0xfd0b('0x38')]));return this['channel'][_0xfd0b('0xb7')]([_0xacf971[_0xfd0b('0xb9')],_0xacf971[_0xfd0b('0xba')]]);};AGIVertices[_0xfd0b('0x15')][_0xfd0b('0xbb')]=function(_0x423e14){logger['info'](util[_0xfd0b('0x29')](_0xfd0b('0xbc'),_0x423e14[_0xfd0b('0x38')]));if(this[_0xfd0b('0x88')](_0x423e14[_0xfd0b('0x66')])){logger[_0xfd0b('0x2f')](util[_0xfd0b('0x29')](_0xfd0b('0xbd'),_0x423e14[_0xfd0b('0x66')]));var _0x44c0b7=this[_0xfd0b('0xe')][_0xfd0b('0xbe')](_0x423e14[_0xfd0b('0x66')]);if(_0x44c0b7['result']===-0x1){return _0x44c0b7;}}return this['channel'][_0xfd0b('0xbb')]();};AGIVertices[_0xfd0b('0x15')]['callback']=function(_0x399157){logger[_0xfd0b('0x2f')](util['format'](_0xfd0b('0xbf'),_0x399157[_0xfd0b('0x38')]));if(!this[_0xfd0b('0x88')](_0x399157['list_id'])){return this[_0xfd0b('0xe')][_0xfd0b('0x33')](_0x399157,_0xfd0b('0xc0'));}_0x399157[_0xfd0b('0x48')]=moment();if(this[_0xfd0b('0x88')](_0x399157[_0xfd0b('0xc1')])){_0x399157[_0xfd0b('0x48')]=moment()[_0xfd0b('0xc2')](_0x399157[_0xfd0b('0xc1')],'minutes');}if(!this['isConfigured'](_0x399157[_0xfd0b('0x4c')])){_0x399157[_0xfd0b('0x4c')]=0x2;}this[_0xfd0b('0x41')][_0xfd0b('0x70')](this,_0x399157);return this[_0xfd0b('0xe')]['noop'](util[_0xfd0b('0x29')](_0xfd0b('0xc3'),_0x399157[_0xfd0b('0x46')],_0x399157[_0xfd0b('0x47')],_0x399157['scheduledAt']));};AGIVertices[_0xfd0b('0x15')][_0xfd0b('0xc4')]=function(_0x24ab62){logger[_0xfd0b('0x2f')](util['format']('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x24ab62[_0xfd0b('0x38')]));var _0x2d51ba=this[_0xfd0b('0xe')][_0xfd0b('0x56')](_0x24ab62[_0xfd0b('0xc5')],_0x24ab62[_0xfd0b('0x7a')]);if(_0x2d51ba[_0xfd0b('0xa4')]===-0x1){return _0x2d51ba;}return this[_0xfd0b('0xe')]['noop'](util[_0xfd0b('0x29')](_0xfd0b('0xc6'),_0x24ab62[_0xfd0b('0xc5')],_0x24ab62['options']));};AGIVertices[_0xfd0b('0x15')][_0xfd0b('0xc7')]=function(_0x170e38){logger[_0xfd0b('0x2f')](util[_0xfd0b('0x29')](_0xfd0b('0xc8'),_0x170e38[_0xfd0b('0x38')]));if(!this[_0xfd0b('0x88')](_0x170e38[_0xfd0b('0x5c')])){return this[_0xfd0b('0xe')][_0xfd0b('0xa9')](_0xfd0b('0xaa'));}var _0x368c1b='\x22'+_0x170e38[_0xfd0b('0x5c')]+'\x22';if(this['isConfigured'](_0x170e38[_0xfd0b('0x7a')])){_0x368c1b+=','+_0x170e38[_0xfd0b('0x7a')];}var _0x22a3e8=this[_0xfd0b('0xe')][_0xfd0b('0x56')](_0xfd0b('0xab'),_0x368c1b);if(_0x22a3e8['result']===-0x1){return _0x22a3e8;}return this[_0xfd0b('0xe')]['noop'](util[_0xfd0b('0x29')](_0xfd0b('0xac'),_0x368c1b));};AGIVertices[_0xfd0b('0x15')]['sestektts']=function(_0x167b11){logger[_0xfd0b('0x2f')](util['format'](_0xfd0b('0xc9'),_0x167b11[_0xfd0b('0x38')]));if(!this[_0xfd0b('0x88')](_0x167b11[_0xfd0b('0x5c')])){return this[_0xfd0b('0xe')][_0xfd0b('0xa9')]('no\x20text\x20configured');}var _0x36de3f='\x22'+_0x167b11[_0xfd0b('0x5c')]+'\x22';if(this[_0xfd0b('0x88')](_0x167b11['options'])){_0x36de3f+=','+_0x167b11[_0xfd0b('0x7a')];}var _0x33eeaa=this[_0xfd0b('0xe')][_0xfd0b('0x56')](_0xfd0b('0xab'),_0x36de3f);if(_0x33eeaa[_0xfd0b('0xa4')]===-0x1){return _0x33eeaa;}return this['channel']['noop'](util['format'](_0xfd0b('0xac'),_0x36de3f));};AGIVertices[_0xfd0b('0x15')]['lumenvoxasr']=function(_0x2a2b58){logger[_0xfd0b('0x2f')](util[_0xfd0b('0x29')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x2a2b58['label']));if(!this[_0xfd0b('0x88')](_0x2a2b58['grammar'])){return this[_0xfd0b('0xe')][_0xfd0b('0xa9')](_0xfd0b('0xaf'));}var _0x131361=_0x2a2b58[_0xfd0b('0xae')];if(this[_0xfd0b('0x88')](_0x2a2b58[_0xfd0b('0x7a')])){_0x131361+=','+_0x2a2b58[_0xfd0b('0x7a')];}var _0x62759a=this['channel'][_0xfd0b('0x56')](_0xfd0b('0xb0'),_0x131361);if(_0x62759a[_0xfd0b('0xa4')]===-0x1){return _0x62759a;}var _0x5157eb=this['getAndSetVariable'](_0xfd0b('0xb1'),_0xfd0b('0xca'));if(_0x5157eb['result']===-0x1){return _0x5157eb;}var _0xba6581=this['getAndSetVariable']('RECOG_INPUT()',_0xfd0b('0xcb'));if(_0xba6581[_0xfd0b('0xa4')]===-0x1){return _0xba6581;}var _0x4e0d2e=this[_0xfd0b('0xa3')]('RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE');if(_0x4e0d2e[_0xfd0b('0xa4')]===-0x1){return _0x4e0d2e;}return this['channel'][_0xfd0b('0xa9')](util[_0xfd0b('0x29')]('Executed\x20command\x20MRCPRecog\x20%s',_0x131361));};AGIVertices[_0xfd0b('0x15')][_0xfd0b('0xcc')]=function(_0x5765b2){logger[_0xfd0b('0x2f')](util[_0xfd0b('0x29')](_0xfd0b('0xcd'),_0x5765b2[_0xfd0b('0x38')]));if(!this['isConfigured'](_0x5765b2[_0xfd0b('0xae')])){return this['channel'][_0xfd0b('0xa9')](_0xfd0b('0xaf'));}var _0x2dffc4=_0x5765b2[_0xfd0b('0xae')];if(this[_0xfd0b('0x88')](_0x5765b2[_0xfd0b('0x7a')])){_0x2dffc4+=','+_0x5765b2[_0xfd0b('0x7a')];}var _0x213ffa=this[_0xfd0b('0xe')][_0xfd0b('0x56')](_0xfd0b('0xb0'),_0x2dffc4);if(_0x213ffa[_0xfd0b('0xa4')]===-0x1){return _0x213ffa;}var _0x566c8f=this[_0xfd0b('0xa3')](_0xfd0b('0xb1'),_0xfd0b('0xce'));if(_0x566c8f[_0xfd0b('0xa4')]===-0x1){return _0x566c8f;}var _0x33cb1e=this['getAndSetVariable'](_0xfd0b('0xb3'),_0xfd0b('0xcf'));if(_0x33cb1e[_0xfd0b('0xa4')]===-0x1){return _0x33cb1e;}var _0x2c9709=this[_0xfd0b('0xa3')]('RECOG_INSTANCE()','SESTEK_ASR_INSTANCE');if(_0x2c9709['result']===-0x1){return _0x2c9709;}return this[_0xfd0b('0xe')]['noop'](util[_0xfd0b('0x29')](_0xfd0b('0xb6'),_0x2dffc4));};AGIVertices[_0xfd0b('0x15')][_0xfd0b('0xd0')]=function(_0x53e3ce){logger['info'](util[_0xfd0b('0x29')](_0xfd0b('0xd1'),_0x53e3ce[_0xfd0b('0x38')]));if(!this['isConfigured'](_0x53e3ce[_0xfd0b('0xd2')])){return this['channel'][_0xfd0b('0x33')](_0x53e3ce,'no\x20database\x20selected');}var _0x1c7829=this[_0xfd0b('0xd3')][_0xfd0b('0x70')](this,_0x53e3ce[_0xfd0b('0xd2')]);if(!_0x1c7829){return this[_0xfd0b('0xe')][_0xfd0b('0x33')](_0x53e3ce,_0xfd0b('0xd4'));}if(!this[_0xfd0b('0x88')](_0x53e3ce[_0xfd0b('0x2e')])){return this[_0xfd0b('0xe')][_0xfd0b('0x33')](_0x53e3ce,_0xfd0b('0xd5'));}var _0x39f327=_0x53e3ce[_0xfd0b('0x2e')][_0xfd0b('0x58')](/(\r\n|\n|\r)/gm,'\x20');this[_0xfd0b('0xe')]['noop'](util[_0xfd0b('0x29')](_0xfd0b('0xd6'),_0x39f327));var _0x230237=this[_0xfd0b('0x2b')][_0xfd0b('0x70')](this,_0x1c7829,_0x39f327);this[_0xfd0b('0x36')][_0xfd0b('0x70')](this,_0x53e3ce,_0x39f327);if(!this['isConfigured'](_0x53e3ce['variable_id'])){return this['channel'][_0xfd0b('0xa9')](_0xfd0b('0xd7'));}var _0x4ce469=this[_0xfd0b('0x11')][_0xfd0b('0x70')](this,_0x53e3ce['variable_id']);if(!_0x4ce469){return this['channel'][_0xfd0b('0x33')](_0x53e3ce,'no\x20variable\x20found');}var _0xe6f44d=this;_0x230237[_0xfd0b('0xd8')](function(_0x7ad5d9,_0x1b59cd){Object['keys'](_0x7ad5d9)['forEach'](function(_0x204c51){_0xe6f44d['channel'][_0xfd0b('0xa0')](util[_0xfd0b('0x29')]('%s[%s][%s]',_0x4ce469,_0x1b59cd,_0x204c51),_0x7ad5d9[_0x204c51]);});});this[_0xfd0b('0xe')]['setVariable'](util['format']('%s_ROWS_COUNT',_0x4ce469),_0x230237['length']);return this[_0xfd0b('0xe')][_0xfd0b('0xa9')](util[_0xfd0b('0x29')]('variable\x20%s\x20set',_0x4ce469));};AGIVertices[_0xfd0b('0x15')][_0xfd0b('0xd9')]=function(_0x2a156e){logger['debug'](util[_0xfd0b('0x29')](_0xfd0b('0xda'),_0x2a156e['label']));if(!this[_0xfd0b('0x88')](_0x2a156e[_0xfd0b('0xdb')])){return this['channel']['error'](_0x2a156e,_0xfd0b('0xdc'));}var _0x619f95=this[_0xfd0b('0xdd')][_0xfd0b('0x70')](this,_0x2a156e['sip_id']);if(!_0x619f95){return this[_0xfd0b('0xe')][_0xfd0b('0x33')](_0x2a156e,_0xfd0b('0xde'));}var _0x561b86=this[_0xfd0b('0xe')]['exec'](_0xfd0b('0xdf'),[util[_0xfd0b('0x29')](_0xfd0b('0xe0'),_0x619f95),_0x2a156e[_0xfd0b('0x66')],_0x2a156e['opts'],_0x2a156e['url']]);if(_0x561b86[_0xfd0b('0xa4')]===-0x1){return _0x561b86;}return this[_0xfd0b('0xe')]['noop'](util[_0xfd0b('0x29')](_0xfd0b('0xe1'),_0xfd0b('0xdf')));};AGIVertices['prototype'][_0xfd0b('0xe2')]=function(_0x414ac5){logger[_0xfd0b('0x2f')](util['format'](_0xfd0b('0xe3'),_0x414ac5[_0xfd0b('0x38')]));if(!this[_0xfd0b('0x88')](_0x414ac5[_0xfd0b('0x7c')])){return this['channel'][_0xfd0b('0xa9')](_0xfd0b('0xe4'));}if(!this['isConfigured'](_0x414ac5['text'])){return this[_0xfd0b('0xe')][_0xfd0b('0xa9')](_0xfd0b('0xaa'));}this[_0xfd0b('0xe')][_0xfd0b('0xe5')]=!![];this['createSquareDetailsReport'](_0x414ac5);this[_0xfd0b('0x40')](_0x414ac5['text'],'in','','');this[_0xfd0b('0xe')][_0xfd0b('0xa9')](util[_0xfd0b('0x29')](_0xfd0b('0xe6'),_0x414ac5[_0xfd0b('0x5c')]));var _0x171c2f=this[_0xfd0b('0x7b')][_0xfd0b('0x70')](this,_0x414ac5);if(_0x171c2f){for(var _0x46808e in _0x171c2f){if(_0x171c2f['hasOwnProperty'](_0x46808e)){this['channel'][_0xfd0b('0xa0')](util[_0xfd0b('0x29')](_0xfd0b('0xe7'),_0x46808e[_0xfd0b('0xe8')]()),_0x171c2f[_0x46808e]);}}this[_0xfd0b('0x40')](_0x171c2f[_0xfd0b('0xe9')],_0xfd0b('0xea'),'dialogflow','');return this[_0xfd0b('0xe')][_0xfd0b('0xa9')](util[_0xfd0b('0x29')](_0xfd0b('0xeb'),_0x171c2f[_0xfd0b('0xe9')]));}return this[_0xfd0b('0xe')][_0xfd0b('0x33')](_0x414ac5,'Dialogflow\x20is\x20unreachable');};AGIVertices[_0xfd0b('0x15')][_0xfd0b('0xec')]=function(_0x546e9f){logger[_0xfd0b('0x2f')](util[_0xfd0b('0x29')](_0xfd0b('0xed'),_0x546e9f[_0xfd0b('0x38')]));if(!this[_0xfd0b('0x88')](_0x546e9f[_0xfd0b('0x7f')])){return this[_0xfd0b('0xe')]['noop']('no\x20project_id\x20configured');}if(!this[_0xfd0b('0x88')](_0x546e9f[_0xfd0b('0xee')])){return this['channel'][_0xfd0b('0xa9')]('no\x20client_email\x20configured');}if(!this[_0xfd0b('0x88')](_0x546e9f['private_key'])){return this[_0xfd0b('0xe')][_0xfd0b('0xa9')](_0xfd0b('0xef'));}if(!this[_0xfd0b('0x88')](_0x546e9f[_0xfd0b('0xf0')])){return this[_0xfd0b('0xe')][_0xfd0b('0xa9')](_0xfd0b('0xf1'));}if(!this[_0xfd0b('0x88')](_0x546e9f[_0xfd0b('0x5c')])){return this[_0xfd0b('0xe')][_0xfd0b('0xa9')](_0xfd0b('0xaa'));}this['channel'][_0xfd0b('0xe5')]=!![];this[_0xfd0b('0x36')](_0x546e9f);this[_0xfd0b('0x40')](_0x546e9f['text'],'in','','');this['channel']['noop'](util[_0xfd0b('0x29')]('Trying\x20DialogflowV2:\x20%s',_0x546e9f[_0xfd0b('0x5c')]));var _0x4b65b3=this[_0xfd0b('0x7e')][_0xfd0b('0x70')](this,_0x546e9f);if(_0x4b65b3){for(var _0x18071a in _0x4b65b3){if(_0x4b65b3['hasOwnProperty'](_0x18071a)){if(_0x18071a!==_0xfd0b('0xf2')){this['channel'][_0xfd0b('0xa0')](util['format'](_0xfd0b('0xe7'),_0x18071a[_0xfd0b('0xe8')]()),_0x4b65b3[_0x18071a]);}}}this[_0xfd0b('0x40')](_0x4b65b3[_0xfd0b('0xe9')],_0xfd0b('0xea'),_0xfd0b('0xec'),_0x4b65b3[_0xfd0b('0xf2')]);return this[_0xfd0b('0xe')][_0xfd0b('0xa9')](util[_0xfd0b('0x29')]('DialogflowV2\x20Result\x20%s',_0x4b65b3[_0xfd0b('0xe9')]));}return this[_0xfd0b('0xe')][_0xfd0b('0x33')](_0x546e9f,_0xfd0b('0xf3'));};AGIVertices['prototype'][_0xfd0b('0xf4')]=function(_0x3d3374){logger[_0xfd0b('0x2f')](util[_0xfd0b('0x29')](_0xfd0b('0xf5'),_0x3d3374[_0xfd0b('0x38')]));if(!this[_0xfd0b('0x88')](_0x3d3374['ndauth_url'])){return this[_0xfd0b('0xe')][_0xfd0b('0xa9')](_0xfd0b('0xf6'));}if(!this[_0xfd0b('0x88')](_0x3d3374[_0xfd0b('0xf7')])){return this['channel'][_0xfd0b('0xa9')]('no\x20username\x20configured');}if(!this[_0xfd0b('0x88')](_0x3d3374[_0xfd0b('0xf8')])){return this[_0xfd0b('0xe')][_0xfd0b('0xa9')](_0xfd0b('0xf9'));}if(!this['isConfigured'](_0x3d3374[_0xfd0b('0xfa')])){return this[_0xfd0b('0xe')]['noop'](_0xfd0b('0xaa'));}this[_0xfd0b('0xe')][_0xfd0b('0xe5')]=!![];this[_0xfd0b('0x36')](_0x3d3374);this[_0xfd0b('0x40')](_0x3d3374[_0xfd0b('0x5c')],'in','','');this[_0xfd0b('0xe')]['noop'](util[_0xfd0b('0x29')](_0xfd0b('0xfb'),_0x3d3374[_0xfd0b('0x5c')]));var _0x1ba0e1=this[_0xfd0b('0x81')][_0xfd0b('0x70')](this,_0x3d3374);if(_0x1ba0e1){for(var _0x3c395d in _0x1ba0e1){if(_0x1ba0e1[_0xfd0b('0x97')](_0x3c395d)){this[_0xfd0b('0xe')]['setVariable'](util[_0xfd0b('0x29')]('SESTEK_NDA_%s',_0x3c395d['toUpperCase']()),_0x1ba0e1[_0x3c395d]);}}this['createSquareMessage'](_0x1ba0e1[_0xfd0b('0xe9')],_0xfd0b('0xea'),'sesteknda','');if(_0x1ba0e1['audiofile']){this[_0xfd0b('0xe')][_0xfd0b('0xa9')](util[_0xfd0b('0x29')](_0xfd0b('0xfc'),_0x1ba0e1[_0xfd0b('0xfd')]));var _0x3ab852=this['channel'][_0xfd0b('0xfe')](_0x1ba0e1[_0xfd0b('0xfd')]);try{fs[_0xfd0b('0xff')](_0x1ba0e1[_0xfd0b('0xfd')]+'.wav');}catch(_0x5c6c94){logger[_0xfd0b('0x33')](_0x5c6c94);}return _0x3ab852;}else{return this[_0xfd0b('0xe')][_0xfd0b('0xa9')](util[_0xfd0b('0x29')](_0xfd0b('0x100'),_0x1ba0e1[_0xfd0b('0xe9')]));}}return this[_0xfd0b('0xe')][_0xfd0b('0x33')](_0x3d3374,_0xfd0b('0x101'));};AGIVertices[_0xfd0b('0x15')][_0xfd0b('0x102')]=function(_0x569374){logger[_0xfd0b('0x2f')](util[_0xfd0b('0x29')](_0xfd0b('0x103'),_0x569374[_0xfd0b('0x38')]));return this[_0xfd0b('0xe')][_0xfd0b('0xa9')](_0xfd0b('0x102'));};AGIVertices[_0xfd0b('0x15')][_0xfd0b('0x104')]=function(_0xc1fb70){logger['info'](util[_0xfd0b('0x29')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0xc1fb70[_0xfd0b('0x38')]));var _0x4d2eb6='';if(_0xc1fb70[_0xfd0b('0x105')]){if(!this[_0xfd0b('0x88')](_0xc1fb70['trunk_id'])){return this[_0xfd0b('0xe')][_0xfd0b('0x33')](_0xc1fb70,_0xfd0b('0x106'));}else{var _0x1e6fdd=parseInt(_0xc1fb70[_0xfd0b('0x105')],0xa);if(isNaN(_0x1e6fdd)){_0x4d2eb6=_0xc1fb70['trunk_id'];}else{_0x4d2eb6=this[_0xfd0b('0x1c')]['sync'](this,_0xc1fb70[_0xfd0b('0x105')]);if(!_0x4d2eb6){return this['channel']['error'](_0xc1fb70,_0xfd0b('0x107'));}}}}else if(_0xc1fb70['trunk_name']){_0x4d2eb6=_0xc1fb70[_0xfd0b('0x108')];}else{return this[_0xfd0b('0xe')][_0xfd0b('0x33')](_0xc1fb70,_0xfd0b('0x106'));}var _0x3d235a=this['channel'][_0xfd0b('0x56')]('DIAL',[util[_0xfd0b('0x29')](_0xfd0b('0x109'),_0x4d2eb6,_0xc1fb70[_0xfd0b('0x46')]),_0xc1fb70[_0xfd0b('0x66')],_0xc1fb70[_0xfd0b('0x10a')],_0xc1fb70[_0xfd0b('0x64')]]);if(_0x3d235a['result']===-0x1){return _0x3d235a;}return this[_0xfd0b('0xe')][_0xfd0b('0xa9')](util['format']('Executed\x20command\x20%s',_0xfd0b('0xdf')));};AGIVertices[_0xfd0b('0x15')]['finally']=function(_0x10d650){logger[_0xfd0b('0x2f')](util[_0xfd0b('0x29')](_0xfd0b('0x10b'),_0x10d650[_0xfd0b('0x38')]));return this[_0xfd0b('0xe')][_0xfd0b('0xa9')]('finally');};AGIVertices[_0xfd0b('0x15')]['getdigits']=function(_0x344b30){logger['info'](util[_0xfd0b('0x29')](_0xfd0b('0x10c'),_0x344b30[_0xfd0b('0x38')]));if(_0x344b30[_0xfd0b('0xa7')]===0x0){return this['maxRetry'](_0x344b30);}_0x344b30[_0xfd0b('0xa7')]-=0x1;if(!this[_0xfd0b('0x88')](_0x344b30[_0xfd0b('0x10d')])){return this[_0xfd0b('0xe')][_0xfd0b('0x33')](_0x344b30,_0xfd0b('0x10e'));}var _0x41ce3e=this[_0xfd0b('0x10f')]['sync'](this,_0x344b30['file_id']);if(!_0x41ce3e){return this[_0xfd0b('0xe')][_0xfd0b('0x33')](_0x344b30,_0xfd0b('0x110'));}if(!this['isConfigured'](_0x344b30[_0xfd0b('0x111')])){return this[_0xfd0b('0xe')][_0xfd0b('0x33')](_0xfd0b('0xd7'));}var _0x26a258=this[_0xfd0b('0xe')][_0xfd0b('0x112')](_0x41ce3e,_0x344b30['response'],_0x344b30[_0xfd0b('0x113')]);var _0x4e4c33=_0x26a258[_0xfd0b('0xa4')]?_0x26a258[_0xfd0b('0xa4')][_0xfd0b('0x4b')]():'';logger['info'](_0xfd0b('0x114'),JSON[_0xfd0b('0x74')](_0x26a258));if(_0x26a258[_0xfd0b('0xa4')]===-0x1){this[_0xfd0b('0x36')][_0xfd0b('0x70')](this,_0x344b30,_0x4e4c33);return _0x26a258;}else if(_0x26a258['extra']===_0xfd0b('0x66')){_0x26a258[_0xfd0b('0xa4')]=_0x4e4c33[_0xfd0b('0x9c')]>=parseInt(_0x344b30['mindigit'])?'x':'i';}else{_0x26a258[_0xfd0b('0xa4')]=_0x4e4c33[_0xfd0b('0x9c')]>=parseInt(_0x344b30[_0xfd0b('0x115')])&&_0x4e4c33[_0xfd0b('0x9c')]<=parseInt(_0x344b30[_0xfd0b('0x113')])?'x':'i';}var _0x30cad9=this[_0xfd0b('0x11')][_0xfd0b('0x70')](this,_0x344b30[_0xfd0b('0x111')]);if(!_0x30cad9){return this['channel'][_0xfd0b('0x33')](_0x344b30,_0xfd0b('0x116'));}this[_0xfd0b('0xe')][_0xfd0b('0xa0')](_0x30cad9,_0x4e4c33);if(this[_0xfd0b('0x88')](_0x344b30[_0xfd0b('0x117')])){var _0x1132bf=parseInt(_0x344b30[_0xfd0b('0x117')],0xa);var _0x123d8b=rs[_0xfd0b('0x118')]({'charset':'*','length':_0x1132bf});var _0x22f01b=_0x4e4c33[_0xfd0b('0x9c')];if(_0x22f01b>0x0){if(_0x22f01b>_0x1132bf){this[_0xfd0b('0x36')][_0xfd0b('0x70')](this,_0x344b30,_0x344b30['hiddendigitspos']===_0xfd0b('0x119')?_0x123d8b+_0x4e4c33[_0xfd0b('0x11a')](_0x1132bf):_0x4e4c33[_0xfd0b('0x11a')](0x0,_0x22f01b-_0x1132bf)+_0x123d8b);}else{this['createSquareDetailsReport'][_0xfd0b('0x70')](this,_0x344b30,rs[_0xfd0b('0x118')]({'charset':'*','length':_0x22f01b}));}}else{this[_0xfd0b('0x36')][_0xfd0b('0x70')](this,_0x344b30,'');}}else{this[_0xfd0b('0x36')][_0xfd0b('0x70')](this,_0x344b30,_0x4e4c33);}return _0x26a258;};AGIVertices[_0xfd0b('0x15')][_0xfd0b('0x11b')]=function(_0x5283a2){logger[_0xfd0b('0x2f')](util[_0xfd0b('0x29')](_0xfd0b('0x11c'),_0x5283a2[_0xfd0b('0x38')]));return this[_0xfd0b('0xd')](_0x5283a2);};AGIVertices[_0xfd0b('0x15')]['goal']=function(_0x3886c4){logger[_0xfd0b('0x2f')](util[_0xfd0b('0x29')](_0xfd0b('0x11d'),_0x3886c4[_0xfd0b('0x38')]));this[_0xfd0b('0x36')][_0xfd0b('0x70')](this,_0x3886c4,_0x3886c4[_0xfd0b('0x11e')]);return this['channel'][_0xfd0b('0xa9')](util[_0xfd0b('0x29')]('GOAL\x20%s',_0x3886c4[_0xfd0b('0x11e')]));};AGIVertices[_0xfd0b('0x15')][_0xfd0b('0x11f')]=function(_0x39a660){logger[_0xfd0b('0x2f')](util[_0xfd0b('0x29')](_0xfd0b('0x120'),_0x39a660['label']));if(!this[_0xfd0b('0x88')](_0x39a660[_0xfd0b('0x8b')])||!this[_0xfd0b('0x88')](_0x39a660[_0xfd0b('0x8c')])){return this[_0xfd0b('0xe')][_0xfd0b('0xa9')](_0xfd0b('0x121'));}if(!this[_0xfd0b('0x88')](_0x39a660[_0xfd0b('0x5c')])){return this[_0xfd0b('0xe')]['noop'](_0xfd0b('0xaa'));}this[_0xfd0b('0xe')][_0xfd0b('0xa9')](util['format'](_0xfd0b('0x122'),_0x39a660[_0xfd0b('0x5c')]));var _0x3506b2=this[_0xfd0b('0x8a')][_0xfd0b('0x70')](this,_0x39a660);if(_0x3506b2){this[_0xfd0b('0xe')][_0xfd0b('0xa9')](util['format'](_0xfd0b('0x123'),_0x3506b2));var _0x5a7288=this[_0xfd0b('0xe')]['streamFile'](_0x3506b2);try{fs['unlink'](_0x3506b2+_0xfd0b('0x124'));}catch(_0x2581d1){logger[_0xfd0b('0x33')](_0x2581d1);}return _0x5a7288;}return this[_0xfd0b('0xe')][_0xfd0b('0x33')](_0x39a660,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0xfd0b('0x15')][_0xfd0b('0x125')]=function(_0x38295e){logger[_0xfd0b('0x2f')](util[_0xfd0b('0x29')](_0xfd0b('0x126'),_0x38295e[_0xfd0b('0x38')]));if(!this[_0xfd0b('0x88')](_0x38295e['aws_access_key_id'])||!this['isConfigured'](_0x38295e['aws_secret_access_key'])){return this['channel']['noop'](_0xfd0b('0x121'));}if(!this['isConfigured'](_0x38295e[_0xfd0b('0x90')])){return this[_0xfd0b('0xe')][_0xfd0b('0xa9')]('no\x20bot\x20name\x20configured');}if(!this['isConfigured'](_0x38295e[_0xfd0b('0x5c')])){return this[_0xfd0b('0xe')][_0xfd0b('0xa9')](_0xfd0b('0xaa'));}this['channel']['bot']=!![];this[_0xfd0b('0x36')](_0x38295e);this[_0xfd0b('0x40')](_0x38295e['text'],'in','','');this[_0xfd0b('0xe')]['noop'](util[_0xfd0b('0x29')]('Trying\x20Amazon\x20Lex:\x20%s',_0x38295e[_0xfd0b('0x5c')]));var _0xbf9c4d=this[_0xfd0b('0x8f')][_0xfd0b('0x70')](this,_0x38295e);if(_0xbf9c4d){for(var _0x32c715 in _0xbf9c4d){if(_0xbf9c4d[_0xfd0b('0x97')](_0x32c715)&&_[_0xfd0b('0x98')](_0xbf9c4d[_0x32c715])){this[_0xfd0b('0xe')][_0xfd0b('0xa0')](util[_0xfd0b('0x29')]('AWS_LEX_%s',_0x32c715[_0xfd0b('0xe8')]()),_0xbf9c4d[_0x32c715]);}}if(_[_0xfd0b('0x42')](_0xbf9c4d['message'])){return this[_0xfd0b('0xe')][_0xfd0b('0xa9')](_0xfd0b('0x127'));}else{this[_0xfd0b('0x40')](_0xbf9c4d['message'],_0xfd0b('0xea'),_0xfd0b('0x128'),'');return this[_0xfd0b('0xe')]['noop'](util[_0xfd0b('0x29')](_0xfd0b('0x129'),_0xbf9c4d[_0xfd0b('0x78')]));}}return this[_0xfd0b('0xe')][_0xfd0b('0x33')](_0x38295e,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0xfd0b('0x15')]['googleasr']=function(_0x1eb7dc){logger[_0xfd0b('0x2f')](util[_0xfd0b('0x29')]('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x1eb7dc[_0xfd0b('0x38')],_0x1eb7dc[_0xfd0b('0x66')]));if(!this['isConfigured'](_0x1eb7dc[_0xfd0b('0x7c')])){return this['channel']['noop'](_0xfd0b('0xe4'));}var _0x497c05=_0xfd0b('0x12a');var _0x32aeb3=util[_0xfd0b('0x29')]('%s/recordings/%s',FILES_PATH,rs[_0xfd0b('0x118')](0x4));var _0x4f0404=util[_0xfd0b('0x29')]('%s.%s',_0x32aeb3,_0x497c05);var _0x4b3b78=!![];if(_0x1eb7dc[_0xfd0b('0x12b')]===_0xfd0b('0x12c')){_0x4b3b78=![];}var _0x41a9a2=this[_0xfd0b('0xe')][_0xfd0b('0x12d')](_0x32aeb3,_0x497c05,_0x1eb7dc['intKey'],_0x1eb7dc[_0xfd0b('0x66')],undefined,_0x4b3b78);if(_0x41a9a2[_0xfd0b('0xa4')]!==-0x1){this[_0xfd0b('0xe')][_0xfd0b('0xa9')](util[_0xfd0b('0x29')](_0xfd0b('0x12e'),_0x4f0404));var _0x4293cc=this['googleASR']['sync'](this,_0x1eb7dc,_0x4f0404);if(_0x4293cc){for(var _0xacaf1b in _0x4293cc){if(_0x4293cc[_0xfd0b('0x97')](_0xacaf1b)){this['channel'][_0xfd0b('0xa0')](util['format']('GOOGLE_ASR_%s',_0xacaf1b[_0xfd0b('0xe8')]()),_0x4293cc[_0xacaf1b]);}}return this[_0xfd0b('0xe')][_0xfd0b('0xa9')](util[_0xfd0b('0x29')](_0xfd0b('0x12f'),JSON[_0xfd0b('0x74')](_0x4293cc)));}}return _0x41a9a2;};AGIVertices[_0xfd0b('0x15')][_0xfd0b('0x130')]=function(_0x2ca76d){logger[_0xfd0b('0x2f')](util[_0xfd0b('0x29')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x2ca76d[_0xfd0b('0x38')]));if(!this[_0xfd0b('0x88')](_0x2ca76d[_0xfd0b('0x93')])){return this['channel'][_0xfd0b('0xa9')]('no\x20appid\x20configured');}if(!this[_0xfd0b('0x88')](_0x2ca76d[_0xfd0b('0x94')])){return this[_0xfd0b('0xe')][_0xfd0b('0xa9')]('no\x20appsecret\x20configured');}var _0x50b802=_0xfd0b('0x12a');var _0x1a4db6=util['format']('%s/recordings/%s',FILES_PATH,rs[_0xfd0b('0x118')](0x4));var _0x2e798a=util['format'](_0xfd0b('0x9f'),_0x1a4db6,_0x50b802);var _0x34590a=!![];if(_0x2ca76d[_0xfd0b('0x12b')]==='NOBEEP'){_0x34590a=![];}var _0x2855b2=this['channel']['recordFile'](_0x1a4db6,_0x50b802,_0x2ca76d['intKey'],_0x2ca76d[_0xfd0b('0x66')],undefined,_0x34590a);if(_0x2855b2[_0xfd0b('0xa4')]!==-0x1){this[_0xfd0b('0xe')]['noop'](util[_0xfd0b('0x29')](_0xfd0b('0x131'),_0x2e798a));var _0x565bbb=this['tildeASR']['sync'](this,_0x2ca76d,_0x2e798a);if(_0x565bbb){for(var _0x4b6fcf in _0x565bbb){if(_0x565bbb[_0xfd0b('0x97')](_0x4b6fcf)){this[_0xfd0b('0xe')][_0xfd0b('0xa0')](util[_0xfd0b('0x29')]('TILDE_ASR_%s',_0x4b6fcf['toUpperCase']()),_0x565bbb[_0x4b6fcf]);}}return this['channel'][_0xfd0b('0xa9')](util[_0xfd0b('0x29')](_0xfd0b('0x132'),JSON[_0xfd0b('0x74')](_0x565bbb)));}}return _0x2855b2;};AGIVertices['prototype'][_0xfd0b('0x133')]=function(_0x34c071){logger[_0xfd0b('0x2f')](util[_0xfd0b('0x29')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x34c071['label']));return this[_0xfd0b('0xe')][_0xfd0b('0x134')](_0x34c071[_0xfd0b('0x3d')],_0x34c071[_0xfd0b('0x135')],_0x34c071[_0xfd0b('0x3e')]);};AGIVertices['prototype']['gotoif']=function(_0x4999c6){logger[_0xfd0b('0x2f')](util[_0xfd0b('0x29')](_0xfd0b('0x136'),_0x4999c6[_0xfd0b('0x38')]));if(!this[_0xfd0b('0x88')](_0x4999c6[_0xfd0b('0x137')])){return this[_0xfd0b('0xe')][_0xfd0b('0x33')](_0x4999c6,_0xfd0b('0x138'));}try{var _0x11078e=eval(_0x4999c6[_0xfd0b('0x137')])?_0xfd0b('0x139'):'false';this['channel'][_0xfd0b('0xa9')](util[_0xfd0b('0x29')]('EVAL\x20CONDITION\x20%s\x20%s',_0x4999c6[_0xfd0b('0x137')],_0x11078e));return{'code':0xc8,'result':_0x11078e};}catch(_0x24a04d){return{'code':0xc8,'result':_0xfd0b('0x13a')};}};AGIVertices[_0xfd0b('0x15')]['gotoiftime']=function(_0x35a5f6){logger['info'](util['format'](_0xfd0b('0x13b'),_0x35a5f6['label']));if(!this[_0xfd0b('0x88')](_0x35a5f6[_0xfd0b('0x13c')])){return this[_0xfd0b('0xe')][_0xfd0b('0x33')](_0x35a5f6,'no\x20interval\x20configured');}var _0x5d0005=this['getIntervals'][_0xfd0b('0x70')](this,_0x35a5f6['interval_id']);if(!_0x5d0005){return this[_0xfd0b('0xe')][_0xfd0b('0x33')](_0x35a5f6,_0xfd0b('0x13d'));}for(var _0x30976d=0x0;_0x30976d<_0x5d0005[_0xfd0b('0x9c')];_0x30976d+=0x1){var _0x2f39c3=this[_0xfd0b('0xe')][_0xfd0b('0x11')](util[_0xfd0b('0x29')]('IFTIME(%s?true:false)',_0x5d0005[_0x30976d]));if(_0x2f39c3[_0xfd0b('0xa4')]===-0x1){return _0x2f39c3;}logger['info'](util[_0xfd0b('0x29')](_0xfd0b('0x13e'),_0x5d0005[_0x30976d],_0x2f39c3[_0xfd0b('0x13f')]));if(_0x2f39c3[_0xfd0b('0x13f')]==='true'){logger[_0xfd0b('0x2f')](util[_0xfd0b('0x29')](_0xfd0b('0x13e'),_0x5d0005[_0x30976d],_0xfd0b('0x139')));this[_0xfd0b('0xe')][_0xfd0b('0xa9')](util[_0xfd0b('0x29')](_0xfd0b('0x13e'),_0x5d0005[_0x30976d],'true'));return{'code':0xc8,'result':'true'};}else{logger[_0xfd0b('0x2f')](util[_0xfd0b('0x29')](_0xfd0b('0x13e'),_0x5d0005[_0x30976d],_0xfd0b('0x13a')));this[_0xfd0b('0xe')][_0xfd0b('0xa9')](util[_0xfd0b('0x29')](_0xfd0b('0x13e'),_0x5d0005[_0x30976d],_0xfd0b('0x13a')));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0xfd0b('0x15')]['hangup']=function(_0x1251fb){logger[_0xfd0b('0x2f')](util['format']('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x1251fb['label']));return this[_0xfd0b('0xe')]['hangup']();};AGIVertices[_0xfd0b('0x15')][_0xfd0b('0x140')]=function(_0x4c5663){logger[_0xfd0b('0x2f')](util['format'](_0xfd0b('0x141'),_0x4c5663[_0xfd0b('0x38')]));if(!this[_0xfd0b('0x88')](_0x4c5663[_0xfd0b('0x7c')])){return this[_0xfd0b('0xe')][_0xfd0b('0xa9')]('no\x20key\x20configured');}var _0x3a14a3=_0xfd0b('0x12a');var _0x3e05aa=util[_0xfd0b('0x29')](_0xfd0b('0x142'),FILES_PATH,rs[_0xfd0b('0x118')](0x4));var _0x2ae2b9=util['format'](_0xfd0b('0x9f'),_0x3e05aa,_0x3a14a3);var _0x5d0f53=!![];if(_0x4c5663[_0xfd0b('0x12b')]===_0xfd0b('0x12c')){_0x5d0f53=![];}var _0x3de156=this['channel'][_0xfd0b('0x12d')](_0x3e05aa,_0x3a14a3,_0x4c5663['intKey'],_0x4c5663[_0xfd0b('0x66')],undefined,_0x5d0f53);if(_0x3de156[_0xfd0b('0xa4')]!==-0x1){this['channel'][_0xfd0b('0xa9')](util[_0xfd0b('0x29')](_0xfd0b('0x143'),_0x2ae2b9));var _0x3079fa=this[_0xfd0b('0x86')]['sync'](this,_0x4c5663,_0x2ae2b9);if(_0x3079fa){for(var _0x7941ad in _0x3079fa){if(_0x3079fa[_0xfd0b('0x97')](_0x7941ad)){this[_0xfd0b('0xe')][_0xfd0b('0xa0')](util['format'](_0xfd0b('0x144'),_0x7941ad[_0xfd0b('0xe8')]()),_0x3079fa[_0x7941ad]);}}return this['channel'][_0xfd0b('0xa9')](util[_0xfd0b('0x29')](_0xfd0b('0x145'),JSON['stringify'](_0x3079fa)));}}return _0x3de156;};AGIVertices[_0xfd0b('0x15')]['ispeechtts']=function(_0x539fb9){logger[_0xfd0b('0x2f')](util[_0xfd0b('0x29')](_0xfd0b('0x146'),_0x539fb9[_0xfd0b('0x38')]));if(!this[_0xfd0b('0x88')](_0x539fb9[_0xfd0b('0x7c')])){return this[_0xfd0b('0xe')][_0xfd0b('0xa9')](_0xfd0b('0xe4'));}if(!this['isConfigured'](_0x539fb9[_0xfd0b('0x5c')])){return this[_0xfd0b('0xe')][_0xfd0b('0xa9')](_0xfd0b('0xaa'));}this[_0xfd0b('0xe')][_0xfd0b('0xa9')](util['format'](_0xfd0b('0x147'),_0x539fb9[_0xfd0b('0x5c')]));var _0x2a8bd7=this[_0xfd0b('0x82')][_0xfd0b('0x70')](this,_0x539fb9);if(_0x2a8bd7){this['channel']['noop'](util[_0xfd0b('0x29')]('ispeech\x20%s\x20file\x20created',_0x2a8bd7));var _0x1a64e5=this[_0xfd0b('0xe')][_0xfd0b('0xfe')](_0x2a8bd7,_0x539fb9[_0xfd0b('0x148')]);try{fs[_0xfd0b('0xff')](_0x2a8bd7+_0xfd0b('0x124'));}catch(_0x440e2a){logger[_0xfd0b('0x33')](_0x440e2a);}return _0x1a64e5;}return this[_0xfd0b('0xe')]['error'](_0x539fb9,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0xfd0b('0x15')][_0xfd0b('0x149')]=function(_0x2d82c0){logger[_0xfd0b('0x2f')](util[_0xfd0b('0x29')](_0xfd0b('0x14a'),_0x2d82c0[_0xfd0b('0x38')]));if(!this[_0xfd0b('0x88')](_0x2d82c0['findBy'])){return this[_0xfd0b('0xe')][_0xfd0b('0x33')](_0x2d82c0,_0xfd0b('0x14b'));}logger[_0xfd0b('0x2f')](util[_0xfd0b('0x29')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel'][_0xfd0b('0x3c')],_0x2d82c0[_0xfd0b('0x14c')]));var _0x5bf7df=this[_0xfd0b('0x53')][_0xfd0b('0x70')](this,_0x2d82c0[_0xfd0b('0x14c')]);if(_0x5bf7df){logger[_0xfd0b('0x2f')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xfd0b('0xe')]['callerid'],_0x2d82c0['findBy']));this[_0xfd0b('0xe')][_0xfd0b('0xa9')](util[_0xfd0b('0x29')](_0xfd0b('0x14d'),this['channel'][_0xfd0b('0x3c')],_0x2d82c0[_0xfd0b('0x14c')]));return{'code':0xc8,'result':'success'};}else{logger[_0xfd0b('0x2f')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xfd0b('0xe')][_0xfd0b('0x3c')],_0x2d82c0[_0xfd0b('0x14c')]));this[_0xfd0b('0xe')][_0xfd0b('0xa9')](util[_0xfd0b('0x29')](_0xfd0b('0x14e'),this[_0xfd0b('0xe')][_0xfd0b('0x3c')],_0x2d82c0['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xfd0b('0x15')][_0xfd0b('0x14f')]=function(_0x5c9339){logger[_0xfd0b('0x2f')](util[_0xfd0b('0x29')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x5c9339['label']));if(!this[_0xfd0b('0x88')](_0x5c9339['findBy'])){return this[_0xfd0b('0xe')][_0xfd0b('0x33')](_0x5c9339,_0xfd0b('0x14b'));}logger[_0xfd0b('0x2f')](util[_0xfd0b('0x29')](_0xfd0b('0x150'),this[_0xfd0b('0xe')][_0xfd0b('0x3c')],_0x5c9339[_0xfd0b('0x14c')]));var _0x82444f=this[_0xfd0b('0x52')][_0xfd0b('0x70')](this,_0x5c9339[_0xfd0b('0x14c')]);if(_0x82444f){logger['info'](util[_0xfd0b('0x29')](_0xfd0b('0x14d'),this[_0xfd0b('0xe')][_0xfd0b('0x3c')],_0x5c9339[_0xfd0b('0x14c')]));this[_0xfd0b('0xe')][_0xfd0b('0xa9')](util[_0xfd0b('0x29')](_0xfd0b('0x14d'),this[_0xfd0b('0xe')][_0xfd0b('0x3c')],_0x5c9339[_0xfd0b('0x14c')]));return{'code':0xc8,'result':_0xfd0b('0x151')};}else{logger[_0xfd0b('0x2f')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xfd0b('0xe')]['callerid'],_0x5c9339[_0xfd0b('0x14c')]));this['channel'][_0xfd0b('0xa9')](util[_0xfd0b('0x29')](_0xfd0b('0x14e'),this['channel'][_0xfd0b('0x3c')],_0x5c9339[_0xfd0b('0x14c')]));return{'code':0xc8,'result':_0xfd0b('0x152')};}};AGIVertices[_0xfd0b('0x15')][_0xfd0b('0x153')]=function(_0x3a12af){logger[_0xfd0b('0x2f')](util[_0xfd0b('0x29')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x3a12af[_0xfd0b('0x38')]));if(!this[_0xfd0b('0x88')](_0x3a12af['operation'])){return this['channel'][_0xfd0b('0x33')](_0x3a12af,'no\x20operation\x20configured');}this['channel']['noop'](util[_0xfd0b('0x29')]('math\x20%s',_0x3a12af[_0xfd0b('0x154')]));var _0x481e99=eval(_0x3a12af[_0xfd0b('0x154')]);if(!this[_0xfd0b('0x88')](_0x3a12af[_0xfd0b('0x111')])){return this['channel']['noop'](_0xfd0b('0xd7'));}var _0x393741=this[_0xfd0b('0x11')][_0xfd0b('0x70')](this,_0x3a12af[_0xfd0b('0x111')]);if(!_0x393741){return this[_0xfd0b('0xe')][_0xfd0b('0x33')](_0x3a12af,'no\x20variable\x20found');}if(_[_0xfd0b('0x9b')](_0x481e99)){var _0x5db104=this;_0x481e99[_0xfd0b('0xd8')](function(_0x578a79,_0x1da0fd){_0x5db104[_0xfd0b('0xe')][_0xfd0b('0xa0')](util[_0xfd0b('0x29')](_0xfd0b('0x155'),_0x393741,_0x1da0fd),_0x578a79);});return this[_0xfd0b('0xe')]['noop'](util[_0xfd0b('0x29')](_0xfd0b('0x156'),_0x393741));}else{return this[_0xfd0b('0xe')][_0xfd0b('0xa0')](_0x393741,_0x481e99);}};AGIVertices[_0xfd0b('0x15')][_0xfd0b('0xc')]=function(_0x3bd682){logger[_0xfd0b('0x2f')](util[_0xfd0b('0x29')](_0xfd0b('0x157'),_0x3bd682[_0xfd0b('0x38')]));if(_0x3bd682['retry']===0x0){return this[_0xfd0b('0xa6')](_0x3bd682);}_0x3bd682[_0xfd0b('0xa7')]-=0x1;if(!this[_0xfd0b('0x88')](_0x3bd682[_0xfd0b('0x10d')])){return this['channel'][_0xfd0b('0x33')](_0x3bd682,_0xfd0b('0x10e'));}var _0x1305d4=this[_0xfd0b('0x10f')][_0xfd0b('0x70')](this,_0x3bd682['file_id']);if(!_0x1305d4){return this['channel'][_0xfd0b('0x33')](_0x3bd682,_0xfd0b('0x110'));}var _0x338058=this[_0xfd0b('0xe')][_0xfd0b('0x112')](_0x1305d4,_0x3bd682[_0xfd0b('0x158')],_0x3bd682[_0xfd0b('0x159')]);var _0x5ccdde=_0x338058['result'];if(_0x338058['result']===-0x1){this[_0xfd0b('0x36')][_0xfd0b('0x70')](this,_0x3bd682,'-1');return _0x338058;}else if(_0x338058[_0xfd0b('0x13f')]===_0xfd0b('0x66')){_0x338058['result']=_0x338058[_0xfd0b('0xa4')][_0xfd0b('0x9c')]>0x0?_0x338058[_0xfd0b('0xa4')]:'t';}else if(_['isEmpty'](_0x338058['result'])){_0x338058[_0xfd0b('0xa4')]='#';_0x5ccdde='#';}if(!this[_0xfd0b('0x88')](_0x3bd682[_0xfd0b('0x111')])){this[_0xfd0b('0xe')][_0xfd0b('0xa9')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x3c3611=this['getVariable'][_0xfd0b('0x70')](this,_0x3bd682[_0xfd0b('0x111')]);if(!_0x3c3611){return this[_0xfd0b('0xe')]['error'](_0x3bd682,_0xfd0b('0x116'));}this[_0xfd0b('0xe')][_0xfd0b('0xa0')](_0x3c3611,_0x5ccdde);}this['createSquareDetailsReport'][_0xfd0b('0x70')](this,_0x3bd682,_0x5ccdde);return _0x338058;};AGIVertices[_0xfd0b('0x15')][_0xfd0b('0xa9')]=function(_0x5703c0){logger[_0xfd0b('0x2f')](util[_0xfd0b('0x29')](_0xfd0b('0x15a'),_0x5703c0[_0xfd0b('0x38')]));return this[_0xfd0b('0xe')][_0xfd0b('0xa9')](_0x5703c0[_0xfd0b('0x15b')]||_0x5703c0[_0xfd0b('0x38')]);};AGIVertices['prototype']['pause']=function(_0x34c475){logger[_0xfd0b('0x2f')](util['format'](_0xfd0b('0x15c'),_0x34c475[_0xfd0b('0x38')]));if(!this['isConfigured'](_0x34c475[_0xfd0b('0x14c')])){return this['channel'][_0xfd0b('0x33')](_0x34c475,_0xfd0b('0x14b'));}logger['info'](util[_0xfd0b('0x29')](_0xfd0b('0x150'),this[_0xfd0b('0xe')][_0xfd0b('0x3c')],_0x34c475[_0xfd0b('0x14c')]));var _0x194c47=this[_0xfd0b('0x4d')]['sync'](this,_0x34c475[_0xfd0b('0x15d')]);var _0x1a153e=this[_0xfd0b('0x4f')]['sync'](this,_0x34c475[_0xfd0b('0x14c')],_0x194c47);if(_0x1a153e){logger[_0xfd0b('0x2f')](util['format'](_0xfd0b('0x14d'),this['channel'][_0xfd0b('0x3c')],_0x34c475[_0xfd0b('0x14c')]));this['channel'][_0xfd0b('0xa9')](util[_0xfd0b('0x29')](_0xfd0b('0x14d'),this['channel'][_0xfd0b('0x3c')],_0x34c475[_0xfd0b('0x14c')]));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0xfd0b('0x29')](_0xfd0b('0x14e'),this[_0xfd0b('0xe')][_0xfd0b('0x3c')],_0x34c475['findBy']));this[_0xfd0b('0xe')][_0xfd0b('0xa9')](util['format'](_0xfd0b('0x14d'),this[_0xfd0b('0xe')]['callerid'],_0x34c475['findBy']));return{'code':0xc8,'result':_0xfd0b('0x152')};}};AGIVertices['prototype'][_0xfd0b('0x15e')]=function(_0x1ee107){logger[_0xfd0b('0x2f')](util[_0xfd0b('0x29')](_0xfd0b('0x15f'),_0x1ee107[_0xfd0b('0x38')]));if(!this[_0xfd0b('0x88')](_0x1ee107[_0xfd0b('0x10d')])){return this[_0xfd0b('0xe')][_0xfd0b('0x33')](_0x1ee107,_0xfd0b('0x10e'));}var _0x4c9c94=this[_0xfd0b('0x10f')]['sync'](this,_0x1ee107[_0xfd0b('0x10d')]);if(!_0x4c9c94){return this[_0xfd0b('0xe')][_0xfd0b('0x33')](_0x1ee107,_0xfd0b('0x110'));}var _0xd93a97=this[_0xfd0b('0xe')][_0xfd0b('0x56')](_0xfd0b('0x160'),[_0x4c9c94,_0x1ee107[_0xfd0b('0x10a')]]);if(_0xd93a97[_0xfd0b('0xa4')]===-0x1){return _0xd93a97;}return this[_0xfd0b('0xe')]['noop'](util[_0xfd0b('0x29')]('Executed\x20command\x20%s\x20%s',_0xfd0b('0x160'),_0x4c9c94));};AGIVertices[_0xfd0b('0x15')]['queue']=function(_0x162f5d){logger[_0xfd0b('0x2f')](util[_0xfd0b('0x29')](_0xfd0b('0x161'),_0x162f5d['label']));if(!this[_0xfd0b('0x88')](_0x162f5d['queue_id'])){return this['channel'][_0xfd0b('0x33')](_0x162f5d,_0xfd0b('0x162'));}var _0xc793e4='';var _0x2b90f8=parseInt(_0x162f5d[_0xfd0b('0x163')],0xa);if(isNaN(_0x2b90f8)){_0xc793e4=_0x162f5d['queue_id'];}else{_0xc793e4=this[_0xfd0b('0x16')][_0xfd0b('0x70')](this,_0x162f5d[_0xfd0b('0x163')]);if(!_0xc793e4){return this['channel'][_0xfd0b('0x33')](_0x162f5d,_0xfd0b('0x164'));}}var _0x3b5bcd='';if(this[_0xfd0b('0x88')](_0x162f5d[_0xfd0b('0x10d')])){var _0x571f17=this[_0xfd0b('0x10f')][_0xfd0b('0x70')](this,_0x162f5d[_0xfd0b('0x10d')]);if(_0x571f17){_0x3b5bcd=_0x571f17;}}this['createSquareDetailsReport']['sync'](this,_0x162f5d,_0xc793e4);if(_0x162f5d[_0xfd0b('0x10a')][_0xfd0b('0x165')]('x')<0x0){_0x162f5d['opts']+='x';}if(_0x162f5d[_0xfd0b('0x10a')][_0xfd0b('0x165')]('X')<0x0){_0x162f5d[_0xfd0b('0x10a')]+='X';}this[_0xfd0b('0xe')][_0xfd0b('0xa0')](_0xfd0b('0x166'),_0xc793e4?_0xc793e4[_0xfd0b('0x167')]():'');var _0xbfdbbd=this[_0xfd0b('0xe')][_0xfd0b('0x56')]('QUEUE',[_0xc793e4,_0x162f5d[_0xfd0b('0x10a')],_0x162f5d[_0xfd0b('0x64')],_0x3b5bcd,_0x162f5d[_0xfd0b('0x66')],_0x162f5d[_0xfd0b('0xb7')],_0x162f5d[_0xfd0b('0x168')],_0x162f5d[_0xfd0b('0x169')],'',_0x162f5d[_0xfd0b('0x16a')]]);if(_0xbfdbbd[_0xfd0b('0xa4')]===-0x1){return _0xbfdbbd;}return this[_0xfd0b('0xe')][_0xfd0b('0xa9')](util['format'](_0xfd0b('0xc6'),_0xfd0b('0x16b'),_0xc793e4));};AGIVertices['prototype'][_0xfd0b('0x16c')]=function(_0x4ef114){logger[_0xfd0b('0x2f')](util[_0xfd0b('0x29')]('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x4ef114[_0xfd0b('0x38')]));var _0x518f97=_0x4ef114[_0xfd0b('0x16d')]||_0xfd0b('0x12a');var _0x5627c1=util[_0xfd0b('0x29')]('%s_%s',this['channel']['uniqueid'],rs[_0xfd0b('0x118')](0x5));var _0xc3370=util[_0xfd0b('0x29')]('%s/recordings/%s.%s',FILES_PATH,_0x5627c1,_0x518f97);var _0x497cbc=util[_0xfd0b('0x29')]('%s/recordings/%s',FILES_PATH,_0x5627c1);this[_0xfd0b('0x3b')][_0xfd0b('0x70')](this,_0x4ef114,_0x5627c1,_0xc3370);this[_0xfd0b('0xe')][_0xfd0b('0xa0')](_0xfd0b('0x16e'),_0x5627c1);logger[_0xfd0b('0x2f')](_0xfd0b('0x16f'),_0x497cbc,_0x518f97,_0x4ef114[_0xfd0b('0x170')],_0x4ef114[_0xfd0b('0x66')]);return this[_0xfd0b('0xe')][_0xfd0b('0x12d')](_0x497cbc,_0x518f97,_0x4ef114['escape_digits'],_0x4ef114[_0xfd0b('0x66')],undefined,!![]);};AGIVertices[_0xfd0b('0x15')]['restapi']=function(_0x4be5d8){logger[_0xfd0b('0x2f')](util['format']('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x4be5d8[_0xfd0b('0x38')]));if(!this[_0xfd0b('0x88')](_0x4be5d8[_0xfd0b('0x64')])){return this['channel'][_0xfd0b('0xa9')](_0xfd0b('0x171'));}var _0x27cffb=this[_0xfd0b('0x63')][_0xfd0b('0x70')](this,_0x4be5d8);logger[_0xfd0b('0x2f')](util['format'](_0xfd0b('0x172'),util[_0xfd0b('0x173')](_0x27cffb,{'showHidden':![],'depth':null})));if(!this[_0xfd0b('0x88')](_0x4be5d8[_0xfd0b('0x111')])){return this[_0xfd0b('0xe')]['noop'](_0xfd0b('0x174'));}var _0x90a7b3=this['getVariable']['sync'](this,_0x4be5d8[_0xfd0b('0x111')]);if(!_0x90a7b3){return this[_0xfd0b('0xe')]['error'](_0x4be5d8,_0xfd0b('0x116'));}this[_0xfd0b('0xe')][_0xfd0b('0xa0')](util[_0xfd0b('0x29')]('%s_STATUS_CODE',_0x90a7b3),_0x27cffb['statusCode']?_0x27cffb[_0xfd0b('0x76')]:_0xfd0b('0x175'));this[_0xfd0b('0xe')]['setVariable'](util[_0xfd0b('0x29')](_0xfd0b('0x176'),_0x90a7b3),_0x27cffb[_0xfd0b('0x77')]?_0x27cffb[_0xfd0b('0x77')]:'OK');if(_0x27cffb['body']){try{this['saveRestApiResult'](_0x27cffb[_0xfd0b('0x73')],_0x90a7b3);}catch(_0x264171){logger[_0xfd0b('0x33')](util[_0xfd0b('0x29')](_0xfd0b('0x177'),_0x90a7b3));}}return this['channel'][_0xfd0b('0xa9')](util[_0xfd0b('0x29')](_0xfd0b('0x178'),_0x90a7b3));};AGIVertices[_0xfd0b('0x15')][_0xfd0b('0x179')]=function(_0x141f86){logger[_0xfd0b('0x2f')](util[_0xfd0b('0x29')](_0xfd0b('0x17a'),_0x141f86['label']));return this[_0xfd0b('0xe')]['sayDigits'](_0x141f86[_0xfd0b('0x17b')][_0xfd0b('0x58')](/\s+/g,''),_0x141f86['escape_digits']);};AGIVertices[_0xfd0b('0x15')][_0xfd0b('0x17c')]=function(_0x2152b2){logger['info'](util[_0xfd0b('0x29')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x2152b2[_0xfd0b('0x38')]));return this[_0xfd0b('0xe')][_0xfd0b('0x17d')](_0x2152b2['number'][_0xfd0b('0x58')](/\s+/g,''),_0x2152b2[_0xfd0b('0x170')]);};AGIVertices[_0xfd0b('0x15')]['sayphonetic']=function(_0x204750){logger[_0xfd0b('0x2f')](util[_0xfd0b('0x29')](_0xfd0b('0x17e'),_0x204750['label']));return this[_0xfd0b('0xe')]['sayPhonetic'](_0x204750[_0xfd0b('0x5c')],_0x204750[_0xfd0b('0x170')]);};AGIVertices[_0xfd0b('0x15')][_0xfd0b('0x17f')]=function(_0x24b6f9){logger[_0xfd0b('0x2f')](util['format'](_0xfd0b('0x180'),_0x24b6f9[_0xfd0b('0x38')]));if(!this[_0xfd0b('0x88')](_0x24b6f9[_0xfd0b('0x181')])){return this[_0xfd0b('0xe')]['noop'](_0xfd0b('0x182'));}var _0x1edf64=this['getMailAccount'][_0xfd0b('0x70')](this,_0x24b6f9[_0xfd0b('0x181')]);if(!_0x1edf64||!_0x1edf64[_0xfd0b('0x183')]){return this[_0xfd0b('0xe')][_0xfd0b('0x33')](_0x24b6f9,'no\x20mail\x20account\x20found');}var _0x2a0f98={'from':util[_0xfd0b('0x29')](_0xfd0b('0x184'),_0x1edf64['name'],_0x1edf64['email']||_0x1edf64['Smtp']['user']),'to':_0x24b6f9['to']||'','cc':_0x24b6f9['cc']||'','bcc':_0x24b6f9[_0xfd0b('0x185')]||'','subject':_0x24b6f9[_0xfd0b('0x186')],'html':_0x24b6f9[_0xfd0b('0x5c')],'text':_0x24b6f9['text']};var _0x4d0a12={'tls':{'rejectUnauthorized':![]}};if(_0x1edf64[_0xfd0b('0x183')][_0xfd0b('0x187')]){_0x4d0a12[_0xfd0b('0x187')]=_0x1edf64[_0xfd0b('0x183')][_0xfd0b('0x187')];}else{_0x4d0a12[_0xfd0b('0x188')]=_0x1edf64[_0xfd0b('0x183')]['host'];_0x4d0a12[_0xfd0b('0x189')]=_0x1edf64[_0xfd0b('0x183')][_0xfd0b('0x189')];_0x4d0a12[_0xfd0b('0x18a')]=_0x1edf64[_0xfd0b('0x183')][_0xfd0b('0x18a')];}if(_0x1edf64['Smtp'][_0xfd0b('0x18b')]){_0x4d0a12[_0xfd0b('0x18c')]={'user':_0x1edf64[_0xfd0b('0x183')][_0xfd0b('0x18d')],'pass':_0x1edf64['Smtp']['pass']};}if(this['isConfigured'](_0x24b6f9[_0xfd0b('0x18e')])){}logger[_0xfd0b('0x18f')](_0xfd0b('0x190'),JSON[_0xfd0b('0x74')](_0x2a0f98));this['createSquareDetailsReport'][_0xfd0b('0x70')](this,_0x24b6f9,_0x24b6f9[_0xfd0b('0x181')]);this[_0xfd0b('0xe')][_0xfd0b('0xa9')](util[_0xfd0b('0x29')](_0xfd0b('0x191'),_0x1edf64[_0xfd0b('0x13')]));this[_0xfd0b('0x23')][_0xfd0b('0x70')](this,_0x4d0a12,_0x2a0f98);return this[_0xfd0b('0xe')][_0xfd0b('0xa9')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0xfd0b('0x15')]['sendFax']=function(_0x169066){logger[_0xfd0b('0x2f')](util['format']('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x169066[_0xfd0b('0x38')]));return this[_0xfd0b('0xe')]['noop']('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0xfd0b('0x15')]['sendSMS']=function(_0x3d01eb){logger[_0xfd0b('0x2f')](util[_0xfd0b('0x29')](_0xfd0b('0x192'),_0x3d01eb['label']));if(!this[_0xfd0b('0x88')](_0x3d01eb[_0xfd0b('0x193')])){return this['channel'][_0xfd0b('0xa9')](_0xfd0b('0x194'));}var _0x1197d4=this[_0xfd0b('0x195')][_0xfd0b('0x70')](this,_0x3d01eb[_0xfd0b('0x193')]);if(!_0x1197d4){return this[_0xfd0b('0xe')][_0xfd0b('0x33')](_0x3d01eb,'no\x20sms\x20account\x20found');}var _0x3628a2={'body':_0x3d01eb[_0xfd0b('0x196')],'phone':_0x3d01eb['to']||'','SmsAccountId':_0x1197d4['id']};logger[_0xfd0b('0x18f')](_0xfd0b('0x197'),JSON[_0xfd0b('0x74')](_0x3628a2));this[_0xfd0b('0x36')][_0xfd0b('0x70')](this,_0x3d01eb,_0x3d01eb[_0xfd0b('0x193')]);this['channel'][_0xfd0b('0xa9')](util[_0xfd0b('0x29')](_0xfd0b('0x198'),_0x1197d4[_0xfd0b('0x13')]));this[_0xfd0b('0x35')]['sync'](this,_0x3628a2);return this[_0xfd0b('0xe')]['noop'](_0xfd0b('0x199'));};AGIVertices[_0xfd0b('0x15')][_0xfd0b('0x19a')]=function(_0x2f510f){logger[_0xfd0b('0x2f')](util[_0xfd0b('0x29')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x2f510f[_0xfd0b('0x38')]));if(!this[_0xfd0b('0x88')](_0x2f510f[_0xfd0b('0x111')])){return this[_0xfd0b('0xe')][_0xfd0b('0x33')](_0x2f510f,_0xfd0b('0x19b'));}var _0x576352=this[_0xfd0b('0x11')][_0xfd0b('0x70')](this,_0x2f510f[_0xfd0b('0x111')]);if(!_0x576352){return this['channel'][_0xfd0b('0x33')](_0x2f510f,_0xfd0b('0x116'));}return this['channel'][_0xfd0b('0xa0')](_0x576352,_0x2f510f[_0xfd0b('0x19c')]);};AGIVertices[_0xfd0b('0x15')][_0xfd0b('0x19d')]=function(_0xf28882){logger[_0xfd0b('0x2f')](util[_0xfd0b('0x29')](_0xfd0b('0x19e'),_0xf28882[_0xfd0b('0x38')]));this[_0xfd0b('0xe')][_0xfd0b('0xa9')](_0xfd0b('0x19f'));if(_0xf28882[_0xfd0b('0xbb')]===_0xfd0b('0x1a0')){this[_0xfd0b('0xe')][_0xfd0b('0xa9')](_0xfd0b('0x1a1'));return this[_0xfd0b('0xe')]['answer']();}return this['channel'][_0xfd0b('0xa9')](_0xfd0b('0x1a2'));};AGIVertices[_0xfd0b('0x15')][_0xfd0b('0x1a3')]=function(_0x3eb46b){logger['info'](util['format'](_0xfd0b('0x1a4'),_0x3eb46b[_0xfd0b('0x38')]));if(!this[_0xfd0b('0x88')](_0x3eb46b['project_id'])){return this[_0xfd0b('0xe')][_0xfd0b('0x33')](_0x3eb46b,_0xfd0b('0x1a5'));}var _0x1ccc88=this['getSquareProject'][_0xfd0b('0x70')](this,_0x3eb46b[_0xfd0b('0x1a6')]);if(!this['isConfigured'](_0x1ccc88)){return this[_0xfd0b('0xe')]['error'](_0x3eb46b,util['format'](_0xfd0b('0x1a7'),_0x3eb46b['project_id']));}if(_0x1ccc88===this[_0xfd0b('0xe')][_0xfd0b('0x3a')]){return this[_0xfd0b('0xe')][_0xfd0b('0x33')](_0x3eb46b,_0xfd0b('0x1a8'));}this[_0xfd0b('0x36')][_0xfd0b('0x70')](this,_0x3eb46b,_0x1ccc88);var _0x1cc614=this[_0xfd0b('0xe')][_0xfd0b('0x56')](_0xfd0b('0x1a9'),util['format']('agi://%s/square,\x22%s\x22,\x22%s\x22',config['agi']['host']||_0xfd0b('0x1aa'),_0x1ccc88,this[_0xfd0b('0xe')]['arg_1']));if(_0x1cc614[_0xfd0b('0xa4')]===-0x1){return _0x1cc614;}return this[_0xfd0b('0xe')][_0xfd0b('0xa9')](util[_0xfd0b('0x29')](_0xfd0b('0xc6'),'AGI',_0x1ccc88));};AGIVertices[_0xfd0b('0x15')][_0xfd0b('0x1ab')]=function(_0x324115){logger[_0xfd0b('0x2f')](util[_0xfd0b('0x29')](_0xfd0b('0x1ac'),_0x324115[_0xfd0b('0x38')]));var _0x5c3d51=this[_0xfd0b('0x1ad')][_0xfd0b('0x70')](this,_0x324115['command']);this['createSquareDetailsReport']['sync'](this,_0x324115,_0x324115['command']);if(this[_0xfd0b('0x88')](_0x324115[_0xfd0b('0x111')])){var _0x5c01d4=this[_0xfd0b('0x11')][_0xfd0b('0x70')](this,_0x324115[_0xfd0b('0x111')]);if(_0x5c01d4){this[_0xfd0b('0xe')]['setVariable'](_0x5c01d4,_0x5c3d51);return this[_0xfd0b('0xe')][_0xfd0b('0xa9')](util[_0xfd0b('0x29')](_0xfd0b('0x1ae'),_0x324115[_0xfd0b('0xb9')],_0x5c01d4));}}return this['channel'][_0xfd0b('0xa9')](util[_0xfd0b('0x29')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x324115[_0xfd0b('0xb9')]));};AGIVertices[_0xfd0b('0x15')][_0xfd0b('0x1af')]=function(_0x593f65){logger[_0xfd0b('0x2f')](util[_0xfd0b('0x29')](_0xfd0b('0x1b0'),_0x593f65[_0xfd0b('0x38')]));_0x593f65[_0xfd0b('0x5c')]=_0x593f65[_0xfd0b('0x5c')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x593f65['apiKey'])){return this[_0xfd0b('0xe')][_0xfd0b('0xa9')](_0xfd0b('0x1b1'));}if(!this['isConfigured'](_0x593f65[_0xfd0b('0x5c')])){return this[_0xfd0b('0xe')][_0xfd0b('0xa9')](_0xfd0b('0xaa'));}this[_0xfd0b('0xe')][_0xfd0b('0xa9')](util[_0xfd0b('0x29')](_0xfd0b('0x1b2'),_0x593f65[_0xfd0b('0x5c')]));var _0x139cf9=this[_0xfd0b('0x59')][_0xfd0b('0x70')](this,_0x593f65);if(_0x139cf9){this[_0xfd0b('0xe')][_0xfd0b('0xa9')](util[_0xfd0b('0x29')](_0xfd0b('0x1b3'),_0x139cf9));var _0x7ce624=this['channel']['streamFile'](_0x139cf9);try{fs[_0xfd0b('0xff')](_0x139cf9+_0xfd0b('0x124'));}catch(_0x5f3132){logger[_0xfd0b('0x33')](_0x5f3132);}return _0x7ce624;}return this['channel'][_0xfd0b('0x33')](_0x593f65,_0xfd0b('0x1b4'));};AGIVertices['prototype'][_0xfd0b('0x1b5')]=function(_0x2721f8){logger[_0xfd0b('0x2f')](util[_0xfd0b('0x29')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x2721f8[_0xfd0b('0x38')]));_0x2721f8[_0xfd0b('0x5c')]=_0x2721f8[_0xfd0b('0x5c')][_0xfd0b('0x58')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xfd0b('0x88')](_0x2721f8[_0xfd0b('0x5c')])){return this[_0xfd0b('0xe')]['noop'](_0xfd0b('0xaa'));}this[_0xfd0b('0xe')][_0xfd0b('0xa9')](util[_0xfd0b('0x29')]('Trying\x20Google\x20TTS\x20%s',_0x2721f8[_0xfd0b('0x5c')]));var _0x4a0094=this[_0xfd0b('0x62')][_0xfd0b('0x70')](this,_0x2721f8);if(_0x4a0094){this['channel'][_0xfd0b('0xa9')](util[_0xfd0b('0x29')](_0xfd0b('0x1b6'),_0x4a0094));var _0x250dbb=this[_0xfd0b('0xe')]['streamFile'](_0x4a0094);try{fs[_0xfd0b('0xff')](_0x4a0094+_0xfd0b('0x124'));}catch(_0x12c9e0){logger[_0xfd0b('0x33')](_0x12c9e0);}return _0x250dbb;}return this[_0xfd0b('0xe')][_0xfd0b('0x33')](_0x2721f8,_0xfd0b('0x1b7'));};AGIVertices[_0xfd0b('0x15')][_0xfd0b('0x1b8')]=function(_0x7338ab){logger[_0xfd0b('0x2f')](util[_0xfd0b('0x29')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x7338ab['label']));if(!this[_0xfd0b('0x88')](_0x7338ab[_0xfd0b('0x14c')])){return this[_0xfd0b('0xe')][_0xfd0b('0x33')](_0x7338ab,_0xfd0b('0x14b'));}logger[_0xfd0b('0x2f')](util[_0xfd0b('0x29')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xfd0b('0xe')][_0xfd0b('0x3c')],_0x7338ab[_0xfd0b('0x14c')]));var _0x3caeeb=this[_0xfd0b('0x51')][_0xfd0b('0x70')](this,_0x7338ab[_0xfd0b('0x14c')]);if(_0x3caeeb){logger['info'](util[_0xfd0b('0x29')](_0xfd0b('0x14d'),this['channel'][_0xfd0b('0x3c')],_0x7338ab[_0xfd0b('0x14c')]));this['channel'][_0xfd0b('0xa9')](util[_0xfd0b('0x29')](_0xfd0b('0x14d'),this['channel'][_0xfd0b('0x3c')],_0x7338ab[_0xfd0b('0x14c')]));return{'code':0xc8,'result':'success'};}else{logger[_0xfd0b('0x2f')](util[_0xfd0b('0x29')](_0xfd0b('0x14e'),this[_0xfd0b('0xe')][_0xfd0b('0x3c')],_0x7338ab[_0xfd0b('0x14c')]));this['channel'][_0xfd0b('0xa9')](util[_0xfd0b('0x29')](_0xfd0b('0x14e'),this[_0xfd0b('0xe')]['callerid'],_0x7338ab[_0xfd0b('0x14c')]));return{'code':0xc8,'result':_0xfd0b('0x152')};}};AGIVertices[_0xfd0b('0x15')]['voicemail']=function(_0x3e2ccf){logger[_0xfd0b('0x2f')](util[_0xfd0b('0x29')](_0xfd0b('0x1b9'),_0x3e2ccf[_0xfd0b('0x38')]));var _0x2ea453=this[_0xfd0b('0xe')]['exec'](_0xfd0b('0x1ba'),[_0x3e2ccf[_0xfd0b('0x1bb')],_0x3e2ccf[_0xfd0b('0x7a')]]);if(_0x2ea453['result']===-0x1){return _0x2ea453;}return this['channel'][_0xfd0b('0xa9')](util[_0xfd0b('0x29')]('Executed\x20command\x20%s\x20%s','VOICEMAIL',_0x3e2ccf[_0xfd0b('0x1bb')]));};AGIVertices[_0xfd0b('0x15')][_0xfd0b('0x1bc')]=function(_0x358758){logger['info'](util[_0xfd0b('0x29')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x358758[_0xfd0b('0x38')]));if(!this[_0xfd0b('0x88')](_0x358758[_0xfd0b('0x111')])){return this[_0xfd0b('0xe')][_0xfd0b('0x33')](_0x358758,_0xfd0b('0x19b'));}var _0x5f4024=this[_0xfd0b('0x11')]['sync'](this,_0x358758[_0xfd0b('0x111')]);if(!_0x5f4024){return this[_0xfd0b('0xe')][_0xfd0b('0x33')](_0x358758,_0xfd0b('0x116'));}var _0xcea68f=this[_0xfd0b('0xe')][_0xfd0b('0x11')](_0x5f4024);return{'code':0xc8,'result':_0xcea68f['extra']?_0xcea68f[_0xfd0b('0x13f')]:'-'};};String[_0xfd0b('0x15')][_0xfd0b('0xa2')]=function(_0x23bd23,_0x17ee94){return this[_0xfd0b('0xa1')](_0x23bd23)['join'](_0x17ee94);};module['exports']=AGIVertices; \ No newline at end of file +var _0x2455=['no\x20username\x20configured','password','Trying\x20SestekNDA:\x20%s','Sestek\x20NDA\x20%s\x20file\x20created','audiofile','streamFile','.wav','SestekNDA\x20Result\x20%s','end','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','Enter\x20in\x20FINALLY\x20(%s)\x20block','finally','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','maxdigit','mindigit','hiddendigitsnum','hiddendigitspos','first','substr','generate','getsecretdigits','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','unlink','aws\x20Polly\x20is\x20unreachable','awslex','no\x20valid\x20credentials\x20configured','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','no\x20key\x20configured','wav','%s/recordings/%s','NOBEEP','recordFile','google\x20%s\x20file\x20created','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','beep','intKey','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','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','ispeechasr','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','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','findBy','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','Enter\x20in\x20LOGOUT\x20(%s)\x20block','agentLogout','success','math','Enter\x20in\x20MATH\x20(%s)\x20block','no\x20operation\x20configured','operation','forEach','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','response','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','getPause','playback','PLAYBACK','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','indexOf','XMCS-QUEUE','QUEUE','macro','position','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','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','sayNumber','sayphonetic','sayPhonetic','account_id','no\x20mail\x20account\x20configured','Smtp','\x22%s\x22\x20<%s>','email','user','subject','service','host','port','secure','authentication','pass','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','no\x20sms\x20account\x20configured','sms_text','sms_account_id','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','subproject','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','command','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','tts','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','path','util','lodash','shelljs','odbc','request-promise','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','menu','getdigits','rpc','mailRpc','prototype','getVariable','getVariableById','then','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareOdbc','getSquareOdbcById','dsn','getUser','getTrunk','getSound','getSoundById','getSoundPath','save_name','getMailAccount','sendMailMessage','getIntervals','getIntervalById','interval','map','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','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','createSmsMessage','createSquareDetailsReport','channel','uniqueid','label','arg_1','createSquareRecording','callerid','calleridname','context','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPauseById','agentPause','agent','agentUnpause','agentLogin','internal','LOCAL','shellCommand','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','en-US','ssmlGender','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','method','timeout','number','includes','POST','toUpperCase','body','rawBody','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','client_email','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_polly_region','aws_polly_voice','Amy','aws_text_type','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','agicommand','clone','isString','replaceObjectAllVariables','recursiveNodeIndex','hasOwnProperty','isArray','replaceAllVariables','saveRestApiResult','isPlainObject','%s.%s','length','setVariable','split','replaceAll','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','extra','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','exec','MRCPSynth','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','getAndSetVariable','RECOG_CONFIDENCE()','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','args','Wait\x20%s\x20seconds\x20before\x20answer','answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','list_id','no\x20list\x20selected','delay','add','minutes','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','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','MRCPRecog','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','replace','query:\x20%s','no\x20variable\x20selected\x20for\x20the\x20result','variable_id','no\x20variable\x20found','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','speech','out','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','dialogflowV2_project_id','no\x20project_id\x20configured','no\x20client_email\x20configured','private_key','no\x20private_key\x20configured','no\x20anguage\x20configured','bot','Trying\x20DialogflowV2:\x20%s','providerResponse','DIALOGFLOW_%s','DialogflowV2\x20is\x20unreachable','sesteknda','ndauth_url','username'];(function(_0x2cba09,_0x23ee85){var _0x10d084=function(_0x11d2e4){while(--_0x11d2e4){_0x2cba09['push'](_0x2cba09['shift']());}};_0x10d084(++_0x23ee85);}(_0x2455,0xd3));var _0x5245=function(_0x28888c,_0x426db0){_0x28888c=_0x28888c-0x0;var _0x176462=_0x2455[_0x28888c];return _0x176462;};'use strict';var fs=require('fs');var path=require(_0x5245('0x0'));var util=require(_0x5245('0x1'));var _=require(_0x5245('0x2'));var sh=require(_0x5245('0x3'));var odbc=require(_0x5245('0x4'))();var rs=require('randomstring');var moment=require('moment');var Mustache=require('mustache');var rp=require(_0x5245('0x5'));var logger=require(_0x5245('0x6'))(_0x5245('0x7'));var config=require(_0x5245('0x8'));var scripts=require(_0x5245('0x9'));var FILES_PATH=_0x5245('0xa');var recursiveMapAttributes=['rawHeaders','rawBody'];var verticesWithRetry=[_0x5245('0xb'),_0x5245('0xc'),'getsecretdigits'];var AGIVertices=function(_0x4b62a9,_0x401746,_0xfaf286){this['channel']=_0x4b62a9;this[_0x5245('0xd')]=_0x401746;this[_0x5245('0xe')]=_0xfaf286;};AGIVertices[_0x5245('0xf')][_0x5245('0x10')]=function(_0x238c09,_0x32fa16){this[_0x5245('0xd')][_0x5245('0x11')](_0x238c09)[_0x5245('0x12')](function(_0x485e2c){_0x32fa16(null,_0x485e2c?_0x485e2c[_0x5245('0x13')]:![]);})[_0x5245('0x14')](function(_0x4a032e){_0x32fa16(_0x4a032e);});};AGIVertices[_0x5245('0xf')][_0x5245('0x15')]=function(_0xdd10e2,_0x373f3e){this['rpc'][_0x5245('0x16')](_0xdd10e2)[_0x5245('0x12')](function(_0x449079){_0x373f3e(null,_0x449079?_0x449079[_0x5245('0x13')]:![]);})[_0x5245('0x14')](function(_0x1b45a2){_0x373f3e(_0x1b45a2);});};AGIVertices[_0x5245('0xf')][_0x5245('0x17')]=function(_0x1b1ccd,_0x2bcdff){this[_0x5245('0xd')]['getSquareProjectById'](_0x1b1ccd)[_0x5245('0x12')](function(_0x2d5747){_0x2bcdff(null,_0x2d5747?_0x2d5747[_0x5245('0x13')]:![]);})[_0x5245('0x14')](function(_0x399ab0){_0x2bcdff(_0x399ab0);});};AGIVertices[_0x5245('0xf')][_0x5245('0x18')]=function(_0x3a32dc,_0x4ff89b){this[_0x5245('0xd')][_0x5245('0x19')](_0x3a32dc)[_0x5245('0x12')](function(_0x1bc8bf){_0x4ff89b(null,_0x1bc8bf?_0x1bc8bf[_0x5245('0x1a')]:![]);})['catch'](function(_0x4cc2cb){_0x4ff89b(_0x4cc2cb);});};AGIVertices[_0x5245('0xf')][_0x5245('0x1b')]=function(_0x41266e,_0x2998ac){this['rpc']['getUserById'](_0x41266e)[_0x5245('0x12')](function(_0xf04d29){_0x2998ac(null,_0xf04d29?_0xf04d29[_0x5245('0x13')]:![]);})[_0x5245('0x14')](function(_0x45db53){_0x2998ac(_0x45db53);});};AGIVertices[_0x5245('0xf')][_0x5245('0x1c')]=function(_0x4a9cbe,_0x39aee9){this[_0x5245('0xd')]['getTrunkById'](_0x4a9cbe)[_0x5245('0x12')](function(_0x409d41){_0x39aee9(null,_0x409d41?_0x409d41['name']:![]);})[_0x5245('0x14')](function(_0x4f0a2d){_0x39aee9(_0x4f0a2d);});};AGIVertices[_0x5245('0xf')][_0x5245('0x1d')]=function(_0x596deb,_0x259fe0){var _0x157252=this;this[_0x5245('0xd')][_0x5245('0x1e')](_0x596deb)[_0x5245('0x12')](function(_0x4b26b9){_0x259fe0(null,_0x4b26b9?_0x157252[_0x5245('0x1f')](_0x4b26b9[_0x5245('0x20')]):![]);})[_0x5245('0x14')](function(_0x256c96){_0x259fe0(_0x256c96);});};AGIVertices['prototype'][_0x5245('0x21')]=function(_0x2399b6,_0x494a0a){this[_0x5245('0xd')]['getMailAccountById'](_0x2399b6)[_0x5245('0x12')](function(_0x5a8b94){_0x494a0a(null,_0x5a8b94?_0x5a8b94:![]);})['catch'](function(_0x3922a9){_0x494a0a(_0x3922a9);});};AGIVertices['prototype'][_0x5245('0x22')]=function(_0x4fe95b,_0x36c727,_0x526abd){this['mailRpc']['sendMailMessage'](_0x4fe95b,_0x36c727)[_0x5245('0x12')](function(){_0x526abd(null);})[_0x5245('0x14')](function(_0x392b4f){_0x526abd(_0x392b4f);});};AGIVertices[_0x5245('0xf')][_0x5245('0x23')]=function(_0x1c1696,_0x902d58){this[_0x5245('0xd')][_0x5245('0x24')](_0x1c1696)[_0x5245('0x12')](function(_0x208076){if(_0x208076){if(_0x208076['IntervalId']){_0x902d58(null,[_0x208076[_0x5245('0x25')]]);}else{_0x902d58(null,_[_0x5245('0x26')](_0x208076[_0x5245('0x27')],_0x5245('0x25')));}}else{_0x902d58(null,![]);}})[_0x5245('0x14')](function(_0x53ae67){_0x902d58(_0x53ae67);});};AGIVertices[_0x5245('0xf')][_0x5245('0x1f')]=function(_0x1f4b9d){return util[_0x5245('0x28')](_0x5245('0x29'),FILES_PATH,_0x1f4b9d);};AGIVertices[_0x5245('0xf')][_0x5245('0x2a')]=function(_0x41234b,_0x4e3e80,_0x26763f){odbc[_0x5245('0x2b')](_0x41234b,function(_0x13c362){if(_0x13c362){logger[_0x5245('0x2c')](_0x5245('0x2d'),_0x13c362);_0x26763f(_0x13c362);}else{logger[_0x5245('0x2e')](_0x5245('0x2f'));odbc[_0x5245('0x30')](_0x4e3e80,function(_0x2e3110,_0x2e39ab){if(_0x2e3110){logger['info'](_0x5245('0x31'),_0x4e3e80);_0x26763f(_0x2e3110);}else{logger[_0x5245('0x2e')](_0x5245('0x32'),_0x4e3e80);odbc[_0x5245('0x33')](function(_0x49be67){if(_0x49be67){logger[_0x5245('0x2c')](_0x5245('0x34'),_0x49be67);}_0x26763f(null,_0x2e39ab);});}});}});};AGIVertices[_0x5245('0xf')][_0x5245('0x35')]=function(_0x5d63ad,_0x52a959){this[_0x5245('0xd')]['getSmsAccountById'](_0x5d63ad)[_0x5245('0x12')](function(_0x4c393d){_0x52a959(null,_0x4c393d?_0x4c393d:![]);})[_0x5245('0x14')](function(_0x5c9020){_0x52a959(_0x5c9020);});};AGIVertices['prototype']['createSmsMessage']=function(_0x371188,_0x1603a8){this[_0x5245('0xd')][_0x5245('0x36')](_0x371188)[_0x5245('0x12')](function(_0x3e2a8d){_0x1603a8(null,_0x3e2a8d);})['catch'](function(_0x4f6446){_0x1603a8(_0x4f6446);});};AGIVertices['prototype'][_0x5245('0x37')]=function(_0x1cffb1,_0x21c6a0,_0x389c32){this[_0x5245('0xd')][_0x5245('0x37')]({'uniqueid':this[_0x5245('0x38')][_0x5245('0x39')],'node':_0x1cffb1[_0x5245('0x3a')],'application':_0x1cffb1['agicommand'],'data':_0x21c6a0||null,'project_name':this['channel'][_0x5245('0x3b')],'callerid':this[_0x5245('0x38')]['callerid']})[_0x5245('0x12')](function(_0xa87ec6){if(_0x389c32){_0x389c32(null,_0xa87ec6);}})['catch'](function(_0x33cdb2){if(_0x389c32){_0x389c32(_0x33cdb2);}});};AGIVertices['prototype'][_0x5245('0x3c')]=function(_0x55902b,_0x2c6c4a,_0x1c40f9,_0x5a0486){this[_0x5245('0xd')][_0x5245('0x3c')]({'uniqueid':this[_0x5245('0x38')][_0x5245('0x39')],'callerid':this[_0x5245('0x38')][_0x5245('0x3d')],'calleridname':this[_0x5245('0x38')][_0x5245('0x3e')],'context':this[_0x5245('0x38')][_0x5245('0x3f')],'extension':this[_0x5245('0x38')][_0x5245('0x40')],'priority':this[_0x5245('0x38')][_0x5245('0x41')],'accountcode':this[_0x5245('0x38')][_0x5245('0x42')],'dnid':this[_0x5245('0x38')][_0x5245('0x43')],'projectName':this[_0x5245('0x38')][_0x5245('0x3b')],'saveName':_0x2c6c4a,'filename':_0x55902b[_0x5245('0x44')]||_0x2c6c4a,'savePath':_0x1c40f9})[_0x5245('0x12')](function(_0x392ebe){_0x5a0486(null,_0x392ebe);})[_0x5245('0x14')](function(_0x2ea305){_0x5a0486(_0x2ea305);});};AGIVertices['prototype'][_0x5245('0x45')]=function(_0x52d6ea,_0xe1f093,_0x4af591,_0x5dcd44,_0x487d34){this[_0x5245('0xd')][_0x5245('0x45')]({'uniqueid':this[_0x5245('0x38')][_0x5245('0x39')],'body':_0x52d6ea,'direction':_0xe1f093,'providerName':_0x4af591,'providerResponse':_0x5dcd44})['then'](function(_0xdcc48a){if(_0x487d34){_0x487d34(null,_0xdcc48a);}})[_0x5245('0x14')](function(_0x43caf3){if(_0x487d34){_0x487d34(_0x43caf3);}});};AGIVertices[_0x5245('0xf')][_0x5245('0x46')]=function(_0x5843be,_0x5ac2a2){this[_0x5245('0xd')][_0x5245('0x46')]({'firstName':_[_0x5245('0x47')](_0x5843be['name'])||_[_0x5245('0x48')](_0x5843be[_0x5245('0x13')])?_0x5245('0x49')+Math[_0x5245('0x4a')]():_0x5843be['name'],'lastName':_[_0x5245('0x47')](_0x5843be[_0x5245('0x4b')])||_['isNil'](_0x5843be['lastName'])?null:_0x5843be[_0x5245('0x4b')],'phone':_0x5843be[_0x5245('0x4c')],'ListId':_0x5843be['list_id'],'scheduledat':_0x5843be[_0x5245('0x4d')],'callbackUniqueid':this['channel'][_0x5245('0x39')],'tags':_0x5245('0x4e'),'description':_0x5245('0x4f')+_0x5843be['scheduledAt'][_0x5245('0x50')](),'priority':_0x5843be[_0x5245('0x51')]})[_0x5245('0x12')](function(_0x3cd653){_0x5ac2a2(null,_0x3cd653);})[_0x5245('0x14')](function(_0x37a759){_0x5ac2a2(_0x37a759);});};AGIVertices[_0x5245('0xf')]['getPause']=function(_0x598267,_0x4c232a){this['rpc'][_0x5245('0x52')](_0x598267)[_0x5245('0x12')](function(_0x522209){_0x4c232a(null,_0x522209?_0x522209[_0x5245('0x13')]:![]);})[_0x5245('0x14')](function(_0x3a6eef){_0x4c232a(_0x3a6eef);});};AGIVertices['prototype'][_0x5245('0x53')]=function(_0x1c579f,_0x11aadb,_0x9daf42){var _0x20eef1={'role':_0x5245('0x54')};_0x20eef1[_0x1c579f]=this[_0x5245('0x38')][_0x5245('0x3d')];this[_0x5245('0xd')]['agentPause'](_0x20eef1,_0x11aadb,this['channel']['uniqueid'])[_0x5245('0x12')](function(_0x276cfb){_0x9daf42(null,_[_0x5245('0x48')](_0x276cfb)?![]:!![]);})[_0x5245('0x14')](function(_0x58111f){logger['error'](_0x58111f);_0x9daf42(null,![]);});};AGIVertices[_0x5245('0xf')][_0x5245('0x55')]=function(_0x4aafa9,_0x675179){var _0x4c1284={'role':'agent'};_0x4c1284[_0x4aafa9]=this[_0x5245('0x38')]['callerid'];this['rpc'][_0x5245('0x55')](_0x4c1284)[_0x5245('0x12')](function(_0x58408f){_0x675179(null,_[_0x5245('0x48')](_0x58408f)?![]:!![]);})[_0x5245('0x14')](function(_0x3c4998){logger['error'](_0x3c4998);_0x675179(null,![]);});};AGIVertices[_0x5245('0xf')]['agentLogout']=function(_0x3147e7,_0x33d598){var _0x5c9a2f={'role':_0x5245('0x54')};_0x5c9a2f[_0x3147e7]=this['channel'][_0x5245('0x3d')];this[_0x5245('0xd')]['agentLogout'](_0x5c9a2f)[_0x5245('0x12')](function(_0x51b78a){_0x33d598(null,_[_0x5245('0x48')](_0x51b78a)?![]:!![]);})[_0x5245('0x14')](function(_0x4d68ad){logger[_0x5245('0x2c')](_0x4d68ad);_0x33d598(null,![]);});};AGIVertices[_0x5245('0xf')][_0x5245('0x56')]=function(_0xda1da0,_0x3e630c){var _0x4219ac={'role':_0x5245('0x54')};_0x4219ac[_0xda1da0]=this[_0x5245('0x38')][_0x5245('0x3d')];var _0x44d905=_0xda1da0!=_0x5245('0x57')?util[_0x5245('0x28')]('%s/%s@from-sip/n',_0x5245('0x58'),this[_0x5245('0x38')][_0x5245('0x3d')]):undefined;this[_0x5245('0xd')]['agentLogin'](_0x4219ac,_0x44d905)[_0x5245('0x12')](function(_0x239e28){_0x3e630c(null,_[_0x5245('0x48')](_0x239e28)?![]:!![]);})[_0x5245('0x14')](function(_0x5bd0cc){logger['error'](_0x5bd0cc);_0x3e630c(null,![]);});};AGIVertices[_0x5245('0xf')][_0x5245('0x59')]=function(_0x2f292d,_0x5a2a40){sh['exec'](_['trim'](_0x2f292d),function(_0x348d0a,_0x396d56){var _0x7694ef=_0x396d56['replace'](/(\r\n|\n|\r)/gm,'');_0x5a2a40(null,_0x7694ef);});};AGIVertices['prototype'][_0x5245('0x5a')]=function(_0x533133,_0x1fc909){scripts[_0x5245('0x5a')](_0x533133[_0x5245('0x5b')],_0x533133[_0x5245('0x5c')]||_0x5245('0x5d'),_0x533133['text'],_0x533133['languageCode']||_0x5245('0x5e'),_0x533133[_0x5245('0x5f')]||'MALE',_0x533133[_0x5245('0x60')]||_0x5245('0x61'))[_0x5245('0x12')](function(_0x8ebe56){_0x1fc909(null,_0x8ebe56);})[_0x5245('0x14')](function(_0x1f93c5){_0x1fc909(_0x1f93c5);});};AGIVertices[_0x5245('0xf')][_0x5245('0x62')]=function(_0x268d30,_0x2ea632){scripts[_0x5245('0x62')](_0x268d30[_0x5245('0x5d')],_0x268d30[_0x5245('0x63')]||'en',0x1)[_0x5245('0x12')](function(_0x3c4fbd){_0x2ea632(null,_0x3c4fbd);})[_0x5245('0x14')](function(_0x37cf58){_0x2ea632(_0x37cf58);});};AGIVertices['prototype'][_0x5245('0x64')]=function(_0x153aba,_0x271d69){var _0x28f8a8={'uri':_0x153aba[_0x5245('0x65')],'method':_0x153aba[_0x5245('0x66')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x153aba[_0x5245('0x67')])===_0x5245('0x68')&&parseInt(_0x153aba[_0x5245('0x67')])>=0x1?parseInt(_0x153aba[_0x5245('0x67')])*0x3e8:0x5*0x3e8};if(_[_0x5245('0x69')]([_0x5245('0x6a'),'PUT'],_0x28f8a8['method'][_0x5245('0x6b')]())){try{_0x28f8a8[_0x5245('0x6c')]=_0x153aba[_0x5245('0x6d')]?JSON[_0x5245('0x6e')](_0x153aba[_0x5245('0x6d')]):{};}catch(_0x3afedc){logger[_0x5245('0x2c')](_0x5245('0x6f'),_0x3afedc);}}try{_0x28f8a8[_0x5245('0x70')]=_0x153aba['rawHeaders']?JSON[_0x5245('0x6e')](_0x153aba[_0x5245('0x71')]):{};}catch(_0x43b86a){logger[_0x5245('0x2c')](_0x5245('0x72'),_0x43b86a);}if(_0x153aba[_0x5245('0x73')]){try{var _0xcfab9f=require(_0x153aba[_0x5245('0x73')])[_0x5245('0x74')](this,_0x28f8a8);_0x28f8a8[_0x5245('0x75')]=Mustache[_0x5245('0x76')](_0x153aba['url'],_0xcfab9f,{},['$$','$$']);if(_0x28f8a8[_0x5245('0x70')]){_0x28f8a8[_0x5245('0x70')]=JSON[_0x5245('0x6e')](Mustache[_0x5245('0x76')](JSON['stringify'](_0x28f8a8['headers']),_0xcfab9f,{},['$$','$$']));}if(_0x28f8a8['body']){_0x28f8a8[_0x5245('0x6c')]=JSON['parse'](Mustache[_0x5245('0x76')](JSON[_0x5245('0x77')](_0x28f8a8[_0x5245('0x6c')]),_0xcfab9f,{},['$$','$$']));}}catch(_0xcf086e){logger[_0x5245('0x2c')](_0x5245('0x78'),_0xcf086e);}}rp(_0x28f8a8)[_0x5245('0x12')](function(_0x25fcd4){var _0x42b1e3={'statusCode':_0x25fcd4[_0x5245('0x79')]||0xc8,'statusMessage':_0x25fcd4[_0x5245('0x7a')]||'OK','headers':_0x25fcd4[_0x5245('0x70')]||{},'body':_0x25fcd4[_0x5245('0x6c')]||{}};_0x271d69(null,_0x42b1e3);})[_0x5245('0x14')](function(_0x5b2a82){var _0x1f6ef0={'statusCode':_0x5b2a82[_0x5245('0x79')]||0x1f4,'statusMessage':_0x5b2a82[_0x5245('0x7b')]||_0x5245('0x7c'),'headers':_0x5b2a82[_0x5245('0x7d')][_0x5245('0x70')]||{},'body':_0x5b2a82[_0x5245('0x7d')][_0x5245('0x6c')]||{}};_0x271d69(null,_0x1f6ef0);});};AGIVertices[_0x5245('0xf')][_0x5245('0x7e')]=function(_0x2b78e6,_0x54f46a){scripts[_0x5245('0x7e')](this[_0x5245('0x38')][_0x5245('0x39')],_0x2b78e6[_0x5245('0x7f')],_0x2b78e6[_0x5245('0x5d')],_0x2b78e6[_0x5245('0x80')]||'en')['then'](function(_0x192b28){_0x54f46a(null,_0x192b28);})[_0x5245('0x14')](function(_0x308f00){_0x54f46a(_0x308f00);});};AGIVertices[_0x5245('0xf')][_0x5245('0x81')]=function(_0x20dc63,_0x1b32d7){scripts[_0x5245('0x81')](this[_0x5245('0x38')][_0x5245('0x39')],_0x20dc63['dialogflowV2_project_id'],_0x20dc63[_0x5245('0x82')],_0x20dc63['private_key'],_0x20dc63['text'],_0x20dc63[_0x5245('0x83')]||'en')['then'](function(_0xe02d25){_0x1b32d7(null,_0xe02d25);})['catch'](function(_0x38dc53){_0x1b32d7(_0x38dc53);});};AGIVertices[_0x5245('0xf')][_0x5245('0x84')]=function(_0x4f7626,_0x11df18){scripts[_0x5245('0x84')](this['channel'],_0x4f7626)[_0x5245('0x12')](function(_0x31dfd5){_0x11df18(null,_0x31dfd5);})[_0x5245('0x14')](function(_0x400f46){_0x11df18(_0x400f46);});};AGIVertices['prototype'][_0x5245('0x85')]=function(_0x13341f,_0x53cf8f){scripts[_0x5245('0x85')](_0x13341f['key'],_0x13341f[_0x5245('0x5d')],_0x13341f[_0x5245('0x86')]||_0x5245('0x5e'),_0x13341f[_0x5245('0x87')])[_0x5245('0x12')](function(_0x258906){_0x53cf8f(null,_0x258906);})[_0x5245('0x14')](function(_0x2a8d47){_0x53cf8f(_0x2a8d47);});};AGIVertices[_0x5245('0xf')]['ispeechASR']=function(_0x394a42,_0xcf2987,_0x3ad654){scripts['ispeechASR'](_0xcf2987,_0x394a42[_0x5245('0x7f')],_0x394a42[_0x5245('0x88')]||_0x5245('0x5e'),this[_0x5245('0x89')](_0x394a42[_0x5245('0x8a')])?_0x394a42[_0x5245('0x8a')]:undefined)[_0x5245('0x12')](function(_0x4509e9){_0x3ad654(null,_0x4509e9);})['catch'](function(_0x4e32cc){_0x3ad654(_0x4e32cc);});};AGIVertices[_0x5245('0xf')][_0x5245('0x8b')]=function(_0x51852a,_0x346010){scripts['awsPolly'](_0x51852a[_0x5245('0x8c')],_0x51852a['aws_secret_access_key'],_0x51852a[_0x5245('0x8d')],_0x51852a[_0x5245('0x8e')]||_0x5245('0x8f'),_0x51852a[_0x5245('0x5d')],_0x51852a[_0x5245('0x90')]||_0x5245('0x5d'))[_0x5245('0x12')](function(_0x68e308){_0x346010(null,_0x68e308);})['catch'](function(_0x5208d9){_0x346010(_0x5208d9);});};AGIVertices['prototype']['awsLex']=function(_0x43f4f7,_0x25205c){scripts['awsLex'](this['channel']['uniqueid'],_0x43f4f7['aws_access_key_id'],_0x43f4f7['aws_secret_access_key'],_0x43f4f7[_0x5245('0x91')],_0x43f4f7[_0x5245('0x5d')],_0x43f4f7[_0x5245('0x92')])[_0x5245('0x12')](function(_0x40c752){_0x25205c(null,_0x40c752);})[_0x5245('0x14')](function(_0xa4b4d7){_0x25205c(_0xa4b4d7);});};AGIVertices[_0x5245('0xf')][_0x5245('0x93')]=function(_0xd202a6,_0x1d91c5,_0x256ddb){scripts['googleASR'](_0x1d91c5,_0xd202a6[_0x5245('0x7f')],_0xd202a6[_0x5245('0x94')]||_0x5245('0x5e'))[_0x5245('0x12')](function(_0x1232e2){_0x256ddb(null,_0x1232e2);})[_0x5245('0x14')](function(_0x281920){_0x256ddb(_0x281920);});};AGIVertices[_0x5245('0xf')]['tildeASR']=function(_0x1eab61,_0x15bb48,_0x490cdf){scripts[_0x5245('0x95')](_0x15bb48,_0x1eab61[_0x5245('0x96')],_0x1eab61[_0x5245('0x97')],_0x1eab61[_0x5245('0x75')])[_0x5245('0x12')](function(_0x169311){_0x490cdf(null,_0x169311);})['catch'](function(_0x1d347e){_0x490cdf(_0x1d347e);});};AGIVertices[_0x5245('0xf')][_0x5245('0x98')]=function(_0x374656){var _0x1c4401=_['includes'](verticesWithRetry,_0x374656[_0x5245('0x99')])?_0x374656:_[_0x5245('0x9a')](_0x374656);for(var _0x45cf5a in _0x1c4401){if(_0x1c4401['hasOwnProperty'](_0x45cf5a)){if(_0x1c4401[_0x45cf5a]&&_[_0x5245('0x9b')](_0x1c4401[_0x45cf5a])){if(_[_0x5245('0x69')](recursiveMapAttributes,_0x45cf5a)){_0x1c4401[_0x45cf5a]=this[_0x5245('0x9c')](_0x1c4401[_0x45cf5a]);}else{_0x1c4401[_0x45cf5a]=this['replaceAllVariables'](_0x1c4401[_0x45cf5a]);}}}}return _0x1c4401;};AGIVertices[_0x5245('0xf')][_0x5245('0x9d')]=function(_0x490384){for(var _0x326985 in _0x490384){if(_0x490384[_0x5245('0x9e')](_0x326985)){if(_['isPlainObject'](_0x490384[_0x326985])){this[_0x5245('0x9d')](_0x490384[_0x326985]);}else if(_[_0x5245('0x9f')](_0x490384[_0x326985])){for(var _0x39bb60=0x0;_0x39bb60<_0x490384[_0x326985]['length'];_0x39bb60++){this[_0x5245('0x9d')](_0x490384[_0x326985][_0x39bb60]);}}else if(_[_0x5245('0x9b')](_0x490384[_0x326985])){_0x490384[_0x326985]=this[_0x5245('0xa0')](_0x490384[_0x326985]);}}}};AGIVertices[_0x5245('0xf')][_0x5245('0xa1')]=function(_0x30c233,_0x3fd820){for(var _0x3d39cd in _0x30c233){if(_0x30c233[_0x5245('0x9e')](_0x3d39cd)){if(_[_0x5245('0xa2')](_0x30c233[_0x3d39cd])){if(!_['isEmpty'](_0x30c233[_0x3d39cd])){this['saveRestApiResult'](_0x30c233[_0x3d39cd],util[_0x5245('0x28')](_0x5245('0xa3'),_0x3fd820,_0x3d39cd));}}else if(_[_0x5245('0x9f')](_0x30c233[_0x3d39cd])){for(var _0x5ca48d=0x0;_0x5ca48d<_0x30c233[_0x3d39cd][_0x5245('0xa4')];_0x5ca48d++){this[_0x5245('0xa1')](_0x30c233[_0x3d39cd][_0x5ca48d],util[_0x5245('0x28')](_0x5245('0xa3'),_0x3fd820,_0x3d39cd+'['+_0x5ca48d+']'));}}else{if(!_['isNil'](_0x30c233[_0x3d39cd])){this[_0x5245('0x38')][_0x5245('0xa5')](util['format'](_0x5245('0xa3'),_0x3fd820,_0x3d39cd),_0x30c233[_0x3d39cd]);}}}}};AGIVertices[_0x5245('0xf')]['replaceObjectAllVariables']=function(_0x340d64){try{var _0x56eb62=JSON[_0x5245('0x6e')](_0x340d64);this[_0x5245('0x9d')](_0x56eb62);return JSON[_0x5245('0x77')](_0x56eb62);}catch(_0x3e1925){return this[_0x5245('0xa0')](_0x340d64);}};AGIVertices[_0x5245('0xf')][_0x5245('0xa0')]=function(_0x10a787){var _0x10583f=_0x10a787[_0x5245('0xa6')]('{');for(var _0x549364=0x1;_0x549364<_0x10583f['length'];_0x549364+=0x1){var _0x1b5431=_0x10583f[_0x549364][_0x5245('0xa6')]('}');if(_0x1b5431['length']>0x1){_0x10a787=_0x10a787[_0x5245('0xa7')]('{'+_0x1b5431[0x0]+'}',this[_0x5245('0x38')]['getVariable'](_0x1b5431[0x0])['extra']||_0x1b5431[0x0]);}}if(_0x10583f['length']===0x1){return _0x10a787['toString']();}return this[_0x5245('0xa0')](_0x10a787);};AGIVertices['prototype']['getAndSetVariable']=function(_0xfcdbd3,_0xe7e5a3){var _0x56738a=this[_0x5245('0x38')][_0x5245('0x10')](_0xfcdbd3);if(_0x56738a[_0x5245('0xa8')]===-0x1){return _0x56738a;}logger[_0x5245('0x2e')](util[_0x5245('0x28')](_0x5245('0xa9'),_0xe7e5a3,_0x56738a['extra']));return this[_0x5245('0x38')][_0x5245('0xa5')](_0xe7e5a3,_0x56738a[_0x5245('0xaa')]);};AGIVertices['prototype']['isConfigured']=function(_0x408514){return _0x408514&&_0x408514!=='0'&&_0x408514!=='-1'&&_0x408514!=='';};AGIVertices[_0x5245('0xf')][_0x5245('0xab')]=function(_0x387ad9){this[_0x5245('0x37')][_0x5245('0x74')](this,_0x387ad9,'-');_0x387ad9[_0x5245('0xac')]=_0x387ad9[_0x5245('0xab')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x5245('0xf')][_0x5245('0xad')]=function(_0x49713f){logger[_0x5245('0x2e')](util[_0x5245('0x28')](_0x5245('0xae'),_0x49713f[_0x5245('0x3a')]));if(!this['isConfigured'](_0x49713f[_0x5245('0x5d')])){return this['channel'][_0x5245('0xaf')](_0x5245('0xb0'));}var _0x1971cd='\x22'+_0x49713f[_0x5245('0x5d')]+'\x22';if(this[_0x5245('0x89')](_0x49713f[_0x5245('0x7d')])){_0x1971cd+=','+_0x49713f[_0x5245('0x7d')];}var _0x1b9ae1=this['channel'][_0x5245('0xb1')](_0x5245('0xb2'),_0x1971cd);if(_0x1b9ae1[_0x5245('0xa8')]===-0x1){return _0x1b9ae1;}return this[_0x5245('0x38')][_0x5245('0xaf')](util[_0x5245('0x28')]('Executed\x20command\x20MRCPSynth\x20%s',_0x1971cd));};AGIVertices['prototype']['mrcprecog']=function(_0x530d4e){logger[_0x5245('0x2e')](util[_0x5245('0x28')](_0x5245('0xb3'),_0x530d4e['label']));if(!this[_0x5245('0x89')](_0x530d4e[_0x5245('0xb4')])){return this[_0x5245('0x38')][_0x5245('0xaf')](_0x5245('0xb5'));}var _0x4ebc0d=_0x530d4e[_0x5245('0xb4')];if(this[_0x5245('0x89')](_0x530d4e['options'])){_0x4ebc0d+=','+_0x530d4e[_0x5245('0x7d')];}var _0x3cc9a5=this['channel']['exec']('MRCPRecog',_0x4ebc0d);if(_0x3cc9a5[_0x5245('0xa8')]===-0x1){return _0x3cc9a5;}var _0x2e2733=this[_0x5245('0xb6')](_0x5245('0xb7'),'MRCP_RECOG_CONFIDENCE');if(_0x2e2733[_0x5245('0xa8')]===-0x1){return _0x2e2733;}var _0x574a5d=this[_0x5245('0xb6')](_0x5245('0xb8'),_0x5245('0xb9'));if(_0x574a5d['result']===-0x1){return _0x574a5d;}var _0x2dc6d9=this[_0x5245('0xb6')](_0x5245('0xba'),_0x5245('0xbb'));if(_0x2dc6d9[_0x5245('0xa8')]===-0x1){return _0x2dc6d9;}return this[_0x5245('0x38')][_0x5245('0xaf')](util[_0x5245('0x28')](_0x5245('0xbc'),_0x4ebc0d));};AGIVertices[_0x5245('0xf')][_0x5245('0x7')]=function(_0xe18b43){logger[_0x5245('0x2e')](util[_0x5245('0x28')](_0x5245('0xbd'),_0xe18b43[_0x5245('0x3a')]));return this[_0x5245('0x38')]['agi']([_0xe18b43['command'],_0xe18b43[_0x5245('0xbe')]]);};AGIVertices[_0x5245('0xf')]['answer']=function(_0x5a87aa){logger[_0x5245('0x2e')](util['format']('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x5a87aa[_0x5245('0x3a')]));if(this['isConfigured'](_0x5a87aa[_0x5245('0x67')])){logger[_0x5245('0x2e')](util['format'](_0x5245('0xbf'),_0x5a87aa[_0x5245('0x67')]));var _0x54f623=this[_0x5245('0x38')]['wait'](_0x5a87aa[_0x5245('0x67')]);if(_0x54f623[_0x5245('0xa8')]===-0x1){return _0x54f623;}}return this[_0x5245('0x38')][_0x5245('0xc0')]();};AGIVertices[_0x5245('0xf')]['callback']=function(_0x180c8f){logger[_0x5245('0x2e')](util['format'](_0x5245('0xc1'),_0x180c8f[_0x5245('0x3a')]));if(!this[_0x5245('0x89')](_0x180c8f[_0x5245('0xc2')])){return this['channel'][_0x5245('0x2c')](_0x180c8f,_0x5245('0xc3'));}_0x180c8f[_0x5245('0x4d')]=moment();if(this['isConfigured'](_0x180c8f[_0x5245('0xc4')])){_0x180c8f[_0x5245('0x4d')]=moment()[_0x5245('0xc5')](_0x180c8f[_0x5245('0xc4')],_0x5245('0xc6'));}if(!this['isConfigured'](_0x180c8f[_0x5245('0x51')])){_0x180c8f[_0x5245('0x51')]=0x2;}this[_0x5245('0x46')]['sync'](this,_0x180c8f);return this[_0x5245('0x38')][_0x5245('0xaf')](util[_0x5245('0x28')](_0x5245('0xc7'),_0x180c8f['phone'],_0x180c8f['list_id'],_0x180c8f[_0x5245('0x4d')]));};AGIVertices[_0x5245('0xf')][_0x5245('0xc8')]=function(_0x59b6d9){logger['info'](util['format'](_0x5245('0xc9'),_0x59b6d9[_0x5245('0x3a')]));var _0x247867=this[_0x5245('0x38')][_0x5245('0xb1')](_0x59b6d9[_0x5245('0xca')],_0x59b6d9['options']);if(_0x247867[_0x5245('0xa8')]===-0x1){return _0x247867;}return this[_0x5245('0x38')][_0x5245('0xaf')](util['format'](_0x5245('0xcb'),_0x59b6d9[_0x5245('0xca')],_0x59b6d9['options']));};AGIVertices[_0x5245('0xf')]['lumenvoxtts']=function(_0x4483bf){logger['info'](util[_0x5245('0x28')](_0x5245('0xcc'),_0x4483bf[_0x5245('0x3a')]));if(!this['isConfigured'](_0x4483bf[_0x5245('0x5d')])){return this[_0x5245('0x38')][_0x5245('0xaf')](_0x5245('0xb0'));}var _0x1aaba0='\x22'+_0x4483bf['text']+'\x22';if(this[_0x5245('0x89')](_0x4483bf[_0x5245('0x7d')])){_0x1aaba0+=','+_0x4483bf[_0x5245('0x7d')];}var _0x10c291=this['channel'][_0x5245('0xb1')](_0x5245('0xb2'),_0x1aaba0);if(_0x10c291[_0x5245('0xa8')]===-0x1){return _0x10c291;}return this[_0x5245('0x38')][_0x5245('0xaf')](util[_0x5245('0x28')](_0x5245('0xcd'),_0x1aaba0));};AGIVertices['prototype']['sestektts']=function(_0x2a3834){logger[_0x5245('0x2e')](util[_0x5245('0x28')](_0x5245('0xce'),_0x2a3834['label']));if(!this[_0x5245('0x89')](_0x2a3834[_0x5245('0x5d')])){return this[_0x5245('0x38')]['noop'](_0x5245('0xb0'));}var _0x5dc5c1='\x22'+_0x2a3834[_0x5245('0x5d')]+'\x22';if(this[_0x5245('0x89')](_0x2a3834[_0x5245('0x7d')])){_0x5dc5c1+=','+_0x2a3834[_0x5245('0x7d')];}var _0x4ff1af=this[_0x5245('0x38')]['exec'](_0x5245('0xb2'),_0x5dc5c1);if(_0x4ff1af[_0x5245('0xa8')]===-0x1){return _0x4ff1af;}return this[_0x5245('0x38')][_0x5245('0xaf')](util[_0x5245('0x28')](_0x5245('0xcd'),_0x5dc5c1));};AGIVertices[_0x5245('0xf')][_0x5245('0xcf')]=function(_0x493ebd){logger[_0x5245('0x2e')](util[_0x5245('0x28')](_0x5245('0xd0'),_0x493ebd[_0x5245('0x3a')]));if(!this[_0x5245('0x89')](_0x493ebd[_0x5245('0xb4')])){return this['channel'][_0x5245('0xaf')](_0x5245('0xb5'));}var _0x5bfb79=_0x493ebd[_0x5245('0xb4')];if(this['isConfigured'](_0x493ebd[_0x5245('0x7d')])){_0x5bfb79+=','+_0x493ebd[_0x5245('0x7d')];}var _0x64ee07=this[_0x5245('0x38')]['exec']('MRCPRecog',_0x5bfb79);if(_0x64ee07['result']===-0x1){return _0x64ee07;}var _0x3946e2=this[_0x5245('0xb6')](_0x5245('0xb7'),_0x5245('0xd1'));if(_0x3946e2[_0x5245('0xa8')]===-0x1){return _0x3946e2;}var _0x3889b2=this[_0x5245('0xb6')](_0x5245('0xb8'),_0x5245('0xd2'));if(_0x3889b2['result']===-0x1){return _0x3889b2;}var _0x20ebb5=this[_0x5245('0xb6')](_0x5245('0xba'),_0x5245('0xd3'));if(_0x20ebb5[_0x5245('0xa8')]===-0x1){return _0x20ebb5;}return this['channel'][_0x5245('0xaf')](util['format'](_0x5245('0xbc'),_0x5bfb79));};AGIVertices[_0x5245('0xf')][_0x5245('0xd4')]=function(_0x40b89f){logger['info'](util[_0x5245('0x28')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x40b89f['label']));if(!this[_0x5245('0x89')](_0x40b89f[_0x5245('0xb4')])){return this[_0x5245('0x38')][_0x5245('0xaf')](_0x5245('0xb5'));}var _0x633cd4=_0x40b89f[_0x5245('0xb4')];if(this[_0x5245('0x89')](_0x40b89f[_0x5245('0x7d')])){_0x633cd4+=','+_0x40b89f['options'];}var _0x3efe7c=this['channel']['exec'](_0x5245('0xd5'),_0x633cd4);if(_0x3efe7c[_0x5245('0xa8')]===-0x1){return _0x3efe7c;}var _0x2f0ac5=this[_0x5245('0xb6')](_0x5245('0xb7'),_0x5245('0xd6'));if(_0x2f0ac5[_0x5245('0xa8')]===-0x1){return _0x2f0ac5;}var _0x184c3a=this['getAndSetVariable'](_0x5245('0xb8'),_0x5245('0xd7'));if(_0x184c3a[_0x5245('0xa8')]===-0x1){return _0x184c3a;}var _0x1d3de0=this[_0x5245('0xb6')](_0x5245('0xba'),_0x5245('0xd8'));if(_0x1d3de0[_0x5245('0xa8')]===-0x1){return _0x1d3de0;}return this[_0x5245('0x38')][_0x5245('0xaf')](util[_0x5245('0x28')](_0x5245('0xbc'),_0x633cd4));};AGIVertices[_0x5245('0xf')]['database']=function(_0x557bc9){logger['info'](util['format'](_0x5245('0xd9'),_0x557bc9[_0x5245('0x3a')]));if(!this[_0x5245('0x89')](_0x557bc9[_0x5245('0xda')])){return this['channel'][_0x5245('0x2c')](_0x557bc9,_0x5245('0xdb'));}var _0x24f8e7=this[_0x5245('0x18')][_0x5245('0x74')](this,_0x557bc9[_0x5245('0xda')]);if(!_0x24f8e7){return this[_0x5245('0x38')]['error'](_0x557bc9,_0x5245('0xdc'));}if(!this[_0x5245('0x89')](_0x557bc9[_0x5245('0x30')])){return this['channel']['error'](_0x557bc9,_0x5245('0xdd'));}var _0x34be3d=_0x557bc9[_0x5245('0x30')][_0x5245('0xde')](/(\r\n|\n|\r)/gm,'\x20');this[_0x5245('0x38')]['noop'](util[_0x5245('0x28')](_0x5245('0xdf'),_0x34be3d));var _0x24c946=this[_0x5245('0x2a')]['sync'](this,_0x24f8e7,_0x34be3d);this['createSquareDetailsReport'][_0x5245('0x74')](this,_0x557bc9,_0x34be3d);if(!this['isConfigured'](_0x557bc9['variable_id'])){return this[_0x5245('0x38')][_0x5245('0xaf')](_0x5245('0xe0'));}var _0x515d77=this[_0x5245('0x10')][_0x5245('0x74')](this,_0x557bc9[_0x5245('0xe1')]);if(!_0x515d77){return this['channel'][_0x5245('0x2c')](_0x557bc9,_0x5245('0xe2'));}var _0x4c20ee=this;_0x24c946['forEach'](function(_0x278769,_0x53715b){Object[_0x5245('0xe3')](_0x278769)['forEach'](function(_0x25f4f7){_0x4c20ee[_0x5245('0x38')][_0x5245('0xa5')](util[_0x5245('0x28')](_0x5245('0xe4'),_0x515d77,_0x53715b,_0x25f4f7),_0x278769[_0x25f4f7]);});});this[_0x5245('0x38')][_0x5245('0xa5')](util[_0x5245('0x28')](_0x5245('0xe5'),_0x515d77),_0x24c946[_0x5245('0xa4')]);return this[_0x5245('0x38')]['noop'](util['format'](_0x5245('0xe6'),_0x515d77));};AGIVertices['prototype'][_0x5245('0xe7')]=function(_0x37d744){logger[_0x5245('0xe8')](util[_0x5245('0x28')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x37d744['label']));if(!this[_0x5245('0x89')](_0x37d744[_0x5245('0xe9')])){return this['channel'][_0x5245('0x2c')](_0x37d744,_0x5245('0xea'));}var _0x3471bb=this[_0x5245('0x1b')][_0x5245('0x74')](this,_0x37d744[_0x5245('0xe9')]);if(!_0x3471bb){return this[_0x5245('0x38')][_0x5245('0x2c')](_0x37d744,_0x5245('0xeb'));}var _0x3bf019=this[_0x5245('0x38')][_0x5245('0xb1')](_0x5245('0xec'),[util[_0x5245('0x28')](_0x5245('0xed'),_0x3471bb),_0x37d744[_0x5245('0x67')],_0x37d744[_0x5245('0xee')],_0x37d744[_0x5245('0x65')]]);if(_0x3bf019[_0x5245('0xa8')]===-0x1){return _0x3bf019;}return this['channel'][_0x5245('0xaf')](util[_0x5245('0x28')](_0x5245('0xef'),_0x5245('0xec')));};AGIVertices['prototype'][_0x5245('0xf0')]=function(_0x33bb72){logger['info'](util['format'](_0x5245('0xf1'),_0x33bb72[_0x5245('0x3a')]));if(!this['isConfigured'](_0x33bb72[_0x5245('0x7f')])){return this[_0x5245('0x38')]['noop']('no\x20key\x20configured');}if(!this[_0x5245('0x89')](_0x33bb72[_0x5245('0x5d')])){return this[_0x5245('0x38')]['noop'](_0x5245('0xb0'));}this[_0x5245('0x38')]['bot']=!![];this[_0x5245('0x37')](_0x33bb72);this['createSquareMessage'](_0x33bb72[_0x5245('0x5d')],'in','','');this['channel'][_0x5245('0xaf')](util[_0x5245('0x28')]('Trying\x20Dialogflow:\x20%s',_0x33bb72[_0x5245('0x5d')]));var _0x3050f1=this[_0x5245('0x7e')][_0x5245('0x74')](this,_0x33bb72);if(_0x3050f1){for(var _0x529cef in _0x3050f1){if(_0x3050f1[_0x5245('0x9e')](_0x529cef)){this[_0x5245('0x38')][_0x5245('0xa5')](util['format']('DIALOGFLOW_%s',_0x529cef[_0x5245('0x6b')]()),_0x3050f1[_0x529cef]);}}this['createSquareMessage'](_0x3050f1[_0x5245('0xf2')],_0x5245('0xf3'),_0x5245('0xf0'),'');return this[_0x5245('0x38')]['noop'](util[_0x5245('0x28')]('Dialogflow\x20Result\x20%s',_0x3050f1[_0x5245('0xf2')]));}return this[_0x5245('0x38')][_0x5245('0x2c')](_0x33bb72,'Dialogflow\x20is\x20unreachable');};AGIVertices[_0x5245('0xf')][_0x5245('0xf4')]=function(_0x231533){logger[_0x5245('0x2e')](util[_0x5245('0x28')](_0x5245('0xf5'),_0x231533[_0x5245('0x3a')]));if(!this['isConfigured'](_0x231533[_0x5245('0xf6')])){return this[_0x5245('0x38')][_0x5245('0xaf')](_0x5245('0xf7'));}if(!this[_0x5245('0x89')](_0x231533[_0x5245('0x82')])){return this[_0x5245('0x38')][_0x5245('0xaf')](_0x5245('0xf8'));}if(!this[_0x5245('0x89')](_0x231533[_0x5245('0xf9')])){return this[_0x5245('0x38')]['noop'](_0x5245('0xfa'));}if(!this[_0x5245('0x89')](_0x231533['dialogflowV2_language'])){return this[_0x5245('0x38')][_0x5245('0xaf')](_0x5245('0xfb'));}if(!this[_0x5245('0x89')](_0x231533[_0x5245('0x5d')])){return this[_0x5245('0x38')][_0x5245('0xaf')](_0x5245('0xb0'));}this[_0x5245('0x38')][_0x5245('0xfc')]=!![];this['createSquareDetailsReport'](_0x231533);this[_0x5245('0x45')](_0x231533[_0x5245('0x5d')],'in','','');this[_0x5245('0x38')][_0x5245('0xaf')](util['format'](_0x5245('0xfd'),_0x231533[_0x5245('0x5d')]));var _0x17f119=this[_0x5245('0x81')]['sync'](this,_0x231533);if(_0x17f119){for(var _0x4d8cf5 in _0x17f119){if(_0x17f119[_0x5245('0x9e')](_0x4d8cf5)){if(_0x4d8cf5!==_0x5245('0xfe')){this[_0x5245('0x38')][_0x5245('0xa5')](util[_0x5245('0x28')](_0x5245('0xff'),_0x4d8cf5[_0x5245('0x6b')]()),_0x17f119[_0x4d8cf5]);}}}this[_0x5245('0x45')](_0x17f119[_0x5245('0xf2')],_0x5245('0xf3'),_0x5245('0xf4'),_0x17f119['providerResponse']);return this[_0x5245('0x38')][_0x5245('0xaf')](util[_0x5245('0x28')]('DialogflowV2\x20Result\x20%s',_0x17f119['speech']));}return this[_0x5245('0x38')][_0x5245('0x2c')](_0x231533,_0x5245('0x100'));};AGIVertices[_0x5245('0xf')][_0x5245('0x101')]=function(_0x504659){logger[_0x5245('0x2e')](util[_0x5245('0x28')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x504659['label']));if(!this[_0x5245('0x89')](_0x504659[_0x5245('0x102')])){return this['channel'][_0x5245('0xaf')]('no\x20ndauth\x20url\x20configured');}if(!this[_0x5245('0x89')](_0x504659[_0x5245('0x103')])){return this[_0x5245('0x38')]['noop'](_0x5245('0x104'));}if(!this[_0x5245('0x89')](_0x504659[_0x5245('0x105')])){return this[_0x5245('0x38')][_0x5245('0xaf')]('no\x20password\x20configured');}if(!this['isConfigured'](_0x504659['ndassistant_url'])){return this[_0x5245('0x38')]['noop'](_0x5245('0xb0'));}this['channel'][_0x5245('0xfc')]=!![];this['createSquareDetailsReport'](_0x504659);this[_0x5245('0x45')](_0x504659[_0x5245('0x5d')],'in','','');this[_0x5245('0x38')]['noop'](util[_0x5245('0x28')](_0x5245('0x106'),_0x504659[_0x5245('0x5d')]));var _0xeb8a08=this['sestekNDA'][_0x5245('0x74')](this,_0x504659);if(_0xeb8a08){for(var _0x1ff76f in _0xeb8a08){if(_0xeb8a08[_0x5245('0x9e')](_0x1ff76f)){this[_0x5245('0x38')]['setVariable'](util[_0x5245('0x28')]('SESTEK_NDA_%s',_0x1ff76f[_0x5245('0x6b')]()),_0xeb8a08[_0x1ff76f]);}}this[_0x5245('0x45')](_0xeb8a08[_0x5245('0xf2')],_0x5245('0xf3'),'sesteknda','');if(_0xeb8a08['audiofile']){this[_0x5245('0x38')][_0x5245('0xaf')](util['format'](_0x5245('0x107'),_0xeb8a08[_0x5245('0x108')]));var _0x4fffcc=this[_0x5245('0x38')][_0x5245('0x109')](_0xeb8a08[_0x5245('0x108')]);try{fs['unlink'](_0xeb8a08['audiofile']+_0x5245('0x10a'));}catch(_0x518c68){logger[_0x5245('0x2c')](_0x518c68);}return _0x4fffcc;}else{return this['channel']['noop'](util[_0x5245('0x28')](_0x5245('0x10b'),_0xeb8a08[_0x5245('0xf2')]));}}return this[_0x5245('0x38')][_0x5245('0x2c')](_0x504659,'SestekNDA\x20is\x20unreachable');};AGIVertices['prototype']['end']=function(_0x4f8ebd){logger[_0x5245('0x2e')](util['format']('Enter\x20in\x20END\x20(%s)\x20block',_0x4f8ebd[_0x5245('0x3a')]));return this['channel'][_0x5245('0xaf')](_0x5245('0x10c'));};AGIVertices[_0x5245('0xf')]['ext_dial']=function(_0x398ff6){logger['info'](util[_0x5245('0x28')](_0x5245('0x10d'),_0x398ff6[_0x5245('0x3a')]));var _0x1a300a='';if(_0x398ff6[_0x5245('0x10e')]){if(!this[_0x5245('0x89')](_0x398ff6[_0x5245('0x10e')])){return this['channel'][_0x5245('0x2c')](_0x398ff6,_0x5245('0x10f'));}else{var _0x2d4495=parseInt(_0x398ff6[_0x5245('0x10e')],0xa);if(isNaN(_0x2d4495)){_0x1a300a=_0x398ff6[_0x5245('0x10e')];}else{_0x1a300a=this[_0x5245('0x1c')][_0x5245('0x74')](this,_0x398ff6[_0x5245('0x10e')]);if(!_0x1a300a){return this[_0x5245('0x38')][_0x5245('0x2c')](_0x398ff6,_0x5245('0x110'));}}}}else if(_0x398ff6[_0x5245('0x111')]){_0x1a300a=_0x398ff6[_0x5245('0x111')];}else{return this[_0x5245('0x38')][_0x5245('0x2c')](_0x398ff6,_0x5245('0x10f'));}var _0x21c79d=this[_0x5245('0x38')]['exec'](_0x5245('0xec'),[util[_0x5245('0x28')](_0x5245('0x112'),_0x1a300a,_0x398ff6[_0x5245('0x4c')]),_0x398ff6['timeout'],_0x398ff6[_0x5245('0xee')],_0x398ff6[_0x5245('0x65')]]);if(_0x21c79d[_0x5245('0xa8')]===-0x1){return _0x21c79d;}return this[_0x5245('0x38')][_0x5245('0xaf')](util[_0x5245('0x28')](_0x5245('0xef'),_0x5245('0xec')));};AGIVertices[_0x5245('0xf')]['finally']=function(_0x1e7280){logger['info'](util[_0x5245('0x28')](_0x5245('0x113'),_0x1e7280[_0x5245('0x3a')]));return this[_0x5245('0x38')][_0x5245('0xaf')](_0x5245('0x114'));};AGIVertices[_0x5245('0xf')][_0x5245('0xc')]=function(_0x54c8e3){logger[_0x5245('0x2e')](util[_0x5245('0x28')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x54c8e3[_0x5245('0x3a')]));if(_0x54c8e3[_0x5245('0xac')]===0x0){return this['maxRetry'](_0x54c8e3);}_0x54c8e3[_0x5245('0xac')]-=0x1;if(!this[_0x5245('0x89')](_0x54c8e3[_0x5245('0x115')])){return this[_0x5245('0x38')]['error'](_0x54c8e3,_0x5245('0x116'));}var _0x23fa13=this[_0x5245('0x1d')][_0x5245('0x74')](this,_0x54c8e3[_0x5245('0x115')]);if(!_0x23fa13){return this[_0x5245('0x38')][_0x5245('0x2c')](_0x54c8e3,_0x5245('0x117'));}if(!this[_0x5245('0x89')](_0x54c8e3[_0x5245('0xe1')])){return this[_0x5245('0x38')]['error'](_0x5245('0xe0'));}var _0x229fc4=this[_0x5245('0x38')][_0x5245('0x118')](_0x23fa13,_0x54c8e3['response'],_0x54c8e3[_0x5245('0x119')]);var _0x5c71ae=_0x229fc4[_0x5245('0xa8')]?_0x229fc4[_0x5245('0xa8')][_0x5245('0x50')]():'';logger['info']('test',JSON[_0x5245('0x77')](_0x229fc4));if(_0x229fc4[_0x5245('0xa8')]===-0x1){this[_0x5245('0x37')][_0x5245('0x74')](this,_0x54c8e3,_0x5c71ae);return _0x229fc4;}else if(_0x229fc4[_0x5245('0xaa')]==='timeout'){_0x229fc4[_0x5245('0xa8')]=_0x5c71ae['length']>=parseInt(_0x54c8e3[_0x5245('0x11a')])?'x':'i';}else{_0x229fc4[_0x5245('0xa8')]=_0x5c71ae[_0x5245('0xa4')]>=parseInt(_0x54c8e3['mindigit'])&&_0x5c71ae['length']<=parseInt(_0x54c8e3[_0x5245('0x119')])?'x':'i';}var _0x39a4c0=this[_0x5245('0x10')][_0x5245('0x74')](this,_0x54c8e3[_0x5245('0xe1')]);if(!_0x39a4c0){return this[_0x5245('0x38')][_0x5245('0x2c')](_0x54c8e3,_0x5245('0xe2'));}this['channel']['setVariable'](_0x39a4c0,_0x5c71ae);if(this[_0x5245('0x89')](_0x54c8e3[_0x5245('0x11b')])){var _0x507495=parseInt(_0x54c8e3[_0x5245('0x11b')],0xa);var _0x5d27cc=rs['generate']({'charset':'*','length':_0x507495});var _0x4f1873=_0x5c71ae[_0x5245('0xa4')];if(_0x4f1873>0x0){if(_0x4f1873>_0x507495){this[_0x5245('0x37')][_0x5245('0x74')](this,_0x54c8e3,_0x54c8e3[_0x5245('0x11c')]===_0x5245('0x11d')?_0x5d27cc+_0x5c71ae['substr'](_0x507495):_0x5c71ae[_0x5245('0x11e')](0x0,_0x4f1873-_0x507495)+_0x5d27cc);}else{this[_0x5245('0x37')]['sync'](this,_0x54c8e3,rs[_0x5245('0x11f')]({'charset':'*','length':_0x4f1873}));}}else{this[_0x5245('0x37')][_0x5245('0x74')](this,_0x54c8e3,'');}}else{this['createSquareDetailsReport']['sync'](this,_0x54c8e3,_0x5c71ae);}return _0x229fc4;};AGIVertices['prototype'][_0x5245('0x120')]=function(_0x2afbc7){logger[_0x5245('0x2e')](util[_0x5245('0x28')](_0x5245('0x121'),_0x2afbc7[_0x5245('0x3a')]));return this[_0x5245('0xc')](_0x2afbc7);};AGIVertices[_0x5245('0xf')][_0x5245('0x122')]=function(_0x28ab09){logger[_0x5245('0x2e')](util['format']('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x28ab09[_0x5245('0x3a')]));this[_0x5245('0x37')]['sync'](this,_0x28ab09,_0x28ab09[_0x5245('0x123')]);return this['channel']['noop'](util[_0x5245('0x28')](_0x5245('0x124'),_0x28ab09[_0x5245('0x123')]));};AGIVertices['prototype'][_0x5245('0x125')]=function(_0xa937fc){logger['info'](util[_0x5245('0x28')](_0x5245('0x126'),_0xa937fc[_0x5245('0x3a')]));if(!this[_0x5245('0x89')](_0xa937fc[_0x5245('0x8c')])||!this[_0x5245('0x89')](_0xa937fc['aws_secret_access_key'])){return this[_0x5245('0x38')][_0x5245('0xaf')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x5245('0x89')](_0xa937fc[_0x5245('0x5d')])){return this[_0x5245('0x38')][_0x5245('0xaf')](_0x5245('0xb0'));}this[_0x5245('0x38')][_0x5245('0xaf')](util[_0x5245('0x28')](_0x5245('0x127'),_0xa937fc[_0x5245('0x5d')]));var _0x389f80=this[_0x5245('0x8b')][_0x5245('0x74')](this,_0xa937fc);if(_0x389f80){this[_0x5245('0x38')]['noop'](util[_0x5245('0x28')](_0x5245('0x128'),_0x389f80));var _0x5a25a4=this['channel']['streamFile'](_0x389f80);try{fs[_0x5245('0x129')](_0x389f80+_0x5245('0x10a'));}catch(_0x49c0a5){logger[_0x5245('0x2c')](_0x49c0a5);}return _0x5a25a4;}return this[_0x5245('0x38')][_0x5245('0x2c')](_0xa937fc,_0x5245('0x12a'));};AGIVertices[_0x5245('0xf')][_0x5245('0x12b')]=function(_0x47ba2b){logger[_0x5245('0x2e')](util[_0x5245('0x28')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x47ba2b[_0x5245('0x3a')]));if(!this[_0x5245('0x89')](_0x47ba2b[_0x5245('0x8c')])||!this[_0x5245('0x89')](_0x47ba2b['aws_secret_access_key'])){return this['channel'][_0x5245('0xaf')](_0x5245('0x12c'));}if(!this[_0x5245('0x89')](_0x47ba2b['aws_bot_name'])){return this[_0x5245('0x38')][_0x5245('0xaf')](_0x5245('0x12d'));}if(!this['isConfigured'](_0x47ba2b['text'])){return this[_0x5245('0x38')]['noop'](_0x5245('0xb0'));}this[_0x5245('0x38')]['bot']=!![];this[_0x5245('0x37')](_0x47ba2b);this[_0x5245('0x45')](_0x47ba2b[_0x5245('0x5d')],'in','','');this['channel'][_0x5245('0xaf')](util[_0x5245('0x28')](_0x5245('0x12e'),_0x47ba2b[_0x5245('0x5d')]));var _0x5b1e55=this['awsLex'][_0x5245('0x74')](this,_0x47ba2b);if(_0x5b1e55){for(var _0x564be2 in _0x5b1e55){if(_0x5b1e55[_0x5245('0x9e')](_0x564be2)&&_[_0x5245('0x9b')](_0x5b1e55[_0x564be2])){this['channel'][_0x5245('0xa5')](util[_0x5245('0x28')](_0x5245('0x12f'),_0x564be2[_0x5245('0x6b')]()),_0x5b1e55[_0x564be2]);}}if(_['isNil'](_0x5b1e55[_0x5245('0x7b')])){return this[_0x5245('0x38')]['noop'](_0x5245('0x130'));}else{this['createSquareMessage'](_0x5b1e55[_0x5245('0x7b')],_0x5245('0xf3'),'amazonlex','');return this[_0x5245('0x38')][_0x5245('0xaf')](util[_0x5245('0x28')](_0x5245('0x131'),_0x5b1e55[_0x5245('0x7b')]));}}return this[_0x5245('0x38')]['error'](_0x47ba2b,_0x5245('0x132'));};AGIVertices['prototype'][_0x5245('0x133')]=function(_0x2142be){logger['info'](util['format'](_0x5245('0x134'),_0x2142be[_0x5245('0x3a')],_0x2142be[_0x5245('0x67')]));if(!this[_0x5245('0x89')](_0x2142be['key'])){return this[_0x5245('0x38')][_0x5245('0xaf')](_0x5245('0x135'));}var _0x4905c1=_0x5245('0x136');var _0x41c6cf=util[_0x5245('0x28')](_0x5245('0x137'),FILES_PATH,rs[_0x5245('0x11f')](0x4));var _0x45fcbe=util[_0x5245('0x28')](_0x5245('0xa3'),_0x41c6cf,_0x4905c1);var _0x22658c=!![];if(_0x2142be['beep']===_0x5245('0x138')){_0x22658c=![];}var _0x153f1f=this[_0x5245('0x38')][_0x5245('0x139')](_0x41c6cf,_0x4905c1,_0x2142be['intKey'],_0x2142be['timeout'],undefined,_0x22658c);if(_0x153f1f[_0x5245('0xa8')]!==-0x1){this[_0x5245('0x38')][_0x5245('0xaf')](util['format'](_0x5245('0x13a'),_0x45fcbe));var _0x565ce6=this[_0x5245('0x93')][_0x5245('0x74')](this,_0x2142be,_0x45fcbe);if(_0x565ce6){for(var _0x41b052 in _0x565ce6){if(_0x565ce6[_0x5245('0x9e')](_0x41b052)){this[_0x5245('0x38')][_0x5245('0xa5')](util[_0x5245('0x28')]('GOOGLE_ASR_%s',_0x41b052[_0x5245('0x6b')]()),_0x565ce6[_0x41b052]);}}return this[_0x5245('0x38')][_0x5245('0xaf')](util[_0x5245('0x28')](_0x5245('0x13b'),JSON[_0x5245('0x77')](_0x565ce6)));}}return _0x153f1f;};AGIVertices[_0x5245('0xf')][_0x5245('0x13c')]=function(_0x42b8c1){logger[_0x5245('0x2e')](util['format'](_0x5245('0x13d'),_0x42b8c1['label']));if(!this[_0x5245('0x89')](_0x42b8c1['appid'])){return this[_0x5245('0x38')]['noop'](_0x5245('0x13e'));}if(!this[_0x5245('0x89')](_0x42b8c1[_0x5245('0x97')])){return this[_0x5245('0x38')][_0x5245('0xaf')]('no\x20appsecret\x20configured');}var _0x5343ea=_0x5245('0x136');var _0x22849d=util['format'](_0x5245('0x137'),FILES_PATH,rs[_0x5245('0x11f')](0x4));var _0x1b9f5d=util[_0x5245('0x28')](_0x5245('0xa3'),_0x22849d,_0x5343ea);var _0x5cca12=!![];if(_0x42b8c1[_0x5245('0x13f')]==='NOBEEP'){_0x5cca12=![];}var _0x502dc1=this[_0x5245('0x38')][_0x5245('0x139')](_0x22849d,_0x5343ea,_0x42b8c1[_0x5245('0x140')],_0x42b8c1[_0x5245('0x67')],undefined,_0x5cca12);if(_0x502dc1['result']!==-0x1){this['channel'][_0x5245('0xaf')](util['format']('tilde\x20%s\x20file\x20created',_0x1b9f5d));var _0x451f82=this[_0x5245('0x95')]['sync'](this,_0x42b8c1,_0x1b9f5d);if(_0x451f82){for(var _0xff776e in _0x451f82){if(_0x451f82[_0x5245('0x9e')](_0xff776e)){this[_0x5245('0x38')][_0x5245('0xa5')](util['format'](_0x5245('0x141'),_0xff776e[_0x5245('0x6b')]()),_0x451f82[_0xff776e]);}}return this[_0x5245('0x38')]['noop'](util[_0x5245('0x28')](_0x5245('0x142'),JSON[_0x5245('0x77')](_0x451f82)));}}return _0x502dc1;};AGIVertices['prototype'][_0x5245('0x143')]=function(_0x393d6a){logger[_0x5245('0x2e')](util['format'](_0x5245('0x144'),_0x393d6a[_0x5245('0x3a')]));return this[_0x5245('0x38')][_0x5245('0x145')](_0x393d6a[_0x5245('0x3f')],_0x393d6a[_0x5245('0x40')],_0x393d6a[_0x5245('0x41')]);};AGIVertices[_0x5245('0xf')]['gotoif']=function(_0x4d0392){logger[_0x5245('0x2e')](util[_0x5245('0x28')](_0x5245('0x146'),_0x4d0392[_0x5245('0x3a')]));if(!this[_0x5245('0x89')](_0x4d0392[_0x5245('0x147')])){return this['channel'][_0x5245('0x2c')](_0x4d0392,_0x5245('0x148'));}try{var _0x26b24b=eval(_0x4d0392['condition'])?_0x5245('0x149'):_0x5245('0x14a');this[_0x5245('0x38')]['noop'](util['format'](_0x5245('0x14b'),_0x4d0392['condition'],_0x26b24b));return{'code':0xc8,'result':_0x26b24b};}catch(_0x5e8054){return{'code':0xc8,'result':'false'};}};AGIVertices[_0x5245('0xf')]['gotoiftime']=function(_0x51ff3c){logger['info'](util['format'](_0x5245('0x14c'),_0x51ff3c[_0x5245('0x3a')]));if(!this[_0x5245('0x89')](_0x51ff3c['interval_id'])){return this['channel'][_0x5245('0x2c')](_0x51ff3c,_0x5245('0x14d'));}var _0x3c3bd4=this[_0x5245('0x23')][_0x5245('0x74')](this,_0x51ff3c[_0x5245('0x14e')]);if(!_0x3c3bd4){return this['channel']['error'](_0x51ff3c,_0x5245('0x14f'));}for(var _0x1e0cce=0x0;_0x1e0cce<_0x3c3bd4[_0x5245('0xa4')];_0x1e0cce+=0x1){var _0xabf186=this[_0x5245('0x38')][_0x5245('0x10')](util[_0x5245('0x28')](_0x5245('0x150'),_0x3c3bd4[_0x1e0cce]));if(_0xabf186['result']===-0x1){return _0xabf186;}logger[_0x5245('0x2e')](util[_0x5245('0x28')]('IFTIME\x20%s\x20%s',_0x3c3bd4[_0x1e0cce],_0xabf186['extra']));if(_0xabf186[_0x5245('0xaa')]===_0x5245('0x149')){logger['info'](util[_0x5245('0x28')](_0x5245('0x151'),_0x3c3bd4[_0x1e0cce],_0x5245('0x149')));this[_0x5245('0x38')][_0x5245('0xaf')](util[_0x5245('0x28')](_0x5245('0x151'),_0x3c3bd4[_0x1e0cce],_0x5245('0x149')));return{'code':0xc8,'result':_0x5245('0x149')};}else{logger[_0x5245('0x2e')](util[_0x5245('0x28')]('IFTIME\x20%s\x20%s',_0x3c3bd4[_0x1e0cce],_0x5245('0x14a')));this[_0x5245('0x38')][_0x5245('0xaf')](util['format'](_0x5245('0x151'),_0x3c3bd4[_0x1e0cce],_0x5245('0x14a')));}}return{'code':0xc8,'result':_0x5245('0x14a')};};AGIVertices[_0x5245('0xf')][_0x5245('0x152')]=function(_0x43999d){logger['info'](util['format'](_0x5245('0x153'),_0x43999d[_0x5245('0x3a')]));return this[_0x5245('0x38')][_0x5245('0x152')]();};AGIVertices[_0x5245('0xf')][_0x5245('0x154')]=function(_0x11cd0d){logger[_0x5245('0x2e')](util[_0x5245('0x28')](_0x5245('0x155'),_0x11cd0d[_0x5245('0x3a')]));if(!this[_0x5245('0x89')](_0x11cd0d[_0x5245('0x7f')])){return this[_0x5245('0x38')][_0x5245('0xaf')](_0x5245('0x135'));}var _0x3f226a=_0x5245('0x136');var _0x499bbb=util[_0x5245('0x28')](_0x5245('0x137'),FILES_PATH,rs[_0x5245('0x11f')](0x4));var _0x370b51=util[_0x5245('0x28')]('%s.%s',_0x499bbb,_0x3f226a);var _0x203dee=!![];if(_0x11cd0d[_0x5245('0x13f')]==='NOBEEP'){_0x203dee=![];}var _0x4316cc=this[_0x5245('0x38')][_0x5245('0x139')](_0x499bbb,_0x3f226a,_0x11cd0d['intKey'],_0x11cd0d[_0x5245('0x67')],undefined,_0x203dee);if(_0x4316cc[_0x5245('0xa8')]!==-0x1){this[_0x5245('0x38')][_0x5245('0xaf')](util[_0x5245('0x28')](_0x5245('0x156'),_0x370b51));var _0x36f2b5=this['ispeechASR'][_0x5245('0x74')](this,_0x11cd0d,_0x370b51);if(_0x36f2b5){for(var _0x339bb8 in _0x36f2b5){if(_0x36f2b5[_0x5245('0x9e')](_0x339bb8)){this['channel']['setVariable'](util[_0x5245('0x28')](_0x5245('0x157'),_0x339bb8[_0x5245('0x6b')]()),_0x36f2b5[_0x339bb8]);}}return this[_0x5245('0x38')][_0x5245('0xaf')](util[_0x5245('0x28')](_0x5245('0x158'),JSON[_0x5245('0x77')](_0x36f2b5)));}}return _0x4316cc;};AGIVertices[_0x5245('0xf')][_0x5245('0x159')]=function(_0x2ec088){logger[_0x5245('0x2e')](util[_0x5245('0x28')](_0x5245('0x15a'),_0x2ec088['label']));if(!this[_0x5245('0x89')](_0x2ec088[_0x5245('0x7f')])){return this['channel']['noop']('no\x20key\x20configured');}if(!this[_0x5245('0x89')](_0x2ec088[_0x5245('0x5d')])){return this[_0x5245('0x38')][_0x5245('0xaf')](_0x5245('0xb0'));}this[_0x5245('0x38')][_0x5245('0xaf')](util['format']('Trying\x20ispeech\x20TTS\x20%s',_0x2ec088[_0x5245('0x5d')]));var _0x2f6d74=this[_0x5245('0x85')][_0x5245('0x74')](this,_0x2ec088);if(_0x2f6d74){this[_0x5245('0x38')][_0x5245('0xaf')](util[_0x5245('0x28')]('ispeech\x20%s\x20file\x20created',_0x2f6d74));var _0xd62334=this['channel'][_0x5245('0x109')](_0x2f6d74,_0x2ec088['intKey']);try{fs[_0x5245('0x129')](_0x2f6d74+'.wav');}catch(_0x1033fa){logger[_0x5245('0x2c')](_0x1033fa);}return _0xd62334;}return this[_0x5245('0x38')][_0x5245('0x2c')](_0x2ec088,_0x5245('0x15b'));};AGIVertices[_0x5245('0xf')][_0x5245('0x15c')]=function(_0x24c0e1){logger['info'](util[_0x5245('0x28')](_0x5245('0x15d'),_0x24c0e1[_0x5245('0x3a')]));if(!this[_0x5245('0x89')](_0x24c0e1['findBy'])){return this['channel']['error'](_0x24c0e1,_0x5245('0x15e'));}logger['info'](util[_0x5245('0x28')](_0x5245('0x15f'),this[_0x5245('0x38')][_0x5245('0x3d')],_0x24c0e1['findBy']));var _0x2ddaeb=this['agentLogin']['sync'](this,_0x24c0e1[_0x5245('0x160')]);if(_0x2ddaeb){logger['info'](util[_0x5245('0x28')](_0x5245('0x161'),this['channel'][_0x5245('0x3d')],_0x24c0e1[_0x5245('0x160')]));this['channel'][_0x5245('0xaf')](util[_0x5245('0x28')](_0x5245('0x161'),this['channel'][_0x5245('0x3d')],_0x24c0e1[_0x5245('0x160')]));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0x5245('0x28')](_0x5245('0x162'),this[_0x5245('0x38')][_0x5245('0x3d')],_0x24c0e1[_0x5245('0x160')]));this[_0x5245('0x38')][_0x5245('0xaf')](util[_0x5245('0x28')](_0x5245('0x162'),this[_0x5245('0x38')][_0x5245('0x3d')],_0x24c0e1['findBy']));return{'code':0xc8,'result':_0x5245('0x163')};}};AGIVertices[_0x5245('0xf')]['logout']=function(_0x1c6be6){logger['info'](util[_0x5245('0x28')](_0x5245('0x164'),_0x1c6be6['label']));if(!this[_0x5245('0x89')](_0x1c6be6[_0x5245('0x160')])){return this['channel']['error'](_0x1c6be6,_0x5245('0x15e'));}logger[_0x5245('0x2e')](util[_0x5245('0x28')](_0x5245('0x15f'),this[_0x5245('0x38')][_0x5245('0x3d')],_0x1c6be6[_0x5245('0x160')]));var _0x1fe8d5=this[_0x5245('0x165')][_0x5245('0x74')](this,_0x1c6be6[_0x5245('0x160')]);if(_0x1fe8d5){logger[_0x5245('0x2e')](util[_0x5245('0x28')](_0x5245('0x161'),this['channel'][_0x5245('0x3d')],_0x1c6be6[_0x5245('0x160')]));this['channel'][_0x5245('0xaf')](util[_0x5245('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this['channel']['callerid'],_0x1c6be6[_0x5245('0x160')]));return{'code':0xc8,'result':_0x5245('0x166')};}else{logger[_0x5245('0x2e')](util[_0x5245('0x28')](_0x5245('0x162'),this[_0x5245('0x38')][_0x5245('0x3d')],_0x1c6be6[_0x5245('0x160')]));this['channel'][_0x5245('0xaf')](util[_0x5245('0x28')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel']['callerid'],_0x1c6be6[_0x5245('0x160')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x5245('0xf')][_0x5245('0x167')]=function(_0x3337ff){logger[_0x5245('0x2e')](util[_0x5245('0x28')](_0x5245('0x168'),_0x3337ff[_0x5245('0x3a')]));if(!this[_0x5245('0x89')](_0x3337ff['operation'])){return this[_0x5245('0x38')][_0x5245('0x2c')](_0x3337ff,_0x5245('0x169'));}this['channel'][_0x5245('0xaf')](util[_0x5245('0x28')]('math\x20%s',_0x3337ff[_0x5245('0x16a')]));var _0x3467ed=eval(_0x3337ff[_0x5245('0x16a')]);if(!this[_0x5245('0x89')](_0x3337ff[_0x5245('0xe1')])){return this[_0x5245('0x38')]['noop'](_0x5245('0xe0'));}var _0x334ed0=this['getVariable'][_0x5245('0x74')](this,_0x3337ff[_0x5245('0xe1')]);if(!_0x334ed0){return this[_0x5245('0x38')][_0x5245('0x2c')](_0x3337ff,_0x5245('0xe2'));}if(_[_0x5245('0x9f')](_0x3467ed)){var _0x1514ef=this;_0x3467ed[_0x5245('0x16b')](function(_0x14cec5,_0xa7299e){_0x1514ef['channel'][_0x5245('0xa5')](util[_0x5245('0x28')](_0x5245('0x16c'),_0x334ed0,_0xa7299e),_0x14cec5);});return this[_0x5245('0x38')][_0x5245('0xaf')](util[_0x5245('0x28')](_0x5245('0x16d'),_0x334ed0));}else{return this['channel'][_0x5245('0xa5')](_0x334ed0,_0x3467ed);}};AGIVertices[_0x5245('0xf')][_0x5245('0xb')]=function(_0x126bdf){logger[_0x5245('0x2e')](util['format'](_0x5245('0x16e'),_0x126bdf['label']));if(_0x126bdf[_0x5245('0xac')]===0x0){return this[_0x5245('0xab')](_0x126bdf);}_0x126bdf[_0x5245('0xac')]-=0x1;if(!this[_0x5245('0x89')](_0x126bdf[_0x5245('0x115')])){return this[_0x5245('0x38')][_0x5245('0x2c')](_0x126bdf,_0x5245('0x116'));}var _0x4a1af5=this['getSound']['sync'](this,_0x126bdf[_0x5245('0x115')]);if(!_0x4a1af5){return this['channel'][_0x5245('0x2c')](_0x126bdf,_0x5245('0x117'));}var _0x531fa3=this[_0x5245('0x38')][_0x5245('0x118')](_0x4a1af5,_0x126bdf[_0x5245('0x16f')],_0x126bdf[_0x5245('0x170')]);var _0x35ed77=_0x531fa3[_0x5245('0xa8')];if(_0x531fa3[_0x5245('0xa8')]===-0x1){this[_0x5245('0x37')][_0x5245('0x74')](this,_0x126bdf,'-1');return _0x531fa3;}else if(_0x531fa3[_0x5245('0xaa')]==='timeout'){_0x531fa3['result']=_0x531fa3[_0x5245('0xa8')][_0x5245('0xa4')]>0x0?_0x531fa3[_0x5245('0xa8')]:'t';}else if(_[_0x5245('0x47')](_0x531fa3['result'])){_0x531fa3[_0x5245('0xa8')]='#';_0x35ed77='#';}if(!this[_0x5245('0x89')](_0x126bdf['variable_id'])){this[_0x5245('0x38')][_0x5245('0xaf')](_0x5245('0xe0'));}else{var _0xa41b49=this[_0x5245('0x10')][_0x5245('0x74')](this,_0x126bdf['variable_id']);if(!_0xa41b49){return this[_0x5245('0x38')][_0x5245('0x2c')](_0x126bdf,_0x5245('0xe2'));}this[_0x5245('0x38')][_0x5245('0xa5')](_0xa41b49,_0x35ed77);}this[_0x5245('0x37')][_0x5245('0x74')](this,_0x126bdf,_0x35ed77);return _0x531fa3;};AGIVertices[_0x5245('0xf')][_0x5245('0xaf')]=function(_0x30fdf3){logger[_0x5245('0x2e')](util[_0x5245('0x28')](_0x5245('0x171'),_0x30fdf3[_0x5245('0x3a')]));return this[_0x5245('0x38')][_0x5245('0xaf')](_0x30fdf3[_0x5245('0x172')]||_0x30fdf3['label']);};AGIVertices[_0x5245('0xf')][_0x5245('0x173')]=function(_0x27f9f7){logger[_0x5245('0x2e')](util[_0x5245('0x28')]('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x27f9f7[_0x5245('0x3a')]));if(!this[_0x5245('0x89')](_0x27f9f7['findBy'])){return this[_0x5245('0x38')][_0x5245('0x2c')](_0x27f9f7,'no\x20find\x20by\x20configured');}logger[_0x5245('0x2e')](util[_0x5245('0x28')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x5245('0x38')][_0x5245('0x3d')],_0x27f9f7[_0x5245('0x160')]));var _0x201001=this[_0x5245('0x174')][_0x5245('0x74')](this,_0x27f9f7['pause_id']);var _0x5935d8=this[_0x5245('0x53')][_0x5245('0x74')](this,_0x27f9f7[_0x5245('0x160')],_0x201001);if(_0x5935d8){logger[_0x5245('0x2e')](util[_0x5245('0x28')](_0x5245('0x161'),this[_0x5245('0x38')][_0x5245('0x3d')],_0x27f9f7['findBy']));this['channel'][_0x5245('0xaf')](util[_0x5245('0x28')](_0x5245('0x161'),this['channel'][_0x5245('0x3d')],_0x27f9f7[_0x5245('0x160')]));return{'code':0xc8,'result':_0x5245('0x166')};}else{logger['info'](util[_0x5245('0x28')](_0x5245('0x162'),this[_0x5245('0x38')]['callerid'],_0x27f9f7[_0x5245('0x160')]));this[_0x5245('0x38')][_0x5245('0xaf')](util[_0x5245('0x28')](_0x5245('0x161'),this[_0x5245('0x38')][_0x5245('0x3d')],_0x27f9f7[_0x5245('0x160')]));return{'code':0xc8,'result':_0x5245('0x163')};}};AGIVertices[_0x5245('0xf')][_0x5245('0x175')]=function(_0x46f887){logger[_0x5245('0x2e')](util[_0x5245('0x28')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x46f887[_0x5245('0x3a')]));if(!this[_0x5245('0x89')](_0x46f887[_0x5245('0x115')])){return this['channel'][_0x5245('0x2c')](_0x46f887,_0x5245('0x116'));}var _0x517773=this[_0x5245('0x1d')][_0x5245('0x74')](this,_0x46f887[_0x5245('0x115')]);if(!_0x517773){return this['channel'][_0x5245('0x2c')](_0x46f887,_0x5245('0x117'));}var _0x16ba65=this[_0x5245('0x38')][_0x5245('0xb1')]('PLAYBACK',[_0x517773,_0x46f887[_0x5245('0xee')]]);if(_0x16ba65[_0x5245('0xa8')]===-0x1){return _0x16ba65;}return this[_0x5245('0x38')][_0x5245('0xaf')](util[_0x5245('0x28')](_0x5245('0xcb'),_0x5245('0x176'),_0x517773));};AGIVertices[_0x5245('0xf')]['queue']=function(_0x4595d1){logger[_0x5245('0x2e')](util[_0x5245('0x28')](_0x5245('0x177'),_0x4595d1[_0x5245('0x3a')]));if(!this['isConfigured'](_0x4595d1[_0x5245('0x178')])){return this[_0x5245('0x38')][_0x5245('0x2c')](_0x4595d1,_0x5245('0x179'));}var _0x3c764c='';var _0x3a5d5a=parseInt(_0x4595d1[_0x5245('0x178')],0xa);if(isNaN(_0x3a5d5a)){_0x3c764c=_0x4595d1[_0x5245('0x178')];}else{_0x3c764c=this[_0x5245('0x15')][_0x5245('0x74')](this,_0x4595d1[_0x5245('0x178')]);if(!_0x3c764c){return this[_0x5245('0x38')][_0x5245('0x2c')](_0x4595d1,'no\x20queue\x20found');}}var _0x2560ca='';if(this['isConfigured'](_0x4595d1[_0x5245('0x115')])){var _0x29eaa9=this[_0x5245('0x1d')][_0x5245('0x74')](this,_0x4595d1[_0x5245('0x115')]);if(_0x29eaa9){_0x2560ca=_0x29eaa9;}}this[_0x5245('0x37')][_0x5245('0x74')](this,_0x4595d1,_0x3c764c);if(_0x4595d1[_0x5245('0xee')]['indexOf']('x')<0x0){_0x4595d1[_0x5245('0xee')]+='x';}if(_0x4595d1[_0x5245('0xee')][_0x5245('0x17a')]('X')<0x0){_0x4595d1[_0x5245('0xee')]+='X';}this[_0x5245('0x38')][_0x5245('0xa5')](_0x5245('0x17b'),_0x3c764c?_0x3c764c['toLowerCase']():'');var _0x3c9642=this[_0x5245('0x38')][_0x5245('0xb1')](_0x5245('0x17c'),[_0x3c764c,_0x4595d1[_0x5245('0xee')],_0x4595d1[_0x5245('0x65')],_0x2560ca,_0x4595d1[_0x5245('0x67')],_0x4595d1['agi'],_0x4595d1[_0x5245('0x17d')],_0x4595d1['gosub'],'',_0x4595d1[_0x5245('0x17e')]]);if(_0x3c9642['result']===-0x1){return _0x3c9642;}return this[_0x5245('0x38')]['noop'](util['format'](_0x5245('0xcb'),_0x5245('0x17c'),_0x3c764c));};AGIVertices[_0x5245('0xf')][_0x5245('0x17f')]=function(_0x5f1d21){logger['info'](util[_0x5245('0x28')](_0x5245('0x180'),_0x5f1d21[_0x5245('0x3a')]));var _0x5bfdb4=_0x5f1d21[_0x5245('0x181')]||_0x5245('0x136');var _0x2258ef=util[_0x5245('0x28')](_0x5245('0x182'),this['channel']['uniqueid'],rs[_0x5245('0x11f')](0x5));var _0x457430=util['format'](_0x5245('0x183'),FILES_PATH,_0x2258ef,_0x5bfdb4);var _0xb3c367=util[_0x5245('0x28')](_0x5245('0x137'),FILES_PATH,_0x2258ef);this[_0x5245('0x3c')][_0x5245('0x74')](this,_0x5f1d21,_0x2258ef,_0x457430);this[_0x5245('0x38')][_0x5245('0xa5')](_0x5245('0x184'),_0x2258ef);logger[_0x5245('0x2e')](_0x5245('0x185'),_0xb3c367,_0x5bfdb4,_0x5f1d21[_0x5245('0x186')],_0x5f1d21[_0x5245('0x67')]);return this[_0x5245('0x38')][_0x5245('0x139')](_0xb3c367,_0x5bfdb4,_0x5f1d21[_0x5245('0x186')],_0x5f1d21[_0x5245('0x67')],undefined,!![]);};AGIVertices[_0x5245('0xf')][_0x5245('0x187')]=function(_0x569f78){logger[_0x5245('0x2e')](util['format'](_0x5245('0x188'),_0x569f78[_0x5245('0x3a')]));if(!this['isConfigured'](_0x569f78[_0x5245('0x65')])){return this[_0x5245('0x38')][_0x5245('0xaf')](_0x5245('0x189'));}var _0x3834e5=this['restAPI'][_0x5245('0x74')](this,_0x569f78);logger[_0x5245('0x2e')](util[_0x5245('0x28')](_0x5245('0x18a'),util[_0x5245('0x18b')](_0x3834e5,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x569f78['variable_id'])){return this['channel'][_0x5245('0xaf')](_0x5245('0x18c'));}var _0x531770=this[_0x5245('0x10')][_0x5245('0x74')](this,_0x569f78['variable_id']);if(!_0x531770){return this[_0x5245('0x38')][_0x5245('0x2c')](_0x569f78,'no\x20variable\x20found');}this[_0x5245('0x38')][_0x5245('0xa5')](util[_0x5245('0x28')](_0x5245('0x18d'),_0x531770),_0x3834e5[_0x5245('0x79')]?_0x3834e5[_0x5245('0x79')]:_0x5245('0x18e'));this[_0x5245('0x38')][_0x5245('0xa5')](util[_0x5245('0x28')](_0x5245('0x18f'),_0x531770),_0x3834e5[_0x5245('0x7a')]?_0x3834e5[_0x5245('0x7a')]:'OK');if(_0x3834e5[_0x5245('0x6c')]){try{this[_0x5245('0xa1')](_0x3834e5[_0x5245('0x6c')],_0x531770);}catch(_0x5631c8){logger[_0x5245('0x2c')](util[_0x5245('0x28')](_0x5245('0x190'),_0x531770));}}return this['channel']['noop'](util[_0x5245('0x28')]('variable\x20%s\x20set',_0x531770));};AGIVertices[_0x5245('0xf')][_0x5245('0x191')]=function(_0x538ab6){logger[_0x5245('0x2e')](util[_0x5245('0x28')](_0x5245('0x192'),_0x538ab6[_0x5245('0x3a')]));return this[_0x5245('0x38')][_0x5245('0x193')](_0x538ab6[_0x5245('0x194')][_0x5245('0xde')](/\s+/g,''),_0x538ab6[_0x5245('0x186')]);};AGIVertices['prototype'][_0x5245('0x195')]=function(_0x23cec6){logger['info'](util[_0x5245('0x28')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x23cec6[_0x5245('0x3a')]));return this['channel'][_0x5245('0x196')](_0x23cec6[_0x5245('0x68')]['replace'](/\s+/g,''),_0x23cec6['escape_digits']);};AGIVertices[_0x5245('0xf')][_0x5245('0x197')]=function(_0x2a0657){logger[_0x5245('0x2e')](util[_0x5245('0x28')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x2a0657[_0x5245('0x3a')]));return this[_0x5245('0x38')][_0x5245('0x198')](_0x2a0657[_0x5245('0x5d')],_0x2a0657['escape_digits']);};AGIVertices[_0x5245('0xf')]['sendMail']=function(_0x151223){logger[_0x5245('0x2e')](util['format']('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x151223[_0x5245('0x3a')]));if(!this[_0x5245('0x89')](_0x151223[_0x5245('0x199')])){return this['channel']['noop'](_0x5245('0x19a'));}var _0x1ccf9b=this[_0x5245('0x21')][_0x5245('0x74')](this,_0x151223['account_id']);if(!_0x1ccf9b||!_0x1ccf9b[_0x5245('0x19b')]){return this[_0x5245('0x38')][_0x5245('0x2c')](_0x151223,'no\x20mail\x20account\x20found');}var _0x3f1a75={'from':util[_0x5245('0x28')](_0x5245('0x19c'),_0x1ccf9b[_0x5245('0x13')],_0x1ccf9b[_0x5245('0x19d')]||_0x1ccf9b[_0x5245('0x19b')][_0x5245('0x19e')]),'to':_0x151223['to']||'','cc':_0x151223['cc']||'','bcc':_0x151223['bcc']||'','subject':_0x151223[_0x5245('0x19f')],'html':_0x151223[_0x5245('0x5d')],'text':_0x151223[_0x5245('0x5d')]};var _0x387407={'tls':{'rejectUnauthorized':![]}};if(_0x1ccf9b[_0x5245('0x19b')][_0x5245('0x1a0')]){_0x387407[_0x5245('0x1a0')]=_0x1ccf9b[_0x5245('0x19b')][_0x5245('0x1a0')];}else{_0x387407[_0x5245('0x1a1')]=_0x1ccf9b[_0x5245('0x19b')][_0x5245('0x1a1')];_0x387407['port']=_0x1ccf9b[_0x5245('0x19b')][_0x5245('0x1a2')];_0x387407['secure']=_0x1ccf9b[_0x5245('0x19b')][_0x5245('0x1a3')];}if(_0x1ccf9b[_0x5245('0x19b')][_0x5245('0x1a4')]){_0x387407['auth']={'user':_0x1ccf9b[_0x5245('0x19b')][_0x5245('0x19e')],'pass':_0x1ccf9b[_0x5245('0x19b')][_0x5245('0x1a5')]};}if(this['isConfigured'](_0x151223[_0x5245('0x1a6')])){}logger['debug'](_0x5245('0x1a7'),JSON[_0x5245('0x77')](_0x3f1a75));this[_0x5245('0x37')][_0x5245('0x74')](this,_0x151223,_0x151223['account_id']);this[_0x5245('0x38')][_0x5245('0xaf')](util[_0x5245('0x28')](_0x5245('0x1a8'),_0x1ccf9b[_0x5245('0x13')]));this[_0x5245('0x22')][_0x5245('0x74')](this,_0x387407,_0x3f1a75);return this[_0x5245('0x38')][_0x5245('0xaf')](_0x5245('0x1a9'));};AGIVertices['prototype'][_0x5245('0x1aa')]=function(_0x485de2){logger[_0x5245('0x2e')](util[_0x5245('0x28')](_0x5245('0x1ab'),_0x485de2[_0x5245('0x3a')]));return this[_0x5245('0x38')][_0x5245('0xaf')](_0x5245('0x1ac'));};AGIVertices[_0x5245('0xf')][_0x5245('0x1ad')]=function(_0x5a6b3f){logger[_0x5245('0x2e')](util[_0x5245('0x28')](_0x5245('0x1ae'),_0x5a6b3f['label']));if(!this['isConfigured'](_0x5a6b3f['sms_account_id'])){return this[_0x5245('0x38')][_0x5245('0xaf')](_0x5245('0x1af'));}var _0x49067e=this[_0x5245('0x35')][_0x5245('0x74')](this,_0x5a6b3f['sms_account_id']);if(!_0x49067e){return this['channel'][_0x5245('0x2c')](_0x5a6b3f,'no\x20sms\x20account\x20found');}var _0x16dc8a={'body':_0x5a6b3f[_0x5245('0x1b0')],'phone':_0x5a6b3f['to']||'','SmsAccountId':_0x49067e['id']};logger[_0x5245('0xe8')]('sendSMS\x20message',JSON[_0x5245('0x77')](_0x16dc8a));this[_0x5245('0x37')][_0x5245('0x74')](this,_0x5a6b3f,_0x5a6b3f[_0x5245('0x1b1')]);this['channel'][_0x5245('0xaf')](util['format']('Trying\x20SendSMS\x20with\x20account\x20%s',_0x49067e[_0x5245('0x13')]));this[_0x5245('0x36')][_0x5245('0x74')](this,_0x16dc8a);return this['channel']['noop'](_0x5245('0x1b2'));};AGIVertices[_0x5245('0xf')][_0x5245('0x1b3')]=function(_0x5a824b){logger[_0x5245('0x2e')](util[_0x5245('0x28')](_0x5245('0x1b4'),_0x5a824b[_0x5245('0x3a')]));if(!this[_0x5245('0x89')](_0x5a824b[_0x5245('0xe1')])){return this[_0x5245('0x38')]['error'](_0x5a824b,_0x5245('0x1b5'));}var _0x485689=this[_0x5245('0x10')]['sync'](this,_0x5a824b[_0x5245('0xe1')]);if(!_0x485689){return this[_0x5245('0x38')][_0x5245('0x2c')](_0x5a824b,'no\x20variable\x20found');}return this[_0x5245('0x38')][_0x5245('0xa5')](_0x485689,_0x5a824b[_0x5245('0x1b6')]);};AGIVertices[_0x5245('0xf')]['start']=function(_0x10cea7){logger[_0x5245('0x2e')](util['format']('Enter\x20in\x20START\x20(%s)\x20block',_0x10cea7['label']));this[_0x5245('0x38')][_0x5245('0xaf')](_0x5245('0x1b7'));if(_0x10cea7[_0x5245('0xc0')]===_0x5245('0x1b8')){this[_0x5245('0x38')][_0x5245('0xaf')](_0x5245('0x1b9'));return this[_0x5245('0x38')][_0x5245('0xc0')]();}return this[_0x5245('0x38')][_0x5245('0xaf')](_0x5245('0x1ba'));};AGIVertices[_0x5245('0xf')][_0x5245('0x1bb')]=function(_0x17b7e4){logger['info'](util[_0x5245('0x28')]('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x17b7e4[_0x5245('0x3a')]));if(!this['isConfigured'](_0x17b7e4[_0x5245('0x1bc')])){return this['channel'][_0x5245('0x2c')](_0x17b7e4,'no\x20subproject\x20selected');}var _0x908bc0=this['getSquareProject'][_0x5245('0x74')](this,_0x17b7e4[_0x5245('0x1bc')]);if(!this[_0x5245('0x89')](_0x908bc0)){return this[_0x5245('0x38')]['error'](_0x17b7e4,util[_0x5245('0x28')](_0x5245('0x1bd'),_0x17b7e4[_0x5245('0x1bc')]));}if(_0x908bc0===this['channel'][_0x5245('0x3b')]){return this[_0x5245('0x38')][_0x5245('0x2c')](_0x17b7e4,_0x5245('0x1be'));}this[_0x5245('0x37')][_0x5245('0x74')](this,_0x17b7e4,_0x908bc0);var _0x2328b9=this[_0x5245('0x38')][_0x5245('0xb1')](_0x5245('0x1bf'),util[_0x5245('0x28')](_0x5245('0x1c0'),config[_0x5245('0x7')][_0x5245('0x1a1')]||_0x5245('0x1c1'),_0x908bc0,this[_0x5245('0x38')][_0x5245('0x3b')]));if(_0x2328b9[_0x5245('0xa8')]===-0x1){return _0x2328b9;}return this[_0x5245('0x38')][_0x5245('0xaf')](util['format'](_0x5245('0xcb'),_0x5245('0x1bf'),_0x908bc0));};AGIVertices[_0x5245('0xf')][_0x5245('0x1c2')]=function(_0xd2e50b){logger[_0x5245('0x2e')](util[_0x5245('0x28')](_0x5245('0x1c3'),_0xd2e50b[_0x5245('0x3a')]));var _0x252a22=this[_0x5245('0x59')][_0x5245('0x74')](this,_0xd2e50b[_0x5245('0x1c4')]);this[_0x5245('0x37')][_0x5245('0x74')](this,_0xd2e50b,_0xd2e50b[_0x5245('0x1c4')]);if(this['isConfigured'](_0xd2e50b[_0x5245('0xe1')])){var _0x5412cf=this[_0x5245('0x10')][_0x5245('0x74')](this,_0xd2e50b[_0x5245('0xe1')]);if(_0x5412cf){this[_0x5245('0x38')]['setVariable'](_0x5412cf,_0x252a22);return this[_0x5245('0x38')]['noop'](util[_0x5245('0x28')](_0x5245('0x1c5'),_0xd2e50b[_0x5245('0x1c4')],_0x5412cf));}}return this[_0x5245('0x38')][_0x5245('0xaf')](util[_0x5245('0x28')](_0x5245('0x1c6'),_0xd2e50b[_0x5245('0x1c4')]));};AGIVertices[_0x5245('0xf')][_0x5245('0x1c7')]=function(_0x143617){logger[_0x5245('0x2e')](util['format'](_0x5245('0x1c8'),_0x143617['label']));_0x143617[_0x5245('0x5d')]=_0x143617[_0x5245('0x5d')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x5245('0x89')](_0x143617['apiKey'])){return this[_0x5245('0x38')][_0x5245('0xaf')]('no\x20apiKey\x20configured');}if(!this[_0x5245('0x89')](_0x143617[_0x5245('0x5d')])){return this[_0x5245('0x38')]['noop']('no\x20text\x20configured');}this[_0x5245('0x38')][_0x5245('0xaf')](util[_0x5245('0x28')](_0x5245('0x1c9'),_0x143617[_0x5245('0x5d')]));var _0x28bcb4=this['googleCloudTTS'][_0x5245('0x74')](this,_0x143617);if(_0x28bcb4){this[_0x5245('0x38')][_0x5245('0xaf')](util['format'](_0x5245('0x1ca'),_0x28bcb4));var _0x15a0aa=this[_0x5245('0x38')][_0x5245('0x109')](_0x28bcb4);try{fs[_0x5245('0x129')](_0x28bcb4+_0x5245('0x10a'));}catch(_0x533c3b){logger[_0x5245('0x2c')](_0x533c3b);}return _0x15a0aa;}return this['channel'][_0x5245('0x2c')](_0x143617,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0x5245('0xf')][_0x5245('0x1cb')]=function(_0x5445fc){logger[_0x5245('0x2e')](util[_0x5245('0x28')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x5445fc[_0x5245('0x3a')]));_0x5445fc['text']=_0x5445fc['text'][_0x5245('0xde')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x5245('0x89')](_0x5445fc[_0x5245('0x5d')])){return this[_0x5245('0x38')][_0x5245('0xaf')]('no\x20text\x20configured');}this[_0x5245('0x38')][_0x5245('0xaf')](util[_0x5245('0x28')](_0x5245('0x1cc'),_0x5445fc[_0x5245('0x5d')]));var _0xcf26e=this[_0x5245('0x62')]['sync'](this,_0x5445fc);if(_0xcf26e){this[_0x5245('0x38')][_0x5245('0xaf')](util[_0x5245('0x28')]('Google\x20TTS\x20%s\x20file\x20created',_0xcf26e));var _0x30b1a9=this[_0x5245('0x38')]['streamFile'](_0xcf26e);try{fs[_0x5245('0x129')](_0xcf26e+'.wav');}catch(_0x473218){logger[_0x5245('0x2c')](_0x473218);}return _0x30b1a9;}return this[_0x5245('0x38')][_0x5245('0x2c')](_0x5445fc,_0x5245('0x1cd'));};AGIVertices[_0x5245('0xf')][_0x5245('0x1ce')]=function(_0x2dd487){logger[_0x5245('0x2e')](util['format'](_0x5245('0x1cf'),_0x2dd487[_0x5245('0x3a')]));if(!this['isConfigured'](_0x2dd487[_0x5245('0x160')])){return this['channel'][_0x5245('0x2c')](_0x2dd487,_0x5245('0x15e'));}logger['info'](util[_0x5245('0x28')](_0x5245('0x15f'),this['channel'][_0x5245('0x3d')],_0x2dd487[_0x5245('0x160')]));var _0x16f0ac=this[_0x5245('0x55')][_0x5245('0x74')](this,_0x2dd487[_0x5245('0x160')]);if(_0x16f0ac){logger[_0x5245('0x2e')](util[_0x5245('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x5245('0x38')][_0x5245('0x3d')],_0x2dd487[_0x5245('0x160')]));this[_0x5245('0x38')][_0x5245('0xaf')](util['format'](_0x5245('0x161'),this[_0x5245('0x38')][_0x5245('0x3d')],_0x2dd487['findBy']));return{'code':0xc8,'result':_0x5245('0x166')};}else{logger[_0x5245('0x2e')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x5245('0x38')][_0x5245('0x3d')],_0x2dd487['findBy']));this[_0x5245('0x38')]['noop'](util[_0x5245('0x28')](_0x5245('0x162'),this[_0x5245('0x38')]['callerid'],_0x2dd487[_0x5245('0x160')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x5245('0xf')][_0x5245('0x1d0')]=function(_0x177f7e){logger[_0x5245('0x2e')](util[_0x5245('0x28')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x177f7e['label']));var _0x3f05d0=this['channel'][_0x5245('0xb1')](_0x5245('0x1d1'),[_0x177f7e['mailbox'],_0x177f7e[_0x5245('0x7d')]]);if(_0x3f05d0['result']===-0x1){return _0x3f05d0;}return this[_0x5245('0x38')][_0x5245('0xaf')](util[_0x5245('0x28')](_0x5245('0xcb'),'VOICEMAIL',_0x177f7e[_0x5245('0x1d2')]));};AGIVertices['prototype'][_0x5245('0x1d3')]=function(_0x26ad92){logger[_0x5245('0x2e')](util[_0x5245('0x28')](_0x5245('0x1d4'),_0x26ad92[_0x5245('0x3a')]));if(!this[_0x5245('0x89')](_0x26ad92[_0x5245('0xe1')])){return this['channel'][_0x5245('0x2c')](_0x26ad92,_0x5245('0x1b5'));}var _0x21fd12=this[_0x5245('0x10')][_0x5245('0x74')](this,_0x26ad92[_0x5245('0xe1')]);if(!_0x21fd12){return this['channel'][_0x5245('0x2c')](_0x26ad92,_0x5245('0xe2'));}var _0x1e4295=this[_0x5245('0x38')]['getVariable'](_0x21fd12);return{'code':0xc8,'result':_0x1e4295[_0x5245('0xaa')]?_0x1e4295[_0x5245('0xaa')]:'-'};};String[_0x5245('0xf')][_0x5245('0xa7')]=function(_0x52fa24,_0x345f42){return this[_0x5245('0xa6')](_0x52fa24)[_0x5245('0x1d5')](_0x345f42);};module[_0x5245('0x1d6')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 7d7e0b4..bb564f4 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 _0xc999=['QueuePause','getAgent','voicePause','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','info','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','queue','updateAcw','timer','uniqueid','then','[%s][UPDATE][ACWTIME:%s]','catch','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','error','finally','prototype','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','message','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','transfereeuniqueid','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','[%s][BLINDTRANSFER:LINKEDID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','savePause','util','lodash','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','milliseconds','diff','seconds','startAcw','channels','interface','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action'];(function(_0x3adba8,_0x38ad46){var _0x4141b8=function(_0x1c5581){while(--_0x1c5581){_0x3adba8['push'](_0x3adba8['shift']());}};_0x4141b8(++_0x38ad46);}(_0xc999,0x129));var _0x9c99=function(_0x386525,_0xefae6){_0x386525=_0x386525-0x0;var _0x14d015=_0xc999[_0x386525];return _0x14d015;};'use strict';var util=require(_0x9c99('0x0'));var _=require(_0x9c99('0x1'));var moment=require('moment');var ami=require('../ami');var logger=require(_0x9c99('0x2'))(_0x9c99('0x3'));var RpcUser=require(_0x9c99('0x4'));var RpcVoiceAgentReport=require(_0x9c99('0x5'));function Acw(_0x1aa77e){this[_0x9c99('0x6')]=_0x1aa77e[_0x9c99('0x6')];this[_0x9c99('0x7')]=_0x1aa77e[_0x9c99('0x7')];this[_0x9c99('0x8')]=_0x1aa77e[_0x9c99('0x8')];this['channels']={};ami['on']('agentconnect',this['syncAgentConnect'][_0x9c99('0x9')](this));ami['on'](_0x9c99('0xa'),this[_0x9c99('0xb')][_0x9c99('0x9')](this));ami['on'](_0x9c99('0xc'),this[_0x9c99('0xd')][_0x9c99('0x9')](this));ami['on'](_0x9c99('0xe'),this[_0x9c99('0xf')]['bind'](this));ami['on']('attendedtransfer',this[_0x9c99('0x10')][_0x9c99('0x9')](this));ami['on'](_0x9c99('0x11'),this[_0x9c99('0x12')][_0x9c99('0x9')](this));ami['on'](_0x9c99('0x13'),this['syncAgentConnectPreview'][_0x9c99('0x9')](this));}function getDiff(_0x45a8b0){var _0x4f2876=moment()[_0x9c99('0x14')](0x0);var _0xa923d6=moment(_0x45a8b0)[_0x9c99('0x14')](0x0);return _0x4f2876[_0x9c99('0x15')](_0xa923d6,_0x9c99('0x16'));}Acw['prototype'][_0x9c99('0x17')]=function(_0x21846a){try{var _0x5a4a08=this;var _0xf46964=this[_0x9c99('0x18')][_0x21846a][_0x9c99('0x19')];var _0x3748f0=this['channels'][_0x21846a]['queue'];var _0x46b1be=this[_0x9c99('0x6')][_0x3748f0];var _0x17b198=![];var _0x4c7677=_0x9c99('0x1a');if(_0x46b1be[_0x9c99('0x1b')]){if(_0x46b1be[_0x9c99('0x1c')][_0x9c99('0x1d')]){_0x17b198=!![];_0x4c7677=_0x46b1be[_0x9c99('0x1c')]['name'];}}ami[_0x9c99('0x1e')]({'action':_0x9c99('0x1f'),'interface':_0xf46964,'paused':!![],'reason':_0x4c7677})['then'](function(_0x41b2b6){if(_0x5a4a08[_0x9c99('0x7')][_0xf46964]){return RpcUser[_0x9c99('0x20')](_0x5a4a08['agents'][_0xf46964]['id'])['then'](function(_0x2021ba){if(_0x2021ba&&!_0x2021ba[_0x9c99('0x21')]){logger['info'](_0x9c99('0x22'),_0x21846a,_0xf46964,_0x3748f0);var _0x2be5e3=_0x5a4a08[_0x9c99('0x18')][_0x21846a][_0x9c99('0x23')]&&_0x5a4a08[_0x9c99('0x18')][_0x21846a]['destlinkedid']?_0x5a4a08[_0x9c99('0x18')][_0x21846a][_0x9c99('0x24')]:_0x21846a;return RpcUser['savePause'](_0x5a4a08['agents'][_0xf46964],_0x4c7677,_0x2be5e3)['then'](function(_0x560c01){if(!_0x17b198){_0x5a4a08['timers'][_0xf46964]={};logger[_0x9c99('0x25')](_0x9c99('0x26'),_0x21846a,_0x5a4a08[_0x9c99('0x6')][_0x3748f0][_0x9c99('0x27')],_0xf46964,_0x3748f0);_0x5a4a08[_0x9c99('0x8')][_0xf46964]['timer']=setTimeout(_0x5a4a08[_0x9c99('0x28')][_0x9c99('0x9')](_0x5a4a08,_0xf46964),_0x5a4a08[_0x9c99('0x6')][_0x3748f0]['acwTimeout']*0x3e8);_0x5a4a08[_0x9c99('0x8')][_0xf46964]['lastPauseAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x5a4a08[_0x9c99('0x8')][_0xf46964]['uniqueid']=_0x21846a;_0x5a4a08['timers'][_0xf46964][_0x9c99('0x29')]=_0x3748f0;_0x5a4a08['timers'][_0xf46964][_0x9c99('0x2a')]=function(){var _0x37c92b=getDiff(_0x5a4a08['timers'][_0xf46964]['lastPauseAt']);clearTimeout(_0x5a4a08[_0x9c99('0x8')][_0xf46964][_0x9c99('0x2b')]);_0x5a4a08[_0x9c99('0x8')][_0xf46964]['timer']=![];RpcVoiceAgentReport['update']({'acwtime':_0x37c92b},_0x5a4a08[_0x9c99('0x8')][_0xf46964][_0x9c99('0x2c')],_0xf46964)[_0x9c99('0x2d')](function(_0x5a82ee){logger[_0x9c99('0x25')](_0x9c99('0x2e'),_0x21846a,_0x37c92b,_0x5a82ee);})[_0x9c99('0x2f')](function(_0x3252c9){logger['error'](_0x9c99('0x30'),_0x21846a,_0x3252c9);});delete _0x5a4a08['timers'][_0xf46964];};}});}else{logger[_0x9c99('0x25')](_0x9c99('0x31'),_0x21846a,_0xf46964,_0x3748f0);}});}})[_0x9c99('0x2f')](function(_0x2b49b8){logger[_0x9c99('0x32')](_0x9c99('0x26'),_0x21846a,_0x5a4a08[_0x9c99('0x6')][_0x3748f0]['acwTimeout'],_0xf46964,_0x3748f0);})[_0x9c99('0x33')](function(){delete _0x5a4a08[_0x9c99('0x18')][_0x21846a];});}catch(_0x368e8b){logger[_0x9c99('0x32')]('[ACW][START]\x20%s',_0x368e8b['message']);}};Acw[_0x9c99('0x34')][_0x9c99('0x28')]=function(_0x55cac6){try{var _0x2cc179=this;if(_0x2cc179[_0x9c99('0x8')][_0x55cac6]){_0x2cc179[_0x9c99('0x8')][_0x55cac6][_0x9c99('0x2b')]=![];var _0x294350=_0x2cc179[_0x9c99('0x8')][_0x55cac6]['uniqueid'];var _0x293eef=_0x2cc179[_0x9c99('0x8')][_0x55cac6][_0x9c99('0x29')];var _0x197ff1=_0x2cc179[_0x9c99('0x6')][_0x293eef][_0x9c99('0x27')];logger['info'](_0x9c99('0x35'),_0x294350,_0x55cac6);RpcUser[_0x9c99('0x36')](this[_0x9c99('0x7')][_0x55cac6]);RpcVoiceAgentReport['update']({'acwtime':_0x197ff1,'agentacw':!![]},_0x294350,_0x55cac6)[_0x9c99('0x2d')](function(_0x5a1a34){logger['info']('[%s][UPDATE][ACWTIME:%s]',_0x294350,_0x197ff1,_0x5a1a34);})[_0x9c99('0x2f')](function(_0x46a3e5){logger[_0x9c99('0x32')](_0x9c99('0x30'),_0x294350,_0x46a3e5);});}else{logger[_0x9c99('0x32')](_0x9c99('0x37'),_0x55cac6);if(_0x2cc179['timers']){logger[_0x9c99('0x25')](_0x9c99('0x38'),JSON[_0x9c99('0x39')](_0x2cc179[_0x9c99('0x8')]));}}}catch(_0x22186d){logger[_0x9c99('0x32')](_0x9c99('0x3a'),_0x22186d[_0x9c99('0x3b')]);}};Acw['prototype']['syncAgentConnect']=function(_0x1df45a){try{if(this[_0x9c99('0x6')][_0x1df45a[_0x9c99('0x29')]]&&(this[_0x9c99('0x6')][_0x1df45a[_0x9c99('0x29')]][_0x9c99('0x3')]||this[_0x9c99('0x6')][_0x1df45a[_0x9c99('0x29')]]['mandatoryDisposition'])){if(this['agents'][_0x1df45a[_0x9c99('0x19')]]){this[_0x9c99('0x18')][_0x1df45a[_0x9c99('0x2c')]]={'queue':_0x1df45a[_0x9c99('0x29')],'interface':_0x1df45a[_0x9c99('0x19')],'destlinkedid':_0x1df45a[_0x9c99('0x24')]};}}}catch(_0x2b764f){logger['error'](_0x9c99('0x3c'),_0x2b764f[_0x9c99('0x3b')]);}};Acw[_0x9c99('0x34')]['syncAgentConnectPreview']=function(_0x14d894){try{if(this['voiceQueues'][_0x14d894[_0x9c99('0x29')]]&&(this[_0x9c99('0x6')][_0x14d894[_0x9c99('0x29')]]['acw']||this['voiceQueues'][_0x14d894[_0x9c99('0x29')]][_0x9c99('0x1b')])){if(this[_0x9c99('0x7')][_0x14d894[_0x9c99('0x19')]]){this[_0x9c99('0x18')][_0x14d894[_0x9c99('0x2c')]]={'queue':_0x14d894[_0x9c99('0x29')],'interface':_0x14d894[_0x9c99('0x19')]};}}}catch(_0x45bb7e){logger[_0x9c99('0x32')](_0x9c99('0x3d'),_0x45bb7e['message']);}};Acw[_0x9c99('0x34')][_0x9c99('0xb')]=function(_0x30558c){try{if(this[_0x9c99('0x18')][_0x30558c[_0x9c99('0x2c')]]&&_[_0x9c99('0x3e')](this[_0x9c99('0x18')][_0x30558c[_0x9c99('0x2c')]]['attended'])){logger['info'](_0x9c99('0x3f'),_0x30558c['uniqueid']);this['startAcw'](_0x30558c['uniqueid']);}else if(this[_0x9c99('0x18')][_0x30558c[_0x9c99('0x40')]]&&_[_0x9c99('0x3e')](this['channels'][_0x30558c[_0x9c99('0x40')]][_0x9c99('0x23')])){logger['info']('[%s][HANGUP:LINKEDID]',_0x30558c[_0x9c99('0x40')]);this[_0x9c99('0x17')](_0x30558c[_0x9c99('0x40')]);}}catch(_0x38b0a6){logger['error'](_0x9c99('0x41'),_0x38b0a6['message']);}};Acw[_0x9c99('0x34')]['syncHangup']=function(_0x18b598){try{if(this[_0x9c99('0x18')][_0x18b598[_0x9c99('0x2c')]]&&this[_0x9c99('0x18')][_0x18b598[_0x9c99('0x2c')]][_0x9c99('0x23')]){logger[_0x9c99('0x25')](_0x9c99('0x42'),_0x18b598[_0x9c99('0x2c')]);this[_0x9c99('0x17')](_0x18b598[_0x9c99('0x2c')]);}else if(this[_0x9c99('0x18')][_0x18b598[_0x9c99('0x40')]]&&this['channels'][_0x18b598[_0x9c99('0x40')]]['attended']){logger[_0x9c99('0x25')](_0x9c99('0x43'),_0x18b598[_0x9c99('0x40')]);this[_0x9c99('0x17')](_0x18b598[_0x9c99('0x40')]);}}catch(_0x49eafa){logger[_0x9c99('0x32')](_0x9c99('0x44'),_0x49eafa[_0x9c99('0x3b')]);}};Acw[_0x9c99('0x34')][_0x9c99('0x10')]=function(_0x30981b){try{if(!_[_0x9c99('0x45')](this[_0x9c99('0x18')][_0x30981b['transfereeuniqueid']])){this[_0x9c99('0x17')](_0x30981b['transfereeuniqueid']);if(this['channels'][_0x30981b[_0x9c99('0x46')]]){this[_0x9c99('0x18')][_0x30981b[_0x9c99('0x46')]][_0x9c99('0x23')]=!![];this[_0x9c99('0x18')][_0x30981b[_0x9c99('0x47')]]=this[_0x9c99('0x18')][_0x30981b[_0x9c99('0x46')]];delete this['channels'][_0x30981b['secondtransfereruniqueid']];}}else if(!_['isNil'](this[_0x9c99('0x18')][_0x30981b[_0x9c99('0x47')]])){this['startAcw'](_0x30981b[_0x9c99('0x47')]);if(this[_0x9c99('0x18')][_0x30981b[_0x9c99('0x48')]]){this[_0x9c99('0x18')][_0x30981b[_0x9c99('0x48')]]['attended']=!![];this[_0x9c99('0x18')][_0x30981b[_0x9c99('0x49')]]=this[_0x9c99('0x18')][_0x30981b[_0x9c99('0x48')]];delete this['channels'][_0x30981b['origtransfereruniqueid']];}}}catch(_0x1d5519){logger['error']('[ACW][syncAttendedTransfer]\x20%s',_0x1d5519[_0x9c99('0x3b')]);}};Acw[_0x9c99('0x34')][_0x9c99('0x12')]=function(_0x2469e5){try{if(this['channels'][_0x2469e5[_0x9c99('0x4a')]]){logger[_0x9c99('0x25')](_0x9c99('0x4b'),JSON[_0x9c99('0x39')](_0x2469e5[_0x9c99('0x4a')]));this[_0x9c99('0x17')](_0x2469e5[_0x9c99('0x4a')]);}else if(this[_0x9c99('0x18')][_0x2469e5['transfererlinkedid']]){logger[_0x9c99('0x25')](_0x9c99('0x4c'),JSON[_0x9c99('0x39')](_0x2469e5[_0x9c99('0x4d')]));this[_0x9c99('0x17')](_0x2469e5[_0x9c99('0x4d')]);}}catch(_0xe70314){logger[_0x9c99('0x32')](_0x9c99('0x4e'),_0xe70314['message']);}};Acw[_0x9c99('0x34')]['syncAgentRingNoAnswer']=function(_0x4749be){try{if(this[_0x9c99('0x6')][_0x4749be['queue']]&&this['voiceQueues'][_0x4749be[_0x9c99('0x29')]]['autopause']===_0x9c99('0x4f')){if(this[_0x9c99('0x7')][_0x4749be[_0x9c99('0x19')]]){logger[_0x9c99('0x25')](_0x9c99('0x50'),_0x4749be['uniqueid'],_0x4749be[_0x9c99('0x19')],_0x4749be[_0x9c99('0x29')]);return RpcUser[_0x9c99('0x51')](this['agents'][_0x4749be[_0x9c99('0x19')]],'Auto-Pause',_0x4749be[_0x9c99('0x2c')]);}}}catch(_0x498316){logger[_0x9c99('0x32')]('[ACW][syncAgentRingNoAnswer]\x20%s',_0x498316[_0x9c99('0x3b')]);}};module['exports']=Acw; \ No newline at end of file +var _0xffb4=['[%s][TIMER][STOP][AGENT:%s]','[%s][UPDATE][ACWTIME:%s]','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','interface','[ACW][syncAgentConnectPreview]\x20%s','syncHangupRequest','isUndefined','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','isNil','transfereeuniqueid','secondtransfereruniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','syncBlindTransfer','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','[ACW][syncAgentRingNoAnswer]\x20%s','exports','moment','../ami','acw','../rpc/user','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','hangup','syncHangup','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','seconds','prototype','startAcw','queue','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','getAgent','then','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','timer','acwTimeout','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','update','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','message'];(function(_0x3b4461,_0x52607c){var _0x3be06b=function(_0x4ef763){while(--_0x4ef763){_0x3b4461['push'](_0x3b4461['shift']());}};_0x3be06b(++_0x52607c);}(_0xffb4,0xc0));var _0x4ffb=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0xffb4[_0x3070dc];return _0x431489;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x4ffb('0x0'));var ami=require(_0x4ffb('0x1'));var logger=require('../../../config/logger')(_0x4ffb('0x2'));var RpcUser=require(_0x4ffb('0x3'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x1c3c72){this[_0x4ffb('0x4')]=_0x1c3c72[_0x4ffb('0x4')];this[_0x4ffb('0x5')]=_0x1c3c72['agents'];this[_0x4ffb('0x6')]=_0x1c3c72[_0x4ffb('0x6')];this[_0x4ffb('0x7')]={};ami['on'](_0x4ffb('0x8'),this[_0x4ffb('0x9')][_0x4ffb('0xa')](this));ami['on'](_0x4ffb('0xb'),this['syncHangupRequest']['bind'](this));ami['on'](_0x4ffb('0xc'),this[_0x4ffb('0xd')][_0x4ffb('0xa')](this));ami['on']('agentringnoanswer',this[_0x4ffb('0xe')][_0x4ffb('0xa')](this));ami['on'](_0x4ffb('0xf'),this[_0x4ffb('0x10')]['bind'](this));ami['on'](_0x4ffb('0x11'),this['syncBlindTransfer']['bind'](this));ami['on'](_0x4ffb('0x12'),this[_0x4ffb('0x13')][_0x4ffb('0xa')](this));}function getDiff(_0x4f175f){var _0x501afc=moment()[_0x4ffb('0x14')](0x0);var _0x4ea9b2=moment(_0x4f175f)[_0x4ffb('0x14')](0x0);return _0x501afc['diff'](_0x4ea9b2,_0x4ffb('0x15'));}Acw[_0x4ffb('0x16')][_0x4ffb('0x17')]=function(_0x3ea4c3){try{var _0x2fdeac=this;var _0x188869=this[_0x4ffb('0x7')][_0x3ea4c3]['interface'];var _0x325da0=this[_0x4ffb('0x7')][_0x3ea4c3][_0x4ffb('0x18')];var _0x245c2f=this['voiceQueues'][_0x325da0];var _0x2943d4=![];var _0x22d003='ACW';if(_0x245c2f[_0x4ffb('0x19')]){if(_0x245c2f[_0x4ffb('0x1a')][_0x4ffb('0x1b')]){_0x2943d4=!![];_0x22d003=_0x245c2f[_0x4ffb('0x1a')][_0x4ffb('0x1b')];}}ami[_0x4ffb('0x1c')]({'action':_0x4ffb('0x1d'),'interface':_0x188869,'paused':!![],'reason':_0x22d003})['then'](function(_0x41ed5e){if(_0x2fdeac['agents'][_0x188869]){return RpcUser[_0x4ffb('0x1e')](_0x2fdeac[_0x4ffb('0x5')][_0x188869]['id'])[_0x4ffb('0x1f')](function(_0x5996da){if(_0x5996da&&!_0x5996da[_0x4ffb('0x20')]){logger[_0x4ffb('0x21')](_0x4ffb('0x22'),_0x3ea4c3,_0x188869,_0x325da0);var _0x382106=_0x2fdeac[_0x4ffb('0x7')][_0x3ea4c3][_0x4ffb('0x23')]&&_0x2fdeac[_0x4ffb('0x7')][_0x3ea4c3][_0x4ffb('0x24')]?_0x2fdeac[_0x4ffb('0x7')][_0x3ea4c3][_0x4ffb('0x24')]:_0x3ea4c3;return RpcUser[_0x4ffb('0x25')](_0x2fdeac[_0x4ffb('0x5')][_0x188869],_0x22d003,_0x382106)[_0x4ffb('0x1f')](function(_0x18e5ac){if(!_0x2943d4){_0x2fdeac[_0x4ffb('0x6')][_0x188869]={};logger[_0x4ffb('0x21')](_0x4ffb('0x26'),_0x3ea4c3,_0x2fdeac[_0x4ffb('0x4')][_0x325da0]['acwTimeout'],_0x188869,_0x325da0);_0x2fdeac[_0x4ffb('0x6')][_0x188869][_0x4ffb('0x27')]=setTimeout(_0x2fdeac['stopAcw'][_0x4ffb('0xa')](_0x2fdeac,_0x188869),_0x2fdeac[_0x4ffb('0x4')][_0x325da0][_0x4ffb('0x28')]*0x3e8);_0x2fdeac[_0x4ffb('0x6')][_0x188869][_0x4ffb('0x29')]=moment()[_0x4ffb('0x2a')](_0x4ffb('0x2b'));_0x2fdeac[_0x4ffb('0x6')][_0x188869][_0x4ffb('0x2c')]=_0x3ea4c3;_0x2fdeac[_0x4ffb('0x6')][_0x188869][_0x4ffb('0x18')]=_0x325da0;_0x2fdeac[_0x4ffb('0x6')][_0x188869][_0x4ffb('0x2d')]=function(){var _0x3ab807=getDiff(_0x2fdeac[_0x4ffb('0x6')][_0x188869][_0x4ffb('0x29')]);clearTimeout(_0x2fdeac['timers'][_0x188869]['timer']);_0x2fdeac[_0x4ffb('0x6')][_0x188869]['timer']=![];RpcVoiceAgentReport[_0x4ffb('0x2e')]({'acwtime':_0x3ab807},_0x2fdeac['timers'][_0x188869][_0x4ffb('0x2c')],_0x188869)['then'](function(_0x6931eb){logger['info']('[%s][UPDATE][ACWTIME:%s]',_0x3ea4c3,_0x3ab807,_0x6931eb);})[_0x4ffb('0x2f')](function(_0x1a7714){logger[_0x4ffb('0x30')](_0x4ffb('0x31'),_0x3ea4c3,_0x1a7714);});delete _0x2fdeac[_0x4ffb('0x6')][_0x188869];};}});}else{logger[_0x4ffb('0x21')](_0x4ffb('0x32'),_0x3ea4c3,_0x188869,_0x325da0);}});}})[_0x4ffb('0x2f')](function(_0x2a05e1){logger[_0x4ffb('0x30')](_0x4ffb('0x26'),_0x3ea4c3,_0x2fdeac[_0x4ffb('0x4')][_0x325da0]['acwTimeout'],_0x188869,_0x325da0);})[_0x4ffb('0x33')](function(){delete _0x2fdeac['channels'][_0x3ea4c3];});}catch(_0x26163b){logger[_0x4ffb('0x30')](_0x4ffb('0x34'),_0x26163b[_0x4ffb('0x35')]);}};Acw['prototype']['stopAcw']=function(_0x35ea33){try{var _0x290625=this;if(_0x290625['timers'][_0x35ea33]){_0x290625[_0x4ffb('0x6')][_0x35ea33]['timer']=![];var _0x43817c=_0x290625['timers'][_0x35ea33][_0x4ffb('0x2c')];var _0x48657f=_0x290625[_0x4ffb('0x6')][_0x35ea33]['queue'];var _0x5e8c31=_0x290625[_0x4ffb('0x4')][_0x48657f][_0x4ffb('0x28')];logger[_0x4ffb('0x21')](_0x4ffb('0x36'),_0x43817c,_0x35ea33);RpcUser['saveUnpause'](this[_0x4ffb('0x5')][_0x35ea33]);RpcVoiceAgentReport[_0x4ffb('0x2e')]({'acwtime':_0x5e8c31,'agentacw':!![]},_0x43817c,_0x35ea33)[_0x4ffb('0x1f')](function(_0x2dede7){logger[_0x4ffb('0x21')](_0x4ffb('0x37'),_0x43817c,_0x5e8c31,_0x2dede7);})[_0x4ffb('0x2f')](function(_0x116017){logger['error'](_0x4ffb('0x31'),_0x43817c,_0x116017);});}else{logger[_0x4ffb('0x30')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x35ea33);if(_0x290625[_0x4ffb('0x6')]){logger['info'](_0x4ffb('0x38'),JSON[_0x4ffb('0x39')](_0x290625[_0x4ffb('0x6')]));}}}catch(_0x5d2644){logger[_0x4ffb('0x30')](_0x4ffb('0x3a'),_0x5d2644[_0x4ffb('0x35')]);}};Acw[_0x4ffb('0x16')][_0x4ffb('0x9')]=function(_0x13e025){try{if(this['voiceQueues'][_0x13e025[_0x4ffb('0x18')]]&&(this[_0x4ffb('0x4')][_0x13e025[_0x4ffb('0x18')]][_0x4ffb('0x2')]||this[_0x4ffb('0x4')][_0x13e025[_0x4ffb('0x18')]]['mandatoryDisposition'])){if(this[_0x4ffb('0x5')][_0x13e025[_0x4ffb('0x3b')]]){this['channels'][_0x13e025[_0x4ffb('0x2c')]]={'queue':_0x13e025[_0x4ffb('0x18')],'interface':_0x13e025[_0x4ffb('0x3b')],'destlinkedid':_0x13e025[_0x4ffb('0x24')]};}}}catch(_0x1ed700){logger['error']('[ACW][syncAgentConnect]\x20%s',_0x1ed700[_0x4ffb('0x35')]);}};Acw[_0x4ffb('0x16')][_0x4ffb('0x13')]=function(_0x61a9f3){try{if(this[_0x4ffb('0x4')][_0x61a9f3[_0x4ffb('0x18')]]&&(this[_0x4ffb('0x4')][_0x61a9f3[_0x4ffb('0x18')]]['acw']||this[_0x4ffb('0x4')][_0x61a9f3[_0x4ffb('0x18')]]['mandatoryDisposition'])){if(this[_0x4ffb('0x5')][_0x61a9f3[_0x4ffb('0x3b')]]){this[_0x4ffb('0x7')][_0x61a9f3['uniqueid']]={'queue':_0x61a9f3[_0x4ffb('0x18')],'interface':_0x61a9f3[_0x4ffb('0x3b')]};}}}catch(_0x45ebe0){logger['error'](_0x4ffb('0x3c'),_0x45ebe0[_0x4ffb('0x35')]);}};Acw[_0x4ffb('0x16')][_0x4ffb('0x3d')]=function(_0xbbf4f){try{if(this[_0x4ffb('0x7')][_0xbbf4f[_0x4ffb('0x2c')]]&&_[_0x4ffb('0x3e')](this['channels'][_0xbbf4f['uniqueid']][_0x4ffb('0x23')])){logger[_0x4ffb('0x21')]('[%s][HANGUP:UNIQUEID]',_0xbbf4f[_0x4ffb('0x2c')]);this['startAcw'](_0xbbf4f['uniqueid']);}else if(this[_0x4ffb('0x7')][_0xbbf4f[_0x4ffb('0x3f')]]&&_[_0x4ffb('0x3e')](this['channels'][_0xbbf4f['linkedid']][_0x4ffb('0x23')])){logger[_0x4ffb('0x21')](_0x4ffb('0x40'),_0xbbf4f[_0x4ffb('0x3f')]);this[_0x4ffb('0x17')](_0xbbf4f[_0x4ffb('0x3f')]);}}catch(_0x3a55f3){logger[_0x4ffb('0x30')](_0x4ffb('0x41'),_0x3a55f3[_0x4ffb('0x35')]);}};Acw[_0x4ffb('0x16')]['syncHangup']=function(_0x13a1b7){try{if(this[_0x4ffb('0x7')][_0x13a1b7[_0x4ffb('0x2c')]]&&this[_0x4ffb('0x7')][_0x13a1b7['uniqueid']][_0x4ffb('0x23')]){logger[_0x4ffb('0x21')](_0x4ffb('0x42'),_0x13a1b7[_0x4ffb('0x2c')]);this['startAcw'](_0x13a1b7[_0x4ffb('0x2c')]);}else if(this[_0x4ffb('0x7')][_0x13a1b7['linkedid']]&&this[_0x4ffb('0x7')][_0x13a1b7[_0x4ffb('0x3f')]]['attended']){logger[_0x4ffb('0x21')](_0x4ffb('0x43'),_0x13a1b7[_0x4ffb('0x3f')]);this['startAcw'](_0x13a1b7[_0x4ffb('0x3f')]);}}catch(_0x404581){logger['error']('[ACW][syncHangup]\x20%s',_0x404581[_0x4ffb('0x35')]);}};Acw['prototype'][_0x4ffb('0x10')]=function(_0x5112cd){try{if(!_[_0x4ffb('0x44')](this[_0x4ffb('0x7')][_0x5112cd[_0x4ffb('0x45')]])){this['startAcw'](_0x5112cd['transfereeuniqueid']);if(this[_0x4ffb('0x7')][_0x5112cd['secondtransfereruniqueid']]){this['channels'][_0x5112cd[_0x4ffb('0x46')]][_0x4ffb('0x23')]=!![];this['channels'][_0x5112cd['transfertargetuniqueid']]=this[_0x4ffb('0x7')][_0x5112cd[_0x4ffb('0x46')]];delete this['channels'][_0x5112cd[_0x4ffb('0x46')]];}}else if(!_['isNil'](this['channels'][_0x5112cd['transfertargetuniqueid']])){this[_0x4ffb('0x17')](_0x5112cd['transfertargetuniqueid']);if(this['channels'][_0x5112cd['origtransfereruniqueid']]){this[_0x4ffb('0x7')][_0x5112cd['origtransfereruniqueid']]['attended']=!![];this[_0x4ffb('0x7')][_0x5112cd[_0x4ffb('0x45')]]=this[_0x4ffb('0x7')][_0x5112cd[_0x4ffb('0x47')]];delete this[_0x4ffb('0x7')][_0x5112cd[_0x4ffb('0x47')]];}}}catch(_0x5156c4){logger[_0x4ffb('0x30')](_0x4ffb('0x48'),_0x5156c4[_0x4ffb('0x35')]);}};Acw['prototype'][_0x4ffb('0x49')]=function(_0x3e83dd){try{if(this[_0x4ffb('0x7')][_0x3e83dd['transfereruniqueid']]){logger[_0x4ffb('0x21')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0x4ffb('0x39')](_0x3e83dd[_0x4ffb('0x4a')]));this['startAcw'](_0x3e83dd[_0x4ffb('0x4a')]);}else if(this[_0x4ffb('0x7')][_0x3e83dd[_0x4ffb('0x4b')]]){logger[_0x4ffb('0x21')](_0x4ffb('0x4c'),JSON['stringify'](_0x3e83dd[_0x4ffb('0x4b')]));this[_0x4ffb('0x17')](_0x3e83dd[_0x4ffb('0x4b')]);}}catch(_0x222173){logger[_0x4ffb('0x30')](_0x4ffb('0x4d'),_0x222173[_0x4ffb('0x35')]);}};Acw['prototype']['syncAgentRingNoAnswer']=function(_0x153546){try{if(this[_0x4ffb('0x4')][_0x153546[_0x4ffb('0x18')]]&&this['voiceQueues'][_0x153546[_0x4ffb('0x18')]][_0x4ffb('0x4e')]==='all'){if(this[_0x4ffb('0x5')][_0x153546['interface']]){logger[_0x4ffb('0x21')](_0x4ffb('0x4f'),_0x153546[_0x4ffb('0x2c')],_0x153546['interface'],_0x153546[_0x4ffb('0x18')]);return RpcUser['savePause'](this[_0x4ffb('0x5')][_0x153546[_0x4ffb('0x3b')]],'Auto-Pause',_0x153546[_0x4ffb('0x2c')]);}}}catch(_0x471c3a){logger[_0x4ffb('0x30')](_0x4ffb('0x50'),_0x471c3a['message']);}};module[_0x4ffb('0x51')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index b2537fa..436d188 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 _0x9dae=['port','username','keepConnected','Action','promisify','action','error','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','format','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','resolve','then','actionSipPeerStatus','catch','log','exports','bluebird','moment','lodash','../../config/logger','ami','../../config/environment','asterisk'];(function(_0x12d033,_0x25fa2f){var _0x3b4e80=function(_0x46c1f4){while(--_0x46c1f4){_0x12d033['push'](_0x12d033['shift']());}};_0x3b4e80(++_0x25fa2f);}(_0x9dae,0x17f));var _0xe9da=function(_0x22efdd,_0x2f2630){_0x22efdd=_0x22efdd-0x0;var _0x156298=_0x9dae[_0x22efdd];return _0x156298;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0xe9da('0x0'));var moment=require(_0xe9da('0x1'));var util=require('util');var _=require(_0xe9da('0x2'));var logger=require(_0xe9da('0x3'))(_0xe9da('0x4'));var config=require(_0xe9da('0x5'));var ami=new Manager(config[_0xe9da('0x6')][_0xe9da('0x7')],config[_0xe9da('0x6')]['ip'],config[_0xe9da('0x6')][_0xe9da('0x8')],config[_0xe9da('0x6')]['password'],!![]);ami[_0xe9da('0x9')]();ami[_0xe9da('0xa')]=BPromise[_0xe9da('0xb')](ami[_0xe9da('0xc')]);function error(_0x133fb3){logger[_0xe9da('0xd')](util['format']('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config['asterisk']['username'],config['asterisk']['ip'],config[_0xe9da('0x6')][_0xe9da('0x7')],util[_0xe9da('0xe')](_0x133fb3,![],null)));}function close(){logger[_0xe9da('0xd')](util['format'](_0xe9da('0xf'),config[_0xe9da('0x6')][_0xe9da('0x8')],config['asterisk']['ip'],config[_0xe9da('0x6')]['port']));}ami[_0xe9da('0x10')]=function(){return function(){return ami[_0xe9da('0xa')]({'action':_0xe9da('0x11')});};};ami[_0xe9da('0x12')]=function(){return function(){return ami[_0xe9da('0xa')]({'action':_0xe9da('0x13')});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0xe9da('0xa')]({'action':_0xe9da('0x14')});};};ami[_0xe9da('0x15')]=function(){return function(){return ami['Action']({'action':_0xe9da('0x16')});};};ami[_0xe9da('0x17')]=function(){return function(){return ami['Action']({'action':_0xe9da('0x18')});};};function connect(_0x1fb596){logger[_0xe9da('0x19')](util[_0xe9da('0x1a')](_0xe9da('0x1b'),config[_0xe9da('0x6')][_0xe9da('0x8')],config[_0xe9da('0x6')]['ip'],config[_0xe9da('0x6')][_0xe9da('0x7')]));ami['once'](_0xe9da('0xd'),error);ami[_0xe9da('0x1c')](_0xe9da('0x1d'),close);}ami['on'](_0xe9da('0x1e'),connect);ami['on'](_0xe9da('0x1f'),function(_0x50ba2b){logger[_0xe9da('0x19')](util['format'](_0xe9da('0x20'),config[_0xe9da('0x6')]['username'],config[_0xe9da('0x6')]['ip'],config[_0xe9da('0x6')][_0xe9da('0x7')],util[_0xe9da('0xe')](_0x50ba2b,![],null)));});ami['on']('fullybooted',function(_0xf0dba8){logger[_0xe9da('0x19')](util[_0xe9da('0x1a')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0xe9da('0x6')][_0xe9da('0x8')],config['asterisk']['ip'],config[_0xe9da('0x6')][_0xe9da('0x7')]));return BPromise[_0xe9da('0x21')]()[_0xe9da('0x22')](ami[_0xe9da('0x10')]())[_0xe9da('0x22')](ami['actionDeviceStateList']())[_0xe9da('0x22')](ami[_0xe9da('0x23')]())[_0xe9da('0x22')](ami[_0xe9da('0x15')]())[_0xe9da('0x22')](ami[_0xe9da('0x17')]())[_0xe9da('0x24')](function(_0x1f9f86){console[_0xe9da('0x25')](_0x1f9f86);});});ami['once'](_0xe9da('0xd'),error);ami['once'](_0xe9da('0x1d'),close);module[_0xe9da('0x26')]=ami; \ No newline at end of file +var _0x193e=['resolve','then','catch','log','asterisk-manager','lodash','ami','../../config/environment','asterisk','port','username','password','keepConnected','action','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','actionSipShowRegistry','Action','actionDeviceStateList','devicestatelist','actionSipPeerStatus','actionQueueSummary','actionCoreShowChannels','coreshowchannels','info','once','error','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','inspect','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s'];(function(_0x3012b4,_0x221630){var _0x1a5352=function(_0x1595a5){while(--_0x1595a5){_0x3012b4['push'](_0x3012b4['shift']());}};_0x1a5352(++_0x221630);}(_0x193e,0x10c));var _0xe193=function(_0x3bd066,_0x198e7e){_0x3bd066=_0x3bd066-0x0;var _0xae7d96=_0x193e[_0x3bd066];return _0xae7d96;};'use strict';var Manager=require(_0xe193('0x0'));var BPromise=require('bluebird');var moment=require('moment');var util=require('util');var _=require(_0xe193('0x1'));var logger=require('../../config/logger')(_0xe193('0x2'));var config=require(_0xe193('0x3'));var ami=new Manager(config[_0xe193('0x4')][_0xe193('0x5')],config[_0xe193('0x4')]['ip'],config['asterisk'][_0xe193('0x6')],config[_0xe193('0x4')][_0xe193('0x7')],!![]);ami[_0xe193('0x8')]();ami['Action']=BPromise['promisify'](ami[_0xe193('0x9')]);function error(_0xcf5808){logger['error'](util[_0xe193('0xa')](_0xe193('0xb'),config[_0xe193('0x4')][_0xe193('0x6')],config[_0xe193('0x4')]['ip'],config[_0xe193('0x4')][_0xe193('0x5')],util['inspect'](_0xcf5808,![],null)));}function close(){logger['error'](util[_0xe193('0xa')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0xe193('0x4')][_0xe193('0x6')],config['asterisk']['ip'],config[_0xe193('0x4')][_0xe193('0x5')]));}ami[_0xe193('0xc')]=function(){return function(){return ami[_0xe193('0xd')]({'action':'sipshowregistry'});};};ami[_0xe193('0xe')]=function(){return function(){return ami['Action']({'action':_0xe193('0xf')});};};ami[_0xe193('0x10')]=function(){return function(){return ami[_0xe193('0xd')]({'action':'sippeerstatus'});};};ami[_0xe193('0x11')]=function(){return function(){return ami['Action']({'action':'queuesummary'});};};ami[_0xe193('0x12')]=function(){return function(){return ami['Action']({'action':_0xe193('0x13')});};};function connect(_0x2cb20b){logger[_0xe193('0x14')](util['format']('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0xe193('0x4')][_0xe193('0x6')],config[_0xe193('0x4')]['ip'],config[_0xe193('0x4')][_0xe193('0x5')]));ami[_0xe193('0x15')](_0xe193('0x16'),error);ami[_0xe193('0x15')]('close',close);}ami['on'](_0xe193('0x17'),connect);ami['on'](_0xe193('0x18'),function(_0x188e47){logger['info'](util[_0xe193('0xa')](_0xe193('0x19'),config[_0xe193('0x4')]['username'],config['asterisk']['ip'],config[_0xe193('0x4')][_0xe193('0x5')],util[_0xe193('0x1a')](_0x188e47,![],null)));});ami['on'](_0xe193('0x1b'),function(_0x4572a1){logger[_0xe193('0x14')](util['format'](_0xe193('0x1c'),config['asterisk']['username'],config[_0xe193('0x4')]['ip'],config['asterisk'][_0xe193('0x5')]));return BPromise[_0xe193('0x1d')]()[_0xe193('0x1e')](ami[_0xe193('0xc')]())[_0xe193('0x1e')](ami[_0xe193('0xe')]())[_0xe193('0x1e')](ami[_0xe193('0x10')]())['then'](ami[_0xe193('0x11')]())[_0xe193('0x1e')](ami['actionCoreShowChannels']())[_0xe193('0x1f')](function(_0x54e351){console[_0xe193('0x20')](_0x54e351);});});ami[_0xe193('0x15')](_0xe193('0x16'),error);ami[_0xe193('0x15')]('close',close);module['exports']=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 22c56de..0329504 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 _0x9c44=['ami','client','http','Request','then','debug','rpc','memberReport','error','message','result','exports','../../config/logger'];(function(_0x4f8c39,_0x144ede){var _0x4d3641=function(_0x222a1d){while(--_0x222a1d){_0x4f8c39['push'](_0x4f8c39['shift']());}};_0x4d3641(++_0x144ede);}(_0x9c44,0x178));var _0x49c4=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x9c44[_0x2e4aa2];return _0x5e6092;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x49c4('0x0'))(_0x49c4('0x1'));var client=jayson[_0x49c4('0x2')][_0x49c4('0x3')]({'port':0x2329});client[_0x49c4('0x4')]=function(_0x2ad237,_0x4e0313){return new BPromise(function(_0x4941f1,_0x41a183){return client['request'](_0x2ad237,_0x4e0313)[_0x49c4('0x5')](function(_0x6030ae){logger[_0x49c4('0x6')](_0x49c4('0x7'),_0x49c4('0x8'),_0x2ad237,_0x4e0313,_0x6030ae);if(_0x6030ae['error']){logger[_0x49c4('0x9')](_0x49c4('0x7'),_0x49c4('0x8'),_0x2ad237,_0x6030ae[_0x49c4('0x9')]['message'],_0x4e0313);return _0x41a183(_0x6030ae['error'][_0x49c4('0xa')]);}else{return _0x4941f1(_0x6030ae[_0x49c4('0xb')]);}})['catch'](function(_0xb611a1){logger[_0x49c4('0x9')]('rpc','memberReport',_0x2ad237,_0xb611a1,_0x4e0313);return _0x41a183(_0xb611a1);});});};module[_0x49c4('0xc')]=client; \ No newline at end of file +var _0xcb91=['request','debug','memberReport','error','rpc','message','result','catch','exports','../../config/logger','ami','client','http'];(function(_0xea8947,_0x1b573d){var _0x2455e9=function(_0x18771e){while(--_0x18771e){_0xea8947['push'](_0xea8947['shift']());}};_0x2455e9(++_0x1b573d);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x599e60,_0x5b6519){_0x599e60=_0x599e60-0x0;var _0x468e19=_0xcb91[_0x599e60];return _0x468e19;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var client=jayson[_0x1cb9('0x2')][_0x1cb9('0x3')]({'port':0x2329});client['Request']=function(_0x8c392f,_0x2c17b8){return new BPromise(function(_0x545a34,_0x13d5fd){return client[_0x1cb9('0x4')](_0x8c392f,_0x2c17b8)['then'](function(_0x226b69){logger[_0x1cb9('0x5')]('rpc',_0x1cb9('0x6'),_0x8c392f,_0x2c17b8,_0x226b69);if(_0x226b69[_0x1cb9('0x7')]){logger['error'](_0x1cb9('0x8'),'memberReport',_0x8c392f,_0x226b69['error'][_0x1cb9('0x9')],_0x2c17b8);return _0x13d5fd(_0x226b69[_0x1cb9('0x7')][_0x1cb9('0x9')]);}else{return _0x545a34(_0x226b69[_0x1cb9('0xa')]);}})[_0x1cb9('0xb')](function(_0x50ce71){logger[_0x1cb9('0x7')](_0x1cb9('0x8'),_0x1cb9('0x6'),_0x8c392f,_0x50ce71,_0x2c17b8);return _0x13d5fd(_0x50ce71);});});};module[_0x1cb9('0xc')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 57492f1..485bad1 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 _0xc6ac=['countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','callback','callbackat','recallme','originatecalleridnum','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','number','exports','util','lodash','moment','string','isNil','voiceQueue','uniqueid','Contact','firstName','phone','queue','name','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry'];(function(_0x237546,_0xa81b26){var _0x233e29=function(_0x728aa4){while(--_0x728aa4){_0x237546['push'](_0x237546['shift']());}};_0x233e29(++_0xa81b26);}(_0xc6ac,0x171));var _0xcc6a=function(_0x962168,_0x56bae4){_0x962168=_0x962168-0x0;var _0x517ed9=_0xc6ac[_0x962168];return _0x517ed9;};'use strict';var util=require(_0xcc6a('0x0'));var _=require(_0xcc6a('0x1'));var moment=require(_0xcc6a('0x2'));function checkNameSurname(_0x30c958,_0x2d167d,_0x265ffd){var _0x44aa2a='';if(!_['isNil'](_0x2d167d)&&_0xcc6a('0x3')===typeof _0x2d167d){_0x44aa2a+=_0x2d167d;}if(!_[_0xcc6a('0x4')](_0x265ffd)&&_0xcc6a('0x3')===typeof _0x265ffd){_0x44aa2a+='\x20'+_0x265ffd;}if(_0x44aa2a!==''){return _0x44aa2a;}return _0x30c958;}function Action(_0x2c53d2,_0x19b95b,_0x43fdf6){this[_0xcc6a('0x5')]=_0x2c53d2;this[_0xcc6a('0x6')]=_0x43fdf6||undefined;this['name']=checkNameSurname(_0x19b95b['Contact']['phone'],_0x19b95b[_0xcc6a('0x7')][_0xcc6a('0x8')],_0x19b95b['Contact']['lastName']);this['number']=_0x19b95b[_0xcc6a('0x9')];this[_0xcc6a('0xa')]=_0x2c53d2[_0xcc6a('0xb')];this[_0xcc6a('0xc')]=_0x19b95b[_0xcc6a('0xc')]||![];this[_0xcc6a('0xd')]=_0x2c53d2[_0xcc6a('0xd')];this[_0xcc6a('0xe')]=_0x2c53d2['dialQueueTimeout']||0x3;this[_0xcc6a('0xf')]=_0x19b95b[_0xcc6a('0xf')];this[_0xcc6a('0x10')]=_0x19b95b[_0xcc6a('0x10')];this[_0xcc6a('0x11')]=_0x19b95b[_0xcc6a('0x11')];this['countnoanswerretry']=_0x19b95b[_0xcc6a('0x12')];this[_0xcc6a('0x13')]=_0x19b95b[_0xcc6a('0x13')];this[_0xcc6a('0x14')]=_0x19b95b[_0xcc6a('0x14')];this[_0xcc6a('0x15')]=_0x19b95b[_0xcc6a('0x15')];this[_0xcc6a('0x16')]=_0x19b95b[_0xcc6a('0x16')];this[_0xcc6a('0x17')]=_0x19b95b[_0xcc6a('0x17')];this['ContactId']=_0x19b95b[_0xcc6a('0x18')];this['ListId']=_0x19b95b[_0xcc6a('0x19')];this[_0xcc6a('0x1a')]=_0x19b95b[_0xcc6a('0x1a')];this[_0xcc6a('0x1b')]=_0x19b95b[_0xcc6a('0x1b')];this[_0xcc6a('0x1c')]=_0x19b95b['CampaignId'];this[_0xcc6a('0x1d')]=_0x19b95b['id'];this[_0xcc6a('0x1e')]=_0x19b95b[_0xcc6a('0x7')][_0xcc6a('0x8')]||'';this[_0xcc6a('0x1f')]=moment()[_0xcc6a('0x20')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xcc6a('0x21')]=_0x19b95b['callback'];this['callbackuniqueid']=_0x19b95b['callbackuniqueid'];this[_0xcc6a('0x22')]=_0x19b95b[_0xcc6a('0x22')];this['recallme']=_0x19b95b[_0xcc6a('0x23')];this[_0xcc6a('0x24')]='';this['originatecalleridname']='';}Action[_0xcc6a('0x25')][_0xcc6a('0x26')]=function(){return util[_0xcc6a('0x20')](_0xcc6a('0x27'),this['name'],this[_0xcc6a('0x5')][_0xcc6a('0x28')]>0x0?this[_0xcc6a('0x29')]['substring'](this['voiceQueue'][_0xcc6a('0x28')]):this[_0xcc6a('0x29')]);};Action['prototype']['getQueue']=function(){return this['queue'];};module[_0xcc6a('0x2a')]=Action; \ No newline at end of file +var _0xc551=['ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridname','prototype','format','\x22%s\x22\x20<%s>','voiceQueue','getQueue','exports','util','lodash','moment','isNil','string','uniqueid','Contact','firstName','phone','queue','name','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry'];(function(_0x3d81bf,_0x2b8733){var _0x5645c7=function(_0x4cd189){while(--_0x4cd189){_0x3d81bf['push'](_0x3d81bf['shift']());}};_0x5645c7(++_0x2b8733);}(_0xc551,0x1e1));var _0x1c55=function(_0xe83fe5,_0x5f4108){_0xe83fe5=_0xe83fe5-0x0;var _0x1e7777=_0xc551[_0xe83fe5];return _0x1e7777;};'use strict';var util=require(_0x1c55('0x0'));var _=require(_0x1c55('0x1'));var moment=require(_0x1c55('0x2'));function checkNameSurname(_0x4e1418,_0x2a482a,_0xa1857f){var _0x47bf2f='';if(!_[_0x1c55('0x3')](_0x2a482a)&&_0x1c55('0x4')===typeof _0x2a482a){_0x47bf2f+=_0x2a482a;}if(!_[_0x1c55('0x3')](_0xa1857f)&&_0x1c55('0x4')===typeof _0xa1857f){_0x47bf2f+='\x20'+_0xa1857f;}if(_0x47bf2f!==''){return _0x47bf2f;}return _0x4e1418;}function Action(_0x52303b,_0x114b25,_0x34fda6){this['voiceQueue']=_0x52303b;this[_0x1c55('0x5')]=_0x34fda6||undefined;this['name']=checkNameSurname(_0x114b25[_0x1c55('0x6')]['phone'],_0x114b25['Contact'][_0x1c55('0x7')],_0x114b25[_0x1c55('0x6')]['lastName']);this['number']=_0x114b25[_0x1c55('0x8')];this[_0x1c55('0x9')]=_0x52303b[_0x1c55('0xa')];this[_0x1c55('0xb')]=_0x114b25[_0x1c55('0xb')]||![];this['type']=_0x52303b[_0x1c55('0xc')];this[_0x1c55('0xd')]=_0x52303b['dialQueueTimeout']||0x3;this[_0x1c55('0xe')]=_0x114b25[_0x1c55('0xe')];this[_0x1c55('0xf')]=_0x114b25['countbusyretry'];this['countcongestionretry']=_0x114b25[_0x1c55('0x10')];this['countnoanswerretry']=_0x114b25[_0x1c55('0x11')];this[_0x1c55('0x12')]=_0x114b25['countnosuchnumberretry'];this[_0x1c55('0x13')]=_0x114b25[_0x1c55('0x13')];this[_0x1c55('0x14')]=_0x114b25['countabandonedretry'];this[_0x1c55('0x15')]=_0x114b25[_0x1c55('0x15')];this[_0x1c55('0x16')]=_0x114b25[_0x1c55('0x16')];this['ContactId']=_0x114b25['ContactId'];this[_0x1c55('0x17')]=_0x114b25[_0x1c55('0x17')];this[_0x1c55('0x18')]=_0x114b25[_0x1c55('0x18')];this[_0x1c55('0x19')]=_0x114b25[_0x1c55('0x19')];this[_0x1c55('0x1a')]=_0x114b25[_0x1c55('0x1a')];this[_0x1c55('0x1b')]=_0x114b25['id'];this[_0x1c55('0x1c')]=_0x114b25['Contact'][_0x1c55('0x7')]||'';this[_0x1c55('0x1d')]=moment()['format'](_0x1c55('0x1e'));this[_0x1c55('0x1f')]=_0x114b25[_0x1c55('0x1f')];this[_0x1c55('0x20')]=_0x114b25['callbackuniqueid'];this[_0x1c55('0x21')]=_0x114b25[_0x1c55('0x21')];this[_0x1c55('0x22')]=_0x114b25[_0x1c55('0x22')];this['originatecalleridnum']='';this[_0x1c55('0x23')]='';}Action[_0x1c55('0x24')]['getCaller']=function(){return util[_0x1c55('0x25')](_0x1c55('0x26'),this['name'],this['voiceQueue']['dialCutDigit']>0x0?this['number']['substring'](this[_0x1c55('0x27')]['dialCutDigit']):this['number']);};Action[_0x1c55('0x24')][_0x1c55('0x28')]=function(){return this[_0x1c55('0x9')];};module[_0x1c55('0x29')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/additionalPhone.js b/server/services/ami/dialer/additionalPhone.js index 9d676d9..12b6f87 100644 --- a/server/services/ami/dialer/additionalPhone.js +++ b/server/services/ami/dialer/additionalPhone.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe642=['countmachineretry','countagentrejectretry','calleridname','name','calleridnum','number','starttime','responsetime','endtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry'];(function(_0x1700b3,_0x4c2e23){var _0x4f4539=function(_0x58327f){while(--_0x58327f){_0x1700b3['push'](_0x1700b3['shift']());}};_0x4f4539(++_0x4c2e23);}(_0xe642,0xb1));var _0x2e64=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe642[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x2e64('0x0'));var _=require(_0x2e64('0x1'));var moment=require(_0x2e64('0x2'));function getSeconds(_0x167dbd,_0xd4c49f){var _0x3e614d=moment(_0x167dbd)[_0x2e64('0x3')](0x0);var _0x71207=moment(_0xd4c49f)[_0x2e64('0x3')](0x0);return _0x3e614d[_0x2e64('0x4')](_0x71207,_0x2e64('0x5'));}function AdditionalPhone(_0x411251){this[_0x2e64('0x6')]=_0x411251[_0x2e64('0x6')];this[_0x2e64('0x7')]=_0x411251[_0x2e64('0x7')]||undefined;this[_0x2e64('0x8')]=_0x411251[_0x2e64('0x8')];this[_0x2e64('0x9')]=_0x411251[_0x2e64('0x8')]==='outbound'?_0x2e64('0xa'):_0x411251['type'];this[_0x2e64('0xb')]=_0x411251[_0x2e64('0xb')];this[_0x2e64('0xc')]=_0x411251[_0x2e64('0xc')];this[_0x2e64('0xd')]=_0x411251[_0x2e64('0xd')];this[_0x2e64('0xe')]=_0x411251[_0x2e64('0xb')]+_0x411251['countcongestionretry']+_0x411251[_0x2e64('0xd')]+_0x411251[_0x2e64('0xf')]+_0x411251[_0x2e64('0x10')]+_0x411251[_0x2e64('0x11')]+_0x411251[_0x2e64('0x12')]+_0x411251[_0x2e64('0x13')];this[_0x2e64('0xf')]=_0x411251[_0x2e64('0xf')];this['countdropretry']=_0x411251[_0x2e64('0x10')];this['countabandonedretry']=_0x411251[_0x2e64('0x11')];this[_0x2e64('0x12')]=_0x411251['countmachineretry'];this[_0x2e64('0x13')]=_0x411251[_0x2e64('0x13')];this[_0x2e64('0xa')]=_0x411251[_0x2e64('0xa')];this[_0x2e64('0x14')]=_0x411251[_0x2e64('0x15')];this[_0x2e64('0x16')]=_0x411251[_0x2e64('0x17')];this['starttime']=_0x411251[_0x2e64('0x18')];this[_0x2e64('0x19')]=_0x411251['responsetime'];this[_0x2e64('0x1a')]=_0x411251['responsetime'];this['ringtime']=getSeconds(_0x411251[_0x2e64('0x19')],_0x411251['starttime']);this[_0x2e64('0x1b')]=0x0;this[_0x2e64('0x1c')]=0x0;this[_0x2e64('0x1d')]=_0x411251[_0x2e64('0x1d')];this[_0x2e64('0x1e')]=_0x411251[_0x2e64('0x1e')];this[_0x2e64('0x1f')]=_0x411251[_0x2e64('0x1f')];this[_0x2e64('0x20')]=_0x411251[_0x2e64('0x20')];this['ContactId']=_0x411251[_0x2e64('0x21')];this['ListId']=_0x411251['ListId'];this[_0x2e64('0x22')]=_0x411251[_0x2e64('0x22')];this[_0x2e64('0x23')]=_0x411251[_0x2e64('0x23')];this['CampaignId']=_0x411251['CampaignId'];this[_0x2e64('0x24')]=_0x411251[_0x2e64('0x24')]||'';this['originatecalleridname']=_0x411251[_0x2e64('0x25')]||'';}module[_0x2e64('0x26')]=History; \ No newline at end of file +var _0xda54=['ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','seconds','uniqueid','scheduledat','type','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','calleridname','name','calleridnum','number','starttime','responsetime','endtime'];(function(_0x426d73,_0x2e7f8a){var _0x3e814f=function(_0x4aac1b){while(--_0x4aac1b){_0x426d73['push'](_0x426d73['shift']());}};_0x3e814f(++_0x2e7f8a);}(_0xda54,0xf3));var _0x4da5=function(_0x2d3d0d,_0x67ac82){_0x2d3d0d=_0x2d3d0d-0x0;var _0xca35b6=_0xda54[_0x2d3d0d];return _0xca35b6;};'use strict';var util=require(_0x4da5('0x0'));var _=require(_0x4da5('0x1'));var moment=require('moment');function getSeconds(_0x29868f,_0x32b90e){var _0x44431b=moment(_0x29868f)[_0x4da5('0x2')](0x0);var _0xdfb386=moment(_0x32b90e)[_0x4da5('0x2')](0x0);return _0x44431b[_0x4da5('0x3')](_0xdfb386,_0x4da5('0x4'));}function AdditionalPhone(_0x5d260f){this['uniqueid']=_0x5d260f[_0x4da5('0x5')];this[_0x4da5('0x6')]=_0x5d260f[_0x4da5('0x6')]||undefined;this['type']=_0x5d260f[_0x4da5('0x7')];this['campaigntype']=_0x5d260f[_0x4da5('0x7')]==='outbound'?_0x4da5('0x8'):_0x5d260f[_0x4da5('0x7')];this['countbusyretry']=_0x5d260f[_0x4da5('0x9')];this[_0x4da5('0xa')]=_0x5d260f[_0x4da5('0xa')];this['countnoanswerretry']=_0x5d260f[_0x4da5('0xb')];this['countglobal']=_0x5d260f[_0x4da5('0x9')]+_0x5d260f[_0x4da5('0xa')]+_0x5d260f[_0x4da5('0xb')]+_0x5d260f[_0x4da5('0xc')]+_0x5d260f[_0x4da5('0xd')]+_0x5d260f[_0x4da5('0xe')]+_0x5d260f['countmachineretry']+_0x5d260f[_0x4da5('0xf')];this[_0x4da5('0xc')]=_0x5d260f['countnosuchnumberretry'];this[_0x4da5('0xd')]=_0x5d260f['countdropretry'];this['countabandonedretry']=_0x5d260f[_0x4da5('0xe')];this['countmachineretry']=_0x5d260f['countmachineretry'];this[_0x4da5('0xf')]=_0x5d260f['countagentrejectretry'];this[_0x4da5('0x8')]=_0x5d260f[_0x4da5('0x8')];this[_0x4da5('0x10')]=_0x5d260f[_0x4da5('0x11')];this[_0x4da5('0x12')]=_0x5d260f[_0x4da5('0x13')];this[_0x4da5('0x14')]=_0x5d260f[_0x4da5('0x14')];this[_0x4da5('0x15')]=_0x5d260f['responsetime'];this[_0x4da5('0x16')]=_0x5d260f[_0x4da5('0x15')];this[_0x4da5('0x17')]=getSeconds(_0x5d260f[_0x4da5('0x15')],_0x5d260f[_0x4da5('0x14')]);this[_0x4da5('0x18')]=0x0;this[_0x4da5('0x19')]=0x0;this[_0x4da5('0x1a')]=_0x5d260f[_0x4da5('0x1a')];this[_0x4da5('0x1b')]=_0x5d260f[_0x4da5('0x1b')];this[_0x4da5('0x1c')]=_0x5d260f[_0x4da5('0x1c')];this['recallme']=_0x5d260f[_0x4da5('0x1d')];this['ContactId']=_0x5d260f[_0x4da5('0x1e')];this[_0x4da5('0x1f')]=_0x5d260f[_0x4da5('0x1f')];this['UserId']=_0x5d260f[_0x4da5('0x20')];this[_0x4da5('0x21')]=_0x5d260f[_0x4da5('0x21')];this[_0x4da5('0x22')]=_0x5d260f['CampaignId'];this[_0x4da5('0x23')]=_0x5d260f[_0x4da5('0x23')]||'';this[_0x4da5('0x24')]=_0x5d260f['originatecalleridname']||'';}module[_0x4da5('0x25')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index 9d23076..ecdafac 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 _0x69d2=['format','ringtime','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','exports','util','lodash','milliseconds','diff','state','statedesc','Answer','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','answertime','endtime'];(function(_0x2ff24b,_0x2cf969){var _0x5c8b2e=function(_0x424272){while(--_0x424272){_0x2ff24b['push'](_0x2ff24b['shift']());}};_0x5c8b2e(++_0x2cf969);}(_0x69d2,0x1a6));var _0x269d=function(_0x5ca5e3,_0x35af78){_0x5ca5e3=_0x5ca5e3-0x0;var _0x2f5834=_0x69d2[_0x5ca5e3];return _0x2f5834;};'use strict';var util=require(_0x269d('0x0'));var _=require(_0x269d('0x1'));var moment=require('moment');function getSeconds(_0x28feac,_0x1c3448){var _0x54e3df=moment(_0x28feac)[_0x269d('0x2')](0x0);var _0x2d7db9=moment(_0x1c3448)[_0x269d('0x2')](0x0);return _0x54e3df[_0x269d('0x3')](_0x2d7db9,'seconds');}function AgentComplete(_0x2c773b,_0x2ade3d){this[_0x269d('0x4')]=0x4;this[_0x269d('0x5')]=_0x269d('0x6');this[_0x269d('0x7')]=_0x2c773b[_0x269d('0x7')];this[_0x269d('0x8')]=_0x2c773b[_0x269d('0x8')];this['campaigntype']=_0x2c773b[_0x269d('0x8')]===_0x269d('0x9')?_0x269d('0xa'):_0x2c773b[_0x269d('0x8')];this[_0x269d('0xb')]=_0x2c773b[_0x269d('0xb')];this[_0x269d('0xc')]=_0x2c773b['countcongestionretry'];this[_0x269d('0xd')]=_0x2c773b[_0x269d('0xd')];this[_0x269d('0xe')]=_0x2c773b[_0x269d('0xb')]+_0x2c773b[_0x269d('0xc')]+_0x2c773b[_0x269d('0xd')]+_0x2c773b['countnosuchnumberretry']+_0x2c773b[_0x269d('0xf')]+_0x2c773b[_0x269d('0x10')]+_0x2c773b[_0x269d('0x11')]+_0x2c773b[_0x269d('0x12')];this[_0x269d('0x13')]=_0x2c773b[_0x269d('0x13')];this[_0x269d('0xf')]=_0x2c773b[_0x269d('0xf')];this[_0x269d('0x10')]=_0x2c773b[_0x269d('0x10')];this[_0x269d('0x11')]=_0x2c773b[_0x269d('0x11')];this[_0x269d('0x12')]=_0x2c773b[_0x269d('0x12')];this['uniqueid']=_0x2ade3d[_0x269d('0x14')];this[_0x269d('0x15')]=_0x2c773b[_0x269d('0x16')];this[_0x269d('0x17')]=_0x2c773b['number'];this[_0x269d('0x18')]=_0x2c773b[_0x269d('0x18')];this[_0x269d('0x19')]=_0x2c773b[_0x269d('0x19')];this[_0x269d('0x1a')]=_0x2c773b[_0x269d('0x1a')];this[_0x269d('0x1b')]=moment()[_0x269d('0x1c')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x269d('0x1d')]=getSeconds(_0x2c773b['responsetime'],_0x2c773b[_0x269d('0x18')]);this[_0x269d('0x1e')]=getSeconds(_0x2c773b[_0x269d('0x1a')],_0x2c773b[_0x269d('0x19')]);this[_0x269d('0x1f')]=getSeconds(this[_0x269d('0x1b')],_0x2c773b['answertime']);this[_0x269d('0xa')]=_0x2ade3d[_0x269d('0xa')];this[_0x269d('0x20')]=_0x2ade3d[_0x269d('0x20')];this[_0x269d('0x21')]=_0x2ade3d[_0x269d('0x21')];this[_0x269d('0x22')]=_0x2c773b[_0x269d('0x22')];this[_0x269d('0x23')]=_0x2c773b['callbackuniqueid'];this[_0x269d('0x24')]=_0x2c773b[_0x269d('0x24')];this[_0x269d('0x25')]=_0x2c773b[_0x269d('0x25')];this[_0x269d('0x26')]=_0x2c773b[_0x269d('0x26')];this[_0x269d('0x27')]=_0x2c773b[_0x269d('0x27')];this['UserId']=_0x2c773b[_0x269d('0x28')];this[_0x269d('0x29')]=_0x2c773b[_0x269d('0x29')];this[_0x269d('0x2a')]=_0x2c773b['CampaignId'];this[_0x269d('0x2b')]=_0x2c773b[_0x269d('0x2b')]||'';this['originatecalleridname']=_0x2c773b['originatecalleridname']||'';}module[_0x269d('0x2c')]=AgentComplete; \ No newline at end of file +var _0xada7=['countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','format','ringtime','talktime','membername','reason','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','seconds','state','statedesc','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x330414,_0x4f3207){var _0x99dbff=function(_0x166f85){while(--_0x166f85){_0x330414['push'](_0x330414['shift']());}};_0x99dbff(++_0x4f3207);}(_0xada7,0x186));var _0x7ada=function(_0x58ff08,_0x38c705){_0x58ff08=_0x58ff08-0x0;var _0x15eca6=_0xada7[_0x58ff08];return _0x15eca6;};'use strict';var util=require(_0x7ada('0x0'));var _=require(_0x7ada('0x1'));var moment=require('moment');function getSeconds(_0x237bfa,_0x3fe141){var _0x22ca77=moment(_0x237bfa)[_0x7ada('0x2')](0x0);var _0x3a2c64=moment(_0x3fe141)['milliseconds'](0x0);return _0x22ca77[_0x7ada('0x3')](_0x3a2c64,_0x7ada('0x4'));}function AgentComplete(_0x363839,_0x284e97){this[_0x7ada('0x5')]=0x4;this[_0x7ada('0x6')]='Answer';this[_0x7ada('0x7')]=_0x363839['scheduledat'];this['type']=_0x363839[_0x7ada('0x8')];this[_0x7ada('0x9')]=_0x363839['type']===_0x7ada('0xa')?_0x7ada('0xb'):_0x363839[_0x7ada('0x8')];this[_0x7ada('0xc')]=_0x363839[_0x7ada('0xc')];this['countcongestionretry']=_0x363839[_0x7ada('0xd')];this[_0x7ada('0xe')]=_0x363839[_0x7ada('0xe')];this[_0x7ada('0xf')]=_0x363839[_0x7ada('0xc')]+_0x363839[_0x7ada('0xd')]+_0x363839[_0x7ada('0xe')]+_0x363839[_0x7ada('0x10')]+_0x363839[_0x7ada('0x11')]+_0x363839[_0x7ada('0x12')]+_0x363839[_0x7ada('0x13')]+_0x363839[_0x7ada('0x14')];this[_0x7ada('0x10')]=_0x363839['countnosuchnumberretry'];this['countdropretry']=_0x363839[_0x7ada('0x11')];this[_0x7ada('0x12')]=_0x363839['countabandonedretry'];this[_0x7ada('0x13')]=_0x363839[_0x7ada('0x13')];this['countagentrejectretry']=_0x363839[_0x7ada('0x14')];this[_0x7ada('0x15')]=_0x284e97[_0x7ada('0x15')];this[_0x7ada('0x16')]=_0x363839[_0x7ada('0x17')];this[_0x7ada('0x18')]=_0x363839[_0x7ada('0x19')];this[_0x7ada('0x1a')]=_0x363839[_0x7ada('0x1a')];this[_0x7ada('0x1b')]=_0x363839[_0x7ada('0x1b')];this['answertime']=_0x363839[_0x7ada('0x1c')];this[_0x7ada('0x1d')]=moment()[_0x7ada('0x1e')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x7ada('0x1f')]=getSeconds(_0x363839[_0x7ada('0x1b')],_0x363839[_0x7ada('0x1a')]);this['holdtime']=getSeconds(_0x363839[_0x7ada('0x1c')],_0x363839[_0x7ada('0x1b')]);this[_0x7ada('0x20')]=getSeconds(this[_0x7ada('0x1d')],_0x363839[_0x7ada('0x1c')]);this[_0x7ada('0xb')]=_0x284e97['queue'];this[_0x7ada('0x21')]=_0x284e97[_0x7ada('0x21')];this[_0x7ada('0x22')]=_0x284e97[_0x7ada('0x22')];this['callback']=_0x363839['callback'];this[_0x7ada('0x23')]=_0x363839[_0x7ada('0x23')];this[_0x7ada('0x24')]=_0x363839['callbackat'];this[_0x7ada('0x25')]=_0x363839[_0x7ada('0x25')];this[_0x7ada('0x26')]=_0x363839['ContactId'];this[_0x7ada('0x27')]=_0x363839[_0x7ada('0x27')];this['UserId']=_0x363839['UserId'];this['VoiceQueueId']=_0x363839[_0x7ada('0x28')];this[_0x7ada('0x29')]=_0x363839[_0x7ada('0x29')];this['originatecalleridnum']=_0x363839[_0x7ada('0x2a')]||'';this[_0x7ada('0x2b')]=_0x363839[_0x7ada('0x2b')]||'';}module[_0x7ada('0x2c')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index 44aab4c..8a11337 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 _0xfa2b=['callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid'];(function(_0x256b72,_0x340985){var _0x2183e3=function(_0xf7fd37){while(--_0xf7fd37){_0x256b72['push'](_0x256b72['shift']());}};_0x2183e3(++_0x340985);}(_0xfa2b,0x1b7));var _0xbfa2=function(_0x2cb53c,_0x23adc0){_0x2cb53c=_0x2cb53c-0x0;var _0xcd1add=_0xfa2b[_0x2cb53c];return _0xcd1add;};'use strict';var util=require(_0xbfa2('0x0'));var _=require(_0xbfa2('0x1'));var moment=require(_0xbfa2('0x2'));function getSeconds(_0x9a9b55,_0x237b3e){var _0x41d712=moment(_0x9a9b55)[_0xbfa2('0x3')](0x0);var _0x1103cf=moment(_0x237b3e)[_0xbfa2('0x3')](0x0);return _0x41d712[_0xbfa2('0x4')](_0x1103cf,_0xbfa2('0x5'));}function Final(_0x2e8f3b){this[_0xbfa2('0x6')]=_0x2e8f3b[_0xbfa2('0x6')];this[_0xbfa2('0x7')]=_0x2e8f3b[_0xbfa2('0x7')];this['type']=_0x2e8f3b[_0xbfa2('0x8')];this['campaigntype']=_0x2e8f3b[_0xbfa2('0x8')]===_0xbfa2('0x9')?_0xbfa2('0xa'):_0x2e8f3b[_0xbfa2('0x8')];this[_0xbfa2('0xb')]=_0x2e8f3b[_0xbfa2('0xb')];this[_0xbfa2('0xc')]=_0x2e8f3b[_0xbfa2('0xc')];this[_0xbfa2('0xd')]=_0x2e8f3b['countnoanswerretry'];this['countglobal']=_0x2e8f3b['countbusyretry']+_0x2e8f3b[_0xbfa2('0xc')]+_0x2e8f3b[_0xbfa2('0xd')]+_0x2e8f3b[_0xbfa2('0xe')]+_0x2e8f3b[_0xbfa2('0xf')]+_0x2e8f3b[_0xbfa2('0x10')]+_0x2e8f3b[_0xbfa2('0x11')]+_0x2e8f3b['countagentrejectretry'];this[_0xbfa2('0xe')]=_0x2e8f3b[_0xbfa2('0xe')];this[_0xbfa2('0xf')]=_0x2e8f3b[_0xbfa2('0xf')];this[_0xbfa2('0x10')]=_0x2e8f3b['countabandonedretry'];this[_0xbfa2('0x11')]=_0x2e8f3b['countmachineretry'];this['countagentrejectretry']=_0x2e8f3b[_0xbfa2('0x12')];this['queue']=_0x2e8f3b['queue'];this[_0xbfa2('0x13')]=_0x2e8f3b[_0xbfa2('0x13')];this['calleridnum']=_0x2e8f3b[_0xbfa2('0x14')];this[_0xbfa2('0x15')]=_0x2e8f3b[_0xbfa2('0x15')];this[_0xbfa2('0x16')]=_0x2e8f3b[_0xbfa2('0x16')];this[_0xbfa2('0x17')]=_0x2e8f3b[_0xbfa2('0x16')];this['ringtime']=_0x2e8f3b[_0xbfa2('0x18')]||0x0;this[_0xbfa2('0x19')]=_0x2e8f3b[_0xbfa2('0x19')]||0x0;this['talktime']=_0x2e8f3b[_0xbfa2('0x1a')]||0x0;this[_0xbfa2('0x1b')]=_0x2e8f3b['callback'];this[_0xbfa2('0x1c')]=_0x2e8f3b['callbackuniqueid'];this['callbackat']=_0x2e8f3b[_0xbfa2('0x1d')];this[_0xbfa2('0x1e')]=_0x2e8f3b[_0xbfa2('0x1e')];this[_0xbfa2('0x1f')]=_0x2e8f3b['ContactId'];this['ListId']=_0x2e8f3b[_0xbfa2('0x20')];this[_0xbfa2('0x21')]=_0x2e8f3b['UserId'];this[_0xbfa2('0x22')]=_0x2e8f3b['VoiceQueueId'];this[_0xbfa2('0x23')]=_0x2e8f3b['CampaignId'];this[_0xbfa2('0x24')]=_0x2e8f3b[_0xbfa2('0x24')]||'';this[_0xbfa2('0x25')]=_0x2e8f3b[_0xbfa2('0x25')]||'';}module[_0xbfa2('0x26')]=Final; \ No newline at end of file +var _0x7579=['endtime','ringtime','holdtime','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countnosuchnumberretry','countagentrejectretry','queue','calleridname','calleridnum','starttime','responsetime'];(function(_0x16297d,_0x2c9d96){var _0x2c4ad5=function(_0x1585be){while(--_0x1585be){_0x16297d['push'](_0x16297d['shift']());}};_0x2c4ad5(++_0x2c9d96);}(_0x7579,0x1e2));var _0x9757=function(_0x5db5df,_0x1c6bda){_0x5db5df=_0x5db5df-0x0;var _0x5a425d=_0x7579[_0x5db5df];return _0x5a425d;};'use strict';var util=require(_0x9757('0x0'));var _=require(_0x9757('0x1'));var moment=require(_0x9757('0x2'));function getSeconds(_0x30eeec,_0x2e6afa){var _0x304b14=moment(_0x30eeec)['milliseconds'](0x0);var _0x399165=moment(_0x2e6afa)[_0x9757('0x3')](0x0);return _0x304b14[_0x9757('0x4')](_0x399165,_0x9757('0x5'));}function Final(_0x4c1a67){this[_0x9757('0x6')]=_0x4c1a67[_0x9757('0x6')];this[_0x9757('0x7')]=_0x4c1a67['scheduledat'];this[_0x9757('0x8')]=_0x4c1a67['type'];this[_0x9757('0x9')]=_0x4c1a67[_0x9757('0x8')]===_0x9757('0xa')?'queue':_0x4c1a67[_0x9757('0x8')];this[_0x9757('0xb')]=_0x4c1a67[_0x9757('0xb')];this[_0x9757('0xc')]=_0x4c1a67[_0x9757('0xc')];this[_0x9757('0xd')]=_0x4c1a67[_0x9757('0xd')];this[_0x9757('0xe')]=_0x4c1a67[_0x9757('0xb')]+_0x4c1a67[_0x9757('0xc')]+_0x4c1a67[_0x9757('0xd')]+_0x4c1a67['countnosuchnumberretry']+_0x4c1a67[_0x9757('0xf')]+_0x4c1a67[_0x9757('0x10')]+_0x4c1a67[_0x9757('0x11')]+_0x4c1a67['countagentrejectretry'];this[_0x9757('0x12')]=_0x4c1a67[_0x9757('0x12')];this[_0x9757('0xf')]=_0x4c1a67[_0x9757('0xf')];this[_0x9757('0x10')]=_0x4c1a67[_0x9757('0x10')];this[_0x9757('0x11')]=_0x4c1a67['countmachineretry'];this[_0x9757('0x13')]=_0x4c1a67['countagentrejectretry'];this[_0x9757('0x14')]=_0x4c1a67[_0x9757('0x14')];this[_0x9757('0x15')]=_0x4c1a67[_0x9757('0x15')];this[_0x9757('0x16')]=_0x4c1a67[_0x9757('0x16')];this['starttime']=_0x4c1a67[_0x9757('0x17')];this[_0x9757('0x18')]=_0x4c1a67[_0x9757('0x18')];this[_0x9757('0x19')]=_0x4c1a67[_0x9757('0x18')];this[_0x9757('0x1a')]=_0x4c1a67[_0x9757('0x1a')]||0x0;this['holdtime']=_0x4c1a67[_0x9757('0x1b')]||0x0;this['talktime']=_0x4c1a67['talktime']||0x0;this[_0x9757('0x1c')]=_0x4c1a67[_0x9757('0x1c')];this[_0x9757('0x1d')]=_0x4c1a67[_0x9757('0x1d')];this['callbackat']=_0x4c1a67['callbackat'];this['recallme']=_0x4c1a67[_0x9757('0x1e')];this[_0x9757('0x1f')]=_0x4c1a67[_0x9757('0x1f')];this[_0x9757('0x20')]=_0x4c1a67['ListId'];this[_0x9757('0x21')]=_0x4c1a67[_0x9757('0x21')];this['VoiceQueueId']=_0x4c1a67[_0x9757('0x22')];this[_0x9757('0x23')]=_0x4c1a67['CampaignId'];this[_0x9757('0x24')]=_0x4c1a67[_0x9757('0x24')]||'';this[_0x9757('0x25')]=_0x4c1a67[_0x9757('0x25')]||'';}module[_0x9757('0x26')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index e02ce2b..113766a 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 _0xc4ef=['ListId','UserId','VoiceQueueId','CampaignId','exports','lodash','moment','milliseconds','diff','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','membername','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme'];(function(_0x510def,_0x11c2b1){var _0x1d43b5=function(_0x1af879){while(--_0x1af879){_0x510def['push'](_0x510def['shift']());}};_0x1d43b5(++_0x11c2b1);}(_0xc4ef,0x107));var _0xfc4e=function(_0x30f07a,_0x98341){_0x30f07a=_0x30f07a-0x0;var _0xb38461=_0xc4ef[_0x30f07a];return _0xb38461;};'use strict';var util=require('util');var _=require(_0xfc4e('0x0'));var moment=require(_0xfc4e('0x1'));function getSeconds(_0x4641be,_0x40714b){var _0x626b52=moment(_0x4641be)[_0xfc4e('0x2')](0x0);var _0x305e5c=moment(_0x40714b)[_0xfc4e('0x2')](0x0);return _0x626b52[_0xfc4e('0x3')](_0x305e5c,'seconds');}function Hangup(_0x596239,_0x207961){this['state']=0x4;this['statedesc']=_0xfc4e('0x4');this[_0xfc4e('0x5')]=_0x596239[_0xfc4e('0x5')];this[_0xfc4e('0x6')]=_0x596239[_0xfc4e('0x6')];this[_0xfc4e('0x7')]=_0x596239[_0xfc4e('0x6')]===_0xfc4e('0x8')?_0xfc4e('0x9'):_0x596239['type'];this['countbusyretry']=_0x596239[_0xfc4e('0xa')];this[_0xfc4e('0xb')]=_0x596239[_0xfc4e('0xb')];this[_0xfc4e('0xc')]=_0x596239[_0xfc4e('0xc')];this[_0xfc4e('0xd')]=_0x596239[_0xfc4e('0xa')]+_0x596239[_0xfc4e('0xb')]+_0x596239['countnoanswerretry']+_0x596239[_0xfc4e('0xe')]+_0x596239[_0xfc4e('0xf')]+_0x596239[_0xfc4e('0x10')]+_0x596239[_0xfc4e('0x11')]+_0x596239[_0xfc4e('0x12')];this[_0xfc4e('0xe')]=_0x596239[_0xfc4e('0xe')];this['countdropretry']=_0x596239[_0xfc4e('0xf')];this[_0xfc4e('0x10')]=_0x596239[_0xfc4e('0x10')];this[_0xfc4e('0x11')]=_0x596239[_0xfc4e('0x11')];this['countagentrejectretry']=_0x596239['countagentrejectretry'];this['uniqueid']=_0x207961[_0xfc4e('0x13')];this[_0xfc4e('0x14')]=_0x596239[_0xfc4e('0x15')];this[_0xfc4e('0x16')]=_0x596239[_0xfc4e('0x17')];this[_0xfc4e('0x18')]=_0x596239[_0xfc4e('0x18')];this[_0xfc4e('0x19')]=_0x596239[_0xfc4e('0x19')];this[_0xfc4e('0x1a')]=moment()['format'](_0xfc4e('0x1b'));this[_0xfc4e('0x1c')]=getSeconds(_0x596239[_0xfc4e('0x19')],_0x596239[_0xfc4e('0x18')]);this[_0xfc4e('0x1d')]=0x0;this[_0xfc4e('0x1e')]=getSeconds(this[_0xfc4e('0x1a')],_0x596239[_0xfc4e('0x19')]);this[_0xfc4e('0x9')]=_0x596239[_0xfc4e('0x9')];this[_0xfc4e('0x1f')]='IVR';this[_0xfc4e('0x20')]=_0x207961[_0xfc4e('0x21')];this[_0xfc4e('0x22')]=_0x596239[_0xfc4e('0x22')];this['callbackuniqueid']=_0x596239[_0xfc4e('0x23')];this[_0xfc4e('0x24')]=_0x596239[_0xfc4e('0x24')];this[_0xfc4e('0x25')]=_0x596239[_0xfc4e('0x25')];this['ContactId']=_0x596239['ContactId'];this[_0xfc4e('0x26')]=_0x596239['ListId'];this['UserId']=_0x596239[_0xfc4e('0x27')];this[_0xfc4e('0x28')]=_0x596239['VoiceQueueId'];this[_0xfc4e('0x29')]=_0x596239[_0xfc4e('0x29')];}module[_0xfc4e('0x2a')]=Hangup; \ No newline at end of file +var _0x5531=['calleridnum','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','holdtime','talktime','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','util','lodash','moment','milliseconds','diff','seconds','state','Answer','scheduledat','type','campaigntype','outbound','queue','countcongestionretry','countnoanswerretry','countbusyretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name'];(function(_0x1a2877,_0x4b2963){var _0xe5dbce=function(_0x27b961){while(--_0x27b961){_0x1a2877['push'](_0x1a2877['shift']());}};_0xe5dbce(++_0x4b2963);}(_0x5531,0x1e0));var _0x1553=function(_0x43ca85,_0x5c0576){_0x43ca85=_0x43ca85-0x0;var _0x44e041=_0x5531[_0x43ca85];return _0x44e041;};'use strict';var util=require(_0x1553('0x0'));var _=require(_0x1553('0x1'));var moment=require(_0x1553('0x2'));function getSeconds(_0x1ffb6b,_0x4ac05c){var _0x4db74d=moment(_0x1ffb6b)[_0x1553('0x3')](0x0);var _0x247bdf=moment(_0x4ac05c)['milliseconds'](0x0);return _0x4db74d[_0x1553('0x4')](_0x247bdf,_0x1553('0x5'));}function Hangup(_0x490896,_0x5d3766){this[_0x1553('0x6')]=0x4;this['statedesc']=_0x1553('0x7');this[_0x1553('0x8')]=_0x490896[_0x1553('0x8')];this[_0x1553('0x9')]=_0x490896[_0x1553('0x9')];this[_0x1553('0xa')]=_0x490896[_0x1553('0x9')]===_0x1553('0xb')?_0x1553('0xc'):_0x490896[_0x1553('0x9')];this['countbusyretry']=_0x490896['countbusyretry'];this[_0x1553('0xd')]=_0x490896['countcongestionretry'];this['countnoanswerretry']=_0x490896[_0x1553('0xe')];this['countglobal']=_0x490896[_0x1553('0xf')]+_0x490896['countcongestionretry']+_0x490896['countnoanswerretry']+_0x490896[_0x1553('0x10')]+_0x490896[_0x1553('0x11')]+_0x490896[_0x1553('0x12')]+_0x490896[_0x1553('0x13')]+_0x490896[_0x1553('0x14')];this['countnosuchnumberretry']=_0x490896[_0x1553('0x10')];this[_0x1553('0x11')]=_0x490896['countdropretry'];this['countabandonedretry']=_0x490896[_0x1553('0x12')];this[_0x1553('0x13')]=_0x490896[_0x1553('0x13')];this[_0x1553('0x14')]=_0x490896[_0x1553('0x14')];this[_0x1553('0x15')]=_0x5d3766['uniqueid'];this[_0x1553('0x16')]=_0x490896[_0x1553('0x17')];this[_0x1553('0x18')]=_0x490896['number'];this[_0x1553('0x19')]=_0x490896[_0x1553('0x19')];this[_0x1553('0x1a')]=_0x490896[_0x1553('0x1a')];this[_0x1553('0x1b')]=moment()['format'](_0x1553('0x1c'));this['ringtime']=getSeconds(_0x490896[_0x1553('0x1a')],_0x490896[_0x1553('0x19')]);this[_0x1553('0x1d')]=0x0;this[_0x1553('0x1e')]=getSeconds(this['endtime'],_0x490896[_0x1553('0x1a')]);this[_0x1553('0xc')]=_0x490896[_0x1553('0xc')];this['membername']='IVR';this[_0x1553('0x1f')]=_0x5d3766[_0x1553('0x20')];this[_0x1553('0x21')]=_0x490896[_0x1553('0x21')];this[_0x1553('0x22')]=_0x490896[_0x1553('0x22')];this[_0x1553('0x23')]=_0x490896['callbackat'];this[_0x1553('0x24')]=_0x490896[_0x1553('0x24')];this['ContactId']=_0x490896[_0x1553('0x25')];this['ListId']=_0x490896[_0x1553('0x26')];this['UserId']=_0x490896[_0x1553('0x27')];this[_0x1553('0x28')]=_0x490896[_0x1553('0x28')];this[_0x1553('0x29')]=_0x490896[_0x1553('0x29')];}module['exports']=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index f1a2138..de110cf 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 _0x05ea=['queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','calleridname','name','calleridnum','number','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','outbound'];(function(_0x11e584,_0x283b75){var _0x5ec3ad=function(_0x3d8cbb){while(--_0x3d8cbb){_0x11e584['push'](_0x11e584['shift']());}};_0x5ec3ad(++_0x283b75);}(_0x05ea,0x187));var _0xa05e=function(_0x52f1e6,_0xf70489){_0x52f1e6=_0x52f1e6-0x0;var _0x21f104=_0x05ea[_0x52f1e6];return _0x21f104;};'use strict';var util=require('util');var _=require(_0xa05e('0x0'));var moment=require(_0xa05e('0x1'));function getSeconds(_0x429dfe,_0x542cbe){var _0x172a41=moment(_0x429dfe)[_0xa05e('0x2')](0x0);var _0x4d355f=moment(_0x542cbe)[_0xa05e('0x2')](0x0);return _0x172a41[_0xa05e('0x3')](_0x4d355f,_0xa05e('0x4'));}function History(_0x270898){this[_0xa05e('0x5')]=_0x270898[_0xa05e('0x5')];this[_0xa05e('0x6')]=_0x270898[_0xa05e('0x6')]||undefined;this[_0xa05e('0x7')]=_0x270898[_0xa05e('0x7')];this['campaigntype']=_0x270898[_0xa05e('0x7')]===_0xa05e('0x8')?_0xa05e('0x9'):_0x270898[_0xa05e('0x7')];this[_0xa05e('0xa')]=_0x270898[_0xa05e('0xa')];this[_0xa05e('0xb')]=_0x270898[_0xa05e('0xb')];this[_0xa05e('0xc')]=_0x270898['countnoanswerretry'];this[_0xa05e('0xd')]=_0x270898['countbusyretry']+_0x270898['countcongestionretry']+_0x270898[_0xa05e('0xc')]+_0x270898['countnosuchnumberretry']+_0x270898[_0xa05e('0xe')]+_0x270898[_0xa05e('0xf')]+_0x270898[_0xa05e('0x10')]+_0x270898[_0xa05e('0x11')];this[_0xa05e('0x12')]=_0x270898[_0xa05e('0x12')];this['countdropretry']=_0x270898['countdropretry'];this['countabandonedretry']=_0x270898[_0xa05e('0xf')];this['countmachineretry']=_0x270898[_0xa05e('0x10')];this[_0xa05e('0x11')]=_0x270898[_0xa05e('0x11')];this[_0xa05e('0x9')]=_0x270898[_0xa05e('0x9')];this[_0xa05e('0x13')]=_0x270898[_0xa05e('0x14')];this[_0xa05e('0x15')]=_0x270898[_0xa05e('0x16')];this[_0xa05e('0x17')]=_0x270898[_0xa05e('0x17')];this['responsetime']=_0x270898[_0xa05e('0x18')];this[_0xa05e('0x19')]=_0x270898[_0xa05e('0x18')];this[_0xa05e('0x1a')]=getSeconds(_0x270898['responsetime'],_0x270898[_0xa05e('0x17')]);this[_0xa05e('0x1b')]=0x0;this[_0xa05e('0x1c')]=0x0;this[_0xa05e('0x1d')]=_0x270898[_0xa05e('0x1d')];this[_0xa05e('0x1e')]=_0x270898[_0xa05e('0x1e')];this[_0xa05e('0x1f')]=_0x270898[_0xa05e('0x1f')];this[_0xa05e('0x20')]=_0x270898['recallme'];this[_0xa05e('0x21')]=_0x270898['ContactId'];this['ListId']=_0x270898[_0xa05e('0x22')];this['UserId']=_0x270898[_0xa05e('0x23')];this[_0xa05e('0x24')]=_0x270898[_0xa05e('0x24')];this['CampaignId']=_0x270898[_0xa05e('0x25')];this[_0xa05e('0x26')]=_0x270898['originatecalleridnum']||'';this[_0xa05e('0x27')]=_0x270898[_0xa05e('0x27')]||'';}module['exports']=History; \ No newline at end of file +var _0x721d=['milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','name','number','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash'];(function(_0x2477c9,_0x51d3d7){var _0x2a8b98=function(_0x347a18){while(--_0x347a18){_0x2477c9['push'](_0x2477c9['shift']());}};_0x2a8b98(++_0x51d3d7);}(_0x721d,0xc1));var _0xd721=function(_0x3ca1f8,_0x4afa33){_0x3ca1f8=_0x3ca1f8-0x0;var _0x94fb6b=_0x721d[_0x3ca1f8];return _0x94fb6b;};'use strict';var util=require(_0xd721('0x0'));var _=require(_0xd721('0x1'));var moment=require('moment');function getSeconds(_0x512ce2,_0x4d5d22){var _0x45484e=moment(_0x512ce2)['milliseconds'](0x0);var _0x5894b7=moment(_0x4d5d22)[_0xd721('0x2')](0x0);return _0x45484e[_0xd721('0x3')](_0x5894b7,_0xd721('0x4'));}function History(_0x188750){this['uniqueid']=_0x188750[_0xd721('0x5')];this[_0xd721('0x6')]=_0x188750['scheduledat']||undefined;this[_0xd721('0x7')]=_0x188750['type'];this[_0xd721('0x8')]=_0x188750['type']==='outbound'?_0xd721('0x9'):_0x188750[_0xd721('0x7')];this[_0xd721('0xa')]=_0x188750[_0xd721('0xa')];this['countcongestionretry']=_0x188750[_0xd721('0xb')];this[_0xd721('0xc')]=_0x188750[_0xd721('0xc')];this['countglobal']=_0x188750[_0xd721('0xa')]+_0x188750[_0xd721('0xb')]+_0x188750['countnoanswerretry']+_0x188750[_0xd721('0xd')]+_0x188750[_0xd721('0xe')]+_0x188750[_0xd721('0xf')]+_0x188750[_0xd721('0x10')]+_0x188750[_0xd721('0x11')];this['countnosuchnumberretry']=_0x188750[_0xd721('0xd')];this['countdropretry']=_0x188750[_0xd721('0xe')];this[_0xd721('0xf')]=_0x188750[_0xd721('0xf')];this['countmachineretry']=_0x188750[_0xd721('0x10')];this['countagentrejectretry']=_0x188750[_0xd721('0x11')];this[_0xd721('0x9')]=_0x188750[_0xd721('0x9')];this[_0xd721('0x12')]=_0x188750[_0xd721('0x13')];this['calleridnum']=_0x188750[_0xd721('0x14')];this[_0xd721('0x15')]=_0x188750[_0xd721('0x15')];this[_0xd721('0x16')]=_0x188750[_0xd721('0x16')];this[_0xd721('0x17')]=_0x188750['responsetime'];this[_0xd721('0x18')]=getSeconds(_0x188750['responsetime'],_0x188750[_0xd721('0x15')]);this[_0xd721('0x19')]=0x0;this[_0xd721('0x1a')]=0x0;this[_0xd721('0x1b')]=_0x188750[_0xd721('0x1b')];this[_0xd721('0x1c')]=_0x188750[_0xd721('0x1c')];this['callbackat']=_0x188750[_0xd721('0x1d')];this[_0xd721('0x1e')]=_0x188750[_0xd721('0x1e')];this[_0xd721('0x1f')]=_0x188750['ContactId'];this[_0xd721('0x20')]=_0x188750['ListId'];this['UserId']=_0x188750[_0xd721('0x21')];this['VoiceQueueId']=_0x188750[_0xd721('0x22')];this[_0xd721('0x23')]=_0x188750[_0xd721('0x23')];this[_0xd721('0x24')]=_0x188750[_0xd721('0x24')]||'';this[_0xd721('0x25')]=_0x188750['originatecalleridname']||'';}module[_0xd721('0x26')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 1b34c00..77ce732 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 _0x0f42=['membername','[syncHangupInAMDIvr]','[rescheduleContact][Machine]','ivrAnswerCallsDay','[syncHangupIvr]','dialQueueProject','AnswerAGI','cause-txt','Unknow','[syncHangupIvr][createHistory]','reason','agent','agiafterat','[syncAgentComplete][createHistory]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dropreason','TIMEOUT','dialQueueProject2','dialDropRetryFrequency','callAdditionalPhoneAfterMin','additional','Drop','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','outboundDropCallsDayCallersExit','CALLEREXIT','voiceQueue','dialAbandonedRetryFrequency','Abandoned','[syncAgentComplete][createHistory][11]','actionid','locked','paused','stateinterface','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','run','idHopper','queueBookedRR','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[Catch][Preview][syncQueueStatusComplete]','[booked][RR][finaly]','[booked][unlock]','[unlock][syncQueueStatusComplete]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','TrunkBackup','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','Failure','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','push','Action','command','iftime\x20%s,%s','interval','content','indexOf','true','all','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','power','dialPowerLevel','booked','Queue','method\x20not\x20recognized','handleIvr','checkIsTrunkReachable','dialGlobalInterval','syncCampaigns','dialTimezone','\x5cw{0,','pow','replace','random','match','object','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialAgiAfterHangupAgent','dialQueueTimeout','getCaller','xcally-motion-dialer','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','Contact','tags','updatedAt','%s%s','XMD-','toUpper','dialOriginateCallerIdNumber','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','dialCutDigit','substring','SIP/%s/%s%s','trim','from-sip','[originateError]:\x20%s','[originate][error]','Error','originate\x20action\x20Error','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialGlobalMaxRetry','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialDropMaxRetry','[rescheduleContact][Drop]','[rescheduleContact][Abandoned]','countagentrejectretry','dialAgentRejectMaxRetry','[rescheduleContact][AgentReject]','[callProgressDetecting]','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','NoAnswer','custom:agentnoanswer','noanswer','dialNoAnswerRetryFrequency','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','congestion','[syncAgentComplete][createHistory][8]','dialCongestionMaxRetry','reason\x208\x20congestion','dialAbandonedMaxRetry','reason\x2011\x20abandoned','dialAgentRejectRetryFrequency','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','floor','predictiveIntervalHitRate','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','averageHandleTime','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(','dialPredictiveOptimizationPercentage','abandonmentRate','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','agentBusyFactor','erlangCallToSecond','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','actionOriginate','scheduledat','dialRecallMeTimeout','Agent','voicePause','dialRecallInQueue','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','dialOrderByScheduledAt','AVAILABLE_CONTACTS_FINISHED','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','emptyContact','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','ACTIVE','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','not_inuse','[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','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','[abandonmentRate]','p\x20=\x20','interval\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]','m\x20=\x20','Ts\x20=\x20','exports','util','lodash','bluebird','uuid','md5','../preview/util/util','../../../config/logger','dialer','predictive','predictiveCalls','redis','localhost','socket.io-emitter','../rpc/cmHopperHistory','../rpc/cmHopperAdditionalPhone','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./final','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','enqueue','tail','finally','preview','voiceQueues','campaigns','agents','maxNumberOriginate','actions','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','syncOriginateResponse','syncAgentComplete','syncQueueSummary','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','message','AGENTS_NOT_LOGGED','name','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','stringify','milliseconds','diff','seconds','emit','outbound','strategy','available','loggedIn','sumBillable','sumDuration','sumHoldTime','total','type','unmanaged','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','erlangCalls','erlangBusyFactor','Trunk','active','callerid','format','voice:queue:%s','voice_queue:save','ivr','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','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','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','isUndefined','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','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','merge','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22\x22\x20<>','error','stack','inspect','length','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','[getContactDialer2][Empty]','talking','pTalking','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','endtime','starttime','[uniqueid]','clearZombieChannels','[actions]','undefined','sequence','isNil','status','channel','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','countReScheduled','then','[countReScheduled]\x20','checkIsBlackList','resolve','[checkIsBlackList]\x20','verifyAdditionalPhones','swapAdditionalPhones','checkIsBlackListIvr','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','notFound','saveInDb','pick','ContactId','UserId','VoiceQueueId','CampaignId','[emptyContact]','isSuccess','Success','isTrunkReachable','trunks','SIP/%s','reachable','unmonitored','uniqueid','exten','dialAMDActive','value','HANGUP','outboundAnswerCallsDay','HangupInAMD','AMD','custom:amd','buildObj','amd','[syncHangupInAMD]','MACHINE','Machine','countmachineretry','countglobal','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','ListId','statedesc'];(function(_0x1c6efd,_0xb2f3cd){var _0x53a918=function(_0x14c19b){while(--_0x14c19b){_0x1c6efd['push'](_0x1c6efd['shift']());}};_0x53a918(++_0xb2f3cd);}(_0x0f42,0x126));var _0x20f4=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x0f42[_0xa464c9];return _0x3d73c4;};'use strict';var util=require(_0x20f4('0x0'));var _=require(_0x20f4('0x1'));var BPromise=require(_0x20f4('0x2'));var uuid=require(_0x20f4('0x3'));var moment=require('moment');var rr=require('rr');var md5=require(_0x20f4('0x4'));var Redis=require('ioredis');var ut=require(_0x20f4('0x5'));var config=require('../../../config/environment/');var logger=require(_0x20f4('0x6'))(_0x20f4('0x7'));var loggerBooked=require(_0x20f4('0x6'))('booked');var loggerPredictive=require(_0x20f4('0x6'))(_0x20f4('0x8'));var loggerPredictiveCalls=require('../../../config/logger')(_0x20f4('0x9'));var loggerSyncQueueSummary=require('../../../config/logger')('syncQueueSummary');var ami=require('../ami');config[_0x20f4('0xa')]=_['defaults'](config[_0x20f4('0xa')],{'host':_0x20f4('0xb'),'port':0x18eb});var io=require(_0x20f4('0xc'))(new Redis(config[_0x20f4('0xa')]));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0x20f4('0xd'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperAdditionalPhone=require(_0x20f4('0xe'));var cmHopperBlack=require(_0x20f4('0xf'));var voiceQueueRt=require(_0x20f4('0x10'));var Action=require(_0x20f4('0x11'));var History=require('./history');var Final=require(_0x20f4('0x12'));var AgentComplete=require(_0x20f4('0x13'));var QueueCallerAbandon=require(_0x20f4('0x14'));var Hangup=require(_0x20f4('0x15'));var ipAgi=process[_0x20f4('0x16')][_0x20f4('0x17')]||_0x20f4('0x18');var strategy={'rrmemory':_0x20f4('0x19'),'roundrobin':_0x20f4('0x1a')};var Sequence=function(){};Sequence[_0x20f4('0x1b')][_0x20f4('0x1c')]=function(_0x490c2c){this['tail']=this[_0x20f4('0x1d')]?this[_0x20f4('0x1d')][_0x20f4('0x1e')](_0x490c2c):_0x490c2c();};function Dialer(_0x36fdc2,_0x14e196){this['sequence']=new Sequence();this[_0x20f4('0x1f')]=_0x14e196;this[_0x20f4('0x20')]=_0x36fdc2[_0x20f4('0x20')];this['campaigns']=_0x36fdc2[_0x20f4('0x21')];this[_0x20f4('0x22')]=_0x36fdc2[_0x20f4('0x22')];this['trunks']=_0x36fdc2['trunks'];this[_0x20f4('0x23')]=config['maxNumberOriginate']||0x2;this['channels']={};this[_0x20f4('0x24')]={};this['contactsId']={};this[_0x20f4('0x25')]={};this[_0x20f4('0x26')]={};this[_0x20f4('0x27')]={};this[_0x20f4('0x28')]={};this[_0x20f4('0x29')]={};this[_0x20f4('0x2a')]={};this['queueBookedRR']={};ami['on'](_0x20f4('0x2b'),this[_0x20f4('0x2c')][_0x20f4('0x2d')](this));ami['on'](_0x20f4('0x2e'),this[_0x20f4('0x2f')]['bind'](this));ami['on']('originateresponse',this[_0x20f4('0x30')][_0x20f4('0x2d')](this));ami['on']('agentcomplete',this[_0x20f4('0x31')][_0x20f4('0x2d')](this));ami['on']('custom:queuesummary',this[_0x20f4('0x32')][_0x20f4('0x2d')](this));ami['on']('hangup',this[_0x20f4('0x33')][_0x20f4('0x2d')](this));ami['on'](_0x20f4('0x34'),this[_0x20f4('0x35')][_0x20f4('0x2d')](this));ami['on'](_0x20f4('0x36'),this[_0x20f4('0x37')][_0x20f4('0x2d')](this));ami['on'](_0x20f4('0x38'),this[_0x20f4('0x39')][_0x20f4('0x2d')](this));ami['on'](_0x20f4('0x3a'),this[_0x20f4('0x3b')][_0x20f4('0x2d')](this));this[_0x20f4('0x3c')]();this[_0x20f4('0x3d')]();}function isNotNull(_0x2f964a){return _0x2f964a!==null&&!_['isUndefined'](_0x2f964a);}function checkIsLoggedIn(_0x4e20fd,_0x4d4edc){return function(){if(_0x4d4edc<=0x0){_0x4e20fd[_0x20f4('0x3e')]=_0x20f4('0x3f');throw _0x4e20fd[_0x20f4('0x40')]+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x5d95f3){return _0x5d95f3;}function checkIsActive(_0x352794,_0x1f85c8){return function(){if(!isActive(_0x1f85c8)){_0x352794[_0x20f4('0x3e')]=_0x20f4('0x41');throw _0x352794['name']+_0x20f4('0x42');}};}function checkInterval(_0x546d61){return function(){if(!isNotNull(_0x546d61[_0x20f4('0x43')])){_0x546d61[_0x20f4('0x3e')]=_0x20f4('0x44');throw _0x546d61[_0x20f4('0x40')]+_0x20f4('0x45');}if(!isNotNull(_0x546d61[_0x20f4('0x43')][_0x20f4('0x46')])){_0x546d61[_0x20f4('0x3e')]=_0x20f4('0x44');throw _0x546d61['name']+_0x20f4('0x45');}if(!isNotNull(_[_0x20f4('0x47')](_0x546d61[_0x20f4('0x43')]['Intervals']))){_0x546d61['message']=_0x20f4('0x44');throw _0x546d61['name']+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x4b3fff,_0xb1504b,_0x2b1ef4){return{'action':_0x4b3fff,'response':_0xb1504b,'message':_0x2b1ef4,'stack':_0x2b1ef4};}function myreject(_0xbc17cc){return function(_0x18b79a){return _0xbc17cc(msgResponse('[ifTime][Action]','Error',JSON[_0x20f4('0x48')](_0x18b79a)));};}function getSeconds(_0x34f5df,_0xd250e7){var _0x5117fb=moment(_0x34f5df)[_0x20f4('0x49')](0x0);var _0x23e40a=moment(_0xd250e7)[_0x20f4('0x49')](0x0);return _0x5117fb[_0x20f4('0x4a')](_0x23e40a,_0x20f4('0x4b'));}function emit(_0x9145f1,_0x3af857,_0x3147f6){io['to'](_0x9145f1)[_0x20f4('0x4c')](_0x3af857,_0x3147f6);}function emitVoiceQueueSummary(_0x35e426){if(_0x35e426['type']===_0x20f4('0x4d')){var _0x3e6211={'id':_0x35e426['id'],'name':_0x35e426[_0x20f4('0x40')],'strategy':_0x35e426[_0x20f4('0x4e')],'answered':_0x35e426['answered'],'available':_0x35e426[_0x20f4('0x4f')],'loggedIn':_0x35e426[_0x20f4('0x50')],'pTalking':_0x35e426['pTalking'],'sumBillable':_0x35e426[_0x20f4('0x51')],'sumDuration':_0x35e426[_0x20f4('0x52')],'sumHoldTime':_0x35e426[_0x20f4('0x53')]||0x0,'talking':_0x35e426['talking'],'total':_0x35e426[_0x20f4('0x54')],'type':_0x35e426[_0x20f4('0x55')],'unmanaged':_0x35e426[_0x20f4('0x56')],'abandoned':_0x35e426['abandoned'],'waiting':_0x35e426[_0x20f4('0x57')],'loggedInDb':_0x35e426[_0x20f4('0x58')],'dialActive':_0x35e426[_0x20f4('0x59')],'dialMethod':_0x35e426[_0x20f4('0x5a')],'dialOriginateCallerIdName':_0x35e426[_0x20f4('0x5b')],'dialOriginateCallerIdNumber':_0x35e426['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x35e426[_0x20f4('0x5c')],'dialPrefix':_0x35e426[_0x20f4('0x5d')],'outboundAnswerAgiCallsDay':_0x35e426[_0x20f4('0x5e')],'outboundAnswerCallsDay':_0x35e426['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x35e426[_0x20f4('0x5f')],'outboundBusyCallsDay':_0x35e426['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x35e426[_0x20f4('0x60')],'outboundDropCallsDayACS':_0x35e426[_0x20f4('0x61')],'outboundDropCallsDayCallersExit':_0x35e426['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x35e426['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x35e426[_0x20f4('0x62')],'outboundNoSuchCallsDay':_0x35e426['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x35e426[_0x20f4('0x63')],'outboundReCallsDay':_0x35e426[_0x20f4('0x64')],'outboundRejectCallsDay':_0x35e426[_0x20f4('0x65')],'outboundUnknownCallsDay':_0x35e426[_0x20f4('0x66')],'predictiveIntervalAnsweredCalls':_0x35e426['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x35e426[_0x20f4('0x67')],'predictiveIntervalAvgTalktime':_0x35e426[_0x20f4('0x68')],'predictiveIntervalDroppedCallsCallersExit':_0x35e426[_0x20f4('0x69')],'predictiveIntervalDroppedCallsTimeout':_0x35e426[_0x20f4('0x6a')],'predictiveIntervalErlangCalls':_0x35e426[_0x20f4('0x6b')],'predictiveIntervalErlangCallsDroppedCalls':_0x35e426[_0x20f4('0x6c')],'predictiveIntervalHitRate':_0x35e426['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x35e426[_0x20f4('0x6d')],'predictiveIntervalPauses':_0x35e426[_0x20f4('0x6e')],'predictiveIntervalAvailable':_0x35e426['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x35e426[_0x20f4('0x6f')],'message':_0x35e426['message'],'originated':_0x35e426[_0x20f4('0x70')],'erlangCalls':_0x35e426[_0x20f4('0x71')],'erlangCallToSecond':_0x35e426['erlangCallToSecond'],'erlangAbandonmentRate':_0x35e426['erlangAbandonmentRate'],'erlangBusyFactor':_0x35e426[_0x20f4('0x72')],'startPredictive':_0x35e426[_0x20f4('0x27')],'startProgressive':_0x35e426['startProgressive']};if(_0x35e426[_0x20f4('0x73')]){_0x3e6211['Trunk']={'id':_0x35e426['Trunk']['id'],'name':_0x35e426['Trunk']['name'],'active':_0x35e426[_0x20f4('0x73')][_0x20f4('0x74')],'callerid':_0x35e426[_0x20f4('0x73')][_0x20f4('0x75')]};}if(_0x35e426[_0x20f4('0x43')]){_0x3e6211[_0x20f4('0x43')]={'id':_0x35e426[_0x20f4('0x43')]['id'],'name':_0x35e426[_0x20f4('0x43')][_0x20f4('0x40')]};}var _0x5102b9=md5(JSON[_0x20f4('0x48')](_0x3e6211));if(_0x35e426[_0x20f4('0x4')]!==_0x5102b9){_0x35e426[_0x20f4('0x4')]=_0x5102b9;emit(util[_0x20f4('0x76')](_0x20f4('0x77'),_0x3e6211[_0x20f4('0x40')]),_0x20f4('0x78'),_0x3e6211);}}}function emitCampaignSummary(_0x48e1d0){if(_0x48e1d0[_0x20f4('0x55')]===_0x20f4('0x79')){emit(util[_0x20f4('0x76')](_0x20f4('0x7a'),_0x48e1d0[_0x20f4('0x40')]),_0x20f4('0x7b'),_0x48e1d0);}}function checkGetDataPredictive(_0x5d2532){if(isNotNull(_0x5d2532)&&!_['isEmpty'](_0x5d2532)){loggerPredictive[_0x20f4('0x7c')](_0x20f4('0x7d'));loggerPredictive[_0x20f4('0x7c')](_0x20f4('0x7e'),_0x5d2532[_0x20f4('0x6f')]);loggerPredictive[_0x20f4('0x7c')](_0x20f4('0x7f'),_0x5d2532[_0x20f4('0x80')]);loggerPredictive['info'](_0x20f4('0x81'),_0x5d2532[_0x20f4('0x6a')]);loggerPredictive[_0x20f4('0x7c')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5d2532['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0x20f4('0x7c')](_0x20f4('0x82'),_0x5d2532[_0x20f4('0x67')]);loggerPredictive[_0x20f4('0x7c')](_0x20f4('0x83'),_0x5d2532[_0x20f4('0x68')]);loggerPredictive[_0x20f4('0x7c')]('---------------------------');if(_0x5d2532[_0x20f4('0x6f')]>0x0){if(!_['isUndefined'](_0x5d2532[_0x20f4('0x68')])&&_0x5d2532['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive[_0x20f4('0x7c')](_0x20f4('0x84'));if(!_[_0x20f4('0x85')](_0x5d2532[_0x20f4('0x67')])&&_0x5d2532[_0x20f4('0x67')]>0x0){return!![];}loggerPredictive[_0x20f4('0x7c')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0x20f4('0x7c')](_0x20f4('0x86'));}}else{loggerPredictive[_0x20f4('0x7c')](_0x20f4('0x87'));}return![];}function mergeDataErlangB(_0x50633e){return function(_0x2d7b79){loggerPredictive['info'](_0x20f4('0x88'));loggerPredictive[_0x20f4('0x7c')](_0x20f4('0x89'),_0x2d7b79[_0x20f4('0x71')]);loggerPredictive[_0x20f4('0x7c')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2d7b79['erlangCallToSecond']);loggerPredictive['info'](_0x20f4('0x8a'),_0x2d7b79[_0x20f4('0x8b')]);loggerPredictive[_0x20f4('0x7c')](_0x20f4('0x8c'),_0x2d7b79[_0x20f4('0x72')]);loggerPredictive['info'](_0x20f4('0x8a'),_0x2d7b79[_0x20f4('0x8b')]);loggerPredictive[_0x20f4('0x7c')](_0x20f4('0x8d'));_[_0x20f4('0x8e')](_0x50633e,_0x2d7b79);};}function getDiff(_0x36becf){var _0x5bdd46=moment()[_0x20f4('0x49')](0x0);var _0x5ee162=moment(_0x36becf)['milliseconds'](0x0);return _0x5bdd46[_0x20f4('0x4a')](_0x5ee162,_0x20f4('0x4b'));}function ifInterval(_0x59de69,_0x49bc7a){if(_[_0x20f4('0x85')](_0x49bc7a)){return![];}return getDiff(_0x49bc7a)<_0x59de69*0x3c;}function freeVariablesPredictive(_0x4736bb){if(isNotNull(_0x4736bb)){if(!_[_0x20f4('0x85')](_0x4736bb[_0x20f4('0x28')])){_0x4736bb[_0x20f4('0x28')]=undefined;loggerPredictive[_0x20f4('0x7c')](_0x4736bb[_0x20f4('0x40')],_0x20f4('0x8f'));}if(!_['isUndefined'](_0x4736bb[_0x20f4('0x27')])){_0x4736bb[_0x20f4('0x27')]=undefined;loggerPredictive['info'](_0x4736bb['name'],_0x20f4('0x90'));}if(!_['isUndefined'](_0x4736bb[_0x20f4('0x91')])){clearInterval(_0x4736bb[_0x20f4('0x91')]);_0x4736bb[_0x20f4('0x91')]=undefined;loggerPredictive['info'](_0x4736bb[_0x20f4('0x40')],_0x20f4('0x92'));}}}function erlangb(_0x5e5307,_0x53112f){if(_0x53112f===0x0){return 0x0;}var _0xf7b234=0x1;for(var _0x219a52=0x1;_0x219a52<=_0x53112f;_0x219a52+=0x1){_0xf7b234=0x1+_0xf7b234*_0x219a52/_0x5e5307;}return 0x1/_0xf7b234;}function isVoiceQueueOutbound(_0x22dd24){return _0x22dd24===_0x20f4('0x4d');}function isNotPreview(_0x5bd35d){return _0x5bd35d!=='preview';}function isCampaignIvr(_0x15dd4c){return _0x15dd4c===_0x20f4('0x79');}function getCallerId(_0x31a54,_0x40155c,_0x34f659){if(!_[_0x20f4('0x85')](_0x34f659)&&typeof _0x34f659==='string'&&!_[_0x20f4('0x47')](_0x34f659)){if(!_[_0x20f4('0x85')](_0x40155c)&&typeof _0x40155c===_0x20f4('0x93')&&!_[_0x20f4('0x47')](_0x40155c)){return util[_0x20f4('0x76')]('\x22%s\x22\x20<%s>',_0x40155c,_0x34f659);}return util[_0x20f4('0x76')]('\x22%s\x22\x20<%s>',_0x34f659,_0x34f659);}if(!_['isUndefined'](_0x31a54)&&typeof _0x31a54===_0x20f4('0x93')&&!_[_0x20f4('0x47')](_0x31a54)){return _0x31a54;}return _0x20f4('0x94');}function loggerCatchQueueSummary(_0x56638d,_0x5ba8fa){return function(_0x2c8691){freeVariablesPredictive(_0x5ba8fa);emitVoiceQueueSummary(_0x5ba8fa);emitCampaignSummary(_0x5ba8fa);loggerSyncQueueSummary['error'](_0x56638d,util['inspect'](_0x2c8691,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x326682,_0x6aed71){return function(_0x360f84){loggerPredictive[_0x20f4('0x95')](_0x6aed71[_0x20f4('0x40')],_0x326682);loggerPredictive[_0x20f4('0x95')](_0x360f84[_0x20f4('0x96')]);freeVariablesPredictive(_0x6aed71);};}function loggerCatch(_0x3a5eb0){return function(_0x54bc1c){logger['error'](_0x3a5eb0,util[_0x20f4('0x97')](_0x54bc1c,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x35fbcc){return _0x35fbcc&&!_[_0x20f4('0x85')](_0x35fbcc)&&_0x35fbcc[_0x20f4('0x98')]>0x0;}function decremetOriginate(_0x13bab5){if(!_['isUndefined'](_0x13bab5)&&_0x13bab5!==null){if(typeof _0x13bab5['originated']!=='undefined'){if(_0x13bab5[_0x20f4('0x70')]>0x0){_0x13bab5[_0x20f4('0x70')]-=0x1;}else{logger[_0x20f4('0x95')](_0x20f4('0x99'));}}}else{logger[_0x20f4('0x95')](_0x20f4('0x9a'));}}function checkContactLowerLimitOriginate(_0x2bdb63,_0x597236,_0x3b1149){if(_0x597236>_0x3b1149){for(var _0x569aff=0x0;_0x569aff<_0x597236-_0x3b1149;_0x569aff+=0x1){decremetOriginate(_0x2bdb63);}}}function loggerGetContactDialer(_0x1099a4,_0x19a846,_0x29e90e){return function(_0x1a845a){checkContactLowerLimitOriginate(_0x19a846,_0x29e90e,0x0);logger[_0x20f4('0x95')](_0x1099a4,util['inspect'](_0x1a845a,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x2b80e5){return function(_0x10c953){if(isNotNull(_0x10c953)&&isNotNull(_0x10c953[0x0])){if(_0x10c953[0x0][_0x20f4('0x9b')]>0x0){_0x2b80e5[_0x20f4('0x3e')]=_0x20f4('0x9c');logger['info'](_0x20f4('0x9d')+_0x2b80e5[_0x20f4('0x40')],_0x10c953[0x0]['contactsRescheduled'],'contacts');}else{_0x2b80e5['message']='AVAILABLE_CONTACTS_FINISHED';logger[_0x20f4('0x7c')](_0x20f4('0x9e')+_0x2b80e5['name']);}}};}function notSendMessagesQueue(_0x55f15f){if(_0x55f15f['sendMessageOneNotActive']){freeVariablesPredictive(_0x55f15f);if(_0x55f15f[_0x20f4('0x70')]===0x0&&_0x55f15f[_0x20f4('0x9f')]===0x0&&_0x55f15f[_0x20f4('0x57')]===0x0&&(_0x55f15f[_0x20f4('0xa0')]||0x0)===0x0){_0x55f15f['sendMessageOneNotActive']=![];_0x55f15f[_0x20f4('0x4f')]=0x0;_0x55f15f[_0x20f4('0x3e')]=_0x20f4('0x41');loggerSyncQueueSummary[_0x20f4('0x95')](_0x20f4('0xa1'),_0x55f15f[_0x20f4('0x40')],_0x20f4('0xa2'));}else{_0x55f15f['message']=_0x20f4('0xa3');loggerSyncQueueSummary['error'](_0x20f4('0xa1'),_0x55f15f[_0x20f4('0x40')],_0x20f4('0xa4'));}emitVoiceQueueSummary(_0x55f15f);}}function notSendMessagesCampaign(_0x45a1cd){if(_0x45a1cd[_0x20f4('0xa5')]){if(_0x45a1cd[_0x20f4('0x70')]===0x0){_0x45a1cd[_0x20f4('0xa5')]=![];_0x45a1cd['message']='NOT_ACTIVE';loggerSyncQueueSummary['error']('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x45a1cd[_0x20f4('0x40')],_0x20f4('0xa2'));}else{_0x45a1cd[_0x20f4('0x3e')]=_0x20f4('0xa3');loggerSyncQueueSummary[_0x20f4('0x95')](_0x20f4('0xa6'),_0x45a1cd[_0x20f4('0x40')],_0x20f4('0xa4'));}emitCampaignSummary(_0x45a1cd);}}function createObjHistory(_0x7948cf,_0x22e4d2,_0x1ff9ec,_0x236bc0,_0x3b51ee){_0x7948cf[_0x20f4('0x3e')]=_0x1ff9ec;var _0x1a904b=new Action(_0x7948cf,_0x22e4d2);var _0x392759=new History(_0x1a904b);_0x392759[_0x20f4('0xa7')]=_0x236bc0;_0x392759['statedesc']=_0x3b51ee;_0x392759[_0x20f4('0xa8')]=_0x1a904b[_0x20f4('0xa9')];return _0x392759;}Dialer[_0x20f4('0x1b')]['loopClearZombieChannels']=function(){var _0x3e4694=this;setInterval(function(){_0x3e4694['clearZombieChannels'](_0x3e4694[_0x20f4('0x25')],_0x20f4('0xaa'));_0x3e4694[_0x20f4('0xab')](_0x3e4694[_0x20f4('0x24')],_0x20f4('0xac'));},0x32c8);};Dialer['prototype'][_0x20f4('0xab')]=function(_0xcad0e2,_0x10f1c3){var _0x5fa68c=this;for(var _0x3610d5 in _0xcad0e2){if(typeof _0xcad0e2[_0x3610d5]!==_0x20f4('0xad')){this[_0x20f4('0xae')][_0x20f4('0x1c')](function(){if(!_[_0x20f4('0xaf')](_0xcad0e2[_0x3610d5])){return ami['Action']({'action':_0x20f4('0xb0'),'channel':_0xcad0e2[_0x3610d5][_0x20f4('0xb1')]})[_0x20f4('0xb2')](function(_0x2b79fd){if(_0x2b79fd[_0x20f4('0x3e')]===_0x20f4('0xb3')){setTimeout(function(){if(_0xcad0e2[_0x3610d5]&&_0xcad0e2[_0x3610d5]['type']!==_0x20f4('0x79')){_0x5fa68c[_0x20f4('0xb4')](_0x5fa68c[_0x20f4('0x20')][_0xcad0e2[_0x3610d5][_0x20f4('0xb5')]]);logger[_0x20f4('0x95')](_0x20f4('0xb6'),_0x10f1c3,_0x3610d5,_0xcad0e2[_0x3610d5][_0x20f4('0xb5')]);delete _0xcad0e2[_0x3610d5];}if(_0xcad0e2[_0x3610d5]&&_0xcad0e2[_0x3610d5][_0x20f4('0x55')]==='ivr'){_0x5fa68c[_0x20f4('0xb4')](_0x5fa68c[_0x20f4('0x21')][_0xcad0e2[_0x3610d5][_0x20f4('0xb5')]]);logger['error'](_0x20f4('0xb7'),_0x10f1c3,_0x3610d5,_0xcad0e2[_0x3610d5][_0x20f4('0xb5')]);delete _0xcad0e2[_0x3610d5];}},0x2328);}});}});}}};Dialer[_0x20f4('0x1b')][_0x20f4('0xb8')]=function(_0xed9276){return BPromise['resolve']()[_0x20f4('0xb9')](cmHopper['countReScheduled'](_0xed9276))[_0x20f4('0xb2')](loggerCatch(_0x20f4('0xba')));};Dialer['prototype'][_0x20f4('0xbb')]=function(_0x4b1024){return BPromise[_0x20f4('0xbc')]()[_0x20f4('0xb9')](cmHopperBlack['checkIsBlackList'](_0x4b1024))['catch'](loggerCatch(_0x20f4('0xbd')));};Dialer[_0x20f4('0x1b')][_0x20f4('0xbe')]=function(_0x1e74d9,_0x1c898e,_0x3f50ce){return BPromise[_0x20f4('0xbc')]()[_0x20f4('0xb9')](cmHopperAdditionalPhone[_0x20f4('0xbe')](_0x1e74d9,_0x1c898e,_0x3f50ce))[_0x20f4('0xb2')](loggerCatch('[verifyAdditionalPhone]\x20'));};Dialer[_0x20f4('0x1b')][_0x20f4('0xbf')]=function(_0x35a3da,_0x1b87f7,_0x41f88d){return BPromise['resolve']()['then'](cmHopperAdditionalPhone[_0x20f4('0xbf')](_0x35a3da,_0x1b87f7,_0x41f88d))['catch'](loggerCatch('[swapAdditionalPhone]\x20'));};Dialer[_0x20f4('0x1b')][_0x20f4('0xc0')]=function(_0x232201){return BPromise[_0x20f4('0xbc')]()[_0x20f4('0xb9')](cmHopperBlack[_0x20f4('0xc0')](_0x232201))[_0x20f4('0xb2')](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer[_0x20f4('0x1b')]['averageHandleTime']=function(_0x2da7e3){return BPromise['resolve']()[_0x20f4('0xb9')](cmHopperHistory[_0x20f4('0xc1')](_0x2da7e3))[_0x20f4('0xb2')](loggerCatch(_0x20f4('0xc2')));};Dialer[_0x20f4('0x1b')]['rescheduleContact']=function(_0x549ff4){return BPromise[_0x20f4('0xbc')]()['then'](cmHopper[_0x20f4('0xc3')](_0x549ff4))[_0x20f4('0xb2')](loggerCatch(_0x20f4('0xc4')));};Dialer[_0x20f4('0x1b')][_0x20f4('0xc5')]=function(_0x4cf791,_0x51ce5e,_0x5dabdf){return BPromise['resolve']()[_0x20f4('0xb9')](cmHopper[_0x20f4('0xc5')](_0x4cf791,_0x51ce5e,_0x5dabdf))[_0x20f4('0xb2')](loggerCatch(_0x20f4('0xc6')));};Dialer['prototype'][_0x20f4('0xc7')]=function(_0x3d5b54,_0x25eb4e,_0x52913c,_0x47f6f9,_0x6ff074){return BPromise[_0x20f4('0xbc')]()['then'](cmHopper[_0x20f4('0xc7')](_0x3d5b54,_0x25eb4e,_0x52913c,_0x47f6f9))[_0x20f4('0xb2')](function(_0xb2ec91){_0x6ff074[_0x20f4('0xc8')]-=_0x52913c;_0x6ff074[_0x20f4('0xc8')]=_0x6ff074[_0x20f4('0xc8')]>0x0?_0x6ff074[_0x20f4('0xc8')]:0x0;loggerCatch(_0x20f4('0xc9'))(_0xb2ec91);});};Dialer['prototype'][_0x20f4('0xca')]=function(_0xbd4fb8,_0x3dbbe6,_0x4af2bd,_0x2642e7){return BPromise['resolve']()[_0x20f4('0xb9')](cmHopper[_0x20f4('0xca')](_0xbd4fb8,_0x3dbbe6,_0x4af2bd))[_0x20f4('0xb2')](function(_0x35fd3b){_0x2642e7[_0x20f4('0xc8')]-=_0x3dbbe6;_0x2642e7[_0x20f4('0xc8')]=_0x2642e7[_0x20f4('0xc8')]>0x0?_0x2642e7[_0x20f4('0xc8')]:0x0;loggerCatch('[getContactDialerIvr]\x20')(_0x35fd3b);});};Dialer[_0x20f4('0x1b')][_0x20f4('0xcb')]=function(_0x1eb6b9){return BPromise[_0x20f4('0xbc')]()[_0x20f4('0xb9')](voiceQueueRt[_0x20f4('0xcb')](_0x1eb6b9))[_0x20f4('0xb2')](loggerCatch(_0x20f4('0xcc')));};Dialer[_0x20f4('0x1b')]['moveContactManagedDialer']=function(_0x145612){return BPromise[_0x20f4('0xbc')]()[_0x20f4('0xb9')](cmHopper[_0x20f4('0xcd')](_0x145612))[_0x20f4('0xb2')](loggerCatch(_0x20f4('0xce')));};Dialer[_0x20f4('0x1b')][_0x20f4('0xcf')]=function(_0x425ea4){return BPromise[_0x20f4('0xbc')]()[_0x20f4('0xb9')](cmHopperHistory[_0x20f4('0xcf')](_0x425ea4))['catch'](loggerCatch('[createHistory]\x20'));};Dialer[_0x20f4('0x1b')][_0x20f4('0xb4')]=function(_0x5a69fa){if(!_[_0x20f4('0x85')](_0x5a69fa)&&_0x5a69fa!==null){if(typeof _0x5a69fa[_0x20f4('0x70')]!==_0x20f4('0xad')){if(_0x5a69fa['originated']>0x0){_0x5a69fa[_0x20f4('0x70')]-=0x1;}else{logger['error'](_0x20f4('0xd0'));}}}else{logger['error'](_0x20f4('0xd1'));}};Dialer[_0x20f4('0x1b')][_0x20f4('0xd2')]=function(_0x59f1d5,_0x47644d){var _0x609461=this;return function(_0x422f7f){_0x609461['updateOriginated'](_0x47644d);logger[_0x20f4('0x95')](_0x59f1d5,util['inspect'](_0x422f7f,{'showHidden':![],'depth':null}));};};Dialer['prototype']['emptyContact']=function(_0x381782,_0x71cf1f,_0x301a9b){var _0x542315={'state':0x19,'statedesc':_0x20f4('0xd3')};this[_0x20f4('0xb4')](_0x71cf1f);this[_0x20f4('0xd4')](_[_0x20f4('0x8e')](_0x542315,_[_0x20f4('0xd5')](_0x301a9b,[_0x20f4('0xd6'),'ListId',_0x20f4('0xd7'),_0x20f4('0xd8'),_0x20f4('0xd9')])),'[emptyContact][createHistory]',_0x20f4('0xda'));logger['error'](_0x381782);};Dialer[_0x20f4('0x1b')][_0x20f4('0xdb')]=function(_0x53d4f3){return _0x53d4f3===_0x20f4('0xdc');};Dialer['prototype'][_0x20f4('0xdd')]=function(_0x329ec0){return!_[_0x20f4('0x85')](_0x329ec0)&&_0x329ec0&&!_['isUndefined'](_0x329ec0['name'])&&!_[_0x20f4('0x85')](_0x329ec0[_0x20f4('0x74')])&&_0x329ec0['active']&&(this[_0x20f4('0xde')][util[_0x20f4('0x76')](_0x20f4('0xdf'),_0x329ec0['name'])][_0x20f4('0xb0')]===_0x20f4('0xe0')||this['trunks'][util['format'](_0x20f4('0xdf'),_0x329ec0[_0x20f4('0x40')])]['status']===_0x20f4('0xe1'));};Dialer['prototype'][_0x20f4('0xd4')]=function(_0x3f1c51,_0x296da4,_0x2d19c5){this[_0x20f4('0xcf')](_0x3f1c51)[_0x20f4('0xb2')](loggerCatch(_0x296da4));this['moveContactManagedDialer'](_0x3f1c51)[_0x20f4('0xb2')](loggerCatch(_0x2d19c5));};Dialer[_0x20f4('0x1b')]['syncVarSet']=function(_0x143f2d){var _0x4c74da=this[_0x20f4('0x25')][_0x143f2d[_0x20f4('0xe2')]];var _0x471cf7;if(!_[_0x20f4('0xaf')](_0x143f2d)&&!_[_0x20f4('0xaf')](_0x143f2d['variable'])&&!_[_0x20f4('0xaf')](_0x143f2d['variable']['amdstatus'])&&_0x143f2d[_0x20f4('0xe3')]==='xcally-motion-dialer'&&_0x4c74da){if(_0x4c74da['type']!==_0x20f4('0x79')&&this[_0x20f4('0x20')][_0x4c74da[_0x20f4('0xb5')]][_0x20f4('0xe4')]&&_0x143f2d[_0x20f4('0xe5')]===_0x20f4('0xe6')){delete this[_0x20f4('0x25')][_0x143f2d['uniqueid']];this[_0x20f4('0xb4')](this[_0x20f4('0x20')][_0x4c74da[_0x20f4('0xb5')]]);this[_0x20f4('0x20')][_0x4c74da['queue']][_0x20f4('0xe7')]+=0x1;this[_0x20f4('0x20')][_0x4c74da['queue']][_0x20f4('0x5e')]+=0x1;_0x471cf7=new Hangup(_0x4c74da,_0x143f2d);_0x471cf7[_0x20f4('0xa7')]=0x12;_0x471cf7['statedesc']=_0x20f4('0xe8');_0x471cf7['membername']=_0x20f4('0xe9');ami[_0x20f4('0x4c')](_0x20f4('0xea'),ut[_0x20f4('0xeb')](_0x471cf7,_0x20f4('0xec')));this['saveInDb'](_0x471cf7,'[syncHangupInAMD][createHistory]',_0x20f4('0xed'));}if(_0x4c74da[_0x20f4('0x55')]!==_0x20f4('0x79')&&this['voiceQueues'][_0x4c74da['queue']][_0x20f4('0xe4')]&&_0x143f2d[_0x20f4('0xe5')]===_0x20f4('0xee')){var _0x532fc0=this;return new BPromise(function(_0x565b7b,_0x453d9a){delete _0x532fc0[_0x20f4('0x25')][_0x143f2d[_0x20f4('0xe2')]];_0x532fc0[_0x20f4('0xb4')](_0x532fc0[_0x20f4('0x20')][_0x4c74da['queue']]);_0x532fc0[_0x20f4('0x20')][_0x4c74da[_0x20f4('0xb5')]][_0x20f4('0xe7')]+=0x1;_0x532fc0[_0x20f4('0x20')][_0x4c74da[_0x20f4('0xb5')]][_0x20f4('0x5e')]+=0x1;var _0x3c00e5=_0x532fc0[_0x20f4('0x20')][_0x4c74da[_0x20f4('0xb5')]];var _0x479592=new Hangup(_0x4c74da,_0x143f2d);_0x479592['state']=0x13;_0x479592['statedesc']=_0x20f4('0xef');_0x479592['membername']='AMD';_0x479592[_0x20f4('0xf0')]+=0x1;_0x479592[_0x20f4('0xf1')]+=0x1;_0x479592['amd']=!![];ami['emit'](_0x20f4('0xea'),ut['buildObj'](_0x479592,'amd'));_0x532fc0[_0x20f4('0xcf')](_0x479592)[_0x20f4('0xb2')](loggerCatch(_0x20f4('0xf2')));if(_0x479592[_0x20f4('0xf3')]+_0x479592[_0x20f4('0xf4')]+_0x479592[_0x20f4('0xf5')]+_0x479592[_0x20f4('0xf6')]+_0x479592[_0x20f4('0xf7')]+_0x479592[_0x20f4('0xf8')]+_0x479592[_0x20f4('0xf0')]+_0x479592['countagentrejectretry']>=_0x3c00e5['dialGlobalMaxRetry']){_0x532fc0[_0x20f4('0xf9')](_0x479592,_0x565b7b,_0x453d9a,_0x20f4('0xfa'));}else{if(_0x479592['countmachineretry']>=_0x3c00e5[_0x20f4('0xfb')]){_0x532fc0[_0x20f4('0xfc')](_0x479592,_0x565b7b,_0x453d9a,_0x20f4('0xfd'));}else{_0x532fc0[_0x20f4('0xc3')]({'active':![],'countmachineretry':_0x479592[_0x20f4('0xf0')],'scheduledat':moment()[_0x20f4('0xfe')](_0x3c00e5[_0x20f4('0xff')],_0x20f4('0x100'))[_0x20f4('0x76')](_0x20f4('0x101')),'ContactId':_0x479592[_0x20f4('0xd6')],'ListId':_0x479592[_0x20f4('0x102')],'VoiceQueueId':_0x479592[_0x20f4('0xd8')]||undefined,'CampaignId':_0x479592[_0x20f4('0xd9')]||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));_0x565b7b({'reschedule':0x1});}}});}if(_0x4c74da['type']==='ivr'&&this[_0x20f4('0x21')][_0x4c74da[_0x20f4('0xb5')]][_0x20f4('0xe4')]&&_0x143f2d[_0x20f4('0xe5')]===_0x20f4('0xe6')){delete this['uniqueId'][_0x143f2d[_0x20f4('0xe2')]];this[_0x20f4('0xb4')](this[_0x20f4('0x21')][_0x4c74da[_0x20f4('0xb5')]]);_0x471cf7=new Hangup(_0x4c74da,_0x143f2d);_0x471cf7['state']=0x12;_0x471cf7[_0x20f4('0x103')]=_0x20f4('0xe8');_0x471cf7[_0x20f4('0x104')]=_0x20f4('0xe9');ami[_0x20f4('0x4c')]('custom:amd',ut['buildObj'](_0x471cf7,_0x20f4('0xec')));this[_0x20f4('0xd4')](_0x471cf7,'[syncHangupInAMDIvr][createHistory]',_0x20f4('0x105'));}if(_0x4c74da[_0x20f4('0x55')]===_0x20f4('0x79')&&this['campaigns'][_0x4c74da[_0x20f4('0xb5')]][_0x20f4('0xe4')]&&_0x143f2d['value']==='MACHINE'){var _0x532fc0=this;return new BPromise(function(_0x3c869f,_0x312250){delete _0x532fc0['uniqueId'][_0x143f2d[_0x20f4('0xe2')]];_0x532fc0['updateOriginated'](_0x532fc0['campaigns'][_0x4c74da[_0x20f4('0xb5')]]);_0x532fc0[_0x20f4('0x21')][_0x4c74da[_0x20f4('0xb5')]]['outboundAnswerCallsDay']+=0x1;_0x532fc0[_0x20f4('0x21')][_0x4c74da['queue']][_0x20f4('0x5e')]+=0x1;var _0x4b72fd=_0x532fc0[_0x20f4('0x21')][_0x4c74da[_0x20f4('0xb5')]];var _0x6a0dd2=new Hangup(_0x4c74da,_0x143f2d);_0x6a0dd2[_0x20f4('0xa7')]=0x13;_0x6a0dd2[_0x20f4('0x103')]='Machine';_0x6a0dd2[_0x20f4('0x104')]=_0x20f4('0xe9');_0x6a0dd2[_0x20f4('0xf0')]+=0x1;_0x6a0dd2[_0x20f4('0xf1')]+=0x1;_0x6a0dd2[_0x20f4('0xec')]=!![];ami[_0x20f4('0x4c')](_0x20f4('0xea'),ut['buildObj'](_0x6a0dd2,_0x20f4('0xec')));_0x532fc0['createHistory'](_0x6a0dd2)[_0x20f4('0xb2')](loggerCatch(_0x20f4('0xf2')));if(_0x6a0dd2[_0x20f4('0xf3')]+_0x6a0dd2['countcongestionretry']+_0x6a0dd2['countnoanswerretry']+_0x6a0dd2[_0x20f4('0xf6')]+_0x6a0dd2[_0x20f4('0xf7')]+_0x6a0dd2[_0x20f4('0xf8')]+_0x6a0dd2['countmachineretry']+_0x6a0dd2['countagentrejectretry']>=_0x4b72fd['dialGlobalMaxRetry']){_0x532fc0[_0x20f4('0xf9')](_0x6a0dd2,_0x3c869f,_0x312250,_0x20f4('0xfa'));}else{if(_0x6a0dd2['countmachineretry']>=_0x4b72fd['dialMachineMaxRetry']){_0x532fc0[_0x20f4('0xfc')](_0x6a0dd2,_0x3c869f,_0x312250,_0x20f4('0xfd'));}else{_0x532fc0['rescheduleContact']({'active':![],'countmachineretry':_0x6a0dd2[_0x20f4('0xf0')],'scheduledat':moment()['add'](_0x4b72fd[_0x20f4('0xff')],'minutes')[_0x20f4('0x76')](_0x20f4('0x101')),'ContactId':_0x6a0dd2[_0x20f4('0xd6')],'ListId':_0x6a0dd2[_0x20f4('0x102')],'VoiceQueueId':_0x6a0dd2[_0x20f4('0xd8')]||undefined,'CampaignId':_0x6a0dd2[_0x20f4('0xd9')]||undefined})[_0x20f4('0xb2')](loggerCatch(_0x20f4('0x106')));_0x3c869f({'reschedule':0x1});}}});}}};Dialer[_0x20f4('0x1b')][_0x20f4('0x33')]=function(_0x5a7ec1){var _0x2c4813=this[_0x20f4('0x25')][_0x5a7ec1[_0x20f4('0xe2')]];var _0x232709=this;var _0x2ea15b;if(_0x2c4813&&_0x2c4813[_0x20f4('0x55')]===_0x20f4('0x79')){delete this[_0x20f4('0x25')][_0x5a7ec1[_0x20f4('0xe2')]];this[_0x20f4('0xb4')](this[_0x20f4('0x21')][_0x2c4813['queue']]);this[_0x20f4('0x21')][_0x2c4813[_0x20f4('0xb5')]][_0x20f4('0x107')]+=0x1;_0x2ea15b=new Hangup(_0x2c4813,_0x5a7ec1);this[_0x20f4('0xcf')](_0x2ea15b)['catch'](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x20f4('0xcd')](_0x2ea15b)[_0x20f4('0xb2')](loggerCatch(_0x20f4('0x108')));}if(_0x2c4813&&_0x2c4813[_0x20f4('0x55')]!==_0x20f4('0x79')&&isNotNull(this[_0x20f4('0x20')][_0x2c4813[_0x20f4('0xb5')]][_0x20f4('0x109')])){delete this['uniqueId'][_0x5a7ec1[_0x20f4('0xe2')]];this[_0x20f4('0xb4')](this['voiceQueues'][_0x2c4813[_0x20f4('0xb5')]]);this['voiceQueues'][_0x2c4813[_0x20f4('0xb5')]][_0x20f4('0xe7')]+=0x1;this[_0x20f4('0x20')][_0x2c4813[_0x20f4('0xb5')]][_0x20f4('0x5e')]+=0x1;_0x2ea15b=new Hangup(_0x2c4813,_0x5a7ec1);_0x2ea15b['state']=0x10;_0x2ea15b[_0x20f4('0x103')]=_0x20f4('0x10a');_0x2ea15b[_0x20f4('0x104')]='AGI';this[_0x20f4('0xcf')](_0x2ea15b)['catch'](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x20f4('0xcd')](_0x2ea15b)[_0x20f4('0xb2')](loggerCatch('[syncHangupIvr]'));}if(_0x2c4813&&_0x2c4813[_0x20f4('0x55')]!=='ivr'&&!isNotNull(this[_0x20f4('0x20')][_0x2c4813['queue']][_0x20f4('0x109')])){delete this[_0x20f4('0x25')][_0x5a7ec1['uniqueid']];this[_0x20f4('0xb4')](this[_0x20f4('0x20')][_0x2c4813['queue']]);this['voiceQueues'][_0x2c4813[_0x20f4('0xb5')]]['outboundUnknownCallsDay']+=0x1;_0x2ea15b=new Hangup(_0x2c4813,_0x5a7ec1);_0x2ea15b[_0x20f4('0xa7')]=0xc;_0x2ea15b['statedesc']=_0x5a7ec1[_0x20f4('0x10b')];_0x2ea15b[_0x20f4('0x104')]=_0x20f4('0x10c');this[_0x20f4('0xcf')](_0x2ea15b)[_0x20f4('0xb2')](loggerCatch(_0x20f4('0x10d')));this[_0x20f4('0xcd')](_0x2ea15b)['catch'](loggerCatch(_0x20f4('0x108')));}};Dialer[_0x20f4('0x1b')][_0x20f4('0x31')]=function(_0x51b64c){var _0x178cc5=this[_0x20f4('0x25')][_0x51b64c[_0x20f4('0xe2')]];var _0x457d57=this;if(this[_0x20f4('0x20')][_0x51b64c[_0x20f4('0xb5')]]){if(_0x178cc5&&_0x178cc5[_0x20f4('0x55')]!==_0x20f4('0x79')){delete this[_0x20f4('0x25')][_0x51b64c['uniqueid']];this[_0x20f4('0x20')][_0x51b64c[_0x20f4('0xb5')]][_0x20f4('0xe7')]+=0x1;var _0x583934=new AgentComplete(_0x178cc5,_0x51b64c);if(_0x51b64c[_0x20f4('0x10e')]===_0x20f4('0x10f')){_0x583934[_0x20f4('0x110')]=this[_0x20f4('0x20')][_0x51b64c['queue']]['dialQueueProject2']&&this[_0x20f4('0x20')][_0x51b64c[_0x20f4('0xb5')]]['dialAgiAfterHangupAgent']?moment()[_0x20f4('0x76')](_0x20f4('0x101')):undefined;}this['createHistory'](_0x583934)[_0x20f4('0xb2')](loggerCatch(_0x20f4('0x111')));this['moveContactManagedDialer'](_0x583934)['catch'](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0x20f4('0x1b')][_0x20f4('0x2c')]=function(_0x243d04){if(this['voiceQueues'][_0x243d04[_0x20f4('0xb5')]]){if(this[_0x20f4('0x25')][_0x243d04[_0x20f4('0xe2')]]&&this[_0x20f4('0x25')][_0x243d04['uniqueid']][_0x20f4('0x55')]!==_0x20f4('0x79')){this['updateOriginated'](this[_0x20f4('0x20')][_0x243d04[_0x20f4('0xb5')]]);this[_0x20f4('0x25')][_0x243d04[_0x20f4('0xe2')]][_0x20f4('0x112')]=moment()[_0x20f4('0x76')](_0x20f4('0x101'));}}};Dialer['prototype'][_0x20f4('0x113')]=function(_0x49c8dc,_0x4e4169){this['createHistory'](_0x49c8dc)[_0x20f4('0xb2')](loggerCatch(_0x20f4('0x111')));if(_0x4e4169==0x0){this[_0x20f4('0xcd')](_0x49c8dc)[_0x20f4('0xb2')](loggerCatch(_0x20f4('0x114')));}};Dialer['prototype']['syncQueueCallerAbandon']=function(_0x15bbdd){var _0x215b2e=this[_0x20f4('0x25')][_0x15bbdd['uniqueid']];var _0x514e9a=this;var _0x1ad9c5=![];var _0x38d786;var _0x22b4b2;if(this[_0x20f4('0x20')][_0x15bbdd[_0x20f4('0xb5')]]){if(_0x215b2e&&_0x215b2e[_0x20f4('0x55')]!==_0x20f4('0x79')){delete this[_0x20f4('0x25')][_0x15bbdd[_0x20f4('0xe2')]];this['updateOriginated'](this['voiceQueues'][_0x15bbdd['queue']]);_0x215b2e[_0x20f4('0x115')]=moment()[_0x20f4('0x76')]('YYYY-MM-DD\x20HH:mm:ss');var _0x4a9ece=new QueueCallerAbandon(_0x215b2e,_0x15bbdd);if(getSeconds(_0x215b2e[_0x20f4('0x115')],_0x215b2e[_0x20f4('0x116')])>=_0x215b2e['dialQueueTimeout']){this['voiceQueues'][_0x15bbdd['queue']]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0x20f4('0x20')][_0x15bbdd[_0x20f4('0xb5')]]['outboundDropCallsDayTimeout']+=0x1;this[_0x20f4('0x20')][_0x15bbdd['queue']][_0x20f4('0x6c')]+=0x1;_0x4a9ece[_0x20f4('0xa7')]=0xa;_0x4a9ece[_0x20f4('0x103')]='Drop';_0x4a9ece[_0x20f4('0x117')]=_0x20f4('0x118');_0x4a9ece[_0x20f4('0x110')]=this[_0x20f4('0x20')][_0x15bbdd['queue']][_0x20f4('0x119')]?moment()[_0x20f4('0x76')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x4a9ece[_0x20f4('0xf7')]+=0x1;_0x4a9ece[_0x20f4('0xf1')]+=0x1;_0x38d786=this['voiceQueues'][_0x15bbdd[_0x20f4('0xb5')]][_0x20f4('0x11a')];_0x22b4b2=this[_0x20f4('0x20')][_0x15bbdd[_0x20f4('0xb5')]][_0x20f4('0x11b')];_0x514e9a['verifyAdditionalPhones'](_0x4a9ece,_0x4a9ece['state'],_0x215b2e['voiceQueue'])[_0x20f4('0xb9')](function(_0x22fce2){_0x1ad9c5=_0x22fce2[_0x20f4('0x11c')]==0x1;if(_0x4a9ece[_0x20f4('0xf7')]>=_0x514e9a[_0x20f4('0x20')][_0x15bbdd[_0x20f4('0xb5')]]['dialDropMaxRetry']){_0x514e9a[_0x20f4('0x113')](_0x4a9ece,_0x22fce2[_0x20f4('0x11c')]);}else{_0x514e9a[_0x20f4('0xc3')]({'active':![],'countdropretry':_0x4a9ece['countdropretry'],'scheduledat':moment()['add'](_0x514e9a[_0x20f4('0x20')][_0x15bbdd[_0x20f4('0xb5')]][_0x20f4('0x11a')],'minutes')[_0x20f4('0x76')](_0x20f4('0x101')),'ContactId':_0x215b2e[_0x20f4('0xd6')],'ListId':_0x215b2e['ListId'],'VoiceQueueId':_0x215b2e[_0x20f4('0xd8')]||undefined,'CampaignId':_0x215b2e[_0x20f4('0xd9')]||undefined})[_0x20f4('0xb2')](loggerCatch('[rescheduleContact][Drop]'));var _0x224b09=new History(_0x4a9ece);_0x224b09[_0x20f4('0xa7')]=0xa;_0x224b09[_0x20f4('0x103')]=_0x20f4('0x11d');_0x224b09[_0x20f4('0xa9')]=moment()[_0x20f4('0x76')](_0x20f4('0x101'));_0x224b09[_0x20f4('0xa8')]=_0x224b09[_0x20f4('0xa9')];_0x224b09[_0x20f4('0x11e')]=_0x4a9ece['calleridname'];_0x224b09[_0x20f4('0x11f')]=_0x4a9ece['calleridnum'];_0x514e9a[_0x20f4('0xcf')](_0x224b09)['catch'](loggerCatch(_0x20f4('0x120')));}})[_0x20f4('0xb9')](function(_0x166224){if(_0x1ad9c5)_0x514e9a['swapAdditionalPhones'](_0x4a9ece,_0x38d786,_0x22b4b2)['then'](function(_0x1f3bfc){return 0x1;});});}else{this[_0x20f4('0x20')][_0x15bbdd[_0x20f4('0xb5')]][_0x20f4('0x69')]+=0x1;this[_0x20f4('0x20')][_0x15bbdd[_0x20f4('0xb5')]][_0x20f4('0x121')]+=0x1;_0x4a9ece[_0x20f4('0xa7')]=0xb;_0x4a9ece[_0x20f4('0x103')]='Abandoned';_0x4a9ece[_0x20f4('0x117')]=_0x20f4('0x122');_0x4a9ece[_0x20f4('0xf8')]+=0x1;_0x4a9ece[_0x20f4('0xf1')]+=0x1;_0x38d786=this[_0x20f4('0x20')][_0x15bbdd['queue']]['dialAbandonedRetryFrequency'];_0x22b4b2=this[_0x20f4('0x20')][_0x15bbdd[_0x20f4('0xb5')]][_0x20f4('0x11b')];_0x514e9a[_0x20f4('0xbe')](_0x4a9ece,_0x4a9ece[_0x20f4('0xa7')],_0x215b2e[_0x20f4('0x123')])['then'](function(_0x1a3084){if(_0x4a9ece[_0x20f4('0xf8')]>=_0x514e9a[_0x20f4('0x20')][_0x15bbdd[_0x20f4('0xb5')]]['dialAbandonedMaxRetry']){_0x514e9a[_0x20f4('0x113')](_0x4a9ece,_0x1a3084[_0x20f4('0x11c')]);}else{_0x514e9a[_0x20f4('0xc3')]({'active':![],'countabandonedretry':_0x4a9ece[_0x20f4('0xf8')],'scheduledat':moment()[_0x20f4('0xfe')](_0x514e9a['voiceQueues'][_0x15bbdd[_0x20f4('0xb5')]][_0x20f4('0x124')],'minutes')['format'](_0x20f4('0x101')),'ContactId':_0x215b2e[_0x20f4('0xd6')],'ListId':_0x215b2e[_0x20f4('0x102')],'VoiceQueueId':_0x215b2e[_0x20f4('0xd8')]||undefined,'CampaignId':_0x215b2e['CampaignId']||undefined})[_0x20f4('0xb2')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x7fca2c=new History(_0x4a9ece);_0x7fca2c[_0x20f4('0xa7')]=0xb;_0x7fca2c[_0x20f4('0x103')]=_0x20f4('0x125');_0x7fca2c[_0x20f4('0xa9')]=moment()[_0x20f4('0x76')](_0x20f4('0x101'));_0x7fca2c[_0x20f4('0xa8')]=_0x7fca2c[_0x20f4('0xa9')];_0x7fca2c['calleridname']=_0x4a9ece[_0x20f4('0x11e')];_0x7fca2c[_0x20f4('0x11f')]=_0x4a9ece[_0x20f4('0x11f')];_0x514e9a[_0x20f4('0xcf')](_0x7fca2c)[_0x20f4('0xb2')](loggerCatch(_0x20f4('0x126')));}})[_0x20f4('0xb9')](function(_0x32c996){if(_0x1ad9c5)_0x514e9a['swapAdditionalPhones'](_0x4a9ece,_0x38d786,_0x22b4b2)[_0x20f4('0xb9')](function(_0x295e38){return 0x1;});});}}}};Dialer[_0x20f4('0x1b')]['syncNewExten']=function(_0x116d3a){if(this['actions'][_0x116d3a[_0x20f4('0xe2')]]){this[_0x20f4('0x24')][_0x116d3a['uniqueid']]['channel']=_0x116d3a[_0x20f4('0xb1')];}if(this[_0x20f4('0x25')][_0x116d3a[_0x20f4('0xe2')]]){this[_0x20f4('0x25')][_0x116d3a[_0x20f4('0xe2')]][_0x20f4('0xb1')]=_0x116d3a[_0x20f4('0xb1')];}};Dialer[_0x20f4('0x1b')][_0x20f4('0x39')]=function(_0xb7e82b){if(strategy[this[_0x20f4('0x20')][this[_0x20f4('0x24')][_0xb7e82b[_0x20f4('0x127')]][_0x20f4('0xb5')]][_0x20f4('0x4e')]]==='roundrobin'){if(this[_0x20f4('0x24')][_0xb7e82b['actionid']]&&_[_0x20f4('0xaf')](this['actions'][_0xb7e82b[_0x20f4('0x127')]][_0x20f4('0x128')])&&_0xb7e82b[_0x20f4('0xb0')]==='1'&&_0xb7e82b[_0x20f4('0x129')]==='0'){if(this[_0x20f4('0x22')][_0xb7e82b[_0x20f4('0x12a')]]){if(!this[_0x20f4('0x22')][_0xb7e82b[_0x20f4('0x12a')]][_0x20f4('0x128')]){this[_0x20f4('0x22')][_0xb7e82b[_0x20f4('0x12a')]][_0x20f4('0x128')]=!![];this[_0x20f4('0x24')][_0xb7e82b['actionid']]['locked']=!![];this[_0x20f4('0x24')][_0xb7e82b[_0x20f4('0x127')]]['stateinterface']=_0xb7e82b['stateinterface'];}}}}else if((strategy[this[_0x20f4('0x20')][this[_0x20f4('0x24')][_0xb7e82b[_0x20f4('0x127')]][_0x20f4('0xb5')]][_0x20f4('0x4e')]]||_0x20f4('0x19'))==='rrmemory'){if(this[_0x20f4('0x24')][_0xb7e82b[_0x20f4('0x127')]]){if(this['agents'][_0xb7e82b[_0x20f4('0x12a')]]){this['actions'][_0xb7e82b[_0x20f4('0x127')]]['stateinterface']=_0xb7e82b[_0x20f4('0x12a')];if(_[_0x20f4('0xaf')](this[_0x20f4('0x2a')][this['actions'][_0xb7e82b['actionid']][_0x20f4('0xb5')]])){this[_0x20f4('0x2a')][this[_0x20f4('0x24')][_0xb7e82b['actionid']]['queue']]=[];}this[_0x20f4('0x2a')][this[_0x20f4('0x24')][_0xb7e82b[_0x20f4('0x127')]][_0x20f4('0xb5')]]['push'](_['merge'](_[_0x20f4('0xd5')](this[_0x20f4('0x24')][_0xb7e82b[_0x20f4('0x127')]],['idHopper',_0x20f4('0x12a')]),{'status':_0xb7e82b[_0x20f4('0xb0')],'paused':_0xb7e82b[_0x20f4('0x129')]}));}}}};function unlockQueueStatus(_0x17ed0b,_0xd4ae61){setTimeout(function(){if(_[_0x20f4('0x85')](_0x17ed0b[_0x20f4('0x12b')])){loggerBooked[_0x20f4('0x95')](_0x20f4('0x12c'),_0xd4ae61);}_0x17ed0b[_0x20f4('0x12b')]=!![];loggerBooked[_0x20f4('0x7c')](_0x20f4('0x12d'),_0xd4ae61,JSON[_0x20f4('0x48')](_[_0x20f4('0xd5')](_0x17ed0b,[_0x20f4('0x40'),_0x20f4('0x12b')])));},0x1f3);}Dialer[_0x20f4('0x1b')][_0x20f4('0x3b')]=function(_0x130f82){var _0x56ef08=this;var _0x317702=_0x56ef08[_0x20f4('0x20')][_0x56ef08['actions'][_0x130f82[_0x20f4('0x127')]]['queue']];if(strategy[this[_0x20f4('0x20')][this[_0x20f4('0x24')][_0x130f82[_0x20f4('0x127')]]['queue']]['strategy']]===_0x20f4('0x1a')){if(this[_0x20f4('0x24')][_0x130f82['actionid']]&&this[_0x20f4('0x24')][_0x130f82[_0x20f4('0x127')]][_0x20f4('0x12a')]){this[_0x20f4('0x1f')][_0x20f4('0x12e')](this['actions'][_0x130f82[_0x20f4('0x127')]][_0x20f4('0x12f')],this[_0x20f4('0x24')][_0x130f82['actionid']][_0x20f4('0x12a')])[_0x20f4('0xb2')](function(_0x59a97f){logger['error']('[Catch][Preview][syncQueueStatusComplete]',util[_0x20f4('0x97')](_0x59a97f,{'showHidden':![],'depth':null}));})[_0x20f4('0x1e')](function(){_0x56ef08[_0x20f4('0xb4')](_0x56ef08[_0x20f4('0x20')][_0x56ef08[_0x20f4('0x24')][_0x130f82[_0x20f4('0x127')]][_0x20f4('0xb5')]]);_0x56ef08['agents'][_0x56ef08[_0x20f4('0x24')][_0x130f82[_0x20f4('0x127')]][_0x20f4('0x12a')]][_0x20f4('0x128')]=![];delete _0x56ef08['actions'][_0x130f82[_0x20f4('0x127')]];unlockQueueStatus(_0x317702);});}else{this[_0x20f4('0xb4')](this[_0x20f4('0x20')][this['actions'][_0x130f82[_0x20f4('0x127')]][_0x20f4('0xb5')]]);this['rescheduleContact']({'active':![],'ContactId':this[_0x20f4('0x24')][_0x130f82[_0x20f4('0x127')]][_0x20f4('0xd6')],'ListId':this[_0x20f4('0x24')][_0x130f82['actionid']][_0x20f4('0x102')],'VoiceQueueId':this[_0x20f4('0x24')][_0x130f82[_0x20f4('0x127')]][_0x20f4('0xd8')]||undefined,'CampaignId':this[_0x20f4('0x24')][_0x130f82[_0x20f4('0x127')]]['CampaignId']||undefined})[_0x20f4('0xb2')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0x20f4('0x24')][_0x130f82['actionid']];unlockQueueStatus(_0x317702);}}else if((strategy[this[_0x20f4('0x20')][this[_0x20f4('0x24')][_0x130f82[_0x20f4('0x127')]][_0x20f4('0xb5')]]['strategy']]||_0x20f4('0x19'))===_0x20f4('0x19')){var _0x389e36;if(this[_0x20f4('0x24')][_0x130f82['actionid']]&&!_[_0x20f4('0x47')](this[_0x20f4('0x2a')][this['actions'][_0x130f82[_0x20f4('0x127')]][_0x20f4('0xb5')]])){if(this['queueBookedRR'][_0x56ef08[_0x20f4('0x24')][_0x130f82[_0x20f4('0x127')]][_0x20f4('0xb5')]]){this[_0x20f4('0x130')][_0x56ef08[_0x20f4('0x24')][_0x130f82['actionid']][_0x20f4('0xb5')]]=this['queueBookedRR'][this[_0x20f4('0x24')][_0x130f82[_0x20f4('0x127')]]['queue']]?this[_0x20f4('0x130')][this[_0x20f4('0x24')][_0x130f82[_0x20f4('0x127')]][_0x20f4('0xb5')]]:this[_0x20f4('0x2a')][this[_0x20f4('0x24')][_0x130f82[_0x20f4('0x127')]][_0x20f4('0xb5')]]?this[_0x20f4('0x2a')][this[_0x20f4('0x24')][_0x130f82[_0x20f4('0x127')]]['queue']][_0x20f4('0x131')]||0x0:0x0;}this[_0x20f4('0x2a')][this[_0x20f4('0x24')][_0x130f82[_0x20f4('0x127')]][_0x20f4('0xb5')]][_0x20f4('0x131')]=this['queueBookedRR'][this[_0x20f4('0x24')][_0x130f82['actionid']][_0x20f4('0xb5')]];for(var _0x43c2fb=0x0;_0x43c2fb=0x0;})[_0x20f4('0xb2')](myreject(_0x4bd7a6)));}}else{_0x3d309a[_0x20f4('0x14a')](ami[_0x20f4('0x14b')]({'action':_0x20f4('0x14c'),'command':util[_0x20f4('0x76')](_0x20f4('0x14d'),_0x594437,!_['isUndefined'](config[_0x20f4('0x146')][_0x269c79])?_0x269c79:'')})[_0x20f4('0xb9')](function(_0x3703b6){return _0x3703b6[_0x20f4('0x14f')][_0x20f4('0x150')](_0x20f4('0x151'))>=0x0;})['catch'](myreject(_0x4bd7a6)));}BPromise[_0x20f4('0x152')](_0x3d309a)[_0x20f4('0xb9')](function(_0x1269d2){var _0x5da52e=_['some'](_0x1269d2);if(_0x5da52e){return _0x20ddd9(_0x5da52e);}else{_0x4fc80a[_0x20f4('0x3e')]=_0x72d55a?_0x20f4('0x153'):_0x20f4('0x154');return _0x4bd7a6(msgResponse(_0x20f4('0x155'),_0x20f4('0x144'),_0x20f4('0x156')+_0x72d55a+'\x20'+_0x1dfc60+'\x20Interval\x20is\x20overtime:\x20'+util[_0x20f4('0x97')](_0x594437,{'showHidden':![],'depth':null})+_0x20f4('0x157')+_0x269c79));}})[_0x20f4('0xb2')](function(_0xdb00dd){return _0x4bd7a6(msgResponse(_0x20f4('0x140'),_0x20f4('0x144'),JSON[_0x20f4('0x48')](_0xdb00dd)));});});};Dialer['prototype'][_0x20f4('0x158')]=function(_0x48049f){var _0x50c16f=this;return function(){switch(_0x48049f[_0x20f4('0x5a')]){case _0x20f4('0x159'):freeVariablesPredictive(_0x48049f);_0x50c16f[_0x20f4('0x15a')](_0x48049f,0x1);break;case _0x20f4('0x15b'):freeVariablesPredictive(_0x48049f);_0x50c16f[_0x20f4('0x15a')](_0x48049f,_0x48049f[_0x20f4('0x15c')]);break;case'predictive':_0x50c16f[_0x20f4('0x8')](_0x48049f);break;case _0x20f4('0x15d'):freeVariablesPredictive(_0x48049f);_0x50c16f['handlePower'](_0x48049f,0x1);break;default:freeVariablesPredictive(_0x48049f);logger[_0x20f4('0x95')](_0x20f4('0x15e'),_0x48049f[_0x20f4('0x40')],_0x20f4('0x15f'));}};};Dialer[_0x20f4('0x1b')]['launchHandleIvr']=function(_0x5725f3){var _0x497967=this;return function(){_0x497967[_0x20f4('0x160')](_0x5725f3);};};Dialer[_0x20f4('0x1b')]['syncQueueSummary']=function(_0x4a9cdd){var _0x764b51=this;if(isNotPreview(_0x4a9cdd[_0x20f4('0x5a')])){if(isVoiceQueueOutbound(_0x4a9cdd[_0x20f4('0x55')])&&isActive(_0x4a9cdd['dialActive'])){_0x4a9cdd[_0x20f4('0xa5')]=!![];BPromise[_0x20f4('0xbc')]()[_0x20f4('0xb9')](checkIsLoggedIn(_0x4a9cdd,_0x4a9cdd[_0x20f4('0x50')]))[_0x20f4('0xb9')](checkIsActive(_0x4a9cdd,_0x4a9cdd[_0x20f4('0x59')]))['then'](checkInterval(_0x4a9cdd))[_0x20f4('0xb9')](_0x764b51[_0x20f4('0x161')](_0x4a9cdd))['then'](_0x764b51[_0x20f4('0x13f')](_0x4a9cdd[_0x20f4('0x162')],_0x4a9cdd['dialTimezone'],_0x4a9cdd['name'],_0x4a9cdd))[_0x20f4('0xb9')](_0x764b51[_0x20f4('0x141')](_0x4a9cdd[_0x20f4('0x43')],_0x4a9cdd['dialTimezone'],_0x4a9cdd[_0x20f4('0x40')],_0x4a9cdd))[_0x20f4('0xb9')](_0x764b51[_0x20f4('0x158')](_0x4a9cdd))[_0x20f4('0xb2')](loggerCatchQueueSummary('[syncQueueSummary]',_0x4a9cdd));}else{notSendMessagesQueue(_0x4a9cdd);}}else{freeVariablesPredictive(_0x4a9cdd);}};Dialer[_0x20f4('0x1b')][_0x20f4('0x163')]=function(){var _0x5ad8bd=this;var _0x38275d;for(var _0x23c816 in this[_0x20f4('0x21')]){if(typeof this[_0x20f4('0x21')][_0x23c816]!==_0x20f4('0xad')){_0x38275d=this[_0x20f4('0x21')][_0x23c816];if(isCampaignIvr(_0x38275d[_0x20f4('0x55')])&&isActive(_0x38275d['active'])){_0x38275d['sendMessageOneNotActive']=!![];BPromise[_0x20f4('0xbc')]()[_0x20f4('0xb9')](checkIsActive(_0x38275d,_0x38275d[_0x20f4('0x74')]))[_0x20f4('0xb9')](checkInterval(_0x38275d))[_0x20f4('0xb9')](_0x5ad8bd['checkIsTrunkReachable'](_0x38275d))[_0x20f4('0xb9')](_0x5ad8bd[_0x20f4('0x13f')](_0x38275d[_0x20f4('0x162')],_0x38275d[_0x20f4('0x164')],_0x38275d[_0x20f4('0x40')],_0x38275d))[_0x20f4('0xb9')](_0x5ad8bd['checkIfTimeIntervals'](_0x38275d[_0x20f4('0x43')],_0x38275d[_0x20f4('0x164')],_0x38275d[_0x20f4('0x40')],_0x38275d))[_0x20f4('0xb9')](_0x5ad8bd['launchHandleIvr'](_0x38275d))[_0x20f4('0xb2')](loggerCatchQueueSummary('[syncCampaigns]',_0x38275d));}else{notSendMessagesCampaign(_0x38275d);}}}};function getCallerIdRandom(_0x19cd67,_0x2b780b){var _0x499c9a;var _0x59cd47;var _0x58386f;if(_0x2b780b<=0x0){_0x2b780b=0x1;}_0x499c9a=new RegExp(_0x20f4('0x165')+_0x2b780b+'}$');_0x59cd47=Math[_0x20f4('0x166')](0xa,_0x2b780b-0x1);_0x58386f=Math[_0x20f4('0x166')](0xa,_0x2b780b)-0x1;return util['format']('%s',_[_0x20f4('0x167')](_0x19cd67,_0x499c9a,_[_0x20f4('0x168')](_0x59cd47,_0x58386f)));}function extractCalleridName(_0x4f3b71){var _0x57b778=_0x4f3b71[_0x20f4('0x169')](/"(.*?)"/);return _0x57b778?_0x57b778[0x1]:_0x4f3b71;}function extractCalleridNumber(_0x4ac020){var _0x246ead=_0x4ac020['match'](/<(.*?)>/);return _0x246ead?_0x246ead[0x1]:_0x4ac020;}Dialer[_0x20f4('0x1b')]['actionOriginate']=function(_0x46dd37,_0x2cfa6c){var _0x319e89=this;var _0x4e2a06=uuid['v4']();this[_0x20f4('0x24')][_0x4e2a06]=new Action(_0x46dd37,_0x2cfa6c,_0x4e2a06);return new BPromise(function(_0x5ae808,_0x2ff425){if(_['isUndefined'](_0x46dd37)&&typeof _0x46dd37!==_0x20f4('0x16a')){return _0x2ff425(msgResponse(_0x20f4('0x16b'),_0x20f4('0x144'),_0x20f4('0x16c')));}if(_[_0x20f4('0x85')](_0x2cfa6c['phone'])||_0x2cfa6c[_0x20f4('0x16d')]===null){return _0x2ff425(msgResponse('originate',_0x20f4('0x144'),_0x20f4('0x16e')));}var _0x54bfc3={'XMD-CALLERID':_0x319e89[_0x20f4('0x24')][_0x4e2a06]['getCaller'](),'XMD-AGI':_0x46dd37[_0x20f4('0x109')]?util['format'](_0x20f4('0x16f'),ipAgi,_0x46dd37['dialQueueProject']):_0x20f4('0x170'),'XMD-AGIAFTER':_0x46dd37[_0x20f4('0x119')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x46dd37[_0x20f4('0x119')]):_0x20f4('0x170'),'XMD-QUEUE':_0x46dd37['type']==='outbound'?util[_0x20f4('0x76')](_0x20f4('0x171'),_0x46dd37[_0x20f4('0x40')],_0x46dd37[_0x20f4('0x172')]||'',_0x46dd37[_0x20f4('0x173')]?'c':'',_0x46dd37[_0x20f4('0x174')]||0x3):_0x20f4('0x170'),'XMD-CONTACTID':_0x2cfa6c['ContactId'],'XMD-CDRTYPE':_0x20f4('0x7'),'CALLERID(all)':_0x319e89[_0x20f4('0x24')][_0x4e2a06][_0x20f4('0x175')](),'XMD-AMD':_0x46dd37[_0x20f4('0xe4')]?'ACTIVE':_0x20f4('0x170'),'XMD-DESTINATION':_0x20f4('0x176')};if(_0x46dd37[_0x20f4('0xe4')]){_0x54bfc3['XMD-AMDINITIALSILENCE']=_0x46dd37[_0x20f4('0x177')]||0x9c4;_0x54bfc3[_0x20f4('0x178')]=_0x46dd37[_0x20f4('0x179')]||0x5dc;_0x54bfc3[_0x20f4('0x17a')]=_0x46dd37[_0x20f4('0x17b')]||0x320;_0x54bfc3['XMD-AMDTOTALANALYSISTIME']=_0x46dd37['dialAMDTotalAnalysisTime']||0x1388;_0x54bfc3[_0x20f4('0x17c')]=_0x46dd37[_0x20f4('0x17d')]||0x64;_0x54bfc3[_0x20f4('0x17e')]=_0x46dd37[_0x20f4('0x17f')]||0x32;_0x54bfc3['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x46dd37[_0x20f4('0x180')]||0x3;_0x54bfc3['XMD-AMDSILENCETHRESHOLD']=_0x46dd37[_0x20f4('0x181')]||0x100;_0x54bfc3[_0x20f4('0x182')]=_0x46dd37[_0x20f4('0x183')]||0x1388;}if(_0x46dd37['type']==='outbound'){_0x54bfc3[_0x20f4('0x184')]=_0x2cfa6c[_0x20f4('0xd8')];}else{_0x54bfc3['XMD-CAMPAIGNID']=_0x2cfa6c['CampaignId'];}for(var _0x1091e3 in _0x2cfa6c[_0x20f4('0x185')]){if(typeof _0x2cfa6c[_0x20f4('0x185')][_0x1091e3]!=='undefined'){if(isNotNull(_0x2cfa6c[_0x20f4('0x185')][_0x1091e3])&&_0x1091e3!=='id'&&_0x1091e3!==_0x20f4('0x186')&&_0x1091e3!=='createdAt'&&_0x1091e3!==_0x20f4('0x187')){_0x54bfc3[util[_0x20f4('0x76')](_0x20f4('0x188'),_0x20f4('0x189'),_[_0x20f4('0x18a')](_0x1091e3))]=_0x2cfa6c['Contact'][_0x1091e3];}}}var _0x31ceb8=_0x319e89[_0x20f4('0xdd')](_0x46dd37[_0x20f4('0x73')])?getCallerId(_0x46dd37[_0x20f4('0x73')][_0x20f4('0x75')],_0x46dd37[_0x20f4('0x5b')],_0x46dd37['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x46dd37[_0x20f4('0x18b')],_0x46dd37[_0x20f4('0x18c')]):_0x46dd37[_0x20f4('0x18b')]):getCallerId(_[_0x20f4('0xaf')](_0x46dd37[_0x20f4('0x13d')])?_0x46dd37[_0x20f4('0x73')][_0x20f4('0x75')]:_0x46dd37[_0x20f4('0x13d')][_0x20f4('0x75')],_0x46dd37[_0x20f4('0x5b')],_0x46dd37['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x46dd37['dialOriginateCallerIdNumber'],_0x46dd37[_0x20f4('0x18c')]):_0x46dd37['dialOriginateCallerIdNumber']);if(_0x31ceb8){_0x54bfc3[_0x20f4('0x18d')]=_0x319e89[_0x20f4('0x24')][_0x4e2a06][_0x20f4('0x18e')]=extractCalleridName(_0x31ceb8);_0x54bfc3['XMD-ORIGINATECALLERIDNUM']=_0x2cfa6c[_0x20f4('0x16d')];}return ami[_0x20f4('0x14b')]({'actionid':_0x4e2a06,'action':_0x20f4('0x16b'),'channel':_0x319e89[_0x20f4('0xdd')](_0x46dd37[_0x20f4('0x73')])?util[_0x20f4('0x76')]('SIP/%s/%s%s',_0x46dd37[_0x20f4('0x73')][_0x20f4('0x40')],isNotNull(_0x46dd37[_0x20f4('0x5d')])?_0x46dd37[_0x20f4('0x5d')]['trim']()||'':'',_0x46dd37[_0x20f4('0x18f')]>0x0?_0x2cfa6c[_0x20f4('0x16d')][_0x20f4('0x190')](_0x46dd37[_0x20f4('0x18f')]):_0x2cfa6c[_0x20f4('0x16d')]):util[_0x20f4('0x76')](_0x20f4('0x191'),_[_0x20f4('0xaf')](_0x46dd37[_0x20f4('0x13d')])?_0x46dd37[_0x20f4('0x73')][_0x20f4('0x40')]:_0x46dd37['TrunkBackup']['name'],isNotNull(_0x46dd37[_0x20f4('0x5d')])?_0x46dd37[_0x20f4('0x5d')][_0x20f4('0x192')]()||'':'',_0x46dd37[_0x20f4('0x18f')]>0x0?_0x2cfa6c[_0x20f4('0x16d')][_0x20f4('0x190')](_0x46dd37['dialCutDigit']):_0x2cfa6c[_0x20f4('0x16d')]),'callerid':_0x31ceb8,'Exten':'xcally-motion-dialer','Context':_0x20f4('0x193'),'Priority':'1','variable':_0x54bfc3,'timeout':(_0x46dd37[_0x20f4('0x5c')]||0x1e)*0x3e8,'async':!![],'channelid':_0x4e2a06})[_0x20f4('0xb9')](function(_0x2c2f62){return _0x5ae808(_0x2c2f62);})['catch'](function(_0x3b3fed){_0x46dd37[_0x20f4('0x63')]+=0x1;var _0x31c56c=new History(_0x319e89[_0x20f4('0x24')][_0x4e2a06]);logger[_0x20f4('0x95')](util[_0x20f4('0x76')](_0x20f4('0x194'),JSON[_0x20f4('0x48')](_0x3b3fed)));_0x31c56c[_0x20f4('0xa7')]=0xe;_0x31c56c['statedesc']='OriginateError';_0x31c56c['starttime']=moment()[_0x20f4('0x76')](_0x20f4('0x101'));_0x31c56c['endtime']=_0x31c56c['starttime'];_0x319e89[_0x20f4('0xcf')](_0x31c56c)[_0x20f4('0xb2')](loggerCatch(_0x20f4('0x195')));_0x319e89['moveContactManagedDialer'](_0x31c56c)[_0x20f4('0xb2')](loggerCatch(_0x20f4('0x195')))['finally'](function(){delete _0x319e89['actions'][_0x4e2a06];return _0x2ff425(msgResponse('originate',_0x20f4('0x196'),_0x20f4('0x197')));});});});};Dialer['prototype'][_0x20f4('0x30')]=function(_0x1d9ada){var _0x4fbe24=this[_0x20f4('0x24')][_0x1d9ada[_0x20f4('0x127')]];if(_0x4fbe24){delete this[_0x20f4('0x24')][_0x1d9ada['actionid']];_0x4fbe24[_0x20f4('0x116')]=moment()[_0x20f4('0x76')](_0x20f4('0x101'));var _0x540076=_0x4fbe24[_0x20f4('0x55')]==='ivr'?this[_0x20f4('0x21')][_0x4fbe24['queue']]:this[_0x20f4('0x20')][_0x4fbe24[_0x20f4('0x198')]()];if(!this[_0x20f4('0xdb')](_0x1d9ada[_0x20f4('0x199')])){this[_0x20f4('0xb4')](_0x540076);return this[_0x20f4('0x19a')](_0x4fbe24,_0x540076,_0x1d9ada)['catch'](loggerCatch(_0x20f4('0x19b')));}this[_0x20f4('0x25')][_0x1d9ada[_0x20f4('0xe2')]]=_0x4fbe24;}};Dialer[_0x20f4('0x1b')][_0x20f4('0x19c')]=function(_0x4a7aa0,_0x1ca108,_0x4f902c){var _0x17d6ed=new History(_0x1ca108);if(_0x17d6ed['countbusyretry']+_0x17d6ed[_0x20f4('0xf4')]+_0x17d6ed[_0x20f4('0xf5')]+_0x17d6ed['countnosuchnumberretry']+_0x17d6ed[_0x20f4('0xf7')]+_0x17d6ed[_0x20f4('0xf8')]+_0x17d6ed['countmachineretry']+_0x17d6ed['countagentrejectretry']>=_0x4f902c[_0x20f4('0x19d')]-0x1){return!![];}switch(_0x4a7aa0){case 0x3:if(_0x17d6ed['countnoanswerretry']>=_0x4f902c[_0x20f4('0x19e')]-0x1){return!![];}this[_0x20f4('0xc3')]({'active':![],'countnoanswerretry':_0x17d6ed[_0x20f4('0xf5')]+=0x1,'scheduledat':moment()[_0x20f4('0xfe')](_0x4f902c['dialNoAnswerRetryFrequency'],_0x20f4('0x100'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x17d6ed[_0x20f4('0xd6')],'ListId':_0x17d6ed[_0x20f4('0x102')],'VoiceQueueId':_0x17d6ed[_0x20f4('0xd8')]||undefined,'CampaignId':_0x17d6ed[_0x20f4('0xd9')]||undefined})[_0x20f4('0xb2')](loggerCatch(_0x20f4('0x19f')));break;case 0x5:if(_0x17d6ed[_0x20f4('0xf3')]>=_0x4f902c[_0x20f4('0x1a0')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countbusyretry':_0x17d6ed[_0x20f4('0xf3')]+=0x1,'scheduledat':moment()['add'](_0x4f902c[_0x20f4('0x1a1')],_0x20f4('0x100'))['format'](_0x20f4('0x101')),'ContactId':_0x17d6ed[_0x20f4('0xd6')],'ListId':_0x17d6ed[_0x20f4('0x102')],'VoiceQueueId':_0x17d6ed[_0x20f4('0xd8')]||undefined,'CampaignId':_0x17d6ed[_0x20f4('0xd9')]||undefined})[_0x20f4('0xb2')](loggerCatch(_0x20f4('0x1a2')));break;case 0x8:if(_0x17d6ed[_0x20f4('0xf4')]>=_0x4f902c['dialCongestionMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countcongestionretry':_0x17d6ed['countcongestionretry']+=0x1,'scheduledat':moment()['add'](_0x4f902c[_0x20f4('0x1a3')],_0x20f4('0x100'))[_0x20f4('0x76')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x17d6ed[_0x20f4('0xd6')],'ListId':_0x17d6ed[_0x20f4('0x102')],'VoiceQueueId':_0x17d6ed[_0x20f4('0xd8')]||undefined,'CampaignId':_0x17d6ed['CampaignId']||undefined})[_0x20f4('0xb2')](loggerCatch(_0x20f4('0x1a4')));break;case 0x0:if(_0x17d6ed[_0x20f4('0xf6')]>=_0x4f902c[_0x20f4('0x1a5')]-0x1){return!![];}else{this[_0x20f4('0xc3')]({'active':![],'countnosuchnumberretry':_0x17d6ed['countnosuchnumberretry']+=0x1,'scheduledat':moment()['add'](_0x4f902c[_0x20f4('0x1a6')],_0x20f4('0x100'))['format'](_0x20f4('0x101')),'ContactId':_0x17d6ed[_0x20f4('0xd6')],'ListId':_0x17d6ed[_0x20f4('0x102')],'VoiceQueueId':_0x17d6ed[_0x20f4('0xd8')]||undefined,'CampaignId':_0x17d6ed[_0x20f4('0xd9')]||undefined})[_0x20f4('0xb2')](loggerCatch(_0x20f4('0x1a7')));}break;case 0xa:if(_0x17d6ed[_0x20f4('0xf7')]>=_0x4f902c[_0x20f4('0x1a8')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countdropretry':_0x17d6ed[_0x20f4('0xf7')]+=0x1,'scheduledat':moment()[_0x20f4('0xfe')](_0x4f902c['dialDropRetryFrequency'],_0x20f4('0x100'))[_0x20f4('0x76')](_0x20f4('0x101')),'ContactId':_0x17d6ed['ContactId'],'ListId':_0x17d6ed[_0x20f4('0x102')],'VoiceQueueId':_0x17d6ed[_0x20f4('0xd8')]||undefined,'CampaignId':_0x17d6ed['CampaignId']||undefined})[_0x20f4('0xb2')](loggerCatch(_0x20f4('0x1a9')));break;case 0xb:if(_0x17d6ed[_0x20f4('0xf8')]>=_0x4f902c['dialAbandonedMaxRetry']-0x1){return!![];}this[_0x20f4('0xc3')]({'active':![],'countabandonedretry':_0x17d6ed[_0x20f4('0xf8')]+=0x1,'scheduledat':moment()[_0x20f4('0xfe')](_0x4f902c['dialAbandonedRetryFrequency'],_0x20f4('0x100'))['format'](_0x20f4('0x101')),'ContactId':_0x17d6ed['ContactId'],'ListId':_0x17d6ed[_0x20f4('0x102')],'VoiceQueueId':_0x17d6ed[_0x20f4('0xd8')]||undefined,'CampaignId':_0x17d6ed[_0x20f4('0xd9')]||undefined})[_0x20f4('0xb2')](loggerCatch(_0x20f4('0x1aa')));break;case 0x13:if(_0x17d6ed[_0x20f4('0xf0')]>=_0x4f902c[_0x20f4('0xfb')]-0x1){return!![];}this[_0x20f4('0xc3')]({'active':![],'countmachineretry':_0x17d6ed[_0x20f4('0xf0')]+=0x1,'scheduledat':moment()[_0x20f4('0xfe')](_0x4f902c['dialMachineRetryFrequency'],_0x20f4('0x100'))[_0x20f4('0x76')](_0x20f4('0x101')),'ContactId':_0x17d6ed[_0x20f4('0xd6')],'ListId':_0x17d6ed['ListId'],'VoiceQueueId':_0x17d6ed[_0x20f4('0xd8')]||undefined,'CampaignId':_0x17d6ed['CampaignId']||undefined})[_0x20f4('0xb2')](loggerCatch(_0x20f4('0x106')));break;case 0x14:if(_0x17d6ed[_0x20f4('0x1ab')]>=_0x4f902c[_0x20f4('0x1ac')]-0x1){return!![];}this[_0x20f4('0xc3')]({'active':![],'countagentrejectretry':_0x17d6ed[_0x20f4('0x1ab')]+=0x1,'scheduledat':moment()[_0x20f4('0xfe')](_0x4f902c['dialAgentRejectRetryFrequency'],_0x20f4('0x100'))[_0x20f4('0x76')](_0x20f4('0x101')),'ContactId':_0x17d6ed[_0x20f4('0xd6')],'ListId':_0x17d6ed[_0x20f4('0x102')],'VoiceQueueId':_0x17d6ed[_0x20f4('0xd8')]||undefined,'CampaignId':_0x17d6ed['CampaignId']||undefined})[_0x20f4('0xb2')](loggerCatch(_0x20f4('0x1ad')));break;default:return!![];}};Dialer[_0x20f4('0x1b')][_0x20f4('0x19a')]=function(_0x5d1833,_0x11c4ad,_0x39b706){var _0x64cc89=this;var _0x55cee9=new History(_0x5d1833);var _0x50c871=![];var _0x3dff48;var _0x4e0246;return new BPromise(function(_0x4ef4ac,_0xd62bf9){if(_['isUndefined'](_0x11c4ad)&&typeof _0x11c4ad!=='object'){return _0xd62bf9(msgResponse('[callProgressDetecting]',_0x20f4('0x144'),'entity\x20is\x20undefine'));}if(_[_0x20f4('0x85')](_0x39b706)&&typeof _0x39b706!==_0x20f4('0x16a')){return _0xd62bf9(msgResponse(_0x20f4('0x1ae'),_0x20f4('0x144'),_0x20f4('0x1af')));}_0x64cc89['verifyAdditionalPhones'](_0x55cee9,_0x39b706[_0x20f4('0x10e')],_0x11c4ad)['then'](function(_0x322e72){if(_0x322e72[_0x20f4('0x11c')]==0x1)_0x50c871=!![];switch(_0x39b706['reason']){case'0':_0x11c4ad[_0x20f4('0x1b0')]+=0x1;_0x55cee9['state']=0x0;_0x55cee9['statedesc']=_0x20f4('0x1b1');_0x55cee9['countnosuchnumberretry']+=0x1;_0x55cee9[_0x20f4('0xf1')]+=0x1;ami['emit'](_0x20f4('0x1b2'),ut[_0x20f4('0xeb')](_0x5d1833,_0x20f4('0x1b3')));_0x3dff48=_0x11c4ad[_0x20f4('0x1a6')];_0x4e0246=_0x11c4ad[_0x20f4('0x11b')];_0x64cc89[_0x20f4('0xcf')](_0x55cee9)[_0x20f4('0xb2')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x64cc89['checkRetriveMax'](0x0,_0x5d1833,_0x11c4ad)&&!_0x50c871){if(_0x55cee9[_0x20f4('0xf6')]>=_0x11c4ad['dialNoSuchNumberMaxRetry']){_0x64cc89[_0x20f4('0xfc')](_0x55cee9,_0x4ef4ac,_0xd62bf9,'reason\x200\x20no\x20such\x20number....');}else{_0x64cc89['stateGlobal'](_0x55cee9,_0x4ef4ac,_0xd62bf9,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x11c4ad[_0x20f4('0x62')]+=0x1;_0x55cee9[_0x20f4('0xa7')]=0x3;_0x55cee9[_0x20f4('0x103')]=_0x20f4('0x1b4');_0x55cee9['countnoanswerretry']+=0x1;_0x55cee9[_0x20f4('0xf1')]+=0x1;ami[_0x20f4('0x4c')](_0x20f4('0x1b5'),ut[_0x20f4('0xeb')](_0x5d1833,_0x20f4('0x1b6')));_0x3dff48=_0x11c4ad[_0x20f4('0x1b7')];_0x4e0246=_0x11c4ad[_0x20f4('0x11b')];_0x64cc89['createHistory'](_0x55cee9)[_0x20f4('0xb2')](loggerCatch(_0x20f4('0x1b8')));if(_0x64cc89['checkRetriveMax'](0x3,_0x5d1833,_0x11c4ad)&&!_0x50c871){if(_0x55cee9[_0x20f4('0xf5')]>=_0x11c4ad[_0x20f4('0x19e')]){_0x64cc89[_0x20f4('0xfc')](_0x55cee9,_0x4ef4ac,_0xd62bf9,_0x20f4('0x1b9'));}else{_0x64cc89[_0x20f4('0xf9')](_0x55cee9,_0x4ef4ac,_0xd62bf9,_0x20f4('0x1b9'));}}break;case'5':_0x11c4ad['outboundBusyCallsDay']+=0x1;_0x55cee9[_0x20f4('0xa7')]=0x5;_0x55cee9[_0x20f4('0x103')]=_0x20f4('0x1ba');_0x55cee9['countbusyretry']+=0x1;_0x55cee9['countglobal']+=0x1;ami[_0x20f4('0x4c')](_0x20f4('0x1bb'),ut[_0x20f4('0xeb')](_0x5d1833,_0x20f4('0x1bc')));_0x3dff48=_0x11c4ad[_0x20f4('0x1a1')];_0x4e0246=_0x11c4ad[_0x20f4('0x11b')];_0x64cc89[_0x20f4('0xcf')](_0x55cee9)[_0x20f4('0xb2')](loggerCatch(_0x20f4('0x1bd')));if(_0x64cc89[_0x20f4('0x19c')](0x5,_0x5d1833,_0x11c4ad)&&!_0x50c871){if(_0x55cee9[_0x20f4('0xf3')]>=_0x11c4ad[_0x20f4('0x1a0')]){_0x64cc89[_0x20f4('0xfc')](_0x55cee9,_0x4ef4ac,_0xd62bf9,_0x20f4('0x1be'));}else{_0x64cc89[_0x20f4('0xf9')](_0x55cee9,_0x4ef4ac,_0xd62bf9,_0x20f4('0x1be'));}}break;case'8':_0x11c4ad[_0x20f4('0x60')]+=0x1;_0x55cee9[_0x20f4('0xa7')]=0x8;_0x55cee9['statedesc']=_0x20f4('0x1bf');_0x55cee9['countcongestionretry']+=0x1;_0x55cee9[_0x20f4('0xf1')]+=0x1;_0x3dff48=_0x11c4ad[_0x20f4('0x1a3')];_0x4e0246=_0x11c4ad[_0x20f4('0x11b')];ami['emit']('custom:agentcongestion',ut[_0x20f4('0xeb')](_0x5d1833,_0x20f4('0x1c0')));_0x64cc89[_0x20f4('0xcf')](_0x55cee9)[_0x20f4('0xb2')](loggerCatch(_0x20f4('0x1c1')));if(_0x64cc89[_0x20f4('0x19c')](0x8,_0x5d1833,_0x11c4ad)&&!_0x50c871){if(_0x55cee9[_0x20f4('0xf4')]>=_0x11c4ad[_0x20f4('0x1c2')]){_0x64cc89[_0x20f4('0xfc')](_0x55cee9,_0x4ef4ac,_0xd62bf9,_0x20f4('0x1c3'));}else{_0x64cc89[_0x20f4('0xf9')](_0x55cee9,_0x4ef4ac,_0xd62bf9,_0x20f4('0x1c3'));}}break;case'11':_0x11c4ad['outboundAbandonedCallsDay']+=0x1;_0x55cee9['state']=0xb;_0x55cee9[_0x20f4('0x103')]=_0x20f4('0x125');_0x55cee9[_0x20f4('0xf8')]+=0x1;_0x55cee9['countglobal']+=0x1;_0x3dff48=_0x11c4ad['dialAbandonedRetryFrequency'];_0x4e0246=_0x11c4ad[_0x20f4('0x11b')];_0x64cc89[_0x20f4('0xcf')](_0x55cee9)[_0x20f4('0xb2')](loggerCatch(_0x20f4('0x126')));if(_0x64cc89['checkRetriveMax'](0xb,_0x5d1833,_0x11c4ad)&&!_0x50c871){if(_0x55cee9[_0x20f4('0xf8')]>=_0x11c4ad[_0x20f4('0x1c4')]){_0x64cc89['createStateFinal'](_0x55cee9,_0x4ef4ac,_0xd62bf9,'reason\x2011\x20abandoned');}else{_0x64cc89[_0x20f4('0xf9')](_0x55cee9,_0x4ef4ac,_0xd62bf9,_0x20f4('0x1c5'));}}break;case'20':_0x11c4ad[_0x20f4('0x65')]+=0x1;_0x55cee9['state']=0x14;_0x55cee9[_0x20f4('0x103')]='AgentReject';_0x55cee9[_0x20f4('0x1ab')]+=0x1;_0x55cee9[_0x20f4('0xf1')]+=0x1;_0x3dff48=_0x11c4ad[_0x20f4('0x1c6')];_0x4e0246=_0x11c4ad[_0x20f4('0x11b')];ami['emit']('custom:agentreject',ut['buildObj'](_0x5d1833,'agentreject'));_0x64cc89[_0x20f4('0xcf')](_0x55cee9)[_0x20f4('0xb2')](loggerCatch(_0x20f4('0x1c7')));if(_0x64cc89['checkRetriveMax'](0x14,_0x5d1833,_0x11c4ad)&&!_0x50c871){if(_0x55cee9[_0x20f4('0x1ab')]>=_0x11c4ad[_0x20f4('0x1ac')]){_0x64cc89[_0x20f4('0xfc')](_0x55cee9,_0x4ef4ac,_0xd62bf9,_0x20f4('0x1c8'));}else{_0x64cc89[_0x20f4('0xf9')](_0x55cee9,_0x4ef4ac,_0xd62bf9,_0x20f4('0x1c8'));}}break;default:_0x11c4ad['outboundUnknownCallsDay']+=0x1;_0x55cee9[_0x20f4('0xa7')]=0xc;_0x55cee9[_0x20f4('0x103')]=_0x39b706[_0x20f4('0x10e')];_0x3dff48=_0x11c4ad[_0x20f4('0x1c6')];_0x4e0246=_0x11c4ad[_0x20f4('0x11b')];_0x64cc89[_0x20f4('0xcf')](_0x55cee9)[_0x20f4('0xb2')](loggerCatch(_0x20f4('0x1c9')));if(_0x64cc89[_0x20f4('0x19c')](_0x39b706[_0x20f4('0x10e')],_0x5d1833,_0x11c4ad)&&!_0x50c871){if(_0x55cee9['countbusyretry']+_0x55cee9[_0x20f4('0xf4')]+_0x55cee9['countnoanswerretry']+_0x55cee9[_0x20f4('0xf6')]+_0x55cee9[_0x20f4('0xf7')]+_0x55cee9[_0x20f4('0xf8')]+_0x55cee9[_0x20f4('0xf0')]+_0x55cee9[_0x20f4('0x1ab')]>=_0x11c4ad[_0x20f4('0x19d')]){_0x64cc89[_0x20f4('0xf9')](_0x55cee9,_0x4ef4ac,_0xd62bf9,_0x39b706[_0x20f4('0x10e')]);}else{_0x64cc89[_0x20f4('0xfc')](_0x55cee9,_0x4ef4ac,_0xd62bf9,_0x39b706[_0x20f4('0x10e')]);}}}})[_0x20f4('0xb9')](function(_0xf8e64a){if(_0x50c871){_0x64cc89['swapAdditionalPhones'](_0x55cee9,_0x3dff48,_0x4e0246)[_0x20f4('0xb9')](function(_0x3d63d9){return _0x4ef4ac(0x1);});}});});};Dialer[_0x20f4('0x1b')]['stateGlobal']=function(_0x5132c3,_0x3f29cc,_0x58074a,_0x474393){var _0x1ba93a=new Final(_0x5132c3);_0x1ba93a[_0x20f4('0xa7')]=0xf;_0x1ba93a[_0x20f4('0x103')]=_0x20f4('0x1ca');this['createStateFinal'](_0x1ba93a,_0x3f29cc,_0x58074a,_0x474393);};Dialer[_0x20f4('0x1b')][_0x20f4('0xfc')]=function(_0x569362,_0xb540f4,_0x2c4f4c,_0x147090){this[_0x20f4('0xcd')](_0x569362)[_0x20f4('0xb9')](function(){return _0xb540f4(msgResponse(_0x20f4('0x1ae'),_0x20f4('0xdc'),_0x147090));})['catch'](function(){return _0x2c4f4c(msgResponse(_0x20f4('0x1cb'),_0x20f4('0x144'),_0x20f4('0x1cc')));});};Dialer[_0x20f4('0x1b')][_0x20f4('0x8')]=function(_0x3887f0){var _0x49cdc8=_0x3887f0['dialPredictiveOptimizationPercentage']/0x64;var _0x37ac54=_0x3887f0['outboundDropCallsDayTimeout']/(_0x3887f0['outboundDropCallsDayTimeout']+_0x3887f0[_0x20f4('0xe7')]);var _0x1c869b=Math[_0x20f4('0x1cd')](_0x3887f0[_0x20f4('0x1ce')]*(_0x3887f0[_0x20f4('0x1cf')]/0x64));var _0x202fbc=Math[_0x20f4('0x1cd')](_0x3887f0['predictiveIntervalAvailable']*(_0x3887f0['predictiveIntervalMinThreshold']/0x64));var _0x496a00=_0x3887f0['available']+_0x3887f0[_0x20f4('0x9f')];var _0x4c6e73=Math[_0x20f4('0x1d0')](_0x3887f0[_0x20f4('0x71')]*_0x3887f0[_0x20f4('0x8b')]*_0x3887f0[_0x20f4('0x1d1')]*_0x3887f0[_0x20f4('0x6d')]);if(_[_0x20f4('0x85')](_0x3887f0[_0x20f4('0x28')])){if(!_[_0x20f4('0x85')](_0x3887f0['startPredictive'])){_0x3887f0[_0x20f4('0x27')]=undefined;loggerPredictive['error'](_0x20f4('0x1d2'),_0x20f4('0x1d3'));}if(!_[_0x20f4('0x85')](_0x3887f0[_0x20f4('0x91')])){loggerPredictive[_0x20f4('0x95')]('[startMethodPredictive][StartProgressive]',_0x20f4('0x1d4'));clearInterval(_0x3887f0['handlePredictive']);_0x3887f0[_0x20f4('0x91')]=undefined;}_0x3887f0[_0x20f4('0x28')]=moment()[_0x20f4('0x76')](_0x20f4('0x101'));loggerPredictive[_0x20f4('0x7c')](_0x3887f0[_0x20f4('0x40')],_0x20f4('0x1d5'),_0x3887f0[_0x20f4('0x28')]);this[_0x20f4('0x15a')](_0x3887f0,0x1);}else if(ifInterval(_0x3887f0[_0x20f4('0x1d6')],_0x3887f0[_0x20f4('0x28')])){this['handlePower'](_0x3887f0,0x1);loggerPredictiveCalls[_0x20f4('0x7c')](_0x20f4('0x1d7'),_0x3887f0[_0x20f4('0x28')],_0x3887f0['name']);_0x3887f0[_0x20f4('0x71')]=0x0;_0x3887f0[_0x20f4('0x6c')]=0x0;}else if(_0x49cdc8<_0x37ac54&&_0x3887f0['dialPredictiveOptimization']===_0x20f4('0x1d8')){freeVariablesPredictive(_0x3887f0);loggerPredictive[_0x20f4('0x7c')](_0x20f4('0x1d9'),_0x20f4('0x1da'),_0x37ac54,_0x20f4('0x28'),_0x3887f0[_0x20f4('0x40')]);}else if(_0x4c6e73<_0x3887f0[_0x20f4('0x6c')]&&_0x3887f0[_0x20f4('0x1db')]===_0x20f4('0x1d8')){freeVariablesPredictive(_0x3887f0);loggerPredictive[_0x20f4('0x7c')](_0x20f4('0x1dc'),_0x20f4('0x1dd'),_0x4c6e73,'Drop\x20in\x20this\x20interval',_0x3887f0['predictiveIntervalErlangCallsDroppedCalls'],'startProgressive',_0x3887f0[_0x20f4('0x40')]);}else if(!ifInterval(_0x3887f0[_0x20f4('0x1d6')],_0x3887f0[_0x20f4('0x28')])&&_[_0x20f4('0x85')](_0x3887f0[_0x20f4('0x27')])&&!_[_0x20f4('0x85')](_0x3887f0[_0x20f4('0x28')])){_0x3887f0[_0x20f4('0x27')]=moment()[_0x20f4('0x76')](_0x20f4('0x101'));loggerPredictive[_0x20f4('0x7c')](_0x3887f0[_0x20f4('0x40')],'started\x20in\x20predictive\x20at',_0x3887f0[_0x20f4('0x27')]);this[_0x20f4('0x1de')](_0x3887f0['dialPredictiveInterval'])[_0x20f4('0xb9')](this[_0x20f4('0x1df')](_0x3887f0))[_0x20f4('0xb9')](mergeDataErlangB(_0x3887f0))[_0x20f4('0xb9')](this[_0x20f4('0x1e0')](_0x3887f0))[_0x20f4('0xb2')](loggerCatchPredictive(_0x20f4('0x1e1'),_0x3887f0));}else if(!ifInterval(_0x3887f0[_0x20f4('0x1d6')],_0x3887f0[_0x20f4('0x27')])){_0x3887f0['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x3887f0[_0x20f4('0x27')]=moment()[_0x20f4('0x76')](_0x20f4('0x101'));loggerPredictive[_0x20f4('0x7c')](_0x3887f0[_0x20f4('0x40')],_0x20f4('0x1e2'),_0x3887f0[_0x20f4('0x27')]);clearInterval(_0x3887f0['handlePredictive']);_0x3887f0[_0x20f4('0x91')]=undefined;this['averageHandleTime'](_0x3887f0[_0x20f4('0x1d6')])[_0x20f4('0xb9')](this[_0x20f4('0x1df')](_0x3887f0))['then'](mergeDataErlangB(_0x3887f0))[_0x20f4('0xb9')](this[_0x20f4('0x1e0')](_0x3887f0))['catch'](loggerCatchPredictive(_0x20f4('0x1e3'),_0x3887f0));}else if(_0x3887f0['predictiveIntervalAvailable']&&_0x496a00<_0x3887f0[_0x20f4('0x1ce')]-_0x202fbc){freeVariablesPredictive(_0x3887f0);loggerPredictive['info'](_0x3887f0[_0x20f4('0x40')],_0x20f4('0x1e4'),_0x496a00,_0x20f4('0x1e5'),_0x3887f0[_0x20f4('0x1ce')],'-',_0x202fbc,'=',_0x3887f0[_0x20f4('0x1ce')]-_0x202fbc,')');}else if(_0x3887f0[_0x20f4('0x1ce')]&&_0x496a00>_0x3887f0['predictiveIntervalAvailable']+_0x1c869b){freeVariablesPredictive(_0x3887f0);loggerPredictive[_0x20f4('0x7c')](_0x3887f0[_0x20f4('0x40')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x496a00,')\x20are\x20more\x20than\x20threshold\x20(',_0x3887f0[_0x20f4('0x1ce')],'+',_0x1c869b,'=',_0x3887f0[_0x20f4('0x1ce')]+_0x1c869b,')');}};Dialer['prototype'][_0x20f4('0x1df')]=function(_0x167cc8){var _0x4df750=this;return function(_0x31283c){return new BPromise(function(_0x49cc5e,_0x4e2d49){_[_0x20f4('0x8e')](_0x167cc8,_0x31283c[0x0]);if(checkGetDataPredictive(_0x31283c[0x0])){var _0x372756=_0x167cc8[_0x20f4('0x1ce')]=_0x167cc8[_0x20f4('0x9f')]+_0x167cc8[_0x20f4('0x4f')];var _0x1de5d2=_0x167cc8[_0x20f4('0x1d6')]*0x3c;var _0x241149=_0x31283c[0x0][_0x20f4('0x68')]+_0x31283c[0x0][_0x20f4('0x67')];var _0x2e4297=(_0x31283c[0x0][_0x20f4('0x80')]+_0x31283c[0x0][_0x20f4('0x6a')]+_0x31283c[0x0][_0x20f4('0x69')])/_0x31283c[0x0][_0x20f4('0x6f')];_0x167cc8['predictiveIntervalHitRate']=_0x2e4297>0x0?_0x2e4297:0x1;switch(_0x167cc8[_0x20f4('0x1db')]){case'dropRate':var _0x7283b3=_0x167cc8[_0x20f4('0x1e6')]/0x64;return _0x4df750[_0x20f4('0x1e7')](_0x372756,_0x1de5d2,_0x241149,_0x2e4297,_0x7283b3)['then'](function(_0x1db12e){return _0x49cc5e(_0x1db12e);});case'agentBusyFactor':var _0x19615a=_0x167cc8[_0x20f4('0x1e6')]/0x64;return _0x4df750[_0x20f4('0x1e8')](_0x372756,_0x1de5d2,_0x241149,_0x2e4297,_0x19615a)[_0x20f4('0xb9')](function(_0x23bc19){return _0x49cc5e(_0x23bc19);});default:return _0x4e2d49(msgResponse(_0x20f4('0x1e9'),'Failure',_0x20f4('0x1ea')));}}else{return _0x4e2d49(msgResponse(_0x20f4('0x1e9'),_0x20f4('0x144'),_0x20f4('0x1eb')));}});};};Dialer[_0x20f4('0x1b')][_0x20f4('0x1ec')]=function(_0x15aaa4){var _0x2583d8=this;return function(_0xf36e7){return new BPromise(function(_0xf089a2,_0x6ee248){_[_0x20f4('0x8e')](_0x15aaa4,_0xf36e7[0x0]);if(checkGetDataPredictive(_0xf36e7[0x0])){loggerPredictive['info'](JSON[_0x20f4('0x48')](_0xf36e7[0x0]));if(_0x15aaa4[_0x20f4('0x1db')]==='dropRate'){return _0x2583d8[_0x20f4('0xcb')](_0x15aaa4['id'])['then'](function(_0xfa7cb0){var _0x310e8f=_0x15aaa4[_0x20f4('0x50')]-_0xfa7cb0[0x0][_0x20f4('0x1ed')];var _0x55a2fa=_0x15aaa4['dialPredictiveInterval']*0x3c;var _0x4ac3a5=_0xf36e7[0x0][_0x20f4('0x68')]+_0xf36e7[0x0][_0x20f4('0x67')];var _0x38634f=(_0xf36e7[0x0][_0x20f4('0x80')]+_0xf36e7[0x0][_0x20f4('0x6a')]+_0xf36e7[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0xf36e7[0x0][_0x20f4('0x6f')];var _0x56a457=_0x15aaa4['dialPredictiveOptimizationPercentage']/0x64;_0x15aaa4[_0x20f4('0x6e')]=_0xfa7cb0[0x0][_0x20f4('0x1ed')]||0x0;_0x15aaa4[_0x20f4('0x1d1')]=_0x38634f>0x0?_0x38634f:0x1;return _0x2583d8['abandonmentRate'](_0x310e8f,_0x55a2fa,_0x4ac3a5,_0x38634f,_0x56a457);})[_0x20f4('0xb9')](function(_0x8d5563){return _0xf089a2(_0x8d5563);})[_0x20f4('0xb2')](function(_0x317318){return _0x6ee248(msgResponse(_0x20f4('0x1ee'),'Failure',JSON['stringify'](_0x317318)));});}if(_0x15aaa4['dialPredictiveOptimization']===_0x20f4('0x1ef')){return _0x2583d8['getVoiceQueueRtPauses'](_0x15aaa4['id'])[_0x20f4('0xb9')](function(_0x29803b){var _0x2e94c1=_0x15aaa4[_0x20f4('0x50')]-_0x29803b[0x0][_0x20f4('0x1ed')];var _0x1a7aa3=_0x15aaa4[_0x20f4('0x1d6')]*0x3c;var _0x524271=_0xf36e7[0x0]['predictiveIntervalAvgTalktime']+_0xf36e7[0x0][_0x20f4('0x67')];var _0x57e329=(_0xf36e7[0x0][_0x20f4('0x80')]+_0xf36e7[0x0][_0x20f4('0x6a')]+_0xf36e7[0x0][_0x20f4('0x69')])/_0xf36e7[0x0][_0x20f4('0x6f')];var _0x4a7736=_0x15aaa4[_0x20f4('0x1e6')]/0x64;_0x15aaa4[_0x20f4('0x6e')]=_0x29803b[0x0][_0x20f4('0x1ed')]||0x0;_0x15aaa4[_0x20f4('0x1d1')]=_0x57e329>0x0?_0x57e329:0x1;return _0x2583d8[_0x20f4('0x1e8')](_0x2e94c1,_0x1a7aa3,_0x524271,_0x57e329,_0x4a7736);})[_0x20f4('0xb9')](function(_0x554975){return _0xf089a2(_0x554975);})[_0x20f4('0xb2')](function(_0x2bdbdb){return _0x6ee248(msgResponse(_0x20f4('0x1ee'),'Failure',JSON[_0x20f4('0x48')](_0x2bdbdb)));});}}else{return _0x6ee248(msgResponse('[getDataPredictive]','Failure',_0x20f4('0x1eb')));}});};};Dialer[_0x20f4('0x1b')][_0x20f4('0x1e0')]=function(_0x738455){var _0x310964=this;return function(){var _0x3a30cc=0x0;var _0x407f5e=Math[_0x20f4('0x1d0')](_0x738455[_0x20f4('0x1f0')]*0x3e8);if(_0x407f5e>0x0){_0x407f5e=_0x407f5e<0x64?0x64:_0x407f5e;loggerPredictive['info'](_0x738455['name'],'one\x20call\x20every:',_0x407f5e,_0x20f4('0x49'));_0x738455[_0x20f4('0x91')]=setInterval(function(){_0x310964[_0x20f4('0x91')](_0x738455);loggerPredictiveCalls[_0x20f4('0x7c')](_0x20f4('0x1f1'),_0x3a30cc+=0x1);},_0x407f5e);}else{loggerPredictive[_0x20f4('0x7c')](_0x738455[_0x20f4('0x40')],_0x20f4('0x1f2'));}};};Dialer[_0x20f4('0x1b')][_0x20f4('0x1f3')]=function(_0x33b878,_0x23ca47){var _0x1ef19b=this;return function(_0x3063c4){if(_[_0x20f4('0x47')](_0x3063c4)){if(_[_0x20f4('0xaf')](_0x23ca47[_0x20f4('0xd7')])||!_0x23ca47[_0x20f4('0x1f4')]){if(_0x33b878['dialMethod']===_0x20f4('0x15d')){_0x33b878['queueStatusComplete']=_[_0x20f4('0x85')](_0x33b878[_0x20f4('0x12b')])?!![]:_0x33b878[_0x20f4('0x12b')];var _0xe7be6c=uuid['v4']();_0x1ef19b[_0x20f4('0x24')][_0xe7be6c]=new Action(_0x33b878,_0x23ca47,_0xe7be6c);loggerBooked[_0x20f4('0x7c')](_0x20f4('0x1f5'),_0xe7be6c,_0x20f4('0x1f6'),JSON[_0x20f4('0x48')](_0x33b878[_0x20f4('0x12b')]),_0x20f4('0x1f7'),_0x33b878[_0x20f4('0x40')]);if(_0x33b878[_0x20f4('0x12b')]){_0x33b878['queueStatusComplete']=![];_0x1ef19b[_0x20f4('0x2a')][_0x1ef19b[_0x20f4('0x24')][_0xe7be6c]['queue']]=[];ami[_0x20f4('0x14b')]({'actionid':_0xe7be6c,'action':_0x20f4('0x1f8'),'queue':_0x33b878[_0x20f4('0x40')]})[_0x20f4('0xb2')](function(){_0x1ef19b[_0x20f4('0xb4')](_0x33b878);_0x1ef19b[_0x20f4('0xc3')]({'active':![],'ContactId':_0x1ef19b['actions'][_0xe7be6c][_0x20f4('0xd6')],'ListId':_0x1ef19b[_0x20f4('0x24')][_0xe7be6c][_0x20f4('0x102')],'VoiceQueueId':_0x1ef19b[_0x20f4('0x24')][_0xe7be6c][_0x20f4('0xd8')]||undefined,'CampaignId':_0x1ef19b[_0x20f4('0x24')][_0xe7be6c][_0x20f4('0xd9')]||undefined})[_0x20f4('0xb2')](loggerCatch(_0x20f4('0x1f9')));delete _0x1ef19b[_0x20f4('0x24')][_0xe7be6c];});}else{loggerBooked[_0x20f4('0x7c')](_0x20f4('0x1fa'),JSON[_0x20f4('0x48')](_0x33b878[_0x20f4('0x12b')]),_0x20f4('0x1f7'),_0x33b878[_0x20f4('0x40')]);_0x1ef19b[_0x20f4('0xb4')](_0x33b878);_0x1ef19b[_0x20f4('0xc3')]({'active':![],'ContactId':_0x1ef19b[_0x20f4('0x24')][_0xe7be6c][_0x20f4('0xd6')],'ListId':_0x1ef19b['actions'][_0xe7be6c]['ListId'],'VoiceQueueId':_0x1ef19b[_0x20f4('0x24')][_0xe7be6c][_0x20f4('0xd8')]||undefined,'CampaignId':_0x1ef19b[_0x20f4('0x24')][_0xe7be6c][_0x20f4('0xd9')]||undefined})[_0x20f4('0xb2')](loggerCatch(_0x20f4('0x1f9')));delete _0x1ef19b[_0x20f4('0x24')][_0xe7be6c];}}else{return _0x1ef19b[_0x20f4('0x1fb')](_0x33b878,_0x23ca47);}}else{if(getDiff(_0x23ca47[_0x20f4('0x1fc')])<_0x33b878[_0x20f4('0x1fd')]*0x3c){if(_0x23ca47[_0x20f4('0x1fe')]&&!_0x23ca47[_0x20f4('0x1fe')][_0x20f4('0x1ff')]){_0x1ef19b[_0x20f4('0x1f')][_0x20f4('0x12e')](_0x23ca47['id'])[_0x20f4('0x1e')](function(){_0x1ef19b['updateOriginated'](_0x33b878);});}else{_0x1ef19b['unlockContact']({'active':![]},_0x23ca47['id'],0x1)[_0x20f4('0x1e')](function(){_0x1ef19b[_0x20f4('0xb4')](_0x33b878);});}}else{_0x33b878[_0x20f4('0x64')]+=0x1;_0x1ef19b[_0x20f4('0xb4')](_0x33b878);if(_0x33b878[_0x20f4('0x200')]){_0x1ef19b['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x23ca47[_0x20f4('0xd6')],'ListId':_0x23ca47[_0x20f4('0x102')],'VoiceQueueId':_0x23ca47[_0x20f4('0xd8')]||undefined,'CampaignId':_0x23ca47[_0x20f4('0xd9')]||undefined})[_0x20f4('0xb2')](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x1ef19b[_0x20f4('0xcf')](createObjHistory(_0x33b878,_0x23ca47,_0x20f4('0x201'),0x17,_0x20f4('0x202')))['catch'](loggerCatch(_0x20f4('0x203')));}else{_0x1ef19b['saveInDb'](createObjHistory(_0x33b878,_0x23ca47,_0x20f4('0x204'),0x16,'RecallFailedTimeout'),_0x20f4('0x205'),_0x20f4('0x206'));}}}}else{_0x33b878['outboundBlacklistCallsDay']+=0x1;_0x1ef19b[_0x20f4('0xd4')](createObjHistory(_0x33b878,_0x23ca47,_0x20f4('0x207'),0xd,_0x20f4('0x208')),_0x20f4('0x209'),_0x20f4('0x20a'));throw _0x20f4('0x20b');}};};Dialer[_0x20f4('0x1b')][_0x20f4('0x160')]=function(_0x173c64){var _0x27c91a=this;var _0x302a51=_0x173c64[_0x20f4('0x20c')]-_0x173c64[_0x20f4('0x70')]-_0x173c64[_0x20f4('0xc8')];emitCampaignSummary(_0x173c64);if(_0x302a51>0x0){if(_0x302a51>this[_0x20f4('0x23')]){_0x302a51=this[_0x20f4('0x23')];}_0x173c64[_0x20f4('0xc8')]+=_0x302a51;this[_0x20f4('0xca')](_0x173c64['id'],_0x302a51,_0x173c64[_0x20f4('0x20d')],_0x173c64)[_0x20f4('0xb9')](function(_0x589286){_0x173c64[_0x20f4('0xc8')]-=_0x302a51;_0x173c64[_0x20f4('0xc8')]=_0x173c64['temp']>0x0?_0x173c64[_0x20f4('0xc8')]:0x0;if(!checkContactEmpty(_0x589286)){_0x173c64['message']=_0x20f4('0x20e');logger[_0x20f4('0x7c')](_0x20f4('0x20f')+_0x173c64['name']);}else{_0x173c64[_0x20f4('0x70')]+=_0x589286[_0x20f4('0x98')];_0x173c64[_0x20f4('0x3e')]=_0x20f4('0x210');for(var _0x338c46=0x0;_0x338c46<_0x589286[_0x20f4('0x98')];_0x338c46+=0x1){_0x173c64[_0x20f4('0x211')]+=0x1;if(_['isNil'](_0x589286[_0x338c46])||_[_0x20f4('0xaf')](_0x589286[_0x338c46]['Contact'])||_[_0x20f4('0xaf')](_0x589286[_0x338c46][_0x20f4('0x16d')])){_0x27c91a[_0x20f4('0x212')](_0x20f4('0x213'),_0x173c64,_0x589286[_0x338c46]);}else{_0x27c91a[_0x20f4('0xc0')](_['pick'](_0x589286[_0x338c46],[_0x20f4('0xd9'),_0x20f4('0x214')]))['then'](_0x27c91a[_0x20f4('0x1f3')](_0x173c64,_0x589286[_0x338c46]))[_0x20f4('0xb2')](_0x27c91a[_0x20f4('0xd2')](_0x20f4('0x215'),_0x173c64));}}}})[_0x20f4('0xb2')](loggerGetContactDialer(_0x20f4('0x216'),_0x173c64,_0x302a51));}};Dialer[_0x20f4('0x1b')]['handlePower']=function(_0x262350,_0x5a31e8){var _0x4e7ca5=this;var _0x52a7e1=[];var _0x3e1d8b=_0x5a31e8>=0x1?_0x5a31e8:0x1;if(_0x262350['dialMethod']===_0x20f4('0x15d')){_0x3e1d8b=0x1;}var _0x32362c=Math[_0x20f4('0x1d0')](_0x262350['available']*_0x3e1d8b)-_0x262350[_0x20f4('0x70')]-_0x262350[_0x20f4('0xc8')];emitVoiceQueueSummary(_0x262350);if(_0x262350[_0x20f4('0x217')]>0x0){var _0x4a6095=_0x262350['dialLimitQueue']-_0x262350[_0x20f4('0x70')]-_0x262350[_0x20f4('0x9f')]-_0x262350[_0x20f4('0xc8')]-_0x262350[_0x20f4('0xa0')];if(_0x32362c>_0x4a6095){_0x32362c=_0x4a6095;}}if(_0x32362c>0x0){if(_0x262350[_0x20f4('0x5a')]==='booked'){_0x32362c=0x1;}if(_0x32362c>this[_0x20f4('0x23')]){_0x32362c=this['maxNumberOriginate'];}_0x262350['temp']+=_0x32362c;for(var _0x3d9568 in this[_0x20f4('0x22')]){if(typeof this[_0x20f4('0x22')][_0x3d9568]!==_0x20f4('0xad')){if(this[_0x20f4('0x22')][_0x3d9568][_0x20f4('0xa7')]==='not_inuse'&&this['agents'][_0x3d9568][_0x20f4('0xb0')]===_0x20f4('0xe0')){_0x52a7e1[_0x20f4('0x14a')](this[_0x20f4('0x22')][_0x3d9568]['id']);}}}this[_0x20f4('0xc7')](_0x262350['id'],_0x52a7e1,_0x32362c,_0x262350['dialOrderByScheduledAt'],_0x262350)[_0x20f4('0xb9')](function(_0x2c4c6e){_0x262350[_0x20f4('0xc8')]-=_0x32362c;_0x262350['temp']=_0x262350['temp']>0x0?_0x262350['temp']:0x0;if(!checkContactEmpty(_0x2c4c6e)){_0x4e7ca5[_0x20f4('0xb8')](_0x262350)[_0x20f4('0xb9')](sendMessageReschedule(_0x262350))[_0x20f4('0xb2')](loggerCatch(_0x20f4('0xba')));}else{_0x262350[_0x20f4('0x70')]+=_0x2c4c6e[_0x20f4('0x98')];_0x262350['message']=_0x262350[_0x20f4('0x5a')]===_0x20f4('0x15d')?_0x20f4('0x218'):_0x20f4('0x210');for(var _0x1f26ca=0x0;_0x1f26ca<_0x2c4c6e['length'];_0x1f26ca+=0x1){if(_[_0x20f4('0xaf')](_0x2c4c6e[_0x1f26ca])||_[_0x20f4('0xaf')](_0x2c4c6e[_0x1f26ca][_0x20f4('0x185')])||_['isNil'](_0x2c4c6e[_0x1f26ca]['phone'])){_0x4e7ca5[_0x20f4('0x212')](_0x20f4('0x213'),_0x262350,_0x2c4c6e[_0x1f26ca]);}else{_0x4e7ca5[_0x20f4('0xbb')](_['pick'](_0x2c4c6e[_0x1f26ca],[_0x20f4('0xd8'),_0x20f4('0x214')]))[_0x20f4('0xb9')](_0x4e7ca5['checkContactBlack'](_0x262350,_0x2c4c6e[_0x1f26ca]))['catch'](_0x4e7ca5[_0x20f4('0xd2')](_0x20f4('0x213'),_0x262350));}}}})[_0x20f4('0xb2')](loggerGetContactDialer(_0x20f4('0x219'),_0x262350,_0x32362c));}};Dialer[_0x20f4('0x1b')]['handlePredictive']=function(_0x4fc0d1){if(_0x4fc0d1[_0x20f4('0x217')]>0x0){var _0x224ce0=_0x4fc0d1[_0x20f4('0x217')]-_0x4fc0d1['originated']-_0x4fc0d1[_0x20f4('0x9f')];if(_0x224ce0>0x0){this[_0x20f4('0x21a')](_0x4fc0d1);}else{loggerPredictiveCalls[_0x20f4('0x7c')](_0x20f4('0x21b'));}}else{this[_0x20f4('0x21a')](_0x4fc0d1);}};Dialer[_0x20f4('0x1b')]['tryOriginatePredictive']=function(_0x19f747){var _0x61627e=this;var _0x23ff66=[];_0x19f747['originated']+=0x1;for(var _0xef1ebd in this['agents']){if(typeof this[_0x20f4('0x22')][_0xef1ebd]!==_0x20f4('0xad')){if(this[_0x20f4('0x22')][_0xef1ebd][_0x20f4('0xa7')]===_0x20f4('0x21c')&&this[_0x20f4('0x22')][_0xef1ebd]['status']===_0x20f4('0xe0')){_0x23ff66[_0x20f4('0x14a')](this[_0x20f4('0x22')][_0xef1ebd]['id']);}}}this['getContactDialer'](_0x19f747['id'],_0x23ff66,0x1,_0x19f747['dialOrderByScheduledAt'],_0x19f747)[_0x20f4('0xb9')](function(_0x10b3bd){if(!checkContactEmpty(_0x10b3bd)){checkContactLowerLimitOriginate(_0x19f747,0x1,0x0);_0x61627e['countReScheduled'](_0x19f747)['then'](sendMessageReschedule(_0x19f747))['catch'](loggerCatch(_0x20f4('0xba')));}else{_0x19f747[_0x20f4('0x3e')]=_0x20f4('0x210');if(_[_0x20f4('0xaf')](_0x10b3bd[0x0])||_[_0x20f4('0xaf')](_0x10b3bd[0x0][_0x20f4('0x185')])||_[_0x20f4('0xaf')](_0x10b3bd[0x0][_0x20f4('0x16d')])){_0x61627e[_0x20f4('0x212')](_0x20f4('0x213'),_0x19f747,_0x10b3bd[0x0]);}else{_0x61627e['checkIsBlackList'](_['pick'](_0x10b3bd[0x0],[_0x20f4('0xd8'),_0x20f4('0x214')]))[_0x20f4('0xb9')](_0x61627e[_0x20f4('0x1f3')](_0x19f747,_0x10b3bd[0x0]))['catch'](_0x61627e[_0x20f4('0xd2')](_0x20f4('0x21d'),_0x19f747));}}})[_0x20f4('0xb2')](loggerGetContactDialer('[getContactDialerPredictive]',_0x19f747,0x1));emitVoiceQueueSummary(_0x19f747);};Dialer[_0x20f4('0x1b')][_0x20f4('0x1e7')]=function(_0x4401eb,_0x470273,_0x3ae3bc,_0xd72ed9,_0x9d0b72,_0x4d5d55){loggerPredictive[_0x20f4('0x7c')](_0x20f4('0x21e'));loggerPredictive['info'](_0x20f4('0x21f'),_0x4401eb);loggerPredictive[_0x20f4('0x7c')](_0x20f4('0x220'),_0x470273);loggerPredictive[_0x20f4('0x7c')]('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',_0x3ae3bc);loggerPredictive['info'](_0x20f4('0x221'),_0xd72ed9);loggerPredictive[_0x20f4('0x7c')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x9d0b72);loggerPredictive[_0x20f4('0x7c')]('---------------------------');return new BPromise(function(_0x54182c,_0x3684fd){if(_0x4401eb<=0x0||isNaN(_0x4401eb)){return _0x3684fd(msgResponse(_0x20f4('0x222'),_0x20f4('0x196'),'m\x20=\x20'+_0x4401eb));}if(_0x3ae3bc<=0x0||isNaN(_0x3ae3bc)){return _0x3684fd(msgResponse('[abandonmentRate]',_0x20f4('0x196'),'Ts\x20=\x20'+_0x3ae3bc));}if(_0xd72ed9<=0x0||isNaN(_0xd72ed9)){return _0x3684fd(msgResponse(_0x20f4('0x222'),_0x20f4('0x196'),_0x20f4('0x223')+_0xd72ed9));}if(_0x470273<=0x0||isNaN(_0x470273)){return _0x3684fd(msgResponse(_0x20f4('0x222'),_0x20f4('0x196'),_0x20f4('0x224')+_0x470273));}if(_0x9d0b72<=0x0||isNaN(_0x9d0b72)){return _0x3684fd(msgResponse(_0x20f4('0x222'),_0x20f4('0x196'),'Amax\x20=\x20'+_0x9d0b72));}_0x4d5d55=_0x4d5d55||0x0;var _0x518048=0x1/_0x3ae3bc;var _0x23b51d=0x0;var _0x25635e=0x0;var _0x24cd08=0x0;var _0x367ece=0x0;for(var _0x4456ab=0x0;_0x24cd08<_0x9d0b72;_0x4456ab+=0x1){_0x25635e=_0x4456ab/_0x470273;_0x23b51d=(_0xd72ed9*_0x25635e+_0x4d5d55)/_0x518048;_0x24cd08=erlangb(_0x23b51d,_0x4401eb);_0x367ece=_0x23b51d/_0x4401eb*(0x1-erlangb(_0x23b51d,_0x4401eb));}return _0x54182c({'erlangCalls':_0x4456ab,'erlangCallToSecond':_0x470273/_0x4456ab,'erlangAbandonmentRate':_0x24cd08,'erlangBusyFactor':_0x367ece});});};Dialer[_0x20f4('0x1b')][_0x20f4('0x1e8')]=function(_0x2189bc,_0x3e9967,_0x3bb483,_0x2ead66,_0x2ec844,_0x2f54f0){loggerPredictive['info']('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive['info'](_0x20f4('0x21f'),_0x2189bc);loggerPredictive[_0x20f4('0x7c')](_0x20f4('0x220'),_0x3e9967);loggerPredictive[_0x20f4('0x7c')]('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',_0x3bb483);loggerPredictive[_0x20f4('0x7c')](_0x20f4('0x221'),_0x2ead66);loggerPredictive[_0x20f4('0x7c')](_0x20f4('0x225'),_0x2ec844);loggerPredictive[_0x20f4('0x7c')](_0x20f4('0x8d'));return new BPromise(function(_0x3029ee,_0x222cb5){if(_0x2189bc<=0x0||isNaN(_0x2189bc)){return _0x222cb5(msgResponse(_0x20f4('0x226'),'Error',_0x20f4('0x227')+_0x2189bc));}if(_0x3bb483<=0x0||isNaN(_0x3bb483)){return _0x222cb5(msgResponse(_0x20f4('0x226'),_0x20f4('0x196'),_0x20f4('0x228')+_0x3bb483));}if(_0x2ead66<=0x0||isNaN(_0x2ead66)){return _0x222cb5(msgResponse(_0x20f4('0x226'),'Error',_0x20f4('0x223')+_0x2ead66));}if(_0x3e9967<=0x0||isNaN(_0x3e9967)){return _0x222cb5(msgResponse(_0x20f4('0x226'),'Error',_0x20f4('0x224')+_0x3e9967));}if(_0x2ec844<=0x0||isNaN(_0x2ec844)){return _0x222cb5(msgResponse(_0x20f4('0x226'),_0x20f4('0x196'),'Umin\x20=\x20'+_0x2ec844));}_0x2f54f0=_0x2f54f0||0x0;var _0x3ce6e9=0x1/_0x3bb483;var _0x46a1a0=0x0;var _0x71cf04=0x0;var _0x920736=0x0;var _0x1e4275=0x0;for(var _0x5d9434=0x0;_0x1e4275<_0x2ec844;_0x5d9434+=0x1){_0x71cf04=_0x5d9434/_0x3e9967;_0x46a1a0=(_0x2ead66*_0x71cf04+_0x2f54f0)/_0x3ce6e9;_0x920736=erlangb(_0x46a1a0,_0x2189bc);_0x1e4275=_0x46a1a0/_0x2189bc*(0x1-erlangb(_0x46a1a0,_0x2189bc));}return _0x3029ee({'erlangCalls':_0x5d9434,'erlangCallToSecond':_0x3e9967/_0x5d9434,'erlangAbandonmentRate':_0x920736,'erlangBusyFactor':_0x1e4275});});};module[_0x20f4('0x229')]=Dialer; \ No newline at end of file +var _0x72a1=['NOT_ACTIVE','name','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','Error','stringify','milliseconds','seconds','emit','type','outbound','strategy','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','abandoned','waiting','dialActive','dialOriginateTimeout','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','format','voice:queue:%s','ivr','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','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','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','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','One\x20call\x20every:\x20\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','merge','diff','clearing\x20variable\x20start\x20predictive','handlePredictive','string','\x22%s\x22\x20<%s>','error','inspect','stack','length','undefined','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','IS_DISACTIVED','state','statedesc','endtime','starttime','clearZombieChannels','[uniqueid]','[actions]','isNil','Action','status','channel','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','then','catch','[countReScheduled]\x20','checkIsBlackList','resolve','[checkIsBlackList]\x20','verifyAdditionalPhones','swapAdditionalPhones','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','rescheduleContact','[rescheduleContact]\x20','unlockContact','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','saveInDb','pick','ContactId','ListId','VoiceQueueId','[emptyContact][createHistory]','[emptyContact]','isSuccess','isTrunkReachable','SIP/%s','reachable','unmonitored','uniqueid','variable','exten','xcally-motion-dialer','dialAMDActive','value','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','HangupInAMD','membername','custom:amd','buildObj','amd','countmachineretry','[syncAgentComplete][createHistory][0]','countbusyretry','countnosuchnumberretry','countabandonedretry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','add','dialMachineRetryFrequency','minutes','CampaignId','HANGUP','AMD','[syncHangupInAMDIvr][createHistory]','MACHINE','Machine','countglobal','countcongestionretry','countnoanswerretry','countdropretry','countagentrejectretry','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','AGI','cause-txt','[syncHangupIvr]','reason','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','answertime','[syncQueueCallerAbandon]\x20[Drop]','responsetime','dialQueueTimeout','Drop','dropreason','TIMEOUT','callAdditionalPhoneAfterMin','voiceQueue','additional','dialDropMaxRetry','queueCallerAbandonCreateState','dialDropRetryFrequency','calleridname','calleridnum','Abandoned','CALLEREXIT','dialAbandonedRetryFrequency','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','actionid','locked','paused','stateinterface','push','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[unlock3][syncQueueStatusComplete]','syncCampaigns','TrunkBackup','TRUNK_IS_NOT_REACHABLE','checkIfTime','ifTime','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','Failure','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','isArray','command','iftime\x20%s,%s','interval','indexOf','true','content','all','some','INTERVAL_IS_OVERTIME','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','dialMethod','progressive','handlePower','dialPowerLevel','predictive','booked','Queue','launchHandleIvr','handleIvr','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','checkIfTimeIntervals','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','phone','originate','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialer','getCaller','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-VOICEQUEUEID','Contact','tags','%s%s','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','dialPrefix','trim','substring','dialCutDigit','SIP/%s/%s%s','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialGlobalMaxRetry','dialNoAnswerMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','[rescheduleContact][NoSuchNumber]','[rescheduleContact][Drop]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','object','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','dialNoSuchNumberRetryFrequency','reason\x200\x20no\x20such\x20number....','noanswer','dialNoAnswerRetryFrequency','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','busy','reason\x205\x20busy','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','Global','Success','[moveContactManagedDialer][0]','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','erlangCalls','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dialPredictiveOptimization','started\x20in\x20predictive\x20at','startMethodPredictive','Predictive\x20after\x20first\x20interval','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','getDataPredictive','abandonmentRate','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','actionOriginate','scheduledat','Agent','voicePause','[rescheduleContact][dialRecallInQueue]','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','BLACKLIST','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','emptyContact','Contact.phone','[actionOriginateIvr]\x20','dialLimitQueue','not_inuse','countReScheduled','[actionOriginate]\x20','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','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','lodash','uuid','md5','ioredis','../preview/util/util','../../../config/logger','predictiveCalls','syncQueueSummary','redis','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperFinal','../rpc/cmHopperAdditionalPhone','../rpc/cmHopperBlack','./action','./history','./final','./agentComplete','./hangup','env','XCALLY_IP_AGI','rrmemory','roundrobin','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','syncOriginateResponse','agentcomplete','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','message','\x20AGENTS\x20NOT\x20LOGGED'];(function(_0x4f1b87,_0x260834){var _0x74718e=function(_0x24c7c2){while(--_0x24c7c2){_0x4f1b87['push'](_0x4f1b87['shift']());}};_0x74718e(++_0x260834);}(_0x72a1,0x1ce));var _0x172a=function(_0x4bfe08,_0x48ae7b){_0x4bfe08=_0x4bfe08-0x0;var _0x1f9125=_0x72a1[_0x4bfe08];return _0x1f9125;};'use strict';var util=require('util');var _=require(_0x172a('0x0'));var BPromise=require('bluebird');var uuid=require(_0x172a('0x1'));var moment=require('moment');var rr=require('rr');var md5=require(_0x172a('0x2'));var Redis=require(_0x172a('0x3'));var ut=require(_0x172a('0x4'));var config=require('../../../config/environment/');var logger=require(_0x172a('0x5'))('dialer');var loggerBooked=require(_0x172a('0x5'))('booked');var loggerPredictive=require(_0x172a('0x5'))('predictive');var loggerPredictiveCalls=require(_0x172a('0x5'))(_0x172a('0x6'));var loggerSyncQueueSummary=require(_0x172a('0x5'))(_0x172a('0x7'));var ami=require('../ami');config[_0x172a('0x8')]=_['defaults'](config[_0x172a('0x8')],{'host':_0x172a('0x9'),'port':0x18eb});var io=require(_0x172a('0xa'))(new Redis(config['redis']));var cmHopper=require(_0x172a('0xb'));var cmHopperHistory=require(_0x172a('0xc'));var cmHopperFinal=require(_0x172a('0xd'));var cmHopperAdditionalPhone=require(_0x172a('0xe'));var cmHopperBlack=require(_0x172a('0xf'));var voiceQueueRt=require('../rpc/voiceQueueRt');var Action=require(_0x172a('0x10'));var History=require(_0x172a('0x11'));var Final=require(_0x172a('0x12'));var AgentComplete=require(_0x172a('0x13'));var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require(_0x172a('0x14'));var ipAgi=process[_0x172a('0x15')][_0x172a('0x16')]||'127.0.0.1';var strategy={'rrmemory':_0x172a('0x17'),'roundrobin':_0x172a('0x18')};var Sequence=function(){};Sequence[_0x172a('0x19')][_0x172a('0x1a')]=function(_0x5775f9){this[_0x172a('0x1b')]=this[_0x172a('0x1b')]?this['tail'][_0x172a('0x1c')](_0x5775f9):_0x5775f9();};function Dialer(_0x489d1c,_0x2909c5){this[_0x172a('0x1d')]=new Sequence();this[_0x172a('0x1e')]=_0x2909c5;this['voiceQueues']=_0x489d1c[_0x172a('0x1f')];this[_0x172a('0x20')]=_0x489d1c[_0x172a('0x20')];this[_0x172a('0x21')]=_0x489d1c[_0x172a('0x21')];this[_0x172a('0x22')]=_0x489d1c[_0x172a('0x22')];this[_0x172a('0x23')]=config['maxNumberOriginate']||0x2;this['channels']={};this[_0x172a('0x24')]={};this[_0x172a('0x25')]={};this[_0x172a('0x26')]={};this[_0x172a('0x27')]={};this[_0x172a('0x28')]={};this[_0x172a('0x29')]={};this[_0x172a('0x2a')]={};this[_0x172a('0x2b')]={};this['queueBookedRR']={};ami['on']('agentconnect',this[_0x172a('0x2c')][_0x172a('0x2d')](this));ami['on'](_0x172a('0x2e'),this[_0x172a('0x2f')]['bind'](this));ami['on']('originateresponse',this[_0x172a('0x30')][_0x172a('0x2d')](this));ami['on'](_0x172a('0x31'),this['syncAgentComplete']['bind'](this));ami['on']('custom:queuesummary',this[_0x172a('0x7')][_0x172a('0x2d')](this));ami['on'](_0x172a('0x32'),this[_0x172a('0x33')][_0x172a('0x2d')](this));ami['on'](_0x172a('0x34'),this[_0x172a('0x35')][_0x172a('0x2d')](this));ami['on'](_0x172a('0x36'),this[_0x172a('0x37')][_0x172a('0x2d')](this));ami['on'](_0x172a('0x38'),this[_0x172a('0x39')][_0x172a('0x2d')](this));ami['on']('queuestatuscomplete',this[_0x172a('0x3a')][_0x172a('0x2d')](this));this[_0x172a('0x3b')]();this[_0x172a('0x3c')]();}function isNotNull(_0x4fd2d0){return _0x4fd2d0!==null&&!_['isUndefined'](_0x4fd2d0);}function checkIsLoggedIn(_0x585b09,_0x473ca2){return function(){if(_0x473ca2<=0x0){_0x585b09[_0x172a('0x3d')]='AGENTS_NOT_LOGGED';throw _0x585b09['name']+_0x172a('0x3e');}};}function isActive(_0x1abcda){return _0x1abcda;}function checkIsActive(_0x199316,_0x40e875){return function(){if(!isActive(_0x40e875)){_0x199316[_0x172a('0x3d')]=_0x172a('0x3f');throw _0x199316[_0x172a('0x40')]+_0x172a('0x41');}};}function checkInterval(_0x361a3c){return function(){if(!isNotNull(_0x361a3c[_0x172a('0x42')])){_0x361a3c[_0x172a('0x3d')]=_0x172a('0x43');throw _0x361a3c[_0x172a('0x40')]+_0x172a('0x44');}if(!isNotNull(_0x361a3c[_0x172a('0x42')][_0x172a('0x45')])){_0x361a3c['message']='INTERVAL_IS_NULL';throw _0x361a3c[_0x172a('0x40')]+_0x172a('0x44');}if(!isNotNull(_[_0x172a('0x46')](_0x361a3c[_0x172a('0x42')]['Intervals']))){_0x361a3c[_0x172a('0x3d')]=_0x172a('0x43');throw _0x361a3c[_0x172a('0x40')]+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x53e89c,_0x5a2d2b,_0x227263){return{'action':_0x53e89c,'response':_0x5a2d2b,'message':_0x227263,'stack':_0x227263};}function myreject(_0x146aae){return function(_0x1a8602){return _0x146aae(msgResponse('[ifTime][Action]',_0x172a('0x47'),JSON[_0x172a('0x48')](_0x1a8602)));};}function getSeconds(_0x49a1a1,_0x14c86e){var _0x332388=moment(_0x49a1a1)[_0x172a('0x49')](0x0);var _0xa00627=moment(_0x14c86e)[_0x172a('0x49')](0x0);return _0x332388['diff'](_0xa00627,_0x172a('0x4a'));}function emit(_0x5a940e,_0x80bf9,_0x1ba3a5){io['to'](_0x5a940e)[_0x172a('0x4b')](_0x80bf9,_0x1ba3a5);}function emitVoiceQueueSummary(_0x1cc53e){if(_0x1cc53e[_0x172a('0x4c')]===_0x172a('0x4d')){var _0x261b4d={'id':_0x1cc53e['id'],'name':_0x1cc53e[_0x172a('0x40')],'strategy':_0x1cc53e[_0x172a('0x4e')],'answered':_0x1cc53e['answered'],'available':_0x1cc53e[_0x172a('0x4f')],'loggedIn':_0x1cc53e[_0x172a('0x50')],'pTalking':_0x1cc53e[_0x172a('0x51')],'sumBillable':_0x1cc53e[_0x172a('0x52')],'sumDuration':_0x1cc53e[_0x172a('0x53')],'sumHoldTime':_0x1cc53e[_0x172a('0x54')]||0x0,'talking':_0x1cc53e[_0x172a('0x55')],'total':_0x1cc53e[_0x172a('0x56')],'type':_0x1cc53e[_0x172a('0x4c')],'unmanaged':_0x1cc53e['unmanaged'],'abandoned':_0x1cc53e[_0x172a('0x57')],'waiting':_0x1cc53e[_0x172a('0x58')],'loggedInDb':_0x1cc53e['loggedInDb'],'dialActive':_0x1cc53e[_0x172a('0x59')],'dialMethod':_0x1cc53e['dialMethod'],'dialOriginateCallerIdName':_0x1cc53e['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x1cc53e['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x1cc53e[_0x172a('0x5a')],'dialPrefix':_0x1cc53e['dialPrefix'],'outboundAnswerAgiCallsDay':_0x1cc53e['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x1cc53e['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x1cc53e[_0x172a('0x5b')],'outboundBusyCallsDay':_0x1cc53e[_0x172a('0x5c')],'outboundCongestionCallsDay':_0x1cc53e[_0x172a('0x5d')],'outboundDropCallsDayACS':_0x1cc53e['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x1cc53e[_0x172a('0x5e')],'outboundDropCallsDayTimeout':_0x1cc53e[_0x172a('0x5f')],'outboundNoAnswerCallsDay':_0x1cc53e[_0x172a('0x60')],'outboundNoSuchCallsDay':_0x1cc53e[_0x172a('0x61')],'outboundOriginateFailureCallsDay':_0x1cc53e['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x1cc53e[_0x172a('0x62')],'outboundRejectCallsDay':_0x1cc53e[_0x172a('0x63')],'outboundUnknownCallsDay':_0x1cc53e[_0x172a('0x64')],'predictiveIntervalAnsweredCalls':_0x1cc53e['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x1cc53e[_0x172a('0x65')],'predictiveIntervalAvgTalktime':_0x1cc53e[_0x172a('0x66')],'predictiveIntervalDroppedCallsCallersExit':_0x1cc53e[_0x172a('0x67')],'predictiveIntervalDroppedCallsTimeout':_0x1cc53e[_0x172a('0x68')],'predictiveIntervalErlangCalls':_0x1cc53e[_0x172a('0x69')],'predictiveIntervalErlangCallsDroppedCalls':_0x1cc53e[_0x172a('0x6a')],'predictiveIntervalHitRate':_0x1cc53e[_0x172a('0x6b')],'predictiveIntervalMultiplicativeFactor':_0x1cc53e[_0x172a('0x6c')],'predictiveIntervalPauses':_0x1cc53e[_0x172a('0x6d')],'predictiveIntervalAvailable':_0x1cc53e[_0x172a('0x6e')],'predictiveIntervalTotalCalls':_0x1cc53e[_0x172a('0x6f')],'message':_0x1cc53e[_0x172a('0x3d')],'originated':_0x1cc53e[_0x172a('0x70')],'erlangCalls':_0x1cc53e['erlangCalls'],'erlangCallToSecond':_0x1cc53e[_0x172a('0x71')],'erlangAbandonmentRate':_0x1cc53e[_0x172a('0x72')],'erlangBusyFactor':_0x1cc53e[_0x172a('0x73')],'startPredictive':_0x1cc53e['startPredictive'],'startProgressive':_0x1cc53e[_0x172a('0x29')]};if(_0x1cc53e['Trunk']){_0x261b4d[_0x172a('0x74')]={'id':_0x1cc53e[_0x172a('0x74')]['id'],'name':_0x1cc53e[_0x172a('0x74')][_0x172a('0x40')],'active':_0x1cc53e[_0x172a('0x74')][_0x172a('0x75')],'callerid':_0x1cc53e[_0x172a('0x74')]['callerid']};}if(_0x1cc53e[_0x172a('0x42')]){_0x261b4d[_0x172a('0x42')]={'id':_0x1cc53e[_0x172a('0x42')]['id'],'name':_0x1cc53e['Interval'][_0x172a('0x40')]};}var _0x135bce=md5(JSON['stringify'](_0x261b4d));if(_0x1cc53e[_0x172a('0x2')]!==_0x135bce){_0x1cc53e[_0x172a('0x2')]=_0x135bce;emit(util[_0x172a('0x76')](_0x172a('0x77'),_0x261b4d[_0x172a('0x40')]),'voice_queue:save',_0x261b4d);}}}function emitCampaignSummary(_0x2bbe93){if(_0x2bbe93[_0x172a('0x4c')]===_0x172a('0x78')){emit(util[_0x172a('0x76')](_0x172a('0x79'),_0x2bbe93['name']),_0x172a('0x7a'),_0x2bbe93);}}function checkGetDataPredictive(_0x706c1b){if(isNotNull(_0x706c1b)&&!_[_0x172a('0x46')](_0x706c1b)){loggerPredictive[_0x172a('0x7b')](_0x172a('0x7c'));loggerPredictive[_0x172a('0x7b')](_0x172a('0x7d'),_0x706c1b[_0x172a('0x6f')]);loggerPredictive[_0x172a('0x7b')](_0x172a('0x7e'),_0x706c1b[_0x172a('0x7f')]);loggerPredictive['info']('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x706c1b[_0x172a('0x68')]);loggerPredictive[_0x172a('0x7b')](_0x172a('0x80'),_0x706c1b[_0x172a('0x67')]);loggerPredictive[_0x172a('0x7b')](_0x172a('0x81'),_0x706c1b[_0x172a('0x65')]);loggerPredictive['info'](_0x172a('0x82'),_0x706c1b[_0x172a('0x66')]);loggerPredictive[_0x172a('0x7b')](_0x172a('0x83'));if(_0x706c1b[_0x172a('0x6f')]>0x0){if(!_[_0x172a('0x84')](_0x706c1b[_0x172a('0x66')])&&_0x706c1b[_0x172a('0x66')]>0x0){return!![];}loggerPredictive[_0x172a('0x7b')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_['isUndefined'](_0x706c1b['predictiveIntervalAvgHoldtime'])&&_0x706c1b[_0x172a('0x65')]>0x0){return!![];}loggerPredictive['info'](_0x172a('0x85'));}else{loggerPredictive[_0x172a('0x7b')](_0x172a('0x86'));}}else{loggerPredictive[_0x172a('0x7b')](_0x172a('0x87'));}return![];}function mergeDataErlangB(_0x1d68c8){return function(_0x2e4326){loggerPredictive[_0x172a('0x7b')]('---------\x20ErlangB\x20---------');loggerPredictive['info']('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2e4326['erlangCalls']);loggerPredictive[_0x172a('0x7b')](_0x172a('0x88'),_0x2e4326[_0x172a('0x71')]);loggerPredictive[_0x172a('0x7b')](_0x172a('0x89'),_0x2e4326[_0x172a('0x72')]);loggerPredictive[_0x172a('0x7b')](_0x172a('0x8a'),_0x2e4326[_0x172a('0x73')]);loggerPredictive['info'](_0x172a('0x89'),_0x2e4326[_0x172a('0x72')]);loggerPredictive[_0x172a('0x7b')](_0x172a('0x83'));_[_0x172a('0x8b')](_0x1d68c8,_0x2e4326);};}function getDiff(_0x214b90){var _0x54f662=moment()[_0x172a('0x49')](0x0);var _0x1cc824=moment(_0x214b90)[_0x172a('0x49')](0x0);return _0x54f662[_0x172a('0x8c')](_0x1cc824,_0x172a('0x4a'));}function ifInterval(_0x2d3e83,_0x4a2302){if(_[_0x172a('0x84')](_0x4a2302)){return![];}return getDiff(_0x4a2302)<_0x2d3e83*0x3c;}function freeVariablesPredictive(_0x217950){if(isNotNull(_0x217950)){if(!_['isUndefined'](_0x217950[_0x172a('0x29')])){_0x217950['startProgressive']=undefined;loggerPredictive[_0x172a('0x7b')](_0x217950[_0x172a('0x40')],'clearing\x20variable\x20start\x20progressive');}if(!_[_0x172a('0x84')](_0x217950[_0x172a('0x28')])){_0x217950[_0x172a('0x28')]=undefined;loggerPredictive[_0x172a('0x7b')](_0x217950[_0x172a('0x40')],_0x172a('0x8d'));}if(!_['isUndefined'](_0x217950[_0x172a('0x8e')])){clearInterval(_0x217950[_0x172a('0x8e')]);_0x217950['handlePredictive']=undefined;loggerPredictive[_0x172a('0x7b')](_0x217950['name'],'clearing\x20variable\x20handle\x20predictive');}}}function erlangb(_0xd25516,_0x382157){if(_0x382157===0x0){return 0x0;}var _0x1ec32f=0x1;for(var _0x18a45c=0x1;_0x18a45c<=_0x382157;_0x18a45c+=0x1){_0x1ec32f=0x1+_0x1ec32f*_0x18a45c/_0xd25516;}return 0x1/_0x1ec32f;}function isVoiceQueueOutbound(_0x3385f3){return _0x3385f3===_0x172a('0x4d');}function isNotPreview(_0x5548de){return _0x5548de!==_0x172a('0x1e');}function isCampaignIvr(_0xc163aa){return _0xc163aa===_0x172a('0x78');}function getCallerId(_0x1d49e0,_0x54e8b5,_0x39b252){if(!_[_0x172a('0x84')](_0x39b252)&&typeof _0x39b252===_0x172a('0x8f')&&!_[_0x172a('0x46')](_0x39b252)){if(!_['isUndefined'](_0x54e8b5)&&typeof _0x54e8b5===_0x172a('0x8f')&&!_['isEmpty'](_0x54e8b5)){return util[_0x172a('0x76')]('\x22%s\x22\x20<%s>',_0x54e8b5,_0x39b252);}return util[_0x172a('0x76')](_0x172a('0x90'),_0x39b252,_0x39b252);}if(!_['isUndefined'](_0x1d49e0)&&typeof _0x1d49e0===_0x172a('0x8f')&&!_['isEmpty'](_0x1d49e0)){return _0x1d49e0;}return'\x22\x22\x20<>';}function loggerCatchQueueSummary(_0x2c42c3,_0x50f042){return function(_0x513a45){freeVariablesPredictive(_0x50f042);emitVoiceQueueSummary(_0x50f042);emitCampaignSummary(_0x50f042);loggerSyncQueueSummary[_0x172a('0x91')](_0x2c42c3,util[_0x172a('0x92')](_0x513a45,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x520e9b,_0x434e8a){return function(_0x141915){loggerPredictive[_0x172a('0x91')](_0x434e8a[_0x172a('0x40')],_0x520e9b);loggerPredictive[_0x172a('0x91')](_0x141915[_0x172a('0x93')]);freeVariablesPredictive(_0x434e8a);};}function loggerCatch(_0x571ec9){return function(_0x414919){logger[_0x172a('0x91')](_0x571ec9,util[_0x172a('0x92')](_0x414919,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x53b40c){return _0x53b40c&&!_['isUndefined'](_0x53b40c)&&_0x53b40c[_0x172a('0x94')]>0x0;}function decremetOriginate(_0x458016){if(!_['isUndefined'](_0x458016)&&_0x458016!==null){if(typeof _0x458016[_0x172a('0x70')]!==_0x172a('0x95')){if(_0x458016[_0x172a('0x70')]>0x0){_0x458016[_0x172a('0x70')]-=0x1;}else{logger[_0x172a('0x91')]('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x172a('0x91')](_0x172a('0x96'));}}function checkContactLowerLimitOriginate(_0x7b6fbd,_0xb98064,_0x4a1dc4){if(_0xb98064>_0x4a1dc4){for(var _0x5236d5=0x0;_0x5236d5<_0xb98064-_0x4a1dc4;_0x5236d5+=0x1){decremetOriginate(_0x7b6fbd);}}}function loggerGetContactDialer(_0x3442b2,_0x4497a6,_0x3b1c33){return function(_0x358dcf){checkContactLowerLimitOriginate(_0x4497a6,_0x3b1c33,0x0);logger[_0x172a('0x91')](_0x3442b2,util['inspect'](_0x358dcf,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x1a7908){return function(_0x55c791){if(isNotNull(_0x55c791)&&isNotNull(_0x55c791[0x0])){if(_0x55c791[0x0][_0x172a('0x97')]>0x0){_0x1a7908[_0x172a('0x3d')]=_0x172a('0x98');logger[_0x172a('0x7b')](_0x172a('0x99')+_0x1a7908['name'],_0x55c791[0x0][_0x172a('0x97')],'contacts');}else{_0x1a7908[_0x172a('0x3d')]=_0x172a('0x9a');logger[_0x172a('0x7b')](_0x172a('0x9b')+_0x1a7908[_0x172a('0x40')]);}}};}function notSendMessagesQueue(_0x1547da){if(_0x1547da[_0x172a('0x9c')]){freeVariablesPredictive(_0x1547da);if(_0x1547da[_0x172a('0x70')]===0x0&&_0x1547da[_0x172a('0x55')]===0x0&&_0x1547da['waiting']===0x0&&(_0x1547da[_0x172a('0x51')]||0x0)===0x0){_0x1547da[_0x172a('0x9c')]=![];_0x1547da[_0x172a('0x4f')]=0x0;_0x1547da[_0x172a('0x3d')]=_0x172a('0x3f');loggerSyncQueueSummary['error'](_0x172a('0x9d'),_0x1547da[_0x172a('0x40')],_0x172a('0x9e'));}else{_0x1547da[_0x172a('0x3d')]='IS_DISACTIVED';loggerSyncQueueSummary['error'](_0x172a('0x9d'),_0x1547da[_0x172a('0x40')],_0x172a('0x9f'));}emitVoiceQueueSummary(_0x1547da);}}function notSendMessagesCampaign(_0x295687){if(_0x295687[_0x172a('0x9c')]){if(_0x295687[_0x172a('0x70')]===0x0){_0x295687[_0x172a('0x9c')]=![];_0x295687[_0x172a('0x3d')]=_0x172a('0x3f');loggerSyncQueueSummary[_0x172a('0x91')](_0x172a('0xa0'),_0x295687[_0x172a('0x40')],_0x172a('0x9e'));}else{_0x295687[_0x172a('0x3d')]=_0x172a('0xa1');loggerSyncQueueSummary[_0x172a('0x91')](_0x172a('0xa0'),_0x295687[_0x172a('0x40')],'is\x20disactive');}emitCampaignSummary(_0x295687);}}function createObjHistory(_0xfb0e2b,_0x19a774,_0x5703e5,_0x43d99d,_0x259f58){_0xfb0e2b[_0x172a('0x3d')]=_0x5703e5;var _0x600a1b=new Action(_0xfb0e2b,_0x19a774);var _0x1f7a2b=new History(_0x600a1b);_0x1f7a2b[_0x172a('0xa2')]=_0x43d99d;_0x1f7a2b[_0x172a('0xa3')]=_0x259f58;_0x1f7a2b[_0x172a('0xa4')]=_0x600a1b[_0x172a('0xa5')];return _0x1f7a2b;}Dialer[_0x172a('0x19')][_0x172a('0x3c')]=function(){var _0x870c39=this;setInterval(function(){_0x870c39[_0x172a('0xa6')](_0x870c39[_0x172a('0x26')],_0x172a('0xa7'));_0x870c39[_0x172a('0xa6')](_0x870c39[_0x172a('0x24')],_0x172a('0xa8'));},0x32c8);};Dialer[_0x172a('0x19')][_0x172a('0xa6')]=function(_0x50da32,_0x408944){var _0x3cd98e=this;for(var _0x63ce77 in _0x50da32){if(typeof _0x50da32[_0x63ce77]!=='undefined'){this[_0x172a('0x1d')][_0x172a('0x1a')](function(){if(!_[_0x172a('0xa9')](_0x50da32[_0x63ce77])){return ami[_0x172a('0xaa')]({'action':_0x172a('0xab'),'channel':_0x50da32[_0x63ce77][_0x172a('0xac')]})['catch'](function(_0x2c4198){if(_0x2c4198[_0x172a('0x3d')]===_0x172a('0xad')){setTimeout(function(){if(_0x50da32[_0x63ce77]&&_0x50da32[_0x63ce77]['type']!==_0x172a('0x78')){_0x3cd98e[_0x172a('0xae')](_0x3cd98e[_0x172a('0x1f')][_0x50da32[_0x63ce77][_0x172a('0xaf')]]);logger[_0x172a('0x91')](_0x172a('0xb0'),_0x408944,_0x63ce77,_0x50da32[_0x63ce77][_0x172a('0xaf')]);delete _0x50da32[_0x63ce77];}if(_0x50da32[_0x63ce77]&&_0x50da32[_0x63ce77][_0x172a('0x4c')]===_0x172a('0x78')){_0x3cd98e[_0x172a('0xae')](_0x3cd98e[_0x172a('0x20')][_0x50da32[_0x63ce77][_0x172a('0xaf')]]);logger[_0x172a('0x91')](_0x172a('0xb1'),_0x408944,_0x63ce77,_0x50da32[_0x63ce77][_0x172a('0xaf')]);delete _0x50da32[_0x63ce77];}},0x2328);}});}});}}};Dialer[_0x172a('0x19')]['countReScheduled']=function(_0x21f3d6){return BPromise['resolve']()[_0x172a('0xb2')](cmHopper['countReScheduled'](_0x21f3d6))[_0x172a('0xb3')](loggerCatch(_0x172a('0xb4')));};Dialer[_0x172a('0x19')][_0x172a('0xb5')]=function(_0x14d9ee){return BPromise[_0x172a('0xb6')]()[_0x172a('0xb2')](cmHopperBlack[_0x172a('0xb5')](_0x14d9ee))[_0x172a('0xb3')](loggerCatch(_0x172a('0xb7')));};Dialer[_0x172a('0x19')][_0x172a('0xb8')]=function(_0x5960ed,_0x436ca6,_0x1c9bb5){return BPromise['resolve']()[_0x172a('0xb2')](cmHopperAdditionalPhone['verifyAdditionalPhones'](_0x5960ed,_0x436ca6,_0x1c9bb5))['catch'](loggerCatch('[verifyAdditionalPhone]\x20'));};Dialer[_0x172a('0x19')][_0x172a('0xb9')]=function(_0x203609,_0x4510be,_0x33bacf){return BPromise[_0x172a('0xb6')]()[_0x172a('0xb2')](cmHopperAdditionalPhone[_0x172a('0xb9')](_0x203609,_0x4510be,_0x33bacf))[_0x172a('0xb3')](loggerCatch('[swapAdditionalPhone]\x20'));};Dialer[_0x172a('0x19')]['checkIsBlackListIvr']=function(_0x13a314){return BPromise[_0x172a('0xb6')]()[_0x172a('0xb2')](cmHopperBlack[_0x172a('0xba')](_0x13a314))[_0x172a('0xb3')](loggerCatch(_0x172a('0xbb')));};Dialer[_0x172a('0x19')][_0x172a('0xbc')]=function(_0x9e7cf3){return BPromise[_0x172a('0xb6')]()['then'](cmHopperHistory[_0x172a('0xbd')](_0x9e7cf3))[_0x172a('0xb3')](loggerCatch('[averageHandleTime]\x20'));};Dialer[_0x172a('0x19')][_0x172a('0xbe')]=function(_0x475672){return BPromise['resolve']()[_0x172a('0xb2')](cmHopper[_0x172a('0xbe')](_0x475672))[_0x172a('0xb3')](loggerCatch(_0x172a('0xbf')));};Dialer[_0x172a('0x19')][_0x172a('0xc0')]=function(_0x15e38e,_0x5d8156,_0x496dd9){return BPromise[_0x172a('0xb6')]()['then'](cmHopper['unlockContact'](_0x15e38e,_0x5d8156,_0x496dd9))[_0x172a('0xb3')](loggerCatch('[unlockContact]\x20'));};Dialer[_0x172a('0x19')][_0x172a('0xc1')]=function(_0x2314e6,_0x3de43b,_0x37d119,_0x3906a3,_0x2643a0){return BPromise[_0x172a('0xb6')]()[_0x172a('0xb2')](cmHopper[_0x172a('0xc1')](_0x2314e6,_0x3de43b,_0x37d119,_0x3906a3))[_0x172a('0xb3')](function(_0x3075dd){_0x2643a0[_0x172a('0xc2')]-=_0x37d119;_0x2643a0[_0x172a('0xc2')]=_0x2643a0['temp']>0x0?_0x2643a0[_0x172a('0xc2')]:0x0;loggerCatch(_0x172a('0xc3'))(_0x3075dd);});};Dialer[_0x172a('0x19')][_0x172a('0xc4')]=function(_0x219216,_0x25093c,_0x1adb69,_0x2720b8){return BPromise[_0x172a('0xb6')]()[_0x172a('0xb2')](cmHopper[_0x172a('0xc4')](_0x219216,_0x25093c,_0x1adb69))[_0x172a('0xb3')](function(_0x40059e){_0x2720b8[_0x172a('0xc2')]-=_0x25093c;_0x2720b8[_0x172a('0xc2')]=_0x2720b8['temp']>0x0?_0x2720b8[_0x172a('0xc2')]:0x0;loggerCatch('[getContactDialerIvr]\x20')(_0x40059e);});};Dialer[_0x172a('0x19')]['getVoiceQueueRtPauses']=function(_0x132317){return BPromise['resolve']()[_0x172a('0xb2')](voiceQueueRt[_0x172a('0xc5')](_0x132317))[_0x172a('0xb3')](loggerCatch(_0x172a('0xc6')));};Dialer[_0x172a('0x19')][_0x172a('0xc7')]=function(_0x43bc59){return BPromise['resolve']()[_0x172a('0xb2')](cmHopper[_0x172a('0xc7')](_0x43bc59))['catch'](loggerCatch(_0x172a('0xc8')));};Dialer[_0x172a('0x19')][_0x172a('0xc9')]=function(_0x52e861){return BPromise[_0x172a('0xb6')]()[_0x172a('0xb2')](cmHopperHistory[_0x172a('0xc9')](_0x52e861))[_0x172a('0xb3')](loggerCatch('[createHistory]\x20'));};Dialer[_0x172a('0x19')][_0x172a('0xae')]=function(_0x6f6142){if(!_[_0x172a('0x84')](_0x6f6142)&&_0x6f6142!==null){if(typeof _0x6f6142[_0x172a('0x70')]!=='undefined'){if(_0x6f6142[_0x172a('0x70')]>0x0){_0x6f6142[_0x172a('0x70')]-=0x1;}else{logger[_0x172a('0x91')](_0x172a('0xca'));}}}else{logger[_0x172a('0x91')](_0x172a('0xcb'));}};Dialer[_0x172a('0x19')][_0x172a('0xcc')]=function(_0xd0f280,_0x5f1e7d){var _0x922306=this;return function(_0x2cc5ed){_0x922306[_0x172a('0xae')](_0x5f1e7d);logger[_0x172a('0x91')](_0xd0f280,util[_0x172a('0x92')](_0x2cc5ed,{'showHidden':![],'depth':null}));};};Dialer[_0x172a('0x19')]['emptyContact']=function(_0x51db6f,_0x2393c2,_0x99febe){var _0x450e1b={'state':0x19,'statedesc':'notFound'};this[_0x172a('0xae')](_0x2393c2);this[_0x172a('0xcd')](_['merge'](_0x450e1b,_[_0x172a('0xce')](_0x99febe,[_0x172a('0xcf'),_0x172a('0xd0'),'UserId',_0x172a('0xd1'),'CampaignId'])),_0x172a('0xd2'),_0x172a('0xd3'));logger['error'](_0x51db6f);};Dialer[_0x172a('0x19')][_0x172a('0xd4')]=function(_0x3badcb){return _0x3badcb==='Success';};Dialer[_0x172a('0x19')][_0x172a('0xd5')]=function(_0x3c2a0b){return!_['isUndefined'](_0x3c2a0b)&&_0x3c2a0b&&!_[_0x172a('0x84')](_0x3c2a0b[_0x172a('0x40')])&&!_[_0x172a('0x84')](_0x3c2a0b[_0x172a('0x75')])&&_0x3c2a0b[_0x172a('0x75')]&&(this['trunks'][util[_0x172a('0x76')](_0x172a('0xd6'),_0x3c2a0b[_0x172a('0x40')])]['status']===_0x172a('0xd7')||this[_0x172a('0x22')][util['format'](_0x172a('0xd6'),_0x3c2a0b[_0x172a('0x40')])][_0x172a('0xab')]===_0x172a('0xd8'));};Dialer[_0x172a('0x19')][_0x172a('0xcd')]=function(_0x4273ba,_0x3de3a4,_0x2422fe){this[_0x172a('0xc9')](_0x4273ba)['catch'](loggerCatch(_0x3de3a4));this[_0x172a('0xc7')](_0x4273ba)[_0x172a('0xb3')](loggerCatch(_0x2422fe));};Dialer[_0x172a('0x19')][_0x172a('0x37')]=function(_0x50ca69){var _0x1d43a1=this[_0x172a('0x26')][_0x50ca69[_0x172a('0xd9')]];var _0x56a225;if(!_[_0x172a('0xa9')](_0x50ca69)&&!_[_0x172a('0xa9')](_0x50ca69['variable'])&&!_[_0x172a('0xa9')](_0x50ca69[_0x172a('0xda')]['amdstatus'])&&_0x50ca69[_0x172a('0xdb')]===_0x172a('0xdc')&&_0x1d43a1){if(_0x1d43a1[_0x172a('0x4c')]!=='ivr'&&this[_0x172a('0x1f')][_0x1d43a1[_0x172a('0xaf')]][_0x172a('0xdd')]&&_0x50ca69[_0x172a('0xde')]==='HANGUP'){delete this[_0x172a('0x26')][_0x50ca69['uniqueid']];this[_0x172a('0xae')](this[_0x172a('0x1f')][_0x1d43a1[_0x172a('0xaf')]]);this['voiceQueues'][_0x1d43a1['queue']][_0x172a('0xdf')]+=0x1;this[_0x172a('0x1f')][_0x1d43a1[_0x172a('0xaf')]][_0x172a('0xe0')]+=0x1;_0x56a225=new Hangup(_0x1d43a1,_0x50ca69);_0x56a225['state']=0x12;_0x56a225[_0x172a('0xa3')]=_0x172a('0xe1');_0x56a225[_0x172a('0xe2')]='AMD';ami[_0x172a('0x4b')](_0x172a('0xe3'),ut[_0x172a('0xe4')](_0x56a225,_0x172a('0xe5')));this['saveInDb'](_0x56a225,'[syncHangupInAMD][createHistory]','[syncHangupInAMD]');}if(_0x1d43a1[_0x172a('0x4c')]!=='ivr'&&this[_0x172a('0x1f')][_0x1d43a1['queue']][_0x172a('0xdd')]&&_0x50ca69['value']==='MACHINE'){var _0x10f78d=this;return new BPromise(function(_0x5e40fa,_0xb483f9){delete _0x10f78d[_0x172a('0x26')][_0x50ca69[_0x172a('0xd9')]];_0x10f78d[_0x172a('0xae')](_0x10f78d['voiceQueues'][_0x1d43a1[_0x172a('0xaf')]]);_0x10f78d[_0x172a('0x1f')][_0x1d43a1[_0x172a('0xaf')]][_0x172a('0xdf')]+=0x1;_0x10f78d[_0x172a('0x1f')][_0x1d43a1[_0x172a('0xaf')]][_0x172a('0xe0')]+=0x1;var _0x3cfb78=_0x10f78d['voiceQueues'][_0x1d43a1[_0x172a('0xaf')]];var _0xe88c52=new Hangup(_0x1d43a1,_0x50ca69);_0xe88c52['state']=0x13;_0xe88c52[_0x172a('0xa3')]='Machine';_0xe88c52['membername']='AMD';_0xe88c52[_0x172a('0xe6')]+=0x1;_0xe88c52['countglobal']+=0x1;_0xe88c52[_0x172a('0xe5')]=!![];ami[_0x172a('0x4b')](_0x172a('0xe3'),ut[_0x172a('0xe4')](_0xe88c52,_0x172a('0xe5')));_0x10f78d[_0x172a('0xc9')](_0xe88c52)[_0x172a('0xb3')](loggerCatch(_0x172a('0xe7')));if(_0xe88c52[_0x172a('0xe8')]+_0xe88c52['countcongestionretry']+_0xe88c52['countnoanswerretry']+_0xe88c52[_0x172a('0xe9')]+_0xe88c52['countdropretry']+_0xe88c52[_0x172a('0xea')]+_0xe88c52[_0x172a('0xe6')]+_0xe88c52['countagentrejectretry']>=_0x3cfb78['dialGlobalMaxRetry']){_0x10f78d[_0x172a('0xeb')](_0xe88c52,_0x5e40fa,_0xb483f9,_0x172a('0xec'));}else{if(_0xe88c52[_0x172a('0xe6')]>=_0x3cfb78[_0x172a('0xed')]){_0x10f78d[_0x172a('0xee')](_0xe88c52,_0x5e40fa,_0xb483f9,'reason\x2019\x20machine....');}else{_0x10f78d[_0x172a('0xbe')]({'active':![],'countmachineretry':_0xe88c52[_0x172a('0xe6')],'scheduledat':moment()[_0x172a('0xef')](_0x3cfb78[_0x172a('0xf0')],_0x172a('0xf1'))[_0x172a('0x76')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xe88c52[_0x172a('0xcf')],'ListId':_0xe88c52[_0x172a('0xd0')],'VoiceQueueId':_0xe88c52['VoiceQueueId']||undefined,'CampaignId':_0xe88c52[_0x172a('0xf2')]||undefined})[_0x172a('0xb3')](loggerCatch('[rescheduleContact][Machine]'));_0x5e40fa({'reschedule':0x1});}}});}if(_0x1d43a1['type']==='ivr'&&this[_0x172a('0x20')][_0x1d43a1[_0x172a('0xaf')]]['dialAMDActive']&&_0x50ca69['value']===_0x172a('0xf3')){delete this[_0x172a('0x26')][_0x50ca69[_0x172a('0xd9')]];this[_0x172a('0xae')](this[_0x172a('0x20')][_0x1d43a1[_0x172a('0xaf')]]);_0x56a225=new Hangup(_0x1d43a1,_0x50ca69);_0x56a225[_0x172a('0xa2')]=0x12;_0x56a225[_0x172a('0xa3')]=_0x172a('0xe1');_0x56a225[_0x172a('0xe2')]=_0x172a('0xf4');ami[_0x172a('0x4b')](_0x172a('0xe3'),ut[_0x172a('0xe4')](_0x56a225,_0x172a('0xe5')));this[_0x172a('0xcd')](_0x56a225,_0x172a('0xf5'),'[syncHangupInAMDIvr]');}if(_0x1d43a1[_0x172a('0x4c')]===_0x172a('0x78')&&this[_0x172a('0x20')][_0x1d43a1['queue']][_0x172a('0xdd')]&&_0x50ca69['value']===_0x172a('0xf6')){var _0x10f78d=this;return new BPromise(function(_0x1ee9d7,_0x532057){delete _0x10f78d[_0x172a('0x26')][_0x50ca69[_0x172a('0xd9')]];_0x10f78d[_0x172a('0xae')](_0x10f78d[_0x172a('0x20')][_0x1d43a1[_0x172a('0xaf')]]);_0x10f78d[_0x172a('0x20')][_0x1d43a1[_0x172a('0xaf')]][_0x172a('0xdf')]+=0x1;_0x10f78d[_0x172a('0x20')][_0x1d43a1[_0x172a('0xaf')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x20ab10=_0x10f78d[_0x172a('0x20')][_0x1d43a1[_0x172a('0xaf')]];var _0x3b0a29=new Hangup(_0x1d43a1,_0x50ca69);_0x3b0a29[_0x172a('0xa2')]=0x13;_0x3b0a29[_0x172a('0xa3')]=_0x172a('0xf7');_0x3b0a29['membername']=_0x172a('0xf4');_0x3b0a29[_0x172a('0xe6')]+=0x1;_0x3b0a29[_0x172a('0xf8')]+=0x1;_0x3b0a29[_0x172a('0xe5')]=!![];ami[_0x172a('0x4b')](_0x172a('0xe3'),ut[_0x172a('0xe4')](_0x3b0a29,'amd'));_0x10f78d[_0x172a('0xc9')](_0x3b0a29)['catch'](loggerCatch(_0x172a('0xe7')));if(_0x3b0a29['countbusyretry']+_0x3b0a29[_0x172a('0xf9')]+_0x3b0a29[_0x172a('0xfa')]+_0x3b0a29[_0x172a('0xe9')]+_0x3b0a29[_0x172a('0xfb')]+_0x3b0a29[_0x172a('0xea')]+_0x3b0a29['countmachineretry']+_0x3b0a29[_0x172a('0xfc')]>=_0x20ab10['dialGlobalMaxRetry']){_0x10f78d[_0x172a('0xeb')](_0x3b0a29,_0x1ee9d7,_0x532057,'reason19\x20machine....');}else{if(_0x3b0a29['countmachineretry']>=_0x20ab10['dialMachineMaxRetry']){_0x10f78d['createStateFinal'](_0x3b0a29,_0x1ee9d7,_0x532057,'reason\x2019\x20machine....');}else{_0x10f78d['rescheduleContact']({'active':![],'countmachineretry':_0x3b0a29['countmachineretry'],'scheduledat':moment()[_0x172a('0xef')](_0x20ab10[_0x172a('0xf0')],_0x172a('0xf1'))[_0x172a('0x76')](_0x172a('0xfd')),'ContactId':_0x3b0a29[_0x172a('0xcf')],'ListId':_0x3b0a29[_0x172a('0xd0')],'VoiceQueueId':_0x3b0a29[_0x172a('0xd1')]||undefined,'CampaignId':_0x3b0a29[_0x172a('0xf2')]||undefined})[_0x172a('0xb3')](loggerCatch(_0x172a('0xfe')));_0x1ee9d7({'reschedule':0x1});}}});}}};Dialer['prototype'][_0x172a('0x33')]=function(_0x1095ff){var _0x522019=this[_0x172a('0x26')][_0x1095ff[_0x172a('0xd9')]];var _0x5f29b3=this;var _0x46eb39;if(_0x522019&&_0x522019[_0x172a('0x4c')]===_0x172a('0x78')){delete this[_0x172a('0x26')][_0x1095ff[_0x172a('0xd9')]];this[_0x172a('0xae')](this[_0x172a('0x20')][_0x522019[_0x172a('0xaf')]]);this[_0x172a('0x20')][_0x522019[_0x172a('0xaf')]][_0x172a('0xff')]+=0x1;_0x46eb39=new Hangup(_0x522019,_0x1095ff);this[_0x172a('0xc9')](_0x46eb39)[_0x172a('0xb3')](loggerCatch(_0x172a('0x100')));this['moveContactManagedDialer'](_0x46eb39)[_0x172a('0xb3')](loggerCatch('[syncHangupIvr]'));}if(_0x522019&&_0x522019[_0x172a('0x4c')]!=='ivr'&&isNotNull(this['voiceQueues'][_0x522019[_0x172a('0xaf')]]['dialQueueProject'])){delete this[_0x172a('0x26')][_0x1095ff['uniqueid']];this[_0x172a('0xae')](this['voiceQueues'][_0x522019['queue']]);this[_0x172a('0x1f')][_0x522019[_0x172a('0xaf')]][_0x172a('0xdf')]+=0x1;this[_0x172a('0x1f')][_0x522019[_0x172a('0xaf')]][_0x172a('0xe0')]+=0x1;_0x46eb39=new Hangup(_0x522019,_0x1095ff);_0x46eb39[_0x172a('0xa2')]=0x10;_0x46eb39[_0x172a('0xa3')]='AnswerAGI';_0x46eb39['membername']=_0x172a('0x101');this[_0x172a('0xc9')](_0x46eb39)[_0x172a('0xb3')](loggerCatch(_0x172a('0x100')));this[_0x172a('0xc7')](_0x46eb39)[_0x172a('0xb3')](loggerCatch('[syncHangupIvr]'));}if(_0x522019&&_0x522019['type']!=='ivr'&&!isNotNull(this[_0x172a('0x1f')][_0x522019[_0x172a('0xaf')]]['dialQueueProject'])){delete this[_0x172a('0x26')][_0x1095ff['uniqueid']];this[_0x172a('0xae')](this[_0x172a('0x1f')][_0x522019[_0x172a('0xaf')]]);this[_0x172a('0x1f')][_0x522019['queue']][_0x172a('0x64')]+=0x1;_0x46eb39=new Hangup(_0x522019,_0x1095ff);_0x46eb39['state']=0xc;_0x46eb39[_0x172a('0xa3')]=_0x1095ff[_0x172a('0x102')];_0x46eb39[_0x172a('0xe2')]='Unknow';this['createHistory'](_0x46eb39)[_0x172a('0xb3')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x172a('0xc7')](_0x46eb39)[_0x172a('0xb3')](loggerCatch(_0x172a('0x103')));}};Dialer[_0x172a('0x19')]['syncAgentComplete']=function(_0x1870cb){var _0x2c530f=this[_0x172a('0x26')][_0x1870cb[_0x172a('0xd9')]];var _0x27d17a=this;if(this[_0x172a('0x1f')][_0x1870cb[_0x172a('0xaf')]]){if(_0x2c530f&&_0x2c530f[_0x172a('0x4c')]!==_0x172a('0x78')){delete this[_0x172a('0x26')][_0x1870cb[_0x172a('0xd9')]];this['voiceQueues'][_0x1870cb[_0x172a('0xaf')]][_0x172a('0xdf')]+=0x1;var _0xccbc2b=new AgentComplete(_0x2c530f,_0x1870cb);if(_0x1870cb[_0x172a('0x104')]==='agent'){_0xccbc2b['agiafterat']=this[_0x172a('0x1f')][_0x1870cb['queue']][_0x172a('0x105')]&&this[_0x172a('0x1f')][_0x1870cb[_0x172a('0xaf')]][_0x172a('0x106')]?moment()['format'](_0x172a('0xfd')):undefined;}this['createHistory'](_0xccbc2b)[_0x172a('0xb3')](loggerCatch(_0x172a('0x107')));this[_0x172a('0xc7')](_0xccbc2b)['catch'](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0x172a('0x19')][_0x172a('0x2c')]=function(_0x571343){if(this[_0x172a('0x1f')][_0x571343['queue']]){if(this['uniqueId'][_0x571343['uniqueid']]&&this[_0x172a('0x26')][_0x571343[_0x172a('0xd9')]][_0x172a('0x4c')]!=='ivr'){this[_0x172a('0xae')](this['voiceQueues'][_0x571343[_0x172a('0xaf')]]);this[_0x172a('0x26')][_0x571343[_0x172a('0xd9')]][_0x172a('0x108')]=moment()[_0x172a('0x76')](_0x172a('0xfd'));}}};Dialer[_0x172a('0x19')]['queueCallerAbandonCreateState']=function(_0x15ffb1,_0x2dfc40){this['createHistory'](_0x15ffb1)[_0x172a('0xb3')](loggerCatch(_0x172a('0x107')));if(_0x2dfc40==0x0){this[_0x172a('0xc7')](_0x15ffb1)[_0x172a('0xb3')](loggerCatch(_0x172a('0x109')));}};Dialer[_0x172a('0x19')][_0x172a('0x2f')]=function(_0x4694f2){var _0x2aee2c=this[_0x172a('0x26')][_0x4694f2[_0x172a('0xd9')]];var _0x39aec6=this;var _0x43f5c6=![];var _0x4e2f2a;var _0x373a2a;if(this[_0x172a('0x1f')][_0x4694f2['queue']]){if(_0x2aee2c&&_0x2aee2c['type']!==_0x172a('0x78')){delete this['uniqueId'][_0x4694f2[_0x172a('0xd9')]];this[_0x172a('0xae')](this[_0x172a('0x1f')][_0x4694f2[_0x172a('0xaf')]]);_0x2aee2c['droptime']=moment()[_0x172a('0x76')](_0x172a('0xfd'));var _0x3c3937=new QueueCallerAbandon(_0x2aee2c,_0x4694f2);if(getSeconds(_0x2aee2c['droptime'],_0x2aee2c[_0x172a('0x10a')])>=_0x2aee2c[_0x172a('0x10b')]){this[_0x172a('0x1f')][_0x4694f2['queue']][_0x172a('0x68')]+=0x1;this[_0x172a('0x1f')][_0x4694f2[_0x172a('0xaf')]][_0x172a('0x5f')]+=0x1;this[_0x172a('0x1f')][_0x4694f2[_0x172a('0xaf')]][_0x172a('0x6a')]+=0x1;_0x3c3937['state']=0xa;_0x3c3937['statedesc']=_0x172a('0x10c');_0x3c3937[_0x172a('0x10d')]=_0x172a('0x10e');_0x3c3937['agiafterat']=this[_0x172a('0x1f')][_0x4694f2['queue']]['dialQueueProject2']?moment()['format'](_0x172a('0xfd')):undefined;_0x3c3937[_0x172a('0xfb')]+=0x1;_0x3c3937[_0x172a('0xf8')]+=0x1;_0x4e2f2a=this[_0x172a('0x1f')][_0x4694f2[_0x172a('0xaf')]]['dialDropRetryFrequency'];_0x373a2a=this['voiceQueues'][_0x4694f2[_0x172a('0xaf')]][_0x172a('0x10f')];_0x39aec6[_0x172a('0xb8')](_0x3c3937,_0x3c3937[_0x172a('0xa2')],_0x2aee2c[_0x172a('0x110')])[_0x172a('0xb2')](function(_0x107d5c){_0x43f5c6=_0x107d5c[_0x172a('0x111')]==0x1;if(_0x3c3937[_0x172a('0xfb')]>=_0x39aec6[_0x172a('0x1f')][_0x4694f2[_0x172a('0xaf')]][_0x172a('0x112')]){_0x39aec6[_0x172a('0x113')](_0x3c3937,_0x107d5c[_0x172a('0x111')]);}else{_0x39aec6[_0x172a('0xbe')]({'active':![],'countdropretry':_0x3c3937[_0x172a('0xfb')],'scheduledat':moment()[_0x172a('0xef')](_0x39aec6[_0x172a('0x1f')][_0x4694f2[_0x172a('0xaf')]][_0x172a('0x114')],_0x172a('0xf1'))[_0x172a('0x76')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2aee2c[_0x172a('0xcf')],'ListId':_0x2aee2c['ListId'],'VoiceQueueId':_0x2aee2c[_0x172a('0xd1')]||undefined,'CampaignId':_0x2aee2c['CampaignId']||undefined})[_0x172a('0xb3')](loggerCatch('[rescheduleContact][Drop]'));var _0x3974dd=new History(_0x3c3937);_0x3974dd['state']=0xa;_0x3974dd[_0x172a('0xa3')]='Drop';_0x3974dd[_0x172a('0xa5')]=moment()[_0x172a('0x76')](_0x172a('0xfd'));_0x3974dd[_0x172a('0xa4')]=_0x3974dd[_0x172a('0xa5')];_0x3974dd[_0x172a('0x115')]=_0x3c3937['calleridname'];_0x3974dd['calleridnum']=_0x3c3937[_0x172a('0x116')];_0x39aec6[_0x172a('0xc9')](_0x3974dd)[_0x172a('0xb3')](loggerCatch('[syncAgentComplete][createHistory][10]'));}})['then'](function(_0x5c7e2a){if(_0x43f5c6)_0x39aec6['swapAdditionalPhones'](_0x3c3937,_0x4e2f2a,_0x373a2a)[_0x172a('0xb2')](function(_0x4db17e){return 0x1;});});}else{this[_0x172a('0x1f')][_0x4694f2[_0x172a('0xaf')]][_0x172a('0x67')]+=0x1;this[_0x172a('0x1f')][_0x4694f2[_0x172a('0xaf')]]['outboundDropCallsDayCallersExit']+=0x1;_0x3c3937['state']=0xb;_0x3c3937[_0x172a('0xa3')]=_0x172a('0x117');_0x3c3937['dropreason']=_0x172a('0x118');_0x3c3937[_0x172a('0xea')]+=0x1;_0x3c3937[_0x172a('0xf8')]+=0x1;_0x4e2f2a=this[_0x172a('0x1f')][_0x4694f2[_0x172a('0xaf')]][_0x172a('0x119')];_0x373a2a=this[_0x172a('0x1f')][_0x4694f2[_0x172a('0xaf')]][_0x172a('0x10f')];_0x39aec6['verifyAdditionalPhones'](_0x3c3937,_0x3c3937[_0x172a('0xa2')],_0x2aee2c[_0x172a('0x110')])[_0x172a('0xb2')](function(_0x4b17e6){if(_0x3c3937[_0x172a('0xea')]>=_0x39aec6[_0x172a('0x1f')][_0x4694f2[_0x172a('0xaf')]][_0x172a('0x11a')]){_0x39aec6[_0x172a('0x113')](_0x3c3937,_0x4b17e6['additional']);}else{_0x39aec6[_0x172a('0xbe')]({'active':![],'countabandonedretry':_0x3c3937[_0x172a('0xea')],'scheduledat':moment()[_0x172a('0xef')](_0x39aec6['voiceQueues'][_0x4694f2[_0x172a('0xaf')]][_0x172a('0x119')],'minutes')[_0x172a('0x76')](_0x172a('0xfd')),'ContactId':_0x2aee2c[_0x172a('0xcf')],'ListId':_0x2aee2c[_0x172a('0xd0')],'VoiceQueueId':_0x2aee2c[_0x172a('0xd1')]||undefined,'CampaignId':_0x2aee2c[_0x172a('0xf2')]||undefined})[_0x172a('0xb3')](loggerCatch(_0x172a('0x11b')));var _0x6f3f73=new History(_0x3c3937);_0x6f3f73['state']=0xb;_0x6f3f73[_0x172a('0xa3')]='Abandoned';_0x6f3f73[_0x172a('0xa5')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x6f3f73['endtime']=_0x6f3f73[_0x172a('0xa5')];_0x6f3f73[_0x172a('0x115')]=_0x3c3937[_0x172a('0x115')];_0x6f3f73[_0x172a('0x116')]=_0x3c3937[_0x172a('0x116')];_0x39aec6[_0x172a('0xc9')](_0x6f3f73)[_0x172a('0xb3')](loggerCatch(_0x172a('0x11c')));}})[_0x172a('0xb2')](function(_0x11dfc8){if(_0x43f5c6)_0x39aec6[_0x172a('0xb9')](_0x3c3937,_0x4e2f2a,_0x373a2a)[_0x172a('0xb2')](function(_0x16c2d4){return 0x1;});});}}}};Dialer['prototype']['syncNewExten']=function(_0x2861f3){if(this[_0x172a('0x24')][_0x2861f3['uniqueid']]){this['actions'][_0x2861f3[_0x172a('0xd9')]][_0x172a('0xac')]=_0x2861f3[_0x172a('0xac')];}if(this[_0x172a('0x26')][_0x2861f3['uniqueid']]){this[_0x172a('0x26')][_0x2861f3[_0x172a('0xd9')]][_0x172a('0xac')]=_0x2861f3[_0x172a('0xac')];}};Dialer[_0x172a('0x19')]['syncQueueMember']=function(_0x1238d8){if(strategy[this[_0x172a('0x1f')][this[_0x172a('0x24')][_0x1238d8[_0x172a('0x11d')]][_0x172a('0xaf')]][_0x172a('0x4e')]]==='roundrobin'){if(this[_0x172a('0x24')][_0x1238d8[_0x172a('0x11d')]]&&_['isNil'](this['actions'][_0x1238d8[_0x172a('0x11d')]][_0x172a('0x11e')])&&_0x1238d8['status']==='1'&&_0x1238d8[_0x172a('0x11f')]==='0'){if(this[_0x172a('0x21')][_0x1238d8['stateinterface']]){if(!this[_0x172a('0x21')][_0x1238d8[_0x172a('0x120')]]['locked']){this[_0x172a('0x21')][_0x1238d8['stateinterface']]['locked']=!![];this[_0x172a('0x24')][_0x1238d8['actionid']][_0x172a('0x11e')]=!![];this[_0x172a('0x24')][_0x1238d8[_0x172a('0x11d')]][_0x172a('0x120')]=_0x1238d8['stateinterface'];}}}}else if((strategy[this[_0x172a('0x1f')][this[_0x172a('0x24')][_0x1238d8[_0x172a('0x11d')]][_0x172a('0xaf')]][_0x172a('0x4e')]]||'rrmemory')===_0x172a('0x17')){if(this[_0x172a('0x24')][_0x1238d8[_0x172a('0x11d')]]){if(this[_0x172a('0x21')][_0x1238d8[_0x172a('0x120')]]){this['actions'][_0x1238d8[_0x172a('0x11d')]]['stateinterface']=_0x1238d8[_0x172a('0x120')];if(_[_0x172a('0xa9')](this[_0x172a('0x2b')][this[_0x172a('0x24')][_0x1238d8[_0x172a('0x11d')]][_0x172a('0xaf')]])){this[_0x172a('0x2b')][this[_0x172a('0x24')][_0x1238d8[_0x172a('0x11d')]]['queue']]=[];}this[_0x172a('0x2b')][this[_0x172a('0x24')][_0x1238d8[_0x172a('0x11d')]][_0x172a('0xaf')]][_0x172a('0x121')](_['merge'](_[_0x172a('0xce')](this['actions'][_0x1238d8[_0x172a('0x11d')]],[_0x172a('0x122'),_0x172a('0x120')]),{'status':_0x1238d8[_0x172a('0xab')],'paused':_0x1238d8[_0x172a('0x11f')]}));}}}};function unlockQueueStatus(_0x46a9e3,_0x4fef4c){setTimeout(function(){if(_[_0x172a('0x84')](_0x46a9e3[_0x172a('0x123')])){loggerBooked['error'](_0x172a('0x124'),_0x4fef4c);}_0x46a9e3[_0x172a('0x123')]=!![];loggerBooked[_0x172a('0x7b')](_0x172a('0x125'),_0x4fef4c,JSON[_0x172a('0x48')](_[_0x172a('0xce')](_0x46a9e3,[_0x172a('0x40'),_0x172a('0x123')])));},0x1f3);}Dialer[_0x172a('0x19')][_0x172a('0x3a')]=function(_0x2bdcdf){var _0x54bd9b=this;var _0x4b96fd=_0x54bd9b[_0x172a('0x1f')][_0x54bd9b[_0x172a('0x24')][_0x2bdcdf[_0x172a('0x11d')]][_0x172a('0xaf')]];if(strategy[this[_0x172a('0x1f')][this[_0x172a('0x24')][_0x2bdcdf[_0x172a('0x11d')]][_0x172a('0xaf')]][_0x172a('0x4e')]]===_0x172a('0x18')){if(this[_0x172a('0x24')][_0x2bdcdf[_0x172a('0x11d')]]&&this[_0x172a('0x24')][_0x2bdcdf['actionid']]['stateinterface']){this[_0x172a('0x1e')][_0x172a('0x126')](this[_0x172a('0x24')][_0x2bdcdf[_0x172a('0x11d')]][_0x172a('0x122')],this[_0x172a('0x24')][_0x2bdcdf['actionid']][_0x172a('0x120')])[_0x172a('0xb3')](function(_0x5cfd90){logger['error'](_0x172a('0x127'),util['inspect'](_0x5cfd90,{'showHidden':![],'depth':null}));})[_0x172a('0x1c')](function(){_0x54bd9b[_0x172a('0xae')](_0x54bd9b['voiceQueues'][_0x54bd9b['actions'][_0x2bdcdf[_0x172a('0x11d')]][_0x172a('0xaf')]]);_0x54bd9b[_0x172a('0x21')][_0x54bd9b[_0x172a('0x24')][_0x2bdcdf[_0x172a('0x11d')]][_0x172a('0x120')]]['locked']=![];delete _0x54bd9b['actions'][_0x2bdcdf[_0x172a('0x11d')]];unlockQueueStatus(_0x4b96fd);});}else{this['updateOriginated'](this[_0x172a('0x1f')][this[_0x172a('0x24')][_0x2bdcdf['actionid']]['queue']]);this[_0x172a('0xbe')]({'active':![],'ContactId':this[_0x172a('0x24')][_0x2bdcdf[_0x172a('0x11d')]]['ContactId'],'ListId':this[_0x172a('0x24')][_0x2bdcdf[_0x172a('0x11d')]][_0x172a('0xd0')],'VoiceQueueId':this[_0x172a('0x24')][_0x2bdcdf['actionid']][_0x172a('0xd1')]||undefined,'CampaignId':this[_0x172a('0x24')][_0x2bdcdf[_0x172a('0x11d')]][_0x172a('0xf2')]||undefined})[_0x172a('0xb3')](loggerCatch(_0x172a('0x128')));delete this['actions'][_0x2bdcdf[_0x172a('0x11d')]];unlockQueueStatus(_0x4b96fd);}}else if((strategy[this[_0x172a('0x1f')][this['actions'][_0x2bdcdf[_0x172a('0x11d')]]['queue']][_0x172a('0x4e')]]||'rrmemory')==='rrmemory'){var _0x23130f;if(this[_0x172a('0x24')][_0x2bdcdf[_0x172a('0x11d')]]&&!_[_0x172a('0x46')](this[_0x172a('0x2b')][this[_0x172a('0x24')][_0x2bdcdf[_0x172a('0x11d')]][_0x172a('0xaf')]])){if(this[_0x172a('0x129')][_0x54bd9b['actions'][_0x2bdcdf['actionid']][_0x172a('0xaf')]]){this[_0x172a('0x129')][_0x54bd9b['actions'][_0x2bdcdf['actionid']][_0x172a('0xaf')]]=this[_0x172a('0x129')][this['actions'][_0x2bdcdf[_0x172a('0x11d')]][_0x172a('0xaf')]]?this[_0x172a('0x129')][this[_0x172a('0x24')][_0x2bdcdf[_0x172a('0x11d')]][_0x172a('0xaf')]]:this['queueBooked'][this[_0x172a('0x24')][_0x2bdcdf['actionid']][_0x172a('0xaf')]]?this[_0x172a('0x2b')][this[_0x172a('0x24')][_0x2bdcdf[_0x172a('0x11d')]][_0x172a('0xaf')]]['_rr']||0x0:0x0;}this['queueBooked'][this[_0x172a('0x24')][_0x2bdcdf[_0x172a('0x11d')]][_0x172a('0xaf')]]['_rr']=this[_0x172a('0x129')][this[_0x172a('0x24')][_0x2bdcdf[_0x172a('0x11d')]][_0x172a('0xaf')]];for(var _0x42db6c=0x0;_0x42db6c=0x0;})[_0x172a('0xb3')](myreject(_0x4c2c3e)));}}else{_0x451151[_0x172a('0x121')](ami[_0x172a('0xaa')]({'action':_0x172a('0x13f'),'command':util[_0x172a('0x76')](_0x172a('0x140'),_0xd0865a,!_[_0x172a('0x84')](config['timezones'][_0x1d3fff])?_0x1d3fff:'')})['then'](function(_0x15db5e){return _0x15db5e[_0x172a('0x144')][_0x172a('0x142')](_0x172a('0x143'))>=0x0;})[_0x172a('0xb3')](myreject(_0x4c2c3e)));}BPromise[_0x172a('0x145')](_0x451151)['then'](function(_0x20dcf6){var _0x41f5fd=_[_0x172a('0x146')](_0x20dcf6);if(_0x41f5fd){return _0xc5644a(_0x41f5fd);}else{_0x135e6a[_0x172a('0x3d')]=_0x40d621?'GLOBAL_INTERVAL_IS_OVERTIME':_0x172a('0x147');return _0x4c2c3e(msgResponse('[ifTime][promiseAll]',_0x172a('0x13a'),_0x172a('0x148')+_0x40d621+'\x20'+_0x943f26+_0x172a('0x149')+util[_0x172a('0x92')](_0xd0865a,{'showHidden':![],'depth':null})+_0x172a('0x14a')+_0x1d3fff));}})[_0x172a('0xb3')](function(_0x28ff66){return _0x4c2c3e(msgResponse('ifTime','Failure',JSON[_0x172a('0x48')](_0x28ff66)));});});};Dialer[_0x172a('0x19')][_0x172a('0x14b')]=function(_0x5f0285){var _0x266ff4=this;return function(){switch(_0x5f0285[_0x172a('0x14c')]){case _0x172a('0x14d'):freeVariablesPredictive(_0x5f0285);_0x266ff4['handlePower'](_0x5f0285,0x1);break;case'power':freeVariablesPredictive(_0x5f0285);_0x266ff4[_0x172a('0x14e')](_0x5f0285,_0x5f0285[_0x172a('0x14f')]);break;case _0x172a('0x150'):_0x266ff4[_0x172a('0x150')](_0x5f0285);break;case _0x172a('0x151'):freeVariablesPredictive(_0x5f0285);_0x266ff4['handlePower'](_0x5f0285,0x1);break;default:freeVariablesPredictive(_0x5f0285);logger[_0x172a('0x91')](_0x172a('0x152'),_0x5f0285[_0x172a('0x40')],'method\x20not\x20recognized');}};};Dialer[_0x172a('0x19')][_0x172a('0x153')]=function(_0x30cd9f){var _0x2aa2d2=this;return function(){_0x2aa2d2[_0x172a('0x154')](_0x30cd9f);};};Dialer[_0x172a('0x19')][_0x172a('0x7')]=function(_0x3016ab){var _0x59e297=this;if(isNotPreview(_0x3016ab[_0x172a('0x14c')])){if(isVoiceQueueOutbound(_0x3016ab[_0x172a('0x4c')])&&isActive(_0x3016ab['dialActive'])){_0x3016ab[_0x172a('0x9c')]=!![];BPromise[_0x172a('0xb6')]()[_0x172a('0xb2')](checkIsLoggedIn(_0x3016ab,_0x3016ab[_0x172a('0x50')]))[_0x172a('0xb2')](checkIsActive(_0x3016ab,_0x3016ab[_0x172a('0x59')]))[_0x172a('0xb2')](checkInterval(_0x3016ab))[_0x172a('0xb2')](_0x59e297[_0x172a('0x155')](_0x3016ab))[_0x172a('0xb2')](_0x59e297[_0x172a('0x136')](_0x3016ab[_0x172a('0x156')],_0x3016ab[_0x172a('0x157')],_0x3016ab['name'],_0x3016ab))[_0x172a('0xb2')](_0x59e297[_0x172a('0x158')](_0x3016ab[_0x172a('0x42')],_0x3016ab[_0x172a('0x157')],_0x3016ab[_0x172a('0x40')],_0x3016ab))[_0x172a('0xb2')](_0x59e297[_0x172a('0x14b')](_0x3016ab))[_0x172a('0xb3')](loggerCatchQueueSummary('[syncQueueSummary]',_0x3016ab));}else{notSendMessagesQueue(_0x3016ab);}}else{freeVariablesPredictive(_0x3016ab);}};Dialer[_0x172a('0x19')][_0x172a('0x133')]=function(){var _0x4b9a95=this;var _0x7440d3;for(var _0x7c3b6b in this[_0x172a('0x20')]){if(typeof this[_0x172a('0x20')][_0x7c3b6b]!==_0x172a('0x95')){_0x7440d3=this['campaigns'][_0x7c3b6b];if(isCampaignIvr(_0x7440d3[_0x172a('0x4c')])&&isActive(_0x7440d3[_0x172a('0x75')])){_0x7440d3['sendMessageOneNotActive']=!![];BPromise[_0x172a('0xb6')]()[_0x172a('0xb2')](checkIsActive(_0x7440d3,_0x7440d3[_0x172a('0x75')]))[_0x172a('0xb2')](checkInterval(_0x7440d3))[_0x172a('0xb2')](_0x4b9a95[_0x172a('0x155')](_0x7440d3))[_0x172a('0xb2')](_0x4b9a95[_0x172a('0x136')](_0x7440d3[_0x172a('0x156')],_0x7440d3[_0x172a('0x157')],_0x7440d3[_0x172a('0x40')],_0x7440d3))['then'](_0x4b9a95[_0x172a('0x158')](_0x7440d3[_0x172a('0x42')],_0x7440d3[_0x172a('0x157')],_0x7440d3[_0x172a('0x40')],_0x7440d3))['then'](_0x4b9a95[_0x172a('0x153')](_0x7440d3))[_0x172a('0xb3')](loggerCatchQueueSummary(_0x172a('0x159'),_0x7440d3));}else{notSendMessagesCampaign(_0x7440d3);}}}};function getCallerIdRandom(_0x31f39e,_0x3e60e2){var _0x5e45fb;var _0x31a01c;var _0x167a21;if(_0x3e60e2<=0x0){_0x3e60e2=0x1;}_0x5e45fb=new RegExp(_0x172a('0x15a')+_0x3e60e2+'}$');_0x31a01c=Math[_0x172a('0x15b')](0xa,_0x3e60e2-0x1);_0x167a21=Math[_0x172a('0x15b')](0xa,_0x3e60e2)-0x1;return util[_0x172a('0x76')]('%s',_[_0x172a('0x15c')](_0x31f39e,_0x5e45fb,_[_0x172a('0x15d')](_0x31a01c,_0x167a21)));}function extractCalleridName(_0x3c7cb0){var _0x475e82=_0x3c7cb0['match'](/"(.*?)"/);return _0x475e82?_0x475e82[0x1]:_0x3c7cb0;}function extractCalleridNumber(_0x3b34e6){var _0x2112ad=_0x3b34e6[_0x172a('0x15e')](/<(.*?)>/);return _0x2112ad?_0x2112ad[0x1]:_0x3b34e6;}Dialer[_0x172a('0x19')]['actionOriginate']=function(_0x1d3378,_0x399818){var _0x448565=this;var _0x364d0f=uuid['v4']();this[_0x172a('0x24')][_0x364d0f]=new Action(_0x1d3378,_0x399818,_0x364d0f);return new BPromise(function(_0x3c2ceb,_0x46191f){if(_[_0x172a('0x84')](_0x1d3378)&&typeof _0x1d3378!=='object'){return _0x46191f(msgResponse('originate',_0x172a('0x13a'),'voiceQueue\x20is\x20undefine'));}if(_[_0x172a('0x84')](_0x399818[_0x172a('0x15f')])||_0x399818[_0x172a('0x15f')]===null){return _0x46191f(msgResponse(_0x172a('0x160'),_0x172a('0x13a'),'contact\x20is\x20undefine'));}var _0x372e69={'XMD-CALLERID':_0x448565[_0x172a('0x24')][_0x364d0f]['getCaller'](),'XMD-AGI':_0x1d3378[_0x172a('0x161')]?util[_0x172a('0x76')](_0x172a('0x162'),ipAgi,_0x1d3378[_0x172a('0x161')]):'NONE','XMD-AGIAFTER':_0x1d3378[_0x172a('0x105')]?util['format'](_0x172a('0x162'),ipAgi,_0x1d3378['dialQueueProject2']):_0x172a('0x163'),'XMD-QUEUE':_0x1d3378[_0x172a('0x4c')]==='outbound'?util[_0x172a('0x76')](_0x172a('0x164'),_0x1d3378[_0x172a('0x40')],_0x1d3378[_0x172a('0x165')]||'',_0x1d3378[_0x172a('0x106')]?'c':'',_0x1d3378['dialQueueTimeout']||0x3):'NONE','XMD-CONTACTID':_0x399818[_0x172a('0xcf')],'XMD-CDRTYPE':_0x172a('0x166'),'CALLERID(all)':_0x448565[_0x172a('0x24')][_0x364d0f][_0x172a('0x167')](),'XMD-AMD':_0x1d3378[_0x172a('0xdd')]?'ACTIVE':_0x172a('0x163'),'XMD-DESTINATION':_0x172a('0xdc')};if(_0x1d3378[_0x172a('0xdd')]){_0x372e69[_0x172a('0x168')]=_0x1d3378[_0x172a('0x169')]||0x9c4;_0x372e69[_0x172a('0x16a')]=_0x1d3378[_0x172a('0x16b')]||0x5dc;_0x372e69[_0x172a('0x16c')]=_0x1d3378[_0x172a('0x16d')]||0x320;_0x372e69[_0x172a('0x16e')]=_0x1d3378[_0x172a('0x16f')]||0x1388;_0x372e69['XMD-AMDMINWORDLENGTH']=_0x1d3378[_0x172a('0x170')]||0x64;_0x372e69[_0x172a('0x171')]=_0x1d3378[_0x172a('0x172')]||0x32;_0x372e69[_0x172a('0x173')]=_0x1d3378[_0x172a('0x174')]||0x3;_0x372e69['XMD-AMDSILENCETHRESHOLD']=_0x1d3378['dialAMDSilenceThreshold']||0x100;_0x372e69['XMD-AMDMAXIMUMWORDLENGTH']=_0x1d3378['dialAMDMaximumWordLength']||0x1388;}if(_0x1d3378[_0x172a('0x4c')]===_0x172a('0x4d')){_0x372e69[_0x172a('0x175')]=_0x399818[_0x172a('0xd1')];}else{_0x372e69['XMD-CAMPAIGNID']=_0x399818[_0x172a('0xf2')];}for(var _0x1bf952 in _0x399818[_0x172a('0x176')]){if(typeof _0x399818['Contact'][_0x1bf952]!==_0x172a('0x95')){if(isNotNull(_0x399818[_0x172a('0x176')][_0x1bf952])&&_0x1bf952!=='id'&&_0x1bf952!==_0x172a('0x177')&&_0x1bf952!=='createdAt'&&_0x1bf952!=='updatedAt'){_0x372e69[util[_0x172a('0x76')](_0x172a('0x178'),'XMD-',_['toUpper'](_0x1bf952))]=_0x399818[_0x172a('0x176')][_0x1bf952];}}}var _0x2e92e4=_0x448565['isTrunkReachable'](_0x1d3378[_0x172a('0x74')])?getCallerId(_0x1d3378[_0x172a('0x74')][_0x172a('0x179')],_0x1d3378[_0x172a('0x17a')],_0x1d3378[_0x172a('0x17b')]>0x0?getCallerIdRandom(_0x1d3378[_0x172a('0x17c')],_0x1d3378['dialRandomLastDigitCallerIdNumber']):_0x1d3378[_0x172a('0x17c')]):getCallerId(_[_0x172a('0xa9')](_0x1d3378['TrunkBackup'])?_0x1d3378[_0x172a('0x74')][_0x172a('0x179')]:_0x1d3378[_0x172a('0x134')][_0x172a('0x179')],_0x1d3378[_0x172a('0x17a')],_0x1d3378[_0x172a('0x17b')]>0x0?getCallerIdRandom(_0x1d3378[_0x172a('0x17c')],_0x1d3378[_0x172a('0x17b')]):_0x1d3378[_0x172a('0x17c')]);if(_0x2e92e4){_0x372e69[_0x172a('0x17d')]=_0x448565[_0x172a('0x24')][_0x364d0f][_0x172a('0x17e')]=extractCalleridName(_0x2e92e4);_0x372e69[_0x172a('0x17f')]=_0x399818[_0x172a('0x15f')];}return ami[_0x172a('0xaa')]({'actionid':_0x364d0f,'action':'originate','channel':_0x448565[_0x172a('0xd5')](_0x1d3378['Trunk'])?util[_0x172a('0x76')]('SIP/%s/%s%s',_0x1d3378['Trunk'][_0x172a('0x40')],isNotNull(_0x1d3378[_0x172a('0x180')])?_0x1d3378[_0x172a('0x180')][_0x172a('0x181')]()||'':'',_0x1d3378['dialCutDigit']>0x0?_0x399818['phone'][_0x172a('0x182')](_0x1d3378[_0x172a('0x183')]):_0x399818['phone']):util[_0x172a('0x76')](_0x172a('0x184'),_[_0x172a('0xa9')](_0x1d3378[_0x172a('0x134')])?_0x1d3378[_0x172a('0x74')][_0x172a('0x40')]:_0x1d3378[_0x172a('0x134')][_0x172a('0x40')],isNotNull(_0x1d3378[_0x172a('0x180')])?_0x1d3378[_0x172a('0x180')][_0x172a('0x181')]()||'':'',_0x1d3378[_0x172a('0x183')]>0x0?_0x399818[_0x172a('0x15f')][_0x172a('0x182')](_0x1d3378['dialCutDigit']):_0x399818[_0x172a('0x15f')]),'callerid':_0x2e92e4,'Exten':_0x172a('0xdc'),'Context':_0x172a('0x185'),'Priority':'1','variable':_0x372e69,'timeout':(_0x1d3378['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x364d0f})['then'](function(_0x308185){return _0x3c2ceb(_0x308185);})['catch'](function(_0x369f63){_0x1d3378['outboundOriginateFailureCallsDay']+=0x1;var _0x368116=new History(_0x448565['actions'][_0x364d0f]);logger[_0x172a('0x91')](util[_0x172a('0x76')](_0x172a('0x186'),JSON['stringify'](_0x369f63)));_0x368116[_0x172a('0xa2')]=0xe;_0x368116['statedesc']=_0x172a('0x187');_0x368116[_0x172a('0xa5')]=moment()[_0x172a('0x76')](_0x172a('0xfd'));_0x368116['endtime']=_0x368116[_0x172a('0xa5')];_0x448565[_0x172a('0xc9')](_0x368116)[_0x172a('0xb3')](loggerCatch(_0x172a('0x188')));_0x448565[_0x172a('0xc7')](_0x368116)['catch'](loggerCatch(_0x172a('0x188')))[_0x172a('0x1c')](function(){delete _0x448565[_0x172a('0x24')][_0x364d0f];return _0x46191f(msgResponse('originate',_0x172a('0x47'),_0x172a('0x189')));});});});};Dialer[_0x172a('0x19')][_0x172a('0x30')]=function(_0x17f51f){var _0x2cf3b3=this[_0x172a('0x24')][_0x17f51f[_0x172a('0x11d')]];if(_0x2cf3b3){delete this[_0x172a('0x24')][_0x17f51f['actionid']];_0x2cf3b3[_0x172a('0x10a')]=moment()[_0x172a('0x76')]('YYYY-MM-DD\x20HH:mm:ss');var _0x66cfba=_0x2cf3b3[_0x172a('0x4c')]===_0x172a('0x78')?this[_0x172a('0x20')][_0x2cf3b3[_0x172a('0xaf')]]:this['voiceQueues'][_0x2cf3b3[_0x172a('0x18a')]()];if(!this[_0x172a('0xd4')](_0x17f51f[_0x172a('0x18b')])){this[_0x172a('0xae')](_0x66cfba);return this[_0x172a('0x18c')](_0x2cf3b3,_0x66cfba,_0x17f51f)[_0x172a('0xb3')](loggerCatch(_0x172a('0x18d')));}this[_0x172a('0x26')][_0x17f51f[_0x172a('0xd9')]]=_0x2cf3b3;}};Dialer[_0x172a('0x19')][_0x172a('0x18e')]=function(_0x185a9c,_0xd9a4f3,_0x43d40d){var _0x16a8be=new History(_0xd9a4f3);if(_0x16a8be['countbusyretry']+_0x16a8be[_0x172a('0xf9')]+_0x16a8be[_0x172a('0xfa')]+_0x16a8be['countnosuchnumberretry']+_0x16a8be['countdropretry']+_0x16a8be['countabandonedretry']+_0x16a8be[_0x172a('0xe6')]+_0x16a8be[_0x172a('0xfc')]>=_0x43d40d[_0x172a('0x18f')]-0x1){return!![];}switch(_0x185a9c){case 0x3:if(_0x16a8be[_0x172a('0xfa')]>=_0x43d40d[_0x172a('0x190')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countnoanswerretry':_0x16a8be[_0x172a('0xfa')]+=0x1,'scheduledat':moment()[_0x172a('0xef')](_0x43d40d['dialNoAnswerRetryFrequency'],_0x172a('0xf1'))[_0x172a('0x76')](_0x172a('0xfd')),'ContactId':_0x16a8be[_0x172a('0xcf')],'ListId':_0x16a8be['ListId'],'VoiceQueueId':_0x16a8be['VoiceQueueId']||undefined,'CampaignId':_0x16a8be['CampaignId']||undefined})[_0x172a('0xb3')](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x16a8be[_0x172a('0xe8')]>=_0x43d40d['dialBusyMaxRetry']-0x1){return!![];}this[_0x172a('0xbe')]({'active':![],'countbusyretry':_0x16a8be[_0x172a('0xe8')]+=0x1,'scheduledat':moment()[_0x172a('0xef')](_0x43d40d[_0x172a('0x191')],_0x172a('0xf1'))[_0x172a('0x76')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x16a8be['ContactId'],'ListId':_0x16a8be['ListId'],'VoiceQueueId':_0x16a8be[_0x172a('0xd1')]||undefined,'CampaignId':_0x16a8be['CampaignId']||undefined})['catch'](loggerCatch(_0x172a('0x192')));break;case 0x8:if(_0x16a8be[_0x172a('0xf9')]>=_0x43d40d[_0x172a('0x193')]-0x1){return!![];}this[_0x172a('0xbe')]({'active':![],'countcongestionretry':_0x16a8be[_0x172a('0xf9')]+=0x1,'scheduledat':moment()[_0x172a('0xef')](_0x43d40d['dialCongestionRetryFrequency'],_0x172a('0xf1'))[_0x172a('0x76')](_0x172a('0xfd')),'ContactId':_0x16a8be['ContactId'],'ListId':_0x16a8be[_0x172a('0xd0')],'VoiceQueueId':_0x16a8be['VoiceQueueId']||undefined,'CampaignId':_0x16a8be[_0x172a('0xf2')]||undefined})['catch'](loggerCatch(_0x172a('0x194')));break;case 0x0:if(_0x16a8be[_0x172a('0xe9')]>=_0x43d40d[_0x172a('0x195')]-0x1){return!![];}else{this[_0x172a('0xbe')]({'active':![],'countnosuchnumberretry':_0x16a8be[_0x172a('0xe9')]+=0x1,'scheduledat':moment()['add'](_0x43d40d['dialNoSuchNumberRetryFrequency'],_0x172a('0xf1'))['format'](_0x172a('0xfd')),'ContactId':_0x16a8be[_0x172a('0xcf')],'ListId':_0x16a8be[_0x172a('0xd0')],'VoiceQueueId':_0x16a8be[_0x172a('0xd1')]||undefined,'CampaignId':_0x16a8be[_0x172a('0xf2')]||undefined})[_0x172a('0xb3')](loggerCatch(_0x172a('0x196')));}break;case 0xa:if(_0x16a8be[_0x172a('0xfb')]>=_0x43d40d[_0x172a('0x112')]-0x1){return!![];}this[_0x172a('0xbe')]({'active':![],'countdropretry':_0x16a8be['countdropretry']+=0x1,'scheduledat':moment()['add'](_0x43d40d[_0x172a('0x114')],'minutes')[_0x172a('0x76')](_0x172a('0xfd')),'ContactId':_0x16a8be[_0x172a('0xcf')],'ListId':_0x16a8be[_0x172a('0xd0')],'VoiceQueueId':_0x16a8be['VoiceQueueId']||undefined,'CampaignId':_0x16a8be['CampaignId']||undefined})[_0x172a('0xb3')](loggerCatch(_0x172a('0x197')));break;case 0xb:if(_0x16a8be[_0x172a('0xea')]>=_0x43d40d[_0x172a('0x11a')]-0x1){return!![];}this[_0x172a('0xbe')]({'active':![],'countabandonedretry':_0x16a8be['countabandonedretry']+=0x1,'scheduledat':moment()[_0x172a('0xef')](_0x43d40d['dialAbandonedRetryFrequency'],'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x16a8be[_0x172a('0xcf')],'ListId':_0x16a8be['ListId'],'VoiceQueueId':_0x16a8be['VoiceQueueId']||undefined,'CampaignId':_0x16a8be['CampaignId']||undefined})[_0x172a('0xb3')](loggerCatch(_0x172a('0x11b')));break;case 0x13:if(_0x16a8be[_0x172a('0xe6')]>=_0x43d40d['dialMachineMaxRetry']-0x1){return!![];}this[_0x172a('0xbe')]({'active':![],'countmachineretry':_0x16a8be['countmachineretry']+=0x1,'scheduledat':moment()[_0x172a('0xef')](_0x43d40d[_0x172a('0xf0')],_0x172a('0xf1'))['format'](_0x172a('0xfd')),'ContactId':_0x16a8be[_0x172a('0xcf')],'ListId':_0x16a8be[_0x172a('0xd0')],'VoiceQueueId':_0x16a8be[_0x172a('0xd1')]||undefined,'CampaignId':_0x16a8be[_0x172a('0xf2')]||undefined})[_0x172a('0xb3')](loggerCatch(_0x172a('0xfe')));break;case 0x14:if(_0x16a8be[_0x172a('0xfc')]>=_0x43d40d[_0x172a('0x198')]-0x1){return!![];}this[_0x172a('0xbe')]({'active':![],'countagentrejectretry':_0x16a8be[_0x172a('0xfc')]+=0x1,'scheduledat':moment()['add'](_0x43d40d[_0x172a('0x199')],_0x172a('0xf1'))[_0x172a('0x76')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x16a8be[_0x172a('0xcf')],'ListId':_0x16a8be[_0x172a('0xd0')],'VoiceQueueId':_0x16a8be[_0x172a('0xd1')]||undefined,'CampaignId':_0x16a8be['CampaignId']||undefined})[_0x172a('0xb3')](loggerCatch(_0x172a('0x19a')));break;default:return!![];}};Dialer[_0x172a('0x19')][_0x172a('0x18c')]=function(_0x545ad2,_0xc22423,_0xabdb66){var _0x5cc48e=this;var _0x2d6c53=new History(_0x545ad2);var _0x22c331=![];var _0x257eaf;var _0x40ace3;return new BPromise(function(_0x370dc4,_0xd2caad){if(_[_0x172a('0x84')](_0xc22423)&&typeof _0xc22423!==_0x172a('0x19b')){return _0xd2caad(msgResponse(_0x172a('0x19c'),_0x172a('0x13a'),_0x172a('0x19d')));}if(_[_0x172a('0x84')](_0xabdb66)&&typeof _0xabdb66!==_0x172a('0x19b')){return _0xd2caad(msgResponse(_0x172a('0x19c'),_0x172a('0x13a'),_0x172a('0x19e')));}_0x5cc48e[_0x172a('0xb8')](_0x2d6c53,_0xabdb66[_0x172a('0x104')],_0xc22423)[_0x172a('0xb2')](function(_0x193154){if(_0x193154[_0x172a('0x111')]==0x1)_0x22c331=!![];switch(_0xabdb66[_0x172a('0x104')]){case'0':_0xc22423[_0x172a('0x61')]+=0x1;_0x2d6c53[_0x172a('0xa2')]=0x0;_0x2d6c53[_0x172a('0xa3')]=_0x172a('0x19f');_0x2d6c53[_0x172a('0xe9')]+=0x1;_0x2d6c53[_0x172a('0xf8')]+=0x1;ami[_0x172a('0x4b')](_0x172a('0x1a0'),ut[_0x172a('0xe4')](_0x545ad2,_0x172a('0x1a1')));_0x257eaf=_0xc22423[_0x172a('0x1a2')];_0x40ace3=_0xc22423[_0x172a('0x10f')];_0x5cc48e[_0x172a('0xc9')](_0x2d6c53)[_0x172a('0xb3')](loggerCatch(_0x172a('0xe7')));if(_0x5cc48e[_0x172a('0x18e')](0x0,_0x545ad2,_0xc22423)&&!_0x22c331){if(_0x2d6c53[_0x172a('0xe9')]>=_0xc22423['dialNoSuchNumberMaxRetry']){_0x5cc48e[_0x172a('0xee')](_0x2d6c53,_0x370dc4,_0xd2caad,_0x172a('0x1a3'));}else{_0x5cc48e[_0x172a('0xeb')](_0x2d6c53,_0x370dc4,_0xd2caad,_0x172a('0x1a3'));}}break;case'3':_0xc22423[_0x172a('0x60')]+=0x1;_0x2d6c53[_0x172a('0xa2')]=0x3;_0x2d6c53[_0x172a('0xa3')]='NoAnswer';_0x2d6c53['countnoanswerretry']+=0x1;_0x2d6c53[_0x172a('0xf8')]+=0x1;ami[_0x172a('0x4b')]('custom:agentnoanswer',ut['buildObj'](_0x545ad2,_0x172a('0x1a4')));_0x257eaf=_0xc22423[_0x172a('0x1a5')];_0x40ace3=_0xc22423[_0x172a('0x10f')];_0x5cc48e[_0x172a('0xc9')](_0x2d6c53)[_0x172a('0xb3')](loggerCatch(_0x172a('0x1a6')));if(_0x5cc48e[_0x172a('0x18e')](0x3,_0x545ad2,_0xc22423)&&!_0x22c331){if(_0x2d6c53[_0x172a('0xfa')]>=_0xc22423[_0x172a('0x190')]){_0x5cc48e[_0x172a('0xee')](_0x2d6c53,_0x370dc4,_0xd2caad,_0x172a('0x1a7'));}else{_0x5cc48e[_0x172a('0xeb')](_0x2d6c53,_0x370dc4,_0xd2caad,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0xc22423[_0x172a('0x5c')]+=0x1;_0x2d6c53[_0x172a('0xa2')]=0x5;_0x2d6c53['statedesc']=_0x172a('0x1a8');_0x2d6c53[_0x172a('0xe8')]+=0x1;_0x2d6c53[_0x172a('0xf8')]+=0x1;ami[_0x172a('0x4b')]('custom:agentbusy',ut[_0x172a('0xe4')](_0x545ad2,_0x172a('0x1a9')));_0x257eaf=_0xc22423[_0x172a('0x191')];_0x40ace3=_0xc22423[_0x172a('0x10f')];_0x5cc48e[_0x172a('0xc9')](_0x2d6c53)[_0x172a('0xb3')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x5cc48e[_0x172a('0x18e')](0x5,_0x545ad2,_0xc22423)&&!_0x22c331){if(_0x2d6c53[_0x172a('0xe8')]>=_0xc22423['dialBusyMaxRetry']){_0x5cc48e[_0x172a('0xee')](_0x2d6c53,_0x370dc4,_0xd2caad,_0x172a('0x1aa'));}else{_0x5cc48e[_0x172a('0xeb')](_0x2d6c53,_0x370dc4,_0xd2caad,'reason\x205\x20busy');}}break;case'8':_0xc22423[_0x172a('0x5d')]+=0x1;_0x2d6c53['state']=0x8;_0x2d6c53[_0x172a('0xa3')]=_0x172a('0x1ab');_0x2d6c53[_0x172a('0xf9')]+=0x1;_0x2d6c53[_0x172a('0xf8')]+=0x1;_0x257eaf=_0xc22423[_0x172a('0x1ac')];_0x40ace3=_0xc22423[_0x172a('0x10f')];ami[_0x172a('0x4b')](_0x172a('0x1ad'),ut[_0x172a('0xe4')](_0x545ad2,'congestion'));_0x5cc48e[_0x172a('0xc9')](_0x2d6c53)[_0x172a('0xb3')](loggerCatch(_0x172a('0x1ae')));if(_0x5cc48e[_0x172a('0x18e')](0x8,_0x545ad2,_0xc22423)&&!_0x22c331){if(_0x2d6c53[_0x172a('0xf9')]>=_0xc22423[_0x172a('0x193')]){_0x5cc48e[_0x172a('0xee')](_0x2d6c53,_0x370dc4,_0xd2caad,_0x172a('0x1af'));}else{_0x5cc48e['stateGlobal'](_0x2d6c53,_0x370dc4,_0xd2caad,_0x172a('0x1af'));}}break;case'11':_0xc22423[_0x172a('0x1b0')]+=0x1;_0x2d6c53[_0x172a('0xa2')]=0xb;_0x2d6c53[_0x172a('0xa3')]=_0x172a('0x117');_0x2d6c53['countabandonedretry']+=0x1;_0x2d6c53[_0x172a('0xf8')]+=0x1;_0x257eaf=_0xc22423[_0x172a('0x119')];_0x40ace3=_0xc22423[_0x172a('0x10f')];_0x5cc48e[_0x172a('0xc9')](_0x2d6c53)[_0x172a('0xb3')](loggerCatch(_0x172a('0x11c')));if(_0x5cc48e[_0x172a('0x18e')](0xb,_0x545ad2,_0xc22423)&&!_0x22c331){if(_0x2d6c53[_0x172a('0xea')]>=_0xc22423['dialAbandonedMaxRetry']){_0x5cc48e[_0x172a('0xee')](_0x2d6c53,_0x370dc4,_0xd2caad,_0x172a('0x1b1'));}else{_0x5cc48e[_0x172a('0xeb')](_0x2d6c53,_0x370dc4,_0xd2caad,_0x172a('0x1b1'));}}break;case'20':_0xc22423['outboundRejectCallsDay']+=0x1;_0x2d6c53[_0x172a('0xa2')]=0x14;_0x2d6c53[_0x172a('0xa3')]='AgentReject';_0x2d6c53[_0x172a('0xfc')]+=0x1;_0x2d6c53['countglobal']+=0x1;_0x257eaf=_0xc22423[_0x172a('0x199')];_0x40ace3=_0xc22423[_0x172a('0x10f')];ami['emit'](_0x172a('0x1b2'),ut[_0x172a('0xe4')](_0x545ad2,_0x172a('0x1b3')));_0x5cc48e['createHistory'](_0x2d6c53)[_0x172a('0xb3')](loggerCatch(_0x172a('0x1b4')));if(_0x5cc48e[_0x172a('0x18e')](0x14,_0x545ad2,_0xc22423)&&!_0x22c331){if(_0x2d6c53[_0x172a('0xfc')]>=_0xc22423[_0x172a('0x198')]){_0x5cc48e[_0x172a('0xee')](_0x2d6c53,_0x370dc4,_0xd2caad,_0x172a('0x1b5'));}else{_0x5cc48e[_0x172a('0xeb')](_0x2d6c53,_0x370dc4,_0xd2caad,_0x172a('0x1b5'));}}break;default:_0xc22423[_0x172a('0x64')]+=0x1;_0x2d6c53[_0x172a('0xa2')]=0xc;_0x2d6c53['statedesc']=_0xabdb66[_0x172a('0x104')];_0x257eaf=_0xc22423[_0x172a('0x199')];_0x40ace3=_0xc22423['callAdditionalPhoneAfterMin'];_0x5cc48e['createHistory'](_0x2d6c53)[_0x172a('0xb3')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x5cc48e['checkRetriveMax'](_0xabdb66[_0x172a('0x104')],_0x545ad2,_0xc22423)&&!_0x22c331){if(_0x2d6c53[_0x172a('0xe8')]+_0x2d6c53[_0x172a('0xf9')]+_0x2d6c53[_0x172a('0xfa')]+_0x2d6c53['countnosuchnumberretry']+_0x2d6c53[_0x172a('0xfb')]+_0x2d6c53[_0x172a('0xea')]+_0x2d6c53[_0x172a('0xe6')]+_0x2d6c53['countagentrejectretry']>=_0xc22423[_0x172a('0x18f')]){_0x5cc48e[_0x172a('0xeb')](_0x2d6c53,_0x370dc4,_0xd2caad,_0xabdb66[_0x172a('0x104')]);}else{_0x5cc48e[_0x172a('0xee')](_0x2d6c53,_0x370dc4,_0xd2caad,_0xabdb66['reason']);}}}})['then'](function(_0xbfa6b0){if(_0x22c331){_0x5cc48e[_0x172a('0xb9')](_0x2d6c53,_0x257eaf,_0x40ace3)[_0x172a('0xb2')](function(_0x1644d1){return _0x370dc4(0x1);});}});});};Dialer[_0x172a('0x19')]['stateGlobal']=function(_0x16b728,_0x1bf1a6,_0x47f1cc,_0x5ed251){var _0x31a6cb=new Final(_0x16b728);_0x31a6cb['state']=0xf;_0x31a6cb[_0x172a('0xa3')]=_0x172a('0x1b6');this[_0x172a('0xee')](_0x31a6cb,_0x1bf1a6,_0x47f1cc,_0x5ed251);};Dialer[_0x172a('0x19')][_0x172a('0xee')]=function(_0x4779b6,_0x363010,_0x2b8216,_0x3c44f1){this[_0x172a('0xc7')](_0x4779b6)[_0x172a('0xb2')](function(){return _0x363010(msgResponse(_0x172a('0x19c'),_0x172a('0x1b7'),_0x3c44f1));})[_0x172a('0xb3')](function(){return _0x2b8216(msgResponse(_0x172a('0x1b8'),'Failure','contact\x20not\x20moved'));});};Dialer['prototype']['predictive']=function(_0x1193e0){var _0x4e20c4=_0x1193e0[_0x172a('0x1b9')]/0x64;var _0x5057a5=_0x1193e0[_0x172a('0x5f')]/(_0x1193e0[_0x172a('0x5f')]+_0x1193e0[_0x172a('0xdf')]);var _0x638610=Math[_0x172a('0x1ba')](_0x1193e0[_0x172a('0x6e')]*(_0x1193e0[_0x172a('0x1bb')]/0x64));var _0x394783=Math[_0x172a('0x1ba')](_0x1193e0[_0x172a('0x6e')]*(_0x1193e0[_0x172a('0x1bc')]/0x64));var _0x2f2108=_0x1193e0[_0x172a('0x4f')]+_0x1193e0['talking'];var _0x55a705=Math[_0x172a('0x1bd')](_0x1193e0['erlangCalls']*_0x1193e0[_0x172a('0x72')]*_0x1193e0[_0x172a('0x6b')]*_0x1193e0[_0x172a('0x6c')]);if(_[_0x172a('0x84')](_0x1193e0[_0x172a('0x29')])){if(!_[_0x172a('0x84')](_0x1193e0['startPredictive'])){_0x1193e0[_0x172a('0x28')]=undefined;loggerPredictive['error'](_0x172a('0x1be'),_0x172a('0x1bf'));}if(!_['isUndefined'](_0x1193e0[_0x172a('0x8e')])){loggerPredictive[_0x172a('0x91')](_0x172a('0x1be'),_0x172a('0x1c0'));clearInterval(_0x1193e0['handlePredictive']);_0x1193e0[_0x172a('0x8e')]=undefined;}_0x1193e0['startProgressive']=moment()['format'](_0x172a('0xfd'));loggerPredictive[_0x172a('0x7b')](_0x1193e0[_0x172a('0x40')],'collection\x20data\x20in\x20progressive\x20at',_0x1193e0['startProgressive']);this[_0x172a('0x14e')](_0x1193e0,0x1);}else if(ifInterval(_0x1193e0[_0x172a('0x1c1')],_0x1193e0[_0x172a('0x29')])){this['handlePower'](_0x1193e0,0x1);loggerPredictiveCalls[_0x172a('0x7b')](_0x172a('0x1c2'),_0x1193e0['startProgressive'],_0x1193e0[_0x172a('0x40')]);_0x1193e0[_0x172a('0x1c3')]=0x0;_0x1193e0[_0x172a('0x6a')]=0x0;}else if(_0x4e20c4<_0x5057a5&&_0x1193e0['dialPredictiveOptimization']===_0x172a('0x1c4')){freeVariablesPredictive(_0x1193e0);loggerPredictive['info'](_0x172a('0x1c5'),_0x172a('0x1c6'),_0x5057a5,_0x172a('0x29'),_0x1193e0['name']);}else if(_0x55a705<_0x1193e0[_0x172a('0x6a')]&&_0x1193e0[_0x172a('0x1c7')]===_0x172a('0x1c4')){freeVariablesPredictive(_0x1193e0);loggerPredictive['info']('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20',_0x55a705,'Drop\x20in\x20this\x20interval',_0x1193e0[_0x172a('0x6a')],_0x172a('0x29'),_0x1193e0['name']);}else if(!ifInterval(_0x1193e0[_0x172a('0x1c1')],_0x1193e0[_0x172a('0x29')])&&_[_0x172a('0x84')](_0x1193e0[_0x172a('0x28')])&&!_[_0x172a('0x84')](_0x1193e0['startProgressive'])){_0x1193e0['startPredictive']=moment()[_0x172a('0x76')](_0x172a('0xfd'));loggerPredictive['info'](_0x1193e0[_0x172a('0x40')],_0x172a('0x1c8'),_0x1193e0['startPredictive']);this[_0x172a('0xbc')](_0x1193e0[_0x172a('0x1c1')])[_0x172a('0xb2')](this['getDataPredictive'](_0x1193e0))[_0x172a('0xb2')](mergeDataErlangB(_0x1193e0))[_0x172a('0xb2')](this[_0x172a('0x1c9')](_0x1193e0))[_0x172a('0xb3')](loggerCatchPredictive(_0x172a('0x1ca'),_0x1193e0));}else if(!ifInterval(_0x1193e0[_0x172a('0x1c1')],_0x1193e0['startPredictive'])){_0x1193e0[_0x172a('0x6a')]=0x0;_0x1193e0[_0x172a('0x28')]=moment()[_0x172a('0x76')](_0x172a('0xfd'));loggerPredictive[_0x172a('0x7b')](_0x1193e0[_0x172a('0x40')],'recalculate\x20predictive\x20at',_0x1193e0['startPredictive']);clearInterval(_0x1193e0[_0x172a('0x8e')]);_0x1193e0[_0x172a('0x8e')]=undefined;this[_0x172a('0xbc')](_0x1193e0['dialPredictiveInterval'])[_0x172a('0xb2')](this['getDataPredictive'](_0x1193e0))[_0x172a('0xb2')](mergeDataErlangB(_0x1193e0))[_0x172a('0xb2')](this[_0x172a('0x1c9')](_0x1193e0))[_0x172a('0xb3')](loggerCatchPredictive(_0x172a('0x1cb'),_0x1193e0));}else if(_0x1193e0[_0x172a('0x6e')]&&_0x2f2108<_0x1193e0['predictiveIntervalAvailable']-_0x394783){freeVariablesPredictive(_0x1193e0);loggerPredictive[_0x172a('0x7b')](_0x1193e0[_0x172a('0x40')],_0x172a('0x1cc'),_0x2f2108,_0x172a('0x1cd'),_0x1193e0[_0x172a('0x6e')],'-',_0x394783,'=',_0x1193e0['predictiveIntervalAvailable']-_0x394783,')');}else if(_0x1193e0['predictiveIntervalAvailable']&&_0x2f2108>_0x1193e0[_0x172a('0x6e')]+_0x638610){freeVariablesPredictive(_0x1193e0);loggerPredictive[_0x172a('0x7b')](_0x1193e0[_0x172a('0x40')],_0x172a('0x1cc'),_0x2f2108,_0x172a('0x1ce'),_0x1193e0[_0x172a('0x6e')],'+',_0x638610,'=',_0x1193e0[_0x172a('0x6e')]+_0x638610,')');}};Dialer[_0x172a('0x19')][_0x172a('0x1cf')]=function(_0x35a3e3){var _0x24a179=this;return function(_0x2dd80d){return new BPromise(function(_0x1404e9,_0xddc525){_[_0x172a('0x8b')](_0x35a3e3,_0x2dd80d[0x0]);if(checkGetDataPredictive(_0x2dd80d[0x0])){var _0x365388=_0x35a3e3[_0x172a('0x6e')]=_0x35a3e3['talking']+_0x35a3e3['available'];var _0x468ce3=_0x35a3e3['dialPredictiveInterval']*0x3c;var _0x4c7516=_0x2dd80d[0x0]['predictiveIntervalAvgTalktime']+_0x2dd80d[0x0][_0x172a('0x65')];var _0x485759=(_0x2dd80d[0x0][_0x172a('0x7f')]+_0x2dd80d[0x0][_0x172a('0x68')]+_0x2dd80d[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x2dd80d[0x0][_0x172a('0x6f')];_0x35a3e3['predictiveIntervalHitRate']=_0x485759>0x0?_0x485759:0x1;switch(_0x35a3e3['dialPredictiveOptimization']){case _0x172a('0x1c4'):var _0x142ad5=_0x35a3e3[_0x172a('0x1b9')]/0x64;return _0x24a179[_0x172a('0x1d0')](_0x365388,_0x468ce3,_0x4c7516,_0x485759,_0x142ad5)[_0x172a('0xb2')](function(_0x1c497d){return _0x1404e9(_0x1c497d);});case'agentBusyFactor':var _0x139f6b=_0x35a3e3[_0x172a('0x1b9')]/0x64;return _0x24a179[_0x172a('0x1d1')](_0x365388,_0x468ce3,_0x4c7516,_0x485759,_0x139f6b)['then'](function(_0x4ea164){return _0x1404e9(_0x4ea164);});default:return _0xddc525(msgResponse(_0x172a('0x1d2'),_0x172a('0x13a'),_0x172a('0x1d3')));}}else{return _0xddc525(msgResponse(_0x172a('0x1d2'),_0x172a('0x13a'),_0x172a('0x1d4')));}});};};Dialer[_0x172a('0x19')][_0x172a('0x1d5')]=function(_0x29bce7){var _0x17a9c7=this;return function(_0x33c3c5){return new BPromise(function(_0xfbb839,_0x57d900){_[_0x172a('0x8b')](_0x29bce7,_0x33c3c5[0x0]);if(checkGetDataPredictive(_0x33c3c5[0x0])){loggerPredictive['info'](JSON['stringify'](_0x33c3c5[0x0]));if(_0x29bce7[_0x172a('0x1c7')]===_0x172a('0x1c4')){return _0x17a9c7[_0x172a('0xc5')](_0x29bce7['id'])['then'](function(_0x527970){var _0x18d53f=_0x29bce7[_0x172a('0x50')]-_0x527970[0x0]['outboundQueuePauses'];var _0x27b8a1=_0x29bce7['dialPredictiveInterval']*0x3c;var _0x28506c=_0x33c3c5[0x0][_0x172a('0x66')]+_0x33c3c5[0x0][_0x172a('0x65')];var _0x217dfc=(_0x33c3c5[0x0][_0x172a('0x7f')]+_0x33c3c5[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x33c3c5[0x0][_0x172a('0x67')])/_0x33c3c5[0x0][_0x172a('0x6f')];var _0x327af5=_0x29bce7[_0x172a('0x1b9')]/0x64;_0x29bce7[_0x172a('0x6d')]=_0x527970[0x0][_0x172a('0x1d6')]||0x0;_0x29bce7[_0x172a('0x6b')]=_0x217dfc>0x0?_0x217dfc:0x1;return _0x17a9c7['abandonmentRate'](_0x18d53f,_0x27b8a1,_0x28506c,_0x217dfc,_0x327af5);})['then'](function(_0x246380){return _0xfbb839(_0x246380);})[_0x172a('0xb3')](function(_0x573773){return _0x57d900(msgResponse('[CatchErlangB]',_0x172a('0x13a'),JSON[_0x172a('0x48')](_0x573773)));});}if(_0x29bce7['dialPredictiveOptimization']==='agentBusyFactor'){return _0x17a9c7[_0x172a('0xc5')](_0x29bce7['id'])[_0x172a('0xb2')](function(_0x3cab18){var _0x496b0e=_0x29bce7[_0x172a('0x50')]-_0x3cab18[0x0]['outboundQueuePauses'];var _0xa7a900=_0x29bce7['dialPredictiveInterval']*0x3c;var _0x549013=_0x33c3c5[0x0][_0x172a('0x66')]+_0x33c3c5[0x0][_0x172a('0x65')];var _0xf0d6f7=(_0x33c3c5[0x0][_0x172a('0x7f')]+_0x33c3c5[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x33c3c5[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x33c3c5[0x0]['predictiveIntervalTotalCalls'];var _0x48f501=_0x29bce7[_0x172a('0x1b9')]/0x64;_0x29bce7[_0x172a('0x6d')]=_0x3cab18[0x0][_0x172a('0x1d6')]||0x0;_0x29bce7['predictiveIntervalHitRate']=_0xf0d6f7>0x0?_0xf0d6f7:0x1;return _0x17a9c7[_0x172a('0x1d1')](_0x496b0e,_0xa7a900,_0x549013,_0xf0d6f7,_0x48f501);})[_0x172a('0xb2')](function(_0x351af1){return _0xfbb839(_0x351af1);})[_0x172a('0xb3')](function(_0x2352a5){return _0x57d900(msgResponse('[CatchErlangB]',_0x172a('0x13a'),JSON[_0x172a('0x48')](_0x2352a5)));});}}else{return _0x57d900(msgResponse('[getDataPredictive]',_0x172a('0x13a'),_0x172a('0x1d4')));}});};};Dialer[_0x172a('0x19')]['startMethodPredictive']=function(_0x10a49f){var _0x586e01=this;return function(){var _0x25bed2=0x0;var _0x526abc=Math['floor'](_0x10a49f[_0x172a('0x71')]*0x3e8);if(_0x526abc>0x0){_0x526abc=_0x526abc<0x64?0x64:_0x526abc;loggerPredictive['info'](_0x10a49f[_0x172a('0x40')],_0x172a('0x1d7'),_0x526abc,_0x172a('0x49'));_0x10a49f[_0x172a('0x8e')]=setInterval(function(){_0x586e01[_0x172a('0x8e')](_0x10a49f);loggerPredictiveCalls['info'](_0x172a('0x1d8'),_0x25bed2+=0x1);},_0x526abc);}else{loggerPredictive[_0x172a('0x7b')](_0x10a49f[_0x172a('0x40')],_0x172a('0x1d9'));}};};Dialer[_0x172a('0x19')][_0x172a('0x1da')]=function(_0x4eddb9,_0x2db03c){var _0x588421=this;return function(_0x25a040){if(_[_0x172a('0x46')](_0x25a040)){if(_[_0x172a('0xa9')](_0x2db03c['UserId'])||!_0x2db03c[_0x172a('0x1db')]){if(_0x4eddb9[_0x172a('0x14c')]===_0x172a('0x151')){_0x4eddb9['queueStatusComplete']=_[_0x172a('0x84')](_0x4eddb9[_0x172a('0x123')])?!![]:_0x4eddb9['queueStatusComplete'];var _0x56cb5c=uuid['v4']();_0x588421[_0x172a('0x24')][_0x56cb5c]=new Action(_0x4eddb9,_0x2db03c,_0x56cb5c);loggerBooked[_0x172a('0x7b')](_0x172a('0x1dc'),_0x56cb5c,_0x172a('0x1dd'),JSON[_0x172a('0x48')](_0x4eddb9[_0x172a('0x123')]),_0x172a('0x1de'),_0x4eddb9['name']);if(_0x4eddb9[_0x172a('0x123')]){_0x4eddb9[_0x172a('0x123')]=![];_0x588421[_0x172a('0x2b')][_0x588421[_0x172a('0x24')][_0x56cb5c]['queue']]=[];ami[_0x172a('0xaa')]({'actionid':_0x56cb5c,'action':_0x172a('0x1df'),'queue':_0x4eddb9[_0x172a('0x40')]})[_0x172a('0xb3')](function(){_0x588421['updateOriginated'](_0x4eddb9);_0x588421[_0x172a('0xbe')]({'active':![],'ContactId':_0x588421[_0x172a('0x24')][_0x56cb5c]['ContactId'],'ListId':_0x588421[_0x172a('0x24')][_0x56cb5c][_0x172a('0xd0')],'VoiceQueueId':_0x588421[_0x172a('0x24')][_0x56cb5c][_0x172a('0xd1')]||undefined,'CampaignId':_0x588421[_0x172a('0x24')][_0x56cb5c][_0x172a('0xf2')]||undefined})['catch'](loggerCatch(_0x172a('0x1e0')));delete _0x588421[_0x172a('0x24')][_0x56cb5c];});}else{loggerBooked[_0x172a('0x7b')](_0x172a('0x1e1'),JSON['stringify'](_0x4eddb9[_0x172a('0x123')]),_0x172a('0x1de'),_0x4eddb9[_0x172a('0x40')]);_0x588421['updateOriginated'](_0x4eddb9);_0x588421[_0x172a('0xbe')]({'active':![],'ContactId':_0x588421['actions'][_0x56cb5c][_0x172a('0xcf')],'ListId':_0x588421[_0x172a('0x24')][_0x56cb5c]['ListId'],'VoiceQueueId':_0x588421[_0x172a('0x24')][_0x56cb5c]['VoiceQueueId']||undefined,'CampaignId':_0x588421[_0x172a('0x24')][_0x56cb5c][_0x172a('0xf2')]||undefined})['catch'](loggerCatch(_0x172a('0x1e0')));delete _0x588421[_0x172a('0x24')][_0x56cb5c];}}else{return _0x588421[_0x172a('0x1e2')](_0x4eddb9,_0x2db03c);}}else{if(getDiff(_0x2db03c[_0x172a('0x1e3')])<_0x4eddb9['dialRecallMeTimeout']*0x3c){if(_0x2db03c['Agent']&&!_0x2db03c[_0x172a('0x1e4')][_0x172a('0x1e5')]){_0x588421[_0x172a('0x1e')][_0x172a('0x126')](_0x2db03c['id'])[_0x172a('0x1c')](function(){_0x588421[_0x172a('0xae')](_0x4eddb9);});}else{_0x588421[_0x172a('0xc0')]({'active':![]},_0x2db03c['id'],0x1)[_0x172a('0x1c')](function(){_0x588421[_0x172a('0xae')](_0x4eddb9);});}}else{_0x4eddb9['outboundReCallsDay']+=0x1;_0x588421[_0x172a('0xae')](_0x4eddb9);if(_0x4eddb9['dialRecallInQueue']){_0x588421['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x2db03c[_0x172a('0xcf')],'ListId':_0x2db03c[_0x172a('0xd0')],'VoiceQueueId':_0x2db03c[_0x172a('0xd1')]||undefined,'CampaignId':_0x2db03c[_0x172a('0xf2')]||undefined})[_0x172a('0xb3')](loggerCatch(_0x172a('0x1e6')));_0x588421[_0x172a('0xc9')](createObjHistory(_0x4eddb9,_0x2db03c,'RECALLINQUEUE',0x17,_0x172a('0x1e7')))[_0x172a('0xb3')](loggerCatch(_0x172a('0x1e8')));}else{_0x588421[_0x172a('0xcd')](createObjHistory(_0x4eddb9,_0x2db03c,'RECALLFAILEDTIMEOUT',0x16,'RecallFailedTimeout'),'[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]');}}}}else{_0x4eddb9[_0x172a('0x5b')]+=0x1;_0x588421[_0x172a('0xcd')](createObjHistory(_0x4eddb9,_0x2db03c,_0x172a('0x1e9'),0xd,'Blacklist'),_0x172a('0x1ea'),_0x172a('0x1eb'));throw'inBlackList';}};};Dialer['prototype']['handleIvr']=function(_0x30f608){var _0x130529=this;var _0x5e119b=_0x30f608[_0x172a('0x1ec')]-_0x30f608[_0x172a('0x70')]-_0x30f608['temp'];emitCampaignSummary(_0x30f608);if(_0x5e119b>0x0){if(_0x5e119b>this[_0x172a('0x23')]){_0x5e119b=this[_0x172a('0x23')];}_0x30f608[_0x172a('0xc2')]+=_0x5e119b;this['getContactDialerIvr'](_0x30f608['id'],_0x5e119b,_0x30f608[_0x172a('0x1ed')],_0x30f608)[_0x172a('0xb2')](function(_0x229cfc){_0x30f608[_0x172a('0xc2')]-=_0x5e119b;_0x30f608[_0x172a('0xc2')]=_0x30f608[_0x172a('0xc2')]>0x0?_0x30f608[_0x172a('0xc2')]:0x0;if(!checkContactEmpty(_0x229cfc)){_0x30f608[_0x172a('0x3d')]='AVAILABLE_CONTACTS_FINISHED';logger[_0x172a('0x7b')](_0x172a('0x1ee')+_0x30f608[_0x172a('0x40')]);}else{_0x30f608[_0x172a('0x70')]+=_0x229cfc[_0x172a('0x94')];_0x30f608[_0x172a('0x3d')]=_0x172a('0x1ef');for(var _0x3c263b=0x0;_0x3c263b<_0x229cfc[_0x172a('0x94')];_0x3c263b+=0x1){_0x30f608[_0x172a('0x1f0')]+=0x1;if(_[_0x172a('0xa9')](_0x229cfc[_0x3c263b])||_['isNil'](_0x229cfc[_0x3c263b][_0x172a('0x176')])||_['isNil'](_0x229cfc[_0x3c263b][_0x172a('0x15f')])){_0x130529[_0x172a('0x1f1')]('[actionOriginate]\x20',_0x30f608,_0x229cfc[_0x3c263b]);}else{_0x130529[_0x172a('0xba')](_[_0x172a('0xce')](_0x229cfc[_0x3c263b],[_0x172a('0xf2'),_0x172a('0x1f2')]))['then'](_0x130529[_0x172a('0x1da')](_0x30f608,_0x229cfc[_0x3c263b]))[_0x172a('0xb3')](_0x130529[_0x172a('0xcc')](_0x172a('0x1f3'),_0x30f608));}}}})[_0x172a('0xb3')](loggerGetContactDialer('[getContactCampaign2]',_0x30f608,_0x5e119b));}};Dialer[_0x172a('0x19')][_0x172a('0x14e')]=function(_0x1c9fd3,_0x46c6c0){var _0x11fdfd=this;var _0x12523f=[];var _0x393a8c=_0x46c6c0>=0x1?_0x46c6c0:0x1;if(_0x1c9fd3['dialMethod']===_0x172a('0x151')){_0x393a8c=0x1;}var _0xb9e9a6=Math[_0x172a('0x1bd')](_0x1c9fd3['available']*_0x393a8c)-_0x1c9fd3['originated']-_0x1c9fd3['temp'];emitVoiceQueueSummary(_0x1c9fd3);if(_0x1c9fd3[_0x172a('0x1f4')]>0x0){var _0x35414b=_0x1c9fd3[_0x172a('0x1f4')]-_0x1c9fd3[_0x172a('0x70')]-_0x1c9fd3[_0x172a('0x55')]-_0x1c9fd3['temp']-_0x1c9fd3['pTalking'];if(_0xb9e9a6>_0x35414b){_0xb9e9a6=_0x35414b;}}if(_0xb9e9a6>0x0){if(_0x1c9fd3[_0x172a('0x14c')]===_0x172a('0x151')){_0xb9e9a6=0x1;}if(_0xb9e9a6>this['maxNumberOriginate']){_0xb9e9a6=this[_0x172a('0x23')];}_0x1c9fd3[_0x172a('0xc2')]+=_0xb9e9a6;for(var _0x248f7a in this[_0x172a('0x21')]){if(typeof this['agents'][_0x248f7a]!==_0x172a('0x95')){if(this[_0x172a('0x21')][_0x248f7a]['state']===_0x172a('0x1f5')&&this[_0x172a('0x21')][_0x248f7a][_0x172a('0xab')]==='reachable'){_0x12523f[_0x172a('0x121')](this['agents'][_0x248f7a]['id']);}}}this[_0x172a('0xc1')](_0x1c9fd3['id'],_0x12523f,_0xb9e9a6,_0x1c9fd3[_0x172a('0x1ed')],_0x1c9fd3)[_0x172a('0xb2')](function(_0x370a06){_0x1c9fd3[_0x172a('0xc2')]-=_0xb9e9a6;_0x1c9fd3[_0x172a('0xc2')]=_0x1c9fd3['temp']>0x0?_0x1c9fd3[_0x172a('0xc2')]:0x0;if(!checkContactEmpty(_0x370a06)){_0x11fdfd[_0x172a('0x1f6')](_0x1c9fd3)['then'](sendMessageReschedule(_0x1c9fd3))[_0x172a('0xb3')](loggerCatch('[countReScheduled]\x20'));}else{_0x1c9fd3[_0x172a('0x70')]+=_0x370a06[_0x172a('0x94')];_0x1c9fd3[_0x172a('0x3d')]=_0x1c9fd3[_0x172a('0x14c')]===_0x172a('0x151')?'ACTIVE':_0x172a('0x1ef');for(var _0x2dfddc=0x0;_0x2dfddc<_0x370a06['length'];_0x2dfddc+=0x1){if(_[_0x172a('0xa9')](_0x370a06[_0x2dfddc])||_['isNil'](_0x370a06[_0x2dfddc]['Contact'])||_[_0x172a('0xa9')](_0x370a06[_0x2dfddc][_0x172a('0x15f')])){_0x11fdfd[_0x172a('0x1f1')](_0x172a('0x1f7'),_0x1c9fd3,_0x370a06[_0x2dfddc]);}else{_0x11fdfd[_0x172a('0xb5')](_[_0x172a('0xce')](_0x370a06[_0x2dfddc],[_0x172a('0xd1'),_0x172a('0x1f2')]))['then'](_0x11fdfd[_0x172a('0x1da')](_0x1c9fd3,_0x370a06[_0x2dfddc]))[_0x172a('0xb3')](_0x11fdfd[_0x172a('0xcc')]('[actionOriginate]\x20',_0x1c9fd3));}}}})[_0x172a('0xb3')](loggerGetContactDialer(_0x172a('0x1f8'),_0x1c9fd3,_0xb9e9a6));}};Dialer[_0x172a('0x19')]['handlePredictive']=function(_0x15766a){if(_0x15766a[_0x172a('0x1f4')]>0x0){var _0x33e462=_0x15766a['dialLimitQueue']-_0x15766a[_0x172a('0x70')]-_0x15766a[_0x172a('0x55')];if(_0x33e462>0x0){this[_0x172a('0x1f9')](_0x15766a);}else{loggerPredictiveCalls[_0x172a('0x7b')](_0x172a('0x1fa'));}}else{this[_0x172a('0x1f9')](_0x15766a);}};Dialer[_0x172a('0x19')][_0x172a('0x1f9')]=function(_0x22cae9){var _0x4986d8=this;var _0xc32641=[];_0x22cae9['originated']+=0x1;for(var _0x515cf4 in this[_0x172a('0x21')]){if(typeof this['agents'][_0x515cf4]!==_0x172a('0x95')){if(this[_0x172a('0x21')][_0x515cf4][_0x172a('0xa2')]===_0x172a('0x1f5')&&this['agents'][_0x515cf4][_0x172a('0xab')]===_0x172a('0xd7')){_0xc32641['push'](this[_0x172a('0x21')][_0x515cf4]['id']);}}}this['getContactDialer'](_0x22cae9['id'],_0xc32641,0x1,_0x22cae9[_0x172a('0x1ed')],_0x22cae9)[_0x172a('0xb2')](function(_0x39d521){if(!checkContactEmpty(_0x39d521)){checkContactLowerLimitOriginate(_0x22cae9,0x1,0x0);_0x4986d8[_0x172a('0x1f6')](_0x22cae9)[_0x172a('0xb2')](sendMessageReschedule(_0x22cae9))[_0x172a('0xb3')](loggerCatch(_0x172a('0xb4')));}else{_0x22cae9[_0x172a('0x3d')]='RUNNING';if(_[_0x172a('0xa9')](_0x39d521[0x0])||_['isNil'](_0x39d521[0x0][_0x172a('0x176')])||_[_0x172a('0xa9')](_0x39d521[0x0][_0x172a('0x15f')])){_0x4986d8['emptyContact']('[actionOriginate]\x20',_0x22cae9,_0x39d521[0x0]);}else{_0x4986d8[_0x172a('0xb5')](_[_0x172a('0xce')](_0x39d521[0x0],[_0x172a('0xd1'),_0x172a('0x1f2')]))[_0x172a('0xb2')](_0x4986d8[_0x172a('0x1da')](_0x22cae9,_0x39d521[0x0]))['catch'](_0x4986d8[_0x172a('0xcc')](_0x172a('0x1fb'),_0x22cae9));}}})[_0x172a('0xb3')](loggerGetContactDialer(_0x172a('0x1fc'),_0x22cae9,0x1));emitVoiceQueueSummary(_0x22cae9);};Dialer[_0x172a('0x19')]['abandonmentRate']=function(_0x52ba3c,_0x3421e1,_0x820a33,_0x210121,_0x531169,_0x15d8d7){loggerPredictive[_0x172a('0x7b')](_0x172a('0x1fd'));loggerPredictive[_0x172a('0x7b')](_0x172a('0x1fe'),_0x52ba3c);loggerPredictive['info'](_0x172a('0x1ff'),_0x3421e1);loggerPredictive['info'](_0x172a('0x200'),_0x820a33);loggerPredictive[_0x172a('0x7b')]('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',_0x210121);loggerPredictive[_0x172a('0x7b')](_0x172a('0x201'),_0x531169);loggerPredictive[_0x172a('0x7b')](_0x172a('0x83'));return new BPromise(function(_0x58b7a2,_0x549498){if(_0x52ba3c<=0x0||isNaN(_0x52ba3c)){return _0x549498(msgResponse(_0x172a('0x202'),_0x172a('0x47'),_0x172a('0x203')+_0x52ba3c));}if(_0x820a33<=0x0||isNaN(_0x820a33)){return _0x549498(msgResponse(_0x172a('0x202'),_0x172a('0x47'),_0x172a('0x204')+_0x820a33));}if(_0x210121<=0x0||isNaN(_0x210121)){return _0x549498(msgResponse(_0x172a('0x202'),_0x172a('0x47'),_0x172a('0x205')+_0x210121));}if(_0x3421e1<=0x0||isNaN(_0x3421e1)){return _0x549498(msgResponse(_0x172a('0x202'),_0x172a('0x47'),_0x172a('0x206')+_0x3421e1));}if(_0x531169<=0x0||isNaN(_0x531169)){return _0x549498(msgResponse(_0x172a('0x202'),'Error',_0x172a('0x207')+_0x531169));}_0x15d8d7=_0x15d8d7||0x0;var _0x531d24=0x1/_0x820a33;var _0x22c0bd=0x0;var _0x2b3fb8=0x0;var _0x1f2dfb=0x0;var _0x41ea9e=0x0;for(var _0x10df4c=0x0;_0x1f2dfb<_0x531169;_0x10df4c+=0x1){_0x2b3fb8=_0x10df4c/_0x3421e1;_0x22c0bd=(_0x210121*_0x2b3fb8+_0x15d8d7)/_0x531d24;_0x1f2dfb=erlangb(_0x22c0bd,_0x52ba3c);_0x41ea9e=_0x22c0bd/_0x52ba3c*(0x1-erlangb(_0x22c0bd,_0x52ba3c));}return _0x58b7a2({'erlangCalls':_0x10df4c,'erlangCallToSecond':_0x3421e1/_0x10df4c,'erlangAbandonmentRate':_0x1f2dfb,'erlangBusyFactor':_0x41ea9e});});};Dialer['prototype'][_0x172a('0x1d1')]=function(_0x22466b,_0x6dd166,_0x2bf032,_0xa90a89,_0x4e965a,_0x54279a){loggerPredictive[_0x172a('0x7b')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0x172a('0x7b')](_0x172a('0x1fe'),_0x22466b);loggerPredictive[_0x172a('0x7b')](_0x172a('0x1ff'),_0x6dd166);loggerPredictive[_0x172a('0x7b')](_0x172a('0x200'),_0x2bf032);loggerPredictive[_0x172a('0x7b')](_0x172a('0x208'),_0xa90a89);loggerPredictive[_0x172a('0x7b')](_0x172a('0x209'),_0x4e965a);loggerPredictive[_0x172a('0x7b')](_0x172a('0x83'));return new BPromise(function(_0x3bf3bd,_0x29efa6){if(_0x22466b<=0x0||isNaN(_0x22466b)){return _0x29efa6(msgResponse('[busyFactor]',_0x172a('0x47'),'m\x20=\x20'+_0x22466b));}if(_0x2bf032<=0x0||isNaN(_0x2bf032)){return _0x29efa6(msgResponse(_0x172a('0x20a'),_0x172a('0x47'),_0x172a('0x204')+_0x2bf032));}if(_0xa90a89<=0x0||isNaN(_0xa90a89)){return _0x29efa6(msgResponse(_0x172a('0x20a'),_0x172a('0x47'),_0x172a('0x205')+_0xa90a89));}if(_0x6dd166<=0x0||isNaN(_0x6dd166)){return _0x29efa6(msgResponse(_0x172a('0x20a'),'Error','interval\x20=\x20'+_0x6dd166));}if(_0x4e965a<=0x0||isNaN(_0x4e965a)){return _0x29efa6(msgResponse('[busyFactor]',_0x172a('0x47'),_0x172a('0x20b')+_0x4e965a));}_0x54279a=_0x54279a||0x0;var _0x4f0238=0x1/_0x2bf032;var _0x206b95=0x0;var _0x5c112f=0x0;var _0x549a68=0x0;var _0x4135d9=0x0;for(var _0x4ddcc7=0x0;_0x4135d9<_0x4e965a;_0x4ddcc7+=0x1){_0x5c112f=_0x4ddcc7/_0x6dd166;_0x206b95=(_0xa90a89*_0x5c112f+_0x54279a)/_0x4f0238;_0x549a68=erlangb(_0x206b95,_0x22466b);_0x4135d9=_0x206b95/_0x22466b*(0x1-erlangb(_0x206b95,_0x22466b));}return _0x3bf3bd({'erlangCalls':_0x4ddcc7,'erlangCallToSecond':_0x6dd166/_0x4ddcc7,'erlangAbandonmentRate':_0x549a68,'erlangBusyFactor':_0x4135d9});});};module[_0x172a('0x20c')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index 318311d..161743d 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 _0x29ef=['responsetime','endtime','droptime','ringtime','holdtime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','calleridnum','number','starttime'];(function(_0x2f6b2a,_0x154a0b){var _0x9a0932=function(_0x32e8e6){while(--_0x32e8e6){_0x2f6b2a['push'](_0x2f6b2a['shift']());}};_0x9a0932(++_0x154a0b);}(_0x29ef,0x196));var _0xf29e=function(_0x2d364e,_0x301c5e){_0x2d364e=_0x2d364e-0x0;var _0x1b9312=_0x29ef[_0x2d364e];return _0x1b9312;};'use strict';var util=require(_0xf29e('0x0'));var _=require(_0xf29e('0x1'));var moment=require(_0xf29e('0x2'));function getSeconds(_0x1c9115,_0x491523){var _0x458386=moment(_0x1c9115)[_0xf29e('0x3')](0x0);var _0x1e2e6=moment(_0x491523)[_0xf29e('0x3')](0x0);return _0x458386[_0xf29e('0x4')](_0x1e2e6,_0xf29e('0x5'));}function QueueCallerAbandon(_0x4d790f,_0x52df07){this[_0xf29e('0x6')]=_0x4d790f['scheduledat'];this['type']=_0x4d790f[_0xf29e('0x7')];this[_0xf29e('0x8')]=_0x4d790f[_0xf29e('0x7')]==='outbound'?_0xf29e('0x9'):_0x4d790f[_0xf29e('0x7')];this[_0xf29e('0xa')]=_0x4d790f[_0xf29e('0xa')];this[_0xf29e('0xb')]=_0x4d790f[_0xf29e('0xb')];this[_0xf29e('0xc')]=_0x4d790f['countnoanswerretry'];this[_0xf29e('0xd')]=_0x4d790f[_0xf29e('0xa')]+_0x4d790f['countcongestionretry']+_0x4d790f[_0xf29e('0xc')]+_0x4d790f[_0xf29e('0xe')]+_0x4d790f[_0xf29e('0xf')]+_0x4d790f[_0xf29e('0x10')]+_0x4d790f[_0xf29e('0x11')]+_0x4d790f[_0xf29e('0x12')];this[_0xf29e('0xe')]=_0x4d790f[_0xf29e('0xe')];this[_0xf29e('0xf')]=_0x4d790f[_0xf29e('0xf')];this[_0xf29e('0x10')]=_0x4d790f[_0xf29e('0x10')];this['countmachineretry']=_0x4d790f[_0xf29e('0x11')];this[_0xf29e('0x12')]=_0x4d790f[_0xf29e('0x12')];this[_0xf29e('0x13')]=_0x52df07['uniqueid'];this[_0xf29e('0x14')]=_0x4d790f['name'];this[_0xf29e('0x15')]=_0x4d790f[_0xf29e('0x16')];this[_0xf29e('0x17')]=_0x4d790f[_0xf29e('0x17')];this[_0xf29e('0x18')]=_0x4d790f[_0xf29e('0x18')];this['droptime']=_0x4d790f['droptime'];this[_0xf29e('0x19')]=this[_0xf29e('0x1a')];this[_0xf29e('0x1b')]=getSeconds(_0x4d790f['responsetime'],_0x4d790f['starttime']);this[_0xf29e('0x1c')]=getSeconds(this['droptime'],_0x4d790f['responsetime']);this['talktime']=0x0;this[_0xf29e('0x9')]=_0x52df07['queue'];this[_0xf29e('0x1d')]=_0x52df07[_0xf29e('0x1e')];this[_0xf29e('0x1f')]=_0x52df07[_0xf29e('0x1f')];this[_0xf29e('0x20')]=_0x4d790f[_0xf29e('0x20')];this[_0xf29e('0x21')]=_0x4d790f[_0xf29e('0x21')];this[_0xf29e('0x22')]=_0x4d790f['callbackat'];this['recallme']=_0x4d790f[_0xf29e('0x23')];this[_0xf29e('0x24')]=_0x4d790f['ContactId'];this[_0xf29e('0x25')]=_0x4d790f[_0xf29e('0x25')];this[_0xf29e('0x26')]=_0x4d790f[_0xf29e('0x26')];this['VoiceQueueId']=_0x4d790f['VoiceQueueId'];this[_0xf29e('0x27')]=_0x4d790f[_0xf29e('0x27')];this['originatecalleridnum']=_0x4d790f[_0xf29e('0x28')]||'';this['originatecalleridname']=_0x4d790f[_0xf29e('0x29')]||'';}module[_0xf29e('0x2a')]=QueueCallerAbandon; \ No newline at end of file +var _0xfa49=['campaigntype','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','droptime','endtime','ringtime','holdtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','scheduledat','type'];(function(_0xc8a931,_0x260690){var _0x28bd27=function(_0x591b9f){while(--_0x591b9f){_0xc8a931['push'](_0xc8a931['shift']());}};_0x28bd27(++_0x260690);}(_0xfa49,0x12c));var _0x9fa4=function(_0x25a7a2,_0x5a86a2){_0x25a7a2=_0x25a7a2-0x0;var _0x1e76ee=_0xfa49[_0x25a7a2];return _0x1e76ee;};'use strict';var util=require(_0x9fa4('0x0'));var _=require(_0x9fa4('0x1'));var moment=require(_0x9fa4('0x2'));function getSeconds(_0x1d3873,_0xe78782){var _0x4277d4=moment(_0x1d3873)[_0x9fa4('0x3')](0x0);var _0x49cf14=moment(_0xe78782)[_0x9fa4('0x3')](0x0);return _0x4277d4[_0x9fa4('0x4')](_0x49cf14,_0x9fa4('0x5'));}function QueueCallerAbandon(_0x453780,_0x57e8a9){this['scheduledat']=_0x453780[_0x9fa4('0x6')];this[_0x9fa4('0x7')]=_0x453780[_0x9fa4('0x7')];this[_0x9fa4('0x8')]=_0x453780[_0x9fa4('0x7')]==='outbound'?'queue':_0x453780[_0x9fa4('0x7')];this[_0x9fa4('0x9')]=_0x453780[_0x9fa4('0x9')];this[_0x9fa4('0xa')]=_0x453780['countcongestionretry'];this[_0x9fa4('0xb')]=_0x453780[_0x9fa4('0xb')];this[_0x9fa4('0xc')]=_0x453780['countbusyretry']+_0x453780['countcongestionretry']+_0x453780[_0x9fa4('0xb')]+_0x453780[_0x9fa4('0xd')]+_0x453780[_0x9fa4('0xe')]+_0x453780['countabandonedretry']+_0x453780[_0x9fa4('0xf')]+_0x453780[_0x9fa4('0x10')];this[_0x9fa4('0xd')]=_0x453780[_0x9fa4('0xd')];this[_0x9fa4('0xe')]=_0x453780['countdropretry'];this['countabandonedretry']=_0x453780[_0x9fa4('0x11')];this[_0x9fa4('0xf')]=_0x453780[_0x9fa4('0xf')];this[_0x9fa4('0x10')]=_0x453780[_0x9fa4('0x10')];this[_0x9fa4('0x12')]=_0x57e8a9['uniqueid'];this[_0x9fa4('0x13')]=_0x453780[_0x9fa4('0x14')];this[_0x9fa4('0x15')]=_0x453780['number'];this[_0x9fa4('0x16')]=_0x453780[_0x9fa4('0x16')];this[_0x9fa4('0x17')]=_0x453780[_0x9fa4('0x17')];this[_0x9fa4('0x18')]=_0x453780[_0x9fa4('0x18')];this[_0x9fa4('0x19')]=this['droptime'];this[_0x9fa4('0x1a')]=getSeconds(_0x453780[_0x9fa4('0x17')],_0x453780['starttime']);this[_0x9fa4('0x1b')]=getSeconds(this[_0x9fa4('0x18')],_0x453780[_0x9fa4('0x17')]);this[_0x9fa4('0x1c')]=0x0;this['queue']=_0x57e8a9['queue'];this[_0x9fa4('0x1d')]=_0x57e8a9[_0x9fa4('0x1e')];this[_0x9fa4('0x1f')]=_0x57e8a9['reason'];this['callback']=_0x453780[_0x9fa4('0x20')];this[_0x9fa4('0x21')]=_0x453780[_0x9fa4('0x21')];this[_0x9fa4('0x22')]=_0x453780[_0x9fa4('0x22')];this[_0x9fa4('0x23')]=_0x453780[_0x9fa4('0x23')];this[_0x9fa4('0x24')]=_0x453780[_0x9fa4('0x24')];this[_0x9fa4('0x25')]=_0x453780['ListId'];this[_0x9fa4('0x26')]=_0x453780[_0x9fa4('0x26')];this[_0x9fa4('0x27')]=_0x453780[_0x9fa4('0x27')];this['CampaignId']=_0x453780[_0x9fa4('0x28')];this[_0x9fa4('0x29')]=_0x453780[_0x9fa4('0x29')]||'';this[_0x9fa4('0x2a')]=_0x453780[_0x9fa4('0x2a')]||'';}module[_0x9fa4('0x2b')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 7508a62..a47e0cb 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(_0x232871,_0x3bfef6){var _0x24aa6d=function(_0x187b9e){while(--_0x187b9e){_0x232871['push'](_0x232871['shift']());}};_0x24aa6d(++_0x3bfef6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'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(_0x1e3228,_0x1c61d1){var _0x825286=function(_0xd5bb20){while(--_0xd5bb20){_0x1e3228['push'](_0x1e3228['shift']());}};_0x825286(++_0x1c61d1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'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 097af65..be2ec6c 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 _0x2256=['Fax\x20failed','checkAfterSend','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','Action','variablesAction','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','checkTrunk','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','bluebird','uuid','path','tiff2pdf','../../../config/logger','fax','../ami','./rpcDb','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','newchannel','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState','newexten','syncNewExten','syncFaxStatus','receivefax','syncReceiveFax','syncHangup','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','localstationid','uniqueid','channel','info','\x20syncNewchannel\x20','actions','variable','value','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','message','parse','name','application/pdf','then','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','pick','response','reason','AttachmentId','logger','[Fax][Message][Error][NoUpdate2]','updateStatus','update','[Fax][Message][NoUpdate1]','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxstatus','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','[Fax][execOriginate][failure]'];(function(_0x4f11c8,_0x23f93c){var _0x1b6ef3=function(_0x5c4ab4){while(--_0x5c4ab4){_0x4f11c8['push'](_0x4f11c8['shift']());}};_0x1b6ef3(++_0x23f93c);}(_0x2256,0x1da));var _0x6225=function(_0x5309af,_0x4129ff){_0x5309af=_0x5309af-0x0;var _0x496f8e=_0x2256[_0x5309af];return _0x496f8e;};'use strict';var util=require(_0x6225('0x0'));var _=require('lodash');var BPromise=require(_0x6225('0x1'));var uuid=require(_0x6225('0x2'));var moment=require('moment');var path=require(_0x6225('0x3'));var tiff2pdf=require(_0x6225('0x4'));var gs=require('./util/gs');var logger=require(_0x6225('0x5'))(_0x6225('0x6'));var ami=require(_0x6225('0x7'));var rpcDb=require(_0x6225('0x8'));var Channel=require('./channel');var ut=require('./util/util');var Action=require(_0x6225('0x9'));var faxAccount=require(_0x6225('0xa'));var attachment=require(_0x6225('0xb'));var faxMessage=require(_0x6225('0xc'));function Fax(_0x3ed803){this[_0x6225('0xd')]={};this[_0x6225('0xe')]=_0x3ed803[_0x6225('0xe')];this['trunks']=_0x3ed803[_0x6225('0xf')];this['actions']={};ami['on'](_0x6225('0x10'),this[_0x6225('0x11')][_0x6225('0x12')](this));ami['on'](_0x6225('0x13'),this[_0x6225('0x14')][_0x6225('0x12')](this));ami['on'](_0x6225('0x15'),this[_0x6225('0x16')][_0x6225('0x12')](this));ami['on'](_0x6225('0x17'),this[_0x6225('0x18')][_0x6225('0x12')](this));ami['on']('faxstatus',this[_0x6225('0x19')][_0x6225('0x12')](this));ami['on'](_0x6225('0x1a'),this[_0x6225('0x1b')][_0x6225('0x12')](this));ami['on']('hangup',this[_0x6225('0x1c')][_0x6225('0x12')](this));ami['on']('originateresponse',this[_0x6225('0x1d')][_0x6225('0x12')](this));}Fax[_0x6225('0x1e')][_0x6225('0x11')]=function(_0x5253ca){if(_0x5253ca[_0x6225('0x1f')]===_0x6225('0x20')){for(var _0x10dd39 in this[_0x6225('0xe')]){if(this[_0x6225('0xe')][_0x6225('0x21')](_0x10dd39)){if(_0x5253ca['exten']===this[_0x6225('0xe')][_0x10dd39][_0x6225('0x22')]){this[_0x6225('0xd')][_0x5253ca[_0x6225('0x23')]]={};this[_0x6225('0xd')][_0x5253ca[_0x6225('0x23')]][_0x6225('0x24')]=_0x5253ca[_0x6225('0x24')];this['channels'][_0x5253ca['uniqueid']]['id']=this['faxAccounts'][_0x10dd39]['id'];this[_0x6225('0xd')][_0x5253ca[_0x6225('0x23')]]['name']=this[_0x6225('0xe')][_0x10dd39]['name'];logger[_0x6225('0x25')](_0x5253ca[_0x6225('0x23')],_0x6225('0x26'));}}}}if(this[_0x6225('0x27')][_0x5253ca[_0x6225('0x23')]]){this['channels'][_0x5253ca['uniqueid']]={};this[_0x6225('0xd')][_0x5253ca['uniqueid']]['channel']=_0x5253ca[_0x6225('0x24')];logger[_0x6225('0x25')](_0x5253ca[_0x6225('0x23')],_0x6225('0x26'));}};Fax[_0x6225('0x1e')][_0x6225('0x14')]=function(_0x1fdce5){if(this[_0x6225('0xd')][_0x1fdce5['uniqueid']]){for(var _0x73b990 in _0x1fdce5[_0x6225('0x28')]){if(_0x1fdce5['variable'][_0x6225('0x21')](_0x73b990)){this['channels'][_0x1fdce5['uniqueid']][_0x73b990]=_0x1fdce5[_0x6225('0x29')];}}}};Fax['prototype']['syncNewState']=function(_0x19f75f){if(this['channels'][_0x19f75f[_0x6225('0x23')]]){this[_0x6225('0xd')][_0x19f75f[_0x6225('0x23')]]['channelstate']=_0x19f75f[_0x6225('0x2a')];this['channels'][_0x19f75f[_0x6225('0x23')]][_0x6225('0x2b')]=_0x19f75f[_0x6225('0x2b')];}};Fax[_0x6225('0x1e')][_0x6225('0x18')]=function(_0x5c298c){if(this[_0x6225('0xd')][_0x5c298c[_0x6225('0x23')]]){for(var _0x129fc6 in _0x5c298c['variable']){if(_0x5c298c['variable'][_0x6225('0x21')](_0x129fc6)){this[_0x6225('0xd')][_0x5c298c[_0x6225('0x23')]][_0x129fc6]=_0x5c298c[_0x6225('0x29')];}}}};Fax[_0x6225('0x1e')]['syncFaxStatus']=function(_0x1a9001){if(this['channels'][_0x1a9001['uniqueid']]){this[_0x6225('0xd')][_0x1a9001['uniqueid']][_0x6225('0x2c')]=_0x1a9001['operation'];this[_0x6225('0xd')][_0x1a9001['uniqueid']]['status']=_0x1a9001[_0x6225('0x2d')];this[_0x6225('0xd')][_0x1a9001[_0x6225('0x23')]][_0x6225('0x22')]=_0x1a9001['localstationid'];this[_0x6225('0xd')][_0x1a9001[_0x6225('0x23')]][_0x6225('0x2e')]=_0x1a9001[_0x6225('0x2e')];logger['info'](_0x1a9001[_0x6225('0x23')],_0x6225('0x2f'));}};Fax['prototype'][_0x6225('0x1b')]=function(_0x16c6c0){var _0x3cc2af=this;if(this[_0x6225('0xd')][_0x16c6c0[_0x6225('0x23')]]){var _0x4795a9=this['channels'][_0x16c6c0[_0x6225('0x23')]]['id'];this['channels'][_0x16c6c0[_0x6225('0x23')]][_0x6225('0x30')]=_0x16c6c0[_0x6225('0x30')];this[_0x6225('0xd')][_0x16c6c0[_0x6225('0x23')]][_0x6225('0x31')]=_0x16c6c0[_0x6225('0x31')];this[_0x6225('0xd')][_0x16c6c0['uniqueid']][_0x6225('0x22')]=_0x16c6c0[_0x6225('0x22')];this['channels'][_0x16c6c0['uniqueid']][_0x6225('0x32')]=_0x16c6c0['resolution'];this[_0x6225('0xd')][_0x16c6c0[_0x6225('0x23')]][_0x6225('0x33')]=_0x16c6c0['transferrate'];this[_0x6225('0xd')][_0x16c6c0['uniqueid']][_0x6225('0x2e')]=_0x16c6c0['filename'];this[_0x6225('0xd')][_0x16c6c0[_0x6225('0x23')]][_0x6225('0x34')]=_0x16c6c0[_0x6225('0x34')];if(this[_0x6225('0xd')][_0x16c6c0[_0x6225('0x23')]][_0x6225('0x31')]>0x0){tiff2pdf(_0x16c6c0['filename'],_0x6225('0x35'),function(_0x48d437){logger['info'](_0x16c6c0[_0x6225('0x23')],'\x20result\x20conversion\x20file\x20',_0x48d437[_0x6225('0x36')]);attachment['create']({'name':path[_0x6225('0x37')](_0x16c6c0[_0x6225('0x2e')])[_0x6225('0x38')],'basename':path[_0x6225('0x37')](_0x16c6c0['filename'])[_0x6225('0x38')]+'.pdf','type':_0x6225('0x39')})[_0x6225('0x3a')](function(_0x5d52d7){faxAccount['notify'](_0x4795a9,{'from':_0x16c6c0[_0x6225('0x34')],'mapKey':_0x6225('0x6'),'body':path[_0x6225('0x37')](_0x16c6c0[_0x6225('0x2e')])[_0x6225('0x38')]+'.pdf','AttachmentId':_0x5d52d7['id']})[_0x6225('0x3b')](function(_0x1e2316){logger[_0x6225('0x3c')](_0x16c6c0['uniqueid'],_0x6225('0x3d'),JSON[_0x6225('0x3e')](_0x1e2316));});})[_0x6225('0x3b')](function(_0x37312f){logger[_0x6225('0x3c')](_0x16c6c0['uniqueid'],_0x6225('0x3f'),JSON[_0x6225('0x3e')](_0x37312f));});});}logger[_0x6225('0x25')](_0x16c6c0[_0x6225('0x23')],_0x6225('0x3f'));}};Fax[_0x6225('0x1e')]['syncOriginateResponse']=function(_0x55b100){if(this[_0x6225('0x27')][_0x55b100[_0x6225('0x23')]]){_[_0x6225('0x40')](this[_0x6225('0xd')][_0x55b100[_0x6225('0x23')]],_[_0x6225('0x41')](_0x55b100,[_0x6225('0x42'),_0x6225('0x43')]));}};function updateStatus(_0x5c2d73){if(_0x5c2d73[_0x6225('0x44')]){faxMessage['update'](_0x5c2d73[_0x6225('0x44')],{'failMessage':'SENDING\x20FAILED\x20'})[_0x6225('0x3a')](function(_0x37cb9b){ut[_0x6225('0x45')]('[Fax][Message][Error][Updated]',_0x37cb9b);})['catch'](function(_0x1871f4){ut[_0x6225('0x45')]('[Fax][Message][Error][NoUpdate1]',_0x1871f4);});}else{ut[_0x6225('0x45')](_0x6225('0x46'));}}Fax['prototype'][_0x6225('0x47')]=function(_0x34d617,_0x3a13cc,_0x2f0e89){var _0x45d202=this;var _0x2e835d={};if(_0x3a13cc){_0x2e835d={'read':_0x3a13cc};}else{_0x2e835d={'failMessage':_0x2f0e89};}if(this['actions'][_0x34d617][_0x6225('0x44')]){faxMessage[_0x6225('0x48')](this[_0x6225('0x27')][_0x34d617]['AttachmentId'],_0x2e835d)['then'](function(_0x2599c2){ut[_0x6225('0x45')]('[Fax][Message][Updated]',_0x2599c2);})[_0x6225('0x3b')](function(_0x5bf3e1){ut[_0x6225('0x45')](_0x6225('0x49'),_0x5bf3e1);})['finally'](function(){delete _0x45d202[_0x6225('0xd')][_0x34d617];delete _0x45d202[_0x6225('0x27')][_0x34d617];});}else{ut[_0x6225('0x45')](_0x6225('0x4a'));delete this[_0x6225('0xd')][_0x34d617];delete this[_0x6225('0x27')][_0x34d617];}};Fax[_0x6225('0x1e')][_0x6225('0x1c')]=function(_0x4a1325){var _0x846f25=this;if(this[_0x6225('0xd')][_0x4a1325['uniqueid']]){if(this[_0x6225('0x27')][_0x4a1325[_0x6225('0x23')]]){this['channels'][_0x4a1325[_0x6225('0x23')]]['id']=this[_0x6225('0x27')][_0x4a1325[_0x6225('0x23')]]['id'];this[_0x6225('0xd')][_0x4a1325[_0x6225('0x23')]]['name']=this['actions'][_0x4a1325[_0x6225('0x23')]][_0x6225('0x38')];}logger[_0x6225('0x25')](_0x4a1325[_0x6225('0x23')],this['actions'][_0x4a1325['uniqueid']]?_0x6225('0x4b'):_0x6225('0x4c'),JSON[_0x6225('0x3e')](this[_0x6225('0xd')][_0x4a1325['uniqueid']]));if(this[_0x6225('0x27')][_0x4a1325[_0x6225('0x23')]]){if(this[_0x6225('0xd')][_0x4a1325[_0x6225('0x23')]]['faxpages']>0x0&&this['channels'][_0x4a1325[_0x6225('0x23')]][_0x6225('0x4d')]==='SUCCESS'){this['updateStatus'](_0x4a1325[_0x6225('0x23')],!![]);}else{this[_0x6225('0x47')](_0x4a1325[_0x6225('0x23')],![],this[_0x6225('0xd')][_0x4a1325[_0x6225('0x23')]][_0x6225('0x4e')]?_0x6225('0x4f')+this[_0x6225('0xd')][_0x4a1325[_0x6225('0x23')]]['faxstatusstring']:_0x6225('0x50'));}}}};Fax[_0x6225('0x1e')][_0x6225('0x51')]=function(_0x59fa5e){var _0xa1f9b2=this;return new BPromise(function(_0x9b5f,_0x393d3a){_0xa1f9b2[_0x6225('0x52')](_0x59fa5e,_0xa1f9b2[_0x6225('0xe')][_0x59fa5e[_0x6225('0x53')]])[_0x6225('0x3a')](function(_0x3ab835){ut['logger'](_0x6225('0x54'),_0x3ab835);_0x9b5f(ut[_0x6225('0x36')]('Fax\x20received'));})['catch'](function(_0x1a4556){ut[_0x6225('0x45')](_0x6225('0x55'),_0x1a4556);updateStatus(_0x59fa5e);_0x393d3a(ut[_0x6225('0x36')](_0x6225('0x56')));});});};Fax[_0x6225('0x1e')][_0x6225('0x57')]=function(_0x3011ea){var _0x193313=this;return new BPromise(function(_0x4aaaab,_0x3a4d03){var _0x3d2852=_0x193313['checkTrunk'](_0x193313[_0x6225('0xe')][_0x3011ea['FaxAccountId']]['Trunk'],_0x3011ea);if(_0x3d2852['isValid']){_0x4aaaab(ut['message'](_0x6225('0x58')));}else{_0x3a4d03(ut[_0x6225('0x36')](_0x3d2852[_0x6225('0x36')]));}});};function originate(_0x317e4b,_0x589c3a,_0x5e249b){return new BPromise(function(_0x5ddf62,_0x233af8){if(_0x5e249b){var _0x3f7a97=util[_0x6225('0x59')](_0x6225('0x5a'),path['parse'](_0x317e4b[_0x6225('0x3')])[_0x6225('0x38')],_0x317e4b[_0x6225('0x3')]);gs[_0x6225('0x5b')](_0x3f7a97)['then'](function(){_0x317e4b[_0x6225('0x3')]=util[_0x6225('0x59')](_0x6225('0x5c'),path[_0x6225('0x37')](_0x317e4b[_0x6225('0x3')])[_0x6225('0x5d')],path[_0x6225('0x37')](_0x317e4b['path'])[_0x6225('0x38')]);_0x589c3a['XMF-PATH']=_0x317e4b[_0x6225('0x3')];ut[_0x6225('0x45')]('Convert\x20pdf\x20to\x20tif','');ami[_0x6225('0x5e')](ut[_0x6225('0x5f')](_0x317e4b,_0x589c3a))[_0x6225('0x3a')](function(_0x3b028f){_0x5ddf62(_0x3b028f);})[_0x6225('0x3b')](function(_0x24f4fd){_0x233af8(_0x24f4fd);});})[_0x6225('0x3b')](function(_0x3dc640){_0x233af8(_0x3dc640);});}else{ami[_0x6225('0x5e')](ut[_0x6225('0x5f')](_0x317e4b,_0x589c3a))[_0x6225('0x3a')](function(_0x3d4ff0){_0x5ddf62(_0x3d4ff0);})[_0x6225('0x3b')](function(_0x2c7671){_0x233af8(_0x2c7671);});}});}Fax[_0x6225('0x1e')][_0x6225('0x52')]=function(_0x2e62c8,_0x2aaf06){var _0x325d47=this;return new BPromise(function(_0x11ce20,_0x537524){var _0x1928ea=uuid['v4']();var _0x9e4ca5=ut['addVariables'](_0x2e62c8,_0x2aaf06);_0x325d47[_0x6225('0x27')][_0x1928ea]=new Action(_0x1928ea,_0x2aaf06,_0x2e62c8);var _0x36300f=_0x325d47[_0x6225('0x27')][_0x1928ea];if(path['parse'](_0x2e62c8[_0x6225('0x3')])[_0x6225('0x60')]==='.pdf'){originate(_0x36300f,_0x9e4ca5,!![])[_0x6225('0x3a')](function(_0x1bbf53){_0x11ce20(_0x1bbf53);})[_0x6225('0x3b')](function(_0x3379d6){_0x537524(_0x3379d6);});}else{originate(_0x36300f,_0x9e4ca5,![])[_0x6225('0x3a')](function(_0x3415cd){_0x11ce20(_0x3415cd);})[_0x6225('0x3b')](function(_0x487f4a){_0x537524(_0x487f4a);});}});};Fax[_0x6225('0x1e')][_0x6225('0x61')]=function(_0x4ddf99){return!_['isNil'](_0x4ddf99)&&!_[_0x6225('0x62')](_0x4ddf99['name'])&&!_[_0x6225('0x62')](_0x4ddf99[_0x6225('0x63')])&&_0x4ddf99[_0x6225('0x63')]&&!_['isNil'](this[_0x6225('0xf')][util[_0x6225('0x59')](_0x6225('0x64'),_0x4ddf99[_0x6225('0x38')])])&&!_[_0x6225('0x62')](this[_0x6225('0xf')][util['format'](_0x6225('0x64'),_0x4ddf99[_0x6225('0x38')])][_0x6225('0x2d')])&&(this[_0x6225('0xf')][util[_0x6225('0x59')]('SIP/%s',_0x4ddf99['name'])][_0x6225('0x2d')]===_0x6225('0x65')||this[_0x6225('0xf')][util['format']('SIP/%s',_0x4ddf99[_0x6225('0x38')])][_0x6225('0x2d')]==='unmonitored');};Fax[_0x6225('0x1e')][_0x6225('0x66')]=function(_0x4a234b,_0x1fc2cf){if(!this['isTrunkReachable'](_0x4a234b)){ut[_0x6225('0x45')](_0x6225('0x67'),_[_0x6225('0x62')](_0x4a234b)?'':_0x4a234b[_0x6225('0x38')]+_0x6225('0x68'));return{'isValid':![],'message':_0x6225('0x69')};}if(_['isNil'](_0x1fc2cf[_0x6225('0x6')])){ut[_0x6225('0x45')](_0x6225('0x6a'),JSON['stringify'](_0x1fc2cf));return{'isValid':![],'message':_0x6225('0x6b')};}if(_['isNil'](_0x1fc2cf[_0x6225('0x3')])){ut[_0x6225('0x45')](_0x6225('0x6c'),JSON['stringify'](_0x1fc2cf));return{'isValid':![],'message':_0x6225('0x6d')};}return{'isValid':!![],'message':_0x6225('0x6e')};};module[_0x6225('0x6f')]=Fax; \ No newline at end of file +var _0xca9d=['\x20result\x20conversion\x20file\x20','create','parse','application/pdf','then','notify','.pdf','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','pick','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','execOriginate','FaxAccountId','message','Fax\x20received','[Fax][execOriginate][failure]','checkAfterSend','checkTrunk','Trunk','isValid','Trunk\x20Reachable','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','format','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isNil','active','SIP/%s','reachable','unmonitored','isTrunkReachable','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Is\x20Valid','exports','util','lodash','bluebird','uuid','moment','path','tiff2pdf','../../../config/logger','fax','../ami','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xca9d,0x13a));var _0xdca9=function(_0x3f12fa,_0x3ba20e){_0x3f12fa=_0x3f12fa-0x0;var _0x48bc3a=_0xca9d[_0x3f12fa];return _0x48bc3a;};'use strict';var util=require(_0xdca9('0x0'));var _=require(_0xdca9('0x1'));var BPromise=require(_0xdca9('0x2'));var uuid=require(_0xdca9('0x3'));var moment=require(_0xdca9('0x4'));var path=require(_0xdca9('0x5'));var tiff2pdf=require(_0xdca9('0x6'));var gs=require('./util/gs');var logger=require(_0xdca9('0x7'))(_0xdca9('0x8'));var ami=require(_0xdca9('0x9'));var rpcDb=require('./rpcDb');var Channel=require(_0xdca9('0xa'));var ut=require(_0xdca9('0xb'));var Action=require(_0xdca9('0xc'));var faxAccount=require(_0xdca9('0xd'));var attachment=require(_0xdca9('0xe'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x28fe86){this[_0xdca9('0xf')]={};this['faxAccounts']=_0x28fe86[_0xdca9('0x10')];this[_0xdca9('0x11')]=_0x28fe86[_0xdca9('0x11')];this[_0xdca9('0x12')]={};ami['on'](_0xdca9('0x13'),this[_0xdca9('0x14')][_0xdca9('0x15')](this));ami['on'](_0xdca9('0x16'),this[_0xdca9('0x17')][_0xdca9('0x15')](this));ami['on']('newstate',this[_0xdca9('0x18')]['bind'](this));ami['on'](_0xdca9('0x19'),this[_0xdca9('0x1a')]['bind'](this));ami['on'](_0xdca9('0x1b'),this[_0xdca9('0x1c')][_0xdca9('0x15')](this));ami['on'](_0xdca9('0x1d'),this[_0xdca9('0x1e')][_0xdca9('0x15')](this));ami['on'](_0xdca9('0x1f'),this[_0xdca9('0x20')][_0xdca9('0x15')](this));ami['on'](_0xdca9('0x21'),this[_0xdca9('0x22')][_0xdca9('0x15')](this));}Fax[_0xdca9('0x23')][_0xdca9('0x14')]=function(_0x2f28ee){if(_0x2f28ee['context']===_0xdca9('0x24')){for(var _0x2a79cc in this['faxAccounts']){if(this[_0xdca9('0x10')][_0xdca9('0x25')](_0x2a79cc)){if(_0x2f28ee[_0xdca9('0x26')]===this[_0xdca9('0x10')][_0x2a79cc][_0xdca9('0x27')]){this[_0xdca9('0xf')][_0x2f28ee[_0xdca9('0x28')]]={};this[_0xdca9('0xf')][_0x2f28ee['uniqueid']][_0xdca9('0x29')]=_0x2f28ee[_0xdca9('0x29')];this[_0xdca9('0xf')][_0x2f28ee[_0xdca9('0x28')]]['id']=this[_0xdca9('0x10')][_0x2a79cc]['id'];this[_0xdca9('0xf')][_0x2f28ee[_0xdca9('0x28')]][_0xdca9('0x2a')]=this[_0xdca9('0x10')][_0x2a79cc][_0xdca9('0x2a')];logger[_0xdca9('0x2b')](_0x2f28ee['uniqueid'],_0xdca9('0x2c'));}}}}if(this[_0xdca9('0x12')][_0x2f28ee[_0xdca9('0x28')]]){this['channels'][_0x2f28ee[_0xdca9('0x28')]]={};this[_0xdca9('0xf')][_0x2f28ee[_0xdca9('0x28')]][_0xdca9('0x29')]=_0x2f28ee['channel'];logger[_0xdca9('0x2b')](_0x2f28ee[_0xdca9('0x28')],_0xdca9('0x2c'));}};Fax[_0xdca9('0x23')]['syncVarSet']=function(_0x5a20a0){if(this[_0xdca9('0xf')][_0x5a20a0['uniqueid']]){for(var _0x240037 in _0x5a20a0[_0xdca9('0x2d')]){if(_0x5a20a0['variable'][_0xdca9('0x25')](_0x240037)){this[_0xdca9('0xf')][_0x5a20a0['uniqueid']][_0x240037]=_0x5a20a0[_0xdca9('0x2e')];}}}};Fax['prototype'][_0xdca9('0x18')]=function(_0x53194e){if(this[_0xdca9('0xf')][_0x53194e['uniqueid']]){this['channels'][_0x53194e[_0xdca9('0x28')]][_0xdca9('0x2f')]=_0x53194e[_0xdca9('0x2f')];this['channels'][_0x53194e['uniqueid']][_0xdca9('0x30')]=_0x53194e[_0xdca9('0x30')];}};Fax[_0xdca9('0x23')][_0xdca9('0x1a')]=function(_0x212d0d){if(this['channels'][_0x212d0d[_0xdca9('0x28')]]){for(var _0x37d49f in _0x212d0d['variable']){if(_0x212d0d[_0xdca9('0x2d')]['hasOwnProperty'](_0x37d49f)){this[_0xdca9('0xf')][_0x212d0d[_0xdca9('0x28')]][_0x37d49f]=_0x212d0d[_0xdca9('0x2e')];}}}};Fax['prototype'][_0xdca9('0x1c')]=function(_0x3a5308){if(this[_0xdca9('0xf')][_0x3a5308[_0xdca9('0x28')]]){this[_0xdca9('0xf')][_0x3a5308[_0xdca9('0x28')]]['operation']=_0x3a5308[_0xdca9('0x31')];this['channels'][_0x3a5308['uniqueid']][_0xdca9('0x32')]=_0x3a5308[_0xdca9('0x32')];this[_0xdca9('0xf')][_0x3a5308[_0xdca9('0x28')]][_0xdca9('0x27')]=_0x3a5308['localstationid'];this[_0xdca9('0xf')][_0x3a5308[_0xdca9('0x28')]][_0xdca9('0x33')]=_0x3a5308[_0xdca9('0x33')];logger['info'](_0x3a5308[_0xdca9('0x28')],_0xdca9('0x34'));}};Fax['prototype'][_0xdca9('0x1e')]=function(_0x5c516f){var _0x21ba5c=this;if(this[_0xdca9('0xf')][_0x5c516f[_0xdca9('0x28')]]){var _0x7a4ef7=this[_0xdca9('0xf')][_0x5c516f['uniqueid']]['id'];this[_0xdca9('0xf')][_0x5c516f[_0xdca9('0x28')]][_0xdca9('0x35')]=_0x5c516f[_0xdca9('0x35')];this[_0xdca9('0xf')][_0x5c516f[_0xdca9('0x28')]][_0xdca9('0x36')]=_0x5c516f['pagestransferred'];this[_0xdca9('0xf')][_0x5c516f[_0xdca9('0x28')]][_0xdca9('0x27')]=_0x5c516f[_0xdca9('0x27')];this[_0xdca9('0xf')][_0x5c516f[_0xdca9('0x28')]][_0xdca9('0x37')]=_0x5c516f[_0xdca9('0x37')];this['channels'][_0x5c516f['uniqueid']][_0xdca9('0x38')]=_0x5c516f['transferrate'];this[_0xdca9('0xf')][_0x5c516f[_0xdca9('0x28')]][_0xdca9('0x33')]=_0x5c516f[_0xdca9('0x33')];this[_0xdca9('0xf')][_0x5c516f['uniqueid']]['calleridnum']=_0x5c516f[_0xdca9('0x39')];if(this[_0xdca9('0xf')][_0x5c516f[_0xdca9('0x28')]][_0xdca9('0x36')]>0x0){tiff2pdf(_0x5c516f[_0xdca9('0x33')],'/var/opt/motion2/server/files/attachments/',function(_0xfc5475){logger[_0xdca9('0x2b')](_0x5c516f['uniqueid'],_0xdca9('0x3a'),_0xfc5475['message']);attachment[_0xdca9('0x3b')]({'name':path[_0xdca9('0x3c')](_0x5c516f[_0xdca9('0x33')])[_0xdca9('0x2a')],'basename':path[_0xdca9('0x3c')](_0x5c516f[_0xdca9('0x33')])[_0xdca9('0x2a')]+'.pdf','type':_0xdca9('0x3d')})[_0xdca9('0x3e')](function(_0x4f4375){faxAccount[_0xdca9('0x3f')](_0x7a4ef7,{'from':_0x5c516f[_0xdca9('0x39')],'mapKey':_0xdca9('0x8'),'body':path[_0xdca9('0x3c')](_0x5c516f['filename'])[_0xdca9('0x2a')]+_0xdca9('0x40'),'AttachmentId':_0x4f4375['id']})[_0xdca9('0x41')](function(_0x49f1c5){logger[_0xdca9('0x42')](_0x5c516f[_0xdca9('0x28')],_0xdca9('0x43'),JSON[_0xdca9('0x44')](_0x49f1c5));});})[_0xdca9('0x41')](function(_0x21f4d5){logger['error'](_0x5c516f[_0xdca9('0x28')],_0xdca9('0x45'),JSON[_0xdca9('0x44')](_0x21f4d5));});});}logger[_0xdca9('0x2b')](_0x5c516f[_0xdca9('0x28')],_0xdca9('0x45'));}};Fax['prototype'][_0xdca9('0x22')]=function(_0x3ba322){if(this[_0xdca9('0x12')][_0x3ba322[_0xdca9('0x28')]]){_[_0xdca9('0x46')](this[_0xdca9('0xf')][_0x3ba322['uniqueid']],_[_0xdca9('0x47')](_0x3ba322,['response',_0xdca9('0x48')]));}};function updateStatus(_0x52eb39){if(_0x52eb39[_0xdca9('0x49')]){faxMessage[_0xdca9('0x4a')](_0x52eb39['AttachmentId'],{'failMessage':_0xdca9('0x4b')})['then'](function(_0x1984c3){ut[_0xdca9('0x4c')](_0xdca9('0x4d'),_0x1984c3);})[_0xdca9('0x41')](function(_0x1c7a38){ut[_0xdca9('0x4c')]('[Fax][Message][Error][NoUpdate1]',_0x1c7a38);});}else{ut['logger'](_0xdca9('0x4e'));}}Fax['prototype'][_0xdca9('0x4f')]=function(_0xbe5057,_0x1344eb,_0x150b4c){var _0x184a1f=this;var _0x3f784e={};if(_0x1344eb){_0x3f784e={'read':_0x1344eb};}else{_0x3f784e={'failMessage':_0x150b4c};}if(this['actions'][_0xbe5057][_0xdca9('0x49')]){faxMessage['update'](this[_0xdca9('0x12')][_0xbe5057][_0xdca9('0x49')],_0x3f784e)['then'](function(_0x1d3901){ut[_0xdca9('0x4c')]('[Fax][Message][Updated]',_0x1d3901);})[_0xdca9('0x41')](function(_0x5d441d){ut[_0xdca9('0x4c')](_0xdca9('0x50'),_0x5d441d);})[_0xdca9('0x51')](function(){delete _0x184a1f['channels'][_0xbe5057];delete _0x184a1f[_0xdca9('0x12')][_0xbe5057];});}else{ut['logger'](_0xdca9('0x52'));delete this[_0xdca9('0xf')][_0xbe5057];delete this['actions'][_0xbe5057];}};Fax[_0xdca9('0x23')]['syncHangup']=function(_0x525389){var _0x1c2d05=this;if(this['channels'][_0x525389[_0xdca9('0x28')]]){if(this[_0xdca9('0x12')][_0x525389[_0xdca9('0x28')]]){this[_0xdca9('0xf')][_0x525389[_0xdca9('0x28')]]['id']=this[_0xdca9('0x12')][_0x525389[_0xdca9('0x28')]]['id'];this[_0xdca9('0xf')][_0x525389[_0xdca9('0x28')]][_0xdca9('0x2a')]=this[_0xdca9('0x12')][_0x525389['uniqueid']]['name'];}logger[_0xdca9('0x2b')](_0x525389[_0xdca9('0x28')],this[_0xdca9('0x12')][_0x525389[_0xdca9('0x28')]]?_0xdca9('0x53'):'\x20hangup\x20faxRiceive\x20',JSON[_0xdca9('0x44')](this[_0xdca9('0xf')][_0x525389[_0xdca9('0x28')]]));if(this['actions'][_0x525389[_0xdca9('0x28')]]){if(this['channels'][_0x525389['uniqueid']][_0xdca9('0x54')]>0x0&&this['channels'][_0x525389['uniqueid']][_0xdca9('0x1b')]===_0xdca9('0x55')){this[_0xdca9('0x4f')](_0x525389[_0xdca9('0x28')],!![]);}else{this[_0xdca9('0x4f')](_0x525389[_0xdca9('0x28')],![],this[_0xdca9('0xf')][_0x525389[_0xdca9('0x28')]][_0xdca9('0x56')]?_0xdca9('0x57')+this[_0xdca9('0xf')][_0x525389[_0xdca9('0x28')]][_0xdca9('0x56')]:_0xdca9('0x58'));}}}};Fax['prototype']['send']=function(_0x2b702f){var _0x488b02=this;return new BPromise(function(_0x4dfbee,_0x46f5bd){_0x488b02[_0xdca9('0x59')](_0x2b702f,_0x488b02[_0xdca9('0x10')][_0x2b702f[_0xdca9('0x5a')]])['then'](function(_0x796756){ut[_0xdca9('0x4c')]('[Fax][execOriginate][success]',_0x796756);_0x4dfbee(ut[_0xdca9('0x5b')](_0xdca9('0x5c')));})[_0xdca9('0x41')](function(_0x4c41bf){ut['logger'](_0xdca9('0x5d'),_0x4c41bf);updateStatus(_0x2b702f);_0x46f5bd(ut['message']('Fax\x20failed'));});});};Fax[_0xdca9('0x23')][_0xdca9('0x5e')]=function(_0x5bfae4){var _0x478550=this;return new BPromise(function(_0x422008,_0x5d7726){var _0x8dafce=_0x478550[_0xdca9('0x5f')](_0x478550[_0xdca9('0x10')][_0x5bfae4['FaxAccountId']][_0xdca9('0x60')],_0x5bfae4);if(_0x8dafce[_0xdca9('0x61')]){_0x422008(ut[_0xdca9('0x5b')](_0xdca9('0x62')));}else{_0x5d7726(ut[_0xdca9('0x5b')](_0x8dafce[_0xdca9('0x5b')]));}});};function originate(_0x50b4cc,_0xe0741e,_0xf4a56d){return new BPromise(function(_0x28caf7,_0x568318){if(_0xf4a56d){var _0x10b952=util['format'](_0xdca9('0x63'),path[_0xdca9('0x3c')](_0x50b4cc['path'])[_0xdca9('0x2a')],_0x50b4cc[_0xdca9('0x5')]);gs[_0xdca9('0x64')](_0x10b952)[_0xdca9('0x3e')](function(){_0x50b4cc[_0xdca9('0x5')]=util[_0xdca9('0x65')](_0xdca9('0x66'),path[_0xdca9('0x3c')](_0x50b4cc[_0xdca9('0x5')])[_0xdca9('0x67')],path[_0xdca9('0x3c')](_0x50b4cc[_0xdca9('0x5')])['name']);_0xe0741e[_0xdca9('0x68')]=_0x50b4cc[_0xdca9('0x5')];ut['logger'](_0xdca9('0x69'),'');ami[_0xdca9('0x6a')](ut[_0xdca9('0x6b')](_0x50b4cc,_0xe0741e))['then'](function(_0x29810f){_0x28caf7(_0x29810f);})[_0xdca9('0x41')](function(_0x59facb){_0x568318(_0x59facb);});})[_0xdca9('0x41')](function(_0x19654a){_0x568318(_0x19654a);});}else{ami['Action'](ut[_0xdca9('0x6b')](_0x50b4cc,_0xe0741e))[_0xdca9('0x3e')](function(_0x2b419b){_0x28caf7(_0x2b419b);})[_0xdca9('0x41')](function(_0x3b05e3){_0x568318(_0x3b05e3);});}});}Fax[_0xdca9('0x23')]['execOriginate']=function(_0x218476,_0x3aeea2){var _0x5d52ec=this;return new BPromise(function(_0x1b9d21,_0x560ef7){var _0x5ef13a=uuid['v4']();var _0x1ec555=ut[_0xdca9('0x6c')](_0x218476,_0x3aeea2);_0x5d52ec[_0xdca9('0x12')][_0x5ef13a]=new Action(_0x5ef13a,_0x3aeea2,_0x218476);var _0x217344=_0x5d52ec[_0xdca9('0x12')][_0x5ef13a];if(path['parse'](_0x218476[_0xdca9('0x5')])[_0xdca9('0x6d')]===_0xdca9('0x40')){originate(_0x217344,_0x1ec555,!![])[_0xdca9('0x3e')](function(_0x362e1d){_0x1b9d21(_0x362e1d);})[_0xdca9('0x41')](function(_0x3fd350){_0x560ef7(_0x3fd350);});}else{originate(_0x217344,_0x1ec555,![])[_0xdca9('0x3e')](function(_0x462e11){_0x1b9d21(_0x462e11);})['catch'](function(_0x41e6ca){_0x560ef7(_0x41e6ca);});}});};Fax[_0xdca9('0x23')]['isTrunkReachable']=function(_0x2a4cee){return!_[_0xdca9('0x6e')](_0x2a4cee)&&!_['isNil'](_0x2a4cee[_0xdca9('0x2a')])&&!_[_0xdca9('0x6e')](_0x2a4cee[_0xdca9('0x6f')])&&_0x2a4cee[_0xdca9('0x6f')]&&!_[_0xdca9('0x6e')](this[_0xdca9('0x11')][util[_0xdca9('0x65')]('SIP/%s',_0x2a4cee[_0xdca9('0x2a')])])&&!_[_0xdca9('0x6e')](this[_0xdca9('0x11')][util[_0xdca9('0x65')](_0xdca9('0x70'),_0x2a4cee[_0xdca9('0x2a')])]['status'])&&(this['trunks'][util[_0xdca9('0x65')](_0xdca9('0x70'),_0x2a4cee[_0xdca9('0x2a')])][_0xdca9('0x32')]===_0xdca9('0x71')||this[_0xdca9('0x11')][util[_0xdca9('0x65')]('SIP/%s',_0x2a4cee['name'])]['status']===_0xdca9('0x72'));};Fax[_0xdca9('0x23')][_0xdca9('0x5f')]=function(_0x278ed7,_0x5c4295){if(!this[_0xdca9('0x73')](_0x278ed7)){ut['logger'](_0xdca9('0x74'),_[_0xdca9('0x6e')](_0x278ed7)?'':_0x278ed7[_0xdca9('0x2a')]+_0xdca9('0x75'));return{'isValid':![],'message':_0xdca9('0x76')};}if(_['isNil'](_0x5c4295[_0xdca9('0x8')])){ut[_0xdca9('0x4c')](_0xdca9('0x77'),JSON[_0xdca9('0x44')](_0x5c4295));return{'isValid':![],'message':_0xdca9('0x78')};}if(_['isNil'](_0x5c4295[_0xdca9('0x5')])){ut['logger'](_0xdca9('0x79'),JSON['stringify'](_0x5c4295));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0xdca9('0x7a')};};module[_0xdca9('0x7b')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 780fff4..43c3e43 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 _0x4071=['bluebird','../../../config/logger','preview','lodash','error','inspect','notify','catch','util'];(function(_0x554814,_0x584e14){var _0x1234e0=function(_0x29b53d){while(--_0x29b53d){_0x554814['push'](_0x554814['shift']());}};_0x1234e0(++_0x584e14);}(_0x4071,0x1a6));var _0x1407=function(_0x40df38,_0x370e4e){_0x40df38=_0x40df38-0x0;var _0x41af26=_0x4071[_0x40df38];return _0x41af26;};'use strict';var util=require(_0x1407('0x0'));var BPromise=require(_0x1407('0x1'));var logger=require(_0x1407('0x2'))(_0x1407('0x3'));var _=require(_0x1407('0x4'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x2aa6f0){return function(_0x2a2dcd){logger[_0x1407('0x5')](_0x2aa6f0,util[_0x1407('0x6')](_0x2a2dcd,{'showHidden':![],'depth':null}));};}exports[_0x1407('0x7')]=function(_0x4eaf3d,_0x312d2b){return BPromise['resolve']()['then'](faxAccount[_0x1407('0x7')](_0x4eaf3d,_0x312d2b))[_0x1407('0x8')](loggerCatch('[Notify]\x20'));}; \ No newline at end of file +var _0x5e17=['[Notify]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/faxAccount','inspect','notify','resolve','catch'];(function(_0x5a452e,_0x355a90){var _0x2c4c43=function(_0x2d9e3f){while(--_0x2d9e3f){_0x5a452e['push'](_0x5a452e['shift']());}};_0x2c4c43(++_0x355a90);}(_0x5e17,0xb1));var _0x75e1=function(_0x5d5ccc,_0x1e8665){_0x5d5ccc=_0x5d5ccc-0x0;var _0x257a7e=_0x5e17[_0x5d5ccc];return _0x257a7e;};'use strict';var util=require(_0x75e1('0x0'));var BPromise=require(_0x75e1('0x1'));var logger=require(_0x75e1('0x2'))(_0x75e1('0x3'));var _=require(_0x75e1('0x4'));var faxAccount=require(_0x75e1('0x5'));function loggerCatch(_0x1b2a98){return function(_0x493462){logger['error'](_0x1b2a98,util[_0x75e1('0x6')](_0x493462,{'showHidden':![],'depth':null}));};}exports[_0x75e1('0x7')]=function(_0x56537a,_0x52fb13){return BPromise[_0x75e1('0x8')]()['then'](faxAccount[_0x75e1('0x7')](_0x56537a,_0x52fb13))[_0x75e1('0x9')](loggerCatch(_0x75e1('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 b015b15..70e3290 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 _0x4f4f=['bluebird','child_process','execute','Exec\x20gs','info','\x20Error\x20:','util','../../../../config/logger','fax'];(function(_0x39f77f,_0x4bf812){var _0x53b26f=function(_0x1246bc){while(--_0x1246bc){_0x39f77f['push'](_0x39f77f['shift']());}};_0x53b26f(++_0x4bf812);}(_0x4f4f,0xde));var _0xf4f4=function(_0x4cb9aa,_0x58b44f){_0x4cb9aa=_0x4cb9aa-0x0;var _0x2eff51=_0x4f4f[_0x4cb9aa];return _0x2eff51;};'use strict';var util=require(_0xf4f4('0x0'));var logger=require(_0xf4f4('0x1'))(_0xf4f4('0x2'));var BPromise=require(_0xf4f4('0x3'));var exec=require(_0xf4f4('0x4'))['exec'];exports[_0xf4f4('0x5')]=function(_0x2162e2){return new BPromise(function(_0x14c5a1,_0x202789){exec(_0x2162e2,function(_0x10e1c5,_0x13c1c7,_0xd6db37){logger['info'](_0xf4f4('0x6'),_0x13c1c7);if(_0x10e1c5){logger[_0xf4f4('0x7')](_0xf4f4('0x6'),_0xf4f4('0x8'),util['inspect'](_0x10e1c5,{'showHidden':![],'depth':null}),_0x13c1c7,_0xd6db37);_0x202789(_0x10e1c5);}_0x14c5a1(_0x13c1c7);});});}; \ No newline at end of file +var _0x31b3=['info','Exec\x20gs','\x20Error\x20:','inspect','util','bluebird','execute'];(function(_0x485cc3,_0x188676){var _0xe7a90c=function(_0x4acb55){while(--_0x4acb55){_0x485cc3['push'](_0x485cc3['shift']());}};_0xe7a90c(++_0x188676);}(_0x31b3,0x1c4));var _0x331b=function(_0x3020ea,_0x2c71f6){_0x3020ea=_0x3020ea-0x0;var _0x2a8cc0=_0x31b3[_0x3020ea];return _0x2a8cc0;};'use strict';var util=require(_0x331b('0x0'));var logger=require('../../../../config/logger')('fax');var BPromise=require(_0x331b('0x1'));var exec=require('child_process')['exec'];exports[_0x331b('0x2')]=function(_0x70de4a){return new BPromise(function(_0x31d8a4,_0x1b178c){exec(_0x70de4a,function(_0x568ef1,_0x12315b,_0x3c147a){logger[_0x331b('0x3')]('Exec\x20gs',_0x12315b);if(_0x568ef1){logger['info'](_0x331b('0x4'),_0x331b('0x5'),util[_0x331b('0x6')](_0x568ef1,{'showHidden':![],'depth':null}),_0x12315b,_0x3c147a);_0x1b178c(_0x568ef1);}_0x31d8a4(_0x12315b);});});}; \ 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 1f6ee13..bb3e0f7 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 _0xa11f=['maxrate','format','modem','gateway','faxdetect','t38timeout','localstationid','path','variablesAction','originate','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','util','lodash','fax','message','logger','info','inspect','addVariables','ecm','headerinfo','minrate'];(function(_0x3d4fc3,_0x4c1d67){var _0x1d0b82=function(_0x52dba0){while(--_0x52dba0){_0x3d4fc3['push'](_0x3d4fc3['shift']());}};_0x1d0b82(++_0x4c1d67);}(_0xa11f,0xa4));var _0xfa11=function(_0x261b8a,_0x553ec4){_0x261b8a=_0x261b8a-0x0;var _0x3455e8=_0xa11f[_0x261b8a];return _0x3455e8;};'use strict';var util=require(_0xfa11('0x0'));var _=require(_0xfa11('0x1'));var moment=require('moment');var logger=require('../../../../config/logger')(_0xfa11('0x2'));exports[_0xfa11('0x3')]=function(_0x1c120f){return{'message':_0x1c120f};};exports[_0xfa11('0x4')]=function(_0x3b4513,_0x57de08){logger[_0xfa11('0x5')](_0x3b4513,util[_0xfa11('0x6')](_0x57de08,{'showHidden':![],'depth':null}));};exports[_0xfa11('0x7')]=function(_0x473217,_0x506dd4){var _0x43766d={'XMF-ECM':_0x506dd4[_0xfa11('0x8')],'XMF-HEADERINFO':_0x506dd4[_0xfa11('0x9')],'XMF-MINRATE':_0x506dd4[_0xfa11('0xa')],'XMF-MAXRATE':_0x506dd4[_0xfa11('0xb')],'XMF-MODEM':util[_0xfa11('0xc')]('\x22%s\x22',_0x506dd4[_0xfa11('0xd')]),'XMF-GATEWAY':_0x506dd4[_0xfa11('0xe')],'XMF-FAXDETECT':_0x506dd4[_0xfa11('0xf')],'XMF-T38TIMEOUT':_0x506dd4[_0xfa11('0x10')],'XMF-LOCALSTATIONID':_0x506dd4[_0xfa11('0x11')],'XMF-PATH':_0x473217[_0xfa11('0x12')]};return _0x43766d;};exports[_0xfa11('0x13')]=function(_0x197ca3,_0x41db21){return{'actionid':_0x197ca3['uniqueid'],'action':_0xfa11('0x14'),'channel':_0x197ca3[_0xfa11('0x15')],'Exten':_0xfa11('0x16'),'Context':_0xfa11('0x17'),'Priority':'1','callerid':util['format'](_0xfa11('0x18'),_0x197ca3[_0xfa11('0x9')]?_0x197ca3[_0xfa11('0x9')]:'',_0x197ca3[_0xfa11('0x11')]),'variable':_0x41db21,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x197ca3['uniqueid']};}; \ No newline at end of file +var _0xb8e6=['minrate','format','modem','faxdetect','t38timeout','localstationid','path','variablesAction','uniqueid','originate','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','util','../../../../config/logger','fax','message','logger','info','inspect','addVariables','ecm','headerinfo'];(function(_0x29e2af,_0x15e2b1){var _0x1ea06a=function(_0x34d736){while(--_0x34d736){_0x29e2af['push'](_0x29e2af['shift']());}};_0x1ea06a(++_0x15e2b1);}(_0xb8e6,0x14f));var _0x6b8e=function(_0x437639,_0x29d4b7){_0x437639=_0x437639-0x0;var _0x5bc6c3=_0xb8e6[_0x437639];return _0x5bc6c3;};'use strict';var util=require(_0x6b8e('0x0'));var _=require('lodash');var moment=require('moment');var logger=require(_0x6b8e('0x1'))(_0x6b8e('0x2'));exports[_0x6b8e('0x3')]=function(_0x58a6ae){return{'message':_0x58a6ae};};exports[_0x6b8e('0x4')]=function(_0x2f7226,_0x67d702){logger[_0x6b8e('0x5')](_0x2f7226,util[_0x6b8e('0x6')](_0x67d702,{'showHidden':![],'depth':null}));};exports[_0x6b8e('0x7')]=function(_0x253bd2,_0x197b7e){var _0x3f8112={'XMF-ECM':_0x197b7e[_0x6b8e('0x8')],'XMF-HEADERINFO':_0x197b7e[_0x6b8e('0x9')],'XMF-MINRATE':_0x197b7e[_0x6b8e('0xa')],'XMF-MAXRATE':_0x197b7e['maxrate'],'XMF-MODEM':util[_0x6b8e('0xb')]('\x22%s\x22',_0x197b7e[_0x6b8e('0xc')]),'XMF-GATEWAY':_0x197b7e['gateway'],'XMF-FAXDETECT':_0x197b7e[_0x6b8e('0xd')],'XMF-T38TIMEOUT':_0x197b7e[_0x6b8e('0xe')],'XMF-LOCALSTATIONID':_0x197b7e[_0x6b8e('0xf')],'XMF-PATH':_0x253bd2[_0x6b8e('0x10')]};return _0x3f8112;};exports[_0x6b8e('0x11')]=function(_0x124d4d,_0x4bd8d9){return{'actionid':_0x124d4d[_0x6b8e('0x12')],'action':_0x6b8e('0x13'),'channel':_0x124d4d['channel'],'Exten':_0x6b8e('0x14'),'Context':_0x6b8e('0x15'),'Priority':'1','callerid':util[_0x6b8e('0xb')](_0x6b8e('0x16'),_0x124d4d['headerinfo']?_0x124d4d['headerinfo']:'',_0x124d4d[_0x6b8e('0xf')]),'variable':_0x4bd8d9,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x124d4d[_0x6b8e('0x12')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index ee2dabd..517f49f 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 _0xbc3f=['initVoiceQueues','getTemplates','initTemplates','initZendeskAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','initVoiceQueueReports','getVoiceQueueHopperHistory','getCampaignHopperHistory','getVoiceCallReports','catch','log','listen','util','moment','./realtime','./report','./acw','./trigger','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour','resolve','then','getAgents','getTelephones','getTrunks','initTrunks'];(function(_0x3634ea,_0xa325a7){var _0x2d4590=function(_0x1ce011){while(--_0x1ce011){_0x3634ea['push'](_0x3634ea['shift']());}};_0x2d4590(++_0xa325a7);}(_0xbc3f,0x1a7));var _0xfbc3=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xbc3f[_0x3ce3c];return _0x55a2c9;};'use strict';var BPromise=require('bluebird');var util=require(_0xfbc3('0x0'));var moment=require(_0xfbc3('0x1'));var server=require('./server');var Realtime=require(_0xfbc3('0x2'));var Report=require(_0xfbc3('0x3'));var Acw=require(_0xfbc3('0x4'));var Trigger=require(_0xfbc3('0x5'));var Dialer=require('./dialer');var Preview=require(_0xfbc3('0x6'));var Fax=require(_0xfbc3('0x7'));var user=require(_0xfbc3('0x8'));var voiceQueue=require(_0xfbc3('0x9'));var voiceQueueReport=require(_0xfbc3('0xa'));var voiceCallReport=require(_0xfbc3('0xb'));var trunk=require('./rpc/trunk');var trigger=require('./rpc/trigger');var template=require('./rpc/template');var cmHopperHistory=require(_0xfbc3('0xc'));var campaign=require(_0xfbc3('0xd'));var voiceExtension=require(_0xfbc3('0xe'));var faxAccount=require(_0xfbc3('0xf'));var zendesk=require(_0xfbc3('0x10'));var salesforce=require(_0xfbc3('0x11'));var sugarcrm=require(_0xfbc3('0x12'));var freshdesk=require(_0xfbc3('0x13'));var desk=require(_0xfbc3('0x14'));var zoho=require('./rpc/integrations/zoho');var vtiger=require('./rpc/integrations/vtiger');var freshsales=require(_0xfbc3('0x15'));var servicenow=require(_0xfbc3('0x16'));var dynamics365=require(_0xfbc3('0x17'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xfbc3('0x18')](_0xfbc3('0x19'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0xfbc3('0x19'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xfbc3('0x1a')]()[_0xfbc3('0x1b')](user[_0xfbc3('0x1c')]())[_0xfbc3('0x1b')](realtime['initAgents']())['then'](user[_0xfbc3('0x1d')]())[_0xfbc3('0x1b')](realtime['initTelephones']())[_0xfbc3('0x1b')](trunk[_0xfbc3('0x1e')]())[_0xfbc3('0x1b')](realtime[_0xfbc3('0x1f')]())[_0xfbc3('0x1b')](voiceQueue['getVoiceQueues']())['then'](realtime[_0xfbc3('0x20')]())[_0xfbc3('0x1b')](trigger['getTriggers']())['then'](realtime['initTriggers']())[_0xfbc3('0x1b')](template[_0xfbc3('0x21')]())[_0xfbc3('0x1b')](realtime[_0xfbc3('0x22')]())[_0xfbc3('0x1b')](zendesk['getZendeskAccounts']())[_0xfbc3('0x1b')](realtime[_0xfbc3('0x23')]())[_0xfbc3('0x1b')](salesforce['getSalesforceAccounts']())[_0xfbc3('0x1b')](realtime['initSalesforceAccounts']())[_0xfbc3('0x1b')](sugarcrm[_0xfbc3('0x24')]())[_0xfbc3('0x1b')](realtime[_0xfbc3('0x25')]())[_0xfbc3('0x1b')](freshdesk[_0xfbc3('0x26')]())['then'](realtime[_0xfbc3('0x27')]())[_0xfbc3('0x1b')](desk[_0xfbc3('0x28')]())[_0xfbc3('0x1b')](realtime[_0xfbc3('0x29')]())['then'](zoho[_0xfbc3('0x2a')]())[_0xfbc3('0x1b')](realtime[_0xfbc3('0x2b')]())['then'](vtiger[_0xfbc3('0x2c')]())[_0xfbc3('0x1b')](realtime[_0xfbc3('0x2d')]())['then'](freshsales[_0xfbc3('0x2e')]())[_0xfbc3('0x1b')](realtime[_0xfbc3('0x2f')]())[_0xfbc3('0x1b')](servicenow[_0xfbc3('0x30')]())[_0xfbc3('0x1b')](realtime[_0xfbc3('0x31')]())[_0xfbc3('0x1b')](dynamics365[_0xfbc3('0x32')]())[_0xfbc3('0x1b')](realtime[_0xfbc3('0x33')]())['then'](campaign[_0xfbc3('0x34')]())[_0xfbc3('0x1b')](realtime[_0xfbc3('0x35')]())[_0xfbc3('0x1b')](voiceExtension[_0xfbc3('0x36')]())[_0xfbc3('0x1b')](realtime[_0xfbc3('0x37')]())[_0xfbc3('0x1b')](faxAccount[_0xfbc3('0x38')]())[_0xfbc3('0x1b')](realtime[_0xfbc3('0x39')]())[_0xfbc3('0x1b')](function(){return realtime;});}function initParams(){return BPromise[_0xfbc3('0x1a')]()['then'](voiceQueueReport['getVoiceQueueReports']())[_0xfbc3('0x1b')](realtime[_0xfbc3('0x3a')]())[_0xfbc3('0x1b')](cmHopperHistory[_0xfbc3('0x3b')]())[_0xfbc3('0x1b')](realtime['initVoiceQueueHopperHistory']())['then'](cmHopperHistory[_0xfbc3('0x3c')]())[_0xfbc3('0x1b')](realtime['initCampaignHopperHistory']())[_0xfbc3('0x1b')](voiceCallReport[_0xfbc3('0x3d')]())[_0xfbc3('0x1b')](realtime['initVoiceCallReports']())[_0xfbc3('0x1b')](function(_0x286b8e){})[_0xfbc3('0x3e')](function(_0x21c2d2){console[_0xfbc3('0x3f')](_0x21c2d2);});}function main(){return server[_0xfbc3('0x40')](realtime,preview,fax)[_0xfbc3('0x1b')](function(_0x2a79fd){return initRealtime();})[_0xfbc3('0x1b')](function(){return initParams();})[_0xfbc3('0x1b')](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0xfbc3('0x3e')](function(_0xf93eb0){console[_0xfbc3('0x3f')](_0xf93eb0);});}main(); \ No newline at end of file +var _0x1995=['./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','get','hour','resolve','then','initAgents','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTemplates','getZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','log','listen','sync','bluebird','moment','./server','./realtime','./report','./acw','./preview','./fax','./rpc/user','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/sugarcrm','./rpc/integrations/desk'];(function(_0x27f284,_0x24ae1b){var _0x329c37=function(_0x3076d8){while(--_0x3076d8){_0x27f284['push'](_0x27f284['shift']());}};_0x329c37(++_0x24ae1b);}(_0x1995,0xf8));var _0x5199=function(_0xd6c3b,_0x2ea546){_0xd6c3b=_0xd6c3b-0x0;var _0x2bfacf=_0x1995[_0xd6c3b];return _0x2bfacf;};'use strict';var BPromise=require(_0x5199('0x0'));var util=require('util');var moment=require(_0x5199('0x1'));var server=require(_0x5199('0x2'));var Realtime=require(_0x5199('0x3'));var Report=require(_0x5199('0x4'));var Acw=require(_0x5199('0x5'));var Trigger=require('./trigger');var Dialer=require('./dialer');var Preview=require(_0x5199('0x6'));var Fax=require(_0x5199('0x7'));var user=require(_0x5199('0x8'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0x5199('0x9'));var voiceCallReport=require(_0x5199('0xa'));var trunk=require(_0x5199('0xb'));var trigger=require('./rpc/trigger');var template=require(_0x5199('0xc'));var cmHopperHistory=require(_0x5199('0xd'));var campaign=require(_0x5199('0xe'));var voiceExtension=require(_0x5199('0xf'));var faxAccount=require(_0x5199('0x10'));var zendesk=require(_0x5199('0x11'));var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0x5199('0x12'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0x5199('0x13'));var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0x5199('0x14'));var freshsales=require(_0x5199('0x15'));var servicenow=require(_0x5199('0x16'));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 isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x5199('0x17')](_0x5199('0x18'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x5199('0x17')](_0x5199('0x18'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x5199('0x19')]()['then'](user['getAgents']())[_0x5199('0x1a')](realtime[_0x5199('0x1b')]())['then'](user['getTelephones']())[_0x5199('0x1a')](realtime['initTelephones']())[_0x5199('0x1a')](trunk[_0x5199('0x1c')]())['then'](realtime[_0x5199('0x1d')]())[_0x5199('0x1a')](voiceQueue[_0x5199('0x1e')]())[_0x5199('0x1a')](realtime[_0x5199('0x1f')]())[_0x5199('0x1a')](trigger[_0x5199('0x20')]())[_0x5199('0x1a')](realtime['initTriggers']())[_0x5199('0x1a')](template['getTemplates']())[_0x5199('0x1a')](realtime[_0x5199('0x21')]())[_0x5199('0x1a')](zendesk[_0x5199('0x22')]())['then'](realtime['initZendeskAccounts']())[_0x5199('0x1a')](salesforce[_0x5199('0x23')]())['then'](realtime[_0x5199('0x24')]())['then'](sugarcrm[_0x5199('0x25')]())['then'](realtime[_0x5199('0x26')]())[_0x5199('0x1a')](freshdesk[_0x5199('0x27')]())[_0x5199('0x1a')](realtime[_0x5199('0x28')]())[_0x5199('0x1a')](desk['getDeskAccounts']())[_0x5199('0x1a')](realtime[_0x5199('0x29')]())[_0x5199('0x1a')](zoho[_0x5199('0x2a')]())['then'](realtime[_0x5199('0x2b')]())[_0x5199('0x1a')](vtiger[_0x5199('0x2c')]())['then'](realtime[_0x5199('0x2d')]())[_0x5199('0x1a')](freshsales['getFreshsalesAccounts']())['then'](realtime[_0x5199('0x2e')]())[_0x5199('0x1a')](servicenow[_0x5199('0x2f')]())[_0x5199('0x1a')](realtime[_0x5199('0x30')]())['then'](dynamics365['getDynamics365Accounts']())[_0x5199('0x1a')](realtime[_0x5199('0x31')]())[_0x5199('0x1a')](campaign[_0x5199('0x32')]())[_0x5199('0x1a')](realtime[_0x5199('0x33')]())[_0x5199('0x1a')](voiceExtension[_0x5199('0x34')]())[_0x5199('0x1a')](realtime[_0x5199('0x35')]())[_0x5199('0x1a')](faxAccount[_0x5199('0x36')]())['then'](realtime[_0x5199('0x37')]())[_0x5199('0x1a')](function(){return realtime;});}function initParams(){return BPromise['resolve']()[_0x5199('0x1a')](voiceQueueReport[_0x5199('0x38')]())[_0x5199('0x1a')](realtime[_0x5199('0x39')]())[_0x5199('0x1a')](cmHopperHistory[_0x5199('0x3a')]())[_0x5199('0x1a')](realtime['initVoiceQueueHopperHistory']())[_0x5199('0x1a')](cmHopperHistory[_0x5199('0x3b')]())[_0x5199('0x1a')](realtime[_0x5199('0x3c')]())['then'](voiceCallReport[_0x5199('0x3d')]())[_0x5199('0x1a')](realtime[_0x5199('0x3e')]())[_0x5199('0x1a')](function(_0x15313e){})[_0x5199('0x3f')](function(_0x235b33){console[_0x5199('0x40')](_0x235b33);});}function main(){return server[_0x5199('0x41')](realtime,preview,fax)[_0x5199('0x1a')](function(_0x376746){return initRealtime();})[_0x5199('0x1a')](function(){return initParams();})[_0x5199('0x1a')](function(){report[_0x5199('0x42')]();setInterval(initRealtime,0x1388);})[_0x5199('0x3f')](function(_0x4d41c2){console[_0x5199('0x40')](_0x4d41c2);});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index a651356..3b9575b 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 _0x70e0=['name','voiceStatusQueue','onhold','stringify','md5','user:%s','user:save','emit','user:presence','lodash','util','moment','../../../config/environment','redis','defaults','socket.io-emitter','email','accountcode','fullname','state','unknown','address','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','local','toLowerCase','not_inuse','idle','inuse','statePause','toNumber','format'];(function(_0x361255,_0x163f26){var _0x3614ce=function(_0x28b26a){while(--_0x28b26a){_0x361255['push'](_0x361255['shift']());}};_0x3614ce(++_0x163f26);}(_0x70e0,0x17b));var _0x070e=function(_0x37b904,_0x595e7c){_0x37b904=_0x37b904-0x0;var _0x527a15=_0x70e0[_0x37b904];return _0x527a15;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x070e('0x3'));config[_0x070e('0x4')]=_[_0x070e('0x5')](config[_0x070e('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x070e('0x6'))(new Redis(config['redis']));function Agent(_0x46fe68){this['id']=_0x46fe68['id']||0x0;this['name']=_0x46fe68['name']||'';this['email']=_0x46fe68[_0x070e('0x7')]||'';this[_0x070e('0x8')]=_0x46fe68[_0x070e('0x8')]||'';this[_0x070e('0x9')]=_0x46fe68[_0x070e('0x9')]||'';this[_0x070e('0xa')]=_0x070e('0xb');this['stateTime']=0x0;this['status']=_0x070e('0xb');this[_0x070e('0xc')]='';this[_0x070e('0xd')]='';this[_0x070e('0xe')]='';this[_0x070e('0xf')]='';this[_0x070e('0x10')]=_0x46fe68[_0x070e('0x10')]||![];this[_0x070e('0x11')]=_0x070e('0xb');this[_0x070e('0x12')]=0x0;this[_0x070e('0x13')]='';this['voiceStatusQueue']='';this['onhold']=![];this[_0x070e('0x14')]=![];this['md5']='';}Agent['prototype']['updateStatusRealtime']=function(_0x11d2ce){var _0x14c3fd;if(_0x11d2ce&&_0x11d2ce['state']){_0x14c3fd=_0x11d2ce['state'][_0x070e('0x15')]();switch(_0x14c3fd){case _0x070e('0x16'):_0x14c3fd=_0x070e('0x17');break;case _0x070e('0x18'):_0x14c3fd='talking';break;}}if(_0x14c3fd&&this['voiceStatus']!==_0x14c3fd||_0x11d2ce[_0x070e('0x19')]){this[_0x070e('0x12')]=_[_0x070e('0x1a')](moment()[_0x070e('0x1b')]('x'));}if(_0x14c3fd){this[_0x070e('0x11')]=_0x14c3fd;}var _0x5037eb={'id':this['id'],'name':this[_0x070e('0x1c')],'email':this[_0x070e('0x7')],'accountcode':this[_0x070e('0x8')],'fullname':this[_0x070e('0x9')],'state':this[_0x070e('0xa')],'stateTime':this['stateTime'],'status':this['status'],'address':this['address'],'online':this[_0x070e('0x10')],'voiceStatus':this[_0x070e('0x11')],'voiceStatusTime':this[_0x070e('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x070e('0x1d')],'interface':this['interface'],'onhold':this[_0x070e('0x1e')]};var _0x3f6985=md5(JSON[_0x070e('0x1f')](_0x5037eb));if(this[_0x070e('0x20')]!==_0x3f6985){this[_0x070e('0x20')]=_0x3f6985;io['to'](util[_0x070e('0x1b')](_0x070e('0x21'),_0x5037eb[_0x070e('0x1c')]))['emit'](_0x070e('0x22'),_0x5037eb);io[_0x070e('0x23')](_0x070e('0x24'),_0x5037eb);}};module['exports']=Agent; \ No newline at end of file +var _0x34e8=['interface','online','voiceStatusTime','voiceStatusQueue','onhold','local','updateStatusRealtime','toLowerCase','not_inuse','inuse','talking','voiceStatus','toNumber','format','voiceStatusCallerIdNumber','stringify','user:%s','emit','user:save','exports','lodash','util','moment','md5','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','status','address','phone','mobile'];(function(_0x57112b,_0x45b6d6){var _0x7546f9=function(_0x324ca6){while(--_0x324ca6){_0x57112b['push'](_0x57112b['shift']());}};_0x7546f9(++_0x45b6d6);}(_0x34e8,0x12c));var _0x834e=function(_0x2789bd,_0x5de5ca){_0x2789bd=_0x2789bd-0x0;var _0xb762c2=_0x34e8[_0x2789bd];return _0xb762c2;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var moment=require(_0x834e('0x2'));var md5=require(_0x834e('0x3'));var Redis=require('ioredis');var config=require(_0x834e('0x4'));config[_0x834e('0x5')]=_[_0x834e('0x6')](config[_0x834e('0x5')],{'host':_0x834e('0x7'),'port':0x18eb});var io=require(_0x834e('0x8'))(new Redis(config[_0x834e('0x5')]));function Agent(_0x4a2018){this['id']=_0x4a2018['id']||0x0;this[_0x834e('0x9')]=_0x4a2018['name']||'';this[_0x834e('0xa')]=_0x4a2018[_0x834e('0xa')]||'';this[_0x834e('0xb')]=_0x4a2018[_0x834e('0xb')]||'';this[_0x834e('0xc')]=_0x4a2018[_0x834e('0xc')]||'';this[_0x834e('0xd')]=_0x834e('0xe');this[_0x834e('0xf')]=0x0;this[_0x834e('0x10')]=_0x834e('0xe');this[_0x834e('0x11')]='';this[_0x834e('0x12')]='';this[_0x834e('0x13')]='';this[_0x834e('0x14')]='';this[_0x834e('0x15')]=_0x4a2018[_0x834e('0x15')]||![];this['voiceStatus']=_0x834e('0xe');this[_0x834e('0x16')]=0x0;this['voiceStatusCallerIdNumber']='';this[_0x834e('0x17')]='';this[_0x834e('0x18')]=![];this[_0x834e('0x19')]=![];this[_0x834e('0x3')]='';}Agent['prototype'][_0x834e('0x1a')]=function(_0x302cbd){var _0x57274a;if(_0x302cbd&&_0x302cbd[_0x834e('0xd')]){_0x57274a=_0x302cbd['state'][_0x834e('0x1b')]();switch(_0x57274a){case _0x834e('0x1c'):_0x57274a='idle';break;case _0x834e('0x1d'):_0x57274a=_0x834e('0x1e');break;}}if(_0x57274a&&this[_0x834e('0x1f')]!==_0x57274a||_0x302cbd['statePause']){this[_0x834e('0x16')]=_[_0x834e('0x20')](moment()[_0x834e('0x21')]('x'));}if(_0x57274a){this[_0x834e('0x1f')]=_0x57274a;}var _0x237947={'id':this['id'],'name':this[_0x834e('0x9')],'email':this[_0x834e('0xa')],'accountcode':this['accountcode'],'fullname':this[_0x834e('0xc')],'state':this[_0x834e('0xd')],'stateTime':this[_0x834e('0xf')],'status':this[_0x834e('0x10')],'address':this['address'],'online':this[_0x834e('0x15')],'voiceStatus':this[_0x834e('0x1f')],'voiceStatusTime':this['voiceStatusTime'],'voiceStatusCallerIdNumber':this[_0x834e('0x22')],'voiceStatusQueue':this[_0x834e('0x17')],'interface':this[_0x834e('0x14')],'onhold':this['onhold']};var _0x4e3f48=md5(JSON[_0x834e('0x23')](_0x237947));if(this[_0x834e('0x3')]!==_0x4e3f48){this['md5']=_0x4e3f48;io['to'](util[_0x834e('0x21')](_0x834e('0x24'),_0x237947['name']))[_0x834e('0x25')](_0x834e('0x26'),_0x237947);io[_0x834e('0x25')]('user:presence',_0x237947);}};module[_0x834e('0x27')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 58413a4..4dff191 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 _0x55a4=['ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialOrderByScheduledAt','dialPrefix','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp'];(function(_0x39ddc8,_0x52f361){var _0x980fbe=function(_0x242bd0){while(--_0x242bd0){_0x39ddc8['push'](_0x39ddc8['shift']());}};_0x980fbe(++_0x52f361);}(_0x55a4,0x1b4));var _0x455a=function(_0x199746,_0x49867b){_0x199746=_0x199746-0x0;var _0x23b01e=_0x55a4[_0x199746];return _0x23b01e;};'use strict';function Campaign(_0x2e9819){this['id']=_0x2e9819['id']||0x0;this[_0x455a('0x0')]=_0x2e9819[_0x455a('0x0')]||'';this[_0x455a('0x1')]=_0x2e9819['type']||_0x455a('0x2');this[_0x455a('0x3')]=0x0;this[_0x455a('0x4')]=0x0;this[_0x455a('0x5')]=0x0;this[_0x455a('0x6')]=0x0;this[_0x455a('0x7')]='';this[_0x455a('0x8')]=!![];this[_0x455a('0x9')]=_0x2e9819[_0x455a('0x9')];this[_0x455a('0xa')]=_0x2e9819[_0x455a('0xa')];this['dialTimezone']=_0x2e9819[_0x455a('0xb')]||null;this[_0x455a('0xc')]=_0x2e9819[_0x455a('0xc')]?_0x2e9819[_0x455a('0xc')]:null;this[_0x455a('0xd')]=_0x2e9819['dialOriginateCallerIdName'];this['dialOriginateCallerIdNumber']=_0x2e9819['dialOriginateCallerIdNumber'];this[_0x455a('0xe')]=_0x2e9819[_0x455a('0xe')]||0x1e;this[_0x455a('0xf')]=_0x2e9819[_0x455a('0xf')];this[_0x455a('0x10')]=_0x2e9819[_0x455a('0x10')];this[_0x455a('0x11')]=_0x2e9819[_0x455a('0x11')];this[_0x455a('0x12')]=_0x2e9819[_0x455a('0x12')];this['dialNoAnswerMaxRetry']=_0x2e9819['dialNoAnswerMaxRetry'];this[_0x455a('0x13')]=_0x2e9819[_0x455a('0x13')];this['dialGlobalMaxRetry']=_0x2e9819[_0x455a('0x14')];this['dialNoSuchNumberMaxRetry']=_0x2e9819[_0x455a('0x15')]||0x3;this[_0x455a('0x16')]=_0x2e9819[_0x455a('0x16')]||0x96;this[_0x455a('0x17')]=_0x2e9819[_0x455a('0x17')]||0x3;this[_0x455a('0x18')]=_0x2e9819[_0x455a('0x18')]||0x96;this[_0x455a('0x19')]=_0x2e9819[_0x455a('0x19')]||0x3;this[_0x455a('0x1a')]=_0x2e9819[_0x455a('0x1a')]||0x96;this[_0x455a('0x1b')]=_0x2e9819['dialMachineMaxRetry']||0x3;this[_0x455a('0x1c')]=_0x2e9819[_0x455a('0x1c')]||0x96;this['dialAgentRejectMaxRetry']=_0x2e9819[_0x455a('0x1d')]||0x3;this['dialAgentRejectRetryFrequency']=_0x2e9819['dialAgentRejectRetryFrequency']||0x96;this['dialOrderByScheduledAt']=_0x2e9819[_0x455a('0x1e')]||'DESC';this[_0x455a('0x1f')]=_0x2e9819[_0x455a('0x1f')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x2e9819['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x455a('0x20')]=_0x2e9819['dialCutDigit']||undefined;this[_0x455a('0x21')]=_0x2e9819[_0x455a('0x21')]?_0x2e9819[_0x455a('0x21')]:undefined;this[_0x455a('0x22')]=_0x2e9819[_0x455a('0x22')]?_0x2e9819[_0x455a('0x22')]:undefined;this[_0x455a('0x23')]=_0x2e9819[_0x455a('0x23')]?_0x2e9819[_0x455a('0x23')]:undefined;this[_0x455a('0x24')]=_0x2e9819[_0x455a('0x24')]?_0x2e9819['SquareProject']:undefined;this[_0x455a('0x25')]=_0x2e9819[_0x455a('0x24')]?_0x2e9819[_0x455a('0x24')][_0x455a('0x0')]:undefined;this[_0x455a('0x26')]=_0x2e9819[_0x455a('0x26')]||![];this['dialAMDInitialSilence']=_0x2e9819[_0x455a('0x27')];this[_0x455a('0x28')]=_0x2e9819['dialAMDGreeting'];this[_0x455a('0x29')]=_0x2e9819[_0x455a('0x29')];this[_0x455a('0x2a')]=_0x2e9819[_0x455a('0x2a')];this[_0x455a('0x2b')]=_0x2e9819['dialAMDMinWordLength'];this[_0x455a('0x2c')]=_0x2e9819['dialAMDBetweenWordsSilence'];this[_0x455a('0x2d')]=_0x2e9819[_0x455a('0x2d')];this[_0x455a('0x2e')]=_0x2e9819[_0x455a('0x2e')];this[_0x455a('0x2f')]=_0x2e9819[_0x455a('0x2f')];}module[_0x455a('0x30')]=Campaign; \ No newline at end of file +var _0xf1b6=['dialTimezone','dialGlobalInterval','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','type','originated','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls'];(function(_0x40634a,_0xfe9420){var _0x3a3e81=function(_0x102440){while(--_0x102440){_0x40634a['push'](_0x40634a['shift']());}};_0x3a3e81(++_0xfe9420);}(_0xf1b6,0x16f));var _0x6f1b=function(_0x8e2b56,_0x425cd3){_0x8e2b56=_0x8e2b56-0x0;var _0x2cfa5b=_0xf1b6[_0x8e2b56];return _0x2cfa5b;};'use strict';function Campaign(_0x14ac4c){this['id']=_0x14ac4c['id']||0x0;this[_0x6f1b('0x0')]=_0x14ac4c['name']||'';this['type']=_0x14ac4c[_0x6f1b('0x1')]||'campaign';this[_0x6f1b('0x2')]=0x0;this['temp']=0x0;this[_0x6f1b('0x3')]=0x0;this[_0x6f1b('0x4')]=0x0;this[_0x6f1b('0x5')]='';this[_0x6f1b('0x6')]=!![];this['active']=_0x14ac4c[_0x6f1b('0x7')];this[_0x6f1b('0x8')]=_0x14ac4c[_0x6f1b('0x8')];this[_0x6f1b('0x9')]=_0x14ac4c[_0x6f1b('0x9')]||null;this[_0x6f1b('0xa')]=_0x14ac4c['dialGlobalInterval']?_0x14ac4c[_0x6f1b('0xa')]:null;this['dialOriginateCallerIdName']=_0x14ac4c['dialOriginateCallerIdName'];this[_0x6f1b('0xb')]=_0x14ac4c[_0x6f1b('0xb')];this[_0x6f1b('0xc')]=_0x14ac4c[_0x6f1b('0xc')]||0x1e;this[_0x6f1b('0xd')]=_0x14ac4c[_0x6f1b('0xd')];this[_0x6f1b('0xe')]=_0x14ac4c[_0x6f1b('0xe')];this[_0x6f1b('0xf')]=_0x14ac4c[_0x6f1b('0xf')];this[_0x6f1b('0x10')]=_0x14ac4c[_0x6f1b('0x10')];this['dialNoAnswerMaxRetry']=_0x14ac4c['dialNoAnswerMaxRetry'];this[_0x6f1b('0x11')]=_0x14ac4c[_0x6f1b('0x11')];this['dialGlobalMaxRetry']=_0x14ac4c[_0x6f1b('0x12')];this[_0x6f1b('0x13')]=_0x14ac4c[_0x6f1b('0x13')]||0x3;this[_0x6f1b('0x14')]=_0x14ac4c[_0x6f1b('0x14')]||0x96;this[_0x6f1b('0x15')]=_0x14ac4c[_0x6f1b('0x15')]||0x3;this[_0x6f1b('0x16')]=_0x14ac4c[_0x6f1b('0x16')]||0x96;this[_0x6f1b('0x17')]=_0x14ac4c['dialAbandonedMaxRetry']||0x3;this[_0x6f1b('0x18')]=_0x14ac4c[_0x6f1b('0x18')]||0x96;this['dialMachineMaxRetry']=_0x14ac4c['dialMachineMaxRetry']||0x3;this[_0x6f1b('0x19')]=_0x14ac4c[_0x6f1b('0x19')]||0x96;this['dialAgentRejectMaxRetry']=_0x14ac4c['dialAgentRejectMaxRetry']||0x3;this[_0x6f1b('0x1a')]=_0x14ac4c[_0x6f1b('0x1a')]||0x96;this[_0x6f1b('0x1b')]=_0x14ac4c[_0x6f1b('0x1b')]||_0x6f1b('0x1c');this[_0x6f1b('0x1d')]=_0x14ac4c['dialPrefix']||undefined;this[_0x6f1b('0x1e')]=_0x14ac4c[_0x6f1b('0x1e')]||undefined;this[_0x6f1b('0x1f')]=_0x14ac4c[_0x6f1b('0x1f')]||undefined;this[_0x6f1b('0x20')]=_0x14ac4c[_0x6f1b('0x20')]?_0x14ac4c[_0x6f1b('0x20')]:undefined;this[_0x6f1b('0x21')]=_0x14ac4c[_0x6f1b('0x21')]?_0x14ac4c[_0x6f1b('0x21')]:undefined;this[_0x6f1b('0x22')]=_0x14ac4c[_0x6f1b('0x22')]?_0x14ac4c[_0x6f1b('0x22')]:undefined;this[_0x6f1b('0x23')]=_0x14ac4c['SquareProject']?_0x14ac4c[_0x6f1b('0x23')]:undefined;this[_0x6f1b('0x24')]=_0x14ac4c['SquareProject']?_0x14ac4c[_0x6f1b('0x23')][_0x6f1b('0x0')]:undefined;this[_0x6f1b('0x25')]=_0x14ac4c['dialAMDActive']||![];this[_0x6f1b('0x26')]=_0x14ac4c['dialAMDInitialSilence'];this[_0x6f1b('0x27')]=_0x14ac4c['dialAMDGreeting'];this['dialAMDAfterGreetingSilence']=_0x14ac4c[_0x6f1b('0x28')];this[_0x6f1b('0x29')]=_0x14ac4c[_0x6f1b('0x29')];this['dialAMDMinWordLength']=_0x14ac4c[_0x6f1b('0x2a')];this['dialAMDBetweenWordsSilence']=_0x14ac4c[_0x6f1b('0x2b')];this['dialAMDMaximumNumberOfWords']=_0x14ac4c[_0x6f1b('0x2c')];this[_0x6f1b('0x2d')]=_0x14ac4c[_0x6f1b('0x2d')];this[_0x6f1b('0x2e')]=_0x14ac4c['dialAMDMaximumWordLength'];}module['exports']=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 39bf1c5..5141a97 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 _0xa693=['exports','starttime','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','uniqueid','linkedid','exten','answered','answertime','endtime','unmanaged','lastapplication','lastdata','type','disposition','monitor','monitorFilename','queue','monitors','transferconnectedlinenum','transferType'];(function(_0x42d58c,_0x1a757a){var _0x3c3ce5=function(_0x195595){while(--_0x195595){_0x42d58c['push'](_0x42d58c['shift']());}};_0x3c3ce5(++_0x1a757a);}(_0xa693,0xf1));var _0x3a69=function(_0x4849f6,_0x104836){_0x4849f6=_0x4849f6-0x0;var _0x1a3dcd=_0xa693[_0x4849f6];return _0x1a3dcd;};'use strict';function Channel(){this[_0x3a69('0x0')]=null;this[_0x3a69('0x1')]='';this[_0x3a69('0x2')]='';this[_0x3a69('0x3')]=0x0;this[_0x3a69('0x4')]='';this[_0x3a69('0x5')]=undefined;this['connectedlinename']=undefined;this['accountcode']=0x0;this['context']='';this[_0x3a69('0x6')]=0x0;this[_0x3a69('0x7')]=0x0;this[_0x3a69('0x8')]=0x0;this[_0x3a69('0x9')]=![];this[_0x3a69('0xa')]=null;this[_0x3a69('0xb')]=null;this[_0x3a69('0xc')]=![];this['abandoned']=![];this[_0x3a69('0xd')]='';this[_0x3a69('0xe')]='';this['duration']=0x0;this['billableseconds']=0x0;this['holdtime']=0x0;this[_0x3a69('0xf')]=null;this['tag']=null;this[_0x3a69('0x10')]=null;this[_0x3a69('0x11')]=![];this[_0x3a69('0x12')]=null;this[_0x3a69('0x13')]=null;this[_0x3a69('0x14')]=[];this['transfercalleridnum']=undefined;this[_0x3a69('0x15')]=undefined;this[_0x3a69('0x16')]=undefined;this['mohtime']=0x0;}module[_0x3a69('0x17')]=Channel; \ No newline at end of file +var _0xfae3=['abandoned','lastapplication','duration','billableseconds','holdtime','type','tag','disposition','monitor','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','transferType','exports','starttime','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','context','uniqueid','linkedid','answered','answertime'];(function(_0x288fe2,_0x443ea2){var _0x1bfdb9=function(_0x14d19d){while(--_0x14d19d){_0x288fe2['push'](_0x288fe2['shift']());}};_0x1bfdb9(++_0x443ea2);}(_0xfae3,0xa1));var _0x3fae=function(_0x3f3ad8,_0x4bc014){_0x3f3ad8=_0x3f3ad8-0x0;var _0x3a2667=_0xfae3[_0x3f3ad8];return _0x3a2667;};'use strict';function Channel(){this[_0x3fae('0x0')]=null;this[_0x3fae('0x1')]='';this[_0x3fae('0x2')]='';this[_0x3fae('0x3')]=0x0;this[_0x3fae('0x4')]='';this[_0x3fae('0x5')]=undefined;this[_0x3fae('0x6')]=undefined;this[_0x3fae('0x7')]=0x0;this[_0x3fae('0x8')]='';this[_0x3fae('0x9')]=0x0;this[_0x3fae('0xa')]=0x0;this['exten']=0x0;this[_0x3fae('0xb')]=![];this[_0x3fae('0xc')]=null;this['endtime']=null;this['unmanaged']=![];this[_0x3fae('0xd')]=![];this[_0x3fae('0xe')]='';this['lastdata']='';this[_0x3fae('0xf')]=0x0;this[_0x3fae('0x10')]=0x0;this[_0x3fae('0x11')]=0x0;this[_0x3fae('0x12')]=null;this[_0x3fae('0x13')]=null;this[_0x3fae('0x14')]=null;this[_0x3fae('0x15')]=![];this[_0x3fae('0x16')]=null;this[_0x3fae('0x17')]=null;this[_0x3fae('0x18')]=[];this[_0x3fae('0x19')]=undefined;this[_0x3fae('0x1a')]=undefined;this[_0x3fae('0x1b')]=undefined;this['mohtime']=0x0;}module[_0x3fae('0x1c')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 7952b1c..a37dd68 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 _0xb061=['password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','authType'];(function(_0x31cc0c,_0x4f2c63){var _0x18b553=function(_0x40d2e2){while(--_0x40d2e2){_0x31cc0c['push'](_0x31cc0c['shift']());}};_0x18b553(++_0x4f2c63);}(_0xb061,0xbf));var _0x1b06=function(_0x100dea,_0x2ca828){_0x100dea=_0x100dea-0x0;var _0x785cb5=_0xb061[_0x100dea];return _0x785cb5;};'use strict';function DeskAccount(_0x449deb){this['id']=_0x449deb['id']||0x0;this[_0x1b06('0x0')]=_0x449deb[_0x1b06('0x0')]||'';this['username']=_0x449deb[_0x1b06('0x1')]||'';this[_0x1b06('0x2')]=_0x449deb['remoteUri']||'';this['authType']=_0x449deb[_0x1b06('0x3')]||'';this[_0x1b06('0x4')]=_0x449deb[_0x1b06('0x4')]||'';this[_0x1b06('0x5')]=_0x449deb[_0x1b06('0x5')]||'';this[_0x1b06('0x6')]=_0x449deb[_0x1b06('0x6')]||'';this[_0x1b06('0x7')]=_0x449deb[_0x1b06('0x7')]||'';this['tokenSecret']=_0x449deb[_0x1b06('0x8')]||'';this[_0x1b06('0x9')]=_0x449deb['type']||'';this[_0x1b06('0xa')]=_0x449deb[_0x1b06('0xa')]||'';this['Configurations']=_0x449deb[_0x1b06('0xb')]||{};}module[_0x1b06('0xc')]=DeskAccount; \ No newline at end of file +var _0xabc4=['consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','remoteUri','authType','password','consumerKey'];(function(_0x1a284c,_0x4579fd){var _0x40e1f4=function(_0x432053){while(--_0x432053){_0x1a284c['push'](_0x1a284c['shift']());}};_0x40e1f4(++_0x4579fd);}(_0xabc4,0x157));var _0x4abc=function(_0x408d22,_0x53eef9){_0x408d22=_0x408d22-0x0;var _0x58effd=_0xabc4[_0x408d22];return _0x58effd;};'use strict';function DeskAccount(_0x5061b9){this['id']=_0x5061b9['id']||0x0;this[_0x4abc('0x0')]=_0x5061b9[_0x4abc('0x0')]||'';this['username']=_0x5061b9['username']||'';this[_0x4abc('0x1')]=_0x5061b9['remoteUri']||'';this[_0x4abc('0x2')]=_0x5061b9[_0x4abc('0x2')]||'';this[_0x4abc('0x3')]=_0x5061b9[_0x4abc('0x3')]||'';this[_0x4abc('0x4')]=_0x5061b9[_0x4abc('0x4')]||'';this[_0x4abc('0x5')]=_0x5061b9[_0x4abc('0x5')]||'';this['token']=_0x5061b9[_0x4abc('0x6')]||'';this[_0x4abc('0x7')]=_0x5061b9[_0x4abc('0x7')]||'';this[_0x4abc('0x8')]=_0x5061b9['type']||'';this[_0x4abc('0x9')]=_0x5061b9[_0x4abc('0x9')]||'';this[_0x4abc('0xa')]=_0x5061b9[_0x4abc('0xa')]||{};}module[_0x4abc('0xb')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index ce8a7b0..528104b 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 _0xa74f=['name','password','remoteUri','tenantId','clientSecret','serverUrl','Configurations'];(function(_0x23e6bb,_0x5c2d69){var _0x1e3b4c=function(_0x1afc46){while(--_0x1afc46){_0x23e6bb['push'](_0x23e6bb['shift']());}};_0x1e3b4c(++_0x5c2d69);}(_0xa74f,0x9a));var _0xfa74=function(_0xd0b415,_0x149675){_0xd0b415=_0xd0b415-0x0;var _0x2bdf2c=_0xa74f[_0xd0b415];return _0x2bdf2c;};'use strict';function Dynamics365Account(_0x4607a1){this['id']=_0x4607a1['id']||0x0;this['name']=_0x4607a1[_0xfa74('0x0')]||'';this['username']=_0x4607a1['username']||'';this[_0xfa74('0x1')]=_0x4607a1[_0xfa74('0x1')]||'';this[_0xfa74('0x2')]=_0x4607a1[_0xfa74('0x2')]||'';this['tenantId']=_0x4607a1[_0xfa74('0x3')]||'';this['clientId']=_0x4607a1['clientId']||'';this[_0xfa74('0x4')]=_0x4607a1[_0xfa74('0x4')]||{};this[_0xfa74('0x5')]=_0x4607a1[_0xfa74('0x5')]||'';this[_0xfa74('0x6')]=_0x4607a1[_0xfa74('0x6')]||{};}module['exports']=Dynamics365Account; \ No newline at end of file +var _0xb4e6=['tenantId','clientId','clientSecret','Configurations','name','username','password','remoteUri'];(function(_0x5c0134,_0xf71427){var _0x4be023=function(_0x5a6be7){while(--_0x5a6be7){_0x5c0134['push'](_0x5c0134['shift']());}};_0x4be023(++_0xf71427);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x590851,_0x496bee){_0x590851=_0x590851-0x0;var _0x3b0115=_0xb4e6[_0x590851];return _0x3b0115;};'use strict';function Dynamics365Account(_0x54acd0){this['id']=_0x54acd0['id']||0x0;this['name']=_0x54acd0[_0x6b4e('0x0')]||'';this[_0x6b4e('0x1')]=_0x54acd0[_0x6b4e('0x1')]||'';this[_0x6b4e('0x2')]=_0x54acd0[_0x6b4e('0x2')]||'';this[_0x6b4e('0x3')]=_0x54acd0[_0x6b4e('0x3')]||'';this['tenantId']=_0x54acd0[_0x6b4e('0x4')]||'';this[_0x6b4e('0x5')]=_0x54acd0[_0x6b4e('0x5')]||'';this['clientSecret']=_0x54acd0[_0x6b4e('0x6')]||{};this['serverUrl']=_0x54acd0['serverUrl']||'';this[_0x6b4e('0x7')]=_0x54acd0['Configurations']||{};}module['exports']=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index d45554e..e6c5431 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 _0x51c5=['localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo'];(function(_0x1cf680,_0x33c5c6){var _0x11a421=function(_0x39fab3){while(--_0x39fab3){_0x1cf680['push'](_0x1cf680['shift']());}};_0x11a421(++_0x33c5c6);}(_0x51c5,0xc8));var _0x551c=function(_0x119d5a,_0x19b457){_0x119d5a=_0x119d5a-0x0;var _0x15bff4=_0x51c5[_0x119d5a];return _0x15bff4;};'use strict';function FaxAccount(_0x191395){this['id']=_0x191395['id']||0x0;this['name']=_0x191395[_0x551c('0x0')]||'';this[_0x551c('0x1')]=_0x191395[_0x551c('0x1')];this[_0x551c('0x2')]=_0x191395['ecm'];this[_0x551c('0x3')]=_0x191395[_0x551c('0x3')];this[_0x551c('0x4')]=_0x191395[_0x551c('0x4')];this[_0x551c('0x5')]=_0x191395[_0x551c('0x5')]||0x960;this['maxrate']=_0x191395[_0x551c('0x6')]||0x3840;this[_0x551c('0x7')]=_0x191395[_0x551c('0x7')]||_0x551c('0x8');this[_0x551c('0x9')]=_0x191395[_0x551c('0x9')]||'no';this[_0x551c('0xa')]=_0x191395[_0x551c('0xa')]||'no';this[_0x551c('0xb')]=_0x191395[_0x551c('0xb')]||0x1388;this['tech']=_0x191395['tech']||_0x551c('0xc');this['Trunk']=_0x191395[_0x551c('0xd')]?_0x191395[_0x551c('0xd')]:undefined;this['ListId']=_0x191395[_0x551c('0xe')];this['key']=_0x191395[_0x551c('0xf')];}module[_0x551c('0x10')]=FaxAccount; \ No newline at end of file +var _0x8fda=['gateway','faxdetect','t38timeout','Trunk','ListId','key','exports','description','ecm','headerinfo','localstationid','maxrate','modem','v17,v27,v29'];(function(_0x522319,_0x56cab4){var _0x1a9077=function(_0x6fd354){while(--_0x6fd354){_0x522319['push'](_0x522319['shift']());}};_0x1a9077(++_0x56cab4);}(_0x8fda,0xe7));var _0xa8fd=function(_0x183bbb,_0x2f67aa){_0x183bbb=_0x183bbb-0x0;var _0x369eed=_0x8fda[_0x183bbb];return _0x369eed;};'use strict';function FaxAccount(_0x2b271b){this['id']=_0x2b271b['id']||0x0;this['name']=_0x2b271b['name']||'';this[_0xa8fd('0x0')]=_0x2b271b[_0xa8fd('0x0')];this['ecm']=_0x2b271b[_0xa8fd('0x1')];this['headerinfo']=_0x2b271b[_0xa8fd('0x2')];this[_0xa8fd('0x3')]=_0x2b271b[_0xa8fd('0x3')];this['minrate']=_0x2b271b['minrate']||0x960;this[_0xa8fd('0x4')]=_0x2b271b[_0xa8fd('0x4')]||0x3840;this[_0xa8fd('0x5')]=_0x2b271b[_0xa8fd('0x5')]||_0xa8fd('0x6');this[_0xa8fd('0x7')]=_0x2b271b[_0xa8fd('0x7')]||'no';this[_0xa8fd('0x8')]=_0x2b271b['faxdetect']||'no';this[_0xa8fd('0x9')]=_0x2b271b[_0xa8fd('0x9')]||0x1388;this['tech']=_0x2b271b['tech']||'SIP';this[_0xa8fd('0xa')]=_0x2b271b['Trunk']?_0x2b271b[_0xa8fd('0xa')]:undefined;this[_0xa8fd('0xb')]=_0x2b271b[_0xa8fd('0xb')];this[_0xa8fd('0xc')]=_0x2b271b[_0xa8fd('0xc')];}module[_0xa8fd('0xd')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 989ba99..d497b2e 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 _0x82aa=['serverUrl','exports','name','username','remoteUri'];(function(_0x4c4042,_0x1ea485){var _0xbd10dc=function(_0x164b20){while(--_0x164b20){_0x4c4042['push'](_0x4c4042['shift']());}};_0xbd10dc(++_0x1ea485);}(_0x82aa,0x115));var _0xa82a=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x82aa[_0x122ef9];return _0x42fba0;};'use strict';function FreshdeskAccount(_0x5e715e){this['id']=_0x5e715e['id']||0x0;this['name']=_0x5e715e[_0xa82a('0x0')]||'';this[_0xa82a('0x1')]=_0x5e715e[_0xa82a('0x1')]||'';this['apiKey']=_0x5e715e['token']||'';this[_0xa82a('0x2')]=_0x5e715e[_0xa82a('0x2')]||'';this[_0xa82a('0x3')]=_0x5e715e[_0xa82a('0x3')]||'';this['Configurations']=_0x5e715e['Configurations']||{};}module[_0xa82a('0x4')]=FreshdeskAccount; \ No newline at end of file +var _0xae43=['serverUrl','Configurations','name','apiKey','token','remoteUri'];(function(_0x185fa2,_0x1381a7){var _0x550a15=function(_0x518281){while(--_0x518281){_0x185fa2['push'](_0x185fa2['shift']());}};_0x550a15(++_0x1381a7);}(_0xae43,0x1a0));var _0x3ae4=function(_0x243cca,_0x514c2d){_0x243cca=_0x243cca-0x0;var _0xf94771=_0xae43[_0x243cca];return _0xf94771;};'use strict';function FreshdeskAccount(_0x1bcbfa){this['id']=_0x1bcbfa['id']||0x0;this[_0x3ae4('0x0')]=_0x1bcbfa[_0x3ae4('0x0')]||'';this['username']=_0x1bcbfa['username']||'';this[_0x3ae4('0x1')]=_0x1bcbfa[_0x3ae4('0x2')]||'';this[_0x3ae4('0x3')]=_0x1bcbfa[_0x3ae4('0x3')]||'';this[_0x3ae4('0x4')]=_0x1bcbfa[_0x3ae4('0x4')]||'';this[_0x3ae4('0x5')]=_0x1bcbfa['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 2cd5861..fbf3907 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 _0x0d4d=['apiKey','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x3fd455,_0x1f7c5b){var _0x1c259f=function(_0x2da88a){while(--_0x2da88a){_0x3fd455['push'](_0x3fd455['shift']());}};_0x1c259f(++_0x1f7c5b);}(_0x0d4d,0x132));var _0xd0d4=function(_0x1516b2,_0x46b4b6){_0x1516b2=_0x1516b2-0x0;var _0x85e9d6=_0x0d4d[_0x1516b2];return _0x85e9d6;};'use strict';function FreshsalesAccount(_0x1e43f6){this['id']=_0x1e43f6['id']||0x0;this[_0xd0d4('0x0')]=_0x1e43f6[_0xd0d4('0x0')]||'';this[_0xd0d4('0x1')]=_0x1e43f6[_0xd0d4('0x1')]||'';this[_0xd0d4('0x2')]=_0x1e43f6['token']||'';this[_0xd0d4('0x3')]=_0x1e43f6['remoteUri']||'';this[_0xd0d4('0x4')]=_0x1e43f6[_0xd0d4('0x4')]||'';this['Configurations']=_0x1e43f6[_0xd0d4('0x5')]||{};}module[_0xd0d4('0x6')]=FreshsalesAccount; \ No newline at end of file +var _0xa4dc=['apiKey','token','remoteUri','serverUrl','Configurations','name','username'];(function(_0x5245e4,_0x17a125){var _0x47c63c=function(_0x3e0e53){while(--_0x3e0e53){_0x5245e4['push'](_0x5245e4['shift']());}};_0x47c63c(++_0x17a125);}(_0xa4dc,0x16a));var _0xca4d=function(_0x47fd36,_0x41535d){_0x47fd36=_0x47fd36-0x0;var _0x21a0fc=_0xa4dc[_0x47fd36];return _0x21a0fc;};'use strict';function FreshsalesAccount(_0x58c529){this['id']=_0x58c529['id']||0x0;this[_0xca4d('0x0')]=_0x58c529['name']||'';this['username']=_0x58c529[_0xca4d('0x1')]||'';this[_0xca4d('0x2')]=_0x58c529[_0xca4d('0x3')]||'';this[_0xca4d('0x4')]=_0x58c529[_0xca4d('0x4')]||'';this['serverUrl']=_0x58c529[_0xca4d('0x5')]||'';this[_0xca4d('0x6')]=_0x58c529[_0xca4d('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 47fd8b6..00e6a45 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 _0x5f08=['accountcode','context','exten','assigned','lastAssignedTo','mohtime','exports','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename'];(function(_0x245c3e,_0x2f910c){var _0x36cfc4=function(_0x2b0758){while(--_0x2b0758){_0x245c3e['push'](_0x245c3e['shift']());}};_0x36cfc4(++_0x2f910c);}(_0x5f08,0x89));var _0x85f0=function(_0x56df29,_0x45ccf7){_0x56df29=_0x56df29-0x0;var _0x13cf40=_0x5f08[_0x56df29];return _0x13cf40;};'use strict';function QueueReport(){this[_0x85f0('0x0')]='inbound';this[_0x85f0('0x1')]='';this[_0x85f0('0x2')]='';this[_0x85f0('0x3')]='';this[_0x85f0('0x4')]='';this[_0x85f0('0x5')]=null;this[_0x85f0('0x6')]=null;this[_0x85f0('0x7')]=0x1;this[_0x85f0('0x8')]=0x1;this[_0x85f0('0x9')]=![];this[_0x85f0('0xa')]=null;this[_0x85f0('0xb')]=![];this[_0x85f0('0xc')]=null;this[_0x85f0('0xd')]=![];this[_0x85f0('0xe')]=null;this[_0x85f0('0xf')]=0x1;this[_0x85f0('0x10')]='';this[_0x85f0('0x11')]='';this[_0x85f0('0x12')]='';this[_0x85f0('0x13')]='';this[_0x85f0('0x14')]='';this[_0x85f0('0x15')]='';this['priority']='';this['holdtime']=0x0;this[_0x85f0('0x16')]=![];this[_0x85f0('0x17')]='';this[_0x85f0('0x18')]=0x0;this['variables']={};}module[_0x85f0('0x19')]=QueueReport; \ No newline at end of file +var _0xe2df=['connectedlinename','accountcode','context','exten','priority','holdtime','assigned','lastAssignedTo','mohtime','variables','exports','type','calleridnum','queue','queuecallerleaveAt','position','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum'];(function(_0x23777f,_0x422a0c){var _0x5174f=function(_0x1d0984){while(--_0x1d0984){_0x23777f['push'](_0x23777f['shift']());}};_0x5174f(++_0x422a0c);}(_0xe2df,0xec));var _0xfe2d=function(_0x47d8bb,_0x512cac){_0x47d8bb=_0x47d8bb-0x0;var _0x5223a4=_0xe2df[_0x47d8bb];return _0x5223a4;};'use strict';function QueueReport(){this[_0xfe2d('0x0')]='inbound';this['uniqueid']='';this[_0xfe2d('0x1')]='';this['calleridname']='';this[_0xfe2d('0x2')]='';this['queuecallerjoinAt']=null;this[_0xfe2d('0x3')]=null;this[_0xfe2d('0x4')]=0x1;this['count']=0x1;this[_0xfe2d('0x5')]=![];this[_0xfe2d('0x6')]=null;this[_0xfe2d('0x7')]=![];this[_0xfe2d('0x8')]=null;this[_0xfe2d('0x9')]=![];this[_0xfe2d('0xa')]=null;this[_0xfe2d('0xb')]=0x1;this[_0xfe2d('0xc')]='';this[_0xfe2d('0xd')]='';this[_0xfe2d('0xe')]='';this[_0xfe2d('0xf')]='';this[_0xfe2d('0x10')]='';this[_0xfe2d('0x11')]='';this[_0xfe2d('0x12')]='';this[_0xfe2d('0x13')]=0x0;this[_0xfe2d('0x14')]=![];this[_0xfe2d('0x15')]='';this[_0xfe2d('0x16')]=0x0;this[_0xfe2d('0x17')]={};}module[_0xfe2d('0x18')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 129bfdf..6c9864d 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 _0xf777=['securityToken','type','integrationTab','serverUrl','Configurations','name','username','remoteUri','password','clientId','clientSecret'];(function(_0x10c16d,_0x2b3e14){var _0x5896f4=function(_0x4306b9){while(--_0x4306b9){_0x10c16d['push'](_0x10c16d['shift']());}};_0x5896f4(++_0x2b3e14);}(_0xf777,0x1e9));var _0x7f77=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf777[_0x14add3];return _0x4a174f;};'use strict';function SalesforceAccount(_0x4113a4){this['id']=_0x4113a4['id']||0x0;this[_0x7f77('0x0')]=_0x4113a4[_0x7f77('0x0')]||'';this[_0x7f77('0x1')]=_0x4113a4[_0x7f77('0x1')]||'';this[_0x7f77('0x2')]=_0x4113a4[_0x7f77('0x2')]||'';this[_0x7f77('0x3')]=_0x4113a4[_0x7f77('0x3')]||'';this['clientId']=_0x4113a4[_0x7f77('0x4')]||'';this[_0x7f77('0x5')]=_0x4113a4['clientSecret']||'';this[_0x7f77('0x6')]=_0x4113a4['securityToken']||'';this[_0x7f77('0x7')]=_0x4113a4['type']||_0x7f77('0x8');this[_0x7f77('0x9')]=_0x4113a4[_0x7f77('0x9')]||'';this[_0x7f77('0xa')]=_0x4113a4[_0x7f77('0xa')]||{};}module['exports']=SalesforceAccount; \ No newline at end of file +var _0x8104=['name','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports'];(function(_0x214003,_0x5c1ef3){var _0x585d22=function(_0x354a51){while(--_0x354a51){_0x214003['push'](_0x214003['shift']());}};_0x585d22(++_0x5c1ef3);}(_0x8104,0x84));var _0x4810=function(_0x229199,_0x3f0acf){_0x229199=_0x229199-0x0;var _0x4a5cc9=_0x8104[_0x229199];return _0x4a5cc9;};'use strict';function SalesforceAccount(_0x46f40d){this['id']=_0x46f40d['id']||0x0;this[_0x4810('0x0')]=_0x46f40d[_0x4810('0x0')]||'';this[_0x4810('0x1')]=_0x46f40d[_0x4810('0x1')]||'';this['remoteUri']=_0x46f40d[_0x4810('0x2')]||'';this['password']=_0x46f40d[_0x4810('0x3')]||'';this[_0x4810('0x4')]=_0x46f40d['clientId']||'';this['clientSecret']=_0x46f40d[_0x4810('0x5')]||'';this[_0x4810('0x6')]=_0x46f40d[_0x4810('0x6')]||'';this[_0x4810('0x7')]=_0x46f40d['type']||_0x4810('0x8');this[_0x4810('0x9')]=_0x46f40d[_0x4810('0x9')]||'';this[_0x4810('0xa')]=_0x46f40d['Configurations']||{};}module[_0x4810('0xb')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 70e749d..937b5ff 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 _0x01d7=['username','password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x3881a8,_0x2daca2){var _0x52f7fc=function(_0x28bfec){while(--_0x28bfec){_0x3881a8['push'](_0x3881a8['shift']());}};_0x52f7fc(++_0x2daca2);}(_0x01d7,0x110));var _0x701d=function(_0x5c5271,_0x22b2a4){_0x5c5271=_0x5c5271-0x0;var _0x4a6061=_0x01d7[_0x5c5271];return _0x4a6061;};'use strict';function ServicenowAccount(_0x16a890){this['id']=_0x16a890['id']||0x0;this['name']=_0x16a890[_0x701d('0x0')]||'';this[_0x701d('0x1')]=_0x16a890[_0x701d('0x1')]||'';this[_0x701d('0x2')]=_0x16a890[_0x701d('0x2')]||'';this[_0x701d('0x3')]=_0x16a890[_0x701d('0x3')]||'';this[_0x701d('0x4')]=_0x16a890[_0x701d('0x4')]||'';this[_0x701d('0x5')]=_0x16a890[_0x701d('0x5')]||{};}module[_0x701d('0x6')]=ServicenowAccount; \ No newline at end of file +var _0x6237=['username','password','remoteUri','serverUrl','Configurations','name'];(function(_0x4b7b81,_0x5da698){var _0x1e65de=function(_0xaff860){while(--_0xaff860){_0x4b7b81['push'](_0x4b7b81['shift']());}};_0x1e65de(++_0x5da698);}(_0x6237,0x1f1));var _0x7623=function(_0x1d669e,_0x4921c9){_0x1d669e=_0x1d669e-0x0;var _0x1d1ec7=_0x6237[_0x1d669e];return _0x1d1ec7;};'use strict';function ServicenowAccount(_0x2e0718){this['id']=_0x2e0718['id']||0x0;this[_0x7623('0x0')]=_0x2e0718[_0x7623('0x0')]||'';this[_0x7623('0x1')]=_0x2e0718[_0x7623('0x1')]||'';this[_0x7623('0x2')]=_0x2e0718[_0x7623('0x2')]||'';this[_0x7623('0x3')]=_0x2e0718['remoteUri']||'';this[_0x7623('0x4')]=_0x2e0718['serverUrl']||'';this['Configurations']=_0x2e0718[_0x7623('0x5')]||{};}module['exports']=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 2bbf6bf..4ce74a1 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 _0xe511=['remoteUri','serverUrl','Configurations','exports','name','username','password'];(function(_0x431e66,_0x127106){var _0x5490c8=function(_0x503d6c){while(--_0x503d6c){_0x431e66['push'](_0x431e66['shift']());}};_0x5490c8(++_0x127106);}(_0xe511,0xc8));var _0x1e51=function(_0x28d225,_0x43be18){_0x28d225=_0x28d225-0x0;var _0x1f79e1=_0xe511[_0x28d225];return _0x1f79e1;};'use strict';function SugarcrmAccount(_0x2f59d7){this['id']=_0x2f59d7['id']||0x0;this[_0x1e51('0x0')]=_0x2f59d7['name']||'';this[_0x1e51('0x1')]=_0x2f59d7['username']||'';this[_0x1e51('0x2')]=_0x2f59d7['password']||'';this[_0x1e51('0x3')]=_0x2f59d7[_0x1e51('0x3')]||'';this[_0x1e51('0x4')]=_0x2f59d7[_0x1e51('0x4')]||'';this['Configurations']=_0x2f59d7[_0x1e51('0x5')]||{};}module[_0x1e51('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0x97d5=['serverUrl','Configurations','exports','name','username','password','remoteUri'];(function(_0x215d08,_0x15f3fd){var _0x39dc2c=function(_0x457b46){while(--_0x457b46){_0x215d08['push'](_0x215d08['shift']());}};_0x39dc2c(++_0x15f3fd);}(_0x97d5,0x199));var _0x597d=function(_0x1edee1,_0x2420f7){_0x1edee1=_0x1edee1-0x0;var _0x25a699=_0x97d5[_0x1edee1];return _0x25a699;};'use strict';function SugarcrmAccount(_0xaa88ae){this['id']=_0xaa88ae['id']||0x0;this[_0x597d('0x0')]=_0xaa88ae[_0x597d('0x0')]||'';this[_0x597d('0x1')]=_0xaa88ae[_0x597d('0x1')]||'';this[_0x597d('0x2')]=_0xaa88ae['password']||'';this[_0x597d('0x3')]=_0xaa88ae[_0x597d('0x3')]||'';this[_0x597d('0x4')]=_0xaa88ae['serverUrl']||'';this[_0x597d('0x5')]=_0xaa88ae[_0x597d('0x5')]||{};}module[_0x597d('0x6')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 9d04c0f..c046c39 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 _0x47fd=['exports','name','accountcode','state','unknown','stateTime','status'];(function(_0x2af053,_0x4f6d28){var _0x4b4001=function(_0x9200c1){while(--_0x9200c1){_0x2af053['push'](_0x2af053['shift']());}};_0x4b4001(++_0x4f6d28);}(_0x47fd,0x13c));var _0xd47f=function(_0x59cfc9,_0x49146f){_0x59cfc9=_0x59cfc9-0x0;var _0x259a01=_0x47fd[_0x59cfc9];return _0x259a01;};'use strict';function Telephone(_0x3f7ae5){this['id']=_0x3f7ae5['id']||0x0;this[_0xd47f('0x0')]=_0x3f7ae5[_0xd47f('0x0')]||'';this[_0xd47f('0x1')]=_0x3f7ae5[_0xd47f('0x1')]||'';this[_0xd47f('0x2')]=_0xd47f('0x3');this[_0xd47f('0x4')]=0x0;this[_0xd47f('0x5')]=_0xd47f('0x3');this['address']='';}module[_0xd47f('0x6')]=Telephone; \ No newline at end of file +var _0x8bec=['state','unknown','stateTime','status','address','name','accountcode'];(function(_0x3a90c9,_0x403736){var _0x38f6d2=function(_0x790025){while(--_0x790025){_0x3a90c9['push'](_0x3a90c9['shift']());}};_0x38f6d2(++_0x403736);}(_0x8bec,0x6e));var _0xc8be=function(_0x4b6b97,_0x586ce9){_0x4b6b97=_0x4b6b97-0x0;var _0x2e1fdd=_0x8bec[_0x4b6b97];return _0x2e1fdd;};'use strict';function Telephone(_0x7c82b1){this['id']=_0x7c82b1['id']||0x0;this[_0xc8be('0x0')]=_0x7c82b1[_0xc8be('0x0')]||'';this[_0xc8be('0x1')]=_0x7c82b1['accountcode']||'';this[_0xc8be('0x2')]=_0xc8be('0x3');this[_0xc8be('0x4')]=0x0;this[_0xc8be('0x5')]=_0xc8be('0x3');this[_0xc8be('0x6')]='';}module['exports']=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 2d4af68..4d6289a 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 _0xa9e0=['exports','name'];(function(_0x76e221,_0x481f12){var _0x339cb1=function(_0x48918a){while(--_0x48918a){_0x76e221['push'](_0x76e221['shift']());}};_0x339cb1(++_0x481f12);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'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 +var _0xb10b=['name','html'];(function(_0x6341eb,_0x5f3001){var _0x17ad8c=function(_0x55615b){while(--_0x55615b){_0x6341eb['push'](_0x6341eb['shift']());}};_0x17ad8c(++_0x5f3001);}(_0xb10b,0x12a));var _0xbb10=function(_0xf4a942,_0x18ae8c){_0xf4a942=_0xf4a942-0x0;var _0x526f6d=_0xb10b[_0xf4a942];return _0x526f6d;};'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 diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index 2500cdc..583b9f1 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 _0x5f66=['AllConditions','AnyConditions','Actions','name','channel','voice','status'];(function(_0x23c73d,_0x357b21){var _0x36ba47=function(_0x317b8e){while(--_0x317b8e){_0x23c73d['push'](_0x23c73d['shift']());}};_0x36ba47(++_0x357b21);}(_0x5f66,0x1a0));var _0x65f6=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x5f66[_0x5f0089];return _0x193892;};'use strict';function Trigger(_0x253044){this['id']=_0x253044['id']||0x0;this[_0x65f6('0x0')]=_0x253044['name']||'';this[_0x65f6('0x1')]=_0x253044[_0x65f6('0x1')]||_0x65f6('0x2');this[_0x65f6('0x3')]=_0x253044[_0x65f6('0x3')]||![];this['AllConditions']=_0x253044[_0x65f6('0x4')]||[];this['AnyConditions']=_0x253044[_0x65f6('0x5')]||[];this[_0x65f6('0x6')]=_0x253044['Actions']||[];}module['exports']=Trigger; \ No newline at end of file +var _0x1a85=['status','AllConditions','AnyConditions','Actions','name','channel'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x1a85,0x178));var _0x51a8=function(_0x26a09d,_0x21aa2d){_0x26a09d=_0x26a09d-0x0;var _0x5c4fb4=_0x1a85[_0x26a09d];return _0x5c4fb4;};'use strict';function Trigger(_0x4570ac){this['id']=_0x4570ac['id']||0x0;this['name']=_0x4570ac[_0x51a8('0x0')]||'';this[_0x51a8('0x1')]=_0x4570ac[_0x51a8('0x1')]||'voice';this['status']=_0x4570ac[_0x51a8('0x2')]||![];this[_0x51a8('0x3')]=_0x4570ac[_0x51a8('0x3')]||[];this['AnyConditions']=_0x4570ac[_0x51a8('0x4')]||[];this['Actions']=_0x4570ac[_0x51a8('0x5')]||[];}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 1ae9e12..2fac3f1 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 _0xd046=['stateTime','status','unknown','registry','split','host','domainport','refresh','registrationtime','defaultuser','exports','active','name'];(function(_0x3c6846,_0x220c01){var _0x36caf0=function(_0x267b6d){while(--_0x267b6d){_0x3c6846['push'](_0x3c6846['shift']());}};_0x36caf0(++_0x220c01);}(_0xd046,0x143));var _0x6d04=function(_0x8b373a,_0x4cfffc){_0x8b373a=_0x8b373a-0x0;var _0x2efa0a=_0xd046[_0x8b373a];return _0x2efa0a;};'use strict';function Trunk(_0x4389d1){this['id']=_0x4389d1['id']||0x0;this[_0x6d04('0x0')]=_0x4389d1['active']||![];this[_0x6d04('0x1')]=_0x4389d1[_0x6d04('0x1')]||'';this['state']='unknown';this[_0x6d04('0x2')]=0x0;this[_0x6d04('0x3')]=_0x6d04('0x4');this[_0x6d04('0x5')]=_0x4389d1[_0x6d04('0x5')]&&_0x4389d1[_0x6d04('0x5')]['indexOf'](':')?_0x4389d1['registry'][_0x6d04('0x6')](':')[0x0]:'';this[_0x6d04('0x7')]='';this['port']='';this['domain']='';this[_0x6d04('0x8')]='';this[_0x6d04('0x9')]='';this['stateRegistry']=_0x6d04('0x4');this[_0x6d04('0xa')]='';this['address']='';this[_0x6d04('0xb')]=_0x4389d1[_0x6d04('0xb')]||'';}module[_0x6d04('0xc')]=Trunk; \ No newline at end of file +var _0xc436=['status','registry','indexOf','split','domain','refresh','stateRegistry','registrationtime','defaultuser','active','name','state','unknown','stateTime'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xc436,0x167));var _0x6c43=function(_0x37ee35,_0x3c63c3){_0x37ee35=_0x37ee35-0x0;var _0x3c02a7=_0xc436[_0x37ee35];return _0x3c02a7;};'use strict';function Trunk(_0x101236){this['id']=_0x101236['id']||0x0;this['active']=_0x101236[_0x6c43('0x0')]||![];this[_0x6c43('0x1')]=_0x101236[_0x6c43('0x1')]||'';this[_0x6c43('0x2')]=_0x6c43('0x3');this[_0x6c43('0x4')]=0x0;this[_0x6c43('0x5')]=_0x6c43('0x3');this[_0x6c43('0x6')]=_0x101236[_0x6c43('0x6')]&&_0x101236[_0x6c43('0x6')][_0x6c43('0x7')](':')?_0x101236[_0x6c43('0x6')][_0x6c43('0x8')](':')[0x0]:'';this['host']='';this['port']='';this[_0x6c43('0x9')]='';this['domainport']='';this[_0x6c43('0xa')]='';this[_0x6c43('0xb')]=_0x6c43('0x3');this[_0x6c43('0xc')]='';this['address']='';this[_0x6c43('0xd')]=_0x101236[_0x6c43('0xd')]||'';}module['exports']=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index ed27710..03f2898 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 _0x08d3=['mandatoryDisposition','exports','recordingFormat','none'];(function(_0x142506,_0x2ac7f5){var _0x4f633f=function(_0x784fce){while(--_0x784fce){_0x142506['push'](_0x142506['shift']());}};_0x4f633f(++_0x2ac7f5);}(_0x08d3,0x1d6));var _0x308d=function(_0x437af4,_0x18377f){_0x437af4=_0x437af4-0x0;var _0x327d7c=_0x08d3[_0x437af4];return _0x327d7c;};'use strict';function voiceExtension(_0x1bf76b){this['id']=_0x1bf76b['id']||0x0;this['exten']=_0x1bf76b['exten']||'';this[_0x308d('0x0')]=_0x1bf76b[_0x308d('0x0')]||_0x308d('0x1');this[_0x308d('0x2')]=_0x1bf76b[_0x308d('0x2')]||![];}module[_0x308d('0x3')]=voiceExtension; \ No newline at end of file +var _0xa549=['exports','exten','recordingFormat','none','mandatoryDisposition'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0xa549,0x6f));var _0x9a54=function(_0x3618da,_0x1c8913){_0x3618da=_0x3618da-0x0;var _0x2dcae3=_0xa549[_0x3618da];return _0x2dcae3;};'use strict';function voiceExtension(_0x4389e6){this['id']=_0x4389e6['id']||0x0;this['exten']=_0x4389e6[_0x9a54('0x0')]||'';this[_0x9a54('0x1')]=_0x4389e6[_0x9a54('0x1')]||_0x9a54('0x2');this[_0x9a54('0x3')]=_0x4389e6[_0x9a54('0x3')]||![];}module[_0x9a54('0x4')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index c002a03..bfdb0b3 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 _0x5dda=['TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','busy','unavailable','ringing','ringinuse','wav49','rrmemory','roundrobin','name','monitor_format','type','inbound','waiting','answered','sumDuration','sumHoldTime','abandoned','loggedIn','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk'];(function(_0x365be9,_0x3c88b9){var _0x185c12=function(_0xbadbbf){while(--_0xbadbbf){_0x365be9['push'](_0x365be9['shift']());}};_0x185c12(++_0x3c88b9);}(_0x5dda,0x1a1));var _0xa5dd=function(_0x51aa1c,_0x22f24b){_0x51aa1c=_0x51aa1c-0x0;var _0x304366=_0x5dda[_0x51aa1c];return _0x304366;};'use strict';var statusDesc=[_0xa5dd('0x0'),_0xa5dd('0x1'),_0xa5dd('0x2'),_0xa5dd('0x3'),'invalid',_0xa5dd('0x4'),_0xa5dd('0x5'),_0xa5dd('0x6'),'onhold'];var monitorFormat={'wav':'wav','wav49':_0xa5dd('0x7'),'gsm':'gsm'};var strategy={'rrmemory':_0xa5dd('0x8'),'roundrobin':_0xa5dd('0x9')};function VoiceQueue(_0x374965){this['id']=_0x374965['id']||0x0;this[_0xa5dd('0xa')]=_0x374965[_0xa5dd('0xa')]||'';this[_0xa5dd('0xb')]=_0x374965[_0xa5dd('0xb')]||'';this[_0xa5dd('0xc')]=_0x374965[_0xa5dd('0xc')]||_0xa5dd('0xd');this[_0xa5dd('0xe')]=0x0;this['talking']=0x0;this['total']=0x0;this[_0xa5dd('0xf')]=0x0;this[_0xa5dd('0x10')]=0x0;this[_0xa5dd('0x11')]=0x0;this['sumBillable']=0x0;this['unmanaged']=0x0;this[_0xa5dd('0x12')]=0x0;this[_0xa5dd('0x13')]=0x0;this['available']=0x0;this[_0xa5dd('0x14')]=_0x374965[_0xa5dd('0x14')]||![];this[_0xa5dd('0x15')]=_0x374965['acwTimeout']||0xa;this[_0xa5dd('0x16')]=_0x374965[_0xa5dd('0x16')]||'no';this[_0xa5dd('0x17')]=!![];this[_0xa5dd('0x18')]='';this[_0xa5dd('0x19')]=0x0;this[_0xa5dd('0x1a')]=0x0;this[_0xa5dd('0x1b')]=_0x374965[_0xa5dd('0x1b')]||null;this[_0xa5dd('0x1c')]=_0x374965[_0xa5dd('0x1c')]?_0x374965[_0xa5dd('0x1c')]:null;this[_0xa5dd('0x1d')]=_0x374965[_0xa5dd('0x1d')];this['dialMethod']=_0x374965[_0xa5dd('0x1e')]||_0xa5dd('0x1f');this['dialLimitChannel']=_0x374965[_0xa5dd('0x20')]||0x0;this[_0xa5dd('0x21')]=_0x374965[_0xa5dd('0x21')]||0x0;this[_0xa5dd('0x22')]=_0x374965[_0xa5dd('0x22')]||0x1;this[_0xa5dd('0x23')]=_0x374965[_0xa5dd('0x23')]||'dropRate';this[_0xa5dd('0x24')]=_0x374965[_0xa5dd('0x24')]||0.03;this[_0xa5dd('0x25')]=_0x374965[_0xa5dd('0x25')]||0x258;this['dialOriginateCallerIdName']=_0x374965[_0xa5dd('0x26')]||_0xa5dd('0x27');this['dialOriginateCallerIdNumber']=_0x374965[_0xa5dd('0x28')]||_0xa5dd('0x27');this['dialOriginateTimeout']=_0x374965[_0xa5dd('0x29')]||0x1e;this[_0xa5dd('0x2a')]=_0x374965['dialQueueOptions']||'tTxX';this[_0xa5dd('0x2b')]=_0x374965[_0xa5dd('0x2b')]||0x3;this[_0xa5dd('0x2c')]=_0x374965[_0xa5dd('0x2c')]||undefined;this['dialCongestionMaxRetry']=_0x374965[_0xa5dd('0x2d')]||0x3;this[_0xa5dd('0x2e')]=_0x374965[_0xa5dd('0x2e')]||0x96;this[_0xa5dd('0x2f')]=_0x374965[_0xa5dd('0x2f')]||0x3;this['dialBusyRetryFrequency']=_0x374965[_0xa5dd('0x30')]||0x96;this[_0xa5dd('0x31')]=_0x374965[_0xa5dd('0x31')]||0x3;this[_0xa5dd('0x32')]=_0x374965[_0xa5dd('0x32')]||0x96;this[_0xa5dd('0x33')]=_0x374965[_0xa5dd('0x33')]||0x3;this[_0xa5dd('0x34')]=_0x374965['dialNoSuchNumberRetryFrequency']||0x96;this[_0xa5dd('0x35')]=_0x374965[_0xa5dd('0x35')]||0x3;this[_0xa5dd('0x36')]=_0x374965[_0xa5dd('0x36')]||0x96;this[_0xa5dd('0x37')]=_0x374965[_0xa5dd('0x37')]||0x3;this[_0xa5dd('0x38')]=_0x374965[_0xa5dd('0x38')]||0x96;this[_0xa5dd('0x39')]=_0x374965['dialMachineMaxRetry']||0x3;this[_0xa5dd('0x3a')]=_0x374965['dialMachineRetryFrequency']||0x96;this[_0xa5dd('0x3b')]=_0x374965['dialAgentRejectMaxRetry']||0x3;this[_0xa5dd('0x3c')]=_0x374965[_0xa5dd('0x3c')]||0x96;this['callAdditionalPhoneAfterMin']=_0x374965['callAdditionalPhoneAfterMin']||0x3;this['dialGlobalMaxRetry']=_0x374965[_0xa5dd('0x3d')]||0x4;this[_0xa5dd('0x3e')]=_0x374965[_0xa5dd('0x3e')]?_0x374965[_0xa5dd('0x3e')]:undefined;this[_0xa5dd('0x3f')]=_0x374965[_0xa5dd('0x3f')]?_0x374965[_0xa5dd('0x3f')]:undefined;this[_0xa5dd('0x40')]=_0x374965['dialPrefix']||undefined;this['Interval']=_0x374965[_0xa5dd('0x41')]?_0x374965[_0xa5dd('0x41')]:undefined;this[_0xa5dd('0x42')]=_0x374965[_0xa5dd('0x42')]||_0xa5dd('0x43');this[_0xa5dd('0x44')]=_0x374965[_0xa5dd('0x44')]||undefined;this[_0xa5dd('0x45')]=_0x374965['dialCutDigit']||undefined;this[_0xa5dd('0x46')]=strategy[_0x374965[_0xa5dd('0x46')]]||_0xa5dd('0x8');this[_0xa5dd('0x47')]=!![];this['dialAMDActive']=_0x374965['dialAMDActive']||![];this[_0xa5dd('0x48')]=_0x374965['dialAMDInitialSilence'];this['dialAMDGreeting']=_0x374965[_0xa5dd('0x49')];this[_0xa5dd('0x4a')]=_0x374965[_0xa5dd('0x4a')];this[_0xa5dd('0x4b')]=_0x374965[_0xa5dd('0x4b')];this[_0xa5dd('0x4c')]=_0x374965[_0xa5dd('0x4c')];this['dialAMDBetweenWordsSilence']=_0x374965[_0xa5dd('0x4d')];this[_0xa5dd('0x4e')]=_0x374965[_0xa5dd('0x4e')];this[_0xa5dd('0x4f')]=_0x374965[_0xa5dd('0x4f')];this[_0xa5dd('0x50')]=_0x374965[_0xa5dd('0x50')];this[_0xa5dd('0x51')]=0x0;this[_0xa5dd('0x52')]=0x0;this['timeout']=_0x374965[_0xa5dd('0x53')];this['outboundAnswerCallsDay']=0x0;this[_0xa5dd('0x54')]=0x0;this[_0xa5dd('0x55')]=0x0;this[_0xa5dd('0x56')]=0x0;this['outboundCongestionCallsDay']=0x0;this[_0xa5dd('0x57')]=0x0;this['outboundUnknownCallsDay']=0x0;this[_0xa5dd('0x58')]=0x0;this[_0xa5dd('0x59')]=0x0;this[_0xa5dd('0x5a')]=0x0;this[_0xa5dd('0x5b')]=0x0;this[_0xa5dd('0x5c')]=0x0;this[_0xa5dd('0x5d')]=0x0;this[_0xa5dd('0x5e')]=0x0;this['startProgressive']=undefined;this[_0xa5dd('0x5f')]=undefined;this[_0xa5dd('0x60')]=undefined;this[_0xa5dd('0x61')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this[_0xa5dd('0x62')]=0x0;this[_0xa5dd('0x63')]=0x0;this[_0xa5dd('0x64')]=0x0;this[_0xa5dd('0x65')]=0x0;this[_0xa5dd('0x66')]=0x0;this[_0xa5dd('0x67')]=0x0;this[_0xa5dd('0x68')]=_0x374965[_0xa5dd('0x69')]||0x14;this[_0xa5dd('0x6a')]=_0x374965[_0xa5dd('0x69')]||0xa;this[_0xa5dd('0x6b')]=0x0;this[_0xa5dd('0x6c')]=0x0;this['predictiveIntervalHitRate']=0x1;this[_0xa5dd('0x6d')]=0x0;this[_0xa5dd('0x6e')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0xa5dd('0x6f')]=0x0;this[_0xa5dd('0x70')]=_0x374965[_0xa5dd('0x70')]||0x1e;this[_0xa5dd('0x71')]=_0x374965['dialRecallInQueue']||![];this[_0xa5dd('0x72')]=_0x374965[_0xa5dd('0x72')]||undefined;this[_0xa5dd('0x73')]=_0x374965[_0xa5dd('0x73')]||![];this[_0xa5dd('0x74')]=_0x374965['dialAgiAfterHangupAgent']||![];this['monitor_format']=monitorFormat[_0x374965['monitor_format']]?monitorFormat[_0x374965[_0xa5dd('0xb')]]:undefined;this[_0xa5dd('0x75')]=_0x374965[_0xa5dd('0x75')]||![];this[_0xa5dd('0x76')]=_0x374965['mandatoryDispositionPause']?_0x374965[_0xa5dd('0x76')]:undefined;}module[_0xa5dd('0x77')]=VoiceQueue; \ No newline at end of file +var _0x6d40=['erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','inuse','busy','invalid','ringinuse','wav','wav49','gsm','name','monitor_format','inbound','waiting','talking','total','answered','sumHoldTime','sumBillable','unmanaged','abandoned','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialCutDigit','strategy','rrmemory','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalPauses','predictiveIntervalAvailable','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0x6d40,0xf3));var _0x06d4=function(_0x4656ef,_0x373931){_0x4656ef=_0x4656ef-0x0;var _0x48f9cd=_0x6d40[_0x4656ef];return _0x48f9cd;};'use strict';var statusDesc=[_0x06d4('0x0'),'not_inuse',_0x06d4('0x1'),_0x06d4('0x2'),_0x06d4('0x3'),'unavailable','ringing',_0x06d4('0x4'),'onhold'];var monitorFormat={'wav':_0x06d4('0x5'),'wav49':_0x06d4('0x6'),'gsm':_0x06d4('0x7')};var strategy={'rrmemory':'rrmemory','roundrobin':'roundrobin'};function VoiceQueue(_0x1594f7){this['id']=_0x1594f7['id']||0x0;this[_0x06d4('0x8')]=_0x1594f7[_0x06d4('0x8')]||'';this['monitor_format']=_0x1594f7[_0x06d4('0x9')]||'';this['type']=_0x1594f7['type']||_0x06d4('0xa');this[_0x06d4('0xb')]=0x0;this[_0x06d4('0xc')]=0x0;this[_0x06d4('0xd')]=0x0;this[_0x06d4('0xe')]=0x0;this['sumDuration']=0x0;this[_0x06d4('0xf')]=0x0;this[_0x06d4('0x10')]=0x0;this[_0x06d4('0x11')]=0x0;this[_0x06d4('0x12')]=0x0;this['loggedIn']=0x0;this['available']=0x0;this[_0x06d4('0x13')]=_0x1594f7[_0x06d4('0x13')]||![];this[_0x06d4('0x14')]=_0x1594f7['acwTimeout']||0xa;this[_0x06d4('0x15')]=_0x1594f7[_0x06d4('0x15')]||'no';this[_0x06d4('0x16')]=!![];this[_0x06d4('0x17')]='';this[_0x06d4('0x18')]=0x0;this[_0x06d4('0x19')]=0x0;this[_0x06d4('0x1a')]=_0x1594f7['dialTimezone']||null;this[_0x06d4('0x1b')]=_0x1594f7['dialGlobalInterval']?_0x1594f7['dialGlobalInterval']:null;this[_0x06d4('0x1c')]=_0x1594f7['dialActive'];this[_0x06d4('0x1d')]=_0x1594f7[_0x06d4('0x1d')]||'progressive';this['dialLimitChannel']=_0x1594f7['dialLimitChannel']||0x0;this['dialLimitQueue']=_0x1594f7[_0x06d4('0x1e')]||0x0;this['dialPowerLevel']=_0x1594f7[_0x06d4('0x1f')]||0x1;this[_0x06d4('0x20')]=_0x1594f7[_0x06d4('0x20')]||_0x06d4('0x21');this[_0x06d4('0x22')]=_0x1594f7[_0x06d4('0x22')]||0.03;this[_0x06d4('0x23')]=_0x1594f7[_0x06d4('0x23')]||0x258;this['dialOriginateCallerIdName']=_0x1594f7[_0x06d4('0x24')]||_0x06d4('0x25');this[_0x06d4('0x26')]=_0x1594f7[_0x06d4('0x26')]||_0x06d4('0x25');this[_0x06d4('0x27')]=_0x1594f7[_0x06d4('0x27')]||0x1e;this[_0x06d4('0x28')]=_0x1594f7[_0x06d4('0x28')]||_0x06d4('0x29');this[_0x06d4('0x2a')]=_0x1594f7[_0x06d4('0x2a')]||0x3;this[_0x06d4('0x2b')]=_0x1594f7[_0x06d4('0x2b')]||undefined;this[_0x06d4('0x2c')]=_0x1594f7['dialCongestionMaxRetry']||0x3;this['dialCongestionRetryFrequency']=_0x1594f7[_0x06d4('0x2d')]||0x96;this[_0x06d4('0x2e')]=_0x1594f7[_0x06d4('0x2e')]||0x3;this[_0x06d4('0x2f')]=_0x1594f7[_0x06d4('0x2f')]||0x96;this[_0x06d4('0x30')]=_0x1594f7['dialNoAnswerMaxRetry']||0x3;this[_0x06d4('0x31')]=_0x1594f7[_0x06d4('0x31')]||0x96;this[_0x06d4('0x32')]=_0x1594f7['dialNoSuchNumberMaxRetry']||0x3;this['dialNoSuchNumberRetryFrequency']=_0x1594f7[_0x06d4('0x33')]||0x96;this[_0x06d4('0x34')]=_0x1594f7[_0x06d4('0x34')]||0x3;this[_0x06d4('0x35')]=_0x1594f7['dialDropRetryFrequency']||0x96;this['dialAbandonedMaxRetry']=_0x1594f7[_0x06d4('0x36')]||0x3;this['dialAbandonedRetryFrequency']=_0x1594f7[_0x06d4('0x37')]||0x96;this[_0x06d4('0x38')]=_0x1594f7[_0x06d4('0x38')]||0x3;this[_0x06d4('0x39')]=_0x1594f7['dialMachineRetryFrequency']||0x96;this[_0x06d4('0x3a')]=_0x1594f7['dialAgentRejectMaxRetry']||0x3;this[_0x06d4('0x3b')]=_0x1594f7[_0x06d4('0x3b')]||0x96;this[_0x06d4('0x3c')]=_0x1594f7['callAdditionalPhoneAfterMin']||0x3;this[_0x06d4('0x3d')]=_0x1594f7['dialGlobalMaxRetry']||0x4;this[_0x06d4('0x3e')]=_0x1594f7[_0x06d4('0x3e')]?_0x1594f7['Trunk']:undefined;this[_0x06d4('0x3f')]=_0x1594f7[_0x06d4('0x3f')]?_0x1594f7[_0x06d4('0x3f')]:undefined;this['dialPrefix']=_0x1594f7[_0x06d4('0x40')]||undefined;this[_0x06d4('0x41')]=_0x1594f7[_0x06d4('0x41')]?_0x1594f7[_0x06d4('0x41')]:undefined;this[_0x06d4('0x42')]=_0x1594f7[_0x06d4('0x42')]||_0x06d4('0x43');this['dialRandomLastDigitCallerIdNumber']=_0x1594f7['dialRandomLastDigitCallerIdNumber']||undefined;this['dialCutDigit']=_0x1594f7[_0x06d4('0x44')]||undefined;this[_0x06d4('0x45')]=strategy[_0x1594f7[_0x06d4('0x45')]]||_0x06d4('0x46');this[_0x06d4('0x47')]=!![];this['dialAMDActive']=_0x1594f7[_0x06d4('0x48')]||![];this['dialAMDInitialSilence']=_0x1594f7[_0x06d4('0x49')];this[_0x06d4('0x4a')]=_0x1594f7[_0x06d4('0x4a')];this[_0x06d4('0x4b')]=_0x1594f7[_0x06d4('0x4b')];this[_0x06d4('0x4c')]=_0x1594f7[_0x06d4('0x4c')];this[_0x06d4('0x4d')]=_0x1594f7[_0x06d4('0x4d')];this[_0x06d4('0x4e')]=_0x1594f7['dialAMDBetweenWordsSilence'];this['dialAMDMaximumNumberOfWords']=_0x1594f7['dialAMDMaximumNumberOfWords'];this[_0x06d4('0x4f')]=_0x1594f7[_0x06d4('0x4f')];this['dialAMDMaximumWordLength']=_0x1594f7[_0x06d4('0x50')];this[_0x06d4('0x51')]=0x0;this[_0x06d4('0x52')]=0x0;this[_0x06d4('0x53')]=_0x1594f7[_0x06d4('0x53')];this[_0x06d4('0x54')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0x06d4('0x55')]=0x0;this[_0x06d4('0x56')]=0x0;this[_0x06d4('0x57')]=0x0;this[_0x06d4('0x58')]=0x0;this[_0x06d4('0x59')]=0x0;this[_0x06d4('0x5a')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0x06d4('0x5b')]=0x0;this[_0x06d4('0x5c')]=0x0;this[_0x06d4('0x5d')]=0x0;this['outboundAbandonedDay']=0x0;this['startProgressive']=undefined;this[_0x06d4('0x5e')]=undefined;this[_0x06d4('0x5f')]=undefined;this[_0x06d4('0x60')]=1.05;this[_0x06d4('0x61')]=0x0;this[_0x06d4('0x62')]=0x0;this[_0x06d4('0x63')]=0x0;this[_0x06d4('0x64')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this['predictiveIntervalAvgTalktime']=0x0;this[_0x06d4('0x65')]=0x0;this[_0x06d4('0x66')]=0x0;this['predictiveIntervalMaxThreshold']=_0x1594f7[_0x06d4('0x67')]||0x14;this[_0x06d4('0x68')]=_0x1594f7[_0x06d4('0x67')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0x06d4('0x69')]=0x0;this[_0x06d4('0x6a')]=0x1;this[_0x06d4('0x6b')]=0x0;this['erlangCallToSecond']=0x0;this[_0x06d4('0x6c')]=0x0;this[_0x06d4('0x6d')]=0x0;this['dialRecallMeTimeout']=_0x1594f7[_0x06d4('0x6e')]||0x1e;this[_0x06d4('0x6f')]=_0x1594f7[_0x06d4('0x6f')]||![];this[_0x06d4('0x70')]=_0x1594f7[_0x06d4('0x70')]||undefined;this['dialAgiAfterHangupClient']=_0x1594f7['dialAgiAfterHangupClient']||![];this[_0x06d4('0x71')]=_0x1594f7[_0x06d4('0x71')]||![];this['monitor_format']=monitorFormat[_0x1594f7[_0x06d4('0x9')]]?monitorFormat[_0x1594f7[_0x06d4('0x9')]]:undefined;this[_0x06d4('0x72')]=_0x1594f7[_0x06d4('0x72')]||![];this['mandatoryDispositionPause']=_0x1594f7[_0x06d4('0x73')]?_0x1594f7[_0x06d4('0x73')]:undefined;}module[_0x06d4('0x74')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 146073b..2ca243d 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 _0x7c53=['remoteUri','serverUrl','Configurations','name','accessKey'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x7c53,0x1e8));var _0x37c5=function(_0x550cbd,_0xdf16a1){_0x550cbd=_0x550cbd-0x0;var _0x2932d2=_0x7c53[_0x550cbd];return _0x2932d2;};'use strict';function VtigerAccount(_0x4a6ad4){this['id']=_0x4a6ad4['id']||0x0;this[_0x37c5('0x0')]=_0x4a6ad4[_0x37c5('0x0')]||'';this['username']=_0x4a6ad4['username']||'';this['accessKey']=_0x4a6ad4[_0x37c5('0x1')]||'';this[_0x37c5('0x2')]=_0x4a6ad4['remoteUri']||'';this['serverUrl']=_0x4a6ad4[_0x37c5('0x3')]||'';this[_0x37c5('0x4')]=_0x4a6ad4[_0x37c5('0x4')]||{};}module['exports']=VtigerAccount; \ No newline at end of file +var _0xb15a=['exports','name','username','accessKey','remoteUri','serverUrl','Configurations'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0xb15a,0x197));var _0xab15=function(_0x3a8db5,_0x31cff7){_0x3a8db5=_0x3a8db5-0x0;var _0x2c03cd=_0xb15a[_0x3a8db5];return _0x2c03cd;};'use strict';function VtigerAccount(_0x2051ab){this['id']=_0x2051ab['id']||0x0;this[_0xab15('0x0')]=_0x2051ab[_0xab15('0x0')]||'';this['username']=_0x2051ab[_0xab15('0x1')]||'';this['accessKey']=_0x2051ab[_0xab15('0x2')]||'';this['remoteUri']=_0x2051ab[_0xab15('0x3')]||'';this[_0xab15('0x4')]=_0x2051ab[_0xab15('0x4')]||'';this[_0xab15('0x5')]=_0x2051ab['Configurations']||{};}module[_0xab15('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 9c605d7..b22872b 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 _0x9a81=['integrationTab','serverUrl','Configurations','exports','name','username','password','token','remoteUri','authType','type'];(function(_0x3165e5,_0x188677){var _0x4f75f4=function(_0x229836){while(--_0x229836){_0x3165e5['push'](_0x3165e5['shift']());}};_0x4f75f4(++_0x188677);}(_0x9a81,0xa9));var _0x19a8=function(_0x32af09,_0x5a39a2){_0x32af09=_0x32af09-0x0;var _0xe8f9d5=_0x9a81[_0x32af09];return _0xe8f9d5;};'use strict';function ZendeskAccount(_0x1a442d){this['id']=_0x1a442d['id']||0x0;this[_0x19a8('0x0')]=_0x1a442d[_0x19a8('0x0')]||'';this[_0x19a8('0x1')]=_0x1a442d['username']||'';this[_0x19a8('0x2')]=_0x1a442d[_0x19a8('0x2')]||'';this[_0x19a8('0x3')]=_0x1a442d[_0x19a8('0x3')]||'';this[_0x19a8('0x4')]=_0x1a442d[_0x19a8('0x4')]||'';this[_0x19a8('0x5')]=_0x1a442d['authType']||'';this[_0x19a8('0x6')]=_0x1a442d[_0x19a8('0x6')]||_0x19a8('0x7');this[_0x19a8('0x8')]=_0x1a442d[_0x19a8('0x8')]||'';this['Configurations']=_0x1a442d[_0x19a8('0x9')]||{};}module[_0x19a8('0xa')]=ZendeskAccount; \ No newline at end of file +var _0x4cae=['exports','name','username','password','token','remoteUri','authType','type','serverUrl','Configurations'];(function(_0x24cc72,_0x4dc73a){var _0xd49f1e=function(_0x39f581){while(--_0x39f581){_0x24cc72['push'](_0x24cc72['shift']());}};_0xd49f1e(++_0x4dc73a);}(_0x4cae,0xb5));var _0xe4ca=function(_0x465ef8,_0x5cf5e5){_0x465ef8=_0x465ef8-0x0;var _0x3ba994=_0x4cae[_0x465ef8];return _0x3ba994;};'use strict';function ZendeskAccount(_0xe4bef9){this['id']=_0xe4bef9['id']||0x0;this[_0xe4ca('0x0')]=_0xe4bef9[_0xe4ca('0x0')]||'';this[_0xe4ca('0x1')]=_0xe4bef9[_0xe4ca('0x1')]||'';this[_0xe4ca('0x2')]=_0xe4bef9[_0xe4ca('0x2')]||'';this['token']=_0xe4bef9[_0xe4ca('0x3')]||'';this[_0xe4ca('0x4')]=_0xe4bef9[_0xe4ca('0x4')]||'';this['authType']=_0xe4bef9[_0xe4ca('0x5')]||'';this['type']=_0xe4bef9[_0xe4ca('0x6')]||'integrationTab';this[_0xe4ca('0x7')]=_0xe4bef9[_0xe4ca('0x7')]||'';this[_0xe4ca('0x8')]=_0xe4bef9[_0xe4ca('0x8')]||{};}module[_0xe4ca('0x9')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 4cc34d2..721b470 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 _0xfdea=['zone','clientId','clientSecret','code','refreshToken','Configurations','exports','name','description','host'];(function(_0x9edfd5,_0x286486){var _0x330738=function(_0x4aceb3){while(--_0x4aceb3){_0x9edfd5['push'](_0x9edfd5['shift']());}};_0x330738(++_0x286486);}(_0xfdea,0xb1));var _0xafde=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0xfdea[_0xb0f7c3];return _0x28ea68;};'use strict';function ZohoAccount(_0x40dce5){this['id']=_0x40dce5['id']||0x0;this[_0xafde('0x0')]=_0x40dce5[_0xafde('0x0')]||'';this['description']=_0x40dce5[_0xafde('0x1')]||'';this[_0xafde('0x2')]=_0x40dce5[_0xafde('0x2')]||'';this[_0xafde('0x3')]=_0x40dce5[_0xafde('0x3')]||'';this[_0xafde('0x4')]=_0x40dce5['clientId']||'';this[_0xafde('0x5')]=_0x40dce5[_0xafde('0x5')]||'';this['serverUrl']=_0x40dce5['serverUrl']||'';this['code']=_0x40dce5[_0xafde('0x6')]||'';this[_0xafde('0x7')]=_0x40dce5[_0xafde('0x7')]||'';this[_0xafde('0x8')]=_0x40dce5[_0xafde('0x8')]||{};}module[_0xafde('0x9')]=ZohoAccount; \ No newline at end of file +var _0xffeb=['zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports','name','description','host'];(function(_0x138c6e,_0xd2dfc4){var _0xee6309=function(_0x238e7d){while(--_0x238e7d){_0x138c6e['push'](_0x138c6e['shift']());}};_0xee6309(++_0xd2dfc4);}(_0xffeb,0xad));var _0xbffe=function(_0x1875c8,_0x4e5f7a){_0x1875c8=_0x1875c8-0x0;var _0x28ed91=_0xffeb[_0x1875c8];return _0x28ed91;};'use strict';function ZohoAccount(_0x15bf28){this['id']=_0x15bf28['id']||0x0;this['name']=_0x15bf28[_0xbffe('0x0')]||'';this[_0xbffe('0x1')]=_0x15bf28[_0xbffe('0x1')]||'';this[_0xbffe('0x2')]=_0x15bf28[_0xbffe('0x2')]||'';this[_0xbffe('0x3')]=_0x15bf28[_0xbffe('0x3')]||'';this[_0xbffe('0x4')]=_0x15bf28[_0xbffe('0x4')]||'';this['clientSecret']=_0x15bf28[_0xbffe('0x5')]||'';this[_0xbffe('0x6')]=_0x15bf28['serverUrl']||'';this[_0xbffe('0x7')]=_0x15bf28['code']||'';this[_0xbffe('0x8')]=_0x15bf28[_0xbffe('0x8')]||'';this['Configurations']=_0x15bf28[_0xbffe('0x9')]||{};}module[_0xbffe('0xa')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 09872b6..2659ef0 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 _0xeb3b=['Contact','lastName','active','calleridnum','scheduledat','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','calleridname','number','util','lodash','moment','isNil','uniqueid','queue','name','type','campaigntype','dialAnswer','Agent','channelAgent','membername','format','SIP/%s','phone'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xeb3b,0x19e));var _0xbeb3=function(_0x19ef2b,_0x354f66){_0x19ef2b=_0x19ef2b-0x0;var _0x4df537=_0xeb3b[_0x19ef2b];return _0x4df537;};'use strict';var util=require(_0xbeb3('0x0'));var _=require(_0xbeb3('0x1'));var moment=require(_0xbeb3('0x2'));function checkNameSurname(_0x33e049,_0xba125a,_0x565c41){var _0x5df0cb='';if(!_[_0xbeb3('0x3')](_0xba125a)&&'string'===typeof _0xba125a){_0x5df0cb+=_0xba125a;}if(!_[_0xbeb3('0x3')](_0x565c41)&&'string'===typeof _0x565c41){_0x5df0cb+='\x20'+_0x565c41;}if(_0x5df0cb!==''){return _0x5df0cb;}return _0x33e049;}function Action(_0x2e8a69,_0x5ae6f9,_0x8d8cce,_0x294cc9,_0x406927){this[_0xbeb3('0x4')]=_0x8d8cce||undefined;this['idContact']=_0x2e8a69['id'];this[_0xbeb3('0x5')]=_0x5ae6f9[_0xbeb3('0x6')];this[_0xbeb3('0x7')]=_0x5ae6f9[_0xbeb3('0x7')];this[_0xbeb3('0x8')]=_0xbeb3('0x5');this[_0xbeb3('0x9')]=![];this['membername']=_[_0xbeb3('0x3')](_0x2e8a69[_0xbeb3('0xa')])?undefined:_0x2e8a69['Agent'][_0xbeb3('0x6')];this[_0xbeb3('0xb')]=this[_0xbeb3('0xc')]?util[_0xbeb3('0xd')](_0xbeb3('0xe'),this[_0xbeb3('0xc')]):_0x294cc9||undefined;this['calleridname']=checkNameSurname(_0x2e8a69['Contact'][_0xbeb3('0xf')],_0x2e8a69[_0xbeb3('0x10')]['firstName'],_0x2e8a69['Contact'][_0xbeb3('0x11')]);this[_0xbeb3('0x12')]=_0x2e8a69[_0xbeb3('0x12')]||![];this[_0xbeb3('0x13')]=_0x2e8a69[_0xbeb3('0xf')];this['scheduledat']=_0x2e8a69[_0xbeb3('0x14')];this['countbusyretry']=_0x2e8a69[_0xbeb3('0x15')]||0x0;this['countcongestionretry']=_0x2e8a69['countcongestionretry']||0x0;this['countnoanswerretry']=_0x2e8a69[_0xbeb3('0x16')]||0x0;this[_0xbeb3('0x17')]=(_0x2e8a69[_0xbeb3('0x15')]||0x0)+(_0x2e8a69[_0xbeb3('0x18')]||0x0)+(_0x2e8a69['countnoanswerretry']||0x0)+(_0x2e8a69[_0xbeb3('0x19')]||0x0)+(_0x2e8a69[_0xbeb3('0x1a')]||0x0)+(_0x2e8a69[_0xbeb3('0x1b')]||0x0)+(_0x2e8a69['countmachineretry']||0x0)+(_0x2e8a69['countagentrejectretry']||0x0);this[_0xbeb3('0x19')]=_0x2e8a69['countnosuchnumberretry']||0x0;this[_0xbeb3('0x1a')]=_0x2e8a69['countdropretry']||0x0;this['countabandonedretry']=_0x2e8a69[_0xbeb3('0x1b')]||0x0;this[_0xbeb3('0x1c')]=_0x2e8a69[_0xbeb3('0x1c')]||0x0;this['countagentrejectretry']=_0x2e8a69[_0xbeb3('0x1d')]||0x0;this[_0xbeb3('0x1e')]=_0x2e8a69['callback'];this[_0xbeb3('0x1f')]=_0x2e8a69[_0xbeb3('0x1f')];this['callbackat']=_0x2e8a69[_0xbeb3('0x20')];this[_0xbeb3('0x21')]=_0x2e8a69[_0xbeb3('0x21')];this[_0xbeb3('0x22')]=_0x2e8a69[_0xbeb3('0x22')];this[_0xbeb3('0x23')]=_0x2e8a69[_0xbeb3('0x23')];this[_0xbeb3('0x24')]=_[_0xbeb3('0x3')](_0x2e8a69['Agent'])?_0x2e8a69['UserId']:_0x2e8a69[_0xbeb3('0xa')]['id'];this['VoiceQueueId']=_0x2e8a69[_0xbeb3('0x25')];this[_0xbeb3('0x26')]='';this[_0xbeb3('0x27')]='';}Action[_0xbeb3('0x28')]['getCaller']=function(){return util[_0xbeb3('0xd')]('\x22%s\x22\x20<%s>',this[_0xbeb3('0x29')],this[_0xbeb3('0x2a')]);};module['exports']=Action; \ No newline at end of file +var _0x6a55=['countagentrejectretry','countnosuchnumberretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','prototype','\x22%s\x22\x20<%s>','number','util','isNil','uniqueid','idContact','queue','type','campaigntype','dialAnswer','membername','Agent','format','SIP/%s','calleridname','Contact','firstName','lastName','active','calleridnum','phone','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry'];(function(_0x28fe94,_0x120b9b){var _0x3560da=function(_0x4d4e25){while(--_0x4d4e25){_0x28fe94['push'](_0x28fe94['shift']());}};_0x3560da(++_0x120b9b);}(_0x6a55,0xdb));var _0x56a5=function(_0x188d31,_0x576e87){_0x188d31=_0x188d31-0x0;var _0x30ed33=_0x6a55[_0x188d31];return _0x30ed33;};'use strict';var util=require(_0x56a5('0x0'));var _=require('lodash');var moment=require('moment');function checkNameSurname(_0x4ec858,_0x173b37,_0x47b337){var _0x561353='';if(!_[_0x56a5('0x1')](_0x173b37)&&'string'===typeof _0x173b37){_0x561353+=_0x173b37;}if(!_[_0x56a5('0x1')](_0x47b337)&&'string'===typeof _0x47b337){_0x561353+='\x20'+_0x47b337;}if(_0x561353!==''){return _0x561353;}return _0x4ec858;}function Action(_0x28bb2b,_0x380b1b,_0x42d164,_0x293ea1,_0x444c65){this[_0x56a5('0x2')]=_0x42d164||undefined;this[_0x56a5('0x3')]=_0x28bb2b['id'];this[_0x56a5('0x4')]=_0x380b1b['name'];this[_0x56a5('0x5')]=_0x380b1b[_0x56a5('0x5')];this[_0x56a5('0x6')]=_0x56a5('0x4');this[_0x56a5('0x7')]=![];this[_0x56a5('0x8')]=_[_0x56a5('0x1')](_0x28bb2b[_0x56a5('0x9')])?undefined:_0x28bb2b[_0x56a5('0x9')]['name'];this['channelAgent']=this[_0x56a5('0x8')]?util[_0x56a5('0xa')](_0x56a5('0xb'),this[_0x56a5('0x8')]):_0x293ea1||undefined;this[_0x56a5('0xc')]=checkNameSurname(_0x28bb2b[_0x56a5('0xd')]['phone'],_0x28bb2b['Contact'][_0x56a5('0xe')],_0x28bb2b[_0x56a5('0xd')][_0x56a5('0xf')]);this[_0x56a5('0x10')]=_0x28bb2b[_0x56a5('0x10')]||![];this[_0x56a5('0x11')]=_0x28bb2b[_0x56a5('0x12')];this['scheduledat']=_0x28bb2b[_0x56a5('0x13')];this['countbusyretry']=_0x28bb2b[_0x56a5('0x14')]||0x0;this['countcongestionretry']=_0x28bb2b[_0x56a5('0x15')]||0x0;this[_0x56a5('0x16')]=_0x28bb2b[_0x56a5('0x16')]||0x0;this[_0x56a5('0x17')]=(_0x28bb2b[_0x56a5('0x14')]||0x0)+(_0x28bb2b[_0x56a5('0x15')]||0x0)+(_0x28bb2b[_0x56a5('0x16')]||0x0)+(_0x28bb2b['countnosuchnumberretry']||0x0)+(_0x28bb2b[_0x56a5('0x18')]||0x0)+(_0x28bb2b[_0x56a5('0x19')]||0x0)+(_0x28bb2b[_0x56a5('0x1a')]||0x0)+(_0x28bb2b[_0x56a5('0x1b')]||0x0);this['countnosuchnumberretry']=_0x28bb2b[_0x56a5('0x1c')]||0x0;this[_0x56a5('0x18')]=_0x28bb2b[_0x56a5('0x18')]||0x0;this[_0x56a5('0x19')]=_0x28bb2b[_0x56a5('0x19')]||0x0;this['countmachineretry']=_0x28bb2b['countmachineretry']||0x0;this[_0x56a5('0x1b')]=_0x28bb2b[_0x56a5('0x1b')]||0x0;this['callback']=_0x28bb2b[_0x56a5('0x1d')];this[_0x56a5('0x1e')]=_0x28bb2b[_0x56a5('0x1e')];this[_0x56a5('0x1f')]=_0x28bb2b[_0x56a5('0x1f')];this[_0x56a5('0x20')]=_0x28bb2b[_0x56a5('0x20')];this[_0x56a5('0x21')]=_0x28bb2b[_0x56a5('0x21')];this[_0x56a5('0x22')]=_0x28bb2b[_0x56a5('0x22')];this[_0x56a5('0x23')]=_[_0x56a5('0x1')](_0x28bb2b['Agent'])?_0x28bb2b[_0x56a5('0x23')]:_0x28bb2b[_0x56a5('0x9')]['id'];this[_0x56a5('0x24')]=_0x28bb2b[_0x56a5('0x24')];this[_0x56a5('0x25')]='';this['originatecalleridname']='';}Action[_0x56a5('0x26')]['getCaller']=function(){return util[_0x56a5('0xa')](_0x56a5('0x27'),this[_0x56a5('0xc')],this[_0x56a5('0x28')]);};module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index c2cb4c9..e87e095 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 _0x4d56=['outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','message','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','stringify','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','format','sendMessageOneNotActive','pTalking','paused','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','loopCampaigns','syncCampaigns','clockClearZombieChannels','hasOwnProperty','booked','clearZombieChannels','setMessage','recallMe','isNil','actions','queue','pTalking:\x20','dialAnswer','pick','contactId','UserId','ListId','Action','channel','No\x20such\x20channel','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','size','clearZombieChannel','getContactRecallMe','agentReadyId','then','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','catch','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','createCustomerFinal','[HistoryRecallClose]','[getContactRecallMe]','IsNotLoggedIn','loggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','ACTIVE','callProgressDetectingCustomer','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','dialNoSuchNumberRetryFrequency','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','countnosuchnumberretry','rescheduleContact','unlockAgent','activeContact','linkedid','actioncountonusuch','idContact','incrementPreviewCounters','swapAdditionalPhones','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','[16]','countglobal','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','talktime','sumBillable','BUSY','outboundBusyCallsDay','countbusyretry','Busy','dialBusyRetryFrequency','callAdditionalPhoneAfterMin','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','additional','dialBusyMaxRetry','NOANSWER','dialNoAnswerRetryFrequency','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','scheduledAt','CONGESTION','countcongestionretry','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','CANCEL','countagentrejectretry','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','AgentReject','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectRetryFrequency','countnoanswerretry','ABANDONED','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedRetryFrequency','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','originated:\x20','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','NoAnswer','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','resolve','[swapAdditionalPhone]\x20','[incrementPreviewCounters]\x20','checkInBlack','Contact','VoiceQueueId','Contact\x20is\x20undefined','Queue','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','Calling','[Preview][execCall][failure]','Call\x20failed','outboundBlacklistCallsDay','logBlacklist','createHistory','SIP/%s','status','unmonitored','execRun','unlock','getContactPreview','recallme','validateContact','isValid','phone','Call\x20unsuccessful','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','SIP/%s/%s%s','trim','dialCutDigit','substring','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variablesAction','channelAgent','destconnectedlinenum','calleridnum','user:agentconnect','accountcode','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','syncOriginateResponse','actionid','logLookAgent','clone','unlockContact','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','syncHangup','[syncHangup][talking]','cause','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','destlinkedid','variables','filterKey','variable','addVariable','keys','value','error','[syncVarSet][Preview]','transfertargetlinkedid','syncBlindTransfer','transfererlinkedid','util','lodash','bluebird','moment','md5','ioredis','../../../config/logger','preview','actionPreview','../ami','./rpcDb','../rpc/cmHopperAdditionalPhone','./util/util','redis','localhost','prototype','enqueue','tail','finally','sequence','campaignsPreview','trunks','agents','originateresponse','hangup','bind','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','syncAttendedTransfer','blindtransfer','emit','outbound','name','strategy','answered','available','sumDuration','talking','total','type','unmanaged','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit'];(function(_0x2160a9,_0x3cbd9e){var _0xa88cf7=function(_0x51ab6f){while(--_0x51ab6f){_0x2160a9['push'](_0x2160a9['shift']());}};_0xa88cf7(++_0x3cbd9e);}(_0x4d56,0x129));var _0x64d5=function(_0x33c118,_0x4ddfbd){_0x33c118=_0x33c118-0x0;var _0x1389a9=_0x4d56[_0x33c118];return _0x1389a9;};'use strict';var util=require(_0x64d5('0x0'));var _=require(_0x64d5('0x1'));var BPromise=require(_0x64d5('0x2'));var uuid=require('uuid');var moment=require(_0x64d5('0x3'));var md5=require(_0x64d5('0x4'));var Redis=require(_0x64d5('0x5'));var config=require('../../../config/environment');var logger=require(_0x64d5('0x6'))(_0x64d5('0x7'));var loggerAction=require('../../../config/logger')(_0x64d5('0x8'));var ami=require(_0x64d5('0x9'));var rpcDb=require(_0x64d5('0xa'));var cmHopperAdditionalPhone=require(_0x64d5('0xb'));var Action=require('./action');var ut=require(_0x64d5('0xc'));config['redis']=_['defaults'](config[_0x64d5('0xd')],{'host':_0x64d5('0xe'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x64d5('0xd')]));var Sequence=function(){};Sequence[_0x64d5('0xf')][_0x64d5('0x10')]=function(_0x2e7dfe){this[_0x64d5('0x11')]=this[_0x64d5('0x11')]?this[_0x64d5('0x11')][_0x64d5('0x12')](_0x2e7dfe):_0x2e7dfe();};function Preview(_0x23de0f){this[_0x64d5('0x13')]=new Sequence();this[_0x64d5('0x14')]=_0x23de0f['voiceQueues'];this[_0x64d5('0x15')]=_0x23de0f[_0x64d5('0x15')];this['actions']={};this[_0x64d5('0x16')]=_0x23de0f[_0x64d5('0x16')];this['clockClearZombieChannels']=0x0;ami['on'](_0x64d5('0x17'),this['syncOriginateResponse']['bind'](this));ami['on'](_0x64d5('0x18'),this['syncHangup'][_0x64d5('0x19')](this));ami['on'](_0x64d5('0x1a'),this[_0x64d5('0x1b')]['bind'](this));ami['on'](_0x64d5('0x1c'),this[_0x64d5('0x1d')][_0x64d5('0x19')](this));ami['on'](_0x64d5('0x1e'),this[_0x64d5('0x1f')][_0x64d5('0x19')](this));ami['on'](_0x64d5('0x20'),this[_0x64d5('0x21')][_0x64d5('0x19')](this));ami['on']('attendedtransfer',this[_0x64d5('0x22')][_0x64d5('0x19')](this));ami['on'](_0x64d5('0x23'),this['syncBlindTransfer'][_0x64d5('0x19')](this));this['loopCampaigns'](this[_0x64d5('0x14')]);}function emit(_0x3c5ea1,_0x1b72e1,_0x2a70c2){io['to'](_0x3c5ea1)[_0x64d5('0x24')](_0x1b72e1,_0x2a70c2);}function emitCampaignPreview(_0x5247c6){if(_0x5247c6['type']===_0x64d5('0x25')){var _0x27e27={'id':_0x5247c6['id'],'name':_0x5247c6[_0x64d5('0x26')],'strategy':_0x5247c6[_0x64d5('0x27')],'answered':_0x5247c6[_0x64d5('0x28')],'available':_0x5247c6[_0x64d5('0x29')],'loggedIn':_0x5247c6['loggedIn'],'pTalking':_0x5247c6['pTalking'],'sumBillable':_0x5247c6['sumBillable'],'sumDuration':_0x5247c6[_0x64d5('0x2a')],'sumHoldTime':_0x5247c6['sumHoldTime']||0x0,'talking':_0x5247c6[_0x64d5('0x2b')],'total':_0x5247c6[_0x64d5('0x2c')],'type':_0x5247c6[_0x64d5('0x2d')],'unmanaged':_0x5247c6[_0x64d5('0x2e')],'abandoned':_0x5247c6['abandoned'],'waiting':_0x5247c6[_0x64d5('0x2f')],'loggedInDb':_0x5247c6[_0x64d5('0x30')],'dialActive':_0x5247c6[_0x64d5('0x31')],'dialMethod':_0x5247c6[_0x64d5('0x32')],'dialOriginateCallerIdName':_0x5247c6[_0x64d5('0x33')],'dialOriginateCallerIdNumber':_0x5247c6[_0x64d5('0x34')],'dialOriginateTimeout':_0x5247c6[_0x64d5('0x35')],'dialPrefix':_0x5247c6[_0x64d5('0x36')],'outboundAnswerAgiCallsDay':_0x5247c6[_0x64d5('0x37')],'outboundAnswerCallsDay':_0x5247c6[_0x64d5('0x38')],'outboundBlacklistCallsDay':_0x5247c6['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x5247c6['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x5247c6[_0x64d5('0x39')],'outboundDropCallsDayACS':_0x5247c6[_0x64d5('0x3a')],'outboundDropCallsDayCallersExit':_0x5247c6[_0x64d5('0x3b')],'outboundDropCallsDayTimeout':_0x5247c6[_0x64d5('0x3c')],'outboundNoAnswerCallsDay':_0x5247c6[_0x64d5('0x3d')],'outboundNoSuchCallsDay':_0x5247c6[_0x64d5('0x3e')],'outboundOriginateFailureCallsDay':_0x5247c6['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x5247c6['outboundReCallsDay'],'outboundRejectCallsDay':_0x5247c6[_0x64d5('0x3f')],'outboundUnknownCallsDay':_0x5247c6[_0x64d5('0x40')],'outboundAbandonedCallsDay':_0x5247c6[_0x64d5('0x41')],'predictiveIntervalAnsweredCalls':_0x5247c6['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x5247c6[_0x64d5('0x42')],'predictiveIntervalAvgTalktime':_0x5247c6[_0x64d5('0x43')],'predictiveIntervalDroppedCallsCallersExit':_0x5247c6['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x5247c6['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x5247c6['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x5247c6[_0x64d5('0x44')],'predictiveIntervalHitRate':_0x5247c6['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x5247c6[_0x64d5('0x45')],'predictiveIntervalPauses':_0x5247c6['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x5247c6['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x5247c6[_0x64d5('0x46')],'message':_0x5247c6[_0x64d5('0x47')],'originated':_0x5247c6[_0x64d5('0x48')],'erlangCalls':_0x5247c6['erlangCalls'],'erlangCallToSecond':_0x5247c6[_0x64d5('0x49')],'erlangAbandonmentRate':_0x5247c6[_0x64d5('0x4a')],'erlangBusyFactor':_0x5247c6[_0x64d5('0x4b')],'startPredictive':_0x5247c6[_0x64d5('0x4c')],'startProgressive':_0x5247c6[_0x64d5('0x4d')]};if(_0x5247c6[_0x64d5('0x4e')]){_0x27e27['Trunk']={'id':_0x5247c6[_0x64d5('0x4e')]['id'],'name':_0x5247c6['Trunk'][_0x64d5('0x26')],'active':_0x5247c6[_0x64d5('0x4e')][_0x64d5('0x4f')],'callerid':_0x5247c6[_0x64d5('0x4e')][_0x64d5('0x50')]};}if(_0x5247c6['Interval']){_0x27e27[_0x64d5('0x51')]={'id':_0x5247c6[_0x64d5('0x51')]['id'],'name':_0x5247c6[_0x64d5('0x51')]['name']};}var _0x3646ff=md5(JSON[_0x64d5('0x52')](_0x27e27));if(_0x5247c6['md5']!==_0x3646ff){_0x5247c6['md5']=_0x3646ff;emit(util['format'](_0x64d5('0x53'),_0x27e27[_0x64d5('0x26')]),_0x64d5('0x54'),_0x27e27);}}}function emitVoiceQueueChannelRemove(_0x3f6437){logger[_0x64d5('0x55')](_0x64d5('0x56'),JSON[_0x64d5('0x52')](_0x3f6437));emit(util[_0x64d5('0x57')](_0x64d5('0x53'),_0x3f6437[_0x64d5('0x26')]),'voice_queue_channel:remove',_0x3f6437);io[_0x64d5('0x24')]('voice_queue_presence:remove',_0x3f6437);}function notSendMessagesQueue(_0x59c29b){if(_0x59c29b[_0x64d5('0x58')]){if(_0x59c29b[_0x64d5('0x48')]===0x0&&_0x59c29b[_0x64d5('0x59')]===0x0){_0x59c29b['sendMessageOneNotActive']=![];_0x59c29b[_0x64d5('0x29')]=0x0;_0x59c29b[_0x64d5('0x5a')]=0x0;_0x59c29b[_0x64d5('0x47')]=_0x64d5('0x5b');ut[_0x64d5('0x5c')](_0x64d5('0x5d'),_0x59c29b[_0x64d5('0x26')]+_0x64d5('0x5e'));}else{_0x59c29b[_0x64d5('0x47')]=_0x64d5('0x5f');ut[_0x64d5('0x5c')](_0x64d5('0x5d'),_0x59c29b[_0x64d5('0x26')]+_0x64d5('0x60'));}emitCampaignPreview(_0x59c29b);}}Preview[_0x64d5('0xf')][_0x64d5('0x61')]=function(){var _0x380def=this;setInterval(function(){_0x380def[_0x64d5('0x62')]();},0x7cf);};Preview['prototype'][_0x64d5('0x62')]=function(){var _0x2dd40c=this[_0x64d5('0x14')];this[_0x64d5('0x63')]+=0x1;for(var _0xc4b621 in _0x2dd40c){if(_0x2dd40c[_0x64d5('0x64')](_0xc4b621)&&(_0x2dd40c[_0xc4b621]['dialMethod']===_0x64d5('0x7')||_0x2dd40c[_0xc4b621][_0x64d5('0x32')]===_0x64d5('0x65'))&&_0x2dd40c[_0xc4b621][_0x64d5('0x2d')]===_0x64d5('0x25')){if(this['clockClearZombieChannels']>0x7){this[_0x64d5('0x63')]=0x0;this[_0x64d5('0x66')]();}}if(_0x2dd40c[_0x64d5('0x64')](_0xc4b621)&&_0x2dd40c[_0xc4b621][_0x64d5('0x32')]===_0x64d5('0x7')&&_0x2dd40c[_0xc4b621][_0x64d5('0x2d')]===_0x64d5('0x25')){if(_0x2dd40c[_0xc4b621][_0x64d5('0x31')]){this[_0x64d5('0x67')](_0x2dd40c[_0xc4b621]);this[_0x64d5('0x68')](_0x2dd40c[_0xc4b621]);}else{notSendMessagesQueue(_0x2dd40c[_0xc4b621]);}}}};Preview[_0x64d5('0xf')]['clearZombieChannel']=function(_0x5065c8){var _0x26b731=this;this['sequence']['enqueue'](function(){if(!_[_0x64d5('0x69')](_0x26b731[_0x64d5('0x6a')][_0x5065c8])){loggerAction['info']('[clearZombieChannels][talking]',_0x5065c8,'Queue',_0x26b731[_0x64d5('0x6a')][_0x5065c8]['queue'],'originated:\x20',JSON[_0x64d5('0x52')](_0x26b731[_0x64d5('0x14')][_0x26b731[_0x64d5('0x6a')][_0x5065c8][_0x64d5('0x6b')]][_0x64d5('0x48')]),_0x64d5('0x6c'),JSON[_0x64d5('0x52')](_0x26b731[_0x64d5('0x14')][_0x26b731['actions'][_0x5065c8][_0x64d5('0x6b')]][_0x64d5('0x59')]),JSON['stringify'](_0x26b731[_0x64d5('0x6a')][_0x5065c8][_0x64d5('0x6d')]),JSON[_0x64d5('0x52')](_[_0x64d5('0x6e')](_0x26b731[_0x64d5('0x6a')][_0x5065c8],[_0x64d5('0x6f'),_0x64d5('0x70'),'VoiceQueueId',_0x64d5('0x71')])));return ami[_0x64d5('0x72')]({'action':'status','channel':_0x26b731[_0x64d5('0x6a')][_0x5065c8][_0x64d5('0x73')]})['catch'](function(_0x521374){if(_0x521374[_0x64d5('0x47')]===_0x64d5('0x74')){setTimeout(function(){if(_0x26b731[_0x64d5('0x6a')][_0x5065c8]){ut['updateOriginated'](_0x26b731['campaignsPreview'][_0x26b731[_0x64d5('0x6a')][_0x5065c8]['queue']],_0x64d5('0x75'));if(_0x26b731[_0x64d5('0x6a')][_0x5065c8][_0x64d5('0x6d')]===!![]){ut[_0x64d5('0x76')](_0x26b731[_0x64d5('0x14')][_0x26b731[_0x64d5('0x6a')][_0x5065c8]['queue']],_0x64d5('0x75'));ut[_0x64d5('0x77')](_0x64d5('0x78')+_0x5065c8,_0x26b731['actions'][_0x5065c8][_0x64d5('0x6b')]);}ut['loggerError'](_0x64d5('0x79')+_0x5065c8,_0x26b731['actions'][_0x5065c8][_0x64d5('0x6b')]);delete _0x26b731['actions'][_0x5065c8];}},0x2328);}});}});};Preview[_0x64d5('0xf')][_0x64d5('0x66')]=function(){var _0x2b4bac=this;loggerAction[_0x64d5('0x55')](_0x64d5('0x7a'),_[_0x64d5('0x7b')](this[_0x64d5('0x6a')]));for(var _0x324c9c in this['actions']){if(_0x2b4bac['actions']['hasOwnProperty'](_0x324c9c)){_0x2b4bac[_0x64d5('0x7c')](_0x324c9c);}}};Preview[_0x64d5('0xf')]['recallMe']=function(_0xa890d8){var _0x4a9a70=this;rpcDb[_0x64d5('0x7d')](_0xa890d8['id'],ut[_0x64d5('0x7e')](this[_0x64d5('0x16')]))[_0x64d5('0x7f')](function(_0x26e375){if(!_['isNil'](_0x26e375)){for(var _0x2aa4e5=0x0;_0x2aa4e5<_0x26e375['length'];_0x2aa4e5+=0x1){if(ut['getDiff'](_0x26e375[_0x2aa4e5][_0x64d5('0x80')])<_0xa890d8[_0x64d5('0x81')]*0x3c){if(_0x26e375[_0x2aa4e5][_0x64d5('0x82')]&&!_0x26e375[_0x2aa4e5][_0x64d5('0x82')][_0x64d5('0x83')]){_0x4a9a70[_0x64d5('0x84')](_0x26e375[_0x2aa4e5]['id'])[_0x64d5('0x7f')](ut[_0x64d5('0x85')](_0x64d5('0x86')))[_0x64d5('0x87')](ut[_0x64d5('0x85')](_0x64d5('0x86')));}else{rpcDb[_0x64d5('0x88')](_0x26e375[_0x2aa4e5]['id']);}}else{var _0x1a4f86=new Action(_0x26e375[_0x2aa4e5],_0xa890d8);_0x1a4f86[_0x64d5('0x89')]=moment()[_0x64d5('0x57')](_0x64d5('0x8a'));_0xa890d8['outboundReCallsDay']+=0x1;ut[_0x64d5('0x8b')](_0x1a4f86,0x17,_0x64d5('0x8c'));if(_0xa890d8['dialRecallInQueue']){rpcDb[_0x64d5('0x8d')](ut[_0x64d5('0x8e')](_0x26e375[_0x2aa4e5]));rpcDb[_0x64d5('0x8f')](_0x1a4f86,_0x64d5('0x90'));}else{ut[_0x64d5('0x8b')](_0x1a4f86,0x16,'RecallFailedTimeout');rpcDb['createCustomerHistory'](_0x1a4f86,'[HistoryRecallClose]');rpcDb[_0x64d5('0x91')](_0x1a4f86,_0x64d5('0x92'));}}}}})['catch'](ut[_0x64d5('0x85')](_0x64d5('0x93')));};Preview['prototype']['setMessage']=function(_0x196a0c){_0x196a0c['sendMessageOneNotActive']=!![];if(ut[_0x64d5('0x94')](_0x196a0c[_0x64d5('0x95')])){_0x196a0c[_0x64d5('0x47')]=_0x64d5('0x96');}else if(!ut[_0x64d5('0x97')](_0x196a0c[_0x64d5('0x31')])){_0x196a0c['message']=_0x64d5('0x5b');}else if(!this[_0x64d5('0x98')](_0x196a0c[_0x64d5('0x4e')])){if(!this[_0x64d5('0x98')](_0x196a0c[_0x64d5('0x99')])){_0x196a0c[_0x64d5('0x47')]='TRUNK_IS_NOT_REACHABLE';}else{_0x196a0c[_0x64d5('0x47')]=_0x64d5('0x9a');}}else{_0x196a0c[_0x64d5('0x47')]='ACTIVE';}emitCampaignPreview(_0x196a0c);};Preview[_0x64d5('0xf')][_0x64d5('0x9b')]=function(_0x4dbfe4,_0x3cc40b,_0x1e709d){var _0x7ec00b=this;var _0x4ccc79=this['actions'][_0x3cc40b];var _0x22cf37=this['campaignsPreview'][_0x4ccc79[_0x64d5('0x6b')]];var _0x5a9e97;var _0x402507=![];var _0x1cec19=0x2;var _0x53a297=0x3;if(_0x22cf37){switch(_0x1e709d){case'1':_0x22cf37[_0x64d5('0x3e')]+=0x1;_0x4ccc79['countnosuchnumberretry']+=0x1;_0x4ccc79['countglobal']=ut[_0x64d5('0x9c')](_0x4ccc79);ut[_0x64d5('0x8b')](_0x4ccc79,0x0,_0x64d5('0x9d'));ami[_0x64d5('0x24')](_0x64d5('0x9e'),ut[_0x64d5('0x9f')](_0x4ccc79,_0x64d5('0xa0')));rpcDb['createCustomerHistory'](_0x4ccc79,_0x64d5('0xa1'));_0x7ec00b[_0x64d5('0xa2')](_0x4ccc79,'0',_0x22cf37)[_0x64d5('0x7f')](function(_0x3e310a){_0x402507=_0x3e310a['additional']==0x1;_0x1cec19=_0x22cf37[_0x64d5('0xa3')];_0x53a297=_0x22cf37['callAdditionalPhoneAfterMin'];if(!_0x402507){if(ut[_0x64d5('0x9c')](_0x4ccc79)>=_0x22cf37[_0x64d5('0xa4')]){_0x5a9e97=ut[_0x64d5('0xa5')](_0x4ccc79,0xf,_0x64d5('0xa6'));rpcDb[_0x64d5('0x91')](_0x5a9e97,_0x64d5('0xa7'));}else{if(_0x4ccc79[_0x64d5('0xa8')]>=_0x22cf37['dialNoSuchNumberMaxRetry']){rpcDb[_0x64d5('0x91')](_0x4ccc79,_0x64d5('0xa7'));}else{rpcDb[_0x64d5('0xa9')](ut['scheduledAt'](_0x4ccc79,_0x64d5('0xa8'),_0x22cf37['dialNoSuchNumberRetryFrequency']),_0x4ccc79[_0x64d5('0xaa')],_0x4ccc79[_0x64d5('0xab')]);}}delete this['actions'][_0x4dbfe4[_0x64d5('0xac')]];}else{_0x4ccc79['countnosuchnumberretry']++;logger[_0x64d5('0x55')](_0x64d5('0xad'),_0x4ccc79[_0x64d5('0xa8')]);logger[_0x64d5('0x55')]('id',_0x4ccc79[_0x64d5('0xae')]);_0x7ec00b[_0x64d5('0xaf')]({'id':_0x4ccc79[_0x64d5('0xae')],'field':{'countnosuchnumberretry':_0x4ccc79[_0x64d5('0xa8')]}})[_0x64d5('0x7f')](function(){_0x7ec00b[_0x64d5('0xb0')](_0x4ccc79,_0x1cec19,_0x53a297)[_0x64d5('0x7f')](function(){});});}});break;case _0x64d5('0xb1'):var _0x346088=moment()[_0x64d5('0x57')](_0x64d5('0x8a'));_0x4ccc79[_0x64d5('0xb2')]=_0x346088;_0x4ccc79[_0x64d5('0xb3')]=_0x346088;_0x4ccc79[_0x64d5('0x6d')]=!![];_0x22cf37[_0x64d5('0x59')]+=0x1;logger[_0x64d5('0x55')](_0x64d5('0xb4'),_0x4ccc79[_0x64d5('0xb5')],_0x64d5('0xb6'),_0x22cf37[_0x64d5('0x26')],'pTalking:\x20',_0x22cf37[_0x64d5('0x59')]);ami['emit'](_0x64d5('0xb7'),ut[_0x64d5('0x9f')](_0x4ccc79,'connect',this[_0x64d5('0x14')][_0x4ccc79[_0x64d5('0x6b')]]));if(_0x22cf37[_0x64d5('0xb8')]){ami[_0x64d5('0x24')](_0x64d5('0xb9'),ut[_0x64d5('0xba')](_0x4ccc79));}break;case'16':ami[_0x64d5('0x24')](_0x64d5('0xbb'),ut[_0x64d5('0x9f')](_0x4ccc79,'complete',this[_0x64d5('0x14')][_0x4ccc79[_0x64d5('0x6b')]]));emitVoiceQueueChannelRemove(ut[_0x64d5('0x9f')](_0x4ccc79,_0x64d5('0xbc')));_0x22cf37[_0x64d5('0x38')]+=0x1;_0x22cf37[_0x64d5('0x2c')]+=0x1;_0x22cf37[_0x64d5('0x28')]+=0x1;ut[_0x64d5('0x76')](_0x22cf37,_0x64d5('0xbd'));_0x4ccc79[_0x64d5('0xbe')]=ut[_0x64d5('0x9c')](_0x4ccc79);ut[_0x64d5('0x8b')](_0x4ccc79,0x4,_0x64d5('0xbf'));rpcDb['createCustomerHistory'](_0x4ccc79,_0x64d5('0xc0'));rpcDb[_0x64d5('0x91')](_0x4ccc79,_0x64d5('0xc1'));rpcDb['crateCustomerReportQueue'](_0x4ccc79);_0x22cf37[_0x64d5('0x2a')]+=_0x4ccc79[_0x64d5('0xc2')];_0x22cf37[_0x64d5('0xc3')]+=_0x4ccc79[_0x64d5('0xc2')];logger[_0x64d5('0x55')]('[syncHangup][talking][decrement]',_0x4ccc79[_0x64d5('0xb5')],_0x64d5('0xb6'),_0x22cf37[_0x64d5('0x26')],_0x64d5('0x6c'),_0x22cf37[_0x64d5('0x59')]);delete this[_0x64d5('0x6a')][_0x4dbfe4[_0x64d5('0xac')]];break;case _0x64d5('0xc4'):_0x22cf37[_0x64d5('0xc5')]+=0x1;_0x4ccc79[_0x64d5('0xc6')]+=0x1;_0x4ccc79[_0x64d5('0xbe')]=ut[_0x64d5('0x9c')](_0x4ccc79);ut[_0x64d5('0x8b')](_0x4ccc79,0x5,_0x64d5('0xc7'));_0x1cec19=_0x22cf37[_0x64d5('0xc8')];_0x53a297=_0x22cf37[_0x64d5('0xc9')];ami[_0x64d5('0x24')](_0x64d5('0xca'),ut[_0x64d5('0x9f')](_0x4ccc79,_0x64d5('0xcb')));rpcDb[_0x64d5('0x8f')](_0x4ccc79,_0x64d5('0xcc'));_0x7ec00b[_0x64d5('0xa2')](_0x4ccc79,'5',_0x22cf37)['then'](function(_0x520d30){_0x402507=_0x520d30[_0x64d5('0xcd')]==0x1;if(!_0x402507){if(ut[_0x64d5('0x9c')](_0x4ccc79)>=_0x22cf37[_0x64d5('0xa4')]){_0x5a9e97=ut[_0x64d5('0xa5')](_0x4ccc79,0xf,_0x64d5('0xa6'));rpcDb[_0x64d5('0x91')](_0x5a9e97,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x4ccc79[_0x64d5('0xc6')]>=_0x22cf37[_0x64d5('0xce')]){rpcDb[_0x64d5('0x91')](_0x4ccc79,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x4ccc79,_0x64d5('0xc6'),_0x22cf37['dialBusyRetryFrequency']),_0x4ccc79[_0x64d5('0xaa')],_0x4ccc79[_0x64d5('0xab')]);}}}else{_0x4ccc79[_0x64d5('0xc6')]++;_0x7ec00b['incrementPreviewCounters']({'id':_0x4ccc79['idContact'],'field':{'countbusyretry':_0x4ccc79['countbusyretry']}})[_0x64d5('0x7f')](function(){_0x7ec00b[_0x64d5('0xb0')](_0x4ccc79,_0x1cec19,_0x53a297)[_0x64d5('0x7f')](function(){});});}});break;case _0x64d5('0xcf'):_0x22cf37[_0x64d5('0x3d')]+=0x1;_0x4ccc79['countnoanswerretry']+=0x1;_0x4ccc79[_0x64d5('0xbe')]=ut[_0x64d5('0x9c')](_0x4ccc79);ut[_0x64d5('0x8b')](_0x4ccc79,0x3,'NoAnswer');_0x1cec19=_0x22cf37[_0x64d5('0xd0')];_0x53a297=_0x22cf37[_0x64d5('0xc9')];ami[_0x64d5('0x24')](_0x64d5('0xd1'),ut['buildObj'](_0x4ccc79,_0x64d5('0xd2')));rpcDb[_0x64d5('0x8f')](_0x4ccc79,_0x64d5('0xd3'));_0x7ec00b[_0x64d5('0xa2')](_0x4ccc79,'3',_0x22cf37)[_0x64d5('0x7f')](function(_0x359e24){_0x402507=_0x359e24[_0x64d5('0xcd')]==0x1;if(!_0x402507){if(ut['totalGlobal'](_0x4ccc79)>=_0x22cf37['dialGlobalMaxRetry']){_0x5a9e97=ut[_0x64d5('0xa5')](_0x4ccc79,0xf,_0x64d5('0xa6'));rpcDb['createCustomerFinal'](_0x5a9e97,_0x64d5('0xd4'));}else{if(_0x4ccc79['countnoanswerretry']>=_0x22cf37['dialNoAnswerMaxRetry']){rpcDb[_0x64d5('0x91')](_0x4ccc79,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb[_0x64d5('0xa9')](ut[_0x64d5('0xd5')](_0x4ccc79,'countnoanswerretry',_0x22cf37[_0x64d5('0xd0')]),_0x4ccc79[_0x64d5('0xaa')],_0x4ccc79[_0x64d5('0xab')]);}}}else{_0x4ccc79['countnoanswerretry']++;_0x7ec00b['incrementPreviewCounters']({'id':_0x4ccc79[_0x64d5('0xae')],'field':{'countnoanswerretry':_0x4ccc79['countnoanswerretry']}})['then'](function(){_0x7ec00b[_0x64d5('0xb0')](_0x4ccc79,_0x1cec19,_0x53a297)['then'](function(){});});}});break;case _0x64d5('0xd6'):_0x22cf37[_0x64d5('0x39')]+=0x1;_0x4ccc79[_0x64d5('0xd7')]+=0x1;_0x4ccc79['countglobal']=ut['totalGlobal'](_0x4ccc79);ut[_0x64d5('0x8b')](_0x4ccc79,0x8,_0x64d5('0xd8'));_0x1cec19=_0x22cf37[_0x64d5('0xd9')];_0x53a297=_0x22cf37[_0x64d5('0xc9')];ami[_0x64d5('0x24')](_0x64d5('0xda'),ut[_0x64d5('0x9f')](_0x4ccc79,_0x64d5('0xdb')));rpcDb[_0x64d5('0x8f')](_0x4ccc79,_0x64d5('0xdc'));_0x7ec00b['verifyAdditionalPhones'](_0x4ccc79,'8',_0x22cf37)[_0x64d5('0x7f')](function(_0x1d1ec0){_0x402507=_0x1d1ec0[_0x64d5('0xcd')]==0x1;if(!_0x402507){if(ut['totalGlobal'](_0x4ccc79)>=_0x22cf37[_0x64d5('0xa4')]){_0x5a9e97=ut[_0x64d5('0xa5')](_0x4ccc79,0xf,_0x64d5('0xa6'));rpcDb[_0x64d5('0x91')](_0x5a9e97,_0x64d5('0xdd'));}else{if(_0x4ccc79[_0x64d5('0xd7')]>=_0x22cf37[_0x64d5('0xde')]){rpcDb['createCustomerFinal'](_0x4ccc79,_0x64d5('0xdc'));}else{rpcDb[_0x64d5('0xa9')](ut[_0x64d5('0xd5')](_0x4ccc79,_0x64d5('0xd7'),_0x22cf37[_0x64d5('0xc8')]),_0x4ccc79[_0x64d5('0xaa')],_0x4ccc79[_0x64d5('0xab')]);}}}else{_0x4ccc79['countcongestionretry']++;_0x7ec00b[_0x64d5('0xaf')]({'id':_0x4ccc79['idContact'],'field':{'countcongestionretry':_0x4ccc79['countcongestionretry']}})['then'](function(){_0x7ec00b[_0x64d5('0xb0')](_0x4ccc79,_0x1cec19,_0x53a297)[_0x64d5('0x7f')](function(){});});}});break;case _0x64d5('0xdf'):_0x22cf37[_0x64d5('0x3f')]+=0x1;_0x4ccc79[_0x64d5('0xe0')]+=0x1;_0x4ccc79[_0x64d5('0xbe')]=ut[_0x64d5('0x9c')](_0x4ccc79);ut[_0x64d5('0x8b')](_0x4ccc79,0x14,'AgentReject');_0x1cec19=_0x22cf37['dialAgentRejectRetryFrequency'];_0x53a297=_0x22cf37[_0x64d5('0xc9')];ami[_0x64d5('0x24')](_0x64d5('0xe1'),ut[_0x64d5('0x9f')](_0x4ccc79,_0x64d5('0xe2')));rpcDb[_0x64d5('0x8f')](_0x4ccc79,_0x64d5('0xe3'));_0x7ec00b[_0x64d5('0xa2')](_0x4ccc79,'20',_0x22cf37)['then'](function(_0x59b736){_0x402507=_0x59b736[_0x64d5('0xcd')]==0x1;if(!_0x402507){if(ut[_0x64d5('0x9c')](_0x4ccc79)>=_0x22cf37[_0x64d5('0xa4')]){_0x5a9e97=ut[_0x64d5('0xa5')](_0x4ccc79,0x14,_0x64d5('0xe4'));rpcDb[_0x64d5('0x91')](_0x5a9e97,_0x64d5('0xe5'));}else{if(_0x4ccc79[_0x64d5('0xe0')]>=_0x22cf37['dialAgentRejectMaxRetry']){rpcDb[_0x64d5('0x91')](_0x4ccc79,_0x64d5('0xe5'));}else{rpcDb[_0x64d5('0xa9')](ut[_0x64d5('0xd5')](_0x4ccc79,'countagentrejectretry',_0x22cf37[_0x64d5('0xe6')]),_0x4ccc79[_0x64d5('0xaa')],_0x4ccc79['activeContact']);}}}else{_0x4ccc79[_0x64d5('0xe7')]++;_0x7ec00b[_0x64d5('0xaf')]({'id':_0x4ccc79[_0x64d5('0xae')],'field':{'countnoanswerretry':_0x4ccc79[_0x64d5('0xe7')]}})[_0x64d5('0x7f')](function(){_0x7ec00b[_0x64d5('0xb0')](_0x4ccc79,_0x1cec19,_0x53a297)[_0x64d5('0x7f')](function(){});});}});break;case _0x64d5('0xe8'):_0x22cf37[_0x64d5('0x41')]+=0x1;_0x4ccc79['countabandonedretry']+=0x1;_0x4ccc79[_0x64d5('0xbe')]=ut[_0x64d5('0x9c')](_0x4ccc79);ut[_0x64d5('0x8b')](_0x4ccc79,0xb,_0x64d5('0xe9'));rpcDb[_0x64d5('0x8f')](_0x4ccc79,_0x64d5('0xea'));_0x7ec00b['verifyAdditionalPhones'](_0x4ccc79,'11',_0x22cf37)[_0x64d5('0x7f')](function(_0x484404){_0x402507=_0x484404[_0x64d5('0xcd')]==0x1;if(!_0x402507){if(ut[_0x64d5('0x9c')](_0x4ccc79)>=_0x22cf37[_0x64d5('0xa4')]){_0x5a9e97=ut['cloneAction'](_0x4ccc79,0xf,_0x64d5('0xa6'));rpcDb['createCustomerFinal'](_0x5a9e97,_0x64d5('0xea'));}else{if(_0x4ccc79[_0x64d5('0xeb')]>=_0x22cf37['dialAbandonedMaxRety']){rpcDb[_0x64d5('0x91')](_0x4ccc79,_0x64d5('0xea'));}else{rpcDb[_0x64d5('0xa9')](ut[_0x64d5('0xd5')](_0x4ccc79,'countabandonedretry',_0x22cf37[_0x64d5('0xec')]),_0x4ccc79[_0x64d5('0xaa')],_0x4ccc79[_0x64d5('0xab')]);}}}else{_0x4ccc79['countnoanswerretry']++;_0x7ec00b[_0x64d5('0xaf')]({'id':_0x4ccc79[_0x64d5('0xae')],'field':{'countnoanswerretry':_0x4ccc79[_0x64d5('0xe7')]}})['then'](function(){_0x7ec00b[_0x64d5('0xb0')](_0x4ccc79,_0x1cec19,_0x53a297)[_0x64d5('0x7f')](function(){});});}});break;case'18':_0x22cf37[_0x64d5('0x40')]+=0x1;_0x4ccc79[_0x64d5('0xed')]+=0x1;_0x4ccc79['countglobal']=ut[_0x64d5('0x9c')](_0x4ccc79);ut[_0x64d5('0x8b')](_0x4ccc79,0x12,_0x4dbfe4[_0x64d5('0xee')]||_0x4dbfe4[_0x64d5('0xef')]);ami[_0x64d5('0x24')](_0x64d5('0xf0'),ut[_0x64d5('0x9f')](_0x4ccc79,_0x64d5('0xf1')));rpcDb['createCustomerHistory'](_0x4ccc79,_0x64d5('0xf2'));_0x7ec00b[_0x64d5('0xa2')](_0x4ccc79,'18',_0x22cf37)[_0x64d5('0x7f')](function(_0x557b43){_0x402507=_0x557b43[_0x64d5('0xcd')]==0x1;if(!_0x402507){if(ut[_0x64d5('0x9c')](_0x4ccc79)>=_0x22cf37[_0x64d5('0xa4')]){_0x5a9e97=ut[_0x64d5('0xa5')](_0x4ccc79,0x12,_0x64d5('0xa6'));rpcDb[_0x64d5('0x91')](_0x5a9e97,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb['createCustomerFinal'](_0x4ccc79,_0x64d5('0xf2'));}}else{_0x4ccc79[_0x64d5('0xe7')]++;_0x7ec00b['incrementPreviewCounters']({'id':_0x4ccc79[_0x64d5('0xae')],'field':{'countnoanswerretry':_0x4ccc79[_0x64d5('0xe7')]}})['then'](function(){_0x7ec00b[_0x64d5('0xb0')](_0x4ccc79,_0x1cec19,_0x53a297)[_0x64d5('0x7f')](function(){});});}});delete this[_0x64d5('0x6a')][_0x4dbfe4['linkedid']];break;case'19':_0x22cf37[_0x64d5('0x40')]+=0x1;_0x4ccc79['countglobal']=ut[_0x64d5('0x9c')](_0x4ccc79);ut[_0x64d5('0x8b')](_0x4ccc79,0x13,_0x4dbfe4['cause-txt']||_0x4dbfe4[_0x64d5('0xef')]);ami[_0x64d5('0x24')](_0x64d5('0xf0'),ut[_0x64d5('0x9f')](_0x4ccc79,_0x64d5('0xf1')));rpcDb[_0x64d5('0x8f')](_0x4ccc79,_0x64d5('0xf3'));_0x7ec00b['verifyAdditionalPhones'](_0x4ccc79,'18',_0x22cf37)[_0x64d5('0x7f')](function(_0x18659e){_0x402507=_0x18659e['additional']==0x1;if(!_0x402507){if(ut['totalGlobal'](_0x4ccc79)>=_0x22cf37[_0x64d5('0xa4')]){_0x5a9e97=ut[_0x64d5('0xa5')](_0x4ccc79,0xf,_0x64d5('0xa6'));rpcDb[_0x64d5('0x91')](_0x5a9e97,_0x64d5('0xf3'));}else{rpcDb[_0x64d5('0x91')](_0x4ccc79,_0x64d5('0xf3'));}}else{_0x4ccc79[_0x64d5('0xe7')]++;_0x7ec00b['incrementPreviewCounters']({'id':_0x4ccc79[_0x64d5('0xae')],'field':{'countnoanswerretry':_0x4ccc79[_0x64d5('0xe7')]}})[_0x64d5('0x7f')](function(){_0x7ec00b[_0x64d5('0xb0')](_0x4ccc79,_0x1cec19,_0x53a297)[_0x64d5('0x7f')](function(){});});}});delete this[_0x64d5('0x6a')][_0x4dbfe4[_0x64d5('0xac')]];break;default:if(_0x4ccc79['dialAnswer']){ut[_0x64d5('0x76')](_0x22cf37,_0x64d5('0xf4'));ut[_0x64d5('0x77')](_0x64d5('0xf5')+_0x22cf37[_0x64d5('0x26')],_0x4dbfe4);}_0x22cf37[_0x64d5('0x40')]+=0x1;_0x4ccc79[_0x64d5('0xbe')]=ut[_0x64d5('0x9c')](_0x4ccc79);ut[_0x64d5('0x8b')](_0x4ccc79,0xc,_0x4dbfe4[_0x64d5('0xee')]||_0x4dbfe4[_0x64d5('0xef')]);_0x1cec19=_0x22cf37['dialAgentRejectRetryFrequency'];_0x53a297=_0x22cf37[_0x64d5('0xc9')];rpcDb['createCustomerHistory'](_0x4ccc79,'[callProgressDetectingCustomer][logUnknown]');_0x7ec00b[_0x64d5('0xa2')](_0x4ccc79,'20',_0x22cf37)[_0x64d5('0x7f')](function(_0x40fd52){_0x402507=_0x40fd52[_0x64d5('0xcd')]==0x1;if(!_0x402507){if(ut['totalGlobal'](_0x4ccc79)>=_0x22cf37['dialGlobalMaxRetry']){_0x5a9e97=ut['cloneAction'](_0x4ccc79,0xf,_0x64d5('0xa6'));rpcDb[_0x64d5('0x91')](_0x5a9e97,_0x64d5('0xf6'));}else{rpcDb['createCustomerFinal'](_0x4ccc79,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0x64d5('0x6a')][_0x4dbfe4[_0x64d5('0xac')]];}else{_0x7ec00b[_0x64d5('0xb0')](_0x4ccc79,_0x1cec19,_0x53a297)['then'](function(_0x279bb6){});}});}if(!(_0x4ccc79[_0x64d5('0x6d')]&&_0x1e709d==='16')){ut[_0x64d5('0xf7')](_0x22cf37,_0x64d5('0xf8'));logger[_0x64d5('0x55')](_0x64d5('0xf9'),_0x4ccc79['uniqueid'],_0x64d5('0xb6'),_0x22cf37[_0x64d5('0x26')],_0x64d5('0xfa'),_0x22cf37[_0x64d5('0x48')]);}if(_0x1e709d!=='ANSWER'){delete this[_0x64d5('0x6a')][_0x4dbfe4[_0x64d5('0xac')]];delete this['actions'][_0x4dbfe4['destlinkedid']];}}};Preview['prototype'][_0x64d5('0xfb')]=function(_0x4caaee,_0x5a6b9a,_0xc01452){if(_[_0x64d5('0xfc')](_0x5a6b9a)&&_0x64d5('0xfd')!==typeof _0x5a6b9a){return;}if(_['isUndefined'](_0xc01452)&&_0x64d5('0xfd')!==typeof _0xc01452){return;}switch(_0xc01452[_0x64d5('0xfe')]){case'0':ut[_0x64d5('0xff')](_0x4caaee,0x0,'NoSuchNumber');rpcDb[_0x64d5('0x100')](_0x4caaee,_0x64d5('0x101'));break;case'3':ut[_0x64d5('0xff')](_0x4caaee,0x3,_0x64d5('0x102'));rpcDb[_0x64d5('0x100')](_0x4caaee,_0x64d5('0x103'));break;case'5':ut['logAgent'](_0x4caaee,0x5,_0x64d5('0xc7'));rpcDb[_0x64d5('0x100')](_0x4caaee,_0x64d5('0x104'));break;case'8':ut['logAgent'](_0x4caaee,0x8,_0x64d5('0xd8'));rpcDb[_0x64d5('0x100')](_0x4caaee,_0x64d5('0x105'));break;case'22':ut[_0x64d5('0xff')](_0x4caaee,0x16,_0x64d5('0x106'));rpcDb[_0x64d5('0x100')](_0x4caaee,_0x64d5('0x107'));break;default:ut[_0x64d5('0xff')](_0x4caaee,0xc,_0xc01452['reason']);rpcDb[_0x64d5('0x100')](_0x4caaee,_0x64d5('0x105'));}ut[_0x64d5('0xf7')](_0x5a6b9a,'[callProgressDetectingAgent]');logger['info'](_0x64d5('0x108'),_0x4caaee[_0x64d5('0xb5')],_0x64d5('0xb6'),_0x5a6b9a[_0x64d5('0x26')],_0x64d5('0xfa'),_0x5a6b9a[_0x64d5('0x48')]);delete this[_0x64d5('0x6a')][_0x4caaee[_0x64d5('0xb5')]];};Preview[_0x64d5('0xf')]['verifyAdditionalPhones']=function(_0x91b5cc,_0x1969fc,_0x5e1c07){return BPromise['resolve']()[_0x64d5('0x7f')](cmHopperAdditionalPhone[_0x64d5('0xa2')](_0x91b5cc,_0x1969fc,_0x5e1c07))['catch'](logger[_0x64d5('0x55')](_0x64d5('0x109')));};Preview['prototype'][_0x64d5('0xb0')]=function(_0x3a54c6,_0x225844,_0x5a943e){return BPromise[_0x64d5('0x10a')]()[_0x64d5('0x7f')](cmHopperAdditionalPhone[_0x64d5('0xb0')](_0x3a54c6,_0x225844,_0x5a943e))[_0x64d5('0x87')](logger[_0x64d5('0x55')](_0x64d5('0x10b')));};Preview[_0x64d5('0xf')][_0x64d5('0xaf')]=function(_0x40c488){return BPromise[_0x64d5('0x10a')]()[_0x64d5('0x7f')](cmHopperAdditionalPhone[_0x64d5('0xaf')](_0x40c488))[_0x64d5('0x87')](logger[_0x64d5('0x55')](_0x64d5('0x10c')));};Preview[_0x64d5('0xf')][_0x64d5('0x10d')]=function(_0xc2f0fa,_0x5629b1,_0x59a2da,_0x5bfe81,_0x47c002){var _0x1872e5=this;return new BPromise(function(_0xd7938e,_0x7237a7){if(_['isNil'](_0x5629b1)||_[_0x64d5('0x69')](_0x5629b1[_0x64d5('0x10e')])||_[_0x64d5('0x69')](_0x5629b1['phone'])||_[_0x64d5('0x69')](_0x5629b1[_0x64d5('0x10f')])){_0x7237a7(ut[_0x64d5('0x47')](_0x64d5('0x110'),_0x5bfe81,_0x47c002));return;}var _0x4579ef=uuid['v4']();var _0x5b0234=_0x1872e5[_0x64d5('0x14')][_0x5629b1[_0x64d5('0x111')]['name']];var _0x4b5576=_0x59a2da?_0x1872e5[_0x64d5('0x16')][_0x59a2da]['id']:undefined;_0x1872e5[_0x64d5('0x6a')][_0x4579ef]=new Action(_0x5629b1,_0x5b0234,_0x4579ef,_0x59a2da,_0x4b5576);var _0x10bed4=_0x1872e5[_0x64d5('0x6a')][_0x4579ef];_0x10bed4[_0x64d5('0xaa')]=_0x5bfe81;_0x10bed4[_0x64d5('0xab')]=_0x47c002;_0x10bed4[_0x64d5('0x112')]=_0x59a2da;if(_[_0x64d5('0x113')](_0xc2f0fa)){_0x1872e5[_0x64d5('0x114')](_0x10bed4,_0x5b0234,_0x5629b1,_0x59a2da)[_0x64d5('0x7f')](function(_0xf34d5d){logger['info'](_0x64d5('0x115'),_0x64d5('0x116')+_0x10bed4[_0x64d5('0x6b')]+_0x64d5('0x117')+_0x10bed4[_0x64d5('0xae')],JSON[_0x64d5('0x52')](_0xf34d5d));ami[_0x64d5('0x24')](_0x64d5('0x118'),ut[_0x64d5('0x9f')](_0x10bed4,'called',_0x1872e5[_0x64d5('0x14')][_0x10bed4['queue']]));_0xd7938e(ut[_0x64d5('0x47')](_0x64d5('0x119')));})['catch'](function(_0x44d328){ut['logger'](_0x64d5('0x11a'),_0x44d328);_0x7237a7(ut[_0x64d5('0x47')](_0x64d5('0x11b'),_0x5bfe81,_0x47c002));});}else{_0x5b0234[_0x64d5('0x11c')]+=0x1;ut[_0x64d5('0x11d')](_0x10bed4);rpcDb[_0x64d5('0x11e')](_0x10bed4,'[Blacklist][error]');delete _0x1872e5[_0x64d5('0x6a')][_0x4579ef];_0x7237a7(ut[_0x64d5('0x47')]('Contact\x20in\x20black\x20List',_0x5bfe81,_0x47c002));}});};Preview[_0x64d5('0xf')][_0x64d5('0x98')]=function(_0x2451d3){return!_[_0x64d5('0x69')](_0x2451d3)&&!_[_0x64d5('0x69')](_0x2451d3[_0x64d5('0x26')])&&!_[_0x64d5('0x69')](_0x2451d3[_0x64d5('0x4f')])&&_0x2451d3[_0x64d5('0x4f')]&&!_['isNil'](this[_0x64d5('0x15')][util['format'](_0x64d5('0x11f'),_0x2451d3[_0x64d5('0x26')])])&&!_[_0x64d5('0x69')](this[_0x64d5('0x15')][util[_0x64d5('0x57')](_0x64d5('0x11f'),_0x2451d3[_0x64d5('0x26')])][_0x64d5('0x120')])&&(this[_0x64d5('0x15')][util[_0x64d5('0x57')](_0x64d5('0x11f'),_0x2451d3[_0x64d5('0x26')])][_0x64d5('0x120')]==='reachable'||this[_0x64d5('0x15')][util[_0x64d5('0x57')](_0x64d5('0x11f'),_0x2451d3[_0x64d5('0x26')])][_0x64d5('0x120')]===_0x64d5('0x121'));};Preview[_0x64d5('0xf')][_0x64d5('0x84')]=function(_0x59ebb3,_0x104b5d){var _0x3c0d93=this;return new BPromise(function(_0x30bbf9,_0x33687b){_0x3c0d93[_0x64d5('0x122')](_0x59ebb3,_0x104b5d)['then'](function(_0x492ced){_0x30bbf9(_[_0x64d5('0x6e')](_0x492ced,[_0x64d5('0x47')]));})[_0x64d5('0x87')](function(_0x3ae272){if(_0x3ae272[_0x64d5('0x123')]){rpcDb['unlockContact'](_0x59ebb3);}if(_0x3ae272[_0x64d5('0x4f')]){rpcDb[_0x64d5('0x88')](_0x59ebb3);}_0x33687b(_[_0x64d5('0x6e')](_0x3ae272,[_0x64d5('0x47')]));});});};Preview[_0x64d5('0xf')]['execRun']=function(_0x27e8b0,_0x40972b){var _0x2ba4f7=this;return new BPromise(function(_0x9e5373,_0x579fea){var _0x350ad9,_0x5624d1;rpcDb[_0x64d5('0x124')](_0x27e8b0)[_0x64d5('0x7f')](function(_0x3c1d8a){if(!_[_0x64d5('0x69')](_0x3c1d8a[0x0])){_0x5624d1=_0x3c1d8a[0x0][_0x64d5('0x125')]?![]:!![];_0x350ad9=_0x3c1d8a[0x0][_0x64d5('0x125')]?!![]:![];_0x350ad9=_0x40972b?!![]:_0x350ad9;}var _0x327914=_0x2ba4f7[_0x64d5('0x126')](_0x3c1d8a);if(_0x327914[_0x64d5('0x127')]){rpcDb['checkIsBlackList'](_[_0x64d5('0x6e')](_0x3c1d8a[0x0],['VoiceQueueId',_0x64d5('0x128')]))[_0x64d5('0x7f')](function(_0x596f42){_0x2ba4f7[_0x64d5('0x10d')](_0x596f42,_0x3c1d8a[0x0],_0x40972b,_0x5624d1,_0x350ad9)['then'](function(_0x32c3e0){_0x9e5373(_0x32c3e0);})[_0x64d5('0x87')](function(_0x13b2ef){_0x579fea(_0x13b2ef);});})[_0x64d5('0x87')](function(_0x700039){ut[_0x64d5('0x5c')]('[Preview][checkIsBlackList]',_0x700039);_0x579fea(ut[_0x64d5('0x47')](_0x64d5('0x129'),_0x5624d1,_0x350ad9));});}else{_0x579fea(ut[_0x64d5('0x47')](_0x327914[_0x64d5('0x47')],_0x5624d1,_0x350ad9));}})[_0x64d5('0x87')](function(_0x1eb193){ut[_0x64d5('0x5c')](_0x64d5('0x12a'),_0x1eb193);_0x579fea(ut[_0x64d5('0x47')](_0x64d5('0x129'),![],!![]));});});};Preview[_0x64d5('0xf')][_0x64d5('0x126')]=function(_0x28efdb){if(_[_0x64d5('0x69')](_0x28efdb)||_[_0x64d5('0x113')](_0x28efdb)||!_['isNil'](_0x28efdb[0x0][_0x64d5('0x82')])&&_['isNil'](_0x28efdb[0x0][_0x64d5('0x82')]['name'])){ut['logger'](_0x64d5('0x12b'),_0x28efdb);return{'isValid':![],'message':_0x64d5('0x12c')};}var _0x771f3c=this[_0x64d5('0x14')][_0x28efdb[0x0][_0x64d5('0x111')][_0x64d5('0x26')]];_0x771f3c[_0x64d5('0x47')]=_0x64d5('0x9a');if(_[_0x64d5('0x69')](_0x771f3c)){ut[_0x64d5('0x5c')]('[Preview][validateContact][Empty\x20Campaign]',_0x771f3c);return{'isValid':![],'message':_0x64d5('0x12d')};}if(!this['isTrunkReachable'](_0x771f3c['Trunk'])){ut[_0x64d5('0x5c')](_0x64d5('0x12e'),'campaign\x20Name:\x20'+_0x771f3c['name']+_0x64d5('0x12f'));if(!this[_0x64d5('0x98')](_0x771f3c[_0x64d5('0x99')])){ut['logger'](_0x64d5('0x12e'),_0x771f3c['name']+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0x64d5('0x130')};}}if(!ut['isActive'](_0x771f3c[_0x64d5('0x31')])){ut[_0x64d5('0x5c')](_0x64d5('0x131'),_0x771f3c[_0x64d5('0x26')]+_0x64d5('0x132'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x771f3c[_0x64d5('0x26')]+_0x64d5('0x132')};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0x64d5('0xf')][_0x64d5('0x114')]=function(_0x5a2037,_0x184811,_0x5837a1,_0x2290a8){var _0x3272e8=this;return new BPromise(function(_0x631d6b,_0x2b196d){var _0xf0ff7b=_0x5a2037['uniqueid'];var _0x5e6287=_0x3272e8[_0x64d5('0x98')](_0x184811[_0x64d5('0x4e')])?util[_0x64d5('0x57')](_0x64d5('0x133'),_0x184811[_0x64d5('0x4e')][_0x64d5('0x26')],_['isNil'](_0x184811[_0x64d5('0x36')])?'':_0x184811[_0x64d5('0x36')][_0x64d5('0x134')]()||'',_0x184811['dialCutDigit']>0x0?_0x5837a1['phone']['substring'](_0x184811[_0x64d5('0x135')]):_0x5837a1[_0x64d5('0x128')]):util[_0x64d5('0x57')](_0x64d5('0x133'),_[_0x64d5('0x69')](_0x184811['TrunkBackup'])?_0x184811[_0x64d5('0x4e')][_0x64d5('0x26')]:_0x184811['TrunkBackup'][_0x64d5('0x26')],_[_0x64d5('0x69')](_0x184811[_0x64d5('0x36')])?'':_0x184811['dialPrefix'][_0x64d5('0x134')]()||'',_0x184811[_0x64d5('0x135')]>0x0?_0x5837a1['phone'][_0x64d5('0x136')](_0x184811[_0x64d5('0x135')]):_0x5837a1[_0x64d5('0x128')]);var _0x3cdf3e=_0x3272e8['isTrunkReachable'](_0x184811['Trunk'])?ut[_0x64d5('0x137')](_0x184811['Trunk'][_0x64d5('0x50')],_0x184811[_0x64d5('0x33')],_0x184811[_0x64d5('0x138')]>0x0?ut[_0x64d5('0x139')](_0x184811[_0x64d5('0x34')],_0x184811[_0x64d5('0x138')]):_0x184811[_0x64d5('0x34')]):ut['getCallerId'](_['isNil'](_0x184811[_0x64d5('0x99')])?_0x184811[_0x64d5('0x4e')][_0x64d5('0x50')]:_0x184811[_0x64d5('0x99')]['callerid'],_0x184811[_0x64d5('0x33')],_0x184811[_0x64d5('0x138')]>0x0?ut[_0x64d5('0x139')](_0x184811[_0x64d5('0x34')],_0x184811[_0x64d5('0x138')]):_0x184811[_0x64d5('0x34')]);if(_0x3cdf3e){_0x5a2037['originatecalleridname']=ut[_0x64d5('0x13a')](_0x3cdf3e);_0x5a2037[_0x64d5('0x13b')]=ut[_0x64d5('0x13c')](_0x3cdf3e);}var _0x3adfd8=ut[_0x64d5('0x13d')](_0x184811,_0x5837a1,_0x5e6287,_0x3cdf3e,_0xf0ff7b,_0x5a2037);_[_0x64d5('0x13e')](_0x5a2037,ut[_0x64d5('0x13f')](_0x3adfd8));_0x5a2037['starttime']=moment()[_0x64d5('0x57')]('YYYY-MM-DD\x20HH:mm:ss');ami[_0x64d5('0x72')](ut[_0x64d5('0x140')](_0x5a2037,_0x184811,_0x3adfd8,_0x5a2037[_0x64d5('0xab')],_0x2290a8))['then'](function(_0x12d646){var _0x3909a0=_0x5a2037[_0x64d5('0x141')];if(!_[_0x64d5('0x69')](_0x3909a0)){if(!_['isNil'](_0x3272e8[_0x64d5('0x16')][_0x3909a0])){_0x3272e8[_0x64d5('0x16')][_0x3909a0][_0x64d5('0x142')]=_0x5a2037[_0x64d5('0x143')];emit(util[_0x64d5('0x57')]('user:%s',_0x3272e8[_0x64d5('0x16')][_0x3909a0]['name']),_0x64d5('0x144'),{'destaccountcode':_0x3272e8[_0x64d5('0x16')][_0x3909a0][_0x64d5('0x145')],'destconnectedlinenum':_0x5a2037[_0x64d5('0x143')]});}}_0x184811[_0x64d5('0x48')]+=0x1;logger['info'](_0x64d5('0x146'),_0xf0ff7b,_0x64d5('0xb6'),_0x184811[_0x64d5('0x26')],_0x64d5('0xfa'),_0x184811[_0x64d5('0x48')]);_0x631d6b(_0x12d646);})[_0x64d5('0x87')](function(_0x1811b0){ut[_0x64d5('0xff')](_0x5a2037,0xe,_0x64d5('0x147'));rpcDb[_0x64d5('0x100')](_0x5a2037,_0x64d5('0x148'));_0x2b196d(_0x1811b0);});});};Preview[_0x64d5('0xf')][_0x64d5('0x1f')]=function(_0x35a8a6){if(this[_0x64d5('0x6a')][_0x35a8a6[_0x64d5('0xac')]]){this['actions'][_0x35a8a6[_0x64d5('0xac')]]['channel']=_0x35a8a6[_0x64d5('0x73')];}};Preview[_0x64d5('0xf')][_0x64d5('0x149')]=function(_0x3273d3){var _0x2a7115=this;var _0xe0253a=this[_0x64d5('0x6a')][_0x3273d3[_0x64d5('0x14a')]];if(_0xe0253a){if(_0xe0253a[_0x64d5('0x112')]&&this[_0x64d5('0x16')][_0xe0253a['lookAgent']]){ut[_0x64d5('0x14b')](_0xe0253a,this[_0x64d5('0x16')][_0xe0253a[_0x64d5('0x112')]][_0x64d5('0x26')],this[_0x64d5('0x16')][_0xe0253a[_0x64d5('0x112')]]['id']);}var _0x365e9a=_[_0x64d5('0x14c')](_0xe0253a);_0x365e9a['responsetime']=moment()[_0x64d5('0x57')](_0x64d5('0x8a'));var _0x28d56c=_0x2a7115[_0x64d5('0x14')][_0xe0253a[_0x64d5('0x6b')]];if(ut['isFailure'](_0x3273d3['response'])){if(_0xe0253a['unlockAgent']){rpcDb[_0x64d5('0x14d')](_0xe0253a[_0x64d5('0xae')]);}if(_0xe0253a['activeContact']){rpcDb[_0x64d5('0x88')](_0xe0253a[_0x64d5('0xae')]);}ami[_0x64d5('0x24')](_0x64d5('0x14e'),ut['buildObj'](_0xe0253a,_0x64d5('0x14f'),this[_0x64d5('0x14')][_0xe0253a[_0x64d5('0x6b')]]));this[_0x64d5('0xfb')](_0x365e9a,_0x28d56c,_0x3273d3);}else{_0xe0253a[_0x64d5('0x89')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');ut[_0x64d5('0xff')](_0x365e9a,0x4,_0x64d5('0xbf'));rpcDb[_0x64d5('0x100')](_0x365e9a,_0x64d5('0x150'));}}};Preview[_0x64d5('0xf')][_0x64d5('0x151')]=function(_0x168355){var _0x1a4054=this;var _0x1d39f3=this['actions'][_0x168355[_0x64d5('0xac')]];var _0x36ed95;if(_0x1d39f3){_0x36ed95=this[_0x64d5('0x14')][_0x1d39f3[_0x64d5('0x6b')]];logger[_0x64d5('0x55')](_0x64d5('0x152'),_0x168355[_0x64d5('0xac')],_0x64d5('0xb6'),_0x36ed95['name'],'pTalking:\x20',_0x36ed95[_0x64d5('0x59')]);}if(this[_0x64d5('0x6a')][_0x168355[_0x64d5('0xac')]]&&_0x168355['linkedid']!==_0x168355['uniqueid']){if(_0x168355['cause']==='16'&&this[_0x64d5('0x6a')][_0x168355[_0x64d5('0xac')]][_0x64d5('0x6d')]){this[_0x64d5('0x9b')](_0x168355,_0x168355[_0x64d5('0xac')],_0x168355[_0x64d5('0x153')]);}else if(this['actions'][_0x168355[_0x64d5('0xac')]][_0x64d5('0x6d')]){logger[_0x64d5('0x55')]('[syncHangup][talking][cause]',_0x168355[_0x64d5('0xac')],_0x168355[_0x64d5('0x153')],_0x64d5('0xb6'),_0x36ed95['name'],_0x64d5('0x6c'),_0x36ed95[_0x64d5('0x59')]);this[_0x64d5('0x9b')](_0x168355,_0x168355['linkedid'],_0x168355[_0x64d5('0x153')]);}}else if(_0x1d39f3&&_[_0x64d5('0x69')](_0x1d39f3[_0x64d5('0x154')])&&_0x36ed95[_0x64d5('0x155')]&&_0x168355[_0x64d5('0xac')]===_0x168355['uniqueid']&&_['isNil'](_0x168355[_0x64d5('0xfe')])&&_0x168355['cause']==='16'&&_0x168355[_0x64d5('0x156')]==='6'&&_[_0x64d5('0xfc')](_0x1d39f3[_0x64d5('0x157')])){if(_0x1d39f3[_0x64d5('0xaa')]){rpcDb['unlockContact'](_0x1d39f3['idContact']);}if(_0x1d39f3[_0x64d5('0xab')]){rpcDb[_0x64d5('0x88')](_0x1d39f3[_0x64d5('0xae')]);}_0x168355[_0x64d5('0xfe')]='22';this[_0x64d5('0xfb')](_0x1d39f3,_0x36ed95,_0x168355);}else if(_0x1d39f3&&_0x1d39f3[_0x64d5('0x157')]){if(_0x168355[_0x64d5('0x153')]==='16'&&this[_0x64d5('0x6a')][_0x168355['linkedid']]['dialAnswer']){logger[_0x64d5('0x55')](_0x64d5('0x158'),_0x168355[_0x64d5('0xac')],_0x168355[_0x64d5('0x153')],'\x20Queue',_0x36ed95['name'],_0x64d5('0x6c'),_0x36ed95[_0x64d5('0x59')]);this[_0x64d5('0x9b')](_0x168355,_0x168355[_0x64d5('0xac')],_0x168355[_0x64d5('0x153')]);}else if(this[_0x64d5('0x6a')][_0x168355[_0x64d5('0xac')]][_0x64d5('0x6d')]){logger[_0x64d5('0x55')]('[syncHangup][talking][cause]',_0x168355[_0x64d5('0xac')],_0x168355[_0x64d5('0x153')],_0x64d5('0xb6'),_0x36ed95['name'],_0x64d5('0x6c'),_0x36ed95[_0x64d5('0x59')]);this[_0x64d5('0x9b')](_0x168355,_0x168355[_0x64d5('0xac')],_0x168355['cause']);}}};Preview[_0x64d5('0xf')][_0x64d5('0x1d')]=function(_0x5971ab){if(this['actions'][_0x5971ab['destlinkedid']]&&_0x5971ab[_0x64d5('0x159')]!==_0x5971ab['destuniqueid']){this[_0x64d5('0x9b')](_0x5971ab,_0x5971ab['destlinkedid'],_0x5971ab[_0x64d5('0xef')]);}};Preview[_0x64d5('0xf')][_0x64d5('0x1b')]=function(_0x547dff){if(this[_0x64d5('0x6a')][_0x547dff[_0x64d5('0xac')]]&&_0x547dff[_0x64d5('0xac')]!==_0x547dff[_0x64d5('0xb5')]&&!this[_0x64d5('0x6a')][_0x547dff[_0x64d5('0xac')]][_0x64d5('0x6d')]){if(_0x547dff[_0x64d5('0x153')]==='1'){this[_0x64d5('0x9b')](_0x547dff,_0x547dff['linkedid'],_0x547dff[_0x64d5('0x153')]);}}};Preview[_0x64d5('0xf')]['addVariable']=function(_0x5b1f29,_0x92efa2,_0x3a6af1){if(this['actions'][_0x5b1f29]){if(_[_0x64d5('0x69')](this['actions'][_0x5b1f29]['variables'])){this['actions'][_0x5b1f29][_0x64d5('0x15a')]={};}this[_0x64d5('0x6a')][_0x5b1f29][_0x64d5('0x15a')][_0x92efa2]=_0x3a6af1;}};Preview['prototype'][_0x64d5('0x21')]=function(_0x4f2b97){try{if(!_[_0x64d5('0x69')](_0x4f2b97)){if(ut[_0x64d5('0x15b')](_['keys'](_0x4f2b97[_0x64d5('0x15c')])[0x0])){this[_0x64d5('0x15d')](_0x4f2b97[_0x64d5('0xb5')],_[_0x64d5('0x15e')](_0x4f2b97[_0x64d5('0x15c')])[0x0],_0x4f2b97[_0x64d5('0x15f')]);}}}catch(_0x4e64b5){logger[_0x64d5('0x160')](_0x64d5('0x161'),util['inspect'](_0x4e64b5,{'showHidden':![],'depth':null}));}};Preview[_0x64d5('0xf')][_0x64d5('0x22')]=function(_0x2f653a){if(_0x2f653a){if(this[_0x64d5('0x6a')][_0x2f653a['transfertargetlinkedid']]){this['actions'][_0x2f653a[_0x64d5('0x162')]][_0x64d5('0x157')]=!![];}}};Preview[_0x64d5('0xf')][_0x64d5('0x163')]=function(_0x497dae){if(_0x497dae){if(this[_0x64d5('0x6a')][_0x497dae[_0x64d5('0x164')]]){this[_0x64d5('0x6a')][_0x497dae[_0x64d5('0x164')]]['transfer']=!![];}}};module['exports']=Preview; \ No newline at end of file +var _0xc450=['reason','logAgent','[callProgressDetectingAgent][logNoSuch]','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','Busy','Congestion','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','resolve','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','[incrementPreviewCounters]\x20','checkInBlack','phone','VoiceQueueId','Contact\x20is\x20undefined','isEmpty','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','Contact\x20in\x20black\x20List','SIP/%s','unmonitored','execRun','disableContact','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','Call\x20unsuccessful','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','execCall','SIP/%s/%s%s','trim','substring','TrunkBackup','dialCutDigit','getCallerId','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variablesAction','destconnectedlinenum','calleridnum','user:%s','accountcode','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','syncNewExten','lookAgent','clone','isFailure','response','unlockContact','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','statedesc','dialQueueProject','channelstate','isUndefined','transfer','[syncHangup][talking][transfer]','destuniqueid','syncHangupRequest','addVariable','variables','filterKey','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','util','lodash','uuid','moment','md5','ioredis','../../../config/logger','preview','actionPreview','../ami','./rpcDb','../rpc/cmHopperAdditionalPhone','./util/util','redis','defaults','localhost','socket.io-emitter','prototype','tail','finally','sequence','voiceQueues','trunks','actions','agents','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','syncDialEnd','newexten','syncVarSet','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','loopCampaigns','campaignsPreview','emit','outbound','name','strategy','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','format','voice:queue:%s','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','voice_queue_channel:remove','sendMessageOneNotActive','originated','available','paused','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','logger','syncCampaigns','clockClearZombieChannels','hasOwnProperty','dialMethod','clearZombieChannels','clearZombieChannel','enqueue','isNil','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pTalking:\x20','pick','UserId','ListId','Action','status','channel','No\x20such\x20channel','[clearZombieChannel]','dialAnswer','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[action]','recallMe','getContactRecallMe','length','getDiff','scheduledat','Agent','voicePause','run','then','logger2','[RecallMe]','starttime','YYYY-MM-DD\x20HH:mm:ss','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','logCustomer','[HistoryRecallClose]','catch','[getContactRecallMe]','setMessage','AGENTS_NOT_LOGGED','isActive','NOT_ACTIVE','isTrunkReachable','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','createCustomerFinal','rescheduleContact','scheduledAt','unlockAgent','activeContact','linkedid','actioncountonusuch','incrementPreviewCounters','idContact','swapAdditionalPhones','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','buildObj','connect','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','outboundAnswerCallsDay','total','answered','[16]','countglobal','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','countbusyretry','dialBusyRetryFrequency','custom:agentbusy','busy','cloneAction','dialBusyMaxRetry','[callProgressDetectingCustomer][logBusy]','NOANSWER','countnoanswerretry','NoAnswer','dialNoAnswerRetryFrequency','callAdditionalPhoneAfterMin','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','countcongestionretry','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','CANCEL','countagentrejectretry','AgentReject','custom:agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','outboundAbandonedCallsDay','countabandonedretry','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','countmachineretry','dialstatus','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','cause-txt','amd','[callProgressDetectingCustomer][machine]','[default]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','object'];(function(_0x476faf,_0xe9e078){var _0x32f70e=function(_0x3c72d9){while(--_0x3c72d9){_0x476faf['push'](_0x476faf['shift']());}};_0x32f70e(++_0xe9e078);}(_0xc450,0x68));var _0x0c45=function(_0x556180,_0x1a8ef3){_0x556180=_0x556180-0x0;var _0x26c01d=_0xc450[_0x556180];return _0x26c01d;};'use strict';var util=require(_0x0c45('0x0'));var _=require(_0x0c45('0x1'));var BPromise=require('bluebird');var uuid=require(_0x0c45('0x2'));var moment=require(_0x0c45('0x3'));var md5=require(_0x0c45('0x4'));var Redis=require(_0x0c45('0x5'));var config=require('../../../config/environment');var logger=require(_0x0c45('0x6'))(_0x0c45('0x7'));var loggerAction=require(_0x0c45('0x6'))(_0x0c45('0x8'));var ami=require(_0x0c45('0x9'));var rpcDb=require(_0x0c45('0xa'));var cmHopperAdditionalPhone=require(_0x0c45('0xb'));var Action=require('./action');var ut=require(_0x0c45('0xc'));config[_0x0c45('0xd')]=_[_0x0c45('0xe')](config[_0x0c45('0xd')],{'host':_0x0c45('0xf'),'port':0x18eb});var io=require(_0x0c45('0x10'))(new Redis(config[_0x0c45('0xd')]));var Sequence=function(){};Sequence[_0x0c45('0x11')]['enqueue']=function(_0x417d90){this[_0x0c45('0x12')]=this[_0x0c45('0x12')]?this[_0x0c45('0x12')][_0x0c45('0x13')](_0x417d90):_0x417d90();};function Preview(_0x320f91){this[_0x0c45('0x14')]=new Sequence();this['campaignsPreview']=_0x320f91[_0x0c45('0x15')];this[_0x0c45('0x16')]=_0x320f91[_0x0c45('0x16')];this[_0x0c45('0x17')]={};this[_0x0c45('0x18')]=_0x320f91['agents'];this['clockClearZombieChannels']=0x0;ami['on'](_0x0c45('0x19'),this[_0x0c45('0x1a')][_0x0c45('0x1b')](this));ami['on'](_0x0c45('0x1c'),this[_0x0c45('0x1d')][_0x0c45('0x1b')](this));ami['on']('hanguprequest',this['syncHangupRequest'][_0x0c45('0x1b')](this));ami['on']('dialend',this[_0x0c45('0x1e')]['bind'](this));ami['on'](_0x0c45('0x1f'),this['syncNewExten'][_0x0c45('0x1b')](this));ami['on']('varset',this[_0x0c45('0x20')][_0x0c45('0x1b')](this));ami['on'](_0x0c45('0x21'),this[_0x0c45('0x22')][_0x0c45('0x1b')](this));ami['on']('blindtransfer',this[_0x0c45('0x23')]['bind'](this));this[_0x0c45('0x24')](this[_0x0c45('0x25')]);}function emit(_0x4e742d,_0x3c97f6,_0x2b613e){io['to'](_0x4e742d)[_0x0c45('0x26')](_0x3c97f6,_0x2b613e);}function emitCampaignPreview(_0x4af0f0){if(_0x4af0f0['type']===_0x0c45('0x27')){var _0x57020d={'id':_0x4af0f0['id'],'name':_0x4af0f0[_0x0c45('0x28')],'strategy':_0x4af0f0[_0x0c45('0x29')],'answered':_0x4af0f0['answered'],'available':_0x4af0f0['available'],'loggedIn':_0x4af0f0[_0x0c45('0x2a')],'pTalking':_0x4af0f0[_0x0c45('0x2b')],'sumBillable':_0x4af0f0[_0x0c45('0x2c')],'sumDuration':_0x4af0f0[_0x0c45('0x2d')],'sumHoldTime':_0x4af0f0[_0x0c45('0x2e')]||0x0,'talking':_0x4af0f0[_0x0c45('0x2f')],'total':_0x4af0f0['total'],'type':_0x4af0f0['type'],'unmanaged':_0x4af0f0[_0x0c45('0x30')],'abandoned':_0x4af0f0[_0x0c45('0x31')],'waiting':_0x4af0f0[_0x0c45('0x32')],'loggedInDb':_0x4af0f0[_0x0c45('0x33')],'dialActive':_0x4af0f0[_0x0c45('0x34')],'dialMethod':_0x4af0f0['dialMethod'],'dialOriginateCallerIdName':_0x4af0f0['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x4af0f0[_0x0c45('0x35')],'dialOriginateTimeout':_0x4af0f0[_0x0c45('0x36')],'dialPrefix':_0x4af0f0[_0x0c45('0x37')],'outboundAnswerAgiCallsDay':_0x4af0f0[_0x0c45('0x38')],'outboundAnswerCallsDay':_0x4af0f0['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x4af0f0[_0x0c45('0x39')],'outboundBusyCallsDay':_0x4af0f0[_0x0c45('0x3a')],'outboundCongestionCallsDay':_0x4af0f0[_0x0c45('0x3b')],'outboundDropCallsDayACS':_0x4af0f0['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x4af0f0[_0x0c45('0x3c')],'outboundDropCallsDayTimeout':_0x4af0f0[_0x0c45('0x3d')],'outboundNoAnswerCallsDay':_0x4af0f0[_0x0c45('0x3e')],'outboundNoSuchCallsDay':_0x4af0f0[_0x0c45('0x3f')],'outboundOriginateFailureCallsDay':_0x4af0f0[_0x0c45('0x40')],'outboundReCallsDay':_0x4af0f0[_0x0c45('0x41')],'outboundRejectCallsDay':_0x4af0f0[_0x0c45('0x42')],'outboundUnknownCallsDay':_0x4af0f0[_0x0c45('0x43')],'outboundAbandonedCallsDay':_0x4af0f0['outboundAbandonedCallsDay'],'predictiveIntervalAnsweredCalls':_0x4af0f0[_0x0c45('0x44')],'predictiveIntervalAvgHoldtime':_0x4af0f0[_0x0c45('0x45')],'predictiveIntervalAvgTalktime':_0x4af0f0['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x4af0f0[_0x0c45('0x46')],'predictiveIntervalDroppedCallsTimeout':_0x4af0f0[_0x0c45('0x47')],'predictiveIntervalErlangCalls':_0x4af0f0[_0x0c45('0x48')],'predictiveIntervalErlangCallsDroppedCalls':_0x4af0f0[_0x0c45('0x49')],'predictiveIntervalHitRate':_0x4af0f0[_0x0c45('0x4a')],'predictiveIntervalMultiplicativeFactor':_0x4af0f0[_0x0c45('0x4b')],'predictiveIntervalPauses':_0x4af0f0[_0x0c45('0x4c')],'predictiveIntervalAvailable':_0x4af0f0[_0x0c45('0x4d')],'predictiveIntervalTotalCalls':_0x4af0f0[_0x0c45('0x4e')],'message':_0x4af0f0[_0x0c45('0x4f')],'originated':_0x4af0f0['originated'],'erlangCalls':_0x4af0f0['erlangCalls'],'erlangCallToSecond':_0x4af0f0['erlangCallToSecond'],'erlangAbandonmentRate':_0x4af0f0[_0x0c45('0x50')],'erlangBusyFactor':_0x4af0f0[_0x0c45('0x51')],'startPredictive':_0x4af0f0[_0x0c45('0x52')],'startProgressive':_0x4af0f0[_0x0c45('0x53')]};if(_0x4af0f0[_0x0c45('0x54')]){_0x57020d[_0x0c45('0x54')]={'id':_0x4af0f0['Trunk']['id'],'name':_0x4af0f0[_0x0c45('0x54')]['name'],'active':_0x4af0f0['Trunk'][_0x0c45('0x55')],'callerid':_0x4af0f0[_0x0c45('0x54')][_0x0c45('0x56')]};}if(_0x4af0f0[_0x0c45('0x57')]){_0x57020d['Interval']={'id':_0x4af0f0[_0x0c45('0x57')]['id'],'name':_0x4af0f0[_0x0c45('0x57')]['name']};}var _0x420211=md5(JSON['stringify'](_0x57020d));if(_0x4af0f0['md5']!==_0x420211){_0x4af0f0['md5']=_0x420211;emit(util[_0x0c45('0x58')](_0x0c45('0x59'),_0x57020d[_0x0c45('0x28')]),'voice_queue:save',_0x57020d);}}}function emitVoiceQueueChannelRemove(_0x718222){logger[_0x0c45('0x5a')](_0x0c45('0x5b'),JSON[_0x0c45('0x5c')](_0x718222));emit(util[_0x0c45('0x58')](_0x0c45('0x59'),_0x718222[_0x0c45('0x28')]),_0x0c45('0x5d'),_0x718222);io['emit']('voice_queue_presence:remove',_0x718222);}function notSendMessagesQueue(_0x506aa8){if(_0x506aa8[_0x0c45('0x5e')]){if(_0x506aa8[_0x0c45('0x5f')]===0x0&&_0x506aa8['pTalking']===0x0){_0x506aa8[_0x0c45('0x5e')]=![];_0x506aa8[_0x0c45('0x60')]=0x0;_0x506aa8[_0x0c45('0x61')]=0x0;_0x506aa8[_0x0c45('0x4f')]='NOT_ACTIVE';ut['logger'](_0x0c45('0x62'),_0x506aa8[_0x0c45('0x28')]+_0x0c45('0x63'));}else{_0x506aa8[_0x0c45('0x4f')]=_0x0c45('0x64');ut[_0x0c45('0x65')](_0x0c45('0x62'),_0x506aa8[_0x0c45('0x28')]+'\x20is\x20disactive');}emitCampaignPreview(_0x506aa8);}}Preview[_0x0c45('0x11')][_0x0c45('0x24')]=function(){var _0x3feb09=this;setInterval(function(){_0x3feb09[_0x0c45('0x66')]();},0x7cf);};Preview[_0x0c45('0x11')][_0x0c45('0x66')]=function(){var _0x5e648b=this['campaignsPreview'];this[_0x0c45('0x67')]+=0x1;for(var _0x339273 in _0x5e648b){if(_0x5e648b[_0x0c45('0x68')](_0x339273)&&(_0x5e648b[_0x339273][_0x0c45('0x69')]==='preview'||_0x5e648b[_0x339273][_0x0c45('0x69')]==='booked')&&_0x5e648b[_0x339273]['type']==='outbound'){if(this[_0x0c45('0x67')]>0x7){this[_0x0c45('0x67')]=0x0;this[_0x0c45('0x6a')]();}}if(_0x5e648b[_0x0c45('0x68')](_0x339273)&&_0x5e648b[_0x339273][_0x0c45('0x69')]===_0x0c45('0x7')&&_0x5e648b[_0x339273]['type']===_0x0c45('0x27')){if(_0x5e648b[_0x339273][_0x0c45('0x34')]){this['setMessage'](_0x5e648b[_0x339273]);this['recallMe'](_0x5e648b[_0x339273]);}else{notSendMessagesQueue(_0x5e648b[_0x339273]);}}}};Preview[_0x0c45('0x11')][_0x0c45('0x6b')]=function(_0x367d35){var _0x449267=this;this['sequence'][_0x0c45('0x6c')](function(){if(!_[_0x0c45('0x6d')](_0x449267[_0x0c45('0x17')][_0x367d35])){loggerAction[_0x0c45('0x5a')](_0x0c45('0x6e'),_0x367d35,_0x0c45('0x6f'),_0x449267[_0x0c45('0x17')][_0x367d35][_0x0c45('0x70')],_0x0c45('0x71'),JSON[_0x0c45('0x5c')](_0x449267[_0x0c45('0x25')][_0x449267[_0x0c45('0x17')][_0x367d35]['queue']]['originated']),_0x0c45('0x72'),JSON['stringify'](_0x449267['campaignsPreview'][_0x449267[_0x0c45('0x17')][_0x367d35][_0x0c45('0x70')]][_0x0c45('0x2b')]),JSON[_0x0c45('0x5c')](_0x449267[_0x0c45('0x17')][_0x367d35]['dialAnswer']),JSON[_0x0c45('0x5c')](_[_0x0c45('0x73')](_0x449267[_0x0c45('0x17')][_0x367d35],['contactId',_0x0c45('0x74'),'VoiceQueueId',_0x0c45('0x75')])));return ami[_0x0c45('0x76')]({'action':_0x0c45('0x77'),'channel':_0x449267['actions'][_0x367d35][_0x0c45('0x78')]})['catch'](function(_0x33d39d){if(_0x33d39d[_0x0c45('0x4f')]===_0x0c45('0x79')){setTimeout(function(){if(_0x449267[_0x0c45('0x17')][_0x367d35]){ut['updateOriginated'](_0x449267[_0x0c45('0x25')][_0x449267[_0x0c45('0x17')][_0x367d35]['queue']],_0x0c45('0x7a'));if(_0x449267[_0x0c45('0x17')][_0x367d35][_0x0c45('0x7b')]===!![]){ut[_0x0c45('0x7c')](_0x449267[_0x0c45('0x25')][_0x449267[_0x0c45('0x17')][_0x367d35][_0x0c45('0x70')]],_0x0c45('0x7a'));ut[_0x0c45('0x7d')](_0x0c45('0x7e')+_0x367d35,_0x449267[_0x0c45('0x17')][_0x367d35][_0x0c45('0x70')]);}ut[_0x0c45('0x7d')]('[Dialer][checkChannel][Preview]'+_0x367d35,_0x449267['actions'][_0x367d35][_0x0c45('0x70')]);delete _0x449267['actions'][_0x367d35];}},0x2328);}});}});};Preview[_0x0c45('0x11')][_0x0c45('0x6a')]=function(){var _0xb9b10a=this;loggerAction['info'](_0x0c45('0x7f'),_['size'](this[_0x0c45('0x17')]));for(var _0x1adbf6 in this[_0x0c45('0x17')]){if(_0xb9b10a[_0x0c45('0x17')][_0x0c45('0x68')](_0x1adbf6)){_0xb9b10a['clearZombieChannel'](_0x1adbf6);}}};Preview[_0x0c45('0x11')][_0x0c45('0x80')]=function(_0x579f74){var _0x12223b=this;rpcDb[_0x0c45('0x81')](_0x579f74['id'],ut['agentReadyId'](this['agents']))['then'](function(_0xa9bb72){if(!_[_0x0c45('0x6d')](_0xa9bb72)){for(var _0x2234d3=0x0;_0x2234d3<_0xa9bb72[_0x0c45('0x82')];_0x2234d3+=0x1){if(ut[_0x0c45('0x83')](_0xa9bb72[_0x2234d3][_0x0c45('0x84')])<_0x579f74['dialRecallMeTimeout']*0x3c){if(_0xa9bb72[_0x2234d3]['Agent']&&!_0xa9bb72[_0x2234d3][_0x0c45('0x85')][_0x0c45('0x86')]){_0x12223b[_0x0c45('0x87')](_0xa9bb72[_0x2234d3]['id'])[_0x0c45('0x88')](ut[_0x0c45('0x89')](_0x0c45('0x8a')))['catch'](ut['logger2'](_0x0c45('0x8a')));}else{rpcDb['disableContact'](_0xa9bb72[_0x2234d3]['id']);}}else{var _0x3f1dbc=new Action(_0xa9bb72[_0x2234d3],_0x579f74);_0x3f1dbc[_0x0c45('0x8b')]=moment()[_0x0c45('0x58')](_0x0c45('0x8c'));_0x579f74[_0x0c45('0x41')]+=0x1;ut['logCustomer'](_0x3f1dbc,0x17,_0x0c45('0x8d'));if(_0x579f74[_0x0c45('0x8e')]){rpcDb[_0x0c45('0x8f')](ut[_0x0c45('0x90')](_0xa9bb72[_0x2234d3]));rpcDb[_0x0c45('0x91')](_0x3f1dbc,'[HistoryDialRecallInQueue][historyCatch]');}else{ut[_0x0c45('0x92')](_0x3f1dbc,0x16,'RecallFailedTimeout');rpcDb[_0x0c45('0x91')](_0x3f1dbc,_0x0c45('0x93'));rpcDb['createCustomerFinal'](_0x3f1dbc,_0x0c45('0x93'));}}}}})[_0x0c45('0x94')](ut['logger2'](_0x0c45('0x95')));};Preview['prototype'][_0x0c45('0x96')]=function(_0x17803b){_0x17803b[_0x0c45('0x5e')]=!![];if(ut['IsNotLoggedIn'](_0x17803b[_0x0c45('0x2a')])){_0x17803b[_0x0c45('0x4f')]=_0x0c45('0x97');}else if(!ut[_0x0c45('0x98')](_0x17803b[_0x0c45('0x34')])){_0x17803b[_0x0c45('0x4f')]=_0x0c45('0x99');}else if(!this[_0x0c45('0x9a')](_0x17803b[_0x0c45('0x54')])){if(!this['isTrunkReachable'](_0x17803b['TrunkBackup'])){_0x17803b[_0x0c45('0x4f')]=_0x0c45('0x9b');}else{_0x17803b[_0x0c45('0x4f')]='ACTIVE';}}else{_0x17803b['message']=_0x0c45('0x9c');}emitCampaignPreview(_0x17803b);};Preview['prototype'][_0x0c45('0x9d')]=function(_0x5a79dd,_0x3f5dc9,_0x2467c6){var _0xf49626=this;var _0x11868a=this['actions'][_0x3f5dc9];var _0x16bb15=this[_0x0c45('0x25')][_0x11868a['queue']];var _0x19b1e3;var _0x5404b1=![];var _0x3a49ee=0x2;var _0x1e39bd=0x3;if(_0x16bb15){switch(_0x2467c6){case'1':_0x16bb15[_0x0c45('0x3f')]+=0x1;_0x11868a[_0x0c45('0x9e')]+=0x1;_0x11868a['countglobal']=ut[_0x0c45('0x9f')](_0x11868a);ut[_0x0c45('0x92')](_0x11868a,0x0,_0x0c45('0xa0'));ami['emit'](_0x0c45('0xa1'),ut['buildObj'](_0x11868a,_0x0c45('0xa2')));rpcDb[_0x0c45('0x91')](_0x11868a,_0x0c45('0xa3'));_0xf49626[_0x0c45('0xa4')](_0x11868a,'0',_0x16bb15)['then'](function(_0x15b96d){_0x5404b1=_0x15b96d[_0x0c45('0xa5')]==0x1;_0x3a49ee=_0x16bb15[_0x0c45('0xa6')];_0x1e39bd=_0x16bb15['callAdditionalPhoneAfterMin'];if(!_0x5404b1){if(ut['totalGlobal'](_0x11868a)>=_0x16bb15[_0x0c45('0xa7')]){_0x19b1e3=ut['cloneAction'](_0x11868a,0xf,_0x0c45('0xa8'));rpcDb['createCustomerFinal'](_0x19b1e3,_0x0c45('0xa9'));}else{if(_0x11868a[_0x0c45('0x9e')]>=_0x16bb15[_0x0c45('0xaa')]){rpcDb[_0x0c45('0xab')](_0x11868a,_0x0c45('0xa9'));}else{rpcDb[_0x0c45('0xac')](ut[_0x0c45('0xad')](_0x11868a,'countnosuchnumberretry',_0x16bb15[_0x0c45('0xa6')]),_0x11868a[_0x0c45('0xae')],_0x11868a[_0x0c45('0xaf')]);}}delete this[_0x0c45('0x17')][_0x5a79dd[_0x0c45('0xb0')]];}else{_0x11868a[_0x0c45('0x9e')]++;logger[_0x0c45('0x5a')](_0x0c45('0xb1'),_0x11868a['countnosuchnumberretry']);logger[_0x0c45('0x5a')]('id',_0x11868a['idContact']);_0xf49626[_0x0c45('0xb2')]({'id':_0x11868a[_0x0c45('0xb3')],'field':{'countnosuchnumberretry':_0x11868a[_0x0c45('0x9e')]}})['then'](function(){_0xf49626[_0x0c45('0xb4')](_0x11868a,_0x3a49ee,_0x1e39bd)[_0x0c45('0x88')](function(){});});}});break;case _0x0c45('0xb5'):var _0x2b0dce=moment()[_0x0c45('0x58')](_0x0c45('0x8c'));_0x11868a[_0x0c45('0xb6')]=_0x2b0dce;_0x11868a[_0x0c45('0xb7')]=_0x2b0dce;_0x11868a[_0x0c45('0x7b')]=!![];_0x16bb15[_0x0c45('0x2b')]+=0x1;logger[_0x0c45('0x5a')](_0x0c45('0xb8'),_0x11868a[_0x0c45('0xb9')],_0x0c45('0xba'),_0x16bb15[_0x0c45('0x28')],'pTalking:\x20',_0x16bb15[_0x0c45('0x2b')]);ami[_0x0c45('0x26')](_0x0c45('0xbb'),ut[_0x0c45('0xbc')](_0x11868a,_0x0c45('0xbd'),this[_0x0c45('0x25')][_0x11868a[_0x0c45('0x70')]]));if(_0x16bb15['acw']){ami[_0x0c45('0x26')](_0x0c45('0xbe'),ut[_0x0c45('0xbf')](_0x11868a));}break;case'16':ami[_0x0c45('0x26')](_0x0c45('0xc0'),ut[_0x0c45('0xbc')](_0x11868a,_0x0c45('0xc1'),this[_0x0c45('0x25')][_0x11868a['queue']]));emitVoiceQueueChannelRemove(ut[_0x0c45('0xbc')](_0x11868a,_0x0c45('0xc1')));_0x16bb15[_0x0c45('0xc2')]+=0x1;_0x16bb15[_0x0c45('0xc3')]+=0x1;_0x16bb15[_0x0c45('0xc4')]+=0x1;ut[_0x0c45('0x7c')](_0x16bb15,_0x0c45('0xc5'));_0x11868a[_0x0c45('0xc6')]=ut[_0x0c45('0x9f')](_0x11868a);ut[_0x0c45('0x92')](_0x11868a,0x4,'Answer');rpcDb[_0x0c45('0x91')](_0x11868a,_0x0c45('0xc7'));rpcDb['createCustomerFinal'](_0x11868a,_0x0c45('0xc8'));rpcDb[_0x0c45('0xc9')](_0x11868a);_0x16bb15[_0x0c45('0x2d')]+=_0x11868a[_0x0c45('0xca')];_0x16bb15['sumBillable']+=_0x11868a[_0x0c45('0xca')];logger['info'](_0x0c45('0xcb'),_0x11868a[_0x0c45('0xb9')],_0x0c45('0xba'),_0x16bb15[_0x0c45('0x28')],_0x0c45('0x72'),_0x16bb15['pTalking']);delete this[_0x0c45('0x17')][_0x5a79dd[_0x0c45('0xb0')]];break;case'BUSY':_0x16bb15[_0x0c45('0x3a')]+=0x1;_0x11868a[_0x0c45('0xcc')]+=0x1;_0x11868a[_0x0c45('0xc6')]=ut[_0x0c45('0x9f')](_0x11868a);ut[_0x0c45('0x92')](_0x11868a,0x5,'Busy');_0x3a49ee=_0x16bb15[_0x0c45('0xcd')];_0x1e39bd=_0x16bb15['callAdditionalPhoneAfterMin'];ami[_0x0c45('0x26')](_0x0c45('0xce'),ut[_0x0c45('0xbc')](_0x11868a,_0x0c45('0xcf')));rpcDb[_0x0c45('0x91')](_0x11868a,'[callProgressDetectingCustomer][logBusy]');_0xf49626['verifyAdditionalPhones'](_0x11868a,'5',_0x16bb15)[_0x0c45('0x88')](function(_0x37eea3){_0x5404b1=_0x37eea3['additional']==0x1;if(!_0x5404b1){if(ut[_0x0c45('0x9f')](_0x11868a)>=_0x16bb15[_0x0c45('0xa7')]){_0x19b1e3=ut[_0x0c45('0xd0')](_0x11868a,0xf,_0x0c45('0xa8'));rpcDb[_0x0c45('0xab')](_0x19b1e3,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x11868a[_0x0c45('0xcc')]>=_0x16bb15[_0x0c45('0xd1')]){rpcDb[_0x0c45('0xab')](_0x11868a,_0x0c45('0xd2'));}else{rpcDb[_0x0c45('0xac')](ut[_0x0c45('0xad')](_0x11868a,'countbusyretry',_0x16bb15[_0x0c45('0xcd')]),_0x11868a[_0x0c45('0xae')],_0x11868a[_0x0c45('0xaf')]);}}}else{_0x11868a[_0x0c45('0xcc')]++;_0xf49626[_0x0c45('0xb2')]({'id':_0x11868a[_0x0c45('0xb3')],'field':{'countbusyretry':_0x11868a[_0x0c45('0xcc')]}})['then'](function(){_0xf49626[_0x0c45('0xb4')](_0x11868a,_0x3a49ee,_0x1e39bd)[_0x0c45('0x88')](function(){});});}});break;case _0x0c45('0xd3'):_0x16bb15[_0x0c45('0x3e')]+=0x1;_0x11868a[_0x0c45('0xd4')]+=0x1;_0x11868a['countglobal']=ut[_0x0c45('0x9f')](_0x11868a);ut['logCustomer'](_0x11868a,0x3,_0x0c45('0xd5'));_0x3a49ee=_0x16bb15[_0x0c45('0xd6')];_0x1e39bd=_0x16bb15[_0x0c45('0xd7')];ami[_0x0c45('0x26')](_0x0c45('0xd8'),ut[_0x0c45('0xbc')](_0x11868a,_0x0c45('0xd9')));rpcDb[_0x0c45('0x91')](_0x11868a,'[callProgressDetectingCustomer][logNoAnswer]');_0xf49626[_0x0c45('0xa4')](_0x11868a,'3',_0x16bb15)[_0x0c45('0x88')](function(_0x396230){_0x5404b1=_0x396230['additional']==0x1;if(!_0x5404b1){if(ut['totalGlobal'](_0x11868a)>=_0x16bb15[_0x0c45('0xa7')]){_0x19b1e3=ut[_0x0c45('0xd0')](_0x11868a,0xf,'Global');rpcDb[_0x0c45('0xab')](_0x19b1e3,_0x0c45('0xda'));}else{if(_0x11868a[_0x0c45('0xd4')]>=_0x16bb15[_0x0c45('0xdb')]){rpcDb[_0x0c45('0xab')](_0x11868a,_0x0c45('0xdc'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x11868a,'countnoanswerretry',_0x16bb15['dialNoAnswerRetryFrequency']),_0x11868a[_0x0c45('0xae')],_0x11868a[_0x0c45('0xaf')]);}}}else{_0x11868a[_0x0c45('0xd4')]++;_0xf49626['incrementPreviewCounters']({'id':_0x11868a[_0x0c45('0xb3')],'field':{'countnoanswerretry':_0x11868a['countnoanswerretry']}})[_0x0c45('0x88')](function(){_0xf49626['swapAdditionalPhones'](_0x11868a,_0x3a49ee,_0x1e39bd)[_0x0c45('0x88')](function(){});});}});break;case'CONGESTION':_0x16bb15[_0x0c45('0x3b')]+=0x1;_0x11868a[_0x0c45('0xdd')]+=0x1;_0x11868a['countglobal']=ut[_0x0c45('0x9f')](_0x11868a);ut[_0x0c45('0x92')](_0x11868a,0x8,'Congestion');_0x3a49ee=_0x16bb15[_0x0c45('0xde')];_0x1e39bd=_0x16bb15[_0x0c45('0xd7')];ami[_0x0c45('0x26')](_0x0c45('0xdf'),ut[_0x0c45('0xbc')](_0x11868a,_0x0c45('0xe0')));rpcDb['createCustomerHistory'](_0x11868a,_0x0c45('0xe1'));_0xf49626[_0x0c45('0xa4')](_0x11868a,'8',_0x16bb15)[_0x0c45('0x88')](function(_0x6d8937){_0x5404b1=_0x6d8937[_0x0c45('0xa5')]==0x1;if(!_0x5404b1){if(ut[_0x0c45('0x9f')](_0x11868a)>=_0x16bb15[_0x0c45('0xa7')]){_0x19b1e3=ut[_0x0c45('0xd0')](_0x11868a,0xf,_0x0c45('0xa8'));rpcDb[_0x0c45('0xab')](_0x19b1e3,_0x0c45('0xe2'));}else{if(_0x11868a['countcongestionretry']>=_0x16bb15[_0x0c45('0xe3')]){rpcDb[_0x0c45('0xab')](_0x11868a,_0x0c45('0xe1'));}else{rpcDb[_0x0c45('0xac')](ut['scheduledAt'](_0x11868a,_0x0c45('0xdd'),_0x16bb15[_0x0c45('0xcd')]),_0x11868a[_0x0c45('0xae')],_0x11868a[_0x0c45('0xaf')]);}}}else{_0x11868a['countcongestionretry']++;_0xf49626[_0x0c45('0xb2')]({'id':_0x11868a[_0x0c45('0xb3')],'field':{'countcongestionretry':_0x11868a[_0x0c45('0xdd')]}})['then'](function(){_0xf49626[_0x0c45('0xb4')](_0x11868a,_0x3a49ee,_0x1e39bd)[_0x0c45('0x88')](function(){});});}});break;case _0x0c45('0xe4'):_0x16bb15[_0x0c45('0x42')]+=0x1;_0x11868a[_0x0c45('0xe5')]+=0x1;_0x11868a[_0x0c45('0xc6')]=ut[_0x0c45('0x9f')](_0x11868a);ut[_0x0c45('0x92')](_0x11868a,0x14,_0x0c45('0xe6'));_0x3a49ee=_0x16bb15['dialAgentRejectRetryFrequency'];_0x1e39bd=_0x16bb15[_0x0c45('0xd7')];ami[_0x0c45('0x26')](_0x0c45('0xe7'),ut['buildObj'](_0x11868a,'agentreject'));rpcDb['createCustomerHistory'](_0x11868a,_0x0c45('0xe8'));_0xf49626['verifyAdditionalPhones'](_0x11868a,'20',_0x16bb15)[_0x0c45('0x88')](function(_0xba7e19){_0x5404b1=_0xba7e19[_0x0c45('0xa5')]==0x1;if(!_0x5404b1){if(ut[_0x0c45('0x9f')](_0x11868a)>=_0x16bb15[_0x0c45('0xa7')]){_0x19b1e3=ut[_0x0c45('0xd0')](_0x11868a,0x14,_0x0c45('0xe6'));rpcDb['createCustomerFinal'](_0x19b1e3,_0x0c45('0xe9'));}else{if(_0x11868a[_0x0c45('0xe5')]>=_0x16bb15[_0x0c45('0xea')]){rpcDb[_0x0c45('0xab')](_0x11868a,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x0c45('0xac')](ut[_0x0c45('0xad')](_0x11868a,'countagentrejectretry',_0x16bb15[_0x0c45('0xeb')]),_0x11868a[_0x0c45('0xae')],_0x11868a[_0x0c45('0xaf')]);}}}else{_0x11868a[_0x0c45('0xd4')]++;_0xf49626['incrementPreviewCounters']({'id':_0x11868a[_0x0c45('0xb3')],'field':{'countnoanswerretry':_0x11868a['countnoanswerretry']}})['then'](function(){_0xf49626[_0x0c45('0xb4')](_0x11868a,_0x3a49ee,_0x1e39bd)['then'](function(){});});}});break;case'ABANDONED':_0x16bb15[_0x0c45('0xec')]+=0x1;_0x11868a[_0x0c45('0xed')]+=0x1;_0x11868a['countglobal']=ut[_0x0c45('0x9f')](_0x11868a);ut[_0x0c45('0x92')](_0x11868a,0xb,'Abandoned');rpcDb[_0x0c45('0x91')](_0x11868a,_0x0c45('0xee'));_0xf49626[_0x0c45('0xa4')](_0x11868a,'11',_0x16bb15)[_0x0c45('0x88')](function(_0x42ac48){_0x5404b1=_0x42ac48[_0x0c45('0xa5')]==0x1;if(!_0x5404b1){if(ut[_0x0c45('0x9f')](_0x11868a)>=_0x16bb15['dialGlobalMaxRetry']){_0x19b1e3=ut[_0x0c45('0xd0')](_0x11868a,0xf,_0x0c45('0xa8'));rpcDb[_0x0c45('0xab')](_0x19b1e3,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x11868a[_0x0c45('0xef')]>=_0x16bb15[_0x0c45('0xf0')]){rpcDb[_0x0c45('0xab')](_0x11868a,_0x0c45('0xee'));}else{rpcDb[_0x0c45('0xac')](ut[_0x0c45('0xad')](_0x11868a,_0x0c45('0xed'),_0x16bb15['dialAbandonedRetryFrequency']),_0x11868a['unlockAgent'],_0x11868a[_0x0c45('0xaf')]);}}}else{_0x11868a['countnoanswerretry']++;_0xf49626['incrementPreviewCounters']({'id':_0x11868a['idContact'],'field':{'countnoanswerretry':_0x11868a[_0x0c45('0xd4')]}})[_0x0c45('0x88')](function(){_0xf49626[_0x0c45('0xb4')](_0x11868a,_0x3a49ee,_0x1e39bd)[_0x0c45('0x88')](function(){});});}});break;case'18':_0x16bb15[_0x0c45('0x43')]+=0x1;_0x11868a[_0x0c45('0xf1')]+=0x1;_0x11868a['countglobal']=ut[_0x0c45('0x9f')](_0x11868a);ut['logCustomer'](_0x11868a,0x12,_0x5a79dd['cause-txt']||_0x5a79dd[_0x0c45('0xf2')]);ami[_0x0c45('0x26')](_0x0c45('0xf3'),ut[_0x0c45('0xbc')](_0x11868a,'amd'));rpcDb[_0x0c45('0x91')](_0x11868a,'[callProgressDetectingCustomer][hangupInAMD]');_0xf49626[_0x0c45('0xa4')](_0x11868a,'18',_0x16bb15)[_0x0c45('0x88')](function(_0x58dfcd){_0x5404b1=_0x58dfcd[_0x0c45('0xa5')]==0x1;if(!_0x5404b1){if(ut[_0x0c45('0x9f')](_0x11868a)>=_0x16bb15[_0x0c45('0xa7')]){_0x19b1e3=ut[_0x0c45('0xd0')](_0x11868a,0x12,_0x0c45('0xa8'));rpcDb['createCustomerFinal'](_0x19b1e3,_0x0c45('0xf4'));}else{rpcDb['createCustomerFinal'](_0x11868a,_0x0c45('0xf4'));}}else{_0x11868a[_0x0c45('0xd4')]++;_0xf49626[_0x0c45('0xb2')]({'id':_0x11868a[_0x0c45('0xb3')],'field':{'countnoanswerretry':_0x11868a[_0x0c45('0xd4')]}})['then'](function(){_0xf49626[_0x0c45('0xb4')](_0x11868a,_0x3a49ee,_0x1e39bd)[_0x0c45('0x88')](function(){});});}});delete this['actions'][_0x5a79dd[_0x0c45('0xb0')]];break;case'19':_0x16bb15[_0x0c45('0x43')]+=0x1;_0x11868a['countglobal']=ut['totalGlobal'](_0x11868a);ut[_0x0c45('0x92')](_0x11868a,0x13,_0x5a79dd[_0x0c45('0xf5')]||_0x5a79dd['dialstatus']);ami['emit'](_0x0c45('0xf3'),ut[_0x0c45('0xbc')](_0x11868a,_0x0c45('0xf6')));rpcDb[_0x0c45('0x91')](_0x11868a,_0x0c45('0xf7'));_0xf49626[_0x0c45('0xa4')](_0x11868a,'18',_0x16bb15)['then'](function(_0x51d906){_0x5404b1=_0x51d906[_0x0c45('0xa5')]==0x1;if(!_0x5404b1){if(ut[_0x0c45('0x9f')](_0x11868a)>=_0x16bb15['dialGlobalMaxRetry']){_0x19b1e3=ut[_0x0c45('0xd0')](_0x11868a,0xf,_0x0c45('0xa8'));rpcDb[_0x0c45('0xab')](_0x19b1e3,_0x0c45('0xf7'));}else{rpcDb[_0x0c45('0xab')](_0x11868a,'[callProgressDetectingCustomer][machine]');}}else{_0x11868a[_0x0c45('0xd4')]++;_0xf49626['incrementPreviewCounters']({'id':_0x11868a[_0x0c45('0xb3')],'field':{'countnoanswerretry':_0x11868a['countnoanswerretry']}})[_0x0c45('0x88')](function(){_0xf49626[_0x0c45('0xb4')](_0x11868a,_0x3a49ee,_0x1e39bd)[_0x0c45('0x88')](function(){});});}});delete this[_0x0c45('0x17')][_0x5a79dd[_0x0c45('0xb0')]];break;default:if(_0x11868a[_0x0c45('0x7b')]){ut[_0x0c45('0x7c')](_0x16bb15,_0x0c45('0xf8'));ut[_0x0c45('0x7d')]('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x16bb15[_0x0c45('0x28')],_0x5a79dd);}_0x16bb15[_0x0c45('0x43')]+=0x1;_0x11868a[_0x0c45('0xc6')]=ut[_0x0c45('0x9f')](_0x11868a);ut[_0x0c45('0x92')](_0x11868a,0xc,_0x5a79dd[_0x0c45('0xf5')]||_0x5a79dd[_0x0c45('0xf2')]);_0x3a49ee=_0x16bb15[_0x0c45('0xeb')];_0x1e39bd=_0x16bb15[_0x0c45('0xd7')];rpcDb[_0x0c45('0x91')](_0x11868a,_0x0c45('0xf9'));_0xf49626['verifyAdditionalPhones'](_0x11868a,'20',_0x16bb15)['then'](function(_0x106d46){_0x5404b1=_0x106d46[_0x0c45('0xa5')]==0x1;if(!_0x5404b1){if(ut[_0x0c45('0x9f')](_0x11868a)>=_0x16bb15[_0x0c45('0xa7')]){_0x19b1e3=ut[_0x0c45('0xd0')](_0x11868a,0xf,_0x0c45('0xa8'));rpcDb[_0x0c45('0xab')](_0x19b1e3,_0x0c45('0xfa'));}else{rpcDb[_0x0c45('0xab')](_0x11868a,_0x0c45('0xfa'));}delete this[_0x0c45('0x17')][_0x5a79dd[_0x0c45('0xb0')]];}else{_0xf49626['swapAdditionalPhones'](_0x11868a,_0x3a49ee,_0x1e39bd)[_0x0c45('0x88')](function(_0x7d3455){});}});}if(!(_0x11868a['dialAnswer']&&_0x2467c6==='16')){ut[_0x0c45('0xfb')](_0x16bb15,_0x0c45('0xfc'));logger['info'](_0x0c45('0xfd'),_0x11868a[_0x0c45('0xb9')],_0x0c45('0xba'),_0x16bb15[_0x0c45('0x28')],_0x0c45('0x71'),_0x16bb15['originated']);}if(_0x2467c6!==_0x0c45('0xb5')){delete this['actions'][_0x5a79dd[_0x0c45('0xb0')]];delete this[_0x0c45('0x17')][_0x5a79dd[_0x0c45('0xfe')]];}}};Preview[_0x0c45('0x11')][_0x0c45('0xff')]=function(_0x1bc009,_0x5173bd,_0x22e68e){if(_['isUndefined'](_0x5173bd)&&_0x0c45('0x100')!==typeof _0x5173bd){return;}if(_['isUndefined'](_0x22e68e)&&_0x0c45('0x100')!==typeof _0x22e68e){return;}switch(_0x22e68e[_0x0c45('0x101')]){case'0':ut[_0x0c45('0x102')](_0x1bc009,0x0,_0x0c45('0xa0'));rpcDb['createAgentHistory'](_0x1bc009,_0x0c45('0x103'));break;case'3':ut[_0x0c45('0x102')](_0x1bc009,0x3,'NoAnswer');rpcDb[_0x0c45('0x104')](_0x1bc009,_0x0c45('0x105'));break;case'5':ut[_0x0c45('0x102')](_0x1bc009,0x5,_0x0c45('0x106'));rpcDb[_0x0c45('0x104')](_0x1bc009,'[callProgressDetectingAgent][logBusy]');break;case'8':ut[_0x0c45('0x102')](_0x1bc009,0x8,_0x0c45('0x107'));rpcDb[_0x0c45('0x104')](_0x1bc009,_0x0c45('0x108'));break;case'22':ut['logAgent'](_0x1bc009,0x16,_0x0c45('0x109'));rpcDb[_0x0c45('0x104')](_0x1bc009,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut['logAgent'](_0x1bc009,0xc,_0x22e68e[_0x0c45('0x101')]);rpcDb[_0x0c45('0x104')](_0x1bc009,_0x0c45('0x108'));}ut[_0x0c45('0xfb')](_0x5173bd,_0x0c45('0x10a'));logger[_0x0c45('0x5a')](_0x0c45('0x10b'),_0x1bc009[_0x0c45('0xb9')],_0x0c45('0xba'),_0x5173bd[_0x0c45('0x28')],_0x0c45('0x71'),_0x5173bd[_0x0c45('0x5f')]);delete this[_0x0c45('0x17')][_0x1bc009[_0x0c45('0xb9')]];};Preview[_0x0c45('0x11')]['verifyAdditionalPhones']=function(_0xabd9ea,_0x2775aa,_0x297d5c){return BPromise[_0x0c45('0x10c')]()['then'](cmHopperAdditionalPhone['verifyAdditionalPhones'](_0xabd9ea,_0x2775aa,_0x297d5c))[_0x0c45('0x94')](logger[_0x0c45('0x5a')](_0x0c45('0x10d')));};Preview['prototype']['swapAdditionalPhones']=function(_0x4214af,_0x3c658d,_0x476d9c){return BPromise[_0x0c45('0x10c')]()['then'](cmHopperAdditionalPhone[_0x0c45('0xb4')](_0x4214af,_0x3c658d,_0x476d9c))[_0x0c45('0x94')](logger[_0x0c45('0x5a')](_0x0c45('0x10e')));};Preview[_0x0c45('0x11')][_0x0c45('0xb2')]=function(_0xfaa382){return BPromise[_0x0c45('0x10c')]()[_0x0c45('0x88')](cmHopperAdditionalPhone[_0x0c45('0xb2')](_0xfaa382))[_0x0c45('0x94')](logger[_0x0c45('0x5a')](_0x0c45('0x10f')));};Preview[_0x0c45('0x11')][_0x0c45('0x110')]=function(_0x1f967c,_0x427115,_0x268494,_0x996d2a,_0x10d177){var _0x42e636=this;return new BPromise(function(_0x5cac9f,_0x525de4){if(_[_0x0c45('0x6d')](_0x427115)||_['isNil'](_0x427115['Contact'])||_[_0x0c45('0x6d')](_0x427115[_0x0c45('0x111')])||_[_0x0c45('0x6d')](_0x427115[_0x0c45('0x112')])){_0x525de4(ut[_0x0c45('0x4f')](_0x0c45('0x113'),_0x996d2a,_0x10d177));return;}var _0x1f478d=uuid['v4']();var _0xa4cff1=_0x42e636[_0x0c45('0x25')][_0x427115[_0x0c45('0x6f')]['name']];var _0x4a1eea=_0x268494?_0x42e636['agents'][_0x268494]['id']:undefined;_0x42e636[_0x0c45('0x17')][_0x1f478d]=new Action(_0x427115,_0xa4cff1,_0x1f478d,_0x268494,_0x4a1eea);var _0x473855=_0x42e636[_0x0c45('0x17')][_0x1f478d];_0x473855[_0x0c45('0xae')]=_0x996d2a;_0x473855[_0x0c45('0xaf')]=_0x10d177;_0x473855['lookAgent']=_0x268494;if(_[_0x0c45('0x114')](_0x1f967c)){_0x42e636['execCall'](_0x473855,_0xa4cff1,_0x427115,_0x268494)[_0x0c45('0x88')](function(_0x4182d7){logger['info'](_0x0c45('0x115'),_0x0c45('0x116')+_0x473855[_0x0c45('0x70')]+_0x0c45('0x117')+_0x473855[_0x0c45('0xb3')],JSON[_0x0c45('0x5c')](_0x4182d7));ami[_0x0c45('0x26')](_0x0c45('0x118'),ut[_0x0c45('0xbc')](_0x473855,'called',_0x42e636['campaignsPreview'][_0x473855[_0x0c45('0x70')]]));_0x5cac9f(ut[_0x0c45('0x4f')](_0x0c45('0x119')));})[_0x0c45('0x94')](function(_0xa234a9){ut['logger'](_0x0c45('0x11a'),_0xa234a9);_0x525de4(ut[_0x0c45('0x4f')](_0x0c45('0x11b'),_0x996d2a,_0x10d177));});}else{_0xa4cff1[_0x0c45('0x39')]+=0x1;ut[_0x0c45('0x11c')](_0x473855);rpcDb[_0x0c45('0x11d')](_0x473855,'[Blacklist][error]');delete _0x42e636[_0x0c45('0x17')][_0x1f478d];_0x525de4(ut['message'](_0x0c45('0x11e'),_0x996d2a,_0x10d177));}});};Preview[_0x0c45('0x11')]['isTrunkReachable']=function(_0x54713b){return!_['isNil'](_0x54713b)&&!_[_0x0c45('0x6d')](_0x54713b['name'])&&!_[_0x0c45('0x6d')](_0x54713b[_0x0c45('0x55')])&&_0x54713b['active']&&!_[_0x0c45('0x6d')](this[_0x0c45('0x16')][util['format']('SIP/%s',_0x54713b[_0x0c45('0x28')])])&&!_[_0x0c45('0x6d')](this['trunks'][util[_0x0c45('0x58')]('SIP/%s',_0x54713b[_0x0c45('0x28')])]['status'])&&(this[_0x0c45('0x16')][util[_0x0c45('0x58')](_0x0c45('0x11f'),_0x54713b[_0x0c45('0x28')])][_0x0c45('0x77')]==='reachable'||this[_0x0c45('0x16')][util[_0x0c45('0x58')]('SIP/%s',_0x54713b[_0x0c45('0x28')])][_0x0c45('0x77')]===_0x0c45('0x120'));};Preview['prototype'][_0x0c45('0x87')]=function(_0x448e36,_0x4995b3){var _0xcf69fa=this;return new BPromise(function(_0x12d6be,_0x3dcd9f){_0xcf69fa[_0x0c45('0x121')](_0x448e36,_0x4995b3)[_0x0c45('0x88')](function(_0xc690aa){_0x12d6be(_[_0x0c45('0x73')](_0xc690aa,[_0x0c45('0x4f')]));})[_0x0c45('0x94')](function(_0xc491f1){if(_0xc491f1['unlock']){rpcDb['unlockContact'](_0x448e36);}if(_0xc491f1[_0x0c45('0x55')]){rpcDb[_0x0c45('0x122')](_0x448e36);}_0x3dcd9f(_[_0x0c45('0x73')](_0xc491f1,[_0x0c45('0x4f')]));});});};Preview['prototype'][_0x0c45('0x121')]=function(_0x2dba97,_0x56b88c){var _0x9fe23=this;return new BPromise(function(_0x20e350,_0x5c2522){var _0x114dd5,_0x3daa0e;rpcDb[_0x0c45('0x123')](_0x2dba97)[_0x0c45('0x88')](function(_0x5cace5){if(!_['isNil'](_0x5cace5[0x0])){_0x3daa0e=_0x5cace5[0x0][_0x0c45('0x124')]?![]:!![];_0x114dd5=_0x5cace5[0x0][_0x0c45('0x124')]?!![]:![];_0x114dd5=_0x56b88c?!![]:_0x114dd5;}var _0x2adbfe=_0x9fe23[_0x0c45('0x125')](_0x5cace5);if(_0x2adbfe[_0x0c45('0x126')]){rpcDb[_0x0c45('0x127')](_[_0x0c45('0x73')](_0x5cace5[0x0],['VoiceQueueId',_0x0c45('0x111')]))['then'](function(_0x143bba){_0x9fe23['checkInBlack'](_0x143bba,_0x5cace5[0x0],_0x56b88c,_0x3daa0e,_0x114dd5)['then'](function(_0x444d57){_0x20e350(_0x444d57);})['catch'](function(_0x1a30f1){_0x5c2522(_0x1a30f1);});})[_0x0c45('0x94')](function(_0x78d7a6){ut[_0x0c45('0x65')]('[Preview][checkIsBlackList]',_0x78d7a6);_0x5c2522(ut[_0x0c45('0x4f')](_0x0c45('0x128'),_0x3daa0e,_0x114dd5));});}else{_0x5c2522(ut[_0x0c45('0x4f')](_0x2adbfe['message'],_0x3daa0e,_0x114dd5));}})[_0x0c45('0x94')](function(_0x5b088a){ut[_0x0c45('0x65')](_0x0c45('0x129'),_0x5b088a);_0x5c2522(ut[_0x0c45('0x4f')](_0x0c45('0x128'),![],!![]));});});};Preview[_0x0c45('0x11')][_0x0c45('0x125')]=function(_0x2cae35){if(_['isNil'](_0x2cae35)||_[_0x0c45('0x114')](_0x2cae35)||!_[_0x0c45('0x6d')](_0x2cae35[0x0][_0x0c45('0x85')])&&_[_0x0c45('0x6d')](_0x2cae35[0x0]['Agent'][_0x0c45('0x28')])){ut[_0x0c45('0x65')](_0x0c45('0x12a'),_0x2cae35);return{'isValid':![],'message':_0x0c45('0x12b')};}var _0x49df5f=this[_0x0c45('0x25')][_0x2cae35[0x0][_0x0c45('0x6f')][_0x0c45('0x28')]];_0x49df5f[_0x0c45('0x4f')]=_0x0c45('0x9c');if(_[_0x0c45('0x6d')](_0x49df5f)){ut[_0x0c45('0x65')]('[Preview][validateContact][Empty\x20Campaign]',_0x49df5f);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this['isTrunkReachable'](_0x49df5f[_0x0c45('0x54')])){ut[_0x0c45('0x65')](_0x0c45('0x12c'),_0x0c45('0x12d')+_0x49df5f['name']+_0x0c45('0x12e'));if(!this['isTrunkReachable'](_0x49df5f['TrunkBackup'])){ut[_0x0c45('0x65')](_0x0c45('0x12c'),_0x49df5f[_0x0c45('0x28')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0x0c45('0x12f')};}}if(!ut[_0x0c45('0x98')](_0x49df5f[_0x0c45('0x34')])){ut[_0x0c45('0x65')](_0x0c45('0x130'),_0x49df5f['name']+'\x20Not\x20Active');return{'isValid':![],'message':_0x0c45('0x12d')+_0x49df5f[_0x0c45('0x28')]+_0x0c45('0x131')};}return{'isValid':!![],'message':_0x0c45('0x132')};};Preview[_0x0c45('0x11')][_0x0c45('0x133')]=function(_0x7f8adc,_0x111d9e,_0x1b47f1,_0x40a026){var _0x10e294=this;return new BPromise(function(_0x29a231,_0x3224ce){var _0x5491e2=_0x7f8adc['uniqueid'];var _0x38d923=_0x10e294[_0x0c45('0x9a')](_0x111d9e[_0x0c45('0x54')])?util['format'](_0x0c45('0x134'),_0x111d9e['Trunk']['name'],_[_0x0c45('0x6d')](_0x111d9e['dialPrefix'])?'':_0x111d9e[_0x0c45('0x37')][_0x0c45('0x135')]()||'',_0x111d9e['dialCutDigit']>0x0?_0x1b47f1[_0x0c45('0x111')][_0x0c45('0x136')](_0x111d9e['dialCutDigit']):_0x1b47f1[_0x0c45('0x111')]):util[_0x0c45('0x58')](_0x0c45('0x134'),_['isNil'](_0x111d9e[_0x0c45('0x137')])?_0x111d9e[_0x0c45('0x54')][_0x0c45('0x28')]:_0x111d9e[_0x0c45('0x137')][_0x0c45('0x28')],_[_0x0c45('0x6d')](_0x111d9e[_0x0c45('0x37')])?'':_0x111d9e['dialPrefix'][_0x0c45('0x135')]()||'',_0x111d9e[_0x0c45('0x138')]>0x0?_0x1b47f1[_0x0c45('0x111')][_0x0c45('0x136')](_0x111d9e[_0x0c45('0x138')]):_0x1b47f1['phone']);var _0x213e2d=_0x10e294[_0x0c45('0x9a')](_0x111d9e['Trunk'])?ut[_0x0c45('0x139')](_0x111d9e['Trunk']['callerid'],_0x111d9e[_0x0c45('0x13a')],_0x111d9e[_0x0c45('0x13b')]>0x0?ut[_0x0c45('0x13c')](_0x111d9e['dialOriginateCallerIdNumber'],_0x111d9e[_0x0c45('0x13b')]):_0x111d9e[_0x0c45('0x35')]):ut[_0x0c45('0x139')](_[_0x0c45('0x6d')](_0x111d9e[_0x0c45('0x137')])?_0x111d9e['Trunk'][_0x0c45('0x56')]:_0x111d9e[_0x0c45('0x137')][_0x0c45('0x56')],_0x111d9e['dialOriginateCallerIdName'],_0x111d9e[_0x0c45('0x13b')]>0x0?ut[_0x0c45('0x13c')](_0x111d9e[_0x0c45('0x35')],_0x111d9e[_0x0c45('0x13b')]):_0x111d9e['dialOriginateCallerIdNumber']);if(_0x213e2d){_0x7f8adc['originatecalleridname']=ut[_0x0c45('0x13d')](_0x213e2d);_0x7f8adc[_0x0c45('0x13e')]=ut[_0x0c45('0x13f')](_0x213e2d);}var _0x1312dc=ut[_0x0c45('0x140')](_0x111d9e,_0x1b47f1,_0x38d923,_0x213e2d,_0x5491e2,_0x7f8adc);_[_0x0c45('0x141')](_0x7f8adc,ut[_0x0c45('0x142')](_0x1312dc));_0x7f8adc[_0x0c45('0x8b')]=moment()['format'](_0x0c45('0x8c'));ami[_0x0c45('0x76')](ut[_0x0c45('0x143')](_0x7f8adc,_0x111d9e,_0x1312dc,_0x7f8adc[_0x0c45('0xaf')],_0x40a026))[_0x0c45('0x88')](function(_0x5de17a){var _0x277014=_0x7f8adc['channelAgent'];if(!_[_0x0c45('0x6d')](_0x277014)){if(!_[_0x0c45('0x6d')](_0x10e294[_0x0c45('0x18')][_0x277014])){_0x10e294['agents'][_0x277014][_0x0c45('0x144')]=_0x7f8adc[_0x0c45('0x145')];emit(util[_0x0c45('0x58')](_0x0c45('0x146'),_0x10e294[_0x0c45('0x18')][_0x277014][_0x0c45('0x28')]),'user:agentconnect',{'destaccountcode':_0x10e294[_0x0c45('0x18')][_0x277014][_0x0c45('0x147')],'destconnectedlinenum':_0x7f8adc['calleridnum']});}}_0x111d9e[_0x0c45('0x5f')]+=0x1;logger[_0x0c45('0x5a')](_0x0c45('0x148'),_0x5491e2,_0x0c45('0xba'),_0x111d9e[_0x0c45('0x28')],_0x0c45('0x71'),_0x111d9e[_0x0c45('0x5f')]);_0x29a231(_0x5de17a);})[_0x0c45('0x94')](function(_0x599f63){ut['logAgent'](_0x7f8adc,0xe,_0x0c45('0x149'));rpcDb['createAgentHistory'](_0x7f8adc,_0x0c45('0x14a'));_0x3224ce(_0x599f63);});});};Preview[_0x0c45('0x11')][_0x0c45('0x14b')]=function(_0x347b08){if(this[_0x0c45('0x17')][_0x347b08[_0x0c45('0xb0')]]){this['actions'][_0x347b08[_0x0c45('0xb0')]]['channel']=_0x347b08['channel'];}};Preview['prototype']['syncOriginateResponse']=function(_0x39cd86){var _0x1b3016=this;var _0x29b9b3=this[_0x0c45('0x17')][_0x39cd86['actionid']];if(_0x29b9b3){if(_0x29b9b3[_0x0c45('0x14c')]&&this[_0x0c45('0x18')][_0x29b9b3['lookAgent']]){ut['logLookAgent'](_0x29b9b3,this['agents'][_0x29b9b3[_0x0c45('0x14c')]][_0x0c45('0x28')],this[_0x0c45('0x18')][_0x29b9b3['lookAgent']]['id']);}var _0x3bbb3c=_[_0x0c45('0x14d')](_0x29b9b3);_0x3bbb3c[_0x0c45('0xb6')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x267fdb=_0x1b3016[_0x0c45('0x25')][_0x29b9b3[_0x0c45('0x70')]];if(ut[_0x0c45('0x14e')](_0x39cd86[_0x0c45('0x14f')])){if(_0x29b9b3[_0x0c45('0xae')]){rpcDb[_0x0c45('0x150')](_0x29b9b3['idContact']);}if(_0x29b9b3[_0x0c45('0xaf')]){rpcDb[_0x0c45('0x122')](_0x29b9b3['idContact']);}ami[_0x0c45('0x26')](_0x0c45('0x151'),ut[_0x0c45('0xbc')](_0x29b9b3,_0x0c45('0x152'),this[_0x0c45('0x25')][_0x29b9b3[_0x0c45('0x70')]]));this[_0x0c45('0xff')](_0x3bbb3c,_0x267fdb,_0x39cd86);}else{_0x29b9b3['starttime']=moment()[_0x0c45('0x58')]('YYYY-MM-DD\x20HH:mm:ss');ut[_0x0c45('0x102')](_0x3bbb3c,0x4,'Answer');rpcDb[_0x0c45('0x104')](_0x3bbb3c,_0x0c45('0x153'));}}};Preview[_0x0c45('0x11')][_0x0c45('0x1d')]=function(_0x29582b){var _0x17ff8a=this;var _0x5a6031=this[_0x0c45('0x17')][_0x29582b['linkedid']];var _0xee62dc;if(_0x5a6031){_0xee62dc=this['campaignsPreview'][_0x5a6031[_0x0c45('0x70')]];logger[_0x0c45('0x5a')](_0x0c45('0x154'),_0x29582b[_0x0c45('0xb0')],_0x0c45('0xba'),_0xee62dc[_0x0c45('0x28')],'pTalking:\x20',_0xee62dc[_0x0c45('0x2b')]);}if(this[_0x0c45('0x17')][_0x29582b[_0x0c45('0xb0')]]&&_0x29582b['linkedid']!==_0x29582b[_0x0c45('0xb9')]){if(_0x29582b['cause']==='16'&&this[_0x0c45('0x17')][_0x29582b['linkedid']][_0x0c45('0x7b')]){this[_0x0c45('0x9d')](_0x29582b,_0x29582b[_0x0c45('0xb0')],_0x29582b['cause']);}else if(this[_0x0c45('0x17')][_0x29582b[_0x0c45('0xb0')]][_0x0c45('0x7b')]){logger[_0x0c45('0x5a')]('[syncHangup][talking][cause]',_0x29582b[_0x0c45('0xb0')],_0x29582b['cause'],_0x0c45('0xba'),_0xee62dc[_0x0c45('0x28')],_0x0c45('0x72'),_0xee62dc[_0x0c45('0x2b')]);this[_0x0c45('0x9d')](_0x29582b,_0x29582b[_0x0c45('0xb0')],_0x29582b[_0x0c45('0x155')]);}}else if(_0x5a6031&&_[_0x0c45('0x6d')](_0x5a6031[_0x0c45('0x156')])&&_0xee62dc[_0x0c45('0x157')]&&_0x29582b[_0x0c45('0xb0')]===_0x29582b[_0x0c45('0xb9')]&&_[_0x0c45('0x6d')](_0x29582b[_0x0c45('0x101')])&&_0x29582b[_0x0c45('0x155')]==='16'&&_0x29582b[_0x0c45('0x158')]==='6'&&_[_0x0c45('0x159')](_0x5a6031['transfer'])){if(_0x5a6031[_0x0c45('0xae')]){rpcDb['unlockContact'](_0x5a6031[_0x0c45('0xb3')]);}if(_0x5a6031[_0x0c45('0xaf')]){rpcDb[_0x0c45('0x122')](_0x5a6031[_0x0c45('0xb3')]);}_0x29582b[_0x0c45('0x101')]='22';this['callProgressDetectingAgent'](_0x5a6031,_0xee62dc,_0x29582b);}else if(_0x5a6031&&_0x5a6031[_0x0c45('0x15a')]){if(_0x29582b[_0x0c45('0x155')]==='16'&&this[_0x0c45('0x17')][_0x29582b['linkedid']][_0x0c45('0x7b')]){logger[_0x0c45('0x5a')](_0x0c45('0x15b'),_0x29582b[_0x0c45('0xb0')],_0x29582b[_0x0c45('0x155')],_0x0c45('0xba'),_0xee62dc['name'],_0x0c45('0x72'),_0xee62dc[_0x0c45('0x2b')]);this[_0x0c45('0x9d')](_0x29582b,_0x29582b[_0x0c45('0xb0')],_0x29582b[_0x0c45('0x155')]);}else if(this[_0x0c45('0x17')][_0x29582b[_0x0c45('0xb0')]][_0x0c45('0x7b')]){logger['info']('[syncHangup][talking][cause]',_0x29582b['linkedid'],_0x29582b['cause'],'\x20Queue',_0xee62dc[_0x0c45('0x28')],_0x0c45('0x72'),_0xee62dc[_0x0c45('0x2b')]);this[_0x0c45('0x9d')](_0x29582b,_0x29582b[_0x0c45('0xb0')],_0x29582b[_0x0c45('0x155')]);}}};Preview[_0x0c45('0x11')][_0x0c45('0x1e')]=function(_0x151f48){if(this['actions'][_0x151f48['destlinkedid']]&&_0x151f48['destlinkedid']!==_0x151f48[_0x0c45('0x15c')]){this['callProgressDetectingCustomer'](_0x151f48,_0x151f48[_0x0c45('0xfe')],_0x151f48[_0x0c45('0xf2')]);}};Preview[_0x0c45('0x11')][_0x0c45('0x15d')]=function(_0x4c1ea3){if(this[_0x0c45('0x17')][_0x4c1ea3[_0x0c45('0xb0')]]&&_0x4c1ea3[_0x0c45('0xb0')]!==_0x4c1ea3[_0x0c45('0xb9')]&&!this[_0x0c45('0x17')][_0x4c1ea3[_0x0c45('0xb0')]]['dialAnswer']){if(_0x4c1ea3[_0x0c45('0x155')]==='1'){this[_0x0c45('0x9d')](_0x4c1ea3,_0x4c1ea3[_0x0c45('0xb0')],_0x4c1ea3['cause']);}}};Preview['prototype'][_0x0c45('0x15e')]=function(_0xea0feb,_0xcd6eeb,_0x5b25ee){if(this['actions'][_0xea0feb]){if(_[_0x0c45('0x6d')](this[_0x0c45('0x17')][_0xea0feb][_0x0c45('0x15f')])){this[_0x0c45('0x17')][_0xea0feb][_0x0c45('0x15f')]={};}this[_0x0c45('0x17')][_0xea0feb][_0x0c45('0x15f')][_0xcd6eeb]=_0x5b25ee;}};Preview[_0x0c45('0x11')][_0x0c45('0x20')]=function(_0x36a6ab){try{if(!_[_0x0c45('0x6d')](_0x36a6ab)){if(ut[_0x0c45('0x160')](_[_0x0c45('0x161')](_0x36a6ab['variable'])[0x0])){this[_0x0c45('0x15e')](_0x36a6ab['uniqueid'],_['keys'](_0x36a6ab[_0x0c45('0x162')])[0x0],_0x36a6ab[_0x0c45('0x163')]);}}}catch(_0x2dc30f){logger[_0x0c45('0x164')](_0x0c45('0x165'),util[_0x0c45('0x166')](_0x2dc30f,{'showHidden':![],'depth':null}));}};Preview[_0x0c45('0x11')]['syncAttendedTransfer']=function(_0x4b6762){if(_0x4b6762){if(this[_0x0c45('0x17')][_0x4b6762['transfertargetlinkedid']]){this['actions'][_0x4b6762[_0x0c45('0x167')]][_0x0c45('0x15a')]=!![];}}};Preview[_0x0c45('0x11')][_0x0c45('0x23')]=function(_0x14b624){if(_0x14b624){if(this['actions'][_0x14b624[_0x0c45('0x168')]]){this['actions'][_0x14b624[_0x0c45('0x168')]][_0x0c45('0x15a')]=!![];}}};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 c247484..0253456 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 _0x39ff=['lastAssignedTo','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','resolve','then','createHistory','catch','[createHistory]\x20','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','unlockContact','[unlockContact]\x20','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','assigned'];(function(_0x31cb5f,_0x2df766){var _0x586042=function(_0x53c807){while(--_0x53c807){_0x31cb5f['push'](_0x31cb5f['shift']());}};_0x586042(++_0x2df766);}(_0x39ff,0x1b7));var _0xf39f=function(_0x8616ff,_0x2c6768){_0x8616ff=_0x8616ff-0x0;var _0x530370=_0x39ff[_0x8616ff];return _0x530370;};'use strict';var util=require(_0xf39f('0x0'));var BPromise=require(_0xf39f('0x1'));var logger=require(_0xf39f('0x2'))(_0xf39f('0x3'));var _=require(_0xf39f('0x4'));var cmHopper=require(_0xf39f('0x5'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0xf39f('0x6'));var cmHopperBlack=require(_0xf39f('0x7'));var voiceQueueRt=require('../rpc/voiceQueueRt');var agentReportPreview=require(_0xf39f('0x8'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x3592c1){return function(_0x35cb33){logger['error'](_0x3592c1,util['inspect'](_0x35cb33,{'showHidden':![],'depth':null}));};}function create(_0x5825b0){return BPromise[_0xf39f('0x9')]()[_0xf39f('0xa')](cmHopperHistory[_0xf39f('0xb')](_0x5825b0))[_0xf39f('0xc')](loggerCatch(_0xf39f('0xd')));}function createAgent(_0x54e673){return BPromise[_0xf39f('0x9')]()[_0xf39f('0xa')](agentReportPreview[_0xf39f('0xb')](_0x54e673))[_0xf39f('0xc')](loggerCatch(_0xf39f('0xd')));}function moveContact(_0x2ec5ff){return BPromise['resolve']()[_0xf39f('0xa')](cmHopper['moveContactManagedDialer'](_0x2ec5ff,!![]))['catch'](loggerCatch(_0xf39f('0xe')));}exports[_0xf39f('0xf')]=function(_0x2e0773){return BPromise[_0xf39f('0x9')]()[_0xf39f('0xa')](cmHopperBlack[_0xf39f('0xf')](_0x2e0773))[_0xf39f('0xc')](loggerCatch(_0xf39f('0x10')));};exports[_0xf39f('0x11')]=function(_0x659849){return BPromise[_0xf39f('0x9')]()[_0xf39f('0xa')](cmHopper[_0xf39f('0x11')](_0x659849))[_0xf39f('0xc')](loggerCatch(_0xf39f('0x12')));};exports[_0xf39f('0xb')]=function(_0x4b49ff,_0xeb890b){create(_0x4b49ff)[_0xf39f('0xc')](loggerCatch(_0xeb890b));moveContact(_0x4b49ff)[_0xf39f('0xc')](loggerCatch(_0xeb890b));};exports[_0xf39f('0x13')]=function(_0x4f1b5c,_0x1d1d2a){createAgent(_0x4f1b5c)['catch'](loggerCatch(_0x1d1d2a));};exports[_0xf39f('0x14')]=function(_0x20453a,_0xb0d92b){create(_0x20453a)[_0xf39f('0xc')](loggerCatch(_0xb0d92b));};exports[_0xf39f('0x15')]=function(_0x140cb4,_0x2d9218){moveContact(_0x140cb4)[_0xf39f('0xc')](loggerCatch(_0x2d9218));};exports[_0xf39f('0x16')]=function(_0x5e9287,_0xe16c01,_0x3f90eb){if(_0xe16c01){_0x5e9287[_0xf39f('0x17')]=null;}if(_0x3f90eb){_0x5e9287[_0xf39f('0x18')]=![];}return BPromise[_0xf39f('0x9')]()[_0xf39f('0xa')](cmHopper[_0xf39f('0x16')](_0x5e9287))[_0xf39f('0xc')](loggerCatch('[rescheduleContact]\x20'));};exports['countReScheduled']=function(_0x5e63c1){return BPromise[_0xf39f('0x9')]()[_0xf39f('0xa')](cmHopper['countReScheduled'](_0x5e63c1))[_0xf39f('0xc')](loggerCatch('[countReScheduled]\x20'));};exports[_0xf39f('0x19')]=function(_0x572b80){return BPromise[_0xf39f('0x9')]()[_0xf39f('0xa')](cmHopper[_0xf39f('0x19')]({'UserId':null},_0x572b80,0x1))['catch'](loggerCatch(_0xf39f('0x1a')));};exports['disableContact']=function(_0x50cbde){return BPromise[_0xf39f('0x9')]()['then'](cmHopper[_0xf39f('0x19')]({'active':![]},_0x50cbde,0x1))[_0xf39f('0xc')](loggerCatch(_0xf39f('0x1b')));};exports[_0xf39f('0x1c')]=function(_0x4888c9){var _0xc012f5={};_0xc012f5[_0xf39f('0x1d')]=_0x4888c9['type'];_0xc012f5[_0xf39f('0x1e')]=_0x4888c9[_0xf39f('0x1e')];_0xc012f5['calleridnum']=_0x4888c9[_0xf39f('0x1f')];_0xc012f5[_0xf39f('0x20')]=_0x4888c9['calleridname'];_0xc012f5['queue']=_0x4888c9[_0xf39f('0x21')];_0xc012f5[_0xf39f('0x22')]=_0x4888c9[_0xf39f('0x23')];_0xc012f5[_0xf39f('0x24')]=_0x4888c9['answertime'];_0xc012f5[_0xf39f('0x25')]=0x1;_0xc012f5[_0xf39f('0x26')]=_0x4888c9[_0xf39f('0x27')];_0xc012f5[_0xf39f('0x28')]=_0x4888c9[_0xf39f('0x29')];_0xc012f5[_0xf39f('0x2a')]=_0xf39f('0x2b');_0xc012f5[_0xf39f('0x2c')]=_0xf39f('0x2d');_0xc012f5['holdtime']=0x0;_0xc012f5[_0xf39f('0x2e')]=0x1;_0xc012f5[_0xf39f('0x2f')]=_0x4888c9[_0xf39f('0x29')];_0xc012f5['queuecallerexitreason']=_0xf39f('0x30');return BPromise['resolve']()[_0xf39f('0xa')](voiceQueueReport[_0xf39f('0x31')](_0xc012f5))[_0xf39f('0xc')](loggerCatch(_0xf39f('0x32')));};exports[_0xf39f('0x33')]=function(_0x555ead,_0x4c6532){return BPromise[_0xf39f('0x9')]()[_0xf39f('0xa')](cmHopper['getContactRecallMe'](_0x555ead,_0x4c6532))['catch'](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0xf39f('0x34')]=function(_0x3697a0){return BPromise['resolve']()[_0xf39f('0xa')](cmHopper[_0xf39f('0x16')](_0x3697a0,!![],!![]))[_0xf39f('0xc')](loggerCatch(_0xf39f('0x35')));}; \ No newline at end of file +var _0x7fe8=['unlockContact','[unlockContact]\x20','crateCustomerReportQueue','type','calleridnum','calleridname','queue','queuecallerleaveAt','answertime','queuecallercomplete','connectedlinename','membername','from-sip','exten','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','util','bluebird','../../../config/logger','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/voiceQueueReport','inspect','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','checkIsBlackList','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x7fe8,0xd9));var _0x87fe=function(_0x47b15f,_0x103e93){_0x47b15f=_0x47b15f-0x0;var _0x55bf25=_0x7fe8[_0x47b15f];return _0x55bf25;};'use strict';var util=require(_0x87fe('0x0'));var BPromise=require(_0x87fe('0x1'));var logger=require(_0x87fe('0x2'))('preview');var _=require(_0x87fe('0x3'));var cmHopper=require(_0x87fe('0x4'));var cmHopperFinal=require(_0x87fe('0x5'));var cmHopperHistory=require(_0x87fe('0x6'));var cmHopperBlack=require(_0x87fe('0x7'));var voiceQueueRt=require(_0x87fe('0x8'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0x87fe('0x9'));function loggerCatch(_0x3667c1){return function(_0x3bb0c4){logger['error'](_0x3667c1,util[_0x87fe('0xa')](_0x3bb0c4,{'showHidden':![],'depth':null}));};}function create(_0x3c612d){return BPromise[_0x87fe('0xb')]()[_0x87fe('0xc')](cmHopperHistory[_0x87fe('0xd')](_0x3c612d))[_0x87fe('0xe')](loggerCatch(_0x87fe('0xf')));}function createAgent(_0x45e597){return BPromise[_0x87fe('0xb')]()[_0x87fe('0xc')](agentReportPreview[_0x87fe('0xd')](_0x45e597))[_0x87fe('0xe')](loggerCatch(_0x87fe('0xf')));}function moveContact(_0x52caa6){return BPromise[_0x87fe('0xb')]()[_0x87fe('0xc')](cmHopper[_0x87fe('0x10')](_0x52caa6,!![]))['catch'](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0x87fe('0x11')]=function(_0x2bfaf6){return BPromise['resolve']()['then'](cmHopperBlack['checkIsBlackList'](_0x2bfaf6))[_0x87fe('0xe')](loggerCatch('[checkIsBlackList]\x20'));};exports[_0x87fe('0x12')]=function(_0x49c28e){return BPromise[_0x87fe('0xb')]()[_0x87fe('0xc')](cmHopper[_0x87fe('0x12')](_0x49c28e))[_0x87fe('0xe')](loggerCatch(_0x87fe('0x13')));};exports['createHistory']=function(_0x1b3132,_0x3197e7){create(_0x1b3132)['catch'](loggerCatch(_0x3197e7));moveContact(_0x1b3132)[_0x87fe('0xe')](loggerCatch(_0x3197e7));};exports[_0x87fe('0x14')]=function(_0xd49ccc,_0x17a789){createAgent(_0xd49ccc)['catch'](loggerCatch(_0x17a789));};exports[_0x87fe('0x15')]=function(_0x1c652f,_0x59636d){create(_0x1c652f)['catch'](loggerCatch(_0x59636d));};exports[_0x87fe('0x16')]=function(_0x5df546,_0x586f82){moveContact(_0x5df546)[_0x87fe('0xe')](loggerCatch(_0x586f82));};exports[_0x87fe('0x17')]=function(_0x3df9de,_0x2a6ba4,_0xc068d5){if(_0x2a6ba4){_0x3df9de[_0x87fe('0x18')]=null;}if(_0xc068d5){_0x3df9de['active']=![];}return BPromise[_0x87fe('0xb')]()[_0x87fe('0xc')](cmHopper[_0x87fe('0x17')](_0x3df9de))[_0x87fe('0xe')](loggerCatch(_0x87fe('0x19')));};exports[_0x87fe('0x1a')]=function(_0xdc1b0b){return BPromise['resolve']()[_0x87fe('0xc')](cmHopper[_0x87fe('0x1a')](_0xdc1b0b))[_0x87fe('0xe')](loggerCatch(_0x87fe('0x1b')));};exports['unlockContact']=function(_0x49b0f8){return BPromise[_0x87fe('0xb')]()[_0x87fe('0xc')](cmHopper[_0x87fe('0x1c')]({'UserId':null},_0x49b0f8,0x1))[_0x87fe('0xe')](loggerCatch(_0x87fe('0x1d')));};exports['disableContact']=function(_0x26605c){return BPromise['resolve']()[_0x87fe('0xc')](cmHopper[_0x87fe('0x1c')]({'active':![]},_0x26605c,0x1))[_0x87fe('0xe')](loggerCatch('[activeContact]\x20'));};exports[_0x87fe('0x1e')]=function(_0x57a170){var _0x3861a8={};_0x3861a8[_0x87fe('0x1f')]=_0x57a170['type'];_0x3861a8['uniqueid']=_0x57a170['uniqueid'];_0x3861a8[_0x87fe('0x20')]=_0x57a170[_0x87fe('0x20')];_0x3861a8['calleridname']=_0x57a170[_0x87fe('0x21')];_0x3861a8[_0x87fe('0x22')]=_0x57a170[_0x87fe('0x22')];_0x3861a8['queuecallerjoinAt']=_0x57a170['answertime'];_0x3861a8[_0x87fe('0x23')]=_0x57a170[_0x87fe('0x24')];_0x3861a8[_0x87fe('0x25')]=0x1;_0x3861a8['queuecallercompleteAt']=_0x57a170['endtime'];_0x3861a8[_0x87fe('0x26')]=_0x57a170[_0x87fe('0x27')];_0x3861a8['context']=_0x87fe('0x28');_0x3861a8[_0x87fe('0x29')]='xcally-motion-preview';_0x3861a8['holdtime']=0x0;_0x3861a8['assigned']=0x1;_0x3861a8['lastAssignedTo']=_0x57a170[_0x87fe('0x27')];_0x3861a8[_0x87fe('0x2a')]=_0x87fe('0x2b');return BPromise[_0x87fe('0xb')]()[_0x87fe('0xc')](voiceQueueReport[_0x87fe('0x2c')](_0x3861a8))['catch'](loggerCatch(_0x87fe('0x2d')));};exports[_0x87fe('0x2e')]=function(_0x134b43,_0x50e9b4){return BPromise['resolve']()[_0x87fe('0xc')](cmHopper[_0x87fe('0x2e')](_0x134b43,_0x50e9b4))[_0x87fe('0xe')](loggerCatch(_0x87fe('0x2f')));};exports[_0x87fe('0x30')]=function(_0x6ef598){return BPromise[_0x87fe('0xb')]()['then'](cmHopper[_0x87fe('0x17')](_0x6ef598,!![],!![]))[_0x87fe('0xe')](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ 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 da9e60c..94aa9ec 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 _0x15b7=['ContactId','dialer','dialOriginateTimeout','\x22rtTxX%s%s\x22','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','originatecalleridnum','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','%s%s','XMD-','toUpper','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','state','statedesc','Blacklist','starttime','responsetime','logAgent','YYYY-MM-DD\x20HH:mm:ss','ringtime','logLookAgent','membername','UserId','logCustomer','endtime','answertime','isFailure','Failure','variablesAction','RECALL','BOOKED','uniqueid','originate','channelAgent','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','cloneAction','clone','Global','scheduledAt','active','scheduledat','add','minutes','ListId','VoiceQueueId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','IsNotLoggedIn','buildObj','queue','interface','mandatoryDisposition','buildAcw','not_inuse','status','push','getDiff','diff','idContact','type','countglobal','callback','callbackat','recallme','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agi','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqos','rtpaudioqosrttbridged','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridNumber','match','util','lodash','../../../../config/logger','env','milliseconds','seconds','loggerCatch','error','logger','info','inspect','loggerError','getCallerId','isEmpty','isUndefined','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','Queue','name','calleridname','calleridnum'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x15b7,0xf3));var _0x715b=function(_0x5d48bf,_0x50d7ad){_0x5d48bf=_0x5d48bf-0x0;var _0x311ab2=_0x15b7[_0x5d48bf];return _0x311ab2;};'use strict';var util=require(_0x715b('0x0'));var _=require(_0x715b('0x1'));var moment=require('moment');var logger=require(_0x715b('0x2'))('preview');var ipAgi=process[_0x715b('0x3')]['XCALLY_IP_AGI']||'127.0.0.1';function getSeconds(_0x5c897d,_0x5e32d3){var _0x20598c=moment(_0x5c897d)[_0x715b('0x4')](0x0);var _0x375472=moment(_0x5e32d3)['milliseconds'](0x0);return _0x20598c['diff'](_0x375472,_0x715b('0x5'));}exports[_0x715b('0x6')]=function(_0x26ec7d){return function(_0x148feb){logger[_0x715b('0x7')](_0x26ec7d,util['inspect'](_0x148feb,{'showHidden':![],'depth':null}));};};exports[_0x715b('0x8')]=function(_0x8f9672,_0x1851ab){logger[_0x715b('0x9')](_0x8f9672,util[_0x715b('0xa')](_0x1851ab,{'showHidden':![],'depth':null}));};exports[_0x715b('0xb')]=function(_0x2ba8be,_0x2d7e1d){logger[_0x715b('0x7')](_0x2ba8be,util['inspect'](_0x2d7e1d,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x4489fc){return function(_0xfdd2a5){logger['info'](_0x4489fc,util[_0x715b('0xa')](_0xfdd2a5,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x24071a,_0x2eac71,_0x3cb6e5){return{'message':_0x24071a,'unlock':_0x2eac71,'active':_0x3cb6e5};};exports[_0x715b('0xc')]=function(_0x467fa9,_0x401fe3,_0x54330f){if(!_['isUndefined'](_0x54330f)&&'string'===typeof _0x54330f&&!_[_0x715b('0xd')](_0x54330f)){if(!_[_0x715b('0xe')](_0x401fe3)&&_0x715b('0xf')===typeof _0x401fe3&&!_['isEmpty'](_0x401fe3)){return util[_0x715b('0x10')](_0x715b('0x11'),_0x401fe3,_0x54330f);}return util[_0x715b('0x10')](_0x715b('0x11'),_0x54330f,_0x54330f);}if(!_['isUndefined'](_0x467fa9)&&_0x715b('0xf')===typeof _0x467fa9&&!_['isEmpty'](_0x467fa9)){return _0x467fa9;}return _0x715b('0x12');};exports[_0x715b('0x13')]=function(_0x81e6f9){if(_[_0x715b('0x14')](_0x81e6f9)){return![];}return _0x81e6f9;};exports['addVariables']=function(_0x54ef47,_0x2be397,_0x542bce,_0x2b7741,_0x1d3bb6,_0x3933ca){var _0x3f201a={'XMD-QUEUE':_0x2be397[_0x715b('0x15')]?_0x2be397['Queue'][_0x715b('0x16')]:'','XMD-CALLERID':_0x2b7741,'XMD-CALLERID-PREVIEW':_0x3933ca?util[_0x715b('0x10')](_0x715b('0x11'),_0x3933ca[_0x715b('0x17')],_0x3933ca[_0x715b('0x18')]):_0x2b7741,'XMD-DIALID':_0x1d3bb6,'XMD-CONTACTID':_0x2be397[_0x715b('0x19')],'XMD-CDRTYPE':_0x715b('0x1a'),'CALLERID(all)':_0x2b7741,'XMD-VOICEQUEUEID':_0x2be397['VoiceQueueId'],'XMD-DIALCHANNEL':_0x542bce,'XMD-DIALTIMEOUT':_0x54ef47[_0x715b('0x1b')]||0x1e,'XMD-DIALOPTIONS':util[_0x715b('0x10')](_0x715b('0x1c'),_0x54ef47['dialQueueProject2']?'g':'',_[_0x715b('0xd')](_0x54ef47[_0x715b('0x1d')])?'':_0x715b('0x1e')),'XMD-DIALURL':_0x54ef47[_0x715b('0x1f')]||'','XMD-AGI':_0x54ef47[_0x715b('0x20')]?util['format'](_0x715b('0x21'),ipAgi,_0x54ef47[_0x715b('0x20')]):_0x715b('0x22'),'XMD-AGIAFTER':_0x54ef47[_0x715b('0x23')]?util['format'](_0x715b('0x21'),ipAgi,_0x54ef47[_0x715b('0x23')]):_0x715b('0x22'),'XMD-ORIGINATECALLERIDNUM':_0x3933ca?_0x3933ca[_0x715b('0x24')]:'','XMD-ORIGINATECALLERIDNAME':_0x3933ca?_0x3933ca['originatecalleridname']:'','XMD-DESTINATION':'xcally-motion-preview'};if(!_['isEmpty'](_0x54ef47[_0x715b('0x1d')])){_0x3f201a[util[_0x715b('0x10')]('%s',_0x715b('0x25'))]=_0x54ef47[_0x715b('0x1d')];_0x3f201a[util[_0x715b('0x10')]('%s',_0x715b('0x26'))]=_0x1d3bb6;}if(_0x2be397&&_0x2be397['Contact']){for(var _0x55ee2d in _0x2be397['Contact']){if(_0x2be397[_0x715b('0x27')][_0x715b('0x28')](_0x55ee2d)){if(!_[_0x715b('0x14')](_0x2be397[_0x715b('0x27')][_0x55ee2d])&&_0x55ee2d!=='id'&&_0x55ee2d!=='tags'&&_0x55ee2d!=='createdAt'&&_0x55ee2d!=='updatedAt'){_0x3f201a[util['format'](_0x715b('0x29'),_0x715b('0x2a'),_[_0x715b('0x2b')](_0x55ee2d))]=_0x2be397[_0x715b('0x27')][_0x55ee2d];}}}}return _0x3f201a;};exports['toLowerVariables']=function(_0x58cc73){var _0x75ddb8={};for(var _0xe4d7ae in _0x58cc73){if(_0x58cc73['hasOwnProperty'](_0xe4d7ae)){_0x75ddb8[util[_0x715b('0x10')]('%s',_[_0x715b('0x2c')](_0xe4d7ae))]=_0x58cc73[_0xe4d7ae];}}return{'variables':_0x75ddb8};};exports[_0x715b('0x2d')]=function(_0x117f23,_0x2202b3){if(!_[_0x715b('0x14')](_0x117f23)){if(_0x117f23[_0x715b('0x28')](_0x715b('0x2e'))){if(_0x117f23[_0x715b('0x2e')]>0x0){_0x117f23[_0x715b('0x2e')]-=0x1;}else{logger[_0x715b('0x7')](_0x715b('0x2f'),_0x2202b3);}}}else{logger[_0x715b('0x7')](_0x715b('0x30'),_0x2202b3);}};exports[_0x715b('0x31')]=function(_0x5d9de8){var _0x3f8c09=moment()[_0x715b('0x10')]('YYYY-MM-DD\x20HH:mm:ss');_0x5d9de8[_0x715b('0x32')]=0xd;_0x5d9de8[_0x715b('0x33')]=_0x715b('0x34');_0x5d9de8[_0x715b('0x35')]=_0x3f8c09;_0x5d9de8[_0x715b('0x36')]=_0x3f8c09;_0x5d9de8['endtime']=_0x3f8c09;};exports[_0x715b('0x37')]=function(_0x19419c,_0x53a01c,_0x14f8a0){var _0x8ae1c5=moment()[_0x715b('0x10')](_0x715b('0x38'));_0x19419c[_0x715b('0x32')]=_0x53a01c;_0x19419c['statedesc']=_0x14f8a0;_0x19419c[_0x715b('0x36')]=_0x8ae1c5;_0x19419c[_0x715b('0x39')]=getSeconds(_0x19419c[_0x715b('0x36')],_0x19419c[_0x715b('0x35')]);};exports[_0x715b('0x3a')]=function(_0x4a0063,_0x1cca8c,_0x5abd3c){_0x4a0063[_0x715b('0x3b')]=_0x1cca8c;_0x4a0063[_0x715b('0x3c')]=_0x5abd3c;};exports[_0x715b('0x3d')]=function(_0x5c74d9,_0x3343d4,_0x25f96f){var _0x24fdd=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x5c74d9[_0x715b('0x32')]=_0x3343d4;_0x5c74d9[_0x715b('0x33')]=_0x25f96f;_0x5c74d9['responsetime']=_0x5c74d9['responsetime']?_0x5c74d9['responsetime']:_0x24fdd;_0x5c74d9[_0x715b('0x3e')]=_0x5c74d9[_0x715b('0x3e')]?_0x5c74d9['endtime']:_0x24fdd;_0x5c74d9['ringtime']=getSeconds(_0x5c74d9[_0x715b('0x36')]||0x0,_0x5c74d9[_0x715b('0x35')]||0x0);_0x5c74d9['talktime']=_0x5c74d9[_0x715b('0x3f')]?getSeconds(_0x5c74d9[_0x715b('0x3e')],_0x5c74d9[_0x715b('0x3f')]):0x0;};exports[_0x715b('0x40')]=function(_0x188e8f){return _0x188e8f===_0x715b('0x41');};exports[_0x715b('0x42')]=function(_0x28e8d3,_0x533e8f,_0x9aa1a0,_0x3879de,_0x3803a0){var _0x152f26=_0x3879de?_0x715b('0x43'):_0x28e8d3[_0x715b('0x17')];_0x152f26=_0x3803a0?_0x715b('0x44'):_0x152f26;return{'actionid':_0x28e8d3[_0x715b('0x45')],'action':_0x715b('0x46'),'channel':_0x28e8d3[_0x715b('0x47')],'callerid':util[_0x715b('0x10')](_0x715b('0x11'),_0x152f26,_0x28e8d3['calleridnum']),'Exten':'xcally-motion-preview','Context':_0x715b('0x48'),'Priority':'1','variable':_0x9aa1a0,'timeout':(_0x533e8f[_0x715b('0x49')]||0x1e)*0x3e8,'async':!![],'channelid':_0x28e8d3[_0x715b('0x45')]};};exports[_0x715b('0x4a')]=function(_0x2dc88a){return _0x2dc88a[_0x715b('0x4b')]+_0x2dc88a[_0x715b('0x4c')]+_0x2dc88a[_0x715b('0x4d')]+_0x2dc88a[_0x715b('0x4e')]+_0x2dc88a['countnosuchnumberretry'];};exports[_0x715b('0x4f')]=function(_0x2426aa){var _0x1bc95c=_[_0x715b('0x50')](_0x2426aa);_0x1bc95c[_0x715b('0x32')]=0xf;_0x1bc95c['statedesc']=_0x715b('0x51');return _0x1bc95c;};exports[_0x715b('0x52')]=function(_0x18d607,_0x389ca4,_0x15413c){var _0x5e0b9f={};_0x5e0b9f[_0x389ca4]=_0x18d607[_0x389ca4];_0x5e0b9f[_0x715b('0x53')]=![];_0x5e0b9f[_0x715b('0x54')]=moment()[_0x715b('0x55')](_0x15413c,_0x715b('0x56'))['format'](_0x715b('0x38'));_0x5e0b9f['ContactId']=_0x18d607[_0x715b('0x19')];_0x5e0b9f[_0x715b('0x57')]=_0x18d607['ListId'];_0x5e0b9f[_0x715b('0x58')]=_0x18d607[_0x715b('0x58')]||undefined;return _0x5e0b9f;};exports[_0x715b('0x59')]=function(_0xc14e85,_0x165a4e){if(!_['isNil'](_0xc14e85)){if(_0xc14e85[_0x715b('0x5a')]>0x0){_0xc14e85[_0x715b('0x5a')]-=0x1;}else{logger[_0x715b('0x7')](_0x165a4e,_0x715b('0x5b'));}}else{logger[_0x715b('0x7')](_0x165a4e,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0x715b('0x5c')]=function(_0x4fae65){if(_0x4fae65<=0x0){return!![];}return![];};exports[_0x715b('0x5d')]=function(_0xb1f437,_0x1134ae,_0x5cc3f7){_0xb1f437['lastevent']=_0x1134ae;_0xb1f437['name']=_0xb1f437[_0x715b('0x5e')];_0xb1f437[_0x715b('0x5f')]=_0xb1f437[_0x715b('0x47')];if(_0x5cc3f7){_0xb1f437[_0x715b('0x60')]=_0x5cc3f7['mandatoryDisposition'];}return _0xb1f437;};exports[_0x715b('0x61')]=function(_0x1cba9b){var _0x140076={};_0x140076[_0x715b('0x5e')]=_0x1cba9b[_0x715b('0x5e')];_0x140076[_0x715b('0x5f')]=_0x1cba9b[_0x715b('0x47')];_0x140076[_0x715b('0x45')]=_0x1cba9b[_0x715b('0x45')];return _0x140076;};exports['agentReadyId']=function(_0x24772a){var _0x3d5750=[];for(var _0x7f42e9 in _0x24772a){if(_0x24772a[_0x715b('0x28')](_0x7f42e9)){if(!_[_0x715b('0x14')](_0x24772a[_0x7f42e9])&&_0x24772a[_0x7f42e9]['state']===_0x715b('0x62')&&_0x24772a[_0x7f42e9][_0x715b('0x63')]==='reachable'){_0x3d5750[_0x715b('0x64')](_0x24772a[_0x7f42e9]['id']);}}}return _0x3d5750;};exports[_0x715b('0x65')]=function(_0x9c3bd3){var _0xfc2293=moment()[_0x715b('0x4')](0x0);var _0x4b301c=moment(_0x9c3bd3)[_0x715b('0x4')](0x0);return _0xfc2293[_0x715b('0x66')](_0x4b301c,_0x715b('0x5'));};exports['createBody']=function(_0x54b66c){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x54b66c['ContactId'],'ListId':_0x54b66c['ListId'],'VoiceQueueId':_0x54b66c[_0x715b('0x58')]||undefined,'CampaignId':_0x54b66c['CampaignId']||undefined};};exports['filterKey']=function(_0xe5ff05){if(_0xe5ff05===_0x715b('0x45')||_0xe5ff05===_0x715b('0x67')||_0xe5ff05==='queue'||_0xe5ff05===_0x715b('0x68')||_0xe5ff05==='campaigntype'||_0xe5ff05==='dialAnswer'||_0xe5ff05===_0x715b('0x3b')||_0xe5ff05===_0x715b('0x47')||_0xe5ff05===_0x715b('0x17')||_0xe5ff05==='active'||_0xe5ff05===_0x715b('0x18')||_0xe5ff05===_0x715b('0x54')||_0xe5ff05===_0x715b('0x4b')||_0xe5ff05===_0x715b('0x4c')||_0xe5ff05===_0x715b('0x4d')||_0xe5ff05===_0x715b('0x69')||_0xe5ff05===_0x715b('0x6a')||_0xe5ff05==='callbackuniqueid'||_0xe5ff05===_0x715b('0x6b')||_0xe5ff05===_0x715b('0x6c')||_0xe5ff05===_0x715b('0x19')||_0xe5ff05===_0x715b('0x57')||_0xe5ff05===_0x715b('0x3c')||_0xe5ff05===_0x715b('0x58')||_0xe5ff05==='sipcallid'||_0xe5ff05===_0x715b('0x6d')||_0xe5ff05===_0x715b('0x6e')||_0xe5ff05===_0x715b('0x6f')||_0xe5ff05===_0x715b('0x70')||_0xe5ff05===_0x715b('0x71')||_0xe5ff05===_0x715b('0x72')||_0xe5ff05==='xmd-dialoptions'||_0xe5ff05===_0x715b('0x73')||_0xe5ff05===_0x715b('0x74')||_0xe5ff05===_0x715b('0x75')||_0xe5ff05===_0x715b('0x76')||_0xe5ff05===_0x715b('0x77')||_0xe5ff05==='xmd-agiafter'||_0xe5ff05===_0x715b('0x78')||_0xe5ff05==='rtpaudioqos'||_0xe5ff05==='rtpaudioqosbridged'||_0xe5ff05===_0x715b('0x79')||_0xe5ff05===_0x715b('0x7a')||_0xe5ff05==='rtpaudioqosloss'||_0xe5ff05===_0x715b('0x7b')||_0xe5ff05==='rtpaudioqosrtt'||_0xe5ff05==='rtpaudioqosrttbridged'||_0xe5ff05===_0x715b('0x7c')||_0xe5ff05==='rtpaudioqosbridged'||_0xe5ff05===_0x715b('0x79')||_0xe5ff05===_0x715b('0x7a')||_0xe5ff05==='rtpaudioqosloss'||_0xe5ff05===_0x715b('0x7b')||_0xe5ff05==='rtpaudioqosrtt'||_0xe5ff05===_0x715b('0x7d')||_0xe5ff05==='bridgepeer'||_0xe5ff05===_0x715b('0x7e')||_0xe5ff05===_0x715b('0x32')||_0xe5ff05==='statedesc'){return![];}return!![];};exports[_0x715b('0x7f')]=function(_0x2616bb,_0x2234f1){var _0x1e173f,_0x174271,_0x4a6dd4;if(_0x2234f1<=0x0){_0x2234f1=0x1;}_0x1e173f=new RegExp(_0x715b('0x80')+_0x2234f1+'}$');_0x174271=Math[_0x715b('0x81')](0xa,_0x2234f1-0x1);_0x4a6dd4=Math[_0x715b('0x81')](0xa,_0x2234f1)-0x1;return util[_0x715b('0x10')]('%s',_[_0x715b('0x82')](_0x2616bb,_0x1e173f,_[_0x715b('0x83')](_0x174271,_0x4a6dd4)));};exports['extractCalleridName']=function(_0x3407cf){var _0x2ad9a6=_0x3407cf['match'](/"(.*?)"/);return _0x2ad9a6?_0x2ad9a6[0x1]:_0x3407cf;};exports[_0x715b('0x84')]=function(_0xbfed62){var _0x2c26c9=_0xbfed62[_0x715b('0x85')](/<(.*?)>/);return _0x2c26c9?_0x2c26c9[0x1]:_0xbfed62;}; \ No newline at end of file +var _0x06ff=['bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','match','extractCalleridNumber','lodash','moment','../../../../config/logger','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','error','inspect','loggerError','info','message','getCallerId','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isNil','addVariables','Queue','name','calleridname','calleridnum','ContactId','dialer','dialOriginateTimeout','\x22rtTxX%s%s\x22','monitor_format','U(xcally-mixmonitor-context)','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_UNIQUEID','Contact','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','hasOwnProperty','toLower','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','starttime','responsetime','endtime','logAgent','ringtime','logLookAgent','UserId','logCustomer','talktime','answertime','Failure','variablesAction','RECALL','BOOKED','uniqueid','originate','channelAgent','from-sip','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledAt','scheduledat','add','minutes','ListId','VoiceQueueId','[decrementTalkink]\x20object\x20talking\x20is\x20negative','IsNotLoggedIn','buildObj','queue','mandatoryDisposition','buildAcw','interface','not_inuse','status','push','getDiff','createBody','filterKey','idContact','type','campaigntype','dialAnswer','membername','countbusyretry','countglobal','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-listid','xmd-dialoptions','xmd-dialid','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer'];(function(_0x4be122,_0x27cb96){var _0x3317d5=function(_0x5c5516){while(--_0x5c5516){_0x4be122['push'](_0x4be122['shift']());}};_0x3317d5(++_0x27cb96);}(_0x06ff,0x19d));var _0xf06f=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x06ff[_0x4e676e];return _0x336a3c;};'use strict';var util=require('util');var _=require(_0xf06f('0x0'));var moment=require(_0xf06f('0x1'));var logger=require(_0xf06f('0x2'))('preview');var ipAgi=process['env'][_0xf06f('0x3')]||_0xf06f('0x4');function getSeconds(_0x14c922,_0x58efe7){var _0x5c702d=moment(_0x14c922)[_0xf06f('0x5')](0x0);var _0xf3e530=moment(_0x58efe7)[_0xf06f('0x5')](0x0);return _0x5c702d[_0xf06f('0x6')](_0xf3e530,_0xf06f('0x7'));}exports['loggerCatch']=function(_0x46f46f){return function(_0x4ea261){logger[_0xf06f('0x8')](_0x46f46f,util[_0xf06f('0x9')](_0x4ea261,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0xff68c6,_0x5b1c5d){logger['info'](_0xff68c6,util['inspect'](_0x5b1c5d,{'showHidden':![],'depth':null}));};exports[_0xf06f('0xa')]=function(_0x4cc825,_0x3a6e1e){logger[_0xf06f('0x8')](_0x4cc825,util[_0xf06f('0x9')](_0x3a6e1e,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x13e3e3){return function(_0x3cb885){logger[_0xf06f('0xb')](_0x13e3e3,util[_0xf06f('0x9')](_0x3cb885,{'showHidden':![],'depth':null}));};};exports[_0xf06f('0xc')]=function(_0x2e4e4f,_0x32c7c8,_0x3ad207){return{'message':_0x2e4e4f,'unlock':_0x32c7c8,'active':_0x3ad207};};exports[_0xf06f('0xd')]=function(_0x2f6f38,_0x15307e,_0x2eab46){if(!_['isUndefined'](_0x2eab46)&&_0xf06f('0xe')===typeof _0x2eab46&&!_['isEmpty'](_0x2eab46)){if(!_['isUndefined'](_0x15307e)&&_0xf06f('0xe')===typeof _0x15307e&&!_[_0xf06f('0xf')](_0x15307e)){return util[_0xf06f('0x10')]('\x22%s\x22\x20<%s>',_0x15307e,_0x2eab46);}return util['format'](_0xf06f('0x11'),_0x2eab46,_0x2eab46);}if(!_['isUndefined'](_0x2f6f38)&&_0xf06f('0xe')===typeof _0x2f6f38&&!_[_0xf06f('0xf')](_0x2f6f38)){return _0x2f6f38;}return _0xf06f('0x12');};exports['isActive']=function(_0x217759){if(_[_0xf06f('0x13')](_0x217759)){return![];}return _0x217759;};exports[_0xf06f('0x14')]=function(_0x2f383b,_0x4b0151,_0x33b991,_0x5c5343,_0x5a1cee,_0x89b333){var _0xbdb594={'XMD-QUEUE':_0x4b0151[_0xf06f('0x15')]?_0x4b0151[_0xf06f('0x15')][_0xf06f('0x16')]:'','XMD-CALLERID':_0x5c5343,'XMD-CALLERID-PREVIEW':_0x89b333?util[_0xf06f('0x10')]('\x22%s\x22\x20<%s>',_0x89b333[_0xf06f('0x17')],_0x89b333[_0xf06f('0x18')]):_0x5c5343,'XMD-DIALID':_0x5a1cee,'XMD-CONTACTID':_0x4b0151[_0xf06f('0x19')],'XMD-CDRTYPE':_0xf06f('0x1a'),'CALLERID(all)':_0x5c5343,'XMD-VOICEQUEUEID':_0x4b0151['VoiceQueueId'],'XMD-DIALCHANNEL':_0x33b991,'XMD-DIALTIMEOUT':_0x2f383b[_0xf06f('0x1b')]||0x1e,'XMD-DIALOPTIONS':util['format'](_0xf06f('0x1c'),_0x2f383b['dialQueueProject2']?'g':'',_[_0xf06f('0xf')](_0x2f383b[_0xf06f('0x1d')])?'':_0xf06f('0x1e')),'XMD-DIALURL':_0x2f383b['dialPreviewUrl']||'','XMD-AGI':_0x2f383b[_0xf06f('0x1f')]?util['format'](_0xf06f('0x20'),ipAgi,_0x2f383b[_0xf06f('0x1f')]):_0xf06f('0x21'),'XMD-AGIAFTER':_0x2f383b[_0xf06f('0x22')]?util['format'](_0xf06f('0x20'),ipAgi,_0x2f383b[_0xf06f('0x22')]):_0xf06f('0x21'),'XMD-ORIGINATECALLERIDNUM':_0x89b333?_0x89b333[_0xf06f('0x23')]:'','XMD-ORIGINATECALLERIDNAME':_0x89b333?_0x89b333[_0xf06f('0x24')]:'','XMD-DESTINATION':_0xf06f('0x25')};if(!_[_0xf06f('0xf')](_0x2f383b[_0xf06f('0x1d')])){_0xbdb594[util[_0xf06f('0x10')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x2f383b[_0xf06f('0x1d')];_0xbdb594[util[_0xf06f('0x10')]('%s',_0xf06f('0x26'))]=_0x5a1cee;}if(_0x4b0151&&_0x4b0151[_0xf06f('0x27')]){for(var _0x3515b1 in _0x4b0151[_0xf06f('0x27')]){if(_0x4b0151['Contact']['hasOwnProperty'](_0x3515b1)){if(!_[_0xf06f('0x13')](_0x4b0151['Contact'][_0x3515b1])&&_0x3515b1!=='id'&&_0x3515b1!==_0xf06f('0x28')&&_0x3515b1!==_0xf06f('0x29')&&_0x3515b1!==_0xf06f('0x2a')){_0xbdb594[util['format'](_0xf06f('0x2b'),_0xf06f('0x2c'),_[_0xf06f('0x2d')](_0x3515b1))]=_0x4b0151['Contact'][_0x3515b1];}}}}return _0xbdb594;};exports['toLowerVariables']=function(_0x18275b){var _0x59bccd={};for(var _0x164f8c in _0x18275b){if(_0x18275b[_0xf06f('0x2e')](_0x164f8c)){_0x59bccd[util[_0xf06f('0x10')]('%s',_[_0xf06f('0x2f')](_0x164f8c))]=_0x18275b[_0x164f8c];}}return{'variables':_0x59bccd};};exports['updateOriginated']=function(_0x520a94,_0x4ded6e){if(!_[_0xf06f('0x13')](_0x520a94)){if(_0x520a94[_0xf06f('0x2e')](_0xf06f('0x30'))){if(_0x520a94[_0xf06f('0x30')]>0x0){_0x520a94[_0xf06f('0x30')]-=0x1;}else{logger[_0xf06f('0x8')](_0xf06f('0x31'),_0x4ded6e);}}}else{logger[_0xf06f('0x8')](_0xf06f('0x32'),_0x4ded6e);}};exports[_0xf06f('0x33')]=function(_0x58d890){var _0x20ecdb=moment()[_0xf06f('0x10')](_0xf06f('0x34'));_0x58d890[_0xf06f('0x35')]=0xd;_0x58d890[_0xf06f('0x36')]='Blacklist';_0x58d890[_0xf06f('0x37')]=_0x20ecdb;_0x58d890[_0xf06f('0x38')]=_0x20ecdb;_0x58d890[_0xf06f('0x39')]=_0x20ecdb;};exports[_0xf06f('0x3a')]=function(_0x40eb84,_0x5418ce,_0x1f3594){var _0x60d43f=moment()['format'](_0xf06f('0x34'));_0x40eb84[_0xf06f('0x35')]=_0x5418ce;_0x40eb84[_0xf06f('0x36')]=_0x1f3594;_0x40eb84[_0xf06f('0x38')]=_0x60d43f;_0x40eb84[_0xf06f('0x3b')]=getSeconds(_0x40eb84[_0xf06f('0x38')],_0x40eb84[_0xf06f('0x37')]);};exports[_0xf06f('0x3c')]=function(_0x214015,_0x38ca39,_0x33fece){_0x214015['membername']=_0x38ca39;_0x214015[_0xf06f('0x3d')]=_0x33fece;};exports[_0xf06f('0x3e')]=function(_0x33ea3c,_0x234bc4,_0x1b4df){var _0x4dc744=moment()[_0xf06f('0x10')](_0xf06f('0x34'));_0x33ea3c[_0xf06f('0x35')]=_0x234bc4;_0x33ea3c[_0xf06f('0x36')]=_0x1b4df;_0x33ea3c[_0xf06f('0x38')]=_0x33ea3c[_0xf06f('0x38')]?_0x33ea3c[_0xf06f('0x38')]:_0x4dc744;_0x33ea3c[_0xf06f('0x39')]=_0x33ea3c[_0xf06f('0x39')]?_0x33ea3c[_0xf06f('0x39')]:_0x4dc744;_0x33ea3c['ringtime']=getSeconds(_0x33ea3c[_0xf06f('0x38')]||0x0,_0x33ea3c['starttime']||0x0);_0x33ea3c[_0xf06f('0x3f')]=_0x33ea3c[_0xf06f('0x40')]?getSeconds(_0x33ea3c['endtime'],_0x33ea3c[_0xf06f('0x40')]):0x0;};exports['isFailure']=function(_0x8092dd){return _0x8092dd===_0xf06f('0x41');};exports[_0xf06f('0x42')]=function(_0x1e08fd,_0x145e6c,_0xa4c1df,_0x488765,_0x3bd8ea){var _0x3d9c51=_0x488765?_0xf06f('0x43'):_0x1e08fd['calleridname'];_0x3d9c51=_0x3bd8ea?_0xf06f('0x44'):_0x3d9c51;return{'actionid':_0x1e08fd[_0xf06f('0x45')],'action':_0xf06f('0x46'),'channel':_0x1e08fd[_0xf06f('0x47')],'callerid':util[_0xf06f('0x10')](_0xf06f('0x11'),_0x3d9c51,_0x1e08fd[_0xf06f('0x18')]),'Exten':'xcally-motion-preview','Context':_0xf06f('0x48'),'Priority':'1','variable':_0xa4c1df,'timeout':(_0x145e6c['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x1e08fd['uniqueid']};};exports['totalGlobal']=function(_0x115990){return _0x115990['countbusyretry']+_0x115990[_0xf06f('0x49')]+_0x115990[_0xf06f('0x4a')]+_0x115990[_0xf06f('0x4b')]+_0x115990[_0xf06f('0x4c')];};exports[_0xf06f('0x4d')]=function(_0x2fdf0c){var _0x1fe163=_[_0xf06f('0x4e')](_0x2fdf0c);_0x1fe163[_0xf06f('0x35')]=0xf;_0x1fe163[_0xf06f('0x36')]=_0xf06f('0x4f');return _0x1fe163;};exports[_0xf06f('0x50')]=function(_0x53f30b,_0x4d48cb,_0x322f59){var _0x11d4a2={};_0x11d4a2[_0x4d48cb]=_0x53f30b[_0x4d48cb];_0x11d4a2['active']=![];_0x11d4a2[_0xf06f('0x51')]=moment()[_0xf06f('0x52')](_0x322f59,_0xf06f('0x53'))['format'](_0xf06f('0x34'));_0x11d4a2[_0xf06f('0x19')]=_0x53f30b[_0xf06f('0x19')];_0x11d4a2[_0xf06f('0x54')]=_0x53f30b[_0xf06f('0x54')];_0x11d4a2[_0xf06f('0x55')]=_0x53f30b[_0xf06f('0x55')]||undefined;return _0x11d4a2;};exports['decrementTalkink']=function(_0x2ab00d,_0x8efc76){if(!_[_0xf06f('0x13')](_0x2ab00d)){if(_0x2ab00d['pTalking']>0x0){_0x2ab00d['pTalking']-=0x1;}else{logger[_0xf06f('0x8')](_0x8efc76,_0xf06f('0x56'));}}else{logger[_0xf06f('0x8')](_0x8efc76,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0xf06f('0x57')]=function(_0x551c81){if(_0x551c81<=0x0){return!![];}return![];};exports[_0xf06f('0x58')]=function(_0x534746,_0x4f6556,_0x869c7f){_0x534746['lastevent']=_0x4f6556;_0x534746[_0xf06f('0x16')]=_0x534746[_0xf06f('0x59')];_0x534746['interface']=_0x534746[_0xf06f('0x47')];if(_0x869c7f){_0x534746[_0xf06f('0x5a')]=_0x869c7f[_0xf06f('0x5a')];}return _0x534746;};exports[_0xf06f('0x5b')]=function(_0x40a1af){var _0x323e6c={};_0x323e6c[_0xf06f('0x59')]=_0x40a1af['queue'];_0x323e6c[_0xf06f('0x5c')]=_0x40a1af[_0xf06f('0x47')];_0x323e6c['uniqueid']=_0x40a1af[_0xf06f('0x45')];return _0x323e6c;};exports['agentReadyId']=function(_0x3ac8de){var _0x47e8ce=[];for(var _0x1b52f2 in _0x3ac8de){if(_0x3ac8de[_0xf06f('0x2e')](_0x1b52f2)){if(!_[_0xf06f('0x13')](_0x3ac8de[_0x1b52f2])&&_0x3ac8de[_0x1b52f2][_0xf06f('0x35')]===_0xf06f('0x5d')&&_0x3ac8de[_0x1b52f2][_0xf06f('0x5e')]==='reachable'){_0x47e8ce[_0xf06f('0x5f')](_0x3ac8de[_0x1b52f2]['id']);}}}return _0x47e8ce;};exports[_0xf06f('0x60')]=function(_0x522d3d){var _0x528fe7=moment()[_0xf06f('0x5')](0x0);var _0x28649e=moment(_0x522d3d)[_0xf06f('0x5')](0x0);return _0x528fe7['diff'](_0x28649e,_0xf06f('0x7'));};exports[_0xf06f('0x61')]=function(_0x1fddd6){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x1fddd6[_0xf06f('0x19')],'ListId':_0x1fddd6[_0xf06f('0x54')],'VoiceQueueId':_0x1fddd6['VoiceQueueId']||undefined,'CampaignId':_0x1fddd6['CampaignId']||undefined};};exports[_0xf06f('0x62')]=function(_0x2b300a){if(_0x2b300a===_0xf06f('0x45')||_0x2b300a===_0xf06f('0x63')||_0x2b300a==='queue'||_0x2b300a===_0xf06f('0x64')||_0x2b300a===_0xf06f('0x65')||_0x2b300a===_0xf06f('0x66')||_0x2b300a===_0xf06f('0x67')||_0x2b300a===_0xf06f('0x47')||_0x2b300a===_0xf06f('0x17')||_0x2b300a==='active'||_0x2b300a==='calleridnum'||_0x2b300a===_0xf06f('0x51')||_0x2b300a===_0xf06f('0x68')||_0x2b300a===_0xf06f('0x49')||_0x2b300a===_0xf06f('0x4a')||_0x2b300a===_0xf06f('0x69')||_0x2b300a==='callback'||_0x2b300a===_0xf06f('0x6a')||_0x2b300a===_0xf06f('0x6b')||_0x2b300a===_0xf06f('0x6c')||_0x2b300a===_0xf06f('0x19')||_0x2b300a===_0xf06f('0x54')||_0x2b300a===_0xf06f('0x3d')||_0x2b300a===_0xf06f('0x55')||_0x2b300a===_0xf06f('0x6d')||_0x2b300a===_0xf06f('0x6e')||_0x2b300a===_0xf06f('0x6f')||_0x2b300a==='xmd-phone'||_0x2b300a===_0xf06f('0x70')||_0x2b300a==='xmd-dialurl'||_0x2b300a==='xmd-dialtimeout'||_0x2b300a===_0xf06f('0x71')||_0x2b300a===_0xf06f('0x72')||_0x2b300a==='xmd-dialchannel'||_0x2b300a===_0xf06f('0x73')||_0x2b300a===_0xf06f('0x74')||_0x2b300a===_0xf06f('0x75')||_0x2b300a===_0xf06f('0x76')||_0x2b300a===_0xf06f('0x77')||_0x2b300a===_0xf06f('0x78')||_0x2b300a==='rtpaudioqosbridged'||_0x2b300a===_0xf06f('0x79')||_0x2b300a===_0xf06f('0x7a')||_0x2b300a===_0xf06f('0x7b')||_0x2b300a==='rtpaudioqoslossbridged'||_0x2b300a===_0xf06f('0x7c')||_0x2b300a==='rtpaudioqosrttbridged'||_0x2b300a===_0xf06f('0x78')||_0x2b300a==='rtpaudioqosbridged'||_0x2b300a===_0xf06f('0x79')||_0x2b300a===_0xf06f('0x7a')||_0x2b300a===_0xf06f('0x7b')||_0x2b300a==='rtpaudioqoslossbridged'||_0x2b300a==='rtpaudioqosrtt'||_0x2b300a===_0xf06f('0x7d')||_0x2b300a===_0xf06f('0x7e')||_0x2b300a===_0xf06f('0x7f')||_0x2b300a===_0xf06f('0x35')||_0x2b300a==='statedesc'){return![];}return!![];};exports[_0xf06f('0x80')]=function(_0x24e13d,_0x17e95f){var _0x29a6ae,_0x405d28,_0x194920;if(_0x17e95f<=0x0){_0x17e95f=0x1;}_0x29a6ae=new RegExp(_0xf06f('0x81')+_0x17e95f+'}$');_0x405d28=Math[_0xf06f('0x82')](0xa,_0x17e95f-0x1);_0x194920=Math['pow'](0xa,_0x17e95f)-0x1;return util[_0xf06f('0x10')]('%s',_[_0xf06f('0x83')](_0x24e13d,_0x29a6ae,_[_0xf06f('0x84')](_0x405d28,_0x194920)));};exports['extractCalleridName']=function(_0x5a4ae0){var _0x4f2451=_0x5a4ae0[_0xf06f('0x85')](/"(.*?)"/);return _0x4f2451?_0x4f2451[0x1]:_0x5a4ae0;};exports[_0xf06f('0x86')]=function(_0x4621f4){var _0xafcaf6=_0x4621f4[_0xf06f('0x85')](/<(.*?)>/);return _0xafcaf6?_0xafcaf6[0x1]:_0x4621f4;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index addf73a..eb2e05e 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 _0x3427=['queueadd','string','number','boolean','queueremove','queuepause','voicequeuechannelhangup'];(function(_0x2ac125,_0x3abddb){var _0x13de41=function(_0x373ac0){while(--_0x373ac0){_0x2ac125['push'](_0x2ac125['shift']());}};_0x13de41(++_0x3abddb);}(_0x3427,0x1ea));var _0x7342=function(_0x5d2480,_0x7e6e83){_0x5d2480=_0x5d2480-0x0;var _0x30d258=_0x3427[_0x5d2480];return _0x30d258;};'use strict';exports[_0x7342('0x0')]={'queue':{'type':_0x7342('0x1'),'required':!![]},'interface':{'type':_0x7342('0x1'),'required':!![]},'membername':{'type':_0x7342('0x1'),'required':!![]},'penalty':{'type':_0x7342('0x2'),'required':![]},'paused':{'type':_0x7342('0x3'),'required':![]}};exports[_0x7342('0x4')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x7342('0x1'),'required':!![]}};exports[_0x7342('0x5')]={'interface':{'type':_0x7342('0x1'),'required':!![]},'paused':{'type':_0x7342('0x3')},'reason':{'type':_0x7342('0x1'),'required':![]}};exports['reload']={'module':{'type':_0x7342('0x1'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0x7342('0x1'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0x7342('0x1'),'required':!![]},'filename':{'type':_0x7342('0x1')},'format':{'type':_0x7342('0x1')},'mixmonitorid':{'type':_0x7342('0x1')}};exports[_0x7342('0x6')]={'uniqueid':{'type':'string','required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0x7342('0x1'),'required':!![]},'exten':{'type':_0x7342('0x1'),'required':!![]},'context':{'type':_0x7342('0x1')}}; \ No newline at end of file +var _0x8a77=['number','queueremove','queuepause','boolean','reload','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string'];(function(_0x2a9768,_0x50cd07){var _0x1ffcc0=function(_0x545bc4){while(--_0x545bc4){_0x2a9768['push'](_0x2a9768['shift']());}};_0x1ffcc0(++_0x50cd07);}(_0x8a77,0xe4));var _0x78a7=function(_0x64ef76,_0x333fcb){_0x64ef76=_0x64ef76-0x0;var _0x335b10=_0x8a77[_0x64ef76];return _0x335b10;};'use strict';exports[_0x78a7('0x0')]={'queue':{'type':_0x78a7('0x1'),'required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':_0x78a7('0x1'),'required':!![]},'penalty':{'type':_0x78a7('0x2'),'required':![]},'paused':{'type':'boolean','required':![]}};exports[_0x78a7('0x3')]={'queue':{'type':_0x78a7('0x1'),'required':!![]},'interface':{'type':_0x78a7('0x1'),'required':!![]}};exports[_0x78a7('0x4')]={'interface':{'type':_0x78a7('0x1'),'required':!![]},'paused':{'type':_0x78a7('0x5')},'reason':{'type':_0x78a7('0x1'),'required':![]}};exports[_0x78a7('0x6')]={'module':{'type':_0x78a7('0x1'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0x78a7('0x1'),'required':!![]}};exports[_0x78a7('0x7')]={'uniqueid':{'type':_0x78a7('0x1'),'required':!![]},'filename':{'type':_0x78a7('0x1')},'format':{'type':_0x78a7('0x1')},'mixmonitorid':{'type':_0x78a7('0x1')}};exports[_0x78a7('0x8')]={'uniqueid':{'type':_0x78a7('0x1'),'required':!![]}};exports[_0x78a7('0x9')]={'uniqueid':{'type':_0x78a7('0x1'),'required':!![]},'exten':{'type':_0x78a7('0x1'),'required':!![]},'context':{'type':_0x78a7('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 6580acd..a093804 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 _0xb949=['initTriggers','triggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','vtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initVoiceQueueHopperHistory','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerabandon','queuecallerleaveAt','queuecallerjoinAt','queuecallercompleteAt','diff','seconds','initVoiceCallReports','duration','ANSWERED','billableseconds','initCampaigns','campaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','merge','exports','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/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','trunks','voiceQueues','templates','outbound','voiceExtensions','channels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','hasOwnProperty','format','SIP/%s','name','isNil','interface','total','answered','sumHoldTime','sumDuration','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','abandoned','sumBillable','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents','length','isUndefined','initTelephones','initTrunks','initVoiceQueues'];(function(_0x32e866,_0x4b38a2){var _0x315957=function(_0x269aae){while(--_0x269aae){_0x32e866['push'](_0x32e866['shift']());}};_0x315957(++_0x4b38a2);}(_0xb949,0x90));var _0x9b94=function(_0x57dc21,_0xb176f4){_0x57dc21=_0x57dc21-0x0;var _0x558a93=_0xb949[_0x57dc21];return _0x558a93;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require('lodash');var moment=require(_0x9b94('0x0'));var Agent=require('../model/agent');var Telephone=require(_0x9b94('0x1'));var Trunk=require(_0x9b94('0x2'));var VoiceQueue=require(_0x9b94('0x3'));var Trigger=require(_0x9b94('0x4'));var Template=require(_0x9b94('0x5'));var Campaign=require(_0x9b94('0x6'));var VoiceExtension=require(_0x9b94('0x7'));var ZendeskAccount=require(_0x9b94('0x8'));var SalesforceAccount=require(_0x9b94('0x9'));var FreshdeskAccount=require(_0x9b94('0xa'));var SugarcrmAccount=require(_0x9b94('0xb'));var ZohoAccount=require(_0x9b94('0xc'));var DeskAccount=require(_0x9b94('0xd'));var VtigerAccount=require('../model/vtigerAccount');var ServicenowAccount=require(_0x9b94('0xe'));var Dynamics365Account=require(_0x9b94('0xf'));var FreshsalesAccount=require(_0x9b94('0x10'));var FaxAccount=require(_0x9b94('0x11'));var Realtime=function(){this[_0x9b94('0x12')]={};this[_0x9b94('0x13')]={};this[_0x9b94('0x14')]={};this[_0x9b94('0x15')]={};this['triggers']={};this['campaigns']={};this[_0x9b94('0x16')]={};this[_0x9b94('0x17')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x9b94('0x18')]={};this[_0x9b94('0x19')]={};this['queueChannels']={};this[_0x9b94('0x1a')]={};this[_0x9b94('0x1b')]={};this[_0x9b94('0x1c')]={};this[_0x9b94('0x1d')]={};this[_0x9b94('0x1e')]={};this[_0x9b94('0x1f')]={};this[_0x9b94('0x20')]={};this[_0x9b94('0x21')]={};this[_0x9b94('0x22')]={};this['vtigerAccounts']={};this[_0x9b94('0x23')]={};this[_0x9b94('0x24')]={};this[_0x9b94('0x25')]={};this[_0x9b94('0x26')]={};};function freeIsNotKey(_0x4f1526,_0x54892f,_0x3ba962){var _0xe243a8=_['mapKeys'](_0x4f1526,function(_0x125bc0,_0x402319){return _0x125bc0[_0x3ba962];});for(var _0x40f4b8 in _0x54892f){if(_0x54892f[_0x9b94('0x27')](_0x40f4b8)){if(!_0xe243a8[_0x40f4b8]){delete _0x54892f[_0x40f4b8];}}}}function freeIsNotKeySip(_0xe1735b,_0x56fc0a){var _0x384cc4=_['mapKeys'](_0xe1735b,function(_0x513f08,_0x38f5b0){return util[_0x9b94('0x28')](_0x9b94('0x29'),_0x513f08[_0x9b94('0x2a')]);});for(var _0x4d31c2 in _0x56fc0a){if(_0x56fc0a[_0x9b94('0x27')](_0x4d31c2)){if(!_0x384cc4[_0x4d31c2]){delete _0x56fc0a[_0x4d31c2];}}}}function freeIsNotKeyAgent(_0x3bf8f,_0x274dcb){var _0x532cf8=_['mapKeys'](_0x3bf8f,function(_0x17c880,_0x2a2152){var _0x3c11ed=_[_0x9b94('0x2b')](_0x17c880['interface'])?util[_0x9b94('0x28')](_0x9b94('0x29'),_0x17c880[_0x9b94('0x2a')]):_0x17c880[_0x9b94('0x2c')];return _0x3c11ed;});for(var _0x24c05d in _0x274dcb){if(_0x274dcb[_0x9b94('0x27')](_0x24c05d)){if(!_0x532cf8[_0x24c05d]){delete _0x274dcb[_0x24c05d];}}}}function clearVoiceCallReports(_0x1b89f6){_0x1b89f6[_0x9b94('0x2d')]=0x0;_0x1b89f6[_0x9b94('0x2e')]=0x0;_0x1b89f6[_0x9b94('0x2f')]=0x0;_0x1b89f6[_0x9b94('0x30')]=0x0;_0x1b89f6['sumBillable']=0x0;}function clearCampaigns(_0x1b366f){if(!_[_0x9b94('0x31')](_0x1b366f)){for(var _0x10df5c in _0x1b366f){if(_0x1b366f[_0x9b94('0x27')](_0x10df5c)){_0x1b366f[_0x10df5c][_0x9b94('0x32')]=0x0;_0x1b366f[_0x10df5c][_0x9b94('0x33')]=0x0;}}}}function clearVoiceQueues(_0xc9482b){if(!_['isEmpty'](_0xc9482b)){for(var _0x3ff57d in _0xc9482b){if(_0xc9482b['hasOwnProperty'](_0x3ff57d)){_0xc9482b[_0x3ff57d]['total']=0x0;_0xc9482b[_0x3ff57d][_0x9b94('0x2e')]=0x0;_0xc9482b[_0x3ff57d][_0x9b94('0x34')]=0x0;_0xc9482b[_0x3ff57d][_0x9b94('0x35')]=0x0;_0xc9482b[_0x3ff57d][_0x9b94('0x2f')]=0x0;_0xc9482b[_0x3ff57d][_0x9b94('0x30')]=0x0;_0xc9482b[_0x3ff57d][_0x9b94('0x36')]=0x0;_0xc9482b[_0x3ff57d][_0x9b94('0x37')]=0x0;_0xc9482b[_0x3ff57d][_0x9b94('0x38')]=0x0;_0xc9482b[_0x3ff57d]['outboundBusyCallsDay']=0x0;_0xc9482b[_0x3ff57d][_0x9b94('0x39')]=0x0;_0xc9482b[_0x3ff57d]['outboundNoSuchCallsDay']=0x0;_0xc9482b[_0x3ff57d][_0x9b94('0x3a')]=0x0;_0xc9482b[_0x3ff57d][_0x9b94('0x3b')]=0x0;_0xc9482b[_0x3ff57d][_0x9b94('0x3c')]=0x0;_0xc9482b[_0x3ff57d][_0x9b94('0x3d')]=0x0;_0xc9482b[_0x3ff57d]['outboundOriginateFailureCallsDay']=0x0;_0xc9482b[_0x3ff57d][_0x9b94('0x3e')]=0x0;_0xc9482b[_0x3ff57d][_0x9b94('0x3f')]=0x0;_0xc9482b[_0x3ff57d][_0x9b94('0x37')]=0x0;_0xc9482b[_0x3ff57d][_0x9b94('0x40')]=0x0;_0xc9482b[_0x3ff57d][_0x9b94('0x41')]=!![];}}}}Realtime['prototype'][_0x9b94('0x42')]=function(_0x370746,_0x52fd7f){for(var _0x1c9393 in _0x52fd7f){if(_0x370746[_0x9b94('0x27')](_0x1c9393)){_0x370746[_0x1c9393]=_0x52fd7f[_0x1c9393];}}};Realtime[_0x9b94('0x43')][_0x9b94('0x44')]=function(){var _0x1ef3ff=this;return function(_0x21c3b5){if(_0x21c3b5){freeIsNotKeyAgent(_0x21c3b5,_0x1ef3ff[_0x9b94('0x12')]);for(var _0x11a577=0x0,_0x333209={},_0x4d8b44={};_0x11a577<_0x21c3b5[_0x9b94('0x45')];_0x11a577+=0x1){_0x333209=_0x21c3b5[_0x11a577];var _0x452d54=_[_0x9b94('0x2b')](_0x333209[_0x9b94('0x2c')])?util[_0x9b94('0x28')]('SIP/%s',_0x333209['name']):_0x333209['interface'];if(_[_0x9b94('0x46')](_0x1ef3ff[_0x9b94('0x12')][_0x452d54])){_0x1ef3ff[_0x9b94('0x12')][_0x452d54]=new Agent(_0x333209);}else{_0x1ef3ff['mergeFromDatabase'](_0x1ef3ff[_0x9b94('0x12')][_0x452d54],_0x333209);}}}return _0x1ef3ff['agents'];};};Realtime[_0x9b94('0x43')][_0x9b94('0x47')]=function(){var _0x379d06=this;return function(_0x3909b1){if(_0x3909b1){freeIsNotKeySip(_0x3909b1,_0x379d06[_0x9b94('0x13')]);for(var _0x169c0d=0x0,_0xab1bea={},_0x4bd9fa={};_0x169c0d<_0x3909b1[_0x9b94('0x45')];_0x169c0d+=0x1){_0xab1bea=_0x3909b1[_0x169c0d];if(_[_0x9b94('0x46')](_0x379d06['telephones'][util[_0x9b94('0x28')](_0x9b94('0x29'),_0xab1bea['name'])])){_0x379d06['telephones'][util['format'](_0x9b94('0x29'),_0xab1bea['name'])]=new Telephone(_0xab1bea);}else{_0x379d06[_0x9b94('0x42')](_0x379d06[_0x9b94('0x13')][util[_0x9b94('0x28')](_0x9b94('0x29'),_0xab1bea[_0x9b94('0x2a')])],_0xab1bea);}}}return _0x379d06['telephones'];};};Realtime[_0x9b94('0x43')][_0x9b94('0x48')]=function(){var _0x49b06a=this;return function(_0x584633){if(_0x584633){freeIsNotKeySip(_0x584633,_0x49b06a[_0x9b94('0x14')]);for(var _0x48156a=0x0,_0x4b12db={},_0x304f29={};_0x48156a<_0x584633[_0x9b94('0x45')];_0x48156a+=0x1){_0x4b12db=_0x584633[_0x48156a];if(_[_0x9b94('0x46')](_0x49b06a[_0x9b94('0x14')][util['format'](_0x9b94('0x29'),_0x4b12db[_0x9b94('0x2a')])])){_0x49b06a[_0x9b94('0x14')][util[_0x9b94('0x28')](_0x9b94('0x29'),_0x4b12db[_0x9b94('0x2a')])]=new Trunk(_0x4b12db);}else{_0x49b06a[_0x9b94('0x42')](_0x49b06a['trunks'][util[_0x9b94('0x28')](_0x9b94('0x29'),_0x4b12db[_0x9b94('0x2a')])],_0x4b12db);}}}return _0x49b06a[_0x9b94('0x14')];};};Realtime[_0x9b94('0x43')][_0x9b94('0x49')]=function(){var _0x498a9d=this;return function(_0x2867a3){if(_0x2867a3){freeIsNotKey(_0x2867a3,_0x498a9d[_0x9b94('0x15')],_0x9b94('0x2a'));for(var _0xbacbe4=0x0,_0x28abbd={},_0x44418a={};_0xbacbe4<_0x2867a3[_0x9b94('0x45')];_0xbacbe4+=0x1){_0x28abbd=_0x2867a3[_0xbacbe4];if(_[_0x9b94('0x46')](_0x498a9d[_0x9b94('0x15')][_0x28abbd[_0x9b94('0x2a')]])){_0x498a9d[_0x9b94('0x15')][_0x28abbd[_0x9b94('0x2a')]]=new VoiceQueue(_0x28abbd);}else{_0x498a9d['mergeFromDatabase'](_0x498a9d['voiceQueues'][_0x28abbd[_0x9b94('0x2a')]],_0x28abbd);}}}return _0x498a9d[_0x9b94('0x15')];};};Realtime['prototype'][_0x9b94('0x4a')]=function(){var _0x54168d=this;return function(_0x927710){if(_0x927710){freeIsNotKey(_0x927710,_0x54168d[_0x9b94('0x4b')],'id');for(var _0x270d9c=0x0,_0x26db4c={},_0x16ffb9={};_0x270d9c<_0x927710[_0x9b94('0x45')];_0x270d9c+=0x1){_0x26db4c=_0x927710[_0x270d9c];if(_[_0x9b94('0x46')](_0x54168d[_0x9b94('0x4b')][_0x26db4c['id']])){_0x54168d[_0x9b94('0x4b')][_0x26db4c['id']]=new Trigger(_0x26db4c);}else{_0x54168d[_0x9b94('0x42')](_0x54168d[_0x9b94('0x4b')][_0x26db4c['id']],_0x26db4c);}}}return _0x54168d[_0x9b94('0x4b')];};};Realtime[_0x9b94('0x43')][_0x9b94('0x4c')]=function(){var _0x55ca70=this;return function(_0x5801de){if(_0x5801de){freeIsNotKey(_0x5801de,_0x55ca70[_0x9b94('0x16')],'id');for(var _0x1d0258=0x0,_0x4d9d4e={},_0xe21967={};_0x1d0258<_0x5801de[_0x9b94('0x45')];_0x1d0258+=0x1){_0x4d9d4e=_0x5801de[_0x1d0258];if(_[_0x9b94('0x46')](_0x55ca70[_0x9b94('0x16')][_0x4d9d4e['id']])){_0x55ca70[_0x9b94('0x16')][_0x4d9d4e['id']]=new Template(_0x4d9d4e);}else{_0x55ca70['mergeFromDatabase'](_0x55ca70[_0x9b94('0x16')][_0x4d9d4e['id']],_0x4d9d4e);}}}return _0x55ca70[_0x9b94('0x16')];};};Realtime[_0x9b94('0x43')][_0x9b94('0x4d')]=function(){var _0x241bae=this;return function(_0x5ac0ba){if(_0x5ac0ba){freeIsNotKey(_0x5ac0ba,_0x241bae[_0x9b94('0x1d')],'id');for(var _0x45091a=0x0,_0x3aa047={},_0x4d3253={};_0x45091a<_0x5ac0ba['length'];_0x45091a+=0x1){_0x3aa047=_0x5ac0ba[_0x45091a];if(_[_0x9b94('0x46')](_0x241bae['zendeskAccounts'][_0x3aa047['id']])){_0x241bae[_0x9b94('0x1d')][_0x3aa047['id']]=new ZendeskAccount(_0x3aa047);}else{_0x241bae[_0x9b94('0x42')](_0x241bae[_0x9b94('0x1d')][_0x3aa047['id']],_0x3aa047);}}}return _0x241bae[_0x9b94('0x1d')];};};Realtime[_0x9b94('0x43')][_0x9b94('0x4e')]=function(){var _0x56be69=this;return function(_0xbeca03){if(_0xbeca03){freeIsNotKey(_0xbeca03,_0x56be69[_0x9b94('0x1e')],'id');for(var _0x420b61=0x0,_0x2f173e={},_0x33f591={};_0x420b61<_0xbeca03[_0x9b94('0x45')];_0x420b61+=0x1){_0x2f173e=_0xbeca03[_0x420b61];if(_[_0x9b94('0x46')](_0x56be69[_0x9b94('0x1e')][_0x2f173e['id']])){_0x56be69[_0x9b94('0x1e')][_0x2f173e['id']]=new SalesforceAccount(_0x2f173e);}else{_0x56be69['mergeFromDatabase'](_0x56be69[_0x9b94('0x1e')][_0x2f173e['id']],_0x2f173e);}}}return _0x56be69[_0x9b94('0x1e')];};};Realtime[_0x9b94('0x43')][_0x9b94('0x4f')]=function(){var _0x1c6c9c=this;return function(_0x5b3ef4){if(_0x5b3ef4){freeIsNotKey(_0x5b3ef4,_0x1c6c9c[_0x9b94('0x20')],'id');for(var _0x228a47=0x0,_0x1b7603={},_0x13c299={};_0x228a47<_0x5b3ef4[_0x9b94('0x45')];_0x228a47+=0x1){_0x1b7603=_0x5b3ef4[_0x228a47];if(_['isUndefined'](_0x1c6c9c[_0x9b94('0x20')][_0x1b7603['id']])){_0x1c6c9c[_0x9b94('0x20')][_0x1b7603['id']]=new FreshdeskAccount(_0x1b7603);}else{_0x1c6c9c['mergeFromDatabase'](_0x1c6c9c['freshdeskAccounts'][_0x1b7603['id']],_0x1b7603);}}}return _0x1c6c9c['freshdeskAccounts'];};};Realtime[_0x9b94('0x43')][_0x9b94('0x50')]=function(){var _0x36b3ac=this;return function(_0x26292d){if(_0x26292d){freeIsNotKey(_0x26292d,_0x36b3ac[_0x9b94('0x21')],'id');for(var _0x508207=0x0,_0x1559b6={},_0x3c7064={};_0x508207<_0x26292d[_0x9b94('0x45')];_0x508207+=0x1){_0x1559b6=_0x26292d[_0x508207];if(_[_0x9b94('0x46')](_0x36b3ac[_0x9b94('0x21')][_0x1559b6['id']])){_0x36b3ac[_0x9b94('0x21')][_0x1559b6['id']]=new ZohoAccount(_0x1559b6);}else{_0x36b3ac[_0x9b94('0x42')](_0x36b3ac[_0x9b94('0x21')][_0x1559b6['id']],_0x1559b6);}}}return _0x36b3ac[_0x9b94('0x21')];};};Realtime['prototype'][_0x9b94('0x51')]=function(){var _0x5b5b7f=this;return function(_0xab140){if(_0xab140){freeIsNotKey(_0xab140,_0x5b5b7f[_0x9b94('0x22')],'id');for(var _0xb9349b=0x0,_0x290495={},_0xe209fd={};_0xb9349b<_0xab140['length'];_0xb9349b+=0x1){_0x290495=_0xab140[_0xb9349b];if(_[_0x9b94('0x46')](_0x5b5b7f['deskAccounts'][_0x290495['id']])){_0x5b5b7f[_0x9b94('0x22')][_0x290495['id']]=new DeskAccount(_0x290495);}else{_0x5b5b7f[_0x9b94('0x42')](_0x5b5b7f['deskAccounts'][_0x290495['id']],_0x290495);}}}return _0x5b5b7f[_0x9b94('0x22')];};};Realtime[_0x9b94('0x43')][_0x9b94('0x52')]=function(){var _0x5d3e7c=this;return function(_0x24e39b){if(_0x24e39b){freeIsNotKey(_0x24e39b,_0x5d3e7c[_0x9b94('0x1f')],'id');for(var _0x1886a2=0x0,_0x443116={},_0x462afc={};_0x1886a2<_0x24e39b['length'];_0x1886a2+=0x1){_0x443116=_0x24e39b[_0x1886a2];if(_[_0x9b94('0x46')](_0x5d3e7c[_0x9b94('0x1f')][_0x443116['id']])){_0x5d3e7c[_0x9b94('0x1f')][_0x443116['id']]=new SugarcrmAccount(_0x443116);}else{_0x5d3e7c[_0x9b94('0x42')](_0x5d3e7c['sugarcrmAccounts'][_0x443116['id']],_0x443116);}}}return _0x5d3e7c['sugarcrmAccounts'];};};Realtime[_0x9b94('0x43')]['initVtigerAccounts']=function(){var _0x5b727e=this;return function(_0x51d80b){if(_0x51d80b){freeIsNotKey(_0x51d80b,_0x5b727e[_0x9b94('0x53')],'id');for(var _0x1e0c2e=0x0,_0x315fd1={},_0x592d97={};_0x1e0c2e<_0x51d80b[_0x9b94('0x45')];_0x1e0c2e+=0x1){_0x315fd1=_0x51d80b[_0x1e0c2e];if(_[_0x9b94('0x46')](_0x5b727e['vtigerAccounts'][_0x315fd1['id']])){_0x5b727e[_0x9b94('0x53')][_0x315fd1['id']]=new VtigerAccount(_0x315fd1);}else{_0x5b727e[_0x9b94('0x42')](_0x5b727e[_0x9b94('0x53')][_0x315fd1['id']],_0x315fd1);}}}return _0x5b727e[_0x9b94('0x53')];};};Realtime[_0x9b94('0x43')][_0x9b94('0x54')]=function(){var _0x513cc2=this;return function(_0x3e521b){if(_0x3e521b){freeIsNotKey(_0x3e521b,_0x513cc2['servicenowAccounts'],'id');for(var _0x345ba7=0x0,_0x4aaa1c={},_0x1cc77a={};_0x345ba7<_0x3e521b[_0x9b94('0x45')];_0x345ba7+=0x1){_0x4aaa1c=_0x3e521b[_0x345ba7];if(_[_0x9b94('0x46')](_0x513cc2[_0x9b94('0x23')][_0x4aaa1c['id']])){_0x513cc2[_0x9b94('0x23')][_0x4aaa1c['id']]=new ServicenowAccount(_0x4aaa1c);}else{_0x513cc2[_0x9b94('0x42')](_0x513cc2[_0x9b94('0x23')][_0x4aaa1c['id']],_0x4aaa1c);}}}return _0x513cc2[_0x9b94('0x23')];};};Realtime[_0x9b94('0x43')][_0x9b94('0x55')]=function(){var _0x893fdb=this;return function(_0x661526){if(_0x661526){freeIsNotKey(_0x661526,_0x893fdb[_0x9b94('0x24')],'id');for(var _0x14b0db=0x0,_0x9687d4={},_0xfde4d7={};_0x14b0db<_0x661526['length'];_0x14b0db+=0x1){_0x9687d4=_0x661526[_0x14b0db];if(_['isUndefined'](_0x893fdb[_0x9b94('0x24')][_0x9687d4['id']])){_0x893fdb[_0x9b94('0x24')][_0x9687d4['id']]=new Dynamics365Account(_0x9687d4);}else{_0x893fdb[_0x9b94('0x42')](_0x893fdb[_0x9b94('0x24')][_0x9687d4['id']],_0x9687d4);}}}return _0x893fdb[_0x9b94('0x24')];};};Realtime[_0x9b94('0x43')]['initFreshsalesAccounts']=function(){var _0x3c3f75=this;return function(_0x5b1732){if(_0x5b1732){freeIsNotKey(_0x5b1732,_0x3c3f75[_0x9b94('0x25')],'id');for(var _0xb67ab9=0x0,_0x5c3bb5={},_0x484199={};_0xb67ab9<_0x5b1732[_0x9b94('0x45')];_0xb67ab9+=0x1){_0x5c3bb5=_0x5b1732[_0xb67ab9];if(_['isUndefined'](_0x3c3f75[_0x9b94('0x25')][_0x5c3bb5['id']])){_0x3c3f75['freshsalesAccounts'][_0x5c3bb5['id']]=new FreshsalesAccount(_0x5c3bb5);}else{_0x3c3f75[_0x9b94('0x42')](_0x3c3f75[_0x9b94('0x25')][_0x5c3bb5['id']],_0x5c3bb5);}}}return _0x3c3f75['freshsalesAccounts'];};};Realtime[_0x9b94('0x43')][_0x9b94('0x56')]=function(){var _0x23add7=this;return function(_0x1f6939){for(var _0x21c334=0x0;_0x21c334<_0x1f6939[_0x9b94('0x45')];_0x21c334+=0x1){_['merge'](_0x23add7[_0x9b94('0x15')][_0x1f6939[_0x21c334][_0x9b94('0x2a')]],_0x1f6939[_0x21c334]);}return _0x23add7[_0x9b94('0x15')];};};Realtime[_0x9b94('0x43')][_0x9b94('0x57')]=function(){var _0x5d19ae=this;return function(_0x501bf7){clearVoiceQueues(_0x5d19ae[_0x9b94('0x15')]);if(_0x501bf7){_0x501bf7=_[_0x9b94('0x58')](_0x501bf7,_0x9b94('0x59'));for(var _0x53d893 in _0x501bf7){if(_0x501bf7['hasOwnProperty'](_0x53d893)){var _0x246ced={};for(var _0x31cb2e=0x0;_0x31cb2e<_0x501bf7[_0x53d893][_0x9b94('0x45')];_0x31cb2e+=0x1){var _0x3856a4=_0x501bf7[_0x53d893][_0x31cb2e][_0x9b94('0x5a')];if(_0x5d19ae['voiceQueues'][_0x3856a4]){if(_0x501bf7[_0x53d893][_0x31cb2e]['queuecallerexit']){_0x5d19ae['voiceQueues'][_0x3856a4][_0x9b94('0x34')]+=0x1;}if(_0x501bf7[_0x53d893][_0x31cb2e][_0x9b94('0x5b')]){_0x5d19ae[_0x9b94('0x15')][_0x3856a4]['abandoned']+=0x1;}_0x5d19ae[_0x9b94('0x15')][_0x3856a4][_0x9b94('0x2f')]+=moment(_0x501bf7[_0x53d893][_0x31cb2e][_0x9b94('0x5c')])['diff'](moment(_0x501bf7[_0x53d893][_0x31cb2e][_0x9b94('0x5d')]),'seconds')||0x0;if(_0x31cb2e===_0x501bf7[_0x53d893][_0x9b94('0x45')]-0x1){_0x5d19ae['voiceQueues'][_0x3856a4][_0x9b94('0x30')]+=moment(_0x501bf7[_0x53d893][_0x31cb2e][_0x9b94('0x5e')]||_0x501bf7[_0x53d893][_0x31cb2e]['queuecallerabandonAt']||_0x501bf7[_0x53d893][_0x31cb2e]['queuecallerexitAt'])[_0x9b94('0x5f')](moment(_0x501bf7[_0x53d893][_0x31cb2e][_0x9b94('0x5d')]),_0x9b94('0x60'))||0x0;_0x5d19ae['voiceQueues'][_0x3856a4]['total']+=0x1;if(_0x501bf7[_0x53d893][_0x31cb2e]['queuecallercomplete']){_0x5d19ae[_0x9b94('0x15')][_0x3856a4]['answered']+=0x1;_0x5d19ae[_0x9b94('0x15')][_0x3856a4][_0x9b94('0x36')]+=moment(_0x501bf7[_0x53d893][_0x31cb2e][_0x9b94('0x5e')])['diff'](moment(_0x501bf7[_0x53d893][_0x31cb2e]['queuecallerleaveAt']),'seconds')||0x0;}}else{_0x5d19ae[_0x9b94('0x15')][_0x3856a4][_0x9b94('0x30')]+=_0x5d19ae[_0x9b94('0x15')][_0x3856a4][_0x9b94('0x2f')]||0x0;}}}}}}return _0x5d19ae[_0x9b94('0x15')];};};Realtime[_0x9b94('0x43')][_0x9b94('0x61')]=function(){var _0x5876cc=this;return function(_0x3234e4){clearVoiceCallReports(_0x5876cc[_0x9b94('0x17')]);if(_0x3234e4){for(var _0x2c8c6e=0x0;_0x2c8c6e<_0x3234e4['length'];_0x2c8c6e+=0x1){_0x5876cc[_0x9b94('0x17')][_0x9b94('0x2d')]+=0x1;_0x5876cc[_0x9b94('0x17')][_0x9b94('0x30')]+=_0x3234e4[_0x2c8c6e][_0x9b94('0x62')];if(_0x3234e4[_0x2c8c6e]['disposition']===_0x9b94('0x63')){_0x5876cc['outbound'][_0x9b94('0x2e')]+=0x1;_0x5876cc['outbound'][_0x9b94('0x2f')]+=_0x3234e4[_0x2c8c6e][_0x9b94('0x62')]-_0x3234e4[_0x2c8c6e][_0x9b94('0x64')]||0x0;_0x5876cc['outbound'][_0x9b94('0x36')]+=_0x3234e4[_0x2c8c6e]['billableseconds'];}}}return _0x5876cc['outbound'];};};Realtime[_0x9b94('0x43')][_0x9b94('0x65')]=function(){var _0x2f8fe4=this;return function(_0x4cc810){if(_0x4cc810){freeIsNotKey(_0x4cc810,_0x2f8fe4[_0x9b94('0x66')],_0x9b94('0x2a'));for(var _0x9070e8=0x0,_0x9e0376={};_0x9070e8<_0x4cc810[_0x9b94('0x45')];_0x9070e8+=0x1){_0x9e0376=_0x4cc810[_0x9070e8];if(_[_0x9b94('0x46')](_0x2f8fe4['campaigns'][_0x9e0376[_0x9b94('0x2a')]])){_0x2f8fe4['campaigns'][_0x9e0376['name']]=new Campaign(_0x9e0376);}else{_0x2f8fe4[_0x9b94('0x42')](_0x2f8fe4['campaigns'][_0x9e0376['name']],_0x9e0376);_0x2f8fe4[_0x9b94('0x66')][_0x9e0376[_0x9b94('0x2a')]][_0x9b94('0x67')]=_0x9e0376[_0x9b94('0x68')]?_0x9e0376[_0x9b94('0x68')]['name']:undefined;}}}return _0x2f8fe4['campaigns'];};};Realtime['prototype'][_0x9b94('0x69')]=function(){var _0x2ab01f=this;return function(_0x158421){if(_0x158421){freeIsNotKey(_0x158421,_0x2ab01f['voiceExtensions'],'id');for(var _0x1edc73=0x0,_0x58e5b2={};_0x1edc73<_0x158421[_0x9b94('0x45')];_0x1edc73+=0x1){_0x58e5b2=_0x158421[_0x1edc73];if(_[_0x9b94('0x46')](_0x2ab01f[_0x9b94('0x18')][_0x58e5b2['id']])){_0x2ab01f[_0x9b94('0x18')][_0x58e5b2['id']]=new VoiceExtension(_0x58e5b2);}else{_0x2ab01f[_0x9b94('0x42')](_0x2ab01f[_0x9b94('0x18')][_0x58e5b2['id']],_0x58e5b2);}}}return _0x2ab01f[_0x9b94('0x18')];};};Realtime[_0x9b94('0x43')][_0x9b94('0x6a')]=function(){var _0x305f71=this;return function(_0x229073){clearCampaigns(_0x305f71[_0x9b94('0x66')]);for(var _0x3c4ed4=0x0;_0x3c4ed4<_0x229073['length'];_0x3c4ed4+=0x1){_[_0x9b94('0x6b')](_0x305f71['campaigns'][_0x229073[_0x3c4ed4]['name']],_0x229073[_0x3c4ed4]);}return _0x305f71[_0x9b94('0x66')];};};Realtime[_0x9b94('0x43')]['initFaxAccounts']=function(){var _0x53f3a0=this;return function(_0x16385c){if(_0x16385c){freeIsNotKey(_0x16385c,_0x53f3a0['faxAccounts'],'id');for(var _0x17965e=0x0,_0x34f04e={},_0x2cf2ee={};_0x17965e<_0x16385c[_0x9b94('0x45')];_0x17965e+=0x1){_0x34f04e=_0x16385c[_0x17965e];if(_[_0x9b94('0x46')](_0x53f3a0[_0x9b94('0x26')][_0x34f04e['id']])){_0x53f3a0['faxAccounts'][_0x34f04e['id']]=new FaxAccount(_0x34f04e);}else{_0x53f3a0[_0x9b94('0x42')](_0x53f3a0[_0x9b94('0x26')][_0x34f04e['id']],_0x34f04e);}}}return _0x53f3a0[_0x9b94('0x26')];};};module[_0x9b94('0x6c')]=Realtime; \ No newline at end of file +var _0xb94e=['../model/freshdeskAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/faxAccount','telephones','trunks','triggers','campaigns','templates','outbound','voiceExtensions','queueChannels','outboundChannels','settings','zendeskAccounts','freshdeskAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','mapKeys','hasOwnProperty','SIP/%s','name','isNil','interface','format','total','sumDuration','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','answered','unmanaged','sumHoldTime','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerAgiCallsDay','queueStatusComplete','prototype','initAgents','agents','isUndefined','mergeFromDatabase','initTelephones','length','initTrunks','initVoiceQueues','voiceQueues','initTriggers','initZendeskAccounts','salesforceAccounts','initFreshdeskAccounts','zohoAccounts','initDeskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueReports','groupBy','uniqueid','queue','abandoned','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallerexitAt','sumBillable','queuecallercompleteAt','initVoiceCallReports','duration','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','merge','faxAccounts','exports','bluebird','util','lodash','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/campaign','../model/zendeskAccount'];(function(_0x3a7f0a,_0xd5bed){var _0x6725fe=function(_0x5e0f08){while(--_0x5e0f08){_0x3a7f0a['push'](_0x3a7f0a['shift']());}};_0x6725fe(++_0xd5bed);}(_0xb94e,0xbf));var _0xeb94=function(_0x10f249,_0x5eb137){_0x10f249=_0x10f249-0x0;var _0x3adfad=_0xb94e[_0x10f249];return _0x3adfad;};'use strict';var BPromise=require(_0xeb94('0x0'));var util=require(_0xeb94('0x1'));var _=require(_0xeb94('0x2'));var moment=require('moment');var Agent=require(_0xeb94('0x3'));var Telephone=require(_0xeb94('0x4'));var Trunk=require(_0xeb94('0x5'));var VoiceQueue=require(_0xeb94('0x6'));var Trigger=require('../model/trigger');var Template=require('../model/template');var Campaign=require(_0xeb94('0x7'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0xeb94('0x8'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0xeb94('0x9'));var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0xeb94('0xa'));var DeskAccount=require(_0xeb94('0xb'));var VtigerAccount=require(_0xeb94('0xc'));var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0xeb94('0xd'));var Realtime=function(){this['agents']={};this[_0xeb94('0xe')]={};this[_0xeb94('0xf')]={};this['voiceQueues']={};this[_0xeb94('0x10')]={};this[_0xeb94('0x11')]={};this[_0xeb94('0x12')]={};this[_0xeb94('0x13')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xeb94('0x14')]={};this['channels']={};this[_0xeb94('0x15')]={};this[_0xeb94('0x16')]={};this['timers']={};this[_0xeb94('0x17')]={};this[_0xeb94('0x18')]={};this['salesforceAccounts']={};this['sugarcrmAccounts']={};this[_0xeb94('0x19')]={};this['zohoAccounts']={};this[_0xeb94('0x1a')]={};this[_0xeb94('0x1b')]={};this[_0xeb94('0x1c')]={};this[_0xeb94('0x1d')]={};this[_0xeb94('0x1e')]={};this['faxAccounts']={};};function freeIsNotKey(_0x41f4b8,_0x52e9f5,_0x6634f5){var _0x4d6c37=_[_0xeb94('0x1f')](_0x41f4b8,function(_0x89d10f,_0x202bd3){return _0x89d10f[_0x6634f5];});for(var _0x52f29c in _0x52e9f5){if(_0x52e9f5[_0xeb94('0x20')](_0x52f29c)){if(!_0x4d6c37[_0x52f29c]){delete _0x52e9f5[_0x52f29c];}}}}function freeIsNotKeySip(_0x419f42,_0x5a9e38){var _0xf707ba=_['mapKeys'](_0x419f42,function(_0x5c75b4,_0x7d1fb5){return util['format'](_0xeb94('0x21'),_0x5c75b4[_0xeb94('0x22')]);});for(var _0x7b518a in _0x5a9e38){if(_0x5a9e38[_0xeb94('0x20')](_0x7b518a)){if(!_0xf707ba[_0x7b518a]){delete _0x5a9e38[_0x7b518a];}}}}function freeIsNotKeyAgent(_0x1d9015,_0x155110){var _0x409e16=_['mapKeys'](_0x1d9015,function(_0x133182,_0x231240){var _0x557d33=_[_0xeb94('0x23')](_0x133182[_0xeb94('0x24')])?util[_0xeb94('0x25')](_0xeb94('0x21'),_0x133182[_0xeb94('0x22')]):_0x133182[_0xeb94('0x24')];return _0x557d33;});for(var _0xce59af in _0x155110){if(_0x155110[_0xeb94('0x20')](_0xce59af)){if(!_0x409e16[_0xce59af]){delete _0x155110[_0xce59af];}}}}function clearVoiceCallReports(_0x38793e){_0x38793e[_0xeb94('0x26')]=0x0;_0x38793e['answered']=0x0;_0x38793e['sumHoldTime']=0x0;_0x38793e[_0xeb94('0x27')]=0x0;_0x38793e['sumBillable']=0x0;}function clearCampaigns(_0x14619a){if(!_[_0xeb94('0x28')](_0x14619a)){for(var _0x197eff in _0x14619a){if(_0x14619a[_0xeb94('0x20')](_0x197eff)){_0x14619a[_0x197eff][_0xeb94('0x29')]=0x0;_0x14619a[_0x197eff][_0xeb94('0x2a')]=0x0;}}}}function clearVoiceQueues(_0x2a6a0a){if(!_[_0xeb94('0x28')](_0x2a6a0a)){for(var _0x55fe07 in _0x2a6a0a){if(_0x2a6a0a[_0xeb94('0x20')](_0x55fe07)){_0x2a6a0a[_0x55fe07][_0xeb94('0x26')]=0x0;_0x2a6a0a[_0x55fe07][_0xeb94('0x2b')]=0x0;_0x2a6a0a[_0x55fe07][_0xeb94('0x2c')]=0x0;_0x2a6a0a[_0x55fe07]['abandoned']=0x0;_0x2a6a0a[_0x55fe07][_0xeb94('0x2d')]=0x0;_0x2a6a0a[_0x55fe07][_0xeb94('0x27')]=0x0;_0x2a6a0a[_0x55fe07]['sumBillable']=0x0;_0x2a6a0a[_0x55fe07]['outboundAnswerAgiCallsDay']=0x0;_0x2a6a0a[_0x55fe07][_0xeb94('0x2e')]=0x0;_0x2a6a0a[_0x55fe07]['outboundBusyCallsDay']=0x0;_0x2a6a0a[_0x55fe07][_0xeb94('0x2f')]=0x0;_0x2a6a0a[_0x55fe07][_0xeb94('0x30')]=0x0;_0x2a6a0a[_0x55fe07][_0xeb94('0x31')]=0x0;_0x2a6a0a[_0x55fe07][_0xeb94('0x32')]=0x0;_0x2a6a0a[_0x55fe07][_0xeb94('0x33')]=0x0;_0x2a6a0a[_0x55fe07]['outboundBlacklistCallsDay']=0x0;_0x2a6a0a[_0x55fe07][_0xeb94('0x34')]=0x0;_0x2a6a0a[_0x55fe07][_0xeb94('0x35')]=0x0;_0x2a6a0a[_0x55fe07][_0xeb94('0x36')]=0x0;_0x2a6a0a[_0x55fe07][_0xeb94('0x37')]=0x0;_0x2a6a0a[_0x55fe07]['outboundAnswerCallsDay']=0x0;_0x2a6a0a[_0x55fe07][_0xeb94('0x38')]=!![];}}}}Realtime[_0xeb94('0x39')]['mergeFromDatabase']=function(_0x5958df,_0x40c02a){for(var _0x367830 in _0x40c02a){if(_0x5958df[_0xeb94('0x20')](_0x367830)){_0x5958df[_0x367830]=_0x40c02a[_0x367830];}}};Realtime[_0xeb94('0x39')][_0xeb94('0x3a')]=function(){var _0xcf359b=this;return function(_0x54e650){if(_0x54e650){freeIsNotKeyAgent(_0x54e650,_0xcf359b[_0xeb94('0x3b')]);for(var _0x427ae6=0x0,_0xf33edd={},_0x3f8f01={};_0x427ae6<_0x54e650['length'];_0x427ae6+=0x1){_0xf33edd=_0x54e650[_0x427ae6];var _0x73917d=_[_0xeb94('0x23')](_0xf33edd[_0xeb94('0x24')])?util[_0xeb94('0x25')](_0xeb94('0x21'),_0xf33edd[_0xeb94('0x22')]):_0xf33edd['interface'];if(_[_0xeb94('0x3c')](_0xcf359b[_0xeb94('0x3b')][_0x73917d])){_0xcf359b[_0xeb94('0x3b')][_0x73917d]=new Agent(_0xf33edd);}else{_0xcf359b[_0xeb94('0x3d')](_0xcf359b[_0xeb94('0x3b')][_0x73917d],_0xf33edd);}}}return _0xcf359b[_0xeb94('0x3b')];};};Realtime[_0xeb94('0x39')][_0xeb94('0x3e')]=function(){var _0x44bf4b=this;return function(_0x1f9a91){if(_0x1f9a91){freeIsNotKeySip(_0x1f9a91,_0x44bf4b['telephones']);for(var _0x1801c4=0x0,_0x1a567={},_0x429bcf={};_0x1801c4<_0x1f9a91[_0xeb94('0x3f')];_0x1801c4+=0x1){_0x1a567=_0x1f9a91[_0x1801c4];if(_['isUndefined'](_0x44bf4b[_0xeb94('0xe')][util['format'](_0xeb94('0x21'),_0x1a567[_0xeb94('0x22')])])){_0x44bf4b[_0xeb94('0xe')][util['format'](_0xeb94('0x21'),_0x1a567['name'])]=new Telephone(_0x1a567);}else{_0x44bf4b['mergeFromDatabase'](_0x44bf4b[_0xeb94('0xe')][util[_0xeb94('0x25')](_0xeb94('0x21'),_0x1a567['name'])],_0x1a567);}}}return _0x44bf4b['telephones'];};};Realtime['prototype'][_0xeb94('0x40')]=function(){var _0x1b1e7d=this;return function(_0x495dcb){if(_0x495dcb){freeIsNotKeySip(_0x495dcb,_0x1b1e7d[_0xeb94('0xf')]);for(var _0x1fd4d1=0x0,_0x5df271={},_0x445559={};_0x1fd4d1<_0x495dcb[_0xeb94('0x3f')];_0x1fd4d1+=0x1){_0x5df271=_0x495dcb[_0x1fd4d1];if(_['isUndefined'](_0x1b1e7d[_0xeb94('0xf')][util[_0xeb94('0x25')](_0xeb94('0x21'),_0x5df271[_0xeb94('0x22')])])){_0x1b1e7d[_0xeb94('0xf')][util[_0xeb94('0x25')](_0xeb94('0x21'),_0x5df271[_0xeb94('0x22')])]=new Trunk(_0x5df271);}else{_0x1b1e7d[_0xeb94('0x3d')](_0x1b1e7d['trunks'][util[_0xeb94('0x25')]('SIP/%s',_0x5df271[_0xeb94('0x22')])],_0x5df271);}}}return _0x1b1e7d[_0xeb94('0xf')];};};Realtime[_0xeb94('0x39')][_0xeb94('0x41')]=function(){var _0x4a8e1b=this;return function(_0x39d140){if(_0x39d140){freeIsNotKey(_0x39d140,_0x4a8e1b['voiceQueues'],_0xeb94('0x22'));for(var _0x43092b=0x0,_0x1da820={},_0x2f09d5={};_0x43092b<_0x39d140[_0xeb94('0x3f')];_0x43092b+=0x1){_0x1da820=_0x39d140[_0x43092b];if(_[_0xeb94('0x3c')](_0x4a8e1b[_0xeb94('0x42')][_0x1da820[_0xeb94('0x22')]])){_0x4a8e1b[_0xeb94('0x42')][_0x1da820[_0xeb94('0x22')]]=new VoiceQueue(_0x1da820);}else{_0x4a8e1b[_0xeb94('0x3d')](_0x4a8e1b[_0xeb94('0x42')][_0x1da820[_0xeb94('0x22')]],_0x1da820);}}}return _0x4a8e1b['voiceQueues'];};};Realtime[_0xeb94('0x39')][_0xeb94('0x43')]=function(){var _0x15838f=this;return function(_0x1e7f17){if(_0x1e7f17){freeIsNotKey(_0x1e7f17,_0x15838f[_0xeb94('0x10')],'id');for(var _0x16a95c=0x0,_0x14c3e4={},_0x5243fa={};_0x16a95c<_0x1e7f17['length'];_0x16a95c+=0x1){_0x14c3e4=_0x1e7f17[_0x16a95c];if(_['isUndefined'](_0x15838f['triggers'][_0x14c3e4['id']])){_0x15838f[_0xeb94('0x10')][_0x14c3e4['id']]=new Trigger(_0x14c3e4);}else{_0x15838f[_0xeb94('0x3d')](_0x15838f[_0xeb94('0x10')][_0x14c3e4['id']],_0x14c3e4);}}}return _0x15838f[_0xeb94('0x10')];};};Realtime[_0xeb94('0x39')]['initTemplates']=function(){var _0x100ebb=this;return function(_0x73eda1){if(_0x73eda1){freeIsNotKey(_0x73eda1,_0x100ebb[_0xeb94('0x12')],'id');for(var _0x1a49d7=0x0,_0xa61230={},_0x5108d2={};_0x1a49d7<_0x73eda1[_0xeb94('0x3f')];_0x1a49d7+=0x1){_0xa61230=_0x73eda1[_0x1a49d7];if(_['isUndefined'](_0x100ebb[_0xeb94('0x12')][_0xa61230['id']])){_0x100ebb[_0xeb94('0x12')][_0xa61230['id']]=new Template(_0xa61230);}else{_0x100ebb[_0xeb94('0x3d')](_0x100ebb[_0xeb94('0x12')][_0xa61230['id']],_0xa61230);}}}return _0x100ebb[_0xeb94('0x12')];};};Realtime[_0xeb94('0x39')][_0xeb94('0x44')]=function(){var _0x48528e=this;return function(_0x407cc8){if(_0x407cc8){freeIsNotKey(_0x407cc8,_0x48528e[_0xeb94('0x18')],'id');for(var _0x2c34f9=0x0,_0x31894e={},_0x1b9b84={};_0x2c34f9<_0x407cc8[_0xeb94('0x3f')];_0x2c34f9+=0x1){_0x31894e=_0x407cc8[_0x2c34f9];if(_[_0xeb94('0x3c')](_0x48528e['zendeskAccounts'][_0x31894e['id']])){_0x48528e[_0xeb94('0x18')][_0x31894e['id']]=new ZendeskAccount(_0x31894e);}else{_0x48528e['mergeFromDatabase'](_0x48528e[_0xeb94('0x18')][_0x31894e['id']],_0x31894e);}}}return _0x48528e[_0xeb94('0x18')];};};Realtime[_0xeb94('0x39')]['initSalesforceAccounts']=function(){var _0x4ac0b1=this;return function(_0x8907d2){if(_0x8907d2){freeIsNotKey(_0x8907d2,_0x4ac0b1[_0xeb94('0x45')],'id');for(var _0xc84c3=0x0,_0x1ebf9d={},_0x3cb3b5={};_0xc84c3<_0x8907d2[_0xeb94('0x3f')];_0xc84c3+=0x1){_0x1ebf9d=_0x8907d2[_0xc84c3];if(_[_0xeb94('0x3c')](_0x4ac0b1['salesforceAccounts'][_0x1ebf9d['id']])){_0x4ac0b1['salesforceAccounts'][_0x1ebf9d['id']]=new SalesforceAccount(_0x1ebf9d);}else{_0x4ac0b1[_0xeb94('0x3d')](_0x4ac0b1[_0xeb94('0x45')][_0x1ebf9d['id']],_0x1ebf9d);}}}return _0x4ac0b1[_0xeb94('0x45')];};};Realtime[_0xeb94('0x39')][_0xeb94('0x46')]=function(){var _0x47fddd=this;return function(_0xa20fac){if(_0xa20fac){freeIsNotKey(_0xa20fac,_0x47fddd[_0xeb94('0x19')],'id');for(var _0x497086=0x0,_0x115915={},_0x19eeb2={};_0x497086<_0xa20fac[_0xeb94('0x3f')];_0x497086+=0x1){_0x115915=_0xa20fac[_0x497086];if(_[_0xeb94('0x3c')](_0x47fddd[_0xeb94('0x19')][_0x115915['id']])){_0x47fddd[_0xeb94('0x19')][_0x115915['id']]=new FreshdeskAccount(_0x115915);}else{_0x47fddd[_0xeb94('0x3d')](_0x47fddd[_0xeb94('0x19')][_0x115915['id']],_0x115915);}}}return _0x47fddd['freshdeskAccounts'];};};Realtime[_0xeb94('0x39')]['initZohoAccounts']=function(){var _0x5b8e79=this;return function(_0x5ab3fb){if(_0x5ab3fb){freeIsNotKey(_0x5ab3fb,_0x5b8e79[_0xeb94('0x47')],'id');for(var _0x92148a=0x0,_0x461eb5={},_0x7b696f={};_0x92148a<_0x5ab3fb[_0xeb94('0x3f')];_0x92148a+=0x1){_0x461eb5=_0x5ab3fb[_0x92148a];if(_[_0xeb94('0x3c')](_0x5b8e79[_0xeb94('0x47')][_0x461eb5['id']])){_0x5b8e79[_0xeb94('0x47')][_0x461eb5['id']]=new ZohoAccount(_0x461eb5);}else{_0x5b8e79[_0xeb94('0x3d')](_0x5b8e79[_0xeb94('0x47')][_0x461eb5['id']],_0x461eb5);}}}return _0x5b8e79['zohoAccounts'];};};Realtime['prototype'][_0xeb94('0x48')]=function(){var _0x27829a=this;return function(_0x3af69f){if(_0x3af69f){freeIsNotKey(_0x3af69f,_0x27829a['deskAccounts'],'id');for(var _0x56ff3d=0x0,_0x1d0cfc={},_0x5b7e5a={};_0x56ff3d<_0x3af69f[_0xeb94('0x3f')];_0x56ff3d+=0x1){_0x1d0cfc=_0x3af69f[_0x56ff3d];if(_['isUndefined'](_0x27829a[_0xeb94('0x1a')][_0x1d0cfc['id']])){_0x27829a[_0xeb94('0x1a')][_0x1d0cfc['id']]=new DeskAccount(_0x1d0cfc);}else{_0x27829a['mergeFromDatabase'](_0x27829a[_0xeb94('0x1a')][_0x1d0cfc['id']],_0x1d0cfc);}}}return _0x27829a[_0xeb94('0x1a')];};};Realtime[_0xeb94('0x39')][_0xeb94('0x49')]=function(){var _0x18b764=this;return function(_0x20abfd){if(_0x20abfd){freeIsNotKey(_0x20abfd,_0x18b764[_0xeb94('0x4a')],'id');for(var _0x4b6c86=0x0,_0x11f587={},_0x3dd832={};_0x4b6c86<_0x20abfd[_0xeb94('0x3f')];_0x4b6c86+=0x1){_0x11f587=_0x20abfd[_0x4b6c86];if(_[_0xeb94('0x3c')](_0x18b764[_0xeb94('0x4a')][_0x11f587['id']])){_0x18b764[_0xeb94('0x4a')][_0x11f587['id']]=new SugarcrmAccount(_0x11f587);}else{_0x18b764[_0xeb94('0x3d')](_0x18b764[_0xeb94('0x4a')][_0x11f587['id']],_0x11f587);}}}return _0x18b764[_0xeb94('0x4a')];};};Realtime[_0xeb94('0x39')][_0xeb94('0x4b')]=function(){var _0x3264fd=this;return function(_0x1b372f){if(_0x1b372f){freeIsNotKey(_0x1b372f,_0x3264fd['vtigerAccounts'],'id');for(var _0x40d629=0x0,_0x494a01={},_0x8eef4c={};_0x40d629<_0x1b372f[_0xeb94('0x3f')];_0x40d629+=0x1){_0x494a01=_0x1b372f[_0x40d629];if(_[_0xeb94('0x3c')](_0x3264fd[_0xeb94('0x1b')][_0x494a01['id']])){_0x3264fd[_0xeb94('0x1b')][_0x494a01['id']]=new VtigerAccount(_0x494a01);}else{_0x3264fd['mergeFromDatabase'](_0x3264fd[_0xeb94('0x1b')][_0x494a01['id']],_0x494a01);}}}return _0x3264fd[_0xeb94('0x1b')];};};Realtime[_0xeb94('0x39')][_0xeb94('0x4c')]=function(){var _0x2a9454=this;return function(_0x241c92){if(_0x241c92){freeIsNotKey(_0x241c92,_0x2a9454[_0xeb94('0x1c')],'id');for(var _0x1aed49=0x0,_0x44d90={},_0x2e4b7a={};_0x1aed49<_0x241c92[_0xeb94('0x3f')];_0x1aed49+=0x1){_0x44d90=_0x241c92[_0x1aed49];if(_[_0xeb94('0x3c')](_0x2a9454[_0xeb94('0x1c')][_0x44d90['id']])){_0x2a9454[_0xeb94('0x1c')][_0x44d90['id']]=new ServicenowAccount(_0x44d90);}else{_0x2a9454[_0xeb94('0x3d')](_0x2a9454['servicenowAccounts'][_0x44d90['id']],_0x44d90);}}}return _0x2a9454['servicenowAccounts'];};};Realtime['prototype'][_0xeb94('0x4d')]=function(){var _0x4efe81=this;return function(_0x7de131){if(_0x7de131){freeIsNotKey(_0x7de131,_0x4efe81[_0xeb94('0x1d')],'id');for(var _0x2923a6=0x0,_0x450bd0={},_0x32a0a4={};_0x2923a6<_0x7de131[_0xeb94('0x3f')];_0x2923a6+=0x1){_0x450bd0=_0x7de131[_0x2923a6];if(_['isUndefined'](_0x4efe81[_0xeb94('0x1d')][_0x450bd0['id']])){_0x4efe81[_0xeb94('0x1d')][_0x450bd0['id']]=new Dynamics365Account(_0x450bd0);}else{_0x4efe81[_0xeb94('0x3d')](_0x4efe81[_0xeb94('0x1d')][_0x450bd0['id']],_0x450bd0);}}}return _0x4efe81[_0xeb94('0x1d')];};};Realtime[_0xeb94('0x39')][_0xeb94('0x4e')]=function(){var _0xb8a222=this;return function(_0x36f362){if(_0x36f362){freeIsNotKey(_0x36f362,_0xb8a222[_0xeb94('0x1e')],'id');for(var _0xfe4642=0x0,_0xb7dfdd={},_0x186be1={};_0xfe4642<_0x36f362[_0xeb94('0x3f')];_0xfe4642+=0x1){_0xb7dfdd=_0x36f362[_0xfe4642];if(_[_0xeb94('0x3c')](_0xb8a222['freshsalesAccounts'][_0xb7dfdd['id']])){_0xb8a222[_0xeb94('0x1e')][_0xb7dfdd['id']]=new FreshsalesAccount(_0xb7dfdd);}else{_0xb8a222['mergeFromDatabase'](_0xb8a222[_0xeb94('0x1e')][_0xb7dfdd['id']],_0xb7dfdd);}}}return _0xb8a222[_0xeb94('0x1e')];};};Realtime[_0xeb94('0x39')]['initVoiceQueueHopperHistory']=function(){var _0x52cf51=this;return function(_0x155ae2){for(var _0x21a069=0x0;_0x21a069<_0x155ae2[_0xeb94('0x3f')];_0x21a069+=0x1){_['merge'](_0x52cf51['voiceQueues'][_0x155ae2[_0x21a069][_0xeb94('0x22')]],_0x155ae2[_0x21a069]);}return _0x52cf51['voiceQueues'];};};Realtime['prototype'][_0xeb94('0x4f')]=function(){var _0x330617=this;return function(_0xb8af69){clearVoiceQueues(_0x330617[_0xeb94('0x42')]);if(_0xb8af69){_0xb8af69=_[_0xeb94('0x50')](_0xb8af69,_0xeb94('0x51'));for(var _0x4585cc in _0xb8af69){if(_0xb8af69[_0xeb94('0x20')](_0x4585cc)){var _0x594aad={};for(var _0x19153e=0x0;_0x19153e<_0xb8af69[_0x4585cc][_0xeb94('0x3f')];_0x19153e+=0x1){var _0x455035=_0xb8af69[_0x4585cc][_0x19153e][_0xeb94('0x52')];if(_0x330617[_0xeb94('0x42')][_0x455035]){if(_0xb8af69[_0x4585cc][_0x19153e]['queuecallerexit']){_0x330617[_0xeb94('0x42')][_0x455035]['unmanaged']+=0x1;}if(_0xb8af69[_0x4585cc][_0x19153e]['queuecallerabandon']){_0x330617[_0xeb94('0x42')][_0x455035][_0xeb94('0x53')]+=0x1;}_0x330617['voiceQueues'][_0x455035][_0xeb94('0x2d')]+=moment(_0xb8af69[_0x4585cc][_0x19153e][_0xeb94('0x54')])[_0xeb94('0x55')](moment(_0xb8af69[_0x4585cc][_0x19153e][_0xeb94('0x56')]),_0xeb94('0x57'))||0x0;if(_0x19153e===_0xb8af69[_0x4585cc][_0xeb94('0x3f')]-0x1){_0x330617[_0xeb94('0x42')][_0x455035][_0xeb94('0x27')]+=moment(_0xb8af69[_0x4585cc][_0x19153e]['queuecallercompleteAt']||_0xb8af69[_0x4585cc][_0x19153e]['queuecallerabandonAt']||_0xb8af69[_0x4585cc][_0x19153e][_0xeb94('0x58')])[_0xeb94('0x55')](moment(_0xb8af69[_0x4585cc][_0x19153e][_0xeb94('0x56')]),'seconds')||0x0;_0x330617[_0xeb94('0x42')][_0x455035]['total']+=0x1;if(_0xb8af69[_0x4585cc][_0x19153e]['queuecallercomplete']){_0x330617[_0xeb94('0x42')][_0x455035][_0xeb94('0x2b')]+=0x1;_0x330617[_0xeb94('0x42')][_0x455035][_0xeb94('0x59')]+=moment(_0xb8af69[_0x4585cc][_0x19153e][_0xeb94('0x5a')])[_0xeb94('0x55')](moment(_0xb8af69[_0x4585cc][_0x19153e]['queuecallerleaveAt']),_0xeb94('0x57'))||0x0;}}else{_0x330617[_0xeb94('0x42')][_0x455035]['sumDuration']+=_0x330617[_0xeb94('0x42')][_0x455035]['sumHoldTime']||0x0;}}}}}}return _0x330617[_0xeb94('0x42')];};};Realtime[_0xeb94('0x39')][_0xeb94('0x5b')]=function(){var _0x195542=this;return function(_0x1e4a48){clearVoiceCallReports(_0x195542[_0xeb94('0x13')]);if(_0x1e4a48){for(var _0x3ee1d3=0x0;_0x3ee1d3<_0x1e4a48[_0xeb94('0x3f')];_0x3ee1d3+=0x1){_0x195542[_0xeb94('0x13')][_0xeb94('0x26')]+=0x1;_0x195542[_0xeb94('0x13')]['sumDuration']+=_0x1e4a48[_0x3ee1d3][_0xeb94('0x5c')];if(_0x1e4a48[_0x3ee1d3]['disposition']==='ANSWERED'){_0x195542[_0xeb94('0x13')][_0xeb94('0x2b')]+=0x1;_0x195542[_0xeb94('0x13')][_0xeb94('0x2d')]+=_0x1e4a48[_0x3ee1d3]['duration']-_0x1e4a48[_0x3ee1d3]['billableseconds']||0x0;_0x195542[_0xeb94('0x13')][_0xeb94('0x59')]+=_0x1e4a48[_0x3ee1d3]['billableseconds'];}}}return _0x195542['outbound'];};};Realtime[_0xeb94('0x39')][_0xeb94('0x5d')]=function(){var _0x1eb71b=this;return function(_0x2e94fc){if(_0x2e94fc){freeIsNotKey(_0x2e94fc,_0x1eb71b[_0xeb94('0x11')],_0xeb94('0x22'));for(var _0x31f748=0x0,_0x31904b={};_0x31f748<_0x2e94fc[_0xeb94('0x3f')];_0x31f748+=0x1){_0x31904b=_0x2e94fc[_0x31f748];if(_[_0xeb94('0x3c')](_0x1eb71b[_0xeb94('0x11')][_0x31904b[_0xeb94('0x22')]])){_0x1eb71b['campaigns'][_0x31904b['name']]=new Campaign(_0x31904b);}else{_0x1eb71b[_0xeb94('0x3d')](_0x1eb71b[_0xeb94('0x11')][_0x31904b[_0xeb94('0x22')]],_0x31904b);_0x1eb71b['campaigns'][_0x31904b[_0xeb94('0x22')]][_0xeb94('0x5e')]=_0x31904b[_0xeb94('0x5f')]?_0x31904b[_0xeb94('0x5f')][_0xeb94('0x22')]:undefined;}}}return _0x1eb71b[_0xeb94('0x11')];};};Realtime[_0xeb94('0x39')][_0xeb94('0x60')]=function(){var _0x2c4e75=this;return function(_0x516b76){if(_0x516b76){freeIsNotKey(_0x516b76,_0x2c4e75[_0xeb94('0x14')],'id');for(var _0x6680b0=0x0,_0x54ec61={};_0x6680b0<_0x516b76[_0xeb94('0x3f')];_0x6680b0+=0x1){_0x54ec61=_0x516b76[_0x6680b0];if(_['isUndefined'](_0x2c4e75[_0xeb94('0x14')][_0x54ec61['id']])){_0x2c4e75['voiceExtensions'][_0x54ec61['id']]=new VoiceExtension(_0x54ec61);}else{_0x2c4e75[_0xeb94('0x3d')](_0x2c4e75[_0xeb94('0x14')][_0x54ec61['id']],_0x54ec61);}}}return _0x2c4e75[_0xeb94('0x14')];};};Realtime[_0xeb94('0x39')]['initCampaignHopperHistory']=function(){var _0x3734fa=this;return function(_0x4db9ad){clearCampaigns(_0x3734fa[_0xeb94('0x11')]);for(var _0x234677=0x0;_0x234677<_0x4db9ad['length'];_0x234677+=0x1){_[_0xeb94('0x61')](_0x3734fa['campaigns'][_0x4db9ad[_0x234677]['name']],_0x4db9ad[_0x234677]);}return _0x3734fa[_0xeb94('0x11')];};};Realtime[_0xeb94('0x39')]['initFaxAccounts']=function(){var _0x3a4cc6=this;return function(_0x43b35a){if(_0x43b35a){freeIsNotKey(_0x43b35a,_0x3a4cc6[_0xeb94('0x62')],'id');for(var _0x2f5eb2=0x0,_0x26375f={},_0x3e1b25={};_0x2f5eb2<_0x43b35a['length'];_0x2f5eb2+=0x1){_0x26375f=_0x43b35a[_0x2f5eb2];if(_[_0xeb94('0x3c')](_0x3a4cc6[_0xeb94('0x62')][_0x26375f['id']])){_0x3a4cc6[_0xeb94('0x62')][_0x26375f['id']]=new FaxAccount(_0x26375f);}else{_0x3a4cc6[_0xeb94('0x3d')](_0x3a4cc6[_0xeb94('0x62')][_0x26375f['id']],_0x26375f);}}}return _0x3a4cc6[_0xeb94('0x62')];};};module[_0xeb94('0x63')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index d894e4f..4f9f98c 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 _0xe64b=['forEach','Local','indexOf','mobile','phone','lastIndexOf','transfererlinkedid','moment','util','../ami','../rpc/voiceCallReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceDialReport','./userReport','realtime','agents','telephones','sync','xdr','voiceQueueReport','voiceCallReport','bind','voiceAgentReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','findAgent','find','accountcode','isNil','interface','format','SIP/%s','name','prototype','length','connectedlinenum','lastAssignedTo','queuecallercomplete','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','destination','exten','type','dialer','lastapplication','queue','context','from-voip-provider','from-sip','originatecalleridnum','destinationchannel','channel','callerid','calleridpreview','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridnum','transfereelinkedid','uniqueid','transfers','linkedid','monitors','monitorFilename','createdAt','calleridname','connectedlinename','membername','isArray'];(function(_0x515aca,_0x27752a){var _0x2161a9=function(_0x486dab){while(--_0x486dab){_0x515aca['push'](_0x515aca['shift']());}};_0x2161a9(++_0x27752a);}(_0xe64b,0xa5));var _0xbe64=function(_0x1777e2,_0x44fd96){_0x1777e2=_0x1777e2-0x0;var _0x55c1a6=_0xe64b[_0x1777e2];return _0x55c1a6;};'use strict';var _=require('lodash');var moment=require(_0xbe64('0x0'));var util=require(_0xbe64('0x1'));var config=require('../../../config/environment');var ami=require(_0xbe64('0x2'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0xbe64('0x3'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0xbe64('0x4'));var RpcVoiceQueueReport=require(_0xbe64('0x5'));var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require(_0xbe64('0x6'));var VoiceQueueReport=require(_0xbe64('0x7'));var VoiceCallReport=require(_0xbe64('0x8'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require(_0xbe64('0x9'));var UserReport=require(_0xbe64('0xa'));function Report(_0x41403d){this[_0xbe64('0xb')]=_0x41403d;this[_0xbe64('0xc')]=_0x41403d[_0xbe64('0xc')];this[_0xbe64('0xd')]=_0x41403d[_0xbe64('0xd')];}Report['prototype'][_0xbe64('0xe')]=function(_0x2b8a66){var _0x557d95=new VoiceQueueReport(this[_0xbe64('0xb')]);var _0x570b6f=new VoiceAgentReport(this['realtime']);var _0x107e47=new VoiceDialReport(this[_0xbe64('0xb')]);var _0x21a01a=new VoiceCallReport(this[_0xbe64('0xb')]);var _0x49d72d=new UserReport(this['realtime']);if(config['xdr']&&config[_0xbe64('0xf')]['disabled']){ami['on']('custom:voiceQueueReport',this[_0xbe64('0x10')]['bind'](this));ami['on']('custom:voiceCallReport',this[_0xbe64('0x11')][_0xbe64('0x12')](this));ami['on']('custom:voiceAgentReport',this[_0xbe64('0x13')]['bind'](this));ami['on']('custom:voiceDialReport',this[_0xbe64('0x14')][_0xbe64('0x12')](this));ami['on'](_0xbe64('0x15'),this[_0xbe64('0x16')][_0xbe64('0x12')](this));ami['on'](_0xbe64('0x17'),this[_0xbe64('0x18')][_0xbe64('0x12')](this));}};Report['prototype'][_0xbe64('0x19')]=function(_0xcb5bcb){var _0x3cd96a;_0x3cd96a=_[_0xbe64('0x1a')](this[_0xbe64('0xc')],function(_0x365e4c){return _0x365e4c[_0xbe64('0x1b')]==_0xcb5bcb||_0x365e4c['name']==_0xcb5bcb;});if(_[_0xbe64('0x1c')](_0x3cd96a)){var _0x1319be=_[_0xbe64('0x1a')](this[_0xbe64('0xd')],function(_0x4deec2){return _0x4deec2['accountcode']==_0xcb5bcb||_0x4deec2['name']==_0xcb5bcb;});if(_0x1319be){_0x3cd96a=_[_0xbe64('0x1a')](this[_0xbe64('0xc')],function(_0x320d6a){return _0x320d6a[_0xbe64('0x1d')]==util[_0xbe64('0x1e')](_0xbe64('0x1f'),_0x1319be[_0xbe64('0x20')]);});}}return _0x3cd96a;};Report[_0xbe64('0x21')][_0xbe64('0x10')]=function(_0x10ecd2){for(var _0x48d30e=0x0;_0x48d30e<_0x10ecd2[_0xbe64('0x22')];_0x48d30e+=0x1){var _0x185603=this[_0xbe64('0x19')](_0x10ecd2[_0x48d30e][_0xbe64('0x23')]);if(_0x185603){_0x10ecd2[_0x48d30e][_0xbe64('0x1b')]=_0x185603[_0xbe64('0x1b')];_0x10ecd2[_0x48d30e]['assigned']=!![];_0x10ecd2[_0x48d30e][_0xbe64('0x24')]=_0x185603[_0xbe64('0x20')];_0x10ecd2[_0x48d30e][_0xbe64('0x1d')]=_[_0xbe64('0x1c')](_0x185603[_0xbe64('0x1d')])?util['format'](_0xbe64('0x1f'),_0x185603['name']):_0x185603[_0xbe64('0x1d')];if(_0x10ecd2[_0x48d30e][_0xbe64('0x25')]){_0x10ecd2[_0x48d30e]['queuecallercompleteAt']=moment()[_0xbe64('0x1e')](_0xbe64('0x26'));}if(_0x10ecd2[_0x48d30e][_0xbe64('0x27')]){_0x10ecd2[_0x48d30e][_0xbe64('0x28')]=moment()[_0xbe64('0x1e')](_0xbe64('0x26'));}RpcMemberReport['voiceQueueReport'](_0x10ecd2[_0x48d30e]);}RpcVoiceQueueReport[_0xbe64('0x29')](_0x10ecd2[_0x48d30e]);}};function extractCalleridNumber(_0x2ba84d){var _0x3796b1=_0x2ba84d[_0xbe64('0x2a')](/<(.*?)>/);return _0x3796b1?_0x3796b1[0x1]:_0x2ba84d;}Report['prototype']['voiceCallReport']=function(_0x129415){_0x129415[_0xbe64('0x2b')]=_0x129415['destination']||_0x129415[_0xbe64('0x2c')];if(_0x129415[_0xbe64('0x2d')]==_0xbe64('0x2e')){_0x129415[_0xbe64('0x2f')]=_0xbe64('0x30');_0x129415['lastdata']=_0x129415['queue'];if(_0x129415[_0xbe64('0x31')]==_0xbe64('0x32')){_0x129415[_0xbe64('0x1b')]='';_0x129415['destination']=extractCalleridNumber(_0x129415['callerid']);}else if(_0x129415[_0xbe64('0x31')]==_0xbe64('0x33')){if(_0x129415[_0xbe64('0x2b')]=='xcally-motion-preview'){_0x129415['destination']=extractCalleridNumber(_0x129415['calleridpreview']);_0x129415['calleridnum']=_0x129415[_0xbe64('0x34')];_0x129415[_0xbe64('0x35')]=[_0x129415[_0xbe64('0x36')],_0x129415[_0xbe64('0x36')]=_0x129415[_0xbe64('0x35')]][0x0];_0x129415[_0xbe64('0x37')]=_0x129415[_0xbe64('0x38')];}else{_0x129415[_0xbe64('0x2b')]=_0x129415['calleridnum'];_0x129415['calleridnum']=_0x129415[_0xbe64('0x34')];if(_0x129415[_0xbe64('0x39')]==_0xbe64('0x3a')){_0x129415[_0xbe64('0x1b')]=_0x129415[_0xbe64('0x23')];}else{_0x129415['accountcode']='';}}}}else{_0x129415[_0xbe64('0x37')]=util[_0xbe64('0x1e')](_0xbe64('0x3b'),_0x129415['calleridname'],_0x129415[_0xbe64('0x3c')]);}if(RpcVoiceTransferReport['transfers'][_0x129415['linkedid']]){var _0x5a19cd=RpcVoiceTransferReport['transfers'][_0x129415['linkedid']];_0x5a19cd[_0xbe64('0x3d')]=_0x129415[_0xbe64('0x3e')];RpcVoiceTransferReport[_0xbe64('0x16')](_0x5a19cd);delete RpcVoiceTransferReport[_0xbe64('0x3f')][_0x129415[_0xbe64('0x40')]];}RpcVoiceCallReport[_0xbe64('0x29')](_0x129415);if(_0x129415['monitor']){for(var _0x1fceff=0x0;_0x1fceff<_0x129415[_0xbe64('0x41')][_0xbe64('0x22')];_0x1fceff+=0x1){_0x129415[_0xbe64('0x42')]=_0x129415['monitors'][_0x1fceff]['filename'];_0x129415[_0xbe64('0x43')]=_0x129415['monitors'][_0x1fceff][_0xbe64('0x43')];if(_0x129415['exten']=='xcally-motion-preview'){_0x129415['calleridnum']=_0x129415[_0xbe64('0x23')];_0x129415[_0xbe64('0x44')]=_0x129415[_0xbe64('0x45')];_0x129415['connectedlinenum']=_0x129415[_0xbe64('0x1b')];_0x129415[_0xbe64('0x45')]=_0x129415[_0xbe64('0x46')];_0x129415[_0xbe64('0x2c')]=_0x129415[_0xbe64('0x34')];}else if(_0x129415['exten']=='xcally-motion-dialer'){_0x129415[_0xbe64('0x3c')]=_0x129415[_0xbe64('0x2b')];_0x129415[_0xbe64('0x2c')]=_0x129415['originatecalleridnum'];}RpcVoiceRecording[_0xbe64('0x29')](_0x129415);}}};Report[_0xbe64('0x21')]['voiceAgentReport']=function(_0x31306d){if(_[_0xbe64('0x47')](_0x31306d)){_0x31306d[_0xbe64('0x48')](function(_0x4099fa){RpcVoiceAgentReport[_0xbe64('0x29')](_0x4099fa);});}else{RpcVoiceAgentReport[_0xbe64('0x29')](_0x31306d);}};Report[_0xbe64('0x21')][_0xbe64('0x14')]=function(_0x1490b5){RpcVoiceDialReport[_0xbe64('0x29')](_0x1490b5);var _0x3727bf;var _0x547833;var _0x322346=_0x1490b5['channel'];if(_['startsWith'](_0x322346,_0xbe64('0x49'))){_0x547833=_0x322346['substring'](_0x322346[_0xbe64('0x4a')]('/')+0x1,_0x322346[_0xbe64('0x4a')]('@'));_0x3727bf=_[_0xbe64('0x1a')](this['agents'],function(_0x2ed655){return _0x2ed655[_0xbe64('0x4b')]==_0x547833||_0x2ed655[_0xbe64('0x4c')]==_0x547833||_0x2ed655[_0xbe64('0x1b')]==_0x547833;});}else{_0x547833=_0x322346['substring'](_0x322346['indexOf']('/')+0x1,_0x322346[_0xbe64('0x4d')]('-'));_0x3727bf=this[_0xbe64('0x19')](_0x547833);}if(_0x3727bf){_0x1490b5[_0xbe64('0x1d')]=_['isNil'](_0x3727bf['interface'])?util[_0xbe64('0x1e')](_0xbe64('0x1f'),_0x3727bf[_0xbe64('0x20')]):_0x3727bf['interface'];_0x1490b5['membername']=_0x3727bf['name'];_0x1490b5[_0xbe64('0x1b')]=_0x3727bf['accountcode'];RpcMemberReport[_0xbe64('0x14')](_0x1490b5);}};Report['prototype'][_0xbe64('0x16')]=function(_0x15af79){RpcVoiceTransferReport[_0xbe64('0x3f')][_0x15af79[_0xbe64('0x4e')]]=_0x15af79;};Report[_0xbe64('0x21')][_0xbe64('0x18')]=function(_0x6572c6){RpcVoiceTransferReport[_0xbe64('0x18')](_0x6572c6);};module['exports']=Report; \ No newline at end of file +var _0x73a3=['telephones','prototype','xdr','custom:voiceQueueReport','voiceQueueReport','bind','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindTransfer','attendedtransfer','findAgent','find','accountcode','name','isNil','interface','format','SIP/%s','length','connectedlinenum','assigned','lastAssignedTo','queuecallercomplete','queuecallercompleteAt','queuecallerexitAt','YYYY-MM-DD\x20HH:mm:ss','match','destination','type','lastapplication','queue','lastdata','context','from-voip-provider','callerid','xcally-motion-preview','destinationchannel','calleridpreview','calleridnum','originatecalleridnum','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','create','monitors','monitorFilename','createdAt','connectedlinename','membername','exten','xcally-motion-dialer','channel','startsWith','Local','indexOf','mobile','substring','lastIndexOf','transfererlinkedid','attendedTransfer','exports','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','realtime','agents'];(function(_0x77c96f,_0xb7b3ed){var _0x4355e9=function(_0x3a272f){while(--_0x3a272f){_0x77c96f['push'](_0x77c96f['shift']());}};_0x4355e9(++_0xb7b3ed);}(_0x73a3,0x144));var _0x373a=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x73a3[_0x40220a];return _0x3903cc;};'use strict';var _=require(_0x373a('0x0'));var moment=require(_0x373a('0x1'));var util=require(_0x373a('0x2'));var config=require(_0x373a('0x3'));var ami=require(_0x373a('0x4'));var RpcVoiceAgentReport=require(_0x373a('0x5'));var RpcVoiceCallReport=require(_0x373a('0x6'));var RpcVoiceDialReport=require(_0x373a('0x7'));var RpcMemberReport=require(_0x373a('0x8'));var RpcVoiceQueueReport=require(_0x373a('0x9'));var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0x373a('0xa'));var VoiceCallReport=require(_0x373a('0xb'));var VoiceAgentReport=require(_0x373a('0xc'));var VoiceDialReport=require(_0x373a('0xd'));var UserReport=require('./userReport');function Report(_0x21fdfc){this[_0x373a('0xe')]=_0x21fdfc;this[_0x373a('0xf')]=_0x21fdfc['agents'];this[_0x373a('0x10')]=_0x21fdfc[_0x373a('0x10')];}Report[_0x373a('0x11')]['sync']=function(_0x5ad161){var _0x4c7fcb=new VoiceQueueReport(this[_0x373a('0xe')]);var _0x42233d=new VoiceAgentReport(this['realtime']);var _0x44961a=new VoiceDialReport(this[_0x373a('0xe')]);var _0x58167b=new VoiceCallReport(this['realtime']);var _0x1fcdb6=new UserReport(this[_0x373a('0xe')]);if(config[_0x373a('0x12')]&&config[_0x373a('0x12')]['disabled']){ami['on'](_0x373a('0x13'),this[_0x373a('0x14')][_0x373a('0x15')](this));ami['on']('custom:voiceCallReport',this[_0x373a('0x16')]['bind'](this));ami['on'](_0x373a('0x17'),this[_0x373a('0x18')][_0x373a('0x15')](this));ami['on'](_0x373a('0x19'),this[_0x373a('0x1a')][_0x373a('0x15')](this));ami['on']('blindtransfer',this[_0x373a('0x1b')][_0x373a('0x15')](this));ami['on'](_0x373a('0x1c'),this['attendedTransfer'][_0x373a('0x15')](this));}};Report[_0x373a('0x11')][_0x373a('0x1d')]=function(_0x20bba8){var _0x60c2aa;_0x60c2aa=_[_0x373a('0x1e')](this[_0x373a('0xf')],function(_0x4eb289){return _0x4eb289[_0x373a('0x1f')]==_0x20bba8||_0x4eb289[_0x373a('0x20')]==_0x20bba8;});if(_[_0x373a('0x21')](_0x60c2aa)){var _0x11ae60=_['find'](this[_0x373a('0x10')],function(_0x8e4add){return _0x8e4add[_0x373a('0x1f')]==_0x20bba8||_0x8e4add[_0x373a('0x20')]==_0x20bba8;});if(_0x11ae60){_0x60c2aa=_[_0x373a('0x1e')](this[_0x373a('0xf')],function(_0x261c1f){return _0x261c1f[_0x373a('0x22')]==util[_0x373a('0x23')](_0x373a('0x24'),_0x11ae60[_0x373a('0x20')]);});}}return _0x60c2aa;};Report[_0x373a('0x11')][_0x373a('0x14')]=function(_0x283737){for(var _0x17fdb0=0x0;_0x17fdb0<_0x283737[_0x373a('0x25')];_0x17fdb0+=0x1){var _0xcea143=this[_0x373a('0x1d')](_0x283737[_0x17fdb0][_0x373a('0x26')]);if(_0xcea143){_0x283737[_0x17fdb0]['accountcode']=_0xcea143[_0x373a('0x1f')];_0x283737[_0x17fdb0][_0x373a('0x27')]=!![];_0x283737[_0x17fdb0][_0x373a('0x28')]=_0xcea143[_0x373a('0x20')];_0x283737[_0x17fdb0][_0x373a('0x22')]=_[_0x373a('0x21')](_0xcea143[_0x373a('0x22')])?util[_0x373a('0x23')](_0x373a('0x24'),_0xcea143['name']):_0xcea143[_0x373a('0x22')];if(_0x283737[_0x17fdb0][_0x373a('0x29')]){_0x283737[_0x17fdb0][_0x373a('0x2a')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}if(_0x283737[_0x17fdb0]['queuecallerexit']){_0x283737[_0x17fdb0][_0x373a('0x2b')]=moment()['format'](_0x373a('0x2c'));}RpcMemberReport[_0x373a('0x14')](_0x283737[_0x17fdb0]);}RpcVoiceQueueReport['create'](_0x283737[_0x17fdb0]);}};function extractCalleridNumber(_0x5cc68a){var _0x33d1f9=_0x5cc68a[_0x373a('0x2d')](/<(.*?)>/);return _0x33d1f9?_0x33d1f9[0x1]:_0x5cc68a;}Report[_0x373a('0x11')][_0x373a('0x16')]=function(_0x248089){_0x248089['destination']=_0x248089[_0x373a('0x2e')]||_0x248089['exten'];if(_0x248089[_0x373a('0x2f')]=='dialer'){_0x248089[_0x373a('0x30')]=_0x373a('0x31');_0x248089[_0x373a('0x32')]=_0x248089[_0x373a('0x31')];if(_0x248089[_0x373a('0x33')]==_0x373a('0x34')){_0x248089[_0x373a('0x1f')]='';_0x248089[_0x373a('0x2e')]=extractCalleridNumber(_0x248089[_0x373a('0x35')]);}else if(_0x248089[_0x373a('0x33')]=='from-sip'){if(_0x248089[_0x373a('0x2e')]==_0x373a('0x36')){_0x248089[_0x373a('0x2e')]=extractCalleridNumber(_0x248089['calleridpreview']);_0x248089['calleridnum']=_0x248089['originatecalleridnum'];_0x248089[_0x373a('0x37')]=[_0x248089['channel'],_0x248089['channel']=_0x248089['destinationchannel']][0x0];_0x248089[_0x373a('0x35')]=_0x248089[_0x373a('0x38')];}else{_0x248089[_0x373a('0x2e')]=_0x248089[_0x373a('0x39')];_0x248089[_0x373a('0x39')]=_0x248089[_0x373a('0x3a')];if(_0x248089[_0x373a('0x3b')]==_0x373a('0x3c')){_0x248089[_0x373a('0x1f')]=_0x248089[_0x373a('0x26')];}else{_0x248089[_0x373a('0x1f')]='';}}}}else{_0x248089[_0x373a('0x35')]=util[_0x373a('0x23')](_0x373a('0x3d'),_0x248089[_0x373a('0x3e')],_0x248089['calleridnum']);}if(RpcVoiceTransferReport[_0x373a('0x3f')][_0x248089[_0x373a('0x40')]]){var _0x1c0281=RpcVoiceTransferReport[_0x373a('0x3f')][_0x248089[_0x373a('0x40')]];_0x1c0281[_0x373a('0x41')]=_0x248089[_0x373a('0x42')];RpcVoiceTransferReport['blindTransfer'](_0x1c0281);delete RpcVoiceTransferReport['transfers'][_0x248089[_0x373a('0x40')]];}RpcVoiceCallReport[_0x373a('0x43')](_0x248089);if(_0x248089['monitor']){for(var _0x2bd58b=0x0;_0x2bd58b<_0x248089[_0x373a('0x44')][_0x373a('0x25')];_0x2bd58b+=0x1){_0x248089[_0x373a('0x45')]=_0x248089[_0x373a('0x44')][_0x2bd58b]['filename'];_0x248089[_0x373a('0x46')]=_0x248089[_0x373a('0x44')][_0x2bd58b][_0x373a('0x46')];if(_0x248089['exten']==_0x373a('0x36')){_0x248089[_0x373a('0x39')]=_0x248089[_0x373a('0x26')];_0x248089[_0x373a('0x3e')]=_0x248089[_0x373a('0x47')];_0x248089[_0x373a('0x26')]=_0x248089[_0x373a('0x1f')];_0x248089[_0x373a('0x47')]=_0x248089[_0x373a('0x48')];_0x248089[_0x373a('0x49')]=_0x248089[_0x373a('0x3a')];}else if(_0x248089[_0x373a('0x49')]==_0x373a('0x4a')){_0x248089[_0x373a('0x39')]=_0x248089[_0x373a('0x2e')];_0x248089['exten']=_0x248089[_0x373a('0x3a')];}RpcVoiceRecording['create'](_0x248089);}}};Report[_0x373a('0x11')][_0x373a('0x18')]=function(_0x4bc129){if(_['isArray'](_0x4bc129)){_0x4bc129['forEach'](function(_0x1c6a59){RpcVoiceAgentReport['create'](_0x1c6a59);});}else{RpcVoiceAgentReport['create'](_0x4bc129);}};Report[_0x373a('0x11')][_0x373a('0x1a')]=function(_0x3bbb6e){RpcVoiceDialReport[_0x373a('0x43')](_0x3bbb6e);var _0x3cb268;var _0x2a914a;var _0xb35f1f=_0x3bbb6e[_0x373a('0x4b')];if(_[_0x373a('0x4c')](_0xb35f1f,_0x373a('0x4d'))){_0x2a914a=_0xb35f1f['substring'](_0xb35f1f['indexOf']('/')+0x1,_0xb35f1f[_0x373a('0x4e')]('@'));_0x3cb268=_['find'](this[_0x373a('0xf')],function(_0x4436bc){return _0x4436bc[_0x373a('0x4f')]==_0x2a914a||_0x4436bc['phone']==_0x2a914a||_0x4436bc[_0x373a('0x1f')]==_0x2a914a;});}else{_0x2a914a=_0xb35f1f[_0x373a('0x50')](_0xb35f1f[_0x373a('0x4e')]('/')+0x1,_0xb35f1f[_0x373a('0x51')]('-'));_0x3cb268=this[_0x373a('0x1d')](_0x2a914a);}if(_0x3cb268){_0x3bbb6e[_0x373a('0x22')]=_['isNil'](_0x3cb268[_0x373a('0x22')])?util[_0x373a('0x23')]('SIP/%s',_0x3cb268['name']):_0x3cb268[_0x373a('0x22')];_0x3bbb6e['membername']=_0x3cb268[_0x373a('0x20')];_0x3bbb6e[_0x373a('0x1f')]=_0x3cb268[_0x373a('0x1f')];RpcMemberReport[_0x373a('0x1a')](_0x3bbb6e);}};Report['prototype'][_0x373a('0x1b')]=function(_0x57eeb9){RpcVoiceTransferReport['transfers'][_0x57eeb9[_0x373a('0x52')]]=_0x57eeb9;};Report[_0x373a('0x11')][_0x373a('0x53')]=function(_0x47706e){RpcVoiceTransferReport[_0x373a('0x53')](_0x47706e);};module[_0x373a('0x54')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index 77ea3a6..3cec611 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 _0x6a9c=['accountcode','peer','address','[userReport][peerstatus]','registered','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','lodash','moment','bluebird','../../../config/environment','../../../config/logger','ami','redis','defaults','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','bind','syncDeviceState','peerstatus','syncPeerStatus','syncRealtimeShow','resolve','then','actionSipShowRegistry','catch','[userReport][sipshowregistry]','inspect','actionDeviceStateList','error','[userReport][devicestatelist]','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','isUndefined','emit','isNotNull','info','[userReport][registry]\x20registry:%s\x20state:%s','username','state','debug','[userReport][registry]','find','stateRegistry','event','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','name','trunk:save','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','local','toLowerCase','inuse','toNumber','stateTime','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','trunk:%s','Local','indexOf','mobile','phone'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x6a9c,0x128));var _0xc6a9=function(_0xb41bcd,_0x3b0a25){_0xb41bcd=_0xb41bcd-0x0;var _0x5ba0dd=_0x6a9c[_0xb41bcd];return _0x5ba0dd;};'use strict';var _=require(_0xc6a9('0x0'));var moment=require(_0xc6a9('0x1'));var util=require('util');var Redis=require('ioredis');var BPromise=require(_0xc6a9('0x2'));var config=require(_0xc6a9('0x3'));var logger=require(_0xc6a9('0x4'))(_0xc6a9('0x5'));var ami=require('../ami');config[_0xc6a9('0x6')]=_[_0xc6a9('0x7')](config[_0xc6a9('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xc6a9('0x8'))(new Redis(config['redis']));function UserReport(_0x52f74b){this[_0xc6a9('0x9')]=_0x52f74b[_0xc6a9('0x9')];this[_0xc6a9('0xa')]=_0x52f74b['agents'];this[_0xc6a9('0xb')]=_0x52f74b['telephones'];ami['on'](_0xc6a9('0xc'),this[_0xc6a9('0xd')][_0xc6a9('0xe')](this));ami['on']('registry',this[_0xc6a9('0xd')][_0xc6a9('0xe')](this));ami['on']('devicestatechange',this[_0xc6a9('0xf')][_0xc6a9('0xe')](this));ami['on'](_0xc6a9('0x10'),this[_0xc6a9('0x11')][_0xc6a9('0xe')](this));return this[_0xc6a9('0x12')]();}function showSipRegistrations(){Promise[_0xc6a9('0x13')]()[_0xc6a9('0x14')](ami[_0xc6a9('0x15')]())[_0xc6a9('0x16')](function(_0x5266f9){logger['error'](_0xc6a9('0x17'),util[_0xc6a9('0x18')](_0x5266f9,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise['resolve']()[_0xc6a9('0x14')](ami[_0xc6a9('0x19')]())[_0xc6a9('0x16')](function(_0x1ed37a){logger[_0xc6a9('0x1a')](_0xc6a9('0x1b'),util['inspect'](_0x1ed37a,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0xc6a9('0x13')]()['then'](ami[_0xc6a9('0x1c')]())[_0xc6a9('0x16')](function(_0x32b7b8){logger[_0xc6a9('0x1a')](_0xc6a9('0x1d'),util[_0xc6a9('0x18')](_0x32b7b8,{'showHidden':![],'depth':null}));});}UserReport[_0xc6a9('0x1e')][_0xc6a9('0x12')]=function(){setInterval(function(){BPromise[_0xc6a9('0x13')]()[_0xc6a9('0x14')](showSipRegistrations())[_0xc6a9('0x14')](listDeviceStates())[_0xc6a9('0x14')](showPeersStatus());},0x32c8);};UserReport[_0xc6a9('0x1e')]['isNotNull']=function(_0x4354b7){return _0x4354b7!==null&&!_[_0xc6a9('0x1f')](_0x4354b7);};UserReport[_0xc6a9('0x1e')][_0xc6a9('0x20')]=function(_0x46ff68,_0x279ba3,_0x341244){io['to'](_0x46ff68)[_0xc6a9('0x20')](_0x279ba3,_0x341244);};UserReport[_0xc6a9('0x1e')][_0xc6a9('0xd')]=function(_0x3f0478){try{if(this[_0xc6a9('0x21')](_0x3f0478)){logger[_0xc6a9('0x22')](_0xc6a9('0x23'),_0x3f0478[_0xc6a9('0x24')],_0x3f0478[_0xc6a9('0x25')]);logger[_0xc6a9('0x26')](_0xc6a9('0x27'),util['inspect'](_0x3f0478,{'showHidden':![],'depth':null}));var _0x3af853=_[_0xc6a9('0x28')](this[_0xc6a9('0x9')],{'defaultuser':_0x3f0478['username']});if(_0x3af853){_0x3f0478[_0xc6a9('0x29')]=_0x3f0478[_0xc6a9('0x25')];_['merge'](_0x3af853,_['omit'](_0x3f0478,[_0xc6a9('0x2a'),'actionid',_0xc6a9('0x24'),'state']));logger['debug'](_0xc6a9('0x2b'),util[_0xc6a9('0x18')](_0x3af853,{'showHidden':![],'depth':null}));this['emit'](util[_0xc6a9('0x2c')]('trunk:%s',_0x3af853[_0xc6a9('0x2d')]),_0xc6a9('0x2e'),_0x3af853);}}}catch(_0x19a458){logger['error'](_0xc6a9('0x27'),util[_0xc6a9('0x18')](_0x19a458,{'showHidden':![],'depth':null}));}};UserReport[_0xc6a9('0x1e')][_0xc6a9('0xf')]=function(_0x288ca9){try{if(this[_0xc6a9('0x21')](_0x288ca9)){logger['info'](_0xc6a9('0x2f'),_0x288ca9[_0xc6a9('0x30')],_0x288ca9[_0xc6a9('0x25')]);logger[_0xc6a9('0x26')](_0xc6a9('0x31'),util[_0xc6a9('0x18')](_0x288ca9,{'showHidden':![],'depth':null}));if(this['agents'][_0x288ca9['device']]){if(!this[_0xc6a9('0xa')][_0x288ca9[_0xc6a9('0x30')]][_0xc6a9('0x32')]||_0x288ca9[_0xc6a9('0x25')][_0xc6a9('0x33')]()==_0xc6a9('0x34')){this[_0xc6a9('0xa')][_0x288ca9[_0xc6a9('0x30')]][_0xc6a9('0x32')]=![];if(this[_0xc6a9('0xa')][_0x288ca9['device']][_0xc6a9('0x25')]!==_0x288ca9['state'][_0xc6a9('0x33')]()){this[_0xc6a9('0xa')][_0x288ca9['device']]['stateTime']=_[_0xc6a9('0x35')](moment()[_0xc6a9('0x2c')]('x'));}this[_0xc6a9('0xa')][_0x288ca9[_0xc6a9('0x30')]]['state']=_0x288ca9[_0xc6a9('0x25')]['toLowerCase']();this[_0xc6a9('0xa')][_0x288ca9['device']]['updateStatusRealtime'](_0x288ca9);}}else if(this[_0xc6a9('0xb')][_0x288ca9[_0xc6a9('0x30')]]){if(this[_0xc6a9('0xb')][_0x288ca9[_0xc6a9('0x30')]][_0xc6a9('0x25')]!==_0x288ca9[_0xc6a9('0x25')][_0xc6a9('0x33')]()){this[_0xc6a9('0xb')][_0x288ca9[_0xc6a9('0x30')]][_0xc6a9('0x36')]=_[_0xc6a9('0x35')](moment()[_0xc6a9('0x2c')]('x'));}this['telephones'][_0x288ca9['device']]['state']=_0x288ca9[_0xc6a9('0x25')][_0xc6a9('0x33')]();logger[_0xc6a9('0x26')](_0xc6a9('0x37'),util[_0xc6a9('0x18')](this[_0xc6a9('0xb')][_0x288ca9[_0xc6a9('0x30')]],{'showHidden':![],'depth':null}));this[_0xc6a9('0x20')](util[_0xc6a9('0x2c')](_0xc6a9('0x38'),this['telephones'][_0x288ca9['device']][_0xc6a9('0x2d')]),_0xc6a9('0x39'),this[_0xc6a9('0xb')][_0x288ca9[_0xc6a9('0x30')]]);}else if(this[_0xc6a9('0x9')][_0x288ca9[_0xc6a9('0x30')]]){if(this[_0xc6a9('0x9')][_0x288ca9[_0xc6a9('0x30')]]['state']!==_0x288ca9[_0xc6a9('0x25')][_0xc6a9('0x33')]()){this[_0xc6a9('0x9')][_0x288ca9[_0xc6a9('0x30')]][_0xc6a9('0x36')]=_['toNumber'](moment()['format']('x'));}this[_0xc6a9('0x9')][_0x288ca9['device']][_0xc6a9('0x25')]=_0x288ca9['state']['toLowerCase']();logger['debug'](_0xc6a9('0x3a'),util[_0xc6a9('0x18')](this['trunks'][_0x288ca9[_0xc6a9('0x30')]],{'showHidden':![],'depth':null}));this[_0xc6a9('0x20')](util['format'](_0xc6a9('0x3b'),this['trunks'][_0x288ca9[_0xc6a9('0x30')]][_0xc6a9('0x2d')]),_0xc6a9('0x2e'),this[_0xc6a9('0x9')][_0x288ca9['device']]);}else if(_['startsWith'](_0x288ca9[_0xc6a9('0x30')],_0xc6a9('0x3c'))){var _0x2b7be5=_0x288ca9[_0xc6a9('0x30')];var _0x5cf52f=_0x2b7be5['substring'](_0x2b7be5['indexOf']('/')+0x1,_0x2b7be5[_0xc6a9('0x3d')]('@'));var _0x476122=_[_0xc6a9('0x28')](this[_0xc6a9('0xa')],function(_0x4255c7){return _0x4255c7[_0xc6a9('0x3e')]==_0x5cf52f||_0x4255c7[_0xc6a9('0x3f')]==_0x5cf52f||_0x4255c7[_0xc6a9('0x40')]==_0x5cf52f;});if(_0x476122){if(_0x476122['state']!==_0x288ca9[_0xc6a9('0x25')][_0xc6a9('0x33')]()){_0x476122['stateTime']=_[_0xc6a9('0x35')](moment()[_0xc6a9('0x2c')]('x'));}_0x476122[_0xc6a9('0x25')]=_0x288ca9['state'][_0xc6a9('0x33')]();_0x476122['local']=!![];_0x476122['updateStatusRealtime'](_0x288ca9);}}}}catch(_0x4cb433){logger[_0xc6a9('0x1a')](_0xc6a9('0x31'),util['inspect'](_0x4cb433,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0xc6a9('0x11')]=function(_0x1088e7){try{if(this[_0xc6a9('0x21')](_0x1088e7)&&this[_0xc6a9('0x21')](_0x1088e7[_0xc6a9('0x10')])){logger[_0xc6a9('0x22')]('[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s',_0x1088e7[_0xc6a9('0x41')],_0x1088e7[_0xc6a9('0x42')],_0x1088e7[_0xc6a9('0x10')]);logger['debug'](_0xc6a9('0x43'),util[_0xc6a9('0x18')](_0x1088e7,{'showHidden':![],'depth':null}));if(this['agents'][_0x1088e7['peer']]){if(!this['agents'][_0x1088e7['peer']]['local']||_0x1088e7['peerstatus'][_0xc6a9('0x33')]()==_0xc6a9('0x44')){this[_0xc6a9('0xa')][_0x1088e7[_0xc6a9('0x41')]][_0xc6a9('0x32')]=![];this[_0xc6a9('0xa')][_0x1088e7[_0xc6a9('0x41')]][_0xc6a9('0x45')]=_0x1088e7[_0xc6a9('0x10')][_0xc6a9('0x33')]();this[_0xc6a9('0xa')][_0x1088e7[_0xc6a9('0x41')]]['address']=_0x1088e7[_0xc6a9('0x42')];this['agents'][_0x1088e7['peer']]['updateStatusRealtime'](_0x1088e7);}}else if(this[_0xc6a9('0xb')][_0x1088e7[_0xc6a9('0x41')]]){this[_0xc6a9('0xb')][_0x1088e7[_0xc6a9('0x41')]][_0xc6a9('0x45')]=_0x1088e7['peerstatus'][_0xc6a9('0x33')]();this[_0xc6a9('0xb')][_0x1088e7[_0xc6a9('0x41')]][_0xc6a9('0x42')]=_0x1088e7[_0xc6a9('0x42')];logger['debug'](_0xc6a9('0x46'),util[_0xc6a9('0x18')](this[_0xc6a9('0xb')][_0x1088e7['peer']],{'showHidden':![],'depth':null}));this[_0xc6a9('0x20')](util[_0xc6a9('0x2c')](_0xc6a9('0x38'),this[_0xc6a9('0xb')][_0x1088e7[_0xc6a9('0x41')]]['name']),'telephone:save',this[_0xc6a9('0xb')][_0x1088e7['peer']]);}else if(this[_0xc6a9('0x9')][_0x1088e7[_0xc6a9('0x41')]]){this[_0xc6a9('0x9')][_0x1088e7['peer']]['status']=_0x1088e7[_0xc6a9('0x10')]['toLowerCase']();this[_0xc6a9('0x9')][_0x1088e7['peer']][_0xc6a9('0x42')]=_0x1088e7[_0xc6a9('0x42')];logger['debug'](_0xc6a9('0x47'),util[_0xc6a9('0x18')](this[_0xc6a9('0x9')][_0x1088e7[_0xc6a9('0x41')]],{'showHidden':![],'depth':null}));this[_0xc6a9('0x20')](util[_0xc6a9('0x2c')]('trunk:%s',this['trunks'][_0x1088e7[_0xc6a9('0x41')]][_0xc6a9('0x2d')]),_0xc6a9('0x2e'),this[_0xc6a9('0x9')][_0x1088e7['peer']]);}}}catch(_0x2ae263){logger['error']('[userReport][peerstatus]',util[_0xc6a9('0x18')](_0x2ae263,{'showHidden':![],'depth':null}));}};module['exports']=UserReport; \ No newline at end of file +var _0x6de8=['actionDeviceStateList','[userReport][devicestatelist]','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','syncRealtimeShow','isUndefined','emit','isNotNull','info','state','debug','find','username','stateRegistry','omit','event','actionid','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','trunk:%s','name','[userReport][registry]','syncDeviceState','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','local','toLowerCase','inuse','stateTime','toNumber','updateStatusRealtime','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','telephone:save','trunk:save','Local','substring','indexOf','phone','accountcode','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','address','[userReport][peerstatus]','peer','registered','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','lodash','ioredis','../../../config/environment','ami','../ami','redis','defaults','trunks','agents','telephones','registryentry','syncRegistry','registry','bind','devicestatechange','peerstatus','syncPeerStatus','resolve','actionSipShowRegistry','catch','error','[userReport][sipshowregistry]','inspect','then'];(function(_0x424357,_0x9ebe3e){var _0x29c68e=function(_0x663b5d){while(--_0x663b5d){_0x424357['push'](_0x424357['shift']());}};_0x29c68e(++_0x9ebe3e);}(_0x6de8,0x15f));var _0x86de=function(_0xf6e75d,_0xc70967){_0xf6e75d=_0xf6e75d-0x0;var _0x27514d=_0x6de8[_0xf6e75d];return _0x27514d;};'use strict';var _=require(_0x86de('0x0'));var moment=require('moment');var util=require('util');var Redis=require(_0x86de('0x1'));var BPromise=require('bluebird');var config=require(_0x86de('0x2'));var logger=require('../../../config/logger')(_0x86de('0x3'));var ami=require(_0x86de('0x4'));config[_0x86de('0x5')]=_[_0x86de('0x6')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function UserReport(_0x5b646c){this['trunks']=_0x5b646c[_0x86de('0x7')];this[_0x86de('0x8')]=_0x5b646c['agents'];this['telephones']=_0x5b646c[_0x86de('0x9')];ami['on'](_0x86de('0xa'),this[_0x86de('0xb')]['bind'](this));ami['on'](_0x86de('0xc'),this[_0x86de('0xb')][_0x86de('0xd')](this));ami['on'](_0x86de('0xe'),this['syncDeviceState'][_0x86de('0xd')](this));ami['on'](_0x86de('0xf'),this[_0x86de('0x10')]['bind'](this));return this['syncRealtimeShow']();}function showSipRegistrations(){Promise[_0x86de('0x11')]()['then'](ami[_0x86de('0x12')]())[_0x86de('0x13')](function(_0x1dd6cb){logger[_0x86de('0x14')](_0x86de('0x15'),util[_0x86de('0x16')](_0x1dd6cb,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise['resolve']()[_0x86de('0x17')](ami[_0x86de('0x18')]())[_0x86de('0x13')](function(_0x3ea09a){logger[_0x86de('0x14')](_0x86de('0x19'),util[_0x86de('0x16')](_0x3ea09a,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x86de('0x11')]()['then'](ami[_0x86de('0x1a')]())[_0x86de('0x13')](function(_0x3064a7){logger[_0x86de('0x14')](_0x86de('0x1b'),util[_0x86de('0x16')](_0x3064a7,{'showHidden':![],'depth':null}));});}UserReport[_0x86de('0x1c')][_0x86de('0x1d')]=function(){setInterval(function(){BPromise[_0x86de('0x11')]()[_0x86de('0x17')](showSipRegistrations())[_0x86de('0x17')](listDeviceStates())[_0x86de('0x17')](showPeersStatus());},0x32c8);};UserReport[_0x86de('0x1c')]['isNotNull']=function(_0x24729d){return _0x24729d!==null&&!_[_0x86de('0x1e')](_0x24729d);};UserReport['prototype'][_0x86de('0x1f')]=function(_0x272613,_0x5904ab,_0x1b8dd0){io['to'](_0x272613)[_0x86de('0x1f')](_0x5904ab,_0x1b8dd0);};UserReport[_0x86de('0x1c')][_0x86de('0xb')]=function(_0x425cb8){try{if(this[_0x86de('0x20')](_0x425cb8)){logger[_0x86de('0x21')]('[userReport][registry]\x20registry:%s\x20state:%s',_0x425cb8['username'],_0x425cb8[_0x86de('0x22')]);logger[_0x86de('0x23')]('[userReport][registry]',util[_0x86de('0x16')](_0x425cb8,{'showHidden':![],'depth':null}));var _0xe7ad1b=_[_0x86de('0x24')](this[_0x86de('0x7')],{'defaultuser':_0x425cb8[_0x86de('0x25')]});if(_0xe7ad1b){_0x425cb8[_0x86de('0x26')]=_0x425cb8['state'];_['merge'](_0xe7ad1b,_[_0x86de('0x27')](_0x425cb8,[_0x86de('0x28'),_0x86de('0x29'),_0x86de('0x25'),_0x86de('0x22')]));logger[_0x86de('0x23')](_0x86de('0x2a'),util[_0x86de('0x16')](_0xe7ad1b,{'showHidden':![],'depth':null}));this[_0x86de('0x1f')](util[_0x86de('0x2b')](_0x86de('0x2c'),_0xe7ad1b[_0x86de('0x2d')]),'trunk:save',_0xe7ad1b);}}}catch(_0x12d951){logger[_0x86de('0x14')](_0x86de('0x2e'),util[_0x86de('0x16')](_0x12d951,{'showHidden':![],'depth':null}));}};UserReport[_0x86de('0x1c')][_0x86de('0x2f')]=function(_0x17c3a9){try{if(this[_0x86de('0x20')](_0x17c3a9)){logger[_0x86de('0x21')](_0x86de('0x30'),_0x17c3a9[_0x86de('0x31')],_0x17c3a9['state']);logger[_0x86de('0x23')](_0x86de('0x32'),util[_0x86de('0x16')](_0x17c3a9,{'showHidden':![],'depth':null}));if(this['agents'][_0x17c3a9['device']]){if(!this[_0x86de('0x8')][_0x17c3a9[_0x86de('0x31')]][_0x86de('0x33')]||_0x17c3a9[_0x86de('0x22')][_0x86de('0x34')]()==_0x86de('0x35')){this[_0x86de('0x8')][_0x17c3a9[_0x86de('0x31')]]['local']=![];if(this[_0x86de('0x8')][_0x17c3a9['device']]['state']!==_0x17c3a9[_0x86de('0x22')]['toLowerCase']()){this[_0x86de('0x8')][_0x17c3a9[_0x86de('0x31')]][_0x86de('0x36')]=_[_0x86de('0x37')](moment()[_0x86de('0x2b')]('x'));}this[_0x86de('0x8')][_0x17c3a9[_0x86de('0x31')]][_0x86de('0x22')]=_0x17c3a9[_0x86de('0x22')][_0x86de('0x34')]();this[_0x86de('0x8')][_0x17c3a9['device']][_0x86de('0x38')](_0x17c3a9);}}else if(this[_0x86de('0x9')][_0x17c3a9[_0x86de('0x31')]]){if(this[_0x86de('0x9')][_0x17c3a9[_0x86de('0x31')]][_0x86de('0x22')]!==_0x17c3a9[_0x86de('0x22')]['toLowerCase']()){this[_0x86de('0x9')][_0x17c3a9[_0x86de('0x31')]][_0x86de('0x36')]=_['toNumber'](moment()['format']('x'));}this[_0x86de('0x9')][_0x17c3a9[_0x86de('0x31')]][_0x86de('0x22')]=_0x17c3a9[_0x86de('0x22')]['toLowerCase']();logger[_0x86de('0x23')](_0x86de('0x39'),util['inspect'](this[_0x86de('0x9')][_0x17c3a9[_0x86de('0x31')]],{'showHidden':![],'depth':null}));this[_0x86de('0x1f')](util['format'](_0x86de('0x3a'),this[_0x86de('0x9')][_0x17c3a9['device']][_0x86de('0x2d')]),_0x86de('0x3b'),this[_0x86de('0x9')][_0x17c3a9[_0x86de('0x31')]]);}else if(this[_0x86de('0x7')][_0x17c3a9[_0x86de('0x31')]]){if(this[_0x86de('0x7')][_0x17c3a9[_0x86de('0x31')]][_0x86de('0x22')]!==_0x17c3a9[_0x86de('0x22')][_0x86de('0x34')]()){this[_0x86de('0x7')][_0x17c3a9[_0x86de('0x31')]][_0x86de('0x36')]=_[_0x86de('0x37')](moment()[_0x86de('0x2b')]('x'));}this[_0x86de('0x7')][_0x17c3a9['device']][_0x86de('0x22')]=_0x17c3a9[_0x86de('0x22')][_0x86de('0x34')]();logger[_0x86de('0x23')]('[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:',util['inspect'](this[_0x86de('0x7')][_0x17c3a9[_0x86de('0x31')]],{'showHidden':![],'depth':null}));this['emit'](util['format'](_0x86de('0x2c'),this[_0x86de('0x7')][_0x17c3a9[_0x86de('0x31')]][_0x86de('0x2d')]),_0x86de('0x3c'),this[_0x86de('0x7')][_0x17c3a9[_0x86de('0x31')]]);}else if(_['startsWith'](_0x17c3a9[_0x86de('0x31')],_0x86de('0x3d'))){var _0x1e3a47=_0x17c3a9[_0x86de('0x31')];var _0x466c58=_0x1e3a47[_0x86de('0x3e')](_0x1e3a47['indexOf']('/')+0x1,_0x1e3a47[_0x86de('0x3f')]('@'));var _0x43c22b=_[_0x86de('0x24')](this['agents'],function(_0x164d6d){return _0x164d6d['mobile']==_0x466c58||_0x164d6d[_0x86de('0x40')]==_0x466c58||_0x164d6d[_0x86de('0x41')]==_0x466c58;});if(_0x43c22b){if(_0x43c22b[_0x86de('0x22')]!==_0x17c3a9[_0x86de('0x22')][_0x86de('0x34')]()){_0x43c22b[_0x86de('0x36')]=_[_0x86de('0x37')](moment()[_0x86de('0x2b')]('x'));}_0x43c22b[_0x86de('0x22')]=_0x17c3a9[_0x86de('0x22')]['toLowerCase']();_0x43c22b[_0x86de('0x33')]=!![];_0x43c22b['updateStatusRealtime'](_0x17c3a9);}}}}catch(_0x3a957c){logger['error'](_0x86de('0x32'),util[_0x86de('0x16')](_0x3a957c,{'showHidden':![],'depth':null}));}};UserReport[_0x86de('0x1c')][_0x86de('0x10')]=function(_0x12e121){try{if(this[_0x86de('0x20')](_0x12e121)&&this[_0x86de('0x20')](_0x12e121['peerstatus'])){logger[_0x86de('0x21')](_0x86de('0x42'),_0x12e121['peer'],_0x12e121[_0x86de('0x43')],_0x12e121[_0x86de('0xf')]);logger[_0x86de('0x23')](_0x86de('0x44'),util[_0x86de('0x16')](_0x12e121,{'showHidden':![],'depth':null}));if(this[_0x86de('0x8')][_0x12e121[_0x86de('0x45')]]){if(!this['agents'][_0x12e121[_0x86de('0x45')]][_0x86de('0x33')]||_0x12e121[_0x86de('0xf')][_0x86de('0x34')]()==_0x86de('0x46')){this[_0x86de('0x8')][_0x12e121[_0x86de('0x45')]]['local']=![];this[_0x86de('0x8')][_0x12e121['peer']][_0x86de('0x47')]=_0x12e121[_0x86de('0xf')]['toLowerCase']();this[_0x86de('0x8')][_0x12e121['peer']][_0x86de('0x43')]=_0x12e121[_0x86de('0x43')];this[_0x86de('0x8')][_0x12e121[_0x86de('0x45')]][_0x86de('0x38')](_0x12e121);}}else if(this['telephones'][_0x12e121[_0x86de('0x45')]]){this[_0x86de('0x9')][_0x12e121[_0x86de('0x45')]][_0x86de('0x47')]=_0x12e121[_0x86de('0xf')][_0x86de('0x34')]();this['telephones'][_0x12e121[_0x86de('0x45')]][_0x86de('0x43')]=_0x12e121['address'];logger[_0x86de('0x23')](_0x86de('0x48'),util[_0x86de('0x16')](this['telephones'][_0x12e121[_0x86de('0x45')]],{'showHidden':![],'depth':null}));this[_0x86de('0x1f')](util[_0x86de('0x2b')](_0x86de('0x3a'),this[_0x86de('0x9')][_0x12e121[_0x86de('0x45')]][_0x86de('0x2d')]),_0x86de('0x3b'),this[_0x86de('0x9')][_0x12e121['peer']]);}else if(this[_0x86de('0x7')][_0x12e121[_0x86de('0x45')]]){this[_0x86de('0x7')][_0x12e121['peer']][_0x86de('0x47')]=_0x12e121[_0x86de('0xf')][_0x86de('0x34')]();this[_0x86de('0x7')][_0x12e121[_0x86de('0x45')]][_0x86de('0x43')]=_0x12e121[_0x86de('0x43')];logger[_0x86de('0x23')](_0x86de('0x49'),util['inspect'](this[_0x86de('0x7')][_0x12e121['peer']],{'showHidden':![],'depth':null}));this[_0x86de('0x1f')](util[_0x86de('0x2b')](_0x86de('0x2c'),this[_0x86de('0x7')][_0x12e121['peer']][_0x86de('0x2d')]),_0x86de('0x3c'),this[_0x86de('0x7')][_0x12e121['peer']]);}}}catch(_0xb8d1de){logger['error']('[userReport][peerstatus]',util['inspect'](_0xb8d1de,{'showHidden':![],'depth':null}));}};module[_0x86de('0x4a')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index f506108..3248bfa 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 _0xa9e0=['redis','defaults','localhost','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','syncMusicOnHoldStart','musiconholdstop','attendedtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','info','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','uniqueid','YYYY-MM-DD\x20HH:mm:ss','queue','mandatoryDisposition','type','inbound','merge','omit','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','format','[%s][voiceAgentReport][agentcalled]','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','lastevent','voiceChannels','routealias','interface','pick','destconnectedlinenum','custom:agentconnect','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:%s','user:agentconnect','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answered_elsewhere','[%s][voiceAgentReport][agentconnect]','syncAgentRingNoAnswer','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','custom:agentringnoanswer','error','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','agentringnoanswer','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','reason','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','transfer','agent','talktime','acw','acwtime','agentacw','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberlastcall','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','syncAttendedTransfer','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','channel','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]','lodash','moment','util','../../../config/logger','../ami'];(function(_0x13986f,_0x4d5b9d){var _0xb5830f=function(_0xcfdc82){while(--_0xcfdc82){_0x13986f['push'](_0x13986f['shift']());}};_0xb5830f(++_0x4d5b9d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'use strict';var _=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x0a9e('0x3'))('ami');var ami=require(_0x0a9e('0x4'));config[_0x0a9e('0x5')]=_[_0x0a9e('0x6')](config[_0x0a9e('0x5')],{'host':_0x0a9e('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x5')]));function VoiceAgentReport(_0x441e3a){this[_0x0a9e('0x8')]={};this['voiceChannels']=_0x441e3a['channels'];this[_0x0a9e('0x9')]=_0x441e3a['voiceQueues'];this['agents']=_0x441e3a[_0x0a9e('0xa')];this[_0x0a9e('0xb')]={};ami['on'](_0x0a9e('0xc'),this[_0x0a9e('0xd')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0xf'),this['syncAgentConnect']['bind'](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x10'),this[_0x0a9e('0x11')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x12'),this[_0x0a9e('0x13')]['bind'](this));ami['on'](_0x0a9e('0x14'),this[_0x0a9e('0x15')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0xe')](this));ami['on']('musiconholdstart',this[_0x0a9e('0x18')]['bind'](this));ami['on'](_0x0a9e('0x19'),this['syncMusicOnHoldStop'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x1a'),this['syncAttendedTransfer'][_0x0a9e('0xe')](this));ami['on']('blindtransfer',this[_0x0a9e('0x1b')][_0x0a9e('0xe')](this));}VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1d')]=function(_0x31b1ca,_0x2eb11f,_0x530eb7){io['to'](_0x31b1ca)[_0x0a9e('0x1d')](_0x2eb11f,_0x530eb7);};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1e')]=function(_0x1c696a){return _0x1c696a!==null&&!_[_0x0a9e('0x1f')](_0x1c696a);};VoiceAgentReport['prototype'][_0x0a9e('0xd')]=function(_0x155cce){try{if(this['isNotNull'](_0x155cce)){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x155cce['uniqueid'],_0x155cce[_0x0a9e('0x21')],_0x155cce[_0x0a9e('0x22')]);logger[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x155cce,{'showHidden':![],'depth':null}));if(_[_0x0a9e('0x1f')](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]]={};}if(_[_0x0a9e('0x1f')](this['channels'][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]={'agentcalledAt':moment()['format'](_0x0a9e('0x27')),'lastevent':'called','mandatoryDisposition':this[_0x0a9e('0x9')][_0x155cce['queue']]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x29')]||![]:![],'type':this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x2a')]||'inbound':_0x0a9e('0x2b'),'variables':this[_0x0a9e('0xb')][_0x155cce[_0x0a9e('0x26')]]};}_[_0x0a9e('0x2c')](this['channels'][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]],_[_0x0a9e('0x2d')](_0x155cce,[_0x0a9e('0x2e'),_0x0a9e('0x2f')]));logger[_0x0a9e('0x23')](_0x0a9e('0x30'),_0x155cce[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this['channels'][_0x155cce[_0x0a9e('0x26')]][_0x155cce['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x31'),this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]);logger['debug'](_0x0a9e('0x32'),_0x155cce[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x33')]('user:%s',_0x155cce[_0x0a9e('0x21')]),'user:called',this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]);}}catch(_0x3f3d41){logger['error'](_0x0a9e('0x34'),_0x155cce[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x3f3d41,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncAgentConnect']=function(_0x54135e){try{if(this[_0x0a9e('0x1e')](_0x54135e)){if(this['channels'][_0x54135e[_0x0a9e('0x26')]]){logger[_0x0a9e('0x23')](_0x0a9e('0x35'),_0x54135e[_0x0a9e('0x26')],util['inspect'](_0x54135e,{'showHidden':![],'depth':null}));for(var _0x31916f in this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]]){if(this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x31916f)){if(_0x54135e[_0x0a9e('0x22')]===_0x31916f){logger['info']('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x54135e[_0x0a9e('0x26')],_0x54135e[_0x0a9e('0x21')],_0x54135e['destuniqueid']);this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x37')]=moment()[_0x0a9e('0x33')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x38')]=_0x54135e['connectedlinename'];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x39')]=_0x54135e['connectedlinenum'];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3a')]=_0x54135e[_0x0a9e('0x3a')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3b')]=_0x54135e[_0x0a9e('0x3b')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3c')]=_0x54135e[_0x0a9e('0x3c')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3d')]='connect';if(this['voiceChannels'][this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x26')]]){var _0x315881=this[_0x0a9e('0x3e')][this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x26')]][_0x0a9e('0x3f')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3f')]=_0x315881;_0x54135e['routealias']=_0x315881;}_[_0x0a9e('0x2c')](this[_0x0a9e('0xa')][_0x54135e[_0x0a9e('0x40')]],_[_0x0a9e('0x41')](_0x54135e,[_0x0a9e('0x28'),_0x0a9e('0x42'),_0x0a9e('0x3f')]));logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:',_0x54135e[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x54135e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami['emit'](_0x0a9e('0x43'),this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x54135e[_0x0a9e('0x22')]]);logger[_0x0a9e('0x23')](_0x0a9e('0x44'),_0x54135e[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x54135e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x33')](_0x0a9e('0x45'),_0x54135e[_0x0a9e('0x21')]),_0x0a9e('0x46'),this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x54135e[_0x0a9e('0x22')]]);}else if(!this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f]['agentringnoanswer']&&!this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')](_0x0a9e('0x47'),_0x54135e[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x21')],_0x31916f);this['channels'][_0x54135e['uniqueid']][_0x31916f]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x48')]=moment()['format'](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f]['answeredelsewheredestinationuniqueid']=_0x54135e[_0x0a9e('0x22')];this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x31916f]['answeredelsewheremembername']=_0x54135e[_0x0a9e('0x21')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f]['lastevent']=_0x0a9e('0x49');this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f]['reason']=_0x0a9e('0x49');logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:',_0x54135e[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')]('custom:agentansweredelsewhere',this['channels'][_0x54135e['uniqueid']][_0x31916f]);}}}}}}catch(_0x2da03c){logger['error'](_0x0a9e('0x4a'),_0x54135e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2da03c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x4b')]=function(_0x272738){try{if(this[_0x0a9e('0x1e')](_0x272738)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x272738[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x272738,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]]&&this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738['destuniqueid']]){logger[_0x0a9e('0x20')](_0x0a9e('0x4c'),_0x272738['uniqueid'],_0x272738[_0x0a9e('0x21')],_0x272738['destuniqueid']);this[_0x0a9e('0x8')][_0x272738['uniqueid']][_0x272738['destuniqueid']]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x272738['uniqueid']][_0x272738[_0x0a9e('0x22')]][_0x0a9e('0x48')]=moment()[_0x0a9e('0x33')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738['destuniqueid']][_0x0a9e('0x3d')]='rejected';this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738[_0x0a9e('0x22')]]['reason']=_0x0a9e('0x4d');logger[_0x0a9e('0x23')](_0x0a9e('0x4e'),_0x272738[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x4f'),this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738[_0x0a9e('0x22')]]);}}}catch(_0x4d4a35){logger[_0x0a9e('0x50')](_0x0a9e('0x51'),_0x272738[_0x0a9e('0x26')],util['inspect'](_0x4d4a35,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncQueueCallerAbandon']=function(_0x5211e3){try{if(this[_0x0a9e('0x1e')](_0x5211e3)){logger[_0x0a9e('0x23')](_0x0a9e('0x52'),_0x5211e3[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x5211e3,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]]){for(var _0x54a37d in this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x54a37d)&&!this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x53')]&&!this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d]['agentcomplete']){logger[_0x0a9e('0x20')](_0x0a9e('0x54'),_0x5211e3[_0x0a9e('0x26')],this['channels'][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x21')],_0x54a37d);this['channels'][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x53')]=!![];this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x48')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x3d')]=_0x0a9e('0x55');this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x56')]=_0x0a9e('0x55');logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:',_0x5211e3[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x5211e3['uniqueid']][_0x54a37d],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')]('custom:agentqueuecallerabandon',this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d]);}}}}}catch(_0x4c46c1){logger[_0x0a9e('0x50')](_0x0a9e('0x57'),_0x5211e3[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4c46c1,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x13')]=function(_0x2e9552){try{if(this[_0x0a9e('0x1e')](_0x2e9552)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcomplete]\x20event:',_0x2e9552[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2e9552,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]]){for(var _0x4abc8f in this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x4abc8f)){if(this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x37')]&&!this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')](_0x0a9e('0x58'),_0x2e9552[_0x0a9e('0x26')],this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x21')],_0x4abc8f);this[_0x0a9e('0x8')][_0x2e9552['uniqueid']][_0x4abc8f][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x59')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f]['lastevent']=_0x0a9e('0x5a');this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x56')]=_0x2e9552['reason']==_0x0a9e('0x5b')?_0x0a9e('0x5c'):_0x2e9552[_0x0a9e('0x56')];this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x5d')]=_0x2e9552[_0x0a9e('0x5d')];if(this['voiceQueues'][_0x2e9552[_0x0a9e('0x28')]]&&this[_0x0a9e('0x9')][_0x2e9552[_0x0a9e('0x28')]][_0x0a9e('0x5e')]){this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x5f')]=this['voiceQueues'][_0x2e9552[_0x0a9e('0x28')]]['acwTimeout'];this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x60')]=!![];}this[_0x0a9e('0xa')][_0x2e9552['interface']]=_['omit'](this[_0x0a9e('0xa')][_0x2e9552[_0x0a9e('0x40')]],[_0x0a9e('0x28'),'destconnectedlinenum']);logger[_0x0a9e('0x23')](_0x0a9e('0x61'),_0x2e9552['uniqueid'],util['inspect'](this[_0x0a9e('0x8')][_0x2e9552['uniqueid']][_0x4abc8f],{'showHidden':![],'depth':null}));ami['emit']('custom:agentcomplete',this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f]);logger[_0x0a9e('0x23')](_0x0a9e('0x62'),_0x2e9552[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f],{'showHidden':![],'depth':null}));this['emit'](util[_0x0a9e('0x33')](_0x0a9e('0x45'),_0x2e9552[_0x0a9e('0x21')]),_0x0a9e('0x63'),this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f]);}}}}}}catch(_0x32f761){logger[_0x0a9e('0x50')]('[%s][voiceAgentReport][agentcomplete]',_0x2e9552[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x32f761,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x15')]=function(_0x255e49){try{if(this[_0x0a9e('0x1e')](_0x255e49)){logger[_0x0a9e('0x23')](_0x0a9e('0x64'),_0x255e49['uniqueid'],util[_0x0a9e('0x25')](_0x255e49,{'showHidden':![],'depth':null}));this[_0x0a9e('0x65')](_0x255e49['uniqueid'],_[_0x0a9e('0x66')](_0x255e49[_0x0a9e('0x67')])[0x0],_0x255e49[_0x0a9e('0x68')]);if(this['channels'][_0x255e49[_0x0a9e('0x26')]]){for(var _0x52ec10 in this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x52ec10)){logger[_0x0a9e('0x20')](_0x0a9e('0x69'),_0x255e49[_0x0a9e('0x26')],_0x52ec10,_['keys'](_0x255e49[_0x0a9e('0x67')])[0x0],_0x255e49[_0x0a9e('0x68')]);if(_[_0x0a9e('0x1f')](this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x52ec10][_0x0a9e('0xb')])){this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x52ec10][_0x0a9e('0xb')]={};}this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x52ec10][_0x0a9e('0xb')]=this[_0x0a9e('0xb')][_0x255e49['uniqueid']];}}}}}catch(_0xc81b64){logger[_0x0a9e('0x50')](_0x0a9e('0x6a'),_0x255e49[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xc81b64,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x65')]=function(_0x1756c7,_0x5ce99d,_0x23b447){var _0x5e725e=[_0x0a9e('0x6b'),_0x0a9e('0x6c'),_0x0a9e('0x6d'),_0x0a9e('0x6e'),'rtpaudioqosloss',_0x0a9e('0x6f'),'rtpaudioqosrtt',_0x0a9e('0x70'),_0x0a9e('0x71'),'sipuri',_0x0a9e('0x72'),_0x0a9e('0x73'),_0x0a9e('0x74'),'memberdynamic','memberinterface',_0x0a9e('0x75'),_0x0a9e('0x21'),_0x0a9e('0x76'),_0x0a9e('0x77')];if(!_[_0x0a9e('0x78')](_0x5ce99d)&&!_[_0x0a9e('0x79')](_0x5e725e,_0x5ce99d)){if(_[_0x0a9e('0x1f')](this[_0x0a9e('0xb')][_0x1756c7])){this[_0x0a9e('0xb')][_0x1756c7]={};}this['variables'][_0x1756c7][_0x5ce99d]=_0x23b447;}};VoiceAgentReport[_0x0a9e('0x1c')]['syncHangup']=function(_0x287324){try{if(this[_0x0a9e('0x1e')](_0x287324)){logger[_0x0a9e('0x23')](_0x0a9e('0x7a'),_0x287324[_0x0a9e('0x26')],util['inspect'](_0x287324,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]]){for(var _0x2791c5 in this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]]){if(this['channels'][_0x287324['uniqueid']][_0x0a9e('0x36')](_0x2791c5)){if(this['channels'][_0x287324[_0x0a9e('0x26')]][_0x2791c5][_0x0a9e('0x56')]==_0x0a9e('0x5b')&&this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]][_0x2791c5][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x287324[_0x0a9e('0x26')],_0x2791c5);this['channels'][_0x287324[_0x0a9e('0x26')]][_0x2791c5]['agentcompleteAt']=moment()[_0x0a9e('0x33')]('YYYY-MM-DD\x20HH:mm:ss');}}}logger['debug'](_0x0a9e('0x7b'),_0x287324[_0x0a9e('0x26')],util['inspect'](_[_0x0a9e('0x7c')](this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]]),{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x7d'),_['values'](this['channels'][_0x287324[_0x0a9e('0x26')]]));delete this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]];}if(this[_0x0a9e('0xb')][_0x287324[_0x0a9e('0x26')]]){delete this['variables'][_0x287324[_0x0a9e('0x26')]];}}}catch(_0xadce3d){logger['error'](_0x0a9e('0x7e'),_0x287324[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xadce3d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x7f')]=function(_0x23b39e){try{if(this[_0x0a9e('0x1e')](_0x23b39e)){logger[_0x0a9e('0x23')](_0x0a9e('0x80'),_0x23b39e[_0x0a9e('0x26')],util['inspect'](_0x23b39e,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]]){for(var _0x2ada60 in this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]]){if(this['channels'][_0x23b39e['transfereeuniqueid']][_0x0a9e('0x36')](_0x2ada60)){if(_0x23b39e[_0x0a9e('0x82')]===_0x2ada60){logger[_0x0a9e('0x20')](_0x0a9e('0x83'),_0x23b39e[_0x0a9e('0x26')],this['channels'][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x21')],_0x2ada60);var _0x3450ae=moment();this['channels'][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60]['agentcomplete']=!![];this[_0x0a9e('0x8')][_0x23b39e['transfereeuniqueid']][_0x2ada60][_0x0a9e('0x59')]=moment()[_0x0a9e('0x33')](_0x0a9e('0x27'));this['channels'][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60]['lastevent']=_0x0a9e('0x5a');this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x56')]=_0x0a9e('0x5b');this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x5d')]=_0x3450ae[_0x0a9e('0x84')](this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x37')],_0x0a9e('0x85'));}}}}if(this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x86')]]){var _0x248368=this['channels'][_0x23b39e['secondtransfereruniqueid']];this[_0x0a9e('0x8')][_0x23b39e['secondtransfereruniqueid']]=this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]];this['channels'][_0x23b39e[_0x0a9e('0x81')]]=_0x248368;}}}catch(_0xe2b083){logger[_0x0a9e('0x50')](_0x0a9e('0x87'),_0x23b39e['uniqueid'],util[_0x0a9e('0x25')](_0xe2b083,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1b')]=function(_0x34a791){try{if(this['isNotNull'](_0x34a791)){logger[_0x0a9e('0x23')](_0x0a9e('0x88'),_0x34a791[_0x0a9e('0x26')],util['inspect'](_0x34a791,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]]){for(var _0x17b29d in this['channels'][_0x34a791[_0x0a9e('0x81')]]){if(this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x0a9e('0x36')](_0x17b29d)){if(_0x34a791[_0x0a9e('0x89')]===_0x17b29d){logger['info'](_0x0a9e('0x8a'),_0x34a791[_0x0a9e('0x26')],this['channels'][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x21')],_0x17b29d);var _0x1f6f1c=moment();this['channels'][_0x34a791['transfereeuniqueid']][_0x17b29d]['agentcomplete']=!![];this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d]['agentcompleteAt']=_0x1f6f1c;this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x3d')]='complete';this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x56')]=_0x0a9e('0x5b');this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x5d')]=_0x1f6f1c[_0x0a9e('0x84')](this[_0x0a9e('0x8')][_0x34a791['transfereeuniqueid']][_0x17b29d][_0x0a9e('0x37')],'seconds');}}}}}}catch(_0x138cf5){logger[_0x0a9e('0x50')](_0x0a9e('0x8b'),_0x34a791[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x138cf5,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncMusicOnHoldStart']=function(_0x1a0314){var _0x33da81='';try{if(this[_0x0a9e('0x1e')](_0x1a0314)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][musiconholdstart]\x20event:',_0x1a0314[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x1a0314,{'showHidden':![],'depth':null}));if(_0x1a0314[_0x0a9e('0x8c')]){_0x33da81=_0x1a0314[_0x0a9e('0x8c')][_0x0a9e('0x8d')](0x0,_0x1a0314[_0x0a9e('0x8c')][_0x0a9e('0x8e')]('-'));if(this[_0x0a9e('0xa')][_0x33da81]){logger[_0x0a9e('0x20')](_0x0a9e('0x8f'),_0x1a0314['uniqueid'],_0x33da81);this[_0x0a9e('0xa')][_0x33da81][_0x0a9e('0x90')]=!![];}}}}catch(_0x2ff265){logger[_0x0a9e('0x50')](_0x0a9e('0x91'),_0x1a0314[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2ff265,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncMusicOnHoldStop']=function(_0x3b581c){var _0xd2391='';try{if(this[_0x0a9e('0x1e')](_0x3b581c)){logger['debug'](_0x0a9e('0x92'),_0x3b581c[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x3b581c,{'showHidden':![],'depth':null}));if(_0x3b581c[_0x0a9e('0x8c')]){_0xd2391=_0x3b581c[_0x0a9e('0x8c')][_0x0a9e('0x8d')](0x0,_0x3b581c[_0x0a9e('0x8c')][_0x0a9e('0x8e')]('-'));if(this[_0x0a9e('0xa')][_0xd2391]){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][musiconholdstop]\x20interface:%s',_0x3b581c[_0x0a9e('0x26')],_0xd2391);this[_0x0a9e('0xa')][_0xd2391][_0x0a9e('0x90')]=![];}}}}catch(_0x3db98f){logger[_0x0a9e('0x50')](_0x0a9e('0x93'),_0x3b581c['uniqueid'],util[_0x0a9e('0x25')](_0x3db98f,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport; \ No newline at end of file +var _0xa9e0=['redis','defaults','localhost','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','syncMusicOnHoldStart','musiconholdstop','attendedtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','info','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','uniqueid','YYYY-MM-DD\x20HH:mm:ss','queue','mandatoryDisposition','type','inbound','merge','omit','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','format','[%s][voiceAgentReport][agentcalled]','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','lastevent','voiceChannels','routealias','interface','pick','destconnectedlinenum','custom:agentconnect','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:%s','user:agentconnect','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answered_elsewhere','[%s][voiceAgentReport][agentconnect]','syncAgentRingNoAnswer','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','custom:agentringnoanswer','error','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','agentringnoanswer','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','reason','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','transfer','agent','talktime','acw','acwtime','agentacw','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberlastcall','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','syncAttendedTransfer','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','channel','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]','lodash','moment','util','../../../config/logger','../ami'];(function(_0x227097,_0x527540){var _0x579dc0=function(_0xfbcd44){while(--_0xfbcd44){_0x227097['push'](_0x227097['shift']());}};_0x579dc0(++_0x527540);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'use strict';var _=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x0a9e('0x3'))('ami');var ami=require(_0x0a9e('0x4'));config[_0x0a9e('0x5')]=_[_0x0a9e('0x6')](config[_0x0a9e('0x5')],{'host':_0x0a9e('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x5')]));function VoiceAgentReport(_0x441e3a){this[_0x0a9e('0x8')]={};this['voiceChannels']=_0x441e3a['channels'];this[_0x0a9e('0x9')]=_0x441e3a['voiceQueues'];this['agents']=_0x441e3a[_0x0a9e('0xa')];this[_0x0a9e('0xb')]={};ami['on'](_0x0a9e('0xc'),this[_0x0a9e('0xd')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0xf'),this['syncAgentConnect']['bind'](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x10'),this[_0x0a9e('0x11')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x12'),this[_0x0a9e('0x13')]['bind'](this));ami['on'](_0x0a9e('0x14'),this[_0x0a9e('0x15')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0xe')](this));ami['on']('musiconholdstart',this[_0x0a9e('0x18')]['bind'](this));ami['on'](_0x0a9e('0x19'),this['syncMusicOnHoldStop'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x1a'),this['syncAttendedTransfer'][_0x0a9e('0xe')](this));ami['on']('blindtransfer',this[_0x0a9e('0x1b')][_0x0a9e('0xe')](this));}VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1d')]=function(_0x31b1ca,_0x2eb11f,_0x530eb7){io['to'](_0x31b1ca)[_0x0a9e('0x1d')](_0x2eb11f,_0x530eb7);};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1e')]=function(_0x1c696a){return _0x1c696a!==null&&!_[_0x0a9e('0x1f')](_0x1c696a);};VoiceAgentReport['prototype'][_0x0a9e('0xd')]=function(_0x155cce){try{if(this['isNotNull'](_0x155cce)){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x155cce['uniqueid'],_0x155cce[_0x0a9e('0x21')],_0x155cce[_0x0a9e('0x22')]);logger[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x155cce,{'showHidden':![],'depth':null}));if(_[_0x0a9e('0x1f')](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]]={};}if(_[_0x0a9e('0x1f')](this['channels'][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]={'agentcalledAt':moment()['format'](_0x0a9e('0x27')),'lastevent':'called','mandatoryDisposition':this[_0x0a9e('0x9')][_0x155cce['queue']]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x29')]||![]:![],'type':this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x2a')]||'inbound':_0x0a9e('0x2b'),'variables':this[_0x0a9e('0xb')][_0x155cce[_0x0a9e('0x26')]]};}_[_0x0a9e('0x2c')](this['channels'][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]],_[_0x0a9e('0x2d')](_0x155cce,[_0x0a9e('0x2e'),_0x0a9e('0x2f')]));logger[_0x0a9e('0x23')](_0x0a9e('0x30'),_0x155cce[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this['channels'][_0x155cce[_0x0a9e('0x26')]][_0x155cce['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x31'),this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]);logger['debug'](_0x0a9e('0x32'),_0x155cce[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x33')]('user:%s',_0x155cce[_0x0a9e('0x21')]),'user:called',this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]);}}catch(_0x3f3d41){logger['error'](_0x0a9e('0x34'),_0x155cce[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x3f3d41,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncAgentConnect']=function(_0x54135e){try{if(this[_0x0a9e('0x1e')](_0x54135e)){if(this['channels'][_0x54135e[_0x0a9e('0x26')]]){logger[_0x0a9e('0x23')](_0x0a9e('0x35'),_0x54135e[_0x0a9e('0x26')],util['inspect'](_0x54135e,{'showHidden':![],'depth':null}));for(var _0x31916f in this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]]){if(this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x31916f)){if(_0x54135e[_0x0a9e('0x22')]===_0x31916f){logger['info']('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x54135e[_0x0a9e('0x26')],_0x54135e[_0x0a9e('0x21')],_0x54135e['destuniqueid']);this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x37')]=moment()[_0x0a9e('0x33')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x38')]=_0x54135e['connectedlinename'];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x39')]=_0x54135e['connectedlinenum'];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3a')]=_0x54135e[_0x0a9e('0x3a')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3b')]=_0x54135e[_0x0a9e('0x3b')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3c')]=_0x54135e[_0x0a9e('0x3c')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3d')]='connect';if(this['voiceChannels'][this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x26')]]){var _0x315881=this[_0x0a9e('0x3e')][this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x26')]][_0x0a9e('0x3f')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3f')]=_0x315881;_0x54135e['routealias']=_0x315881;}_[_0x0a9e('0x2c')](this[_0x0a9e('0xa')][_0x54135e[_0x0a9e('0x40')]],_[_0x0a9e('0x41')](_0x54135e,[_0x0a9e('0x28'),_0x0a9e('0x42'),_0x0a9e('0x3f')]));logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:',_0x54135e[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x54135e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami['emit'](_0x0a9e('0x43'),this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x54135e[_0x0a9e('0x22')]]);logger[_0x0a9e('0x23')](_0x0a9e('0x44'),_0x54135e[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x54135e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x33')](_0x0a9e('0x45'),_0x54135e[_0x0a9e('0x21')]),_0x0a9e('0x46'),this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x54135e[_0x0a9e('0x22')]]);}else if(!this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f]['agentringnoanswer']&&!this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')](_0x0a9e('0x47'),_0x54135e[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x21')],_0x31916f);this['channels'][_0x54135e['uniqueid']][_0x31916f]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x48')]=moment()['format'](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f]['answeredelsewheredestinationuniqueid']=_0x54135e[_0x0a9e('0x22')];this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x31916f]['answeredelsewheremembername']=_0x54135e[_0x0a9e('0x21')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f]['lastevent']=_0x0a9e('0x49');this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f]['reason']=_0x0a9e('0x49');logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:',_0x54135e[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')]('custom:agentansweredelsewhere',this['channels'][_0x54135e['uniqueid']][_0x31916f]);}}}}}}catch(_0x2da03c){logger['error'](_0x0a9e('0x4a'),_0x54135e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2da03c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x4b')]=function(_0x272738){try{if(this[_0x0a9e('0x1e')](_0x272738)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x272738[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x272738,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]]&&this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738['destuniqueid']]){logger[_0x0a9e('0x20')](_0x0a9e('0x4c'),_0x272738['uniqueid'],_0x272738[_0x0a9e('0x21')],_0x272738['destuniqueid']);this[_0x0a9e('0x8')][_0x272738['uniqueid']][_0x272738['destuniqueid']]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x272738['uniqueid']][_0x272738[_0x0a9e('0x22')]][_0x0a9e('0x48')]=moment()[_0x0a9e('0x33')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738['destuniqueid']][_0x0a9e('0x3d')]='rejected';this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738[_0x0a9e('0x22')]]['reason']=_0x0a9e('0x4d');logger[_0x0a9e('0x23')](_0x0a9e('0x4e'),_0x272738[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x4f'),this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738[_0x0a9e('0x22')]]);}}}catch(_0x4d4a35){logger[_0x0a9e('0x50')](_0x0a9e('0x51'),_0x272738[_0x0a9e('0x26')],util['inspect'](_0x4d4a35,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncQueueCallerAbandon']=function(_0x5211e3){try{if(this[_0x0a9e('0x1e')](_0x5211e3)){logger[_0x0a9e('0x23')](_0x0a9e('0x52'),_0x5211e3[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x5211e3,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]]){for(var _0x54a37d in this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x54a37d)&&!this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x53')]&&!this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d]['agentcomplete']){logger[_0x0a9e('0x20')](_0x0a9e('0x54'),_0x5211e3[_0x0a9e('0x26')],this['channels'][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x21')],_0x54a37d);this['channels'][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x53')]=!![];this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x48')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x3d')]=_0x0a9e('0x55');this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x56')]=_0x0a9e('0x55');logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:',_0x5211e3[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x5211e3['uniqueid']][_0x54a37d],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')]('custom:agentqueuecallerabandon',this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d]);}}}}}catch(_0x4c46c1){logger[_0x0a9e('0x50')](_0x0a9e('0x57'),_0x5211e3[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4c46c1,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x13')]=function(_0x2e9552){try{if(this[_0x0a9e('0x1e')](_0x2e9552)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcomplete]\x20event:',_0x2e9552[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2e9552,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]]){for(var _0x4abc8f in this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x4abc8f)){if(this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x37')]&&!this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')](_0x0a9e('0x58'),_0x2e9552[_0x0a9e('0x26')],this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x21')],_0x4abc8f);this[_0x0a9e('0x8')][_0x2e9552['uniqueid']][_0x4abc8f][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x59')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f]['lastevent']=_0x0a9e('0x5a');this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x56')]=_0x2e9552['reason']==_0x0a9e('0x5b')?_0x0a9e('0x5c'):_0x2e9552[_0x0a9e('0x56')];this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x5d')]=_0x2e9552[_0x0a9e('0x5d')];if(this['voiceQueues'][_0x2e9552[_0x0a9e('0x28')]]&&this[_0x0a9e('0x9')][_0x2e9552[_0x0a9e('0x28')]][_0x0a9e('0x5e')]){this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x5f')]=this['voiceQueues'][_0x2e9552[_0x0a9e('0x28')]]['acwTimeout'];this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x60')]=!![];}this[_0x0a9e('0xa')][_0x2e9552['interface']]=_['omit'](this[_0x0a9e('0xa')][_0x2e9552[_0x0a9e('0x40')]],[_0x0a9e('0x28'),'destconnectedlinenum']);logger[_0x0a9e('0x23')](_0x0a9e('0x61'),_0x2e9552['uniqueid'],util['inspect'](this[_0x0a9e('0x8')][_0x2e9552['uniqueid']][_0x4abc8f],{'showHidden':![],'depth':null}));ami['emit']('custom:agentcomplete',this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f]);logger[_0x0a9e('0x23')](_0x0a9e('0x62'),_0x2e9552[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f],{'showHidden':![],'depth':null}));this['emit'](util[_0x0a9e('0x33')](_0x0a9e('0x45'),_0x2e9552[_0x0a9e('0x21')]),_0x0a9e('0x63'),this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f]);}}}}}}catch(_0x32f761){logger[_0x0a9e('0x50')]('[%s][voiceAgentReport][agentcomplete]',_0x2e9552[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x32f761,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x15')]=function(_0x255e49){try{if(this[_0x0a9e('0x1e')](_0x255e49)){logger[_0x0a9e('0x23')](_0x0a9e('0x64'),_0x255e49['uniqueid'],util[_0x0a9e('0x25')](_0x255e49,{'showHidden':![],'depth':null}));this[_0x0a9e('0x65')](_0x255e49['uniqueid'],_[_0x0a9e('0x66')](_0x255e49[_0x0a9e('0x67')])[0x0],_0x255e49[_0x0a9e('0x68')]);if(this['channels'][_0x255e49[_0x0a9e('0x26')]]){for(var _0x52ec10 in this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x52ec10)){logger[_0x0a9e('0x20')](_0x0a9e('0x69'),_0x255e49[_0x0a9e('0x26')],_0x52ec10,_['keys'](_0x255e49[_0x0a9e('0x67')])[0x0],_0x255e49[_0x0a9e('0x68')]);if(_[_0x0a9e('0x1f')](this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x52ec10][_0x0a9e('0xb')])){this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x52ec10][_0x0a9e('0xb')]={};}this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x52ec10][_0x0a9e('0xb')]=this[_0x0a9e('0xb')][_0x255e49['uniqueid']];}}}}}catch(_0xc81b64){logger[_0x0a9e('0x50')](_0x0a9e('0x6a'),_0x255e49[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xc81b64,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x65')]=function(_0x1756c7,_0x5ce99d,_0x23b447){var _0x5e725e=[_0x0a9e('0x6b'),_0x0a9e('0x6c'),_0x0a9e('0x6d'),_0x0a9e('0x6e'),'rtpaudioqosloss',_0x0a9e('0x6f'),'rtpaudioqosrtt',_0x0a9e('0x70'),_0x0a9e('0x71'),'sipuri',_0x0a9e('0x72'),_0x0a9e('0x73'),_0x0a9e('0x74'),'memberdynamic','memberinterface',_0x0a9e('0x75'),_0x0a9e('0x21'),_0x0a9e('0x76'),_0x0a9e('0x77')];if(!_[_0x0a9e('0x78')](_0x5ce99d)&&!_[_0x0a9e('0x79')](_0x5e725e,_0x5ce99d)){if(_[_0x0a9e('0x1f')](this[_0x0a9e('0xb')][_0x1756c7])){this[_0x0a9e('0xb')][_0x1756c7]={};}this['variables'][_0x1756c7][_0x5ce99d]=_0x23b447;}};VoiceAgentReport[_0x0a9e('0x1c')]['syncHangup']=function(_0x287324){try{if(this[_0x0a9e('0x1e')](_0x287324)){logger[_0x0a9e('0x23')](_0x0a9e('0x7a'),_0x287324[_0x0a9e('0x26')],util['inspect'](_0x287324,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]]){for(var _0x2791c5 in this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]]){if(this['channels'][_0x287324['uniqueid']][_0x0a9e('0x36')](_0x2791c5)){if(this['channels'][_0x287324[_0x0a9e('0x26')]][_0x2791c5][_0x0a9e('0x56')]==_0x0a9e('0x5b')&&this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]][_0x2791c5][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x287324[_0x0a9e('0x26')],_0x2791c5);this['channels'][_0x287324[_0x0a9e('0x26')]][_0x2791c5]['agentcompleteAt']=moment()[_0x0a9e('0x33')]('YYYY-MM-DD\x20HH:mm:ss');}}}logger['debug'](_0x0a9e('0x7b'),_0x287324[_0x0a9e('0x26')],util['inspect'](_[_0x0a9e('0x7c')](this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]]),{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x7d'),_['values'](this['channels'][_0x287324[_0x0a9e('0x26')]]));delete this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]];}if(this[_0x0a9e('0xb')][_0x287324[_0x0a9e('0x26')]]){delete this['variables'][_0x287324[_0x0a9e('0x26')]];}}}catch(_0xadce3d){logger['error'](_0x0a9e('0x7e'),_0x287324[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xadce3d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x7f')]=function(_0x23b39e){try{if(this[_0x0a9e('0x1e')](_0x23b39e)){logger[_0x0a9e('0x23')](_0x0a9e('0x80'),_0x23b39e[_0x0a9e('0x26')],util['inspect'](_0x23b39e,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]]){for(var _0x2ada60 in this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]]){if(this['channels'][_0x23b39e['transfereeuniqueid']][_0x0a9e('0x36')](_0x2ada60)){if(_0x23b39e[_0x0a9e('0x82')]===_0x2ada60){logger[_0x0a9e('0x20')](_0x0a9e('0x83'),_0x23b39e[_0x0a9e('0x26')],this['channels'][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x21')],_0x2ada60);var _0x3450ae=moment();this['channels'][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60]['agentcomplete']=!![];this[_0x0a9e('0x8')][_0x23b39e['transfereeuniqueid']][_0x2ada60][_0x0a9e('0x59')]=moment()[_0x0a9e('0x33')](_0x0a9e('0x27'));this['channels'][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60]['lastevent']=_0x0a9e('0x5a');this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x56')]=_0x0a9e('0x5b');this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x5d')]=_0x3450ae[_0x0a9e('0x84')](this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x37')],_0x0a9e('0x85'));}}}}if(this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x86')]]){var _0x248368=this['channels'][_0x23b39e['secondtransfereruniqueid']];this[_0x0a9e('0x8')][_0x23b39e['secondtransfereruniqueid']]=this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]];this['channels'][_0x23b39e[_0x0a9e('0x81')]]=_0x248368;}}}catch(_0xe2b083){logger[_0x0a9e('0x50')](_0x0a9e('0x87'),_0x23b39e['uniqueid'],util[_0x0a9e('0x25')](_0xe2b083,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1b')]=function(_0x34a791){try{if(this['isNotNull'](_0x34a791)){logger[_0x0a9e('0x23')](_0x0a9e('0x88'),_0x34a791[_0x0a9e('0x26')],util['inspect'](_0x34a791,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]]){for(var _0x17b29d in this['channels'][_0x34a791[_0x0a9e('0x81')]]){if(this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x0a9e('0x36')](_0x17b29d)){if(_0x34a791[_0x0a9e('0x89')]===_0x17b29d){logger['info'](_0x0a9e('0x8a'),_0x34a791[_0x0a9e('0x26')],this['channels'][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x21')],_0x17b29d);var _0x1f6f1c=moment();this['channels'][_0x34a791['transfereeuniqueid']][_0x17b29d]['agentcomplete']=!![];this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d]['agentcompleteAt']=_0x1f6f1c;this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x3d')]='complete';this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x56')]=_0x0a9e('0x5b');this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x5d')]=_0x1f6f1c[_0x0a9e('0x84')](this[_0x0a9e('0x8')][_0x34a791['transfereeuniqueid']][_0x17b29d][_0x0a9e('0x37')],'seconds');}}}}}}catch(_0x138cf5){logger[_0x0a9e('0x50')](_0x0a9e('0x8b'),_0x34a791[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x138cf5,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncMusicOnHoldStart']=function(_0x1a0314){var _0x33da81='';try{if(this[_0x0a9e('0x1e')](_0x1a0314)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][musiconholdstart]\x20event:',_0x1a0314[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x1a0314,{'showHidden':![],'depth':null}));if(_0x1a0314[_0x0a9e('0x8c')]){_0x33da81=_0x1a0314[_0x0a9e('0x8c')][_0x0a9e('0x8d')](0x0,_0x1a0314[_0x0a9e('0x8c')][_0x0a9e('0x8e')]('-'));if(this[_0x0a9e('0xa')][_0x33da81]){logger[_0x0a9e('0x20')](_0x0a9e('0x8f'),_0x1a0314['uniqueid'],_0x33da81);this[_0x0a9e('0xa')][_0x33da81][_0x0a9e('0x90')]=!![];}}}}catch(_0x2ff265){logger[_0x0a9e('0x50')](_0x0a9e('0x91'),_0x1a0314[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2ff265,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncMusicOnHoldStop']=function(_0x3b581c){var _0xd2391='';try{if(this[_0x0a9e('0x1e')](_0x3b581c)){logger['debug'](_0x0a9e('0x92'),_0x3b581c[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x3b581c,{'showHidden':![],'depth':null}));if(_0x3b581c[_0x0a9e('0x8c')]){_0xd2391=_0x3b581c[_0x0a9e('0x8c')][_0x0a9e('0x8d')](0x0,_0x3b581c[_0x0a9e('0x8c')][_0x0a9e('0x8e')]('-'));if(this[_0x0a9e('0xa')][_0xd2391]){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][musiconholdstop]\x20interface:%s',_0x3b581c[_0x0a9e('0x26')],_0xd2391);this[_0x0a9e('0xa')][_0xd2391][_0x0a9e('0x90')]=![];}}}}catch(_0x3db98f){logger[_0x0a9e('0x50')](_0x0a9e('0x93'),_0x3b581c['uniqueid'],util[_0x0a9e('0x25')](_0x3db98f,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index fcae4e0..f3f26e5 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 _0xa236=['agents','blindTransfers','coreshowchannel','syncNewExten','bind','newchannel','syncNewChannel','newstate','syncNewState','syncVarSet','hangup','newcallerid','syncNewCallerId','attendedtransfer','blindtransfer','syncBlindTransfer','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','info','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','[voiceCallReport][coreshowchannels]','inspect','isNotNull','isUndefined','emit','prototype','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridnum','debug','[%s][voiceCallReport][newcallerid]\x20event:','linkedid','merge','pick','keys','context','from-sip','exten','xcally-motion-preview','channel','split','destconnectedlinenum','format','user:%s','name','user:agentconnect','accountcode','[%s][voiceCallReport][newcallerid]','[%s][voiceCallReport][newchannel]\x20event:','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','error','[%s][voiceCallReport][newexten]\x20event:','application','toLowerCase','applicationdata','appdata','CDR(routeAlias)','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','starttime','duration','subtract','seconds','includes','lastapplication','lastdata','startsWith','cdr(','match','[%s][voiceCallReport][newexten]','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','[%s][voiceCallReport][newstate]\x20event:','answered','answertime','holdtime','diff','connectedlinenum','connectedlinename','calleridname','destinationchannel','UserId','membername','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','endsWith','.wav49','monitorFilename','monitors','isNil','push','[%s][voiceCallReport][mixMonitorFilename]','[%s][voiceCallReport][varset]\x20event:','variable','mixmonitor_filename','value','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','type','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','originatecalleridnum','xmd-destination','destination','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','sipcalllinkedid','syncHangup','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','endtime','billableseconds','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','resolve','then','transferType','undefined','getSettings','Action','StopMixMonitor','catch','finally','webbar:stopmonitors','BlindTransfer','outbound','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','[%s][voiceCallReport][hangup]','syncAttendedTransfer','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid','origtransferercalleridnum','transfertargetuniqueid','origtransfereruniqueid','origtransfererlinkedid','some','ATTENDED','[%s][voiceCallReport][attendedtransfer]','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','extension','[%s][voiceCallReport][blindtransfer]\x20event:','transfercalleridnum','transfereecalleridnum','BLIND','transfererchannel','transfereruniqueid','[%s][voiceCallReport][blindtransfer]','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','mohtime','[%s][voiceCallReport][musiconholdstop]','bluebird','lodash','moment','util','path','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../model/channel','../rpc/setting','unknown','not_inuse','inuse','busy','invalid','unavailable','ringing','ringinuse','set','queue','playback','FAILED','NO\x20ANSWER','ANSWERED','BUSY','defaults','redis','localhost','channels'];(function(_0x323bf6,_0x19aed6){var _0x18da88=function(_0x1111da){while(--_0x1111da){_0x323bf6['push'](_0x323bf6['shift']());}};_0x18da88(++_0x19aed6);}(_0xa236,0xb4));var _0x6a23=function(_0x2c96fd,_0x10369a){_0x2c96fd=_0x2c96fd-0x0;var _0x38ca61=_0xa236[_0x2c96fd];return _0x38ca61;};'use strict';var BPromise=require(_0x6a23('0x0'));var _=require(_0x6a23('0x1'));var moment=require(_0x6a23('0x2'));var util=require(_0x6a23('0x3'));var path=require(_0x6a23('0x4'));var Redis=require(_0x6a23('0x5'));var config=require(_0x6a23('0x6'));var logger=require(_0x6a23('0x7'))(_0x6a23('0x8'));var ami=require(_0x6a23('0x9'));var Channel=require(_0x6a23('0xa'));var RpcSetting=require(_0x6a23('0xb'));var statusDesc=[_0x6a23('0xc'),_0x6a23('0xd'),_0x6a23('0xe'),_0x6a23('0xf'),_0x6a23('0x10'),_0x6a23('0x11'),_0x6a23('0x12'),_0x6a23('0x13'),'onhold'];var applications=[_0x6a23('0x14'),_0x6a23('0x15'),'agi','dial',_0x6a23('0x16'),'voicemail'];var dispositions=['NO\x20ANSWER',_0x6a23('0x17'),'FAILED','NO\x20ANSWER',_0x6a23('0x18'),'NO\x20ANSWER',_0x6a23('0x19'),_0x6a23('0x1a'),_0x6a23('0x17'),_0x6a23('0x17'),'FAILED'];var actions={};config['redis']=_[_0x6a23('0x1b')](config[_0x6a23('0x1c')],{'host':_0x6a23('0x1d'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function VoiceCallReport(_0x4a37ba){this['channels']=_0x4a37ba[_0x6a23('0x1e')];this[_0x6a23('0x1f')]=_0x4a37ba[_0x6a23('0x1f')];this[_0x6a23('0x20')]={};ami['on'](_0x6a23('0x21'),this[_0x6a23('0x22')]['bind'](this));ami['on']('newexten',this[_0x6a23('0x22')][_0x6a23('0x23')](this));ami['on'](_0x6a23('0x24'),this[_0x6a23('0x25')]['bind'](this));ami['on'](_0x6a23('0x26'),this[_0x6a23('0x27')][_0x6a23('0x23')](this));ami['on']('varset',this[_0x6a23('0x28')]['bind'](this));ami['on'](_0x6a23('0x29'),this['syncHangup']['bind'](this));ami['on'](_0x6a23('0x2a'),this[_0x6a23('0x2b')]['bind'](this));ami['on'](_0x6a23('0x2c'),this['syncAttendedTransfer'][_0x6a23('0x23')](this));ami['on'](_0x6a23('0x2d'),this[_0x6a23('0x2e')][_0x6a23('0x23')](this));ami['on']('musiconholdstart',this[_0x6a23('0x2f')][_0x6a23('0x23')](this));ami['on'](_0x6a23('0x30'),this[_0x6a23('0x31')][_0x6a23('0x23')](this));try{logger[_0x6a23('0x32')](_0x6a23('0x33'));ami[_0x6a23('0x34')]();}catch(_0x1889d8){logger['error'](_0x6a23('0x35'),util[_0x6a23('0x36')](_0x1889d8,{'showHidden':![],'depth':null}));}}VoiceCallReport['prototype'][_0x6a23('0x37')]=function(_0x36f157){return _0x36f157!==null&&!_[_0x6a23('0x38')](_0x36f157);};VoiceCallReport['prototype']['emit']=function(_0x3a2c5e,_0x277dd3,_0x278edc){io['to'](_0x3a2c5e)[_0x6a23('0x39')](_0x277dd3,_0x278edc);};VoiceCallReport[_0x6a23('0x3a')][_0x6a23('0x2b')]=function(_0x368d9c){try{if(this[_0x6a23('0x37')](_0x368d9c)){logger['info'](_0x6a23('0x3b'),_0x368d9c[_0x6a23('0x3c')],_0x368d9c['calleridname'],_0x368d9c[_0x6a23('0x3d')]);logger[_0x6a23('0x3e')](_0x6a23('0x3f'),_0x368d9c[_0x6a23('0x3c')],util[_0x6a23('0x36')](_0x368d9c,{'showHidden':![],'depth':null}));if(_0x368d9c[_0x6a23('0x3c')]===_0x368d9c[_0x6a23('0x40')]){if(!_[_0x6a23('0x38')](this[_0x6a23('0x1e')][_0x368d9c[_0x6a23('0x3c')]])){_[_0x6a23('0x41')](this[_0x6a23('0x1e')][_0x368d9c[_0x6a23('0x3c')]],_[_0x6a23('0x42')](_0x368d9c,_[_0x6a23('0x43')](this[_0x6a23('0x1e')][_0x368d9c[_0x6a23('0x3c')]])));}}if(_0x368d9c[_0x6a23('0x44')]===_0x6a23('0x45')){if(this[_0x6a23('0x1f')][_0x368d9c['channel']['split']('-')[0x0]]){if(_0x368d9c[_0x6a23('0x46')]==_0x6a23('0x47')){this['agents'][_0x368d9c[_0x6a23('0x48')][_0x6a23('0x49')]('-')[0x0]][_0x6a23('0x4a')]=_0x368d9c['connectedlinenum'];this[_0x6a23('0x39')](util[_0x6a23('0x4b')](_0x6a23('0x4c'),this[_0x6a23('0x1f')][_0x368d9c[_0x6a23('0x48')][_0x6a23('0x49')]('-')[0x0]][_0x6a23('0x4d')]),_0x6a23('0x4e'),{'destaccountcode':this[_0x6a23('0x1f')][_0x368d9c[_0x6a23('0x48')][_0x6a23('0x49')]('-')[0x0]][_0x6a23('0x4f')],'destconnectedlinenum':_0x368d9c['connectedlinenum']});}}}}}catch(_0x3689b5){logger['error'](_0x6a23('0x50'),_0x368d9c['uniqueid'],util[_0x6a23('0x36')](_0x3689b5,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x6a23('0x3a')][_0x6a23('0x25')]=function(_0x36cacf){try{if(this[_0x6a23('0x37')](_0x36cacf)){logger[_0x6a23('0x3e')](_0x6a23('0x51'),_0x36cacf[_0x6a23('0x3c')],util[_0x6a23('0x36')](_0x36cacf,{'showHidden':![],'depth':null}));if(_0x36cacf[_0x6a23('0x3c')]===_0x36cacf[_0x6a23('0x40')]&&_0x36cacf[_0x6a23('0x48')]!=_0x6a23('0x52')){if(_[_0x6a23('0x38')](this['channels'][_0x36cacf[_0x6a23('0x3c')]])){logger['info'](_0x6a23('0x53'),_0x36cacf[_0x6a23('0x3c')],_0x36cacf[_0x6a23('0x44')],_0x36cacf['exten']);this['channels'][_0x36cacf[_0x6a23('0x3c')]]=new Channel();this[_0x6a23('0x1e')][_0x36cacf[_0x6a23('0x3c')]]['starttime']=moment()[_0x6a23('0x4b')](_0x6a23('0x54'));this[_0x6a23('0x1e')][_0x36cacf[_0x6a23('0x3c')]][_0x6a23('0x55')]=dispositions[_[_0x6a23('0x56')](_0x36cacf[_0x6a23('0x57')])];_[_0x6a23('0x41')](this['channels'][_0x36cacf[_0x6a23('0x3c')]],_[_0x6a23('0x42')](_0x36cacf,_[_0x6a23('0x43')](this[_0x6a23('0x1e')][_0x36cacf[_0x6a23('0x3c')]])));if(_0x36cacf['context']===_0x6a23('0x45')){if(this['agents'][_0x36cacf[_0x6a23('0x48')]['split']('-')[0x0]]){if(_[_0x6a23('0x38')](this[_0x6a23('0x1f')][_0x36cacf[_0x6a23('0x48')]['split']('-')[0x0]][_0x6a23('0x4a')])){this[_0x6a23('0x1f')][_0x36cacf[_0x6a23('0x48')][_0x6a23('0x49')]('-')[0x0]]['destconnectedlinenum']=_0x36cacf[_0x6a23('0x46')];logger[_0x6a23('0x3e')](_0x6a23('0x58'),_0x36cacf['uniqueid'],util[_0x6a23('0x36')]({'destaccountcode':this[_0x6a23('0x1f')][_0x36cacf[_0x6a23('0x48')][_0x6a23('0x49')]('-')[0x0]][_0x6a23('0x4f')],'destconnectedlinenum':_0x36cacf[_0x6a23('0x46')]},{'showHidden':![],'depth':null}));this[_0x6a23('0x39')](util['format']('user:%s',this[_0x6a23('0x1f')][_0x36cacf[_0x6a23('0x48')]['split']('-')[0x0]][_0x6a23('0x4d')]),_0x6a23('0x4e'),{'destaccountcode':this['agents'][_0x36cacf[_0x6a23('0x48')][_0x6a23('0x49')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x36cacf['exten']});}}}}}}}catch(_0x55d52f){logger[_0x6a23('0x59')]('[%s][voiceCallReport][newchannel]',_0x36cacf[_0x6a23('0x3c')],util[_0x6a23('0x36')](_0x55d52f,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x6a23('0x3a')][_0x6a23('0x22')]=function(_0x526b8f){try{if(this[_0x6a23('0x37')](_0x526b8f)){logger[_0x6a23('0x3e')](_0x6a23('0x5a'),_0x526b8f[_0x6a23('0x3c')],util[_0x6a23('0x36')](_0x526b8f,{'showHidden':![],'depth':null}));if(_0x526b8f[_0x6a23('0x3c')]===_0x526b8f['linkedid']&&_0x526b8f[_0x6a23('0x46')]!='h'&&_0x526b8f[_0x6a23('0x48')]!='OutgoingSpoolFailed'){_0x526b8f[_0x6a23('0x5b')]=_0x526b8f['application'][_0x6a23('0x5c')]();_0x526b8f[_0x6a23('0x5d')]=_0x526b8f[_0x6a23('0x5e')]&&_0x526b8f[_0x6a23('0x5e')]['startsWith'](_0x6a23('0x5f'))?_0x526b8f[_0x6a23('0x5e')]:(_0x526b8f[_0x6a23('0x5e')]||_0x526b8f[_0x6a23('0x5d')])[_0x6a23('0x5c')]();logger[_0x6a23('0x32')](_0x6a23('0x60'),_0x526b8f[_0x6a23('0x3c')],_0x526b8f[_0x6a23('0x5b')],_0x526b8f[_0x6a23('0x5d')]);if(_[_0x6a23('0x38')](this[_0x6a23('0x1e')][_0x526b8f['uniqueid']])){this['channels'][_0x526b8f[_0x6a23('0x3c')]]=new Channel();this['channels'][_0x526b8f[_0x6a23('0x3c')]][_0x6a23('0x61')]=_0x526b8f[_0x6a23('0x62')]?moment()[_0x6a23('0x63')](moment[_0x6a23('0x62')](_0x526b8f[_0x6a23('0x62')])['seconds'](),_0x6a23('0x64'))[_0x6a23('0x4b')](_0x6a23('0x54')):moment()[_0x6a23('0x4b')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x6a23('0x1e')][_0x526b8f[_0x6a23('0x3c')]][_0x6a23('0x55')]='NO\x20ANSWER';}_['merge'](this['channels'][_0x526b8f[_0x6a23('0x3c')]],_[_0x6a23('0x42')](_0x526b8f,_['keys'](this[_0x6a23('0x1e')][_0x526b8f[_0x6a23('0x3c')]])));if(_[_0x6a23('0x65')](applications,_0x526b8f[_0x6a23('0x5b')])){this[_0x6a23('0x1e')][_0x526b8f[_0x6a23('0x3c')]][_0x6a23('0x66')]=_0x526b8f[_0x6a23('0x5b')];this['channels'][_0x526b8f['uniqueid']][_0x6a23('0x67')]=_0x526b8f[_0x6a23('0x5d')];if(_0x526b8f[_0x6a23('0x5b')]==='set'&&_[_0x6a23('0x68')](_0x526b8f[_0x6a23('0x5d')]['toLowerCase'](),_0x6a23('0x69'))){var _0x2f0f7b=_0x526b8f[_0x6a23('0x5d')][_0x6a23('0x49')]('=');var _0x342303=_0x2f0f7b[0x0]['toLowerCase']()[_0x6a23('0x6a')](/cdr\((.*)\)/);if(_0x342303){this['channels'][_0x526b8f[_0x6a23('0x3c')]][_0x342303[0x1]]=_0x2f0f7b[0x1];}}else if(_0x526b8f['application']===_0x6a23('0x15')){this[_0x6a23('0x1e')][_0x526b8f[_0x6a23('0x3c')]][_0x6a23('0x15')]=_0x526b8f[_0x6a23('0x5d')]['split'](',')[0x0];}}}}}catch(_0x59adc3){logger[_0x6a23('0x59')](_0x6a23('0x6b'),_0x526b8f[_0x6a23('0x3c')],util[_0x6a23('0x36')](_0x59adc3,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x6a23('0x3a')][_0x6a23('0x27')]=function(_0x395f83){try{if(this[_0x6a23('0x37')](_0x395f83)){logger[_0x6a23('0x32')](_0x6a23('0x6c'),_0x395f83[_0x6a23('0x3c')],_0x395f83[_0x6a23('0x40')],_0x395f83['calleridname'],_0x395f83[_0x6a23('0x3d')]);logger[_0x6a23('0x3e')](_0x6a23('0x6d'),_0x395f83[_0x6a23('0x3c')],util[_0x6a23('0x36')](_0x395f83,{'showHidden':![],'depth':null}));if(_0x395f83['uniqueid']!==_0x395f83[_0x6a23('0x40')]){if(this[_0x6a23('0x1e')][_0x395f83[_0x6a23('0x40')]]){if(_0x395f83[_0x6a23('0x57')]==='6'){if(!this['channels'][_0x395f83[_0x6a23('0x40')]][_0x6a23('0x6e')]){var _0xc06d09=moment();this[_0x6a23('0x1e')][_0x395f83[_0x6a23('0x40')]]['answered']=!![];this[_0x6a23('0x1e')][_0x395f83[_0x6a23('0x40')]][_0x6a23('0x6f')]=_0xc06d09[_0x6a23('0x4b')](_0x6a23('0x54'));if(this[_0x6a23('0x1e')][_0x395f83[_0x6a23('0x40')]][_0x6a23('0x61')]){this['channels'][_0x395f83[_0x6a23('0x40')]][_0x6a23('0x70')]=_0xc06d09[_0x6a23('0x71')](this[_0x6a23('0x1e')][_0x395f83['linkedid']][_0x6a23('0x61')],_0x6a23('0x64'));}}this[_0x6a23('0x1e')][_0x395f83[_0x6a23('0x40')]][_0x6a23('0x40')]=_0x395f83[_0x6a23('0x3c')];if(_0x395f83[_0x6a23('0x3d')]!==_0x6a23('0x47')){this[_0x6a23('0x1e')][_0x395f83['linkedid']][_0x6a23('0x72')]=_0x395f83[_0x6a23('0x3d')];}this[_0x6a23('0x1e')][_0x395f83[_0x6a23('0x40')]][_0x6a23('0x73')]=_0x395f83[_0x6a23('0x74')];this['channels'][_0x395f83[_0x6a23('0x40')]][_0x6a23('0x75')]=_0x395f83[_0x6a23('0x48')];this[_0x6a23('0x1e')][_0x395f83[_0x6a23('0x40')]][_0x6a23('0x55')]=dispositions[_[_0x6a23('0x56')](_0x395f83[_0x6a23('0x57')])];if(this['agents'][_0x395f83['channel'][_0x6a23('0x49')]('-')[0x0]]){this[_0x6a23('0x1e')][_0x395f83[_0x6a23('0x40')]][_0x6a23('0x76')]=this[_0x6a23('0x1f')][_0x395f83[_0x6a23('0x48')][_0x6a23('0x49')]('-')[0x0]]['id'];this['channels'][_0x395f83[_0x6a23('0x40')]][_0x6a23('0x77')]=this[_0x6a23('0x1f')][_0x395f83[_0x6a23('0x48')]['split']('-')[0x0]][_0x6a23('0x4d')];}}}}else{if(this[_0x6a23('0x1e')][_0x395f83[_0x6a23('0x3c')]]){if(_0x395f83[_0x6a23('0x57')]==='6'){if(this[_0x6a23('0x1f')][_0x395f83['channel']['split']('-')[0x0]]){this['channels'][_0x395f83[_0x6a23('0x3c')]]['UserId']=this[_0x6a23('0x1f')][_0x395f83['channel'][_0x6a23('0x49')]('-')[0x0]]['id'];this[_0x6a23('0x1e')][_0x395f83['uniqueid']][_0x6a23('0x77')]=this[_0x6a23('0x1f')][_0x395f83[_0x6a23('0x48')]['split']('-')[0x0]]['name'];}}}}if(_0x395f83[_0x6a23('0x57')]==='6'&&_0x395f83[_0x6a23('0x44')]===_0x6a23('0x45')){if(this[_0x6a23('0x1f')][_0x395f83['channel'][_0x6a23('0x49')]('-')[0x0]]){this['agents'][_0x395f83[_0x6a23('0x48')]['split']('-')[0x0]]['destconnectedlinenum']=_0x395f83[_0x6a23('0x46')];var _0x4fd43f;if(this['channels'][_0x395f83[_0x6a23('0x3c')]])_0x4fd43f=this[_0x6a23('0x1e')][_0x395f83[_0x6a23('0x3c')]][_0x6a23('0x78')];else if(this[_0x6a23('0x1e')][_0x395f83['linkedid']])_0x4fd43f=this['channels'][_0x395f83[_0x6a23('0x40')]][_0x6a23('0x78')];logger[_0x6a23('0x3e')](_0x6a23('0x79'),_0x395f83[_0x6a23('0x3c')],util[_0x6a23('0x36')]({'destaccountcode':this[_0x6a23('0x1f')][_0x395f83[_0x6a23('0x48')]['split']('-')[0x0]][_0x6a23('0x4f')],'destconnectedlinenum':_0x395f83[_0x6a23('0x46')],'routealias':_0x4fd43f},{'showHidden':![],'depth':null}));this['emit'](util[_0x6a23('0x4b')]('user:%s',this['agents'][_0x395f83[_0x6a23('0x48')][_0x6a23('0x49')]('-')[0x0]][_0x6a23('0x4d')]),'user:agentconnect',{'destaccountcode':this[_0x6a23('0x1f')][_0x395f83['channel']['split']('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x395f83['exten'],'routealias':_0x4fd43f});}}}}catch(_0x2ae7be){logger[_0x6a23('0x59')](_0x6a23('0x7a'),_0x395f83[_0x6a23('0x3c')],util[_0x6a23('0x36')](_0x2ae7be,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x6a23('0x3a')][_0x6a23('0x7b')]=function(_0x3e060f,_0x4058d1){try{if(this['channels'][_0x3e060f]){logger[_0x6a23('0x32')](_0x6a23('0x7c'),_0x3e060f,_0x4058d1);this[_0x6a23('0x1e')][_0x3e060f][_0x6a23('0x7d')]=!![];if(_[_0x6a23('0x7e')](_0x4058d1,_0x6a23('0x7f'))){_0x4058d1=_0x4058d1['replace'](_0x6a23('0x7f'),'.WAV');}this[_0x6a23('0x1e')][_0x3e060f][_0x6a23('0x80')]=_0x4058d1;var _0x233605=_['find'](this[_0x6a23('0x1e')][_0x3e060f][_0x6a23('0x81')],{'filename':_0x4058d1});if(_[_0x6a23('0x82')](_0x233605)){this['channels'][_0x3e060f][_0x6a23('0x81')][_0x6a23('0x83')]({'filename':_0x4058d1,'createdAt':moment()[_0x6a23('0x4b')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':'','status':'rec'});}}}catch(_0x4b0533){logger['error'](_0x6a23('0x84'),_0x3e060f,util[_0x6a23('0x36')](_0x4b0533,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x6a23('0x3a')][_0x6a23('0x28')]=function(_0x6776bf){try{if(this[_0x6a23('0x37')](_0x6776bf)){logger['debug'](_0x6a23('0x85'),_0x6776bf[_0x6a23('0x3c')],util[_0x6a23('0x36')](_0x6776bf,{'showHidden':![],'depth':null}));if(this[_0x6a23('0x1e')][_0x6776bf[_0x6a23('0x3c')]]&&_0x6776bf[_0x6a23('0x48')]!=_0x6a23('0x52')){if(this[_0x6a23('0x37')](_0x6776bf['variable'])){if(this['isNotNull'](_0x6776bf[_0x6a23('0x86')][_0x6a23('0x87')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0x6776bf[_0x6a23('0x3c')],_0x6776bf[_0x6a23('0x88')]);this['syncMixMonitorFilename'](_0x6776bf[_0x6a23('0x3c')],_0x6776bf['value']);}else if(this[_0x6a23('0x37')](_0x6776bf[_0x6a23('0x86')][_0x6a23('0x89')])){logger[_0x6a23('0x32')](_0x6a23('0x8a'),_0x6776bf[_0x6a23('0x3c')],_0x6776bf['value']);this[_0x6a23('0x1e')][_0x6776bf[_0x6a23('0x3c')]][_0x6a23('0x3d')]=_0x6776bf[_0x6a23('0x88')];}else if(this[_0x6a23('0x37')](_0x6776bf[_0x6a23('0x86')][_0x6a23('0x8b')])){logger['info'](_0x6a23('0x8c'),_0x6776bf[_0x6a23('0x3c')],_0x6776bf['value']);this[_0x6a23('0x1e')][_0x6776bf['uniqueid']][_0x6a23('0x8d')]=_0x6776bf['value'];}else if(this['isNotNull'](_0x6776bf[_0x6a23('0x86')]['xmd-cdrtype'])){logger['info'](_0x6a23('0x8e'),_0x6776bf[_0x6a23('0x3c')],_0x6776bf[_0x6a23('0x88')]);this[_0x6a23('0x1e')][_0x6776bf['uniqueid']][_0x6a23('0x8f')]=_0x6776bf[_0x6a23('0x88')];}else if(this['isNotNull'](_0x6776bf[_0x6a23('0x86')][_0x6a23('0x90')])){logger[_0x6a23('0x32')]('[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s',_0x6776bf[_0x6a23('0x3c')],_0x6776bf[_0x6a23('0x88')]['split'](',')[0x0]);this[_0x6a23('0x1e')][_0x6776bf[_0x6a23('0x3c')]][_0x6a23('0x15')]=_0x6776bf[_0x6a23('0x88')][_0x6a23('0x49')](',')[0x0];}else if(this['isNotNull'](_0x6776bf[_0x6a23('0x86')]['xmd-originatecalleridnum'])){logger[_0x6a23('0x32')](_0x6a23('0x91'),_0x6776bf['uniqueid'],_0x6776bf[_0x6a23('0x88')]);this['channels'][_0x6776bf[_0x6a23('0x3c')]][_0x6a23('0x92')]=_0x6776bf[_0x6a23('0x88')];}else if(this[_0x6a23('0x37')](_0x6776bf[_0x6a23('0x86')][_0x6a23('0x93')])){logger[_0x6a23('0x32')]('[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s',_0x6776bf[_0x6a23('0x3c')],_0x6776bf[_0x6a23('0x88')]);this[_0x6a23('0x1e')][_0x6776bf['uniqueid']][_0x6a23('0x94')]=_0x6776bf[_0x6a23('0x88')];}else if(this[_0x6a23('0x37')](_0x6776bf[_0x6a23('0x86')][_0x6a23('0x95')])){logger['info'](_0x6a23('0x96'),_0x6776bf[_0x6a23('0x3c')],_0x6776bf['value']);this['channels'][_0x6776bf[_0x6a23('0x3c')]][_0x6a23('0x97')]=_0x6776bf['value'];}else if(this['isNotNull'](_0x6776bf[_0x6a23('0x86')][_0x6a23('0x98')])){logger[_0x6a23('0x32')](_0x6a23('0x99'),_0x6776bf[_0x6a23('0x3c')],_0x6776bf[_0x6a23('0x88')]);this[_0x6a23('0x1e')][_0x6776bf[_0x6a23('0x3c')]][_0x6a23('0x15')]=_0x6776bf['value'];}else if(this['isNotNull'](_0x6776bf[_0x6a23('0x86')][_0x6a23('0x9a')])){logger[_0x6a23('0x32')](_0x6a23('0x9b'),_0x6776bf[_0x6a23('0x3c')],_0x6776bf['value']);this[_0x6a23('0x1e')][_0x6776bf[_0x6a23('0x3c')]][_0x6a23('0x9c')]=_0x6776bf['value'];}}}else if(this[_0x6a23('0x37')](_0x6776bf[_0x6a23('0x86')][_0x6a23('0x87')])){if(_0x6776bf[_0x6a23('0x88')]){var _0x4aa3d6=path['parse'](_0x6776bf['value'])[_0x6a23('0x4d')];logger[_0x6a23('0x32')](_0x6a23('0x9d'),_0x4aa3d6,_0x6776bf[_0x6a23('0x88')]);this[_0x6a23('0x7b')](_0x4aa3d6,_0x6776bf[_0x6a23('0x88')]);}}else if(this[_0x6a23('0x1e')][_0x6776bf[_0x6a23('0x40')]]){if(this[_0x6a23('0x37')](_0x6776bf[_0x6a23('0x86')])){if(this[_0x6a23('0x37')](_0x6776bf[_0x6a23('0x86')][_0x6a23('0x9a')])){logger['info'](_0x6a23('0x9b'),_0x6776bf[_0x6a23('0x40')],_0x6776bf['value']);this['channels'][_0x6776bf[_0x6a23('0x40')]][_0x6a23('0x9e')]=_0x6776bf[_0x6a23('0x88')];}}}}}catch(_0x13e586){logger[_0x6a23('0x59')]('[%s][voiceCallReport][varset]',_0x6776bf[_0x6a23('0x3c')],util[_0x6a23('0x36')](_0x13e586,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x6a23('0x3a')][_0x6a23('0x9f')]=function(_0x1ed5b){try{if(this['isNotNull'](_0x1ed5b)){logger[_0x6a23('0x3e')](_0x6a23('0xa0'),_0x1ed5b[_0x6a23('0x3c')],util[_0x6a23('0x36')](_0x1ed5b,{'showHidden':![],'depth':null}));if(this[_0x6a23('0x1e')][_0x1ed5b[_0x6a23('0x3c')]]){logger[_0x6a23('0x32')](_0x6a23('0xa1'),_0x1ed5b[_0x6a23('0x3c')],_0x1ed5b[_0x6a23('0xa2')]);var _0x2718b3=moment();this[_0x6a23('0x1e')][_0x1ed5b['uniqueid']][_0x6a23('0xa3')]=_0x2718b3[_0x6a23('0x4b')](_0x6a23('0x54'));this[_0x6a23('0x1e')][_0x1ed5b['uniqueid']][_0x6a23('0x62')]=_0x2718b3[_0x6a23('0x71')](this[_0x6a23('0x1e')][_0x1ed5b[_0x6a23('0x3c')]]['starttime'],_0x6a23('0x64'));if(this[_0x6a23('0x1e')][_0x1ed5b[_0x6a23('0x3c')]][_0x6a23('0x6e')]){this[_0x6a23('0x1e')][_0x1ed5b['uniqueid']]['billableseconds']=_0x2718b3[_0x6a23('0x71')](this[_0x6a23('0x1e')][_0x1ed5b[_0x6a23('0x3c')]]['answertime'],'seconds');this[_0x6a23('0x1e')][_0x1ed5b[_0x6a23('0x3c')]][_0x6a23('0x70')]=this[_0x6a23('0x1e')][_0x1ed5b[_0x6a23('0x3c')]][_0x6a23('0x62')]-this[_0x6a23('0x1e')][_0x1ed5b[_0x6a23('0x3c')]][_0x6a23('0xa4')];}if(_0x1ed5b[_0x6a23('0x44')]===_0x6a23('0x45')){if(this['agents'][_0x1ed5b[_0x6a23('0x48')][_0x6a23('0x49')]('-')[0x0]]){this[_0x6a23('0x1f')][_0x1ed5b['channel']['split']('-')[0x0]]=_['omit'](this['agents'][_0x1ed5b['channel'][_0x6a23('0x49')]('-')[0x0]],[_0x6a23('0x4a')]);logger[_0x6a23('0x3e')](_0x6a23('0xa5'),_0x1ed5b['uniqueid'],util[_0x6a23('0x36')]({'id':this[_0x6a23('0x1f')][_0x1ed5b[_0x6a23('0x48')][_0x6a23('0x49')]('-')[0x0]]['id'],'destaccountcode':this[_0x6a23('0x1f')][_0x1ed5b[_0x6a23('0x48')]['split']('-')[0x0]][_0x6a23('0x4f')]},{'showHidden':![],'depth':null}));this[_0x6a23('0x39')](util[_0x6a23('0x4b')](_0x6a23('0x4c'),this['agents'][_0x1ed5b[_0x6a23('0x48')][_0x6a23('0x49')]('-')[0x0]][_0x6a23('0x4d')]),'user:agentcomplete',{'id':this[_0x6a23('0x1f')][_0x1ed5b[_0x6a23('0x48')][_0x6a23('0x49')]('-')[0x0]]['id'],'destaccountcode':this[_0x6a23('0x1f')][_0x1ed5b[_0x6a23('0x48')][_0x6a23('0x49')]('-')[0x0]][_0x6a23('0x4f')]});}}var _0x5492c8=this;Promise[_0x6a23('0xa6')]()[_0x6a23('0xa7')](function(){var _0x3589d3=_0x5492c8[_0x6a23('0x1e')][_0x1ed5b['uniqueid']];if(typeof _0x3589d3[_0x6a23('0xa8')]===_0x6a23('0xa9'))return;if(_['isEmpty'](_0x3589d3[_0x6a23('0x81')]))return;return RpcSetting[_0x6a23('0xaa')]()[_0x6a23('0xa7')](function(_0x176851){if(!_0x176851['stopRecordingOnTransfer'])return;return Promise[_0x6a23('0xa6')]()[_0x6a23('0xa7')](function(){return ami[_0x6a23('0xab')]({'action':_0x6a23('0xac'),'channel':_0x3589d3[_0x6a23('0x48')]})[_0x6a23('0xad')](function(){});})[_0x6a23('0xa7')](function(){return ami['Action']({'action':_0x6a23('0xac'),'channel':_0x3589d3[_0x6a23('0x75')]})[_0x6a23('0xad')](function(){})[_0x6a23('0xae')](function(){var _0x4ad1d1=_0x5492c8['agents'][_0x3589d3[_0x6a23('0x75')]['split']('-')[0x0]];if(!_0x4ad1d1)return;io[_0x6a23('0x39')](_0x6a23('0xaf'),{'agentId':_0x4ad1d1['id'],'uniqueid':_0x3589d3[_0x6a23('0x3c')]});});});});})['then'](function(){if(_0x1ed5b['event']===_0x6a23('0xb0')){_0x5492c8[_0x6a23('0x20')][_0x1ed5b[_0x6a23('0x3c')]]=_0x5492c8[_0x6a23('0x1e')][_0x1ed5b[_0x6a23('0x3c')]];}else{if(_0x5492c8[_0x6a23('0x1e')][_0x1ed5b[_0x6a23('0x3c')]][_0x6a23('0x8f')]===_0x6a23('0xb1')&&_0x5492c8[_0x6a23('0x20')][_0x1ed5b[_0x6a23('0x3c')]]){_0x5492c8[_0x6a23('0x1e')][_0x1ed5b[_0x6a23('0x3c')]][_0x6a23('0x3c')]=[_0x5492c8[_0x6a23('0x1e')][_0x1ed5b[_0x6a23('0x3c')]][_0x6a23('0x40')],_0x5492c8[_0x6a23('0x1e')][_0x1ed5b['uniqueid']][_0x6a23('0x40')]=_0x5492c8[_0x6a23('0x1e')][_0x1ed5b[_0x6a23('0x3c')]][_0x6a23('0x3c')]][0x0];delete _0x5492c8[_0x6a23('0x20')][_0x1ed5b['uniqueid']];}}logger['debug'](_0x6a23('0xb2'),_0x1ed5b[_0x6a23('0x3c')],util[_0x6a23('0x36')](_0x5492c8[_0x6a23('0x1e')][_0x1ed5b[_0x6a23('0x3c')]],{'showHidden':![],'depth':null}));ami[_0x6a23('0x39')](_0x6a23('0xb3'),_0x5492c8['channels'][_0x1ed5b[_0x6a23('0x3c')]]);delete _0x5492c8['channels'][_0x1ed5b[_0x6a23('0x3c')]];});}}}catch(_0x6632e7){logger[_0x6a23('0x59')](_0x6a23('0xb4'),_0x1ed5b[_0x6a23('0x3c')],util[_0x6a23('0x36')](_0x6632e7,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x6a23('0x3a')][_0x6a23('0xb5')]=function(_0x44269c){try{if(this[_0x6a23('0x37')](_0x44269c)){logger[_0x6a23('0x32')](_0x6a23('0xb6'),_0x44269c[_0x6a23('0x3c')],_0x44269c['origtransferercalleridnum'],_0x44269c['transfertargetcalleridnum']);logger[_0x6a23('0x3e')](_0x6a23('0xb7'),_0x44269c['uniqueid'],util[_0x6a23('0x36')](_0x44269c,{'showHidden':![],'depth':null}));if(this['channels'][_0x44269c[_0x6a23('0xb8')]]){this[_0x6a23('0x1e')][_0x44269c[_0x6a23('0xb8')]]['transfercalleridnum']=_0x44269c['origtransferercalleridnum'];this[_0x6a23('0x1e')][_0x44269c[_0x6a23('0xb8')]][_0x6a23('0xb9')]=_0x44269c[_0x6a23('0xba')];if(this['channels'][_0x44269c[_0x6a23('0xbb')]]){var _0x189170=this['channels'][_0x44269c[_0x6a23('0xbb')]];this['channels'][_0x44269c[_0x6a23('0xbb')]]=this[_0x6a23('0x1e')][_0x44269c['transfereeuniqueid']];this[_0x6a23('0x1e')][_0x44269c[_0x6a23('0xb8')]]=_0x189170;}}else if(this[_0x6a23('0x1e')][_0x44269c['transfertargetuniqueid']]){this['channels'][_0x44269c['transfertargetuniqueid']]['transfercalleridnum']=_0x44269c[_0x6a23('0xbc')];this[_0x6a23('0x1e')][_0x44269c[_0x6a23('0xbd')]]['transferconnectedlinenum']=_0x44269c['transfertargetcalleridnum'];if(this['channels'][_0x44269c[_0x6a23('0xbe')]]){var _0x189170=this[_0x6a23('0x1e')][_0x44269c['origtransfereruniqueid']];this[_0x6a23('0x1e')][_0x44269c['origtransfereruniqueid']]=this['channels'][_0x44269c[_0x6a23('0xbd')]];this['channels'][_0x44269c['transfertargetuniqueid']]=_0x189170;}}if((this[_0x6a23('0x1e')][_0x44269c['origtransfereruniqueid']]||this[_0x6a23('0x1e')][_0x44269c[_0x6a23('0xbf')]])&&this[_0x6a23('0x1e')][_0x44269c[_0x6a23('0xbb')]]){var _0x443509=_[_0x6a23('0xc0')]([this[_0x6a23('0x1e')][_0x44269c[_0x6a23('0xbe')]],this['channels'][_0x44269c[_0x6a23('0xbf')]],this[_0x6a23('0x1e')][_0x44269c[_0x6a23('0xbb')]]],function(_0x236683){return _0x236683&&_0x236683[_0x6a23('0x8f')]===_0x6a23('0xb1')&&_0x236683['routeid'];});if(_0x443509){if(this['channels'][_0x44269c[_0x6a23('0xbe')]])this[_0x6a23('0x1e')][_0x44269c[_0x6a23('0xbe')]]['transferType']=_0x6a23('0xc1');if(this[_0x6a23('0x1e')][_0x44269c[_0x6a23('0xbf')]])this['channels'][_0x44269c[_0x6a23('0xbf')]][_0x6a23('0xa8')]=_0x6a23('0xc1');this[_0x6a23('0x1e')][_0x44269c[_0x6a23('0xbb')]][_0x6a23('0xa8')]=_0x6a23('0xc1');}}}}catch(_0x43994d){logger[_0x6a23('0x59')](_0x6a23('0xc2'),_0x44269c[_0x6a23('0x3c')],util[_0x6a23('0x36')](_0x43994d,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x6a23('0x3a')][_0x6a23('0x2e')]=function(_0x5dfda6){try{if(this[_0x6a23('0x37')](_0x5dfda6)){logger[_0x6a23('0x32')](_0x6a23('0xc3'),_0x5dfda6[_0x6a23('0x3c')],_0x5dfda6['transfereecalleridnum'],_0x5dfda6[_0x6a23('0xc4')]);logger['debug'](_0x6a23('0xc5'),_0x5dfda6['uniqueid'],util[_0x6a23('0x36')](_0x5dfda6,{'showHidden':![],'depth':null}));if(this['channels'][_0x5dfda6[_0x6a23('0xb8')]]){this[_0x6a23('0x1e')][_0x5dfda6[_0x6a23('0xb8')]][_0x6a23('0xc6')]=_0x5dfda6[_0x6a23('0xc7')];this[_0x6a23('0x1e')][_0x5dfda6[_0x6a23('0xb8')]][_0x6a23('0xb9')]=_0x5dfda6[_0x6a23('0xc4')];this['channels'][_0x5dfda6[_0x6a23('0xb8')]]['transferType']=_0x6a23('0xc8');this[_0x6a23('0x9f')]({'event':_0x6a23('0xb0'),'uniqueid':_0x5dfda6[_0x6a23('0xb8')],'context':_0x5dfda6[_0x6a23('0x44')],'channel':_0x5dfda6[_0x6a23('0xc9')]});}else{this['channels'][_0x5dfda6[_0x6a23('0xca')]][_0x6a23('0xa8')]=_0x6a23('0xc8');}}}catch(_0x2f57b6){logger['error'](_0x6a23('0xcb'),_0x5dfda6['uniqueid'],util[_0x6a23('0x36')](_0x2f57b6,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x6a23('0x3a')][_0x6a23('0x2f')]=function(_0x265338){try{if(this['isNotNull'](_0x265338)){logger[_0x6a23('0x3e')]('[%s][voiceCallReport][musiconholdstart]\x20event:',_0x265338[_0x6a23('0x3c')],util[_0x6a23('0x36')](_0x265338,{'showHidden':![],'depth':null}));if(this[_0x6a23('0x1e')][_0x265338['uniqueid']]){if(!_['isNil'](this[_0x6a23('0x1e')][_0x265338[_0x6a23('0x3c')]][_0x6a23('0x6f')])){this['channels'][_0x265338[_0x6a23('0x3c')]][_0x6a23('0xcc')]=moment()[_0x6a23('0x4b')](_0x6a23('0x54'));logger[_0x6a23('0x32')](_0x6a23('0xcd'),_0x265338['uniqueid'],this['channels'][_0x265338[_0x6a23('0x3c')]]['mohstarttime']);}}}}catch(_0x526b74){logger[_0x6a23('0x59')](_0x6a23('0xce'),_0x265338[_0x6a23('0x3c')],util[_0x6a23('0x36')](_0x526b74,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x6a23('0x3a')]['syncMusicOnHoldStop']=function(_0x466c1a){try{if(this[_0x6a23('0x37')](_0x466c1a)){logger['debug'](_0x6a23('0xcf'),_0x466c1a[_0x6a23('0x3c')],util['inspect'](_0x466c1a,{'showHidden':![],'depth':null}));if(this['channels'][_0x466c1a[_0x6a23('0x3c')]]){if(!_[_0x6a23('0x82')](this['channels'][_0x466c1a[_0x6a23('0x3c')]][_0x6a23('0xcc')])){this[_0x6a23('0x1e')][_0x466c1a['uniqueid']]['mohtime']+=moment()['milliseconds'](0x0)[_0x6a23('0x71')](this[_0x6a23('0x1e')][_0x466c1a[_0x6a23('0x3c')]][_0x6a23('0xcc')],'seconds');logger[_0x6a23('0x32')](_0x6a23('0xd0'),_0x466c1a['uniqueid'],this[_0x6a23('0x1e')][_0x466c1a['uniqueid']][_0x6a23('0xd1')]);delete this[_0x6a23('0x1e')][_0x466c1a[_0x6a23('0x3c')]][_0x6a23('0xcc')];}}}}catch(_0x499ce4){logger['error'](_0x6a23('0xd2'),_0x466c1a[_0x6a23('0x3c')],util[_0x6a23('0x36')](_0x499ce4,{'showHidden':![],'depth':null}));}};module['exports']=VoiceCallReport; \ No newline at end of file +var _0xb80a=['[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','syncMusicOnHoldStop','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','[%s][voiceCallReport][musiconholdstop]','exports','bluebird','lodash','moment','path','ioredis','../../../config/environment','ami','../ami','../model/channel','../rpc/setting','unknown','not_inuse','inuse','invalid','unavailable','ringinuse','onhold','set','queue','agi','dial','playback','NO\x20ANSWER','FAILED','BUSY','redis','localhost','socket.io-emitter','channels','agents','blindTransfers','coreshowchannel','bind','syncNewChannel','newstate','syncNewState','varset','syncVarSet','syncHangup','newcallerid','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','syncMusicOnHoldStart','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','error','[voiceCallReport][coreshowchannels]','prototype','emit','isNotNull','info','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridname','calleridnum','debug','inspect','linkedid','isUndefined','keys','context','channel','split','exten','xcally-motion-preview','destconnectedlinenum','format','name','accountcode','connectedlinenum','[%s][voiceCallReport][newcallerid]','[%s][voiceCallReport][newchannel]\x20event:','OutgoingSpoolFailed','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','merge','pick','from-sip','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','user:%s','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','application','toLowerCase','applicationdata','appdata','startsWith','CDR(routeAlias)','duration','subtract','seconds','includes','lastapplication','lastdata','cdr(','match','[%s][voiceCallReport][newstate]\x20event:','channelstate','answered','answertime','holdtime','starttime','connectedlinename','UserId','membername','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','user:agentconnect','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','.wav49','replace','.WAV','find','isNil','push','rec','[%s][voiceCallReport][mixMonitorFilename]','[%s][voiceCallReport][varset]\x20event:','variable','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','xmd-cdrtype','type','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','sipcalluniqueid','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20event:','endtime','diff','billableseconds','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','resolve','transferType','undefined','isEmpty','monitors','getSettings','then','stopRecordingOnTransfer','Action','StopMixMonitor','catch','destinationchannel','webbar:stopmonitors','event','outbound','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','[%s][voiceCallReport][hangup]','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','transfertargetcalleridnum','transfereeuniqueid','transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','transfercalleridnum','origtransfereruniqueid','origtransfererlinkedid','some','routeid','ATTENDED','[%s][voiceCallReport][attendedtransfer]','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','transfereruniqueid','BLIND'];(function(_0x6f9302,_0x2e6647){var _0x29b129=function(_0xc1e51e){while(--_0xc1e51e){_0x6f9302['push'](_0x6f9302['shift']());}};_0x29b129(++_0x2e6647);}(_0xb80a,0xd5));var _0xab80=function(_0x31f17f,_0x28fb36){_0x31f17f=_0x31f17f-0x0;var _0x23ce05=_0xb80a[_0x31f17f];return _0x23ce05;};'use strict';var BPromise=require(_0xab80('0x0'));var _=require(_0xab80('0x1'));var moment=require(_0xab80('0x2'));var util=require('util');var path=require(_0xab80('0x3'));var Redis=require(_0xab80('0x4'));var config=require(_0xab80('0x5'));var logger=require('../../../config/logger')(_0xab80('0x6'));var ami=require(_0xab80('0x7'));var Channel=require(_0xab80('0x8'));var RpcSetting=require(_0xab80('0x9'));var statusDesc=[_0xab80('0xa'),_0xab80('0xb'),_0xab80('0xc'),'busy',_0xab80('0xd'),_0xab80('0xe'),'ringing',_0xab80('0xf'),_0xab80('0x10')];var applications=[_0xab80('0x11'),_0xab80('0x12'),_0xab80('0x13'),_0xab80('0x14'),_0xab80('0x15'),'voicemail'];var dispositions=[_0xab80('0x16'),_0xab80('0x17'),_0xab80('0x17'),_0xab80('0x16'),_0xab80('0x16'),_0xab80('0x16'),'ANSWERED',_0xab80('0x18'),_0xab80('0x17'),'FAILED',_0xab80('0x17')];var actions={};config[_0xab80('0x19')]=_['defaults'](config[_0xab80('0x19')],{'host':_0xab80('0x1a'),'port':0x18eb});var io=require(_0xab80('0x1b'))(new Redis(config[_0xab80('0x19')]));function VoiceCallReport(_0x35f184){this[_0xab80('0x1c')]=_0x35f184[_0xab80('0x1c')];this[_0xab80('0x1d')]=_0x35f184['agents'];this[_0xab80('0x1e')]={};ami['on'](_0xab80('0x1f'),this['syncNewExten'][_0xab80('0x20')](this));ami['on']('newexten',this['syncNewExten']['bind'](this));ami['on']('newchannel',this[_0xab80('0x21')][_0xab80('0x20')](this));ami['on'](_0xab80('0x22'),this[_0xab80('0x23')][_0xab80('0x20')](this));ami['on'](_0xab80('0x24'),this[_0xab80('0x25')][_0xab80('0x20')](this));ami['on']('hangup',this[_0xab80('0x26')]['bind'](this));ami['on'](_0xab80('0x27'),this[_0xab80('0x28')]['bind'](this));ami['on'](_0xab80('0x29'),this[_0xab80('0x2a')][_0xab80('0x20')](this));ami['on'](_0xab80('0x2b'),this[_0xab80('0x2c')]['bind'](this));ami['on']('musiconholdstart',this[_0xab80('0x2d')][_0xab80('0x20')](this));ami['on']('musiconholdstop',this['syncMusicOnHoldStop']['bind'](this));try{logger['info'](_0xab80('0x2e'));ami[_0xab80('0x2f')]();}catch(_0x368828){logger[_0xab80('0x30')](_0xab80('0x31'),util['inspect'](_0x368828,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0xab80('0x32')]['isNotNull']=function(_0xa528d0){return _0xa528d0!==null&&!_['isUndefined'](_0xa528d0);};VoiceCallReport[_0xab80('0x32')][_0xab80('0x33')]=function(_0x5365a7,_0x1a55a9,_0x16a921){io['to'](_0x5365a7)['emit'](_0x1a55a9,_0x16a921);};VoiceCallReport['prototype'][_0xab80('0x28')]=function(_0x56e1a7){try{if(this[_0xab80('0x34')](_0x56e1a7)){logger[_0xab80('0x35')](_0xab80('0x36'),_0x56e1a7[_0xab80('0x37')],_0x56e1a7[_0xab80('0x38')],_0x56e1a7[_0xab80('0x39')]);logger[_0xab80('0x3a')]('[%s][voiceCallReport][newcallerid]\x20event:',_0x56e1a7[_0xab80('0x37')],util[_0xab80('0x3b')](_0x56e1a7,{'showHidden':![],'depth':null}));if(_0x56e1a7[_0xab80('0x37')]===_0x56e1a7[_0xab80('0x3c')]){if(!_[_0xab80('0x3d')](this[_0xab80('0x1c')][_0x56e1a7['uniqueid']])){_['merge'](this['channels'][_0x56e1a7['uniqueid']],_['pick'](_0x56e1a7,_[_0xab80('0x3e')](this[_0xab80('0x1c')][_0x56e1a7[_0xab80('0x37')]])));}}if(_0x56e1a7[_0xab80('0x3f')]==='from-sip'){if(this[_0xab80('0x1d')][_0x56e1a7[_0xab80('0x40')][_0xab80('0x41')]('-')[0x0]]){if(_0x56e1a7[_0xab80('0x42')]==_0xab80('0x43')){this[_0xab80('0x1d')][_0x56e1a7[_0xab80('0x40')][_0xab80('0x41')]('-')[0x0]][_0xab80('0x44')]=_0x56e1a7['connectedlinenum'];this[_0xab80('0x33')](util[_0xab80('0x45')]('user:%s',this[_0xab80('0x1d')][_0x56e1a7[_0xab80('0x40')][_0xab80('0x41')]('-')[0x0]][_0xab80('0x46')]),'user:agentconnect',{'destaccountcode':this[_0xab80('0x1d')][_0x56e1a7[_0xab80('0x40')][_0xab80('0x41')]('-')[0x0]][_0xab80('0x47')],'destconnectedlinenum':_0x56e1a7[_0xab80('0x48')]});}}}}}catch(_0x35f5ce){logger[_0xab80('0x30')](_0xab80('0x49'),_0x56e1a7[_0xab80('0x37')],util[_0xab80('0x3b')](_0x35f5ce,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xab80('0x32')][_0xab80('0x21')]=function(_0x32325f){try{if(this[_0xab80('0x34')](_0x32325f)){logger[_0xab80('0x3a')](_0xab80('0x4a'),_0x32325f[_0xab80('0x37')],util[_0xab80('0x3b')](_0x32325f,{'showHidden':![],'depth':null}));if(_0x32325f['uniqueid']===_0x32325f[_0xab80('0x3c')]&&_0x32325f[_0xab80('0x40')]!=_0xab80('0x4b')){if(_[_0xab80('0x3d')](this[_0xab80('0x1c')][_0x32325f[_0xab80('0x37')]])){logger[_0xab80('0x35')]('[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s',_0x32325f[_0xab80('0x37')],_0x32325f['context'],_0x32325f[_0xab80('0x42')]);this[_0xab80('0x1c')][_0x32325f[_0xab80('0x37')]]=new Channel();this[_0xab80('0x1c')][_0x32325f[_0xab80('0x37')]]['starttime']=moment()[_0xab80('0x45')](_0xab80('0x4c'));this['channels'][_0x32325f['uniqueid']][_0xab80('0x4d')]=dispositions[_[_0xab80('0x4e')](_0x32325f['channelstate'])];_[_0xab80('0x4f')](this['channels'][_0x32325f[_0xab80('0x37')]],_[_0xab80('0x50')](_0x32325f,_[_0xab80('0x3e')](this[_0xab80('0x1c')][_0x32325f[_0xab80('0x37')]])));if(_0x32325f[_0xab80('0x3f')]===_0xab80('0x51')){if(this[_0xab80('0x1d')][_0x32325f[_0xab80('0x40')][_0xab80('0x41')]('-')[0x0]]){if(_[_0xab80('0x3d')](this[_0xab80('0x1d')][_0x32325f[_0xab80('0x40')][_0xab80('0x41')]('-')[0x0]][_0xab80('0x44')])){this[_0xab80('0x1d')][_0x32325f['channel'][_0xab80('0x41')]('-')[0x0]][_0xab80('0x44')]=_0x32325f[_0xab80('0x42')];logger[_0xab80('0x3a')](_0xab80('0x52'),_0x32325f[_0xab80('0x37')],util['inspect']({'destaccountcode':this[_0xab80('0x1d')][_0x32325f[_0xab80('0x40')][_0xab80('0x41')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x32325f[_0xab80('0x42')]},{'showHidden':![],'depth':null}));this[_0xab80('0x33')](util[_0xab80('0x45')](_0xab80('0x53'),this['agents'][_0x32325f[_0xab80('0x40')][_0xab80('0x41')]('-')[0x0]][_0xab80('0x46')]),'user:agentconnect',{'destaccountcode':this[_0xab80('0x1d')][_0x32325f[_0xab80('0x40')][_0xab80('0x41')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x32325f[_0xab80('0x42')]});}}}}}}}catch(_0x525ed9){logger[_0xab80('0x30')](_0xab80('0x54'),_0x32325f[_0xab80('0x37')],util['inspect'](_0x525ed9,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncNewExten']=function(_0x175422){try{if(this[_0xab80('0x34')](_0x175422)){logger[_0xab80('0x3a')](_0xab80('0x55'),_0x175422[_0xab80('0x37')],util[_0xab80('0x3b')](_0x175422,{'showHidden':![],'depth':null}));if(_0x175422[_0xab80('0x37')]===_0x175422[_0xab80('0x3c')]&&_0x175422['exten']!='h'&&_0x175422[_0xab80('0x40')]!=_0xab80('0x4b')){_0x175422[_0xab80('0x56')]=_0x175422[_0xab80('0x56')][_0xab80('0x57')]();_0x175422[_0xab80('0x58')]=_0x175422[_0xab80('0x59')]&&_0x175422[_0xab80('0x59')][_0xab80('0x5a')](_0xab80('0x5b'))?_0x175422[_0xab80('0x59')]:(_0x175422[_0xab80('0x59')]||_0x175422[_0xab80('0x58')])[_0xab80('0x57')]();logger[_0xab80('0x35')]('[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s',_0x175422[_0xab80('0x37')],_0x175422['application'],_0x175422[_0xab80('0x58')]);if(_['isUndefined'](this[_0xab80('0x1c')][_0x175422['uniqueid']])){this[_0xab80('0x1c')][_0x175422[_0xab80('0x37')]]=new Channel();this[_0xab80('0x1c')][_0x175422[_0xab80('0x37')]]['starttime']=_0x175422[_0xab80('0x5c')]?moment()[_0xab80('0x5d')](moment[_0xab80('0x5c')](_0x175422['duration'])[_0xab80('0x5e')](),_0xab80('0x5e'))[_0xab80('0x45')]('YYYY-MM-DD\x20HH:mm:ss'):moment()['format'](_0xab80('0x4c'));this[_0xab80('0x1c')][_0x175422[_0xab80('0x37')]][_0xab80('0x4d')]='NO\x20ANSWER';}_['merge'](this['channels'][_0x175422[_0xab80('0x37')]],_['pick'](_0x175422,_[_0xab80('0x3e')](this['channels'][_0x175422[_0xab80('0x37')]])));if(_[_0xab80('0x5f')](applications,_0x175422[_0xab80('0x56')])){this[_0xab80('0x1c')][_0x175422[_0xab80('0x37')]][_0xab80('0x60')]=_0x175422[_0xab80('0x56')];this[_0xab80('0x1c')][_0x175422[_0xab80('0x37')]][_0xab80('0x61')]=_0x175422[_0xab80('0x58')];if(_0x175422[_0xab80('0x56')]==='set'&&_['startsWith'](_0x175422[_0xab80('0x58')][_0xab80('0x57')](),_0xab80('0x62'))){var _0x5ab848=_0x175422['applicationdata'][_0xab80('0x41')]('=');var _0x20380e=_0x5ab848[0x0]['toLowerCase']()[_0xab80('0x63')](/cdr\((.*)\)/);if(_0x20380e){this[_0xab80('0x1c')][_0x175422[_0xab80('0x37')]][_0x20380e[0x1]]=_0x5ab848[0x1];}}else if(_0x175422[_0xab80('0x56')]===_0xab80('0x12')){this[_0xab80('0x1c')][_0x175422[_0xab80('0x37')]][_0xab80('0x12')]=_0x175422[_0xab80('0x58')]['split'](',')[0x0];}}}}}catch(_0x1c624f){logger[_0xab80('0x30')]('[%s][voiceCallReport][newexten]',_0x175422[_0xab80('0x37')],util['inspect'](_0x1c624f,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xab80('0x23')]=function(_0x15545d){try{if(this['isNotNull'](_0x15545d)){logger[_0xab80('0x35')]('[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s',_0x15545d[_0xab80('0x37')],_0x15545d['linkedid'],_0x15545d[_0xab80('0x38')],_0x15545d[_0xab80('0x39')]);logger[_0xab80('0x3a')](_0xab80('0x64'),_0x15545d[_0xab80('0x37')],util[_0xab80('0x3b')](_0x15545d,{'showHidden':![],'depth':null}));if(_0x15545d['uniqueid']!==_0x15545d[_0xab80('0x3c')]){if(this[_0xab80('0x1c')][_0x15545d[_0xab80('0x3c')]]){if(_0x15545d[_0xab80('0x65')]==='6'){if(!this[_0xab80('0x1c')][_0x15545d['linkedid']]['answered']){var _0x1e83f3=moment();this[_0xab80('0x1c')][_0x15545d['linkedid']][_0xab80('0x66')]=!![];this['channels'][_0x15545d[_0xab80('0x3c')]][_0xab80('0x67')]=_0x1e83f3[_0xab80('0x45')]('YYYY-MM-DD\x20HH:mm:ss');if(this['channels'][_0x15545d[_0xab80('0x3c')]]['starttime']){this[_0xab80('0x1c')][_0x15545d[_0xab80('0x3c')]][_0xab80('0x68')]=_0x1e83f3['diff'](this[_0xab80('0x1c')][_0x15545d[_0xab80('0x3c')]][_0xab80('0x69')],'seconds');}}this['channels'][_0x15545d[_0xab80('0x3c')]][_0xab80('0x3c')]=_0x15545d[_0xab80('0x37')];if(_0x15545d[_0xab80('0x39')]!==_0xab80('0x43')){this[_0xab80('0x1c')][_0x15545d[_0xab80('0x3c')]][_0xab80('0x48')]=_0x15545d[_0xab80('0x39')];}this['channels'][_0x15545d[_0xab80('0x3c')]][_0xab80('0x6a')]=_0x15545d[_0xab80('0x38')];this[_0xab80('0x1c')][_0x15545d[_0xab80('0x3c')]]['destinationchannel']=_0x15545d[_0xab80('0x40')];this[_0xab80('0x1c')][_0x15545d['linkedid']][_0xab80('0x4d')]=dispositions[_[_0xab80('0x4e')](_0x15545d['channelstate'])];if(this['agents'][_0x15545d['channel'][_0xab80('0x41')]('-')[0x0]]){this[_0xab80('0x1c')][_0x15545d[_0xab80('0x3c')]][_0xab80('0x6b')]=this[_0xab80('0x1d')][_0x15545d['channel'][_0xab80('0x41')]('-')[0x0]]['id'];this['channels'][_0x15545d[_0xab80('0x3c')]][_0xab80('0x6c')]=this[_0xab80('0x1d')][_0x15545d[_0xab80('0x40')][_0xab80('0x41')]('-')[0x0]]['name'];}}}}else{if(this['channels'][_0x15545d['uniqueid']]){if(_0x15545d[_0xab80('0x65')]==='6'){if(this['agents'][_0x15545d[_0xab80('0x40')][_0xab80('0x41')]('-')[0x0]]){this[_0xab80('0x1c')][_0x15545d[_0xab80('0x37')]][_0xab80('0x6b')]=this[_0xab80('0x1d')][_0x15545d[_0xab80('0x40')][_0xab80('0x41')]('-')[0x0]]['id'];this[_0xab80('0x1c')][_0x15545d['uniqueid']][_0xab80('0x6c')]=this[_0xab80('0x1d')][_0x15545d[_0xab80('0x40')][_0xab80('0x41')]('-')[0x0]][_0xab80('0x46')];}}}}if(_0x15545d['channelstate']==='6'&&_0x15545d[_0xab80('0x3f')]==='from-sip'){if(this[_0xab80('0x1d')][_0x15545d[_0xab80('0x40')]['split']('-')[0x0]]){this[_0xab80('0x1d')][_0x15545d[_0xab80('0x40')]['split']('-')[0x0]][_0xab80('0x44')]=_0x15545d[_0xab80('0x42')];var _0x4dc0ac;if(this[_0xab80('0x1c')][_0x15545d['uniqueid']])_0x4dc0ac=this['channels'][_0x15545d[_0xab80('0x37')]][_0xab80('0x6d')];else if(this['channels'][_0x15545d[_0xab80('0x3c')]])_0x4dc0ac=this[_0xab80('0x1c')][_0x15545d[_0xab80('0x3c')]][_0xab80('0x6d')];logger[_0xab80('0x3a')](_0xab80('0x6e'),_0x15545d[_0xab80('0x37')],util[_0xab80('0x3b')]({'destaccountcode':this[_0xab80('0x1d')][_0x15545d[_0xab80('0x40')][_0xab80('0x41')]('-')[0x0]][_0xab80('0x47')],'destconnectedlinenum':_0x15545d[_0xab80('0x42')],'routealias':_0x4dc0ac},{'showHidden':![],'depth':null}));this[_0xab80('0x33')](util[_0xab80('0x45')](_0xab80('0x53'),this[_0xab80('0x1d')][_0x15545d[_0xab80('0x40')][_0xab80('0x41')]('-')[0x0]]['name']),_0xab80('0x6f'),{'destaccountcode':this[_0xab80('0x1d')][_0x15545d[_0xab80('0x40')][_0xab80('0x41')]('-')[0x0]][_0xab80('0x47')],'destconnectedlinenum':_0x15545d[_0xab80('0x42')],'routealias':_0x4dc0ac});}}}}catch(_0x3203d3){logger['error'](_0xab80('0x70'),_0x15545d[_0xab80('0x37')],util[_0xab80('0x3b')](_0x3203d3,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xab80('0x32')][_0xab80('0x71')]=function(_0x459d1c,_0x500085){try{if(this[_0xab80('0x1c')][_0x459d1c]){logger['info'](_0xab80('0x72'),_0x459d1c,_0x500085);this[_0xab80('0x1c')][_0x459d1c][_0xab80('0x73')]=!![];if(_['endsWith'](_0x500085,_0xab80('0x74'))){_0x500085=_0x500085[_0xab80('0x75')](_0xab80('0x74'),_0xab80('0x76'));}this[_0xab80('0x1c')][_0x459d1c]['monitorFilename']=_0x500085;var _0x56c590=_[_0xab80('0x77')](this[_0xab80('0x1c')][_0x459d1c]['monitors'],{'filename':_0x500085});if(_[_0xab80('0x78')](_0x56c590)){this[_0xab80('0x1c')][_0x459d1c]['monitors'][_0xab80('0x79')]({'filename':_0x500085,'createdAt':moment()[_0xab80('0x45')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':'','status':_0xab80('0x7a')});}}}catch(_0x3b5ef4){logger[_0xab80('0x30')](_0xab80('0x7b'),_0x459d1c,util[_0xab80('0x3b')](_0x3b5ef4,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xab80('0x32')]['syncVarSet']=function(_0x132967){try{if(this[_0xab80('0x34')](_0x132967)){logger[_0xab80('0x3a')](_0xab80('0x7c'),_0x132967[_0xab80('0x37')],util['inspect'](_0x132967,{'showHidden':![],'depth':null}));if(this[_0xab80('0x1c')][_0x132967[_0xab80('0x37')]]&&_0x132967[_0xab80('0x40')]!=_0xab80('0x4b')){if(this[_0xab80('0x34')](_0x132967[_0xab80('0x7d')])){if(this[_0xab80('0x34')](_0x132967[_0xab80('0x7d')]['mixmonitor_filename'])){logger['info'](_0xab80('0x7e'),_0x132967[_0xab80('0x37')],_0x132967[_0xab80('0x7f')]);this[_0xab80('0x71')](_0x132967[_0xab80('0x37')],_0x132967[_0xab80('0x7f')]);}else if(this[_0xab80('0x34')](_0x132967[_0xab80('0x7d')][_0xab80('0x80')])){logger[_0xab80('0x35')](_0xab80('0x81'),_0x132967[_0xab80('0x37')],_0x132967[_0xab80('0x7f')]);this[_0xab80('0x1c')][_0x132967[_0xab80('0x37')]][_0xab80('0x39')]=_0x132967['value'];}else if(this['isNotNull'](_0x132967[_0xab80('0x7d')][_0xab80('0x82')])){logger[_0xab80('0x35')](_0xab80('0x83'),_0x132967[_0xab80('0x37')],_0x132967[_0xab80('0x7f')]);this[_0xab80('0x1c')][_0x132967[_0xab80('0x37')]][_0xab80('0x84')]=_0x132967[_0xab80('0x7f')];}else if(this[_0xab80('0x34')](_0x132967['variable'][_0xab80('0x85')])){logger[_0xab80('0x35')]('[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x132967[_0xab80('0x37')],_0x132967[_0xab80('0x7f')]);this[_0xab80('0x1c')][_0x132967[_0xab80('0x37')]][_0xab80('0x86')]=_0x132967['value'];}else if(this['isNotNull'](_0x132967[_0xab80('0x7d')][_0xab80('0x87')])){logger[_0xab80('0x35')](_0xab80('0x88'),_0x132967['uniqueid'],_0x132967[_0xab80('0x7f')][_0xab80('0x41')](',')[0x0]);this['channels'][_0x132967['uniqueid']][_0xab80('0x12')]=_0x132967[_0xab80('0x7f')][_0xab80('0x41')](',')[0x0];}else if(this[_0xab80('0x34')](_0x132967[_0xab80('0x7d')][_0xab80('0x89')])){logger[_0xab80('0x35')]('[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x132967[_0xab80('0x37')],_0x132967[_0xab80('0x7f')]);this[_0xab80('0x1c')][_0x132967[_0xab80('0x37')]][_0xab80('0x8a')]=_0x132967['value'];}else if(this[_0xab80('0x34')](_0x132967['variable']['xmd-destination'])){logger[_0xab80('0x35')](_0xab80('0x8b'),_0x132967['uniqueid'],_0x132967[_0xab80('0x7f')]);this[_0xab80('0x1c')][_0x132967[_0xab80('0x37')]]['destination']=_0x132967['value'];}else if(this['isNotNull'](_0x132967[_0xab80('0x7d')]['xmd-callerid-preview'])){logger[_0xab80('0x35')](_0xab80('0x8c'),_0x132967[_0xab80('0x37')],_0x132967['value']);this[_0xab80('0x1c')][_0x132967[_0xab80('0x37')]][_0xab80('0x8d')]=_0x132967[_0xab80('0x7f')];}else if(this[_0xab80('0x34')](_0x132967[_0xab80('0x7d')][_0xab80('0x8e')])){logger['info'](_0xab80('0x8f'),_0x132967[_0xab80('0x37')],_0x132967[_0xab80('0x7f')]);this['channels'][_0x132967['uniqueid']][_0xab80('0x12')]=_0x132967['value'];}else if(this[_0xab80('0x34')](_0x132967['variable'][_0xab80('0x90')])){logger[_0xab80('0x35')]('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0x132967['uniqueid'],_0x132967['value']);this[_0xab80('0x1c')][_0x132967[_0xab80('0x37')]][_0xab80('0x91')]=_0x132967['value'];}}}else if(this[_0xab80('0x34')](_0x132967[_0xab80('0x7d')][_0xab80('0x92')])){if(_0x132967['value']){var _0xb4c5a3=path['parse'](_0x132967[_0xab80('0x7f')])[_0xab80('0x46')];logger[_0xab80('0x35')](_0xab80('0x7e'),_0xb4c5a3,_0x132967[_0xab80('0x7f')]);this[_0xab80('0x71')](_0xb4c5a3,_0x132967[_0xab80('0x7f')]);}}else if(this[_0xab80('0x1c')][_0x132967['linkedid']]){if(this[_0xab80('0x34')](_0x132967[_0xab80('0x7d')])){if(this['isNotNull'](_0x132967[_0xab80('0x7d')][_0xab80('0x90')])){logger['info'](_0xab80('0x93'),_0x132967[_0xab80('0x3c')],_0x132967[_0xab80('0x7f')]);this['channels'][_0x132967['linkedid']][_0xab80('0x94')]=_0x132967[_0xab80('0x7f')];}}}}}catch(_0x326e52){logger[_0xab80('0x30')](_0xab80('0x95'),_0x132967['uniqueid'],util[_0xab80('0x3b')](_0x326e52,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xab80('0x26')]=function(_0x557a1a){try{if(this[_0xab80('0x34')](_0x557a1a)){logger[_0xab80('0x3a')](_0xab80('0x96'),_0x557a1a[_0xab80('0x37')],util['inspect'](_0x557a1a,{'showHidden':![],'depth':null}));if(this[_0xab80('0x1c')][_0x557a1a[_0xab80('0x37')]]){logger[_0xab80('0x35')]('[%s][voiceCallReport][hangup]\x20reason:%s',_0x557a1a[_0xab80('0x37')],_0x557a1a['cause-txt']);var _0x5a8393=moment();this[_0xab80('0x1c')][_0x557a1a[_0xab80('0x37')]][_0xab80('0x97')]=_0x5a8393['format'](_0xab80('0x4c'));this[_0xab80('0x1c')][_0x557a1a['uniqueid']]['duration']=_0x5a8393[_0xab80('0x98')](this[_0xab80('0x1c')][_0x557a1a[_0xab80('0x37')]][_0xab80('0x69')],_0xab80('0x5e'));if(this[_0xab80('0x1c')][_0x557a1a[_0xab80('0x37')]]['answered']){this['channels'][_0x557a1a['uniqueid']][_0xab80('0x99')]=_0x5a8393[_0xab80('0x98')](this[_0xab80('0x1c')][_0x557a1a[_0xab80('0x37')]][_0xab80('0x67')],_0xab80('0x5e'));this[_0xab80('0x1c')][_0x557a1a[_0xab80('0x37')]][_0xab80('0x68')]=this[_0xab80('0x1c')][_0x557a1a[_0xab80('0x37')]][_0xab80('0x5c')]-this[_0xab80('0x1c')][_0x557a1a[_0xab80('0x37')]][_0xab80('0x99')];}if(_0x557a1a['context']===_0xab80('0x51')){if(this['agents'][_0x557a1a[_0xab80('0x40')][_0xab80('0x41')]('-')[0x0]]){this[_0xab80('0x1d')][_0x557a1a['channel']['split']('-')[0x0]]=_[_0xab80('0x9a')](this[_0xab80('0x1d')][_0x557a1a[_0xab80('0x40')][_0xab80('0x41')]('-')[0x0]],[_0xab80('0x44')]);logger[_0xab80('0x3a')](_0xab80('0x9b'),_0x557a1a[_0xab80('0x37')],util['inspect']({'id':this[_0xab80('0x1d')][_0x557a1a['channel'][_0xab80('0x41')]('-')[0x0]]['id'],'destaccountcode':this[_0xab80('0x1d')][_0x557a1a[_0xab80('0x40')][_0xab80('0x41')]('-')[0x0]]['accountcode']},{'showHidden':![],'depth':null}));this[_0xab80('0x33')](util['format'](_0xab80('0x53'),this[_0xab80('0x1d')][_0x557a1a[_0xab80('0x40')]['split']('-')[0x0]]['name']),_0xab80('0x9c'),{'id':this[_0xab80('0x1d')][_0x557a1a['channel'][_0xab80('0x41')]('-')[0x0]]['id'],'destaccountcode':this[_0xab80('0x1d')][_0x557a1a[_0xab80('0x40')][_0xab80('0x41')]('-')[0x0]]['accountcode']});}}var _0x41edd7=this;Promise[_0xab80('0x9d')]()['then'](function(){var _0x10297d=_0x41edd7[_0xab80('0x1c')][_0x557a1a[_0xab80('0x37')]];if(typeof _0x10297d[_0xab80('0x9e')]===_0xab80('0x9f'))return;if(_[_0xab80('0xa0')](_0x10297d[_0xab80('0xa1')]))return;return RpcSetting[_0xab80('0xa2')]()[_0xab80('0xa3')](function(_0x3b93e8){if(!_0x3b93e8[_0xab80('0xa4')])return;return Promise[_0xab80('0x9d')]()['then'](function(){return ami[_0xab80('0xa5')]({'action':_0xab80('0xa6'),'channel':_0x10297d['channel']})['catch'](function(){});})['then'](function(){return ami[_0xab80('0xa5')]({'action':_0xab80('0xa6'),'channel':_0x10297d['destinationchannel']})[_0xab80('0xa7')](function(){})['finally'](function(){var _0x2f6651=_0x41edd7[_0xab80('0x1d')][_0x10297d[_0xab80('0xa8')]['split']('-')[0x0]];if(!_0x2f6651)return;io[_0xab80('0x33')](_0xab80('0xa9'),{'agentId':_0x2f6651['id'],'uniqueid':_0x10297d[_0xab80('0x37')]});});});});})[_0xab80('0xa3')](function(){if(_0x557a1a[_0xab80('0xaa')]==='BlindTransfer'){_0x41edd7[_0xab80('0x1e')][_0x557a1a[_0xab80('0x37')]]=_0x41edd7[_0xab80('0x1c')][_0x557a1a[_0xab80('0x37')]];}else{if(_0x41edd7[_0xab80('0x1c')][_0x557a1a[_0xab80('0x37')]]['type']===_0xab80('0xab')&&_0x41edd7[_0xab80('0x1e')][_0x557a1a[_0xab80('0x37')]]){_0x41edd7[_0xab80('0x1c')][_0x557a1a['uniqueid']][_0xab80('0x37')]=[_0x41edd7['channels'][_0x557a1a['uniqueid']][_0xab80('0x3c')],_0x41edd7[_0xab80('0x1c')][_0x557a1a[_0xab80('0x37')]][_0xab80('0x3c')]=_0x41edd7['channels'][_0x557a1a[_0xab80('0x37')]]['uniqueid']][0x0];delete _0x41edd7['blindTransfers'][_0x557a1a[_0xab80('0x37')]];}}logger[_0xab80('0x3a')](_0xab80('0xac'),_0x557a1a[_0xab80('0x37')],util[_0xab80('0x3b')](_0x41edd7[_0xab80('0x1c')][_0x557a1a[_0xab80('0x37')]],{'showHidden':![],'depth':null}));ami[_0xab80('0x33')]('custom:voiceCallReport',_0x41edd7[_0xab80('0x1c')][_0x557a1a[_0xab80('0x37')]]);delete _0x41edd7[_0xab80('0x1c')][_0x557a1a[_0xab80('0x37')]];});}}}catch(_0x4b3c57){logger[_0xab80('0x30')](_0xab80('0xad'),_0x557a1a[_0xab80('0x37')],util[_0xab80('0x3b')](_0x4b3c57,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xab80('0x32')][_0xab80('0x2a')]=function(_0x2e2a91){try{if(this[_0xab80('0x34')](_0x2e2a91)){logger[_0xab80('0x35')](_0xab80('0xae'),_0x2e2a91[_0xab80('0x37')],_0x2e2a91[_0xab80('0xaf')],_0x2e2a91[_0xab80('0xb0')]);logger[_0xab80('0x3a')]('[%s][voiceCallReport][attendedtransfer]\x20event:',_0x2e2a91['uniqueid'],util['inspect'](_0x2e2a91,{'showHidden':![],'depth':null}));if(this[_0xab80('0x1c')][_0x2e2a91[_0xab80('0xb1')]]){this[_0xab80('0x1c')][_0x2e2a91[_0xab80('0xb1')]]['transfercalleridnum']=_0x2e2a91[_0xab80('0xaf')];this[_0xab80('0x1c')][_0x2e2a91[_0xab80('0xb1')]][_0xab80('0xb2')]=_0x2e2a91[_0xab80('0xb0')];if(this[_0xab80('0x1c')][_0x2e2a91['secondtransfereruniqueid']]){var _0x3f9b4d=this[_0xab80('0x1c')][_0x2e2a91[_0xab80('0xb3')]];this['channels'][_0x2e2a91[_0xab80('0xb3')]]=this[_0xab80('0x1c')][_0x2e2a91[_0xab80('0xb1')]];this[_0xab80('0x1c')][_0x2e2a91['transfereeuniqueid']]=_0x3f9b4d;}}else if(this['channels'][_0x2e2a91[_0xab80('0xb4')]]){this[_0xab80('0x1c')][_0x2e2a91[_0xab80('0xb4')]][_0xab80('0xb5')]=_0x2e2a91[_0xab80('0xaf')];this[_0xab80('0x1c')][_0x2e2a91['transfertargetuniqueid']][_0xab80('0xb2')]=_0x2e2a91['transfertargetcalleridnum'];if(this[_0xab80('0x1c')][_0x2e2a91[_0xab80('0xb6')]]){var _0x3f9b4d=this[_0xab80('0x1c')][_0x2e2a91[_0xab80('0xb6')]];this[_0xab80('0x1c')][_0x2e2a91[_0xab80('0xb6')]]=this[_0xab80('0x1c')][_0x2e2a91['transfertargetuniqueid']];this[_0xab80('0x1c')][_0x2e2a91[_0xab80('0xb4')]]=_0x3f9b4d;}}if((this[_0xab80('0x1c')][_0x2e2a91['origtransfereruniqueid']]||this[_0xab80('0x1c')][_0x2e2a91[_0xab80('0xb7')]])&&this['channels'][_0x2e2a91[_0xab80('0xb3')]]){var _0x464ad6=_[_0xab80('0xb8')]([this[_0xab80('0x1c')][_0x2e2a91[_0xab80('0xb6')]],this[_0xab80('0x1c')][_0x2e2a91['origtransfererlinkedid']],this[_0xab80('0x1c')][_0x2e2a91[_0xab80('0xb3')]]],function(_0x5b2044){return _0x5b2044&&_0x5b2044[_0xab80('0x86')]===_0xab80('0xab')&&_0x5b2044[_0xab80('0xb9')];});if(_0x464ad6){if(this[_0xab80('0x1c')][_0x2e2a91[_0xab80('0xb6')]])this['channels'][_0x2e2a91['origtransfereruniqueid']][_0xab80('0x9e')]=_0xab80('0xba');if(this[_0xab80('0x1c')][_0x2e2a91[_0xab80('0xb7')]])this[_0xab80('0x1c')][_0x2e2a91[_0xab80('0xb7')]]['transferType']=_0xab80('0xba');this[_0xab80('0x1c')][_0x2e2a91[_0xab80('0xb3')]][_0xab80('0x9e')]='ATTENDED';}}}}catch(_0xa86deb){logger[_0xab80('0x30')](_0xab80('0xbb'),_0x2e2a91[_0xab80('0x37')],util['inspect'](_0xa86deb,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xab80('0x2c')]=function(_0x6122d0){try{if(this['isNotNull'](_0x6122d0)){logger[_0xab80('0x35')](_0xab80('0xbc'),_0x6122d0['uniqueid'],_0x6122d0[_0xab80('0xbd')],_0x6122d0[_0xab80('0xbe')]);logger[_0xab80('0x3a')]('[%s][voiceCallReport][blindtransfer]\x20event:',_0x6122d0[_0xab80('0x37')],util[_0xab80('0x3b')](_0x6122d0,{'showHidden':![],'depth':null}));if(this['channels'][_0x6122d0[_0xab80('0xb1')]]){this[_0xab80('0x1c')][_0x6122d0[_0xab80('0xb1')]][_0xab80('0xb5')]=_0x6122d0[_0xab80('0xbd')];this[_0xab80('0x1c')][_0x6122d0[_0xab80('0xb1')]]['transferconnectedlinenum']=_0x6122d0[_0xab80('0xbe')];this['channels'][_0x6122d0['transfereeuniqueid']][_0xab80('0x9e')]='BLIND';this['syncHangup']({'event':'BlindTransfer','uniqueid':_0x6122d0['transfereeuniqueid'],'context':_0x6122d0['context'],'channel':_0x6122d0['transfererchannel']});}else{this[_0xab80('0x1c')][_0x6122d0[_0xab80('0xbf')]][_0xab80('0x9e')]=_0xab80('0xc0');}}}catch(_0x37b080){logger[_0xab80('0x30')](_0xab80('0xc1'),_0x6122d0[_0xab80('0x37')],util['inspect'](_0x37b080,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xab80('0x32')]['syncMusicOnHoldStart']=function(_0x110d00){try{if(this[_0xab80('0x34')](_0x110d00)){logger['debug'](_0xab80('0xc2'),_0x110d00[_0xab80('0x37')],util[_0xab80('0x3b')](_0x110d00,{'showHidden':![],'depth':null}));if(this['channels'][_0x110d00['uniqueid']]){if(!_['isNil'](this[_0xab80('0x1c')][_0x110d00[_0xab80('0x37')]][_0xab80('0x67')])){this['channels'][_0x110d00[_0xab80('0x37')]][_0xab80('0xc3')]=moment()[_0xab80('0x45')](_0xab80('0x4c'));logger[_0xab80('0x35')](_0xab80('0xc4'),_0x110d00['uniqueid'],this[_0xab80('0x1c')][_0x110d00[_0xab80('0x37')]][_0xab80('0xc3')]);}}}}catch(_0x29ce7e){logger[_0xab80('0x30')](_0xab80('0xc5'),_0x110d00['uniqueid'],util[_0xab80('0x3b')](_0x29ce7e,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xab80('0xc6')]=function(_0x3cfdc1){try{if(this[_0xab80('0x34')](_0x3cfdc1)){logger[_0xab80('0x3a')](_0xab80('0xc7'),_0x3cfdc1[_0xab80('0x37')],util[_0xab80('0x3b')](_0x3cfdc1,{'showHidden':![],'depth':null}));if(this[_0xab80('0x1c')][_0x3cfdc1['uniqueid']]){if(!_['isNil'](this['channels'][_0x3cfdc1[_0xab80('0x37')]][_0xab80('0xc3')])){this[_0xab80('0x1c')][_0x3cfdc1[_0xab80('0x37')]][_0xab80('0xc8')]+=moment()['milliseconds'](0x0)[_0xab80('0x98')](this['channels'][_0x3cfdc1[_0xab80('0x37')]][_0xab80('0xc3')],_0xab80('0x5e'));logger[_0xab80('0x35')]('[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s',_0x3cfdc1['uniqueid'],this[_0xab80('0x1c')][_0x3cfdc1[_0xab80('0x37')]]['mohtime']);delete this[_0xab80('0x1c')][_0x3cfdc1[_0xab80('0x37')]][_0xab80('0xc3')];}}}}catch(_0x32863b){logger[_0xab80('0x30')](_0xab80('0xc9'),_0x3cfdc1[_0xab80('0x37')],util[_0xab80('0x3b')](_0x32863b,{'showHidden':![],'depth':null}));}};module[_0xab80('0xca')]=VoiceCallReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceDialReport.js b/server/services/ami/report/voiceDialReport.js index bdeac86..88a100a 100644 --- a/server/services/ami/report/voiceDialReport.js +++ b/server/services/ami/report/voiceDialReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf6a5=['sumBillable','billableseconds','sumDuration','duration','custom:voiceDialReport','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','custom:dialend','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','voice_outbound:save','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','voice_outbound_channel:remove','linkedid','destuniqueid','[%s][voiceDialReport][hangup]','[%s][voiceDialReport][newexten]\x20event:','application','toLowerCase','set','applicationdata','startsWith','cdr(','[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s','split','match','exports','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','socket.io-emitter','channels','outboundChannels','outbound','applications','variables','dialbegin','syncDialBegin','dialend','syncDialEnd','syncVarSet','bind','newexten','syncNewExten','hangup','syncHangup','isNotNull','isUndefined','prototype','emit','debug','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','inspect','merge','YYYY-MM-DD\x20HH:mm:ss','called','channel','substring','lastIndexOf','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','membername','interface','voice:outbound','voice_outbound_channel:save','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','error','[%s][voiceDialReport][dialbegin]','[%s][voiceDialReport][dialend]\x20event:','connectedlinename','answertime','format','lastevent','connect','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','custom:dialconnect','[%s][voiceDialReport][dialend]','[%s][voiceDialReport][varset]\x20event:','addVariable','variable','value','outboundrouteid','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberlastcall','memberpenalty','memberrealtime','isNil','includes','[%s][voiceDialReport][hangup]\x20event:','info','cause-txt','endtime','diff','seconds','complete','total','answered','holdtime','starttime'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0xf6a5,0x92));var _0x5f6a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf6a5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var moment=require(_0x5f6a('0x0'));var util=require(_0x5f6a('0x1'));var Redis=require(_0x5f6a('0x2'));var config=require(_0x5f6a('0x3'));var logger=require(_0x5f6a('0x4'))(_0x5f6a('0x5'));var ami=require(_0x5f6a('0x6'));config[_0x5f6a('0x7')]=_[_0x5f6a('0x8')](config[_0x5f6a('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x5f6a('0x9'))(new Redis(config[_0x5f6a('0x7')]));function VoiceDialReport(_0x35b810){this[_0x5f6a('0xa')]=_0x35b810[_0x5f6a('0xb')];this[_0x5f6a('0xc')]=_0x35b810[_0x5f6a('0xc')];this[_0x5f6a('0xd')]={};this[_0x5f6a('0xe')]={};ami['on'](_0x5f6a('0xf'),this[_0x5f6a('0x10')]['bind'](this));ami['on'](_0x5f6a('0x11'),this[_0x5f6a('0x12')]['bind'](this));ami['on']('varset',this[_0x5f6a('0x13')][_0x5f6a('0x14')](this));ami['on'](_0x5f6a('0x15'),this[_0x5f6a('0x16')][_0x5f6a('0x14')](this));ami['on'](_0x5f6a('0x17'),this[_0x5f6a('0x18')][_0x5f6a('0x14')](this));}VoiceDialReport['prototype'][_0x5f6a('0x19')]=function(_0x5701fd){return _0x5701fd!==null&&!_[_0x5f6a('0x1a')](_0x5701fd);};VoiceDialReport[_0x5f6a('0x1b')][_0x5f6a('0x1c')]=function(_0x35e80a,_0x4715ac,_0x2fcbf8){io['to'](_0x35e80a)[_0x5f6a('0x1c')](_0x4715ac,_0x2fcbf8);};VoiceDialReport['prototype']['syncDialBegin']=function(_0x16ec2a){try{if(this[_0x5f6a('0x19')](_0x16ec2a)){logger[_0x5f6a('0x1d')](_0x5f6a('0x1e'),_0x16ec2a[_0x5f6a('0x1f')],util[_0x5f6a('0x20')](_0x16ec2a,{'showHidden':![],'depth':null}));if(this[_0x5f6a('0xa')][_0x16ec2a[_0x5f6a('0x1f')]]){_[_0x5f6a('0x21')](this[_0x5f6a('0xa')][_0x16ec2a[_0x5f6a('0x1f')]],{'starttime':moment()['format'](_0x5f6a('0x22')),'lastevent':_0x5f6a('0x23'),'interface':_0x16ec2a[_0x5f6a('0x24')][_0x5f6a('0x25')](0x0,_0x16ec2a[_0x5f6a('0x24')][_0x5f6a('0x26')]('-')),'membername':_0x16ec2a[_0x5f6a('0x24')]['substring'](_0x16ec2a[_0x5f6a('0x24')][_0x5f6a('0x26')]('/')+0x1,_0x16ec2a['channel'][_0x5f6a('0x26')]('-'))},_['omit'](_0x16ec2a,['event','privilege']));logger['info'](_0x5f6a('0x27'),_0x16ec2a[_0x5f6a('0x1f')],this['channels'][_0x16ec2a[_0x5f6a('0x1f')]][_0x5f6a('0x28')],this['channels'][_0x16ec2a['uniqueid']][_0x5f6a('0x29')]);logger[_0x5f6a('0x1d')]('[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:',_0x16ec2a['uniqueid'],util[_0x5f6a('0x20')](this[_0x5f6a('0xa')][_0x16ec2a[_0x5f6a('0x1f')]],{'showHidden':![],'depth':null}));if(this['applications'][_0x16ec2a[_0x5f6a('0x1f')]])_[_0x5f6a('0x21')](this[_0x5f6a('0xa')][_0x16ec2a[_0x5f6a('0x1f')]],this['applications'][_0x16ec2a['uniqueid']]);this['emit'](_0x5f6a('0x2a'),_0x5f6a('0x2b'),this[_0x5f6a('0xa')][_0x16ec2a[_0x5f6a('0x1f')]]);logger[_0x5f6a('0x1d')](_0x5f6a('0x2c'),_0x16ec2a[_0x5f6a('0x1f')],util[_0x5f6a('0x20')](this[_0x5f6a('0xa')][_0x16ec2a[_0x5f6a('0x1f')]],{'showHidden':![],'depth':null}));ami[_0x5f6a('0x1c')]('custom:dialbegin',this[_0x5f6a('0xa')][_0x16ec2a['uniqueid']]);}}}catch(_0x3e7718){logger[_0x5f6a('0x2d')](_0x5f6a('0x2e'),_0x16ec2a[_0x5f6a('0x1f')],util[_0x5f6a('0x20')](_0x3e7718,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x5f6a('0x1b')][_0x5f6a('0x12')]=function(_0x54dae8){try{if(this[_0x5f6a('0x19')](_0x54dae8)){logger[_0x5f6a('0x1d')](_0x5f6a('0x2f'),_0x54dae8[_0x5f6a('0x1f')],util[_0x5f6a('0x20')](_0x54dae8,{'showHidden':![],'depth':null}));if(this['channels'][_0x54dae8[_0x5f6a('0x1f')]]){this[_0x5f6a('0xa')][_0x54dae8['uniqueid']]['dialstatus']=_0x54dae8['dialstatus'];if(_0x54dae8['dialstatus']==='ANSWER'){this[_0x5f6a('0xa')][_0x54dae8['uniqueid']]['connectedlinenum']=_0x54dae8['connectedlinenum'];this[_0x5f6a('0xa')][_0x54dae8[_0x5f6a('0x1f')]][_0x5f6a('0x30')]=_0x54dae8[_0x5f6a('0x30')];this[_0x5f6a('0xa')][_0x54dae8[_0x5f6a('0x1f')]][_0x5f6a('0x31')]=moment()[_0x5f6a('0x32')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x5f6a('0xa')][_0x54dae8['uniqueid']][_0x5f6a('0x33')]=_0x5f6a('0x34');logger['info']('[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect',_0x54dae8[_0x5f6a('0x1f')],_0x54dae8[_0x5f6a('0x24')][_0x5f6a('0x25')](_0x54dae8[_0x5f6a('0x24')]['lastIndexOf']('/')+0x1,_0x54dae8[_0x5f6a('0x24')][_0x5f6a('0x26')]('-')));logger[_0x5f6a('0x1d')](_0x5f6a('0x35'),_0x54dae8[_0x5f6a('0x1f')],util[_0x5f6a('0x20')](this[_0x5f6a('0xa')][_0x54dae8[_0x5f6a('0x1f')]],{'showHidden':![],'depth':null}));ami[_0x5f6a('0x1c')](_0x5f6a('0x36'),this[_0x5f6a('0xa')][_0x54dae8[_0x5f6a('0x1f')]]);}logger[_0x5f6a('0x1d')]('[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:',_0x54dae8[_0x5f6a('0x1f')],util[_0x5f6a('0x20')](this[_0x5f6a('0xa')][_0x54dae8[_0x5f6a('0x1f')]],{'showHidden':![],'depth':null}));this[_0x5f6a('0x1c')](_0x5f6a('0x2a'),_0x5f6a('0x2b'),this[_0x5f6a('0xa')][_0x54dae8[_0x5f6a('0x1f')]]);}}}catch(_0x4d5fd3){logger[_0x5f6a('0x2d')](_0x5f6a('0x37'),_0x54dae8['uniqueid'],util['inspect'](_0x4d5fd3,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x5f6a('0x1b')][_0x5f6a('0x13')]=function(_0x19abd8){try{if(this[_0x5f6a('0x19')](_0x19abd8)){logger[_0x5f6a('0x1d')](_0x5f6a('0x38'),_0x19abd8[_0x5f6a('0x1f')],util[_0x5f6a('0x20')](_0x19abd8,{'showHidden':![],'depth':null}));this[_0x5f6a('0x39')](_0x19abd8[_0x5f6a('0x1f')],_['keys'](_0x19abd8[_0x5f6a('0x3a')])[0x0],_0x19abd8[_0x5f6a('0x3b')]);if(this['isNotNull'](_0x19abd8['variable'])&&this['isNotNull'](_0x19abd8[_0x5f6a('0x3a')][_0x5f6a('0x3c')])){if(_['isUndefined'](this[_0x5f6a('0xa')][_0x19abd8[_0x5f6a('0x1f')]])){this[_0x5f6a('0xa')][_0x19abd8[_0x5f6a('0x1f')]]={'routeId':_0x19abd8['value'],'variables':this['variables'][_0x19abd8[_0x5f6a('0x1f')]]};logger['info'](_0x5f6a('0x3d'),_0x19abd8[_0x5f6a('0x1f')],_0x19abd8[_0x5f6a('0x3a')]['outboundrouteid'],_['keys'](_0x19abd8[_0x5f6a('0x3a')])[0x0],_0x19abd8['value']);logger[_0x5f6a('0x1d')]('[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:',_0x19abd8[_0x5f6a('0x1f')],util[_0x5f6a('0x20')](this[_0x5f6a('0xa')][_0x19abd8[_0x5f6a('0x1f')]],{'showHidden':![],'depth':null}));this['emit']('voice:outbound',_0x5f6a('0x2b'),this[_0x5f6a('0xa')][_0x19abd8[_0x5f6a('0x1f')]]);}}}}catch(_0x596fc6){logger[_0x5f6a('0x2d')]('[%s][voiceDialReport][varset]',_0x19abd8[_0x5f6a('0x1f')],util[_0x5f6a('0x20')](_0x596fc6,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x5f6a('0x1b')][_0x5f6a('0x39')]=function(_0x4c9bcd,_0x3b5570,_0x5713a6){var _0x47f600=[_0x5f6a('0x3e'),_0x5f6a('0x3f'),_0x5f6a('0x40'),_0x5f6a('0x41'),_0x5f6a('0x42'),_0x5f6a('0x43'),_0x5f6a('0x44'),_0x5f6a('0x45'),_0x5f6a('0x46'),_0x5f6a('0x47'),_0x5f6a('0x48'),_0x5f6a('0x49'),_0x5f6a('0x4a'),_0x5f6a('0x4b'),'memberinterface',_0x5f6a('0x4c'),_0x5f6a('0x28'),_0x5f6a('0x4d'),_0x5f6a('0x4e')];if(!_[_0x5f6a('0x4f')](_0x3b5570)&&!_[_0x5f6a('0x50')](_0x47f600,_0x3b5570)){if(_[_0x5f6a('0x1a')](this[_0x5f6a('0xe')][_0x4c9bcd])){this[_0x5f6a('0xe')][_0x4c9bcd]={};}this[_0x5f6a('0xe')][_0x4c9bcd][_0x3b5570]=_0x5713a6;}};VoiceDialReport[_0x5f6a('0x1b')][_0x5f6a('0x18')]=function(_0x238fb8){try{if(this[_0x5f6a('0x19')](_0x238fb8)){logger[_0x5f6a('0x1d')](_0x5f6a('0x51'),_0x238fb8['uniqueid'],util['inspect'](_0x238fb8,{'showHidden':![],'depth':null}));if(this['channels'][_0x238fb8['uniqueid']]){logger[_0x5f6a('0x52')]('[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete',_0x238fb8[_0x5f6a('0x1f')],_0x238fb8[_0x5f6a('0x53')]);this['channels'][_0x238fb8['uniqueid']][_0x5f6a('0x54')]=moment()['format'](_0x5f6a('0x22'));this[_0x5f6a('0xa')][_0x238fb8[_0x5f6a('0x1f')]]['duration']=moment(this[_0x5f6a('0xa')][_0x238fb8[_0x5f6a('0x1f')]][_0x5f6a('0x54')])[_0x5f6a('0x55')](this[_0x5f6a('0xa')][_0x238fb8[_0x5f6a('0x1f')]]['starttime'],_0x5f6a('0x56'));this[_0x5f6a('0xa')][_0x238fb8[_0x5f6a('0x1f')]][_0x5f6a('0x33')]=_0x5f6a('0x57');this[_0x5f6a('0xc')][_0x5f6a('0x58')]+=0x1;if(this[_0x5f6a('0xa')][_0x238fb8[_0x5f6a('0x1f')]][_0x5f6a('0x31')]){this[_0x5f6a('0xc')][_0x5f6a('0x59')]+=0x1;this[_0x5f6a('0xa')][_0x238fb8[_0x5f6a('0x1f')]][_0x5f6a('0x5a')]=moment(this[_0x5f6a('0xa')][_0x238fb8[_0x5f6a('0x1f')]]['answertime'])[_0x5f6a('0x55')](this['channels'][_0x238fb8[_0x5f6a('0x1f')]][_0x5f6a('0x5b')],_0x5f6a('0x56'));this[_0x5f6a('0xa')][_0x238fb8[_0x5f6a('0x1f')]]['billableseconds']=moment(this[_0x5f6a('0xa')][_0x238fb8[_0x5f6a('0x1f')]][_0x5f6a('0x54')])[_0x5f6a('0x55')](this[_0x5f6a('0xa')][_0x238fb8[_0x5f6a('0x1f')]][_0x5f6a('0x31')],_0x5f6a('0x56'));this[_0x5f6a('0xc')]['sumHoldTime']+=this['channels'][_0x238fb8[_0x5f6a('0x1f')]][_0x5f6a('0x5a')]||0x0;this[_0x5f6a('0xc')][_0x5f6a('0x5c')]+=this[_0x5f6a('0xa')][_0x238fb8[_0x5f6a('0x1f')]][_0x5f6a('0x5d')];}this[_0x5f6a('0xc')][_0x5f6a('0x5e')]+=this[_0x5f6a('0xa')][_0x238fb8[_0x5f6a('0x1f')]][_0x5f6a('0x5f')];logger[_0x5f6a('0x1d')]('[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:',_0x238fb8['uniqueid'],util[_0x5f6a('0x20')](this['channels'][_0x238fb8['uniqueid']],{'showHidden':![],'depth':null}));ami[_0x5f6a('0x1c')](_0x5f6a('0x60'),this[_0x5f6a('0xa')][_0x238fb8[_0x5f6a('0x1f')]]);logger[_0x5f6a('0x1d')](_0x5f6a('0x61'),_0x238fb8[_0x5f6a('0x1f')],util[_0x5f6a('0x20')](this[_0x5f6a('0xa')][_0x238fb8[_0x5f6a('0x1f')]],{'showHidden':![],'depth':null}));ami[_0x5f6a('0x1c')](_0x5f6a('0x62'),this['channels'][_0x238fb8[_0x5f6a('0x1f')]]);logger[_0x5f6a('0x1d')](_0x5f6a('0x63'),_0x238fb8['uniqueid'],util[_0x5f6a('0x20')](this[_0x5f6a('0xa')][_0x238fb8['uniqueid']],{'showHidden':![],'depth':null}));this[_0x5f6a('0x1c')](_0x5f6a('0x2a'),_0x5f6a('0x64'),this[_0x5f6a('0xc')]);logger[_0x5f6a('0x52')](_0x5f6a('0x65'),JSON[_0x5f6a('0x66')](this[_0x5f6a('0xa')][_0x238fb8[_0x5f6a('0x1f')]]));logger[_0x5f6a('0x1d')](_0x5f6a('0x67'),_0x238fb8[_0x5f6a('0x1f')],util['inspect'](this['channels'][_0x238fb8[_0x5f6a('0x1f')]],{'showHidden':![],'depth':null}));this[_0x5f6a('0x1c')](_0x5f6a('0x2a'),_0x5f6a('0x68'),this[_0x5f6a('0xa')][_0x238fb8[_0x5f6a('0x1f')]]);delete this['channels'][_0x238fb8[_0x5f6a('0x1f')]];}else if(this[_0x5f6a('0xa')][_0x238fb8[_0x5f6a('0x69')]]){this[_0x5f6a('0xa')][_0x238fb8[_0x5f6a('0x69')]][_0x5f6a('0x1f')]=this[_0x5f6a('0xa')][_0x238fb8['linkedid']][_0x5f6a('0x6a')];}if(this['variables'][_0x238fb8[_0x5f6a('0x1f')]]){delete this[_0x5f6a('0xe')][_0x238fb8['uniqueid']];}}}catch(_0x5b553d){logger[_0x5f6a('0x2d')](_0x5f6a('0x6b'),_0x238fb8[_0x5f6a('0x1f')],util[_0x5f6a('0x20')](_0x5b553d,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x5f6a('0x1b')]['syncNewExten']=function(_0x41fae4){try{if(this['isNotNull'](_0x41fae4)){logger['debug'](_0x5f6a('0x6c'),_0x41fae4[_0x5f6a('0x1f')],util[_0x5f6a('0x20')](_0x41fae4,{'showHidden':![],'depth':null}));if(_0x41fae4[_0x5f6a('0x6d')][_0x5f6a('0x6e')]()===_0x5f6a('0x6f')){_0x41fae4['applicationdata']=(_0x41fae4['appdata']||_0x41fae4[_0x5f6a('0x70')])[_0x5f6a('0x6e')]();if(_[_0x5f6a('0x71')](_0x41fae4[_0x5f6a('0x70')],_0x5f6a('0x72'))){if(_[_0x5f6a('0x1a')](this[_0x5f6a('0xd')][_0x41fae4[_0x5f6a('0x1f')]]))this['applications'][_0x41fae4[_0x5f6a('0x1f')]]={};logger[_0x5f6a('0x52')](_0x5f6a('0x73'),_0x41fae4[_0x5f6a('0x1f')],_0x41fae4[_0x5f6a('0x6d')],_0x41fae4[_0x5f6a('0x70')]);var _0x5129d4=_0x41fae4[_0x5f6a('0x70')][_0x5f6a('0x74')]('=');var _0x7c556d=_0x5129d4[0x0][_0x5f6a('0x75')](/cdr\((.*)\)/);if(_0x7c556d)this['applications'][_0x41fae4[_0x5f6a('0x1f')]][_0x7c556d[0x1]]=_0x5129d4[0x1];}}}}catch(_0x497731){logger[_0x5f6a('0x2d')]('[%s][voiceDialReport][newexten]',_0x41fae4[_0x5f6a('0x1f')],util[_0x5f6a('0x20')](_0x497731,{'showHidden':![],'depth':null}));}};module[_0x5f6a('0x76')]=VoiceDialReport; \ No newline at end of file +var _0x81ff=['memberinterface','memberlastcall','membername','memberrealtime','isNil','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','cause-txt','endtime','duration','diff','starttime','lastevent','holdtime','seconds','billableseconds','sumHoldTime','sumBillable','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','custom:dialend','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','voice_outbound:save','stringify','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','linkedid','destuniqueid','[%s][voiceDialReport][hangup]','[%s][voiceDialReport][newexten]\x20event:','application','toLowerCase','set','appdata','applicationdata','startsWith','[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s','split','[%s][voiceDialReport][newexten]','exports','lodash','moment','util','ioredis','../../../config/logger','ami','../ami','redis','defaults','localhost','channels','outboundChannels','outbound','applications','dialbegin','syncDialBegin','bind','dialend','syncDialEnd','varset','syncVarSet','syncNewExten','syncHangup','prototype','isUndefined','emit','debug','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','inspect','merge','format','YYYY-MM-DD\x20HH:mm:ss','called','substring','channel','lastIndexOf','event','info','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','voice:outbound','voice_outbound_channel:save','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','custom:dialbegin','error','[%s][voiceDialReport][dialbegin]','isNotNull','dialstatus','connectedlinenum','connectedlinename','answertime','connect','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','[%s][voiceDialReport][dialend]','[%s][voiceDialReport][varset]\x20event:','addVariable','variable','outboundrouteid','variables','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','keys','value','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][varset]','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','bridgepvtcallid','membercalls','memberdynamic'];(function(_0x26c48a,_0x3e7621){var _0x4ff686=function(_0x7fd2c3){while(--_0x7fd2c3){_0x26c48a['push'](_0x26c48a['shift']());}};_0x4ff686(++_0x3e7621);}(_0x81ff,0x106));var _0xf81f=function(_0x2c9636,_0x36fe8b){_0x2c9636=_0x2c9636-0x0;var _0xbcec8=_0x81ff[_0x2c9636];return _0xbcec8;};'use strict';var _=require(_0xf81f('0x0'));var moment=require(_0xf81f('0x1'));var util=require(_0xf81f('0x2'));var Redis=require(_0xf81f('0x3'));var config=require('../../../config/environment');var logger=require(_0xf81f('0x4'))(_0xf81f('0x5'));var ami=require(_0xf81f('0x6'));config[_0xf81f('0x7')]=_[_0xf81f('0x8')](config['redis'],{'host':_0xf81f('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function VoiceDialReport(_0x1da6c2){this[_0xf81f('0xa')]=_0x1da6c2[_0xf81f('0xb')];this[_0xf81f('0xc')]=_0x1da6c2[_0xf81f('0xc')];this[_0xf81f('0xd')]={};this['variables']={};ami['on'](_0xf81f('0xe'),this[_0xf81f('0xf')][_0xf81f('0x10')](this));ami['on'](_0xf81f('0x11'),this[_0xf81f('0x12')]['bind'](this));ami['on'](_0xf81f('0x13'),this[_0xf81f('0x14')][_0xf81f('0x10')](this));ami['on']('newexten',this[_0xf81f('0x15')]['bind'](this));ami['on']('hangup',this[_0xf81f('0x16')][_0xf81f('0x10')](this));}VoiceDialReport[_0xf81f('0x17')]['isNotNull']=function(_0x381faa){return _0x381faa!==null&&!_[_0xf81f('0x18')](_0x381faa);};VoiceDialReport[_0xf81f('0x17')]['emit']=function(_0x559668,_0x40a8c5,_0x17b1c8){io['to'](_0x559668)[_0xf81f('0x19')](_0x40a8c5,_0x17b1c8);};VoiceDialReport[_0xf81f('0x17')][_0xf81f('0xf')]=function(_0x22f896){try{if(this['isNotNull'](_0x22f896)){logger[_0xf81f('0x1a')](_0xf81f('0x1b'),_0x22f896[_0xf81f('0x1c')],util[_0xf81f('0x1d')](_0x22f896,{'showHidden':![],'depth':null}));if(this[_0xf81f('0xa')][_0x22f896[_0xf81f('0x1c')]]){_[_0xf81f('0x1e')](this[_0xf81f('0xa')][_0x22f896[_0xf81f('0x1c')]],{'starttime':moment()[_0xf81f('0x1f')](_0xf81f('0x20')),'lastevent':_0xf81f('0x21'),'interface':_0x22f896['channel'][_0xf81f('0x22')](0x0,_0x22f896[_0xf81f('0x23')]['lastIndexOf']('-')),'membername':_0x22f896['channel']['substring'](_0x22f896[_0xf81f('0x23')][_0xf81f('0x24')]('/')+0x1,_0x22f896[_0xf81f('0x23')]['lastIndexOf']('-'))},_['omit'](_0x22f896,[_0xf81f('0x25'),'privilege']));logger[_0xf81f('0x26')](_0xf81f('0x27'),_0x22f896[_0xf81f('0x1c')],this['channels'][_0x22f896[_0xf81f('0x1c')]]['membername'],this[_0xf81f('0xa')][_0x22f896[_0xf81f('0x1c')]]['interface']);logger[_0xf81f('0x1a')]('[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:',_0x22f896[_0xf81f('0x1c')],util[_0xf81f('0x1d')](this['channels'][_0x22f896[_0xf81f('0x1c')]],{'showHidden':![],'depth':null}));if(this[_0xf81f('0xd')][_0x22f896[_0xf81f('0x1c')]])_['merge'](this[_0xf81f('0xa')][_0x22f896[_0xf81f('0x1c')]],this[_0xf81f('0xd')][_0x22f896[_0xf81f('0x1c')]]);this[_0xf81f('0x19')](_0xf81f('0x28'),_0xf81f('0x29'),this[_0xf81f('0xa')][_0x22f896[_0xf81f('0x1c')]]);logger[_0xf81f('0x1a')](_0xf81f('0x2a'),_0x22f896[_0xf81f('0x1c')],util[_0xf81f('0x1d')](this['channels'][_0x22f896[_0xf81f('0x1c')]],{'showHidden':![],'depth':null}));ami[_0xf81f('0x19')](_0xf81f('0x2b'),this[_0xf81f('0xa')][_0x22f896[_0xf81f('0x1c')]]);}}}catch(_0x2424a5){logger[_0xf81f('0x2c')](_0xf81f('0x2d'),_0x22f896[_0xf81f('0x1c')],util['inspect'](_0x2424a5,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xf81f('0x17')]['syncDialEnd']=function(_0x55d0a2){try{if(this[_0xf81f('0x2e')](_0x55d0a2)){logger[_0xf81f('0x1a')]('[%s][voiceDialReport][dialend]\x20event:',_0x55d0a2[_0xf81f('0x1c')],util[_0xf81f('0x1d')](_0x55d0a2,{'showHidden':![],'depth':null}));if(this['channels'][_0x55d0a2[_0xf81f('0x1c')]]){this['channels'][_0x55d0a2[_0xf81f('0x1c')]][_0xf81f('0x2f')]=_0x55d0a2[_0xf81f('0x2f')];if(_0x55d0a2[_0xf81f('0x2f')]==='ANSWER'){this[_0xf81f('0xa')][_0x55d0a2[_0xf81f('0x1c')]][_0xf81f('0x30')]=_0x55d0a2[_0xf81f('0x30')];this[_0xf81f('0xa')][_0x55d0a2[_0xf81f('0x1c')]]['connectedlinename']=_0x55d0a2[_0xf81f('0x31')];this[_0xf81f('0xa')][_0x55d0a2[_0xf81f('0x1c')]][_0xf81f('0x32')]=moment()['format'](_0xf81f('0x20'));this[_0xf81f('0xa')][_0x55d0a2[_0xf81f('0x1c')]]['lastevent']=_0xf81f('0x33');logger[_0xf81f('0x26')](_0xf81f('0x34'),_0x55d0a2[_0xf81f('0x1c')],_0x55d0a2['channel'][_0xf81f('0x22')](_0x55d0a2['channel']['lastIndexOf']('/')+0x1,_0x55d0a2[_0xf81f('0x23')]['lastIndexOf']('-')));logger[_0xf81f('0x1a')](_0xf81f('0x35'),_0x55d0a2['uniqueid'],util['inspect'](this[_0xf81f('0xa')][_0x55d0a2[_0xf81f('0x1c')]],{'showHidden':![],'depth':null}));ami[_0xf81f('0x19')]('custom:dialconnect',this[_0xf81f('0xa')][_0x55d0a2[_0xf81f('0x1c')]]);}logger[_0xf81f('0x1a')]('[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:',_0x55d0a2[_0xf81f('0x1c')],util[_0xf81f('0x1d')](this[_0xf81f('0xa')][_0x55d0a2[_0xf81f('0x1c')]],{'showHidden':![],'depth':null}));this[_0xf81f('0x19')](_0xf81f('0x28'),_0xf81f('0x29'),this['channels'][_0x55d0a2[_0xf81f('0x1c')]]);}}}catch(_0x576e9b){logger['error'](_0xf81f('0x36'),_0x55d0a2[_0xf81f('0x1c')],util['inspect'](_0x576e9b,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype']['syncVarSet']=function(_0x397957){try{if(this[_0xf81f('0x2e')](_0x397957)){logger['debug'](_0xf81f('0x37'),_0x397957['uniqueid'],util[_0xf81f('0x1d')](_0x397957,{'showHidden':![],'depth':null}));this[_0xf81f('0x38')](_0x397957[_0xf81f('0x1c')],_['keys'](_0x397957[_0xf81f('0x39')])[0x0],_0x397957['value']);if(this[_0xf81f('0x2e')](_0x397957[_0xf81f('0x39')])&&this[_0xf81f('0x2e')](_0x397957[_0xf81f('0x39')][_0xf81f('0x3a')])){if(_[_0xf81f('0x18')](this['channels'][_0x397957[_0xf81f('0x1c')]])){this[_0xf81f('0xa')][_0x397957[_0xf81f('0x1c')]]={'routeId':_0x397957['value'],'variables':this[_0xf81f('0x3b')][_0x397957[_0xf81f('0x1c')]]};logger[_0xf81f('0x26')](_0xf81f('0x3c'),_0x397957[_0xf81f('0x1c')],_0x397957[_0xf81f('0x39')][_0xf81f('0x3a')],_[_0xf81f('0x3d')](_0x397957[_0xf81f('0x39')])[0x0],_0x397957[_0xf81f('0x3e')]);logger[_0xf81f('0x1a')](_0xf81f('0x3f'),_0x397957[_0xf81f('0x1c')],util[_0xf81f('0x1d')](this['channels'][_0x397957[_0xf81f('0x1c')]],{'showHidden':![],'depth':null}));this[_0xf81f('0x19')](_0xf81f('0x28'),_0xf81f('0x29'),this[_0xf81f('0xa')][_0x397957['uniqueid']]);}}}}catch(_0x4abc0d){logger['error'](_0xf81f('0x40'),_0x397957[_0xf81f('0x1c')],util[_0xf81f('0x1d')](_0x4abc0d,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xf81f('0x17')][_0xf81f('0x38')]=function(_0x537ef6,_0x1f4bee,_0x2dbd92){var _0x282e03=['rtpaudioqos','rtpaudioqosbridged',_0xf81f('0x41'),_0xf81f('0x42'),_0xf81f('0x43'),_0xf81f('0x44'),'rtpaudioqosrtt',_0xf81f('0x45'),_0xf81f('0x46'),'sipuri','bridgepeer',_0xf81f('0x47'),_0xf81f('0x48'),_0xf81f('0x49'),_0xf81f('0x4a'),_0xf81f('0x4b'),_0xf81f('0x4c'),'memberpenalty',_0xf81f('0x4d')];if(!_[_0xf81f('0x4e')](_0x1f4bee)&&!_['includes'](_0x282e03,_0x1f4bee)){if(_[_0xf81f('0x18')](this[_0xf81f('0x3b')][_0x537ef6])){this[_0xf81f('0x3b')][_0x537ef6]={};}this[_0xf81f('0x3b')][_0x537ef6][_0x1f4bee]=_0x2dbd92;}};VoiceDialReport[_0xf81f('0x17')][_0xf81f('0x16')]=function(_0x271974){try{if(this['isNotNull'](_0x271974)){logger[_0xf81f('0x1a')]('[%s][voiceDialReport][hangup]\x20event:',_0x271974['uniqueid'],util['inspect'](_0x271974,{'showHidden':![],'depth':null}));if(this[_0xf81f('0xa')][_0x271974[_0xf81f('0x1c')]]){logger[_0xf81f('0x26')](_0xf81f('0x4f'),_0x271974[_0xf81f('0x1c')],_0x271974[_0xf81f('0x50')]);this['channels'][_0x271974['uniqueid']][_0xf81f('0x51')]=moment()[_0xf81f('0x1f')](_0xf81f('0x20'));this[_0xf81f('0xa')][_0x271974['uniqueid']][_0xf81f('0x52')]=moment(this[_0xf81f('0xa')][_0x271974[_0xf81f('0x1c')]][_0xf81f('0x51')])[_0xf81f('0x53')](this[_0xf81f('0xa')][_0x271974[_0xf81f('0x1c')]][_0xf81f('0x54')],'seconds');this['channels'][_0x271974[_0xf81f('0x1c')]][_0xf81f('0x55')]='complete';this['outbound']['total']+=0x1;if(this[_0xf81f('0xa')][_0x271974[_0xf81f('0x1c')]][_0xf81f('0x32')]){this['outbound']['answered']+=0x1;this[_0xf81f('0xa')][_0x271974[_0xf81f('0x1c')]][_0xf81f('0x56')]=moment(this[_0xf81f('0xa')][_0x271974[_0xf81f('0x1c')]][_0xf81f('0x32')])[_0xf81f('0x53')](this['channels'][_0x271974[_0xf81f('0x1c')]][_0xf81f('0x54')],_0xf81f('0x57'));this[_0xf81f('0xa')][_0x271974[_0xf81f('0x1c')]][_0xf81f('0x58')]=moment(this['channels'][_0x271974['uniqueid']][_0xf81f('0x51')])['diff'](this[_0xf81f('0xa')][_0x271974[_0xf81f('0x1c')]][_0xf81f('0x32')],_0xf81f('0x57'));this['outbound'][_0xf81f('0x59')]+=this[_0xf81f('0xa')][_0x271974[_0xf81f('0x1c')]]['holdtime']||0x0;this['outbound'][_0xf81f('0x5a')]+=this[_0xf81f('0xa')][_0x271974[_0xf81f('0x1c')]][_0xf81f('0x58')];}this[_0xf81f('0xc')]['sumDuration']+=this[_0xf81f('0xa')][_0x271974[_0xf81f('0x1c')]][_0xf81f('0x52')];logger[_0xf81f('0x1a')](_0xf81f('0x5b'),_0x271974['uniqueid'],util[_0xf81f('0x1d')](this[_0xf81f('0xa')][_0x271974['uniqueid']],{'showHidden':![],'depth':null}));ami[_0xf81f('0x19')]('custom:voiceDialReport',this[_0xf81f('0xa')][_0x271974['uniqueid']]);logger[_0xf81f('0x1a')](_0xf81f('0x5c'),_0x271974[_0xf81f('0x1c')],util[_0xf81f('0x1d')](this[_0xf81f('0xa')][_0x271974[_0xf81f('0x1c')]],{'showHidden':![],'depth':null}));ami['emit'](_0xf81f('0x5d'),this[_0xf81f('0xa')][_0x271974[_0xf81f('0x1c')]]);logger[_0xf81f('0x1a')](_0xf81f('0x5e'),_0x271974[_0xf81f('0x1c')],util[_0xf81f('0x1d')](this[_0xf81f('0xa')][_0x271974['uniqueid']],{'showHidden':![],'depth':null}));this[_0xf81f('0x19')]('voice:outbound',_0xf81f('0x5f'),this[_0xf81f('0xc')]);logger['info']('[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event',JSON[_0xf81f('0x60')](this[_0xf81f('0xa')][_0x271974['uniqueid']]));logger[_0xf81f('0x1a')](_0xf81f('0x61'),_0x271974[_0xf81f('0x1c')],util[_0xf81f('0x1d')](this[_0xf81f('0xa')][_0x271974[_0xf81f('0x1c')]],{'showHidden':![],'depth':null}));this[_0xf81f('0x19')](_0xf81f('0x28'),'voice_outbound_channel:remove',this[_0xf81f('0xa')][_0x271974['uniqueid']]);delete this[_0xf81f('0xa')][_0x271974['uniqueid']];}else if(this[_0xf81f('0xa')][_0x271974['linkedid']]){this[_0xf81f('0xa')][_0x271974['linkedid']]['uniqueid']=this[_0xf81f('0xa')][_0x271974[_0xf81f('0x62')]][_0xf81f('0x63')];}if(this[_0xf81f('0x3b')][_0x271974[_0xf81f('0x1c')]]){delete this['variables'][_0x271974['uniqueid']];}}}catch(_0x3c0d1d){logger[_0xf81f('0x2c')](_0xf81f('0x64'),_0x271974[_0xf81f('0x1c')],util[_0xf81f('0x1d')](_0x3c0d1d,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xf81f('0x17')][_0xf81f('0x15')]=function(_0x10880c){try{if(this[_0xf81f('0x2e')](_0x10880c)){logger[_0xf81f('0x1a')](_0xf81f('0x65'),_0x10880c[_0xf81f('0x1c')],util[_0xf81f('0x1d')](_0x10880c,{'showHidden':![],'depth':null}));if(_0x10880c[_0xf81f('0x66')][_0xf81f('0x67')]()===_0xf81f('0x68')){_0x10880c['applicationdata']=(_0x10880c[_0xf81f('0x69')]||_0x10880c[_0xf81f('0x6a')])['toLowerCase']();if(_[_0xf81f('0x6b')](_0x10880c[_0xf81f('0x6a')],'cdr(')){if(_[_0xf81f('0x18')](this[_0xf81f('0xd')][_0x10880c[_0xf81f('0x1c')]]))this[_0xf81f('0xd')][_0x10880c[_0xf81f('0x1c')]]={};logger['info'](_0xf81f('0x6c'),_0x10880c[_0xf81f('0x1c')],_0x10880c[_0xf81f('0x66')],_0x10880c[_0xf81f('0x6a')]);var _0x374523=_0x10880c['applicationdata'][_0xf81f('0x6d')]('=');var _0x159af2=_0x374523[0x0]['match'](/cdr\((.*)\)/);if(_0x159af2)this['applications'][_0x10880c['uniqueid']][_0x159af2[0x1]]=_0x374523[0x1];}}}}catch(_0x5a0265){logger[_0xf81f('0x2c')](_0xf81f('0x6e'),_0x10880c[_0xf81f('0x1c')],util[_0xf81f('0x1d')](_0x5a0265,{'showHidden':![],'depth':null}));}};module[_0xf81f('0x6f')]=VoiceDialReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceQueueReport.js b/server/services/ami/report/voiceQueueReport.js index 7996419..75a2f72 100644 --- a/server/services/ami/report/voiceQueueReport.js +++ b/server/services/ami/report/voiceQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfbac=['loggedin','[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:','custom:queuesummary','[%s][voiceQueueReport][queuecallerjoin]','isUndefined','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','merge','pick','keys','push','[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','queuecallerexitreason','ABANDONED','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','[%s][voiceQueueReport][queuecallerleave]','queuecallerleaveAt','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','[%s][voiceQueueReport][agentconnect]','[%s][voiceQueueReport][agentcomplete]','assigned','lastAssignedTo','membername','queuecallerexit','transfer','reason','startsWith','toLowerCase','local/','linkedid','queuecallerexitAt','transfertype','FORWARD','destexten','transferuniqueid','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','COMPLETEDBY','toUpperCase','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','syncVarSet','[%s][voiceQueueReport][varset]','addVariable','variable','value','queuestatus','timeout','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','custom:timeout','queueposition','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberinterface','memberlastcall','memberrealtime','includes','[%s][voiceQueueReport][hangup]','length','diff','milliseconds','seconds','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','custom:queuecallerunmanaged','lastevent','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','custom:queuecallerabandon','cause-txt','transfereeuniqueid','transferexten','secondtransfererexten','secondtransfereruniqueid','ATTENDEDTRANSFER','ATTENDED','origtransfererexten','origtransfereruniqueid','transfertargetuniqueid','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','[%s][voiceQueueReport][blindtransfer]','BLINDTRANSFER','BLIND','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BlindTransfer','transfererchannel','syncMusicOnHoldStart','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','mohstarttime','[%s][voiceQueueReport][musiconholdstart]','[%s][voiceQueueReport][musiconholdstop]','mohtime','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','[%s][voiceQueueReport][newexten]\x20event:','application','appdata','applicationdata','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','split','match','[%s][voiceQueueReport][newexten]','moment','util','md5','ioredis','../../../config/environment','../../../config/logger','../model/queueReport','redis','localhost','enqueue','tail','finally','sequence','queueReports','agents','channels','queueChannels','voiceQueues','campaigns','variables','syncQueueSummary','bind','queuesummarycomplete','syncQueueSummaryComplete','queuecallerjoin','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','agentcomplete','syncAgentComplete','agentconnect','syncAgentConnect','varset','hangup','syncHangup','syncFullyBooted','newexten','syncNewExten','musiconholdstart','syncMusicOnHoldStop','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopQueueShow','isEmpty','hasOwnProperty','originated','talking','pTalking','waiting','queueStatusComplete','prototype','switch','isNil','channel','No\x20such\x20channel','error','[%s][voiceQueueReport][checkChannel]','inspect','[%s][voiceQueueReport][checkQueueReport]','[%s][voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emitVoiceQueueChannelRemove','clearqueuereport','emit','emitVoiceQueueChannelSave','[%s][voiceQueueReport][','uniqueid','format','voice:queue:%s','name','debug',']\x20sending\x20voice_queue_channel:remove\x20event:','voice_queue_channel:remove','voice_queue_presence:remove','emitVoiceQueueSummary','type','inbound','strategy','answered','available','sumBillable','sumDuration','sumHoldTime','total','unmanaged','abandoned','Trunk','active','callerid','Interval','stringify','voice_queue:save','isNotNull','clearZombieChannels','Action','queues','catch','[voiceQueueReport][queues]','loopQueueSummary','queuesummary','then','flagQueueSummary','[voiceQueueReport][queuesummary]','queue','[voiceQueueReport][queuesummary]\x20event:','info','callers','loggedIn','toNumber'];(function(_0xbe200f,_0x4b50eb){var _0x192597=function(_0x106cfd){while(--_0x106cfd){_0xbe200f['push'](_0xbe200f['shift']());}};_0x192597(++_0x4b50eb);}(_0xfbac,0x167));var _0xcfba=function(_0x230254,_0xa6080){_0x230254=_0x230254-0x0;var _0x3f33cc=_0xfbac[_0x230254];return _0x3f33cc;};'use strict';var _=require('lodash');var moment=require(_0xcfba('0x0'));var util=require(_0xcfba('0x1'));var md5=require(_0xcfba('0x2'));var Redis=require(_0xcfba('0x3'));var config=require(_0xcfba('0x4'));var logger=require(_0xcfba('0x5'))('ami');var ami=require('../ami');var QueueReport=require(_0xcfba('0x6'));config[_0xcfba('0x7')]=_['defaults'](config['redis'],{'host':_0xcfba('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xcfba('0x7')]));var Sequence=function(){};Sequence['prototype'][_0xcfba('0x9')]=function(_0x2c68cd){this['tail']=this[_0xcfba('0xa')]?this[_0xcfba('0xa')][_0xcfba('0xb')](_0x2c68cd):_0x2c68cd();};function VoiceQueueReport(_0x460f01){this[_0xcfba('0xc')]=new Sequence();this[_0xcfba('0xd')]={};this[_0xcfba('0xe')]=_0x460f01[_0xcfba('0xe')];this[_0xcfba('0xf')]=_0x460f01[_0xcfba('0x10')];this[_0xcfba('0x11')]=_0x460f01[_0xcfba('0x11')];this['flagQueueSummary']=!![];this['campaigns']=_0x460f01[_0xcfba('0x12')];this[_0xcfba('0x13')]={};ami['on']('queuesummary',this[_0xcfba('0x14')][_0xcfba('0x15')](this));ami['on'](_0xcfba('0x16'),this[_0xcfba('0x17')][_0xcfba('0x15')](this));ami['on'](_0xcfba('0x18'),this[_0xcfba('0x19')][_0xcfba('0x15')](this));ami['on'](_0xcfba('0x1a'),this[_0xcfba('0x1b')][_0xcfba('0x15')](this));ami['on'](_0xcfba('0x1c'),this[_0xcfba('0x1d')]['bind'](this));ami['on'](_0xcfba('0x1e'),this[_0xcfba('0x1f')][_0xcfba('0x15')](this));ami['on'](_0xcfba('0x20'),this[_0xcfba('0x21')][_0xcfba('0x15')](this));ami['on'](_0xcfba('0x22'),this['syncVarSet'][_0xcfba('0x15')](this));ami['on'](_0xcfba('0x23'),this[_0xcfba('0x24')]['bind'](this));ami['on']('fullybooted',this[_0xcfba('0x25')][_0xcfba('0x15')](this));ami['on'](_0xcfba('0x26'),this[_0xcfba('0x27')][_0xcfba('0x15')](this));ami['on'](_0xcfba('0x28'),this['syncMusicOnHoldStart'][_0xcfba('0x15')](this));ami['on']('musiconholdstop',this[_0xcfba('0x29')][_0xcfba('0x15')](this));ami['on']('attendedtransfer',this[_0xcfba('0x2a')][_0xcfba('0x15')](this));ami['on'](_0xcfba('0x2b'),this[_0xcfba('0x2c')]['bind'](this));this['loopQueueSummary']();this[_0xcfba('0x2d')]();}function clearChannels(_0x119c6e){if(!_[_0xcfba('0x2e')](_0x119c6e)){for(var _0x4c9098 in _0x119c6e){if(_0x119c6e[_0xcfba('0x2f')](_0x4c9098)){delete _0x119c6e[_0x4c9098];}}}}function clearCampaigns(_0x544913){if(!_[_0xcfba('0x2e')](_0x544913)){for(var _0x5e79c7 in _0x544913){if(_0x544913['hasOwnProperty'](_0x5e79c7)){_0x544913[_0x5e79c7][_0xcfba('0x30')]=0x0;}}}}function clearVoiceQueues(_0x11f949){if(!_['isEmpty'](_0x11f949)){for(var _0x2f7ac0 in _0x11f949){if(_0x11f949[_0xcfba('0x2f')](_0x2f7ac0)){_0x11f949[_0x2f7ac0][_0xcfba('0x30')]=0x0;_0x11f949[_0x2f7ac0][_0xcfba('0x31')]=0x0;_0x11f949[_0x2f7ac0][_0xcfba('0x32')]=0x0;_0x11f949[_0x2f7ac0][_0xcfba('0x33')]=0x0;_0x11f949[_0x2f7ac0][_0xcfba('0x34')]=!![];}}}}function clearAgentBooked(_0x4585ec){if(!_['isEmpty'](_0x4585ec)){for(var _0x7c7d76 in _0x4585ec){if(_0x4585ec['hasOwnProperty'](_0x7c7d76)){_0x4585ec[_0x7c7d76]['unlockRR']=!![];}}}}VoiceQueueReport[_0xcfba('0x35')]['clearZombieChannels']=function(){var _0x2ec629=this;for(var _0x57e1c1 in this[_0xcfba('0xf')]){if(this[_0xcfba('0xf')][_0xcfba('0x2f')](_0x57e1c1)&&!this[_0xcfba('0xf')][_0x57e1c1][_0xcfba('0x36')]){this[_0xcfba('0xc')][_0xcfba('0x9')](function(){if(!_[_0xcfba('0x37')](_0x2ec629['channels'][_0x57e1c1])){return ami['Action']({'action':'status','channel':_0x2ec629[_0xcfba('0xf')][_0x57e1c1][_0xcfba('0x38')]})['catch'](function(_0x34f60b){if(_0x34f60b['message']===_0xcfba('0x39')){setTimeout(function(){if(_0x2ec629[_0xcfba('0xf')][_0x57e1c1]){delete _0x2ec629[_0xcfba('0xf')][_0x57e1c1];logger[_0xcfba('0x3a')](_0xcfba('0x3b'),_0x57e1c1,util[_0xcfba('0x3c')](_0x34f60b,{'showHidden':![],'depth':null}));}if(_0x2ec629[_0xcfba('0xd')][_0x57e1c1]){delete _0x2ec629[_0xcfba('0xd')][_0x57e1c1];logger['error'](_0xcfba('0x3d'),_0x57e1c1,util[_0xcfba('0x3c')](_0x34f60b,{'showHidden':![],'depth':null}));}if(_0x2ec629[_0xcfba('0x13')][_0x57e1c1]){delete _0x2ec629[_0xcfba('0x13')][_0x57e1c1];logger[_0xcfba('0x3a')](_0xcfba('0x3e'),_0x57e1c1,util[_0xcfba('0x3c')](_0x34f60b,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport['prototype'][_0xcfba('0x25')]=function(){logger[_0xcfba('0x3a')](_0xcfba('0x3f'));clearChannels(this[_0xcfba('0xf')]);this[_0xcfba('0x40')](this['queueReports']);clearAgentBooked(this['agents']);clearVoiceQueues(this[_0xcfba('0x11')]);clearCampaigns(this[_0xcfba('0x12')]);};VoiceQueueReport[_0xcfba('0x35')][_0xcfba('0x40')]=function(_0x548c3c){var _0x40a6ae=this;if(!_[_0xcfba('0x2e')](_0x548c3c)){for(var _0x4fc962 in _0x548c3c){if(_0x548c3c['hasOwnProperty'](_0x4fc962)){_0x40a6ae[_0xcfba('0x41')](_0x548c3c[_0x4fc962],_0xcfba('0x42'));delete _0x548c3c[_0x4fc962];}}}};VoiceQueueReport[_0xcfba('0x35')][_0xcfba('0x43')]=function(_0x268aa8,_0x173903,_0x58ffb6){io['to'](_0x268aa8)['emit'](_0x173903,_0x58ffb6);};VoiceQueueReport[_0xcfba('0x35')][_0xcfba('0x44')]=function(_0x577b46,_0x438aeb){logger['debug'](_0xcfba('0x45')+_0x438aeb+']\x20sending\x20voice_queue_channel:save\x20event:',_0x577b46[_0xcfba('0x46')],util[_0xcfba('0x3c')](_0x577b46,{'showHidden':![],'depth':null}));this[_0xcfba('0x43')](util[_0xcfba('0x47')](_0xcfba('0x48'),_0x577b46[_0xcfba('0x49')]),'voice_queue_channel:save',_0x577b46);io[_0xcfba('0x43')]('voice_queue_presence:save',_0x577b46);};VoiceQueueReport['prototype'][_0xcfba('0x41')]=function(_0x1498f3,_0x1279a9){logger[_0xcfba('0x4a')](_0xcfba('0x45')+_0x1279a9+_0xcfba('0x4b'),_0x1498f3['uniqueid'],util['inspect'](_0x1498f3,{'showHidden':![],'depth':null}));this['emit'](util[_0xcfba('0x47')](_0xcfba('0x48'),_0x1498f3[_0xcfba('0x49')]),_0xcfba('0x4c'),_0x1498f3);io[_0xcfba('0x43')](_0xcfba('0x4d'),_0x1498f3);};VoiceQueueReport[_0xcfba('0x35')][_0xcfba('0x4e')]=function(_0x813013,_0x55b945){if(_0x813013[_0xcfba('0x4f')]===_0xcfba('0x50')){var _0xd2a387={'id':_0x813013['id'],'name':_0x813013[_0xcfba('0x49')],'strategy':_0x813013[_0xcfba('0x51')],'answered':_0x813013[_0xcfba('0x52')],'available':_0x813013[_0xcfba('0x53')],'loggedIn':_0x813013['loggedIn'],'pTalking':_0x813013[_0xcfba('0x32')],'sumBillable':_0x813013[_0xcfba('0x54')],'sumDuration':_0x813013[_0xcfba('0x55')],'sumHoldTime':_0x813013[_0xcfba('0x56')]||0x0,'talking':_0x813013['talking'],'total':_0x813013[_0xcfba('0x57')],'type':_0x813013[_0xcfba('0x4f')],'unmanaged':_0x813013[_0xcfba('0x58')],'abandoned':_0x813013[_0xcfba('0x59')],'waiting':_0x813013[_0xcfba('0x33')]};if(_0x813013[_0xcfba('0x5a')]){_0xd2a387[_0xcfba('0x5a')]={'id':_0x813013['Trunk']['id'],'name':_0x813013['Trunk'][_0xcfba('0x49')],'active':_0x813013[_0xcfba('0x5a')][_0xcfba('0x5b')],'callerid':_0x813013[_0xcfba('0x5a')][_0xcfba('0x5c')]};}if(_0x813013[_0xcfba('0x5d')]){_0xd2a387['Interval']={'id':_0x813013['Interval']['id'],'name':_0x813013['Interval'][_0xcfba('0x49')]};}var _0x5dbaaa=md5(JSON[_0xcfba('0x5e')](_0xd2a387));if(_0x813013[_0xcfba('0x2')]!==_0x5dbaaa){_0x813013[_0xcfba('0x2')]=_0x5dbaaa;logger[_0xcfba('0x4a')]('[voiceQueueReport]['+_0x55b945+']\x20sending\x20voice_queue:save\x20event:',util[_0xcfba('0x3c')](_0xd2a387,{'showHidden':![],'depth':null}));this[_0xcfba('0x43')](util[_0xcfba('0x47')](_0xcfba('0x48'),_0xd2a387[_0xcfba('0x49')]),_0xcfba('0x5f'),_0xd2a387);}}};VoiceQueueReport[_0xcfba('0x35')][_0xcfba('0x60')]=function(_0x51b297){return _0x51b297!==null&&!_['isUndefined'](_0x51b297);};VoiceQueueReport[_0xcfba('0x35')][_0xcfba('0x2d')]=function(){var _0x358477=this;setInterval(function(){_0x358477[_0xcfba('0x61')]();ami[_0xcfba('0x62')]({'action':_0xcfba('0x63')})[_0xcfba('0x64')](function(_0x3c76a4){logger[_0xcfba('0x3a')](_0xcfba('0x65'),util[_0xcfba('0x3c')](_0x3c76a4,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0xcfba('0x35')][_0xcfba('0x66')]=function(){var _0xbf1c0a=this;setInterval(function(){if(_0xbf1c0a['flagQueueSummary']){return ami['Action']({'action':_0xcfba('0x67')})[_0xcfba('0x68')](function(_0x28cd32){_0xbf1c0a[_0xcfba('0x69')]=![];})['catch'](function(_0x31cb0c){logger[_0xcfba('0x3a')](_0xcfba('0x6a'),util['inspect'](_0x31cb0c,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0xcfba('0x35')][_0xcfba('0x14')]=function(_0x21ee2b){try{if(this['isNotNull'](_0x21ee2b)&&this[_0xcfba('0x60')](_0x21ee2b[_0xcfba('0x6b')])){logger[_0xcfba('0x4a')](_0xcfba('0x6c'),util['inspect'](_0x21ee2b,{'showHidden':![],'depth':null}));if(this['voiceQueues'][_0x21ee2b[_0xcfba('0x6b')]]){logger[_0xcfba('0x6d')]('[voiceQueueReport][queuesummary]\x20name:%s',_0x21ee2b['queue']);var _0x3692b5=_['countBy'](this[_0xcfba('0xf')],_0xcfba('0x6b'))[_0x21ee2b[_0xcfba('0x6b')]]||0x0;var _0x4a36be=_0x3692b5-_0x21ee2b[_0xcfba('0x6e')];if(this[_0xcfba('0x11')][_0x21ee2b[_0xcfba('0x6b')]][_0xcfba('0x33')]!==_['toNumber'](_0x21ee2b[_0xcfba('0x6e')])||this[_0xcfba('0x11')][_0x21ee2b[_0xcfba('0x6b')]][_0xcfba('0x6f')]!==_[_0xcfba('0x70')](_0x21ee2b[_0xcfba('0x71')])||this['voiceQueues'][_0x21ee2b[_0xcfba('0x6b')]][_0xcfba('0x53')]!==_[_0xcfba('0x70')](_0x21ee2b['available'])||this[_0xcfba('0x11')][_0x21ee2b['queue']][_0xcfba('0x31')]!==_0x4a36be){this[_0xcfba('0x11')][_0x21ee2b[_0xcfba('0x6b')]][_0xcfba('0x33')]=_['toNumber'](_0x21ee2b[_0xcfba('0x6e')]);this[_0xcfba('0x11')][_0x21ee2b[_0xcfba('0x6b')]][_0xcfba('0x6f')]=_['toNumber'](_0x21ee2b[_0xcfba('0x71')]);this['voiceQueues'][_0x21ee2b[_0xcfba('0x6b')]][_0xcfba('0x53')]=_[_0xcfba('0x70')](_0x21ee2b[_0xcfba('0x53')]);this[_0xcfba('0x11')][_0x21ee2b['queue']][_0xcfba('0x31')]=_0x4a36be>0x0?_0x4a36be:0x0;this['voiceQueues'][_0x21ee2b[_0xcfba('0x6b')]][_0xcfba('0x31')]=this[_0xcfba('0x11')][_0x21ee2b[_0xcfba('0x6b')]]['talking']>_[_0xcfba('0x70')](_0x21ee2b['loggedin'])?_[_0xcfba('0x70')](_0x21ee2b['loggedin']):this[_0xcfba('0x11')][_0x21ee2b[_0xcfba('0x6b')]]['talking'];this['emitVoiceQueueSummary'](this[_0xcfba('0x11')][_0x21ee2b[_0xcfba('0x6b')]],'queuesummary');}logger[_0xcfba('0x4a')](_0xcfba('0x72'),util[_0xcfba('0x3c')](this[_0xcfba('0x11')][_0x21ee2b[_0xcfba('0x6b')]],{'showHidden':![],'depth':null}));ami['emit'](_0xcfba('0x73'),this[_0xcfba('0x11')][_0x21ee2b['queue']]);}}}catch(_0x4c08a1){logger[_0xcfba('0x3a')](_0xcfba('0x6a'),util[_0xcfba('0x3c')](_0x4c08a1,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xcfba('0x35')]['syncQueueSummaryComplete']=function(_0x553ec5){logger['debug']('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0xcfba('0x3c')](_0x553ec5,{'showHidden':![],'depth':null}));this[_0xcfba('0x69')]=!![];};VoiceQueueReport[_0xcfba('0x35')][_0xcfba('0x19')]=function(_0x407012){try{if(this[_0xcfba('0x60')](_0x407012)){logger[_0xcfba('0x4a')](_0xcfba('0x74'),_0x407012['uniqueid'],util[_0xcfba('0x3c')](_0x407012,{'showHidden':![],'depth':null}));if(_[_0xcfba('0x75')](this[_0xcfba('0xd')][_0x407012[_0xcfba('0x46')]]))this[_0xcfba('0xd')][_0x407012[_0xcfba('0x46')]]=[];if(_[_0xcfba('0x75')](this[_0xcfba('0xf')][_0x407012[_0xcfba('0x46')]]))this[_0xcfba('0xf')][_0x407012['uniqueid']]={};var _0x483fb7=new QueueReport();_0x483fb7[_0xcfba('0x49')]=_0x407012[_0xcfba('0x6b')];_0x483fb7[_0xcfba('0x4f')]=this[_0xcfba('0x11')][_0x483fb7[_0xcfba('0x49')]]&&this[_0xcfba('0x11')][_0x483fb7[_0xcfba('0x49')]][_0xcfba('0x4f')]?this[_0xcfba('0x11')][_0x483fb7[_0xcfba('0x49')]][_0xcfba('0x4f')]||_0xcfba('0x50'):_0xcfba('0x50');_0x483fb7['queue']=_0x407012[_0xcfba('0x6b')];_0x483fb7[_0xcfba('0x76')]=moment()[_0xcfba('0x47')](_0xcfba('0x77'));_0x483fb7['position']=_0x407012[_0xcfba('0x78')];_0x483fb7[_0xcfba('0x79')]=_0x407012[_0xcfba('0x79')];_0x483fb7[_0xcfba('0x46')]=_0x407012[_0xcfba('0x46')];_0x483fb7['routealias']=this[_0xcfba('0xf')][_0x407012[_0xcfba('0x46')]][_0xcfba('0x7a')];logger[_0xcfba('0x6d')](_0xcfba('0x7b'),_0x483fb7[_0xcfba('0x49')],_0x483fb7[_0xcfba('0x4f')]);_[_0xcfba('0x7c')](_0x483fb7,_[_0xcfba('0x7d')](_0x407012,_[_0xcfba('0x7e')](_0x483fb7)));this[_0xcfba('0xd')][_0x407012['uniqueid']][_0xcfba('0x7f')](_0x483fb7);this['channels'][_0x407012['uniqueid']]=_0x483fb7;this[_0xcfba('0x44')](_0x483fb7,_0xcfba('0x18'));}}catch(_0x22d8c7){logger[_0xcfba('0x3a')]('[%s][voiceQueueReport][queuecallerjoin]',_0x407012[_0xcfba('0x46')],util[_0xcfba('0x3c')](_0x22d8c7,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xcfba('0x35')][_0xcfba('0x1b')]=function(_0x29507d){try{if(this[_0xcfba('0x60')](_0x29507d)){logger[_0xcfba('0x4a')](_0xcfba('0x80'),_0x29507d[_0xcfba('0x46')],util[_0xcfba('0x3c')](_0x29507d,{'showHidden':![],'depth':null}));if(this[_0xcfba('0xd')][_0x29507d[_0xcfba('0x46')]]){var _0x321809=_[_0xcfba('0x81')](this['queueReports'][_0x29507d[_0xcfba('0x46')]]);_0x321809[_0xcfba('0x82')]=![];_0x321809[_0xcfba('0x83')]=null;_0x321809[_0xcfba('0x84')]=_0x29507d[_0xcfba('0x84')];_0x321809[_0xcfba('0x85')]=_0x29507d['originalposition'];_0x321809['queuecallerabandon']=!![];_0x321809[_0xcfba('0x86')]=moment()[_0xcfba('0x47')](_0xcfba('0x77'));_0x321809[_0xcfba('0x87')]=_0xcfba('0x88');_0x321809['lastAssignedTo']=null;logger['info'](_0xcfba('0x89'),_0x321809[_0xcfba('0x49')],_0x321809[_0xcfba('0x4f')]);this['channels'][_0x29507d[_0xcfba('0x46')]]=_0x321809;this['emitVoiceQueueChannelRemove'](_0x321809,_0xcfba('0x1a'));}}}catch(_0x493e63){logger[_0xcfba('0x3a')](_0xcfba('0x80'),_0x29507d[_0xcfba('0x46')],util[_0xcfba('0x3c')](_0x493e63,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xcfba('0x1d')]=function(_0xe3af){try{if(this[_0xcfba('0x60')](_0xe3af)){logger[_0xcfba('0x4a')](_0xcfba('0x8a'),_0xe3af[_0xcfba('0x46')],util[_0xcfba('0x3c')](_0xe3af,{'showHidden':![],'depth':null}));if(this['queueReports'][_0xe3af[_0xcfba('0x46')]]){var _0x4f5f67=_[_0xcfba('0x81')](this[_0xcfba('0xd')][_0xe3af[_0xcfba('0x46')]]);_0x4f5f67[_0xcfba('0x8b')]=moment()[_0xcfba('0x47')](_0xcfba('0x77'));_0x4f5f67[_0xcfba('0x8c')]=_0xe3af['connectedlinenum'];_0x4f5f67[_0xcfba('0x8d')]=_0xe3af['connectedlinename'];logger[_0xcfba('0x6d')](_0xcfba('0x8e'),_0x4f5f67[_0xcfba('0x49')],_0x4f5f67[_0xcfba('0x4f')],_0xe3af[_0xcfba('0x8c')],_0xe3af[_0xcfba('0x8d')]);this[_0xcfba('0xf')][_0xe3af[_0xcfba('0x46')]]=_0x4f5f67;this[_0xcfba('0x44')](_0x4f5f67,_0xcfba('0x1c'));}}}catch(_0x1d7df9){logger['error']('[%s][voiceQueueReport][queuecallerleave]',_0xe3af[_0xcfba('0x46')],util[_0xcfba('0x3c')](_0x1d7df9,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xcfba('0x35')][_0xcfba('0x21')]=function(_0x578027){try{if(this[_0xcfba('0x60')](_0x578027)){logger[_0xcfba('0x4a')]('[%s][voiceQueueReport][agentconnect]',_0x578027[_0xcfba('0x46')],util['inspect'](_0x578027,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x578027[_0xcfba('0x46')]]){var _0x59b793=_[_0xcfba('0x81')](this['queueReports'][_0x578027[_0xcfba('0x46')]]);_0x59b793['queuecallercomplete']=!![];_0x59b793[_0xcfba('0x87')]=_0xcfba('0x8f');logger[_0xcfba('0x6d')](_0xcfba('0x90'),_0x59b793[_0xcfba('0x49')],_0x59b793[_0xcfba('0x4f')]);}}}catch(_0x59169d){logger[_0xcfba('0x3a')](_0xcfba('0x91'),_0x578027[_0xcfba('0x46')],util[_0xcfba('0x3c')](_0x59169d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xcfba('0x35')][_0xcfba('0x1f')]=function(_0x18c1d8){try{if(this[_0xcfba('0x60')](_0x18c1d8)){logger[_0xcfba('0x4a')](_0xcfba('0x92'),_0x18c1d8[_0xcfba('0x46')],util[_0xcfba('0x3c')](_0x18c1d8,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x18c1d8[_0xcfba('0x46')]]){var _0x88f6ab=_[_0xcfba('0x81')](this[_0xcfba('0xd')][_0x18c1d8[_0xcfba('0x46')]]);_0x88f6ab['queuecallerabandon']=![];_0x88f6ab[_0xcfba('0x86')]=null;_0x88f6ab[_0xcfba('0x93')]=!![];_0x88f6ab[_0xcfba('0x94')]=_0x18c1d8[_0xcfba('0x95')];_0x88f6ab[_0xcfba('0x84')]=_0x18c1d8['holdtime'];_0x88f6ab[_0xcfba('0x82')]=!![];_0x88f6ab[_0xcfba('0x96')]=![];_0x88f6ab['queuecallerexitAt']=null;if(!_0x88f6ab[_0xcfba('0x97')]){if(_0x18c1d8[_0xcfba('0x98')]=='transfer'){_0x88f6ab[_0xcfba('0x87')]='COMPLETED';logger[_0xcfba('0x6d')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x88f6ab[_0xcfba('0x49')],_0x88f6ab[_0xcfba('0x4f')]);}else{if(_[_0xcfba('0x99')](_0x18c1d8[_0xcfba('0x38')][_0xcfba('0x9a')](),_0xcfba('0x9b'))){if(this[_0xcfba('0xd')][_0x18c1d8['linkedid']]){var _0xa7ade7=_[_0xcfba('0x81')](this[_0xcfba('0xd')][_0x18c1d8[_0xcfba('0x9c')]]);_0xa7ade7[_0xcfba('0x82')]=![];_0xa7ade7[_0xcfba('0x96')]=!![];_0xa7ade7[_0xcfba('0x9d')]=moment(_0x88f6ab['queuecallerjoinAt'])['add'](_0x18c1d8[_0xcfba('0x84')],'seconds')[_0xcfba('0x47')](_0xcfba('0x77'));_0xa7ade7[_0xcfba('0x87')]='FORWARDTRANSFER';_0xa7ade7[_0xcfba('0x97')]=!![];_0xa7ade7[_0xcfba('0x9e')]=_0xcfba('0x9f');_0xa7ade7['transferexten']=_0x18c1d8[_0xcfba('0xa0')];_0xa7ade7[_0xcfba('0xa1')]=_0x18c1d8[_0xcfba('0x46')];logger['info'](_0xcfba('0xa2'),_0xa7ade7[_0xcfba('0x49')],_0xa7ade7[_0xcfba('0x4f')]);var _0x194218=this[_0xcfba('0xd')][_0x18c1d8[_0xcfba('0x9c')]];this[_0xcfba('0xd')][_0x18c1d8['linkedid']]=this['queueReports'][_0x18c1d8[_0xcfba('0x46')]];this[_0xcfba('0xd')][_0x18c1d8[_0xcfba('0x46')]]=_0x194218;}}else{_0x88f6ab[_0xcfba('0x87')]=_0xcfba('0xa3')+_0x18c1d8[_0xcfba('0x98')][_0xcfba('0xa4')]();logger[_0xcfba('0x6d')](_0xcfba('0xa5'),_0x88f6ab['name'],_0x88f6ab[_0xcfba('0x4f')],_0x88f6ab[_0xcfba('0x87')]);}}}this[_0xcfba('0xf')][_0x18c1d8[_0xcfba('0x46')]]=_0x88f6ab;this['emitVoiceQueueChannelRemove'](_0x88f6ab,_0xcfba('0x1e'));}}}catch(_0x189642){logger[_0xcfba('0x3a')]('[%s][voiceQueueReport][agentcomplete]',_0x18c1d8[_0xcfba('0x46')],util['inspect'](_0x189642,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xcfba('0xa6')]=function(_0x355c05){try{if(this[_0xcfba('0x60')](_0x355c05)){logger['debug'](_0xcfba('0xa7'),_0x355c05['uniqueid'],util['inspect'](_0x355c05,{'showHidden':![],'depth':null}));this[_0xcfba('0xa8')](_0x355c05[_0xcfba('0x46')],_['keys'](_0x355c05[_0xcfba('0xa9')])[0x0],_0x355c05[_0xcfba('0xaa')]);if(this[_0xcfba('0xd')][_0x355c05['uniqueid']]){var _0x1d1183=_[_0xcfba('0x81')](this['queueReports'][_0x355c05[_0xcfba('0x46')]]);if(_0x1d1183){if(this[_0xcfba('0x60')](_0x355c05[_0xcfba('0xa9')])&&this['isNotNull'](_0x355c05[_0xcfba('0xa9')][_0xcfba('0xab')])){switch(_0x355c05[_0xcfba('0xaa')]){case'CONTINUE':_0x1d1183[_0xcfba('0x96')]=![];_0x1d1183[_0xcfba('0x9d')]=null;break;case'TIMEOUT':_0x1d1183['lastevent']=_0xcfba('0xac');_0x1d1183['queuecallerexit']=!![];_0x1d1183[_0xcfba('0x9d')]=moment()[_0xcfba('0x47')]('YYYY-MM-DD\x20HH:mm:ss');_0x1d1183[_0xcfba('0x8b')]=moment()[_0xcfba('0x47')](_0xcfba('0x77'));logger['debug'](_0xcfba('0xad'),_0x355c05[_0xcfba('0x46')],util[_0xcfba('0x3c')](_0x1d1183,{'showHidden':![],'depth':null}));ami[_0xcfba('0x43')](_0xcfba('0xae'),_0x1d1183);break;default:_0x1d1183[_0xcfba('0x96')]=!![];_0x1d1183['queuecallerexitAt']=moment()[_0xcfba('0x47')](_0xcfba('0x77'));_0x1d1183[_0xcfba('0x8b')]=moment()[_0xcfba('0x47')](_0xcfba('0x77'));}_0x1d1183['queuecallerabandon']=![];_0x1d1183[_0xcfba('0x86')]=null;_0x1d1183[_0xcfba('0x87')]=_0x355c05[_0xcfba('0xaa')];this[_0xcfba('0xf')][_0x355c05[_0xcfba('0x46')]]=_0x1d1183;this[_0xcfba('0x41')](_0x1d1183,_0xcfba('0x22'));}else if(this[_0xcfba('0x60')](_0x355c05[_0xcfba('0xa9')])&&this[_0xcfba('0x60')](_0x355c05[_0xcfba('0xa9')][_0xcfba('0xaf')])){if(!_0x1d1183[_0xcfba('0x1a')]){_0x1d1183[_0xcfba('0x96')]=!![];_0x1d1183[_0xcfba('0x9d')]=moment()[_0xcfba('0x47')](_0xcfba('0x77'));_0x1d1183[_0xcfba('0x87')]=_0xcfba('0xb0');_0x1d1183['queuecallerleaveAt']=moment()['format'](_0xcfba('0x77'));this[_0xcfba('0xf')][_0x355c05[_0xcfba('0x46')]]=_0x1d1183;}}logger[_0xcfba('0x6d')](_0xcfba('0xb1'),_0x355c05[_0xcfba('0x46')],_0x1d1183[_0xcfba('0x49')],_0x1d1183['type'],_['keys'](_0x355c05[_0xcfba('0xa9')])[0x0],_0x355c05['value']);_0x1d1183[_0xcfba('0x13')]=this['variables'][_0x355c05['uniqueid']];}}}}catch(_0x23506f){logger['error']('[%s][voiceQueueReport][varset]',_0x355c05[_0xcfba('0x46')],util['inspect'](_0x23506f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xcfba('0x35')][_0xcfba('0xa8')]=function(_0x4714e3,_0x5dd875,_0x571ed8){var _0x5e8908=[_0xcfba('0xb2'),_0xcfba('0xb3'),'rtpaudioqosjitter',_0xcfba('0xb4'),_0xcfba('0xb5'),_0xcfba('0xb6'),_0xcfba('0xb7'),_0xcfba('0xb8'),_0xcfba('0xb9'),'sipuri',_0xcfba('0xba'),_0xcfba('0xbb'),_0xcfba('0xbc'),'memberdynamic',_0xcfba('0xbd'),_0xcfba('0xbe'),_0xcfba('0x95'),'memberpenalty',_0xcfba('0xbf')];if(!_[_0xcfba('0x37')](_0x5dd875)&&!_[_0xcfba('0xc0')](_0x5e8908,_0x5dd875)){if(_[_0xcfba('0x75')](this['variables'][_0x4714e3])){this[_0xcfba('0x13')][_0x4714e3]={};}this[_0xcfba('0x13')][_0x4714e3][_0x5dd875]=_0x571ed8;}};VoiceQueueReport[_0xcfba('0x35')]['syncHangup']=function(_0x2abe10){try{if(this['isNotNull'](_0x2abe10)){logger[_0xcfba('0x4a')](_0xcfba('0xc1'),_0x2abe10[_0xcfba('0x46')],util['inspect'](_0x2abe10,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x2abe10[_0xcfba('0x46')]]){for(var _0x3548ee=0x0,_0x4e5b8f={};_0x3548ee0x0?_0x5070a6:0x0;this[_0x46a2('0x12')][_0x5e926e[_0x46a2('0x67')]][_0x46a2('0x30')]=this[_0x46a2('0x12')][_0x5e926e[_0x46a2('0x67')]][_0x46a2('0x30')]>_[_0x46a2('0x6c')](_0x5e926e['loggedin'])?_['toNumber'](_0x5e926e['loggedin']):this[_0x46a2('0x12')][_0x5e926e[_0x46a2('0x67')]][_0x46a2('0x30')];this[_0x46a2('0x4e')](this[_0x46a2('0x12')][_0x5e926e[_0x46a2('0x67')]],_0x46a2('0x14'));}logger['debug'](_0x46a2('0x6e'),util['inspect'](this['voiceQueues'][_0x5e926e[_0x46a2('0x67')]],{'showHidden':![],'depth':null}));ami[_0x46a2('0x41')](_0x46a2('0x6f'),this['voiceQueues'][_0x5e926e[_0x46a2('0x67')]]);}}}catch(_0x3dc724){logger[_0x46a2('0x3c')](_0x46a2('0x70'),util[_0x46a2('0x3e')](_0x3dc724,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x46a2('0xa')][_0x46a2('0x18')]=function(_0x136151){logger[_0x46a2('0x43')](_0x46a2('0x71'),util['inspect'](_0x136151,{'showHidden':![],'depth':null}));this[_0x46a2('0x66')]=!![];};VoiceQueueReport[_0x46a2('0xa')][_0x46a2('0x1a')]=function(_0x3c7c10){try{if(this[_0x46a2('0x72')](_0x3c7c10)){logger[_0x46a2('0x43')](_0x46a2('0x73'),_0x3c7c10['uniqueid'],util[_0x46a2('0x3e')](_0x3c7c10,{'showHidden':![],'depth':null}));if(_[_0x46a2('0x62')](this[_0x46a2('0xe')][_0x3c7c10[_0x46a2('0x46')]]))this['queueReports'][_0x3c7c10[_0x46a2('0x46')]]=[];if(_[_0x46a2('0x62')](this[_0x46a2('0x10')][_0x3c7c10[_0x46a2('0x46')]]))this['channels'][_0x3c7c10[_0x46a2('0x46')]]={};var _0x2f30f2=new QueueReport();_0x2f30f2[_0x46a2('0x48')]=_0x3c7c10[_0x46a2('0x67')];_0x2f30f2[_0x46a2('0x4f')]=this[_0x46a2('0x12')][_0x2f30f2[_0x46a2('0x48')]]&&this['voiceQueues'][_0x2f30f2['name']][_0x46a2('0x4f')]?this[_0x46a2('0x12')][_0x2f30f2['name']][_0x46a2('0x4f')]||_0x46a2('0x50'):'inbound';_0x2f30f2[_0x46a2('0x67')]=_0x3c7c10[_0x46a2('0x67')];_0x2f30f2['queuecallerjoinAt']=moment()[_0x46a2('0x47')](_0x46a2('0x74'));_0x2f30f2[_0x46a2('0x75')]=_0x3c7c10[_0x46a2('0x75')];_0x2f30f2[_0x46a2('0x76')]=_0x3c7c10[_0x46a2('0x76')];_0x2f30f2[_0x46a2('0x46')]=_0x3c7c10[_0x46a2('0x46')];_0x2f30f2['routealias']=this[_0x46a2('0x10')][_0x3c7c10[_0x46a2('0x46')]]['routealias'];logger['info'](_0x46a2('0x77'),_0x2f30f2[_0x46a2('0x48')],_0x2f30f2['type']);_['merge'](_0x2f30f2,_[_0x46a2('0x78')](_0x3c7c10,_['keys'](_0x2f30f2)));this[_0x46a2('0xe')][_0x3c7c10[_0x46a2('0x46')]][_0x46a2('0x79')](_0x2f30f2);this[_0x46a2('0x10')][_0x3c7c10['uniqueid']]=_0x2f30f2;this['emitVoiceQueueChannelSave'](_0x2f30f2,_0x46a2('0x19'));}}catch(_0x13f446){logger[_0x46a2('0x3c')](_0x46a2('0x73'),_0x3c7c10[_0x46a2('0x46')],util[_0x46a2('0x3e')](_0x13f446,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x46a2('0xa')][_0x46a2('0x1b')]=function(_0x9eade3){try{if(this[_0x46a2('0x72')](_0x9eade3)){logger['debug']('[%s][voiceQueueReport][queuecallerabandon]',_0x9eade3[_0x46a2('0x46')],util[_0x46a2('0x3e')](_0x9eade3,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x9eade3[_0x46a2('0x46')]]){var _0x1e2ef4=_[_0x46a2('0x7a')](this['queueReports'][_0x9eade3[_0x46a2('0x46')]]);_0x1e2ef4[_0x46a2('0x7b')]=![];_0x1e2ef4[_0x46a2('0x7c')]=null;_0x1e2ef4[_0x46a2('0x7d')]=_0x9eade3[_0x46a2('0x7d')];_0x1e2ef4[_0x46a2('0x7e')]=_0x9eade3[_0x46a2('0x7e')];_0x1e2ef4[_0x46a2('0x7f')]=!![];_0x1e2ef4['queuecallerabandonAt']=moment()[_0x46a2('0x47')](_0x46a2('0x74'));_0x1e2ef4['queuecallerexitreason']='ABANDONED';_0x1e2ef4[_0x46a2('0x80')]=null;logger[_0x46a2('0x68')](_0x46a2('0x81'),_0x1e2ef4[_0x46a2('0x48')],_0x1e2ef4['type']);this[_0x46a2('0x10')][_0x9eade3['uniqueid']]=_0x1e2ef4;this[_0x46a2('0x4b')](_0x1e2ef4,_0x46a2('0x7f'));}}}catch(_0x46801a){logger[_0x46a2('0x3c')](_0x46a2('0x82'),_0x9eade3[_0x46a2('0x46')],util['inspect'](_0x46801a,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueCallerLeave']=function(_0x4a49cb){try{if(this[_0x46a2('0x72')](_0x4a49cb)){logger[_0x46a2('0x43')](_0x46a2('0x83'),_0x4a49cb[_0x46a2('0x46')],util['inspect'](_0x4a49cb,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x4a49cb[_0x46a2('0x46')]]){var _0x5b1227=_[_0x46a2('0x7a')](this[_0x46a2('0xe')][_0x4a49cb[_0x46a2('0x46')]]);_0x5b1227[_0x46a2('0x84')]=moment()[_0x46a2('0x47')](_0x46a2('0x74'));_0x5b1227[_0x46a2('0x85')]=_0x4a49cb['connectedlinenum'];_0x5b1227[_0x46a2('0x86')]=_0x4a49cb[_0x46a2('0x86')];logger['info'](_0x46a2('0x87'),_0x5b1227[_0x46a2('0x48')],_0x5b1227[_0x46a2('0x4f')],_0x4a49cb[_0x46a2('0x85')],_0x4a49cb['connectedlinename']);this['channels'][_0x4a49cb['uniqueid']]=_0x5b1227;this[_0x46a2('0x42')](_0x5b1227,_0x46a2('0x88'));}}}catch(_0x27c9ad){logger[_0x46a2('0x3c')]('[%s][voiceQueueReport][queuecallerleave]',_0x4a49cb[_0x46a2('0x46')],util[_0x46a2('0x3e')](_0x27c9ad,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x46a2('0x1e')]=function(_0xec46cf){try{if(this[_0x46a2('0x72')](_0xec46cf)){logger[_0x46a2('0x43')]('[%s][voiceQueueReport][agentconnect]',_0xec46cf['uniqueid'],util[_0x46a2('0x3e')](_0xec46cf,{'showHidden':![],'depth':null}));if(this[_0x46a2('0xe')][_0xec46cf['uniqueid']]){var _0xfcd9bd=_[_0x46a2('0x7a')](this[_0x46a2('0xe')][_0xec46cf[_0x46a2('0x46')]]);_0xfcd9bd[_0x46a2('0x7b')]=!![];_0xfcd9bd['queuecallerexitreason']=_0x46a2('0x89');logger[_0x46a2('0x68')](_0x46a2('0x8a'),_0xfcd9bd[_0x46a2('0x48')],_0xfcd9bd[_0x46a2('0x4f')]);}}}catch(_0x6f8eee){logger['error'](_0x46a2('0x8b'),_0xec46cf[_0x46a2('0x46')],util[_0x46a2('0x3e')](_0x6f8eee,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x46a2('0x1d')]=function(_0x137721){try{if(this[_0x46a2('0x72')](_0x137721)){logger[_0x46a2('0x43')](_0x46a2('0x8c'),_0x137721['uniqueid'],util[_0x46a2('0x3e')](_0x137721,{'showHidden':![],'depth':null}));if(this[_0x46a2('0xe')][_0x137721[_0x46a2('0x46')]]){var _0x57f730=_[_0x46a2('0x7a')](this[_0x46a2('0xe')][_0x137721[_0x46a2('0x46')]]);_0x57f730[_0x46a2('0x7f')]=![];_0x57f730[_0x46a2('0x8d')]=null;_0x57f730[_0x46a2('0x8e')]=!![];_0x57f730['lastAssignedTo']=_0x137721[_0x46a2('0x8f')];_0x57f730[_0x46a2('0x7d')]=_0x137721[_0x46a2('0x7d')];_0x57f730[_0x46a2('0x7b')]=!![];_0x57f730[_0x46a2('0x90')]=![];_0x57f730[_0x46a2('0x91')]=null;if(!_0x57f730[_0x46a2('0x92')]){if(_0x137721['reason']=='transfer'){_0x57f730[_0x46a2('0x93')]='COMPLETED';logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x57f730[_0x46a2('0x48')],_0x57f730['type']);}else{if(_[_0x46a2('0x94')](_0x137721[_0x46a2('0x39')]['toLowerCase'](),'local/')){if(this[_0x46a2('0xe')][_0x137721['linkedid']]){var _0x4e2df1=_[_0x46a2('0x7a')](this['queueReports'][_0x137721['linkedid']]);_0x4e2df1[_0x46a2('0x7b')]=![];_0x4e2df1[_0x46a2('0x90')]=!![];_0x4e2df1[_0x46a2('0x91')]=moment(_0x57f730[_0x46a2('0x95')])['add'](_0x137721[_0x46a2('0x7d')],_0x46a2('0x96'))[_0x46a2('0x47')](_0x46a2('0x74'));_0x4e2df1[_0x46a2('0x93')]=_0x46a2('0x97');_0x4e2df1[_0x46a2('0x92')]=!![];_0x4e2df1['transfertype']=_0x46a2('0x98');_0x4e2df1['transferexten']=_0x137721[_0x46a2('0x99')];_0x4e2df1[_0x46a2('0x9a')]=_0x137721['uniqueid'];logger[_0x46a2('0x68')](_0x46a2('0x9b'),_0x4e2df1[_0x46a2('0x48')],_0x4e2df1[_0x46a2('0x4f')]);var _0x540959=this['queueReports'][_0x137721[_0x46a2('0x9c')]];this[_0x46a2('0xe')][_0x137721[_0x46a2('0x9c')]]=this['queueReports'][_0x137721[_0x46a2('0x46')]];this[_0x46a2('0xe')][_0x137721[_0x46a2('0x46')]]=_0x540959;}}else{_0x57f730[_0x46a2('0x93')]=_0x46a2('0x9d')+_0x137721['reason'][_0x46a2('0x9e')]();logger[_0x46a2('0x68')](_0x46a2('0x9f'),_0x57f730[_0x46a2('0x48')],_0x57f730[_0x46a2('0x4f')],_0x57f730[_0x46a2('0x93')]);}}}this[_0x46a2('0x10')][_0x137721[_0x46a2('0x46')]]=_0x57f730;this[_0x46a2('0x4b')](_0x57f730,_0x46a2('0xa0'));}}}catch(_0x5ddb00){logger[_0x46a2('0x3c')](_0x46a2('0x8c'),_0x137721[_0x46a2('0x46')],util['inspect'](_0x5ddb00,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x46a2('0xa')][_0x46a2('0x1f')]=function(_0x11afba){try{if(this[_0x46a2('0x72')](_0x11afba)){logger[_0x46a2('0x43')](_0x46a2('0xa1'),_0x11afba[_0x46a2('0x46')],util[_0x46a2('0x3e')](_0x11afba,{'showHidden':![],'depth':null}));this[_0x46a2('0xa2')](_0x11afba['uniqueid'],_['keys'](_0x11afba['variable'])[0x0],_0x11afba[_0x46a2('0xa3')]);if(this[_0x46a2('0xe')][_0x11afba[_0x46a2('0x46')]]){var _0x5b9ea6=_['last'](this['queueReports'][_0x11afba['uniqueid']]);if(_0x5b9ea6){if(this[_0x46a2('0x72')](_0x11afba['variable'])&&this['isNotNull'](_0x11afba[_0x46a2('0xa4')]['queuestatus'])){switch(_0x11afba[_0x46a2('0xa3')]){case'CONTINUE':_0x5b9ea6[_0x46a2('0x90')]=![];_0x5b9ea6[_0x46a2('0x91')]=null;break;case _0x46a2('0xa5'):_0x5b9ea6[_0x46a2('0xa6')]=_0x46a2('0xa7');_0x5b9ea6[_0x46a2('0x90')]=!![];_0x5b9ea6[_0x46a2('0x91')]=moment()['format'](_0x46a2('0x74'));_0x5b9ea6[_0x46a2('0x84')]=moment()[_0x46a2('0x47')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0x46a2('0x43')]('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x11afba[_0x46a2('0x46')],util[_0x46a2('0x3e')](_0x5b9ea6,{'showHidden':![],'depth':null}));ami[_0x46a2('0x41')](_0x46a2('0xa8'),_0x5b9ea6);break;default:_0x5b9ea6['queuecallerexit']=!![];_0x5b9ea6['queuecallerexitAt']=moment()[_0x46a2('0x47')]('YYYY-MM-DD\x20HH:mm:ss');_0x5b9ea6[_0x46a2('0x84')]=moment()[_0x46a2('0x47')](_0x46a2('0x74'));}_0x5b9ea6[_0x46a2('0x7f')]=![];_0x5b9ea6[_0x46a2('0x8d')]=null;_0x5b9ea6[_0x46a2('0x93')]=_0x11afba[_0x46a2('0xa3')];this[_0x46a2('0x10')][_0x11afba[_0x46a2('0x46')]]=_0x5b9ea6;this[_0x46a2('0x4b')](_0x5b9ea6,_0x46a2('0xa9'));}else if(this[_0x46a2('0x72')](_0x11afba[_0x46a2('0xa4')])&&this['isNotNull'](_0x11afba[_0x46a2('0xa4')][_0x46a2('0xaa')])){if(!_0x5b9ea6['queuecallerabandon']){_0x5b9ea6[_0x46a2('0x90')]=!![];_0x5b9ea6[_0x46a2('0x91')]=moment()[_0x46a2('0x47')](_0x46a2('0x74'));_0x5b9ea6[_0x46a2('0x93')]=_0x46a2('0xab');_0x5b9ea6[_0x46a2('0x84')]=moment()[_0x46a2('0x47')](_0x46a2('0x74'));this['channels'][_0x11afba['uniqueid']]=_0x5b9ea6;}}logger[_0x46a2('0x68')](_0x46a2('0xac'),_0x11afba[_0x46a2('0x46')],_0x5b9ea6['name'],_0x5b9ea6[_0x46a2('0x4f')],_['keys'](_0x11afba[_0x46a2('0xa4')])[0x0],_0x11afba[_0x46a2('0xa3')]);_0x5b9ea6[_0x46a2('0x3f')]=this[_0x46a2('0x3f')][_0x11afba['uniqueid']];}}}}catch(_0x3f6f2c){logger[_0x46a2('0x3c')](_0x46a2('0xa1'),_0x11afba[_0x46a2('0x46')],util['inspect'](_0x3f6f2c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x46a2('0xa')][_0x46a2('0xa2')]=function(_0x414fc6,_0x340e11,_0x54f6c6){var _0x42a96e=[_0x46a2('0xad'),_0x46a2('0xae'),_0x46a2('0xaf'),'rtpaudioqosjitterbridged',_0x46a2('0xb0'),_0x46a2('0xb1'),_0x46a2('0xb2'),'rtpaudioqosrttbridged',_0x46a2('0xb3'),_0x46a2('0xb4'),_0x46a2('0xb5'),_0x46a2('0xb6'),'membercalls',_0x46a2('0xb7'),_0x46a2('0xb8'),_0x46a2('0xb9'),_0x46a2('0x8f'),_0x46a2('0xba'),_0x46a2('0xbb')];if(!_['isNil'](_0x340e11)&&!_[_0x46a2('0xbc')](_0x42a96e,_0x340e11)){if(_['isUndefined'](this[_0x46a2('0x3f')][_0x414fc6])){this[_0x46a2('0x3f')][_0x414fc6]={};}this[_0x46a2('0x3f')][_0x414fc6][_0x340e11]=_0x54f6c6;}};VoiceQueueReport[_0x46a2('0xa')][_0x46a2('0x21')]=function(_0x6b79a9){try{if(this[_0x46a2('0x72')](_0x6b79a9)){logger[_0x46a2('0x43')](_0x46a2('0xbd'),_0x6b79a9[_0x46a2('0x46')],util[_0x46a2('0x3e')](_0x6b79a9,{'showHidden':![],'depth':null}));if(this[_0x46a2('0xe')][_0x6b79a9[_0x46a2('0x46')]]){for(var _0x590afb=0x0,_0x2f1b6d={};_0x590afb=0x0?moment(_0x3bffa9['endtime'])[_0x152d('0xd')](_0x3bffa9[_0x152d('0x16')],_0x152d('0xe')):null,'data1':_0x152d('0x18'),'data2':_0x3bffa9[_0x152d('0x12')],'data3':_0x3bffa9[_0x152d('0x10')],'data4':_0x3bffa9['dialstring']||null,'role':_0x152d('0x11'),'internal':_0x3bffa9[_0x152d('0x12')]?_['toNumber'](_0x3bffa9[_0x152d('0x12')]):undefined,'uniqueid':_0x3bffa9[_0x152d('0x19')]},'log':'CreateMemberReport'});}; \ No newline at end of file +var _0xa72e=['endtime','seconds','outbound','moment','lodash','util','../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','CreateMemberReport','voice','lastAssignedTo','isNil','interface','SIP/%s','queuecallerleaveAt','diff','exten','queue','agent','toNumber','accountcode','uniqueid','voiceDialReport','Request','membername','TALKING','starttime'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa72e,0x1d3));var _0xea72=function(_0xd6d456,_0x37accf){_0xd6d456=_0xd6d456-0x0;var _0x5c3e7d=_0xa72e[_0xd6d456];return _0x5c3e7d;};'use strict';var moment=require(_0xea72('0x0'));var _=require(_0xea72('0x1'));var util=require(_0xea72('0x2'));var client=require(_0xea72('0x3'));exports[_0xea72('0x4')]=function(_0x29f398){var _0x221bd4=_0x29f398[_0xea72('0x5')]||_0x29f398[_0xea72('0x6')];return client['Request'](_0xea72('0x7'),{'body':{'channel':_0xea72('0x8'),'membername':_0x29f398[_0xea72('0x9')],'interface':_[_0xea72('0xa')](_0x29f398[_0xea72('0xb')])?util['format'](_0xea72('0xc'),_0x29f398[_0xea72('0x9')]):_0x29f398[_0xea72('0xb')],'type':'TALKING','enterAt':_0x29f398[_0xea72('0xd')],'exitAt':_0x221bd4,'duration':moment(_0x221bd4)[_0xea72('0xe')](_0x29f398[_0xea72('0xd')],'seconds'),'data1':'inbound','data2':_0x29f398['calleridnum'],'data3':_0x29f398[_0xea72('0xf')],'data4':null,'data5':_0x29f398[_0xea72('0x10')],'role':_0xea72('0x11'),'internal':_0x29f398['accountcode']?_[_0xea72('0x12')](_0x29f398[_0xea72('0x13')]):undefined,'uniqueid':_0x29f398[_0xea72('0x14')]},'log':_0xea72('0x7')});};exports[_0xea72('0x15')]=function(_0x4ad3aa){return client[_0xea72('0x16')](_0xea72('0x7'),{'body':{'channel':_0xea72('0x8'),'membername':_0x4ad3aa[_0xea72('0x17')],'interface':_0x4ad3aa[_0xea72('0xb')],'type':_0xea72('0x18'),'enterAt':_0x4ad3aa[_0xea72('0x19')],'exitAt':_0x4ad3aa['endtime'],'duration':moment(_0x4ad3aa[_0xea72('0x1a')])['diff'](_0x4ad3aa[_0xea72('0x19')],_0xea72('0x1b'))>=0x0?moment(_0x4ad3aa[_0xea72('0x1a')])[_0xea72('0xe')](_0x4ad3aa['starttime'],_0xea72('0x1b')):null,'data1':_0xea72('0x1c'),'data2':_0x4ad3aa[_0xea72('0x13')],'data3':_0x4ad3aa[_0xea72('0xf')],'data4':_0x4ad3aa['dialstring']||null,'role':_0xea72('0x11'),'internal':_0x4ad3aa['accountcode']?_[_0xea72('0x12')](_0x4ad3aa['accountcode']):undefined,'uniqueid':_0x4ad3aa[_0xea72('0x14')]},'log':_0xea72('0x7')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 7ef0756..1a2b832 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 _0xdfe0=['stopRecordingOnTransfer','GetSettings','../client','getSettings','Request','ShowSetting'];(function(_0x397d26,_0x4c54a9){var _0x386ed2=function(_0x1c3c0f){while(--_0x1c3c0f){_0x397d26['push'](_0x397d26['shift']());}};_0x386ed2(++_0x4c54a9);}(_0xdfe0,0xce));var _0x0dfe=function(_0x5946c3,_0x27a08d){_0x5946c3=_0x5946c3-0x0;var _0x403f3f=_0xdfe0[_0x5946c3];return _0x403f3f;};'use strict';var client=require(_0x0dfe('0x0'));exports[_0x0dfe('0x1')]=function(){return client[_0x0dfe('0x2')](_0x0dfe('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x0dfe('0x4')]},'log':_0x0dfe('0x5')});}; \ No newline at end of file +var _0x8d79=['Request','GetSettings','../client','getSettings'];(function(_0x22dac7,_0x45d32a){var _0x3e6cfa=function(_0x4c2e9d){while(--_0x4c2e9d){_0x22dac7['push'](_0x22dac7['shift']());}};_0x3e6cfa(++_0x45d32a);}(_0x8d79,0x10a));var _0x98d7=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x8d79[_0x4fde08];return _0x12e725;};'use strict';var client=require(_0x98d7('0x0'));exports[_0x98d7('0x1')]=function(){return client[_0x98d7('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer']},'log':_0x98d7('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 95b16ff..8bb0de5 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 _0xc758=['getTemplates','Request','name','html','GetTemplate','../client'];(function(_0x3be82b,_0x3ef4fb){var _0x293c0e=function(_0x6af388){while(--_0x6af388){_0x3be82b['push'](_0x3be82b['shift']());}};_0x293c0e(++_0x3ef4fb);}(_0xc758,0xb9));var _0x8c75=function(_0x248fbb,_0x532e8c){_0x248fbb=_0x248fbb-0x0;var _0x431c96=_0xc758[_0x248fbb];return _0x431c96;};'use strict';var client=require(_0x8c75('0x0'));exports[_0x8c75('0x1')]=function(_0x5b766c){return function(_0x2e3b0e){return client[_0x8c75('0x2')]('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0x8c75('0x3'),_0x8c75('0x4')]},'log':_0x8c75('0x5')});};}; \ No newline at end of file +var _0xbe58=['html','GetTemplate'];(function(_0x1ae048,_0x4314be){var _0x5847dc=function(_0x17a5a0){while(--_0x17a5a0){_0x1ae048['push'](_0x1ae048['shift']());}};_0x5847dc(++_0x4314be);}(_0xbe58,0x19f));var _0x8be5=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xbe58[_0x2be8c2];return _0x97f531;};'use strict';var client=require('../client');exports['getTemplates']=function(_0xf1df38){return function(_0x4c7d6b){return client['Request'](_0x8be5('0x0'),{'options':{'raw':!![],'attributes':['id','name',_0x8be5('0x1')]},'log':_0x8be5('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index a4fd156..c4338ca 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 _0x5044=['AllConditions','field','operator','value','AnyConditions','Actions','action','data2','data6','data7','getTriggers','Request','GetTrigger','name','channel','Condition'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x5044,0xaa));var _0x4504=function(_0x17a178,_0x20f58e){_0x17a178=_0x17a178-0x0;var _0x5503d1=_0x5044[_0x17a178];return _0x5503d1;};'use strict';var client=require('../client');exports[_0x4504('0x0')]=function(_0x46e279){return function(_0x2f01a1){return client[_0x4504('0x1')](_0x4504('0x2'),{'options':{'raw':![],'attributes':['id',_0x4504('0x3'),_0x4504('0x4'),'status'],'include':[{'model':_0x4504('0x5'),'as':_0x4504('0x6'),'attributes':['id',_0x4504('0x7'),_0x4504('0x8'),_0x4504('0x9')]},{'model':'Condition','as':_0x4504('0xa'),'attributes':['id',_0x4504('0x7'),_0x4504('0x8'),'value']},{'model':'Action','as':_0x4504('0xb'),'attributes':['id',_0x4504('0xc'),'data1',_0x4504('0xd'),'data3','data4','data5',_0x4504('0xe'),_0x4504('0xf')]}]},'log':_0x4504('0x2')});};}; \ No newline at end of file +var _0x6f48=['Action','Actions','action','data1','data2','data3','data4','data5','data6','../client','getTriggers','Request','GetTrigger','name','channel','status','AllConditions','field','operator','value','Condition','AnyConditions'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6f48,0x1ab));var _0x86f4=function(_0x3916cb,_0x20898a){_0x3916cb=_0x3916cb-0x0;var _0x1d4a0f=_0x6f48[_0x3916cb];return _0x1d4a0f;};'use strict';var client=require(_0x86f4('0x0'));exports[_0x86f4('0x1')]=function(_0x2f70db){return function(_0x4dcf48){return client[_0x86f4('0x2')](_0x86f4('0x3'),{'options':{'raw':![],'attributes':['id',_0x86f4('0x4'),_0x86f4('0x5'),_0x86f4('0x6')],'include':[{'model':'Condition','as':_0x86f4('0x7'),'attributes':['id',_0x86f4('0x8'),_0x86f4('0x9'),_0x86f4('0xa')]},{'model':_0x86f4('0xb'),'as':_0x86f4('0xc'),'attributes':['id',_0x86f4('0x8'),_0x86f4('0x9'),_0x86f4('0xa')]},{'model':_0x86f4('0xd'),'as':_0x86f4('0xe'),'attributes':['id',_0x86f4('0xf'),_0x86f4('0x10'),_0x86f4('0x11'),_0x86f4('0x12'),_0x86f4('0x13'),_0x86f4('0x14'),_0x86f4('0x15'),'data7']}]},'log':_0x86f4('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 070f23c..834c21f 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 _0x1b4e=['GetTrunk','name','registry','defaultuser','Request'];(function(_0x1adaeb,_0x27ebcd){var _0x3c444b=function(_0x3d8d3f){while(--_0x3d8d3f){_0x1adaeb['push'](_0x1adaeb['shift']());}};_0x3c444b(++_0x27ebcd);}(_0x1b4e,0x158));var _0xe1b4=function(_0x1ff29d,_0x1e58fc){_0x1ff29d=_0x1ff29d-0x0;var _0x38cb30=_0x1b4e[_0x1ff29d];return _0x38cb30;};'use strict';var client=require('../client');exports['getTrunks']=function(_0x840f39){return function(_0x4b0e67){return client[_0xe1b4('0x0')](_0xe1b4('0x1'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xe1b4('0x2'),_0xe1b4('0x3'),_0xe1b4('0x4')]},'log':'GetTrunk'});};}; \ No newline at end of file +var _0xb32d=['getTrunks','Request','registry','defaultuser','../client'];(function(_0x2aaa32,_0x10fe8d){var _0x5afa0e=function(_0x22f449){while(--_0x22f449){_0x2aaa32['push'](_0x2aaa32['shift']());}};_0x5afa0e(++_0x10fe8d);}(_0xb32d,0x1da));var _0xdb32=function(_0x40d8d7,_0x30dd5e){_0x40d8d7=_0x40d8d7-0x0;var _0x3454cc=_0xb32d[_0x40d8d7];return _0x3454cc;};'use strict';var client=require(_0xdb32('0x0'));exports[_0xdb32('0x1')]=function(_0x2d50e1){return function(_0x7c2c59){return client[_0xdb32('0x2')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0xdb32('0x3'),_0xdb32('0x4')]},'log':'GetTrunk'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 2927aa7..cd5f51b 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(_0x4a96ca,_0x13754e){var _0x2aed48=function(_0x361330){while(--_0x361330){_0x4a96ca['push'](_0x4a96ca['shift']());}};_0x2aed48(++_0x13754e);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4536a4,_0x55af7b){_0x4536a4=_0x4536a4-0x0;var _0x4fd1c1=_0xcb91[_0x4536a4];return _0x4fd1c1;};'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 _0xedd9=['mobile','getTelephones','internal','PauseUser','savePause','saveUnpause','UnpauseUser','ShowUser','interface','getAgent','getAgents','Request','GetUser','agent','name','email','accountcode','fullname','lastLoginAt','pauseType','lastPauseAt','voicePause'];(function(_0x316932,_0x22c37c){var _0x75343a=function(_0x1b5233){while(--_0x1b5233){_0x316932['push'](_0x316932['shift']());}};_0x75343a(++_0x22c37c);}(_0xedd9,0xfc));var _0x9edd=function(_0x2d6b29,_0x7a0fc4){_0x2d6b29=_0x2d6b29-0x0;var _0x57e60c=_0xedd9[_0x2d6b29];return _0x57e60c;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3')},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),_0x9edd('0xb'),'phone',_0x9edd('0xc'),'interface']},'log':_0x9edd('0x0')});};};exports[_0x9edd('0xd')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x9edd('0x4'),'accountcode',_0x9edd('0xe')]},'log':_0x9edd('0xd')});};};exports['savePause']=function(_0xbf9da6,_0x13dc4f,_0x5b6c00){return client[_0x9edd('0x1')](_0x9edd('0xf'),{'body':{'type':_0x13dc4f,'uniqueid':_0x5b6c00},'options':{'where':{'id':_0xbf9da6['id']}},'log':_0x9edd('0x10')});};exports[_0x9edd('0x11')]=function(_0x287ddd){return client[_0x9edd('0x1')](_0x9edd('0x12'),{'body':{},'options':{'where':{'id':_0x287ddd['id']}},'log':_0x9edd('0x10')});};exports['getAgent']=function(_0x176bfa){return client[_0x9edd('0x1')](_0x9edd('0x13'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3'),'id':_0x176bfa},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),'voicePause',_0x9edd('0x14')]},'log':_0x9edd('0x15')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index acd88e8..b38a98b 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 _0xa8e3=['UpdateVoiceAgentReport','update','Request'];(function(_0x1164b5,_0x11ef47){var _0x42d006=function(_0xb19024){while(--_0xb19024){_0x1164b5['push'](_0x1164b5['shift']());}};_0x42d006(++_0x11ef47);}(_0xa8e3,0x17e));var _0x3a8e=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xa8e3[_0x27af45];return _0x18df21;};'use strict';var client=require('../client');exports['create']=function(_0xf331ac){return client['Request']('CreateVoiceAgentReport',{'body':_0xf331ac,'log':'CreateVoiceAgentReport'});};exports[_0x3a8e('0x0')]=function(_0xe0f17c,_0x17bd88,_0x55d175){return client[_0x3a8e('0x1')]('UpdateVoiceAgentReport',{'body':_0xe0f17c,'options':{'where':{'uniqueid':_0x17bd88,'interface':_0x55d175,'agentcomplete':!![]}},'log':_0x3a8e('0x2')});}; \ No newline at end of file +var _0x6d9b=['UpdateVoiceAgentReport','../client','create','Request','CreateVoiceAgentReport'];(function(_0x4c8430,_0x2ce9ea){var _0x3ff8fa=function(_0x198db6){while(--_0x198db6){_0x4c8430['push'](_0x4c8430['shift']());}};_0x3ff8fa(++_0x2ce9ea);}(_0x6d9b,0x1af));var _0xb6d9=function(_0xfa01e4,_0x54691e){_0xfa01e4=_0xfa01e4-0x0;var _0x2df60e=_0x6d9b[_0xfa01e4];return _0x2df60e;};'use strict';var client=require(_0xb6d9('0x0'));exports[_0xb6d9('0x1')]=function(_0x12c321){return client[_0xb6d9('0x2')](_0xb6d9('0x3'),{'body':_0x12c321,'log':_0xb6d9('0x3')});};exports['update']=function(_0x452021,_0x471950,_0x110a1f){return client[_0xb6d9('0x2')](_0xb6d9('0x4'),{'body':_0x452021,'options':{'where':{'uniqueid':_0x471950,'interface':_0x110a1f,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 2a8fe30..46d196e 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 _0x8b77=['GetVoiceCallReports','moment','util','lodash','../client','create','Request','merge','calleridnum','context','DOCUMENTATION','CreateVoiceCallReport','getVoiceCallReports','GetVoiceCallReport','outbound','day','YYYY-MM-DD\x20HH:mm:ss','format','type','disposition','duration','billableseconds'];(function(_0x3c2b2b,_0x5250d9){var _0x1484f5=function(_0x6c9957){while(--_0x6c9957){_0x3c2b2b['push'](_0x3c2b2b['shift']());}};_0x1484f5(++_0x5250d9);}(_0x8b77,0x14b));var _0x78b7=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x8b77[_0x2dafbe];return _0x58a45a;};'use strict';var moment=require(_0x78b7('0x0'));var util=require(_0x78b7('0x1'));var _=require(_0x78b7('0x2'));var client=require(_0x78b7('0x3'));exports[_0x78b7('0x4')]=function(_0x27bc64){return client[_0x78b7('0x5')]('CreateVoiceCallReport',{'body':_[_0x78b7('0x6')](_0x27bc64,{'source':_0x27bc64[_0x78b7('0x7')],'destinationcontext':_0x27bc64[_0x78b7('0x8')],'callerid':_0x27bc64['callerid'],'amaflags':_0x78b7('0x9')}),'log':_0x78b7('0xa')});};exports[_0x78b7('0xb')]=function(){return function(){return client[_0x78b7('0x5')](_0x78b7('0xc'),{'options':{'where':{'type':[_0x78b7('0xd')],'createdAt':{'$between':[moment()['startOf'](_0x78b7('0xe'))['format'](_0x78b7('0xf')),moment()['endOf'](_0x78b7('0xe'))[_0x78b7('0x10')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':[_0x78b7('0x11'),_0x78b7('0x12'),_0x78b7('0x13'),_0x78b7('0x14')]},'log':_0x78b7('0x15')});};}; \ No newline at end of file +var _0xba5b=['endOf','type','disposition','duration','billableseconds','moment','util','lodash','../client','Request','CreateVoiceCallReport','merge','calleridnum','context','DOCUMENTATION','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x2896f8,_0x2184b3){var _0x37db3e=function(_0x49bb4d){while(--_0x49bb4d){_0x2896f8['push'](_0x2896f8['shift']());}};_0x37db3e(++_0x2184b3);}(_0xba5b,0x1cd));var _0xbba5=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xba5b[_0x122ef9];return _0x42fba0;};'use strict';var moment=require(_0xbba5('0x0'));var util=require(_0xbba5('0x1'));var _=require(_0xbba5('0x2'));var client=require(_0xbba5('0x3'));exports['create']=function(_0x43747d){return client[_0xbba5('0x4')](_0xbba5('0x5'),{'body':_[_0xbba5('0x6')](_0x43747d,{'source':_0x43747d[_0xbba5('0x7')],'destinationcontext':_0x43747d[_0xbba5('0x8')],'callerid':_0x43747d['callerid'],'amaflags':_0xbba5('0x9')}),'log':_0xbba5('0x5')});};exports['getVoiceCallReports']=function(){return function(){return client[_0xbba5('0x4')]('GetVoiceCallReport',{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0xbba5('0xa')](_0xbba5('0xb'))[_0xbba5('0xc')](_0xbba5('0xd')),moment()[_0xbba5('0xe')]('day')[_0xbba5('0xc')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':[_0xbba5('0xf'),_0xbba5('0x10'),_0xbba5('0x11'),_0xbba5('0x12')]},'log':'GetVoiceCallReports'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index daf38ed..dbb1a97 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 _0xd64f=['Request','CreateVoiceDialReport','../client','create'];(function(_0x5865fc,_0x339792){var _0x2aa668=function(_0xccb174){while(--_0xccb174){_0x5865fc['push'](_0x5865fc['shift']());}};_0x2aa668(++_0x339792);}(_0xd64f,0x1d2));var _0xfd64=function(_0x2f252d,_0x37e132){_0x2f252d=_0x2f252d-0x0;var _0x31600e=_0xd64f[_0x2f252d];return _0x31600e;};'use strict';var client=require(_0xfd64('0x0'));exports[_0xfd64('0x1')]=function(_0xfd762){return client[_0xfd64('0x2')](_0xfd64('0x3'),{'body':_0xfd762,'log':'CreateVoiceDialReport'});}; \ No newline at end of file +var _0x8b50=['Request','CreateVoiceDialReport','create'];(function(_0x4211f2,_0x369159){var _0x2ed1f7=function(_0x369104){while(--_0x369104){_0x4211f2['push'](_0x4211f2['shift']());}};_0x2ed1f7(++_0x369159);}(_0x8b50,0x1dc));var _0x08b5=function(_0xdcf899,_0x5b8ba0){_0xdcf899=_0xdcf899-0x0;var _0x446d8e=_0x8b50[_0xdcf899];return _0x446d8e;};'use strict';var client=require('../client');exports[_0x08b5('0x0')]=function(_0x4036fb){return client[_0x08b5('0x1')]('CreateVoiceDialReport',{'body':_0x4036fb,'log':_0x08b5('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 3bc0f21..df85033 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 _0xc91b=['recordingFormat','../client','getVoiceExtensions','Request','GetVoiceExtension','exten'];(function(_0x293b0b,_0x277b64){var _0x2b619f=function(_0x4aba5a){while(--_0x4aba5a){_0x293b0b['push'](_0x293b0b['shift']());}};_0x2b619f(++_0x277b64);}(_0xc91b,0x16f));var _0xbc91=function(_0x4f759c,_0x4e3f10){_0x4f759c=_0x4f759c-0x0;var _0x524004=_0xc91b[_0x4f759c];return _0x524004;};'use strict';var client=require(_0xbc91('0x0'));exports[_0xbc91('0x1')]=function(){return function(){return client[_0xbc91('0x2')](_0xbc91('0x3'),{'options':{'raw':!![],'attributes':['id',_0xbc91('0x4'),_0xbc91('0x5')],'where':{'VoiceExtensionId':null}},'log':_0xbc91('0x1')});};}; \ No newline at end of file +var _0xee11=['getVoiceExtensions','../client','GetVoiceExtension','exten','recordingFormat'];(function(_0x3adcda,_0x1e454c){var _0xe45fe3=function(_0x18f6de){while(--_0x18f6de){_0x3adcda['push'](_0x3adcda['shift']());}};_0xe45fe3(++_0x1e454c);}(_0xee11,0x146));var _0x1ee1=function(_0xb95e68,_0x46fea5){_0xb95e68=_0xb95e68-0x0;var _0x274df0=_0xee11[_0xb95e68];return _0x274df0;};'use strict';var client=require(_0x1ee1('0x0'));exports['getVoiceExtensions']=function(){return function(){return client['Request'](_0x1ee1('0x1'),{'options':{'raw':!![],'attributes':['id',_0x1ee1('0x2'),_0x1ee1('0x3')],'where':{'VoiceExtensionId':null}},'log':_0x1ee1('0x4')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index b72b4ab..7bd97e3 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 _0x85f5=['dialAgiAfterHangupAgent','dialQueueProject2','dialRandomLastDigitCallerIdNumber','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','callAdditionalPhoneAfterMin','Trunk','name','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','../client','getVoiceQueues','GetVoiceQueue','acw','acwTimeout','monitor_format','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialOriginateCallerIdNumber','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialRecallMeTimeout','dialOrderByScheduledAt'];(function(_0x4d73b1,_0x91ab71){var _0xe394f9=function(_0x47dd5d){while(--_0x47dd5d){_0x4d73b1['push'](_0x4d73b1['shift']());}};_0xe394f9(++_0x91ab71);}(_0x85f5,0x1e8));var _0x585f=function(_0x505439,_0x5a4a50){_0x505439=_0x505439-0x0;var _0x54267a=_0x85f5[_0x505439];return _0x54267a;};'use strict';var client=require(_0x585f('0x0'));exports[_0x585f('0x1')]=function(){return function(){return client['Request'](_0x585f('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x585f('0x3'),_0x585f('0x4'),'autopause',_0x585f('0x5'),'type',_0x585f('0x6'),_0x585f('0x7'),_0x585f('0x8'),_0x585f('0x9'),_0x585f('0xa'),_0x585f('0xb'),_0x585f('0xc'),'dialPredictiveInterval','dialOriginateCallerIdName',_0x585f('0xd'),'dialOriginateTimeout',_0x585f('0xe'),_0x585f('0xf'),_0x585f('0x10'),_0x585f('0x11'),_0x585f('0x12'),'dialBusyMaxRetry',_0x585f('0x13'),_0x585f('0x14'),_0x585f('0x15'),'dialGlobalMaxRetry',_0x585f('0x16'),_0x585f('0x17'),_0x585f('0x18'),_0x585f('0x19'),_0x585f('0x1a'),'dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence',_0x585f('0x1b'),_0x585f('0x1c'),_0x585f('0x1d'),'timeout',_0x585f('0x1e'),'dialRecallInQueue',_0x585f('0x1f'),_0x585f('0x20'),'dialAgiAfterHangupClient',_0x585f('0x21'),_0x585f('0x5'),'strategy',_0x585f('0x22'),'dialCutDigit',_0x585f('0x23'),_0x585f('0x24'),'dialDropMaxRetry',_0x585f('0x25'),_0x585f('0x26'),_0x585f('0x27'),'dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry',_0x585f('0x28'),_0x585f('0x29'),_0x585f('0x2a'),'dialPredictiveIntervalMinThreshold',_0x585f('0x2b')],'include':[{'model':_0x585f('0x2c'),'as':_0x585f('0x2c'),'attributes':['id',_0x585f('0x2d'),_0x585f('0x2e'),_0x585f('0x2f')]},{'model':_0x585f('0x30'),'as':_0x585f('0x31'),'attributes':['id',_0x585f('0x2d')]},{'model':'Trunk','as':_0x585f('0x32'),'attributes':['id','name',_0x585f('0x2e'),_0x585f('0x2f')]},{'model':_0x585f('0x33'),'as':'Interval','attributes':['id',_0x585f('0x2d')],'include':[{'model':'Interval','as':'Intervals','attributes':['id','name','interval']}]}]},'log':_0x585f('0x1')});};}; \ No newline at end of file +var _0xfe5a=['dialRecallInQueue','strategy','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','callAdditionalPhoneAfterMin','Trunk','Pause','TrunkBackup','callerid','active','Interval','Intervals','interval','getVoiceQueues','Request','GetVoiceQueue','name','acw','autopause','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdNumber','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout'];(function(_0x10f56f,_0x3b47f4){var _0x3febe1=function(_0x3d2966){while(--_0x3d2966){_0x10f56f['push'](_0x10f56f['shift']());}};_0x3febe1(++_0x3b47f4);}(_0xfe5a,0x1d1));var _0xafe5=function(_0x5b7efa,_0x4792df){_0x5b7efa=_0x5b7efa-0x0;var _0x2c3f18=_0xfe5a[_0x5b7efa];return _0x2c3f18;};'use strict';var client=require('../client');exports[_0xafe5('0x0')]=function(){return function(){return client[_0xafe5('0x1')](_0xafe5('0x2'),{'options':{'raw':![],'attributes':['id',_0xafe5('0x3'),_0xafe5('0x4'),'acwTimeout',_0xafe5('0x5'),_0xafe5('0x6'),_0xafe5('0x7'),_0xafe5('0x8'),_0xafe5('0x9'),_0xafe5('0xa'),_0xafe5('0xb'),_0xafe5('0xc'),'dialPredictiveOptimization',_0xafe5('0xd'),_0xafe5('0xe'),'dialOriginateCallerIdName',_0xafe5('0xf'),'dialOriginateTimeout',_0xafe5('0x10'),_0xafe5('0x11'),_0xafe5('0x12'),_0xafe5('0x13'),_0xafe5('0x14'),'dialBusyMaxRetry',_0xafe5('0x15'),_0xafe5('0x16'),_0xafe5('0x17'),_0xafe5('0x18'),_0xafe5('0x19'),_0xafe5('0x1a'),_0xafe5('0x1b'),_0xafe5('0x1c'),_0xafe5('0x1d'),'dialAMDInitialSilence',_0xafe5('0x1e'),_0xafe5('0x1f'),_0xafe5('0x20'),_0xafe5('0x21'),_0xafe5('0x22'),'dialAMDMaximumNumberOfWords',_0xafe5('0x23'),_0xafe5('0x24'),_0xafe5('0x25'),_0xafe5('0x26'),_0xafe5('0x27'),'dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2',_0xafe5('0x6'),_0xafe5('0x28'),'dialRandomLastDigitCallerIdNumber',_0xafe5('0x29'),_0xafe5('0x2a'),_0xafe5('0x2b'),_0xafe5('0x2c'),_0xafe5('0x2d'),'dialAbandonedMaxRetry',_0xafe5('0x2e'),_0xafe5('0x2f'),_0xafe5('0x30'),_0xafe5('0x31'),_0xafe5('0x32'),_0xafe5('0x33'),_0xafe5('0x34'),_0xafe5('0x35'),_0xafe5('0x36')],'include':[{'model':'Trunk','as':_0xafe5('0x37'),'attributes':['id',_0xafe5('0x3'),'callerid','active']},{'model':_0xafe5('0x38'),'as':'mandatoryDispositionPause','attributes':['id',_0xafe5('0x3')]},{'model':_0xafe5('0x37'),'as':_0xafe5('0x39'),'attributes':['id','name',_0xafe5('0x3a'),_0xafe5('0x3b')]},{'model':'Interval','as':_0xafe5('0x3c'),'attributes':['id','name'],'include':[{'model':'Interval','as':_0xafe5('0x3d'),'attributes':['id','name',_0xafe5('0x3e')]}]}]},'log':_0xafe5('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index f801d5d..9f99ec1 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(_0x57299d,_0x451858){var _0x2fdf38=function(_0x43d00b){while(--_0x43d00b){_0x57299d['push'](_0x57299d['shift']());}};_0x2fdf38(++_0x451858);}(_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 +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(_0x53a49b,_0x18a671){var _0x3ee763=function(_0x270980){while(--_0x270980){_0x53a49b['push'](_0x53a49b['shift']());}};_0x3ee763(++_0x18a671);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'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 8dc2f95..d21b357 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 _0x73fd=['Request','GetVoiceQueueRtPauses','getVoiceQueueRtPauses'];(function(_0x1ed68d,_0x1c010a){var _0x4f08d8=function(_0x27117a){while(--_0x27117a){_0x1ed68d['push'](_0x1ed68d['shift']());}};_0x4f08d8(++_0x1c010a);}(_0x73fd,0x1ca));var _0xd73f=function(_0x267d8d,_0xe90f65){_0x267d8d=_0x267d8d-0x0;var _0x11a98f=_0x73fd[_0x267d8d];return _0x11a98f;};'use strict';var client=require('../client');exports[_0xd73f('0x0')]=function(_0x36a186){return function(){return client[_0xd73f('0x1')](_0xd73f('0x2'),{'options':{'where':{'VoiceQueueId':_0x36a186,'paused':!![]},'raw':!![]},'log':_0xd73f('0x0')});};}; \ No newline at end of file +var _0x5d6b=['GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses','Request'];(function(_0xf38064,_0xcbe11c){var _0x42f37c=function(_0x56b1b7){while(--_0x56b1b7){_0xf38064['push'](_0xf38064['shift']());}};_0x42f37c(++_0xcbe11c);}(_0x5d6b,0xb5));var _0xb5d6=function(_0x58cdc6,_0x3ce04e){_0x58cdc6=_0x58cdc6-0x0;var _0x6e50ba=_0x5d6b[_0x58cdc6];return _0x6e50ba;};'use strict';var client=require(_0xb5d6('0x0'));exports[_0xb5d6('0x1')]=function(_0x3eb391){return function(){return client[_0xb5d6('0x2')](_0xb5d6('0x3'),{'options':{'where':{'VoiceQueueId':_0x3eb391,'paused':!![]},'raw':!![]},'log':_0xb5d6('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 13b1a54..e834a84 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 _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x1de456,_0x40be9c){var _0x45b535=function(_0x3af41c){while(--_0x3af41c){_0x1de456['push'](_0x1de456['shift']());}};_0x45b535(++_0x40be9c);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'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 +var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x202056,_0x496bb2){var _0xb2fd6=function(_0xf6bc1a){while(--_0xf6bc1a){_0x202056['push'](_0x202056['shift']());}};_0xb2fd6(++_0x496bb2);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'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 a398fc1..9925cfc 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 _0x6e48=['transfers','blindTransfer','Request','result','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','extension','blind','CreateVoiceTransferReport','attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridname','transfertargetaccountcode','transfertargetcontext','transfertargetexten','origtransferercontext','attended'];(function(_0x5172fc,_0x803050){var _0x1cca84=function(_0x5de775){while(--_0x5de775){_0x5172fc['push'](_0x5172fc['shift']());}};_0x1cca84(++_0x803050);}(_0x6e48,0x168));var _0x86e4=function(_0xe8652b,_0x163325){_0xe8652b=_0xe8652b-0x0;var _0x146a9a=_0x6e48[_0xe8652b];return _0x146a9a;};'use strict';var client=require('../client');exports[_0x86e4('0x0')]={};exports[_0x86e4('0x1')]=function(_0x930864){return client[_0x86e4('0x2')]('CreateVoiceTransferReport',{'body':{'result':_0x930864[_0x86e4('0x3')],'transfererchannel':_0x930864['transfererchannel'],'transferercalleridnum':_0x930864[_0x86e4('0x4')],'transferercalleridname':_0x930864[_0x86e4('0x5')],'transfererconnectedlinenum':_0x930864[_0x86e4('0x6')],'transfererconnectedlinename':_0x930864[_0x86e4('0x7')],'transfereraccountcode':_0x930864[_0x86e4('0x8')],'transferercontext':_0x930864[_0x86e4('0x9')],'transfererexten':_0x930864[_0x86e4('0xa')],'transfererlinkedid':_0x930864[_0x86e4('0xb')],'transfereechannel':_0x930864['transfereechannel'],'transfereecalleridnum':_0x930864[_0x86e4('0xc')],'transfereecalleridname':_0x930864[_0x86e4('0xd')],'transfereeconnectedlinenum':_0x930864[_0x86e4('0xe')],'transfereeconnectedlinename':_0x930864[_0x86e4('0xf')],'transfereeaccountcode':_0x930864['transfereeaccountcode'],'transfereecontext':_0x930864[_0x86e4('0x10')],'transfereeexten':_0x930864[_0x86e4('0x11')],'transfereelinkedid':_0x930864[_0x86e4('0x12')],'isexternal':_0x930864[_0x86e4('0x13')],'context':_0x930864[_0x86e4('0x14')],'extension':_0x930864[_0x86e4('0x15')],'type':_0x86e4('0x16')},'log':_0x86e4('0x17')});};exports[_0x86e4('0x18')]=function(_0x308641){return client[_0x86e4('0x2')]('CreateVoiceTransferReport',{'body':{'result':_0x308641[_0x86e4('0x3')],'transfererchannel':_0x308641[_0x86e4('0x19')],'transferercalleridnum':_0x308641[_0x86e4('0x1a')],'transferercalleridname':_0x308641[_0x86e4('0x1b')],'transfererconnectedlinenum':_0x308641[_0x86e4('0x1c')],'transfererconnectedlinename':_0x308641[_0x86e4('0x1d')],'transfereraccountcode':_0x308641[_0x86e4('0x1e')],'transferercontext':_0x308641['secondtransferercontext'],'transfererexten':_0x308641[_0x86e4('0x1f')],'transfererlinkedid':_0x308641[_0x86e4('0x20')],'transfereechannel':_0x308641[_0x86e4('0x21')],'transfereecalleridnum':_0x308641['transfertargetcalleridnum'],'transfereecalleridname':_0x308641[_0x86e4('0x22')],'transfereeconnectedlinenum':_0x308641['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x308641['transfertargetconnectedlinename'],'transfereeaccountcode':_0x308641[_0x86e4('0x23')],'transfereecontext':_0x308641[_0x86e4('0x24')],'transfereeexten':_0x308641[_0x86e4('0x25')],'transfereelinkedid':_0x308641['transfertargetlinkedid'],'isexternal':_0x308641[_0x86e4('0x13')],'context':_0x308641[_0x86e4('0x26')],'extension':_0x308641['origtransfererexten'],'type':_0x86e4('0x27')},'log':_0x86e4('0x17')});}; \ No newline at end of file +var _0xeda6=['transferercontext','transfereechannel','transfereeconnectedlinename','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','extension','blind','attendedTransfer','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinename','secondtransfererexten','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','origtransferercontext','origtransfererexten','../client','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode'];(function(_0x2a8860,_0x2da926){var _0x2f47a4=function(_0x3b7f54){while(--_0x3b7f54){_0x2a8860['push'](_0x2a8860['shift']());}};_0x2f47a4(++_0x2da926);}(_0xeda6,0xf7));var _0x6eda=function(_0xcea56c,_0x161b86){_0xcea56c=_0xcea56c-0x0;var _0x6b7d0=_0xeda6[_0xcea56c];return _0x6b7d0;};'use strict';var client=require(_0x6eda('0x0'));exports[_0x6eda('0x1')]={};exports[_0x6eda('0x2')]=function(_0x44e154){return client[_0x6eda('0x3')](_0x6eda('0x4'),{'body':{'result':_0x44e154[_0x6eda('0x5')],'transfererchannel':_0x44e154[_0x6eda('0x6')],'transferercalleridnum':_0x44e154[_0x6eda('0x7')],'transferercalleridname':_0x44e154[_0x6eda('0x8')],'transfererconnectedlinenum':_0x44e154[_0x6eda('0x9')],'transfererconnectedlinename':_0x44e154[_0x6eda('0xa')],'transfereraccountcode':_0x44e154[_0x6eda('0xb')],'transferercontext':_0x44e154[_0x6eda('0xc')],'transfererexten':_0x44e154['transfererexten'],'transfererlinkedid':_0x44e154['transfererlinkedid'],'transfereechannel':_0x44e154[_0x6eda('0xd')],'transfereecalleridnum':_0x44e154['transfereecalleridnum'],'transfereecalleridname':_0x44e154['transfereecalleridname'],'transfereeconnectedlinenum':_0x44e154['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x44e154[_0x6eda('0xe')],'transfereeaccountcode':_0x44e154['transfereeaccountcode'],'transfereecontext':_0x44e154[_0x6eda('0xf')],'transfereeexten':_0x44e154[_0x6eda('0x10')],'transfereelinkedid':_0x44e154[_0x6eda('0x11')],'isexternal':_0x44e154[_0x6eda('0x12')],'context':_0x44e154[_0x6eda('0x13')],'extension':_0x44e154[_0x6eda('0x14')],'type':_0x6eda('0x15')},'log':_0x6eda('0x4')});};exports[_0x6eda('0x16')]=function(_0x295e39){return client[_0x6eda('0x3')](_0x6eda('0x4'),{'body':{'result':_0x295e39[_0x6eda('0x5')],'transfererchannel':_0x295e39[_0x6eda('0x17')],'transferercalleridnum':_0x295e39['origtransferercalleridnum'],'transferercalleridname':_0x295e39[_0x6eda('0x18')],'transfererconnectedlinenum':_0x295e39['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x295e39[_0x6eda('0x19')],'transfereraccountcode':_0x295e39['origtransfereraccountcode'],'transferercontext':_0x295e39['secondtransferercontext'],'transfererexten':_0x295e39[_0x6eda('0x1a')],'transfererlinkedid':_0x295e39['origtransfererlinkedid'],'transfereechannel':_0x295e39[_0x6eda('0x1b')],'transfereecalleridnum':_0x295e39[_0x6eda('0x1c')],'transfereecalleridname':_0x295e39[_0x6eda('0x1d')],'transfereeconnectedlinenum':_0x295e39[_0x6eda('0x1e')],'transfereeconnectedlinename':_0x295e39[_0x6eda('0x1f')],'transfereeaccountcode':_0x295e39[_0x6eda('0x20')],'transfereecontext':_0x295e39[_0x6eda('0x21')],'transfereeexten':_0x295e39[_0x6eda('0x22')],'transfereelinkedid':_0x295e39['transfertargetlinkedid'],'isexternal':_0x295e39['isexternal'],'context':_0x295e39[_0x6eda('0x23')],'extension':_0x295e39[_0x6eda('0x24')],'type':'attended'},'log':_0x6eda('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 6a83289..97efcec 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 _0xabce=['name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','asterisk','username','ami\x20disconnected','pick','keys','Reload','then','message','catch','error','join','action','Command','Action','content','voiceQueues','hasOwnProperty','strategy','available','loggedIn','sumBillable','sumDuration','sumHoldTime','talking','total','type','unmanaged','abandoned','waiting','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangBusyFactor','startPredictive','startProgressive','Trunk','callerid','Interval','push','length','omit','undefined','channels','voicechannel','find','uniqueid','%s.%s','filename','wav','MixMonitor','channel','/var/spool/asterisk/monitor/','toLowerCase','isNil','monitors','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','Channel\x20doesn\x27t\x20exist','map','resolve','destinationchannel','StopMixMonitor','stop','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','Redirect','exten','context','values','telephones','trunks','outboundChannels','outbound','campaigns','Event\x20name\x20mandatory','custom:','event','faxAccounts','checkAfterSend','server','http','127.0.0.1','log','lodash','util','jayson/promise','validate','bluebird','../properties','../ami','listen','format','%s/%s','SIP'];(function(_0x5887ec,_0x504c12){var _0x23b637=function(_0x3f720f){while(--_0x3f720f){_0x5887ec['push'](_0x5887ec['shift']());}};_0x23b637(++_0x504c12);}(_0xabce,0x103));var _0xeabc=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xabce[_0x3899d1];return _0xeb4a7d;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var jayson=require(_0xeabc('0x2'));var schema=require(_0xeabc('0x3'));var BPromise=require(_0xeabc('0x4'));var moment=require('moment');var config=require('../../../config/environment');var properties=require(_0xeabc('0x5'));var ami=require(_0xeabc('0x6'));exports[_0xeabc('0x7')]=function(_0x5e9e2d,_0x54e4a8,_0x1b07a8){return new BPromise(function(_0x52a4d7,_0x229ba4){var _0x52ede8={'QueuePause':function(_0x3bdc29){return new Promise(function(_0x9417af,_0x8434c5){var _0x5d59d5=util[_0xeabc('0x8')](_0xeabc('0x9'),_0xeabc('0xa'),_0x3bdc29[_0xeabc('0xb')]);if(_0x5e9e2d[_0xeabc('0xc')]&&_0x5e9e2d[_0xeabc('0xc')][_0x5d59d5]&&_0x5e9e2d[_0xeabc('0xc')][_0x5d59d5][_0xeabc('0xd')]){_0x5e9e2d[_0xeabc('0xc')][_0x5d59d5][_0xeabc('0xe')]();}if(_0x5e9e2d[_0xeabc('0xf')][_0x5d59d5]){_0x5e9e2d[_0xeabc('0xf')][_0x5d59d5][_0xeabc('0x10')]({'statePause':_0x3bdc29[_0xeabc('0x11')]?!![]:![]});}_0x9417af({'code':0xc8,'message':_0xeabc('0x12')});});},'Reload':function(_0xcfbf06){var _0x53df9c=this;return new Promise(function(_0x235c2d,_0x1319f3){if(ami[_0xeabc('0x13')]()==![]){return _0x1319f3(_0x53df9c['error'](0x1f4,[config['asterisk']['ip'],config[_0xeabc('0x14')][_0xeabc('0x15')],_0xeabc('0x16')]['join']('\x20')));}_0xcfbf06=_[_0xeabc('0x17')](_0xcfbf06,_[_0xeabc('0x18')](properties['module']));_0xcfbf06['action']=_0xeabc('0x19');return ami['Action'](_0xcfbf06)[_0xeabc('0x1a')](function(_0x1b64b9){_0x235c2d({'code':0xc8,'message':_0x1b64b9[_0xeabc('0x1b')]});})[_0xeabc('0x1c')](function(_0x31dd53){_0x1319f3(_0x53df9c[_0xeabc('0x1d')](0x1f5,_0x31dd53[_0xeabc('0x1b')]));});});},'Command':function(_0x5e30ee){var _0x5d92e5=this;return new Promise(function(_0x1253e4,_0x4d68ea){if(ami[_0xeabc('0x13')]()==![]){return _0x4d68ea(_0x5d92e5[_0xeabc('0x1d')](0x1f4,[config['asterisk']['ip'],config[_0xeabc('0x14')][_0xeabc('0x15')],_0xeabc('0x16')][_0xeabc('0x1e')]('\x20')));}_0x5e30ee=_[_0xeabc('0x17')](_0x5e30ee,'command');_0x5e30ee[_0xeabc('0x1f')]=_0xeabc('0x20');return ami[_0xeabc('0x21')](_0x5e30ee)['then'](function(_0x457f27){_0x1253e4({'code':0xc8,'message':_0x457f27[_0xeabc('0x22')]});})[_0xeabc('0x1c')](function(_0x319119){_0x4d68ea(_0x5d92e5['error'](0x1f5,_0x319119[_0xeabc('0x1b')]));});});},'VoiceQueues':function(_0x480440){return new Promise(function(_0x27dbaf,_0x4d4e29){var _0x811f0d=[];for(var _0x12acbd in _0x5e9e2d[_0xeabc('0x23')]){if(_0x5e9e2d[_0xeabc('0x23')][_0xeabc('0x24')](_0x12acbd)){var _0x137293=_0x5e9e2d[_0xeabc('0x23')][_0x12acbd];var _0x4c2693={'id':_0x137293['id'],'name':_0x137293['name'],'strategy':_0x137293[_0xeabc('0x25')],'answered':_0x137293['answered'],'available':_0x137293[_0xeabc('0x26')],'loggedIn':_0x137293[_0xeabc('0x27')],'pTalking':_0x137293['pTalking'],'sumBillable':_0x137293[_0xeabc('0x28')],'sumDuration':_0x137293[_0xeabc('0x29')],'sumHoldTime':_0x137293[_0xeabc('0x2a')]||0x0,'talking':_0x137293[_0xeabc('0x2b')],'total':_0x137293[_0xeabc('0x2c')],'type':_0x137293[_0xeabc('0x2d')],'unmanaged':_0x137293[_0xeabc('0x2e')],'abandoned':_0x137293[_0xeabc('0x2f')],'waiting':_0x137293[_0xeabc('0x30')],'loggedInDb':_0x137293['loggedInDb']};if(_0x137293[_0xeabc('0x2d')]==='outbound'){_0x4c2693[_0xeabc('0x31')]=_0x137293[_0xeabc('0x31')];_0x4c2693[_0xeabc('0x32')]=_0x137293[_0xeabc('0x32')];_0x4c2693[_0xeabc('0x33')]=_0x137293[_0xeabc('0x33')];_0x4c2693[_0xeabc('0x34')]=_0x137293['dialOriginateCallerIdNumber'];_0x4c2693[_0xeabc('0x35')]=_0x137293[_0xeabc('0x35')];_0x4c2693[_0xeabc('0x36')]=_0x137293['dialPrefix'];_0x4c2693[_0xeabc('0x37')]=_0x137293[_0xeabc('0x37')];_0x4c2693[_0xeabc('0x38')]=_0x137293['outboundAnswerAgiCallsDay'];_0x4c2693[_0xeabc('0x39')]=_0x137293[_0xeabc('0x39')];_0x4c2693[_0xeabc('0x3a')]=_0x137293['outboundBlacklistCallsDay'];_0x4c2693[_0xeabc('0x3b')]=_0x137293[_0xeabc('0x3b')];_0x4c2693['outboundCongestionCallsDay']=_0x137293['outboundCongestionCallsDay'];_0x4c2693[_0xeabc('0x3c')]=_0x137293[_0xeabc('0x3c')];_0x4c2693['outboundDropCallsDayCallersExit']=_0x137293[_0xeabc('0x3d')];_0x4c2693[_0xeabc('0x3e')]=_0x137293[_0xeabc('0x3e')];_0x4c2693[_0xeabc('0x3f')]=_0x137293[_0xeabc('0x3f')];_0x4c2693['outboundNoSuchCallsDay']=_0x137293[_0xeabc('0x40')];_0x4c2693['outboundOriginateFailureCallsDay']=_0x137293[_0xeabc('0x41')];_0x4c2693[_0xeabc('0x42')]=_0x137293[_0xeabc('0x42')];_0x4c2693['outboundRejectCallsDay']=_0x137293['outboundRejectCallsDay'];_0x4c2693[_0xeabc('0x43')]=_0x137293['outboundUnknownCallsDay'];_0x4c2693[_0xeabc('0x44')]=_0x137293['predictiveIntervalAnsweredCalls'];_0x4c2693['predictiveIntervalAvgHoldtime']=_0x137293['predictiveIntervalAvgHoldtime'];_0x4c2693['predictiveIntervalAvgTalktime']=_0x137293[_0xeabc('0x45')];_0x4c2693['predictiveIntervalDroppedCallsCallersExit']=_0x137293[_0xeabc('0x46')];_0x4c2693[_0xeabc('0x47')]=_0x137293['predictiveIntervalDroppedCallsTimeout'];_0x4c2693[_0xeabc('0x48')]=_0x137293['predictiveIntervalErlangCalls'];_0x4c2693[_0xeabc('0x49')]=_0x137293['predictiveIntervalErlangCallsDroppedCalls'];_0x4c2693[_0xeabc('0x4a')]=_0x137293[_0xeabc('0x4a')];_0x4c2693[_0xeabc('0x4b')]=_0x137293['predictiveIntervalMultiplicativeFactor'];_0x4c2693['predictiveIntervalPauses']=_0x137293['predictiveIntervalPauses'];_0x4c2693[_0xeabc('0x4c')]=_0x137293[_0xeabc('0x4c')];_0x4c2693[_0xeabc('0x4d')]=_0x137293['predictiveIntervalTotalCalls'];_0x4c2693['message']=_0x137293[_0xeabc('0x1b')];_0x4c2693[_0xeabc('0x4e')]=_0x137293['originated'];_0x4c2693[_0xeabc('0x4f')]=_0x137293['erlangCalls'];_0x4c2693[_0xeabc('0x50')]=_0x137293['erlangCallToSecond'];_0x4c2693['erlangAbandonmentRate']=_0x137293['erlangAbandonmentRate'];_0x4c2693[_0xeabc('0x51')]=_0x137293[_0xeabc('0x51')];_0x4c2693[_0xeabc('0x52')]=_0x137293[_0xeabc('0x52')];_0x4c2693['startProgressive']=_0x137293[_0xeabc('0x53')];}if(_0x137293['Trunk']){_0x4c2693[_0xeabc('0x54')]={'id':_0x137293[_0xeabc('0x54')]['id'],'name':_0x137293[_0xeabc('0x54')][_0xeabc('0xb')],'active':_0x137293[_0xeabc('0x54')]['active'],'callerid':_0x137293['Trunk'][_0xeabc('0x55')]};}if(_0x137293['Interval']){_0x4c2693[_0xeabc('0x56')]={'id':_0x137293[_0xeabc('0x56')]['id'],'name':_0x137293['Interval'][_0xeabc('0xb')]};}_0x811f0d[_0xeabc('0x57')](_0x4c2693);}}_0x27dbaf({'count':_0x811f0d[_0xeabc('0x58')],'rows':_0x811f0d});});},'UpdateVoiceQueue':function(_0x353038){return new Promise(function(_0x4360d7,_0xcaa5b9){var _0x2003a7=_['find'](_0x5e9e2d[_0xeabc('0x23')],{'id':parseInt(_0x353038['id'])});var _0x2c85f0=_[_0xeabc('0x59')](_0x353038,['id']);if(_0x2003a7){for(var _0x1b41c8 in _0x2c85f0){if(typeof _0x2c85f0[_0x1b41c8]!==_0xeabc('0x5a')&&typeof _0x2003a7[_0x1b41c8]!==_0xeabc('0x5a')){_0x2003a7[_0x1b41c8]=_0x2c85f0[_0x1b41c8];}}_0x4360d7(_0x2003a7);}else{_0xcaa5b9();}});},'VoiceChannels':function(_0x2107d5){return new Promise(function(_0x20f004,_0x10d938){var _0x44e714=_['values'](_0x5e9e2d[_0xeabc('0x5b')]);_0x20f004({'count':_0x44e714[_0xeabc('0x58')],'rows':_0x44e714});});},'VoiceChannelMixMonitor':function(_0x41f5d7){var _0xec22ef=this;return new Promise(function(_0x34abdf,_0x26f829){if(ami[_0xeabc('0x13')]()==![]){return _0x26f829(_0xec22ef['error'](0x1f4,[config[_0xeabc('0x14')]['ip'],config[_0xeabc('0x14')][_0xeabc('0x15')],_0xeabc('0x16')][_0xeabc('0x1e')]('\x20')));}var _0x58e2c1=schema(properties[_0xeabc('0x5c')])[_0xeabc('0x3')](_0x41f5d7);if(_0x58e2c1[_0xeabc('0x58')]>0x0){return _0x26f829(_0xec22ef[_0xeabc('0x1d')](0x1f4,_['map'](_0x58e2c1,_0xeabc('0x1b'))[_0xeabc('0x1e')](',\x20')));}var _0x568847=_[_0xeabc('0x5d')](_0x5e9e2d['channels'],{'uniqueid':_0x41f5d7[_0xeabc('0x5e')]});if(_0x568847&&_0x568847['channel']){var _0x16ce77=util[_0xeabc('0x8')](_0xeabc('0x5f'),_0x41f5d7[_0xeabc('0x60')]||_0x41f5d7[_0xeabc('0x5e')],_0x41f5d7[_0xeabc('0x8')]||_0xeabc('0x61'));return ami[_0xeabc('0x21')]({'action':_0xeabc('0x62'),'channel':_0x568847[_0xeabc('0x63')],'file':_0x16ce77,'options':'ai(mixmonitorid)'})[_0xeabc('0x1a')](function(_0x2537ab){var _0x4072cb=_[_0xeabc('0x5d')](_0x568847['monitors'],{'filename':_0xeabc('0x64')+_0x16ce77[_0xeabc('0x65')]()});if(_[_0xeabc('0x66')](_0x4072cb)){_0x568847[_0xeabc('0x67')]['push']({'filename':_0xeabc('0x64')+_0x16ce77[_0xeabc('0x65')](),'createdAt':moment()[_0xeabc('0x8')](_0xeabc('0x68')),'mixmonitorid':_0x2537ab[_0xeabc('0x69')],'status':_0xeabc('0x6a')});}else{_0x4072cb[_0xeabc('0x69')]=_0x2537ab[_0xeabc('0x69')];_0x4072cb[_0xeabc('0x6b')]='rec';}_0x34abdf({'code':0xc8,'message':[_0x41f5d7[_0xeabc('0x5e')],'MixMonitor\x20Success',_0x2537ab['mixmonitorid']]['join']('\x20'),'mixmonitorid':_0x2537ab[_0xeabc('0x69')]});})[_0xeabc('0x1c')](function(_0x219ca8){_0x26f829(_0xec22ef[_0xeabc('0x1d')](0x1f5,[_0x41f5d7[_0xeabc('0x5e')],_0x219ca8[_0xeabc('0x1b')]['toLowerCase']()][_0xeabc('0x1e')]('\x20')));});}else{return _0x26f829(_0xec22ef[_0xeabc('0x1d')](0x1f5,_0xeabc('0x6c')));}});},'VoiceChannelStopMixMonitor':function(_0x104c1e){var _0x2ddc53=this;return new Promise(function(_0x2c7b4e,_0x1750e9){if(ami[_0xeabc('0x13')]()==![]){return _0x1750e9(_0x2ddc53['error'](0x1f4,[config['asterisk']['ip'],config[_0xeabc('0x14')][_0xeabc('0x15')],_0xeabc('0x16')]['join']('\x20')));}var _0x287f88=schema(properties['voicechannel'])['validate'](_0x104c1e);if(_0x287f88[_0xeabc('0x58')]>0x0){return _0x1750e9(_0x2ddc53[_0xeabc('0x1d')](0x1f4,_[_0xeabc('0x6d')](_0x287f88,_0xeabc('0x1b'))[_0xeabc('0x1e')](',\x20')));}var _0xc2ef0c=_['find'](_0x5e9e2d[_0xeabc('0x5b')],{'uniqueid':_0x104c1e[_0xeabc('0x5e')]});if(_0xc2ef0c){return BPromise[_0xeabc('0x6e')]()[_0xeabc('0x1a')](function(){if(_0xc2ef0c[_0xeabc('0x63')]){return ami[_0xeabc('0x21')]({'action':'StopMixMonitor','channel':_0xc2ef0c[_0xeabc('0x63')],'mixmonitorid':_0x104c1e[_0xeabc('0x69')]})[_0xeabc('0x1c')](function(_0x165899){});}})[_0xeabc('0x1a')](function(){if(_0xc2ef0c[_0xeabc('0x6f')]){return ami[_0xeabc('0x21')]({'action':_0xeabc('0x70'),'channel':_0xc2ef0c[_0xeabc('0x6f')],'mixmonitorid':_0x104c1e['mixmonitorid']})[_0xeabc('0x1c')](function(_0x590439){});}})[_0xeabc('0x1a')](function(_0x2c389d){var _0x3fea99=_[_0xeabc('0x5d')](_0xc2ef0c[_0xeabc('0x67')],{'mixmonitorid':_0x104c1e[_0xeabc('0x69')]});if(_0x3fea99){_0x3fea99[_0xeabc('0x6b')]=_0xeabc('0x71');}})[_0xeabc('0x1a')](function(){var _0x24d0e5=util['format'](_0xeabc('0x5f'),_0x104c1e[_0xeabc('0x60')]||_0x104c1e[_0xeabc('0x5e')],_0x104c1e[_0xeabc('0x8')]||'wav');var _0x12fd48=_['find'](_0xc2ef0c['monitors'],{'filename':_0xeabc('0x64')+_0x24d0e5[_0xeabc('0x65')]()});if(_0x12fd48){_0x12fd48[_0xeabc('0x6b')]=_0xeabc('0x71');}})['then'](function(){_0x2c7b4e({'code':0xc8,'message':[_0x104c1e['uniqueid'],_0xeabc('0x72')]['join']('\x20')});})['catch'](function(_0x44c0a6){_0x1750e9(_0x2ddc53['error'](0x1f5,[_0x104c1e['uniqueid'],_0x44c0a6[_0xeabc('0x1b')][_0xeabc('0x65')]()]['join']('\x20')));});}else{return _0x1750e9(_0x2ddc53['error'](0x1f5,_0xeabc('0x6c')));}});},'VoiceQueuesChannels':function(_0x5d183a){return new Promise(function(_0x238e2d,_0x15ca17){var _0x4c84a9=_['values'](_0x5e9e2d[_0xeabc('0x73')]);_0x238e2d({'count':_0x4c84a9[_0xeabc('0x58')],'rows':_0x4c84a9});});},'VoiceQueuesChannel':function(_0xd86ea7){var _0x471cb6=this;return new Promise(function(_0x1debaa,_0x511b33){var _0x53f578=schema(properties[_0xeabc('0x74')])['validate'](_0xd86ea7);if(_0x53f578[_0xeabc('0x58')]>0x0){return _0x511b33(_0x471cb6['error'](0x1f4,_[_0xeabc('0x6d')](_0x53f578,'message')[_0xeabc('0x1e')](',\x20')));}var _0x53ac31=_[_0xeabc('0x5d')](_0x5e9e2d[_0xeabc('0x73')],{'uniqueid':_0xd86ea7[_0xeabc('0x5e')]});if(_0x53ac31){_0x1debaa(_0x53ac31);}else{return _0x511b33(_0x471cb6[_0xeabc('0x1d')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x6ee7cf){var _0x4fa682=this;return new Promise(function(_0x26ff38,_0x3e87c3){if(ami[_0xeabc('0x13')]()==![]){return _0x3e87c3(_0x4fa682[_0xeabc('0x1d')](0x1f4,[config[_0xeabc('0x14')]['ip'],config['asterisk'][_0xeabc('0x15')],_0xeabc('0x16')][_0xeabc('0x1e')]('\x20')));}var _0x2509a4=schema(properties['voicequeuechannelhangup'])[_0xeabc('0x3')](_0x6ee7cf);if(_0x2509a4[_0xeabc('0x58')]>0x0){return _0x3e87c3(_0x4fa682[_0xeabc('0x1d')](0x1f4,_[_0xeabc('0x6d')](_0x2509a4,'message')[_0xeabc('0x1e')](',\x20')));}var _0x368cd4=_[_0xeabc('0x5d')](_0x5e9e2d[_0xeabc('0x73')],{'uniqueid':_0x6ee7cf['uniqueid']});if(_0x368cd4&&_0x368cd4['channel']){return ami[_0xeabc('0x21')]({'action':'Hangup','channel':_0x368cd4['channel']})[_0xeabc('0x1a')](function(_0x460f07){_0x26ff38({'code':0xc8,'message':[_0x6ee7cf[_0xeabc('0x5e')],_0x460f07['message'][_0xeabc('0x65')]()][_0xeabc('0x1e')]('\x20')});})['catch'](function(_0x3d1d12){_0x3e87c3(_0x4fa682[_0xeabc('0x1d')](0x1f5,[_0x6ee7cf[_0xeabc('0x5e')],_0x3d1d12[_0xeabc('0x1b')][_0xeabc('0x65')]()]['join']('\x20')));});}else{return _0x3e87c3(_0x4fa682[_0xeabc('0x1d')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x480c66){var _0x4c4b1e=this;return new Promise(function(_0x953553,_0x1c8a51){if(ami[_0xeabc('0x13')]()==![]){return _0x1c8a51(_0x4c4b1e[_0xeabc('0x1d')](0x1f4,[config[_0xeabc('0x14')]['ip'],config['asterisk'][_0xeabc('0x15')],'ami\x20disconnected'][_0xeabc('0x1e')]('\x20')));}var _0x2f95c7=schema(properties['voicequeuechannelredirect'])[_0xeabc('0x3')](_0x480c66);if(_0x2f95c7['length']>0x0){return _0x1c8a51(_0x4c4b1e['error'](0x1f4,_[_0xeabc('0x6d')](_0x2f95c7,_0xeabc('0x1b'))[_0xeabc('0x1e')](',\x20')));}var _0x3acb88=_[_0xeabc('0x5d')](_0x5e9e2d['queueChannels'],{'uniqueid':_0x480c66[_0xeabc('0x5e')]});if(_0x3acb88&&_0x3acb88[_0xeabc('0x63')]){return ami[_0xeabc('0x21')]({'action':_0xeabc('0x75'),'channel':_0x3acb88[_0xeabc('0x63')],'exten':_0x480c66[_0xeabc('0x76')],'context':_0x480c66[_0xeabc('0x77')]||_0x3acb88[_0xeabc('0x77')],'priority':0x1})[_0xeabc('0x1a')](function(_0x1921d5){_0x953553({'code':0xc8,'message':[_0x480c66['uniqueid'],_0x1921d5[_0xeabc('0x1b')][_0xeabc('0x65')]()][_0xeabc('0x1e')]('\x20')});})['catch'](function(_0x4bccf7){_0x1c8a51(_0x4c4b1e[_0xeabc('0x1d')](0x1f5,[_0x480c66[_0xeabc('0x5e')],_0x4bccf7[_0xeabc('0x1b')][_0xeabc('0x65')]()][_0xeabc('0x1e')]('\x20')));});}else{return _0x1c8a51(_0x4c4b1e['error'](0x1f5,_0xeabc('0x6c')));}});},'Agents':function(_0x538190){return new Promise(function(_0x5f39ef,_0x16ff81){var _0x302e94=_['values'](_0x5e9e2d[_0xeabc('0xf')]);_0x5f39ef({'count':_0x302e94[_0xeabc('0x58')],'rows':_0x302e94});});},'Telephones':function(_0x49a70a){return new Promise(function(_0x5963f7,_0xfaef39){var _0xb04677=_[_0xeabc('0x78')](_0x5e9e2d[_0xeabc('0x79')]);_0x5963f7({'count':_0xb04677[_0xeabc('0x58')],'rows':_0xb04677});});},'Trunks':function(_0x1b0995){return new Promise(function(_0x1f8197,_0x485c13){var _0xb54c35=_['values'](_0x5e9e2d[_0xeabc('0x7a')]);_0x1f8197({'count':_0xb54c35[_0xeabc('0x58')],'rows':_0xb54c35});});},'OutboundChannels':function(_0x204e39){return new Promise(function(_0x2d1441,_0x62cb8e){var _0x20c003=_[_0xeabc('0x78')](_0x5e9e2d[_0xeabc('0x7b')]);_0x2d1441({'count':_0x20c003[_0xeabc('0x58')],'rows':_0x20c003});});},'Outbound':function(_0x156e20){return new Promise(function(_0x42e92b,_0x5d471f){_0x42e92b(_0x5e9e2d[_0xeabc('0x7c')]);});},'Campaigns':function(_0x274ddc){return new Promise(function(_0x3a3967,_0x1e880e){var _0x5b00d6=_[_0xeabc('0x78')](_0x5e9e2d[_0xeabc('0x7d')]);_0x3a3967({'count':_0x5b00d6['length'],'rows':_0x5b00d6});});},'VoiceQueuesPreview':function(_0x3de927){var _0x22ef88=this;return new Promise(function(_0x5086e7,_0x507ac0){_0x54e4a8['run'](_0x3de927['id'])['then'](function(_0x2959e9){_0x5086e7({'code':0xc8,'message':_0x2959e9[_0xeabc('0x1b')]});})[_0xeabc('0x1c')](function(_0xe18bf1){_0x507ac0(_0x22ef88[_0xeabc('0x1d')](0x1f4,_0xe18bf1[_0xeabc('0x1b')]));});});},'EventManager':function(_0x3abe69){var _0x385ecf=this;return new Promise(function(_0x18c27f,_0x3eb795){if(!_0x3abe69['event']){return _0x3eb795(_0x385ecf[_0xeabc('0x1d')](0x1f4,_0xeabc('0x7e')));}ami['emit'](_0xeabc('0x7f')+_0x3abe69[_0xeabc('0x80')],_0x3abe69[_0xeabc('0x1b')]);_0x18c27f({'code':0xc8,'message':_0x3abe69});});},'FaxAccounts':function(_0x4c4ee3){return new Promise(function(_0x1f3198,_0x488120){var _0x425e5c=_[_0xeabc('0x78')](_0x5e9e2d[_0xeabc('0x81')]);_0x1f3198({'count':_0x425e5c[_0xeabc('0x58')],'rows':_0x425e5c});});},'SendFax':function(_0x1c52f7){var _0x5e7e00=this;return new Promise(function(_0x53a5bc,_0x5e9079){_0x1b07a8['send'](_0x1c52f7)[_0xeabc('0x1a')](function(_0x3c2725){_0x53a5bc({'code':0xc8,'message':_0x3c2725[_0xeabc('0x1b')]});})['catch'](function(_0x12f83f){_0x5e9079(_0x5e7e00[_0xeabc('0x1d')](0x1f4,_0x12f83f[_0xeabc('0x1b')]));});});},'CheckAfterSend':function(_0x36cc30){var _0x39964d=this;return new Promise(function(_0x646353,_0xdd956){_0x1b07a8[_0xeabc('0x82')](_0x36cc30)[_0xeabc('0x1a')](function(_0x391e67){_0x646353({'code':0xc8,'message':_0x391e67[_0xeabc('0x1b')]});})[_0xeabc('0x1c')](function(_0x5a1422){_0xdd956(_0x39964d['error'](0x1f4,_0x5a1422[_0xeabc('0x1b')]));});});}};var _0x50a5d5=jayson[_0xeabc('0x83')](_0x52ede8)[_0xeabc('0x84')]();_0x50a5d5['on'](_0xeabc('0x1d'),function(_0x56f622){return _0x229ba4(_0x56f622);});_0x50a5d5[_0xeabc('0x7')](0x232a,_0xeabc('0x85'),function(){console[_0xeabc('0x86')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x52a4d7('RPC\x20listening\x20on\x20port:'+0x232a);});});}; \ No newline at end of file +var _0x4fb4=['format','%s/%s','SIP','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Action','then','message','catch','Command','content','voiceQueues','strategy','answered','available','loggedIn','pTalking','sumBillable','total','unmanaged','abandoned','loggedInDb','type','outbound','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','Interval','find','omit','undefined','channels','uniqueid','channel','%s.%s','filename','wav','MixMonitor','isNil','monitors','push','/var/spool/asterisk/monitor/','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','voicechannel','length','map','StopMixMonitor','destinationchannel','stop','StopMixMonitor\x20Success','values','queueChannels','voicequeuechannelhangup','Redirect','exten','context','trunks','campaigns','run','event','Event\x20name\x20mandatory','emit','custom:','faxAccounts','send','server','http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','util','jayson/promise','validate','bluebird','moment','../../../config/environment','../ami','listen'];(function(_0x4a1fac,_0x106ce8){var _0x470c9e=function(_0x5175c0){while(--_0x5175c0){_0x4a1fac['push'](_0x4a1fac['shift']());}};_0x470c9e(++_0x106ce8);}(_0x4fb4,0x190));var _0x44fb=function(_0x170561,_0x2f0ca9){_0x170561=_0x170561-0x0;var _0x3e753e=_0x4fb4[_0x170561];return _0x3e753e;};'use strict';var _=require('lodash');var util=require(_0x44fb('0x0'));var jayson=require(_0x44fb('0x1'));var schema=require(_0x44fb('0x2'));var BPromise=require(_0x44fb('0x3'));var moment=require(_0x44fb('0x4'));var config=require(_0x44fb('0x5'));var properties=require('../properties');var ami=require(_0x44fb('0x6'));exports[_0x44fb('0x7')]=function(_0x308b96,_0x26fbd6,_0x375d33){return new BPromise(function(_0x173e70,_0x464af5){var _0x2a4d75={'QueuePause':function(_0x59aa6d){return new Promise(function(_0x87f716,_0xd4ead0){var _0x5405a8=util[_0x44fb('0x8')](_0x44fb('0x9'),_0x44fb('0xa'),_0x59aa6d[_0x44fb('0xb')]);if(_0x308b96[_0x44fb('0xc')]&&_0x308b96[_0x44fb('0xc')][_0x5405a8]&&_0x308b96[_0x44fb('0xc')][_0x5405a8][_0x44fb('0xd')]){_0x308b96[_0x44fb('0xc')][_0x5405a8][_0x44fb('0xe')]();}if(_0x308b96['agents'][_0x5405a8]){_0x308b96[_0x44fb('0xf')][_0x5405a8][_0x44fb('0x10')]({'statePause':_0x59aa6d[_0x44fb('0x11')]?!![]:![]});}_0x87f716({'code':0xc8,'message':_0x44fb('0x12')});});},'Reload':function(_0x1c1cbc){var _0x47c87b=this;return new Promise(function(_0x1fc8fa,_0xaedd7f){if(ami[_0x44fb('0x13')]()==![]){return _0xaedd7f(_0x47c87b[_0x44fb('0x14')](0x1f4,[config[_0x44fb('0x15')]['ip'],config['asterisk'][_0x44fb('0x16')],_0x44fb('0x17')][_0x44fb('0x18')]('\x20')));}_0x1c1cbc=_[_0x44fb('0x19')](_0x1c1cbc,_[_0x44fb('0x1a')](properties[_0x44fb('0x1b')]));_0x1c1cbc[_0x44fb('0x1c')]='Reload';return ami[_0x44fb('0x1d')](_0x1c1cbc)[_0x44fb('0x1e')](function(_0x2e0efd){_0x1fc8fa({'code':0xc8,'message':_0x2e0efd[_0x44fb('0x1f')]});})[_0x44fb('0x20')](function(_0x22c2eb){_0xaedd7f(_0x47c87b[_0x44fb('0x14')](0x1f5,_0x22c2eb[_0x44fb('0x1f')]));});});},'Command':function(_0x44e6de){var _0x1fc48c=this;return new Promise(function(_0x5eafcb,_0x4bd157){if(ami['isConnected']()==![]){return _0x4bd157(_0x1fc48c[_0x44fb('0x14')](0x1f4,[config[_0x44fb('0x15')]['ip'],config[_0x44fb('0x15')]['username'],_0x44fb('0x17')][_0x44fb('0x18')]('\x20')));}_0x44e6de=_[_0x44fb('0x19')](_0x44e6de,'command');_0x44e6de['action']=_0x44fb('0x21');return ami[_0x44fb('0x1d')](_0x44e6de)[_0x44fb('0x1e')](function(_0x4fc66d){_0x5eafcb({'code':0xc8,'message':_0x4fc66d[_0x44fb('0x22')]});})[_0x44fb('0x20')](function(_0x1f3d5c){_0x4bd157(_0x1fc48c['error'](0x1f5,_0x1f3d5c['message']));});});},'VoiceQueues':function(_0x105b88){return new Promise(function(_0xa50a49,_0x1c831e){var _0x733c=[];for(var _0x5e7116 in _0x308b96[_0x44fb('0x23')]){if(_0x308b96[_0x44fb('0x23')]['hasOwnProperty'](_0x5e7116)){var _0x5b6ce5=_0x308b96[_0x44fb('0x23')][_0x5e7116];var _0x2611d6={'id':_0x5b6ce5['id'],'name':_0x5b6ce5[_0x44fb('0xb')],'strategy':_0x5b6ce5[_0x44fb('0x24')],'answered':_0x5b6ce5[_0x44fb('0x25')],'available':_0x5b6ce5[_0x44fb('0x26')],'loggedIn':_0x5b6ce5[_0x44fb('0x27')],'pTalking':_0x5b6ce5[_0x44fb('0x28')],'sumBillable':_0x5b6ce5[_0x44fb('0x29')],'sumDuration':_0x5b6ce5['sumDuration'],'sumHoldTime':_0x5b6ce5['sumHoldTime']||0x0,'talking':_0x5b6ce5['talking'],'total':_0x5b6ce5[_0x44fb('0x2a')],'type':_0x5b6ce5['type'],'unmanaged':_0x5b6ce5[_0x44fb('0x2b')],'abandoned':_0x5b6ce5[_0x44fb('0x2c')],'waiting':_0x5b6ce5['waiting'],'loggedInDb':_0x5b6ce5[_0x44fb('0x2d')]};if(_0x5b6ce5[_0x44fb('0x2e')]===_0x44fb('0x2f')){_0x2611d6[_0x44fb('0x30')]=_0x5b6ce5[_0x44fb('0x30')];_0x2611d6['dialMethod']=_0x5b6ce5['dialMethod'];_0x2611d6[_0x44fb('0x31')]=_0x5b6ce5['dialOriginateCallerIdName'];_0x2611d6[_0x44fb('0x32')]=_0x5b6ce5[_0x44fb('0x32')];_0x2611d6[_0x44fb('0x33')]=_0x5b6ce5[_0x44fb('0x33')];_0x2611d6[_0x44fb('0x34')]=_0x5b6ce5[_0x44fb('0x34')];_0x2611d6[_0x44fb('0x35')]=_0x5b6ce5[_0x44fb('0x35')];_0x2611d6[_0x44fb('0x36')]=_0x5b6ce5[_0x44fb('0x36')];_0x2611d6[_0x44fb('0x37')]=_0x5b6ce5[_0x44fb('0x37')];_0x2611d6[_0x44fb('0x38')]=_0x5b6ce5[_0x44fb('0x38')];_0x2611d6[_0x44fb('0x39')]=_0x5b6ce5['outboundBusyCallsDay'];_0x2611d6['outboundCongestionCallsDay']=_0x5b6ce5['outboundCongestionCallsDay'];_0x2611d6[_0x44fb('0x3a')]=_0x5b6ce5[_0x44fb('0x3a')];_0x2611d6[_0x44fb('0x3b')]=_0x5b6ce5[_0x44fb('0x3b')];_0x2611d6['outboundDropCallsDayTimeout']=_0x5b6ce5[_0x44fb('0x3c')];_0x2611d6[_0x44fb('0x3d')]=_0x5b6ce5['outboundNoAnswerCallsDay'];_0x2611d6[_0x44fb('0x3e')]=_0x5b6ce5['outboundNoSuchCallsDay'];_0x2611d6[_0x44fb('0x3f')]=_0x5b6ce5['outboundOriginateFailureCallsDay'];_0x2611d6[_0x44fb('0x40')]=_0x5b6ce5['outboundReCallsDay'];_0x2611d6[_0x44fb('0x41')]=_0x5b6ce5['outboundRejectCallsDay'];_0x2611d6['outboundUnknownCallsDay']=_0x5b6ce5[_0x44fb('0x42')];_0x2611d6[_0x44fb('0x43')]=_0x5b6ce5[_0x44fb('0x43')];_0x2611d6[_0x44fb('0x44')]=_0x5b6ce5[_0x44fb('0x44')];_0x2611d6[_0x44fb('0x45')]=_0x5b6ce5[_0x44fb('0x45')];_0x2611d6[_0x44fb('0x46')]=_0x5b6ce5[_0x44fb('0x46')];_0x2611d6[_0x44fb('0x47')]=_0x5b6ce5['predictiveIntervalDroppedCallsTimeout'];_0x2611d6[_0x44fb('0x48')]=_0x5b6ce5[_0x44fb('0x48')];_0x2611d6[_0x44fb('0x49')]=_0x5b6ce5[_0x44fb('0x49')];_0x2611d6[_0x44fb('0x4a')]=_0x5b6ce5['predictiveIntervalHitRate'];_0x2611d6[_0x44fb('0x4b')]=_0x5b6ce5[_0x44fb('0x4b')];_0x2611d6['predictiveIntervalPauses']=_0x5b6ce5['predictiveIntervalPauses'];_0x2611d6[_0x44fb('0x4c')]=_0x5b6ce5[_0x44fb('0x4c')];_0x2611d6[_0x44fb('0x4d')]=_0x5b6ce5['predictiveIntervalTotalCalls'];_0x2611d6[_0x44fb('0x1f')]=_0x5b6ce5[_0x44fb('0x1f')];_0x2611d6[_0x44fb('0x4e')]=_0x5b6ce5[_0x44fb('0x4e')];_0x2611d6[_0x44fb('0x4f')]=_0x5b6ce5[_0x44fb('0x4f')];_0x2611d6['erlangCallToSecond']=_0x5b6ce5[_0x44fb('0x50')];_0x2611d6['erlangAbandonmentRate']=_0x5b6ce5[_0x44fb('0x51')];_0x2611d6[_0x44fb('0x52')]=_0x5b6ce5[_0x44fb('0x52')];_0x2611d6[_0x44fb('0x53')]=_0x5b6ce5['startPredictive'];_0x2611d6[_0x44fb('0x54')]=_0x5b6ce5[_0x44fb('0x54')];}if(_0x5b6ce5[_0x44fb('0x55')]){_0x2611d6[_0x44fb('0x55')]={'id':_0x5b6ce5[_0x44fb('0x55')]['id'],'name':_0x5b6ce5['Trunk'][_0x44fb('0xb')],'active':_0x5b6ce5[_0x44fb('0x55')][_0x44fb('0x56')],'callerid':_0x5b6ce5[_0x44fb('0x55')]['callerid']};}if(_0x5b6ce5['Interval']){_0x2611d6[_0x44fb('0x57')]={'id':_0x5b6ce5[_0x44fb('0x57')]['id'],'name':_0x5b6ce5['Interval'][_0x44fb('0xb')]};}_0x733c['push'](_0x2611d6);}}_0xa50a49({'count':_0x733c['length'],'rows':_0x733c});});},'UpdateVoiceQueue':function(_0x5519d9){return new Promise(function(_0x5d5317,_0x396bdc){var _0x1a7acd=_[_0x44fb('0x58')](_0x308b96[_0x44fb('0x23')],{'id':parseInt(_0x5519d9['id'])});var _0x48fc96=_[_0x44fb('0x59')](_0x5519d9,['id']);if(_0x1a7acd){for(var _0x2bf1e0 in _0x48fc96){if(typeof _0x48fc96[_0x2bf1e0]!==_0x44fb('0x5a')&&typeof _0x1a7acd[_0x2bf1e0]!==_0x44fb('0x5a')){_0x1a7acd[_0x2bf1e0]=_0x48fc96[_0x2bf1e0];}}_0x5d5317(_0x1a7acd);}else{_0x396bdc();}});},'VoiceChannels':function(_0x1b6495){return new Promise(function(_0x204d54,_0x3eb4a1){var _0x15084d=_['values'](_0x308b96[_0x44fb('0x5b')]);_0x204d54({'count':_0x15084d['length'],'rows':_0x15084d});});},'VoiceChannelMixMonitor':function(_0x484529){var _0x304a0f=this;return new Promise(function(_0x16d8c2,_0x174e33){if(ami['isConnected']()==![]){return _0x174e33(_0x304a0f[_0x44fb('0x14')](0x1f4,[config[_0x44fb('0x15')]['ip'],config[_0x44fb('0x15')][_0x44fb('0x16')],_0x44fb('0x17')][_0x44fb('0x18')]('\x20')));}var _0x24eb8a=schema(properties['voicechannel'])[_0x44fb('0x2')](_0x484529);if(_0x24eb8a['length']>0x0){return _0x174e33(_0x304a0f[_0x44fb('0x14')](0x1f4,_['map'](_0x24eb8a,_0x44fb('0x1f'))[_0x44fb('0x18')](',\x20')));}var _0xf56878=_[_0x44fb('0x58')](_0x308b96['channels'],{'uniqueid':_0x484529[_0x44fb('0x5c')]});if(_0xf56878&&_0xf56878[_0x44fb('0x5d')]){var _0x247266=util[_0x44fb('0x8')](_0x44fb('0x5e'),_0x484529[_0x44fb('0x5f')]||_0x484529[_0x44fb('0x5c')],_0x484529[_0x44fb('0x8')]||_0x44fb('0x60'));return ami[_0x44fb('0x1d')]({'action':_0x44fb('0x61'),'channel':_0xf56878[_0x44fb('0x5d')],'file':_0x247266,'options':'ai(mixmonitorid)'})[_0x44fb('0x1e')](function(_0x4d0803){var _0x13a799=_[_0x44fb('0x58')](_0xf56878['monitors'],{'filename':'/var/spool/asterisk/monitor/'+_0x247266['toLowerCase']()});if(_[_0x44fb('0x62')](_0x13a799)){_0xf56878[_0x44fb('0x63')][_0x44fb('0x64')]({'filename':_0x44fb('0x65')+_0x247266[_0x44fb('0x66')](),'createdAt':moment()[_0x44fb('0x8')](_0x44fb('0x67')),'mixmonitorid':_0x4d0803[_0x44fb('0x68')],'status':_0x44fb('0x69')});}else{_0x13a799[_0x44fb('0x68')]=_0x4d0803[_0x44fb('0x68')];_0x13a799[_0x44fb('0x6a')]=_0x44fb('0x69');}_0x16d8c2({'code':0xc8,'message':[_0x484529[_0x44fb('0x5c')],_0x44fb('0x6b'),_0x4d0803[_0x44fb('0x68')]][_0x44fb('0x18')]('\x20'),'mixmonitorid':_0x4d0803[_0x44fb('0x68')]});})[_0x44fb('0x20')](function(_0x4dfba3){_0x174e33(_0x304a0f['error'](0x1f5,[_0x484529[_0x44fb('0x5c')],_0x4dfba3['message']['toLowerCase']()]['join']('\x20')));});}else{return _0x174e33(_0x304a0f[_0x44fb('0x14')](0x1f5,_0x44fb('0x6c')));}});},'VoiceChannelStopMixMonitor':function(_0x174fcf){var _0x55f28f=this;return new Promise(function(_0x986ca,_0x5ad3af){if(ami[_0x44fb('0x13')]()==![]){return _0x5ad3af(_0x55f28f['error'](0x1f4,[config[_0x44fb('0x15')]['ip'],config[_0x44fb('0x15')][_0x44fb('0x16')],'ami\x20disconnected'][_0x44fb('0x18')]('\x20')));}var _0x14cfc4=schema(properties[_0x44fb('0x6d')])['validate'](_0x174fcf);if(_0x14cfc4[_0x44fb('0x6e')]>0x0){return _0x5ad3af(_0x55f28f[_0x44fb('0x14')](0x1f4,_[_0x44fb('0x6f')](_0x14cfc4,'message')['join'](',\x20')));}var _0x1ed4a0=_[_0x44fb('0x58')](_0x308b96[_0x44fb('0x5b')],{'uniqueid':_0x174fcf[_0x44fb('0x5c')]});if(_0x1ed4a0){return BPromise['resolve']()['then'](function(){if(_0x1ed4a0[_0x44fb('0x5d')]){return ami[_0x44fb('0x1d')]({'action':_0x44fb('0x70'),'channel':_0x1ed4a0[_0x44fb('0x5d')],'mixmonitorid':_0x174fcf[_0x44fb('0x68')]})[_0x44fb('0x20')](function(_0x5a7d27){});}})[_0x44fb('0x1e')](function(){if(_0x1ed4a0[_0x44fb('0x71')]){return ami[_0x44fb('0x1d')]({'action':_0x44fb('0x70'),'channel':_0x1ed4a0['destinationchannel'],'mixmonitorid':_0x174fcf['mixmonitorid']})[_0x44fb('0x20')](function(_0xf0c095){});}})[_0x44fb('0x1e')](function(_0x5edbb9){var _0x269270=_['find'](_0x1ed4a0[_0x44fb('0x63')],{'mixmonitorid':_0x174fcf[_0x44fb('0x68')]});if(_0x269270){_0x269270[_0x44fb('0x6a')]=_0x44fb('0x72');}})[_0x44fb('0x1e')](function(){var _0x4796b1=util[_0x44fb('0x8')](_0x44fb('0x5e'),_0x174fcf[_0x44fb('0x5f')]||_0x174fcf[_0x44fb('0x5c')],_0x174fcf['format']||_0x44fb('0x60'));var _0x26a86e=_[_0x44fb('0x58')](_0x1ed4a0[_0x44fb('0x63')],{'filename':_0x44fb('0x65')+_0x4796b1[_0x44fb('0x66')]()});if(_0x26a86e){_0x26a86e[_0x44fb('0x6a')]=_0x44fb('0x72');}})[_0x44fb('0x1e')](function(){_0x986ca({'code':0xc8,'message':[_0x174fcf[_0x44fb('0x5c')],_0x44fb('0x73')][_0x44fb('0x18')]('\x20')});})[_0x44fb('0x20')](function(_0x2cb5c5){_0x5ad3af(_0x55f28f[_0x44fb('0x14')](0x1f5,[_0x174fcf[_0x44fb('0x5c')],_0x2cb5c5[_0x44fb('0x1f')][_0x44fb('0x66')]()][_0x44fb('0x18')]('\x20')));});}else{return _0x5ad3af(_0x55f28f['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(_0x3d51db){return new Promise(function(_0x3cc62c,_0x3781a9){var _0x1feabd=_[_0x44fb('0x74')](_0x308b96[_0x44fb('0x75')]);_0x3cc62c({'count':_0x1feabd['length'],'rows':_0x1feabd});});},'VoiceQueuesChannel':function(_0x56e968){var _0x40a471=this;return new Promise(function(_0x443b6b,_0x149e96){var _0x25d64f=schema(properties['voicequeuechannel'])[_0x44fb('0x2')](_0x56e968);if(_0x25d64f[_0x44fb('0x6e')]>0x0){return _0x149e96(_0x40a471[_0x44fb('0x14')](0x1f4,_[_0x44fb('0x6f')](_0x25d64f,_0x44fb('0x1f'))[_0x44fb('0x18')](',\x20')));}var _0xf77a1a=_[_0x44fb('0x58')](_0x308b96[_0x44fb('0x75')],{'uniqueid':_0x56e968[_0x44fb('0x5c')]});if(_0xf77a1a){_0x443b6b(_0xf77a1a);}else{return _0x149e96(_0x40a471['error'](0x1f5,_0x44fb('0x6c')));}});},'VoiceQueuesChannelHangup':function(_0x2d1bb9){var _0x5b9ba8=this;return new Promise(function(_0x4395ae,_0x443e66){if(ami['isConnected']()==![]){return _0x443e66(_0x5b9ba8[_0x44fb('0x14')](0x1f4,[config[_0x44fb('0x15')]['ip'],config[_0x44fb('0x15')]['username'],'ami\x20disconnected']['join']('\x20')));}var _0x1e506a=schema(properties[_0x44fb('0x76')])[_0x44fb('0x2')](_0x2d1bb9);if(_0x1e506a[_0x44fb('0x6e')]>0x0){return _0x443e66(_0x5b9ba8[_0x44fb('0x14')](0x1f4,_[_0x44fb('0x6f')](_0x1e506a,_0x44fb('0x1f'))[_0x44fb('0x18')](',\x20')));}var _0x55905f=_[_0x44fb('0x58')](_0x308b96[_0x44fb('0x75')],{'uniqueid':_0x2d1bb9[_0x44fb('0x5c')]});if(_0x55905f&&_0x55905f[_0x44fb('0x5d')]){return ami[_0x44fb('0x1d')]({'action':'Hangup','channel':_0x55905f[_0x44fb('0x5d')]})[_0x44fb('0x1e')](function(_0x31d02d){_0x4395ae({'code':0xc8,'message':[_0x2d1bb9['uniqueid'],_0x31d02d[_0x44fb('0x1f')][_0x44fb('0x66')]()][_0x44fb('0x18')]('\x20')});})[_0x44fb('0x20')](function(_0xcc7787){_0x443e66(_0x5b9ba8[_0x44fb('0x14')](0x1f5,[_0x2d1bb9[_0x44fb('0x5c')],_0xcc7787[_0x44fb('0x1f')][_0x44fb('0x66')]()][_0x44fb('0x18')]('\x20')));});}else{return _0x443e66(_0x5b9ba8[_0x44fb('0x14')](0x1f5,_0x44fb('0x6c')));}});},'VoiceQueuesChannelRedirect':function(_0x3d1f34){var _0x650ea9=this;return new Promise(function(_0x5aef90,_0x45045e){if(ami[_0x44fb('0x13')]()==![]){return _0x45045e(_0x650ea9[_0x44fb('0x14')](0x1f4,[config[_0x44fb('0x15')]['ip'],config[_0x44fb('0x15')][_0x44fb('0x16')],_0x44fb('0x17')][_0x44fb('0x18')]('\x20')));}var _0x34268f=schema(properties['voicequeuechannelredirect'])[_0x44fb('0x2')](_0x3d1f34);if(_0x34268f['length']>0x0){return _0x45045e(_0x650ea9[_0x44fb('0x14')](0x1f4,_[_0x44fb('0x6f')](_0x34268f,'message')['join'](',\x20')));}var _0x358042=_[_0x44fb('0x58')](_0x308b96['queueChannels'],{'uniqueid':_0x3d1f34[_0x44fb('0x5c')]});if(_0x358042&&_0x358042['channel']){return ami['Action']({'action':_0x44fb('0x77'),'channel':_0x358042[_0x44fb('0x5d')],'exten':_0x3d1f34[_0x44fb('0x78')],'context':_0x3d1f34[_0x44fb('0x79')]||_0x358042[_0x44fb('0x79')],'priority':0x1})['then'](function(_0x57191f){_0x5aef90({'code':0xc8,'message':[_0x3d1f34['uniqueid'],_0x57191f[_0x44fb('0x1f')][_0x44fb('0x66')]()][_0x44fb('0x18')]('\x20')});})[_0x44fb('0x20')](function(_0x2be4c5){_0x45045e(_0x650ea9[_0x44fb('0x14')](0x1f5,[_0x3d1f34[_0x44fb('0x5c')],_0x2be4c5[_0x44fb('0x1f')][_0x44fb('0x66')]()][_0x44fb('0x18')]('\x20')));});}else{return _0x45045e(_0x650ea9[_0x44fb('0x14')](0x1f5,_0x44fb('0x6c')));}});},'Agents':function(_0xf37376){return new Promise(function(_0x26c134,_0x55f5c8){var _0x8b4613=_['values'](_0x308b96[_0x44fb('0xf')]);_0x26c134({'count':_0x8b4613[_0x44fb('0x6e')],'rows':_0x8b4613});});},'Telephones':function(_0x5e1c14){return new Promise(function(_0x1792e7,_0x152963){var _0x2b5583=_[_0x44fb('0x74')](_0x308b96['telephones']);_0x1792e7({'count':_0x2b5583['length'],'rows':_0x2b5583});});},'Trunks':function(_0x173b35){return new Promise(function(_0x385c6b,_0x4a88bd){var _0x399142=_[_0x44fb('0x74')](_0x308b96[_0x44fb('0x7a')]);_0x385c6b({'count':_0x399142[_0x44fb('0x6e')],'rows':_0x399142});});},'OutboundChannels':function(_0x3fac48){return new Promise(function(_0x37db10,_0x1e7329){var _0x4f5c7f=_['values'](_0x308b96['outboundChannels']);_0x37db10({'count':_0x4f5c7f[_0x44fb('0x6e')],'rows':_0x4f5c7f});});},'Outbound':function(_0x4fd096){return new Promise(function(_0x385e5e,_0x2f677f){_0x385e5e(_0x308b96[_0x44fb('0x2f')]);});},'Campaigns':function(_0x15c6ee){return new Promise(function(_0x1294c1,_0x55a021){var _0x498fff=_['values'](_0x308b96[_0x44fb('0x7b')]);_0x1294c1({'count':_0x498fff[_0x44fb('0x6e')],'rows':_0x498fff});});},'VoiceQueuesPreview':function(_0x5ee6e1){var _0x268197=this;return new Promise(function(_0x55be2f,_0x4e7074){_0x26fbd6[_0x44fb('0x7c')](_0x5ee6e1['id'])[_0x44fb('0x1e')](function(_0x4c4843){_0x55be2f({'code':0xc8,'message':_0x4c4843[_0x44fb('0x1f')]});})[_0x44fb('0x20')](function(_0x214496){_0x4e7074(_0x268197[_0x44fb('0x14')](0x1f4,_0x214496['message']));});});},'EventManager':function(_0x20a3ec){var _0x35b928=this;return new Promise(function(_0x145f21,_0x11f460){if(!_0x20a3ec[_0x44fb('0x7d')]){return _0x11f460(_0x35b928[_0x44fb('0x14')](0x1f4,_0x44fb('0x7e')));}ami[_0x44fb('0x7f')](_0x44fb('0x80')+_0x20a3ec[_0x44fb('0x7d')],_0x20a3ec[_0x44fb('0x1f')]);_0x145f21({'code':0xc8,'message':_0x20a3ec});});},'FaxAccounts':function(_0x127bec){return new Promise(function(_0x10c4c9,_0x172fba){var _0x167293=_[_0x44fb('0x74')](_0x308b96[_0x44fb('0x81')]);_0x10c4c9({'count':_0x167293['length'],'rows':_0x167293});});},'SendFax':function(_0x3607a7){var _0x4bf099=this;return new Promise(function(_0x50f5bd,_0x215272){_0x375d33[_0x44fb('0x82')](_0x3607a7)[_0x44fb('0x1e')](function(_0x5a6ac3){_0x50f5bd({'code':0xc8,'message':_0x5a6ac3[_0x44fb('0x1f')]});})[_0x44fb('0x20')](function(_0x2a7f1a){_0x215272(_0x4bf099[_0x44fb('0x14')](0x1f4,_0x2a7f1a[_0x44fb('0x1f')]));});});},'CheckAfterSend':function(_0x158bfd){var _0x37aa8c=this;return new Promise(function(_0x45f8d3,_0x190e04){_0x375d33['checkAfterSend'](_0x158bfd)[_0x44fb('0x1e')](function(_0x41726c){_0x45f8d3({'code':0xc8,'message':_0x41726c['message']});})[_0x44fb('0x20')](function(_0x1a0c70){_0x190e04(_0x37aa8c[_0x44fb('0x14')](0x1f4,_0x1a0c70['message']));});});}};var _0x404e4a=jayson[_0x44fb('0x83')](_0x2a4d75)[_0x44fb('0x84')]();_0x404e4a['on'](_0x44fb('0x14'),function(_0x2257be){return _0x464af5(_0x2257be);});_0x404e4a[_0x44fb('0x7')](0x232a,_0x44fb('0x85'),function(){console[_0x44fb('0x86')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x173e70(_0x44fb('0x87')+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 d9b401c..c50a90e 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 _0x4e20=['util','../../../../config/logger','trigger','../../rpc/cmContact','redis','localhost','socket.io-emitter','info','[CM][%s][%s]','emit','exec','data1','data2','xmd-contactid','data3','phone','map','routeId','calleridnum','lastName','mobile','fax','ListId','createdAt','scheduledAt','union','resolve','then','getContacts','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','uniqueid','join','data4','[CM][%s][%s]\x20Autocreate\x20enabled','destcalleridnum','firstName','calleridname','destcalleridname','','Unknown','createContact','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','isNil','push','format','user:%s','name','trigger:%s','toLowerCase','bluebird'];(function(_0x5421f9,_0x287da5){var _0x109d9b=function(_0xedc33f){while(--_0xedc33f){_0x5421f9['push'](_0x5421f9['shift']());}};_0x109d9b(++_0x287da5);}(_0x4e20,0xd7));var _0x04e2=function(_0x695b76,_0x551526){_0x695b76=_0x695b76-0x0;var _0x1dc21f=_0x4e20[_0x695b76];return _0x1dc21f;};'use strict';var _=require('lodash');var BPromise=require(_0x04e2('0x0'));var Redis=require('ioredis');var util=require(_0x04e2('0x1'));var config=require('../../../../config/environment');var logger=require(_0x04e2('0x2'))(_0x04e2('0x3'));var cmContactRpc=require(_0x04e2('0x4'));config[_0x04e2('0x5')]=_['defaults'](config['redis'],{'host':_0x04e2('0x6'),'port':0x18eb});var io=require(_0x04e2('0x7'))(new Redis(config[_0x04e2('0x5')]));function emit(_0xfd815d,_0x37c0ae,_0x5e9d67,_0x86790b,_0x56ac0b){logger[_0x04e2('0x8')](_0x04e2('0x9'),_0xfd815d,_0x37c0ae['id'],_0x5e9d67,_0x86790b,JSON['stringify'](_0x56ac0b));io['to'](_0x5e9d67)[_0x04e2('0xa')](_0x86790b,_0x56ac0b);}exports[_0x04e2('0xb')]=function(_0x6e7a88,_0x522b1d,_0x56c604,_0x40bc3e){var _0x19ddde,_0x5424b8;var _0x5e1325={};var _0x5f2ed1=Number(_0x56c604[_0x04e2('0xc')]);var _0x54131b=_0x56c604[_0x04e2('0xd')]?Boolean(Number(_0x56c604['data2'])):![];var _0x264e26;if(_0x40bc3e[_0x04e2('0xe')]){_0x5e1325['id']=_0x40bc3e[_0x04e2('0xe')];}if(!_0x5e1325['id']){_0x5e1325['ListId']=_0x5f2ed1;_0x264e26=_0x56c604[_0x04e2('0xf')]&&_0x56c604['data3']!=='0'?_0x56c604[_0x04e2('0xf')]['split'](','):[_0x04e2('0x10')];_0x5e1325['$or']=_[_0x04e2('0x11')](_0x264e26,function(_0x35e6dd){var _0xbf932f={};_0xbf932f[_0x35e6dd]=_0x40bc3e[_0x04e2('0x12')]?_0x40bc3e['destcalleridnum']:_0x40bc3e[_0x04e2('0x13')];return _0xbf932f;});}var _0x40512d=['id','firstName',_0x04e2('0x14'),'phone',_0x04e2('0x15'),_0x04e2('0x16'),_0x04e2('0x17'),_0x04e2('0x18'),_0x04e2('0x19'),'updatedAt'];var _0x4363a1=_[_0x04e2('0x1a')](_0x40512d,_0x264e26);BPromise[_0x04e2('0x1b')]()[_0x04e2('0x1c')](cmContactRpc[_0x04e2('0x1d')]({'attributes':_0x4363a1,'where':_0x5e1325}))[_0x04e2('0x1c')](function(_0x157d1a){_0x5424b8=_0x157d1a;if(!_[_0x04e2('0x1e')](_0x5424b8)){if(_0x5424b8[_0x04e2('0x1f')]===0x1){_0x19ddde=_0x5424b8[0x0];logger[_0x04e2('0x8')](_0x04e2('0x20'),_0x40bc3e['uniqueid'],_0x522b1d['id'],_0x19ddde['id']);}else{logger['info'](_0x04e2('0x21'),_0x40bc3e[_0x04e2('0x22')],_0x522b1d['id'],_[_0x04e2('0x11')](_0x5424b8,'id')[_0x04e2('0x23')](','));}return;}else{logger['info']('[CM][%s][%s]\x20Contact\x20not\x20found',_0x40bc3e[_0x04e2('0x22')],_0x522b1d['id']);var _0x391bc2={'ListId':_0x5f2ed1};var _0x4c576c=_0x56c604[_0x04e2('0x24')]&&_0x56c604[_0x04e2('0x24')]!=='0'?_0x56c604[_0x04e2('0x24')]:_0x04e2('0x10');if(_0x54131b){logger[_0x04e2('0x8')](_0x04e2('0x25'),_0x40bc3e[_0x04e2('0x22')],_0x522b1d['id']);_0x391bc2[_0x4c576c]=_['isNil'](_0x40bc3e[_0x04e2('0x12')])?_0x40bc3e['calleridnum']:_0x40bc3e[_0x04e2('0x26')];if(_['isNil'](_0x40bc3e['routeId'])){_0x391bc2[_0x04e2('0x27')]=_0x40bc3e[_0x04e2('0x28')]&&_0x40bc3e['calleridname']!==''?_0x40bc3e['calleridname']:'Unknown';}else{_0x391bc2[_0x04e2('0x27')]=_0x40bc3e[_0x04e2('0x29')]&&_0x40bc3e[_0x04e2('0x29')]!==_0x04e2('0x2a')?_0x40bc3e[_0x04e2('0x29')]:_0x04e2('0x2b');}return BPromise[_0x04e2('0x1b')]()[_0x04e2('0x1c')](cmContactRpc[_0x04e2('0x2c')](_0x391bc2))[_0x04e2('0x1c')](function(_0xf7ce4){_0x19ddde=_0xf7ce4;_0x5424b8['push'](_0xf7ce4);if(_0x19ddde){logger['info'](_0x04e2('0x2d'),_0x40bc3e[_0x04e2('0x22')],_0x522b1d['id'],_0x19ddde['id']);}return;});}else{logger[_0x04e2('0x8')](_0x04e2('0x2e'),_0x40bc3e[_0x04e2('0x22')],_0x522b1d['id']);_0x391bc2[_0x4c576c]=_['isNil'](_0x40bc3e['routeId'])?_0x40bc3e[_0x04e2('0x13')]:_0x40bc3e['destcalleridnum'];if(_[_0x04e2('0x2f')](_0x40bc3e[_0x04e2('0x12')])){_0x391bc2[_0x04e2('0x27')]=_0x40bc3e[_0x04e2('0x28')]&&_0x40bc3e[_0x04e2('0x28')]!==''?_0x40bc3e[_0x04e2('0x28')]:_0x04e2('0x2b');}else{_0x391bc2['firstName']=_0x40bc3e[_0x04e2('0x29')]&&_0x40bc3e['destcalleridname']!==''?_0x40bc3e[_0x04e2('0x29')]:_0x04e2('0x2b');}_0x19ddde=_0x391bc2;_0x5424b8[_0x04e2('0x30')](_0x391bc2);return;}}})[_0x04e2('0x1c')](function(){if(_0x6e7a88){emit(_0x40bc3e[_0x04e2('0x22')],_0x522b1d,util[_0x04e2('0x31')](_0x04e2('0x32'),_0x6e7a88[_0x04e2('0x33')]),util[_0x04e2('0x31')](_0x04e2('0x34'),_0x56c604['action'][_0x04e2('0x35')]()),{'evt':_['merge'](_0x40bc3e,{'autoCreate':_0x54131b}),'contact':_0x19ddde===undefined?{}:_0x19ddde,'contacts':_0x5424b8[_0x04e2('0x1f')]===0x0?undefined:_0x5424b8});}});}; \ No newline at end of file +var _0xaf96=['localhost','socket.io-emitter','info','[CM][%s][%s]','stringify','exec','data1','data2','xmd-contactid','ListId','data3','split','phone','routeId','lastName','mobile','fax','createdAt','scheduledAt','updatedAt','resolve','then','getContacts','isEmpty','length','uniqueid','map','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','isNil','destcalleridnum','firstName','calleridname','','Unknown','destcalleridname','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','calleridnum','user:%s','name','format','trigger:%s','toLowerCase','lodash','ioredis','util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults'];(function(_0x4291f1,_0x2dbc88){var _0x44dba8=function(_0x504505){while(--_0x504505){_0x4291f1['push'](_0x4291f1['shift']());}};_0x44dba8(++_0x2dbc88);}(_0xaf96,0x178));var _0x6af9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaf96[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6af9('0x0'));var BPromise=require('bluebird');var Redis=require(_0x6af9('0x1'));var util=require(_0x6af9('0x2'));var config=require(_0x6af9('0x3'));var logger=require(_0x6af9('0x4'))(_0x6af9('0x5'));var cmContactRpc=require(_0x6af9('0x6'));config[_0x6af9('0x7')]=_[_0x6af9('0x8')](config['redis'],{'host':_0x6af9('0x9'),'port':0x18eb});var io=require(_0x6af9('0xa'))(new Redis(config['redis']));function emit(_0x1af925,_0x5e547c,_0x2fd443,_0x1add70,_0x11bf20){logger[_0x6af9('0xb')](_0x6af9('0xc'),_0x1af925,_0x5e547c['id'],_0x2fd443,_0x1add70,JSON[_0x6af9('0xd')](_0x11bf20));io['to'](_0x2fd443)['emit'](_0x1add70,_0x11bf20);}exports[_0x6af9('0xe')]=function(_0x94ce8,_0x1a4302,_0x12708a,_0xd4f6d9){var _0x25135a,_0x4c03ff;var _0xf719cf={};var _0x34266d=Number(_0x12708a[_0x6af9('0xf')]);var _0x56656d=_0x12708a['data2']?Boolean(Number(_0x12708a[_0x6af9('0x10')])):![];var _0x4c79a4;if(_0xd4f6d9[_0x6af9('0x11')]){_0xf719cf['id']=_0xd4f6d9[_0x6af9('0x11')];}if(!_0xf719cf['id']){_0xf719cf[_0x6af9('0x12')]=_0x34266d;_0x4c79a4=_0x12708a['data3']&&_0x12708a[_0x6af9('0x13')]!=='0'?_0x12708a[_0x6af9('0x13')][_0x6af9('0x14')](','):[_0x6af9('0x15')];_0xf719cf['$or']=_['map'](_0x4c79a4,function(_0x44267c){var _0xbd2616={};_0xbd2616[_0x44267c]=_0xd4f6d9[_0x6af9('0x16')]?_0xd4f6d9['destcalleridnum']:_0xd4f6d9['calleridnum'];return _0xbd2616;});}var _0x51db12=['id','firstName',_0x6af9('0x17'),_0x6af9('0x15'),_0x6af9('0x18'),_0x6af9('0x19'),'ListId',_0x6af9('0x1a'),_0x6af9('0x1b'),_0x6af9('0x1c')];var _0x10b828=_['union'](_0x51db12,_0x4c79a4);BPromise[_0x6af9('0x1d')]()[_0x6af9('0x1e')](cmContactRpc[_0x6af9('0x1f')]({'attributes':_0x10b828,'where':_0xf719cf}))['then'](function(_0x7ad7fb){_0x4c03ff=_0x7ad7fb;if(!_[_0x6af9('0x20')](_0x4c03ff)){if(_0x4c03ff[_0x6af9('0x21')]===0x1){_0x25135a=_0x4c03ff[0x0];logger['info']('[CM][%s][%s]\x20Contact\x20found:%s',_0xd4f6d9[_0x6af9('0x22')],_0x1a4302['id'],_0x25135a['id']);}else{logger[_0x6af9('0xb')]('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0xd4f6d9['uniqueid'],_0x1a4302['id'],_[_0x6af9('0x23')](_0x4c03ff,'id')[_0x6af9('0x24')](','));}return;}else{logger[_0x6af9('0xb')](_0x6af9('0x25'),_0xd4f6d9['uniqueid'],_0x1a4302['id']);var _0x27a4d8={'ListId':_0x34266d};var _0x323f52=_0x12708a['data4']&&_0x12708a[_0x6af9('0x26')]!=='0'?_0x12708a[_0x6af9('0x26')]:_0x6af9('0x15');if(_0x56656d){logger[_0x6af9('0xb')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0xd4f6d9[_0x6af9('0x22')],_0x1a4302['id']);_0x27a4d8[_0x323f52]=_[_0x6af9('0x27')](_0xd4f6d9[_0x6af9('0x16')])?_0xd4f6d9['calleridnum']:_0xd4f6d9[_0x6af9('0x28')];if(_['isNil'](_0xd4f6d9['routeId'])){_0x27a4d8[_0x6af9('0x29')]=_0xd4f6d9['calleridname']&&_0xd4f6d9[_0x6af9('0x2a')]!==_0x6af9('0x2b')?_0xd4f6d9[_0x6af9('0x2a')]:_0x6af9('0x2c');}else{_0x27a4d8[_0x6af9('0x29')]=_0xd4f6d9[_0x6af9('0x2d')]&&_0xd4f6d9[_0x6af9('0x2d')]!==_0x6af9('0x2b')?_0xd4f6d9[_0x6af9('0x2d')]:_0x6af9('0x2c');}return BPromise[_0x6af9('0x1d')]()[_0x6af9('0x1e')](cmContactRpc['createContact'](_0x27a4d8))[_0x6af9('0x1e')](function(_0x5310e2){_0x25135a=_0x5310e2;_0x4c03ff[_0x6af9('0x2e')](_0x5310e2);if(_0x25135a){logger[_0x6af9('0xb')](_0x6af9('0x2f'),_0xd4f6d9['uniqueid'],_0x1a4302['id'],_0x25135a['id']);}return;});}else{logger[_0x6af9('0xb')](_0x6af9('0x30'),_0xd4f6d9['uniqueid'],_0x1a4302['id']);_0x27a4d8[_0x323f52]=_[_0x6af9('0x27')](_0xd4f6d9[_0x6af9('0x16')])?_0xd4f6d9[_0x6af9('0x31')]:_0xd4f6d9[_0x6af9('0x28')];if(_['isNil'](_0xd4f6d9[_0x6af9('0x16')])){_0x27a4d8['firstName']=_0xd4f6d9['calleridname']&&_0xd4f6d9[_0x6af9('0x2a')]!==_0x6af9('0x2b')?_0xd4f6d9[_0x6af9('0x2a')]:_0x6af9('0x2c');}else{_0x27a4d8['firstName']=_0xd4f6d9[_0x6af9('0x2d')]&&_0xd4f6d9['destcalleridname']!==''?_0xd4f6d9[_0x6af9('0x2d')]:_0x6af9('0x2c');}_0x25135a=_0x27a4d8;_0x4c03ff[_0x6af9('0x2e')](_0x27a4d8);return;}}})[_0x6af9('0x1e')](function(){if(_0x94ce8){emit(_0xd4f6d9['uniqueid'],_0x1a4302,util['format'](_0x6af9('0x32'),_0x94ce8[_0x6af9('0x33')]),util[_0x6af9('0x34')](_0x6af9('0x35'),_0x12708a['action'][_0x6af9('0x36')]()),{'evt':_['merge'](_0xd4f6d9,{'autoCreate':_0x56656d}),'contact':_0x25135a===undefined?{}:_0x25135a,'contacts':_0x4c03ff[_0x6af9('0x21')]===0x0?undefined:_0x4c03ff});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 5fac6d0..0103c3c 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 _0x8378=['voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','syncCustomEvent','custom:agentconnect','bind','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:amd','custom:dialbegin','custom:dialconnect','syncAgentDial','custom:closedinteraction','custom:incomingmessage','custom:outgoingmessage','prototype','emit','info','stringify','clone','interface','hasOwnProperty','status','checkTrigger','merge','variables','Actions','length','action','toLowerCase','contactmanager','motionbar','browser','html','data2','render','template\x20not\x20found','uri','buildUri','isNil','data3','data4','uriLocation','windowWidth','data5','windowHeight','data6','600','format','name','trigger:%s:%s','data1','jscripty','user:%s','trigger:%s','exec','integration','queue','routeId','urlforward','script','parse','query','search','replace','AllConditions','checkConditions','channel','some','account','chat','ChatWebsiteId','operator','value','AccountId','upperFirst','interaction','event','agent','membername','lastevent','util','lodash','url','mustache','./urlforward','./script','../../../config/environment','../ami','defaults','localhost','socket.io-emitter','popup','winapp','triggers','agents','voiceQueues','templates'];(function(_0x2c5c7a,_0x47a954){var _0x563cdf=function(_0x22195d){while(--_0x22195d){_0x2c5c7a['push'](_0x2c5c7a['shift']());}};_0x563cdf(++_0x47a954);}(_0x8378,0x1b3));var _0x8837=function(_0x59332a,_0x4b59a6){_0x59332a=_0x59332a-0x0;var _0xc564ed=_0x8378[_0x59332a];return _0xc564ed;};'use strict';var util=require(_0x8837('0x0'));var _=require(_0x8837('0x1'));var url=require(_0x8837('0x2'));var Mustache=require(_0x8837('0x3'));var Redis=require('ioredis');var urlforward=require(_0x8837('0x4'));var integration=require('./integration');var cmContact=require('./cmContact');var script=require(_0x8837('0x5'));var config=require(_0x8837('0x6'));var logger=require('../../../config/logger')('trigger');var ami=require(_0x8837('0x7'));config['redis']=_[_0x8837('0x8')](config['redis'],{'host':_0x8837('0x9'),'port':0x18eb});var io=require(_0x8837('0xa'))(new Redis(config['redis']));var operators={'equals':function(_0x5d1890,_0x35279b){return _0x5d1890==_0x35279b;},'not_equals':function(_0x166933,_0x50905a){return _0x166933!=_0x50905a;}};var barAndWebActions=[_0x8837('0xb'),_0x8837('0x2'),_0x8837('0xc')];function Trigger(_0x311836){this[_0x8837('0xd')]=_0x311836[_0x8837('0xd')];this['agents']=_0x311836[_0x8837('0xe')];this[_0x8837('0xf')]=_0x311836['voiceQueues'];this[_0x8837('0x10')]=_0x311836[_0x8837('0x10')];this[_0x8837('0x11')]=_0x311836[_0x8837('0x11')];this['zendeskAccounts']=_0x311836[_0x8837('0x12')];this[_0x8837('0x13')]=_0x311836[_0x8837('0x13')];this[_0x8837('0x14')]=_0x311836[_0x8837('0x14')];this[_0x8837('0x15')]=_0x311836[_0x8837('0x15')];this[_0x8837('0x16')]=_0x311836[_0x8837('0x16')];this[_0x8837('0x17')]=_0x311836[_0x8837('0x17')];this[_0x8837('0x18')]=_0x311836[_0x8837('0x18')];this['servicenowAccounts']=_0x311836[_0x8837('0x19')];this['dynamics365Accounts']=_0x311836[_0x8837('0x1a')];this['freshsalesAccounts']=_0x311836[_0x8837('0x1b')];this[_0x8837('0x1c')]={'zendesk':this[_0x8837('0x12')],'salesforce':this[_0x8837('0x14')],'freshdesk':this['freshdeskAccounts'],'sugarcrm':this[_0x8837('0x15')],'zoho':this[_0x8837('0x16')],'desk':this[_0x8837('0x17')],'vtiger':this[_0x8837('0x18')],'dynamics365':this[_0x8837('0x1a')],'freshsales':this[_0x8837('0x1b')],'servicenow':this[_0x8837('0x19')]};ami['on'](_0x8837('0x1d'),this[_0x8837('0x1e')]['bind'](this));ami['on'](_0x8837('0x1f'),this[_0x8837('0x1e')][_0x8837('0x20')](this));ami['on'](_0x8837('0x21'),this[_0x8837('0x1e')][_0x8837('0x20')](this));ami['on'](_0x8837('0x22'),this[_0x8837('0x1e')][_0x8837('0x20')](this));ami['on'](_0x8837('0x23'),this['syncCustomEvent'][_0x8837('0x20')](this));ami['on'](_0x8837('0x24'),this['syncCustomEvent'][_0x8837('0x20')](this));ami['on'](_0x8837('0x25'),this[_0x8837('0x1e')]['bind'](this));ami['on'](_0x8837('0x26'),this['syncCustomEvent']['bind'](this));ami['on'](_0x8837('0x27'),this['syncCustomEvent'][_0x8837('0x20')](this));ami['on'](_0x8837('0x28'),this[_0x8837('0x1e')][_0x8837('0x20')](this));ami['on']('custom:queuecallerabandon',this['syncCustomEvent'][_0x8837('0x20')](this));ami['on']('custom:timeout',this[_0x8837('0x1e')][_0x8837('0x20')](this));ami['on'](_0x8837('0x29'),this['syncAgentDial']['bind'](this));ami['on'](_0x8837('0x2a'),this[_0x8837('0x2b')]['bind'](this));ami['on']('custom:dialend',this[_0x8837('0x2b')]['bind'](this));ami['on']('custom:newinteraction',this[_0x8837('0x1e')][_0x8837('0x20')](this));ami['on'](_0x8837('0x2c'),this[_0x8837('0x1e')][_0x8837('0x20')](this));ami['on'](_0x8837('0x2d'),this[_0x8837('0x1e')][_0x8837('0x20')](this));ami['on'](_0x8837('0x2e'),this[_0x8837('0x1e')][_0x8837('0x20')](this));ami['on']('custom:acceptmessage',this[_0x8837('0x1e')]['bind'](this));ami['on']('custom:rejectmessage',this['syncCustomEvent'][_0x8837('0x20')](this));}Trigger[_0x8837('0x2f')][_0x8837('0x30')]=function(_0x28cfbe,_0x7dd161,_0x139fdb){logger[_0x8837('0x31')](_0x28cfbe,_0x7dd161,JSON[_0x8837('0x32')](_0x139fdb));io['to'](_0x28cfbe)[_0x8837('0x30')](_0x7dd161,_0x139fdb);};Trigger[_0x8837('0x2f')][_0x8837('0x1e')]=function(_0x166e19){var _0x3a0ef5=_[_0x8837('0x33')](_0x166e19);this['checkTriggers'](_0x3a0ef5);};Trigger['prototype'][_0x8837('0x2b')]=function(_0x84c1a9){if(this[_0x8837('0xe')][_0x84c1a9[_0x8837('0x34')]]){this[_0x8837('0x1e')](_0x84c1a9);}};Trigger[_0x8837('0x2f')]['checkTriggers']=function(_0x2df2e7){var _0x9f69b7;for(var _0x121741 in this[_0x8837('0xd')]){if(this[_0x8837('0xd')][_0x8837('0x35')](_0x121741)){if(this[_0x8837('0xd')][_0x121741][_0x8837('0x36')]){_0x9f69b7=this[_0x8837('0x37')](this[_0x8837('0xd')][_0x121741],_0x2df2e7);if(_0x9f69b7){_[_0x8837('0x38')](_0x2df2e7,_0x2df2e7[_0x8837('0x39')]);for(var _0x268959=0x0,_0x59a692,_0x8b6468,_0x50a5df;_0x2689590x0){_0x3565cf=_['map'](_0x2dd5f,_0x40dc8f);}return _0x3565cf;}function getCustomFields(_0x33a1a5,_0x4690a6){var _0x45b675=[];var _0x50f9f5={'custom_fields':{}};if(_0x33a1a5[_0x43e7('0x28')]>0x0){_[_0x43e7('0x29')](_0x33a1a5,function(_0x2b85a5){if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5[_0x43e7('0x2d')])&&_0x2b85a5[_0x43e7('0x2e')]&&!_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x2b85a5[_0x43e7('0x2e')]['toLowerCase']()]=_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x21')]();}else if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5['type'])&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x2b85a5['content']['toString']();}else if(_0x2b85a5['type']===_0x43e7('0x33')&&_0x2b85a5[_0x43e7('0x34')]&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x34')]]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5['idField']]=_0x4690a6[_0x2b85a5['variableName']]['toString']());}else if(_0x2b85a5['type']==='customVariable'&&_0x2b85a5['Variable']&&_0x2b85a5['Variable'][_0x43e7('0x35')]&&_0x2b85a5['idField']&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x36')][_0x43e7('0x35')][_0x43e7('0x37')]()]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x4690a6[_0x2b85a5[_0x43e7('0x36')]['name']['toLowerCase']()]['toString']());}});}if(_0x50f9f5[_0x43e7('0x38')]){_0x50f9f5[_0x43e7('0x38')]=Number(_0x50f9f5[_0x43e7('0x38')]);}return _0x50f9f5;}function getTicket(_0x16cdba,_0x1b1440,_0x1ed538,_0x1d4589,_0x2ffd43){logger['info'](_0x43e7('0x39'));var _0x2b0ffe=_['merge']({'subject':intUtil[_0x43e7('0x3a')](_0x1d4589['Subjects'],_0x2ffd43,'\x20'),'type':_0x43e7('0x3b'),'status':_0x43e7('0x3c'),'labels':[_0x43e7('0x3d'),_0x43e7('0x3e'),_0x43e7('0x3f')][_0x43e7('0x40')](getTags(_0x1d4589['Tags'],'name')),'description':intUtil[_0x43e7('0x3a')](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a'),'_links':{'assigned_user':{'href':util[_0x43e7('0x16')](_0x43e7('0x42'),_0x1b1440['id']),'class':_0x43e7('0x43')}},'message':{'direction':'in','body':intUtil['getString'](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a')}},getCustomFields(_0x1d4589[_0x43e7('0x44')],_0x2ffd43));return request({'uri':util['format'](_0x43e7('0x45'),_0x16cdba['remoteUri'],_0x1ed538['id']),'method':_0x43e7('0x27'),'body':_0x2b0ffe});}exports['queue']=function(_0x3d81ae,_0x3b4235,_0x3a5807,_0x1c2c6b,_0x49b866,_0x47d6a1){var _0x103393,_0x40c509;_0x47d6a1[_0x43e7('0x14')]=intUtil[_0x43e7('0x46')](_0x47d6a1['remoteUri']);_0x47d6a1['serverUrl']=intUtil['stripTrailingSlash'](_0x47d6a1[_0x43e7('0x47')]);if(_0x49b866&&_0x49b866['monitor_format']){logger[_0x43e7('0xb')]('[QUEUE]','Recording\x20is\x20enabled!');_0x3b4235[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x47d6a1[_0x43e7('0x47')],_0x3b4235[_0x43e7('0x4a')],md5(_0x3b4235[_0x43e7('0x4a')]));}else{_0x3b4235['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x47d6a1);return getUser(_0x47d6a1,_0x1c2c6b[_0x43e7('0x4c')])[_0x43e7('0xe')](function(_0x1fd277){_0x103393=_0x1fd277;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x103393['id']);return getEndUser(_0x47d6a1,_0x3b4235['calleridname'],_0x3b4235['calleridnum']);})[_0x43e7('0xe')](function(_0x36a09e){_0x40c509=_0x36a09e;logger[_0x43e7('0xb')]('The\x20Enduser\x20ID\x20is:',_0x40c509['id']);return getTicket(_0x47d6a1,_0x103393,_0x40c509,_0x3a5807,_0x3b4235);})['then'](function(_0x56489b){if(_0x56489b){logger[_0x43e7('0xb')](_0x43e7('0x4e'));logger['info'](_0x43e7('0x4f'),_0x56489b['id']);switch(_0x47d6a1[_0x43e7('0x2d')]){case _0x43e7('0x50'):logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0x43e7('0x51'),_0x1c2c6b[_0x43e7('0x35')]),'trigger:desk:display',{'recordId':_0x56489b['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')](_0x43e7('0x53'),_0x43e7('0x54'));emit(util['format'](_0x43e7('0x51'),_0x1c2c6b['name']),'trigger:browser:url',{'uri':util[_0x43e7('0x16')](_0x43e7('0x55'),_0x56489b['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x53'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x1cd87c){console[_0x43e7('0x56')](_0x1cd87c);logger[_0x43e7('0x56')](_0x43e7('0x53'),JSON['stringify'](_0x1cd87c));});};exports[_0x43e7('0x59')]=function(_0x46c910,_0x499c03,_0x39e3ca,_0x4e6f6d,_0x35b799,_0x520857,_0x34e2ec){var _0x1f561f,_0xfe13fa;_0x520857['remoteUri']=intUtil['stripTrailingSlash'](_0x520857[_0x43e7('0x14')]);_0x520857[_0x43e7('0x47')]=intUtil[_0x43e7('0x46')](_0x520857[_0x43e7('0x47')]);if(_0x34e2ec&&_0x34e2ec[_0x43e7('0x5a')]&&_0x34e2ec[_0x43e7('0x5a')]!==_0x43e7('0x5b')){logger[_0x43e7('0xb')](_0x43e7('0x5c'),_0x43e7('0x5d'));_0x499c03[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x520857[_0x43e7('0x47')],_0x499c03['uniqueid'],md5(_0x499c03[_0x43e7('0x4a')]));}headers[_0x43e7('0x4b')]=getAuth(_0x520857);return getUser(_0x520857,_0x4e6f6d[_0x43e7('0x4c')])['then'](function(_0x5d63c6){_0x1f561f=_0x5d63c6;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x1f561f['id']);return getEndUser(_0x520857,_0x499c03['destcalleridname'],_0x499c03[_0x43e7('0x5e')]);})['then'](function(_0x49a6ce){_0xfe13fa=_0x49a6ce;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xfe13fa['id']);return getTicket(_0x520857,_0x1f561f,_0xfe13fa,_0x39e3ca,_0x499c03);})[_0x43e7('0xe')](function(_0x40155c){if(_0x40155c){logger[_0x43e7('0xb')]('Ticket\x20created!');logger[_0x43e7('0xb')](_0x43e7('0x4f'),_0x40155c['id']);switch(_0x520857['type']){case _0x43e7('0x50'):logger[_0x43e7('0xb')](_0x43e7('0x53'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format']('user:%s',_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x60'),{'recordId':_0x40155c['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x43e7('0x16')](_0x43e7('0x51'),_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x61'),{'uri':util['format'](_0x43e7('0x62'),_0x520857[_0x43e7('0x14')],_0x40155c['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x5c'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x4665db){logger[_0x43e7('0x56')](_0x43e7('0x5c'),JSON[_0x43e7('0x63')](_0x4665db));});};exports[_0x43e7('0x64')]=function(_0x57fdfe,_0x5f3824,_0x2b0711,_0x58a3a8,_0x501616,_0x50edb2){var _0xb3e981,_0xe666b0;_0x50edb2['remoteUri']=intUtil[_0x43e7('0x46')](_0x50edb2[_0x43e7('0x14')]);_0x50edb2[_0x43e7('0x47')]=intUtil['stripTrailingSlash'](_0x50edb2[_0x43e7('0x47')]);if(_0x501616&&_0x501616[_0x43e7('0x65')]){logger[_0x43e7('0xb')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',_0x43e7('0x5d'));_0x5f3824[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x50edb2[_0x43e7('0x47')],_0x5f3824[_0x43e7('0x4a')],md5(_0x5f3824['uniqueid']));}else{_0x5f3824['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x50edb2);return getUser(_0x50edb2)['then'](function(_0x5cb26e){_0xb3e981=_0x5cb26e;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0xb3e981['id']);return getEndUser(_0x50edb2,_0x5f3824['calleridname'],_0x5f3824[_0x43e7('0x68')]);})[_0x43e7('0xe')](function(_0x1e2fed){_0xe666b0=_0x1e2fed;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xe666b0['id']);return getTicket(_0x50edb2,_0xb3e981,_0xe666b0,_0x2b0711,_0x5f3824);})[_0x43e7('0xe')](function(_0x398a78){if(_0x398a78){logger['info'](_0x43e7('0x4e'));logger[_0x43e7('0xb')]('The\x20Ticket\x20ID\x20is:',_0x398a78['id']);}})[_0x43e7('0x58')](function(_0x5c2c5f){logger[_0x43e7('0x56')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',JSON[_0x43e7('0x63')](_0x5c2c5f));});}; \ No newline at end of file +var _0x326f=['catch','stringify','unmanaged','lastevent','toUpperCase','lodash','util','ioredis','./util','../../../../config/environment','../../../../config/logger','desk','redis','defaults','localhost','validateEmail','info','Getting\x20agent\x20with\x20email','%s/users','then','total_entries','_embedded','entries','Agent\x20found!','format','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/users/me','remoteUri','debug','[HTTP]','GET','authType','basic','password','%s/token:%s','Basic\x20%s','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','work','map','length','includes','string','picklist','type','nameField','customField','toLowerCase','content','idField','custom_fields','toString','variable','variableName','customVariable','Variable','name','priority','Creating\x20new\x20ticket...','getString','Subjects','xCALLY','concat','Descriptions','user','Fields','%s/customers/%d/cases','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','error','Desk\x20account\x20type\x20not\x20recognized','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','integrationTab','%s/agent/tickets/%s'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x326f,0xd1));var _0xf326=function(_0xa32a70,_0x4153dd){_0xa32a70=_0xa32a70-0x0;var _0x3fafb1=_0x326f[_0xa32a70];return _0x3fafb1;};'use strict';var _=require(_0xf326('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require(_0xf326('0x1'));var Redis=require(_0xf326('0x2'));var intUtil=require(_0xf326('0x3'));var config=require(_0xf326('0x4'));var logger=require(_0xf326('0x5'))(_0xf326('0x6'));config[_0xf326('0x7')]=_[_0xf326('0x8')](config[_0xf326('0x7')],{'host':_0xf326('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf326('0x7')]));function emit(_0x3851eb,_0x165f95,_0x1e7b8a){io['to'](_0x3851eb)['emit'](_0x165f95,_0x1e7b8a);}var headers={'Content-Type':'application/json','Accept':'application/json'};function getUser(_0x3bacf2,_0x1fc80e){if(intUtil[_0xf326('0xa')](_0x1fc80e)===!![]){logger[_0xf326('0xb')](_0xf326('0xc'),_0x1fc80e);return request({'uri':util['format'](_0xf326('0xd'),_0x3bacf2['remoteUri'])})[_0xf326('0xe')](function(_0x4aaf3a){if(_0x4aaf3a[_0xf326('0xf')]){return _['find'](_0x4aaf3a[_0xf326('0x10')][_0xf326('0x11')],{'email':_0x1fc80e});}})['then'](function(_0x342fe5){if(_0x342fe5){logger[_0xf326('0xb')](_0xf326('0x12'));return _0x342fe5;}else{logger[_0xf326('0xb')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xf326('0x13')]('%s/users/me',_0x3bacf2['remoteUri'])});}});}else{logger[_0xf326('0xb')](_0xf326('0x14'));return request({'uri':util[_0xf326('0x13')](_0xf326('0x15'),_0x3bacf2[_0xf326('0x16')])});}}function request(_0x287a2a){logger[_0xf326('0x17')](_0xf326('0x18'),JSON['stringify'](_0x287a2a));return rp(_[_0xf326('0x8')](_0x287a2a,{'method':_0xf326('0x19'),'headers':headers,'json':!![]}));}function getAuth(_0x18bee3){var _0x31ffb9;if(_0x18bee3[_0xf326('0x1a')]===_0xf326('0x1b')){_0x31ffb9=util['format']('%s:%s',_0x18bee3['username'],_0x18bee3[_0xf326('0x1c')]);}else if(_0x18bee3[_0xf326('0x1a')]==='token'){_0x31ffb9=util['format'](_0xf326('0x1d'),_0x18bee3['username'],_0x18bee3['token']);}return util[_0xf326('0x13')](_0xf326('0x1e'),new Buffer(_0x31ffb9)['toString']('base64'));}function getEndUser(_0x19b8ba,_0xb1efcf,_0x5f21a2){logger[_0xf326('0xb')](_0xf326('0x1f'),_0x5f21a2);return request({'uri':util[_0xf326('0x13')](_0xf326('0x20'),_0x19b8ba[_0xf326('0x16')]),'qs':{'phone':_0x5f21a2}})[_0xf326('0xe')](function(_0x5ce532){if(_0x5ce532['total_entries']){logger['info'](_0xf326('0x21'));return _0x5ce532[_0xf326('0x10')][_0xf326('0x11')][0x0];}else{logger[_0xf326('0xb')](_0xf326('0x22'));return request({'uri':util[_0xf326('0x13')]('%s/customers',_0x19b8ba[_0xf326('0x16')]),'method':_0xf326('0x23'),'body':{'first_name':_0xb1efcf,'title':_0xb1efcf,'phone_numbers':[{'type':_0xf326('0x24'),'value':_0x5f21a2}]}});}});}function getTags(_0x581531,_0x1617d2){var _0x55ad0f=[];if(_0x581531&&_0x581531['length']>0x0){_0x55ad0f=_[_0xf326('0x25')](_0x581531,_0x1617d2);}return _0x55ad0f;}function getCustomFields(_0x1ae23a,_0x2fa28e){var _0x5dbe63=[];var _0xc115d9={'custom_fields':{}};if(_0x1ae23a[_0xf326('0x26')]>0x0){_['forEach'](_0x1ae23a,function(_0x225776){if(_[_0xf326('0x27')]([_0xf326('0x28'),_0xf326('0x29')],_0x225776[_0xf326('0x2a')])&&_0x225776[_0xf326('0x2b')]&&!_0x225776[_0xf326('0x2c')]){_0xc115d9[_0x225776[_0xf326('0x2b')][_0xf326('0x2d')]()]=_0x225776[_0xf326('0x2e')]['toString']();}else if(_[_0xf326('0x27')]([_0xf326('0x28'),_0xf326('0x29')],_0x225776['type'])&&_0x225776[_0xf326('0x2f')]&&_0x225776[_0xf326('0x2c')]){_0xc115d9[_0xf326('0x30')][_0x225776['idField']]=_0x225776['content'][_0xf326('0x31')]();}else if(_0x225776[_0xf326('0x2a')]===_0xf326('0x32')&&_0x225776[_0xf326('0x33')]&&_0x225776[_0xf326('0x2f')]&&_0x225776[_0xf326('0x2c')]){_0x2fa28e[_0x225776[_0xf326('0x33')]]&&(_0xc115d9[_0xf326('0x30')][_0x225776['idField']]=_0x2fa28e[_0x225776[_0xf326('0x33')]][_0xf326('0x31')]());}else if(_0x225776['type']===_0xf326('0x34')&&_0x225776['Variable']&&_0x225776[_0xf326('0x35')]['name']&&_0x225776['idField']&&_0x225776[_0xf326('0x2c')]){_0x2fa28e[_0x225776['Variable'][_0xf326('0x36')]['toLowerCase']()]&&(_0xc115d9[_0xf326('0x30')][_0x225776[_0xf326('0x2f')]]=_0x2fa28e[_0x225776[_0xf326('0x35')]['name'][_0xf326('0x2d')]()][_0xf326('0x31')]());}});}if(_0xc115d9['priority']){_0xc115d9[_0xf326('0x37')]=Number(_0xc115d9[_0xf326('0x37')]);}return _0xc115d9;}function getTicket(_0x40fa7a,_0xaf65e0,_0x51076c,_0x2c4416,_0xb1ef35){logger[_0xf326('0xb')](_0xf326('0x38'));var _0x1d88ed=_['merge']({'subject':intUtil[_0xf326('0x39')](_0x2c4416[_0xf326('0x3a')],_0xb1ef35,'\x20'),'type':'phone','status':'new','labels':[_0xf326('0x3b'),'Motion','CTI'][_0xf326('0x3c')](getTags(_0x2c4416['Tags'],_0xf326('0x36'))),'description':intUtil[_0xf326('0x39')](_0x2c4416[_0xf326('0x3d')],_0xb1ef35,'\x0a'),'_links':{'assigned_user':{'href':util[_0xf326('0x13')]('/api/v2/users/%d',_0xaf65e0['id']),'class':_0xf326('0x3e')}},'message':{'direction':'in','body':intUtil[_0xf326('0x39')](_0x2c4416[_0xf326('0x3d')],_0xb1ef35,'\x0a')}},getCustomFields(_0x2c4416[_0xf326('0x3f')],_0xb1ef35));return request({'uri':util[_0xf326('0x13')](_0xf326('0x40'),_0x40fa7a[_0xf326('0x16')],_0x51076c['id']),'method':_0xf326('0x23'),'body':_0x1d88ed});}exports[_0xf326('0x41')]=function(_0x1227d3,_0x361776,_0x2bab13,_0x50d63f,_0x1b6126,_0x1637dc){var _0x2ed1a7,_0x270288;_0x1637dc[_0xf326('0x16')]=intUtil[_0xf326('0x42')](_0x1637dc['remoteUri']);_0x1637dc[_0xf326('0x43')]=intUtil[_0xf326('0x42')](_0x1637dc['serverUrl']);if(_0x1b6126&&_0x1b6126[_0xf326('0x44')]){logger[_0xf326('0xb')](_0xf326('0x45'),_0xf326('0x46'));_0x361776[_0xf326('0x47')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1637dc[_0xf326('0x43')],_0x361776[_0xf326('0x48')],md5(_0x361776['uniqueid']));}else{_0x361776['recordingURL']='';}headers[_0xf326('0x49')]=getAuth(_0x1637dc);return getUser(_0x1637dc,_0x50d63f[_0xf326('0x4a')])[_0xf326('0xe')](function(_0x5b3705){_0x2ed1a7=_0x5b3705;logger[_0xf326('0xb')](_0xf326('0x4b'),_0x2ed1a7['id']);return getEndUser(_0x1637dc,_0x361776[_0xf326('0x4c')],_0x361776[_0xf326('0x4d')]);})[_0xf326('0xe')](function(_0x2d9bba){_0x270288=_0x2d9bba;logger[_0xf326('0xb')](_0xf326('0x4e'),_0x270288['id']);return getTicket(_0x1637dc,_0x2ed1a7,_0x270288,_0x2bab13,_0x361776);})[_0xf326('0xe')](function(_0x27ced1){if(_0x27ced1){logger[_0xf326('0xb')](_0xf326('0x4f'));logger[_0xf326('0xb')](_0xf326('0x50'),_0x27ced1['id']);switch(_0x1637dc[_0xf326('0x2a')]){case'integrationTab':logger[_0xf326('0xb')](_0xf326('0x45'),_0xf326('0x51'));emit(util[_0xf326('0x13')]('user:%s',_0x50d63f[_0xf326('0x36')]),_0xf326('0x52'),{'recordId':_0x27ced1['id']});break;case _0xf326('0x53'):logger[_0xf326('0xb')]('[QUEUE]',_0xf326('0x54'));emit(util[_0xf326('0x13')](_0xf326('0x55'),_0x50d63f[_0xf326('0x36')]),_0xf326('0x56'),{'uri':util['format']('https://xcally.desk.com/web/agent/case/%d',_0x27ced1['id'])});break;default:logger[_0xf326('0x57')](_0xf326('0x45'),_0xf326('0x58'));}}})['catch'](function(_0x102fba){console[_0xf326('0x57')](_0x102fba);logger[_0xf326('0x57')]('[QUEUE]',JSON['stringify'](_0x102fba));});};exports[_0xf326('0x59')]=function(_0x5b4832,_0x1cf58f,_0x554277,_0x458e5f,_0x7ee57,_0x28c959,_0x25e091){var _0x212594,_0x35d3c8;_0x28c959[_0xf326('0x16')]=intUtil['stripTrailingSlash'](_0x28c959[_0xf326('0x16')]);_0x28c959[_0xf326('0x43')]=intUtil[_0xf326('0x42')](_0x28c959['serverUrl']);if(_0x25e091&&_0x25e091[_0xf326('0x5a')]&&_0x25e091[_0xf326('0x5a')]!==_0xf326('0x5b')){logger[_0xf326('0xb')](_0xf326('0x5c'),'Recording\x20is\x20enabled!');_0x1cf58f[_0xf326('0x47')]=util[_0xf326('0x13')](_0xf326('0x5d'),_0x28c959[_0xf326('0x43')],_0x1cf58f['uniqueid'],md5(_0x1cf58f[_0xf326('0x48')]));}headers[_0xf326('0x49')]=getAuth(_0x28c959);return getUser(_0x28c959,_0x458e5f[_0xf326('0x4a')])[_0xf326('0xe')](function(_0x4d3b9e){_0x212594=_0x4d3b9e;logger['info'](_0xf326('0x4b'),_0x212594['id']);return getEndUser(_0x28c959,_0x1cf58f[_0xf326('0x5e')],_0x1cf58f['destcalleridnum']);})[_0xf326('0xe')](function(_0x29de71){_0x35d3c8=_0x29de71;logger[_0xf326('0xb')](_0xf326('0x4e'),_0x35d3c8['id']);return getTicket(_0x28c959,_0x212594,_0x35d3c8,_0x554277,_0x1cf58f);})['then'](function(_0xb1c18c){if(_0xb1c18c){logger['info']('Ticket\x20created!');logger[_0xf326('0xb')]('The\x20Ticket\x20ID\x20is:',_0xb1c18c['id']);switch(_0x28c959[_0xf326('0x2a')]){case _0xf326('0x5f'):logger[_0xf326('0xb')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');emit(util[_0xf326('0x13')](_0xf326('0x55'),_0x458e5f[_0xf326('0x36')]),'trigger:desk:display',{'recordId':_0xb1c18c['id']});break;case _0xf326('0x53'):logger['info'](_0xf326('0x45'),_0xf326('0x54'));emit(util[_0xf326('0x13')](_0xf326('0x55'),_0x458e5f[_0xf326('0x36')]),_0xf326('0x56'),{'uri':util[_0xf326('0x13')](_0xf326('0x60'),_0x28c959[_0xf326('0x16')],_0xb1c18c['id'])});break;default:logger[_0xf326('0x57')](_0xf326('0x5c'),_0xf326('0x58'));}}})[_0xf326('0x61')](function(_0x4ca1b8){logger[_0xf326('0x57')]('[OUTBOUND]',JSON[_0xf326('0x62')](_0x4ca1b8));});};exports[_0xf326('0x63')]=function(_0x5e858d,_0x2b770c,_0x5283da,_0x3255b2,_0xd55246,_0x28f3cb){var _0x2d45c9,_0x31b6dd;_0x28f3cb['remoteUri']=intUtil['stripTrailingSlash'](_0x28f3cb[_0xf326('0x16')]);_0x28f3cb[_0xf326('0x43')]=intUtil[_0xf326('0x42')](_0x28f3cb[_0xf326('0x43')]);if(_0xd55246&&_0xd55246[_0xf326('0x44')]){logger['info']('['+_0x2b770c[_0xf326('0x64')][_0xf326('0x65')]()+']','Recording\x20is\x20enabled!');_0x2b770c['recordingURL']=util['format'](_0xf326('0x5d'),_0x28f3cb[_0xf326('0x43')],_0x2b770c[_0xf326('0x48')],md5(_0x2b770c[_0xf326('0x48')]));}else{_0x2b770c[_0xf326('0x47')]='';}headers[_0xf326('0x49')]=getAuth(_0x28f3cb);return getUser(_0x28f3cb)[_0xf326('0xe')](function(_0x4b9013){_0x2d45c9=_0x4b9013;logger[_0xf326('0xb')](_0xf326('0x4b'),_0x2d45c9['id']);return getEndUser(_0x28f3cb,_0x2b770c[_0xf326('0x4c')],_0x2b770c[_0xf326('0x4d')]);})['then'](function(_0x3717fe){_0x31b6dd=_0x3717fe;logger['info']('The\x20Enduser\x20ID\x20is:',_0x31b6dd['id']);return getTicket(_0x28f3cb,_0x2d45c9,_0x31b6dd,_0x5283da,_0x2b770c);})[_0xf326('0xe')](function(_0x540fa0){if(_0x540fa0){logger[_0xf326('0xb')](_0xf326('0x4f'));logger[_0xf326('0xb')](_0xf326('0x50'),_0x540fa0['id']);}})[_0xf326('0x61')](function(_0x541491){logger['error']('['+_0x2b770c['lastevent'][_0xf326('0x65')]()+']',JSON[_0xf326('0x62')](_0x541491));});}; \ 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 c36ac62..3117ed3 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 _0x9572=['indexOf','ticketType','incidents','getString','Subjects','Descriptions','/contacts(','Fields','phonecall','phonecalls','assign','callDirection','queue','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','stripTrailingSlash','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:','userEmail',']\x20The\x20%s\x20ID\x20is:\x20%s','ticketId','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','md5','ioredis','../../../../config/logger','dynamics365','redis','defaults','localhost','POST','remoteUri','username','password','clientSecret','then','catch','error',']\x20Wrong\x20credentials!','GET','Bearer\x20','value','isNil','validateEmail','email','length','internalemailaddress','info','toUpperCase',']\x20Agent\x20found\x20','systemuserid','userId','message','toLowerCase','outbound','destcalleridnum','calleridnum','/systemusers(','4.0','headers','odata-entityid','lastIndexOf','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','%2b','contactid','enduserId','forEach','includes','string','picklist','type','customField','substring'];(function(_0x134318,_0x28ce39){var _0xb8b64=function(_0x2561d9){while(--_0x2561d9){_0x134318['push'](_0x134318['shift']());}};_0xb8b64(++_0x28ce39);}(_0x9572,0x82));var _0x2957=function(_0x2d5724,_0x15bf66){_0x2d5724=_0x2d5724-0x0;var _0x1063d0=_0x9572[_0x2d5724];return _0x1063d0;};'use strict';var _=require(_0x2957('0x0'));var BPromise=require('bluebird');var rp=require(_0x2957('0x1'));var util=require(_0x2957('0x2'));var intUtil=require('./util');var md5=require(_0x2957('0x3'));var Redis=require(_0x2957('0x4'));var logger=require(_0x2957('0x5'))(_0x2957('0x6'));var config=require('../../../../config/environment');config[_0x2957('0x7')]=_[_0x2957('0x8')](config[_0x2957('0x7')],{'host':_0x2957('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x2957('0x7')]));function getAuthToken(_0x5055b9,_0x52c3a9,_0x102025){var _0x364561={'method':_0x2957('0xa'),'uri':_0x52c3a9,'form':{'client_id':_0x5055b9['clientId'],'resource':_0x5055b9[_0x2957('0xb')],'username':_0x5055b9[_0x2957('0xc')],'password':_0x5055b9[_0x2957('0xd')],'grant_type':_0x2957('0xd'),'client_secret':_0x5055b9[_0x2957('0xe')]},'json':!![]};return rp(_0x364561)[_0x2957('0xf')](function(_0x23b678){return _0x23b678['access_token'];})[_0x2957('0x10')](function(_0x295a20){logger[_0x2957('0x11')]('['+[_0x102025['toUpperCase']()]+_0x2957('0x12'));return _0x295a20['message'];});}function getUser(_0x1440a3,_0x22da1f,_0x2e7fa2,_0x4962d9,_0x2f0c12,_0x324126){return new BPromise(function(_0x102646,_0x197d92){return getAuthToken(_0x22da1f,_0x4962d9,_0x324126)[_0x2957('0xf')](function(_0xb08896){var _0x4cb4bf={'method':_0x2957('0x13'),'uri':_0x2f0c12+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0x2957('0x14')+_0xb08896,'OData-Version':'4.0'},'json':!![]};return rp(_0x4cb4bf);})[_0x2957('0xf')](function(_0x18c91a){var _0x28b7f3=_0x18c91a[_0x2957('0x15')];var _0x57452b=![];var _0x54c7a6=null;if(!_[_0x2957('0x16')](_0x2e7fa2)){if(intUtil[_0x2957('0x17')](_0x2e7fa2[_0x2957('0x18')])){_0x1440a3['userEmail']=_0x2e7fa2[_0x2957('0x18')];for(_0x54c7a6=0x0;_0x54c7a6<_0x28b7f3[_0x2957('0x19')];_0x54c7a6++){if(_0x28b7f3[_0x54c7a6][_0x2957('0x1a')]===_0x2e7fa2[_0x2957('0x18')]&&!_0x28b7f3[_0x54c7a6]['isdisabled']){_0x57452b=!![];logger[_0x2957('0x1b')]('['+[_0x324126[_0x2957('0x1c')]()]+_0x2957('0x1d')+_0x28b7f3[_0x54c7a6][_0x2957('0x1e')]+'!');_0x1440a3['userId']=_0x28b7f3[_0x54c7a6][_0x2957('0x1e')];}}}}if(!_0x57452b){logger[_0x2957('0x1b')]('['+[_0x324126[_0x2957('0x1c')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x1440a3['userEmail']=_0x22da1f['username'];for(_0x54c7a6=0x0;_0x54c7a6<_0x28b7f3[_0x2957('0x19')];_0x54c7a6++){if(_0x28b7f3[_0x54c7a6][_0x2957('0x1a')]===_0x22da1f[_0x2957('0xc')]){_0x1440a3[_0x2957('0x1f')]=_0x28b7f3[_0x54c7a6][_0x2957('0x1e')];}}}_0x102646(_0x1440a3);})[_0x2957('0x10')](function(_0x3065cc){_0x197d92(_0x3065cc[_0x2957('0x20')]);});});}function createEndUser(_0x4975f4,_0x334ac8,_0x6e36ec,_0x554ee6,_0x510342,_0x7fff15){return new BPromise(function(_0x58b963,_0x2affd9){return getAuthToken(_0x334ac8,_0x6e36ec,_0x7fff15)['then'](function(_0x28d592){var _0x59641b=_0x7fff15[_0x2957('0x21')]()===_0x2957('0x22')?_0x510342[_0x2957('0x23')]:_0x510342[_0x2957('0x24')];var _0x3d9b38={'method':_0x2957('0xa'),'uri':_0x554ee6+'contacts','body':{'telephone1':_0x59641b,'fullname':_0x59641b,'firstname':_0x59641b,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x2957('0x25')+_0x4975f4[_0x2957('0x1f')]+')'},'headers':{'Authorization':'Bearer\x20'+_0x28d592,'OData-Version':_0x2957('0x26')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x3d9b38);})[_0x2957('0xf')](function(_0x19f4d7){var _0x3ddeee=_0x19f4d7[_0x2957('0x27')][_0x2957('0x28')];var _0x554bb8=_0x3ddeee['substring'](_0x3ddeee[_0x2957('0x29')]('(')+0x1,_0x3ddeee[_0x2957('0x29')](')'));_0x4975f4['enduserId']=_0x554bb8;_0x58b963(_0x4975f4);})['catch'](function(_0x3f0fd6){_0x2affd9(_0x3f0fd6[_0x2957('0x20')]);});});}function getEndUser(_0x1c5025,_0x737b80,_0x1a2584,_0x24e21c,_0x4d8ac8,_0xbe20f9){return new BPromise(function(_0x2ef292,_0x1adc47){var _0x581d00=_0xbe20f9[_0x2957('0x21')]()===_0x2957('0x22')?_0x4d8ac8['destcalleridnum']:_0x4d8ac8[_0x2957('0x24')];return getAuthToken(_0x737b80,_0x1a2584,_0xbe20f9)[_0x2957('0xf')](function(_0x183990){var _0x3397af={'method':'GET','uri':_0x24e21c+_0x2957('0x2a')+_0x581d00[_0x2957('0x2b')]('+',_0x2957('0x2c'))+'\x27','headers':{'Authorization':_0x2957('0x14')+_0x183990,'If-None-Match':null,'OData-Version':_0x2957('0x26')},'json':!![]};return rp(_0x3397af);})[_0x2957('0xf')](function(_0x11e207){var _0x31c316=null;if(_0x11e207){var _0x284c38=_0x11e207[_0x2957('0x15')];var _0x30311a=![];for(_0x31c316=0x0;_0x31c316<_0x284c38[_0x2957('0x19')];_0x31c316++){if(_0x284c38[_0x31c316]['telephone1']===_0x581d00){_0x30311a=!![];_0x1c5025['enduserId']=_0x284c38[_0x31c316][_0x2957('0x2d')];}}if(_0x30311a){_0x2ef292(_0x1c5025);}else{return createEndUser(_0x1c5025,_0x737b80,_0x1a2584,_0x24e21c,_0x4d8ac8,_0xbe20f9)[_0x2957('0xf')](function(_0xd79e21){logger[_0x2957('0x1b')]('['+[_0xbe20f9['toUpperCase']()]+']\x20Enduser\x20created!',_0xd79e21[_0x2957('0x2e')]);_0x2ef292(_0xd79e21);});}}else{return createEndUser(_0x1c5025,_0x737b80,_0x1a2584,_0x24e21c,_0x4d8ac8,_0xbe20f9)[_0x2957('0xf')](function(_0x550d9e){logger['info']('['+[_0xbe20f9[_0x2957('0x1c')]()]+']\x20Enduser\x20Created!',_0x550d9e['enduserId']);_0x2ef292(_0x550d9e);});}});});}function getCustomFields(_0x3b1dab,_0x36b088,_0x3cc261){var _0x1d6dc2={};if(_0x3b1dab['length']>0x0){_[_0x2957('0x2f')](_0x3b1dab,function(_0x4129d0){if(_[_0x2957('0x30')]([_0x2957('0x31'),_0x2957('0x32')],_0x4129d0[_0x2957('0x33')])&&_0x4129d0['nameField']&&!_0x4129d0[_0x2957('0x34')]){var _0x5b3df1=_0x4129d0['idField']['toLowerCase']();var _0x57f6f1=_0x5b3df1[_0x2957('0x35')](0x0,_0x5b3df1[_0x2957('0x36')]('_'));var _0x42ef5b=_0x5b3df1['substring'](_0x5b3df1['indexOf']('_')+0x1);if(_0x57f6f1===_0x3cc261){_0x1d6dc2[_0x42ef5b]=_0x4129d0['content'];}}});}return _0x1d6dc2;}function getTicket(_0x1b2f6f,_0x5cae54,_0x2b892a,_0x262d7d,_0x4ef60e,_0x25b266,_0x3426d2){return new BPromise(function(_0x32dad6,_0x2e329f){var _0x3bfffb;return getAuthToken(_0x5cae54,_0x2b892a,_0x3426d2)[_0x2957('0xf')](function(_0xb94f60){if(_0x25b266[_0x2957('0x37')]==='incident'){_0x3bfffb={'method':_0x2957('0xa'),'uri':_0x262d7d+_0x2957('0x38'),'body':Object['assign']({},{'title':intUtil[_0x2957('0x39')](_0x25b266[_0x2957('0x3a')],_0x4ef60e,'\x20'),'description':intUtil['getString'](_0x25b266[_0x2957('0x3b')],_0x4ef60e,'\x0a'),'customerid_contact@odata.bind':_0x2957('0x3c')+_0x1b2f6f[_0x2957('0x2e')]+')','ownerid@odata.bind':_0x2957('0x25')+_0x1b2f6f[_0x2957('0x1f')]+')','caseorigincode':'1'},getCustomFields(_0x25b266[_0x2957('0x3d')],_0x4ef60e,_0x25b266['ticketType'])),'headers':{'Authorization':'Bearer\x20'+_0xb94f60,'OData-Version':_0x2957('0x26')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x25b266[_0x2957('0x37')]===_0x2957('0x3e')){_0x3bfffb={'method':_0x2957('0xa'),'uri':_0x262d7d+_0x2957('0x3f'),'body':Object[_0x2957('0x40')]({},{'subject':intUtil['getString'](_0x25b266[_0x2957('0x3a')],_0x4ef60e,'\x20'),'phonenumber':String(_0x4ef60e['calleridnum']),'description':intUtil[_0x2957('0x39')](_0x25b266['Descriptions'],_0x4ef60e,'\x0a'),'regardingobjectid_contact@odata.bind':_0x2957('0x3c')+_0x1b2f6f[_0x2957('0x2e')]+')','ownerid@odata.bind':_0x2957('0x25')+_0x1b2f6f[_0x2957('0x1f')]+')','directioncode':_0x1b2f6f[_0x2957('0x41')]===_0x2957('0x42')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':'/systemusers('+_0x1b2f6f[_0x2957('0x1f')]+')','participationtypemask':_0x1b2f6f[_0x2957('0x41')]===_0x2957('0x42')?0x2:0x1},{'partyid_contact@odata.bind':_0x2957('0x3c')+_0x1b2f6f[_0x2957('0x2e')]+')','participationtypemask':_0x1b2f6f[_0x2957('0x41')]===_0x2957('0x42')?0x1:0x2}]},getCustomFields(_0x25b266[_0x2957('0x3d')],_0x4ef60e,_0x25b266[_0x2957('0x37')])),'headers':{'Authorization':_0x2957('0x14')+_0xb94f60,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x3bfffb);})[_0x2957('0xf')](function(_0x16e346){var _0x40892f=_0x16e346[_0x2957('0x27')][_0x2957('0x28')];var _0x72fa7d=_0x40892f[_0x2957('0x35')](_0x40892f[_0x2957('0x29')]('(')+0x1,_0x40892f[_0x2957('0x29')](')'));_0x1b2f6f['ticketId']=_0x72fa7d;_0x32dad6(_0x1b2f6f);})[_0x2957('0x10')](function(_0x3d2552){_0x2e329f(_0x3d2552[_0x2957('0x20')]);});});}function emit(_0x2cb780,_0x4fa968,_0x3ce4be,_0x51b75c){var _0xab9557={'uri':util[_0x2957('0x43')](_0x2957('0x44'),_0x2cb780,_0x3ce4be,_0x51b75c)};io['to'](util['format'](_0x2957('0x45'),_0x4fa968))[_0x2957('0x46')](_0x2957('0x47'),_0xab9557);}exports['cs']=function(_0xd3f8b3,_0x140eba,_0x553ca3,_0x303d20,_0x3186f0,_0xc7329d,_0x31ae33,_0x4fa6cd){var _0x148950={};_0xc7329d[_0x2957('0xb')]=intUtil[_0x2957('0x48')](_0xc7329d[_0x2957('0xb')]);_0xc7329d['serverUrl']=intUtil[_0x2957('0x48')](_0xc7329d['serverUrl']);_0x148950['callDirection']=_0x4fa6cd===_0x2957('0x42')||_0x4fa6cd==='unmanaged'?_0x2957('0x42'):'outbound';var _0x1a1d00=util[_0x2957('0x43')]('%s/api/data/v9.0/',_0xc7329d[_0x2957('0xb')]);var _0x507a1f=util[_0x2957('0x43')](_0x2957('0x49'),_0xc7329d[_0x2957('0x4a')]);var _0x1c8c06=util['format'](_0x2957('0x4b'),_0xc7329d[_0x2957('0x4c')],_0x140eba['uniqueid'],md5(_0x140eba[_0x2957('0x4d')]));if(_0x3186f0&&_0x3186f0[_0x2957('0x4e')]){logger[_0x2957('0x1b')]('[QUEUE]',_0x2957('0x4f'));_0x140eba[_0x2957('0x50')]=_0x1c8c06;}else if(_0x31ae33&&_0x31ae33[_0x2957('0x51')]&&_0x31ae33[_0x2957('0x51')]!==_0x2957('0x52')){logger['info'](_0x2957('0x53'),'Recording\x20is\x20enabled!');_0x140eba['recordingURL']=_0x1c8c06;}else{_0x140eba[_0x2957('0x50')]='';}return getUser(_0x148950,_0xc7329d,_0x303d20,_0x507a1f,_0x1a1d00,_0x4fa6cd)['then'](function(_0x4fc31b){logger[_0x2957('0x1b')]('['+_0x4fa6cd[_0x2957('0x1c')]()+_0x2957('0x54'),_0x4fc31b[_0x2957('0x1f')]);logger['info']('['+_0x4fa6cd[_0x2957('0x1c')]()+']\x20The\x20User\x20email\x20is:',_0x4fc31b[_0x2957('0x55')]);return getEndUser(_0x4fc31b,_0xc7329d,_0x507a1f,_0x1a1d00,_0x140eba,_0x4fa6cd);})['then'](function(_0x6908ef){logger['info']('['+_0x4fa6cd[_0x2957('0x1c')]()+']\x20The\x20Enduser\x20ID\x20is:',_0x6908ef[_0x2957('0x2e')]);logger[_0x2957('0x1b')]('['+_0x4fa6cd[_0x2957('0x1c')]()+']\x20The\x20Enduser\x20phone\x20is:',_0x140eba[_0x2957('0x24')]);return getTicket(_0x6908ef,_0xc7329d,_0x507a1f,_0x1a1d00,_0x140eba,_0x553ca3,_0x4fa6cd);})[_0x2957('0xf')](function(_0x3f9e15){logger['info'](util['format']('['+_0x4fa6cd[_0x2957('0x1c')]()+_0x2957('0x56'),_0x553ca3[_0x2957('0x37')],_0x3f9e15[_0x2957('0x57')]));logger['info'](util['format']('['+_0x4fa6cd[_0x2957('0x1c')]()+']\x20Call\x20direction:\x20%s',_0x4fa6cd));if(_0x4fa6cd!==_0x2957('0x58')){logger['info']('['+_0x4fa6cd[_0x2957('0x1c')]()+']',_0x2957('0x59'));emit(_0xc7329d[_0x2957('0xb')],_0x303d20[_0x2957('0x5a')],_0x553ca3[_0x2957('0x37')],_0x3f9e15[_0x2957('0x57')]);}})['catch'](function(_0x1dd9f3){logger[_0x2957('0x11')]('['+_0x4fa6cd[_0x2957('0x1c')]()+_0x2957('0x5b'),util['inspect'](_0x1dd9f3,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xdd12=['contactid',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','includes','string','picklist','type','nameField','customField','idField','indexOf','ticketType','incident','incidents','getString','Descriptions','/contacts(','Fields','phonecall','phonecalls','assign','Subjects','callDirection','queue','/systemusers(','odata-entityid','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','serverUrl','stripTrailingSlash','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','uniqueid','monitor_format','[QUEUE]','recordingFormat','none','[OUTBOUND]','recordingURL',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20phone\x20is:','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','bluebird','util','./util','ioredis','../../../../config/logger','../../../../config/environment','redis','defaults','socket.io-emitter','POST','clientId','remoteUri','username','password','then','access_token','catch','error','toUpperCase','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','value','isNil','email','length','info',']\x20Agent\x20found\x20','systemuserid','userId','userEmail','internalemailaddress','outbound','calleridnum','contacts','4.0','headers','substring','lastIndexOf','enduserId','toLowerCase','destcalleridnum','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','%2b','telephone1'];(function(_0x2439af,_0x4cbb04){var _0x193b2b=function(_0x43e332){while(--_0x43e332){_0x2439af['push'](_0x2439af['shift']());}};_0x193b2b(++_0x4cbb04);}(_0xdd12,0xf6));var _0x2dd1=function(_0xab788e,_0x4e8075){_0xab788e=_0xab788e-0x0;var _0x406606=_0xdd12[_0xab788e];return _0x406606;};'use strict';var _=require(_0x2dd1('0x0'));var BPromise=require(_0x2dd1('0x1'));var rp=require('request-promise');var util=require(_0x2dd1('0x2'));var intUtil=require(_0x2dd1('0x3'));var md5=require('md5');var Redis=require(_0x2dd1('0x4'));var logger=require(_0x2dd1('0x5'))('dynamics365');var config=require(_0x2dd1('0x6'));config[_0x2dd1('0x7')]=_[_0x2dd1('0x8')](config[_0x2dd1('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x2dd1('0x9'))(new Redis(config[_0x2dd1('0x7')]));function getAuthToken(_0x37704b,_0xd326d4,_0x2171e4){var _0x327580={'method':_0x2dd1('0xa'),'uri':_0xd326d4,'form':{'client_id':_0x37704b[_0x2dd1('0xb')],'resource':_0x37704b[_0x2dd1('0xc')],'username':_0x37704b[_0x2dd1('0xd')],'password':_0x37704b['password'],'grant_type':_0x2dd1('0xe'),'client_secret':_0x37704b['clientSecret']},'json':!![]};return rp(_0x327580)[_0x2dd1('0xf')](function(_0x5dcd26){return _0x5dcd26[_0x2dd1('0x10')];})[_0x2dd1('0x11')](function(_0x341b4a){logger[_0x2dd1('0x12')]('['+[_0x2171e4[_0x2dd1('0x13')]()]+']\x20Wrong\x20credentials!');return _0x341b4a[_0x2dd1('0x14')];});}function getUser(_0xcabc7,_0x435a60,_0x2f38b1,_0x52edc8,_0x54106f,_0x5981a5){return new BPromise(function(_0x222025,_0x251e4f){return getAuthToken(_0x435a60,_0x52edc8,_0x5981a5)[_0x2dd1('0xf')](function(_0xb3cd58){var _0x1c5b7e={'method':_0x2dd1('0x15'),'uri':_0x54106f+_0x2dd1('0x16'),'headers':{'Authorization':_0x2dd1('0x17')+_0xb3cd58,'OData-Version':'4.0'},'json':!![]};return rp(_0x1c5b7e);})[_0x2dd1('0xf')](function(_0x350f15){var _0x48bfd3=_0x350f15[_0x2dd1('0x18')];var _0x1dc473=![];var _0x4c3a8a=null;if(!_[_0x2dd1('0x19')](_0x2f38b1)){if(intUtil['validateEmail'](_0x2f38b1[_0x2dd1('0x1a')])){_0xcabc7['userEmail']=_0x2f38b1['email'];for(_0x4c3a8a=0x0;_0x4c3a8a<_0x48bfd3[_0x2dd1('0x1b')];_0x4c3a8a++){if(_0x48bfd3[_0x4c3a8a]['internalemailaddress']===_0x2f38b1[_0x2dd1('0x1a')]&&!_0x48bfd3[_0x4c3a8a]['isdisabled']){_0x1dc473=!![];logger[_0x2dd1('0x1c')]('['+[_0x5981a5['toUpperCase']()]+_0x2dd1('0x1d')+_0x48bfd3[_0x4c3a8a][_0x2dd1('0x1e')]+'!');_0xcabc7[_0x2dd1('0x1f')]=_0x48bfd3[_0x4c3a8a]['systemuserid'];}}}}if(!_0x1dc473){logger[_0x2dd1('0x1c')]('['+[_0x5981a5[_0x2dd1('0x13')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0xcabc7[_0x2dd1('0x20')]=_0x435a60[_0x2dd1('0xd')];for(_0x4c3a8a=0x0;_0x4c3a8a<_0x48bfd3['length'];_0x4c3a8a++){if(_0x48bfd3[_0x4c3a8a][_0x2dd1('0x21')]===_0x435a60[_0x2dd1('0xd')]){_0xcabc7['userId']=_0x48bfd3[_0x4c3a8a][_0x2dd1('0x1e')];}}}_0x222025(_0xcabc7);})[_0x2dd1('0x11')](function(_0x2e4d91){_0x251e4f(_0x2e4d91[_0x2dd1('0x14')]);});});}function createEndUser(_0xd3ce9b,_0x5d11a1,_0x247b0f,_0x24a122,_0x3cbf86,_0x263b81){return new BPromise(function(_0x389b4b,_0x3e3c05){return getAuthToken(_0x5d11a1,_0x247b0f,_0x263b81)['then'](function(_0x250ec6){var _0x35f74b=_0x263b81['toLowerCase']()===_0x2dd1('0x22')?_0x3cbf86['destcalleridnum']:_0x3cbf86[_0x2dd1('0x23')];var _0x434461={'method':_0x2dd1('0xa'),'uri':_0x24a122+_0x2dd1('0x24'),'body':{'telephone1':_0x35f74b,'fullname':_0x35f74b,'firstname':_0x35f74b,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0xd3ce9b[_0x2dd1('0x1f')]+')'},'headers':{'Authorization':_0x2dd1('0x17')+_0x250ec6,'OData-Version':_0x2dd1('0x25')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x434461);})['then'](function(_0x198018){var _0x24782f=_0x198018[_0x2dd1('0x26')]['odata-entityid'];var _0x4b789a=_0x24782f[_0x2dd1('0x27')](_0x24782f[_0x2dd1('0x28')]('(')+0x1,_0x24782f[_0x2dd1('0x28')](')'));_0xd3ce9b[_0x2dd1('0x29')]=_0x4b789a;_0x389b4b(_0xd3ce9b);})['catch'](function(_0x5c192d){_0x3e3c05(_0x5c192d[_0x2dd1('0x14')]);});});}function getEndUser(_0x40d745,_0x40175b,_0x555993,_0x1a215b,_0x50cc8a,_0x7cd687){return new BPromise(function(_0x47474c,_0x1e120d){var _0x2230f5=_0x7cd687[_0x2dd1('0x2a')]()===_0x2dd1('0x22')?_0x50cc8a[_0x2dd1('0x2b')]:_0x50cc8a[_0x2dd1('0x23')];return getAuthToken(_0x40175b,_0x555993,_0x7cd687)[_0x2dd1('0xf')](function(_0x17383c){var _0x2a9700={'method':_0x2dd1('0x15'),'uri':_0x1a215b+_0x2dd1('0x2c')+_0x2230f5[_0x2dd1('0x2d')]('+',_0x2dd1('0x2e'))+'\x27','headers':{'Authorization':_0x2dd1('0x17')+_0x17383c,'If-None-Match':null,'OData-Version':_0x2dd1('0x25')},'json':!![]};return rp(_0x2a9700);})['then'](function(_0x5c6590){var _0x26d906=null;if(_0x5c6590){var _0x51bd35=_0x5c6590[_0x2dd1('0x18')];var _0x442918=![];for(_0x26d906=0x0;_0x26d906<_0x51bd35[_0x2dd1('0x1b')];_0x26d906++){if(_0x51bd35[_0x26d906][_0x2dd1('0x2f')]===_0x2230f5){_0x442918=!![];_0x40d745['enduserId']=_0x51bd35[_0x26d906][_0x2dd1('0x30')];}}if(_0x442918){_0x47474c(_0x40d745);}else{return createEndUser(_0x40d745,_0x40175b,_0x555993,_0x1a215b,_0x50cc8a,_0x7cd687)[_0x2dd1('0xf')](function(_0x5024c1){logger[_0x2dd1('0x1c')]('['+[_0x7cd687[_0x2dd1('0x13')]()]+_0x2dd1('0x31'),_0x5024c1[_0x2dd1('0x29')]);_0x47474c(_0x5024c1);});}}else{return createEndUser(_0x40d745,_0x40175b,_0x555993,_0x1a215b,_0x50cc8a,_0x7cd687)[_0x2dd1('0xf')](function(_0x77c277){logger[_0x2dd1('0x1c')]('['+[_0x7cd687[_0x2dd1('0x13')]()]+_0x2dd1('0x32'),_0x77c277['enduserId']);_0x47474c(_0x77c277);});}});});}function getCustomFields(_0x3cc29a,_0x4c8542,_0x4f48a2){var _0xd68037={};if(_0x3cc29a[_0x2dd1('0x1b')]>0x0){_['forEach'](_0x3cc29a,function(_0x471b2b){if(_[_0x2dd1('0x33')]([_0x2dd1('0x34'),_0x2dd1('0x35')],_0x471b2b[_0x2dd1('0x36')])&&_0x471b2b[_0x2dd1('0x37')]&&!_0x471b2b[_0x2dd1('0x38')]){var _0x1f09ea=_0x471b2b[_0x2dd1('0x39')]['toLowerCase']();var _0xf35b51=_0x1f09ea[_0x2dd1('0x27')](0x0,_0x1f09ea[_0x2dd1('0x3a')]('_'));var _0x5cac81=_0x1f09ea[_0x2dd1('0x27')](_0x1f09ea[_0x2dd1('0x3a')]('_')+0x1);if(_0xf35b51===_0x4f48a2){_0xd68037[_0x5cac81]=_0x471b2b['content'];}}});}return _0xd68037;}function getTicket(_0x3cddb4,_0x55ff8f,_0x356400,_0x5bf5fb,_0x3b4cd3,_0x33609c,_0x20a9c5){return new BPromise(function(_0x4c6ee8,_0x58058b){var _0x4fe4b5;return getAuthToken(_0x55ff8f,_0x356400,_0x20a9c5)[_0x2dd1('0xf')](function(_0x1176cc){if(_0x33609c[_0x2dd1('0x3b')]===_0x2dd1('0x3c')){_0x4fe4b5={'method':_0x2dd1('0xa'),'uri':_0x5bf5fb+_0x2dd1('0x3d'),'body':Object['assign']({},{'title':intUtil[_0x2dd1('0x3e')](_0x33609c['Subjects'],_0x3b4cd3,'\x20'),'description':intUtil[_0x2dd1('0x3e')](_0x33609c[_0x2dd1('0x3f')],_0x3b4cd3,'\x0a'),'customerid_contact@odata.bind':_0x2dd1('0x40')+_0x3cddb4[_0x2dd1('0x29')]+')','ownerid@odata.bind':'/systemusers('+_0x3cddb4[_0x2dd1('0x1f')]+')','caseorigincode':'1'},getCustomFields(_0x33609c[_0x2dd1('0x41')],_0x3b4cd3,_0x33609c[_0x2dd1('0x3b')])),'headers':{'Authorization':_0x2dd1('0x17')+_0x1176cc,'OData-Version':_0x2dd1('0x25')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x33609c['ticketType']===_0x2dd1('0x42')){_0x4fe4b5={'method':_0x2dd1('0xa'),'uri':_0x5bf5fb+_0x2dd1('0x43'),'body':Object[_0x2dd1('0x44')]({},{'subject':intUtil['getString'](_0x33609c[_0x2dd1('0x45')],_0x3b4cd3,'\x20'),'phonenumber':String(_0x3b4cd3['calleridnum']),'description':intUtil['getString'](_0x33609c['Descriptions'],_0x3b4cd3,'\x0a'),'regardingobjectid_contact@odata.bind':_0x2dd1('0x40')+_0x3cddb4['enduserId']+')','ownerid@odata.bind':'/systemusers('+_0x3cddb4[_0x2dd1('0x1f')]+')','directioncode':_0x3cddb4[_0x2dd1('0x46')]===_0x2dd1('0x47')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x2dd1('0x48')+_0x3cddb4[_0x2dd1('0x1f')]+')','participationtypemask':_0x3cddb4['callDirection']==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0x2dd1('0x40')+_0x3cddb4['enduserId']+')','participationtypemask':_0x3cddb4[_0x2dd1('0x46')]===_0x2dd1('0x47')?0x1:0x2}]},getCustomFields(_0x33609c['Fields'],_0x3b4cd3,_0x33609c[_0x2dd1('0x3b')])),'headers':{'Authorization':'Bearer\x20'+_0x1176cc,'OData-Version':_0x2dd1('0x25')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x4fe4b5);})[_0x2dd1('0xf')](function(_0x114f05){var _0x1b0000=_0x114f05[_0x2dd1('0x26')][_0x2dd1('0x49')];var _0x19387d=_0x1b0000[_0x2dd1('0x27')](_0x1b0000[_0x2dd1('0x28')]('(')+0x1,_0x1b0000[_0x2dd1('0x28')](')'));_0x3cddb4[_0x2dd1('0x4a')]=_0x19387d;_0x4c6ee8(_0x3cddb4);})['catch'](function(_0x1a34af){_0x58058b(_0x1a34af[_0x2dd1('0x14')]);});});}function emit(_0x2f869e,_0x1801c6,_0xe3a8f2,_0x4cfb5d){var _0x28f838={'uri':util[_0x2dd1('0x4b')](_0x2dd1('0x4c'),_0x2f869e,_0xe3a8f2,_0x4cfb5d)};io['to'](util['format'](_0x2dd1('0x4d'),_0x1801c6))[_0x2dd1('0x4e')]('trigger:browser:url',_0x28f838);}exports['cs']=function(_0x5e64fd,_0x41c2a8,_0x26fab5,_0x16a6f0,_0x32e2b3,_0x4c2dc1,_0x293e01,_0x168e58){var _0x49d97e={};_0x4c2dc1[_0x2dd1('0xc')]=intUtil['stripTrailingSlash'](_0x4c2dc1[_0x2dd1('0xc')]);_0x4c2dc1[_0x2dd1('0x4f')]=intUtil[_0x2dd1('0x50')](_0x4c2dc1[_0x2dd1('0x4f')]);_0x49d97e[_0x2dd1('0x46')]=_0x168e58==='queue'||_0x168e58===_0x2dd1('0x51')?'queue':_0x2dd1('0x22');var _0x53a280=util[_0x2dd1('0x4b')](_0x2dd1('0x52'),_0x4c2dc1['remoteUri']);var _0x563677=util['format'](_0x2dd1('0x53'),_0x4c2dc1[_0x2dd1('0x54')]);var _0x37e7ad=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4c2dc1['serverUrl'],_0x41c2a8['uniqueid'],md5(_0x41c2a8[_0x2dd1('0x55')]));if(_0x32e2b3&&_0x32e2b3[_0x2dd1('0x56')]){logger['info'](_0x2dd1('0x57'),'Recording\x20is\x20enabled!');_0x41c2a8['recordingURL']=_0x37e7ad;}else if(_0x293e01&&_0x293e01[_0x2dd1('0x58')]&&_0x293e01[_0x2dd1('0x58')]!==_0x2dd1('0x59')){logger['info'](_0x2dd1('0x5a'),'Recording\x20is\x20enabled!');_0x41c2a8[_0x2dd1('0x5b')]=_0x37e7ad;}else{_0x41c2a8[_0x2dd1('0x5b')]='';}return getUser(_0x49d97e,_0x4c2dc1,_0x16a6f0,_0x563677,_0x53a280,_0x168e58)[_0x2dd1('0xf')](function(_0xd15f10){logger[_0x2dd1('0x1c')]('['+_0x168e58['toUpperCase']()+_0x2dd1('0x5c'),_0xd15f10['userId']);logger['info']('['+_0x168e58[_0x2dd1('0x13')]()+_0x2dd1('0x5d'),_0xd15f10[_0x2dd1('0x20')]);return getEndUser(_0xd15f10,_0x4c2dc1,_0x563677,_0x53a280,_0x41c2a8,_0x168e58);})[_0x2dd1('0xf')](function(_0x27649c){logger[_0x2dd1('0x1c')]('['+_0x168e58[_0x2dd1('0x13')]()+']\x20The\x20Enduser\x20ID\x20is:',_0x27649c[_0x2dd1('0x29')]);logger[_0x2dd1('0x1c')]('['+_0x168e58[_0x2dd1('0x13')]()+_0x2dd1('0x5e'),_0x41c2a8[_0x2dd1('0x23')]);return getTicket(_0x27649c,_0x4c2dc1,_0x563677,_0x53a280,_0x41c2a8,_0x26fab5,_0x168e58);})['then'](function(_0x56f2a7){logger[_0x2dd1('0x1c')](util['format']('['+_0x168e58[_0x2dd1('0x13')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x26fab5[_0x2dd1('0x3b')],_0x56f2a7[_0x2dd1('0x4a')]));logger[_0x2dd1('0x1c')](util[_0x2dd1('0x4b')]('['+_0x168e58[_0x2dd1('0x13')]()+']\x20Call\x20direction:\x20%s',_0x168e58));if(_0x168e58!==_0x2dd1('0x51')){logger[_0x2dd1('0x1c')]('['+_0x168e58[_0x2dd1('0x13')]()+']',_0x2dd1('0x5f'));emit(_0x4c2dc1[_0x2dd1('0xc')],_0x16a6f0[_0x2dd1('0x60')],_0x26fab5[_0x2dd1('0x3b')],_0x56f2a7['ticketId']);}})[_0x2dd1('0x11')](function(_0x35895d){logger[_0x2dd1('0x12')]('['+_0x168e58[_0x2dd1('0x13')]()+_0x2dd1('0x61'),util['inspect'](_0x35895d,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/freshdesk.js b/server/services/ami/trigger/integration/freshdesk.js index 0ff3e8b..9315006 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 _0x2527=['trigger:browser:url','catch','error','stringify','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','uniqueid','Authorization','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','%s/helpdesk/tickets/%d','unmanaged','toUpperCase','lastevent','lodash','md5','./util','../../../../config/environment','freshdesk','redis','localhost','socket.io-emitter','application/json','emit','Creating\x20new\x20ticket...','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Descriptions','
','name','Fields','custom_fields','mapValues','keyBy','remoteUri','POST','then','info','Ticket\x20created!','%s/api/v2/agents','length','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/api/v2/contacts','Basic\x20%s','apiKey','toString','[HTTP]','defaults','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','idField','variable','variableName','customVariable','Variable','push','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','recordingURL','The\x20User\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','user:%s'];(function(_0x4b90fa,_0x950b38){var _0x395a43=function(_0x16651b){while(--_0x16651b){_0x4b90fa['push'](_0x4b90fa['shift']());}};_0x395a43(++_0x950b38);}(_0x2527,0xc7));var _0x7252=function(_0x4f948f,_0x561138){_0x4f948f=_0x4f948f-0x0;var _0x5f350e=_0x2527[_0x4f948f];return _0x5f350e;};'use strict';var _=require(_0x7252('0x0'));var rp=require('request-promise');var md5=require(_0x7252('0x1'));var util=require('util');var Redis=require('ioredis');var intUtil=require(_0x7252('0x2'));var config=require(_0x7252('0x3'));var logger=require('../../../../config/logger')(_0x7252('0x4'));config[_0x7252('0x5')]=_['defaults'](config[_0x7252('0x5')],{'host':_0x7252('0x6'),'port':0x18eb});var io=require(_0x7252('0x7'))(new Redis(config[_0x7252('0x5')]));var headers={'Content-Type':_0x7252('0x8'),'Accept':_0x7252('0x8')};function emit(_0x14a4d2,_0x430234,_0x137b42){io['to'](_0x14a4d2)[_0x7252('0x9')](_0x430234,_0x137b42);}function getTicket(_0x39123d,_0x1db4dd,_0x229694,_0x47e8c1,_0x35ee2c){logger['info'](_0x7252('0xa'));var _0x12359d=_['merge']({'responder_id':_0x1db4dd['id'],'requester_id':_0x229694['id'],'name':util[_0x7252('0xb')](_0x7252('0xc'),_0x35ee2c[_0x7252('0xd')]),'phone':_0x35ee2c[_0x7252('0xe')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x7252('0xf')](_0x47e8c1[_0x7252('0x10')],_0x35ee2c,'\x20'),'description':intUtil[_0x7252('0xf')](_0x47e8c1[_0x7252('0x11')],_0x35ee2c,_0x7252('0x12')),'tags':getTags(_0x47e8c1['Tags'],_0x7252('0x13'))},getCustomFields(_0x47e8c1[_0x7252('0x14')],_0x35ee2c));_0x12359d[_0x7252('0x15')]=_[_0x7252('0x16')](_[_0x7252('0x17')](_0x12359d[_0x7252('0x15')],'id'),'value');return request({'uri':util[_0x7252('0xb')]('%s/api/v2/tickets',_0x39123d[_0x7252('0x18')]),'method':_0x7252('0x19'),'body':_0x12359d})[_0x7252('0x1a')](function(_0x377a41){logger[_0x7252('0x1b')](_0x7252('0x1c'));return _0x377a41;});}function getUser(_0x3ba3c5,_0x28ad81){if(intUtil['validateEmail'](_0x28ad81)){return request({'uri':util[_0x7252('0xb')](_0x7252('0x1d'),_0x3ba3c5[_0x7252('0x18')]),'qs':{'email':_0x28ad81}})[_0x7252('0x1a')](function(_0x575f81){if(_0x575f81[_0x7252('0x1e')]){logger[_0x7252('0x1b')]('Agent\x20found!');return _[_0x7252('0x1f')](_0x575f81,function(_0x51f0d8){return _0x51f0d8[_0x7252('0x20')][_0x7252('0x21')]===_0x28ad81;});}else{logger[_0x7252('0x1b')](_0x7252('0x22'));return request({'uri':util[_0x7252('0xb')](_0x7252('0x23'),_0x3ba3c5[_0x7252('0x18')])})['then'](function(_0x5a8c20){logger['info'](_0x7252('0x24'));return _0x5a8c20;});}});}else{logger[_0x7252('0x1b')](_0x7252('0x25'));return request({'uri':util[_0x7252('0xb')](_0x7252('0x23'),_0x3ba3c5[_0x7252('0x18')])})['then'](function(_0xeb5e4d){logger[_0x7252('0x1b')](_0x7252('0x24'));return _0xeb5e4d;});}}function getEndUser(_0x172cf4,_0x50c925,_0x48650c){logger[_0x7252('0x1b')](_0x7252('0x26'),_0x48650c);return request({'uri':util[_0x7252('0xb')]('%s/api/v2/contacts',_0x172cf4[_0x7252('0x18')]),'qs':{'phone':_0x48650c}})[_0x7252('0x1a')](function(_0x1bcc00){if(_0x1bcc00[_0x7252('0x1e')]){logger[_0x7252('0x1b')]('Enduser\x20found!');return _[_0x7252('0x1f')](_0x1bcc00,{'phone':_0x48650c});}else{logger['info'](_0x7252('0x27'));return request({'uri':util[_0x7252('0xb')](_0x7252('0x28'),_0x172cf4[_0x7252('0x18')]),'method':'POST','body':{'name':_0x50c925,'phone':_0x48650c}})[_0x7252('0x1a')](function(_0x501159){logger[_0x7252('0x1b')]('Enduser\x20created.');return _0x501159;});}});}function getAuth(_0xea0ac7){return util[_0x7252('0xb')](_0x7252('0x29'),new Buffer(_0xea0ac7[_0x7252('0x2a')]+':X')[_0x7252('0x2b')]('base64'));}function request(_0xec8ae4){logger['debug'](_0x7252('0x2c'),JSON['stringify'](_0xec8ae4));return rp(_[_0x7252('0x2d')](_0xec8ae4,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x30fe70,_0x2c5340){var _0x48642c=[];if(_0x30fe70&&_0x30fe70[_0x7252('0x1e')]>0x0){_0x48642c=_['map'](_0x30fe70,_0x2c5340);}return _0x48642c;}function getCustomFields(_0x71a9b,_0x4c0ef4){var _0x9dc648=[];var _0x2a1df5={'custom_fields':[]};if(_0x71a9b[_0x7252('0x1e')]>0x0){_[_0x7252('0x2e')](_0x71a9b,function(_0x861fc2){if(_[_0x7252('0x2f')]([_0x7252('0x30'),_0x7252('0x31')],_0x861fc2[_0x7252('0x32')])&&_0x861fc2[_0x7252('0x33')]&&!_0x861fc2[_0x7252('0x34')]){_0x2a1df5[_0x861fc2['nameField'][_0x7252('0x35')]()]=_0x861fc2[_0x7252('0x36')]['toString']();}else if(_[_0x7252('0x2f')](['string',_0x7252('0x31')],_0x861fc2['type'])&&_0x861fc2[_0x7252('0x37')]&&_0x861fc2[_0x7252('0x34')]){_0x2a1df5[_0x7252('0x15')]['push']({'id':_0x861fc2['idField'],'value':_0x861fc2[_0x7252('0x36')][_0x7252('0x2b')]()});}else if(_0x861fc2[_0x7252('0x32')]===_0x7252('0x38')&&_0x861fc2[_0x7252('0x39')]&&_0x861fc2[_0x7252('0x37')]&&_0x861fc2[_0x7252('0x34')]){_0x4c0ef4[_0x861fc2[_0x7252('0x39')]]&&_0x2a1df5[_0x7252('0x15')]['push']({'id':_0x861fc2['idField'],'value':_0x4c0ef4[_0x861fc2['variableName']][_0x7252('0x2b')]()});}else if(_0x861fc2[_0x7252('0x32')]===_0x7252('0x3a')&&_0x861fc2[_0x7252('0x3b')]&&_0x861fc2[_0x7252('0x3b')][_0x7252('0x13')]&&_0x861fc2[_0x7252('0x37')]&&_0x861fc2[_0x7252('0x34')]){_0x4c0ef4[_0x861fc2['Variable'][_0x7252('0x13')][_0x7252('0x35')]()]&&_0x2a1df5[_0x7252('0x15')][_0x7252('0x3c')]({'id':_0x861fc2[_0x7252('0x37')],'value':_0x4c0ef4[_0x861fc2[_0x7252('0x3b')][_0x7252('0x13')][_0x7252('0x35')]()][_0x7252('0x2b')]()});}});}return _0x2a1df5;}exports[_0x7252('0x3d')]=function(_0x51380f,_0x2ae01e,_0x27a46a,_0x22688d,_0x1c7e6e,_0x3bed56){var _0x25a0b8,_0x4a4ebb;_0x3bed56[_0x7252('0x18')]=intUtil[_0x7252('0x3e')](_0x3bed56[_0x7252('0x18')]);_0x3bed56[_0x7252('0x3f')]=intUtil[_0x7252('0x3e')](_0x3bed56[_0x7252('0x3f')]);if(_0x1c7e6e&&_0x1c7e6e[_0x7252('0x40')]){logger['info'](_0x7252('0x41'),'Recording\x20is\x20enabled!');_0x2ae01e['recordingURL']=util[_0x7252('0xb')](_0x7252('0x42'),_0x3bed56[_0x7252('0x3f')],_0x2ae01e['uniqueid'],md5(_0x2ae01e['uniqueid']));}else{_0x2ae01e[_0x7252('0x43')]='';}headers['Authorization']=getAuth(_0x3bed56);return getUser(_0x3bed56,_0x22688d[_0x7252('0x21')])[_0x7252('0x1a')](function(_0x24b383){_0x25a0b8=_0x24b383;logger['info'](_0x7252('0x44'),_0x25a0b8['id']);return getEndUser(_0x3bed56,_0x2ae01e[_0x7252('0xd')],_0x2ae01e[_0x7252('0xe')]);})[_0x7252('0x1a')](function(_0x3c1344){_0x4a4ebb=_0x3c1344;logger[_0x7252('0x1b')]('The\x20Enduser\x20ID\x20is:',_0x4a4ebb['id']);return getTicket(_0x3bed56,_0x25a0b8,_0x4a4ebb,_0x27a46a,_0x2ae01e);})[_0x7252('0x1a')](function(_0x862734){if(_0x862734&&_0x862734['id']){logger[_0x7252('0x1b')](_0x7252('0x1c'));logger[_0x7252('0x1b')](_0x7252('0x45'),_0x862734['id']);logger[_0x7252('0x1b')](_0x7252('0x41'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x7252('0xb')](_0x7252('0x46'),_0x22688d[_0x7252('0x13')]),_0x7252('0x47'),{'uri':util['format']('%s/helpdesk/tickets/%d',_0x3bed56[_0x7252('0x18')],_0x862734['id'])});}})[_0x7252('0x48')](function(_0x5411ac){logger[_0x7252('0x49')](_0x7252('0x41'),JSON[_0x7252('0x4a')](_0x5411ac));});};exports[_0x7252('0x4b')]=function(_0x57a97b,_0x53d6fb,_0x8bd721,_0x531da6,_0x36029d,_0x5c0d0a,_0xfecf42){var _0x2e9599,_0x590bcc;_0x5c0d0a[_0x7252('0x18')]=intUtil[_0x7252('0x3e')](_0x5c0d0a[_0x7252('0x18')]);_0x5c0d0a['serverUrl']=intUtil[_0x7252('0x3e')](_0x5c0d0a[_0x7252('0x3f')]);if(_0xfecf42&&_0xfecf42['recordingFormat']&&_0xfecf42[_0x7252('0x4c')]!==_0x7252('0x4d')){logger[_0x7252('0x1b')](_0x7252('0x4e'),_0x7252('0x4f'));_0x53d6fb[_0x7252('0x43')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5c0d0a['serverUrl'],_0x53d6fb[_0x7252('0x50')],md5(_0x53d6fb[_0x7252('0x50')]));}headers[_0x7252('0x51')]=getAuth(_0x5c0d0a);return getUser(_0x5c0d0a,_0x531da6['email'])[_0x7252('0x1a')](function(_0x3fbc01){_0x2e9599=_0x3fbc01;logger['info'](_0x7252('0x44'),_0x2e9599['id']);return getEndUser(_0x5c0d0a,_0x53d6fb[_0x7252('0x52')],_0x53d6fb[_0x7252('0x53')]);})[_0x7252('0x1a')](function(_0x1cde26){_0x590bcc=_0x1cde26;logger[_0x7252('0x1b')](_0x7252('0x54'),_0x590bcc['id']);return getTicket(_0x5c0d0a,_0x2e9599,_0x590bcc,_0x8bd721,_0x53d6fb);})[_0x7252('0x1a')](function(_0x36bb00){if(_0x36bb00&&_0x36bb00['id']){logger[_0x7252('0x1b')](_0x7252('0x1c'));logger[_0x7252('0x1b')](_0x7252('0x45'),_0x36bb00['id']);logger[_0x7252('0x1b')]('[OUTBOUND]',_0x7252('0x55'));emit(util['format']('user:%s',_0x531da6[_0x7252('0x13')]),'trigger:browser:url',{'uri':util['format'](_0x7252('0x56'),_0x5c0d0a[_0x7252('0x18')],_0x36bb00['id'])});}})[_0x7252('0x48')](function(_0x30e4b9){logger['error'](_0x7252('0x4e'),JSON[_0x7252('0x4a')](_0x30e4b9));});};exports[_0x7252('0x57')]=function(_0x57b90a,_0x3bf8dc,_0x12696b,_0x287139,_0x132fa5,_0x37935b){var _0x347248,_0x275d21;_0x37935b[_0x7252('0x18')]=intUtil[_0x7252('0x3e')](_0x37935b['remoteUri']);_0x37935b[_0x7252('0x3f')]=intUtil[_0x7252('0x3e')](_0x37935b[_0x7252('0x3f')]);if(_0x132fa5&&_0x132fa5[_0x7252('0x40')]){logger[_0x7252('0x1b')]('['+_0x3bf8dc['lastevent'][_0x7252('0x58')]()+']','Recording\x20is\x20enabled!');_0x3bf8dc[_0x7252('0x43')]=util[_0x7252('0xb')](_0x7252('0x42'),_0x37935b[_0x7252('0x3f')],_0x3bf8dc[_0x7252('0x50')],md5(_0x3bf8dc['uniqueid']));}else{_0x3bf8dc[_0x7252('0x43')]='';}headers[_0x7252('0x51')]=getAuth(_0x37935b);return getUser(_0x37935b,'')['then'](function(_0x264e48){_0x347248=_0x264e48;logger[_0x7252('0x1b')](_0x7252('0x44'),_0x347248['id']);return getEndUser(_0x37935b,_0x3bf8dc[_0x7252('0xd')],_0x3bf8dc['calleridnum']);})[_0x7252('0x1a')](function(_0x5b5d0e){_0x275d21=_0x5b5d0e;logger['info'](_0x7252('0x54'),_0x275d21['id']);return getTicket(_0x37935b,_0x347248,_0x275d21,_0x12696b,_0x3bf8dc);})['then'](function(_0x5cfceb){if(_0x5cfceb){logger[_0x7252('0x1b')](_0x7252('0x1c'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x5cfceb['id']);}})[_0x7252('0x48')](function(_0x346485){logger[_0x7252('0x49')]('['+_0x3bf8dc[_0x7252('0x59')][_0x7252('0x58')]()+']',JSON['stringify'](_0x346485));});}; \ No newline at end of file +var _0x5fc7=['defaults','localhost','socket.io-emitter','application/json','emit','info','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Descriptions','
','Tags','Fields','custom_fields','mapValues','keyBy','value','remoteUri','POST','then','validateEmail','%s/api/v2/agents','length','Agent\x20found!','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','find','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','toString','debug','[HTTP]','stringify','map','forEach','string','type','nameField','customField','content','picklist','idField','variable','variableName','push','customVariable','Variable','name','toLowerCase','queue','serverUrl','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','outbound','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridnum','%s/helpdesk/tickets/%d','error','unmanaged','lastevent','lodash','request-promise','md5','util','ioredis','./util','freshdesk','redis'];(function(_0x27d201,_0x2e3808){var _0xe745bd=function(_0x3f27d2){while(--_0x3f27d2){_0x27d201['push'](_0x27d201['shift']());}};_0xe745bd(++_0x2e3808);}(_0x5fc7,0x170));var _0x75fc=function(_0x2f8530,_0x5cbd67){_0x2f8530=_0x2f8530-0x0;var _0x5e814e=_0x5fc7[_0x2f8530];return _0x5e814e;};'use strict';var _=require(_0x75fc('0x0'));var rp=require(_0x75fc('0x1'));var md5=require(_0x75fc('0x2'));var util=require(_0x75fc('0x3'));var Redis=require(_0x75fc('0x4'));var intUtil=require(_0x75fc('0x5'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x75fc('0x6'));config[_0x75fc('0x7')]=_[_0x75fc('0x8')](config[_0x75fc('0x7')],{'host':_0x75fc('0x9'),'port':0x18eb});var io=require(_0x75fc('0xa'))(new Redis(config[_0x75fc('0x7')]));var headers={'Content-Type':'application/json','Accept':_0x75fc('0xb')};function emit(_0x4df5e8,_0x2dedf1,_0x1f2f13){io['to'](_0x4df5e8)[_0x75fc('0xc')](_0x2dedf1,_0x1f2f13);}function getTicket(_0x3e01e9,_0x156323,_0x2e844b,_0x4df969,_0x45aaf8){logger[_0x75fc('0xd')]('Creating\x20new\x20ticket...');var _0x593ad1=_['merge']({'responder_id':_0x156323['id'],'requester_id':_0x2e844b['id'],'name':util[_0x75fc('0xe')](_0x75fc('0xf'),_0x45aaf8[_0x75fc('0x10')]),'phone':_0x45aaf8[_0x75fc('0x11')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x75fc('0x12')](_0x4df969['Subjects'],_0x45aaf8,'\x20'),'description':intUtil[_0x75fc('0x12')](_0x4df969[_0x75fc('0x13')],_0x45aaf8,_0x75fc('0x14')),'tags':getTags(_0x4df969[_0x75fc('0x15')],'name')},getCustomFields(_0x4df969[_0x75fc('0x16')],_0x45aaf8));_0x593ad1[_0x75fc('0x17')]=_[_0x75fc('0x18')](_[_0x75fc('0x19')](_0x593ad1['custom_fields'],'id'),_0x75fc('0x1a'));return request({'uri':util[_0x75fc('0xe')]('%s/api/v2/tickets',_0x3e01e9[_0x75fc('0x1b')]),'method':_0x75fc('0x1c'),'body':_0x593ad1})[_0x75fc('0x1d')](function(_0x5ed24a){logger[_0x75fc('0xd')]('Ticket\x20created!');return _0x5ed24a;});}function getUser(_0x456564,_0x2bf062){if(intUtil[_0x75fc('0x1e')](_0x2bf062)){return request({'uri':util[_0x75fc('0xe')](_0x75fc('0x1f'),_0x456564[_0x75fc('0x1b')]),'qs':{'email':_0x2bf062}})[_0x75fc('0x1d')](function(_0xbcfaac){if(_0xbcfaac[_0x75fc('0x20')]){logger[_0x75fc('0xd')](_0x75fc('0x21'));return _['find'](_0xbcfaac,function(_0x20d88e){return _0x20d88e[_0x75fc('0x22')][_0x75fc('0x23')]===_0x2bf062;});}else{logger[_0x75fc('0xd')](_0x75fc('0x24'));return request({'uri':util[_0x75fc('0xe')](_0x75fc('0x25'),_0x456564[_0x75fc('0x1b')])})[_0x75fc('0x1d')](function(_0x2134c8){logger[_0x75fc('0xd')](_0x75fc('0x26'));return _0x2134c8;});}});}else{logger[_0x75fc('0xd')](_0x75fc('0x27'));return request({'uri':util[_0x75fc('0xe')]('%s/api/v2/agents/me',_0x456564[_0x75fc('0x1b')])})['then'](function(_0x22052e){logger[_0x75fc('0xd')](_0x75fc('0x26'));return _0x22052e;});}}function getEndUser(_0x57b6dc,_0x228a16,_0x3d39d4){logger[_0x75fc('0xd')](_0x75fc('0x28'),_0x3d39d4);return request({'uri':util[_0x75fc('0xe')](_0x75fc('0x29'),_0x57b6dc[_0x75fc('0x1b')]),'qs':{'phone':_0x3d39d4}})[_0x75fc('0x1d')](function(_0x436e91){if(_0x436e91[_0x75fc('0x20')]){logger[_0x75fc('0xd')](_0x75fc('0x2a'));return _[_0x75fc('0x2b')](_0x436e91,{'phone':_0x3d39d4});}else{logger[_0x75fc('0xd')](_0x75fc('0x2c'));return request({'uri':util['format'](_0x75fc('0x29'),_0x57b6dc[_0x75fc('0x1b')]),'method':_0x75fc('0x1c'),'body':{'name':_0x228a16,'phone':_0x3d39d4}})[_0x75fc('0x1d')](function(_0x7d76e4){logger[_0x75fc('0xd')](_0x75fc('0x2d'));return _0x7d76e4;});}});}function getAuth(_0x137d3d){return util[_0x75fc('0xe')](_0x75fc('0x2e'),new Buffer(_0x137d3d['apiKey']+':X')[_0x75fc('0x2f')]('base64'));}function request(_0x57ea57){logger[_0x75fc('0x30')](_0x75fc('0x31'),JSON[_0x75fc('0x32')](_0x57ea57));return rp(_['defaults'](_0x57ea57,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x17da77,_0x4e4da8){var _0xee56fc=[];if(_0x17da77&&_0x17da77[_0x75fc('0x20')]>0x0){_0xee56fc=_[_0x75fc('0x33')](_0x17da77,_0x4e4da8);}return _0xee56fc;}function getCustomFields(_0x37f062,_0x272f75){var _0x109d0d=[];var _0x4045e6={'custom_fields':[]};if(_0x37f062['length']>0x0){_[_0x75fc('0x34')](_0x37f062,function(_0x339847){if(_['includes']([_0x75fc('0x35'),'picklist'],_0x339847[_0x75fc('0x36')])&&_0x339847[_0x75fc('0x37')]&&!_0x339847[_0x75fc('0x38')]){_0x4045e6[_0x339847['nameField']['toLowerCase']()]=_0x339847[_0x75fc('0x39')][_0x75fc('0x2f')]();}else if(_['includes']([_0x75fc('0x35'),_0x75fc('0x3a')],_0x339847['type'])&&_0x339847['idField']&&_0x339847['customField']){_0x4045e6[_0x75fc('0x17')]['push']({'id':_0x339847[_0x75fc('0x3b')],'value':_0x339847[_0x75fc('0x39')]['toString']()});}else if(_0x339847['type']===_0x75fc('0x3c')&&_0x339847[_0x75fc('0x3d')]&&_0x339847['idField']&&_0x339847[_0x75fc('0x38')]){_0x272f75[_0x339847[_0x75fc('0x3d')]]&&_0x4045e6[_0x75fc('0x17')][_0x75fc('0x3e')]({'id':_0x339847[_0x75fc('0x3b')],'value':_0x272f75[_0x339847[_0x75fc('0x3d')]][_0x75fc('0x2f')]()});}else if(_0x339847[_0x75fc('0x36')]===_0x75fc('0x3f')&&_0x339847[_0x75fc('0x40')]&&_0x339847[_0x75fc('0x40')][_0x75fc('0x41')]&&_0x339847[_0x75fc('0x3b')]&&_0x339847[_0x75fc('0x38')]){_0x272f75[_0x339847[_0x75fc('0x40')][_0x75fc('0x41')]['toLowerCase']()]&&_0x4045e6[_0x75fc('0x17')][_0x75fc('0x3e')]({'id':_0x339847[_0x75fc('0x3b')],'value':_0x272f75[_0x339847[_0x75fc('0x40')][_0x75fc('0x41')][_0x75fc('0x42')]()][_0x75fc('0x2f')]()});}});}return _0x4045e6;}exports[_0x75fc('0x43')]=function(_0xefa17,_0x47cb25,_0x35444b,_0x35487a,_0x3ec231,_0x32c999){var _0x1b2884,_0xf6d64a;_0x32c999['remoteUri']=intUtil['stripTrailingSlash'](_0x32c999[_0x75fc('0x1b')]);_0x32c999[_0x75fc('0x44')]=intUtil[_0x75fc('0x45')](_0x32c999[_0x75fc('0x44')]);if(_0x3ec231&&_0x3ec231[_0x75fc('0x46')]){logger[_0x75fc('0xd')]('[QUEUE]',_0x75fc('0x47'));_0x47cb25['recordingURL']=util[_0x75fc('0xe')](_0x75fc('0x48'),_0x32c999['serverUrl'],_0x47cb25[_0x75fc('0x49')],md5(_0x47cb25['uniqueid']));}else{_0x47cb25[_0x75fc('0x4a')]='';}headers[_0x75fc('0x4b')]=getAuth(_0x32c999);return getUser(_0x32c999,_0x35487a[_0x75fc('0x23')])[_0x75fc('0x1d')](function(_0x77c2f3){_0x1b2884=_0x77c2f3;logger[_0x75fc('0xd')]('The\x20User\x20ID\x20is:',_0x1b2884['id']);return getEndUser(_0x32c999,_0x47cb25['calleridname'],_0x47cb25['calleridnum']);})['then'](function(_0x52d959){_0xf6d64a=_0x52d959;logger[_0x75fc('0xd')](_0x75fc('0x4c'),_0xf6d64a['id']);return getTicket(_0x32c999,_0x1b2884,_0xf6d64a,_0x35444b,_0x47cb25);})['then'](function(_0x341a04){if(_0x341a04&&_0x341a04['id']){logger['info'](_0x75fc('0x4d'));logger[_0x75fc('0xd')](_0x75fc('0x4e'),_0x341a04['id']);logger['info'](_0x75fc('0x4f'),_0x75fc('0x50'));emit(util['format'](_0x75fc('0x51'),_0x35487a[_0x75fc('0x41')]),_0x75fc('0x52'),{'uri':util[_0x75fc('0xe')]('%s/helpdesk/tickets/%d',_0x32c999['remoteUri'],_0x341a04['id'])});}})[_0x75fc('0x53')](function(_0xee3cd8){logger['error'](_0x75fc('0x4f'),JSON[_0x75fc('0x32')](_0xee3cd8));});};exports[_0x75fc('0x54')]=function(_0x1ce991,_0x1718f7,_0x3824a2,_0x3c280a,_0x2dff1e,_0x2f6e16,_0x28a5c0){var _0x28a403,_0x1c94c6;_0x2f6e16[_0x75fc('0x1b')]=intUtil[_0x75fc('0x45')](_0x2f6e16[_0x75fc('0x1b')]);_0x2f6e16[_0x75fc('0x44')]=intUtil[_0x75fc('0x45')](_0x2f6e16[_0x75fc('0x44')]);if(_0x28a5c0&&_0x28a5c0[_0x75fc('0x55')]&&_0x28a5c0[_0x75fc('0x55')]!==_0x75fc('0x56')){logger[_0x75fc('0xd')](_0x75fc('0x57'),'Recording\x20is\x20enabled!');_0x1718f7[_0x75fc('0x4a')]=util[_0x75fc('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2f6e16[_0x75fc('0x44')],_0x1718f7[_0x75fc('0x49')],md5(_0x1718f7[_0x75fc('0x49')]));}headers[_0x75fc('0x4b')]=getAuth(_0x2f6e16);return getUser(_0x2f6e16,_0x3c280a['email'])['then'](function(_0x1899c8){_0x28a403=_0x1899c8;logger['info'](_0x75fc('0x58'),_0x28a403['id']);return getEndUser(_0x2f6e16,_0x1718f7['destcalleridname'],_0x1718f7[_0x75fc('0x59')]);})[_0x75fc('0x1d')](function(_0x2eaa79){_0x1c94c6=_0x2eaa79;logger['info'](_0x75fc('0x4c'),_0x1c94c6['id']);return getTicket(_0x2f6e16,_0x28a403,_0x1c94c6,_0x3824a2,_0x1718f7);})[_0x75fc('0x1d')](function(_0x4a9b88){if(_0x4a9b88&&_0x4a9b88['id']){logger[_0x75fc('0xd')]('Ticket\x20created!');logger[_0x75fc('0xd')](_0x75fc('0x4e'),_0x4a9b88['id']);logger[_0x75fc('0xd')](_0x75fc('0x57'),_0x75fc('0x50'));emit(util[_0x75fc('0xe')](_0x75fc('0x51'),_0x3c280a[_0x75fc('0x41')]),_0x75fc('0x52'),{'uri':util[_0x75fc('0xe')](_0x75fc('0x5a'),_0x2f6e16[_0x75fc('0x1b')],_0x4a9b88['id'])});}})[_0x75fc('0x53')](function(_0x781be9){logger[_0x75fc('0x5b')]('[OUTBOUND]',JSON[_0x75fc('0x32')](_0x781be9));});};exports[_0x75fc('0x5c')]=function(_0x586e11,_0x47050f,_0x151b15,_0x33d4fd,_0x442099,_0x2bef7e){var _0x443276,_0x1da4a5;_0x2bef7e[_0x75fc('0x1b')]=intUtil[_0x75fc('0x45')](_0x2bef7e['remoteUri']);_0x2bef7e[_0x75fc('0x44')]=intUtil[_0x75fc('0x45')](_0x2bef7e[_0x75fc('0x44')]);if(_0x442099&&_0x442099[_0x75fc('0x46')]){logger[_0x75fc('0xd')]('['+_0x47050f[_0x75fc('0x5d')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x47050f[_0x75fc('0x4a')]=util[_0x75fc('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2bef7e[_0x75fc('0x44')],_0x47050f['uniqueid'],md5(_0x47050f[_0x75fc('0x49')]));}else{_0x47050f[_0x75fc('0x4a')]='';}headers['Authorization']=getAuth(_0x2bef7e);return getUser(_0x2bef7e,'')[_0x75fc('0x1d')](function(_0xa08b66){_0x443276=_0xa08b66;logger['info']('The\x20User\x20ID\x20is:',_0x443276['id']);return getEndUser(_0x2bef7e,_0x47050f[_0x75fc('0x10')],_0x47050f['calleridnum']);})[_0x75fc('0x1d')](function(_0x4ae576){_0x1da4a5=_0x4ae576;logger[_0x75fc('0xd')](_0x75fc('0x4c'),_0x1da4a5['id']);return getTicket(_0x2bef7e,_0x443276,_0x1da4a5,_0x151b15,_0x47050f);})[_0x75fc('0x1d')](function(_0x54f74b){if(_0x54f74b){logger[_0x75fc('0xd')](_0x75fc('0x4d'));logger[_0x75fc('0xd')](_0x75fc('0x4e'),_0x54f74b['id']);}})[_0x75fc('0x53')](function(_0x21d8fb){logger['error']('['+_0x47050f['lastevent']['toUpperCase']()+']',JSON[_0x75fc('0x32')](_0x21d8fb));});}; \ 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 49cc7f5..aa2e78f 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 _0x1fd6=['contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','contact','Creating\x20new\x20task','/api/tasks','getString','Descriptions','Contact','ticketId','task','/contacts/','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','toLowerCase','destcalleridnum','queue','unmanaged','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','request-promise','md5','util','moment','bluebird','ioredis','../../../../config/logger','freshsales','redis','localhost','socket.io-emitter','GET','headers','info','Getting\x20admin\x20information','users','length','email','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','message','/api/selector/owners','then','agentEmail','userEmail','userId','User\x20found:','Admin\x20selected','adminEmail','toUpperCase','/api/lookup?q=','&f=','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s'];(function(_0x319dfe,_0x49b997){var _0x3c5996=function(_0x22f7cb){while(--_0x22f7cb){_0x319dfe['push'](_0x319dfe['shift']());}};_0x3c5996(++_0x49b997);}(_0x1fd6,0xcf));var _0x61fd=function(_0x42dfcf,_0x2672c7){_0x42dfcf=_0x42dfcf-0x0;var _0x2e1d0e=_0x1fd6[_0x42dfcf];return _0x2e1d0e;};'use strict';var _=require('lodash');var rp=require(_0x61fd('0x0'));var md5=require(_0x61fd('0x1'));var util=require(_0x61fd('0x2'));var moment=require(_0x61fd('0x3'));var Promise=require(_0x61fd('0x4'));var Redis=require(_0x61fd('0x5'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x61fd('0x6'))(_0x61fd('0x7'));config[_0x61fd('0x8')]=_['defaults'](config[_0x61fd('0x8')],{'host':_0x61fd('0x9'),'port':0x18eb});var io=require(_0x61fd('0xa'))(new Redis(config[_0x61fd('0x8')]));function getAdminId(_0x5a8d99,_0x3d337a,_0x13d526,_0x328058){return new Promise(function(_0x3026ca,_0x3b2af0){var _0x502049=![];var _0x4604eb={'method':_0x61fd('0xb'),'uri':_0x328058+'/api/selector/owners','json':!![]};_0x4604eb[_0x61fd('0xc')]=_0x13d526;logger[_0x61fd('0xd')](_0x61fd('0xe'));return rp(_0x4604eb)['then'](function(_0xf6dd36){if(_0xf6dd36){var _0x177a2c=_0xf6dd36[_0x61fd('0xf')];var _0x417281=null;for(_0x417281=0x0;_0x417281<_0x177a2c[_0x61fd('0x10')];_0x417281++){if(_0x177a2c[_0x417281][_0x61fd('0x11')]===_0x5a8d99['adminEmail']){_0x5a8d99[_0x61fd('0x12')]=_0x177a2c[_0x417281]['id'];_0x502049=!![];}}if(_0x502049){logger[_0x61fd('0xd')](_0x61fd('0x13'),_0x5a8d99[_0x61fd('0x12')]);_0x3026ca(_0x5a8d99);}else{_0x3b2af0({'statusCode':0x194,'message':_0x61fd('0x14')});}}else{_0x3b2af0({'statusCode':0x194,'message':_0x61fd('0x14')});}})[_0x61fd('0x15')](function(_0x86b44b){logger[_0x61fd('0x16')]('['+[_0x3d337a['toUpperCase']()]+']',_0x86b44b[_0x61fd('0x17')]);_0x3b2af0(_0x86b44b);});});}function getUser(_0xb95b17,_0x476317,_0x2555c1){return function(_0x2862c9){return new Promise(function(_0xae8f8c,_0x349481){var _0x9cde79={'method':'GET','uri':_0x2555c1+_0x61fd('0x18'),'json':!![]};_0x9cde79[_0x61fd('0xc')]=_0x476317;logger[_0x61fd('0xd')]('Getting\x20user\x20list');return rp(_0x9cde79)[_0x61fd('0x19')](function(_0x5567b6){if(_0x5567b6){var _0x4a70be=_0x5567b6[_0x61fd('0xf')];var _0x367a8a=![];var _0x21e46d=null;if(_0x2862c9[_0x61fd('0x1a')]!==null){logger[_0x61fd('0xd')]('Getting\x20user\x20with\x20email',_0x2862c9[_0x61fd('0x1a')]);_0x2862c9[_0x61fd('0x1b')]=_0x2862c9[_0x61fd('0x1a')];for(_0x21e46d=0x0;_0x21e46d<_0x4a70be[_0x61fd('0x10')];_0x21e46d++){if(_0x4a70be[_0x21e46d]['email']===_0x2862c9[_0x61fd('0x1a')]){_0x367a8a=!![];_0x2862c9[_0x61fd('0x1c')]=_0x4a70be[_0x21e46d]['id'];logger[_0x61fd('0xd')](_0x61fd('0x1d'),_0x2862c9['userId']);}}}if(!_0x367a8a){logger[_0x61fd('0xd')](_0x61fd('0x1e'));_0x2862c9['userEmail']=_0x2862c9[_0x61fd('0x1f')];_0x2862c9[_0x61fd('0x1c')]=_0x2862c9[_0x61fd('0x12')];_0x367a8a=!![];}if(_0x367a8a){_0xae8f8c(_0x2862c9);}else{_0x349481({'statusCode':0x194,'message':_0x61fd('0x14')});}}else{_0x349481({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x61fd('0x15')](function(_0x1a350b){logger[_0x61fd('0x16')]('['+[_0xb95b17[_0x61fd('0x20')]()]+']',_0x1a350b['message']);_0x349481(_0x1a350b);});});};}function searchContact(_0x4772c8,_0x1e5b23,_0x4442a6,_0x1ea21f){return new Promise(function(_0x231f96,_0x4feee0){var _0x245364={'method':_0x61fd('0xb'),'headers':_0x1e5b23,'uri':_0x4772c8+_0x61fd('0x21')+_0x1ea21f+_0x61fd('0x22')+_0x4442a6+'&entities=contact','json':!![]};rp(_0x245364)[_0x61fd('0x19')](function(_0x26b59e){var _0x66fece=_[_0x61fd('0x23')](_0x26b59e[_0x61fd('0x24')][_0x61fd('0x24')],[_0x4442a6,_0x1ea21f]);_0x231f96(_0x66fece);})[_0x61fd('0x15')](function(_0x4d1123){_0x4feee0(_0x4d1123);});});}function getEndUser(_0x3e6710,_0x15379d,_0x57a8b6){return function(_0x54afb7){return new Promise(function(_0x586c15,_0x2c0c30){logger[_0x61fd('0xd')](util[_0x61fd('0x25')](_0x61fd('0x26'),_0x54afb7[_0x61fd('0x27')]));searchContact(_0x57a8b6,_0x15379d,_0x61fd('0x28'),_0x54afb7[_0x61fd('0x27')])[_0x61fd('0x19')](function(_0x5effd8){if(_0x5effd8){_0x54afb7[_0x61fd('0x29')]=_0x5effd8['id'];logger['info'](_0x61fd('0x2a'),_0x54afb7[_0x61fd('0x29')]);return _0x586c15(_0x54afb7);}searchContact(_0x57a8b6,_0x15379d,_0x61fd('0x2b'),_0x54afb7[_0x61fd('0x27')])['then'](function(_0x3538a6){if(_0x3538a6){_0x54afb7[_0x61fd('0x29')]=_0x3538a6['id'];logger[_0x61fd('0xd')](_0x61fd('0x2c'),_0x54afb7[_0x61fd('0x29')]);return _0x586c15(_0x54afb7);}createEndUser(_0x54afb7,_0x3e6710,_0x15379d,_0x57a8b6)[_0x61fd('0x19')](function(_0x501734){logger[_0x61fd('0xd')](_0x61fd('0x2d'),_0x501734[_0x61fd('0x29')]);return _0x586c15(_0x501734);});});})[_0x61fd('0x15')](function(_0x549459){_0x2c0c30(_0x549459);});});};}function createEndUser(_0x5b6eb1,_0x56c45e,_0x10e1e1,_0x266403){return new Promise(function(_0x2e8700,_0x301ddc){var _0x538659=moment();var _0x1b60ee={'method':_0x61fd('0x2e'),'uri':_0x266403+_0x61fd('0x2f'),'body':{'contact':{'last_name':_0x5b6eb1[_0x61fd('0x27')],'work_number':_0x5b6eb1['contactNumber'],'mobile_number':_0x5b6eb1[_0x61fd('0x27')],'owner_id':_0x5b6eb1[_0x61fd('0x1c')],'created_at':_0x538659[_0x61fd('0x25')](_0x61fd('0x30'))}},'json':!![]};_0x1b60ee[_0x61fd('0xc')]=_0x10e1e1;logger[_0x61fd('0xd')]('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x1b60ee)[_0x61fd('0x19')](function(_0x19e6b3){_0x5b6eb1['endUserId']=_0x19e6b3[_0x61fd('0x31')]['id'];_0x2e8700(_0x5b6eb1);})[_0x61fd('0x15')](function(_0x9bc821){logger[_0x61fd('0x16')]('['+[_0x56c45e[_0x61fd('0x20')]()]+']',_0x9bc821[_0x61fd('0x17')]);_0x301ddc(_0x9bc821[_0x61fd('0x17')]);});});}function getTicket(_0x2ba642,_0x1d456c,_0x2ebfda,_0x4eec64,_0x13a441){return function(_0x298456){logger[_0x61fd('0xd')](_0x61fd('0x32'));return new Promise(function(_0x42b1cb,_0x17cbc1){var _0xce7378=moment();var _0x3dca0a={'method':_0x61fd('0x2e'),'uri':_0x2ebfda+_0x61fd('0x33'),'body':{'title':intUtil[_0x61fd('0x34')](_0x4eec64['Subjects'],_0x13a441,'\x20'),'description':intUtil[_0x61fd('0x34')](_0x4eec64[_0x61fd('0x35')],_0x13a441,'\x0a'),'owner_id':_0x298456[_0x61fd('0x1c')],'creater_id':_0x298456[_0x61fd('0x12')],'targetable_id':_0x298456[_0x61fd('0x29')],'targetable_type':_0x61fd('0x36'),'created_at':_0xce7378[_0x61fd('0x25')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0xce7378['add'](0x1e,'m')['format']('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x3dca0a[_0x61fd('0xc')]=_0x1d456c;return rp(_0x3dca0a)[_0x61fd('0x19')](function(_0x57bdce){_0x298456[_0x61fd('0x37')]=_0x57bdce[_0x61fd('0x38')]['id'];logger[_0x61fd('0xd')]('Task\x20created:',_0x298456[_0x61fd('0x37')]);_0x42b1cb(_0x298456);})['catch'](function(_0x2d69fe){logger['error']('['+[_0x2ba642[_0x61fd('0x20')]()]+']',_0x2d69fe[_0x61fd('0x17')]);_0x17cbc1(_0x2d69fe[_0x61fd('0x17')]);});});};}function emit(_0x66ad43,_0x267c33,_0x4f7fc7){var _0xa5e9b0={'uri':_0x66ad43+_0x61fd('0x39')+_0x4f7fc7};io['to'](util[_0x61fd('0x25')]('user:%s',_0x267c33))[_0x61fd('0x3a')](_0x61fd('0x3b'),_0xa5e9b0);}exports['cs']=function(_0x59c7f3,_0x3d75d2,_0x45d5ed,_0x22e47b,_0x22953e,_0x37f5df,_0x496060,_0x158e0c){var _0x412deb={};var _0x202a13={'Authorization':_0x61fd('0x3c')+_0x37f5df[_0x61fd('0x3d')]};_0x37f5df[_0x61fd('0x3e')]=intUtil[_0x61fd('0x3f')](_0x37f5df[_0x61fd('0x3e')]);_0x37f5df[_0x61fd('0x40')]=intUtil[_0x61fd('0x3f')](_0x37f5df[_0x61fd('0x40')]);var _0x314ded=_0x37f5df['remoteUri'];_0x412deb[_0x61fd('0x1f')]=_0x37f5df['username'];_0x412deb[_0x61fd('0x27')]=_0x158e0c[_0x61fd('0x41')]()==='outbound'?_0x3d75d2[_0x61fd('0x42')]:_0x3d75d2['calleridnum'];_0x412deb['callDirection']=_0x158e0c===_0x61fd('0x43')||_0x158e0c===_0x61fd('0x44')?_0x61fd('0x43'):_0x61fd('0x45');if(_0x22e47b){_0x412deb[_0x61fd('0x1a')]=_0x22e47b[_0x61fd('0x11')];}var _0x18b814=util[_0x61fd('0x25')](_0x61fd('0x46'),_0x37f5df[_0x61fd('0x40')],_0x3d75d2[_0x61fd('0x47')],md5(_0x3d75d2[_0x61fd('0x47')]));if(_0x22953e&&_0x22953e['monitor_format']){logger[_0x61fd('0xd')](_0x61fd('0x48'),_0x61fd('0x49'));_0x3d75d2[_0x61fd('0x4a')]=_0x18b814;}else if(_0x496060&&_0x496060[_0x61fd('0x4b')]&&_0x496060['recordingFormat']!=='none'){logger[_0x61fd('0xd')](_0x61fd('0x4c'),_0x61fd('0x49'));_0x3d75d2[_0x61fd('0x4a')]=_0x18b814;}else{_0x3d75d2[_0x61fd('0x4a')]='';}return getAdminId(_0x412deb,_0x158e0c,_0x202a13,_0x314ded)['then'](getUser(_0x158e0c,_0x202a13,_0x314ded))[_0x61fd('0x19')](getEndUser(_0x158e0c,_0x202a13,_0x314ded))[_0x61fd('0x19')](getTicket(_0x158e0c,_0x202a13,_0x314ded,_0x45d5ed,_0x3d75d2))['then'](function(_0x7e1ae1){logger[_0x61fd('0xd')](util[_0x61fd('0x25')](_0x61fd('0x4d'),_0x7e1ae1['ticketId']));if(_0x158e0c!==_0x61fd('0x44')){logger[_0x61fd('0xd')]('['+[_0x158e0c['toUpperCase']()]+']',_0x61fd('0x4e'));emit(_0x314ded,_0x22e47b[_0x61fd('0x4f')],_0x7e1ae1[_0x61fd('0x29')]);}})[_0x61fd('0x15')](function(_0x5d0ef8){logger[_0x61fd('0x16')]('['+[_0x158e0c['toUpperCase']()]+_0x61fd('0x50'),util[_0x61fd('0x51')](_0x5d0ef8,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xec42=['redis','localhost','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','users','length','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','message','agentEmail','Getting\x20user\x20with\x20email','userEmail','email','userId','Admin\x20selected','adminEmail','toUpperCase','/api/lookup?q=','&f=','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20created:','POST','/api/contacts','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','getString','Subjects','Contact','YYYY-MM-DDTHH:mm:ss','add','ticketId','task','Task\x20created:','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','recordingURL','name',']\x20Error\x20running\x20Freshsales\x20integration','lodash','request-promise','md5','util','moment','bluebird','ioredis','../../../../config/logger','freshsales'];(function(_0x4fbb38,_0x7725b0){var _0x56c193=function(_0x590c8d){while(--_0x590c8d){_0x4fbb38['push'](_0x4fbb38['shift']());}};_0x56c193(++_0x7725b0);}(_0xec42,0x1ef));var _0x2ec4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xec42[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2ec4('0x0'));var rp=require(_0x2ec4('0x1'));var md5=require(_0x2ec4('0x2'));var util=require(_0x2ec4('0x3'));var moment=require(_0x2ec4('0x4'));var Promise=require(_0x2ec4('0x5'));var Redis=require(_0x2ec4('0x6'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x2ec4('0x7'))(_0x2ec4('0x8'));config[_0x2ec4('0x9')]=_['defaults'](config[_0x2ec4('0x9')],{'host':_0x2ec4('0xa'),'port':0x18eb});var io=require(_0x2ec4('0xb'))(new Redis(config[_0x2ec4('0x9')]));function getAdminId(_0x5458f2,_0x56e54a,_0x45e242,_0x1dac39){return new Promise(function(_0x143dbe,_0x305f06){var _0x5c3171=![];var _0x64acc={'method':_0x2ec4('0xc'),'uri':_0x1dac39+_0x2ec4('0xd'),'json':!![]};_0x64acc[_0x2ec4('0xe')]=_0x45e242;logger[_0x2ec4('0xf')](_0x2ec4('0x10'));return rp(_0x64acc)[_0x2ec4('0x11')](function(_0x3051c4){if(_0x3051c4){var _0x491fc4=_0x3051c4[_0x2ec4('0x12')];var _0x17265c=null;for(_0x17265c=0x0;_0x17265c<_0x491fc4[_0x2ec4('0x13')];_0x17265c++){if(_0x491fc4[_0x17265c]['email']===_0x5458f2['adminEmail']){_0x5458f2[_0x2ec4('0x14')]=_0x491fc4[_0x17265c]['id'];_0x5c3171=!![];}}if(_0x5c3171){logger[_0x2ec4('0xf')](_0x2ec4('0x15'),_0x5458f2[_0x2ec4('0x14')]);_0x143dbe(_0x5458f2);}else{_0x305f06({'statusCode':0x194,'message':_0x2ec4('0x16')});}}else{_0x305f06({'statusCode':0x194,'message':_0x2ec4('0x16')});}})[_0x2ec4('0x17')](function(_0x2101f5){logger[_0x2ec4('0x18')]('['+[_0x56e54a['toUpperCase']()]+']',_0x2101f5[_0x2ec4('0x19')]);_0x305f06(_0x2101f5);});});}function getUser(_0x53e468,_0x194879,_0x324d20){return function(_0x269562){return new Promise(function(_0x67cc61,_0x5218e3){var _0x2b0915={'method':_0x2ec4('0xc'),'uri':_0x324d20+'/api/selector/owners','json':!![]};_0x2b0915['headers']=_0x194879;logger[_0x2ec4('0xf')]('Getting\x20user\x20list');return rp(_0x2b0915)[_0x2ec4('0x11')](function(_0x21b49a){if(_0x21b49a){var _0x3256ee=_0x21b49a['users'];var _0x351d24=![];var _0x631913=null;if(_0x269562[_0x2ec4('0x1a')]!==null){logger['info'](_0x2ec4('0x1b'),_0x269562['agentEmail']);_0x269562[_0x2ec4('0x1c')]=_0x269562[_0x2ec4('0x1a')];for(_0x631913=0x0;_0x631913<_0x3256ee['length'];_0x631913++){if(_0x3256ee[_0x631913][_0x2ec4('0x1d')]===_0x269562['agentEmail']){_0x351d24=!![];_0x269562[_0x2ec4('0x1e')]=_0x3256ee[_0x631913]['id'];logger['info']('User\x20found:',_0x269562[_0x2ec4('0x1e')]);}}}if(!_0x351d24){logger[_0x2ec4('0xf')](_0x2ec4('0x1f'));_0x269562[_0x2ec4('0x1c')]=_0x269562[_0x2ec4('0x20')];_0x269562[_0x2ec4('0x1e')]=_0x269562['adminId'];_0x351d24=!![];}if(_0x351d24){_0x67cc61(_0x269562);}else{_0x5218e3({'statusCode':0x194,'message':_0x2ec4('0x16')});}}else{_0x5218e3({'statusCode':0x194,'message':_0x2ec4('0x16')});}})[_0x2ec4('0x17')](function(_0x4dae34){logger['error']('['+[_0x53e468[_0x2ec4('0x21')]()]+']',_0x4dae34[_0x2ec4('0x19')]);_0x5218e3(_0x4dae34);});});};}function searchContact(_0x3eea4b,_0x3a52ec,_0x430daf,_0xaa4a1a){return new Promise(function(_0x12ebd5,_0x3b0d8d){var _0x3c00d3={'method':_0x2ec4('0xc'),'headers':_0x3a52ec,'uri':_0x3eea4b+_0x2ec4('0x22')+_0xaa4a1a+_0x2ec4('0x23')+_0x430daf+'&entities=contact','json':!![]};rp(_0x3c00d3)[_0x2ec4('0x11')](function(_0x104568){var _0x3bd071=_[_0x2ec4('0x24')](_0x104568[_0x2ec4('0x25')][_0x2ec4('0x25')],[_0x430daf,_0xaa4a1a]);_0x12ebd5(_0x3bd071);})[_0x2ec4('0x17')](function(_0xb229de){_0x3b0d8d(_0xb229de);});});}function getEndUser(_0x344344,_0x5f1327,_0x2a6d7c){return function(_0x3340d7){return new Promise(function(_0x43cee9,_0xc66133){logger['info'](util[_0x2ec4('0x26')](_0x2ec4('0x27'),_0x3340d7[_0x2ec4('0x28')]));searchContact(_0x2a6d7c,_0x5f1327,_0x2ec4('0x29'),_0x3340d7['contactNumber'])['then'](function(_0x5aad8d){if(_0x5aad8d){_0x3340d7[_0x2ec4('0x2a')]=_0x5aad8d['id'];logger[_0x2ec4('0xf')](_0x2ec4('0x2b'),_0x3340d7['endUserId']);return _0x43cee9(_0x3340d7);}searchContact(_0x2a6d7c,_0x5f1327,_0x2ec4('0x2c'),_0x3340d7[_0x2ec4('0x28')])[_0x2ec4('0x11')](function(_0x25d07c){if(_0x25d07c){_0x3340d7[_0x2ec4('0x2a')]=_0x25d07c['id'];logger['info']('Contact\x20found\x20work_number:',_0x3340d7[_0x2ec4('0x2a')]);return _0x43cee9(_0x3340d7);}createEndUser(_0x3340d7,_0x344344,_0x5f1327,_0x2a6d7c)[_0x2ec4('0x11')](function(_0x5c3027){logger[_0x2ec4('0xf')](_0x2ec4('0x2d'),_0x5c3027[_0x2ec4('0x2a')]);return _0x43cee9(_0x5c3027);});});})[_0x2ec4('0x17')](function(_0x1c35c6){_0xc66133(_0x1c35c6);});});};}function createEndUser(_0xcf6755,_0x52d2cc,_0x488e6e,_0x89f4d6){return new Promise(function(_0x2279c8,_0x242feb){var _0x346b76=moment();var _0x150dc1={'method':_0x2ec4('0x2e'),'uri':_0x89f4d6+_0x2ec4('0x2f'),'body':{'contact':{'last_name':_0xcf6755['contactNumber'],'work_number':_0xcf6755[_0x2ec4('0x28')],'mobile_number':_0xcf6755[_0x2ec4('0x28')],'owner_id':_0xcf6755['userId'],'created_at':_0x346b76[_0x2ec4('0x26')]('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x150dc1[_0x2ec4('0xe')]=_0x488e6e;logger[_0x2ec4('0xf')](_0x2ec4('0x30'));return rp(_0x150dc1)['then'](function(_0x4da1c1){_0xcf6755[_0x2ec4('0x2a')]=_0x4da1c1[_0x2ec4('0x31')]['id'];_0x2279c8(_0xcf6755);})[_0x2ec4('0x17')](function(_0x3bb172){logger[_0x2ec4('0x18')]('['+[_0x52d2cc[_0x2ec4('0x21')]()]+']',_0x3bb172[_0x2ec4('0x19')]);_0x242feb(_0x3bb172[_0x2ec4('0x19')]);});});}function getTicket(_0x1eb513,_0x232d8a,_0x1c506e,_0x377dde,_0x2fcafd){return function(_0x1778c9){logger[_0x2ec4('0xf')](_0x2ec4('0x32'));return new Promise(function(_0x38a326,_0x343b22){var _0x354a07=moment();var _0x399e33={'method':'POST','uri':_0x1c506e+'/api/tasks','body':{'title':intUtil[_0x2ec4('0x33')](_0x377dde[_0x2ec4('0x34')],_0x2fcafd,'\x20'),'description':intUtil['getString'](_0x377dde['Descriptions'],_0x2fcafd,'\x0a'),'owner_id':_0x1778c9[_0x2ec4('0x1e')],'creater_id':_0x1778c9[_0x2ec4('0x14')],'targetable_id':_0x1778c9[_0x2ec4('0x2a')],'targetable_type':_0x2ec4('0x35'),'created_at':_0x354a07[_0x2ec4('0x26')](_0x2ec4('0x36')),'due_date':_0x354a07[_0x2ec4('0x37')](0x1e,'m')[_0x2ec4('0x26')](_0x2ec4('0x36'))},'json':!![]};_0x399e33[_0x2ec4('0xe')]=_0x232d8a;return rp(_0x399e33)[_0x2ec4('0x11')](function(_0x2401bc){_0x1778c9[_0x2ec4('0x38')]=_0x2401bc[_0x2ec4('0x39')]['id'];logger[_0x2ec4('0xf')](_0x2ec4('0x3a'),_0x1778c9[_0x2ec4('0x38')]);_0x38a326(_0x1778c9);})[_0x2ec4('0x17')](function(_0x2e8fe8){logger[_0x2ec4('0x18')]('['+[_0x1eb513[_0x2ec4('0x21')]()]+']',_0x2e8fe8[_0x2ec4('0x19')]);_0x343b22(_0x2e8fe8['message']);});});};}function emit(_0x89401d,_0x8e2e43,_0xf24907){var _0x5f5cba={'uri':_0x89401d+_0x2ec4('0x3b')+_0xf24907};io['to'](util['format'](_0x2ec4('0x3c'),_0x8e2e43))[_0x2ec4('0x3d')](_0x2ec4('0x3e'),_0x5f5cba);}exports['cs']=function(_0x44384a,_0x2bd894,_0x1e8ec2,_0x139940,_0x5eaf92,_0x523247,_0x29706a,_0x3d0d01){var _0x189998={};var _0x4447cc={'Authorization':_0x2ec4('0x3f')+_0x523247[_0x2ec4('0x40')]};_0x523247[_0x2ec4('0x41')]=intUtil[_0x2ec4('0x42')](_0x523247[_0x2ec4('0x41')]);_0x523247[_0x2ec4('0x43')]=intUtil['stripTrailingSlash'](_0x523247[_0x2ec4('0x43')]);var _0x174ce5=_0x523247['remoteUri'];_0x189998[_0x2ec4('0x20')]=_0x523247[_0x2ec4('0x44')];_0x189998[_0x2ec4('0x28')]=_0x3d0d01['toLowerCase']()===_0x2ec4('0x45')?_0x2bd894[_0x2ec4('0x46')]:_0x2bd894[_0x2ec4('0x47')];_0x189998[_0x2ec4('0x48')]=_0x3d0d01===_0x2ec4('0x49')||_0x3d0d01===_0x2ec4('0x4a')?_0x2ec4('0x49'):_0x2ec4('0x45');if(_0x139940){_0x189998[_0x2ec4('0x1a')]=_0x139940['email'];}var _0x49be2b=util[_0x2ec4('0x26')](_0x2ec4('0x4b'),_0x523247[_0x2ec4('0x43')],_0x2bd894['uniqueid'],md5(_0x2bd894['uniqueid']));if(_0x5eaf92&&_0x5eaf92[_0x2ec4('0x4c')]){logger['info'](_0x2ec4('0x4d'),_0x2ec4('0x4e'));_0x2bd894['recordingURL']=_0x49be2b;}else if(_0x29706a&&_0x29706a[_0x2ec4('0x4f')]&&_0x29706a['recordingFormat']!==_0x2ec4('0x50')){logger[_0x2ec4('0xf')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x2bd894[_0x2ec4('0x51')]=_0x49be2b;}else{_0x2bd894['recordingURL']='';}return getAdminId(_0x189998,_0x3d0d01,_0x4447cc,_0x174ce5)['then'](getUser(_0x3d0d01,_0x4447cc,_0x174ce5))[_0x2ec4('0x11')](getEndUser(_0x3d0d01,_0x4447cc,_0x174ce5))[_0x2ec4('0x11')](getTicket(_0x3d0d01,_0x4447cc,_0x174ce5,_0x1e8ec2,_0x2bd894))[_0x2ec4('0x11')](function(_0x265d7b){logger[_0x2ec4('0xf')](util[_0x2ec4('0x26')]('The\x20ticket\x20ID\x20is:\x20%s',_0x265d7b[_0x2ec4('0x38')]));if(_0x3d0d01!=='unmanaged'){logger[_0x2ec4('0xf')]('['+[_0x3d0d01[_0x2ec4('0x21')]()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x174ce5,_0x139940[_0x2ec4('0x52')],_0x265d7b[_0x2ec4('0x2a')]);}})[_0x2ec4('0x17')](function(_0x3eed68){logger[_0x2ec4('0x18')]('['+[_0x3d0d01[_0x2ec4('0x21')]()]+_0x2ec4('0x53'),util['inspect'](_0x3eed68,{'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 91c851d..eea8de5 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 _0xc909=['error','[EXEC]','format','%s\x20account\x20#%s\x20not\x20found','./zendesk','./salesforce','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','sugarcrm','vtiger','dynamics365','freshsales','servicenow','exec','includes','data1','toLowerCase','data3','queue','EVENT\x20UNKNOWN','unmanaged','freshdesk','desk','log','../../../../config/logger'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xc909,0xdd));var _0x9c90=function(_0x3e7e96,_0x5683ca){_0x3e7e96=_0x3e7e96-0x0;var _0x13f6f0=_0xc909[_0x3e7e96];return _0x13f6f0;};'use strict';var _=require('lodash');var util=require('util');var zendesk=require(_0x9c90('0x0'));var salesforce=require(_0x9c90('0x1'));var sugarcrm=require('./sugarcrm');var freshdesk=require(_0x9c90('0x2'));var zoho=require(_0x9c90('0x3'));var desk=require(_0x9c90('0x4'));var vtiger=require(_0x9c90('0x5'));var servicenow=require(_0x9c90('0x6'));var dynamics365=require(_0x9c90('0x7'));var freshsales=require(_0x9c90('0x8'));var integrations=[_0x9c90('0x9'),'salesforce',_0x9c90('0xa'),'freshdesk','zoho','desk',_0x9c90('0xb'),_0x9c90('0xc'),_0x9c90('0xd'),_0x9c90('0xe')];exports[_0x9c90('0xf')]=function(_0x468cd0,_0x5378b6,_0x2fe1e9,_0x45d5ff,_0x524a89,_0x25995f){if(_0x2fe1e9){if(_[_0x9c90('0x10')](integrations,_0x468cd0[_0x9c90('0x11')][_0x9c90('0x12')]())){try{var _0x31ab6d=null;var _0x4e045a='';var _0x1d0162=_0x2fe1e9[_0x468cd0[_0x9c90('0x11')][_0x9c90('0x12')]()];if(_0x1d0162){var _0x4ee185=_0x1d0162[_0x468cd0['data2']];if(_0x4ee185){var _0x2ce93f=_['find'](_0x4ee185['Configurations'],{'id':parseInt(_0x468cd0[_0x9c90('0x13')],0xa)});if(_0x2ce93f){if(_0x45d5ff){if(_0x524a89&&_0x5378b6[_0x9c90('0x14')]){_0x4e045a=_0x9c90('0x14');}else if(_0x5378b6['routeId']){_0x4e045a='outbound';}else{console['log'](_0x9c90('0x15'),_0x5378b6);}}else{_0x4e045a=_0x9c90('0x16');}switch(_0x468cd0[_0x9c90('0x11')][_0x9c90('0x12')]()){case _0x9c90('0x9'):zendesk[_0x4e045a](_0x468cd0,_0x5378b6,_0x2ce93f,_0x45d5ff,_0x524a89,_0x4ee185,_0x25995f);break;case'salesforce':salesforce[_0x4e045a](_0x468cd0,_0x5378b6,_0x2ce93f,_0x45d5ff,_0x524a89,_0x4ee185,_0x25995f);break;case _0x9c90('0xa'):sugarcrm[_0x4e045a](_0x468cd0,_0x5378b6,_0x2ce93f,_0x45d5ff,_0x524a89,_0x4ee185,_0x25995f);break;case _0x9c90('0x17'):freshdesk[_0x4e045a](_0x468cd0,_0x5378b6,_0x2ce93f,_0x45d5ff,_0x524a89,_0x4ee185,_0x25995f);break;case'zoho':zoho[_0x4e045a](_0x468cd0,_0x5378b6,_0x2ce93f,_0x45d5ff,_0x524a89,_0x4ee185,_0x25995f);break;case _0x9c90('0x18'):desk[_0x4e045a](_0x468cd0,_0x5378b6,_0x2ce93f,_0x45d5ff,_0x524a89,_0x4ee185,_0x25995f);break;case'vtiger':vtiger[_0x4e045a](_0x468cd0,_0x5378b6,_0x2ce93f,_0x45d5ff,_0x524a89,_0x4ee185,_0x25995f);break;case _0x9c90('0xd'):freshsales['cs'](_0x468cd0,_0x5378b6,_0x2ce93f,_0x45d5ff,_0x524a89,_0x4ee185,_0x25995f,_0x4e045a);break;case'servicenow':servicenow['cs'](_0x468cd0,_0x5378b6,_0x2ce93f,_0x45d5ff,_0x524a89,_0x4ee185,_0x25995f,_0x4e045a);break;case _0x9c90('0xc'):dynamics365['cs'](_0x468cd0,_0x5378b6,_0x2ce93f,_0x45d5ff,_0x524a89,_0x4ee185,_0x25995f,_0x4e045a);break;default:console[_0x9c90('0x19')]('unknown\x20integration');}}else{_0x31ab6d=require(_0x9c90('0x1a'))(_0x468cd0[_0x9c90('0x11')]['toLowerCase']());_0x31ab6d[_0x9c90('0x1b')](_0x9c90('0x1c'),util[_0x9c90('0x1d')]('%s\x20configuration\x20#%s\x20not\x20found',_0x468cd0[_0x9c90('0x11')][_0x9c90('0x12')](),_0x468cd0[_0x9c90('0x13')]));}}else{_0x31ab6d=require(_0x9c90('0x1a'))(_0x468cd0[_0x9c90('0x11')][_0x9c90('0x12')]());_0x31ab6d[_0x9c90('0x1b')](_0x9c90('0x1c'),util['format'](_0x9c90('0x1e'),_0x468cd0['data1']['toLowerCase'](),_0x468cd0['data2']));}}else{}}catch(_0x27e219){console[_0x9c90('0x1b')](_0x27e219);}}}}; \ No newline at end of file +var _0x046b=['queue','outbound','EVENT\x20UNKNOWN','unmanaged','unknown\x20integration','error','[EXEC]','data3','../../../../config/logger','format','lodash','util','./zendesk','./salesforce','./freshdesk','./zoho','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','salesforce','sugarcrm','freshdesk','zoho','desk','vtiger','dynamics365','freshsales','exec','includes','data1','toLowerCase','data2','find','Configurations'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x046b,0x1ba));var _0xb046=function(_0xb25c71,_0x184611){_0xb25c71=_0xb25c71-0x0;var _0x4ad3a4=_0x046b[_0xb25c71];return _0x4ad3a4;};'use strict';var _=require(_0xb046('0x0'));var util=require(_0xb046('0x1'));var zendesk=require(_0xb046('0x2'));var salesforce=require(_0xb046('0x3'));var sugarcrm=require('./sugarcrm');var freshdesk=require(_0xb046('0x4'));var zoho=require(_0xb046('0x5'));var desk=require('./desk');var vtiger=require(_0xb046('0x6'));var servicenow=require(_0xb046('0x7'));var dynamics365=require(_0xb046('0x8'));var freshsales=require(_0xb046('0x9'));var integrations=[_0xb046('0xa'),_0xb046('0xb'),_0xb046('0xc'),_0xb046('0xd'),_0xb046('0xe'),_0xb046('0xf'),_0xb046('0x10'),_0xb046('0x11'),_0xb046('0x12'),'servicenow'];exports[_0xb046('0x13')]=function(_0x3adc6d,_0x4104f7,_0x322324,_0x19406c,_0x48ffdc,_0x2996b1){if(_0x322324){if(_[_0xb046('0x14')](integrations,_0x3adc6d['data1']['toLowerCase']())){try{var _0x3dfff1=null;var _0x9fda4b='';var _0x2ff4f3=_0x322324[_0x3adc6d[_0xb046('0x15')][_0xb046('0x16')]()];if(_0x2ff4f3){var _0x3ab89a=_0x2ff4f3[_0x3adc6d[_0xb046('0x17')]];if(_0x3ab89a){var _0x1d97b0=_[_0xb046('0x18')](_0x3ab89a[_0xb046('0x19')],{'id':parseInt(_0x3adc6d['data3'],0xa)});if(_0x1d97b0){if(_0x19406c){if(_0x48ffdc&&_0x4104f7[_0xb046('0x1a')]){_0x9fda4b=_0xb046('0x1a');}else if(_0x4104f7['routeId']){_0x9fda4b=_0xb046('0x1b');}else{console['log'](_0xb046('0x1c'),_0x4104f7);}}else{_0x9fda4b=_0xb046('0x1d');}switch(_0x3adc6d[_0xb046('0x15')][_0xb046('0x16')]()){case _0xb046('0xa'):zendesk[_0x9fda4b](_0x3adc6d,_0x4104f7,_0x1d97b0,_0x19406c,_0x48ffdc,_0x3ab89a,_0x2996b1);break;case _0xb046('0xb'):salesforce[_0x9fda4b](_0x3adc6d,_0x4104f7,_0x1d97b0,_0x19406c,_0x48ffdc,_0x3ab89a,_0x2996b1);break;case'sugarcrm':sugarcrm[_0x9fda4b](_0x3adc6d,_0x4104f7,_0x1d97b0,_0x19406c,_0x48ffdc,_0x3ab89a,_0x2996b1);break;case'freshdesk':freshdesk[_0x9fda4b](_0x3adc6d,_0x4104f7,_0x1d97b0,_0x19406c,_0x48ffdc,_0x3ab89a,_0x2996b1);break;case _0xb046('0xe'):zoho[_0x9fda4b](_0x3adc6d,_0x4104f7,_0x1d97b0,_0x19406c,_0x48ffdc,_0x3ab89a,_0x2996b1);break;case _0xb046('0xf'):desk[_0x9fda4b](_0x3adc6d,_0x4104f7,_0x1d97b0,_0x19406c,_0x48ffdc,_0x3ab89a,_0x2996b1);break;case _0xb046('0x10'):vtiger[_0x9fda4b](_0x3adc6d,_0x4104f7,_0x1d97b0,_0x19406c,_0x48ffdc,_0x3ab89a,_0x2996b1);break;case'freshsales':freshsales['cs'](_0x3adc6d,_0x4104f7,_0x1d97b0,_0x19406c,_0x48ffdc,_0x3ab89a,_0x2996b1,_0x9fda4b);break;case'servicenow':servicenow['cs'](_0x3adc6d,_0x4104f7,_0x1d97b0,_0x19406c,_0x48ffdc,_0x3ab89a,_0x2996b1,_0x9fda4b);break;case _0xb046('0x11'):dynamics365['cs'](_0x3adc6d,_0x4104f7,_0x1d97b0,_0x19406c,_0x48ffdc,_0x3ab89a,_0x2996b1,_0x9fda4b);break;default:console['log'](_0xb046('0x1e'));}}else{_0x3dfff1=require('../../../../config/logger')(_0x3adc6d[_0xb046('0x15')][_0xb046('0x16')]());_0x3dfff1[_0xb046('0x1f')](_0xb046('0x20'),util['format']('%s\x20configuration\x20#%s\x20not\x20found',_0x3adc6d['data1'][_0xb046('0x16')](),_0x3adc6d[_0xb046('0x21')]));}}else{_0x3dfff1=require(_0xb046('0x22'))(_0x3adc6d[_0xb046('0x15')][_0xb046('0x16')]());_0x3dfff1[_0xb046('0x1f')]('[EXEC]',util[_0xb046('0x23')]('%s\x20account\x20#%s\x20not\x20found',_0x3adc6d['data1'][_0xb046('0x16')](),_0x3adc6d[_0xb046('0x17')]));}}else{}}catch(_0x1c3638){console[_0xb046('0x1f')](_0x1c3638);}}}}; \ 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 b388ae1..242a843 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 _0xb5c4=['Account','Contact','attributes','type','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','LastName','format','Company','No\x20Company','includes','picklist','idField','variable','variableName','toString','customVariable','Variable','name','toLowerCase','password','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','Connection\x20established.','serverUrl','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:salesforce:display','newTab','user:%s','trigger:browser:url','%s/%s/e','instanceUrl','error','catch','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Fields','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','emit','assign','getString','Subjects','Descriptions','ticketType','ActivityDate','IsReminderSet','endUserType','contact','lead','WhoId','WhatId','Case','ContactId','account','AccountId','leadId','info','sobject','create','isNil','User','find','execute','then','Email','Agent\x20%s\x20found.','resolve','Name','user_id','display_name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','length','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0xb5c4,0x1c2));var _0x4b5c=function(_0x1a1e8c,_0x3d2df3){_0x1a1e8c=_0x1a1e8c-0x0;var _0x29b0c9=_0xb5c4[_0x1a1e8c];return _0x29b0c9;};'use strict';var _=require(_0x4b5c('0x0'));var rp=require(_0x4b5c('0x1'));var moment=require(_0x4b5c('0x2'));var BPromise=require(_0x4b5c('0x3'));var md5=require(_0x4b5c('0x4'));var jsforce=require('jsforce');var util=require(_0x4b5c('0x5'));var Redis=require(_0x4b5c('0x6'));var intUtil=require(_0x4b5c('0x7'));var config=require(_0x4b5c('0x8'));var logger=require(_0x4b5c('0x9'))(_0x4b5c('0xa'));config[_0x4b5c('0xb')]=_[_0x4b5c('0xc')](config['redis'],{'host':_0x4b5c('0xd'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x4b5c('0xb')]));function emit(_0x106124,_0x196f84,_0xc1503){io['to'](_0x106124)[_0x4b5c('0xe')](_0x196f84,_0xc1503);}function getTicket(_0x3360d9,_0x3b92a4,_0x2c5c93,_0x26e541,_0x335975,_0x5930b1,_0x5d9d1d,_0x32e893){var _0x1b05c7=Object[_0x4b5c('0xf')]({},{'OwnerId':_0x3b92a4['id'],'Subject':intUtil[_0x4b5c('0x10')](_0x26e541[_0x4b5c('0x11')],_0x335975,'\x20'),'Description':intUtil[_0x4b5c('0x10')](_0x26e541[_0x4b5c('0x12')],_0x335975,'\x0a')},getCustomFields(_0x5930b1,_0x335975));if(_0x2c5c93){if(_0x26e541[_0x4b5c('0x13')]==='Task'){_0x1b05c7[_0x4b5c('0x14')]=moment['utc']();_0x1b05c7[_0x4b5c('0x15')]=![];_0x1b05c7['IsRecurrence']=![];if(_0x2c5c93[_0x4b5c('0x16')]===_0x4b5c('0x17')||_0x2c5c93[_0x4b5c('0x16')]===_0x4b5c('0x18')){_0x1b05c7[_0x4b5c('0x19')]=_0x2c5c93['id'];}else if(_0x2c5c93[_0x4b5c('0x16')]==='account'){_0x1b05c7[_0x4b5c('0x1a')]=_0x2c5c93['id'];}}else if(_0x26e541[_0x4b5c('0x13')]===_0x4b5c('0x1b')){if(_0x2c5c93[_0x4b5c('0x16')]===_0x4b5c('0x17')){_0x1b05c7[_0x4b5c('0x1c')]=_0x2c5c93['id'];}else if(_0x2c5c93[_0x4b5c('0x16')]===_0x4b5c('0x1d')){_0x1b05c7[_0x4b5c('0x1e')]=_0x2c5c93['id'];}else if(_0x2c5c93[_0x4b5c('0x16')]===_0x4b5c('0x18')&&_0x26e541['leadId']){_0x1b05c7[_0x26e541[_0x4b5c('0x1f')]]=_0x2c5c93['id'];}else{logger[_0x4b5c('0x20')]('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x5d9d1d[_0x4b5c('0x21')](_0x26e541['ticketType'])[_0x4b5c('0x22')](_0x1b05c7);}function getUser(_0x5b0a5d,_0xff267d,_0x5b83d3){if(!_[_0x4b5c('0x23')](_0xff267d)&&intUtil['validateEmail'](_0xff267d)){var _0x49220f={'Email':_0xff267d};var _0x4f97fa={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x5b83d3[_0x4b5c('0x21')](_0x4b5c('0x24'))[_0x4b5c('0x25')](_0x49220f,_0x4f97fa)[_0x4b5c('0x26')]()[_0x4b5c('0x27')](function(_0xe3d994){if(_0xe3d994['length']){var _0x1b0c90=_[_0x4b5c('0x25')](_0xe3d994,function(_0x57282d){return _0x57282d[_0x4b5c('0x28')]===_0xff267d;});if(_0x1b0c90){logger['info'](_0x4b5c('0x29'),_0xff267d);return BPromise[_0x4b5c('0x2a')]({'id':_0x1b0c90['Id'],'name':_0x1b0c90[_0x4b5c('0x2b')]});}}else{logger[_0x4b5c('0x20')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0xff267d);return _0x5b83d3['identity']()[_0x4b5c('0x27')](function(_0x4d59e8){return BPromise[_0x4b5c('0x2a')]({'id':_0x4d59e8[_0x4b5c('0x2c')],'name':_0x4d59e8[_0x4b5c('0x2d')]});});}});}else{logger[_0x4b5c('0x20')](_0x4b5c('0x2e'),_0xff267d);return _0x5b83d3['identity']()[_0x4b5c('0x27')](function(_0x3b55f9){return BPromise[_0x4b5c('0x2a')]({'id':_0x3b55f9['user_id'],'name':_0x3b55f9[_0x4b5c('0x2d')]});});}}function getEndUser(_0x37f44b,_0x178a3e,_0x517829,_0x53cad3,_0x581bd4){var _0x11b052={'$or':{'Phone':_0x53cad3}};var _0x22db7f={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0x4b5c('0x27')](function(){logger[_0x4b5c('0x20')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x53cad3,_0x178a3e[_0x4b5c('0x2f')]);switch(_0x178a3e[_0x4b5c('0x2f')]){case _0x4b5c('0x30'):var _0x30ad11=_[_0x4b5c('0x31')](_0x11b052);if(_0x178a3e[_0x4b5c('0x32')]){var _0x5049bc={};_0x5049bc[_0x178a3e[_0x4b5c('0x32')]]=_0x53cad3;_[_0x4b5c('0x33')](_0x30ad11[_0x4b5c('0x34')],_0x5049bc);}return _0x581bd4['sobject']('Contact')[_0x4b5c('0x25')](_0x30ad11,_0x22db7f)[_0x4b5c('0x26')]()['then'](function(_0x46c980){if(_0x46c980&&_0x46c980[_0x4b5c('0x35')]){return _0x46c980;}else{var _0x1e5aa8=_['cloneDeep'](_0x11b052);if(_0x178a3e['additionalSearchLead']){var _0x122fe0={};_0x122fe0[_0x178a3e[_0x4b5c('0x36')]]=_0x53cad3;_[_0x4b5c('0x33')](_0x1e5aa8['$or'],_0x122fe0);}return _0x581bd4['sobject'](_0x4b5c('0x37'))[_0x4b5c('0x25')](_0x1e5aa8,_0x22db7f);}});case _0x4b5c('0x38'):var _0x48c62c=_[_0x4b5c('0x31')](_0x11b052);if(_0x178a3e['additionalSearchAccount']){var _0x5049bc={};_0x5049bc[_0x178a3e[_0x4b5c('0x39')]]=_0x53cad3;_[_0x4b5c('0x33')](_0x48c62c[_0x4b5c('0x34')],_0x5049bc);}return _0x581bd4[_0x4b5c('0x21')](_0x4b5c('0x3a'))[_0x4b5c('0x25')](_0x48c62c,_0x22db7f)[_0x4b5c('0x26')]()[_0x4b5c('0x27')](function(_0x38403a){if(_0x38403a&&_0x38403a[_0x4b5c('0x35')]){return _0x38403a;}else{var _0x4945ae=_['cloneDeep'](_0x11b052);if(_0x178a3e['additionalSearchContact']){var _0x699bdb={};_0x699bdb[_0x178a3e[_0x4b5c('0x32')]]=_0x53cad3;_[_0x4b5c('0x33')](_0x4945ae[_0x4b5c('0x34')],_0x699bdb);}return _0x581bd4[_0x4b5c('0x21')](_0x4b5c('0x3b'))[_0x4b5c('0x25')](_0x4945ae,_0x22db7f)[_0x4b5c('0x27')](function(_0x29027a){if(_0x29027a&&_0x29027a[_0x4b5c('0x35')]){return _0x29027a;}else{var _0x4564fb=_[_0x4b5c('0x31')](_0x11b052);if(_0x178a3e['additionalSearchLead']){var _0x13932b={};_0x13932b[_0x178a3e[_0x4b5c('0x36')]]=_0x53cad3;_[_0x4b5c('0x33')](_0x4564fb[_0x4b5c('0x34')],_0x13932b);}return _0x581bd4[_0x4b5c('0x21')](_0x4b5c('0x37'))[_0x4b5c('0x25')](_0x4564fb,_0x22db7f);}});}});case _0x4b5c('0x17'):var _0x30ad11=_[_0x4b5c('0x31')](_0x11b052);if(_0x178a3e[_0x4b5c('0x32')]){var _0x5049bc={};_0x5049bc[_0x178a3e[_0x4b5c('0x32')]]=_0x53cad3;_[_0x4b5c('0x33')](_0x30ad11[_0x4b5c('0x34')],_0x5049bc);}return _0x581bd4[_0x4b5c('0x21')](_0x4b5c('0x3b'))['find'](_0x30ad11,_0x22db7f)['execute']();case _0x4b5c('0x18'):var _0x2b9750=_[_0x4b5c('0x31')](_0x11b052);if(_0x178a3e[_0x4b5c('0x36')]){var _0x5049bc={};_0x5049bc[_0x178a3e[_0x4b5c('0x36')]]=_0x53cad3;_['merge'](_0x2b9750[_0x4b5c('0x34')],_0x5049bc);}return _0x581bd4[_0x4b5c('0x21')](_0x4b5c('0x37'))[_0x4b5c('0x25')](_0x2b9750,_0x22db7f);case'account':var _0x48c62c=_['cloneDeep'](_0x11b052);if(_0x178a3e[_0x4b5c('0x39')]){var _0x5049bc={};_0x5049bc[_0x178a3e[_0x4b5c('0x39')]]=_0x53cad3;_[_0x4b5c('0x33')](_0x48c62c['$or'],_0x5049bc);}return _0x581bd4[_0x4b5c('0x21')](_0x4b5c('0x3a'))[_0x4b5c('0x25')](_0x48c62c,_0x22db7f);default:return null;}})[_0x4b5c('0x27')](function(_0x5ace36){if(_0x5ace36&&_0x5ace36[_0x4b5c('0x35')]){var _0x5a9d87=_['first'](_0x5ace36);if(_0x5a9d87){return BPromise[_0x4b5c('0x2a')]({'id':_0x5a9d87['Id'],'name':_0x5a9d87['Name'],'phone':_0x5a9d87['Phone'],'endUserType':_0x5a9d87[_0x4b5c('0x3c')][_0x4b5c('0x3d')]['toLowerCase']()});}}})[_0x4b5c('0x27')](function(_0x9e1ad2){if(_0x9e1ad2){logger[_0x4b5c('0x20')](_0x4b5c('0x3e'),_0x9e1ad2[_0x4b5c('0x16')],_0x53cad3);return BPromise[_0x4b5c('0x2a')](_0x9e1ad2);}else{logger[_0x4b5c('0x20')](_0x4b5c('0x3f'),_0x53cad3);var _0x5d604b={'Phone':_0x53cad3};if(_0x178a3e[_0x4b5c('0x40')]){if(_0x178a3e['moduleCreate']===_0x4b5c('0x17')){logger['info'](_0x4b5c('0x41'),_0x53cad3,_0x178a3e[_0x4b5c('0x40')]);_0x5d604b['LastName']=_0x517829!==_0x4b5c('0x42')?_0x517829:util['format'](_0x4b5c('0x43'),_0x53cad3);}else if(_0x178a3e[_0x4b5c('0x40')]==='lead'){logger[_0x4b5c('0x20')](_0x4b5c('0x41'),_0x53cad3,_0x178a3e[_0x4b5c('0x40')]);_0x5d604b[_0x4b5c('0x44')]=_0x517829!==''?_0x517829:util[_0x4b5c('0x45')](_0x4b5c('0x43'),_0x53cad3);_0x5d604b[_0x4b5c('0x46')]=_0x4b5c('0x47');}else if(_0x178a3e[_0x4b5c('0x40')]===_0x4b5c('0x1d')){logger[_0x4b5c('0x20')](_0x4b5c('0x41'),_0x53cad3,_0x178a3e[_0x4b5c('0x40')]);_0x5d604b['Name']=_0x517829!==_0x4b5c('0x42')?_0x517829:util[_0x4b5c('0x45')](_0x4b5c('0x43'),_0x53cad3);}else{return null;}}return _0x581bd4[_0x4b5c('0x21')](_['upperFirst'](_0x178a3e[_0x4b5c('0x40')]))[_0x4b5c('0x22')](_0x5d604b)['then'](function(_0x131ea6){return BPromise[_0x4b5c('0x2a')]({'id':_0x131ea6['id'],'endUserType':_0x178a3e[_0x4b5c('0x40')]});});}});}function getCustomFields(_0x3876d3,_0x55c7a4){var _0x4dca50={};if(_0x3876d3[_0x4b5c('0x35')]>0x0){_['forEach'](_0x3876d3,function(_0x4381d3){if(_[_0x4b5c('0x48')](['string',_0x4b5c('0x49')],_0x4381d3[_0x4b5c('0x3d')])&&_0x4381d3[_0x4b5c('0x4a')]){_0x4dca50[_0x4381d3[_0x4b5c('0x4a')]]=_0x4381d3['content']['toString']();}else if(_0x4381d3[_0x4b5c('0x3d')]===_0x4b5c('0x4b')&&_0x4381d3[_0x4b5c('0x4c')]&&_0x4381d3['idField']){_0x55c7a4[_0x4381d3[_0x4b5c('0x4c')]]&&(_0x4dca50[_0x4381d3[_0x4b5c('0x4a')]]=_0x55c7a4[_0x4381d3[_0x4b5c('0x4c')]][_0x4b5c('0x4d')]());}else if(_0x4381d3[_0x4b5c('0x3d')]===_0x4b5c('0x4e')&&_0x4381d3[_0x4b5c('0x4f')]&&_0x4381d3[_0x4b5c('0x4f')][_0x4b5c('0x50')]&&_0x4381d3[_0x4b5c('0x4a')]){_0x55c7a4[_0x4381d3['Variable'][_0x4b5c('0x50')][_0x4b5c('0x51')]()]&&(_0x4dca50[_0x4381d3['idField']]=_0x55c7a4[_0x4381d3['Variable'][_0x4b5c('0x50')]['toLowerCase']()]['toString']());}});}return _0x4dca50;}function getConnection(_0x1d1263){var _0x556203=_0x1d1263[_0x4b5c('0x52')][_0x4b5c('0x53')](_0x1d1263[_0x4b5c('0x54')]);var _0x2a0a06=new jsforce[(_0x4b5c('0x55'))]({'oauth2':{'loginUrl':_0x1d1263[_0x4b5c('0x56')]||_0x4b5c('0x57'),'clientId':_0x1d1263[_0x4b5c('0x58')],'clientSecret':_0x1d1263[_0x4b5c('0x59')]}});return _0x2a0a06[_0x4b5c('0x5a')](_0x1d1263['username'],_0x556203)[_0x4b5c('0x27')](function(){logger[_0x4b5c('0x20')](_0x4b5c('0x5b'));return _0x2a0a06;});}exports['queue']=function(_0x50c63e,_0x4ba003,_0x4c4769,_0x5b7339,_0x343096,_0x3d14b8){var _0x261f45,_0x41551c,_0x432da2,_0x5010f5;_0x3d14b8[_0x4b5c('0x5c')]=intUtil[_0x4b5c('0x5d')](_0x3d14b8[_0x4b5c('0x5c')]);_0x3d14b8[_0x4b5c('0x56')]=intUtil[_0x4b5c('0x5d')](_0x3d14b8[_0x4b5c('0x56')]);if(_0x343096&&_0x343096['monitor_format']){logger[_0x4b5c('0x20')](_0x4b5c('0x5e'),_0x4b5c('0x5f'));_0x4ba003[_0x4b5c('0x60')]=util[_0x4b5c('0x45')](_0x4b5c('0x61'),_0x3d14b8[_0x4b5c('0x5c')],_0x4ba003[_0x4b5c('0x62')],md5(_0x4ba003[_0x4b5c('0x62')]));}else{_0x4ba003[_0x4b5c('0x60')]='';}return getConnection(_0x3d14b8)['then'](function(_0xd8418a){_0x5010f5=_0xd8418a;return getUser(_0x3d14b8,_0x5b7339[_0x4b5c('0x63')],_0x5010f5);})[_0x4b5c('0x27')](function(_0x186ca9){_0x261f45=_0x186ca9;return getEndUser(_0x3d14b8,_0x4c4769,_0x4ba003[_0x4b5c('0x64')],_0x4ba003[_0x4b5c('0x65')],_0x5010f5);})[_0x4b5c('0x27')](function(_0x43704b){_0x41551c=_0x43704b;return getTicket(_0x3d14b8,_0x261f45,_0x41551c,_0x4c4769,_0x4ba003,_0x4c4769['Fields'],_0x5010f5,'queue');})[_0x4b5c('0x27')](function(_0x4bcfd2){_0x432da2=_0x4bcfd2;logger[_0x4b5c('0x20')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x432da2['id']);logger[_0x4b5c('0x20')](_0x4b5c('0x66'),_0x432da2['id'],_0x5b7339['name'],_0x3d14b8[_0x4b5c('0x3d')]);switch(_0x3d14b8[_0x4b5c('0x3d')]){case _0x4b5c('0x67'):emit(util['format']('user:%s',_0x5b7339[_0x4b5c('0x50')]),_0x4b5c('0x68'),{'recordId':_0x432da2['id']});break;case _0x4b5c('0x69'):emit(util[_0x4b5c('0x45')](_0x4b5c('0x6a'),_0x5b7339[_0x4b5c('0x50')]),_0x4b5c('0x6b'),{'uri':util['format'](_0x4b5c('0x6c'),_0x5010f5[_0x4b5c('0x6d')],_0x432da2['id'])});break;default:logger[_0x4b5c('0x6e')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0x4b5c('0x6f')](function(_0x5bd77a){logger[_0x4b5c('0x6e')](_0x4b5c('0x5e'),_0x5bd77a);});};exports[_0x4b5c('0x70')]=function(_0x4403a0,_0x2bd10e,_0x5aa164,_0x5ee217,_0xba7465,_0x3c6817,_0x32367d){var _0xac13ad,_0x1b1413,_0x10d7a9,_0x25cd44;_0x3c6817['serverUrl']=intUtil['stripTrailingSlash'](_0x3c6817[_0x4b5c('0x5c')]);_0x3c6817[_0x4b5c('0x56')]=intUtil[_0x4b5c('0x5d')](_0x3c6817['remoteUri']);if(_0x32367d&&_0x32367d[_0x4b5c('0x71')]&&_0x32367d[_0x4b5c('0x71')]!==_0x4b5c('0x72')){logger[_0x4b5c('0x20')](_0x4b5c('0x73'),_0x4b5c('0x5f'));_0x2bd10e[_0x4b5c('0x60')]=util[_0x4b5c('0x45')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3c6817[_0x4b5c('0x5c')],_0x2bd10e[_0x4b5c('0x62')],md5(_0x2bd10e[_0x4b5c('0x62')]));}return getConnection(_0x3c6817)[_0x4b5c('0x27')](function(_0x1d8797){_0x25cd44=_0x1d8797;return getUser(_0x3c6817,_0x5ee217[_0x4b5c('0x63')],_0x25cd44);})[_0x4b5c('0x27')](function(_0x60f393){_0xac13ad=_0x60f393;return getEndUser(_0x3c6817,_0x5aa164,_0x2bd10e[_0x4b5c('0x74')],_0x2bd10e[_0x4b5c('0x75')],_0x25cd44);})['then'](function(_0x4b4e0d){_0x1b1413=_0x4b4e0d;return getTicket(_0x3c6817,_0xac13ad,_0x1b1413,_0x5aa164,_0x2bd10e,_0x5aa164[_0x4b5c('0x76')],_0x25cd44,_0x4b5c('0x70'));})[_0x4b5c('0x27')](function(_0x1f1aa2){_0x10d7a9=_0x1f1aa2;logger[_0x4b5c('0x20')](_0x4b5c('0x77'),_0x10d7a9['id']);logger[_0x4b5c('0x20')](_0x4b5c('0x78'),_0x10d7a9['id'],_0x5ee217[_0x4b5c('0x50')],_0x3c6817[_0x4b5c('0x3d')]);switch(_0x3c6817[_0x4b5c('0x3d')]){case'integrationTab':emit(util[_0x4b5c('0x45')](_0x4b5c('0x6a'),_0x5ee217[_0x4b5c('0x50')]),_0x4b5c('0x68'),{'recordId':_0x10d7a9['id']});break;case _0x4b5c('0x69'):emit(util['format'](_0x4b5c('0x6a'),_0x5ee217[_0x4b5c('0x50')]),_0x4b5c('0x6b'),{'uri':util['format'](_0x4b5c('0x6c'),_0x25cd44['instanceUrl'],_0x10d7a9['id'])});break;default:logger['error'](_0x4b5c('0x73'),_0x4b5c('0x79'));}})[_0x4b5c('0x6f')](function(_0x45f11c){logger[_0x4b5c('0x6e')](_0x4b5c('0x73'),_0x45f11c);});};exports[_0x4b5c('0x7a')]=function(_0xf78fb,_0x2d0f41,_0x2a374a,_0x367bb4,_0x260ad7,_0x204a5b){var _0x3fdab0,_0x264b5b,_0xe364d9,_0x5db6c1;_0x204a5b['serverUrl']=intUtil[_0x4b5c('0x5d')](_0x204a5b[_0x4b5c('0x5c')]);_0x204a5b[_0x4b5c('0x56')]=intUtil['stripTrailingSlash'](_0x204a5b[_0x4b5c('0x56')]);if(_0x260ad7&&_0x260ad7['monitor_format']){logger[_0x4b5c('0x20')]('['+_0x2d0f41[_0x4b5c('0x7b')][_0x4b5c('0x7c')]()+']','Recording\x20is\x20enabled!');_0x2d0f41[_0x4b5c('0x60')]=util[_0x4b5c('0x45')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x204a5b[_0x4b5c('0x5c')],_0x2d0f41[_0x4b5c('0x62')],md5(_0x2d0f41[_0x4b5c('0x62')]));}else{_0x2d0f41['recordingURL']='';}return getConnection(_0x204a5b)[_0x4b5c('0x27')](function(_0x1d0fbe){_0x5db6c1=_0x1d0fbe;if(!_[_0x4b5c('0x23')](_0x367bb4)){return getUser(_0x204a5b,_0x367bb4[_0x4b5c('0x50')],_0x5db6c1);}else{return getUser(_0x204a5b,null,_0x5db6c1);}})[_0x4b5c('0x27')](function(_0x266955){_0x3fdab0=_0x266955;return getEndUser(_0x204a5b,_0x2a374a,_0x2d0f41[_0x4b5c('0x64')],_0x2d0f41['calleridnum'],_0x5db6c1);})[_0x4b5c('0x27')](function(_0x54ef6a){_0x264b5b=_0x54ef6a;return getTicket(_0x204a5b,_0x3fdab0,_0x264b5b,_0x2a374a,_0x2d0f41,_0x2a374a[_0x4b5c('0x76')],_0x5db6c1);})['then'](function(_0x1a8ba7){_0xe364d9=_0x1a8ba7;logger[_0x4b5c('0x20')]('['+_0x2d0f41[_0x4b5c('0x7b')][_0x4b5c('0x7c')]()+_0x4b5c('0x7d'),_0xe364d9['id']);logger[_0x4b5c('0x20')]('['+_0x2d0f41[_0x4b5c('0x7b')][_0x4b5c('0x7c')]()+_0x4b5c('0x7e'),_0x204a5b[_0x4b5c('0x3d')]);})['catch'](function(_0x4d5e6f){logger['error']('['+_0x2d0f41[_0x4b5c('0x7b')][_0x4b5c('0x7c')]()+']',_0x4d5e6f);});}; \ No newline at end of file +var _0x2e47=['endUserType','contact','lead','account','WhatId','Case','ContactId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','execute','then','find','Email','Agent\x20%s\x20found.','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','resolve','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','additionalSearchContact','merge','$or','Contact','cloneDeep','additionalSearchLead','additionalSearchAccount','Account','length','Lead','first','Phone','attributes','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','Company','forEach','string','picklist','type','idField','toString','variable','variableName','customVariable','Variable','name','toLowerCase','password','concat','securityToken','Connection','clientId','clientSecret','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','uniqueid','recordingURL','email','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','integrationTab','trigger:salesforce:display','newTab','user:%s','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','outbound','remoteUri','recordingFormat','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','[OUTBOUND]','Salesforce\x20account\x20type\x20not\x20recognized','catch','lastevent','toUpperCase','request-promise','md5','jsforce','util','ioredis','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','emit','getString','Subjects','Descriptions','ticketType','Task','ActivityDate','IsRecurrence'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2e47,0xdc));var _0x72e4=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2e47[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var rp=require(_0x72e4('0x0'));var moment=require('moment');var BPromise=require('bluebird');var md5=require(_0x72e4('0x1'));var jsforce=require(_0x72e4('0x2'));var util=require(_0x72e4('0x3'));var Redis=require(_0x72e4('0x4'));var intUtil=require('./util');var config=require(_0x72e4('0x5'));var logger=require(_0x72e4('0x6'))('salesforce');config[_0x72e4('0x7')]=_[_0x72e4('0x8')](config[_0x72e4('0x7')],{'host':_0x72e4('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x72e4('0x7')]));function emit(_0x4a7164,_0x1a92f6,_0x812b84){io['to'](_0x4a7164)[_0x72e4('0xa')](_0x1a92f6,_0x812b84);}function getTicket(_0x4d60b3,_0x3f0c2c,_0x4361b4,_0x174662,_0x3fd5ff,_0x5e1c38,_0x1d0a79,_0x221577){var _0x219e45=Object['assign']({},{'OwnerId':_0x3f0c2c['id'],'Subject':intUtil[_0x72e4('0xb')](_0x174662[_0x72e4('0xc')],_0x3fd5ff,'\x20'),'Description':intUtil['getString'](_0x174662[_0x72e4('0xd')],_0x3fd5ff,'\x0a')},getCustomFields(_0x5e1c38,_0x3fd5ff));if(_0x4361b4){if(_0x174662[_0x72e4('0xe')]===_0x72e4('0xf')){_0x219e45[_0x72e4('0x10')]=moment['utc']();_0x219e45['IsReminderSet']=![];_0x219e45[_0x72e4('0x11')]=![];if(_0x4361b4[_0x72e4('0x12')]===_0x72e4('0x13')||_0x4361b4['endUserType']===_0x72e4('0x14')){_0x219e45['WhoId']=_0x4361b4['id'];}else if(_0x4361b4['endUserType']===_0x72e4('0x15')){_0x219e45[_0x72e4('0x16')]=_0x4361b4['id'];}}else if(_0x174662[_0x72e4('0xe')]===_0x72e4('0x17')){if(_0x4361b4[_0x72e4('0x12')]===_0x72e4('0x13')){_0x219e45[_0x72e4('0x18')]=_0x4361b4['id'];}else if(_0x4361b4[_0x72e4('0x12')]===_0x72e4('0x15')){_0x219e45['AccountId']=_0x4361b4['id'];}else if(_0x4361b4[_0x72e4('0x12')]===_0x72e4('0x14')&&_0x174662['leadId']){_0x219e45[_0x174662[_0x72e4('0x19')]]=_0x4361b4['id'];}else{logger[_0x72e4('0x1a')](_0x72e4('0x1b'));}}}return _0x1d0a79[_0x72e4('0x1c')](_0x174662[_0x72e4('0xe')])[_0x72e4('0x1d')](_0x219e45);}function getUser(_0x48f62b,_0x2b9369,_0x43b0b4){if(!_[_0x72e4('0x1e')](_0x2b9369)&&intUtil['validateEmail'](_0x2b9369)){var _0x3c6065={'Email':_0x2b9369};var _0x568b36={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x43b0b4[_0x72e4('0x1c')]('User')['find'](_0x3c6065,_0x568b36)[_0x72e4('0x1f')]()[_0x72e4('0x20')](function(_0x49fa64){if(_0x49fa64['length']){var _0x475cda=_[_0x72e4('0x21')](_0x49fa64,function(_0x560f64){return _0x560f64[_0x72e4('0x22')]===_0x2b9369;});if(_0x475cda){logger[_0x72e4('0x1a')](_0x72e4('0x23'),_0x2b9369);return BPromise['resolve']({'id':_0x475cda['Id'],'name':_0x475cda[_0x72e4('0x24')]});}}else{logger[_0x72e4('0x1a')](_0x72e4('0x25'),_0x2b9369);return _0x43b0b4[_0x72e4('0x26')]()[_0x72e4('0x20')](function(_0x1e9eb9){return BPromise[_0x72e4('0x27')]({'id':_0x1e9eb9[_0x72e4('0x28')],'name':_0x1e9eb9[_0x72e4('0x29')]});});}});}else{logger[_0x72e4('0x1a')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x2b9369);return _0x43b0b4['identity']()[_0x72e4('0x20')](function(_0x58a441){return BPromise[_0x72e4('0x27')]({'id':_0x58a441[_0x72e4('0x28')],'name':_0x58a441[_0x72e4('0x29')]});});}}function getEndUser(_0xc85be7,_0x4e3628,_0x3872d8,_0x1110e9,_0xe93a64){var _0xa8a3c0={'$or':{'Phone':_0x1110e9}};var _0x5f156c={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x72e4('0x27')]()[_0x72e4('0x20')](function(){logger[_0x72e4('0x1a')](_0x72e4('0x2a'),_0x1110e9,_0x4e3628[_0x72e4('0x2b')]);switch(_0x4e3628[_0x72e4('0x2b')]){case _0x72e4('0x2c'):var _0x36cf75=_['cloneDeep'](_0xa8a3c0);if(_0x4e3628[_0x72e4('0x2d')]){var _0x7d9edd={};_0x7d9edd[_0x4e3628['additionalSearchContact']]=_0x1110e9;_[_0x72e4('0x2e')](_0x36cf75[_0x72e4('0x2f')],_0x7d9edd);}return _0xe93a64[_0x72e4('0x1c')](_0x72e4('0x30'))[_0x72e4('0x21')](_0x36cf75,_0x5f156c)[_0x72e4('0x1f')]()[_0x72e4('0x20')](function(_0x5df265){if(_0x5df265&&_0x5df265['length']){return _0x5df265;}else{var _0x435e84=_[_0x72e4('0x31')](_0xa8a3c0);if(_0x4e3628[_0x72e4('0x32')]){var _0x522778={};_0x522778[_0x4e3628[_0x72e4('0x32')]]=_0x1110e9;_[_0x72e4('0x2e')](_0x435e84[_0x72e4('0x2f')],_0x522778);}return _0xe93a64['sobject']('Lead')[_0x72e4('0x21')](_0x435e84,_0x5f156c);}});case'account_contact_lead':var _0x2f5dd9=_['cloneDeep'](_0xa8a3c0);if(_0x4e3628[_0x72e4('0x33')]){var _0x7d9edd={};_0x7d9edd[_0x4e3628[_0x72e4('0x33')]]=_0x1110e9;_[_0x72e4('0x2e')](_0x2f5dd9[_0x72e4('0x2f')],_0x7d9edd);}return _0xe93a64['sobject'](_0x72e4('0x34'))[_0x72e4('0x21')](_0x2f5dd9,_0x5f156c)[_0x72e4('0x1f')]()[_0x72e4('0x20')](function(_0x8fd3e3){if(_0x8fd3e3&&_0x8fd3e3[_0x72e4('0x35')]){return _0x8fd3e3;}else{var _0x3b6991=_[_0x72e4('0x31')](_0xa8a3c0);if(_0x4e3628[_0x72e4('0x2d')]){var _0x30d537={};_0x30d537[_0x4e3628[_0x72e4('0x2d')]]=_0x1110e9;_[_0x72e4('0x2e')](_0x3b6991[_0x72e4('0x2f')],_0x30d537);}return _0xe93a64['sobject'](_0x72e4('0x30'))[_0x72e4('0x21')](_0x3b6991,_0x5f156c)[_0x72e4('0x20')](function(_0x57a139){if(_0x57a139&&_0x57a139[_0x72e4('0x35')]){return _0x57a139;}else{var _0x3d9220=_[_0x72e4('0x31')](_0xa8a3c0);if(_0x4e3628['additionalSearchLead']){var _0x1e8798={};_0x1e8798[_0x4e3628['additionalSearchLead']]=_0x1110e9;_[_0x72e4('0x2e')](_0x3d9220[_0x72e4('0x2f')],_0x1e8798);}return _0xe93a64[_0x72e4('0x1c')](_0x72e4('0x36'))[_0x72e4('0x21')](_0x3d9220,_0x5f156c);}});}});case _0x72e4('0x13'):var _0x36cf75=_[_0x72e4('0x31')](_0xa8a3c0);if(_0x4e3628[_0x72e4('0x2d')]){var _0x7d9edd={};_0x7d9edd[_0x4e3628['additionalSearchContact']]=_0x1110e9;_[_0x72e4('0x2e')](_0x36cf75['$or'],_0x7d9edd);}return _0xe93a64[_0x72e4('0x1c')](_0x72e4('0x30'))['find'](_0x36cf75,_0x5f156c)['execute']();case _0x72e4('0x14'):var _0x3a550a=_['cloneDeep'](_0xa8a3c0);if(_0x4e3628['additionalSearchLead']){var _0x7d9edd={};_0x7d9edd[_0x4e3628[_0x72e4('0x32')]]=_0x1110e9;_[_0x72e4('0x2e')](_0x3a550a[_0x72e4('0x2f')],_0x7d9edd);}return _0xe93a64[_0x72e4('0x1c')](_0x72e4('0x36'))[_0x72e4('0x21')](_0x3a550a,_0x5f156c);case _0x72e4('0x15'):var _0x2f5dd9=_[_0x72e4('0x31')](_0xa8a3c0);if(_0x4e3628['additionalSearchAccount']){var _0x7d9edd={};_0x7d9edd[_0x4e3628[_0x72e4('0x33')]]=_0x1110e9;_[_0x72e4('0x2e')](_0x2f5dd9[_0x72e4('0x2f')],_0x7d9edd);}return _0xe93a64[_0x72e4('0x1c')](_0x72e4('0x34'))['find'](_0x2f5dd9,_0x5f156c);default:return null;}})['then'](function(_0xa07c54){if(_0xa07c54&&_0xa07c54[_0x72e4('0x35')]){var _0x27d360=_[_0x72e4('0x37')](_0xa07c54);if(_0x27d360){return BPromise[_0x72e4('0x27')]({'id':_0x27d360['Id'],'name':_0x27d360[_0x72e4('0x24')],'phone':_0x27d360[_0x72e4('0x38')],'endUserType':_0x27d360[_0x72e4('0x39')]['type']['toLowerCase']()});}}})[_0x72e4('0x20')](function(_0x4baeca){if(_0x4baeca){logger[_0x72e4('0x1a')]('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x4baeca[_0x72e4('0x12')],_0x1110e9);return BPromise['resolve'](_0x4baeca);}else{logger[_0x72e4('0x1a')]('Enduser\x20with\x20phone\x20%s\x20not\x20found',_0x1110e9);var _0x492876={'Phone':_0x1110e9};if(_0x4e3628[_0x72e4('0x3a')]){if(_0x4e3628[_0x72e4('0x3a')]===_0x72e4('0x13')){logger[_0x72e4('0x1a')](_0x72e4('0x3b'),_0x1110e9,_0x4e3628[_0x72e4('0x3a')]);_0x492876[_0x72e4('0x3c')]=_0x3872d8!==_0x72e4('0x3d')?_0x3872d8:util[_0x72e4('0x3e')](_0x72e4('0x3f'),_0x1110e9);}else if(_0x4e3628[_0x72e4('0x3a')]==='lead'){logger[_0x72e4('0x1a')](_0x72e4('0x3b'),_0x1110e9,_0x4e3628[_0x72e4('0x3a')]);_0x492876[_0x72e4('0x3c')]=_0x3872d8!==_0x72e4('0x3d')?_0x3872d8:util['format'](_0x72e4('0x3f'),_0x1110e9);_0x492876[_0x72e4('0x40')]='No\x20Company';}else if(_0x4e3628[_0x72e4('0x3a')]===_0x72e4('0x15')){logger[_0x72e4('0x1a')](_0x72e4('0x3b'),_0x1110e9,_0x4e3628[_0x72e4('0x3a')]);_0x492876[_0x72e4('0x24')]=_0x3872d8!==_0x72e4('0x3d')?_0x3872d8:util[_0x72e4('0x3e')](_0x72e4('0x3f'),_0x1110e9);}else{return null;}}return _0xe93a64[_0x72e4('0x1c')](_['upperFirst'](_0x4e3628[_0x72e4('0x3a')]))[_0x72e4('0x1d')](_0x492876)['then'](function(_0xfb6647){return BPromise[_0x72e4('0x27')]({'id':_0xfb6647['id'],'endUserType':_0x4e3628[_0x72e4('0x3a')]});});}});}function getCustomFields(_0x256b59,_0x147561){var _0x371aa8={};if(_0x256b59['length']>0x0){_[_0x72e4('0x41')](_0x256b59,function(_0x4a9f16){if(_['includes']([_0x72e4('0x42'),_0x72e4('0x43')],_0x4a9f16[_0x72e4('0x44')])&&_0x4a9f16[_0x72e4('0x45')]){_0x371aa8[_0x4a9f16['idField']]=_0x4a9f16['content'][_0x72e4('0x46')]();}else if(_0x4a9f16['type']===_0x72e4('0x47')&&_0x4a9f16[_0x72e4('0x48')]&&_0x4a9f16[_0x72e4('0x45')]){_0x147561[_0x4a9f16[_0x72e4('0x48')]]&&(_0x371aa8[_0x4a9f16[_0x72e4('0x45')]]=_0x147561[_0x4a9f16[_0x72e4('0x48')]][_0x72e4('0x46')]());}else if(_0x4a9f16[_0x72e4('0x44')]===_0x72e4('0x49')&&_0x4a9f16[_0x72e4('0x4a')]&&_0x4a9f16[_0x72e4('0x4a')][_0x72e4('0x4b')]&&_0x4a9f16[_0x72e4('0x45')]){_0x147561[_0x4a9f16[_0x72e4('0x4a')][_0x72e4('0x4b')][_0x72e4('0x4c')]()]&&(_0x371aa8[_0x4a9f16[_0x72e4('0x45')]]=_0x147561[_0x4a9f16['Variable']['name'][_0x72e4('0x4c')]()]['toString']());}});}return _0x371aa8;}function getConnection(_0x21c3b1){var _0x300730=_0x21c3b1[_0x72e4('0x4d')][_0x72e4('0x4e')](_0x21c3b1[_0x72e4('0x4f')]);var _0x2c84ca=new jsforce[(_0x72e4('0x50'))]({'oauth2':{'loginUrl':_0x21c3b1['remoteUri']||'https://login.salesforce.com','clientId':_0x21c3b1[_0x72e4('0x51')],'clientSecret':_0x21c3b1[_0x72e4('0x52')]}});return _0x2c84ca[_0x72e4('0x53')](_0x21c3b1[_0x72e4('0x54')],_0x300730)[_0x72e4('0x20')](function(){logger['info'](_0x72e4('0x55'));return _0x2c84ca;});}exports[_0x72e4('0x56')]=function(_0x52b7d3,_0x1aceea,_0x711099,_0x1312bf,_0x215b96,_0x12f5f5){var _0x16b5a6,_0x5bd171,_0x3f26d7,_0x98d087;_0x12f5f5[_0x72e4('0x57')]=intUtil[_0x72e4('0x58')](_0x12f5f5['serverUrl']);_0x12f5f5['remoteUri']=intUtil[_0x72e4('0x58')](_0x12f5f5['remoteUri']);if(_0x215b96&&_0x215b96[_0x72e4('0x59')]){logger['info'](_0x72e4('0x5a'),'Recording\x20is\x20enabled!');_0x1aceea['recordingURL']=util[_0x72e4('0x3e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x12f5f5[_0x72e4('0x57')],_0x1aceea['uniqueid'],md5(_0x1aceea[_0x72e4('0x5b')]));}else{_0x1aceea[_0x72e4('0x5c')]='';}return getConnection(_0x12f5f5)[_0x72e4('0x20')](function(_0x503d50){_0x98d087=_0x503d50;return getUser(_0x12f5f5,_0x1312bf[_0x72e4('0x5d')],_0x98d087);})[_0x72e4('0x20')](function(_0x590cb6){_0x16b5a6=_0x590cb6;return getEndUser(_0x12f5f5,_0x711099,_0x1aceea['calleridname'],_0x1aceea[_0x72e4('0x5e')],_0x98d087);})[_0x72e4('0x20')](function(_0x548043){_0x5bd171=_0x548043;return getTicket(_0x12f5f5,_0x16b5a6,_0x5bd171,_0x711099,_0x1aceea,_0x711099[_0x72e4('0x5f')],_0x98d087,_0x72e4('0x56'));})[_0x72e4('0x20')](function(_0x10da0c){_0x3f26d7=_0x10da0c;logger['info'](_0x72e4('0x60'),_0x3f26d7['id']);logger[_0x72e4('0x1a')]('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x3f26d7['id'],_0x1312bf[_0x72e4('0x4b')],_0x12f5f5['type']);switch(_0x12f5f5['type']){case _0x72e4('0x61'):emit(util[_0x72e4('0x3e')]('user:%s',_0x1312bf[_0x72e4('0x4b')]),_0x72e4('0x62'),{'recordId':_0x3f26d7['id']});break;case _0x72e4('0x63'):emit(util[_0x72e4('0x3e')](_0x72e4('0x64'),_0x1312bf[_0x72e4('0x4b')]),_0x72e4('0x65'),{'uri':util['format'](_0x72e4('0x66'),_0x98d087[_0x72e4('0x67')],_0x3f26d7['id'])});break;default:logger[_0x72e4('0x68')](_0x72e4('0x69'));}})['catch'](function(_0x1be398){logger['error'](_0x72e4('0x5a'),_0x1be398);});};exports[_0x72e4('0x6a')]=function(_0x9e9d36,_0x49c2cb,_0x33f344,_0x254ffa,_0x7a2259,_0xe3c659,_0x17f516){var _0x307831,_0xd0304b,_0x231c51,_0x52cb2d;_0xe3c659['serverUrl']=intUtil[_0x72e4('0x58')](_0xe3c659[_0x72e4('0x57')]);_0xe3c659[_0x72e4('0x6b')]=intUtil[_0x72e4('0x58')](_0xe3c659[_0x72e4('0x6b')]);if(_0x17f516&&_0x17f516[_0x72e4('0x6c')]&&_0x17f516[_0x72e4('0x6c')]!=='none'){logger['info']('[OUTBOUND]',_0x72e4('0x6d'));_0x49c2cb['recordingURL']=util[_0x72e4('0x3e')](_0x72e4('0x6e'),_0xe3c659['serverUrl'],_0x49c2cb[_0x72e4('0x5b')],md5(_0x49c2cb[_0x72e4('0x5b')]));}return getConnection(_0xe3c659)['then'](function(_0x5dbad3){_0x52cb2d=_0x5dbad3;return getUser(_0xe3c659,_0x254ffa[_0x72e4('0x5d')],_0x52cb2d);})[_0x72e4('0x20')](function(_0x44f5df){_0x307831=_0x44f5df;return getEndUser(_0xe3c659,_0x33f344,_0x49c2cb['destcalleridname'],_0x49c2cb[_0x72e4('0x6f')],_0x52cb2d);})['then'](function(_0x5aa578){_0xd0304b=_0x5aa578;return getTicket(_0xe3c659,_0x307831,_0xd0304b,_0x33f344,_0x49c2cb,_0x33f344[_0x72e4('0x5f')],_0x52cb2d,_0x72e4('0x6a'));})[_0x72e4('0x20')](function(_0xe744af){_0x231c51=_0xe744af;logger[_0x72e4('0x1a')](_0x72e4('0x70'),_0x231c51['id']);logger[_0x72e4('0x1a')](_0x72e4('0x71'),_0x231c51['id'],_0x254ffa[_0x72e4('0x4b')],_0xe3c659[_0x72e4('0x44')]);switch(_0xe3c659[_0x72e4('0x44')]){case _0x72e4('0x61'):emit(util[_0x72e4('0x3e')](_0x72e4('0x64'),_0x254ffa[_0x72e4('0x4b')]),'trigger:salesforce:display',{'recordId':_0x231c51['id']});break;case'newTab':emit(util[_0x72e4('0x3e')](_0x72e4('0x64'),_0x254ffa[_0x72e4('0x4b')]),_0x72e4('0x65'),{'uri':util[_0x72e4('0x3e')]('%s/%s/e',_0x52cb2d[_0x72e4('0x67')],_0x231c51['id'])});break;default:logger[_0x72e4('0x68')](_0x72e4('0x72'),_0x72e4('0x73'));}})[_0x72e4('0x74')](function(_0x576a4e){logger[_0x72e4('0x68')]('[OUTBOUND]',_0x576a4e);});};exports['unmanaged']=function(_0x4cf661,_0x1fb7cf,_0x121883,_0x2ae681,_0x2843af,_0x3c3f3c){var _0xf64cb8,_0x27de3d,_0x2cbc95,_0xe84fdd;_0x3c3f3c[_0x72e4('0x57')]=intUtil['stripTrailingSlash'](_0x3c3f3c[_0x72e4('0x57')]);_0x3c3f3c[_0x72e4('0x6b')]=intUtil[_0x72e4('0x58')](_0x3c3f3c[_0x72e4('0x6b')]);if(_0x2843af&&_0x2843af['monitor_format']){logger[_0x72e4('0x1a')]('['+_0x1fb7cf['lastevent']['toUpperCase']()+']',_0x72e4('0x6d'));_0x1fb7cf[_0x72e4('0x5c')]=util[_0x72e4('0x3e')](_0x72e4('0x6e'),_0x3c3f3c[_0x72e4('0x57')],_0x1fb7cf['uniqueid'],md5(_0x1fb7cf[_0x72e4('0x5b')]));}else{_0x1fb7cf[_0x72e4('0x5c')]='';}return getConnection(_0x3c3f3c)[_0x72e4('0x20')](function(_0x5a1bf8){_0xe84fdd=_0x5a1bf8;if(!_[_0x72e4('0x1e')](_0x2ae681)){return getUser(_0x3c3f3c,_0x2ae681['name'],_0xe84fdd);}else{return getUser(_0x3c3f3c,null,_0xe84fdd);}})[_0x72e4('0x20')](function(_0x541f66){_0xf64cb8=_0x541f66;return getEndUser(_0x3c3f3c,_0x121883,_0x1fb7cf['calleridname'],_0x1fb7cf[_0x72e4('0x5e')],_0xe84fdd);})[_0x72e4('0x20')](function(_0xd0db69){_0x27de3d=_0xd0db69;return getTicket(_0x3c3f3c,_0xf64cb8,_0x27de3d,_0x121883,_0x1fb7cf,_0x121883[_0x72e4('0x5f')],_0xe84fdd);})[_0x72e4('0x20')](function(_0x1b46ce){_0x2cbc95=_0x1b46ce;logger[_0x72e4('0x1a')]('['+_0x1fb7cf[_0x72e4('0x75')]['toUpperCase']()+']\x20Ticket\x20%s\x20created.',_0x2cbc95['id']);logger[_0x72e4('0x1a')]('['+_0x1fb7cf['lastevent'][_0x72e4('0x76')]()+']\x20Integration\x20account\x20type\x20%s.',_0x3c3f3c[_0x72e4('0x44')]);})[_0x72e4('0x74')](function(_0x27703b){logger[_0x72e4('0x68')]('['+_0x1fb7cf['lastevent']['toUpperCase']()+']',_0x27703b);});}; \ 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 dd95717..70d2dfb 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 _0xe2ef=['toLowerCase','toString','customField','idField','content','variable','customVariable','Variable',']\x20getTicket\x20input\x20crm','outbound','POST','incident','assign','getString','Subjects','Descriptions','Fields','ticketNumber','label','?sysparm_query=name%3D','label_entry','Incident','ticketId','Incident\x20-\x20','push',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','all','Tags','name','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','username','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','isNil','email','destcalleridnum','calleridnum','queue','unmanaged','uniqueid','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','inspect','lodash','bluebird','request-promise','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','length','adminId','sys_id','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','info','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','result','active','true','userId','adminEmail',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','sys_user?','endUserNumber','user','System','],\x20EndUser\x20schema','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','endUserId','],\x20getEndUser\x20crm','forEach','includes','string','picklist','type','nameField'];(function(_0x2a7fa8,_0x413c0e){var _0xf7e306=function(_0x9af322){while(--_0x9af322){_0x2a7fa8['push'](_0x2a7fa8['shift']());}};_0xf7e306(++_0x413c0e);}(_0xe2ef,0x17d));var _0xfe2e=function(_0x5c709b,_0x50d687){_0x5c709b=_0x5c709b-0x0;var _0x407861=_0xe2ef[_0x5c709b];return _0x407861;};'use strict';var _=require(_0xfe2e('0x0'));var Promise=require(_0xfe2e('0x1'));var rp=require(_0xfe2e('0x2'));var util=require('util');var md5=require(_0xfe2e('0x3'));var Redis=require(_0xfe2e('0x4'));var intUtil=require(_0xfe2e('0x5'));var config=require(_0xfe2e('0x6'));var logger=require(_0xfe2e('0x7'))('servicenow');config[_0xfe2e('0x8')]=_['defaults'](config['redis'],{'host':_0xfe2e('0x9'),'port':0x18eb});var io=require(_0xfe2e('0xa'))(new Redis(config['redis']));function getAdminUser(_0x19d5e5,_0x363b5b,_0x3eadb6,_0x5faee3,_0x278aa6,_0x284351){return new Promise(function(_0x57d39f,_0x327d61){var _0x466ee4={'method':_0xfe2e('0xb'),'uri':_0x5faee3+_0xfe2e('0xc')+'&'+_0x278aa6+'&'+_0x284351,'auth':_0x363b5b,'json':!![]};return rp(_0x466ee4)[_0xfe2e('0xd')](function(_0x3cb366){if(_0x3cb366['result'][_0xfe2e('0xe')]>0x0){_0x3eadb6[_0xfe2e('0xf')]=_0x3cb366['result'][0x0][_0xfe2e('0x10')];}logger['info']('['+[_0x19d5e5[_0xfe2e('0x11')]()]+_0xfe2e('0x12'),_0x3eadb6);_0x57d39f(_0x3eadb6);})[_0xfe2e('0x13')](function(_0x369e6c){logger[_0xfe2e('0x14')]('['+[_0x19d5e5[_0xfe2e('0x11')]()]+']',_0x369e6c['message']);_0x327d61(_0x369e6c[_0xfe2e('0x15')]);});});}function getUser(_0x5812a1,_0x57fc87,_0x38738a,_0xad391d,_0x41ef5b){return function(_0x31bebd){logger[_0xfe2e('0x16')]('['+[_0x5812a1['toUpperCase']()]+_0xfe2e('0x17'),_0x31bebd);return new Promise(function(_0x4e27f9,_0x3ff82c){if(intUtil[_0xfe2e('0x18')](_0x31bebd[_0xfe2e('0x19')])){var _0x1a5f40={'method':'GET','uri':_0x38738a+_0xfe2e('0x1a')+_0x31bebd[_0xfe2e('0x19')]+'&'+_0xad391d+'&'+_0x41ef5b,'auth':_0x57fc87,'json':!![]};logger[_0xfe2e('0x16')]('['+[_0x5812a1['toUpperCase']()]+_0xfe2e('0x1b'),_0x1a5f40);return rp(_0x1a5f40)[_0xfe2e('0xd')](function(_0x466f79){logger[_0xfe2e('0x16')]('['+[_0x5812a1[_0xfe2e('0x11')]()]+_0xfe2e('0x1c'),_0x466f79);if(_0x466f79[_0xfe2e('0x1d')]['length']>0x0&&String(_0x466f79[_0xfe2e('0x1d')][0x0][_0xfe2e('0x1e')])===_0xfe2e('0x1f')){_0x31bebd[_0xfe2e('0x20')]=_0x466f79[_0xfe2e('0x1d')][0x0][_0xfe2e('0x10')];}else{_0x31bebd['userId']=_0x31bebd[_0xfe2e('0xf')];_0x31bebd[_0xfe2e('0x19')]=_0x31bebd[_0xfe2e('0x21')];}logger[_0xfe2e('0x16')]('['+[_0x5812a1[_0xfe2e('0x11')]()]+'],\x20getUser\x20crm',_0x31bebd);_0x4e27f9(_0x31bebd);})['catch'](function(_0x43cc89){logger[_0xfe2e('0x14')]('['+[_0x5812a1[_0xfe2e('0x11')]()]+']',_0x43cc89[_0xfe2e('0x15')]);_0x3ff82c(_0x43cc89[_0xfe2e('0x15')]);});}else{logger[_0xfe2e('0x16')]('['+[_0x5812a1[_0xfe2e('0x11')]()]+_0xfe2e('0x22'));_0x31bebd['userId']=_0x31bebd[_0xfe2e('0xf')];_0x31bebd[_0xfe2e('0x19')]=_0x31bebd[_0xfe2e('0x21')];_0x4e27f9(_0x31bebd);}});};}function createEndUser(_0x4f3ef4,_0xbdeb4e,_0x5c1a2d,_0x20da82,_0xb07735){logger[_0xfe2e('0x16')]('['+[_0x4f3ef4[_0xfe2e('0x11')]()]+_0xfe2e('0x23'),_0x5c1a2d);return new Promise(function(_0x2f7dca,_0x1fd4b1){var _0x50a4ef={'method':'POST','uri':_0x20da82+_0xfe2e('0x24')+_0xb07735,'body':{'user_name':_0x5c1a2d[_0xfe2e('0x25')],'roles':_0xfe2e('0x26'),'first_name':_0x5c1a2d[_0xfe2e('0x25')],'active':'true','date_format':_0xfe2e('0x27'),'phone':_0x5c1a2d['endUserNumber']},'auth':_0xbdeb4e,'json':!![]};return rp(_0x50a4ef)[_0xfe2e('0xd')](function(_0x4a32b8){logger[_0xfe2e('0x16')]('['+[_0x4f3ef4['toUpperCase']()]+_0xfe2e('0x28'),_0x4a32b8[_0xfe2e('0x1d')]);_0x5c1a2d['endUserId']=_0x4a32b8[_0xfe2e('0x1d')]['sys_id'];_0x2f7dca(_0x5c1a2d);})[_0xfe2e('0x13')](function(_0x2a161f){logger['error']('['+[_0x4f3ef4[_0xfe2e('0x11')]()]+']',_0x2a161f['message']);_0x1fd4b1(_0x2a161f[_0xfe2e('0x15')]);});});}function getEndUser(_0x27bec5,_0x25a0ae,_0x3770e6,_0x21dc01,_0x4ff759){return function(_0x4adaae){logger[_0xfe2e('0x16')]('['+[_0x27bec5['toUpperCase']()]+_0xfe2e('0x29'),_0x4adaae);return new Promise(function(_0x3faa9e,_0x494651){var _0x2b2905={'method':_0xfe2e('0xb'),'uri':_0x3770e6+_0xfe2e('0x2a')+_0x4adaae[_0xfe2e('0x25')]+'&'+_0x21dc01+'&'+_0x4ff759,'auth':_0x25a0ae,'json':!![]};return rp(_0x2b2905)[_0xfe2e('0xd')](function(_0x471bfe){if(_0x471bfe[_0xfe2e('0x1d')][_0xfe2e('0xe')]>0x0){_0x4adaae[_0xfe2e('0x2b')]=_0x471bfe[_0xfe2e('0x1d')][0x0][_0xfe2e('0x10')];logger[_0xfe2e('0x16')]('['+[_0x27bec5[_0xfe2e('0x11')]()]+_0xfe2e('0x2c'),_0x4adaae);_0x3faa9e(_0x4adaae);}else{return createEndUser(_0x27bec5,_0x25a0ae,_0x4adaae,_0x3770e6,_0x21dc01)[_0xfe2e('0xd')](function(_0x1c2b46){logger[_0xfe2e('0x16')]('['+[_0x27bec5['toUpperCase']()]+'],\x20createEndUser\x20crm',_0x1c2b46);_0x3faa9e(_0x1c2b46);});}})[_0xfe2e('0x13')](function(_0x347463){logger['error']('['+[_0x27bec5['toUpperCase']()]+']',_0x347463[_0xfe2e('0x15')]);_0x494651(_0x347463[_0xfe2e('0x15')]);});});};}function getCustomFields(_0x88c8d1,_0xcaeae0){var _0x3efa5c={};if(_0x88c8d1[_0xfe2e('0xe')]>0x0){_[_0xfe2e('0x2d')](_0x88c8d1,function(_0x5cea60){if(_[_0xfe2e('0x2e')]([_0xfe2e('0x2f'),_0xfe2e('0x30')],_0x5cea60[_0xfe2e('0x31')])&&_0x5cea60['nameField']&&!_0x5cea60['customField']){_0x3efa5c[_0x5cea60[_0xfe2e('0x32')][_0xfe2e('0x33')]()]=_0x5cea60['content'][_0xfe2e('0x34')]();}else if(_[_0xfe2e('0x2e')](['string','picklist'],_0x5cea60['type'])&&_0x5cea60['idField']&&_0x5cea60[_0xfe2e('0x35')]){_0x3efa5c[_0x5cea60[_0xfe2e('0x36')]['toLowerCase']()]=_0x5cea60[_0xfe2e('0x37')]['toString']();}else if(_0x5cea60[_0xfe2e('0x31')]===_0xfe2e('0x38')&&_0x5cea60['variableName']&&_0x5cea60[_0xfe2e('0x36')]&&_0x5cea60[_0xfe2e('0x35')]){_0x3efa5c[_0x5cea60[_0xfe2e('0x36')]['toLowerCase']()]=_0xcaeae0[_0x5cea60['variableName']][_0xfe2e('0x34')]();}else if(_0x5cea60[_0xfe2e('0x31')]===_0xfe2e('0x39')&&_0x5cea60[_0xfe2e('0x3a')]&&_0x5cea60[_0xfe2e('0x3a')]['name']&&_0x5cea60[_0xfe2e('0x36')]&&_0x5cea60['customField']){_0x3efa5c[_0x5cea60[_0xfe2e('0x36')]['toLowerCase']()]=_0xcaeae0[_0x5cea60[_0xfe2e('0x3a')]['name']['toLowerCase']()][_0xfe2e('0x34')]();}});}return _0x3efa5c;}function getTicket(_0x15ae69,_0x54a3aa,_0x17d666,_0x222690,_0x1e33f5,_0x2f34e8){return function(_0x234004){logger[_0xfe2e('0x16')]('['+[_0x15ae69[_0xfe2e('0x11')]()]+_0xfe2e('0x3b'),_0x234004);return new Promise(function(_0x59c24d,_0xe9fa75){var _0x10eb1e=_0x15ae69['toLowerCase']()===_0xfe2e('0x3c')?_0x234004[_0xfe2e('0x20')]:_0x234004[_0xfe2e('0x2b')];var _0x125312={'method':_0xfe2e('0x3d'),'uri':_0x17d666+_0xfe2e('0x3e')+'?'+_0x2f34e8,'body':Object[_0xfe2e('0x3f')]({},{'active':'true','caller_id':_0x10eb1e,'assigned_to':_0x234004['userId'],'short_description':intUtil[_0xfe2e('0x40')](_0x222690[_0xfe2e('0x41')],_0x1e33f5,'\x20'),'description':intUtil[_0xfe2e('0x40')](_0x222690[_0xfe2e('0x42')],_0x1e33f5,'\x0a')},getCustomFields(_0x222690[_0xfe2e('0x43')],_0x1e33f5)),'auth':_0x54a3aa,'json':!![]};return rp(_0x125312)[_0xfe2e('0xd')](function(_0x3bea3d){logger[_0xfe2e('0x16')]('['+[_0x15ae69['toUpperCase']()]+']\x20POST\x20incident\x20entity\x20schema',_0x3bea3d[_0xfe2e('0x1d')]);_0x234004['ticketId']=_0x3bea3d['result'][_0xfe2e('0x10')];_0x234004[_0xfe2e('0x44')]=_0x3bea3d[_0xfe2e('0x1d')]['number'];logger[_0xfe2e('0x16')]('['+[_0x15ae69[_0xfe2e('0x11')]()]+']\x20getTicket\x20crm',_0x234004);_0x59c24d(_0x234004);})['catch'](function(_0x1cd5b){logger[_0xfe2e('0x14')]('['+[_0x15ae69['toUpperCase']()]+']',_0x1cd5b['message']);_0xe9fa75(_0x1cd5b[_0xfe2e('0x15')]);});});};}function createRemoteTag(_0x190cb3,_0x2ad513,_0x20cc05,_0x4fa164){return new Promise(function(_0x236d1e,_0x535702){var _0x1c2c0={'method':_0xfe2e('0x3d'),'uri':_0x20cc05+_0xfe2e('0x45')+'?'+_0x4fa164,'body':{'short_description':_0x190cb3,'global':!![],'active':!![],'name':_0x190cb3},'auth':_0x2ad513,'json':!![]};return rp(_0x1c2c0)[_0xfe2e('0xd')](function(_0x88c84f){var _0x347d1c=_0x88c84f['result'][_0xfe2e('0x10')];_0x236d1e(_0x347d1c);});});}function getRemoteTag(_0x77bac9,_0x26e453,_0x4b66c8,_0x9615dc,_0x5c8d73){return new Promise(function(_0x2e6f62,_0x9ab618){var _0x35e7a6={'method':_0xfe2e('0xb'),'uri':_0x4b66c8+_0xfe2e('0x45')+_0xfe2e('0x46')+_0x77bac9+'&'+_0x9615dc,'auth':_0x26e453,'json':!![]};return rp(_0x35e7a6)[_0xfe2e('0xd')](function(_0xd43d4e){if(_0xd43d4e[_0xfe2e('0x1d')][_0xfe2e('0xe')]>0x0){var _0x157852=_0xd43d4e[_0xfe2e('0x1d')][0x0][_0xfe2e('0x10')];_0x2e6f62(_0x157852);}else{return createRemoteTag(_0x77bac9,_0x26e453,_0x4b66c8,_0x9615dc)['then'](function(_0x1376fc){_0x2e6f62(_0x1376fc);});}});});}function assignTagToIncident(_0x4218c8,_0x2dba7c,_0x11ba4b,_0x25eb24,_0x5c5dbf){return new Promise(function(_0x5ee396,_0x4f4479){var _0xcca7a3={'method':'POST','uri':_0x11ba4b+_0xfe2e('0x47')+'?'+_0x5c5dbf,'body':{'label':_0x4218c8,'table':_0xfe2e('0x3e'),'id_type':_0xfe2e('0x48'),'table_key':_0x25eb24[_0xfe2e('0x49')],'title':_0xfe2e('0x4a')+_0x25eb24[_0xfe2e('0x44')],'id_display':_0x25eb24['ticketNumber']},'auth':_0x2dba7c,'json':!![]};return rp(_0xcca7a3)[_0xfe2e('0xd')](function(_0x2cef7f){_0x5ee396();})[_0xfe2e('0x13')](function(){_0x5ee396();});});}function manageTags(_0xf6971,_0x26eacc,_0x139a5f,_0x402085,_0x2bda61,_0x246983,_0x54318a){return new Promise(function(_0x540a22,_0x39471a){var _0x102147=[];_0x26eacc[_0xfe2e('0x2d')](function(_0x206b55){_0x102147[_0xfe2e('0x4b')](getRemoteTag(_0x206b55,_0x139a5f,_0x402085,_0x246983,_0x54318a));});return Promise['all'](_0x102147)[_0xfe2e('0xd')](function(_0x51b7a6){if(_0x51b7a6[_0xfe2e('0xe')]){logger[_0xfe2e('0x16')]('['+[_0xf6971[_0xfe2e('0x11')]()]+_0xfe2e('0x4c'),_0x51b7a6);var _0x4ad713=[];_0x51b7a6[_0xfe2e('0x2d')](function(_0x18f71c){_0x4ad713[_0xfe2e('0x4b')](assignTagToIncident(_0x18f71c,_0x139a5f,_0x402085,_0x2bda61,_0x246983));});return Promise[_0xfe2e('0x4d')](_0x4ad713)[_0xfe2e('0xd')](function(){_0x540a22();})[_0xfe2e('0x13')](function(){_0x540a22();});}else{_0x540a22();}});});}function getTags(_0x3787d2,_0xba8d22,_0x23f69c,_0x2c07dd,_0x972e46,_0x3569bf){return function(_0x3d5920){return new Promise(function(_0x2b52fe,_0x44d29d){var _0x5bcc54=[];var _0x487456=_0x2c07dd[_0xfe2e('0x4e')];if(_0x487456&&_0x487456[_0xfe2e('0xe')]>0x0){_0x5bcc54=_['map'](_0x487456,_0xfe2e('0x4f'));}if(_0x5bcc54[_0xfe2e('0xe')]>0x0){return manageTags(_0x3787d2,_0x5bcc54,_0xba8d22,_0x23f69c,_0x3d5920,_0x972e46,_0x3569bf)[_0xfe2e('0xd')](function(){_0x2b52fe(_0x3d5920);});}else{_0x2b52fe(_0x3d5920);}});};}function emit(_0x322458,_0x16e217,_0x2e0615){var _0x31f74d='%26sysparm_record_target%3Dincident'+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0xfe2e('0x50')+_0xfe2e('0x51');var _0xbaa641={'uri':_0x322458+_0xfe2e('0x52')+_0x2e0615+_0x31f74d};io['to'](util[_0xfe2e('0x53')](_0xfe2e('0x54'),_0x16e217))[_0xfe2e('0x55')](_0xfe2e('0x56'),_0xbaa641);}exports['cs']=function(_0x11b4c7,_0x1010ea,_0x151ffb,_0x545309,_0x174675,_0x5d32ca,_0x4b93a5,_0x216e24){var _0x31caae={};var _0x279507={'user':_0x5d32ca[_0xfe2e('0x57')],'pass':_0x5d32ca['password']};var _0x20dec0=_0xfe2e('0x58');var _0x2fddfb=_0xfe2e('0x59');_0x5d32ca[_0xfe2e('0x5a')]=intUtil[_0xfe2e('0x5b')](_0x5d32ca[_0xfe2e('0x5a')]);_0x5d32ca[_0xfe2e('0x5c')]=intUtil[_0xfe2e('0x5b')](_0x5d32ca[_0xfe2e('0x5c')]);var _0x4af78c=util[_0xfe2e('0x53')]('%s/api/now/table/',_0x5d32ca[_0xfe2e('0x5a')]);_0x31caae[_0xfe2e('0x19')]=!_[_0xfe2e('0x5d')](_0x545309)?_0x545309[_0xfe2e('0x5e')]:null;_0x31caae[_0xfe2e('0x21')]=_0x5d32ca['email'];_0x31caae[_0xfe2e('0x25')]=_0x216e24[_0xfe2e('0x33')]()==='outbound'?_0x1010ea[_0xfe2e('0x5f')]:_0x1010ea[_0xfe2e('0x60')];_0x31caae['callDirection']=_0x216e24===_0xfe2e('0x61')||_0x216e24===_0xfe2e('0x62')?_0xfe2e('0x61'):_0xfe2e('0x3c');var _0x262b44=util[_0xfe2e('0x53')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5d32ca[_0xfe2e('0x5c')],_0x1010ea[_0xfe2e('0x63')],md5(_0x1010ea[_0xfe2e('0x63')]));if(_0x174675&&_0x174675['monitor_format']){logger[_0xfe2e('0x16')]('[QUEUE]',_0xfe2e('0x64'));_0x1010ea[_0xfe2e('0x65')]=_0x262b44;}else if(_0x4b93a5&&_0x4b93a5[_0xfe2e('0x66')]&&_0x4b93a5['recordingFormat']!==_0xfe2e('0x67')){logger[_0xfe2e('0x16')](_0xfe2e('0x68'),_0xfe2e('0x64'));_0x1010ea[_0xfe2e('0x65')]=_0x262b44;}else{_0x1010ea['recordingURL']='';}return getAdminUser(_0x216e24,_0x279507,_0x31caae,_0x4af78c,_0x2fddfb,_0x20dec0)[_0xfe2e('0xd')](getUser(_0x216e24,_0x279507,_0x4af78c,_0x2fddfb,_0x20dec0))['then'](getEndUser(_0x216e24,_0x279507,_0x4af78c,_0x2fddfb,_0x20dec0))[_0xfe2e('0xd')](getTicket(_0x216e24,_0x279507,_0x4af78c,_0x151ffb,_0x1010ea,_0x2fddfb))[_0xfe2e('0xd')](function(_0x166cff){logger['info'](util[_0xfe2e('0x53')](_0xfe2e('0x69'),_0x166cff[_0xfe2e('0x49')]));logger['info'](util[_0xfe2e('0x53')]('call\x20direction:\x20%s',_0x216e24));if(_0x216e24!==_0xfe2e('0x62')){logger[_0xfe2e('0x16')]('['+[_0x216e24[_0xfe2e('0x11')]()]+']',_0xfe2e('0x6a'));emit(_0x5d32ca['remoteUri'],_0x545309['name'],_0x166cff['ticketId']);}})[_0xfe2e('0x13')](function(_0x2246b0){logger[_0xfe2e('0x14')]('['+[_0x216e24[_0xfe2e('0x11')]()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0xfe2e('0x6b')](_0x2246b0,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x7069=['Variable','name',']\x20getTicket\x20input\x20crm','outbound','POST','incident','assign','Subjects','getString','Descriptions',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','label','?sysparm_query=name%3D','label_entry','Incident\x20-\x20','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','recordingURL','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','util','md5','ioredis','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','sys_id','info','toUpperCase','catch','error','message','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20entity','active','true','userId','adminEmail','],\x20getUser\x20crm','],\x20createEndUser\x20input\x20crm','sys_user?','user','endUserNumber','System','],\x20EndUser\x20schema','endUserId','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','string','picklist','type','customField','nameField','toLowerCase','content','idField','toString','variableName','customVariable'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x7069,0xa3));var _0x9706=function(_0x6c349f,_0x5e022a){_0x6c349f=_0x6c349f-0x0;var _0x403b84=_0x7069[_0x6c349f];return _0x403b84;};'use strict';var _=require(_0x9706('0x0'));var Promise=require(_0x9706('0x1'));var rp=require(_0x9706('0x2'));var util=require(_0x9706('0x3'));var md5=require(_0x9706('0x4'));var Redis=require(_0x9706('0x5'));var intUtil=require('./util');var config=require(_0x9706('0x6'));var logger=require(_0x9706('0x7'))('servicenow');config[_0x9706('0x8')]=_[_0x9706('0x9')](config['redis'],{'host':_0x9706('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function getAdminUser(_0x3e3733,_0x3b47b4,_0x3c0a27,_0x243d8f,_0x3cacb2,_0x557d92){return new Promise(function(_0x29ed05,_0x17ba7c){var _0x26fa0e={'method':_0x9706('0xb'),'uri':_0x243d8f+_0x9706('0xc')+'&'+_0x3cacb2+'&'+_0x557d92,'auth':_0x3b47b4,'json':!![]};return rp(_0x26fa0e)[_0x9706('0xd')](function(_0x560a77){if(_0x560a77[_0x9706('0xe')][_0x9706('0xf')]>0x0){_0x3c0a27[_0x9706('0x10')]=_0x560a77[_0x9706('0xe')][0x0][_0x9706('0x11')];}logger[_0x9706('0x12')]('['+[_0x3e3733[_0x9706('0x13')]()]+'],\x20getAdminUser\x20crm',_0x3c0a27);_0x29ed05(_0x3c0a27);})[_0x9706('0x14')](function(_0x57a0bb){logger[_0x9706('0x15')]('['+[_0x3e3733[_0x9706('0x13')]()]+']',_0x57a0bb[_0x9706('0x16')]);_0x17ba7c(_0x57a0bb[_0x9706('0x16')]);});});}function getUser(_0x3bba27,_0x2cc08a,_0x2508cb,_0x43a973,_0x1a1081){return function(_0x553aac){logger[_0x9706('0x12')]('['+[_0x3bba27['toUpperCase']()]+'],\x20getUser\x20input\x20crm',_0x553aac);return new Promise(function(_0x2ec05f,_0x27fe1b){if(intUtil[_0x9706('0x17')](_0x553aac[_0x9706('0x18')])){var _0x41e695={'method':'GET','uri':_0x2508cb+_0x9706('0x19')+_0x553aac[_0x9706('0x18')]+'&'+_0x43a973+'&'+_0x1a1081,'auth':_0x2cc08a,'json':!![]};logger[_0x9706('0x12')]('['+[_0x3bba27['toUpperCase']()]+'],\x20getUser\x20rp\x20obj',_0x41e695);return rp(_0x41e695)[_0x9706('0xd')](function(_0x17e8af){logger[_0x9706('0x12')]('['+[_0x3bba27['toUpperCase']()]+_0x9706('0x1a'),_0x17e8af);if(_0x17e8af['result'][_0x9706('0xf')]>0x0&&String(_0x17e8af['result'][0x0][_0x9706('0x1b')])===_0x9706('0x1c')){_0x553aac[_0x9706('0x1d')]=_0x17e8af['result'][0x0]['sys_id'];}else{_0x553aac[_0x9706('0x1d')]=_0x553aac['adminId'];_0x553aac['userEmail']=_0x553aac[_0x9706('0x1e')];}logger[_0x9706('0x12')]('['+[_0x3bba27[_0x9706('0x13')]()]+_0x9706('0x1f'),_0x553aac);_0x2ec05f(_0x553aac);})[_0x9706('0x14')](function(_0x575f11){logger[_0x9706('0x15')]('['+[_0x3bba27[_0x9706('0x13')]()]+']',_0x575f11['message']);_0x27fe1b(_0x575f11['message']);});}else{logger[_0x9706('0x12')]('['+[_0x3bba27[_0x9706('0x13')]()]+']\x20using\x20admin\x20profile');_0x553aac[_0x9706('0x1d')]=_0x553aac[_0x9706('0x10')];_0x553aac[_0x9706('0x18')]=_0x553aac[_0x9706('0x1e')];_0x2ec05f(_0x553aac);}});};}function createEndUser(_0x1e96cb,_0x1fdf75,_0x5cd9f1,_0x4dc289,_0xffacda){logger[_0x9706('0x12')]('['+[_0x1e96cb[_0x9706('0x13')]()]+_0x9706('0x20'),_0x5cd9f1);return new Promise(function(_0x436414,_0x5073bf){var _0x886add={'method':'POST','uri':_0x4dc289+_0x9706('0x21')+_0xffacda,'body':{'user_name':_0x5cd9f1['endUserNumber'],'roles':_0x9706('0x22'),'first_name':_0x5cd9f1[_0x9706('0x23')],'active':_0x9706('0x1c'),'date_format':_0x9706('0x24'),'phone':_0x5cd9f1['endUserNumber']},'auth':_0x1fdf75,'json':!![]};return rp(_0x886add)['then'](function(_0x14b66a){logger[_0x9706('0x12')]('['+[_0x1e96cb[_0x9706('0x13')]()]+_0x9706('0x25'),_0x14b66a[_0x9706('0xe')]);_0x5cd9f1[_0x9706('0x26')]=_0x14b66a['result'][_0x9706('0x11')];_0x436414(_0x5cd9f1);})[_0x9706('0x14')](function(_0x404503){logger[_0x9706('0x15')]('['+[_0x1e96cb[_0x9706('0x13')]()]+']',_0x404503[_0x9706('0x16')]);_0x5073bf(_0x404503['message']);});});}function getEndUser(_0x9cf8ed,_0x304829,_0x3e1b40,_0x133489,_0x5e84ad){return function(_0x5a6f2a){logger['info']('['+[_0x9cf8ed[_0x9706('0x13')]()]+'],\x20getEndUser\x20input\x20crm',_0x5a6f2a);return new Promise(function(_0x1abdf7,_0x2b49d3){var _0x40e796={'method':'GET','uri':_0x3e1b40+_0x9706('0x27')+_0x5a6f2a[_0x9706('0x23')]+'&'+_0x133489+'&'+_0x5e84ad,'auth':_0x304829,'json':!![]};return rp(_0x40e796)[_0x9706('0xd')](function(_0x3be7cd){if(_0x3be7cd['result'][_0x9706('0xf')]>0x0){_0x5a6f2a[_0x9706('0x26')]=_0x3be7cd[_0x9706('0xe')][0x0]['sys_id'];logger[_0x9706('0x12')]('['+[_0x9cf8ed[_0x9706('0x13')]()]+_0x9706('0x28'),_0x5a6f2a);_0x1abdf7(_0x5a6f2a);}else{return createEndUser(_0x9cf8ed,_0x304829,_0x5a6f2a,_0x3e1b40,_0x133489)['then'](function(_0xb6bd35){logger['info']('['+[_0x9cf8ed['toUpperCase']()]+_0x9706('0x29'),_0xb6bd35);_0x1abdf7(_0xb6bd35);});}})[_0x9706('0x14')](function(_0x247970){logger[_0x9706('0x15')]('['+[_0x9cf8ed['toUpperCase']()]+']',_0x247970[_0x9706('0x16')]);_0x2b49d3(_0x247970[_0x9706('0x16')]);});});};}function getCustomFields(_0xb13ea1,_0x4673c3){var _0x5e8e62={};if(_0xb13ea1[_0x9706('0xf')]>0x0){_[_0x9706('0x2a')](_0xb13ea1,function(_0x13d480){if(_[_0x9706('0x2b')]([_0x9706('0x2c'),_0x9706('0x2d')],_0x13d480[_0x9706('0x2e')])&&_0x13d480['nameField']&&!_0x13d480[_0x9706('0x2f')]){_0x5e8e62[_0x13d480[_0x9706('0x30')][_0x9706('0x31')]()]=_0x13d480[_0x9706('0x32')]['toString']();}else if(_[_0x9706('0x2b')](['string','picklist'],_0x13d480['type'])&&_0x13d480[_0x9706('0x33')]&&_0x13d480[_0x9706('0x2f')]){_0x5e8e62[_0x13d480[_0x9706('0x33')]['toLowerCase']()]=_0x13d480[_0x9706('0x32')][_0x9706('0x34')]();}else if(_0x13d480[_0x9706('0x2e')]==='variable'&&_0x13d480[_0x9706('0x35')]&&_0x13d480[_0x9706('0x33')]&&_0x13d480[_0x9706('0x2f')]){_0x5e8e62[_0x13d480[_0x9706('0x33')]['toLowerCase']()]=_0x4673c3[_0x13d480[_0x9706('0x35')]][_0x9706('0x34')]();}else if(_0x13d480['type']===_0x9706('0x36')&&_0x13d480[_0x9706('0x37')]&&_0x13d480[_0x9706('0x37')][_0x9706('0x38')]&&_0x13d480[_0x9706('0x33')]&&_0x13d480[_0x9706('0x2f')]){_0x5e8e62[_0x13d480[_0x9706('0x33')][_0x9706('0x31')]()]=_0x4673c3[_0x13d480['Variable']['name'][_0x9706('0x31')]()][_0x9706('0x34')]();}});}return _0x5e8e62;}function getTicket(_0x2d3fd6,_0x24b498,_0x42f66b,_0x9a1830,_0x50fe2b,_0x2dc250){return function(_0xc61da9){logger[_0x9706('0x12')]('['+[_0x2d3fd6[_0x9706('0x13')]()]+_0x9706('0x39'),_0xc61da9);return new Promise(function(_0x35f8aa,_0x287edf){var _0x31718f=_0x2d3fd6[_0x9706('0x31')]()===_0x9706('0x3a')?_0xc61da9[_0x9706('0x1d')]:_0xc61da9[_0x9706('0x26')];var _0x3c5075={'method':_0x9706('0x3b'),'uri':_0x42f66b+_0x9706('0x3c')+'?'+_0x2dc250,'body':Object[_0x9706('0x3d')]({},{'active':_0x9706('0x1c'),'caller_id':_0x31718f,'assigned_to':_0xc61da9['userId'],'short_description':intUtil['getString'](_0x9a1830[_0x9706('0x3e')],_0x50fe2b,'\x20'),'description':intUtil[_0x9706('0x3f')](_0x9a1830[_0x9706('0x40')],_0x50fe2b,'\x0a')},getCustomFields(_0x9a1830['Fields'],_0x50fe2b)),'auth':_0x24b498,'json':!![]};return rp(_0x3c5075)[_0x9706('0xd')](function(_0x24f841){logger[_0x9706('0x12')]('['+[_0x2d3fd6[_0x9706('0x13')]()]+_0x9706('0x41'),_0x24f841[_0x9706('0xe')]);_0xc61da9[_0x9706('0x42')]=_0x24f841['result']['sys_id'];_0xc61da9[_0x9706('0x43')]=_0x24f841['result']['number'];logger[_0x9706('0x12')]('['+[_0x2d3fd6[_0x9706('0x13')]()]+']\x20getTicket\x20crm',_0xc61da9);_0x35f8aa(_0xc61da9);})[_0x9706('0x14')](function(_0x534539){logger['error']('['+[_0x2d3fd6[_0x9706('0x13')]()]+']',_0x534539[_0x9706('0x16')]);_0x287edf(_0x534539[_0x9706('0x16')]);});});};}function createRemoteTag(_0x2c7c47,_0x2559bc,_0x430f16,_0x2efa7e){return new Promise(function(_0x308443,_0xd2a08a){var _0x4f8744={'method':_0x9706('0x3b'),'uri':_0x430f16+_0x9706('0x44')+'?'+_0x2efa7e,'body':{'short_description':_0x2c7c47,'global':!![],'active':!![],'name':_0x2c7c47},'auth':_0x2559bc,'json':!![]};return rp(_0x4f8744)[_0x9706('0xd')](function(_0x3c19f6){var _0x358db5=_0x3c19f6[_0x9706('0xe')][_0x9706('0x11')];_0x308443(_0x358db5);});});}function getRemoteTag(_0x4840cc,_0x4a6aaf,_0x251bed,_0x5d1048,_0x4347e2){return new Promise(function(_0x1dc875,_0x6f7221){var _0x1e0084={'method':_0x9706('0xb'),'uri':_0x251bed+_0x9706('0x44')+_0x9706('0x45')+_0x4840cc+'&'+_0x5d1048,'auth':_0x4a6aaf,'json':!![]};return rp(_0x1e0084)[_0x9706('0xd')](function(_0x44357e){if(_0x44357e['result'][_0x9706('0xf')]>0x0){var _0x4c7bf9=_0x44357e[_0x9706('0xe')][0x0]['sys_id'];_0x1dc875(_0x4c7bf9);}else{return createRemoteTag(_0x4840cc,_0x4a6aaf,_0x251bed,_0x5d1048)[_0x9706('0xd')](function(_0x4530dd){_0x1dc875(_0x4530dd);});}});});}function assignTagToIncident(_0x4626b1,_0x35abf8,_0x57bb83,_0x4da971,_0x53993f){return new Promise(function(_0x395d04,_0x30c0af){var _0x177200={'method':'POST','uri':_0x57bb83+_0x9706('0x46')+'?'+_0x53993f,'body':{'label':_0x4626b1,'table':_0x9706('0x3c'),'id_type':'Incident','table_key':_0x4da971['ticketId'],'title':_0x9706('0x47')+_0x4da971[_0x9706('0x43')],'id_display':_0x4da971['ticketNumber']},'auth':_0x35abf8,'json':!![]};return rp(_0x177200)[_0x9706('0xd')](function(_0x26b79a){_0x395d04();})[_0x9706('0x14')](function(){_0x395d04();});});}function manageTags(_0x2e8999,_0x4e0e2b,_0x4303e3,_0x5437b0,_0x1d7d1e,_0xd330c6,_0x35d211){return new Promise(function(_0x399706,_0x1c775b){var _0x519132=[];_0x4e0e2b[_0x9706('0x2a')](function(_0x461cca){_0x519132[_0x9706('0x48')](getRemoteTag(_0x461cca,_0x4303e3,_0x5437b0,_0xd330c6,_0x35d211));});return Promise[_0x9706('0x49')](_0x519132)[_0x9706('0xd')](function(_0x327f3a){if(_0x327f3a[_0x9706('0xf')]){logger[_0x9706('0x12')]('['+[_0x2e8999[_0x9706('0x13')]()]+_0x9706('0x4a'),_0x327f3a);var _0x581d6=[];_0x327f3a[_0x9706('0x2a')](function(_0x18daa3){_0x581d6[_0x9706('0x48')](assignTagToIncident(_0x18daa3,_0x4303e3,_0x5437b0,_0x1d7d1e,_0xd330c6));});return Promise[_0x9706('0x49')](_0x581d6)[_0x9706('0xd')](function(){_0x399706();})[_0x9706('0x14')](function(){_0x399706();});}else{_0x399706();}});});}function getTags(_0x288a0c,_0x54a236,_0x21dca2,_0x2b9074,_0x47a290,_0x1a54ee){return function(_0x543eeb){return new Promise(function(_0x1c8678,_0x3e572e){var _0x4814e5=[];var _0x5cba22=_0x2b9074[_0x9706('0x4b')];if(_0x5cba22&&_0x5cba22[_0x9706('0xf')]>0x0){_0x4814e5=_['map'](_0x5cba22,_0x9706('0x38'));}if(_0x4814e5[_0x9706('0xf')]>0x0){return manageTags(_0x288a0c,_0x4814e5,_0x54a236,_0x21dca2,_0x543eeb,_0x47a290,_0x1a54ee)['then'](function(){_0x1c8678(_0x543eeb);});}else{_0x1c8678(_0x543eeb);}});};}function emit(_0x29b589,_0x54a04d,_0xf07577){var _0x4a26b0=_0x9706('0x4c')+_0x9706('0x4d')+_0x9706('0x4e')+_0x9706('0x4f');var _0x1562ce={'uri':_0x29b589+_0x9706('0x50')+_0xf07577+_0x4a26b0};io['to'](util[_0x9706('0x51')](_0x9706('0x52'),_0x54a04d))[_0x9706('0x53')]('trigger:browser:url',_0x1562ce);}exports['cs']=function(_0xc62140,_0x6b0cab,_0x526cbc,_0x430fa4,_0x2c7f57,_0x26fdda,_0x3d67c7,_0x459c8b){var _0x4bd129={};var _0x37dc12={'user':_0x26fdda['username'],'pass':_0x26fdda[_0x9706('0x54')]};var _0x6f96f1=_0x9706('0x55');var _0x5155ad=_0x9706('0x56');_0x26fdda[_0x9706('0x57')]=intUtil[_0x9706('0x58')](_0x26fdda[_0x9706('0x57')]);_0x26fdda[_0x9706('0x59')]=intUtil[_0x9706('0x58')](_0x26fdda[_0x9706('0x59')]);var _0x9d4a5c=util['format'](_0x9706('0x5a'),_0x26fdda[_0x9706('0x57')]);_0x4bd129[_0x9706('0x18')]=!_[_0x9706('0x5b')](_0x430fa4)?_0x430fa4['email']:null;_0x4bd129['adminEmail']=_0x26fdda[_0x9706('0x5c')];_0x4bd129[_0x9706('0x23')]=_0x459c8b[_0x9706('0x31')]()===_0x9706('0x3a')?_0x6b0cab[_0x9706('0x5d')]:_0x6b0cab[_0x9706('0x5e')];_0x4bd129['callDirection']=_0x459c8b===_0x9706('0x5f')||_0x459c8b===_0x9706('0x60')?_0x9706('0x5f'):_0x9706('0x3a');var _0x27c6fa=util['format'](_0x9706('0x61'),_0x26fdda[_0x9706('0x59')],_0x6b0cab['uniqueid'],md5(_0x6b0cab[_0x9706('0x62')]));if(_0x2c7f57&&_0x2c7f57[_0x9706('0x63')]){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x6b0cab[_0x9706('0x64')]=_0x27c6fa;}else if(_0x3d67c7&&_0x3d67c7[_0x9706('0x65')]&&_0x3d67c7[_0x9706('0x65')]!=='none'){logger[_0x9706('0x12')](_0x9706('0x66'),_0x9706('0x67'));_0x6b0cab['recordingURL']=_0x27c6fa;}else{_0x6b0cab[_0x9706('0x64')]='';}return getAdminUser(_0x459c8b,_0x37dc12,_0x4bd129,_0x9d4a5c,_0x5155ad,_0x6f96f1)[_0x9706('0xd')](getUser(_0x459c8b,_0x37dc12,_0x9d4a5c,_0x5155ad,_0x6f96f1))['then'](getEndUser(_0x459c8b,_0x37dc12,_0x9d4a5c,_0x5155ad,_0x6f96f1))[_0x9706('0xd')](getTicket(_0x459c8b,_0x37dc12,_0x9d4a5c,_0x526cbc,_0x6b0cab,_0x5155ad))['then'](function(_0x3c03e4){logger[_0x9706('0x12')](util['format'](_0x9706('0x68'),_0x3c03e4['ticketId']));logger[_0x9706('0x12')](util['format'](_0x9706('0x69'),_0x459c8b));if(_0x459c8b!=='unmanaged'){logger['info']('['+[_0x459c8b['toUpperCase']()]+']',_0x9706('0x6a'));emit(_0x26fdda[_0x9706('0x57')],_0x430fa4[_0x9706('0x38')],_0x3c03e4['ticketId']);}})[_0x9706('0x14')](function(_0x54dba9){logger[_0x9706('0x15')]('['+[_0x459c8b[_0x9706('0x13')]()]+_0x9706('0x6b'),util[_0x9706('0x6c')](_0x54dba9,{'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 efc4cd7..dc4a231 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 _0x8c9b=['contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','Caller\x20-\x20%s','then','Enduser\x20created.','debug','[HTTP]','type','string','nameField','toLowerCase','idField','customField','custom_fields','content','customVariable','Variable','POST','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','set_relationship','stripTrailingSlash','remoteUri','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','contacts','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','error','[QUEUE]','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Outbound','users','catch','unmanaged','toUpperCase','isNil','calleridnum','lastevent','lodash','request-promise','bluebird','md5','util','./util','../../../../config/environment','sugarcrm','defaults','redis','localhost','socket.io-emitter','emit','info','name','getString','Subjects','assigned_user_id','created_by','description','Descriptions','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','Contacts','parent_name','direction','length','variableName','push','set_entry','JSON','stringify','Calls','format','Basic\x20%s','toString','get_server_info','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','entry_list','find','name_value_list','user_name','value','Agent\x20found!','resolve','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!'];(function(_0x40a6f0,_0x556962){var _0x1c5519=function(_0x3d5513){while(--_0x3d5513){_0x40a6f0['push'](_0x40a6f0['shift']());}};_0x1c5519(++_0x556962);}(_0x8c9b,0xb7));var _0xb8c9=function(_0x4872c9,_0x3efc87){_0x4872c9=_0x4872c9-0x0;var _0x445cc8=_0x8c9b[_0x4872c9];return _0x445cc8;};'use strict';var _=require(_0xb8c9('0x0'));var rp=require(_0xb8c9('0x1'));var BPromise=require(_0xb8c9('0x2'));var md5=require(_0xb8c9('0x3'));var util=require(_0xb8c9('0x4'));var Redis=require('ioredis');var intUtil=require(_0xb8c9('0x5'));var config=require(_0xb8c9('0x6'));var logger=require('../../../../config/logger')(_0xb8c9('0x7'));config['redis']=_[_0xb8c9('0x8')](config[_0xb8c9('0x9')],{'host':_0xb8c9('0xa'),'port':0x18eb});var io=require(_0xb8c9('0xb'))(new Redis(config[_0xb8c9('0x9')]));var def={'method':'POST','json':!![]};function emit(_0x36378d,_0x40fe6e,_0x34e2cc){io['to'](_0x36378d)[_0xb8c9('0xc')](_0x40fe6e,_0x34e2cc);}function getTicket(_0x38e3b1,_0x5bc9c0,_0xb19a5f,_0x5277f4,_0x5466ea,_0xc7cb09,_0x1f87e5,_0x205790){logger[_0xb8c9('0xd')]('Creating\x20new\x20ticket...');var _0x8f0b1c=new Date();var _0x404f04=[{'name':_0xb8c9('0xe'),'value':intUtil[_0xb8c9('0xf')](_0x5277f4[_0xb8c9('0x10')],_0x5466ea,'\x20')},{'name':_0xb8c9('0x11'),'value':_0x5bc9c0['id']},{'name':_0xb8c9('0x12'),'value':_0x5bc9c0['id']},{'name':_0xb8c9('0x13'),'value':intUtil[_0xb8c9('0xf')](_0x5277f4[_0xb8c9('0x14')],_0x5466ea,'\x0a')},{'name':'date_start','value':_0x8f0b1c[_0xb8c9('0x15')]()[_0xb8c9('0x16')](0x0,0x13)[_0xb8c9('0x17')]('T','\x20')},{'name':_0xb8c9('0x18'),'value':'0'},{'name':_0xb8c9('0x19'),'value':'15'},{'name':_0xb8c9('0x1a'),'value':_0xb19a5f['id']},{'name':'parent_type','value':_0xb8c9('0x1b')},{'name':_0xb8c9('0x1c'),'value':_0xb19a5f[_0xb8c9('0xe')]},{'name':_0xb8c9('0x1d'),'value':_0x205790}];if(_0xc7cb09[_0xb8c9('0x1e')]){_['forEach'](_0xc7cb09,function(_0x2645e7){if(_0x5466ea[_0x2645e7[_0xb8c9('0x1f')]]){_0x404f04[_0xb8c9('0x20')]({'name':_0x2645e7['idField'],'value':_0x5466ea[_0x2645e7['variableName']]});}});}return request({'form':{'method':_0xb8c9('0x21'),'input_type':'JSON','response_type':_0xb8c9('0x22'),'rest_data':JSON[_0xb8c9('0x23')]({'session':_0x1f87e5['id'],'module_name':_0xb8c9('0x24'),'name_value_list':_0x404f04})}});}function getAuth(_0x414dfa){return util[_0xb8c9('0x25')](_0xb8c9('0x26'),new Buffer(_0x414dfa['apiKey']+':X')[_0xb8c9('0x27')]('base64'));}function getServerInfo(_0x3877d8){return request({'form':{'method':_0xb8c9('0x28'),'input_type':_0xb8c9('0x22'),'response_type':_0xb8c9('0x22'),'rest_data':JSON[_0xb8c9('0x23')]({'session':_0x3877d8['id']})}});}function getUser(_0x576e5c,_0x9b8976,_0x17e47a){if(!_['isNil'](_0x9b8976)){logger[_0xb8c9('0xd')]('Getting\x20agent\x20with\x20name',_0x9b8976);return request({'form':{'method':_0xb8c9('0x29'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0xb8c9('0x23')]({'session':_0x17e47a['id'],'module_name':_0xb8c9('0x2a'),'query':util[_0xb8c9('0x25')](_0xb8c9('0x2b'),_0x9b8976),'order_by':'','offset':'0','select_fields':['id',_0xb8c9('0xe'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x1c9a0b){if(_0x1c9a0b[_0xb8c9('0x2c')][_0xb8c9('0x1e')]){var _0x273241=_[_0xb8c9('0x2d')](_0x1c9a0b['entry_list'],function(_0x3fb6da){return _0x3fb6da[_0xb8c9('0x2e')][_0xb8c9('0x2f')][_0xb8c9('0x30')]===_0x9b8976;});if(_0x273241){logger[_0xb8c9('0xd')](_0xb8c9('0x31'));return BPromise['resolve']({'id':_0x273241[_0xb8c9('0x2e')]['id'][_0xb8c9('0x30')],'name':_0x273241[_0xb8c9('0x2e')][_0xb8c9('0xe')][_0xb8c9('0x30')]});}}logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0xb8c9('0x32')]({'id':_0x17e47a['name_value_list'][_0xb8c9('0x33')]['value'],'name':_0x17e47a[_0xb8c9('0x2e')][_0xb8c9('0x2f')][_0xb8c9('0x30')]});});}else{logger[_0xb8c9('0xd')](_0xb8c9('0x34'));return BPromise[_0xb8c9('0x32')]({'id':_0x17e47a[_0xb8c9('0x2e')][_0xb8c9('0x33')][_0xb8c9('0x30')],'name':_0x17e47a['name_value_list'][_0xb8c9('0x2f')][_0xb8c9('0x30')]});}}function getEndUser(_0x4a4ab7,_0x51b54b,_0x230846,_0x1b48bf){logger[_0xb8c9('0xd')]('Searching\x20enduser\x20with\x20phone',_0x230846);return request({'form':{'method':_0xb8c9('0x29'),'input_type':'JSON','response_type':_0xb8c9('0x22'),'rest_data':JSON[_0xb8c9('0x23')]({'session':_0x1b48bf['id'],'module_name':_0xb8c9('0x1b'),'query':util[_0xb8c9('0x25')](_0xb8c9('0x35'),_0x230846),'order_by':'','offset':'0','select_fields':['id','name',_0xb8c9('0x36')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x442630){if(_0x442630[_0xb8c9('0x2c')][_0xb8c9('0x1e')]){var _0x4d875a=_['find'](_0x442630[_0xb8c9('0x2c')],function(_0x56410f){return _0x56410f[_0xb8c9('0x2e')][_0xb8c9('0x36')][_0xb8c9('0x30')]===_0x230846;});if(_0x4d875a){logger[_0xb8c9('0xd')]('Enduser\x20found!');return BPromise[_0xb8c9('0x32')]({'id':_0x4d875a[_0xb8c9('0x2e')]['id'][_0xb8c9('0x30')],'name':_0x4d875a[_0xb8c9('0x2e')][_0xb8c9('0xe')][_0xb8c9('0x30')],'phone':_0x4d875a[_0xb8c9('0x2e')]['phone_home'][_0xb8c9('0x30')]});}}else{logger[_0xb8c9('0xd')](_0xb8c9('0x37'));return request({'form':{'method':'set_entry','input_type':'JSON','response_type':_0xb8c9('0x22'),'rest_data':JSON[_0xb8c9('0x23')]({'session':_0x1b48bf['id'],'module_name':_0xb8c9('0x1b'),'name_value_list':[{'name':_0xb8c9('0x38'),'value':_0x51b54b!==''?_0x51b54b:util[_0xb8c9('0x25')](_0xb8c9('0x39'),_0x230846)},{'name':_0xb8c9('0x36'),'value':_0x230846}]})}})[_0xb8c9('0x3a')](function(_0x3b3331){logger[_0xb8c9('0xd')](_0xb8c9('0x3b'));return BPromise['resolve']({'id':_0x3b3331['id'],'name':_0x3b3331[_0xb8c9('0x2c')][_0xb8c9('0x38')][_0xb8c9('0x30')],'phone':_0x3b3331[_0xb8c9('0x2c')]['phone_home'][_0xb8c9('0x30')]});});}});}function request(_0x17946d){logger[_0xb8c9('0x3c')](_0xb8c9('0x3d'),JSON[_0xb8c9('0x23')](_0x17946d));return rp(_['merge'](def,_0x17946d));}function getTags(_0x544ac,_0x9cef60){var _0x40aad8=[];if(_0x544ac&&_0x544ac['length']>0x0){_0x40aad8=_['map'](_0x544ac,_0x9cef60);}return _0x40aad8;}function getCustomFields(_0x2fba5f,_0x472250){var _0x4d5c22=[];var _0x32bae8={'custom_fields':[]};if(_0x2fba5f[_0xb8c9('0x1e')]>0x0){_['forEach'](_0x2fba5f,function(_0x2c0924){if(_0x2c0924[_0xb8c9('0x3e')]===_0xb8c9('0x3f')&&_0x2c0924[_0xb8c9('0x40')]&&!_0x2c0924['customField']){_0x32bae8[_0x2c0924['nameField'][_0xb8c9('0x41')]()]=_0x2c0924['content']['toString']();}else if(_0x2c0924['type']===_0xb8c9('0x3f')&&_0x2c0924[_0xb8c9('0x42')]&&_0x2c0924[_0xb8c9('0x43')]){_0x32bae8[_0xb8c9('0x44')][_0xb8c9('0x20')]({'id':_0x2c0924[_0xb8c9('0x42')],'value':_0x2c0924[_0xb8c9('0x45')][_0xb8c9('0x27')]()});}else if(_0x2c0924[_0xb8c9('0x3e')]==='variable'&&_0x2c0924[_0xb8c9('0x1f')]&&_0x2c0924[_0xb8c9('0x42')]&&_0x2c0924['customField']){_0x472250[_0x2c0924[_0xb8c9('0x1f')]]&&_0x32bae8[_0xb8c9('0x44')][_0xb8c9('0x20')]({'id':_0x2c0924[_0xb8c9('0x42')],'value':_0x472250[_0x2c0924[_0xb8c9('0x1f')]]['toString']()});}else if(_0x2c0924[_0xb8c9('0x3e')]===_0xb8c9('0x46')&&_0x2c0924[_0xb8c9('0x47')]&&_0x2c0924[_0xb8c9('0x47')][_0xb8c9('0xe')]&&_0x2c0924[_0xb8c9('0x42')]&&_0x2c0924[_0xb8c9('0x43')]){_0x472250[_0x2c0924[_0xb8c9('0x47')][_0xb8c9('0xe')][_0xb8c9('0x41')]()]&&_0x32bae8[_0xb8c9('0x44')][_0xb8c9('0x20')]({'id':_0x2c0924['idField'],'value':_0x472250[_0x2c0924[_0xb8c9('0x47')][_0xb8c9('0xe')][_0xb8c9('0x41')]()][_0xb8c9('0x27')]()});}});}return _0x32bae8;}function getConnection(_0x2c8427){return request({'method':_0xb8c9('0x48'),'form':{'method':'login','input_type':'JSON','response_type':_0xb8c9('0x22'),'rest_data':JSON[_0xb8c9('0x23')]({'user_auth':{'user_name':_0x2c8427['username'],'password':_0x2c8427[_0xb8c9('0x49')],'encryption':_0xb8c9('0x4a')},'application':_0xb8c9('0x4b')})}})['then'](function(_0x2b21d0){var _0x2db237=_0x2b21d0;if(_0x2db237['id']){def[_0xb8c9('0x4c')]=_0x2db237['id'];return BPromise['resolve'](_0x2db237);}else{throw new Error(util[_0xb8c9('0x25')]('Account\x20%d\x20is\x20not\x20valid',_0x2c8427['id']));}});}function setRelationship(_0x35db83,_0x34e5d0,_0x209e84,_0x2b0be3){return request({'form':{'method':_0xb8c9('0x4d'),'input_type':_0xb8c9('0x22'),'response_type':_0xb8c9('0x22'),'rest_data':JSON[_0xb8c9('0x23')]({'session':_0x35db83['id'],'module_name':_0xb8c9('0x24'),'module_id':_0x209e84['id'],'link_field_name':_0x2b0be3,'related_ids':[_0x34e5d0['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x3fbb0e,_0x35777b,_0x365c6a,_0x1b4476,_0x33c610,_0x502dfc){var _0x46f401,_0x3b3e2f,_0x2297da,_0x4fbd55;_0x502dfc['remoteUri']=intUtil[_0xb8c9('0x4e')](_0x502dfc[_0xb8c9('0x4f')]);_0x502dfc['serverUrl']=intUtil[_0xb8c9('0x4e')](_0x502dfc[_0xb8c9('0x50')]);def[_0xb8c9('0x51')]=util[_0xb8c9('0x25')](_0xb8c9('0x52'),_0x502dfc[_0xb8c9('0x4f')]);if(_0x33c610&&_0x33c610[_0xb8c9('0x53')]){logger[_0xb8c9('0xd')]('[QUEUE]',_0xb8c9('0x54'));_0x35777b[_0xb8c9('0x55')]=util[_0xb8c9('0x25')](_0xb8c9('0x56'),_0x502dfc[_0xb8c9('0x50')],_0x35777b[_0xb8c9('0x57')],md5(_0x35777b[_0xb8c9('0x57')]));}else{_0x35777b[_0xb8c9('0x55')]='';}return getConnection(_0x502dfc)[_0xb8c9('0x3a')](function(_0x5f18d4){_0x4fbd55=_0x5f18d4;return getUser(_0x502dfc,_0x1b4476['name'],_0x4fbd55);})[_0xb8c9('0x3a')](function(_0x55c02e){_0x46f401=_0x55c02e;logger[_0xb8c9('0xd')](_0xb8c9('0x58'),_0x46f401['id']);return getEndUser(_0x502dfc,_0x35777b[_0xb8c9('0x59')],_0x35777b['calleridnum'],_0x4fbd55);})[_0xb8c9('0x3a')](function(_0x11fc63){_0x3b3e2f=_0x11fc63;logger[_0xb8c9('0xd')]('The\x20Enduser\x20ID\x20is:',_0x3b3e2f['id']);return getTicket(_0x502dfc,_0x46f401,_0x3b3e2f,_0x365c6a,_0x35777b,_0x365c6a[_0xb8c9('0x5a')],_0x4fbd55,_0xb8c9('0x5b'));})['then'](function(_0x44d429){_0x2297da=_0x44d429;logger[_0xb8c9('0xd')](_0xb8c9('0x5c'));logger[_0xb8c9('0xd')](_0xb8c9('0x5d'),_0x2297da['id']);return setRelationship(_0x4fbd55,_0x46f401,_0x2297da,'users');})['then'](function(){return setRelationship(_0x4fbd55,_0x3b3e2f,_0x2297da,_0xb8c9('0x5e'));})['then'](function(){return getServerInfo(_0x4fbd55);})[_0xb8c9('0x3a')](function(_0x5129e3){var _0x8a3ac9=parseInt(_0x5129e3['version'][_0xb8c9('0x5f')](0x0));var _0x433eb1=util[_0xb8c9('0x25')](_0xb8c9('0x60'),_0x502dfc['remoteUri'],_0x2297da['id']);if(_0x8a3ac9>0x6){_0x433eb1=util['format'](_0xb8c9('0x61'),_0x502dfc[_0xb8c9('0x4f')],_0x2297da['id']);}logger[_0xb8c9('0xd')]('[QUEUE]',_0xb8c9('0x62'));emit(util[_0xb8c9('0x25')](_0xb8c9('0x63'),_0x1b4476[_0xb8c9('0xe')]),_0xb8c9('0x64'),{'uri':_0x433eb1});})['catch'](function(_0x57eaf2){logger[_0xb8c9('0x65')](_0xb8c9('0x66'),JSON[_0xb8c9('0x23')](_0x57eaf2));});};exports[_0xb8c9('0x67')]=function(_0x19fe3d,_0x34f300,_0x4e28e4,_0x1a5e58,_0x463c76,_0x1cffd0,_0x108dab){var _0x561669,_0x17d6bb,_0x16a18f,_0x290059;_0x1cffd0[_0xb8c9('0x4f')]=intUtil[_0xb8c9('0x4e')](_0x1cffd0['remoteUri']);_0x1cffd0['serverUrl']=intUtil[_0xb8c9('0x4e')](_0x1cffd0[_0xb8c9('0x50')]);def[_0xb8c9('0x51')]=util[_0xb8c9('0x25')]('%s/service/v4_1/rest.php',_0x1cffd0['remoteUri']);if(_0x108dab&&_0x108dab['recordingFormat']&&_0x108dab[_0xb8c9('0x68')]!==_0xb8c9('0x69')){logger['info'](_0xb8c9('0x6a'),_0xb8c9('0x54'));_0x34f300[_0xb8c9('0x55')]=util[_0xb8c9('0x25')](_0xb8c9('0x56'),_0x1cffd0[_0xb8c9('0x50')],_0x34f300[_0xb8c9('0x57')],md5(_0x34f300['uniqueid']));}return getConnection(_0x1cffd0)[_0xb8c9('0x3a')](function(_0x3ae266){_0x290059=_0x3ae266;return getUser(_0x1cffd0,_0x1a5e58[_0xb8c9('0xe')],_0x290059);})[_0xb8c9('0x3a')](function(_0x293fbf){_0x561669=_0x293fbf;logger[_0xb8c9('0xd')]('The\x20User\x20ID\x20is:',_0x561669['id']);return getEndUser(_0x1cffd0,_0x34f300[_0xb8c9('0x6b')],_0x34f300[_0xb8c9('0x6c')],_0x290059);})[_0xb8c9('0x3a')](function(_0x1cd700){_0x17d6bb=_0x1cd700;logger[_0xb8c9('0xd')](_0xb8c9('0x6d'),_0x17d6bb['id']);return getTicket(_0x1cffd0,_0x561669,_0x17d6bb,_0x4e28e4,_0x34f300,_0x4e28e4[_0xb8c9('0x5a')],_0x290059,_0xb8c9('0x6e'));})[_0xb8c9('0x3a')](function(_0x22d331){_0x16a18f=_0x22d331;logger['info'](_0xb8c9('0x5c'));logger['info'](_0xb8c9('0x5d'),_0x16a18f['id']);return setRelationship(_0x290059,_0x561669,_0x16a18f,_0xb8c9('0x6f'));})[_0xb8c9('0x3a')](function(){return setRelationship(_0x290059,_0x17d6bb,_0x16a18f,_0xb8c9('0x5e'));})[_0xb8c9('0x3a')](function(){return getServerInfo(_0x290059);})[_0xb8c9('0x3a')](function(_0x5240a5){var _0xb5ba34=parseInt(_0x5240a5['version']['charAt'](0x0));var _0x2d8731=util[_0xb8c9('0x25')](_0xb8c9('0x60'),_0x1cffd0[_0xb8c9('0x4f')],_0x16a18f['id']);if(_0xb5ba34>0x6){_0x2d8731=util[_0xb8c9('0x25')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x1cffd0[_0xb8c9('0x4f')],_0x16a18f['id']);}logger[_0xb8c9('0xd')](_0xb8c9('0x6a'),_0xb8c9('0x62'));emit(util[_0xb8c9('0x25')](_0xb8c9('0x63'),_0x1a5e58['name']),_0xb8c9('0x64'),{'uri':_0x2d8731});})[_0xb8c9('0x70')](function(_0x5947ab){logger[_0xb8c9('0x65')]('[OUTBOUND]',JSON[_0xb8c9('0x23')](_0x5947ab));});};exports[_0xb8c9('0x71')]=function(_0xc69363,_0x135185,_0x4f3f2c,_0xd00bac,_0x1e96e9,_0x211ff6){var _0x239fad,_0x1e6085,_0xda6449,_0x478cb6;_0x211ff6[_0xb8c9('0x4f')]=intUtil[_0xb8c9('0x4e')](_0x211ff6['remoteUri']);_0x211ff6['serverUrl']=intUtil[_0xb8c9('0x4e')](_0x211ff6[_0xb8c9('0x50')]);def[_0xb8c9('0x51')]=util['format'](_0xb8c9('0x52'),_0x211ff6[_0xb8c9('0x4f')]);if(_0x1e96e9&&_0x1e96e9[_0xb8c9('0x53')]){logger['info']('['+_0x135185['lastevent'][_0xb8c9('0x72')]()+']',_0xb8c9('0x54'));_0x135185[_0xb8c9('0x55')]=util['format'](_0xb8c9('0x56'),_0x211ff6[_0xb8c9('0x50')],_0x135185['uniqueid'],md5(_0x135185['uniqueid']));}else{_0x135185[_0xb8c9('0x55')]='';}return getConnection(_0x211ff6)[_0xb8c9('0x3a')](function(_0xec6907){_0x478cb6=_0xec6907;if(!_[_0xb8c9('0x73')](_0xd00bac)){return getUser(_0x211ff6,_0xd00bac[_0xb8c9('0xe')],_0x478cb6);}else{return getUser(_0x211ff6,null,_0x478cb6);}})[_0xb8c9('0x3a')](function(_0xaefe55){_0x239fad=_0xaefe55;logger[_0xb8c9('0xd')](_0xb8c9('0x58'),_0x239fad['id']);return getEndUser(_0x211ff6,_0x135185[_0xb8c9('0x59')],_0x135185[_0xb8c9('0x74')],_0x478cb6);})[_0xb8c9('0x3a')](function(_0x11c97d){_0x1e6085=_0x11c97d;logger['info'](_0xb8c9('0x6d'),_0x1e6085['id']);return getTicket(_0x211ff6,_0x239fad,_0x1e6085,_0x4f3f2c,_0x135185,_0x4f3f2c[_0xb8c9('0x5a')],_0x478cb6,'Inbound');})[_0xb8c9('0x3a')](function(_0xf7c7dd){_0xda6449=_0xf7c7dd;logger[_0xb8c9('0xd')](_0xb8c9('0x5c'));logger[_0xb8c9('0xd')](_0xb8c9('0x5d'),_0xda6449['id']);return setRelationship(_0x478cb6,_0x239fad,_0xda6449,_0xb8c9('0x6f'));})[_0xb8c9('0x3a')](function(){return setRelationship(_0x478cb6,_0x1e6085,_0xda6449,_0xb8c9('0x5e'));})[_0xb8c9('0x3a')](function(){return getServerInfo(_0x478cb6);})[_0xb8c9('0x70')](function(_0xbe2f57){logger['error']('['+_0x135185[_0xb8c9('0x75')][_0xb8c9('0x72')]()+']',JSON[_0xb8c9('0x23')](_0xbe2f57));});}; \ No newline at end of file +var _0x78aa=['../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','Creating\x20new\x20ticket...','name','getString','Subjects','created_by','Descriptions','slice','replace','duration_hours','duration_minutes','parent_id','Contacts','direction','length','variableName','set_entry','JSON','stringify','apiKey','toString','base64','get_server_info','isNil','info','Getting\x20agent\x20with\x20name','Employees','format','user_name','find','entry_list','name_value_list','value','resolve','user_id','Searching\x20enduser\x20with\x20phone','phone_home','then','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','[HTTP]','map','forEach','type','string','customField','nameField','toLowerCase','content','idField','custom_fields','push','variable','customVariable','Variable','POST','login','username','password','xCALLY\x20Motion\x20integration','sessionID','set_relationship','Calls','queue','stripTrailingSlash','remoteUri','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','The\x20Enduser\x20ID\x20is:','Fields','Inbound','The\x20Ticket\x20ID\x20is:','users','version','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','Outbound','Ticket\x20created!','catch','unmanaged','lastevent','toUpperCase','error','bluebird','md5','ioredis','./util','../../../../config/environment'];(function(_0x46e7ae,_0x1ecf22){var _0x24949a=function(_0x482f5f){while(--_0x482f5f){_0x46e7ae['push'](_0x46e7ae['shift']());}};_0x24949a(++_0x1ecf22);}(_0x78aa,0x1bb));var _0xa78a=function(_0x515f2b,_0x16055a){_0x515f2b=_0x515f2b-0x0;var _0x3d1c64=_0x78aa[_0x515f2b];return _0x3d1c64;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0xa78a('0x0'));var md5=require(_0xa78a('0x1'));var util=require('util');var Redis=require(_0xa78a('0x2'));var intUtil=require(_0xa78a('0x3'));var config=require(_0xa78a('0x4'));var logger=require(_0xa78a('0x5'))('sugarcrm');config[_0xa78a('0x6')]=_[_0xa78a('0x7')](config[_0xa78a('0x6')],{'host':_0xa78a('0x8'),'port':0x18eb});var io=require(_0xa78a('0x9'))(new Redis(config[_0xa78a('0x6')]));var def={'method':'POST','json':!![]};function emit(_0x41edb3,_0xc6b2ea,_0x2ef015){io['to'](_0x41edb3)[_0xa78a('0xa')](_0xc6b2ea,_0x2ef015);}function getTicket(_0x29342a,_0x31d69d,_0x3c02d7,_0xd21cdb,_0xd5bb99,_0x2beb31,_0x5d3bd6,_0x557976){logger['info'](_0xa78a('0xb'));var _0xbcdcac=new Date();var _0x2481b4=[{'name':_0xa78a('0xc'),'value':intUtil[_0xa78a('0xd')](_0xd21cdb[_0xa78a('0xe')],_0xd5bb99,'\x20')},{'name':'assigned_user_id','value':_0x31d69d['id']},{'name':_0xa78a('0xf'),'value':_0x31d69d['id']},{'name':'description','value':intUtil[_0xa78a('0xd')](_0xd21cdb[_0xa78a('0x10')],_0xd5bb99,'\x0a')},{'name':'date_start','value':_0xbcdcac['toISOString']()[_0xa78a('0x11')](0x0,0x13)[_0xa78a('0x12')]('T','\x20')},{'name':_0xa78a('0x13'),'value':'0'},{'name':_0xa78a('0x14'),'value':'15'},{'name':_0xa78a('0x15'),'value':_0x3c02d7['id']},{'name':'parent_type','value':_0xa78a('0x16')},{'name':'parent_name','value':_0x3c02d7['name']},{'name':_0xa78a('0x17'),'value':_0x557976}];if(_0x2beb31[_0xa78a('0x18')]){_['forEach'](_0x2beb31,function(_0x2a3466){if(_0xd5bb99[_0x2a3466[_0xa78a('0x19')]]){_0x2481b4['push']({'name':_0x2a3466['idField'],'value':_0xd5bb99[_0x2a3466[_0xa78a('0x19')]]});}});}return request({'form':{'method':_0xa78a('0x1a'),'input_type':_0xa78a('0x1b'),'response_type':_0xa78a('0x1b'),'rest_data':JSON[_0xa78a('0x1c')]({'session':_0x5d3bd6['id'],'module_name':'Calls','name_value_list':_0x2481b4})}});}function getAuth(_0x2bf818){return util['format']('Basic\x20%s',new Buffer(_0x2bf818[_0xa78a('0x1d')]+':X')[_0xa78a('0x1e')](_0xa78a('0x1f')));}function getServerInfo(_0x39b061){return request({'form':{'method':_0xa78a('0x20'),'input_type':_0xa78a('0x1b'),'response_type':_0xa78a('0x1b'),'rest_data':JSON[_0xa78a('0x1c')]({'session':_0x39b061['id']})}});}function getUser(_0x4c99e3,_0x1a8667,_0x3bb130){if(!_[_0xa78a('0x21')](_0x1a8667)){logger[_0xa78a('0x22')](_0xa78a('0x23'),_0x1a8667);return request({'form':{'method':'get_entry_list','input_type':'JSON','response_type':_0xa78a('0x1b'),'rest_data':JSON['stringify']({'session':_0x3bb130['id'],'module_name':_0xa78a('0x24'),'query':util[_0xa78a('0x25')]('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x1a8667),'order_by':'','offset':'0','select_fields':['id',_0xa78a('0xc'),_0xa78a('0x26')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x5503a3){if(_0x5503a3['entry_list'][_0xa78a('0x18')]){var _0x43df53=_[_0xa78a('0x27')](_0x5503a3[_0xa78a('0x28')],function(_0x210387){return _0x210387[_0xa78a('0x29')][_0xa78a('0x26')][_0xa78a('0x2a')]===_0x1a8667;});if(_0x43df53){logger['info']('Agent\x20found!');return BPromise[_0xa78a('0x2b')]({'id':_0x43df53[_0xa78a('0x29')]['id']['value'],'name':_0x43df53[_0xa78a('0x29')][_0xa78a('0xc')]['value']});}}logger[_0xa78a('0x22')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0xa78a('0x2b')]({'id':_0x3bb130[_0xa78a('0x29')][_0xa78a('0x2c')]['value'],'name':_0x3bb130[_0xa78a('0x29')]['user_name'][_0xa78a('0x2a')]});});}else{logger[_0xa78a('0x22')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise[_0xa78a('0x2b')]({'id':_0x3bb130[_0xa78a('0x29')][_0xa78a('0x2c')][_0xa78a('0x2a')],'name':_0x3bb130['name_value_list'][_0xa78a('0x26')][_0xa78a('0x2a')]});}}function getEndUser(_0x2aeb7f,_0x2ed906,_0x1518ec,_0x21cabb){logger[_0xa78a('0x22')](_0xa78a('0x2d'),_0x1518ec);return request({'form':{'method':'get_entry_list','input_type':_0xa78a('0x1b'),'response_type':_0xa78a('0x1b'),'rest_data':JSON[_0xa78a('0x1c')]({'session':_0x21cabb['id'],'module_name':'Contacts','query':util['format']('contacts.phone_home\x20=\x20\x22%s\x22',_0x1518ec),'order_by':'','offset':'0','select_fields':['id',_0xa78a('0xc'),_0xa78a('0x2e')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xa78a('0x2f')](function(_0x59fb27){if(_0x59fb27[_0xa78a('0x28')][_0xa78a('0x18')]){var _0x55e8e9=_[_0xa78a('0x27')](_0x59fb27[_0xa78a('0x28')],function(_0x119d37){return _0x119d37[_0xa78a('0x29')][_0xa78a('0x2e')][_0xa78a('0x2a')]===_0x1518ec;});if(_0x55e8e9){logger[_0xa78a('0x22')]('Enduser\x20found!');return BPromise[_0xa78a('0x2b')]({'id':_0x55e8e9[_0xa78a('0x29')]['id']['value'],'name':_0x55e8e9[_0xa78a('0x29')][_0xa78a('0xc')]['value'],'phone':_0x55e8e9[_0xa78a('0x29')]['phone_home']['value']});}}else{logger[_0xa78a('0x22')](_0xa78a('0x30'));return request({'form':{'method':_0xa78a('0x1a'),'input_type':_0xa78a('0x1b'),'response_type':_0xa78a('0x1b'),'rest_data':JSON[_0xa78a('0x1c')]({'session':_0x21cabb['id'],'module_name':_0xa78a('0x16'),'name_value_list':[{'name':_0xa78a('0x31'),'value':_0x2ed906!==_0xa78a('0x32')?_0x2ed906:util[_0xa78a('0x25')](_0xa78a('0x33'),_0x1518ec)},{'name':_0xa78a('0x2e'),'value':_0x1518ec}]})}})[_0xa78a('0x2f')](function(_0x5e7d6b){logger[_0xa78a('0x22')]('Enduser\x20created.');return BPromise['resolve']({'id':_0x5e7d6b['id'],'name':_0x5e7d6b[_0xa78a('0x28')][_0xa78a('0x31')][_0xa78a('0x2a')],'phone':_0x5e7d6b[_0xa78a('0x28')][_0xa78a('0x2e')][_0xa78a('0x2a')]});});}});}function request(_0x3457b8){logger['debug'](_0xa78a('0x34'),JSON[_0xa78a('0x1c')](_0x3457b8));return rp(_['merge'](def,_0x3457b8));}function getTags(_0x30de28,_0x80692e){var _0x243b60=[];if(_0x30de28&&_0x30de28[_0xa78a('0x18')]>0x0){_0x243b60=_[_0xa78a('0x35')](_0x30de28,_0x80692e);}return _0x243b60;}function getCustomFields(_0x1c9c51,_0x4d7613){var _0x3fa2ef=[];var _0x25a1b6={'custom_fields':[]};if(_0x1c9c51[_0xa78a('0x18')]>0x0){_[_0xa78a('0x36')](_0x1c9c51,function(_0x1f34d7){if(_0x1f34d7[_0xa78a('0x37')]===_0xa78a('0x38')&&_0x1f34d7['nameField']&&!_0x1f34d7[_0xa78a('0x39')]){_0x25a1b6[_0x1f34d7[_0xa78a('0x3a')][_0xa78a('0x3b')]()]=_0x1f34d7[_0xa78a('0x3c')]['toString']();}else if(_0x1f34d7[_0xa78a('0x37')]==='string'&&_0x1f34d7[_0xa78a('0x3d')]&&_0x1f34d7[_0xa78a('0x39')]){_0x25a1b6[_0xa78a('0x3e')][_0xa78a('0x3f')]({'id':_0x1f34d7[_0xa78a('0x3d')],'value':_0x1f34d7['content'][_0xa78a('0x1e')]()});}else if(_0x1f34d7[_0xa78a('0x37')]===_0xa78a('0x40')&&_0x1f34d7[_0xa78a('0x19')]&&_0x1f34d7[_0xa78a('0x3d')]&&_0x1f34d7['customField']){_0x4d7613[_0x1f34d7[_0xa78a('0x19')]]&&_0x25a1b6[_0xa78a('0x3e')][_0xa78a('0x3f')]({'id':_0x1f34d7[_0xa78a('0x3d')],'value':_0x4d7613[_0x1f34d7[_0xa78a('0x19')]]['toString']()});}else if(_0x1f34d7[_0xa78a('0x37')]===_0xa78a('0x41')&&_0x1f34d7[_0xa78a('0x42')]&&_0x1f34d7['Variable'][_0xa78a('0xc')]&&_0x1f34d7['idField']&&_0x1f34d7[_0xa78a('0x39')]){_0x4d7613[_0x1f34d7['Variable']['name'][_0xa78a('0x3b')]()]&&_0x25a1b6[_0xa78a('0x3e')]['push']({'id':_0x1f34d7['idField'],'value':_0x4d7613[_0x1f34d7[_0xa78a('0x42')][_0xa78a('0xc')]['toLowerCase']()][_0xa78a('0x1e')]()});}});}return _0x25a1b6;}function getConnection(_0x2d0baa){return request({'method':_0xa78a('0x43'),'form':{'method':_0xa78a('0x44'),'input_type':_0xa78a('0x1b'),'response_type':_0xa78a('0x1b'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x2d0baa[_0xa78a('0x45')],'password':_0x2d0baa[_0xa78a('0x46')],'encryption':'PLAIN'},'application':_0xa78a('0x47')})}})[_0xa78a('0x2f')](function(_0x1a127c){var _0x5b714e=_0x1a127c;if(_0x5b714e['id']){def[_0xa78a('0x48')]=_0x5b714e['id'];return BPromise[_0xa78a('0x2b')](_0x5b714e);}else{throw new Error(util[_0xa78a('0x25')]('Account\x20%d\x20is\x20not\x20valid',_0x2d0baa['id']));}});}function setRelationship(_0xd1d51d,_0x353190,_0x5a5470,_0x1d5ac9){return request({'form':{'method':_0xa78a('0x49'),'input_type':'JSON','response_type':_0xa78a('0x1b'),'rest_data':JSON['stringify']({'session':_0xd1d51d['id'],'module_name':_0xa78a('0x4a'),'module_id':_0x5a5470['id'],'link_field_name':_0x1d5ac9,'related_ids':[_0x353190['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xa78a('0x4b')]=function(_0xa419f3,_0xa75f60,_0x448fe4,_0x342c59,_0x4c5c56,_0x169b1c){var _0x10cebb,_0x1721d0,_0x37f0a8,_0xd5725e;_0x169b1c['remoteUri']=intUtil[_0xa78a('0x4c')](_0x169b1c[_0xa78a('0x4d')]);_0x169b1c[_0xa78a('0x4e')]=intUtil[_0xa78a('0x4c')](_0x169b1c[_0xa78a('0x4e')]);def[_0xa78a('0x4f')]=util[_0xa78a('0x25')](_0xa78a('0x50'),_0x169b1c[_0xa78a('0x4d')]);if(_0x4c5c56&&_0x4c5c56[_0xa78a('0x51')]){logger[_0xa78a('0x22')]('[QUEUE]',_0xa78a('0x52'));_0xa75f60[_0xa78a('0x53')]=util[_0xa78a('0x25')](_0xa78a('0x54'),_0x169b1c[_0xa78a('0x4e')],_0xa75f60[_0xa78a('0x55')],md5(_0xa75f60[_0xa78a('0x55')]));}else{_0xa75f60[_0xa78a('0x53')]='';}return getConnection(_0x169b1c)[_0xa78a('0x2f')](function(_0x147f20){_0xd5725e=_0x147f20;return getUser(_0x169b1c,_0x342c59[_0xa78a('0xc')],_0xd5725e);})[_0xa78a('0x2f')](function(_0x1f0211){_0x10cebb=_0x1f0211;logger[_0xa78a('0x22')]('The\x20User\x20ID\x20is:',_0x10cebb['id']);return getEndUser(_0x169b1c,_0xa75f60[_0xa78a('0x56')],_0xa75f60['calleridnum'],_0xd5725e);})[_0xa78a('0x2f')](function(_0x2f85dd){_0x1721d0=_0x2f85dd;logger['info'](_0xa78a('0x57'),_0x1721d0['id']);return getTicket(_0x169b1c,_0x10cebb,_0x1721d0,_0x448fe4,_0xa75f60,_0x448fe4[_0xa78a('0x58')],_0xd5725e,_0xa78a('0x59'));})[_0xa78a('0x2f')](function(_0x434fc0){_0x37f0a8=_0x434fc0;logger[_0xa78a('0x22')]('Ticket\x20created!');logger[_0xa78a('0x22')](_0xa78a('0x5a'),_0x37f0a8['id']);return setRelationship(_0xd5725e,_0x10cebb,_0x37f0a8,_0xa78a('0x5b'));})['then'](function(){return setRelationship(_0xd5725e,_0x1721d0,_0x37f0a8,'contacts');})[_0xa78a('0x2f')](function(){return getServerInfo(_0xd5725e);})[_0xa78a('0x2f')](function(_0x110729){var _0x15738d=parseInt(_0x110729[_0xa78a('0x5c')]['charAt'](0x0));var _0x23e4da=util[_0xa78a('0x25')](_0xa78a('0x5d'),_0x169b1c[_0xa78a('0x4d')],_0x37f0a8['id']);if(_0x15738d>0x6){_0x23e4da=util[_0xa78a('0x25')](_0xa78a('0x5e'),_0x169b1c['remoteUri'],_0x37f0a8['id']);}logger['info'](_0xa78a('0x5f'),_0xa78a('0x60'));emit(util[_0xa78a('0x25')](_0xa78a('0x61'),_0x342c59[_0xa78a('0xc')]),_0xa78a('0x62'),{'uri':_0x23e4da});})['catch'](function(_0xa6c4d7){logger['error']('[QUEUE]',JSON['stringify'](_0xa6c4d7));});};exports[_0xa78a('0x63')]=function(_0x32ad0e,_0x5d2dc2,_0x42fba7,_0x18110c,_0x27dd24,_0x5eca18,_0xd33700){var _0x54eb87,_0x3abe9e,_0xeb4658,_0x4be384;_0x5eca18['remoteUri']=intUtil[_0xa78a('0x4c')](_0x5eca18[_0xa78a('0x4d')]);_0x5eca18['serverUrl']=intUtil[_0xa78a('0x4c')](_0x5eca18[_0xa78a('0x4e')]);def[_0xa78a('0x4f')]=util[_0xa78a('0x25')]('%s/service/v4_1/rest.php',_0x5eca18[_0xa78a('0x4d')]);if(_0xd33700&&_0xd33700[_0xa78a('0x64')]&&_0xd33700[_0xa78a('0x64')]!==_0xa78a('0x65')){logger[_0xa78a('0x22')](_0xa78a('0x66'),'Recording\x20is\x20enabled!');_0x5d2dc2[_0xa78a('0x53')]=util['format'](_0xa78a('0x54'),_0x5eca18[_0xa78a('0x4e')],_0x5d2dc2[_0xa78a('0x55')],md5(_0x5d2dc2[_0xa78a('0x55')]));}return getConnection(_0x5eca18)[_0xa78a('0x2f')](function(_0x54ed36){_0x4be384=_0x54ed36;return getUser(_0x5eca18,_0x18110c[_0xa78a('0xc')],_0x4be384);})['then'](function(_0x3a2664){_0x54eb87=_0x3a2664;logger['info'](_0xa78a('0x67'),_0x54eb87['id']);return getEndUser(_0x5eca18,_0x5d2dc2[_0xa78a('0x68')],_0x5d2dc2['destcalleridnum'],_0x4be384);})['then'](function(_0x307a28){_0x3abe9e=_0x307a28;logger[_0xa78a('0x22')](_0xa78a('0x57'),_0x3abe9e['id']);return getTicket(_0x5eca18,_0x54eb87,_0x3abe9e,_0x42fba7,_0x5d2dc2,_0x42fba7[_0xa78a('0x58')],_0x4be384,_0xa78a('0x69'));})[_0xa78a('0x2f')](function(_0x221a0b){_0xeb4658=_0x221a0b;logger[_0xa78a('0x22')](_0xa78a('0x6a'));logger['info'](_0xa78a('0x5a'),_0xeb4658['id']);return setRelationship(_0x4be384,_0x54eb87,_0xeb4658,_0xa78a('0x5b'));})[_0xa78a('0x2f')](function(){return setRelationship(_0x4be384,_0x3abe9e,_0xeb4658,'contacts');})[_0xa78a('0x2f')](function(){return getServerInfo(_0x4be384);})['then'](function(_0x3039b7){var _0x17a9f6=parseInt(_0x3039b7['version']['charAt'](0x0));var _0x1de14a=util[_0xa78a('0x25')](_0xa78a('0x5d'),_0x5eca18[_0xa78a('0x4d')],_0xeb4658['id']);if(_0x17a9f6>0x6){_0x1de14a=util[_0xa78a('0x25')](_0xa78a('0x5e'),_0x5eca18[_0xa78a('0x4d')],_0xeb4658['id']);}logger[_0xa78a('0x22')](_0xa78a('0x66'),_0xa78a('0x60'));emit(util[_0xa78a('0x25')]('user:%s',_0x18110c[_0xa78a('0xc')]),_0xa78a('0x62'),{'uri':_0x1de14a});})[_0xa78a('0x6b')](function(_0xb8c4e2){logger['error'](_0xa78a('0x66'),JSON[_0xa78a('0x1c')](_0xb8c4e2));});};exports[_0xa78a('0x6c')]=function(_0x23241b,_0x195630,_0x43ae43,_0x99ba2d,_0x129adc,_0x3d3910){var _0x29057,_0x1b1eac,_0x1ee0c1,_0xe3a40;_0x3d3910[_0xa78a('0x4d')]=intUtil[_0xa78a('0x4c')](_0x3d3910[_0xa78a('0x4d')]);_0x3d3910[_0xa78a('0x4e')]=intUtil[_0xa78a('0x4c')](_0x3d3910[_0xa78a('0x4e')]);def[_0xa78a('0x4f')]=util['format'](_0xa78a('0x50'),_0x3d3910[_0xa78a('0x4d')]);if(_0x129adc&&_0x129adc[_0xa78a('0x51')]){logger[_0xa78a('0x22')]('['+_0x195630[_0xa78a('0x6d')][_0xa78a('0x6e')]()+']',_0xa78a('0x52'));_0x195630[_0xa78a('0x53')]=util[_0xa78a('0x25')](_0xa78a('0x54'),_0x3d3910['serverUrl'],_0x195630[_0xa78a('0x55')],md5(_0x195630[_0xa78a('0x55')]));}else{_0x195630[_0xa78a('0x53')]='';}return getConnection(_0x3d3910)['then'](function(_0x5a140b){_0xe3a40=_0x5a140b;if(!_['isNil'](_0x99ba2d)){return getUser(_0x3d3910,_0x99ba2d[_0xa78a('0xc')],_0xe3a40);}else{return getUser(_0x3d3910,null,_0xe3a40);}})[_0xa78a('0x2f')](function(_0x1e6025){_0x29057=_0x1e6025;logger[_0xa78a('0x22')](_0xa78a('0x67'),_0x29057['id']);return getEndUser(_0x3d3910,_0x195630[_0xa78a('0x56')],_0x195630['calleridnum'],_0xe3a40);})['then'](function(_0x32f39c){_0x1b1eac=_0x32f39c;logger[_0xa78a('0x22')](_0xa78a('0x57'),_0x1b1eac['id']);return getTicket(_0x3d3910,_0x29057,_0x1b1eac,_0x43ae43,_0x195630,_0x43ae43['Fields'],_0xe3a40,_0xa78a('0x59'));})['then'](function(_0x2d1cfb){_0x1ee0c1=_0x2d1cfb;logger[_0xa78a('0x22')](_0xa78a('0x6a'));logger[_0xa78a('0x22')](_0xa78a('0x5a'),_0x1ee0c1['id']);return setRelationship(_0xe3a40,_0x29057,_0x1ee0c1,_0xa78a('0x5b'));})['then'](function(){return setRelationship(_0xe3a40,_0x1b1eac,_0x1ee0c1,'contacts');})[_0xa78a('0x2f')](function(){return getServerInfo(_0xe3a40);})['catch'](function(_0x1cd18d){logger[_0xa78a('0x6f')]('['+_0x195630[_0xa78a('0x6d')][_0xa78a('0x6e')]()+']',JSON['stringify'](_0x1cd18d));});}; \ 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 15f8909..df85f79 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 _0x01d5=['isNil','test','lodash','util','getString','length','push','type','variable','variableName','Variable','name','toString','string','key','%s:\x20%s','keyContent','keyType','format','toLowerCase','join','stripTrailingSlash','slice','validateEmail'];(function(_0x4708c0,_0x571b22){var _0x1cb0e0=function(_0x514757){while(--_0x514757){_0x4708c0['push'](_0x4708c0['shift']());}};_0x1cb0e0(++_0x571b22);}(_0x01d5,0x1ca));var _0x501d=function(_0x179620,_0x9d4cd8){_0x179620=_0x179620-0x0;var _0x5f339f=_0x01d5[_0x179620];return _0x5f339f;};'use strict';var _=require(_0x501d('0x0'));var util=require(_0x501d('0x1'));exports[_0x501d('0x2')]=function(_0x3509c0,_0x3513bf,_0x1c652a){var _0x2e3129=[];if(_0x3509c0['length']>0x0){var _0x1bdbc2=_['sortBy'](_0x3509c0,['id']);for(var _0x517542=0x0;_0x517542<_0x1bdbc2[_0x501d('0x3')];_0x517542++){var _0x2276bd=_0x1bdbc2[_0x517542];if(_0x2276bd['type']==='string'){_0x2e3129[_0x501d('0x4')](_0x2276bd['content']);}else if(_0x2276bd[_0x501d('0x5')]===_0x501d('0x6')&&_0x2276bd[_0x501d('0x7')]){_0x3513bf[_0x2276bd[_0x501d('0x7')]]&&_0x2e3129[_0x501d('0x4')](_0x3513bf[_0x2276bd['variableName']]['toString']());}else if(_0x2276bd['type']==='customVariable'&&_0x2276bd[_0x501d('0x8')]&&_0x2276bd[_0x501d('0x8')]['name']){_0x3513bf[_0x2276bd[_0x501d('0x8')][_0x501d('0x9')]['toLowerCase']()]&&_0x2e3129['push'](_0x3513bf[_0x2276bd['Variable'][_0x501d('0x9')]['toLowerCase']()][_0x501d('0xa')]());}else if(_0x2276bd[_0x501d('0x5')]==='keyValue'){if(_0x2276bd['keyType']===_0x501d('0xb')&&_0x2276bd[_0x501d('0xc')]){_0x2e3129[_0x501d('0x4')](util['format'](_0x501d('0xd'),_0x2276bd['key'],_0x2276bd[_0x501d('0xe')]));}else if(_0x2276bd[_0x501d('0xf')]===_0x501d('0x6')&&_0x2276bd[_0x501d('0x7')]&&_0x2276bd[_0x501d('0xc')]){_0x3513bf[_0x2276bd[_0x501d('0x7')]]&&_0x2e3129[_0x501d('0x4')](util[_0x501d('0x10')]('%s:\x20%s',_0x2276bd['key'],_0x3513bf[_0x2276bd[_0x501d('0x7')]]));}else if(_0x2276bd[_0x501d('0xf')]==='customVariable'&&_0x2276bd[_0x501d('0x8')]&&_0x2276bd['Variable'][_0x501d('0x9')]&&_0x2276bd[_0x501d('0xc')]){_0x3513bf[_0x2276bd[_0x501d('0x8')]['name'][_0x501d('0x11')]()]&&_0x2e3129[_0x501d('0x4')](util['format'](_0x501d('0xd'),_0x2276bd[_0x501d('0xc')],_0x3513bf[_0x2276bd[_0x501d('0x8')]['name'][_0x501d('0x11')]()]));}}}}return _0x2e3129[_0x501d('0x12')](_0x1c652a);};exports[_0x501d('0x13')]=function(_0x164031){var _0x28e9bb=_0x164031[_0x501d('0x14')](-0x1);if(_0x28e9bb==='/'){_0x164031=_0x164031['substring'](0x0,_0x164031['lastIndexOf'](_0x28e9bb));}return _0x164031;};exports[_0x501d('0x15')]=function(_0x311a46){if(!_[_0x501d('0x16')](_0x311a46)&&_0x311a46!==''){var _0x3e944c=/^(([^<>()\[\]\\.,;:\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 _0x3e944c[_0x501d('0x17')](String(_0x311a46)[_0x501d('0x11')]());}else{return![];}}; \ No newline at end of file +var _0x44c6=['variableName','push','toString','customVariable','Variable','toLowerCase','name','keyValue','keyType','string','key','format','%s:\x20%s','keyContent','join','slice','substring','lastIndexOf','validateEmail','isNil','test','lodash','util','length','sortBy','type','content','variable'];(function(_0x17928f,_0x4ad33f){var _0x500b63=function(_0x127644){while(--_0x127644){_0x17928f['push'](_0x17928f['shift']());}};_0x500b63(++_0x4ad33f);}(_0x44c6,0xbd));var _0x644c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x44c6[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x644c('0x0'));var util=require(_0x644c('0x1'));exports['getString']=function(_0x5cfa06,_0x4db576,_0xfc69c2){var _0x2ecf49=[];if(_0x5cfa06[_0x644c('0x2')]>0x0){var _0xd79885=_[_0x644c('0x3')](_0x5cfa06,['id']);for(var _0x40e677=0x0;_0x40e677<_0xd79885[_0x644c('0x2')];_0x40e677++){var _0x2e305c=_0xd79885[_0x40e677];if(_0x2e305c[_0x644c('0x4')]==='string'){_0x2ecf49['push'](_0x2e305c[_0x644c('0x5')]);}else if(_0x2e305c['type']===_0x644c('0x6')&&_0x2e305c[_0x644c('0x7')]){_0x4db576[_0x2e305c[_0x644c('0x7')]]&&_0x2ecf49[_0x644c('0x8')](_0x4db576[_0x2e305c['variableName']][_0x644c('0x9')]());}else if(_0x2e305c[_0x644c('0x4')]===_0x644c('0xa')&&_0x2e305c[_0x644c('0xb')]&&_0x2e305c[_0x644c('0xb')]['name']){_0x4db576[_0x2e305c[_0x644c('0xb')]['name'][_0x644c('0xc')]()]&&_0x2ecf49['push'](_0x4db576[_0x2e305c[_0x644c('0xb')][_0x644c('0xd')][_0x644c('0xc')]()][_0x644c('0x9')]());}else if(_0x2e305c['type']===_0x644c('0xe')){if(_0x2e305c[_0x644c('0xf')]===_0x644c('0x10')&&_0x2e305c[_0x644c('0x11')]){_0x2ecf49[_0x644c('0x8')](util[_0x644c('0x12')](_0x644c('0x13'),_0x2e305c['key'],_0x2e305c[_0x644c('0x14')]));}else if(_0x2e305c['keyType']===_0x644c('0x6')&&_0x2e305c[_0x644c('0x7')]&&_0x2e305c['key']){_0x4db576[_0x2e305c[_0x644c('0x7')]]&&_0x2ecf49[_0x644c('0x8')](util[_0x644c('0x12')]('%s:\x20%s',_0x2e305c[_0x644c('0x11')],_0x4db576[_0x2e305c[_0x644c('0x7')]]));}else if(_0x2e305c[_0x644c('0xf')]===_0x644c('0xa')&&_0x2e305c[_0x644c('0xb')]&&_0x2e305c[_0x644c('0xb')][_0x644c('0xd')]&&_0x2e305c[_0x644c('0x11')]){_0x4db576[_0x2e305c[_0x644c('0xb')]['name'][_0x644c('0xc')]()]&&_0x2ecf49[_0x644c('0x8')](util[_0x644c('0x12')](_0x644c('0x13'),_0x2e305c[_0x644c('0x11')],_0x4db576[_0x2e305c[_0x644c('0xb')]['name']['toLowerCase']()]));}}}}return _0x2ecf49[_0x644c('0x15')](_0xfc69c2);};exports['stripTrailingSlash']=function(_0x55ca4a){var _0x43eb43=_0x55ca4a[_0x644c('0x16')](-0x1);if(_0x43eb43==='/'){_0x55ca4a=_0x55ca4a[_0x644c('0x17')](0x0,_0x55ca4a[_0x644c('0x18')](_0x43eb43));}return _0x55ca4a;};exports[_0x644c('0x19')]=function(_0x516e6a){if(!_[_0x644c('0x1a')](_0x516e6a)&&_0x516e6a!==''){var _0xf0fc99=/^(([^<>()\[\]\\.,;:\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 _0xf0fc99[_0x644c('0x1b')](String(_0x516e6a)[_0x644c('0xc')]());}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 24c5581..ee003db 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 _0xa9e0=['variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','Open','Subjects','POST','format','%s/webservice.php','create','username','sessionName','HelpDesk','stringify','then','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','resolve','email1','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','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','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','Fields','split','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridname','lastevent','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','length','forEach','includes','idField','content','toString','type'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function emit(_0x5f41ea,_0x503809,_0xe42b77){io['to'](_0x5f41ea)['emit'](_0x503809,_0xe42b77);}function getCustomFields(_0x52cace,_0x39753a){var _0xf81284={};if(_0x52cace[_0x0a9e('0xb')]>0x0){_[_0x0a9e('0xc')](_0x52cace,function(_0xfeb75b){if(_[_0x0a9e('0xd')](['string','picklist'],_0xfeb75b['type'])&&_0xfeb75b['idField']){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0xfeb75b[_0x0a9e('0xf')][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x12')&&_0xfeb75b[_0x0a9e('0x13')]&&_0xfeb75b['idField']&&_0x39753a[_0xfeb75b[_0x0a9e('0x13')]]){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0x39753a[_0xfeb75b[_0x0a9e('0x13')]][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x14')&&_0xfeb75b['Variable']&&_0xfeb75b[_0x0a9e('0x15')]['name']&&_0xfeb75b[_0x0a9e('0xe')]&&_0x39753a[_0xfeb75b['Variable'][_0x0a9e('0x16')][_0x0a9e('0x17')]()]){_0xf81284[_0xfeb75b['idField']]=_0x39753a[_0xfeb75b[_0x0a9e('0x15')]['name'][_0x0a9e('0x17')]()][_0x0a9e('0x10')]();}});}return _0xf81284;}function createTicket(_0x106033,_0x205fd6,_0x31b1ca,_0x2eb11f,_0x530eb7,_0x20559e,_0x1314ae){logger[_0x0a9e('0x18')](_0x0a9e('0x19'));var _0x105080=_['merge']({'parent_id':'','assigned_user_id':_0x205fd6['id'],'ticketpriorities':_0x0a9e('0x1a'),'ticketstatus':_0x0a9e('0x1b'),'ticket_title':intUtil['getString'](_0x2eb11f[_0x0a9e('0x1c')],_0x530eb7,'\x20'),'description':intUtil['getString'](_0x2eb11f['Descriptions'],_0x530eb7,'\x0a'),'contact_id':_0x31b1ca['id']},getCustomFields(_0x20559e,_0x530eb7));var _0x3a02e1={'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033['remoteUri']),'form':{'operation':_0x0a9e('0x20'),'username':_0x106033[_0x0a9e('0x21')],'sessionName':_0x1314ae[_0x0a9e('0x22')],'elementType':_0x0a9e('0x23'),'element':JSON[_0x0a9e('0x24')](_0x105080)},'json':!![]};return request(_0x3a02e1)[_0x0a9e('0x25')](function(_0x16b1ca){if(_0x16b1ca['success']){return BPromise['resolve']({'id':_0x16b1ca[_0x0a9e('0x26')]['id']});}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x27'),JSON[_0x0a9e('0x24')](_0x16b1ca['error'])));}})[_0x0a9e('0x28')](function(_0x479bc4){var _0x45a1e7=_0x479bc4['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x2b'),_0x45a1e7,JSON[_0x0a9e('0x24')](_0x479bc4));});}function getUser(_0x140511,_0x1538a4,_0x11c3b6){if(intUtil[_0x0a9e('0x2c')](_0x1538a4)){logger['info'](_0x0a9e('0x2d'),_0x1538a4);return request({'method':_0x0a9e('0x2e'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x140511['remoteUri']),'qs':{'operation':_0x0a9e('0x2f'),'username':_0x140511[_0x0a9e('0x21')],'sessionName':_0x11c3b6[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x30'),_0x1538a4)},'json':!![]})[_0x0a9e('0x25')](function(_0x296f41){if(_0x296f41[_0x0a9e('0x31')]&&_0x296f41[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')]('Agent\x20found!');return BPromise[_0x0a9e('0x32')]({'id':_0x296f41[_0x0a9e('0x26')][0x0]['id'],'email':_0x296f41[_0x0a9e('0x26')][0x0][_0x0a9e('0x33')],'name':_0x296f41[_0x0a9e('0x26')][0x0]['first_name']+'\x20'+_0x296f41[_0x0a9e('0x26')][_0x0a9e('0x34')]});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511[_0x0a9e('0x21')],'name':_0x0a9e('0x37')});}})['catch'](function(_0x44295a){var _0x5e7238=_0x44295a[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x39'),_0x5e7238,JSON['stringify'](_0x44295a));});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511['username'],'name':'admin'})[_0x0a9e('0x28')](function(_0x5640eb){var _0x24936a=_0x5640eb[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getUser',_0x24936a,JSON[_0x0a9e('0x24')](_0x5640eb));});}}function getEndUser(_0x3bfce8,_0x3cae,_0x533942,_0x1dbf74){logger[_0x0a9e('0x18')](_0x0a9e('0x3a'),_0x533942);return request({'method':'GET','uri':util['format'](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'qs':{'operation':'query','username':_0x3bfce8[_0x0a9e('0x21')],'sessionName':_0x1dbf74[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x3c'),_0x533942,_0x533942,_0x533942,_0x533942,_0x533942)},'json':!![]})['then'](function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x31')]&&_0x5a594b[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')](_0x0a9e('0x3d'));return BPromise[_0x0a9e('0x32')]({'id':_0x5a594b['result'][0x0]['id'],'name':_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3e')]+'\x20'+_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3f')],'phone':_0x533942});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x40'));return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x20'),'sessionName':_0x1dbf74[_0x0a9e('0x22')],'elementType':_0x0a9e('0x41'),'element':JSON[_0x0a9e('0x24')]({'lastname':_0x3cae,'phone':_0x533942,'assigned_user_id':'\x20'})},'json':!![]})[_0x0a9e('0x25')](function(_0x4d04c8){logger['info'](_0x0a9e('0x42'));return BPromise[_0x0a9e('0x32')]({'id':_0x4d04c8[_0x0a9e('0x26')]['id'],'name':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x3f')],'phone':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x43')]});})[_0x0a9e('0x28')](function(_0x432fcc){var _0x25c6e6=_0x432fcc[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x0a9e('0x44'),_0x25c6e6,JSON[_0x0a9e('0x24')](_0x432fcc));});}});}function getConnection(_0xdd268f){var _0xfbd5ad=_0xdd268f[_0x0a9e('0x21')];var _0xbe9d19=_0xdd268f[_0x0a9e('0x45')];return request({'method':_0x0a9e('0x2e'),'uri':util['format'](_0x0a9e('0x1f'),_0xdd268f['remoteUri']),'qs':{'operation':_0x0a9e('0x46'),'username':_0xfbd5ad},'json':!![]})[_0x0a9e('0x25')](function(_0x8d6dd1){if(_0x8d6dd1['success']){return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0xdd268f[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x47'),'username':_0xfbd5ad,'accessKey':md5(_0x8d6dd1[_0x0a9e('0x26')][_0x0a9e('0x48')]+_0xbe9d19)},'json':!![]});}})['then'](function(_0x13f44d){if(_0x13f44d[_0x0a9e('0x31')]){return BPromise[_0x0a9e('0x32')](_0x13f44d[_0x0a9e('0x26')]);}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x49'),_0xdd268f['id']));}})[_0x0a9e('0x28')](function(_0x19383e){var _0x34febd=_0x19383e['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getConnection',_0x34febd,JSON['stringify'](_0x19383e));});}function request(_0x5ddf84){logger[_0x0a9e('0x18')](_0x0a9e('0x4a'),JSON[_0x0a9e('0x24')](_0x5ddf84));return rp(_0x5ddf84);}exports[_0x0a9e('0x4b')]=function(_0x61bb17,_0x30decb,_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f){var _0x53975a,_0x39d77d,_0x204173,_0x14d602;_0x4b1b9f['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x4b1b9f[_0x0a9e('0x3b')]);if(_0x5d38ae&&_0x5d38ae['monitor_format']){logger['info'](_0x0a9e('0x4d'),'Recording\x20is\x20enabled!');_0x30decb[_0x0a9e('0x4e')]=util['format'](_0x0a9e('0x4f'),_0x4b1b9f[_0x0a9e('0x50')],_0x30decb[_0x0a9e('0x51')],md5(_0x30decb['uniqueid']));}else{_0x30decb[_0x0a9e('0x4e')]='';}return getConnection(_0x4b1b9f)[_0x0a9e('0x25')](function(_0x508b47){_0x14d602=_0x508b47;return getUser(_0x4b1b9f,_0x375c18['email'],_0x14d602);})[_0x0a9e('0x25')](function(_0x3aedd0){_0x53975a=_0x3aedd0;logger['info'](_0x0a9e('0x52'),_0x53975a['id']);return getEndUser(_0x4b1b9f,_0x30decb['calleridname'],_0x30decb[_0x0a9e('0x53')],_0x14d602);})['then'](function(_0xe22ccc){_0x39d77d=_0xe22ccc;logger['info']('The\x20Enduser\x20ID\x20is:',_0x39d77d['id']);return createTicket(_0x4b1b9f,_0x53975a,_0x39d77d,_0x2e5165,_0x30decb,_0x2e5165['Fields'],_0x14d602);})[_0x0a9e('0x25')](function(_0x47de4c){_0x204173=_0x47de4c;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x204173['id']);var _0x232830=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x4b1b9f[_0x0a9e('0x3b')],_['split'](_0x204173['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x4d'),_0x0a9e('0x57'));emit(util[_0x0a9e('0x1e')](_0x0a9e('0x58'),_0x375c18[_0x0a9e('0x16')]),'trigger:browser:url',{'uri':_0x232830});})[_0x0a9e('0x28')](function(_0x26bc80){logger['error'](_0x0a9e('0x4d'),JSON['stringify'](_0x26bc80));});};exports[_0x0a9e('0x59')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee,_0x273cb5,_0x49d231,_0x2244d6,_0x1fc70e){var _0x261adb,_0x7be420,_0x1cca9f,_0x26d7db;_0x2244d6['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x2244d6['remoteUri']);_0x2244d6[_0x0a9e('0x50')]=intUtil[_0x0a9e('0x4c')](_0x2244d6[_0x0a9e('0x50')]);if(_0x1fc70e&&_0x1fc70e['recordingFormat']&&_0x1fc70e[_0x0a9e('0x5a')]!==_0x0a9e('0x5b')){logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),'Recording\x20is\x20enabled!');_0x4b3c1a[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2244d6[_0x0a9e('0x50')],_0x4b3c1a[_0x0a9e('0x51')],md5(_0x4b3c1a[_0x0a9e('0x51')]));}return getConnection(_0x2244d6)[_0x0a9e('0x25')](function(_0x401837){_0x26d7db=_0x401837;return getUser(_0x2244d6,_0x273cb5['email'],_0x26d7db);})[_0x0a9e('0x25')](function(_0x2937e0){_0x261adb=_0x2937e0;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x261adb['id']);return getEndUser(_0x2244d6,_0x4b3c1a[_0x0a9e('0x5d')],_0x4b3c1a['destcalleridnum'],_0x26d7db);})['then'](function(_0x242745){_0x7be420=_0x242745;logger[_0x0a9e('0x18')](_0x0a9e('0x5e'),_0x7be420['id']);return createTicket(_0x2244d6,_0x261adb,_0x7be420,_0x5674ee,_0x4b3c1a,_0x5674ee[_0x0a9e('0x5f')],_0x26d7db);})[_0x0a9e('0x25')](function(_0xc8c264){_0x1cca9f=_0xc8c264;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1cca9f['id']);var _0x2e89b7=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x2244d6[_0x0a9e('0x3b')],_[_0x0a9e('0x60')](_0x1cca9f['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),_0x0a9e('0x57'));emit(util['format'](_0x0a9e('0x58'),_0x273cb5[_0x0a9e('0x16')]),_0x0a9e('0x61'),{'uri':_0x2e89b7});})['catch'](function(_0x1148a1){logger[_0x0a9e('0x29')]('[OUTBOUND]',JSON[_0x0a9e('0x24')](_0x1148a1));});};exports[_0x0a9e('0x62')]=function(_0x3ef315,_0x427946,_0x13b5c0,_0x4a43a8,_0x50cdce,_0x4a2438){var _0x40fb85,_0x18bf5d,_0x1104ad,_0x23a7d3;_0x4a2438[_0x0a9e('0x3b')]=intUtil[_0x0a9e('0x4c')](_0x4a2438[_0x0a9e('0x3b')]);_0x4a2438[_0x0a9e('0x50')]=intUtil['stripTrailingSlash'](_0x4a2438[_0x0a9e('0x50')]);if(_0x50cdce&&_0x50cdce[_0x0a9e('0x63')]){logger[_0x0a9e('0x18')]('['+_0x427946['lastevent'][_0x0a9e('0x64')]()+']','Recording\x20is\x20enabled!');_0x427946[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a2438[_0x0a9e('0x50')],_0x427946[_0x0a9e('0x51')],md5(_0x427946[_0x0a9e('0x51')]));}else{_0x427946[_0x0a9e('0x4e')]='';}return getConnection(_0x4a2438)['then'](function(_0x1d442c){_0x23a7d3=_0x1d442c;return getUser(_0x4a2438,'',_0x23a7d3);})[_0x0a9e('0x25')](function(_0x371533){_0x40fb85=_0x371533;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x40fb85['id']);return getEndUser(_0x4a2438,_0x427946[_0x0a9e('0x65')],_0x427946[_0x0a9e('0x53')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0x361b21){_0x18bf5d=_0x361b21;logger['info'](_0x0a9e('0x5e'),_0x18bf5d['id']);return createTicket(_0x4a2438,_0x40fb85,_0x18bf5d,_0x13b5c0,_0x427946,_0x13b5c0[_0x0a9e('0x5f')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0xf410e5){_0x1104ad=_0xf410e5;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1104ad['id']);})[_0x0a9e('0x28')](function(_0x336dc3){logger[_0x0a9e('0x29')]('['+_0x427946[_0x0a9e('0x66')][_0x0a9e('0x64')]()+']',JSON[_0x0a9e('0x24')](_0x336dc3));});}; \ No newline at end of file +var _0x9c44=['stringify','validateEmail','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','length','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','getUser','admin','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','login','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridnum','lastevent','bluebird','md5','util','ioredis','./util','../../../../config/environment','redis','localhost','socket.io-emitter','emit','forEach','string','picklist','idField','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','getString','Subjects','POST','remoteUri','create','username','sessionName','then','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s'];(function(_0x55012f,_0x120177){var _0x9c1f2f=function(_0x2d0bcf){while(--_0x2d0bcf){_0x55012f['push'](_0x55012f['shift']());}};_0x9c1f2f(++_0x120177);}(_0x9c44,0x178));var _0x49c4=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x9c44[_0x2dea24];return _0x309d58;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var util=require(_0x49c4('0x2'));var Redis=require(_0x49c4('0x3'));var intUtil=require(_0x49c4('0x4'));var config=require(_0x49c4('0x5'));var logger=require('../../../../config/logger')('vTiger');config[_0x49c4('0x6')]=_['defaults'](config[_0x49c4('0x6')],{'host':_0x49c4('0x7'),'port':0x18eb});var io=require(_0x49c4('0x8'))(new Redis(config[_0x49c4('0x6')]));function emit(_0x436234,_0x511d53,_0x11c586){io['to'](_0x436234)[_0x49c4('0x9')](_0x511d53,_0x11c586);}function getCustomFields(_0x1d13fb,_0x4487ca){var _0x4c7d3a={};if(_0x1d13fb['length']>0x0){_[_0x49c4('0xa')](_0x1d13fb,function(_0x313e73){if(_['includes']([_0x49c4('0xb'),_0x49c4('0xc')],_0x313e73['type'])&&_0x313e73['idField']){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x313e73[_0x49c4('0xe')]['toString']();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x10')&&_0x313e73['variableName']&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x11')]]){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x4487ca[_0x313e73[_0x49c4('0x11')]][_0x49c4('0x12')]();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x13')&&_0x313e73[_0x49c4('0x14')]&&_0x313e73['Variable'][_0x49c4('0x15')]&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')][_0x49c4('0x16')]()]){_0x4c7d3a[_0x313e73['idField']]=_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')]['toLowerCase']()]['toString']();}});}return _0x4c7d3a;}function createTicket(_0x3c782d,_0x2f82d5,_0x3addb2,_0x59f29b,_0x24856d,_0x50b151,_0x2cbd50){logger[_0x49c4('0x17')](_0x49c4('0x18'));var _0x291526=_[_0x49c4('0x19')]({'parent_id':'','assigned_user_id':_0x2f82d5['id'],'ticketpriorities':_0x49c4('0x1a'),'ticketstatus':_0x49c4('0x1b'),'ticket_title':intUtil[_0x49c4('0x1c')](_0x59f29b[_0x49c4('0x1d')],_0x24856d,'\x20'),'description':intUtil['getString'](_0x59f29b['Descriptions'],_0x24856d,'\x0a'),'contact_id':_0x3addb2['id']},getCustomFields(_0x50b151,_0x24856d));var _0x57f502={'method':_0x49c4('0x1e'),'uri':util['format']('%s/webservice.php',_0x3c782d[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x20'),'username':_0x3c782d[_0x49c4('0x21')],'sessionName':_0x2cbd50[_0x49c4('0x22')],'elementType':'HelpDesk','element':JSON['stringify'](_0x291526)},'json':!![]};return request(_0x57f502)[_0x49c4('0x23')](function(_0x9cb797){if(_0x9cb797['success']){return BPromise[_0x49c4('0x24')]({'id':_0x9cb797[_0x49c4('0x25')]['id']});}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x27'),JSON['stringify'](_0x9cb797['error'])));}})[_0x49c4('0x28')](function(_0x53c199){var _0x3800b7=_0x53c199[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'createTicket',_0x3800b7,JSON[_0x49c4('0x2c')](_0x53c199));});}function getUser(_0x2b2793,_0x46e04d,_0x4f28a2){if(intUtil[_0x49c4('0x2d')](_0x46e04d)){logger[_0x49c4('0x17')](_0x49c4('0x2e'),_0x46e04d);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2b2793[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x2b2793['username'],'sessionName':_0x4f28a2['sessionName'],'query':util[_0x49c4('0x26')](_0x49c4('0x31'),_0x46e04d)},'json':!![]})[_0x49c4('0x23')](function(_0x27e467){if(_0x27e467[_0x49c4('0x32')]&&_0x27e467['result'][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x34'));return BPromise[_0x49c4('0x24')]({'id':_0x27e467['result'][0x0]['id'],'email':_0x27e467['result'][0x0][_0x49c4('0x35')],'name':_0x27e467[_0x49c4('0x25')][0x0][_0x49c4('0x36')]+'\x20'+_0x27e467[_0x49c4('0x25')][_0x49c4('0x37')]});}else{logger['info'](_0x49c4('0x38'));return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2[_0x49c4('0x39')],'email':_0x2b2793['username'],'name':'admin'});}})[_0x49c4('0x28')](function(_0x1991e9){var _0x3bec0a=_0x1991e9[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x3a'),_0x3bec0a,JSON[_0x49c4('0x2c')](_0x1991e9));});}else{logger[_0x49c4('0x17')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2['userId'],'email':_0x2b2793[_0x49c4('0x21')],'name':_0x49c4('0x3b')})[_0x49c4('0x28')](function(_0x1c2830){var _0x4ed4f8=_0x1c2830[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'getUser',_0x4ed4f8,JSON[_0x49c4('0x2c')](_0x1c2830));});}}function getEndUser(_0x21d8c7,_0x178987,_0x5e5366,_0x1ba7a0){logger[_0x49c4('0x17')](_0x49c4('0x3c'),_0x5e5366);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x21d8c7[_0x49c4('0x21')],'sessionName':_0x1ba7a0[_0x49c4('0x22')],'query':util[_0x49c4('0x26')](_0x49c4('0x3d'),_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366)},'json':!![]})[_0x49c4('0x23')](function(_0x29dd5d){if(_0x29dd5d[_0x49c4('0x32')]&&_0x29dd5d[_0x49c4('0x25')][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x3e'));return BPromise[_0x49c4('0x24')]({'id':_0x29dd5d[_0x49c4('0x25')][0x0]['id'],'name':_0x29dd5d['result'][0x0][_0x49c4('0x3f')]+'\x20'+_0x29dd5d['result'][0x0][_0x49c4('0x40')],'phone':_0x5e5366});}else{logger[_0x49c4('0x17')](_0x49c4('0x41'));return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7['remoteUri']),'form':{'operation':'create','sessionName':_0x1ba7a0[_0x49c4('0x22')],'elementType':_0x49c4('0x42'),'element':JSON[_0x49c4('0x2c')]({'lastname':_0x178987,'phone':_0x5e5366,'assigned_user_id':'\x20'})},'json':!![]})[_0x49c4('0x23')](function(_0x490823){logger[_0x49c4('0x17')](_0x49c4('0x43'));return BPromise[_0x49c4('0x24')]({'id':_0x490823[_0x49c4('0x25')]['id'],'name':_0x490823[_0x49c4('0x25')][_0x49c4('0x40')],'phone':_0x490823[_0x49c4('0x25')][_0x49c4('0x44')]});})[_0x49c4('0x28')](function(_0x5640d3){var _0x2ad771=_0x5640d3['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x45'),_0x2ad771,JSON[_0x49c4('0x2c')](_0x5640d3));});}});}function getConnection(_0x2d93d8){var _0x5b296d=_0x2d93d8[_0x49c4('0x21')];var _0x15b674=_0x2d93d8[_0x49c4('0x46')];return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'qs':{'operation':'getchallenge','username':_0x5b296d},'json':!![]})[_0x49c4('0x23')](function(_0x5cfff9){if(_0x5cfff9[_0x49c4('0x32')]){return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x47'),'username':_0x5b296d,'accessKey':md5(_0x5cfff9[_0x49c4('0x25')]['token']+_0x15b674)},'json':!![]});}})[_0x49c4('0x23')](function(_0x3feaf0){if(_0x3feaf0['success']){return BPromise[_0x49c4('0x24')](_0x3feaf0[_0x49c4('0x25')]);}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x48'),_0x2d93d8['id']));}})['catch'](function(_0x5d8bf0){var _0x144fd2=_0x5d8bf0['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x49'),_0x144fd2,JSON[_0x49c4('0x2c')](_0x5d8bf0));});}function request(_0x240c20){logger[_0x49c4('0x17')](_0x49c4('0x4a'),JSON['stringify'](_0x240c20));return rp(_0x240c20);}exports[_0x49c4('0x4b')]=function(_0x1550ce,_0x3936d3,_0x3d944c,_0x17ef75,_0x2644c0,_0x156748){var _0x25d174,_0x1e0b4f,_0x1856be,_0x5b822f;_0x156748['remoteUri']=intUtil[_0x49c4('0x4c')](_0x156748[_0x49c4('0x1f')]);if(_0x2644c0&&_0x2644c0['monitor_format']){logger['info'](_0x49c4('0x4d'),'Recording\x20is\x20enabled!');_0x3936d3['recordingURL']=util[_0x49c4('0x26')](_0x49c4('0x4e'),_0x156748[_0x49c4('0x4f')],_0x3936d3[_0x49c4('0x50')],md5(_0x3936d3[_0x49c4('0x50')]));}else{_0x3936d3[_0x49c4('0x51')]='';}return getConnection(_0x156748)[_0x49c4('0x23')](function(_0x50798e){_0x5b822f=_0x50798e;return getUser(_0x156748,_0x17ef75[_0x49c4('0x52')],_0x5b822f);})[_0x49c4('0x23')](function(_0x207572){_0x25d174=_0x207572;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x25d174['id']);return getEndUser(_0x156748,_0x3936d3[_0x49c4('0x54')],_0x3936d3['calleridnum'],_0x5b822f);})['then'](function(_0x1ef0c1){_0x1e0b4f=_0x1ef0c1;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0x1e0b4f['id']);return createTicket(_0x156748,_0x25d174,_0x1e0b4f,_0x3d944c,_0x3936d3,_0x3d944c[_0x49c4('0x56')],_0x5b822f);})[_0x49c4('0x23')](function(_0x6b2592){_0x1856be=_0x6b2592;logger[_0x49c4('0x17')]('Ticket\x20created!');logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x1856be['id']);var _0x4ba4eb=util[_0x49c4('0x26')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x156748[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x1856be['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x4d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x17ef75[_0x49c4('0x15')]),'trigger:browser:url',{'uri':_0x4ba4eb});})[_0x49c4('0x28')](function(_0x27b9c2){logger['error'](_0x49c4('0x4d'),JSON[_0x49c4('0x2c')](_0x27b9c2));});};exports['outbound']=function(_0x39c455,_0x42e0e6,_0x4f50bf,_0x4dc54d,_0x589484,_0x513879,_0xc43386){var _0x54947d,_0xb20a5d,_0x32f344,_0x515240;_0x513879[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x513879['remoteUri']);_0x513879[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x513879[_0x49c4('0x4f')]);if(_0xc43386&&_0xc43386[_0x49c4('0x5b')]&&_0xc43386['recordingFormat']!==_0x49c4('0x5c')){logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x5e'));_0x42e0e6['recordingURL']=util[_0x49c4('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x513879['serverUrl'],_0x42e0e6['uniqueid'],md5(_0x42e0e6['uniqueid']));}return getConnection(_0x513879)[_0x49c4('0x23')](function(_0x32eaef){_0x515240=_0x32eaef;return getUser(_0x513879,_0x4dc54d[_0x49c4('0x52')],_0x515240);})[_0x49c4('0x23')](function(_0x5b056e){_0x54947d=_0x5b056e;logger['info'](_0x49c4('0x53'),_0x54947d['id']);return getEndUser(_0x513879,_0x42e0e6[_0x49c4('0x5f')],_0x42e0e6[_0x49c4('0x60')],_0x515240);})[_0x49c4('0x23')](function(_0x102c15){_0xb20a5d=_0x102c15;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0xb20a5d['id']);return createTicket(_0x513879,_0x54947d,_0xb20a5d,_0x4f50bf,_0x42e0e6,_0x4f50bf[_0x49c4('0x56')],_0x515240);})['then'](function(_0x2276db){_0x32f344=_0x2276db;logger['info'](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x32f344['id']);var _0x1ea1b4=util[_0x49c4('0x26')](_0x49c4('0x62'),_0x513879[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x32f344['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x4dc54d[_0x49c4('0x15')]),_0x49c4('0x63'),{'uri':_0x1ea1b4});})[_0x49c4('0x28')](function(_0x371e49){logger[_0x49c4('0x2a')]('[OUTBOUND]',JSON['stringify'](_0x371e49));});};exports[_0x49c4('0x64')]=function(_0x16b3e8,_0x4af680,_0x1a15f3,_0x38ad50,_0x2939fd,_0x16e7b1){var _0x4d6aaa,_0x5a14a5,_0x4a85d4,_0x2e90d8;_0x16e7b1[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x1f')]);_0x16e7b1[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x4f')]);if(_0x2939fd&&_0x2939fd[_0x49c4('0x65')]){logger[_0x49c4('0x17')]('['+_0x4af680['lastevent'][_0x49c4('0x66')]()+']',_0x49c4('0x5e'));_0x4af680[_0x49c4('0x51')]=util['format'](_0x49c4('0x4e'),_0x16e7b1[_0x49c4('0x4f')],_0x4af680[_0x49c4('0x50')],md5(_0x4af680[_0x49c4('0x50')]));}else{_0x4af680[_0x49c4('0x51')]='';}return getConnection(_0x16e7b1)[_0x49c4('0x23')](function(_0x35fa39){_0x2e90d8=_0x35fa39;return getUser(_0x16e7b1,'',_0x2e90d8);})[_0x49c4('0x23')](function(_0x4ba198){_0x4d6aaa=_0x4ba198;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x4d6aaa['id']);return getEndUser(_0x16e7b1,_0x4af680[_0x49c4('0x54')],_0x4af680[_0x49c4('0x67')],_0x2e90d8);})[_0x49c4('0x23')](function(_0x4a204d){_0x5a14a5=_0x4a204d;logger['info'](_0x49c4('0x55'),_0x5a14a5['id']);return createTicket(_0x16e7b1,_0x4d6aaa,_0x5a14a5,_0x1a15f3,_0x4af680,_0x1a15f3['Fields'],_0x2e90d8);})[_0x49c4('0x23')](function(_0x558880){_0x4a85d4=_0x558880;logger[_0x49c4('0x17')](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x4a85d4['id']);})['catch'](function(_0x123060){logger[_0x49c4('0x2a')]('['+_0x4af680[_0x49c4('0x68')][_0x49c4('0x66')]()+']',JSON[_0x49c4('0x2c')](_0x123060));});}; \ 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 9d86d83..40c5563 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 _0x0043=['util','ioredis','../../../../config/environment','redis','defaults','localhost','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','merge','Tags','getString','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','count','Agent\x20found!','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','end-user','length','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','username','%s/token:%s','token','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','GET','map','forEach','includes','string','type','nameField','customField','toLowerCase','idField','custom_fields','push','content','variable','variableName','customVariable','Variable','name','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','integrationTab','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','outbound','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridnum','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','POST','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','unmanaged','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','request-promise','md5'];(function(_0x3a8fae,_0xff5dea){var _0x5e5f32=function(_0x521dfe){while(--_0x521dfe){_0x3a8fae['push'](_0x3a8fae['shift']());}};_0x5e5f32(++_0xff5dea);}(_0x0043,0xde));var _0x3004=function(_0x58547b,_0x4b89c2){_0x58547b=_0x58547b-0x0;var _0x1d3fd2=_0x0043[_0x58547b];return _0x1d3fd2;};'use strict';var _=require('lodash');var rp=require(_0x3004('0x0'));var md5=require(_0x3004('0x1'));var util=require(_0x3004('0x2'));var Redis=require(_0x3004('0x3'));var intUtil=require('./util');var config=require(_0x3004('0x4'));var logger=require('../../../../config/logger')('zendesk');config[_0x3004('0x5')]=_[_0x3004('0x6')](config[_0x3004('0x5')],{'host':_0x3004('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3004('0x5')]));function emit(_0x1675d5,_0xac9d68,_0x1ea72d){io['to'](_0x1675d5)[_0x3004('0x8')](_0xac9d68,_0x1ea72d);}var headers={'Content-Type':_0x3004('0x9'),'Accept':_0x3004('0x9')};function getTicket(_0x3656d6,_0x1f13cc,_0x5809b7,_0x51b9ee,_0x4a020c){logger[_0x3004('0xa')](_0x3004('0xb'));return request({'uri':util[_0x3004('0xc')](_0x3004('0xd'),_0x3656d6[_0x3004('0xe')]),'method':'POST','body':{'ticket':_[_0x3004('0xf')]({'requester_id':_0x5809b7['id'],'submitter_id':_0x1f13cc?_0x1f13cc['id']:undefined,'assignee_id':_0x1f13cc?_0x1f13cc['id']:undefined,'tags':getTags(_0x51b9ee[_0x3004('0x10')],'name'),'subject':intUtil['getString'](_0x51b9ee['Subjects'],_0x4a020c,'\x20'),'description':intUtil[_0x3004('0x11')](_0x51b9ee[_0x3004('0x12')],_0x4a020c,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x51b9ee[_0x3004('0x12')],_0x4a020c,'\x0a')}},getCustomFields(_0x51b9ee[_0x3004('0x13')],_0x4a020c))}})[_0x3004('0x14')](function(_0x26ec4b){logger[_0x3004('0xa')](_0x3004('0x15'));return _0x26ec4b[_0x3004('0x16')];});}function getUser(_0x473d85,_0x2e95a6){if(intUtil[_0x3004('0x17')](_0x2e95a6)){logger[_0x3004('0xa')](_0x3004('0x18'),_0x2e95a6);return request({'uri':util[_0x3004('0xc')](_0x3004('0x19'),_0x473d85[_0x3004('0xe')]),'qs':{'query':util[_0x3004('0xc')]('type:user\x20role:agent\x20email:%s',_0x2e95a6)}})[_0x3004('0x14')](function(_0xf9498f){if(_0xf9498f[_0x3004('0x1a')]){logger['info'](_0x3004('0x1b'));return _['find'](_0xf9498f[_0x3004('0x1c')],{'email':_0x2e95a6,'role':_0x3004('0x1d')});}else{logger[_0x3004('0xa')](_0x3004('0x1e'));return request({'uri':util[_0x3004('0xc')](_0x3004('0x1f'),_0x473d85[_0x3004('0xe')])})[_0x3004('0x14')](function(_0x2bd772){logger['info'](_0x3004('0x20'));return _0x2bd772[_0x3004('0x21')];});}});}else{logger[_0x3004('0xa')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0x3004('0x1f'),_0x473d85['remoteUri'])})[_0x3004('0x14')](function(_0x1246d2){logger['info']('Admin\x20account\x20selected.');return _0x1246d2[_0x3004('0x21')];});}}function getEndUser(_0x3a51cf,_0x490013,_0x132dcf){logger[_0x3004('0xa')](_0x3004('0x22'),_0x132dcf);return request({'uri':util[_0x3004('0xc')](_0x3004('0x19'),_0x3a51cf['remoteUri']),'qs':{'query':util[_0x3004('0xc')](_0x3004('0x23'),_0x132dcf)}})[_0x3004('0x14')](function(_0x148891){var _0x40a733;if(_0x148891['results']['length']){_0x148891[_0x3004('0x1c')]=_['filter'](_0x148891['results'],{'suspended':![],'role':_0x3004('0x24')});if(_0x148891[_0x3004('0x1c')][_0x3004('0x25')]){_0x40a733=_['first'](_0x148891['results']);}}if(_0x40a733){logger[_0x3004('0xa')](_0x3004('0x26'));return _0x40a733;}else{logger[_0x3004('0xa')](_0x3004('0x27'));return request({'uri':util['format']('%s/users.json',_0x3a51cf[_0x3004('0xe')]),'method':'POST','body':{'user':{'role':_0x3004('0x24'),'name':util[_0x3004('0xc')](_0x3004('0x28'),_0x490013||_0x132dcf),'phone':_0x132dcf}}})[_0x3004('0x14')](function(_0xe1041){logger[_0x3004('0xa')](_0x3004('0x29'));return _0xe1041[_0x3004('0x21')];});}});}function getAuth(_0x433120){var _0x4a7eec;if(_0x433120[_0x3004('0x2a')]===_0x3004('0x2b')){_0x4a7eec=util[_0x3004('0xc')](_0x3004('0x2c'),_0x433120[_0x3004('0x2d')],_0x433120[_0x3004('0x2b')]);}else if(_0x433120[_0x3004('0x2a')]==='token'){_0x4a7eec=util[_0x3004('0xc')](_0x3004('0x2e'),_0x433120['username'],_0x433120[_0x3004('0x2f')]);}return util['format'](_0x3004('0x30'),new Buffer(_0x4a7eec)[_0x3004('0x31')](_0x3004('0x32')));}function request(_0x546cb7){logger[_0x3004('0x33')](_0x3004('0x34'),JSON[_0x3004('0x35')](_0x546cb7));return rp(_[_0x3004('0x6')](_0x546cb7,{'method':_0x3004('0x36'),'headers':headers,'json':!![]}));}function getTags(_0x132dce,_0x112656){var _0x2658e4=[];if(_0x132dce&&_0x132dce[_0x3004('0x25')]>0x0){_0x2658e4=_[_0x3004('0x37')](_0x132dce,_0x112656);}return _0x2658e4;}function getCustomFields(_0x22118c,_0x128c15){var _0x7a3513=[];var _0x20cc09={'custom_fields':[]};if(_0x22118c[_0x3004('0x25')]>0x0){_[_0x3004('0x38')](_0x22118c,function(_0x55e446){if(_[_0x3004('0x39')]([_0x3004('0x3a'),'picklist'],_0x55e446[_0x3004('0x3b')])&&_0x55e446[_0x3004('0x3c')]&&!_0x55e446[_0x3004('0x3d')]){_0x20cc09[_0x55e446['nameField'][_0x3004('0x3e')]()]=_0x55e446['content'][_0x3004('0x31')]();}else if(_['includes']([_0x3004('0x3a'),'picklist'],_0x55e446[_0x3004('0x3b')])&&_0x55e446[_0x3004('0x3f')]&&_0x55e446[_0x3004('0x3d')]){_0x20cc09[_0x3004('0x40')][_0x3004('0x41')]({'id':_0x55e446[_0x3004('0x3f')],'value':_0x55e446[_0x3004('0x42')][_0x3004('0x31')]()});}else if(_0x55e446[_0x3004('0x3b')]===_0x3004('0x43')&&_0x55e446['variableName']&&_0x55e446[_0x3004('0x3f')]&&_0x55e446[_0x3004('0x3d')]){_0x128c15[_0x55e446[_0x3004('0x44')]]&&_0x20cc09[_0x3004('0x40')][_0x3004('0x41')]({'id':_0x55e446[_0x3004('0x3f')],'value':_0x128c15[_0x55e446[_0x3004('0x44')]][_0x3004('0x31')]()});}else if(_0x55e446['type']===_0x3004('0x45')&&_0x55e446[_0x3004('0x46')]&&_0x55e446[_0x3004('0x46')]['name']&&_0x55e446[_0x3004('0x3f')]&&_0x55e446[_0x3004('0x3d')]){_0x128c15[_0x55e446[_0x3004('0x46')][_0x3004('0x47')][_0x3004('0x3e')]()]&&_0x20cc09[_0x3004('0x40')][_0x3004('0x41')]({'id':_0x55e446[_0x3004('0x3f')],'value':_0x128c15[_0x55e446[_0x3004('0x46')][_0x3004('0x47')][_0x3004('0x3e')]()][_0x3004('0x31')]()});}});}return _0x20cc09;}exports[_0x3004('0x48')]=function(_0xf82961,_0x2e3581,_0x404eea,_0x481b24,_0x4d05ce,_0x317af0){var _0x3f674a,_0x2422a2;_0x317af0[_0x3004('0xe')]=intUtil[_0x3004('0x49')](_0x317af0[_0x3004('0xe')]);_0x317af0[_0x3004('0x4a')]=intUtil[_0x3004('0x49')](_0x317af0[_0x3004('0x4a')]);if(_0x4d05ce&&_0x4d05ce[_0x3004('0x4b')]){logger[_0x3004('0xa')](_0x3004('0x4c'),'Recording\x20is\x20enabled!');_0x2e3581['recordingURL']=util[_0x3004('0xc')](_0x3004('0x4d'),_0x317af0[_0x3004('0x4a')],_0x2e3581[_0x3004('0x4e')],md5(_0x2e3581[_0x3004('0x4e')]));}else{_0x2e3581[_0x3004('0x4f')]='';}headers[_0x3004('0x50')]=getAuth(_0x317af0);return getUser(_0x317af0,_0x481b24[_0x3004('0x51')])[_0x3004('0x14')](function(_0x98f58){_0x3f674a=_0x98f58;logger[_0x3004('0xa')](_0x3004('0x52'),_0x3f674a['id']);return getEndUser(_0x317af0,_0x2e3581[_0x3004('0x53')],_0x2e3581[_0x3004('0x54')]);})[_0x3004('0x14')](function(_0x5461ea){_0x2422a2=_0x5461ea;logger[_0x3004('0xa')](_0x3004('0x55'),_0x2422a2['id']);return getTicket(_0x317af0,_0x3f674a,_0x2422a2,_0x404eea,_0x2e3581);})[_0x3004('0x14')](function(_0x334599){if(_0x334599){logger[_0x3004('0xa')]('The\x20Ticket\x20ID\x20is:',_0x334599['id']);switch(_0x317af0[_0x3004('0x3b')]){case _0x3004('0x56'):logger[_0x3004('0xa')](_0x3004('0x4c'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util['format'](_0x3004('0x57'),_0x317af0[_0x3004('0xe')],_0x3f674a['id'],_0x334599['id']),'method':'POST'});case _0x3004('0x58'):logger[_0x3004('0xa')](_0x3004('0x4c'),_0x3004('0x59'));emit(util['format'](_0x3004('0x5a'),_0x481b24[_0x3004('0x47')]),_0x3004('0x5b'),{'uri':util[_0x3004('0xc')](_0x3004('0x5c'),_0x317af0[_0x3004('0xe')]['replace'](_0x3004('0x5d'),''),_0x334599['id'])});break;default:logger[_0x3004('0x5e')](_0x3004('0x4c'),_0x3004('0x5f'));}}})[_0x3004('0x60')](function(_0x36916b){logger[_0x3004('0x5e')](_0x3004('0x61'),util['inspect'](_0x36916b,{'showHidden':!![],'depth':null}));});};exports[_0x3004('0x62')]=function(_0x39b8a1,_0x4287f5,_0x3af181,_0xd7c2ce,_0x210a93,_0x15df36,_0x1e5fb9){var _0x5022a5,_0x50066d;_0x15df36[_0x3004('0xe')]=intUtil[_0x3004('0x49')](_0x15df36[_0x3004('0xe')]);_0x15df36['serverUrl']=intUtil[_0x3004('0x49')](_0x15df36['serverUrl']);if(_0x1e5fb9&&_0x1e5fb9[_0x3004('0x63')]&&_0x1e5fb9[_0x3004('0x63')]!=='none'){logger[_0x3004('0xa')](_0x3004('0x64'),_0x3004('0x65'));_0x4287f5[_0x3004('0x4f')]=util[_0x3004('0xc')](_0x3004('0x4d'),_0x15df36['serverUrl'],_0x4287f5['uniqueid'],md5(_0x4287f5['uniqueid']));}headers['Authorization']=getAuth(_0x15df36);return getUser(_0x15df36,_0xd7c2ce['email'])['then'](function(_0x6bad22){_0x5022a5=_0x6bad22;logger[_0x3004('0xa')](_0x3004('0x52'),_0x5022a5['id']);return getEndUser(_0x15df36,_0x4287f5['destcalleridname'],_0x4287f5[_0x3004('0x66')]);})[_0x3004('0x14')](function(_0x174fdc){_0x50066d=_0x174fdc;logger[_0x3004('0xa')](_0x3004('0x55'),_0x50066d['id']);return getTicket(_0x15df36,_0x5022a5,_0x50066d,_0x3af181,_0x4287f5);})[_0x3004('0x14')](function(_0x4a5818){if(_0x4a5818){logger[_0x3004('0xa')](_0x3004('0x67'),_0x4a5818['id']);switch(_0x15df36['type']){case _0x3004('0x56'):logger[_0x3004('0xa')](_0x3004('0x64'),_0x3004('0x68'));return request({'uri':util[_0x3004('0xc')](_0x3004('0x57'),_0x15df36[_0x3004('0xe')],_0x5022a5['id'],_0x4a5818['id']),'method':_0x3004('0x69')});case'newTab':logger[_0x3004('0xa')](_0x3004('0x64'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x3004('0x5a'),_0xd7c2ce[_0x3004('0x47')]),_0x3004('0x5b'),{'uri':util[_0x3004('0xc')](_0x3004('0x5c'),_0x15df36[_0x3004('0xe')]['replace'](_0x3004('0x5d'),''),_0x4a5818['id'])});break;default:logger['error'](_0x3004('0x64'),_0x3004('0x5f'));}}})[_0x3004('0x60')](function(_0x25a1bb){logger[_0x3004('0x5e')](_0x3004('0x6a'),util[_0x3004('0x6b')](_0x25a1bb,{'showHidden':!![],'depth':null}));});};exports[_0x3004('0x6c')]=function(_0xac4b0a,_0x52766a,_0x19f24d,_0x4cd109,_0x44fa2e,_0x942066){var _0x3a15fd,_0x19ec2b;_0x942066[_0x3004('0xe')]=intUtil[_0x3004('0x49')](_0x942066[_0x3004('0xe')]);_0x942066['serverUrl']=intUtil[_0x3004('0x49')](_0x942066[_0x3004('0x4a')]);if(_0x44fa2e&&_0x44fa2e[_0x3004('0x4b')]){logger[_0x3004('0xa')]('['+_0x52766a[_0x3004('0x6d')][_0x3004('0x6e')]()+']',_0x3004('0x65'));_0x52766a[_0x3004('0x4f')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x942066['serverUrl'],_0x52766a[_0x3004('0x4e')],md5(_0x52766a[_0x3004('0x4e')]));}else{_0x52766a[_0x3004('0x4f')]='';}headers[_0x3004('0x50')]=getAuth(_0x942066);return getUser(_0x942066)['then'](function(_0x5528ac){_0x3a15fd=_0x5528ac;logger[_0x3004('0xa')](_0x3004('0x52'),_0x3a15fd['id']);return getEndUser(_0x942066,_0x52766a['calleridname'],_0x52766a[_0x3004('0x54')]);})[_0x3004('0x14')](function(_0x30cab2){_0x19ec2b=_0x30cab2;logger[_0x3004('0xa')]('The\x20Enduser\x20ID\x20is:',_0x19ec2b['id']);return getTicket(_0x942066,_0x3a15fd,_0x19ec2b,_0x19f24d,_0x52766a);})[_0x3004('0x14')](function(_0x168ed4){if(_0x168ed4){logger[_0x3004('0xa')](_0x3004('0x67'),_0x168ed4['id']);}})[_0x3004('0x60')](function(_0x11f086){logger[_0x3004('0x5e')]('['+_0x52766a[_0x3004('0x6d')][_0x3004('0x6e')]()+']'+_0x3004('0x6f'),util[_0x3004('0x6b')](_0x11f086,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x0149=['toString','base64','debug','[HTTP]','map','includes','string','picklist','type','nameField','customField','toLowerCase','idField','custom_fields','push','content','variable','variableName','customVariable','Variable','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','email','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','user:%s','%s/agent/tickets/%s','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','Authorization','The\x20User\x20ID\x20is:','destcalleridnum','Displaying\x20ticket\x20to\x20agent...','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','replace','catch','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','calleridname','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','defaults','redis','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','%s/tickets.json','remoteUri','POST','merge','name','getString','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','format','then','count','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','type:user\x20role:end-user\x20phone:%s','filter','length','first','Enduser\x20found!','%s/users.json','end-user','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','username','token','Basic\x20%s'];(function(_0x11ac0d,_0x4b5deb){var _0x145496=function(_0x10a367){while(--_0x10a367){_0x11ac0d['push'](_0x11ac0d['shift']());}};_0x145496(++_0x4b5deb);}(_0x0149,0xab));var _0x9014=function(_0x5e8e6d,_0x20c80b){_0x5e8e6d=_0x5e8e6d-0x0;var _0x5c2bac=_0x0149[_0x5e8e6d];return _0x5c2bac;};'use strict';var _=require(_0x9014('0x0'));var rp=require(_0x9014('0x1'));var md5=require(_0x9014('0x2'));var util=require(_0x9014('0x3'));var Redis=require(_0x9014('0x4'));var intUtil=require(_0x9014('0x5'));var config=require(_0x9014('0x6'));var logger=require(_0x9014('0x7'))(_0x9014('0x8'));config['redis']=_[_0x9014('0x9')](config[_0x9014('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0x9014('0xb'))(new Redis(config['redis']));function emit(_0x99aeb4,_0x37864b,_0x18c67b){io['to'](_0x99aeb4)[_0x9014('0xc')](_0x37864b,_0x18c67b);}var headers={'Content-Type':_0x9014('0xd'),'Accept':'application/json'};function getTicket(_0x21c5b2,_0x414ce5,_0x431d32,_0x2d04c3,_0x1833a1){logger[_0x9014('0xe')](_0x9014('0xf'));return request({'uri':util['format'](_0x9014('0x10'),_0x21c5b2[_0x9014('0x11')]),'method':_0x9014('0x12'),'body':{'ticket':_[_0x9014('0x13')]({'requester_id':_0x431d32['id'],'submitter_id':_0x414ce5?_0x414ce5['id']:undefined,'assignee_id':_0x414ce5?_0x414ce5['id']:undefined,'tags':getTags(_0x2d04c3['Tags'],_0x9014('0x14')),'subject':intUtil['getString'](_0x2d04c3['Subjects'],_0x1833a1,'\x20'),'description':intUtil[_0x9014('0x15')](_0x2d04c3['Descriptions'],_0x1833a1,'\x0a'),'comment':{'public':![],'body':intUtil[_0x9014('0x15')](_0x2d04c3['Descriptions'],_0x1833a1,'\x0a')}},getCustomFields(_0x2d04c3['Fields'],_0x1833a1))}})['then'](function(_0x20b7b1){logger[_0x9014('0xe')](_0x9014('0x16'));return _0x20b7b1[_0x9014('0x17')];});}function getUser(_0x1530ea,_0x334281){if(intUtil[_0x9014('0x18')](_0x334281)){logger[_0x9014('0xe')](_0x9014('0x19'),_0x334281);return request({'uri':util['format'](_0x9014('0x1a'),_0x1530ea[_0x9014('0x11')]),'qs':{'query':util[_0x9014('0x1b')]('type:user\x20role:agent\x20email:%s',_0x334281)}})[_0x9014('0x1c')](function(_0x242199){if(_0x242199[_0x9014('0x1d')]){logger[_0x9014('0xe')](_0x9014('0x1e'));return _[_0x9014('0x1f')](_0x242199[_0x9014('0x20')],{'email':_0x334281,'role':_0x9014('0x21')});}else{logger[_0x9014('0xe')](_0x9014('0x22'));return request({'uri':util[_0x9014('0x1b')](_0x9014('0x23'),_0x1530ea[_0x9014('0x11')])})[_0x9014('0x1c')](function(_0x1d4388){logger[_0x9014('0xe')](_0x9014('0x24'));return _0x1d4388[_0x9014('0x25')];});}});}else{logger[_0x9014('0xe')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x9014('0x1b')](_0x9014('0x23'),_0x1530ea[_0x9014('0x11')])})[_0x9014('0x1c')](function(_0x2aa4c9){logger[_0x9014('0xe')](_0x9014('0x24'));return _0x2aa4c9[_0x9014('0x25')];});}}function getEndUser(_0x1cea1a,_0x1c65bf,_0x18b265){logger[_0x9014('0xe')]('Searching\x20enduser\x20with\x20phone',_0x18b265);return request({'uri':util['format'](_0x9014('0x1a'),_0x1cea1a[_0x9014('0x11')]),'qs':{'query':util['format'](_0x9014('0x26'),_0x18b265)}})['then'](function(_0x1d6aea){var _0x3cfaf3;if(_0x1d6aea[_0x9014('0x20')]['length']){_0x1d6aea['results']=_[_0x9014('0x27')](_0x1d6aea['results'],{'suspended':![],'role':'end-user'});if(_0x1d6aea[_0x9014('0x20')][_0x9014('0x28')]){_0x3cfaf3=_[_0x9014('0x29')](_0x1d6aea[_0x9014('0x20')]);}}if(_0x3cfaf3){logger[_0x9014('0xe')](_0x9014('0x2a'));return _0x3cfaf3;}else{logger[_0x9014('0xe')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x9014('0x1b')](_0x9014('0x2b'),_0x1cea1a[_0x9014('0x11')]),'method':'POST','body':{'user':{'role':_0x9014('0x2c'),'name':util[_0x9014('0x1b')](_0x9014('0x2d'),_0x1c65bf||_0x18b265),'phone':_0x18b265}}})[_0x9014('0x1c')](function(_0x49d230){logger[_0x9014('0xe')](_0x9014('0x2e'));return _0x49d230[_0x9014('0x25')];});}});}function getAuth(_0x4800b0){var _0x39f8f0;if(_0x4800b0[_0x9014('0x2f')]===_0x9014('0x30')){_0x39f8f0=util[_0x9014('0x1b')](_0x9014('0x31'),_0x4800b0[_0x9014('0x32')],_0x4800b0['password']);}else if(_0x4800b0['authType']===_0x9014('0x33')){_0x39f8f0=util['format']('%s/token:%s',_0x4800b0[_0x9014('0x32')],_0x4800b0[_0x9014('0x33')]);}return util[_0x9014('0x1b')](_0x9014('0x34'),new Buffer(_0x39f8f0)[_0x9014('0x35')](_0x9014('0x36')));}function request(_0x4ba589){logger[_0x9014('0x37')](_0x9014('0x38'),JSON['stringify'](_0x4ba589));return rp(_['defaults'](_0x4ba589,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x279373,_0x251f2b){var _0x47b2c1=[];if(_0x279373&&_0x279373['length']>0x0){_0x47b2c1=_[_0x9014('0x39')](_0x279373,_0x251f2b);}return _0x47b2c1;}function getCustomFields(_0x5799f4,_0x346f29){var _0x57b58a=[];var _0x3915b5={'custom_fields':[]};if(_0x5799f4['length']>0x0){_['forEach'](_0x5799f4,function(_0x3acff9){if(_[_0x9014('0x3a')]([_0x9014('0x3b'),_0x9014('0x3c')],_0x3acff9[_0x9014('0x3d')])&&_0x3acff9[_0x9014('0x3e')]&&!_0x3acff9[_0x9014('0x3f')]){_0x3915b5[_0x3acff9['nameField'][_0x9014('0x40')]()]=_0x3acff9['content']['toString']();}else if(_['includes'](['string',_0x9014('0x3c')],_0x3acff9[_0x9014('0x3d')])&&_0x3acff9[_0x9014('0x41')]&&_0x3acff9[_0x9014('0x3f')]){_0x3915b5[_0x9014('0x42')][_0x9014('0x43')]({'id':_0x3acff9[_0x9014('0x41')],'value':_0x3acff9[_0x9014('0x44')][_0x9014('0x35')]()});}else if(_0x3acff9[_0x9014('0x3d')]===_0x9014('0x45')&&_0x3acff9['variableName']&&_0x3acff9[_0x9014('0x41')]&&_0x3acff9[_0x9014('0x3f')]){_0x346f29[_0x3acff9[_0x9014('0x46')]]&&_0x3915b5['custom_fields'][_0x9014('0x43')]({'id':_0x3acff9['idField'],'value':_0x346f29[_0x3acff9['variableName']][_0x9014('0x35')]()});}else if(_0x3acff9[_0x9014('0x3d')]===_0x9014('0x47')&&_0x3acff9[_0x9014('0x48')]&&_0x3acff9[_0x9014('0x48')]['name']&&_0x3acff9[_0x9014('0x41')]&&_0x3acff9[_0x9014('0x3f')]){_0x346f29[_0x3acff9[_0x9014('0x48')][_0x9014('0x14')][_0x9014('0x40')]()]&&_0x3915b5[_0x9014('0x42')][_0x9014('0x43')]({'id':_0x3acff9['idField'],'value':_0x346f29[_0x3acff9['Variable']['name'][_0x9014('0x40')]()]['toString']()});}});}return _0x3915b5;}exports[_0x9014('0x49')]=function(_0x14f7d7,_0x5c994f,_0x444b6f,_0x447659,_0x68a81f,_0xfb99af){var _0x541bef,_0x512335;_0xfb99af[_0x9014('0x11')]=intUtil['stripTrailingSlash'](_0xfb99af[_0x9014('0x11')]);_0xfb99af[_0x9014('0x4a')]=intUtil[_0x9014('0x4b')](_0xfb99af[_0x9014('0x4a')]);if(_0x68a81f&&_0x68a81f[_0x9014('0x4c')]){logger['info'](_0x9014('0x4d'),'Recording\x20is\x20enabled!');_0x5c994f['recordingURL']=util[_0x9014('0x1b')](_0x9014('0x4e'),_0xfb99af[_0x9014('0x4a')],_0x5c994f[_0x9014('0x4f')],md5(_0x5c994f[_0x9014('0x4f')]));}else{_0x5c994f[_0x9014('0x50')]='';}headers['Authorization']=getAuth(_0xfb99af);return getUser(_0xfb99af,_0x447659[_0x9014('0x51')])[_0x9014('0x1c')](function(_0x345158){_0x541bef=_0x345158;logger[_0x9014('0xe')]('The\x20User\x20ID\x20is:',_0x541bef['id']);return getEndUser(_0xfb99af,_0x5c994f['calleridname'],_0x5c994f[_0x9014('0x52')]);})[_0x9014('0x1c')](function(_0x24f399){_0x512335=_0x24f399;logger[_0x9014('0xe')](_0x9014('0x53'),_0x512335['id']);return getTicket(_0xfb99af,_0x541bef,_0x512335,_0x444b6f,_0x5c994f);})[_0x9014('0x1c')](function(_0x4fe154){if(_0x4fe154){logger[_0x9014('0xe')](_0x9014('0x54'),_0x4fe154['id']);switch(_0xfb99af[_0x9014('0x3d')]){case _0x9014('0x55'):logger[_0x9014('0xe')](_0x9014('0x4d'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x9014('0x1b')](_0x9014('0x56'),_0xfb99af[_0x9014('0x11')],_0x541bef['id'],_0x4fe154['id']),'method':_0x9014('0x12')});case _0x9014('0x57'):logger[_0x9014('0xe')](_0x9014('0x4d'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x9014('0x1b')](_0x9014('0x58'),_0x447659[_0x9014('0x14')]),'trigger:browser:url',{'uri':util[_0x9014('0x1b')](_0x9014('0x59'),_0xfb99af[_0x9014('0x11')]['replace'](_0x9014('0x5a'),''),_0x4fe154['id'])});break;default:logger[_0x9014('0x5b')](_0x9014('0x4d'),_0x9014('0x5c'));}}})['catch'](function(_0x185193){logger[_0x9014('0x5b')](_0x9014('0x5d'),util[_0x9014('0x5e')](_0x185193,{'showHidden':!![],'depth':null}));});};exports[_0x9014('0x5f')]=function(_0x549326,_0x248817,_0x307f56,_0x4ee14e,_0xb4f1bf,_0x4939da,_0x2d26c2){var _0x38f11c,_0x18a9b2;_0x4939da['remoteUri']=intUtil[_0x9014('0x4b')](_0x4939da[_0x9014('0x11')]);_0x4939da[_0x9014('0x4a')]=intUtil[_0x9014('0x4b')](_0x4939da[_0x9014('0x4a')]);if(_0x2d26c2&&_0x2d26c2[_0x9014('0x60')]&&_0x2d26c2[_0x9014('0x60')]!=='none'){logger[_0x9014('0xe')](_0x9014('0x61'),_0x9014('0x62'));_0x248817['recordingURL']=util[_0x9014('0x1b')](_0x9014('0x4e'),_0x4939da['serverUrl'],_0x248817['uniqueid'],md5(_0x248817['uniqueid']));}headers[_0x9014('0x63')]=getAuth(_0x4939da);return getUser(_0x4939da,_0x4ee14e['email'])[_0x9014('0x1c')](function(_0x3b7864){_0x38f11c=_0x3b7864;logger['info'](_0x9014('0x64'),_0x38f11c['id']);return getEndUser(_0x4939da,_0x248817['destcalleridname'],_0x248817[_0x9014('0x65')]);})[_0x9014('0x1c')](function(_0x1a8e7c){_0x18a9b2=_0x1a8e7c;logger['info']('The\x20Enduser\x20ID\x20is:',_0x18a9b2['id']);return getTicket(_0x4939da,_0x38f11c,_0x18a9b2,_0x307f56,_0x248817);})[_0x9014('0x1c')](function(_0x37534c){if(_0x37534c){logger['info'](_0x9014('0x54'),_0x37534c['id']);switch(_0x4939da[_0x9014('0x3d')]){case _0x9014('0x55'):logger[_0x9014('0xe')](_0x9014('0x61'),_0x9014('0x66'));return request({'uri':util['format'](_0x9014('0x56'),_0x4939da[_0x9014('0x11')],_0x38f11c['id'],_0x37534c['id']),'method':_0x9014('0x12')});case _0x9014('0x57'):logger[_0x9014('0xe')](_0x9014('0x61'),_0x9014('0x67'));emit(util[_0x9014('0x1b')]('user:%s',_0x4ee14e['name']),'trigger:browser:url',{'uri':util[_0x9014('0x1b')](_0x9014('0x59'),_0x4939da[_0x9014('0x11')][_0x9014('0x68')](_0x9014('0x5a'),''),_0x37534c['id'])});break;default:logger[_0x9014('0x5b')](_0x9014('0x61'),_0x9014('0x5c'));}}})[_0x9014('0x69')](function(_0x16c7aa){logger['error'](_0x9014('0x6a'),util[_0x9014('0x5e')](_0x16c7aa,{'showHidden':!![],'depth':null}));});};exports[_0x9014('0x6b')]=function(_0x3acdb3,_0x3fb43a,_0x5bdd9c,_0x45abb0,_0x4e6be5,_0x239661){var _0x84fdc0,_0x9c1466;_0x239661[_0x9014('0x11')]=intUtil['stripTrailingSlash'](_0x239661['remoteUri']);_0x239661['serverUrl']=intUtil[_0x9014('0x4b')](_0x239661[_0x9014('0x4a')]);if(_0x4e6be5&&_0x4e6be5['monitor_format']){logger[_0x9014('0xe')]('['+_0x3fb43a[_0x9014('0x6c')][_0x9014('0x6d')]()+']',_0x9014('0x62'));_0x3fb43a[_0x9014('0x50')]=util[_0x9014('0x1b')](_0x9014('0x4e'),_0x239661[_0x9014('0x4a')],_0x3fb43a[_0x9014('0x4f')],md5(_0x3fb43a[_0x9014('0x4f')]));}else{_0x3fb43a[_0x9014('0x50')]='';}headers[_0x9014('0x63')]=getAuth(_0x239661);return getUser(_0x239661)['then'](function(_0x9ff2c4){_0x84fdc0=_0x9ff2c4;logger[_0x9014('0xe')]('The\x20User\x20ID\x20is:',_0x84fdc0['id']);return getEndUser(_0x239661,_0x3fb43a[_0x9014('0x6e')],_0x3fb43a[_0x9014('0x52')]);})[_0x9014('0x1c')](function(_0x3c64cf){_0x9c1466=_0x3c64cf;logger[_0x9014('0xe')](_0x9014('0x53'),_0x9c1466['id']);return getTicket(_0x239661,_0x84fdc0,_0x9c1466,_0x5bdd9c,_0x3fb43a);})[_0x9014('0x1c')](function(_0xa5ad7c){if(_0xa5ad7c){logger[_0x9014('0xe')](_0x9014('0x54'),_0xa5ad7c['id']);}})[_0x9014('0x69')](function(_0x4a758b){logger[_0x9014('0x5b')]('['+_0x3fb43a['lastevent']['toUpperCase']()+']'+_0x9014('0x6f'),util[_0x9014('0x5e')](_0x4a758b,{'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 bb8befb..4270a3a 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 _0x29a7=['toString','indexOf','split','isNil','expires_in','access_token','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','refreshToken','clientSecret','then','add','seconds','catch','error','Failing\x20creating\x20the\x20access_token','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','email','info','Agent\x20found!','Using\x20the\x20admin\x20account!','user','Administrator','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','The\x20failing\x20result\x20is','data','enduserType','POST','https://www.zohoapis.','role','first_name','last_name','details','startCase','moduleCreate','Error:\x20','log','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','lead','Creating\x20new\x20call...','profile','administrator','Subject','getString','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','utc','talktime','answertime','endtime','Call_Duration','YYYY-MM-DDTHH:mm:ss','diff','starttime','mm:ss','called','Called','Call_Result','Answered','rejected','Rejected','Abandoned','Timeout','agentcalledAt','Inbound','merge','Fields','code','Call\x20created!','err','queue','host','stripTrailingSlash','serverUrl','Recording\x20is\x20enabled!','recordingURL','/downloads?type=uniqueid&token=','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','outbound','recordingFormat','none','[OUTBOUND]','/api/voice/recordings/','zoho.eu','com','destcalleridname','destcalleridnum','Outbound','/crm/EntityInfo.do?module=Calls&id=','unmanaged','monitor_format','toUpperCase','lastevent','lodash','request-promise','md5','util','./util','moment','ioredis','bluebird','../../../../config/environment','redis','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','forEach','includes','picklist','type','idField','variableName','Variable','name','toLowerCase'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0x29a7,0x1af));var _0x729a=function(_0x15e812,_0x44748d){_0x15e812=_0x15e812-0x0;var _0x264014=_0x29a7[_0x15e812];return _0x264014;};'use strict';var _=require(_0x729a('0x0'));var rp=require(_0x729a('0x1'));var md5=require(_0x729a('0x2'));var util=require(_0x729a('0x3'));var intUtil=require(_0x729a('0x4'));var moment=require(_0x729a('0x5'));var Redis=require(_0x729a('0x6'));var BPromise=require(_0x729a('0x7'));var config=require(_0x729a('0x8'));var logger=require('../../../../config/logger')('zoho');config[_0x729a('0x9')]=_['defaults'](config[_0x729a('0x9')],{'host':_0x729a('0xa'),'port':0x18eb});var io=require(_0x729a('0xb'))(new Redis(config[_0x729a('0x9')]));function emit(_0x14f587,_0x539bfa,_0x76aee0){io['to'](_0x14f587)[_0x729a('0xc')](_0x539bfa,_0x76aee0);}function request(_0x35aa72){logger[_0x729a('0xd')](_0x729a('0xe'),JSON[_0x729a('0xf')](_0x35aa72));return rp(_0x35aa72);}function getCustomFields(_0x41ee38,_0xeef376){var _0x440288={};if(_0x41ee38['length']>0x0){_[_0x729a('0x10')](_0x41ee38,function(_0x17d5ae){if(_[_0x729a('0x11')](['string',_0x729a('0x12')],_0x17d5ae[_0x729a('0x13')])&&_0x17d5ae[_0x729a('0x14')]){_0x440288[_0x17d5ae[_0x729a('0x14')]]=_0x17d5ae['content']['toString']();}else if(_0x17d5ae[_0x729a('0x13')]==='variable'&&_0x17d5ae[_0x729a('0x15')]&&_0x17d5ae[_0x729a('0x14')]&&_0xeef376[_0x17d5ae[_0x729a('0x15')]]){_0x440288[_0x17d5ae['idField']]=_0xeef376[_0x17d5ae[_0x729a('0x15')]]['toString']();}else if(_0x17d5ae[_0x729a('0x13')]==='customVariable'&&_0x17d5ae[_0x729a('0x16')]&&_0x17d5ae[_0x729a('0x16')][_0x729a('0x17')]&&_0x17d5ae[_0x729a('0x14')]&&_0xeef376[_0x17d5ae[_0x729a('0x16')]['name'][_0x729a('0x18')]()]){_0x440288[_0x17d5ae[_0x729a('0x14')]]=_0xeef376[_0x17d5ae[_0x729a('0x16')][_0x729a('0x17')][_0x729a('0x18')]()][_0x729a('0x19')]();}});}return _0x440288;}function getName(_0x37443a){if(_0x37443a[_0x729a('0x1a')]('\x20')>0x0){var _0x1e2110=_0x37443a[_0x729a('0x1b')](/ (.+)/);if(_0x1e2110[0x1]){return _0x1e2110;}}return[_0x37443a,_0x37443a];}var accountsTokens={};function getAccessToken(_0x372727){return new Promise(function(_0x16fb93,_0x5f4838){if(!_[_0x729a('0x1c')](accountsTokens[_0x372727['id']])&&!_[_0x729a('0x1c')](accountsTokens[_0x372727['id']]['access_token'])){if(moment()['isBefore'](accountsTokens[_0x372727['id']][_0x729a('0x1d')])){_0x16fb93(accountsTokens[_0x372727['id']][_0x729a('0x1e')]);}}var _0x142751;switch(_0x372727[_0x729a('0x1f')]){case'US':_0x142751=_0x729a('0x20');break;case'AU':_0x142751=_0x729a('0x21');break;case'EU':_0x142751=_0x729a('0x22');break;case'IN':_0x142751=_0x729a('0x23');break;case'CN':_0x142751=_0x729a('0x24');break;default:_0x142751='https://accounts.zoho.eu';break;}var _0x5d3bff={'method':'POST','uri':_0x142751+_0x729a('0x25'),'qs':{'refresh_token':_0x372727[_0x729a('0x26')],'client_id':_0x372727['clientId'],'client_secret':_0x372727[_0x729a('0x27')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x5d3bff)[_0x729a('0x28')](function(_0x2bdd91){accountsTokens[_0x372727['id']]={'access_token':_0x2bdd91[_0x729a('0x1e')],'expires_in':moment()[_0x729a('0x29')](_0x2bdd91['expires_in'],_0x729a('0x2a'))};_0x16fb93(_0x2bdd91[_0x729a('0x1e')]);})[_0x729a('0x2b')](function(_0x49ea0e){logger[_0x729a('0x2c')](_0x729a('0x2d'),_0x49ea0e['stack']);_0x5f4838(_0x49ea0e);});});}function getUser(_0x5dd096,_0xa240d2,_0x3b10cc,_0x38e029){logger['info']('Search\x20user');return request({'method':_0x729a('0x2e'),'uri':util[_0x729a('0x2f')](_0x729a('0x30'),_0xa240d2),'qs':{'type':_0x729a('0x31')},'headers':{'Authorization':_0x729a('0x32')+_0x5dd096},'json':!![]})[_0x729a('0x28')](function(_0x2d6b0b){if(_0x2d6b0b[_0x729a('0x33')]){var _0x4c99ee=-0x1;if(_[_0x729a('0x34')](_0x2d6b0b[_0x729a('0x33')])){if(!_[_0x729a('0x1c')](_0x38e029)){_0x4c99ee=_[_0x729a('0x35')](_0x2d6b0b[_0x729a('0x33')],function(_0x1134d7){return _0x1134d7[_0x729a('0x36')]===_0x38e029;});}if(_0x4c99ee>=0x0){logger[_0x729a('0x37')](_0x729a('0x38'));}else{logger[_0x729a('0x37')](_0x729a('0x39'));_0x4c99ee=_[_0x729a('0x35')](_0x2d6b0b[_0x729a('0x33')],function(_0x392782){return _0x392782['profile'][_0x729a('0x17')]==='Administrator';});}return _0x2d6b0b['users'][_0x4c99ee];}else{if(_0x2d6b0b[_0x729a('0x3a')]['profile'][_0x729a('0x17')]===_0x729a('0x3b')){logger[_0x729a('0x37')](_0x729a('0x39'));user=_0x2d6b0b[_0x729a('0x3a')];return user;}else{logger[_0x729a('0x2c')]('The\x20failing\x20result\x20is',JSON[_0x729a('0xf')](_0x2d6b0b));throw new Error(_0x729a('0x3c')+JSON[_0x729a('0xf')](_0x2d6b0b));}}}else{logger[_0x729a('0x2c')](_0x729a('0x3d'),JSON[_0x729a('0xf')](_0x2d6b0b));throw new Error(_0x729a('0x3c')+JSON[_0x729a('0xf')](_0x2d6b0b));}})['catch'](function(_0x153c73){console['error'](_0x153c73);});}function getZohoUser(_0x5dec24,_0x58254d){return new BPromise(function(_0x4f54e3,_0xdcf534){request(_0x5dec24)[_0x729a('0x28')](function(_0xf2bc9d){var _0x47fb3b=null;if(_0xf2bc9d){_0x47fb3b=_0xf2bc9d[_0x729a('0x3e')][0x0];_0x47fb3b[_0x729a('0x3f')]=_0x58254d;}_0x4f54e3(_0x47fb3b);})[_0x729a('0x2b')](function(_0x4e5be5){_0xdcf534(_0x4e5be5);});});}function createEndUser(_0x6adccb,_0x42c218,_0xb6dd16,_0x42b5b2,_0x10b1ca,_0x31ca69){var _0xb6dd16=getName(_0xb6dd16);return request({'method':_0x729a('0x40'),'uri':_0x729a('0x41')+_0x42c218+'/crm/v2/'+_['startCase'](_0x31ca69['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0xb6dd16[0x1],'First_Name':_0xb6dd16[0x0],'Phone':_0x42b5b2,'Owner':{'name':!_[_0x729a('0x1c')](_0x10b1ca[_0x729a('0x42')]['name'])?_0x10b1ca[_0x729a('0x42')][_0x729a('0x17')]:!_['isNil'](_0x10b1ca['first_name'])?_0x10b1ca[_0x729a('0x43')]+'\x20'+_0x10b1ca[_0x729a('0x44')]:_0x10b1ca[_0x729a('0x44')],'id':_0x10b1ca['id']}}]},'headers':{'Authorization':_0x729a('0x32')+_0x6adccb},'json':!![]})[_0x729a('0x28')](function(_0xd96367){if(_0xd96367&&_0xd96367[_0x729a('0x3e')][0x0]['code']==='SUCCESS'){var _0x1e9243=_0xd96367[_0x729a('0x3e')][0x0][_0x729a('0x45')];_0x1e9243[_0x729a('0x3f')]=_[_0x729a('0x46')](_0x31ca69[_0x729a('0x47')])+'s';return _0x1e9243;}logger[_0x729a('0x2c')](_0x729a('0x3d'),JSON[_0x729a('0xf')](data));throw new Error(_0x729a('0x48')+JSON['stringify'](data));})['catch'](function(_0x38c0e1){console[_0x729a('0x49')]('CREATE\x20ERROR',_0x38c0e1);});}function getEndUser(_0x3355d8,_0x4e2187,_0x2d3f81,_0x15219c,_0x55e843,_0x558c71,_0x1d2f32){var _0x4f87b1={'method':_0x729a('0x2e'),'uri':'','headers':{'Authorization':_0x729a('0x32')+_0x3355d8},'json':!![]};switch(_0x1d2f32['moduleSearch']){case _0x729a('0x4a'):_0x4f87b1[_0x729a('0x4b')]=_0x729a('0x41')+_0x4e2187+_0x729a('0x4c')+_0x55e843+'))';return getZohoUser(_0x4f87b1,_0x729a('0x4d'))[_0x729a('0x28')](function(_0x139dfd){if(_0x139dfd)return _0x139dfd;_0x4f87b1[_0x729a('0x4b')]=_0x729a('0x41')+_0x4e2187+_0x729a('0x4e')+_0x55e843+'))';return getZohoUser(_0x4f87b1,_0x729a('0x4f'))[_0x729a('0x28')](function(_0x4c9d09){if(_0x4c9d09)return _0x4c9d09;if(_0x1d2f32['moduleCreate']!=_0x729a('0x50')){return createEndUser(_0x3355d8,_0x4e2187,_0x15219c,_0x55e843,_0x558c71,_0x1d2f32);}else{return{};}});});break;case _0x729a('0x51'):_0x4f87b1[_0x729a('0x4b')]='https://www.zohoapis.'+_0x4e2187+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x55e843+'))';return getZohoUser(_0x4f87b1,_0x729a('0x4d'))[_0x729a('0x28')](function(_0xe2a2ce){if(_0xe2a2ce)return _0xe2a2ce;if(_0x1d2f32['moduleCreate']!='nothing'){return createEndUser(_0x3355d8,_0x4e2187,_0x15219c,_0x55e843,_0x558c71,_0x1d2f32);}else{return{};}});break;case _0x729a('0x52'):_0x4f87b1[_0x729a('0x4b')]='https://www.zohoapis.'+_0x4e2187+_0x729a('0x4e')+_0x55e843+'))';return getZohoUser(_0x4f87b1,'Leads')[_0x729a('0x28')](function(_0x26042d){if(_0x26042d)return _0x26042d;if(_0x1d2f32[_0x729a('0x47')]!=_0x729a('0x50')){return createEndUser(_0x3355d8,_0x4e2187,_0x15219c,_0x55e843,_0x558c71,_0x1d2f32);}else{return{};}});break;}}function getCall(_0x41ca2f,_0x8702ed,_0x34ad6a,_0x56116a,_0x2d5c9e,_0x55c6cb,_0x1f0604,_0x28008d){logger['info'](_0x729a('0x53'));var _0x4edccc={};_0x4edccc['Owner']={'name':!_[_0x729a('0x1c')](_0x56116a[_0x729a('0x42')][_0x729a('0x17')])&&!_[_0x729a('0x1c')](_0x56116a[_0x729a('0x54')][_0x729a('0x17')])&&_0x56116a[_0x729a('0x54')][_0x729a('0x17')]===_0x729a('0x55')?_0x56116a[_0x729a('0x42')]['name']:!_[_0x729a('0x1c')](_0x56116a[_0x729a('0x43')])?_0x56116a[_0x729a('0x43')]+'\x20'+_0x56116a[_0x729a('0x44')]:_0x56116a[_0x729a('0x44')],'id':_0x56116a['id']};_0x4edccc[_0x729a('0x56')]=intUtil[_0x729a('0x57')](_0x55c6cb[_0x729a('0x58')],_0x1f0604,'\x20');_0x4edccc[_0x729a('0x59')]=intUtil[_0x729a('0x57')](_0x55c6cb[_0x729a('0x5a')],_0x1f0604,'\x0a');if(_0x2d5c9e[_0x729a('0x3f')]==='Contacts'){_0x4edccc[_0x729a('0x5b')]={'name':!_[_0x729a('0x1c')](_0x2d5c9e[_0x729a('0x5c')])?_0x2d5c9e[_0x729a('0x5c')]:!_[_0x729a('0x1c')](_0x2d5c9e[_0x729a('0x5d')])?_0x2d5c9e[_0x729a('0x5d')]+'\x20'+_0x2d5c9e[_0x729a('0x5e')]:_0x2d5c9e['Last_Name'],'id':_0x2d5c9e['id']};}if(_0x2d5c9e[_0x729a('0x3f')]===_0x729a('0x4f')){_0x4edccc[_0x729a('0x5f')]={'name':!_[_0x729a('0x1c')](_0x2d5c9e['Full_Name'])?_0x2d5c9e[_0x729a('0x5c')]:!_['isNil'](_0x2d5c9e['First_Name'])?_0x2d5c9e[_0x729a('0x5d')]+'\x20'+_0x2d5c9e[_0x729a('0x5e')]:_0x2d5c9e[_0x729a('0x5e')],'id':_0x2d5c9e['id']};_0x4edccc['$se_module']=_[_0x729a('0x46')](_0x2d5c9e[_0x729a('0x3f')]);}if(_0x1f0604['talktime']){_0x4edccc['Call_Duration']=moment[_0x729a('0x60')](parseInt(_0x1f0604[_0x729a('0x61')])*0x3e8)[_0x729a('0x2f')]('mm:ss');}else if(_0x1f0604[_0x729a('0x62')]&&_0x1f0604[_0x729a('0x63')]){_0x4edccc[_0x729a('0x64')]=moment[_0x729a('0x60')](moment(_0x1f0604[_0x729a('0x63')],_0x729a('0x65'))[_0x729a('0x66')](moment(_0x1f0604[_0x729a('0x67')],_0x729a('0x65'))))['format'](_0x729a('0x68'));}switch(_0x1f0604['lastevent']){case _0x729a('0x69'):_0x4edccc['Call_Result']=_0x729a('0x6a');break;case'complete':case'connect':_0x4edccc[_0x729a('0x6b')]=_0x729a('0x6c');break;case _0x729a('0x6d'):_0x4edccc[_0x729a('0x6b')]=_0x729a('0x6e');break;case'abandoned':_0x4edccc[_0x729a('0x6b')]=_0x729a('0x6f');break;case'timeout':_0x4edccc['Call_Result']=_0x729a('0x70');default:}_0x4edccc['Call_Start_Time']=(_0x28008d==='outbound'?moment(_0x1f0604[_0x729a('0x67')])[_0x729a('0x2f')](_0x729a('0x65')):moment(_0x1f0604[_0x729a('0x71')])[_0x729a('0x2f')]('YYYY-MM-DDTHH:mm:ss'))||moment()['format'](_0x729a('0x65'));_0x4edccc['Call_Type']=_0x28008d||_0x729a('0x72');_0x4edccc=_[_0x729a('0x73')](_0x4edccc,getCustomFields(_0x55c6cb[_0x729a('0x74')],_0x1f0604));return request({'method':_0x729a('0x40'),'uri':_0x729a('0x41')+_0x8702ed+'/crm/v2/Calls','headers':{'Authorization':_0x729a('0x32')+_0x41ca2f},'body':{'data':[_0x4edccc]},'json':!![]})[_0x729a('0x28')](function(_0x340563){if(_0x340563&&_0x340563[_0x729a('0x3e')][0x0][_0x729a('0x75')]==='SUCCESS'){logger[_0x729a('0x37')](_0x729a('0x76'));return{'id':_0x340563['data'][0x0][_0x729a('0x45')]['id']};}})['catch'](function(_0x29864e){logger[_0x729a('0x37')](_0x729a('0x77'),_0x29864e['stack']);console[_0x729a('0x49')](_0x729a('0x77'),_0x29864e);});}exports[_0x729a('0x78')]=function(_0x39297d,_0x18b441,_0x5321ad,_0x481d44,_0x54629,_0x12f5d9){var _0x3faceb,_0x5e1ac5,_0xafd9cb;_0x12f5d9[_0x729a('0x79')]=intUtil[_0x729a('0x7a')](_0x12f5d9[_0x729a('0x79')]);_0x12f5d9['serverUrl']=intUtil[_0x729a('0x7a')](_0x12f5d9[_0x729a('0x7b')]);if(_0x54629&&_0x54629['monitor_format']){logger['info']('[QUEUE]',_0x729a('0x7c'));_0x18b441[_0x729a('0x7d')]=_0x12f5d9['serverUrl']+'/api/voice/recordings/'+_0x18b441['uniqueid']+_0x729a('0x7e')+md5(_0x18b441[_0x729a('0x7f')]);}else{_0x18b441[_0x729a('0x7d')]='';}var _0x53929e=_0x12f5d9[_0x729a('0x79')]==='zoho.eu'?'eu':'com';return getAccessToken(_0x12f5d9)[_0x729a('0x28')](function(_0x4d844f){_0xafd9cb=_0x4d844f;return getUser(_0xafd9cb,_0x53929e,_0x12f5d9,_0x481d44[_0x729a('0x36')]);})[_0x729a('0x28')](function(_0x12c20b){_0x3faceb=_0x12c20b;logger[_0x729a('0x37')](_0x729a('0x80'),_0x3faceb['id']);return getEndUser(_0xafd9cb,_0x53929e,_0x12f5d9,_0x18b441[_0x729a('0x81')],_0x18b441[_0x729a('0x82')],_0x3faceb,_0x5321ad);})[_0x729a('0x28')](function(_0x4ef795){_0x5e1ac5=_0x4ef795;return getCall(_0xafd9cb,_0x53929e,_0x12f5d9,_0x3faceb,_0x5e1ac5,_0x5321ad,_0x18b441,'Inbound');})[_0x729a('0x28')](function(_0x9176b2){if(_0x9176b2){logger['info'](_0x729a('0x83'),_0x9176b2['id']);logger[_0x729a('0x37')](_0x729a('0x84'),_0x729a('0x85'));emit(util['format'](_0x729a('0x86'),_0x481d44[_0x729a('0x17')]),_0x729a('0x87'),{'uri':_0x729a('0x88')+_0x12f5d9[_0x729a('0x79')]+'/crm/EntityInfo.do?module=Calls&id='+_0x9176b2['id']});}})['catch'](function(_0x4e3db1){logger['error'](_0x729a('0x84'),JSON['stringify'](_0x4e3db1));});};exports[_0x729a('0x89')]=function(_0x47ea0f,_0x5726d5,_0x2d50dd,_0x1057df,_0x157bd0,_0x1863a8,_0x130730){var _0x1017c6,_0x1a320a,_0x593620;_0x1863a8[_0x729a('0x79')]=intUtil['stripTrailingSlash'](_0x1863a8['host']);_0x1863a8[_0x729a('0x7b')]=intUtil[_0x729a('0x7a')](_0x1863a8['serverUrl']);if(_0x130730&&_0x130730[_0x729a('0x8a')]&&_0x130730[_0x729a('0x8a')]!==_0x729a('0x8b')){logger[_0x729a('0x37')](_0x729a('0x8c'),_0x729a('0x7c'));_0x5726d5[_0x729a('0x7d')]=_0x1863a8[_0x729a('0x7b')]+_0x729a('0x8d')+_0x5726d5[_0x729a('0x7f')]+'/downloads?type=uniqueid&token='+md5(_0x5726d5[_0x729a('0x7f')]);}var _0x3bc17c=_0x1863a8['host']===_0x729a('0x8e')?'eu':_0x729a('0x8f');return getAccessToken(_0x1863a8)[_0x729a('0x28')](function(_0x1585e6){_0x593620=_0x1585e6;return getUser(_0x593620,_0x3bc17c,_0x1863a8,_0x1057df[_0x729a('0x36')]);})['then'](function(_0x4819d5){_0x1017c6=_0x4819d5;logger['info'](_0x729a('0x80'),_0x1017c6['id']);return getEndUser(_0x593620,_0x3bc17c,_0x1863a8,_0x5726d5[_0x729a('0x90')],_0x5726d5[_0x729a('0x91')],_0x1017c6,_0x2d50dd);})['then'](function(_0x5f35f4){_0x1a320a=_0x5f35f4;return getCall(_0x593620,_0x3bc17c,_0x1863a8,_0x1017c6,_0x1a320a,_0x2d50dd,_0x5726d5,_0x729a('0x92'));})[_0x729a('0x28')](function(_0x2b2b84){if(_0x2b2b84){logger[_0x729a('0x37')](_0x729a('0x83'),_0x2b2b84['id']);logger['info']('[OUTBOUND]',_0x729a('0x85'));emit(util[_0x729a('0x2f')](_0x729a('0x86'),_0x1057df[_0x729a('0x17')]),'trigger:browser:url',{'uri':_0x729a('0x88')+_0x1863a8['host']+_0x729a('0x93')+_0x2b2b84['id']});}})[_0x729a('0x2b')](function(_0x460b6c){logger[_0x729a('0x2c')](_0x729a('0x8c'),JSON[_0x729a('0xf')](_0x460b6c));});};exports[_0x729a('0x94')]=function(_0x2ad023,_0x470b7a,_0x476478,_0xebbf1a,_0x58fe81,_0x37e903){var _0x2db03c,_0x1a6d07,_0x59898b;_0x37e903['host']=intUtil[_0x729a('0x7a')](_0x37e903['host']);_0x37e903[_0x729a('0x7b')]=intUtil[_0x729a('0x7a')](_0x37e903[_0x729a('0x7b')]);if(_0x58fe81&&_0x58fe81[_0x729a('0x95')]){logger['info']('['+_0x470b7a['lastevent'][_0x729a('0x96')]()+']',_0x729a('0x7c'));_0x470b7a[_0x729a('0x7d')]=_0x37e903['serverUrl']+_0x729a('0x8d')+_0x470b7a['uniqueid']+_0x729a('0x7e')+md5(_0x470b7a[_0x729a('0x7f')]);}else{_0x470b7a[_0x729a('0x7d')]='';}var _0x9b9ae6=_0x37e903[_0x729a('0x79')]===_0x729a('0x8e')?'eu':_0x729a('0x8f');return getAccessToken(_0x37e903)[_0x729a('0x28')](function(_0x1f09fa){_0x59898b=_0x1f09fa;return getUser(_0x59898b,_0x9b9ae6,_0x37e903);})[_0x729a('0x28')](function(_0xf535af){_0x2db03c=_0xf535af;logger[_0x729a('0x37')]('The\x20User\x20ID\x20is:',_0x2db03c['id']);return getEndUser(_0x59898b,_0x9b9ae6,_0x37e903,_0x470b7a[_0x729a('0x81')],_0x470b7a[_0x729a('0x82')],_0x2db03c,_0x476478);})[_0x729a('0x28')](function(_0xd86ea4){_0x1a6d07=_0xd86ea4;return getCall(_0x59898b,_0x9b9ae6,_0x37e903,_0x2db03c,_0x1a6d07,_0x476478,_0x470b7a,_0x729a('0x72'));})[_0x729a('0x28')](function(_0x2a32e9){if(_0x2a32e9){logger[_0x729a('0x37')]('The\x20Call\x20ID\x20is:',_0x2a32e9['id']);}})['catch'](function(_0x124859){logger['error']('['+_0x470b7a[_0x729a('0x97')]['toUpperCase']()+']',JSON[_0x729a('0xf')](_0x124859));});}; \ No newline at end of file +var _0x5d7d=['[OUTBOUND]','Recording\x20is\x20enabled!','The\x20User\x20ID\x20is:','Outbound','/crm/EntityInfo.do?module=Calls&id=','toUpperCase','recordingURL','lastevent','lodash','request-promise','md5','util','./util','moment','ioredis','bluebird','../../../../config/environment','zoho','redis','defaults','localhost','socket.io-emitter','emit','stringify','length','forEach','string','picklist','type','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','access_token','isBefore','expires_in','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','then','add','seconds','error','Failing\x20creating\x20the\x20access_token','stack','info','GET','format','Zoho-oauthtoken\x20','users','isNil','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','catch','https://www.zohoapis.','startCase','moduleCreate','role','first_name','last_name','data','code','details','enduserType','Error:\x20','log','CREATE\x20ERROR','contact_lead','uri','/crm/v2/Leads/search?criteria=((Phone:equals:','nothing','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','Leads','Owner','administrator','Subject','getString','Subjects','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','mm:ss','answertime','endtime','utc','YYYY-MM-DDTHH:mm:ss','diff','starttime','Call_Result','Called','complete','connect','Answered','rejected','Rejected','abandoned','Abandoned','timeout','Timeout','outbound','agentcalledAt','Call_Type','Fields','Call\x20created!','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','calleridname','calleridnum','Inbound','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','recordingFormat','none'];(function(_0x4a5f6c,_0x4f532e){var _0x281ffd=function(_0x4c68e3){while(--_0x4c68e3){_0x4a5f6c['push'](_0x4a5f6c['shift']());}};_0x281ffd(++_0x4f532e);}(_0x5d7d,0x134));var _0xd5d7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5d7d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd5d7('0x0'));var rp=require(_0xd5d7('0x1'));var md5=require(_0xd5d7('0x2'));var util=require(_0xd5d7('0x3'));var intUtil=require(_0xd5d7('0x4'));var moment=require(_0xd5d7('0x5'));var Redis=require(_0xd5d7('0x6'));var BPromise=require(_0xd5d7('0x7'));var config=require(_0xd5d7('0x8'));var logger=require('../../../../config/logger')(_0xd5d7('0x9'));config[_0xd5d7('0xa')]=_[_0xd5d7('0xb')](config[_0xd5d7('0xa')],{'host':_0xd5d7('0xc'),'port':0x18eb});var io=require(_0xd5d7('0xd'))(new Redis(config['redis']));function emit(_0x30ab7c,_0x2008b6,_0x3d076a){io['to'](_0x30ab7c)[_0xd5d7('0xe')](_0x2008b6,_0x3d076a);}function request(_0x124b53){logger['debug']('[HTTP]',JSON[_0xd5d7('0xf')](_0x124b53));return rp(_0x124b53);}function getCustomFields(_0x4dde17,_0x413cd6){var _0x4d2368={};if(_0x4dde17[_0xd5d7('0x10')]>0x0){_[_0xd5d7('0x11')](_0x4dde17,function(_0x5c4268){if(_['includes']([_0xd5d7('0x12'),_0xd5d7('0x13')],_0x5c4268[_0xd5d7('0x14')])&&_0x5c4268['idField']){_0x4d2368[_0x5c4268[_0xd5d7('0x15')]]=_0x5c4268[_0xd5d7('0x16')][_0xd5d7('0x17')]();}else if(_0x5c4268[_0xd5d7('0x14')]===_0xd5d7('0x18')&&_0x5c4268[_0xd5d7('0x19')]&&_0x5c4268[_0xd5d7('0x15')]&&_0x413cd6[_0x5c4268['variableName']]){_0x4d2368[_0x5c4268[_0xd5d7('0x15')]]=_0x413cd6[_0x5c4268[_0xd5d7('0x19')]][_0xd5d7('0x17')]();}else if(_0x5c4268['type']===_0xd5d7('0x1a')&&_0x5c4268[_0xd5d7('0x1b')]&&_0x5c4268['Variable'][_0xd5d7('0x1c')]&&_0x5c4268[_0xd5d7('0x15')]&&_0x413cd6[_0x5c4268[_0xd5d7('0x1b')][_0xd5d7('0x1c')][_0xd5d7('0x1d')]()]){_0x4d2368[_0x5c4268[_0xd5d7('0x15')]]=_0x413cd6[_0x5c4268[_0xd5d7('0x1b')][_0xd5d7('0x1c')][_0xd5d7('0x1d')]()][_0xd5d7('0x17')]();}});}return _0x4d2368;}function getName(_0xbe143d){if(_0xbe143d[_0xd5d7('0x1e')]('\x20')>0x0){var _0x1bd08c=_0xbe143d[_0xd5d7('0x1f')](/ (.+)/);if(_0x1bd08c[0x1]){return _0x1bd08c;}}return[_0xbe143d,_0xbe143d];}var accountsTokens={};function getAccessToken(_0x4426cd){return new Promise(function(_0x5224ce,_0x54e4b7){if(!_['isNil'](accountsTokens[_0x4426cd['id']])&&!_['isNil'](accountsTokens[_0x4426cd['id']][_0xd5d7('0x20')])){if(moment()[_0xd5d7('0x21')](accountsTokens[_0x4426cd['id']][_0xd5d7('0x22')])){_0x5224ce(accountsTokens[_0x4426cd['id']][_0xd5d7('0x20')]);}}var _0x4246ce;switch(_0x4426cd['zone']){case'US':_0x4246ce=_0xd5d7('0x23');break;case'AU':_0x4246ce=_0xd5d7('0x24');break;case'EU':_0x4246ce=_0xd5d7('0x25');break;case'IN':_0x4246ce='https://accounts.zoho.in';break;case'CN':_0x4246ce='https://accounts.zoho.com.cn';break;default:_0x4246ce=_0xd5d7('0x25');break;}var _0x4efe45={'method':_0xd5d7('0x26'),'uri':_0x4246ce+_0xd5d7('0x27'),'qs':{'refresh_token':_0x4426cd[_0xd5d7('0x28')],'client_id':_0x4426cd[_0xd5d7('0x29')],'client_secret':_0x4426cd[_0xd5d7('0x2a')],'grant_type':_0xd5d7('0x2b')},'json':!![]};return rp(_0x4efe45)[_0xd5d7('0x2c')](function(_0x413b0a){accountsTokens[_0x4426cd['id']]={'access_token':_0x413b0a['access_token'],'expires_in':moment()[_0xd5d7('0x2d')](_0x413b0a[_0xd5d7('0x22')],_0xd5d7('0x2e'))};_0x5224ce(_0x413b0a[_0xd5d7('0x20')]);})['catch'](function(_0x1c4463){logger[_0xd5d7('0x2f')](_0xd5d7('0x30'),_0x1c4463[_0xd5d7('0x31')]);_0x54e4b7(_0x1c4463);});});}function getUser(_0x4a8afa,_0x5e5a5b,_0x40560e,_0x554573){logger[_0xd5d7('0x32')]('Search\x20user');return request({'method':_0xd5d7('0x33'),'uri':util[_0xd5d7('0x34')]('https://www.zohoapis.%s/crm/v2/users',_0x5e5a5b),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':_0xd5d7('0x35')+_0x4a8afa},'json':!![]})[_0xd5d7('0x2c')](function(_0x5485d2){if(_0x5485d2[_0xd5d7('0x36')]){var _0xa9b227=-0x1;if(_['isArrayLikeObject'](_0x5485d2[_0xd5d7('0x36')])){if(!_[_0xd5d7('0x37')](_0x554573)){_0xa9b227=_[_0xd5d7('0x38')](_0x5485d2[_0xd5d7('0x36')],function(_0xb1bf41){return _0xb1bf41[_0xd5d7('0x39')]===_0x554573;});}if(_0xa9b227>=0x0){logger[_0xd5d7('0x32')](_0xd5d7('0x3a'));}else{logger[_0xd5d7('0x32')](_0xd5d7('0x3b'));_0xa9b227=_[_0xd5d7('0x38')](_0x5485d2['users'],function(_0x3c603e){return _0x3c603e[_0xd5d7('0x3c')][_0xd5d7('0x1c')]===_0xd5d7('0x3d');});}return _0x5485d2['users'][_0xa9b227];}else{if(_0x5485d2['user'][_0xd5d7('0x3c')][_0xd5d7('0x1c')]===_0xd5d7('0x3d')){logger[_0xd5d7('0x32')](_0xd5d7('0x3b'));user=_0x5485d2['user'];return user;}else{logger['error'](_0xd5d7('0x3e'),JSON['stringify'](_0x5485d2));throw new Error(_0xd5d7('0x3f')+JSON['stringify'](_0x5485d2));}}}else{logger[_0xd5d7('0x2f')](_0xd5d7('0x3e'),JSON[_0xd5d7('0xf')](_0x5485d2));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0xd5d7('0xf')](_0x5485d2));}})[_0xd5d7('0x40')](function(_0x20d342){console['error'](_0x20d342);});}function getZohoUser(_0x405fcf,_0x43185e){return new BPromise(function(_0x2da423,_0x18601a){request(_0x405fcf)[_0xd5d7('0x2c')](function(_0xa36001){var _0x20a03b=null;if(_0xa36001){_0x20a03b=_0xa36001['data'][0x0];_0x20a03b['enduserType']=_0x43185e;}_0x2da423(_0x20a03b);})[_0xd5d7('0x40')](function(_0x508a66){_0x18601a(_0x508a66);});});}function createEndUser(_0x49c3d4,_0x17fd0f,_0x216d7e,_0x5f55b5,_0x24a3c7,_0xcde19c){var _0x216d7e=getName(_0x216d7e);return request({'method':'POST','uri':_0xd5d7('0x41')+_0x17fd0f+'/crm/v2/'+_[_0xd5d7('0x42')](_0xcde19c[_0xd5d7('0x43')])+'s','body':{'data':[{'Last_Name':_0x216d7e[0x1],'First_Name':_0x216d7e[0x0],'Phone':_0x5f55b5,'Owner':{'name':!_[_0xd5d7('0x37')](_0x24a3c7[_0xd5d7('0x44')][_0xd5d7('0x1c')])?_0x24a3c7['role'][_0xd5d7('0x1c')]:!_['isNil'](_0x24a3c7[_0xd5d7('0x45')])?_0x24a3c7[_0xd5d7('0x45')]+'\x20'+_0x24a3c7[_0xd5d7('0x46')]:_0x24a3c7['last_name'],'id':_0x24a3c7['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x49c3d4},'json':!![]})['then'](function(_0x152df1){if(_0x152df1&&_0x152df1[_0xd5d7('0x47')][0x0][_0xd5d7('0x48')]==='SUCCESS'){var _0x24f23b=_0x152df1['data'][0x0][_0xd5d7('0x49')];_0x24f23b[_0xd5d7('0x4a')]=_[_0xd5d7('0x42')](_0xcde19c[_0xd5d7('0x43')])+'s';return _0x24f23b;}logger['error']('The\x20failing\x20result\x20is',JSON[_0xd5d7('0xf')](data));throw new Error(_0xd5d7('0x4b')+JSON['stringify'](data));})[_0xd5d7('0x40')](function(_0x3e650e){console[_0xd5d7('0x4c')](_0xd5d7('0x4d'),_0x3e650e);});}function getEndUser(_0x478fc8,_0x3ca0c3,_0x13ee4c,_0x4a52b6,_0x282796,_0x1370bd,_0x537ed7){var _0x3b6d46={'method':'GET','uri':'','headers':{'Authorization':_0xd5d7('0x35')+_0x478fc8},'json':!![]};switch(_0x537ed7['moduleSearch']){case _0xd5d7('0x4e'):_0x3b6d46[_0xd5d7('0x4f')]=_0xd5d7('0x41')+_0x3ca0c3+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x282796+'))';return getZohoUser(_0x3b6d46,'Contacts')[_0xd5d7('0x2c')](function(_0x1c1d3a){if(_0x1c1d3a)return _0x1c1d3a;_0x3b6d46[_0xd5d7('0x4f')]='https://www.zohoapis.'+_0x3ca0c3+_0xd5d7('0x50')+_0x282796+'))';return getZohoUser(_0x3b6d46,'Leads')['then'](function(_0x59a6b5){if(_0x59a6b5)return _0x59a6b5;if(_0x537ed7[_0xd5d7('0x43')]!=_0xd5d7('0x51')){return createEndUser(_0x478fc8,_0x3ca0c3,_0x4a52b6,_0x282796,_0x1370bd,_0x537ed7);}else{return{};}});});break;case'contact':_0x3b6d46[_0xd5d7('0x4f')]=_0xd5d7('0x41')+_0x3ca0c3+_0xd5d7('0x52')+_0x282796+'))';return getZohoUser(_0x3b6d46,_0xd5d7('0x53'))['then'](function(_0x6fb2c8){if(_0x6fb2c8)return _0x6fb2c8;if(_0x537ed7[_0xd5d7('0x43')]!='nothing'){return createEndUser(_0x478fc8,_0x3ca0c3,_0x4a52b6,_0x282796,_0x1370bd,_0x537ed7);}else{return{};}});break;case'lead':_0x3b6d46[_0xd5d7('0x4f')]=_0xd5d7('0x41')+_0x3ca0c3+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x282796+'))';return getZohoUser(_0x3b6d46,_0xd5d7('0x54'))['then'](function(_0x3e5472){if(_0x3e5472)return _0x3e5472;if(_0x537ed7['moduleCreate']!=_0xd5d7('0x51')){return createEndUser(_0x478fc8,_0x3ca0c3,_0x4a52b6,_0x282796,_0x1370bd,_0x537ed7);}else{return{};}});break;}}function getCall(_0x2a98fa,_0x45947f,_0x463c3b,_0x33563d,_0x10d78b,_0x67b3be,_0xa83767,_0x5e1b7b){logger[_0xd5d7('0x32')]('Creating\x20new\x20call...');var _0x2c9353={};_0x2c9353[_0xd5d7('0x55')]={'name':!_[_0xd5d7('0x37')](_0x33563d['role'][_0xd5d7('0x1c')])&&!_[_0xd5d7('0x37')](_0x33563d[_0xd5d7('0x3c')][_0xd5d7('0x1c')])&&_0x33563d[_0xd5d7('0x3c')][_0xd5d7('0x1c')]===_0xd5d7('0x56')?_0x33563d['role']['name']:!_[_0xd5d7('0x37')](_0x33563d[_0xd5d7('0x45')])?_0x33563d[_0xd5d7('0x45')]+'\x20'+_0x33563d[_0xd5d7('0x46')]:_0x33563d[_0xd5d7('0x46')],'id':_0x33563d['id']};_0x2c9353[_0xd5d7('0x57')]=intUtil[_0xd5d7('0x58')](_0x67b3be[_0xd5d7('0x59')],_0xa83767,'\x20');_0x2c9353['Description']=intUtil[_0xd5d7('0x58')](_0x67b3be['Descriptions'],_0xa83767,'\x0a');if(_0x10d78b[_0xd5d7('0x4a')]===_0xd5d7('0x53')){_0x2c9353[_0xd5d7('0x5a')]={'name':!_[_0xd5d7('0x37')](_0x10d78b[_0xd5d7('0x5b')])?_0x10d78b[_0xd5d7('0x5b')]:!_[_0xd5d7('0x37')](_0x10d78b[_0xd5d7('0x5c')])?_0x10d78b[_0xd5d7('0x5c')]+'\x20'+_0x10d78b[_0xd5d7('0x5d')]:_0x10d78b['Last_Name'],'id':_0x10d78b['id']};}if(_0x10d78b[_0xd5d7('0x4a')]===_0xd5d7('0x54')){_0x2c9353[_0xd5d7('0x5e')]={'name':!_[_0xd5d7('0x37')](_0x10d78b[_0xd5d7('0x5b')])?_0x10d78b[_0xd5d7('0x5b')]:!_['isNil'](_0x10d78b[_0xd5d7('0x5c')])?_0x10d78b[_0xd5d7('0x5c')]+'\x20'+_0x10d78b[_0xd5d7('0x5d')]:_0x10d78b[_0xd5d7('0x5d')],'id':_0x10d78b['id']};_0x2c9353[_0xd5d7('0x5f')]=_[_0xd5d7('0x42')](_0x10d78b[_0xd5d7('0x4a')]);}if(_0xa83767[_0xd5d7('0x60')]){_0x2c9353['Call_Duration']=moment['utc'](parseInt(_0xa83767[_0xd5d7('0x60')])*0x3e8)[_0xd5d7('0x34')](_0xd5d7('0x61'));}else if(_0xa83767[_0xd5d7('0x62')]&&_0xa83767[_0xd5d7('0x63')]){_0x2c9353['Call_Duration']=moment[_0xd5d7('0x64')](moment(_0xa83767[_0xd5d7('0x63')],_0xd5d7('0x65'))[_0xd5d7('0x66')](moment(_0xa83767[_0xd5d7('0x67')],_0xd5d7('0x65'))))[_0xd5d7('0x34')](_0xd5d7('0x61'));}switch(_0xa83767['lastevent']){case'called':_0x2c9353[_0xd5d7('0x68')]=_0xd5d7('0x69');break;case _0xd5d7('0x6a'):case _0xd5d7('0x6b'):_0x2c9353['Call_Result']=_0xd5d7('0x6c');break;case _0xd5d7('0x6d'):_0x2c9353[_0xd5d7('0x68')]=_0xd5d7('0x6e');break;case _0xd5d7('0x6f'):_0x2c9353[_0xd5d7('0x68')]=_0xd5d7('0x70');break;case _0xd5d7('0x71'):_0x2c9353[_0xd5d7('0x68')]=_0xd5d7('0x72');default:}_0x2c9353['Call_Start_Time']=(_0x5e1b7b===_0xd5d7('0x73')?moment(_0xa83767[_0xd5d7('0x67')])['format'](_0xd5d7('0x65')):moment(_0xa83767[_0xd5d7('0x74')])[_0xd5d7('0x34')](_0xd5d7('0x65')))||moment()[_0xd5d7('0x34')]('YYYY-MM-DDTHH:mm:ss');_0x2c9353[_0xd5d7('0x75')]=_0x5e1b7b||'Inbound';_0x2c9353=_['merge'](_0x2c9353,getCustomFields(_0x67b3be[_0xd5d7('0x76')],_0xa83767));return request({'method':_0xd5d7('0x26'),'uri':'https://www.zohoapis.'+_0x45947f+'/crm/v2/Calls','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x2a98fa},'body':{'data':[_0x2c9353]},'json':!![]})[_0xd5d7('0x2c')](function(_0x3bd077){if(_0x3bd077&&_0x3bd077[_0xd5d7('0x47')][0x0][_0xd5d7('0x48')]==='SUCCESS'){logger['info'](_0xd5d7('0x77'));return{'id':_0x3bd077['data'][0x0][_0xd5d7('0x49')]['id']};}})['catch'](function(_0x4cd92b){logger[_0xd5d7('0x32')](_0xd5d7('0x78'),_0x4cd92b[_0xd5d7('0x31')]);console[_0xd5d7('0x4c')](_0xd5d7('0x78'),_0x4cd92b);});}exports[_0xd5d7('0x79')]=function(_0x4d589a,_0x1bf4d2,_0x49fda1,_0x1db3c9,_0x2211b3,_0x2651c5){var _0x391004,_0x5919b1,_0x1a92be;_0x2651c5[_0xd5d7('0x7a')]=intUtil[_0xd5d7('0x7b')](_0x2651c5[_0xd5d7('0x7a')]);_0x2651c5[_0xd5d7('0x7c')]=intUtil[_0xd5d7('0x7b')](_0x2651c5['serverUrl']);if(_0x2211b3&&_0x2211b3[_0xd5d7('0x7d')]){logger[_0xd5d7('0x32')](_0xd5d7('0x7e'),'Recording\x20is\x20enabled!');_0x1bf4d2['recordingURL']=_0x2651c5[_0xd5d7('0x7c')]+_0xd5d7('0x7f')+_0x1bf4d2[_0xd5d7('0x80')]+_0xd5d7('0x81')+md5(_0x1bf4d2[_0xd5d7('0x80')]);}else{_0x1bf4d2['recordingURL']='';}var _0x57f288=_0x2651c5['host']===_0xd5d7('0x82')?'eu':_0xd5d7('0x83');return getAccessToken(_0x2651c5)['then'](function(_0x12c8c7){_0x1a92be=_0x12c8c7;return getUser(_0x1a92be,_0x57f288,_0x2651c5,_0x1db3c9[_0xd5d7('0x39')]);})[_0xd5d7('0x2c')](function(_0x382807){_0x391004=_0x382807;logger[_0xd5d7('0x32')]('The\x20User\x20ID\x20is:',_0x391004['id']);return getEndUser(_0x1a92be,_0x57f288,_0x2651c5,_0x1bf4d2[_0xd5d7('0x84')],_0x1bf4d2[_0xd5d7('0x85')],_0x391004,_0x49fda1);})['then'](function(_0x1a89ea){_0x5919b1=_0x1a89ea;return getCall(_0x1a92be,_0x57f288,_0x2651c5,_0x391004,_0x5919b1,_0x49fda1,_0x1bf4d2,_0xd5d7('0x86'));})[_0xd5d7('0x2c')](function(_0x2d496f){if(_0x2d496f){logger['info'](_0xd5d7('0x87'),_0x2d496f['id']);logger[_0xd5d7('0x32')](_0xd5d7('0x7e'),_0xd5d7('0x88'));emit(util[_0xd5d7('0x34')](_0xd5d7('0x89'),_0x1db3c9['name']),_0xd5d7('0x8a'),{'uri':_0xd5d7('0x8b')+_0x2651c5[_0xd5d7('0x7a')]+'/crm/EntityInfo.do?module=Calls&id='+_0x2d496f['id']});}})[_0xd5d7('0x40')](function(_0x3cef1b){logger[_0xd5d7('0x2f')](_0xd5d7('0x7e'),JSON[_0xd5d7('0xf')](_0x3cef1b));});};exports[_0xd5d7('0x73')]=function(_0x40a55f,_0xc3638,_0x4c6d87,_0x4913fc,_0x22f69b,_0x53c4c2,_0x227aae){var _0x139f33,_0x553a65,_0x582d9b;_0x53c4c2[_0xd5d7('0x7a')]=intUtil[_0xd5d7('0x7b')](_0x53c4c2[_0xd5d7('0x7a')]);_0x53c4c2[_0xd5d7('0x7c')]=intUtil[_0xd5d7('0x7b')](_0x53c4c2[_0xd5d7('0x7c')]);if(_0x227aae&&_0x227aae['recordingFormat']&&_0x227aae[_0xd5d7('0x8c')]!==_0xd5d7('0x8d')){logger['info'](_0xd5d7('0x8e'),_0xd5d7('0x8f'));_0xc3638['recordingURL']=_0x53c4c2[_0xd5d7('0x7c')]+_0xd5d7('0x7f')+_0xc3638['uniqueid']+_0xd5d7('0x81')+md5(_0xc3638[_0xd5d7('0x80')]);}var _0x8b854d=_0x53c4c2[_0xd5d7('0x7a')]===_0xd5d7('0x82')?'eu':_0xd5d7('0x83');return getAccessToken(_0x53c4c2)[_0xd5d7('0x2c')](function(_0x485c29){_0x582d9b=_0x485c29;return getUser(_0x582d9b,_0x8b854d,_0x53c4c2,_0x4913fc[_0xd5d7('0x39')]);})[_0xd5d7('0x2c')](function(_0xc88d39){_0x139f33=_0xc88d39;logger[_0xd5d7('0x32')](_0xd5d7('0x90'),_0x139f33['id']);return getEndUser(_0x582d9b,_0x8b854d,_0x53c4c2,_0xc3638['destcalleridname'],_0xc3638['destcalleridnum'],_0x139f33,_0x4c6d87);})[_0xd5d7('0x2c')](function(_0x9dea29){_0x553a65=_0x9dea29;return getCall(_0x582d9b,_0x8b854d,_0x53c4c2,_0x139f33,_0x553a65,_0x4c6d87,_0xc3638,_0xd5d7('0x91'));})['then'](function(_0x30208a){if(_0x30208a){logger[_0xd5d7('0x32')](_0xd5d7('0x87'),_0x30208a['id']);logger[_0xd5d7('0x32')](_0xd5d7('0x8e'),_0xd5d7('0x88'));emit(util['format']('user:%s',_0x4913fc[_0xd5d7('0x1c')]),'trigger:browser:url',{'uri':_0xd5d7('0x8b')+_0x53c4c2[_0xd5d7('0x7a')]+_0xd5d7('0x92')+_0x30208a['id']});}})[_0xd5d7('0x40')](function(_0x12b0a9){logger[_0xd5d7('0x2f')](_0xd5d7('0x8e'),JSON['stringify'](_0x12b0a9));});};exports['unmanaged']=function(_0x397859,_0x4ddd50,_0x3a21ff,_0xdb5426,_0xf67f9a,_0x11957b){var _0x80dfda,_0x383587,_0x414c9a;_0x11957b['host']=intUtil[_0xd5d7('0x7b')](_0x11957b[_0xd5d7('0x7a')]);_0x11957b['serverUrl']=intUtil[_0xd5d7('0x7b')](_0x11957b['serverUrl']);if(_0xf67f9a&&_0xf67f9a[_0xd5d7('0x7d')]){logger['info']('['+_0x4ddd50['lastevent'][_0xd5d7('0x93')]()+']',_0xd5d7('0x8f'));_0x4ddd50['recordingURL']=_0x11957b[_0xd5d7('0x7c')]+_0xd5d7('0x7f')+_0x4ddd50[_0xd5d7('0x80')]+'/downloads?type=uniqueid&token='+md5(_0x4ddd50['uniqueid']);}else{_0x4ddd50[_0xd5d7('0x94')]='';}var _0x39edf8=_0x11957b[_0xd5d7('0x7a')]===_0xd5d7('0x82')?'eu':_0xd5d7('0x83');return getAccessToken(_0x11957b)[_0xd5d7('0x2c')](function(_0x3a7929){_0x414c9a=_0x3a7929;return getUser(_0x414c9a,_0x39edf8,_0x11957b);})[_0xd5d7('0x2c')](function(_0x3edff5){_0x80dfda=_0x3edff5;logger[_0xd5d7('0x32')](_0xd5d7('0x90'),_0x80dfda['id']);return getEndUser(_0x414c9a,_0x39edf8,_0x11957b,_0x4ddd50[_0xd5d7('0x84')],_0x4ddd50['calleridnum'],_0x80dfda,_0x3a21ff);})[_0xd5d7('0x2c')](function(_0x202f19){_0x383587=_0x202f19;return getCall(_0x414c9a,_0x39edf8,_0x11957b,_0x80dfda,_0x383587,_0x3a21ff,_0x4ddd50,'Inbound');})['then'](function(_0x3d974c){if(_0x3d974c){logger[_0xd5d7('0x32')]('The\x20Call\x20ID\x20is:',_0x3d974c['id']);}})[_0xd5d7('0x40')](function(_0x1a74e9){logger[_0xd5d7('0x2f')]('['+_0x4ddd50[_0xd5d7('0x95')]['toUpperCase']()+']',JSON[_0xd5d7('0xf')](_0x1a74e9));});}; \ 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 08da00e..908cc79 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 _0xd6a4=['info','shelljs','mustache','trigger','exec','data2','data3','render','error','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s'];(function(_0x2379b9,_0x8b96c2){var _0x5b097d=function(_0xbeec91){while(--_0xbeec91){_0x2379b9['push'](_0x2379b9['shift']());}};_0x5b097d(++_0x8b96c2);}(_0xd6a4,0x17d));var _0x4d6a=function(_0x16e711,_0x4b2cb4){_0x16e711=_0x16e711-0x0;var _0x416155=_0xd6a4[_0x16e711];return _0x416155;};'use strict';var util=require('util');var sh=require(_0x4d6a('0x0'));var Mustache=require(_0x4d6a('0x1'));var logger=require('../../../../config/logger')(_0x4d6a('0x2'));exports[_0x4d6a('0x3')]=function(_0x244816,_0x2fe5c4){var _0x172576=_0x244816[_0x4d6a('0x4')]?_0x244816['data2']:'Script';var _0x2954df=_0x244816[_0x4d6a('0x5')]?Mustache[_0x4d6a('0x6')](_0x244816[_0x4d6a('0x5')],_0x2fe5c4):_0x2fe5c4;sh[_0x4d6a('0x3')](_0x2954df,function(_0x53bb55,_0x36bb9c,_0xd2452a){if(_0x53bb55!==0x0){logger[_0x4d6a('0x7')](util['format'](_0x4d6a('0x8'),_0x172576,_0x2954df,_0x53bb55,_0xd2452a));}else{logger[_0x4d6a('0x9')](util['format']('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x172576,_0x2954df,_0x36bb9c));}});}; \ No newline at end of file +var _0x5a73=['render','error','format','info','shelljs','trigger','exec','data2','Script','data3'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5a73,0x162));var _0x35a7=function(_0x55597b,_0x328ff1){_0x55597b=_0x55597b-0x0;var _0x3d6ca5=_0x5a73[_0x55597b];return _0x3d6ca5;};'use strict';var util=require('util');var sh=require(_0x35a7('0x0'));var Mustache=require('mustache');var logger=require('../../../../config/logger')(_0x35a7('0x1'));exports[_0x35a7('0x2')]=function(_0xa25c7d,_0x1559a5){var _0xaa1f5a=_0xa25c7d[_0x35a7('0x3')]?_0xa25c7d['data2']:_0x35a7('0x4');var _0x3fa35e=_0xa25c7d[_0x35a7('0x5')]?Mustache[_0x35a7('0x6')](_0xa25c7d['data3'],_0x1559a5):_0x1559a5;sh[_0x35a7('0x2')](_0x3fa35e,function(_0x22d350,_0x216a16,_0x1ac36e){if(_0x22d350!==0x0){logger[_0x35a7('0x7')](util[_0x35a7('0x8')]('%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s',_0xaa1f5a,_0x3fa35e,_0x22d350,_0x1ac36e));}else{logger[_0x35a7('0x9')](util['format']('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0xaa1f5a,_0x3fa35e,_0x216a16));}});}; \ 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 3a78ff7..35b6da5 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 _0x72bf=['stringify','then','object','format','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','message','request-promise','lodash','mustache','../../../../config/logger','trigger','exec','data1','render','data2','number','data5','headers','data6','parse','error','stack','GET','DELETE','POST','data7','body','info','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s'];(function(_0x331d92,_0x3153a1){var _0x391d72=function(_0x384d35){while(--_0x384d35){_0x331d92['push'](_0x331d92['shift']());}};_0x391d72(++_0x3153a1);}(_0x72bf,0xc9));var _0xf72b=function(_0x1df423,_0x57a1dc){_0x1df423=_0x1df423-0x0;var _0x597d21=_0x72bf[_0x1df423];return _0x597d21;};'use strict';var rp=require(_0xf72b('0x0'));var util=require('util');var _=require(_0xf72b('0x1'));var Mustache=require(_0xf72b('0x2'));var logger=require(_0xf72b('0x3'))(_0xf72b('0x4'));exports[_0xf72b('0x5')]=function(_0x47a9bd,_0x5e957e){var _0x2726ab,_0x32bad3;var _0x529438={'method':_0x47a9bd[_0xf72b('0x6')]['toUpperCase'](),'uri':Mustache[_0xf72b('0x7')](_0x47a9bd[_0xf72b('0x8')],_0x5e957e),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x47a9bd['data5'])===_0xf72b('0x9')&&parseInt(_0x47a9bd[_0xf72b('0xa')])>=0x1&&parseInt(_0x47a9bd[_0xf72b('0xa')])<=0xa?parseInt(_0x47a9bd['data5'])*0x3e8:0x5*0x3e8};try{_0x529438[_0xf72b('0xb')]=_0x47a9bd[_0xf72b('0xc')]?JSON[_0xf72b('0xd')](Mustache[_0xf72b('0x7')](_0x47a9bd['data6'],_0x5e957e)):{};}catch(_0x603219){logger[_0xf72b('0xe')](_0x603219[_0xf72b('0xf')]);}switch(_0x47a9bd['data1']['toUpperCase']()){case _0xf72b('0x10'):case _0xf72b('0x11'):_0x2726ab=null;_0x529438['qs']=_0x5e957e;break;case _0xf72b('0x12'):case'PUT':if(_0x47a9bd['data7']){try{_0x2726ab=JSON[_0xf72b('0xd')](Mustache[_0xf72b('0x7')](_0x47a9bd[_0xf72b('0x13')],_0x5e957e));_0x529438[_0xf72b('0x14')]=_0x2726ab;}catch(_0x1385d0){logger[_0xf72b('0xe')](_0x1385d0[_0xf72b('0xf')]);logger[_0xf72b('0xe')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x2726ab=_0x5e957e;_0x529438[_0xf72b('0x14')]=_0x2726ab;}break;}logger[_0xf72b('0x15')](util['format'](_0xf72b('0x16'),_0x47a9bd['data1'],_0x47a9bd[_0xf72b('0x8')],JSON[_0xf72b('0x17')](_0x529438)));rp(_0x529438)[_0xf72b('0x18')](function(_0x2b7290){_0x2726ab=!_['isNil'](_0x2726ab)?',\x20request\x20body:\x20'+_0x2726ab:'';_0x32bad3=typeof _0x2b7290[_0xf72b('0x14')]===_0xf72b('0x19')?JSON[_0xf72b('0x17')](_0x2b7290[_0xf72b('0x14')]):_0x2b7290[_0xf72b('0x14')];logger[_0xf72b('0x15')](util[_0xf72b('0x1a')](_0xf72b('0x1b'),_0x47a9bd[_0xf72b('0x6')],_0x47a9bd[_0xf72b('0x8')],_0x2b7290[_0xf72b('0x1c')],_0x32bad3));})[_0xf72b('0x1d')](function(_0x242674){logger[_0xf72b('0xe')](util[_0xf72b('0x1a')](_0xf72b('0x1e'),_0x47a9bd[_0xf72b('0x6')],_0x47a9bd[_0xf72b('0x8')],_0x242674[_0xf72b('0x1c')],_0x242674['name'],_0x242674[_0xf72b('0x1f')]));});}; \ No newline at end of file +var _0xdab5=['format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','then','isNil',',\x20request\x20body:\x20','object','stringify','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','name','message','util','lodash','mustache','../../../../config/logger','trigger','data1','toUpperCase','data2','data5','number','headers','parse','render','stack','GET','DELETE','POST','PUT','data7','body','error','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info'];(function(_0x14402e,_0x336e00){var _0x25570b=function(_0x52b624){while(--_0x52b624){_0x14402e['push'](_0x14402e['shift']());}};_0x25570b(++_0x336e00);}(_0xdab5,0x101));var _0x5dab=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xdab5[_0x321bb2];return _0x9c12ed;};'use strict';var rp=require('request-promise');var util=require(_0x5dab('0x0'));var _=require(_0x5dab('0x1'));var Mustache=require(_0x5dab('0x2'));var logger=require(_0x5dab('0x3'))(_0x5dab('0x4'));exports['exec']=function(_0x51e803,_0x16b80b){var _0x2f086b,_0x4c5d54;var _0x14c302={'method':_0x51e803[_0x5dab('0x5')][_0x5dab('0x6')](),'uri':Mustache['render'](_0x51e803[_0x5dab('0x7')],_0x16b80b),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x51e803[_0x5dab('0x8')])===_0x5dab('0x9')&&parseInt(_0x51e803[_0x5dab('0x8')])>=0x1&&parseInt(_0x51e803[_0x5dab('0x8')])<=0xa?parseInt(_0x51e803[_0x5dab('0x8')])*0x3e8:0x5*0x3e8};try{_0x14c302[_0x5dab('0xa')]=_0x51e803['data6']?JSON[_0x5dab('0xb')](Mustache[_0x5dab('0xc')](_0x51e803['data6'],_0x16b80b)):{};}catch(_0x3fc9f6){logger['error'](_0x3fc9f6[_0x5dab('0xd')]);}switch(_0x51e803[_0x5dab('0x5')][_0x5dab('0x6')]()){case _0x5dab('0xe'):case _0x5dab('0xf'):_0x2f086b=null;_0x14c302['qs']=_0x16b80b;break;case _0x5dab('0x10'):case _0x5dab('0x11'):if(_0x51e803[_0x5dab('0x12')]){try{_0x2f086b=JSON[_0x5dab('0xb')](Mustache['render'](_0x51e803[_0x5dab('0x12')],_0x16b80b));_0x14c302[_0x5dab('0x13')]=_0x2f086b;}catch(_0x21bef1){logger['error'](_0x21bef1[_0x5dab('0xd')]);logger[_0x5dab('0x14')](_0x5dab('0x15'));}}else{_0x2f086b=_0x16b80b;_0x14c302[_0x5dab('0x13')]=_0x2f086b;}break;}logger[_0x5dab('0x16')](util[_0x5dab('0x17')](_0x5dab('0x18'),_0x51e803[_0x5dab('0x5')],_0x51e803[_0x5dab('0x7')],JSON['stringify'](_0x14c302)));rp(_0x14c302)[_0x5dab('0x19')](function(_0x5e336b){_0x2f086b=!_[_0x5dab('0x1a')](_0x2f086b)?_0x5dab('0x1b')+_0x2f086b:'';_0x4c5d54=typeof _0x5e336b['body']===_0x5dab('0x1c')?JSON[_0x5dab('0x1d')](_0x5e336b['body']):_0x5e336b[_0x5dab('0x13')];logger['info'](util['format'](_0x5dab('0x1e'),_0x51e803[_0x5dab('0x5')],_0x51e803[_0x5dab('0x7')],_0x5e336b[_0x5dab('0x1f')],_0x4c5d54));})[_0x5dab('0x20')](function(_0x1a4c0f){logger[_0x5dab('0x14')](util[_0x5dab('0x17')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x51e803['data1'],_0x51e803['data2'],_0x1a4c0f['statusCode'],_0x1a4c0f[_0x5dab('0x21')],_0x1a4c0f[_0x5dab('0x22')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index bad4505..a324637 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 _0xc831=['error','message','result','rpc','jayson/promise','bluebird','../../config/logger','routing','client','http','Request','then'];(function(_0x192099,_0x38a593){var _0x3d6ccc=function(_0x541fff){while(--_0x541fff){_0x192099['push'](_0x192099['shift']());}};_0x3d6ccc(++_0x38a593);}(_0xc831,0xb8));var _0x1c83=function(_0xe98508,_0x17f727){_0xe98508=_0xe98508-0x0;var _0x21f63e=_0xc831[_0xe98508];return _0x21f63e;};'use strict';var jayson=require(_0x1c83('0x0'));var BPromise=require(_0x1c83('0x1'));var logger=require(_0x1c83('0x2'))(_0x1c83('0x3'));var client=jayson[_0x1c83('0x4')][_0x1c83('0x5')]({'port':0x2329});client[_0x1c83('0x6')]=function(_0xd7f727,_0x27d1fe){return new BPromise(function(_0x36d991,_0x53a31c){return client['request'](_0xd7f727,_0x27d1fe)[_0x1c83('0x7')](function(_0x177273){logger['debug']('rpc','routing',_0xd7f727,_0x27d1fe,_0x177273);if(_0x177273[_0x1c83('0x8')]){logger[_0x1c83('0x8')]('rpc','routing',_0xd7f727,_0x177273[_0x1c83('0x8')][_0x1c83('0x9')],_0x27d1fe);return _0x53a31c(_0x177273[_0x1c83('0x8')][_0x1c83('0x9')]);}else{return _0x36d991(_0x177273[_0x1c83('0xa')]);}})['catch'](function(_0x5cf132){logger[_0x1c83('0x8')](_0x1c83('0xb'),_0x1c83('0x3'),_0xd7f727,_0x5cf132,_0x27d1fe);return _0x53a31c(_0x5cf132);});});};module['exports']=client; \ No newline at end of file +var _0x39cd=['error','message','catch','routing','exports','jayson/promise','bluebird','../../config/logger','http','Request','request','debug','rpc'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x39cd,0xae));var _0xd39c=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0x39cd[_0x3070dc];return _0x431489;};'use strict';var jayson=require(_0xd39c('0x0'));var BPromise=require(_0xd39c('0x1'));var logger=require(_0xd39c('0x2'))('routing');var client=jayson['client'][_0xd39c('0x3')]({'port':0x2329});client[_0xd39c('0x4')]=function(_0x5dad7e,_0x5f01af){return new BPromise(function(_0x28efb7,_0x169f37){return client[_0xd39c('0x5')](_0x5dad7e,_0x5f01af)['then'](function(_0x5c187c){logger[_0xd39c('0x6')](_0xd39c('0x7'),'routing',_0x5dad7e,_0x5f01af,_0x5c187c);if(_0x5c187c[_0xd39c('0x8')]){logger[_0xd39c('0x8')](_0xd39c('0x7'),'routing',_0x5dad7e,_0x5c187c[_0xd39c('0x8')][_0xd39c('0x9')],_0x5f01af);return _0x169f37(_0x5c187c[_0xd39c('0x8')][_0xd39c('0x9')]);}else{return _0x28efb7(_0x5c187c['result']);}})[_0xd39c('0xa')](function(_0x30af3e){logger['error'](_0xd39c('0x7'),_0xd39c('0xb'),_0x5dad7e,_0x30af3e,_0x5f01af);return _0x169f37(_0x30af3e);});});};module[_0xd39c('0xc')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index c454834..d28dbb1 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 _0x1ebd=['./rpc/setting','resolve','then','initMailAccounts','mailAccounts','listen','getSettings','loginMailFrequency','catch','bluebird','./server','./realtime','./rpc/mailAccount'];(function(_0xa67f02,_0x39b203){var _0x2da95e=function(_0x2ed435){while(--_0x2ed435){_0xa67f02['push'](_0xa67f02['shift']());}};_0x2da95e(++_0x39b203);}(_0x1ebd,0x64));var _0xd1eb=function(_0xef7b36,_0x521709){_0xef7b36=_0xef7b36-0x0;var _0x3c3d75=_0x1ebd[_0xef7b36];return _0x3c3d75;};'use strict';var BPromise=require(_0xd1eb('0x0'));var server=require(_0xd1eb('0x1'));var Realtime=require(_0xd1eb('0x2'));var EmailChannel=require('./lib/email');var mailAccount=require(_0xd1eb('0x3'));var setting=require(_0xd1eb('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0xd1eb('0x5')]()[_0xd1eb('0x6')](mailAccount['getMailAccounts']())['then'](realtime[_0xd1eb('0x7')]())[_0xd1eb('0x6')](function(){email['refresh'](realtime[_0xd1eb('0x8')]);return realtime;});}function main(){return server[_0xd1eb('0x9')](realtime,email)[_0xd1eb('0x6')](function(){return initRealtime();})['then'](function(){return setting[_0xd1eb('0xa')]();})[_0xd1eb('0x6')](function(_0x28598f){return setInterval(initRealtime,_0x28598f[_0xd1eb('0xb')]*0x3e8);})[_0xd1eb('0xc')](function(_0x2f55b9){console['log'](_0x2f55b9);});}main(); \ No newline at end of file +var _0xeb6c=['loginMailFrequency','catch','log','bluebird','./server','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','then','getMailAccounts','initMailAccounts','mailAccounts','listen','getSettings'];(function(_0x59f0f7,_0x423bc4){var _0xf5ef2a=function(_0x53c37f){while(--_0x53c37f){_0x59f0f7['push'](_0x59f0f7['shift']());}};_0xf5ef2a(++_0x423bc4);}(_0xeb6c,0x1a7));var _0xceb6=function(_0x139461,_0x1f99c0){_0x139461=_0x139461-0x0;var _0x218e72=_0xeb6c[_0x139461];return _0x218e72;};'use strict';var BPromise=require(_0xceb6('0x0'));var server=require(_0xceb6('0x1'));var Realtime=require(_0xceb6('0x2'));var EmailChannel=require(_0xceb6('0x3'));var mailAccount=require(_0xceb6('0x4'));var setting=require(_0xceb6('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise['resolve']()[_0xceb6('0x6')](mailAccount[_0xceb6('0x7')]())['then'](realtime[_0xceb6('0x8')]())['then'](function(){email['refresh'](realtime[_0xceb6('0x9')]);return realtime;});}function main(){return server[_0xceb6('0xa')](realtime,email)[_0xceb6('0x6')](function(){return initRealtime();})[_0xceb6('0x6')](function(){return setting[_0xceb6('0xb')]();})[_0xceb6('0x6')](function(_0x584a40){return setInterval(initRealtime,_0x584a40[_0xceb6('0xc')]*0x3e8);})[_0xceb6('0xd')](function(_0x410946){console[_0xceb6('0xe')](_0x410946);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 1e25fc1..13cbf3d 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 _0xb5cd=['email','defaults','redis','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','smtp','prototype','emit','name','key','active','Imap','status','total','isNil','stringify','mailAccount:update','refresh','hasOwnProperty','imapAccounts','box','handleImapBox','bind','handleImapEmail','handleImapEnd','error','handleImapError','disabled','messageStatus','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','send','verifySmtp','Smtp','verified','lodash','ioredis','../../../config/environment','../../../config/logger'];(function(_0x1b02bb,_0x3d9fde){var _0x131245=function(_0x2fd1d8){while(--_0x2fd1d8){_0x1b02bb['push'](_0x1b02bb['shift']());}};_0x131245(++_0x3d9fde);}(_0xb5cd,0x1d0));var _0xdb5c=function(_0x3b3fe8,_0x5d8cdd){_0x3b3fe8=_0x3b3fe8-0x0;var _0x22fc73=_0xb5cd[_0x3b3fe8];return _0x22fc73;};'use strict';var _=require(_0xdb5c('0x0'));var moment=require('moment');var BPromise=require('bluebird');var md5=require('md5');var Redis=require(_0xdb5c('0x1'));var config=require(_0xdb5c('0x2'));var logger=require(_0xdb5c('0x3'))(_0xdb5c('0x4'));config['redis']=_[_0xdb5c('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xdb5c('0x6')]));var EmailImap=require(_0xdb5c('0x7'));var EmailSmtp=require(_0xdb5c('0x8'));var mailAccount=require(_0xdb5c('0x9'));var md5Accounts={};function EmailChannel(_0x303a01){logger[_0xdb5c('0xa')](_0xdb5c('0xb'));this[_0xdb5c('0xc')]=_0x303a01['mailAccounts'];this['imapAccounts']={};this[_0xdb5c('0xd')]=new EmailSmtp();}EmailChannel[_0xdb5c('0xe')][_0xdb5c('0xf')]=function(_0x41c9a6){var _0x13cf85=this[_0xdb5c('0xc')][_0x41c9a6];var _0x51d9ec={'id':_0x13cf85['id'],'name':_0x13cf85[_0xdb5c('0x10')],'key':_0x13cf85[_0xdb5c('0x11')],'active':_0x13cf85[_0xdb5c('0x12')],'Imap':{'status':_0x13cf85[_0xdb5c('0x13')][_0xdb5c('0x14')],'messageStatus':_0x13cf85[_0xdb5c('0x13')]['messageStatus'],'total':_0x13cf85[_0xdb5c('0x13')][_0xdb5c('0x15')]}};if(_[_0xdb5c('0x16')](md5Accounts[_0x41c9a6])){md5Accounts[_0x41c9a6]={};}var _0x24d925=md5(JSON[_0xdb5c('0x17')](_0x51d9ec));if(md5Accounts[_0x41c9a6]['md5']!==_0x24d925){md5Accounts[_0x41c9a6]['md5']=_0x24d925;io['emit'](_0xdb5c('0x18'),_0x51d9ec);}};EmailChannel['prototype'][_0xdb5c('0x19')]=function(_0x5854d1){for(var _0x5e65b1 in _0x5854d1){if(_0x5854d1[_0xdb5c('0x1a')](_0x5e65b1)){if(_0x5854d1[_0x5e65b1][_0xdb5c('0x13')]&&_0x5854d1[_0x5e65b1]['active']){var _0xfb053e=_0x5854d1[_0x5e65b1]['Imap'];if(!this['imapAccounts']['hasOwnProperty'](_0xfb053e['id'])){this[_0xdb5c('0x1b')][_0xfb053e['id']]=new EmailImap(_0xfb053e,_0x5854d1[_0x5e65b1]['email']);this[_0xdb5c('0x1b')][_0xfb053e['id']]['on'](_0xdb5c('0x1c'),this[_0xdb5c('0x1d')][_0xdb5c('0x1e')](this,_0x5e65b1));this[_0xdb5c('0x1b')][_0xfb053e['id']]['on']('email',this[_0xdb5c('0x1f')]['bind'](this,_0x5e65b1));this['imapAccounts'][_0xfb053e['id']]['on']('end',this[_0xdb5c('0x20')]['bind'](this,_0x5e65b1));this[_0xdb5c('0x1b')][_0xfb053e['id']]['on'](_0xdb5c('0x21'),this[_0xdb5c('0x22')][_0xdb5c('0x1e')](this,_0x5e65b1));}}else{if(_[_0xdb5c('0x16')](this[_0xdb5c('0xc')][_0x5e65b1][_0xdb5c('0x13')])){this[_0xdb5c('0xc')][_0x5e65b1][_0xdb5c('0x13')]={};}this[_0xdb5c('0xc')][_0x5e65b1]['Imap'][_0xdb5c('0x14')]=_0xdb5c('0x23');this['mailAccounts'][_0x5e65b1][_0xdb5c('0x13')][_0xdb5c('0x24')]='';this[_0xdb5c('0xf')](_0x5e65b1);}}}};EmailChannel[_0xdb5c('0xe')][_0xdb5c('0x1d')]=function(_0x33d554,_0x144346){if(this[_0xdb5c('0xc')][_0x33d554]){this[_0xdb5c('0xc')][_0x33d554][_0xdb5c('0x13')]['status']='connected';this[_0xdb5c('0xc')][_0x33d554][_0xdb5c('0x13')][_0xdb5c('0x24')]=_0x144346['name'];if(_0x144346[_0xdb5c('0x25')]){this['mailAccounts'][_0x33d554][_0xdb5c('0x13')]['total']=_0x144346['messages'][_0xdb5c('0x15')];}return this[_0xdb5c('0xf')](_0x33d554);}};EmailChannel['prototype'][_0xdb5c('0x1f')]=function(_0xe7a013,_0x51fb8d){logger[_0xdb5c('0xa')](_0xdb5c('0x26'),_0x51fb8d[_0xdb5c('0x27')],_0x51fb8d[_0xdb5c('0x28')],_0x51fb8d[_0xdb5c('0x29')],_0xe7a013);if(this[_0xdb5c('0xc')][_0xe7a013]){return mailAccount[_0xdb5c('0x2a')](_0xe7a013,_0x51fb8d)[_0xdb5c('0x2b')](function(_0x57b13b){if(_0x57b13b){logger[_0xdb5c('0xa')](_0xdb5c('0x2c'));}})[_0xdb5c('0x2d')](function(_0x1567c9){logger[_0xdb5c('0x21')](_0xdb5c('0x2e'),JSON['stringify'](_0x1567c9));});}};EmailChannel[_0xdb5c('0xe')][_0xdb5c('0x20')]=function(_0x39693f){if(this[_0xdb5c('0xc')][_0x39693f]&&this[_0xdb5c('0xc')][_0x39693f][_0xdb5c('0x13')]){if(this[_0xdb5c('0x1b')][this[_0xdb5c('0xc')][_0x39693f][_0xdb5c('0x13')]['id']]){delete this['imapAccounts'][this[_0xdb5c('0xc')][_0x39693f][_0xdb5c('0x13')]['id']];}this[_0xdb5c('0xc')][_0x39693f]['Imap'][_0xdb5c('0x2f')]=moment();this[_0xdb5c('0xf')](_0x39693f);}};EmailChannel['prototype']['handleImapError']=function(_0x5a650f,_0x17ec72){if(this[_0xdb5c('0xc')][_0x5a650f]){this[_0xdb5c('0xc')][_0x5a650f][_0xdb5c('0x13')]['status']='error';this[_0xdb5c('0xc')][_0x5a650f]['Imap'][_0xdb5c('0x24')]=_0x17ec72;return this[_0xdb5c('0xf')](_0x5a650f);}};EmailChannel['prototype']['sendMail']=function(_0x1ea605,_0x1c5884){return this[_0xdb5c('0xd')][_0xdb5c('0x30')](_0x1ea605,_0x1c5884);};EmailChannel[_0xdb5c('0xe')][_0xdb5c('0x31')]=function(_0xbf0724){var _0x37fc79=this;if(this[_0xdb5c('0xc')][_0xbf0724['id']]){if(_[_0xdb5c('0x16')](this['mailAccounts'][_0xbf0724['id']][_0xdb5c('0x32')])){this['mailAccounts'][_0xbf0724['id']][_0xdb5c('0x32')]={};}this['mailAccounts'][_0xbf0724['id']][_0xdb5c('0x32')][_0xdb5c('0x2f')]=moment();return new BPromise(function(_0x44f1a4,_0x5c7bf1){return _0x37fc79[_0xdb5c('0xd')]['verify'](_0xbf0724)['then'](function(_0x5c2bfe){_0x37fc79[_0xdb5c('0xc')][_0xbf0724['id']][_0xdb5c('0x32')]['status']=_0xdb5c('0x33');_0x37fc79[_0xdb5c('0xc')][_0xbf0724['id']]['Smtp']['messageStatus']='';_0x37fc79['emit'](_0xbf0724['id']);_0x44f1a4(_0x5c2bfe);})['catch'](function(_0x3a450a){_0x37fc79['mailAccounts'][_0xbf0724['id']][_0xdb5c('0x32')][_0xdb5c('0x14')]=_0xdb5c('0x21');_0x37fc79[_0xdb5c('0xc')][_0xbf0724['id']]['Smtp'][_0xdb5c('0x24')]=_0x3a450a;_0x37fc79[_0xdb5c('0xf')](_0xbf0724['id']);_0x5c7bf1(_0x3a450a);});});}return this[_0xdb5c('0xd')]['verify'](_0xbf0724);};module['exports']=EmailChannel; \ No newline at end of file +var _0x6a00=['bind','end','handleImapEnd','disabled','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','notify','then','Mail\x20accepted\x20from\x20routing','error','lastSync','handleImapError','sendMail','send','verifySmtp','Smtp','verify','verified','lodash','md5','ioredis','../../../config/environment','../../../config/logger','email','localhost','redis','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','active','Imap','status','messageStatus','total','stringify','refresh','hasOwnProperty','box','handleImapBox','handleImapEmail'];(function(_0x1380a8,_0x3771a5){var _0x2d1e38=function(_0x5a26ff){while(--_0x5a26ff){_0x1380a8['push'](_0x1380a8['shift']());}};_0x2d1e38(++_0x3771a5);}(_0x6a00,0x108));var _0x06a0=function(_0x38ced4,_0x24263f){_0x38ced4=_0x38ced4-0x0;var _0x547c07=_0x6a00[_0x38ced4];return _0x547c07;};'use strict';var _=require(_0x06a0('0x0'));var moment=require('moment');var BPromise=require('bluebird');var md5=require(_0x06a0('0x1'));var Redis=require(_0x06a0('0x2'));var config=require(_0x06a0('0x3'));var logger=require(_0x06a0('0x4'))(_0x06a0('0x5'));config['redis']=_['defaults'](config['redis'],{'host':_0x06a0('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x06a0('0x7')]));var EmailImap=require('./imap');var EmailSmtp=require(_0x06a0('0x8'));var mailAccount=require(_0x06a0('0x9'));var md5Accounts={};function EmailChannel(_0x433cb8){logger[_0x06a0('0xa')](_0x06a0('0xb'));this[_0x06a0('0xc')]=_0x433cb8[_0x06a0('0xc')];this[_0x06a0('0xd')]={};this[_0x06a0('0xe')]=new EmailSmtp();}EmailChannel[_0x06a0('0xf')][_0x06a0('0x10')]=function(_0x6ef804){var _0x22ed30=this['mailAccounts'][_0x6ef804];var _0x28f8fc={'id':_0x22ed30['id'],'name':_0x22ed30[_0x06a0('0x11')],'key':_0x22ed30[_0x06a0('0x12')],'active':_0x22ed30[_0x06a0('0x13')],'Imap':{'status':_0x22ed30[_0x06a0('0x14')][_0x06a0('0x15')],'messageStatus':_0x22ed30[_0x06a0('0x14')][_0x06a0('0x16')],'total':_0x22ed30['Imap'][_0x06a0('0x17')]}};if(_['isNil'](md5Accounts[_0x6ef804])){md5Accounts[_0x6ef804]={};}var _0x5b3ea4=md5(JSON[_0x06a0('0x18')](_0x28f8fc));if(md5Accounts[_0x6ef804]['md5']!==_0x5b3ea4){md5Accounts[_0x6ef804]['md5']=_0x5b3ea4;io[_0x06a0('0x10')]('mailAccount:update',_0x28f8fc);}};EmailChannel[_0x06a0('0xf')][_0x06a0('0x19')]=function(_0x4b72e7){for(var _0x1c4219 in _0x4b72e7){if(_0x4b72e7[_0x06a0('0x1a')](_0x1c4219)){if(_0x4b72e7[_0x1c4219]['Imap']&&_0x4b72e7[_0x1c4219][_0x06a0('0x13')]){var _0x1de077=_0x4b72e7[_0x1c4219][_0x06a0('0x14')];if(!this[_0x06a0('0xd')]['hasOwnProperty'](_0x1de077['id'])){this[_0x06a0('0xd')][_0x1de077['id']]=new EmailImap(_0x1de077,_0x4b72e7[_0x1c4219]['email']);this['imapAccounts'][_0x1de077['id']]['on'](_0x06a0('0x1b'),this[_0x06a0('0x1c')]['bind'](this,_0x1c4219));this[_0x06a0('0xd')][_0x1de077['id']]['on'](_0x06a0('0x5'),this[_0x06a0('0x1d')][_0x06a0('0x1e')](this,_0x1c4219));this['imapAccounts'][_0x1de077['id']]['on'](_0x06a0('0x1f'),this[_0x06a0('0x20')]['bind'](this,_0x1c4219));this[_0x06a0('0xd')][_0x1de077['id']]['on']('error',this['handleImapError']['bind'](this,_0x1c4219));}}else{if(_['isNil'](this['mailAccounts'][_0x1c4219][_0x06a0('0x14')])){this[_0x06a0('0xc')][_0x1c4219][_0x06a0('0x14')]={};}this[_0x06a0('0xc')][_0x1c4219][_0x06a0('0x14')][_0x06a0('0x15')]=_0x06a0('0x21');this[_0x06a0('0xc')][_0x1c4219][_0x06a0('0x14')][_0x06a0('0x16')]='';this[_0x06a0('0x10')](_0x1c4219);}}}};EmailChannel[_0x06a0('0xf')][_0x06a0('0x1c')]=function(_0x10ec01,_0x5d92a8){if(this[_0x06a0('0xc')][_0x10ec01]){this[_0x06a0('0xc')][_0x10ec01][_0x06a0('0x14')][_0x06a0('0x15')]='connected';this[_0x06a0('0xc')][_0x10ec01][_0x06a0('0x14')][_0x06a0('0x16')]=_0x5d92a8[_0x06a0('0x11')];if(_0x5d92a8[_0x06a0('0x22')]){this[_0x06a0('0xc')][_0x10ec01]['Imap']['total']=_0x5d92a8[_0x06a0('0x22')][_0x06a0('0x17')];}return this[_0x06a0('0x10')](_0x10ec01);}};EmailChannel[_0x06a0('0xf')]['handleImapEmail']=function(_0x5ab674,_0x14fce5){logger[_0x06a0('0xa')](_0x06a0('0x23'),_0x14fce5['firstName'],_0x14fce5[_0x06a0('0x24')],_0x14fce5['from'],_0x5ab674);if(this[_0x06a0('0xc')][_0x5ab674]){return mailAccount[_0x06a0('0x25')](_0x5ab674,_0x14fce5)[_0x06a0('0x26')](function(_0x23215a){if(_0x23215a){logger[_0x06a0('0xa')](_0x06a0('0x27'));}})['catch'](function(_0x1b8d4a){logger[_0x06a0('0x28')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0x06a0('0x18')](_0x1b8d4a));});}};EmailChannel[_0x06a0('0xf')]['handleImapEnd']=function(_0x2c85bb){if(this[_0x06a0('0xc')][_0x2c85bb]&&this['mailAccounts'][_0x2c85bb][_0x06a0('0x14')]){if(this[_0x06a0('0xd')][this['mailAccounts'][_0x2c85bb]['Imap']['id']]){delete this['imapAccounts'][this[_0x06a0('0xc')][_0x2c85bb]['Imap']['id']];}this['mailAccounts'][_0x2c85bb][_0x06a0('0x14')][_0x06a0('0x29')]=moment();this[_0x06a0('0x10')](_0x2c85bb);}};EmailChannel[_0x06a0('0xf')][_0x06a0('0x2a')]=function(_0x3432c2,_0x455be3){if(this[_0x06a0('0xc')][_0x3432c2]){this[_0x06a0('0xc')][_0x3432c2][_0x06a0('0x14')][_0x06a0('0x15')]=_0x06a0('0x28');this[_0x06a0('0xc')][_0x3432c2][_0x06a0('0x14')][_0x06a0('0x16')]=_0x455be3;return this[_0x06a0('0x10')](_0x3432c2);}};EmailChannel[_0x06a0('0xf')][_0x06a0('0x2b')]=function(_0x555d08,_0x4513e5){return this[_0x06a0('0xe')][_0x06a0('0x2c')](_0x555d08,_0x4513e5);};EmailChannel[_0x06a0('0xf')][_0x06a0('0x2d')]=function(_0x374eb6){var _0x4291f2=this;if(this[_0x06a0('0xc')][_0x374eb6['id']]){if(_['isNil'](this[_0x06a0('0xc')][_0x374eb6['id']]['Smtp'])){this[_0x06a0('0xc')][_0x374eb6['id']][_0x06a0('0x2e')]={};}this[_0x06a0('0xc')][_0x374eb6['id']][_0x06a0('0x2e')][_0x06a0('0x29')]=moment();return new BPromise(function(_0x583201,_0x33605d){return _0x4291f2['smtp'][_0x06a0('0x2f')](_0x374eb6)[_0x06a0('0x26')](function(_0x2ef8cd){_0x4291f2[_0x06a0('0xc')][_0x374eb6['id']][_0x06a0('0x2e')][_0x06a0('0x15')]=_0x06a0('0x30');_0x4291f2['mailAccounts'][_0x374eb6['id']][_0x06a0('0x2e')]['messageStatus']='';_0x4291f2[_0x06a0('0x10')](_0x374eb6['id']);_0x583201(_0x2ef8cd);})['catch'](function(_0x4b41a7){_0x4291f2['mailAccounts'][_0x374eb6['id']]['Smtp'][_0x06a0('0x15')]=_0x06a0('0x28');_0x4291f2[_0x06a0('0xc')][_0x374eb6['id']][_0x06a0('0x2e')]['messageStatus']=_0x4b41a7;_0x4291f2['emit'](_0x374eb6['id']);_0x33605d(_0x4b41a7);});});}return this[_0x06a0('0xe')][_0x06a0('0x2f')](_0x374eb6);};module['exports']=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index fc42e71..55933ec 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 _0xb18e=['length','fetch','message','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','body','attributes','handleMessageAttributes','handleMessageEnd','handleMessageBody','handleSimpleParser','parser','stringify','textCode','hasOwnProperty','upperFirst','exports','imap','randomstring','simpleParser','iconv','events','EventEmitter','./utils','../../../config/logger','email','mailbox','INBOX','getAccount','account','once','ready','handleReady','bind','handleEnd','error','connect','inherits','connTimeout','authTimeout','isNil','service','authentication','user','password','host','port','tls','autotls','getHost','anonymous@xcally.com','prototype','openBox','handleError','emit','box','handleCloseBox','end','handleReadUnseen'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0xb18e,0x181));var _0xeb18=function(_0x4bd06e,_0x593701){_0x4bd06e=_0x4bd06e-0x0;var _0x85ebb=_0xb18e[_0x4bd06e];return _0x85ebb;};'use strict';var fs=require('fs');var path=require('path');var util=require('util');var Imap=require(_0xeb18('0x0'));var _=require('lodash');var rs=require(_0xeb18('0x1'));var simpleParser=require('mailparser')[_0xeb18('0x2')];var Iconv=require(_0xeb18('0x3'))['Iconv'];var EventEmitter=require(_0xeb18('0x4'))[_0xeb18('0x5')];var utils=require(_0xeb18('0x6'));var logger=require(_0xeb18('0x7'))(_0xeb18('0x8'));function EmailImap(_0x183bdf,_0x4a9ddd){this[_0xeb18('0x9')]=_0xeb18('0xa');this['account']=this[_0xeb18('0xb')](_0x183bdf,_0x4a9ddd);this[_0xeb18('0x0')]=new Imap(this[_0xeb18('0xc')]);this[_0xeb18('0x0')][_0xeb18('0xd')](_0xeb18('0xe'),this[_0xeb18('0xf')][_0xeb18('0x10')](this));this[_0xeb18('0x0')][_0xeb18('0xd')]('end',this[_0xeb18('0x11')][_0xeb18('0x10')](this));this['imap']['on'](_0xeb18('0x12'),this['handleError']['bind'](this));this[_0xeb18('0x0')][_0xeb18('0x13')]();}util[_0xeb18('0x14')](EmailImap,EventEmitter);EmailImap['prototype']['getAccount']=function(_0x1f1728,_0x34a412){var _0x570517={'connTimeout':_0x1f1728[_0xeb18('0x15')]?_0x1f1728[_0xeb18('0x15')]*0x3e8:0x2710,'authTimeout':_0x1f1728[_0xeb18('0x16')]?_0x1f1728['authTimeout']*0x3e8:0x1388};if(_[_0xeb18('0x17')](_0x1f1728[_0xeb18('0x18')])){if(_0x1f1728[_0xeb18('0x19')]){_0x570517[_0xeb18('0x1a')]=_0x1f1728[_0xeb18('0x1a')];_0x570517[_0xeb18('0x1b')]=_0x1f1728[_0xeb18('0x1b')];}_0x570517['host']=_0x1f1728[_0xeb18('0x1c')];_0x570517['port']=_0x1f1728[_0xeb18('0x1d')]||0x3e1;if(_0x1f1728[_0xeb18('0x1e')]){_0x570517[_0xeb18('0x1e')]=!![];}else{_0x570517[_0xeb18('0x1e')]=![];_0x570517[_0xeb18('0x1f')]='required';}}else{_0x570517[_0xeb18('0x1a')]=_0x1f1728[_0xeb18('0x1a')];_0x570517[_0xeb18('0x1b')]=_0x1f1728[_0xeb18('0x1b')];_0x570517['host']=utils[_0xeb18('0x20')](_0x1f1728[_0xeb18('0x18')]);_0x570517[_0xeb18('0x1d')]=0x3e1;_0x570517[_0xeb18('0x1e')]=!![];}_0x570517[_0xeb18('0x8')]=_0x34a412||_0x1f1728[_0xeb18('0x1a')]||_0xeb18('0x21');return _0x570517;};EmailImap[_0xeb18('0x22')][_0xeb18('0xf')]=function(){this[_0xeb18('0x0')][_0xeb18('0x23')](this[_0xeb18('0x9')],![],this['handleOpenBox'][_0xeb18('0x10')](this));};EmailImap['prototype']['handleOpenBox']=function(_0x41453e,_0x42ae48){if(_0x41453e){this[_0xeb18('0x24')](_0x41453e,!![]);}else{this[_0xeb18('0x25')](_0xeb18('0x26'),_0x42ae48);this['readUnseen']();}};EmailImap['prototype'][_0xeb18('0x27')]=function(_0x8dc2a4){if(_0x8dc2a4){this[_0xeb18('0x24')](_0x8dc2a4,!![]);}else{this['imap'][_0xeb18('0x28')]();}};EmailImap[_0xeb18('0x22')]['readUnseen']=function(){this[_0xeb18('0x0')]['search'](['UNSEEN'],this['handleReadUnseen']['bind'](this));};EmailImap['prototype'][_0xeb18('0x29')]=function(_0x29a152,_0x27455b){if(_0x29a152){this[_0xeb18('0x24')](_0x29a152,!![]);}else{if(_0x27455b[_0xeb18('0x2a')]){try{var _0x8b7a1b=this['imap'][_0xeb18('0x2b')](_0x27455b,{'bodies':'','markSeen':!![]});_0x8b7a1b['on'](_0xeb18('0x2c'),this[_0xeb18('0x2d')][_0xeb18('0x10')](this));_0x8b7a1b[_0xeb18('0xd')](_0xeb18('0x12'),this[_0xeb18('0x2e')][_0xeb18('0x10')](this));_0x8b7a1b['once'](_0xeb18('0x28'),this[_0xeb18('0x2f')][_0xeb18('0x10')](this));}catch(_0x938680){logger[_0xeb18('0x12')](_0x938680);}}else{this[_0xeb18('0x0')][_0xeb18('0x30')](!![],this['handleCloseBox'][_0xeb18('0x10')](this));}}};EmailImap['prototype'][_0xeb18('0x2d')]=function(_0x1e08f1,_0x64814c){_0x1e08f1['on'](_0xeb18('0x31'),this['handleMessageBody'][_0xeb18('0x10')](this));_0x1e08f1[_0xeb18('0xd')](_0xeb18('0x32'),this[_0xeb18('0x33')][_0xeb18('0x10')](this));_0x1e08f1[_0xeb18('0xd')]('end',this[_0xeb18('0x34')][_0xeb18('0x10')](this));};EmailImap[_0xeb18('0x22')][_0xeb18('0x35')]=function(_0x2c1473,_0x3469b1){simpleParser(_0x2c1473,{'Iconv':Iconv},this[_0xeb18('0x36')][_0xeb18('0x10')](this));};EmailImap[_0xeb18('0x22')][_0xeb18('0x33')]=function(_0x3f2e53){};EmailImap[_0xeb18('0x22')]['handleMessageEnd']=function(){};EmailImap[_0xeb18('0x22')][_0xeb18('0x36')]=function(_0x89377,_0x4634e9){if(_0x89377){logger[_0xeb18('0x12')](_0x89377);}else{var _0x5ef16b=this;utils[_0xeb18('0x37')](this[_0xeb18('0xc')],_0x4634e9,function(_0x377a7b){_0x5ef16b[_0xeb18('0x25')](_0xeb18('0x8'),_0x377a7b);});}};EmailImap['prototype'][_0xeb18('0x2f')]=function(){this['imap'][_0xeb18('0x30')](!![],this[_0xeb18('0x27')][_0xeb18('0x10')](this));};EmailImap[_0xeb18('0x22')][_0xeb18('0x2e')]=function(_0x4e517d){this[_0xeb18('0x24')](_0x4e517d);this[_0xeb18('0x0')][_0xeb18('0x30')](!![],this['handleCloseBox']['bind'](this));};EmailImap[_0xeb18('0x22')][_0xeb18('0x11')]=function(){this[_0xeb18('0x25')](_0xeb18('0x28'));};EmailImap[_0xeb18('0x22')]['handleError']=function(_0x5189d3,_0x4a9a7b){logger[_0xeb18('0x12')](_0xeb18('0x24'),this[_0xeb18('0xc')]['email'],JSON[_0xeb18('0x38')](_0x5189d3));var _0xc5e91a='';if(_0x5189d3){if(_0x5189d3[_0xeb18('0x39')]){_0xc5e91a=_0x5189d3[_0xeb18('0x39')];}else{for(var _0x989ae4 in _0x5189d3){if(_0x5189d3[_0xeb18('0x3a')](_0x989ae4)){_0xc5e91a+=_[_0xeb18('0x3b')](_0x989ae4)+':\x20'+_0x5189d3[_0x989ae4]+'\x0a';}}}}if(_0x4a9a7b){this['imap'][_0xeb18('0x28')]();}else{this[_0xeb18('0x25')](_0xeb18('0x12'),_0xc5e91a);this[_0xeb18('0x25')](_0xeb18('0x28'));}};module[_0xeb18('0x3c')]=EmailImap; \ No newline at end of file +var _0xee24=['error','connect','inherits','connTimeout','authTimeout','isNil','service','user','password','host','port','tls','autotls','getHost','email','anonymous@xcally.com','prototype','openBox','handleOpenBox','handleError','emit','box','readUnseen','end','search','UNSEEN','length','message','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','handleCloseBox','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','stringify','textCode','hasOwnProperty','upperFirst','util','imap','randomstring','mailparser','simpleParser','iconv','events','EventEmitter','./utils','../../../config/logger','mailbox','INBOX','account','getAccount','ready','handleReady','bind','once','handleEnd'];(function(_0x2be385,_0x428ea9){var _0x288d5c=function(_0x213e6b){while(--_0x213e6b){_0x2be385['push'](_0x2be385['shift']());}};_0x288d5c(++_0x428ea9);}(_0xee24,0x1a6));var _0x4ee2=function(_0x103ac4,_0x137d0c){_0x103ac4=_0x103ac4-0x0;var _0x39d4c0=_0xee24[_0x103ac4];return _0x39d4c0;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0x4ee2('0x0'));var Imap=require(_0x4ee2('0x1'));var _=require('lodash');var rs=require(_0x4ee2('0x2'));var simpleParser=require(_0x4ee2('0x3'))[_0x4ee2('0x4')];var Iconv=require(_0x4ee2('0x5'))['Iconv'];var EventEmitter=require(_0x4ee2('0x6'))[_0x4ee2('0x7')];var utils=require(_0x4ee2('0x8'));var logger=require(_0x4ee2('0x9'))('email');function EmailImap(_0x2e6e11,_0x319d9d){this[_0x4ee2('0xa')]=_0x4ee2('0xb');this[_0x4ee2('0xc')]=this[_0x4ee2('0xd')](_0x2e6e11,_0x319d9d);this[_0x4ee2('0x1')]=new Imap(this[_0x4ee2('0xc')]);this['imap']['once'](_0x4ee2('0xe'),this[_0x4ee2('0xf')][_0x4ee2('0x10')](this));this[_0x4ee2('0x1')][_0x4ee2('0x11')]('end',this[_0x4ee2('0x12')][_0x4ee2('0x10')](this));this[_0x4ee2('0x1')]['on'](_0x4ee2('0x13'),this['handleError'][_0x4ee2('0x10')](this));this[_0x4ee2('0x1')][_0x4ee2('0x14')]();}util[_0x4ee2('0x15')](EmailImap,EventEmitter);EmailImap['prototype']['getAccount']=function(_0x2357c5,_0x2bf4c2){var _0x5a3c5c={'connTimeout':_0x2357c5[_0x4ee2('0x16')]?_0x2357c5[_0x4ee2('0x16')]*0x3e8:0x2710,'authTimeout':_0x2357c5[_0x4ee2('0x17')]?_0x2357c5[_0x4ee2('0x17')]*0x3e8:0x1388};if(_[_0x4ee2('0x18')](_0x2357c5[_0x4ee2('0x19')])){if(_0x2357c5['authentication']){_0x5a3c5c[_0x4ee2('0x1a')]=_0x2357c5[_0x4ee2('0x1a')];_0x5a3c5c[_0x4ee2('0x1b')]=_0x2357c5['password'];}_0x5a3c5c[_0x4ee2('0x1c')]=_0x2357c5[_0x4ee2('0x1c')];_0x5a3c5c[_0x4ee2('0x1d')]=_0x2357c5[_0x4ee2('0x1d')]||0x3e1;if(_0x2357c5[_0x4ee2('0x1e')]){_0x5a3c5c[_0x4ee2('0x1e')]=!![];}else{_0x5a3c5c[_0x4ee2('0x1e')]=![];_0x5a3c5c[_0x4ee2('0x1f')]='required';}}else{_0x5a3c5c['user']=_0x2357c5[_0x4ee2('0x1a')];_0x5a3c5c['password']=_0x2357c5[_0x4ee2('0x1b')];_0x5a3c5c[_0x4ee2('0x1c')]=utils[_0x4ee2('0x20')](_0x2357c5[_0x4ee2('0x19')]);_0x5a3c5c[_0x4ee2('0x1d')]=0x3e1;_0x5a3c5c['tls']=!![];}_0x5a3c5c[_0x4ee2('0x21')]=_0x2bf4c2||_0x2357c5['user']||_0x4ee2('0x22');return _0x5a3c5c;};EmailImap[_0x4ee2('0x23')][_0x4ee2('0xf')]=function(){this[_0x4ee2('0x1')][_0x4ee2('0x24')](this[_0x4ee2('0xa')],![],this[_0x4ee2('0x25')]['bind'](this));};EmailImap[_0x4ee2('0x23')]['handleOpenBox']=function(_0x58f27e,_0xebd95f){if(_0x58f27e){this[_0x4ee2('0x26')](_0x58f27e,!![]);}else{this[_0x4ee2('0x27')](_0x4ee2('0x28'),_0xebd95f);this[_0x4ee2('0x29')]();}};EmailImap['prototype']['handleCloseBox']=function(_0x404fba){if(_0x404fba){this[_0x4ee2('0x26')](_0x404fba,!![]);}else{this['imap'][_0x4ee2('0x2a')]();}};EmailImap['prototype']['readUnseen']=function(){this['imap'][_0x4ee2('0x2b')]([_0x4ee2('0x2c')],this['handleReadUnseen'][_0x4ee2('0x10')](this));};EmailImap[_0x4ee2('0x23')]['handleReadUnseen']=function(_0xc7df80,_0x4bf072){if(_0xc7df80){this[_0x4ee2('0x26')](_0xc7df80,!![]);}else{if(_0x4bf072[_0x4ee2('0x2d')]){try{var _0x1fea65=this['imap']['fetch'](_0x4bf072,{'bodies':'','markSeen':!![]});_0x1fea65['on'](_0x4ee2('0x2e'),this[_0x4ee2('0x2f')][_0x4ee2('0x10')](this));_0x1fea65['once'](_0x4ee2('0x13'),this[_0x4ee2('0x30')][_0x4ee2('0x10')](this));_0x1fea65[_0x4ee2('0x11')](_0x4ee2('0x2a'),this[_0x4ee2('0x31')][_0x4ee2('0x10')](this));}catch(_0x250fc7){logger[_0x4ee2('0x13')](_0x250fc7);}}else{this[_0x4ee2('0x1')][_0x4ee2('0x32')](!![],this[_0x4ee2('0x33')]['bind'](this));}}};EmailImap[_0x4ee2('0x23')][_0x4ee2('0x2f')]=function(_0x5c4ab7,_0x16ea20){_0x5c4ab7['on'](_0x4ee2('0x34'),this[_0x4ee2('0x35')][_0x4ee2('0x10')](this));_0x5c4ab7[_0x4ee2('0x11')](_0x4ee2('0x36'),this[_0x4ee2('0x37')]['bind'](this));_0x5c4ab7[_0x4ee2('0x11')](_0x4ee2('0x2a'),this[_0x4ee2('0x38')]['bind'](this));};EmailImap[_0x4ee2('0x23')]['handleMessageBody']=function(_0x1079b6,_0x3f833d){simpleParser(_0x1079b6,{'Iconv':Iconv},this[_0x4ee2('0x39')][_0x4ee2('0x10')](this));};EmailImap[_0x4ee2('0x23')][_0x4ee2('0x37')]=function(_0x57850d){};EmailImap['prototype'][_0x4ee2('0x38')]=function(){};EmailImap[_0x4ee2('0x23')][_0x4ee2('0x39')]=function(_0x3f95e8,_0x264fe3){if(_0x3f95e8){logger[_0x4ee2('0x13')](_0x3f95e8);}else{var _0x938e4d=this;utils[_0x4ee2('0x3a')](this[_0x4ee2('0xc')],_0x264fe3,function(_0x11b091){_0x938e4d['emit']('email',_0x11b091);});}};EmailImap[_0x4ee2('0x23')][_0x4ee2('0x31')]=function(){this[_0x4ee2('0x1')]['closeBox'](!![],this[_0x4ee2('0x33')][_0x4ee2('0x10')](this));};EmailImap[_0x4ee2('0x23')][_0x4ee2('0x30')]=function(_0x31901e){this[_0x4ee2('0x26')](_0x31901e);this[_0x4ee2('0x1')][_0x4ee2('0x32')](!![],this[_0x4ee2('0x33')][_0x4ee2('0x10')](this));};EmailImap['prototype']['handleEnd']=function(){this[_0x4ee2('0x27')](_0x4ee2('0x2a'));};EmailImap[_0x4ee2('0x23')]['handleError']=function(_0x1ef1d5,_0x56fd09){logger[_0x4ee2('0x13')]('handleError',this[_0x4ee2('0xc')][_0x4ee2('0x21')],JSON[_0x4ee2('0x3b')](_0x1ef1d5));var _0x5bc5f3='';if(_0x1ef1d5){if(_0x1ef1d5[_0x4ee2('0x3c')]){_0x5bc5f3=_0x1ef1d5['textCode'];}else{for(var _0x29bca3 in _0x1ef1d5){if(_0x1ef1d5[_0x4ee2('0x3d')](_0x29bca3)){_0x5bc5f3+=_[_0x4ee2('0x3e')](_0x29bca3)+':\x20'+_0x1ef1d5[_0x29bca3]+'\x0a';}}}}if(_0x56fd09){this[_0x4ee2('0x1')]['end']();}else{this[_0x4ee2('0x27')](_0x4ee2('0x13'),_0x5bc5f3);this['emit'](_0x4ee2('0x2a'));}};module['exports']=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index d82984b..afe8964 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 _0xcf2b=['createTransport','exports','bluebird','nodemailer-plugin-inline-base64','send','compile','sendMail','toString','prototype','verify'];(function(_0x437d7f,_0x1feb46){var _0x31058c=function(_0x49dd1a){while(--_0x49dd1a){_0x437d7f['push'](_0x437d7f['shift']());}};_0x31058c(++_0x1feb46);}(_0xcf2b,0x156));var _0xbcf2=function(_0x291d3f,_0x3ef99f){_0x291d3f=_0x291d3f-0x0;var _0x242080=_0xcf2b[_0x291d3f];return _0x242080;};'use strict';var nodemailer=require('nodemailer');var BPromise=require(_0xbcf2('0x0'));var inlineBase64=require(_0xbcf2('0x1'));function EmailSmtp(){}EmailSmtp['prototype'][_0xbcf2('0x2')]=function(_0x5dbb27,_0x495f5a){return new BPromise(function(_0x594dee,_0x53eb75){var _0x23f683=nodemailer['createTransport'](_0x5dbb27);_0x23f683['use'](_0xbcf2('0x3'),inlineBase64());_0x23f683[_0xbcf2('0x4')](_0x495f5a,function(_0x49df6e,_0x1a2447){if(_0x49df6e){_0x53eb75(_0x49df6e[_0xbcf2('0x5')]());}else{_0x594dee(_0x1a2447);}});});};EmailSmtp[_0xbcf2('0x6')][_0xbcf2('0x7')]=function(_0x25b352){return new BPromise(function(_0x80deff,_0x9bd5c7){var _0x23bd87=nodemailer[_0xbcf2('0x8')](_0x25b352);_0x23bd87[_0xbcf2('0x7')](function(_0x4245a0,_0x12c7f6){if(_0x4245a0){_0x9bd5c7(_0x4245a0['toString']());}else{if(_0x12c7f6){_0x80deff(_0x12c7f6);}else{_0x9bd5c7('Not\x20verifired');}}});});};module[_0xbcf2('0x9')]=EmailSmtp; \ No newline at end of file +var _0xc623=['prototype','send','createTransport','use','compile','sendMail','verify','toString','Not\x20verifired','exports','nodemailer','bluebird'];(function(_0x1139dd,_0x2251a3){var _0x4d831d=function(_0x2c2a26){while(--_0x2c2a26){_0x1139dd['push'](_0x1139dd['shift']());}};_0x4d831d(++_0x2251a3);}(_0xc623,0xbe));var _0x3c62=function(_0x1cbe8c,_0x43762a){_0x1cbe8c=_0x1cbe8c-0x0;var _0x2902d8=_0xc623[_0x1cbe8c];return _0x2902d8;};'use strict';var nodemailer=require(_0x3c62('0x0'));var BPromise=require(_0x3c62('0x1'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0x3c62('0x2')][_0x3c62('0x3')]=function(_0x3b4f08,_0x375888){return new BPromise(function(_0x172892,_0x59edad){var _0x4e3548=nodemailer[_0x3c62('0x4')](_0x3b4f08);_0x4e3548[_0x3c62('0x5')](_0x3c62('0x6'),inlineBase64());_0x4e3548[_0x3c62('0x7')](_0x375888,function(_0x12fa4a,_0x351155){if(_0x12fa4a){_0x59edad(_0x12fa4a['toString']());}else{_0x172892(_0x351155);}});});};EmailSmtp[_0x3c62('0x2')][_0x3c62('0x8')]=function(_0x1c29d0){return new BPromise(function(_0x55571d,_0x542c32){var _0x438cb4=nodemailer[_0x3c62('0x4')](_0x1c29d0);_0x438cb4['verify'](function(_0x3624f3,_0x1b268e){if(_0x3624f3){_0x542c32(_0x3624f3[_0x3c62('0x9')]());}else{if(_0x1b268e){_0x55571d(_0x1b268e);}else{_0x542c32(_0x3c62('0xa'));}}});});};module[_0x3c62('0xb')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 2e07016..4b847e2 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 _0x5fdc=['attachment-','format','now','server/files/attachments/','writeFileSync','content','contentType','parser','from','subject','messageId','textAsHtml','application/ms-tnef','info','first','BodyHTML','Attachments','push','Title','Data','

Empty\x20message

','getHost','yahoo','imap.mail.yahoo.com','hotmail','outlook365','127.0.0.1','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','value','address','name','split','length','slice','join','pop','anonymous','@xcally.com','html','test','includes','\x20[Attachment:\x20','\x20]','body','0x1?_0x3fa7c4[_0xc5fd('0x11')]():'';}return'';}function getMails(_0xa7a954,_0x51233a){var _0x124651='';for(var _0x103c3d=0x0;_0x103c3d<_0x51233a[_0xc5fd('0xa')][_0xc5fd('0xe')];_0x103c3d+=0x1){if(_0x51233a['value'][_0x103c3d]['address']!==_0xa7a954){if(!_['isEmpty'](_0x124651)){_0x124651+=',';}_0x124651+=_0x51233a['value'][_0x103c3d]['name']||_0x51233a[_0xc5fd('0xa')][_0x103c3d][_0xc5fd('0xb')]||'';_0x124651+='\x20<';_0x124651+=_0x51233a[_0xc5fd('0xa')][_0x103c3d][_0xc5fd('0xb')]?_0x51233a[_0xc5fd('0xa')][_0x103c3d][_0xc5fd('0xb')]:_0xc5fd('0x12')+random['generate'](0x6)+_0xc5fd('0x13');_0x124651+='>';}}return _0x124651;}function parseEmail(_0x27bda1,_0x32eac2,_0x9c12e4){if(_0x32eac2[_0xc5fd('0x14')]){var _0x48024e=/)<[^<]*)*<\/script>/gi;while(_0x48024e[_0xc5fd('0x15')](_0x32eac2[_0xc5fd('0x14')])){_0x32eac2[_0xc5fd('0x14')]=_0x32eac2[_0xc5fd('0x14')]['replace'](_0x48024e,'');}if(_0x32eac2['html'][_0xc5fd('0x16')](_0xc5fd('0x17'))){var _0x3d7211=[];_0x32eac2[_0xc5fd('0x18')][_0xc5fd('0x19')](_0x311952=>{_0x3d7211['push'](_0x311952[_0xc5fd('0x1a')]);});var _0x2701f7=/]+>/g;var _0x1a5174=/src=\"data:image\/([a-zA-Z]*);base64,([^\"]*)\"/g;var _0x18c9c7=_0x32eac2[_0xc5fd('0x14')][_0xc5fd('0x1b')](_0x1a5174,_0xc5fd('0x1c'));var _0x527018=_0x18c9c7[_0xc5fd('0x1b')](_0x2701f7,'_IMG');for(let _0x2ee700=0x0;_0x2ee700<_0x3d7211[_0xc5fd('0xe')];_0x2ee700++){var _0x44681d=_0x527018[_0xc5fd('0x1b')]('_IMG',_0xc5fd('0x1d')+_0x3d7211[_0x2ee700]+_0xc5fd('0x1e'));_0x527018=_0x44681d;}_0x32eac2[_0xc5fd('0x14')]=_0x527018;}_0x9c12e4[_0xc5fd('0x1f')]=_0x32eac2[_0xc5fd('0x14')];}else{_0x9c12e4[_0xc5fd('0x1f')]=_0x32eac2['textAsHtml'];}if(_0x9c12e4[_0xc5fd('0x1f')]){_0x9c12e4['body']=_0x9c12e4['body'][_0xc5fd('0x1b')](/Empty\x20message

';if(_0x2b98a9[_0xc5fd('0x38')]){for(var _0x74a071=0x0;_0x74a071<_0x2b98a9['Attachments']['length'];_0x74a071++){var _0x3b7cf1=_0x2b98a9['Attachments'][_0x74a071];_0x47fe66['message']['attachments'][_0xc5fd('0x39')]({'filename':_0x3b7cf1[_0xc5fd('0x3a')],'content':new Buffer(_0x3b7cf1[_0xc5fd('0x3b')])});}}}_0x559ec4(parseEmail(_0x2a368e,_0x5d3fce,_0x47fe66));});}else{_0x5d3fce[_0xc5fd('0x14')]=_0xc5fd('0x3c');_0x559ec4(parseEmail(_0x2a368e,_0x5d3fce,_0x47fe66));}}else{_0x559ec4(parseEmail(_0x2a368e,_0x5d3fce,_0x47fe66));}};exports[_0xc5fd('0x3d')]=function(_0x480011){switch(_0x480011){case'gmail':return'imap.gmail.com';case _0xc5fd('0x3e'):return _0xc5fd('0x3f');case _0xc5fd('0x40'):return'imap-mail.outlook.com';case _0xc5fd('0x41'):return'outlook.office365.com';}return _0xc5fd('0x42');}; \ No newline at end of file +var _0xd914=['filename','replace','_SRC','_IMG','\x20[Attachment:\x20','body','message','originTo','includes','originCc','bcc','attach','type','attachment','format','%s-%s','join','root','server/files/attachments/','writeFileSync','content','contentType','from','subject','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','textAsHtml','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','messageId','parseBuffer','BodyHTML','

Empty\x20message

','Attachments','Title','getHost','imap.gmail.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','127.0.0.1','lodash','moment','path','util','node-tnef','../../../config/logger','email','../../../config/environment','value','address','anonymous','generate','@xcally.com','name','split','length','Anonymous','head','pop','isEmpty','html','test','attachments','forEach','push'];(function(_0x3e91a9,_0x53c466){var _0x25c9ad=function(_0x69ee2d){while(--_0x69ee2d){_0x3e91a9['push'](_0x3e91a9['shift']());}};_0x25c9ad(++_0x53c466);}(_0xd914,0x17f));var _0x4d91=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xd914[_0x4709c0];return _0x13348b;};'use strict';var _=require(_0x4d91('0x0'));var moment=require(_0x4d91('0x1'));var random=require('randomstring');var fs=require('fs');var path=require(_0x4d91('0x2'));var util=require(_0x4d91('0x3'));var tnef=require(_0x4d91('0x4'));var logger=require(_0x4d91('0x5'))(_0x4d91('0x6'));var config=require(_0x4d91('0x7'));function getAddress(_0x4875a2){var _0x1b256e=_['head'](_0x4875a2[_0x4d91('0x8')]);return _0x1b256e&&_0x1b256e[_0x4d91('0x9')]?_0x1b256e[_0x4d91('0x9')]:_0x4d91('0xa')+random[_0x4d91('0xb')](0x6)+_0x4d91('0xc');}function getFirstName(_0x3016c0){var _0x2a3ca1=_['head'](_0x3016c0[_0x4d91('0x8')]);if(_0x2a3ca1&&_0x2a3ca1[_0x4d91('0xd')]){var _0xc07c64=_0x2a3ca1[_0x4d91('0xd')][_0x4d91('0xe')](/\s+/);return _0xc07c64[_0x4d91('0xf')]?_0xc07c64['slice'](0x0,-0x1)['join']('\x20'):_0x2a3ca1[_0x4d91('0xd')];}return _0x4d91('0x10');}function getLastName(_0x9d9542){var _0x370e78=_[_0x4d91('0x11')](_0x9d9542[_0x4d91('0x8')]);if(_0x370e78&&_0x370e78['name']){var _0x577a69=_0x370e78[_0x4d91('0xd')][_0x4d91('0xe')](/\s+/);return _0x577a69[_0x4d91('0xf')]>0x1?_0x577a69[_0x4d91('0x12')]():'';}return'';}function getMails(_0x33fbd4,_0x25bafc){var _0x36f606='';for(var _0x4f5aef=0x0;_0x4f5aef<_0x25bafc[_0x4d91('0x8')][_0x4d91('0xf')];_0x4f5aef+=0x1){if(_0x25bafc[_0x4d91('0x8')][_0x4f5aef][_0x4d91('0x9')]!==_0x33fbd4){if(!_[_0x4d91('0x13')](_0x36f606)){_0x36f606+=',';}_0x36f606+=_0x25bafc['value'][_0x4f5aef][_0x4d91('0xd')]||_0x25bafc[_0x4d91('0x8')][_0x4f5aef][_0x4d91('0x9')]||'';_0x36f606+='\x20<';_0x36f606+=_0x25bafc[_0x4d91('0x8')][_0x4f5aef]['address']?_0x25bafc[_0x4d91('0x8')][_0x4f5aef][_0x4d91('0x9')]:_0x4d91('0xa')+random['generate'](0x6)+_0x4d91('0xc');_0x36f606+='>';}}return _0x36f606;}function parseEmail(_0x127911,_0x351388,_0xd59fe){if(_0x351388[_0x4d91('0x14')]){var _0x40cde4=/)<[^<]*)*<\/script>/gi;while(_0x40cde4[_0x4d91('0x15')](_0x351388[_0x4d91('0x14')])){_0x351388[_0x4d91('0x14')]=_0x351388[_0x4d91('0x14')]['replace'](_0x40cde4,'');}if(_0x351388[_0x4d91('0x14')]['includes']('{_0x74a697[_0x4d91('0x18')](_0x9cb864[_0x4d91('0x19')]);});var _0x100cd4=/]+>/g;var _0x123606=/src=\"data:image\/([a-zA-Z]*);base64,([^\"]*)\"/g;var _0x55356b=_0x351388['html'][_0x4d91('0x1a')](_0x123606,_0x4d91('0x1b'));var _0x3bed98=_0x55356b[_0x4d91('0x1a')](_0x100cd4,_0x4d91('0x1c'));for(let _0x2c7d7a=0x0;_0x2c7d7a<_0x74a697[_0x4d91('0xf')];_0x2c7d7a++){var _0x560966=_0x3bed98[_0x4d91('0x1a')](_0x4d91('0x1c'),_0x4d91('0x1d')+_0x74a697[_0x2c7d7a]+'\x20]');_0x3bed98=_0x560966;}_0x351388['html']=_0x3bed98;}_0xd59fe[_0x4d91('0x1e')]=_0x351388[_0x4d91('0x14')];}else{_0xd59fe['body']=_0x351388['textAsHtml'];}if(_0xd59fe[_0x4d91('0x1e')]){_0xd59fe[_0x4d91('0x1e')]=_0xd59fe[_0x4d91('0x1e')][_0x4d91('0x1a')](/0x0){if(this[_0x403a50+'Capacity']>0x0&&this[_0x403a50+_0x1597('0x27')]>=this[_0x403a50+_0x1597('0x28')]){return'maxcapacity';}else{return _0x1597('0x29');}}else{return'idle';}};Agent[_0x1597('0x2a')]['updateRealtime']=function(){var _0x3a250d=[_0x1597('0x2b'),_0x1597('0x2c'),'openchannel','fax',_0x1597('0x2d'),_0x1597('0x2e')];for(var _0xeb33aa=0x0;_0xeb33aa<_0x3a250d[_0x1597('0x2f')];_0xeb33aa+=0x1){var _0x107c68=this[_0x1597('0x26')](_0x3a250d[_0xeb33aa]);if(this[_0x3a250d[_0xeb33aa]+_0x1597('0x30')]!==_0x107c68){this[_0x3a250d[_0xeb33aa]+'StatusTime']=_[_0x1597('0x31')](moment()[_0x1597('0x32')]('x'));}this[_0x3a250d[_0xeb33aa]+_0x1597('0x30')]=_0x107c68;}var _0x38fcba={'id':this['id'],'name':this[_0x1597('0x7')],'online':this[_0x1597('0x8')],'voicePause':this[_0x1597('0x9')],'chatPause':this['chatPause'],'mailPause':this[_0x1597('0xb')],'smsPause':this['smsPause'],'faxPause':this[_0x1597('0xc')],'openchannelPause':this[_0x1597('0xe')],'chatStatus':this[_0x1597('0xf')],'chatStatusTime':this[_0x1597('0x11')],'chatCapacity':this[_0x1597('0x12')],'chatCurrentCapacity':this[_0x1597('0x13')],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0x1597('0x15')],'mailCapacity':this[_0x1597('0x16')],'mailCurrentCapacity':this[_0x1597('0x17')],'faxStatus':this[_0x1597('0x18')],'faxStatusTime':this[_0x1597('0x19')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0x1597('0x33')],'smsStatus':this[_0x1597('0x1b')],'smsStatusTime':this[_0x1597('0x34')],'smsCapacity':this[_0x1597('0x1c')],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this[_0x1597('0x1e')],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this[_0x1597('0x1f')],'whatsappCurrentCapacity':this[_0x1597('0x20')],'openchannelStatus':this[_0x1597('0x21')],'openchannelStatusTime':this[_0x1597('0x35')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this[_0x1597('0x24')],'busyQueue':this['busyQueue']};var _0x2f5e08=md5(JSON[_0x1597('0x36')](_0x38fcba));if(this[_0x1597('0x0')]!==_0x2f5e08){this[_0x1597('0x0')]=_0x2f5e08;io['emit'](_0x1597('0x37'),_0x38fcba);}};module['exports']=Agent; \ No newline at end of file +var _0xa67e=['mailStatus','mailStatusTime','mailCapacity','faxStatusTime','faxCapacity','smsStatusTime','smsCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','busy','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','updateRealtime','chat','openchannel','fax','whatsapp','length','Status','StatusTime','toNumber','chatStatusTime','faxStatus','faxCurrentCapacity','smsStatus','smsCurrentCapacity','whatsappCurrentCapacity','openchannelCurrentCapacity','busyQueue','stringify','emit','user:save','exports','lodash','moment','md5','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatCapacity','chatCurrentCapacity'];(function(_0xf57a29,_0x11287b){var _0x40d12a=function(_0x26b57d){while(--_0x26b57d){_0xf57a29['push'](_0xf57a29['shift']());}};_0x40d12a(++_0x11287b);}(_0xa67e,0x19d));var _0xea67=function(_0x469149,_0x449071){_0x469149=_0x469149-0x0;var _0x341823=_0xa67e[_0x469149];return _0x341823;};'use strict';var _=require(_0xea67('0x0'));var moment=require(_0xea67('0x1'));var md5=require(_0xea67('0x2'));var Redis=require(_0xea67('0x3'));var config=require(_0xea67('0x4'));config['redis']=_[_0xea67('0x5')](config[_0xea67('0x6')],{'host':_0xea67('0x7'),'port':0x18eb});var io=require(_0xea67('0x8'))(new Redis(config[_0xea67('0x6')]));function Agent(_0x37d49e){this['id']=_0x37d49e['id']||0x0;this[_0xea67('0x9')]=_0x37d49e[_0xea67('0x9')]||'';this[_0xea67('0xa')]=_0x37d49e['online']||!![];this[_0xea67('0xb')]=_0x37d49e[_0xea67('0xb')]||![];this[_0xea67('0xc')]=_0x37d49e[_0xea67('0xc')]||![];this[_0xea67('0xd')]=_0x37d49e[_0xea67('0xd')]||![];this['faxPause']=_0x37d49e[_0xea67('0xe')]||![];this[_0xea67('0xf')]=_0x37d49e['smsPause']||![];this[_0xea67('0x10')]=_0x37d49e[_0xea67('0x10')]||![];this[_0xea67('0x11')]=_0xea67('0x12');this['chatStatusTime']=0x0;this[_0xea67('0x13')]=_0x37d49e[_0xea67('0x13')]||0x0;this[_0xea67('0x14')]=0x0;this[_0xea67('0x15')]=_0xea67('0x12');this[_0xea67('0x16')]=0x0;this[_0xea67('0x17')]=_0x37d49e[_0xea67('0x17')]||0x0;this['mailCurrentCapacity']=0x0;this['faxStatus']='unknown';this[_0xea67('0x18')]=0x0;this[_0xea67('0x19')]=_0x37d49e[_0xea67('0x19')]||0x0;this['faxCurrentCapacity']=0x0;this['smsStatus']=_0xea67('0x12');this[_0xea67('0x1a')]=0x0;this[_0xea67('0x1b')]=_0x37d49e[_0xea67('0x1b')]||0x0;this['smsCurrentCapacity']=0x0;this[_0xea67('0x1c')]='unknown';this[_0xea67('0x1d')]=0x0;this[_0xea67('0x1e')]=_0x37d49e['whatsappCapacity']||0x0;this['whatsappCurrentCapacity']=0x0;this[_0xea67('0x1f')]=_0xea67('0x12');this[_0xea67('0x20')]=0x0;this[_0xea67('0x21')]=_0x37d49e[_0xea67('0x21')]||0x0;this['openchannelCurrentCapacity']=0x0;this[_0xea67('0x22')]=![];this['busyQueue']=undefined;this[_0xea67('0x2')]='';this['updateRealtime']();}Agent[_0xea67('0x23')][_0xea67('0x24')]=function(_0x40fa0d){if(this[_0x40fa0d+_0xea67('0x25')]>0x0){if(this[_0x40fa0d+_0xea67('0x26')]>0x0&&this[_0x40fa0d+_0xea67('0x25')]>=this[_0x40fa0d+'Capacity']){return _0xea67('0x27');}else{return _0xea67('0x28');}}else{return'idle';}};Agent[_0xea67('0x23')][_0xea67('0x29')]=function(){var _0x3bc164=['mail',_0xea67('0x2a'),_0xea67('0x2b'),_0xea67('0x2c'),'sms',_0xea67('0x2d')];for(var _0x4506f0=0x0;_0x4506f0<_0x3bc164[_0xea67('0x2e')];_0x4506f0+=0x1){var _0x5932a4=this[_0xea67('0x24')](_0x3bc164[_0x4506f0]);if(this[_0x3bc164[_0x4506f0]+_0xea67('0x2f')]!==_0x5932a4){this[_0x3bc164[_0x4506f0]+_0xea67('0x30')]=_[_0xea67('0x31')](moment()['format']('x'));}this[_0x3bc164[_0x4506f0]+'Status']=_0x5932a4;}var _0x5aa085={'id':this['id'],'name':this['name'],'online':this[_0xea67('0xa')],'voicePause':this[_0xea67('0xb')],'chatPause':this[_0xea67('0xc')],'mailPause':this[_0xea67('0xd')],'smsPause':this[_0xea67('0xf')],'faxPause':this[_0xea67('0xe')],'openchannelPause':this[_0xea67('0x10')],'chatStatus':this['chatStatus'],'chatStatusTime':this[_0xea67('0x32')],'chatCapacity':this[_0xea67('0x13')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0xea67('0x15')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0xea67('0x17')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0xea67('0x33')],'faxStatusTime':this[_0xea67('0x18')],'faxCapacity':this[_0xea67('0x19')],'faxCurrentCapacity':this[_0xea67('0x34')],'smsStatus':this[_0xea67('0x35')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0xea67('0x1b')],'smsCurrentCapacity':this[_0xea67('0x36')],'whatsappStatus':this[_0xea67('0x1c')],'whatsappStatusTime':this[_0xea67('0x1d')],'whatsappCapacity':this[_0xea67('0x1e')],'whatsappCurrentCapacity':this[_0xea67('0x37')],'openchannelStatus':this[_0xea67('0x1f')],'openchannelStatusTime':this[_0xea67('0x20')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0xea67('0x38')],'busy':this[_0xea67('0x22')],'busyQueue':this[_0xea67('0x39')]};var _0x4c42c7=md5(JSON[_0xea67('0x3a')](_0x5aa085));if(this['md5']!==_0x4c42c7){this[_0xea67('0x2')]=_0x4c42c7;io[_0xea67('0x3b')](_0xea67('0x3c'),_0x5aa085);}};module[_0xea67('0x3d')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index ef126c1..bb8d53e 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 _0x1ecc=['redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','available','waiting','stringify','emit','chat_queue:save','md5','util','ioredis','../../../config/environment'];(function(_0x40bffc,_0x3a45d7){var _0x3007e9=function(_0x4c8fda){while(--_0x4c8fda){_0x40bffc['push'](_0x40bffc['shift']());}};_0x3007e9(++_0x3a45d7);}(_0x1ecc,0x1bc));var _0xc1ec=function(_0x46ae5a,_0x2a38d0){_0x46ae5a=_0x46ae5a-0x0;var _0x434986=_0x1ecc[_0x46ae5a];return _0x434986;};'use strict';var _=require('lodash');var md5=require(_0xc1ec('0x0'));var util=require(_0xc1ec('0x1'));var Redis=require(_0xc1ec('0x2'));var config=require(_0xc1ec('0x3'));config[_0xc1ec('0x4')]=_[_0xc1ec('0x5')](config[_0xc1ec('0x4')],{'host':_0xc1ec('0x6'),'port':0x18eb});var io=require(_0xc1ec('0x7'))(new Redis(config[_0xc1ec('0x4')]));function ChatQueue(_0xd56760){this['id']=_0xd56760['id']||0x0;this['name']=_0xd56760[_0xc1ec('0x8')]||'';this['timeout']=_0xd56760[_0xc1ec('0x9')]||0xa;this[_0xc1ec('0xa')]=_0xd56760[_0xc1ec('0xa')]||_0xc1ec('0xb');this[_0xc1ec('0xc')]=_0xd56760[_0xc1ec('0xc')];this[_0xc1ec('0xd')]={};this['waiting']=0x0;this['md5']='';this[_0xc1ec('0xe')]();this[_0xc1ec('0xf')]();}ChatQueue[_0xc1ec('0x10')][_0xc1ec('0xe')]=function(){var _0x471eec=this['mapAgentsId'][_0xc1ec('0x11')];this['mapAgentsId']=_[_0xc1ec('0x12')](this['Agents'],'id');this[_0xc1ec('0xd')][_0xc1ec('0x11')]=_0x471eec;};ChatQueue[_0xc1ec('0x10')][_0xc1ec('0xf')]=function(){this[_0xc1ec('0x13')]=0x0;this[_0xc1ec('0x14')]=0x0;for(var _0x12f1ec=0x0;_0x12f1ec=0x0?this['available']:0x0;var _0x459603={'id':this['id'],'available':this[_0xc1ec('0x17')],'loggedIn':this[_0xc1ec('0x13')],'name':this[_0xc1ec('0x8')],'paused':this[_0xc1ec('0x14')],'waiting':this[_0xc1ec('0x18')]};var _0x228304=md5(JSON[_0xc1ec('0x19')](_0x459603));if(this[_0xc1ec('0x0')]!==_0x228304){this[_0xc1ec('0x0')]=_0x228304;io['to'](util['format']('chat:queue:%s',_0x459603['name']))[_0xc1ec('0x1a')](_0xc1ec('0x1b'),_0x459603);}};module['exports']=ChatQueue; \ No newline at end of file +var _0x30b3=['defaults','redis','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','prototype','_rr','map','updateRealtime','paused','length','loggedIn','chatPause','available','stringify','format','chat:queue:%s','emit','chat_queue:save','exports','md5','util','../../../config/environment'];(function(_0x3a3984,_0x4501b2){var _0x57d250=function(_0x530205){while(--_0x530205){_0x3a3984['push'](_0x3a3984['shift']());}};_0x57d250(++_0x4501b2);}(_0x30b3,0x13c));var _0x330b=function(_0x48d1d4,_0xd24262){_0x48d1d4=_0x48d1d4-0x0;var _0x50521d=_0x30b3[_0x48d1d4];return _0x50521d;};'use strict';var _=require('lodash');var md5=require(_0x330b('0x0'));var util=require(_0x330b('0x1'));var Redis=require('ioredis');var config=require(_0x330b('0x2'));config['redis']=_[_0x330b('0x3')](config[_0x330b('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x330b('0x5'))(new Redis(config[_0x330b('0x4')]));function ChatQueue(_0x582848){this['id']=_0x582848['id']||0x0;this[_0x330b('0x6')]=_0x582848[_0x330b('0x6')]||'';this['timeout']=_0x582848[_0x330b('0x7')]||0xa;this[_0x330b('0x8')]=_0x582848[_0x330b('0x8')]||_0x330b('0x9');this[_0x330b('0xa')]=_0x582848[_0x330b('0xa')];this[_0x330b('0xb')]={};this[_0x330b('0xc')]=0x0;this[_0x330b('0x0')]='';this[_0x330b('0xd')]();this['updateRealtime']();}ChatQueue[_0x330b('0xe')][_0x330b('0xd')]=function(){var _0x452bd7=this['mapAgentsId'][_0x330b('0xf')];this[_0x330b('0xb')]=_[_0x330b('0x10')](this['Agents'],'id');this[_0x330b('0xb')][_0x330b('0xf')]=_0x452bd7;};ChatQueue[_0x330b('0xe')][_0x330b('0x11')]=function(){this['loggedIn']=0x0;this[_0x330b('0x12')]=0x0;for(var _0x6a735d=0x0;_0x6a735d=0x0?this['available']:0x0;var _0x5ac452={'id':this['id'],'available':this[_0x330b('0x16')],'loggedIn':this[_0x330b('0x14')],'name':this[_0x330b('0x6')],'paused':this[_0x330b('0x12')],'waiting':this[_0x330b('0xc')]};var _0x43b27c=md5(JSON[_0x330b('0x17')](_0x5ac452));if(this[_0x330b('0x0')]!==_0x43b27c){this['md5']=_0x43b27c;io['to'](util[_0x330b('0x18')](_0x330b('0x19'),_0x5ac452[_0x330b('0x6')]))[_0x330b('0x1a')](_0x330b('0x1b'),_0x5ac452);}};module[_0x330b('0x1c')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 4cc886d..e956a8e 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 _0xd4fb=['timeout','strategy','beepall','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','_rr','map','Agents','loggedIn','paused','length','online','faxPause','available','stringify','fax:queue:%s','emit','fax_queue:save','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','name'];(function(_0x49684e,_0x9a24fb){var _0x54062f=function(_0x4e410a){while(--_0x4e410a){_0x49684e['push'](_0x49684e['shift']());}};_0x54062f(++_0x9a24fb);}(_0xd4fb,0xa6));var _0xbd4f=function(_0x596731,_0x562c05){_0x596731=_0x596731-0x0;var _0xadb084=_0xd4fb[_0x596731];return _0xadb084;};'use strict';var _=require('lodash');var md5=require(_0xbd4f('0x0'));var util=require(_0xbd4f('0x1'));var Redis=require(_0xbd4f('0x2'));var config=require(_0xbd4f('0x3'));config[_0xbd4f('0x4')]=_[_0xbd4f('0x5')](config[_0xbd4f('0x4')],{'host':_0xbd4f('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xbd4f('0x4')]));function FaxQueue(_0x89469c){this['id']=_0x89469c['id']||0x0;this[_0xbd4f('0x7')]=_0x89469c[_0xbd4f('0x7')]||'';this[_0xbd4f('0x8')]=_0x89469c['timeout']||0xa;this[_0xbd4f('0x9')]=_0x89469c[_0xbd4f('0x9')]||_0xbd4f('0xa');this['Agents']=_0x89469c['Agents'];this[_0xbd4f('0xb')]={};this[_0xbd4f('0xc')]=0x0;this[_0xbd4f('0x0')]='';this['updateRouting']();this[_0xbd4f('0xd')]();}FaxQueue[_0xbd4f('0xe')][_0xbd4f('0xf')]=function(){var _0x3ba3a5=this[_0xbd4f('0xb')][_0xbd4f('0x10')];this[_0xbd4f('0xb')]=_[_0xbd4f('0x11')](this[_0xbd4f('0x12')],'id');this['mapAgentsId'][_0xbd4f('0x10')]=_0x3ba3a5;};FaxQueue[_0xbd4f('0xe')][_0xbd4f('0xd')]=function(){this[_0xbd4f('0x13')]=0x0;this[_0xbd4f('0x14')]=0x0;for(var _0x5ebe10=0x0;_0x5ebe10=0x0?this[_0xbd4f('0x18')]:0x0;var _0x1181d9={'id':this['id'],'available':this[_0xbd4f('0x18')],'loggedIn':this['loggedIn'],'name':this[_0xbd4f('0x7')],'paused':this[_0xbd4f('0x14')],'waiting':this['waiting']};var _0x21454d=md5(JSON[_0xbd4f('0x19')](_0x1181d9));if(this['md5']!==_0x21454d){this[_0xbd4f('0x0')]=_0x21454d;io['to'](util['format'](_0xbd4f('0x1a'),_0x1181d9[_0xbd4f('0x7')]))[_0xbd4f('0x1b')](_0xbd4f('0x1c'),_0x1181d9);}};module['exports']=FaxQueue; \ No newline at end of file +var _0x9128=['exports','lodash','md5','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','map','loggedIn','paused','length','online','available','stringify','format','fax:queue:%s','emit','fax_queue:save'];(function(_0x1f2f7d,_0x379c04){var _0x45841c=function(_0x31814b){while(--_0x31814b){_0x1f2f7d['push'](_0x1f2f7d['shift']());}};_0x45841c(++_0x379c04);}(_0x9128,0x1c3));var _0x8912=function(_0x31a37b,_0x826249){_0x31a37b=_0x31a37b-0x0;var _0x49ae16=_0x9128[_0x31a37b];return _0x49ae16;};'use strict';var _=require(_0x8912('0x0'));var md5=require(_0x8912('0x1'));var util=require(_0x8912('0x2'));var Redis=require('ioredis');var config=require(_0x8912('0x3'));config[_0x8912('0x4')]=_[_0x8912('0x5')](config[_0x8912('0x4')],{'host':_0x8912('0x6'),'port':0x18eb});var io=require(_0x8912('0x7'))(new Redis(config['redis']));function FaxQueue(_0x3b37ed){this['id']=_0x3b37ed['id']||0x0;this[_0x8912('0x8')]=_0x3b37ed['name']||'';this[_0x8912('0x9')]=_0x3b37ed[_0x8912('0x9')]||0xa;this['strategy']=_0x3b37ed[_0x8912('0xa')]||_0x8912('0xb');this[_0x8912('0xc')]=_0x3b37ed[_0x8912('0xc')];this[_0x8912('0xd')]={};this[_0x8912('0xe')]=0x0;this[_0x8912('0x1')]='';this[_0x8912('0xf')]();this[_0x8912('0x10')]();}FaxQueue['prototype']['updateRouting']=function(){var _0x450f48=this[_0x8912('0xd')][_0x8912('0x11')];this['mapAgentsId']=_[_0x8912('0x12')](this[_0x8912('0xc')],'id');this[_0x8912('0xd')][_0x8912('0x11')]=_0x450f48;};FaxQueue['prototype'][_0x8912('0x10')]=function(){this[_0x8912('0x13')]=0x0;this[_0x8912('0x14')]=0x0;for(var _0xd7f125=0x0;_0xd7f125=0x0?this['available']:0x0;var _0x309eb3={'id':this['id'],'available':this['available'],'loggedIn':this[_0x8912('0x13')],'name':this['name'],'paused':this[_0x8912('0x14')],'waiting':this[_0x8912('0xe')]};var _0x5fd152=md5(JSON[_0x8912('0x18')](_0x309eb3));if(this[_0x8912('0x1')]!==_0x5fd152){this[_0x8912('0x1')]=_0x5fd152;io['to'](util[_0x8912('0x19')](_0x8912('0x1a'),_0x309eb3['name']))[_0x8912('0x1b')](_0x8912('0x1c'),_0x309eb3);}};module[_0x8912('0x1d')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 3311958..06f36f3 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 _0xbf6a=['exports','name','Intervals'];(function(_0x5a7e3c,_0xdc9219){var _0x59252b=function(_0x29655c){while(--_0x29655c){_0x5a7e3c['push'](_0x5a7e3c['shift']());}};_0x59252b(++_0xdc9219);}(_0xbf6a,0x1c3));var _0xabf6=function(_0x4ac424,_0x554b5d){_0x4ac424=_0x4ac424-0x0;var _0xe1b890=_0xbf6a[_0x4ac424];return _0xe1b890;};'use strict';function Interval(_0x293aa6){this['id']=_0x293aa6['id']||0x0;this[_0xabf6('0x0')]=_0x293aa6['name']||'';this[_0xabf6('0x1')]=_0x293aa6[_0xabf6('0x1')]||{};}module[_0xabf6('0x2')]=Interval; \ No newline at end of file +var _0xc659=['Intervals','exports','name'];(function(_0x5e87bd,_0x2fc340){var _0x5599fe=function(_0x455e90){while(--_0x455e90){_0x5e87bd['push'](_0x5e87bd['shift']());}};_0x5599fe(++_0x2fc340);}(_0xc659,0x1c7));var _0x9c65=function(_0x3a49f9,_0x15418e){_0x3a49f9=_0x3a49f9-0x0;var _0x47dc01=_0xc659[_0x3a49f9];return _0x47dc01;};'use strict';function Interval(_0x42d653){this['id']=_0x42d653['id']||0x0;this[_0x9c65('0x0')]=_0x42d653[_0x9c65('0x0')]||'';this[_0x9c65('0x1')]=_0x42d653['Intervals']||{};}module[_0x9c65('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 1ccc1e4..e6e064a 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 _0x336d=['ioredis','redis','defaults','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','_rr','map','prototype','loggedIn','paused','length','online','mailPause','available','stringify','format','emit','exports','lodash','util'];(function(_0x37c22c,_0x28a70d){var _0x119d79=function(_0x243a13){while(--_0x243a13){_0x37c22c['push'](_0x37c22c['shift']());}};_0x119d79(++_0x28a70d);}(_0x336d,0xbb));var _0xd336=function(_0x11f439,_0x2ba5e1){_0x11f439=_0x11f439-0x0;var _0x59cbe6=_0x336d[_0x11f439];return _0x59cbe6;};'use strict';var _=require(_0xd336('0x0'));var md5=require('md5');var util=require(_0xd336('0x1'));var Redis=require(_0xd336('0x2'));var config=require('../../../config/environment');config[_0xd336('0x3')]=_[_0xd336('0x4')](config[_0xd336('0x3')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xd336('0x3')]));function MailQueue(_0x4954ae){this['id']=_0x4954ae['id']||0x0;this['name']=_0x4954ae[_0xd336('0x5')]||'';this[_0xd336('0x6')]=_0x4954ae[_0xd336('0x6')]||0xa;this[_0xd336('0x7')]=_0x4954ae[_0xd336('0x7')]||_0xd336('0x8');this[_0xd336('0x9')]=_0x4954ae[_0xd336('0x9')];this[_0xd336('0xa')]={};this[_0xd336('0xb')]=0x0;this[_0xd336('0xc')]='';this[_0xd336('0xd')]();this['updateRealtime']();}MailQueue['prototype'][_0xd336('0xd')]=function(){var _0x425192=this['mapAgentsId'][_0xd336('0xe')];this[_0xd336('0xa')]=_[_0xd336('0xf')](this['Agents'],'id');this['mapAgentsId'][_0xd336('0xe')]=_0x425192;};MailQueue[_0xd336('0x10')]['updateRealtime']=function(){this[_0xd336('0x11')]=0x0;this[_0xd336('0x12')]=0x0;for(var _0xb1282e=0x0;_0xb1282e=0x0?this[_0xd336('0x16')]:0x0;var _0x486da9={'id':this['id'],'available':this[_0xd336('0x16')],'loggedIn':this[_0xd336('0x11')],'name':this['name'],'paused':this[_0xd336('0x12')],'waiting':this['waiting']};var _0x1c4c9d=md5(JSON[_0xd336('0x17')](_0x486da9));if(this['md5']!==_0x1c4c9d){this[_0xd336('0xc')]=_0x1c4c9d;io['to'](util[_0xd336('0x18')]('mail:queue:%s',_0x486da9['name']))[_0xd336('0x19')]('mail_queue:save',_0x486da9);}};module[_0xd336('0x1a')]=MailQueue; \ No newline at end of file +var _0x662d=['Agents','updateRouting','updateRealtime','mapAgentsId','_rr','map','loggedIn','paused','length','online','mailPause','available','waiting','stringify','format','lodash','md5','util','ioredis','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x662d,0x1e3));var _0xd662=function(_0x4c0deb,_0x73f9e8){_0x4c0deb=_0x4c0deb-0x0;var _0x299967=_0x662d[_0x4c0deb];return _0x299967;};'use strict';var _=require(_0xd662('0x0'));var md5=require(_0xd662('0x1'));var util=require(_0xd662('0x2'));var Redis=require(_0xd662('0x3'));var config=require('../../../config/environment');config['redis']=_['defaults'](config[_0xd662('0x4')],{'host':_0xd662('0x5'),'port':0x18eb});var io=require(_0xd662('0x6'))(new Redis(config[_0xd662('0x4')]));function MailQueue(_0x561c77){this['id']=_0x561c77['id']||0x0;this[_0xd662('0x7')]=_0x561c77[_0xd662('0x7')]||'';this['timeout']=_0x561c77[_0xd662('0x8')]||0xa;this[_0xd662('0x9')]=_0x561c77['strategy']||_0xd662('0xa');this[_0xd662('0xb')]=_0x561c77[_0xd662('0xb')];this['mapAgentsId']={};this['waiting']=0x0;this[_0xd662('0x1')]='';this[_0xd662('0xc')]();this[_0xd662('0xd')]();}MailQueue['prototype'][_0xd662('0xc')]=function(){var _0x5555ba=this[_0xd662('0xe')][_0xd662('0xf')];this[_0xd662('0xe')]=_[_0xd662('0x10')](this['Agents'],'id');this['mapAgentsId'][_0xd662('0xf')]=_0x5555ba;};MailQueue['prototype']['updateRealtime']=function(){this[_0xd662('0x11')]=0x0;this[_0xd662('0x12')]=0x0;for(var _0x41952b=0x0;_0x41952b=0x0?this[_0xd662('0x16')]:0x0;var _0x5c176f={'id':this['id'],'available':this['available'],'loggedIn':this[_0xd662('0x11')],'name':this[_0xd662('0x7')],'paused':this[_0xd662('0x12')],'waiting':this[_0xd662('0x17')]};var _0x5e526f=md5(JSON[_0xd662('0x18')](_0x5c176f));if(this['md5']!==_0x5e526f){this[_0xd662('0x1')]=_0x5e526f;io['to'](util[_0xd662('0x19')]('mail:queue:%s',_0x5c176f['name']))['emit']('mail_queue:save',_0x5c176f);}};module['exports']=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index d4b70b3..687d03c 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 _0xadb5=['../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','_rr','prototype','updateRealtime','paused','loggedIn','openchannelPause','available','stringify','format','openchannel:queue:%s','emit','md5','ioredis'];(function(_0x590ef3,_0x3b2dd2){var _0x4502be=function(_0x2c8011){while(--_0x2c8011){_0x590ef3['push'](_0x590ef3['shift']());}};_0x4502be(++_0x3b2dd2);}(_0xadb5,0xad));var _0x5adb=function(_0x255801,_0x37497d){_0x255801=_0x255801-0x0;var _0x3b9526=_0xadb5[_0x255801];return _0x3b9526;};'use strict';var _=require('lodash');var md5=require(_0x5adb('0x0'));var util=require('util');var Redis=require(_0x5adb('0x1'));var config=require(_0x5adb('0x2'));config[_0x5adb('0x3')]=_['defaults'](config[_0x5adb('0x3')],{'host':_0x5adb('0x4'),'port':0x18eb});var io=require(_0x5adb('0x5'))(new Redis(config['redis']));function OpenchannelQueue(_0x35a5d3){this['id']=_0x35a5d3['id']||0x0;this[_0x5adb('0x6')]=_0x35a5d3[_0x5adb('0x6')]||'';this[_0x5adb('0x7')]=_0x35a5d3[_0x5adb('0x7')]||0xa;this[_0x5adb('0x8')]=_0x35a5d3[_0x5adb('0x8')]||_0x5adb('0x9');this[_0x5adb('0xa')]=_0x35a5d3[_0x5adb('0xa')];this[_0x5adb('0xb')]={};this[_0x5adb('0xc')]=0x0;this[_0x5adb('0x0')]='';this[_0x5adb('0xd')]();this['updateRealtime']();}OpenchannelQueue['prototype'][_0x5adb('0xd')]=function(){var _0x1ea238=this[_0x5adb('0xb')]['_rr'];this[_0x5adb('0xb')]=_['map'](this[_0x5adb('0xa')],'id');this['mapAgentsId'][_0x5adb('0xe')]=_0x1ea238;};OpenchannelQueue[_0x5adb('0xf')][_0x5adb('0x10')]=function(){this['loggedIn']=0x0;this[_0x5adb('0x11')]=0x0;for(var _0x34af2c=0x0;_0x34af2c=0x0?this['available']:0x0;var _0x3fff62={'id':this['id'],'available':this['available'],'loggedIn':this[_0x5adb('0x12')],'name':this['name'],'paused':this[_0x5adb('0x11')],'waiting':this['waiting']};var _0x5e218c=md5(JSON[_0x5adb('0x15')](_0x3fff62));if(this[_0x5adb('0x0')]!==_0x5e218c){this[_0x5adb('0x0')]=_0x5e218c;io['to'](util[_0x5adb('0x16')](_0x5adb('0x17'),_0x3fff62['name']))[_0x5adb('0x18')]('openchannel_queue:save',_0x3fff62);}};module['exports']=OpenchannelQueue; \ No newline at end of file +var _0xadb5=['../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','_rr','prototype','updateRealtime','paused','loggedIn','openchannelPause','available','stringify','format','openchannel:queue:%s','emit','md5','ioredis'];(function(_0x2952d5,_0x5a22e1){var _0x11a097=function(_0x2e7f47){while(--_0x2e7f47){_0x2952d5['push'](_0x2952d5['shift']());}};_0x11a097(++_0x5a22e1);}(_0xadb5,0xad));var _0x5adb=function(_0x2929c3,_0x39397f){_0x2929c3=_0x2929c3-0x0;var _0x36ab52=_0xadb5[_0x2929c3];return _0x36ab52;};'use strict';var _=require('lodash');var md5=require(_0x5adb('0x0'));var util=require('util');var Redis=require(_0x5adb('0x1'));var config=require(_0x5adb('0x2'));config[_0x5adb('0x3')]=_['defaults'](config[_0x5adb('0x3')],{'host':_0x5adb('0x4'),'port':0x18eb});var io=require(_0x5adb('0x5'))(new Redis(config['redis']));function OpenchannelQueue(_0x35a5d3){this['id']=_0x35a5d3['id']||0x0;this[_0x5adb('0x6')]=_0x35a5d3[_0x5adb('0x6')]||'';this[_0x5adb('0x7')]=_0x35a5d3[_0x5adb('0x7')]||0xa;this[_0x5adb('0x8')]=_0x35a5d3[_0x5adb('0x8')]||_0x5adb('0x9');this[_0x5adb('0xa')]=_0x35a5d3[_0x5adb('0xa')];this[_0x5adb('0xb')]={};this[_0x5adb('0xc')]=0x0;this[_0x5adb('0x0')]='';this[_0x5adb('0xd')]();this['updateRealtime']();}OpenchannelQueue['prototype'][_0x5adb('0xd')]=function(){var _0x1ea238=this[_0x5adb('0xb')]['_rr'];this[_0x5adb('0xb')]=_['map'](this[_0x5adb('0xa')],'id');this['mapAgentsId'][_0x5adb('0xe')]=_0x1ea238;};OpenchannelQueue[_0x5adb('0xf')][_0x5adb('0x10')]=function(){this['loggedIn']=0x0;this[_0x5adb('0x11')]=0x0;for(var _0x34af2c=0x0;_0x34af2c=0x0?this['available']:0x0;var _0x3fff62={'id':this['id'],'available':this['available'],'loggedIn':this[_0x5adb('0x12')],'name':this['name'],'paused':this[_0x5adb('0x11')],'waiting':this['waiting']};var _0x5e218c=md5(JSON[_0x5adb('0x15')](_0x3fff62));if(this[_0x5adb('0x0')]!==_0x5e218c){this[_0x5adb('0x0')]=_0x5e218c;io['to'](util[_0x5adb('0x16')](_0x5adb('0x17'),_0x3fff62['name']))[_0x5adb('0x18')]('openchannel_queue:save',_0x3fff62);}};module['exports']=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index ed06b29..1944b78 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 _0x72b1=['format','exports','lodash','util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','smsPause','available','stringify','md5'];(function(_0x15b625,_0x40b042){var _0x24fac1=function(_0xc8f408){while(--_0xc8f408){_0x15b625['push'](_0x15b625['shift']());}};_0x24fac1(++_0x40b042);}(_0x72b1,0x16e));var _0x172b=function(_0x60ea4a,_0x191ebd){_0x60ea4a=_0x60ea4a-0x0;var _0x139162=_0x72b1[_0x60ea4a];return _0x139162;};'use strict';var _=require(_0x172b('0x0'));var md5=require('md5');var util=require(_0x172b('0x1'));var Redis=require(_0x172b('0x2'));var config=require(_0x172b('0x3'));config[_0x172b('0x4')]=_[_0x172b('0x5')](config[_0x172b('0x4')],{'host':_0x172b('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x172b('0x4')]));function SmsQueue(_0x40c72e){this['id']=_0x40c72e['id']||0x0;this[_0x172b('0x7')]=_0x40c72e[_0x172b('0x7')]||'';this['timeout']=_0x40c72e[_0x172b('0x8')]||0xa;this['strategy']=_0x40c72e[_0x172b('0x9')]||'beepall';this[_0x172b('0xa')]=_0x40c72e[_0x172b('0xa')];this[_0x172b('0xb')]={};this[_0x172b('0xc')]=0x0;this['md5']='';this[_0x172b('0xd')]();this[_0x172b('0xe')]();}SmsQueue[_0x172b('0xf')][_0x172b('0xd')]=function(){var _0xa4ada9=this[_0x172b('0xb')][_0x172b('0x10')];this['mapAgentsId']=_[_0x172b('0x11')](this[_0x172b('0xa')],'id');this[_0x172b('0xb')]['_rr']=_0xa4ada9;};SmsQueue[_0x172b('0xf')]['updateRealtime']=function(){this[_0x172b('0x12')]=0x0;this[_0x172b('0x13')]=0x0;for(var _0x5239b9=0x0;_0x5239b9=0x0?this[_0x172b('0x17')]:0x0;var _0x18c22a={'id':this['id'],'available':this[_0x172b('0x17')],'loggedIn':this[_0x172b('0x12')],'name':this['name'],'paused':this[_0x172b('0x13')],'waiting':this[_0x172b('0xc')]};var _0x2bedae=md5(JSON[_0x172b('0x18')](_0x18c22a));if(this[_0x172b('0x19')]!==_0x2bedae){this[_0x172b('0x19')]=_0x2bedae;io['to'](util[_0x172b('0x1a')]('sms:queue:%s',_0x18c22a['name']))['emit']('sms_queue:save',_0x18c22a);}};module[_0x172b('0x1b')]=SmsQueue; \ No newline at end of file +var _0x073e=['map','loggedIn','paused','length','online','smsPause','available','stringify','format','sms:queue:%s','emit','sms_queue:save','exports','lodash','md5','util','ioredis','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','_rr'];(function(_0x500758,_0x2bb3e1){var _0xa7977f=function(_0x424de7){while(--_0x424de7){_0x500758['push'](_0x500758['shift']());}};_0xa7977f(++_0x2bb3e1);}(_0x073e,0x181));var _0xe073=function(_0x3a5dd7,_0xb315b8){_0x3a5dd7=_0x3a5dd7-0x0;var _0x46a36a=_0x073e[_0x3a5dd7];return _0x46a36a;};'use strict';var _=require(_0xe073('0x0'));var md5=require(_0xe073('0x1'));var util=require(_0xe073('0x2'));var Redis=require(_0xe073('0x3'));var config=require('../../../config/environment');config['redis']=_['defaults'](config[_0xe073('0x4')],{'host':_0xe073('0x5'),'port':0x18eb});var io=require(_0xe073('0x6'))(new Redis(config['redis']));function SmsQueue(_0x5b9324){this['id']=_0x5b9324['id']||0x0;this['name']=_0x5b9324[_0xe073('0x7')]||'';this[_0xe073('0x8')]=_0x5b9324[_0xe073('0x8')]||0xa;this[_0xe073('0x9')]=_0x5b9324[_0xe073('0x9')]||_0xe073('0xa');this['Agents']=_0x5b9324[_0xe073('0xb')];this[_0xe073('0xc')]={};this[_0xe073('0xd')]=0x0;this[_0xe073('0x1')]='';this['updateRouting']();this[_0xe073('0xe')]();}SmsQueue[_0xe073('0xf')][_0xe073('0x10')]=function(){var _0x1f5a22=this[_0xe073('0xc')][_0xe073('0x11')];this['mapAgentsId']=_[_0xe073('0x12')](this['Agents'],'id');this[_0xe073('0xc')]['_rr']=_0x1f5a22;};SmsQueue[_0xe073('0xf')]['updateRealtime']=function(){this[_0xe073('0x13')]=0x0;this[_0xe073('0x14')]=0x0;for(var _0x47828d=0x0;_0x47828d=0x0?this[_0xe073('0x18')]:0x0;var _0x16eaa6={'id':this['id'],'available':this['available'],'loggedIn':this[_0xe073('0x13')],'name':this[_0xe073('0x7')],'paused':this[_0xe073('0x14')],'waiting':this['waiting']};var _0x21c02e=md5(JSON[_0xe073('0x19')](_0x16eaa6));if(this[_0xe073('0x1')]!==_0x21c02e){this[_0xe073('0x1')]=_0x21c02e;io['to'](util[_0xe073('0x1a')](_0xe073('0x1b'),_0x16eaa6[_0xe073('0x7')]))[_0xe073('0x1c')](_0xe073('0x1d'),_0x16eaa6);}};module[_0xe073('0x1e')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index ec7f735..acca04a 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 _0x88b8=['whatsappPause','available','format','whatsapp:queue:%s','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online'];(function(_0x42acfc,_0x349f46){var _0x24b053=function(_0x49409e){while(--_0x49409e){_0x42acfc['push'](_0x42acfc['shift']());}};_0x24b053(++_0x349f46);}(_0x88b8,0x108));var _0x888b=function(_0x2673a4,_0x4d0b8d){_0x2673a4=_0x2673a4-0x0;var _0x5e3a6a=_0x88b8[_0x2673a4];return _0x5e3a6a;};'use strict';var _=require(_0x888b('0x0'));var md5=require(_0x888b('0x1'));var util=require(_0x888b('0x2'));var Redis=require(_0x888b('0x3'));var config=require(_0x888b('0x4'));config[_0x888b('0x5')]=_['defaults'](config[_0x888b('0x5')],{'host':_0x888b('0x6'),'port':0x18eb});var io=require(_0x888b('0x7'))(new Redis(config['redis']));function WhatsappQueue(_0x65aaee){this['id']=_0x65aaee['id']||0x0;this[_0x888b('0x8')]=_0x65aaee[_0x888b('0x8')]||'';this['timeout']=_0x65aaee['timeout']||0xa;this[_0x888b('0x9')]=_0x65aaee[_0x888b('0x9')]||'beepall';this[_0x888b('0xa')]=_0x65aaee[_0x888b('0xa')];this[_0x888b('0xb')]={};this[_0x888b('0xc')]=0x0;this[_0x888b('0x1')]='';this[_0x888b('0xd')]();this[_0x888b('0xe')]();}WhatsappQueue[_0x888b('0xf')][_0x888b('0xd')]=function(){var _0xe2565=this[_0x888b('0xb')][_0x888b('0x10')];this[_0x888b('0xb')]=_[_0x888b('0x11')](this['Agents'],'id');this['mapAgentsId']['_rr']=_0xe2565;};WhatsappQueue[_0x888b('0xf')][_0x888b('0xe')]=function(){this[_0x888b('0x12')]=0x0;this[_0x888b('0x13')]=0x0;for(var _0x377c10=0x0;_0x377c10=0x0?this[_0x888b('0x17')]:0x0;var _0x150354={'id':this['id'],'available':this[_0x888b('0x17')],'loggedIn':this[_0x888b('0x12')],'name':this[_0x888b('0x8')],'paused':this[_0x888b('0x13')],'waiting':this[_0x888b('0xc')]};var _0x143049=md5(JSON['stringify'](_0x150354));if(this[_0x888b('0x1')]!==_0x143049){this[_0x888b('0x1')]=_0x143049;io['to'](util[_0x888b('0x18')](_0x888b('0x19'),_0x150354[_0x888b('0x8')]))['emit']('whatsapp_queue:save',_0x150354);}};module['exports']=WhatsappQueue; \ No newline at end of file +var _0x2fc0=['socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','prototype','mapAgentsId','_rr','map','paused','length','online','loggedIn','whatsappPause','available','stringify','format','emit','whatsapp_queue:save','exports','lodash','md5','ioredis','../../../config/environment','defaults','redis'];(function(_0x2eefb7,_0x16f020){var _0x1ebee8=function(_0x191ef1){while(--_0x191ef1){_0x2eefb7['push'](_0x2eefb7['shift']());}};_0x1ebee8(++_0x16f020);}(_0x2fc0,0xa8));var _0x02fc=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2fc0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x02fc('0x0'));var md5=require(_0x02fc('0x1'));var util=require('util');var Redis=require(_0x02fc('0x2'));var config=require(_0x02fc('0x3'));config['redis']=_[_0x02fc('0x4')](config[_0x02fc('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x02fc('0x6'))(new Redis(config[_0x02fc('0x5')]));function WhatsappQueue(_0x5fae32){this['id']=_0x5fae32['id']||0x0;this[_0x02fc('0x7')]=_0x5fae32[_0x02fc('0x7')]||'';this['timeout']=_0x5fae32[_0x02fc('0x8')]||0xa;this[_0x02fc('0x9')]=_0x5fae32[_0x02fc('0x9')]||_0x02fc('0xa');this[_0x02fc('0xb')]=_0x5fae32['Agents'];this['mapAgentsId']={};this[_0x02fc('0xc')]=0x0;this[_0x02fc('0x1')]='';this[_0x02fc('0xd')]();this['updateRealtime']();}WhatsappQueue[_0x02fc('0xe')][_0x02fc('0xd')]=function(){var _0x551c82=this[_0x02fc('0xf')][_0x02fc('0x10')];this['mapAgentsId']=_[_0x02fc('0x11')](this[_0x02fc('0xb')],'id');this[_0x02fc('0xf')][_0x02fc('0x10')]=_0x551c82;};WhatsappQueue['prototype']['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x02fc('0x12')]=0x0;for(var _0x243541=0x0;_0x243541=0x0?this[_0x02fc('0x17')]:0x0;var _0xb242be={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0x02fc('0x7')],'paused':this[_0x02fc('0x12')],'waiting':this[_0x02fc('0xc')]};var _0x2d6dc4=md5(JSON[_0x02fc('0x18')](_0xb242be));if(this[_0x02fc('0x1')]!==_0x2d6dc4){this['md5']=_0x2d6dc4;io['to'](util[_0x02fc('0x19')]('whatsapp:queue:%s',_0xb242be[_0x02fc('0x7')]))[_0x02fc('0x1a')](_0x02fc('0x1b'),_0xb242be);}};module[_0x02fc('0x1c')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 132074d..1f83280 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 _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x5edbcf,_0x5e51da){var _0x288d0b=function(_0x19c095){while(--_0x19c095){_0x5edbcf['push'](_0x5edbcf['shift']());}};_0x288d0b(++_0x5e51da);}(_0xb10b,0x12a));var _0xbb10=function(_0x57306c,_0xdeff85){_0x57306c=_0x57306c-0x0;var _0x413cfb=_0xb10b[_0x57306c];return _0x413cfb;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'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 c8482e7..7e7c4f5 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 _0xf2aa=['../client','Request','UpdateChatInteraction','updateChatInteraction','addTags','addTagsToChatInteraction'];(function(_0x449595,_0x113070){var _0x28b865=function(_0x336b8b){while(--_0x336b8b){_0x449595['push'](_0x449595['shift']());}};_0x28b865(++_0x113070);}(_0xf2aa,0x72));var _0xaf2a=function(_0x4ace20,_0x12a5a1){_0x4ace20=_0x4ace20-0x0;var _0x1ebfac=_0xf2aa[_0x4ace20];return _0x1ebfac;};'use strict';var client=require(_0xaf2a('0x0'));exports['update']=function(_0x3305e4,_0x33abef){return client[_0xaf2a('0x1')](_0xaf2a('0x2'),{'body':_0x33abef,'options':{'where':{'id':_0x3305e4}},'log':_0xaf2a('0x3')});};exports[_0xaf2a('0x4')]=function(_0x1d8773,_0x37f2f2){return client[_0xaf2a('0x1')]('AddTagsToChatInteraction',{'body':_0x37f2f2,'options':{'where':{'id':_0x1d8773}},'log':_0xaf2a('0x5')});}; \ No newline at end of file +var _0x7558=['update','Request','UpdateChatInteraction','updateChatInteraction','addTags','../client'];(function(_0x3ee1a1,_0x28152b){var _0x166cb1=function(_0x3d6c9e){while(--_0x3d6c9e){_0x3ee1a1['push'](_0x3ee1a1['shift']());}};_0x166cb1(++_0x28152b);}(_0x7558,0x15b));var _0x8755=function(_0x54d5ef,_0x195f4b){_0x54d5ef=_0x54d5ef-0x0;var _0x3e13ae=_0x7558[_0x54d5ef];return _0x3e13ae;};'use strict';var client=require(_0x8755('0x0'));exports[_0x8755('0x1')]=function(_0x3aff14,_0x4f4830){return client[_0x8755('0x2')](_0x8755('0x3'),{'body':_0x4f4830,'options':{'where':{'id':_0x3aff14}},'log':_0x8755('0x4')});};exports[_0x8755('0x5')]=function(_0x1080f4,_0x574a85){return client[_0x8755('0x2')]('AddTagsToChatInteraction',{'body':_0x574a85,'options':{'where':{'id':_0x1080f4}},'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 c5fe06b..33a9942 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 _0x3d4d=['CreateChatMessage','../client'];(function(_0x164ef5,_0xba6238){var _0x2d60c5=function(_0x34deca){while(--_0x34deca){_0x164ef5['push'](_0x164ef5['shift']());}};_0x2d60c5(++_0xba6238);}(_0x3d4d,0x12d));var _0xd3d4=function(_0x57807,_0x43a33b){_0x57807=_0x57807-0x0;var _0x1ba2c3=_0x3d4d[_0x57807];return _0x1ba2c3;};'use strict';var client=require(_0xd3d4('0x0'));exports['create']=function(_0x20f4e3){return client['Request'](_0xd3d4('0x1'),{'body':_0x20f4e3,'log':'createChatMessage'});}; \ No newline at end of file +var _0x64ec=['createChatMessage','Request'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x64ec,0xcb));var _0xc64e=function(_0x587bcb,_0x4309b4){_0x587bcb=_0x587bcb-0x0;var _0x2143ff=_0x64ec[_0x587bcb];return _0x2143ff;};'use strict';var client=require('../client');exports['create']=function(_0x4e21c4){return client[_0xc64e('0x0')]('CreateChatMessage',{'body':_0x4e21c4,'log':_0xc64e('0x1')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 0bb5c1c..03e2a65 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 _0xf8de=['User','Agents','online','chatPause','getChatQueues','Request','name','strategy'];(function(_0x5705e3,_0x18af22){var _0x334d81=function(_0x48eb8c){while(--_0x48eb8c){_0x5705e3['push'](_0x5705e3['shift']());}};_0x334d81(++_0x18af22);}(_0xf8de,0x1d4));var _0xef8d=function(_0x5900ee,_0x48931e){_0x5900ee=_0x5900ee-0x0;var _0x171d06=_0xf8de[_0x5900ee];return _0x171d06;};'use strict';var client=require('../client');exports[_0xef8d('0x0')]=function(){return function(){return client[_0xef8d('0x1')]('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0xef8d('0x2'),'timeout',_0xef8d('0x3')],'include':[{'model':_0xef8d('0x4'),'as':_0xef8d('0x5'),'attributes':['id','name',_0xef8d('0x6'),_0xef8d('0x7')]}]},'log':'getChatQueues'});};}; \ No newline at end of file +var _0xac4f=['chatPause','getChatQueues','../client','Request','name','User','Agents','online'];(function(_0x12ca16,_0x281fd9){var _0x56fb78=function(_0x3479b2){while(--_0x3479b2){_0x12ca16['push'](_0x12ca16['shift']());}};_0x56fb78(++_0x281fd9);}(_0xac4f,0x122));var _0xfac4=function(_0x43a6cd,_0x503d1a){_0x43a6cd=_0x43a6cd-0x0;var _0x5acb36=_0xac4f[_0x43a6cd];return _0x5acb36;};'use strict';var client=require(_0xfac4('0x0'));exports['getChatQueues']=function(){return function(){return client[_0xfac4('0x1')]('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0xfac4('0x2'),'timeout','strategy'],'include':[{'model':_0xfac4('0x3'),'as':_0xfac4('0x4'),'attributes':['id','name',_0xfac4('0x5'),_0xfac4('0x6')]}]},'log':_0xfac4('0x7')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 8045f2c..4b1f2cf 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 _0xc7e9=['../client','create','Request','CreateChatQueueReport','DESC'];(function(_0x4ef048,_0x244de2){var _0x2d58ac=function(_0x5cd657){while(--_0x5cd657){_0x4ef048['push'](_0x4ef048['shift']());}};_0x2d58ac(++_0x244de2);}(_0xc7e9,0x1ef));var _0x9c7e=function(_0x2adbeb,_0x5581be){_0x2adbeb=_0x2adbeb-0x0;var _0x5e18a6=_0xc7e9[_0x2adbeb];return _0x5e18a6;};'use strict';var client=require(_0x9c7e('0x0'));exports[_0x9c7e('0x1')]=function(_0x581e2d){return client[_0x9c7e('0x2')](_0x9c7e('0x3'),{'body':_0x581e2d,'log':_0x9c7e('0x3')});};exports['update']=function(_0x340997,_0x34cef0){return client['Request']('UpdateChatQueueReport',{'body':_0x34cef0,'options':{'where':{'uniqueid':_0x340997},'order':[['id',_0x9c7e('0x4')]],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file +var _0xaa88=['create','Request','CreateChatQueueReport','update','UpdateChatQueueReport','../client'];(function(_0xcd4e15,_0x345e45){var _0x3dd3be=function(_0x13b793){while(--_0x13b793){_0xcd4e15['push'](_0xcd4e15['shift']());}};_0x3dd3be(++_0x345e45);}(_0xaa88,0x137));var _0x8aa8=function(_0x1663ae,_0x10484a){_0x1663ae=_0x1663ae-0x0;var _0x30ffb8=_0xaa88[_0x1663ae];return _0x30ffb8;};'use strict';var client=require(_0x8aa8('0x0'));exports[_0x8aa8('0x1')]=function(_0x1643a6){return client[_0x8aa8('0x2')]('CreateChatQueueReport',{'body':_0x1643a6,'log':_0x8aa8('0x3')});};exports[_0x8aa8('0x4')]=function(_0x43f7e4,_0x3b2c88){return client[_0x8aa8('0x2')](_0x8aa8('0x5'),{'body':_0x3b2c88,'options':{'where':{'uniqueid':_0x43f7e4},'order':[['id','DESC']],'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 c443389..9590b4a 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 _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x132558,_0x521d93){var _0x34f138=function(_0x3e3541){while(--_0x3e3541){_0x132558['push'](_0x132558['shift']());}};_0x34f138(++_0x521d93);}(_0x7a54,0x106));var _0x47a5=function(_0x35e8df,_0x51df48){_0x35e8df=_0x35e8df-0x0;var _0x504dc8=_0x7a54[_0x35e8df];return _0x504dc8;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file +var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x14d8c3,_0x2b55a9){var _0x354f8f=function(_0x2ae623){while(--_0x2ae623){_0x14d8c3['push'](_0x14d8c3['shift']());}};_0x354f8f(++_0x2b55a9);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'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 fe6c6f4..a89ccf1 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 _0xa582=['../client','create','Request','CreateFaxMessage','createFaxMessage'];(function(_0x245afe,_0x319cde){var _0x4eefde=function(_0x15a1fa){while(--_0x15a1fa){_0x245afe['push'](_0x245afe['shift']());}};_0x4eefde(++_0x319cde);}(_0xa582,0x1a9));var _0x2a58=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xa582[_0x122ef9];return _0x42fba0;};'use strict';var client=require(_0x2a58('0x0'));exports[_0x2a58('0x1')]=function(_0x59b0ab){return client[_0x2a58('0x2')](_0x2a58('0x3'),{'body':_0x59b0ab,'log':_0x2a58('0x4')});}; \ No newline at end of file +var _0xc41a=['../client','create','Request','CreateFaxMessage','createFaxMessage'];(function(_0x4b1d41,_0x6bb5db){var _0x109f9d=function(_0x51e9c3){while(--_0x51e9c3){_0x4b1d41['push'](_0x4b1d41['shift']());}};_0x109f9d(++_0x6bb5db);}(_0xc41a,0xc8));var _0xac41=function(_0x1d9c70,_0x4ba8cc){_0x1d9c70=_0x1d9c70-0x0;var _0x9247cb=_0xc41a[_0x1d9c70];return _0x9247cb;};'use strict';var client=require(_0xac41('0x0'));exports[_0xac41('0x1')]=function(_0x1aea8c){return client[_0xac41('0x2')](_0xac41('0x3'),{'body':_0x1aea8c,'log':_0xac41('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 977b756..00d236e 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 _0x192e=['getFaxQueues','Request','GetFaxQueue','timeout','User','online','faxPause','../client'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0x192e,0x1df));var _0xe192=function(_0x1d20af,_0xcc2ff0){_0x1d20af=_0x1d20af-0x0;var _0x102b00=_0x192e[_0x1d20af];return _0x102b00;};'use strict';var client=require(_0xe192('0x0'));exports[_0xe192('0x1')]=function(){return function(){return client[_0xe192('0x2')](_0xe192('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xe192('0x4'),'strategy'],'include':[{'model':_0xe192('0x5'),'as':'Agents','attributes':['id','name',_0xe192('0x6'),_0xe192('0x7')]}]},'log':_0xe192('0x1')});};}; \ No newline at end of file +var _0x9478=['name','timeout','strategy','User','online','../client','getFaxQueues','Request','GetFaxQueue'];(function(_0x14df36,_0x6055c4){var _0x3378ec=function(_0x244523){while(--_0x244523){_0x14df36['push'](_0x14df36['shift']());}};_0x3378ec(++_0x6055c4);}(_0x9478,0x1e2));var _0x8947=function(_0x35af5d,_0x2da3cd){_0x35af5d=_0x35af5d-0x0;var _0x3468be=_0x9478[_0x35af5d];return _0x3468be;};'use strict';var client=require(_0x8947('0x0'));exports[_0x8947('0x1')]=function(){return function(){return client[_0x8947('0x2')](_0x8947('0x3'),{'options':{'raw':![],'attributes':['id',_0x8947('0x4'),_0x8947('0x5'),_0x8947('0x6')],'include':[{'model':_0x8947('0x7'),'as':'Agents','attributes':['id',_0x8947('0x4'),_0x8947('0x8'),'faxPause']}]},'log':_0x8947('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index d729738..362021f 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 _0xbd06=['Request','CreateFaxQueueReport','update','UpdateFaxQueueReport','DESC','../client','create'];(function(_0x59a04f,_0x3faa5f){var _0xdc470a=function(_0x29894f){while(--_0x29894f){_0x59a04f['push'](_0x59a04f['shift']());}};_0xdc470a(++_0x3faa5f);}(_0xbd06,0x1e8));var _0x6bd0=function(_0x34e333,_0x12da13){_0x34e333=_0x34e333-0x0;var _0x567b6a=_0xbd06[_0x34e333];return _0x567b6a;};'use strict';var client=require(_0x6bd0('0x0'));exports[_0x6bd0('0x1')]=function(_0x58e623){return client[_0x6bd0('0x2')]('CreateFaxQueueReport',{'body':_0x58e623,'log':_0x6bd0('0x3')});};exports[_0x6bd0('0x4')]=function(_0x13aede,_0x6705a1){return client[_0x6bd0('0x2')](_0x6bd0('0x5'),{'body':_0x6705a1,'options':{'where':{'uniqueid':_0x13aede},'order':[['id',_0x6bd0('0x6')]],'limit':0x1},'log':_0x6bd0('0x5')});}; \ No newline at end of file +var _0x2d48=['update','Request','DESC','../client','create'];(function(_0x57c76c,_0x2249da){var _0x12e012=function(_0x4daed7){while(--_0x4daed7){_0x57c76c['push'](_0x57c76c['shift']());}};_0x12e012(++_0x2249da);}(_0x2d48,0x85));var _0x82d4=function(_0x191f56,_0x5678e0){_0x191f56=_0x191f56-0x0;var _0x49010c=_0x2d48[_0x191f56];return _0x49010c;};'use strict';var client=require(_0x82d4('0x0'));exports[_0x82d4('0x1')]=function(_0x1a6a92){return client['Request']('CreateFaxQueueReport',{'body':_0x1a6a92,'log':'CreateFaxQueueReport'});};exports[_0x82d4('0x2')]=function(_0x13dd63,_0x2aac99){return client[_0x82d4('0x3')]('UpdateFaxQueueReport',{'body':_0x2aac99,'options':{'where':{'uniqueid':_0x13dd63},'order':[['id',_0x82d4('0x4')]],'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 8d583c5..b76935a 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 _0x154f=['Request','GetInterval','name','Interval','Intervals','../client'];(function(_0x3fb030,_0x12aebe){var _0xd6899b=function(_0x327646){while(--_0x327646){_0x3fb030['push'](_0x3fb030['shift']());}};_0xd6899b(++_0x12aebe);}(_0x154f,0x13d));var _0xf154=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x154f[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0xf154('0x0'));exports['getIntervals']=function(){return function(){return client[_0xf154('0x1')](_0xf154('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xf154('0x3')],'include':[{'model':_0xf154('0x4'),'as':_0xf154('0x5'),'attributes':['id','name','interval']}]},'log':'getIntervals'});};}; \ No newline at end of file +var _0xc330=['interval','../client','getIntervals','Request','GetInterval','name','Interval','Intervals'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0xc330,0x171));var _0x0c33=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc330[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x0c33('0x0'));exports[_0x0c33('0x1')]=function(){return function(){return client[_0x0c33('0x2')](_0x0c33('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x0c33('0x4')],'include':[{'model':_0x0c33('0x5'),'as':_0x0c33('0x6'),'attributes':['id',_0x0c33('0x4'),_0x0c33('0x7')]}]},'log':_0x0c33('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 2bfbe2e..571ab12 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 _0x0120=['update','Request','UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction','../client'];(function(_0xeba421,_0x143cbe){var _0x345bca=function(_0x4c8fc1){while(--_0x4c8fc1){_0xeba421['push'](_0xeba421['shift']());}};_0x345bca(++_0x143cbe);}(_0x0120,0x6f));var _0x0012=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x0120[_0x30ae5e];return _0x1f2e93;};'use strict';var client=require(_0x0012('0x0'));exports[_0x0012('0x1')]=function(_0x3d23e7,_0xb8d57c){return client[_0x0012('0x2')](_0x0012('0x3'),{'body':_0xb8d57c,'options':{'where':{'id':_0x3d23e7}},'log':_0x0012('0x4')});};exports[_0x0012('0x5')]=function(_0x357f77,_0x302029){return client[_0x0012('0x2')](_0x0012('0x6'),{'body':_0x302029,'options':{'where':{'id':_0x357f77}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x47c5=['UpdateMailInteraction','addTags','AddTagsToMailInteraction','../client','update','Request'];(function(_0x24d2cd,_0x30d6ff){var _0x5c2962=function(_0x376530){while(--_0x376530){_0x24d2cd['push'](_0x24d2cd['shift']());}};_0x5c2962(++_0x30d6ff);}(_0x47c5,0x165));var _0x547c=function(_0x5e07d5,_0x484083){_0x5e07d5=_0x5e07d5-0x0;var _0x273a52=_0x47c5[_0x5e07d5];return _0x273a52;};'use strict';var client=require(_0x547c('0x0'));exports[_0x547c('0x1')]=function(_0x2b2280,_0x123697){return client[_0x547c('0x2')](_0x547c('0x3'),{'body':_0x123697,'options':{'where':{'id':_0x2b2280}},'log':'updateMailInteraction'});};exports[_0x547c('0x4')]=function(_0x16f4db,_0x5b48c9){return client[_0x547c('0x2')](_0x547c('0x5'),{'body':_0x5b48c9,'options':{'where':{'id':_0x16f4db}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index f17508a..985bb11 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 _0x21be=['CreateMailMessage','../client','create','Request'];(function(_0x183dd2,_0x4e96fe){var _0x40322c=function(_0x288725){while(--_0x288725){_0x183dd2['push'](_0x183dd2['shift']());}};_0x40322c(++_0x4e96fe);}(_0x21be,0x16d));var _0xe21b=function(_0x53b6ae,_0x3cb9f4){_0x53b6ae=_0x53b6ae-0x0;var _0x34f4b2=_0x21be[_0x53b6ae];return _0x34f4b2;};'use strict';var client=require(_0xe21b('0x0'));exports[_0xe21b('0x1')]=function(_0x491b47){return client[_0xe21b('0x2')](_0xe21b('0x3'),{'body':_0x491b47,'log':'createMailMessage'});}; \ No newline at end of file +var _0x9544=['create','Request','createMailMessage','../client'];(function(_0x54d4fe,_0x55e869){var _0x1ab5bb=function(_0x5b1af2){while(--_0x5b1af2){_0x54d4fe['push'](_0x54d4fe['shift']());}};_0x1ab5bb(++_0x55e869);}(_0x9544,0x1af));var _0x4954=function(_0x5edf47,_0x5b550e){_0x5edf47=_0x5edf47-0x0;var _0x17d5a7=_0x9544[_0x5edf47];return _0x17d5a7;};'use strict';var client=require(_0x4954('0x0'));exports[_0x4954('0x1')]=function(_0x44ed8c){return client[_0x4954('0x2')]('CreateMailMessage',{'body':_0x44ed8c,'log':_0x4954('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index ee50854..27948fa 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 _0x0a76=['timeout','strategy','Agents','online','../client','getMailQueues','GetMailQueue','name'];(function(_0x3c39a1,_0xe6d095){var _0x495f46=function(_0x86befa){while(--_0x86befa){_0x3c39a1['push'](_0x3c39a1['shift']());}};_0x495f46(++_0xe6d095);}(_0x0a76,0x14c));var _0x60a7=function(_0x4dde71,_0xa7a39f){_0x4dde71=_0x4dde71-0x0;var _0x1068ac=_0x0a76[_0x4dde71];return _0x1068ac;};'use strict';var client=require(_0x60a7('0x0'));exports[_0x60a7('0x1')]=function(){return function(){return client['Request'](_0x60a7('0x2'),{'options':{'raw':![],'attributes':['id',_0x60a7('0x3'),_0x60a7('0x4'),_0x60a7('0x5')],'include':[{'model':'User','as':_0x60a7('0x6'),'attributes':['id',_0x60a7('0x3'),_0x60a7('0x7'),'mailPause']}]},'log':_0x60a7('0x1')});};}; \ No newline at end of file +var _0xb786=['../client','Request','GetMailQueue','name','timeout','strategy','User','getMailQueues'];(function(_0x54b719,_0x39ade5){var _0x31edd9=function(_0x3f2514){while(--_0x3f2514){_0x54b719['push'](_0x54b719['shift']());}};_0x31edd9(++_0x39ade5);}(_0xb786,0x128));var _0x6b78=function(_0x1dad80,_0x8c40e1){_0x1dad80=_0x1dad80-0x0;var _0x26fc90=_0xb786[_0x1dad80];return _0x26fc90;};'use strict';var client=require(_0x6b78('0x0'));exports['getMailQueues']=function(){return function(){return client[_0x6b78('0x1')](_0x6b78('0x2'),{'options':{'raw':![],'attributes':['id',_0x6b78('0x3'),_0x6b78('0x4'),_0x6b78('0x5')],'include':[{'model':_0x6b78('0x6'),'as':'Agents','attributes':['id','name','online','mailPause']}]},'log':_0x6b78('0x7')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index d95306b..77db514 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 _0xe04b=['Request','CreateMailQueueReport','DESC','create'];(function(_0x32c94c,_0x301e06){var _0x398d1e=function(_0x57e701){while(--_0x57e701){_0x32c94c['push'](_0x32c94c['shift']());}};_0x398d1e(++_0x301e06);}(_0xe04b,0xc3));var _0xbe04=function(_0x4fc026,_0x66bb48){_0x4fc026=_0x4fc026-0x0;var _0xf1c6ea=_0xe04b[_0x4fc026];return _0xf1c6ea;};'use strict';var client=require('../client');exports[_0xbe04('0x0')]=function(_0x28a7e0){return client[_0xbe04('0x1')](_0xbe04('0x2'),{'body':_0x28a7e0,'log':'CreateMailQueueReport'});};exports['update']=function(_0x2eb8a0,_0x137071){return client['Request']('UpdateMailQueueReport',{'body':_0x137071,'options':{'where':{'uniqueid':_0x2eb8a0},'order':[['id',_0xbe04('0x3')]],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file +var _0xfdf2=['UpdateMailQueueReport','DESC','../client','Request','CreateMailQueueReport'];(function(_0x43c799,_0x2a0635){var _0x3195db=function(_0x4d62e2){while(--_0x4d62e2){_0x43c799['push'](_0x43c799['shift']());}};_0x3195db(++_0x2a0635);}(_0xfdf2,0x1f1));var _0x2fdf=function(_0x505942,_0x47b4fc){_0x505942=_0x505942-0x0;var _0x30b622=_0xfdf2[_0x505942];return _0x30b622;};'use strict';var client=require(_0x2fdf('0x0'));exports['create']=function(_0x47e654){return client[_0x2fdf('0x1')](_0x2fdf('0x2'),{'body':_0x47e654,'log':_0x2fdf('0x2')});};exports['update']=function(_0x5f1faf,_0x48b862){return client[_0x2fdf('0x1')](_0x2fdf('0x3'),{'body':_0x48b862,'options':{'where':{'uniqueid':_0x5f1faf},'order':[['id',_0x2fdf('0x4')]],'limit':0x1},'log':_0x2fdf('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index ff35095..7572258 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 _0xecdc=['Request','UpdateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','../client'];(function(_0x8b60c8,_0x3453aa){var _0x4b8f96=function(_0x57e854){while(--_0x57e854){_0x8b60c8['push'](_0x8b60c8['shift']());}};_0x4b8f96(++_0x3453aa);}(_0xecdc,0x68));var _0xcecd=function(_0x11d5e9,_0x3dae2d){_0x11d5e9=_0x11d5e9-0x0;var _0x2230b1=_0xecdc[_0x11d5e9];return _0x2230b1;};'use strict';var client=require(_0xcecd('0x0'));exports['update']=function(_0x2dbc36,_0x7bbd0f){return client[_0xcecd('0x1')](_0xcecd('0x2'),{'body':_0x7bbd0f,'options':{'where':{'id':_0x2dbc36}},'log':'updateOpenchannelInteraction'});};exports[_0xcecd('0x3')]=function(_0x53c395,_0x22953c){return client[_0xcecd('0x1')](_0xcecd('0x4'),{'body':_0x22953c,'options':{'where':{'id':_0x53c395}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x30c3=['Request','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update','updateOpenchannelInteraction','addTags'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x30c3,0x1bc));var _0x330c=function(_0x1e05c1,_0x3cffa3){_0x1e05c1=_0x1e05c1-0x0;var _0x15f1ca=_0x30c3[_0x1e05c1];return _0x15f1ca;};'use strict';var client=require(_0x330c('0x0'));exports[_0x330c('0x1')]=function(_0x3f83f0,_0x2fa2ac){return client['Request']('UpdateOpenchannelInteraction',{'body':_0x2fa2ac,'options':{'where':{'id':_0x3f83f0}},'log':_0x330c('0x2')});};exports[_0x330c('0x3')]=function(_0x218ceb,_0x2a3d81){return client[_0x330c('0x4')](_0x330c('0x5'),{'body':_0x2a3d81,'options':{'where':{'id':_0x218ceb}},'log':_0x330c('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index b9ec955..eecdd06 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 _0x96c6=['Request','../client','create'];(function(_0x4493e7,_0x212d2d){var _0x1ad90a=function(_0x4235c0){while(--_0x4235c0){_0x4493e7['push'](_0x4493e7['shift']());}};_0x1ad90a(++_0x212d2d);}(_0x96c6,0x124));var _0x696c=function(_0x2a13f4,_0x1b0930){_0x2a13f4=_0x2a13f4-0x0;var _0x1a556d=_0x96c6[_0x2a13f4];return _0x1a556d;};'use strict';var client=require(_0x696c('0x0'));exports[_0x696c('0x1')]=function(_0x19aaa5){return client[_0x696c('0x2')]('CreateOpenchannelMessage',{'body':_0x19aaa5,'log':'createOpenchannelMessage'});}; \ No newline at end of file +var _0xed67=['create','Request','CreateOpenchannelMessage','createOpenchannelMessage'];(function(_0x30c0eb,_0x2e8ad3){var _0x4bba9e=function(_0x4fa0b5){while(--_0x4fa0b5){_0x30c0eb['push'](_0x30c0eb['shift']());}};_0x4bba9e(++_0x2e8ad3);}(_0xed67,0x1f0));var _0x7ed6=function(_0x3358ba,_0x24c5fc){_0x3358ba=_0x3358ba-0x0;var _0x296e73=_0xed67[_0x3358ba];return _0x296e73;};'use strict';var client=require('../client');exports[_0x7ed6('0x0')]=function(_0x259f95){return client[_0x7ed6('0x1')](_0x7ed6('0x2'),{'body':_0x259f95,'log':_0x7ed6('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index b9cccc2..fe07bf0 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 _0xecd2=['GetOpenchannelQueue','name','timeout','strategy','User','Agents','openchannelPause','../client','getOpenchannelQueues'];(function(_0x50357f,_0x41343a){var _0x3deeb3=function(_0x57aa5e){while(--_0x57aa5e){_0x50357f['push'](_0x50357f['shift']());}};_0x3deeb3(++_0x41343a);}(_0xecd2,0x139));var _0x2ecd=function(_0x3cdbbc,_0x55dfd6){_0x3cdbbc=_0x3cdbbc-0x0;var _0x25422b=_0xecd2[_0x3cdbbc];return _0x25422b;};'use strict';var client=require(_0x2ecd('0x0'));exports[_0x2ecd('0x1')]=function(){return function(){return client['Request'](_0x2ecd('0x2'),{'options':{'raw':![],'attributes':['id',_0x2ecd('0x3'),_0x2ecd('0x4'),_0x2ecd('0x5')],'include':[{'model':_0x2ecd('0x6'),'as':_0x2ecd('0x7'),'attributes':['id',_0x2ecd('0x3'),'online',_0x2ecd('0x8')]}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file +var _0xd345=['Request','name','timeout','Agents','../client'];(function(_0x26df48,_0x22aa50){var _0x209047=function(_0x1d068b){while(--_0x1d068b){_0x26df48['push'](_0x26df48['shift']());}};_0x209047(++_0x22aa50);}(_0xd345,0xfe));var _0x5d34=function(_0x4a0ba5,_0x508b0f){_0x4a0ba5=_0x4a0ba5-0x0;var _0x570386=_0xd345[_0x4a0ba5];return _0x570386;};'use strict';var client=require(_0x5d34('0x0'));exports['getOpenchannelQueues']=function(){return function(){return client[_0x5d34('0x1')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0x5d34('0x2'),_0x5d34('0x3'),'strategy'],'include':[{'model':'User','as':_0x5d34('0x4'),'attributes':['id',_0x5d34('0x2'),'online','openchannelPause']}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index b17ab4f..33c481f 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 _0x969d=['CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','../client','create','Request'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x969d,0xf7));var _0xd969=function(_0x304e81,_0xe6a12e){_0x304e81=_0x304e81-0x0;var _0x3fb0a0=_0x969d[_0x304e81];return _0x3fb0a0;};'use strict';var client=require(_0xd969('0x0'));exports[_0xd969('0x1')]=function(_0x1c5abf){return client[_0xd969('0x2')]('CreateOpenchannelQueueReport',{'body':_0x1c5abf,'log':_0xd969('0x3')});};exports['update']=function(_0x1f13c7,_0x5139f0){return client['Request'](_0xd969('0x4'),{'body':_0x5139f0,'options':{'where':{'uniqueid':_0x1f13c7},'order':[['id','DESC']],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file +var _0xcb1e=['../client','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport'];(function(_0x54ea7a,_0x19df9b){var _0x65a10d=function(_0x1bf936){while(--_0x1bf936){_0x54ea7a['push'](_0x54ea7a['shift']());}};_0x65a10d(++_0x19df9b);}(_0xcb1e,0x1b8));var _0xecb1=function(_0x335271,_0x5025f2){_0x335271=_0x335271-0x0;var _0xa9fff8=_0xcb1e[_0x335271];return _0xa9fff8;};'use strict';var client=require(_0xecb1('0x0'));exports['create']=function(_0x4d86c9){return client['Request'](_0xecb1('0x1'),{'body':_0x4d86c9,'log':_0xecb1('0x1')});};exports[_0xecb1('0x2')]=function(_0x1b284d,_0x3ea00a){return client['Request']('UpdateOpenchannelQueueReport',{'body':_0x3ea00a,'options':{'where':{'uniqueid':_0x1b284d},'order':[['id','DESC']],'limit':0x1},'log':_0xecb1('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 0ecfab0..48c30fb 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 _0x432b=['addTagsToSmsInteraction','../client','Request','UpdateSmsInteraction'];(function(_0x68061e,_0x31ead8){var _0x5b3b61=function(_0x481642){while(--_0x481642){_0x68061e['push'](_0x68061e['shift']());}};_0x5b3b61(++_0x31ead8);}(_0x432b,0x161));var _0xb432=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x432b[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xb432('0x0'));exports['update']=function(_0x3b6273,_0x37fb3d){return client[_0xb432('0x1')](_0xb432('0x2'),{'body':_0x37fb3d,'options':{'where':{'id':_0x3b6273}},'log':'updateSmsInteraction'});};exports['addTags']=function(_0x93e722,_0x4cefc4){return client[_0xb432('0x1')]('AddTagsToSmsInteraction',{'body':_0x4cefc4,'options':{'where':{'id':_0x93e722}},'log':_0xb432('0x3')});}; \ No newline at end of file +var _0xc43c=['AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update','Request','UpdateSmsInteraction','addTags'];(function(_0x41b654,_0x39239c){var _0x55c219=function(_0x1f55c0){while(--_0x1f55c0){_0x41b654['push'](_0x41b654['shift']());}};_0x55c219(++_0x39239c);}(_0xc43c,0x152));var _0xcc43=function(_0x42404b,_0x4a14a3){_0x42404b=_0x42404b-0x0;var _0x4b4383=_0xc43c[_0x42404b];return _0x4b4383;};'use strict';var client=require(_0xcc43('0x0'));exports[_0xcc43('0x1')]=function(_0x41a7fe,_0x3d90f5){return client[_0xcc43('0x2')](_0xcc43('0x3'),{'body':_0x3d90f5,'options':{'where':{'id':_0x41a7fe}},'log':'updateSmsInteraction'});};exports[_0xcc43('0x4')]=function(_0x258c7e,_0x5c21a3){return client[_0xcc43('0x2')](_0xcc43('0x5'),{'body':_0x5c21a3,'options':{'where':{'id':_0x258c7e}},'log':_0xcc43('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index eed856e..6a866f2 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 _0x3690=['CreateSmsMessage','createSmsMessage','../client','create'];(function(_0x5e9fac,_0x17364a){var _0x438973=function(_0x593cf3){while(--_0x593cf3){_0x5e9fac['push'](_0x5e9fac['shift']());}};_0x438973(++_0x17364a);}(_0x3690,0xfa));var _0x0369=function(_0x5076bb,_0x10fd12){_0x5076bb=_0x5076bb-0x0;var _0x2d19ee=_0x3690[_0x5076bb];return _0x2d19ee;};'use strict';var client=require(_0x0369('0x0'));exports[_0x0369('0x1')]=function(_0x1278a0){return client['Request'](_0x0369('0x2'),{'body':_0x1278a0,'log':_0x0369('0x3')});}; \ No newline at end of file +var _0x4e8f=['CreateSmsMessage','createSmsMessage','../client','create'];(function(_0x305e8a,_0x5b948c){var _0x51fca4=function(_0x4a9c29){while(--_0x4a9c29){_0x305e8a['push'](_0x305e8a['shift']());}};_0x51fca4(++_0x5b948c);}(_0x4e8f,0x152));var _0xf4e8=function(_0x11ad6b,_0x2b34cc){_0x11ad6b=_0x11ad6b-0x0;var _0x4e97c2=_0x4e8f[_0x11ad6b];return _0x4e97c2;};'use strict';var client=require(_0xf4e8('0x0'));exports[_0xf4e8('0x1')]=function(_0x2a899c){return client['Request'](_0xf4e8('0x2'),{'body':_0x2a899c,'log':_0xf4e8('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 48ce03c..a51449a 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 _0xa9e0=['name','online','smsPause','../client','getSmsQueues','Request','timeout','User','Agents'];(function(_0x962361,_0x28f0c6){var _0x3a12fa=function(_0x2a85c6){while(--_0x2a85c6){_0x962361['push'](_0x962361['shift']());}};_0x3a12fa(++_0x28f0c6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0a9e('0x3'),'strategy'],'include':[{'model':_0x0a9e('0x4'),'as':_0x0a9e('0x5'),'attributes':['id',_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8')]}]},'log':'getSmsQueues'});};}; \ No newline at end of file +var _0x0713=['getSmsQueues','Request','GetSmsQueue','name','timeout','strategy','Agents','online','smsPause'];(function(_0x26e727,_0x3e65be){var _0x563800=function(_0xbcf999){while(--_0xbcf999){_0x26e727['push'](_0x26e727['shift']());}};_0x563800(++_0x3e65be);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':![],'attributes':['id',_0x3071('0x2'),_0x3071('0x3'),_0x3071('0x4')],'include':[{'model':'User','as':_0x3071('0x5'),'attributes':['id',_0x3071('0x2'),_0x3071('0x6'),_0x3071('0x7')]}]},'log':_0x3071('0x8')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 6571aa6..e08151c 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 _0x34e8=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC','../client'];(function(_0x2438ef,_0xe999c1){var _0x114731=function(_0x72a6cd){while(--_0x72a6cd){_0x2438ef['push'](_0x2438ef['shift']());}};_0x114731(++_0xe999c1);}(_0x34e8,0x12c));var _0x834e=function(_0x464c3c,_0x346e7e){_0x464c3c=_0x464c3c-0x0;var _0x102b75=_0x34e8[_0x464c3c];return _0x102b75;};'use strict';var client=require(_0x834e('0x0'));exports[_0x834e('0x1')]=function(_0x8b339){return client[_0x834e('0x2')]('CreateSmsQueueReport',{'body':_0x8b339,'log':_0x834e('0x3')});};exports[_0x834e('0x4')]=function(_0x472111,_0x31bf20){return client[_0x834e('0x2')](_0x834e('0x5'),{'body':_0x31bf20,'options':{'where':{'uniqueid':_0x472111},'order':[['id',_0x834e('0x6')]],'limit':0x1},'log':'UpdateSmsQueueReport'});}; \ No newline at end of file +var _0x3e74=['CreateSmsQueueReport','UpdateSmsQueueReport','DESC','../client','Request'];(function(_0x232ed0,_0x5aa050){var _0x75b274=function(_0x5b897c){while(--_0x5b897c){_0x232ed0['push'](_0x232ed0['shift']());}};_0x75b274(++_0x5aa050);}(_0x3e74,0x175));var _0x43e7=function(_0x251b58,_0x4ee963){_0x251b58=_0x251b58-0x0;var _0x50e4d6=_0x3e74[_0x251b58];return _0x50e4d6;};'use strict';var client=require(_0x43e7('0x0'));exports['create']=function(_0x349480){return client[_0x43e7('0x1')](_0x43e7('0x2'),{'body':_0x349480,'log':'CreateSmsQueueReport'});};exports['update']=function(_0xc58479,_0x4f9bbe){return client[_0x43e7('0x1')](_0x43e7('0x3'),{'body':_0x4f9bbe,'options':{'where':{'uniqueid':_0xc58479},'order':[['id',_0x43e7('0x4')]],'limit':0x1},'log':_0x43e7('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index f7a40cf..2770f42 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(_0xca4742,_0x2213c8){var _0x2b21a5=function(_0x203585){while(--_0x203585){_0xca4742['push'](_0xca4742['shift']());}};_0x2b21a5(++_0x2213c8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'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(_0x1fe726,_0x39ee06){var _0x5ea178=function(_0x1b35a5){while(--_0x1b35a5){_0x1fe726['push'](_0x1fe726['shift']());}};_0x5ea178(++_0x39ee06);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'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 c5786c9..c504c66 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 _0xed5c=['addTagsToWhatsappInteraction','../client','update','Request','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction'];(function(_0x2d13b3,_0xcfdcca){var _0x3b64aa=function(_0x10c4e7){while(--_0x10c4e7){_0x2d13b3['push'](_0x2d13b3['shift']());}};_0x3b64aa(++_0xcfdcca);}(_0xed5c,0x81));var _0xced5=function(_0x129df0,_0x4a7f3d){_0x129df0=_0x129df0-0x0;var _0x8d9a76=_0xed5c[_0x129df0];return _0x8d9a76;};'use strict';var client=require(_0xced5('0x0'));exports[_0xced5('0x1')]=function(_0x2c59c3,_0x21fae7){return client[_0xced5('0x2')](_0xced5('0x3'),{'body':_0x21fae7,'options':{'where':{'id':_0x2c59c3}},'log':_0xced5('0x4')});};exports[_0xced5('0x5')]=function(_0x2b8184,_0x2ec4f9){return client['Request'](_0xced5('0x6'),{'body':_0x2ec4f9,'options':{'where':{'id':_0x2b8184}},'log':_0xced5('0x7')});}; \ No newline at end of file +var _0x2675=['addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','Request','UpdateWhatsappInteraction'];(function(_0x5ae44d,_0x3ad480){var _0x537437=function(_0x261ec6){while(--_0x261ec6){_0x5ae44d['push'](_0x5ae44d['shift']());}};_0x537437(++_0x3ad480);}(_0x2675,0x75));var _0x5267=function(_0x424a7f,_0x223ca5){_0x424a7f=_0x424a7f-0x0;var _0x1e6a39=_0x2675[_0x424a7f];return _0x1e6a39;};'use strict';var client=require(_0x5267('0x0'));exports['update']=function(_0x53e71f,_0x4f8fae){return client[_0x5267('0x1')](_0x5267('0x2'),{'body':_0x4f8fae,'options':{'where':{'id':_0x53e71f}},'log':'updateWhatsappInteraction'});};exports[_0x5267('0x3')]=function(_0x36bdf0,_0x4e2548){return client[_0x5267('0x1')](_0x5267('0x4'),{'body':_0x4e2548,'options':{'where':{'id':_0x36bdf0}},'log':_0x5267('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 4d1f897..56f664b 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 _0x7071=['Request','createWhatsappMessage','../client'];(function(_0x1f222a,_0x1210d4){var _0x401901=function(_0x6a94d){while(--_0x6a94d){_0x1f222a['push'](_0x1f222a['shift']());}};_0x401901(++_0x1210d4);}(_0x7071,0x12b));var _0x1707=function(_0x44a0ce,_0x455244){_0x44a0ce=_0x44a0ce-0x0;var _0x4ff348=_0x7071[_0x44a0ce];return _0x4ff348;};'use strict';var client=require(_0x1707('0x0'));exports['create']=function(_0x1a5499){return client[_0x1707('0x1')]('CreateWhatsappMessage',{'body':_0x1a5499,'log':_0x1707('0x2')});}; \ No newline at end of file +var _0x282d=['create','CreateWhatsappMessage','createWhatsappMessage','../client'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x282d,0x14b));var _0xd282=function(_0x5e78d3,_0x460fe0){_0x5e78d3=_0x5e78d3-0x0;var _0x16c591=_0x282d[_0x5e78d3];return _0x16c591;};'use strict';var client=require(_0xd282('0x0'));exports[_0xd282('0x1')]=function(_0x3ea123){return client['Request'](_0xd282('0x2'),{'body':_0x3ea123,'log':_0xd282('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index a0db552..af90df8 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 _0x720a=['name','timeout','User','Agents','online','../client','getWhatsappQueues','GetWhatsappQueue'];(function(_0x59cc6b,_0xfb135a){var _0x28a0e7=function(_0x362594){while(--_0x362594){_0x59cc6b['push'](_0x59cc6b['shift']());}};_0x28a0e7(++_0xfb135a);}(_0x720a,0x17d));var _0xa720=function(_0x39f407,_0x361939){_0x39f407=_0x39f407-0x0;var _0x2f6ada=_0x720a[_0x39f407];return _0x2f6ada;};'use strict';var client=require(_0xa720('0x0'));exports[_0xa720('0x1')]=function(){return function(){return client['Request'](_0xa720('0x2'),{'options':{'raw':![],'attributes':['id',_0xa720('0x3'),_0xa720('0x4'),'strategy'],'include':[{'model':_0xa720('0x5'),'as':_0xa720('0x6'),'attributes':['id',_0xa720('0x3'),_0xa720('0x7'),'whatsappPause']}]},'log':'getWhatsappQueues'});};}; \ No newline at end of file +var _0xfff5=['Request','GetWhatsappQueue','timeout','strategy','name','online','whatsappPause','getWhatsappQueues'];(function(_0x5a477d,_0x1c822f){var _0x3d1f7b=function(_0x107712){while(--_0x107712){_0x5a477d['push'](_0x5a477d['shift']());}};_0x3d1f7b(++_0x1c822f);}(_0xfff5,0x180));var _0x5fff=function(_0x3ed287,_0x15ffaf){_0x3ed287=_0x3ed287-0x0;var _0x2e4a48=_0xfff5[_0x3ed287];return _0x2e4a48;};'use strict';var client=require('../client');exports['getWhatsappQueues']=function(){return function(){return client[_0x5fff('0x0')](_0x5fff('0x1'),{'options':{'raw':![],'attributes':['id','name',_0x5fff('0x2'),_0x5fff('0x3')],'include':[{'model':'User','as':'Agents','attributes':['id',_0x5fff('0x4'),_0x5fff('0x5'),_0x5fff('0x6')]}]},'log':_0x5fff('0x7')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 7310ed8..0cc9095 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 _0x9207=['Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','../client'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x9207,0x1f3));var _0x7920=function(_0x1edf2a,_0x55c423){_0x1edf2a=_0x1edf2a-0x0;var _0x5698f0=_0x9207[_0x1edf2a];return _0x5698f0;};'use strict';var client=require(_0x7920('0x0'));exports['create']=function(_0x55e86b){return client[_0x7920('0x1')](_0x7920('0x2'),{'body':_0x55e86b,'log':_0x7920('0x2')});};exports[_0x7920('0x3')]=function(_0x10b176,_0x14984f){return client[_0x7920('0x1')](_0x7920('0x4'),{'body':_0x14984f,'options':{'where':{'uniqueid':_0x10b176},'order':[['id','DESC']],'limit':0x1},'log':_0x7920('0x4')});}; \ No newline at end of file +var _0x2f40=['../client','create','Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','DESC'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2f40,0x157));var _0x02f4=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x2f40[_0x2dafbe];return _0x58a45a;};'use strict';var client=require(_0x02f4('0x0'));exports[_0x02f4('0x1')]=function(_0x31fbdd){return client[_0x02f4('0x2')]('CreateWhatsappQueueReport',{'body':_0x31fbdd,'log':_0x02f4('0x3')});};exports[_0x02f4('0x4')]=function(_0x2d5446,_0x449434){return client[_0x02f4('0x2')](_0x02f4('0x5'),{'body':_0x449434,'options':{'where':{'uniqueid':_0x2d5446},'order':[['id',_0x02f4('0x6')]],'limit':0x1},'log':'UpdateWhatsappQueueReport'});}; \ 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 e97ea2e..e04118c 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 _0xc0de=['seq-queue','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','format','name','toLowerCase','consequence','length','error','map','join','stop','find','agents','timeout','createQueue','atimeout','channel','rules','info','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][QUEUE]\x20%s','stack','validate','util'];(function(_0x47c39d,_0x3eea90){var _0xd41416=function(_0x24d049){while(--_0x24d049){_0x47c39d['push'](_0x47c39d['shift']());}};_0xd41416(++_0x3eea90);}(_0xc0de,0x11e));var _0xec0d=function(_0x18e5c3,_0x569c0b){_0x18e5c3=_0x18e5c3-0x0;var _0x11dcb3=_0xc0de[_0x18e5c3];return _0x11dcb3;};'use strict';var schema=require(_0xec0d('0x0'));var _=require('lodash');var util=require(_0xec0d('0x1'));var seqqueue=require(_0xec0d('0x2'));var logger=require('../../../../config/logger')('routing');var strategy=require(_0xec0d('0x3'));var queue=schema({'name':{'type':_0xec0d('0x4'),'required':!![],'message':_0xec0d('0x5')},'timeout':{'type':_0xec0d('0x6'),'message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x1fb3a6,_0x562c1f,_0x124a6d){return logger['info'](util[_0xec0d('0x7')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x1fb3a6,_0x562c1f['name'],_0x124a6d));}function handleFindAgent(_0x3105bf){return function(_0x246c9e){return _0x246c9e[_0xec0d('0x8')]['toLowerCase']()===_0x3105bf[_0xec0d('0x9')]();};}exports[_0xec0d('0xa')]=function(_0xf62a5c,_0x2aad55,_0x35b9de,_0x5ab4ff){return function(_0x58dccf){try{var _0x52e542={'name':_0x2aad55[0x0],'timeout':_0x2aad55[0x1]};var _0xcae47e=queue[_0xec0d('0x0')](_0x52e542,{'typecast':!![]});if(_0xcae47e[_0xec0d('0xb')]){logger[_0xec0d('0xc')]('[%s][AGENT]\x20%s',_0xf62a5c,_[_0xec0d('0xd')](_0xcae47e,'message')[_0xec0d('0xe')](',\x20'));_0x58dccf[_0xec0d('0xf')]();}else{var _0x17349a=_[_0xec0d('0x10')](_0x35b9de[_0xec0d('0x11')],handleFindAgent(_0x52e542[_0xec0d('0x8')]));if(_0x17349a){var _0x384222=(_0x52e542[_0xec0d('0x12')]||0xa)*0x3e8;var _0x4bf9bc,_0x29a5ed;var _0x194282=seqqueue[_0xec0d('0x13')](_0x384222);_0x194282['id']=_0xf62a5c;_0x194282[_0xec0d('0x14')]=_0x384222;_0x194282[_0xec0d('0x15')]=_0x5ab4ff[_0xec0d('0x15')];writeLog(_0xf62a5c,_0x17349a,util[_0xec0d('0x7')]('START:%s',_0x384222));_0x35b9de[_0xec0d('0x16')][_0xf62a5c]['on']('end',function(){logger[_0xec0d('0x17')](_0xec0d('0x18'),_0xf62a5c);clearTimeout(_0x29a5ed);_0x29a5ed=undefined;_0x194282[_0xec0d('0x19')]();if(_0x35b9de['rules'][_0xf62a5c]){delete _0x35b9de[_0xec0d('0x16')][_0xf62a5c];}_0x58dccf[_0xec0d('0xf')]();});_0x35b9de['rules'][_0xf62a5c]['on'](_0xec0d('0x1a'),function(){if(_0x35b9de[_0xec0d('0x16')][_0xf62a5c]){delete _0x35b9de[_0xec0d('0x16')][_0xf62a5c];}});_0x29a5ed=setTimeout(function(){logger[_0xec0d('0x17')](_0xec0d('0x1b'),_0xf62a5c);clearTimeout(_0x29a5ed);_0x194282['close']();_0x58dccf[_0xec0d('0x1c')]();},_0x384222);strategy[_0xec0d('0x1d')](_0x194282,_0x17349a,_0x35b9de,_0x5ab4ff);}else{logger['error']('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0xf62a5c,_0x52e542['name']);_0x58dccf[_0xec0d('0xf')]();}}}catch(_0x1c0cdc){console['log'](_0x1c0cdc);logger[_0xec0d('0xc')](_0xec0d('0x1e'),_0xf62a5c,_0x1c0cdc[_0xec0d('0x1f')]);_0x58dccf[_0xec0d('0xf')]();}};}; \ No newline at end of file +var _0x3cdd=['name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','message','stop','find','agents','timeout','createQueue','atimeout','channel','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','validate','lodash','util','seq-queue','../../../../config/logger','./strategy','string'];(function(_0x1ad0c1,_0x2f5433){var _0x1b56ae=function(_0x44fcc2){while(--_0x44fcc2){_0x1ad0c1['push'](_0x1ad0c1['shift']());}};_0x1b56ae(++_0x2f5433);}(_0x3cdd,0x1b5));var _0xd3cd=function(_0xd9f2ce,_0x277721){_0xd9f2ce=_0xd9f2ce-0x0;var _0xb2dfd1=_0x3cdd[_0xd9f2ce];return _0xb2dfd1;};'use strict';var schema=require(_0xd3cd('0x0'));var _=require(_0xd3cd('0x1'));var util=require(_0xd3cd('0x2'));var seqqueue=require(_0xd3cd('0x3'));var logger=require(_0xd3cd('0x4'))('routing');var strategy=require(_0xd3cd('0x5'));var queue=schema({'name':{'type':_0xd3cd('0x6'),'required':!![],'message':_0xd3cd('0x7')},'timeout':{'type':_0xd3cd('0x8'),'message':_0xd3cd('0x9')}});function writeLog(_0x222352,_0x3fd341,_0x112b9b){return logger[_0xd3cd('0xa')](util[_0xd3cd('0xb')](_0xd3cd('0xc'),_0x222352,_0x3fd341['name'],_0x112b9b));}function handleFindAgent(_0x48e81a){return function(_0x475066){return _0x475066[_0xd3cd('0xd')][_0xd3cd('0xe')]()===_0x48e81a['toLowerCase']();};}exports[_0xd3cd('0xf')]=function(_0x391572,_0x1a2f25,_0x5cc856,_0x4938b6){return function(_0x1b25b8){try{var _0x147eb1={'name':_0x1a2f25[0x0],'timeout':_0x1a2f25[0x1]};var _0x217652=queue[_0xd3cd('0x0')](_0x147eb1,{'typecast':!![]});if(_0x217652[_0xd3cd('0x10')]){logger[_0xd3cd('0x11')](_0xd3cd('0x12'),_0x391572,_['map'](_0x217652,_0xd3cd('0x13'))['join'](',\x20'));_0x1b25b8[_0xd3cd('0x14')]();}else{var _0x121993=_[_0xd3cd('0x15')](_0x5cc856[_0xd3cd('0x16')],handleFindAgent(_0x147eb1[_0xd3cd('0xd')]));if(_0x121993){var _0x36ea77=(_0x147eb1[_0xd3cd('0x17')]||0xa)*0x3e8;var _0x3d19d3,_0x18faf3;var _0x2bb28e=seqqueue[_0xd3cd('0x18')](_0x36ea77);_0x2bb28e['id']=_0x391572;_0x2bb28e[_0xd3cd('0x19')]=_0x36ea77;_0x2bb28e[_0xd3cd('0x1a')]=_0x4938b6[_0xd3cd('0x1a')];writeLog(_0x391572,_0x121993,util[_0xd3cd('0xb')]('START:%s',_0x36ea77));_0x5cc856[_0xd3cd('0x1b')][_0x391572]['on'](_0xd3cd('0x1c'),function(){logger[_0xd3cd('0xa')](_0xd3cd('0x1d'),_0x391572);clearTimeout(_0x18faf3);_0x18faf3=undefined;_0x2bb28e[_0xd3cd('0x1e')]();if(_0x5cc856[_0xd3cd('0x1b')][_0x391572]){delete _0x5cc856[_0xd3cd('0x1b')][_0x391572];}_0x1b25b8['stop']();});_0x5cc856['rules'][_0x391572]['on']('complete',function(){if(_0x5cc856[_0xd3cd('0x1b')][_0x391572]){delete _0x5cc856['rules'][_0x391572];}});_0x18faf3=setTimeout(function(){logger[_0xd3cd('0xa')](_0xd3cd('0x1f'),_0x391572);clearTimeout(_0x18faf3);_0x2bb28e[_0xd3cd('0x1e')]();_0x1b25b8[_0xd3cd('0x20')]();},_0x36ea77);strategy[_0xd3cd('0x21')](_0x2bb28e,_0x121993,_0x5cc856,_0x4938b6);}else{logger[_0xd3cd('0x11')](_0xd3cd('0x22'),_0x391572,_0x147eb1[_0xd3cd('0xd')]);_0x1b25b8[_0xd3cd('0x14')]();}}}catch(_0x3402ea){console[_0xd3cd('0x23')](_0x3402ea);logger[_0xd3cd('0x11')](_0xd3cd('0x24'),_0x391572,_0x3402ea['stack']);_0x1b25b8['stop']();}};}; \ 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 4328913..d490057 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 _0xdaa4=['../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','info','[%s][AMAZONLEX]\x20%s','next','channel','sms','whatsapp','phone','interaction','chat','ChatWebsiteId','upperFirst','AccountId','account','created','body','Message','create','then','catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','toString','postText','amazonlex','Failed','aws-sdk','routing'];(function(_0x21e13b,_0x400a1){var _0x352262=function(_0x2dfb1e){while(--_0x2dfb1e){_0x21e13b['push'](_0x21e13b['shift']());}};_0x352262(++_0x400a1);}(_0xdaa4,0xc1));var _0x4daa=function(_0x5e09ed,_0x3a2790){_0x5e09ed=_0x5e09ed-0x0;var _0x553ad6=_0xdaa4[_0x5e09ed];return _0x553ad6;};'use strict';var _=require('lodash');var moment=require('moment');var AWS=require(_0x4daa('0x0'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0x4daa('0x1'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x4daa('0x2')),'mailMessage':require(_0x4daa('0x3')),'smsMessage':require(_0x4daa('0x4')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x4daa('0x5'))};exports[_0x4daa('0x6')]=function(_0x3cc5b6,_0x21d3e0){return function(_0x1d2e81){try{if(!_['isNil'](this['interaction']['UserId'])){logger[_0x4daa('0x7')](_0x4daa('0x8'),_0x3cc5b6,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x1d2e81[_0x4daa('0x9')]();}var _0x491006={'ContactId':this['contact']['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};if(this[_0x4daa('0xa')]===_0x4daa('0xb')||this[_0x4daa('0xa')]===_0x4daa('0xc')){_0x491006[_0x4daa('0xd')]=this[_0x4daa('0xe')][_0x4daa('0xd')];}var _0xc286d5=this['channel'];if(_0xc286d5===_0x4daa('0xf')){_0x491006[_0x4daa('0x10')]=this['account']['id'];}else{_0x491006[_[_0x4daa('0x11')](_0xc286d5)+_0x4daa('0x12')]=this[_0x4daa('0x13')]['id'];}_0x491006[_[_0x4daa('0x11')](_0xc286d5)+'InteractionId']=this['interaction']['id'];if(this[_0x4daa('0xe')][_0x4daa('0x14')]){var _0x1ef970=_0x21d3e0[0x4];if(!_['isEmpty'](_0x1ef970)){_0x491006[_0x4daa('0x15')]=utils['getMustacheRender'](_0x1ef970,this);return rpc[_0xc286d5+_0x4daa('0x16')][_0x4daa('0x17')](_0x491006)[_0x4daa('0x18')](function(_0x3fb23f){logger[_0x4daa('0x7')](_0x4daa('0x8'),_0x3cc5b6,_0x491006[_0x4daa('0x15')]);})[_0x4daa('0x19')](function(_0x42a2a7){logger[_0x4daa('0x1a')]('[%s][AMAZONLEX]\x20%s',_0x3cc5b6,JSON[_0x4daa('0x1b')](_0x42a2a7));})[_0x4daa('0x1c')](function(){logger[_0x4daa('0x7')](_0x4daa('0x1d'),_0x3cc5b6);_0x1d2e81[_0x4daa('0x1e')]();});}else{logger[_0x4daa('0x7')](_0x4daa('0x1f'),_0x3cc5b6);_0x1d2e81['stop']();}}else{var _0x40f27d=this;var _0x2655fc=new AWS[(_0x4daa('0x20'))]({'accessKeyId':_0x21d3e0[0x0],'secretAccessKey':_0x21d3e0[0x1],'region':_0x21d3e0[0x2]});var _0xd37ecf={'botAlias':_0x4daa('0x21'),'botName':_0x21d3e0[0x3],'inputText':this[_0x4daa('0x22')]['body'],'userId':this['channel']+':'+this[_0x4daa('0xe')]['id'][_0x4daa('0x23')]()};_0x2655fc[_0x4daa('0x24')](_0xd37ecf,function(_0x1857ab,_0xfd33ec){if(_0x1857ab){logger['error']('[%s][AMAZONLEX]\x20%s',_0x3cc5b6,_0x1857ab[_0x4daa('0x22')]);_0x1d2e81[_0x4daa('0x9')]();}else if(_0xfd33ec&&_0xfd33ec[_0x4daa('0x22')]){_0x40f27d[_0x4daa('0x15')]['amazonlex']=_0xfd33ec;_0x491006[_0x4daa('0x15')]=_0xfd33ec[_0x4daa('0x22')];_0x491006['providerName']=_0x4daa('0x25');_0x491006['providerResponse']=JSON['stringify'](_0xfd33ec);return rpc[_0xc286d5+'Message'][_0x4daa('0x17')](_0x491006)[_0x4daa('0x18')](function(_0x3b582a){logger['info'](_0x4daa('0x8'),_0x3cc5b6,_0x491006[_0x4daa('0x15')]);if(_0xfd33ec['dialogState']==_0x4daa('0x26')){_0x1d2e81[_0x4daa('0x9')]();}else{_0x1d2e81[_0x4daa('0x1e')]();}})[_0x4daa('0x19')](function(_0x1118ee){logger[_0x4daa('0x1a')](_0x4daa('0x8'),_0x3cc5b6,JSON[_0x4daa('0x1b')](_0x1118ee));_0x1d2e81[_0x4daa('0x9')]();});}else{_0x1d2e81[_0x4daa('0x9')]();}});}}catch(_0x43030e){logger[_0x4daa('0x1a')](_0x4daa('0x8'),_0x3cc5b6,JSON[_0x4daa('0x1b')](_0x43030e));_0x1d2e81[_0x4daa('0x1e')]();}};}; \ No newline at end of file +var _0xc39b=['phone','chat','ChatWebsiteId','account','upperFirst','AccountId','created','isEmpty','body','getMustacheRender','create','then','error','stringify','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','toString','postText','message','amazonlex','providerName','providerResponse','Message','dialogState','moment','../../../../config/logger','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','YYYY-MM-DD\x20HH:mm:ss','channel','sms'];(function(_0x2b8e3c,_0x3c12c9){var _0xdfb0bc=function(_0x523082){while(--_0x523082){_0x2b8e3c['push'](_0x2b8e3c['shift']());}};_0xdfb0bc(++_0x3c12c9);}(_0xc39b,0xc6));var _0xbc39=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0xc39b[_0x4792c8];return _0x35edb1;};'use strict';var _=require('lodash');var moment=require(_0xbc39('0x0'));var AWS=require('aws-sdk');var utils=require('./utils');var logger=require(_0xbc39('0x1'))('routing');var rpc={'chatMessage':require(_0xbc39('0x2')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xbc39('0x3')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xbc39('0x4')),'whatsappMessage':require(_0xbc39('0x5'))};exports['consequence']=function(_0x506c95,_0x16f759){return function(_0xf25523){try{if(!_[_0xbc39('0x6')](this[_0xbc39('0x7')][_0xbc39('0x8')])){logger[_0xbc39('0x9')](_0xbc39('0xa'),_0x506c95,_0xbc39('0xb'));return _0xf25523[_0xbc39('0xc')]();}var _0x3c001a={'ContactId':this[_0xbc39('0xd')]['id'],'sentAt':moment()['format'](_0xbc39('0xe')),'direction':'out'};if(this[_0xbc39('0xf')]===_0xbc39('0x10')||this['channel']==='whatsapp'){_0x3c001a[_0xbc39('0x11')]=this[_0xbc39('0x7')][_0xbc39('0x11')];}var _0x246bcd=this[_0xbc39('0xf')];if(_0x246bcd===_0xbc39('0x12')){_0x3c001a[_0xbc39('0x13')]=this[_0xbc39('0x14')]['id'];}else{_0x3c001a[_[_0xbc39('0x15')](_0x246bcd)+_0xbc39('0x16')]=this['account']['id'];}_0x3c001a[_[_0xbc39('0x15')](_0x246bcd)+'InteractionId']=this['interaction']['id'];if(this[_0xbc39('0x7')][_0xbc39('0x17')]){var _0x2dbd09=_0x16f759[0x4];if(!_[_0xbc39('0x18')](_0x2dbd09)){_0x3c001a[_0xbc39('0x19')]=utils[_0xbc39('0x1a')](_0x2dbd09,this);return rpc[_0x246bcd+'Message'][_0xbc39('0x1b')](_0x3c001a)[_0xbc39('0x1c')](function(_0x159b51){logger[_0xbc39('0x9')](_0xbc39('0xa'),_0x506c95,_0x3c001a[_0xbc39('0x19')]);})['catch'](function(_0x34aa1d){logger[_0xbc39('0x1d')](_0xbc39('0xa'),_0x506c95,JSON[_0xbc39('0x1e')](_0x34aa1d));})['finally'](function(){logger['info'](_0xbc39('0x1f'),_0x506c95);_0xf25523[_0xbc39('0x20')]();});}else{logger['info'](_0xbc39('0x21'),_0x506c95);_0xf25523[_0xbc39('0x20')]();}}else{var _0x13be65=this;var _0x94687b=new AWS[(_0xbc39('0x22'))]({'accessKeyId':_0x16f759[0x0],'secretAccessKey':_0x16f759[0x1],'region':_0x16f759[0x2]});var _0x4edb96={'botAlias':'$LATEST','botName':_0x16f759[0x3],'inputText':this['message'][_0xbc39('0x19')],'userId':this[_0xbc39('0xf')]+':'+this[_0xbc39('0x7')]['id'][_0xbc39('0x23')]()};_0x94687b[_0xbc39('0x24')](_0x4edb96,function(_0x225402,_0x579c61){if(_0x225402){logger[_0xbc39('0x1d')](_0xbc39('0xa'),_0x506c95,_0x225402[_0xbc39('0x25')]);_0xf25523[_0xbc39('0xc')]();}else if(_0x579c61&&_0x579c61['message']){_0x13be65[_0xbc39('0x19')][_0xbc39('0x26')]=_0x579c61;_0x3c001a[_0xbc39('0x19')]=_0x579c61['message'];_0x3c001a[_0xbc39('0x27')]=_0xbc39('0x26');_0x3c001a[_0xbc39('0x28')]=JSON[_0xbc39('0x1e')](_0x579c61);return rpc[_0x246bcd+_0xbc39('0x29')]['create'](_0x3c001a)[_0xbc39('0x1c')](function(_0x369ee6){logger[_0xbc39('0x9')]('[%s][AMAZONLEX]\x20%s',_0x506c95,_0x3c001a[_0xbc39('0x19')]);if(_0x579c61[_0xbc39('0x2a')]=='Failed'){_0xf25523[_0xbc39('0xc')]();}else{_0xf25523[_0xbc39('0x20')]();}})['catch'](function(_0x428245){logger[_0xbc39('0x1d')](_0xbc39('0xa'),_0x506c95,JSON['stringify'](_0x428245));_0xf25523['next']();});}else{_0xf25523['next']();}});}}catch(_0x32e7d1){logger['error'](_0xbc39('0xa'),_0x506c95,JSON['stringify'](_0x32e7d1));_0xf25523[_0xbc39('0x20')]();}};}; \ 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 e832be5..6f03f5a 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 _0x77f0=['message','from','mail','phone','read','subject','startsWith','chat','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','Message','Smtp','service','host','port','secure','authentication','auth','messageId','html','replace','','auto-replied','All','sendMailMessage','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','autoreplyExecuted','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','resolve','Interaction','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','isNil','interaction','created','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','getMustacheRender','body'];(function(_0x51fddd,_0xbf504d){var _0x29b515=function(_0x1c4775){while(--_0x1c4775){_0x51fddd['push'](_0x51fddd['shift']());}};_0x29b515(++_0xbf504d);}(_0x77f0,0x102));var _0x077f=function(_0x1fc122,_0x5e2c17){_0x1fc122=_0x1fc122-0x0;var _0xa2cb13=_0x77f0[_0x1fc122];return _0xa2cb13;};'use strict';var _=require('lodash');var moment=require(_0x077f('0x0'));var utils=require(_0x077f('0x1'));var logger=require(_0x077f('0x2'))(_0x077f('0x3'));var rpc={'chatMessage':require(_0x077f('0x4')),'openchannelMessage':require(_0x077f('0x5')),'mailMessage':require(_0x077f('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x077f('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require(_0x077f('0x8')),'openchannelInteraction':require(_0x077f('0x9')),'mailInteraction':require(_0x077f('0xa')),'smsInteraction':require(_0x077f('0xb')),'faxInteraction':require(_0x077f('0xc')),'whatsappInteraction':require(_0x077f('0xd'))};var mailRpc=require('../../mailRpc');exports[_0x077f('0xe')]=function(_0x547981,_0x28f3c1){return function(_0x55f50e){try{if(_0x28f3c1[0x0]==='1'&&(_[_0x077f('0xf')](this[_0x077f('0x10')]['created'])||!this['interaction'][_0x077f('0x11')])){logger[_0x077f('0x12')](_0x077f('0x13'),_0x547981,_0x077f('0x14'));return _0x55f50e['next']();}if(_0x28f3c1[0x0]==='2'&&this['interaction']['autoreplyExecuted']){logger[_0x077f('0x12')](_0x077f('0x15'),_0x547981,'One\x20Time\x20already\x20sent');return _0x55f50e[_0x077f('0x16')]();}var _0x3ea9bc=this['channel'];var _0x347b22={'ContactId':this[_0x077f('0x17')]['id'],'sentAt':moment()[_0x077f('0x18')](_0x077f('0x19')),'direction':_0x077f('0x1a')};if(this[_0x077f('0x1b')]==='mail'){_0x347b22['body']=utils[_0x077f('0x1c')](_0x28f3c1[0x2],this);}else{_0x347b22[_0x077f('0x1d')]=utils[_0x077f('0x1c')](_0x28f3c1[0x1],this);}if(this[_0x077f('0x1e')]){_0x347b22['to']=this[_0x077f('0x1e')][_0x077f('0x1f')]||'';if(this[_0x077f('0x1b')]===_0x077f('0x20')&&_0x28f3c1[0x1]==='1'){_0x347b22['cc']=this[_0x077f('0x1e')]['cc']||'';}_0x347b22[_0x077f('0x1f')]=this['message']['to']||'';_0x347b22[_0x077f('0x21')]=this[_0x077f('0x1e')]['phone']||'';_0x347b22[_0x077f('0x22')]=!![];if(this[_0x077f('0x1e')][_0x077f('0x23')]){_0x347b22[_0x077f('0x23')]='';_0x347b22[_0x077f('0x23')]+=_[_0x077f('0x24')](this[_0x077f('0x1e')][_0x077f('0x23')],'Re:')?'':'Re:\x20';_0x347b22[_0x077f('0x23')]+=this['message'][_0x077f('0x23')];}}if(this[_0x077f('0x1b')]===_0x077f('0x25')){_0x347b22[_0x077f('0x26')]=this['account']['id'];}else{_0x347b22[_[_0x077f('0x27')](this[_0x077f('0x1b')])+_0x077f('0x28')]=this[_0x077f('0x29')]['id'];}_0x347b22[_['upperFirst'](this['channel'])+_0x077f('0x2a')]=this[_0x077f('0x10')]['id'];var _0x5390ef=this[_0x077f('0x10')];if(rpc[this[_0x077f('0x1b')]+_0x077f('0x2b')]){if(this[_0x077f('0x1b')]===_0x077f('0x20')){var _0x49b73d={'tls':{'rejectUnauthorized':![]}};if(this[_0x077f('0x29')][_0x077f('0x2c')][_0x077f('0x2d')]){_0x49b73d[_0x077f('0x2d')]=this[_0x077f('0x29')][_0x077f('0x2c')]['service'];}else{_0x49b73d[_0x077f('0x2e')]=this[_0x077f('0x29')][_0x077f('0x2c')][_0x077f('0x2e')];_0x49b73d['port']=this[_0x077f('0x29')][_0x077f('0x2c')][_0x077f('0x2f')];_0x49b73d[_0x077f('0x30')]=this[_0x077f('0x29')][_0x077f('0x2c')][_0x077f('0x30')];}if(this['account']['Smtp'][_0x077f('0x31')]){_0x49b73d[_0x077f('0x32')]={'user':this[_0x077f('0x29')]['Smtp']['user'],'pass':this[_0x077f('0x29')][_0x077f('0x2c')]['pass']};}_0x347b22['inReplyTo']=this['message'][_0x077f('0x33')];_0x347b22[_0x077f('0x34')]=''+_[_0x077f('0x35')](_0x347b22[_0x077f('0x1d')],''+_[_0xd089('0x34')](_0xfbeb5d[_0xd089('0x19')],_0xd089('0x35'),'';_0xfbeb5d[_0xd089('0x36')]={'Auto-Submitted':_0xd089('0x37'),'X-Auto-Response-Suppress':_0xd089('0x38'),'Precedence':'auto_reply'};return mailRpc[_0xd089('0x39')](_0x2b9c2b,_0xfbeb5d)[_0xd089('0x3a')](function(_0x39e0d5){logger[_0xd089('0xf')](_0xd089('0x3b'),_0x21d3ae);_0xfbeb5d[_0xd089('0x32')]=_0x39e0d5[_0xd089('0x1b')][_0xd089('0x32')];return rpc[_0x18b2e1+_0xd089('0x28')][_0xd089('0x3c')](_0xfbeb5d);})[_0xd089('0x3a')](function(_0x4e7752){logger[_0xd089('0xf')](_0xd089('0x10'),_0x21d3ae,JSON[_0xd089('0x3d')](_0x4e7752));})['catch'](function(_0x21866a){logger[_0xd089('0x3e')](_0xd089('0x3f'),_0x21d3ae,JSON[_0xd089('0x3d')](_0x21866a));})[_0xd089('0x40')](function(){Promise[_0xd089('0x41')]()[_0xd089('0x3a')](function(){if(_0x22ed04[0x0]!=='2'||_0x4d155b['autoreplyExecuted'])return;return rpc[_0x18b2e1+_0xd089('0x42')]['update'](_0x4d155b['id'],{'autoreplyExecuted':!![]})['then'](function(_0x216041){logger['info']('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x21d3ae,JSON['stringify'](_0x216041));})[_0xd089('0x43')](function(_0x537aee){logger[_0xd089('0x3e')]('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x21d3ae,JSON[_0xd089('0x3d')](_0x537aee));});})[_0xd089('0x3a')](function(){_0x29d893['next']();});});}else{return rpc[this[_0xd089('0x17')]+_0xd089('0x28')][_0xd089('0x3c')](_0xfbeb5d)[_0xd089('0x3a')](function(_0x556cdd){logger[_0xd089('0xf')](_0xd089('0x10'),_0x21d3ae,_0xfbeb5d[_0xd089('0x19')]);})['catch'](function(_0x5a0635){logger['error'](_0xd089('0x10'),_0x21d3ae,JSON[_0xd089('0x3d')](_0x5a0635));})[_0xd089('0x40')](function(){Promise[_0xd089('0x41')]()[_0xd089('0x3a')](function(){if(_0x22ed04[0x0]!=='2'||_0x4d155b[_0xd089('0x12')])return;return rpc[_0x18b2e1+'Interaction'][_0xd089('0x44')](_0x4d155b['id'],{'autoreplyExecuted':!![]})[_0xd089('0x3a')](function(_0x4bd19d){logger[_0xd089('0xf')](_0xd089('0x13'),_0x21d3ae,JSON[_0xd089('0x3d')](_0x4bd19d));})[_0xd089('0x43')](function(_0x4701dd){logger['error']('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x21d3ae,JSON[_0xd089('0x3d')](_0x4701dd));});})['then'](function(){_0x29d893[_0xd089('0x11')]();});});}}}catch(_0x3b15a5){logger['error'](_0xd089('0x10'),_0x21d3ae,JSON['stringify'](_0x3b15a5));_0x29d893['stop']();}};}; \ 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 60ccb14..2f2b014 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 _0x2a5c=['channel','Interaction','update','interaction','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','stringify','stop','[%s][CLOSE]\x20%s','moment','../../../../config/logger','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','format','YYYY-MM-DD\x20HH:mm:ss','system'];(function(_0x407ce0,_0x507e0e){var _0x5cb371=function(_0x33cadf){while(--_0x33cadf){_0x407ce0['push'](_0x407ce0['shift']());}};_0x5cb371(++_0x507e0e);}(_0x2a5c,0x1bf));var _0xc2a5=function(_0x23e1ec,_0x590c91){_0x23e1ec=_0x23e1ec-0x0;var _0x5e9893=_0x2a5c[_0x23e1ec];return _0x5e9893;};'use strict';var moment=require(_0xc2a5('0x0'));var logger=require(_0xc2a5('0x1'))('routing');var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0xc2a5('0x2')),'smsInteraction':require(_0xc2a5('0x3')),'mailInteraction':require(_0xc2a5('0x4')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0xc2a5('0x5'))};exports['consequence']=function(_0x5a3ed5,_0x5a05a1,_0x3e4604,_0x159195){return function(_0x218a6f){try{logger['info']('[%s][CLOSE]\x20reason\x20%s',_0x5a3ed5,_0x5a05a1[0x0]);var _0x1da263={'closed':0x1,'closedAt':moment()[_0xc2a5('0x6')](_0xc2a5('0x7')),'closeReason':_0xc2a5('0x8'),'disposition':_0x5a05a1[0x0]};if(rpc[_0x159195[_0xc2a5('0x9')]+'Interaction']){rpc[_0x159195[_0xc2a5('0x9')]+_0xc2a5('0xa')][_0xc2a5('0xb')](_0x159195[_0xc2a5('0xc')]['id'],_0x1da263)['then'](function(_0x5c7d68){logger['info'](_0xc2a5('0xd'),_0x5a3ed5,_0x159195[_0xc2a5('0xc')]['id']);})[_0xc2a5('0xe')](function(_0x4fe8da){logger[_0xc2a5('0xf')]('[%s][CLOSE]\x20%s',_0x5a3ed5,JSON[_0xc2a5('0x10')](_0x4fe8da));})['finally'](function(){_0x218a6f[_0xc2a5('0x11')]();});}}catch(_0x2d33b5){logger[_0xc2a5('0xf')](_0xc2a5('0x12'),_0x5a3ed5,JSON[_0xc2a5('0x10')](_0x2d33b5));_0x218a6f[_0xc2a5('0x11')]();}};}; \ No newline at end of file +var _0x9239=['../../rpc/mailInteraction','../../rpc/whatsappInteraction','consequence','[%s][CLOSE]\x20reason\x20%s','format','system','channel','Interaction','update','interaction','then','info','error','[%s][CLOSE]\x20%s','stringify','finally','stop','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction'];(function(_0x4a1311,_0xc62539){var _0x2fa504=function(_0x402f98){while(--_0x402f98){_0x4a1311['push'](_0x4a1311['shift']());}};_0x2fa504(++_0xc62539);}(_0x9239,0x1dd));var _0x9923=function(_0x326d50,_0x22de26){_0x326d50=_0x326d50-0x0;var _0x1dfdf9=_0x9239[_0x326d50];return _0x1dfdf9;};'use strict';var moment=require(_0x9923('0x0'));var logger=require(_0x9923('0x1'))(_0x9923('0x2'));var rpc={'chatInteraction':require(_0x9923('0x3')),'openchannelInteraction':require(_0x9923('0x4')),'smsInteraction':require(_0x9923('0x5')),'mailInteraction':require(_0x9923('0x6')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x9923('0x7'))};exports[_0x9923('0x8')]=function(_0x50ccdd,_0x1c89de,_0x4bf81e,_0x4c253e){return function(_0x5c5a37){try{logger['info'](_0x9923('0x9'),_0x50ccdd,_0x1c89de[0x0]);var _0x1a4cf0={'closed':0x1,'closedAt':moment()[_0x9923('0xa')]('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':_0x9923('0xb'),'disposition':_0x1c89de[0x0]};if(rpc[_0x4c253e[_0x9923('0xc')]+_0x9923('0xd')]){rpc[_0x4c253e['channel']+_0x9923('0xd')][_0x9923('0xe')](_0x4c253e[_0x9923('0xf')]['id'],_0x1a4cf0)[_0x9923('0x10')](function(_0x22ef19){logger[_0x9923('0x11')]('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x50ccdd,_0x4c253e[_0x9923('0xf')]['id']);})['catch'](function(_0x305dc1){logger[_0x9923('0x12')](_0x9923('0x13'),_0x50ccdd,JSON[_0x9923('0x14')](_0x305dc1));})[_0x9923('0x15')](function(){_0x5c5a37['stop']();});}}catch(_0x34ad23){logger[_0x9923('0x12')](_0x9923('0x13'),_0x50ccdd,JSON[_0x9923('0x14')](_0x34ad23));_0x5c5a37[_0x9923('0x16')]();}};}; \ 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 d979cf8..7267b4f 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 _0xd7c3=['routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','body','create','then','catch','stringify','finally','[%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','result','fulfillment','speech','providerName','providerResponse','endConversation','error','lodash','moment','apiai-promise','md5','./utils','../../../../config/logger'];(function(_0x15fc3c,_0x35665b){var _0x94c5c8=function(_0xbab268){while(--_0xbab268){_0x15fc3c['push'](_0x15fc3c['shift']());}};_0x94c5c8(++_0x35665b);}(_0xd7c3,0x1c5));var _0x3d7c=function(_0x5ccee2,_0x5cdd28){_0x5ccee2=_0x5ccee2-0x0;var _0xd2564c=_0xd7c3[_0x5ccee2];return _0xd2564c;};'use strict';var _=require(_0x3d7c('0x0'));var moment=require(_0x3d7c('0x1'));var apiai=require(_0x3d7c('0x2'));var md5=require(_0x3d7c('0x3'));var utils=require(_0x3d7c('0x4'));var logger=require(_0x3d7c('0x5'))(_0x3d7c('0x6'));var rpc={'chatMessage':require(_0x3d7c('0x7')),'openchannelMessage':require(_0x3d7c('0x8')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x3d7c('0x9')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0xeccebe,_0x1047f5){return function(_0x3416dd){try{if(!_[_0x3d7c('0xa')](this[_0x3d7c('0xb')][_0x3d7c('0xc')])){logger[_0x3d7c('0xd')](_0x3d7c('0xe'),_0xeccebe,_0x3d7c('0xf'));return _0x3416dd[_0x3d7c('0x10')]();}var _0x222e27={'ContactId':this[_0x3d7c('0x11')]['id'],'sentAt':moment()[_0x3d7c('0x12')](_0x3d7c('0x13')),'direction':_0x3d7c('0x14')};if(this[_0x3d7c('0x15')]===_0x3d7c('0x16')||this[_0x3d7c('0x15')]==='whatsapp'){_0x222e27[_0x3d7c('0x17')]=this[_0x3d7c('0xb')][_0x3d7c('0x17')];}var _0x223ae1=this[_0x3d7c('0x15')];if(_0x223ae1===_0x3d7c('0x18')){_0x222e27[_0x3d7c('0x19')]=this[_0x3d7c('0x1a')]['id'];}else{_0x222e27[_[_0x3d7c('0x1b')](_0x223ae1)+_0x3d7c('0x1c')]=this[_0x3d7c('0x1a')]['id'];}_0x222e27[_[_0x3d7c('0x1b')](_0x223ae1)+_0x3d7c('0x1d')]=this[_0x3d7c('0xb')]['id'];if(this[_0x3d7c('0xb')][_0x3d7c('0x1e')]){var _0x4cf556=_0x1047f5[0x2];if(!_[_0x3d7c('0x1f')](_0x4cf556)){_0x222e27[_0x3d7c('0x20')]=utils['getMustacheRender'](_0x4cf556,this);return rpc[_0x223ae1+'Message'][_0x3d7c('0x21')](_0x222e27)[_0x3d7c('0x22')](function(_0x323204){logger[_0x3d7c('0xd')]('[%s][DIALOGFLOW]\x20%s',_0xeccebe,_0x222e27[_0x3d7c('0x20')]);})[_0x3d7c('0x23')](function(_0x3ebe2a){logger['error'](_0x3d7c('0xe'),_0xeccebe,JSON[_0x3d7c('0x24')](_0x3ebe2a));})[_0x3d7c('0x25')](function(){logger[_0x3d7c('0xd')](_0x3d7c('0x26'),_0xeccebe);_0x3416dd[_0x3d7c('0x27')]();});}else{logger[_0x3d7c('0xd')](_0x3d7c('0x28'),_0xeccebe);_0x3416dd[_0x3d7c('0x27')]();}}else{var _0x4c977f=this;var _0x126c5e=apiai(_0x1047f5[0x0],{'language':_0x1047f5[0x1]||'en'});return _0x126c5e[_0x3d7c('0x29')](this[_0x3d7c('0x2a')][_0x3d7c('0x20')],{'sessionId':md5(this['interaction']['id'])})['then'](function(_0x3518c9){_0x4c977f[_0x3d7c('0x20')][_0x3d7c('0x2b')]=_0x3518c9;_0x222e27[_0x3d7c('0x20')]=_0x3518c9[_0x3d7c('0x2c')][_0x3d7c('0x2d')][_0x3d7c('0x2e')];_0x222e27[_0x3d7c('0x2f')]=_0x3d7c('0x2b');_0x222e27[_0x3d7c('0x30')]=JSON[_0x3d7c('0x24')](_0x3518c9);return rpc[_0x223ae1+'Message']['create'](_0x222e27)[_0x3d7c('0x22')](function(_0x21137a){logger['info'](_0x3d7c('0xe'),_0xeccebe,_0x222e27[_0x3d7c('0x20')]);if(_0x3518c9[_0x3d7c('0x2c')]['metadata'][_0x3d7c('0x31')]){_0x3416dd[_0x3d7c('0x10')]();}else{_0x3416dd[_0x3d7c('0x27')]();}})[_0x3d7c('0x23')](function(_0x257dde){logger['error'](_0x3d7c('0xe'),_0xeccebe,JSON[_0x3d7c('0x24')](_0x257dde));_0x3416dd[_0x3d7c('0x10')]();});})['catch'](function(_0x77d399){logger[_0x3d7c('0x32')](_0x3d7c('0xe'),_0xeccebe,_0x77d399[_0x3d7c('0x2a')]);_0x3416dd[_0x3d7c('0x10')]();});}}catch(_0xb3eb39){logger['error']('[%s][DIALOGFLOW]\x20%s',_0xeccebe,JSON[_0x3d7c('0x24')](_0xb3eb39));_0x3416dd[_0x3d7c('0x27')]();}};}; \ No newline at end of file +var _0x9851=['result','fulfillment','speech','providerName','providerResponse','stringify','endConversation','lodash','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','interaction','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','account','upperFirst','InteractionId','body','Message','create','then','[%s][DIALOGFLOW]\x20%s','catch','error','finally','[%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'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9851,0x1f1));var _0x1985=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9851[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1985('0x0'));var moment=require('moment');var apiai=require(_0x1985('0x1'));var md5=require(_0x1985('0x2'));var utils=require(_0x1985('0x3'));var logger=require(_0x1985('0x4'))(_0x1985('0x5'));var rpc={'chatMessage':require(_0x1985('0x6')),'openchannelMessage':require(_0x1985('0x7')),'mailMessage':require(_0x1985('0x8')),'smsMessage':require(_0x1985('0x9')),'faxMessage':require(_0x1985('0xa')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x1985('0xb')]=function(_0x8a5919,_0x310f2e){return function(_0x50eea1){try{if(!_[_0x1985('0xc')](this[_0x1985('0xd')]['UserId'])){logger[_0x1985('0xe')]('[%s][DIALOGFLOW]\x20%s',_0x8a5919,_0x1985('0xf'));return _0x50eea1[_0x1985('0x10')]();}var _0x2d8c61={'ContactId':this[_0x1985('0x11')]['id'],'sentAt':moment()[_0x1985('0x12')](_0x1985('0x13')),'direction':_0x1985('0x14')};if(this[_0x1985('0x15')]===_0x1985('0x16')||this[_0x1985('0x15')]===_0x1985('0x17')){_0x2d8c61[_0x1985('0x18')]=this['interaction'][_0x1985('0x18')];}var _0x2390aa=this['channel'];if(_0x2390aa==='chat'){_0x2d8c61['ChatWebsiteId']=this[_0x1985('0x19')]['id'];}else{_0x2d8c61[_[_0x1985('0x1a')](_0x2390aa)+'AccountId']=this[_0x1985('0x19')]['id'];}_0x2d8c61[_[_0x1985('0x1a')](_0x2390aa)+_0x1985('0x1b')]=this['interaction']['id'];if(this[_0x1985('0xd')]['created']){var _0x275b29=_0x310f2e[0x2];if(!_['isEmpty'](_0x275b29)){_0x2d8c61[_0x1985('0x1c')]=utils['getMustacheRender'](_0x275b29,this);return rpc[_0x2390aa+_0x1985('0x1d')][_0x1985('0x1e')](_0x2d8c61)[_0x1985('0x1f')](function(_0x433a33){logger[_0x1985('0xe')](_0x1985('0x20'),_0x8a5919,_0x2d8c61[_0x1985('0x1c')]);})[_0x1985('0x21')](function(_0x54f2a8){logger[_0x1985('0x22')](_0x1985('0x20'),_0x8a5919,JSON['stringify'](_0x54f2a8));})[_0x1985('0x23')](function(){logger[_0x1985('0xe')](_0x1985('0x24'),_0x8a5919);_0x50eea1[_0x1985('0x25')]();});}else{logger[_0x1985('0xe')](_0x1985('0x26'),_0x8a5919);_0x50eea1[_0x1985('0x25')]();}}else{var _0x290c1a=this;var _0x2e648a=apiai(_0x310f2e[0x0],{'language':_0x310f2e[0x1]||'en'});return _0x2e648a[_0x1985('0x27')](this[_0x1985('0x28')]['body'],{'sessionId':md5(this[_0x1985('0xd')]['id'])})[_0x1985('0x1f')](function(_0x42889c){_0x290c1a[_0x1985('0x1c')][_0x1985('0x29')]=_0x42889c;_0x2d8c61['body']=_0x42889c[_0x1985('0x2a')][_0x1985('0x2b')][_0x1985('0x2c')];_0x2d8c61[_0x1985('0x2d')]='dialogflow';_0x2d8c61[_0x1985('0x2e')]=JSON[_0x1985('0x2f')](_0x42889c);return rpc[_0x2390aa+_0x1985('0x1d')][_0x1985('0x1e')](_0x2d8c61)['then'](function(_0x5627ba){logger[_0x1985('0xe')](_0x1985('0x20'),_0x8a5919,_0x2d8c61[_0x1985('0x1c')]);if(_0x42889c[_0x1985('0x2a')]['metadata'][_0x1985('0x30')]){_0x50eea1['next']();}else{_0x50eea1['stop']();}})[_0x1985('0x21')](function(_0x488e9c){logger['error'](_0x1985('0x20'),_0x8a5919,JSON[_0x1985('0x2f')](_0x488e9c));_0x50eea1[_0x1985('0x10')]();});})[_0x1985('0x21')](function(_0x5962d8){logger[_0x1985('0x22')](_0x1985('0x20'),_0x8a5919,_0x5962d8[_0x1985('0x28')]);_0x50eea1[_0x1985('0x10')]();});}}catch(_0x3c6bdf){logger['error'](_0x1985('0x20'),_0x8a5919,JSON[_0x1985('0x2f')](_0x3c6bdf));_0x50eea1[_0x1985('0x25')]();}};}; \ 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 09b695c..b4ef047 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 _0x6d03=['DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','end_conversation','DIALOGFLOWV2_INTENTNAME','intent','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','languageCode','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','providerResponse','fulfillmentText','push','lodash','md5','moment','bluebird','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','clone','body','Message','create','[%s][DIALOGFLOWV2]\x20%s','catch','error','consequence','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','InteractionId','interaction','isEmpty','getMustacheRender','stringify','finally','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','SessionsClient','message','then','length','dialogflowV2','queryResult','diagnosticInfo','fields','boolValue'];(function(_0x30c30d,_0x11af19){var _0x148de0=function(_0x2d78e2){while(--_0x2d78e2){_0x30c30d['push'](_0x30c30d['shift']());}};_0x148de0(++_0x11af19);}(_0x6d03,0x177));var _0x36d0=function(_0x4d4b94,_0x5858bf){_0x4d4b94=_0x4d4b94-0x0;var _0x25f8e8=_0x6d03[_0x4d4b94];return _0x25f8e8;};'use strict';var _=require(_0x36d0('0x0'));var dialogflow=require('dialogflow');var md5=require(_0x36d0('0x1'));var moment=require(_0x36d0('0x2'));var Promise=require(_0x36d0('0x3'));var logger=require(_0x36d0('0x4'))(_0x36d0('0x5'));var utils=require('./utils');var rpc={'chatMessage':require(_0x36d0('0x6')),'openchannelMessage':require(_0x36d0('0x7')),'mailMessage':require(_0x36d0('0x8')),'smsMessage':require(_0x36d0('0x9')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x36d0('0xa'))};function createMessage(_0x31ced6,_0x3c4646,_0x3267c9,_0x1a1490){return new Promise(function(_0x296659,_0x4b0899){var _0x36cc21=_[_0x36d0('0xb')](_0x3267c9);_0x36cc21[_0x36d0('0xc')]=_0x1a1490;return rpc[_0x3c4646+_0x36d0('0xd')][_0x36d0('0xe')](_0x36cc21)['then'](function(){logger['info'](_0x36d0('0xf'),_0x31ced6,_0x36cc21[_0x36d0('0xc')]);_0x296659();})[_0x36d0('0x10')](function(_0x28beee){logger[_0x36d0('0x11')](_0x36d0('0xf'),_0x31ced6,JSON['stringify'](_0x28beee));_0x4b0899(_0x28beee);});});}exports[_0x36d0('0x12')]=function(_0x525e43,_0x4d62c9){return function(_0x4a27a0){try{if(!_['isNil'](this['interaction'][_0x36d0('0x13')])){logger[_0x36d0('0x14')](_0x36d0('0xf'),_0x525e43,_0x36d0('0x15'));return _0x4a27a0[_0x36d0('0x16')]();}var _0x44e2a7={'ContactId':this[_0x36d0('0x17')]['id'],'sentAt':moment()[_0x36d0('0x18')](_0x36d0('0x19')),'direction':_0x36d0('0x1a')};if(this[_0x36d0('0x1b')]==='sms'||this['channel']===_0x36d0('0x1c')){_0x44e2a7[_0x36d0('0x1d')]=this['interaction'][_0x36d0('0x1d')];}var _0x163cf7=this[_0x36d0('0x1b')];if(_0x163cf7===_0x36d0('0x1e')){_0x44e2a7[_0x36d0('0x1f')]=this[_0x36d0('0x20')]['id'];}else{_0x44e2a7[_[_0x36d0('0x21')](_0x163cf7)+'AccountId']=this[_0x36d0('0x20')]['id'];}_0x44e2a7[_['upperFirst'](_0x163cf7)+_0x36d0('0x22')]=this[_0x36d0('0x23')]['id'];if(this[_0x36d0('0x23')]['created']){var _0x378d04=_0x4d62c9[0x4];if(!_[_0x36d0('0x24')](_0x378d04)){_0x44e2a7[_0x36d0('0xc')]=utils[_0x36d0('0x25')](_0x378d04,this);return rpc[_0x163cf7+'Message'][_0x36d0('0xe')](_0x44e2a7)['then'](function(_0x2d3cd5){logger[_0x36d0('0x14')](_0x36d0('0xf'),_0x525e43,_0x44e2a7[_0x36d0('0xc')]);})[_0x36d0('0x10')](function(_0x32b9ad){logger[_0x36d0('0x11')](_0x36d0('0xf'),_0x525e43,JSON[_0x36d0('0x26')](_0x32b9ad));})[_0x36d0('0x27')](function(){logger[_0x36d0('0x14')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x525e43);_0x4a27a0[_0x36d0('0x28')]();});}else{logger['info'](_0x36d0('0x29'),_0x525e43);_0x4a27a0[_0x36d0('0x28')]();}}else{var _0x5cefc8=this;var _0x263fad=_0x4d62c9[0x2]['replace'](/\\n/g,'\x0a');var _0x25d204={'credentials':{'private_key':_0x263fad,'client_email':_0x4d62c9[0x1]}};var _0x1c88db=new dialogflow[(_0x36d0('0x2a'))](_0x25d204);var _0x2e73dd=_0x1c88db['sessionPath'](_0x4d62c9[0x0],md5(_0x5cefc8[_0x36d0('0x23')]['id']));var _0x5067d4={'session':_0x2e73dd,'queryInput':{'text':{'text':_0x5cefc8[_0x36d0('0x2b')][_0x36d0('0xc')],'languageCode':_0x4d62c9[0x3]||'en'}}};return _0x1c88db['detectIntent'](_0x5067d4)[_0x36d0('0x2c')](function(_0xf73115){if(_0xf73115&&_0xf73115[_0x36d0('0x2d')]){_0x5cefc8['body'][_0x36d0('0x2e')]=_0xf73115;var _0x580ec3=_0xf73115[0x0];var _0x317206=_0x580ec3[_0x36d0('0x2f')][_0x36d0('0x30')]&&_0x580ec3['queryResult'][_0x36d0('0x30')]['fields']?_0x580ec3[_0x36d0('0x2f')][_0x36d0('0x30')][_0x36d0('0x31')]['end_conversation'][_0x36d0('0x32')]:![];_0x5cefc8[_0x36d0('0xc')][_0x36d0('0x33')]=_0x580ec3[_0x36d0('0x2f')][_0x36d0('0x34')];_0x5cefc8[_0x36d0('0xc')][_0x36d0('0x35')]=_0x580ec3[_0x36d0('0x2f')][_0x36d0('0x36')];_0x5cefc8[_0x36d0('0xc')][_0x36d0('0x37')]=_0x580ec3[_0x36d0('0x2f')][_0x36d0('0x30')]&&_0x580ec3['queryResult'][_0x36d0('0x30')][_0x36d0('0x31')]?_0x580ec3[_0x36d0('0x2f')][_0x36d0('0x30')]['fields'][_0x36d0('0x38')][_0x36d0('0x32')]:![];_0x5cefc8[_0x36d0('0xc')][_0x36d0('0x39')]=_0x580ec3[_0x36d0('0x2f')][_0x36d0('0x3a')]['name'];_0x5cefc8[_0x36d0('0xc')][_0x36d0('0x3b')]=_0x580ec3[_0x36d0('0x2f')][_0x36d0('0x3a')][_0x36d0('0x3c')];_0x5cefc8[_0x36d0('0xc')][_0x36d0('0x3d')]=_0x580ec3[_0x36d0('0x2f')]['intent'][_0x36d0('0x3e')];_0x5cefc8[_0x36d0('0xc')]['DIALOGFLOWV2_LANGUAGECODE']=_0x580ec3[_0x36d0('0x2f')][_0x36d0('0x3f')];_0x5cefc8[_0x36d0('0xc')]['DIALOGFLOWV2_QUERYTEXT']=_0x580ec3[_0x36d0('0x2f')][_0x36d0('0x40')];_0x5cefc8[_0x36d0('0xc')][_0x36d0('0x41')]=_0x580ec3['queryResult'][_0x36d0('0x42')];_0x44e2a7[_0x36d0('0x43')]=_0x36d0('0x2e');_0x44e2a7[_0x36d0('0x44')]=JSON[_0x36d0('0x26')](_0xf73115);var _0x5aa7b4=[];for(var _0x3e3bfd=0x0;_0x3e3bfd<_0xf73115['length'];_0x3e3bfd++){var _0x56a7cd=_0xf73115[_0x3e3bfd];if(_0x56a7cd&&_0x56a7cd[_0x36d0('0x2f')]&&_0x56a7cd['queryResult'][_0x36d0('0x45')]){_0x5aa7b4[_0x36d0('0x46')](createMessage(_0x525e43,_0x163cf7,_0x44e2a7,_0x56a7cd[_0x36d0('0x2f')][_0x36d0('0x45')]));}}return Promise['all'](_0x5aa7b4)[_0x36d0('0x2c')](function(){if(_0x317206){_0x4a27a0[_0x36d0('0x16')]();}else{_0x4a27a0['stop']();}})[_0x36d0('0x10')](function(_0x44a98f){logger[_0x36d0('0x11')](_0x36d0('0xf'),_0x525e43,JSON[_0x36d0('0x26')](_0x44a98f));_0x4a27a0[_0x36d0('0x16')]();});}})[_0x36d0('0x10')](function(_0x489f55){logger['error'](_0x36d0('0xf'),_0x525e43,_0x489f55[_0x36d0('0x2b')]);_0x4a27a0[_0x36d0('0x16')]();});}}catch(_0x511694){logger[_0x36d0('0x11')](_0x36d0('0xf'),_0x525e43,JSON[_0x36d0('0x26')](_0x511694));_0x4a27a0[_0x36d0('0x28')]();}};}; \ No newline at end of file +var _0xf143=['finally','info','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','replace','SessionsClient','sessionPath','detectIntent','queryResult','diagnosticInfo','fields','boolValue','DIALOGFLOWV2_ACTION','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','end_conversation','DIALOGFLOWV2_INTENTNAME','intent','name','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','providerName','dialogflowV2','length','fulfillmentText','push','all','message','md5','bluebird','../../../../config/logger','routing','./utils','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','body','Message','create','[%s][DIALOGFLOWV2]\x20%s','catch','error','stringify','consequence','isNil','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','format','out','channel','sms','interaction','phone','chat','account','upperFirst','InteractionId','getMustacheRender','then'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xf143,0x12a));var _0x3f14=function(_0x778b72,_0x19857f){_0x778b72=_0x778b72-0x0;var _0x4528ab=_0xf143[_0x778b72];return _0x4528ab;};'use strict';var _=require('lodash');var dialogflow=require('dialogflow');var md5=require(_0x3f14('0x0'));var moment=require('moment');var Promise=require(_0x3f14('0x1'));var logger=require(_0x3f14('0x2'))(_0x3f14('0x3'));var utils=require(_0x3f14('0x4'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x3f14('0x5')),'mailMessage':require(_0x3f14('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x3f14('0x7')),'whatsappMessage':require(_0x3f14('0x8'))};function createMessage(_0x528d66,_0xd06962,_0x359b7d,_0x4d057a){return new Promise(function(_0x341031,_0x3a5b95){var _0x525539=_['clone'](_0x359b7d);_0x525539[_0x3f14('0x9')]=_0x4d057a;return rpc[_0xd06962+_0x3f14('0xa')][_0x3f14('0xb')](_0x525539)['then'](function(){logger['info'](_0x3f14('0xc'),_0x528d66,_0x525539[_0x3f14('0x9')]);_0x341031();})[_0x3f14('0xd')](function(_0x5e9614){logger[_0x3f14('0xe')](_0x3f14('0xc'),_0x528d66,JSON[_0x3f14('0xf')](_0x5e9614));_0x3a5b95(_0x5e9614);});});}exports[_0x3f14('0x10')]=function(_0x55c068,_0xd42b2b){return function(_0x5e0520){try{if(!_[_0x3f14('0x11')](this['interaction']['UserId'])){logger['info'](_0x3f14('0xc'),_0x55c068,_0x3f14('0x12'));return _0x5e0520[_0x3f14('0x13')]();}var _0x161471={'ContactId':this['contact']['id'],'sentAt':moment()[_0x3f14('0x14')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x3f14('0x15')};if(this[_0x3f14('0x16')]===_0x3f14('0x17')||this[_0x3f14('0x16')]==='whatsapp'){_0x161471['phone']=this[_0x3f14('0x18')][_0x3f14('0x19')];}var _0x1bdefc=this[_0x3f14('0x16')];if(_0x1bdefc===_0x3f14('0x1a')){_0x161471['ChatWebsiteId']=this[_0x3f14('0x1b')]['id'];}else{_0x161471[_['upperFirst'](_0x1bdefc)+'AccountId']=this[_0x3f14('0x1b')]['id'];}_0x161471[_[_0x3f14('0x1c')](_0x1bdefc)+_0x3f14('0x1d')]=this[_0x3f14('0x18')]['id'];if(this[_0x3f14('0x18')]['created']){var _0x5bae99=_0xd42b2b[0x4];if(!_['isEmpty'](_0x5bae99)){_0x161471['body']=utils[_0x3f14('0x1e')](_0x5bae99,this);return rpc[_0x1bdefc+_0x3f14('0xa')][_0x3f14('0xb')](_0x161471)[_0x3f14('0x1f')](function(_0x3fc549){logger['info'](_0x3f14('0xc'),_0x55c068,_0x161471[_0x3f14('0x9')]);})[_0x3f14('0xd')](function(_0x62afc4){logger[_0x3f14('0xe')](_0x3f14('0xc'),_0x55c068,JSON[_0x3f14('0xf')](_0x62afc4));})[_0x3f14('0x20')](function(){logger[_0x3f14('0x21')](_0x3f14('0x22'),_0x55c068);_0x5e0520['stop']();});}else{logger[_0x3f14('0x21')](_0x3f14('0x23'),_0x55c068);_0x5e0520[_0x3f14('0x24')]();}}else{var _0x95ae40=this;var _0x283cc8=_0xd42b2b[0x2][_0x3f14('0x25')](/\\n/g,'\x0a');var _0x195492={'credentials':{'private_key':_0x283cc8,'client_email':_0xd42b2b[0x1]}};var _0x3924e3=new dialogflow[(_0x3f14('0x26'))](_0x195492);var _0x508cbd=_0x3924e3[_0x3f14('0x27')](_0xd42b2b[0x0],md5(_0x95ae40[_0x3f14('0x18')]['id']));var _0x86ca7e={'session':_0x508cbd,'queryInput':{'text':{'text':_0x95ae40['message'][_0x3f14('0x9')],'languageCode':_0xd42b2b[0x3]||'en'}}};return _0x3924e3[_0x3f14('0x28')](_0x86ca7e)['then'](function(_0x555bf7){if(_0x555bf7&&_0x555bf7['length']){_0x95ae40[_0x3f14('0x9')]['dialogflowV2']=_0x555bf7;var _0x325424=_0x555bf7[0x0];var _0x3c5b65=_0x325424[_0x3f14('0x29')][_0x3f14('0x2a')]&&_0x325424[_0x3f14('0x29')][_0x3f14('0x2a')][_0x3f14('0x2b')]?_0x325424[_0x3f14('0x29')][_0x3f14('0x2a')]['fields']['end_conversation'][_0x3f14('0x2c')]:![];_0x95ae40[_0x3f14('0x9')][_0x3f14('0x2d')]=_0x325424[_0x3f14('0x29')]['action'];_0x95ae40[_0x3f14('0x9')][_0x3f14('0x2e')]=_0x325424['queryResult'][_0x3f14('0x2f')];_0x95ae40['body'][_0x3f14('0x30')]=_0x325424[_0x3f14('0x29')]['diagnosticInfo']&&_0x325424[_0x3f14('0x29')][_0x3f14('0x2a')][_0x3f14('0x2b')]?_0x325424[_0x3f14('0x29')][_0x3f14('0x2a')]['fields'][_0x3f14('0x31')]['boolValue']:![];_0x95ae40['body'][_0x3f14('0x32')]=_0x325424[_0x3f14('0x29')][_0x3f14('0x33')][_0x3f14('0x34')];_0x95ae40['body']['DIALOGFLOWV2_INTENTDISPLAYNAME']=_0x325424[_0x3f14('0x29')][_0x3f14('0x33')][_0x3f14('0x35')];_0x95ae40[_0x3f14('0x9')][_0x3f14('0x36')]=_0x325424[_0x3f14('0x29')]['intent']['isFallback'];_0x95ae40['body']['DIALOGFLOWV2_LANGUAGECODE']=_0x325424['queryResult'][_0x3f14('0x37')];_0x95ae40[_0x3f14('0x9')][_0x3f14('0x38')]=_0x325424['queryResult'][_0x3f14('0x39')];_0x95ae40['body'][_0x3f14('0x3a')]=_0x325424[_0x3f14('0x29')]['intentDetectionConfidence'];_0x161471[_0x3f14('0x3b')]=_0x3f14('0x3c');_0x161471['providerResponse']=JSON[_0x3f14('0xf')](_0x555bf7);var _0x50627f=[];for(var _0x5aca37=0x0;_0x5aca37<_0x555bf7[_0x3f14('0x3d')];_0x5aca37++){var _0x251be0=_0x555bf7[_0x5aca37];if(_0x251be0&&_0x251be0[_0x3f14('0x29')]&&_0x251be0[_0x3f14('0x29')][_0x3f14('0x3e')]){_0x50627f[_0x3f14('0x3f')](createMessage(_0x55c068,_0x1bdefc,_0x161471,_0x251be0[_0x3f14('0x29')][_0x3f14('0x3e')]));}}return Promise[_0x3f14('0x40')](_0x50627f)[_0x3f14('0x1f')](function(){if(_0x3c5b65){_0x5e0520[_0x3f14('0x13')]();}else{_0x5e0520[_0x3f14('0x24')]();}})[_0x3f14('0xd')](function(_0x9d8f41){logger[_0x3f14('0xe')]('[%s][DIALOGFLOWV2]\x20%s',_0x55c068,JSON[_0x3f14('0xf')](_0x9d8f41));_0x5e0520['next']();});}})[_0x3f14('0xd')](function(_0x21f878){logger['error'](_0x3f14('0xc'),_0x55c068,_0x21f878[_0x3f14('0x41')]);_0x5e0520['next']();});}}catch(_0x279e52){logger[_0x3f14('0xe')](_0x3f14('0xc'),_0x55c068,JSON[_0x3f14('0xf')](_0x279e52));_0x5e0520[_0x3f14('0x24')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotoif.js b/server/services/routing/server/applications/gotoif.js index 7b1d489..8e7cac8 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 _0x8ea3=['./utils','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20false\x20is\x20a\x20number','consequence','fromString','replace','validate','[%s][GOTOIF]\x20%s','map','join','stop','priorityTrue','priorityFalse','info','condition','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','error','[%s][GOTOIF]\x20eval\x20error:\x20%s','message','html-to-text'];(function(_0x48965a,_0x1aefa6){var _0x4ffb46=function(_0x4c91ba){while(--_0x4c91ba){_0x48965a['push'](_0x48965a['shift']());}};_0x4ffb46(++_0x1aefa6);}(_0x8ea3,0xd7));var _0x38ea=function(_0x1cd4d5,_0x40bd09){_0x1cd4d5=_0x1cd4d5-0x0;var _0x348028=_0x8ea3[_0x1cd4d5];return _0x348028;};'use strict';var schema=require('validate');var _=require('lodash');var htmlToText=require(_0x38ea('0x0'));var utils=require(_0x38ea('0x1'));var logger=require('../../../../config/logger')(_0x38ea('0x2'));var gotoif=schema({'condition':{'type':_0x38ea('0x3'),'required':!![],'message':_0x38ea('0x4')},'priorityTrue':{'type':_0x38ea('0x5'),'message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':_0x38ea('0x5'),'message':_0x38ea('0x6')}});exports[_0x38ea('0x7')]=function(_0x24e89d,_0x4fadac){return function(_0x203f7f){try{var _0xaf7e8f={'condition':htmlToText[_0x38ea('0x8')](utils['getMustacheRender'](_0x4fadac[0x0],this),{'wordwrap':![]})[_0x38ea('0x9')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x4fadac[0x1],'priorityFalse':_0x4fadac[0x2]};var _0x210cb8=gotoif[_0x38ea('0xa')](_0xaf7e8f,{'typecast':!![]});if(_0x210cb8['length']){logger['error'](_0x38ea('0xb'),_0x24e89d,_[_0x38ea('0xc')](_0x210cb8,'message')[_0x38ea('0xd')](',\x20'));_0x203f7f[_0x38ea('0xe')]();}else{try{var _0x3ed1ef=eval('('+_0xaf7e8f['condition']+')');var _0xe556d7=_0x3ed1ef?_0xaf7e8f[_0x38ea('0xf')]:_0xaf7e8f[_0x38ea('0x10')];logger[_0x38ea('0x11')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x24e89d,_0xaf7e8f[_0x38ea('0x12')],_0x3ed1ef,_0xe556d7||'next');if(_0xe556d7){var _0x1512bb=_[_0x38ea('0x13')](_0x203f7f[_0x38ea('0x14')](),{'p':_0xe556d7});if(_0x1512bb>=0x0){logger[_0x38ea('0x11')](_0x38ea('0x15'),_0x24e89d,_0xe556d7||_0x38ea('0x16'),_0x1512bb);_0x203f7f[_0x38ea('0x16')](_0x1512bb);}else{logger[_0x38ea('0x11')](_0x38ea('0x17'),_0x24e89d,_0xe556d7||'next');_0x203f7f[_0x38ea('0xe')]();}}else{_0x203f7f[_0x38ea('0x16')]();}}catch(_0x428440){logger[_0x38ea('0x18')](_0x38ea('0x19'),_0x24e89d,_0x428440[_0x38ea('0x1a')]);_0x203f7f['stop']();}}}catch(_0x1cefae){logger['error'](_0x38ea('0xb'),_0x24e89d,JSON['stringify'](_0x1cefae));_0x203f7f[_0x38ea('0xe')]();}};}; \ No newline at end of file +var _0xa734=['rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','error','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','lodash','html-to-text','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','length','[%s][GOTOIF]\x20%s','map','message','join','stop','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','condition','next','findIndex'];(function(_0x300e3f,_0x9b93e8){var _0x12ebf3=function(_0x282f67){while(--_0x282f67){_0x300e3f['push'](_0x300e3f['shift']());}};_0x12ebf3(++_0x9b93e8);}(_0xa734,0xcc));var _0x4a73=function(_0x25b1dd,_0x5d0aab){_0x25b1dd=_0x25b1dd-0x0;var _0x7392f=_0xa734[_0x25b1dd];return _0x7392f;};'use strict';var schema=require(_0x4a73('0x0'));var _=require(_0x4a73('0x1'));var htmlToText=require(_0x4a73('0x2'));var utils=require(_0x4a73('0x3'));var logger=require(_0x4a73('0x4'))(_0x4a73('0x5'));var gotoif=schema({'condition':{'type':_0x4a73('0x6'),'required':!![],'message':_0x4a73('0x7')},'priorityTrue':{'type':'number','message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':_0x4a73('0x8'),'message':_0x4a73('0x9')}});exports[_0x4a73('0xa')]=function(_0x438fe3,_0x24ede9){return function(_0x2c65e4){try{var _0x19243a={'condition':htmlToText[_0x4a73('0xb')](utils[_0x4a73('0xc')](_0x24ede9[0x0],this),{'wordwrap':![]})[_0x4a73('0xd')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x24ede9[0x1],'priorityFalse':_0x24ede9[0x2]};var _0x254c25=gotoif['validate'](_0x19243a,{'typecast':!![]});if(_0x254c25[_0x4a73('0xe')]){logger['error'](_0x4a73('0xf'),_0x438fe3,_[_0x4a73('0x10')](_0x254c25,_0x4a73('0x11'))[_0x4a73('0x12')](',\x20'));_0x2c65e4[_0x4a73('0x13')]();}else{try{var _0x4db90e=eval('('+_0x19243a['condition']+')');var _0x5796d0=_0x4db90e?_0x19243a[_0x4a73('0x14')]:_0x19243a[_0x4a73('0x15')];logger[_0x4a73('0x16')](_0x4a73('0x17'),_0x438fe3,_0x19243a[_0x4a73('0x18')],_0x4db90e,_0x5796d0||_0x4a73('0x19'));if(_0x5796d0){var _0x139802=_[_0x4a73('0x1a')](_0x2c65e4[_0x4a73('0x1b')](),{'p':_0x5796d0});if(_0x139802>=0x0){logger[_0x4a73('0x16')](_0x4a73('0x1c'),_0x438fe3,_0x5796d0||_0x4a73('0x19'),_0x139802);_0x2c65e4[_0x4a73('0x19')](_0x139802);}else{logger[_0x4a73('0x16')](_0x4a73('0x1d'),_0x438fe3,_0x5796d0||_0x4a73('0x19'));_0x2c65e4[_0x4a73('0x13')]();}}else{_0x2c65e4['next']();}}catch(_0x1b8fcb){logger[_0x4a73('0x1e')](_0x4a73('0x1f'),_0x438fe3,_0x1b8fcb['message']);_0x2c65e4[_0x4a73('0x13')]();}}}catch(_0x1ee3ea){logger[_0x4a73('0x1e')]('[%s][GOTOIF]\x20%s',_0x438fe3,JSON[_0x4a73('0x20')](_0x1ee3ea));_0x2c65e4[_0x4a73('0x13')]();}};}; \ 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 c6115d5..f637f43 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 _0x1b4f=['error','map','message','join','stop','info','priority','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20%s','stringify','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','validate'];(function(_0x54e408,_0x1d47d7){var _0x44e402=function(_0x4fc2d5){while(--_0x4fc2d5){_0x54e408['push'](_0x54e408['shift']());}};_0x44e402(++_0x1d47d7);}(_0x1b4f,0xf5));var _0xf1b4=function(_0x4a2ac8,_0x4ccba8){_0x4a2ac8=_0x4a2ac8-0x0;var _0x507c80=_0x1b4f[_0x4a2ac8];return _0x507c80;};'use strict';var schema=require('validate');var _=require(_0xf1b4('0x0'));var logger=require(_0xf1b4('0x1'))(_0xf1b4('0x2'));var gotop=schema({'priority':{'type':_0xf1b4('0x3'),'required':!![],'message':_0xf1b4('0x4')}});exports[_0xf1b4('0x5')]=function(_0x1383fa,_0xabe4be){return function(_0x106d33){try{var _0x35440c={'priority':_0xabe4be[0x0]};var _0x1a441d=gotop[_0xf1b4('0x6')](_0x35440c,{'typecast':!![]});if(_0x1a441d['length']){logger[_0xf1b4('0x7')]('[%s][GOTOP]\x20%s',_0x1383fa,_[_0xf1b4('0x8')](_0x1a441d,_0xf1b4('0x9'))[_0xf1b4('0xa')](',\x20'));_0x106d33[_0xf1b4('0xb')]();}else{logger[_0xf1b4('0xc')]('[%s][GOTOP]\x20priority\x20%s',_0x1383fa,_0x35440c[_0xf1b4('0xd')]);if(_0x35440c[_0xf1b4('0xd')]){var _0x17e024=_['findIndex'](_0x106d33['rules'](),{'p':_0x35440c[_0xf1b4('0xd')]});if(_0x17e024>=0x0){logger['info'](_0xf1b4('0xe'),_0x1383fa,_0x35440c[_0xf1b4('0xd')]||_0xf1b4('0xf'),_0x17e024);_0x106d33[_0xf1b4('0xf')](_0x17e024);}else{logger['info']('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x1383fa,_0x35440c[_0xf1b4('0xd')]||_0xf1b4('0xf'));_0x106d33[_0xf1b4('0xb')]();}}else{_0x106d33['next']();}}}catch(_0x56c68e){logger['error'](_0xf1b4('0x10'),_0x1383fa,JSON[_0xf1b4('0x11')](_0x56c68e));_0x106d33[_0xf1b4('0xb')]();}};}; \ No newline at end of file +var _0x35d4=['consequence','length','error','[%s][GOTOP]\x20%s','map','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','validate','lodash','../../../../config/logger','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'];(function(_0x34b6aa,_0x5ddd29){var _0x3ead29=function(_0x53979c){while(--_0x53979c){_0x34b6aa['push'](_0x34b6aa['shift']());}};_0x3ead29(++_0x5ddd29);}(_0x35d4,0x1df));var _0x435d=function(_0x35d3f2,_0x18fb7a){_0x35d3f2=_0x35d3f2-0x0;var _0x54aa8b=_0x35d4[_0x35d3f2];return _0x54aa8b;};'use strict';var schema=require(_0x435d('0x0'));var _=require(_0x435d('0x1'));var logger=require(_0x435d('0x2'))('routing');var gotop=schema({'priority':{'type':_0x435d('0x3'),'required':!![],'message':_0x435d('0x4')}});exports[_0x435d('0x5')]=function(_0x580751,_0x52ba77){return function(_0x299d15){try{var _0x8f95f9={'priority':_0x52ba77[0x0]};var _0x25ffaf=gotop[_0x435d('0x0')](_0x8f95f9,{'typecast':!![]});if(_0x25ffaf[_0x435d('0x6')]){logger[_0x435d('0x7')](_0x435d('0x8'),_0x580751,_[_0x435d('0x9')](_0x25ffaf,_0x435d('0xa'))[_0x435d('0xb')](',\x20'));_0x299d15[_0x435d('0xc')]();}else{logger[_0x435d('0xd')](_0x435d('0xe'),_0x580751,_0x8f95f9[_0x435d('0xf')]);if(_0x8f95f9['priority']){var _0xb3e381=_[_0x435d('0x10')](_0x299d15[_0x435d('0x11')](),{'p':_0x8f95f9[_0x435d('0xf')]});if(_0xb3e381>=0x0){logger[_0x435d('0xd')](_0x435d('0x12'),_0x580751,_0x8f95f9[_0x435d('0xf')]||_0x435d('0x13'),_0xb3e381);_0x299d15[_0x435d('0x13')](_0xb3e381);}else{logger[_0x435d('0xd')](_0x435d('0x14'),_0x580751,_0x8f95f9[_0x435d('0xf')]||'next');_0x299d15[_0x435d('0xc')]();}}else{_0x299d15[_0x435d('0x13')]();}}}catch(_0x3bbb2c){logger[_0x435d('0x7')](_0x435d('0x8'),_0x580751,JSON[_0x435d('0x15')](_0x3bbb2c));_0x299d15['stop']();}};}; \ 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 3583617..4ce21b0 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 _0x2c5b=['../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','channel','account','upperFirst','interaction','Message','create','then','info','next','catch','error','[%s][MESSAGE]\x20%s','stringify','stop','lodash','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/smsMessage'];(function(_0x1b03f7,_0x4e251b){var _0x1fb7e1=function(_0x7841c2){while(--_0x7841c2){_0x1b03f7['push'](_0x1b03f7['shift']());}};_0x1fb7e1(++_0x4e251b);}(_0x2c5b,0x193));var _0xb2c5=function(_0x48360c,_0x4c1bdd){_0x48360c=_0x48360c-0x0;var _0x568ce0=_0x2c5b[_0x48360c];return _0x568ce0;};'use strict';var _=require(_0xb2c5('0x0'));var utils=require('./utils');var logger=require(_0xb2c5('0x1'))(_0xb2c5('0x2'));var rpc={'chatMessage':require(_0xb2c5('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xb2c5('0x4')),'faxMessage':require(_0xb2c5('0x5')),'whatsappMessage':require(_0xb2c5('0x6'))};exports[_0xb2c5('0x7')]=function(_0x4cc6e2,_0x195514){return function(_0xc08d26){try{var _0x449204={'body':utils[_0xb2c5('0x8')](_0x195514[0x0],this),'ContactId':this[_0xb2c5('0x9')]['id']};if(this[_0xb2c5('0xa')]==='chat'){_0x449204['ChatWebsiteId']=this[_0xb2c5('0xb')]['id'];}else{_0x449204[_[_0xb2c5('0xc')](this[_0xb2c5('0xa')])+'AccountId']=this[_0xb2c5('0xb')]['id'];}_0x449204[_[_0xb2c5('0xc')](this['channel'])+'InteractionId']=this[_0xb2c5('0xd')]['id'];if(rpc[this[_0xb2c5('0xa')]+_0xb2c5('0xe')]){return rpc[this[_0xb2c5('0xa')]+'Message'][_0xb2c5('0xf')](_0x449204)[_0xb2c5('0x10')](function(_0x250f0d){logger[_0xb2c5('0x11')]('[%s][MESSAGE]\x20%s',_0x4cc6e2,_0x449204['body']);_0xc08d26[_0xb2c5('0x12')]();})[_0xb2c5('0x13')](function(_0x409398){logger[_0xb2c5('0x14')](_0xb2c5('0x15'),_0x4cc6e2,JSON[_0xb2c5('0x16')](_0x409398));_0xc08d26[_0xb2c5('0x17')]();});}}catch(_0x1fffa7){logger[_0xb2c5('0x14')]('[%s][MESSAGE]\x20%s',_0x4cc6e2,JSON[_0xb2c5('0x16')](_0x1fffa7));_0xc08d26[_0xb2c5('0x17')]();}};}; \ No newline at end of file +var _0x3f7c=['error','stringify','stop','lodash','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','channel','ChatWebsiteId','upperFirst','AccountId','Message','create','[%s][MESSAGE]\x20%s','body','next','catch'];(function(_0x474f57,_0x37252e){var _0x31f92f=function(_0x144d8e){while(--_0x144d8e){_0x474f57['push'](_0x474f57['shift']());}};_0x31f92f(++_0x37252e);}(_0x3f7c,0x17a));var _0xc3f7=function(_0x4d01de,_0x2dd876){_0x4d01de=_0x4d01de-0x0;var _0xca9ff1=_0x3f7c[_0x4d01de];return _0xca9ff1;};'use strict';var _=require(_0xc3f7('0x0'));var utils=require(_0xc3f7('0x1'));var logger=require(_0xc3f7('0x2'))('routing');var rpc={'chatMessage':require(_0xc3f7('0x3')),'openchannelMessage':require(_0xc3f7('0x4')),'mailMessage':require(_0xc3f7('0x5')),'smsMessage':require(_0xc3f7('0x6')),'faxMessage':require(_0xc3f7('0x7')),'whatsappMessage':require(_0xc3f7('0x8'))};exports[_0xc3f7('0x9')]=function(_0x2688c6,_0xd8f1c6){return function(_0x524236){try{var _0x160e60={'body':utils[_0xc3f7('0xa')](_0xd8f1c6[0x0],this),'ContactId':this[_0xc3f7('0xb')]['id']};if(this[_0xc3f7('0xc')]==='chat'){_0x160e60[_0xc3f7('0xd')]=this['account']['id'];}else{_0x160e60[_[_0xc3f7('0xe')](this[_0xc3f7('0xc')])+_0xc3f7('0xf')]=this['account']['id'];}_0x160e60[_[_0xc3f7('0xe')](this[_0xc3f7('0xc')])+'InteractionId']=this['interaction']['id'];if(rpc[this['channel']+_0xc3f7('0x10')]){return rpc[this[_0xc3f7('0xc')]+_0xc3f7('0x10')][_0xc3f7('0x11')](_0x160e60)['then'](function(_0x57040f){logger['info'](_0xc3f7('0x12'),_0x2688c6,_0x160e60[_0xc3f7('0x13')]);_0x524236[_0xc3f7('0x14')]();})[_0xc3f7('0x15')](function(_0x31d78f){logger[_0xc3f7('0x16')](_0xc3f7('0x12'),_0x2688c6,JSON[_0xc3f7('0x17')](_0x31d78f));_0x524236[_0xc3f7('0x18')]();});}}catch(_0x339376){logger['error'](_0xc3f7('0x12'),_0x2688c6,JSON[_0xc3f7('0x17')](_0x339376));_0x524236[_0xc3f7('0x18')]();}};}; \ 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 dbc3e77..7603acb 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 _0x17e2=['info','[%s][NOOP]\x20%s','next','error','stringify','stop','routing'];(function(_0x502c74,_0x25e1f7){var _0x4bfe33=function(_0x4d653e){while(--_0x4d653e){_0x502c74['push'](_0x502c74['shift']());}};_0x4bfe33(++_0x25e1f7);}(_0x17e2,0x99));var _0x217e=function(_0x5b028b,_0x5ee82b){_0x5b028b=_0x5b028b-0x0;var _0x37ad7f=_0x17e2[_0x5b028b];return _0x37ad7f;};'use strict';var utils=require('./utils');var logger=require('../../../../config/logger')(_0x217e('0x0'));exports['consequence']=function(_0x133c9c,_0x11be38){return function(_0x3c33b1){try{logger[_0x217e('0x1')](_0x217e('0x2'),_0x133c9c,utils['getMustacheRender'](_0x11be38[0x0],this));_0x3c33b1[_0x217e('0x3')]();}catch(_0x33836b){logger[_0x217e('0x4')](_0x217e('0x2'),_0x133c9c,JSON[_0x217e('0x5')](_0x33836b));_0x3c33b1[_0x217e('0x6')]();}};}; \ No newline at end of file +var _0x7dbd=['getMustacheRender','next','error','stringify','./utils','consequence','info','[%s][NOOP]\x20%s'];(function(_0x4b479b,_0x3b686f){var _0x5d2376=function(_0xf01ff4){while(--_0xf01ff4){_0x4b479b['push'](_0x4b479b['shift']());}};_0x5d2376(++_0x3b686f);}(_0x7dbd,0x1dc));var _0xd7db=function(_0x2fa457,_0x7021df){_0x2fa457=_0x2fa457-0x0;var _0x4f250a=_0x7dbd[_0x2fa457];return _0x4f250a;};'use strict';var utils=require(_0xd7db('0x0'));var logger=require('../../../../config/logger')('routing');exports[_0xd7db('0x1')]=function(_0x1a7a61,_0x142945){return function(_0x20c79c){try{logger[_0xd7db('0x2')](_0xd7db('0x3'),_0x1a7a61,utils[_0xd7db('0x4')](_0x142945[0x0],this));_0x20c79c[_0xd7db('0x5')]();}catch(_0x519c07){logger[_0xd7db('0x6')]('[%s][NOOP]\x20%s',_0x1a7a61,JSON[_0xd7db('0x7')](_0x519c07));_0x20c79c['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 48b165c..1b86dc0 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 _0x7fec=['message','chat','WebsiteId','info','name','QueueReport','create','catch','error','create\x20queue\x20report','[%s][STOP:QUEUE][NAME:%s]','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','update','toLowerCase','length','[%s][QUEUE]\x20%s','join','stop','createQueue','atimeout','qtimeout','end','close','rules','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','lodash','util','seq-queue','moment','ioredis','../../../../config/logger','routing','./strategy','redis','defaults','queue_id','account','queue','joinAt','emit','clone','format','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/smsQueueReport','../../rpc/whatsappQueueReport','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','waiting','body','from','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','QueueId','interaction','channel'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0x7fec,0x14b));var _0xc7fe=function(_0x2c4586,_0x45dc73){_0x2c4586=_0x2c4586-0x0;var _0x5d807c=_0x7fec[_0x2c4586];return _0x5d807c;};'use strict';var schema=require(_0xc7fe('0x0'));var _=require(_0xc7fe('0x1'));var util=require(_0xc7fe('0x2'));var seqqueue=require(_0xc7fe('0x3'));var moment=require(_0xc7fe('0x4'));var Redis=require(_0xc7fe('0x5'));var config=require('../../../../config/environment');var logger=require(_0xc7fe('0x6'))(_0xc7fe('0x7'));var strategy=require(_0xc7fe('0x8'));config[_0xc7fe('0x9')]=_[_0xc7fe('0xa')](config[_0xc7fe('0x9')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xc7fe('0x9')]));var attributes=['id',_0xc7fe('0xb'),_0xc7fe('0xc'),_0xc7fe('0xd'),'from',_0xc7fe('0xe')];function emit(_0x3df88a,_0x54ab43,_0xbb6b8){io['to'](_0x3df88a)[_0xc7fe('0xf')](_0x54ab43,_0xbb6b8);}function emitChannelQueueInteraction(_0x28bc3b,_0x3764d6,_0x3e48f2,_0x2ebcfe,_0x307a4c,_0x49f478,_0x354f7a,_0x1f4f23){var _0x2be6e1=_[_0xc7fe('0x10')](_0x3e48f2);_0x2be6e1[_0xc7fe('0xb')]=_0x1f4f23;_0x2be6e1[_0xc7fe('0xd')]=_0x3764d6;_0x2be6e1[_0xc7fe('0xc')]=_0x2ebcfe;_0x2be6e1['id']=_0x307a4c;if(_0x49f478){_0x354f7a[util[_0xc7fe('0x11')]('%sQueuesWaitingInteractions',_0x28bc3b)][_0x307a4c]=_[_0xc7fe('0x12')](_0x2be6e1,attributes);}else{delete _0x354f7a[util[_0xc7fe('0x11')]('%sQueuesWaitingInteractions',_0x28bc3b)][_0x307a4c];}emit(util[_0xc7fe('0x11')](_0xc7fe('0x13'),_0x28bc3b,_0x3764d6),util['format'](_0xc7fe('0x14'),_0x28bc3b,_0x49f478?_0xc7fe('0x15'):_0xc7fe('0x16')),_[_0xc7fe('0x12')](_0x2be6e1,attributes));}var rpc={'openchannelQueueReport':require(_0xc7fe('0x17')),'mailQueueReport':require(_0xc7fe('0x18')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0xc7fe('0x19')),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require(_0xc7fe('0x1a'))};var queue=schema({'name':{'type':'string','required':!![],'message':_0xc7fe('0x1b')},'timeout':{'type':_0xc7fe('0x1c'),'message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x2d27af,_0x1b46a4,_0x2afc6b,_0x4dffd0){if(_0x2d27af&&_0x1b46a4&&_0x2afc6b){_0x1b46a4[_0xc7fe('0x1d')]+=0x1;var _0x4e659b={'uniqueid':_0x2d27af,'from':_0x2afc6b[_0xc7fe('0x1e')]?_0x2afc6b[_0xc7fe('0x1e')][_0xc7fe('0x1f')]:'','joinAt':moment()[_0xc7fe('0x11')](_0xc7fe('0x20')),'ContactId':_0x2afc6b[_0xc7fe('0x21')]?_0x2afc6b['contact']['id']:null,'ListId':_0x2afc6b[_0xc7fe('0x22')]?_0x2afc6b[_0xc7fe('0x22')]['id']:null};_0x4e659b[_[_0xc7fe('0x23')](_0x2afc6b['channel'])+_0xc7fe('0x24')]=_0x1b46a4['id']||null;_0x4e659b[_[_0xc7fe('0x23')](_0x2afc6b['channel'])+'InteractionId']=_0x2afc6b[_0xc7fe('0x25')]?_0x2afc6b[_0xc7fe('0x25')]['id']:null;_0x4e659b[_[_0xc7fe('0x23')](_0x2afc6b[_0xc7fe('0x26')])+'MessageId']=_0x2afc6b[_0xc7fe('0x27')]?_0x2afc6b[_0xc7fe('0x27')]['id']:null;_0x4e659b[_[_0xc7fe('0x23')](_0x2afc6b['channel'])+(_0x2afc6b[_0xc7fe('0x26')]!==_0xc7fe('0x28')?'AccountId':_0xc7fe('0x29'))]=_0x2afc6b[_0xc7fe('0xc')]?_0x2afc6b[_0xc7fe('0xc')]['id']:null;logger[_0xc7fe('0x2a')](util[_0xc7fe('0x11')]('[%s][START:QUEUE][NAME:%s]',_0x2d27af,_0x1b46a4['name']));emitChannelQueueInteraction(_0x2afc6b['channel'],_0x1b46a4[_0xc7fe('0x2b')],_0x4e659b,_0x2afc6b[_0xc7fe('0xc')][_0xc7fe('0x2b')],_0x2afc6b[_0xc7fe('0x27')]['id'],!![],_0x4dffd0,_0x1b46a4['id']);if(rpc[_0x2afc6b[_0xc7fe('0x26')]+_0xc7fe('0x2c')]){return rpc[_0x2afc6b[_0xc7fe('0x26')]+'QueueReport'][_0xc7fe('0x2d')](_0x4e659b)[_0xc7fe('0x2e')](function(_0x4736b1){logger[_0xc7fe('0x2f')](_0xc7fe('0x30'));});}}}function stopRouting(_0x18e55b,_0x1dea6f,_0x30d90a,_0x204c3d){if(_0x18e55b&&_0x1dea6f){_0x1dea6f[_0xc7fe('0x1d')]-=0x1;var _0x2ae22e={'leaveAt':moment()[_0xc7fe('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0xc7fe('0x11')](_0xc7fe('0x20')),'reason':'accepted'};logger[_0xc7fe('0x2a')](util[_0xc7fe('0x11')](_0xc7fe('0x31'),_0x18e55b,_0x1dea6f[_0xc7fe('0x2b')]));emitChannelQueueInteraction(_0x30d90a[_0xc7fe('0x26')],_0x1dea6f['name'],_0x30d90a['body'],_0x30d90a['account'][_0xc7fe('0x2b')],_0x30d90a[_0xc7fe('0x27')]['id'],![],_0x204c3d,_0x1dea6f['id']);if(rpc[_0x30d90a[_0xc7fe('0x26')]+_0xc7fe('0x2c')]){return rpc[_0x30d90a[_0xc7fe('0x26')]+'QueueReport']['update'](_0x18e55b,_0x2ae22e)[_0xc7fe('0x2e')](function(_0x4bc825){logger[_0xc7fe('0x2f')](_0xc7fe('0x32'));});}}}function endRouting(_0xad833c,_0x409cf6,_0x4a742f,_0x1c2f61){if(_0xad833c&&_0x409cf6){_0x409cf6['waiting']-=0x1;var _0x2cd5d8={'leaveAt':moment()[_0xc7fe('0x11')](_0xc7fe('0x20')),'exitAt':moment()['format'](_0xc7fe('0x20')),'reason':_0xc7fe('0x33')};logger[_0xc7fe('0x2a')](util[_0xc7fe('0x11')](_0xc7fe('0x34'),_0xad833c,_0x409cf6[_0xc7fe('0x2b')]));emitChannelQueueInteraction(_0x4a742f[_0xc7fe('0x26')],_0x409cf6[_0xc7fe('0x2b')],_0x4a742f[_0xc7fe('0x1e')],_0x4a742f[_0xc7fe('0xc')]['name'],_0x4a742f[_0xc7fe('0x27')]['id'],![],_0x1c2f61);if(rpc[_0x4a742f[_0xc7fe('0x26')]+_0xc7fe('0x2c')]){return rpc[_0x4a742f[_0xc7fe('0x26')]+_0xc7fe('0x2c')][_0xc7fe('0x35')](_0xad833c,_0x2cd5d8)[_0xc7fe('0x2e')](function(_0x2b23d2){logger['error'](_0xc7fe('0x32'));});}}}function handleFindQueue(_0x3e0ce6){return function(_0x2eb476){return _0x2eb476[_0xc7fe('0x2b')][_0xc7fe('0x36')]()===_0x3e0ce6['toLowerCase']();};}exports['consequence']=function(_0x46805c,_0x42282b,_0x42205a,_0xa14c66){return function(_0x2497a7){try{var _0xbac451={'name':_0x42282b[0x0],'timeout':_0x42282b[0x1]};var _0x4922b0=queue[_0xc7fe('0x0')](_0xbac451,{'typecast':!![]});if(_0x4922b0[_0xc7fe('0x37')]){logger[_0xc7fe('0x2f')](_0xc7fe('0x38'),_0x46805c,_['map'](_0x4922b0,'message')[_0xc7fe('0x39')](',\x20'));_0x2497a7[_0xc7fe('0x3a')]();}else{var _0x5b316a=_['find'](_0x42205a[_0xa14c66[_0xc7fe('0x26')]+'Queues'],handleFindQueue(_0xbac451[_0xc7fe('0x2b')]));if(_0x5b316a){startRouting(_0x46805c,_0x5b316a,_0xa14c66,_0x42205a);var _0x29a351=(_0x5b316a[_0xc7fe('0x33')]||0xa)*0x3e8;var _0x1a4cbe=(_0xbac451[_0xc7fe('0x33')]||0x14)*0x3e8;var _0x22802d,_0x11d7d3;if(_0x29a351>_0x1a4cbe){_0x1a4cbe=_0x29a351;}var _0x5dcda4=seqqueue[_0xc7fe('0x3b')](_0x29a351);_0x5dcda4['id']=_0x46805c;_0x5dcda4[_0xc7fe('0x3c')]=_0x29a351;_0x5dcda4[_0xc7fe('0x3d')]=_0x1a4cbe;_0x5dcda4[_0xc7fe('0x26')]=_0xa14c66[_0xc7fe('0x26')];_0x42205a['rules'][_0x46805c]['on'](_0xc7fe('0x3e'),function(){logger[_0xc7fe('0x2a')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x46805c);stopRouting(_0x46805c,_0x5b316a,_0xa14c66,_0x42205a);clearTimeout(_0x22802d);_0x22802d=undefined;_0x5dcda4[_0xc7fe('0x3f')](!![]);if(_0x42205a['rules'][_0x46805c]){delete _0x42205a[_0xc7fe('0x40')][_0x46805c];}_0x2497a7[_0xc7fe('0x3a')]();});_0x42205a[_0xc7fe('0x40')][_0x46805c]['on'](_0xc7fe('0x41'),function(){if(_0x42205a[_0xc7fe('0x40')][_0x46805c]){delete _0x42205a[_0xc7fe('0x40')][_0x46805c];}});_0x22802d=setTimeout(function(){logger[_0xc7fe('0x2a')](_0xc7fe('0x42'),_0x46805c);endRouting(_0x46805c,_0x5b316a,_0xa14c66,_0x42205a);clearTimeout(_0x22802d);_0x5dcda4['close'](!![]);_0x2497a7[_0xc7fe('0x43')]();},_0x1a4cbe);switch(_0x5b316a[_0xc7fe('0x44')]){case _0xc7fe('0x45'):strategy[_0xc7fe('0x45')](_0x5dcda4,_0x5b316a,_0x42205a,_0xa14c66);break;default:strategy[_0xc7fe('0x46')](_0x5dcda4,_0x5b316a,_0x42205a,_0xa14c66);}}else{logger['error'](_0xc7fe('0x47'),_0x46805c,_0xbac451[_0xc7fe('0x2b')]);_0x2497a7[_0xc7fe('0x3a')]();}}}catch(_0xc6534e){console[_0xc7fe('0x48')](_0xc6534e);logger['error']('[%s][QUEUE]\x20%s',_0x46805c,_0xc6534e[_0xc7fe('0x49')]);_0x2497a7[_0xc7fe('0x3a')]();}};}; \ No newline at end of file +var _0x5c57=['../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','waiting','body','from','contact','list','upperFirst','channel','interaction','message','AccountId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','YYYY-MM-DD\x20HH:mm:ss','accepted','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','join','stop','Queues','createQueue','qtimeout','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','rules','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','lodash','util','seq-queue','moment','ioredis','../../../../config/environment','routing','redis','queue_id','account','queue','joinAt','emit','clone','format','pick','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x5c57,0x116));var _0x75c5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5c57[_0x3dd15e];return _0x231fd0;};'use strict';var schema=require(_0x75c5('0x0'));var _=require(_0x75c5('0x1'));var util=require(_0x75c5('0x2'));var seqqueue=require(_0x75c5('0x3'));var moment=require(_0x75c5('0x4'));var Redis=require(_0x75c5('0x5'));var config=require(_0x75c5('0x6'));var logger=require('../../../../config/logger')(_0x75c5('0x7'));var strategy=require('./strategy');config[_0x75c5('0x8')]=_['defaults'](config[_0x75c5('0x8')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var attributes=['id',_0x75c5('0x9'),_0x75c5('0xa'),_0x75c5('0xb'),'from',_0x75c5('0xc')];function emit(_0x7c5d09,_0x1ef0a2,_0x57af05){io['to'](_0x7c5d09)[_0x75c5('0xd')](_0x1ef0a2,_0x57af05);}function emitChannelQueueInteraction(_0x5c542e,_0x1c9e58,_0xac0d9f,_0x5dfb0f,_0x3650d7,_0x1b862c,_0x17fbfb,_0x2e8d03){var _0x253a68=_[_0x75c5('0xe')](_0xac0d9f);_0x253a68['queue_id']=_0x2e8d03;_0x253a68[_0x75c5('0xb')]=_0x1c9e58;_0x253a68[_0x75c5('0xa')]=_0x5dfb0f;_0x253a68['id']=_0x3650d7;if(_0x1b862c){_0x17fbfb[util[_0x75c5('0xf')]('%sQueuesWaitingInteractions',_0x5c542e)][_0x3650d7]=_[_0x75c5('0x10')](_0x253a68,attributes);}else{delete _0x17fbfb[util['format'](_0x75c5('0x11'),_0x5c542e)][_0x3650d7];}emit(util[_0x75c5('0xf')](_0x75c5('0x12'),_0x5c542e,_0x1c9e58),util[_0x75c5('0xf')](_0x75c5('0x13'),_0x5c542e,_0x1b862c?_0x75c5('0x14'):_0x75c5('0x15')),_[_0x75c5('0x10')](_0x253a68,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0x75c5('0x16')),'smsQueueReport':require(_0x75c5('0x17')),'faxQueueReport':require(_0x75c5('0x18')),'whatsappQueueReport':require(_0x75c5('0x19'))};var queue=schema({'name':{'type':_0x75c5('0x1a'),'required':!![],'message':_0x75c5('0x1b')},'timeout':{'type':'number','message':_0x75c5('0x1c')}});function startRouting(_0x5d09d5,_0x1f19d3,_0x3e018d,_0x197008){if(_0x5d09d5&&_0x1f19d3&&_0x3e018d){_0x1f19d3[_0x75c5('0x1d')]+=0x1;var _0x10eb6={'uniqueid':_0x5d09d5,'from':_0x3e018d[_0x75c5('0x1e')]?_0x3e018d[_0x75c5('0x1e')][_0x75c5('0x1f')]:'','joinAt':moment()[_0x75c5('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3e018d[_0x75c5('0x20')]?_0x3e018d[_0x75c5('0x20')]['id']:null,'ListId':_0x3e018d[_0x75c5('0x21')]?_0x3e018d[_0x75c5('0x21')]['id']:null};_0x10eb6[_[_0x75c5('0x22')](_0x3e018d[_0x75c5('0x23')])+'QueueId']=_0x1f19d3['id']||null;_0x10eb6[_[_0x75c5('0x22')](_0x3e018d[_0x75c5('0x23')])+'InteractionId']=_0x3e018d[_0x75c5('0x24')]?_0x3e018d[_0x75c5('0x24')]['id']:null;_0x10eb6[_['upperFirst'](_0x3e018d['channel'])+'MessageId']=_0x3e018d[_0x75c5('0x25')]?_0x3e018d[_0x75c5('0x25')]['id']:null;_0x10eb6[_[_0x75c5('0x22')](_0x3e018d[_0x75c5('0x23')])+(_0x3e018d[_0x75c5('0x23')]!=='chat'?_0x75c5('0x26'):'WebsiteId')]=_0x3e018d[_0x75c5('0xa')]?_0x3e018d[_0x75c5('0xa')]['id']:null;logger[_0x75c5('0x27')](util[_0x75c5('0xf')](_0x75c5('0x28'),_0x5d09d5,_0x1f19d3['name']));emitChannelQueueInteraction(_0x3e018d['channel'],_0x1f19d3[_0x75c5('0x29')],_0x10eb6,_0x3e018d[_0x75c5('0xa')][_0x75c5('0x29')],_0x3e018d[_0x75c5('0x25')]['id'],!![],_0x197008,_0x1f19d3['id']);if(rpc[_0x3e018d[_0x75c5('0x23')]+_0x75c5('0x2a')]){return rpc[_0x3e018d['channel']+'QueueReport'][_0x75c5('0x2b')](_0x10eb6)[_0x75c5('0x2c')](function(_0x5b432c){logger[_0x75c5('0x2d')](_0x75c5('0x2e'));});}}}function stopRouting(_0x3a6418,_0x2cbefe,_0x34b47b,_0x151f14){if(_0x3a6418&&_0x2cbefe){_0x2cbefe[_0x75c5('0x1d')]-=0x1;var _0x1d3dcb={'leaveAt':moment()[_0x75c5('0xf')](_0x75c5('0x2f')),'acceptAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x75c5('0x30')};logger['info'](util[_0x75c5('0xf')](_0x75c5('0x31'),_0x3a6418,_0x2cbefe[_0x75c5('0x29')]));emitChannelQueueInteraction(_0x34b47b['channel'],_0x2cbefe[_0x75c5('0x29')],_0x34b47b[_0x75c5('0x1e')],_0x34b47b[_0x75c5('0xa')][_0x75c5('0x29')],_0x34b47b[_0x75c5('0x25')]['id'],![],_0x151f14,_0x2cbefe['id']);if(rpc[_0x34b47b['channel']+_0x75c5('0x2a')]){return rpc[_0x34b47b[_0x75c5('0x23')]+_0x75c5('0x2a')][_0x75c5('0x32')](_0x3a6418,_0x1d3dcb)[_0x75c5('0x2c')](function(_0x2223ca){logger['error'](_0x75c5('0x33'));});}}}function endRouting(_0x3bffd1,_0x3d8258,_0x327023,_0x2821a1){if(_0x3bffd1&&_0x3d8258){_0x3d8258[_0x75c5('0x1d')]-=0x1;var _0x231888={'leaveAt':moment()['format'](_0x75c5('0x2f')),'exitAt':moment()['format'](_0x75c5('0x2f')),'reason':_0x75c5('0x34')};logger[_0x75c5('0x27')](util[_0x75c5('0xf')](_0x75c5('0x35'),_0x3bffd1,_0x3d8258[_0x75c5('0x29')]));emitChannelQueueInteraction(_0x327023[_0x75c5('0x23')],_0x3d8258[_0x75c5('0x29')],_0x327023['body'],_0x327023[_0x75c5('0xa')]['name'],_0x327023['message']['id'],![],_0x2821a1);if(rpc[_0x327023[_0x75c5('0x23')]+_0x75c5('0x2a')]){return rpc[_0x327023[_0x75c5('0x23')]+_0x75c5('0x2a')][_0x75c5('0x32')](_0x3bffd1,_0x231888)[_0x75c5('0x2c')](function(_0x1e216e){logger[_0x75c5('0x2d')](_0x75c5('0x33'));});}}}function handleFindQueue(_0x1b86dc){return function(_0x580bcc){return _0x580bcc[_0x75c5('0x29')]['toLowerCase']()===_0x1b86dc[_0x75c5('0x36')]();};}exports[_0x75c5('0x37')]=function(_0x529204,_0x51b642,_0x11119c,_0x30dcd8){return function(_0x388bb3){try{var _0x41e51c={'name':_0x51b642[0x0],'timeout':_0x51b642[0x1]};var _0x28bcef=queue['validate'](_0x41e51c,{'typecast':!![]});if(_0x28bcef[_0x75c5('0x38')]){logger[_0x75c5('0x2d')](_0x75c5('0x39'),_0x529204,_['map'](_0x28bcef,'message')[_0x75c5('0x3a')](',\x20'));_0x388bb3[_0x75c5('0x3b')]();}else{var _0x1818b7=_['find'](_0x11119c[_0x30dcd8[_0x75c5('0x23')]+_0x75c5('0x3c')],handleFindQueue(_0x41e51c[_0x75c5('0x29')]));if(_0x1818b7){startRouting(_0x529204,_0x1818b7,_0x30dcd8,_0x11119c);var _0x5326c3=(_0x1818b7['timeout']||0xa)*0x3e8;var _0x4ac3d3=(_0x41e51c[_0x75c5('0x34')]||0x14)*0x3e8;var _0xbd7d06,_0x3c2be7;if(_0x5326c3>_0x4ac3d3){_0x4ac3d3=_0x5326c3;}var _0x58fe3b=seqqueue[_0x75c5('0x3d')](_0x5326c3);_0x58fe3b['id']=_0x529204;_0x58fe3b['atimeout']=_0x5326c3;_0x58fe3b[_0x75c5('0x3e')]=_0x4ac3d3;_0x58fe3b[_0x75c5('0x23')]=_0x30dcd8['channel'];_0x11119c['rules'][_0x529204]['on'](_0x75c5('0x3f'),function(){logger[_0x75c5('0x27')](_0x75c5('0x40'),_0x529204);stopRouting(_0x529204,_0x1818b7,_0x30dcd8,_0x11119c);clearTimeout(_0xbd7d06);_0xbd7d06=undefined;_0x58fe3b[_0x75c5('0x41')](!![]);if(_0x11119c[_0x75c5('0x42')][_0x529204]){delete _0x11119c[_0x75c5('0x42')][_0x529204];}_0x388bb3[_0x75c5('0x3b')]();});_0x11119c[_0x75c5('0x42')][_0x529204]['on'](_0x75c5('0x43'),function(){if(_0x11119c[_0x75c5('0x42')][_0x529204]){delete _0x11119c[_0x75c5('0x42')][_0x529204];}});_0xbd7d06=setTimeout(function(){logger['info'](_0x75c5('0x44'),_0x529204);endRouting(_0x529204,_0x1818b7,_0x30dcd8,_0x11119c);clearTimeout(_0xbd7d06);_0x58fe3b[_0x75c5('0x41')](!![]);_0x388bb3[_0x75c5('0x45')]();},_0x4ac3d3);switch(_0x1818b7['strategy']){case _0x75c5('0x46'):strategy['rrmemory'](_0x58fe3b,_0x1818b7,_0x11119c,_0x30dcd8);break;default:strategy[_0x75c5('0x47')](_0x58fe3b,_0x1818b7,_0x11119c,_0x30dcd8);}}else{logger[_0x75c5('0x2d')](_0x75c5('0x48'),_0x529204,_0x41e51c[_0x75c5('0x29')]);_0x388bb3[_0x75c5('0x3b')]();}}}catch(_0x4d3354){console[_0x75c5('0x49')](_0x4d3354);logger[_0x75c5('0x2d')](_0x75c5('0x39'),_0x529204,_0x4d3354[_0x75c5('0x4a')]);_0x388bb3[_0x75c5('0x3b')]();}};}; \ 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 434634e..f115e98 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 _0xe542=['./util','../../../../../config/logger','routing','notificationId','squeue','agent','realtime','push','handleRun','handleTimeout','bind','timeout','drained','prototype','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','busy','busyQueue','showNotification','writeLog','RINGING',':FORCED','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','STOP','TIMEOUT','exports','uuid'];(function(_0x53a2a1,_0x595e09){var _0x270bc4=function(_0x27c716){while(--_0x27c716){_0x53a2a1['push'](_0x53a2a1['shift']());}};_0x270bc4(++_0x595e09);}(_0xe542,0x131));var _0x2e54=function(_0x2b38f7,_0x3897af){_0x2b38f7=_0x2b38f7-0x0;var _0x4f8e27=_0xe542[_0x2b38f7];return _0x4f8e27;};'use strict';var _=require('lodash');var uuid=require(_0x2e54('0x0'));var util=require(_0x2e54('0x1'));var logger=require(_0x2e54('0x2'))(_0x2e54('0x3'));var Agent=function(_0x49569b,_0x3d4c48,_0x240a50,_0xcd80c7){this[_0x2e54('0x4')]=uuid['v4']();this[_0x2e54('0x5')]=_0x49569b;this[_0x2e54('0x6')]=_0x3d4c48;this[_0x2e54('0x7')]=_0x240a50;this[_0x2e54('0x3')]=_0xcd80c7;this[_0x2e54('0x5')][_0x2e54('0x8')](this[_0x2e54('0x9')]['bind'](this),this[_0x2e54('0xa')][_0x2e54('0xb')](this));this[_0x2e54('0x5')]['on'](_0x2e54('0xc'),this[_0x2e54('0xa')]['bind'](this));this[_0x2e54('0x5')]['on'](_0x2e54('0xd'),this['handleDrained'][_0x2e54('0xb')](this));};Agent['prototype']['push']=function(){this[_0x2e54('0x5')][_0x2e54('0x8')](this[_0x2e54('0x9')][_0x2e54('0xb')](this),this['handleTimeout'][_0x2e54('0xb')](this));};Agent[_0x2e54('0xe')]['handleDrained']=function(){this[_0x2e54('0xa')](!![]);};Agent[_0x2e54('0xe')][_0x2e54('0x9')]=function(_0x1c18ce){logger[_0x2e54('0xf')](_0x2e54('0x10'),this[_0x2e54('0x5')]['id'],this[_0x2e54('0x6')]['id']);if(_[_0x2e54('0x11')](this['realtime'][_0x2e54('0x12')][this['agent']['id']])){logger[_0x2e54('0xf')](_0x2e54('0x13'),this[_0x2e54('0x5')]['id'],this[_0x2e54('0x6')]['id']);setTimeout(this['push'][_0x2e54('0xb')](this),0x3e8);}else{if(this[_0x2e54('0x3')][_0x2e54('0x14')]||util[_0x2e54('0x15')](this[_0x2e54('0x5')]['id'],this['realtime'][_0x2e54('0x12')][this['agent']['id']],this['squeue'][_0x2e54('0x16')],![])){this[_0x2e54('0x7')][_0x2e54('0x12')][this[_0x2e54('0x6')]['id']][_0x2e54('0x17')]=!![];this[_0x2e54('0x7')][_0x2e54('0x12')][this[_0x2e54('0x6')]['id']][_0x2e54('0x18')]=undefined;util[_0x2e54('0x19')](this[_0x2e54('0x4')],this[_0x2e54('0x5')]['id'],this[_0x2e54('0x7')][_0x2e54('0x12')][this[_0x2e54('0x6')]['id']],null,this['routing']);util[_0x2e54('0x1a')](this[_0x2e54('0x5')]['id'],this[_0x2e54('0x7')][_0x2e54('0x12')][this[_0x2e54('0x6')]['id']],_0x2e54('0x1b')+(this[_0x2e54('0x3')]['forcedOwnership']?_0x2e54('0x1c'):''));}else{logger[_0x2e54('0xf')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this['squeue']['id'],this[_0x2e54('0x6')]['id']);setTimeout(this['push'][_0x2e54('0xb')](this),0x3e8);}}};Agent[_0x2e54('0xe')][_0x2e54('0xa')]=function(_0x29a461){if(_[_0x2e54('0x11')](this[_0x2e54('0x7')]['agents'][this[_0x2e54('0x6')]['id']])){return logger[_0x2e54('0xf')](_0x2e54('0x13'),this[_0x2e54('0x5')]['id'],this[_0x2e54('0x6')]['id']);}else{logger[_0x2e54('0xf')](_0x2e54('0x1d'),this['squeue']['id'],this['agent']['id']);util[_0x2e54('0x1e')](this[_0x2e54('0x4')],this['squeue']['id'],this[_0x2e54('0x7')][_0x2e54('0x12')][this[_0x2e54('0x6')]['id']],null,this[_0x2e54('0x3')]);this[_0x2e54('0x7')][_0x2e54('0x12')][this['agent']['id']]['busy']=![];this['realtime'][_0x2e54('0x12')][this[_0x2e54('0x6')]['id']][_0x2e54('0x18')]=undefined;util[_0x2e54('0x1a')](this[_0x2e54('0x5')]['id'],this[_0x2e54('0x7')][_0x2e54('0x12')][this['agent']['id']],_0x29a461?_0x2e54('0x1f'):_0x2e54('0x20'));}if(!_0x29a461){setTimeout(this['push']['bind'](this),0x3e8);}};function agent(_0x22fa9b,_0x32d103,_0x53ee23,_0x382d00){return new Agent(_0x22fa9b,_0x32d103,_0x53ee23,_0x382d00);}module[_0x2e54('0x21')]=agent; \ No newline at end of file +var _0x4535=['busyQueue','showNotification','writeLog','RINGING',':FORCED','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','TIMEOUT','exports','lodash','uuid','./util','routing','notificationId','squeue','agent','realtime','push','handleRun','handleTimeout','bind','timeout','prototype','handleDrained','info','isNil','agents','forcedOwnership','isAgentAvailable','channel','busy'];(function(_0x3ff774,_0x2b9150){var _0x14c81e=function(_0x2dcb2d){while(--_0x2dcb2d){_0x3ff774['push'](_0x3ff774['shift']());}};_0x14c81e(++_0x2b9150);}(_0x4535,0x66));var _0x5453=function(_0x3f7ad6,_0x117519){_0x3f7ad6=_0x3f7ad6-0x0;var _0x5867ca=_0x4535[_0x3f7ad6];return _0x5867ca;};'use strict';var _=require(_0x5453('0x0'));var uuid=require(_0x5453('0x1'));var util=require(_0x5453('0x2'));var logger=require('../../../../../config/logger')(_0x5453('0x3'));var Agent=function(_0x3a86e5,_0x20e97f,_0x3cccae,_0x441aa4){this[_0x5453('0x4')]=uuid['v4']();this[_0x5453('0x5')]=_0x3a86e5;this[_0x5453('0x6')]=_0x20e97f;this[_0x5453('0x7')]=_0x3cccae;this[_0x5453('0x3')]=_0x441aa4;this[_0x5453('0x5')][_0x5453('0x8')](this[_0x5453('0x9')]['bind'](this),this[_0x5453('0xa')][_0x5453('0xb')](this));this[_0x5453('0x5')]['on'](_0x5453('0xc'),this[_0x5453('0xa')][_0x5453('0xb')](this));this['squeue']['on']('drained',this['handleDrained'][_0x5453('0xb')](this));};Agent[_0x5453('0xd')][_0x5453('0x8')]=function(){this['squeue'][_0x5453('0x8')](this[_0x5453('0x9')]['bind'](this),this[_0x5453('0xa')]['bind'](this));};Agent[_0x5453('0xd')][_0x5453('0xe')]=function(){this[_0x5453('0xa')](!![]);};Agent[_0x5453('0xd')]['handleRun']=function(_0x177101){logger[_0x5453('0xf')]('[%s][AGENT]\x20try\x20with\x20%s',this['squeue']['id'],this[_0x5453('0x6')]['id']);if(_[_0x5453('0x10')](this['realtime'][_0x5453('0x11')][this[_0x5453('0x6')]['id']])){logger['info']('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x5453('0x5')]['id'],this[_0x5453('0x6')]['id']);setTimeout(this[_0x5453('0x8')][_0x5453('0xb')](this),0x3e8);}else{if(this['routing'][_0x5453('0x12')]||util[_0x5453('0x13')](this['squeue']['id'],this[_0x5453('0x7')]['agents'][this[_0x5453('0x6')]['id']],this[_0x5453('0x5')][_0x5453('0x14')],![])){this[_0x5453('0x7')]['agents'][this[_0x5453('0x6')]['id']][_0x5453('0x15')]=!![];this[_0x5453('0x7')][_0x5453('0x11')][this[_0x5453('0x6')]['id']][_0x5453('0x16')]=undefined;util[_0x5453('0x17')](this['notificationId'],this['squeue']['id'],this['realtime']['agents'][this[_0x5453('0x6')]['id']],null,this[_0x5453('0x3')]);util[_0x5453('0x18')](this['squeue']['id'],this['realtime'][_0x5453('0x11')][this[_0x5453('0x6')]['id']],_0x5453('0x19')+(this[_0x5453('0x3')][_0x5453('0x12')]?_0x5453('0x1a'):''));}else{logger['info']('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0x5453('0x5')]['id'],this[_0x5453('0x6')]['id']);setTimeout(this[_0x5453('0x8')][_0x5453('0xb')](this),0x3e8);}}};Agent[_0x5453('0xd')][_0x5453('0xa')]=function(_0x46064c){if(_[_0x5453('0x10')](this[_0x5453('0x7')]['agents'][this[_0x5453('0x6')]['id']])){return logger[_0x5453('0xf')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x5453('0x5')]['id'],this[_0x5453('0x6')]['id']);}else{logger['info'](_0x5453('0x1b'),this[_0x5453('0x5')]['id'],this['agent']['id']);util[_0x5453('0x1c')](this[_0x5453('0x4')],this[_0x5453('0x5')]['id'],this[_0x5453('0x7')][_0x5453('0x11')][this['agent']['id']],null,this[_0x5453('0x3')]);this[_0x5453('0x7')][_0x5453('0x11')][this[_0x5453('0x6')]['id']][_0x5453('0x15')]=![];this[_0x5453('0x7')][_0x5453('0x11')][this['agent']['id']]['busyQueue']=undefined;util[_0x5453('0x18')](this[_0x5453('0x5')]['id'],this[_0x5453('0x7')]['agents'][this[_0x5453('0x6')]['id']],_0x46064c?'STOP':_0x5453('0x1d'));}if(!_0x46064c){setTimeout(this[_0x5453('0x8')][_0x5453('0xb')](this),0x3e8);}};function agent(_0x2bac9b,_0x48ed7b,_0x488ba5,_0x4903f5){return new Agent(_0x2bac9b,_0x48ed7b,_0x488ba5,_0x4903f5);}module[_0x5453('0x1e')]=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 bb72c6a..a3b1f0b 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 _0x28e3=['handleRun','bind','handleTimeout','prototype','push','handleDrained','isNil','Agents','length','agents','info','isAgentAvailable','channel','writeLog','RINGING','busyQueue','name','routing','[%s][QUEUE]\x20EMPTY','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','STOP','exports','lodash','uuid','./util','../../../../../config/logger','notificationId','squeue','queue','realtime'];(function(_0x59248f,_0x5d7264){var _0x2cf486=function(_0x491e90){while(--_0x491e90){_0x59248f['push'](_0x59248f['shift']());}};_0x2cf486(++_0x5d7264);}(_0x28e3,0x106));var _0x328e=function(_0x2053ea,_0x1ab2d4){_0x2053ea=_0x2053ea-0x0;var _0x2232c4=_0x28e3[_0x2053ea];return _0x2232c4;};'use strict';var _=require(_0x328e('0x0'));var uuid=require(_0x328e('0x1'));var util=require(_0x328e('0x2'));var logger=require(_0x328e('0x3'))('routing');var Beepall=function(_0x5f1520,_0x392b85,_0x106c30,_0x168893){this[_0x328e('0x4')]=uuid['v4']();this[_0x328e('0x5')]=_0x5f1520;this[_0x328e('0x6')]=_0x392b85;this[_0x328e('0x7')]=_0x106c30;this['routing']=_0x168893;this['squeue']['push'](this[_0x328e('0x8')][_0x328e('0x9')](this),this[_0x328e('0xa')][_0x328e('0x9')](this));this[_0x328e('0x5')]['on']('timeout',this[_0x328e('0xa')][_0x328e('0x9')](this));this[_0x328e('0x5')]['on']('drained',this['handleDrained']['bind'](this));};Beepall[_0x328e('0xb')][_0x328e('0xc')]=function(){this[_0x328e('0x5')][_0x328e('0xc')](this[_0x328e('0x8')][_0x328e('0x9')](this),this[_0x328e('0xa')][_0x328e('0x9')](this));};Beepall[_0x328e('0xb')][_0x328e('0xd')]=function(_0xb252e5){this['handleTimeout'](!![]);};Beepall[_0x328e('0xb')][_0x328e('0x8')]=function(_0x1552ce){var _0x1a035d=!![];if(!_[_0x328e('0xe')](this[_0x328e('0x6')])&&!_[_0x328e('0xe')](this[_0x328e('0x6')][_0x328e('0xf')])&&this['queue'][_0x328e('0xf')][_0x328e('0x10')]>0x0){for(var _0x116f46=0x0,_0x1adadc;_0x116f460x0){for(var _0x19f510=0x0,_0x3d63a5;_0x19f5100x0&&_0x5c6e66[_0x1322ec+_0xb0a6('0x1f')]>=_0x5c6e66[_0x1322ec+_0xb0a6('0x1e')]){writeLog(_0x3db6a6,_0x5c6e66,_0x1322ec[_0xb0a6('0x20')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0xb0a6('0x21')]=function(_0x3347ac,_0x3edd9a,_0xc1c647,_0x10cf86,_0x3aef2b){return sendNotification(!![],_0x3347ac,_0x3edd9a,_0xc1c647,_0x10cf86,_0x3aef2b);};exports[_0xb0a6('0x22')]=function(_0x305661,_0x4255b9,_0x4ced9f,_0x12d683,_0x26eb41){return sendNotification(![],_0x305661,_0x4255b9,_0x4ced9f,_0x12d683,_0x26eb41);};exports[_0xb0a6('0x23')]=writeLog; \ No newline at end of file +var _0x4975=['notificationShake','body','queue','msg','getMustacheRender','notificationTemplate','error','[%s][QUEUE]\x20%s','notification:%s','save','remove','isAgentAvailable','online','OFFLINE','Pause','PAUSE','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','lodash','../utils','mustache','ioredis','../../../../../config/environment','../../../../../config/logger','routing','redis','defaults','localhost','emit','format','user:%s','name','user:save','\x20interaction','account','notificationSound'];(function(_0xa1a68d,_0x59786f){var _0x508e61=function(_0x6ee42f){while(--_0x6ee42f){_0xa1a68d['push'](_0xa1a68d['shift']());}};_0x508e61(++_0x59786f);}(_0x4975,0x86));var _0x5497=function(_0x1c961a,_0x356404){_0x1c961a=_0x1c961a-0x0;var _0x3cd4ef=_0x4975[_0x1c961a];return _0x3cd4ef;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var utils=require(_0x5497('0x1'));var Mustache=require(_0x5497('0x2'));var Redis=require(_0x5497('0x3'));var config=require(_0x5497('0x4'));var logger=require(_0x5497('0x5'))(_0x5497('0x6'));config[_0x5497('0x7')]=_[_0x5497('0x8')](config[_0x5497('0x7')],{'host':_0x5497('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x5497('0x7')]));function emit(_0x4f563d,_0x1d0019,_0x674a2a){io['to'](_0x4f563d)[_0x5497('0xa')](_0x1d0019,_0x674a2a);}function sendNotification(_0x57f930,_0x42af11,_0x49d94b,_0x1f63d8,_0x29c93f,_0x2ec5a4){io['to'](util[_0x5497('0xb')](_0x5497('0xc'),_0x1f63d8[_0x5497('0xd')]))[_0x5497('0xa')](_0x5497('0xe'),_0x1f63d8);var _0x50d716=_0x2ec5a4||{};var _0x5874ef=_0x49d94b['split']('.');var _0xc250bb={'uniqueid':_0x42af11,'channel':_0x5874ef[0x0],'id':_0x5874ef[0x1],'title':_0x5874ef[0x0]+_0x5497('0xf'),'interactionId':_0x5874ef[0x2],'queue':_0x29c93f?_0x29c93f[_0x5497('0xd')]:null,'sound':_0x50d716[_0x5497('0x10')][_0x5497('0x11')],'shake':_0x50d716[_0x5497('0x10')][_0x5497('0x12')]};try{if(!_0x50d716[_0x5497('0x13')]){_0x50d716[_0x5497('0x13')]={};}if(_0x29c93f){_0x50d716[_0x5497('0x13')]['queue']=_0x29c93f;}else if(_0x50d716[_0x5497('0x13')]['queue']){delete _0x50d716[_0x5497('0x13')][_0x5497('0x14')];}_0xc250bb[_0x5497('0x15')]=utils[_0x5497('0x16')](_0x50d716[_0x5497('0x10')][_0x5497('0x17')],_0x50d716);}catch(_0x2f2997){_0xc250bb['msg']='I\x20can\x27t\x20render\x20your\x20template';logger[_0x5497('0x18')](util[_0x5497('0xb')](_0x5497('0x19'),_0x42af11,_0x2f2997['message']));}io['to'](util[_0x5497('0xb')](_0x5497('0xc'),_0x1f63d8[_0x5497('0xd')]))[_0x5497('0xa')](util[_0x5497('0xb')](_0x5497('0x1a'),_0x57f930?_0x5497('0x1b'):_0x5497('0x1c')),_0xc250bb);}function writeLog(_0x2e3960,_0x3f54ef,_0x186065){return logger['info'](util[_0x5497('0xb')]('[%s][QUEUE][AGENT:%s][STATUS:%s]',_0x2e3960,_0x3f54ef[_0x5497('0xd')],_0x186065));}exports[_0x5497('0x1d')]=function(_0x44265c,_0x2f587d,_0x35ecd9,_0x3b2fbc){if(_0x2f587d['busy']){writeLog(_0x44265c,_0x2f587d,'BUSY');return![];}if(!_0x2f587d[_0x5497('0x1e')]){writeLog(_0x44265c,_0x2f587d,_0x5497('0x1f'));return![];}if(_0x2f587d[_0x35ecd9+_0x5497('0x20')]){writeLog(_0x44265c,_0x2f587d,_0x5497('0x21'));return![];}if(_0x3b2fbc&&_0x2f587d['hasOwnProperty'](_0x35ecd9+_0x5497('0x22'))&&_0x2f587d['hasOwnProperty'](_0x35ecd9+_0x5497('0x23'))){if(_0x2f587d[_0x35ecd9+_0x5497('0x22')]>0x0&&_0x2f587d[_0x35ecd9+_0x5497('0x23')]>=_0x2f587d[_0x35ecd9+_0x5497('0x22')]){writeLog(_0x44265c,_0x2f587d,_0x35ecd9[_0x5497('0x24')]()+_0x5497('0x25'));return![];}}return!![];};exports['showNotification']=function(_0x4af5f4,_0x5406e2,_0x583d06,_0x498f15,_0x39a2b7){return sendNotification(!![],_0x4af5f4,_0x5406e2,_0x583d06,_0x498f15,_0x39a2b7);};exports['hideNotification']=function(_0x5e9356,_0xc3465,_0xb14593,_0x1cf908,_0x4c442a){return sendNotification(![],_0x5e9356,_0xc3465,_0xb14593,_0x1cf908,_0x4c442a);};exports['writeLog']=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 1ef297d..2c35d5d 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 _0x30cb=['../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','message','info','next','exec','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','error','[%s][SYSTEM]\x20%s','isObject','stringify','validate','shelljs','lodash','./utils'];(function(_0x5ddec9,_0x209a36){var _0x5abb94=function(_0x5816db){while(--_0x5816db){_0x5ddec9['push'](_0x5ddec9['shift']());}};_0x5abb94(++_0x209a36);}(_0x30cb,0x1c4));var _0xb30c=function(_0x4f4c11,_0xdb6add){_0x4f4c11=_0x4f4c11-0x0;var _0x4dfd33=_0x30cb[_0x4f4c11];return _0x4dfd33;};'use strict';var schema=require(_0xb30c('0x0'));var sh=require(_0xb30c('0x1'));var _=require(_0xb30c('0x2'));var utils=require(_0xb30c('0x3'));var logger=require(_0xb30c('0x4'))(_0xb30c('0x5'));var system=schema({'command':{'type':_0xb30c('0x6'),'required':!![],'message':_0xb30c('0x7')}});exports[_0xb30c('0x8')]=function(_0x4c16d4,_0x5c0fcd){return function(_0x3996e0){try{var _0x5677b8={'command':_0x5c0fcd[0x0]};var _0x14959d=system['validate'](_0x5677b8,{'typecast':!![]});if(_0x14959d[_0xb30c('0x9')]){logger['error']('[%s][SYSTEM]\x20%s',_0x4c16d4,_['map'](_0x14959d,_0xb30c('0xa'))['join'](',\x20'));logger[_0xb30c('0xb')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x4c16d4);_0x3996e0[_0xb30c('0xc')]();}else{var _0x4e7490=this;var _0xb3a257=utils['getMustacheRender'](_0x5c0fcd[0x0],this);logger[_0xb30c('0xb')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x4c16d4,_0xb3a257);sh[_0xb30c('0xd')](_['trim'](_0xb3a257),function(_0x4b67c5,_0x3d248a){logger[_0xb30c('0xb')](_0xb30c('0xe'),_0x4c16d4,_0x4b67c5);if(_0x4b67c5==0x0){var _0x308237=_0x3d248a[_0xb30c('0xf')](/(\r\n|\n|\r)/gm,'');if(_[_0xb30c('0x10')](_0x5c0fcd[0x1])||_[_0xb30c('0x11')](_0x5c0fcd[0x1])){logger[_0xb30c('0xb')]('[%s][SYSTEM]\x20no\x20variable',_0x4c16d4);_0x4e7490[_0xb30c('0x12')][_0x5c0fcd[0x1]]=_0x308237;}else{logger['info'](_0xb30c('0x13'),_0x4c16d4,_0x5c0fcd[0x1],_0x308237);_0x4e7490[_0xb30c('0x12')][_0x5c0fcd[0x1]]=_0x308237;}}_0x3996e0[_0xb30c('0xc')]();});}}catch(_0x2a0d1f){logger[_0xb30c('0x14')](_0xb30c('0x15'),_0x4c16d4,_[_0xb30c('0x16')](_0x2a0d1f)?JSON[_0xb30c('0x17')](_0x2a0d1f):_0x2a0d1f);logger[_0xb30c('0xb')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x4c16d4);_0x3996e0[_0xb30c('0xc')]();}};}; \ No newline at end of file +var _0xfdd7=['command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','[%s][SYSTEM]\x20%s','map','message','join','info','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','error','isObject','stringify','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','validate','shelljs','lodash','../../../../config/logger','routing'];(function(_0x432d86,_0x45364c){var _0x359e1c=function(_0x3e25fb){while(--_0x3e25fb){_0x432d86['push'](_0x432d86['shift']());}};_0x359e1c(++_0x45364c);}(_0xfdd7,0xa3));var _0x7fdd=function(_0x260838,_0x2cf7d5){_0x260838=_0x260838-0x0;var _0x4a6796=_0xfdd7[_0x260838];return _0x4a6796;};'use strict';var schema=require(_0x7fdd('0x0'));var sh=require(_0x7fdd('0x1'));var _=require(_0x7fdd('0x2'));var utils=require('./utils');var logger=require(_0x7fdd('0x3'))(_0x7fdd('0x4'));var system=schema({'command':{'type':'string','required':!![],'message':_0x7fdd('0x5')}});exports[_0x7fdd('0x6')]=function(_0x3fb5ac,_0x238cac){return function(_0x2557f8){try{var _0x54deda={'command':_0x238cac[0x0]};var _0x40dbe3=system[_0x7fdd('0x0')](_0x54deda,{'typecast':!![]});if(_0x40dbe3[_0x7fdd('0x7')]){logger['error'](_0x7fdd('0x8'),_0x3fb5ac,_[_0x7fdd('0x9')](_0x40dbe3,_0x7fdd('0xa'))[_0x7fdd('0xb')](',\x20'));logger[_0x7fdd('0xc')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x3fb5ac);_0x2557f8['next']();}else{var _0x9f2764=this;var _0x175940=utils['getMustacheRender'](_0x238cac[0x0],this);logger[_0x7fdd('0xc')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x3fb5ac,_0x175940);sh['exec'](_[_0x7fdd('0xd')](_0x175940),function(_0x59ba21,_0x3743cb){logger['info'](_0x7fdd('0xe'),_0x3fb5ac,_0x59ba21);if(_0x59ba21==0x0){var _0x17a502=_0x3743cb['replace'](/(\r\n|\n|\r)/gm,'');if(_[_0x7fdd('0xf')](_0x238cac[0x1])||_[_0x7fdd('0x10')](_0x238cac[0x1])){logger[_0x7fdd('0xc')](_0x7fdd('0x11'),_0x3fb5ac);_0x9f2764[_0x7fdd('0x12')][_0x238cac[0x1]]=_0x17a502;}else{logger[_0x7fdd('0xc')](_0x7fdd('0x13'),_0x3fb5ac,_0x238cac[0x1],_0x17a502);_0x9f2764[_0x7fdd('0x12')][_0x238cac[0x1]]=_0x17a502;}}_0x2557f8['next']();});}}catch(_0x552a8f){logger[_0x7fdd('0x14')]('[%s][SYSTEM]\x20%s',_0x3fb5ac,_[_0x7fdd('0x15')](_0x552a8f)?JSON[_0x7fdd('0x16')](_0x552a8f):_0x552a8f);logger['info'](_0x7fdd('0x17'),_0x3fb5ac);_0x2557f8['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 e6aeeb4..5d40fbf 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 _0x0d28=['consequence','validate','length','error','[%s][TAG]\x20%s','message','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','channel','Interaction','addTags','interaction','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','stringify','finally','next','isObject','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing'];(function(_0x5a5a8a,_0x3b1050){var _0xfd289c=function(_0x3d8a27){while(--_0x3d8a27){_0x5a5a8a['push'](_0x5a5a8a['shift']());}};_0xfd289c(++_0x3b1050);}(_0x0d28,0x149));var _0x80d2=function(_0x5bdf15,_0x39f070){_0x5bdf15=_0x5bdf15-0x0;var _0x1c7939=_0x0d28[_0x5bdf15];return _0x1c7939;};'use strict';var schema=require('validate');var _=require(_0x80d2('0x0'));var rpc={'chatInteraction':require(_0x80d2('0x1')),'openchannelInteraction':require(_0x80d2('0x2')),'smsInteraction':require(_0x80d2('0x3')),'mailInteraction':require(_0x80d2('0x4')),'faxInteraction':require(_0x80d2('0x5')),'whatsappInteraction':require(_0x80d2('0x6'))};var logger=require(_0x80d2('0x7'))(_0x80d2('0x8'));var tag=schema({'tag':{'type':'number','required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0x80d2('0x9')]=function(_0x2ff894,_0x344410,_0x5b4173,_0x44fe3d){return function(_0x5e7a64){try{var _0x38f8fb={'tag':_0x344410[0x0]};var _0x22d378=tag[_0x80d2('0xa')](_0x38f8fb,{'typecast':!![]});if(_0x22d378[_0x80d2('0xb')]){logger[_0x80d2('0xc')](_0x80d2('0xd'),_0x2ff894,_['map'](_0x22d378,_0x80d2('0xe'))['join'](',\x20'));logger['info'](_0x80d2('0xf'),_0x2ff894);_0x5e7a64['next']();}else{var _0xe6ee6b={'ids':[_0x344410[0x0]]};if(rpc[_0x44fe3d[_0x80d2('0x10')]+_0x80d2('0x11')]){rpc[_0x44fe3d[_0x80d2('0x10')]+_0x80d2('0x11')][_0x80d2('0x12')](_0x44fe3d[_0x80d2('0x13')]['id'],_0xe6ee6b)['then'](function(_0x22f26d){logger[_0x80d2('0x14')](_0x80d2('0x15'),_0x2ff894,_0x344410[0x1],_0x44fe3d[_0x80d2('0x10')],_0x44fe3d['interaction']['id']);})['catch'](function(_0x612b63){logger[_0x80d2('0xc')]('[%s][TAG]\x20%s',_0x2ff894,JSON[_0x80d2('0x16')](_0x612b63));logger[_0x80d2('0x14')](_0x80d2('0xf'),_0x2ff894);})[_0x80d2('0x17')](function(){_0x5e7a64[_0x80d2('0x18')]();});}}}catch(_0x45ceca){logger['error'](_0x80d2('0xd'),_0x2ff894,_[_0x80d2('0x19')](_0x45ceca)?JSON[_0x80d2('0x16')](_0x45ceca):_0x45ceca);logger[_0x80d2('0x14')](_0x80d2('0xf'),_0x2ff894);_0x5e7a64[_0x80d2('0x18')]();}};}; \ No newline at end of file +var _0xf60a=['TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][TAG]\x20%s','map','message','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','addTags','then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','interaction','catch','stringify','finally','isObject','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing'];(function(_0x52071d,_0x1a6e5f){var _0x437165=function(_0x5272cd){while(--_0x5272cd){_0x52071d['push'](_0x52071d['shift']());}};_0x437165(++_0x1a6e5f);}(_0xf60a,0x172));var _0xaf60=function(_0xa9f1a1,_0x457440){_0xa9f1a1=_0xa9f1a1-0x0;var _0x4e210e=_0xf60a[_0xa9f1a1];return _0x4e210e;};'use strict';var schema=require('validate');var _=require(_0xaf60('0x0'));var rpc={'chatInteraction':require(_0xaf60('0x1')),'openchannelInteraction':require(_0xaf60('0x2')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0xaf60('0x3')),'faxInteraction':require(_0xaf60('0x4')),'whatsappInteraction':require(_0xaf60('0x5'))};var logger=require(_0xaf60('0x6'))(_0xaf60('0x7'));var tag=schema({'tag':{'type':'number','required':!![],'message':_0xaf60('0x8')}});exports[_0xaf60('0x9')]=function(_0x4c0afa,_0xd07339,_0x22c79c,_0x23e5c4){return function(_0x1c9eb1){try{var _0x4c8844={'tag':_0xd07339[0x0]};var _0x164b51=tag['validate'](_0x4c8844,{'typecast':!![]});if(_0x164b51[_0xaf60('0xa')]){logger[_0xaf60('0xb')](_0xaf60('0xc'),_0x4c0afa,_[_0xaf60('0xd')](_0x164b51,_0xaf60('0xe'))['join'](',\x20'));logger['info'](_0xaf60('0xf'),_0x4c0afa);_0x1c9eb1[_0xaf60('0x10')]();}else{var _0x6c210f={'ids':[_0xd07339[0x0]]};if(rpc[_0x23e5c4[_0xaf60('0x11')]+'Interaction']){rpc[_0x23e5c4[_0xaf60('0x11')]+'Interaction'][_0xaf60('0x12')](_0x23e5c4['interaction']['id'],_0x6c210f)[_0xaf60('0x13')](function(_0x25d2ff){logger[_0xaf60('0x14')](_0xaf60('0x15'),_0x4c0afa,_0xd07339[0x1],_0x23e5c4[_0xaf60('0x11')],_0x23e5c4[_0xaf60('0x16')]['id']);})[_0xaf60('0x17')](function(_0x518a32){logger['error'](_0xaf60('0xc'),_0x4c0afa,JSON[_0xaf60('0x18')](_0x518a32));logger[_0xaf60('0x14')](_0xaf60('0xf'),_0x4c0afa);})[_0xaf60('0x19')](function(){_0x1c9eb1['next']();});}}}catch(_0x4d1917){logger['error'](_0xaf60('0xc'),_0x4c0afa,_[_0xaf60('0x1a')](_0x4d1917)?JSON[_0xaf60('0x18')](_0x4d1917):_0x4d1917);logger[_0xaf60('0x14')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x4c0afa);_0x1c9eb1[_0xaf60('0x10')]();}};}; \ 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 951305f..31c7de0 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 _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x3c22f3,_0x483b11){var _0x2d1b2f=function(_0x14be5c){while(--_0x14be5c){_0x3c22f3['push'](_0x3c22f3['shift']());}};_0x2d1b2f(++_0x483b11);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Mustache=require(_0x0d8b('0x0'));var _=require(_0x0d8b('0x1'));module['exports']={'getMustacheRender':function(_0x585166,_0x4b72b0){return Mustache[_0x0d8b('0x2')](_0x585166,_[_0x0d8b('0x3')](_0x4b72b0[_0x0d8b('0x4')],{'contact':_0x4b72b0[_0x0d8b('0x5')],'message':_0x4b72b0[_0x0d8b('0x6')],'account':_0x4b72b0['account'],'interaction':_0x4b72b0['interaction'],'list':_0x4b72b0[_0x0d8b('0x7')]}))||'';}}; \ No newline at end of file +var _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0x526c76,_0x34d02a){var _0x4329c8=function(_0x32096c){while(--_0x32096c){_0x526c76['push'](_0x526c76['shift']());}};_0x4329c8(++_0x34d02a);}(_0xe706,0xa3));var _0x6e70=function(_0x4fa1f0,_0x5b5c01){_0x4fa1f0=_0x4fa1f0-0x0;var _0x20c7b6=_0xe706[_0x4fa1f0];return _0x20c7b6;};'use strict';var Mustache=require(_0x6e70('0x0'));var _=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'getMustacheRender':function(_0x5e8446,_0x2cae77){return Mustache[_0x6e70('0x3')](_0x5e8446,_[_0x6e70('0x4')](_0x2cae77[_0x6e70('0x5')],{'contact':_0x2cae77[_0x6e70('0x6')],'message':_0x2cae77[_0x6e70('0x7')],'account':_0x2cae77[_0x6e70('0x8')],'interaction':_0x2cae77[_0x6e70('0x9')],'list':_0x2cae77[_0x6e70('0xa')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index a8e7aa8..6c95913 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 _0x4a9a=['app','.js','toLowerCase','mail','push','slice','dialogflow','appdata','split','amazonlex','tag','TagId','%s:%s:%s','./interval','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','stringify','complete','stack','agent','agents','busy','emit','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','busyQueue','end','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','values','mailQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','uuid','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message','interaction','isArray','applications','length','join'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x4a9a,0x164));var _0xa4a9=function(_0x5a1d40,_0x127e8a){_0x5a1d40=_0x5a1d40-0x0;var _0x2bc28b=_0x4a9a[_0x5a1d40];return _0x2bc28b;};'use strict';var _=require(_0xa4a9('0x0'));var util=require(_0xa4a9('0x1'));var path=require(_0xa4a9('0x2'));var fs=require('fs');var jayson=require(_0xa4a9('0x3'));var BPromise=require(_0xa4a9('0x4'));var uuid=require(_0xa4a9('0x5'));var config=require(_0xa4a9('0x6'));var logger=require(_0xa4a9('0x7'))(_0xa4a9('0x8'));var rpc={'openchannelQueueReport':require(_0xa4a9('0x9')),'mailQueueReport':require(_0xa4a9('0xa')),'chatQueueReport':require(_0xa4a9('0xb')),'smsQueueReport':require(_0xa4a9('0xc')),'faxQueueReport':require(_0xa4a9('0xd')),'whatsappQueueReport':require(_0xa4a9('0xe'))};var RuleEngine=require(_0xa4a9('0xf'));function getId(_0xade4b6,_0x4068b8,_0xf214d7){return util[_0xa4a9('0x10')](_0xa4a9('0x11'),_0xade4b6,_0x4068b8||0x0,_0xf214d7||0x0);}function getIntervals(_0x41e462,_0x3e90fa){var _0x37fe3f=[];if(!_[_0xa4a9('0x12')](_0x3e90fa[_0xa4a9('0x13')])&&!_[_0xa4a9('0x12')](_0x41e462[_0x3e90fa['IntervalId']])&&!_[_0xa4a9('0x12')](_0x41e462[_0x3e90fa['IntervalId']][_0xa4a9('0x14')])){_0x37fe3f=_[_0xa4a9('0x15')](_0x41e462[_0x3e90fa['IntervalId']][_0xa4a9('0x14')],'interval');}else if(!_[_0xa4a9('0x12')](_0x3e90fa[_0xa4a9('0x16')])){_0x37fe3f=[_0x3e90fa[_0xa4a9('0x16')]];}return _0x37fe3f;}exports[_0xa4a9('0x17')]=function(_0x3e8b88){_0x3e8b88[_0xa4a9('0x18')]={};return new BPromise(function(_0xb8b579,_0x49c9bf){var _0x183f1e={'Start':function(_0x4ec012){var _0x4a452c=this;return new Promise(function(_0x4135da,_0x446cf4){if(_0x4ec012){try{var _0x37bc37=[];var _0x361b10=getId(_0x4ec012[_0xa4a9('0x19')],_0x4ec012[_0xa4a9('0x1a')]?_0x4ec012['message']['id']:0x0,_0x4ec012[_0xa4a9('0x1b')]?_0x4ec012['interaction']['id']:0x0);if(_0x4ec012['applications']&&_[_0xa4a9('0x1c')](_0x4ec012[_0xa4a9('0x1d')])&&_0x4ec012[_0xa4a9('0x1d')]['length']){for(var _0x57d9d0=0x0;_0x57d9d0<_0x4ec012[_0xa4a9('0x1d')][_0xa4a9('0x1e')];_0x57d9d0+=0x1){var _0x1e4d78=_0x4ec012[_0xa4a9('0x1d')][_0x57d9d0];if(fs['existsSync'](path[_0xa4a9('0x1f')](__dirname,_0xa4a9('0x1d'),_0x1e4d78[_0xa4a9('0x20')]+_0xa4a9('0x21')))){var _0x386e1f=[];switch(_0x1e4d78[_0xa4a9('0x20')][_0xa4a9('0x22')]()){case'autoreply':var _0x46aa5c=_0x1e4d78['appdata']['split'](',');if(_0x4ec012[_0xa4a9('0x19')]===_0xa4a9('0x23')){_0x386e1f[_0xa4a9('0x24')](_0x46aa5c[0x0]);_0x386e1f[_0xa4a9('0x24')](_0x46aa5c[0x1]);_0x386e1f['push'](_0x46aa5c['slice'](0x2,_0x46aa5c[_0xa4a9('0x1e')])[_0xa4a9('0x1f')](','));}else{_0x386e1f[_0xa4a9('0x24')](_0x46aa5c[0x0]);_0x386e1f['push'](_0x46aa5c[_0xa4a9('0x25')](0x1,_0x46aa5c[_0xa4a9('0x1e')])[_0xa4a9('0x1f')](','));}break;case _0xa4a9('0x26'):var _0x1f960d=_0x1e4d78[_0xa4a9('0x27')][_0xa4a9('0x28')](',');_0x386e1f[_0xa4a9('0x24')](_0x1f960d[0x0]);_0x386e1f[_0xa4a9('0x24')](_0x1f960d[0x1]);_0x386e1f[_0xa4a9('0x24')](_0x1f960d[_0xa4a9('0x25')](0x2,_0x1f960d[_0xa4a9('0x1e')])[_0xa4a9('0x1f')](','));break;case'dialogflowv2':var _0x5e2d16=_0x1e4d78[_0xa4a9('0x27')]['split'](',');_0x386e1f[_0xa4a9('0x24')](_0x5e2d16[0x0]);_0x386e1f[_0xa4a9('0x24')](_0x5e2d16[0x1]);_0x386e1f['push'](_0x5e2d16[0x2]);_0x386e1f[_0xa4a9('0x24')](_0x5e2d16[0x3]);_0x386e1f['push'](_0x5e2d16[_0xa4a9('0x25')](0x4,_0x5e2d16[_0xa4a9('0x1e')])[_0xa4a9('0x1f')](','));break;case _0xa4a9('0x29'):var _0x4fbe64=_0x1e4d78[_0xa4a9('0x27')][_0xa4a9('0x28')](',');_0x386e1f['push'](_0x4fbe64[0x0]);_0x386e1f[_0xa4a9('0x24')](_0x4fbe64[0x1]);_0x386e1f[_0xa4a9('0x24')](_0x4fbe64[0x2]);_0x386e1f[_0xa4a9('0x24')](_0x4fbe64[0x3]);_0x386e1f[_0xa4a9('0x24')](_0x4fbe64['slice'](0x4,_0x4fbe64[_0xa4a9('0x1e')])[_0xa4a9('0x1f')](','));break;case _0xa4a9('0x1a'):_0x386e1f['push'](_0x1e4d78[_0xa4a9('0x27')]);break;case _0xa4a9('0x2a'):_0x386e1f[_0xa4a9('0x24')](_0x1e4d78[_0xa4a9('0x2b')]);_0x386e1f[_0xa4a9('0x24')](_0x1e4d78[_0xa4a9('0x27')]);break;default:_0x386e1f=_['isNil'](_0x1e4d78[_0xa4a9('0x27')])?[]:_0x1e4d78[_0xa4a9('0x27')][_0xa4a9('0x28')](',');}var _0x2cc0ba={'id':util[_0xa4a9('0x10')](_0xa4a9('0x2c'),_0x361b10,_0x1e4d78['id'],_0x1e4d78['app']),'condition':require(_0xa4a9('0x2d'))['condition'](_0x361b10,getIntervals(_0x3e8b88[_0xa4a9('0x2e')],_0x1e4d78),_0x3e8b88),'consequence':require(_0xa4a9('0x2f')+_0x1e4d78[_0xa4a9('0x20')])[_0xa4a9('0x30')](_0x361b10,_0x386e1f,_0x3e8b88,_0x4ec012),'p':_0x1e4d78[_0xa4a9('0x31')]||0x0};logger[_0xa4a9('0x32')](_0xa4a9('0x33'),_0x2cc0ba['id'],_0xa4a9('0x34'),getIntervals(_0x3e8b88[_0xa4a9('0x2e')],_0x1e4d78)['join'](_0xa4a9('0x35')));_0x37bc37[_0xa4a9('0x24')](_0x2cc0ba);}else{logger[_0xa4a9('0x36')](_0xa4a9('0x37'),path[_0xa4a9('0x1f')](__dirname,_0xa4a9('0x1d'),_0x1e4d78[_0xa4a9('0x20')]+_0xa4a9('0x21')));}}_0x3e8b88[_0xa4a9('0x18')][_0x361b10]=new RuleEngine(_0x37bc37);_0x3e8b88[_0xa4a9('0x18')][_0x361b10]['execute'](_0x4ec012,function(_0x5a1407){logger['info']('Applications\x20executed',JSON[_0xa4a9('0x38')](_0x5a1407['matchPath']));if(_0x3e8b88[_0xa4a9('0x18')][_0x361b10]){_0x3e8b88[_0xa4a9('0x18')][_0x361b10]['emit'](_0xa4a9('0x39'));}});return _0x4135da({'code':0xc8,'message':_0x4ec012});}else{logger[_0xa4a9('0x32')]('No\x20applications\x20to\x20execute');return _0x4135da({'code':0xc8,'message':_0x4ec012});}}catch(_0x149982){logger['error'](_0x149982[_0xa4a9('0x3a')]);return _0x446cf4(_0x4a452c[_0xa4a9('0x36')](0x1f4,_0x149982));}}return _0x446cf4('routing\x20is\x20empty');});},'AcceptMessage':function(_0x39af08){var _0x3ea951=this;return new Promise(function(_0x41789f,_0xdfcce0){if(_0x39af08[_0xa4a9('0x3b')]&&_0x39af08[_0xa4a9('0x3b')]['id']){if(_0x3e8b88['agents'][_0x39af08['agent']['id']]){_0x3e8b88[_0xa4a9('0x3c')][_0x39af08['agent']['id']][_0xa4a9('0x3d')]=![];_0x3e8b88[_0xa4a9('0x3c')][_0x39af08[_0xa4a9('0x3b')]['id']]['busyQueue']=undefined;}}if(_0x39af08['message']&&_0x39af08[_0xa4a9('0x1a')]['id']){try{var _0x3d8a1e=getId(_0x39af08[_0xa4a9('0x19')],_0x39af08[_0xa4a9('0x1a')]?_0x39af08['message']['id']:0x0,_0x39af08['interaction']?_0x39af08[_0xa4a9('0x1b')]['id']:0x0);if(_0x3e8b88[_0xa4a9('0x18')][_0x3d8a1e]){_0x3e8b88[_0xa4a9('0x18')][_0x3d8a1e][_0xa4a9('0x3e')]('end');if(rpc[_0x39af08['channel']+'QueueReport']){rpc[_0x39af08['channel']+_0xa4a9('0x3f')][_0xa4a9('0x40')](_0x3d8a1e,{'UserId':_0x39af08['message'][_0xa4a9('0x41')]})[_0xa4a9('0x42')](function(_0x4fe089){logger[_0xa4a9('0x36')](_0xa4a9('0x43'));});}}return _0x41789f({'code':0xc8,'message':_0x39af08});}catch(_0x5629b1){logger[_0xa4a9('0x36')](_0x5629b1['stack']);return _0xdfcce0(_0x3ea951[_0xa4a9('0x36')](0x1f4,_0x5629b1));}}logger['error'](_0xa4a9('0x44'));return _0xdfcce0(_0x3ea951[_0xa4a9('0x36')](0x1f4,_0xa4a9('0x44')));});},'RejectMessage':function(_0x3c72f6){var _0x3b4b1e=this;return new Promise(function(_0x46ff84,_0xe0b553){if(_0x3c72f6[_0xa4a9('0x3b')]&&_0x3c72f6[_0xa4a9('0x3b')]['id']){try{if(_0x3e8b88[_0xa4a9('0x3c')][_0x3c72f6[_0xa4a9('0x3b')]['id']]){_0x3e8b88['agents'][_0x3c72f6['agent']['id']][_0xa4a9('0x3d')]=![];_0x3e8b88[_0xa4a9('0x3c')][_0x3c72f6[_0xa4a9('0x3b')]['id']][_0xa4a9('0x45')]=undefined;}return _0x46ff84({'code':0xc8,'message':_0x3c72f6});}catch(_0x1007ff){logger['error'](_0x1007ff[_0xa4a9('0x3a')]);return _0xe0b553(_0x3b4b1e['error'](0x1f4,_0x1007ff));}}logger[_0xa4a9('0x36')](_0xa4a9('0x44'));return _0xe0b553(_0x3b4b1e[_0xa4a9('0x36')](0x1f4,_0xa4a9('0x44')));});},'AbandonInteraction':function(_0x42af10){var _0x1b1aa8=this;return new Promise(function(_0xa3b261,_0xd50d42){if(_0x42af10[_0xa4a9('0x19')]&&_0x42af10[_0xa4a9('0x1b')]&&_0x42af10[_0xa4a9('0x1b')]['id']){try{var _0x5f2be7=getId(_0x42af10[_0xa4a9('0x19')],_0x42af10[_0xa4a9('0x1a')]?_0x42af10[_0xa4a9('0x1a')]['id']:0x0,_0x42af10[_0xa4a9('0x1b')]?_0x42af10['interaction']['id']:0x0);if(_0x3e8b88[_0xa4a9('0x18')][_0x5f2be7]){_0x3e8b88[_0xa4a9('0x18')][_0x5f2be7]['emit'](_0xa4a9('0x46'));}return _0xa3b261({'code':0xc8,'message':_0x42af10});}catch(_0x225cef){logger[_0xa4a9('0x36')](_0x225cef[_0xa4a9('0x3a')]);return _0xd50d42(_0x1b1aa8['error'](0x1f4,_0x225cef));}}logger[_0xa4a9('0x36')](_0xa4a9('0x44'));return _0xd50d42(_0x1b1aa8[_0xa4a9('0x36')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x10df01){var _0x1dd676=this;return new Promise(function(_0xd70d2c,_0x5eae0d){if(_0x3e8b88['agents'][_0xa4a9('0x47')](_0x10df01['id'])){for(var _0x55f0e5 in _0x10df01[_0xa4a9('0x48')]){if(_0x10df01[_0xa4a9('0x48')][_0xa4a9('0x47')](_0x55f0e5)){if(_0x3e8b88[_0xa4a9('0x3c')][_0x10df01['id']][_0xa4a9('0x47')](_0x55f0e5+_0xa4a9('0x49'))){_0x3e8b88[_0xa4a9('0x3c')][_0x10df01['id']][_0x55f0e5+_0xa4a9('0x49')]=parseInt(_0x10df01['capacity'][_0x55f0e5],0xa);}}}_0x3e8b88[_0xa4a9('0x3c')][_0x10df01['id']][_0xa4a9('0x4a')]();return _0xd70d2c({'code':0xc8,'message':_0x3e8b88[_0xa4a9('0x3c')][_0x10df01['id']]});}else{return _0x5eae0d(_0x1dd676[_0xa4a9('0x36')](0x1f4,_0xa4a9('0x4b')));}});},'Agents':function(_0x41fd19){return new Promise(function(_0x38044a,_0x1b003a){var _0x4ec475=_['values'](_0x3e8b88['agents']);_0x38044a({'count':_0x4ec475[_0xa4a9('0x1e')],'rows':_0x4ec475});});},'ChatQueues':function(_0x1f9848){return new Promise(function(_0x218413,_0xcd4751){var _0x1f4ccb=[];for(var _0x4eaf46 in _0x3e8b88['chatQueues']){if(_0x3e8b88[_0xa4a9('0x4c')][_0xa4a9('0x47')](_0x4eaf46)){var _0x51af70=_0x3e8b88[_0xa4a9('0x4c')][_0x4eaf46];var _0x55bcbf={'id':_0x51af70['id'],'available':_0x51af70[_0xa4a9('0x4d')],'loggedIn':_0x51af70[_0xa4a9('0x4e')],'name':_0x51af70[_0xa4a9('0x4f')],'paused':_0x51af70[_0xa4a9('0x50')],'waiting':_0x51af70[_0xa4a9('0x51')]};_0x1f4ccb[_0xa4a9('0x24')](_0x55bcbf);}}_0x218413({'count':_0x1f4ccb['length'],'rows':_0x1f4ccb});});},'MailQueues':function(_0x506d60){return new Promise(function(_0x1772f7,_0x3fb795){var _0x678b96=[];for(var _0x367ecc in _0x3e8b88[_0xa4a9('0x52')]){if(_0x3e8b88[_0xa4a9('0x52')][_0xa4a9('0x47')](_0x367ecc)){var _0x41639b=_0x3e8b88['mailQueues'][_0x367ecc];var _0x5c4a63={'id':_0x41639b['id'],'available':_0x41639b[_0xa4a9('0x4d')],'loggedIn':_0x41639b['loggedIn'],'name':_0x41639b[_0xa4a9('0x4f')],'paused':_0x41639b[_0xa4a9('0x50')],'waiting':_0x41639b[_0xa4a9('0x51')]};_0x678b96[_0xa4a9('0x24')](_0x5c4a63);}}_0x1772f7({'count':_0x678b96[_0xa4a9('0x1e')],'rows':_0x678b96});});},'OpenchannelQueues':function(_0x54abc5){return new Promise(function(_0x38dd72,_0x5ab5c8){var _0x375024=[];for(var _0x48c48e in _0x3e8b88[_0xa4a9('0x53')]){if(_0x3e8b88[_0xa4a9('0x53')]['hasOwnProperty'](_0x48c48e)){var _0x31cd6e=_0x3e8b88[_0xa4a9('0x53')][_0x48c48e];var _0x5f06a5={'id':_0x31cd6e['id'],'available':_0x31cd6e['available'],'loggedIn':_0x31cd6e['loggedIn'],'name':_0x31cd6e[_0xa4a9('0x4f')],'paused':_0x31cd6e[_0xa4a9('0x50')],'waiting':_0x31cd6e[_0xa4a9('0x51')]};_0x375024[_0xa4a9('0x24')](_0x5f06a5);}}_0x38dd72({'count':_0x375024['length'],'rows':_0x375024});});},'SmsQueues':function(_0x2e62aa){return new Promise(function(_0x1a901c,_0x3277bf){var _0x1c89a6=[];for(var _0x16e016 in _0x3e8b88[_0xa4a9('0x54')]){if(_0x3e8b88[_0xa4a9('0x54')][_0xa4a9('0x47')](_0x16e016)){var _0x16b2c2=_0x3e8b88[_0xa4a9('0x54')][_0x16e016];var _0x31f853={'id':_0x16b2c2['id'],'available':_0x16b2c2[_0xa4a9('0x4d')],'loggedIn':_0x16b2c2[_0xa4a9('0x4e')],'name':_0x16b2c2[_0xa4a9('0x4f')],'paused':_0x16b2c2[_0xa4a9('0x50')],'waiting':_0x16b2c2[_0xa4a9('0x51')]};_0x1c89a6[_0xa4a9('0x24')](_0x31f853);}}_0x1a901c({'count':_0x1c89a6[_0xa4a9('0x1e')],'rows':_0x1c89a6});});},'FaxQueues':function(_0x3df853){return new Promise(function(_0x2c859f,_0xaab1b){var _0xd69a4b=[];for(var _0x3cd2b7 in _0x3e8b88[_0xa4a9('0x55')]){if(_0x3e8b88['faxQueues'][_0xa4a9('0x47')](_0x3cd2b7)){var _0x13a218=_0x3e8b88[_0xa4a9('0x55')][_0x3cd2b7];var _0x4e8945={'id':_0x13a218['id'],'available':_0x13a218[_0xa4a9('0x4d')],'loggedIn':_0x13a218[_0xa4a9('0x4e')],'name':_0x13a218[_0xa4a9('0x4f')],'paused':_0x13a218['paused'],'waiting':_0x13a218[_0xa4a9('0x51')]};_0xd69a4b['push'](_0x4e8945);}}_0x2c859f({'count':_0xd69a4b[_0xa4a9('0x1e')],'rows':_0xd69a4b});});},'WhatsappQueues':function(_0x1d509c){return new Promise(function(_0x594cdf,_0x5134ab){var _0x33336d=[];for(var _0x570dc0 in _0x3e8b88['whatsappQueues']){if(_0x3e8b88[_0xa4a9('0x56')]['hasOwnProperty'](_0x570dc0)){var _0x359f30=_0x3e8b88[_0xa4a9('0x56')][_0x570dc0];var _0x3926ef={'id':_0x359f30['id'],'available':_0x359f30[_0xa4a9('0x4d')],'loggedIn':_0x359f30[_0xa4a9('0x4e')],'name':_0x359f30[_0xa4a9('0x4f')],'paused':_0x359f30[_0xa4a9('0x50')],'waiting':_0x359f30['waiting']};_0x33336d[_0xa4a9('0x24')](_0x3926ef);}}_0x594cdf({'count':_0x33336d[_0xa4a9('0x1e')],'rows':_0x33336d});});},'ChatQueuesWaitingInteractions':function(_0x482907){return new Promise(function(_0x1ed70c,_0x5a5f4b){var _0x56794c=_['values'](_0x3e8b88['chatQueuesWaitingInteractions']);_0x1ed70c({'count':_0x56794c[_0xa4a9('0x1e')],'rows':_0x56794c});});},'MailQueuesWaitingInteractions':function(_0x356db2){return new Promise(function(_0xb6d1f4,_0x50756e){var _0x3e00a5=_[_0xa4a9('0x57')](_0x3e8b88[_0xa4a9('0x58')]);_0xb6d1f4({'count':_0x3e00a5['length'],'rows':_0x3e00a5});});},'OpenchannelQueuesWaitingInteractions':function(_0x31da11){return new Promise(function(_0x3ffcce,_0x29699a){var _0x577818=_['values'](_0x3e8b88['openchannelQueuesWaitingInteractions']);_0x3ffcce({'count':_0x577818[_0xa4a9('0x1e')],'rows':_0x577818});});},'SmsQueuesWaitingInteractions':function(_0x13ee29){return new Promise(function(_0x42c748,_0x2b78b8){var _0x268583=_['values'](_0x3e8b88[_0xa4a9('0x59')]);_0x42c748({'count':_0x268583[_0xa4a9('0x1e')],'rows':_0x268583});});},'FaxQueuesWaitingInteractions':function(_0x1d9d68){return new Promise(function(_0x5e8a42,_0x3a093c){var _0x116a42=_['values'](_0x3e8b88[_0xa4a9('0x5a')]);_0x5e8a42({'count':_0x116a42['length'],'rows':_0x116a42});});},'WhatsappQueuesWaitingInteractions':function(_0x14e782){return new Promise(function(_0x7f4bc4,_0x5348b1){var _0x523f58=_[_0xa4a9('0x57')](_0x3e8b88[_0xa4a9('0x5b')]);_0x7f4bc4({'count':_0x523f58['length'],'rows':_0x523f58});});}};var _0x39d18a=jayson[_0xa4a9('0x5c')](_0x183f1e)['http']();_0x39d18a['on'](_0xa4a9('0x36'),function(_0x5715a6){logger['error'](JSON[_0xa4a9('0x38')](_0x5715a6));return _0x49c9bf(_0x5715a6);});_0x39d18a[_0xa4a9('0x17')](0x232c,_0xa4a9('0x5d'),function(){console[_0xa4a9('0x5e')](_0xa4a9('0x5f'),0x232c);return _0xb8b579(_0xa4a9('0x60')+0x232c);});});}; \ No newline at end of file +var _0x2507=['CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','uuid','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/smsQueueReport','../lib/rule-engine','isNil','IntervalId','Intervals','interval','listen','rules','channel','message','interaction','applications','isArray','join','app','.js','toLowerCase','autoreply','appdata','split','mail','push','slice','length','dialogflow','amazonlex','tag','TagId','condition','intervals','./applications/','consequence','info','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify','matchPath','emit','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','QueueReport','update','UserId','message\x20is\x20empty','hasOwnProperty','capacity'];(function(_0x19cd60,_0x8c2635){var _0x532cee=function(_0x31a2b9){while(--_0x31a2b9){_0x19cd60['push'](_0x19cd60['shift']());}};_0x532cee(++_0x8c2635);}(_0x2507,0xca));var _0x7250=function(_0x4200c5,_0x461868){_0x4200c5=_0x4200c5-0x0;var _0x3010c8=_0x2507[_0x4200c5];return _0x3010c8;};'use strict';var _=require(_0x7250('0x0'));var util=require(_0x7250('0x1'));var path=require(_0x7250('0x2'));var fs=require('fs');var jayson=require(_0x7250('0x3'));var BPromise=require(_0x7250('0x4'));var uuid=require(_0x7250('0x5'));var config=require(_0x7250('0x6'));var logger=require(_0x7250('0x7'))(_0x7250('0x8'));var rpc={'openchannelQueueReport':require(_0x7250('0x9')),'mailQueueReport':require(_0x7250('0xa')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0x7250('0xb')),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require(_0x7250('0xc'));function getId(_0x3b3284,_0x2c6772,_0x4e0f11){return util['format']('%s.%s.%s',_0x3b3284,_0x2c6772||0x0,_0x4e0f11||0x0);}function getIntervals(_0x3c28e3,_0x18b597){var _0x5a377a=[];if(!_[_0x7250('0xd')](_0x18b597[_0x7250('0xe')])&&!_[_0x7250('0xd')](_0x3c28e3[_0x18b597[_0x7250('0xe')]])&&!_[_0x7250('0xd')](_0x3c28e3[_0x18b597[_0x7250('0xe')]][_0x7250('0xf')])){_0x5a377a=_['map'](_0x3c28e3[_0x18b597[_0x7250('0xe')]][_0x7250('0xf')],_0x7250('0x10'));}else if(!_['isNil'](_0x18b597['interval'])){_0x5a377a=[_0x18b597[_0x7250('0x10')]];}return _0x5a377a;}exports[_0x7250('0x11')]=function(_0x50f41c){_0x50f41c[_0x7250('0x12')]={};return new BPromise(function(_0x3c5b1b,_0x11dc0e){var _0x41d01f={'Start':function(_0x56d344){var _0x5beec4=this;return new Promise(function(_0x1363a1,_0x3edcd5){if(_0x56d344){try{var _0x23ffbd=[];var _0x57eeb3=getId(_0x56d344[_0x7250('0x13')],_0x56d344['message']?_0x56d344[_0x7250('0x14')]['id']:0x0,_0x56d344[_0x7250('0x15')]?_0x56d344['interaction']['id']:0x0);if(_0x56d344[_0x7250('0x16')]&&_[_0x7250('0x17')](_0x56d344['applications'])&&_0x56d344[_0x7250('0x16')]['length']){for(var _0x5cd050=0x0;_0x5cd050<_0x56d344[_0x7250('0x16')]['length'];_0x5cd050+=0x1){var _0x163319=_0x56d344[_0x7250('0x16')][_0x5cd050];if(fs['existsSync'](path[_0x7250('0x18')](__dirname,'applications',_0x163319[_0x7250('0x19')]+_0x7250('0x1a')))){var _0x366fd4=[];switch(_0x163319[_0x7250('0x19')][_0x7250('0x1b')]()){case _0x7250('0x1c'):var _0x1f39df=_0x163319[_0x7250('0x1d')][_0x7250('0x1e')](',');if(_0x56d344['channel']===_0x7250('0x1f')){_0x366fd4[_0x7250('0x20')](_0x1f39df[0x0]);_0x366fd4[_0x7250('0x20')](_0x1f39df[0x1]);_0x366fd4[_0x7250('0x20')](_0x1f39df[_0x7250('0x21')](0x2,_0x1f39df['length'])['join'](','));}else{_0x366fd4[_0x7250('0x20')](_0x1f39df[0x0]);_0x366fd4[_0x7250('0x20')](_0x1f39df[_0x7250('0x21')](0x1,_0x1f39df[_0x7250('0x22')])[_0x7250('0x18')](','));}break;case _0x7250('0x23'):var _0x1cd90a=_0x163319[_0x7250('0x1d')][_0x7250('0x1e')](',');_0x366fd4['push'](_0x1cd90a[0x0]);_0x366fd4['push'](_0x1cd90a[0x1]);_0x366fd4['push'](_0x1cd90a['slice'](0x2,_0x1cd90a[_0x7250('0x22')])['join'](','));break;case'dialogflowv2':var _0x57635f=_0x163319[_0x7250('0x1d')][_0x7250('0x1e')](',');_0x366fd4[_0x7250('0x20')](_0x57635f[0x0]);_0x366fd4['push'](_0x57635f[0x1]);_0x366fd4[_0x7250('0x20')](_0x57635f[0x2]);_0x366fd4[_0x7250('0x20')](_0x57635f[0x3]);_0x366fd4[_0x7250('0x20')](_0x57635f[_0x7250('0x21')](0x4,_0x57635f[_0x7250('0x22')])[_0x7250('0x18')](','));break;case _0x7250('0x24'):var _0x47deda=_0x163319[_0x7250('0x1d')][_0x7250('0x1e')](',');_0x366fd4['push'](_0x47deda[0x0]);_0x366fd4['push'](_0x47deda[0x1]);_0x366fd4['push'](_0x47deda[0x2]);_0x366fd4[_0x7250('0x20')](_0x47deda[0x3]);_0x366fd4[_0x7250('0x20')](_0x47deda[_0x7250('0x21')](0x4,_0x47deda[_0x7250('0x22')])[_0x7250('0x18')](','));break;case _0x7250('0x14'):_0x366fd4[_0x7250('0x20')](_0x163319[_0x7250('0x1d')]);break;case _0x7250('0x25'):_0x366fd4['push'](_0x163319[_0x7250('0x26')]);_0x366fd4[_0x7250('0x20')](_0x163319['appdata']);break;default:_0x366fd4=_[_0x7250('0xd')](_0x163319[_0x7250('0x1d')])?[]:_0x163319[_0x7250('0x1d')][_0x7250('0x1e')](',');}var _0x4ae01e={'id':util['format']('%s:%s:%s',_0x57eeb3,_0x163319['id'],_0x163319['app']),'condition':require('./interval')[_0x7250('0x27')](_0x57eeb3,getIntervals(_0x50f41c[_0x7250('0x28')],_0x163319),_0x50f41c),'consequence':require(_0x7250('0x29')+_0x163319[_0x7250('0x19')])[_0x7250('0x2a')](_0x57eeb3,_0x366fd4,_0x50f41c,_0x56d344),'p':_0x163319['priority']||0x0};logger[_0x7250('0x2b')]('Push\x20new\x20rule',_0x4ae01e['id'],'on\x20interval',getIntervals(_0x50f41c[_0x7250('0x28')],_0x163319)[_0x7250('0x18')](_0x7250('0x2c')));_0x23ffbd[_0x7250('0x20')](_0x4ae01e);}else{logger[_0x7250('0x2d')](_0x7250('0x2e'),path[_0x7250('0x18')](__dirname,_0x7250('0x16'),_0x163319[_0x7250('0x19')]+'.js'));}}_0x50f41c['rules'][_0x57eeb3]=new RuleEngine(_0x23ffbd);_0x50f41c['rules'][_0x57eeb3][_0x7250('0x2f')](_0x56d344,function(_0x27474a){logger[_0x7250('0x2b')](_0x7250('0x30'),JSON[_0x7250('0x31')](_0x27474a[_0x7250('0x32')]));if(_0x50f41c['rules'][_0x57eeb3]){_0x50f41c[_0x7250('0x12')][_0x57eeb3][_0x7250('0x33')]('complete');}});return _0x1363a1({'code':0xc8,'message':_0x56d344});}else{logger[_0x7250('0x2b')]('No\x20applications\x20to\x20execute');return _0x1363a1({'code':0xc8,'message':_0x56d344});}}catch(_0x47fa4b){logger[_0x7250('0x2d')](_0x47fa4b[_0x7250('0x34')]);return _0x3edcd5(_0x5beec4[_0x7250('0x2d')](0x1f4,_0x47fa4b));}}return _0x3edcd5(_0x7250('0x35'));});},'AcceptMessage':function(_0x1f2ea4){var _0x57ea04=this;return new Promise(function(_0x7de47e,_0x190e2f){if(_0x1f2ea4['agent']&&_0x1f2ea4[_0x7250('0x36')]['id']){if(_0x50f41c[_0x7250('0x37')][_0x1f2ea4[_0x7250('0x36')]['id']]){_0x50f41c[_0x7250('0x37')][_0x1f2ea4['agent']['id']][_0x7250('0x38')]=![];_0x50f41c[_0x7250('0x37')][_0x1f2ea4[_0x7250('0x36')]['id']][_0x7250('0x39')]=undefined;}}if(_0x1f2ea4[_0x7250('0x14')]&&_0x1f2ea4[_0x7250('0x14')]['id']){try{var _0xcb1f6b=getId(_0x1f2ea4['channel'],_0x1f2ea4[_0x7250('0x14')]?_0x1f2ea4[_0x7250('0x14')]['id']:0x0,_0x1f2ea4[_0x7250('0x15')]?_0x1f2ea4[_0x7250('0x15')]['id']:0x0);if(_0x50f41c[_0x7250('0x12')][_0xcb1f6b]){_0x50f41c['rules'][_0xcb1f6b][_0x7250('0x33')](_0x7250('0x3a'));if(rpc[_0x1f2ea4[_0x7250('0x13')]+_0x7250('0x3b')]){rpc[_0x1f2ea4[_0x7250('0x13')]+_0x7250('0x3b')][_0x7250('0x3c')](_0xcb1f6b,{'UserId':_0x1f2ea4[_0x7250('0x14')][_0x7250('0x3d')]})['catch'](function(_0x5263d4){logger[_0x7250('0x2d')]('error\x20update\x20queue\x20report');});}}return _0x7de47e({'code':0xc8,'message':_0x1f2ea4});}catch(_0x1487b6){logger[_0x7250('0x2d')](_0x1487b6['stack']);return _0x190e2f(_0x57ea04[_0x7250('0x2d')](0x1f4,_0x1487b6));}}logger['error'](_0x7250('0x3e'));return _0x190e2f(_0x57ea04['error'](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x58315d){var _0x3e1f96=this;return new Promise(function(_0x22bcde,_0x44d1cf){if(_0x58315d['agent']&&_0x58315d[_0x7250('0x36')]['id']){try{if(_0x50f41c[_0x7250('0x37')][_0x58315d[_0x7250('0x36')]['id']]){_0x50f41c[_0x7250('0x37')][_0x58315d[_0x7250('0x36')]['id']][_0x7250('0x38')]=![];_0x50f41c[_0x7250('0x37')][_0x58315d[_0x7250('0x36')]['id']][_0x7250('0x39')]=undefined;}return _0x22bcde({'code':0xc8,'message':_0x58315d});}catch(_0x156bfb){logger[_0x7250('0x2d')](_0x156bfb[_0x7250('0x34')]);return _0x44d1cf(_0x3e1f96[_0x7250('0x2d')](0x1f4,_0x156bfb));}}logger[_0x7250('0x2d')](_0x7250('0x3e'));return _0x44d1cf(_0x3e1f96[_0x7250('0x2d')](0x1f4,_0x7250('0x3e')));});},'AbandonInteraction':function(_0x5738c3){var _0x46c5b7=this;return new Promise(function(_0x1e1e97,_0x30e858){if(_0x5738c3[_0x7250('0x13')]&&_0x5738c3[_0x7250('0x15')]&&_0x5738c3['interaction']['id']){try{var _0x261178=getId(_0x5738c3['channel'],_0x5738c3['message']?_0x5738c3['message']['id']:0x0,_0x5738c3['interaction']?_0x5738c3[_0x7250('0x15')]['id']:0x0);if(_0x50f41c[_0x7250('0x12')][_0x261178]){_0x50f41c[_0x7250('0x12')][_0x261178][_0x7250('0x33')]('end');}return _0x1e1e97({'code':0xc8,'message':_0x5738c3});}catch(_0x5c22b6){logger[_0x7250('0x2d')](_0x5c22b6[_0x7250('0x34')]);return _0x30e858(_0x46c5b7['error'](0x1f4,_0x5c22b6));}}logger['error'](_0x7250('0x3e'));return _0x30e858(_0x46c5b7[_0x7250('0x2d')](0x1f4,_0x7250('0x3e')));});},'AgentCapacity':function(_0x5edc63){var _0x611ae=this;return new Promise(function(_0x2b469c,_0x47708b){if(_0x50f41c[_0x7250('0x37')][_0x7250('0x3f')](_0x5edc63['id'])){for(var _0x2fc7f7 in _0x5edc63['capacity']){if(_0x5edc63[_0x7250('0x40')]['hasOwnProperty'](_0x2fc7f7)){if(_0x50f41c[_0x7250('0x37')][_0x5edc63['id']][_0x7250('0x3f')](_0x2fc7f7+_0x7250('0x41'))){_0x50f41c[_0x7250('0x37')][_0x5edc63['id']][_0x2fc7f7+_0x7250('0x41')]=parseInt(_0x5edc63[_0x7250('0x40')][_0x2fc7f7],0xa);}}}_0x50f41c[_0x7250('0x37')][_0x5edc63['id']][_0x7250('0x42')]();return _0x2b469c({'code':0xc8,'message':_0x50f41c[_0x7250('0x37')][_0x5edc63['id']]});}else{return _0x47708b(_0x611ae[_0x7250('0x2d')](0x1f4,_0x7250('0x43')));}});},'Agents':function(_0x9190b4){return new Promise(function(_0x45a6e4,_0x11d164){var _0x490da3=_[_0x7250('0x44')](_0x50f41c[_0x7250('0x37')]);_0x45a6e4({'count':_0x490da3[_0x7250('0x22')],'rows':_0x490da3});});},'ChatQueues':function(_0x4556a0){return new Promise(function(_0x194c59,_0x543688){var _0x2998b1=[];for(var _0x56c0f7 in _0x50f41c['chatQueues']){if(_0x50f41c['chatQueues'][_0x7250('0x3f')](_0x56c0f7)){var _0x4ad607=_0x50f41c[_0x7250('0x45')][_0x56c0f7];var _0x2fe27e={'id':_0x4ad607['id'],'available':_0x4ad607[_0x7250('0x46')],'loggedIn':_0x4ad607[_0x7250('0x47')],'name':_0x4ad607[_0x7250('0x48')],'paused':_0x4ad607[_0x7250('0x49')],'waiting':_0x4ad607[_0x7250('0x4a')]};_0x2998b1[_0x7250('0x20')](_0x2fe27e);}}_0x194c59({'count':_0x2998b1[_0x7250('0x22')],'rows':_0x2998b1});});},'MailQueues':function(_0x5d9037){return new Promise(function(_0x699871,_0x415d80){var _0x1d1588=[];for(var _0x32fee3 in _0x50f41c['mailQueues']){if(_0x50f41c[_0x7250('0x4b')][_0x7250('0x3f')](_0x32fee3)){var _0x23a947=_0x50f41c['mailQueues'][_0x32fee3];var _0x3b275a={'id':_0x23a947['id'],'available':_0x23a947[_0x7250('0x46')],'loggedIn':_0x23a947[_0x7250('0x47')],'name':_0x23a947['name'],'paused':_0x23a947['paused'],'waiting':_0x23a947[_0x7250('0x4a')]};_0x1d1588[_0x7250('0x20')](_0x3b275a);}}_0x699871({'count':_0x1d1588[_0x7250('0x22')],'rows':_0x1d1588});});},'OpenchannelQueues':function(_0x4bf4c2){return new Promise(function(_0x5e53f5,_0x17ae8b){var _0x3a85ed=[];for(var _0x4ab1f5 in _0x50f41c['openchannelQueues']){if(_0x50f41c['openchannelQueues'][_0x7250('0x3f')](_0x4ab1f5)){var _0x26deb0=_0x50f41c[_0x7250('0x4c')][_0x4ab1f5];var _0x2764b4={'id':_0x26deb0['id'],'available':_0x26deb0[_0x7250('0x46')],'loggedIn':_0x26deb0['loggedIn'],'name':_0x26deb0[_0x7250('0x48')],'paused':_0x26deb0[_0x7250('0x49')],'waiting':_0x26deb0[_0x7250('0x4a')]};_0x3a85ed[_0x7250('0x20')](_0x2764b4);}}_0x5e53f5({'count':_0x3a85ed[_0x7250('0x22')],'rows':_0x3a85ed});});},'SmsQueues':function(_0x4d3722){return new Promise(function(_0x27099d,_0x4bc6bb){var _0x46e7ae=[];for(var _0xcaa86b in _0x50f41c['smsQueues']){if(_0x50f41c[_0x7250('0x4d')][_0x7250('0x3f')](_0xcaa86b)){var _0x5f2246=_0x50f41c[_0x7250('0x4d')][_0xcaa86b];var _0x3501aa={'id':_0x5f2246['id'],'available':_0x5f2246['available'],'loggedIn':_0x5f2246['loggedIn'],'name':_0x5f2246[_0x7250('0x48')],'paused':_0x5f2246[_0x7250('0x49')],'waiting':_0x5f2246[_0x7250('0x4a')]};_0x46e7ae['push'](_0x3501aa);}}_0x27099d({'count':_0x46e7ae[_0x7250('0x22')],'rows':_0x46e7ae});});},'FaxQueues':function(_0x363e2a){return new Promise(function(_0x114375,_0x206f50){var _0x448803=[];for(var _0x3be00e in _0x50f41c[_0x7250('0x4e')]){if(_0x50f41c[_0x7250('0x4e')]['hasOwnProperty'](_0x3be00e)){var _0x1dc85b=_0x50f41c[_0x7250('0x4e')][_0x3be00e];var _0x26cc23={'id':_0x1dc85b['id'],'available':_0x1dc85b[_0x7250('0x46')],'loggedIn':_0x1dc85b[_0x7250('0x47')],'name':_0x1dc85b[_0x7250('0x48')],'paused':_0x1dc85b[_0x7250('0x49')],'waiting':_0x1dc85b[_0x7250('0x4a')]};_0x448803[_0x7250('0x20')](_0x26cc23);}}_0x114375({'count':_0x448803[_0x7250('0x22')],'rows':_0x448803});});},'WhatsappQueues':function(_0x1181f6){return new Promise(function(_0x55c3d3,_0x16dd4b){var _0x288635=[];for(var _0x3ac2f6 in _0x50f41c[_0x7250('0x4f')]){if(_0x50f41c[_0x7250('0x4f')][_0x7250('0x3f')](_0x3ac2f6)){var _0x2f0f85=_0x50f41c[_0x7250('0x4f')][_0x3ac2f6];var _0x1a7c9a={'id':_0x2f0f85['id'],'available':_0x2f0f85['available'],'loggedIn':_0x2f0f85[_0x7250('0x47')],'name':_0x2f0f85[_0x7250('0x48')],'paused':_0x2f0f85[_0x7250('0x49')],'waiting':_0x2f0f85['waiting']};_0x288635[_0x7250('0x20')](_0x1a7c9a);}}_0x55c3d3({'count':_0x288635['length'],'rows':_0x288635});});},'ChatQueuesWaitingInteractions':function(_0x4438e5){return new Promise(function(_0x3c02be,_0x44fb46){var _0x1f324b=_[_0x7250('0x44')](_0x50f41c['chatQueuesWaitingInteractions']);_0x3c02be({'count':_0x1f324b['length'],'rows':_0x1f324b});});},'MailQueuesWaitingInteractions':function(_0x1595d6){return new Promise(function(_0x2d66ca,_0x1da251){var _0x13414f=_['values'](_0x50f41c[_0x7250('0x50')]);_0x2d66ca({'count':_0x13414f['length'],'rows':_0x13414f});});},'OpenchannelQueuesWaitingInteractions':function(_0x428ec4){return new Promise(function(_0x24f995,_0x2d30f3){var _0x3e2d9d=_[_0x7250('0x44')](_0x50f41c[_0x7250('0x51')]);_0x24f995({'count':_0x3e2d9d[_0x7250('0x22')],'rows':_0x3e2d9d});});},'SmsQueuesWaitingInteractions':function(_0xc6872a){return new Promise(function(_0x4a4e77,_0x2cafad){var _0x5be44c=_['values'](_0x50f41c[_0x7250('0x52')]);_0x4a4e77({'count':_0x5be44c[_0x7250('0x22')],'rows':_0x5be44c});});},'FaxQueuesWaitingInteractions':function(_0x4a4c8b){return new Promise(function(_0x39a1d5,_0x99496a){var _0x13ac63=_[_0x7250('0x44')](_0x50f41c['faxQueuesWaitingInteractions']);_0x39a1d5({'count':_0x13ac63['length'],'rows':_0x13ac63});});},'WhatsappQueuesWaitingInteractions':function(_0x5d0049){return new Promise(function(_0x479809,_0x3fef83){var _0xd699e8=_[_0x7250('0x44')](_0x50f41c[_0x7250('0x53')]);_0x479809({'count':_0xd699e8[_0x7250('0x22')],'rows':_0xd699e8});});}};var _0x1c6b0c=jayson[_0x7250('0x54')](_0x41d01f)['http']();_0x1c6b0c['on'](_0x7250('0x2d'),function(_0x44981f){logger['error'](JSON[_0x7250('0x31')](_0x44981f));return _0x11dc0e(_0x44981f);});_0x1c6b0c[_0x7250('0x11')](0x232c,_0x7250('0x55'),function(){console[_0x7250('0x56')](_0x7250('0x57'),0x232c);return _0x3c5b1b(_0x7250('0x58')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index f800c3f..5241537 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 _0x2718=['rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','length','Command','format','catch','[%s][INTERVAL]\x20%s','all','join','\x20|\x20','when','[%s][INTERVAL]\x20%s\x20%s','stop','util','jayson/promise','lodash','../../../config/logger','routing','client','http','then','error','message','result','condition'];(function(_0x319d6a,_0x290d07){var _0x2bc9b9=function(_0x3837a4){while(--_0x3837a4){_0x319d6a['push'](_0x319d6a['shift']());}};_0x2bc9b9(++_0x290d07);}(_0x2718,0xf8));var _0x8271=function(_0x23a236,_0x5928e7){_0x23a236=_0x23a236-0x0;var _0x5747cd=_0x2718[_0x23a236];return _0x5747cd;};'use strict';var util=require(_0x8271('0x0'));var BPromise=require('bluebird');var jayson=require(_0x8271('0x1'));var _=require(_0x8271('0x2'));var logger=require(_0x8271('0x3'))(_0x8271('0x4'));var client=jayson[_0x8271('0x5')][_0x8271('0x6')]({'port':0x232a});function request(_0x1dc464,_0x119beb){return new BPromise(function(_0x530683,_0x1c8aeb){return client['request'](_0x1dc464,_0x119beb)[_0x8271('0x7')](function(_0x24e27d){if(_0x24e27d[_0x8271('0x8')]){return _0x1c8aeb(_0x24e27d[_0x8271('0x8')][_0x8271('0x9')]);}else{return _0x530683(_0x24e27d[_0x8271('0xa')]);}})['catch'](function(_0x665ace){return _0x1c8aeb(_0x665ace);});});}exports[_0x8271('0xb')]=function(_0x563f36,_0x3dcc36,_0x4c8fe8){return function(_0x2e40cc){if(_0x4c8fe8['rules']&&!_0x4c8fe8[_0x8271('0xc')][_0x563f36]){logger[_0x8271('0xd')](_0x8271('0xe'),_0x563f36);return _0x2e40cc['stop']();}var _0x38640c=[];for(var _0x52f905=0x0;_0x52f905<_0x3dcc36[_0x8271('0xf')];_0x52f905+=0x1){_0x38640c['push'](request(_0x8271('0x10'),{'command':util[_0x8271('0x11')]('iftime\x20%s',_0x3dcc36[_0x52f905])})[_0x8271('0x7')](function(_0x1440ee){return _0x1440ee&&_0x1440ee[_0x8271('0x9')]&&_0x1440ee[_0x8271('0x9')]['indexOf']('true')>=0x0?!![]:![];})[_0x8271('0x12')](function(_0x3f3d58){logger[_0x8271('0x8')](_0x8271('0x13'),_0x563f36,_0x3dcc36[_0x52f905]);}));}BPromise[_0x8271('0x14')](_0x38640c)[_0x8271('0x7')](function(_0x308111){var _0x1c735c=_['some'](_0x308111);logger['info']('[%s][INTERVAL]\x20%s\x20%s',_0x563f36,_0x3dcc36[_0x8271('0x15')](_0x8271('0x16')),_0x1c735c);_0x2e40cc[_0x8271('0x17')](_0x1c735c);})[_0x8271('0x12')](function(_0x59b15c){console['log'](_0x59b15c);logger[_0x8271('0x8')](_0x8271('0x18'),_0x563f36,_0x3dcc36['join']('\x20|\x20'),_0x59b15c['stack']);_0x2e40cc[_0x8271('0x19')]();});};}; \ No newline at end of file +var _0x440c=['request','then','error','message','result','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','push','indexOf','true','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','log','stack','util','bluebird','lodash','../../../config/logger','routing','client'];(function(_0x8cd837,_0x42d7c2){var _0x3ee7bb=function(_0x63b167){while(--_0x63b167){_0x8cd837['push'](_0x8cd837['shift']());}};_0x3ee7bb(++_0x42d7c2);}(_0x440c,0x182));var _0xc440=function(_0x519baa,_0x460fb6){_0x519baa=_0x519baa-0x0;var _0x8a2ef9=_0x440c[_0x519baa];return _0x8a2ef9;};'use strict';var util=require(_0xc440('0x0'));var BPromise=require(_0xc440('0x1'));var jayson=require('jayson/promise');var _=require(_0xc440('0x2'));var logger=require(_0xc440('0x3'))(_0xc440('0x4'));var client=jayson[_0xc440('0x5')]['http']({'port':0x232a});function request(_0x283d2b,_0x2699b6){return new BPromise(function(_0xc2e91b,_0x216871){return client[_0xc440('0x6')](_0x283d2b,_0x2699b6)[_0xc440('0x7')](function(_0x354c37){if(_0x354c37[_0xc440('0x8')]){return _0x216871(_0x354c37['error'][_0xc440('0x9')]);}else{return _0xc2e91b(_0x354c37[_0xc440('0xa')]);}})['catch'](function(_0x198076){return _0x216871(_0x198076);});});}exports[_0xc440('0xb')]=function(_0x41e097,_0x130f01,_0x25b90b){return function(_0x4a14b2){if(_0x25b90b[_0xc440('0xc')]&&!_0x25b90b['rules'][_0x41e097]){logger[_0xc440('0xd')](_0xc440('0xe'),_0x41e097);return _0x4a14b2[_0xc440('0xf')]();}var _0x5d402b=[];for(var _0x5efb18=0x0;_0x5efb18<_0x130f01['length'];_0x5efb18+=0x1){_0x5d402b[_0xc440('0x10')](request('Command',{'command':util['format']('iftime\x20%s',_0x130f01[_0x5efb18])})[_0xc440('0x7')](function(_0x15045c){return _0x15045c&&_0x15045c[_0xc440('0x9')]&&_0x15045c[_0xc440('0x9')][_0xc440('0x11')](_0xc440('0x12'))>=0x0?!![]:![];})['catch'](function(_0x242940){logger['error'](_0xc440('0x13'),_0x41e097,_0x130f01[_0x5efb18]);}));}BPromise[_0xc440('0x14')](_0x5d402b)['then'](function(_0x36d23f){var _0x61b475=_[_0xc440('0x15')](_0x36d23f);logger[_0xc440('0xd')](_0xc440('0x16'),_0x41e097,_0x130f01[_0xc440('0x17')](_0xc440('0x18')),_0x61b475);_0x4a14b2[_0xc440('0x19')](_0x61b475);})['catch'](function(_0x3267fd){console[_0xc440('0x1a')](_0x3267fd);logger[_0xc440('0x8')](_0xc440('0x16'),_0x41e097,_0x130f01[_0xc440('0x17')]('\x20|\x20'),_0x3267fd[_0xc440('0x1b')]);_0x4a14b2['stop']();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index f345f20..2c7456a 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 _0x3c81=['CreateVoiceAgentReport','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','called','connectedlinename','info','format','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','uniqueid','error','agentringnoanswer','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','now','reason','holdtime','talktime','push','queuecallerabandon','forIn','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','agentringnoanswerAt','abandoned','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','ringtime','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','transferexten','extension','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','origtransfererexten','transferuniqueid','transfereeuniqueid','clone','calleridname','agententerreason','secondtransfererlinkedid','isNil','ATTENDED','secondtransfererexten','transfertargetuniqueid','[%s][agents][hangup]','timeout','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','splice','agent','lodash','util','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','request'];(function(_0x16181e,_0x4e57c2){var _0x16dbeb=function(_0x2b210e){while(--_0x2b210e){_0x16181e['push'](_0x16181e['shift']());}};_0x16dbeb(++_0x4e57c2);}(_0x3c81,0x102));var _0x13c8=function(_0x1dc40e,_0x5e72bb){_0x1dc40e=_0x1dc40e-0x0;var _0x3a46cc=_0x3c81[_0x1dc40e];return _0x3a46cc;};'use strict';var _=require(_0x13c8('0x0'));var util=require(_0x13c8('0x1'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x252f26,_0x131d0b){utils['info'](util['format']('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x252f26['uniqueid'],_0x252f26[_0x13c8('0x2')],_0x252f26[_0x13c8('0x3')],_0x252f26[_0x13c8('0x4')],_0x252f26[_0x13c8('0x5')],_0x252f26[_0x13c8('0x6')],_0x252f26[_0x13c8('0x7')],_0x252f26[_0x13c8('0x8')]));if(_0x252f26['queue']){utils[_0x13c8('0x9')](_0x252f26['queue'])[_0x13c8('0xa')](function(_0x296463){if(_0x296463){_0x252f26[_0x13c8('0xb')]=_0x296463[_0x13c8('0xb')];_0x252f26[_0x13c8('0xc')]=_0x252f26[_0x13c8('0xd')]?_0x296463[_0x13c8('0xe')]:![];_0x252f26[_0x13c8('0xf')]=_0x252f26[_0x13c8('0xc')]?_0x296463[_0x13c8('0x10')]:0x0;}utils[_0x13c8('0x11')](_0x13c8('0x12'),_0x252f26);});}else{utils[_0x13c8('0x11')](_0x13c8('0x12'),_0x252f26);}if(_0x131d0b){delete transfers[_0x252f26['uniqueid']];}else{delete agents[_0x252f26[_0x13c8('0x13')]];}}exports[_0x13c8('0x14')]=function(_0x2304b5){try{utils[_0x13c8('0x15')](util['format'](_0x13c8('0x16'),_0x2304b5['uniqueid']),_0x2304b5);agents[_0x2304b5['destuniqueid']]=_0x2304b5;agents[_0x2304b5['destuniqueid']][_0x13c8('0x17')]=utils['now']();agents[_0x2304b5[_0x13c8('0x13')]][_0x13c8('0x8')]=_0x13c8('0x18');agents[_0x2304b5[_0x13c8('0x13')]]['connectedlinenum']=null;agents[_0x2304b5[_0x13c8('0x13')]][_0x13c8('0x19')]=null;utils[_0x13c8('0x1a')](util[_0x13c8('0x1b')](_0x13c8('0x1c'),_0x2304b5[_0x13c8('0x1d')],agents[_0x2304b5[_0x13c8('0x13')]][_0x13c8('0x4')],_0x2304b5[_0x13c8('0x13')]));}catch(_0x31d122){utils[_0x13c8('0x1e')](util['format'](_0x13c8('0x16'),_0x2304b5[_0x13c8('0x1d')]),_0x31d122);}};exports[_0x13c8('0x1f')]=function(_0x313ea3){try{if(!_['isNil'](agents[_0x313ea3[_0x13c8('0x13')]])){utils[_0x13c8('0x15')](util[_0x13c8('0x1b')](_0x13c8('0x20'),_0x313ea3[_0x13c8('0x1d')]),_0x313ea3);utils[_0x13c8('0x1a')](util['format'](_0x13c8('0x21'),_0x313ea3[_0x13c8('0x1d')],agents[_0x313ea3[_0x13c8('0x13')]][_0x13c8('0x4')],_0x313ea3['destuniqueid']));agents[_0x313ea3[_0x13c8('0x13')]][_0x13c8('0x1f')]=!![];agents[_0x313ea3['destuniqueid']]['agentringnoanswerAt']=utils[_0x13c8('0x22')]();agents[_0x313ea3[_0x13c8('0x13')]]['lastevent']='timeout';agents[_0x313ea3[_0x13c8('0x13')]][_0x13c8('0x23')]='timeout';agents[_0x313ea3['destuniqueid']][_0x13c8('0x24')]=_0x313ea3['ringtime']?parseInt(_0x313ea3['ringtime'])/0x3e8:0x0;agents[_0x313ea3[_0x13c8('0x13')]][_0x13c8('0x25')]=0x0;unanswered[_0x13c8('0x26')](_0x313ea3['destuniqueid']);}}catch(_0x5ef2f7){utils[_0x13c8('0x1e')](util[_0x13c8('0x1b')](_0x13c8('0x20'),_0x313ea3[_0x13c8('0x1d')]),_0x5ef2f7);}};exports[_0x13c8('0x27')]=function(_0x220d40){try{_[_0x13c8('0x28')](agents,function(_0x4a1b9c,_0x109cb8){if(_0x4a1b9c[_0x13c8('0x1d')]==_0x220d40['uniqueid']&&!_['includes'](unanswered,_0x4a1b9c[_0x13c8('0x13')])){utils[_0x13c8('0x15')](util['format'](_0x13c8('0x29'),_0x220d40[_0x13c8('0x1d')]),_0x220d40);utils['info'](util[_0x13c8('0x1b')](_0x13c8('0x2a'),_0x220d40[_0x13c8('0x1d')],_0x4a1b9c[_0x13c8('0x4')],_0x4a1b9c[_0x13c8('0x13')]));_0x4a1b9c[_0x13c8('0x1f')]=!![];_0x4a1b9c[_0x13c8('0x2b')]=utils[_0x13c8('0x22')]();_0x4a1b9c['lastevent']='abandoned';_0x4a1b9c[_0x13c8('0x23')]=_0x13c8('0x2c');_0x4a1b9c['holdtime']=_0x220d40[_0x13c8('0x24')];_0x4a1b9c['talktime']=0x0;writeDB(_0x4a1b9c);}});}catch(_0x1fdf7d){utils['error'](util[_0x13c8('0x1b')](_0x13c8('0x29'),_0x220d40[_0x13c8('0x1d')]),_0x1fdf7d);}};exports[_0x13c8('0x2d')]=function(_0x2039e7){try{if(agents[_0x2039e7[_0x13c8('0x13')]]){utils[_0x13c8('0x15')](util['format'](_0x13c8('0x2e'),_0x2039e7[_0x13c8('0x1d')]),_0x2039e7);utils['info'](util[_0x13c8('0x1b')](_0x13c8('0x2f'),_0x2039e7[_0x13c8('0x1d')],agents[_0x2039e7['destuniqueid']]['membername'],_0x2039e7['destuniqueid']));agents[_0x2039e7[_0x13c8('0x13')]][_0x13c8('0x30')]=utils[_0x13c8('0x22')]();agents[_0x2039e7[_0x13c8('0x13')]][_0x13c8('0x7')]=_0x2039e7[_0x13c8('0x7')];agents[_0x2039e7[_0x13c8('0x13')]][_0x13c8('0x19')]=_0x2039e7[_0x13c8('0x19')];agents[_0x2039e7['destuniqueid']]['holdtime']=_0x2039e7[_0x13c8('0x31')];agents[_0x2039e7[_0x13c8('0x13')]][_0x13c8('0x8')]=_0x13c8('0x32');_['forIn'](agents,function(_0x35e1e7,_0x4bd627){if(_0x35e1e7[_0x13c8('0x13')]!=_0x2039e7[_0x13c8('0x13')]&&_0x35e1e7[_0x13c8('0x1d')]==_0x2039e7[_0x13c8('0x1d')]){_0x35e1e7[_0x13c8('0x25')]=0x0;_0x35e1e7[_0x13c8('0x24')]=_0x2039e7[_0x13c8('0x31')];_0x35e1e7[_0x13c8('0x1f')]=!![];_0x35e1e7[_0x13c8('0x2b')]=utils[_0x13c8('0x22')]();_0x35e1e7[_0x13c8('0x8')]=_0x13c8('0x33');_0x35e1e7[_0x13c8('0x23')]=_0x13c8('0x33');_0x35e1e7[_0x13c8('0x34')]=_0x2039e7[_0x13c8('0x13')];_0x35e1e7[_0x13c8('0x35')]=_0x2039e7[_0x13c8('0x4')];writeDB(_0x35e1e7);}});}}catch(_0xc5eb86){utils[_0x13c8('0x1e')](util[_0x13c8('0x1b')](_0x13c8('0x2e'),_0x2039e7[_0x13c8('0x1d')]),_0xc5eb86);}};exports[_0x13c8('0xd')]=function(_0x44ee66){try{if(!_['isNil'](agents[_0x44ee66[_0x13c8('0x13')]])){utils[_0x13c8('0x15')](util[_0x13c8('0x1b')](_0x13c8('0x36'),_0x44ee66[_0x13c8('0x1d')]),_0x44ee66);utils['info'](util['format'](_0x13c8('0x37'),_0x44ee66[_0x13c8('0x1d')],agents[_0x44ee66[_0x13c8('0x13')]]['membername'],_0x44ee66['destuniqueid']));agents[_0x44ee66['destuniqueid']][_0x13c8('0xd')]=!![];agents[_0x44ee66['destuniqueid']][_0x13c8('0x38')]=utils['now']();agents[_0x44ee66[_0x13c8('0x13')]][_0x13c8('0x25')]=utils[_0x13c8('0x39')](agents[_0x44ee66[_0x13c8('0x13')]][_0x13c8('0x38')],agents[_0x44ee66[_0x13c8('0x13')]]['agentconnectAt']);agents[_0x44ee66[_0x13c8('0x13')]][_0x13c8('0x23')]=_0x44ee66['reason'];agents[_0x44ee66[_0x13c8('0x13')]][_0x13c8('0x8')]=_0x13c8('0x3a');writeDB(agents[_0x44ee66[_0x13c8('0x13')]]);}}catch(_0x38486a){utils['error'](util[_0x13c8('0x1b')](_0x13c8('0x36'),_0x44ee66[_0x13c8('0x1d')]),_0x38486a);}};exports[_0x13c8('0x3b')]=function(_0x185d18){try{if(!_['isNil'](agents[_0x185d18[_0x13c8('0x3c')]])){utils[_0x13c8('0x15')](util[_0x13c8('0x1b')](_0x13c8('0x3d'),_0x185d18[_0x13c8('0x1d')]),_0x185d18);utils[_0x13c8('0x1a')](util[_0x13c8('0x1b')](_0x13c8('0x3e'),_0x185d18[_0x13c8('0x1d')],agents[_0x185d18[_0x13c8('0x3c')]][_0x13c8('0x4')],agents[_0x185d18['transfereruniqueid']][_0x13c8('0x1d')]));agents[_0x185d18[_0x13c8('0x3c')]][_0x13c8('0x3f')]=!![];agents[_0x185d18[_0x13c8('0x3c')]][_0x13c8('0x40')]=_0x13c8('0x41');agents[_0x185d18['transfereruniqueid']][_0x13c8('0x42')]=_0x185d18[_0x13c8('0x43')];agents[_0x185d18[_0x13c8('0x3c')]]['transferuniqueid']=agents[_0x185d18['transfereruniqueid']][_0x13c8('0x1d')];}}catch(_0x14a738){utils['error'](util[_0x13c8('0x1b')](_0x13c8('0x3d'),_0x185d18['uniqueid']),_0x14a738);}};exports[_0x13c8('0x44')]=function(_0x554792){try{utils[_0x13c8('0x15')](util[_0x13c8('0x1b')](_0x13c8('0x45'),_0x554792['origtransfereruniqueid']),_0x554792);if(_0x554792[_0x13c8('0x46')]==_0x554792[_0x13c8('0x47')]){if(!_['isNil'](agents[_0x554792[_0x13c8('0x48')]])){utils['info'](util[_0x13c8('0x1b')](_0x13c8('0x49'),_0x554792[_0x13c8('0x46')],agents[_0x554792[_0x13c8('0x48')]][_0x13c8('0x4')]));agents[_0x554792['secondtransfereruniqueid']][_0x13c8('0x3f')]=!![];agents[_0x554792['secondtransfereruniqueid']]['transfertype']='ATTENDED';agents[_0x554792['secondtransfereruniqueid']]['transferexten']=_0x554792[_0x13c8('0x4a')];agents[_0x554792[_0x13c8('0x48')]][_0x13c8('0x4b')]=_0x554792[_0x13c8('0x46')];}if(_0x554792[_0x13c8('0x4c')]&&agents[_0x554792[_0x13c8('0x4c')]]){agents[_0x554792[_0x13c8('0x4c')]]['agententerreason']=0x1;transfers[_0x554792['transfereeuniqueid']]=_[_0x13c8('0x4d')](agents[_0x554792[_0x13c8('0x4c')]]);transfers[_0x554792[_0x13c8('0x4c')]][_0x13c8('0x6')]=agents[_0x554792[_0x13c8('0x48')]][_0x13c8('0x6')];transfers[_0x554792[_0x13c8('0x4c')]][_0x13c8('0x4e')]=agents[_0x554792['secondtransfereruniqueid']][_0x13c8('0x4e')];transfers[_0x554792[_0x13c8('0x4c')]]['agentcalledAt']=utils[_0x13c8('0x22')]();transfers[_0x554792[_0x13c8('0x4c')]][_0x13c8('0x30')]=utils[_0x13c8('0x22')]();transfers[_0x554792[_0x13c8('0x4c')]][_0x13c8('0x24')]=0x0;transfers[_0x554792[_0x13c8('0x4c')]][_0x13c8('0x4f')]=0x2;}}else if(_0x554792[_0x13c8('0x48')]==_0x554792[_0x13c8('0x50')]){if(!_[_0x13c8('0x51')](agents[_0x554792[_0x13c8('0x46')]])){utils[_0x13c8('0x1a')](util[_0x13c8('0x1b')](_0x13c8('0x49'),_0x554792[_0x13c8('0x46')],agents[_0x554792['origtransfereruniqueid']][_0x13c8('0x4')]));agents[_0x554792['origtransfereruniqueid']][_0x13c8('0x3f')]=!![];agents[_0x554792[_0x13c8('0x46')]]['transfertype']=_0x13c8('0x52');agents[_0x554792[_0x13c8('0x46')]]['transferexten']=_0x554792[_0x13c8('0x53')];agents[_0x554792[_0x13c8('0x46')]][_0x13c8('0x4b')]=_0x554792[_0x13c8('0x48')];}if(_0x554792[_0x13c8('0x54')]&&agents[_0x554792[_0x13c8('0x54')]]){agents[_0x554792[_0x13c8('0x54')]][_0x13c8('0x4f')]=0x1;transfers[_0x554792[_0x13c8('0x54')]]=_[_0x13c8('0x4d')](agents[_0x554792[_0x13c8('0x54')]]);transfers[_0x554792['transfertargetuniqueid']][_0x13c8('0x6')]=agents[_0x554792[_0x13c8('0x46')]][_0x13c8('0x6')];transfers[_0x554792[_0x13c8('0x54')]][_0x13c8('0x4e')]=agents[_0x554792[_0x13c8('0x46')]]['calleridname'];transfers[_0x554792[_0x13c8('0x54')]][_0x13c8('0x17')]=utils[_0x13c8('0x22')]();transfers[_0x554792['transfertargetuniqueid']][_0x13c8('0x30')]=utils[_0x13c8('0x22')]();transfers[_0x554792[_0x13c8('0x54')]][_0x13c8('0x24')]=0x0;transfers[_0x554792[_0x13c8('0x54')]][_0x13c8('0x4f')]=0x2;}}}catch(_0x55e5ba){utils[_0x13c8('0x1e')](util[_0x13c8('0x1b')](_0x13c8('0x45'),_0x554792[_0x13c8('0x46')]),_0x55e5ba);}};exports['hangup']=function(_0x16b409){try{utils[_0x13c8('0x15')](util[_0x13c8('0x1b')](_0x13c8('0x55'),_0x16b409[_0x13c8('0x1d')]),_0x16b409);if(agents[_0x16b409[_0x13c8('0x1d')]]&&agents[_0x16b409[_0x13c8('0x1d')]]['reason']===_0x13c8('0x56')){if(_0x16b409[_0x13c8('0x57')]==='21'){agents[_0x16b409[_0x13c8('0x1d')]]['reason']=_0x13c8('0x58');agents[_0x16b409[_0x13c8('0x1d')]]['lastevent']='rejected';}utils[_0x13c8('0x1a')](util['format'](_0x13c8('0x59'),_0x16b409['uniqueid'],agents[_0x16b409[_0x13c8('0x1d')]][_0x13c8('0x4')],agents[_0x16b409[_0x13c8('0x1d')]][_0x13c8('0x23')],agents[_0x16b409[_0x13c8('0x1d')]]['lastevent']));writeDB(agents[_0x16b409[_0x13c8('0x1d')]]);var _0x2d8dfe=unanswered['indexOf'](_0x16b409[_0x13c8('0x1d')]);if(_0x2d8dfe>-0x1){unanswered[_0x13c8('0x5a')](_0x2d8dfe,0x1);}}if(transfers[_0x16b409[_0x13c8('0x1d')]]){transfers[_0x16b409[_0x13c8('0x1d')]][_0x13c8('0xd')]=!![];transfers[_0x16b409[_0x13c8('0x1d')]][_0x13c8('0x38')]=utils[_0x13c8('0x22')]();transfers[_0x16b409[_0x13c8('0x1d')]][_0x13c8('0x25')]=utils['diffTime'](transfers[_0x16b409[_0x13c8('0x1d')]][_0x13c8('0x38')],transfers[_0x16b409['uniqueid']]['agentconnectAt']);transfers[_0x16b409[_0x13c8('0x1d')]][_0x13c8('0x23')]=_0x13c8('0x5b');transfers[_0x16b409[_0x13c8('0x1d')]][_0x13c8('0x8')]=_0x13c8('0x3a');utils['info'](util[_0x13c8('0x1b')](_0x13c8('0x59'),_0x16b409[_0x13c8('0x1d')],transfers[_0x16b409[_0x13c8('0x1d')]][_0x13c8('0x4')],transfers[_0x16b409['uniqueid']][_0x13c8('0x23')],transfers[_0x16b409[_0x13c8('0x1d')]]['lastevent']));writeDB(transfers[_0x16b409[_0x13c8('0x1d')]],!![]);}if(agents[_0x16b409[_0x13c8('0x1d')]]&&agents[_0x16b409['uniqueid']][_0x13c8('0x30')]){agents[_0x16b409['uniqueid']][_0x13c8('0xd')]=!![];agents[_0x16b409['uniqueid']][_0x13c8('0x38')]=utils[_0x13c8('0x22')]();agents[_0x16b409[_0x13c8('0x1d')]]['talktime']=utils[_0x13c8('0x39')](agents[_0x16b409['uniqueid']]['agentcompleteAt'],agents[_0x16b409[_0x13c8('0x1d')]][_0x13c8('0x30')]);agents[_0x16b409[_0x13c8('0x1d')]][_0x13c8('0x23')]=agents[_0x16b409['uniqueid']]['transfer']?_0x13c8('0x3f'):'agent';agents[_0x16b409['uniqueid']][_0x13c8('0x8')]=_0x13c8('0x3a');utils[_0x13c8('0x1a')](util[_0x13c8('0x1b')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x16b409[_0x13c8('0x1d')],agents[_0x16b409['uniqueid']]['membername'],agents[_0x16b409[_0x13c8('0x1d')]][_0x13c8('0x23')],agents[_0x16b409[_0x13c8('0x1d')]][_0x13c8('0x8')]));writeDB(agents[_0x16b409[_0x13c8('0x1d')]]);}}catch(_0x551563){utils[_0x13c8('0x1e')](util['format'](_0x13c8('0x55'),_0x16b409['uniqueid']),_0x551563);}}; \ No newline at end of file +var _0x282b=['talktime','push','queuecallerabandon','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','agentringnoanswerAt','abandoned','agentconnect','[%s][agents][agentconnect]','connectedlinename','forIn','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','agentcomplete','[%s][agents][agentcomplete]','agentcompleteAt','diffTime','agentconnectAt','blindtransfer','[%s][agents][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','origtransfererexten','transfereeuniqueid','clone','calleridname','agentcalledAt','agententerreason','secondtransfererlinkedid','ATTENDED','secondtransfererexten','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','complete','lodash','util','./utils','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','calleridnum','connectedlinenum','getVoiceQueueByName','type','agentacw','acwtime','acwTimeout','request','CreateVoiceAgentReport','uniqueid','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','lastevent','called','info','format','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','now','timeout','reason','holdtime','ringtime'];(function(_0xb4ff79,_0x43a5f9){var _0xe98536=function(_0x1335b0){while(--_0x1335b0){_0xb4ff79['push'](_0xb4ff79['shift']());}};_0xe98536(++_0x43a5f9);}(_0x282b,0xec));var _0xb282=function(_0x3929fe,_0x5d292f){_0x3929fe=_0x3929fe-0x0;var _0xdf76a9=_0x282b[_0x3929fe];return _0xdf76a9;};'use strict';var _=require(_0xb282('0x0'));var util=require(_0xb282('0x1'));var utils=require(_0xb282('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x2251b5,_0x527989){utils['info'](util['format'](_0xb282('0x3'),_0x2251b5['uniqueid'],_0x2251b5[_0xb282('0x4')],_0x2251b5[_0xb282('0x5')],_0x2251b5[_0xb282('0x6')],_0x2251b5[_0xb282('0x7')],_0x2251b5[_0xb282('0x8')],_0x2251b5[_0xb282('0x9')],_0x2251b5['lastevent']));if(_0x2251b5['queue']){utils[_0xb282('0xa')](_0x2251b5[_0xb282('0x5')])['then'](function(_0x2928cf){if(_0x2928cf){_0x2251b5[_0xb282('0xb')]=_0x2928cf[_0xb282('0xb')];_0x2251b5[_0xb282('0xc')]=_0x2251b5['agentcomplete']?_0x2928cf['acw']:![];_0x2251b5[_0xb282('0xd')]=_0x2251b5[_0xb282('0xc')]?_0x2928cf[_0xb282('0xe')]:0x0;}utils[_0xb282('0xf')](_0xb282('0x10'),_0x2251b5);});}else{utils['request']('CreateVoiceAgentReport',_0x2251b5);}if(_0x527989){delete transfers[_0x2251b5[_0xb282('0x11')]];}else{delete agents[_0x2251b5[_0xb282('0x12')]];}}exports[_0xb282('0x13')]=function(_0x9e9072){try{utils[_0xb282('0x14')](util['format'](_0xb282('0x15'),_0x9e9072['uniqueid']),_0x9e9072);agents[_0x9e9072[_0xb282('0x12')]]=_0x9e9072;agents[_0x9e9072[_0xb282('0x12')]]['agentcalledAt']=utils['now']();agents[_0x9e9072['destuniqueid']][_0xb282('0x16')]=_0xb282('0x17');agents[_0x9e9072[_0xb282('0x12')]][_0xb282('0x9')]=null;agents[_0x9e9072[_0xb282('0x12')]]['connectedlinename']=null;utils[_0xb282('0x18')](util[_0xb282('0x19')](_0xb282('0x1a'),_0x9e9072[_0xb282('0x11')],agents[_0x9e9072[_0xb282('0x12')]]['membername'],_0x9e9072['destuniqueid']));}catch(_0xcea320){utils[_0xb282('0x1b')](util['format'](_0xb282('0x15'),_0x9e9072[_0xb282('0x11')]),_0xcea320);}};exports[_0xb282('0x1c')]=function(_0x438dbe){try{if(!_[_0xb282('0x1d')](agents[_0x438dbe['destuniqueid']])){utils[_0xb282('0x14')](util[_0xb282('0x19')](_0xb282('0x1e'),_0x438dbe['uniqueid']),_0x438dbe);utils[_0xb282('0x18')](util[_0xb282('0x19')](_0xb282('0x1f'),_0x438dbe[_0xb282('0x11')],agents[_0x438dbe[_0xb282('0x12')]]['membername'],_0x438dbe['destuniqueid']));agents[_0x438dbe[_0xb282('0x12')]][_0xb282('0x1c')]=!![];agents[_0x438dbe['destuniqueid']]['agentringnoanswerAt']=utils[_0xb282('0x20')]();agents[_0x438dbe[_0xb282('0x12')]][_0xb282('0x16')]=_0xb282('0x21');agents[_0x438dbe[_0xb282('0x12')]][_0xb282('0x22')]='timeout';agents[_0x438dbe[_0xb282('0x12')]][_0xb282('0x23')]=_0x438dbe['ringtime']?parseInt(_0x438dbe[_0xb282('0x24')])/0x3e8:0x0;agents[_0x438dbe[_0xb282('0x12')]][_0xb282('0x25')]=0x0;unanswered[_0xb282('0x26')](_0x438dbe['destuniqueid']);}}catch(_0x1520b1){utils[_0xb282('0x1b')](util[_0xb282('0x19')](_0xb282('0x1e'),_0x438dbe[_0xb282('0x11')]),_0x1520b1);}};exports[_0xb282('0x27')]=function(_0x22f657){try{_['forIn'](agents,function(_0x1b15b5,_0x1e2861){if(_0x1b15b5[_0xb282('0x11')]==_0x22f657[_0xb282('0x11')]&&!_[_0xb282('0x28')](unanswered,_0x1b15b5['destuniqueid'])){utils[_0xb282('0x14')](util['format'](_0xb282('0x29'),_0x22f657[_0xb282('0x11')]),_0x22f657);utils[_0xb282('0x18')](util['format'](_0xb282('0x2a'),_0x22f657['uniqueid'],_0x1b15b5[_0xb282('0x6')],_0x1b15b5[_0xb282('0x12')]));_0x1b15b5[_0xb282('0x1c')]=!![];_0x1b15b5[_0xb282('0x2b')]=utils[_0xb282('0x20')]();_0x1b15b5[_0xb282('0x16')]='abandoned';_0x1b15b5[_0xb282('0x22')]=_0xb282('0x2c');_0x1b15b5['holdtime']=_0x22f657['holdtime'];_0x1b15b5[_0xb282('0x25')]=0x0;writeDB(_0x1b15b5);}});}catch(_0x271643){utils[_0xb282('0x1b')](util['format']('[%s][agents][queuecallerabandon]',_0x22f657['uniqueid']),_0x271643);}};exports[_0xb282('0x2d')]=function(_0x2a7362){try{if(agents[_0x2a7362[_0xb282('0x12')]]){utils[_0xb282('0x14')](util[_0xb282('0x19')](_0xb282('0x2e'),_0x2a7362[_0xb282('0x11')]),_0x2a7362);utils['info'](util[_0xb282('0x19')]('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x2a7362[_0xb282('0x11')],agents[_0x2a7362[_0xb282('0x12')]][_0xb282('0x6')],_0x2a7362['destuniqueid']));agents[_0x2a7362[_0xb282('0x12')]]['agentconnectAt']=utils[_0xb282('0x20')]();agents[_0x2a7362[_0xb282('0x12')]][_0xb282('0x9')]=_0x2a7362[_0xb282('0x9')];agents[_0x2a7362['destuniqueid']]['connectedlinename']=_0x2a7362[_0xb282('0x2f')];agents[_0x2a7362[_0xb282('0x12')]][_0xb282('0x23')]=_0x2a7362[_0xb282('0x24')];agents[_0x2a7362['destuniqueid']][_0xb282('0x16')]='connect';_[_0xb282('0x30')](agents,function(_0x1a1b50,_0x482ff9){if(_0x1a1b50[_0xb282('0x12')]!=_0x2a7362[_0xb282('0x12')]&&_0x1a1b50[_0xb282('0x11')]==_0x2a7362[_0xb282('0x11')]){_0x1a1b50[_0xb282('0x25')]=0x0;_0x1a1b50[_0xb282('0x23')]=_0x2a7362[_0xb282('0x24')];_0x1a1b50[_0xb282('0x1c')]=!![];_0x1a1b50[_0xb282('0x2b')]=utils[_0xb282('0x20')]();_0x1a1b50[_0xb282('0x16')]=_0xb282('0x31');_0x1a1b50[_0xb282('0x22')]=_0xb282('0x31');_0x1a1b50[_0xb282('0x32')]=_0x2a7362[_0xb282('0x12')];_0x1a1b50[_0xb282('0x33')]=_0x2a7362[_0xb282('0x6')];writeDB(_0x1a1b50);}});}}catch(_0x573da7){utils[_0xb282('0x1b')](util['format'](_0xb282('0x2e'),_0x2a7362[_0xb282('0x11')]),_0x573da7);}};exports[_0xb282('0x34')]=function(_0x2f2ce8){try{if(!_[_0xb282('0x1d')](agents[_0x2f2ce8[_0xb282('0x12')]])){utils['debug'](util['format'](_0xb282('0x35'),_0x2f2ce8['uniqueid']),_0x2f2ce8);utils[_0xb282('0x18')](util[_0xb282('0x19')]('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x2f2ce8[_0xb282('0x11')],agents[_0x2f2ce8[_0xb282('0x12')]][_0xb282('0x6')],_0x2f2ce8['destuniqueid']));agents[_0x2f2ce8['destuniqueid']][_0xb282('0x34')]=!![];agents[_0x2f2ce8['destuniqueid']][_0xb282('0x36')]=utils[_0xb282('0x20')]();agents[_0x2f2ce8[_0xb282('0x12')]][_0xb282('0x25')]=utils[_0xb282('0x37')](agents[_0x2f2ce8[_0xb282('0x12')]]['agentcompleteAt'],agents[_0x2f2ce8[_0xb282('0x12')]][_0xb282('0x38')]);agents[_0x2f2ce8[_0xb282('0x12')]]['reason']=_0x2f2ce8[_0xb282('0x22')];agents[_0x2f2ce8['destuniqueid']][_0xb282('0x16')]='complete';writeDB(agents[_0x2f2ce8[_0xb282('0x12')]]);}}catch(_0x4ac56f){utils['error'](util['format'](_0xb282('0x35'),_0x2f2ce8[_0xb282('0x11')]),_0x4ac56f);}};exports[_0xb282('0x39')]=function(_0x7a5aa4){try{if(!_['isNil'](agents[_0x7a5aa4['transfereruniqueid']])){utils['debug'](util[_0xb282('0x19')](_0xb282('0x3a'),_0x7a5aa4[_0xb282('0x11')]),_0x7a5aa4);utils[_0xb282('0x18')](util['format'](_0xb282('0x3b'),_0x7a5aa4[_0xb282('0x11')],agents[_0x7a5aa4['transfereruniqueid']][_0xb282('0x6')],agents[_0x7a5aa4[_0xb282('0x3c')]][_0xb282('0x11')]));agents[_0x7a5aa4[_0xb282('0x3c')]][_0xb282('0x3d')]=!![];agents[_0x7a5aa4['transfereruniqueid']][_0xb282('0x3e')]=_0xb282('0x3f');agents[_0x7a5aa4[_0xb282('0x3c')]][_0xb282('0x40')]=_0x7a5aa4[_0xb282('0x41')];agents[_0x7a5aa4[_0xb282('0x3c')]]['transferuniqueid']=agents[_0x7a5aa4[_0xb282('0x3c')]]['uniqueid'];}}catch(_0x4554f1){utils[_0xb282('0x1b')](util['format'](_0xb282('0x3a'),_0x7a5aa4[_0xb282('0x11')]),_0x4554f1);}};exports[_0xb282('0x42')]=function(_0x49fc44){try{utils['debug'](util[_0xb282('0x19')](_0xb282('0x43'),_0x49fc44[_0xb282('0x44')]),_0x49fc44);if(_0x49fc44['origtransfereruniqueid']==_0x49fc44[_0xb282('0x45')]){if(!_['isNil'](agents[_0x49fc44[_0xb282('0x46')]])){utils[_0xb282('0x18')](util['format'](_0xb282('0x47'),_0x49fc44['origtransfereruniqueid'],agents[_0x49fc44[_0xb282('0x46')]][_0xb282('0x6')]));agents[_0x49fc44[_0xb282('0x46')]][_0xb282('0x3d')]=!![];agents[_0x49fc44[_0xb282('0x46')]][_0xb282('0x3e')]='ATTENDED';agents[_0x49fc44[_0xb282('0x46')]]['transferexten']=_0x49fc44[_0xb282('0x48')];agents[_0x49fc44[_0xb282('0x46')]]['transferuniqueid']=_0x49fc44['origtransfereruniqueid'];}if(_0x49fc44[_0xb282('0x49')]&&agents[_0x49fc44[_0xb282('0x49')]]){agents[_0x49fc44[_0xb282('0x49')]]['agententerreason']=0x1;transfers[_0x49fc44['transfereeuniqueid']]=_[_0xb282('0x4a')](agents[_0x49fc44[_0xb282('0x49')]]);transfers[_0x49fc44[_0xb282('0x49')]]['calleridnum']=agents[_0x49fc44[_0xb282('0x46')]]['calleridnum'];transfers[_0x49fc44[_0xb282('0x49')]][_0xb282('0x4b')]=agents[_0x49fc44[_0xb282('0x46')]][_0xb282('0x4b')];transfers[_0x49fc44[_0xb282('0x49')]][_0xb282('0x4c')]=utils[_0xb282('0x20')]();transfers[_0x49fc44['transfereeuniqueid']][_0xb282('0x38')]=utils[_0xb282('0x20')]();transfers[_0x49fc44[_0xb282('0x49')]]['holdtime']=0x0;transfers[_0x49fc44['transfereeuniqueid']][_0xb282('0x4d')]=0x2;}}else if(_0x49fc44[_0xb282('0x46')]==_0x49fc44[_0xb282('0x4e')]){if(!_['isNil'](agents[_0x49fc44['origtransfereruniqueid']])){utils[_0xb282('0x18')](util[_0xb282('0x19')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x49fc44[_0xb282('0x44')],agents[_0x49fc44[_0xb282('0x44')]][_0xb282('0x6')]));agents[_0x49fc44['origtransfereruniqueid']][_0xb282('0x3d')]=!![];agents[_0x49fc44[_0xb282('0x44')]]['transfertype']=_0xb282('0x4f');agents[_0x49fc44[_0xb282('0x44')]][_0xb282('0x40')]=_0x49fc44[_0xb282('0x50')];agents[_0x49fc44['origtransfereruniqueid']]['transferuniqueid']=_0x49fc44[_0xb282('0x46')];}if(_0x49fc44[_0xb282('0x51')]&&agents[_0x49fc44['transfertargetuniqueid']]){agents[_0x49fc44[_0xb282('0x51')]][_0xb282('0x4d')]=0x1;transfers[_0x49fc44[_0xb282('0x51')]]=_[_0xb282('0x4a')](agents[_0x49fc44[_0xb282('0x51')]]);transfers[_0x49fc44[_0xb282('0x51')]][_0xb282('0x8')]=agents[_0x49fc44[_0xb282('0x44')]]['calleridnum'];transfers[_0x49fc44[_0xb282('0x51')]][_0xb282('0x4b')]=agents[_0x49fc44[_0xb282('0x44')]]['calleridname'];transfers[_0x49fc44[_0xb282('0x51')]][_0xb282('0x4c')]=utils['now']();transfers[_0x49fc44['transfertargetuniqueid']][_0xb282('0x38')]=utils[_0xb282('0x20')]();transfers[_0x49fc44[_0xb282('0x51')]][_0xb282('0x23')]=0x0;transfers[_0x49fc44[_0xb282('0x51')]][_0xb282('0x4d')]=0x2;}}}catch(_0x3cb0c6){utils[_0xb282('0x1b')](util[_0xb282('0x19')](_0xb282('0x43'),_0x49fc44[_0xb282('0x44')]),_0x3cb0c6);}};exports[_0xb282('0x52')]=function(_0x88dfa6){try{utils[_0xb282('0x14')](util[_0xb282('0x19')](_0xb282('0x53'),_0x88dfa6['uniqueid']),_0x88dfa6);if(agents[_0x88dfa6[_0xb282('0x11')]]&&agents[_0x88dfa6[_0xb282('0x11')]][_0xb282('0x22')]===_0xb282('0x21')){if(_0x88dfa6[_0xb282('0x54')]==='21'){agents[_0x88dfa6[_0xb282('0x11')]][_0xb282('0x22')]=_0xb282('0x55');agents[_0x88dfa6[_0xb282('0x11')]][_0xb282('0x16')]=_0xb282('0x55');}utils['info'](util[_0xb282('0x19')](_0xb282('0x56'),_0x88dfa6[_0xb282('0x11')],agents[_0x88dfa6[_0xb282('0x11')]][_0xb282('0x6')],agents[_0x88dfa6['uniqueid']]['reason'],agents[_0x88dfa6[_0xb282('0x11')]][_0xb282('0x16')]));writeDB(agents[_0x88dfa6[_0xb282('0x11')]]);var _0x449adc=unanswered[_0xb282('0x57')](_0x88dfa6[_0xb282('0x11')]);if(_0x449adc>-0x1){unanswered[_0xb282('0x58')](_0x449adc,0x1);}}if(transfers[_0x88dfa6['uniqueid']]){transfers[_0x88dfa6['uniqueid']][_0xb282('0x34')]=!![];transfers[_0x88dfa6[_0xb282('0x11')]]['agentcompleteAt']=utils['now']();transfers[_0x88dfa6[_0xb282('0x11')]][_0xb282('0x25')]=utils[_0xb282('0x37')](transfers[_0x88dfa6[_0xb282('0x11')]][_0xb282('0x36')],transfers[_0x88dfa6[_0xb282('0x11')]][_0xb282('0x38')]);transfers[_0x88dfa6['uniqueid']][_0xb282('0x22')]=_0xb282('0x59');transfers[_0x88dfa6[_0xb282('0x11')]][_0xb282('0x16')]=_0xb282('0x5a');utils[_0xb282('0x18')](util[_0xb282('0x19')](_0xb282('0x56'),_0x88dfa6[_0xb282('0x11')],transfers[_0x88dfa6[_0xb282('0x11')]]['membername'],transfers[_0x88dfa6[_0xb282('0x11')]][_0xb282('0x22')],transfers[_0x88dfa6[_0xb282('0x11')]][_0xb282('0x16')]));writeDB(transfers[_0x88dfa6[_0xb282('0x11')]],!![]);}if(agents[_0x88dfa6[_0xb282('0x11')]]&&agents[_0x88dfa6[_0xb282('0x11')]][_0xb282('0x38')]){agents[_0x88dfa6['uniqueid']][_0xb282('0x34')]=!![];agents[_0x88dfa6[_0xb282('0x11')]][_0xb282('0x36')]=utils[_0xb282('0x20')]();agents[_0x88dfa6[_0xb282('0x11')]][_0xb282('0x25')]=utils['diffTime'](agents[_0x88dfa6[_0xb282('0x11')]][_0xb282('0x36')],agents[_0x88dfa6[_0xb282('0x11')]]['agentconnectAt']);agents[_0x88dfa6[_0xb282('0x11')]][_0xb282('0x22')]=agents[_0x88dfa6['uniqueid']][_0xb282('0x3d')]?_0xb282('0x3d'):_0xb282('0x59');agents[_0x88dfa6[_0xb282('0x11')]][_0xb282('0x16')]=_0xb282('0x5a');utils[_0xb282('0x18')](util['format']('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x88dfa6[_0xb282('0x11')],agents[_0x88dfa6['uniqueid']][_0xb282('0x6')],agents[_0x88dfa6[_0xb282('0x11')]][_0xb282('0x22')],agents[_0x88dfa6[_0xb282('0x11')]][_0xb282('0x16')]));writeDB(agents[_0x88dfa6['uniqueid']]);}}catch(_0xa1f33c){utils[_0xb282('0x1b')](util[_0xb282('0x19')]('[%s][agents][hangup]',_0x88dfa6[_0xb282('0x11')]),_0xa1f33c);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 25732b7..3405835 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 _0x29b6=['[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','musiconholdstartAt','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','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','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','startsWith','toLowerCase','cdr','lastIndexOf','includes','hangup','noop','execif','gotoif','lastdata','lodash','./utils','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','uniqueid','transfereeuniqueid','info','channel','queue','interface','connectedlinenum','lastevent','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','blinds','newchannel','format','linkedid','OutgoingSpoolFailed','context','exten','now','error','[%s][calls][newchannel]','newstate','[%s][calls][newstate]','isNil','systemanswertime','channelstate','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','disposition','toNumber','debug','[%s][calls][hangup]','callerid','calleridname','cause-txt','endtime','diffTime','billableseconds','answertime','localtwolinkedid','[%s][calls][attendedtransfer]','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfereruniqueid','secondtransfererchannel','userfield','_attended','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]'];(function(_0x92354d,_0xcbd1ac){var _0x57f449=function(_0x19658f){while(--_0x19658f){_0x92354d['push'](_0x92354d['shift']());}};_0x57f449(++_0xcbd1ac);}(_0x29b6,0x9c));var _0x629b=function(_0x2e0d27,_0xd23596){_0x2e0d27=_0x2e0d27-0x0;var _0x570a63=_0x29b6[_0x2e0d27];return _0x570a63;};'use strict';var _=require(_0x629b('0x0'));var util=require('util');var utils=require(_0x629b('0x1'));var transfers=require(_0x629b('0x2'));var dispositions=[_0x629b('0x3'),_0x629b('0x4'),_0x629b('0x4'),_0x629b('0x3'),'NO\x20ANSWER',_0x629b('0x3'),_0x629b('0x5'),'BUSY',_0x629b('0x4'),'FAILED',_0x629b('0x4')];var channels={};function writeDB(_0x46c3f6){var _0x2b2c3b;if(transfers['blinds'][_0x46c3f6['uniqueid']]){_0x2b2c3b=_0x46c3f6[_0x629b('0x6')];_0x46c3f6[_0x629b('0x6')]=transfers['blinds'][_0x46c3f6[_0x629b('0x6')]][_0x629b('0x7')];}utils[_0x629b('0x8')](util['format']('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x46c3f6[_0x629b('0x6')],_0x46c3f6[_0x629b('0x9')],_0x46c3f6[_0x629b('0xa')],_0x46c3f6['membername'],_0x46c3f6[_0x629b('0xb')],_0x46c3f6['calleridnum'],_0x46c3f6[_0x629b('0xc')],_0x46c3f6[_0x629b('0xd')]));if(_0x46c3f6[_0x629b('0xe')]){utils[_0x629b('0xf')](_0x46c3f6[_0x629b('0xe')])[_0x629b('0x10')](function(_0x15e82c){if(_0x15e82c){_0x46c3f6[_0x629b('0x11')]=_0x15e82c['id'];}utils[_0x629b('0x12')](_0x629b('0x13'),_0x46c3f6);});}else{utils[_0x629b('0x12')](_0x629b('0x13'),_0x46c3f6);}if(channels[_0x46c3f6['uniqueid']]){delete channels[_0x46c3f6[_0x629b('0x6')]];}else if(_0x2b2c3b&&channels[_0x2b2c3b]){delete transfers[_0x629b('0x14')][_0x2b2c3b];delete channels[_0x2b2c3b];}}exports[_0x629b('0x15')]=function(_0x45dadf){try{utils['debug'](util[_0x629b('0x16')]('[%s][calls][newchannel]',_0x45dadf['uniqueid']),_0x45dadf);if(_0x45dadf[_0x629b('0x6')]==_0x45dadf[_0x629b('0x17')]&&_0x45dadf[_0x629b('0x9')]!=_0x629b('0x18')){utils[_0x629b('0x8')](util['format']('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x45dadf['uniqueid'],_0x45dadf[_0x629b('0x19')],_0x45dadf[_0x629b('0x1a')]));channels[_0x45dadf[_0x629b('0x6')]]={'uniqueid':_0x45dadf[_0x629b('0x6')],'accountcode':_0x45dadf[_0x629b('0xe')],'source':_0x45dadf['calleridnum'],'destination':_0x45dadf[_0x629b('0x1a')],'destinationcontext':_0x45dadf[_0x629b('0x19')],'channel':_0x45dadf['channel'],'starttime':utils[_0x629b('0x1b')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x629b('0x3'),'amaflags':'DOCUMENTATION'};}}catch(_0x15700e){utils[_0x629b('0x1c')](util[_0x629b('0x16')](_0x629b('0x1d'),_0x45dadf['uniqueid']),_0x15700e);}};exports[_0x629b('0x1e')]=function(_0x2d61cc){try{utils['debug'](util[_0x629b('0x16')](_0x629b('0x1f'),_0x2d61cc[_0x629b('0x6')]),_0x2d61cc);if(!_[_0x629b('0x20')](channels[_0x2d61cc[_0x629b('0x6')]])&&_0x2d61cc['channelstate']==0x6){utils[_0x629b('0x8')](util['format']('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x2d61cc[_0x629b('0x6')],_0x2d61cc['context'],_0x2d61cc[_0x629b('0x9')]));if(_[_0x629b('0x20')](channels[_0x2d61cc[_0x629b('0x6')]]['systemanswertime'])){channels[_0x2d61cc[_0x629b('0x6')]][_0x629b('0x21')]=utils[_0x629b('0x1b')]();}}else if(!_[_0x629b('0x20')](channels[_0x2d61cc['linkedid']])&&_0x2d61cc[_0x629b('0x22')]==0x6&&_0x2d61cc['context']!=_0x629b('0x23')){utils[_0x629b('0x8')](util[_0x629b('0x16')](_0x629b('0x24'),_0x2d61cc[_0x629b('0x6')],_0x2d61cc[_0x629b('0x17')],_0x2d61cc[_0x629b('0x19')],_0x2d61cc['channel']));channels[_0x2d61cc[_0x629b('0x17')]][_0x629b('0xe')]=_0x2d61cc[_0x629b('0xe')];channels[_0x2d61cc[_0x629b('0x17')]][_0x629b('0x25')]=_0x2d61cc[_0x629b('0x9')];if(_['isNil'](channels[_0x2d61cc[_0x629b('0x17')]]['answertime'])){channels[_0x2d61cc[_0x629b('0x17')]]['answertime']=utils[_0x629b('0x1b')]();}channels[_0x2d61cc[_0x629b('0x17')]][_0x629b('0x26')]=dispositions[_[_0x629b('0x27')](_0x2d61cc[_0x629b('0x22')])]||_0x629b('0x5');}}catch(_0x5df1ee){utils[_0x629b('0x1c')](util[_0x629b('0x16')](_0x629b('0x1f'),_0x2d61cc[_0x629b('0x6')]),_0x5df1ee);}};exports['hangup']=function(_0x150f48){try{if(!_['isNil'](channels[_0x150f48[_0x629b('0x6')]])){utils[_0x629b('0x28')](util[_0x629b('0x16')](_0x629b('0x29'),_0x150f48['uniqueid']),_0x150f48);if(_[_0x629b('0x20')](channels[_0x150f48[_0x629b('0x6')]][_0x629b('0x2a')])){channels[_0x150f48['uniqueid']][_0x629b('0x2a')]=_0x150f48[_0x629b('0x2b')]+'\x20<'+_0x150f48['calleridnum']+'>';}utils['info'](util[_0x629b('0x16')]('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x150f48[_0x629b('0x6')],channels[_0x150f48['uniqueid']]['callerid'],_0x150f48[_0x629b('0x2c')]));channels[_0x150f48[_0x629b('0x6')]][_0x629b('0x2d')]=utils[_0x629b('0x1b')]();channels[_0x150f48[_0x629b('0x6')]]['duration']=utils[_0x629b('0x2e')](channels[_0x150f48[_0x629b('0x6')]][_0x629b('0x2d')],channels[_0x150f48[_0x629b('0x6')]]['starttime']);channels[_0x150f48[_0x629b('0x6')]][_0x629b('0x2f')]=channels[_0x150f48['uniqueid']][_0x629b('0x30')]?utils[_0x629b('0x2e')](channels[_0x150f48['uniqueid']][_0x629b('0x2d')],channels[_0x150f48['uniqueid']][_0x629b('0x30')]):0x0;writeDB(channels[_0x150f48[_0x629b('0x6')]]);}}catch(_0x2b40c3){utils[_0x629b('0x1c')](util[_0x629b('0x16')]('[%s][calls][hangup]',_0x150f48[_0x629b('0x6')]),_0x2b40c3);}};exports['attendedtransfer']=function(_0x484162){try{if(!_[_0x629b('0x20')](channels[_0x484162[_0x629b('0x31')]])){utils[_0x629b('0x28')](util['format'](_0x629b('0x32'),_0x484162['origtransfereruniqueid']),_0x484162);if(channels[_0x484162['localtwolinkedid']][_0x629b('0x9')]==_0x484162[_0x629b('0x33')]){utils[_0x629b('0x8')](util[_0x629b('0x16')](_0x629b('0x34'),_0x484162[_0x629b('0x35')],_0x484162['localtwolinkedid'],_0x484162[_0x629b('0x36')]));channels[_0x484162['localtwolinkedid']][_0x629b('0x25')]=_0x484162[_0x629b('0x36')];channels[_0x484162['localtwolinkedid']][_0x629b('0x37')]=_0x629b('0x38');}else if(channels[_0x484162[_0x629b('0x31')]][_0x629b('0x9')]=_0x484162['transfertargetchannel']){utils['info'](util['format']('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x484162[_0x629b('0x35')],_0x484162[_0x629b('0x31')],_0x484162[_0x629b('0x39')]));channels[_0x484162[_0x629b('0x31')]][_0x629b('0x25')]=_0x484162['origtransfererchannel'];channels[_0x484162['localtwolinkedid']]['userfield']='_attended';}}}catch(_0x102df3){utils[_0x629b('0x1c')](util[_0x629b('0x16')](_0x629b('0x32'),_0x484162[_0x629b('0x35')]),_0x102df3);}};exports[_0x629b('0x3a')]=function(_0x19a4ed){try{if(!_[_0x629b('0x20')](channels[_0x19a4ed[_0x629b('0x6')]])){utils[_0x629b('0x28')](util[_0x629b('0x16')](_0x629b('0x3b'),_0x19a4ed['uniqueid']),_0x19a4ed);channels[_0x19a4ed[_0x629b('0x6')]]['musiconholdstartAt']=utils[_0x629b('0x1b')]();utils['info'](util[_0x629b('0x16')](_0x629b('0x3c'),_0x19a4ed[_0x629b('0x6')],channels[_0x19a4ed[_0x629b('0x6')]]['musiconholdstartAt']));}}catch(_0xeb2b98){utils['error'](util[_0x629b('0x16')](_0x629b('0x3b'),_0x19a4ed[_0x629b('0x6')]),_0xeb2b98);}};exports[_0x629b('0x3d')]=function(_0x4bd22d){try{if(!_[_0x629b('0x20')](channels[_0x4bd22d['uniqueid']])){utils[_0x629b('0x28')](util['format'](_0x629b('0x3e'),_0x4bd22d['uniqueid']),_0x4bd22d);if(!_[_0x629b('0x20')](channels[_0x4bd22d['uniqueid']][_0x629b('0x3f')])){channels[_0x4bd22d[_0x629b('0x6')]][_0x629b('0x40')]+=utils['diffTime'](utils[_0x629b('0x1b')](),channels[_0x4bd22d[_0x629b('0x6')]][_0x629b('0x3f')]);utils[_0x629b('0x8')](util[_0x629b('0x16')](_0x629b('0x41'),_0x4bd22d[_0x629b('0x6')],channels[_0x4bd22d[_0x629b('0x6')]][_0x629b('0x40')]));delete channels[_0x4bd22d[_0x629b('0x6')]][_0x629b('0x3f')];}}}catch(_0x396693){utils[_0x629b('0x1c')](util[_0x629b('0x16')](_0x629b('0x3e'),_0x4bd22d['uniqueid']),_0x396693);}};exports[_0x629b('0x42')]=function(_0xc561c3){try{if(!_[_0x629b('0x20')](channels[_0xc561c3['uniqueid']])){utils[_0x629b('0x28')](util[_0x629b('0x16')](_0x629b('0x43'),_0xc561c3[_0x629b('0x6')]),_0xc561c3);if(!_[_0x629b('0x20')](_0xc561c3[_0x629b('0x44')][_0x629b('0x45')])){utils[_0x629b('0x8')](util['format'](_0x629b('0x46'),_0xc561c3[_0x629b('0x6')],_0xc561c3[_0x629b('0x47')]));channels[_0xc561c3[_0x629b('0x6')]][_0x629b('0x48')]=_0xc561c3[_0x629b('0x47')];}if(!_[_0x629b('0x20')](_0xc561c3['variable'][_0x629b('0x49')])){utils['info'](util[_0x629b('0x16')](_0x629b('0x4a'),_0xc561c3['uniqueid'],_0xc561c3[_0x629b('0x47')]));channels[_0xc561c3[_0x629b('0x6')]][_0x629b('0x4b')]=_0xc561c3[_0x629b('0x47')];channels[_0xc561c3[_0x629b('0x6')]]['callerid']='\x22'+_0xc561c3['value']+_0x629b('0x4c')+_0xc561c3[_0x629b('0x47')]+'>';}if(!_[_0x629b('0x20')](_0xc561c3[_0x629b('0x44')][_0x629b('0x4d')])||!_['isNil'](_0xc561c3[_0x629b('0x44')][_0x629b('0x4e')])){utils[_0x629b('0x8')](util[_0x629b('0x16')](_0x629b('0x4f'),_0xc561c3['uniqueid'],!_['isNil'](_0xc561c3[_0x629b('0x44')][_0x629b('0x4d')])?_0x629b('0x4d'):'xmd-callerid',_0xc561c3[_0x629b('0x47')]));channels[_0xc561c3[_0x629b('0x6')]][_0x629b('0x2a')]=_0xc561c3[_0x629b('0x47')];}if(!_[_0x629b('0x20')](_0xc561c3[_0x629b('0x44')][_0x629b('0x50')])||!_[_0x629b('0x20')](_0xc561c3[_0x629b('0x44')]['xmcs-queue'])){utils[_0x629b('0x8')](util[_0x629b('0x16')](_0x629b('0x4f'),_0xc561c3[_0x629b('0x6')],!_[_0x629b('0x20')](_0xc561c3[_0x629b('0x44')][_0x629b('0x50')])?_0x629b('0x50'):_0x629b('0x51'),_0xc561c3[_0x629b('0x47')]));channels[_0xc561c3[_0x629b('0x6')]][_0x629b('0x52')]='Queue';channels[_0xc561c3[_0x629b('0x6')]]['lastdata']=_0xc561c3['value'];channels[_0xc561c3[_0x629b('0x6')]]['queue']=!![];}if(!_[_0x629b('0x20')](_0xc561c3[_0x629b('0x44')][_0x629b('0x53')])){utils[_0x629b('0x8')](util['format'](_0x629b('0x54'),_0xc561c3[_0x629b('0x6')],_0xc561c3[_0x629b('0x47')]));channels[_0xc561c3[_0x629b('0x6')]][_0x629b('0x55')]=_0xc561c3[_0x629b('0x47')];}if(!_[_0x629b('0x20')](_0xc561c3[_0x629b('0x44')]['xmd-cdrtype'])){utils[_0x629b('0x8')](util[_0x629b('0x16')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0xc561c3['uniqueid'],_0xc561c3['value']));channels[_0xc561c3[_0x629b('0x6')]][_0x629b('0x56')]=_0xc561c3['value'];}if(!_[_0x629b('0x20')](_0xc561c3['variable'][_0x629b('0x57')])){utils['info'](util[_0x629b('0x16')](_0x629b('0x58'),_0xc561c3[_0x629b('0x6')],_0xc561c3[_0x629b('0x47')]));channels[_0xc561c3['uniqueid']][_0x629b('0x59')]=_0xc561c3[_0x629b('0x47')];}if(!_['isNil'](_0xc561c3[_0x629b('0x44')][_0x629b('0x5a')])){utils['info'](util['format'](_0x629b('0x5b'),_0xc561c3[_0x629b('0x6')],_0xc561c3[_0x629b('0x47')]));channels[_0xc561c3['uniqueid']][_0x629b('0x5a')]=_0xc561c3[_0x629b('0x47')];}}}catch(_0x5c8f8c){utils['error'](util[_0x629b('0x16')](_0x629b('0x43'),_0xc561c3['uniqueid']),_0x5c8f8c);}};exports[_0x629b('0x5c')]=function(_0x22df3d){try{if(!_[_0x629b('0x20')](channels[_0x22df3d['uniqueid']])){utils[_0x629b('0x28')](util[_0x629b('0x16')](_0x629b('0x5d'),_0x22df3d[_0x629b('0x6')]),_0x22df3d);utils[_0x629b('0x8')](util[_0x629b('0x16')](_0x629b('0x5e'),_0x22df3d[_0x629b('0x6')],_0x22df3d[_0x629b('0x5f')],_0x22df3d[_0x629b('0x60')]));if(_0x22df3d[_0x629b('0x5f')]['toLowerCase']()==_0x629b('0x61')&&_[_0x629b('0x62')](_0x22df3d[_0x629b('0x60')][_0x629b('0x63')](),_0x629b('0x64'))){var _0x3b36a4=_0x22df3d[_0x629b('0x60')]['split']('=');var _0x2e55ce=_0x3b36a4[0x0]['substring'](_0x3b36a4[0x0][_0x629b('0x65')]('(')+0x1,_0x3b36a4[0x0][_0x629b('0x65')](')'));var _0x41bcd6=_0x3b36a4[0x1];channels[_0x22df3d[_0x629b('0x6')]][_0x2e55ce]=_0x41bcd6;}if(!_[_0x629b('0x66')]([_0x629b('0x67'),_0x629b('0x68'),_0x629b('0x69'),_0x629b('0x61'),_0x629b('0x6a')],_0x22df3d[_0x629b('0x5f')][_0x629b('0x63')]())){channels[_0x22df3d[_0x629b('0x6')]][_0x629b('0x52')]=_0x22df3d['application'];channels[_0x22df3d[_0x629b('0x6')]][_0x629b('0x6b')]=_0x22df3d[_0x629b('0x60')];}}}catch(_0xe1f970){utils['error'](util['format'](_0x629b('0x5d'),_0x22df3d[_0x629b('0x6')]),_0xe1f970);}}; \ No newline at end of file +var _0x697c=['lastapplication','Queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','sipcallid','newexten','[%s][calls][newexten]\x20application:%s\x20appdata:%s','appdata','toLowerCase','startsWith','cdr','split','substring','lastIndexOf','includes','noop','set','gotoif','util','./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','queue','membername','interface','calleridnum','connectedlinenum','lastevent','accountcode','then','UserId','request','debug','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','info','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','error','[%s][calls][newstate]','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','isNil','systemanswertime','destinationchannel','answertime','disposition','ANSWERED','hangup','[%s][calls][hangup]','callerid','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','endtime','diffTime','starttime','billableseconds','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','[%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','varset','[%s][calls][varset]','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','variable','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'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x697c,0x1c2));var _0xc697=function(_0x5c7416,_0x119690){_0x5c7416=_0x5c7416-0x0;var _0x49d6d8=_0x697c[_0x5c7416];return _0x49d6d8;};'use strict';var _=require('lodash');var util=require(_0xc697('0x0'));var utils=require('./utils');var transfers=require(_0xc697('0x1'));var dispositions=[_0xc697('0x2'),_0xc697('0x3'),_0xc697('0x3'),_0xc697('0x2'),_0xc697('0x2'),'NO\x20ANSWER','ANSWERED',_0xc697('0x4'),_0xc697('0x3'),_0xc697('0x3'),_0xc697('0x3')];var channels={};function writeDB(_0x597853){var _0x52f825;if(transfers[_0xc697('0x5')][_0x597853[_0xc697('0x6')]]){_0x52f825=_0x597853[_0xc697('0x6')];_0x597853[_0xc697('0x6')]=transfers[_0xc697('0x5')][_0x597853[_0xc697('0x6')]][_0xc697('0x7')];}utils['info'](util[_0xc697('0x8')](_0xc697('0x9'),_0x597853[_0xc697('0x6')],_0x597853[_0xc697('0xa')],_0x597853[_0xc697('0xb')],_0x597853[_0xc697('0xc')],_0x597853[_0xc697('0xd')],_0x597853[_0xc697('0xe')],_0x597853[_0xc697('0xf')],_0x597853[_0xc697('0x10')]));if(_0x597853[_0xc697('0x11')]){utils['getUserByInternal'](_0x597853[_0xc697('0x11')])[_0xc697('0x12')](function(_0x50aee2){if(_0x50aee2){_0x597853[_0xc697('0x13')]=_0x50aee2['id'];}utils[_0xc697('0x14')]('CreateVoiceCallReport',_0x597853);});}else{utils[_0xc697('0x14')]('CreateVoiceCallReport',_0x597853);}if(channels[_0x597853[_0xc697('0x6')]]){delete channels[_0x597853[_0xc697('0x6')]];}else if(_0x52f825&&channels[_0x52f825]){delete transfers[_0xc697('0x5')][_0x52f825];delete channels[_0x52f825];}}exports['newchannel']=function(_0x44f4b3){try{utils[_0xc697('0x15')](util[_0xc697('0x8')](_0xc697('0x16'),_0x44f4b3['uniqueid']),_0x44f4b3);if(_0x44f4b3[_0xc697('0x6')]==_0x44f4b3[_0xc697('0x17')]&&_0x44f4b3[_0xc697('0xa')]!=_0xc697('0x18')){utils[_0xc697('0x19')](util[_0xc697('0x8')](_0xc697('0x1a'),_0x44f4b3[_0xc697('0x6')],_0x44f4b3[_0xc697('0x1b')],_0x44f4b3[_0xc697('0x1c')]));channels[_0x44f4b3['uniqueid']]={'uniqueid':_0x44f4b3[_0xc697('0x6')],'accountcode':_0x44f4b3[_0xc697('0x11')],'source':_0x44f4b3['calleridnum'],'destination':_0x44f4b3['exten'],'destinationcontext':_0x44f4b3[_0xc697('0x1b')],'channel':_0x44f4b3['channel'],'starttime':utils[_0xc697('0x1d')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':'DOCUMENTATION'};}}catch(_0x389598){utils[_0xc697('0x1e')](util[_0xc697('0x8')]('[%s][calls][newchannel]',_0x44f4b3[_0xc697('0x6')]),_0x389598);}};exports['newstate']=function(_0x4e131c){try{utils[_0xc697('0x15')](util[_0xc697('0x8')](_0xc697('0x1f'),_0x4e131c[_0xc697('0x6')]),_0x4e131c);if(!_['isNil'](channels[_0x4e131c['uniqueid']])&&_0x4e131c[_0xc697('0x20')]==0x6){utils[_0xc697('0x19')](util[_0xc697('0x8')](_0xc697('0x21'),_0x4e131c['uniqueid'],_0x4e131c[_0xc697('0x1b')],_0x4e131c[_0xc697('0xa')]));if(_[_0xc697('0x22')](channels[_0x4e131c[_0xc697('0x6')]][_0xc697('0x23')])){channels[_0x4e131c[_0xc697('0x6')]][_0xc697('0x23')]=utils[_0xc697('0x1d')]();}}else if(!_[_0xc697('0x22')](channels[_0x4e131c[_0xc697('0x17')]])&&_0x4e131c['channelstate']==0x6&&_0x4e131c[_0xc697('0x1b')]!='transfer'){utils[_0xc697('0x19')](util[_0xc697('0x8')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x4e131c[_0xc697('0x6')],_0x4e131c[_0xc697('0x17')],_0x4e131c[_0xc697('0x1b')],_0x4e131c[_0xc697('0xa')]));channels[_0x4e131c[_0xc697('0x17')]][_0xc697('0x11')]=_0x4e131c[_0xc697('0x11')];channels[_0x4e131c[_0xc697('0x17')]][_0xc697('0x24')]=_0x4e131c[_0xc697('0xa')];if(_[_0xc697('0x22')](channels[_0x4e131c[_0xc697('0x17')]]['answertime'])){channels[_0x4e131c['linkedid']][_0xc697('0x25')]=utils['now']();}channels[_0x4e131c[_0xc697('0x17')]][_0xc697('0x26')]=dispositions[_['toNumber'](_0x4e131c[_0xc697('0x20')])]||_0xc697('0x27');}}catch(_0x23c4d4){utils[_0xc697('0x1e')](util[_0xc697('0x8')]('[%s][calls][newstate]',_0x4e131c[_0xc697('0x6')]),_0x23c4d4);}};exports[_0xc697('0x28')]=function(_0x4f2e35){try{if(!_[_0xc697('0x22')](channels[_0x4f2e35['uniqueid']])){utils['debug'](util[_0xc697('0x8')](_0xc697('0x29'),_0x4f2e35[_0xc697('0x6')]),_0x4f2e35);if(_[_0xc697('0x22')](channels[_0x4f2e35[_0xc697('0x6')]][_0xc697('0x2a')])){channels[_0x4f2e35[_0xc697('0x6')]]['callerid']=_0x4f2e35['calleridname']+'\x20<'+_0x4f2e35[_0xc697('0xe')]+'>';}utils[_0xc697('0x19')](util[_0xc697('0x8')](_0xc697('0x2b'),_0x4f2e35['uniqueid'],channels[_0x4f2e35[_0xc697('0x6')]][_0xc697('0x2a')],_0x4f2e35['cause-txt']));channels[_0x4f2e35['uniqueid']][_0xc697('0x2c')]=utils[_0xc697('0x1d')]();channels[_0x4f2e35['uniqueid']]['duration']=utils[_0xc697('0x2d')](channels[_0x4f2e35['uniqueid']][_0xc697('0x2c')],channels[_0x4f2e35[_0xc697('0x6')]][_0xc697('0x2e')]);channels[_0x4f2e35[_0xc697('0x6')]][_0xc697('0x2f')]=channels[_0x4f2e35[_0xc697('0x6')]][_0xc697('0x25')]?utils[_0xc697('0x2d')](channels[_0x4f2e35[_0xc697('0x6')]][_0xc697('0x2c')],channels[_0x4f2e35['uniqueid']][_0xc697('0x25')]):0x0;writeDB(channels[_0x4f2e35[_0xc697('0x6')]]);}}catch(_0x518e6c){utils[_0xc697('0x1e')](util[_0xc697('0x8')](_0xc697('0x29'),_0x4f2e35['uniqueid']),_0x518e6c);}};exports['attendedtransfer']=function(_0x4e9637){try{if(!_[_0xc697('0x22')](channels[_0x4e9637[_0xc697('0x30')]])){utils['debug'](util[_0xc697('0x8')](_0xc697('0x31'),_0x4e9637[_0xc697('0x32')]),_0x4e9637);if(channels[_0x4e9637[_0xc697('0x30')]][_0xc697('0xa')]==_0x4e9637['transfereechannel']){utils[_0xc697('0x19')](util[_0xc697('0x8')](_0xc697('0x33'),_0x4e9637[_0xc697('0x32')],_0x4e9637[_0xc697('0x30')],_0x4e9637['secondtransfererchannel']));channels[_0x4e9637[_0xc697('0x30')]][_0xc697('0x24')]=_0x4e9637[_0xc697('0x34')];channels[_0x4e9637[_0xc697('0x30')]][_0xc697('0x35')]=_0xc697('0x36');}else if(channels[_0x4e9637['localtwolinkedid']][_0xc697('0xa')]=_0x4e9637[_0xc697('0x37')]){utils['info'](util[_0xc697('0x8')](_0xc697('0x33'),_0x4e9637['origtransfereruniqueid'],_0x4e9637[_0xc697('0x30')],_0x4e9637[_0xc697('0x38')]));channels[_0x4e9637[_0xc697('0x30')]][_0xc697('0x24')]=_0x4e9637['origtransfererchannel'];channels[_0x4e9637[_0xc697('0x30')]][_0xc697('0x35')]='_attended';}}}catch(_0x3ca684){utils[_0xc697('0x1e')](util[_0xc697('0x8')](_0xc697('0x31'),_0x4e9637[_0xc697('0x32')]),_0x3ca684);}};exports[_0xc697('0x39')]=function(_0x1a35dd){try{if(!_[_0xc697('0x22')](channels[_0x1a35dd[_0xc697('0x6')]])){utils['debug'](util[_0xc697('0x8')](_0xc697('0x3a'),_0x1a35dd[_0xc697('0x6')]),_0x1a35dd);channels[_0x1a35dd[_0xc697('0x6')]][_0xc697('0x3b')]=utils[_0xc697('0x1d')]();utils[_0xc697('0x19')](util[_0xc697('0x8')](_0xc697('0x3c'),_0x1a35dd[_0xc697('0x6')],channels[_0x1a35dd[_0xc697('0x6')]][_0xc697('0x3b')]));}}catch(_0x4196b4){utils['error'](util['format']('[%s][calls][musiconholdstart]',_0x1a35dd[_0xc697('0x6')]),_0x4196b4);}};exports[_0xc697('0x3d')]=function(_0xb0cfbc){try{if(!_[_0xc697('0x22')](channels[_0xb0cfbc['uniqueid']])){utils['debug'](util[_0xc697('0x8')](_0xc697('0x3e'),_0xb0cfbc[_0xc697('0x6')]),_0xb0cfbc);if(!_[_0xc697('0x22')](channels[_0xb0cfbc[_0xc697('0x6')]][_0xc697('0x3b')])){channels[_0xb0cfbc['uniqueid']][_0xc697('0x3f')]+=utils[_0xc697('0x2d')](utils['now'](),channels[_0xb0cfbc['uniqueid']][_0xc697('0x3b')]);utils['info'](util[_0xc697('0x8')]('[%s][calls][musiconholdstop]\x20mohtime:%s',_0xb0cfbc[_0xc697('0x6')],channels[_0xb0cfbc[_0xc697('0x6')]]['mohtime']));delete channels[_0xb0cfbc[_0xc697('0x6')]][_0xc697('0x3b')];}}}catch(_0xf7428c){utils[_0xc697('0x1e')](util[_0xc697('0x8')](_0xc697('0x3e'),_0xb0cfbc[_0xc697('0x6')]),_0xf7428c);}};exports[_0xc697('0x40')]=function(_0x58ce1f){try{if(!_[_0xc697('0x22')](channels[_0x58ce1f[_0xc697('0x6')]])){utils[_0xc697('0x15')](util[_0xc697('0x8')](_0xc697('0x41'),_0x58ce1f['uniqueid']),_0x58ce1f);if(!_['isNil'](_0x58ce1f['variable'][_0xc697('0x42')])){utils[_0xc697('0x19')](util[_0xc697('0x8')](_0xc697('0x43'),_0x58ce1f[_0xc697('0x6')],_0x58ce1f[_0xc697('0x44')]));channels[_0x58ce1f[_0xc697('0x6')]][_0xc697('0x45')]=_0x58ce1f[_0xc697('0x44')];}if(!_['isNil'](_0x58ce1f[_0xc697('0x46')][_0xc697('0x47')])){utils[_0xc697('0x19')](util['format'](_0xc697('0x48'),_0x58ce1f[_0xc697('0x6')],_0x58ce1f[_0xc697('0x44')]));channels[_0x58ce1f[_0xc697('0x6')]][_0xc697('0x49')]=_0x58ce1f[_0xc697('0x44')];channels[_0x58ce1f['uniqueid']][_0xc697('0x2a')]='\x22'+_0x58ce1f[_0xc697('0x44')]+_0xc697('0x4a')+_0x58ce1f[_0xc697('0x44')]+'>';}if(!_['isNil'](_0x58ce1f[_0xc697('0x46')][_0xc697('0x4b')])||!_['isNil'](_0x58ce1f[_0xc697('0x46')][_0xc697('0x4c')])){utils[_0xc697('0x19')](util[_0xc697('0x8')](_0xc697('0x4d'),_0x58ce1f['uniqueid'],!_[_0xc697('0x22')](_0x58ce1f[_0xc697('0x46')][_0xc697('0x4b')])?_0xc697('0x4b'):_0xc697('0x4c'),_0x58ce1f[_0xc697('0x44')]));channels[_0x58ce1f['uniqueid']][_0xc697('0x2a')]=_0x58ce1f[_0xc697('0x44')];}if(!_[_0xc697('0x22')](_0x58ce1f[_0xc697('0x46')][_0xc697('0x4e')])||!_[_0xc697('0x22')](_0x58ce1f[_0xc697('0x46')][_0xc697('0x4f')])){utils[_0xc697('0x19')](util[_0xc697('0x8')](_0xc697('0x4d'),_0x58ce1f[_0xc697('0x6')],!_[_0xc697('0x22')](_0x58ce1f[_0xc697('0x46')][_0xc697('0x4e')])?_0xc697('0x4e'):_0xc697('0x4f'),_0x58ce1f['value']));channels[_0x58ce1f[_0xc697('0x6')]][_0xc697('0x50')]=_0xc697('0x51');channels[_0x58ce1f[_0xc697('0x6')]][_0xc697('0x52')]=_0x58ce1f[_0xc697('0x44')];channels[_0x58ce1f['uniqueid']]['queue']=!![];}if(!_[_0xc697('0x22')](_0x58ce1f['variable'][_0xc697('0x53')])){utils[_0xc697('0x19')](util[_0xc697('0x8')](_0xc697('0x54'),_0x58ce1f['uniqueid'],_0x58ce1f['value']));channels[_0x58ce1f[_0xc697('0x6')]][_0xc697('0x55')]=_0x58ce1f['value'];}if(!_[_0xc697('0x22')](_0x58ce1f[_0xc697('0x46')][_0xc697('0x56')])){utils[_0xc697('0x19')](util[_0xc697('0x8')](_0xc697('0x57'),_0x58ce1f[_0xc697('0x6')],_0x58ce1f[_0xc697('0x44')]));channels[_0x58ce1f['uniqueid']][_0xc697('0x58')]=_0x58ce1f[_0xc697('0x44')];}if(!_[_0xc697('0x22')](_0x58ce1f[_0xc697('0x46')][_0xc697('0x59')])){utils[_0xc697('0x19')](util[_0xc697('0x8')](_0xc697('0x5a'),_0x58ce1f[_0xc697('0x6')],_0x58ce1f['value']));channels[_0x58ce1f[_0xc697('0x6')]]['routeid']=_0x58ce1f[_0xc697('0x44')];}if(!_['isNil'](_0x58ce1f[_0xc697('0x46')]['sipcallid'])){utils[_0xc697('0x19')](util['format'](_0xc697('0x5b'),_0x58ce1f[_0xc697('0x6')],_0x58ce1f['value']));channels[_0x58ce1f[_0xc697('0x6')]][_0xc697('0x5c')]=_0x58ce1f[_0xc697('0x44')];}}}catch(_0x2afc71){utils['error'](util[_0xc697('0x8')](_0xc697('0x41'),_0x58ce1f[_0xc697('0x6')]),_0x2afc71);}};exports[_0xc697('0x5d')]=function(_0x111b49){try{if(!_['isNil'](channels[_0x111b49['uniqueid']])){utils['debug'](util['format']('[%s][calls][newexten]',_0x111b49['uniqueid']),_0x111b49);utils[_0xc697('0x19')](util['format'](_0xc697('0x5e'),_0x111b49[_0xc697('0x6')],_0x111b49['application'],_0x111b49[_0xc697('0x5f')]));if(_0x111b49['application'][_0xc697('0x60')]()=='set'&&_[_0xc697('0x61')](_0x111b49[_0xc697('0x5f')][_0xc697('0x60')](),_0xc697('0x62'))){var _0x1a8ef5=_0x111b49[_0xc697('0x5f')][_0xc697('0x63')]('=');var _0x5f1a23=_0x1a8ef5[0x0][_0xc697('0x64')](_0x1a8ef5[0x0][_0xc697('0x65')]('(')+0x1,_0x1a8ef5[0x0][_0xc697('0x65')](')'));var _0x1e338c=_0x1a8ef5[0x1];channels[_0x111b49[_0xc697('0x6')]][_0x5f1a23]=_0x1e338c;}if(!_[_0xc697('0x66')]([_0xc697('0x28'),_0xc697('0x67'),'execif',_0xc697('0x68'),_0xc697('0x69')],_0x111b49['application'][_0xc697('0x60')]())){channels[_0x111b49[_0xc697('0x6')]][_0xc697('0x50')]=_0x111b49['application'];channels[_0x111b49['uniqueid']][_0xc697('0x52')]=_0x111b49['appdata'];}}}catch(_0x3801a6){utils[_0xc697('0x1e')](util[_0xc697('0x8')]('[%s][calls][newexten]',_0x111b49[_0xc697('0x6')]),_0x3801a6);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 50669d9..6ab63aa 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 _0xa597=['info','[core]\x20connected','[core]\x20shutdown','fullybooted','error','[core]\x20error','[core]\x20close','connect'];(function(_0x4603a2,_0x2a26ac){var _0x17dc98=function(_0x15cdf5){while(--_0x15cdf5){_0x4603a2['push'](_0x4603a2['shift']());}};_0x17dc98(++_0x2a26ac);}(_0xa597,0xb7));var _0x7a59=function(_0x20ea4e,_0xb93349){_0x20ea4e=_0x20ea4e-0x0;var _0x160cba=_0xa597[_0x20ea4e];return _0x160cba;};'use strict';var utils=require('./utils');exports[_0x7a59('0x0')]=function(){utils[_0x7a59('0x1')](_0x7a59('0x2'));};exports['shutdown']=function(){utils[_0x7a59('0x1')](_0x7a59('0x3'));};exports[_0x7a59('0x4')]=function(){utils['info']('[core]\x20fullybooted');};exports['error']=function(_0xac64bb){utils[_0x7a59('0x5')](_0x7a59('0x6'),_0xac64bb);};exports['close']=function(){utils[_0x7a59('0x1')](_0x7a59('0x7'));};exports['managerevent']=function(_0x573e15){}; \ No newline at end of file +var _0x8c03=['[core]\x20error','close','managerevent','connect','info','[core]\x20connected','shutdown','[core]\x20fullybooted','error'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8c03,0x6f));var _0x38c0=function(_0x8a6ac9,_0x558f27){_0x8a6ac9=_0x8a6ac9-0x0;var _0x2919cf=_0x8c03[_0x8a6ac9];return _0x2919cf;};'use strict';var utils=require('./utils');exports[_0x38c0('0x0')]=function(){utils[_0x38c0('0x1')](_0x38c0('0x2'));};exports[_0x38c0('0x3')]=function(){utils[_0x38c0('0x1')]('[core]\x20shutdown');};exports['fullybooted']=function(){utils[_0x38c0('0x1')](_0x38c0('0x4'));};exports['error']=function(_0x3e49f0){utils[_0x38c0('0x5')](_0x38c0('0x6'),_0x3e49f0);};exports[_0x38c0('0x7')]=function(){utils['info']('[core]\x20close');};exports[_0x38c0('0x8')]=function(_0x40af95){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index ae5da11..9a70c40 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 _0x3ad8=['[%s][dials][dialend]','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridnum','calleridname','cause-txt','complete','duration','endtime','holdtime','diffTime','lodash','./utils','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','channel','dialstring','connectedlinenum','dialstatus','request','CreateVoiceDialReport','uniqueid','debug','[%s][dials][newexten]','info','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','startsWith','toLowerCase','split','varset','[%s][dials][varset]','isNil','variable','outboundrouteid','value','dialbegin','[%s][dials][dialbegin]','assign','now','lastevent','called','starttime','error'];(function(_0x1d9571,_0x5c2153){var _0x18ec91=function(_0x3c11bb){while(--_0x3c11bb){_0x1d9571['push'](_0x1d9571['shift']());}};_0x18ec91(++_0x5c2153);}(_0x3ad8,0x76));var _0x83ad=function(_0x260cbc,_0x2fa83b){_0x260cbc=_0x260cbc-0x0;var _0xd11cc9=_0x3ad8[_0x260cbc];return _0xd11cc9;};'use strict';var _=require(_0x83ad('0x0'));var util=require('util');var utils=require(_0x83ad('0x1'));var dials={};function writeDB(_0x325023){utils['info'](util[_0x83ad('0x2')](_0x83ad('0x3'),_0x325023['uniqueid'],_0x325023[_0x83ad('0x4')],_0x325023[_0x83ad('0x5')],_0x325023['calleridnum'],_0x325023[_0x83ad('0x6')],_0x325023[_0x83ad('0x7')]));utils[_0x83ad('0x8')](_0x83ad('0x9'),_0x325023);delete dials[_0x325023[_0x83ad('0xa')]];}exports['newexten']=function(_0x2ca8c7){try{utils[_0x83ad('0xb')](util[_0x83ad('0x2')](_0x83ad('0xc'),_0x2ca8c7[_0x83ad('0xa')]),_0x2ca8c7);utils[_0x83ad('0xd')](util[_0x83ad('0x2')](_0x83ad('0xe'),_0x2ca8c7[_0x83ad('0xa')],_0x2ca8c7[_0x83ad('0xf')],_0x2ca8c7[_0x83ad('0x10')]));if(_0x2ca8c7[_0x83ad('0xf')]['toLowerCase']()==_0x83ad('0x11')&&_[_0x83ad('0x12')](_0x2ca8c7[_0x83ad('0x10')][_0x83ad('0x13')](),'cdr(routeid)')){var _0x56bea6=_0x2ca8c7['appdata'][_0x83ad('0x14')]('=');dials[_0x2ca8c7[_0x83ad('0xa')]]={'routeId':_0x56bea6[0x1]};}}catch(_0x4cdb29){utils['error'](util[_0x83ad('0x2')](_0x83ad('0xc'),_0x2ca8c7[_0x83ad('0xa')]),_0x4cdb29);}};exports[_0x83ad('0x15')]=function(_0x3df28c){try{utils[_0x83ad('0xb')](util[_0x83ad('0x2')](_0x83ad('0x16'),_0x3df28c[_0x83ad('0xa')]),_0x3df28c);if(!_[_0x83ad('0x17')](_0x3df28c[_0x83ad('0x18')][_0x83ad('0x19')])){utils[_0x83ad('0xd')](util[_0x83ad('0x2')]('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0x3df28c[_0x83ad('0xa')],_0x3df28c[_0x83ad('0x1a')]));dials[_0x3df28c['uniqueid']]={'routeId':_0x3df28c[_0x83ad('0x1a')]};}}catch(_0x268034){utils['error'](util['format'](_0x83ad('0x16'),_0x3df28c['uniqueid']),_0x268034);}};exports[_0x83ad('0x1b')]=function(_0x2f461d){try{if(!_[_0x83ad('0x17')](dials[_0x2f461d[_0x83ad('0xa')]])){utils[_0x83ad('0xb')](util[_0x83ad('0x2')](_0x83ad('0x1c'),_0x2f461d[_0x83ad('0xa')]),_0x2f461d);dials[_0x2f461d[_0x83ad('0xa')]]=_[_0x83ad('0x1d')](dials[_0x2f461d[_0x83ad('0xa')]],_0x2f461d);dials[_0x2f461d[_0x83ad('0xa')]]['starttime']=utils[_0x83ad('0x1e')]();dials[_0x2f461d[_0x83ad('0xa')]][_0x83ad('0x1f')]=_0x83ad('0x20');utils[_0x83ad('0xd')](util[_0x83ad('0x2')]('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x2f461d['uniqueid'],dials[_0x2f461d[_0x83ad('0xa')]][_0x83ad('0x21')]));}}catch(_0x20f7a5){utils[_0x83ad('0x22')](util['format']('[%s][dials][dialbegin]',_0x2f461d['uniqueid']),_0x20f7a5);}};exports['dialend']=function(_0x12e8ca){try{if(!_['isNil'](dials[_0x12e8ca[_0x83ad('0xa')]])){utils[_0x83ad('0xb')](util[_0x83ad('0x2')](_0x83ad('0x23'),_0x12e8ca[_0x83ad('0xa')]),_0x12e8ca);dials[_0x12e8ca[_0x83ad('0xa')]][_0x83ad('0x7')]=_0x12e8ca['dialstatus'];if(_0x12e8ca[_0x83ad('0x7')]=='ANSWER'){dials[_0x12e8ca['uniqueid']]=_[_0x83ad('0x1d')](dials[_0x12e8ca['uniqueid']],_0x12e8ca);dials[_0x12e8ca[_0x83ad('0xa')]][_0x83ad('0x24')]=utils['now']();dials[_0x12e8ca[_0x83ad('0xa')]][_0x83ad('0x1f')]=_0x83ad('0x25');utils[_0x83ad('0xd')](util[_0x83ad('0x2')](_0x83ad('0x26'),_0x12e8ca[_0x83ad('0xa')],_0x12e8ca[_0x83ad('0x7')],dials[_0x12e8ca['uniqueid']][_0x83ad('0x24')]));}else{utils[_0x83ad('0xd')](util['format'](_0x83ad('0x27'),_0x12e8ca[_0x83ad('0xa')],_0x12e8ca[_0x83ad('0x7')]));}}}catch(_0x537198){utils[_0x83ad('0x22')](util[_0x83ad('0x2')](_0x83ad('0x23'),_0x12e8ca[_0x83ad('0xa')]),_0x537198);}};exports[_0x83ad('0x28')]=function(_0x1bd9b7){try{if(!_['isNil'](dials[_0x1bd9b7['uniqueid']])){utils[_0x83ad('0xb')](util[_0x83ad('0x2')](_0x83ad('0x29'),_0x1bd9b7['uniqueid']),_0x1bd9b7);utils[_0x83ad('0xd')](util[_0x83ad('0x2')](_0x83ad('0x2a'),_0x1bd9b7[_0x83ad('0xa')],_0x1bd9b7[_0x83ad('0x2b')],_0x1bd9b7[_0x83ad('0x2c')],_0x1bd9b7[_0x83ad('0x2d')]));dials[_0x1bd9b7[_0x83ad('0xa')]]=_[_0x83ad('0x1d')](dials[_0x1bd9b7['uniqueid']],{'endtime':utils[_0x83ad('0x1e')](),'lastevent':_0x83ad('0x2e')});dials[_0x1bd9b7[_0x83ad('0xa')]][_0x83ad('0x2f')]=utils['diffTime'](dials[_0x1bd9b7[_0x83ad('0xa')]][_0x83ad('0x30')],dials[_0x1bd9b7[_0x83ad('0xa')]][_0x83ad('0x21')]);dials[_0x1bd9b7[_0x83ad('0xa')]][_0x83ad('0x31')]=utils[_0x83ad('0x32')](dials[_0x1bd9b7[_0x83ad('0xa')]][_0x83ad('0x24')]||dials[_0x1bd9b7['uniqueid']]['endtime'],dials[_0x1bd9b7['uniqueid']][_0x83ad('0x21')]);dials[_0x1bd9b7[_0x83ad('0xa')]]['billableseconds']=dials[_0x1bd9b7['uniqueid']][_0x83ad('0x24')]?utils[_0x83ad('0x32')](dials[_0x1bd9b7['uniqueid']][_0x83ad('0x30')],dials[_0x1bd9b7[_0x83ad('0xa')]]['answertime']):0x0;writeDB(dials[_0x1bd9b7[_0x83ad('0xa')]]);}}catch(_0x61f665){utils[_0x83ad('0x22')](util[_0x83ad('0x2')](_0x83ad('0x29'),_0x1bd9b7['uniqueid']),_0x61f665);}}; \ No newline at end of file +var _0x4913=['dialbegin','[%s][dials][dialbegin]','starttime','now','lastevent','called','dialend','[%s][dials][dialend]','ANSWER','assign','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','hangup','calleridname','cause-txt','complete','diffTime','holdtime','endtime','billableseconds','[%s][dials][hangup]','lodash','util','info','format','uniqueid','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','error','varset','[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value'];(function(_0x58ac9b,_0x34477f){var _0x523cfe=function(_0x2cdad4){while(--_0x2cdad4){_0x58ac9b['push'](_0x58ac9b['shift']());}};_0x523cfe(++_0x34477f);}(_0x4913,0x110));var _0x3491=function(_0x52d090,_0x31b778){_0x52d090=_0x52d090-0x0;var _0x433671=_0x4913[_0x52d090];return _0x433671;};'use strict';var _=require(_0x3491('0x0'));var util=require(_0x3491('0x1'));var utils=require('./utils');var dials={};function writeDB(_0x3f9476){utils[_0x3491('0x2')](util[_0x3491('0x3')]('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x3f9476[_0x3491('0x4')],_0x3f9476['channel'],_0x3f9476[_0x3491('0x5')],_0x3f9476[_0x3491('0x6')],_0x3f9476[_0x3491('0x7')],_0x3f9476[_0x3491('0x8')]));utils[_0x3491('0x9')](_0x3491('0xa'),_0x3f9476);delete dials[_0x3f9476[_0x3491('0x4')]];}exports[_0x3491('0xb')]=function(_0x36b149){try{utils[_0x3491('0xc')](util[_0x3491('0x3')](_0x3491('0xd'),_0x36b149[_0x3491('0x4')]),_0x36b149);utils[_0x3491('0x2')](util[_0x3491('0x3')](_0x3491('0xe'),_0x36b149[_0x3491('0x4')],_0x36b149[_0x3491('0xf')],_0x36b149[_0x3491('0x10')]));if(_0x36b149[_0x3491('0xf')][_0x3491('0x11')]()==_0x3491('0x12')&&_[_0x3491('0x13')](_0x36b149[_0x3491('0x10')][_0x3491('0x11')](),'cdr(routeid)')){var _0x21bc81=_0x36b149[_0x3491('0x10')]['split']('=');dials[_0x36b149['uniqueid']]={'routeId':_0x21bc81[0x1]};}}catch(_0x212b24){utils[_0x3491('0x14')](util[_0x3491('0x3')]('[%s][dials][newexten]',_0x36b149[_0x3491('0x4')]),_0x212b24);}};exports[_0x3491('0x15')]=function(_0x5e2f04){try{utils[_0x3491('0xc')](util[_0x3491('0x3')](_0x3491('0x16'),_0x5e2f04[_0x3491('0x4')]),_0x5e2f04);if(!_[_0x3491('0x17')](_0x5e2f04[_0x3491('0x18')][_0x3491('0x19')])){utils['info'](util['format'](_0x3491('0x1a'),_0x5e2f04['uniqueid'],_0x5e2f04[_0x3491('0x1b')]));dials[_0x5e2f04[_0x3491('0x4')]]={'routeId':_0x5e2f04[_0x3491('0x1b')]};}}catch(_0x389608){utils[_0x3491('0x14')](util['format']('[%s][dials][varset]',_0x5e2f04['uniqueid']),_0x389608);}};exports[_0x3491('0x1c')]=function(_0x315e9b){try{if(!_[_0x3491('0x17')](dials[_0x315e9b[_0x3491('0x4')]])){utils['debug'](util[_0x3491('0x3')](_0x3491('0x1d'),_0x315e9b[_0x3491('0x4')]),_0x315e9b);dials[_0x315e9b[_0x3491('0x4')]]=_['assign'](dials[_0x315e9b[_0x3491('0x4')]],_0x315e9b);dials[_0x315e9b[_0x3491('0x4')]][_0x3491('0x1e')]=utils[_0x3491('0x1f')]();dials[_0x315e9b[_0x3491('0x4')]][_0x3491('0x20')]=_0x3491('0x21');utils[_0x3491('0x2')](util['format']('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x315e9b[_0x3491('0x4')],dials[_0x315e9b[_0x3491('0x4')]]['starttime']));}}catch(_0x5da6d5){utils[_0x3491('0x14')](util[_0x3491('0x3')](_0x3491('0x1d'),_0x315e9b[_0x3491('0x4')]),_0x5da6d5);}};exports[_0x3491('0x22')]=function(_0xfdbebe){try{if(!_[_0x3491('0x17')](dials[_0xfdbebe[_0x3491('0x4')]])){utils[_0x3491('0xc')](util[_0x3491('0x3')](_0x3491('0x23'),_0xfdbebe[_0x3491('0x4')]),_0xfdbebe);dials[_0xfdbebe[_0x3491('0x4')]][_0x3491('0x8')]=_0xfdbebe[_0x3491('0x8')];if(_0xfdbebe[_0x3491('0x8')]==_0x3491('0x24')){dials[_0xfdbebe[_0x3491('0x4')]]=_[_0x3491('0x25')](dials[_0xfdbebe['uniqueid']],_0xfdbebe);dials[_0xfdbebe['uniqueid']][_0x3491('0x26')]=utils['now']();dials[_0xfdbebe[_0x3491('0x4')]]['lastevent']=_0x3491('0x27');utils[_0x3491('0x2')](util[_0x3491('0x3')](_0x3491('0x28'),_0xfdbebe[_0x3491('0x4')],_0xfdbebe[_0x3491('0x8')],dials[_0xfdbebe[_0x3491('0x4')]]['answertime']));}else{utils[_0x3491('0x2')](util[_0x3491('0x3')]('[%s][dials][dialend]\x20dialstatus:%s',_0xfdbebe[_0x3491('0x4')],_0xfdbebe[_0x3491('0x8')]));}}}catch(_0x32ad1){utils[_0x3491('0x14')](util[_0x3491('0x3')](_0x3491('0x23'),_0xfdbebe[_0x3491('0x4')]),_0x32ad1);}};exports[_0x3491('0x29')]=function(_0x4cff67){try{if(!_['isNil'](dials[_0x4cff67[_0x3491('0x4')]])){utils[_0x3491('0xc')](util['format']('[%s][dials][hangup]',_0x4cff67[_0x3491('0x4')]),_0x4cff67);utils[_0x3491('0x2')](util[_0x3491('0x3')]('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0x4cff67['uniqueid'],_0x4cff67[_0x3491('0x6')],_0x4cff67[_0x3491('0x2a')],_0x4cff67[_0x3491('0x2b')]));dials[_0x4cff67[_0x3491('0x4')]]=_['assign'](dials[_0x4cff67['uniqueid']],{'endtime':utils['now'](),'lastevent':_0x3491('0x2c')});dials[_0x4cff67['uniqueid']]['duration']=utils[_0x3491('0x2d')](dials[_0x4cff67['uniqueid']]['endtime'],dials[_0x4cff67[_0x3491('0x4')]][_0x3491('0x1e')]);dials[_0x4cff67[_0x3491('0x4')]][_0x3491('0x2e')]=utils[_0x3491('0x2d')](dials[_0x4cff67[_0x3491('0x4')]][_0x3491('0x26')]||dials[_0x4cff67[_0x3491('0x4')]][_0x3491('0x2f')],dials[_0x4cff67[_0x3491('0x4')]][_0x3491('0x1e')]);dials[_0x4cff67[_0x3491('0x4')]][_0x3491('0x30')]=dials[_0x4cff67[_0x3491('0x4')]][_0x3491('0x26')]?utils[_0x3491('0x2d')](dials[_0x4cff67['uniqueid']]['endtime'],dials[_0x4cff67[_0x3491('0x4')]][_0x3491('0x26')]):0x0;writeDB(dials[_0x4cff67['uniqueid']]);}}catch(_0x56b575){utils['error'](util[_0x3491('0x3')](_0x3491('0x31'),_0x4cff67[_0x3491('0x4')]),_0x56b575);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index e38b037..9ef63c0 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 _0x02b9=['[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','[%s][index][musiconholdstop]','musiconholdstop','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','origtransfereruniqueid','attendedtransfer','[%s][index][attendedtransfer]','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','util','asterisk','port','username','password','keepConnected','xdr','disabled','info','XDR\x20DISABLED','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./transfers.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device'];(function(_0x8cc412,_0x2af12a){var _0x50356a=function(_0x4d3c8e){while(--_0x4d3c8e){_0x8cc412['push'](_0x8cc412['shift']());}};_0x50356a(++_0x2af12a);}(_0x02b9,0x132));var _0x902b=function(_0x20877e,_0x3f5e7d){_0x20877e=_0x20877e-0x0;var _0x3cbc09=_0x02b9[_0x20877e];return _0x3cbc09;};var AsteriskManager=require(_0x902b('0x0'));var config=require(_0x902b('0x1'));var utils=require('./utils');var util=require(_0x902b('0x2'));var ami=new AsteriskManager(config[_0x902b('0x3')][_0x902b('0x4')],config['asterisk']['ip'],config[_0x902b('0x3')][_0x902b('0x5')],config[_0x902b('0x3')][_0x902b('0x6')],!![]);ami[_0x902b('0x7')]();if(config[_0x902b('0x8')]&&config[_0x902b('0x8')][_0x902b('0x9')]){utils[_0x902b('0xa')](_0x902b('0xb'));}else{var agents=require(_0x902b('0xc'));var calls=require(_0x902b('0xd'));var queues=require(_0x902b('0xe'));var recordings=require(_0x902b('0xf'));var members=require(_0x902b('0x10'));var dials=require('./dials.controller');var transfers=require(_0x902b('0x11'));var core=require('./core.controller');ami['on']('connect',core[_0x902b('0x12')]);ami['on'](_0x902b('0x13'),core[_0x902b('0x13')]);ami['on'](_0x902b('0x14'),core[_0x902b('0x14')]);ami['on'](_0x902b('0x15'),core[_0x902b('0x15')]);ami['on'](_0x902b('0x16'),core[_0x902b('0x16')]);ami['on'](_0x902b('0x17'),core[_0x902b('0x17')]);ami['on'](_0x902b('0x18'),function(_0x2feb79){try{utils[_0x902b('0x19')](util[_0x902b('0x1a')](_0x902b('0x1b'),_0x2feb79['device']),_0x2feb79);members['devicestatechange'](_0x2feb79);}catch(_0x26efe5){utils[_0x902b('0x15')](util[_0x902b('0x1a')](_0x902b('0x1b'),_0x2feb79[_0x902b('0x1c')]),_0x26efe5);}});ami['on']('agentcalled',function(_0xe06974){try{utils[_0x902b('0x19')](util[_0x902b('0x1a')](_0x902b('0x1d'),_0xe06974[_0x902b('0x1e')]),_0xe06974);agents['agentcalled'](_0xe06974);}catch(_0x1655ed){utils[_0x902b('0x15')](util[_0x902b('0x1a')](_0x902b('0x1d'),_0xe06974[_0x902b('0x1e')]),_0x1655ed);}});ami['on'](_0x902b('0x1f'),function(_0x1efd2a){try{utils[_0x902b('0x19')](util[_0x902b('0x1a')]('[%s][index][agentringnoanswer]',_0x1efd2a['uniqueid']),_0x1efd2a);agents[_0x902b('0x1f')](_0x1efd2a);}catch(_0x7bff34){utils[_0x902b('0x15')](util[_0x902b('0x1a')](_0x902b('0x20'),_0x1efd2a[_0x902b('0x1e')]),_0x7bff34);}});ami['on'](_0x902b('0x21'),function(_0x3ce6d2){try{utils[_0x902b('0x19')](util[_0x902b('0x1a')]('[%s][index][agentconnect]',_0x3ce6d2[_0x902b('0x1e')]),_0x3ce6d2);agents[_0x902b('0x21')](_0x3ce6d2);queues[_0x902b('0x21')](_0x3ce6d2);}catch(_0x3a7c4e){utils['error'](util[_0x902b('0x1a')](_0x902b('0x22'),_0x3ce6d2[_0x902b('0x1e')]),_0x3a7c4e);}});ami['on'](_0x902b('0x23'),function(_0x3dbdf6){try{utils[_0x902b('0x19')](util[_0x902b('0x1a')](_0x902b('0x24'),_0x3dbdf6[_0x902b('0x1e')]),_0x3dbdf6);agents[_0x902b('0x23')](_0x3dbdf6);queues['agentcomplete'](_0x3dbdf6);members[_0x902b('0x23')](_0x3dbdf6);}catch(_0x584d80){utils[_0x902b('0x15')](util[_0x902b('0x1a')](_0x902b('0x24'),_0x3dbdf6[_0x902b('0x1e')]),_0x584d80);}});ami['on'](_0x902b('0x25'),function(_0x25edc0){try{utils['debug'](util[_0x902b('0x1a')](_0x902b('0x26'),_0x25edc0[_0x902b('0x1e')]),_0x25edc0);agents[_0x902b('0x25')](_0x25edc0);queues['queuecallerabandon'](_0x25edc0);}catch(_0x105a46){utils[_0x902b('0x15')](util[_0x902b('0x1a')](_0x902b('0x26'),_0x25edc0['uniqueid']),_0x105a46);}});ami['on'](_0x902b('0x27'),function(_0x549a0d){try{utils[_0x902b('0x19')](util['format']('[%s][index][queuecallerjoin]',_0x549a0d[_0x902b('0x1e')]),_0x549a0d);queues[_0x902b('0x27')](_0x549a0d);recordings[_0x902b('0x27')](_0x549a0d);}catch(_0x4db964){utils['error'](util[_0x902b('0x1a')](_0x902b('0x28'),_0x549a0d[_0x902b('0x1e')]),_0x4db964);}});ami['on'](_0x902b('0x29'),function(_0x2ab2c4){try{utils[_0x902b('0x19')](util[_0x902b('0x1a')](_0x902b('0x2a'),_0x2ab2c4[_0x902b('0x1e')]),_0x2ab2c4);queues[_0x902b('0x29')](_0x2ab2c4);}catch(_0x475f4a){utils[_0x902b('0x15')](util[_0x902b('0x1a')](_0x902b('0x2a'),_0x2ab2c4['uniqueid']),_0x475f4a);}});ami['on']('musiconholdstart',function(_0x255182){try{utils[_0x902b('0x19')](util[_0x902b('0x1a')]('[%s][index][musiconholdstart]',_0x255182['uniqueid']),_0x255182);queues[_0x902b('0x2b')](_0x255182);calls[_0x902b('0x2b')](_0x255182);}catch(_0x317464){utils['error'](util[_0x902b('0x1a')](_0x902b('0x2c'),_0x255182['uniqueid']),_0x317464);}});ami['on']('musiconholdstop',function(_0x52ff52){try{utils[_0x902b('0x19')](util[_0x902b('0x1a')](_0x902b('0x2d'),_0x52ff52[_0x902b('0x1e')]),_0x52ff52);queues[_0x902b('0x2e')](_0x52ff52);calls['musiconholdstop'](_0x52ff52);}catch(_0x329068){utils[_0x902b('0x15')](util[_0x902b('0x1a')]('[%s][index][musiconholdstop]',_0x52ff52[_0x902b('0x1e')]),_0x329068);}});ami['on'](_0x902b('0x2f'),function(_0x795015){try{utils['debug'](util[_0x902b('0x1a')](_0x902b('0x30'),_0x795015['uniqueid']),_0x795015);calls[_0x902b('0x2f')](_0x795015);recordings['newstate'](_0x795015);}catch(_0x1e2c37){utils[_0x902b('0x15')](util[_0x902b('0x1a')]('[%s][index][newstate]',_0x795015[_0x902b('0x1e')]),_0x1e2c37);}});ami['on'](_0x902b('0x31'),function(_0x10c8b4){try{utils[_0x902b('0x19')](util['format'](_0x902b('0x32'),_0x10c8b4[_0x902b('0x1e')]),_0x10c8b4);calls['hangup'](_0x10c8b4);recordings[_0x902b('0x31')](_0x10c8b4);dials[_0x902b('0x31')](_0x10c8b4);agents[_0x902b('0x31')](_0x10c8b4);queues[_0x902b('0x31')](_0x10c8b4);}catch(_0x1fbe6b){utils[_0x902b('0x15')](util[_0x902b('0x1a')](_0x902b('0x32'),_0x10c8b4[_0x902b('0x1e')]),_0x1fbe6b);}});ami['on'](_0x902b('0x33'),function(_0x9e64d){try{utils[_0x902b('0x19')](util['format'](_0x902b('0x34'),_0x9e64d[_0x902b('0x1e')]),_0x9e64d);members[_0x902b('0x33')](_0x9e64d);}catch(_0x5a4640){utils[_0x902b('0x15')](util['format'](_0x902b('0x34'),_0x9e64d[_0x902b('0x1e')]),_0x5a4640);}});ami['on'](_0x902b('0x35'),function(_0x4b93b5){try{utils[_0x902b('0x19')](util[_0x902b('0x1a')]('[%s][index][blindtransfer]',_0x4b93b5['uniqueid']),_0x4b93b5);queues[_0x902b('0x35')](_0x4b93b5);agents[_0x902b('0x35')](_0x4b93b5);transfers[_0x902b('0x35')](_0x4b93b5);}catch(_0x3200d3){utils['error'](util[_0x902b('0x1a')](_0x902b('0x36'),_0x4b93b5[_0x902b('0x1e')]),_0x3200d3);}});ami['on']('attendedtransfer',function(_0x309363){try{utils[_0x902b('0x19')](util[_0x902b('0x1a')]('[%s][index][attendedtransfer]',_0x309363[_0x902b('0x37')]),_0x309363);queues['attendedtransfer'](_0x309363);transfers[_0x902b('0x38')](_0x309363);agents[_0x902b('0x38')](_0x309363);calls[_0x902b('0x38')](_0x309363);}catch(_0xe40049){utils[_0x902b('0x15')](util[_0x902b('0x1a')](_0x902b('0x39'),_0x309363[_0x902b('0x37')]),_0xe40049);}});ami['on'](_0x902b('0x3a'),function(_0xb5b2a9){try{utils[_0x902b('0x19')](util[_0x902b('0x1a')](_0x902b('0x3b'),_0xb5b2a9[_0x902b('0x1e')]),_0xb5b2a9);queues[_0x902b('0x3a')](_0xb5b2a9);recordings['varset'](_0xb5b2a9);calls[_0x902b('0x3a')](_0xb5b2a9);dials[_0x902b('0x3a')](_0xb5b2a9);}catch(_0x94acf9){utils['error'](util[_0x902b('0x1a')]('[%s][index][varset]',_0xb5b2a9[_0x902b('0x1e')]),_0x94acf9);}});ami['on'](_0x902b('0x3c'),function(_0x222956){try{utils['debug'](util[_0x902b('0x1a')](_0x902b('0x3d'),_0x222956[_0x902b('0x1e')]),_0x222956);calls[_0x902b('0x3c')](_0x222956);recordings[_0x902b('0x3c')](_0x222956);dials[_0x902b('0x3c')](_0x222956);}catch(_0x4412f0){utils['error'](util[_0x902b('0x1a')](_0x902b('0x3d'),_0x222956[_0x902b('0x1e')]),_0x4412f0);}});ami['on'](_0x902b('0x3e'),function(_0x2bf9da){try{utils[_0x902b('0x19')](util[_0x902b('0x1a')]('[%s][index][newchannel]',_0x2bf9da['uniqueid']),_0x2bf9da);calls[_0x902b('0x3e')](_0x2bf9da);recordings[_0x902b('0x3e')](_0x2bf9da);}catch(_0x566bb5){utils[_0x902b('0x15')](util['format'](_0x902b('0x3f'),_0x2bf9da[_0x902b('0x1e')]),_0x566bb5);}});ami['on']('dialbegin',function(_0x583b33){try{utils[_0x902b('0x19')](util[_0x902b('0x1a')]('[%s][index][dialbegin]',_0x583b33[_0x902b('0x1e')]),_0x583b33);dials['dialbegin'](_0x583b33);}catch(_0xecc9e0){utils[_0x902b('0x15')](util[_0x902b('0x1a')](_0x902b('0x40'),_0x583b33[_0x902b('0x1e')]),_0xecc9e0);}});ami['on'](_0x902b('0x41'),function(_0x3d33cd){try{utils[_0x902b('0x19')](util[_0x902b('0x1a')](_0x902b('0x42'),_0x3d33cd[_0x902b('0x1e')]),_0x3d33cd);dials[_0x902b('0x41')](_0x3d33cd);}catch(_0x10e4a7){utils[_0x902b('0x15')](util[_0x902b('0x1a')]('[%s][index][dialend]',_0x3d33cd[_0x902b('0x1e')]),_0x10e4a7);}});} \ No newline at end of file +var _0x29d0=['fullybooted','error','close','managerevent','devicestatechange','debug','format','device','[%s][index][devicestatechange]','uniqueid','agentcalled','[%s][index][agentcalled]','agentringnoanswer','[%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','[%s][index][musiconholdstop]','musiconholdstop','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','[%s][index][varset]','varset','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','util','port','asterisk','password','keepConnected','xdr','disabled','info','XDR\x20DISABLED','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','connect','shutdown'];(function(_0x10dbf6,_0x3ff964){var _0x452147=function(_0x7476e0){while(--_0x7476e0){_0x10dbf6['push'](_0x10dbf6['shift']());}};_0x452147(++_0x3ff964);}(_0x29d0,0x195));var _0x029d=function(_0x112120,_0x52979c){_0x112120=_0x112120-0x0;var _0x471bc1=_0x29d0[_0x112120];return _0x471bc1;};var AsteriskManager=require(_0x029d('0x0'));var config=require(_0x029d('0x1'));var utils=require(_0x029d('0x2'));var util=require(_0x029d('0x3'));var ami=new AsteriskManager(config['asterisk'][_0x029d('0x4')],config[_0x029d('0x5')]['ip'],config[_0x029d('0x5')]['username'],config['asterisk'][_0x029d('0x6')],!![]);ami[_0x029d('0x7')]();if(config[_0x029d('0x8')]&&config['xdr'][_0x029d('0x9')]){utils[_0x029d('0xa')](_0x029d('0xb'));}else{var agents=require(_0x029d('0xc'));var calls=require(_0x029d('0xd'));var queues=require(_0x029d('0xe'));var recordings=require(_0x029d('0xf'));var members=require(_0x029d('0x10'));var dials=require(_0x029d('0x11'));var transfers=require(_0x029d('0x12'));var core=require('./core.controller');ami['on'](_0x029d('0x13'),core[_0x029d('0x13')]);ami['on'](_0x029d('0x14'),core['shutdown']);ami['on'](_0x029d('0x15'),core[_0x029d('0x15')]);ami['on'](_0x029d('0x16'),core[_0x029d('0x16')]);ami['on'](_0x029d('0x17'),core['close']);ami['on']('managerevent',core[_0x029d('0x18')]);ami['on'](_0x029d('0x19'),function(_0x2604b6){try{utils[_0x029d('0x1a')](util[_0x029d('0x1b')]('[%s][index][devicestatechange]',_0x2604b6[_0x029d('0x1c')]),_0x2604b6);members[_0x029d('0x19')](_0x2604b6);}catch(_0xd2fb6d){utils[_0x029d('0x16')](util[_0x029d('0x1b')](_0x029d('0x1d'),_0x2604b6[_0x029d('0x1c')]),_0xd2fb6d);}});ami['on']('agentcalled',function(_0x541610){try{utils['debug'](util[_0x029d('0x1b')]('[%s][index][agentcalled]',_0x541610[_0x029d('0x1e')]),_0x541610);agents[_0x029d('0x1f')](_0x541610);}catch(_0x23539e){utils[_0x029d('0x16')](util['format'](_0x029d('0x20'),_0x541610['uniqueid']),_0x23539e);}});ami['on'](_0x029d('0x21'),function(_0x236d24){try{utils[_0x029d('0x1a')](util['format'](_0x029d('0x22'),_0x236d24['uniqueid']),_0x236d24);agents[_0x029d('0x21')](_0x236d24);}catch(_0x255447){utils[_0x029d('0x16')](util[_0x029d('0x1b')](_0x029d('0x22'),_0x236d24['uniqueid']),_0x255447);}});ami['on'](_0x029d('0x23'),function(_0x4a103e){try{utils[_0x029d('0x1a')](util[_0x029d('0x1b')](_0x029d('0x24'),_0x4a103e['uniqueid']),_0x4a103e);agents[_0x029d('0x23')](_0x4a103e);queues[_0x029d('0x23')](_0x4a103e);}catch(_0x2a246c){utils[_0x029d('0x16')](util['format']('[%s][index][agentconnect]',_0x4a103e[_0x029d('0x1e')]),_0x2a246c);}});ami['on'](_0x029d('0x25'),function(_0x33bf9a){try{utils[_0x029d('0x1a')](util[_0x029d('0x1b')](_0x029d('0x26'),_0x33bf9a[_0x029d('0x1e')]),_0x33bf9a);agents[_0x029d('0x25')](_0x33bf9a);queues[_0x029d('0x25')](_0x33bf9a);members[_0x029d('0x25')](_0x33bf9a);}catch(_0xf1f0f6){utils[_0x029d('0x16')](util[_0x029d('0x1b')](_0x029d('0x26'),_0x33bf9a['uniqueid']),_0xf1f0f6);}});ami['on'](_0x029d('0x27'),function(_0x4a3b5c){try{utils[_0x029d('0x1a')](util[_0x029d('0x1b')](_0x029d('0x28'),_0x4a3b5c[_0x029d('0x1e')]),_0x4a3b5c);agents[_0x029d('0x27')](_0x4a3b5c);queues['queuecallerabandon'](_0x4a3b5c);}catch(_0x18a8a3){utils['error'](util['format'](_0x029d('0x28'),_0x4a3b5c['uniqueid']),_0x18a8a3);}});ami['on'](_0x029d('0x29'),function(_0x485eed){try{utils[_0x029d('0x1a')](util[_0x029d('0x1b')](_0x029d('0x2a'),_0x485eed[_0x029d('0x1e')]),_0x485eed);queues[_0x029d('0x29')](_0x485eed);recordings[_0x029d('0x29')](_0x485eed);}catch(_0x20a0e5){utils[_0x029d('0x16')](util[_0x029d('0x1b')](_0x029d('0x2a'),_0x485eed[_0x029d('0x1e')]),_0x20a0e5);}});ami['on']('queuecallerleave',function(_0x31df04){try{utils['debug'](util['format']('[%s][index][queuecallerleave]',_0x31df04[_0x029d('0x1e')]),_0x31df04);queues[_0x029d('0x2b')](_0x31df04);}catch(_0x3e69a1){utils['error'](util[_0x029d('0x1b')](_0x029d('0x2c'),_0x31df04[_0x029d('0x1e')]),_0x3e69a1);}});ami['on']('musiconholdstart',function(_0x15584a){try{utils[_0x029d('0x1a')](util[_0x029d('0x1b')](_0x029d('0x2d'),_0x15584a['uniqueid']),_0x15584a);queues[_0x029d('0x2e')](_0x15584a);calls[_0x029d('0x2e')](_0x15584a);}catch(_0xfb897b){utils['error'](util['format'](_0x029d('0x2d'),_0x15584a[_0x029d('0x1e')]),_0xfb897b);}});ami['on']('musiconholdstop',function(_0xf52293){try{utils[_0x029d('0x1a')](util[_0x029d('0x1b')](_0x029d('0x2f'),_0xf52293[_0x029d('0x1e')]),_0xf52293);queues[_0x029d('0x30')](_0xf52293);calls[_0x029d('0x30')](_0xf52293);}catch(_0x34dc60){utils['error'](util[_0x029d('0x1b')](_0x029d('0x2f'),_0xf52293[_0x029d('0x1e')]),_0x34dc60);}});ami['on'](_0x029d('0x31'),function(_0x67b06c){try{utils[_0x029d('0x1a')](util[_0x029d('0x1b')](_0x029d('0x32'),_0x67b06c[_0x029d('0x1e')]),_0x67b06c);calls[_0x029d('0x31')](_0x67b06c);recordings['newstate'](_0x67b06c);}catch(_0x1fc27c){utils['error'](util['format']('[%s][index][newstate]',_0x67b06c[_0x029d('0x1e')]),_0x1fc27c);}});ami['on']('hangup',function(_0xbc4a4d){try{utils['debug'](util[_0x029d('0x1b')]('[%s][index][hangup]',_0xbc4a4d[_0x029d('0x1e')]),_0xbc4a4d);calls['hangup'](_0xbc4a4d);recordings['hangup'](_0xbc4a4d);dials[_0x029d('0x33')](_0xbc4a4d);agents['hangup'](_0xbc4a4d);queues[_0x029d('0x33')](_0xbc4a4d);}catch(_0xdad71e){utils[_0x029d('0x16')](util[_0x029d('0x1b')](_0x029d('0x34'),_0xbc4a4d[_0x029d('0x1e')]),_0xdad71e);}});ami['on'](_0x029d('0x35'),function(_0x130724){try{utils['debug'](util[_0x029d('0x1b')](_0x029d('0x36'),_0x130724[_0x029d('0x1e')]),_0x130724);members[_0x029d('0x35')](_0x130724);}catch(_0x1703d3){utils[_0x029d('0x16')](util[_0x029d('0x1b')](_0x029d('0x36'),_0x130724['uniqueid']),_0x1703d3);}});ami['on'](_0x029d('0x37'),function(_0x542cb3){try{utils['debug'](util[_0x029d('0x1b')](_0x029d('0x38'),_0x542cb3['uniqueid']),_0x542cb3);queues['blindtransfer'](_0x542cb3);agents[_0x029d('0x37')](_0x542cb3);transfers['blindtransfer'](_0x542cb3);}catch(_0x58fe63){utils['error'](util[_0x029d('0x1b')](_0x029d('0x38'),_0x542cb3[_0x029d('0x1e')]),_0x58fe63);}});ami['on'](_0x029d('0x39'),function(_0x9736aa){try{utils[_0x029d('0x1a')](util['format'](_0x029d('0x3a'),_0x9736aa[_0x029d('0x3b')]),_0x9736aa);queues[_0x029d('0x39')](_0x9736aa);transfers[_0x029d('0x39')](_0x9736aa);agents[_0x029d('0x39')](_0x9736aa);calls[_0x029d('0x39')](_0x9736aa);}catch(_0x2aeeaf){utils[_0x029d('0x16')](util[_0x029d('0x1b')]('[%s][index][attendedtransfer]',_0x9736aa[_0x029d('0x3b')]),_0x2aeeaf);}});ami['on']('varset',function(_0x4f994b){try{utils['debug'](util[_0x029d('0x1b')](_0x029d('0x3c'),_0x4f994b['uniqueid']),_0x4f994b);queues[_0x029d('0x3d')](_0x4f994b);recordings['varset'](_0x4f994b);calls[_0x029d('0x3d')](_0x4f994b);dials[_0x029d('0x3d')](_0x4f994b);}catch(_0x1665fc){utils['error'](util[_0x029d('0x1b')]('[%s][index][varset]',_0x4f994b['uniqueid']),_0x1665fc);}});ami['on'](_0x029d('0x3e'),function(_0x2d0f0){try{utils['debug'](util[_0x029d('0x1b')](_0x029d('0x3f'),_0x2d0f0[_0x029d('0x1e')]),_0x2d0f0);calls[_0x029d('0x3e')](_0x2d0f0);recordings['newexten'](_0x2d0f0);dials['newexten'](_0x2d0f0);}catch(_0x13ff8d){utils[_0x029d('0x16')](util[_0x029d('0x1b')]('[%s][index][newexten]',_0x2d0f0[_0x029d('0x1e')]),_0x13ff8d);}});ami['on'](_0x029d('0x40'),function(_0x13fa38){try{utils[_0x029d('0x1a')](util[_0x029d('0x1b')](_0x029d('0x41'),_0x13fa38[_0x029d('0x1e')]),_0x13fa38);calls[_0x029d('0x40')](_0x13fa38);recordings[_0x029d('0x40')](_0x13fa38);}catch(_0x5e529a){utils['error'](util[_0x029d('0x1b')](_0x029d('0x41'),_0x13fa38[_0x029d('0x1e')]),_0x5e529a);}});ami['on'](_0x029d('0x42'),function(_0x34ea8c){try{utils[_0x029d('0x1a')](util[_0x029d('0x1b')](_0x029d('0x43'),_0x34ea8c[_0x029d('0x1e')]),_0x34ea8c);dials[_0x029d('0x42')](_0x34ea8c);}catch(_0x48feeb){utils[_0x029d('0x16')](util[_0x029d('0x1b')](_0x029d('0x44'),_0x34ea8c[_0x029d('0x1e')]),_0x48feeb);}});ami['on'](_0x029d('0x45'),function(_0x568d0b){try{utils[_0x029d('0x1a')](util['format']('[%s][index][dialend]',_0x568d0b[_0x029d('0x1e')]),_0x568d0b);dials['dialend'](_0x568d0b);}catch(_0x1632c4){utils[_0x029d('0x16')](util[_0x029d('0x1b')](_0x029d('0x46'),_0x568d0b[_0x029d('0x1e')]),_0x1632c4);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 989d0de..1c555cf 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 _0xcba7=['interface','channel','data2','membername','type','getUserByInterface','name','request','CreateMemberReport','getUserByName','then','internal','catch','error','some','startsWith','devicestatechange','debug','device','state','INUSE','BUSY','voice','TALKING','now','agent','NOT_INUSE','isNil','exitAt','diffTime','enterAt','[%s][members][devicestatechange]','agentcomplete','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','[%s][members][agentcomplete]','[%s][members][cdr]','split','assign','data1','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','lodash','util','./utils','Local/_attended@transfer','info','format','uniqueid'];(function(_0x4a2e6c,_0x5322a5){var _0x127498=function(_0x1cdc82){while(--_0x1cdc82){_0x4a2e6c['push'](_0x4a2e6c['shift']());}};_0x127498(++_0x5322a5);}(_0xcba7,0x199));var _0x7cba=function(_0x1792ae,_0x3738a3){_0x1792ae=_0x1792ae-0x0;var _0x379871=_0xcba7[_0x1792ae];return _0x379871;};'use strict';var _=require(_0x7cba('0x0'));var util=require(_0x7cba('0x1'));var utils=require(_0x7cba('0x2'));var members={};var exclude=[_0x7cba('0x3'),'Queue:'];function writeDB(_0x119b7f){utils[_0x7cba('0x4')](util[_0x7cba('0x5')]('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0x119b7f[_0x7cba('0x6')],_0x119b7f[_0x7cba('0x7')],_0x119b7f[_0x7cba('0x8')],_0x119b7f[_0x7cba('0x9')],_0x119b7f[_0x7cba('0xa')],_0x119b7f[_0x7cba('0xb')]));if(_0x119b7f[_0x7cba('0x7')]){utils[_0x7cba('0xc')](_0x119b7f[_0x7cba('0x7')])['then'](function(_0x2d9628){if(_0x2d9628){_0x119b7f[_0x7cba('0xa')]=_0x2d9628[_0x7cba('0xd')];_0x119b7f['internal']=_0x2d9628['internal'];utils[_0x7cba('0xe')](_0x7cba('0xf'),_0x119b7f);}else{utils[_0x7cba('0x10')](_0x119b7f[_0x7cba('0x7')]['split']('/')[0x1])[_0x7cba('0x11')](function(_0x145ecc){if(_0x145ecc){_0x119b7f[_0x7cba('0xa')]=_0x145ecc[_0x7cba('0xd')];_0x119b7f[_0x7cba('0x12')]=_0x145ecc[_0x7cba('0x12')];utils[_0x7cba('0xe')](_0x7cba('0xf'),_0x119b7f);}});}})[_0x7cba('0x13')](function(_0x406553){utils[_0x7cba('0x14')](util[_0x7cba('0x5')]('[%s][members][writeDB]',_0x119b7f['uniqueid']),_0x406553);});}delete members[_0x119b7f[_0x7cba('0x7')]];}function startsWith(_0xbf5ce8,_0x39585b){return _[_0x7cba('0x15')](_0xbf5ce8,function(_0x38b935){return _[_0x7cba('0x16')](_0x39585b,_0x38b935);});}exports[_0x7cba('0x17')]=function(_0x40c869){try{utils[_0x7cba('0x18')](util[_0x7cba('0x5')]('[%s][members][devicestatechange]',members[_0x40c869[_0x7cba('0x19')]]?members[_0x40c869['device']]['uniqueid']:_0x40c869[_0x7cba('0x19')]),_0x40c869);utils[_0x7cba('0x4')](util[_0x7cba('0x5')]('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x40c869[_0x7cba('0x19')]]?members[_0x40c869['device']][_0x7cba('0x6')]:_0x40c869['device'],_0x40c869['state'],_0x40c869[_0x7cba('0x19')]));switch(_0x40c869[_0x7cba('0x1a')]){case _0x7cba('0x1b'):case _0x7cba('0x1c'):if(!startsWith(exclude,_0x40c869[_0x7cba('0x19')])){members[_0x40c869['device']]={'channel':_0x7cba('0x1d'),'interface':_0x40c869['device'],'type':_0x7cba('0x1e'),'enterAt':utils[_0x7cba('0x1f')](),'role':_0x7cba('0x20')};}break;case _0x7cba('0x21'):if(!_[_0x7cba('0x22')](members[_0x40c869[_0x7cba('0x19')]])){members[_0x40c869[_0x7cba('0x19')]][_0x7cba('0x23')]=utils[_0x7cba('0x1f')]();members[_0x40c869['device']]['duration']=utils[_0x7cba('0x24')](members[_0x40c869['device']][_0x7cba('0x23')],members[_0x40c869[_0x7cba('0x19')]][_0x7cba('0x25')]);if(members[_0x40c869[_0x7cba('0x19')]][_0x7cba('0x6')]){writeDB(members[_0x40c869['device']]);}}break;default:break;}}catch(_0x35a10b){utils['error'](util['format'](_0x7cba('0x26'),members[_0x40c869[_0x7cba('0x19')]]?members[_0x40c869[_0x7cba('0x19')]][_0x7cba('0x6')]:_0x40c869[_0x7cba('0x19')]),_0x35a10b);}};exports[_0x7cba('0x27')]=function(_0x296196){try{if(!_[_0x7cba('0x22')](members[_0x296196[_0x7cba('0x7')]])){utils['debug'](util[_0x7cba('0x5')]('[%s][members][agentcomplete]',_0x296196[_0x7cba('0x6')]),_0x296196);utils[_0x7cba('0x4')](util[_0x7cba('0x5')](_0x7cba('0x28'),_0x296196[_0x7cba('0x6')],_0x296196[_0x7cba('0x7')],_0x296196[_0x7cba('0x29')]));members[_0x296196[_0x7cba('0x7')]]=_['assign'](members[_0x296196[_0x7cba('0x7')]],{'data4':_0x296196['queue'],'uniqueid':_0x296196[_0x7cba('0x6')]});}}catch(_0x13fdbd){utils[_0x7cba('0x14')](util[_0x7cba('0x5')](_0x7cba('0x2a'),_0x296196[_0x7cba('0x6')]),_0x13fdbd);}};exports['cdr']=function(_0x52866e){try{utils[_0x7cba('0x18')](util[_0x7cba('0x5')](_0x7cba('0x2b'),_0x52866e['uniqueid']),_0x52866e);if(_0x52866e['channel']){var _0x15da45=_0x52866e['channel'][_0x7cba('0x2c')]('-')[0x0];if(!_[_0x7cba('0x22')](members[_0x15da45])){members[_0x15da45]=_[_0x7cba('0x2d')](members[_0x15da45],{'data1':members[_0x15da45][_0x7cba('0x2e')]||_0x52866e[_0x7cba('0xb')],'data2':members[_0x15da45]['data2']||_0x52866e[_0x7cba('0x2f')],'data3':members[_0x15da45][_0x7cba('0x30')]||_0x52866e[_0x7cba('0x31')],'uniqueid':members[_0x15da45]['uniqueid']||_0x52866e['uniqueid']});utils[_0x7cba('0x4')](util['format'](_0x7cba('0x32'),_0x52866e[_0x7cba('0x6')],members[_0x15da45]['data1'],members[_0x15da45][_0x7cba('0x9')],members[_0x15da45][_0x7cba('0x30')]));if(members[_0x15da45][_0x7cba('0x23')]){writeDB(members[_0x15da45]);}}}if(_0x52866e[_0x7cba('0x33')]){var _0x45b688=_0x52866e[_0x7cba('0x33')][_0x7cba('0x2c')]('-')[0x0];if(!_[_0x7cba('0x22')](members[_0x45b688])){members[_0x45b688]=_['assign'](members[_0x45b688],{'data1':members[_0x45b688][_0x7cba('0x2e')]||_0x52866e[_0x7cba('0xb')],'data2':members[_0x45b688][_0x7cba('0x9')]||_0x52866e[_0x7cba('0x2f')],'data3':members[_0x45b688][_0x7cba('0x30')]||_0x52866e[_0x7cba('0x31')],'uniqueid':members[_0x45b688][_0x7cba('0x6')]||_0x52866e[_0x7cba('0x6')]});utils[_0x7cba('0x4')](util['format']('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x52866e['uniqueid'],members[_0x45b688]['data1'],members[_0x45b688]['data2'],members[_0x45b688][_0x7cba('0x30')]));if(members[_0x45b688][_0x7cba('0x23')]){writeDB(members[_0x45b688]);}}}}catch(_0x1b538b){utils['error'](util['format'](_0x7cba('0x2b'),_0x52866e[_0x7cba('0x6')]),_0x1b538b);}}; \ No newline at end of file +var _0xbab3=['destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','split','lodash','./utils','Local/_attended@transfer','Queue:','info','interface','data2','membername','type','getUserByInterface','then','name','internal','request','getUserByName','CreateMemberReport','catch','error','format','[%s][members][writeDB]','uniqueid','some','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','voice','TALKING','agent','NOT_INUSE','exitAt','now','duration','enterAt','isNil','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','assign','queue','cdr','[%s][members][cdr]','data1','source','data3'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0xbab3,0x130));var _0x3bab=function(_0x13f257,_0x3c3d67){_0x13f257=_0x13f257-0x0;var _0x455f37=_0xbab3[_0x13f257];return _0x455f37;};'use strict';var _=require(_0x3bab('0x0'));var util=require('util');var utils=require(_0x3bab('0x1'));var members={};var exclude=[_0x3bab('0x2'),_0x3bab('0x3')];function writeDB(_0x54da45){utils[_0x3bab('0x4')](util['format']('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0x54da45['uniqueid'],_0x54da45[_0x3bab('0x5')],_0x54da45['channel'],_0x54da45[_0x3bab('0x6')],_0x54da45[_0x3bab('0x7')],_0x54da45[_0x3bab('0x8')]));if(_0x54da45[_0x3bab('0x5')]){utils[_0x3bab('0x9')](_0x54da45[_0x3bab('0x5')])[_0x3bab('0xa')](function(_0x31b4a9){if(_0x31b4a9){_0x54da45[_0x3bab('0x7')]=_0x31b4a9[_0x3bab('0xb')];_0x54da45[_0x3bab('0xc')]=_0x31b4a9['internal'];utils[_0x3bab('0xd')]('CreateMemberReport',_0x54da45);}else{utils[_0x3bab('0xe')](_0x54da45[_0x3bab('0x5')]['split']('/')[0x1])[_0x3bab('0xa')](function(_0x1ebce4){if(_0x1ebce4){_0x54da45[_0x3bab('0x7')]=_0x1ebce4[_0x3bab('0xb')];_0x54da45[_0x3bab('0xc')]=_0x1ebce4[_0x3bab('0xc')];utils[_0x3bab('0xd')](_0x3bab('0xf'),_0x54da45);}});}})[_0x3bab('0x10')](function(_0x10d3ca){utils[_0x3bab('0x11')](util[_0x3bab('0x12')](_0x3bab('0x13'),_0x54da45[_0x3bab('0x14')]),_0x10d3ca);});}delete members[_0x54da45[_0x3bab('0x5')]];}function startsWith(_0x173d14,_0x12a2a0){return _[_0x3bab('0x15')](_0x173d14,function(_0x51b3e3){return _['startsWith'](_0x12a2a0,_0x51b3e3);});}exports['devicestatechange']=function(_0x1af796){try{utils[_0x3bab('0x16')](util[_0x3bab('0x12')](_0x3bab('0x17'),members[_0x1af796[_0x3bab('0x18')]]?members[_0x1af796[_0x3bab('0x18')]][_0x3bab('0x14')]:_0x1af796[_0x3bab('0x18')]),_0x1af796);utils[_0x3bab('0x4')](util['format'](_0x3bab('0x19'),members[_0x1af796[_0x3bab('0x18')]]?members[_0x1af796[_0x3bab('0x18')]]['uniqueid']:_0x1af796[_0x3bab('0x18')],_0x1af796[_0x3bab('0x1a')],_0x1af796[_0x3bab('0x18')]));switch(_0x1af796['state']){case _0x3bab('0x1b'):case'BUSY':if(!startsWith(exclude,_0x1af796[_0x3bab('0x18')])){members[_0x1af796[_0x3bab('0x18')]]={'channel':_0x3bab('0x1c'),'interface':_0x1af796[_0x3bab('0x18')],'type':_0x3bab('0x1d'),'enterAt':utils['now'](),'role':_0x3bab('0x1e')};}break;case _0x3bab('0x1f'):if(!_['isNil'](members[_0x1af796['device']])){members[_0x1af796[_0x3bab('0x18')]][_0x3bab('0x20')]=utils[_0x3bab('0x21')]();members[_0x1af796[_0x3bab('0x18')]][_0x3bab('0x22')]=utils['diffTime'](members[_0x1af796[_0x3bab('0x18')]][_0x3bab('0x20')],members[_0x1af796[_0x3bab('0x18')]][_0x3bab('0x23')]);if(members[_0x1af796['device']][_0x3bab('0x14')]){writeDB(members[_0x1af796[_0x3bab('0x18')]]);}}break;default:break;}}catch(_0x1a7e66){utils['error'](util[_0x3bab('0x12')](_0x3bab('0x17'),members[_0x1af796['device']]?members[_0x1af796[_0x3bab('0x18')]]['uniqueid']:_0x1af796[_0x3bab('0x18')]),_0x1a7e66);}};exports['agentcomplete']=function(_0x15513e){try{if(!_[_0x3bab('0x24')](members[_0x15513e[_0x3bab('0x5')]])){utils['debug'](util['format'](_0x3bab('0x25'),_0x15513e[_0x3bab('0x14')]),_0x15513e);utils['info'](util[_0x3bab('0x12')](_0x3bab('0x26'),_0x15513e[_0x3bab('0x14')],_0x15513e['interface'],_0x15513e['queue']));members[_0x15513e[_0x3bab('0x5')]]=_[_0x3bab('0x27')](members[_0x15513e[_0x3bab('0x5')]],{'data4':_0x15513e[_0x3bab('0x28')],'uniqueid':_0x15513e['uniqueid']});}}catch(_0x4b2b94){utils[_0x3bab('0x11')](util[_0x3bab('0x12')](_0x3bab('0x25'),_0x15513e[_0x3bab('0x14')]),_0x4b2b94);}};exports[_0x3bab('0x29')]=function(_0x1ba60d){try{utils['debug'](util[_0x3bab('0x12')](_0x3bab('0x2a'),_0x1ba60d[_0x3bab('0x14')]),_0x1ba60d);if(_0x1ba60d['channel']){var _0x2c09bc=_0x1ba60d['channel']['split']('-')[0x0];if(!_[_0x3bab('0x24')](members[_0x2c09bc])){members[_0x2c09bc]=_[_0x3bab('0x27')](members[_0x2c09bc],{'data1':members[_0x2c09bc][_0x3bab('0x2b')]||_0x1ba60d['type'],'data2':members[_0x2c09bc]['data2']||_0x1ba60d[_0x3bab('0x2c')],'data3':members[_0x2c09bc][_0x3bab('0x2d')]||_0x1ba60d[_0x3bab('0x2e')],'uniqueid':members[_0x2c09bc][_0x3bab('0x14')]||_0x1ba60d[_0x3bab('0x14')]});utils[_0x3bab('0x4')](util[_0x3bab('0x12')](_0x3bab('0x2f'),_0x1ba60d[_0x3bab('0x14')],members[_0x2c09bc][_0x3bab('0x2b')],members[_0x2c09bc][_0x3bab('0x6')],members[_0x2c09bc][_0x3bab('0x2d')]));if(members[_0x2c09bc]['exitAt']){writeDB(members[_0x2c09bc]);}}}if(_0x1ba60d[_0x3bab('0x30')]){var _0xd462c3=_0x1ba60d['destinationchannel'][_0x3bab('0x31')]('-')[0x0];if(!_[_0x3bab('0x24')](members[_0xd462c3])){members[_0xd462c3]=_[_0x3bab('0x27')](members[_0xd462c3],{'data1':members[_0xd462c3][_0x3bab('0x2b')]||_0x1ba60d['type'],'data2':members[_0xd462c3][_0x3bab('0x6')]||_0x1ba60d[_0x3bab('0x2c')],'data3':members[_0xd462c3][_0x3bab('0x2d')]||_0x1ba60d[_0x3bab('0x2e')],'uniqueid':members[_0xd462c3][_0x3bab('0x14')]||_0x1ba60d[_0x3bab('0x14')]});utils[_0x3bab('0x4')](util[_0x3bab('0x12')](_0x3bab('0x2f'),_0x1ba60d[_0x3bab('0x14')],members[_0xd462c3][_0x3bab('0x2b')],members[_0xd462c3][_0x3bab('0x6')],members[_0xd462c3][_0x3bab('0x2d')]));if(members[_0xd462c3][_0x3bab('0x20')]){writeDB(members[_0xd462c3]);}}}}catch(_0x1ace0c){utils[_0x3bab('0x11')](util['format'](_0x3bab('0x2a'),_0x1ba60d[_0x3bab('0x14')]),_0x1ace0c);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 6072b84..f4d7650 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 _0x6631=['queuecallerexitreason','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','[%s][queues][varset]','variable','value','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','EXITWITHKEY','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','queuecallerleave','holdtime','diffTime','count','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','assigned','accountcode','membername','agentcomplete','[%s][queues][agentcomplete]','reason','transfer','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','transfertype','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','[%s][queues][blindtransfer]','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDEDTRANSFER','transfereelinkedid','clone','calleridname','queuecallerjoinAt','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','origtransfererlinkedid','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','ATTENDED','transfertargetlinkedid','transfertargetuniqueid','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','[%s][queues][musiconholdstop]','lodash','util','info','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','channel','queue','lastAssignedTo','calleridnum','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','uniqueid','queuecallerjoin','format','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','error','[%s][queues][queuecallerjoin]','hangup','isNil','debug','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercompleteAt','now'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x6631,0xb6));var _0x1663=function(_0x1c9361,_0x4c4539){_0x1c9361=_0x1c9361-0x0;var _0x16233d=_0x6631[_0x1c9361];return _0x16233d;};'use strict';var _=require(_0x1663('0x0'));var util=require(_0x1663('0x1'));var utils=require('./utils');var queues={};function writeDB(_0x213062){utils[_0x1663('0x2')](util['format'](_0x1663('0x3'),_0x213062['uniqueid'],_0x213062[_0x1663('0x4')],_0x213062[_0x1663('0x5')],_0x213062[_0x1663('0x6')],_0x213062[_0x1663('0x7')],_0x213062['accountcode'],_0x213062['queuecallerexitreason']));if(_0x213062[_0x1663('0x5')]){utils[_0x1663('0x8')](_0x213062['queue'])[_0x1663('0x9')](function(_0x2eecb9){if(_0x2eecb9){_0x213062[_0x1663('0xa')]=_0x2eecb9[_0x1663('0xa')];}utils[_0x1663('0xb')](_0x1663('0xc'),_0x213062);});}else{utils['request'](_0x1663('0xc'),_0x213062);}if(_0x213062[_0x1663('0xd')]){delete queues[_0x213062['transfereduniqueid']];}else{delete queues[_0x213062[_0x1663('0xe')]];}}exports[_0x1663('0xf')]=function(_0x410a86){try{utils['debug'](util[_0x1663('0x10')]('[%s][queues][queuecallerjoin]',_0x410a86[_0x1663('0xe')]),_0x410a86);utils['info'](util[_0x1663('0x10')](_0x1663('0x11'),_0x410a86[_0x1663('0xe')],_0x410a86['queue'],_0x410a86[_0x1663('0x12')]));queues[_0x410a86[_0x1663('0xe')]]=_[_0x1663('0x13')](_0x410a86,{'originalposition':_0x410a86[_0x1663('0x12')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x50770c){utils[_0x1663('0x14')](util[_0x1663('0x10')](_0x1663('0x15'),_0x410a86[_0x1663('0xe')]),_0x50770c);}};exports[_0x1663('0x16')]=function(_0x2e888e){try{if(!_[_0x1663('0x17')](queues[_0x2e888e[_0x1663('0xe')]])){utils[_0x1663('0x18')](util[_0x1663('0x10')]('[%s][queues][hangup]',_0x2e888e['uniqueid']),_0x2e888e);if(queues[_0x2e888e[_0x1663('0xe')]][_0x1663('0x19')]){if(!queues[_0x2e888e['uniqueid']][_0x1663('0x1a')]&&!queues[_0x2e888e['uniqueid']][_0x1663('0x1b')]){queues[_0x2e888e[_0x1663('0xe')]]['queuecallercomplete']=!![];queues[_0x2e888e[_0x1663('0xe')]][_0x1663('0x1c')]=utils[_0x1663('0x1d')]();queues[_0x2e888e[_0x1663('0xe')]][_0x1663('0x1e')]=_0x1663('0x1f');}utils['info'](util['format'](_0x1663('0x20'),_0x2e888e[_0x1663('0xe')],queues[_0x2e888e[_0x1663('0xe')]][_0x1663('0x21')],queues[_0x2e888e[_0x1663('0xe')]][_0x1663('0x1e')]));writeDB(queues[_0x2e888e['uniqueid']]);}else if(queues[_0x2e888e[_0x1663('0xe')]][_0x1663('0xd')]){utils[_0x1663('0x2')](util[_0x1663('0x10')](_0x1663('0x22'),_0x2e888e[_0x1663('0xe')],queues[_0x2e888e[_0x1663('0xe')]][_0x1663('0x21')],queues[_0x2e888e[_0x1663('0xe')]][_0x1663('0xd')]));queues[queues[_0x2e888e[_0x1663('0xe')]][_0x1663('0xd')]]=queues[_0x2e888e[_0x1663('0xe')]];queues[queues[_0x2e888e[_0x1663('0xe')]]['transfereduniqueid']][_0x1663('0x23')]=0x2;delete queues[_0x2e888e[_0x1663('0xe')]];}}}catch(_0x4972ac){utils[_0x1663('0x14')](util[_0x1663('0x10')]('[%s][queues][hangup]',_0x2e888e['uniqueid']),_0x4972ac);}};exports['varset']=function(_0x21e36f){try{utils[_0x1663('0x18')](util[_0x1663('0x10')](_0x1663('0x24'),_0x21e36f[_0x1663('0xe')]),_0x21e36f);if(!_['isNil'](_0x21e36f[_0x1663('0x25')]['queuestatus'])&&_0x21e36f[_0x1663('0x26')][_0x1663('0x27')]()!==_0x1663('0x28')){if(!_[_0x1663('0x17')](queues[_0x21e36f[_0x1663('0xe')]])){queues[_0x21e36f['uniqueid']][_0x1663('0x1a')]=![];queues[_0x21e36f[_0x1663('0xe')]][_0x1663('0x29')]=null;queues[_0x21e36f[_0x1663('0xe')]][_0x1663('0x1b')]=!![];queues[_0x21e36f['uniqueid']][_0x1663('0x2a')]=utils[_0x1663('0x1d')]();queues[_0x21e36f[_0x1663('0xe')]][_0x1663('0x1e')]=_0x21e36f[_0x1663('0x26')][_0x1663('0x27')]();utils[_0x1663('0x2')](util[_0x1663('0x10')](_0x1663('0x2b'),_0x21e36f[_0x1663('0xe')],queues[_0x21e36f[_0x1663('0xe')]][_0x1663('0x21')],_0x21e36f[_0x1663('0x26')],queues[_0x21e36f[_0x1663('0xe')]][_0x1663('0x1e')]));writeDB(queues[_0x21e36f[_0x1663('0xe')]]);}}else if(!_[_0x1663('0x17')](_0x21e36f['variable'][_0x1663('0x2c')])){if(!_[_0x1663('0x17')](queues[_0x21e36f['uniqueid']])&&!queues[_0x21e36f[_0x1663('0xe')]][_0x1663('0x1a')]){queues[_0x21e36f[_0x1663('0xe')]][_0x1663('0x1a')]=![];queues[_0x21e36f[_0x1663('0xe')]][_0x1663('0x29')]=null;queues[_0x21e36f[_0x1663('0xe')]]['queuecallerexit']=!![];queues[_0x21e36f[_0x1663('0xe')]][_0x1663('0x2a')]=utils[_0x1663('0x1d')]();queues[_0x21e36f[_0x1663('0xe')]][_0x1663('0x1e')]=_0x1663('0x2d');utils['info'](util[_0x1663('0x10')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x21e36f[_0x1663('0xe')],queues[_0x21e36f[_0x1663('0xe')]][_0x1663('0x21')],_0x21e36f[_0x1663('0x26')],queues[_0x21e36f[_0x1663('0xe')]][_0x1663('0x1e')]));}}}catch(_0x3256a1){utils[_0x1663('0x14')](util[_0x1663('0x10')](_0x1663('0x24'),_0x21e36f[_0x1663('0xe')]),_0x3256a1);}};exports[_0x1663('0x1a')]=function(_0x3a48da){try{if(!_[_0x1663('0x17')](queues[_0x3a48da[_0x1663('0xe')]])){utils[_0x1663('0x18')](util['format'](_0x1663('0x2e'),_0x3a48da[_0x1663('0xe')]),_0x3a48da);queues[_0x3a48da['uniqueid']]['queuecallerexit']=![];queues[_0x3a48da[_0x1663('0xe')]][_0x1663('0x2a')]=null;queues[_0x3a48da['uniqueid']][_0x1663('0x1a')]=!![];queues[_0x3a48da[_0x1663('0xe')]][_0x1663('0x29')]=utils['now']();queues[_0x3a48da[_0x1663('0xe')]][_0x1663('0x1e')]=_0x1663('0x2f');utils[_0x1663('0x2')](util[_0x1663('0x10')](_0x1663('0x30'),_0x3a48da[_0x1663('0xe')],queues[_0x3a48da[_0x1663('0xe')]][_0x1663('0x21')],queues[_0x3a48da[_0x1663('0xe')]][_0x1663('0x1e')]));}}catch(_0x4ee3aa){utils[_0x1663('0x14')](util[_0x1663('0x10')](_0x1663('0x2e'),_0x3a48da[_0x1663('0xe')]),_0x4ee3aa);}};exports['queuecallerleave']=function(_0x2f56ff){try{if(!_[_0x1663('0x17')](queues[_0x2f56ff['uniqueid']])){utils[_0x1663('0x18')](util[_0x1663('0x10')](_0x1663('0x31'),_0x2f56ff[_0x1663('0xe')]),_0x2f56ff);utils[_0x1663('0x2')](util[_0x1663('0x10')](_0x1663('0x32'),_0x2f56ff[_0x1663('0xe')],queues[_0x2f56ff[_0x1663('0xe')]][_0x1663('0x21')],_0x2f56ff[_0x1663('0x33')],_0x2f56ff[_0x1663('0x34')]));queues[_0x2f56ff[_0x1663('0xe')]][_0x1663('0x35')]=!![];queues[_0x2f56ff[_0x1663('0xe')]][_0x1663('0x19')]=utils[_0x1663('0x1d')]();queues[_0x2f56ff[_0x1663('0xe')]][_0x1663('0x36')]=utils[_0x1663('0x37')](queues[_0x2f56ff[_0x1663('0xe')]][_0x1663('0x19')],queues[_0x2f56ff[_0x1663('0xe')]]['queuecallerjoinAt']);queues[_0x2f56ff[_0x1663('0xe')]][_0x1663('0x12')]=_0x2f56ff[_0x1663('0x12')];queues[_0x2f56ff['uniqueid']][_0x1663('0x38')]=_0x2f56ff[_0x1663('0x38')];queues[_0x2f56ff[_0x1663('0xe')]][_0x1663('0x33')]=_0x2f56ff[_0x1663('0x33')];queues[_0x2f56ff[_0x1663('0xe')]][_0x1663('0x34')]=_0x2f56ff[_0x1663('0x34')];}}catch(_0x58f28c){utils[_0x1663('0x14')](util[_0x1663('0x10')](_0x1663('0x31'),_0x2f56ff['uniqueid']),_0x58f28c);}};exports[_0x1663('0x39')]=function(_0x2311d3){try{if(!_[_0x1663('0x17')](queues[_0x2311d3[_0x1663('0xe')]])){utils[_0x1663('0x18')](util[_0x1663('0x10')](_0x1663('0x3a'),_0x2311d3['uniqueid']),_0x2311d3);utils[_0x1663('0x2')](util[_0x1663('0x10')](_0x1663('0x3b'),_0x2311d3[_0x1663('0xe')],queues[_0x2311d3[_0x1663('0xe')]][_0x1663('0x21')],_0x2311d3['membername'],_0x2311d3['destaccountcode']));queues[_0x2311d3[_0x1663('0xe')]][_0x1663('0x1a')]=![];queues[_0x2311d3[_0x1663('0xe')]][_0x1663('0x1a')]=![];queues[_0x2311d3['uniqueid']][_0x1663('0x29')]=null;queues[_0x2311d3['uniqueid']][_0x1663('0x1b')]=![];queues[_0x2311d3[_0x1663('0xe')]][_0x1663('0x1e')]=null;queues[_0x2311d3[_0x1663('0xe')]]['queuecallerexitAt']=null;queues[_0x2311d3['uniqueid']][_0x1663('0x3c')]=!![];queues[_0x2311d3[_0x1663('0xe')]][_0x1663('0x3d')]=_0x2311d3['destaccountcode'];queues[_0x2311d3[_0x1663('0xe')]][_0x1663('0x6')]=_0x2311d3[_0x1663('0x3e')];}}catch(_0x2154fa){utils[_0x1663('0x14')](util['format'](_0x1663('0x3a'),_0x2311d3['uniqueid']),_0x2154fa);}};exports[_0x1663('0x3f')]=function(_0x1e07f3){try{if(!_['isNil'](queues[_0x1e07f3['uniqueid']])){if(queues[_0x1e07f3['uniqueid']]['queuecallerleaveAt']){utils[_0x1663('0x18')](util[_0x1663('0x10')](_0x1663('0x40'),_0x1e07f3[_0x1663('0xe')]),_0x1e07f3);queues[_0x1e07f3['uniqueid']][_0x1663('0x1a')]=![];queues[_0x1e07f3[_0x1663('0xe')]][_0x1663('0x1a')]=![];queues[_0x1e07f3[_0x1663('0xe')]][_0x1663('0x29')]=null;queues[_0x1e07f3[_0x1663('0xe')]]['queuecallerexit']=![];queues[_0x1e07f3[_0x1663('0xe')]][_0x1663('0x2a')]=null;queues[_0x1e07f3[_0x1663('0xe')]]['assigned']=!![];queues[_0x1e07f3[_0x1663('0xe')]][_0x1663('0x6')]=_0x1e07f3[_0x1663('0x3e')];queues[_0x1e07f3[_0x1663('0xe')]]['queuecallercomplete']=!![];queues[_0x1e07f3[_0x1663('0xe')]][_0x1663('0x1c')]=utils['now']();if(_0x1e07f3[_0x1663('0x41')]==_0x1663('0x42')){if(!queues[_0x1e07f3[_0x1663('0xe')]][_0x1663('0x42')]){queues[_0x1e07f3['uniqueid']]['queuecallerexitreason']='TRANSFER';}}else{queues[_0x1e07f3['uniqueid']][_0x1663('0x1e')]=_0x1663('0x43')+_0x1e07f3[_0x1663('0x41')][_0x1663('0x27')]();}utils['info'](util[_0x1663('0x10')](_0x1663('0x44'),_0x1e07f3['uniqueid'],queues[_0x1e07f3[_0x1663('0xe')]]['name'],_0x1e07f3[_0x1663('0x3e')],queues[_0x1e07f3[_0x1663('0xe')]][_0x1663('0x1e')]));writeDB(queues[_0x1e07f3[_0x1663('0xe')]]);}}}catch(_0x5f0a1b){utils[_0x1663('0x14')](util[_0x1663('0x10')](_0x1663('0x40'),_0x1e07f3[_0x1663('0xe')]),_0x5f0a1b);}};exports[_0x1663('0x45')]=function(_0x2cd948){try{if(!_['isNil'](queues[_0x2cd948['transfereeuniqueid']])){utils[_0x1663('0x18')](util[_0x1663('0x10')]('[%s][queues][blindtransfer]',_0x2cd948['uniqueid']),_0x2cd948);queues[_0x2cd948['transfereeuniqueid']]['transfer']=!![];queues[_0x2cd948[_0x1663('0x46')]][_0x1663('0x47')]=_0x1663('0x48');queues[_0x2cd948[_0x1663('0x46')]][_0x1663('0x49')]=_0x2cd948[_0x1663('0x4a')];queues[_0x2cd948['transfereeuniqueid']][_0x1663('0x4b')]=_0x2cd948['transfereeuniqueid'];queues[_0x2cd948['transfereeuniqueid']]['queuecallerexitreason']=_0x1663('0x4c');utils[_0x1663('0x2')](util[_0x1663('0x10')](_0x1663('0x4d'),_0x2cd948['uniqueid'],queues[_0x2cd948[_0x1663('0x46')]][_0x1663('0x21')],_0x2cd948['transfereeuniqueid'],_0x2cd948[_0x1663('0x4a')]));}}catch(_0xf3a9ac){utils[_0x1663('0x14')](util['format'](_0x1663('0x4e'),_0x2cd948['uniqueid']),_0xf3a9ac);}};exports[_0x1663('0x4f')]=function(_0x5a4a23){try{utils[_0x1663('0x18')](util['format'](_0x1663('0x50'),_0x5a4a23['origtransfereruniqueid']),_0x5a4a23);if(_0x5a4a23[_0x1663('0x51')]==_0x5a4a23['origtransfererlinkedid']){if(!_[_0x1663('0x17')](queues[_0x5a4a23[_0x1663('0x52')]])){utils[_0x1663('0x2')](util[_0x1663('0x10')](_0x1663('0x53'),_0x5a4a23[_0x1663('0x51')],queues[_0x5a4a23[_0x1663('0x52')]][_0x1663('0x21')],_0x5a4a23['origtransfererexten']));queues[_0x5a4a23['secondtransfererlinkedid']][_0x1663('0x42')]=!![];queues[_0x5a4a23[_0x1663('0x52')]][_0x1663('0x47')]='ATTENDED';queues[_0x5a4a23[_0x1663('0x52')]][_0x1663('0x49')]=_0x5a4a23[_0x1663('0x54')];queues[_0x5a4a23['secondtransfererlinkedid']][_0x1663('0x4b')]=_0x5a4a23[_0x1663('0x51')];queues[_0x5a4a23['secondtransfererlinkedid']][_0x1663('0x1e')]=_0x1663('0x55');}if(!_[_0x1663('0x17')](queues[_0x5a4a23['origtransfererlinkedid']])){if(_0x5a4a23[_0x1663('0x56')]&&queues[_0x5a4a23[_0x1663('0x56')]]){queues[_0x5a4a23[_0x1663('0x56')]][_0x1663('0x23')]=0x1;queues[_0x5a4a23['transfereeuniqueid']]=_[_0x1663('0x57')](queues[_0x5a4a23[_0x1663('0x56')]]);queues[_0x5a4a23['transfereeuniqueid']][_0x1663('0xd')]=_0x5a4a23['transfertargetuniqueid'];queues[_0x5a4a23[_0x1663('0x46')]][_0x1663('0x23')]=0x2;queues[_0x5a4a23[_0x1663('0x46')]][_0x1663('0x7')]=queues[_0x5a4a23[_0x1663('0x52')]][_0x1663('0x7')];queues[_0x5a4a23['transfereeuniqueid']]['calleridname']=queues[_0x5a4a23['secondtransfererlinkedid']][_0x1663('0x58')];queues[_0x5a4a23[_0x1663('0x46')]][_0x1663('0x59')]=utils['now']();queues[_0x5a4a23['transfereeuniqueid']]['queuecallerleaveAt']=utils['now']();queues[_0x5a4a23[_0x1663('0x46')]]['holdtime']=0x0;queues[_0x5a4a23[_0x1663('0x46')]]['mohtime']=0x0;utils[_0x1663('0x2')](util[_0x1663('0x10')](_0x1663('0x5a'),_0x5a4a23[_0x1663('0x51')],queues[_0x5a4a23[_0x1663('0x46')]][_0x1663('0x21')],queues[_0x5a4a23[_0x1663('0x46')]][_0x1663('0x7')],queues[_0x5a4a23[_0x1663('0x46')]][_0x1663('0x58')]));}else{utils[_0x1663('0x2')](util[_0x1663('0x10')](_0x1663('0x5b'),_0x5a4a23['origtransfereruniqueid'],queues[_0x5a4a23[_0x1663('0x5c')]][_0x1663('0x21')],_0x5a4a23['secondtransfererlinkedid']));queues[_0x5a4a23[_0x1663('0x5c')]][_0x1663('0xd')]=_0x5a4a23['secondtransfererlinkedid'];}}}else if(_0x5a4a23[_0x1663('0x5d')]==_0x5a4a23[_0x1663('0x52')]){if(!_[_0x1663('0x17')](queues[_0x5a4a23[_0x1663('0x5c')]])){utils['info'](util[_0x1663('0x10')](_0x1663('0x5e'),_0x5a4a23['origtransfereruniqueid'],queues[_0x5a4a23[_0x1663('0x5c')]]['name'],_0x5a4a23[_0x1663('0x5d')],_0x5a4a23[_0x1663('0x5f')]));queues[_0x5a4a23[_0x1663('0x5c')]]['transfer']=!![];queues[_0x5a4a23[_0x1663('0x5c')]][_0x1663('0x47')]=_0x1663('0x60');queues[_0x5a4a23[_0x1663('0x5c')]][_0x1663('0x49')]=_0x5a4a23[_0x1663('0x5f')];queues[_0x5a4a23[_0x1663('0x5c')]][_0x1663('0x4b')]=_0x5a4a23[_0x1663('0x5d')];queues[_0x5a4a23[_0x1663('0x5c')]][_0x1663('0x1e')]=_0x1663('0x55');}if(!_[_0x1663('0x17')](queues[_0x5a4a23[_0x1663('0x52')]])){if(_0x5a4a23[_0x1663('0x61')]&&queues[_0x5a4a23[_0x1663('0x61')]]){queues[_0x5a4a23[_0x1663('0x61')]]['queuecallerenterreason']=0x1;queues[_0x5a4a23[_0x1663('0x62')]]=_[_0x1663('0x57')](queues[_0x5a4a23[_0x1663('0x61')]]);queues[_0x5a4a23['transfertargetuniqueid']][_0x1663('0xd')]=_0x5a4a23[_0x1663('0x62')];queues[_0x5a4a23[_0x1663('0x62')]]['queuecallerenterreason']=0x2;queues[_0x5a4a23[_0x1663('0x62')]][_0x1663('0x7')]=queues[_0x5a4a23['origtransfererlinkedid']][_0x1663('0x7')];queues[_0x5a4a23[_0x1663('0x62')]]['calleridname']=queues[_0x5a4a23[_0x1663('0x5c')]][_0x1663('0x58')];queues[_0x5a4a23[_0x1663('0x62')]][_0x1663('0x59')]=utils[_0x1663('0x1d')]();queues[_0x5a4a23[_0x1663('0x62')]][_0x1663('0x19')]=utils[_0x1663('0x1d')]();queues[_0x5a4a23['transfertargetuniqueid']]['holdtime']=0x0;queues[_0x5a4a23['transfertargetuniqueid']][_0x1663('0x63')]=0x0;utils[_0x1663('0x2')](util['format'](_0x1663('0x64'),_0x5a4a23[_0x1663('0x51')],queues[_0x5a4a23[_0x1663('0x62')]][_0x1663('0x21')],queues[_0x5a4a23[_0x1663('0x62')]][_0x1663('0xd')],queues[_0x5a4a23['transfertargetuniqueid']]['calleridnum'],queues[_0x5a4a23['transfertargetuniqueid']]['calleridname']));}else{utils['info'](util['format'](_0x1663('0x5b'),_0x5a4a23[_0x1663('0x51')],queues[_0x5a4a23['secondtransfererlinkedid']][_0x1663('0x21')],_0x5a4a23[_0x1663('0x5c')]));queues[_0x5a4a23[_0x1663('0x52')]][_0x1663('0xd')]=_0x5a4a23[_0x1663('0x5c')];}}}}catch(_0x4b5c39){utils[_0x1663('0x14')](util[_0x1663('0x10')](_0x1663('0x50'),_0x5a4a23['origtransfereruniqueid']),_0x4b5c39);}};exports[_0x1663('0x65')]=function(_0x7b3cc0){try{if(!_[_0x1663('0x17')](queues[_0x7b3cc0[_0x1663('0xe')]])){utils[_0x1663('0x18')](util['format']('[%s][queues][musiconholdstart]',_0x7b3cc0[_0x1663('0xe')]),_0x7b3cc0);queues[_0x7b3cc0[_0x1663('0xe')]][_0x1663('0x66')]=utils[_0x1663('0x1d')]();utils[_0x1663('0x2')](util[_0x1663('0x10')](_0x1663('0x67'),_0x7b3cc0[_0x1663('0xe')],queues[_0x7b3cc0[_0x1663('0xe')]][_0x1663('0x21')],queues[_0x7b3cc0['uniqueid']][_0x1663('0x66')]));}}catch(_0x4eddee){utils[_0x1663('0x14')](util[_0x1663('0x10')]('[%s][queues][musiconholdstart]',_0x7b3cc0['uniqueid']),_0x4eddee);}};exports['musiconholdstop']=function(_0x9948cb){try{if(!_['isNil'](queues[_0x9948cb['uniqueid']])){if(!_['isNil'](queues[_0x9948cb[_0x1663('0xe')]][_0x1663('0x66')])){utils['debug'](util['format']('[%s][queues][musiconholdstop]',_0x9948cb[_0x1663('0xe')]),_0x9948cb);queues[_0x9948cb[_0x1663('0xe')]][_0x1663('0x63')]+=utils[_0x1663('0x37')](utils[_0x1663('0x1d')](),queues[_0x9948cb[_0x1663('0xe')]]['musiconholdstartAt']);utils['info'](util[_0x1663('0x10')](_0x1663('0x68'),_0x9948cb['uniqueid'],queues[_0x9948cb['uniqueid']][_0x1663('0x21')],queues[_0x9948cb[_0x1663('0xe')]][_0x1663('0x63')]));delete queues[_0x9948cb[_0x1663('0xe')]]['musiconholdstartAt'];}}}catch(_0x5a991b){utils[_0x1663('0x14')](util['format'](_0x1663('0x69'),_0x9948cb[_0x1663('0xe')]),_0x5a991b);}}; \ No newline at end of file +var _0xfe88=['now','error','hangup','isNil','debug','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','name','varset','[%s][queues][varset]','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexit','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','variable','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','holdtime','diffTime','queuecallerjoinAt','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','agentcomplete','[%s][queues][agentcomplete]','queuecallercomplete','queuecallercompleteAt','transfer','TRANSFER','reason','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','transfertype','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','[%s][queues][blindtransfer]','[%s][queues][attendedtransfer]','origtransfereruniqueid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','origtransfererlinkedid','transfereelinkedid','queuecallerenterreason','clone','transfertargetuniqueid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfereruniqueid','secondtransfererexten','ATTENDED','ATTENDEDTRANSFER','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','[%s][queues][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','channel','queue','lastAssignedTo','calleridnum','queuecallerexitreason','then','type','request','CreateVoiceQueueReport','transfereduniqueid','uniqueid','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign'];(function(_0x219783,_0x186863){var _0x38be00=function(_0x269107){while(--_0x269107){_0x219783['push'](_0x219783['shift']());}};_0x38be00(++_0x186863);}(_0xfe88,0x181));var _0x8fe8=function(_0x708c47,_0x6eaa1f){_0x708c47=_0x708c47-0x0;var _0x52a470=_0xfe88[_0x708c47];return _0x52a470;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x8fe8('0x0'));var queues={};function writeDB(_0x218e77){utils[_0x8fe8('0x1')](util[_0x8fe8('0x2')](_0x8fe8('0x3'),_0x218e77['uniqueid'],_0x218e77[_0x8fe8('0x4')],_0x218e77[_0x8fe8('0x5')],_0x218e77[_0x8fe8('0x6')],_0x218e77[_0x8fe8('0x7')],_0x218e77['accountcode'],_0x218e77[_0x8fe8('0x8')]));if(_0x218e77[_0x8fe8('0x5')]){utils['getVoiceQueueByName'](_0x218e77['queue'])[_0x8fe8('0x9')](function(_0x2e2eea){if(_0x2e2eea){_0x218e77[_0x8fe8('0xa')]=_0x2e2eea['type'];}utils[_0x8fe8('0xb')](_0x8fe8('0xc'),_0x218e77);});}else{utils['request'](_0x8fe8('0xc'),_0x218e77);}if(_0x218e77[_0x8fe8('0xd')]){delete queues[_0x218e77[_0x8fe8('0xd')]];}else{delete queues[_0x218e77[_0x8fe8('0xe')]];}}exports['queuecallerjoin']=function(_0x2b4ac5){try{utils['debug'](util[_0x8fe8('0x2')](_0x8fe8('0xf'),_0x2b4ac5[_0x8fe8('0xe')]),_0x2b4ac5);utils[_0x8fe8('0x1')](util[_0x8fe8('0x2')](_0x8fe8('0x10'),_0x2b4ac5[_0x8fe8('0xe')],_0x2b4ac5['queue'],_0x2b4ac5[_0x8fe8('0x11')]));queues[_0x2b4ac5[_0x8fe8('0xe')]]=_[_0x8fe8('0x12')](_0x2b4ac5,{'originalposition':_0x2b4ac5[_0x8fe8('0x11')],'queuecallerjoinAt':utils[_0x8fe8('0x13')](),'mohtime':0x0});}catch(_0x249196){utils[_0x8fe8('0x14')](util[_0x8fe8('0x2')]('[%s][queues][queuecallerjoin]',_0x2b4ac5[_0x8fe8('0xe')]),_0x249196);}};exports[_0x8fe8('0x15')]=function(_0x580070){try{if(!_[_0x8fe8('0x16')](queues[_0x580070[_0x8fe8('0xe')]])){utils[_0x8fe8('0x17')](util['format'](_0x8fe8('0x18'),_0x580070[_0x8fe8('0xe')]),_0x580070);if(queues[_0x580070['uniqueid']][_0x8fe8('0x19')]){if(!queues[_0x580070[_0x8fe8('0xe')]][_0x8fe8('0x1a')]&&!queues[_0x580070[_0x8fe8('0xe')]]['queuecallerexit']){queues[_0x580070['uniqueid']]['queuecallercomplete']=!![];queues[_0x580070['uniqueid']]['queuecallercompleteAt']=utils['now']();queues[_0x580070[_0x8fe8('0xe')]][_0x8fe8('0x8')]=_0x8fe8('0x1b');}utils[_0x8fe8('0x1')](util['format']('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x580070['uniqueid'],queues[_0x580070[_0x8fe8('0xe')]]['name'],queues[_0x580070['uniqueid']][_0x8fe8('0x8')]));writeDB(queues[_0x580070['uniqueid']]);}else if(queues[_0x580070[_0x8fe8('0xe')]][_0x8fe8('0xd')]){utils['info'](util[_0x8fe8('0x2')](_0x8fe8('0x1c'),_0x580070[_0x8fe8('0xe')],queues[_0x580070[_0x8fe8('0xe')]][_0x8fe8('0x1d')],queues[_0x580070[_0x8fe8('0xe')]][_0x8fe8('0xd')]));queues[queues[_0x580070[_0x8fe8('0xe')]]['transfereduniqueid']]=queues[_0x580070[_0x8fe8('0xe')]];queues[queues[_0x580070[_0x8fe8('0xe')]][_0x8fe8('0xd')]]['queuecallerenterreason']=0x2;delete queues[_0x580070[_0x8fe8('0xe')]];}}}catch(_0x216350){utils[_0x8fe8('0x14')](util[_0x8fe8('0x2')](_0x8fe8('0x18'),_0x580070[_0x8fe8('0xe')]),_0x216350);}};exports[_0x8fe8('0x1e')]=function(_0x5003da){try{utils['debug'](util['format'](_0x8fe8('0x1f'),_0x5003da['uniqueid']),_0x5003da);if(!_[_0x8fe8('0x16')](_0x5003da['variable'][_0x8fe8('0x20')])&&_0x5003da[_0x8fe8('0x21')][_0x8fe8('0x22')]()!==_0x8fe8('0x23')){if(!_[_0x8fe8('0x16')](queues[_0x5003da[_0x8fe8('0xe')]])){queues[_0x5003da[_0x8fe8('0xe')]][_0x8fe8('0x1a')]=![];queues[_0x5003da[_0x8fe8('0xe')]][_0x8fe8('0x24')]=null;queues[_0x5003da[_0x8fe8('0xe')]][_0x8fe8('0x25')]=!![];queues[_0x5003da[_0x8fe8('0xe')]][_0x8fe8('0x26')]=utils['now']();queues[_0x5003da['uniqueid']]['queuecallerexitreason']=_0x5003da['value'][_0x8fe8('0x22')]();utils[_0x8fe8('0x1')](util[_0x8fe8('0x2')](_0x8fe8('0x27'),_0x5003da[_0x8fe8('0xe')],queues[_0x5003da[_0x8fe8('0xe')]][_0x8fe8('0x1d')],_0x5003da[_0x8fe8('0x21')],queues[_0x5003da[_0x8fe8('0xe')]]['queuecallerexitreason']));writeDB(queues[_0x5003da[_0x8fe8('0xe')]]);}}else if(!_[_0x8fe8('0x16')](_0x5003da[_0x8fe8('0x28')]['queueposition'])){if(!_[_0x8fe8('0x16')](queues[_0x5003da[_0x8fe8('0xe')]])&&!queues[_0x5003da[_0x8fe8('0xe')]][_0x8fe8('0x1a')]){queues[_0x5003da[_0x8fe8('0xe')]][_0x8fe8('0x1a')]=![];queues[_0x5003da[_0x8fe8('0xe')]][_0x8fe8('0x24')]=null;queues[_0x5003da[_0x8fe8('0xe')]]['queuecallerexit']=!![];queues[_0x5003da[_0x8fe8('0xe')]][_0x8fe8('0x26')]=utils[_0x8fe8('0x13')]();queues[_0x5003da[_0x8fe8('0xe')]][_0x8fe8('0x8')]=_0x8fe8('0x29');utils[_0x8fe8('0x1')](util[_0x8fe8('0x2')](_0x8fe8('0x2a'),_0x5003da[_0x8fe8('0xe')],queues[_0x5003da['uniqueid']]['name'],_0x5003da[_0x8fe8('0x21')],queues[_0x5003da[_0x8fe8('0xe')]][_0x8fe8('0x8')]));}}}catch(_0x5c5708){utils[_0x8fe8('0x14')](util[_0x8fe8('0x2')]('[%s][queues][varset]',_0x5003da[_0x8fe8('0xe')]),_0x5c5708);}};exports[_0x8fe8('0x1a')]=function(_0x150bb5){try{if(!_['isNil'](queues[_0x150bb5[_0x8fe8('0xe')]])){utils['debug'](util['format'](_0x8fe8('0x2b'),_0x150bb5['uniqueid']),_0x150bb5);queues[_0x150bb5[_0x8fe8('0xe')]]['queuecallerexit']=![];queues[_0x150bb5[_0x8fe8('0xe')]][_0x8fe8('0x26')]=null;queues[_0x150bb5[_0x8fe8('0xe')]]['queuecallerabandon']=!![];queues[_0x150bb5[_0x8fe8('0xe')]][_0x8fe8('0x24')]=utils[_0x8fe8('0x13')]();queues[_0x150bb5[_0x8fe8('0xe')]][_0x8fe8('0x8')]='ABANDONED';utils[_0x8fe8('0x1')](util[_0x8fe8('0x2')](_0x8fe8('0x2c'),_0x150bb5[_0x8fe8('0xe')],queues[_0x150bb5[_0x8fe8('0xe')]][_0x8fe8('0x1d')],queues[_0x150bb5['uniqueid']][_0x8fe8('0x8')]));}}catch(_0xbe9a51){utils[_0x8fe8('0x14')](util[_0x8fe8('0x2')](_0x8fe8('0x2b'),_0x150bb5[_0x8fe8('0xe')]),_0xbe9a51);}};exports[_0x8fe8('0x2d')]=function(_0x18e576){try{if(!_['isNil'](queues[_0x18e576[_0x8fe8('0xe')]])){utils[_0x8fe8('0x17')](util[_0x8fe8('0x2')](_0x8fe8('0x2e'),_0x18e576[_0x8fe8('0xe')]),_0x18e576);utils[_0x8fe8('0x1')](util['format'](_0x8fe8('0x2f'),_0x18e576[_0x8fe8('0xe')],queues[_0x18e576[_0x8fe8('0xe')]][_0x8fe8('0x1d')],_0x18e576[_0x8fe8('0x30')],_0x18e576[_0x8fe8('0x31')]));queues[_0x18e576[_0x8fe8('0xe')]][_0x8fe8('0x2d')]=!![];queues[_0x18e576[_0x8fe8('0xe')]][_0x8fe8('0x19')]=utils[_0x8fe8('0x13')]();queues[_0x18e576[_0x8fe8('0xe')]][_0x8fe8('0x32')]=utils[_0x8fe8('0x33')](queues[_0x18e576[_0x8fe8('0xe')]][_0x8fe8('0x19')],queues[_0x18e576[_0x8fe8('0xe')]][_0x8fe8('0x34')]);queues[_0x18e576[_0x8fe8('0xe')]][_0x8fe8('0x11')]=_0x18e576[_0x8fe8('0x11')];queues[_0x18e576[_0x8fe8('0xe')]]['count']=_0x18e576['count'];queues[_0x18e576[_0x8fe8('0xe')]][_0x8fe8('0x30')]=_0x18e576[_0x8fe8('0x30')];queues[_0x18e576[_0x8fe8('0xe')]][_0x8fe8('0x31')]=_0x18e576['connectedlinename'];}}catch(_0x35c444){utils[_0x8fe8('0x14')](util[_0x8fe8('0x2')](_0x8fe8('0x2e'),_0x18e576[_0x8fe8('0xe')]),_0x35c444);}};exports[_0x8fe8('0x35')]=function(_0x31abfe){try{if(!_['isNil'](queues[_0x31abfe[_0x8fe8('0xe')]])){utils[_0x8fe8('0x17')](util[_0x8fe8('0x2')](_0x8fe8('0x36'),_0x31abfe[_0x8fe8('0xe')]),_0x31abfe);utils['info'](util[_0x8fe8('0x2')](_0x8fe8('0x37'),_0x31abfe[_0x8fe8('0xe')],queues[_0x31abfe[_0x8fe8('0xe')]][_0x8fe8('0x1d')],_0x31abfe[_0x8fe8('0x38')],_0x31abfe[_0x8fe8('0x39')]));queues[_0x31abfe[_0x8fe8('0xe')]][_0x8fe8('0x1a')]=![];queues[_0x31abfe[_0x8fe8('0xe')]][_0x8fe8('0x1a')]=![];queues[_0x31abfe['uniqueid']]['queuecallerabandonAt']=null;queues[_0x31abfe[_0x8fe8('0xe')]][_0x8fe8('0x25')]=![];queues[_0x31abfe[_0x8fe8('0xe')]][_0x8fe8('0x8')]=null;queues[_0x31abfe[_0x8fe8('0xe')]][_0x8fe8('0x26')]=null;queues[_0x31abfe[_0x8fe8('0xe')]][_0x8fe8('0x3a')]=!![];queues[_0x31abfe[_0x8fe8('0xe')]]['accountcode']=_0x31abfe['destaccountcode'];queues[_0x31abfe[_0x8fe8('0xe')]]['lastAssignedTo']=_0x31abfe['membername'];}}catch(_0x3166d1){utils[_0x8fe8('0x14')](util[_0x8fe8('0x2')](_0x8fe8('0x36'),_0x31abfe[_0x8fe8('0xe')]),_0x3166d1);}};exports[_0x8fe8('0x3b')]=function(_0x62ad16){try{if(!_[_0x8fe8('0x16')](queues[_0x62ad16[_0x8fe8('0xe')]])){if(queues[_0x62ad16[_0x8fe8('0xe')]][_0x8fe8('0x19')]){utils['debug'](util[_0x8fe8('0x2')](_0x8fe8('0x3c'),_0x62ad16[_0x8fe8('0xe')]),_0x62ad16);queues[_0x62ad16[_0x8fe8('0xe')]]['queuecallerabandon']=![];queues[_0x62ad16[_0x8fe8('0xe')]][_0x8fe8('0x1a')]=![];queues[_0x62ad16[_0x8fe8('0xe')]][_0x8fe8('0x24')]=null;queues[_0x62ad16['uniqueid']][_0x8fe8('0x25')]=![];queues[_0x62ad16[_0x8fe8('0xe')]][_0x8fe8('0x26')]=null;queues[_0x62ad16[_0x8fe8('0xe')]][_0x8fe8('0x3a')]=!![];queues[_0x62ad16['uniqueid']][_0x8fe8('0x6')]=_0x62ad16[_0x8fe8('0x38')];queues[_0x62ad16['uniqueid']][_0x8fe8('0x3d')]=!![];queues[_0x62ad16[_0x8fe8('0xe')]][_0x8fe8('0x3e')]=utils[_0x8fe8('0x13')]();if(_0x62ad16['reason']=='transfer'){if(!queues[_0x62ad16[_0x8fe8('0xe')]][_0x8fe8('0x3f')]){queues[_0x62ad16[_0x8fe8('0xe')]][_0x8fe8('0x8')]=_0x8fe8('0x40');}}else{queues[_0x62ad16[_0x8fe8('0xe')]][_0x8fe8('0x8')]='COMPLETEDBY'+_0x62ad16[_0x8fe8('0x41')]['toUpperCase']();}utils[_0x8fe8('0x1')](util[_0x8fe8('0x2')](_0x8fe8('0x42'),_0x62ad16[_0x8fe8('0xe')],queues[_0x62ad16['uniqueid']][_0x8fe8('0x1d')],_0x62ad16[_0x8fe8('0x38')],queues[_0x62ad16[_0x8fe8('0xe')]]['queuecallerexitreason']));writeDB(queues[_0x62ad16[_0x8fe8('0xe')]]);}}}catch(_0x59cb8e){utils['error'](util[_0x8fe8('0x2')](_0x8fe8('0x3c'),_0x62ad16['uniqueid']),_0x59cb8e);}};exports[_0x8fe8('0x43')]=function(_0x26923c){try{if(!_['isNil'](queues[_0x26923c[_0x8fe8('0x44')]])){utils[_0x8fe8('0x17')](util['format']('[%s][queues][blindtransfer]',_0x26923c[_0x8fe8('0xe')]),_0x26923c);queues[_0x26923c[_0x8fe8('0x44')]][_0x8fe8('0x3f')]=!![];queues[_0x26923c[_0x8fe8('0x44')]][_0x8fe8('0x45')]='BLIND';queues[_0x26923c[_0x8fe8('0x44')]][_0x8fe8('0x46')]=_0x26923c[_0x8fe8('0x47')];queues[_0x26923c['transfereeuniqueid']][_0x8fe8('0x48')]=_0x26923c['transfereeuniqueid'];queues[_0x26923c[_0x8fe8('0x44')]][_0x8fe8('0x8')]=_0x8fe8('0x49');utils[_0x8fe8('0x1')](util[_0x8fe8('0x2')](_0x8fe8('0x4a'),_0x26923c[_0x8fe8('0xe')],queues[_0x26923c[_0x8fe8('0x44')]]['name'],_0x26923c[_0x8fe8('0x44')],_0x26923c[_0x8fe8('0x47')]));}}catch(_0x481fa2){utils[_0x8fe8('0x14')](util[_0x8fe8('0x2')](_0x8fe8('0x4b'),_0x26923c['uniqueid']),_0x481fa2);}};exports['attendedtransfer']=function(_0x10878c){try{utils['debug'](util['format'](_0x8fe8('0x4c'),_0x10878c['origtransfereruniqueid']),_0x10878c);if(_0x10878c[_0x8fe8('0x4d')]==_0x10878c['origtransfererlinkedid']){if(!_[_0x8fe8('0x16')](queues[_0x10878c[_0x8fe8('0x4e')]])){utils['info'](util[_0x8fe8('0x2')](_0x8fe8('0x4f'),_0x10878c['origtransfereruniqueid'],queues[_0x10878c['secondtransfererlinkedid']][_0x8fe8('0x1d')],_0x10878c[_0x8fe8('0x50')]));queues[_0x10878c[_0x8fe8('0x4e')]][_0x8fe8('0x3f')]=!![];queues[_0x10878c[_0x8fe8('0x4e')]]['transfertype']='ATTENDED';queues[_0x10878c[_0x8fe8('0x4e')]][_0x8fe8('0x46')]=_0x10878c[_0x8fe8('0x50')];queues[_0x10878c['secondtransfererlinkedid']]['transferuniqueid']=_0x10878c['origtransfereruniqueid'];queues[_0x10878c['secondtransfererlinkedid']][_0x8fe8('0x8')]='ATTENDEDTRANSFER';}if(!_[_0x8fe8('0x16')](queues[_0x10878c[_0x8fe8('0x51')]])){if(_0x10878c[_0x8fe8('0x52')]&&queues[_0x10878c[_0x8fe8('0x52')]]){queues[_0x10878c['transfereelinkedid']][_0x8fe8('0x53')]=0x1;queues[_0x10878c[_0x8fe8('0x44')]]=_[_0x8fe8('0x54')](queues[_0x10878c['transfereelinkedid']]);queues[_0x10878c['transfereeuniqueid']]['transfereduniqueid']=_0x10878c[_0x8fe8('0x55')];queues[_0x10878c[_0x8fe8('0x44')]]['queuecallerenterreason']=0x2;queues[_0x10878c['transfereeuniqueid']][_0x8fe8('0x7')]=queues[_0x10878c[_0x8fe8('0x4e')]]['calleridnum'];queues[_0x10878c[_0x8fe8('0x44')]]['calleridname']=queues[_0x10878c[_0x8fe8('0x4e')]][_0x8fe8('0x56')];queues[_0x10878c[_0x8fe8('0x44')]][_0x8fe8('0x34')]=utils['now']();queues[_0x10878c[_0x8fe8('0x44')]][_0x8fe8('0x19')]=utils[_0x8fe8('0x13')]();queues[_0x10878c[_0x8fe8('0x44')]][_0x8fe8('0x32')]=0x0;queues[_0x10878c[_0x8fe8('0x44')]][_0x8fe8('0x57')]=0x0;utils[_0x8fe8('0x1')](util[_0x8fe8('0x2')](_0x8fe8('0x58'),_0x10878c[_0x8fe8('0x4d')],queues[_0x10878c[_0x8fe8('0x44')]][_0x8fe8('0x1d')],queues[_0x10878c[_0x8fe8('0x44')]][_0x8fe8('0x7')],queues[_0x10878c[_0x8fe8('0x44')]]['calleridname']));}else{utils[_0x8fe8('0x1')](util[_0x8fe8('0x2')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x10878c[_0x8fe8('0x4d')],queues[_0x10878c[_0x8fe8('0x51')]][_0x8fe8('0x1d')],_0x10878c['secondtransfererlinkedid']));queues[_0x10878c['origtransfererlinkedid']][_0x8fe8('0xd')]=_0x10878c[_0x8fe8('0x4e')];}}}else if(_0x10878c['secondtransfereruniqueid']==_0x10878c[_0x8fe8('0x4e')]){if(!_['isNil'](queues[_0x10878c[_0x8fe8('0x51')]])){utils['info'](util['format'](_0x8fe8('0x59'),_0x10878c['origtransfereruniqueid'],queues[_0x10878c[_0x8fe8('0x51')]][_0x8fe8('0x1d')],_0x10878c[_0x8fe8('0x5a')],_0x10878c[_0x8fe8('0x5b')]));queues[_0x10878c[_0x8fe8('0x51')]]['transfer']=!![];queues[_0x10878c[_0x8fe8('0x51')]]['transfertype']=_0x8fe8('0x5c');queues[_0x10878c[_0x8fe8('0x51')]][_0x8fe8('0x46')]=_0x10878c[_0x8fe8('0x5b')];queues[_0x10878c[_0x8fe8('0x51')]]['transferuniqueid']=_0x10878c['secondtransfereruniqueid'];queues[_0x10878c['origtransfererlinkedid']][_0x8fe8('0x8')]=_0x8fe8('0x5d');}if(!_[_0x8fe8('0x16')](queues[_0x10878c['secondtransfererlinkedid']])){if(_0x10878c['transfertargetlinkedid']&&queues[_0x10878c[_0x8fe8('0x5e')]]){queues[_0x10878c[_0x8fe8('0x5e')]][_0x8fe8('0x53')]=0x1;queues[_0x10878c[_0x8fe8('0x55')]]=_[_0x8fe8('0x54')](queues[_0x10878c[_0x8fe8('0x5e')]]);queues[_0x10878c[_0x8fe8('0x55')]]['transfereduniqueid']=_0x10878c[_0x8fe8('0x55')];queues[_0x10878c[_0x8fe8('0x55')]]['queuecallerenterreason']=0x2;queues[_0x10878c['transfertargetuniqueid']][_0x8fe8('0x7')]=queues[_0x10878c['origtransfererlinkedid']]['calleridnum'];queues[_0x10878c[_0x8fe8('0x55')]][_0x8fe8('0x56')]=queues[_0x10878c[_0x8fe8('0x51')]][_0x8fe8('0x56')];queues[_0x10878c[_0x8fe8('0x55')]][_0x8fe8('0x34')]=utils[_0x8fe8('0x13')]();queues[_0x10878c[_0x8fe8('0x55')]][_0x8fe8('0x19')]=utils['now']();queues[_0x10878c[_0x8fe8('0x55')]][_0x8fe8('0x32')]=0x0;queues[_0x10878c['transfertargetuniqueid']]['mohtime']=0x0;utils[_0x8fe8('0x1')](util['format'](_0x8fe8('0x5f'),_0x10878c['origtransfereruniqueid'],queues[_0x10878c[_0x8fe8('0x55')]]['name'],queues[_0x10878c['transfertargetuniqueid']]['transfereduniqueid'],queues[_0x10878c['transfertargetuniqueid']][_0x8fe8('0x7')],queues[_0x10878c[_0x8fe8('0x55')]][_0x8fe8('0x56')]));}else{utils[_0x8fe8('0x1')](util[_0x8fe8('0x2')](_0x8fe8('0x60'),_0x10878c[_0x8fe8('0x4d')],queues[_0x10878c['secondtransfererlinkedid']][_0x8fe8('0x1d')],_0x10878c[_0x8fe8('0x51')]));queues[_0x10878c['secondtransfererlinkedid']][_0x8fe8('0xd')]=_0x10878c[_0x8fe8('0x51')];}}}}catch(_0x2cdde1){utils['error'](util[_0x8fe8('0x2')](_0x8fe8('0x4c'),_0x10878c[_0x8fe8('0x4d')]),_0x2cdde1);}};exports['musiconholdstart']=function(_0x12cca9){try{if(!_['isNil'](queues[_0x12cca9[_0x8fe8('0xe')]])){utils['debug'](util[_0x8fe8('0x2')](_0x8fe8('0x61'),_0x12cca9[_0x8fe8('0xe')]),_0x12cca9);queues[_0x12cca9[_0x8fe8('0xe')]][_0x8fe8('0x62')]=utils[_0x8fe8('0x13')]();utils[_0x8fe8('0x1')](util[_0x8fe8('0x2')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x12cca9['uniqueid'],queues[_0x12cca9[_0x8fe8('0xe')]][_0x8fe8('0x1d')],queues[_0x12cca9['uniqueid']]['musiconholdstartAt']));}}catch(_0x481fe1){utils[_0x8fe8('0x14')](util[_0x8fe8('0x2')]('[%s][queues][musiconholdstart]',_0x12cca9[_0x8fe8('0xe')]),_0x481fe1);}};exports[_0x8fe8('0x63')]=function(_0x1c3259){try{if(!_[_0x8fe8('0x16')](queues[_0x1c3259[_0x8fe8('0xe')]])){if(!_[_0x8fe8('0x16')](queues[_0x1c3259[_0x8fe8('0xe')]][_0x8fe8('0x62')])){utils[_0x8fe8('0x17')](util[_0x8fe8('0x2')]('[%s][queues][musiconholdstop]',_0x1c3259['uniqueid']),_0x1c3259);queues[_0x1c3259[_0x8fe8('0xe')]][_0x8fe8('0x57')]+=utils[_0x8fe8('0x33')](utils[_0x8fe8('0x13')](),queues[_0x1c3259[_0x8fe8('0xe')]][_0x8fe8('0x62')]);utils['info'](util[_0x8fe8('0x2')]('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x1c3259[_0x8fe8('0xe')],queues[_0x1c3259['uniqueid']][_0x8fe8('0x1d')],queues[_0x1c3259['uniqueid']][_0x8fe8('0x57')]));delete queues[_0x1c3259[_0x8fe8('0xe')]][_0x8fe8('0x62')];}}}catch(_0x49f0bf){utils[_0x8fe8('0x14')](util[_0x8fe8('0x2')](_0x8fe8('0x64'),_0x1c3259[_0x8fe8('0xe')]),_0x49f0bf);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 5d91322..9d8da04 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 _0xd0a0=['forEach','clone','[%s][recordings][hangup]','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','startsWith','cdr','appdata','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','util','./utils','info','format','[%s][recordings][writeDB]','uniqueid','accountcode','then','UserId','request','CreateVoiceRecording','debug','[%s][recordings][newchannel]','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','exten','error','newstate','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','context','linkedid','transfer','channel','varset','variable','mixmonitor_filename','[%s][recordings][varset]','value','.wav49','replace','.WAV','monitors','hangup','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','outbound'];(function(_0x35893a,_0x4ca48a){var _0x34d2d9=function(_0x459fcd){while(--_0x459fcd){_0x35893a['push'](_0x35893a['shift']());}};_0x34d2d9(++_0x4ca48a);}(_0xd0a0,0x149));var _0x0d0a=function(_0x24c027,_0x50e009){_0x24c027=_0x24c027-0x0;var _0x2b8d7c=_0xd0a0[_0x24c027];return _0x2b8d7c;};'use strict';var _=require(_0x0d0a('0x0'));var util=require(_0x0d0a('0x1'));var utils=require(_0x0d0a('0x2'));var recordings={};function writeDB(_0x2ea485){utils[_0x0d0a('0x3')](util[_0x0d0a('0x4')](_0x0d0a('0x5'),_0x2ea485[_0x0d0a('0x6')]));if(_0x2ea485['accountcode']){utils['getUserByInternal'](_0x2ea485[_0x0d0a('0x7')])[_0x0d0a('0x8')](function(_0x5c3f52){if(_0x5c3f52){_0x2ea485['membername']=_0x5c3f52['name'];_0x2ea485[_0x0d0a('0x9')]=_0x5c3f52['id'];}utils[_0x0d0a('0xa')]('CreateVoiceRecording',_0x2ea485);});}else{utils[_0x0d0a('0xa')](_0x0d0a('0xb'),_0x2ea485);}}exports['newchannel']=function(_0x2ccf06){try{utils[_0x0d0a('0xc')](util[_0x0d0a('0x4')](_0x0d0a('0xd'),_0x2ccf06[_0x0d0a('0x6')]),_0x2ccf06);if(_0x2ccf06[_0x0d0a('0x6')]==_0x2ccf06['linkedid']){utils[_0x0d0a('0x3')](util[_0x0d0a('0x4')](_0x0d0a('0xe'),_0x2ccf06[_0x0d0a('0x6')],_0x2ccf06['context'],_0x2ccf06[_0x0d0a('0xf')]));recordings[_0x2ccf06[_0x0d0a('0x6')]]={'uniqueid':_0x2ccf06['uniqueid'],'accountcode':_0x2ccf06[_0x0d0a('0x7')],'exten':_0x2ccf06[_0x0d0a('0xf')],'context':_0x2ccf06['context'],'channel':_0x2ccf06['channel'],'monitors':[]};}}catch(_0x262b09){utils[_0x0d0a('0x10')](util[_0x0d0a('0x4')](_0x0d0a('0xd'),_0x2ccf06[_0x0d0a('0x6')]),_0x262b09);}};exports[_0x0d0a('0x11')]=function(_0x13a548){try{utils[_0x0d0a('0xc')](util['format'](_0x0d0a('0x12'),_0x13a548[_0x0d0a('0x6')]),_0x13a548);if(!_[_0x0d0a('0x13')](recordings[_0x13a548[_0x0d0a('0x6')]])&&_0x13a548[_0x0d0a('0x14')]==0x6){utils[_0x0d0a('0x3')](util[_0x0d0a('0x4')](_0x0d0a('0x15'),_0x13a548['uniqueid'],_0x13a548[_0x0d0a('0x16')],_0x13a548['channel']));}else if(!_[_0x0d0a('0x13')](recordings[_0x13a548[_0x0d0a('0x17')]])&&_0x13a548[_0x0d0a('0x14')]==0x6&&_0x13a548[_0x0d0a('0x16')]!=_0x0d0a('0x18')){utils[_0x0d0a('0x3')](util[_0x0d0a('0x4')]('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x13a548[_0x0d0a('0x6')],_0x13a548[_0x0d0a('0x17')],_0x13a548['context'],_0x13a548[_0x0d0a('0x19')]));recordings[_0x13a548['linkedid']][_0x0d0a('0x7')]=_0x13a548['accountcode'];}}catch(_0x50baa9){utils['error'](util[_0x0d0a('0x4')](_0x0d0a('0x12'),_0x13a548[_0x0d0a('0x6')]),_0x50baa9);}};exports[_0x0d0a('0x1a')]=function(_0x525887){try{if(!_[_0x0d0a('0x13')](_0x525887[_0x0d0a('0x1b')])&&!_[_0x0d0a('0x13')](_0x525887[_0x0d0a('0x1b')][_0x0d0a('0x1c')])){utils[_0x0d0a('0xc')](util['format'](_0x0d0a('0x1d'),_0x525887[_0x0d0a('0x6')]),_0x525887);utils[_0x0d0a('0x3')](util[_0x0d0a('0x4')]('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x525887[_0x0d0a('0x6')],_0x525887['variable'],_0x525887[_0x0d0a('0x1e')]));if(_['endsWith'](_0x525887[_0x0d0a('0x1e')],_0x0d0a('0x1f'))){_0x525887[_0x0d0a('0x1e')]=_0x525887[_0x0d0a('0x1e')][_0x0d0a('0x20')](_0x0d0a('0x1f'),_0x0d0a('0x21'));}if(recordings[_0x525887[_0x0d0a('0x17')]]){var _0x28a42c=_['find'](recordings[_0x525887[_0x0d0a('0x17')]][_0x0d0a('0x22')],{'value':_0x525887[_0x0d0a('0x1e')]});if(_[_0x0d0a('0x13')](_0x28a42c)){recordings[_0x525887[_0x0d0a('0x17')]][_0x0d0a('0x22')]['push']({'value':_0x525887[_0x0d0a('0x1e')]});}}}}catch(_0x5c17e9){utils[_0x0d0a('0x10')](util[_0x0d0a('0x4')](_0x0d0a('0x1d'),_0x525887['uniqueid']),_0x5c17e9);}};exports[_0x0d0a('0x23')]=function(_0x2692fd){try{if(!_[_0x0d0a('0x13')](recordings[_0x2692fd['uniqueid']])){utils['debug'](util[_0x0d0a('0x4')]('[%s][recordings][hangup]',_0x2692fd['uniqueid']),_0x2692fd);utils['info'](util['format'](_0x0d0a('0x24'),_0x2692fd['uniqueid'],_0x2692fd[_0x0d0a('0x25')],_0x2692fd[_0x0d0a('0x26')],_0x2692fd[_0x0d0a('0x27')]));recordings[_0x2692fd['uniqueid']][_0x0d0a('0x25')]=_0x2692fd['calleridnum'];recordings[_0x2692fd['uniqueid']][_0x0d0a('0x26')]=_0x2692fd[_0x0d0a('0x26')];recordings[_0x2692fd[_0x0d0a('0x6')]]['connectedlinenum']=_0x2692fd[_0x0d0a('0x28')];recordings[_0x2692fd['uniqueid']][_0x0d0a('0x29')]=_0x2692fd[_0x0d0a('0x29')];if(recordings[_0x2692fd[_0x0d0a('0x6')]]['type']==_0x0d0a('0x2a')&&recordings[_0x2692fd[_0x0d0a('0x6')]][_0x0d0a('0x7')]){recordings[_0x2692fd['uniqueid']][_0x0d0a('0x28')]=recordings[_0x2692fd['uniqueid']]['accountcode'];recordings[_0x2692fd[_0x0d0a('0x6')]][_0x0d0a('0x29')]='';}recordings[_0x2692fd[_0x0d0a('0x6')]][_0x0d0a('0x22')][_0x0d0a('0x2b')](function(_0xa4d6b7){var _0x2f328a=_[_0x0d0a('0x2c')](recordings[_0x2692fd[_0x0d0a('0x6')]]);_0x2f328a[_0x0d0a('0x1e')]=_0xa4d6b7[_0x0d0a('0x1e')];writeDB(_0x2f328a);});delete recordings[_0x2692fd[_0x0d0a('0x6')]];}}catch(_0x57bd82){utils[_0x0d0a('0x10')](util[_0x0d0a('0x4')](_0x0d0a('0x2d'),_0x2692fd['uniqueid']),_0x57bd82);}};exports[_0x0d0a('0x2e')]=function(_0x144b1d){try{if(!_[_0x0d0a('0x13')](recordings[_0x144b1d[_0x0d0a('0x6')]])){utils[_0x0d0a('0xc')](util[_0x0d0a('0x4')](_0x0d0a('0x2f'),_0x144b1d['uniqueid']),_0x144b1d);utils[_0x0d0a('0x3')](util[_0x0d0a('0x4')](_0x0d0a('0x30'),_0x144b1d[_0x0d0a('0x6')],_0x144b1d[_0x0d0a('0x31')],_0x144b1d['appdata']));if(_0x144b1d['application'][_0x0d0a('0x32')]()==_0x0d0a('0x33')&&_[_0x0d0a('0x34')](_0x144b1d['appdata'][_0x0d0a('0x32')](),_0x0d0a('0x35'))){var _0x36a87f=_0x144b1d[_0x0d0a('0x36')][_0x0d0a('0x37')]('=');var _0x5dd1ab=_0x36a87f[0x0][_0x0d0a('0x38')](_0x36a87f[0x0][_0x0d0a('0x39')]('(')+0x1,_0x36a87f[0x0][_0x0d0a('0x39')](')'));var _0x5dc2e3=_0x36a87f[0x1];recordings[_0x144b1d[_0x0d0a('0x6')]][_0x5dd1ab]=_0x5dc2e3;}}}catch(_0x4fd5e4){utils[_0x0d0a('0x10')](util[_0x0d0a('0x4')](_0x0d0a('0x2f'),_0x144b1d[_0x0d0a('0x6')]),_0x4fd5e4);}};exports[_0x0d0a('0x3a')]=function(_0x552787){try{if(!_[_0x0d0a('0x13')](recordings[_0x552787['uniqueid']])){utils[_0x0d0a('0xc')](util['format'](_0x0d0a('0x3b'),_0x552787[_0x0d0a('0x6')]),_0x552787);utils[_0x0d0a('0x3')](util[_0x0d0a('0x4')](_0x0d0a('0x3c'),_0x552787[_0x0d0a('0x6')],_0x552787[_0x0d0a('0x3d')]));recordings[_0x552787[_0x0d0a('0x6')]]['queue']=_0x552787['queue'];}}catch(_0x11cd52){utils[_0x0d0a('0x10')](util[_0x0d0a('0x4')](_0x0d0a('0x3b'),_0x552787['uniqueid']),_0x11cd52);}}; \ No newline at end of file +var _0x9432=['name','UserId','CreateVoiceRecording','request','debug','[%s][recordings][newchannel]','uniqueid','linkedid','info','context','exten','channel','error','newstate','isNil','[%s][recordings][newstate]\x20context:%s\x20channel:%s','channelstate','transfer','varset','variable','mixmonitor_filename','value','endsWith','.wav49','replace','.WAV','find','monitors','push','[%s][recordings][varset]','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','cause-txt','connectedlinenum','connectedlinename','outbound','forEach','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','cdr','substring','lastIndexOf','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','./utils','format','[%s][recordings][writeDB]','accountcode','getUserByInternal','membername'];(function(_0xfc9299,_0x3f9b7e){var _0x1a57c5=function(_0x142b2a){while(--_0x142b2a){_0xfc9299['push'](_0xfc9299['shift']());}};_0x1a57c5(++_0x3f9b7e);}(_0x9432,0x117));var _0x2943=function(_0x394a59,_0x325981){_0x394a59=_0x394a59-0x0;var _0x14652c=_0x9432[_0x394a59];return _0x14652c;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x2943('0x0'));var recordings={};function writeDB(_0x257ca9){utils['info'](util[_0x2943('0x1')](_0x2943('0x2'),_0x257ca9['uniqueid']));if(_0x257ca9[_0x2943('0x3')]){utils[_0x2943('0x4')](_0x257ca9[_0x2943('0x3')])['then'](function(_0x21acd1){if(_0x21acd1){_0x257ca9[_0x2943('0x5')]=_0x21acd1[_0x2943('0x6')];_0x257ca9[_0x2943('0x7')]=_0x21acd1['id'];}utils['request'](_0x2943('0x8'),_0x257ca9);});}else{utils[_0x2943('0x9')]('CreateVoiceRecording',_0x257ca9);}}exports['newchannel']=function(_0x52f102){try{utils[_0x2943('0xa')](util[_0x2943('0x1')](_0x2943('0xb'),_0x52f102['uniqueid']),_0x52f102);if(_0x52f102[_0x2943('0xc')]==_0x52f102[_0x2943('0xd')]){utils[_0x2943('0xe')](util[_0x2943('0x1')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x52f102[_0x2943('0xc')],_0x52f102[_0x2943('0xf')],_0x52f102[_0x2943('0x10')]));recordings[_0x52f102[_0x2943('0xc')]]={'uniqueid':_0x52f102[_0x2943('0xc')],'accountcode':_0x52f102[_0x2943('0x3')],'exten':_0x52f102[_0x2943('0x10')],'context':_0x52f102['context'],'channel':_0x52f102[_0x2943('0x11')],'monitors':[]};}}catch(_0x57dd2e){utils[_0x2943('0x12')](util[_0x2943('0x1')]('[%s][recordings][newchannel]',_0x52f102[_0x2943('0xc')]),_0x57dd2e);}};exports[_0x2943('0x13')]=function(_0x565ca3){try{utils['debug'](util['format']('[%s][recordings][newstate]',_0x565ca3[_0x2943('0xc')]),_0x565ca3);if(!_[_0x2943('0x14')](recordings[_0x565ca3['uniqueid']])&&_0x565ca3['channelstate']==0x6){utils['info'](util[_0x2943('0x1')](_0x2943('0x15'),_0x565ca3['uniqueid'],_0x565ca3['context'],_0x565ca3['channel']));}else if(!_[_0x2943('0x14')](recordings[_0x565ca3[_0x2943('0xd')]])&&_0x565ca3[_0x2943('0x16')]==0x6&&_0x565ca3[_0x2943('0xf')]!=_0x2943('0x17')){utils['info'](util[_0x2943('0x1')]('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x565ca3[_0x2943('0xc')],_0x565ca3[_0x2943('0xd')],_0x565ca3[_0x2943('0xf')],_0x565ca3['channel']));recordings[_0x565ca3[_0x2943('0xd')]]['accountcode']=_0x565ca3[_0x2943('0x3')];}}catch(_0xb83b8c){utils[_0x2943('0x12')](util[_0x2943('0x1')]('[%s][recordings][newstate]',_0x565ca3['uniqueid']),_0xb83b8c);}};exports[_0x2943('0x18')]=function(_0x16ae55){try{if(!_[_0x2943('0x14')](_0x16ae55['variable'])&&!_[_0x2943('0x14')](_0x16ae55[_0x2943('0x19')][_0x2943('0x1a')])){utils[_0x2943('0xa')](util[_0x2943('0x1')]('[%s][recordings][varset]',_0x16ae55[_0x2943('0xc')]),_0x16ae55);utils[_0x2943('0xe')](util[_0x2943('0x1')]('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x16ae55[_0x2943('0xc')],_0x16ae55['variable'],_0x16ae55[_0x2943('0x1b')]));if(_[_0x2943('0x1c')](_0x16ae55[_0x2943('0x1b')],_0x2943('0x1d'))){_0x16ae55[_0x2943('0x1b')]=_0x16ae55[_0x2943('0x1b')][_0x2943('0x1e')](_0x2943('0x1d'),_0x2943('0x1f'));}if(recordings[_0x16ae55['linkedid']]){var _0x5a044=_[_0x2943('0x20')](recordings[_0x16ae55[_0x2943('0xd')]][_0x2943('0x21')],{'value':_0x16ae55[_0x2943('0x1b')]});if(_[_0x2943('0x14')](_0x5a044)){recordings[_0x16ae55[_0x2943('0xd')]][_0x2943('0x21')][_0x2943('0x22')]({'value':_0x16ae55[_0x2943('0x1b')]});}}}}catch(_0x29271b){utils[_0x2943('0x12')](util['format'](_0x2943('0x23'),_0x16ae55[_0x2943('0xc')]),_0x29271b);}};exports['hangup']=function(_0x39401f){try{if(!_[_0x2943('0x14')](recordings[_0x39401f[_0x2943('0xc')]])){utils['debug'](util[_0x2943('0x1')](_0x2943('0x24'),_0x39401f[_0x2943('0xc')]),_0x39401f);utils['info'](util[_0x2943('0x1')](_0x2943('0x25'),_0x39401f[_0x2943('0xc')],_0x39401f[_0x2943('0x26')],_0x39401f['calleridname'],_0x39401f[_0x2943('0x27')]));recordings[_0x39401f[_0x2943('0xc')]][_0x2943('0x26')]=_0x39401f[_0x2943('0x26')];recordings[_0x39401f[_0x2943('0xc')]]['calleridname']=_0x39401f['calleridname'];recordings[_0x39401f['uniqueid']][_0x2943('0x28')]=_0x39401f[_0x2943('0x28')];recordings[_0x39401f[_0x2943('0xc')]][_0x2943('0x29')]=_0x39401f[_0x2943('0x29')];if(recordings[_0x39401f[_0x2943('0xc')]]['type']==_0x2943('0x2a')&&recordings[_0x39401f['uniqueid']][_0x2943('0x3')]){recordings[_0x39401f[_0x2943('0xc')]]['connectedlinenum']=recordings[_0x39401f[_0x2943('0xc')]]['accountcode'];recordings[_0x39401f[_0x2943('0xc')]]['connectedlinename']='';}recordings[_0x39401f[_0x2943('0xc')]][_0x2943('0x21')][_0x2943('0x2b')](function(_0x584d90){var _0x3f8dc8=_[_0x2943('0x2c')](recordings[_0x39401f[_0x2943('0xc')]]);_0x3f8dc8[_0x2943('0x1b')]=_0x584d90[_0x2943('0x1b')];writeDB(_0x3f8dc8);});delete recordings[_0x39401f[_0x2943('0xc')]];}}catch(_0x5c20bd){utils[_0x2943('0x12')](util[_0x2943('0x1')]('[%s][recordings][hangup]',_0x39401f[_0x2943('0xc')]),_0x5c20bd);}};exports[_0x2943('0x2d')]=function(_0x293212){try{if(!_['isNil'](recordings[_0x293212[_0x2943('0xc')]])){utils[_0x2943('0xa')](util[_0x2943('0x1')](_0x2943('0x2e'),_0x293212[_0x2943('0xc')]),_0x293212);utils[_0x2943('0xe')](util[_0x2943('0x1')](_0x2943('0x2f'),_0x293212[_0x2943('0xc')],_0x293212[_0x2943('0x30')],_0x293212[_0x2943('0x31')]));if(_0x293212['application']['toLowerCase']()==_0x2943('0x32')&&_['startsWith'](_0x293212[_0x2943('0x31')]['toLowerCase'](),_0x2943('0x33'))){var _0x187d30=_0x293212[_0x2943('0x31')]['split']('=');var _0x219281=_0x187d30[0x0][_0x2943('0x34')](_0x187d30[0x0][_0x2943('0x35')]('(')+0x1,_0x187d30[0x0][_0x2943('0x35')](')'));var _0x198818=_0x187d30[0x1];recordings[_0x293212[_0x2943('0xc')]][_0x219281]=_0x198818;}}}catch(_0x301874){utils[_0x2943('0x12')](util[_0x2943('0x1')](_0x2943('0x2e'),_0x293212[_0x2943('0xc')]),_0x301874);}};exports['queuecallerjoin']=function(_0x2f5ddb){try{if(!_[_0x2943('0x14')](recordings[_0x2f5ddb[_0x2943('0xc')]])){utils[_0x2943('0xa')](util['format'](_0x2943('0x36'),_0x2f5ddb[_0x2943('0xc')]),_0x2f5ddb);utils[_0x2943('0xe')](util[_0x2943('0x1')](_0x2943('0x37'),_0x2f5ddb[_0x2943('0xc')],_0x2f5ddb[_0x2943('0x38')]));recordings[_0x2f5ddb[_0x2943('0xc')]][_0x2943('0x38')]=_0x2f5ddb['queue'];}}catch(_0x593b6b){utils['error'](util[_0x2943('0x1')](_0x2943('0x36'),_0x2f5ddb['uniqueid']),_0x593b6b);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 6fbf20a..a2ceef1 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 _0xfc15=['origtransfereruniqueid','uniqueid','type','CreateVoiceTransferReport','blinds','blindtransfer','debug','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','transfereruniqueid','error','attendedtransfer','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','origtransfereraccountcode','secondtransferercontext','origtransfererexten','isNil','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','[%s][transfers][attendedtransfer]','lodash','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','attended'];(function(_0x377e7a,_0x19a2ed){var _0x21aa22=function(_0x526a26){while(--_0x526a26){_0x377e7a['push'](_0x377e7a['shift']());}};_0x21aa22(++_0x19a2ed);}(_0xfc15,0x7a));var _0x5fc1=function(_0x62c958,_0x2bfdbc){_0x62c958=_0x62c958-0x0;var _0x57ec61=_0xfc15[_0x62c958];return _0x57ec61;};'use strict';var _=require(_0x5fc1('0x0'));var util=require(_0x5fc1('0x1'));var utils=require(_0x5fc1('0x2'));function writeDB(_0x4c9119){utils[_0x5fc1('0x3')](util[_0x5fc1('0x4')](_0x5fc1('0x5'),_0x4c9119['type']===_0x5fc1('0x6')?_0x4c9119[_0x5fc1('0x7')]:_0x4c9119[_0x5fc1('0x8')],_0x4c9119[_0x5fc1('0x9')]));utils['request'](_0x5fc1('0xa'),_0x4c9119);}exports[_0x5fc1('0xb')]={};exports[_0x5fc1('0xc')]=function(_0x3d791e){try{utils[_0x5fc1('0xd')](util[_0x5fc1('0x4')](_0x5fc1('0xe'),_0x3d791e[_0x5fc1('0x8')]),_0x3d791e);utils[_0x5fc1('0x3')](util[_0x5fc1('0x4')](_0x5fc1('0xf'),_0x3d791e['uniqueid'],_0x3d791e[_0x5fc1('0x10')],_0x3d791e[_0x5fc1('0x11')],_0x3d791e[_0x5fc1('0x12')],_0x3d791e[_0x5fc1('0x13')]));_0x3d791e['type']=_0x5fc1('0x14');exports[_0x5fc1('0xb')][_0x3d791e[_0x5fc1('0x15')]]=_0x3d791e;writeDB(_0x3d791e);}catch(_0x3794bb){utils[_0x5fc1('0x16')](util['format']('[%s][transfers][blindtransfer]',_0x3d791e[_0x5fc1('0x8')]),_0x3794bb);}};exports[_0x5fc1('0x17')]=function(_0x247697){try{utils[_0x5fc1('0xd')](util[_0x5fc1('0x4')]('[%s][transfers][attendedtransfer]',_0x247697[_0x5fc1('0x7')]),_0x247697);utils[_0x5fc1('0x3')](util[_0x5fc1('0x4')](_0x5fc1('0x18'),_0x247697['origtransfereruniqueid'],_0x247697[_0x5fc1('0x19')],_0x247697[_0x5fc1('0x1a')],_0x247697[_0x5fc1('0x1b')],_0x247697[_0x5fc1('0x1c')]));_0x247697=_[_0x5fc1('0x1d')](_0x247697,{'transfererchannel':_0x247697[_0x5fc1('0x1e')],'transferercalleridnum':_0x247697[_0x5fc1('0x19')],'transferercalleridname':_0x247697[_0x5fc1('0x1a')],'transfererconnectedlinenum':_0x247697['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x247697['secondtransfererconnectedlinename'],'transfereraccountcode':_0x247697[_0x5fc1('0x1f')],'transferercontext':_0x247697[_0x5fc1('0x20')],'transfererexten':_0x247697['secondtransfererexten'],'transfererlinkedid':_0x247697['origtransfererlinkedid'],'context':_0x247697['origtransferercontext'],'extension':_0x247697[_0x5fc1('0x21')],'type':'attended'});if(_[_0x5fc1('0x22')](_0x247697['transfereechannel'])){_0x247697=_['assign'](_0x247697,{'transfereechannel':_0x247697[_0x5fc1('0x23')],'transfereecalleridnum':_0x247697[_0x5fc1('0x1b')],'transfereecalleridname':_0x247697[_0x5fc1('0x1c')],'transfereeconnectedlinenum':_0x247697[_0x5fc1('0x24')],'transfereeconnectedlinename':_0x247697[_0x5fc1('0x25')],'transfereeaccountcode':_0x247697[_0x5fc1('0x26')],'transfereecontext':_0x247697[_0x5fc1('0x27')],'transfereeexten':_0x247697[_0x5fc1('0x28')],'transfereelinkedid':_0x247697[_0x5fc1('0x29')]});}writeDB(_0x247697);}catch(_0x442f86){utils[_0x5fc1('0x16')](util[_0x5fc1('0x4')](_0x5fc1('0x2a'),_0x247697[_0x5fc1('0x7')]),_0x442f86);}}; \ No newline at end of file +var _0x9561=['blind','transfereruniqueid','error','debug','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransferercontext','origtransfererexten','attended','isNil','transfertargetchannel','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','transfertargetexten','util','info','format','[%s][transfers][writeDB]\x20type:%s','type','origtransfereruniqueid','uniqueid','blinds','blindtransfer','[%s][transfers][blindtransfer]','transferercalleridnum','transferercalleridname','transfereecalleridname'];(function(_0x4ca325,_0x4e8c91){var _0x382fbd=function(_0x23710f){while(--_0x23710f){_0x4ca325['push'](_0x4ca325['shift']());}};_0x382fbd(++_0x4e8c91);}(_0x9561,0x1bb));var _0x1956=function(_0x21546d,_0x447721){_0x21546d=_0x21546d-0x0;var _0x8c6176=_0x9561[_0x21546d];return _0x8c6176;};'use strict';var _=require('lodash');var util=require(_0x1956('0x0'));var utils=require('./utils');function writeDB(_0x27c1f4){utils[_0x1956('0x1')](util[_0x1956('0x2')](_0x1956('0x3'),_0x27c1f4[_0x1956('0x4')]==='attended'?_0x27c1f4[_0x1956('0x5')]:_0x27c1f4[_0x1956('0x6')],_0x27c1f4['type']));utils['request']('CreateVoiceTransferReport',_0x27c1f4);}exports[_0x1956('0x7')]={};exports[_0x1956('0x8')]=function(_0x4398c4){try{utils['debug'](util['format'](_0x1956('0x9'),_0x4398c4[_0x1956('0x6')]),_0x4398c4);utils[_0x1956('0x1')](util[_0x1956('0x2')]('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x4398c4[_0x1956('0x6')],_0x4398c4[_0x1956('0xa')],_0x4398c4[_0x1956('0xb')],_0x4398c4['transfereecalleridnum'],_0x4398c4[_0x1956('0xc')]));_0x4398c4[_0x1956('0x4')]=_0x1956('0xd');exports[_0x1956('0x7')][_0x4398c4[_0x1956('0xe')]]=_0x4398c4;writeDB(_0x4398c4);}catch(_0x158aab){utils[_0x1956('0xf')](util[_0x1956('0x2')](_0x1956('0x9'),_0x4398c4['uniqueid']),_0x158aab);}};exports['attendedtransfer']=function(_0x38b16a){try{utils[_0x1956('0x10')](util[_0x1956('0x2')](_0x1956('0x11'),_0x38b16a[_0x1956('0x5')]),_0x38b16a);utils[_0x1956('0x1')](util[_0x1956('0x2')](_0x1956('0x12'),_0x38b16a[_0x1956('0x5')],_0x38b16a[_0x1956('0x13')],_0x38b16a['origtransferercalleridname'],_0x38b16a[_0x1956('0x14')],_0x38b16a[_0x1956('0x15')]));_0x38b16a=_[_0x1956('0x16')](_0x38b16a,{'transfererchannel':_0x38b16a[_0x1956('0x17')],'transferercalleridnum':_0x38b16a['origtransferercalleridnum'],'transferercalleridname':_0x38b16a[_0x1956('0x18')],'transfererconnectedlinenum':_0x38b16a[_0x1956('0x19')],'transfererconnectedlinename':_0x38b16a[_0x1956('0x1a')],'transfereraccountcode':_0x38b16a[_0x1956('0x1b')],'transferercontext':_0x38b16a[_0x1956('0x1c')],'transfererexten':_0x38b16a['secondtransfererexten'],'transfererlinkedid':_0x38b16a['origtransfererlinkedid'],'context':_0x38b16a[_0x1956('0x1d')],'extension':_0x38b16a[_0x1956('0x1e')],'type':_0x1956('0x1f')});if(_[_0x1956('0x20')](_0x38b16a['transfereechannel'])){_0x38b16a=_['assign'](_0x38b16a,{'transfereechannel':_0x38b16a[_0x1956('0x21')],'transfereecalleridnum':_0x38b16a['transfertargetcalleridnum'],'transfereecalleridname':_0x38b16a[_0x1956('0x15')],'transfereeconnectedlinenum':_0x38b16a[_0x1956('0x22')],'transfereeconnectedlinename':_0x38b16a['transfertargetconnectedlinename'],'transfereeaccountcode':_0x38b16a[_0x1956('0x23')],'transfereecontext':_0x38b16a[_0x1956('0x24')],'transfereeexten':_0x38b16a[_0x1956('0x25')],'transfereelinkedid':_0x38b16a['transfertargetlinkedid']});}writeDB(_0x38b16a);}catch(_0x58c115){utils[_0x1956('0xf')](util[_0x1956('0x2')](_0x1956('0x11'),_0x38b16a[_0x1956('0x5')]),_0x58c115);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 8dc2d64..7cf93ce 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 _0x6666=['diffTime','diff','sumTime','isAfter','isBefore','bluebird','util','client','http','../../config/logger','xdr','info','inspect','error','request','then','debug','catch','name','interface','result','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','found','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','notfound','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','acw','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','length','addTime','add','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','seconds'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6666,0x1c7));var _0x6666=function(_0x3ff4a3,_0xa5bfa6){_0x3ff4a3=_0x3ff4a3-0x0;var _0x38676f=_0x6666[_0x3ff4a3];return _0x38676f;};'use strict';var BPromise=require(_0x6666('0x0'));var jayson=require('jayson/promise');var moment=require('moment');var util=require(_0x6666('0x1'));var client=jayson[_0x6666('0x2')][_0x6666('0x3')]({'port':0x2329});var logger=require(_0x6666('0x4'))(_0x6666('0x5'));exports[_0x6666('0x6')]=function(_0x35f510,_0x5f7258){logger['info'](_0x35f510,_0x5f7258?util[_0x6666('0x7')](_0x5f7258,{'showHidden':![],'depth':null}):'');};exports['debug']=function(_0x2d4070,_0x7b5dec){logger['debug'](_0x2d4070,_0x7b5dec?util[_0x6666('0x7')](_0x7b5dec,{'showHidden':![],'depth':null}):'');};exports[_0x6666('0x8')]=function(_0x1aad67,_0xcee857){logger['error'](_0x1aad67,_0xcee857?util[_0x6666('0x7')](_0xcee857,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0x41212d,_0x401100){return client[_0x6666('0x9')](_0x41212d,{'body':_0x401100})[_0x6666('0xa')](function(_0x30843e){logger[_0x6666('0xb')]('[utils][request]\x20name:%s',_0x41212d,_0x30843e?util['inspect'](_0x30843e,{'showHidden':![],'depth':null}):'');})[_0x6666('0xc')](function(_0x1a9364){logger[_0x6666('0x8')]('[utils][request]\x20name:%s',_0x41212d,_0x1a9364?util['inspect'](_0x1a9364,{'showHidden':![],'depth':null}):'');});};function getUser(_0x137758){return client[_0x6666('0x9')]('GetUser',{'options':{'raw':!![],'attributes':['id','internal',_0x6666('0xd'),_0x6666('0xe')],'where':_0x137758,'limit':0x1}})[_0x6666('0xa')](function(_0x5500ae){logger['debug']('[utils][getUser]\x20where:%s',JSON['stringify'](_0x137758),_0x5500ae?util['inspect'](_0x5500ae,{'showHidden':![],'depth':null}):'');return _0x5500ae['result']['length']?_0x5500ae[_0x6666('0xf')][0x0]:null;});}exports[_0x6666('0x10')]=function(_0x3842d3){return new BPromise(function(_0x3e88fd,_0x5d3374){if(_0x3842d3){return getUser({'internal':_0x3842d3})[_0x6666('0xa')](function(_0x449d20){logger[_0x6666('0x6')](_0x6666('0x11'),_0x3842d3,_0x449d20?'found':'notfound');return _0x3e88fd(_0x449d20);})[_0x6666('0xc')](function(_0x386f8e){logger['error']('[utils][getUserByInternal]',_0x386f8e?util[_0x6666('0x7')](_0x386f8e,{'showHidden':![],'depth':null}):'');return _0x3e88fd(null);});}return _0x3e88fd(null);});};exports[_0x6666('0x12')]=function(_0x415d09){return new BPromise(function(_0x56ec7b,_0x159675){if(_0x415d09){return getUser({'interface':_0x415d09})[_0x6666('0xa')](function(_0x2c2711){logger[_0x6666('0x6')](_0x6666('0x13'),_0x415d09,_0x2c2711?_0x6666('0x14'):'notfound');return _0x56ec7b(_0x2c2711);})['catch'](function(_0x249f9f){logger[_0x6666('0x8')](_0x6666('0x15'),_0x249f9f?util[_0x6666('0x7')](_0x249f9f,{'showHidden':![],'depth':null}):'');return _0x56ec7b(null);});}return _0x56ec7b(null);});};exports[_0x6666('0x16')]=function(_0x136ce8){return new BPromise(function(_0x13baa6,_0x1cd21b){if(_0x136ce8){return getUser({'name':_0x136ce8})['then'](function(_0x3a2972){logger[_0x6666('0x6')](_0x6666('0x17'),_0x136ce8,_0x3a2972?_0x6666('0x14'):_0x6666('0x18'));return _0x13baa6(_0x3a2972);})[_0x6666('0xc')](function(_0x136444){logger[_0x6666('0x8')](_0x6666('0x19'),_0x136444?util[_0x6666('0x7')](_0x136444,{'showHidden':![],'depth':null}):'');return _0x13baa6(null);});}return _0x13baa6(null);});};exports[_0x6666('0x1a')]=function(_0x2a51ef){return new BPromise(function(_0x3f7718,_0x58a39b){if(_0x2a51ef){return client[_0x6666('0x9')](_0x6666('0x1b'),{'options':{'raw':!![],'attributes':['id',_0x6666('0xd'),_0x6666('0x1c'),_0x6666('0x1d'),'acwTimeout'],'where':{'name':_0x2a51ef},'limit':0x1}})['then'](function(_0x19f0bf){logger['debug'](_0x6666('0x1e'),_0x2a51ef,_0x19f0bf?util[_0x6666('0x7')](_0x19f0bf,{'showHidden':![],'depth':null}):'');logger[_0x6666('0x6')](_0x6666('0x1f'),_0x2a51ef,_0x19f0bf?_0x6666('0x14'):_0x6666('0x18'));return _0x3f7718(_0x19f0bf[_0x6666('0xf')][_0x6666('0x20')]?_0x19f0bf['result'][0x0]:null);})[_0x6666('0xc')](function(_0x3aeaf0){logger[_0x6666('0x8')]('[utils][getVoiceQueueByName]',_0x3aeaf0?util[_0x6666('0x7')](_0x3aeaf0,{'showHidden':![],'depth':null}):'');return _0x3f7718(null);});}return _0x3f7718(null);});};exports[_0x6666('0x21')]=function(_0x2cae99,_0x2ae6ef){return moment(_0x2cae99)[_0x6666('0x22')](_0x2ae6ef,'seconds')[_0x6666('0x23')](_0x6666('0x24'));};exports[_0x6666('0x25')]=function(_0xe9c258,_0x4fa948){return moment(_0xe9c258)[_0x6666('0x26')](_0x4fa948,_0x6666('0x27'))[_0x6666('0x23')](_0x6666('0x24'));};exports[_0x6666('0x28')]=function(_0x35079c,_0x244745){return moment(_0x35079c)[_0x6666('0x29')](moment(_0x244745),_0x6666('0x27'));};exports[_0x6666('0x2a')]=function(_0x19f0f1,_0x3d1d25){return parseInt(_0x19f0f1,0xa)+parseInt(_0x3d1d25,0xa);};exports['now']=function(){return moment()[_0x6666('0x23')](_0x6666('0x24'));};exports['isAfter']=function(_0x1f6293,_0x5b4757){if(_0x5b4757){return moment(_0x1f6293)[_0x6666('0x2b')](_0x5b4757);}return!![];};exports[_0x6666('0x2c')]=function(_0x4ffae8,_0x269e39){if(_0x269e39){return moment(_0x4ffae8)[_0x6666('0x2c')](_0x269e39);}else if(_0x4ffae8){return!![];}return![];}; \ No newline at end of file +var _0x0974=['sumTime','now','isAfter','isBefore','util','client','info','inspect','debug','error','request','then','catch','[utils][request]\x20name:%s','interface','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','name','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','format','seconds','YYYY-MM-DD\x20HH:mm:ss','diff'];(function(_0x4391b0,_0x958f3){var _0x43776b=function(_0x399b9b){while(--_0x399b9b){_0x4391b0['push'](_0x4391b0['shift']());}};_0x43776b(++_0x958f3);}(_0x0974,0xb0));var _0x4097=function(_0x7a1163,_0x1d963c){_0x7a1163=_0x7a1163-0x0;var _0x1ae182=_0x0974[_0x7a1163];return _0x1ae182;};'use strict';var BPromise=require('bluebird');var jayson=require('jayson/promise');var moment=require('moment');var util=require(_0x4097('0x0'));var client=jayson[_0x4097('0x1')]['http']({'port':0x2329});var logger=require('../../config/logger')('xdr');exports[_0x4097('0x2')]=function(_0x16781f,_0x11898f){logger['info'](_0x16781f,_0x11898f?util[_0x4097('0x3')](_0x11898f,{'showHidden':![],'depth':null}):'');};exports[_0x4097('0x4')]=function(_0x54595d,_0x1acf18){logger['debug'](_0x54595d,_0x1acf18?util['inspect'](_0x1acf18,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x48a341,_0x3a1acb){logger[_0x4097('0x5')](_0x48a341,_0x3a1acb?util[_0x4097('0x3')](_0x3a1acb,{'showHidden':![],'depth':null}):'');};exports[_0x4097('0x6')]=function(_0x107328,_0xf4b2df){return client[_0x4097('0x6')](_0x107328,{'body':_0xf4b2df})[_0x4097('0x7')](function(_0x3cd9ba){logger[_0x4097('0x4')]('[utils][request]\x20name:%s',_0x107328,_0x3cd9ba?util[_0x4097('0x3')](_0x3cd9ba,{'showHidden':![],'depth':null}):'');})[_0x4097('0x8')](function(_0x582223){logger[_0x4097('0x5')](_0x4097('0x9'),_0x107328,_0x582223?util[_0x4097('0x3')](_0x582223,{'showHidden':![],'depth':null}):'');});};function getUser(_0x59c97f){return client[_0x4097('0x6')]('GetUser',{'options':{'raw':!![],'attributes':['id','internal','name',_0x4097('0xa')],'where':_0x59c97f,'limit':0x1}})[_0x4097('0x7')](function(_0x5caf09){logger[_0x4097('0x4')](_0x4097('0xb'),JSON[_0x4097('0xc')](_0x59c97f),_0x5caf09?util[_0x4097('0x3')](_0x5caf09,{'showHidden':![],'depth':null}):'');return _0x5caf09[_0x4097('0xd')][_0x4097('0xe')]?_0x5caf09[_0x4097('0xd')][0x0]:null;});}exports[_0x4097('0xf')]=function(_0x184f15){return new BPromise(function(_0x47342c,_0x16444a){if(_0x184f15){return getUser({'internal':_0x184f15})[_0x4097('0x7')](function(_0x36ad00){logger[_0x4097('0x2')](_0x4097('0x10'),_0x184f15,_0x36ad00?_0x4097('0x11'):_0x4097('0x12'));return _0x47342c(_0x36ad00);})[_0x4097('0x8')](function(_0x588b2a){logger[_0x4097('0x5')](_0x4097('0x13'),_0x588b2a?util['inspect'](_0x588b2a,{'showHidden':![],'depth':null}):'');return _0x47342c(null);});}return _0x47342c(null);});};exports['getUserByInterface']=function(_0x3940d5){return new BPromise(function(_0x417823,_0xc10bff){if(_0x3940d5){return getUser({'interface':_0x3940d5})[_0x4097('0x7')](function(_0x3bb4e2){logger[_0x4097('0x2')](_0x4097('0x14'),_0x3940d5,_0x3bb4e2?_0x4097('0x11'):_0x4097('0x12'));return _0x417823(_0x3bb4e2);})[_0x4097('0x8')](function(_0x32857b){logger['error'](_0x4097('0x15'),_0x32857b?util['inspect'](_0x32857b,{'showHidden':![],'depth':null}):'');return _0x417823(null);});}return _0x417823(null);});};exports[_0x4097('0x16')]=function(_0x4e564a){return new BPromise(function(_0x388f94,_0x9b111){if(_0x4e564a){return getUser({'name':_0x4e564a})[_0x4097('0x7')](function(_0x47d01c){logger['info'](_0x4097('0x17'),_0x4e564a,_0x47d01c?_0x4097('0x11'):_0x4097('0x12'));return _0x388f94(_0x47d01c);})[_0x4097('0x8')](function(_0x1751a2){logger[_0x4097('0x5')](_0x4097('0x18'),_0x1751a2?util['inspect'](_0x1751a2,{'showHidden':![],'depth':null}):'');return _0x388f94(null);});}return _0x388f94(null);});};exports[_0x4097('0x19')]=function(_0x4c1ef1){return new BPromise(function(_0x301754,_0x51a60a){if(_0x4c1ef1){return client[_0x4097('0x6')](_0x4097('0x1a'),{'options':{'raw':!![],'attributes':['id',_0x4097('0x1b'),_0x4097('0x1c'),_0x4097('0x1d'),_0x4097('0x1e')],'where':{'name':_0x4c1ef1},'limit':0x1}})[_0x4097('0x7')](function(_0x5e697f){logger[_0x4097('0x4')](_0x4097('0x1f'),_0x4c1ef1,_0x5e697f?util[_0x4097('0x3')](_0x5e697f,{'showHidden':![],'depth':null}):'');logger['info'](_0x4097('0x20'),_0x4c1ef1,_0x5e697f?_0x4097('0x11'):_0x4097('0x12'));return _0x301754(_0x5e697f[_0x4097('0xd')][_0x4097('0xe')]?_0x5e697f[_0x4097('0xd')][0x0]:null);})[_0x4097('0x8')](function(_0x3f1c2f){logger[_0x4097('0x5')](_0x4097('0x21'),_0x3f1c2f?util[_0x4097('0x3')](_0x3f1c2f,{'showHidden':![],'depth':null}):'');return _0x301754(null);});}return _0x301754(null);});};exports[_0x4097('0x22')]=function(_0x113932,_0x254101){return moment(_0x113932)['add'](_0x254101,'seconds')[_0x4097('0x23')]('YYYY-MM-DD\x20HH:mm:ss');};exports['subtractTime']=function(_0x4e1ab3,_0x22af66){return moment(_0x4e1ab3)['subtract'](_0x22af66,_0x4097('0x24'))[_0x4097('0x23')](_0x4097('0x25'));};exports['diffTime']=function(_0x2b0f32,_0x49b182){return moment(_0x2b0f32)[_0x4097('0x26')](moment(_0x49b182),_0x4097('0x24'));};exports[_0x4097('0x27')]=function(_0x5bb954,_0x13b918){return parseInt(_0x5bb954,0xa)+parseInt(_0x13b918,0xa);};exports[_0x4097('0x28')]=function(){return moment()[_0x4097('0x23')](_0x4097('0x25'));};exports[_0x4097('0x29')]=function(_0xc86361,_0x24db39){if(_0x24db39){return moment(_0xc86361)[_0x4097('0x29')](_0x24db39);}return!![];};exports[_0x4097('0x2a')]=function(_0x35c77a,_0x168e57){if(_0x168e57){return moment(_0x35c77a)[_0x4097('0x2a')](_0x168e57);}else if(_0x35c77a){return!![];}return![];}; \ No newline at end of file -- 1.7.1